From: Andrea Cuccaro Date: Thu, 5 Mar 2020 11:37:27 +0000 (+0100) Subject: Built motion from commit (unavailable).|2.4.4 X-Git-Url: http://repos.xcallymotion.com/base//%22%7B%7Blicense.openchannel?a=commitdiff_plain;h=e423b4a697180edbec667fd39ebd8986ef13d29a;p=motion2.git Built motion from commit (unavailable).|2.4.4 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 897cfb0..a4331fa 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-03-05T10:59:39.072Z", "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-03-05T11:27:36.260Z", "url": "http://apidocjs.com", "version": "0.17.7" } }); diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 240a9a8..863fc0f 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-03-05T10:59:39.072Z", "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-03-05T11:27:36.260Z", "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 ab8ed72..b526585 100644 --- a/server/api/action/action.attributes.js +++ b/server/api/action/action.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['STRING','contactManager','integration','motionbar','jscripty','urlForward','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','exports','VIRTUAL','action'];(function(_0x1ac02a,_0x2a073f){var _0x5ce590=function(_0x9c63f9){while(--_0x9c63f9){_0x1ac02a['push'](_0x1ac02a['shift']());}};_0x5ce590(++_0x2a073f);}(_0x34e8,0x12c));var _0x834e=function(_0x389e72,_0x5b62d1){_0x389e72=_0x389e72-0x0;var _0xee83db=_0x34e8[_0x389e72];return _0xee83db;};'use strict';var Sequelize=require(_0x834e('0x0'));module[_0x834e('0x1')]={'name':{'type':Sequelize[_0x834e('0x2')],'get':function(_0x35e6fb){return this['getDataValue'](_0x834e('0x3'));}},'action':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x834e('0x5'),_0x834e('0x6'),_0x834e('0x7'),_0x834e('0x8'),_0x834e('0x9'),'browser',_0x834e('0xa'),'script']],'msg':_0x834e('0xb')}},'comment':_0x834e('0xb')},'data1':{'type':Sequelize[_0x834e('0x4')](0x1000),'comment':_0x834e('0xc')},'data2':{'type':Sequelize[_0x834e('0x4')](0x1000),'comment':_0x834e('0xd')},'data3':{'type':Sequelize[_0x834e('0x4')](0x1000),'comment':_0x834e('0xe')},'data4':{'type':Sequelize[_0x834e('0x4')](0x1000)},'data5':{'type':Sequelize[_0x834e('0x4')](0x1000)},'data6':{'type':Sequelize[_0x834e('0x4')]},'data7':{'type':Sequelize[_0x834e('0xf')]}}; \ No newline at end of file +var _0x9957=['integration','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)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','exports','VIRTUAL','action','STRING','contactManager'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'get':function(_0x10a05d){return this['getDataValue'](_0x7995('0x3'));}},'action':{'type':Sequelize[_0x7995('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x7995('0x5'),_0x7995('0x6'),'motionbar',_0x7995('0x7'),_0x7995('0x8'),_0x7995('0x9'),_0x7995('0xa'),_0x7995('0xb')]],'msg':_0x7995('0xc')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x7995('0x4')](0x1000),'comment':_0x7995('0xd')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x7995('0xe')},'data3':{'type':Sequelize[_0x7995('0x4')](0x1000),'comment':_0x7995('0xf')},'data4':{'type':Sequelize[_0x7995('0x4')](0x1000)},'data5':{'type':Sequelize[_0x7995('0x4')](0x1000)},'data6':{'type':Sequelize[_0x7995('0x4')]},'data7':{'type':Sequelize[_0x7995('0x10')]}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index ffcfbfc..ce794f6 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 _0x14a0=['request-promise','moment','bluebird','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','name','body','Action','find','params','catch','html-pdf','eml-format','zip-dir','fast-json-patch'];(function(_0x329e42,_0x4d6570){var _0x3b891c=function(_0x1e37cc){while(--_0x1e37cc){_0x329e42['push'](_0x329e42['shift']());}};_0x3b891c(++_0x4d6570);}(_0x14a0,0x16c));var _0x014a=function(_0xa602fd,_0x52a378){_0xa602fd=_0xa602fd-0x0;var _0xbb0bd0=_0x14a0[_0xa602fd];return _0xbb0bd0;};'use strict';var pdf=require(_0x014a('0x0'));var emlformat=require(_0x014a('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x014a('0x2'));var jsonpatch=require(_0x014a('0x3'));var rp=require(_0x014a('0x4'));var moment=require(_0x014a('0x5'));var BPromise=require(_0x014a('0x6'));var Mustache=require('mustache');var util=require(_0x014a('0x7'));var path=require(_0x014a('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x014a('0x9'));var fs=require('fs');var _=require(_0x014a('0xa'));var squel=require(_0x014a('0xb'));var crypto=require(_0x014a('0xc'));var jsforce=require(_0x014a('0xd'));var deskjs=require(_0x014a('0xe'));var toCsv=require(_0x014a('0xf'));var querystring=require(_0x014a('0x10'));var Papa=require('papaparse');var Redis=require(_0x014a('0x11'));var authService=require(_0x014a('0x12'));var qs=require(_0x014a('0x13'));var hardwareService=require(_0x014a('0x14'));var logger=require('../../config/logger')(_0x014a('0x15'));var utils=require(_0x014a('0x16'));var config=require(_0x014a('0x17'));var db=require(_0x014a('0x18'))['db'];function respondWithStatusCode(_0x663dd2,_0x1d94ba){_0x1d94ba=_0x1d94ba||0xcc;return function(_0x3e9c21){if(_0x3e9c21){return _0x663dd2[_0x014a('0x19')](_0x1d94ba);}return _0x663dd2[_0x014a('0x1a')](_0x1d94ba)[_0x014a('0x1b')]();};}function respondWithResult(_0x5705b7,_0x1b25d5){_0x1b25d5=_0x1b25d5||0xc8;return function(_0x12af2e){if(_0x12af2e){return _0x5705b7[_0x014a('0x1a')](_0x1b25d5)[_0x014a('0x1c')](_0x12af2e);}};}function respondWithFilteredResult(_0x3ab209,_0x4b78c4){return function(_0x6b1017){if(_0x6b1017){var _0x53a481=_0x6b1017[_0x014a('0x1d')],_0x562abe=_0x4b78c4[_0x014a('0x1e')],_0x19a735=_0x4b78c4[_0x014a('0x1e')]+_0x4b78c4[_0x014a('0x1f')],_0x310c9d;if(_0x19a735>=_0x53a481){_0x19a735=_0x53a481;_0x310c9d=0xc8;}else{_0x310c9d=0xce;}_0x3ab209[_0x014a('0x1a')](_0x310c9d);return _0x3ab209[_0x014a('0x20')](_0x014a('0x21'),_0x562abe+'-'+_0x19a735+'/'+_0x53a481)['json'](_0x6b1017);}return null;};}function patchUpdates(_0x465d8a){return function(_0x3ca662){try{jsonpatch[_0x014a('0x22')](_0x3ca662,_0x465d8a,!![]);}catch(_0x1ce3cc){return BPromise['reject'](_0x1ce3cc);}return _0x3ca662[_0x014a('0x23')]();};}function saveUpdates(_0xe5e5e4,_0x500bbf){return function(_0x1734a8){if(_0x1734a8){return _0x1734a8[_0x014a('0x24')](_0xe5e5e4)[_0x014a('0x25')](function(_0x15b41e){return _0x15b41e;});}return null;};}function removeEntity(_0x18d419,_0x3d9825){return function(_0x44698b){if(_0x44698b){return _0x44698b[_0x014a('0x26')]()['then'](function(){_0x18d419[_0x014a('0x1a')](0xcc)[_0x014a('0x1b')]();});}};}function handleEntityNotFound(_0x56684c,_0x48fb68){return function(_0x57c0e8){if(!_0x57c0e8){_0x56684c[_0x014a('0x19')](0x194);}return _0x57c0e8;};}function handleError(_0x4ff88f,_0x3727d9){_0x3727d9=_0x3727d9||0x1f4;return function(_0x408719){logger[_0x014a('0x27')](_0x408719['stack']);if(_0x408719['name']){delete _0x408719[_0x014a('0x28')];}_0x4ff88f[_0x014a('0x1a')](_0x3727d9)['send'](_0x408719);};}exports[_0x014a('0x24')]=function(_0x4e70fa,_0x55e8b3){if(_0x4e70fa[_0x014a('0x29')]['id']){delete _0x4e70fa['body']['id'];}return db[_0x014a('0x2a')][_0x014a('0x2b')]({'where':{'id':_0x4e70fa[_0x014a('0x2c')]['id']}})[_0x014a('0x25')](handleEntityNotFound(_0x55e8b3,null))[_0x014a('0x25')](saveUpdates(_0x4e70fa[_0x014a('0x29')],null))[_0x014a('0x25')](respondWithResult(_0x55e8b3,null))[_0x014a('0x2d')](handleError(_0x55e8b3,null));};exports['destroy']=function(_0x208503,_0x4a2a38){return db[_0x014a('0x2a')][_0x014a('0x2b')]({'where':{'id':_0x208503[_0x014a('0x2c')]['id']}})[_0x014a('0x25')](handleEntityNotFound(_0x4a2a38,null))[_0x014a('0x25')](removeEntity(_0x4a2a38,null))[_0x014a('0x2d')](handleError(_0x4a2a38,null));}; \ No newline at end of file +var _0x754e=['apply','save','update','then','destroy','name','send','body','find','catch','params','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','squel','desk.js','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','sendStatus','status','end','count','offset','limit','set'];(function(_0x43de22,_0x1eced6){var _0x4b15ee=function(_0x6e36da){while(--_0x6e36da){_0x43de22['push'](_0x43de22['shift']());}};_0x4b15ee(++_0x1eced6);}(_0x754e,0x100));var _0xe754=function(_0x1b16cf,_0x220918){_0x1b16cf=_0x1b16cf-0x0;var _0x1ae2d8=_0x754e[_0x1b16cf];return _0x1ae2d8;};'use strict';var pdf=require(_0xe754('0x0'));var emlformat=require(_0xe754('0x1'));var rimraf=require(_0xe754('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe754('0x3'));var rp=require(_0xe754('0x4'));var moment=require(_0xe754('0x5'));var BPromise=require(_0xe754('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe754('0x7'));var sox=require('sox');var csv=require(_0xe754('0x8'));var ejs=require(_0xe754('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe754('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe754('0xb'));var toCsv=require(_0xe754('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe754('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xe754('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe754('0xe'))(_0xe754('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xe754('0x10'))['db'];function respondWithStatusCode(_0x2279d9,_0x157259){_0x157259=_0x157259||0xcc;return function(_0x3e969d){if(_0x3e969d){return _0x2279d9[_0xe754('0x11')](_0x157259);}return _0x2279d9[_0xe754('0x12')](_0x157259)[_0xe754('0x13')]();};}function respondWithResult(_0x89ef46,_0x448d4b){_0x448d4b=_0x448d4b||0xc8;return function(_0x3cfd69){if(_0x3cfd69){return _0x89ef46[_0xe754('0x12')](_0x448d4b)['json'](_0x3cfd69);}};}function respondWithFilteredResult(_0x1bfa07,_0x4c2338){return function(_0x34742b){if(_0x34742b){var _0xddb770=_0x34742b[_0xe754('0x14')],_0x504bdd=_0x4c2338[_0xe754('0x15')],_0xcaea11=_0x4c2338[_0xe754('0x15')]+_0x4c2338[_0xe754('0x16')],_0x132502;if(_0xcaea11>=_0xddb770){_0xcaea11=_0xddb770;_0x132502=0xc8;}else{_0x132502=0xce;}_0x1bfa07[_0xe754('0x12')](_0x132502);return _0x1bfa07[_0xe754('0x17')]('Content-Range',_0x504bdd+'-'+_0xcaea11+'/'+_0xddb770)['json'](_0x34742b);}return null;};}function patchUpdates(_0x2be272){return function(_0x1884eb){try{jsonpatch[_0xe754('0x18')](_0x1884eb,_0x2be272,!![]);}catch(_0x56174f){return BPromise['reject'](_0x56174f);}return _0x1884eb[_0xe754('0x19')]();};}function saveUpdates(_0xf0195a,_0x60f111){return function(_0xf7d34a){if(_0xf7d34a){return _0xf7d34a[_0xe754('0x1a')](_0xf0195a)[_0xe754('0x1b')](function(_0x2548e8){return _0x2548e8;});}return null;};}function removeEntity(_0xa77ee6,_0x443204){return function(_0x5e537f){if(_0x5e537f){return _0x5e537f[_0xe754('0x1c')]()['then'](function(){_0xa77ee6[_0xe754('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8fe100,_0x142319){return function(_0x2202af){if(!_0x2202af){_0x8fe100['sendStatus'](0x194);}return _0x2202af;};}function handleError(_0x536250,_0x1cada6){_0x1cada6=_0x1cada6||0x1f4;return function(_0x33772a){logger['error'](_0x33772a['stack']);if(_0x33772a[_0xe754('0x1d')]){delete _0x33772a[_0xe754('0x1d')];}_0x536250[_0xe754('0x12')](_0x1cada6)[_0xe754('0x1e')](_0x33772a);};}exports[_0xe754('0x1a')]=function(_0x4dfe62,_0x60f78a){if(_0x4dfe62[_0xe754('0x1f')]['id']){delete _0x4dfe62[_0xe754('0x1f')]['id'];}return db['Action'][_0xe754('0x20')]({'where':{'id':_0x4dfe62['params']['id']}})[_0xe754('0x1b')](handleEntityNotFound(_0x60f78a,null))[_0xe754('0x1b')](saveUpdates(_0x4dfe62['body'],null))[_0xe754('0x1b')](respondWithResult(_0x60f78a,null))[_0xe754('0x21')](handleError(_0x60f78a,null));};exports[_0xe754('0x1c')]=function(_0xc926d3,_0x219c90){return db['Action'][_0xe754('0x20')]({'where':{'id':_0xc926d3[_0xe754('0x22')]['id']}})[_0xe754('0x1b')](handleEntityNotFound(_0x219c90,null))['then'](removeEntity(_0x219c90,null))[_0xe754('0x21')](handleError(_0x219c90,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index e91366e..2dedb75 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 _0xbbe1=['tools_actions','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./action.attributes','exports','define','Action'];(function(_0x4c6ecf,_0x46d4f7){var _0x46fb15=function(_0x11919c){while(--_0x11919c){_0x4c6ecf['push'](_0x4c6ecf['shift']());}};_0x46fb15(++_0x46d4f7);}(_0xbbe1,0xc1));var _0x1bbe=function(_0x1bcb9d,_0x196e3d){_0x1bcb9d=_0x1bcb9d-0x0;var _0x5651f2=_0xbbe1[_0x1bcb9d];return _0x5651f2;};'use strict';var _=require(_0x1bbe('0x0'));var util=require('util');var logger=require(_0x1bbe('0x1'))('api');var moment=require(_0x1bbe('0x2'));var BPromise=require(_0x1bbe('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1bbe('0x4'));var rimraf=require(_0x1bbe('0x5'));var config=require(_0x1bbe('0x6'));var attributes=require(_0x1bbe('0x7'));module[_0x1bbe('0x8')]=function(_0x3a6b29,_0x18bfce){return _0x3a6b29[_0x1bbe('0x9')](_0x1bbe('0xa'),attributes,{'tableName':_0x1bbe('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x366e=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Action','tools_actions'];(function(_0x556eb9,_0x6ce4de){var _0x4d5de7=function(_0x1fe638){while(--_0x1fe638){_0x556eb9['push'](_0x556eb9['shift']());}};_0x4d5de7(++_0x6ce4de);}(_0x366e,0xdd));var _0xe366=function(_0x22a3f0,_0x513d0e){_0x22a3f0=_0x22a3f0-0x0;var _0x2d8a9c=_0x366e[_0x22a3f0];return _0x2d8a9c;};'use strict';var _=require(_0xe366('0x0'));var util=require(_0xe366('0x1'));var logger=require('../../config/logger')(_0xe366('0x2'));var moment=require(_0xe366('0x3'));var BPromise=require(_0xe366('0x4'));var rp=require(_0xe366('0x5'));var fs=require('fs');var path=require(_0xe366('0x6'));var rimraf=require(_0xe366('0x7'));var config=require(_0xe366('0x8'));var attributes=require('./action.attributes');module[_0xe366('0x9')]=function(_0x356eac,_0x176ac6){return _0x356eac[_0xe366('0xa')](_0xe366('0xb'),attributes,{'tableName':_0xe366('0xc'),'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 62963ec..31a5af8 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 _0xd847=['../../config/utils','../../config/logger','rpc','../../config/environment','client','request','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','Action,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','../../mysqldb'];(function(_0x31a4b8,_0x3a7032){var _0x24c287=function(_0x226b45){while(--_0x226b45){_0x31a4b8['push'](_0x31a4b8['shift']());}};_0x24c287(++_0x3a7032);}(_0xd847,0x18a));var _0x7d84=function(_0x6707c,_0x15fd4b){_0x6707c=_0x6707c-0x0;var _0x4c6050=_0xd847[_0x6707c];return _0x4c6050;};'use strict';var _=require(_0x7d84('0x0'));var util=require(_0x7d84('0x1'));var moment=require(_0x7d84('0x2'));var BPromise=require(_0x7d84('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7d84('0x4'))['db'];var utils=require(_0x7d84('0x5'));var logger=require(_0x7d84('0x6'))(_0x7d84('0x7'));var config=require(_0x7d84('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7d84('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c57cd,_0x20ce63,_0x1d6297){return new BPromise(function(_0x32da6d,_0x128ef5){return client[_0x7d84('0xa')](_0x3c57cd,_0x1d6297)['then'](function(_0x1cf0b9){logger['info']('Action,\x20%s,\x20%s',_0x20ce63,_0x7d84('0xb'));logger[_0x7d84('0xc')](_0x7d84('0xd'),_0x20ce63,_0x7d84('0xb'),JSON[_0x7d84('0xe')](_0x1cf0b9));if(_0x1cf0b9[_0x7d84('0xf')]){if(_0x1cf0b9[_0x7d84('0xf')][_0x7d84('0x10')]===0x1f4){logger[_0x7d84('0xf')](_0x7d84('0x11'),_0x20ce63,_0x1cf0b9[_0x7d84('0xf')][_0x7d84('0x12')]);return _0x128ef5(_0x1cf0b9[_0x7d84('0xf')][_0x7d84('0x12')]);}logger[_0x7d84('0xf')](_0x7d84('0x11'),_0x20ce63,_0x1cf0b9[_0x7d84('0xf')][_0x7d84('0x12')]);return _0x32da6d(_0x1cf0b9[_0x7d84('0xf')][_0x7d84('0x12')]);}else{logger[_0x7d84('0x13')]('Action,\x20%s,\x20%s',_0x20ce63,_0x7d84('0xb'));_0x32da6d(_0x1cf0b9[_0x7d84('0x14')]['message']);}})['catch'](function(_0x5338ab){logger[_0x7d84('0xf')](_0x7d84('0x11'),_0x20ce63,_0x5338ab);_0x128ef5(_0x5338ab);});});} \ 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(_0x3db3bc,_0x16701b){var _0x567dd9=function(_0x9f24ba){while(--_0x9f24ba){_0x3db3bc['push'](_0x3db3bc['shift']());}};_0x567dd9(++_0x16701b);}(_0xb2ff,0x123));var _0xfb2f=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xb2ff[_0x167cc1];return _0x10bc4b;};'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 f393f92..a7ff5eb 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 _0x1094=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id','isAuthenticated','update','delete','exports','multer','util'];(function(_0x1d6a82,_0x37c315){var _0x5834ac=function(_0x2402ba){while(--_0x2402ba){_0x1d6a82['push'](_0x1d6a82['shift']());}};_0x5834ac(++_0x37c315);}(_0x1094,0x143));var _0x4109=function(_0x599e0a,_0x3162d9){_0x599e0a=_0x599e0a-0x0;var _0x3ac3e0=_0x1094[_0x599e0a];return _0x3ac3e0;};'use strict';var multer=require(_0x4109('0x0'));var util=require(_0x4109('0x1'));var path=require('path');var timeout=require(_0x4109('0x2'));var express=require('express');var router=express[_0x4109('0x3')]();var auth=require(_0x4109('0x4'));var interaction=require(_0x4109('0x5'));var config=require(_0x4109('0x6'));var controller=require(_0x4109('0x7'));router['put'](_0x4109('0x8'),auth[_0x4109('0x9')](),controller[_0x4109('0xa')]);router[_0x4109('0xb')](_0x4109('0x8'),auth[_0x4109('0x9')](),controller['destroy']);module[_0x4109('0xc')]=router; \ No newline at end of file +var _0xdacc=['isAuthenticated','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./action.controller','put','/:id'];(function(_0x4de586,_0x183427){var _0x46baf5=function(_0x1157f0){while(--_0x1157f0){_0x4de586['push'](_0x4de586['shift']());}};_0x46baf5(++_0x183427);}(_0xdacc,0x14f));var _0xcdac=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xdacc[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require(_0xcdac('0x0'));var path=require(_0xcdac('0x1'));var timeout=require(_0xcdac('0x2'));var express=require(_0xcdac('0x3'));var router=express[_0xcdac('0x4')]();var auth=require(_0xcdac('0x5'));var interaction=require(_0xcdac('0x6'));var config=require('../../config/environment');var controller=require(_0xcdac('0x7'));router[_0xcdac('0x8')](_0xcdac('0x9'),auth[_0xcdac('0xa')](),controller[_0xcdac('0xb')]);router[_0xcdac('0xc')](_0xcdac('0x9'),auth[_0xcdac('0xa')](),controller[_0xcdac('0xd')]);module[_0xcdac('0xe')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 3e194b6..076c2f3 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 _0x99f7=['TEXT','sequelize','STRING'];(function(_0x115b4e,_0x36f998){var _0x320459=function(_0x11b8f4){while(--_0x11b8f4){_0x115b4e['push'](_0x115b4e['shift']());}};_0x320459(++_0x36f998);}(_0x99f7,0xb5));var _0x799f=function(_0x1ae244,_0x2befcb){_0x1ae244=_0x1ae244-0x0;var _0x5d8aa0=_0x99f7[_0x1ae244];return _0x5d8aa0;};'use strict';var Sequelize=require(_0x799f('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x799f('0x1')]},'table':{'type':Sequelize[_0x799f('0x1')]},'conditions':{'type':Sequelize[_0x799f('0x2')]},'joins':{'type':Sequelize[_0x799f('0x2')]}}; \ No newline at end of file +var _0x0516=['TEXT','sequelize','STRING'];(function(_0x365e54,_0x44be74){var _0x13317a=function(_0x2d917f){while(--_0x2d917f){_0x365e54['push'](_0x365e54['shift']());}};_0x13317a(++_0x44be74);}(_0x0516,0xa0));var _0x6051=function(_0x434138,_0x74656){_0x434138=_0x434138-0x0;var _0x40ebdd=_0x0516[_0x434138];return _0x40ebdd;};'use strict';var Sequelize=require(_0x6051('0x0'));module['exports']={'name':{'type':Sequelize[_0x6051('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x6051('0x1')]},'parent':{'type':Sequelize[_0x6051('0x1')]},'table':{'type':Sequelize[_0x6051('0x1')]},'conditions':{'type':Sequelize[_0x6051('0x2')]},'joins':{'type':Sequelize[_0x6051('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index c8cf906..df36bc8 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 _0x18ba=['desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','UserProfileResource','destroy','end','stack','name','send','AnalyticCustomReport','rawAttributes','keys','query','filters','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','map','type','key','filter','include','findAll','rows','catch','show','params','intersection','options','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','CustomReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','table','MetricId','function','replace','format','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','Limited\x20Query:','sequelize','SELECT','left_join','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','value','getFields','select','metric','groupBy','debug','toString','QueryTypes','No\x20available\x20data','output','fullPath','%s-%s.%s','generate','custom','AnalyticExtractedReport','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','run','runReport','html-pdf','eml-format','zip-dir','request-promise','mustache','to-csv','lodash','squel','crypto','jsforce'];(function(_0xadeb97,_0x8354cd){var _0x2cc30f=function(_0xfdf66){while(--_0xfdf66){_0xadeb97['push'](_0xadeb97['shift']());}};_0x2cc30f(++_0x8354cd);}(_0x18ba,0x1dc));var _0xa18b=function(_0x2a3256,_0x2df222){_0x2a3256=_0x2a3256-0x0;var _0x417807=_0x18ba[_0x2a3256];return _0x417807;};'use strict';var pdf=require(_0xa18b('0x0'));var emlformat=require(_0xa18b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa18b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa18b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa18b('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xa18b('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa18b('0x6'));var squel=require(_0xa18b('0x7'));var crypto=require(_0xa18b('0x8'));var jsforce=require(_0xa18b('0x9'));var deskjs=require(_0xa18b('0xa'));var toCsv=require('to-csv');var querystring=require(_0xa18b('0xb'));var Papa=require('papaparse');var Redis=require(_0xa18b('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xa18b('0xd'));var logger=require(_0xa18b('0xe'))(_0xa18b('0xf'));var utils=require(_0xa18b('0x10'));var config=require(_0xa18b('0x11'));var db=require(_0xa18b('0x12'))['db'];function respondWithStatusCode(_0x14ebbd,_0x37ff1f){_0x37ff1f=_0x37ff1f||0xcc;return function(_0x30ee53){if(_0x30ee53){return _0x14ebbd[_0xa18b('0x13')](_0x37ff1f);}return _0x14ebbd[_0xa18b('0x14')](_0x37ff1f)['end']();};}function respondWithResult(_0x547071,_0x2f485b){_0x2f485b=_0x2f485b||0xc8;return function(_0x565208){if(_0x565208){return _0x547071[_0xa18b('0x14')](_0x2f485b)[_0xa18b('0x15')](_0x565208);}};}function respondWithFilteredResult(_0x26efa0,_0x397a30){return function(_0x1f8145){if(_0x1f8145){var _0x2f3c36=_0x1f8145[_0xa18b('0x16')],_0x45a702=_0x397a30[_0xa18b('0x17')],_0x1e9141=_0x397a30[_0xa18b('0x17')]+_0x397a30[_0xa18b('0x18')],_0x2e42a1;if(_0x1e9141>=_0x2f3c36){_0x1e9141=_0x2f3c36;_0x2e42a1=0xc8;}else{_0x2e42a1=0xce;}_0x26efa0[_0xa18b('0x14')](_0x2e42a1);return _0x26efa0[_0xa18b('0x19')](_0xa18b('0x1a'),_0x45a702+'-'+_0x1e9141+'/'+_0x2f3c36)[_0xa18b('0x15')](_0x1f8145);}return null;};}function patchUpdates(_0x2b9482){return function(_0x478e28){try{jsonpatch[_0xa18b('0x1b')](_0x478e28,_0x2b9482,!![]);}catch(_0x572133){return BPromise[_0xa18b('0x1c')](_0x572133);}return _0x478e28[_0xa18b('0x1d')]();};}function saveUpdates(_0x288c14,_0x2a5272){return function(_0x90bbe4){if(_0x90bbe4){return _0x90bbe4[_0xa18b('0x1e')](_0x288c14)['then'](function(_0x462123){return _0x462123;});}return null;};}function removeEntity(_0x1861f0,_0x2b8bd9){return function(_0x42f1dd){if(_0x42f1dd){return _0x42f1dd['destroy']()[_0xa18b('0x1f')](function(){var _0x570e62=_0x42f1dd['get']({'plain':!![]});var _0x31dd47='CustomReports';return db[_0xa18b('0x20')][_0xa18b('0x21')]({'where':{'type':_0x31dd47,'resourceId':_0x570e62['id']}})[_0xa18b('0x1f')](function(){return _0x42f1dd;});})['then'](function(){_0x1861f0[_0xa18b('0x14')](0xcc)[_0xa18b('0x22')]();});}};}function handleEntityNotFound(_0x5d5d39,_0x3579a5){return function(_0x1a5268){if(!_0x1a5268){_0x5d5d39[_0xa18b('0x13')](0x194);}return _0x1a5268;};}function handleError(_0x4307ca,_0x200d9c){_0x200d9c=_0x200d9c||0x1f4;return function(_0x2ec154){logger['error'](_0x2ec154[_0xa18b('0x23')]);if(_0x2ec154[_0xa18b('0x24')]){delete _0x2ec154[_0xa18b('0x24')];}_0x4307ca['status'](_0x200d9c)[_0xa18b('0x25')](_0x2ec154);};}exports['index']=function(_0xcecb7c,_0x357a12){var _0x33ee06={},_0x42a6ea={},_0x11ce3e={'count':0x0,'rows':[]};var _0x3475da=db[_0xa18b('0x26')][_0xa18b('0x27')];_0x42a6ea['model']=_[_0xa18b('0x28')](_0x3475da);_0x42a6ea[_0xa18b('0x29')]=_[_0xa18b('0x28')](_0xcecb7c[_0xa18b('0x29')]);_0x42a6ea[_0xa18b('0x2a')]=_['intersection'](_0x42a6ea[_0xa18b('0x2b')],_0x42a6ea[_0xa18b('0x29')]);_0x33ee06[_0xa18b('0x2c')]=_['intersection'](_0x42a6ea[_0xa18b('0x2b')],qs['fields'](_0xcecb7c[_0xa18b('0x29')][_0xa18b('0x2d')]));_0x33ee06[_0xa18b('0x2c')]=_0x33ee06[_0xa18b('0x2c')][_0xa18b('0x2e')]?_0x33ee06[_0xa18b('0x2c')]:_0x42a6ea[_0xa18b('0x2b')];if(!_0xcecb7c[_0xa18b('0x29')][_0xa18b('0x2f')]('nolimit')){_0x33ee06[_0xa18b('0x18')]=qs[_0xa18b('0x18')](_0xcecb7c[_0xa18b('0x29')][_0xa18b('0x18')]);_0x33ee06['offset']=qs[_0xa18b('0x17')](_0xcecb7c['query'][_0xa18b('0x17')]);}_0x33ee06[_0xa18b('0x30')]=qs[_0xa18b('0x31')](_0xcecb7c[_0xa18b('0x29')][_0xa18b('0x31')]);_0x33ee06[_0xa18b('0x32')]=qs['filters'](_[_0xa18b('0x33')](_0xcecb7c[_0xa18b('0x29')],_0x42a6ea[_0xa18b('0x2a')]));if(_0xcecb7c[_0xa18b('0x29')]['filter']){_0x33ee06[_0xa18b('0x32')]=_[_0xa18b('0x34')](_0x33ee06[_0xa18b('0x32')],{'$or':_[_0xa18b('0x35')](_0x3475da,function(_0x423f4c){if(_0x423f4c[_0xa18b('0x36')][_0xa18b('0x37')]!=='VIRTUAL'){var _0x42c6f5={};_0x42c6f5[_0x423f4c['field']]={'$like':'%'+_0xcecb7c[_0xa18b('0x29')][_0xa18b('0x38')]+'%'};return _0x42c6f5;}})});}_0x33ee06=_[_0xa18b('0x34')]({},_0x33ee06,_0xcecb7c['options']);var _0x4f87c0={'where':_0x33ee06[_0xa18b('0x32')]};return db[_0xa18b('0x26')][_0xa18b('0x16')](_0x4f87c0)[_0xa18b('0x1f')](function(_0x3c061d){_0x11ce3e['count']=_0x3c061d;if(_0xcecb7c[_0xa18b('0x29')]['includeAll']){_0x33ee06[_0xa18b('0x39')]=[{'all':!![]}];}return db[_0xa18b('0x26')][_0xa18b('0x3a')](_0x33ee06);})[_0xa18b('0x1f')](function(_0x43b184){_0x11ce3e[_0xa18b('0x3b')]=_0x43b184;return _0x11ce3e;})[_0xa18b('0x1f')](respondWithFilteredResult(_0x357a12,_0x33ee06))[_0xa18b('0x3c')](handleError(_0x357a12,null));};exports[_0xa18b('0x3d')]=function(_0x4f6414,_0x3aa271){var _0x442fa1={'raw':![],'where':{'id':_0x4f6414[_0xa18b('0x3e')]['id']}},_0xa27ea3={};_0xa27ea3[_0xa18b('0x2b')]=_[_0xa18b('0x28')](db[_0xa18b('0x26')][_0xa18b('0x27')]);_0xa27ea3[_0xa18b('0x29')]=_['keys'](_0x4f6414[_0xa18b('0x29')]);_0xa27ea3[_0xa18b('0x2a')]=_[_0xa18b('0x3f')](_0xa27ea3[_0xa18b('0x2b')],_0xa27ea3[_0xa18b('0x29')]);_0x442fa1[_0xa18b('0x2c')]=_['intersection'](_0xa27ea3[_0xa18b('0x2b')],qs[_0xa18b('0x2d')](_0x4f6414[_0xa18b('0x29')][_0xa18b('0x2d')]));_0x442fa1[_0xa18b('0x2c')]=_0x442fa1[_0xa18b('0x2c')][_0xa18b('0x2e')]?_0x442fa1[_0xa18b('0x2c')]:_0xa27ea3[_0xa18b('0x2b')];if(_0x4f6414[_0xa18b('0x29')]['includeAll']){_0x442fa1[_0xa18b('0x39')]=[{'all':!![]}];}_0x442fa1=_[_0xa18b('0x34')]({},_0x442fa1,_0x4f6414[_0xa18b('0x40')]);return db[_0xa18b('0x26')][_0xa18b('0x41')](_0x442fa1)[_0xa18b('0x1f')](handleEntityNotFound(_0x3aa271,null))['then'](respondWithResult(_0x3aa271,null))['catch'](handleError(_0x3aa271,null));};exports[_0xa18b('0x42')]=function(_0x2448f0,_0x1a2394){return db['AnalyticCustomReport']['create'](_0x2448f0['body'],{})[_0xa18b('0x1f')](function(_0x19c6cb){var _0x22258f=_0x2448f0[_0xa18b('0x43')][_0xa18b('0x44')]({'plain':!![]});if(!_0x22258f)throw new Error(_0xa18b('0x45'));if(_0x22258f[_0xa18b('0x46')]===_0xa18b('0x43')){var _0x3eba69=_0x19c6cb[_0xa18b('0x44')]({'plain':!![]});var _0x47caf2=_0xa18b('0x47');return db[_0xa18b('0x48')][_0xa18b('0x41')]({'where':{'name':_0x47caf2,'userProfileId':_0x22258f[_0xa18b('0x49')]},'raw':!![]})[_0xa18b('0x1f')](function(_0x32b0ca){if(_0x32b0ca&&_0x32b0ca[_0xa18b('0x4a')]===0x0){return db[_0xa18b('0x20')][_0xa18b('0x42')]({'name':_0x3eba69[_0xa18b('0x24')],'resourceId':_0x3eba69['id'],'type':_0xa18b('0x4b'),'sectionId':_0x32b0ca['id']},{})['then'](function(){return _0x19c6cb;});}else{return _0x19c6cb;}})[_0xa18b('0x3c')](function(_0xd9cb76){logger[_0xa18b('0x4c')](_0xa18b('0x4d'),_0xd9cb76);throw _0xd9cb76;});}return _0x19c6cb;})['then'](respondWithResult(_0x1a2394,0xc9))[_0xa18b('0x3c')](handleError(_0x1a2394,null));};exports['update']=function(_0x10b57c,_0x4df655){if(_0x10b57c['body']['id']){delete _0x10b57c['body']['id'];}return db[_0xa18b('0x26')][_0xa18b('0x41')]({'where':{'id':_0x10b57c[_0xa18b('0x3e')]['id']}})[_0xa18b('0x1f')](handleEntityNotFound(_0x4df655,null))[_0xa18b('0x1f')](saveUpdates(_0x10b57c[_0xa18b('0x4e')],null))['then'](respondWithResult(_0x4df655,null))[_0xa18b('0x3c')](handleError(_0x4df655,null));};exports[_0xa18b('0x21')]=function(_0x332d09,_0x473003){return db[_0xa18b('0x26')]['find']({'where':{'id':_0x332d09['params']['id']}})['then'](handleEntityNotFound(_0x473003,null))['then'](removeEntity(_0x473003,null))['catch'](handleError(_0x473003,null));};exports[_0xa18b('0x4f')]=function(_0x105a0f,_0x368b8c){var _0x47bdc9=0xa;var _0x4ee820=[_0xa18b('0x50'),'left_join',_0xa18b('0x51'),_0xa18b('0x52')];var _0x88a3a={'SUM':_0xa18b('0x53'),'COUNT':_0xa18b('0x54'),'COUNT DISTINCT':_0xa18b('0x55'),'MAX':_0xa18b('0x56'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xa18b('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x3058d2={'SEC_TO_TIME':_0xa18b('0x58'),'DATE':'DATE(%s)','HOUR':_0xa18b('0x59'),'ROUND':_0xa18b('0x5a'),'UNIX_TIMESTAMP':_0xa18b('0x5b')};var _0x5208ba=function(_0x5c23b2){return!_[_0xa18b('0x5c')]([_0xa18b('0x5d'),_0xa18b('0x5e'),_0xa18b('0x5f'),_0xa18b('0x60')],_0x5c23b2);};var _0x532148=function(_0xfce7ae){if(!_0xfce7ae||!_0xfce7ae[_0xa18b('0x61')][_0xa18b('0x2e')]){return'';}for(var _0x161aec='(',_0x3480f8=0x0;_0x3480f8<_0xfce7ae[_0xa18b('0x61')][_0xa18b('0x2e')];_0x3480f8+=0x1){_0x3480f8>0x0&&(_0x161aec+='\x20'+_0xfce7ae[_0xa18b('0x62')]+'\x20');_0x161aec+=_0xfce7ae[_0xa18b('0x61')][_0x3480f8]['group']?_0x532148(_0xfce7ae['rules'][_0x3480f8][_0xa18b('0x63')]):_0xfce7ae[_0xa18b('0x61')][_0x3480f8][_0xa18b('0x64')]+'\x20'+_0xfce7ae[_0xa18b('0x61')][_0x3480f8][_0xa18b('0x65')]+(_0x5208ba(_0xfce7ae['rules'][_0x3480f8][_0xa18b('0x65')])?'\x20'+_0xfce7ae['rules'][_0x3480f8]['value']:'');}return _0x161aec+')';};var _0x2703f3={'where':{'id':_0x105a0f[_0xa18b('0x3e')]['id']}},_0x38c92c,_0x456ec2,_0x16b73d,_0x3ed0bd,_0x23aa36;_0x2703f3=_[_0xa18b('0x34')]({},_0x2703f3,_0x105a0f[_0xa18b('0x40')]);return db[_0xa18b('0x26')][_0xa18b('0x41')](_0x2703f3)[_0xa18b('0x1f')](function(_0x2503ab){if(_0x2503ab){_0x38c92c=_0x2503ab;return _0x2503ab['getFields']();}return null;})[_0xa18b('0x1f')](function(_0x1b2ca5){if(_0x1b2ca5){if(!_0x1b2ca5[_0xa18b('0x2e')]){throw new db[(_0xa18b('0x66'))][(_0xa18b('0x67'))](_0xa18b('0x68'),0x193);}_0x456ec2=_0x1b2ca5;return db[_0xa18b('0x69')][_0xa18b('0x3a')]({'raw':!![]});}return null;})[_0xa18b('0x1f')](function(_0x3e48f2){if(_0x3e48f2){_0x16b73d=_[_0xa18b('0x6a')](_0x3e48f2,'id');var _0x1b1ec1;var _0x36e4c3=squel['select']();_0x36e4c3[_0xa18b('0x6b')](_0x38c92c[_0xa18b('0x6c')]);for(var _0xc4cf0c=0x0;_0xc4cf0c<_0x456ec2[_0xa18b('0x2e')];_0xc4cf0c+=0x1){_0x1b1ec1=_0x456ec2[_0xc4cf0c][_0xa18b('0x6d')]?_0x16b73d[_0x456ec2[_0xc4cf0c]['MetricId']]['metric']:_0x456ec2[_0xc4cf0c][_0xa18b('0x64')];_0x1b1ec1=_0x456ec2[_0xc4cf0c][_0xa18b('0x6e')]?_[_0xa18b('0x6f')](_0x88a3a[_0x456ec2[_0xc4cf0c][_0xa18b('0x6e')]],'%s',_0x1b1ec1):_0x1b1ec1;_0x1b1ec1=_0x456ec2[_0xc4cf0c][_0xa18b('0x70')]?_[_0xa18b('0x6f')](_0x3058d2[_0x456ec2[_0xc4cf0c][_0xa18b('0x70')]],'%s',_0x1b1ec1):_0x1b1ec1;if(_0x456ec2[_0xc4cf0c]['groupBy']){_0x36e4c3[_0xa18b('0x63')](_0x1b1ec1);}_0x456ec2[_0xc4cf0c][_0xa18b('0x71')]&&_0x36e4c3[_0xa18b('0x30')](_0x1b1ec1,_0x456ec2[_0xc4cf0c][_0xa18b('0x71')]===_0xa18b('0x72')?![]:!![]);_0x36e4c3[_0xa18b('0x64')](_0x1b1ec1,_0x456ec2[_0xc4cf0c][_0xa18b('0x73')]||_0x1b1ec1);}if(_0x38c92c[_0xa18b('0x74')]){_0x38c92c[_0xa18b('0x74')]=JSON[_0xa18b('0x75')](_0x38c92c[_0xa18b('0x74')]);for(var _0xbf44c6=0x0;_0xbf44c6<_0x38c92c[_0xa18b('0x74')][_0xa18b('0x2e')];_0xbf44c6+=0x1){if(_0x38c92c[_0xa18b('0x74')][_0xbf44c6][_0xa18b('0x36')]&&_[_0xa18b('0x5c')](_0x4ee820,_0x38c92c['joins'][_0xbf44c6][_0xa18b('0x36')])&&_0x38c92c[_0xa18b('0x74')][_0xbf44c6][_0xa18b('0x76')]&&_0x38c92c[_0xa18b('0x74')][_0xbf44c6][_0xa18b('0x77')]&&_0x38c92c['joins'][_0xbf44c6][_0xa18b('0x78')]){_0x36e4c3[_0x38c92c['joins'][_0xbf44c6]['type']](_0x38c92c[_0xa18b('0x74')][_0xbf44c6][_0xa18b('0x77')],null,util['format'](_0xa18b('0x79'),_0x38c92c['table'],_0x38c92c[_0xa18b('0x74')][_0xbf44c6][_0xa18b('0x76')],_0x38c92c['joins'][_0xbf44c6][_0xa18b('0x77')],_0x38c92c[_0xa18b('0x74')][_0xbf44c6]['foreignKey']));}}}if(_0x38c92c[_0xa18b('0x7a')]){_0x38c92c[_0xa18b('0x7a')]=JSON[_0xa18b('0x75')](_0x38c92c['conditions']);_0x36e4c3[_0xa18b('0x32')](_0x532148(_0x38c92c[_0xa18b('0x7a')][_0xa18b('0x63')]));}_0x23aa36=_0x36e4c3[_0xa18b('0x7b')]();_0x36e4c3[_0xa18b('0x18')](_0x47bdc9);_0x36e4c3[_0xa18b('0x17')](0x0);logger['debug'](_0xa18b('0x7c'),_0x36e4c3['toString']());return db[_0xa18b('0x7d')][_0xa18b('0x29')](_0x36e4c3['toString'](),{'type':db[_0xa18b('0x7d')]['QueryTypes'][_0xa18b('0x7e')]});}})[_0xa18b('0x1f')](respondWithResult(_0x368b8c,null))[_0xa18b('0x3c')](handleError(_0x368b8c,null));};function runReport(_0xdfbdd2,_0xaffd6b,_0x2dc082){var _0x3329ce=_0xaffd6b['name'];var _0x21aab2=0xa;var _0x16cbc2=[_0xa18b('0x50'),_0xa18b('0x7f'),_0xa18b('0x51'),'cross_join'];var _0x401dba={'SUM':_0xa18b('0x53'),'COUNT':_0xa18b('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xa18b('0x56'),'MIN':_0xa18b('0x80'),'AVG':_0xa18b('0x81'),'GROUP_CONCAT':_0xa18b('0x82'),'GROUP_CONCAT ASC':_0xa18b('0x57'),'GROUP_CONCAT DESC':_0xa18b('0x83')};var _0x53e683={'SEC_TO_TIME':_0xa18b('0x58'),'DATE':_0xa18b('0x84'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xa18b('0x5b')};var _0x5d14e3=function(_0x38c3eb){return!_[_0xa18b('0x5c')](['IS\x20NULL',_0xa18b('0x5e'),_0xa18b('0x5f'),'IS\x20NOT\x20EMPTY'],_0x38c3eb);};var _0x4aad04=function(_0x1470fa){if(!_0x1470fa||!_0x1470fa['rules']['length']){return'';}for(var _0x2ec7d0='(',_0x190494=0x0;_0x190494<_0x1470fa[_0xa18b('0x61')][_0xa18b('0x2e')];_0x190494+=0x1){_0x190494>0x0&&(_0x2ec7d0+='\x20'+_0x1470fa[_0xa18b('0x62')]+'\x20');_0x2ec7d0+=_0x1470fa[_0xa18b('0x61')][_0x190494][_0xa18b('0x63')]?_0x4aad04(_0x1470fa[_0xa18b('0x61')][_0x190494][_0xa18b('0x63')]):_0x1470fa['rules'][_0x190494][_0xa18b('0x64')]+'\x20'+_0x1470fa['rules'][_0x190494][_0xa18b('0x65')]+(_0x5d14e3(_0x1470fa[_0xa18b('0x61')][_0x190494]['condition'])?'\x20'+_0x1470fa[_0xa18b('0x61')][_0x190494][_0xa18b('0x85')]:'');}return _0x2ec7d0+')';};var _0x3761d6={'where':{'id':_0xdfbdd2['id']}},_0xe95f47,_0x4211d1,_0x44b8cf,_0x3377da,_0x37900c;_0x3761d6=_[_0xa18b('0x34')]({},_0x3761d6,_0x2dc082);return db['AnalyticCustomReport'][_0xa18b('0x41')](_0x3761d6)[_0xa18b('0x1f')](function(_0x450d8e){if(_0x450d8e){_0xe95f47=_0x450d8e;return _0x450d8e[_0xa18b('0x86')]();}return null;})['then'](function(_0x33f559){if(_0x33f559){if(!_0x33f559[_0xa18b('0x2e')]){throw new db['Sequelize'][(_0xa18b('0x67'))](_0xa18b('0x68'),0x193);}_0x4211d1=_0x33f559;return db[_0xa18b('0x69')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x284d72){if(_0x284d72){_0x44b8cf=_[_0xa18b('0x6a')](_0x284d72,'id');var _0x3c10f5;var _0x42555e=squel[_0xa18b('0x87')]();_0x42555e[_0xa18b('0x6b')](_0xe95f47[_0xa18b('0x6c')]);for(var _0x33a7d7=0x0;_0x33a7d7<_0x4211d1['length'];_0x33a7d7+=0x1){_0x3c10f5=_0x4211d1[_0x33a7d7][_0xa18b('0x6d')]?_0x44b8cf[_0x4211d1[_0x33a7d7][_0xa18b('0x6d')]][_0xa18b('0x88')]:_0x4211d1[_0x33a7d7]['field'];_0x3c10f5=_0x4211d1[_0x33a7d7][_0xa18b('0x6e')]?_[_0xa18b('0x6f')](_0x401dba[_0x4211d1[_0x33a7d7][_0xa18b('0x6e')]],'%s',_0x3c10f5):_0x3c10f5;_0x3c10f5=_0x4211d1[_0x33a7d7][_0xa18b('0x70')]?_['replace'](_0x53e683[_0x4211d1[_0x33a7d7][_0xa18b('0x70')]],'%s',_0x3c10f5):_0x3c10f5;if(_0x4211d1[_0x33a7d7][_0xa18b('0x89')]){_0x42555e[_0xa18b('0x63')](_0x3c10f5);}_0x4211d1[_0x33a7d7][_0xa18b('0x71')]&&_0x42555e['order'](_0x3c10f5,_0x4211d1[_0x33a7d7][_0xa18b('0x71')]===_0xa18b('0x72')?![]:!![]);_0x42555e[_0xa18b('0x64')](_0x3c10f5,_0x4211d1[_0x33a7d7][_0xa18b('0x73')]||_0x3c10f5);}if(_0xe95f47[_0xa18b('0x74')]){_0xe95f47[_0xa18b('0x74')]=JSON[_0xa18b('0x75')](_0xe95f47[_0xa18b('0x74')]);for(var _0x4120b9=0x0;_0x4120b9<_0xe95f47[_0xa18b('0x74')][_0xa18b('0x2e')];_0x4120b9+=0x1){if(_0xe95f47[_0xa18b('0x74')][_0x4120b9][_0xa18b('0x36')]&&_[_0xa18b('0x5c')](_0x16cbc2,_0xe95f47[_0xa18b('0x74')][_0x4120b9][_0xa18b('0x36')])&&_0xe95f47['joins'][_0x4120b9][_0xa18b('0x76')]&&_0xe95f47[_0xa18b('0x74')][_0x4120b9][_0xa18b('0x77')]&&_0xe95f47['joins'][_0x4120b9][_0xa18b('0x78')]){_0x42555e[_0xe95f47['joins'][_0x4120b9][_0xa18b('0x36')]](_0xe95f47[_0xa18b('0x74')][_0x4120b9][_0xa18b('0x77')],null,util[_0xa18b('0x70')](_0xa18b('0x79'),_0xe95f47[_0xa18b('0x6c')],_0xe95f47['joins'][_0x4120b9][_0xa18b('0x76')],_0xe95f47[_0xa18b('0x74')][_0x4120b9]['foreignTable'],_0xe95f47[_0xa18b('0x74')][_0x4120b9][_0xa18b('0x78')]));}}}if(_0xe95f47[_0xa18b('0x7a')]){_0xe95f47[_0xa18b('0x7a')]=JSON[_0xa18b('0x75')](_0xe95f47[_0xa18b('0x7a')]);_0x42555e['where'](_0x4aad04(_0xe95f47[_0xa18b('0x7a')][_0xa18b('0x63')]));}_0x37900c=_0x42555e[_0xa18b('0x7b')]();_0x42555e[_0xa18b('0x18')](_0x21aab2);_0x42555e[_0xa18b('0x17')](0x0);logger[_0xa18b('0x8a')](_0xa18b('0x7c'),_0x42555e['toString']());return db[_0xa18b('0x7d')][_0xa18b('0x29')](_0x42555e[_0xa18b('0x8b')](),{'type':db[_0xa18b('0x7d')][_0xa18b('0x8c')]['SELECT']});}})[_0xa18b('0x1f')](function(_0x559988){if(!_0x559988['length']){throw new db[(_0xa18b('0x66'))]['ValidationErrorItem'](_0xa18b('0x8d'),0xcc);}if(_0xaffd6b[_0xa18b('0x8e')]==='web'){return null;}var _0x45d09e=_['merge'](_0xaffd6b,{'name':_0xaffd6b[_0xa18b('0x8f')]||_0xaffd6b[_0xa18b('0x24')]||_0xe95f47[_0xa18b('0x24')],'basename':_0x3329ce,'savename':util[_0xa18b('0x70')](_0xa18b('0x90'),_0xaffd6b[_0xa18b('0x24')]||_0xe95f47[_0xa18b('0x24')],require('randomstring')[_0xa18b('0x91')](0x4),_0xaffd6b[_0xa18b('0x8e')]||'csv'),'reportId':_0xe95f47['id'],'reportType':_0xa18b('0x92')});return db[_0xa18b('0x93')][_0xa18b('0x42')](_0x45d09e,{'raw':!![]});})[_0xa18b('0x1f')](function(_0x54c54d){if(_0xe95f47['table']===_0xa18b('0x94')){_0x37900c[_0xa18b('0x32')](_0xe95f47[_0xa18b('0x6c')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xaffd6b['startDate'],_0xaffd6b[_0xa18b('0x95')]);}else{_0x37900c['where'](_0xe95f47[_0xa18b('0x6c')]+_0xa18b('0x96'),_0xaffd6b[_0xa18b('0x97')],_0xaffd6b[_0xa18b('0x95')]);}if(_0x54c54d){logger[_0xa18b('0x98')](_0xa18b('0x99'),_0x37900c[_0xa18b('0x8b')]());require(_0xa18b('0x9a'))[_0xa18b('0x9b')](path[_0xa18b('0x50')](__dirname,_0xa18b('0x9c'),_0x54c54d[_0xa18b('0x8e')]),[_0x54c54d['id'],_0x37900c['toString'](),path[_0xa18b('0x50')](__dirname,'../../files/reports',_0x54c54d[_0xa18b('0x9d')]),_0x3329ce]);return _0x54c54d;}else{var _0x530015=squel['select']();_0x530015[_0xa18b('0x6b')]('('+_0x37900c[_0xa18b('0x8b')]()+')',_0xa18b('0x9e'));_0x530015[_0xa18b('0x64')](_0xa18b('0x9f'),_0xa18b('0x16'));_0x37900c['limit'](_0xaffd6b[_0xa18b('0x18')]||_0x21aab2);_0x37900c[_0xa18b('0x17')](_0xaffd6b[_0xa18b('0x17')]||0x0);return db[_0xa18b('0x7d')][_0xa18b('0x29')](_0x530015[_0xa18b('0x8b')](),{'type':db[_0xa18b('0x7d')][_0xa18b('0x8c')][_0xa18b('0x7e')]})[_0xa18b('0x1f')](function(_0xb81fc0){if(!_0xb81fc0[_0xa18b('0x2e')]){_0x3377da=0x0;}else{_0x3377da=_0xb81fc0[0x0][_0xa18b('0x16')]||0x0;}return db[_0xa18b('0x7d')]['query'](_0x37900c[_0xa18b('0x8b')](),{'type':db['sequelize'][_0xa18b('0x8c')][_0xa18b('0x7e')]});})['then'](function(_0x3bf0af){return{'rows':_0x3bf0af||[],'count':_0x3377da};});}});}exports[_0xa18b('0xa0')]=function(_0x5b7c3b,_0x3315e6){return runReport(_0x5b7c3b['params'],_0x5b7c3b['query'],_0x5b7c3b[_0xa18b('0x40')])['then'](respondWithResult(_0x3315e6,null))[_0xa18b('0x3c')](handleError(_0x3315e6,null));};exports[_0xa18b('0xa1')]=runReport;exports['query']=function(_0x333bb0,_0x57351c){var _0x389a35=0xa;var _0x4c11e1=[_0xa18b('0x50'),_0xa18b('0x7f'),_0xa18b('0x51'),_0xa18b('0x52')];var _0x431f2e={'SUM':'SUM(%s)','COUNT':_0xa18b('0x54'),'COUNT DISTINCT':_0xa18b('0x55'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xa18b('0x81'),'GROUP_CONCAT':_0xa18b('0x82'),'GROUP_CONCAT ASC':_0xa18b('0x57'),'GROUP_CONCAT DESC':_0xa18b('0x83')};var _0x511964={'SEC_TO_TIME':_0xa18b('0x58'),'DATE':'DATE(%s)','HOUR':_0xa18b('0x59'),'ROUND':_0xa18b('0x5a'),'UNIX_TIMESTAMP':_0xa18b('0x5b')};var _0x22ea60=function(_0x9b2c43){return!_['includes']([_0xa18b('0x5d'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xa18b('0x60')],_0x9b2c43);};var _0x1600d4=function(_0x1c261c){if(!_0x1c261c||!_0x1c261c['rules']['length']){return'';}for(var _0x592cdc='(',_0xa7da14=0x0;_0xa7da14<_0x1c261c[_0xa18b('0x61')][_0xa18b('0x2e')];_0xa7da14+=0x1){_0xa7da14>0x0&&(_0x592cdc+='\x20'+_0x1c261c[_0xa18b('0x62')]+'\x20');_0x592cdc+=_0x1c261c[_0xa18b('0x61')][_0xa7da14][_0xa18b('0x63')]?_0x1600d4(_0x1c261c[_0xa18b('0x61')][_0xa7da14][_0xa18b('0x63')]):_0x1c261c[_0xa18b('0x61')][_0xa7da14][_0xa18b('0x64')]+'\x20'+_0x1c261c['rules'][_0xa7da14][_0xa18b('0x65')]+(_0x22ea60(_0x1c261c[_0xa18b('0x61')][_0xa7da14]['condition'])?'\x20'+_0x1c261c[_0xa18b('0x61')][_0xa7da14][_0xa18b('0x85')]:'');}return _0x592cdc+')';};var _0xfed362={'where':{'id':_0x333bb0[_0xa18b('0x3e')]['id']}},_0x2292fe,_0x25a10d,_0x3665ca,_0x32eb26,_0x3d24b0;_0xfed362=_[_0xa18b('0x34')]({},_0xfed362,_0x333bb0['options']);return db[_0xa18b('0x26')][_0xa18b('0x41')](_0xfed362)['then'](function(_0x3500b6){if(_0x3500b6){_0x2292fe=_0x3500b6;return _0x3500b6[_0xa18b('0x86')]();}return null;})[_0xa18b('0x1f')](function(_0x3d2616){if(_0x3d2616){if(!_0x3d2616[_0xa18b('0x2e')]){throw new db['Sequelize'][(_0xa18b('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x25a10d=_0x3d2616;return db[_0xa18b('0x69')][_0xa18b('0x3a')]({'raw':!![]});}return null;})[_0xa18b('0x1f')](function(_0x67ca5e){if(_0x67ca5e){_0x3665ca=_[_0xa18b('0x6a')](_0x67ca5e,'id');var _0x344a3c;var _0x33b8b0=squel[_0xa18b('0x87')]();_0x33b8b0['from'](_0x2292fe[_0xa18b('0x6c')]);for(var _0x16c455=0x0;_0x16c455<_0x25a10d[_0xa18b('0x2e')];_0x16c455+=0x1){_0x344a3c=_0x25a10d[_0x16c455][_0xa18b('0x6d')]?_0x3665ca[_0x25a10d[_0x16c455][_0xa18b('0x6d')]][_0xa18b('0x88')]:_0x25a10d[_0x16c455][_0xa18b('0x64')];_0x344a3c=_0x25a10d[_0x16c455][_0xa18b('0x6e')]?_['replace'](_0x431f2e[_0x25a10d[_0x16c455][_0xa18b('0x6e')]],'%s',_0x344a3c):_0x344a3c;_0x344a3c=_0x25a10d[_0x16c455][_0xa18b('0x70')]?_[_0xa18b('0x6f')](_0x511964[_0x25a10d[_0x16c455][_0xa18b('0x70')]],'%s',_0x344a3c):_0x344a3c;if(_0x25a10d[_0x16c455]['groupBy']){_0x33b8b0['group'](_0x344a3c);}_0x25a10d[_0x16c455][_0xa18b('0x71')]&&_0x33b8b0['order'](_0x344a3c,_0x25a10d[_0x16c455][_0xa18b('0x71')]===_0xa18b('0x72')?![]:!![]);_0x33b8b0[_0xa18b('0x64')](_0x344a3c,_0x25a10d[_0x16c455][_0xa18b('0x73')]||_0x344a3c);}if(_0x2292fe['joins']){_0x2292fe[_0xa18b('0x74')]=JSON[_0xa18b('0x75')](_0x2292fe['joins']);for(var _0x5836d4=0x0;_0x5836d4<_0x2292fe['joins'][_0xa18b('0x2e')];_0x5836d4+=0x1){if(_0x2292fe['joins'][_0x5836d4][_0xa18b('0x36')]&&_[_0xa18b('0x5c')](_0x4c11e1,_0x2292fe[_0xa18b('0x74')][_0x5836d4][_0xa18b('0x36')])&&_0x2292fe[_0xa18b('0x74')][_0x5836d4][_0xa18b('0x76')]&&_0x2292fe[_0xa18b('0x74')][_0x5836d4][_0xa18b('0x77')]&&_0x2292fe[_0xa18b('0x74')][_0x5836d4][_0xa18b('0x78')]){_0x33b8b0[_0x2292fe['joins'][_0x5836d4][_0xa18b('0x36')]](_0x2292fe[_0xa18b('0x74')][_0x5836d4][_0xa18b('0x77')],null,util[_0xa18b('0x70')](_0xa18b('0x79'),_0x2292fe[_0xa18b('0x6c')],_0x2292fe[_0xa18b('0x74')][_0x5836d4][_0xa18b('0x76')],_0x2292fe[_0xa18b('0x74')][_0x5836d4][_0xa18b('0x77')],_0x2292fe[_0xa18b('0x74')][_0x5836d4][_0xa18b('0x78')]));}}}if(_0x2292fe[_0xa18b('0x7a')]){_0x2292fe['conditions']=JSON[_0xa18b('0x75')](_0x2292fe[_0xa18b('0x7a')]);_0x33b8b0[_0xa18b('0x32')](_0x1600d4(_0x2292fe[_0xa18b('0x7a')]['group']));}_0x3d24b0=_0x33b8b0[_0xa18b('0x7b')]();_0x33b8b0[_0xa18b('0x18')](_0x389a35);_0x33b8b0[_0xa18b('0x17')](0x0);logger[_0xa18b('0x8a')](_0xa18b('0x7c'),_0x33b8b0[_0xa18b('0x8b')]());return db[_0xa18b('0x7d')][_0xa18b('0x29')](_0x33b8b0[_0xa18b('0x8b')](),{'type':db[_0xa18b('0x7d')]['QueryTypes']['SELECT']});}})['then'](function(){return{'sql':_0x3d24b0[_0xa18b('0x8b')]()};})[_0xa18b('0x1f')](respondWithResult(_0x57351c,null))[_0xa18b('0x3c')](handleError(_0x57351c,null));}; \ No newline at end of file +var _0xadf3=['filter','options','include','findAll','rows','show','includeAll','find','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','CustomReports','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','MetricId','metric','function','replace','format','orderBy','DESC','joins','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','parse','clone','Limited\x20Query:','toString','sequelize','QueryTypes','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NOT\x20NULL','Sequelize','from','groupBy','alias','type','debug','SELECT','web','fullPath','generate','csv','custom','AnalyticExtractedReport','cdr','startDate','endDate','info','child_process','fork','../../components/export/','output','../../files/reports','savename','countTable','runReport','HOUR(%s)','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','count','offset','limit','set','apply','reject','update','destroy','then','UserProfileResource','sendStatus','stack','name','send','index','AnalyticCustomReport','model','keys','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','merge','VIRTUAL'];(function(_0x5489c4,_0x1e7a17){var _0x2c4624=function(_0x42675a){while(--_0x42675a){_0x5489c4['push'](_0x5489c4['shift']());}};_0x2c4624(++_0x1e7a17);}(_0xadf3,0x19d));var _0x3adf=function(_0x4a2fcb,_0x400b85){_0x4a2fcb=_0x4a2fcb-0x0;var _0x4d5a9b=_0xadf3[_0x4a2fcb];return _0x4d5a9b;};'use strict';var pdf=require(_0x3adf('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x3adf('0x1'));var zipdir=require(_0x3adf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3adf('0x3'));var moment=require(_0x3adf('0x4'));var BPromise=require(_0x3adf('0x5'));var Mustache=require('mustache');var util=require(_0x3adf('0x6'));var path=require('path');var sox=require(_0x3adf('0x7'));var csv=require(_0x3adf('0x8'));var ejs=require(_0x3adf('0x9'));var fs=require('fs');var _=require(_0x3adf('0xa'));var squel=require(_0x3adf('0xb'));var crypto=require(_0x3adf('0xc'));var jsforce=require(_0x3adf('0xd'));var deskjs=require(_0x3adf('0xe'));var toCsv=require(_0x3adf('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3adf('0xf'));var authService=require(_0x3adf('0x10'));var qs=require(_0x3adf('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3adf('0x12'))(_0x3adf('0x13'));var utils=require(_0x3adf('0x14'));var config=require(_0x3adf('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e4714,_0xc236f3){_0xc236f3=_0xc236f3||0xcc;return function(_0x1463e4){if(_0x1463e4){return _0x1e4714['sendStatus'](_0xc236f3);}return _0x1e4714[_0x3adf('0x16')](_0xc236f3)[_0x3adf('0x17')]();};}function respondWithResult(_0x14038b,_0x547ead){_0x547ead=_0x547ead||0xc8;return function(_0xe578ee){if(_0xe578ee){return _0x14038b[_0x3adf('0x16')](_0x547ead)[_0x3adf('0x18')](_0xe578ee);}};}function respondWithFilteredResult(_0x5e071f,_0x24b239){return function(_0x5e96de){if(_0x5e96de){var _0x323df3=_0x5e96de[_0x3adf('0x19')],_0x2d04fe=_0x24b239[_0x3adf('0x1a')],_0x46f0ee=_0x24b239['offset']+_0x24b239[_0x3adf('0x1b')],_0x28d191;if(_0x46f0ee>=_0x323df3){_0x46f0ee=_0x323df3;_0x28d191=0xc8;}else{_0x28d191=0xce;}_0x5e071f['status'](_0x28d191);return _0x5e071f[_0x3adf('0x1c')]('Content-Range',_0x2d04fe+'-'+_0x46f0ee+'/'+_0x323df3)[_0x3adf('0x18')](_0x5e96de);}return null;};}function patchUpdates(_0x266d50){return function(_0x2d6c8b){try{jsonpatch[_0x3adf('0x1d')](_0x2d6c8b,_0x266d50,!![]);}catch(_0xf4a4c){return BPromise[_0x3adf('0x1e')](_0xf4a4c);}return _0x2d6c8b['save']();};}function saveUpdates(_0x2753c9,_0x207629){return function(_0x23a25d){if(_0x23a25d){return _0x23a25d[_0x3adf('0x1f')](_0x2753c9)['then'](function(_0xf6ff3e){return _0xf6ff3e;});}return null;};}function removeEntity(_0x250e94,_0x22ea04){return function(_0x48230a){if(_0x48230a){return _0x48230a[_0x3adf('0x20')]()[_0x3adf('0x21')](function(){var _0x287cca=_0x48230a['get']({'plain':!![]});var _0xfb83e='CustomReports';return db[_0x3adf('0x22')][_0x3adf('0x20')]({'where':{'type':_0xfb83e,'resourceId':_0x287cca['id']}})[_0x3adf('0x21')](function(){return _0x48230a;});})['then'](function(){_0x250e94[_0x3adf('0x16')](0xcc)[_0x3adf('0x17')]();});}};}function handleEntityNotFound(_0x481248,_0x538a03){return function(_0x1d7d5d){if(!_0x1d7d5d){_0x481248[_0x3adf('0x23')](0x194);}return _0x1d7d5d;};}function handleError(_0x2f7db3,_0x667154){_0x667154=_0x667154||0x1f4;return function(_0x1c509a){logger['error'](_0x1c509a[_0x3adf('0x24')]);if(_0x1c509a[_0x3adf('0x25')]){delete _0x1c509a['name'];}_0x2f7db3['status'](_0x667154)[_0x3adf('0x26')](_0x1c509a);};}exports[_0x3adf('0x27')]=function(_0x4a04ad,_0x2a9868){var _0x344f7d={},_0x50f46e={},_0x3d540b={'count':0x0,'rows':[]};var _0x4ffac9=db[_0x3adf('0x28')]['rawAttributes'];_0x50f46e[_0x3adf('0x29')]=_[_0x3adf('0x2a')](_0x4ffac9);_0x50f46e[_0x3adf('0x2b')]=_[_0x3adf('0x2a')](_0x4a04ad[_0x3adf('0x2b')]);_0x50f46e['filters']=_['intersection'](_0x50f46e[_0x3adf('0x29')],_0x50f46e['query']);_0x344f7d['attributes']=_[_0x3adf('0x2c')](_0x50f46e[_0x3adf('0x29')],qs[_0x3adf('0x2d')](_0x4a04ad[_0x3adf('0x2b')][_0x3adf('0x2d')]));_0x344f7d['attributes']=_0x344f7d[_0x3adf('0x2e')][_0x3adf('0x2f')]?_0x344f7d[_0x3adf('0x2e')]:_0x50f46e['model'];if(!_0x4a04ad['query']['hasOwnProperty'](_0x3adf('0x30'))){_0x344f7d[_0x3adf('0x1b')]=qs[_0x3adf('0x1b')](_0x4a04ad['query'][_0x3adf('0x1b')]);_0x344f7d[_0x3adf('0x1a')]=qs[_0x3adf('0x1a')](_0x4a04ad['query']['offset']);}_0x344f7d[_0x3adf('0x31')]=qs[_0x3adf('0x32')](_0x4a04ad[_0x3adf('0x2b')][_0x3adf('0x32')]);_0x344f7d[_0x3adf('0x33')]=qs[_0x3adf('0x34')](_['pick'](_0x4a04ad[_0x3adf('0x2b')],_0x50f46e[_0x3adf('0x34')]));if(_0x4a04ad[_0x3adf('0x2b')]['filter']){_0x344f7d['where']=_[_0x3adf('0x35')](_0x344f7d[_0x3adf('0x33')],{'$or':_['map'](_0x4ffac9,function(_0x3b9ddc){if(_0x3b9ddc['type']['key']!==_0x3adf('0x36')){var _0x45ef60={};_0x45ef60[_0x3b9ddc['field']]={'$like':'%'+_0x4a04ad[_0x3adf('0x2b')][_0x3adf('0x37')]+'%'};return _0x45ef60;}})});}_0x344f7d=_[_0x3adf('0x35')]({},_0x344f7d,_0x4a04ad[_0x3adf('0x38')]);var _0x21c722={'where':_0x344f7d[_0x3adf('0x33')]};return db[_0x3adf('0x28')][_0x3adf('0x19')](_0x21c722)[_0x3adf('0x21')](function(_0x5d647e){_0x3d540b['count']=_0x5d647e;if(_0x4a04ad[_0x3adf('0x2b')]['includeAll']){_0x344f7d[_0x3adf('0x39')]=[{'all':!![]}];}return db[_0x3adf('0x28')][_0x3adf('0x3a')](_0x344f7d);})[_0x3adf('0x21')](function(_0xd20f13){_0x3d540b[_0x3adf('0x3b')]=_0xd20f13;return _0x3d540b;})['then'](respondWithFilteredResult(_0x2a9868,_0x344f7d))['catch'](handleError(_0x2a9868,null));};exports[_0x3adf('0x3c')]=function(_0x2b4a30,_0x4c34e4){var _0xd4e300={'raw':![],'where':{'id':_0x2b4a30['params']['id']}},_0x9cf1bf={};_0x9cf1bf[_0x3adf('0x29')]=_[_0x3adf('0x2a')](db['AnalyticCustomReport']['rawAttributes']);_0x9cf1bf[_0x3adf('0x2b')]=_[_0x3adf('0x2a')](_0x2b4a30[_0x3adf('0x2b')]);_0x9cf1bf[_0x3adf('0x34')]=_[_0x3adf('0x2c')](_0x9cf1bf['model'],_0x9cf1bf[_0x3adf('0x2b')]);_0xd4e300[_0x3adf('0x2e')]=_[_0x3adf('0x2c')](_0x9cf1bf[_0x3adf('0x29')],qs[_0x3adf('0x2d')](_0x2b4a30['query'][_0x3adf('0x2d')]));_0xd4e300[_0x3adf('0x2e')]=_0xd4e300[_0x3adf('0x2e')]['length']?_0xd4e300[_0x3adf('0x2e')]:_0x9cf1bf['model'];if(_0x2b4a30[_0x3adf('0x2b')][_0x3adf('0x3d')]){_0xd4e300[_0x3adf('0x39')]=[{'all':!![]}];}_0xd4e300=_[_0x3adf('0x35')]({},_0xd4e300,_0x2b4a30['options']);return db[_0x3adf('0x28')][_0x3adf('0x3e')](_0xd4e300)[_0x3adf('0x21')](handleEntityNotFound(_0x4c34e4,null))[_0x3adf('0x21')](respondWithResult(_0x4c34e4,null))['catch'](handleError(_0x4c34e4,null));};exports['create']=function(_0x4fc03d,_0x440ba1){return db['AnalyticCustomReport']['create'](_0x4fc03d['body'],{})['then'](function(_0x46b19c){var _0x4adbd2=_0x4fc03d[_0x3adf('0x3f')][_0x3adf('0x40')]({'plain':!![]});if(!_0x4adbd2)throw new Error(_0x3adf('0x41'));if(_0x4adbd2[_0x3adf('0x42')]===_0x3adf('0x3f')){var _0x432ff2=_0x46b19c[_0x3adf('0x40')]({'plain':!![]});var _0x1aa017=_0x3adf('0x43');return db[_0x3adf('0x44')][_0x3adf('0x3e')]({'where':{'name':_0x1aa017,'userProfileId':_0x4adbd2['userProfileId']},'raw':!![]})[_0x3adf('0x21')](function(_0x58e89c){if(_0x58e89c&&_0x58e89c[_0x3adf('0x45')]===0x0){return db[_0x3adf('0x22')]['create']({'name':_0x432ff2[_0x3adf('0x25')],'resourceId':_0x432ff2['id'],'type':_0x3adf('0x46'),'sectionId':_0x58e89c['id']},{})[_0x3adf('0x21')](function(){return _0x46b19c;});}else{return _0x46b19c;}})[_0x3adf('0x47')](function(_0x5f118f){logger[_0x3adf('0x48')](_0x3adf('0x49'),_0x5f118f);throw _0x5f118f;});}return _0x46b19c;})['then'](respondWithResult(_0x440ba1,0xc9))[_0x3adf('0x47')](handleError(_0x440ba1,null));};exports[_0x3adf('0x1f')]=function(_0x45e38a,_0x542fa3){if(_0x45e38a['body']['id']){delete _0x45e38a[_0x3adf('0x4a')]['id'];}return db['AnalyticCustomReport'][_0x3adf('0x3e')]({'where':{'id':_0x45e38a[_0x3adf('0x4b')]['id']}})[_0x3adf('0x21')](handleEntityNotFound(_0x542fa3,null))[_0x3adf('0x21')](saveUpdates(_0x45e38a[_0x3adf('0x4a')],null))['then'](respondWithResult(_0x542fa3,null))[_0x3adf('0x47')](handleError(_0x542fa3,null));};exports[_0x3adf('0x20')]=function(_0x2ac9e5,_0x204ab4){return db[_0x3adf('0x28')]['find']({'where':{'id':_0x2ac9e5[_0x3adf('0x4b')]['id']}})[_0x3adf('0x21')](handleEntityNotFound(_0x204ab4,null))['then'](removeEntity(_0x204ab4,null))[_0x3adf('0x47')](handleError(_0x204ab4,null));};exports['preview']=function(_0x173760,_0x1ef1d0){var _0x791146=0xa;var _0x70556=[_0x3adf('0x4c'),_0x3adf('0x4d'),_0x3adf('0x4e'),_0x3adf('0x4f')];var _0x89394d={'SUM':_0x3adf('0x50'),'COUNT':_0x3adf('0x51'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x3adf('0x52'),'MIN':_0x3adf('0x53'),'AVG':_0x3adf('0x54'),'GROUP_CONCAT':_0x3adf('0x55'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x47e02={'SEC_TO_TIME':_0x3adf('0x56'),'DATE':_0x3adf('0x57'),'HOUR':'HOUR(%s)','ROUND':_0x3adf('0x58'),'UNIX_TIMESTAMP':_0x3adf('0x59')};var _0x3f40cb=function(_0x20cff2){return!_[_0x3adf('0x5a')]([_0x3adf('0x5b'),'IS\x20NOT\x20NULL',_0x3adf('0x5c'),_0x3adf('0x5d')],_0x20cff2);};var _0x46c64b=function(_0x488ce8){if(!_0x488ce8||!_0x488ce8[_0x3adf('0x5e')][_0x3adf('0x2f')]){return'';}for(var _0x422c91='(',_0x50abb6=0x0;_0x50abb6<_0x488ce8['rules']['length'];_0x50abb6+=0x1){_0x50abb6>0x0&&(_0x422c91+='\x20'+_0x488ce8[_0x3adf('0x5f')]+'\x20');_0x422c91+=_0x488ce8[_0x3adf('0x5e')][_0x50abb6][_0x3adf('0x60')]?_0x46c64b(_0x488ce8['rules'][_0x50abb6][_0x3adf('0x60')]):_0x488ce8[_0x3adf('0x5e')][_0x50abb6][_0x3adf('0x61')]+'\x20'+_0x488ce8[_0x3adf('0x5e')][_0x50abb6][_0x3adf('0x62')]+(_0x3f40cb(_0x488ce8[_0x3adf('0x5e')][_0x50abb6][_0x3adf('0x62')])?'\x20'+_0x488ce8[_0x3adf('0x5e')][_0x50abb6][_0x3adf('0x63')]:'');}return _0x422c91+')';};var _0x14baef={'where':{'id':_0x173760['params']['id']}},_0x19abfd,_0x242dd4,_0x12025a,_0x30f2c4,_0x4b96e1;_0x14baef=_[_0x3adf('0x35')]({},_0x14baef,_0x173760[_0x3adf('0x38')]);return db[_0x3adf('0x28')][_0x3adf('0x3e')](_0x14baef)[_0x3adf('0x21')](function(_0x2221a9){if(_0x2221a9){_0x19abfd=_0x2221a9;return _0x2221a9[_0x3adf('0x64')]();}return null;})['then'](function(_0x2f2e88){if(_0x2f2e88){if(!_0x2f2e88['length']){throw new db['Sequelize'][(_0x3adf('0x65'))](_0x3adf('0x66'),0x193);}_0x242dd4=_0x2f2e88;return db[_0x3adf('0x67')][_0x3adf('0x3a')]({'raw':!![]});}return null;})['then'](function(_0x592723){if(_0x592723){_0x12025a=_[_0x3adf('0x68')](_0x592723,'id');var _0x2b8110;var _0x2e312c=squel[_0x3adf('0x69')]();_0x2e312c['from'](_0x19abfd['table']);for(var _0x35c943=0x0;_0x35c943<_0x242dd4[_0x3adf('0x2f')];_0x35c943+=0x1){_0x2b8110=_0x242dd4[_0x35c943][_0x3adf('0x6a')]?_0x12025a[_0x242dd4[_0x35c943][_0x3adf('0x6a')]][_0x3adf('0x6b')]:_0x242dd4[_0x35c943][_0x3adf('0x61')];_0x2b8110=_0x242dd4[_0x35c943][_0x3adf('0x6c')]?_[_0x3adf('0x6d')](_0x89394d[_0x242dd4[_0x35c943]['function']],'%s',_0x2b8110):_0x2b8110;_0x2b8110=_0x242dd4[_0x35c943][_0x3adf('0x6e')]?_[_0x3adf('0x6d')](_0x47e02[_0x242dd4[_0x35c943][_0x3adf('0x6e')]],'%s',_0x2b8110):_0x2b8110;if(_0x242dd4[_0x35c943]['groupBy']){_0x2e312c[_0x3adf('0x60')](_0x2b8110);}_0x242dd4[_0x35c943][_0x3adf('0x6f')]&&_0x2e312c['order'](_0x2b8110,_0x242dd4[_0x35c943][_0x3adf('0x6f')]===_0x3adf('0x70')?![]:!![]);_0x2e312c[_0x3adf('0x61')](_0x2b8110,_0x242dd4[_0x35c943]['alias']||_0x2b8110);}if(_0x19abfd[_0x3adf('0x71')]){_0x19abfd[_0x3adf('0x71')]=JSON['parse'](_0x19abfd[_0x3adf('0x71')]);for(var _0x102404=0x0;_0x102404<_0x19abfd[_0x3adf('0x71')][_0x3adf('0x2f')];_0x102404+=0x1){if(_0x19abfd[_0x3adf('0x71')][_0x102404]['type']&&_[_0x3adf('0x5a')](_0x70556,_0x19abfd[_0x3adf('0x71')][_0x102404]['type'])&&_0x19abfd[_0x3adf('0x71')][_0x102404]['parentKey']&&_0x19abfd[_0x3adf('0x71')][_0x102404][_0x3adf('0x72')]&&_0x19abfd[_0x3adf('0x71')][_0x102404][_0x3adf('0x73')]){_0x2e312c[_0x19abfd[_0x3adf('0x71')][_0x102404]['type']](_0x19abfd[_0x3adf('0x71')][_0x102404][_0x3adf('0x72')],null,util['format'](_0x3adf('0x74'),_0x19abfd[_0x3adf('0x75')],_0x19abfd['joins'][_0x102404][_0x3adf('0x76')],_0x19abfd['joins'][_0x102404]['foreignTable'],_0x19abfd[_0x3adf('0x71')][_0x102404][_0x3adf('0x73')]));}}}if(_0x19abfd['conditions']){_0x19abfd[_0x3adf('0x77')]=JSON[_0x3adf('0x78')](_0x19abfd[_0x3adf('0x77')]);_0x2e312c[_0x3adf('0x33')](_0x46c64b(_0x19abfd[_0x3adf('0x77')][_0x3adf('0x60')]));}_0x4b96e1=_0x2e312c[_0x3adf('0x79')]();_0x2e312c[_0x3adf('0x1b')](_0x791146);_0x2e312c[_0x3adf('0x1a')](0x0);logger['debug'](_0x3adf('0x7a'),_0x2e312c[_0x3adf('0x7b')]());return db['sequelize']['query'](_0x2e312c[_0x3adf('0x7b')](),{'type':db[_0x3adf('0x7c')][_0x3adf('0x7d')]['SELECT']});}})[_0x3adf('0x21')](respondWithResult(_0x1ef1d0,null))['catch'](handleError(_0x1ef1d0,null));};function runReport(_0x32d63e,_0x361e51,_0x5dfe11){var _0x278a19=_0x361e51[_0x3adf('0x25')];var _0x5d5169=0xa;var _0x4a8e83=['join',_0x3adf('0x4d'),_0x3adf('0x4e'),_0x3adf('0x4f')];var _0x1cfd74={'SUM':_0x3adf('0x50'),'COUNT':_0x3adf('0x51'),'COUNT DISTINCT':_0x3adf('0x7e'),'MAX':'MAX(%s)','MIN':_0x3adf('0x53'),'AVG':_0x3adf('0x54'),'GROUP_CONCAT':_0x3adf('0x55'),'GROUP_CONCAT ASC':_0x3adf('0x7f'),'GROUP_CONCAT DESC':_0x3adf('0x80')};var _0x56c9b4={'SEC_TO_TIME':_0x3adf('0x56'),'DATE':_0x3adf('0x57'),'HOUR':'HOUR(%s)','ROUND':_0x3adf('0x58'),'UNIX_TIMESTAMP':_0x3adf('0x59')};var _0x1b7675=function(_0x4deccf){return!_[_0x3adf('0x5a')]([_0x3adf('0x5b'),_0x3adf('0x81'),'IS\x20EMPTY',_0x3adf('0x5d')],_0x4deccf);};var _0x4efe74=function(_0x5df779){if(!_0x5df779||!_0x5df779['rules']['length']){return'';}for(var _0x27e769='(',_0x210592=0x0;_0x210592<_0x5df779[_0x3adf('0x5e')][_0x3adf('0x2f')];_0x210592+=0x1){_0x210592>0x0&&(_0x27e769+='\x20'+_0x5df779[_0x3adf('0x5f')]+'\x20');_0x27e769+=_0x5df779['rules'][_0x210592][_0x3adf('0x60')]?_0x4efe74(_0x5df779[_0x3adf('0x5e')][_0x210592][_0x3adf('0x60')]):_0x5df779[_0x3adf('0x5e')][_0x210592][_0x3adf('0x61')]+'\x20'+_0x5df779[_0x3adf('0x5e')][_0x210592]['condition']+(_0x1b7675(_0x5df779[_0x3adf('0x5e')][_0x210592][_0x3adf('0x62')])?'\x20'+_0x5df779[_0x3adf('0x5e')][_0x210592][_0x3adf('0x63')]:'');}return _0x27e769+')';};var _0x2e2837={'where':{'id':_0x32d63e['id']}},_0x3c400b,_0x1c26fd,_0x47827d,_0x4a9ae9,_0x24f13d;_0x2e2837=_['merge']({},_0x2e2837,_0x5dfe11);return db[_0x3adf('0x28')][_0x3adf('0x3e')](_0x2e2837)[_0x3adf('0x21')](function(_0x4706e5){if(_0x4706e5){_0x3c400b=_0x4706e5;return _0x4706e5['getFields']();}return null;})[_0x3adf('0x21')](function(_0x26d560){if(_0x26d560){if(!_0x26d560[_0x3adf('0x2f')]){throw new db[(_0x3adf('0x82'))][(_0x3adf('0x65'))](_0x3adf('0x66'),0x193);}_0x1c26fd=_0x26d560;return db[_0x3adf('0x67')][_0x3adf('0x3a')]({'raw':!![]});}return null;})[_0x3adf('0x21')](function(_0x1f8bfc){if(_0x1f8bfc){_0x47827d=_['keyBy'](_0x1f8bfc,'id');var _0x578b79;var _0x9e52a9=squel[_0x3adf('0x69')]();_0x9e52a9[_0x3adf('0x83')](_0x3c400b['table']);for(var _0x421b39=0x0;_0x421b39<_0x1c26fd[_0x3adf('0x2f')];_0x421b39+=0x1){_0x578b79=_0x1c26fd[_0x421b39]['MetricId']?_0x47827d[_0x1c26fd[_0x421b39][_0x3adf('0x6a')]][_0x3adf('0x6b')]:_0x1c26fd[_0x421b39][_0x3adf('0x61')];_0x578b79=_0x1c26fd[_0x421b39][_0x3adf('0x6c')]?_['replace'](_0x1cfd74[_0x1c26fd[_0x421b39]['function']],'%s',_0x578b79):_0x578b79;_0x578b79=_0x1c26fd[_0x421b39][_0x3adf('0x6e')]?_[_0x3adf('0x6d')](_0x56c9b4[_0x1c26fd[_0x421b39][_0x3adf('0x6e')]],'%s',_0x578b79):_0x578b79;if(_0x1c26fd[_0x421b39][_0x3adf('0x84')]){_0x9e52a9[_0x3adf('0x60')](_0x578b79);}_0x1c26fd[_0x421b39]['orderBy']&&_0x9e52a9[_0x3adf('0x31')](_0x578b79,_0x1c26fd[_0x421b39][_0x3adf('0x6f')]===_0x3adf('0x70')?![]:!![]);_0x9e52a9[_0x3adf('0x61')](_0x578b79,_0x1c26fd[_0x421b39][_0x3adf('0x85')]||_0x578b79);}if(_0x3c400b[_0x3adf('0x71')]){_0x3c400b[_0x3adf('0x71')]=JSON[_0x3adf('0x78')](_0x3c400b[_0x3adf('0x71')]);for(var _0xa97d08=0x0;_0xa97d08<_0x3c400b[_0x3adf('0x71')][_0x3adf('0x2f')];_0xa97d08+=0x1){if(_0x3c400b[_0x3adf('0x71')][_0xa97d08][_0x3adf('0x86')]&&_[_0x3adf('0x5a')](_0x4a8e83,_0x3c400b[_0x3adf('0x71')][_0xa97d08]['type'])&&_0x3c400b[_0x3adf('0x71')][_0xa97d08][_0x3adf('0x76')]&&_0x3c400b[_0x3adf('0x71')][_0xa97d08]['foreignTable']&&_0x3c400b['joins'][_0xa97d08][_0x3adf('0x73')]){_0x9e52a9[_0x3c400b[_0x3adf('0x71')][_0xa97d08][_0x3adf('0x86')]](_0x3c400b['joins'][_0xa97d08][_0x3adf('0x72')],null,util[_0x3adf('0x6e')](_0x3adf('0x74'),_0x3c400b[_0x3adf('0x75')],_0x3c400b[_0x3adf('0x71')][_0xa97d08]['parentKey'],_0x3c400b['joins'][_0xa97d08][_0x3adf('0x72')],_0x3c400b['joins'][_0xa97d08][_0x3adf('0x73')]));}}}if(_0x3c400b[_0x3adf('0x77')]){_0x3c400b[_0x3adf('0x77')]=JSON['parse'](_0x3c400b['conditions']);_0x9e52a9[_0x3adf('0x33')](_0x4efe74(_0x3c400b['conditions']['group']));}_0x24f13d=_0x9e52a9[_0x3adf('0x79')]();_0x9e52a9[_0x3adf('0x1b')](_0x5d5169);_0x9e52a9[_0x3adf('0x1a')](0x0);logger[_0x3adf('0x87')](_0x3adf('0x7a'),_0x9e52a9[_0x3adf('0x7b')]());return db[_0x3adf('0x7c')][_0x3adf('0x2b')](_0x9e52a9['toString'](),{'type':db[_0x3adf('0x7c')][_0x3adf('0x7d')][_0x3adf('0x88')]});}})[_0x3adf('0x21')](function(_0x189359){if(!_0x189359[_0x3adf('0x2f')]){throw new db[(_0x3adf('0x82'))][(_0x3adf('0x65'))]('No\x20available\x20data',0xcc);}if(_0x361e51['output']===_0x3adf('0x89')){return null;}var _0x254ac1=_[_0x3adf('0x35')](_0x361e51,{'name':_0x361e51[_0x3adf('0x8a')]||_0x361e51[_0x3adf('0x25')]||_0x3c400b[_0x3adf('0x25')],'basename':_0x278a19,'savename':util[_0x3adf('0x6e')]('%s-%s.%s',_0x361e51[_0x3adf('0x25')]||_0x3c400b[_0x3adf('0x25')],require('randomstring')[_0x3adf('0x8b')](0x4),_0x361e51['output']||_0x3adf('0x8c')),'reportId':_0x3c400b['id'],'reportType':_0x3adf('0x8d')});return db[_0x3adf('0x8e')]['create'](_0x254ac1,{'raw':!![]});})['then'](function(_0x2757c0){if(_0x3c400b['table']===_0x3adf('0x8f')){_0x24f13d[_0x3adf('0x33')](_0x3c400b['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x361e51[_0x3adf('0x90')],_0x361e51['endDate']);}else{_0x24f13d[_0x3adf('0x33')](_0x3c400b[_0x3adf('0x75')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x361e51['startDate'],_0x361e51[_0x3adf('0x91')]);}if(_0x2757c0){logger[_0x3adf('0x92')]('Run\x20Query:',_0x24f13d[_0x3adf('0x7b')]());require(_0x3adf('0x93'))[_0x3adf('0x94')](path[_0x3adf('0x4c')](__dirname,_0x3adf('0x95'),_0x2757c0[_0x3adf('0x96')]),[_0x2757c0['id'],_0x24f13d[_0x3adf('0x7b')](),path[_0x3adf('0x4c')](__dirname,_0x3adf('0x97'),_0x2757c0[_0x3adf('0x98')]),_0x278a19]);return _0x2757c0;}else{var _0x1347b9=squel['select']();_0x1347b9['from']('('+_0x24f13d[_0x3adf('0x7b')]()+')',_0x3adf('0x99'));_0x1347b9[_0x3adf('0x61')]('COUNT(*)',_0x3adf('0x19'));_0x24f13d[_0x3adf('0x1b')](_0x361e51[_0x3adf('0x1b')]||_0x5d5169);_0x24f13d[_0x3adf('0x1a')](_0x361e51[_0x3adf('0x1a')]||0x0);return db[_0x3adf('0x7c')][_0x3adf('0x2b')](_0x1347b9[_0x3adf('0x7b')](),{'type':db[_0x3adf('0x7c')][_0x3adf('0x7d')]['SELECT']})[_0x3adf('0x21')](function(_0x445cf1){if(!_0x445cf1[_0x3adf('0x2f')]){_0x4a9ae9=0x0;}else{_0x4a9ae9=_0x445cf1[0x0]['count']||0x0;}return db[_0x3adf('0x7c')][_0x3adf('0x2b')](_0x24f13d[_0x3adf('0x7b')](),{'type':db['sequelize']['QueryTypes'][_0x3adf('0x88')]});})[_0x3adf('0x21')](function(_0x3330c6){return{'rows':_0x3330c6||[],'count':_0x4a9ae9};});}});}exports['run']=function(_0x2901e4,_0x1123f2){return runReport(_0x2901e4[_0x3adf('0x4b')],_0x2901e4[_0x3adf('0x2b')],_0x2901e4[_0x3adf('0x38')])['then'](respondWithResult(_0x1123f2,null))[_0x3adf('0x47')](handleError(_0x1123f2,null));};exports[_0x3adf('0x9a')]=runReport;exports[_0x3adf('0x2b')]=function(_0x536506,_0x1a1c3e){var _0x6942ee=0xa;var _0x210ac1=['join',_0x3adf('0x4d'),'right_join',_0x3adf('0x4f')];var _0x2b2127={'SUM':_0x3adf('0x50'),'COUNT':_0x3adf('0x51'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x3adf('0x52'),'MIN':_0x3adf('0x53'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x3adf('0x55'),'GROUP_CONCAT ASC':_0x3adf('0x7f'),'GROUP_CONCAT DESC':_0x3adf('0x80')};var _0xaf4c8f={'SEC_TO_TIME':_0x3adf('0x56'),'DATE':_0x3adf('0x57'),'HOUR':_0x3adf('0x9b'),'ROUND':_0x3adf('0x58'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1382ff=function(_0x3d7eda){return!_[_0x3adf('0x5a')]([_0x3adf('0x5b'),_0x3adf('0x81'),_0x3adf('0x5c'),_0x3adf('0x5d')],_0x3d7eda);};var _0x4f20b1=function(_0x21f056){if(!_0x21f056||!_0x21f056[_0x3adf('0x5e')][_0x3adf('0x2f')]){return'';}for(var _0x1787cd='(',_0x75ea09=0x0;_0x75ea09<_0x21f056[_0x3adf('0x5e')]['length'];_0x75ea09+=0x1){_0x75ea09>0x0&&(_0x1787cd+='\x20'+_0x21f056['operator']+'\x20');_0x1787cd+=_0x21f056[_0x3adf('0x5e')][_0x75ea09][_0x3adf('0x60')]?_0x4f20b1(_0x21f056['rules'][_0x75ea09][_0x3adf('0x60')]):_0x21f056['rules'][_0x75ea09][_0x3adf('0x61')]+'\x20'+_0x21f056[_0x3adf('0x5e')][_0x75ea09][_0x3adf('0x62')]+(_0x1382ff(_0x21f056[_0x3adf('0x5e')][_0x75ea09][_0x3adf('0x62')])?'\x20'+_0x21f056['rules'][_0x75ea09][_0x3adf('0x63')]:'');}return _0x1787cd+')';};var _0x315602={'where':{'id':_0x536506['params']['id']}},_0x580449,_0x53e467,_0x7bdab0,_0x31815a,_0x495a03;_0x315602=_[_0x3adf('0x35')]({},_0x315602,_0x536506[_0x3adf('0x38')]);return db[_0x3adf('0x28')]['find'](_0x315602)['then'](function(_0x349c4e){if(_0x349c4e){_0x580449=_0x349c4e;return _0x349c4e['getFields']();}return null;})[_0x3adf('0x21')](function(_0x238ed1){if(_0x238ed1){if(!_0x238ed1[_0x3adf('0x2f')]){throw new db[(_0x3adf('0x82'))][(_0x3adf('0x65'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x53e467=_0x238ed1;return db[_0x3adf('0x67')][_0x3adf('0x3a')]({'raw':!![]});}return null;})[_0x3adf('0x21')](function(_0x2a6733){if(_0x2a6733){_0x7bdab0=_[_0x3adf('0x68')](_0x2a6733,'id');var _0x24ec0f;var _0x6b37fd=squel[_0x3adf('0x69')]();_0x6b37fd['from'](_0x580449[_0x3adf('0x75')]);for(var _0x38b175=0x0;_0x38b175<_0x53e467[_0x3adf('0x2f')];_0x38b175+=0x1){_0x24ec0f=_0x53e467[_0x38b175]['MetricId']?_0x7bdab0[_0x53e467[_0x38b175]['MetricId']][_0x3adf('0x6b')]:_0x53e467[_0x38b175]['field'];_0x24ec0f=_0x53e467[_0x38b175][_0x3adf('0x6c')]?_['replace'](_0x2b2127[_0x53e467[_0x38b175][_0x3adf('0x6c')]],'%s',_0x24ec0f):_0x24ec0f;_0x24ec0f=_0x53e467[_0x38b175][_0x3adf('0x6e')]?_[_0x3adf('0x6d')](_0xaf4c8f[_0x53e467[_0x38b175][_0x3adf('0x6e')]],'%s',_0x24ec0f):_0x24ec0f;if(_0x53e467[_0x38b175]['groupBy']){_0x6b37fd[_0x3adf('0x60')](_0x24ec0f);}_0x53e467[_0x38b175][_0x3adf('0x6f')]&&_0x6b37fd[_0x3adf('0x31')](_0x24ec0f,_0x53e467[_0x38b175][_0x3adf('0x6f')]===_0x3adf('0x70')?![]:!![]);_0x6b37fd['field'](_0x24ec0f,_0x53e467[_0x38b175][_0x3adf('0x85')]||_0x24ec0f);}if(_0x580449[_0x3adf('0x71')]){_0x580449[_0x3adf('0x71')]=JSON[_0x3adf('0x78')](_0x580449[_0x3adf('0x71')]);for(var _0x84c891=0x0;_0x84c891<_0x580449[_0x3adf('0x71')][_0x3adf('0x2f')];_0x84c891+=0x1){if(_0x580449[_0x3adf('0x71')][_0x84c891]['type']&&_[_0x3adf('0x5a')](_0x210ac1,_0x580449['joins'][_0x84c891][_0x3adf('0x86')])&&_0x580449[_0x3adf('0x71')][_0x84c891][_0x3adf('0x76')]&&_0x580449[_0x3adf('0x71')][_0x84c891][_0x3adf('0x72')]&&_0x580449[_0x3adf('0x71')][_0x84c891][_0x3adf('0x73')]){_0x6b37fd[_0x580449[_0x3adf('0x71')][_0x84c891][_0x3adf('0x86')]](_0x580449['joins'][_0x84c891][_0x3adf('0x72')],null,util[_0x3adf('0x6e')](_0x3adf('0x74'),_0x580449[_0x3adf('0x75')],_0x580449[_0x3adf('0x71')][_0x84c891][_0x3adf('0x76')],_0x580449[_0x3adf('0x71')][_0x84c891][_0x3adf('0x72')],_0x580449[_0x3adf('0x71')][_0x84c891][_0x3adf('0x73')]));}}}if(_0x580449[_0x3adf('0x77')]){_0x580449[_0x3adf('0x77')]=JSON[_0x3adf('0x78')](_0x580449[_0x3adf('0x77')]);_0x6b37fd[_0x3adf('0x33')](_0x4f20b1(_0x580449['conditions'][_0x3adf('0x60')]));}_0x495a03=_0x6b37fd[_0x3adf('0x79')]();_0x6b37fd[_0x3adf('0x1b')](_0x6942ee);_0x6b37fd['offset'](0x0);logger[_0x3adf('0x87')](_0x3adf('0x7a'),_0x6b37fd[_0x3adf('0x7b')]());return db['sequelize'][_0x3adf('0x2b')](_0x6b37fd[_0x3adf('0x7b')](),{'type':db[_0x3adf('0x7c')]['QueryTypes'][_0x3adf('0x88')]});}})[_0x3adf('0x21')](function(){return{'sql':_0x495a03[_0x3adf('0x7b')]()};})[_0x3adf('0x21')](respondWithResult(_0x1a1c3e,null))['catch'](handleError(_0x1a1c3e,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 02c139d..8256235 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 _0xe4d5=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','util','../../config/logger'];(function(_0x7472aa,_0x3971a1){var _0x12e552=function(_0x3c58d4){while(--_0x3c58d4){_0x7472aa['push'](_0x7472aa['shift']());}};_0x12e552(++_0x3971a1);}(_0xe4d5,0x124));var _0x5e4d=function(_0x4d4c63,_0x33ac30){_0x4d4c63=_0x4d4c63-0x0;var _0x383b63=_0xe4d5[_0x4d4c63];return _0x383b63;};'use strict';var _=require('lodash');var util=require(_0x5e4d('0x0'));var logger=require(_0x5e4d('0x1'))(_0x5e4d('0x2'));var moment=require(_0x5e4d('0x3'));var BPromise=require(_0x5e4d('0x4'));var rp=require(_0x5e4d('0x5'));var fs=require('fs');var path=require(_0x5e4d('0x6'));var rimraf=require(_0x5e4d('0x7'));var config=require(_0x5e4d('0x8'));var attributes=require(_0x5e4d('0x9'));module[_0x5e4d('0xa')]=function(_0x53ef70,_0x10a63a){return _0x53ef70[_0x5e4d('0xb')](_0x5e4d('0xc'),attributes,{'tableName':_0x5e4d('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc07d=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports','define','AnalyticCustomReport','analytics_custom_reports'];(function(_0x679dce,_0x255924){var _0x490d21=function(_0x34c444){while(--_0x34c444){_0x679dce['push'](_0x679dce['shift']());}};_0x490d21(++_0x255924);}(_0xc07d,0x84));var _0xdc07=function(_0x182da6,_0x389200){_0x182da6=_0x182da6-0x0;var _0x564adb=_0xc07d[_0x182da6];return _0x564adb;};'use strict';var _=require('lodash');var util=require(_0xdc07('0x0'));var logger=require(_0xdc07('0x1'))(_0xdc07('0x2'));var moment=require(_0xdc07('0x3'));var BPromise=require('bluebird');var rp=require(_0xdc07('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdc07('0x5'));var config=require(_0xdc07('0x6'));var attributes=require('./analyticCustomReport.attributes');module[_0xdc07('0x7')]=function(_0x1c1ac4,_0x1ad3cc){return _0x1c1ac4[_0xdc07('0x8')](_0xdc07('0x9'),attributes,{'tableName':_0xdc07('0xa'),'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 35bef23..5e5815f 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 _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(_0x56e463,_0x41fd38){var _0x2280b2=function(_0xee2af6){while(--_0xee2af6){_0x56e463['push'](_0x56e463['shift']());}};_0x2280b2(++_0x41fd38);}(_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 moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _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(_0x4d7df6,_0x3f6139){var _0x4c0d29=function(_0x12ae02){while(--_0x12ae02){_0x4d7df6['push'](_0x4d7df6['shift']());}};_0x4c0d29(++_0x3f6139);}(_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 diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 32a682b..4f33ab0 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 _0x8aad=['../../components/auth/service','./analyticCustomReport.controller','index','get','/:id','show','/:id/preview','isAuthenticated','/:id/run','run','/:id/query','query','post','create','put','update','delete','exports','multer','util','connect-timeout','Router'];(function(_0x34d9b2,_0x5e7918){var _0x51513f=function(_0x4e0fa5){while(--_0x4e0fa5){_0x34d9b2['push'](_0x34d9b2['shift']());}};_0x51513f(++_0x5e7918);}(_0x8aad,0x146));var _0xd8aa=function(_0x347a30,_0x2ff4ef){_0x347a30=_0x347a30-0x0;var _0x548982=_0x8aad[_0x347a30];return _0x548982;};'use strict';var multer=require(_0xd8aa('0x0'));var util=require(_0xd8aa('0x1'));var path=require('path');var timeout=require(_0xd8aa('0x2'));var express=require('express');var router=express[_0xd8aa('0x3')]();var auth=require(_0xd8aa('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd8aa('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xd8aa('0x6')]);router[_0xd8aa('0x7')](_0xd8aa('0x8'),auth['isAuthenticated'](),controller[_0xd8aa('0x9')]);router[_0xd8aa('0x7')](_0xd8aa('0xa'),auth[_0xd8aa('0xb')](),controller['preview']);router['get'](_0xd8aa('0xc'),auth[_0xd8aa('0xb')](),controller[_0xd8aa('0xd')]);router[_0xd8aa('0x7')](_0xd8aa('0xe'),auth['isAuthenticated'](),controller[_0xd8aa('0xf')]);router[_0xd8aa('0x10')]('/',auth[_0xd8aa('0xb')](),controller[_0xd8aa('0x11')]);router[_0xd8aa('0x12')](_0xd8aa('0x8'),auth[_0xd8aa('0xb')](),controller[_0xd8aa('0x13')]);router[_0xd8aa('0x14')](_0xd8aa('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0xd8aa('0x15')]=router; \ No newline at end of file +var _0x430c=['delete','multer','connect-timeout','express','Router','get','isAuthenticated','show','/:id/preview','preview','/:id/run','/:id/query','query','put','/:id','update'];(function(_0x4f7ee9,_0x5e2e09){var _0x2dff3a=function(_0x1699d7){while(--_0x1699d7){_0x4f7ee9['push'](_0x4f7ee9['shift']());}};_0x2dff3a(++_0x5e2e09);}(_0x430c,0x1a1));var _0xc430=function(_0x434804,_0x415f68){_0x434804=_0x434804-0x0;var _0x573fc8=_0x430c[_0x434804];return _0x573fc8;};'use strict';var multer=require(_0xc430('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc430('0x1'));var express=require(_0xc430('0x2'));var router=express[_0xc430('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router[_0xc430('0x4')]('/',auth[_0xc430('0x5')](),controller['index']);router[_0xc430('0x4')]('/:id',auth[_0xc430('0x5')](),controller[_0xc430('0x6')]);router[_0xc430('0x4')](_0xc430('0x7'),auth[_0xc430('0x5')](),controller[_0xc430('0x8')]);router[_0xc430('0x4')](_0xc430('0x9'),auth[_0xc430('0x5')](),controller['run']);router[_0xc430('0x4')](_0xc430('0xa'),auth['isAuthenticated'](),controller[_0xc430('0xb')]);router['post']('/',auth[_0xc430('0x5')](),controller['create']);router[_0xc430('0xc')](_0xc430('0xd'),auth[_0xc430('0x5')](),controller[_0xc430('0xe')]);router[_0xc430('0xf')](_0xc430('0xd'),auth[_0xc430('0x5')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index a0bb3a6..89e92c5 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 _0xe27f=['STRING','TEXT','exports'];(function(_0x5a3202,_0x4a9c0d){var _0xb4cf2=function(_0x169a51){while(--_0x169a51){_0x5a3202['push'](_0x5a3202['shift']());}};_0xb4cf2(++_0x4a9c0d);}(_0xe27f,0x80));var _0xfe27=function(_0x340c6b,_0x2423d7){_0x340c6b=_0x340c6b-0x0;var _0x1e204a=_0xe27f[_0x340c6b];return _0x1e204a;};'use strict';var Sequelize=require('sequelize');module[_0xfe27('0x0')]={'name':{'type':Sequelize[_0xfe27('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xfe27('0x1')]},'parent':{'type':Sequelize[_0xfe27('0x1')]},'table':{'type':Sequelize[_0xfe27('0x1')]},'conditions':{'type':Sequelize[_0xfe27('0x2')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x3465=['STRING','sequelize','exports'];(function(_0x51a8b3,_0x35a867){var _0x370673=function(_0x39750d){while(--_0x39750d){_0x51a8b3['push'](_0x51a8b3['shift']());}};_0x370673(++_0x35a867);}(_0x3465,0x73));var _0x5346=function(_0x1b4395,_0x427c86){_0x1b4395=_0x1b4395-0x0;var _0x25b235=_0x3465[_0x1b4395];return _0x25b235;};'use strict';var Sequelize=require(_0x5346('0x0'));module[_0x5346('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x5346('0x2')]},'parent':{'type':Sequelize[_0x5346('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 2449580..ff2bbce 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 _0xfb3d=['send','index','AnalyticDefaultReport','rawAttributes','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','field','options','include','findAll','rows','show','params','fields','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','MetricId','function','format','orderBy','DESC','alias','joins','parse','type','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(DISTINCT\x20%s)','MIN(%s)','IS\x20NULL','value','keyBy','metric','groupBy','Sequelize','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','../../components/export/','../../files/reports','savename','COUNT(*)','runReport','cross_join','HOUR(%s)','replace','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','get','DefaultReports','error','stack','name'];(function(_0x3ee369,_0x311aff){var _0xd65c5e=function(_0x39dfde){while(--_0x39dfde){_0x3ee369['push'](_0x3ee369['shift']());}};_0xd65c5e(++_0x311aff);}(_0xfb3d,0x7c));var _0xdfb3=function(_0x4dcc75,_0x1a8621){_0x4dcc75=_0x4dcc75-0x0;var _0x3384db=_0xfb3d[_0x4dcc75];return _0x3384db;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xdfb3('0x0'));var rimraf=require(_0xdfb3('0x1'));var zipdir=require(_0xdfb3('0x2'));var jsonpatch=require(_0xdfb3('0x3'));var rp=require(_0xdfb3('0x4'));var moment=require(_0xdfb3('0x5'));var BPromise=require(_0xdfb3('0x6'));var Mustache=require(_0xdfb3('0x7'));var util=require(_0xdfb3('0x8'));var path=require(_0xdfb3('0x9'));var sox=require('sox');var csv=require(_0xdfb3('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xdfb3('0xb'));var squel=require(_0xdfb3('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xdfb3('0xd'));var toCsv=require(_0xdfb3('0xa'));var querystring=require(_0xdfb3('0xe'));var Papa=require(_0xdfb3('0xf'));var Redis=require('ioredis');var authService=require(_0xdfb3('0x10'));var qs=require(_0xdfb3('0x11'));var hardwareService=require(_0xdfb3('0x12'));var logger=require('../../config/logger')(_0xdfb3('0x13'));var utils=require(_0xdfb3('0x14'));var config=require('../../config/environment');var db=require(_0xdfb3('0x15'))['db'];function respondWithStatusCode(_0x31e1cd,_0xafec){_0xafec=_0xafec||0xcc;return function(_0x306aba){if(_0x306aba){return _0x31e1cd[_0xdfb3('0x16')](_0xafec);}return _0x31e1cd['status'](_0xafec)[_0xdfb3('0x17')]();};}function respondWithResult(_0x3406de,_0x3657ea){_0x3657ea=_0x3657ea||0xc8;return function(_0x4da609){if(_0x4da609){return _0x3406de[_0xdfb3('0x18')](_0x3657ea)[_0xdfb3('0x19')](_0x4da609);}};}function respondWithFilteredResult(_0x522af0,_0x2e793a){return function(_0xd48def){if(_0xd48def){var _0x18f131=_0xd48def[_0xdfb3('0x1a')],_0x4f029d=_0x2e793a['offset'],_0x235f50=_0x2e793a[_0xdfb3('0x1b')]+_0x2e793a[_0xdfb3('0x1c')],_0x292deb;if(_0x235f50>=_0x18f131){_0x235f50=_0x18f131;_0x292deb=0xc8;}else{_0x292deb=0xce;}_0x522af0[_0xdfb3('0x18')](_0x292deb);return _0x522af0[_0xdfb3('0x1d')]('Content-Range',_0x4f029d+'-'+_0x235f50+'/'+_0x18f131)[_0xdfb3('0x19')](_0xd48def);}return null;};}function patchUpdates(_0x19f61a){return function(_0x594985){try{jsonpatch[_0xdfb3('0x1e')](_0x594985,_0x19f61a,!![]);}catch(_0x58170f){return BPromise[_0xdfb3('0x1f')](_0x58170f);}return _0x594985[_0xdfb3('0x20')]();};}function saveUpdates(_0x3877c6,_0x117b51){return function(_0x32d4b3){if(_0x32d4b3){return _0x32d4b3[_0xdfb3('0x21')](_0x3877c6)[_0xdfb3('0x22')](function(_0x4f6f1e){return _0x4f6f1e;});}return null;};}function removeEntity(_0x489428,_0x582a87){return function(_0x4632c7){if(_0x4632c7){return _0x4632c7[_0xdfb3('0x23')]()[_0xdfb3('0x22')](function(){var _0x274260=_0x4632c7[_0xdfb3('0x24')]({'plain':!![]});var _0x308a53=_0xdfb3('0x25');return db['UserProfileResource'][_0xdfb3('0x23')]({'where':{'type':_0x308a53,'resourceId':_0x274260['id']}})['then'](function(){return _0x4632c7;});})[_0xdfb3('0x22')](function(){_0x489428[_0xdfb3('0x18')](0xcc)[_0xdfb3('0x17')]();});}};}function handleEntityNotFound(_0xbd184f,_0x11fc56){return function(_0x341ea0){if(!_0x341ea0){_0xbd184f[_0xdfb3('0x16')](0x194);}return _0x341ea0;};}function handleError(_0xebf40,_0x66e7cc){_0x66e7cc=_0x66e7cc||0x1f4;return function(_0x1ccc79){logger[_0xdfb3('0x26')](_0x1ccc79[_0xdfb3('0x27')]);if(_0x1ccc79[_0xdfb3('0x28')]){delete _0x1ccc79['name'];}_0xebf40[_0xdfb3('0x18')](_0x66e7cc)[_0xdfb3('0x29')](_0x1ccc79);};}exports[_0xdfb3('0x2a')]=function(_0x2e6eb8,_0xa82486){var _0x5acede={},_0x2ff8f7={},_0x98449={'count':0x0,'rows':[]};var _0x2c406c=db[_0xdfb3('0x2b')][_0xdfb3('0x2c')];_0x2ff8f7[_0xdfb3('0x2d')]=_[_0xdfb3('0x2e')](_0x2c406c);_0x2ff8f7[_0xdfb3('0x2f')]=_[_0xdfb3('0x2e')](_0x2e6eb8[_0xdfb3('0x2f')]);_0x2ff8f7[_0xdfb3('0x30')]=_[_0xdfb3('0x31')](_0x2ff8f7['model'],_0x2ff8f7[_0xdfb3('0x2f')]);_0x5acede['attributes']=_[_0xdfb3('0x31')](_0x2ff8f7['model'],qs['fields'](_0x2e6eb8['query']['fields']));_0x5acede[_0xdfb3('0x32')]=_0x5acede[_0xdfb3('0x32')][_0xdfb3('0x33')]?_0x5acede['attributes']:_0x2ff8f7['model'];if(!_0x2e6eb8[_0xdfb3('0x2f')][_0xdfb3('0x34')](_0xdfb3('0x35'))){_0x5acede['limit']=qs[_0xdfb3('0x1c')](_0x2e6eb8[_0xdfb3('0x2f')]['limit']);_0x5acede['offset']=qs[_0xdfb3('0x1b')](_0x2e6eb8[_0xdfb3('0x2f')][_0xdfb3('0x1b')]);}_0x5acede[_0xdfb3('0x36')]=qs['sort'](_0x2e6eb8[_0xdfb3('0x2f')][_0xdfb3('0x37')]);_0x5acede[_0xdfb3('0x38')]=qs[_0xdfb3('0x30')](_[_0xdfb3('0x39')](_0x2e6eb8['query'],_0x2ff8f7[_0xdfb3('0x30')]));if(_0x2e6eb8[_0xdfb3('0x2f')][_0xdfb3('0x3a')]){_0x5acede[_0xdfb3('0x38')]=_[_0xdfb3('0x3b')](_0x5acede[_0xdfb3('0x38')],{'$or':_[_0xdfb3('0x3c')](_0x2c406c,function(_0xd1e98f){if(_0xd1e98f['type'][_0xdfb3('0x3d')]!==_0xdfb3('0x3e')){var _0xd7a530={};_0xd7a530[_0xd1e98f[_0xdfb3('0x3f')]]={'$like':'%'+_0x2e6eb8['query'][_0xdfb3('0x3a')]+'%'};return _0xd7a530;}})});}_0x5acede=_['merge']({},_0x5acede,_0x2e6eb8[_0xdfb3('0x40')]);var _0x308001={'where':_0x5acede['where']};return db[_0xdfb3('0x2b')][_0xdfb3('0x1a')](_0x308001)[_0xdfb3('0x22')](function(_0x2e6135){_0x98449[_0xdfb3('0x1a')]=_0x2e6135;if(_0x2e6eb8[_0xdfb3('0x2f')]['includeAll']){_0x5acede[_0xdfb3('0x41')]=[{'all':!![]}];}return db[_0xdfb3('0x2b')][_0xdfb3('0x42')](_0x5acede);})[_0xdfb3('0x22')](function(_0x49e26a){_0x98449[_0xdfb3('0x43')]=_0x49e26a;return _0x98449;})[_0xdfb3('0x22')](respondWithFilteredResult(_0xa82486,_0x5acede))['catch'](handleError(_0xa82486,null));};exports[_0xdfb3('0x44')]=function(_0x455cd1,_0x448a1a){var _0x3d20f0={'raw':!![],'where':{'id':_0x455cd1[_0xdfb3('0x45')]['id']}},_0x387d3f={};_0x387d3f[_0xdfb3('0x2d')]=_['keys'](db[_0xdfb3('0x2b')][_0xdfb3('0x2c')]);_0x387d3f[_0xdfb3('0x2f')]=_[_0xdfb3('0x2e')](_0x455cd1[_0xdfb3('0x2f')]);_0x387d3f[_0xdfb3('0x30')]=_[_0xdfb3('0x31')](_0x387d3f[_0xdfb3('0x2d')],_0x387d3f['query']);_0x3d20f0[_0xdfb3('0x32')]=_[_0xdfb3('0x31')](_0x387d3f['model'],qs[_0xdfb3('0x46')](_0x455cd1['query'][_0xdfb3('0x46')]));_0x3d20f0['attributes']=_0x3d20f0[_0xdfb3('0x32')][_0xdfb3('0x33')]?_0x3d20f0[_0xdfb3('0x32')]:_0x387d3f['model'];if(_0x455cd1[_0xdfb3('0x2f')][_0xdfb3('0x47')]){_0x3d20f0[_0xdfb3('0x41')]=[{'all':!![]}];}_0x3d20f0=_[_0xdfb3('0x3b')]({},_0x3d20f0,_0x455cd1[_0xdfb3('0x40')]);return db[_0xdfb3('0x2b')][_0xdfb3('0x48')](_0x3d20f0)[_0xdfb3('0x22')](handleEntityNotFound(_0x448a1a,null))[_0xdfb3('0x22')](respondWithResult(_0x448a1a,null))[_0xdfb3('0x49')](handleError(_0x448a1a,null));};exports[_0xdfb3('0x4a')]=function(_0x2160a9,_0x199a7b){return db['AnalyticDefaultReport'][_0xdfb3('0x4a')](_0x2160a9[_0xdfb3('0x4b')],{})[_0xdfb3('0x22')](function(_0x1ade9e){var _0x1a331e=_0x2160a9[_0xdfb3('0x4c')]['get']({'plain':!![]});if(!_0x1a331e)throw new Error(_0xdfb3('0x4d'));if(_0x1a331e['role']===_0xdfb3('0x4c')){var _0x4dbc79=_0x1ade9e[_0xdfb3('0x24')]({'plain':!![]});var _0x168bdd=_0xdfb3('0x4e');return db[_0xdfb3('0x4f')]['find']({'where':{'name':_0x168bdd,'userProfileId':_0x1a331e[_0xdfb3('0x50')]},'raw':!![]})['then'](function(_0x1e0aa9){if(_0x1e0aa9&&_0x1e0aa9[_0xdfb3('0x51')]===0x0){return db[_0xdfb3('0x52')][_0xdfb3('0x4a')]({'name':_0x4dbc79[_0xdfb3('0x28')],'resourceId':_0x4dbc79['id'],'type':_0xdfb3('0x25'),'sectionId':_0x1e0aa9['id']},{})['then'](function(){return _0x1ade9e;});}else{return _0x1ade9e;}})[_0xdfb3('0x49')](function(_0x38d528){logger[_0xdfb3('0x26')](_0xdfb3('0x53'),_0x38d528);throw _0x38d528;});}return _0x1ade9e;})[_0xdfb3('0x22')](respondWithResult(_0x199a7b,0xc9))['catch'](handleError(_0x199a7b,null));};exports[_0xdfb3('0x21')]=function(_0x26723c,_0x5dc863){if(_0x26723c['body']['id']){delete _0x26723c[_0xdfb3('0x4b')]['id'];}return db[_0xdfb3('0x2b')][_0xdfb3('0x48')]({'where':{'id':_0x26723c['params']['id']}})['then'](handleEntityNotFound(_0x5dc863,null))[_0xdfb3('0x22')](saveUpdates(_0x26723c[_0xdfb3('0x4b')],null))[_0xdfb3('0x22')](respondWithResult(_0x5dc863,null))[_0xdfb3('0x49')](handleError(_0x5dc863,null));};exports[_0xdfb3('0x23')]=function(_0x3f37f8,_0xca3f3a){return db['AnalyticDefaultReport'][_0xdfb3('0x48')]({'where':{'id':_0x3f37f8['params']['id']}})[_0xdfb3('0x22')](handleEntityNotFound(_0xca3f3a,null))[_0xdfb3('0x22')](removeEntity(_0xca3f3a,null))[_0xdfb3('0x49')](handleError(_0xca3f3a,null));};exports[_0xdfb3('0x54')]=function(_0x36028c,_0xb39976){var _0x1d0a95=0xa;var _0x5bd7d2=[_0xdfb3('0x55'),_0xdfb3('0x56'),_0xdfb3('0x57'),'cross_join'];var _0x327538={'SUM':_0xdfb3('0x58'),'COUNT':_0xdfb3('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xdfb3('0x5a'),'MIN':'MIN(%s)','AVG':_0xdfb3('0x5b'),'GROUP_CONCAT':_0xdfb3('0x5c'),'GROUP_CONCAT ASC':_0xdfb3('0x5d'),'GROUP_CONCAT DESC':_0xdfb3('0x5e')};var _0x36d83a={'SEC_TO_TIME':_0xdfb3('0x5f'),'DATE':_0xdfb3('0x60'),'HOUR':'HOUR(%s)','ROUND':_0xdfb3('0x61'),'UNIX_TIMESTAMP':_0xdfb3('0x62')};var _0x3960c7=function(_0x49eaf1){return!_['includes'](['IS\x20NULL',_0xdfb3('0x63'),_0xdfb3('0x64'),_0xdfb3('0x65')],_0x49eaf1);};var _0x2d5ff3=function(_0x2a02af){if(!_0x2a02af||!_0x2a02af[_0xdfb3('0x66')][_0xdfb3('0x33')]){return'';}for(var _0x2dbd1f='(',_0xab76c0=0x0;_0xab76c0<_0x2a02af['rules'][_0xdfb3('0x33')];_0xab76c0+=0x1){_0xab76c0>0x0&&(_0x2dbd1f+='\x20'+_0x2a02af[_0xdfb3('0x67')]+'\x20');_0x2dbd1f+=_0x2a02af[_0xdfb3('0x66')][_0xab76c0][_0xdfb3('0x68')]?_0x2d5ff3(_0x2a02af[_0xdfb3('0x66')][_0xab76c0][_0xdfb3('0x68')]):_0x2a02af[_0xdfb3('0x66')][_0xab76c0]['field']+'\x20'+_0x2a02af[_0xdfb3('0x66')][_0xab76c0]['condition']+(_0x3960c7(_0x2a02af[_0xdfb3('0x66')][_0xab76c0][_0xdfb3('0x69')])?'\x20'+_0x2a02af[_0xdfb3('0x66')][_0xab76c0]['value']:'');}return _0x2dbd1f+')';};var _0x93ef41={'where':{'id':_0x36028c[_0xdfb3('0x45')]['id']}},_0xcae918,_0x24e474,_0xe4a4dc,_0x48ca24,_0x20e3a6;_0x93ef41=_[_0xdfb3('0x3b')]({},_0x93ef41,_0x36028c['options']);return db['AnalyticDefaultReport'][_0xdfb3('0x48')](_0x93ef41)[_0xdfb3('0x22')](function(_0x59e6e1){if(_0x59e6e1){_0xcae918=_0x59e6e1;return _0x59e6e1[_0xdfb3('0x6a')]();}return null;})['then'](function(_0x101ba3){if(_0x101ba3){if(!_0x101ba3['length']){throw new db['Sequelize'][(_0xdfb3('0x6b'))](_0xdfb3('0x6c'),0x193);}_0x24e474=_0x101ba3;return db[_0xdfb3('0x6d')][_0xdfb3('0x42')]({'raw':!![]});}return null;})[_0xdfb3('0x22')](function(_0x447294){if(_0x447294){_0xe4a4dc=_['keyBy'](_0x447294,'id');var _0x2f72ab;var _0x1519dc=squel[_0xdfb3('0x6e')]();_0x1519dc[_0xdfb3('0x6f')](_0xcae918[_0xdfb3('0x70')]);for(var _0x1e90e7=0x0;_0x1e90e7<_0x24e474[_0xdfb3('0x33')];_0x1e90e7+=0x1){_0x2f72ab=_0x24e474[_0x1e90e7][_0xdfb3('0x71')]?_0xe4a4dc[_0x24e474[_0x1e90e7][_0xdfb3('0x71')]]['metric']:_0x24e474[_0x1e90e7][_0xdfb3('0x3f')];_0x2f72ab=_0x24e474[_0x1e90e7][_0xdfb3('0x72')]?_['replace'](_0x327538[_0x24e474[_0x1e90e7][_0xdfb3('0x72')]],'%s',_0x2f72ab):_0x2f72ab;_0x2f72ab=_0x24e474[_0x1e90e7][_0xdfb3('0x73')]?_['replace'](_0x36d83a[_0x24e474[_0x1e90e7][_0xdfb3('0x73')]],'%s',_0x2f72ab):_0x2f72ab;if(_0x24e474[_0x1e90e7]['groupBy']){_0x1519dc[_0xdfb3('0x68')](_0x2f72ab);}_0x24e474[_0x1e90e7][_0xdfb3('0x74')]&&_0x1519dc[_0xdfb3('0x36')](_0x2f72ab,_0x24e474[_0x1e90e7][_0xdfb3('0x74')]===_0xdfb3('0x75')?![]:!![]);_0x1519dc[_0xdfb3('0x3f')](_0x2f72ab,_0x24e474[_0x1e90e7][_0xdfb3('0x76')]||_0x2f72ab);}if(_0xcae918['joins']){_0xcae918[_0xdfb3('0x77')]=JSON[_0xdfb3('0x78')](_0xcae918[_0xdfb3('0x77')]);for(var _0x4e62ab=0x0;_0x4e62ab<_0xcae918[_0xdfb3('0x77')]['length'];_0x4e62ab+=0x1){if(_0xcae918['joins'][_0x4e62ab][_0xdfb3('0x79')]&&_[_0xdfb3('0x7a')](_0x5bd7d2,_0xcae918[_0xdfb3('0x77')][_0x4e62ab][_0xdfb3('0x79')])&&_0xcae918[_0xdfb3('0x77')][_0x4e62ab][_0xdfb3('0x7b')]&&_0xcae918['joins'][_0x4e62ab][_0xdfb3('0x7c')]&&_0xcae918['joins'][_0x4e62ab]['foreignKey']){_0x1519dc[_0xcae918['joins'][_0x4e62ab][_0xdfb3('0x79')]](_0xcae918[_0xdfb3('0x77')][_0x4e62ab]['foreignTable'],null,util[_0xdfb3('0x73')](_0xdfb3('0x7d'),_0xcae918[_0xdfb3('0x70')],_0xcae918[_0xdfb3('0x77')][_0x4e62ab][_0xdfb3('0x7b')],_0xcae918[_0xdfb3('0x77')][_0x4e62ab]['foreignTable'],_0xcae918[_0xdfb3('0x77')][_0x4e62ab][_0xdfb3('0x7e')]));}}}if(_0xcae918['conditions']){_0xcae918[_0xdfb3('0x7f')]=JSON[_0xdfb3('0x78')](_0xcae918[_0xdfb3('0x7f')]);_0x1519dc[_0xdfb3('0x38')](_0x2d5ff3(_0xcae918[_0xdfb3('0x7f')][_0xdfb3('0x68')]));}_0x20e3a6=_0x1519dc['clone']();_0x1519dc['limit'](_0x1d0a95);_0x1519dc[_0xdfb3('0x1b')](0x0);logger[_0xdfb3('0x80')](_0xdfb3('0x81'),_0x1519dc[_0xdfb3('0x82')]());return db['sequelize'][_0xdfb3('0x2f')](_0x1519dc[_0xdfb3('0x82')](),{'type':db[_0xdfb3('0x83')][_0xdfb3('0x84')][_0xdfb3('0x85')]});}})['then'](respondWithResult(_0xb39976,null))[_0xdfb3('0x49')](handleError(_0xb39976,null));};function runReport(_0x33bf54,_0x1c0ee1,_0x4b05c3){var _0x1fc9cc=_0x1c0ee1['name'];var _0x84a83d=0xa;var _0x1e8c67=[_0xdfb3('0x55'),_0xdfb3('0x56'),_0xdfb3('0x57'),'cross_join'];var _0x266583={'SUM':_0xdfb3('0x58'),'COUNT':_0xdfb3('0x59'),'COUNT DISTINCT':_0xdfb3('0x86'),'MAX':_0xdfb3('0x5a'),'MIN':_0xdfb3('0x87'),'AVG':_0xdfb3('0x5b'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1f42e2={'SEC_TO_TIME':_0xdfb3('0x5f'),'DATE':_0xdfb3('0x60'),'HOUR':'HOUR(%s)','ROUND':_0xdfb3('0x61'),'UNIX_TIMESTAMP':_0xdfb3('0x62')};var _0x148d24=function(_0x433579){return!_[_0xdfb3('0x7a')]([_0xdfb3('0x88'),_0xdfb3('0x63'),_0xdfb3('0x64'),'IS\x20NOT\x20EMPTY'],_0x433579);};var _0xc21251=function(_0x168833){if(!_0x168833||!_0x168833[_0xdfb3('0x66')][_0xdfb3('0x33')]){return'';}for(var _0x41fda3='(',_0x8ebc4a=0x0;_0x8ebc4a<_0x168833[_0xdfb3('0x66')][_0xdfb3('0x33')];_0x8ebc4a+=0x1){_0x8ebc4a>0x0&&(_0x41fda3+='\x20'+_0x168833[_0xdfb3('0x67')]+'\x20');_0x41fda3+=_0x168833[_0xdfb3('0x66')][_0x8ebc4a]['group']?_0xc21251(_0x168833[_0xdfb3('0x66')][_0x8ebc4a]['group']):_0x168833[_0xdfb3('0x66')][_0x8ebc4a][_0xdfb3('0x3f')]+'\x20'+_0x168833[_0xdfb3('0x66')][_0x8ebc4a][_0xdfb3('0x69')]+(_0x148d24(_0x168833['rules'][_0x8ebc4a][_0xdfb3('0x69')])?'\x20'+_0x168833[_0xdfb3('0x66')][_0x8ebc4a][_0xdfb3('0x89')]:'');}return _0x41fda3+')';};var _0x17aaba={'where':{'id':_0x33bf54['id']}},_0x1c9525,_0x4fb6e6,_0x4d988d,_0x30e976,_0x441279;_0x17aaba=_[_0xdfb3('0x3b')]({},_0x17aaba,_0x4b05c3);return db[_0xdfb3('0x2b')][_0xdfb3('0x48')](_0x17aaba)[_0xdfb3('0x22')](function(_0x13b2bc){if(_0x13b2bc){_0x1c9525=_0x13b2bc;return _0x13b2bc['getFields']();}return null;})[_0xdfb3('0x22')](function(_0x35cc75){if(_0x35cc75){if(!_0x35cc75[_0xdfb3('0x33')]){throw new db['Sequelize']['ValidationErrorItem'](_0xdfb3('0x6c'),0x193);}_0x4fb6e6=_0x35cc75;return db[_0xdfb3('0x6d')][_0xdfb3('0x42')]({'raw':!![]});}return null;})[_0xdfb3('0x22')](function(_0x122d0c){if(_0x122d0c){_0x4d988d=_[_0xdfb3('0x8a')](_0x122d0c,'id');var _0x5b8cb0;var _0x42c188=squel['select']();_0x42c188['from'](_0x1c9525[_0xdfb3('0x70')]);for(var _0x41336d=0x0;_0x41336d<_0x4fb6e6[_0xdfb3('0x33')];_0x41336d+=0x1){_0x5b8cb0=_0x4fb6e6[_0x41336d][_0xdfb3('0x71')]?_0x4d988d[_0x4fb6e6[_0x41336d][_0xdfb3('0x71')]][_0xdfb3('0x8b')]:_0x4fb6e6[_0x41336d][_0xdfb3('0x3f')];_0x5b8cb0=_0x4fb6e6[_0x41336d]['function']?_['replace'](_0x266583[_0x4fb6e6[_0x41336d]['function']],'%s',_0x5b8cb0):_0x5b8cb0;_0x5b8cb0=_0x4fb6e6[_0x41336d][_0xdfb3('0x73')]?_['replace'](_0x1f42e2[_0x4fb6e6[_0x41336d]['format']],'%s',_0x5b8cb0):_0x5b8cb0;if(_0x4fb6e6[_0x41336d][_0xdfb3('0x8c')]){_0x42c188[_0xdfb3('0x68')](_0x5b8cb0);}_0x4fb6e6[_0x41336d][_0xdfb3('0x74')]&&_0x42c188[_0xdfb3('0x36')](_0x5b8cb0,_0x4fb6e6[_0x41336d][_0xdfb3('0x74')]===_0xdfb3('0x75')?![]:!![]);_0x42c188[_0xdfb3('0x3f')](_0x5b8cb0,_0x4fb6e6[_0x41336d][_0xdfb3('0x76')]||_0x5b8cb0);}if(_0x1c9525['joins']){_0x1c9525[_0xdfb3('0x77')]=JSON[_0xdfb3('0x78')](_0x1c9525['joins']);for(var _0x204668=0x0;_0x204668<_0x1c9525[_0xdfb3('0x77')]['length'];_0x204668+=0x1){if(_0x1c9525[_0xdfb3('0x77')][_0x204668][_0xdfb3('0x79')]&&_['includes'](_0x1e8c67,_0x1c9525[_0xdfb3('0x77')][_0x204668]['type'])&&_0x1c9525[_0xdfb3('0x77')][_0x204668]['parentKey']&&_0x1c9525[_0xdfb3('0x77')][_0x204668][_0xdfb3('0x7c')]&&_0x1c9525['joins'][_0x204668][_0xdfb3('0x7e')]){_0x42c188[_0x1c9525[_0xdfb3('0x77')][_0x204668]['type']](_0x1c9525['joins'][_0x204668][_0xdfb3('0x7c')],null,util['format'](_0xdfb3('0x7d'),_0x1c9525[_0xdfb3('0x70')],_0x1c9525[_0xdfb3('0x77')][_0x204668][_0xdfb3('0x7b')],_0x1c9525[_0xdfb3('0x77')][_0x204668][_0xdfb3('0x7c')],_0x1c9525[_0xdfb3('0x77')][_0x204668]['foreignKey']));}}}if(_0x1c9525['conditions']){_0x1c9525[_0xdfb3('0x7f')]=JSON[_0xdfb3('0x78')](_0x1c9525[_0xdfb3('0x7f')]);_0x42c188[_0xdfb3('0x38')](_0xc21251(_0x1c9525['conditions'][_0xdfb3('0x68')]));}_0x441279=_0x42c188['clone']();_0x42c188['limit'](_0x84a83d);_0x42c188[_0xdfb3('0x1b')](0x0);logger[_0xdfb3('0x80')](_0xdfb3('0x81'),_0x42c188['toString']());return db[_0xdfb3('0x83')][_0xdfb3('0x2f')](_0x42c188['toString'](),{'type':db[_0xdfb3('0x83')]['QueryTypes'][_0xdfb3('0x85')]});}})[_0xdfb3('0x22')](function(_0x2c79ea){if(!_0x2c79ea[_0xdfb3('0x33')]){throw new db[(_0xdfb3('0x8d'))]['ValidationErrorItem']('No\x20available\x20data',0xcc);}if(_0x1c0ee1[_0xdfb3('0x8e')]===_0xdfb3('0x8f')){return null;}var _0x48d3a4=_['merge'](_0x1c0ee1,{'name':_0x1c0ee1[_0xdfb3('0x90')]||_0x1c0ee1['name']||_0x1c9525[_0xdfb3('0x28')],'basename':_0x1fc9cc,'savename':util[_0xdfb3('0x73')](_0xdfb3('0x91'),_0x1c0ee1[_0xdfb3('0x28')]||_0x1c9525[_0xdfb3('0x28')],require(_0xdfb3('0x92'))[_0xdfb3('0x93')](0x4),_0x1c0ee1['output']||_0xdfb3('0x94')),'reportId':_0x1c9525['id'],'reportType':_0xdfb3('0x95')});return db['AnalyticExtractedReport'][_0xdfb3('0x4a')](_0x48d3a4,{'raw':!![]});})['then'](function(_0x24130d){if(_0x1c9525[_0xdfb3('0x70')]===_0xdfb3('0x96')){_0x441279[_0xdfb3('0x38')](_0x1c9525['table']+_0xdfb3('0x97'),_0x1c0ee1[_0xdfb3('0x98')],_0x1c0ee1[_0xdfb3('0x99')]);}else{_0x441279[_0xdfb3('0x38')](_0x1c9525['table']+_0xdfb3('0x9a'),_0x1c0ee1[_0xdfb3('0x98')],_0x1c0ee1[_0xdfb3('0x99')]);}if(_0x24130d){logger[_0xdfb3('0x9b')](_0xdfb3('0x9c'),_0x441279[_0xdfb3('0x82')]());require('child_process')['fork'](path['join'](__dirname,_0xdfb3('0x9d'),_0x24130d[_0xdfb3('0x8e')]),[_0x24130d['id'],_0x441279[_0xdfb3('0x82')](),path[_0xdfb3('0x55')](__dirname,_0xdfb3('0x9e'),_0x24130d[_0xdfb3('0x9f')]),_0x1fc9cc]);return _0x24130d;}else{var _0x597f63=squel['select']();_0x597f63[_0xdfb3('0x6f')]('('+_0x441279['toString']()+')','countTable');_0x597f63[_0xdfb3('0x3f')](_0xdfb3('0xa0'),_0xdfb3('0x1a'));_0x441279[_0xdfb3('0x1c')](_0x1c0ee1[_0xdfb3('0x1c')]||_0x84a83d);_0x441279[_0xdfb3('0x1b')](_0x1c0ee1[_0xdfb3('0x1b')]||0x0);return db['sequelize'][_0xdfb3('0x2f')](_0x597f63[_0xdfb3('0x82')](),{'type':db[_0xdfb3('0x83')][_0xdfb3('0x84')][_0xdfb3('0x85')]})[_0xdfb3('0x22')](function(_0x2f634e){if(!_0x2f634e[_0xdfb3('0x33')]){_0x30e976=0x0;}else{_0x30e976=_0x2f634e[0x0][_0xdfb3('0x1a')]||0x0;}return db['sequelize'][_0xdfb3('0x2f')](_0x441279[_0xdfb3('0x82')](),{'type':db[_0xdfb3('0x83')][_0xdfb3('0x84')]['SELECT']});})[_0xdfb3('0x22')](function(_0x74614d){return{'rows':_0x74614d||[],'count':_0x30e976};});}});}exports['run']=function(_0xe08c29,_0x5241be){return runReport(_0xe08c29['params'],_0xe08c29['query'],_0xe08c29[_0xdfb3('0x40')])[_0xdfb3('0x22')](respondWithResult(_0x5241be,null))[_0xdfb3('0x49')](handleError(_0x5241be,null));};exports[_0xdfb3('0xa1')]=runReport;exports[_0xdfb3('0x2f')]=function(_0x3f18d3,_0x1515e7){var _0x534488=0xa;var _0x1e14fa=[_0xdfb3('0x55'),'left_join','right_join',_0xdfb3('0xa2')];var _0x3cffa1={'SUM':'SUM(%s)','COUNT':_0xdfb3('0x59'),'COUNT DISTINCT':_0xdfb3('0x86'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xdfb3('0x5b'),'GROUP_CONCAT':_0xdfb3('0x5c'),'GROUP_CONCAT ASC':_0xdfb3('0x5d'),'GROUP_CONCAT DESC':_0xdfb3('0x5e')};var _0x468cff={'SEC_TO_TIME':_0xdfb3('0x5f'),'DATE':'DATE(%s)','HOUR':_0xdfb3('0xa3'),'ROUND':_0xdfb3('0x61'),'UNIX_TIMESTAMP':_0xdfb3('0x62')};var _0x23af61=function(_0x41ccf5){return!_[_0xdfb3('0x7a')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xdfb3('0x64'),_0xdfb3('0x65')],_0x41ccf5);};var _0x1bae90=function(_0x46a544){if(!_0x46a544||!_0x46a544[_0xdfb3('0x66')][_0xdfb3('0x33')]){return'';}for(var _0x49a8e6='(',_0x11ae32=0x0;_0x11ae32<_0x46a544[_0xdfb3('0x66')][_0xdfb3('0x33')];_0x11ae32+=0x1){_0x11ae32>0x0&&(_0x49a8e6+='\x20'+_0x46a544[_0xdfb3('0x67')]+'\x20');_0x49a8e6+=_0x46a544[_0xdfb3('0x66')][_0x11ae32]['group']?_0x1bae90(_0x46a544[_0xdfb3('0x66')][_0x11ae32][_0xdfb3('0x68')]):_0x46a544[_0xdfb3('0x66')][_0x11ae32][_0xdfb3('0x3f')]+'\x20'+_0x46a544[_0xdfb3('0x66')][_0x11ae32][_0xdfb3('0x69')]+(_0x23af61(_0x46a544['rules'][_0x11ae32][_0xdfb3('0x69')])?'\x20'+_0x46a544['rules'][_0x11ae32][_0xdfb3('0x89')]:'');}return _0x49a8e6+')';};var _0x26b397={'where':{'id':_0x3f18d3[_0xdfb3('0x45')]['id']}},_0x46e489,_0x32fb6f,_0x2ab719,_0x4f61c9,_0x549760;_0x26b397=_[_0xdfb3('0x3b')]({},_0x26b397,_0x3f18d3[_0xdfb3('0x40')]);return db[_0xdfb3('0x2b')]['find'](_0x26b397)[_0xdfb3('0x22')](function(_0x199b75){if(_0x199b75){_0x46e489=_0x199b75;return _0x199b75[_0xdfb3('0x6a')]();}return null;})[_0xdfb3('0x22')](function(_0x5b0c0a){if(_0x5b0c0a){if(!_0x5b0c0a['length']){throw new db['Sequelize']['ValidationErrorItem'](_0xdfb3('0x6c'),0x193);}_0x32fb6f=_0x5b0c0a;return db[_0xdfb3('0x6d')]['findAll']({'raw':!![]});}return null;})[_0xdfb3('0x22')](function(_0x713bd2){if(_0x713bd2){_0x2ab719=_[_0xdfb3('0x8a')](_0x713bd2,'id');var _0x5e9959;var _0x9f0d40=squel[_0xdfb3('0x6e')]();_0x9f0d40[_0xdfb3('0x6f')](_0x46e489['table']);for(var _0x2403d8=0x0;_0x2403d8<_0x32fb6f[_0xdfb3('0x33')];_0x2403d8+=0x1){_0x5e9959=_0x32fb6f[_0x2403d8][_0xdfb3('0x71')]?_0x2ab719[_0x32fb6f[_0x2403d8][_0xdfb3('0x71')]][_0xdfb3('0x8b')]:_0x32fb6f[_0x2403d8][_0xdfb3('0x3f')];_0x5e9959=_0x32fb6f[_0x2403d8]['function']?_[_0xdfb3('0xa4')](_0x3cffa1[_0x32fb6f[_0x2403d8][_0xdfb3('0x72')]],'%s',_0x5e9959):_0x5e9959;_0x5e9959=_0x32fb6f[_0x2403d8][_0xdfb3('0x73')]?_[_0xdfb3('0xa4')](_0x468cff[_0x32fb6f[_0x2403d8][_0xdfb3('0x73')]],'%s',_0x5e9959):_0x5e9959;if(_0x32fb6f[_0x2403d8]['groupBy']){_0x9f0d40[_0xdfb3('0x68')](_0x5e9959);}_0x32fb6f[_0x2403d8][_0xdfb3('0x74')]&&_0x9f0d40[_0xdfb3('0x36')](_0x5e9959,_0x32fb6f[_0x2403d8][_0xdfb3('0x74')]==='DESC'?![]:!![]);_0x9f0d40['field'](_0x5e9959,_0x32fb6f[_0x2403d8][_0xdfb3('0x76')]||_0x5e9959);}if(_0x46e489['joins']){_0x46e489['joins']=JSON[_0xdfb3('0x78')](_0x46e489['joins']);for(var _0x28e186=0x0;_0x28e186<_0x46e489['joins']['length'];_0x28e186+=0x1){if(_0x46e489['joins'][_0x28e186][_0xdfb3('0x79')]&&_[_0xdfb3('0x7a')](_0x1e14fa,_0x46e489[_0xdfb3('0x77')][_0x28e186][_0xdfb3('0x79')])&&_0x46e489['joins'][_0x28e186][_0xdfb3('0x7b')]&&_0x46e489[_0xdfb3('0x77')][_0x28e186]['foreignTable']&&_0x46e489['joins'][_0x28e186][_0xdfb3('0x7e')]){_0x9f0d40[_0x46e489[_0xdfb3('0x77')][_0x28e186]['type']](_0x46e489[_0xdfb3('0x77')][_0x28e186][_0xdfb3('0x7c')],null,util[_0xdfb3('0x73')](_0xdfb3('0x7d'),_0x46e489['table'],_0x46e489[_0xdfb3('0x77')][_0x28e186]['parentKey'],_0x46e489[_0xdfb3('0x77')][_0x28e186][_0xdfb3('0x7c')],_0x46e489['joins'][_0x28e186][_0xdfb3('0x7e')]));}}}if(_0x46e489[_0xdfb3('0x7f')]){_0x46e489[_0xdfb3('0x7f')]=JSON[_0xdfb3('0x78')](_0x46e489[_0xdfb3('0x7f')]);_0x9f0d40[_0xdfb3('0x38')](_0x1bae90(_0x46e489['conditions']['group']));}_0x549760=_0x9f0d40['clone']();_0x9f0d40[_0xdfb3('0x1c')](_0x534488);_0x9f0d40[_0xdfb3('0x1b')](0x0);logger[_0xdfb3('0x80')](_0xdfb3('0x81'),_0x9f0d40[_0xdfb3('0x82')]());return db[_0xdfb3('0x83')][_0xdfb3('0x2f')](_0x9f0d40[_0xdfb3('0x82')](),{'type':db['sequelize'][_0xdfb3('0x84')][_0xdfb3('0x85')]});}})[_0xdfb3('0x22')](function(){return{'sql':_0x549760[_0xdfb3('0x82')]()};})[_0xdfb3('0x22')](respondWithResult(_0x1515e7,null))[_0xdfb3('0x49')](handleError(_0x1515e7,null));}; \ No newline at end of file +var _0x7459=['get','UserProfileResource','destroy','error','stack','name','send','AnalyticDefaultReport','model','keys','query','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','field','options','includeAll','include','findAll','rows','show','rawAttributes','intersection','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','autoAssociation','DefaultReports','update','body','params','preview','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','AVG(%s)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','metric','function','format','replace','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','debug','Limited\x20Query:','toString','sequelize','SELECT','right_join','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','MetricId','clone','QueryTypes','No\x20available\x20data','output','web','%s-%s.%s','randomstring','generate','default','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','../../files/reports','countTable','COUNT(*)','run','runReport','MAX(%s)','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','then'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x7459,0x1ad));var _0x9745=function(_0x311746,_0x5d553c){_0x311746=_0x311746-0x0;var _0x1c40d1=_0x7459[_0x311746];return _0x1c40d1;};'use strict';var pdf=require(_0x9745('0x0'));var emlformat=require(_0x9745('0x1'));var rimraf=require(_0x9745('0x2'));var zipdir=require(_0x9745('0x3'));var jsonpatch=require(_0x9745('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9745('0x5'));var Mustache=require('mustache');var util=require(_0x9745('0x6'));var path=require(_0x9745('0x7'));var sox=require(_0x9745('0x8'));var csv=require(_0x9745('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9745('0xa'));var squel=require(_0x9745('0xb'));var crypto=require(_0x9745('0xc'));var jsforce=require(_0x9745('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9745('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9745('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x9745('0xf'));var logger=require(_0x9745('0x10'))(_0x9745('0x11'));var utils=require(_0x9745('0x12'));var config=require(_0x9745('0x13'));var db=require(_0x9745('0x14'))['db'];function respondWithStatusCode(_0x50fabe,_0x1e506d){_0x1e506d=_0x1e506d||0xcc;return function(_0x52c7ca){if(_0x52c7ca){return _0x50fabe[_0x9745('0x15')](_0x1e506d);}return _0x50fabe[_0x9745('0x16')](_0x1e506d)[_0x9745('0x17')]();};}function respondWithResult(_0x508d96,_0x30f988){_0x30f988=_0x30f988||0xc8;return function(_0x17652d){if(_0x17652d){return _0x508d96[_0x9745('0x16')](_0x30f988)[_0x9745('0x18')](_0x17652d);}};}function respondWithFilteredResult(_0x40763d,_0x4c1689){return function(_0x558a84){if(_0x558a84){var _0x33e89f=_0x558a84[_0x9745('0x19')],_0x398221=_0x4c1689[_0x9745('0x1a')],_0x79432e=_0x4c1689[_0x9745('0x1a')]+_0x4c1689[_0x9745('0x1b')],_0x175318;if(_0x79432e>=_0x33e89f){_0x79432e=_0x33e89f;_0x175318=0xc8;}else{_0x175318=0xce;}_0x40763d['status'](_0x175318);return _0x40763d[_0x9745('0x1c')](_0x9745('0x1d'),_0x398221+'-'+_0x79432e+'/'+_0x33e89f)[_0x9745('0x18')](_0x558a84);}return null;};}function patchUpdates(_0x2db5c3){return function(_0x32dbe8){try{jsonpatch[_0x9745('0x1e')](_0x32dbe8,_0x2db5c3,!![]);}catch(_0x2c409d){return BPromise[_0x9745('0x1f')](_0x2c409d);}return _0x32dbe8['save']();};}function saveUpdates(_0x316a20,_0x1007e6){return function(_0x2e8415){if(_0x2e8415){return _0x2e8415['update'](_0x316a20)['then'](function(_0xce515d){return _0xce515d;});}return null;};}function removeEntity(_0x28843a,_0x597552){return function(_0x90577b){if(_0x90577b){return _0x90577b['destroy']()[_0x9745('0x20')](function(){var _0x5a6650=_0x90577b[_0x9745('0x21')]({'plain':!![]});var _0x59f9c9='DefaultReports';return db[_0x9745('0x22')][_0x9745('0x23')]({'where':{'type':_0x59f9c9,'resourceId':_0x5a6650['id']}})[_0x9745('0x20')](function(){return _0x90577b;});})[_0x9745('0x20')](function(){_0x28843a[_0x9745('0x16')](0xcc)[_0x9745('0x17')]();});}};}function handleEntityNotFound(_0x564859,_0x160891){return function(_0x3e3ade){if(!_0x3e3ade){_0x564859[_0x9745('0x15')](0x194);}return _0x3e3ade;};}function handleError(_0x446271,_0x48e7c2){_0x48e7c2=_0x48e7c2||0x1f4;return function(_0x95afbf){logger[_0x9745('0x24')](_0x95afbf[_0x9745('0x25')]);if(_0x95afbf['name']){delete _0x95afbf[_0x9745('0x26')];}_0x446271[_0x9745('0x16')](_0x48e7c2)[_0x9745('0x27')](_0x95afbf);};}exports['index']=function(_0x4b2142,_0x114fe8){var _0x3f4554={},_0x10dc31={},_0xc899db={'count':0x0,'rows':[]};var _0x40dc43=db[_0x9745('0x28')]['rawAttributes'];_0x10dc31[_0x9745('0x29')]=_[_0x9745('0x2a')](_0x40dc43);_0x10dc31['query']=_['keys'](_0x4b2142['query']);_0x10dc31['filters']=_['intersection'](_0x10dc31['model'],_0x10dc31[_0x9745('0x2b')]);_0x3f4554[_0x9745('0x2c')]=_['intersection'](_0x10dc31['model'],qs[_0x9745('0x2d')](_0x4b2142[_0x9745('0x2b')][_0x9745('0x2d')]));_0x3f4554[_0x9745('0x2c')]=_0x3f4554[_0x9745('0x2c')][_0x9745('0x2e')]?_0x3f4554['attributes']:_0x10dc31['model'];if(!_0x4b2142[_0x9745('0x2b')]['hasOwnProperty'](_0x9745('0x2f'))){_0x3f4554[_0x9745('0x1b')]=qs[_0x9745('0x1b')](_0x4b2142[_0x9745('0x2b')]['limit']);_0x3f4554[_0x9745('0x1a')]=qs['offset'](_0x4b2142[_0x9745('0x2b')][_0x9745('0x1a')]);}_0x3f4554[_0x9745('0x30')]=qs[_0x9745('0x31')](_0x4b2142[_0x9745('0x2b')][_0x9745('0x31')]);_0x3f4554[_0x9745('0x32')]=qs[_0x9745('0x33')](_['pick'](_0x4b2142[_0x9745('0x2b')],_0x10dc31['filters']));if(_0x4b2142['query'][_0x9745('0x34')]){_0x3f4554['where']=_[_0x9745('0x35')](_0x3f4554[_0x9745('0x32')],{'$or':_['map'](_0x40dc43,function(_0x20d73f){if(_0x20d73f[_0x9745('0x36')]['key']!==_0x9745('0x37')){var _0x108377={};_0x108377[_0x20d73f[_0x9745('0x38')]]={'$like':'%'+_0x4b2142[_0x9745('0x2b')]['filter']+'%'};return _0x108377;}})});}_0x3f4554=_['merge']({},_0x3f4554,_0x4b2142[_0x9745('0x39')]);var _0x40fa1b={'where':_0x3f4554['where']};return db[_0x9745('0x28')][_0x9745('0x19')](_0x40fa1b)[_0x9745('0x20')](function(_0x28b57c){_0xc899db[_0x9745('0x19')]=_0x28b57c;if(_0x4b2142['query'][_0x9745('0x3a')]){_0x3f4554[_0x9745('0x3b')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x9745('0x3c')](_0x3f4554);})[_0x9745('0x20')](function(_0x3fbad7){_0xc899db[_0x9745('0x3d')]=_0x3fbad7;return _0xc899db;})[_0x9745('0x20')](respondWithFilteredResult(_0x114fe8,_0x3f4554))['catch'](handleError(_0x114fe8,null));};exports[_0x9745('0x3e')]=function(_0x5c0189,_0x130a76){var _0x5bb93f={'raw':!![],'where':{'id':_0x5c0189['params']['id']}},_0x14038b={};_0x14038b[_0x9745('0x29')]=_[_0x9745('0x2a')](db[_0x9745('0x28')][_0x9745('0x3f')]);_0x14038b[_0x9745('0x2b')]=_[_0x9745('0x2a')](_0x5c0189['query']);_0x14038b[_0x9745('0x33')]=_[_0x9745('0x40')](_0x14038b[_0x9745('0x29')],_0x14038b[_0x9745('0x2b')]);_0x5bb93f[_0x9745('0x2c')]=_[_0x9745('0x40')](_0x14038b[_0x9745('0x29')],qs[_0x9745('0x2d')](_0x5c0189[_0x9745('0x2b')][_0x9745('0x2d')]));_0x5bb93f['attributes']=_0x5bb93f['attributes'][_0x9745('0x2e')]?_0x5bb93f[_0x9745('0x2c')]:_0x14038b[_0x9745('0x29')];if(_0x5c0189[_0x9745('0x2b')][_0x9745('0x3a')]){_0x5bb93f[_0x9745('0x3b')]=[{'all':!![]}];}_0x5bb93f=_[_0x9745('0x35')]({},_0x5bb93f,_0x5c0189[_0x9745('0x39')]);return db[_0x9745('0x28')][_0x9745('0x41')](_0x5bb93f)[_0x9745('0x20')](handleEntityNotFound(_0x130a76,null))['then'](respondWithResult(_0x130a76,null))[_0x9745('0x42')](handleError(_0x130a76,null));};exports[_0x9745('0x43')]=function(_0x7d3ff1,_0x35fee1){return db[_0x9745('0x28')][_0x9745('0x43')](_0x7d3ff1['body'],{})[_0x9745('0x20')](function(_0x2f2aae){var _0x2a2ae2=_0x7d3ff1['user'][_0x9745('0x21')]({'plain':!![]});if(!_0x2a2ae2)throw new Error(_0x9745('0x44'));if(_0x2a2ae2[_0x9745('0x45')]===_0x9745('0x46')){var _0x470920=_0x2f2aae[_0x9745('0x21')]({'plain':!![]});var _0x560b8b=_0x9745('0x47');return db['UserProfileSection'][_0x9745('0x41')]({'where':{'name':_0x560b8b,'userProfileId':_0x2a2ae2['userProfileId']},'raw':!![]})['then'](function(_0x45b162){if(_0x45b162&&_0x45b162[_0x9745('0x48')]===0x0){return db[_0x9745('0x22')][_0x9745('0x43')]({'name':_0x470920[_0x9745('0x26')],'resourceId':_0x470920['id'],'type':_0x9745('0x49'),'sectionId':_0x45b162['id']},{})[_0x9745('0x20')](function(){return _0x2f2aae;});}else{return _0x2f2aae;}})['catch'](function(_0x144973){logger[_0x9745('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x144973);throw _0x144973;});}return _0x2f2aae;})[_0x9745('0x20')](respondWithResult(_0x35fee1,0xc9))[_0x9745('0x42')](handleError(_0x35fee1,null));};exports[_0x9745('0x4a')]=function(_0x4a1d4c,_0x275135){if(_0x4a1d4c[_0x9745('0x4b')]['id']){delete _0x4a1d4c[_0x9745('0x4b')]['id'];}return db[_0x9745('0x28')][_0x9745('0x41')]({'where':{'id':_0x4a1d4c[_0x9745('0x4c')]['id']}})[_0x9745('0x20')](handleEntityNotFound(_0x275135,null))[_0x9745('0x20')](saveUpdates(_0x4a1d4c[_0x9745('0x4b')],null))[_0x9745('0x20')](respondWithResult(_0x275135,null))['catch'](handleError(_0x275135,null));};exports[_0x9745('0x23')]=function(_0x6e59d9,_0x57fc13){return db[_0x9745('0x28')]['find']({'where':{'id':_0x6e59d9[_0x9745('0x4c')]['id']}})[_0x9745('0x20')](handleEntityNotFound(_0x57fc13,null))[_0x9745('0x20')](removeEntity(_0x57fc13,null))[_0x9745('0x42')](handleError(_0x57fc13,null));};exports[_0x9745('0x4d')]=function(_0xce3766,_0x4ef346){var _0x27f0e1=0xa;var _0x58b92f=[_0x9745('0x4e'),_0x9745('0x4f'),'right_join',_0x9745('0x50')];var _0xafe162={'SUM':_0x9745('0x51'),'COUNT':_0x9745('0x52'),'COUNT DISTINCT':_0x9745('0x53'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x9745('0x54'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x147638={'SEC_TO_TIME':_0x9745('0x55'),'DATE':_0x9745('0x56'),'HOUR':_0x9745('0x57'),'ROUND':_0x9745('0x58'),'UNIX_TIMESTAMP':_0x9745('0x59')};var _0x623804=function(_0x588c6c){return!_[_0x9745('0x5a')]([_0x9745('0x5b'),_0x9745('0x5c'),_0x9745('0x5d'),_0x9745('0x5e')],_0x588c6c);};var _0x5575ad=function(_0x5402c9){if(!_0x5402c9||!_0x5402c9[_0x9745('0x5f')]['length']){return'';}for(var _0x3a87b1='(',_0x3d23fe=0x0;_0x3d23fe<_0x5402c9[_0x9745('0x5f')][_0x9745('0x2e')];_0x3d23fe+=0x1){_0x3d23fe>0x0&&(_0x3a87b1+='\x20'+_0x5402c9[_0x9745('0x60')]+'\x20');_0x3a87b1+=_0x5402c9[_0x9745('0x5f')][_0x3d23fe]['group']?_0x5575ad(_0x5402c9['rules'][_0x3d23fe][_0x9745('0x61')]):_0x5402c9[_0x9745('0x5f')][_0x3d23fe]['field']+'\x20'+_0x5402c9['rules'][_0x3d23fe][_0x9745('0x62')]+(_0x623804(_0x5402c9[_0x9745('0x5f')][_0x3d23fe][_0x9745('0x62')])?'\x20'+_0x5402c9['rules'][_0x3d23fe][_0x9745('0x63')]:'');}return _0x3a87b1+')';};var _0x422591={'where':{'id':_0xce3766[_0x9745('0x4c')]['id']}},_0x2a6616,_0x33b904,_0x1a8efe,_0x30b6a2,_0x4e1337;_0x422591=_['merge']({},_0x422591,_0xce3766[_0x9745('0x39')]);return db['AnalyticDefaultReport']['find'](_0x422591)[_0x9745('0x20')](function(_0x3c8839){if(_0x3c8839){_0x2a6616=_0x3c8839;return _0x3c8839[_0x9745('0x64')]();}return null;})[_0x9745('0x20')](function(_0x418a3d){if(_0x418a3d){if(!_0x418a3d[_0x9745('0x2e')]){throw new db[(_0x9745('0x65'))][(_0x9745('0x66'))](_0x9745('0x67'),0x193);}_0x33b904=_0x418a3d;return db[_0x9745('0x68')][_0x9745('0x3c')]({'raw':!![]});}return null;})[_0x9745('0x20')](function(_0x5f15ab){if(_0x5f15ab){_0x1a8efe=_[_0x9745('0x69')](_0x5f15ab,'id');var _0x1be3cb;var _0x160522=squel[_0x9745('0x6a')]();_0x160522[_0x9745('0x6b')](_0x2a6616['table']);for(var _0x52958e=0x0;_0x52958e<_0x33b904[_0x9745('0x2e')];_0x52958e+=0x1){_0x1be3cb=_0x33b904[_0x52958e]['MetricId']?_0x1a8efe[_0x33b904[_0x52958e]['MetricId']][_0x9745('0x6c')]:_0x33b904[_0x52958e][_0x9745('0x38')];_0x1be3cb=_0x33b904[_0x52958e][_0x9745('0x6d')]?_['replace'](_0xafe162[_0x33b904[_0x52958e][_0x9745('0x6d')]],'%s',_0x1be3cb):_0x1be3cb;_0x1be3cb=_0x33b904[_0x52958e][_0x9745('0x6e')]?_[_0x9745('0x6f')](_0x147638[_0x33b904[_0x52958e]['format']],'%s',_0x1be3cb):_0x1be3cb;if(_0x33b904[_0x52958e][_0x9745('0x70')]){_0x160522[_0x9745('0x61')](_0x1be3cb);}_0x33b904[_0x52958e][_0x9745('0x71')]&&_0x160522['order'](_0x1be3cb,_0x33b904[_0x52958e][_0x9745('0x71')]===_0x9745('0x72')?![]:!![]);_0x160522['field'](_0x1be3cb,_0x33b904[_0x52958e][_0x9745('0x73')]||_0x1be3cb);}if(_0x2a6616[_0x9745('0x74')]){_0x2a6616[_0x9745('0x74')]=JSON[_0x9745('0x75')](_0x2a6616['joins']);for(var _0x32b9f0=0x0;_0x32b9f0<_0x2a6616[_0x9745('0x74')][_0x9745('0x2e')];_0x32b9f0+=0x1){if(_0x2a6616['joins'][_0x32b9f0][_0x9745('0x36')]&&_[_0x9745('0x5a')](_0x58b92f,_0x2a6616['joins'][_0x32b9f0][_0x9745('0x36')])&&_0x2a6616[_0x9745('0x74')][_0x32b9f0][_0x9745('0x76')]&&_0x2a6616[_0x9745('0x74')][_0x32b9f0][_0x9745('0x77')]&&_0x2a6616[_0x9745('0x74')][_0x32b9f0][_0x9745('0x78')]){_0x160522[_0x2a6616[_0x9745('0x74')][_0x32b9f0][_0x9745('0x36')]](_0x2a6616[_0x9745('0x74')][_0x32b9f0][_0x9745('0x77')],null,util['format'](_0x9745('0x79'),_0x2a6616[_0x9745('0x7a')],_0x2a6616['joins'][_0x32b9f0][_0x9745('0x76')],_0x2a6616['joins'][_0x32b9f0][_0x9745('0x77')],_0x2a6616[_0x9745('0x74')][_0x32b9f0][_0x9745('0x78')]));}}}if(_0x2a6616[_0x9745('0x7b')]){_0x2a6616['conditions']=JSON[_0x9745('0x75')](_0x2a6616[_0x9745('0x7b')]);_0x160522['where'](_0x5575ad(_0x2a6616[_0x9745('0x7b')][_0x9745('0x61')]));}_0x4e1337=_0x160522['clone']();_0x160522[_0x9745('0x1b')](_0x27f0e1);_0x160522[_0x9745('0x1a')](0x0);logger[_0x9745('0x7c')](_0x9745('0x7d'),_0x160522[_0x9745('0x7e')]());return db['sequelize'][_0x9745('0x2b')](_0x160522[_0x9745('0x7e')](),{'type':db[_0x9745('0x7f')]['QueryTypes'][_0x9745('0x80')]});}})[_0x9745('0x20')](respondWithResult(_0x4ef346,null))[_0x9745('0x42')](handleError(_0x4ef346,null));};function runReport(_0x1dc743,_0x435eec,_0x23406a){var _0x5eb4cd=_0x435eec[_0x9745('0x26')];var _0x5af60e=0xa;var _0x47b272=[_0x9745('0x4e'),_0x9745('0x4f'),_0x9745('0x81'),_0x9745('0x50')];var _0x5ee31a={'SUM':_0x9745('0x51'),'COUNT':_0x9745('0x52'),'COUNT DISTINCT':_0x9745('0x53'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x9745('0x82'),'GROUP_CONCAT ASC':_0x9745('0x83'),'GROUP_CONCAT DESC':_0x9745('0x84')};var _0xf04a6c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9745('0x56'),'HOUR':_0x9745('0x57'),'ROUND':_0x9745('0x58'),'UNIX_TIMESTAMP':_0x9745('0x59')};var _0xc29f9=function(_0x6776d8){return!_[_0x9745('0x5a')]([_0x9745('0x5b'),'IS\x20NOT\x20NULL',_0x9745('0x5d'),_0x9745('0x5e')],_0x6776d8);};var _0x403210=function(_0x27b180){if(!_0x27b180||!_0x27b180[_0x9745('0x5f')][_0x9745('0x2e')]){return'';}for(var _0x287cf6='(',_0x40dc42=0x0;_0x40dc42<_0x27b180['rules'][_0x9745('0x2e')];_0x40dc42+=0x1){_0x40dc42>0x0&&(_0x287cf6+='\x20'+_0x27b180[_0x9745('0x60')]+'\x20');_0x287cf6+=_0x27b180[_0x9745('0x5f')][_0x40dc42]['group']?_0x403210(_0x27b180[_0x9745('0x5f')][_0x40dc42][_0x9745('0x61')]):_0x27b180['rules'][_0x40dc42][_0x9745('0x38')]+'\x20'+_0x27b180['rules'][_0x40dc42][_0x9745('0x62')]+(_0xc29f9(_0x27b180['rules'][_0x40dc42][_0x9745('0x62')])?'\x20'+_0x27b180['rules'][_0x40dc42][_0x9745('0x63')]:'');}return _0x287cf6+')';};var _0x1524cd={'where':{'id':_0x1dc743['id']}},_0x9c6453,_0xa70cf4,_0x3d1864,_0x251c06,_0x93031a;_0x1524cd=_['merge']({},_0x1524cd,_0x23406a);return db[_0x9745('0x28')][_0x9745('0x41')](_0x1524cd)[_0x9745('0x20')](function(_0x10f216){if(_0x10f216){_0x9c6453=_0x10f216;return _0x10f216[_0x9745('0x64')]();}return null;})[_0x9745('0x20')](function(_0x4676f9){if(_0x4676f9){if(!_0x4676f9[_0x9745('0x2e')]){throw new db[(_0x9745('0x65'))]['ValidationErrorItem'](_0x9745('0x67'),0x193);}_0xa70cf4=_0x4676f9;return db[_0x9745('0x68')]['findAll']({'raw':!![]});}return null;})[_0x9745('0x20')](function(_0x25f753){if(_0x25f753){_0x3d1864=_[_0x9745('0x69')](_0x25f753,'id');var _0x105f2d;var _0x1fe711=squel['select']();_0x1fe711[_0x9745('0x6b')](_0x9c6453[_0x9745('0x7a')]);for(var _0x26236a=0x0;_0x26236a<_0xa70cf4[_0x9745('0x2e')];_0x26236a+=0x1){_0x105f2d=_0xa70cf4[_0x26236a][_0x9745('0x85')]?_0x3d1864[_0xa70cf4[_0x26236a][_0x9745('0x85')]]['metric']:_0xa70cf4[_0x26236a][_0x9745('0x38')];_0x105f2d=_0xa70cf4[_0x26236a][_0x9745('0x6d')]?_[_0x9745('0x6f')](_0x5ee31a[_0xa70cf4[_0x26236a]['function']],'%s',_0x105f2d):_0x105f2d;_0x105f2d=_0xa70cf4[_0x26236a][_0x9745('0x6e')]?_[_0x9745('0x6f')](_0xf04a6c[_0xa70cf4[_0x26236a][_0x9745('0x6e')]],'%s',_0x105f2d):_0x105f2d;if(_0xa70cf4[_0x26236a][_0x9745('0x70')]){_0x1fe711[_0x9745('0x61')](_0x105f2d);}_0xa70cf4[_0x26236a][_0x9745('0x71')]&&_0x1fe711['order'](_0x105f2d,_0xa70cf4[_0x26236a][_0x9745('0x71')]===_0x9745('0x72')?![]:!![]);_0x1fe711[_0x9745('0x38')](_0x105f2d,_0xa70cf4[_0x26236a][_0x9745('0x73')]||_0x105f2d);}if(_0x9c6453[_0x9745('0x74')]){_0x9c6453['joins']=JSON[_0x9745('0x75')](_0x9c6453[_0x9745('0x74')]);for(var _0x5abc3d=0x0;_0x5abc3d<_0x9c6453[_0x9745('0x74')][_0x9745('0x2e')];_0x5abc3d+=0x1){if(_0x9c6453[_0x9745('0x74')][_0x5abc3d][_0x9745('0x36')]&&_['includes'](_0x47b272,_0x9c6453[_0x9745('0x74')][_0x5abc3d][_0x9745('0x36')])&&_0x9c6453[_0x9745('0x74')][_0x5abc3d][_0x9745('0x76')]&&_0x9c6453[_0x9745('0x74')][_0x5abc3d][_0x9745('0x77')]&&_0x9c6453[_0x9745('0x74')][_0x5abc3d][_0x9745('0x78')]){_0x1fe711[_0x9c6453[_0x9745('0x74')][_0x5abc3d][_0x9745('0x36')]](_0x9c6453['joins'][_0x5abc3d][_0x9745('0x77')],null,util[_0x9745('0x6e')](_0x9745('0x79'),_0x9c6453[_0x9745('0x7a')],_0x9c6453[_0x9745('0x74')][_0x5abc3d][_0x9745('0x76')],_0x9c6453[_0x9745('0x74')][_0x5abc3d][_0x9745('0x77')],_0x9c6453[_0x9745('0x74')][_0x5abc3d]['foreignKey']));}}}if(_0x9c6453['conditions']){_0x9c6453[_0x9745('0x7b')]=JSON['parse'](_0x9c6453['conditions']);_0x1fe711[_0x9745('0x32')](_0x403210(_0x9c6453[_0x9745('0x7b')]['group']));}_0x93031a=_0x1fe711[_0x9745('0x86')]();_0x1fe711['limit'](_0x5af60e);_0x1fe711[_0x9745('0x1a')](0x0);logger[_0x9745('0x7c')](_0x9745('0x7d'),_0x1fe711[_0x9745('0x7e')]());return db['sequelize']['query'](_0x1fe711[_0x9745('0x7e')](),{'type':db[_0x9745('0x7f')][_0x9745('0x87')][_0x9745('0x80')]});}})[_0x9745('0x20')](function(_0x5f2f9b){if(!_0x5f2f9b[_0x9745('0x2e')]){throw new db[(_0x9745('0x65'))][(_0x9745('0x66'))](_0x9745('0x88'),0xcc);}if(_0x435eec[_0x9745('0x89')]===_0x9745('0x8a')){return null;}var _0x493f1d=_[_0x9745('0x35')](_0x435eec,{'name':_0x435eec['fullPath']||_0x435eec[_0x9745('0x26')]||_0x9c6453['name'],'basename':_0x5eb4cd,'savename':util['format'](_0x9745('0x8b'),_0x435eec[_0x9745('0x26')]||_0x9c6453[_0x9745('0x26')],require(_0x9745('0x8c'))[_0x9745('0x8d')](0x4),_0x435eec[_0x9745('0x89')]||'csv'),'reportId':_0x9c6453['id'],'reportType':_0x9745('0x8e')});return db['AnalyticExtractedReport'][_0x9745('0x43')](_0x493f1d,{'raw':!![]});})[_0x9745('0x20')](function(_0x48c2c5){if(_0x9c6453[_0x9745('0x7a')]===_0x9745('0x8f')){_0x93031a['where'](_0x9c6453['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x435eec[_0x9745('0x90')],_0x435eec['endDate']);}else{_0x93031a[_0x9745('0x32')](_0x9c6453['table']+_0x9745('0x91'),_0x435eec[_0x9745('0x90')],_0x435eec['endDate']);}if(_0x48c2c5){logger[_0x9745('0x92')](_0x9745('0x93'),_0x93031a['toString']());require('child_process')['fork'](path[_0x9745('0x4e')](__dirname,'../../components/export/',_0x48c2c5['output']),[_0x48c2c5['id'],_0x93031a[_0x9745('0x7e')](),path['join'](__dirname,_0x9745('0x94'),_0x48c2c5['savename']),_0x5eb4cd]);return _0x48c2c5;}else{var _0x315b59=squel[_0x9745('0x6a')]();_0x315b59['from']('('+_0x93031a[_0x9745('0x7e')]()+')',_0x9745('0x95'));_0x315b59[_0x9745('0x38')](_0x9745('0x96'),'count');_0x93031a[_0x9745('0x1b')](_0x435eec[_0x9745('0x1b')]||_0x5af60e);_0x93031a[_0x9745('0x1a')](_0x435eec[_0x9745('0x1a')]||0x0);return db[_0x9745('0x7f')][_0x9745('0x2b')](_0x315b59[_0x9745('0x7e')](),{'type':db[_0x9745('0x7f')][_0x9745('0x87')][_0x9745('0x80')]})[_0x9745('0x20')](function(_0x93d9e7){if(!_0x93d9e7['length']){_0x251c06=0x0;}else{_0x251c06=_0x93d9e7[0x0]['count']||0x0;}return db[_0x9745('0x7f')]['query'](_0x93031a[_0x9745('0x7e')](),{'type':db[_0x9745('0x7f')][_0x9745('0x87')][_0x9745('0x80')]});})[_0x9745('0x20')](function(_0x47724a){return{'rows':_0x47724a||[],'count':_0x251c06};});}});}exports[_0x9745('0x97')]=function(_0x151a36,_0x394137){return runReport(_0x151a36['params'],_0x151a36[_0x9745('0x2b')],_0x151a36[_0x9745('0x39')])[_0x9745('0x20')](respondWithResult(_0x394137,null))[_0x9745('0x42')](handleError(_0x394137,null));};exports[_0x9745('0x98')]=runReport;exports[_0x9745('0x2b')]=function(_0x5d3e75,_0x2e200c){var _0x26f687=0xa;var _0x6e0f95=['join',_0x9745('0x4f'),_0x9745('0x81'),_0x9745('0x50')];var _0x73b2f2={'SUM':_0x9745('0x51'),'COUNT':_0x9745('0x52'),'COUNT DISTINCT':_0x9745('0x53'),'MAX':_0x9745('0x99'),'MIN':'MIN(%s)','AVG':_0x9745('0x54'),'GROUP_CONCAT':_0x9745('0x82'),'GROUP_CONCAT ASC':_0x9745('0x83'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x42ee73={'SEC_TO_TIME':_0x9745('0x55'),'DATE':_0x9745('0x56'),'HOUR':_0x9745('0x57'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x362256=function(_0x156740){return!_[_0x9745('0x5a')]([_0x9745('0x5b'),_0x9745('0x5c'),_0x9745('0x5d'),_0x9745('0x5e')],_0x156740);};var _0x4d3498=function(_0x1660c7){if(!_0x1660c7||!_0x1660c7[_0x9745('0x5f')][_0x9745('0x2e')]){return'';}for(var _0x4493bb='(',_0x4a468b=0x0;_0x4a468b<_0x1660c7[_0x9745('0x5f')][_0x9745('0x2e')];_0x4a468b+=0x1){_0x4a468b>0x0&&(_0x4493bb+='\x20'+_0x1660c7[_0x9745('0x60')]+'\x20');_0x4493bb+=_0x1660c7['rules'][_0x4a468b]['group']?_0x4d3498(_0x1660c7[_0x9745('0x5f')][_0x4a468b][_0x9745('0x61')]):_0x1660c7[_0x9745('0x5f')][_0x4a468b][_0x9745('0x38')]+'\x20'+_0x1660c7[_0x9745('0x5f')][_0x4a468b][_0x9745('0x62')]+(_0x362256(_0x1660c7[_0x9745('0x5f')][_0x4a468b][_0x9745('0x62')])?'\x20'+_0x1660c7[_0x9745('0x5f')][_0x4a468b][_0x9745('0x63')]:'');}return _0x4493bb+')';};var _0x27ec4c={'where':{'id':_0x5d3e75[_0x9745('0x4c')]['id']}},_0x23d60e,_0x399886,_0x220696,_0x2f05a6,_0x51c63e;_0x27ec4c=_[_0x9745('0x35')]({},_0x27ec4c,_0x5d3e75[_0x9745('0x39')]);return db[_0x9745('0x28')]['find'](_0x27ec4c)[_0x9745('0x20')](function(_0x11eeb2){if(_0x11eeb2){_0x23d60e=_0x11eeb2;return _0x11eeb2[_0x9745('0x64')]();}return null;})[_0x9745('0x20')](function(_0x3d2ff0){if(_0x3d2ff0){if(!_0x3d2ff0[_0x9745('0x2e')]){throw new db[(_0x9745('0x65'))][(_0x9745('0x66'))](_0x9745('0x67'),0x193);}_0x399886=_0x3d2ff0;return db[_0x9745('0x68')][_0x9745('0x3c')]({'raw':!![]});}return null;})['then'](function(_0x43b67f){if(_0x43b67f){_0x220696=_[_0x9745('0x69')](_0x43b67f,'id');var _0x2b8523;var _0x17d3f9=squel['select']();_0x17d3f9[_0x9745('0x6b')](_0x23d60e[_0x9745('0x7a')]);for(var _0x46eb30=0x0;_0x46eb30<_0x399886[_0x9745('0x2e')];_0x46eb30+=0x1){_0x2b8523=_0x399886[_0x46eb30]['MetricId']?_0x220696[_0x399886[_0x46eb30][_0x9745('0x85')]]['metric']:_0x399886[_0x46eb30][_0x9745('0x38')];_0x2b8523=_0x399886[_0x46eb30][_0x9745('0x6d')]?_[_0x9745('0x6f')](_0x73b2f2[_0x399886[_0x46eb30][_0x9745('0x6d')]],'%s',_0x2b8523):_0x2b8523;_0x2b8523=_0x399886[_0x46eb30][_0x9745('0x6e')]?_['replace'](_0x42ee73[_0x399886[_0x46eb30][_0x9745('0x6e')]],'%s',_0x2b8523):_0x2b8523;if(_0x399886[_0x46eb30][_0x9745('0x70')]){_0x17d3f9['group'](_0x2b8523);}_0x399886[_0x46eb30][_0x9745('0x71')]&&_0x17d3f9[_0x9745('0x30')](_0x2b8523,_0x399886[_0x46eb30][_0x9745('0x71')]===_0x9745('0x72')?![]:!![]);_0x17d3f9[_0x9745('0x38')](_0x2b8523,_0x399886[_0x46eb30][_0x9745('0x73')]||_0x2b8523);}if(_0x23d60e['joins']){_0x23d60e[_0x9745('0x74')]=JSON[_0x9745('0x75')](_0x23d60e[_0x9745('0x74')]);for(var _0xd4abab=0x0;_0xd4abab<_0x23d60e['joins']['length'];_0xd4abab+=0x1){if(_0x23d60e['joins'][_0xd4abab][_0x9745('0x36')]&&_['includes'](_0x6e0f95,_0x23d60e[_0x9745('0x74')][_0xd4abab][_0x9745('0x36')])&&_0x23d60e[_0x9745('0x74')][_0xd4abab]['parentKey']&&_0x23d60e[_0x9745('0x74')][_0xd4abab][_0x9745('0x77')]&&_0x23d60e['joins'][_0xd4abab]['foreignKey']){_0x17d3f9[_0x23d60e['joins'][_0xd4abab][_0x9745('0x36')]](_0x23d60e[_0x9745('0x74')][_0xd4abab]['foreignTable'],null,util[_0x9745('0x6e')](_0x9745('0x79'),_0x23d60e[_0x9745('0x7a')],_0x23d60e['joins'][_0xd4abab][_0x9745('0x76')],_0x23d60e[_0x9745('0x74')][_0xd4abab][_0x9745('0x77')],_0x23d60e[_0x9745('0x74')][_0xd4abab][_0x9745('0x78')]));}}}if(_0x23d60e[_0x9745('0x7b')]){_0x23d60e[_0x9745('0x7b')]=JSON[_0x9745('0x75')](_0x23d60e[_0x9745('0x7b')]);_0x17d3f9[_0x9745('0x32')](_0x4d3498(_0x23d60e['conditions'][_0x9745('0x61')]));}_0x51c63e=_0x17d3f9[_0x9745('0x86')]();_0x17d3f9[_0x9745('0x1b')](_0x26f687);_0x17d3f9[_0x9745('0x1a')](0x0);logger['debug'](_0x9745('0x7d'),_0x17d3f9[_0x9745('0x7e')]());return db[_0x9745('0x7f')][_0x9745('0x2b')](_0x17d3f9['toString'](),{'type':db[_0x9745('0x7f')]['QueryTypes'][_0x9745('0x80')]});}})[_0x9745('0x20')](function(){return{'sql':_0x51c63e[_0x9745('0x7e')]()};})[_0x9745('0x20')](respondWithResult(_0x2e200c,null))[_0x9745('0x42')](handleError(_0x2e200c,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 319789d..c857c05 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 _0x656b=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','analytics_default_reports','lodash','util'];(function(_0x287bcf,_0x139dfb){var _0x44a8d5=function(_0x41ace6){while(--_0x41ace6){_0x287bcf['push'](_0x287bcf['shift']());}};_0x44a8d5(++_0x139dfb);}(_0x656b,0xc1));var _0xb656=function(_0x3fdc82,_0x3796ed){_0x3fdc82=_0x3fdc82-0x0;var _0x3214e3=_0x656b[_0x3fdc82];return _0x3214e3;};'use strict';var _=require(_0xb656('0x0'));var util=require(_0xb656('0x1'));var logger=require(_0xb656('0x2'))(_0xb656('0x3'));var moment=require('moment');var BPromise=require(_0xb656('0x4'));var rp=require(_0xb656('0x5'));var fs=require('fs');var path=require(_0xb656('0x6'));var rimraf=require(_0xb656('0x7'));var config=require(_0xb656('0x8'));var attributes=require(_0xb656('0x9'));module[_0xb656('0xa')]=function(_0x391e0a,_0xfbf456){return _0x391e0a['define'](_0xb656('0xb'),attributes,{'tableName':_0xb656('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x96e0=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticDefaultReport.attributes','exports','define','analytics_default_reports','lodash','util'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x96e0,0x184));var _0x096e=function(_0x1f31fe,_0x1acf93){_0x1f31fe=_0x1f31fe-0x0;var _0x30422e=_0x96e0[_0x1f31fe];return _0x30422e;};'use strict';var _=require(_0x096e('0x0'));var util=require(_0x096e('0x1'));var logger=require(_0x096e('0x2'))(_0x096e('0x3'));var moment=require(_0x096e('0x4'));var BPromise=require(_0x096e('0x5'));var rp=require(_0x096e('0x6'));var fs=require('fs');var path=require(_0x096e('0x7'));var rimraf=require(_0x096e('0x8'));var config=require('../../config/environment');var attributes=require(_0x096e('0x9'));module[_0x096e('0xa')]=function(_0xf2e3b8,_0x60ccb4){return _0xf2e3b8[_0x096e('0xb')]('AnalyticDefaultReport',attributes,{'tableName':_0x096e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 55691d9..b3b9f35 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2219ef,_0x941436){var _0x897093=function(_0x4df8c3){while(--_0x4df8c3){_0x2219ef['push'](_0x2219ef['shift']());}};_0x897093(++_0x941436);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0x70e0=['code','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x46f31e,_0x459163){var _0x1a3bff=function(_0x492243){while(--_0x492243){_0x46f31e['push'](_0x46f31e['shift']());}};_0x1a3bff(++_0x459163);}(_0x70e0,0x17b));var _0x070e=function(_0x4a41bb,_0x5c3d9e){_0x4a41bb=_0x4a41bb-0x0;var _0x144027=_0x70e0[_0x4a41bb];return _0x144027;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index c955c27..3b373b4 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 _0xc07c=['update','delete','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','show','preview','/:id/run','query','post','create','put','/:id'];(function(_0x5baa0a,_0x237c6e){var _0x567e64=function(_0x6d22ff){while(--_0x6d22ff){_0x5baa0a['push'](_0x5baa0a['shift']());}};_0x567e64(++_0x237c6e);}(_0xc07c,0x17d));var _0xcc07=function(_0x4e78c4,_0x1195b8){_0x4e78c4=_0x4e78c4-0x0;var _0x199eea=_0xc07c[_0x4e78c4];return _0x199eea;};'use strict';var multer=require(_0xcc07('0x0'));var util=require(_0xcc07('0x1'));var path=require(_0xcc07('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xcc07('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xcc07('0x4'));var config=require(_0xcc07('0x5'));var controller=require(_0xcc07('0x6'));router[_0xcc07('0x7')]('/',auth[_0xcc07('0x8')](),controller[_0xcc07('0x9')]);router[_0xcc07('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xcc07('0xa')]);router[_0xcc07('0x7')]('/:id/preview',auth[_0xcc07('0x8')](),controller[_0xcc07('0xb')]);router[_0xcc07('0x7')](_0xcc07('0xc'),auth[_0xcc07('0x8')](),controller['run']);router[_0xcc07('0x7')]('/:id/query',auth[_0xcc07('0x8')](),controller[_0xcc07('0xd')]);router[_0xcc07('0xe')]('/',auth['isAuthenticated'](),controller[_0xcc07('0xf')]);router[_0xcc07('0x10')](_0xcc07('0x11'),auth['isAuthenticated'](),controller[_0xcc07('0x12')]);router[_0xcc07('0x13')](_0xcc07('0x11'),auth[_0xcc07('0x8')](),controller['destroy']);module[_0xcc07('0x14')]=router; \ No newline at end of file +var _0xff05=['destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','show','/:id/preview','preview','/:id/run','run','/:id/query','post','create','put','/:id','delete'];(function(_0x1c85ac,_0x413cb9){var _0x12819f=function(_0x458c4d){while(--_0x458c4d){_0x1c85ac['push'](_0x1c85ac['shift']());}};_0x12819f(++_0x413cb9);}(_0xff05,0x192));var _0x5ff0=function(_0x200a3b,_0x475c95){_0x200a3b=_0x200a3b-0x0;var _0x54622b=_0xff05[_0x200a3b];return _0x54622b;};'use strict';var multer=require(_0x5ff0('0x0'));var util=require(_0x5ff0('0x1'));var path=require(_0x5ff0('0x2'));var timeout=require(_0x5ff0('0x3'));var express=require(_0x5ff0('0x4'));var router=express['Router']();var auth=require(_0x5ff0('0x5'));var interaction=require(_0x5ff0('0x6'));var config=require(_0x5ff0('0x7'));var controller=require(_0x5ff0('0x8'));router[_0x5ff0('0x9')]('/',auth[_0x5ff0('0xa')](),controller[_0x5ff0('0xb')]);router[_0x5ff0('0x9')]('/:id',auth[_0x5ff0('0xa')](),controller[_0x5ff0('0xc')]);router[_0x5ff0('0x9')](_0x5ff0('0xd'),auth['isAuthenticated'](),controller[_0x5ff0('0xe')]);router[_0x5ff0('0x9')](_0x5ff0('0xf'),auth[_0x5ff0('0xa')](),controller[_0x5ff0('0x10')]);router[_0x5ff0('0x9')](_0x5ff0('0x11'),auth[_0x5ff0('0xa')](),controller['query']);router[_0x5ff0('0x12')]('/',auth[_0x5ff0('0xa')](),controller[_0x5ff0('0x13')]);router[_0x5ff0('0x14')](_0x5ff0('0x15'),auth['isAuthenticated'](),controller['update']);router[_0x5ff0('0x16')](_0x5ff0('0x15'),auth[_0x5ff0('0xa')](),controller[_0x5ff0('0x17')]);module[_0x5ff0('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 a656b26..dc0b91b 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 _0x40df=['pdf','xlsx','DATE','manual','scheduled','INTEGER','sequelize','moment','exports','STRING','ENUM','csv'];(function(_0x15e6fe,_0x1a5c39){var _0x34894d=function(_0x32eec2){while(--_0x32eec2){_0x15e6fe['push'](_0x15e6fe['shift']());}};_0x34894d(++_0x1a5c39);}(_0x40df,0x162));var _0xf40d=function(_0x48ed6d,_0x4c6169){_0x48ed6d=_0x48ed6d-0x0;var _0x576050=_0x40df[_0x48ed6d];return _0x576050;};'use strict';var Sequelize=require(_0xf40d('0x0'));var moment=require(_0xf40d('0x1'));module[_0xf40d('0x2')]={'name':{'type':Sequelize[_0xf40d('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xf40d('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0xf40d('0x4')](_0xf40d('0x5'),_0xf40d('0x6'),_0xf40d('0x7')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0xf40d('0x8')]},'endDate':{'type':Sequelize[_0xf40d('0x8')]},'status':{'type':Sequelize[_0xf40d('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xf40d('0x4')](_0xf40d('0x9'),_0xf40d('0xa')),'allowNull':![],'defaultValue':_0xf40d('0x9')},'reportId':{'type':Sequelize[_0xf40d('0xb')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbad8=['csv','pdf','xlsx','DATE','ENUM','scheduled','manual','INTEGER','UNSIGNED','moment','exports','STRING'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xbad8,0x1b9));var _0x8bad=function(_0x4adfa4,_0x121c5a){_0x4adfa4=_0x4adfa4-0x0;var _0x14cec1=_0xbad8[_0x4adfa4];return _0x14cec1;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x8bad('0x0'));module[_0x8bad('0x1')]={'name':{'type':Sequelize[_0x8bad('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x8bad('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x8bad('0x3'),_0x8bad('0x4'),_0x8bad('0x5')),'allowNull':![],'defaultValue':_0x8bad('0x3')},'savename':{'type':Sequelize[_0x8bad('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x8bad('0x6')]},'endDate':{'type':Sequelize[_0x8bad('0x6')]},'status':{'type':Sequelize[_0x8bad('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x8bad('0x7')]('manual',_0x8bad('0x8')),'allowNull':![],'defaultValue':_0x8bad('0x9')},'reportId':{'type':Sequelize[_0x8bad('0xa')](0xb)[_0x8bad('0xb')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 223a8d9..e0a2553 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 _0x028b=['apply','reject','save','then','ExtractedReports','UserProfileResource','destroy','stack','name','index','AnalyticExtractedReport','rawAttributes','keys','query','filters','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','map','key','VIRTUAL','field','findAll','rows','catch','params','include','merge','options','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','toLowerCase','html-pdf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/environment','sendStatus','status','end','count','offset','json'];(function(_0x5a763a,_0x33b25d){var _0x4a08c6=function(_0x3ef6e4){while(--_0x3ef6e4){_0x5a763a['push'](_0x5a763a['shift']());}};_0x4a08c6(++_0x33b25d);}(_0x028b,0x95));var _0xb028=function(_0x5ec201,_0x37b650){_0x5ec201=_0x5ec201-0x0;var _0x44fa7b=_0x028b[_0x5ec201];return _0x44fa7b;};'use strict';var pdf=require(_0xb028('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb028('0x1'));var jsonpatch=require(_0xb028('0x2'));var rp=require(_0xb028('0x3'));var moment=require(_0xb028('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb028('0x5'));var util=require(_0xb028('0x6'));var path=require(_0xb028('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb028('0x8'));var fs=require('fs');var _=require(_0xb028('0x9'));var squel=require('squel');var crypto=require(_0xb028('0xa'));var jsforce=require(_0xb028('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xb028('0xc'));var querystring=require(_0xb028('0xd'));var Papa=require(_0xb028('0xe'));var Redis=require(_0xb028('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb028('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb028('0x11'));var utils=require('../../config/utils');var config=require(_0xb028('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1fcb85,_0x540b52){_0x540b52=_0x540b52||0xcc;return function(_0x238705){if(_0x238705){return _0x1fcb85[_0xb028('0x13')](_0x540b52);}return _0x1fcb85[_0xb028('0x14')](_0x540b52)[_0xb028('0x15')]();};}function respondWithResult(_0x4e0631,_0x4c3ac2){_0x4c3ac2=_0x4c3ac2||0xc8;return function(_0x40a512){if(_0x40a512){return _0x4e0631['status'](_0x4c3ac2)['json'](_0x40a512);}};}function respondWithFilteredResult(_0x2f1ccb,_0x5d8d7c){return function(_0x3b217a){if(_0x3b217a){var _0x17c83b=_0x3b217a[_0xb028('0x16')],_0x5632a1=_0x5d8d7c['offset'],_0x42ddaa=_0x5d8d7c[_0xb028('0x17')]+_0x5d8d7c['limit'],_0x17c6ab;if(_0x42ddaa>=_0x17c83b){_0x42ddaa=_0x17c83b;_0x17c6ab=0xc8;}else{_0x17c6ab=0xce;}_0x2f1ccb['status'](_0x17c6ab);return _0x2f1ccb['set']('Content-Range',_0x5632a1+'-'+_0x42ddaa+'/'+_0x17c83b)[_0xb028('0x18')](_0x3b217a);}return null;};}function patchUpdates(_0x13538d){return function(_0x1c6009){try{jsonpatch[_0xb028('0x19')](_0x1c6009,_0x13538d,!![]);}catch(_0x6c6cd2){return BPromise[_0xb028('0x1a')](_0x6c6cd2);}return _0x1c6009[_0xb028('0x1b')]();};}function saveUpdates(_0x25ba25,_0x449c09){return function(_0x930535){if(_0x930535){return _0x930535['update'](_0x25ba25)[_0xb028('0x1c')](function(_0x21116c){return _0x21116c;});}return null;};}function removeEntity(_0x41ab19,_0x2cfcca){return function(_0x156d8e){if(_0x156d8e){return _0x156d8e['destroy']()['then'](function(){var _0x45c2b1=_0x156d8e['get']({'plain':!![]});var _0x2fa699=_0xb028('0x1d');return db[_0xb028('0x1e')][_0xb028('0x1f')]({'where':{'type':_0x2fa699,'resourceId':_0x45c2b1['id']}})[_0xb028('0x1c')](function(){return _0x156d8e;});})[_0xb028('0x1c')](function(){_0x41ab19[_0xb028('0x14')](0xcc)[_0xb028('0x15')]();});}};}function handleEntityNotFound(_0x5ea5fc,_0x55afcc){return function(_0x2d1b21){if(!_0x2d1b21){_0x5ea5fc[_0xb028('0x13')](0x194);}return _0x2d1b21;};}function handleError(_0x22d345,_0x54b59c){_0x54b59c=_0x54b59c||0x1f4;return function(_0x54945d){logger['error'](_0x54945d[_0xb028('0x20')]);if(_0x54945d['name']){delete _0x54945d[_0xb028('0x21')];}_0x22d345[_0xb028('0x14')](_0x54b59c)['send'](_0x54945d);};}exports[_0xb028('0x22')]=function(_0x309d0e,_0x236a88){var _0x37f12d={},_0x211a73={},_0xc763a5={'count':0x0,'rows':[]};var _0x234315=db[_0xb028('0x23')][_0xb028('0x24')];_0x211a73['model']=_[_0xb028('0x25')](_0x234315);_0x211a73[_0xb028('0x26')]=_[_0xb028('0x25')](_0x309d0e[_0xb028('0x26')]);_0x211a73[_0xb028('0x27')]=_[_0xb028('0x28')](_0x211a73['model'],_0x211a73[_0xb028('0x26')]);_0x37f12d['attributes']=_['intersection'](_0x211a73['model'],qs[_0xb028('0x29')](_0x309d0e['query'][_0xb028('0x29')]));_0x37f12d['attributes']=_0x37f12d[_0xb028('0x2a')][_0xb028('0x2b')]?_0x37f12d['attributes']:_0x211a73[_0xb028('0x2c')];if(!_0x309d0e[_0xb028('0x26')][_0xb028('0x2d')](_0xb028('0x2e'))){_0x37f12d[_0xb028('0x2f')]=qs['limit'](_0x309d0e[_0xb028('0x26')][_0xb028('0x2f')]);_0x37f12d[_0xb028('0x17')]=qs[_0xb028('0x17')](_0x309d0e['query'][_0xb028('0x17')]);}_0x37f12d[_0xb028('0x30')]=qs[_0xb028('0x31')](_0x309d0e[_0xb028('0x26')][_0xb028('0x31')]);_0x37f12d[_0xb028('0x32')]=qs['filters'](_[_0xb028('0x33')](_0x309d0e[_0xb028('0x26')],_0x211a73['filters']));if(_0x309d0e[_0xb028('0x26')][_0xb028('0x34')]){_0x37f12d[_0xb028('0x32')]=_['merge'](_0x37f12d['where'],{'$or':_[_0xb028('0x35')](_0x234315,function(_0xe86eb){if(_0xe86eb['type'][_0xb028('0x36')]!==_0xb028('0x37')){var _0x1cfacb={};_0x1cfacb[_0xe86eb[_0xb028('0x38')]]={'$like':'%'+_0x309d0e['query'][_0xb028('0x34')]+'%'};return _0x1cfacb;}})});}_0x37f12d=_['merge']({},_0x37f12d,_0x309d0e['options']);var _0xfbb147={'where':_0x37f12d[_0xb028('0x32')]};return db['AnalyticExtractedReport'][_0xb028('0x16')](_0xfbb147)['then'](function(_0x449d94){_0xc763a5[_0xb028('0x16')]=_0x449d94;if(_0x309d0e[_0xb028('0x26')]['includeAll']){_0x37f12d['include']=[{'all':!![]}];}return db[_0xb028('0x23')][_0xb028('0x39')](_0x37f12d);})[_0xb028('0x1c')](function(_0x4aaac5){_0xc763a5[_0xb028('0x3a')]=_0x4aaac5;return _0xc763a5;})['then'](respondWithFilteredResult(_0x236a88,_0x37f12d))[_0xb028('0x3b')](handleError(_0x236a88,null));};exports['show']=function(_0x156a5e,_0x48dff2){var _0x24d9cd={'raw':!![],'where':{'id':_0x156a5e[_0xb028('0x3c')]['id']}},_0x493218={};_0x493218['model']=_[_0xb028('0x25')](db[_0xb028('0x23')]['rawAttributes']);_0x493218['query']=_[_0xb028('0x25')](_0x156a5e[_0xb028('0x26')]);_0x493218[_0xb028('0x27')]=_[_0xb028('0x28')](_0x493218['model'],_0x493218[_0xb028('0x26')]);_0x24d9cd['attributes']=_[_0xb028('0x28')](_0x493218['model'],qs[_0xb028('0x29')](_0x156a5e['query'][_0xb028('0x29')]));_0x24d9cd['attributes']=_0x24d9cd['attributes'][_0xb028('0x2b')]?_0x24d9cd[_0xb028('0x2a')]:_0x493218[_0xb028('0x2c')];if(_0x156a5e[_0xb028('0x26')]['includeAll']){_0x24d9cd[_0xb028('0x3d')]=[{'all':!![]}];}_0x24d9cd=_[_0xb028('0x3e')]({},_0x24d9cd,_0x156a5e[_0xb028('0x3f')]);return db[_0xb028('0x23')][_0xb028('0x40')](_0x24d9cd)[_0xb028('0x1c')](handleEntityNotFound(_0x48dff2,null))[_0xb028('0x1c')](respondWithResult(_0x48dff2,null))[_0xb028('0x3b')](handleError(_0x48dff2,null));};exports[_0xb028('0x41')]=function(_0x36ff09,_0x4e4344){return db['AnalyticExtractedReport'][_0xb028('0x41')](_0x36ff09[_0xb028('0x42')],{})[_0xb028('0x1c')](function(_0x2168b4){var _0x516d7e=_0x36ff09['user'][_0xb028('0x43')]({'plain':!![]});if(!_0x516d7e)throw new Error(_0xb028('0x44'));if(_0x516d7e['role']===_0xb028('0x45')){var _0x3d1a52=_0x2168b4['get']({'plain':!![]});var _0x329491=_0xb028('0x1d');return db[_0xb028('0x46')]['find']({'where':{'name':_0x329491,'userProfileId':_0x516d7e[_0xb028('0x47')]},'raw':!![]})[_0xb028('0x1c')](function(_0x7470e4){if(_0x7470e4&&_0x7470e4[_0xb028('0x48')]===0x0){return db[_0xb028('0x1e')][_0xb028('0x41')]({'name':_0x3d1a52[_0xb028('0x21')],'resourceId':_0x3d1a52['id'],'type':_0x7470e4[_0xb028('0x21')],'sectionId':_0x7470e4['id']},{})[_0xb028('0x1c')](function(){return _0x2168b4;});}else{return _0x2168b4;}})['catch'](function(_0x8dbdb9){logger['error'](_0xb028('0x49'),_0x8dbdb9);throw _0x8dbdb9;});}return _0x2168b4;})[_0xb028('0x1c')](respondWithResult(_0x4e4344,0xc9))[_0xb028('0x3b')](handleError(_0x4e4344,null));};exports[_0xb028('0x4a')]=function(_0x5a00ec,_0x4282de){if(_0x5a00ec['body']['id']){delete _0x5a00ec[_0xb028('0x42')]['id'];}return db[_0xb028('0x23')]['find']({'where':{'id':_0x5a00ec[_0xb028('0x3c')]['id']}})[_0xb028('0x1c')](handleEntityNotFound(_0x4282de,null))[_0xb028('0x1c')](saveUpdates(_0x5a00ec[_0xb028('0x42')],null))[_0xb028('0x1c')](respondWithResult(_0x4282de,null))[_0xb028('0x3b')](handleError(_0x4282de,null));};exports[_0xb028('0x1f')]=function(_0x194b55,_0x3ea702){return db[_0xb028('0x23')]['find']({'where':{'id':_0x194b55[_0xb028('0x3c')]['id']}})['then'](handleEntityNotFound(_0x3ea702,null))[_0xb028('0x1c')](removeEntity(_0x3ea702,null))[_0xb028('0x3b')](handleError(_0x3ea702,null));};exports[_0xb028('0x4b')]=function(_0x37a70b,_0x4dcb44,_0x1b019a){return db[_0xb028('0x23')]['find']({'where':{'id':_0x37a70b[_0xb028('0x3c')]['id']},'attributes':['name',_0xb028('0x4c'),_0xb028('0x4d'),_0xb028('0x4e')],'raw':!![]})[_0xb028('0x1c')](handleEntityNotFound(_0x4dcb44,null))[_0xb028('0x1c')](function(_0x30c115){if(_0x30c115){if(!fs[_0xb028('0x4f')](path[_0xb028('0x50')](config[_0xb028('0x51')],_0xb028('0x52'),_0x30c115[_0xb028('0x4d')]))){throw new db[(_0xb028('0x53'))][(_0xb028('0x54'))](_0xb028('0x55'));}if(_0x37a70b[_0xb028('0x26')]['exists']){return _0x4dcb44['sendStatus'](0xc8);}return _0x4dcb44['download'](path[_0xb028('0x50')](config['root'],_0xb028('0x52'),_0x30c115[_0xb028('0x4d')]),util['format']('%s.%s',_0x30c115[_0xb028('0x4c')]||_0x30c115[_0xb028('0x21')],_0x30c115[_0xb028('0x4e')][_0xb028('0x56')]()));}})[_0xb028('0x3b')](handleError(_0x4dcb44,null));}; \ No newline at end of file +var _0x9b1e=['exists','sendStatus','format','%s.%s','output','toLowerCase','eml-format','rimraf','zip-dir','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','status','end','count','offset','limit','set','json','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','AnalyticExtractedReport','rawAttributes','keys','query','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','map','type','VIRTUAL','field','merge','includeAll','include','rows','catch','show','params','options','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ExtractedReports','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download','basename','existsSync','join','root','server/files/reports','savename','ValidationError','Report\x20not\x20found\x20or\x20empty'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0x9b1e,0x11a));var _0xe9b1=function(_0x1e0104,_0x50dd68){_0x1e0104=_0x1e0104-0x0;var _0xf9d5c0=_0x9b1e[_0x1e0104];return _0xf9d5c0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe9b1('0x0'));var rimraf=require(_0xe9b1('0x1'));var zipdir=require(_0xe9b1('0x2'));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(_0xe9b1('0x3'));var path=require(_0xe9b1('0x4'));var sox=require(_0xe9b1('0x5'));var csv=require(_0xe9b1('0x6'));var ejs=require(_0xe9b1('0x7'));var fs=require('fs');var _=require(_0xe9b1('0x8'));var squel=require('squel');var crypto=require(_0xe9b1('0x9'));var jsforce=require(_0xe9b1('0xa'));var deskjs=require(_0xe9b1('0xb'));var toCsv=require(_0xe9b1('0x6'));var querystring=require('querystring');var Papa=require(_0xe9b1('0xc'));var Redis=require(_0xe9b1('0xd'));var authService=require(_0xe9b1('0xe'));var qs=require(_0xe9b1('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe9b1('0x10'))('api');var utils=require(_0xe9b1('0x11'));var config=require(_0xe9b1('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d3cef,_0x327953){_0x327953=_0x327953||0xcc;return function(_0x4c2f7c){if(_0x4c2f7c){return _0x5d3cef['sendStatus'](_0x327953);}return _0x5d3cef[_0xe9b1('0x13')](_0x327953)[_0xe9b1('0x14')]();};}function respondWithResult(_0x825e1e,_0x5b5edd){_0x5b5edd=_0x5b5edd||0xc8;return function(_0x11590a){if(_0x11590a){return _0x825e1e[_0xe9b1('0x13')](_0x5b5edd)['json'](_0x11590a);}};}function respondWithFilteredResult(_0x5790e1,_0x458690){return function(_0x422012){if(_0x422012){var _0x572bfa=_0x422012[_0xe9b1('0x15')],_0x3cd5e3=_0x458690[_0xe9b1('0x16')],_0x5a42a4=_0x458690[_0xe9b1('0x16')]+_0x458690[_0xe9b1('0x17')],_0x37b265;if(_0x5a42a4>=_0x572bfa){_0x5a42a4=_0x572bfa;_0x37b265=0xc8;}else{_0x37b265=0xce;}_0x5790e1['status'](_0x37b265);return _0x5790e1[_0xe9b1('0x18')]('Content-Range',_0x3cd5e3+'-'+_0x5a42a4+'/'+_0x572bfa)[_0xe9b1('0x19')](_0x422012);}return null;};}function patchUpdates(_0x2c5451){return function(_0x28666d){try{jsonpatch[_0xe9b1('0x1a')](_0x28666d,_0x2c5451,!![]);}catch(_0x4f58f6){return BPromise[_0xe9b1('0x1b')](_0x4f58f6);}return _0x28666d[_0xe9b1('0x1c')]();};}function saveUpdates(_0x2857d1,_0x5ad5dc){return function(_0x422e50){if(_0x422e50){return _0x422e50[_0xe9b1('0x1d')](_0x2857d1)[_0xe9b1('0x1e')](function(_0x230cee){return _0x230cee;});}return null;};}function removeEntity(_0x2c3d06,_0x2eb300){return function(_0x22364d){if(_0x22364d){return _0x22364d['destroy']()[_0xe9b1('0x1e')](function(){var _0x4e24cc=_0x22364d[_0xe9b1('0x1f')]({'plain':!![]});var _0x58b7e8='ExtractedReports';return db[_0xe9b1('0x20')][_0xe9b1('0x21')]({'where':{'type':_0x58b7e8,'resourceId':_0x4e24cc['id']}})[_0xe9b1('0x1e')](function(){return _0x22364d;});})[_0xe9b1('0x1e')](function(){_0x2c3d06[_0xe9b1('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3dc831,_0x12b4cc){return function(_0x4b9960){if(!_0x4b9960){_0x3dc831['sendStatus'](0x194);}return _0x4b9960;};}function handleError(_0x47d6e2,_0x3c71e9){_0x3c71e9=_0x3c71e9||0x1f4;return function(_0x1f3a32){logger[_0xe9b1('0x22')](_0x1f3a32[_0xe9b1('0x23')]);if(_0x1f3a32[_0xe9b1('0x24')]){delete _0x1f3a32['name'];}_0x47d6e2[_0xe9b1('0x13')](_0x3c71e9)[_0xe9b1('0x25')](_0x1f3a32);};}exports['index']=function(_0x1c1a71,_0x384e61){var _0x4beaf0={},_0x43d7be={},_0x26ac59={'count':0x0,'rows':[]};var _0x340bca=db[_0xe9b1('0x26')][_0xe9b1('0x27')];_0x43d7be['model']=_[_0xe9b1('0x28')](_0x340bca);_0x43d7be[_0xe9b1('0x29')]=_[_0xe9b1('0x28')](_0x1c1a71[_0xe9b1('0x29')]);_0x43d7be[_0xe9b1('0x2a')]=_['intersection'](_0x43d7be[_0xe9b1('0x2b')],_0x43d7be[_0xe9b1('0x29')]);_0x4beaf0[_0xe9b1('0x2c')]=_[_0xe9b1('0x2d')](_0x43d7be[_0xe9b1('0x2b')],qs['fields'](_0x1c1a71[_0xe9b1('0x29')][_0xe9b1('0x2e')]));_0x4beaf0[_0xe9b1('0x2c')]=_0x4beaf0[_0xe9b1('0x2c')][_0xe9b1('0x2f')]?_0x4beaf0[_0xe9b1('0x2c')]:_0x43d7be[_0xe9b1('0x2b')];if(!_0x1c1a71[_0xe9b1('0x29')]['hasOwnProperty'](_0xe9b1('0x30'))){_0x4beaf0['limit']=qs[_0xe9b1('0x17')](_0x1c1a71[_0xe9b1('0x29')][_0xe9b1('0x17')]);_0x4beaf0[_0xe9b1('0x16')]=qs[_0xe9b1('0x16')](_0x1c1a71['query'][_0xe9b1('0x16')]);}_0x4beaf0[_0xe9b1('0x31')]=qs[_0xe9b1('0x32')](_0x1c1a71[_0xe9b1('0x29')][_0xe9b1('0x32')]);_0x4beaf0[_0xe9b1('0x33')]=qs[_0xe9b1('0x2a')](_[_0xe9b1('0x34')](_0x1c1a71[_0xe9b1('0x29')],_0x43d7be[_0xe9b1('0x2a')]));if(_0x1c1a71['query'][_0xe9b1('0x35')]){_0x4beaf0[_0xe9b1('0x33')]=_['merge'](_0x4beaf0[_0xe9b1('0x33')],{'$or':_[_0xe9b1('0x36')](_0x340bca,function(_0x1be72a){if(_0x1be72a[_0xe9b1('0x37')]['key']!==_0xe9b1('0x38')){var _0x27a4e4={};_0x27a4e4[_0x1be72a[_0xe9b1('0x39')]]={'$like':'%'+_0x1c1a71[_0xe9b1('0x29')][_0xe9b1('0x35')]+'%'};return _0x27a4e4;}})});}_0x4beaf0=_[_0xe9b1('0x3a')]({},_0x4beaf0,_0x1c1a71['options']);var _0x3e1dc8={'where':_0x4beaf0[_0xe9b1('0x33')]};return db[_0xe9b1('0x26')][_0xe9b1('0x15')](_0x3e1dc8)['then'](function(_0x130fe8){_0x26ac59[_0xe9b1('0x15')]=_0x130fe8;if(_0x1c1a71[_0xe9b1('0x29')][_0xe9b1('0x3b')]){_0x4beaf0[_0xe9b1('0x3c')]=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x4beaf0);})[_0xe9b1('0x1e')](function(_0x18a442){_0x26ac59[_0xe9b1('0x3d')]=_0x18a442;return _0x26ac59;})[_0xe9b1('0x1e')](respondWithFilteredResult(_0x384e61,_0x4beaf0))[_0xe9b1('0x3e')](handleError(_0x384e61,null));};exports[_0xe9b1('0x3f')]=function(_0x1dfa29,_0x45be18){var _0x37d25a={'raw':!![],'where':{'id':_0x1dfa29[_0xe9b1('0x40')]['id']}},_0x23bae9={};_0x23bae9[_0xe9b1('0x2b')]=_[_0xe9b1('0x28')](db[_0xe9b1('0x26')]['rawAttributes']);_0x23bae9[_0xe9b1('0x29')]=_[_0xe9b1('0x28')](_0x1dfa29[_0xe9b1('0x29')]);_0x23bae9[_0xe9b1('0x2a')]=_[_0xe9b1('0x2d')](_0x23bae9['model'],_0x23bae9[_0xe9b1('0x29')]);_0x37d25a['attributes']=_[_0xe9b1('0x2d')](_0x23bae9['model'],qs['fields'](_0x1dfa29['query'][_0xe9b1('0x2e')]));_0x37d25a[_0xe9b1('0x2c')]=_0x37d25a[_0xe9b1('0x2c')]['length']?_0x37d25a['attributes']:_0x23bae9[_0xe9b1('0x2b')];if(_0x1dfa29['query'][_0xe9b1('0x3b')]){_0x37d25a[_0xe9b1('0x3c')]=[{'all':!![]}];}_0x37d25a=_[_0xe9b1('0x3a')]({},_0x37d25a,_0x1dfa29[_0xe9b1('0x41')]);return db[_0xe9b1('0x26')][_0xe9b1('0x42')](_0x37d25a)[_0xe9b1('0x1e')](handleEntityNotFound(_0x45be18,null))['then'](respondWithResult(_0x45be18,null))[_0xe9b1('0x3e')](handleError(_0x45be18,null));};exports['create']=function(_0x3f121f,_0x22a68d){return db[_0xe9b1('0x26')]['create'](_0x3f121f['body'],{})[_0xe9b1('0x1e')](function(_0x13d9bc){var _0x50cfe9=_0x3f121f[_0xe9b1('0x43')]['get']({'plain':!![]});if(!_0x50cfe9)throw new Error(_0xe9b1('0x44'));if(_0x50cfe9[_0xe9b1('0x45')]==='user'){var _0x2791e2=_0x13d9bc[_0xe9b1('0x1f')]({'plain':!![]});var _0x4757eb=_0xe9b1('0x46');return db[_0xe9b1('0x47')]['find']({'where':{'name':_0x4757eb,'userProfileId':_0x50cfe9[_0xe9b1('0x48')]},'raw':!![]})['then'](function(_0x8e7c56){if(_0x8e7c56&&_0x8e7c56[_0xe9b1('0x49')]===0x0){return db[_0xe9b1('0x20')][_0xe9b1('0x4a')]({'name':_0x2791e2[_0xe9b1('0x24')],'resourceId':_0x2791e2['id'],'type':_0x8e7c56[_0xe9b1('0x24')],'sectionId':_0x8e7c56['id']},{})[_0xe9b1('0x1e')](function(){return _0x13d9bc;});}else{return _0x13d9bc;}})[_0xe9b1('0x3e')](function(_0x2080db){logger[_0xe9b1('0x22')](_0xe9b1('0x4b'),_0x2080db);throw _0x2080db;});}return _0x13d9bc;})['then'](respondWithResult(_0x22a68d,0xc9))[_0xe9b1('0x3e')](handleError(_0x22a68d,null));};exports[_0xe9b1('0x1d')]=function(_0xe9259c,_0x240715){if(_0xe9259c[_0xe9b1('0x4c')]['id']){delete _0xe9259c[_0xe9b1('0x4c')]['id'];}return db[_0xe9b1('0x26')][_0xe9b1('0x42')]({'where':{'id':_0xe9259c['params']['id']}})[_0xe9b1('0x1e')](handleEntityNotFound(_0x240715,null))[_0xe9b1('0x1e')](saveUpdates(_0xe9259c[_0xe9b1('0x4c')],null))[_0xe9b1('0x1e')](respondWithResult(_0x240715,null))[_0xe9b1('0x3e')](handleError(_0x240715,null));};exports[_0xe9b1('0x21')]=function(_0x164476,_0x26bd01){return db[_0xe9b1('0x26')][_0xe9b1('0x42')]({'where':{'id':_0x164476[_0xe9b1('0x40')]['id']}})[_0xe9b1('0x1e')](handleEntityNotFound(_0x26bd01,null))[_0xe9b1('0x1e')](removeEntity(_0x26bd01,null))[_0xe9b1('0x3e')](handleError(_0x26bd01,null));};exports[_0xe9b1('0x4d')]=function(_0x17ae41,_0x462b4d,_0x21e791){return db[_0xe9b1('0x26')][_0xe9b1('0x42')]({'where':{'id':_0x17ae41[_0xe9b1('0x40')]['id']},'attributes':[_0xe9b1('0x24'),_0xe9b1('0x4e'),'savename','output'],'raw':!![]})[_0xe9b1('0x1e')](handleEntityNotFound(_0x462b4d,null))[_0xe9b1('0x1e')](function(_0x171d14){if(_0x171d14){if(!fs[_0xe9b1('0x4f')](path[_0xe9b1('0x50')](config[_0xe9b1('0x51')],_0xe9b1('0x52'),_0x171d14[_0xe9b1('0x53')]))){throw new db['Sequelize'][(_0xe9b1('0x54'))](_0xe9b1('0x55'));}if(_0x17ae41[_0xe9b1('0x29')][_0xe9b1('0x56')]){return _0x462b4d[_0xe9b1('0x57')](0xc8);}return _0x462b4d[_0xe9b1('0x4d')](path[_0xe9b1('0x50')](config[_0xe9b1('0x51')],_0xe9b1('0x52'),_0x171d14[_0xe9b1('0x53')]),util[_0xe9b1('0x58')](_0xe9b1('0x59'),_0x171d14['basename']||_0x171d14[_0xe9b1('0x24')],_0x171d14[_0xe9b1('0x5a')][_0xe9b1('0x5b')]()));}})[_0xe9b1('0x3e')](handleError(_0x462b4d,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 2a855cb..f2c351b 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 _0xc949=['lodash','../../config/logger','api','moment','bluebird','path','rimraf','./analyticExtractedReport.attributes','exports','AnalyticExtractedReport','analytics_extracted_reports'];(function(_0x50b58f,_0x3a0374){var _0x57c5fd=function(_0x81344c){while(--_0x81344c){_0x50b58f['push'](_0x50b58f['shift']());}};_0x57c5fd(++_0x3a0374);}(_0xc949,0x181));var _0x9c94=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xc949[_0x1c546c];return _0x2cc384;};'use strict';var _=require(_0x9c94('0x0'));var util=require('util');var logger=require(_0x9c94('0x1'))(_0x9c94('0x2'));var moment=require(_0x9c94('0x3'));var BPromise=require(_0x9c94('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9c94('0x5'));var rimraf=require(_0x9c94('0x6'));var config=require('../../config/environment');var attributes=require(_0x9c94('0x7'));module[_0x9c94('0x8')]=function(_0x46d560,_0x1357ac){return _0x46d560['define'](_0x9c94('0x9'),attributes,{'tableName':_0x9c94('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0faf=['path','rimraf','../../config/environment','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2aaa60,_0x22258f){var _0x2e3fa5=function(_0x335589){while(--_0x335589){_0x2aaa60['push'](_0x2aaa60['shift']());}};_0x2e3fa5(++_0x22258f);}(_0x0faf,0x132));var _0xf0fa=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x0faf[_0x38ced4];return _0x547c07;};'use strict';var _=require(_0xf0fa('0x0'));var util=require('util');var logger=require(_0xf0fa('0x1'))(_0xf0fa('0x2'));var moment=require(_0xf0fa('0x3'));var BPromise=require(_0xf0fa('0x4'));var rp=require(_0xf0fa('0x5'));var fs=require('fs');var path=require(_0xf0fa('0x6'));var rimraf=require(_0xf0fa('0x7'));var config=require(_0xf0fa('0x8'));var attributes=require(_0xf0fa('0x9'));module['exports']=function(_0x3637a3,_0x44ffa0){return _0x3637a3[_0xf0fa('0xa')](_0xf0fa('0xb'),attributes,{'tableName':_0xf0fa('0xc'),'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 4a76976..9b1a5c9 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 _0x3437=['rpc','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x235448,_0x361274){var _0x187e6e=function(_0x5e3b52){while(--_0x5e3b52){_0x235448['push'](_0x235448['shift']());}};_0x187e6e(++_0x361274);}(_0x3437,0x1db));var _0x7343=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x3437[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x7343('0x0'));var util=require(_0x7343('0x1'));var moment=require(_0x7343('0x2'));var BPromise=require(_0x7343('0x3'));var rs=require(_0x7343('0x4'));var fs=require('fs');var Redis=require(_0x7343('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7343('0x6'));var logger=require(_0x7343('0x7'))(_0x7343('0x8'));var config=require('../../config/environment');var jayson=require(_0x7343('0x9'));var client=jayson[_0x7343('0xa')][_0x7343('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d3296,_0x243fd6,_0x2517cd){return new BPromise(function(_0x46277c,_0xf919a6){return client[_0x7343('0xc')](_0x5d3296,_0x2517cd)[_0x7343('0xd')](function(_0x3d6a04){logger[_0x7343('0xe')](_0x7343('0xf'),_0x243fd6,_0x7343('0x10'));logger['debug'](_0x7343('0x11'),_0x243fd6,'request\x20sent',JSON[_0x7343('0x12')](_0x3d6a04));if(_0x3d6a04['error']){if(_0x3d6a04['error'][_0x7343('0x13')]===0x1f4){logger[_0x7343('0x14')](_0x7343('0xf'),_0x243fd6,_0x3d6a04['error'][_0x7343('0x15')]);return _0xf919a6(_0x3d6a04[_0x7343('0x14')][_0x7343('0x15')]);}logger[_0x7343('0x14')](_0x7343('0xf'),_0x243fd6,_0x3d6a04[_0x7343('0x14')][_0x7343('0x15')]);return _0x46277c(_0x3d6a04[_0x7343('0x14')][_0x7343('0x15')]);}else{logger[_0x7343('0xe')](_0x7343('0xf'),_0x243fd6,'request\x20sent');_0x46277c(_0x3d6a04[_0x7343('0x16')][_0x7343('0x15')]);}})['catch'](function(_0x5c8e46){logger[_0x7343('0x14')](_0x7343('0xf'),_0x243fd6,_0x5c8e46);_0xf919a6(_0x5c8e46);});});} \ No newline at end of file +var _0xb421=['info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb421,0x1e5));var _0x1b42=function(_0x52ccd3,_0x483a67){_0x52ccd3=_0x52ccd3-0x0;var _0x33b818=_0xb421[_0x52ccd3];return _0x33b818;};'use strict';var _=require(_0x1b42('0x0'));var util=require(_0x1b42('0x1'));var moment=require('moment');var BPromise=require(_0x1b42('0x2'));var rs=require(_0x1b42('0x3'));var fs=require('fs');var Redis=require(_0x1b42('0x4'));var db=require(_0x1b42('0x5'))['db'];var utils=require(_0x1b42('0x6'));var logger=require(_0x1b42('0x7'))(_0x1b42('0x8'));var config=require(_0x1b42('0x9'));var jayson=require(_0x1b42('0xa'));var client=jayson[_0x1b42('0xb')][_0x1b42('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4614b8,_0x158d47,_0x167f2c){return new BPromise(function(_0x49ec41,_0x1c46c0){return client[_0x1b42('0xd')](_0x4614b8,_0x167f2c)[_0x1b42('0xe')](function(_0x39a33f){logger[_0x1b42('0xf')](_0x1b42('0x10'),_0x158d47,'request\x20sent');logger[_0x1b42('0x11')](_0x1b42('0x12'),_0x158d47,_0x1b42('0x13'),JSON[_0x1b42('0x14')](_0x39a33f));if(_0x39a33f[_0x1b42('0x15')]){if(_0x39a33f[_0x1b42('0x15')][_0x1b42('0x16')]===0x1f4){logger[_0x1b42('0x15')](_0x1b42('0x10'),_0x158d47,_0x39a33f[_0x1b42('0x15')]['message']);return _0x1c46c0(_0x39a33f[_0x1b42('0x15')]['message']);}logger[_0x1b42('0x15')](_0x1b42('0x10'),_0x158d47,_0x39a33f[_0x1b42('0x15')][_0x1b42('0x17')]);return _0x49ec41(_0x39a33f[_0x1b42('0x15')][_0x1b42('0x17')]);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x158d47,'request\x20sent');_0x49ec41(_0x39a33f['result'][_0x1b42('0x17')]);}})[_0x1b42('0x18')](function(_0xddc38a){logger[_0x1b42('0x15')](_0x1b42('0x10'),_0x158d47,_0xddc38a);_0x1c46c0(_0xddc38a);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 7713a94..61a2b48 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 _0x6b54=['download','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download'];(function(_0x4c51a6,_0x2b9e00){var _0x3ed67e=function(_0x5959df){while(--_0x5959df){_0x4c51a6['push'](_0x4c51a6['shift']());}};_0x3ed67e(++_0x2b9e00);}(_0x6b54,0x1d5));var _0x46b5=function(_0x27e83c,_0xe6fa23){_0x27e83c=_0x27e83c-0x0;var _0x20464c=_0x6b54[_0x27e83c];return _0x20464c;};'use strict';var multer=require(_0x46b5('0x0'));var util=require(_0x46b5('0x1'));var path=require(_0x46b5('0x2'));var timeout=require(_0x46b5('0x3'));var express=require(_0x46b5('0x4'));var router=express[_0x46b5('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x46b5('0x6'));var controller=require(_0x46b5('0x7'));router[_0x46b5('0x8')]('/',auth[_0x46b5('0x9')](),controller[_0x46b5('0xa')]);router['get'](_0x46b5('0xb'),auth['isAuthenticated'](),controller[_0x46b5('0xc')]);router[_0x46b5('0x8')](_0x46b5('0xd'),auth['isAuthenticated'](),controller[_0x46b5('0xe')]);router[_0x46b5('0xf')]('/',auth[_0x46b5('0x9')](),controller[_0x46b5('0x10')]);router[_0x46b5('0x11')](_0x46b5('0xb'),auth[_0x46b5('0x9')](),controller[_0x46b5('0x12')]);router[_0x46b5('0x13')](_0x46b5('0xb'),auth[_0x46b5('0x9')](),controller['destroy']);module[_0x46b5('0x14')]=router; \ No newline at end of file +var _0xe66b=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','create','put'];(function(_0x10a927,_0x58379b){var _0x59bb5e=function(_0x369892){while(--_0x369892){_0x10a927['push'](_0x10a927['shift']());}};_0x59bb5e(++_0x58379b);}(_0xe66b,0x90));var _0xbe66=function(_0xf9ddf3,_0x5a5662){_0xf9ddf3=_0xf9ddf3-0x0;var _0x4aebbc=_0xe66b[_0xf9ddf3];return _0x4aebbc;};'use strict';var multer=require(_0xbe66('0x0'));var util=require(_0xbe66('0x1'));var path=require(_0xbe66('0x2'));var timeout=require(_0xbe66('0x3'));var express=require(_0xbe66('0x4'));var router=express['Router']();var auth=require(_0xbe66('0x5'));var interaction=require(_0xbe66('0x6'));var config=require('../../config/environment');var controller=require(_0xbe66('0x7'));router[_0xbe66('0x8')]('/',auth[_0xbe66('0x9')](),controller[_0xbe66('0xa')]);router['get'](_0xbe66('0xb'),auth['isAuthenticated'](),controller[_0xbe66('0xc')]);router['get'](_0xbe66('0xd'),auth[_0xbe66('0x9')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0xbe66('0xe')]);router[_0xbe66('0xf')](_0xbe66('0xb'),auth['isAuthenticated'](),controller[_0xbe66('0x10')]);router[_0xbe66('0x11')]('/:id',auth[_0xbe66('0x9')](),controller[_0xbe66('0x12')]);module[_0xbe66('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 9e4f434..a43ba68 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 _0xcdca=['BOOLEAN','exports','TEXT','STRING'];(function(_0xca3038,_0x27ff20){var _0x58fb9d=function(_0x28deb4){while(--_0x28deb4){_0xca3038['push'](_0xca3038['shift']());}};_0x58fb9d(++_0x27ff20);}(_0xcdca,0x1c1));var _0xacdc=function(_0x5f412e,_0x33beea){_0x5f412e=_0x5f412e-0x0;var _0x4ed28f=_0xcdca[_0x5f412e];return _0x4ed28f;};'use strict';var Sequelize=require('sequelize');module[_0xacdc('0x0')]={'field':{'type':Sequelize[_0xacdc('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xacdc('0x2')]},'format':{'type':Sequelize[_0xacdc('0x2')]},'groupBy':{'type':Sequelize[_0xacdc('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x9bf1=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x4fa8b3,_0x59d119){var _0x2b4be1=function(_0x47b8cd){while(--_0x47b8cd){_0x4fa8b3['push'](_0x4fa8b3['shift']());}};_0x2b4be1(++_0x59d119);}(_0x9bf1,0x144));var _0x19bf=function(_0x26da89,_0x264785){_0x26da89=_0x26da89-0x0;var _0xc95b7b=_0x9bf1[_0x26da89];return _0xc95b7b;};'use strict';var Sequelize=require(_0x19bf('0x0'));module[_0x19bf('0x1')]={'field':{'type':Sequelize[_0x19bf('0x2')]},'alias':{'type':Sequelize[_0x19bf('0x3')]},'function':{'type':Sequelize[_0x19bf('0x3')]},'format':{'type':Sequelize[_0x19bf('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x19bf('0x3')]},'custom':{'type':Sequelize[_0x19bf('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 76f05db..3750e5d 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 _0xd47f=['save','update','then','destroy','sendStatus','error','name','send','index','AnalyticFieldReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','map','type','key','field','count','include','findAll','show','options','find','create','catch','bulkCreate','body','params','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','status','json','offset','limit','set','Content-Range','apply','reject'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0xd47f,0x1bd));var _0xfd47=function(_0x50da6f,_0xfeb8d1){_0x50da6f=_0x50da6f-0x0;var _0xaff1c5=_0xd47f[_0x50da6f];return _0xaff1c5;};'use strict';var pdf=require(_0xfd47('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xfd47('0x1'));var zipdir=require(_0xfd47('0x2'));var jsonpatch=require(_0xfd47('0x3'));var rp=require(_0xfd47('0x4'));var moment=require(_0xfd47('0x5'));var BPromise=require(_0xfd47('0x6'));var Mustache=require(_0xfd47('0x7'));var util=require(_0xfd47('0x8'));var path=require(_0xfd47('0x9'));var sox=require(_0xfd47('0xa'));var csv=require(_0xfd47('0xb'));var ejs=require(_0xfd47('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xfd47('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfd47('0xe'));var Papa=require(_0xfd47('0xf'));var Redis=require(_0xfd47('0x10'));var authService=require(_0xfd47('0x11'));var qs=require(_0xfd47('0x12'));var hardwareService=require(_0xfd47('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xfd47('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a0078,_0x4d3c12){_0x4d3c12=_0x4d3c12||0xcc;return function(_0x4b01ce){if(_0x4b01ce){return _0x3a0078['sendStatus'](_0x4d3c12);}return _0x3a0078[_0xfd47('0x15')](_0x4d3c12)['end']();};}function respondWithResult(_0x391aec,_0x44144b){_0x44144b=_0x44144b||0xc8;return function(_0x3ada2a){if(_0x3ada2a){return _0x391aec['status'](_0x44144b)[_0xfd47('0x16')](_0x3ada2a);}};}function respondWithFilteredResult(_0x13fc51,_0x6e24f5){return function(_0x24873a){if(_0x24873a){var _0x584fe1=_0x24873a['count'],_0x791937=_0x6e24f5['offset'],_0x1011a3=_0x6e24f5[_0xfd47('0x17')]+_0x6e24f5[_0xfd47('0x18')],_0x11300b;if(_0x1011a3>=_0x584fe1){_0x1011a3=_0x584fe1;_0x11300b=0xc8;}else{_0x11300b=0xce;}_0x13fc51[_0xfd47('0x15')](_0x11300b);return _0x13fc51[_0xfd47('0x19')](_0xfd47('0x1a'),_0x791937+'-'+_0x1011a3+'/'+_0x584fe1)['json'](_0x24873a);}return null;};}function patchUpdates(_0x2b3fa4){return function(_0x471472){try{jsonpatch[_0xfd47('0x1b')](_0x471472,_0x2b3fa4,!![]);}catch(_0x231106){return BPromise[_0xfd47('0x1c')](_0x231106);}return _0x471472[_0xfd47('0x1d')]();};}function saveUpdates(_0x5d3c0f,_0x1af7bf){return function(_0x59239c){if(_0x59239c){return _0x59239c[_0xfd47('0x1e')](_0x5d3c0f)[_0xfd47('0x1f')](function(_0x4153f6){return _0x4153f6;});}return null;};}function removeEntity(_0x9e3ccd,_0x4a0d0f){return function(_0x45e681){if(_0x45e681){return _0x45e681[_0xfd47('0x20')]()[_0xfd47('0x1f')](function(){_0x9e3ccd[_0xfd47('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x511dbd,_0x285f2a){return function(_0xc06999){if(!_0xc06999){_0x511dbd[_0xfd47('0x21')](0x194);}return _0xc06999;};}function handleError(_0x42105a,_0x1e3361){_0x1e3361=_0x1e3361||0x1f4;return function(_0x545eb9){logger[_0xfd47('0x22')](_0x545eb9['stack']);if(_0x545eb9[_0xfd47('0x23')]){delete _0x545eb9[_0xfd47('0x23')];}_0x42105a[_0xfd47('0x15')](_0x1e3361)[_0xfd47('0x24')](_0x545eb9);};}exports[_0xfd47('0x25')]=function(_0xcce2e3,_0x3aaecd){var _0x504ce5={},_0x392669={},_0x33072e={'count':0x0,'rows':[]};var _0x284964=db[_0xfd47('0x26')][_0xfd47('0x27')];_0x392669[_0xfd47('0x28')]=_[_0xfd47('0x29')](_0x284964);_0x392669[_0xfd47('0x2a')]=_[_0xfd47('0x29')](_0xcce2e3[_0xfd47('0x2a')]);_0x392669[_0xfd47('0x2b')]=_[_0xfd47('0x2c')](_0x392669['model'],_0x392669[_0xfd47('0x2a')]);_0x504ce5[_0xfd47('0x2d')]=_[_0xfd47('0x2c')](_0x392669['model'],qs[_0xfd47('0x2e')](_0xcce2e3['query'][_0xfd47('0x2e')]));_0x504ce5['attributes']=_0x504ce5[_0xfd47('0x2d')][_0xfd47('0x2f')]?_0x504ce5['attributes']:_0x392669[_0xfd47('0x28')];if(!_0xcce2e3[_0xfd47('0x2a')][_0xfd47('0x30')](_0xfd47('0x31'))){_0x504ce5[_0xfd47('0x18')]=qs[_0xfd47('0x18')](_0xcce2e3[_0xfd47('0x2a')]['limit']);_0x504ce5[_0xfd47('0x17')]=qs[_0xfd47('0x17')](_0xcce2e3['query'][_0xfd47('0x17')]);}_0x504ce5[_0xfd47('0x32')]=qs[_0xfd47('0x33')](_0xcce2e3['query'][_0xfd47('0x33')]);_0x504ce5['where']=qs[_0xfd47('0x2b')](_[_0xfd47('0x34')](_0xcce2e3['query'],_0x392669[_0xfd47('0x2b')]));if(_0xcce2e3[_0xfd47('0x2a')][_0xfd47('0x35')]){_0x504ce5['where']=_[_0xfd47('0x36')](_0x504ce5[_0xfd47('0x37')],{'$or':_[_0xfd47('0x38')](_0x284964,function(_0x55ac41){if(_0x55ac41[_0xfd47('0x39')][_0xfd47('0x3a')]!=='VIRTUAL'){var _0x1271a9={};_0x1271a9[_0x55ac41[_0xfd47('0x3b')]]={'$like':'%'+_0xcce2e3['query']['filter']+'%'};return _0x1271a9;}})});}_0x504ce5=_[_0xfd47('0x36')]({},_0x504ce5,_0xcce2e3['options']);var _0x217a1e={'where':_0x504ce5['where']};return db[_0xfd47('0x26')][_0xfd47('0x3c')](_0x217a1e)['then'](function(_0x9c42a9){_0x33072e['count']=_0x9c42a9;if(_0xcce2e3[_0xfd47('0x2a')]['includeAll']){_0x504ce5[_0xfd47('0x3d')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xfd47('0x3e')](_0x504ce5);})[_0xfd47('0x1f')](function(_0x2c70a8){_0x33072e['rows']=_0x2c70a8;return _0x33072e;})['then'](respondWithFilteredResult(_0x3aaecd,_0x504ce5))['catch'](handleError(_0x3aaecd,null));};exports[_0xfd47('0x3f')]=function(_0x420ce0,_0x3b5072){var _0x2abfd1={'raw':![],'where':{'id':_0x420ce0['params']['id']}},_0x218eda={};_0x218eda[_0xfd47('0x28')]=_[_0xfd47('0x29')](db[_0xfd47('0x26')][_0xfd47('0x27')]);_0x218eda[_0xfd47('0x2a')]=_[_0xfd47('0x29')](_0x420ce0[_0xfd47('0x2a')]);_0x218eda[_0xfd47('0x2b')]=_[_0xfd47('0x2c')](_0x218eda[_0xfd47('0x28')],_0x218eda[_0xfd47('0x2a')]);_0x2abfd1[_0xfd47('0x2d')]=_['intersection'](_0x218eda[_0xfd47('0x28')],qs[_0xfd47('0x2e')](_0x420ce0[_0xfd47('0x2a')][_0xfd47('0x2e')]));_0x2abfd1[_0xfd47('0x2d')]=_0x2abfd1[_0xfd47('0x2d')]['length']?_0x2abfd1[_0xfd47('0x2d')]:_0x218eda[_0xfd47('0x28')];if(_0x420ce0[_0xfd47('0x2a')]['includeAll']){_0x2abfd1[_0xfd47('0x3d')]=[{'all':!![]}];}_0x2abfd1=_[_0xfd47('0x36')]({},_0x2abfd1,_0x420ce0[_0xfd47('0x40')]);return db[_0xfd47('0x26')][_0xfd47('0x41')](_0x2abfd1)[_0xfd47('0x1f')](handleEntityNotFound(_0x3b5072,null))[_0xfd47('0x1f')](respondWithResult(_0x3b5072,null))['catch'](handleError(_0x3b5072,null));};exports[_0xfd47('0x42')]=function(_0x209200,_0x14b5df){return db['AnalyticFieldReport'][_0xfd47('0x42')](_0x209200['body'],{})[_0xfd47('0x1f')](respondWithResult(_0x14b5df,0xc9))[_0xfd47('0x43')](handleError(_0x14b5df,null));};exports['bulkCreate']=function(_0x2db46b,_0x3c407c){return db[_0xfd47('0x26')][_0xfd47('0x44')](_0x2db46b['body'],{'raw':![],'individualHooks':!![]})[_0xfd47('0x1f')](respondWithResult(_0x3c407c,0xc9))['catch'](handleError(_0x3c407c,null));};exports['update']=function(_0x9d46a6,_0x2e30da){if(_0x9d46a6['body']['id']){delete _0x9d46a6[_0xfd47('0x45')]['id'];}return db[_0xfd47('0x26')]['find']({'where':{'id':_0x9d46a6[_0xfd47('0x46')]['id']}})[_0xfd47('0x1f')](handleEntityNotFound(_0x2e30da,null))[_0xfd47('0x1f')](saveUpdates(_0x9d46a6[_0xfd47('0x45')],null))[_0xfd47('0x1f')](respondWithResult(_0x2e30da,null))['catch'](handleError(_0x2e30da,null));};exports[_0xfd47('0x20')]=function(_0x55da8c,_0x1fb7d8){return db['AnalyticFieldReport']['find']({'where':{'id':_0x55da8c[_0xfd47('0x46')]['id']}})[_0xfd47('0x1f')](handleEntityNotFound(_0x1fb7d8,null))['then'](removeEntity(_0x1fb7d8,null))[_0xfd47('0x43')](handleError(_0x1fb7d8,null));};exports[_0xfd47('0x47')]=function(_0x2cce80,_0x420bec){return db['AnalyticFieldReport'][_0xfd47('0x20')]({'where':{'id':_0x2cce80[_0xfd47('0x2a')][_0xfd47('0x48')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x420bec,0xcc))[_0xfd47('0x43')](handleError(_0x420bec,null));};exports[_0xfd47('0x49')]=function(_0x596b99,_0x16c6a5,_0x563883){return db[_0xfd47('0x4a')][_0xfd47('0x4b')]({'where':{'id':_0x596b99[_0xfd47('0x46')]['id']}})['then'](handleEntityNotFound(_0x16c6a5,null))[_0xfd47('0x1f')](function(_0x128ff8){if(_0x128ff8){return db[_0xfd47('0x4c')][_0xfd47('0x4d')](function(_0x3ed00e){return db[_0xfd47('0x26')]['destroy']({'where':{'CustomReportId':_0x596b99[_0xfd47('0x46')]['id']},'transaction':_0x3ed00e})[_0xfd47('0x1f')](function(_0x1139b0){var _0x49e995=_['map'](_0x596b99[_0xfd47('0x45')],function(_0x11a339){delete _0x11a339['id'];_0x11a339[_0xfd47('0x4e')]=_0x596b99[_0xfd47('0x46')]['id'];return _0x11a339;});return db[_0xfd47('0x26')][_0xfd47('0x44')](_0x49e995,{'transaction':_0x3ed00e});});})[_0xfd47('0x1f')](function(){return db[_0xfd47('0x26')][_0xfd47('0x3e')]({'where':{'CustomReportId':_0x596b99[_0xfd47('0x46')]['id']}});});}})[_0xfd47('0x1f')](respondWithResult(_0x16c6a5,null))[_0xfd47('0x43')](handleError(_0x16c6a5,null));}; \ No newline at end of file +var _0x677a=['lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','set','apply','save','update','then','destroy','error','stack','name','send','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','where','pick','filter','map','type','field','options','includeAll','include','findAll','rows','catch','show','params','AnalyticFieldReport','find','create','body','bulkCreate','bulkDestroy','addFields','AnalyticCustomReport','findOne','sequelize','transaction','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv'];(function(_0x4e884d,_0x1309e1){var _0x40d395=function(_0x4a9801){while(--_0x4a9801){_0x4e884d['push'](_0x4e884d['shift']());}};_0x40d395(++_0x1309e1);}(_0x677a,0xd6));var _0xa677=function(_0x476510,_0x2dcb66){_0x476510=_0x476510-0x0;var _0x70d8f6=_0x677a[_0x476510];return _0x70d8f6;};'use strict';var pdf=require(_0xa677('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa677('0x1'));var zipdir=require(_0xa677('0x2'));var jsonpatch=require(_0xa677('0x3'));var rp=require(_0xa677('0x4'));var moment=require(_0xa677('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa677('0x6'));var util=require(_0xa677('0x7'));var path=require(_0xa677('0x8'));var sox=require(_0xa677('0x9'));var csv=require(_0xa677('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa677('0xb'));var squel=require(_0xa677('0xc'));var crypto=require(_0xa677('0xd'));var jsforce=require(_0xa677('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa677('0xf'));var Redis=require('ioredis');var authService=require(_0xa677('0x10'));var qs=require(_0xa677('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa677('0x12'))(_0xa677('0x13'));var utils=require(_0xa677('0x14'));var config=require(_0xa677('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1bbc6e,_0x3540ee){_0x3540ee=_0x3540ee||0xcc;return function(_0xb1d2b6){if(_0xb1d2b6){return _0x1bbc6e[_0xa677('0x16')](_0x3540ee);}return _0x1bbc6e['status'](_0x3540ee)[_0xa677('0x17')]();};}function respondWithResult(_0x5de5c8,_0x1faba2){_0x1faba2=_0x1faba2||0xc8;return function(_0x2e5b2a){if(_0x2e5b2a){return _0x5de5c8[_0xa677('0x18')](_0x1faba2)[_0xa677('0x19')](_0x2e5b2a);}};}function respondWithFilteredResult(_0xca5d15,_0x36634f){return function(_0x268fa5){if(_0x268fa5){var _0x4ffe4c=_0x268fa5[_0xa677('0x1a')],_0x1feb0e=_0x36634f[_0xa677('0x1b')],_0x230363=_0x36634f[_0xa677('0x1b')]+_0x36634f['limit'],_0x25c63b;if(_0x230363>=_0x4ffe4c){_0x230363=_0x4ffe4c;_0x25c63b=0xc8;}else{_0x25c63b=0xce;}_0xca5d15[_0xa677('0x18')](_0x25c63b);return _0xca5d15[_0xa677('0x1c')]('Content-Range',_0x1feb0e+'-'+_0x230363+'/'+_0x4ffe4c)['json'](_0x268fa5);}return null;};}function patchUpdates(_0xbc3f5b){return function(_0x73350){try{jsonpatch[_0xa677('0x1d')](_0x73350,_0xbc3f5b,!![]);}catch(_0x30fbfd){return BPromise['reject'](_0x30fbfd);}return _0x73350[_0xa677('0x1e')]();};}function saveUpdates(_0x2122ac,_0xad957e){return function(_0x44de05){if(_0x44de05){return _0x44de05[_0xa677('0x1f')](_0x2122ac)[_0xa677('0x20')](function(_0x5cbea0){return _0x5cbea0;});}return null;};}function removeEntity(_0x2e8113,_0x4dcab4){return function(_0x470e0a){if(_0x470e0a){return _0x470e0a[_0xa677('0x21')]()[_0xa677('0x20')](function(){_0x2e8113['status'](0xcc)[_0xa677('0x17')]();});}};}function handleEntityNotFound(_0x31acd3,_0x395d33){return function(_0x1c59e4){if(!_0x1c59e4){_0x31acd3['sendStatus'](0x194);}return _0x1c59e4;};}function handleError(_0x1aa82b,_0x17f483){_0x17f483=_0x17f483||0x1f4;return function(_0x595c10){logger[_0xa677('0x22')](_0x595c10[_0xa677('0x23')]);if(_0x595c10[_0xa677('0x24')]){delete _0x595c10[_0xa677('0x24')];}_0x1aa82b[_0xa677('0x18')](_0x17f483)[_0xa677('0x25')](_0x595c10);};}exports['index']=function(_0x34dee4,_0x12756d){var _0x1a7e27={},_0x6189c={},_0x428987={'count':0x0,'rows':[]};var _0x377660=db['AnalyticFieldReport'][_0xa677('0x26')];_0x6189c[_0xa677('0x27')]=_[_0xa677('0x28')](_0x377660);_0x6189c['query']=_[_0xa677('0x28')](_0x34dee4[_0xa677('0x29')]);_0x6189c[_0xa677('0x2a')]=_[_0xa677('0x2b')](_0x6189c['model'],_0x6189c[_0xa677('0x29')]);_0x1a7e27[_0xa677('0x2c')]=_[_0xa677('0x2b')](_0x6189c['model'],qs[_0xa677('0x2d')](_0x34dee4[_0xa677('0x29')][_0xa677('0x2d')]));_0x1a7e27[_0xa677('0x2c')]=_0x1a7e27[_0xa677('0x2c')][_0xa677('0x2e')]?_0x1a7e27[_0xa677('0x2c')]:_0x6189c[_0xa677('0x27')];if(!_0x34dee4['query'][_0xa677('0x2f')]('nolimit')){_0x1a7e27[_0xa677('0x30')]=qs[_0xa677('0x30')](_0x34dee4[_0xa677('0x29')][_0xa677('0x30')]);_0x1a7e27[_0xa677('0x1b')]=qs[_0xa677('0x1b')](_0x34dee4[_0xa677('0x29')][_0xa677('0x1b')]);}_0x1a7e27[_0xa677('0x31')]=qs['sort'](_0x34dee4[_0xa677('0x29')]['sort']);_0x1a7e27[_0xa677('0x32')]=qs[_0xa677('0x2a')](_[_0xa677('0x33')](_0x34dee4[_0xa677('0x29')],_0x6189c['filters']));if(_0x34dee4[_0xa677('0x29')][_0xa677('0x34')]){_0x1a7e27[_0xa677('0x32')]=_['merge'](_0x1a7e27['where'],{'$or':_[_0xa677('0x35')](_0x377660,function(_0x9a0837){if(_0x9a0837[_0xa677('0x36')]['key']!=='VIRTUAL'){var _0xbc5bd2={};_0xbc5bd2[_0x9a0837[_0xa677('0x37')]]={'$like':'%'+_0x34dee4[_0xa677('0x29')][_0xa677('0x34')]+'%'};return _0xbc5bd2;}})});}_0x1a7e27=_['merge']({},_0x1a7e27,_0x34dee4[_0xa677('0x38')]);var _0x1b15bb={'where':_0x1a7e27['where']};return db['AnalyticFieldReport'][_0xa677('0x1a')](_0x1b15bb)[_0xa677('0x20')](function(_0x5b540f){_0x428987[_0xa677('0x1a')]=_0x5b540f;if(_0x34dee4['query'][_0xa677('0x39')]){_0x1a7e27[_0xa677('0x3a')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xa677('0x3b')](_0x1a7e27);})[_0xa677('0x20')](function(_0x23ae91){_0x428987[_0xa677('0x3c')]=_0x23ae91;return _0x428987;})[_0xa677('0x20')](respondWithFilteredResult(_0x12756d,_0x1a7e27))[_0xa677('0x3d')](handleError(_0x12756d,null));};exports[_0xa677('0x3e')]=function(_0x240c7b,_0x43a477){var _0x5326d1={'raw':![],'where':{'id':_0x240c7b[_0xa677('0x3f')]['id']}},_0x21fd10={};_0x21fd10[_0xa677('0x27')]=_[_0xa677('0x28')](db['AnalyticFieldReport']['rawAttributes']);_0x21fd10['query']=_[_0xa677('0x28')](_0x240c7b[_0xa677('0x29')]);_0x21fd10['filters']=_[_0xa677('0x2b')](_0x21fd10[_0xa677('0x27')],_0x21fd10[_0xa677('0x29')]);_0x5326d1['attributes']=_[_0xa677('0x2b')](_0x21fd10[_0xa677('0x27')],qs[_0xa677('0x2d')](_0x240c7b[_0xa677('0x29')][_0xa677('0x2d')]));_0x5326d1[_0xa677('0x2c')]=_0x5326d1[_0xa677('0x2c')][_0xa677('0x2e')]?_0x5326d1[_0xa677('0x2c')]:_0x21fd10[_0xa677('0x27')];if(_0x240c7b[_0xa677('0x29')][_0xa677('0x39')]){_0x5326d1[_0xa677('0x3a')]=[{'all':!![]}];}_0x5326d1=_['merge']({},_0x5326d1,_0x240c7b['options']);return db[_0xa677('0x40')][_0xa677('0x41')](_0x5326d1)[_0xa677('0x20')](handleEntityNotFound(_0x43a477,null))[_0xa677('0x20')](respondWithResult(_0x43a477,null))[_0xa677('0x3d')](handleError(_0x43a477,null));};exports[_0xa677('0x42')]=function(_0x130294,_0x509298){return db[_0xa677('0x40')]['create'](_0x130294[_0xa677('0x43')],{})[_0xa677('0x20')](respondWithResult(_0x509298,0xc9))[_0xa677('0x3d')](handleError(_0x509298,null));};exports[_0xa677('0x44')]=function(_0x28cee0,_0x23790e){return db[_0xa677('0x40')][_0xa677('0x44')](_0x28cee0[_0xa677('0x43')],{'raw':![],'individualHooks':!![]})[_0xa677('0x20')](respondWithResult(_0x23790e,0xc9))['catch'](handleError(_0x23790e,null));};exports['update']=function(_0x33a4e7,_0x3fb32c){if(_0x33a4e7[_0xa677('0x43')]['id']){delete _0x33a4e7[_0xa677('0x43')]['id'];}return db[_0xa677('0x40')][_0xa677('0x41')]({'where':{'id':_0x33a4e7['params']['id']}})[_0xa677('0x20')](handleEntityNotFound(_0x3fb32c,null))['then'](saveUpdates(_0x33a4e7[_0xa677('0x43')],null))[_0xa677('0x20')](respondWithResult(_0x3fb32c,null))['catch'](handleError(_0x3fb32c,null));};exports['destroy']=function(_0x4394d8,_0x41c7b1){return db['AnalyticFieldReport'][_0xa677('0x41')]({'where':{'id':_0x4394d8[_0xa677('0x3f')]['id']}})[_0xa677('0x20')](handleEntityNotFound(_0x41c7b1,null))[_0xa677('0x20')](removeEntity(_0x41c7b1,null))[_0xa677('0x3d')](handleError(_0x41c7b1,null));};exports[_0xa677('0x45')]=function(_0x2005e4,_0x1d669f){return db[_0xa677('0x40')][_0xa677('0x21')]({'where':{'id':_0x2005e4[_0xa677('0x29')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0xa677('0x20')](respondWithResult(_0x1d669f,0xcc))[_0xa677('0x3d')](handleError(_0x1d669f,null));};exports[_0xa677('0x46')]=function(_0x2164d8,_0xd56d64,_0x254e08){return db[_0xa677('0x47')][_0xa677('0x48')]({'where':{'id':_0x2164d8[_0xa677('0x3f')]['id']}})[_0xa677('0x20')](handleEntityNotFound(_0xd56d64,null))[_0xa677('0x20')](function(_0x34bf08){if(_0x34bf08){return db[_0xa677('0x49')][_0xa677('0x4a')](function(_0x4adab3){return db[_0xa677('0x40')][_0xa677('0x21')]({'where':{'CustomReportId':_0x2164d8[_0xa677('0x3f')]['id']},'transaction':_0x4adab3})[_0xa677('0x20')](function(_0x516a6e){var _0x36b2fd=_['map'](_0x2164d8['body'],function(_0x4117d0){delete _0x4117d0['id'];_0x4117d0['CustomReportId']=_0x2164d8[_0xa677('0x3f')]['id'];return _0x4117d0;});return db[_0xa677('0x40')]['bulkCreate'](_0x36b2fd,{'transaction':_0x4adab3});});})[_0xa677('0x20')](function(){return db[_0xa677('0x40')][_0xa677('0x3b')]({'where':{'CustomReportId':_0x2164d8['params']['id']}});});}})['then'](respondWithResult(_0xd56d64,null))[_0xa677('0x3d')](handleError(_0xd56d64,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 08dc053..1fef07a 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 _0xc181=['request-promise','path','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','api','moment','bluebird'];(function(_0x2672e4,_0x42595c){var _0x5ac540=function(_0x2b4180){while(--_0x2b4180){_0x2672e4['push'](_0x2672e4['shift']());}};_0x5ac540(++_0x42595c);}(_0xc181,0x126));var _0x1c18=function(_0x3b9d5f,_0x2e9039){_0x3b9d5f=_0x3b9d5f-0x0;var _0x39924e=_0xc181[_0x3b9d5f];return _0x39924e;};'use strict';var _=require(_0x1c18('0x0'));var util=require(_0x1c18('0x1'));var logger=require('../../config/logger')(_0x1c18('0x2'));var moment=require(_0x1c18('0x3'));var BPromise=require(_0x1c18('0x4'));var rp=require(_0x1c18('0x5'));var fs=require('fs');var path=require(_0x1c18('0x6'));var rimraf=require('rimraf');var config=require(_0x1c18('0x7'));var attributes=require(_0x1c18('0x8'));module[_0x1c18('0x9')]=function(_0x1af123,_0x2f3f3a){return _0x1af123[_0x1c18('0xa')](_0x1c18('0xb'),attributes,{'tableName':_0x1c18('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6d1a=['./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4dcfb4,_0x1c7e2b){var _0x548f07=function(_0xa11cfc){while(--_0xa11cfc){_0x4dcfb4['push'](_0x4dcfb4['shift']());}};_0x548f07(++_0x1c7e2b);}(_0x6d1a,0x1c0));var _0xa6d1=function(_0x115730,_0x1ca3b4){_0x115730=_0x115730-0x0;var _0x1ef276=_0x6d1a[_0x115730];return _0x1ef276;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa6d1('0x0'))(_0xa6d1('0x1'));var moment=require(_0xa6d1('0x2'));var BPromise=require(_0xa6d1('0x3'));var rp=require(_0xa6d1('0x4'));var fs=require('fs');var path=require(_0xa6d1('0x5'));var rimraf=require(_0xa6d1('0x6'));var config=require(_0xa6d1('0x7'));var attributes=require(_0xa6d1('0x8'));module[_0xa6d1('0x9')]=function(_0x5d6d9e,_0x5c5f20){return _0x5d6d9e['define'](_0xa6d1('0xa'),attributes,{'tableName':_0xa6d1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index ef41606..da56926 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 _0x5d58=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x55f6cd,_0x3aec70){var _0x3c3c19=function(_0x382faf){while(--_0x382faf){_0x55f6cd['push'](_0x55f6cd['shift']());}};_0x3c3c19(++_0x3aec70);}(_0x5d58,0x187));var _0x85d5=function(_0xb92571,_0x3e7870){_0xb92571=_0xb92571-0x0;var _0xbe49b2=_0x5d58[_0xb92571];return _0xbe49b2;};'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(_0x85d5('0x0'));var db=require(_0x85d5('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x85d5('0x2'))(_0x85d5('0x3'));var config=require('../../config/environment');var jayson=require(_0x85d5('0x4'));var client=jayson[_0x85d5('0x5')][_0x85d5('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x46e7b4,_0x5f47ec,_0x98c963){return new BPromise(function(_0x3fecca,_0x4ca293){return client[_0x85d5('0x7')](_0x46e7b4,_0x98c963)['then'](function(_0x1098be){logger[_0x85d5('0x8')](_0x85d5('0x9'),_0x5f47ec,'request\x20sent');logger['debug']('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x5f47ec,_0x85d5('0xa'),JSON[_0x85d5('0xb')](_0x1098be));if(_0x1098be[_0x85d5('0xc')]){if(_0x1098be[_0x85d5('0xc')][_0x85d5('0xd')]===0x1f4){logger[_0x85d5('0xc')](_0x85d5('0x9'),_0x5f47ec,_0x1098be['error']['message']);return _0x4ca293(_0x1098be['error'][_0x85d5('0xe')]);}logger[_0x85d5('0xc')](_0x85d5('0x9'),_0x5f47ec,_0x1098be[_0x85d5('0xc')][_0x85d5('0xe')]);return _0x3fecca(_0x1098be[_0x85d5('0xc')][_0x85d5('0xe')]);}else{logger['info'](_0x85d5('0x9'),_0x5f47ec,_0x85d5('0xa'));_0x3fecca(_0x1098be[_0x85d5('0xf')][_0x85d5('0xe')]);}})[_0x85d5('0x10')](function(_0x3dc83c){logger[_0x85d5('0xc')](_0x85d5('0x9'),_0x5f47ec,_0x3dc83c);_0x4ca293(_0x3dc83c);});});} \ No newline at end of file +var _0x52ad=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment'];(function(_0x54d96e,_0x51531a){var _0xc2494=function(_0x2e8be1){while(--_0x2e8be1){_0x54d96e['push'](_0x54d96e['shift']());}};_0xc2494(++_0x51531a);}(_0x52ad,0x1d8));var _0xd52a=function(_0x36af54,_0x246d71){_0x36af54=_0x36af54-0x0;var _0x21ca2e=_0x52ad[_0x36af54];return _0x21ca2e;};'use strict';var _=require(_0xd52a('0x0'));var util=require(_0xd52a('0x1'));var moment=require(_0xd52a('0x2'));var BPromise=require(_0xd52a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd52a('0x4'));var db=require(_0xd52a('0x5'))['db'];var utils=require(_0xd52a('0x6'));var logger=require(_0xd52a('0x7'))(_0xd52a('0x8'));var config=require(_0xd52a('0x9'));var jayson=require(_0xd52a('0xa'));var client=jayson[_0xd52a('0xb')][_0xd52a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5e80f5,_0x123bb1,_0x16a73d){return new BPromise(function(_0x20b817,_0x3df9d4){return client['request'](_0x5e80f5,_0x16a73d)[_0xd52a('0xd')](function(_0x671681){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x123bb1,_0xd52a('0xe'));logger[_0xd52a('0xf')](_0xd52a('0x10'),_0x123bb1,_0xd52a('0xe'),JSON[_0xd52a('0x11')](_0x671681));if(_0x671681[_0xd52a('0x12')]){if(_0x671681['error'][_0xd52a('0x13')]===0x1f4){logger[_0xd52a('0x12')](_0xd52a('0x14'),_0x123bb1,_0x671681[_0xd52a('0x12')][_0xd52a('0x15')]);return _0x3df9d4(_0x671681[_0xd52a('0x12')][_0xd52a('0x15')]);}logger[_0xd52a('0x12')](_0xd52a('0x14'),_0x123bb1,_0x671681[_0xd52a('0x12')][_0xd52a('0x15')]);return _0x20b817(_0x671681[_0xd52a('0x12')][_0xd52a('0x15')]);}else{logger[_0xd52a('0x16')](_0xd52a('0x14'),_0x123bb1,_0xd52a('0xe'));_0x20b817(_0x671681[_0xd52a('0x17')][_0xd52a('0x15')]);}})[_0xd52a('0x18')](function(_0x1aa59f){logger[_0xd52a('0x12')](_0xd52a('0x14'),_0x123bb1,_0x1aa59f);_0x3df9d4(_0x1aa59f);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index e905f58..39b67ef 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 _0x9aea=['exports','multer','path','express','Router','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','isAuthenticated','/:id','post','create','/create_many','bulkCreate','/:id/create_many','addFields','update','delete','/destroy_many','bulkDestroy','destroy'];(function(_0x40ae18,_0x271674){var _0x3a6f2c=function(_0x1df590){while(--_0x1df590){_0x40ae18['push'](_0x40ae18['shift']());}};_0x3a6f2c(++_0x271674);}(_0x9aea,0xdd));var _0xa9ae=function(_0x114af1,_0x949220){_0x114af1=_0x114af1-0x0;var _0x5977e6=_0x9aea[_0x114af1];return _0x5977e6;};'use strict';var multer=require(_0xa9ae('0x0'));var util=require('util');var path=require(_0xa9ae('0x1'));var timeout=require('connect-timeout');var express=require(_0xa9ae('0x2'));var router=express[_0xa9ae('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xa9ae('0x4'));var config=require(_0xa9ae('0x5'));var controller=require(_0xa9ae('0x6'));router[_0xa9ae('0x7')]('/',auth[_0xa9ae('0x8')](),controller['index']);router[_0xa9ae('0x7')](_0xa9ae('0x9'),auth[_0xa9ae('0x8')](),controller['show']);router[_0xa9ae('0xa')]('/',auth[_0xa9ae('0x8')](),controller[_0xa9ae('0xb')]);router[_0xa9ae('0xa')](_0xa9ae('0xc'),auth[_0xa9ae('0x8')](),controller[_0xa9ae('0xd')]);router[_0xa9ae('0xa')](_0xa9ae('0xe'),auth['isAuthenticated'](),controller[_0xa9ae('0xf')]);router['put'](_0xa9ae('0x9'),auth[_0xa9ae('0x8')](),controller[_0xa9ae('0x10')]);router[_0xa9ae('0x11')](_0xa9ae('0x12'),auth[_0xa9ae('0x8')](),controller[_0xa9ae('0x13')]);router[_0xa9ae('0x11')]('/:id',auth[_0xa9ae('0x8')](),controller[_0xa9ae('0x14')]);module[_0xa9ae('0x15')]=router; \ No newline at end of file +var _0xb49a=['post','/create_many','/:id/create_many','addFields','put','update','delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','create'];(function(_0x544099,_0x372b30){var _0x20ab09=function(_0x149613){while(--_0x149613){_0x544099['push'](_0x544099['shift']());}};_0x20ab09(++_0x372b30);}(_0xb49a,0xfb));var _0xab49=function(_0x50f157,_0x280833){_0x50f157=_0x50f157-0x0;var _0x7e0178=_0xb49a[_0x50f157];return _0x7e0178;};'use strict';var multer=require(_0xab49('0x0'));var util=require(_0xab49('0x1'));var path=require(_0xab49('0x2'));var timeout=require(_0xab49('0x3'));var express=require(_0xab49('0x4'));var router=express['Router']();var auth=require(_0xab49('0x5'));var interaction=require(_0xab49('0x6'));var config=require('../../config/environment');var controller=require('./analyticFieldReport.controller');router[_0xab49('0x7')]('/',auth[_0xab49('0x8')](),controller[_0xab49('0x9')]);router[_0xab49('0x7')](_0xab49('0xa'),auth[_0xab49('0x8')](),controller[_0xab49('0xb')]);router['post']('/',auth[_0xab49('0x8')](),controller[_0xab49('0xc')]);router[_0xab49('0xd')](_0xab49('0xe'),auth[_0xab49('0x8')](),controller['bulkCreate']);router['post'](_0xab49('0xf'),auth[_0xab49('0x8')](),controller[_0xab49('0x10')]);router[_0xab49('0x11')](_0xab49('0xa'),auth['isAuthenticated'](),controller[_0xab49('0x12')]);router[_0xab49('0x13')](_0xab49('0x14'),auth[_0xab49('0x8')](),controller[_0xab49('0x15')]);router[_0xab49('0x13')](_0xab49('0xa'),auth[_0xab49('0x8')](),controller[_0xab49('0x16')]);module[_0xab49('0x17')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index a56624c..4b10391 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 _0x6317=['TEXT','sequelize','STRING','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6317,0xe1));var _0x7631=function(_0x2e78af,_0x3d5796){_0x2e78af=_0x2e78af-0x0;var _0x192ab6=_0x6317[_0x2e78af];return _0x192ab6;};'use strict';var Sequelize=require(_0x7631('0x0'));module['exports']={'name':{'type':Sequelize[_0x7631('0x1')],'allowNull':![],'unique':_0x7631('0x2')},'table':{'type':Sequelize[_0x7631('0x1')]},'metric':{'type':Sequelize[_0x7631('0x3')]},'description':{'type':Sequelize[_0x7631('0x1')]}}; \ No newline at end of file +var _0x9f5a=['exports','STRING','name'];(function(_0x5749b0,_0x88ef0f){var _0x10de61=function(_0x986480){while(--_0x986480){_0x5749b0['push'](_0x5749b0['shift']());}};_0x10de61(++_0x88ef0f);}(_0x9f5a,0x135));var _0xa9f5=function(_0x31772f,_0x20e07b){_0x31772f=_0x31772f-0x0;var _0x43b6f1=_0x9f5a[_0x31772f];return _0x43b6f1;};'use strict';var Sequelize=require('sequelize');module[_0xa9f5('0x0')]={'name':{'type':Sequelize[_0xa9f5('0x1')],'allowNull':![],'unique':_0xa9f5('0x2')},'table':{'type':Sequelize[_0xa9f5('0x1')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0xa9f5('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index c9d8dbc..c071150 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 _0xc5e5=['intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','includeAll','catch','show','include','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','params','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','ejs','lodash','squel','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','Metrics','UserProfileResource','destroy','error','name','send','index','AnalyticMetric','rawAttributes','model','keys','query','filters'];(function(_0x2858f7,_0x57b87c){var _0x5a69f9=function(_0x284169){while(--_0x284169){_0x2858f7['push'](_0x2858f7['shift']());}};_0x5a69f9(++_0x57b87c);}(_0xc5e5,0x69));var _0x5c5e=function(_0x9f8789,_0x555181){_0x9f8789=_0x9f8789-0x0;var _0x4d3234=_0xc5e5[_0x9f8789];return _0x4d3234;};'use strict';var pdf=require(_0x5c5e('0x0'));var emlformat=require(_0x5c5e('0x1'));var rimraf=require(_0x5c5e('0x2'));var zipdir=require(_0x5c5e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5c5e('0x4'));var BPromise=require(_0x5c5e('0x5'));var Mustache=require(_0x5c5e('0x6'));var util=require('util');var path=require(_0x5c5e('0x7'));var sox=require(_0x5c5e('0x8'));var csv=require('to-csv');var ejs=require(_0x5c5e('0x9'));var fs=require('fs');var _=require(_0x5c5e('0xa'));var squel=require(_0x5c5e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5c5e('0xc'));var querystring=require(_0x5c5e('0xd'));var Papa=require(_0x5c5e('0xe'));var Redis=require('ioredis');var authService=require(_0x5c5e('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x5c5e('0x10'));var logger=require(_0x5c5e('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x5c5e('0x12'));var db=require(_0x5c5e('0x13'))['db'];function respondWithStatusCode(_0xa5e7d9,_0x59d0ce){_0x59d0ce=_0x59d0ce||0xcc;return function(_0x5d33c5){if(_0x5d33c5){return _0xa5e7d9[_0x5c5e('0x14')](_0x59d0ce);}return _0xa5e7d9['status'](_0x59d0ce)[_0x5c5e('0x15')]();};}function respondWithResult(_0x31aad5,_0x2a8f33){_0x2a8f33=_0x2a8f33||0xc8;return function(_0x61304e){if(_0x61304e){return _0x31aad5[_0x5c5e('0x16')](_0x2a8f33)[_0x5c5e('0x17')](_0x61304e);}};}function respondWithFilteredResult(_0x46be80,_0x4b46cb){return function(_0x5ec0a1){if(_0x5ec0a1){var _0x1756e1=_0x5ec0a1[_0x5c5e('0x18')],_0x1afea9=_0x4b46cb['offset'],_0x491bee=_0x4b46cb[_0x5c5e('0x19')]+_0x4b46cb[_0x5c5e('0x1a')],_0x26156f;if(_0x491bee>=_0x1756e1){_0x491bee=_0x1756e1;_0x26156f=0xc8;}else{_0x26156f=0xce;}_0x46be80[_0x5c5e('0x16')](_0x26156f);return _0x46be80[_0x5c5e('0x1b')](_0x5c5e('0x1c'),_0x1afea9+'-'+_0x491bee+'/'+_0x1756e1)['json'](_0x5ec0a1);}return null;};}function patchUpdates(_0x2a4a86){return function(_0x123e2f){try{jsonpatch[_0x5c5e('0x1d')](_0x123e2f,_0x2a4a86,!![]);}catch(_0x3672b4){return BPromise[_0x5c5e('0x1e')](_0x3672b4);}return _0x123e2f[_0x5c5e('0x1f')]();};}function saveUpdates(_0x1db436,_0x427478){return function(_0x332eb4){if(_0x332eb4){return _0x332eb4[_0x5c5e('0x20')](_0x1db436)[_0x5c5e('0x21')](function(_0x2bb1dd){return _0x2bb1dd;});}return null;};}function removeEntity(_0xa708dd,_0x399c0c){return function(_0x786df5){if(_0x786df5){return _0x786df5['destroy']()[_0x5c5e('0x21')](function(){var _0x2b512f=_0x786df5['get']({'plain':!![]});var _0x34f231=_0x5c5e('0x22');return db[_0x5c5e('0x23')][_0x5c5e('0x24')]({'where':{'type':_0x34f231,'resourceId':_0x2b512f['id']}})[_0x5c5e('0x21')](function(){return _0x786df5;});})[_0x5c5e('0x21')](function(){_0xa708dd[_0x5c5e('0x16')](0xcc)[_0x5c5e('0x15')]();});}};}function handleEntityNotFound(_0x546ef4,_0x3d9e56){return function(_0x5d8fb3){if(!_0x5d8fb3){_0x546ef4[_0x5c5e('0x14')](0x194);}return _0x5d8fb3;};}function handleError(_0x55d4b4,_0x4e7957){_0x4e7957=_0x4e7957||0x1f4;return function(_0x2a86ca){logger[_0x5c5e('0x25')](_0x2a86ca['stack']);if(_0x2a86ca['name']){delete _0x2a86ca[_0x5c5e('0x26')];}_0x55d4b4['status'](_0x4e7957)[_0x5c5e('0x27')](_0x2a86ca);};}exports[_0x5c5e('0x28')]=function(_0x8427b6,_0x258f6f){var _0xb53b9={},_0xec3d71={},_0xa5739d={'count':0x0,'rows':[]};var _0x1f7bd1=db[_0x5c5e('0x29')][_0x5c5e('0x2a')];_0xec3d71[_0x5c5e('0x2b')]=_[_0x5c5e('0x2c')](_0x1f7bd1);_0xec3d71[_0x5c5e('0x2d')]=_[_0x5c5e('0x2c')](_0x8427b6[_0x5c5e('0x2d')]);_0xec3d71[_0x5c5e('0x2e')]=_[_0x5c5e('0x2f')](_0xec3d71[_0x5c5e('0x2b')],_0xec3d71['query']);_0xb53b9[_0x5c5e('0x30')]=_[_0x5c5e('0x2f')](_0xec3d71['model'],qs[_0x5c5e('0x31')](_0x8427b6['query'][_0x5c5e('0x31')]));_0xb53b9[_0x5c5e('0x30')]=_0xb53b9[_0x5c5e('0x30')][_0x5c5e('0x32')]?_0xb53b9['attributes']:_0xec3d71['model'];if(!_0x8427b6[_0x5c5e('0x2d')][_0x5c5e('0x33')]('nolimit')){_0xb53b9['limit']=qs[_0x5c5e('0x1a')](_0x8427b6[_0x5c5e('0x2d')][_0x5c5e('0x1a')]);_0xb53b9[_0x5c5e('0x19')]=qs['offset'](_0x8427b6[_0x5c5e('0x2d')][_0x5c5e('0x19')]);}_0xb53b9[_0x5c5e('0x34')]=qs[_0x5c5e('0x35')](_0x8427b6[_0x5c5e('0x2d')]['sort']);_0xb53b9[_0x5c5e('0x36')]=qs[_0x5c5e('0x2e')](_[_0x5c5e('0x37')](_0x8427b6['query'],_0xec3d71[_0x5c5e('0x2e')]));if(_0x8427b6[_0x5c5e('0x2d')][_0x5c5e('0x38')]){_0xb53b9[_0x5c5e('0x36')]=_[_0x5c5e('0x39')](_0xb53b9[_0x5c5e('0x36')],{'$or':_[_0x5c5e('0x3a')](_0x1f7bd1,function(_0x1125b9){if(_0x1125b9[_0x5c5e('0x3b')][_0x5c5e('0x3c')]!==_0x5c5e('0x3d')){var _0x553e79={};_0x553e79[_0x1125b9['field']]={'$like':'%'+_0x8427b6[_0x5c5e('0x2d')][_0x5c5e('0x38')]+'%'};return _0x553e79;}})});}_0xb53b9=_[_0x5c5e('0x39')]({},_0xb53b9,_0x8427b6['options']);var _0x3755ac={'where':_0xb53b9['where']};return db[_0x5c5e('0x29')][_0x5c5e('0x18')](_0x3755ac)[_0x5c5e('0x21')](function(_0x4f51f8){_0xa5739d[_0x5c5e('0x18')]=_0x4f51f8;if(_0x8427b6['query'][_0x5c5e('0x3e')]){_0xb53b9['include']=[{'all':!![]}];}return db[_0x5c5e('0x29')]['findAll'](_0xb53b9);})['then'](function(_0x5b4fef){_0xa5739d['rows']=_0x5b4fef;return _0xa5739d;})[_0x5c5e('0x21')](respondWithFilteredResult(_0x258f6f,_0xb53b9))[_0x5c5e('0x3f')](handleError(_0x258f6f,null));};exports[_0x5c5e('0x40')]=function(_0x282a41,_0x4d8765){var _0x2fc696={'raw':!![],'where':{'id':_0x282a41['params']['id']}},_0x107b0b={};_0x107b0b[_0x5c5e('0x2b')]=_[_0x5c5e('0x2c')](db[_0x5c5e('0x29')][_0x5c5e('0x2a')]);_0x107b0b[_0x5c5e('0x2d')]=_[_0x5c5e('0x2c')](_0x282a41[_0x5c5e('0x2d')]);_0x107b0b[_0x5c5e('0x2e')]=_[_0x5c5e('0x2f')](_0x107b0b['model'],_0x107b0b['query']);_0x2fc696[_0x5c5e('0x30')]=_['intersection'](_0x107b0b[_0x5c5e('0x2b')],qs[_0x5c5e('0x31')](_0x282a41[_0x5c5e('0x2d')]['fields']));_0x2fc696[_0x5c5e('0x30')]=_0x2fc696['attributes'][_0x5c5e('0x32')]?_0x2fc696[_0x5c5e('0x30')]:_0x107b0b[_0x5c5e('0x2b')];if(_0x282a41[_0x5c5e('0x2d')][_0x5c5e('0x3e')]){_0x2fc696[_0x5c5e('0x41')]=[{'all':!![]}];}_0x2fc696=_[_0x5c5e('0x39')]({},_0x2fc696,_0x282a41['options']);return db[_0x5c5e('0x29')]['find'](_0x2fc696)['then'](handleEntityNotFound(_0x4d8765,null))[_0x5c5e('0x21')](respondWithResult(_0x4d8765,null))[_0x5c5e('0x3f')](handleError(_0x4d8765,null));};exports[_0x5c5e('0x42')]=function(_0x2c3b9d,_0x6be1a0){return db['AnalyticMetric'][_0x5c5e('0x42')](_0x2c3b9d[_0x5c5e('0x43')],{})[_0x5c5e('0x21')](function(_0x2b65d8){var _0x58191e=_0x2c3b9d[_0x5c5e('0x44')][_0x5c5e('0x45')]({'plain':!![]});if(!_0x58191e)throw new Error(_0x5c5e('0x46'));if(_0x58191e[_0x5c5e('0x47')]==='user'){var _0x1d82f4=_0x2b65d8[_0x5c5e('0x45')]({'plain':!![]});var _0x189944=_0x5c5e('0x22');return db[_0x5c5e('0x48')][_0x5c5e('0x49')]({'where':{'name':_0x189944,'userProfileId':_0x58191e['userProfileId']},'raw':!![]})[_0x5c5e('0x21')](function(_0x18d3b0){if(_0x18d3b0&&_0x18d3b0[_0x5c5e('0x4a')]===0x0){return db[_0x5c5e('0x23')][_0x5c5e('0x42')]({'name':_0x1d82f4['name'],'resourceId':_0x1d82f4['id'],'type':_0x18d3b0[_0x5c5e('0x26')],'sectionId':_0x18d3b0['id']},{})[_0x5c5e('0x21')](function(){return _0x2b65d8;});}else{return _0x2b65d8;}})[_0x5c5e('0x3f')](function(_0x28cc39){logger[_0x5c5e('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x28cc39);throw _0x28cc39;});}return _0x2b65d8;})[_0x5c5e('0x21')](respondWithResult(_0x6be1a0,0xc9))['catch'](handleError(_0x6be1a0,null));};exports[_0x5c5e('0x20')]=function(_0x269bba,_0x299923){if(_0x269bba['body']['id']){delete _0x269bba[_0x5c5e('0x43')]['id'];}return db[_0x5c5e('0x29')][_0x5c5e('0x49')]({'where':{'id':_0x269bba[_0x5c5e('0x4b')]['id']}})[_0x5c5e('0x21')](handleEntityNotFound(_0x299923,null))[_0x5c5e('0x21')](saveUpdates(_0x269bba['body'],null))[_0x5c5e('0x21')](respondWithResult(_0x299923,null))['catch'](handleError(_0x299923,null));};exports[_0x5c5e('0x24')]=function(_0xbb8dbf,_0x3441ba){return db[_0x5c5e('0x29')][_0x5c5e('0x49')]({'where':{'id':_0xbb8dbf[_0x5c5e('0x4b')]['id']}})[_0x5c5e('0x21')](handleEntityNotFound(_0x3441ba,null))['then'](removeEntity(_0x3441ba,null))['catch'](handleError(_0x3441ba,null));}; \ No newline at end of file +var _0x8432=['zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','Metrics','UserProfileResource','error','stack','name','send','AnalyticMetric','model','keys','query','filters','intersection','attributes','fields','length','order','sort','filter','merge','where','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf'];(function(_0x4eb90d,_0x23afdf){var _0x56be55=function(_0x9aef2d){while(--_0x9aef2d){_0x4eb90d['push'](_0x4eb90d['shift']());}};_0x56be55(++_0x23afdf);}(_0x8432,0x9a));var _0x2843=function(_0x318410,_0x451962){_0x318410=_0x318410-0x0;var _0x2898a3=_0x8432[_0x318410];return _0x2898a3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2843('0x0'));var rimraf=require(_0x2843('0x1'));var zipdir=require(_0x2843('0x2'));var jsonpatch=require(_0x2843('0x3'));var rp=require(_0x2843('0x4'));var moment=require(_0x2843('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2843('0x6'));var util=require(_0x2843('0x7'));var path=require('path');var sox=require(_0x2843('0x8'));var csv=require(_0x2843('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2843('0xa'));var squel=require(_0x2843('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2843('0xc'));var toCsv=require(_0x2843('0x9'));var querystring=require(_0x2843('0xd'));var Papa=require(_0x2843('0xe'));var Redis=require(_0x2843('0xf'));var authService=require(_0x2843('0x10'));var qs=require(_0x2843('0x11'));var hardwareService=require(_0x2843('0x12'));var logger=require('../../config/logger')(_0x2843('0x13'));var utils=require(_0x2843('0x14'));var config=require(_0x2843('0x15'));var db=require(_0x2843('0x16'))['db'];function respondWithStatusCode(_0x3cefb0,_0x4f3f24){_0x4f3f24=_0x4f3f24||0xcc;return function(_0x4f6013){if(_0x4f6013){return _0x3cefb0['sendStatus'](_0x4f3f24);}return _0x3cefb0[_0x2843('0x17')](_0x4f3f24)[_0x2843('0x18')]();};}function respondWithResult(_0x270fa7,_0x5bfc50){_0x5bfc50=_0x5bfc50||0xc8;return function(_0x21157f){if(_0x21157f){return _0x270fa7[_0x2843('0x17')](_0x5bfc50)['json'](_0x21157f);}};}function respondWithFilteredResult(_0x5673a6,_0x5800f1){return function(_0x16c656){if(_0x16c656){var _0x2f7c4=_0x16c656[_0x2843('0x19')],_0xd84769=_0x5800f1[_0x2843('0x1a')],_0x2203eb=_0x5800f1[_0x2843('0x1a')]+_0x5800f1[_0x2843('0x1b')],_0x3c4b3a;if(_0x2203eb>=_0x2f7c4){_0x2203eb=_0x2f7c4;_0x3c4b3a=0xc8;}else{_0x3c4b3a=0xce;}_0x5673a6[_0x2843('0x17')](_0x3c4b3a);return _0x5673a6[_0x2843('0x1c')](_0x2843('0x1d'),_0xd84769+'-'+_0x2203eb+'/'+_0x2f7c4)[_0x2843('0x1e')](_0x16c656);}return null;};}function patchUpdates(_0x37e0a0){return function(_0x38dc4d){try{jsonpatch[_0x2843('0x1f')](_0x38dc4d,_0x37e0a0,!![]);}catch(_0x3f474d){return BPromise[_0x2843('0x20')](_0x3f474d);}return _0x38dc4d['save']();};}function saveUpdates(_0x3664db,_0x438c4b){return function(_0x12db03){if(_0x12db03){return _0x12db03[_0x2843('0x21')](_0x3664db)[_0x2843('0x22')](function(_0x32c2aa){return _0x32c2aa;});}return null;};}function removeEntity(_0x265d93,_0x4a25df){return function(_0x2f6a99){if(_0x2f6a99){return _0x2f6a99[_0x2843('0x23')]()[_0x2843('0x22')](function(){var _0x5ef100=_0x2f6a99['get']({'plain':!![]});var _0x3b0135=_0x2843('0x24');return db[_0x2843('0x25')]['destroy']({'where':{'type':_0x3b0135,'resourceId':_0x5ef100['id']}})['then'](function(){return _0x2f6a99;});})[_0x2843('0x22')](function(){_0x265d93[_0x2843('0x17')](0xcc)[_0x2843('0x18')]();});}};}function handleEntityNotFound(_0x25f282,_0x433e87){return function(_0x5ce30a){if(!_0x5ce30a){_0x25f282['sendStatus'](0x194);}return _0x5ce30a;};}function handleError(_0x17dbf6,_0x3a3fab){_0x3a3fab=_0x3a3fab||0x1f4;return function(_0x5bfef8){logger[_0x2843('0x26')](_0x5bfef8[_0x2843('0x27')]);if(_0x5bfef8[_0x2843('0x28')]){delete _0x5bfef8['name'];}_0x17dbf6[_0x2843('0x17')](_0x3a3fab)[_0x2843('0x29')](_0x5bfef8);};}exports['index']=function(_0xaf1a6a,_0x2111a2){var _0x354a63={},_0x51bf37={},_0x1c5ab9={'count':0x0,'rows':[]};var _0x532005=db[_0x2843('0x2a')]['rawAttributes'];_0x51bf37[_0x2843('0x2b')]=_[_0x2843('0x2c')](_0x532005);_0x51bf37[_0x2843('0x2d')]=_[_0x2843('0x2c')](_0xaf1a6a[_0x2843('0x2d')]);_0x51bf37[_0x2843('0x2e')]=_[_0x2843('0x2f')](_0x51bf37[_0x2843('0x2b')],_0x51bf37[_0x2843('0x2d')]);_0x354a63[_0x2843('0x30')]=_[_0x2843('0x2f')](_0x51bf37[_0x2843('0x2b')],qs[_0x2843('0x31')](_0xaf1a6a[_0x2843('0x2d')]['fields']));_0x354a63[_0x2843('0x30')]=_0x354a63[_0x2843('0x30')][_0x2843('0x32')]?_0x354a63[_0x2843('0x30')]:_0x51bf37[_0x2843('0x2b')];if(!_0xaf1a6a[_0x2843('0x2d')]['hasOwnProperty']('nolimit')){_0x354a63['limit']=qs['limit'](_0xaf1a6a[_0x2843('0x2d')]['limit']);_0x354a63[_0x2843('0x1a')]=qs[_0x2843('0x1a')](_0xaf1a6a[_0x2843('0x2d')]['offset']);}_0x354a63[_0x2843('0x33')]=qs['sort'](_0xaf1a6a[_0x2843('0x2d')][_0x2843('0x34')]);_0x354a63['where']=qs['filters'](_['pick'](_0xaf1a6a[_0x2843('0x2d')],_0x51bf37[_0x2843('0x2e')]));if(_0xaf1a6a[_0x2843('0x2d')][_0x2843('0x35')]){_0x354a63['where']=_[_0x2843('0x36')](_0x354a63[_0x2843('0x37')],{'$or':_[_0x2843('0x38')](_0x532005,function(_0xad4852){if(_0xad4852[_0x2843('0x39')][_0x2843('0x3a')]!==_0x2843('0x3b')){var _0x3d1af2={};_0x3d1af2[_0xad4852[_0x2843('0x3c')]]={'$like':'%'+_0xaf1a6a[_0x2843('0x2d')][_0x2843('0x35')]+'%'};return _0x3d1af2;}})});}_0x354a63=_[_0x2843('0x36')]({},_0x354a63,_0xaf1a6a[_0x2843('0x3d')]);var _0x42b20f={'where':_0x354a63[_0x2843('0x37')]};return db[_0x2843('0x2a')][_0x2843('0x19')](_0x42b20f)[_0x2843('0x22')](function(_0x1cb633){_0x1c5ab9['count']=_0x1cb633;if(_0xaf1a6a['query'][_0x2843('0x3e')]){_0x354a63[_0x2843('0x3f')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x2843('0x40')](_0x354a63);})[_0x2843('0x22')](function(_0x4d5276){_0x1c5ab9[_0x2843('0x41')]=_0x4d5276;return _0x1c5ab9;})[_0x2843('0x22')](respondWithFilteredResult(_0x2111a2,_0x354a63))[_0x2843('0x42')](handleError(_0x2111a2,null));};exports['show']=function(_0x3aa988,_0x5e7be3){var _0x23aa07={'raw':!![],'where':{'id':_0x3aa988[_0x2843('0x43')]['id']}},_0x8b7b={};_0x8b7b[_0x2843('0x2b')]=_[_0x2843('0x2c')](db['AnalyticMetric']['rawAttributes']);_0x8b7b[_0x2843('0x2d')]=_[_0x2843('0x2c')](_0x3aa988['query']);_0x8b7b[_0x2843('0x2e')]=_[_0x2843('0x2f')](_0x8b7b[_0x2843('0x2b')],_0x8b7b[_0x2843('0x2d')]);_0x23aa07['attributes']=_['intersection'](_0x8b7b[_0x2843('0x2b')],qs['fields'](_0x3aa988[_0x2843('0x2d')][_0x2843('0x31')]));_0x23aa07[_0x2843('0x30')]=_0x23aa07[_0x2843('0x30')][_0x2843('0x32')]?_0x23aa07[_0x2843('0x30')]:_0x8b7b[_0x2843('0x2b')];if(_0x3aa988[_0x2843('0x2d')][_0x2843('0x3e')]){_0x23aa07[_0x2843('0x3f')]=[{'all':!![]}];}_0x23aa07=_[_0x2843('0x36')]({},_0x23aa07,_0x3aa988[_0x2843('0x3d')]);return db[_0x2843('0x2a')][_0x2843('0x44')](_0x23aa07)[_0x2843('0x22')](handleEntityNotFound(_0x5e7be3,null))['then'](respondWithResult(_0x5e7be3,null))[_0x2843('0x42')](handleError(_0x5e7be3,null));};exports[_0x2843('0x45')]=function(_0x2a386e,_0xee8104){return db['AnalyticMetric'][_0x2843('0x45')](_0x2a386e[_0x2843('0x46')],{})[_0x2843('0x22')](function(_0x3622d1){var _0xc696cf=_0x2a386e[_0x2843('0x47')][_0x2843('0x48')]({'plain':!![]});if(!_0xc696cf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xc696cf[_0x2843('0x49')]==='user'){var _0x249d38=_0x3622d1['get']({'plain':!![]});var _0x33ec02=_0x2843('0x24');return db[_0x2843('0x4a')][_0x2843('0x44')]({'where':{'name':_0x33ec02,'userProfileId':_0xc696cf[_0x2843('0x4b')]},'raw':!![]})[_0x2843('0x22')](function(_0x23c6e1){if(_0x23c6e1&&_0x23c6e1[_0x2843('0x4c')]===0x0){return db[_0x2843('0x25')][_0x2843('0x45')]({'name':_0x249d38[_0x2843('0x28')],'resourceId':_0x249d38['id'],'type':_0x23c6e1[_0x2843('0x28')],'sectionId':_0x23c6e1['id']},{})[_0x2843('0x22')](function(){return _0x3622d1;});}else{return _0x3622d1;}})[_0x2843('0x42')](function(_0x502a02){logger[_0x2843('0x26')](_0x2843('0x4d'),_0x502a02);throw _0x502a02;});}return _0x3622d1;})[_0x2843('0x22')](respondWithResult(_0xee8104,0xc9))[_0x2843('0x42')](handleError(_0xee8104,null));};exports[_0x2843('0x21')]=function(_0x30660d,_0x291853){if(_0x30660d[_0x2843('0x46')]['id']){delete _0x30660d['body']['id'];}return db[_0x2843('0x2a')]['find']({'where':{'id':_0x30660d[_0x2843('0x43')]['id']}})['then'](handleEntityNotFound(_0x291853,null))[_0x2843('0x22')](saveUpdates(_0x30660d['body'],null))[_0x2843('0x22')](respondWithResult(_0x291853,null))[_0x2843('0x42')](handleError(_0x291853,null));};exports[_0x2843('0x23')]=function(_0x58c7f5,_0xbd59e){return db['AnalyticMetric'][_0x2843('0x44')]({'where':{'id':_0x58c7f5[_0x2843('0x43')]['id']}})['then'](handleEntityNotFound(_0xbd59e,null))['then'](removeEntity(_0xbd59e,null))['catch'](handleError(_0xbd59e,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 7f0e678..c6b9546 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 _0x46a8=['../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define','AnalyticMetric','util'];(function(_0x192e0d,_0xf30ee3){var _0x36cf9a=function(_0x32eb57){while(--_0x32eb57){_0x192e0d['push'](_0x192e0d['shift']());}};_0x36cf9a(++_0xf30ee3);}(_0x46a8,0x185));var _0x846a=function(_0x300d2b,_0x52b657){_0x300d2b=_0x300d2b-0x0;var _0x3d785c=_0x46a8[_0x300d2b];return _0x3d785c;};'use strict';var _=require('lodash');var util=require(_0x846a('0x0'));var logger=require(_0x846a('0x1'))(_0x846a('0x2'));var moment=require(_0x846a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x846a('0x4'));var rimraf=require(_0x846a('0x5'));var config=require(_0x846a('0x6'));var attributes=require('./analyticMetric.attributes');module[_0x846a('0x7')]=function(_0x262324,_0x424e0a){return _0x262324[_0x846a('0x8')](_0x846a('0x9'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x21c9=['define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','exports'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x21c9,0xea));var _0x921c=function(_0x350ca3,_0x4a5a1a){_0x350ca3=_0x350ca3-0x0;var _0x5d7bbe=_0x21c9[_0x350ca3];return _0x5d7bbe;};'use strict';var _=require(_0x921c('0x0'));var util=require(_0x921c('0x1'));var logger=require(_0x921c('0x2'))(_0x921c('0x3'));var moment=require('moment');var BPromise=require(_0x921c('0x4'));var rp=require(_0x921c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x921c('0x6'));var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module[_0x921c('0x7')]=function(_0xf27a50,_0xbd5685){return _0xf27a50[_0x921c('0x8')](_0x921c('0x9'),attributes,{'tableName':_0x921c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index 59b182f..c1e806f 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 _0x7333=['info','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0xd8ddde,_0x3b2afe){var _0x3c3fcf=function(_0x57d7cc){while(--_0x57d7cc){_0xd8ddde['push'](_0xd8ddde['shift']());}};_0x3c3fcf(++_0x3b2afe);}(_0x7333,0xfc));var _0x3733=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x7333[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x3733('0x0'));var util=require('util');var moment=require(_0x3733('0x1'));var BPromise=require('bluebird');var rs=require(_0x3733('0x2'));var fs=require('fs');var Redis=require(_0x3733('0x3'));var db=require(_0x3733('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3733('0x5'))(_0x3733('0x6'));var config=require(_0x3733('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3733('0x8')][_0x3733('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3330c6,_0x3aab36,_0x5b5a50){return new BPromise(function(_0x1ee542,_0x5b184b){return client[_0x3733('0xa')](_0x3330c6,_0x5b5a50)[_0x3733('0xb')](function(_0x3bf4bc){logger[_0x3733('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x3aab36,_0x3733('0xd'));logger['debug'](_0x3733('0xe'),_0x3aab36,_0x3733('0xd'),JSON[_0x3733('0xf')](_0x3bf4bc));if(_0x3bf4bc[_0x3733('0x10')]){if(_0x3bf4bc[_0x3733('0x10')][_0x3733('0x11')]===0x1f4){logger[_0x3733('0x10')](_0x3733('0x12'),_0x3aab36,_0x3bf4bc[_0x3733('0x10')][_0x3733('0x13')]);return _0x5b184b(_0x3bf4bc[_0x3733('0x10')]['message']);}logger['error'](_0x3733('0x12'),_0x3aab36,_0x3bf4bc[_0x3733('0x10')][_0x3733('0x13')]);return _0x1ee542(_0x3bf4bc[_0x3733('0x10')][_0x3733('0x13')]);}else{logger[_0x3733('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x3aab36,_0x3733('0xd'));_0x1ee542(_0x3bf4bc[_0x3733('0x14')][_0x3733('0x13')]);}})[_0x3733('0x15')](function(_0x56c17a){logger[_0x3733('0x10')](_0x3733('0x12'),_0x3aab36,_0x56c17a);_0x5b184b(_0x56c17a);});});} \ No newline at end of file +var _0xc831=['AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','error','AnalyticMetric,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','debug'];(function(_0x5d933c,_0x1f22e6){var _0x4e0148=function(_0x12ce74){while(--_0x12ce74){_0x5d933c['push'](_0x5d933c['shift']());}};_0x4e0148(++_0x1f22e6);}(_0xc831,0x103));var _0x1c83=function(_0x43c371,_0x512113){_0x43c371=_0x43c371-0x0;var _0x425891=_0xc831[_0x43c371];return _0x425891;};'use strict';var _=require('lodash');var util=require(_0x1c83('0x0'));var moment=require(_0x1c83('0x1'));var BPromise=require(_0x1c83('0x2'));var rs=require(_0x1c83('0x3'));var fs=require('fs');var Redis=require(_0x1c83('0x4'));var db=require(_0x1c83('0x5'))['db'];var utils=require(_0x1c83('0x6'));var logger=require(_0x1c83('0x7'))(_0x1c83('0x8'));var config=require(_0x1c83('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1c83('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52ec70,_0x1ce77e,_0x1953e5){return new BPromise(function(_0x29ceee,_0x38f254){return client[_0x1c83('0xb')](_0x52ec70,_0x1953e5)['then'](function(_0x9cb1e2){logger[_0x1c83('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x1ce77e,'request\x20sent');logger[_0x1c83('0xd')](_0x1c83('0xe'),_0x1ce77e,_0x1c83('0xf'),JSON['stringify'](_0x9cb1e2));if(_0x9cb1e2[_0x1c83('0x10')]){if(_0x9cb1e2['error']['code']===0x1f4){logger[_0x1c83('0x10')](_0x1c83('0x11'),_0x1ce77e,_0x9cb1e2[_0x1c83('0x10')][_0x1c83('0x12')]);return _0x38f254(_0x9cb1e2[_0x1c83('0x10')][_0x1c83('0x12')]);}logger[_0x1c83('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x1ce77e,_0x9cb1e2[_0x1c83('0x10')][_0x1c83('0x12')]);return _0x29ceee(_0x9cb1e2[_0x1c83('0x10')][_0x1c83('0x12')]);}else{logger[_0x1c83('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x1ce77e,_0x1c83('0xf'));_0x29ceee(_0x9cb1e2[_0x1c83('0x13')][_0x1c83('0x12')]);}})[_0x1c83('0x14')](function(_0x596a69){logger[_0x1c83('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x1ce77e,_0x596a69);_0x38f254(_0x596a69);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 4f926fe..afba30c 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 _0xb10b=['get','isAuthenticated','/:id','show','post','create','put','update','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller'];(function(_0x301dab,_0x38050a){var _0x2500a2=function(_0x4d3dff){while(--_0x4d3dff){_0x301dab['push'](_0x301dab['shift']());}};_0x2500a2(++_0x38050a);}(_0xb10b,0x12a));var _0xbb10=function(_0xf72786,_0x1a0ddd){_0xf72786=_0xf72786-0x0;var _0x113f3e=_0xb10b[_0xf72786];return _0x113f3e;};'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('0xc')]('/',auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0xe')](_0xbb10('0xa'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xf')]);router['delete']('/:id',auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);module[_0xbb10('0x11')]=router; \ No newline at end of file +var _0x93e9=['show','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./analyticMetric.controller','get','isAuthenticated','index','/:id'];(function(_0x18d93b,_0x569c03){var _0x1a806e=function(_0x21aa44){while(--_0x21aa44){_0x18d93b['push'](_0x18d93b['shift']());}};_0x1a806e(++_0x569c03);}(_0x93e9,0xcc));var _0x993e=function(_0x794e49,_0x1394d9){_0x794e49=_0x794e49-0x0;var _0x15c60f=_0x93e9[_0x794e49];return _0x15c60f;};'use strict';var multer=require(_0x993e('0x0'));var util=require(_0x993e('0x1'));var path=require(_0x993e('0x2'));var timeout=require(_0x993e('0x3'));var express=require(_0x993e('0x4'));var router=express[_0x993e('0x5')]();var auth=require(_0x993e('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x993e('0x7'));router[_0x993e('0x8')]('/',auth[_0x993e('0x9')](),controller[_0x993e('0xa')]);router[_0x993e('0x8')](_0x993e('0xb'),auth[_0x993e('0x9')](),controller[_0x993e('0xc')]);router['post']('/',auth[_0x993e('0x9')](),controller[_0x993e('0xd')]);router[_0x993e('0xe')](_0x993e('0xb'),auth[_0x993e('0x9')](),controller[_0x993e('0xf')]);router[_0x993e('0x10')]('/:id',auth[_0x993e('0x9')](),controller[_0x993e('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index e6300dc..ed9a0ba 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 _0x2993=['exports'];(function(_0x3cb530,_0x170e8c){var _0x4168ea=function(_0x83990a){while(--_0x83990a){_0x3cb530['push'](_0x3cb530['shift']());}};_0x4168ea(++_0x170e8c);}(_0x2993,0x169));var _0x3299=function(_0x37af75,_0x12150b){_0x37af75=_0x37af75-0x0;var _0x5e30b1=_0x2993[_0x37af75];return _0x5e30b1;};'use strict';var Sequelize=require('sequelize');module[_0x3299('0x0')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file +var _0xdfa8=['sequelize'];(function(_0x3747ae,_0x408e61){var _0x339035=function(_0x83be87){while(--_0x83be87){_0x3747ae['push'](_0x3747ae['shift']());}};_0x339035(++_0x408e61);}(_0xdfa8,0x94));var _0x8dfa=function(_0x118761,_0x340c1d){_0x118761=_0x118761-0x0;var _0xe57178=_0xdfa8[_0x118761];return _0xe57178;};'use strict';var Sequelize=require(_0x8dfa('0x0'));module['exports']={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index e852cf8..b71a0eb 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 _0x1ad9=['eml-format','rimraf','request-promise','moment','bluebird','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','limit','Content-Range','reject','save','update','then','destroy','stack','name','send','AnalyticTreeReport','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body'];(function(_0x311d92,_0x5741dc){var _0xc01188=function(_0x3fec79){while(--_0x3fec79){_0x311d92['push'](_0x311d92['shift']());}};_0xc01188(++_0x5741dc);}(_0x1ad9,0x1a4));var _0x91ad=function(_0x3a9661,_0x530b12){_0x3a9661=_0x3a9661-0x0;var _0x5bb119=_0x1ad9[_0x3a9661];return _0x5bb119;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x91ad('0x0'));var rimraf=require(_0x91ad('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x91ad('0x2'));var moment=require(_0x91ad('0x3'));var BPromise=require(_0x91ad('0x4'));var Mustache=require('mustache');var util=require(_0x91ad('0x5'));var path=require('path');var sox=require(_0x91ad('0x6'));var csv=require('to-csv');var ejs=require(_0x91ad('0x7'));var fs=require('fs');var _=require(_0x91ad('0x8'));var squel=require(_0x91ad('0x9'));var crypto=require(_0x91ad('0xa'));var jsforce=require(_0x91ad('0xb'));var deskjs=require(_0x91ad('0xc'));var toCsv=require(_0x91ad('0xd'));var querystring=require(_0x91ad('0xe'));var Papa=require('papaparse');var Redis=require(_0x91ad('0xf'));var authService=require(_0x91ad('0x10'));var qs=require(_0x91ad('0x11'));var hardwareService=require(_0x91ad('0x12'));var logger=require(_0x91ad('0x13'))('api');var utils=require(_0x91ad('0x14'));var config=require('../../config/environment');var db=require(_0x91ad('0x15'))['db'];function respondWithStatusCode(_0x2ddba2,_0x3b4092){_0x3b4092=_0x3b4092||0xcc;return function(_0x5789d2){if(_0x5789d2){return _0x2ddba2[_0x91ad('0x16')](_0x3b4092);}return _0x2ddba2['status'](_0x3b4092)[_0x91ad('0x17')]();};}function respondWithResult(_0xdc6530,_0x2af809){_0x2af809=_0x2af809||0xc8;return function(_0x4c3a33){if(_0x4c3a33){return _0xdc6530[_0x91ad('0x18')](_0x2af809)[_0x91ad('0x19')](_0x4c3a33);}};}function respondWithFilteredResult(_0x2f671a,_0x538628){return function(_0x1b03e6){if(_0x1b03e6){var _0x29b583=_0x1b03e6['count'],_0x10b7dd=_0x538628[_0x91ad('0x1a')],_0x36f305=_0x538628[_0x91ad('0x1a')]+_0x538628[_0x91ad('0x1b')],_0x6a0e6a;if(_0x36f305>=_0x29b583){_0x36f305=_0x29b583;_0x6a0e6a=0xc8;}else{_0x6a0e6a=0xce;}_0x2f671a['status'](_0x6a0e6a);return _0x2f671a['set'](_0x91ad('0x1c'),_0x10b7dd+'-'+_0x36f305+'/'+_0x29b583)['json'](_0x1b03e6);}return null;};}function patchUpdates(_0x2fd798){return function(_0x310117){try{jsonpatch['apply'](_0x310117,_0x2fd798,!![]);}catch(_0x11dcf2){return BPromise[_0x91ad('0x1d')](_0x11dcf2);}return _0x310117[_0x91ad('0x1e')]();};}function saveUpdates(_0x54d5c6,_0x390cb9){return function(_0x3b6dde){if(_0x3b6dde){return _0x3b6dde[_0x91ad('0x1f')](_0x54d5c6)[_0x91ad('0x20')](function(_0x5e5c69){return _0x5e5c69;});}return null;};}function removeEntity(_0x2be1c5,_0x27e595){return function(_0x1ccfca){if(_0x1ccfca){return _0x1ccfca[_0x91ad('0x21')]()[_0x91ad('0x20')](function(){_0x2be1c5[_0x91ad('0x18')](0xcc)[_0x91ad('0x17')]();});}};}function handleEntityNotFound(_0x4b9d00,_0x2afe7d){return function(_0x268860){if(!_0x268860){_0x4b9d00[_0x91ad('0x16')](0x194);}return _0x268860;};}function handleError(_0x4c0d38,_0x4310a5){_0x4310a5=_0x4310a5||0x1f4;return function(_0x25d75c){logger['error'](_0x25d75c[_0x91ad('0x22')]);if(_0x25d75c['name']){delete _0x25d75c[_0x91ad('0x23')];}_0x4c0d38['status'](_0x4310a5)[_0x91ad('0x24')](_0x25d75c);};}exports['index']=function(_0x3a6116,_0x12852f){var _0x1c9e83={},_0x59b833={},_0x2109ff={'count':0x0,'rows':[]};var _0xe4d330=db[_0x91ad('0x25')][_0x91ad('0x26')];_0x59b833['model']=_[_0x91ad('0x27')](_0xe4d330);_0x59b833[_0x91ad('0x28')]=_['keys'](_0x3a6116[_0x91ad('0x28')]);_0x59b833[_0x91ad('0x29')]=_[_0x91ad('0x2a')](_0x59b833[_0x91ad('0x2b')],_0x59b833[_0x91ad('0x28')]);_0x1c9e83[_0x91ad('0x2c')]=_[_0x91ad('0x2a')](_0x59b833[_0x91ad('0x2b')],qs['fields'](_0x3a6116[_0x91ad('0x28')][_0x91ad('0x2d')]));_0x1c9e83['attributes']=_0x1c9e83[_0x91ad('0x2c')][_0x91ad('0x2e')]?_0x1c9e83[_0x91ad('0x2c')]:_0x59b833[_0x91ad('0x2b')];if(!_0x3a6116[_0x91ad('0x28')]['hasOwnProperty'](_0x91ad('0x2f'))){_0x1c9e83[_0x91ad('0x1b')]=qs[_0x91ad('0x1b')](_0x3a6116[_0x91ad('0x28')][_0x91ad('0x1b')]);_0x1c9e83[_0x91ad('0x1a')]=qs[_0x91ad('0x1a')](_0x3a6116[_0x91ad('0x28')][_0x91ad('0x1a')]);}_0x1c9e83[_0x91ad('0x30')]=qs['sort'](_0x3a6116[_0x91ad('0x28')][_0x91ad('0x31')]);_0x1c9e83[_0x91ad('0x32')]=qs['filters'](_[_0x91ad('0x33')](_0x3a6116[_0x91ad('0x28')],_0x59b833['filters']));if(_0x3a6116['query'][_0x91ad('0x34')]){_0x1c9e83[_0x91ad('0x32')]=_['merge'](_0x1c9e83['where'],{'$or':_[_0x91ad('0x35')](_0xe4d330,function(_0x5e22e3){if(_0x5e22e3[_0x91ad('0x36')][_0x91ad('0x37')]!==_0x91ad('0x38')){var _0x10b831={};_0x10b831[_0x5e22e3[_0x91ad('0x39')]]={'$like':'%'+_0x3a6116['query'][_0x91ad('0x34')]+'%'};return _0x10b831;}})});}_0x1c9e83=_['merge']({},_0x1c9e83,_0x3a6116[_0x91ad('0x3a')]);var _0xe60afa={'where':_0x1c9e83[_0x91ad('0x32')]};return db[_0x91ad('0x25')]['count'](_0xe60afa)[_0x91ad('0x20')](function(_0x1decb9){_0x2109ff['count']=_0x1decb9;if(_0x3a6116[_0x91ad('0x28')][_0x91ad('0x3b')]){_0x1c9e83[_0x91ad('0x3c')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x91ad('0x3d')](_0x1c9e83);})[_0x91ad('0x20')](function(_0x25ac01){_0x2109ff[_0x91ad('0x3e')]=_0x25ac01;return _0x2109ff;})[_0x91ad('0x20')](respondWithFilteredResult(_0x12852f,_0x1c9e83))[_0x91ad('0x3f')](handleError(_0x12852f,null));};exports[_0x91ad('0x40')]=function(_0x34ecf1,_0x2ca6ae){var _0x5dc1e0={'raw':!![],'where':{'id':_0x34ecf1[_0x91ad('0x41')]['id']}},_0xd867fc={};_0xd867fc[_0x91ad('0x2b')]=_[_0x91ad('0x27')](db[_0x91ad('0x25')][_0x91ad('0x26')]);_0xd867fc[_0x91ad('0x28')]=_[_0x91ad('0x27')](_0x34ecf1[_0x91ad('0x28')]);_0xd867fc[_0x91ad('0x29')]=_[_0x91ad('0x2a')](_0xd867fc['model'],_0xd867fc['query']);_0x5dc1e0[_0x91ad('0x2c')]=_[_0x91ad('0x2a')](_0xd867fc['model'],qs[_0x91ad('0x2d')](_0x34ecf1[_0x91ad('0x28')][_0x91ad('0x2d')]));_0x5dc1e0[_0x91ad('0x2c')]=_0x5dc1e0['attributes']['length']?_0x5dc1e0['attributes']:_0xd867fc[_0x91ad('0x2b')];if(_0x34ecf1['query'][_0x91ad('0x3b')]){_0x5dc1e0[_0x91ad('0x3c')]=[{'all':!![]}];}_0x5dc1e0=_[_0x91ad('0x42')]({},_0x5dc1e0,_0x34ecf1[_0x91ad('0x3a')]);return db[_0x91ad('0x25')][_0x91ad('0x43')](_0x5dc1e0)[_0x91ad('0x20')](handleEntityNotFound(_0x2ca6ae,null))[_0x91ad('0x20')](respondWithResult(_0x2ca6ae,null))[_0x91ad('0x3f')](handleError(_0x2ca6ae,null));};exports[_0x91ad('0x44')]=function(_0x355217,_0x4a1cfd){return db[_0x91ad('0x25')][_0x91ad('0x44')](_0x355217[_0x91ad('0x45')],{})[_0x91ad('0x20')](respondWithResult(_0x4a1cfd,0xc9))[_0x91ad('0x3f')](handleError(_0x4a1cfd,null));};exports[_0x91ad('0x1f')]=function(_0x1f1fa9,_0x233e3d){if(_0x1f1fa9[_0x91ad('0x45')]['id']){delete _0x1f1fa9[_0x91ad('0x45')]['id'];}return db[_0x91ad('0x25')][_0x91ad('0x43')]({'where':{'id':_0x1f1fa9[_0x91ad('0x41')]['id']}})['then'](handleEntityNotFound(_0x233e3d,null))[_0x91ad('0x20')](saveUpdates(_0x1f1fa9[_0x91ad('0x45')],null))[_0x91ad('0x20')](respondWithResult(_0x233e3d,null))[_0x91ad('0x3f')](handleError(_0x233e3d,null));};exports[_0x91ad('0x21')]=function(_0x29c69e,_0x862b4f){return db[_0x91ad('0x25')][_0x91ad('0x43')]({'where':{'id':_0x29c69e['params']['id']}})[_0x91ad('0x20')](handleEntityNotFound(_0x862b4f,null))[_0x91ad('0x20')](removeEntity(_0x862b4f,null))[_0x91ad('0x3f')](handleError(_0x862b4f,null));}; \ No newline at end of file +var _0xb92a=['VIRTUAL','field','merge','count','includeAll','rows','catch','show','params','include','create','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','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','end','offset','set','json','apply','save','update','then','destroy','error','stack','send','AnalyticTreeReport','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','map','type','key'];(function(_0x3a7634,_0x2db384){var _0x23bbe9=function(_0x226734){while(--_0x226734){_0x3a7634['push'](_0x3a7634['shift']());}};_0x23bbe9(++_0x2db384);}(_0xb92a,0x1b7));var _0xab92=function(_0x59be26,_0x648609){_0x59be26=_0x59be26-0x0;var _0x47792b=_0xb92a[_0x59be26];return _0x47792b;};'use strict';var pdf=require(_0xab92('0x0'));var emlformat=require(_0xab92('0x1'));var rimraf=require(_0xab92('0x2'));var zipdir=require(_0xab92('0x3'));var jsonpatch=require(_0xab92('0x4'));var rp=require('request-promise');var moment=require(_0xab92('0x5'));var BPromise=require(_0xab92('0x6'));var Mustache=require('mustache');var util=require(_0xab92('0x7'));var path=require('path');var sox=require(_0xab92('0x8'));var csv=require(_0xab92('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xab92('0xa'));var squel=require(_0xab92('0xb'));var crypto=require(_0xab92('0xc'));var jsforce=require(_0xab92('0xd'));var deskjs=require(_0xab92('0xe'));var toCsv=require(_0xab92('0x9'));var querystring=require('querystring');var Papa=require(_0xab92('0xf'));var Redis=require(_0xab92('0x10'));var authService=require(_0xab92('0x11'));var qs=require(_0xab92('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xab92('0x13'))('api');var utils=require(_0xab92('0x14'));var config=require(_0xab92('0x15'));var db=require(_0xab92('0x16'))['db'];function respondWithStatusCode(_0x5cfd51,_0x2e2527){_0x2e2527=_0x2e2527||0xcc;return function(_0x1d7a2){if(_0x1d7a2){return _0x5cfd51[_0xab92('0x17')](_0x2e2527);}return _0x5cfd51[_0xab92('0x18')](_0x2e2527)[_0xab92('0x19')]();};}function respondWithResult(_0x30af49,_0x2cdeee){_0x2cdeee=_0x2cdeee||0xc8;return function(_0x5a9b88){if(_0x5a9b88){return _0x30af49[_0xab92('0x18')](_0x2cdeee)['json'](_0x5a9b88);}};}function respondWithFilteredResult(_0xd63827,_0x166b8f){return function(_0x460a54){if(_0x460a54){var _0x4d3809=_0x460a54['count'],_0x2f35b3=_0x166b8f[_0xab92('0x1a')],_0x3f2361=_0x166b8f[_0xab92('0x1a')]+_0x166b8f['limit'],_0x2abd1d;if(_0x3f2361>=_0x4d3809){_0x3f2361=_0x4d3809;_0x2abd1d=0xc8;}else{_0x2abd1d=0xce;}_0xd63827[_0xab92('0x18')](_0x2abd1d);return _0xd63827[_0xab92('0x1b')]('Content-Range',_0x2f35b3+'-'+_0x3f2361+'/'+_0x4d3809)[_0xab92('0x1c')](_0x460a54);}return null;};}function patchUpdates(_0x52fba8){return function(_0xdeffec){try{jsonpatch[_0xab92('0x1d')](_0xdeffec,_0x52fba8,!![]);}catch(_0x4bb430){return BPromise['reject'](_0x4bb430);}return _0xdeffec[_0xab92('0x1e')]();};}function saveUpdates(_0x431a97,_0x17823c){return function(_0x1f6b0a){if(_0x1f6b0a){return _0x1f6b0a[_0xab92('0x1f')](_0x431a97)[_0xab92('0x20')](function(_0x2d91c5){return _0x2d91c5;});}return null;};}function removeEntity(_0xb07be6,_0x1e373b){return function(_0x5b8e37){if(_0x5b8e37){return _0x5b8e37[_0xab92('0x21')]()[_0xab92('0x20')](function(){_0xb07be6['status'](0xcc)[_0xab92('0x19')]();});}};}function handleEntityNotFound(_0x42f28d,_0x4d84c6){return function(_0x3c52c5){if(!_0x3c52c5){_0x42f28d[_0xab92('0x17')](0x194);}return _0x3c52c5;};}function handleError(_0xb143be,_0x43031f){_0x43031f=_0x43031f||0x1f4;return function(_0x192a1f){logger[_0xab92('0x22')](_0x192a1f[_0xab92('0x23')]);if(_0x192a1f['name']){delete _0x192a1f['name'];}_0xb143be['status'](_0x43031f)[_0xab92('0x24')](_0x192a1f);};}exports['index']=function(_0x2be145,_0x501d4b){var _0xdff6b0={},_0x30e79c={},_0x55d106={'count':0x0,'rows':[]};var _0x47a424=db[_0xab92('0x25')][_0xab92('0x26')];_0x30e79c[_0xab92('0x27')]=_[_0xab92('0x28')](_0x47a424);_0x30e79c['query']=_['keys'](_0x2be145[_0xab92('0x29')]);_0x30e79c[_0xab92('0x2a')]=_[_0xab92('0x2b')](_0x30e79c[_0xab92('0x27')],_0x30e79c[_0xab92('0x29')]);_0xdff6b0['attributes']=_[_0xab92('0x2b')](_0x30e79c[_0xab92('0x27')],qs[_0xab92('0x2c')](_0x2be145[_0xab92('0x29')][_0xab92('0x2c')]));_0xdff6b0[_0xab92('0x2d')]=_0xdff6b0['attributes'][_0xab92('0x2e')]?_0xdff6b0[_0xab92('0x2d')]:_0x30e79c[_0xab92('0x27')];if(!_0x2be145[_0xab92('0x29')][_0xab92('0x2f')](_0xab92('0x30'))){_0xdff6b0[_0xab92('0x31')]=qs[_0xab92('0x31')](_0x2be145['query']['limit']);_0xdff6b0['offset']=qs[_0xab92('0x1a')](_0x2be145[_0xab92('0x29')][_0xab92('0x1a')]);}_0xdff6b0[_0xab92('0x32')]=qs[_0xab92('0x33')](_0x2be145[_0xab92('0x29')][_0xab92('0x33')]);_0xdff6b0[_0xab92('0x34')]=qs['filters'](_[_0xab92('0x35')](_0x2be145[_0xab92('0x29')],_0x30e79c[_0xab92('0x2a')]));if(_0x2be145[_0xab92('0x29')][_0xab92('0x36')]){_0xdff6b0[_0xab92('0x34')]=_['merge'](_0xdff6b0['where'],{'$or':_[_0xab92('0x37')](_0x47a424,function(_0x3fb42d){if(_0x3fb42d[_0xab92('0x38')][_0xab92('0x39')]!==_0xab92('0x3a')){var _0x490d3b={};_0x490d3b[_0x3fb42d[_0xab92('0x3b')]]={'$like':'%'+_0x2be145[_0xab92('0x29')]['filter']+'%'};return _0x490d3b;}})});}_0xdff6b0=_[_0xab92('0x3c')]({},_0xdff6b0,_0x2be145['options']);var _0x37a168={'where':_0xdff6b0[_0xab92('0x34')]};return db[_0xab92('0x25')]['count'](_0x37a168)[_0xab92('0x20')](function(_0xc44205){_0x55d106[_0xab92('0x3d')]=_0xc44205;if(_0x2be145[_0xab92('0x29')][_0xab92('0x3e')]){_0xdff6b0['include']=[{'all':!![]}];}return db[_0xab92('0x25')]['findAll'](_0xdff6b0);})[_0xab92('0x20')](function(_0x290464){_0x55d106[_0xab92('0x3f')]=_0x290464;return _0x55d106;})[_0xab92('0x20')](respondWithFilteredResult(_0x501d4b,_0xdff6b0))[_0xab92('0x40')](handleError(_0x501d4b,null));};exports[_0xab92('0x41')]=function(_0x4a35f9,_0x43b8f7){var _0x1dc3c0={'raw':!![],'where':{'id':_0x4a35f9[_0xab92('0x42')]['id']}},_0x5c0250={};_0x5c0250[_0xab92('0x27')]=_['keys'](db['AnalyticTreeReport'][_0xab92('0x26')]);_0x5c0250[_0xab92('0x29')]=_[_0xab92('0x28')](_0x4a35f9[_0xab92('0x29')]);_0x5c0250[_0xab92('0x2a')]=_[_0xab92('0x2b')](_0x5c0250[_0xab92('0x27')],_0x5c0250['query']);_0x1dc3c0[_0xab92('0x2d')]=_[_0xab92('0x2b')](_0x5c0250[_0xab92('0x27')],qs['fields'](_0x4a35f9['query'][_0xab92('0x2c')]));_0x1dc3c0[_0xab92('0x2d')]=_0x1dc3c0[_0xab92('0x2d')][_0xab92('0x2e')]?_0x1dc3c0['attributes']:_0x5c0250['model'];if(_0x4a35f9[_0xab92('0x29')]['includeAll']){_0x1dc3c0[_0xab92('0x43')]=[{'all':!![]}];}_0x1dc3c0=_[_0xab92('0x3c')]({},_0x1dc3c0,_0x4a35f9['options']);return db['AnalyticTreeReport']['find'](_0x1dc3c0)[_0xab92('0x20')](handleEntityNotFound(_0x43b8f7,null))['then'](respondWithResult(_0x43b8f7,null))[_0xab92('0x40')](handleError(_0x43b8f7,null));};exports[_0xab92('0x44')]=function(_0x47c57e,_0x4edd01){return db[_0xab92('0x25')][_0xab92('0x44')](_0x47c57e[_0xab92('0x45')],{})[_0xab92('0x20')](respondWithResult(_0x4edd01,0xc9))[_0xab92('0x40')](handleError(_0x4edd01,null));};exports['update']=function(_0x539a25,_0x3df968){if(_0x539a25[_0xab92('0x45')]['id']){delete _0x539a25[_0xab92('0x45')]['id'];}return db[_0xab92('0x25')]['find']({'where':{'id':_0x539a25[_0xab92('0x42')]['id']}})['then'](handleEntityNotFound(_0x3df968,null))[_0xab92('0x20')](saveUpdates(_0x539a25[_0xab92('0x45')],null))[_0xab92('0x20')](respondWithResult(_0x3df968,null))[_0xab92('0x40')](handleError(_0x3df968,null));};exports[_0xab92('0x21')]=function(_0x5f5c9d,_0x50bc0e){return db[_0xab92('0x25')][_0xab92('0x46')]({'where':{'id':_0x5f5c9d[_0xab92('0x42')]['id']}})['then'](handleEntityNotFound(_0x50bc0e,null))[_0xab92('0x20')](removeEntity(_0x50bc0e,null))[_0xab92('0x40')](handleError(_0x50bc0e,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index d0205fc..e76e5df 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 _0x20f1=['../../config/logger','api','bluebird','request-promise','AnalyticTreeReport','analytics_report_trees','util'];(function(_0x2432eb,_0x37e058){var _0x5f2808=function(_0x386124){while(--_0x386124){_0x2432eb['push'](_0x2432eb['shift']());}};_0x5f2808(++_0x37e058);}(_0x20f1,0x117));var _0x120f=function(_0x5aae53,_0x33c6d4){_0x5aae53=_0x5aae53-0x0;var _0x11a64d=_0x20f1[_0x5aae53];return _0x11a64d;};'use strict';var _=require('lodash');var util=require(_0x120f('0x0'));var logger=require(_0x120f('0x1'))(_0x120f('0x2'));var moment=require('moment');var BPromise=require(_0x120f('0x3'));var rp=require(_0x120f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x5a9769,_0xec59a7){return _0x5a9769['define'](_0x120f('0x5'),attributes,{'tableName':_0x120f('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf5a7=['path','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','api','moment','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf5a7,0x163));var _0x7f5a=function(_0x3a55dc,_0x88f855){_0x3a55dc=_0x3a55dc-0x0;var _0x2e9e74=_0xf5a7[_0x3a55dc];return _0x2e9e74;};'use strict';var _=require(_0x7f5a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7f5a('0x1'));var moment=require(_0x7f5a('0x2'));var BPromise=require(_0x7f5a('0x3'));var rp=require(_0x7f5a('0x4'));var fs=require('fs');var path=require(_0x7f5a('0x5'));var rimraf=require('rimraf');var config=require(_0x7f5a('0x6'));var attributes=require(_0x7f5a('0x7'));module[_0x7f5a('0x8')]=function(_0xaabf76,_0x3f9553){return _0xaabf76[_0x7f5a('0x9')](_0x7f5a('0xa'),attributes,{'tableName':_0x7f5a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index 46539f9..9ec5150 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 _0xeb34=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x574d18,_0x583280){var _0x451c6d=function(_0x1ca139){while(--_0x1ca139){_0x574d18['push'](_0x574d18['shift']());}};_0x451c6d(++_0x583280);}(_0xeb34,0x1f4));var _0x4eb3=function(_0x10dfdf,_0x36b623){_0x10dfdf=_0x10dfdf-0x0;var _0x4d857d=_0xeb34[_0x10dfdf];return _0x4d857d;};'use strict';var _=require(_0x4eb3('0x0'));var util=require(_0x4eb3('0x1'));var moment=require(_0x4eb3('0x2'));var BPromise=require(_0x4eb3('0x3'));var rs=require(_0x4eb3('0x4'));var fs=require('fs');var Redis=require(_0x4eb3('0x5'));var db=require(_0x4eb3('0x6'))['db'];var utils=require(_0x4eb3('0x7'));var logger=require(_0x4eb3('0x8'))(_0x4eb3('0x9'));var config=require(_0x4eb3('0xa'));var jayson=require(_0x4eb3('0xb'));var client=jayson['client'][_0x4eb3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x59d7df,_0x2535fc,_0xd57106){return new BPromise(function(_0x482f09,_0x876e01){return client[_0x4eb3('0xd')](_0x59d7df,_0xd57106)['then'](function(_0xc5fc51){logger[_0x4eb3('0xe')](_0x4eb3('0xf'),_0x2535fc,_0x4eb3('0x10'));logger['debug'](_0x4eb3('0x11'),_0x2535fc,_0x4eb3('0x10'),JSON[_0x4eb3('0x12')](_0xc5fc51));if(_0xc5fc51[_0x4eb3('0x13')]){if(_0xc5fc51[_0x4eb3('0x13')][_0x4eb3('0x14')]===0x1f4){logger[_0x4eb3('0x13')]('AnalyticTreeReport,\x20%s,\x20%s',_0x2535fc,_0xc5fc51['error'][_0x4eb3('0x15')]);return _0x876e01(_0xc5fc51['error'][_0x4eb3('0x15')]);}logger[_0x4eb3('0x13')](_0x4eb3('0xf'),_0x2535fc,_0xc5fc51['error'][_0x4eb3('0x15')]);return _0x482f09(_0xc5fc51[_0x4eb3('0x13')][_0x4eb3('0x15')]);}else{logger[_0x4eb3('0xe')](_0x4eb3('0xf'),_0x2535fc,_0x4eb3('0x10'));_0x482f09(_0xc5fc51[_0x4eb3('0x16')]['message']);}})[_0x4eb3('0x17')](function(_0x5e207a){logger[_0x4eb3('0x13')](_0x4eb3('0xf'),_0x2535fc,_0x5e207a);_0x876e01(_0x5e207a);});});} \ No newline at end of file +var _0x6e7d=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','ioredis'];(function(_0x34532b,_0x5a61e){var _0x560ef4=function(_0xb0e21d){while(--_0xb0e21d){_0x34532b['push'](_0x34532b['shift']());}};_0x560ef4(++_0x5a61e);}(_0x6e7d,0x168));var _0xd6e7=function(_0x5646b8,_0xdac36){_0x5646b8=_0x5646b8-0x0;var _0x5f2776=_0x6e7d[_0x5646b8];return _0x5f2776;};'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(_0xd6e7('0x0'));var db=require(_0xd6e7('0x1'))['db'];var utils=require(_0xd6e7('0x2'));var logger=require(_0xd6e7('0x3'))(_0xd6e7('0x4'));var config=require(_0xd6e7('0x5'));var jayson=require(_0xd6e7('0x6'));var client=jayson[_0xd6e7('0x7')][_0xd6e7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x38850c,_0xf11e4,_0x267e13){return new BPromise(function(_0x222539,_0x405d13){return client[_0xd6e7('0x9')](_0x38850c,_0x267e13)[_0xd6e7('0xa')](function(_0x3ee80f){logger[_0xd6e7('0xb')](_0xd6e7('0xc'),_0xf11e4,_0xd6e7('0xd'));logger[_0xd6e7('0xe')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xf11e4,_0xd6e7('0xd'),JSON['stringify'](_0x3ee80f));if(_0x3ee80f[_0xd6e7('0xf')]){if(_0x3ee80f[_0xd6e7('0xf')]['code']===0x1f4){logger[_0xd6e7('0xf')](_0xd6e7('0xc'),_0xf11e4,_0x3ee80f['error']['message']);return _0x405d13(_0x3ee80f['error'][_0xd6e7('0x10')]);}logger[_0xd6e7('0xf')](_0xd6e7('0xc'),_0xf11e4,_0x3ee80f['error'][_0xd6e7('0x10')]);return _0x222539(_0x3ee80f[_0xd6e7('0xf')]['message']);}else{logger[_0xd6e7('0xb')](_0xd6e7('0xc'),_0xf11e4,_0xd6e7('0xd'));_0x222539(_0x3ee80f[_0xd6e7('0x11')][_0xd6e7('0x10')]);}})[_0xd6e7('0x12')](function(_0x1716aa){logger[_0xd6e7('0xf')]('AnalyticTreeReport,\x20%s,\x20%s',_0xf11e4,_0x1716aa);_0x405d13(_0x1716aa);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 36055ef..d485a33 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 _0xcf67=['get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2dacca,_0x3b55a5){var _0x4e8745=function(_0x4c4515){while(--_0x4c4515){_0x2dacca['push'](_0x2dacca['shift']());}};_0x4e8745(++_0x3b55a5);}(_0xcf67,0x1cd));var _0x7cf6=function(_0x130d82,_0x25f49b){_0x130d82=_0x130d82-0x0;var _0x112070=_0xcf67[_0x130d82];return _0x112070;};'use strict';var multer=require(_0x7cf6('0x0'));var util=require(_0x7cf6('0x1'));var path=require(_0x7cf6('0x2'));var timeout=require('connect-timeout');var express=require(_0x7cf6('0x3'));var router=express['Router']();var auth=require(_0x7cf6('0x4'));var interaction=require(_0x7cf6('0x5'));var config=require(_0x7cf6('0x6'));var controller=require('./analyticTreeReport.controller');router[_0x7cf6('0x7')]('/',auth[_0x7cf6('0x8')](),controller[_0x7cf6('0x9')]);router['get'](_0x7cf6('0xa'),auth['isAuthenticated'](),controller[_0x7cf6('0xb')]);router[_0x7cf6('0xc')]('/',auth[_0x7cf6('0x8')](),controller[_0x7cf6('0xd')]);router[_0x7cf6('0xe')](_0x7cf6('0xa'),auth[_0x7cf6('0x8')](),controller[_0x7cf6('0xf')]);router[_0x7cf6('0x10')](_0x7cf6('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x7cf6('0x11')]=router; \ No newline at end of file +var _0x2f20=['/:id','post','create','put','delete','destroy','multer','util','express','Router','../../components/auth/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index'];(function(_0x2bd8b8,_0x1962ab){var _0x22ef21=function(_0x1304cb){while(--_0x1304cb){_0x2bd8b8['push'](_0x2bd8b8['shift']());}};_0x22ef21(++_0x1962ab);}(_0x2f20,0xc6));var _0x02f2=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x2f20[_0x2aea9e];return _0x430b92;};'use strict';var multer=require(_0x02f2('0x0'));var util=require(_0x02f2('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x02f2('0x2'));var router=express[_0x02f2('0x3')]();var auth=require(_0x02f2('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x02f2('0x5'));var controller=require(_0x02f2('0x6'));router[_0x02f2('0x7')]('/',auth[_0x02f2('0x8')](),controller[_0x02f2('0x9')]);router[_0x02f2('0x7')](_0x02f2('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x02f2('0xb')]('/',auth[_0x02f2('0x8')](),controller[_0x02f2('0xc')]);router[_0x02f2('0xd')](_0x02f2('0xa'),auth[_0x02f2('0x8')](),controller['update']);router[_0x02f2('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x02f2('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 23925ee..23b1abd 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 _0x1988=['exports','STRING','sequelize'];(function(_0x4140ba,_0x44372d){var _0x1d6cc1=function(_0x3a4685){while(--_0x3a4685){_0x4140ba['push'](_0x4140ba['shift']());}};_0x1d6cc1(++_0x44372d);}(_0x1988,0x8c));var _0x8198=function(_0x2912e2,_0x1d4fdc){_0x2912e2=_0x2912e2-0x0;var _0x5bfaee=_0x1988[_0x2912e2];return _0x5bfaee;};'use strict';var Sequelize=require(_0x8198('0x0'));module[_0x8198('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x8198('0x2')]},'type':{'type':Sequelize[_0x8198('0x2')]}}; \ No newline at end of file +var _0xb698=['STRING','sequelize'];(function(_0x3233c3,_0x15e5fa){var _0x36029b=function(_0xe3dd12){while(--_0xe3dd12){_0x3233c3['push'](_0x3233c3['shift']());}};_0x36029b(++_0x15e5fa);}(_0xb698,0x1dd));var _0x8b69=function(_0xe569fa,_0x562197){_0xe569fa=_0xe569fa-0x0;var _0x2b9181=_0xb698[_0xe569fa];return _0x2b9181;};'use strict';var Sequelize=require(_0x8b69('0x0'));module['exports']={'name':{'type':Sequelize[_0x8b69('0x1')]},'basename':{'type':Sequelize[_0x8b69('0x1')]},'type':{'type':Sequelize[_0x8b69('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 304d51d..6602b4c 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 _0xc0d5=['nolimit','limit','order','sort','where','pick','filter','map','type','key','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','find','body','create','file','originalname','filename','mimetype','download','join','basename','html-pdf','eml-format','zip-dir','request-promise','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','Attachment','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty'];(function(_0x2892da,_0x191a40){var _0x28cff2=function(_0x57023d){while(--_0x57023d){_0x2892da['push'](_0x2892da['shift']());}};_0x28cff2(++_0x191a40);}(_0xc0d5,0x159));var _0x5c0d=function(_0x2beff0,_0x55476e){_0x2beff0=_0x2beff0-0x0;var _0x2c26c8=_0xc0d5[_0x2beff0];return _0x2c26c8;};'use strict';var pdf=require(_0x5c0d('0x0'));var emlformat=require(_0x5c0d('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5c0d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5c0d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5c0d('0x4'));var util=require(_0x5c0d('0x5'));var path=require(_0x5c0d('0x6'));var sox=require(_0x5c0d('0x7'));var csv=require('to-csv');var ejs=require(_0x5c0d('0x8'));var fs=require('fs');var _=require(_0x5c0d('0x9'));var squel=require(_0x5c0d('0xa'));var crypto=require(_0x5c0d('0xb'));var jsforce=require(_0x5c0d('0xc'));var deskjs=require(_0x5c0d('0xd'));var toCsv=require(_0x5c0d('0xe'));var querystring=require(_0x5c0d('0xf'));var Papa=require(_0x5c0d('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5c0d('0x11'));var hardwareService=require(_0x5c0d('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x5c0d('0x13'));var db=require(_0x5c0d('0x14'))['db'];function respondWithStatusCode(_0xb00aef,_0x3db4c4){_0x3db4c4=_0x3db4c4||0xcc;return function(_0x153946){if(_0x153946){return _0xb00aef[_0x5c0d('0x15')](_0x3db4c4);}return _0xb00aef[_0x5c0d('0x16')](_0x3db4c4)[_0x5c0d('0x17')]();};}function respondWithResult(_0x552402,_0x58679c){_0x58679c=_0x58679c||0xc8;return function(_0x2c2f7a){if(_0x2c2f7a){return _0x552402[_0x5c0d('0x16')](_0x58679c)['json'](_0x2c2f7a);}};}function respondWithFilteredResult(_0x4dd1c3,_0x15fe3e){return function(_0x25fe93){if(_0x25fe93){var _0x19bba1=_0x25fe93[_0x5c0d('0x18')],_0x214cfb=_0x15fe3e[_0x5c0d('0x19')],_0x582250=_0x15fe3e[_0x5c0d('0x19')]+_0x15fe3e['limit'],_0x1cb73f;if(_0x582250>=_0x19bba1){_0x582250=_0x19bba1;_0x1cb73f=0xc8;}else{_0x1cb73f=0xce;}_0x4dd1c3[_0x5c0d('0x16')](_0x1cb73f);return _0x4dd1c3[_0x5c0d('0x1a')](_0x5c0d('0x1b'),_0x214cfb+'-'+_0x582250+'/'+_0x19bba1)[_0x5c0d('0x1c')](_0x25fe93);}return null;};}function patchUpdates(_0xdcbe8){return function(_0x3e0950){try{jsonpatch[_0x5c0d('0x1d')](_0x3e0950,_0xdcbe8,!![]);}catch(_0x53cb0c){return BPromise[_0x5c0d('0x1e')](_0x53cb0c);}return _0x3e0950[_0x5c0d('0x1f')]();};}function saveUpdates(_0x1fc65,_0x1b9d65){return function(_0x49e881){if(_0x49e881){return _0x49e881[_0x5c0d('0x20')](_0x1fc65)[_0x5c0d('0x21')](function(_0x3518f4){return _0x3518f4;});}return null;};}function removeEntity(_0x4c48d5,_0x3dbf2c){return function(_0x57abae){if(_0x57abae){return _0x57abae[_0x5c0d('0x22')]()[_0x5c0d('0x21')](function(){_0x4c48d5[_0x5c0d('0x16')](0xcc)[_0x5c0d('0x17')]();});}};}function handleEntityNotFound(_0x456648,_0x8ab5d6){return function(_0x50363c){if(!_0x50363c){_0x456648[_0x5c0d('0x15')](0x194);}return _0x50363c;};}function handleError(_0x4c6776,_0x271c95){_0x271c95=_0x271c95||0x1f4;return function(_0x20b527){logger[_0x5c0d('0x23')](_0x20b527[_0x5c0d('0x24')]);if(_0x20b527[_0x5c0d('0x25')]){delete _0x20b527[_0x5c0d('0x25')];}_0x4c6776[_0x5c0d('0x16')](_0x271c95)[_0x5c0d('0x26')](_0x20b527);};}exports[_0x5c0d('0x27')]=function(_0x15070c,_0x2f9835){var _0x39ef10={},_0x52bf3f={},_0x454da0={'count':0x0,'rows':[]};var _0x56fb50=db[_0x5c0d('0x28')]['rawAttributes'];_0x52bf3f['model']=_[_0x5c0d('0x29')](_0x56fb50);_0x52bf3f[_0x5c0d('0x2a')]=_['keys'](_0x15070c[_0x5c0d('0x2a')]);_0x52bf3f[_0x5c0d('0x2b')]=_[_0x5c0d('0x2c')](_0x52bf3f[_0x5c0d('0x2d')],_0x52bf3f[_0x5c0d('0x2a')]);_0x39ef10[_0x5c0d('0x2e')]=_[_0x5c0d('0x2c')](_0x52bf3f[_0x5c0d('0x2d')],qs[_0x5c0d('0x2f')](_0x15070c[_0x5c0d('0x2a')][_0x5c0d('0x2f')]));_0x39ef10[_0x5c0d('0x2e')]=_0x39ef10[_0x5c0d('0x2e')][_0x5c0d('0x30')]?_0x39ef10[_0x5c0d('0x2e')]:_0x52bf3f['model'];if(!_0x15070c[_0x5c0d('0x2a')][_0x5c0d('0x31')](_0x5c0d('0x32'))){_0x39ef10[_0x5c0d('0x33')]=qs['limit'](_0x15070c[_0x5c0d('0x2a')][_0x5c0d('0x33')]);_0x39ef10[_0x5c0d('0x19')]=qs[_0x5c0d('0x19')](_0x15070c[_0x5c0d('0x2a')][_0x5c0d('0x19')]);}_0x39ef10[_0x5c0d('0x34')]=qs[_0x5c0d('0x35')](_0x15070c[_0x5c0d('0x2a')][_0x5c0d('0x35')]);_0x39ef10[_0x5c0d('0x36')]=qs[_0x5c0d('0x2b')](_[_0x5c0d('0x37')](_0x15070c[_0x5c0d('0x2a')],_0x52bf3f[_0x5c0d('0x2b')]));if(_0x15070c['query'][_0x5c0d('0x38')]){_0x39ef10['where']=_['merge'](_0x39ef10[_0x5c0d('0x36')],{'$or':_[_0x5c0d('0x39')](_0x56fb50,function(_0xbade32){if(_0xbade32[_0x5c0d('0x3a')][_0x5c0d('0x3b')]!==_0x5c0d('0x3c')){var _0x257605={};_0x257605[_0xbade32['field']]={'$like':'%'+_0x15070c['query'][_0x5c0d('0x38')]+'%'};return _0x257605;}})});}_0x39ef10=_[_0x5c0d('0x3d')]({},_0x39ef10,_0x15070c[_0x5c0d('0x3e')]);var _0x145a74={'where':_0x39ef10[_0x5c0d('0x36')]};return db['Attachment'][_0x5c0d('0x18')](_0x145a74)[_0x5c0d('0x21')](function(_0x115f0c){_0x454da0[_0x5c0d('0x18')]=_0x115f0c;if(_0x15070c[_0x5c0d('0x2a')][_0x5c0d('0x3f')]){_0x39ef10[_0x5c0d('0x40')]=[{'all':!![]}];}return db['Attachment']['findAll'](_0x39ef10);})[_0x5c0d('0x21')](function(_0x55a493){_0x454da0[_0x5c0d('0x41')]=_0x55a493;return _0x454da0;})[_0x5c0d('0x21')](respondWithFilteredResult(_0x2f9835,_0x39ef10))[_0x5c0d('0x42')](handleError(_0x2f9835,null));};exports[_0x5c0d('0x43')]=function(_0x93aa4d,_0x3abc31){var _0x3f8ed5={'raw':!![],'where':{'id':_0x93aa4d[_0x5c0d('0x44')]['id']}},_0x4869d4={};_0x4869d4[_0x5c0d('0x2d')]=_[_0x5c0d('0x29')](db['Attachment']['rawAttributes']);_0x4869d4[_0x5c0d('0x2a')]=_[_0x5c0d('0x29')](_0x93aa4d[_0x5c0d('0x2a')]);_0x4869d4[_0x5c0d('0x2b')]=_[_0x5c0d('0x2c')](_0x4869d4['model'],_0x4869d4[_0x5c0d('0x2a')]);_0x3f8ed5[_0x5c0d('0x2e')]=_[_0x5c0d('0x2c')](_0x4869d4[_0x5c0d('0x2d')],qs[_0x5c0d('0x2f')](_0x93aa4d[_0x5c0d('0x2a')]['fields']));_0x3f8ed5[_0x5c0d('0x2e')]=_0x3f8ed5[_0x5c0d('0x2e')][_0x5c0d('0x30')]?_0x3f8ed5[_0x5c0d('0x2e')]:_0x4869d4['model'];if(_0x93aa4d[_0x5c0d('0x2a')][_0x5c0d('0x3f')]){_0x3f8ed5[_0x5c0d('0x40')]=[{'all':!![]}];}_0x3f8ed5=_['merge']({},_0x3f8ed5,_0x93aa4d[_0x5c0d('0x3e')]);return db[_0x5c0d('0x28')][_0x5c0d('0x45')](_0x3f8ed5)['then'](handleEntityNotFound(_0x3abc31,null))[_0x5c0d('0x21')](respondWithResult(_0x3abc31,null))[_0x5c0d('0x42')](handleError(_0x3abc31,null));};exports[_0x5c0d('0x20')]=function(_0x469eeb,_0x515ab2){if(_0x469eeb['body']['id']){delete _0x469eeb[_0x5c0d('0x46')]['id'];}return db['Attachment'][_0x5c0d('0x45')]({'where':{'id':_0x469eeb[_0x5c0d('0x44')]['id']}})['then'](handleEntityNotFound(_0x515ab2,null))[_0x5c0d('0x21')](saveUpdates(_0x469eeb[_0x5c0d('0x46')],null))[_0x5c0d('0x21')](respondWithResult(_0x515ab2,null))[_0x5c0d('0x42')](handleError(_0x515ab2,null));};exports[_0x5c0d('0x22')]=function(_0x2ecaba,_0x41df49){return db[_0x5c0d('0x28')][_0x5c0d('0x45')]({'where':{'id':_0x2ecaba['params']['id']}})[_0x5c0d('0x21')](handleEntityNotFound(_0x41df49,null))[_0x5c0d('0x21')](removeEntity(_0x41df49,null))[_0x5c0d('0x42')](handleError(_0x41df49,null));};exports[_0x5c0d('0x47')]=function(_0x9d6cf4,_0x339c16,_0x31f78b){_0x9d6cf4['body'][_0x5c0d('0x25')]=_0x9d6cf4[_0x5c0d('0x48')][_0x5c0d('0x49')];_0x9d6cf4[_0x5c0d('0x46')]['basename']=_0x9d6cf4[_0x5c0d('0x48')][_0x5c0d('0x4a')];_0x9d6cf4[_0x5c0d('0x46')]['type']=_0x9d6cf4[_0x5c0d('0x48')][_0x5c0d('0x4b')];return db[_0x5c0d('0x28')][_0x5c0d('0x47')](_0x9d6cf4[_0x5c0d('0x46')])[_0x5c0d('0x21')](respondWithResult(_0x339c16,0xc9))['catch'](handleError(_0x339c16,null));};exports[_0x5c0d('0x4c')]=function(_0x4be198,_0x42de08,_0x2e27c9){return db[_0x5c0d('0x28')]['findOne']({'where':{'id':_0x4be198[_0x5c0d('0x44')]['id']},'raw':!![]})[_0x5c0d('0x21')](handleEntityNotFound(_0x42de08,null))[_0x5c0d('0x21')](function(_0x52aa9d){if(_0x52aa9d){return _0x42de08[_0x5c0d('0x4c')](path[_0x5c0d('0x4d')](config['root'],'server/files/attachments/',_0x52aa9d[_0x5c0d('0x4e')]));}})[_0x5c0d('0x42')](handleError(_0x42de08,null));}; \ No newline at end of file +var _0xe433=['mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','papaparse','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','then','end','error','stack','name','send','index','rawAttributes','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','Attachment','includeAll','include','findAll','rows','catch','show','params','update','body','find','destroy','create','file','basename','download','findOne','root','server/files/attachments/','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird'];(function(_0x3597f4,_0x16abfd){var _0x4dbf72=function(_0x4f1ecb){while(--_0x4f1ecb){_0x3597f4['push'](_0x3597f4['shift']());}};_0x4dbf72(++_0x16abfd);}(_0xe433,0x1bc));var _0x3e43=function(_0x3ff0b7,_0xb28c3c){_0x3ff0b7=_0x3ff0b7-0x0;var _0x2fa6fc=_0xe433[_0x3ff0b7];return _0x2fa6fc;};'use strict';var pdf=require(_0x3e43('0x0'));var emlformat=require(_0x3e43('0x1'));var rimraf=require(_0x3e43('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3e43('0x3'));var rp=require('request-promise');var moment=require(_0x3e43('0x4'));var BPromise=require(_0x3e43('0x5'));var Mustache=require(_0x3e43('0x6'));var util=require(_0x3e43('0x7'));var path=require(_0x3e43('0x8'));var sox=require(_0x3e43('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x3e43('0xa'));var squel=require(_0x3e43('0xb'));var crypto=require(_0x3e43('0xc'));var jsforce=require(_0x3e43('0xd'));var deskjs=require(_0x3e43('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3e43('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x3e43('0x10'));var logger=require(_0x3e43('0x11'))('api');var utils=require(_0x3e43('0x12'));var config=require(_0x3e43('0x13'));var db=require(_0x3e43('0x14'))['db'];function respondWithStatusCode(_0x3b1172,_0x5d9913){_0x5d9913=_0x5d9913||0xcc;return function(_0x391366){if(_0x391366){return _0x3b1172[_0x3e43('0x15')](_0x5d9913);}return _0x3b1172[_0x3e43('0x16')](_0x5d9913)['end']();};}function respondWithResult(_0x190186,_0x351069){_0x351069=_0x351069||0xc8;return function(_0x241015){if(_0x241015){return _0x190186[_0x3e43('0x16')](_0x351069)[_0x3e43('0x17')](_0x241015);}};}function respondWithFilteredResult(_0xb84bcb,_0x2d1a38){return function(_0x5292c4){if(_0x5292c4){var _0x55f882=_0x5292c4[_0x3e43('0x18')],_0x593cb8=_0x2d1a38[_0x3e43('0x19')],_0x319c27=_0x2d1a38[_0x3e43('0x19')]+_0x2d1a38[_0x3e43('0x1a')],_0x4048e8;if(_0x319c27>=_0x55f882){_0x319c27=_0x55f882;_0x4048e8=0xc8;}else{_0x4048e8=0xce;}_0xb84bcb[_0x3e43('0x16')](_0x4048e8);return _0xb84bcb[_0x3e43('0x1b')](_0x3e43('0x1c'),_0x593cb8+'-'+_0x319c27+'/'+_0x55f882)['json'](_0x5292c4);}return null;};}function patchUpdates(_0x12c84e){return function(_0x3fbb74){try{jsonpatch['apply'](_0x3fbb74,_0x12c84e,!![]);}catch(_0x3dea66){return BPromise[_0x3e43('0x1d')](_0x3dea66);}return _0x3fbb74['save']();};}function saveUpdates(_0x12a3bb,_0x2df963){return function(_0x15b9db){if(_0x15b9db){return _0x15b9db['update'](_0x12a3bb)[_0x3e43('0x1e')](function(_0x3e2fb6){return _0x3e2fb6;});}return null;};}function removeEntity(_0x4f19bc,_0x5e0e38){return function(_0x2edc27){if(_0x2edc27){return _0x2edc27['destroy']()[_0x3e43('0x1e')](function(){_0x4f19bc[_0x3e43('0x16')](0xcc)[_0x3e43('0x1f')]();});}};}function handleEntityNotFound(_0x228a2c,_0x3c11b6){return function(_0x22693d){if(!_0x22693d){_0x228a2c[_0x3e43('0x15')](0x194);}return _0x22693d;};}function handleError(_0x1ce1b4,_0x7b09fa){_0x7b09fa=_0x7b09fa||0x1f4;return function(_0x4fc0e3){logger[_0x3e43('0x20')](_0x4fc0e3[_0x3e43('0x21')]);if(_0x4fc0e3[_0x3e43('0x22')]){delete _0x4fc0e3[_0x3e43('0x22')];}_0x1ce1b4['status'](_0x7b09fa)[_0x3e43('0x23')](_0x4fc0e3);};}exports[_0x3e43('0x24')]=function(_0x57a8c2,_0xcf4694){var _0x7c7c76={},_0x8eff42={},_0x43f579={'count':0x0,'rows':[]};var _0x1b4550=db['Attachment'][_0x3e43('0x25')];_0x8eff42['model']=_[_0x3e43('0x26')](_0x1b4550);_0x8eff42['query']=_[_0x3e43('0x26')](_0x57a8c2[_0x3e43('0x27')]);_0x8eff42[_0x3e43('0x28')]=_[_0x3e43('0x29')](_0x8eff42[_0x3e43('0x2a')],_0x8eff42['query']);_0x7c7c76[_0x3e43('0x2b')]=_[_0x3e43('0x29')](_0x8eff42[_0x3e43('0x2a')],qs['fields'](_0x57a8c2[_0x3e43('0x27')]['fields']));_0x7c7c76[_0x3e43('0x2b')]=_0x7c7c76[_0x3e43('0x2b')][_0x3e43('0x2c')]?_0x7c7c76[_0x3e43('0x2b')]:_0x8eff42[_0x3e43('0x2a')];if(!_0x57a8c2[_0x3e43('0x27')][_0x3e43('0x2d')]('nolimit')){_0x7c7c76[_0x3e43('0x1a')]=qs['limit'](_0x57a8c2[_0x3e43('0x27')][_0x3e43('0x1a')]);_0x7c7c76[_0x3e43('0x19')]=qs[_0x3e43('0x19')](_0x57a8c2[_0x3e43('0x27')][_0x3e43('0x19')]);}_0x7c7c76[_0x3e43('0x2e')]=qs['sort'](_0x57a8c2[_0x3e43('0x27')][_0x3e43('0x2f')]);_0x7c7c76[_0x3e43('0x30')]=qs[_0x3e43('0x28')](_[_0x3e43('0x31')](_0x57a8c2[_0x3e43('0x27')],_0x8eff42[_0x3e43('0x28')]));if(_0x57a8c2[_0x3e43('0x27')][_0x3e43('0x32')]){_0x7c7c76[_0x3e43('0x30')]=_[_0x3e43('0x33')](_0x7c7c76[_0x3e43('0x30')],{'$or':_[_0x3e43('0x34')](_0x1b4550,function(_0x78352d){if(_0x78352d[_0x3e43('0x35')]['key']!==_0x3e43('0x36')){var _0x43b2d4={};_0x43b2d4[_0x78352d['field']]={'$like':'%'+_0x57a8c2[_0x3e43('0x27')]['filter']+'%'};return _0x43b2d4;}})});}_0x7c7c76=_[_0x3e43('0x33')]({},_0x7c7c76,_0x57a8c2[_0x3e43('0x37')]);var _0x19767c={'where':_0x7c7c76[_0x3e43('0x30')]};return db[_0x3e43('0x38')][_0x3e43('0x18')](_0x19767c)[_0x3e43('0x1e')](function(_0x52fc71){_0x43f579[_0x3e43('0x18')]=_0x52fc71;if(_0x57a8c2[_0x3e43('0x27')][_0x3e43('0x39')]){_0x7c7c76[_0x3e43('0x3a')]=[{'all':!![]}];}return db[_0x3e43('0x38')][_0x3e43('0x3b')](_0x7c7c76);})[_0x3e43('0x1e')](function(_0xaa8830){_0x43f579[_0x3e43('0x3c')]=_0xaa8830;return _0x43f579;})[_0x3e43('0x1e')](respondWithFilteredResult(_0xcf4694,_0x7c7c76))[_0x3e43('0x3d')](handleError(_0xcf4694,null));};exports[_0x3e43('0x3e')]=function(_0x26f1f2,_0x5344bc){var _0x3a7261={'raw':!![],'where':{'id':_0x26f1f2[_0x3e43('0x3f')]['id']}},_0x15bd3e={};_0x15bd3e['model']=_['keys'](db['Attachment']['rawAttributes']);_0x15bd3e[_0x3e43('0x27')]=_[_0x3e43('0x26')](_0x26f1f2['query']);_0x15bd3e[_0x3e43('0x28')]=_[_0x3e43('0x29')](_0x15bd3e[_0x3e43('0x2a')],_0x15bd3e[_0x3e43('0x27')]);_0x3a7261[_0x3e43('0x2b')]=_[_0x3e43('0x29')](_0x15bd3e['model'],qs['fields'](_0x26f1f2[_0x3e43('0x27')]['fields']));_0x3a7261[_0x3e43('0x2b')]=_0x3a7261['attributes']['length']?_0x3a7261[_0x3e43('0x2b')]:_0x15bd3e[_0x3e43('0x2a')];if(_0x26f1f2[_0x3e43('0x27')]['includeAll']){_0x3a7261[_0x3e43('0x3a')]=[{'all':!![]}];}_0x3a7261=_[_0x3e43('0x33')]({},_0x3a7261,_0x26f1f2[_0x3e43('0x37')]);return db[_0x3e43('0x38')]['find'](_0x3a7261)[_0x3e43('0x1e')](handleEntityNotFound(_0x5344bc,null))[_0x3e43('0x1e')](respondWithResult(_0x5344bc,null))[_0x3e43('0x3d')](handleError(_0x5344bc,null));};exports[_0x3e43('0x40')]=function(_0x654078,_0x8dce9b){if(_0x654078[_0x3e43('0x41')]['id']){delete _0x654078[_0x3e43('0x41')]['id'];}return db[_0x3e43('0x38')][_0x3e43('0x42')]({'where':{'id':_0x654078[_0x3e43('0x3f')]['id']}})[_0x3e43('0x1e')](handleEntityNotFound(_0x8dce9b,null))['then'](saveUpdates(_0x654078['body'],null))[_0x3e43('0x1e')](respondWithResult(_0x8dce9b,null))['catch'](handleError(_0x8dce9b,null));};exports[_0x3e43('0x43')]=function(_0x5c2105,_0x4d73bd){return db[_0x3e43('0x38')]['find']({'where':{'id':_0x5c2105[_0x3e43('0x3f')]['id']}})[_0x3e43('0x1e')](handleEntityNotFound(_0x4d73bd,null))[_0x3e43('0x1e')](removeEntity(_0x4d73bd,null))['catch'](handleError(_0x4d73bd,null));};exports[_0x3e43('0x44')]=function(_0x3370fb,_0xefcc1f,_0x3e2d97){_0x3370fb['body'][_0x3e43('0x22')]=_0x3370fb[_0x3e43('0x45')]['originalname'];_0x3370fb['body'][_0x3e43('0x46')]=_0x3370fb[_0x3e43('0x45')]['filename'];_0x3370fb[_0x3e43('0x41')][_0x3e43('0x35')]=_0x3370fb[_0x3e43('0x45')]['mimetype'];return db[_0x3e43('0x38')][_0x3e43('0x44')](_0x3370fb[_0x3e43('0x41')])['then'](respondWithResult(_0xefcc1f,0xc9))[_0x3e43('0x3d')](handleError(_0xefcc1f,null));};exports[_0x3e43('0x47')]=function(_0x5b856c,_0x2706a3,_0x41bac3){return db[_0x3e43('0x38')][_0x3e43('0x48')]({'where':{'id':_0x5b856c['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2706a3,null))[_0x3e43('0x1e')](function(_0x13dc8d){if(_0x13dc8d){return _0x2706a3['download'](path['join'](config[_0x3e43('0x49')],_0x3e43('0x4a'),_0x13dc8d[_0x3e43('0x46')]));}})[_0x3e43('0x3d')](handleError(_0x2706a3,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 46b4f1d..b34f842 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 _0xe1f0=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./attachment.attributes','define','Attachment','attachments','util'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0xe1f0,0x1c2));var _0x0e1f=function(_0x9275e3,_0x3991b4){_0x9275e3=_0x9275e3-0x0;var _0x457f3b=_0xe1f0[_0x9275e3];return _0x457f3b;};'use strict';var _=require('lodash');var util=require(_0x0e1f('0x0'));var logger=require(_0x0e1f('0x1'))('api');var moment=require(_0x0e1f('0x2'));var BPromise=require(_0x0e1f('0x3'));var rp=require(_0x0e1f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0e1f('0x5'));var config=require(_0x0e1f('0x6'));var attributes=require(_0x0e1f('0x7'));module['exports']=function(_0x260585,_0x569a5a){return _0x260585[_0x0e1f('0x8')](_0x0e1f('0x9'),attributes,{'tableName':_0x0e1f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x057a=['./attachment.attributes','define','Attachment','attachments','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x057a,0x1a6));var _0xa057=function(_0x484a85,_0x3064ba){_0x484a85=_0x484a85-0x0;var _0x308887=_0x057a[_0x484a85];return _0x308887;};'use strict';var _=require(_0xa057('0x0'));var util=require(_0xa057('0x1'));var logger=require(_0xa057('0x2'))('api');var moment=require(_0xa057('0x3'));var BPromise=require('bluebird');var rp=require(_0xa057('0x4'));var fs=require('fs');var path=require(_0xa057('0x5'));var rimraf=require('rimraf');var config=require(_0xa057('0x6'));var attributes=require(_0xa057('0x7'));module['exports']=function(_0x55b99c,_0x466f7d){return _0x55b99c[_0xa057('0x8')](_0xa057('0x9'),attributes,{'tableName':_0xa057('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index b419d1f..9116110 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 _0xb4e2=['jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateAttachment','Attachment','create','body','options','raw','lodash','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1ea4ef,_0x5a6339){var _0x1c7efc=function(_0x89ce90){while(--_0x89ce90){_0x1ea4ef['push'](_0x1ea4ef['shift']());}};_0x1c7efc(++_0x5a6339);}(_0xb4e2,0x1aa));var _0x2b4e=function(_0x5fb722,_0x15625f){_0x5fb722=_0x5fb722-0x0;var _0x4d2f1d=_0xb4e2[_0x5fb722];return _0x4d2f1d;};'use strict';var _=require(_0x2b4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2b4e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2b4e('0x2'));var logger=require(_0x2b4e('0x3'))(_0x2b4e('0x4'));var config=require(_0x2b4e('0x5'));var jayson=require(_0x2b4e('0x6'));var client=jayson[_0x2b4e('0x7')][_0x2b4e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4a84a9,_0xc18f62,_0x11a6ee){return new BPromise(function(_0x36f83e,_0x36a811){return client[_0x2b4e('0x9')](_0x4a84a9,_0x11a6ee)[_0x2b4e('0xa')](function(_0x3fd14e){logger[_0x2b4e('0xb')](_0x2b4e('0xc'),_0xc18f62,_0x2b4e('0xd'));logger[_0x2b4e('0xe')](_0x2b4e('0xf'),_0xc18f62,_0x2b4e('0xd'),JSON[_0x2b4e('0x10')](_0x3fd14e));if(_0x3fd14e['error']){if(_0x3fd14e[_0x2b4e('0x11')][_0x2b4e('0x12')]===0x1f4){logger[_0x2b4e('0x11')](_0x2b4e('0xc'),_0xc18f62,_0x3fd14e['error'][_0x2b4e('0x13')]);return _0x36a811(_0x3fd14e['error'][_0x2b4e('0x13')]);}logger[_0x2b4e('0x11')](_0x2b4e('0xc'),_0xc18f62,_0x3fd14e[_0x2b4e('0x11')][_0x2b4e('0x13')]);return _0x36f83e(_0x3fd14e[_0x2b4e('0x11')]['message']);}else{logger[_0x2b4e('0xb')](_0x2b4e('0xc'),_0xc18f62,_0x2b4e('0xd'));_0x36f83e(_0x3fd14e['result'][_0x2b4e('0x13')]);}})[_0x2b4e('0x14')](function(_0x4b87ec){logger[_0x2b4e('0x11')]('Attachment,\x20%s,\x20%s',_0xc18f62,_0x4b87ec);_0x36a811(_0x4b87ec);});});}exports[_0x2b4e('0x15')]=function(_0x30b754){var _0xb8b550=this;return new Promise(function(_0x2b9480,_0x275a55){return db[_0x2b4e('0x16')][_0x2b4e('0x17')](_0x30b754[_0x2b4e('0x18')],{'raw':_0x30b754[_0x2b4e('0x19')]?_0x30b754['options'][_0x2b4e('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x4293ae){logger[_0x2b4e('0xb')](_0x2b4e('0x15'),_0x30b754);logger[_0x2b4e('0xe')]('CreateAttachment',_0x30b754,JSON[_0x2b4e('0x10')](_0x4293ae));_0x2b9480(_0x4293ae);})[_0x2b4e('0x14')](function(_0x63c129){logger['error'](_0x2b4e('0x15'),_0x63c129[_0x2b4e('0x13')],_0x30b754);_0x275a55(_0xb8b550['error'](0x1f4,_0x63c129[_0x2b4e('0x13')]));});});}; \ No newline at end of file +var _0x95a6=['create','body','options','CreateAttachment','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','Attachment'];(function(_0x2053ea,_0x1ab2d4){var _0x2232c4=function(_0x4230df){while(--_0x4230df){_0x2053ea['push'](_0x2053ea['shift']());}};_0x2232c4(++_0x1ab2d4);}(_0x95a6,0xe5));var _0x695a=function(_0x4ba632,_0x22e676){_0x4ba632=_0x4ba632-0x0;var _0x247c80=_0x95a6[_0x4ba632];return _0x247c80;};'use strict';var _=require(_0x695a('0x0'));var util=require(_0x695a('0x1'));var moment=require('moment');var BPromise=require(_0x695a('0x2'));var rs=require(_0x695a('0x3'));var fs=require('fs');var Redis=require(_0x695a('0x4'));var db=require(_0x695a('0x5'))['db'];var utils=require(_0x695a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x695a('0x7'));var jayson=require(_0x695a('0x8'));var client=jayson[_0x695a('0x9')][_0x695a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4160bc,_0xa4ea41,_0x27825a){return new BPromise(function(_0x6dd7d7,_0x3846ed){return client['request'](_0x4160bc,_0x27825a)['then'](function(_0x2b4dca){logger[_0x695a('0xb')](_0x695a('0xc'),_0xa4ea41,_0x695a('0xd'));logger[_0x695a('0xe')]('Attachment,\x20%s,\x20%s,\x20%s',_0xa4ea41,_0x695a('0xd'),JSON[_0x695a('0xf')](_0x2b4dca));if(_0x2b4dca[_0x695a('0x10')]){if(_0x2b4dca['error']['code']===0x1f4){logger[_0x695a('0x10')](_0x695a('0xc'),_0xa4ea41,_0x2b4dca[_0x695a('0x10')][_0x695a('0x11')]);return _0x3846ed(_0x2b4dca[_0x695a('0x10')][_0x695a('0x11')]);}logger[_0x695a('0x10')](_0x695a('0xc'),_0xa4ea41,_0x2b4dca[_0x695a('0x10')]['message']);return _0x6dd7d7(_0x2b4dca[_0x695a('0x10')][_0x695a('0x11')]);}else{logger[_0x695a('0xb')](_0x695a('0xc'),_0xa4ea41,_0x695a('0xd'));_0x6dd7d7(_0x2b4dca[_0x695a('0x12')][_0x695a('0x11')]);}})[_0x695a('0x13')](function(_0x29e1e8){logger[_0x695a('0x10')]('Attachment,\x20%s,\x20%s',_0xa4ea41,_0x29e1e8);_0x3846ed(_0x29e1e8);});});}exports['CreateAttachment']=function(_0x2c4d2a){var _0x250d5f=this;return new Promise(function(_0x338aed,_0x119828){return db[_0x695a('0x14')][_0x695a('0x15')](_0x2c4d2a[_0x695a('0x16')],{'raw':_0x2c4d2a[_0x695a('0x17')]?_0x2c4d2a['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x559ab9){logger['info']('CreateAttachment',_0x2c4d2a);logger['debug'](_0x695a('0x18'),_0x2c4d2a,JSON[_0x695a('0xf')](_0x559ab9));_0x338aed(_0x559ab9);})[_0x695a('0x13')](function(_0x14df03){logger[_0x695a('0x10')](_0x695a('0x18'),_0x14df03['message'],_0x2c4d2a);_0x119828(_0x250d5f[_0x695a('0x10')](0x1f4,_0x14df03[_0x695a('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 0b5a290..f9e37a8 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 _0xa1b9=['../../config/environment','get','isAuthenticated','index','/:id/download','download','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','replace','post','single','file','create','put','/:id','update','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x376db5,_0x2b8874){var _0x304c17=function(_0x2dd9ba){while(--_0x2dd9ba){_0x376db5['push'](_0x376db5['shift']());}};_0x304c17(++_0x2b8874);}(_0xa1b9,0x71));var _0x9a1b=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa1b9[_0x3054be];return _0x3df150;};'use strict';var multer=require(_0x9a1b('0x0'));var util=require('util');var path=require(_0x9a1b('0x1'));var timeout=require(_0x9a1b('0x2'));var express=require(_0x9a1b('0x3'));var router=express[_0x9a1b('0x4')]();var auth=require(_0x9a1b('0x5'));var interaction=require(_0x9a1b('0x6'));var config=require(_0x9a1b('0x7'));var controller=require('./attachment.controller');router[_0x9a1b('0x8')]('/',auth[_0x9a1b('0x9')](),controller[_0x9a1b('0xa')]);router[_0x9a1b('0x8')]('/:id',auth[_0x9a1b('0x9')](),controller['show']);router[_0x9a1b('0x8')](_0x9a1b('0xb'),auth[_0x9a1b('0x9')](),controller[_0x9a1b('0xc')]);var upload=multer({'storage':multer[_0x9a1b('0xd')]({'destination':function(_0x497e8c,_0x787b9b,_0x300d48){_0x300d48(null,path[_0x9a1b('0xe')](config[_0x9a1b('0xf')],_0x9a1b('0x10')));},'filename':function(_0xca51cf,_0x19dd59,_0x58c70a){_0x58c70a(null,util[_0x9a1b('0x11')](_0x9a1b('0x12'),Date[_0x9a1b('0x13')](),_0x19dd59['originalname'][_0x9a1b('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x9a1b('0x15')]('/',upload[_0x9a1b('0x16')](_0x9a1b('0x17')),controller[_0x9a1b('0x18')]);router[_0x9a1b('0x19')](_0x9a1b('0x1a'),auth[_0x9a1b('0x9')](),controller[_0x9a1b('0x1b')]);router[_0x9a1b('0x1c')]('/:id',auth[_0x9a1b('0x9')](),controller[_0x9a1b('0x1d')]);module['exports']=router; \ No newline at end of file +var _0xc17f=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','/:id','isAuthenticated','show','/:id/download','diskStorage','server/files/attachments/','format','%s-%s','now','originalname','replace','post','file','create','put'];(function(_0x54bafd,_0x3d73f8){var _0x24b2c3=function(_0x404594){while(--_0x404594){_0x54bafd['push'](_0x54bafd['shift']());}};_0x24b2c3(++_0x3d73f8);}(_0xc17f,0xb8));var _0xfc17=function(_0x1732f3,_0x38c1b4){_0x1732f3=_0x1732f3-0x0;var _0x37354e=_0xc17f[_0x1732f3];return _0x37354e;};'use strict';var multer=require(_0xfc17('0x0'));var util=require(_0xfc17('0x1'));var path=require(_0xfc17('0x2'));var timeout=require(_0xfc17('0x3'));var express=require(_0xfc17('0x4'));var router=express[_0xfc17('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xfc17('0x6'));var config=require(_0xfc17('0x7'));var controller=require(_0xfc17('0x8'));router[_0xfc17('0x9')]('/',auth['isAuthenticated'](),controller[_0xfc17('0xa')]);router[_0xfc17('0x9')](_0xfc17('0xb'),auth[_0xfc17('0xc')](),controller[_0xfc17('0xd')]);router[_0xfc17('0x9')](_0xfc17('0xe'),auth[_0xfc17('0xc')](),controller['download']);var upload=multer({'storage':multer[_0xfc17('0xf')]({'destination':function(_0x1d43ee,_0x343eff,_0x2e722){_0x2e722(null,path['join'](config['root'],_0xfc17('0x10')));},'filename':function(_0x22cbef,_0x2924e9,_0x431f67){_0x431f67(null,util[_0xfc17('0x11')](_0xfc17('0x12'),Date[_0xfc17('0x13')](),_0x2924e9[_0xfc17('0x14')][_0xfc17('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xfc17('0x16')]('/',upload['single'](_0xfc17('0x17')),controller[_0xfc17('0x18')]);router[_0xfc17('0x19')]('/:id',auth[_0xfc17('0xc')](),controller[_0xfc17('0x1a')]);router[_0xfc17('0x1b')](_0xfc17('0xb'),auth[_0xfc17('0xc')](),controller[_0xfc17('0x1c')]);module[_0xfc17('0x1d')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 273f397..fa19d0e 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 _0xc4f5=['emails','user','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','clearBlockUser','getLicense','catch','passport','passport-google-oauth20','Strategy','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','authenticate','google','/login','profile','email','clientID','clientSecret','secret','callbackURL','allowedLoginAttempts','blockDuration','then','User'];(function(_0x461eca,_0x427b1a){var _0x3d6efa=function(_0x4cfb9f){while(--_0x4cfb9f){_0x461eca['push'](_0x461eca['shift']());}};_0x3d6efa(++_0x427b1a);}(_0xc4f5,0xa5));var _0x5c4f=function(_0x5557aa,_0x554f79){_0x5557aa=_0x5557aa-0x0;var _0x4148d6=_0xc4f5[_0x5557aa];return _0x4148d6;};'use strict';var _=require('lodash');var passport=require(_0x5c4f('0x0'));var GoogleStrategy=require(_0x5c4f('0x1'))[_0x5c4f('0x2')];var moment=require('moment');var db=require(_0x5c4f('0x3'))['db'];var config=require(_0x5c4f('0x4'));var signToken=require(_0x5c4f('0x5'))[_0x5c4f('0x6')];var utils=require(_0x5c4f('0x7'));exports['login']=passport[_0x5c4f('0x8')](_0x5c4f('0x9'),{'failureRedirect':_0x5c4f('0xa'),'scope':[_0x5c4f('0xb'),_0x5c4f('0xc')],'session':![]});exports['callback']=passport[_0x5c4f('0x8')]('google',{'failureRedirect':_0x5c4f('0xa'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0x5c4f('0x9')]?config[_0x5c4f('0x9')][_0x5c4f('0xd')]:'id','clientSecret':config[_0x5c4f('0x9')]?config[_0x5c4f('0x9')][_0x5c4f('0xe')]:_0x5c4f('0xf'),'callbackURL':config['google']?config[_0x5c4f('0x9')][_0x5c4f('0x10')]:''},function(_0x5b77ab,_0x22b73b,_0x138495,_0x1d68ac){var _0x3e3c06,_0x376452;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x5c4f('0x11'),_0x5c4f('0x12')],'raw':!![]})[_0x5c4f('0x13')](function(_0x31941b){_0x3e3c06=_0x31941b;return db[_0x5c4f('0x14')]['find']({'where':{'email':_['map'](_0x138495[_0x5c4f('0x15')],'value'),'role':{'$or':['admin',_0x5c4f('0x16'),'agent']}}});})[_0x5c4f('0x13')](function(_0x2cff0f){_0x376452=_0x2cff0f;if(_0x376452){if(_0x376452[_0x5c4f('0x17')]){return _0x1d68ac(_0x5c4f('0x18'));}else if(_0x3e3c06[_0x5c4f('0x12')]>0x0){if(_0x376452[_0x5c4f('0x19')]){if(moment(_0x376452[_0x5c4f('0x1a')])[_0x5c4f('0x1b')](_0x3e3c06[_0x5c4f('0x12')],'minutes')>moment()){return _0x1d68ac(_0x5c4f('0x18'));}else{return utils[_0x5c4f('0x1c')](_0x376452,0x0,![],null)[_0x5c4f('0x13')](function(){return utils[_0x5c4f('0x1d')](_0x376452);})['then'](function(){return _0x1d68ac(null,_0x376452);});}}else{return utils['getLicense'](_0x376452)[_0x5c4f('0x13')](function(){return _0x1d68ac(null,_0x376452);});}}else{return utils[_0x5c4f('0x1d')](_0x376452)[_0x5c4f('0x13')](function(){return _0x1d68ac(null,_0x376452);});}}return _0x1d68ac(_0x5c4f('0x18'));})[_0x5c4f('0x1e')](function(_0x40ce01){_0x1d68ac(_0x40ce01);});})); \ No newline at end of file +var _0x536e=['map','emails','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','minutes','clearBlockUser','getLicense','lodash','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','login','authenticate','google','/login','callback','use','clientID','findOne','allowedLoginAttempts','blockDuration','then','find'];(function(_0x36fa30,_0xf85490){var _0x19c07d=function(_0xbb758){while(--_0xbb758){_0x36fa30['push'](_0x36fa30['shift']());}};_0x19c07d(++_0xf85490);}(_0x536e,0x155));var _0xe536=function(_0x511fad,_0x26cf29){_0x511fad=_0x511fad-0x0;var _0x4b61bd=_0x536e[_0x511fad];return _0x4b61bd;};'use strict';var _=require(_0xe536('0x0'));var passport=require(_0xe536('0x1'));var GoogleStrategy=require(_0xe536('0x2'))[_0xe536('0x3')];var moment=require(_0xe536('0x4'));var db=require(_0xe536('0x5'))['db'];var config=require(_0xe536('0x6'));var signToken=require(_0xe536('0x7'))[_0xe536('0x8')];var utils=require(_0xe536('0x9'));exports[_0xe536('0xa')]=passport[_0xe536('0xb')](_0xe536('0xc'),{'failureRedirect':_0xe536('0xd'),'scope':['profile','email'],'session':![]});exports[_0xe536('0xe')]=passport[_0xe536('0xb')]('google',{'failureRedirect':_0xe536('0xd'),'session':![]});passport[_0xe536('0xf')](new GoogleStrategy({'clientID':config[_0xe536('0xc')]?config[_0xe536('0xc')][_0xe536('0x10')]:'id','clientSecret':config[_0xe536('0xc')]?config[_0xe536('0xc')]['clientSecret']:'secret','callbackURL':config[_0xe536('0xc')]?config[_0xe536('0xc')]['callbackURL']:''},function(_0x3f256f,_0x165551,_0x2d3a64,_0x97e923){var _0x3377aa,_0x2b8a2e;return db['Setting'][_0xe536('0x11')]({'where':{'id':0x1},'attributes':[_0xe536('0x12'),_0xe536('0x13')],'raw':!![]})[_0xe536('0x14')](function(_0x349020){_0x3377aa=_0x349020;return db['User'][_0xe536('0x15')]({'where':{'email':_[_0xe536('0x16')](_0x2d3a64[_0xe536('0x17')],'value'),'role':{'$or':[_0xe536('0x18'),_0xe536('0x19'),_0xe536('0x1a')]}}});})[_0xe536('0x14')](function(_0x4cf519){_0x2b8a2e=_0x4cf519;if(_0x2b8a2e){if(_0x2b8a2e['disabled']){return _0x97e923(_0xe536('0x1b'));}else if(_0x3377aa[_0xe536('0x13')]>0x0){if(_0x2b8a2e[_0xe536('0x1c')]){if(moment(_0x2b8a2e[_0xe536('0x1d')])['add'](_0x3377aa['blockDuration'],_0xe536('0x1e'))>moment()){return _0x97e923(_0xe536('0x1b'));}else{return utils[_0xe536('0x1f')](_0x2b8a2e,0x0,![],null)[_0xe536('0x14')](function(){return utils[_0xe536('0x20')](_0x2b8a2e);})[_0xe536('0x14')](function(){return _0x97e923(null,_0x2b8a2e);});}}else{return utils[_0xe536('0x20')](_0x2b8a2e)[_0xe536('0x14')](function(){return _0x97e923(null,_0x2b8a2e);});}}else{return utils[_0xe536('0x20')](_0x2b8a2e)[_0xe536('0x14')](function(){return _0x97e923(null,_0x2b8a2e);});}}return _0x97e923(_0xe536('0x1b'));})['catch'](function(_0x53f355){_0x97e923(_0x53f355);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index f260254..20fd81b 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 _0x2130=['isMiddleware','setTokenCookie','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','callback'];(function(_0x432d38,_0x201399){var _0x39c577=function(_0x436c2a){while(--_0x436c2a){_0x432d38['push'](_0x432d38['shift']());}};_0x39c577(++_0x201399);}(_0x2130,0xff));var _0x0213=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0x2130[_0xd09668];return _0x68726;};'use strict';var express=require(_0x0213('0x0'));var passport=require(_0x0213('0x1'));var router=express[_0x0213('0x2')]();var controller=require(_0x0213('0x3'));var userController=require(_0x0213('0x4'));var authService=require(_0x0213('0x5'));router[_0x0213('0x6')]('/',controller[_0x0213('0x7')]);router[_0x0213('0x6')]('/callback',controller[_0x0213('0x8')],authService[_0x0213('0x9')],userController[_0x0213('0x7')],authService[_0x0213('0xa')]);module['exports']=router; \ No newline at end of file +var _0x5395=['login','/callback','callback','isMiddleware','setTokenCookie','exports','express','Router','../../components/auth/service','get'];(function(_0x86ed5d,_0x4b46e6){var _0x306f95=function(_0xd93427){while(--_0xd93427){_0x86ed5d['push'](_0x86ed5d['shift']());}};_0x306f95(++_0x4b46e6);}(_0x5395,0x150));var _0x5539=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x5395[_0x42cae2];return _0x5f256f;};'use strict';var express=require(_0x5539('0x0'));var passport=require('passport');var router=express[_0x5539('0x1')]();var controller=require('./authGoogle.controller');var userController=require('../user/user.controller.js');var authService=require(_0x5539('0x2'));router[_0x5539('0x3')]('/',controller[_0x5539('0x4')]);router['get'](_0x5539('0x5'),controller[_0x5539('0x6')],authService[_0x5539('0x7')],userController[_0x5539('0x4')],authService[_0x5539('0x8')]);module[_0x5539('0x9')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index f1cd797..b8741c3 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 _0x68ef=['Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','http://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','resetPasswordToken','Password\x20reset!','use','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','signToken','../../config/utils','client','Setting','blockDuration','then','findOne','password','salt','disabled','blocked','blockedAt','loginAttempts','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','allowedLoginAttempts','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','merge','format','\x22%s\x22\x20<%s>','name','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','send','test','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','json','online','body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset'];(function(_0x2b9cfb,_0x1ff6d6){var _0x40ce80=function(_0x1c93b0){while(--_0x1c93b0){_0x2b9cfb['push'](_0x2b9cfb['shift']());}};_0x40ce80(++_0x1ff6d6);}(_0x68ef,0x102));var _0xf68e=function(_0x27a2b7,_0x551f76){_0x27a2b7=_0x27a2b7-0x0;var _0x2bfba6=_0x68ef[_0x27a2b7];return _0x2bfba6;};'use strict';var util=require('util');var passport=require(_0xf68e('0x0'));var LocalStrategy=require(_0xf68e('0x1'))[_0xf68e('0x2')];var jayson=require(_0xf68e('0x3'));var _=require(_0xf68e('0x4'));var rs=require(_0xf68e('0x5'));var moment=require(_0xf68e('0x6'));var db=require(_0xf68e('0x7'))['db'];var signToken=require(_0xf68e('0x8'))[_0xf68e('0x9')];var utils=require(_0xf68e('0xa'));var client=jayson[_0xf68e('0xb')]['http']({'port':0x232b});function localAuthenticate(_0x1a4c90,_0x2d144e,_0x2fb977,_0x342bdb){var _0x443710,_0x5e239c;return db[_0xf68e('0xc')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xf68e('0xd')],'raw':!![]})[_0xf68e('0xe')](function(_0x447187){_0x443710=_0x447187;return _0x1a4c90[_0xf68e('0xf')]({'attributes':['id','name',_0xf68e('0x10'),_0xf68e('0x11'),'role',_0xf68e('0x12'),_0xf68e('0x13'),_0xf68e('0x14'),_0xf68e('0x15')],'where':{'name':_0x2d144e,'role':{'$or':['admin',_0xf68e('0x16'),_0xf68e('0x17')]}}});})['then'](function(_0x343a27){if(!_0x343a27||_0x343a27&&_0x343a27['name']!==_0x2d144e){throw new Error(_0xf68e('0x18'));}else{_0x5e239c=_0x343a27;return _0x5e239c;}})[_0xf68e('0xe')](function(){_0x5e239c[_0xf68e('0x19')](_0x2fb977,function(_0x17f830,_0x288a7a){var _0x3ea2e2=_0x5e239c[_0xf68e('0x15')]+0x1;if(_0x17f830){return _0x342bdb(_0x17f830);}else if(!_0x288a7a){if(_0x5e239c['disabled']){return _0x342bdb(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x443710[_0xf68e('0x1a')]>0x0){if(_0x5e239c[_0xf68e('0x13')]){if(_0x443710[_0xf68e('0xd')]>0x0){if(moment(_0x5e239c[_0xf68e('0x14')])[_0xf68e('0x1b')](_0x443710[_0xf68e('0xd')],_0xf68e('0x1c'))>moment()){return _0x342bdb(null,![],{'message':_0xf68e('0x18')});}else{return utils['clearBlockUser'](_0x5e239c,_0x3ea2e2,![],null)[_0xf68e('0xe')](function(){return _0x342bdb(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x342bdb(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x3ea2e2>=_0x443710[_0xf68e('0x1a')]){return utils[_0xf68e('0x1d')](_0x5e239c,0x0,!![],moment())[_0xf68e('0xe')](function(){return _0x342bdb(null,![],{'message':_0xf68e('0x18')});});}else{return utils['clearBlockUser'](_0x5e239c,_0x3ea2e2,![],null)['then'](function(){return _0x342bdb(null,![],{'message':_0xf68e('0x18')});});}}}else{return _0x342bdb(null,![],{'message':_0xf68e('0x18')});}}else{if(_0x5e239c[_0xf68e('0x12')]){return _0x342bdb(null,![],{'message':_0xf68e('0x18')});}else if(_0x443710['allowedLoginAttempts']>0x0){if(_0x5e239c['blocked']){if(_0x443710[_0xf68e('0xd')]>0x0){if(moment(_0x5e239c[_0xf68e('0x14')])['add'](_0x443710[_0xf68e('0xd')],_0xf68e('0x1c'))>moment()){return _0x342bdb(null,![],{'message':_0xf68e('0x18')});}else{return utils[_0xf68e('0x1d')](_0x5e239c,0x0,![],null)[_0xf68e('0xe')](function(){return utils['getLicense'](_0x5e239c);})[_0xf68e('0xe')](function(){return _0x342bdb(null,_0x5e239c);});}}else{return _0x342bdb(null,![],{'message':_0xf68e('0x18')});}}else{return utils[_0xf68e('0x1d')](_0x5e239c,0x0,![],null)['then'](function(){return utils[_0xf68e('0x1e')](_0x5e239c);})['then'](function(){return _0x342bdb(null,_0x5e239c);})[_0xf68e('0x1f')](function(_0x208560){return _0x342bdb(null,![],_0x208560);});}}else{if(_0x5e239c[_0xf68e('0x13')]){return _0x342bdb(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xf68e('0x1e')](_0x5e239c)[_0xf68e('0xe')](function(){return _0x342bdb(null,_0x5e239c);});}}}});})[_0xf68e('0x1f')](function(_0x1eae9d){return _0x342bdb(null,![],_0x1eae9d);});}function sendServiceMail(_0x4e959c){return db[_0xf68e('0x20')][_0xf68e('0x21')]({'where':{'service':!![]},'attributes':['id','name',_0xf68e('0x22')],'include':[{'model':db[_0xf68e('0x23')],'as':_0xf68e('0x24')}]})[_0xf68e('0xe')](function(_0x209f33){if(!_0x209f33){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x723111={'tls':{'rejectUnauthorized':![]}};if(_0x209f33['Smtp'][_0xf68e('0x25')]){_0x723111['service']=_0x209f33[_0xf68e('0x24')][_0xf68e('0x25')];}else{_0x723111[_0xf68e('0x26')]=_0x209f33[_0xf68e('0x24')][_0xf68e('0x26')];_0x723111['port']=_0x209f33['Smtp'][_0xf68e('0x27')];_0x723111['secure']=_0x209f33[_0xf68e('0x24')][_0xf68e('0x28')];}if(_0x209f33[_0xf68e('0x24')][_0xf68e('0x29')]){_0x723111[_0xf68e('0x2a')]={'user':_0x209f33[_0xf68e('0x24')][_0xf68e('0x16')],'pass':_0x209f33[_0xf68e('0x24')][_0xf68e('0x2b')]};}var _0x55bfd0={'account':_0x723111,'message':_[_0xf68e('0x2c')]({'from':util[_0xf68e('0x2d')](_0xf68e('0x2e'),_0x209f33[_0xf68e('0x2f')],_0x209f33['email']||_0x209f33['Smtp']['user'])},_0x4e959c)};return client[_0xf68e('0x30')]('SendMail',_0x55bfd0);})['then'](function(_0x6ecc6b){if(_0x6ecc6b[_0xf68e('0x31')]){throw new Error(util['format'](_0xf68e('0x32'),_0x6ecc6b[_0xf68e('0x31')][_0xf68e('0x33')]||JSON['stringify'](_0x6ecc6b[_0xf68e('0x31')])));}return!![];});}function handleError(_0x1e18eb,_0x39c3a7,_0x501b62){return _0x1e18eb['status'](_0x39c3a7||0x1f4)[_0xf68e('0x34')]({'message':_0x501b62?_0x501b62[_0xf68e('0x33')]||_0x501b62:''});}function checkPasswordPattern(_0x2f090c,_0x5722b6,_0x203eff){if(_0x203eff){var _0x20a529=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x20a529[_0xf68e('0x35')](_0x5722b6)){return _0x2f090c;}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 _0x2f090c;}}exports['login']=function(_0x45e927,_0x4f199a,_0x1b3fa2){passport[_0xf68e('0x19')](_0xf68e('0x36'),function(_0x59aa19,_0x2c68e4,_0x3ca79d){var _0x1a0b5a=_0x59aa19||_0x3ca79d;if(_0x1a0b5a){return handleError(_0x4f199a,0x191,_0x1a0b5a);}if(!_0x2c68e4){return handleError(_0x4f199a,0x194,{'message':_0xf68e('0x37')});}else{var _0xf3aaa0=signToken(_0x2c68e4['id'],_0x2c68e4[_0xf68e('0x38')]);_0x4f199a[_0xf68e('0x39')]({'id':_0x2c68e4['id'],'token':_0xf3aaa0,'statusCall':'','isAlreadyLogged':_0x2c68e4[_0xf68e('0x3a')]});}})(_0x45e927,_0x4f199a,_0x1b3fa2);};exports['forgot']=function(_0x26ed81,_0x48458e,_0x2ff5c0){if(!_0x26ed81[_0xf68e('0x3b')][_0xf68e('0x22')]){return handleError(_0x48458e,0x1f4,{'message':_0xf68e('0x3c')});}var _0x54f42e=rs['generate']();_0x26ed81[_0xf68e('0x3b')][_0xf68e('0x22')]=_0x26ed81['body'][_0xf68e('0x22')][_0xf68e('0x3d')]()[_0xf68e('0x3e')]();var _0x4f2b3c;return db[_0xf68e('0xc')]['findOne']({'where':{'id':0x1},'attributes':[_0xf68e('0x1a'),'blockDuration'],'raw':!![]})[_0xf68e('0xe')](function(_0x1e8ce9){_0x4f2b3c=_0x1e8ce9;return db[_0xf68e('0x3f')][_0xf68e('0x21')]({'where':{'email':_0x26ed81[_0xf68e('0x3b')][_0xf68e('0x22')]}});})[_0xf68e('0xe')](function(_0x3ddbc7){if(!_0x3ddbc7){throw new Error(_0xf68e('0x40'));}if(_0x3ddbc7['disabled']){throw new Error(_0xf68e('0x41'));}if(_0x3ddbc7[_0xf68e('0x13')]){if(moment(_0x3ddbc7[_0xf68e('0x14')])[_0xf68e('0x1b')](_0x4f2b3c[_0xf68e('0xd')],'minutes')>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x3ddbc7[_0xf68e('0x13')]=![];_0x3ddbc7[_0xf68e('0x14')]=null;}}_0x3ddbc7['resetPasswordToken']=_0x54f42e;_0x3ddbc7[_0xf68e('0x42')]=Date[_0xf68e('0x43')]()+0x36ee80;return _0x3ddbc7[_0xf68e('0x44')]();})[_0xf68e('0xe')](function(){return sendServiceMail({'to':_0x26ed81[_0xf68e('0x3b')][_0xf68e('0x22')],'subject':_0xf68e('0x45'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0xf68e('0x46')+_0xf68e('0x47')+_0x26ed81[_0xf68e('0x48')][_0xf68e('0x26')]+'/reset/'+_0x54f42e+'\x0a\x0a'+_0xf68e('0x49')});})[_0xf68e('0xe')](function(){_0x48458e[_0xf68e('0x4a')](0xc8)[_0xf68e('0x34')]({'message':'Reset\x20Email\x20sent!'});})[_0xf68e('0x1f')](function(_0x2d885f){return handleError(_0x48458e,0x1f4,_0x2d885f);});};exports['reset']=function(_0x5c156f,_0x2724a5,_0x2f8210){var _0x129b4a;return db['User'][_0xf68e('0x21')]({'where':{'resetPasswordToken':_0x5c156f[_0xf68e('0x4b')][_0xf68e('0x4c')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0xf68e('0xe')](function(_0x2038d){_0x129b4a=_0x2038d;if(!_0x129b4a){throw new Error(_0xf68e('0x4d'));}return db[_0xf68e('0xc')]['findOne']({'attributes':['id',_0xf68e('0x4e')]});})[_0xf68e('0xe')](function(_0x20a15e){return checkPasswordPattern(_0x20a15e,_0x5c156f['body']['password'],_0x20a15e[_0xf68e('0x4e')]);})['then'](function(){_0x129b4a['password']=_0x5c156f['body'][_0xf68e('0x10')];_0x129b4a[_0xf68e('0x4f')]=null;_0x129b4a[_0xf68e('0x42')]=null;return _0x129b4a['save']();})[_0xf68e('0xe')](function(){_0x2724a5[_0xf68e('0x4a')](0xc8)[_0xf68e('0x34')]({'message':_0xf68e('0x50')});})[_0xf68e('0x1f')](function(_0x327fde){return handleError(_0x2724a5,0x1f4,_0x327fde);});};passport[_0xf68e('0x51')](new LocalStrategy({'usernameField':_0xf68e('0x2f'),'passwordField':'password'},function(_0x2c2fc7,_0x431be4,_0x249627){return localAuthenticate(db[_0xf68e('0x3f')],_0x2c2fc7,_0x431be4,_0x249627);})); \ No newline at end of file +var _0x7308=['minutes','getLicense','catch','MailAccount','find','email','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','port','secure','authentication','auth','pass','merge','format','error','message','stringify','status','send','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','forgot','Email\x20parameter\x20is\x20missing','generate','body','trim','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','/reset/','Reset\x20Email\x20sent!','User','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','resetPasswordToken','Password\x20reset!','passport','passport-local','jayson/promise','randomstring','moment','../../mysqldb','../../components/auth/service','signToken','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','then','name','password','salt','role','disabled','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','add','clearBlockUser','blocked','blockedAt'];(function(_0x2f202e,_0x5ed293){var _0x398ac6=function(_0x49bda9){while(--_0x49bda9){_0x2f202e['push'](_0x2f202e['shift']());}};_0x398ac6(++_0x5ed293);}(_0x7308,0x7f));var _0x8730=function(_0x10c52d,_0x508e20){_0x10c52d=_0x10c52d-0x0;var _0x4df380=_0x7308[_0x10c52d];return _0x4df380;};'use strict';var util=require('util');var passport=require(_0x8730('0x0'));var LocalStrategy=require(_0x8730('0x1'))['Strategy'];var jayson=require(_0x8730('0x2'));var _=require('lodash');var rs=require(_0x8730('0x3'));var moment=require(_0x8730('0x4'));var db=require(_0x8730('0x5'))['db'];var signToken=require(_0x8730('0x6'))[_0x8730('0x7')];var utils=require(_0x8730('0x8'));var client=jayson[_0x8730('0x9')][_0x8730('0xa')]({'port':0x232b});function localAuthenticate(_0x489894,_0x545757,_0x30bdda,_0x47acb8){var _0x4c305e,_0x314cab;return db[_0x8730('0xb')][_0x8730('0xc')]({'where':{'id':0x1},'attributes':[_0x8730('0xd'),'blockDuration'],'raw':!![]})[_0x8730('0xe')](function(_0x70e114){_0x4c305e=_0x70e114;return _0x489894[_0x8730('0xc')]({'attributes':['id',_0x8730('0xf'),_0x8730('0x10'),_0x8730('0x11'),_0x8730('0x12'),_0x8730('0x13'),'blocked','blockedAt',_0x8730('0x14')],'where':{'name':_0x545757,'role':{'$or':[_0x8730('0x15'),_0x8730('0x16'),_0x8730('0x17')]}}});})['then'](function(_0x491fd6){if(!_0x491fd6||_0x491fd6&&_0x491fd6[_0x8730('0xf')]!==_0x545757){throw new Error(_0x8730('0x18'));}else{_0x314cab=_0x491fd6;return _0x314cab;}})[_0x8730('0xe')](function(){_0x314cab[_0x8730('0x19')](_0x30bdda,function(_0x47f26f,_0x4d278f){var _0x53dd95=_0x314cab[_0x8730('0x14')]+0x1;if(_0x47f26f){return _0x47acb8(_0x47f26f);}else if(!_0x4d278f){if(_0x314cab[_0x8730('0x13')]){return _0x47acb8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x4c305e[_0x8730('0xd')]>0x0){if(_0x314cab['blocked']){if(_0x4c305e[_0x8730('0x1a')]>0x0){if(moment(_0x314cab['blockedAt'])[_0x8730('0x1b')](_0x4c305e[_0x8730('0x1a')],'minutes')>moment()){return _0x47acb8(null,![],{'message':_0x8730('0x18')});}else{return utils['clearBlockUser'](_0x314cab,_0x53dd95,![],null)[_0x8730('0xe')](function(){return _0x47acb8(null,![],{'message':_0x8730('0x18')});});}}else{return _0x47acb8(null,![],{'message':_0x8730('0x18')});}}else{if(_0x53dd95>=_0x4c305e[_0x8730('0xd')]){return utils[_0x8730('0x1c')](_0x314cab,0x0,!![],moment())[_0x8730('0xe')](function(){return _0x47acb8(null,![],{'message':_0x8730('0x18')});});}else{return utils['clearBlockUser'](_0x314cab,_0x53dd95,![],null)[_0x8730('0xe')](function(){return _0x47acb8(null,![],{'message':_0x8730('0x18')});});}}}else{return _0x47acb8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x314cab[_0x8730('0x13')]){return _0x47acb8(null,![],{'message':_0x8730('0x18')});}else if(_0x4c305e[_0x8730('0xd')]>0x0){if(_0x314cab[_0x8730('0x1d')]){if(_0x4c305e['blockDuration']>0x0){if(moment(_0x314cab[_0x8730('0x1e')])[_0x8730('0x1b')](_0x4c305e['blockDuration'],_0x8730('0x1f'))>moment()){return _0x47acb8(null,![],{'message':_0x8730('0x18')});}else{return utils['clearBlockUser'](_0x314cab,0x0,![],null)[_0x8730('0xe')](function(){return utils[_0x8730('0x20')](_0x314cab);})[_0x8730('0xe')](function(){return _0x47acb8(null,_0x314cab);});}}else{return _0x47acb8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x8730('0x1c')](_0x314cab,0x0,![],null)[_0x8730('0xe')](function(){return utils['getLicense'](_0x314cab);})[_0x8730('0xe')](function(){return _0x47acb8(null,_0x314cab);})[_0x8730('0x21')](function(_0x3b5341){return _0x47acb8(null,![],_0x3b5341);});}}else{if(_0x314cab[_0x8730('0x1d')]){return _0x47acb8(null,![],{'message':_0x8730('0x18')});}else{return utils[_0x8730('0x20')](_0x314cab)[_0x8730('0xe')](function(){return _0x47acb8(null,_0x314cab);});}}}});})[_0x8730('0x21')](function(_0x3bef82){return _0x47acb8(null,![],_0x3bef82);});}function sendServiceMail(_0x39a965){return db[_0x8730('0x22')][_0x8730('0x23')]({'where':{'service':!![]},'attributes':['id',_0x8730('0xf'),_0x8730('0x24')],'include':[{'model':db[_0x8730('0x25')],'as':'Smtp'}]})[_0x8730('0xe')](function(_0x286c8a){if(!_0x286c8a){throw new Error(_0x8730('0x26'));}var _0x377f1d={'tls':{'rejectUnauthorized':![]}};if(_0x286c8a[_0x8730('0x27')][_0x8730('0x28')]){_0x377f1d['service']=_0x286c8a[_0x8730('0x27')]['service'];}else{_0x377f1d[_0x8730('0x29')]=_0x286c8a['Smtp'][_0x8730('0x29')];_0x377f1d[_0x8730('0x2a')]=_0x286c8a[_0x8730('0x27')]['port'];_0x377f1d[_0x8730('0x2b')]=_0x286c8a[_0x8730('0x27')][_0x8730('0x2b')];}if(_0x286c8a[_0x8730('0x27')][_0x8730('0x2c')]){_0x377f1d[_0x8730('0x2d')]={'user':_0x286c8a[_0x8730('0x27')][_0x8730('0x16')],'pass':_0x286c8a[_0x8730('0x27')][_0x8730('0x2e')]};}var _0x446392={'account':_0x377f1d,'message':_[_0x8730('0x2f')]({'from':util[_0x8730('0x30')]('\x22%s\x22\x20<%s>',_0x286c8a[_0x8730('0xf')],_0x286c8a['email']||_0x286c8a[_0x8730('0x27')]['user'])},_0x39a965)};return client['request']('SendMail',_0x446392);})['then'](function(_0x296a3a){if(_0x296a3a[_0x8730('0x31')]){throw new Error(util[_0x8730('0x30')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x296a3a['error'][_0x8730('0x32')]||JSON[_0x8730('0x33')](_0x296a3a['error'])));}return!![];});}function handleError(_0x1cf77a,_0x349e38,_0x5b36a4){return _0x1cf77a[_0x8730('0x34')](_0x349e38||0x1f4)[_0x8730('0x35')]({'message':_0x5b36a4?_0x5b36a4[_0x8730('0x32')]||_0x5b36a4:''});}function checkPasswordPattern(_0x563f4e,_0x1ede25,_0x28403a){if(_0x28403a){var _0x3aa036=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3aa036['test'](_0x1ede25)){return _0x563f4e;}else{throw new Error(_0x8730('0x36'));}}else{return _0x563f4e;}}exports[_0x8730('0x37')]=function(_0x1d3bdd,_0x335eec,_0x56ca93){passport[_0x8730('0x19')]('local',function(_0x5687d3,_0x201025,_0x49ad61){var _0x928cf4=_0x5687d3||_0x49ad61;if(_0x928cf4){return handleError(_0x335eec,0x191,_0x928cf4);}if(!_0x201025){return handleError(_0x335eec,0x194,{'message':_0x8730('0x38')});}else{var _0x781ed=signToken(_0x201025['id'],_0x201025[_0x8730('0x12')]);_0x335eec[_0x8730('0x39')]({'id':_0x201025['id'],'token':_0x781ed,'statusCall':'','isAlreadyLogged':_0x201025['online']});}})(_0x1d3bdd,_0x335eec,_0x56ca93);};exports[_0x8730('0x3a')]=function(_0x1f4b75,_0x1cee46,_0x3ae22f){if(!_0x1f4b75['body'][_0x8730('0x24')]){return handleError(_0x1cee46,0x1f4,{'message':_0x8730('0x3b')});}var _0x779a6a=rs[_0x8730('0x3c')]();_0x1f4b75['body']['email']=_0x1f4b75[_0x8730('0x3d')]['email'][_0x8730('0x3e')]()['toLowerCase']();var _0x48d209;return db[_0x8730('0xb')][_0x8730('0xc')]({'where':{'id':0x1},'attributes':[_0x8730('0xd'),_0x8730('0x1a')],'raw':!![]})[_0x8730('0xe')](function(_0x36ece7){_0x48d209=_0x36ece7;return db['User'][_0x8730('0x23')]({'where':{'email':_0x1f4b75[_0x8730('0x3d')][_0x8730('0x24')]}});})[_0x8730('0xe')](function(_0x4bf8aa){if(!_0x4bf8aa){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x4bf8aa['disabled']){throw new Error(_0x8730('0x3f'));}if(_0x4bf8aa[_0x8730('0x1d')]){if(moment(_0x4bf8aa['blockedAt'])[_0x8730('0x1b')](_0x48d209['blockDuration'],_0x8730('0x1f'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x4bf8aa[_0x8730('0x1d')]=![];_0x4bf8aa[_0x8730('0x1e')]=null;}}_0x4bf8aa['resetPasswordToken']=_0x779a6a;_0x4bf8aa[_0x8730('0x40')]=Date[_0x8730('0x41')]()+0x36ee80;return _0x4bf8aa[_0x8730('0x42')]();})['then'](function(){return sendServiceMail({'to':_0x1f4b75[_0x8730('0x3d')][_0x8730('0x24')],'subject':_0x8730('0x43'),'text':_0x8730('0x44')+_0x8730('0x45')+'http://'+_0x1f4b75['headers']['host']+_0x8730('0x46')+_0x779a6a+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x8730('0xe')](function(){_0x1cee46[_0x8730('0x34')](0xc8)[_0x8730('0x35')]({'message':_0x8730('0x47')});})[_0x8730('0x21')](function(_0x2fcaa5){return handleError(_0x1cee46,0x1f4,_0x2fcaa5);});};exports['reset']=function(_0x13a911,_0x9880b4,_0x369844){var _0x2b5c38;return db[_0x8730('0x48')][_0x8730('0x23')]({'where':{'resetPasswordToken':_0x13a911[_0x8730('0x49')][_0x8730('0x4a')],'resetPasswordExpires':{'$gt':Date[_0x8730('0x41')]()}}})[_0x8730('0xe')](function(_0x364063){_0x2b5c38=_0x364063;if(!_0x2b5c38){throw new Error(_0x8730('0x4b'));}return db[_0x8730('0xb')][_0x8730('0xc')]({'attributes':['id',_0x8730('0x4c')]});})['then'](function(_0x482f5c){return checkPasswordPattern(_0x482f5c,_0x13a911[_0x8730('0x3d')][_0x8730('0x10')],_0x482f5c[_0x8730('0x4c')]);})['then'](function(){_0x2b5c38[_0x8730('0x10')]=_0x13a911[_0x8730('0x3d')][_0x8730('0x10')];_0x2b5c38[_0x8730('0x4d')]=null;_0x2b5c38[_0x8730('0x40')]=null;return _0x2b5c38[_0x8730('0x42')]();})[_0x8730('0xe')](function(){_0x9880b4[_0x8730('0x34')](0xc8)[_0x8730('0x35')]({'message':_0x8730('0x4e')});})[_0x8730('0x21')](function(_0x3b4640){return handleError(_0x9880b4,0x1f4,_0x3b4640);});};passport['use'](new LocalStrategy({'usernameField':_0x8730('0xf'),'passwordField':'password'},function(_0x20f608,_0x4ac608,_0x4bfd5f){return localAuthenticate(db['User'],_0x20f608,_0x4ac608,_0x4bfd5f);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 459ed53..b188476 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 _0xb1fa=['post','login','/forgot','forgot','/reset/:token','reset','exports','express','./authLocal.controller'];(function(_0x2fdf09,_0x37eccb){var _0x1457fb=function(_0x5a13fa){while(--_0x5a13fa){_0x2fdf09['push'](_0x2fdf09['shift']());}};_0x1457fb(++_0x37eccb);}(_0xb1fa,0x18a));var _0xab1f=function(_0x6db1ed,_0x4e0130){_0x6db1ed=_0x6db1ed-0x0;var _0x4fae3b=_0xb1fa[_0x6db1ed];return _0x4fae3b;};'use strict';var express=require(_0xab1f('0x0'));var router=express['Router']();var controller=require(_0xab1f('0x1'));router[_0xab1f('0x2')]('/',controller[_0xab1f('0x3')]);router[_0xab1f('0x2')](_0xab1f('0x4'),controller[_0xab1f('0x5')]);router['post'](_0xab1f('0x6'),controller[_0xab1f('0x7')]);module[_0xab1f('0x8')]=router; \ No newline at end of file +var _0x125c=['Router','./authLocal.controller','post','login','/forgot','reset','exports'];(function(_0x163291,_0xe707a8){var _0x3646ea=function(_0x3931e2){while(--_0x3931e2){_0x163291['push'](_0x163291['shift']());}};_0x3646ea(++_0xe707a8);}(_0x125c,0x1e3));var _0xc125=function(_0x19dc0b,_0x3c889d){_0x19dc0b=_0x19dc0b-0x0;var _0x15fa17=_0x125c[_0x19dc0b];return _0x15fa17;};'use strict';var express=require('express');var router=express[_0xc125('0x0')]();var controller=require(_0xc125('0x1'));router[_0xc125('0x2')]('/',controller[_0xc125('0x3')]);router['post'](_0xc125('0x4'),controller['forgot']);router[_0xc125('0x2')]('/reset/:token',controller[_0xc125('0x5')]);module[_0xc125('0x6')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 2c2861c..a09b99f 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 _0xe6f1=['INTEGER','sequelize','STRING'];(function(_0x5dbb84,_0x1bbce9){var _0x1d6eae=function(_0xd93967){while(--_0xd93967){_0x5dbb84['push'](_0x5dbb84['shift']());}};_0x1d6eae(++_0x1bbce9);}(_0xe6f1,0x19c));var _0x1e6f=function(_0x34cc9f,_0x4d891a){_0x34cc9f=_0x34cc9f-0x0;var _0x1991d3=_0xe6f1[_0x34cc9f];return _0x1991d3;};'use strict';var Sequelize=require(_0x1e6f('0x0'));module['exports']={'name':{'type':Sequelize[_0x1e6f('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1e6f('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x1e6f('0x2')],'defaultValue':0xa}}; \ No newline at end of file +var _0x1619=['STRING','BOOLEAN','INTEGER'];(function(_0x22d8da,_0x46234c){var _0x4adf95=function(_0x3bd9b2){while(--_0x3bd9b2){_0x22d8da['push'](_0x22d8da['shift']());}};_0x4adf95(++_0x46234c);}(_0x1619,0x189));var _0x9161=function(_0x2e7841,_0x3d4e57){_0x2e7841=_0x2e7841-0x0;var _0xd0b064=_0x1619[_0x2e7841];return _0xd0b064;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9161('0x0')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9161('0x0')]},'status':{'type':Sequelize[_0x9161('0x1')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x9161('0x2')],'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 e3d042a..179cd33 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 _0x497b=['../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','update','destroy','then','end','stack','name','index','rawAttributes','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','where','map','type','key','VIRTUAL','field','merge','Automation','includeAll','include','findAll','rows','catch','show','params','options','find','body','Condition','addConditions','ids','omit','getConditions','findOne','order','sort','pick','filter','Action','addActions','getActions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils'];(function(_0x59e27a,_0x5b404e){var _0x3b452f=function(_0x398db3){while(--_0x398db3){_0x59e27a['push'](_0x59e27a['shift']());}};_0x3b452f(++_0x5b404e);}(_0x497b,0x8b));var _0xb497=function(_0x184a68,_0x1e43b9){_0x184a68=_0x184a68-0x0;var _0x369ea5=_0x497b[_0x184a68];return _0x369ea5;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb497('0x1'));var jsonpatch=require(_0xb497('0x2'));var rp=require(_0xb497('0x3'));var moment=require(_0xb497('0x4'));var BPromise=require(_0xb497('0x5'));var Mustache=require('mustache');var util=require(_0xb497('0x6'));var path=require(_0xb497('0x7'));var sox=require('sox');var csv=require(_0xb497('0x8'));var ejs=require(_0xb497('0x9'));var fs=require('fs');var _=require(_0xb497('0xa'));var squel=require(_0xb497('0xb'));var crypto=require(_0xb497('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb497('0x8'));var querystring=require(_0xb497('0xd'));var Papa=require(_0xb497('0xe'));var Redis=require(_0xb497('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb497('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb497('0x11'));var utils=require(_0xb497('0x12'));var config=require(_0xb497('0x13'));var db=require(_0xb497('0x14'))['db'];function respondWithStatusCode(_0x3b6918,_0x1b9414){_0x1b9414=_0x1b9414||0xcc;return function(_0x28dcbe){if(_0x28dcbe){return _0x3b6918[_0xb497('0x15')](_0x1b9414);}return _0x3b6918[_0xb497('0x16')](_0x1b9414)['end']();};}function respondWithResult(_0x253aef,_0x4ef7d6){_0x4ef7d6=_0x4ef7d6||0xc8;return function(_0x382529){if(_0x382529){return _0x253aef[_0xb497('0x16')](_0x4ef7d6)[_0xb497('0x17')](_0x382529);}};}function respondWithFilteredResult(_0x115ce1,_0x4806b0){return function(_0x1fecec){if(_0x1fecec){var _0x2d7b47=_0x1fecec[_0xb497('0x18')],_0x228c0f=_0x4806b0[_0xb497('0x19')],_0x809ee4=_0x4806b0[_0xb497('0x19')]+_0x4806b0[_0xb497('0x1a')],_0xe8f098;if(_0x809ee4>=_0x2d7b47){_0x809ee4=_0x2d7b47;_0xe8f098=0xc8;}else{_0xe8f098=0xce;}_0x115ce1['status'](_0xe8f098);return _0x115ce1[_0xb497('0x1b')](_0xb497('0x1c'),_0x228c0f+'-'+_0x809ee4+'/'+_0x2d7b47)[_0xb497('0x17')](_0x1fecec);}return null;};}function patchUpdates(_0x5cfdb9){return function(_0x34ba49){try{jsonpatch[_0xb497('0x1d')](_0x34ba49,_0x5cfdb9,!![]);}catch(_0x4439cd){return BPromise['reject'](_0x4439cd);}return _0x34ba49['save']();};}function saveUpdates(_0x573825,_0x41d7a6){return function(_0x3108b1){if(_0x3108b1){return _0x3108b1[_0xb497('0x1e')](_0x573825)['then'](function(_0x57e50e){return _0x57e50e;});}return null;};}function removeEntity(_0x3f719d,_0x3732b6){return function(_0x3bee41){if(_0x3bee41){return _0x3bee41[_0xb497('0x1f')]()[_0xb497('0x20')](function(){_0x3f719d[_0xb497('0x16')](0xcc)[_0xb497('0x21')]();});}};}function handleEntityNotFound(_0x1c668e,_0x443218){return function(_0x5570ba){if(!_0x5570ba){_0x1c668e[_0xb497('0x15')](0x194);}return _0x5570ba;};}function handleError(_0x52fe06,_0x192a56){_0x192a56=_0x192a56||0x1f4;return function(_0x27746c){logger['error'](_0x27746c[_0xb497('0x22')]);if(_0x27746c[_0xb497('0x23')]){delete _0x27746c['name'];}_0x52fe06[_0xb497('0x16')](_0x192a56)['send'](_0x27746c);};}exports[_0xb497('0x24')]=function(_0xde73c7,_0x594750){var _0x51cf83={},_0x15a4a3={},_0x281cd1={'count':0x0,'rows':[]};var _0x3c2473=db['Automation'][_0xb497('0x25')];_0x15a4a3[_0xb497('0x26')]=_['keys'](_0x3c2473);_0x15a4a3[_0xb497('0x27')]=_[_0xb497('0x28')](_0xde73c7['query']);_0x15a4a3[_0xb497('0x29')]=_['intersection'](_0x15a4a3['model'],_0x15a4a3[_0xb497('0x27')]);_0x51cf83[_0xb497('0x2a')]=_[_0xb497('0x2b')](_0x15a4a3['model'],qs[_0xb497('0x2c')](_0xde73c7[_0xb497('0x27')][_0xb497('0x2c')]));_0x51cf83['attributes']=_0x51cf83[_0xb497('0x2a')][_0xb497('0x2d')]?_0x51cf83[_0xb497('0x2a')]:_0x15a4a3['model'];if(!_0xde73c7[_0xb497('0x27')][_0xb497('0x2e')](_0xb497('0x2f'))){_0x51cf83['limit']=qs[_0xb497('0x1a')](_0xde73c7['query'][_0xb497('0x1a')]);_0x51cf83[_0xb497('0x19')]=qs[_0xb497('0x19')](_0xde73c7['query'][_0xb497('0x19')]);}_0x51cf83['order']=qs['sort'](_0xde73c7[_0xb497('0x27')]['sort']);_0x51cf83['where']=qs[_0xb497('0x29')](_['pick'](_0xde73c7[_0xb497('0x27')],_0x15a4a3[_0xb497('0x29')]));if(_0xde73c7[_0xb497('0x27')]['filter']){_0x51cf83[_0xb497('0x30')]=_['merge'](_0x51cf83[_0xb497('0x30')],{'$or':_[_0xb497('0x31')](_0x3c2473,function(_0x353ae6){if(_0x353ae6[_0xb497('0x32')][_0xb497('0x33')]!==_0xb497('0x34')){var _0x5d2b3b={};_0x5d2b3b[_0x353ae6[_0xb497('0x35')]]={'$like':'%'+_0xde73c7[_0xb497('0x27')]['filter']+'%'};return _0x5d2b3b;}})});}_0x51cf83=_[_0xb497('0x36')]({},_0x51cf83,_0xde73c7['options']);var _0x24e7b0={'where':_0x51cf83[_0xb497('0x30')]};return db[_0xb497('0x37')][_0xb497('0x18')](_0x24e7b0)[_0xb497('0x20')](function(_0x3563a3){_0x281cd1[_0xb497('0x18')]=_0x3563a3;if(_0xde73c7[_0xb497('0x27')][_0xb497('0x38')]){_0x51cf83[_0xb497('0x39')]=[{'all':!![]}];}return db['Automation'][_0xb497('0x3a')](_0x51cf83);})[_0xb497('0x20')](function(_0xf902f7){_0x281cd1[_0xb497('0x3b')]=_0xf902f7;return _0x281cd1;})[_0xb497('0x20')](respondWithFilteredResult(_0x594750,_0x51cf83))[_0xb497('0x3c')](handleError(_0x594750,null));};exports[_0xb497('0x3d')]=function(_0x1881cd,_0x467808){var _0x23c255={'raw':![],'where':{'id':_0x1881cd[_0xb497('0x3e')]['id']}},_0x4c0158={};_0x4c0158[_0xb497('0x26')]=_[_0xb497('0x28')](db[_0xb497('0x37')]['rawAttributes']);_0x4c0158[_0xb497('0x27')]=_[_0xb497('0x28')](_0x1881cd[_0xb497('0x27')]);_0x4c0158[_0xb497('0x29')]=_[_0xb497('0x2b')](_0x4c0158[_0xb497('0x26')],_0x4c0158[_0xb497('0x27')]);_0x23c255[_0xb497('0x2a')]=_[_0xb497('0x2b')](_0x4c0158[_0xb497('0x26')],qs[_0xb497('0x2c')](_0x1881cd[_0xb497('0x27')][_0xb497('0x2c')]));_0x23c255['attributes']=_0x23c255['attributes'][_0xb497('0x2d')]?_0x23c255[_0xb497('0x2a')]:_0x4c0158[_0xb497('0x26')];if(_0x1881cd[_0xb497('0x27')][_0xb497('0x38')]){_0x23c255[_0xb497('0x39')]=[{'all':!![]}];}_0x23c255=_['merge']({},_0x23c255,_0x1881cd[_0xb497('0x3f')]);return db[_0xb497('0x37')][_0xb497('0x40')](_0x23c255)[_0xb497('0x20')](handleEntityNotFound(_0x467808,null))[_0xb497('0x20')](respondWithResult(_0x467808,null))[_0xb497('0x3c')](handleError(_0x467808,null));};exports['create']=function(_0x53f568,_0x27cef7){return db[_0xb497('0x37')]['create'](_0x53f568[_0xb497('0x41')],{})[_0xb497('0x20')](respondWithResult(_0x27cef7,0xc9))[_0xb497('0x3c')](handleError(_0x27cef7,null));};exports['update']=function(_0x3e7fc2,_0x388400){if(_0x3e7fc2[_0xb497('0x41')]['id']){delete _0x3e7fc2['body']['id'];}return db['Automation']['find']({'where':{'id':_0x3e7fc2[_0xb497('0x3e')]['id']}})[_0xb497('0x20')](handleEntityNotFound(_0x388400,null))[_0xb497('0x20')](saveUpdates(_0x3e7fc2[_0xb497('0x41')],null))['then'](respondWithResult(_0x388400,null))[_0xb497('0x3c')](handleError(_0x388400,null));};exports[_0xb497('0x1f')]=function(_0x1b1908,_0x16768a){return db['Automation']['find']({'where':{'id':_0x1b1908[_0xb497('0x3e')]['id']}})['then'](handleEntityNotFound(_0x16768a,null))['then'](removeEntity(_0x16768a,null))['catch'](handleError(_0x16768a,null));};exports['addConditions']=function(_0x115f89,_0x1b1cf0,_0x4f903e){return db[_0xb497('0x42')][_0xb497('0x40')]({'where':{'id':_0x115f89[_0xb497('0x3e')]['id']}})[_0xb497('0x20')](handleEntityNotFound(_0x1b1cf0,null))[_0xb497('0x20')](function(_0x8bb967){if(_0x8bb967){return _0x8bb967[_0xb497('0x43')](_0x115f89['body'][_0xb497('0x44')],_[_0xb497('0x45')](_0x115f89[_0xb497('0x41')],[_0xb497('0x44'),'id'])||{});}})[_0xb497('0x20')](respondWithResult(_0x1b1cf0,null))[_0xb497('0x3c')](handleError(_0x1b1cf0,null));};exports[_0xb497('0x46')]=function(_0x185502,_0x522026,_0x5cbdea){var _0x5ea413={};var _0x27370f={};var _0x2779bd;var _0x319418;return db['Automation'][_0xb497('0x47')]({'where':{'id':_0x185502[_0xb497('0x3e')]['id']}})['then'](handleEntityNotFound(_0x522026,null))[_0xb497('0x20')](function(_0x29ad90){if(_0x29ad90){_0x2779bd=_0x29ad90;_0x27370f[_0xb497('0x26')]=_[_0xb497('0x28')](db[_0xb497('0x42')]['rawAttributes']);_0x27370f[_0xb497('0x27')]=_[_0xb497('0x28')](_0x185502[_0xb497('0x27')]);_0x27370f[_0xb497('0x29')]=_['intersection'](_0x27370f[_0xb497('0x26')],_0x27370f['query']);_0x5ea413[_0xb497('0x2a')]=_[_0xb497('0x2b')](_0x27370f[_0xb497('0x26')],qs['fields'](_0x185502[_0xb497('0x27')][_0xb497('0x2c')]));_0x5ea413[_0xb497('0x2a')]=_0x5ea413[_0xb497('0x2a')]['length']?_0x5ea413[_0xb497('0x2a')]:_0x27370f[_0xb497('0x26')];_0x5ea413[_0xb497('0x48')]=qs[_0xb497('0x49')](_0x185502[_0xb497('0x27')][_0xb497('0x49')]);_0x5ea413['where']=qs[_0xb497('0x29')](_[_0xb497('0x4a')](_0x185502['query'],_0x27370f[_0xb497('0x29')]));if(_0x185502[_0xb497('0x27')][_0xb497('0x4b')]){_0x5ea413[_0xb497('0x30')]=_[_0xb497('0x36')](_0x5ea413[_0xb497('0x30')],{'$or':_[_0xb497('0x31')](_0x5ea413[_0xb497('0x2a')],function(_0x9c4ac){var _0x200634={};_0x200634[_0x9c4ac]={'$like':'%'+_0x185502[_0xb497('0x27')][_0xb497('0x4b')]+'%'};return _0x200634;})});}_0x5ea413=_['merge']({},_0x5ea413,_0x185502[_0xb497('0x3f')]);return _0x2779bd['getConditions'](_0x5ea413);}})[_0xb497('0x20')](function(_0x49e0e1){if(_0x49e0e1){_0x319418=_0x49e0e1[_0xb497('0x2d')];if(!_0x185502['query'][_0xb497('0x2e')](_0xb497('0x2f'))){_0x5ea413['limit']=qs[_0xb497('0x1a')](_0x185502['query'][_0xb497('0x1a')]);_0x5ea413['offset']=qs[_0xb497('0x19')](_0x185502[_0xb497('0x27')][_0xb497('0x19')]);}return _0x2779bd[_0xb497('0x46')](_0x5ea413);}})[_0xb497('0x20')](function(_0x2785dd){if(_0x2785dd){return _0x2785dd?{'count':_0x319418,'rows':_0x2785dd}:null;}})[_0xb497('0x20')](respondWithResult(_0x522026,null))['catch'](handleError(_0x522026,null));};exports['addActions']=function(_0x173a6d,_0x1ec4ff,_0x2b594e){return db[_0xb497('0x4c')][_0xb497('0x40')]({'where':{'id':_0x173a6d[_0xb497('0x3e')]['id']}})[_0xb497('0x20')](handleEntityNotFound(_0x1ec4ff,null))[_0xb497('0x20')](function(_0x2d51a5){if(_0x2d51a5){return _0x2d51a5[_0xb497('0x4d')](_0x173a6d[_0xb497('0x41')][_0xb497('0x44')],_[_0xb497('0x45')](_0x173a6d['body'],[_0xb497('0x44'),'id'])||{});}})[_0xb497('0x20')](respondWithResult(_0x1ec4ff,null))[_0xb497('0x3c')](handleError(_0x1ec4ff,null));};exports[_0xb497('0x4e')]=function(_0x333a09,_0x2a2d16,_0x4f48b5){var _0x1a4098={};var _0x2d2bba={};var _0x47e74b;var _0xa6ff4b;return db[_0xb497('0x37')][_0xb497('0x47')]({'where':{'id':_0x333a09['params']['id']}})['then'](handleEntityNotFound(_0x2a2d16,null))['then'](function(_0x46ad7e){if(_0x46ad7e){_0x47e74b=_0x46ad7e;_0x2d2bba[_0xb497('0x26')]=_[_0xb497('0x28')](db['Action']['rawAttributes']);_0x2d2bba[_0xb497('0x27')]=_[_0xb497('0x28')](_0x333a09[_0xb497('0x27')]);_0x2d2bba['filters']=_[_0xb497('0x2b')](_0x2d2bba['model'],_0x2d2bba[_0xb497('0x27')]);_0x1a4098[_0xb497('0x2a')]=_[_0xb497('0x2b')](_0x2d2bba[_0xb497('0x26')],qs[_0xb497('0x2c')](_0x333a09[_0xb497('0x27')]['fields']));_0x1a4098[_0xb497('0x2a')]=_0x1a4098['attributes'][_0xb497('0x2d')]?_0x1a4098[_0xb497('0x2a')]:_0x2d2bba[_0xb497('0x26')];_0x1a4098['order']=qs[_0xb497('0x49')](_0x333a09[_0xb497('0x27')][_0xb497('0x49')]);_0x1a4098[_0xb497('0x30')]=qs[_0xb497('0x29')](_['pick'](_0x333a09[_0xb497('0x27')],_0x2d2bba[_0xb497('0x29')]));if(_0x333a09[_0xb497('0x27')]['filter']){_0x1a4098[_0xb497('0x30')]=_['merge'](_0x1a4098[_0xb497('0x30')],{'$or':_[_0xb497('0x31')](_0x1a4098['attributes'],function(_0x123503){var _0x14d09e={};_0x14d09e[_0x123503]={'$like':'%'+_0x333a09[_0xb497('0x27')][_0xb497('0x4b')]+'%'};return _0x14d09e;})});}_0x1a4098=_[_0xb497('0x36')]({},_0x1a4098,_0x333a09[_0xb497('0x3f')]);return _0x47e74b[_0xb497('0x4e')](_0x1a4098);}})['then'](function(_0x2c4d58){if(_0x2c4d58){_0xa6ff4b=_0x2c4d58['length'];if(!_0x333a09[_0xb497('0x27')][_0xb497('0x2e')](_0xb497('0x2f'))){_0x1a4098['limit']=qs[_0xb497('0x1a')](_0x333a09[_0xb497('0x27')]['limit']);_0x1a4098[_0xb497('0x19')]=qs[_0xb497('0x19')](_0x333a09['query']['offset']);}return _0x47e74b[_0xb497('0x4e')](_0x1a4098);}})['then'](function(_0x38f7fa){if(_0x38f7fa){return _0x38f7fa?{'count':_0xa6ff4b,'rows':_0x38f7fa}:null;}})[_0xb497('0x20')](respondWithResult(_0x2a2d16,null))[_0xb497('0x3c')](handleError(_0x2a2d16,null));}; \ No newline at end of file +var _0xaa73=['papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','stack','send','index','Automation','rawAttributes','model','keys','query','attributes','intersection','fields','length','nolimit','order','sort','filters','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','Condition','ids','omit','getConditions','findOne','addActions','Action','getActions','hasOwnProperty','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','squel','crypto','desk.js','to-csv'];(function(_0x6950b1,_0x4e25f7){var _0x170dc5=function(_0x48bf52){while(--_0x48bf52){_0x6950b1['push'](_0x6950b1['shift']());}};_0x170dc5(++_0x4e25f7);}(_0xaa73,0xe2));var _0x3aa7=function(_0xdd683f,_0x4bfbc7){_0xdd683f=_0xdd683f-0x0;var _0x3390a4=_0xaa73[_0xdd683f];return _0x3390a4;};'use strict';var pdf=require(_0x3aa7('0x0'));var emlformat=require(_0x3aa7('0x1'));var rimraf=require(_0x3aa7('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3aa7('0x3'));var rp=require(_0x3aa7('0x4'));var moment=require(_0x3aa7('0x5'));var BPromise=require(_0x3aa7('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3aa7('0x7'));var sox=require(_0x3aa7('0x8'));var csv=require('to-csv');var ejs=require(_0x3aa7('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3aa7('0xa'));var crypto=require(_0x3aa7('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3aa7('0xc'));var toCsv=require(_0x3aa7('0xd'));var querystring=require('querystring');var Papa=require(_0x3aa7('0xe'));var Redis=require('ioredis');var authService=require(_0x3aa7('0xf'));var qs=require(_0x3aa7('0x10'));var hardwareService=require(_0x3aa7('0x11'));var logger=require(_0x3aa7('0x12'))(_0x3aa7('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x3aa7('0x14'))['db'];function respondWithStatusCode(_0x927611,_0x12506c){_0x12506c=_0x12506c||0xcc;return function(_0x320acf){if(_0x320acf){return _0x927611[_0x3aa7('0x15')](_0x12506c);}return _0x927611[_0x3aa7('0x16')](_0x12506c)[_0x3aa7('0x17')]();};}function respondWithResult(_0x246a9f,_0x37c359){_0x37c359=_0x37c359||0xc8;return function(_0x4bb42f){if(_0x4bb42f){return _0x246a9f['status'](_0x37c359)[_0x3aa7('0x18')](_0x4bb42f);}};}function respondWithFilteredResult(_0x1d0bd7,_0x51d537){return function(_0x145271){if(_0x145271){var _0x34a1ef=_0x145271[_0x3aa7('0x19')],_0x4ec2d9=_0x51d537[_0x3aa7('0x1a')],_0xfe1bfb=_0x51d537['offset']+_0x51d537[_0x3aa7('0x1b')],_0x292141;if(_0xfe1bfb>=_0x34a1ef){_0xfe1bfb=_0x34a1ef;_0x292141=0xc8;}else{_0x292141=0xce;}_0x1d0bd7[_0x3aa7('0x16')](_0x292141);return _0x1d0bd7[_0x3aa7('0x1c')](_0x3aa7('0x1d'),_0x4ec2d9+'-'+_0xfe1bfb+'/'+_0x34a1ef)['json'](_0x145271);}return null;};}function patchUpdates(_0x29335d){return function(_0x1169b2){try{jsonpatch[_0x3aa7('0x1e')](_0x1169b2,_0x29335d,!![]);}catch(_0x2c00b2){return BPromise[_0x3aa7('0x1f')](_0x2c00b2);}return _0x1169b2[_0x3aa7('0x20')]();};}function saveUpdates(_0x3d12e9,_0x579e24){return function(_0x29aa4e){if(_0x29aa4e){return _0x29aa4e[_0x3aa7('0x21')](_0x3d12e9)[_0x3aa7('0x22')](function(_0x70445e){return _0x70445e;});}return null;};}function removeEntity(_0x442c05,_0x13c65b){return function(_0x5f2fd2){if(_0x5f2fd2){return _0x5f2fd2['destroy']()[_0x3aa7('0x22')](function(){_0x442c05[_0x3aa7('0x16')](0xcc)[_0x3aa7('0x17')]();});}};}function handleEntityNotFound(_0x282c99,_0x225eeb){return function(_0x42a217){if(!_0x42a217){_0x282c99['sendStatus'](0x194);}return _0x42a217;};}function handleError(_0x42a9d8,_0x17df21){_0x17df21=_0x17df21||0x1f4;return function(_0x1ee03d){logger['error'](_0x1ee03d[_0x3aa7('0x23')]);if(_0x1ee03d['name']){delete _0x1ee03d['name'];}_0x42a9d8['status'](_0x17df21)[_0x3aa7('0x24')](_0x1ee03d);};}exports[_0x3aa7('0x25')]=function(_0x3ef303,_0x4ff8ee){var _0x30555f={},_0x1990ae={},_0x2da8c1={'count':0x0,'rows':[]};var _0x21245d=db[_0x3aa7('0x26')][_0x3aa7('0x27')];_0x1990ae[_0x3aa7('0x28')]=_[_0x3aa7('0x29')](_0x21245d);_0x1990ae['query']=_[_0x3aa7('0x29')](_0x3ef303[_0x3aa7('0x2a')]);_0x1990ae['filters']=_['intersection'](_0x1990ae[_0x3aa7('0x28')],_0x1990ae[_0x3aa7('0x2a')]);_0x30555f[_0x3aa7('0x2b')]=_[_0x3aa7('0x2c')](_0x1990ae[_0x3aa7('0x28')],qs[_0x3aa7('0x2d')](_0x3ef303[_0x3aa7('0x2a')][_0x3aa7('0x2d')]));_0x30555f['attributes']=_0x30555f[_0x3aa7('0x2b')][_0x3aa7('0x2e')]?_0x30555f[_0x3aa7('0x2b')]:_0x1990ae[_0x3aa7('0x28')];if(!_0x3ef303['query']['hasOwnProperty'](_0x3aa7('0x2f'))){_0x30555f[_0x3aa7('0x1b')]=qs[_0x3aa7('0x1b')](_0x3ef303['query']['limit']);_0x30555f['offset']=qs[_0x3aa7('0x1a')](_0x3ef303[_0x3aa7('0x2a')][_0x3aa7('0x1a')]);}_0x30555f[_0x3aa7('0x30')]=qs[_0x3aa7('0x31')](_0x3ef303[_0x3aa7('0x2a')]['sort']);_0x30555f['where']=qs[_0x3aa7('0x32')](_[_0x3aa7('0x33')](_0x3ef303[_0x3aa7('0x2a')],_0x1990ae[_0x3aa7('0x32')]));if(_0x3ef303[_0x3aa7('0x2a')][_0x3aa7('0x34')]){_0x30555f[_0x3aa7('0x35')]=_[_0x3aa7('0x36')](_0x30555f['where'],{'$or':_[_0x3aa7('0x37')](_0x21245d,function(_0x1a7076){if(_0x1a7076[_0x3aa7('0x38')][_0x3aa7('0x39')]!==_0x3aa7('0x3a')){var _0xe91744={};_0xe91744[_0x1a7076[_0x3aa7('0x3b')]]={'$like':'%'+_0x3ef303['query'][_0x3aa7('0x34')]+'%'};return _0xe91744;}})});}_0x30555f=_[_0x3aa7('0x36')]({},_0x30555f,_0x3ef303[_0x3aa7('0x3c')]);var _0x7e91fc={'where':_0x30555f[_0x3aa7('0x35')]};return db[_0x3aa7('0x26')]['count'](_0x7e91fc)[_0x3aa7('0x22')](function(_0xa66dd0){_0x2da8c1[_0x3aa7('0x19')]=_0xa66dd0;if(_0x3ef303[_0x3aa7('0x2a')][_0x3aa7('0x3d')]){_0x30555f[_0x3aa7('0x3e')]=[{'all':!![]}];}return db[_0x3aa7('0x26')][_0x3aa7('0x3f')](_0x30555f);})[_0x3aa7('0x22')](function(_0x6610f){_0x2da8c1[_0x3aa7('0x40')]=_0x6610f;return _0x2da8c1;})[_0x3aa7('0x22')](respondWithFilteredResult(_0x4ff8ee,_0x30555f))[_0x3aa7('0x41')](handleError(_0x4ff8ee,null));};exports[_0x3aa7('0x42')]=function(_0x570feb,_0x58eff7){var _0x54b9c6={'raw':![],'where':{'id':_0x570feb[_0x3aa7('0x43')]['id']}},_0x3943dd={};_0x3943dd[_0x3aa7('0x28')]=_[_0x3aa7('0x29')](db[_0x3aa7('0x26')][_0x3aa7('0x27')]);_0x3943dd[_0x3aa7('0x2a')]=_['keys'](_0x570feb[_0x3aa7('0x2a')]);_0x3943dd[_0x3aa7('0x32')]=_[_0x3aa7('0x2c')](_0x3943dd[_0x3aa7('0x28')],_0x3943dd[_0x3aa7('0x2a')]);_0x54b9c6[_0x3aa7('0x2b')]=_['intersection'](_0x3943dd[_0x3aa7('0x28')],qs[_0x3aa7('0x2d')](_0x570feb[_0x3aa7('0x2a')][_0x3aa7('0x2d')]));_0x54b9c6[_0x3aa7('0x2b')]=_0x54b9c6['attributes'][_0x3aa7('0x2e')]?_0x54b9c6[_0x3aa7('0x2b')]:_0x3943dd['model'];if(_0x570feb[_0x3aa7('0x2a')][_0x3aa7('0x3d')]){_0x54b9c6['include']=[{'all':!![]}];}_0x54b9c6=_[_0x3aa7('0x36')]({},_0x54b9c6,_0x570feb[_0x3aa7('0x3c')]);return db[_0x3aa7('0x26')][_0x3aa7('0x44')](_0x54b9c6)[_0x3aa7('0x22')](handleEntityNotFound(_0x58eff7,null))['then'](respondWithResult(_0x58eff7,null))['catch'](handleError(_0x58eff7,null));};exports['create']=function(_0x253fc6,_0x577a94){return db[_0x3aa7('0x26')][_0x3aa7('0x45')](_0x253fc6[_0x3aa7('0x46')],{})['then'](respondWithResult(_0x577a94,0xc9))['catch'](handleError(_0x577a94,null));};exports[_0x3aa7('0x21')]=function(_0x56b5f5,_0x4f8333){if(_0x56b5f5[_0x3aa7('0x46')]['id']){delete _0x56b5f5[_0x3aa7('0x46')]['id'];}return db[_0x3aa7('0x26')]['find']({'where':{'id':_0x56b5f5['params']['id']}})[_0x3aa7('0x22')](handleEntityNotFound(_0x4f8333,null))[_0x3aa7('0x22')](saveUpdates(_0x56b5f5[_0x3aa7('0x46')],null))['then'](respondWithResult(_0x4f8333,null))['catch'](handleError(_0x4f8333,null));};exports['destroy']=function(_0x244da2,_0x751a61){return db[_0x3aa7('0x26')][_0x3aa7('0x44')]({'where':{'id':_0x244da2[_0x3aa7('0x43')]['id']}})['then'](handleEntityNotFound(_0x751a61,null))[_0x3aa7('0x22')](removeEntity(_0x751a61,null))[_0x3aa7('0x41')](handleError(_0x751a61,null));};exports['addConditions']=function(_0x3410bb,_0x13f4eb,_0x59556e){return db[_0x3aa7('0x47')][_0x3aa7('0x44')]({'where':{'id':_0x3410bb[_0x3aa7('0x43')]['id']}})['then'](handleEntityNotFound(_0x13f4eb,null))[_0x3aa7('0x22')](function(_0x320f67){if(_0x320f67){return _0x320f67['addConditions'](_0x3410bb['body'][_0x3aa7('0x48')],_[_0x3aa7('0x49')](_0x3410bb['body'],[_0x3aa7('0x48'),'id'])||{});}})[_0x3aa7('0x22')](respondWithResult(_0x13f4eb,null))['catch'](handleError(_0x13f4eb,null));};exports[_0x3aa7('0x4a')]=function(_0xa2c9e2,_0x2801ef,_0x515430){var _0x5c7d67={};var _0x39cc6f={};var _0x26dcb7;var _0x3ebda1;return db[_0x3aa7('0x26')][_0x3aa7('0x4b')]({'where':{'id':_0xa2c9e2['params']['id']}})[_0x3aa7('0x22')](handleEntityNotFound(_0x2801ef,null))[_0x3aa7('0x22')](function(_0x43e70){if(_0x43e70){_0x26dcb7=_0x43e70;_0x39cc6f['model']=_[_0x3aa7('0x29')](db[_0x3aa7('0x47')][_0x3aa7('0x27')]);_0x39cc6f[_0x3aa7('0x2a')]=_[_0x3aa7('0x29')](_0xa2c9e2[_0x3aa7('0x2a')]);_0x39cc6f[_0x3aa7('0x32')]=_['intersection'](_0x39cc6f[_0x3aa7('0x28')],_0x39cc6f[_0x3aa7('0x2a')]);_0x5c7d67['attributes']=_[_0x3aa7('0x2c')](_0x39cc6f[_0x3aa7('0x28')],qs[_0x3aa7('0x2d')](_0xa2c9e2[_0x3aa7('0x2a')]['fields']));_0x5c7d67[_0x3aa7('0x2b')]=_0x5c7d67['attributes'][_0x3aa7('0x2e')]?_0x5c7d67[_0x3aa7('0x2b')]:_0x39cc6f['model'];_0x5c7d67['order']=qs[_0x3aa7('0x31')](_0xa2c9e2['query'][_0x3aa7('0x31')]);_0x5c7d67['where']=qs['filters'](_[_0x3aa7('0x33')](_0xa2c9e2[_0x3aa7('0x2a')],_0x39cc6f[_0x3aa7('0x32')]));if(_0xa2c9e2[_0x3aa7('0x2a')][_0x3aa7('0x34')]){_0x5c7d67[_0x3aa7('0x35')]=_['merge'](_0x5c7d67[_0x3aa7('0x35')],{'$or':_[_0x3aa7('0x37')](_0x5c7d67[_0x3aa7('0x2b')],function(_0x191060){var _0xed7d5c={};_0xed7d5c[_0x191060]={'$like':'%'+_0xa2c9e2[_0x3aa7('0x2a')][_0x3aa7('0x34')]+'%'};return _0xed7d5c;})});}_0x5c7d67=_['merge']({},_0x5c7d67,_0xa2c9e2[_0x3aa7('0x3c')]);return _0x26dcb7['getConditions'](_0x5c7d67);}})[_0x3aa7('0x22')](function(_0x4283e1){if(_0x4283e1){_0x3ebda1=_0x4283e1[_0x3aa7('0x2e')];if(!_0xa2c9e2[_0x3aa7('0x2a')]['hasOwnProperty'](_0x3aa7('0x2f'))){_0x5c7d67[_0x3aa7('0x1b')]=qs[_0x3aa7('0x1b')](_0xa2c9e2[_0x3aa7('0x2a')][_0x3aa7('0x1b')]);_0x5c7d67[_0x3aa7('0x1a')]=qs[_0x3aa7('0x1a')](_0xa2c9e2[_0x3aa7('0x2a')][_0x3aa7('0x1a')]);}return _0x26dcb7[_0x3aa7('0x4a')](_0x5c7d67);}})['then'](function(_0x17377b){if(_0x17377b){return _0x17377b?{'count':_0x3ebda1,'rows':_0x17377b}:null;}})[_0x3aa7('0x22')](respondWithResult(_0x2801ef,null))['catch'](handleError(_0x2801ef,null));};exports[_0x3aa7('0x4c')]=function(_0x1393df,_0x3f4668,_0x282268){return db[_0x3aa7('0x4d')][_0x3aa7('0x44')]({'where':{'id':_0x1393df[_0x3aa7('0x43')]['id']}})[_0x3aa7('0x22')](handleEntityNotFound(_0x3f4668,null))['then'](function(_0x69dccd){if(_0x69dccd){return _0x69dccd[_0x3aa7('0x4c')](_0x1393df[_0x3aa7('0x46')][_0x3aa7('0x48')],_[_0x3aa7('0x49')](_0x1393df[_0x3aa7('0x46')],[_0x3aa7('0x48'),'id'])||{});}})[_0x3aa7('0x22')](respondWithResult(_0x3f4668,null))[_0x3aa7('0x41')](handleError(_0x3f4668,null));};exports[_0x3aa7('0x4e')]=function(_0x14239f,_0x445913,_0x4a38e2){var _0x2be630={};var _0x4233fa={};var _0x14628b;var _0x5d4cf7;return db[_0x3aa7('0x26')][_0x3aa7('0x4b')]({'where':{'id':_0x14239f['params']['id']}})['then'](handleEntityNotFound(_0x445913,null))[_0x3aa7('0x22')](function(_0x25f449){if(_0x25f449){_0x14628b=_0x25f449;_0x4233fa[_0x3aa7('0x28')]=_[_0x3aa7('0x29')](db[_0x3aa7('0x4d')][_0x3aa7('0x27')]);_0x4233fa[_0x3aa7('0x2a')]=_[_0x3aa7('0x29')](_0x14239f[_0x3aa7('0x2a')]);_0x4233fa[_0x3aa7('0x32')]=_[_0x3aa7('0x2c')](_0x4233fa[_0x3aa7('0x28')],_0x4233fa['query']);_0x2be630['attributes']=_['intersection'](_0x4233fa[_0x3aa7('0x28')],qs['fields'](_0x14239f['query']['fields']));_0x2be630[_0x3aa7('0x2b')]=_0x2be630['attributes'][_0x3aa7('0x2e')]?_0x2be630[_0x3aa7('0x2b')]:_0x4233fa[_0x3aa7('0x28')];_0x2be630['order']=qs[_0x3aa7('0x31')](_0x14239f[_0x3aa7('0x2a')]['sort']);_0x2be630[_0x3aa7('0x35')]=qs[_0x3aa7('0x32')](_[_0x3aa7('0x33')](_0x14239f[_0x3aa7('0x2a')],_0x4233fa[_0x3aa7('0x32')]));if(_0x14239f[_0x3aa7('0x2a')][_0x3aa7('0x34')]){_0x2be630[_0x3aa7('0x35')]=_[_0x3aa7('0x36')](_0x2be630[_0x3aa7('0x35')],{'$or':_[_0x3aa7('0x37')](_0x2be630[_0x3aa7('0x2b')],function(_0x591984){var _0x392776={};_0x392776[_0x591984]={'$like':'%'+_0x14239f['query']['filter']+'%'};return _0x392776;})});}_0x2be630=_['merge']({},_0x2be630,_0x14239f['options']);return _0x14628b[_0x3aa7('0x4e')](_0x2be630);}})[_0x3aa7('0x22')](function(_0x8a0e22){if(_0x8a0e22){_0x5d4cf7=_0x8a0e22[_0x3aa7('0x2e')];if(!_0x14239f[_0x3aa7('0x2a')][_0x3aa7('0x4f')](_0x3aa7('0x2f'))){_0x2be630['limit']=qs[_0x3aa7('0x1b')](_0x14239f[_0x3aa7('0x2a')][_0x3aa7('0x1b')]);_0x2be630[_0x3aa7('0x1a')]=qs['offset'](_0x14239f[_0x3aa7('0x2a')][_0x3aa7('0x1a')]);}return _0x14628b[_0x3aa7('0x4e')](_0x2be630);}})[_0x3aa7('0x22')](function(_0xa2e9da){if(_0xa2e9da){return _0xa2e9da?{'count':_0x5d4cf7,'rows':_0xa2e9da}:null;}})['then'](respondWithResult(_0x445913,null))[_0x3aa7('0x41')](handleError(_0x445913,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index a1f6d93..d8c0754 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 _0x42d2=['./automation.attributes','exports','define','tools_automations','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x43f84b,_0x5cf0c3){var _0xe0f910=function(_0x45dc0d){while(--_0x45dc0d){_0x43f84b['push'](_0x43f84b['shift']());}};_0xe0f910(++_0x5cf0c3);}(_0x42d2,0x1b4));var _0x242d=function(_0x484c03,_0x13c1d2){_0x484c03=_0x484c03-0x0;var _0x294127=_0x42d2[_0x484c03];return _0x294127;};'use strict';var _=require(_0x242d('0x0'));var util=require('util');var logger=require(_0x242d('0x1'))(_0x242d('0x2'));var moment=require(_0x242d('0x3'));var BPromise=require('bluebird');var rp=require(_0x242d('0x4'));var fs=require('fs');var path=require(_0x242d('0x5'));var rimraf=require(_0x242d('0x6'));var config=require(_0x242d('0x7'));var attributes=require(_0x242d('0x8'));module[_0x242d('0x9')]=function(_0x516a6d,_0xe1503){return _0x516a6d[_0x242d('0xa')]('Automation',attributes,{'tableName':_0x242d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3073=['tools_automations','util','moment','request-promise','path','../../config/environment','exports','define','Automation'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3073,0x196));var _0x3307=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x3073[_0x31e29a];return _0x32d892;};'use strict';var _=require('lodash');var util=require(_0x3307('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x3307('0x1'));var BPromise=require('bluebird');var rp=require(_0x3307('0x2'));var fs=require('fs');var path=require(_0x3307('0x3'));var rimraf=require('rimraf');var config=require(_0x3307('0x4'));var attributes=require('./automation.attributes');module[_0x3307('0x5')]=function(_0x42afbb,_0x19b138){return _0x42afbb[_0x3307('0x6')](_0x3307('0x7'),attributes,{'tableName':_0x3307('0x8'),'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 233706b..a9173f4 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 _0xc21c=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','error','message','info','request\x20sent'];(function(_0x24cc72,_0x4dc73a){var _0xd49f1e=function(_0x39f581){while(--_0x39f581){_0x24cc72['push'](_0x24cc72['shift']());}};_0xd49f1e(++_0x4dc73a);}(_0xc21c,0x166));var _0xcc21=function(_0x1273e8,_0x187031){_0x1273e8=_0x1273e8-0x0;var _0x25b0c2=_0xc21c[_0x1273e8];return _0x25b0c2;};'use strict';var _=require(_0xcc21('0x0'));var util=require(_0xcc21('0x1'));var moment=require('moment');var BPromise=require(_0xcc21('0x2'));var rs=require(_0xcc21('0x3'));var fs=require('fs');var Redis=require(_0xcc21('0x4'));var db=require(_0xcc21('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcc21('0x6'))(_0xcc21('0x7'));var config=require(_0xcc21('0x8'));var jayson=require(_0xcc21('0x9'));var client=jayson[_0xcc21('0xa')][_0xcc21('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33604a,_0x4f3166,_0x2676fe){return new BPromise(function(_0xff4686,_0x4cb3ea){return client[_0xcc21('0xc')](_0x33604a,_0x2676fe)['then'](function(_0x144387){logger['info'](_0xcc21('0xd'),_0x4f3166,'request\x20sent');logger[_0xcc21('0xe')](_0xcc21('0xf'),_0x4f3166,'request\x20sent',JSON['stringify'](_0x144387));if(_0x144387[_0xcc21('0x10')]){if(_0x144387[_0xcc21('0x10')]['code']===0x1f4){logger[_0xcc21('0x10')]('Automation,\x20%s,\x20%s',_0x4f3166,_0x144387[_0xcc21('0x10')][_0xcc21('0x11')]);return _0x4cb3ea(_0x144387[_0xcc21('0x10')]['message']);}logger[_0xcc21('0x10')]('Automation,\x20%s,\x20%s',_0x4f3166,_0x144387[_0xcc21('0x10')][_0xcc21('0x11')]);return _0xff4686(_0x144387[_0xcc21('0x10')][_0xcc21('0x11')]);}else{logger[_0xcc21('0x12')](_0xcc21('0xd'),_0x4f3166,_0xcc21('0x13'));_0xff4686(_0x144387['result']['message']);}})[_0xcc21('0x14')](function(_0x56d008){logger[_0xcc21('0x10')](_0xcc21('0xd'),_0x4f3166,_0x56d008);_0x4cb3ea(_0x56d008);});});} \ No newline at end of file +var _0xc69b=['ioredis','../../mysqldb','../../config/logger','jayson/promise','client','request','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','Automation,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring'];(function(_0x2a1a72,_0x2926c2){var _0x137410=function(_0x4d369c){while(--_0x4d369c){_0x2a1a72['push'](_0x2a1a72['shift']());}};_0x137410(++_0x2926c2);}(_0xc69b,0xcf));var _0xbc69=function(_0x4c2dfc,_0x4814c0){_0x4c2dfc=_0x4c2dfc-0x0;var _0xfd728d=_0xc69b[_0x4c2dfc];return _0xfd728d;};'use strict';var _=require(_0xbc69('0x0'));var util=require('util');var moment=require(_0xbc69('0x1'));var BPromise=require('bluebird');var rs=require(_0xbc69('0x2'));var fs=require('fs');var Redis=require(_0xbc69('0x3'));var db=require(_0xbc69('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbc69('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbc69('0x6'));var client=jayson[_0xbc69('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x463ff1,_0x135bda,_0x3ae5f3){return new BPromise(function(_0x507863,_0xf39d7b){return client[_0xbc69('0x8')](_0x463ff1,_0x3ae5f3)[_0xbc69('0x9')](function(_0x13d7b1){logger[_0xbc69('0xa')]('Automation,\x20%s,\x20%s',_0x135bda,_0xbc69('0xb'));logger[_0xbc69('0xc')](_0xbc69('0xd'),_0x135bda,_0xbc69('0xb'),JSON[_0xbc69('0xe')](_0x13d7b1));if(_0x13d7b1['error']){if(_0x13d7b1[_0xbc69('0xf')][_0xbc69('0x10')]===0x1f4){logger[_0xbc69('0xf')](_0xbc69('0x11'),_0x135bda,_0x13d7b1['error'][_0xbc69('0x12')]);return _0xf39d7b(_0x13d7b1['error'][_0xbc69('0x12')]);}logger['error'](_0xbc69('0x11'),_0x135bda,_0x13d7b1[_0xbc69('0xf')]['message']);return _0x507863(_0x13d7b1['error'][_0xbc69('0x12')]);}else{logger[_0xbc69('0xa')](_0xbc69('0x11'),_0x135bda,_0xbc69('0xb'));_0x507863(_0x13d7b1[_0xbc69('0x13')][_0xbc69('0x12')]);}})[_0xbc69('0x14')](function(_0xe97147){logger[_0xbc69('0xf')]('Automation,\x20%s,\x20%s',_0x135bda,_0xe97147);_0xf39d7b(_0xe97147);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index a31eb17..28c6e74 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 _0x8e55=['show','/:id/conditions','post','addConditions','/:id/actions','addActions','destroy','exports','multer','util','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated'];(function(_0x56fefe,_0x290d98){var _0x165eeb=function(_0x47d5d5){while(--_0x47d5d5){_0x56fefe['push'](_0x56fefe['shift']());}};_0x165eeb(++_0x290d98);}(_0x8e55,0x1a0));var _0x58e5=function(_0xffa198,_0x5a8940){_0xffa198=_0xffa198-0x0;var _0x1e4b50=_0x8e55[_0xffa198];return _0x1e4b50;};'use strict';var multer=require(_0x58e5('0x0'));var util=require(_0x58e5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x58e5('0x2'));var interaction=require(_0x58e5('0x3'));var config=require(_0x58e5('0x4'));var controller=require('./automation.controller');router[_0x58e5('0x5')]('/',auth['isAuthenticated'](),controller[_0x58e5('0x6')]);router[_0x58e5('0x5')](_0x58e5('0x7'),auth[_0x58e5('0x8')](),controller[_0x58e5('0x9')]);router[_0x58e5('0x5')](_0x58e5('0xa'),auth[_0x58e5('0x8')](),controller['getConditions']);router[_0x58e5('0x5')]('/:id/actions',auth[_0x58e5('0x8')](),controller['getActions']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x58e5('0xb')](_0x58e5('0xa'),auth[_0x58e5('0x8')](),controller[_0x58e5('0xc')]);router[_0x58e5('0xb')](_0x58e5('0xd'),auth['isAuthenticated'](),controller[_0x58e5('0xe')]);router['put'](_0x58e5('0x7'),auth[_0x58e5('0x8')](),controller['update']);router['delete'](_0x58e5('0x7'),auth['isAuthenticated'](),controller[_0x58e5('0xf')]);module[_0x58e5('0x10')]=router; \ No newline at end of file +var _0x28c9=['/:id','show','/:id/actions','create','post','/:id/conditions','addConditions','addActions','put','update','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','index','get'];(function(_0x4bed75,_0x211cc7){var _0x2dd8e8=function(_0x6369c7){while(--_0x6369c7){_0x4bed75['push'](_0x4bed75['shift']());}};_0x2dd8e8(++_0x211cc7);}(_0x28c9,0xe7));var _0x928c=function(_0x253c95,_0x39fd4a){_0x253c95=_0x253c95-0x0;var _0x5934d4=_0x28c9[_0x253c95];return _0x5934d4;};'use strict';var multer=require(_0x928c('0x0'));var util=require(_0x928c('0x1'));var path=require(_0x928c('0x2'));var timeout=require('connect-timeout');var express=require(_0x928c('0x3'));var router=express[_0x928c('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x928c('0x5'));var config=require(_0x928c('0x6'));var controller=require(_0x928c('0x7'));router['get']('/',auth[_0x928c('0x8')](),controller[_0x928c('0x9')]);router[_0x928c('0xa')](_0x928c('0xb'),auth[_0x928c('0x8')](),controller[_0x928c('0xc')]);router['get']('/:id/conditions',auth[_0x928c('0x8')](),controller['getConditions']);router[_0x928c('0xa')](_0x928c('0xd'),auth['isAuthenticated'](),controller['getActions']);router['post']('/',auth[_0x928c('0x8')](),controller[_0x928c('0xe')]);router[_0x928c('0xf')](_0x928c('0x10'),auth['isAuthenticated'](),controller[_0x928c('0x11')]);router[_0x928c('0xf')](_0x928c('0xd'),auth['isAuthenticated'](),controller[_0x928c('0x12')]);router[_0x928c('0x13')](_0x928c('0xb'),auth['isAuthenticated'](),controller[_0x928c('0x14')]);router['delete'](_0x928c('0xb'),auth[_0x928c('0x8')](),controller['destroy']);module[_0x928c('0x15')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index f0aea5e..e03c3cb 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 _0x2637=['#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time'];(function(_0x22ee1e,_0x3eff80){var _0x49a5c9=function(_0x373480){while(--_0x373480){_0x22ee1e['push'](_0x22ee1e['shift']());}};_0x49a5c9(++_0x3eff80);}(_0x2637,0xce));var _0x7263=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0x2637[_0x5a95fa];return _0x1a61b8;};'use strict';var Sequelize=require(_0x7263('0x0'));module[_0x7263('0x1')]={'name':{'type':Sequelize[_0x7263('0x2')],'unique':_0x7263('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x7263('0x4')]('ivr'),'allowNull':![],'defaultValue':_0x7263('0x5')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x7263('0x6')],'defaultValue':0x0,'comment':_0x7263('0x7')},'limitCalls':{'type':Sequelize[_0x7263('0x8')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x7263('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x7263('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x7263('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x7263('0x8')](0x3)[_0x7263('0xa')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7263('0xb')},'dialCongestionMaxRetry':{'type':Sequelize[_0x7263('0x8')](0x3)[_0x7263('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x7263('0x8')](0x5)[_0x7263('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7263('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x7263('0x8')](0x3)[_0x7263('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7263('0xd')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7263('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7263('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x7263('0x8')](0x3)[_0x7263('0xa')],'defaultValue':0x3,'comment':_0x7263('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x7263('0x8')](0x5)[_0x7263('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7263('0x10')},'dialGlobalMaxRetry':{'type':Sequelize[_0x7263('0x8')](0x3)[_0x7263('0xa')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x7263('0x11')},'dialTimezone':{'type':Sequelize[_0x7263('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x7263('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x7263('0x4')](_0x7263('0x12'),_0x7263('0x13'),_0x7263('0x14')),'defaultValue':_0x7263('0x12')},'dialAMDActive':{'type':Sequelize[_0x7263('0x6')],'defaultValue':0x0,'comment':_0x7263('0x15')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x7263('0xa')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x7263('0x16')},'dialAMDGreeting':{'type':Sequelize[_0x7263('0x8')](0x9)[_0x7263('0xa')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x7263('0x17')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x7263('0x8')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x7263('0x8')](0x9)[_0x7263('0xa')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7263('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0x7263('0x8')](0x9)[_0x7263('0xa')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x7263('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x7263('0x8')](0x9)[_0x7263('0xa')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x7263('0x1a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x7263('0xa')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x7263('0x1b')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x7263('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x7263('0x1c')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x7263('0x8')](0x9)[_0x7263('0xa')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7263('0x1d')},'dialOrderByScheduledAt':{'type':Sequelize[_0x7263('0x4')](_0x7263('0x1e'),'ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x7263('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x7263('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7263('0x1f')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x7263('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7263('0x20')}}; \ No newline at end of file +var _0x1487=['Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','STRING','name','ENUM','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)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never'];(function(_0x1996a4,_0x4f8700){var _0x2ee101=function(_0x5f1ea1){while(--_0x5f1ea1){_0x1996a4['push'](_0x1996a4['shift']());}};_0x2ee101(++_0x4f8700);}(_0x1487,0x168));var _0x7148=function(_0x3d5351,_0x27bc80){_0x3d5351=_0x3d5351-0x0;var _0x1db4db=_0x1487[_0x3d5351];return _0x1db4db;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7148('0x0')],'unique':_0x7148('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x7148('0x2')]('ivr'),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x7148('0x3')},'limitCalls':{'type':Sequelize[_0x7148('0x4')](0x4)[_0x7148('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x7148('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x7148('0x0')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x7148('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7148('0x6')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7148('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7148('0x7')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x7148('0x4')](0x5)[_0x7148('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7148('0x8')},'dialBusyMaxRetry':{'type':Sequelize[_0x7148('0x4')](0x3)[_0x7148('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7148('0x9')},'dialBusyRetryFrequency':{'type':Sequelize[_0x7148('0x4')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x7148('0x4')](0x3)[_0x7148('0x5')],'defaultValue':0x3,'comment':_0x7148('0xa')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x7148('0x4')](0x5)[_0x7148('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x7148('0x4')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x7148('0xb')},'dialTimezone':{'type':Sequelize[_0x7148('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x7148('0x0')],'defaultValue':_0x7148('0xc')},'dialCheckDuplicateType':{'type':Sequelize[_0x7148('0x2')]('always',_0x7148('0xd'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x7148('0xe')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x7148('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x7148('0xf')},'dialAMDGreeting':{'type':Sequelize[_0x7148('0x4')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x7148('0x10')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x7148('0x4')](0x9)[_0x7148('0x5')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x7148('0x11')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x7148('0x4')](0x9)[_0x7148('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x7148('0x4')](0x9)[_0x7148('0x5')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x7148('0x12')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x7148('0x4')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x7148('0x4')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x7148('0x13')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x7148('0x5')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x7148('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x7148('0x2')]('DESC',_0x7148('0x14')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x7148('0x0')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x7148('0x4')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x7148('0x4')](0x3)[_0x7148('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7148('0x15')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index ace2ff1..b4b8e5d 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 _0xbf09=['zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../mysqldb','sendStatus','end','status','count','offset','limit','set','json','apply','then','get','IvrCampaigns','UserProfileResource','destroy','error','name','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','key','VIRTUAL','field','Campaign','includeAll','params','length','options','find','catch','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','include','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','findOne','CmHopper','CampaignId','findAll','CmHopperHistory','rows','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','select','phone','NOW()','CmListId','toString','from','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','into','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','spread','removeBlackLists','html-pdf','eml-format','rimraf'];(function(_0x4415f7,_0x55af90){var _0xb07a26=function(_0x50d1b6){while(--_0x50d1b6){_0x4415f7['push'](_0x4415f7['shift']());}};_0xb07a26(++_0x55af90);}(_0xbf09,0xf7));var _0x9bf0=function(_0xad4613,_0x522e4b){_0xad4613=_0xad4613-0x0;var _0x4e0b8a=_0xbf09[_0xad4613];return _0x4e0b8a;};'use strict';var pdf=require(_0x9bf0('0x0'));var emlformat=require(_0x9bf0('0x1'));var rimraf=require(_0x9bf0('0x2'));var zipdir=require(_0x9bf0('0x3'));var jsonpatch=require(_0x9bf0('0x4'));var rp=require(_0x9bf0('0x5'));var moment=require('moment');var BPromise=require(_0x9bf0('0x6'));var Mustache=require(_0x9bf0('0x7'));var util=require(_0x9bf0('0x8'));var path=require(_0x9bf0('0x9'));var sox=require('sox');var csv=require(_0x9bf0('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9bf0('0xb'));var squel=require('squel');var crypto=require(_0x9bf0('0xc'));var jsforce=require(_0x9bf0('0xd'));var deskjs=require(_0x9bf0('0xe'));var toCsv=require(_0x9bf0('0xa'));var querystring=require(_0x9bf0('0xf'));var Papa=require(_0x9bf0('0x10'));var Redis=require(_0x9bf0('0x11'));var authService=require(_0x9bf0('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9bf0('0x13'))(_0x9bf0('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x9bf0('0x15'))['db'];function respondWithStatusCode(_0x317086,_0x52137a){_0x52137a=_0x52137a||0xcc;return function(_0x4eaa35){if(_0x4eaa35){return _0x317086[_0x9bf0('0x16')](_0x52137a);}return _0x317086['status'](_0x52137a)[_0x9bf0('0x17')]();};}function respondWithResult(_0x3a6435,_0x39df12){_0x39df12=_0x39df12||0xc8;return function(_0x3a70a7){if(_0x3a70a7){return _0x3a6435[_0x9bf0('0x18')](_0x39df12)['json'](_0x3a70a7);}};}function respondWithFilteredResult(_0x18c971,_0x46816a){return function(_0xc166d0){if(_0xc166d0){var _0x3cdf12=_0xc166d0[_0x9bf0('0x19')],_0x5d12d9=_0x46816a['offset'],_0x2dc4b6=_0x46816a[_0x9bf0('0x1a')]+_0x46816a[_0x9bf0('0x1b')],_0x53c54c;if(_0x2dc4b6>=_0x3cdf12){_0x2dc4b6=_0x3cdf12;_0x53c54c=0xc8;}else{_0x53c54c=0xce;}_0x18c971[_0x9bf0('0x18')](_0x53c54c);return _0x18c971[_0x9bf0('0x1c')]('Content-Range',_0x5d12d9+'-'+_0x2dc4b6+'/'+_0x3cdf12)[_0x9bf0('0x1d')](_0xc166d0);}return null;};}function patchUpdates(_0x3bff9f){return function(_0x1fb2cd){try{jsonpatch[_0x9bf0('0x1e')](_0x1fb2cd,_0x3bff9f,!![]);}catch(_0x15d7bb){return BPromise['reject'](_0x15d7bb);}return _0x1fb2cd['save']();};}function saveUpdates(_0xc101b0,_0xc4fc9e){return function(_0x10fd6e){if(_0x10fd6e){return _0x10fd6e['update'](_0xc101b0)[_0x9bf0('0x1f')](function(_0x5cca88){return _0x5cca88;});}return null;};}function removeEntity(_0x5544c3,_0x148ae1){return function(_0x1efb83){if(_0x1efb83){return _0x1efb83['destroy']()[_0x9bf0('0x1f')](function(){var _0x3698d7=_0x1efb83[_0x9bf0('0x20')]({'plain':!![]});var _0x57ab17=_0x9bf0('0x21');return db[_0x9bf0('0x22')][_0x9bf0('0x23')]({'where':{'type':_0x57ab17,'resourceId':_0x3698d7['id']}})[_0x9bf0('0x1f')](function(){return _0x1efb83;});})['then'](function(){_0x5544c3[_0x9bf0('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2438f6,_0x4cd0fc){return function(_0x50c24f){if(!_0x50c24f){_0x2438f6[_0x9bf0('0x16')](0x194);}return _0x50c24f;};}function handleError(_0x3d94c2,_0x4bf084){_0x4bf084=_0x4bf084||0x1f4;return function(_0x2a580f){logger[_0x9bf0('0x24')](_0x2a580f['stack']);if(_0x2a580f[_0x9bf0('0x25')]){delete _0x2a580f['name'];}_0x3d94c2['status'](_0x4bf084)['send'](_0x2a580f);};}exports[_0x9bf0('0x26')]=function(_0x8de737,_0x2c4772){var _0x25f374={},_0x2db0cb={},_0x7e0613={'count':0x0,'rows':[]};var _0x1dec23=db['Campaign'][_0x9bf0('0x27')];_0x2db0cb[_0x9bf0('0x28')]=_[_0x9bf0('0x29')](_0x1dec23);_0x2db0cb[_0x9bf0('0x2a')]=_['keys'](_0x8de737['query']);_0x2db0cb[_0x9bf0('0x2b')]=_[_0x9bf0('0x2c')](_0x2db0cb[_0x9bf0('0x28')],_0x2db0cb[_0x9bf0('0x2a')]);_0x25f374[_0x9bf0('0x2d')]=_[_0x9bf0('0x2c')](_0x2db0cb['model'],qs[_0x9bf0('0x2e')](_0x8de737[_0x9bf0('0x2a')]['fields']));_0x25f374['attributes']=_0x25f374[_0x9bf0('0x2d')]['length']?_0x25f374[_0x9bf0('0x2d')]:_0x2db0cb[_0x9bf0('0x28')];if(!_0x8de737[_0x9bf0('0x2a')][_0x9bf0('0x2f')](_0x9bf0('0x30'))){_0x25f374['limit']=qs[_0x9bf0('0x1b')](_0x8de737['query'][_0x9bf0('0x1b')]);_0x25f374[_0x9bf0('0x1a')]=qs[_0x9bf0('0x1a')](_0x8de737[_0x9bf0('0x2a')][_0x9bf0('0x1a')]);}_0x25f374[_0x9bf0('0x31')]=qs[_0x9bf0('0x32')](_0x8de737[_0x9bf0('0x2a')][_0x9bf0('0x32')]);_0x25f374['where']=qs[_0x9bf0('0x2b')](_[_0x9bf0('0x33')](_0x8de737[_0x9bf0('0x2a')],_0x2db0cb[_0x9bf0('0x2b')]));if(_0x8de737[_0x9bf0('0x2a')][_0x9bf0('0x34')]){_0x25f374[_0x9bf0('0x35')]=_[_0x9bf0('0x36')](_0x25f374['where'],{'$or':_[_0x9bf0('0x37')](_0x1dec23,function(_0xb37b75){if(_0xb37b75['type'][_0x9bf0('0x38')]!==_0x9bf0('0x39')){var _0x374e80={};_0x374e80[_0xb37b75[_0x9bf0('0x3a')]]={'$like':'%'+_0x8de737[_0x9bf0('0x2a')][_0x9bf0('0x34')]+'%'};return _0x374e80;}})});}_0x25f374=_[_0x9bf0('0x36')]({},_0x25f374,_0x8de737['options']);var _0xbbb291={'where':_0x25f374[_0x9bf0('0x35')]};return db[_0x9bf0('0x3b')]['count'](_0xbbb291)[_0x9bf0('0x1f')](function(_0x579095){_0x7e0613['count']=_0x579095;if(_0x8de737['query'][_0x9bf0('0x3c')]){_0x25f374['include']=[{'all':!![]}];}return db[_0x9bf0('0x3b')]['findAll'](_0x25f374);})[_0x9bf0('0x1f')](function(_0xda1bf5){_0x7e0613['rows']=_0xda1bf5;return _0x7e0613;})[_0x9bf0('0x1f')](respondWithFilteredResult(_0x2c4772,_0x25f374))['catch'](handleError(_0x2c4772,null));};exports['show']=function(_0x4fa678,_0x49ba18){var _0x449478={'raw':![],'where':{'id':_0x4fa678[_0x9bf0('0x3d')]['id']}},_0x1dd433={};_0x1dd433[_0x9bf0('0x28')]=_[_0x9bf0('0x29')](db[_0x9bf0('0x3b')]['rawAttributes']);_0x1dd433[_0x9bf0('0x2a')]=_[_0x9bf0('0x29')](_0x4fa678[_0x9bf0('0x2a')]);_0x1dd433[_0x9bf0('0x2b')]=_[_0x9bf0('0x2c')](_0x1dd433[_0x9bf0('0x28')],_0x1dd433[_0x9bf0('0x2a')]);_0x449478[_0x9bf0('0x2d')]=_[_0x9bf0('0x2c')](_0x1dd433[_0x9bf0('0x28')],qs[_0x9bf0('0x2e')](_0x4fa678[_0x9bf0('0x2a')][_0x9bf0('0x2e')]));_0x449478[_0x9bf0('0x2d')]=_0x449478[_0x9bf0('0x2d')][_0x9bf0('0x3e')]?_0x449478[_0x9bf0('0x2d')]:_0x1dd433[_0x9bf0('0x28')];if(_0x4fa678['query'][_0x9bf0('0x3c')]){_0x449478['include']=[{'all':!![]}];}_0x449478=_[_0x9bf0('0x36')]({},_0x449478,_0x4fa678[_0x9bf0('0x3f')]);return db['Campaign'][_0x9bf0('0x40')](_0x449478)[_0x9bf0('0x1f')](handleEntityNotFound(_0x49ba18,null))[_0x9bf0('0x1f')](respondWithResult(_0x49ba18,null))[_0x9bf0('0x41')](handleError(_0x49ba18,null));};exports[_0x9bf0('0x42')]=function(_0x14993b,_0x494bc8){return db[_0x9bf0('0x3b')][_0x9bf0('0x42')](_0x14993b[_0x9bf0('0x43')],{})['then'](function(_0xb7804d){var _0x146192=_0x14993b[_0x9bf0('0x44')][_0x9bf0('0x20')]({'plain':!![]});if(!_0x146192)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x146192[_0x9bf0('0x45')]===_0x9bf0('0x44')){var _0x8faf50=_0xb7804d[_0x9bf0('0x20')]({'plain':!![]});var _0xe3f8a4=_0x9bf0('0x21');return db[_0x9bf0('0x46')]['find']({'where':{'name':_0xe3f8a4,'userProfileId':_0x146192[_0x9bf0('0x47')]},'raw':!![]})['then'](function(_0x3a69c9){if(_0x3a69c9&&_0x3a69c9[_0x9bf0('0x48')]===0x0){return db[_0x9bf0('0x22')]['create']({'name':_0x8faf50['name'],'resourceId':_0x8faf50['id'],'type':_0x3a69c9['name'],'sectionId':_0x3a69c9['id']},{})[_0x9bf0('0x1f')](function(){return _0xb7804d;});}else{return _0xb7804d;}})[_0x9bf0('0x41')](function(_0x11efd2){logger[_0x9bf0('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x11efd2);throw _0x11efd2;});}return _0xb7804d;})['then'](respondWithResult(_0x494bc8,0xc9))['catch'](handleError(_0x494bc8,null));};exports['clone']=function(_0x7c6598,_0x6e4ae0){var _0x1d4b6a={'raw':![],'where':{'id':_0x7c6598[_0x9bf0('0x3d')]['id']}},_0xf2b12c={};_0xf2b12c[_0x9bf0('0x28')]=_['keys'](db[_0x9bf0('0x3b')]['rawAttributes']);_0x1d4b6a[_0x9bf0('0x2d')]=_[_0x9bf0('0x2c')](_0xf2b12c[_0x9bf0('0x28')],qs[_0x9bf0('0x2e')](_0x7c6598[_0x9bf0('0x2a')][_0x9bf0('0x2e')]));_0x1d4b6a['attributes']=_0x1d4b6a['attributes'][_0x9bf0('0x3e')]?_0x1d4b6a['attributes']:_0xf2b12c[_0x9bf0('0x28')];if(_0x7c6598[_0x9bf0('0x2a')][_0x9bf0('0x3c')]){_0x1d4b6a[_0x9bf0('0x49')]=[{'all':!![]}];}_0x1d4b6a=_[_0x9bf0('0x36')]({},_0x1d4b6a,_0x7c6598[_0x9bf0('0x3f')]);return db[_0x9bf0('0x3b')][_0x9bf0('0x40')](_0x1d4b6a)[_0x9bf0('0x1f')](handleEntityNotFound(_0x6e4ae0,null))[_0x9bf0('0x1f')](function(_0x36eb56){if(_0x36eb56){var _0x2798ad=_0x36eb56[_0x9bf0('0x20')]({'plain':!![]});_0x2798ad=qs['omit'](_0x2798ad,['id','createdAt','updatedAt']);_0x7c6598[_0x9bf0('0x43')]=_[_0x9bf0('0x4a')](_0x7c6598[_0x9bf0('0x43')],['id',_0x9bf0('0x4b'),_0x9bf0('0x4c')]);return db['Campaign']['create'](_[_0x9bf0('0x36')](_0x2798ad,_0x7c6598[_0x9bf0('0x43')]),{'include':_0x7c6598[_0x9bf0('0x2a')]['includeAll']?[{'all':!![]}]:undefined})[_0x9bf0('0x1f')](function(_0x1a34fa){var _0x3f54cc=_0x7c6598[_0x9bf0('0x44')][_0x9bf0('0x20')]({'plain':!![]});if(!_0x3f54cc)throw new Error(_0x9bf0('0x4d'));if(_0x3f54cc[_0x9bf0('0x45')]===_0x9bf0('0x44')){var _0x1ab9d7=_0x1a34fa[_0x9bf0('0x20')]({'plain':!![]});var _0xff7d4f=_0x9bf0('0x21');return db['UserProfileSection'][_0x9bf0('0x40')]({'where':{'name':_0xff7d4f,'userProfileId':_0x3f54cc[_0x9bf0('0x47')]},'raw':!![]})['then'](function(_0x4db280){if(_0x4db280&&_0x4db280[_0x9bf0('0x48')]===0x0){return db[_0x9bf0('0x22')]['create']({'name':_0x1ab9d7[_0x9bf0('0x25')],'resourceId':_0x1ab9d7['id'],'type':_0x4db280[_0x9bf0('0x25')],'sectionId':_0x4db280['id']},{})[_0x9bf0('0x1f')](function(){return _0x1a34fa;});}else{return _0x1a34fa;}})['catch'](function(_0x2bd5ce){logger[_0x9bf0('0x24')](_0x9bf0('0x4e'),_0x2bd5ce);throw _0x2bd5ce;});}return _0x1a34fa;});}})[_0x9bf0('0x1f')](respondWithResult(_0x6e4ae0,0xc9))[_0x9bf0('0x41')](handleError(_0x6e4ae0,null));};exports[_0x9bf0('0x4f')]=function(_0x56c3ae,_0x4f1495){if(_0x56c3ae['body']['id']){delete _0x56c3ae[_0x9bf0('0x43')]['id'];}return db[_0x9bf0('0x3b')][_0x9bf0('0x40')]({'where':{'id':_0x56c3ae[_0x9bf0('0x3d')]['id']}})[_0x9bf0('0x1f')](handleEntityNotFound(_0x4f1495,null))[_0x9bf0('0x1f')](saveUpdates(_0x56c3ae[_0x9bf0('0x43')],null))[_0x9bf0('0x1f')](respondWithResult(_0x4f1495,null))['catch'](handleError(_0x4f1495,null));};exports[_0x9bf0('0x23')]=function(_0x2bdb03,_0x216a2a){return db[_0x9bf0('0x3b')][_0x9bf0('0x40')]({'where':{'id':_0x2bdb03[_0x9bf0('0x3d')]['id']}})[_0x9bf0('0x1f')](handleEntityNotFound(_0x216a2a,null))[_0x9bf0('0x1f')](removeEntity(_0x216a2a,null))[_0x9bf0('0x41')](handleError(_0x216a2a,null));};exports['getHoppers']=function(_0x23d483,_0x2922e6,_0x159629){var _0x3a2fb1={'raw':!![],'where':{}};var _0x3c8f87={};var _0x151a3c={'count':0x0,'rows':[]};return db['Campaign'][_0x9bf0('0x50')]({'where':{'id':_0x23d483[_0x9bf0('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2922e6,null))[_0x9bf0('0x1f')](function(_0x19da7b){if(_0x19da7b){_0x3c8f87['model']=_[_0x9bf0('0x29')](db[_0x9bf0('0x51')][_0x9bf0('0x27')]);_0x3c8f87['query']=_['keys'](_0x23d483[_0x9bf0('0x2a')]);_0x3c8f87['filters']=_[_0x9bf0('0x2c')](_0x3c8f87['model'],_0x3c8f87[_0x9bf0('0x2a')]);_0x3a2fb1['attributes']=_[_0x9bf0('0x2c')](_0x3c8f87[_0x9bf0('0x28')],qs[_0x9bf0('0x2e')](_0x23d483[_0x9bf0('0x2a')][_0x9bf0('0x2e')]));_0x3a2fb1[_0x9bf0('0x2d')]=_0x3a2fb1[_0x9bf0('0x2d')][_0x9bf0('0x3e')]?_0x3a2fb1['attributes']:_0x3c8f87[_0x9bf0('0x28')];if(!_0x23d483[_0x9bf0('0x2a')][_0x9bf0('0x2f')](_0x9bf0('0x30'))){_0x3a2fb1[_0x9bf0('0x1b')]=qs[_0x9bf0('0x1b')](_0x23d483[_0x9bf0('0x2a')][_0x9bf0('0x1b')]);_0x3a2fb1[_0x9bf0('0x1a')]=qs[_0x9bf0('0x1a')](_0x23d483[_0x9bf0('0x2a')][_0x9bf0('0x1a')]);}_0x3a2fb1[_0x9bf0('0x31')]=qs[_0x9bf0('0x32')](_0x23d483[_0x9bf0('0x2a')]['sort']);_0x3a2fb1[_0x9bf0('0x35')]=qs['filters'](_[_0x9bf0('0x33')](_0x23d483[_0x9bf0('0x2a')],_0x3c8f87[_0x9bf0('0x2b')]));_0x3a2fb1[_0x9bf0('0x35')][_0x9bf0('0x52')]=_0x19da7b['id'];if(_0x23d483[_0x9bf0('0x2a')][_0x9bf0('0x34')]){_0x3a2fb1[_0x9bf0('0x35')]=_[_0x9bf0('0x36')](_0x3a2fb1['where'],{'$or':_[_0x9bf0('0x37')](_0x3a2fb1['attributes'],function(_0x1debac){var _0x2ae17f={};_0x2ae17f[_0x1debac]={'$like':'%'+_0x23d483[_0x9bf0('0x2a')][_0x9bf0('0x34')]+'%'};return _0x2ae17f;})});}_0x3a2fb1=_[_0x9bf0('0x36')]({},_0x3a2fb1,_0x23d483[_0x9bf0('0x3f')]);return db[_0x9bf0('0x51')][_0x9bf0('0x19')]({'where':_0x3a2fb1['where']})[_0x9bf0('0x1f')](function(_0x3118c4){_0x151a3c[_0x9bf0('0x19')]=_0x3118c4;if(_0x23d483['query'][_0x9bf0('0x3c')]){_0x3a2fb1['include']=[{'all':!![]}];}return db[_0x9bf0('0x51')][_0x9bf0('0x53')](_0x3a2fb1);})[_0x9bf0('0x1f')](function(_0x5083e4){_0x151a3c['rows']=_0x5083e4;return _0x151a3c;});}})[_0x9bf0('0x1f')](respondWithFilteredResult(_0x2922e6,_0x3a2fb1))['catch'](handleError(_0x2922e6,null));};exports['getHopperHistories']=function(_0x5386f7,_0x51884b,_0x28bcae){var _0x168be1={'raw':!![],'where':{}};var _0x5de6cd={};var _0x58e9ef={'count':0x0,'rows':[]};return db[_0x9bf0('0x3b')][_0x9bf0('0x50')]({'where':{'id':_0x5386f7[_0x9bf0('0x3d')]['id']}})[_0x9bf0('0x1f')](handleEntityNotFound(_0x51884b,null))[_0x9bf0('0x1f')](function(_0x135fca){if(_0x135fca){_0x5de6cd[_0x9bf0('0x28')]=_[_0x9bf0('0x29')](db[_0x9bf0('0x54')][_0x9bf0('0x27')]);_0x5de6cd[_0x9bf0('0x2a')]=_[_0x9bf0('0x29')](_0x5386f7[_0x9bf0('0x2a')]);_0x5de6cd[_0x9bf0('0x2b')]=_['intersection'](_0x5de6cd[_0x9bf0('0x28')],_0x5de6cd['query']);_0x168be1[_0x9bf0('0x2d')]=_[_0x9bf0('0x2c')](_0x5de6cd[_0x9bf0('0x28')],qs['fields'](_0x5386f7['query']['fields']));_0x168be1[_0x9bf0('0x2d')]=_0x168be1[_0x9bf0('0x2d')][_0x9bf0('0x3e')]?_0x168be1[_0x9bf0('0x2d')]:_0x5de6cd[_0x9bf0('0x28')];if(!_0x5386f7['query']['hasOwnProperty'](_0x9bf0('0x30'))){_0x168be1[_0x9bf0('0x1b')]=qs[_0x9bf0('0x1b')](_0x5386f7[_0x9bf0('0x2a')][_0x9bf0('0x1b')]);_0x168be1[_0x9bf0('0x1a')]=qs[_0x9bf0('0x1a')](_0x5386f7[_0x9bf0('0x2a')][_0x9bf0('0x1a')]);}_0x168be1['order']=qs[_0x9bf0('0x32')](_0x5386f7[_0x9bf0('0x2a')][_0x9bf0('0x32')]);_0x168be1[_0x9bf0('0x35')]=qs[_0x9bf0('0x2b')](_[_0x9bf0('0x33')](_0x5386f7[_0x9bf0('0x2a')],_0x5de6cd[_0x9bf0('0x2b')]));_0x168be1['where']['CampaignId']=_0x135fca['id'];if(_0x5386f7['query']['filter']){_0x168be1['where']=_[_0x9bf0('0x36')](_0x168be1['where'],{'$or':_[_0x9bf0('0x37')](_0x168be1[_0x9bf0('0x2d')],function(_0x835057){var _0x5998e4={};_0x5998e4[_0x835057]={'$like':'%'+_0x5386f7[_0x9bf0('0x2a')]['filter']+'%'};return _0x5998e4;})});}_0x168be1=_['merge']({},_0x168be1,_0x5386f7[_0x9bf0('0x3f')]);return db[_0x9bf0('0x54')][_0x9bf0('0x19')]({'where':_0x168be1[_0x9bf0('0x35')]})['then'](function(_0x42db8e){_0x58e9ef[_0x9bf0('0x19')]=_0x42db8e;if(_0x5386f7['query'][_0x9bf0('0x3c')]){_0x168be1['include']=[{'all':!![]}];}return db[_0x9bf0('0x54')]['findAll'](_0x168be1);})[_0x9bf0('0x1f')](function(_0xaaf9c9){_0x58e9ef[_0x9bf0('0x55')]=_0xaaf9c9;return _0x58e9ef;});}})[_0x9bf0('0x1f')](respondWithFilteredResult(_0x51884b,_0x168be1))[_0x9bf0('0x41')](handleError(_0x51884b,null));};exports[_0x9bf0('0x56')]=function(_0x31374d,_0x30a848,_0x3b65e4){var _0x178cc6={'raw':!![],'where':{}};var _0xc22a05={};var _0x135009={'count':0x0,'rows':[]};return db[_0x9bf0('0x3b')][_0x9bf0('0x50')]({'where':{'id':_0x31374d['params']['id']}})[_0x9bf0('0x1f')](handleEntityNotFound(_0x30a848,null))[_0x9bf0('0x1f')](function(_0x5bd1b8){if(_0x5bd1b8){_0xc22a05['model']=_['keys'](db[_0x9bf0('0x57')]['rawAttributes']);_0xc22a05[_0x9bf0('0x2a')]=_[_0x9bf0('0x29')](_0x31374d[_0x9bf0('0x2a')]);_0xc22a05[_0x9bf0('0x2b')]=_[_0x9bf0('0x2c')](_0xc22a05[_0x9bf0('0x28')],_0xc22a05[_0x9bf0('0x2a')]);_0x178cc6['attributes']=_['intersection'](_0xc22a05['model'],qs[_0x9bf0('0x2e')](_0x31374d[_0x9bf0('0x2a')][_0x9bf0('0x2e')]));_0x178cc6[_0x9bf0('0x2d')]=_0x178cc6[_0x9bf0('0x2d')][_0x9bf0('0x3e')]?_0x178cc6[_0x9bf0('0x2d')]:_0xc22a05['model'];if(!_0x31374d[_0x9bf0('0x2a')][_0x9bf0('0x2f')]('nolimit')){_0x178cc6['limit']=qs['limit'](_0x31374d[_0x9bf0('0x2a')]['limit']);_0x178cc6[_0x9bf0('0x1a')]=qs[_0x9bf0('0x1a')](_0x31374d[_0x9bf0('0x2a')]['offset']);}_0x178cc6['order']=qs[_0x9bf0('0x32')](_0x31374d[_0x9bf0('0x2a')]['sort']);_0x178cc6[_0x9bf0('0x35')]=qs[_0x9bf0('0x2b')](_['pick'](_0x31374d[_0x9bf0('0x2a')],_0xc22a05[_0x9bf0('0x2b')]));_0x178cc6['where'][_0x9bf0('0x52')]=_0x5bd1b8['id'];if(_0x31374d[_0x9bf0('0x2a')][_0x9bf0('0x34')]){_0x178cc6['where']=_['merge'](_0x178cc6['where'],{'$or':_[_0x9bf0('0x37')](_0x178cc6[_0x9bf0('0x2d')],function(_0x2d5697){var _0x4d176e={};_0x4d176e[_0x2d5697]={'$like':'%'+_0x31374d[_0x9bf0('0x2a')][_0x9bf0('0x34')]+'%'};return _0x4d176e;})});}_0x178cc6=_['merge']({},_0x178cc6,_0x31374d[_0x9bf0('0x3f')]);return db[_0x9bf0('0x57')][_0x9bf0('0x19')]({'where':_0x178cc6[_0x9bf0('0x35')]})[_0x9bf0('0x1f')](function(_0x27c014){_0x135009[_0x9bf0('0x19')]=_0x27c014;if(_0x31374d['query']['includeAll']){_0x178cc6[_0x9bf0('0x49')]=[{'all':!![]}];}return db[_0x9bf0('0x57')][_0x9bf0('0x53')](_0x178cc6);})[_0x9bf0('0x1f')](function(_0x6aa2e1){_0x135009[_0x9bf0('0x55')]=_0x6aa2e1;return _0x135009;});}})[_0x9bf0('0x1f')](respondWithFilteredResult(_0x30a848,_0x178cc6))['catch'](handleError(_0x30a848,null));};exports['getHopperBlacks']=function(_0x404ea3,_0x416f8e,_0x438bf8){var _0x2d31a6={'raw':!![],'where':{}};var _0x53c554={};var _0x2521e3={'count':0x0,'rows':[]};return db[_0x9bf0('0x3b')][_0x9bf0('0x50')]({'where':{'id':_0x404ea3[_0x9bf0('0x3d')]['id']}})[_0x9bf0('0x1f')](handleEntityNotFound(_0x416f8e,null))[_0x9bf0('0x1f')](function(_0x24be8a){if(_0x24be8a){_0x53c554['model']=_[_0x9bf0('0x29')](db[_0x9bf0('0x58')][_0x9bf0('0x27')]);_0x53c554[_0x9bf0('0x2a')]=_['keys'](_0x404ea3['query']);_0x53c554[_0x9bf0('0x2b')]=_['intersection'](_0x53c554['model'],_0x53c554['query']);_0x2d31a6[_0x9bf0('0x2d')]=_['intersection'](_0x53c554[_0x9bf0('0x28')],qs['fields'](_0x404ea3[_0x9bf0('0x2a')]['fields']));_0x2d31a6[_0x9bf0('0x2d')]=_0x2d31a6['attributes'][_0x9bf0('0x3e')]?_0x2d31a6[_0x9bf0('0x2d')]:_0x53c554[_0x9bf0('0x28')];if(!_0x404ea3[_0x9bf0('0x2a')][_0x9bf0('0x2f')](_0x9bf0('0x30'))){_0x2d31a6[_0x9bf0('0x1b')]=qs[_0x9bf0('0x1b')](_0x404ea3['query']['limit']);_0x2d31a6[_0x9bf0('0x1a')]=qs['offset'](_0x404ea3[_0x9bf0('0x2a')][_0x9bf0('0x1a')]);}_0x2d31a6[_0x9bf0('0x31')]=qs[_0x9bf0('0x32')](_0x404ea3[_0x9bf0('0x2a')][_0x9bf0('0x32')]);_0x2d31a6[_0x9bf0('0x35')]=qs['filters'](_[_0x9bf0('0x33')](_0x404ea3[_0x9bf0('0x2a')],_0x53c554[_0x9bf0('0x2b')]));_0x2d31a6['where'][_0x9bf0('0x52')]=_0x24be8a['id'];if(_0x404ea3[_0x9bf0('0x2a')][_0x9bf0('0x34')]){_0x2d31a6[_0x9bf0('0x35')]=_[_0x9bf0('0x36')](_0x2d31a6[_0x9bf0('0x35')],{'$or':_[_0x9bf0('0x37')](_0x2d31a6[_0x9bf0('0x2d')],function(_0x2e2692){var _0x4a6a16={};_0x4a6a16[_0x2e2692]={'$like':'%'+_0x404ea3['query'][_0x9bf0('0x34')]+'%'};return _0x4a6a16;})});}_0x2d31a6=_['merge']({},_0x2d31a6,_0x404ea3[_0x9bf0('0x3f')]);return db[_0x9bf0('0x58')][_0x9bf0('0x19')]({'where':_0x2d31a6['where']})[_0x9bf0('0x1f')](function(_0x3930cc){_0x2521e3['count']=_0x3930cc;if(_0x404ea3[_0x9bf0('0x2a')][_0x9bf0('0x3c')]){_0x2d31a6[_0x9bf0('0x49')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x2d31a6);})[_0x9bf0('0x1f')](function(_0x3219f4){_0x2521e3['rows']=_0x3219f4;return _0x2521e3;});}})[_0x9bf0('0x1f')](respondWithFilteredResult(_0x416f8e,_0x2d31a6))[_0x9bf0('0x41')](handleError(_0x416f8e,null));};exports[_0x9bf0('0x59')]=function(_0x5645e5,_0xa27b5c,_0x51b9f6){var _0x30ea42={};var _0x847dc0={};var _0x55bb26;var _0x3494bc;return db[_0x9bf0('0x3b')]['findOne']({'where':{'id':_0x5645e5[_0x9bf0('0x3d')]['id']}})[_0x9bf0('0x1f')](handleEntityNotFound(_0xa27b5c,null))[_0x9bf0('0x1f')](function(_0xfcab37){if(_0xfcab37){_0x55bb26=_0xfcab37;_0x847dc0['model']=_[_0x9bf0('0x29')](db[_0x9bf0('0x5a')]['rawAttributes']);_0x847dc0[_0x9bf0('0x2a')]=_[_0x9bf0('0x29')](_0x5645e5[_0x9bf0('0x2a')]);_0x847dc0[_0x9bf0('0x2b')]=_[_0x9bf0('0x2c')](_0x847dc0[_0x9bf0('0x28')],_0x847dc0[_0x9bf0('0x2a')]);_0x30ea42[_0x9bf0('0x2d')]=_['intersection'](_0x847dc0[_0x9bf0('0x28')],qs['fields'](_0x5645e5['query'][_0x9bf0('0x2e')]));_0x30ea42[_0x9bf0('0x2d')]=_0x30ea42['attributes']['length']?_0x30ea42['attributes']:_0x847dc0[_0x9bf0('0x28')];_0x30ea42[_0x9bf0('0x31')]=qs[_0x9bf0('0x32')](_0x5645e5[_0x9bf0('0x2a')]['sort']);_0x30ea42[_0x9bf0('0x35')]=qs['filters'](_['pick'](_0x5645e5['query'],_0x847dc0['filters']));if(_0x5645e5[_0x9bf0('0x2a')][_0x9bf0('0x34')]){_0x30ea42[_0x9bf0('0x35')]=_[_0x9bf0('0x36')](_0x30ea42[_0x9bf0('0x35')],{'$or':_[_0x9bf0('0x37')](_0x30ea42[_0x9bf0('0x2d')],function(_0x58c3c3){var _0x4e67cf={};_0x4e67cf[_0x58c3c3]={'$like':'%'+_0x5645e5['query'][_0x9bf0('0x34')]+'%'};return _0x4e67cf;})});}_0x30ea42=_[_0x9bf0('0x36')]({},_0x30ea42,_0x5645e5[_0x9bf0('0x3f')]);return _0x55bb26[_0x9bf0('0x59')](_0x30ea42);}})['then'](function(_0x4eb61d){if(_0x4eb61d){_0x3494bc=_0x4eb61d[_0x9bf0('0x3e')];if(!_0x5645e5[_0x9bf0('0x2a')]['hasOwnProperty'](_0x9bf0('0x30'))){_0x30ea42[_0x9bf0('0x1b')]=qs[_0x9bf0('0x1b')](_0x5645e5['query'][_0x9bf0('0x1b')]);_0x30ea42[_0x9bf0('0x1a')]=qs[_0x9bf0('0x1a')](_0x5645e5[_0x9bf0('0x2a')][_0x9bf0('0x1a')]);}return _0x55bb26[_0x9bf0('0x59')](_0x30ea42);}})[_0x9bf0('0x1f')](function(_0x5ef637){if(_0x5ef637){return _0x5ef637?{'count':_0x3494bc,'rows':_0x5ef637}:null;}})[_0x9bf0('0x1f')](respondWithResult(_0xa27b5c,null))['catch'](handleError(_0xa27b5c,null));};exports[_0x9bf0('0x5b')]=function(_0x4f4725,_0x3a9dd5,_0x1e233b){var _0x43611d,_0x4743c4;return db['Campaign'][_0x9bf0('0x40')]({'where':{'id':_0x4f4725[_0x9bf0('0x3d')]['id']}})[_0x9bf0('0x1f')](handleEntityNotFound(_0x3a9dd5,null))[_0x9bf0('0x1f')](function(_0x15d801){if(_0x15d801){_0x4743c4=_0x15d801;return _0x15d801[_0x9bf0('0x5b')](_0x4f4725[_0x9bf0('0x43')][_0x9bf0('0x5c')],_[_0x9bf0('0x4a')](_0x4f4725[_0x9bf0('0x43')],[_0x9bf0('0x5c'),'id'])||{});}return null;})['spread'](function(_0x189623){var _0x138781;_0x43611d=_0x189623||[];var _0x328fa4=[];if(_0x189623){for(var _0x37bacb=0x0;_0x37bacb<_0x189623['length'];_0x37bacb+=0x1){var _0x5941c3=_0x189623[_0x37bacb][_0x9bf0('0x20')]({'plain':!![]});_0x4743c4[_0x9bf0('0x5d')]=_0x4f4725[_0x9bf0('0x43')][_0x9bf0('0x5d')]?_0x4f4725[_0x9bf0('0x43')][_0x9bf0('0x5d')]:_0x4743c4[_0x9bf0('0x5d')];switch(_0x4743c4[_0x9bf0('0x5d')]){case _0x9bf0('0x5e'):_0x138781=squel[_0x9bf0('0x5f')]()['into'](_0x9bf0('0x60'))[_0x9bf0('0x61')](['phone',_0x9bf0('0x62'),_0x9bf0('0x63'),_0x9bf0('0x64'),_0x9bf0('0x52'),_0x9bf0('0x4b'),_0x9bf0('0x4c')],squel[_0x9bf0('0x65')]()[_0x9bf0('0x3a')](_0x9bf0('0x66'),_0x9bf0('0x66'))[_0x9bf0('0x3a')](_0x9bf0('0x67'),_0x9bf0('0x62'))[_0x9bf0('0x3a')]('id',_0x9bf0('0x63'))[_0x9bf0('0x3a')](_0x5941c3[_0x9bf0('0x68')][_0x9bf0('0x69')](),_0x9bf0('0x64'))[_0x9bf0('0x3a')](_0x4f4725[_0x9bf0('0x3d')]['id']['toString'](),_0x9bf0('0x52'))[_0x9bf0('0x3a')](_0x9bf0('0x67'),_0x9bf0('0x4b'))[_0x9bf0('0x3a')](_0x9bf0('0x67'),_0x9bf0('0x4c'))[_0x9bf0('0x6a')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x9bf0('0x35')]('ListId\x20=\x20?',_0x5941c3[_0x9bf0('0x68')][_0x9bf0('0x69')]())[_0x9bf0('0x35')](_0x9bf0('0x6b'))[_0x9bf0('0x35')](_0x9bf0('0x6c'),squel[_0x9bf0('0x65')]()['field'](_0x9bf0('0x6d'))[_0x9bf0('0x6a')]('cm_hopper_final')[_0x9bf0('0x35')]('CampaignId\x20=\x20?',_0x4f4725[_0x9bf0('0x3d')]['id'][_0x9bf0('0x69')]()))['where'](_0x9bf0('0x6c'),squel[_0x9bf0('0x65')]()[_0x9bf0('0x3a')](_0x9bf0('0x6e'))[_0x9bf0('0x6a')](_0x9bf0('0x60'))[_0x9bf0('0x35')](_0x9bf0('0x6f'),_0x4f4725[_0x9bf0('0x3d')]['id'][_0x9bf0('0x69')]())))[_0x9bf0('0x69')]();break;case _0x9bf0('0x70'):_0x138781=squel[_0x9bf0('0x5f')]()[_0x9bf0('0x71')](_0x9bf0('0x60'))['fromQuery']([_0x9bf0('0x66'),_0x9bf0('0x62'),_0x9bf0('0x63'),_0x9bf0('0x64'),'CampaignId','createdAt','updatedAt'],squel['select']()[_0x9bf0('0x3a')]('phone',_0x9bf0('0x66'))[_0x9bf0('0x3a')](_0x9bf0('0x67'),_0x9bf0('0x62'))['field']('id',_0x9bf0('0x63'))[_0x9bf0('0x3a')](_0x5941c3['CmListId'][_0x9bf0('0x69')](),_0x9bf0('0x64'))[_0x9bf0('0x3a')](_0x4f4725[_0x9bf0('0x3d')]['id'][_0x9bf0('0x69')](),_0x9bf0('0x52'))[_0x9bf0('0x3a')]('NOW()',_0x9bf0('0x4b'))[_0x9bf0('0x3a')](_0x9bf0('0x67'),'updatedAt')[_0x9bf0('0x6a')](_0x9bf0('0x72'))[_0x9bf0('0x35')](_0x9bf0('0x73'))['where']('ListId\x20=\x20?',_0x5941c3[_0x9bf0('0x68')][_0x9bf0('0x69')]())[_0x9bf0('0x35')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x9bf0('0x6c'),squel[_0x9bf0('0x65')]()[_0x9bf0('0x3a')](_0x9bf0('0x6e'))[_0x9bf0('0x6a')]('cm_hopper')[_0x9bf0('0x35')](_0x9bf0('0x6f'),_0x4f4725[_0x9bf0('0x3d')]['id'][_0x9bf0('0x69')]())))[_0x9bf0('0x69')]();break;default:_0x138781=squel[_0x9bf0('0x5f')]()['into']('cm_hopper')[_0x9bf0('0x61')](['phone',_0x9bf0('0x62'),_0x9bf0('0x63'),_0x9bf0('0x64'),'CampaignId',_0x9bf0('0x4b'),_0x9bf0('0x4c')],squel[_0x9bf0('0x65')]()[_0x9bf0('0x3a')](_0x9bf0('0x66'),_0x9bf0('0x66'))[_0x9bf0('0x3a')]('NOW()',_0x9bf0('0x62'))[_0x9bf0('0x3a')]('id',_0x9bf0('0x63'))[_0x9bf0('0x3a')](_0x5941c3[_0x9bf0('0x68')][_0x9bf0('0x69')](),_0x9bf0('0x64'))[_0x9bf0('0x3a')](_0x4f4725['params']['id'][_0x9bf0('0x69')](),'CampaignId')[_0x9bf0('0x3a')](_0x9bf0('0x67'),_0x9bf0('0x4b'))[_0x9bf0('0x3a')](_0x9bf0('0x67'),_0x9bf0('0x4c'))[_0x9bf0('0x6a')](_0x9bf0('0x72'))['where'](_0x9bf0('0x73'))[_0x9bf0('0x35')](_0x9bf0('0x74'),_0x5941c3[_0x9bf0('0x68')][_0x9bf0('0x69')]())[_0x9bf0('0x35')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x328fa4[_0x9bf0('0x75')](db[_0x9bf0('0x76')][_0x9bf0('0x2a')](_0x138781));}return BPromise[_0x9bf0('0x77')](_0x328fa4);}})[_0x9bf0('0x1f')](function(){return _0x43611d;})[_0x9bf0('0x1f')](respondWithResult(_0x3a9dd5,null))['catch'](handleError(_0x3a9dd5,null));};exports[_0x9bf0('0x78')]=function(_0x4980ad,_0x2b605b,_0x47bf0a){return db[_0x9bf0('0x3b')][_0x9bf0('0x40')]({'where':{'id':_0x4980ad['params']['id']}})[_0x9bf0('0x1f')](handleEntityNotFound(_0x2b605b,null))[_0x9bf0('0x1f')](function(_0x37753c){if(_0x37753c){return _0x37753c[_0x9bf0('0x78')](_0x4980ad['query'][_0x9bf0('0x5c')]);}})[_0x9bf0('0x1f')](function(_0x28c700){if(_0x28c700){return db[_0x9bf0('0x51')][_0x9bf0('0x23')]({'where':{'ListId':_0x4980ad[_0x9bf0('0x2a')][_0x9bf0('0x5c')],'CampaignId':_0x4980ad[_0x9bf0('0x3d')]['id']}})['then'](function(){return _0x28c700;});}})[_0x9bf0('0x1f')](respondWithStatusCode(_0x2b605b,null))['catch'](handleError(_0x2b605b,null));};exports[_0x9bf0('0x79')]=function(_0xfec05e,_0x2b81b7,_0x5a5c1e){var _0x75c14c={'raw':!![],'where':{}};var _0xd1c543={};var _0x55250d={'count':0x0,'rows':[]};return db[_0x9bf0('0x3b')]['findOne']({'where':{'id':_0xfec05e['params']['id']}})[_0x9bf0('0x1f')](handleEntityNotFound(_0x2b81b7,null))[_0x9bf0('0x1f')](function(_0x47c7cd){if(_0x47c7cd){_0xd1c543[_0x9bf0('0x28')]=_[_0x9bf0('0x29')](db['CmList'][_0x9bf0('0x27')]);_0xd1c543[_0x9bf0('0x2a')]=_[_0x9bf0('0x29')](_0xfec05e[_0x9bf0('0x2a')]);_0xd1c543[_0x9bf0('0x2b')]=_['intersection'](_0xd1c543[_0x9bf0('0x28')],_0xd1c543[_0x9bf0('0x2a')]);_0x75c14c['attributes']=_[_0x9bf0('0x2c')](_0xd1c543[_0x9bf0('0x28')],qs['fields'](_0xfec05e[_0x9bf0('0x2a')]['fields']));_0x75c14c[_0x9bf0('0x2d')]=_0x75c14c['attributes'][_0x9bf0('0x3e')]?_0x75c14c[_0x9bf0('0x2d')]:_0xd1c543['model'];if(!_0xfec05e[_0x9bf0('0x2a')]['hasOwnProperty'](_0x9bf0('0x30'))){_0x75c14c[_0x9bf0('0x1b')]=qs['limit'](_0xfec05e[_0x9bf0('0x2a')]['limit']);_0x75c14c[_0x9bf0('0x1a')]=qs[_0x9bf0('0x1a')](_0xfec05e['query']['offset']);}_0x75c14c[_0x9bf0('0x31')]=qs[_0x9bf0('0x32')](_0xfec05e[_0x9bf0('0x2a')][_0x9bf0('0x32')]);_0x75c14c[_0x9bf0('0x35')]=qs[_0x9bf0('0x2b')](_[_0x9bf0('0x33')](_0xfec05e['query'],_0xd1c543['filters']));_0x75c14c[_0x9bf0('0x35')][_0x9bf0('0x52')]=_0x47c7cd['id'];if(_0xfec05e['query'][_0x9bf0('0x34')]){_0x75c14c[_0x9bf0('0x35')]=_[_0x9bf0('0x36')](_0x75c14c[_0x9bf0('0x35')],{'$or':_[_0x9bf0('0x37')](_0x75c14c[_0x9bf0('0x2d')],function(_0x1fce7c){var _0x3fc9c8={};_0x3fc9c8[_0x1fce7c]={'$like':'%'+_0xfec05e[_0x9bf0('0x2a')][_0x9bf0('0x34')]+'%'};return _0x3fc9c8;})});}_0x75c14c=_[_0x9bf0('0x36')]({},_0x75c14c,_0xfec05e['options']);return db['CmList'][_0x9bf0('0x19')]({'where':_0x75c14c[_0x9bf0('0x35')]})['then'](function(_0x1287c1){_0x55250d['count']=_0x1287c1;if(_0xfec05e[_0x9bf0('0x2a')][_0x9bf0('0x3c')]){_0x75c14c[_0x9bf0('0x49')]=[{'all':!![]}];}return db[_0x9bf0('0x5a')][_0x9bf0('0x53')](_0x75c14c);})['then'](function(_0x2ea575){_0x55250d['rows']=_0x2ea575;return _0x55250d;});}})[_0x9bf0('0x1f')](respondWithFilteredResult(_0x2b81b7,_0x75c14c))[_0x9bf0('0x41')](handleError(_0x2b81b7,null));};exports[_0x9bf0('0x7a')]=function(_0x2de588,_0x34a6f0,_0x2edb74){var _0x5c8323,_0x5daa3c;return db['Campaign'][_0x9bf0('0x40')]({'where':{'id':_0x2de588[_0x9bf0('0x3d')]['id']}})[_0x9bf0('0x1f')](handleEntityNotFound(_0x34a6f0,null))[_0x9bf0('0x1f')](function(_0x28f758){if(_0x28f758){_0x5daa3c=_0x28f758;return _0x28f758[_0x9bf0('0x7a')](_0x2de588[_0x9bf0('0x43')]['ids'],_[_0x9bf0('0x4a')](_0x2de588[_0x9bf0('0x43')],[_0x9bf0('0x5c'),'id'])||{});}return null;})[_0x9bf0('0x7b')](function(_0xdb4d5b){var _0x1e1b3f;_0x5c8323=_0xdb4d5b||[];var _0x5b3aec=[];if(_0xdb4d5b){for(var _0x17c907=0x0;_0x17c907<_0xdb4d5b[_0x9bf0('0x3e')];_0x17c907+=0x1){var _0x43d5c2=_0xdb4d5b[_0x17c907][_0x9bf0('0x20')]({'plain':!![]});_0x1e1b3f=squel[_0x9bf0('0x5f')]()[_0x9bf0('0x71')]('cm_hopper_black')['fromQuery']([_0x9bf0('0x66'),_0x9bf0('0x63'),'ListId',_0x9bf0('0x52'),_0x9bf0('0x4b'),'updatedAt'],squel[_0x9bf0('0x65')]()['field']('phone','phone')[_0x9bf0('0x3a')]('id',_0x9bf0('0x63'))['field'](_0x43d5c2[_0x9bf0('0x68')][_0x9bf0('0x69')](),_0x9bf0('0x64'))[_0x9bf0('0x3a')](_0x2de588[_0x9bf0('0x3d')]['id'][_0x9bf0('0x69')](),'CampaignId')[_0x9bf0('0x3a')](_0x9bf0('0x67'),'createdAt')[_0x9bf0('0x3a')]('NOW()',_0x9bf0('0x4c'))['from'](_0x9bf0('0x72'))[_0x9bf0('0x35')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x43d5c2[_0x9bf0('0x68')][_0x9bf0('0x69')]())['where'](_0x9bf0('0x6b')))[_0x9bf0('0x69')]();_0x5b3aec[_0x9bf0('0x75')](db[_0x9bf0('0x76')][_0x9bf0('0x2a')](_0x1e1b3f));}return BPromise['all'](_0x5b3aec);}})['then'](function(){return _0x5c8323;})['then'](respondWithResult(_0x34a6f0,null))['catch'](handleError(_0x34a6f0,null));};exports[_0x9bf0('0x7c')]=function(_0x21d76d,_0x38289e,_0x27ba2c){return db['Campaign'][_0x9bf0('0x40')]({'where':{'id':_0x21d76d[_0x9bf0('0x3d')]['id']}})['then'](handleEntityNotFound(_0x38289e,null))[_0x9bf0('0x1f')](function(_0xf87466){if(_0xf87466){return _0xf87466['removeBlackLists'](_0x21d76d[_0x9bf0('0x2a')][_0x9bf0('0x5c')]);}})[_0x9bf0('0x1f')](function(_0x2f18e3){if(_0x2f18e3){return db[_0x9bf0('0x58')]['destroy']({'where':{'ListId':_0x21d76d['query'][_0x9bf0('0x5c')],'CampaignId':_0x21d76d[_0x9bf0('0x3d')]['id']}})[_0x9bf0('0x1f')](function(){return _0x2f18e3;});}})[_0x9bf0('0x1f')](respondWithStatusCode(_0x38289e,null))['catch'](handleError(_0x38289e,null));}; \ No newline at end of file +var _0xc4e6=['../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','apply','reject','update','destroy','then','get','UserProfileResource','name','send','index','Campaign','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','field','options','includeAll','findAll','rows','catch','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','IvrCampaigns','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','include','omit','createdAt','updatedAt','getHoppers','CmHopper','CampaignId','filter','map','getHopperHistories','findOne','CmHopperHistory','CmHopperFinal','CmHopperBlack','getLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','CmListId','toString','NOW()','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','select','cm_contacts','phone\x20IS\x20NOT\x20NULL','COALESCE(phone,\x27\x27)','push','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','sequelize','removeBlackLists','html-pdf','rimraf','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/utils'];(function(_0x4963b2,_0x379b50){var _0x442301=function(_0x342093){while(--_0x342093){_0x4963b2['push'](_0x4963b2['shift']());}};_0x442301(++_0x379b50);}(_0xc4e6,0xe5));var _0x6c4e=function(_0x1a8bbc,_0x17a086){_0x1a8bbc=_0x1a8bbc-0x0;var _0x212fc2=_0xc4e6[_0x1a8bbc];return _0x212fc2;};'use strict';var pdf=require(_0x6c4e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6c4e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6c4e('0x2'));var moment=require('moment');var BPromise=require(_0x6c4e('0x3'));var Mustache=require(_0x6c4e('0x4'));var util=require(_0x6c4e('0x5'));var path=require('path');var sox=require(_0x6c4e('0x6'));var csv=require(_0x6c4e('0x7'));var ejs=require(_0x6c4e('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6c4e('0x9'));var crypto=require(_0x6c4e('0xa'));var jsforce=require(_0x6c4e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x6c4e('0x7'));var querystring=require(_0x6c4e('0xc'));var Papa=require(_0x6c4e('0xd'));var Redis=require('ioredis');var authService=require(_0x6c4e('0xe'));var qs=require(_0x6c4e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x6c4e('0x10'));var config=require(_0x6c4e('0x11'));var db=require(_0x6c4e('0x12'))['db'];function respondWithStatusCode(_0x380f62,_0x28dfb6){_0x28dfb6=_0x28dfb6||0xcc;return function(_0x3c4bf2){if(_0x3c4bf2){return _0x380f62[_0x6c4e('0x13')](_0x28dfb6);}return _0x380f62[_0x6c4e('0x14')](_0x28dfb6)[_0x6c4e('0x15')]();};}function respondWithResult(_0x21043c,_0x4cea94){_0x4cea94=_0x4cea94||0xc8;return function(_0x335bab){if(_0x335bab){return _0x21043c[_0x6c4e('0x14')](_0x4cea94)[_0x6c4e('0x16')](_0x335bab);}};}function respondWithFilteredResult(_0x4c50b2,_0x37ff78){return function(_0x43f03d){if(_0x43f03d){var _0x18fd8e=_0x43f03d[_0x6c4e('0x17')],_0x5c87fd=_0x37ff78[_0x6c4e('0x18')],_0x5bd8f8=_0x37ff78[_0x6c4e('0x18')]+_0x37ff78[_0x6c4e('0x19')],_0x13563c;if(_0x5bd8f8>=_0x18fd8e){_0x5bd8f8=_0x18fd8e;_0x13563c=0xc8;}else{_0x13563c=0xce;}_0x4c50b2[_0x6c4e('0x14')](_0x13563c);return _0x4c50b2['set']('Content-Range',_0x5c87fd+'-'+_0x5bd8f8+'/'+_0x18fd8e)[_0x6c4e('0x16')](_0x43f03d);}return null;};}function patchUpdates(_0x4db819){return function(_0x1b9793){try{jsonpatch[_0x6c4e('0x1a')](_0x1b9793,_0x4db819,!![]);}catch(_0x64a7ee){return BPromise[_0x6c4e('0x1b')](_0x64a7ee);}return _0x1b9793['save']();};}function saveUpdates(_0x591c2f,_0x12244b){return function(_0x4d3b02){if(_0x4d3b02){return _0x4d3b02[_0x6c4e('0x1c')](_0x591c2f)['then'](function(_0x9a932b){return _0x9a932b;});}return null;};}function removeEntity(_0x237af7,_0x100216){return function(_0x3c0db0){if(_0x3c0db0){return _0x3c0db0[_0x6c4e('0x1d')]()[_0x6c4e('0x1e')](function(){var _0x4fcd53=_0x3c0db0[_0x6c4e('0x1f')]({'plain':!![]});var _0x16f174='IvrCampaigns';return db[_0x6c4e('0x20')][_0x6c4e('0x1d')]({'where':{'type':_0x16f174,'resourceId':_0x4fcd53['id']}})['then'](function(){return _0x3c0db0;});})[_0x6c4e('0x1e')](function(){_0x237af7[_0x6c4e('0x14')](0xcc)[_0x6c4e('0x15')]();});}};}function handleEntityNotFound(_0x1ceecc,_0x3ff340){return function(_0x1bf5da){if(!_0x1bf5da){_0x1ceecc[_0x6c4e('0x13')](0x194);}return _0x1bf5da;};}function handleError(_0x555d39,_0x27ddf4){_0x27ddf4=_0x27ddf4||0x1f4;return function(_0x283f04){logger['error'](_0x283f04['stack']);if(_0x283f04[_0x6c4e('0x21')]){delete _0x283f04['name'];}_0x555d39[_0x6c4e('0x14')](_0x27ddf4)[_0x6c4e('0x22')](_0x283f04);};}exports[_0x6c4e('0x23')]=function(_0xef4cb7,_0x486e80){var _0x577b9f={},_0x59d170={},_0x28fa40={'count':0x0,'rows':[]};var _0x1e1b22=db[_0x6c4e('0x24')][_0x6c4e('0x25')];_0x59d170[_0x6c4e('0x26')]=_[_0x6c4e('0x27')](_0x1e1b22);_0x59d170[_0x6c4e('0x28')]=_['keys'](_0xef4cb7[_0x6c4e('0x28')]);_0x59d170[_0x6c4e('0x29')]=_[_0x6c4e('0x2a')](_0x59d170[_0x6c4e('0x26')],_0x59d170['query']);_0x577b9f['attributes']=_[_0x6c4e('0x2a')](_0x59d170['model'],qs['fields'](_0xef4cb7[_0x6c4e('0x28')][_0x6c4e('0x2b')]));_0x577b9f[_0x6c4e('0x2c')]=_0x577b9f[_0x6c4e('0x2c')][_0x6c4e('0x2d')]?_0x577b9f['attributes']:_0x59d170[_0x6c4e('0x26')];if(!_0xef4cb7[_0x6c4e('0x28')][_0x6c4e('0x2e')](_0x6c4e('0x2f'))){_0x577b9f['limit']=qs['limit'](_0xef4cb7['query']['limit']);_0x577b9f[_0x6c4e('0x18')]=qs['offset'](_0xef4cb7['query'][_0x6c4e('0x18')]);}_0x577b9f[_0x6c4e('0x30')]=qs[_0x6c4e('0x31')](_0xef4cb7[_0x6c4e('0x28')]['sort']);_0x577b9f[_0x6c4e('0x32')]=qs['filters'](_[_0x6c4e('0x33')](_0xef4cb7[_0x6c4e('0x28')],_0x59d170[_0x6c4e('0x29')]));if(_0xef4cb7[_0x6c4e('0x28')]['filter']){_0x577b9f[_0x6c4e('0x32')]=_[_0x6c4e('0x34')](_0x577b9f[_0x6c4e('0x32')],{'$or':_['map'](_0x1e1b22,function(_0x543f86){if(_0x543f86['type']['key']!=='VIRTUAL'){var _0x43cc66={};_0x43cc66[_0x543f86[_0x6c4e('0x35')]]={'$like':'%'+_0xef4cb7[_0x6c4e('0x28')]['filter']+'%'};return _0x43cc66;}})});}_0x577b9f=_[_0x6c4e('0x34')]({},_0x577b9f,_0xef4cb7[_0x6c4e('0x36')]);var _0x55aa19={'where':_0x577b9f['where']};return db[_0x6c4e('0x24')][_0x6c4e('0x17')](_0x55aa19)[_0x6c4e('0x1e')](function(_0x1f0f02){_0x28fa40[_0x6c4e('0x17')]=_0x1f0f02;if(_0xef4cb7['query'][_0x6c4e('0x37')]){_0x577b9f['include']=[{'all':!![]}];}return db['Campaign'][_0x6c4e('0x38')](_0x577b9f);})[_0x6c4e('0x1e')](function(_0x33d750){_0x28fa40[_0x6c4e('0x39')]=_0x33d750;return _0x28fa40;})['then'](respondWithFilteredResult(_0x486e80,_0x577b9f))[_0x6c4e('0x3a')](handleError(_0x486e80,null));};exports['show']=function(_0x56acf5,_0x49b229){var _0x18a8a3={'raw':![],'where':{'id':_0x56acf5[_0x6c4e('0x3b')]['id']}},_0x5047ec={};_0x5047ec[_0x6c4e('0x26')]=_[_0x6c4e('0x27')](db[_0x6c4e('0x24')][_0x6c4e('0x25')]);_0x5047ec['query']=_[_0x6c4e('0x27')](_0x56acf5[_0x6c4e('0x28')]);_0x5047ec[_0x6c4e('0x29')]=_[_0x6c4e('0x2a')](_0x5047ec['model'],_0x5047ec[_0x6c4e('0x28')]);_0x18a8a3[_0x6c4e('0x2c')]=_[_0x6c4e('0x2a')](_0x5047ec[_0x6c4e('0x26')],qs[_0x6c4e('0x2b')](_0x56acf5[_0x6c4e('0x28')][_0x6c4e('0x2b')]));_0x18a8a3[_0x6c4e('0x2c')]=_0x18a8a3[_0x6c4e('0x2c')][_0x6c4e('0x2d')]?_0x18a8a3[_0x6c4e('0x2c')]:_0x5047ec['model'];if(_0x56acf5[_0x6c4e('0x28')]['includeAll']){_0x18a8a3['include']=[{'all':!![]}];}_0x18a8a3=_[_0x6c4e('0x34')]({},_0x18a8a3,_0x56acf5['options']);return db['Campaign'][_0x6c4e('0x3c')](_0x18a8a3)[_0x6c4e('0x1e')](handleEntityNotFound(_0x49b229,null))[_0x6c4e('0x1e')](respondWithResult(_0x49b229,null))[_0x6c4e('0x3a')](handleError(_0x49b229,null));};exports['create']=function(_0x98670f,_0x408c88){return db[_0x6c4e('0x24')][_0x6c4e('0x3d')](_0x98670f[_0x6c4e('0x3e')],{})['then'](function(_0x1eab8e){var _0x37ffff=_0x98670f['user'][_0x6c4e('0x1f')]({'plain':!![]});if(!_0x37ffff)throw new Error(_0x6c4e('0x3f'));if(_0x37ffff[_0x6c4e('0x40')]===_0x6c4e('0x41')){var _0xedf25=_0x1eab8e[_0x6c4e('0x1f')]({'plain':!![]});var _0x21c939=_0x6c4e('0x42');return db[_0x6c4e('0x43')]['find']({'where':{'name':_0x21c939,'userProfileId':_0x37ffff[_0x6c4e('0x44')]},'raw':!![]})[_0x6c4e('0x1e')](function(_0x47bd5c){if(_0x47bd5c&&_0x47bd5c[_0x6c4e('0x45')]===0x0){return db['UserProfileResource'][_0x6c4e('0x3d')]({'name':_0xedf25[_0x6c4e('0x21')],'resourceId':_0xedf25['id'],'type':_0x47bd5c[_0x6c4e('0x21')],'sectionId':_0x47bd5c['id']},{})[_0x6c4e('0x1e')](function(){return _0x1eab8e;});}else{return _0x1eab8e;}})['catch'](function(_0x479b0e){logger[_0x6c4e('0x46')](_0x6c4e('0x47'),_0x479b0e);throw _0x479b0e;});}return _0x1eab8e;})['then'](respondWithResult(_0x408c88,0xc9))[_0x6c4e('0x3a')](handleError(_0x408c88,null));};exports[_0x6c4e('0x48')]=function(_0x3ccedc,_0x102143){var _0x4caf1a={'raw':![],'where':{'id':_0x3ccedc[_0x6c4e('0x3b')]['id']}},_0x418913={};_0x418913['model']=_[_0x6c4e('0x27')](db[_0x6c4e('0x24')][_0x6c4e('0x25')]);_0x4caf1a[_0x6c4e('0x2c')]=_[_0x6c4e('0x2a')](_0x418913['model'],qs['fields'](_0x3ccedc['query']['fields']));_0x4caf1a[_0x6c4e('0x2c')]=_0x4caf1a[_0x6c4e('0x2c')][_0x6c4e('0x2d')]?_0x4caf1a['attributes']:_0x418913['model'];if(_0x3ccedc[_0x6c4e('0x28')][_0x6c4e('0x37')]){_0x4caf1a[_0x6c4e('0x49')]=[{'all':!![]}];}_0x4caf1a=_['merge']({},_0x4caf1a,_0x3ccedc['options']);return db['Campaign'][_0x6c4e('0x3c')](_0x4caf1a)[_0x6c4e('0x1e')](handleEntityNotFound(_0x102143,null))[_0x6c4e('0x1e')](function(_0x60645f){if(_0x60645f){var _0x57a929=_0x60645f['get']({'plain':!![]});_0x57a929=qs[_0x6c4e('0x4a')](_0x57a929,['id',_0x6c4e('0x4b'),_0x6c4e('0x4c')]);_0x3ccedc[_0x6c4e('0x3e')]=_[_0x6c4e('0x4a')](_0x3ccedc[_0x6c4e('0x3e')],['id','createdAt',_0x6c4e('0x4c')]);return db[_0x6c4e('0x24')][_0x6c4e('0x3d')](_['merge'](_0x57a929,_0x3ccedc[_0x6c4e('0x3e')]),{'include':_0x3ccedc[_0x6c4e('0x28')][_0x6c4e('0x37')]?[{'all':!![]}]:undefined})[_0x6c4e('0x1e')](function(_0x29335e){var _0x3b425f=_0x3ccedc['user'][_0x6c4e('0x1f')]({'plain':!![]});if(!_0x3b425f)throw new Error(_0x6c4e('0x3f'));if(_0x3b425f['role']===_0x6c4e('0x41')){var _0x340b95=_0x29335e[_0x6c4e('0x1f')]({'plain':!![]});var _0x2b899c='IvrCampaigns';return db[_0x6c4e('0x43')][_0x6c4e('0x3c')]({'where':{'name':_0x2b899c,'userProfileId':_0x3b425f[_0x6c4e('0x44')]},'raw':!![]})[_0x6c4e('0x1e')](function(_0x1cd75c){if(_0x1cd75c&&_0x1cd75c[_0x6c4e('0x45')]===0x0){return db[_0x6c4e('0x20')][_0x6c4e('0x3d')]({'name':_0x340b95[_0x6c4e('0x21')],'resourceId':_0x340b95['id'],'type':_0x1cd75c[_0x6c4e('0x21')],'sectionId':_0x1cd75c['id']},{})[_0x6c4e('0x1e')](function(){return _0x29335e;});}else{return _0x29335e;}})[_0x6c4e('0x3a')](function(_0x29b65b){logger[_0x6c4e('0x46')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x29b65b);throw _0x29b65b;});}return _0x29335e;});}})[_0x6c4e('0x1e')](respondWithResult(_0x102143,0xc9))[_0x6c4e('0x3a')](handleError(_0x102143,null));};exports[_0x6c4e('0x1c')]=function(_0x424b75,_0x22b784){if(_0x424b75[_0x6c4e('0x3e')]['id']){delete _0x424b75[_0x6c4e('0x3e')]['id'];}return db[_0x6c4e('0x24')][_0x6c4e('0x3c')]({'where':{'id':_0x424b75[_0x6c4e('0x3b')]['id']}})[_0x6c4e('0x1e')](handleEntityNotFound(_0x22b784,null))[_0x6c4e('0x1e')](saveUpdates(_0x424b75[_0x6c4e('0x3e')],null))[_0x6c4e('0x1e')](respondWithResult(_0x22b784,null))[_0x6c4e('0x3a')](handleError(_0x22b784,null));};exports[_0x6c4e('0x1d')]=function(_0x4bc211,_0x592dcf){return db[_0x6c4e('0x24')][_0x6c4e('0x3c')]({'where':{'id':_0x4bc211['params']['id']}})[_0x6c4e('0x1e')](handleEntityNotFound(_0x592dcf,null))[_0x6c4e('0x1e')](removeEntity(_0x592dcf,null))['catch'](handleError(_0x592dcf,null));};exports[_0x6c4e('0x4d')]=function(_0x4fb4b2,_0x48b918,_0x211373){var _0x39ced4={'raw':!![],'where':{}};var _0x579f4f={};var _0x28c6a7={'count':0x0,'rows':[]};return db[_0x6c4e('0x24')]['findOne']({'where':{'id':_0x4fb4b2['params']['id']}})[_0x6c4e('0x1e')](handleEntityNotFound(_0x48b918,null))[_0x6c4e('0x1e')](function(_0x2b0f7f){if(_0x2b0f7f){_0x579f4f[_0x6c4e('0x26')]=_[_0x6c4e('0x27')](db[_0x6c4e('0x4e')][_0x6c4e('0x25')]);_0x579f4f[_0x6c4e('0x28')]=_[_0x6c4e('0x27')](_0x4fb4b2['query']);_0x579f4f['filters']=_[_0x6c4e('0x2a')](_0x579f4f[_0x6c4e('0x26')],_0x579f4f[_0x6c4e('0x28')]);_0x39ced4[_0x6c4e('0x2c')]=_[_0x6c4e('0x2a')](_0x579f4f[_0x6c4e('0x26')],qs[_0x6c4e('0x2b')](_0x4fb4b2['query']['fields']));_0x39ced4[_0x6c4e('0x2c')]=_0x39ced4[_0x6c4e('0x2c')][_0x6c4e('0x2d')]?_0x39ced4[_0x6c4e('0x2c')]:_0x579f4f[_0x6c4e('0x26')];if(!_0x4fb4b2[_0x6c4e('0x28')]['hasOwnProperty']('nolimit')){_0x39ced4[_0x6c4e('0x19')]=qs[_0x6c4e('0x19')](_0x4fb4b2[_0x6c4e('0x28')][_0x6c4e('0x19')]);_0x39ced4[_0x6c4e('0x18')]=qs[_0x6c4e('0x18')](_0x4fb4b2['query'][_0x6c4e('0x18')]);}_0x39ced4['order']=qs[_0x6c4e('0x31')](_0x4fb4b2[_0x6c4e('0x28')][_0x6c4e('0x31')]);_0x39ced4[_0x6c4e('0x32')]=qs[_0x6c4e('0x29')](_[_0x6c4e('0x33')](_0x4fb4b2[_0x6c4e('0x28')],_0x579f4f[_0x6c4e('0x29')]));_0x39ced4[_0x6c4e('0x32')][_0x6c4e('0x4f')]=_0x2b0f7f['id'];if(_0x4fb4b2[_0x6c4e('0x28')][_0x6c4e('0x50')]){_0x39ced4[_0x6c4e('0x32')]=_['merge'](_0x39ced4['where'],{'$or':_[_0x6c4e('0x51')](_0x39ced4['attributes'],function(_0x3cf174){var _0x367afc={};_0x367afc[_0x3cf174]={'$like':'%'+_0x4fb4b2[_0x6c4e('0x28')][_0x6c4e('0x50')]+'%'};return _0x367afc;})});}_0x39ced4=_[_0x6c4e('0x34')]({},_0x39ced4,_0x4fb4b2[_0x6c4e('0x36')]);return db[_0x6c4e('0x4e')][_0x6c4e('0x17')]({'where':_0x39ced4[_0x6c4e('0x32')]})[_0x6c4e('0x1e')](function(_0x48b94c){_0x28c6a7[_0x6c4e('0x17')]=_0x48b94c;if(_0x4fb4b2['query'][_0x6c4e('0x37')]){_0x39ced4['include']=[{'all':!![]}];}return db[_0x6c4e('0x4e')][_0x6c4e('0x38')](_0x39ced4);})[_0x6c4e('0x1e')](function(_0x5ee17c){_0x28c6a7[_0x6c4e('0x39')]=_0x5ee17c;return _0x28c6a7;});}})[_0x6c4e('0x1e')](respondWithFilteredResult(_0x48b918,_0x39ced4))[_0x6c4e('0x3a')](handleError(_0x48b918,null));};exports[_0x6c4e('0x52')]=function(_0x323bb0,_0x1f6a8d,_0x2169b0){var _0x159364={'raw':!![],'where':{}};var _0x11c099={};var _0x4b9086={'count':0x0,'rows':[]};return db['Campaign'][_0x6c4e('0x53')]({'where':{'id':_0x323bb0[_0x6c4e('0x3b')]['id']}})[_0x6c4e('0x1e')](handleEntityNotFound(_0x1f6a8d,null))[_0x6c4e('0x1e')](function(_0x3c2082){if(_0x3c2082){_0x11c099[_0x6c4e('0x26')]=_[_0x6c4e('0x27')](db['CmHopperHistory'][_0x6c4e('0x25')]);_0x11c099[_0x6c4e('0x28')]=_[_0x6c4e('0x27')](_0x323bb0[_0x6c4e('0x28')]);_0x11c099[_0x6c4e('0x29')]=_[_0x6c4e('0x2a')](_0x11c099[_0x6c4e('0x26')],_0x11c099[_0x6c4e('0x28')]);_0x159364[_0x6c4e('0x2c')]=_['intersection'](_0x11c099[_0x6c4e('0x26')],qs[_0x6c4e('0x2b')](_0x323bb0[_0x6c4e('0x28')]['fields']));_0x159364[_0x6c4e('0x2c')]=_0x159364[_0x6c4e('0x2c')]['length']?_0x159364[_0x6c4e('0x2c')]:_0x11c099[_0x6c4e('0x26')];if(!_0x323bb0[_0x6c4e('0x28')][_0x6c4e('0x2e')]('nolimit')){_0x159364[_0x6c4e('0x19')]=qs[_0x6c4e('0x19')](_0x323bb0[_0x6c4e('0x28')][_0x6c4e('0x19')]);_0x159364[_0x6c4e('0x18')]=qs[_0x6c4e('0x18')](_0x323bb0[_0x6c4e('0x28')][_0x6c4e('0x18')]);}_0x159364[_0x6c4e('0x30')]=qs[_0x6c4e('0x31')](_0x323bb0['query'][_0x6c4e('0x31')]);_0x159364[_0x6c4e('0x32')]=qs['filters'](_[_0x6c4e('0x33')](_0x323bb0['query'],_0x11c099['filters']));_0x159364['where'][_0x6c4e('0x4f')]=_0x3c2082['id'];if(_0x323bb0[_0x6c4e('0x28')][_0x6c4e('0x50')]){_0x159364[_0x6c4e('0x32')]=_[_0x6c4e('0x34')](_0x159364[_0x6c4e('0x32')],{'$or':_[_0x6c4e('0x51')](_0x159364['attributes'],function(_0x2e9166){var _0x579b87={};_0x579b87[_0x2e9166]={'$like':'%'+_0x323bb0[_0x6c4e('0x28')]['filter']+'%'};return _0x579b87;})});}_0x159364=_[_0x6c4e('0x34')]({},_0x159364,_0x323bb0[_0x6c4e('0x36')]);return db[_0x6c4e('0x54')]['count']({'where':_0x159364[_0x6c4e('0x32')]})[_0x6c4e('0x1e')](function(_0x559e60){_0x4b9086[_0x6c4e('0x17')]=_0x559e60;if(_0x323bb0['query'][_0x6c4e('0x37')]){_0x159364[_0x6c4e('0x49')]=[{'all':!![]}];}return db[_0x6c4e('0x54')][_0x6c4e('0x38')](_0x159364);})['then'](function(_0x3c5aef){_0x4b9086['rows']=_0x3c5aef;return _0x4b9086;});}})[_0x6c4e('0x1e')](respondWithFilteredResult(_0x1f6a8d,_0x159364))[_0x6c4e('0x3a')](handleError(_0x1f6a8d,null));};exports['getHopperFinals']=function(_0x52fb1f,_0x4361b8,_0x8fab4e){var _0x4c0f3e={'raw':!![],'where':{}};var _0x12ac82={};var _0x455a7f={'count':0x0,'rows':[]};return db[_0x6c4e('0x24')][_0x6c4e('0x53')]({'where':{'id':_0x52fb1f[_0x6c4e('0x3b')]['id']}})[_0x6c4e('0x1e')](handleEntityNotFound(_0x4361b8,null))[_0x6c4e('0x1e')](function(_0x585ee2){if(_0x585ee2){_0x12ac82[_0x6c4e('0x26')]=_[_0x6c4e('0x27')](db[_0x6c4e('0x55')]['rawAttributes']);_0x12ac82[_0x6c4e('0x28')]=_[_0x6c4e('0x27')](_0x52fb1f[_0x6c4e('0x28')]);_0x12ac82['filters']=_[_0x6c4e('0x2a')](_0x12ac82['model'],_0x12ac82[_0x6c4e('0x28')]);_0x4c0f3e[_0x6c4e('0x2c')]=_[_0x6c4e('0x2a')](_0x12ac82[_0x6c4e('0x26')],qs[_0x6c4e('0x2b')](_0x52fb1f[_0x6c4e('0x28')][_0x6c4e('0x2b')]));_0x4c0f3e[_0x6c4e('0x2c')]=_0x4c0f3e[_0x6c4e('0x2c')]['length']?_0x4c0f3e[_0x6c4e('0x2c')]:_0x12ac82['model'];if(!_0x52fb1f['query'][_0x6c4e('0x2e')](_0x6c4e('0x2f'))){_0x4c0f3e[_0x6c4e('0x19')]=qs['limit'](_0x52fb1f[_0x6c4e('0x28')][_0x6c4e('0x19')]);_0x4c0f3e[_0x6c4e('0x18')]=qs[_0x6c4e('0x18')](_0x52fb1f[_0x6c4e('0x28')][_0x6c4e('0x18')]);}_0x4c0f3e['order']=qs[_0x6c4e('0x31')](_0x52fb1f[_0x6c4e('0x28')]['sort']);_0x4c0f3e[_0x6c4e('0x32')]=qs['filters'](_[_0x6c4e('0x33')](_0x52fb1f[_0x6c4e('0x28')],_0x12ac82[_0x6c4e('0x29')]));_0x4c0f3e['where'][_0x6c4e('0x4f')]=_0x585ee2['id'];if(_0x52fb1f[_0x6c4e('0x28')][_0x6c4e('0x50')]){_0x4c0f3e['where']=_['merge'](_0x4c0f3e[_0x6c4e('0x32')],{'$or':_[_0x6c4e('0x51')](_0x4c0f3e[_0x6c4e('0x2c')],function(_0x49de61){var _0x1fc990={};_0x1fc990[_0x49de61]={'$like':'%'+_0x52fb1f[_0x6c4e('0x28')]['filter']+'%'};return _0x1fc990;})});}_0x4c0f3e=_[_0x6c4e('0x34')]({},_0x4c0f3e,_0x52fb1f[_0x6c4e('0x36')]);return db[_0x6c4e('0x55')][_0x6c4e('0x17')]({'where':_0x4c0f3e[_0x6c4e('0x32')]})['then'](function(_0x574514){_0x455a7f[_0x6c4e('0x17')]=_0x574514;if(_0x52fb1f['query'][_0x6c4e('0x37')]){_0x4c0f3e['include']=[{'all':!![]}];}return db[_0x6c4e('0x55')][_0x6c4e('0x38')](_0x4c0f3e);})[_0x6c4e('0x1e')](function(_0xb07bc3){_0x455a7f['rows']=_0xb07bc3;return _0x455a7f;});}})['then'](respondWithFilteredResult(_0x4361b8,_0x4c0f3e))[_0x6c4e('0x3a')](handleError(_0x4361b8,null));};exports['getHopperBlacks']=function(_0x5170e1,_0x3802bb,_0x14fc26){var _0x590739={'raw':!![],'where':{}};var _0x424a60={};var _0x1a57a1={'count':0x0,'rows':[]};return db[_0x6c4e('0x24')][_0x6c4e('0x53')]({'where':{'id':_0x5170e1['params']['id']}})['then'](handleEntityNotFound(_0x3802bb,null))[_0x6c4e('0x1e')](function(_0x2f6eb9){if(_0x2f6eb9){_0x424a60[_0x6c4e('0x26')]=_[_0x6c4e('0x27')](db[_0x6c4e('0x56')][_0x6c4e('0x25')]);_0x424a60[_0x6c4e('0x28')]=_['keys'](_0x5170e1[_0x6c4e('0x28')]);_0x424a60[_0x6c4e('0x29')]=_[_0x6c4e('0x2a')](_0x424a60[_0x6c4e('0x26')],_0x424a60[_0x6c4e('0x28')]);_0x590739['attributes']=_[_0x6c4e('0x2a')](_0x424a60['model'],qs['fields'](_0x5170e1[_0x6c4e('0x28')][_0x6c4e('0x2b')]));_0x590739['attributes']=_0x590739[_0x6c4e('0x2c')][_0x6c4e('0x2d')]?_0x590739[_0x6c4e('0x2c')]:_0x424a60[_0x6c4e('0x26')];if(!_0x5170e1[_0x6c4e('0x28')][_0x6c4e('0x2e')](_0x6c4e('0x2f'))){_0x590739[_0x6c4e('0x19')]=qs['limit'](_0x5170e1[_0x6c4e('0x28')][_0x6c4e('0x19')]);_0x590739[_0x6c4e('0x18')]=qs[_0x6c4e('0x18')](_0x5170e1[_0x6c4e('0x28')][_0x6c4e('0x18')]);}_0x590739[_0x6c4e('0x30')]=qs[_0x6c4e('0x31')](_0x5170e1[_0x6c4e('0x28')][_0x6c4e('0x31')]);_0x590739[_0x6c4e('0x32')]=qs[_0x6c4e('0x29')](_[_0x6c4e('0x33')](_0x5170e1[_0x6c4e('0x28')],_0x424a60[_0x6c4e('0x29')]));_0x590739[_0x6c4e('0x32')]['CampaignId']=_0x2f6eb9['id'];if(_0x5170e1['query'][_0x6c4e('0x50')]){_0x590739[_0x6c4e('0x32')]=_[_0x6c4e('0x34')](_0x590739[_0x6c4e('0x32')],{'$or':_[_0x6c4e('0x51')](_0x590739[_0x6c4e('0x2c')],function(_0x4c7f28){var _0x224595={};_0x224595[_0x4c7f28]={'$like':'%'+_0x5170e1[_0x6c4e('0x28')][_0x6c4e('0x50')]+'%'};return _0x224595;})});}_0x590739=_[_0x6c4e('0x34')]({},_0x590739,_0x5170e1[_0x6c4e('0x36')]);return db[_0x6c4e('0x56')][_0x6c4e('0x17')]({'where':_0x590739[_0x6c4e('0x32')]})[_0x6c4e('0x1e')](function(_0x2dba2a){_0x1a57a1[_0x6c4e('0x17')]=_0x2dba2a;if(_0x5170e1['query']['includeAll']){_0x590739[_0x6c4e('0x49')]=[{'all':!![]}];}return db[_0x6c4e('0x56')][_0x6c4e('0x38')](_0x590739);})['then'](function(_0x5eeaeb){_0x1a57a1[_0x6c4e('0x39')]=_0x5eeaeb;return _0x1a57a1;});}})['then'](respondWithFilteredResult(_0x3802bb,_0x590739))[_0x6c4e('0x3a')](handleError(_0x3802bb,null));};exports[_0x6c4e('0x57')]=function(_0x5b701f,_0x4abf16,_0x40a9ed){var _0x3a74b4={};var _0x4742e8={};var _0x4b441b;var _0x6139dd;return db[_0x6c4e('0x24')]['findOne']({'where':{'id':_0x5b701f[_0x6c4e('0x3b')]['id']}})[_0x6c4e('0x1e')](handleEntityNotFound(_0x4abf16,null))[_0x6c4e('0x1e')](function(_0x4744b3){if(_0x4744b3){_0x4b441b=_0x4744b3;_0x4742e8['model']=_['keys'](db['CmList']['rawAttributes']);_0x4742e8[_0x6c4e('0x28')]=_['keys'](_0x5b701f[_0x6c4e('0x28')]);_0x4742e8[_0x6c4e('0x29')]=_['intersection'](_0x4742e8[_0x6c4e('0x26')],_0x4742e8[_0x6c4e('0x28')]);_0x3a74b4[_0x6c4e('0x2c')]=_[_0x6c4e('0x2a')](_0x4742e8[_0x6c4e('0x26')],qs['fields'](_0x5b701f[_0x6c4e('0x28')][_0x6c4e('0x2b')]));_0x3a74b4[_0x6c4e('0x2c')]=_0x3a74b4[_0x6c4e('0x2c')]['length']?_0x3a74b4[_0x6c4e('0x2c')]:_0x4742e8[_0x6c4e('0x26')];_0x3a74b4[_0x6c4e('0x30')]=qs['sort'](_0x5b701f[_0x6c4e('0x28')][_0x6c4e('0x31')]);_0x3a74b4[_0x6c4e('0x32')]=qs[_0x6c4e('0x29')](_[_0x6c4e('0x33')](_0x5b701f[_0x6c4e('0x28')],_0x4742e8[_0x6c4e('0x29')]));if(_0x5b701f[_0x6c4e('0x28')]['filter']){_0x3a74b4[_0x6c4e('0x32')]=_[_0x6c4e('0x34')](_0x3a74b4[_0x6c4e('0x32')],{'$or':_[_0x6c4e('0x51')](_0x3a74b4[_0x6c4e('0x2c')],function(_0x2b436e){var _0x2374f4={};_0x2374f4[_0x2b436e]={'$like':'%'+_0x5b701f[_0x6c4e('0x28')]['filter']+'%'};return _0x2374f4;})});}_0x3a74b4=_[_0x6c4e('0x34')]({},_0x3a74b4,_0x5b701f['options']);return _0x4b441b[_0x6c4e('0x57')](_0x3a74b4);}})[_0x6c4e('0x1e')](function(_0x5b70a2){if(_0x5b70a2){_0x6139dd=_0x5b70a2[_0x6c4e('0x2d')];if(!_0x5b701f['query'][_0x6c4e('0x2e')]('nolimit')){_0x3a74b4[_0x6c4e('0x19')]=qs['limit'](_0x5b701f[_0x6c4e('0x28')][_0x6c4e('0x19')]);_0x3a74b4[_0x6c4e('0x18')]=qs[_0x6c4e('0x18')](_0x5b701f[_0x6c4e('0x28')]['offset']);}return _0x4b441b[_0x6c4e('0x57')](_0x3a74b4);}})['then'](function(_0x56b20c){if(_0x56b20c){return _0x56b20c?{'count':_0x6139dd,'rows':_0x56b20c}:null;}})[_0x6c4e('0x1e')](respondWithResult(_0x4abf16,null))['catch'](handleError(_0x4abf16,null));};exports['addLists']=function(_0x238be6,_0x157388,_0x61e3e2){var _0x366d9a,_0xdbcc1a;return db[_0x6c4e('0x24')][_0x6c4e('0x3c')]({'where':{'id':_0x238be6[_0x6c4e('0x3b')]['id']}})['then'](handleEntityNotFound(_0x157388,null))[_0x6c4e('0x1e')](function(_0x416d1e){if(_0x416d1e){_0xdbcc1a=_0x416d1e;return _0x416d1e['addLists'](_0x238be6[_0x6c4e('0x3e')][_0x6c4e('0x58')],_[_0x6c4e('0x4a')](_0x238be6['body'],[_0x6c4e('0x58'),'id'])||{});}return null;})[_0x6c4e('0x59')](function(_0x4e1d44){var _0x4ae8db;_0x366d9a=_0x4e1d44||[];var _0x54a331=[];if(_0x4e1d44){for(var _0x3ec326=0x0;_0x3ec326<_0x4e1d44[_0x6c4e('0x2d')];_0x3ec326+=0x1){var _0x26242e=_0x4e1d44[_0x3ec326][_0x6c4e('0x1f')]({'plain':!![]});_0xdbcc1a[_0x6c4e('0x5a')]=_0x238be6[_0x6c4e('0x3e')][_0x6c4e('0x5a')]?_0x238be6[_0x6c4e('0x3e')][_0x6c4e('0x5a')]:_0xdbcc1a[_0x6c4e('0x5a')];switch(_0xdbcc1a['dialCheckDuplicateType']){case _0x6c4e('0x5b'):_0x4ae8db=squel[_0x6c4e('0x5c')]()[_0x6c4e('0x5d')](_0x6c4e('0x5e'))[_0x6c4e('0x5f')]([_0x6c4e('0x60'),_0x6c4e('0x61'),_0x6c4e('0x62'),_0x6c4e('0x63'),_0x6c4e('0x4f'),_0x6c4e('0x4b'),_0x6c4e('0x4c')],squel['select']()[_0x6c4e('0x35')](_0x6c4e('0x60'),_0x6c4e('0x60'))['field']('NOW()',_0x6c4e('0x61'))[_0x6c4e('0x35')]('id',_0x6c4e('0x62'))['field'](_0x26242e[_0x6c4e('0x64')][_0x6c4e('0x65')](),_0x6c4e('0x63'))['field'](_0x238be6[_0x6c4e('0x3b')]['id'][_0x6c4e('0x65')](),_0x6c4e('0x4f'))[_0x6c4e('0x35')](_0x6c4e('0x66'),'createdAt')[_0x6c4e('0x35')]('NOW()','updatedAt')[_0x6c4e('0x67')]('cm_contacts')[_0x6c4e('0x32')](_0x6c4e('0x68'))[_0x6c4e('0x32')](_0x6c4e('0x69'),_0x26242e[_0x6c4e('0x64')]['toString']())['where']('phone\x20IS\x20NOT\x20NULL')[_0x6c4e('0x32')](_0x6c4e('0x6a'),squel['select']()[_0x6c4e('0x35')](_0x6c4e('0x6b'))['from'](_0x6c4e('0x6c'))[_0x6c4e('0x32')](_0x6c4e('0x6d'),_0x238be6[_0x6c4e('0x3b')]['id'][_0x6c4e('0x65')]()))[_0x6c4e('0x32')](_0x6c4e('0x6a'),squel['select']()['field']('COALESCE(phone,\x27\x27)')[_0x6c4e('0x67')](_0x6c4e('0x5e'))[_0x6c4e('0x32')]('CampaignId\x20=\x20?',_0x238be6[_0x6c4e('0x3b')]['id']['toString']())))[_0x6c4e('0x65')]();break;case'onlyIfOpen':_0x4ae8db=squel[_0x6c4e('0x5c')]()['into'](_0x6c4e('0x5e'))[_0x6c4e('0x5f')](['phone','scheduledAt',_0x6c4e('0x62'),_0x6c4e('0x63'),_0x6c4e('0x4f'),_0x6c4e('0x4b'),_0x6c4e('0x4c')],squel[_0x6c4e('0x6e')]()['field'](_0x6c4e('0x60'),_0x6c4e('0x60'))[_0x6c4e('0x35')](_0x6c4e('0x66'),_0x6c4e('0x61'))['field']('id','ContactId')[_0x6c4e('0x35')](_0x26242e[_0x6c4e('0x64')]['toString'](),_0x6c4e('0x63'))[_0x6c4e('0x35')](_0x238be6[_0x6c4e('0x3b')]['id']['toString'](),_0x6c4e('0x4f'))[_0x6c4e('0x35')]('NOW()',_0x6c4e('0x4b'))[_0x6c4e('0x35')](_0x6c4e('0x66'),_0x6c4e('0x4c'))[_0x6c4e('0x67')](_0x6c4e('0x6f'))[_0x6c4e('0x32')](_0x6c4e('0x68'))[_0x6c4e('0x32')]('ListId\x20=\x20?',_0x26242e[_0x6c4e('0x64')][_0x6c4e('0x65')]())['where'](_0x6c4e('0x70'))[_0x6c4e('0x32')]('phone\x20NOT\x20IN\x20(?)',squel[_0x6c4e('0x6e')]()[_0x6c4e('0x35')](_0x6c4e('0x71'))[_0x6c4e('0x67')](_0x6c4e('0x5e'))[_0x6c4e('0x32')](_0x6c4e('0x6d'),_0x238be6[_0x6c4e('0x3b')]['id'][_0x6c4e('0x65')]())))[_0x6c4e('0x65')]();break;default:_0x4ae8db=squel[_0x6c4e('0x5c')]()[_0x6c4e('0x5d')](_0x6c4e('0x5e'))[_0x6c4e('0x5f')](['phone',_0x6c4e('0x61'),_0x6c4e('0x62'),_0x6c4e('0x63'),_0x6c4e('0x4f'),_0x6c4e('0x4b'),_0x6c4e('0x4c')],squel[_0x6c4e('0x6e')]()[_0x6c4e('0x35')](_0x6c4e('0x60'),_0x6c4e('0x60'))[_0x6c4e('0x35')]('NOW()',_0x6c4e('0x61'))[_0x6c4e('0x35')]('id',_0x6c4e('0x62'))['field'](_0x26242e['CmListId']['toString'](),_0x6c4e('0x63'))[_0x6c4e('0x35')](_0x238be6[_0x6c4e('0x3b')]['id'][_0x6c4e('0x65')](),'CampaignId')[_0x6c4e('0x35')](_0x6c4e('0x66'),'createdAt')[_0x6c4e('0x35')](_0x6c4e('0x66'),_0x6c4e('0x4c'))[_0x6c4e('0x67')](_0x6c4e('0x6f'))[_0x6c4e('0x32')](_0x6c4e('0x68'))['where'](_0x6c4e('0x69'),_0x26242e[_0x6c4e('0x64')]['toString']())[_0x6c4e('0x32')]('phone\x20IS\x20NOT\x20NULL'))[_0x6c4e('0x65')]();}_0x54a331[_0x6c4e('0x72')](db['sequelize'][_0x6c4e('0x28')](_0x4ae8db));}return BPromise[_0x6c4e('0x73')](_0x54a331);}})[_0x6c4e('0x1e')](function(){return _0x366d9a;})[_0x6c4e('0x1e')](respondWithResult(_0x157388,null))['catch'](handleError(_0x157388,null));};exports[_0x6c4e('0x74')]=function(_0x544128,_0x2a476d,_0x3a8b0e){return db[_0x6c4e('0x24')]['find']({'where':{'id':_0x544128[_0x6c4e('0x3b')]['id']}})[_0x6c4e('0x1e')](handleEntityNotFound(_0x2a476d,null))[_0x6c4e('0x1e')](function(_0x4137a8){if(_0x4137a8){return _0x4137a8[_0x6c4e('0x74')](_0x544128[_0x6c4e('0x28')][_0x6c4e('0x58')]);}})[_0x6c4e('0x1e')](function(_0x335892){if(_0x335892){return db[_0x6c4e('0x4e')][_0x6c4e('0x1d')]({'where':{'ListId':_0x544128['query']['ids'],'CampaignId':_0x544128[_0x6c4e('0x3b')]['id']}})[_0x6c4e('0x1e')](function(){return _0x335892;});}})[_0x6c4e('0x1e')](respondWithStatusCode(_0x2a476d,null))['catch'](handleError(_0x2a476d,null));};exports[_0x6c4e('0x75')]=function(_0x13c68f,_0x3a63a0,_0x3adac7){var _0xd4a261={'raw':!![],'where':{}};var _0x33b916={};var _0x2be1f8={'count':0x0,'rows':[]};return db[_0x6c4e('0x24')]['findOne']({'where':{'id':_0x13c68f[_0x6c4e('0x3b')]['id']}})[_0x6c4e('0x1e')](handleEntityNotFound(_0x3a63a0,null))['then'](function(_0xfdbf94){if(_0xfdbf94){_0x33b916['model']=_['keys'](db[_0x6c4e('0x76')][_0x6c4e('0x25')]);_0x33b916['query']=_[_0x6c4e('0x27')](_0x13c68f[_0x6c4e('0x28')]);_0x33b916[_0x6c4e('0x29')]=_[_0x6c4e('0x2a')](_0x33b916['model'],_0x33b916[_0x6c4e('0x28')]);_0xd4a261[_0x6c4e('0x2c')]=_[_0x6c4e('0x2a')](_0x33b916[_0x6c4e('0x26')],qs[_0x6c4e('0x2b')](_0x13c68f[_0x6c4e('0x28')]['fields']));_0xd4a261[_0x6c4e('0x2c')]=_0xd4a261[_0x6c4e('0x2c')][_0x6c4e('0x2d')]?_0xd4a261[_0x6c4e('0x2c')]:_0x33b916[_0x6c4e('0x26')];if(!_0x13c68f[_0x6c4e('0x28')][_0x6c4e('0x2e')](_0x6c4e('0x2f'))){_0xd4a261[_0x6c4e('0x19')]=qs[_0x6c4e('0x19')](_0x13c68f['query'][_0x6c4e('0x19')]);_0xd4a261[_0x6c4e('0x18')]=qs[_0x6c4e('0x18')](_0x13c68f[_0x6c4e('0x28')]['offset']);}_0xd4a261['order']=qs[_0x6c4e('0x31')](_0x13c68f['query'][_0x6c4e('0x31')]);_0xd4a261[_0x6c4e('0x32')]=qs[_0x6c4e('0x29')](_['pick'](_0x13c68f[_0x6c4e('0x28')],_0x33b916['filters']));_0xd4a261[_0x6c4e('0x32')][_0x6c4e('0x4f')]=_0xfdbf94['id'];if(_0x13c68f['query']['filter']){_0xd4a261['where']=_[_0x6c4e('0x34')](_0xd4a261['where'],{'$or':_[_0x6c4e('0x51')](_0xd4a261['attributes'],function(_0x2c2aeb){var _0x1155cf={};_0x1155cf[_0x2c2aeb]={'$like':'%'+_0x13c68f[_0x6c4e('0x28')][_0x6c4e('0x50')]+'%'};return _0x1155cf;})});}_0xd4a261=_[_0x6c4e('0x34')]({},_0xd4a261,_0x13c68f[_0x6c4e('0x36')]);return db[_0x6c4e('0x76')][_0x6c4e('0x17')]({'where':_0xd4a261[_0x6c4e('0x32')]})[_0x6c4e('0x1e')](function(_0x24af76){_0x2be1f8['count']=_0x24af76;if(_0x13c68f['query'][_0x6c4e('0x37')]){_0xd4a261[_0x6c4e('0x49')]=[{'all':!![]}];}return db[_0x6c4e('0x76')][_0x6c4e('0x38')](_0xd4a261);})[_0x6c4e('0x1e')](function(_0x4baede){_0x2be1f8['rows']=_0x4baede;return _0x2be1f8;});}})['then'](respondWithFilteredResult(_0x3a63a0,_0xd4a261))[_0x6c4e('0x3a')](handleError(_0x3a63a0,null));};exports[_0x6c4e('0x77')]=function(_0x21c2eb,_0x4c8eec,_0x422bb3){var _0x4dd4e6,_0x4d5574;return db[_0x6c4e('0x24')][_0x6c4e('0x3c')]({'where':{'id':_0x21c2eb[_0x6c4e('0x3b')]['id']}})[_0x6c4e('0x1e')](handleEntityNotFound(_0x4c8eec,null))[_0x6c4e('0x1e')](function(_0xa9007){if(_0xa9007){_0x4d5574=_0xa9007;return _0xa9007[_0x6c4e('0x77')](_0x21c2eb['body'][_0x6c4e('0x58')],_[_0x6c4e('0x4a')](_0x21c2eb[_0x6c4e('0x3e')],[_0x6c4e('0x58'),'id'])||{});}return null;})[_0x6c4e('0x59')](function(_0x1ca5e5){var _0x1bd23d;_0x4dd4e6=_0x1ca5e5||[];var _0x4396ab=[];if(_0x1ca5e5){for(var _0x30e9ec=0x0;_0x30e9ec<_0x1ca5e5[_0x6c4e('0x2d')];_0x30e9ec+=0x1){var _0x57f0b3=_0x1ca5e5[_0x30e9ec][_0x6c4e('0x1f')]({'plain':!![]});_0x1bd23d=squel['insert']()[_0x6c4e('0x5d')](_0x6c4e('0x78'))[_0x6c4e('0x5f')](['phone',_0x6c4e('0x62'),_0x6c4e('0x63'),_0x6c4e('0x4f'),'createdAt',_0x6c4e('0x4c')],squel[_0x6c4e('0x6e')]()['field'](_0x6c4e('0x60'),_0x6c4e('0x60'))[_0x6c4e('0x35')]('id','ContactId')[_0x6c4e('0x35')](_0x57f0b3[_0x6c4e('0x64')][_0x6c4e('0x65')](),_0x6c4e('0x63'))['field'](_0x21c2eb[_0x6c4e('0x3b')]['id'][_0x6c4e('0x65')](),_0x6c4e('0x4f'))[_0x6c4e('0x35')](_0x6c4e('0x66'),_0x6c4e('0x4b'))[_0x6c4e('0x35')]('NOW()','updatedAt')[_0x6c4e('0x67')]('cm_contacts')[_0x6c4e('0x32')](_0x6c4e('0x68'))[_0x6c4e('0x32')]('ListId\x20=\x20?',_0x57f0b3[_0x6c4e('0x64')][_0x6c4e('0x65')]())[_0x6c4e('0x32')]('phone\x20IS\x20NOT\x20NULL'))[_0x6c4e('0x65')]();_0x4396ab[_0x6c4e('0x72')](db[_0x6c4e('0x79')][_0x6c4e('0x28')](_0x1bd23d));}return BPromise[_0x6c4e('0x73')](_0x4396ab);}})['then'](function(){return _0x4dd4e6;})['then'](respondWithResult(_0x4c8eec,null))[_0x6c4e('0x3a')](handleError(_0x4c8eec,null));};exports[_0x6c4e('0x7a')]=function(_0x2ed482,_0x679cd0,_0x342b95){return db['Campaign']['find']({'where':{'id':_0x2ed482[_0x6c4e('0x3b')]['id']}})['then'](handleEntityNotFound(_0x679cd0,null))[_0x6c4e('0x1e')](function(_0x214922){if(_0x214922){return _0x214922['removeBlackLists'](_0x2ed482[_0x6c4e('0x28')][_0x6c4e('0x58')]);}})[_0x6c4e('0x1e')](function(_0xaf4c96){if(_0xaf4c96){return db[_0x6c4e('0x56')][_0x6c4e('0x1d')]({'where':{'ListId':_0x2ed482[_0x6c4e('0x28')][_0x6c4e('0x58')],'CampaignId':_0x2ed482[_0x6c4e('0x3b')]['id']}})[_0x6c4e('0x1e')](function(){return _0xaf4c96;});}})[_0x6c4e('0x1e')](respondWithStatusCode(_0x679cd0,null))[_0x6c4e('0x3a')](handleError(_0x679cd0,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 66ba294..4b66ee9 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 _0x2493=['bluebird','request-promise','path','./campaign.attributes','exports','define','Campaign','campaigns','util','api','moment'];(function(_0x415a7d,_0x3e9ed8){var _0x1a5de4=function(_0xc27a3c){while(--_0xc27a3c){_0x415a7d['push'](_0x415a7d['shift']());}};_0x1a5de4(++_0x3e9ed8);}(_0x2493,0x105));var _0x3249=function(_0xabc21a,_0x452894){_0xabc21a=_0xabc21a-0x0;var _0x5440fd=_0x2493[_0xabc21a];return _0x5440fd;};'use strict';var _=require('lodash');var util=require(_0x3249('0x0'));var logger=require('../../config/logger')(_0x3249('0x1'));var moment=require(_0x3249('0x2'));var BPromise=require(_0x3249('0x3'));var rp=require(_0x3249('0x4'));var fs=require('fs');var path=require(_0x3249('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3249('0x6'));module[_0x3249('0x7')]=function(_0xc27fb8,_0x2cab1b){return _0xc27fb8[_0x3249('0x8')](_0x3249('0x9'),attributes,{'tableName':_0x3249('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1629=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','lodash','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1629,0x11e));var _0x9162=function(_0x53d196,_0x186493){_0x53d196=_0x53d196-0x0;var _0x4cf385=_0x1629[_0x53d196];return _0x4cf385;};'use strict';var _=require(_0x9162('0x0'));var util=require(_0x9162('0x1'));var logger=require(_0x9162('0x2'))(_0x9162('0x3'));var moment=require('moment');var BPromise=require(_0x9162('0x4'));var rp=require(_0x9162('0x5'));var fs=require('fs');var path=require(_0x9162('0x6'));var rimraf=require(_0x9162('0x7'));var config=require(_0x9162('0x8'));var attributes=require(_0x9162('0x9'));module[_0x9162('0xa')]=function(_0x484e0a,_0x2675c8){return _0x484e0a['define'](_0x9162('0xb'),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 28e1b62..cfe89a5 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 _0xead5=['Campaign','options','raw','attributes','limit','include','model','map','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetCampaign'];(function(_0x4b966b,_0x463b51){var _0x86b205=function(_0x292ef9){while(--_0x292ef9){_0x4b966b['push'](_0x4b966b['shift']());}};_0x86b205(++_0x463b51);}(_0xead5,0xf6));var _0x5ead=function(_0x5e77db,_0x356d1c){_0x5e77db=_0x5e77db-0x0;var _0x34b675=_0xead5[_0x5e77db];return _0x34b675;};'use strict';var _=require(_0x5ead('0x0'));var util=require(_0x5ead('0x1'));var moment=require(_0x5ead('0x2'));var BPromise=require('bluebird');var rs=require(_0x5ead('0x3'));var fs=require('fs');var Redis=require(_0x5ead('0x4'));var db=require(_0x5ead('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5ead('0x6'))(_0x5ead('0x7'));var config=require(_0x5ead('0x8'));var jayson=require(_0x5ead('0x9'));var client=jayson[_0x5ead('0xa')][_0x5ead('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b25c2,_0x57de42,_0x421c4b){return new BPromise(function(_0x5da5d3,_0x1a1112){return client[_0x5ead('0xc')](_0x4b25c2,_0x421c4b)[_0x5ead('0xd')](function(_0x2ae579){logger['info'](_0x5ead('0xe'),_0x57de42,'request\x20sent');logger[_0x5ead('0xf')](_0x5ead('0x10'),_0x57de42,_0x5ead('0x11'),JSON[_0x5ead('0x12')](_0x2ae579));if(_0x2ae579[_0x5ead('0x13')]){if(_0x2ae579['error'][_0x5ead('0x14')]===0x1f4){logger['error'](_0x5ead('0xe'),_0x57de42,_0x2ae579[_0x5ead('0x13')][_0x5ead('0x15')]);return _0x1a1112(_0x2ae579[_0x5ead('0x13')][_0x5ead('0x15')]);}logger[_0x5ead('0x13')](_0x5ead('0xe'),_0x57de42,_0x2ae579[_0x5ead('0x13')][_0x5ead('0x15')]);return _0x5da5d3(_0x2ae579[_0x5ead('0x13')]['message']);}else{logger[_0x5ead('0x16')]('Campaign,\x20%s,\x20%s',_0x57de42,_0x5ead('0x11'));_0x5da5d3(_0x2ae579[_0x5ead('0x17')][_0x5ead('0x15')]);}})[_0x5ead('0x18')](function(_0x560362){logger['error'](_0x5ead('0xe'),_0x57de42,_0x560362);_0x1a1112(_0x560362);});});}exports[_0x5ead('0x19')]=function(_0x91b852){var _0x28bc9f=this;return new Promise(function(_0x4584e8,_0x4e9b0d){return db[_0x5ead('0x1a')]['findAll']({'raw':_0x91b852[_0x5ead('0x1b')]?_0x91b852['options'][_0x5ead('0x1c')]===undefined?!![]:![]:!![],'where':_0x91b852[_0x5ead('0x1b')]?_0x91b852['options']['where']||null:null,'attributes':_0x91b852['options']?_0x91b852[_0x5ead('0x1b')][_0x5ead('0x1d')]||null:null,'limit':_0x91b852[_0x5ead('0x1b')]?_0x91b852[_0x5ead('0x1b')][_0x5ead('0x1e')]||null:null,'include':_0x91b852[_0x5ead('0x1b')]?_0x91b852[_0x5ead('0x1b')][_0x5ead('0x1f')]?_['map'](_0x91b852['options'][_0x5ead('0x1f')],function(_0x30ec69){return{'model':db[_0x30ec69[_0x5ead('0x20')]],'as':_0x30ec69['as'],'attributes':_0x30ec69[_0x5ead('0x1d')],'include':_0x30ec69[_0x5ead('0x1f')]?_['map'](_0x30ec69[_0x5ead('0x1f')],function(_0x9b7ac5){return{'model':db[_0x9b7ac5[_0x5ead('0x20')]],'as':_0x9b7ac5['as'],'attributes':_0x9b7ac5[_0x5ead('0x1d')],'include':_0x9b7ac5['include']?_[_0x5ead('0x21')](_0x9b7ac5[_0x5ead('0x1f')],function(_0x28d5ee){return{'model':db[_0x28d5ee[_0x5ead('0x20')]],'as':_0x28d5ee['as'],'attributes':_0x28d5ee['attributes']};}):[]};}):[]};}):[]:[]})[_0x5ead('0xd')](function(_0x37be71){logger[_0x5ead('0x16')](_0x5ead('0x19'),_0x91b852);logger[_0x5ead('0xf')](_0x5ead('0x19'),_0x91b852,JSON[_0x5ead('0x12')](_0x37be71));_0x4584e8(_0x37be71);})[_0x5ead('0x18')](function(_0x555174){logger['error'](_0x5ead('0x19'),_0x555174[_0x5ead('0x15')],_0x91b852);_0x4e9b0d(_0x28bc9f[_0x5ead('0x13')](0x1f4,_0x555174['message']));});});}; \ No newline at end of file +var _0x7734=['info','Campaign,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','GetCampaign','Campaign','findAll','options','raw','attributes','limit','include','model','map','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http'];(function(_0x4521e3,_0x10a8a4){var _0x46a272=function(_0x2f4c64){while(--_0x2f4c64){_0x4521e3['push'](_0x4521e3['shift']());}};_0x46a272(++_0x10a8a4);}(_0x7734,0x1e5));var _0x4773=function(_0x135791,_0x5f3c32){_0x135791=_0x135791-0x0;var _0x5ab543=_0x7734[_0x135791];return _0x5ab543;};'use strict';var _=require(_0x4773('0x0'));var util=require(_0x4773('0x1'));var moment=require(_0x4773('0x2'));var BPromise=require(_0x4773('0x3'));var rs=require(_0x4773('0x4'));var fs=require('fs');var Redis=require(_0x4773('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4773('0x6'));var logger=require(_0x4773('0x7'))(_0x4773('0x8'));var config=require(_0x4773('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4773('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x882025,_0x4415e1,_0x192709){return new BPromise(function(_0x2daba5,_0x503bbd){return client['request'](_0x882025,_0x192709)['then'](function(_0x35a9f5){logger[_0x4773('0xb')](_0x4773('0xc'),_0x4415e1,'request\x20sent');logger[_0x4773('0xd')]('Campaign,\x20%s,\x20%s,\x20%s',_0x4415e1,_0x4773('0xe'),JSON[_0x4773('0xf')](_0x35a9f5));if(_0x35a9f5[_0x4773('0x10')]){if(_0x35a9f5[_0x4773('0x10')]['code']===0x1f4){logger[_0x4773('0x10')](_0x4773('0xc'),_0x4415e1,_0x35a9f5[_0x4773('0x10')][_0x4773('0x11')]);return _0x503bbd(_0x35a9f5[_0x4773('0x10')][_0x4773('0x11')]);}logger['error'](_0x4773('0xc'),_0x4415e1,_0x35a9f5['error'][_0x4773('0x11')]);return _0x2daba5(_0x35a9f5['error']['message']);}else{logger[_0x4773('0xb')]('Campaign,\x20%s,\x20%s',_0x4415e1,_0x4773('0xe'));_0x2daba5(_0x35a9f5[_0x4773('0x12')][_0x4773('0x11')]);}})[_0x4773('0x13')](function(_0x416da8){logger[_0x4773('0x10')](_0x4773('0xc'),_0x4415e1,_0x416da8);_0x503bbd(_0x416da8);});});}exports[_0x4773('0x14')]=function(_0x43c8a1){var _0x21427d=this;return new Promise(function(_0x4653bb,_0x5dffdd){return db[_0x4773('0x15')][_0x4773('0x16')]({'raw':_0x43c8a1[_0x4773('0x17')]?_0x43c8a1['options'][_0x4773('0x18')]===undefined?!![]:![]:!![],'where':_0x43c8a1[_0x4773('0x17')]?_0x43c8a1[_0x4773('0x17')]['where']||null:null,'attributes':_0x43c8a1[_0x4773('0x17')]?_0x43c8a1[_0x4773('0x17')][_0x4773('0x19')]||null:null,'limit':_0x43c8a1[_0x4773('0x17')]?_0x43c8a1[_0x4773('0x17')][_0x4773('0x1a')]||null:null,'include':_0x43c8a1[_0x4773('0x17')]?_0x43c8a1[_0x4773('0x17')][_0x4773('0x1b')]?_['map'](_0x43c8a1[_0x4773('0x17')][_0x4773('0x1b')],function(_0xdb0a69){return{'model':db[_0xdb0a69[_0x4773('0x1c')]],'as':_0xdb0a69['as'],'attributes':_0xdb0a69[_0x4773('0x19')],'include':_0xdb0a69[_0x4773('0x1b')]?_[_0x4773('0x1d')](_0xdb0a69['include'],function(_0x19abde){return{'model':db[_0x19abde[_0x4773('0x1c')]],'as':_0x19abde['as'],'attributes':_0x19abde[_0x4773('0x19')],'include':_0x19abde[_0x4773('0x1b')]?_['map'](_0x19abde[_0x4773('0x1b')],function(_0x4120f2){return{'model':db[_0x4120f2[_0x4773('0x1c')]],'as':_0x4120f2['as'],'attributes':_0x4120f2[_0x4773('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4773('0x1e')](function(_0x4e7e61){logger[_0x4773('0xb')](_0x4773('0x14'),_0x43c8a1);logger['debug']('GetCampaign',_0x43c8a1,JSON[_0x4773('0xf')](_0x4e7e61));_0x4653bb(_0x4e7e61);})['catch'](function(_0xbefa5a){logger['error']('GetCampaign',_0xbefa5a[_0x4773('0x11')],_0x43c8a1);_0x5dffdd(_0x21427d[_0x4773('0x10')](0x1f4,_0xbefa5a[_0x4773('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index bbeede8..224f8bc 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 _0x6828=['removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addBlackLists','put','/:id','delete','destroy'];(function(_0x4eda8f,_0x26c419){var _0x232a3a=function(_0x524d40){while(--_0x524d40){_0x4eda8f['push'](_0x4eda8f['shift']());}};_0x232a3a(++_0x26c419);}(_0x6828,0x1d1));var _0x8682=function(_0x2cc07c,_0x56858){_0x2cc07c=_0x2cc07c-0x0;var _0x47c3b6=_0x6828[_0x2cc07c];return _0x47c3b6;};'use strict';var multer=require(_0x8682('0x0'));var util=require(_0x8682('0x1'));var path=require(_0x8682('0x2'));var timeout=require(_0x8682('0x3'));var express=require(_0x8682('0x4'));var router=express[_0x8682('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x8682('0x6'));var config=require(_0x8682('0x7'));var controller=require(_0x8682('0x8'));router[_0x8682('0x9')]('/',auth[_0x8682('0xa')](),controller['index']);router[_0x8682('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x8682('0x9')](_0x8682('0xb'),auth[_0x8682('0xa')](),controller[_0x8682('0xc')]);router[_0x8682('0x9')](_0x8682('0xd'),auth[_0x8682('0xa')](),controller['getHopperHistories']);router[_0x8682('0x9')](_0x8682('0xe'),auth[_0x8682('0xa')](),controller[_0x8682('0xf')]);router[_0x8682('0x9')](_0x8682('0x10'),auth[_0x8682('0xa')](),controller[_0x8682('0x11')]);router[_0x8682('0x9')](_0x8682('0x12'),auth['isAuthenticated'](),controller['getLists']);router[_0x8682('0x9')](_0x8682('0x13'),auth[_0x8682('0xa')](),controller[_0x8682('0x14')]);router[_0x8682('0x15')]('/',auth[_0x8682('0xa')](),controller[_0x8682('0x16')]);router[_0x8682('0x15')](_0x8682('0x17'),auth[_0x8682('0xa')](),controller[_0x8682('0x18')]);router[_0x8682('0x15')](_0x8682('0x12'),auth['isAuthenticated'](),controller['addLists']);router[_0x8682('0x15')](_0x8682('0x13'),auth[_0x8682('0xa')](),controller[_0x8682('0x19')]);router[_0x8682('0x1a')](_0x8682('0x1b'),auth[_0x8682('0xa')](),controller['update']);router[_0x8682('0x1c')](_0x8682('0x1b'),auth[_0x8682('0xa')](),controller[_0x8682('0x1d')]);router[_0x8682('0x1c')](_0x8682('0x12'),auth['isAuthenticated'](),controller[_0x8682('0x1e')]);router[_0x8682('0x1c')]('/:id/blacklists',auth[_0x8682('0xa')](),controller[_0x8682('0x1f')]);module[_0x8682('0x20')]=router; \ No newline at end of file +var _0x87d6=['./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addLists','addBlackLists','destroy','delete','exports','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0xf89c3,_0x351bf1){var _0x274fc8=function(_0x5e0c91){while(--_0x5e0c91){_0xf89c3['push'](_0xf89c3['shift']());}};_0x274fc8(++_0x351bf1);}(_0x87d6,0xd3));var _0x687d=function(_0x49beea,_0x47add1){_0x49beea=_0x49beea-0x0;var _0x27693a=_0x87d6[_0x49beea];return _0x27693a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x687d('0x0'));var timeout=require(_0x687d('0x1'));var express=require(_0x687d('0x2'));var router=express[_0x687d('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x687d('0x4'));var config=require(_0x687d('0x5'));var controller=require(_0x687d('0x6'));router[_0x687d('0x7')]('/',auth[_0x687d('0x8')](),controller[_0x687d('0x9')]);router[_0x687d('0x7')](_0x687d('0xa'),auth[_0x687d('0x8')](),controller[_0x687d('0xb')]);router[_0x687d('0x7')](_0x687d('0xc'),auth['isAuthenticated'](),controller[_0x687d('0xd')]);router['get'](_0x687d('0xe'),auth[_0x687d('0x8')](),controller['getHopperHistories']);router['get'](_0x687d('0xf'),auth['isAuthenticated'](),controller[_0x687d('0x10')]);router['get'](_0x687d('0x11'),auth[_0x687d('0x8')](),controller[_0x687d('0x12')]);router[_0x687d('0x7')](_0x687d('0x13'),auth['isAuthenticated'](),controller[_0x687d('0x14')]);router[_0x687d('0x7')](_0x687d('0x15'),auth[_0x687d('0x8')](),controller[_0x687d('0x16')]);router[_0x687d('0x17')]('/',auth['isAuthenticated'](),controller[_0x687d('0x18')]);router[_0x687d('0x17')](_0x687d('0x19'),auth[_0x687d('0x8')](),controller['clone']);router['post']('/:id/lists',auth[_0x687d('0x8')](),controller[_0x687d('0x1a')]);router[_0x687d('0x17')](_0x687d('0x15'),auth[_0x687d('0x8')](),controller[_0x687d('0x1b')]);router['put'](_0x687d('0xa'),auth[_0x687d('0x8')](),controller['update']);router['delete']('/:id',auth[_0x687d('0x8')](),controller[_0x687d('0x1c')]);router[_0x687d('0x1d')]('/:id/lists',auth[_0x687d('0x8')](),controller['removeLists']);router[_0x687d('0x1d')](_0x687d('0x15'),auth[_0x687d('0x8')](),controller['removeBlackLists']);module[_0x687d('0x1e')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 9642f75..69c1339 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 _0xc943=['VIRTUAL','getDataValue','key','STRING','TEXT'];(function(_0x5359d1,_0x43ea08){var _0x161b5b=function(_0x5c4216){while(--_0x5c4216){_0x5359d1['push'](_0x5359d1['shift']());}};_0x161b5b(++_0x43ea08);}(_0xc943,0x1f2));var _0x3c94=function(_0x492221,_0x9e2521){_0x492221=_0x492221-0x0;var _0x398bf9=_0xc943[_0x492221];return _0x398bf9;};'use strict';var Sequelize=require('sequelize');module['exports']={'key':{'type':Sequelize[_0x3c94('0x0')],'allowNull':![]},'value':{'type':Sequelize[_0x3c94('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x3c94('0x0')]},'name':{'type':Sequelize[_0x3c94('0x2')],'get':function(){return this[_0x3c94('0x3')](_0x3c94('0x4'));}}}; \ No newline at end of file +var _0x34bf=['sequelize','exports','STRING','TEXT','VIRTUAL','getDataValue','key'];(function(_0x622126,_0xed8d35){var _0x22a605=function(_0x4a1aba){while(--_0x4a1aba){_0x622126['push'](_0x622126['shift']());}};_0x22a605(++_0xed8d35);}(_0x34bf,0x188));var _0xf34b=function(_0x582274,_0x2cbd9c){_0x582274=_0x582274-0x0;var _0x8f14d3=_0x34bf[_0x582274];return _0x8f14d3;};'use strict';var Sequelize=require(_0xf34b('0x0'));module[_0xf34b('0x1')]={'key':{'type':Sequelize[_0xf34b('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xf34b('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0xf34b('0x2')]},'name':{'type':Sequelize[_0xf34b('0x4')],'get':function(){return this[_0xf34b('0x5')](_0xf34b('0x6'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 10e8f41..5ef3dd3 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 _0xc8a0=['map','type','key','field','merge','options','includeAll','findAll','show','params','include','find','catch','update','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','CannedAnswers','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','status','end','json','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','CannedAnswer','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','nolimit','limit','offset','sort','where','pick','filter'];(function(_0x436d48,_0x155a40){var _0x528a0f=function(_0x865ed9){while(--_0x865ed9){_0x436d48['push'](_0x436d48['shift']());}};_0x528a0f(++_0x155a40);}(_0xc8a0,0x1cd));var _0x0c8a=function(_0x446613,_0x325071){_0x446613=_0x446613-0x0;var _0x2d293e=_0xc8a0[_0x446613];return _0x2d293e;};'use strict';var pdf=require(_0x0c8a('0x0'));var emlformat=require(_0x0c8a('0x1'));var rimraf=require(_0x0c8a('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0c8a('0x3'));var rp=require('request-promise');var moment=require(_0x0c8a('0x4'));var BPromise=require(_0x0c8a('0x5'));var Mustache=require(_0x0c8a('0x6'));var util=require(_0x0c8a('0x7'));var path=require('path');var sox=require(_0x0c8a('0x8'));var csv=require(_0x0c8a('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0c8a('0xa'));var squel=require(_0x0c8a('0xb'));var crypto=require(_0x0c8a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0c8a('0xd'));var toCsv=require(_0x0c8a('0x9'));var querystring=require(_0x0c8a('0xe'));var Papa=require('papaparse');var Redis=require(_0x0c8a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x0c8a('0x10'));var hardwareService=require(_0x0c8a('0x11'));var logger=require('../../config/logger')(_0x0c8a('0x12'));var utils=require(_0x0c8a('0x13'));var config=require(_0x0c8a('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cbc30,_0x37221f){_0x37221f=_0x37221f||0xcc;return function(_0x40c1b7){if(_0x40c1b7){return _0x4cbc30['sendStatus'](_0x37221f);}return _0x4cbc30[_0x0c8a('0x15')](_0x37221f)[_0x0c8a('0x16')]();};}function respondWithResult(_0x2ddb7d,_0x57239f){_0x57239f=_0x57239f||0xc8;return function(_0x28da24){if(_0x28da24){return _0x2ddb7d[_0x0c8a('0x15')](_0x57239f)[_0x0c8a('0x17')](_0x28da24);}};}function respondWithFilteredResult(_0x336d31,_0x15e0ee){return function(_0x4f21e1){if(_0x4f21e1){var _0x3bb4a4=_0x4f21e1[_0x0c8a('0x18')],_0x145407=_0x15e0ee['offset'],_0xbd6151=_0x15e0ee['offset']+_0x15e0ee['limit'],_0x5bf58d;if(_0xbd6151>=_0x3bb4a4){_0xbd6151=_0x3bb4a4;_0x5bf58d=0xc8;}else{_0x5bf58d=0xce;}_0x336d31['status'](_0x5bf58d);return _0x336d31[_0x0c8a('0x19')](_0x0c8a('0x1a'),_0x145407+'-'+_0xbd6151+'/'+_0x3bb4a4)[_0x0c8a('0x17')](_0x4f21e1);}return null;};}function patchUpdates(_0x31f564){return function(_0x31b2dd){try{jsonpatch[_0x0c8a('0x1b')](_0x31b2dd,_0x31f564,!![]);}catch(_0x2f8776){return BPromise[_0x0c8a('0x1c')](_0x2f8776);}return _0x31b2dd[_0x0c8a('0x1d')]();};}function saveUpdates(_0x3722e2,_0x27a203){return function(_0x309865){if(_0x309865){return _0x309865['update'](_0x3722e2)[_0x0c8a('0x1e')](function(_0x43af42){return _0x43af42;});}return null;};}function removeEntity(_0x124f66,_0x5abcbe){return function(_0x17844c){if(_0x17844c){return _0x17844c['destroy']()[_0x0c8a('0x1e')](function(){var _0x155625=_0x17844c['get']({'plain':!![]});var _0x2aca15='CannedAnswers';return db['UserProfileResource'][_0x0c8a('0x1f')]({'where':{'type':_0x2aca15,'resourceId':_0x155625['id']}})[_0x0c8a('0x1e')](function(){return _0x17844c;});})[_0x0c8a('0x1e')](function(){_0x124f66[_0x0c8a('0x15')](0xcc)[_0x0c8a('0x16')]();});}};}function handleEntityNotFound(_0x85ee6,_0x16d8bc){return function(_0x4f5d02){if(!_0x4f5d02){_0x85ee6[_0x0c8a('0x20')](0x194);}return _0x4f5d02;};}function handleError(_0x100042,_0x1ee312){_0x1ee312=_0x1ee312||0x1f4;return function(_0x43fe52){logger[_0x0c8a('0x21')](_0x43fe52[_0x0c8a('0x22')]);if(_0x43fe52[_0x0c8a('0x23')]){delete _0x43fe52['name'];}_0x100042[_0x0c8a('0x15')](_0x1ee312)[_0x0c8a('0x24')](_0x43fe52);};}exports[_0x0c8a('0x25')]=function(_0x2be036,_0x1ada43){var _0xbf18ba={},_0x332e42={},_0x4da9be={'count':0x0,'rows':[]};var _0x2cbc90=db[_0x0c8a('0x26')][_0x0c8a('0x27')];_0x332e42[_0x0c8a('0x28')]=_[_0x0c8a('0x29')](_0x2cbc90);_0x332e42[_0x0c8a('0x2a')]=_['keys'](_0x2be036[_0x0c8a('0x2a')]);_0x332e42[_0x0c8a('0x2b')]=_['intersection'](_0x332e42['model'],_0x332e42[_0x0c8a('0x2a')]);_0xbf18ba['attributes']=_[_0x0c8a('0x2c')](_0x332e42[_0x0c8a('0x28')],qs[_0x0c8a('0x2d')](_0x2be036[_0x0c8a('0x2a')][_0x0c8a('0x2d')]));_0xbf18ba[_0x0c8a('0x2e')]=_0xbf18ba[_0x0c8a('0x2e')][_0x0c8a('0x2f')]?_0xbf18ba[_0x0c8a('0x2e')]:_0x332e42[_0x0c8a('0x28')];if(!_0x2be036[_0x0c8a('0x2a')]['hasOwnProperty'](_0x0c8a('0x30'))){_0xbf18ba['limit']=qs[_0x0c8a('0x31')](_0x2be036[_0x0c8a('0x2a')]['limit']);_0xbf18ba[_0x0c8a('0x32')]=qs[_0x0c8a('0x32')](_0x2be036['query'][_0x0c8a('0x32')]);}_0xbf18ba['order']=qs['sort'](_0x2be036['query'][_0x0c8a('0x33')]);_0xbf18ba[_0x0c8a('0x34')]=qs[_0x0c8a('0x2b')](_[_0x0c8a('0x35')](_0x2be036['query'],_0x332e42[_0x0c8a('0x2b')]));if(_0x2be036[_0x0c8a('0x2a')][_0x0c8a('0x36')]){_0xbf18ba[_0x0c8a('0x34')]=_['merge'](_0xbf18ba['where'],{'$or':_[_0x0c8a('0x37')](_0x2cbc90,function(_0x19d800){if(_0x19d800[_0x0c8a('0x38')][_0x0c8a('0x39')]!=='VIRTUAL'){var _0x38b8a9={};_0x38b8a9[_0x19d800[_0x0c8a('0x3a')]]={'$like':'%'+_0x2be036[_0x0c8a('0x2a')][_0x0c8a('0x36')]+'%'};return _0x38b8a9;}})});}_0xbf18ba=_[_0x0c8a('0x3b')]({},_0xbf18ba,_0x2be036[_0x0c8a('0x3c')]);var _0x277e7e={'where':_0xbf18ba['where']};return db[_0x0c8a('0x26')][_0x0c8a('0x18')](_0x277e7e)[_0x0c8a('0x1e')](function(_0x26dab1){_0x4da9be['count']=_0x26dab1;if(_0x2be036[_0x0c8a('0x2a')][_0x0c8a('0x3d')]){_0xbf18ba['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x0c8a('0x3e')](_0xbf18ba);})[_0x0c8a('0x1e')](function(_0x4601cd){_0x4da9be['rows']=_0x4601cd;return _0x4da9be;})[_0x0c8a('0x1e')](respondWithFilteredResult(_0x1ada43,_0xbf18ba))['catch'](handleError(_0x1ada43,null));};exports[_0x0c8a('0x3f')]=function(_0x177dfd,_0x4e8f1a){var _0x5a0f72={'raw':!![],'where':{'id':_0x177dfd[_0x0c8a('0x40')]['id']}},_0x3c52d3={};_0x3c52d3[_0x0c8a('0x28')]=_[_0x0c8a('0x29')](db[_0x0c8a('0x26')][_0x0c8a('0x27')]);_0x3c52d3[_0x0c8a('0x2a')]=_[_0x0c8a('0x29')](_0x177dfd[_0x0c8a('0x2a')]);_0x3c52d3['filters']=_['intersection'](_0x3c52d3[_0x0c8a('0x28')],_0x3c52d3[_0x0c8a('0x2a')]);_0x5a0f72[_0x0c8a('0x2e')]=_['intersection'](_0x3c52d3[_0x0c8a('0x28')],qs[_0x0c8a('0x2d')](_0x177dfd[_0x0c8a('0x2a')][_0x0c8a('0x2d')]));_0x5a0f72[_0x0c8a('0x2e')]=_0x5a0f72[_0x0c8a('0x2e')][_0x0c8a('0x2f')]?_0x5a0f72[_0x0c8a('0x2e')]:_0x3c52d3['model'];if(_0x177dfd[_0x0c8a('0x2a')][_0x0c8a('0x3d')]){_0x5a0f72[_0x0c8a('0x41')]=[{'all':!![]}];}_0x5a0f72=_[_0x0c8a('0x3b')]({},_0x5a0f72,_0x177dfd[_0x0c8a('0x3c')]);return db[_0x0c8a('0x26')][_0x0c8a('0x42')](_0x5a0f72)[_0x0c8a('0x1e')](handleEntityNotFound(_0x4e8f1a,null))[_0x0c8a('0x1e')](respondWithResult(_0x4e8f1a,null))[_0x0c8a('0x43')](handleError(_0x4e8f1a,null));};exports[_0x0c8a('0x44')]=function(_0x31a7b7,_0x450062){if(_0x31a7b7[_0x0c8a('0x45')]['id']){delete _0x31a7b7[_0x0c8a('0x45')]['id'];}return db[_0x0c8a('0x26')]['find']({'where':{'id':_0x31a7b7[_0x0c8a('0x40')]['id']}})[_0x0c8a('0x1e')](handleEntityNotFound(_0x450062,null))[_0x0c8a('0x1e')](saveUpdates(_0x31a7b7[_0x0c8a('0x45')],null))['then'](respondWithResult(_0x450062,null))[_0x0c8a('0x43')](handleError(_0x450062,null));};exports['destroy']=function(_0x2392f9,_0x332700){return db[_0x0c8a('0x26')][_0x0c8a('0x42')]({'where':{'id':_0x2392f9[_0x0c8a('0x40')]['id']}})[_0x0c8a('0x1e')](handleEntityNotFound(_0x332700,null))[_0x0c8a('0x1e')](removeEntity(_0x332700,null))[_0x0c8a('0x43')](handleError(_0x332700,null));};exports[_0x0c8a('0x46')]=function(_0xa7c7a9,_0x26b2f1){var _0x50112d={'key':_0xa7c7a9[_0x0c8a('0x45')][_0x0c8a('0x39')]};if(_0xa7c7a9[_0x0c8a('0x45')][_0x0c8a('0x47')]){_0x50112d['MailAccountId']=_0xa7c7a9[_0x0c8a('0x45')][_0x0c8a('0x47')];}else if(_0xa7c7a9[_0x0c8a('0x45')][_0x0c8a('0x48')]){_0x50112d[_0x0c8a('0x48')]=_0xa7c7a9[_0x0c8a('0x45')][_0x0c8a('0x48')];}else if(_0xa7c7a9[_0x0c8a('0x45')][_0x0c8a('0x49')]){_0x50112d[_0x0c8a('0x49')]=_0xa7c7a9['body'][_0x0c8a('0x49')];}else if(_0xa7c7a9[_0x0c8a('0x45')][_0x0c8a('0x4a')]){_0x50112d[_0x0c8a('0x4a')]=_0xa7c7a9[_0x0c8a('0x45')][_0x0c8a('0x4a')];}return db[_0x0c8a('0x26')]['find']({'where':_0x50112d})[_0x0c8a('0x1e')](function(_0x127893){if(_0x127893){throw new db[(_0x0c8a('0x4b'))][(_0x0c8a('0x4c'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x0c8a('0x26')][_0x0c8a('0x46')](_0xa7c7a9['body']);})[_0x0c8a('0x1e')](function(_0x887b8e){var _0x54161a=_0xa7c7a9[_0x0c8a('0x4d')][_0x0c8a('0x4e')]({'plain':!![]});if(!_0x54161a)throw new Error(_0x0c8a('0x4f'));if(_0x54161a[_0x0c8a('0x50')]===_0x0c8a('0x4d')){var _0x17a416=_0x887b8e[_0x0c8a('0x4e')]({'plain':!![]});return db[_0x0c8a('0x51')][_0x0c8a('0x42')]({'where':{'name':_0x0c8a('0x52'),'userProfileId':_0x54161a['userProfileId']},'raw':!![]})[_0x0c8a('0x1e')](function(_0x55221b){if(_0x55221b&&_0x55221b[_0x0c8a('0x53')]===0x0){return db[_0x0c8a('0x54')]['create']({'name':_0x17a416[_0x0c8a('0x23')],'resourceId':_0x17a416['id'],'type':_0x55221b['name'],'sectionId':_0x55221b['id']},{})[_0x0c8a('0x1e')](function(){return _0x887b8e;});}else{return _0x887b8e;}})[_0x0c8a('0x43')](function(_0x7f14b4){logger[_0x0c8a('0x21')](_0x0c8a('0x55'),_0x7f14b4);throw _0x7f14b4;});}return _0x887b8e;})['then'](respondWithResult(_0x26b2f1,0xc9))['catch'](handleError(_0x26b2f1,null));}; \ No newline at end of file +var _0xa822=['create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','util','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','then','get','CannedAnswers','UserProfileResource','error','stack','name','index','CannedAnswer','rawAttributes','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','map','type','key','VIRTUAL','field','include','findAll','catch','options','find','body','params'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0xa822,0x65));var _0x2a82=function(_0x122e9b,_0x391bf4){_0x122e9b=_0x122e9b-0x0;var _0x22c247=_0xa822[_0x122e9b];return _0x22c247;};'use strict';var pdf=require(_0x2a82('0x0'));var emlformat=require(_0x2a82('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2a82('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2a82('0x3'));var moment=require(_0x2a82('0x4'));var BPromise=require(_0x2a82('0x5'));var Mustache=require('mustache');var util=require(_0x2a82('0x6'));var path=require('path');var sox=require(_0x2a82('0x7'));var csv=require('to-csv');var ejs=require(_0x2a82('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2a82('0x9'));var crypto=require(_0x2a82('0xa'));var jsforce=require(_0x2a82('0xb'));var deskjs=require(_0x2a82('0xc'));var toCsv=require(_0x2a82('0xd'));var querystring=require(_0x2a82('0xe'));var Papa=require('papaparse');var Redis=require(_0x2a82('0xf'));var authService=require(_0x2a82('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x2a82('0x11'));var logger=require(_0x2a82('0x12'))(_0x2a82('0x13'));var utils=require(_0x2a82('0x14'));var config=require(_0x2a82('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x867a95,_0x106a00){_0x106a00=_0x106a00||0xcc;return function(_0x7b57be){if(_0x7b57be){return _0x867a95[_0x2a82('0x16')](_0x106a00);}return _0x867a95[_0x2a82('0x17')](_0x106a00)[_0x2a82('0x18')]();};}function respondWithResult(_0x3b25d2,_0x16efd1){_0x16efd1=_0x16efd1||0xc8;return function(_0x39aafd){if(_0x39aafd){return _0x3b25d2[_0x2a82('0x17')](_0x16efd1)[_0x2a82('0x19')](_0x39aafd);}};}function respondWithFilteredResult(_0x43ddad,_0x112ee8){return function(_0x32b833){if(_0x32b833){var _0x217b45=_0x32b833[_0x2a82('0x1a')],_0x183a89=_0x112ee8[_0x2a82('0x1b')],_0x3f4028=_0x112ee8[_0x2a82('0x1b')]+_0x112ee8[_0x2a82('0x1c')],_0x5ac422;if(_0x3f4028>=_0x217b45){_0x3f4028=_0x217b45;_0x5ac422=0xc8;}else{_0x5ac422=0xce;}_0x43ddad[_0x2a82('0x17')](_0x5ac422);return _0x43ddad['set'](_0x2a82('0x1d'),_0x183a89+'-'+_0x3f4028+'/'+_0x217b45)[_0x2a82('0x19')](_0x32b833);}return null;};}function patchUpdates(_0x18409a){return function(_0x46274e){try{jsonpatch[_0x2a82('0x1e')](_0x46274e,_0x18409a,!![]);}catch(_0x1799a4){return BPromise[_0x2a82('0x1f')](_0x1799a4);}return _0x46274e[_0x2a82('0x20')]();};}function saveUpdates(_0x4d9038,_0x2c46fd){return function(_0x5cb3b1){if(_0x5cb3b1){return _0x5cb3b1[_0x2a82('0x21')](_0x4d9038)['then'](function(_0x4938f2){return _0x4938f2;});}return null;};}function removeEntity(_0x36539a,_0x38691c){return function(_0x4c5005){if(_0x4c5005){return _0x4c5005[_0x2a82('0x22')]()[_0x2a82('0x23')](function(){var _0x35b480=_0x4c5005[_0x2a82('0x24')]({'plain':!![]});var _0x4b11ca=_0x2a82('0x25');return db[_0x2a82('0x26')][_0x2a82('0x22')]({'where':{'type':_0x4b11ca,'resourceId':_0x35b480['id']}})['then'](function(){return _0x4c5005;});})[_0x2a82('0x23')](function(){_0x36539a[_0x2a82('0x17')](0xcc)[_0x2a82('0x18')]();});}};}function handleEntityNotFound(_0x5ed9a0,_0x3c1018){return function(_0x1d965d){if(!_0x1d965d){_0x5ed9a0[_0x2a82('0x16')](0x194);}return _0x1d965d;};}function handleError(_0x292908,_0x221257){_0x221257=_0x221257||0x1f4;return function(_0x58513b){logger[_0x2a82('0x27')](_0x58513b[_0x2a82('0x28')]);if(_0x58513b[_0x2a82('0x29')]){delete _0x58513b['name'];}_0x292908[_0x2a82('0x17')](_0x221257)['send'](_0x58513b);};}exports[_0x2a82('0x2a')]=function(_0xe2a81e,_0x4f2d52){var _0x2eb9c6={},_0x480544={},_0x395ad5={'count':0x0,'rows':[]};var _0x4e5131=db[_0x2a82('0x2b')][_0x2a82('0x2c')];_0x480544['model']=_[_0x2a82('0x2d')](_0x4e5131);_0x480544[_0x2a82('0x2e')]=_[_0x2a82('0x2d')](_0xe2a81e[_0x2a82('0x2e')]);_0x480544['filters']=_['intersection'](_0x480544[_0x2a82('0x2f')],_0x480544[_0x2a82('0x2e')]);_0x2eb9c6[_0x2a82('0x30')]=_[_0x2a82('0x31')](_0x480544[_0x2a82('0x2f')],qs[_0x2a82('0x32')](_0xe2a81e['query'][_0x2a82('0x32')]));_0x2eb9c6['attributes']=_0x2eb9c6[_0x2a82('0x30')][_0x2a82('0x33')]?_0x2eb9c6[_0x2a82('0x30')]:_0x480544['model'];if(!_0xe2a81e['query'][_0x2a82('0x34')](_0x2a82('0x35'))){_0x2eb9c6[_0x2a82('0x1c')]=qs['limit'](_0xe2a81e[_0x2a82('0x2e')]['limit']);_0x2eb9c6[_0x2a82('0x1b')]=qs[_0x2a82('0x1b')](_0xe2a81e[_0x2a82('0x2e')][_0x2a82('0x1b')]);}_0x2eb9c6[_0x2a82('0x36')]=qs[_0x2a82('0x37')](_0xe2a81e[_0x2a82('0x2e')][_0x2a82('0x37')]);_0x2eb9c6[_0x2a82('0x38')]=qs['filters'](_[_0x2a82('0x39')](_0xe2a81e['query'],_0x480544[_0x2a82('0x3a')]));if(_0xe2a81e[_0x2a82('0x2e')][_0x2a82('0x3b')]){_0x2eb9c6['where']=_[_0x2a82('0x3c')](_0x2eb9c6[_0x2a82('0x38')],{'$or':_[_0x2a82('0x3d')](_0x4e5131,function(_0x1527a7){if(_0x1527a7[_0x2a82('0x3e')][_0x2a82('0x3f')]!==_0x2a82('0x40')){var _0x1ef830={};_0x1ef830[_0x1527a7[_0x2a82('0x41')]]={'$like':'%'+_0xe2a81e[_0x2a82('0x2e')]['filter']+'%'};return _0x1ef830;}})});}_0x2eb9c6=_['merge']({},_0x2eb9c6,_0xe2a81e['options']);var _0x2a193b={'where':_0x2eb9c6[_0x2a82('0x38')]};return db[_0x2a82('0x2b')]['count'](_0x2a193b)['then'](function(_0x500321){_0x395ad5[_0x2a82('0x1a')]=_0x500321;if(_0xe2a81e[_0x2a82('0x2e')]['includeAll']){_0x2eb9c6[_0x2a82('0x42')]=[{'all':!![]}];}return db[_0x2a82('0x2b')][_0x2a82('0x43')](_0x2eb9c6);})[_0x2a82('0x23')](function(_0x1a0820){_0x395ad5['rows']=_0x1a0820;return _0x395ad5;})['then'](respondWithFilteredResult(_0x4f2d52,_0x2eb9c6))[_0x2a82('0x44')](handleError(_0x4f2d52,null));};exports['show']=function(_0x304e27,_0x4e1cf4){var _0x44679b={'raw':!![],'where':{'id':_0x304e27['params']['id']}},_0x53cdf0={};_0x53cdf0[_0x2a82('0x2f')]=_[_0x2a82('0x2d')](db[_0x2a82('0x2b')][_0x2a82('0x2c')]);_0x53cdf0[_0x2a82('0x2e')]=_[_0x2a82('0x2d')](_0x304e27[_0x2a82('0x2e')]);_0x53cdf0[_0x2a82('0x3a')]=_[_0x2a82('0x31')](_0x53cdf0[_0x2a82('0x2f')],_0x53cdf0[_0x2a82('0x2e')]);_0x44679b[_0x2a82('0x30')]=_[_0x2a82('0x31')](_0x53cdf0[_0x2a82('0x2f')],qs['fields'](_0x304e27[_0x2a82('0x2e')]['fields']));_0x44679b[_0x2a82('0x30')]=_0x44679b[_0x2a82('0x30')]['length']?_0x44679b['attributes']:_0x53cdf0[_0x2a82('0x2f')];if(_0x304e27[_0x2a82('0x2e')]['includeAll']){_0x44679b['include']=[{'all':!![]}];}_0x44679b=_[_0x2a82('0x3c')]({},_0x44679b,_0x304e27[_0x2a82('0x45')]);return db['CannedAnswer'][_0x2a82('0x46')](_0x44679b)[_0x2a82('0x23')](handleEntityNotFound(_0x4e1cf4,null))[_0x2a82('0x23')](respondWithResult(_0x4e1cf4,null))['catch'](handleError(_0x4e1cf4,null));};exports[_0x2a82('0x21')]=function(_0x573504,_0x14c615){if(_0x573504[_0x2a82('0x47')]['id']){delete _0x573504[_0x2a82('0x47')]['id'];}return db[_0x2a82('0x2b')]['find']({'where':{'id':_0x573504['params']['id']}})['then'](handleEntityNotFound(_0x14c615,null))[_0x2a82('0x23')](saveUpdates(_0x573504['body'],null))[_0x2a82('0x23')](respondWithResult(_0x14c615,null))[_0x2a82('0x44')](handleError(_0x14c615,null));};exports[_0x2a82('0x22')]=function(_0x31fcbf,_0x15f6d2){return db[_0x2a82('0x2b')][_0x2a82('0x46')]({'where':{'id':_0x31fcbf[_0x2a82('0x48')]['id']}})[_0x2a82('0x23')](handleEntityNotFound(_0x15f6d2,null))[_0x2a82('0x23')](removeEntity(_0x15f6d2,null))['catch'](handleError(_0x15f6d2,null));};exports[_0x2a82('0x49')]=function(_0x150148,_0x7c9b1){var _0x19af00={'key':_0x150148[_0x2a82('0x47')]['key']};if(_0x150148[_0x2a82('0x47')][_0x2a82('0x4a')]){_0x19af00[_0x2a82('0x4a')]=_0x150148[_0x2a82('0x47')]['MailAccountId'];}else if(_0x150148[_0x2a82('0x47')][_0x2a82('0x4b')]){_0x19af00[_0x2a82('0x4b')]=_0x150148[_0x2a82('0x47')]['SmsAccountId'];}else if(_0x150148[_0x2a82('0x47')][_0x2a82('0x4c')]){_0x19af00[_0x2a82('0x4c')]=_0x150148[_0x2a82('0x47')][_0x2a82('0x4c')];}else if(_0x150148[_0x2a82('0x47')]['ChatWebsiteId']){_0x19af00[_0x2a82('0x4d')]=_0x150148['body'][_0x2a82('0x4d')];}return db[_0x2a82('0x2b')]['find']({'where':_0x19af00})[_0x2a82('0x23')](function(_0x3c5bf3){if(_0x3c5bf3){throw new db['Sequelize'][(_0x2a82('0x4e'))](_0x2a82('0x4f'));}return db[_0x2a82('0x2b')][_0x2a82('0x49')](_0x150148[_0x2a82('0x47')]);})['then'](function(_0x4e1619){var _0x3b6f71=_0x150148[_0x2a82('0x50')][_0x2a82('0x24')]({'plain':!![]});if(!_0x3b6f71)throw new Error(_0x2a82('0x51'));if(_0x3b6f71[_0x2a82('0x52')]==='user'){var _0x44b30a=_0x4e1619[_0x2a82('0x24')]({'plain':!![]});return db[_0x2a82('0x53')][_0x2a82('0x46')]({'where':{'name':'CannedAnswers','userProfileId':_0x3b6f71[_0x2a82('0x54')]},'raw':!![]})['then'](function(_0x3eaffc){if(_0x3eaffc&&_0x3eaffc[_0x2a82('0x55')]===0x0){return db[_0x2a82('0x26')][_0x2a82('0x49')]({'name':_0x44b30a['name'],'resourceId':_0x44b30a['id'],'type':_0x3eaffc['name'],'sectionId':_0x3eaffc['id']},{})[_0x2a82('0x23')](function(){return _0x4e1619;});}else{return _0x4e1619;}})[_0x2a82('0x44')](function(_0x3f1b98){logger[_0x2a82('0x27')](_0x2a82('0x56'),_0x3f1b98);throw _0x3f1b98;});}return _0x4e1619;})[_0x2a82('0x23')](respondWithResult(_0x7c9b1,0xc9))[_0x2a82('0x44')](handleError(_0x7c9b1,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index fa5890f..ab0011a 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 _0x9026=['request-promise','rimraf','./cannedAnswer.attributes','exports','define','tools_canned_answers','utf8mb4','lodash','util','../../config/logger','moment'];(function(_0x1966e1,_0x4cb55d){var _0x4c5d56=function(_0x50e6dc){while(--_0x50e6dc){_0x1966e1['push'](_0x1966e1['shift']());}};_0x4c5d56(++_0x4cb55d);}(_0x9026,0x188));var _0x6902=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x9026[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x6902('0x0'));var util=require(_0x6902('0x1'));var logger=require(_0x6902('0x2'))('api');var moment=require(_0x6902('0x3'));var BPromise=require('bluebird');var rp=require(_0x6902('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6902('0x5'));var config=require('../../config/environment');var attributes=require(_0x6902('0x6'));module[_0x6902('0x7')]=function(_0xee6201,_0x46bcee){return _0xee6201[_0x6902('0x8')]('CannedAnswer',attributes,{'tableName':_0x6902('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6902('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x443e=['../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','path'];(function(_0x267f04,_0x18005d){var _0x324621=function(_0x3ef6a9){while(--_0x3ef6a9){_0x267f04['push'](_0x267f04['shift']());}};_0x324621(++_0x18005d);}(_0x443e,0x188));var _0xe443=function(_0x3b7a0c,_0xf1a4c2){_0x3b7a0c=_0x3b7a0c-0x0;var _0x3bb70f=_0x443e[_0x3b7a0c];return _0x3bb70f;};'use strict';var _=require(_0xe443('0x0'));var util=require('util');var logger=require(_0xe443('0x1'))(_0xe443('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe443('0x3'));var rimraf=require('rimraf');var config=require(_0xe443('0x4'));var attributes=require(_0xe443('0x5'));module[_0xe443('0x6')]=function(_0x268a7f,_0xff2d59){return _0x268a7f[_0xe443('0x7')](_0xe443('0x8'),attributes,{'tableName':_0xe443('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe443('0xa'),'collate':_0xe443('0xb')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 104de28..d313449 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 _0xe4ef=['result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','error','code','CannedAnswer,\x20%s,\x20%s','message'];(function(_0x3c1d68,_0x44cce2){var _0x19c5aa=function(_0x154be0){while(--_0x154be0){_0x3c1d68['push'](_0x3c1d68['shift']());}};_0x19c5aa(++_0x44cce2);}(_0xe4ef,0x18e));var _0xfe4e=function(_0x51d05d,_0x5191bc){_0x51d05d=_0x51d05d-0x0;var _0x429b97=_0xe4ef[_0x51d05d];return _0x429b97;};'use strict';var _=require(_0xfe4e('0x0'));var util=require(_0xfe4e('0x1'));var moment=require(_0xfe4e('0x2'));var BPromise=require(_0xfe4e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe4e('0x4'));var db=require(_0xfe4e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfe4e('0x6'))(_0xfe4e('0x7'));var config=require(_0xfe4e('0x8'));var jayson=require(_0xfe4e('0x9'));var client=jayson['client'][_0xfe4e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x604b4b,_0x4e747c,_0x28642f){return new BPromise(function(_0x565b4d,_0x2e6656){return client['request'](_0x604b4b,_0x28642f)[_0xfe4e('0xb')](function(_0x5180a0){logger[_0xfe4e('0xc')]('CannedAnswer,\x20%s,\x20%s',_0x4e747c,_0xfe4e('0xd'));logger['debug'](_0xfe4e('0xe'),_0x4e747c,'request\x20sent',JSON[_0xfe4e('0xf')](_0x5180a0));if(_0x5180a0[_0xfe4e('0x10')]){if(_0x5180a0['error'][_0xfe4e('0x11')]===0x1f4){logger[_0xfe4e('0x10')](_0xfe4e('0x12'),_0x4e747c,_0x5180a0[_0xfe4e('0x10')][_0xfe4e('0x13')]);return _0x2e6656(_0x5180a0['error']['message']);}logger[_0xfe4e('0x10')](_0xfe4e('0x12'),_0x4e747c,_0x5180a0[_0xfe4e('0x10')][_0xfe4e('0x13')]);return _0x565b4d(_0x5180a0[_0xfe4e('0x10')][_0xfe4e('0x13')]);}else{logger['info']('CannedAnswer,\x20%s,\x20%s',_0x4e747c,_0xfe4e('0xd'));_0x565b4d(_0x5180a0[_0xfe4e('0x14')][_0xfe4e('0x13')]);}})[_0xfe4e('0x15')](function(_0x3b87fe){logger['error'](_0xfe4e('0x12'),_0x4e747c,_0x3b87fe);_0x2e6656(_0x3b87fe);});});} \ No newline at end of file +var _0x9469=['CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','info','CannedAnswer,\x20%s,\x20%s','request\x20sent'];(function(_0x2a6bf8,_0x26df71){var _0x4c7ec0=function(_0x3dcf39){while(--_0x3dcf39){_0x2a6bf8['push'](_0x2a6bf8['shift']());}};_0x4c7ec0(++_0x26df71);}(_0x9469,0x1d3));var _0x9946=function(_0x3b26b8,_0x5dde68){_0x3b26b8=_0x3b26b8-0x0;var _0x4279a9=_0x9469[_0x3b26b8];return _0x4279a9;};'use strict';var _=require(_0x9946('0x0'));var util=require(_0x9946('0x1'));var moment=require(_0x9946('0x2'));var BPromise=require(_0x9946('0x3'));var rs=require(_0x9946('0x4'));var fs=require('fs');var Redis=require(_0x9946('0x5'));var db=require(_0x9946('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9946('0x7'))(_0x9946('0x8'));var config=require(_0x9946('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9946('0xa')][_0x9946('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf7cd9b,_0x596d0a,_0x324034){return new BPromise(function(_0x3cee48,_0x1ca668){return client['request'](_0xf7cd9b,_0x324034)[_0x9946('0xc')](function(_0x2e7bfc){logger[_0x9946('0xd')](_0x9946('0xe'),_0x596d0a,_0x9946('0xf'));logger['debug'](_0x9946('0x10'),_0x596d0a,_0x9946('0xf'),JSON[_0x9946('0x11')](_0x2e7bfc));if(_0x2e7bfc[_0x9946('0x12')]){if(_0x2e7bfc['error'][_0x9946('0x13')]===0x1f4){logger['error']('CannedAnswer,\x20%s,\x20%s',_0x596d0a,_0x2e7bfc['error'][_0x9946('0x14')]);return _0x1ca668(_0x2e7bfc['error'][_0x9946('0x14')]);}logger[_0x9946('0x12')]('CannedAnswer,\x20%s,\x20%s',_0x596d0a,_0x2e7bfc[_0x9946('0x12')][_0x9946('0x14')]);return _0x3cee48(_0x2e7bfc['error'][_0x9946('0x14')]);}else{logger[_0x9946('0xd')](_0x9946('0xe'),_0x596d0a,_0x9946('0xf'));_0x3cee48(_0x2e7bfc[_0x9946('0x15')][_0x9946('0x14')]);}})[_0x9946('0x16')](function(_0x3215b4){logger[_0x9946('0x12')]('CannedAnswer,\x20%s,\x20%s',_0x596d0a,_0x3215b4);_0x1ca668(_0x3215b4);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index 4a97e65..12aed70 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 _0x5dfd=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','get','/:id','post','create'];(function(_0x38ce60,_0x123fe2){var _0x44ab67=function(_0x1d0cb4){while(--_0x1d0cb4){_0x38ce60['push'](_0x38ce60['shift']());}};_0x44ab67(++_0x123fe2);}(_0x5dfd,0xec));var _0xd5df=function(_0x126fb9,_0x122c59){_0x126fb9=_0x126fb9-0x0;var _0xc8a3b1=_0x5dfd[_0x126fb9];return _0xc8a3b1;};'use strict';var multer=require(_0xd5df('0x0'));var util=require(_0xd5df('0x1'));var path=require(_0xd5df('0x2'));var timeout=require(_0xd5df('0x3'));var express=require(_0xd5df('0x4'));var router=express[_0xd5df('0x5')]();var auth=require(_0xd5df('0x6'));var interaction=require(_0xd5df('0x7'));var config=require(_0xd5df('0x8'));var controller=require(_0xd5df('0x9'));router['get']('/',auth[_0xd5df('0xa')](),controller[_0xd5df('0xb')]);router[_0xd5df('0xc')](_0xd5df('0xd'),auth[_0xd5df('0xa')](),controller['show']);router[_0xd5df('0xe')]('/',auth[_0xd5df('0xa')](),controller[_0xd5df('0xf')]);router[_0xd5df('0x10')](_0xd5df('0xd'),auth[_0xd5df('0xa')](),controller[_0xd5df('0x11')]);router[_0xd5df('0x12')](_0xd5df('0xd'),auth['isAuthenticated'](),controller[_0xd5df('0x13')]);module[_0xd5df('0x14')]=router; \ No newline at end of file +var _0x4a74=['isAuthenticated','index','post','create','put','/:id','update','exports','multer','path','connect-timeout','express','Router','../../config/environment','./cannedAnswer.controller','get'];(function(_0x2513f0,_0x3298f5){var _0x235adf=function(_0x56667f){while(--_0x56667f){_0x2513f0['push'](_0x2513f0['shift']());}};_0x235adf(++_0x3298f5);}(_0x4a74,0x158));var _0x44a7=function(_0x1f69a0,_0x561598){_0x1f69a0=_0x1f69a0-0x0;var _0x14ce9e=_0x4a74[_0x1f69a0];return _0x14ce9e;};'use strict';var multer=require(_0x44a7('0x0'));var util=require('util');var path=require(_0x44a7('0x1'));var timeout=require(_0x44a7('0x2'));var express=require(_0x44a7('0x3'));var router=express[_0x44a7('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x44a7('0x5'));var controller=require(_0x44a7('0x6'));router[_0x44a7('0x7')]('/',auth[_0x44a7('0x8')](),controller[_0x44a7('0x9')]);router[_0x44a7('0x7')]('/:id',auth[_0x44a7('0x8')](),controller['show']);router[_0x44a7('0xa')]('/',auth[_0x44a7('0x8')](),controller[_0x44a7('0xb')]);router[_0x44a7('0xc')](_0x44a7('0xd'),auth[_0x44a7('0x8')](),controller[_0x44a7('0xe')]);router['delete']('/:id',auth[_0x44a7('0x8')](),controller['destroy']);module[_0x44a7('0xf')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 02fe26f..623e85a 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 _0x8454=['INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x5f34a3,_0x4ba871){var _0xeabd05=function(_0x3ececd){while(--_0x3ececd){_0x5f34a3['push'](_0x5f34a3['shift']());}};_0xeabd05(++_0x4ba871);}(_0x8454,0xe5));var _0x4845=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x8454[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0x4845('0x0'));module[_0x4845('0x1')]={'calldate':{'type':Sequelize[_0x4845('0x2')],'allowNull':![],'defaultValue':_0x4845('0x3')},'clid':{'type':Sequelize[_0x4845('0x4')]},'src':{'type':Sequelize[_0x4845('0x4')]},'dst':{'type':Sequelize[_0x4845('0x4')]},'dcontext':{'type':Sequelize[_0x4845('0x4')]},'channel':{'type':Sequelize[_0x4845('0x4')]},'dstchannel':{'type':Sequelize[_0x4845('0x4')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x4845('0x4')]},'duration':{'type':Sequelize[_0x4845('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x4845('0x4')]},'amaflags':{'type':Sequelize[_0x4845('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x4845('0x4')]},'userfield':{'type':Sequelize[_0x4845('0x4')]},'uniqueid':{'type':Sequelize[_0x4845('0x4')]},'linkedid':{'type':Sequelize[_0x4845('0x4')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x4845('0x4')]},'type':{'type':Sequelize[_0x4845('0x4')]},'tag':{'type':Sequelize[_0x4845('0x4')]}}; \ No newline at end of file +var _0x96fb=['STRING','INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x45b361,_0x34a7c0){var _0x257282=function(_0x5d3c2d){while(--_0x5d3c2d){_0x45b361['push'](_0x45b361['shift']());}};_0x257282(++_0x34a7c0);}(_0x96fb,0x116));var _0xb96f=function(_0x3e6b21,_0x1ec94c){_0x3e6b21=_0x3e6b21-0x0;var _0x467d5f=_0x96fb[_0x3e6b21];return _0x467d5f;};'use strict';var Sequelize=require(_0xb96f('0x0'));module[_0xb96f('0x1')]={'calldate':{'type':Sequelize[_0xb96f('0x2')],'allowNull':![],'defaultValue':_0xb96f('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xb96f('0x4')]},'dst':{'type':Sequelize[_0xb96f('0x4')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xb96f('0x4')]},'dstchannel':{'type':Sequelize[_0xb96f('0x4')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xb96f('0x4')]},'duration':{'type':Sequelize[_0xb96f('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xb96f('0x4')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xb96f('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xb96f('0x4')]},'sequence':{'type':Sequelize[_0xb96f('0x4')]},'peeraccount':{'type':Sequelize[_0xb96f('0x4')]},'type':{'type':Sequelize[_0xb96f('0x4')]},'tag':{'type':Sequelize[_0xb96f('0x4')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 7eb64fd..3effa73 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 _0x736c=['fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','key','field','filter','options','findAll','rows','catch','show','params','includeAll','include','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','json','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','Cdr','rawAttributes','model','keys','query','filters','intersection'];(function(_0x39049f,_0x1a38ac){var _0x4a893b=function(_0x104abc){while(--_0x104abc){_0x39049f['push'](_0x39049f['shift']());}};_0x4a893b(++_0x1a38ac);}(_0x736c,0x191));var _0xc736=function(_0x11d556,_0x1ab952){_0x11d556=_0x11d556-0x0;var _0x151d44=_0x736c[_0x11d556];return _0x151d44;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc736('0x0'));var rimraf=require(_0xc736('0x1'));var zipdir=require(_0xc736('0x2'));var jsonpatch=require(_0xc736('0x3'));var rp=require(_0xc736('0x4'));var moment=require(_0xc736('0x5'));var BPromise=require(_0xc736('0x6'));var Mustache=require(_0xc736('0x7'));var util=require(_0xc736('0x8'));var path=require(_0xc736('0x9'));var sox=require(_0xc736('0xa'));var csv=require('to-csv');var ejs=require(_0xc736('0xb'));var fs=require('fs');var _=require(_0xc736('0xc'));var squel=require(_0xc736('0xd'));var crypto=require('crypto');var jsforce=require(_0xc736('0xe'));var deskjs=require(_0xc736('0xf'));var toCsv=require(_0xc736('0x10'));var querystring=require(_0xc736('0x11'));var Papa=require(_0xc736('0x12'));var Redis=require(_0xc736('0x13'));var authService=require(_0xc736('0x14'));var qs=require(_0xc736('0x15'));var hardwareService=require(_0xc736('0x16'));var logger=require(_0xc736('0x17'))(_0xc736('0x18'));var utils=require('../../config/utils');var config=require(_0xc736('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16aeb9,_0x2c9e61){_0x2c9e61=_0x2c9e61||0xcc;return function(_0x384d6a){if(_0x384d6a){return _0x16aeb9[_0xc736('0x1a')](_0x2c9e61);}return _0x16aeb9['status'](_0x2c9e61)['end']();};}function respondWithResult(_0x57e6f0,_0x25aeaf){_0x25aeaf=_0x25aeaf||0xc8;return function(_0x3b69bf){if(_0x3b69bf){return _0x57e6f0[_0xc736('0x1b')](_0x25aeaf)[_0xc736('0x1c')](_0x3b69bf);}};}function respondWithFilteredResult(_0x1b0ba0,_0x16ec71){return function(_0x1b0ca9){if(_0x1b0ca9){var _0xa91c9e=_0x1b0ca9[_0xc736('0x1d')],_0x411c92=_0x16ec71[_0xc736('0x1e')],_0x3c0c7c=_0x16ec71[_0xc736('0x1e')]+_0x16ec71['limit'],_0x58c286;if(_0x3c0c7c>=_0xa91c9e){_0x3c0c7c=_0xa91c9e;_0x58c286=0xc8;}else{_0x58c286=0xce;}_0x1b0ba0['status'](_0x58c286);return _0x1b0ba0[_0xc736('0x1f')](_0xc736('0x20'),_0x411c92+'-'+_0x3c0c7c+'/'+_0xa91c9e)[_0xc736('0x1c')](_0x1b0ca9);}return null;};}function patchUpdates(_0x5c0b14){return function(_0x45b5a3){try{jsonpatch[_0xc736('0x21')](_0x45b5a3,_0x5c0b14,!![]);}catch(_0x5a0ded){return BPromise['reject'](_0x5a0ded);}return _0x45b5a3[_0xc736('0x22')]();};}function saveUpdates(_0x3d601a,_0x4418ef){return function(_0x3599f0){if(_0x3599f0){return _0x3599f0[_0xc736('0x23')](_0x3d601a)[_0xc736('0x24')](function(_0x2f46e6){return _0x2f46e6;});}return null;};}function removeEntity(_0xf170ea,_0x43f289){return function(_0x1cc857){if(_0x1cc857){return _0x1cc857[_0xc736('0x25')]()['then'](function(){_0xf170ea[_0xc736('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4092a0,_0xa2f11e){return function(_0x2c24cf){if(!_0x2c24cf){_0x4092a0[_0xc736('0x1a')](0x194);}return _0x2c24cf;};}function handleError(_0x336134,_0xa13f0c){_0xa13f0c=_0xa13f0c||0x1f4;return function(_0x41bfa5){logger[_0xc736('0x26')](_0x41bfa5[_0xc736('0x27')]);if(_0x41bfa5[_0xc736('0x28')]){delete _0x41bfa5[_0xc736('0x28')];}_0x336134['status'](_0xa13f0c)['send'](_0x41bfa5);};}exports[_0xc736('0x29')]=function(_0x5a50df,_0x49b4b6){var _0x54dd33={},_0x5841e1={},_0x6b15c4={'count':0x0,'rows':[]};var _0x36e8ce=db[_0xc736('0x2a')][_0xc736('0x2b')];_0x5841e1[_0xc736('0x2c')]=_[_0xc736('0x2d')](_0x36e8ce);_0x5841e1[_0xc736('0x2e')]=_['keys'](_0x5a50df['query']);_0x5841e1[_0xc736('0x2f')]=_[_0xc736('0x30')](_0x5841e1[_0xc736('0x2c')],_0x5841e1[_0xc736('0x2e')]);_0x54dd33['attributes']=_[_0xc736('0x30')](_0x5841e1[_0xc736('0x2c')],qs[_0xc736('0x31')](_0x5a50df[_0xc736('0x2e')][_0xc736('0x31')]));_0x54dd33[_0xc736('0x32')]=_0x54dd33[_0xc736('0x32')][_0xc736('0x33')]?_0x54dd33[_0xc736('0x32')]:_0x5841e1['model'];if(!_0x5a50df[_0xc736('0x2e')][_0xc736('0x34')](_0xc736('0x35'))){_0x54dd33[_0xc736('0x36')]=qs['limit'](_0x5a50df['query'][_0xc736('0x36')]);_0x54dd33[_0xc736('0x1e')]=qs[_0xc736('0x1e')](_0x5a50df[_0xc736('0x2e')][_0xc736('0x1e')]);}_0x54dd33[_0xc736('0x37')]=qs[_0xc736('0x38')](_0x5a50df['query'][_0xc736('0x38')]);_0x54dd33[_0xc736('0x39')]=qs['filters'](_[_0xc736('0x3a')](_0x5a50df['query'],_0x5841e1[_0xc736('0x2f')]));if(_0x5a50df[_0xc736('0x2e')]['filter']){_0x54dd33[_0xc736('0x39')]=_[_0xc736('0x3b')](_0x54dd33['where'],{'$or':_['map'](_0x36e8ce,function(_0x240d07){if(_0x240d07['type'][_0xc736('0x3c')]!=='VIRTUAL'){var _0x377baa={};_0x377baa[_0x240d07[_0xc736('0x3d')]]={'$like':'%'+_0x5a50df[_0xc736('0x2e')][_0xc736('0x3e')]+'%'};return _0x377baa;}})});}_0x54dd33=_[_0xc736('0x3b')]({},_0x54dd33,_0x5a50df[_0xc736('0x3f')]);var _0x4832af={'where':_0x54dd33[_0xc736('0x39')]};return db[_0xc736('0x2a')][_0xc736('0x1d')](_0x4832af)[_0xc736('0x24')](function(_0x55e592){_0x6b15c4[_0xc736('0x1d')]=_0x55e592;if(_0x5a50df[_0xc736('0x2e')]['includeAll']){_0x54dd33['include']=[{'all':!![]}];}return db[_0xc736('0x2a')][_0xc736('0x40')](_0x54dd33);})[_0xc736('0x24')](function(_0x196d05){_0x6b15c4[_0xc736('0x41')]=_0x196d05;return _0x6b15c4;})[_0xc736('0x24')](respondWithFilteredResult(_0x49b4b6,_0x54dd33))[_0xc736('0x42')](handleError(_0x49b4b6,null));};exports[_0xc736('0x43')]=function(_0x1b8784,_0x4839d2){var _0x52aa69={'raw':!![],'where':{'id':_0x1b8784[_0xc736('0x44')]['id']}},_0x291eac={};_0x291eac[_0xc736('0x2c')]=_[_0xc736('0x2d')](db['Cdr']['rawAttributes']);_0x291eac[_0xc736('0x2e')]=_[_0xc736('0x2d')](_0x1b8784[_0xc736('0x2e')]);_0x291eac[_0xc736('0x2f')]=_[_0xc736('0x30')](_0x291eac[_0xc736('0x2c')],_0x291eac[_0xc736('0x2e')]);_0x52aa69[_0xc736('0x32')]=_[_0xc736('0x30')](_0x291eac[_0xc736('0x2c')],qs['fields'](_0x1b8784['query']['fields']));_0x52aa69['attributes']=_0x52aa69[_0xc736('0x32')][_0xc736('0x33')]?_0x52aa69[_0xc736('0x32')]:_0x291eac[_0xc736('0x2c')];if(_0x1b8784[_0xc736('0x2e')][_0xc736('0x45')]){_0x52aa69[_0xc736('0x46')]=[{'all':!![]}];}_0x52aa69=_[_0xc736('0x3b')]({},_0x52aa69,_0x1b8784[_0xc736('0x3f')]);return db[_0xc736('0x2a')]['find'](_0x52aa69)[_0xc736('0x24')](handleEntityNotFound(_0x4839d2,null))[_0xc736('0x24')](respondWithResult(_0x4839d2,null))[_0xc736('0x42')](handleError(_0x4839d2,null));};exports['create']=function(_0x2719ee,_0x4d0750){return db[_0xc736('0x2a')][_0xc736('0x47')](_0x2719ee['body'],{})[_0xc736('0x24')](respondWithResult(_0x4d0750,0xc9))[_0xc736('0x42')](handleError(_0x4d0750,null));};exports[_0xc736('0x23')]=function(_0x4bdc53,_0x4c0a08){if(_0x4bdc53[_0xc736('0x48')]['id']){delete _0x4bdc53[_0xc736('0x48')]['id'];}return db[_0xc736('0x2a')][_0xc736('0x49')]({'where':{'id':_0x4bdc53[_0xc736('0x44')]['id']}})[_0xc736('0x24')](handleEntityNotFound(_0x4c0a08,null))[_0xc736('0x24')](saveUpdates(_0x4bdc53[_0xc736('0x48')],null))[_0xc736('0x24')](respondWithResult(_0x4c0a08,null))[_0xc736('0x42')](handleError(_0x4c0a08,null));};exports[_0xc736('0x25')]=function(_0x3af4b2,_0x41354b){return db[_0xc736('0x2a')][_0xc736('0x49')]({'where':{'id':_0x3af4b2[_0xc736('0x44')]['id']}})['then'](handleEntityNotFound(_0x41354b,null))[_0xc736('0x24')](removeEntity(_0x41354b,null))['catch'](handleError(_0x41354b,null));};exports['describe']=function(_0xea071,_0x2a1a1a){return db[_0xc736('0x2a')][_0xc736('0x4a')]()['then'](respondWithResult(_0x2a1a1a,null))['catch'](handleError(_0x2a1a1a,null));}; \ No newline at end of file +var _0x4896=['error','stack','send','Cdr','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','map','type','key','merge','options','count','then','includeAll','include','findAll','show','params','find','create','body','catch','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','set','reject','save','update','destroy'];(function(_0x120144,_0x6d7919){var _0x327c40=function(_0x8a3c7a){while(--_0x8a3c7a){_0x120144['push'](_0x120144['shift']());}};_0x327c40(++_0x6d7919);}(_0x4896,0x133));var _0x6489=function(_0x5e2e47,_0x46e1d4){_0x5e2e47=_0x5e2e47-0x0;var _0x4d7bad=_0x4896[_0x5e2e47];return _0x4d7bad;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6489('0x0'));var rimraf=require(_0x6489('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6489('0x2'));var rp=require('request-promise');var moment=require(_0x6489('0x3'));var BPromise=require(_0x6489('0x4'));var Mustache=require(_0x6489('0x5'));var util=require('util');var path=require(_0x6489('0x6'));var sox=require(_0x6489('0x7'));var csv=require('to-csv');var ejs=require(_0x6489('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6489('0x9'));var crypto=require(_0x6489('0xa'));var jsforce=require(_0x6489('0xb'));var deskjs=require(_0x6489('0xc'));var toCsv=require(_0x6489('0xd'));var querystring=require(_0x6489('0xe'));var Papa=require(_0x6489('0xf'));var Redis=require(_0x6489('0x10'));var authService=require(_0x6489('0x11'));var qs=require(_0x6489('0x12'));var hardwareService=require(_0x6489('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x6489('0x14'));var config=require(_0x6489('0x15'));var db=require(_0x6489('0x16'))['db'];function respondWithStatusCode(_0x442588,_0x2c52e4){_0x2c52e4=_0x2c52e4||0xcc;return function(_0x250f31){if(_0x250f31){return _0x442588['sendStatus'](_0x2c52e4);}return _0x442588[_0x6489('0x17')](_0x2c52e4)[_0x6489('0x18')]();};}function respondWithResult(_0x2f6ae9,_0x4f87ac){_0x4f87ac=_0x4f87ac||0xc8;return function(_0x5dfc25){if(_0x5dfc25){return _0x2f6ae9[_0x6489('0x17')](_0x4f87ac)[_0x6489('0x19')](_0x5dfc25);}};}function respondWithFilteredResult(_0x58314f,_0x282759){return function(_0x5b59bd){if(_0x5b59bd){var _0xa0e8d4=_0x5b59bd['count'],_0x4e2889=_0x282759[_0x6489('0x1a')],_0x492bce=_0x282759['offset']+_0x282759[_0x6489('0x1b')],_0x2cc9a9;if(_0x492bce>=_0xa0e8d4){_0x492bce=_0xa0e8d4;_0x2cc9a9=0xc8;}else{_0x2cc9a9=0xce;}_0x58314f[_0x6489('0x17')](_0x2cc9a9);return _0x58314f[_0x6489('0x1c')]('Content-Range',_0x4e2889+'-'+_0x492bce+'/'+_0xa0e8d4)[_0x6489('0x19')](_0x5b59bd);}return null;};}function patchUpdates(_0x1af4dc){return function(_0x4f3101){try{jsonpatch['apply'](_0x4f3101,_0x1af4dc,!![]);}catch(_0x1cd8a1){return BPromise[_0x6489('0x1d')](_0x1cd8a1);}return _0x4f3101[_0x6489('0x1e')]();};}function saveUpdates(_0x4e0d48,_0xb0d1e5){return function(_0x26496e){if(_0x26496e){return _0x26496e[_0x6489('0x1f')](_0x4e0d48)['then'](function(_0x554b7c){return _0x554b7c;});}return null;};}function removeEntity(_0x5c370b,_0x2fa122){return function(_0x1ab16a){if(_0x1ab16a){return _0x1ab16a[_0x6489('0x20')]()['then'](function(){_0x5c370b[_0x6489('0x17')](0xcc)[_0x6489('0x18')]();});}};}function handleEntityNotFound(_0x3d5158,_0x4cc097){return function(_0xe74bb4){if(!_0xe74bb4){_0x3d5158['sendStatus'](0x194);}return _0xe74bb4;};}function handleError(_0xf832f3,_0x191be1){_0x191be1=_0x191be1||0x1f4;return function(_0x293331){logger[_0x6489('0x21')](_0x293331[_0x6489('0x22')]);if(_0x293331['name']){delete _0x293331['name'];}_0xf832f3['status'](_0x191be1)[_0x6489('0x23')](_0x293331);};}exports['index']=function(_0x448878,_0x8b3c20){var _0x390b3f={},_0xfad077={},_0xafd9a4={'count':0x0,'rows':[]};var _0x41d3da=db[_0x6489('0x24')][_0x6489('0x25')];_0xfad077[_0x6489('0x26')]=_[_0x6489('0x27')](_0x41d3da);_0xfad077[_0x6489('0x28')]=_['keys'](_0x448878[_0x6489('0x28')]);_0xfad077['filters']=_[_0x6489('0x29')](_0xfad077['model'],_0xfad077[_0x6489('0x28')]);_0x390b3f[_0x6489('0x2a')]=_[_0x6489('0x29')](_0xfad077[_0x6489('0x26')],qs[_0x6489('0x2b')](_0x448878[_0x6489('0x28')][_0x6489('0x2b')]));_0x390b3f['attributes']=_0x390b3f['attributes'][_0x6489('0x2c')]?_0x390b3f[_0x6489('0x2a')]:_0xfad077[_0x6489('0x26')];if(!_0x448878['query'][_0x6489('0x2d')]('nolimit')){_0x390b3f['limit']=qs[_0x6489('0x1b')](_0x448878[_0x6489('0x28')][_0x6489('0x1b')]);_0x390b3f[_0x6489('0x1a')]=qs[_0x6489('0x1a')](_0x448878[_0x6489('0x28')]['offset']);}_0x390b3f[_0x6489('0x2e')]=qs[_0x6489('0x2f')](_0x448878[_0x6489('0x28')][_0x6489('0x2f')]);_0x390b3f[_0x6489('0x30')]=qs[_0x6489('0x31')](_['pick'](_0x448878[_0x6489('0x28')],_0xfad077[_0x6489('0x31')]));if(_0x448878['query'][_0x6489('0x32')]){_0x390b3f[_0x6489('0x30')]=_['merge'](_0x390b3f[_0x6489('0x30')],{'$or':_[_0x6489('0x33')](_0x41d3da,function(_0xf8356e){if(_0xf8356e[_0x6489('0x34')][_0x6489('0x35')]!=='VIRTUAL'){var _0x415b28={};_0x415b28[_0xf8356e['field']]={'$like':'%'+_0x448878[_0x6489('0x28')][_0x6489('0x32')]+'%'};return _0x415b28;}})});}_0x390b3f=_[_0x6489('0x36')]({},_0x390b3f,_0x448878[_0x6489('0x37')]);var _0x425210={'where':_0x390b3f['where']};return db[_0x6489('0x24')][_0x6489('0x38')](_0x425210)[_0x6489('0x39')](function(_0x2c40b2){_0xafd9a4[_0x6489('0x38')]=_0x2c40b2;if(_0x448878[_0x6489('0x28')][_0x6489('0x3a')]){_0x390b3f[_0x6489('0x3b')]=[{'all':!![]}];}return db['Cdr'][_0x6489('0x3c')](_0x390b3f);})[_0x6489('0x39')](function(_0xf64f5f){_0xafd9a4['rows']=_0xf64f5f;return _0xafd9a4;})[_0x6489('0x39')](respondWithFilteredResult(_0x8b3c20,_0x390b3f))['catch'](handleError(_0x8b3c20,null));};exports[_0x6489('0x3d')]=function(_0x3e5164,_0x1705a8){var _0x1a8435={'raw':!![],'where':{'id':_0x3e5164[_0x6489('0x3e')]['id']}},_0x3ceddd={};_0x3ceddd[_0x6489('0x26')]=_[_0x6489('0x27')](db['Cdr'][_0x6489('0x25')]);_0x3ceddd[_0x6489('0x28')]=_[_0x6489('0x27')](_0x3e5164['query']);_0x3ceddd[_0x6489('0x31')]=_[_0x6489('0x29')](_0x3ceddd[_0x6489('0x26')],_0x3ceddd[_0x6489('0x28')]);_0x1a8435[_0x6489('0x2a')]=_[_0x6489('0x29')](_0x3ceddd[_0x6489('0x26')],qs[_0x6489('0x2b')](_0x3e5164[_0x6489('0x28')][_0x6489('0x2b')]));_0x1a8435[_0x6489('0x2a')]=_0x1a8435[_0x6489('0x2a')][_0x6489('0x2c')]?_0x1a8435[_0x6489('0x2a')]:_0x3ceddd['model'];if(_0x3e5164[_0x6489('0x28')][_0x6489('0x3a')]){_0x1a8435['include']=[{'all':!![]}];}_0x1a8435=_['merge']({},_0x1a8435,_0x3e5164[_0x6489('0x37')]);return db[_0x6489('0x24')][_0x6489('0x3f')](_0x1a8435)[_0x6489('0x39')](handleEntityNotFound(_0x1705a8,null))['then'](respondWithResult(_0x1705a8,null))['catch'](handleError(_0x1705a8,null));};exports[_0x6489('0x40')]=function(_0x53a467,_0x539f25){return db[_0x6489('0x24')][_0x6489('0x40')](_0x53a467[_0x6489('0x41')],{})[_0x6489('0x39')](respondWithResult(_0x539f25,0xc9))[_0x6489('0x42')](handleError(_0x539f25,null));};exports['update']=function(_0xb1ce81,_0x21f846){if(_0xb1ce81[_0x6489('0x41')]['id']){delete _0xb1ce81[_0x6489('0x41')]['id'];}return db[_0x6489('0x24')][_0x6489('0x3f')]({'where':{'id':_0xb1ce81['params']['id']}})[_0x6489('0x39')](handleEntityNotFound(_0x21f846,null))[_0x6489('0x39')](saveUpdates(_0xb1ce81[_0x6489('0x41')],null))['then'](respondWithResult(_0x21f846,null))[_0x6489('0x42')](handleError(_0x21f846,null));};exports[_0x6489('0x20')]=function(_0x5322ac,_0x5b244a){return db[_0x6489('0x24')][_0x6489('0x3f')]({'where':{'id':_0x5322ac[_0x6489('0x3e')]['id']}})[_0x6489('0x39')](handleEntityNotFound(_0x5b244a,null))[_0x6489('0x39')](removeEntity(_0x5b244a,null))[_0x6489('0x42')](handleError(_0x5b244a,null));};exports[_0x6489('0x43')]=function(_0x4e9637,_0x863ed){return db[_0x6489('0x24')][_0x6489('0x43')]()[_0x6489('0x39')](respondWithResult(_0x863ed,null))[_0x6489('0x42')](handleError(_0x863ed,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index bedcfee..176d685 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 _0x3c67=['dst','src','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','./cdr.attributes','exports','define','Cdr','cdr','accountcode','calldate','disposition'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0x3c67,0x159));var _0x73c6=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x3c67[_0x599f41];return _0x2e4d58;};'use strict';var _=require(_0x73c6('0x0'));var util=require(_0x73c6('0x1'));var logger=require(_0x73c6('0x2'))(_0x73c6('0x3'));var moment=require(_0x73c6('0x4'));var BPromise=require('bluebird');var rp=require(_0x73c6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x73c6('0x6'));var attributes=require(_0x73c6('0x7'));module[_0x73c6('0x8')]=function(_0x2b3f86,_0x5f49f2){return _0x2b3f86[_0x73c6('0x9')](_0x73c6('0xa'),attributes,{'tableName':_0x73c6('0xb'),'paranoid':![],'indexes':[{'name':_0x73c6('0xc'),'fields':[_0x73c6('0xc')]},{'name':'calldate','fields':[_0x73c6('0xd')]},{'name':_0x73c6('0xe'),'fields':[_0x73c6('0xe')]},{'name':_0x73c6('0xf'),'fields':[_0x73c6('0xf')]},{'name':_0x73c6('0x10'),'fields':[_0x73c6('0x10')]},{'name':_0x73c6('0x11'),'fields':[_0x73c6('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x2fba=['path','rimraf','../../config/environment','exports','define','Cdr','cdr','accountcode','calldate','disposition','dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2fba,0x1bd));var _0xa2fb=function(_0x331440,_0x160bc9){_0x331440=_0x331440-0x0;var _0x4e366a=_0x2fba[_0x331440];return _0x4e366a;};'use strict';var _=require(_0xa2fb('0x0'));var util=require(_0xa2fb('0x1'));var logger=require(_0xa2fb('0x2'))(_0xa2fb('0x3'));var moment=require('moment');var BPromise=require(_0xa2fb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa2fb('0x5'));var rimraf=require(_0xa2fb('0x6'));var config=require(_0xa2fb('0x7'));var attributes=require('./cdr.attributes');module[_0xa2fb('0x8')]=function(_0x1d75e2,_0x3017d2){return _0x1d75e2[_0xa2fb('0x9')](_0xa2fb('0xa'),attributes,{'tableName':_0xa2fb('0xb'),'paranoid':![],'indexes':[{'name':_0xa2fb('0xc'),'fields':[_0xa2fb('0xc')]},{'name':'calldate','fields':[_0xa2fb('0xd')]},{'name':_0xa2fb('0xe'),'fields':[_0xa2fb('0xe')]},{'name':_0xa2fb('0xf'),'fields':[_0xa2fb('0xf')]},{'name':_0xa2fb('0x10'),'fields':['src']},{'name':_0xa2fb('0x11'),'fields':[_0xa2fb('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 7f97b6e..dcbdc74 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 _0xb81d=['Cdr,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3b422d,_0x476ad4){var _0x6f2fd0=function(_0x43f34e){while(--_0x43f34e){_0x3b422d['push'](_0x3b422d['shift']());}};_0x6f2fd0(++_0x476ad4);}(_0xb81d,0x1d1));var _0xdb81=function(_0x21ca13,_0xc01dc4){_0x21ca13=_0x21ca13-0x0;var _0x1a9d29=_0xb81d[_0x21ca13];return _0x1a9d29;};'use strict';var _=require(_0xdb81('0x0'));var util=require(_0xdb81('0x1'));var moment=require(_0xdb81('0x2'));var BPromise=require(_0xdb81('0x3'));var rs=require(_0xdb81('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdb81('0x5'))['db'];var utils=require(_0xdb81('0x6'));var logger=require(_0xdb81('0x7'))('rpc');var config=require(_0xdb81('0x8'));var jayson=require(_0xdb81('0x9'));var client=jayson[_0xdb81('0xa')][_0xdb81('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x201588,_0x3584dd,_0x12f36a){return new BPromise(function(_0x1cb03e,_0x1d5472){return client[_0xdb81('0xc')](_0x201588,_0x12f36a)['then'](function(_0x2cdf72){logger[_0xdb81('0xd')]('Cdr,\x20%s,\x20%s',_0x3584dd,_0xdb81('0xe'));logger[_0xdb81('0xf')](_0xdb81('0x10'),_0x3584dd,_0xdb81('0xe'),JSON[_0xdb81('0x11')](_0x2cdf72));if(_0x2cdf72['error']){if(_0x2cdf72[_0xdb81('0x12')]['code']===0x1f4){logger[_0xdb81('0x12')](_0xdb81('0x13'),_0x3584dd,_0x2cdf72['error'][_0xdb81('0x14')]);return _0x1d5472(_0x2cdf72[_0xdb81('0x12')][_0xdb81('0x14')]);}logger[_0xdb81('0x12')](_0xdb81('0x13'),_0x3584dd,_0x2cdf72[_0xdb81('0x12')][_0xdb81('0x14')]);return _0x1cb03e(_0x2cdf72['error']['message']);}else{logger['info'](_0xdb81('0x13'),_0x3584dd,_0xdb81('0xe'));_0x1cb03e(_0x2cdf72['result'][_0xdb81('0x14')]);}})[_0xdb81('0x15')](function(_0x31ead9){logger[_0xdb81('0x12')]('Cdr,\x20%s,\x20%s',_0x3584dd,_0x31ead9);_0x1d5472(_0x31ead9);});});} \ No newline at end of file +var _0x9138=['http','request','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x3c33d6,_0x1a7e05){var _0x2a0c98=function(_0xd72d4d){while(--_0xd72d4d){_0x3c33d6['push'](_0x3c33d6['shift']());}};_0x2a0c98(++_0x1a7e05);}(_0x9138,0xb5));var _0x8913=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0x9138[_0xc67528];return _0x38e26d;};'use strict';var _=require('lodash');var util=require(_0x8913('0x0'));var moment=require(_0x8913('0x1'));var BPromise=require(_0x8913('0x2'));var rs=require(_0x8913('0x3'));var fs=require('fs');var Redis=require(_0x8913('0x4'));var db=require(_0x8913('0x5'))['db'];var utils=require(_0x8913('0x6'));var logger=require(_0x8913('0x7'))(_0x8913('0x8'));var config=require('../../config/environment');var jayson=require(_0x8913('0x9'));var client=jayson[_0x8913('0xa')][_0x8913('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33f3c1,_0x5fa6b7,_0x146e3d){return new BPromise(function(_0x260562,_0x3cae14){return client[_0x8913('0xc')](_0x33f3c1,_0x146e3d)[_0x8913('0xd')](function(_0x759d54){logger['info'](_0x8913('0xe'),_0x5fa6b7,_0x8913('0xf'));logger[_0x8913('0x10')](_0x8913('0x11'),_0x5fa6b7,_0x8913('0xf'),JSON[_0x8913('0x12')](_0x759d54));if(_0x759d54[_0x8913('0x13')]){if(_0x759d54[_0x8913('0x13')][_0x8913('0x14')]===0x1f4){logger[_0x8913('0x13')](_0x8913('0xe'),_0x5fa6b7,_0x759d54[_0x8913('0x13')][_0x8913('0x15')]);return _0x3cae14(_0x759d54[_0x8913('0x13')]['message']);}logger['error'](_0x8913('0xe'),_0x5fa6b7,_0x759d54[_0x8913('0x13')][_0x8913('0x15')]);return _0x260562(_0x759d54[_0x8913('0x13')][_0x8913('0x15')]);}else{logger[_0x8913('0x16')]('Cdr,\x20%s,\x20%s',_0x5fa6b7,_0x8913('0xf'));_0x260562(_0x759d54[_0x8913('0x17')][_0x8913('0x15')]);}})['catch'](function(_0xca95c0){logger['error'](_0x8913('0xe'),_0x5fa6b7,_0xca95c0);_0x3cae14(_0xca95c0);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 2d4346d..02f2d49 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 _0x2e0a=['isAuthenticated','describe','get','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x2e0a,0xa3));var _0xa2e0=function(_0x4cf104,_0x30692c){_0x4cf104=_0x4cf104-0x0;var _0x4e9537=_0x2e0a[_0x4cf104];return _0x4e9537;};'use strict';var multer=require(_0xa2e0('0x0'));var util=require(_0xa2e0('0x1'));var path=require(_0xa2e0('0x2'));var timeout=require(_0xa2e0('0x3'));var express=require(_0xa2e0('0x4'));var router=express[_0xa2e0('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xa2e0('0x6'));var config=require(_0xa2e0('0x7'));var controller=require('./cdr.controller');router['get']('/',auth[_0xa2e0('0x8')](),controller['index']);router['get']('/describe',auth[_0xa2e0('0x8')](),controller[_0xa2e0('0x9')]);router[_0xa2e0('0xa')](_0xa2e0('0xb'),auth['isAuthenticated'](),controller[_0xa2e0('0xc')]);router[_0xa2e0('0xd')]('/',auth[_0xa2e0('0x8')](),controller[_0xa2e0('0xe')]);router[_0xa2e0('0xf')](_0xa2e0('0xb'),auth['isAuthenticated'](),controller[_0xa2e0('0x10')]);router[_0xa2e0('0x11')](_0xa2e0('0xb'),auth[_0xa2e0('0x8')](),controller['destroy']);module[_0xa2e0('0x12')]=router; \ No newline at end of file +var _0x04f7=['../../config/environment','index','get','/describe','isAuthenticated','describe','show','create','put','/:id','update','exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x2ba23c,_0x14c0f4){var _0x399c52=function(_0x935392){while(--_0x935392){_0x2ba23c['push'](_0x2ba23c['shift']());}};_0x399c52(++_0x14c0f4);}(_0x04f7,0x1f2));var _0x704f=function(_0x538b7b,_0x29540f){_0x538b7b=_0x538b7b-0x0;var _0x35b03e=_0x04f7[_0x538b7b];return _0x35b03e;};'use strict';var multer=require(_0x704f('0x0'));var util=require('util');var path=require(_0x704f('0x1'));var timeout=require(_0x704f('0x2'));var express=require(_0x704f('0x3'));var router=express[_0x704f('0x4')]();var auth=require(_0x704f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x704f('0x6'));var controller=require('./cdr.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x704f('0x7')]);router[_0x704f('0x8')](_0x704f('0x9'),auth[_0x704f('0xa')](),controller[_0x704f('0xb')]);router[_0x704f('0x8')]('/:id',auth[_0x704f('0xa')](),controller[_0x704f('0xc')]);router['post']('/',auth[_0x704f('0xa')](),controller[_0x704f('0xd')]);router[_0x704f('0xe')](_0x704f('0xf'),auth[_0x704f('0xa')](),controller[_0x704f('0x10')]);router['delete'](_0x704f('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x704f('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 c7adf87..5688e70 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 _0xbeb6=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0xbeb6,0x19e));var _0x6beb=function(_0x13cc23,_0x487f14){_0x13cc23=_0x13cc23-0x0;var _0x11677c=_0xbeb6[_0x13cc23];return _0x11677c;};'use strict';var Sequelize=require('sequelize');module[_0x6beb('0x0')]={'priority':{'type':Sequelize[_0x6beb('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x6beb('0x2')],'allowNull':![],'defaultValue':_0x6beb('0x3')},'appdata':{'type':Sequelize[_0x6beb('0x4')]()},'description':{'type':Sequelize[_0x6beb('0x2')]},'interval':{'type':Sequelize[_0x6beb('0x2')],'defaultValue':_0x6beb('0x5')}}; \ No newline at end of file +var _0x9a4d=['INTEGER','STRING','*,*,*,*','sequelize','exports'];(function(_0x4a6156,_0x2b8ce6){var _0x12c1f6=function(_0x533b09){while(--_0x533b09){_0x4a6156['push'](_0x4a6156['shift']());}};_0x12c1f6(++_0x2b8ce6);}(_0x9a4d,0xa8));var _0xd9a4=function(_0x448f46,_0xe5067c){_0x448f46=_0x448f46-0x0;var _0x12878b=_0x9a4d[_0x448f46];return _0x12878b;};'use strict';var Sequelize=require(_0xd9a4('0x0'));module[_0xd9a4('0x1')]={'priority':{'type':Sequelize[_0xd9a4('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xd9a4('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xd9a4('0x3')],'defaultValue':_0xd9a4('0x4')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index f47df13..b14a54a 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 _0x80a9=['attributes','includeAll','include','merge','catch','body','find','destroy','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','update','then','error','stack','name','send','show','params','model','keys','ChatApplication','query','filters','intersection','fields'];(function(_0x210333,_0x2db9be){var _0x37ea98=function(_0x5e6049){while(--_0x5e6049){_0x210333['push'](_0x210333['shift']());}};_0x37ea98(++_0x2db9be);}(_0x80a9,0x198));var _0x980a=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x80a9[_0x278e3c];return _0x3e2d9b;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x980a('0x0'));var zipdir=require(_0x980a('0x1'));var jsonpatch=require(_0x980a('0x2'));var rp=require('request-promise');var moment=require(_0x980a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x980a('0x4'));var util=require('util');var path=require(_0x980a('0x5'));var sox=require(_0x980a('0x6'));var csv=require(_0x980a('0x7'));var ejs=require(_0x980a('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x980a('0x9'));var crypto=require(_0x980a('0xa'));var jsforce=require(_0x980a('0xb'));var deskjs=require(_0x980a('0xc'));var toCsv=require(_0x980a('0x7'));var querystring=require('querystring');var Papa=require(_0x980a('0xd'));var Redis=require(_0x980a('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x980a('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x980a('0x10'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x980a('0x11'))['db'];function respondWithStatusCode(_0x254ff2,_0x6dbf50){_0x6dbf50=_0x6dbf50||0xcc;return function(_0x2b5c7f){if(_0x2b5c7f){return _0x254ff2[_0x980a('0x12')](_0x6dbf50);}return _0x254ff2[_0x980a('0x13')](_0x6dbf50)[_0x980a('0x14')]();};}function respondWithResult(_0x49aef3,_0x57935b){_0x57935b=_0x57935b||0xc8;return function(_0x1a615d){if(_0x1a615d){return _0x49aef3[_0x980a('0x13')](_0x57935b)[_0x980a('0x15')](_0x1a615d);}};}function respondWithFilteredResult(_0x5d0bbd,_0x3aaae0){return function(_0x28770c){if(_0x28770c){var _0x4bf361=_0x28770c[_0x980a('0x16')],_0x358b72=_0x3aaae0[_0x980a('0x17')],_0x2cbeca=_0x3aaae0[_0x980a('0x17')]+_0x3aaae0[_0x980a('0x18')],_0x1a32c2;if(_0x2cbeca>=_0x4bf361){_0x2cbeca=_0x4bf361;_0x1a32c2=0xc8;}else{_0x1a32c2=0xce;}_0x5d0bbd[_0x980a('0x13')](_0x1a32c2);return _0x5d0bbd['set'](_0x980a('0x19'),_0x358b72+'-'+_0x2cbeca+'/'+_0x4bf361)[_0x980a('0x15')](_0x28770c);}return null;};}function patchUpdates(_0x559239){return function(_0x344d4a){try{jsonpatch['apply'](_0x344d4a,_0x559239,!![]);}catch(_0x3ca580){return BPromise[_0x980a('0x1a')](_0x3ca580);}return _0x344d4a['save']();};}function saveUpdates(_0x5913b7,_0x5e235f){return function(_0x3d5305){if(_0x3d5305){return _0x3d5305[_0x980a('0x1b')](_0x5913b7)[_0x980a('0x1c')](function(_0x5b4c1a){return _0x5b4c1a;});}return null;};}function removeEntity(_0x58d56c,_0x1b8151){return function(_0x44f1a7){if(_0x44f1a7){return _0x44f1a7['destroy']()['then'](function(){_0x58d56c['status'](0xcc)[_0x980a('0x14')]();});}};}function handleEntityNotFound(_0x4f1964,_0x303eb0){return function(_0x153596){if(!_0x153596){_0x4f1964[_0x980a('0x12')](0x194);}return _0x153596;};}function handleError(_0x5e1542,_0x178156){_0x178156=_0x178156||0x1f4;return function(_0x2fe555){logger[_0x980a('0x1d')](_0x2fe555[_0x980a('0x1e')]);if(_0x2fe555['name']){delete _0x2fe555[_0x980a('0x1f')];}_0x5e1542[_0x980a('0x13')](_0x178156)[_0x980a('0x20')](_0x2fe555);};}exports[_0x980a('0x21')]=function(_0x110e55,_0xaca078){var _0x302bee={'raw':!![],'where':{'id':_0x110e55[_0x980a('0x22')]['id']}},_0x7d9e12={};_0x7d9e12[_0x980a('0x23')]=_[_0x980a('0x24')](db[_0x980a('0x25')]['rawAttributes']);_0x7d9e12[_0x980a('0x26')]=_[_0x980a('0x24')](_0x110e55[_0x980a('0x26')]);_0x7d9e12[_0x980a('0x27')]=_[_0x980a('0x28')](_0x7d9e12['model'],_0x7d9e12['query']);_0x302bee['attributes']=_[_0x980a('0x28')](_0x7d9e12[_0x980a('0x23')],qs[_0x980a('0x29')](_0x110e55[_0x980a('0x26')]['fields']));_0x302bee[_0x980a('0x2a')]=_0x302bee[_0x980a('0x2a')]['length']?_0x302bee[_0x980a('0x2a')]:_0x7d9e12['model'];if(_0x110e55['query'][_0x980a('0x2b')]){_0x302bee[_0x980a('0x2c')]=[{'all':!![]}];}_0x302bee=_[_0x980a('0x2d')]({},_0x302bee,_0x110e55['options']);return db[_0x980a('0x25')]['find'](_0x302bee)[_0x980a('0x1c')](handleEntityNotFound(_0xaca078,null))[_0x980a('0x1c')](respondWithResult(_0xaca078,null))[_0x980a('0x2e')](handleError(_0xaca078,null));};exports[_0x980a('0x1b')]=function(_0x529fc4,_0x445612){if(_0x529fc4[_0x980a('0x2f')]['id']){delete _0x529fc4[_0x980a('0x2f')]['id'];}return db[_0x980a('0x25')][_0x980a('0x30')]({'where':{'id':_0x529fc4[_0x980a('0x22')]['id']}})[_0x980a('0x1c')](handleEntityNotFound(_0x445612,null))[_0x980a('0x1c')](saveUpdates(_0x529fc4[_0x980a('0x2f')],null))['then'](respondWithResult(_0x445612,null))[_0x980a('0x2e')](handleError(_0x445612,null));};exports[_0x980a('0x31')]=function(_0x48103c,_0x53430c){return db[_0x980a('0x25')][_0x980a('0x30')]({'where':{'id':_0x48103c[_0x980a('0x22')]['id']}})[_0x980a('0x1c')](handleEntityNotFound(_0x53430c,null))[_0x980a('0x1c')](removeEntity(_0x53430c,null))[_0x980a('0x2e')](handleError(_0x53430c,null));}; \ No newline at end of file +var _0xa73c=['papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','apply','save','update','then','destroy','error','name','send','params','keys','rawAttributes','query','filters','model','attributes','intersection','length','includeAll','include','options','find','catch','body','ChatApplication','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','ejs','squel','jsforce','desk.js','to-csv','querystring'];(function(_0x3c28c5,_0x20e5ba){var _0x32fc94=function(_0x26ea9a){while(--_0x26ea9a){_0x3c28c5['push'](_0x3c28c5['shift']());}};_0x32fc94(++_0x20e5ba);}(_0xa73c,0xc5));var _0xca73=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa73c[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0xca73('0x0'));var emlformat=require(_0xca73('0x1'));var rimraf=require(_0xca73('0x2'));var zipdir=require(_0xca73('0x3'));var jsonpatch=require(_0xca73('0x4'));var rp=require(_0xca73('0x5'));var moment=require(_0xca73('0x6'));var BPromise=require(_0xca73('0x7'));var Mustache=require(_0xca73('0x8'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xca73('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xca73('0xa'));var crypto=require('crypto');var jsforce=require(_0xca73('0xb'));var deskjs=require(_0xca73('0xc'));var toCsv=require(_0xca73('0xd'));var querystring=require(_0xca73('0xe'));var Papa=require(_0xca73('0xf'));var Redis=require(_0xca73('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xca73('0x11'));var hardwareService=require(_0xca73('0x12'));var logger=require('../../config/logger')(_0xca73('0x13'));var utils=require('../../config/utils');var config=require(_0xca73('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f9026,_0x4e0a3a){_0x4e0a3a=_0x4e0a3a||0xcc;return function(_0x3afb4c){if(_0x3afb4c){return _0x1f9026[_0xca73('0x15')](_0x4e0a3a);}return _0x1f9026[_0xca73('0x16')](_0x4e0a3a)[_0xca73('0x17')]();};}function respondWithResult(_0x278858,_0x2f6ffc){_0x2f6ffc=_0x2f6ffc||0xc8;return function(_0x2468ee){if(_0x2468ee){return _0x278858[_0xca73('0x16')](_0x2f6ffc)[_0xca73('0x18')](_0x2468ee);}};}function respondWithFilteredResult(_0x3b2276,_0xa663a){return function(_0x4f24e3){if(_0x4f24e3){var _0x411abd=_0x4f24e3[_0xca73('0x19')],_0x581253=_0xa663a[_0xca73('0x1a')],_0x343a2b=_0xa663a['offset']+_0xa663a[_0xca73('0x1b')],_0x45561d;if(_0x343a2b>=_0x411abd){_0x343a2b=_0x411abd;_0x45561d=0xc8;}else{_0x45561d=0xce;}_0x3b2276[_0xca73('0x16')](_0x45561d);return _0x3b2276[_0xca73('0x1c')]('Content-Range',_0x581253+'-'+_0x343a2b+'/'+_0x411abd)[_0xca73('0x18')](_0x4f24e3);}return null;};}function patchUpdates(_0xb08351){return function(_0x31e556){try{jsonpatch[_0xca73('0x1d')](_0x31e556,_0xb08351,!![]);}catch(_0x43171d){return BPromise['reject'](_0x43171d);}return _0x31e556[_0xca73('0x1e')]();};}function saveUpdates(_0x4672db,_0x24930d){return function(_0x2fb8ce){if(_0x2fb8ce){return _0x2fb8ce[_0xca73('0x1f')](_0x4672db)[_0xca73('0x20')](function(_0x1b9a6a){return _0x1b9a6a;});}return null;};}function removeEntity(_0x1275e6,_0xa8e1aa){return function(_0x3b3a73){if(_0x3b3a73){return _0x3b3a73[_0xca73('0x21')]()[_0xca73('0x20')](function(){_0x1275e6['status'](0xcc)[_0xca73('0x17')]();});}};}function handleEntityNotFound(_0x1f3ee9,_0x5823be){return function(_0x337d8c){if(!_0x337d8c){_0x1f3ee9[_0xca73('0x15')](0x194);}return _0x337d8c;};}function handleError(_0x4645eb,_0x417d1e){_0x417d1e=_0x417d1e||0x1f4;return function(_0x5c820b){logger[_0xca73('0x22')](_0x5c820b['stack']);if(_0x5c820b[_0xca73('0x23')]){delete _0x5c820b[_0xca73('0x23')];}_0x4645eb['status'](_0x417d1e)[_0xca73('0x24')](_0x5c820b);};}exports['show']=function(_0x243149,_0x99194b){var _0x37f5c1={'raw':!![],'where':{'id':_0x243149[_0xca73('0x25')]['id']}},_0x477060={};_0x477060['model']=_[_0xca73('0x26')](db['ChatApplication'][_0xca73('0x27')]);_0x477060[_0xca73('0x28')]=_[_0xca73('0x26')](_0x243149[_0xca73('0x28')]);_0x477060[_0xca73('0x29')]=_['intersection'](_0x477060[_0xca73('0x2a')],_0x477060[_0xca73('0x28')]);_0x37f5c1[_0xca73('0x2b')]=_[_0xca73('0x2c')](_0x477060['model'],qs['fields'](_0x243149[_0xca73('0x28')]['fields']));_0x37f5c1['attributes']=_0x37f5c1[_0xca73('0x2b')][_0xca73('0x2d')]?_0x37f5c1[_0xca73('0x2b')]:_0x477060[_0xca73('0x2a')];if(_0x243149['query'][_0xca73('0x2e')]){_0x37f5c1[_0xca73('0x2f')]=[{'all':!![]}];}_0x37f5c1=_['merge']({},_0x37f5c1,_0x243149[_0xca73('0x30')]);return db['ChatApplication'][_0xca73('0x31')](_0x37f5c1)[_0xca73('0x20')](handleEntityNotFound(_0x99194b,null))[_0xca73('0x20')](respondWithResult(_0x99194b,null))[_0xca73('0x32')](handleError(_0x99194b,null));};exports[_0xca73('0x1f')]=function(_0x59ccce,_0x1f1f15){if(_0x59ccce[_0xca73('0x33')]['id']){delete _0x59ccce[_0xca73('0x33')]['id'];}return db[_0xca73('0x34')][_0xca73('0x31')]({'where':{'id':_0x59ccce[_0xca73('0x25')]['id']}})[_0xca73('0x20')](handleEntityNotFound(_0x1f1f15,null))[_0xca73('0x20')](saveUpdates(_0x59ccce['body'],null))[_0xca73('0x20')](respondWithResult(_0x1f1f15,null))[_0xca73('0x32')](handleError(_0x1f1f15,null));};exports[_0xca73('0x21')]=function(_0x2cc60c,_0x39b242){return db[_0xca73('0x34')][_0xca73('0x31')]({'where':{'id':_0x2cc60c[_0xca73('0x25')]['id']}})[_0xca73('0x20')](handleEntityNotFound(_0x39b242,null))[_0xca73('0x20')](removeEntity(_0x39b242,null))['catch'](handleError(_0x39b242,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index c74d504..5bc0ad3 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 _0x8b8a=['moment','bluebird','../../config/environment','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x32cc7d,_0x2dee57){var _0x122b67=function(_0x4bc955){while(--_0x4bc955){_0x32cc7d['push'](_0x32cc7d['shift']());}};_0x122b67(++_0x2dee57);}(_0x8b8a,0x141));var _0xa8b8=function(_0x359b4a,_0x58c821){_0x359b4a=_0x359b4a-0x0;var _0x6d9198=_0x8b8a[_0x359b4a];return _0x6d9198;};'use strict';var _=require(_0xa8b8('0x0'));var util=require(_0xa8b8('0x1'));var logger=require(_0xa8b8('0x2'))('api');var moment=require(_0xa8b8('0x3'));var BPromise=require(_0xa8b8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa8b8('0x5'));var attributes=require('./chatApplication.attributes');module[_0xa8b8('0x6')]=function(_0x327764,_0x34b63e){return _0x327764[_0xa8b8('0x7')](_0xa8b8('0x8'),attributes,{'tableName':_0xa8b8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa8b8('0xa'),'collate':_0xa8b8('0xb')});}; \ No newline at end of file +var _0xb1d0=['moment','bluebird','path','../../config/environment','./chatApplication.attributes','define','utf8mb4_unicode_ci','lodash','util'];(function(_0x24ecfe,_0x3fe862){var _0x5a118a=function(_0x3db002){while(--_0x3db002){_0x24ecfe['push'](_0x24ecfe['shift']());}};_0x5a118a(++_0x3fe862);}(_0xb1d0,0x154));var _0x0b1d=function(_0x35b76f,_0x324c48){_0x35b76f=_0x35b76f-0x0;var _0x582906=_0xb1d0[_0x35b76f];return _0x582906;};'use strict';var _=require(_0x0b1d('0x0'));var util=require(_0x0b1d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0b1d('0x2'));var BPromise=require(_0x0b1d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0b1d('0x4'));var rimraf=require('rimraf');var config=require(_0x0b1d('0x5'));var attributes=require(_0x0b1d('0x6'));module['exports']=function(_0x3b610b,_0x29e623){return _0x3b610b[_0x0b1d('0x7')]('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0b1d('0x8')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 2148901..f2bfa55 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 _0x640e=['debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','info','ChatApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x640e,0x158));var _0xe640=function(_0x2df724,_0x411382){_0x2df724=_0x2df724-0x0;var _0x1b2504=_0x640e[_0x2df724];return _0x1b2504;};'use strict';var _=require(_0xe640('0x0'));var util=require('util');var moment=require(_0xe640('0x1'));var BPromise=require(_0xe640('0x2'));var rs=require(_0xe640('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe640('0x4'))['db'];var utils=require(_0xe640('0x5'));var logger=require(_0xe640('0x6'))(_0xe640('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe640('0x8')][_0xe640('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xdf54eb,_0x283867,_0x49bdd7){return new BPromise(function(_0x39abeb,_0x57b534){return client['request'](_0xdf54eb,_0x49bdd7)['then'](function(_0x3d389c){logger[_0xe640('0xa')](_0xe640('0xb'),_0x283867,_0xe640('0xc'));logger[_0xe640('0xd')](_0xe640('0xe'),_0x283867,_0xe640('0xc'),JSON[_0xe640('0xf')](_0x3d389c));if(_0x3d389c[_0xe640('0x10')]){if(_0x3d389c[_0xe640('0x10')][_0xe640('0x11')]===0x1f4){logger[_0xe640('0x10')](_0xe640('0xb'),_0x283867,_0x3d389c[_0xe640('0x10')]['message']);return _0x57b534(_0x3d389c[_0xe640('0x10')][_0xe640('0x12')]);}logger[_0xe640('0x10')](_0xe640('0xb'),_0x283867,_0x3d389c[_0xe640('0x10')]['message']);return _0x39abeb(_0x3d389c[_0xe640('0x10')]['message']);}else{logger[_0xe640('0xa')](_0xe640('0xb'),_0x283867,_0xe640('0xc'));_0x39abeb(_0x3d389c[_0xe640('0x13')]['message']);}})[_0xe640('0x14')](function(_0x1bc905){logger[_0xe640('0x10')](_0xe640('0xb'),_0x283867,_0x1bc905);_0x57b534(_0x1bc905);});});} \ No newline at end of file +var _0xaded=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatApplication,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','lodash','bluebird'];(function(_0x32a81f,_0x4eee66){var _0x5b67a2=function(_0x35d368){while(--_0x35d368){_0x32a81f['push'](_0x32a81f['shift']());}};_0x5b67a2(++_0x4eee66);}(_0xaded,0x178));var _0xdade=function(_0x3e7eee,_0xa8050f){_0x3e7eee=_0x3e7eee-0x0;var _0x34cce7=_0xaded[_0x3e7eee];return _0x34cce7;};'use strict';var _=require(_0xdade('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xdade('0x1'));var rs=require(_0xdade('0x2'));var fs=require('fs');var Redis=require(_0xdade('0x3'));var db=require(_0xdade('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xdade('0x5'))(_0xdade('0x6'));var config=require(_0xdade('0x7'));var jayson=require(_0xdade('0x8'));var client=jayson['client'][_0xdade('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ed265,_0x37dd87,_0x340e07){return new BPromise(function(_0x1e2656,_0x1b584e){return client[_0xdade('0xa')](_0x4ed265,_0x340e07)[_0xdade('0xb')](function(_0x10e70a){logger[_0xdade('0xc')](_0xdade('0xd'),_0x37dd87,'request\x20sent');logger[_0xdade('0xe')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x37dd87,_0xdade('0xf'),JSON[_0xdade('0x10')](_0x10e70a));if(_0x10e70a[_0xdade('0x11')]){if(_0x10e70a['error']['code']===0x1f4){logger[_0xdade('0x11')](_0xdade('0xd'),_0x37dd87,_0x10e70a[_0xdade('0x11')][_0xdade('0x12')]);return _0x1b584e(_0x10e70a[_0xdade('0x11')][_0xdade('0x12')]);}logger[_0xdade('0x11')](_0xdade('0xd'),_0x37dd87,_0x10e70a[_0xdade('0x11')][_0xdade('0x12')]);return _0x1e2656(_0x10e70a[_0xdade('0x11')][_0xdade('0x12')]);}else{logger[_0xdade('0xc')](_0xdade('0xd'),_0x37dd87,_0xdade('0xf'));_0x1e2656(_0x10e70a[_0xdade('0x13')][_0xdade('0x12')]);}})[_0xdade('0x14')](function(_0x2a9093){logger['error']('ChatApplication,\x20%s,\x20%s',_0x37dd87,_0x2a9093);_0x1b584e(_0x2a9093);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 255eb36..763949d 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 _0x12de=['exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','/:id','show','put','update','delete','isAuthenticated','destroy'];(function(_0x3d8aa5,_0x5ad768){var _0x1e2ad9=function(_0x5e5196){while(--_0x5e5196){_0x3d8aa5['push'](_0x3d8aa5['shift']());}};_0x1e2ad9(++_0x5ad768);}(_0x12de,0x71));var _0xe12d=function(_0x15782a,_0x2f4d6a){_0x15782a=_0x15782a-0x0;var _0x334d31=_0x12de[_0x15782a];return _0x334d31;};'use strict';var multer=require('multer');var util=require(_0xe12d('0x0'));var path=require(_0xe12d('0x1'));var timeout=require(_0xe12d('0x2'));var express=require(_0xe12d('0x3'));var router=express['Router']();var auth=require(_0xe12d('0x4'));var interaction=require(_0xe12d('0x5'));var config=require('../../config/environment');var controller=require('./chatApplication.controller');router['get'](_0xe12d('0x6'),auth['isAuthenticated'](),controller[_0xe12d('0x7')]);router[_0xe12d('0x8')](_0xe12d('0x6'),auth['isAuthenticated'](),controller[_0xe12d('0x9')]);router[_0xe12d('0xa')](_0xe12d('0x6'),auth[_0xe12d('0xb')](),controller[_0xe12d('0xc')]);module[_0xe12d('0xd')]=router; \ No newline at end of file +var _0x9f7c=['delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./chatApplication.controller','get','isAuthenticated','show','put','/:id','update'];(function(_0x1f6a0f,_0x75bef2){var _0x1de297=function(_0x3c5675){while(--_0x3c5675){_0x1f6a0f['push'](_0x1f6a0f['shift']());}};_0x1de297(++_0x75bef2);}(_0x9f7c,0xf3));var _0xc9f7=function(_0x1f7f08,_0x1ffea5){_0x1f7f08=_0x1f7f08-0x0;var _0x15aa9a=_0x9f7c[_0x1f7f08];return _0x15aa9a;};'use strict';var multer=require(_0xc9f7('0x0'));var util=require('util');var path=require(_0xc9f7('0x1'));var timeout=require(_0xc9f7('0x2'));var express=require(_0xc9f7('0x3'));var router=express['Router']();var auth=require(_0xc9f7('0x4'));var interaction=require(_0xc9f7('0x5'));var config=require('../../config/environment');var controller=require(_0xc9f7('0x6'));router[_0xc9f7('0x7')]('/:id',auth[_0xc9f7('0x8')](),controller[_0xc9f7('0x9')]);router[_0xc9f7('0xa')](_0xc9f7('0xb'),auth[_0xc9f7('0x8')](),controller[_0xc9f7('0xc')]);router[_0xc9f7('0xd')]('/:id',auth[_0xc9f7('0x8')](),controller[_0xc9f7('0xe')]);module[_0xc9f7('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index bfed701..e1bae28 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 _0xf74c=['sequelize','exports','STRING'];(function(_0x967959,_0x53c5c1){var _0x5c4489=function(_0x1ae5c6){while(--_0x1ae5c6){_0x967959['push'](_0x967959['shift']());}};_0x5c4489(++_0x53c5c1);}(_0xf74c,0x129));var _0xcf74=function(_0x57246b,_0xb199cf){_0x57246b=_0x57246b-0x0;var _0xb0790e=_0xf74c[_0x57246b];return _0xb0790e;};'use strict';var Sequelize=require(_0xcf74('0x0'));module[_0xcf74('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xcf74('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x96b4=['STRING'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0x96b4,0xcf));var _0x496b=function(_0x54b868,_0x1036ff){_0x54b868=_0x54b868-0x0;var _0x2807bc=_0x96b4[_0x54b868];return _0x2807bc;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x496b('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x496b('0x0')]},'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 c270a10..7a68b91 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 _0x7341=['create','body','find','describe','ChatInternalMessage','user','toInteger','addMembers','ids','getMembers','findOne','User','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.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','debug','request\x20sent','stringify','error','message','ChatGroup,\x20%s,\x20%s','info','catch','sendStatus','end','status','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','ChatGroup','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','map','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x7341,0xe4));var _0x1734=function(_0x2be78f,_0x3e5035){_0x2be78f=_0x2be78f-0x0;var _0x1faa18=_0x7341[_0x2be78f];return _0x1faa18;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x1734('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1734('0x1'));var rp=require(_0x1734('0x2'));var moment=require('moment');var BPromise=require(_0x1734('0x3'));var Mustache=require(_0x1734('0x4'));var util=require(_0x1734('0x5'));var path=require(_0x1734('0x6'));var sox=require(_0x1734('0x7'));var csv=require(_0x1734('0x8'));var ejs=require(_0x1734('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1734('0xa'));var crypto=require(_0x1734('0xb'));var jsforce=require(_0x1734('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1734('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1734('0xd'));var authService=require(_0x1734('0xe'));var qs=require(_0x1734('0xf'));var hardwareService=require(_0x1734('0x10'));var logger=require(_0x1734('0x11'))(_0x1734('0x12'));var utils=require(_0x1734('0x13'));var config=require(_0x1734('0x14'));var db=require(_0x1734('0x15'))['db'];config[_0x1734('0x16')]=_['defaults'](config[_0x1734('0x16')],{'host':_0x1734('0x17'),'port':0x18eb});var socket=require(_0x1734('0x18'))(new Redis(config[_0x1734('0x16')]));require(_0x1734('0x19'))[_0x1734('0x1a')](socket);var jayson=require(_0x1734('0x1b'));var client=jayson[_0x1734('0x1c')][_0x1734('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x469b4f,_0x444527,_0x27679e){if(_0x27679e){var _0x2162c9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2162c9[_0x1734('0x1e')](_0x444527)){return _0x469b4f;}else{throw new Error(_0x1734('0x1f'));}}else{return _0x469b4f;}}function respondWithRpcPromise(_0x24bbf3,_0x2b375d,_0x1ea188,_0x414b7c){return new BPromise(function(_0x56756c,_0x5ab895){var _0x1fa9c0=_0x414b7c||client;return _0x1fa9c0[_0x1734('0x20')](_0x24bbf3,_0x1ea188)['then'](function(_0x212e63){logger['info']('ChatGroup,\x20%s,\x20%s',_0x2b375d,'request\x20sent');logger[_0x1734('0x21')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x2b375d,_0x1734('0x22'),JSON[_0x1734('0x23')](_0x212e63));if(_0x212e63['error']){if(_0x212e63['error']['code']===0x1f4){logger[_0x1734('0x24')]('ChatGroup,\x20%s,\x20%s',_0x2b375d,_0x212e63[_0x1734('0x24')]['message']);return _0x5ab895(_0x212e63[_0x1734('0x24')][_0x1734('0x25')]);}logger[_0x1734('0x24')](_0x1734('0x26'),_0x2b375d,_0x212e63[_0x1734('0x24')][_0x1734('0x25')]);return _0x56756c(_0x212e63[_0x1734('0x24')][_0x1734('0x25')]);}else{logger[_0x1734('0x27')]('ChatGroup,\x20%s,\x20%s',_0x2b375d,_0x1734('0x22'));_0x56756c(_0x212e63['result']['message']);}})[_0x1734('0x28')](function(_0x46b2fa){logger[_0x1734('0x24')](_0x1734('0x26'),_0x2b375d,_0x46b2fa);_0x5ab895(_0x46b2fa);});});}function respondWithStatusCode(_0x4435ac,_0x2a95e3){_0x2a95e3=_0x2a95e3||0xcc;return function(_0x3616c1){if(_0x3616c1){return _0x4435ac[_0x1734('0x29')](_0x2a95e3);}return _0x4435ac['status'](_0x2a95e3)[_0x1734('0x2a')]();};}function respondWithResult(_0x52eaf5,_0x17e068){_0x17e068=_0x17e068||0xc8;return function(_0x16a35f){if(_0x16a35f){return _0x52eaf5[_0x1734('0x2b')](_0x17e068)['json'](_0x16a35f);}};}function respondWithFilteredResult(_0x3eb31b,_0x3f9abe){return function(_0xf2d136){if(_0xf2d136){var _0x50efce=_0xf2d136[_0x1734('0x2c')],_0x2b1352=_0x3f9abe[_0x1734('0x2d')],_0xb5e574=_0x3f9abe[_0x1734('0x2d')]+_0x3f9abe[_0x1734('0x2e')],_0x5594c0;if(_0xb5e574>=_0x50efce){_0xb5e574=_0x50efce;_0x5594c0=0xc8;}else{_0x5594c0=0xce;}_0x3eb31b['status'](_0x5594c0);return _0x3eb31b[_0x1734('0x2f')](_0x1734('0x30'),_0x2b1352+'-'+_0xb5e574+'/'+_0x50efce)['json'](_0xf2d136);}return null;};}function patchUpdates(_0x4dd04a){return function(_0x321718){try{jsonpatch[_0x1734('0x31')](_0x321718,_0x4dd04a,!![]);}catch(_0x1b83b8){return BPromise[_0x1734('0x32')](_0x1b83b8);}return _0x321718[_0x1734('0x33')]();};}function saveUpdates(_0xe7d077,_0x3ba024){return function(_0x423299){if(_0x423299){return _0x423299[_0x1734('0x34')](_0xe7d077)[_0x1734('0x35')](function(_0x224869){return _0x224869;});}return null;};}function removeEntity(_0x29fb7b,_0x18a0c7){return function(_0x2982ed){if(_0x2982ed){return _0x2982ed[_0x1734('0x36')]()[_0x1734('0x35')](function(){_0x29fb7b[_0x1734('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e7134,_0x4ab5b2){return function(_0xc618e5){if(!_0xc618e5){_0x1e7134[_0x1734('0x29')](0x194);}return _0xc618e5;};}function handleError(_0x1f8446,_0x21a855){_0x21a855=_0x21a855||0x1f4;return function(_0x42df6b){logger[_0x1734('0x24')](_0x42df6b[_0x1734('0x37')]);if(_0x42df6b[_0x1734('0x38')]){delete _0x42df6b['name'];}_0x1f8446[_0x1734('0x2b')](_0x21a855)[_0x1734('0x39')](_0x42df6b);};}exports[_0x1734('0x3a')]=function(_0x16d081,_0x30817d){var _0x1b7caa={},_0x26072f={},_0x4db10d={'count':0x0,'rows':[]};var _0x1f67b4=db[_0x1734('0x3b')][_0x1734('0x3c')];_0x26072f[_0x1734('0x3d')]=_[_0x1734('0x3e')](_0x1f67b4);_0x26072f[_0x1734('0x3f')]=_[_0x1734('0x3e')](_0x16d081[_0x1734('0x3f')]);_0x26072f['filters']=_[_0x1734('0x40')](_0x26072f['model'],_0x26072f[_0x1734('0x3f')]);_0x1b7caa[_0x1734('0x41')]=_[_0x1734('0x40')](_0x26072f[_0x1734('0x3d')],qs[_0x1734('0x42')](_0x16d081[_0x1734('0x3f')][_0x1734('0x42')]));_0x1b7caa[_0x1734('0x41')]=_0x1b7caa[_0x1734('0x41')][_0x1734('0x43')]?_0x1b7caa[_0x1734('0x41')]:_0x26072f['model'];if(!_0x16d081[_0x1734('0x3f')][_0x1734('0x44')](_0x1734('0x45'))){_0x1b7caa[_0x1734('0x2e')]=qs['limit'](_0x16d081[_0x1734('0x3f')]['limit']);_0x1b7caa['offset']=qs[_0x1734('0x2d')](_0x16d081[_0x1734('0x3f')][_0x1734('0x2d')]);}_0x1b7caa[_0x1734('0x46')]=qs['sort'](_0x16d081[_0x1734('0x3f')][_0x1734('0x47')]);_0x1b7caa['where']=qs[_0x1734('0x48')](_[_0x1734('0x49')](_0x16d081['query'],_0x26072f[_0x1734('0x48')]));if(_0x16d081['query'][_0x1734('0x4a')]){_0x1b7caa[_0x1734('0x4b')]=_[_0x1734('0x4c')](_0x1b7caa[_0x1734('0x4b')],{'$or':_[_0x1734('0x4d')](_0x1f67b4,function(_0x34cec3){if(_0x34cec3[_0x1734('0x4e')]['key']!==_0x1734('0x4f')){var _0xbf1023={};_0xbf1023[_0x34cec3['field']]={'$like':'%'+_0x16d081[_0x1734('0x3f')][_0x1734('0x4a')]+'%'};return _0xbf1023;}})});}_0x1b7caa=_[_0x1734('0x4c')]({},_0x1b7caa,_0x16d081[_0x1734('0x50')]);var _0x57bf4b={'where':_0x1b7caa[_0x1734('0x4b')]};return db[_0x1734('0x3b')][_0x1734('0x2c')](_0x57bf4b)['then'](function(_0x2526e1){_0x4db10d[_0x1734('0x2c')]=_0x2526e1;if(_0x16d081[_0x1734('0x3f')][_0x1734('0x51')]){_0x1b7caa[_0x1734('0x52')]=[{'all':!![]}];}return db[_0x1734('0x3b')][_0x1734('0x53')](_0x1b7caa);})[_0x1734('0x35')](function(_0x32a39d){_0x4db10d[_0x1734('0x54')]=_0x32a39d;return _0x4db10d;})[_0x1734('0x35')](respondWithFilteredResult(_0x30817d,_0x1b7caa))[_0x1734('0x28')](handleError(_0x30817d,null));};exports[_0x1734('0x55')]=function(_0x9a7607,_0x470110){var _0x121c8c={'raw':!![],'where':{'id':_0x9a7607[_0x1734('0x56')]['id']}},_0x255b75={};_0x255b75['model']=_[_0x1734('0x3e')](db['ChatGroup'][_0x1734('0x3c')]);_0x255b75[_0x1734('0x3f')]=_[_0x1734('0x3e')](_0x9a7607[_0x1734('0x3f')]);_0x255b75['filters']=_['intersection'](_0x255b75[_0x1734('0x3d')],_0x255b75[_0x1734('0x3f')]);_0x121c8c['attributes']=_[_0x1734('0x40')](_0x255b75[_0x1734('0x3d')],qs[_0x1734('0x42')](_0x9a7607[_0x1734('0x3f')][_0x1734('0x42')]));_0x121c8c[_0x1734('0x41')]=_0x121c8c[_0x1734('0x41')]['length']?_0x121c8c[_0x1734('0x41')]:_0x255b75[_0x1734('0x3d')];if(_0x9a7607[_0x1734('0x3f')]['includeAll']){_0x121c8c[_0x1734('0x52')]=[{'all':!![]}];}_0x121c8c=_[_0x1734('0x4c')]({},_0x121c8c,_0x9a7607[_0x1734('0x50')]);return db[_0x1734('0x3b')]['find'](_0x121c8c)[_0x1734('0x35')](handleEntityNotFound(_0x470110,null))[_0x1734('0x35')](respondWithResult(_0x470110,null))[_0x1734('0x28')](handleError(_0x470110,null));};exports[_0x1734('0x57')]=function(_0x33b805,_0x529b8a){return db[_0x1734('0x3b')]['create'](_0x33b805['body'],{})[_0x1734('0x35')](respondWithResult(_0x529b8a,0xc9))[_0x1734('0x28')](handleError(_0x529b8a,null));};exports['update']=function(_0x4ff6a9,_0x36492b){if(_0x4ff6a9[_0x1734('0x58')]['id']){delete _0x4ff6a9['body']['id'];}return db['ChatGroup']['find']({'where':{'id':_0x4ff6a9[_0x1734('0x56')]['id']}})[_0x1734('0x35')](handleEntityNotFound(_0x36492b,null))[_0x1734('0x35')](saveUpdates(_0x4ff6a9[_0x1734('0x58')],null))['then'](respondWithResult(_0x36492b,null))['catch'](handleError(_0x36492b,null));};exports[_0x1734('0x36')]=function(_0x7872f5,_0x50bf35){return db[_0x1734('0x3b')][_0x1734('0x59')]({'where':{'id':_0x7872f5[_0x1734('0x56')]['id']}})['then'](handleEntityNotFound(_0x50bf35,null))[_0x1734('0x35')](removeEntity(_0x50bf35,null))[_0x1734('0x28')](handleError(_0x50bf35,null));};exports[_0x1734('0x5a')]=function(_0x46afc1,_0x20a1fc){return db[_0x1734('0x3b')][_0x1734('0x5a')]()[_0x1734('0x35')](respondWithResult(_0x20a1fc,null))[_0x1734('0x28')](handleError(_0x20a1fc,null));};exports['getUnread']=function(_0x1a8fe4,_0x25f886,_0x16bea9){return db[_0x1734('0x5b')][_0x1734('0x2c')]({'where':{'ChatGroupId':_0x1a8fe4[_0x1734('0x56')]['id'],'ToId':_0x1a8fe4[_0x1734('0x5c')]['id'],'read':![]}})[_0x1734('0x35')](function(_0x1c830a){return{'id':_[_0x1734('0x5d')](_0x1a8fe4[_0x1734('0x56')]['id']),'count':_0x1c830a};})['then'](respondWithResult(_0x25f886,null))[_0x1734('0x28')](handleError(_0x25f886,null));};exports[_0x1734('0x5e')]=function(_0x1de563,_0x1e646d,_0x112265){return db[_0x1734('0x3b')][_0x1734('0x59')]({'where':{'id':_0x1de563['params']['id']}})[_0x1734('0x35')](handleEntityNotFound(_0x1e646d,null))['then'](function(_0x30fb01){if(_0x30fb01){return _0x30fb01[_0x1734('0x5e')](_0x1de563[_0x1734('0x58')][_0x1734('0x5f')],_['omit'](_0x1de563['body'],[_0x1734('0x5f'),'id'])||{});}})['then'](respondWithResult(_0x1e646d,null))[_0x1734('0x28')](handleError(_0x1e646d,null));};exports[_0x1734('0x60')]=function(_0x1590ab,_0x3ce57f,_0x532c6a){var _0x586418={};var _0x52e5e2={};var _0x4923f8;var _0x314023;return db[_0x1734('0x3b')][_0x1734('0x61')]({'where':{'id':_0x1590ab[_0x1734('0x56')]['id']}})[_0x1734('0x35')](handleEntityNotFound(_0x3ce57f,null))[_0x1734('0x35')](function(_0x2d3a75){if(_0x2d3a75){_0x4923f8=_0x2d3a75;_0x52e5e2['model']=_[_0x1734('0x3e')](db[_0x1734('0x62')]['rawAttributes']);_0x52e5e2[_0x1734('0x3f')]=_[_0x1734('0x3e')](_0x1590ab[_0x1734('0x3f')]);_0x52e5e2['filters']=_[_0x1734('0x40')](_0x52e5e2[_0x1734('0x3d')],_0x52e5e2['query']);_0x586418[_0x1734('0x41')]=_[_0x1734('0x40')](_0x52e5e2[_0x1734('0x3d')],qs[_0x1734('0x42')](_0x1590ab[_0x1734('0x3f')]['fields']));_0x586418['attributes']=_0x586418['attributes']['length']?_0x586418[_0x1734('0x41')]:_0x52e5e2['model'];_0x586418[_0x1734('0x46')]=qs[_0x1734('0x47')](_0x1590ab[_0x1734('0x3f')][_0x1734('0x47')]);_0x586418[_0x1734('0x4b')]=qs[_0x1734('0x48')](_[_0x1734('0x49')](_0x1590ab[_0x1734('0x3f')],_0x52e5e2['filters']));if(_0x1590ab[_0x1734('0x3f')]['filter']){_0x586418[_0x1734('0x4b')]=_[_0x1734('0x4c')](_0x586418['where'],{'$or':_[_0x1734('0x4d')](_0x586418[_0x1734('0x41')],function(_0x5cf3be){var _0x4b7344={};_0x4b7344[_0x5cf3be]={'$like':'%'+_0x1590ab[_0x1734('0x3f')][_0x1734('0x4a')]+'%'};return _0x4b7344;})});}_0x586418=_[_0x1734('0x4c')]({},_0x586418,_0x1590ab[_0x1734('0x50')]);return _0x4923f8['getMembers'](_0x586418);}})[_0x1734('0x35')](function(_0x48d011){if(_0x48d011){_0x314023=_0x48d011[_0x1734('0x43')];if(!_0x1590ab[_0x1734('0x3f')]['hasOwnProperty']('nolimit')){_0x586418[_0x1734('0x2e')]=qs[_0x1734('0x2e')](_0x1590ab[_0x1734('0x3f')][_0x1734('0x2e')]);_0x586418[_0x1734('0x2d')]=qs[_0x1734('0x2d')](_0x1590ab['query'][_0x1734('0x2d')]);}return _0x4923f8['getMembers'](_0x586418);}})['then'](function(_0x3f4afb){if(_0x3f4afb){return _0x3f4afb?{'count':_0x314023,'rows':_0x3f4afb}:null;}})[_0x1734('0x35')](respondWithResult(_0x3ce57f,null))[_0x1734('0x28')](handleError(_0x3ce57f,null));};exports[_0x1734('0x63')]=function(_0x2830eb,_0x5b03c5,_0x267098){return db[_0x1734('0x3b')][_0x1734('0x59')]({'where':{'id':_0x2830eb[_0x1734('0x56')]['id']}})[_0x1734('0x35')](handleEntityNotFound(_0x5b03c5,null))[_0x1734('0x35')](function(_0x4817cc){if(_0x4817cc){return _0x4817cc[_0x1734('0x63')](_0x2830eb['query'][_0x1734('0x5f')]);}})[_0x1734('0x35')](respondWithStatusCode(_0x5b03c5,null))[_0x1734('0x28')](handleError(_0x5b03c5,null));};exports[_0x1734('0x64')]=function(_0x42283c,_0x56610b,_0x47bc32){if(_0x42283c['body']['id']){delete _0x42283c[_0x1734('0x58')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x42283c[_0x1734('0x56')]['id']}})[_0x1734('0x35')](handleEntityNotFound(_0x56610b,null))[_0x1734('0x35')](function(_0x510258){if(_0x510258){_0x42283c['body'][_0x1734('0x65')]=_0x510258['id'];return db['ChatInternalMessage']['create'](_0x42283c[_0x1734('0x58')]);}})[_0x1734('0x35')](respondWithResult(_0x56610b,null))[_0x1734('0x28')](handleError(_0x56610b,null));};exports[_0x1734('0x66')]=function(_0x57f3de,_0x2b4c49,_0x4a88ee){var _0x2f8098={};var _0x586c4a={};var _0x3313d2;var _0x10b29d;return db[_0x1734('0x3b')][_0x1734('0x61')]({'where':{'id':_0x57f3de[_0x1734('0x56')]['id']}})['then'](handleEntityNotFound(_0x2b4c49,null))['then'](function(_0x11a185){if(_0x11a185){_0x3313d2=_0x11a185;_0x586c4a[_0x1734('0x3d')]=_[_0x1734('0x3e')](db[_0x1734('0x5b')][_0x1734('0x3c')]);_0x586c4a[_0x1734('0x3f')]=_[_0x1734('0x3e')](_0x57f3de[_0x1734('0x3f')]);_0x586c4a['filters']=_[_0x1734('0x40')](_0x586c4a[_0x1734('0x3d')],_0x586c4a['query']);_0x2f8098['attributes']=_[_0x1734('0x40')](_0x586c4a[_0x1734('0x3d')],qs[_0x1734('0x42')](_0x57f3de[_0x1734('0x3f')][_0x1734('0x42')]));_0x2f8098[_0x1734('0x41')]=_0x2f8098[_0x1734('0x41')][_0x1734('0x43')]?_0x2f8098[_0x1734('0x41')]:_0x586c4a[_0x1734('0x3d')];_0x2f8098[_0x1734('0x46')]=qs[_0x1734('0x47')](_0x57f3de[_0x1734('0x3f')][_0x1734('0x47')]);_0x2f8098[_0x1734('0x4b')]=qs[_0x1734('0x48')](_['pick'](_0x57f3de[_0x1734('0x3f')],_0x586c4a[_0x1734('0x48')]));if(_0x57f3de[_0x1734('0x3f')][_0x1734('0x4a')]){_0x2f8098[_0x1734('0x4b')]=_[_0x1734('0x4c')](_0x2f8098[_0x1734('0x4b')],{'$or':_[_0x1734('0x4d')](_0x2f8098[_0x1734('0x41')],function(_0x19ab7b){var _0x56e6e1={};_0x56e6e1[_0x19ab7b]={'$like':'%'+_0x57f3de[_0x1734('0x3f')][_0x1734('0x4a')]+'%'};return _0x56e6e1;})});}if(_0x57f3de[_0x1734('0x3f')][_0x1734('0x67')]){var _0xd53898=_0x57f3de['query'][_0x1734('0x67')][_0x1734('0x68')](',');var _0x4ee541={};_0x4ee541[_0xd53898[0x0]]={'$gte':moment(_0xd53898[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x2f8098[_0x1734('0x4b')]=_[_0x1734('0x4c')](_0x2f8098[_0x1734('0x4b')],_0x4ee541);}_0x2f8098=_['merge']({},_0x2f8098,_0x57f3de['options']);return _0x3313d2[_0x1734('0x66')](_0x2f8098);}})['then'](function(_0x154f4d){if(_0x154f4d){_0x10b29d=_0x154f4d[_0x1734('0x43')];if(!_0x57f3de['query'][_0x1734('0x44')](_0x1734('0x45'))){_0x2f8098[_0x1734('0x2e')]=qs[_0x1734('0x2e')](_0x57f3de[_0x1734('0x3f')][_0x1734('0x2e')]);_0x2f8098[_0x1734('0x2d')]=qs['offset'](_0x57f3de[_0x1734('0x3f')][_0x1734('0x2d')]);}return _0x3313d2[_0x1734('0x66')](_0x2f8098);}})[_0x1734('0x35')](function(_0x2cac74){if(_0x2cac74){return _0x2cac74?{'count':_0x10b29d,'rows':_0x2cac74}:null;}})[_0x1734('0x35')](respondWithResult(_0x2b4c49,null))['catch'](handleError(_0x2b4c49,null));}; \ No newline at end of file +var _0x851c=['redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','jayson/promise','client','http','test','request','then','info','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','json','limit','set','apply','reject','save','update','destroy','stack','name','send','index','ChatGroup','rawAttributes','model','keys','query','filters','attributes','fields','length','nolimit','offset','sort','where','pick','filter','merge','map','key','field','options','count','includeAll','include','findAll','catch','show','params','intersection','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','hasOwnProperty','removeMembers','ChatGroupId','order','$gte','YYYY-MM-DD\x20HH:mm:ss','getMessages','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb'];(function(_0x15663e,_0xd622d7){var _0x865447=function(_0x399087){while(--_0x399087){_0x15663e['push'](_0x15663e['shift']());}};_0x865447(++_0xd622d7);}(_0x851c,0x19d));var _0xc851=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x851c[_0x3bf83f];return _0x22c4a9;};'use strict';var pdf=require(_0xc851('0x0'));var emlformat=require(_0xc851('0x1'));var rimraf=require(_0xc851('0x2'));var zipdir=require(_0xc851('0x3'));var jsonpatch=require(_0xc851('0x4'));var rp=require(_0xc851('0x5'));var moment=require(_0xc851('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xc851('0x7'));var util=require(_0xc851('0x8'));var path=require('path');var sox=require(_0xc851('0x9'));var csv=require(_0xc851('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc851('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc851('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc851('0xd'));var Papa=require(_0xc851('0xe'));var Redis=require(_0xc851('0xf'));var authService=require(_0xc851('0x10'));var qs=require(_0xc851('0x11'));var hardwareService=require(_0xc851('0x12'));var logger=require(_0xc851('0x13'))(_0xc851('0x14'));var utils=require('../../config/utils');var config=require(_0xc851('0x15'));var db=require(_0xc851('0x16'))['db'];config[_0xc851('0x17')]=_[_0xc851('0x18')](config[_0xc851('0x17')],{'host':_0xc851('0x19'),'port':0x18eb});var socket=require(_0xc851('0x1a'))(new Redis(config[_0xc851('0x17')]));require(_0xc851('0x1b'))[_0xc851('0x1c')](socket);var jayson=require(_0xc851('0x1d'));var client=jayson[_0xc851('0x1e')][_0xc851('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x445d9b,_0x42cae5,_0x458951){if(_0x458951){var _0x5e67ee=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5e67ee[_0xc851('0x20')](_0x42cae5)){return _0x445d9b;}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 _0x445d9b;}}function respondWithRpcPromise(_0x2b4839,_0x5178ca,_0x110261,_0x25a49c){return new BPromise(function(_0x2235b9,_0x251e23){var _0xc06f5=_0x25a49c||client;return _0xc06f5[_0xc851('0x21')](_0x2b4839,_0x110261)[_0xc851('0x22')](function(_0x4a2d90){logger[_0xc851('0x23')](_0xc851('0x24'),_0x5178ca,'request\x20sent');logger[_0xc851('0x25')](_0xc851('0x26'),_0x5178ca,_0xc851('0x27'),JSON[_0xc851('0x28')](_0x4a2d90));if(_0x4a2d90['error']){if(_0x4a2d90[_0xc851('0x29')][_0xc851('0x2a')]===0x1f4){logger[_0xc851('0x29')](_0xc851('0x24'),_0x5178ca,_0x4a2d90[_0xc851('0x29')]['message']);return _0x251e23(_0x4a2d90['error'][_0xc851('0x2b')]);}logger[_0xc851('0x29')](_0xc851('0x24'),_0x5178ca,_0x4a2d90[_0xc851('0x29')][_0xc851('0x2b')]);return _0x2235b9(_0x4a2d90[_0xc851('0x29')]['message']);}else{logger[_0xc851('0x23')]('ChatGroup,\x20%s,\x20%s',_0x5178ca,'request\x20sent');_0x2235b9(_0x4a2d90[_0xc851('0x2c')][_0xc851('0x2b')]);}})['catch'](function(_0x16b3c4){logger[_0xc851('0x29')](_0xc851('0x24'),_0x5178ca,_0x16b3c4);_0x251e23(_0x16b3c4);});});}function respondWithStatusCode(_0x48afe7,_0x2c6d43){_0x2c6d43=_0x2c6d43||0xcc;return function(_0x4407a6){if(_0x4407a6){return _0x48afe7[_0xc851('0x2d')](_0x2c6d43);}return _0x48afe7[_0xc851('0x2e')](_0x2c6d43)[_0xc851('0x2f')]();};}function respondWithResult(_0x2fc8f1,_0x3ebd7b){_0x3ebd7b=_0x3ebd7b||0xc8;return function(_0x3d20eb){if(_0x3d20eb){return _0x2fc8f1[_0xc851('0x2e')](_0x3ebd7b)[_0xc851('0x30')](_0x3d20eb);}};}function respondWithFilteredResult(_0x279a40,_0x13a826){return function(_0x5570c0){if(_0x5570c0){var _0x2989b9=_0x5570c0['count'],_0x170e54=_0x13a826['offset'],_0x478ccf=_0x13a826['offset']+_0x13a826[_0xc851('0x31')],_0x1e35d6;if(_0x478ccf>=_0x2989b9){_0x478ccf=_0x2989b9;_0x1e35d6=0xc8;}else{_0x1e35d6=0xce;}_0x279a40['status'](_0x1e35d6);return _0x279a40[_0xc851('0x32')]('Content-Range',_0x170e54+'-'+_0x478ccf+'/'+_0x2989b9)[_0xc851('0x30')](_0x5570c0);}return null;};}function patchUpdates(_0xe5c563){return function(_0x11d4a7){try{jsonpatch[_0xc851('0x33')](_0x11d4a7,_0xe5c563,!![]);}catch(_0x3eb4b3){return BPromise[_0xc851('0x34')](_0x3eb4b3);}return _0x11d4a7[_0xc851('0x35')]();};}function saveUpdates(_0x2848e6,_0x3da3b8){return function(_0x1c6b64){if(_0x1c6b64){return _0x1c6b64[_0xc851('0x36')](_0x2848e6)['then'](function(_0x2e69a7){return _0x2e69a7;});}return null;};}function removeEntity(_0x530806,_0xcf908){return function(_0x10042c){if(_0x10042c){return _0x10042c[_0xc851('0x37')]()[_0xc851('0x22')](function(){_0x530806[_0xc851('0x2e')](0xcc)[_0xc851('0x2f')]();});}};}function handleEntityNotFound(_0x7bc799,_0x4d4531){return function(_0x506d2a){if(!_0x506d2a){_0x7bc799[_0xc851('0x2d')](0x194);}return _0x506d2a;};}function handleError(_0x477bab,_0x533fc4){_0x533fc4=_0x533fc4||0x1f4;return function(_0x53bd59){logger[_0xc851('0x29')](_0x53bd59[_0xc851('0x38')]);if(_0x53bd59[_0xc851('0x39')]){delete _0x53bd59['name'];}_0x477bab[_0xc851('0x2e')](_0x533fc4)[_0xc851('0x3a')](_0x53bd59);};}exports[_0xc851('0x3b')]=function(_0x33a1e0,_0x28a98e){var _0x35fce0={},_0xb3fe3={},_0x4b02b5={'count':0x0,'rows':[]};var _0x13b722=db[_0xc851('0x3c')][_0xc851('0x3d')];_0xb3fe3[_0xc851('0x3e')]=_[_0xc851('0x3f')](_0x13b722);_0xb3fe3['query']=_[_0xc851('0x3f')](_0x33a1e0[_0xc851('0x40')]);_0xb3fe3[_0xc851('0x41')]=_['intersection'](_0xb3fe3[_0xc851('0x3e')],_0xb3fe3['query']);_0x35fce0[_0xc851('0x42')]=_['intersection'](_0xb3fe3[_0xc851('0x3e')],qs['fields'](_0x33a1e0[_0xc851('0x40')][_0xc851('0x43')]));_0x35fce0[_0xc851('0x42')]=_0x35fce0['attributes'][_0xc851('0x44')]?_0x35fce0[_0xc851('0x42')]:_0xb3fe3[_0xc851('0x3e')];if(!_0x33a1e0[_0xc851('0x40')]['hasOwnProperty'](_0xc851('0x45'))){_0x35fce0[_0xc851('0x31')]=qs[_0xc851('0x31')](_0x33a1e0['query']['limit']);_0x35fce0[_0xc851('0x46')]=qs['offset'](_0x33a1e0['query']['offset']);}_0x35fce0['order']=qs[_0xc851('0x47')](_0x33a1e0[_0xc851('0x40')][_0xc851('0x47')]);_0x35fce0[_0xc851('0x48')]=qs[_0xc851('0x41')](_[_0xc851('0x49')](_0x33a1e0[_0xc851('0x40')],_0xb3fe3[_0xc851('0x41')]));if(_0x33a1e0[_0xc851('0x40')][_0xc851('0x4a')]){_0x35fce0[_0xc851('0x48')]=_[_0xc851('0x4b')](_0x35fce0[_0xc851('0x48')],{'$or':_[_0xc851('0x4c')](_0x13b722,function(_0x5041fb){if(_0x5041fb['type'][_0xc851('0x4d')]!=='VIRTUAL'){var _0x591460={};_0x591460[_0x5041fb[_0xc851('0x4e')]]={'$like':'%'+_0x33a1e0[_0xc851('0x40')]['filter']+'%'};return _0x591460;}})});}_0x35fce0=_['merge']({},_0x35fce0,_0x33a1e0[_0xc851('0x4f')]);var _0x19a9b4={'where':_0x35fce0['where']};return db[_0xc851('0x3c')][_0xc851('0x50')](_0x19a9b4)['then'](function(_0x2d364f){_0x4b02b5[_0xc851('0x50')]=_0x2d364f;if(_0x33a1e0[_0xc851('0x40')][_0xc851('0x51')]){_0x35fce0[_0xc851('0x52')]=[{'all':!![]}];}return db['ChatGroup'][_0xc851('0x53')](_0x35fce0);})[_0xc851('0x22')](function(_0x2782ac){_0x4b02b5['rows']=_0x2782ac;return _0x4b02b5;})[_0xc851('0x22')](respondWithFilteredResult(_0x28a98e,_0x35fce0))[_0xc851('0x54')](handleError(_0x28a98e,null));};exports[_0xc851('0x55')]=function(_0x5e8e40,_0x53c81f){var _0x1fcc0a={'raw':!![],'where':{'id':_0x5e8e40[_0xc851('0x56')]['id']}},_0x1392b7={};_0x1392b7['model']=_[_0xc851('0x3f')](db['ChatGroup'][_0xc851('0x3d')]);_0x1392b7[_0xc851('0x40')]=_[_0xc851('0x3f')](_0x5e8e40[_0xc851('0x40')]);_0x1392b7[_0xc851('0x41')]=_[_0xc851('0x57')](_0x1392b7[_0xc851('0x3e')],_0x1392b7[_0xc851('0x40')]);_0x1fcc0a['attributes']=_[_0xc851('0x57')](_0x1392b7[_0xc851('0x3e')],qs['fields'](_0x5e8e40[_0xc851('0x40')][_0xc851('0x43')]));_0x1fcc0a[_0xc851('0x42')]=_0x1fcc0a[_0xc851('0x42')]['length']?_0x1fcc0a['attributes']:_0x1392b7[_0xc851('0x3e')];if(_0x5e8e40['query'][_0xc851('0x51')]){_0x1fcc0a['include']=[{'all':!![]}];}_0x1fcc0a=_[_0xc851('0x4b')]({},_0x1fcc0a,_0x5e8e40[_0xc851('0x4f')]);return db[_0xc851('0x3c')][_0xc851('0x58')](_0x1fcc0a)[_0xc851('0x22')](handleEntityNotFound(_0x53c81f,null))['then'](respondWithResult(_0x53c81f,null))[_0xc851('0x54')](handleError(_0x53c81f,null));};exports['create']=function(_0x2b14a8,_0x4bcafd){return db[_0xc851('0x3c')][_0xc851('0x59')](_0x2b14a8[_0xc851('0x5a')],{})[_0xc851('0x22')](respondWithResult(_0x4bcafd,0xc9))[_0xc851('0x54')](handleError(_0x4bcafd,null));};exports['update']=function(_0x3378da,_0x2c58be){if(_0x3378da[_0xc851('0x5a')]['id']){delete _0x3378da[_0xc851('0x5a')]['id'];}return db[_0xc851('0x3c')][_0xc851('0x58')]({'where':{'id':_0x3378da[_0xc851('0x56')]['id']}})[_0xc851('0x22')](handleEntityNotFound(_0x2c58be,null))[_0xc851('0x22')](saveUpdates(_0x3378da[_0xc851('0x5a')],null))[_0xc851('0x22')](respondWithResult(_0x2c58be,null))[_0xc851('0x54')](handleError(_0x2c58be,null));};exports['destroy']=function(_0x3353ee,_0x3f0d86){return db[_0xc851('0x3c')][_0xc851('0x58')]({'where':{'id':_0x3353ee[_0xc851('0x56')]['id']}})[_0xc851('0x22')](handleEntityNotFound(_0x3f0d86,null))['then'](removeEntity(_0x3f0d86,null))[_0xc851('0x54')](handleError(_0x3f0d86,null));};exports['describe']=function(_0x25746d,_0x544b8a){return db['ChatGroup'][_0xc851('0x5b')]()['then'](respondWithResult(_0x544b8a,null))[_0xc851('0x54')](handleError(_0x544b8a,null));};exports[_0xc851('0x5c')]=function(_0x2c979b,_0x4e3d06,_0x21f5d1){return db[_0xc851('0x5d')][_0xc851('0x50')]({'where':{'ChatGroupId':_0x2c979b[_0xc851('0x56')]['id'],'ToId':_0x2c979b[_0xc851('0x5e')]['id'],'read':![]}})[_0xc851('0x22')](function(_0x551d1e){return{'id':_[_0xc851('0x5f')](_0x2c979b[_0xc851('0x56')]['id']),'count':_0x551d1e};})[_0xc851('0x22')](respondWithResult(_0x4e3d06,null))['catch'](handleError(_0x4e3d06,null));};exports[_0xc851('0x60')]=function(_0x1c4b53,_0x516af3,_0x86cc){return db[_0xc851('0x3c')][_0xc851('0x58')]({'where':{'id':_0x1c4b53[_0xc851('0x56')]['id']}})['then'](handleEntityNotFound(_0x516af3,null))['then'](function(_0x55faa7){if(_0x55faa7){return _0x55faa7['addMembers'](_0x1c4b53[_0xc851('0x5a')][_0xc851('0x61')],_[_0xc851('0x62')](_0x1c4b53[_0xc851('0x5a')],[_0xc851('0x61'),'id'])||{});}})[_0xc851('0x22')](respondWithResult(_0x516af3,null))['catch'](handleError(_0x516af3,null));};exports[_0xc851('0x63')]=function(_0x4d67b6,_0x567977,_0x3a6a48){var _0x3c32ea={};var _0x517e56={};var _0xe2dc0a;var _0x60e022;return db['ChatGroup'][_0xc851('0x64')]({'where':{'id':_0x4d67b6[_0xc851('0x56')]['id']}})[_0xc851('0x22')](handleEntityNotFound(_0x567977,null))['then'](function(_0x56c221){if(_0x56c221){_0xe2dc0a=_0x56c221;_0x517e56['model']=_[_0xc851('0x3f')](db[_0xc851('0x65')]['rawAttributes']);_0x517e56[_0xc851('0x40')]=_[_0xc851('0x3f')](_0x4d67b6[_0xc851('0x40')]);_0x517e56[_0xc851('0x41')]=_[_0xc851('0x57')](_0x517e56[_0xc851('0x3e')],_0x517e56[_0xc851('0x40')]);_0x3c32ea[_0xc851('0x42')]=_[_0xc851('0x57')](_0x517e56[_0xc851('0x3e')],qs[_0xc851('0x43')](_0x4d67b6[_0xc851('0x40')][_0xc851('0x43')]));_0x3c32ea['attributes']=_0x3c32ea[_0xc851('0x42')][_0xc851('0x44')]?_0x3c32ea['attributes']:_0x517e56[_0xc851('0x3e')];_0x3c32ea['order']=qs[_0xc851('0x47')](_0x4d67b6[_0xc851('0x40')][_0xc851('0x47')]);_0x3c32ea[_0xc851('0x48')]=qs['filters'](_['pick'](_0x4d67b6[_0xc851('0x40')],_0x517e56['filters']));if(_0x4d67b6[_0xc851('0x40')]['filter']){_0x3c32ea[_0xc851('0x48')]=_['merge'](_0x3c32ea[_0xc851('0x48')],{'$or':_[_0xc851('0x4c')](_0x3c32ea[_0xc851('0x42')],function(_0x587366){var _0x5a36bc={};_0x5a36bc[_0x587366]={'$like':'%'+_0x4d67b6['query'][_0xc851('0x4a')]+'%'};return _0x5a36bc;})});}_0x3c32ea=_['merge']({},_0x3c32ea,_0x4d67b6[_0xc851('0x4f')]);return _0xe2dc0a[_0xc851('0x63')](_0x3c32ea);}})['then'](function(_0x4f3ec5){if(_0x4f3ec5){_0x60e022=_0x4f3ec5['length'];if(!_0x4d67b6[_0xc851('0x40')][_0xc851('0x66')](_0xc851('0x45'))){_0x3c32ea[_0xc851('0x31')]=qs[_0xc851('0x31')](_0x4d67b6['query']['limit']);_0x3c32ea[_0xc851('0x46')]=qs[_0xc851('0x46')](_0x4d67b6[_0xc851('0x40')]['offset']);}return _0xe2dc0a[_0xc851('0x63')](_0x3c32ea);}})['then'](function(_0x55f71b){if(_0x55f71b){return _0x55f71b?{'count':_0x60e022,'rows':_0x55f71b}:null;}})[_0xc851('0x22')](respondWithResult(_0x567977,null))['catch'](handleError(_0x567977,null));};exports['removeMembers']=function(_0x48cae8,_0x460296,_0x191fb0){return db[_0xc851('0x3c')][_0xc851('0x58')]({'where':{'id':_0x48cae8['params']['id']}})[_0xc851('0x22')](handleEntityNotFound(_0x460296,null))[_0xc851('0x22')](function(_0x2eb13e){if(_0x2eb13e){return _0x2eb13e[_0xc851('0x67')](_0x48cae8[_0xc851('0x40')][_0xc851('0x61')]);}})[_0xc851('0x22')](respondWithStatusCode(_0x460296,null))['catch'](handleError(_0x460296,null));};exports['addMessage']=function(_0x472413,_0x8dd449,_0x577ca0){if(_0x472413['body']['id']){delete _0x472413[_0xc851('0x5a')]['id'];}return db[_0xc851('0x3c')][_0xc851('0x58')]({'where':{'id':_0x472413[_0xc851('0x56')]['id']}})[_0xc851('0x22')](handleEntityNotFound(_0x8dd449,null))['then'](function(_0x4012f1){if(_0x4012f1){_0x472413[_0xc851('0x5a')][_0xc851('0x68')]=_0x4012f1['id'];return db[_0xc851('0x5d')]['create'](_0x472413[_0xc851('0x5a')]);}})[_0xc851('0x22')](respondWithResult(_0x8dd449,null))[_0xc851('0x54')](handleError(_0x8dd449,null));};exports['getMessages']=function(_0x481ffc,_0x42d11c,_0x12cc8b){var _0x5b84ed={};var _0x22b43e={};var _0x35fa67;var _0x45576c;return db[_0xc851('0x3c')]['findOne']({'where':{'id':_0x481ffc[_0xc851('0x56')]['id']}})[_0xc851('0x22')](handleEntityNotFound(_0x42d11c,null))[_0xc851('0x22')](function(_0x1bbf4b){if(_0x1bbf4b){_0x35fa67=_0x1bbf4b;_0x22b43e[_0xc851('0x3e')]=_[_0xc851('0x3f')](db['ChatInternalMessage'][_0xc851('0x3d')]);_0x22b43e[_0xc851('0x40')]=_['keys'](_0x481ffc[_0xc851('0x40')]);_0x22b43e['filters']=_[_0xc851('0x57')](_0x22b43e['model'],_0x22b43e[_0xc851('0x40')]);_0x5b84ed[_0xc851('0x42')]=_[_0xc851('0x57')](_0x22b43e['model'],qs['fields'](_0x481ffc[_0xc851('0x40')]['fields']));_0x5b84ed[_0xc851('0x42')]=_0x5b84ed[_0xc851('0x42')][_0xc851('0x44')]?_0x5b84ed[_0xc851('0x42')]:_0x22b43e[_0xc851('0x3e')];_0x5b84ed[_0xc851('0x69')]=qs['sort'](_0x481ffc[_0xc851('0x40')]['sort']);_0x5b84ed['where']=qs[_0xc851('0x41')](_[_0xc851('0x49')](_0x481ffc[_0xc851('0x40')],_0x22b43e['filters']));if(_0x481ffc['query'][_0xc851('0x4a')]){_0x5b84ed['where']=_['merge'](_0x5b84ed[_0xc851('0x48')],{'$or':_['map'](_0x5b84ed[_0xc851('0x42')],function(_0x16df69){var _0x103550={};_0x103550[_0x16df69]={'$like':'%'+_0x481ffc['query'][_0xc851('0x4a')]+'%'};return _0x103550;})});}if(_0x481ffc[_0xc851('0x40')][_0xc851('0x6a')]){var _0x2b9fef=_0x481ffc[_0xc851('0x40')][_0xc851('0x6a')]['split'](',');var _0x1a27da={};_0x1a27da[_0x2b9fef[0x0]]={'$gte':moment(_0x2b9fef[0x1])['format'](_0xc851('0x6b'))};_0x5b84ed[_0xc851('0x48')]=_[_0xc851('0x4b')](_0x5b84ed[_0xc851('0x48')],_0x1a27da);}_0x5b84ed=_[_0xc851('0x4b')]({},_0x5b84ed,_0x481ffc[_0xc851('0x4f')]);return _0x35fa67[_0xc851('0x6c')](_0x5b84ed);}})[_0xc851('0x22')](function(_0x2ee0a5){if(_0x2ee0a5){_0x45576c=_0x2ee0a5[_0xc851('0x44')];if(!_0x481ffc[_0xc851('0x40')][_0xc851('0x66')](_0xc851('0x45'))){_0x5b84ed[_0xc851('0x31')]=qs[_0xc851('0x31')](_0x481ffc[_0xc851('0x40')]['limit']);_0x5b84ed[_0xc851('0x46')]=qs[_0xc851('0x46')](_0x481ffc[_0xc851('0x40')][_0xc851('0x46')]);}return _0x35fa67[_0xc851('0x6c')](_0x5b84ed);}})[_0xc851('0x22')](function(_0x2110b9){if(_0x2110b9){return _0x2110b9?{'count':_0x45576c,'rows':_0x2110b9}:null;}})[_0xc851('0x22')](respondWithResult(_0x42d11c,null))[_0xc851('0x54')](handleError(_0x42d11c,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 2f3dc03..d757a67 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 _0xea4e=['emit','hasOwnProperty','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','remove'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0xea4e,0xc0));var _0xeea4=function(_0x498d4f,_0x6e928e){_0x498d4f=_0x498d4f-0x0;var _0x1c81a8=_0xea4e[_0x498d4f];return _0x1c81a8;};'use strict';var EventEmitter=require(_0xeea4('0x0'));var ChatGroup=require(_0xeea4('0x1'))['db'][_0xeea4('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xeea4('0x3')](0x0);var events={'afterCreate':_0xeea4('0x4'),'afterUpdate':'update','afterDestroy':_0xeea4('0x5')};function emitEvent(_0xc2e6bb){return function(_0x4a84c9,_0x4c93bf,_0x173143){ChatGroupEvents[_0xeea4('0x6')](_0xc2e6bb+':'+_0x4a84c9['id'],_0x4a84c9);ChatGroupEvents['emit'](_0xc2e6bb,_0x4a84c9);_0x173143(null);};}for(var e in events){if(events[_0xeea4('0x7')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0xeea4('0x8')]=ChatGroupEvents; \ No newline at end of file +var _0x3233=['events','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty','exports'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0x3233,0x1d8));var _0x3323=function(_0x54dd31,_0x55f45f){_0x54dd31=_0x54dd31-0x0;var _0x1f29ef=_0x3233[_0x54dd31];return _0x1f29ef;};'use strict';var EventEmitter=require(_0x3323('0x0'));var ChatGroup=require(_0x3323('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x3323('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3323('0x3'),'afterDestroy':_0x3323('0x4')};function emitEvent(_0x48ac64){return function(_0x256b63,_0x16c04b,_0x130134){ChatGroupEvents['emit'](_0x48ac64+':'+_0x256b63['id'],_0x256b63);ChatGroupEvents[_0x3323('0x5')](_0x48ac64,_0x256b63);_0x130134(null);};}for(var e in events){if(events[_0x3323('0x6')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x3323('0x7')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 3147a14..12f107e 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 _0xbda2=['chat_groups','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./chatGroup.attributes','define','ChatGroup'];(function(_0x7729b1,_0x468322){var _0x349504=function(_0x401cee){while(--_0x401cee){_0x7729b1['push'](_0x7729b1['shift']());}};_0x349504(++_0x468322);}(_0xbda2,0x85));var _0x2bda=function(_0x7e3c0d,_0x41f0fc){_0x7e3c0d=_0x7e3c0d-0x0;var _0x1b3df0=_0xbda2[_0x7e3c0d];return _0x1b3df0;};'use strict';var _=require(_0x2bda('0x0'));var util=require(_0x2bda('0x1'));var logger=require(_0x2bda('0x2'))(_0x2bda('0x3'));var moment=require('moment');var BPromise=require(_0x2bda('0x4'));var rp=require(_0x2bda('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2bda('0x6'));var config=require(_0x2bda('0x7'));var attributes=require(_0x2bda('0x8'));module['exports']=function(_0x9dd567,_0x18f609){return _0x9dd567[_0x2bda('0x9')](_0x2bda('0xa'),attributes,{'tableName':_0x2bda('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeeae=['path','../../config/environment','./chatGroup.attributes','exports','define','chat_groups','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x39c341,_0x2f47ff){var _0x58f61e=function(_0x101e79){while(--_0x101e79){_0x39c341['push'](_0x39c341['shift']());}};_0x58f61e(++_0x2f47ff);}(_0xeeae,0x192));var _0xeeea=function(_0x3758b5,_0x41d0ec){_0x3758b5=_0x3758b5-0x0;var _0x2673cc=_0xeeae[_0x3758b5];return _0x2673cc;};'use strict';var _=require(_0xeeea('0x0'));var util=require(_0xeeea('0x1'));var logger=require(_0xeeea('0x2'))(_0xeeea('0x3'));var moment=require(_0xeeea('0x4'));var BPromise=require(_0xeeea('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeeea('0x6'));var rimraf=require('rimraf');var config=require(_0xeeea('0x7'));var attributes=require(_0xeeea('0x8'));module[_0xeeea('0x9')]=function(_0xbd544c,_0x5546e5){return _0xbd544c[_0xeeea('0xa')]('ChatGroup',attributes,{'tableName':_0xeeea('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index f533591..3253ac6 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 _0x5ad3=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatGroup.socket','request','info','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','lodash','util','moment','bluebird'];(function(_0x3ff893,_0x53e2bd){var _0x246d70=function(_0x78da15){while(--_0x78da15){_0x3ff893['push'](_0x3ff893['shift']());}};_0x246d70(++_0x53e2bd);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x4f75b5,_0x4db76d){_0x4f75b5=_0x4f75b5-0x0;var _0x5c263b=_0x5ad3[_0x4f75b5];return _0x5c263b;};'use strict';var _=require(_0x35ad('0x0'));var util=require(_0x35ad('0x1'));var moment=require(_0x35ad('0x2'));var BPromise=require(_0x35ad('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x35ad('0x4'));var db=require(_0x35ad('0x5'))['db'];var utils=require(_0x35ad('0x6'));var logger=require(_0x35ad('0x7'))(_0x35ad('0x8'));var config=require(_0x35ad('0x9'));var jayson=require(_0x35ad('0xa'));var client=jayson[_0x35ad('0xb')][_0x35ad('0xc')]({'port':0x232a});config[_0x35ad('0xd')]=_['defaults'](config[_0x35ad('0xd')],{'host':_0x35ad('0xe'),'port':0x18eb});var socket=require(_0x35ad('0xf'))(new Redis(config['redis']));require(_0x35ad('0x10'))['register'](socket);function respondWithRpcPromise(_0x5a29e3,_0x2efae0,_0x3e9830){return new BPromise(function(_0x4881d1,_0x34c2cb){return client[_0x35ad('0x11')](_0x5a29e3,_0x3e9830)['then'](function(_0x4b31a1){logger[_0x35ad('0x12')](_0x35ad('0x13'),_0x2efae0,'request\x20sent');logger[_0x35ad('0x14')](_0x35ad('0x15'),_0x2efae0,'request\x20sent',JSON['stringify'](_0x4b31a1));if(_0x4b31a1[_0x35ad('0x16')]){if(_0x4b31a1[_0x35ad('0x16')][_0x35ad('0x17')]===0x1f4){logger['error'](_0x35ad('0x13'),_0x2efae0,_0x4b31a1[_0x35ad('0x16')]['message']);return _0x34c2cb(_0x4b31a1[_0x35ad('0x16')]['message']);}logger['error'](_0x35ad('0x13'),_0x2efae0,_0x4b31a1[_0x35ad('0x16')][_0x35ad('0x18')]);return _0x4881d1(_0x4b31a1['error'][_0x35ad('0x18')]);}else{logger[_0x35ad('0x12')](_0x35ad('0x13'),_0x2efae0,_0x35ad('0x19'));_0x4881d1(_0x4b31a1[_0x35ad('0x1a')][_0x35ad('0x18')]);}})['catch'](function(_0xd32a43){logger[_0x35ad('0x16')]('ChatGroup,\x20%s,\x20%s',_0x2efae0,_0xd32a43);_0x34c2cb(_0xd32a43);});});} \ No newline at end of file +var _0x008c=['rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1bd948,_0xd2639c){var _0x5cccf9=function(_0x52c976){while(--_0x52c976){_0x1bd948['push'](_0x1bd948['shift']());}};_0x5cccf9(++_0xd2639c);}(_0x008c,0x188));var _0xc008=function(_0x5edbac,_0xa54f78){_0x5edbac=_0x5edbac-0x0;var _0x2a5b78=_0x008c[_0x5edbac];return _0x2a5b78;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var moment=require(_0xc008('0x2'));var BPromise=require(_0xc008('0x3'));var rs=require(_0xc008('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc008('0x5'))['db'];var utils=require(_0xc008('0x6'));var logger=require(_0xc008('0x7'))(_0xc008('0x8'));var config=require(_0xc008('0x9'));var jayson=require(_0xc008('0xa'));var client=jayson[_0xc008('0xb')][_0xc008('0xc')]({'port':0x232a});config[_0xc008('0xd')]=_['defaults'](config[_0xc008('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xc008('0xe'))(new Redis(config['redis']));require('./chatGroup.socket')[_0xc008('0xf')](socket);function respondWithRpcPromise(_0x7231b4,_0x57c46d,_0x51ba7d){return new BPromise(function(_0x543eb8,_0x1eacfa){return client[_0xc008('0x10')](_0x7231b4,_0x51ba7d)['then'](function(_0xae2dab){logger[_0xc008('0x11')](_0xc008('0x12'),_0x57c46d,_0xc008('0x13'));logger[_0xc008('0x14')](_0xc008('0x15'),_0x57c46d,_0xc008('0x13'),JSON['stringify'](_0xae2dab));if(_0xae2dab['error']){if(_0xae2dab[_0xc008('0x16')]['code']===0x1f4){logger[_0xc008('0x16')](_0xc008('0x12'),_0x57c46d,_0xae2dab[_0xc008('0x16')][_0xc008('0x17')]);return _0x1eacfa(_0xae2dab[_0xc008('0x16')]['message']);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x57c46d,_0xae2dab[_0xc008('0x16')][_0xc008('0x17')]);return _0x543eb8(_0xae2dab[_0xc008('0x16')][_0xc008('0x17')]);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0x57c46d,'request\x20sent');_0x543eb8(_0xae2dab['result'][_0xc008('0x17')]);}})[_0xc008('0x18')](function(_0x501137){logger[_0xc008('0x16')]('ChatGroup,\x20%s,\x20%s',_0x57c46d,_0x501137);_0x1eacfa(_0x501137);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 064c24b..9259872 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 _0x4a81=['save','remove','update','chatGroup:','./chatGroup.events'];(function(_0x11ba32,_0x5a7ba6){var _0x296558=function(_0x53d575){while(--_0x53d575){_0x11ba32['push'](_0x11ba32['shift']());}};_0x296558(++_0x5a7ba6);}(_0x4a81,0x1b7));var _0x14a8=function(_0x586230,_0x1bf138){_0x586230=_0x586230-0x0;var _0x169a89=_0x4a81[_0x586230];return _0x169a89;};'use strict';var ChatGroupEvents=require(_0x14a8('0x0'));var events=[_0x14a8('0x1'),_0x14a8('0x2'),_0x14a8('0x3')];function createListener(_0x4a7f9e,_0x5845a3){return function(_0x45869b){_0x5845a3['emit'](_0x4a7f9e,_0x45869b);};}function removeListener(_0x39c3d4,_0x3363f8){return function(){ChatGroupEvents['removeListener'](_0x39c3d4,_0x3363f8);};}exports['register']=function(_0x2cd6d2){for(var _0x4aa19e=0x0,_0x134295=events['length'];_0x4aa19e<_0x134295;_0x4aa19e++){var _0x26e442=events[_0x4aa19e];var _0x4271b5=createListener(_0x14a8('0x4')+_0x26e442,_0x2cd6d2);ChatGroupEvents['on'](_0x26e442,_0x4271b5);}}; \ No newline at end of file +var _0xd2ea=['./chatGroup.events','save','remove','update','emit','removeListener','register','length','chatGroup:'];(function(_0x404e77,_0x4c4f6b){var _0x332a79=function(_0x551161){while(--_0x551161){_0x404e77['push'](_0x404e77['shift']());}};_0x332a79(++_0x4c4f6b);}(_0xd2ea,0x15f));var _0xad2e=function(_0xd78fd9,_0x13a0b9){_0xd78fd9=_0xd78fd9-0x0;var _0x1ab459=_0xd2ea[_0xd78fd9];return _0x1ab459;};'use strict';var ChatGroupEvents=require(_0xad2e('0x0'));var events=[_0xad2e('0x1'),_0xad2e('0x2'),_0xad2e('0x3')];function createListener(_0x44b30d,_0x5c9fa9){return function(_0x3a9d11){_0x5c9fa9[_0xad2e('0x4')](_0x44b30d,_0x3a9d11);};}function removeListener(_0xcba7cb,_0x3e0741){return function(){ChatGroupEvents[_0xad2e('0x5')](_0xcba7cb,_0x3e0741);};}exports[_0xad2e('0x6')]=function(_0x29e97f){for(var _0x592e8b=0x0,_0x3b5170=events[_0xad2e('0x7')];_0x592e8b<_0x3b5170;_0x592e8b++){var _0x2ff7b2=events[_0x592e8b];var _0x5710ac=createListener(_0xad2e('0x8')+_0x2ff7b2,_0x29e97f);ChatGroupEvents['on'](_0x2ff7b2,_0x5710ac);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index ac52ef3..aa7cbe5 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 _0x5fca=['/describe','isAuthenticated','describe','/:id','show','/:id/unread','/:id/members','getMembers','/:id/messages','create','addMembers','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./chatGroup.controller','index','get'];(function(_0x1f1a97,_0xadfc15){var _0x29fc6a=function(_0x38c180){while(--_0x38c180){_0x1f1a97['push'](_0x1f1a97['shift']());}};_0x29fc6a(++_0xadfc15);}(_0x5fca,0x104));var _0xa5fc=function(_0x30b0d8,_0x57470c){_0x30b0d8=_0x30b0d8-0x0;var _0x459c09=_0x5fca[_0x30b0d8];return _0x459c09;};'use strict';var multer=require(_0xa5fc('0x0'));var util=require(_0xa5fc('0x1'));var path=require(_0xa5fc('0x2'));var timeout=require(_0xa5fc('0x3'));var express=require(_0xa5fc('0x4'));var router=express[_0xa5fc('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa5fc('0x6'));var controller=require(_0xa5fc('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xa5fc('0x8')]);router[_0xa5fc('0x9')](_0xa5fc('0xa'),auth[_0xa5fc('0xb')](),controller[_0xa5fc('0xc')]);router[_0xa5fc('0x9')](_0xa5fc('0xd'),auth[_0xa5fc('0xb')](),controller[_0xa5fc('0xe')]);router[_0xa5fc('0x9')](_0xa5fc('0xf'),auth[_0xa5fc('0xb')](),controller['getUnread']);router[_0xa5fc('0x9')](_0xa5fc('0x10'),auth['isAuthenticated'](),controller[_0xa5fc('0x11')]);router[_0xa5fc('0x9')](_0xa5fc('0x12'),auth['isAuthenticated'](),controller['getMessages']);router['post']('/',auth['isAuthenticated'](),controller[_0xa5fc('0x13')]);router['post']('/:id/members',auth[_0xa5fc('0xb')](),controller[_0xa5fc('0x14')]);router[_0xa5fc('0x15')](_0xa5fc('0x12'),auth[_0xa5fc('0xb')](),controller['addMessage']);router[_0xa5fc('0x16')](_0xa5fc('0xd'),auth['isAuthenticated'](),controller[_0xa5fc('0x17')]);router[_0xa5fc('0x18')](_0xa5fc('0xd'),auth[_0xa5fc('0xb')](),controller[_0xa5fc('0x19')]);router[_0xa5fc('0x18')]('/:id/members',auth[_0xa5fc('0xb')](),controller['removeMembers']);module[_0xa5fc('0x1a')]=router; \ No newline at end of file +var _0x3961=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','post','create','addMembers','addMessage','put','delete','destroy','exports','util','path'];(function(_0x1d9677,_0x26c76a){var _0xfa46f1=function(_0x3f321d){while(--_0x3f321d){_0x1d9677['push'](_0x1d9677['shift']());}};_0xfa46f1(++_0x26c76a);}(_0x3961,0x178));var _0x1396=function(_0x4f6d08,_0x1b3dd0){_0x4f6d08=_0x4f6d08-0x0;var _0x53a9c6=_0x3961[_0x4f6d08];return _0x53a9c6;};'use strict';var multer=require('multer');var util=require(_0x1396('0x0'));var path=require(_0x1396('0x1'));var timeout=require(_0x1396('0x2'));var express=require(_0x1396('0x3'));var router=express[_0x1396('0x4')]();var auth=require(_0x1396('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1396('0x6'));var controller=require('./chatGroup.controller');router['get']('/',auth[_0x1396('0x7')](),controller[_0x1396('0x8')]);router['get'](_0x1396('0x9'),auth[_0x1396('0x7')](),controller[_0x1396('0xa')]);router[_0x1396('0xb')](_0x1396('0xc'),auth[_0x1396('0x7')](),controller[_0x1396('0xd')]);router[_0x1396('0xb')](_0x1396('0xe'),auth[_0x1396('0x7')](),controller[_0x1396('0xf')]);router['get'](_0x1396('0x10'),auth['isAuthenticated'](),controller['getMembers']);router['get'](_0x1396('0x11'),auth[_0x1396('0x7')](),controller[_0x1396('0x12')]);router[_0x1396('0x13')]('/',auth[_0x1396('0x7')](),controller[_0x1396('0x14')]);router[_0x1396('0x13')]('/:id/members',auth[_0x1396('0x7')](),controller[_0x1396('0x15')]);router[_0x1396('0x13')](_0x1396('0x11'),auth[_0x1396('0x7')](),controller[_0x1396('0x16')]);router[_0x1396('0x17')](_0x1396('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x1396('0x18')](_0x1396('0xc'),auth[_0x1396('0x7')](),controller[_0x1396('0x19')]);router['delete'](_0x1396('0x10'),auth['isAuthenticated'](),controller['removeMembers']);module[_0x1396('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 c818590..2fd0885 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 _0x5eb8=['thumb','TEXT','STRING','DATE','long','BOOLEAN','INTEGER','ENUM','star'];(function(_0x356186,_0x566a29){var _0xb6af2d=function(_0x2d7209){while(--_0x2d7209){_0x356186['push'](_0x356186['shift']());}};_0xb6af2d(++_0x566a29);}(_0x5eb8,0xb0));var _0x85eb=function(_0x2a0fc4,_0x2eaf74){_0x2a0fc4=_0x2a0fc4-0x0;var _0x531d00=_0x5eb8[_0x2a0fc4];return _0x531d00;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x85eb('0x0')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x85eb('0x1')]},'ratingType':{'type':Sequelize[_0x85eb('0x2')](_0x85eb('0x3'),_0x85eb('0x4')),'defaultValue':_0x85eb('0x3')},'ratingMessage':{'type':Sequelize[_0x85eb('0x5')]},'pathTranscript':{'type':Sequelize[_0x85eb('0x5')]},'mailTranscript':{'type':Sequelize[_0x85eb('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x85eb('0x7')]},'disposition':{'type':Sequelize[_0x85eb('0x6')]},'note':{'type':Sequelize[_0x85eb('0x6')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x85eb('0x6')]},'osName':{'type':Sequelize[_0x85eb('0x6')]},'osVersion':{'type':Sequelize[_0x85eb('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x85eb('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x85eb('0x6')]},'customerIp':{'type':Sequelize[_0x85eb('0x6')]},'formData':{'type':Sequelize[_0x85eb('0x5')](_0x85eb('0x8'))},'read1stAt':{'type':Sequelize[_0x85eb('0x7')]},'lastMsgAt':{'type':Sequelize[_0x85eb('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x85eb('0x2')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x85eb('0x6')]}}; \ No newline at end of file +var _0xb62e=['BOOLEAN','INTEGER','star','thumb','TEXT','STRING','long','DATE','ENUM','out','sequelize','exports'];(function(_0x207869,_0xe6185e){var _0xd279fb=function(_0x90aa84){while(--_0x90aa84){_0x207869['push'](_0x207869['shift']());}};_0xd279fb(++_0xe6185e);}(_0xb62e,0x1de));var _0xeb62=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xb62e[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0xeb62('0x0'));module[_0xeb62('0x1')]={'closed':{'type':Sequelize[_0xeb62('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xeb62('0x3')]},'ratingType':{'type':Sequelize['ENUM'](_0xeb62('0x4'),_0xeb62('0x5')),'defaultValue':_0xeb62('0x4')},'ratingMessage':{'type':Sequelize[_0xeb62('0x6')]},'pathTranscript':{'type':Sequelize[_0xeb62('0x6')]},'mailTranscript':{'type':Sequelize[_0xeb62('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xeb62('0x7')]},'note':{'type':Sequelize[_0xeb62('0x7')]},'browserName':{'type':Sequelize[_0xeb62('0x7')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xeb62('0x7')]},'osVersion':{'type':Sequelize[_0xeb62('0x7')]},'deviceModel':{'type':Sequelize[_0xeb62('0x7')]},'deviceVendor':{'type':Sequelize[_0xeb62('0x7')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize['STRING']},'customerIp':{'type':Sequelize[_0xeb62('0x7')]},'formData':{'type':Sequelize[_0xeb62('0x6')](_0xeb62('0x8'))},'read1stAt':{'type':Sequelize[_0xeb62('0x9')]},'lastMsgAt':{'type':Sequelize[_0xeb62('0x9')]},'lastMsgDirection':{'type':Sequelize[_0xeb62('0xa')]('in',_0xeb62('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xeb62('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 5055e57..e443def 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 _0xf403=['utc','endOf','isArray','condition','unreadMessages','\x20IN\x20?','and','tableAlias','\x20=\x20?','LIKE','c.firstName','\x20LIKE\x20?','c.lastName','c.email','\x20>\x20?','TagId','ContactId','\x20<\x20?','filter','isNil','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','replace','\x27\x27\x27\x27','i.id\x20LIKE\x20?','split','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','order','DESC','group','i.id','Sequelize','QueryTypes','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\x20=\x20it.TagId','t.id\x20IN\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','sequelize','toString','keyBy','merge','i.*','Contact.firstName','Contact.lastName','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','GROUP_CONCAT(DISTINCT\x20t.id)','chat_interaction_has_tags','ui.ChatInteractionId\x20IN\x20?','map','groupBy','all','includeAll','include','options','find','create','body','params','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','ValidationError','Interaction\x20already\x20assigned','AbandonInteraction','file','filename','mimetype','Attachment','attachmentDownload','closed','Unauthorized','findOne','attachId','basename','close','mailTranscript','root','server/files/chat/upload/','transcript-%s.txt','now','pathTranscript','ChatMessage','Messages','User','ChatWebsite','CmContact','format','%s%d','agentAlias','customer','agentIdentifier','System','agent_alias','fullname','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','user','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','YYYY-MM-DD\x20HH:mm:ss','rows','includeAgent','push','alias','findAll','addTags','setTags','spread','Tag','chatInteractionTags:save','removeTags','unix','server','files','tmp','transcript-%d-%s.zip','direction','firstName','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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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','Chat','YYYY-MM-DD','mkdirSync','Account','N.A.','closedAt','disposition','browserName','referer','customerIp','tail','existsSync','pipe','createWriteStream','out','Contact','lastName','renderFile','views','toFile','.pdf','download','log','err','unlinkSync','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./chatInteraction.socket','register','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','status','end','json','count','offset','set','Content-Range','apply','reject','update','destroy','sendStatus','stack','name','send','TagIds','forEach','Tags','catch','index','ChatInteraction','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','select','field','color','from','tools_tags','COUNT(*)','chat_messages','me.ChatInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','user_has_chat_interactions','users','chat_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','me.ChatInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false','expr','parse','advancedFilter','createdAt','value','startOf'];(function(_0x2b60e7,_0x590a96){var _0x51bf5a=function(_0x343408){while(--_0x343408){_0x2b60e7['push'](_0x2b60e7['shift']());}};_0x51bf5a(++_0x590a96);}(_0xf403,0x1d3));var _0x3f40=function(_0xb212de,_0x5e1e50){_0xb212de=_0xb212de-0x0;var _0x3246c1=_0xf403[_0xb212de];return _0x3246c1;};'use strict';var pdf=require(_0x3f40('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x3f40('0x1'));var zipdir=require(_0x3f40('0x2'));var jsonpatch=require(_0x3f40('0x3'));var rp=require(_0x3f40('0x4'));var moment=require(_0x3f40('0x5'));var BPromise=require(_0x3f40('0x6'));var Mustache=require(_0x3f40('0x7'));var util=require(_0x3f40('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x3f40('0x9'));var ejs=require(_0x3f40('0xa'));var fs=require('fs');var _=require(_0x3f40('0xb'));var squel=require(_0x3f40('0xc'));var crypto=require('crypto');var jsforce=require(_0x3f40('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3f40('0xe'));var Papa=require(_0x3f40('0xf'));var Redis=require(_0x3f40('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x3f40('0x11'));var logger=require(_0x3f40('0x12'))(_0x3f40('0x13'));var utils=require('../../config/utils');var config=require(_0x3f40('0x14'));var db=require(_0x3f40('0x15'))['db'];config[_0x3f40('0x16')]=_['defaults'](config[_0x3f40('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x3f40('0x17'))(new Redis(config[_0x3f40('0x16')]));require(_0x3f40('0x18'))[_0x3f40('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3f40('0x1a')][_0x3f40('0x1b')]({'port':0x232b});var client9004=jayson[_0x3f40('0x1a')][_0x3f40('0x1b')]({'port':0x232c});function checkPasswordPattern(_0x232241,_0x4e28b9,_0x2e51ed){if(_0x2e51ed){var _0x3d11c9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3d11c9['test'](_0x4e28b9)){return _0x232241;}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 _0x232241;}}function respondWithRpcPromise(_0x54f596,_0x206630,_0x13b950,_0x59718c){return new BPromise(function(_0x131e55,_0x374644){var _0x5b4ebc=_0x59718c||client;return _0x5b4ebc[_0x3f40('0x1c')](_0x54f596,_0x13b950)[_0x3f40('0x1d')](function(_0x464b26){logger[_0x3f40('0x1e')](_0x3f40('0x1f'),_0x206630,'request\x20sent');logger[_0x3f40('0x20')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x206630,_0x3f40('0x21'),JSON[_0x3f40('0x22')](_0x464b26));if(_0x464b26[_0x3f40('0x23')]){if(_0x464b26[_0x3f40('0x23')][_0x3f40('0x24')]===0x1f4){logger['error'](_0x3f40('0x1f'),_0x206630,_0x464b26[_0x3f40('0x23')][_0x3f40('0x25')]);return _0x374644(_0x464b26[_0x3f40('0x23')][_0x3f40('0x25')]);}logger[_0x3f40('0x23')]('ChatInteraction,\x20%s,\x20%s',_0x206630,_0x464b26[_0x3f40('0x23')][_0x3f40('0x25')]);return _0x131e55(_0x464b26[_0x3f40('0x23')]['message']);}else{logger[_0x3f40('0x1e')]('ChatInteraction,\x20%s,\x20%s',_0x206630,_0x3f40('0x21'));_0x131e55(_0x464b26['result']['message']);}})['catch'](function(_0x30a945){logger[_0x3f40('0x23')](_0x3f40('0x1f'),_0x206630,_0x30a945);_0x374644(_0x30a945);});});}function respondWithStatusCode(_0x257833,_0x5b1079){_0x5b1079=_0x5b1079||0xcc;return function(_0x300665){if(_0x300665){return _0x257833['sendStatus'](_0x5b1079);}return _0x257833[_0x3f40('0x26')](_0x5b1079)[_0x3f40('0x27')]();};}function respondWithResult(_0xbd4333,_0x5e0f25){_0x5e0f25=_0x5e0f25||0xc8;return function(_0x287632){if(_0x287632){return _0xbd4333['status'](_0x5e0f25)[_0x3f40('0x28')](_0x287632);}};}function respondWithFilteredResult(_0x5b9079,_0x49057b){return function(_0xb6ab4d){if(_0xb6ab4d){var _0x19fb8e=_0xb6ab4d[_0x3f40('0x29')],_0x14fdfd=_0x49057b[_0x3f40('0x2a')],_0xb23186=_0x49057b[_0x3f40('0x2a')]+_0x49057b['limit'],_0x357396;if(_0xb23186>=_0x19fb8e){_0xb23186=_0x19fb8e;_0x357396=0xc8;}else{_0x357396=0xce;}_0x5b9079[_0x3f40('0x26')](_0x357396);return _0x5b9079[_0x3f40('0x2b')](_0x3f40('0x2c'),_0x14fdfd+'-'+_0xb23186+'/'+_0x19fb8e)[_0x3f40('0x28')](_0xb6ab4d);}return null;};}function patchUpdates(_0x3b20f4){return function(_0x5cc804){try{jsonpatch[_0x3f40('0x2d')](_0x5cc804,_0x3b20f4,!![]);}catch(_0x86d9cb){return BPromise[_0x3f40('0x2e')](_0x86d9cb);}return _0x5cc804['save']();};}function saveUpdates(_0x21c8eb,_0x2869d0){return function(_0x239fd5){if(_0x239fd5){return _0x239fd5[_0x3f40('0x2f')](_0x21c8eb)[_0x3f40('0x1d')](function(_0x323908){return _0x323908;});}return null;};}function removeEntity(_0x23b7ec,_0x1b5f3f){return function(_0x10356d){if(_0x10356d){return _0x10356d[_0x3f40('0x30')]()[_0x3f40('0x1d')](function(){_0x23b7ec[_0x3f40('0x26')](0xcc)[_0x3f40('0x27')]();});}};}function handleEntityNotFound(_0x13f7bc,_0x22a8bc){return function(_0xf26a2f){if(!_0xf26a2f){_0x13f7bc[_0x3f40('0x31')](0x194);}return _0xf26a2f;};}function handleError(_0x32a715,_0x41428f){_0x41428f=_0x41428f||0x1f4;return function(_0xbe29de){logger[_0x3f40('0x23')](_0xbe29de[_0x3f40('0x32')]);if(_0xbe29de[_0x3f40('0x33')]){delete _0xbe29de[_0x3f40('0x33')];}_0x32a715[_0x3f40('0x26')](_0x41428f)[_0x3f40('0x34')](_0xbe29de);};}function getInteractionUsers(_0x2e158a,_0x31ab72){return new BPromise(function(_0x411c98,_0x2df15b){try{if(_0x31ab72[_0x2e158a['id']]){_0x2e158a['Users']=_['map'](_0x31ab72[_0x2e158a['id']],function(_0x1b5d96){return{'id':_0x1b5d96['id']};});}}catch(_0x1b005e){_0x2df15b(_0x1b005e);}_0x411c98(_0x2e158a);});}function getInteractionTags(_0x24f070,_0x4778ec){return new BPromise(function(_0x179477,_0x215d00){try{if(_0x24f070[_0x3f40('0x35')]){_0x24f070['Tags']=[];_0x24f070[_0x3f40('0x35')]['split'](',')[_0x3f40('0x36')](function(_0x3bec11){_0x24f070[_0x3f40('0x37')]['push'](_0x4778ec[_0x3bec11]);});}delete _0x24f070[_0x3f40('0x35')];}catch(_0x252738){_0x215d00(_0x252738);}_0x179477(_0x24f070);});}function updateChatInteraction(_0x5a5720,_0x1eb15c,_0x180305){return new BPromise(function(_0x4b1a66,_0x192839){return getInteractionUsers(_0x5a5720,_0x180305)['then'](function(_0x7c3f80){return getInteractionTags(_0x7c3f80,_0x1eb15c);})['then'](function(_0x557f27){_0x4b1a66(_0x557f27);})[_0x3f40('0x38')](function(_0x4bf783){_0x192839(_0x4bf783);});});}exports[_0x3f40('0x39')]=function(_0xe04271,_0x2a830d){var _0x460237={},_0x48b65e={},_0x237c91={'count':0x0,'rows':[]};var _0x5b0eaa=db[_0x3f40('0x3a')][_0x3f40('0x3b')];_0x48b65e[_0x3f40('0x3c')]=_['keys'](_0x5b0eaa);_0x48b65e['query']=_[_0x3f40('0x3d')](_0xe04271[_0x3f40('0x3e')]);_0x48b65e[_0x3f40('0x3f')]=_[_0x3f40('0x40')](_0x48b65e[_0x3f40('0x3c')],_0x48b65e[_0x3f40('0x3e')]);_0x460237[_0x3f40('0x41')]=_[_0x3f40('0x40')](_0x48b65e['model'],qs[_0x3f40('0x42')](_0xe04271['query']['fields']));_0x460237[_0x3f40('0x41')]=_0x460237[_0x3f40('0x41')][_0x3f40('0x43')]?_0x460237[_0x3f40('0x41')]:_0x48b65e[_0x3f40('0x3c')];if(!_0xe04271[_0x3f40('0x3e')][_0x3f40('0x44')](_0x3f40('0x45'))){_0x460237[_0x3f40('0x46')]=qs[_0x3f40('0x46')](_0xe04271[_0x3f40('0x3e')][_0x3f40('0x46')]);_0x460237[_0x3f40('0x2a')]=qs[_0x3f40('0x2a')](_0xe04271['query'][_0x3f40('0x2a')]);}_0x460237['order']=qs[_0x3f40('0x47')](_0xe04271[_0x3f40('0x3e')]['sort']);_0x460237[_0x3f40('0x48')]=qs[_0x3f40('0x3f')](_[_0x3f40('0x49')](_0xe04271[_0x3f40('0x3e')],_0x48b65e[_0x3f40('0x3f')]));var _0x268ae4=[];var _0x851bfc=squel[_0x3f40('0x4a')]()[_0x3f40('0x4b')]('id')[_0x3f40('0x4b')](_0x3f40('0x33'))[_0x3f40('0x4b')](_0x3f40('0x4c'))[_0x3f40('0x4d')](_0x3f40('0x4e'));var _0x3cbcd3=squel[_0x3f40('0x4a')]()[_0x3f40('0x4b')](_0x3f40('0x4f'))[_0x3f40('0x4d')](_0x3f40('0x50'),'me')['where'](_0x3f40('0x51'))[_0x3f40('0x48')](_0x3f40('0x52'))[_0x3f40('0x48')](_0x3f40('0x53'));var _0x551395=squel['select']()['field'](_0x3f40('0x54'))[_0x3f40('0x4b')]('ui.ChatInteractionId')[_0x3f40('0x4d')](_0x3f40('0x55'),'ui')['left_join'](_0x3f40('0x56'),'u','u.id\x20=\x20ui.UserId');var _0x187960=squel[_0x3f40('0x4a')]()[_0x3f40('0x4d')](_0x3f40('0x57'),'i')[_0x3f40('0x58')](_0x3f40('0x59'),'c',_0x3f40('0x5a'))[_0x3f40('0x58')](_0x3f40('0x56'),'o',_0x3f40('0x5b'))[_0x3f40('0x58')](_0x3f40('0x5c'),'a',_0x3f40('0x5d'))['left_join'](_0x3f40('0x50'),'me',_0x3f40('0x5e'));var _0x1c94a1=squel[_0x3f40('0x5f')]();if(_0xe04271[_0x3f40('0x3e')]['advancedFilter']){var _0x3746cf=JSON[_0x3f40('0x60')](_0xe04271[_0x3f40('0x3e')][_0x3f40('0x61')]);_[_0x3f40('0x3d')](_0x3746cf)['forEach'](function(_0x5acce7){var _0x6c81fe=_0x3746cf[_0x5acce7];if(_0x5acce7===_0x3f40('0x62')){var _0x47a7b6=moment(_0x6c81fe[_0x3f40('0x63')]['dateStart'])[_0x3f40('0x64')]('day')[_0x3f40('0x65')]()['format']();var _0xab34b=moment(_0xab34b)[_0x3f40('0x65')]()[_0x3f40('0x66')]('day')['format']();_0x1c94a1['and']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x47a7b6,_0xab34b);}else{if(_[_0x3f40('0x67')](_0x6c81fe['condition'])){_0x6c81fe['condition'][_0x3f40('0x36')](function(_0x2a800d){switch(_0x6c81fe[_0x3f40('0x68')][_0x3f40('0x63')]){case'IS':if(_0x5acce7!=='TagId'&&_0x5acce7!==_0x3f40('0x69')){if(_['isArray'](_0x6c81fe['value'])&&_0x6c81fe['value'][_0x3f40('0x43')]>0x1){_0x1c94a1['and'](_0x6c81fe['tableAlias']+'.'+_0x5acce7+_0x3f40('0x6a'),_0x6c81fe[_0x3f40('0x63')]);}else{_0x1c94a1[_0x3f40('0x6b')](_0x6c81fe[_0x3f40('0x6c')]+'.'+_0x5acce7+_0x3f40('0x6d'),_0x6c81fe['value'][0x0]);}}break;case'=':_0x1c94a1[_0x3f40('0x6b')](_0x6c81fe['tableAlias']+'.'+_0x5acce7+_0x3f40('0x6d'),_0x6c81fe[_0x3f40('0x63')]);break;case _0x3f40('0x6e'):if(_0x5acce7==='ContactId'){_0x1c94a1[_0x3f40('0x6b')](_0x3f40('0x6f')+_0x3f40('0x70'),'%'+_0x6c81fe[_0x3f40('0x63')]+'%');_0x1c94a1['or'](_0x3f40('0x71')+'\x20LIKE\x20?','%'+_0x6c81fe[_0x3f40('0x63')]+'%');_0x1c94a1['or'](_0x3f40('0x72')+_0x3f40('0x70'),'%'+_0x6c81fe[_0x3f40('0x63')]+'%');}else{_0x1c94a1[_0x3f40('0x6b')](_0x6c81fe[_0x3f40('0x6c')]+'.'+_0x5acce7+_0x3f40('0x70'),'%'+_0x6c81fe[_0x3f40('0x63')]+'%');}break;case'>':_0x1c94a1[_0x3f40('0x6b')](_0x6c81fe[_0x3f40('0x6c')]+'.'+_0x5acce7+_0x3f40('0x73'),_0x6c81fe[_0x3f40('0x63')]);break;case'<':_0x1c94a1['and'](_0x6c81fe['tableAlias']+'.'+_0x5acce7+'\x20<\x20?',_0x6c81fe[_0x3f40('0x63')]);break;}});}else{switch(_0x6c81fe[_0x3f40('0x68')][_0x3f40('0x63')]){case'IS':if(_0x5acce7!==_0x3f40('0x74')&&_0x5acce7!==_0x3f40('0x69')){if(_[_0x3f40('0x67')](_0x6c81fe['value'])&&_0x6c81fe[_0x3f40('0x63')]['length']>0x1){_0x1c94a1[_0x3f40('0x6b')](_0x6c81fe[_0x3f40('0x6c')]+'.'+_0x5acce7+_0x3f40('0x6a'),_0x6c81fe[_0x3f40('0x63')]);}else{_0x1c94a1[_0x3f40('0x6b')](_0x6c81fe['tableAlias']+'.'+_0x5acce7+_0x3f40('0x6d'),_0x6c81fe['value'][0x0]);}}break;case'=':_0x1c94a1['and'](_0x6c81fe[_0x3f40('0x6c')]+'.'+_0x5acce7+'\x20=\x20?',_0x6c81fe[_0x3f40('0x63')]);break;case _0x3f40('0x6e'):if(_0x5acce7===_0x3f40('0x75')){_0x1c94a1[_0x3f40('0x6b')](_0x3f40('0x6f')+_0x3f40('0x70'),'%'+_0x6c81fe[_0x3f40('0x63')]+'%');_0x1c94a1['or']('c.lastName'+_0x3f40('0x70'),'%'+_0x6c81fe[_0x3f40('0x63')]+'%');_0x1c94a1['or'](_0x3f40('0x72')+_0x3f40('0x70'),'%'+_0x6c81fe[_0x3f40('0x63')]+'%');}else{_0x1c94a1['and'](_0x6c81fe[_0x3f40('0x6c')]+'.'+_0x5acce7+_0x3f40('0x70'),'%'+_0x6c81fe[_0x3f40('0x63')]+'%');}break;case'>':_0x1c94a1[_0x3f40('0x6b')](_0x6c81fe[_0x3f40('0x6c')]+'.'+_0x5acce7+_0x3f40('0x73'),_0x6c81fe['value']);break;case'<':_0x1c94a1[_0x3f40('0x6b')](_0x6c81fe[_0x3f40('0x6c')]+'.'+_0x5acce7+_0x3f40('0x76'),_0x6c81fe[_0x3f40('0x63')]);break;}}}});}else{var _0x2f7dfa=_(Object['keys'](_0xe04271['query']))['map'](function(_0x25d8fb){return _0x5b0eaa[_0x3f40('0x44')](_0x25d8fb)?_0x25d8fb:undefined;})[_0x3f40('0x77')](function(_0xb52921){return!_[_0x3f40('0x78')](_0xb52921);})[_0x3f40('0x63')]();if(!_[_0x3f40('0x79')](_0x2f7dfa)){_0x2f7dfa[_0x3f40('0x36')](function(_0x3fc422){if(_0x3fc422===_0x3f40('0x7a')){_0x187960[_0x3f40('0x48')](_0x3f40('0x7b'),[][_0x3f40('0x7c')](_0xe04271['query'][_0x3fc422]));}else if(_0x3fc422===_0x3f40('0x62')){var _0x391943=JSON[_0x3f40('0x60')](_0xe04271['query'][_0x3fc422])['$gte'];var _0x4595cd=JSON[_0x3f40('0x60')](_0xe04271[_0x3f40('0x3e')][_0x3fc422])[_0x3f40('0x7d')];_0x187960['where'](_0x3f40('0x7e'),_0x391943,_0x4595cd);}else{if(_0xe04271[_0x3f40('0x3e')][_0x3fc422]===_0x3f40('0x7f')){_0x187960[_0x3f40('0x48')]('i.'+_0x3fc422+_0x3f40('0x80'));}else{_0x187960[_0x3f40('0x48')]('i.'+_0x3fc422+_0x3f40('0x6d'),_0xe04271[_0x3f40('0x3e')][_0x3fc422]);}}});}if(_0xe04271[_0x3f40('0x3e')][_0x3f40('0x77')]){var _0x5299d3=_0xe04271['query'][_0x3f40('0x77')][_0x3f40('0x81')]('\x5c','\x5c\x5c')[_0x3f40('0x81')]('\x27\x27',_0x3f40('0x82'));if(qs['isNumeric'](_0x5299d3)){_0x1c94a1['or'](_0x3f40('0x83'),_0x5299d3+'%');}else{var _0x66f9d=[];_0x5299d3[_0x3f40('0x84')]('\x20')[_0x3f40('0x36')](function(_0xca2941){_0x66f9d['push']('+'+_0xca2941['toString']());});var _0x839281=_0x66f9d[_0x3f40('0x85')]('\x20');_0x1c94a1['or'](_0x3f40('0x86'),_0x839281)['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x5299d3+'%');}}}_0x187960[_0x3f40('0x48')](_0x1c94a1);if(_0x460237[_0x3f40('0x87')]){_0x460237[_0x3f40('0x87')]['forEach'](function(_0x4cbc7b){_0x187960[_0x3f40('0x87')]('i.'+_0x4cbc7b[0x0],_0x4cbc7b[0x1]===_0x3f40('0x88')?![]:!![]);});}_0x187960[_0x3f40('0x89')](_0x3f40('0x8a'));var _0xade25c={'type':db[_0x3f40('0x8b')][_0x3f40('0x8c')]['SELECT'],'raw':!![]};var _0xb4e27e=_0x187960['clone']()[_0x3f40('0x4b')]('COUNT(*)')['field'](_0x3f40('0x8d'),'unreadMessages');if(!_0xe04271['query'][_0x3f40('0x61')]){if(_0xe04271[_0x3f40('0x3e')][_0x3f40('0x8e')]){if(_0xe04271[_0x3f40('0x3e')][_0x3f40('0x8e')]==0x1){_0xb4e27e[_0x3f40('0x8f')](_0x3f40('0x90'));_0x187960['having'](_0x3f40('0x90'));}else{_0xb4e27e['having']('`unreadMessages`\x20>\x200');_0x187960[_0x3f40('0x8f')](_0x3f40('0x91'));}}if(_0xe04271[_0x3f40('0x3e')]['tag']){var _0x2b860a=_['isArray'](_0xe04271['query']['tag'])?_0xe04271['query']['tag']:new Array(_0xe04271['query'][_0x3f40('0x92')]);var _0x105fde=squel[_0x3f40('0x5f')]();_0x2b860a[_0x3f40('0x36')](function(_0x346611){_0x105fde['or'](_0x3f40('0x93'),'%,'+_0x346611+',%');});_0x187960[_0x3f40('0x8f')](_0x105fde);_0xb4e27e[_0x3f40('0x58')]('chat_interaction_has_tags','it',_0x3f40('0x94'));_0xb4e27e[_0x3f40('0x58')](_0x3f40('0x4e'),'t',_0x3f40('0x95'));_0xb4e27e[_0x3f40('0x48')](_0x3f40('0x96'),_0x2b860a);}}else{var _0x3746cf=JSON[_0x3f40('0x60')](_0xe04271[_0x3f40('0x3e')][_0x3f40('0x61')]);_['keys'](_0x3746cf)[_0x3f40('0x36')](function(_0x3c670c){var _0x5e33ac=_0x3746cf[_0x3c670c];if(_0x3c670c==='TagId'){var _0x5a3e5f=_0x5e33ac[_0x3f40('0x63')];var _0x4d2aee=squel[_0x3f40('0x5f')]();_0x5a3e5f[_0x3f40('0x36')](function(_0x5939a2){_0x4d2aee['or'](_0x3f40('0x93'),'%,'+_0x5939a2+',%');});_0x187960[_0x3f40('0x8f')](_0x4d2aee);_0xb4e27e[_0x3f40('0x58')](_0x3f40('0x97'),'it',_0x3f40('0x98'));_0xb4e27e[_0x3f40('0x58')](_0x3f40('0x4e'),'t',_0x3f40('0x95'));_0xb4e27e[_0x3f40('0x48')](_0x3f40('0x96'),_0x5a3e5f);}else if(_0x3c670c===_0x3f40('0x69')){if(_0x5e33ac[_0x3f40('0x63')][_0x3f40('0x43')]===0x1){if(_0x5e33ac[_0x3f40('0x63')][0x0]===0x1){_0xb4e27e[_0x3f40('0x8f')]('`unreadMessages`\x20=\x200');_0x187960[_0x3f40('0x8f')](_0x3f40('0x90'));}else{_0xb4e27e[_0x3f40('0x8f')](_0x3f40('0x91'));_0x187960[_0x3f40('0x8f')](_0x3f40('0x91'));}}}});}db[_0x3f40('0x99')]['query'](_0xb4e27e[_0x3f40('0x9a')](),_0xade25c)['then'](function(_0x7d91c7){_0x237c91['count']=_0x7d91c7['length'];if(_0x237c91[_0x3f40('0x29')]===0x0)return[];return db[_0x3f40('0x99')]['query'](_0x851bfc[_0x3f40('0x9a')](),_0xade25c)['then'](function(_0x4acfcb){_0x268ae4=_[_0x3f40('0x9b')](_0x4acfcb,'id');_0xade25c=_[_0x3f40('0x9c')](_0xade25c,{'model':db[_0x3f40('0x3a')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x187960['field']('COUNT(me.id)',_0x3f40('0x69'));_0x187960[_0x3f40('0x4b')]('a.key','Account.key');_0x187960[_0x3f40('0x4b')](_0x3f40('0x9d'));_0x187960[_0x3f40('0x4b')](_0x3f40('0x6f'),_0x3f40('0x9e'));_0x187960[_0x3f40('0x4b')](_0x3f40('0x71'),_0x3f40('0x9f'));_0x187960[_0x3f40('0x4b')](_0x3f40('0x72'),'Contact.email');_0x187960[_0x3f40('0x4b')](_0x3f40('0xa0'),_0x3f40('0xa1'));_0x187960[_0x3f40('0x4b')](_0x3f40('0xa2'),_0x3f40('0xa3'));_0x187960['field'](_0x3f40('0xa4'),'Contact.fax');_0x187960[_0x3f40('0x4b')](_0x3f40('0xa5'),_0x3f40('0x35'));_0x187960['left_join'](_0x3f40('0xa6'),'it',_0x3f40('0x94'));_0x187960[_0x3f40('0x58')](_0x3f40('0x4e'),'t',_0x3f40('0x95'));_0x187960[_0x3f40('0x46')](_0x460237[_0x3f40('0x46')]);_0x187960[_0x3f40('0x2a')](_0x460237['offset']);return db[_0x3f40('0x99')][_0x3f40('0x3e')](_0x187960[_0x3f40('0x9a')](),_0xade25c);})[_0x3f40('0x1d')](function(_0x178f60){_0x551395['where'](_0x3f40('0xa7'),_[_0x3f40('0xa8')](_0x178f60,'id'));return db[_0x3f40('0x99')]['query'](_0x551395[_0x3f40('0x9a')](),_0xade25c)['then'](function(_0x5225b4){var _0x4eb228=_[_0x3f40('0xa9')](_0x5225b4,'ChatInteractionId');var _0x2c48c6=[];_0x178f60['forEach'](function(_0x4c0114){_0x2c48c6['push'](updateChatInteraction(_0x4c0114,_0x268ae4,_0x4eb228));});return BPromise[_0x3f40('0xaa')](_0x2c48c6);});});})[_0x3f40('0x1d')](function(_0x322a0a){_0x237c91['rows']=_0x322a0a;return _0x237c91;})[_0x3f40('0x1d')](respondWithFilteredResult(_0x2a830d,_0x460237))['catch'](handleError(_0x2a830d,null));};exports['show']=function(_0x40fba2,_0x390e1e){var _0x39a849={'raw':![],'where':{'id':_0x40fba2['params']['id']}},_0x540287={};_0x540287[_0x3f40('0x3c')]=_[_0x3f40('0x3d')](db[_0x3f40('0x3a')][_0x3f40('0x3b')]);_0x540287[_0x3f40('0x3e')]=_[_0x3f40('0x3d')](_0x40fba2[_0x3f40('0x3e')]);_0x540287['filters']=_[_0x3f40('0x40')](_0x540287[_0x3f40('0x3c')],_0x540287[_0x3f40('0x3e')]);_0x39a849[_0x3f40('0x41')]=_[_0x3f40('0x40')](_0x540287[_0x3f40('0x3c')],qs[_0x3f40('0x42')](_0x40fba2[_0x3f40('0x3e')][_0x3f40('0x42')]));_0x39a849[_0x3f40('0x41')]=_0x39a849[_0x3f40('0x41')][_0x3f40('0x43')]?_0x39a849[_0x3f40('0x41')]:_0x540287['model'];if(_0x40fba2[_0x3f40('0x3e')][_0x3f40('0xab')]){_0x39a849[_0x3f40('0xac')]=[{'all':!![]}];}_0x39a849=_[_0x3f40('0x9c')]({},_0x39a849,_0x40fba2[_0x3f40('0xad')]);return db[_0x3f40('0x3a')][_0x3f40('0xae')](_0x39a849)['then'](handleEntityNotFound(_0x390e1e,null))[_0x3f40('0x1d')](respondWithResult(_0x390e1e,null))[_0x3f40('0x38')](handleError(_0x390e1e,null));};exports[_0x3f40('0xaf')]=function(_0x28f542,_0x31c206){return db['ChatInteraction']['create'](_0x28f542[_0x3f40('0xb0')],{})['then'](respondWithResult(_0x31c206,0xc9))[_0x3f40('0x38')](handleError(_0x31c206,null));};exports[_0x3f40('0x2f')]=function(_0x856302,_0x517575){if(_0x856302[_0x3f40('0xb0')]['id']){delete _0x856302[_0x3f40('0xb0')]['id'];}return db[_0x3f40('0x3a')][_0x3f40('0xae')]({'where':{'id':_0x856302[_0x3f40('0xb1')]['id']}})[_0x3f40('0x1d')](handleEntityNotFound(_0x517575,null))['then'](saveUpdates(_0x856302[_0x3f40('0xb0')],null))[_0x3f40('0x1d')](respondWithResult(_0x517575,null))[_0x3f40('0x38')](handleError(_0x517575,null));};exports[_0x3f40('0x30')]=function(_0x85efd3,_0x17dbb5){return db[_0x3f40('0x3a')][_0x3f40('0xae')]({'where':{'id':_0x85efd3[_0x3f40('0xb1')]['id']}})[_0x3f40('0x1d')](handleEntityNotFound(_0x17dbb5,null))[_0x3f40('0x1d')](removeEntity(_0x17dbb5,null))[_0x3f40('0x38')](handleError(_0x17dbb5,null));};exports['describe']=function(_0x2cd1c7,_0x544754){return db['ChatInteraction']['describe']()[_0x3f40('0x1d')](respondWithResult(_0x544754,null))[_0x3f40('0x38')](handleError(_0x544754,null));};exports['customUpdate']=function(_0x1a4ff,_0x3e32c2){if(_0x1a4ff[_0x3f40('0xb0')]['id']){delete _0x1a4ff[_0x3f40('0xb0')]['id'];}return db[_0x3f40('0x3a')]['find']({'where':{'id':_0x1a4ff['params']['id']}})['then'](handleEntityNotFound(_0x3e32c2,null))[_0x3f40('0x1d')](saveUpdates(_0x1a4ff['body'],null))['then'](respondWithResult(_0x3e32c2,null))[_0x3f40('0x38')](handleError(_0x3e32c2,null));};exports[_0x3f40('0xb2')]=function(_0x37f585,_0x3ec8c4,_0x5e83b7){if(_0x37f585[_0x3f40('0xb0')]['id']){delete _0x37f585[_0x3f40('0xb0')]['id'];}return db[_0x3f40('0x3a')][_0x3f40('0xae')]({'where':{'id':_0x37f585['params']['id']}})['then'](function(_0x5c68cd){if(!_0x5c68cd){logger['error'](_0x3f40('0xb3'),'abandon',0x194,_0x3f40('0xb4'));_0x3ec8c4[_0x3f40('0x31')](0x194);}else{if(_0x5c68cd[_0x3f40('0xb5')]){throw new db[(_0x3f40('0x8b'))][(_0x3f40('0xb6'))](_0x3f40('0xb7'));}}return _0x5c68cd;})[_0x3f40('0x1d')](function(_0xf17297){if(_0xf17297){return _0xf17297['update']({'closed':_0x37f585[_0x3f40('0xb0')]['closed'],'disposition':_0x37f585[_0x3f40('0xb0')]['disposition']})['then'](function(_0x541ee0){return _0x541ee0;});}})[_0x3f40('0x1d')](function(_0x177631){return respondWithRpcPromise(_0x3f40('0xb8'),'abandon',_0x37f585['body'],client9004);})[_0x3f40('0x1d')](respondWithResult(_0x3ec8c4,null))['catch'](handleError(_0x3ec8c4,null));};exports['attachmentUpload']=function(_0x3b410d,_0x12d9ef,_0x56af8d){_0x3b410d[_0x3f40('0xb0')]['name']=_0x3b410d['file']['originalname'];_0x3b410d['body']['basename']=_0x3b410d[_0x3f40('0xb9')][_0x3f40('0xba')];_0x3b410d[_0x3f40('0xb0')]['type']=_0x3b410d['file'][_0x3f40('0xbb')];return db[_0x3f40('0xbc')]['create'](_0x3b410d['body'])[_0x3f40('0x1d')](respondWithResult(_0x12d9ef,0xc9))['catch'](handleError(_0x12d9ef,null));};exports[_0x3f40('0xbd')]=function(_0x39ec45,_0x549d58,_0x459804){return db[_0x3f40('0x3a')]['findOne']({'where':{'id':_0x39ec45[_0x3f40('0xb1')]['id']},'raw':!![]})[_0x3f40('0x1d')](handleEntityNotFound(_0x549d58,null))[_0x3f40('0x1d')](function(_0x5f32c1){if(_0x5f32c1){if(_0x5f32c1[_0x3f40('0xbe')]){return _0x549d58[_0x3f40('0x26')](0x193)['json']({'status':0x193,'message':_0x3f40('0xbf')});}return db[_0x3f40('0xbc')][_0x3f40('0xc0')]({'where':{'id':_0x39ec45[_0x3f40('0x3e')][_0x3f40('0xc1')]},'raw':!![]})[_0x3f40('0x1d')](handleEntityNotFound(_0x549d58,null));}})[_0x3f40('0x1d')](function(_0x15a224){if(_0x15a224){return _0x549d58['download'](path[_0x3f40('0x85')](config['root'],'server/files/attachments/',_0x15a224[_0x3f40('0xc2')]));}})['catch'](handleError(_0x549d58,null));};exports[_0x3f40('0xc3')]=function(_0x30344a,_0x2acffe){var _0x5b4fcc=null;var _0x219253=null;var _0x434d13=null;var _0xa53845=null;if(_0x30344a[_0x3f40('0xb0')]['id']){delete _0x30344a[_0x3f40('0xb0')]['id'];}if(_0x30344a['body'][_0x3f40('0xc4')]){_0xa53845=path[_0x3f40('0x85')](config[_0x3f40('0xc5')],_0x3f40('0xc6'),util['format'](_0x3f40('0xc7'),Date[_0x3f40('0xc8')]()));_0x30344a[_0x3f40('0xb0')][_0x3f40('0xc9')]=_0xa53845;}return db[_0x3f40('0x3a')][_0x3f40('0xae')]({'where':{'id':_0x30344a[_0x3f40('0xb1')]['id']},'include':[{'model':db[_0x3f40('0xca')],'as':_0x3f40('0xcb'),'include':[{'model':db[_0x3f40('0xcc')],'as':_0x3f40('0xcc')}]}]})[_0x3f40('0x1d')](handleEntityNotFound(_0x2acffe,null))[_0x3f40('0x1d')](saveUpdates(_0x30344a[_0x3f40('0xb0')],null))[_0x3f40('0x1d')](function(_0x4d446f){if(_0x4d446f){_0x5b4fcc=_0x4d446f;return db[_0x3f40('0xcd')][_0x3f40('0xae')]({'where':{'id':_0x5b4fcc['ChatWebsiteId']}});}})['then'](function(_0x3a4edb){if(_0x3a4edb){_0x434d13=_0x3a4edb;return db[_0x3f40('0xce')]['find']({'where':{'id':_0x5b4fcc['ContactId']}});}})[_0x3f40('0x1d')](function(_0x729ac8){if(_0x729ac8){_0x219253=_0x729ac8;if(_0xa53845){var _0x4bbce0=null;for(var _0x8e0d7=0x1;_0x8e0d7<_0x5b4fcc[_0x3f40('0xcb')][_0x3f40('0x43')];++_0x8e0d7){_0x4bbce0=_0x5b4fcc['Messages'][_0x8e0d7];var _0x18aae3=_0x4bbce0[_0x3f40('0xb5')]?util[_0x3f40('0xcf')](_0x3f40('0xd0'),_0x434d13[_0x3f40('0xd1')],_0x4bbce0[_0x3f40('0xb5')]):'System';var _0x3239f8=_0x30344a[_0x3f40('0xb0')][_0x3f40('0xd2')]||util['format'](_0x3f40('0xd0'),'Visitor',_0x4bbce0['ContactId']);switch(_0x434d13[_0x3f40('0xd3')]){case'website_alias':_0x18aae3=_0x4bbce0[_0x3f40('0xb5')]?util[_0x3f40('0xcf')](_0x3f40('0xd0'),_0x434d13[_0x3f40('0xd1')],_0x4bbce0['UserId']):_0x3f40('0xd4');break;case _0x3f40('0xd5'):_0x18aae3=_0x4bbce0[_0x3f40('0xb5')]?_0x4bbce0[_0x3f40('0xcc')]['alias']||_0x4bbce0[_0x3f40('0xcc')][_0x3f40('0xd6')]:'System';break;case _0x3f40('0xd7'):_0x18aae3=_0x4bbce0[_0x3f40('0xb5')]?_0x4bbce0[_0x3f40('0xcc')]['fullname']:_0x3f40('0xd4');break;default:_0x18aae3=_0x4bbce0['UserId']?util['format'](_0x3f40('0xd0'),_0x434d13[_0x3f40('0xd1')],_0x4bbce0['UserId']):_0x3f40('0xd4');}var _0x7d6353=util['format']('[%s]\x20%s:\x20%s\x0a',moment(_0x4bbce0['createdAt'])[_0x3f40('0xcf')](_0x3f40('0xd8')),_0x4bbce0['direction']==='in'?_0x3239f8:_0x18aae3,_0x4bbce0['body']);if(!_0x4bbce0[_0x3f40('0xd9')]){fs[_0x3f40('0xda')](_0xa53845,_0x7d6353);}}return db[_0x3f40('0xdb')][_0x3f40('0xc0')]({'where':{'service':!![]},'include':[{'model':db[_0x3f40('0xdc')],'as':_0x3f40('0xdd'),'raw':!![]}]});}}})[_0x3f40('0x1d')](function(_0x5a4878){if(_0x5a4878&&_0x5a4878['Smtp']&&_0x30344a[_0x3f40('0xb0')]){var _0x55b07b={'tls':{'rejectUnauthorized':![]}};if(_0x5a4878[_0x3f40('0xdd')][_0x3f40('0xde')]){_0x55b07b[_0x3f40('0xde')]=_0x5a4878[_0x3f40('0xdd')]['service'];}else{_0x55b07b['host']=_0x5a4878[_0x3f40('0xdd')][_0x3f40('0xdf')];_0x55b07b[_0x3f40('0xe0')]=_0x5a4878[_0x3f40('0xdd')][_0x3f40('0xe0')];_0x55b07b[_0x3f40('0xe1')]=_0x5a4878[_0x3f40('0xdd')][_0x3f40('0xe1')];}if(_0x5a4878[_0x3f40('0xdd')][_0x3f40('0xe2')]){_0x55b07b[_0x3f40('0xe3')]={'user':_0x5a4878['Smtp']['user'],'pass':_0x5a4878[_0x3f40('0xdd')][_0x3f40('0xe4')]};}return respondWithRpcPromise(_0x3f40('0xe5'),'sendMail',{'account':_0x55b07b,'message':{'from':util[_0x3f40('0xcf')]('\x22%s\x22\x20<%s>',_0x5a4878[_0x3f40('0x33')],_0x5a4878['email']||_0x5a4878[_0x3f40('0xdd')][_0x3f40('0xe6')]),'to':_0x30344a[_0x3f40('0xb0')][_0x3f40('0xc4')],'subject':'Mail\x20Transcript','text':util[_0x3f40('0xcf')](_0x3f40('0xe7'),_0x30344a[_0x3f40('0xb0')][_0x3f40('0xc4')]),'attachments':[{'path':_0xa53845}]}})[_0x3f40('0x1d')](function(){return _0x5b4fcc;})[_0x3f40('0x38')](function(_0x37f8c3){console[_0x3f40('0x23')](_0x37f8c3);});}else{return _0x5b4fcc;}})['then'](respondWithStatusCode(_0x2acffe,0xc8))[_0x3f40('0x38')](handleError(_0x2acffe,null));};exports[_0x3f40('0xe8')]=function(_0x48fb2c,_0x3286bd,_0x2e8dc0){return db['ChatMessage'][_0x3f40('0xae')]({'where':{'id':_0x48fb2c['params']['id']}})['then'](handleEntityNotFound(_0x3286bd,null))[_0x3f40('0x1d')](function(_0x2f19bb){if(_0x2f19bb){return _0x2f19bb[_0x3f40('0xe8')](_0x48fb2c[_0x3f40('0xb0')][_0x3f40('0xe9')],_[_0x3f40('0xea')](_0x48fb2c['body'],[_0x3f40('0xe9'),'id'])||{});}})[_0x3f40('0x1d')](respondWithResult(_0x3286bd,null))[_0x3f40('0x38')](handleError(_0x3286bd,null));};exports[_0x3f40('0xeb')]=function(_0x39b4f0,_0x178822,_0x196c2a){var _0x448109={'raw':![],'where':{}};var _0x3441d3={};var _0x270016={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x3f40('0xc0')]({'where':{'id':_0x39b4f0[_0x3f40('0xb1')]['id']}})['then'](handleEntityNotFound(_0x178822,null))[_0x3f40('0x1d')](function(_0x22cb05){if(_0x22cb05){_0x3441d3[_0x3f40('0x3c')]=_['keys'](db[_0x3f40('0xca')][_0x3f40('0x3b')]);_0x3441d3[_0x3f40('0x3e')]=_[_0x3f40('0x3d')](_0x39b4f0[_0x3f40('0x3e')]);_0x3441d3[_0x3f40('0x3f')]=_[_0x3f40('0x40')](_0x3441d3[_0x3f40('0x3c')],_0x3441d3[_0x3f40('0x3e')]);_0x448109[_0x3f40('0x41')]=_['intersection'](_0x3441d3[_0x3f40('0x3c')],qs[_0x3f40('0x42')](_0x39b4f0[_0x3f40('0x3e')]['fields']));_0x448109[_0x3f40('0x41')]=_0x448109[_0x3f40('0x41')][_0x3f40('0x43')]?_0x448109['attributes']:_0x3441d3[_0x3f40('0x3c')];if(!_0x39b4f0[_0x3f40('0x3e')][_0x3f40('0x44')](_0x3f40('0x45'))){_0x448109[_0x3f40('0x46')]=qs[_0x3f40('0x46')](_0x39b4f0[_0x3f40('0x3e')][_0x3f40('0x46')]);_0x448109[_0x3f40('0x2a')]=qs['offset'](_0x39b4f0[_0x3f40('0x3e')][_0x3f40('0x2a')]);}_0x448109[_0x3f40('0x87')]=qs['sort'](_0x39b4f0[_0x3f40('0x3e')][_0x3f40('0x47')]);_0x448109[_0x3f40('0x48')]=qs[_0x3f40('0x3f')](_[_0x3f40('0x49')](_0x39b4f0['query'],_0x3441d3['filters']));_0x448109['where']['ChatInteractionId']=_0x22cb05['id'];if(_0x39b4f0[_0x3f40('0x3e')][_0x3f40('0x77')]){_0x448109[_0x3f40('0x48')]=_[_0x3f40('0x9c')](_0x448109[_0x3f40('0x48')],{'$or':_[_0x3f40('0xa8')](_0x448109[_0x3f40('0x41')],function(_0x392e8b){var _0x56c2d4={};_0x56c2d4[_0x392e8b]={'$like':'%'+_0x39b4f0[_0x3f40('0x3e')][_0x3f40('0x77')]+'%'};return _0x56c2d4;})});}if(_0x39b4f0[_0x3f40('0x3e')]['$gte']){var _0x193783=_0x39b4f0[_0x3f40('0x3e')]['$gte'][_0x3f40('0x84')](',');var _0x483196={};_0x483196[_0x193783[0x0]]={'$gte':moment(_0x193783[0x1])[_0x3f40('0xcf')](_0x3f40('0xec'))};_0x448109[_0x3f40('0x48')]=_[_0x3f40('0x9c')](_0x448109[_0x3f40('0x48')],_0x483196);}_0x448109=_[_0x3f40('0x9c')]({},_0x448109,_0x39b4f0['options']);return db[_0x3f40('0xca')][_0x3f40('0x29')]({'where':_0x448109[_0x3f40('0x48')]})[_0x3f40('0x1d')](function(_0x4eb579){_0x270016[_0x3f40('0x29')]=_0x4eb579;if(_0x39b4f0['query']['includeAll']){_0x448109[_0x3f40('0xac')]=[{'all':!![]}];}return db[_0x3f40('0xca')]['findAll'](_0x448109);})[_0x3f40('0x1d')](function(_0xc9b7f1){_0x270016[_0x3f40('0xed')]=_0xc9b7f1;return _0x270016;});}})[_0x3f40('0x1d')](respondWithFilteredResult(_0x178822,_0x448109))[_0x3f40('0x38')](handleError(_0x178822,null));};exports['getMyMessages']=function(_0x4f807c,_0xcf744d,_0x509471){var _0x109e7b={'where':{}},_0x5cf8c4={},_0x556b23={'count':0x0,'rows':[]};return db[_0x3f40('0x3a')][_0x3f40('0xc0')]({'where':{'id':_0x4f807c[_0x3f40('0xb1')]['id']}})[_0x3f40('0x1d')](handleEntityNotFound(_0xcf744d,null))['then'](function(_0x2a3c61){if(_0x2a3c61){_0x5cf8c4[_0x3f40('0x3c')]=_['keys'](db[_0x3f40('0xca')][_0x3f40('0x3b')]);_0x5cf8c4[_0x3f40('0x3e')]=_[_0x3f40('0x3d')](_0x4f807c[_0x3f40('0x3e')]);_0x5cf8c4['filters']=_['intersection'](_0x5cf8c4[_0x3f40('0x3c')],_0x5cf8c4['query']);_0x109e7b[_0x3f40('0x41')]=_[_0x3f40('0x40')](_0x5cf8c4[_0x3f40('0x3c')],qs[_0x3f40('0x42')](_0x4f807c[_0x3f40('0x3e')][_0x3f40('0x42')]));_0x109e7b[_0x3f40('0x41')]=_0x109e7b[_0x3f40('0x41')][_0x3f40('0x43')]?_0x109e7b[_0x3f40('0x41')]:_0x5cf8c4['model'];if(!_0x4f807c[_0x3f40('0x3e')][_0x3f40('0x44')]('nolimit')){_0x109e7b[_0x3f40('0x46')]=qs[_0x3f40('0x46')](_0x4f807c[_0x3f40('0x3e')][_0x3f40('0x46')]);_0x109e7b[_0x3f40('0x2a')]=qs[_0x3f40('0x2a')](_0x4f807c[_0x3f40('0x3e')][_0x3f40('0x2a')]);}_0x109e7b[_0x3f40('0x87')]=qs[_0x3f40('0x47')](_0x4f807c[_0x3f40('0x3e')][_0x3f40('0x47')]);_0x109e7b['where']=qs[_0x3f40('0x3f')](_[_0x3f40('0x49')](_0x4f807c['query'],_0x5cf8c4[_0x3f40('0x3f')]));_0x109e7b[_0x3f40('0x48')]['ChatInteractionId']=_0x2a3c61['id'];if(_0x4f807c[_0x3f40('0x3e')][_0x3f40('0x77')]){_0x109e7b[_0x3f40('0x48')]=_['merge'](_0x109e7b[_0x3f40('0x48')],{'$or':_[_0x3f40('0xa8')](_0x109e7b[_0x3f40('0x41')],function(_0x49a481){var _0xe5536c={};_0xe5536c[_0x49a481]={'$like':'%'+_0x4f807c[_0x3f40('0x3e')][_0x3f40('0x77')]+'%'};return _0xe5536c;})});}_0x109e7b[_0x3f40('0x48')][_0x3f40('0xd9')]=![];if(_0x4f807c[_0x3f40('0x3e')]['id']){_0x109e7b[_0x3f40('0x48')]['id']={'$gt':_0x4f807c[_0x3f40('0x3e')]['id']};}_0x109e7b=_['merge']({},_0x109e7b,_0x4f807c[_0x3f40('0xad')]);return db[_0x3f40('0xca')][_0x3f40('0x29')]({'where':_0x109e7b[_0x3f40('0x48')]})[_0x3f40('0x1d')](function(_0x5855ef){_0x556b23[_0x3f40('0x29')]=_0x5855ef;_0x109e7b[_0x3f40('0xac')]=[];if(_0x4f807c[_0x3f40('0x3e')][_0x3f40('0xee')]){_0x109e7b['include'][_0x3f40('0xef')]({'model':db[_0x3f40('0xcc')],'as':'User','attributes':['id','fullname',_0x3f40('0xf0')]});}if(_0x4f807c[_0x3f40('0x3e')][_0x3f40('0xab')]){_0x109e7b[_0x3f40('0xac')]=[{'all':!![]}];}return db[_0x3f40('0xca')][_0x3f40('0xf1')](_0x109e7b);})[_0x3f40('0x1d')](function(_0x3410a6){_0x556b23[_0x3f40('0xed')]=_0x3410a6;return _0x556b23;});}})[_0x3f40('0x1d')](respondWithFilteredResult(_0xcf744d,_0x109e7b))[_0x3f40('0x38')](handleError(_0xcf744d,null));};exports[_0x3f40('0xf2')]=function(_0x3a12e1,_0x3c18cd,_0x220998){return db[_0x3f40('0x3a')][_0x3f40('0xae')]({'where':{'id':_0x3a12e1[_0x3f40('0xb1')]['id']}})[_0x3f40('0x1d')](handleEntityNotFound(_0x3c18cd,null))[_0x3f40('0x1d')](function(_0x39a932){if(_0x39a932){return _0x39a932[_0x3f40('0xf3')](_0x3a12e1[_0x3f40('0xb0')]['ids'],_[_0x3f40('0xea')](_0x3a12e1[_0x3f40('0xb0')],['ids','id'])||{})[_0x3f40('0xf4')](function(){return db[_0x3f40('0xf5')][_0x3f40('0xf1')]({'attributes':['id',_0x3f40('0x33'),'color'],'where':{'id':_0x3a12e1[_0x3f40('0xb0')][_0x3f40('0xe9')]}});})[_0x3f40('0x1d')](function(_0x1e3b09){socket['emit'](_0x3f40('0xf6'),{'id':Number(_0x3a12e1[_0x3f40('0xb1')]['id']),'tags':_0x1e3b09||[]});return{'id':Number(_0x3a12e1[_0x3f40('0xb1')]['id']),'tags':_0x1e3b09||[]};});}})['then'](respondWithResult(_0x3c18cd,null))[_0x3f40('0x38')](handleError(_0x3c18cd,null));};exports[_0x3f40('0xf7')]=function(_0x438622,_0x46b7b5,_0x194b50){return db[_0x3f40('0x3a')]['find']({'where':{'id':_0x438622[_0x3f40('0xb1')]['id']}})['then'](handleEntityNotFound(_0x46b7b5,null))[_0x3f40('0x1d')](function(_0x481573){if(_0x481573){return _0x481573[_0x3f40('0xf7')](_0x438622['query'][_0x3f40('0xe9')]);}})['then'](respondWithStatusCode(_0x46b7b5,null))[_0x3f40('0x38')](handleError(_0x46b7b5,null));};exports['download']=function(_0x15222b,_0x410d35){var _0x98688c=moment()[_0x3f40('0xf8')]()[_0x3f40('0x9a')]();var _0x1072aa=path['join'](config[_0x3f40('0xc5')],_0x3f40('0xf9'),_0x3f40('0xfa'),_0x3f40('0xfb'));var _0xaa2363=path[_0x3f40('0x85')](config[_0x3f40('0xc5')],_0x3f40('0xf9'),_0x3f40('0xfa'),'attachments');var _0x150b2e=path['join'](_0x1072aa,_0x98688c);var _0x5ff6b6=util[_0x3f40('0xcf')](_0x3f40('0xfc'),_0x15222b[_0x3f40('0xb1')]['id'],_0x98688c);var _0x4ac90f=path['join'](_0x1072aa,_0x5ff6b6);var _0x34569a=![];return db[_0x3f40('0x3a')][_0x3f40('0xae')]({'where':{'id':_0x15222b[_0x3f40('0xb1')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x3f40('0xcb'),'attributes':['id',_0x3f40('0xb0'),_0x3f40('0x62'),_0x3f40('0xfd'),'secret'],'include':[{'model':db[_0x3f40('0xcc')],'as':_0x3f40('0xcc'),'attributes':['id',_0x3f40('0xd6')],'raw':!![]},{'model':db[_0x3f40('0xce')],'as':'Contact','attributes':['id',_0x3f40('0xfe'),'lastName'],'raw':!![]},{'model':db[_0x3f40('0xbc')],'as':_0x3f40('0xbc'),'raw':!![]}]},{'model':db[_0x3f40('0xcd')],'as':'Account','attributes':['id',_0x3f40('0x33')]},{'model':db['User'],'as':_0x3f40('0xff'),'attributes':['id',_0x3f40('0xd6')]}]})['then'](handleEntityNotFound(_0x410d35,null))[_0x3f40('0x1d')](function(_0x5722e5){if(_0x5722e5){var _0x32a0a9=_0x5722e5['get']({'plain':!![]});_0x34569a=!![];var _0x505c9f={'format':'A4','border':_0x3f40('0x100'),'header':{'height':_0x3f40('0x101'),'contents':{'first':'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'}},'footer':{'height':'30px','contents':{'default':util[_0x3f40('0xcf')](_0x3f40('0x102'),util[_0x3f40('0xcf')]('%s\x20#%d',_0x3f40('0x103'),_0x32a0a9['id']),moment()[_0x3f40('0xcf')](_0x3f40('0x104'))[_0x3f40('0x9a')]())}}};fs[_0x3f40('0x105')](_0x150b2e);var _0x487e59={'channel':_0x3f40('0x103'),'account':_0x32a0a9[_0x3f40('0x106')][_0x3f40('0x33')],'agent':_0x32a0a9[_0x3f40('0xff')]?_0x32a0a9[_0x3f40('0xff')][_0x3f40('0xd6')]:_0x3f40('0x107'),'createdAt':moment(_0x32a0a9[_0x3f40('0x62')])['format'](_0x3f40('0xec'))[_0x3f40('0x9a')](),'closedAt':_0x32a0a9[_0x3f40('0xbe')]?moment(_0x32a0a9[_0x3f40('0x108')])['format'](_0x3f40('0xec'))[_0x3f40('0x9a')]():'','disposition':_0x32a0a9[_0x3f40('0x109')],'chatInfo':{'browser':_0x32a0a9[_0x3f40('0x10a')],'os':_0x32a0a9['osName'],'referer':_0x32a0a9[_0x3f40('0x10b')],'customerIp':_0x32a0a9[_0x3f40('0x10c')]},'messages':_(_0x32a0a9['Messages'])[_0x3f40('0x10d')]()[_0x3f40('0x77')]({'secret':![]})[_0x3f40('0xa8')](function(_0x351059){if(_0x351059[_0x3f40('0xbc')]){var _0x387317=path[_0x3f40('0x85')](_0xaa2363,_0x351059[_0x3f40('0xbc')][_0x3f40('0xc2')]);if(fs[_0x3f40('0x10e')](_0x387317)){fs['createReadStream'](_0x387317)[_0x3f40('0x10f')](fs[_0x3f40('0x110')](path[_0x3f40('0x85')](_0x150b2e,_0x351059['Attachment'][_0x3f40('0xc2')])));}}return{'date':moment(_0x351059[_0x3f40('0x62')])['format'](_0x3f40('0xec'))[_0x3f40('0x9a')](),'sender':_0x351059[_0x3f40('0xfd')]===_0x3f40('0x111')?_0x351059['User']?_0x351059[_0x3f40('0xcc')]['fullname']:_0x3f40('0xd4'):_0x351059['Contact']['firstName']+(_0x351059['Contact']['lastName']?'\x20'+_0x351059[_0x3f40('0x112')][_0x3f40('0x113')]:''),'body':_0x351059[_0x3f40('0xbc')]?_0x351059['Attachment'][_0x3f40('0xc2')]:_0x351059['body'],'direction':_0x351059[_0x3f40('0xfd')]===_0x3f40('0x111')?'A':'C','secret':_0x351059[_0x3f40('0xd9')],'attachment':_0x351059[_0x3f40('0xbc')]};})[_0x3f40('0x63')]()};return ejs[_0x3f40('0x114')](path['join'](config['root'],_0x3f40('0xf9'),_0x3f40('0x115'),'downloadInteraction.html'),{'interaction':_0x487e59})[_0x3f40('0x1d')](function(_0x3f9306){return new BPromise(function(_0x16268f,_0x32bd44){pdf['create'](_0x3f9306,_0x505c9f)[_0x3f40('0x116')](path[_0x3f40('0x85')](_0x150b2e,'transcript-'+_0x32a0a9['id']+'-'+_0x98688c+_0x3f40('0x117')),function(_0x2edc8d,_0x3d180e){if(_0x2edc8d)return _0x32bd44(_0x2edc8d);_0x16268f(_0x3d180e);});});});}})['then'](function(){if(_0x34569a){return new BPromise(function(_0x2190d2,_0x276bf0){zipdir(_0x150b2e,{'saveTo':_0x4ac90f},function(_0x2e7688,_0x4e769e){if(_0x2e7688)return _0x276bf0(_0x2e7688);return _0x2190d2(_0x4e769e);});})[_0x3f40('0x1d')](function(){return new BPromise(function(_0x16a660,_0x44ed57){rimraf(_0x150b2e,function(_0x566183){if(_0x566183)_0x44ed57(_0x566183);return _0x16a660();});});})[_0x3f40('0x1d')](function(){return _0x410d35[_0x3f40('0x118')](_0x4ac90f,_0x5ff6b6,function(_0x502483){if(_0x502483){console[_0x3f40('0x119')](_0x3f40('0x11a'),_0x502483);}else{fs[_0x3f40('0x11b')](_0x4ac90f);}});});}else{return _0x410d35[_0x3f40('0x31')](0xc8);}})[_0x3f40('0x38')](handleError(_0x410d35,null));}; \ No newline at end of file +var _0x32ef=['message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','map','TagIds','Tags','forEach','push','index','ChatInteraction','rawAttributes','keys','query','filters','intersection','attributes','model','fields','length','order','sort','where','field','color','from','select','COUNT(*)','chat_messages','me.ChatInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','ui.ChatInteractionId','user_has_chat_interactions','left_join','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','me.ChatInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false','expr','advancedFilter','parse','createdAt','value','dateStart','startOf','utc','format','day','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','TagId','unreadMessages','\x20IN\x20?','tableAlias','\x20=\x20?','ContactId','c.firstName','\x20LIKE\x20?','c.email','\x20<\x20?','LIKE','\x20>\x20?','hasOwnProperty','filter','isNil','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','$lte','null','replace','\x27\x27\x27\x27','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','DESC','i.id','Sequelize','SELECT','clone','COUNT(me.id)','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','it.MailInteractionId\x20=\x20i.id','sequelize','toString','keyBy','Account.key','i.*','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','ui.ChatInteractionId\x20IN\x20?','groupBy','all','rows','params','includeAll','include','create','body','find','describe','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','ValidationError','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','file','originalname','basename','filename','type','Attachment','attachmentDownload','Unauthorized','attachId','download','close','mailTranscript','transcript-%s.txt','now','User','ChatWebsite','CmContact','Messages','UserId','%s%d','agentAlias','customer','Visitor','agentIdentifier','website_alias','System','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','MailAccount','MailServerOut','Smtp','service','port','secure','authentication','auth','pass','sendMail','\x22%s\x22\x20<%s>','user','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','ChatMessage','ids','omit','findOne','nolimit','pick','ChatInteractionId','$gte','options','getMyMessages','secret','merge','includeAgent','alias','findAll','addTags','setTags','emit','chatInteractionTags:save','removeTags','unix','server','files','tmp','root','attachments','transcript-%d-%s.zip','direction','firstName','lastName','Account','Owner','get','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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','YYYY-MM-DD','mkdirSync','Chat','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','osName','customerIp','existsSync','pipe','Contact','out','renderFile','views','downloadInteraction.html','transcript-','.pdf','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x10f367,_0x23b2b5){var _0x6f4a85=function(_0x3719ce){while(--_0x3719ce){_0x10f367['push'](_0x10f367['shift']());}};_0x6f4a85(++_0x23b2b5);}(_0x32ef,0xf9));var _0xf32e=function(_0xe9be57,_0x531a26){_0xe9be57=_0xe9be57-0x0;var _0x1b92e1=_0x32ef[_0xe9be57];return _0x1b92e1;};'use strict';var pdf=require(_0xf32e('0x0'));var emlformat=require(_0xf32e('0x1'));var rimraf=require(_0xf32e('0x2'));var zipdir=require(_0xf32e('0x3'));var jsonpatch=require(_0xf32e('0x4'));var rp=require(_0xf32e('0x5'));var moment=require('moment');var BPromise=require(_0xf32e('0x6'));var Mustache=require(_0xf32e('0x7'));var util=require('util');var path=require(_0xf32e('0x8'));var sox=require(_0xf32e('0x9'));var csv=require(_0xf32e('0xa'));var ejs=require(_0xf32e('0xb'));var fs=require('fs');var _=require(_0xf32e('0xc'));var squel=require(_0xf32e('0xd'));var crypto=require('crypto');var jsforce=require(_0xf32e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf32e('0xa'));var querystring=require(_0xf32e('0xf'));var Papa=require(_0xf32e('0x10'));var Redis=require(_0xf32e('0x11'));var authService=require(_0xf32e('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xf32e('0x13'));var logger=require(_0xf32e('0x14'))(_0xf32e('0x15'));var utils=require(_0xf32e('0x16'));var config=require(_0xf32e('0x17'));var db=require(_0xf32e('0x18'))['db'];config[_0xf32e('0x19')]=_[_0xf32e('0x1a')](config[_0xf32e('0x19')],{'host':_0xf32e('0x1b'),'port':0x18eb});var socket=require(_0xf32e('0x1c'))(new Redis(config['redis']));require(_0xf32e('0x1d'))[_0xf32e('0x1e')](socket);var jayson=require(_0xf32e('0x1f'));var client=jayson[_0xf32e('0x20')][_0xf32e('0x21')]({'port':0x232b});var client9004=jayson[_0xf32e('0x20')]['http']({'port':0x232c});function checkPasswordPattern(_0xe324ad,_0x299efa,_0x1dd008){if(_0x1dd008){var _0x400d25=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x400d25[_0xf32e('0x22')](_0x299efa)){return _0xe324ad;}else{throw new Error(_0xf32e('0x23'));}}else{return _0xe324ad;}}function respondWithRpcPromise(_0x6a0231,_0x2c092d,_0x21aa73,_0x4caac5){return new BPromise(function(_0x3510ec,_0xc47a9){var _0xb828b8=_0x4caac5||client;return _0xb828b8[_0xf32e('0x24')](_0x6a0231,_0x21aa73)[_0xf32e('0x25')](function(_0x1f7a5e){logger[_0xf32e('0x26')](_0xf32e('0x27'),_0x2c092d,_0xf32e('0x28'));logger[_0xf32e('0x29')](_0xf32e('0x2a'),_0x2c092d,_0xf32e('0x28'),JSON[_0xf32e('0x2b')](_0x1f7a5e));if(_0x1f7a5e[_0xf32e('0x2c')]){if(_0x1f7a5e[_0xf32e('0x2c')]['code']===0x1f4){logger[_0xf32e('0x2c')]('ChatInteraction,\x20%s,\x20%s',_0x2c092d,_0x1f7a5e[_0xf32e('0x2c')][_0xf32e('0x2d')]);return _0xc47a9(_0x1f7a5e[_0xf32e('0x2c')][_0xf32e('0x2d')]);}logger[_0xf32e('0x2c')]('ChatInteraction,\x20%s,\x20%s',_0x2c092d,_0x1f7a5e[_0xf32e('0x2c')][_0xf32e('0x2d')]);return _0x3510ec(_0x1f7a5e[_0xf32e('0x2c')][_0xf32e('0x2d')]);}else{logger['info'](_0xf32e('0x27'),_0x2c092d,_0xf32e('0x28'));_0x3510ec(_0x1f7a5e[_0xf32e('0x2e')][_0xf32e('0x2d')]);}})[_0xf32e('0x2f')](function(_0x15103f){logger[_0xf32e('0x2c')](_0xf32e('0x27'),_0x2c092d,_0x15103f);_0xc47a9(_0x15103f);});});}function respondWithStatusCode(_0x237c72,_0x29be62){_0x29be62=_0x29be62||0xcc;return function(_0x488489){if(_0x488489){return _0x237c72[_0xf32e('0x30')](_0x29be62);}return _0x237c72[_0xf32e('0x31')](_0x29be62)[_0xf32e('0x32')]();};}function respondWithResult(_0x4a873c,_0x419d13){_0x419d13=_0x419d13||0xc8;return function(_0x5bc6f2){if(_0x5bc6f2){return _0x4a873c[_0xf32e('0x31')](_0x419d13)['json'](_0x5bc6f2);}};}function respondWithFilteredResult(_0x439143,_0x39965e){return function(_0x3e42ac){if(_0x3e42ac){var _0xf42594=_0x3e42ac[_0xf32e('0x33')],_0x32a74b=_0x39965e[_0xf32e('0x34')],_0x4e64d4=_0x39965e['offset']+_0x39965e[_0xf32e('0x35')],_0x2e2ea4;if(_0x4e64d4>=_0xf42594){_0x4e64d4=_0xf42594;_0x2e2ea4=0xc8;}else{_0x2e2ea4=0xce;}_0x439143[_0xf32e('0x31')](_0x2e2ea4);return _0x439143[_0xf32e('0x36')](_0xf32e('0x37'),_0x32a74b+'-'+_0x4e64d4+'/'+_0xf42594)[_0xf32e('0x38')](_0x3e42ac);}return null;};}function patchUpdates(_0x3f4362){return function(_0x146b52){try{jsonpatch[_0xf32e('0x39')](_0x146b52,_0x3f4362,!![]);}catch(_0x2e580c){return BPromise[_0xf32e('0x3a')](_0x2e580c);}return _0x146b52[_0xf32e('0x3b')]();};}function saveUpdates(_0x45524d,_0xe36079){return function(_0x5c04ae){if(_0x5c04ae){return _0x5c04ae[_0xf32e('0x3c')](_0x45524d)['then'](function(_0x576446){return _0x576446;});}return null;};}function removeEntity(_0x529b70,_0x565552){return function(_0x45ebcf){if(_0x45ebcf){return _0x45ebcf[_0xf32e('0x3d')]()[_0xf32e('0x25')](function(){_0x529b70[_0xf32e('0x31')](0xcc)[_0xf32e('0x32')]();});}};}function handleEntityNotFound(_0x47fcf9,_0x4432de){return function(_0x39cc2b){if(!_0x39cc2b){_0x47fcf9[_0xf32e('0x30')](0x194);}return _0x39cc2b;};}function handleError(_0xc9b274,_0x4a775c){_0x4a775c=_0x4a775c||0x1f4;return function(_0x230025){logger[_0xf32e('0x2c')](_0x230025[_0xf32e('0x3e')]);if(_0x230025[_0xf32e('0x3f')]){delete _0x230025[_0xf32e('0x3f')];}_0xc9b274['status'](_0x4a775c)[_0xf32e('0x40')](_0x230025);};}function getInteractionUsers(_0x6d2794,_0x44418a){return new BPromise(function(_0x4b0088,_0x1723e8){try{if(_0x44418a[_0x6d2794['id']]){_0x6d2794['Users']=_[_0xf32e('0x41')](_0x44418a[_0x6d2794['id']],function(_0x113b11){return{'id':_0x113b11['id']};});}}catch(_0x1566d9){_0x1723e8(_0x1566d9);}_0x4b0088(_0x6d2794);});}function getInteractionTags(_0x5934ed,_0x409701){return new BPromise(function(_0x3a156b,_0x218d95){try{if(_0x5934ed[_0xf32e('0x42')]){_0x5934ed[_0xf32e('0x43')]=[];_0x5934ed[_0xf32e('0x42')]['split'](',')[_0xf32e('0x44')](function(_0x26ef18){_0x5934ed[_0xf32e('0x43')][_0xf32e('0x45')](_0x409701[_0x26ef18]);});}delete _0x5934ed[_0xf32e('0x42')];}catch(_0x4d23f5){_0x218d95(_0x4d23f5);}_0x3a156b(_0x5934ed);});}function updateChatInteraction(_0x399a04,_0x56bf88,_0x19a251){return new BPromise(function(_0x160a30,_0x41fbb1){return getInteractionUsers(_0x399a04,_0x19a251)[_0xf32e('0x25')](function(_0x1576a1){return getInteractionTags(_0x1576a1,_0x56bf88);})[_0xf32e('0x25')](function(_0xb9d562){_0x160a30(_0xb9d562);})['catch'](function(_0x1b38d7){_0x41fbb1(_0x1b38d7);});});}exports[_0xf32e('0x46')]=function(_0x2a36a3,_0x1ad978){var _0x417a90={},_0x453e24={},_0x1bff7b={'count':0x0,'rows':[]};var _0x3ce422=db[_0xf32e('0x47')][_0xf32e('0x48')];_0x453e24['model']=_[_0xf32e('0x49')](_0x3ce422);_0x453e24[_0xf32e('0x4a')]=_[_0xf32e('0x49')](_0x2a36a3[_0xf32e('0x4a')]);_0x453e24[_0xf32e('0x4b')]=_[_0xf32e('0x4c')](_0x453e24['model'],_0x453e24[_0xf32e('0x4a')]);_0x417a90[_0xf32e('0x4d')]=_[_0xf32e('0x4c')](_0x453e24[_0xf32e('0x4e')],qs[_0xf32e('0x4f')](_0x2a36a3['query'][_0xf32e('0x4f')]));_0x417a90['attributes']=_0x417a90[_0xf32e('0x4d')][_0xf32e('0x50')]?_0x417a90['attributes']:_0x453e24[_0xf32e('0x4e')];if(!_0x2a36a3['query']['hasOwnProperty']('nolimit')){_0x417a90[_0xf32e('0x35')]=qs[_0xf32e('0x35')](_0x2a36a3[_0xf32e('0x4a')][_0xf32e('0x35')]);_0x417a90[_0xf32e('0x34')]=qs[_0xf32e('0x34')](_0x2a36a3[_0xf32e('0x4a')][_0xf32e('0x34')]);}_0x417a90[_0xf32e('0x51')]=qs[_0xf32e('0x52')](_0x2a36a3[_0xf32e('0x4a')][_0xf32e('0x52')]);_0x417a90[_0xf32e('0x53')]=qs[_0xf32e('0x4b')](_['pick'](_0x2a36a3[_0xf32e('0x4a')],_0x453e24[_0xf32e('0x4b')]));var _0xc83c9f=[];var _0x4b15be=squel['select']()['field']('id')[_0xf32e('0x54')](_0xf32e('0x3f'))['field'](_0xf32e('0x55'))[_0xf32e('0x56')]('tools_tags');var _0x5b1841=squel[_0xf32e('0x57')]()[_0xf32e('0x54')](_0xf32e('0x58'))[_0xf32e('0x56')](_0xf32e('0x59'),'me')['where'](_0xf32e('0x5a'))[_0xf32e('0x53')](_0xf32e('0x5b'))['where'](_0xf32e('0x5c'));var _0xfd3f05=squel[_0xf32e('0x57')]()['field']('u.id')['field'](_0xf32e('0x5d'))[_0xf32e('0x56')](_0xf32e('0x5e'),'ui')[_0xf32e('0x5f')]('users','u',_0xf32e('0x60'));var _0x3ff3c9=squel[_0xf32e('0x57')]()[_0xf32e('0x56')](_0xf32e('0x61'),'i')['left_join'](_0xf32e('0x62'),'c',_0xf32e('0x63'))[_0xf32e('0x5f')](_0xf32e('0x64'),'o','o.id\x20=\x20i.UserId')[_0xf32e('0x5f')]('chat_websites','a','a.id\x20=\x20i.ChatWebsiteId')[_0xf32e('0x5f')](_0xf32e('0x59'),'me',_0xf32e('0x65'));var _0x391cbc=squel[_0xf32e('0x66')]();if(_0x2a36a3[_0xf32e('0x4a')][_0xf32e('0x67')]){var _0x2b8ea1=JSON[_0xf32e('0x68')](_0x2a36a3[_0xf32e('0x4a')][_0xf32e('0x67')]);_[_0xf32e('0x49')](_0x2b8ea1)['forEach'](function(_0x5867f){var _0x5d81d0=_0x2b8ea1[_0x5867f];if(_0x5867f===_0xf32e('0x69')){var _0x4babd7=moment(_0x5d81d0[_0xf32e('0x6a')][_0xf32e('0x6b')])[_0xf32e('0x6c')]('day')[_0xf32e('0x6d')]()[_0xf32e('0x6e')]();var _0x500bfb=moment(_0x500bfb)['utc']()['endOf'](_0xf32e('0x6f'))[_0xf32e('0x6e')]();_0x391cbc[_0xf32e('0x70')](_0xf32e('0x71'),_0x4babd7,_0x500bfb);}else{if(_[_0xf32e('0x72')](_0x5d81d0[_0xf32e('0x73')])){_0x5d81d0['condition'][_0xf32e('0x44')](function(_0x5afdee){switch(_0x5d81d0[_0xf32e('0x73')][_0xf32e('0x6a')]){case'IS':if(_0x5867f!==_0xf32e('0x74')&&_0x5867f!==_0xf32e('0x75')){if(_['isArray'](_0x5d81d0[_0xf32e('0x6a')])&&_0x5d81d0[_0xf32e('0x6a')]['length']>0x1){_0x391cbc[_0xf32e('0x70')](_0x5d81d0['tableAlias']+'.'+_0x5867f+_0xf32e('0x76'),_0x5d81d0[_0xf32e('0x6a')]);}else{_0x391cbc[_0xf32e('0x70')](_0x5d81d0[_0xf32e('0x77')]+'.'+_0x5867f+_0xf32e('0x78'),_0x5d81d0['value'][0x0]);}}break;case'=':_0x391cbc[_0xf32e('0x70')](_0x5d81d0[_0xf32e('0x77')]+'.'+_0x5867f+_0xf32e('0x78'),_0x5d81d0[_0xf32e('0x6a')]);break;case'LIKE':if(_0x5867f===_0xf32e('0x79')){_0x391cbc[_0xf32e('0x70')](_0xf32e('0x7a')+'\x20LIKE\x20?','%'+_0x5d81d0[_0xf32e('0x6a')]+'%');_0x391cbc['or']('c.lastName'+_0xf32e('0x7b'),'%'+_0x5d81d0[_0xf32e('0x6a')]+'%');_0x391cbc['or'](_0xf32e('0x7c')+_0xf32e('0x7b'),'%'+_0x5d81d0[_0xf32e('0x6a')]+'%');}else{_0x391cbc[_0xf32e('0x70')](_0x5d81d0[_0xf32e('0x77')]+'.'+_0x5867f+_0xf32e('0x7b'),'%'+_0x5d81d0[_0xf32e('0x6a')]+'%');}break;case'>':_0x391cbc[_0xf32e('0x70')](_0x5d81d0[_0xf32e('0x77')]+'.'+_0x5867f+'\x20>\x20?',_0x5d81d0[_0xf32e('0x6a')]);break;case'<':_0x391cbc[_0xf32e('0x70')](_0x5d81d0[_0xf32e('0x77')]+'.'+_0x5867f+_0xf32e('0x7d'),_0x5d81d0['value']);break;}});}else{switch(_0x5d81d0['condition']['value']){case'IS':if(_0x5867f!=='TagId'&&_0x5867f!==_0xf32e('0x75')){if(_[_0xf32e('0x72')](_0x5d81d0[_0xf32e('0x6a')])&&_0x5d81d0[_0xf32e('0x6a')][_0xf32e('0x50')]>0x1){_0x391cbc[_0xf32e('0x70')](_0x5d81d0['tableAlias']+'.'+_0x5867f+_0xf32e('0x76'),_0x5d81d0[_0xf32e('0x6a')]);}else{_0x391cbc[_0xf32e('0x70')](_0x5d81d0['tableAlias']+'.'+_0x5867f+'\x20=\x20?',_0x5d81d0['value'][0x0]);}}break;case'=':_0x391cbc['and'](_0x5d81d0[_0xf32e('0x77')]+'.'+_0x5867f+_0xf32e('0x78'),_0x5d81d0[_0xf32e('0x6a')]);break;case _0xf32e('0x7e'):if(_0x5867f==='ContactId'){_0x391cbc[_0xf32e('0x70')](_0xf32e('0x7a')+_0xf32e('0x7b'),'%'+_0x5d81d0[_0xf32e('0x6a')]+'%');_0x391cbc['or']('c.lastName'+_0xf32e('0x7b'),'%'+_0x5d81d0[_0xf32e('0x6a')]+'%');_0x391cbc['or'](_0xf32e('0x7c')+_0xf32e('0x7b'),'%'+_0x5d81d0[_0xf32e('0x6a')]+'%');}else{_0x391cbc[_0xf32e('0x70')](_0x5d81d0[_0xf32e('0x77')]+'.'+_0x5867f+'\x20LIKE\x20?','%'+_0x5d81d0['value']+'%');}break;case'>':_0x391cbc[_0xf32e('0x70')](_0x5d81d0[_0xf32e('0x77')]+'.'+_0x5867f+_0xf32e('0x7f'),_0x5d81d0[_0xf32e('0x6a')]);break;case'<':_0x391cbc[_0xf32e('0x70')](_0x5d81d0[_0xf32e('0x77')]+'.'+_0x5867f+_0xf32e('0x7d'),_0x5d81d0['value']);break;}}}});}else{var _0x21d659=_(Object[_0xf32e('0x49')](_0x2a36a3[_0xf32e('0x4a')]))[_0xf32e('0x41')](function(_0x53e610){return _0x3ce422[_0xf32e('0x80')](_0x53e610)?_0x53e610:undefined;})[_0xf32e('0x81')](function(_0x26492c){return!_[_0xf32e('0x82')](_0x26492c);})['value']();if(!_[_0xf32e('0x83')](_0x21d659)){_0x21d659[_0xf32e('0x44')](function(_0x3bb3e8){if(_0x3bb3e8===_0xf32e('0x84')){_0x3ff3c9[_0xf32e('0x53')](_0xf32e('0x85'),[][_0xf32e('0x86')](_0x2a36a3['query'][_0x3bb3e8]));}else if(_0x3bb3e8===_0xf32e('0x69')){var _0x324835=JSON[_0xf32e('0x68')](_0x2a36a3[_0xf32e('0x4a')][_0x3bb3e8])['$gte'];var _0xc15d29=JSON['parse'](_0x2a36a3[_0xf32e('0x4a')][_0x3bb3e8])[_0xf32e('0x87')];_0x3ff3c9[_0xf32e('0x53')](_0xf32e('0x71'),_0x324835,_0xc15d29);}else{if(_0x2a36a3[_0xf32e('0x4a')][_0x3bb3e8]===_0xf32e('0x88')){_0x3ff3c9[_0xf32e('0x53')]('i.'+_0x3bb3e8+'\x20IS\x20NULL');}else{_0x3ff3c9[_0xf32e('0x53')]('i.'+_0x3bb3e8+'\x20=\x20?',_0x2a36a3[_0xf32e('0x4a')][_0x3bb3e8]);}}});}if(_0x2a36a3[_0xf32e('0x4a')][_0xf32e('0x81')]){var _0x439fde=_0x2a36a3[_0xf32e('0x4a')][_0xf32e('0x81')][_0xf32e('0x89')]('\x5c','\x5c\x5c')[_0xf32e('0x89')]('\x27\x27',_0xf32e('0x8a'));if(qs['isNumeric'](_0x439fde)){_0x391cbc['or']('i.id\x20LIKE\x20?',_0x439fde+'%');}else{var _0x4ed8dd=[];_0x439fde['split']('\x20')[_0xf32e('0x44')](function(_0x146adf){_0x4ed8dd[_0xf32e('0x45')]('+'+_0x146adf['toString']());});var _0x3bc1c2=_0x4ed8dd[_0xf32e('0x8b')]('\x20');_0x391cbc['or'](_0xf32e('0x8c'),_0x3bc1c2)['or'](_0xf32e('0x8d'),_0x439fde+'%');}}}_0x3ff3c9[_0xf32e('0x53')](_0x391cbc);if(_0x417a90['order']){_0x417a90['order'][_0xf32e('0x44')](function(_0xee8286){_0x3ff3c9[_0xf32e('0x51')]('i.'+_0xee8286[0x0],_0xee8286[0x1]===_0xf32e('0x8e')?![]:!![]);});}_0x3ff3c9['group'](_0xf32e('0x8f'));var _0x5304a3={'type':db[_0xf32e('0x90')]['QueryTypes'][_0xf32e('0x91')],'raw':!![]};var _0x46acd7=_0x3ff3c9[_0xf32e('0x92')]()[_0xf32e('0x54')](_0xf32e('0x58'))[_0xf32e('0x54')](_0xf32e('0x93'),'unreadMessages');if(!_0x2a36a3[_0xf32e('0x4a')][_0xf32e('0x67')]){if(_0x2a36a3['query'][_0xf32e('0x94')]){if(_0x2a36a3[_0xf32e('0x4a')][_0xf32e('0x94')]==0x1){_0x46acd7[_0xf32e('0x95')]('`unreadMessages`\x20=\x200');_0x3ff3c9['having'](_0xf32e('0x96'));}else{_0x46acd7[_0xf32e('0x95')](_0xf32e('0x97'));_0x3ff3c9[_0xf32e('0x95')](_0xf32e('0x97'));}}if(_0x2a36a3[_0xf32e('0x4a')][_0xf32e('0x98')]){var _0x5c0c0b=_[_0xf32e('0x72')](_0x2a36a3[_0xf32e('0x4a')][_0xf32e('0x98')])?_0x2a36a3['query'][_0xf32e('0x98')]:new Array(_0x2a36a3['query']['tag']);var _0x3656c4=squel[_0xf32e('0x66')]();_0x5c0c0b[_0xf32e('0x44')](function(_0x279a60){_0x3656c4['or'](_0xf32e('0x99'),'%,'+_0x279a60+',%');});_0x3ff3c9[_0xf32e('0x95')](_0x3656c4);_0x46acd7[_0xf32e('0x5f')](_0xf32e('0x9a'),'it',_0xf32e('0x9b'));_0x46acd7[_0xf32e('0x5f')](_0xf32e('0x9c'),'t',_0xf32e('0x9d'));_0x46acd7['where'](_0xf32e('0x9e'),_0x5c0c0b);}}else{var _0x2b8ea1=JSON[_0xf32e('0x68')](_0x2a36a3[_0xf32e('0x4a')][_0xf32e('0x67')]);_[_0xf32e('0x49')](_0x2b8ea1)[_0xf32e('0x44')](function(_0x43caf3){var _0x50abf7=_0x2b8ea1[_0x43caf3];if(_0x43caf3===_0xf32e('0x74')){var _0x364a9c=_0x50abf7[_0xf32e('0x6a')];var _0xbf8447=squel['expr']();_0x364a9c[_0xf32e('0x44')](function(_0x3080f3){_0xbf8447['or'](_0xf32e('0x99'),'%,'+_0x3080f3+',%');});_0x3ff3c9[_0xf32e('0x95')](_0xbf8447);_0x46acd7['left_join']('mail_interaction_has_tags','it',_0xf32e('0x9f'));_0x46acd7[_0xf32e('0x5f')](_0xf32e('0x9c'),'t',_0xf32e('0x9d'));_0x46acd7['where']('t.id\x20IN\x20?',_0x364a9c);}else if(_0x43caf3===_0xf32e('0x75')){if(_0x50abf7['value'][_0xf32e('0x50')]===0x1){if(_0x50abf7['value'][0x0]===0x1){_0x46acd7['having'](_0xf32e('0x96'));_0x3ff3c9['having']('`unreadMessages`\x20=\x200');}else{_0x46acd7[_0xf32e('0x95')]('`unreadMessages`\x20>\x200');_0x3ff3c9[_0xf32e('0x95')]('`unreadMessages`\x20>\x200');}}}});}db[_0xf32e('0xa0')]['query'](_0x46acd7[_0xf32e('0xa1')](),_0x5304a3)[_0xf32e('0x25')](function(_0x41b0d1){_0x1bff7b[_0xf32e('0x33')]=_0x41b0d1[_0xf32e('0x50')];if(_0x1bff7b[_0xf32e('0x33')]===0x0)return[];return db[_0xf32e('0xa0')]['query'](_0x4b15be[_0xf32e('0xa1')](),_0x5304a3)[_0xf32e('0x25')](function(_0x56fc4b){_0xc83c9f=_[_0xf32e('0xa2')](_0x56fc4b,'id');_0x5304a3=_['merge'](_0x5304a3,{'model':db[_0xf32e('0x47')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x3ff3c9[_0xf32e('0x54')](_0xf32e('0x93'),_0xf32e('0x75'));_0x3ff3c9['field']('a.key',_0xf32e('0xa3'));_0x3ff3c9[_0xf32e('0x54')](_0xf32e('0xa4'));_0x3ff3c9['field'](_0xf32e('0x7a'),_0xf32e('0xa5'));_0x3ff3c9[_0xf32e('0x54')](_0xf32e('0xa6'),_0xf32e('0xa7'));_0x3ff3c9['field'](_0xf32e('0x7c'),_0xf32e('0xa8'));_0x3ff3c9[_0xf32e('0x54')](_0xf32e('0xa9'),_0xf32e('0xaa'));_0x3ff3c9[_0xf32e('0x54')](_0xf32e('0xab'),_0xf32e('0xac'));_0x3ff3c9[_0xf32e('0x54')](_0xf32e('0xad'),_0xf32e('0xae'));_0x3ff3c9[_0xf32e('0x54')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xf32e('0x42'));_0x3ff3c9['left_join'](_0xf32e('0x9a'),'it',_0xf32e('0x9b'));_0x3ff3c9[_0xf32e('0x5f')](_0xf32e('0x9c'),'t',_0xf32e('0x9d'));_0x3ff3c9[_0xf32e('0x35')](_0x417a90[_0xf32e('0x35')]);_0x3ff3c9[_0xf32e('0x34')](_0x417a90[_0xf32e('0x34')]);return db['sequelize']['query'](_0x3ff3c9[_0xf32e('0xa1')](),_0x5304a3);})[_0xf32e('0x25')](function(_0x3addcf){_0xfd3f05[_0xf32e('0x53')](_0xf32e('0xaf'),_[_0xf32e('0x41')](_0x3addcf,'id'));return db['sequelize'][_0xf32e('0x4a')](_0xfd3f05[_0xf32e('0xa1')](),_0x5304a3)[_0xf32e('0x25')](function(_0x9aa397){var _0x4d69a5=_[_0xf32e('0xb0')](_0x9aa397,'ChatInteractionId');var _0x3786c0=[];_0x3addcf[_0xf32e('0x44')](function(_0x4e8bd5){_0x3786c0[_0xf32e('0x45')](updateChatInteraction(_0x4e8bd5,_0xc83c9f,_0x4d69a5));});return BPromise[_0xf32e('0xb1')](_0x3786c0);});});})['then'](function(_0xbd5c91){_0x1bff7b[_0xf32e('0xb2')]=_0xbd5c91;return _0x1bff7b;})['then'](respondWithFilteredResult(_0x1ad978,_0x417a90))['catch'](handleError(_0x1ad978,null));};exports['show']=function(_0x421a36,_0x16b410){var _0x22aa71={'raw':![],'where':{'id':_0x421a36[_0xf32e('0xb3')]['id']}},_0x165044={};_0x165044[_0xf32e('0x4e')]=_['keys'](db['ChatInteraction']['rawAttributes']);_0x165044[_0xf32e('0x4a')]=_[_0xf32e('0x49')](_0x421a36[_0xf32e('0x4a')]);_0x165044[_0xf32e('0x4b')]=_['intersection'](_0x165044[_0xf32e('0x4e')],_0x165044[_0xf32e('0x4a')]);_0x22aa71[_0xf32e('0x4d')]=_[_0xf32e('0x4c')](_0x165044[_0xf32e('0x4e')],qs[_0xf32e('0x4f')](_0x421a36[_0xf32e('0x4a')][_0xf32e('0x4f')]));_0x22aa71[_0xf32e('0x4d')]=_0x22aa71[_0xf32e('0x4d')][_0xf32e('0x50')]?_0x22aa71[_0xf32e('0x4d')]:_0x165044[_0xf32e('0x4e')];if(_0x421a36['query'][_0xf32e('0xb4')]){_0x22aa71[_0xf32e('0xb5')]=[{'all':!![]}];}_0x22aa71=_['merge']({},_0x22aa71,_0x421a36['options']);return db[_0xf32e('0x47')]['find'](_0x22aa71)[_0xf32e('0x25')](handleEntityNotFound(_0x16b410,null))[_0xf32e('0x25')](respondWithResult(_0x16b410,null))['catch'](handleError(_0x16b410,null));};exports[_0xf32e('0xb6')]=function(_0x24d0e5,_0x37a1d1){return db[_0xf32e('0x47')]['create'](_0x24d0e5[_0xf32e('0xb7')],{})['then'](respondWithResult(_0x37a1d1,0xc9))[_0xf32e('0x2f')](handleError(_0x37a1d1,null));};exports[_0xf32e('0x3c')]=function(_0x2e4faf,_0x21b1dc){if(_0x2e4faf[_0xf32e('0xb7')]['id']){delete _0x2e4faf[_0xf32e('0xb7')]['id'];}return db[_0xf32e('0x47')][_0xf32e('0xb8')]({'where':{'id':_0x2e4faf[_0xf32e('0xb3')]['id']}})['then'](handleEntityNotFound(_0x21b1dc,null))[_0xf32e('0x25')](saveUpdates(_0x2e4faf[_0xf32e('0xb7')],null))[_0xf32e('0x25')](respondWithResult(_0x21b1dc,null))[_0xf32e('0x2f')](handleError(_0x21b1dc,null));};exports[_0xf32e('0x3d')]=function(_0x3d985f,_0x4559bc){return db[_0xf32e('0x47')][_0xf32e('0xb8')]({'where':{'id':_0x3d985f['params']['id']}})[_0xf32e('0x25')](handleEntityNotFound(_0x4559bc,null))[_0xf32e('0x25')](removeEntity(_0x4559bc,null))[_0xf32e('0x2f')](handleError(_0x4559bc,null));};exports[_0xf32e('0xb9')]=function(_0x21a310,_0x46e7c4){return db['ChatInteraction'][_0xf32e('0xb9')]()[_0xf32e('0x25')](respondWithResult(_0x46e7c4,null))[_0xf32e('0x2f')](handleError(_0x46e7c4,null));};exports['customUpdate']=function(_0x41eb42,_0x3e1fc3){if(_0x41eb42['body']['id']){delete _0x41eb42['body']['id'];}return db[_0xf32e('0x47')]['find']({'where':{'id':_0x41eb42[_0xf32e('0xb3')]['id']}})[_0xf32e('0x25')](handleEntityNotFound(_0x3e1fc3,null))['then'](saveUpdates(_0x41eb42[_0xf32e('0xb7')],null))['then'](respondWithResult(_0x3e1fc3,null))['catch'](handleError(_0x3e1fc3,null));};exports[_0xf32e('0xba')]=function(_0x3b600a,_0x204d11,_0x5cec75){if(_0x3b600a[_0xf32e('0xb7')]['id']){delete _0x3b600a['body']['id'];}return db[_0xf32e('0x47')][_0xf32e('0xb8')]({'where':{'id':_0x3b600a[_0xf32e('0xb3')]['id']}})[_0xf32e('0x25')](function(_0x57d2b9){if(!_0x57d2b9){logger[_0xf32e('0x2c')](_0xf32e('0xbb'),_0xf32e('0xba'),0x194,_0xf32e('0xbc'));_0x204d11[_0xf32e('0x30')](0x194);}else{if(_0x57d2b9['UserId']){throw new db['Sequelize'][(_0xf32e('0xbd'))](_0xf32e('0xbe'));}}return _0x57d2b9;})[_0xf32e('0x25')](function(_0x578afa){if(_0x578afa){return _0x578afa['update']({'closed':_0x3b600a[_0xf32e('0xb7')][_0xf32e('0xbf')],'disposition':_0x3b600a[_0xf32e('0xb7')][_0xf32e('0xc0')]})['then'](function(_0x2b5f56){return _0x2b5f56;});}})[_0xf32e('0x25')](function(_0x253dd9){return respondWithRpcPromise(_0xf32e('0xc1'),_0xf32e('0xba'),_0x3b600a[_0xf32e('0xb7')],client9004);})[_0xf32e('0x25')](respondWithResult(_0x204d11,null))[_0xf32e('0x2f')](handleError(_0x204d11,null));};exports['attachmentUpload']=function(_0x3f7814,_0x382141,_0x31d396){_0x3f7814[_0xf32e('0xb7')][_0xf32e('0x3f')]=_0x3f7814[_0xf32e('0xc2')][_0xf32e('0xc3')];_0x3f7814[_0xf32e('0xb7')][_0xf32e('0xc4')]=_0x3f7814[_0xf32e('0xc2')][_0xf32e('0xc5')];_0x3f7814[_0xf32e('0xb7')][_0xf32e('0xc6')]=_0x3f7814[_0xf32e('0xc2')]['mimetype'];return db[_0xf32e('0xc7')][_0xf32e('0xb6')](_0x3f7814[_0xf32e('0xb7')])[_0xf32e('0x25')](respondWithResult(_0x382141,0xc9))[_0xf32e('0x2f')](handleError(_0x382141,null));};exports[_0xf32e('0xc8')]=function(_0x49a67b,_0x1dead2,_0x3151b7){return db[_0xf32e('0x47')]['findOne']({'where':{'id':_0x49a67b['params']['id']},'raw':!![]})[_0xf32e('0x25')](handleEntityNotFound(_0x1dead2,null))[_0xf32e('0x25')](function(_0x40bd11){if(_0x40bd11){if(_0x40bd11[_0xf32e('0xbf')]){return _0x1dead2['status'](0x193)['json']({'status':0x193,'message':_0xf32e('0xc9')});}return db[_0xf32e('0xc7')]['findOne']({'where':{'id':_0x49a67b[_0xf32e('0x4a')][_0xf32e('0xca')]},'raw':!![]})['then'](handleEntityNotFound(_0x1dead2,null));}})[_0xf32e('0x25')](function(_0x437aef){if(_0x437aef){return _0x1dead2[_0xf32e('0xcb')](path[_0xf32e('0x8b')](config['root'],'server/files/attachments/',_0x437aef['basename']));}})[_0xf32e('0x2f')](handleError(_0x1dead2,null));};exports[_0xf32e('0xcc')]=function(_0x5a2362,_0x248bae){var _0x31dc45=null;var _0x1e00e1=null;var _0x336c3d=null;var _0x4e1792=null;if(_0x5a2362['body']['id']){delete _0x5a2362[_0xf32e('0xb7')]['id'];}if(_0x5a2362['body'][_0xf32e('0xcd')]){_0x4e1792=path[_0xf32e('0x8b')](config['root'],'server/files/chat/upload/',util[_0xf32e('0x6e')](_0xf32e('0xce'),Date[_0xf32e('0xcf')]()));_0x5a2362['body']['pathTranscript']=_0x4e1792;}return db[_0xf32e('0x47')]['find']({'where':{'id':_0x5a2362['params']['id']},'include':[{'model':db['ChatMessage'],'as':'Messages','include':[{'model':db[_0xf32e('0xd0')],'as':'User'}]}]})[_0xf32e('0x25')](handleEntityNotFound(_0x248bae,null))['then'](saveUpdates(_0x5a2362[_0xf32e('0xb7')],null))[_0xf32e('0x25')](function(_0x1a1bc0){if(_0x1a1bc0){_0x31dc45=_0x1a1bc0;return db[_0xf32e('0xd1')][_0xf32e('0xb8')]({'where':{'id':_0x31dc45[_0xf32e('0x84')]}});}})['then'](function(_0x168b1b){if(_0x168b1b){_0x336c3d=_0x168b1b;return db[_0xf32e('0xd2')]['find']({'where':{'id':_0x31dc45[_0xf32e('0x79')]}});}})[_0xf32e('0x25')](function(_0x33af74){if(_0x33af74){_0x1e00e1=_0x33af74;if(_0x4e1792){var _0x37e290=null;for(var _0x3f3ed8=0x1;_0x3f3ed8<_0x31dc45[_0xf32e('0xd3')][_0xf32e('0x50')];++_0x3f3ed8){_0x37e290=_0x31dc45['Messages'][_0x3f3ed8];var _0x4bc71d=_0x37e290[_0xf32e('0xd4')]?util[_0xf32e('0x6e')](_0xf32e('0xd5'),_0x336c3d[_0xf32e('0xd6')],_0x37e290[_0xf32e('0xd4')]):'System';var _0x37d45d=_0x5a2362[_0xf32e('0xb7')][_0xf32e('0xd7')]||util['format'](_0xf32e('0xd5'),_0xf32e('0xd8'),_0x37e290[_0xf32e('0x79')]);switch(_0x336c3d[_0xf32e('0xd9')]){case _0xf32e('0xda'):_0x4bc71d=_0x37e290[_0xf32e('0xd4')]?util[_0xf32e('0x6e')](_0xf32e('0xd5'),_0x336c3d[_0xf32e('0xd6')],_0x37e290['UserId']):_0xf32e('0xdb');break;case'agent_alias':_0x4bc71d=_0x37e290[_0xf32e('0xd4')]?_0x37e290['User']['alias']||_0x37e290[_0xf32e('0xd0')][_0xf32e('0xdc')]:_0xf32e('0xdb');break;case _0xf32e('0xdd'):_0x4bc71d=_0x37e290[_0xf32e('0xd4')]?_0x37e290[_0xf32e('0xd0')][_0xf32e('0xdc')]:_0xf32e('0xdb');break;default:_0x4bc71d=_0x37e290[_0xf32e('0xd4')]?util['format'](_0xf32e('0xd5'),_0x336c3d[_0xf32e('0xd6')],_0x37e290[_0xf32e('0xd4')]):_0xf32e('0xdb');}var _0x24c40a=util[_0xf32e('0x6e')](_0xf32e('0xde'),moment(_0x37e290['createdAt'])[_0xf32e('0x6e')]('MM/DD/YYYY\x20HH:mm:ss'),_0x37e290['direction']==='in'?_0x37d45d:_0x4bc71d,_0x37e290[_0xf32e('0xb7')]);if(!_0x37e290['secret']){fs['appendFileSync'](_0x4e1792,_0x24c40a);}}return db[_0xf32e('0xdf')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xf32e('0xe0')],'as':'Smtp','raw':!![]}]});}}})[_0xf32e('0x25')](function(_0x4348d5){if(_0x4348d5&&_0x4348d5[_0xf32e('0xe1')]&&_0x5a2362[_0xf32e('0xb7')]){var _0x155467={'tls':{'rejectUnauthorized':![]}};if(_0x4348d5[_0xf32e('0xe1')][_0xf32e('0xe2')]){_0x155467[_0xf32e('0xe2')]=_0x4348d5[_0xf32e('0xe1')]['service'];}else{_0x155467['host']=_0x4348d5[_0xf32e('0xe1')]['host'];_0x155467[_0xf32e('0xe3')]=_0x4348d5[_0xf32e('0xe1')][_0xf32e('0xe3')];_0x155467[_0xf32e('0xe4')]=_0x4348d5[_0xf32e('0xe1')][_0xf32e('0xe4')];}if(_0x4348d5[_0xf32e('0xe1')][_0xf32e('0xe5')]){_0x155467[_0xf32e('0xe6')]={'user':_0x4348d5['Smtp']['user'],'pass':_0x4348d5[_0xf32e('0xe1')][_0xf32e('0xe7')]};}return respondWithRpcPromise('SendMail',_0xf32e('0xe8'),{'account':_0x155467,'message':{'from':util[_0xf32e('0x6e')](_0xf32e('0xe9'),_0x4348d5[_0xf32e('0x3f')],_0x4348d5['email']||_0x4348d5[_0xf32e('0xe1')][_0xf32e('0xea')]),'to':_0x5a2362[_0xf32e('0xb7')][_0xf32e('0xcd')],'subject':_0xf32e('0xeb'),'text':util[_0xf32e('0x6e')](_0xf32e('0xec'),_0x5a2362['body'][_0xf32e('0xcd')]),'attachments':[{'path':_0x4e1792}]}})[_0xf32e('0x25')](function(){return _0x31dc45;})[_0xf32e('0x2f')](function(_0x1f50e9){console['error'](_0x1f50e9);});}else{return _0x31dc45;}})['then'](respondWithStatusCode(_0x248bae,0xc8))['catch'](handleError(_0x248bae,null));};exports['addMessage']=function(_0x275f52,_0x300fbb,_0x52ade1){return db[_0xf32e('0xed')][_0xf32e('0xb8')]({'where':{'id':_0x275f52[_0xf32e('0xb3')]['id']}})['then'](handleEntityNotFound(_0x300fbb,null))['then'](function(_0x235be9){if(_0x235be9){return _0x235be9['addMessage'](_0x275f52[_0xf32e('0xb7')][_0xf32e('0xee')],_[_0xf32e('0xef')](_0x275f52[_0xf32e('0xb7')],[_0xf32e('0xee'),'id'])||{});}})[_0xf32e('0x25')](respondWithResult(_0x300fbb,null))[_0xf32e('0x2f')](handleError(_0x300fbb,null));};exports['getMessages']=function(_0x5e1e53,_0x4e4d0f,_0x57cfcc){var _0x1a6beb={'raw':![],'where':{}};var _0x427d52={};var _0x48c41f={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xf32e('0xf0')]({'where':{'id':_0x5e1e53[_0xf32e('0xb3')]['id']}})[_0xf32e('0x25')](handleEntityNotFound(_0x4e4d0f,null))[_0xf32e('0x25')](function(_0x2290d0){if(_0x2290d0){_0x427d52[_0xf32e('0x4e')]=_['keys'](db[_0xf32e('0xed')][_0xf32e('0x48')]);_0x427d52[_0xf32e('0x4a')]=_['keys'](_0x5e1e53['query']);_0x427d52[_0xf32e('0x4b')]=_[_0xf32e('0x4c')](_0x427d52[_0xf32e('0x4e')],_0x427d52[_0xf32e('0x4a')]);_0x1a6beb[_0xf32e('0x4d')]=_[_0xf32e('0x4c')](_0x427d52[_0xf32e('0x4e')],qs[_0xf32e('0x4f')](_0x5e1e53[_0xf32e('0x4a')][_0xf32e('0x4f')]));_0x1a6beb[_0xf32e('0x4d')]=_0x1a6beb[_0xf32e('0x4d')][_0xf32e('0x50')]?_0x1a6beb[_0xf32e('0x4d')]:_0x427d52['model'];if(!_0x5e1e53['query'][_0xf32e('0x80')](_0xf32e('0xf1'))){_0x1a6beb[_0xf32e('0x35')]=qs['limit'](_0x5e1e53[_0xf32e('0x4a')]['limit']);_0x1a6beb[_0xf32e('0x34')]=qs[_0xf32e('0x34')](_0x5e1e53[_0xf32e('0x4a')][_0xf32e('0x34')]);}_0x1a6beb[_0xf32e('0x51')]=qs[_0xf32e('0x52')](_0x5e1e53['query'][_0xf32e('0x52')]);_0x1a6beb[_0xf32e('0x53')]=qs[_0xf32e('0x4b')](_[_0xf32e('0xf2')](_0x5e1e53['query'],_0x427d52['filters']));_0x1a6beb['where'][_0xf32e('0xf3')]=_0x2290d0['id'];if(_0x5e1e53[_0xf32e('0x4a')]['filter']){_0x1a6beb[_0xf32e('0x53')]=_['merge'](_0x1a6beb[_0xf32e('0x53')],{'$or':_[_0xf32e('0x41')](_0x1a6beb[_0xf32e('0x4d')],function(_0x54c59d){var _0x2d1bfc={};_0x2d1bfc[_0x54c59d]={'$like':'%'+_0x5e1e53['query'][_0xf32e('0x81')]+'%'};return _0x2d1bfc;})});}if(_0x5e1e53[_0xf32e('0x4a')][_0xf32e('0xf4')]){var _0x1227c0=_0x5e1e53[_0xf32e('0x4a')][_0xf32e('0xf4')]['split'](',');var _0x4fb62f={};_0x4fb62f[_0x1227c0[0x0]]={'$gte':moment(_0x1227c0[0x1])[_0xf32e('0x6e')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1a6beb['where']=_['merge'](_0x1a6beb[_0xf32e('0x53')],_0x4fb62f);}_0x1a6beb=_['merge']({},_0x1a6beb,_0x5e1e53[_0xf32e('0xf5')]);return db[_0xf32e('0xed')]['count']({'where':_0x1a6beb[_0xf32e('0x53')]})[_0xf32e('0x25')](function(_0x5d0742){_0x48c41f[_0xf32e('0x33')]=_0x5d0742;if(_0x5e1e53['query'][_0xf32e('0xb4')]){_0x1a6beb[_0xf32e('0xb5')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x1a6beb);})[_0xf32e('0x25')](function(_0x468c53){_0x48c41f[_0xf32e('0xb2')]=_0x468c53;return _0x48c41f;});}})[_0xf32e('0x25')](respondWithFilteredResult(_0x4e4d0f,_0x1a6beb))[_0xf32e('0x2f')](handleError(_0x4e4d0f,null));};exports[_0xf32e('0xf6')]=function(_0x49844f,_0x562a97,_0x5db1b2){var _0x598997={'where':{}},_0x22fecc={},_0x4a1574={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xf32e('0xf0')]({'where':{'id':_0x49844f[_0xf32e('0xb3')]['id']}})[_0xf32e('0x25')](handleEntityNotFound(_0x562a97,null))[_0xf32e('0x25')](function(_0x49f50c){if(_0x49f50c){_0x22fecc[_0xf32e('0x4e')]=_[_0xf32e('0x49')](db[_0xf32e('0xed')][_0xf32e('0x48')]);_0x22fecc[_0xf32e('0x4a')]=_[_0xf32e('0x49')](_0x49844f[_0xf32e('0x4a')]);_0x22fecc[_0xf32e('0x4b')]=_[_0xf32e('0x4c')](_0x22fecc[_0xf32e('0x4e')],_0x22fecc[_0xf32e('0x4a')]);_0x598997[_0xf32e('0x4d')]=_[_0xf32e('0x4c')](_0x22fecc[_0xf32e('0x4e')],qs['fields'](_0x49844f[_0xf32e('0x4a')][_0xf32e('0x4f')]));_0x598997[_0xf32e('0x4d')]=_0x598997[_0xf32e('0x4d')][_0xf32e('0x50')]?_0x598997[_0xf32e('0x4d')]:_0x22fecc['model'];if(!_0x49844f[_0xf32e('0x4a')][_0xf32e('0x80')](_0xf32e('0xf1'))){_0x598997[_0xf32e('0x35')]=qs[_0xf32e('0x35')](_0x49844f['query']['limit']);_0x598997['offset']=qs[_0xf32e('0x34')](_0x49844f[_0xf32e('0x4a')][_0xf32e('0x34')]);}_0x598997[_0xf32e('0x51')]=qs[_0xf32e('0x52')](_0x49844f[_0xf32e('0x4a')]['sort']);_0x598997['where']=qs['filters'](_[_0xf32e('0xf2')](_0x49844f[_0xf32e('0x4a')],_0x22fecc['filters']));_0x598997[_0xf32e('0x53')][_0xf32e('0xf3')]=_0x49f50c['id'];if(_0x49844f['query'][_0xf32e('0x81')]){_0x598997[_0xf32e('0x53')]=_['merge'](_0x598997[_0xf32e('0x53')],{'$or':_[_0xf32e('0x41')](_0x598997[_0xf32e('0x4d')],function(_0x1016e6){var _0x4e396b={};_0x4e396b[_0x1016e6]={'$like':'%'+_0x49844f[_0xf32e('0x4a')][_0xf32e('0x81')]+'%'};return _0x4e396b;})});}_0x598997[_0xf32e('0x53')][_0xf32e('0xf7')]=![];if(_0x49844f[_0xf32e('0x4a')]['id']){_0x598997[_0xf32e('0x53')]['id']={'$gt':_0x49844f['query']['id']};}_0x598997=_[_0xf32e('0xf8')]({},_0x598997,_0x49844f['options']);return db[_0xf32e('0xed')][_0xf32e('0x33')]({'where':_0x598997[_0xf32e('0x53')]})[_0xf32e('0x25')](function(_0x17c711){_0x4a1574['count']=_0x17c711;_0x598997[_0xf32e('0xb5')]=[];if(_0x49844f[_0xf32e('0x4a')][_0xf32e('0xf9')]){_0x598997[_0xf32e('0xb5')]['push']({'model':db[_0xf32e('0xd0')],'as':'User','attributes':['id',_0xf32e('0xdc'),_0xf32e('0xfa')]});}if(_0x49844f[_0xf32e('0x4a')][_0xf32e('0xb4')]){_0x598997[_0xf32e('0xb5')]=[{'all':!![]}];}return db[_0xf32e('0xed')][_0xf32e('0xfb')](_0x598997);})['then'](function(_0x2fcb06){_0x4a1574['rows']=_0x2fcb06;return _0x4a1574;});}})['then'](respondWithFilteredResult(_0x562a97,_0x598997))[_0xf32e('0x2f')](handleError(_0x562a97,null));};exports[_0xf32e('0xfc')]=function(_0x492af8,_0x4376bb,_0x29b7db){return db[_0xf32e('0x47')][_0xf32e('0xb8')]({'where':{'id':_0x492af8[_0xf32e('0xb3')]['id']}})[_0xf32e('0x25')](handleEntityNotFound(_0x4376bb,null))[_0xf32e('0x25')](function(_0x31aed2){if(_0x31aed2){return _0x31aed2[_0xf32e('0xfd')](_0x492af8[_0xf32e('0xb7')][_0xf32e('0xee')],_['omit'](_0x492af8[_0xf32e('0xb7')],[_0xf32e('0xee'),'id'])||{})['spread'](function(){return db['Tag'][_0xf32e('0xfb')]({'attributes':['id','name',_0xf32e('0x55')],'where':{'id':_0x492af8[_0xf32e('0xb7')][_0xf32e('0xee')]}});})[_0xf32e('0x25')](function(_0x27dd32){socket[_0xf32e('0xfe')](_0xf32e('0xff'),{'id':Number(_0x492af8['params']['id']),'tags':_0x27dd32||[]});return{'id':Number(_0x492af8[_0xf32e('0xb3')]['id']),'tags':_0x27dd32||[]};});}})[_0xf32e('0x25')](respondWithResult(_0x4376bb,null))[_0xf32e('0x2f')](handleError(_0x4376bb,null));};exports[_0xf32e('0x100')]=function(_0x592e0f,_0x196fc0,_0x59629b){return db[_0xf32e('0x47')][_0xf32e('0xb8')]({'where':{'id':_0x592e0f['params']['id']}})[_0xf32e('0x25')](handleEntityNotFound(_0x196fc0,null))[_0xf32e('0x25')](function(_0x316247){if(_0x316247){return _0x316247[_0xf32e('0x100')](_0x592e0f['query'][_0xf32e('0xee')]);}})['then'](respondWithStatusCode(_0x196fc0,null))[_0xf32e('0x2f')](handleError(_0x196fc0,null));};exports['download']=function(_0x532531,_0x9f22e3){var _0x48d746=moment()[_0xf32e('0x101')]()[_0xf32e('0xa1')]();var _0x20f4da=path[_0xf32e('0x8b')](config['root'],_0xf32e('0x102'),_0xf32e('0x103'),_0xf32e('0x104'));var _0x146134=path[_0xf32e('0x8b')](config[_0xf32e('0x105')],_0xf32e('0x102'),_0xf32e('0x103'),_0xf32e('0x106'));var _0x3bed5b=path[_0xf32e('0x8b')](_0x20f4da,_0x48d746);var _0xe2ab3=util[_0xf32e('0x6e')](_0xf32e('0x107'),_0x532531[_0xf32e('0xb3')]['id'],_0x48d746);var _0xbb480e=path[_0xf32e('0x8b')](_0x20f4da,_0xe2ab3);var _0x295400=![];return db[_0xf32e('0x47')][_0xf32e('0xb8')]({'where':{'id':_0x532531[_0xf32e('0xb3')]['id']},'include':[{'model':db[_0xf32e('0xed')],'as':_0xf32e('0xd3'),'attributes':['id',_0xf32e('0xb7'),_0xf32e('0x69'),_0xf32e('0x108'),_0xf32e('0xf7')],'include':[{'model':db[_0xf32e('0xd0')],'as':_0xf32e('0xd0'),'attributes':['id','fullname'],'raw':!![]},{'model':db[_0xf32e('0xd2')],'as':'Contact','attributes':['id',_0xf32e('0x109'),_0xf32e('0x10a')],'raw':!![]},{'model':db[_0xf32e('0xc7')],'as':_0xf32e('0xc7'),'raw':!![]}]},{'model':db[_0xf32e('0xd1')],'as':_0xf32e('0x10b'),'attributes':['id',_0xf32e('0x3f')]},{'model':db[_0xf32e('0xd0')],'as':_0xf32e('0x10c'),'attributes':['id',_0xf32e('0xdc')]}]})['then'](handleEntityNotFound(_0x9f22e3,null))[_0xf32e('0x25')](function(_0x431c64){if(_0x431c64){var _0xb841ef=_0x431c64[_0xf32e('0x10d')]({'plain':!![]});_0x295400=!![];var _0x5d8726={'format':'A4','border':'10px','header':{'height':_0xf32e('0x10e'),'contents':{'first':_0xf32e('0x10f')}},'footer':{'height':_0xf32e('0x110'),'contents':{'default':util[_0xf32e('0x6e')](_0xf32e('0x111'),util[_0xf32e('0x6e')]('%s\x20#%d','Chat',_0xb841ef['id']),moment()[_0xf32e('0x6e')](_0xf32e('0x112'))[_0xf32e('0xa1')]())}}};fs[_0xf32e('0x113')](_0x3bed5b);var _0x51ea5f={'channel':_0xf32e('0x114'),'account':_0xb841ef[_0xf32e('0x10b')][_0xf32e('0x3f')],'agent':_0xb841ef[_0xf32e('0x10c')]?_0xb841ef['Owner']['fullname']:'N.A.','createdAt':moment(_0xb841ef[_0xf32e('0x69')])['format'](_0xf32e('0x115'))[_0xf32e('0xa1')](),'closedAt':_0xb841ef[_0xf32e('0xbf')]?moment(_0xb841ef[_0xf32e('0x116')])[_0xf32e('0x6e')](_0xf32e('0x115'))[_0xf32e('0xa1')]():'','disposition':_0xb841ef[_0xf32e('0xc0')],'chatInfo':{'browser':_0xb841ef[_0xf32e('0x117')],'os':_0xb841ef[_0xf32e('0x118')],'referer':_0xb841ef['referer'],'customerIp':_0xb841ef[_0xf32e('0x119')]},'messages':_(_0xb841ef['Messages'])['tail']()['filter']({'secret':![]})[_0xf32e('0x41')](function(_0x3a51d6){if(_0x3a51d6[_0xf32e('0xc7')]){var _0x119fb1=path[_0xf32e('0x8b')](_0x146134,_0x3a51d6[_0xf32e('0xc7')][_0xf32e('0xc4')]);if(fs[_0xf32e('0x11a')](_0x119fb1)){fs['createReadStream'](_0x119fb1)[_0xf32e('0x11b')](fs['createWriteStream'](path[_0xf32e('0x8b')](_0x3bed5b,_0x3a51d6[_0xf32e('0xc7')][_0xf32e('0xc4')])));}}return{'date':moment(_0x3a51d6[_0xf32e('0x69')])[_0xf32e('0x6e')](_0xf32e('0x115'))[_0xf32e('0xa1')](),'sender':_0x3a51d6[_0xf32e('0x108')]==='out'?_0x3a51d6[_0xf32e('0xd0')]?_0x3a51d6[_0xf32e('0xd0')]['fullname']:_0xf32e('0xdb'):_0x3a51d6['Contact'][_0xf32e('0x109')]+(_0x3a51d6[_0xf32e('0x11c')]['lastName']?'\x20'+_0x3a51d6['Contact'][_0xf32e('0x10a')]:''),'body':_0x3a51d6[_0xf32e('0xc7')]?_0x3a51d6[_0xf32e('0xc7')]['basename']:_0x3a51d6[_0xf32e('0xb7')],'direction':_0x3a51d6['direction']===_0xf32e('0x11d')?'A':'C','secret':_0x3a51d6['secret'],'attachment':_0x3a51d6[_0xf32e('0xc7')]};})[_0xf32e('0x6a')]()};return ejs[_0xf32e('0x11e')](path[_0xf32e('0x8b')](config[_0xf32e('0x105')],_0xf32e('0x102'),_0xf32e('0x11f'),_0xf32e('0x120')),{'interaction':_0x51ea5f})[_0xf32e('0x25')](function(_0xef3bf1){return new BPromise(function(_0x6c7c65,_0x4b922b){pdf[_0xf32e('0xb6')](_0xef3bf1,_0x5d8726)['toFile'](path[_0xf32e('0x8b')](_0x3bed5b,_0xf32e('0x121')+_0xb841ef['id']+'-'+_0x48d746+_0xf32e('0x122')),function(_0x46cb39,_0x22a9fe){if(_0x46cb39)return _0x4b922b(_0x46cb39);_0x6c7c65(_0x22a9fe);});});});}})[_0xf32e('0x25')](function(){if(_0x295400){return new BPromise(function(_0x3de9bc,_0x1e6d6f){zipdir(_0x3bed5b,{'saveTo':_0xbb480e},function(_0x2e76db,_0x21b344){if(_0x2e76db)return _0x1e6d6f(_0x2e76db);return _0x3de9bc(_0x21b344);});})[_0xf32e('0x25')](function(){return new BPromise(function(_0x843885,_0x158597){rimraf(_0x3bed5b,function(_0x3acc16){if(_0x3acc16)_0x158597(_0x3acc16);return _0x843885();});});})['then'](function(){return _0x9f22e3[_0xf32e('0xcb')](_0xbb480e,_0xe2ab3,function(_0x2cbed0){if(_0x2cbed0){console[_0xf32e('0x123')](_0xf32e('0x124'),_0x2cbed0);}else{fs[_0xf32e('0x125')](_0xbb480e);}});});}else{return _0x9f22e3[_0xf32e('0x30')](0xc8);}})[_0xf32e('0x2f')](handleError(_0x9f22e3,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 0898b84..0685652 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 _0x6266=['ChatInteraction','ChatMessage','save','update','getUsers','then','Users','map','findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x234a3b,_0x595343){var _0x387f80=function(_0x44b24d){while(--_0x44b24d){_0x234a3b['push'](_0x234a3b['shift']());}};_0x387f80(++_0x595343);}(_0x6266,0x163));var _0x6626=function(_0x1e3dd7,_0x708e1f){_0x1e3dd7=_0x1e3dd7-0x0;var _0x59ec9c=_0x6266[_0x1e3dd7];return _0x59ec9c;};'use strict';var EventEmitter=require(_0x6626('0x0'));var ChatInteraction=require(_0x6626('0x1'))['db'][_0x6626('0x2')];var ChatMessage=require(_0x6626('0x1'))['db'][_0x6626('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6626('0x4'),'afterUpdate':_0x6626('0x5'),'afterDestroy':'remove'};function emitEvent(_0x494497){return function(_0x133aab,_0x554b90,_0x1dec58){_0x133aab[_0x6626('0x6')]({'attributes':['id'],'raw':!![]})[_0x6626('0x7')](function(_0x3ca3b0){_0x133aab['setDataValue'](_0x6626('0x8'),_0x3ca3b0[_0x6626('0x9')](function(_0x38f09a){return{'id':_0x38f09a['id']};}));return ChatMessage[_0x6626('0xa')]({'where':{'ChatInteractionId':_0x133aab['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6626('0x7')](function(_0x209310){_0x133aab['setDataValue'](_0x6626('0xb'),_0x209310[_0x6626('0xc')]);ChatInteractionEvents[_0x6626('0xd')](_0x494497+':'+_0x133aab['id'],_0x133aab);ChatInteractionEvents[_0x6626('0xd')](_0x494497,_0x133aab);_0x1dec58(null);})['catch'](_0x1dec58(null));};}for(var e in events){if(events[_0x6626('0xe')](e)){var event=events[e];ChatInteraction[_0x6626('0xf')](e,emitEvent(event));}}module[_0x6626('0x10')]=ChatInteractionEvents; \ No newline at end of file +var _0x302a=['save','update','remove','getUsers','then','map','setDataValue','unreadMessages','length','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatMessage'];(function(_0x587ba2,_0x42eb40){var _0x50ec73=function(_0x2f32e3){while(--_0x2f32e3){_0x587ba2['push'](_0x587ba2['shift']());}};_0x50ec73(++_0x42eb40);}(_0x302a,0x11b));var _0xa302=function(_0x51d8d9,_0x5950b2){_0x51d8d9=_0x51d8d9-0x0;var _0x96195e=_0x302a[_0x51d8d9];return _0x96195e;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xa302('0x0'))['db']['ChatInteraction'];var ChatMessage=require(_0xa302('0x0'))['db'][_0xa302('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa302('0x2'),'afterUpdate':_0xa302('0x3'),'afterDestroy':_0xa302('0x4')};function emitEvent(_0x52b280){return function(_0xe0260e,_0x112477,_0x4171a2){_0xe0260e[_0xa302('0x5')]({'attributes':['id'],'raw':!![]})[_0xa302('0x6')](function(_0x362178){_0xe0260e['setDataValue']('Users',_0x362178[_0xa302('0x7')](function(_0x3b414b){return{'id':_0x3b414b['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0xe0260e['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa302('0x6')](function(_0x11a10e){_0xe0260e[_0xa302('0x8')](_0xa302('0x9'),_0x11a10e[_0xa302('0xa')]);ChatInteractionEvents[_0xa302('0xb')](_0x52b280+':'+_0xe0260e['id'],_0xe0260e);ChatInteractionEvents[_0xa302('0xb')](_0x52b280,_0xe0260e);_0x4171a2(null);})['catch'](_0x4171a2(null));};}for(var e in events){if(events[_0xa302('0xc')](e)){var event=events[e];ChatInteraction[_0xa302('0xd')](e,emitEvent(event));}}module[_0xa302('0xe')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 6740e83..4c6ee76 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 _0x757a=['request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','chat_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x5d27d7,_0x3a489e){var _0x523085=function(_0x66ae55){while(--_0x66ae55){_0x5d27d7['push'](_0x5d27d7['shift']());}};_0x523085(++_0x3a489e);}(_0x757a,0xde));var _0xa757=function(_0x3f87ee,_0x52da62){_0x3f87ee=_0x3f87ee-0x0;var _0x4bfec=_0x757a[_0x3f87ee];return _0x4bfec;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatInteraction',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2f7793,_0x447344,_0x1a95ee){if(_0x2f7793[_0xa757('0xa')]('closed')){_0x2f7793[_0xa757('0xb')]=moment()[_0xa757('0xc')](_0xa757('0xd'));}_0x1a95ee(null,_0x2f7793);}},'charset':_0xa757('0xe'),'collate':_0xa757('0xf')});}; \ No newline at end of file +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(_0x3aec12,_0x52a677){var _0x4d8def=function(_0x43ad94){while(--_0x43ad94){_0x3aec12['push'](_0x3aec12['shift']());}};_0x4d8def(++_0x52a677);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x1dc82c,_0x4f43eb){_0x1dc82c=_0x1dc82c-0x0;var _0x39b34a=_0xbdb7[_0x1dc82c];return _0x39b34a;};'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 diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index e3f038e..ec44e63 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 _0xd540=['find','ids','omit','spread','AddTags','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','AddTagsToChatInteraction'];(function(_0x3d3e91,_0x4e805c){var _0x5d6949=function(_0x23f557){while(--_0x23f557){_0x3d3e91['push'](_0x3d3e91['shift']());}};_0x5d6949(++_0x4e805c);}(_0xd540,0x19f));var _0x0d54=function(_0x4a6210,_0x2272bb){_0x4a6210=_0x4a6210-0x0;var _0x58a507=_0xd540[_0x4a6210];return _0x58a507;};'use strict';var _=require(_0x0d54('0x0'));var util=require('util');var moment=require(_0x0d54('0x1'));var BPromise=require('bluebird');var rs=require(_0x0d54('0x2'));var fs=require('fs');var Redis=require(_0x0d54('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0d54('0x4'));var logger=require(_0x0d54('0x5'))(_0x0d54('0x6'));var config=require('../../config/environment');var jayson=require(_0x0d54('0x7'));var client=jayson[_0x0d54('0x8')][_0x0d54('0x9')]({'port':0x232a});config['redis']=_[_0x0d54('0xa')](config[_0x0d54('0xb')],{'host':_0x0d54('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0d54('0xd'))[_0x0d54('0xe')](socket);function respondWithRpcPromise(_0x280102,_0x495b7b,_0x52fb8e){return new BPromise(function(_0x4079a2,_0x4f44b4){return client['request'](_0x280102,_0x52fb8e)[_0x0d54('0xf')](function(_0x495e3b){logger[_0x0d54('0x10')](_0x0d54('0x11'),_0x495b7b,_0x0d54('0x12'));logger[_0x0d54('0x13')](_0x0d54('0x14'),_0x495b7b,_0x0d54('0x12'),JSON[_0x0d54('0x15')](_0x495e3b));if(_0x495e3b['error']){if(_0x495e3b['error']['code']===0x1f4){logger[_0x0d54('0x16')](_0x0d54('0x11'),_0x495b7b,_0x495e3b[_0x0d54('0x16')][_0x0d54('0x17')]);return _0x4f44b4(_0x495e3b['error'][_0x0d54('0x17')]);}logger['error'](_0x0d54('0x11'),_0x495b7b,_0x495e3b[_0x0d54('0x16')][_0x0d54('0x17')]);return _0x4079a2(_0x495e3b['error'][_0x0d54('0x17')]);}else{logger[_0x0d54('0x10')](_0x0d54('0x11'),_0x495b7b,_0x0d54('0x12'));_0x4079a2(_0x495e3b[_0x0d54('0x18')]['message']);}})[_0x0d54('0x19')](function(_0x56f2e2){logger[_0x0d54('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x495b7b,_0x56f2e2);_0x4f44b4(_0x56f2e2);});});}exports[_0x0d54('0x1a')]=function(_0x5d75e1){var _0x121523=this;return new Promise(function(_0xbb85aa,_0x42e0ce){return db[_0x0d54('0x1b')][_0x0d54('0x1c')](_0x5d75e1[_0x0d54('0x1d')],{'raw':_0x5d75e1[_0x0d54('0x1e')]?_0x5d75e1[_0x0d54('0x1e')][_0x0d54('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d75e1[_0x0d54('0x1e')]?_0x5d75e1[_0x0d54('0x1e')][_0x0d54('0x20')]||null:null,'attributes':_0x5d75e1[_0x0d54('0x1e')]?_0x5d75e1[_0x0d54('0x1e')][_0x0d54('0x21')]||null:null,'limit':_0x5d75e1['options']?_0x5d75e1[_0x0d54('0x1e')][_0x0d54('0x22')]||null:null})[_0x0d54('0xf')](function(_0xc0a525){logger[_0x0d54('0x10')](_0x0d54('0x1a'),_0x5d75e1);logger[_0x0d54('0x13')]('UpdateChatInteraction',_0x5d75e1,JSON[_0x0d54('0x15')](_0xc0a525));_0xbb85aa(_0xc0a525);})[_0x0d54('0x19')](function(_0x18f912){logger['error']('UpdateChatInteraction',_0x18f912[_0x0d54('0x17')],_0x5d75e1);_0x42e0ce(_0x121523[_0x0d54('0x16')](0x1f4,_0x18f912[_0x0d54('0x17')]));});});};exports[_0x0d54('0x23')]=function(_0x782fe){return new Promise(function(_0x3773b5,_0xa1e6b4){return db['ChatInteraction'][_0x0d54('0x24')]({'where':_0x782fe[_0x0d54('0x1e')]?_0x782fe[_0x0d54('0x1e')][_0x0d54('0x20')]||null:null})[_0x0d54('0xf')](function(_0x15321d){if(_0x15321d){return _0x15321d['addTags'](_0x782fe[_0x0d54('0x1d')][_0x0d54('0x25')],_[_0x0d54('0x26')](_0x782fe[_0x0d54('0x1d')],[_0x0d54('0x25'),'id'])||{});}})[_0x0d54('0x27')](function(_0x1b3b14){logger[_0x0d54('0x10')](_0x0d54('0x28'),_0x782fe);logger[_0x0d54('0x13')](_0x0d54('0x28'),_0x782fe,JSON['stringify'](_0x1b3b14));_0x3773b5(_0x1b3b14);})['catch'](function(_0x52f36b){logger[_0x0d54('0x16')]('AddTags',_0x52f36b['message'],_0x782fe);_0xa1e6b4(_this[_0x0d54('0x16')](0x1f4,_0x52f36b['message']));});});}; \ No newline at end of file +var _0x36d5=['redis','defaults','socket.io-emitter','./chatInteraction.socket','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ChatInteraction','update','body','options','UpdateChatInteraction','catch','AddTagsToChatInteraction','where','addTags','ids','omit','AddTags','debug','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x36d5,0x1b0));var _0x536d=function(_0x3c9e74,_0x4334c5){_0x3c9e74=_0x3c9e74-0x0;var _0x4fea21=_0x36d5[_0x3c9e74];return _0x4fea21;};'use strict';var _=require(_0x536d('0x0'));var util=require(_0x536d('0x1'));var moment=require(_0x536d('0x2'));var BPromise=require('bluebird');var rs=require(_0x536d('0x3'));var fs=require('fs');var Redis=require(_0x536d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x536d('0x5'));var logger=require(_0x536d('0x6'))(_0x536d('0x7'));var config=require(_0x536d('0x8'));var jayson=require(_0x536d('0x9'));var client=jayson[_0x536d('0xa')][_0x536d('0xb')]({'port':0x232a});config[_0x536d('0xc')]=_[_0x536d('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x536d('0xe'))(new Redis(config[_0x536d('0xc')]));require(_0x536d('0xf'))['register'](socket);function respondWithRpcPromise(_0x56a4d2,_0x956b2e,_0x5d7e57){return new BPromise(function(_0x57765f,_0x372a43){return client['request'](_0x56a4d2,_0x5d7e57)[_0x536d('0x10')](function(_0xa79cd8){logger[_0x536d('0x11')](_0x536d('0x12'),_0x956b2e,_0x536d('0x13'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x956b2e,_0x536d('0x13'),JSON[_0x536d('0x14')](_0xa79cd8));if(_0xa79cd8['error']){if(_0xa79cd8[_0x536d('0x15')]['code']===0x1f4){logger['error'](_0x536d('0x12'),_0x956b2e,_0xa79cd8[_0x536d('0x15')][_0x536d('0x16')]);return _0x372a43(_0xa79cd8[_0x536d('0x15')][_0x536d('0x16')]);}logger['error'](_0x536d('0x12'),_0x956b2e,_0xa79cd8['error']['message']);return _0x57765f(_0xa79cd8[_0x536d('0x15')][_0x536d('0x16')]);}else{logger[_0x536d('0x11')](_0x536d('0x12'),_0x956b2e,'request\x20sent');_0x57765f(_0xa79cd8[_0x536d('0x17')][_0x536d('0x16')]);}})['catch'](function(_0x221d3d){logger[_0x536d('0x15')](_0x536d('0x12'),_0x956b2e,_0x221d3d);_0x372a43(_0x221d3d);});});}exports['UpdateChatInteraction']=function(_0x2d5d5e){var _0x2a4c01=this;return new Promise(function(_0x211ad4,_0x4eda0b){return db[_0x536d('0x18')][_0x536d('0x19')](_0x2d5d5e[_0x536d('0x1a')],{'raw':_0x2d5d5e['options']?_0x2d5d5e[_0x536d('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d5d5e['options']?_0x2d5d5e[_0x536d('0x1b')]['where']||null:null,'attributes':_0x2d5d5e['options']?_0x2d5d5e[_0x536d('0x1b')]['attributes']||null:null,'limit':_0x2d5d5e[_0x536d('0x1b')]?_0x2d5d5e[_0x536d('0x1b')]['limit']||null:null})['then'](function(_0x4cd576){logger[_0x536d('0x11')](_0x536d('0x1c'),_0x2d5d5e);logger['debug'](_0x536d('0x1c'),_0x2d5d5e,JSON[_0x536d('0x14')](_0x4cd576));_0x211ad4(_0x4cd576);})[_0x536d('0x1d')](function(_0x192e91){logger[_0x536d('0x15')](_0x536d('0x1c'),_0x192e91[_0x536d('0x16')],_0x2d5d5e);_0x4eda0b(_0x2a4c01['error'](0x1f4,_0x192e91['message']));});});};exports[_0x536d('0x1e')]=function(_0x3f5282){return new Promise(function(_0x3493a7,_0x4b8fc2){return db[_0x536d('0x18')]['find']({'where':_0x3f5282[_0x536d('0x1b')]?_0x3f5282[_0x536d('0x1b')][_0x536d('0x1f')]||null:null})[_0x536d('0x10')](function(_0x69353d){if(_0x69353d){return _0x69353d[_0x536d('0x20')](_0x3f5282[_0x536d('0x1a')][_0x536d('0x21')],_[_0x536d('0x22')](_0x3f5282[_0x536d('0x1a')],[_0x536d('0x21'),'id'])||{});}})['spread'](function(_0x3a34c8){logger['info'](_0x536d('0x23'),_0x3f5282);logger[_0x536d('0x24')](_0x536d('0x23'),_0x3f5282,JSON[_0x536d('0x14')](_0x3a34c8));_0x3493a7(_0x3a34c8);})[_0x536d('0x1d')](function(_0x509ae9){logger[_0x536d('0x15')](_0x536d('0x23'),_0x509ae9[_0x536d('0x16')],_0x3f5282);_0x4b8fc2(_this[_0x536d('0x15')](0x1f4,_0x509ae9[_0x536d('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index f89c73d..cadaf72 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 _0x4936=['update','emit','removeListener','length','chatInteraction:','save','remove'];(function(_0x5935fd,_0x1c0ba8){var _0x158df3=function(_0x4aaaf4){while(--_0x4aaaf4){_0x5935fd['push'](_0x5935fd['shift']());}};_0x158df3(++_0x1c0ba8);}(_0x4936,0x171));var _0x6493=function(_0x291693,_0x4e9119){_0x291693=_0x291693-0x0;var _0x17150b=_0x4936[_0x291693];return _0x17150b;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x6493('0x0'),_0x6493('0x1'),_0x6493('0x2')];function createListener(_0x282b09,_0x212a06){return function(_0x56f371){_0x212a06[_0x6493('0x3')](_0x282b09,_0x56f371);};}function removeListener(_0x5f27c7,_0x109709){return function(){ChatInteractionEvents[_0x6493('0x4')](_0x5f27c7,_0x109709);};}exports['register']=function(_0x16cba8){for(var _0x50c8ce=0x0,_0x55babb=events[_0x6493('0x5')];_0x50c8ce<_0x55babb;_0x50c8ce++){var _0x3c5f28=events[_0x50c8ce];var _0x5f361a=createListener(_0x6493('0x6')+_0x3c5f28,_0x16cba8);ChatInteractionEvents['on'](_0x3c5f28,_0x5f361a);}}; \ No newline at end of file +var _0x06fd=['length','chatInteraction:','save','remove','update','emit','removeListener','register'];(function(_0x1de1c9,_0x179709){var _0x41618e=function(_0x2569e4){while(--_0x2569e4){_0x1de1c9['push'](_0x1de1c9['shift']());}};_0x41618e(++_0x179709);}(_0x06fd,0x1aa));var _0xd06f=function(_0x1fd155,_0x340af9){_0x1fd155=_0x1fd155-0x0;var _0x250e2f=_0x06fd[_0x1fd155];return _0x250e2f;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0xd06f('0x0'),_0xd06f('0x1'),_0xd06f('0x2')];function createListener(_0x49758e,_0x16e885){return function(_0x404111){_0x16e885[_0xd06f('0x3')](_0x49758e,_0x404111);};}function removeListener(_0x43f1e5,_0x4ec75b){return function(){ChatInteractionEvents[_0xd06f('0x4')](_0x43f1e5,_0x4ec75b);};}exports[_0xd06f('0x5')]=function(_0x2b4da0){for(var _0x1aac66=0x0,_0x1b2f46=events[_0xd06f('0x6')];_0x1aac66<_0x1b2f46;_0x1aac66++){var _0x5b6d85=events[_0x1aac66];var _0x22a2fc=createListener(_0xd06f('0x7')+_0x5b6d85,_0x2b4da0);ChatInteractionEvents['on'](_0x5b6d85,_0x22a2fc);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index e6f8f47..40a016a 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 _0xdb94=['server/files/attachments/','now','originalname','replace','/:id/attachment_upload','file','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','/:id/my_messages','download','post','create','diskStorage','root'];(function(_0x20008a,_0x362490){var _0x5d0f1c=function(_0x122ecf){while(--_0x122ecf){_0x20008a['push'](_0x20008a['shift']());}};_0x5d0f1c(++_0x362490);}(_0xdb94,0xab));var _0x4db9=function(_0x5d5f0e,_0xd92540){_0x5d5f0e=_0x5d5f0e-0x0;var _0x18d862=_0xdb94[_0x5d5f0e];return _0x18d862;};'use strict';var multer=require(_0x4db9('0x0'));var util=require(_0x4db9('0x1'));var path=require(_0x4db9('0x2'));var timeout=require(_0x4db9('0x3'));var express=require(_0x4db9('0x4'));var router=express['Router']();var auth=require(_0x4db9('0x5'));var interaction=require(_0x4db9('0x6'));var config=require('../../config/environment');var controller=require('./chatInteraction.controller');router[_0x4db9('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4db9('0x7')]('/describe',auth[_0x4db9('0x8')](),controller['describe']);router[_0x4db9('0x7')](_0x4db9('0x9'),auth[_0x4db9('0xa')](),controller[_0x4db9('0xb')]);router[_0x4db9('0x7')](_0x4db9('0xc'),auth[_0x4db9('0xa')](),controller[_0x4db9('0xd')]);router[_0x4db9('0x7')](_0x4db9('0xe'),auth[_0x4db9('0x8')](),controller['getMessages']);router[_0x4db9('0x7')](_0x4db9('0xf'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router[_0x4db9('0x7')]('/:id/download',auth['isAuthenticated'](),controller[_0x4db9('0x10')]);router[_0x4db9('0x11')]('/',auth['isAuthenticated'](),controller[_0x4db9('0x12')]);var upload=multer({'storage':multer[_0x4db9('0x13')]({'destination':function(_0x452896,_0x22667c,_0x51d024){_0x51d024(null,path['join'](config[_0x4db9('0x14')],_0x4db9('0x15')));},'filename':function(_0x4a037f,_0xadc104,_0x4976){_0x4976(null,util['format']('%s-%s',Date[_0x4db9('0x16')](),_0xadc104[_0x4db9('0x17')][_0x4db9('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x4db9('0x11')](_0x4db9('0x19'),upload['single'](_0x4db9('0x1a')),controller[_0x4db9('0x1b')]);router[_0x4db9('0x11')]('/:id/messages',auth[_0x4db9('0xa')](),controller[_0x4db9('0x1c')]);router[_0x4db9('0x11')]('/:id/tags',auth[_0x4db9('0x8')](),interaction[_0x4db9('0x1d')](_0x4db9('0x1e'),_0x4db9('0x1f')),controller[_0x4db9('0x20')]);router[_0x4db9('0x21')](_0x4db9('0x9'),auth['isAuthenticated'](),interaction[_0x4db9('0x1d')](_0x4db9('0x1e'),_0x4db9('0x22')),controller[_0x4db9('0x23')]);router['put'](_0x4db9('0x24'),controller[_0x4db9('0x25')]);router['put'](_0x4db9('0x26'),auth[_0x4db9('0xa')](),controller[_0x4db9('0x27')]);router['put'](_0x4db9('0x28'),controller[_0x4db9('0x29')]);router[_0x4db9('0x2a')](_0x4db9('0x9'),auth[_0x4db9('0x8')](),interaction[_0x4db9('0x1d')](_0x4db9('0x1e'),_0x4db9('0x2b')),controller[_0x4db9('0x2c')]);router[_0x4db9('0x2a')](_0x4db9('0x2d'),auth[_0x4db9('0x8')](),controller[_0x4db9('0x2e')]);module[_0x4db9('0x2f')]=router; \ No newline at end of file +var _0xd824=['../../config/environment','./chatInteraction.controller','index','isAuthenticated','describe','get','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','create','diskStorage','join','server/files/attachments/','format','%s-%s','now','originalname','replace','post','/:id/attachment_upload','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','chatinteraction:destroy','delete','removeTags','multer','util','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x1d3791,_0x51c613){var _0x40fbf5=function(_0xe5d147){while(--_0xe5d147){_0x1d3791['push'](_0x1d3791['shift']());}};_0x40fbf5(++_0x51c613);}(_0xd824,0xc2));var _0x4d82=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd824[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x4d82('0x0'));var util=require(_0x4d82('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4d82('0x2'));var router=express[_0x4d82('0x3')]();var auth=require(_0x4d82('0x4'));var interaction=require(_0x4d82('0x5'));var config=require(_0x4d82('0x6'));var controller=require(_0x4d82('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x4d82('0x8')]);router['get']('/describe',auth[_0x4d82('0x9')](),controller[_0x4d82('0xa')]);router[_0x4d82('0xb')]('/:id',auth[_0x4d82('0xc')](),controller['show']);router['get'](_0x4d82('0xd'),auth[_0x4d82('0xc')](),controller[_0x4d82('0xe')]);router['get'](_0x4d82('0xf'),auth['isAuthenticated'](),controller[_0x4d82('0x10')]);router[_0x4d82('0xb')](_0x4d82('0x11'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router[_0x4d82('0xb')](_0x4d82('0x12'),auth[_0x4d82('0x9')](),controller[_0x4d82('0x13')]);router['post']('/',auth[_0x4d82('0x9')](),controller[_0x4d82('0x14')]);var upload=multer({'storage':multer[_0x4d82('0x15')]({'destination':function(_0x486152,_0x70c598,_0x4f4c45){_0x4f4c45(null,path[_0x4d82('0x16')](config['root'],_0x4d82('0x17')));},'filename':function(_0x496f3b,_0x474acf,_0xb1640d){_0xb1640d(null,util[_0x4d82('0x18')](_0x4d82('0x19'),Date[_0x4d82('0x1a')](),_0x474acf[_0x4d82('0x1b')][_0x4d82('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x4d82('0x1d')](_0x4d82('0x1e'),upload['single'](_0x4d82('0x1f')),controller[_0x4d82('0x20')]);router[_0x4d82('0x1d')](_0x4d82('0xf'),auth[_0x4d82('0xc')](),controller[_0x4d82('0x21')]);router[_0x4d82('0x1d')](_0x4d82('0x22'),auth[_0x4d82('0x9')](),interaction[_0x4d82('0x23')](_0x4d82('0x24'),'chatinteraction:addtags'),controller[_0x4d82('0x25')]);router[_0x4d82('0x26')]('/:id',auth[_0x4d82('0x9')](),interaction[_0x4d82('0x23')](_0x4d82('0x24'),_0x4d82('0x27')),controller[_0x4d82('0x28')]);router[_0x4d82('0x26')](_0x4d82('0x29'),controller[_0x4d82('0x2a')]);router[_0x4d82('0x26')](_0x4d82('0x2b'),auth[_0x4d82('0xc')](),controller[_0x4d82('0x2c')]);router[_0x4d82('0x26')](_0x4d82('0x2d'),controller[_0x4d82('0x2e')]);router['delete']('/:id',auth[_0x4d82('0x9')](),interaction[_0x4d82('0x23')](_0x4d82('0x24'),_0x4d82('0x2f')),controller['destroy']);router[_0x4d82('0x30')](_0x4d82('0x22'),auth[_0x4d82('0x9')](),controller[_0x4d82('0x31')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 620ee20..3414dd1 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 _0x7fea=['BOOLEAN','INTEGER','exports'];(function(_0x1ac002,_0x1f8b3d){var _0x5118d5=function(_0x5d7323){while(--_0x5d7323){_0x1ac002['push'](_0x1ac002['shift']());}};_0x5118d5(++_0x1f8b3d);}(_0x7fea,0x149));var _0xa7fe=function(_0x490832,_0x272178){_0x490832=_0x490832-0x0;var _0x224970=_0x7fea[_0x490832];return _0x224970;};'use strict';var Sequelize=require('sequelize');module[_0xa7fe('0x0')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xa7fe('0x1')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xa7fe('0x2')]}}; \ No newline at end of file +var _0x160f=['sequelize','exports','TEXT','medium','INTEGER'];(function(_0x3b8ccf,_0x4dad64){var _0x59b109=function(_0x2efaab){while(--_0x2efaab){_0x3b8ccf['push'](_0x3b8ccf['shift']());}};_0x59b109(++_0x4dad64);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xf160('0x0'));module[_0xf160('0x1')]={'body':{'type':Sequelize[_0xf160('0x2')](_0xf160('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xf160('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 7198d4b..02d092e 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 _0x6f59=['include','findAll','show','params','find','create','body','catch','update','describe','get','messages','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','isEmpty','push','FromId','read','-createdAt','all','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','socket.io-emitter','./chatInternalMessage.socket','register','status','end','offset','set','json','apply','reject','then','sendStatus','stack','name','send','index','ChatInternalMessage','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','field','options','count','includeAll'];(function(_0x323640,_0x23e0d9){var _0x4ca925=function(_0xeefac2){while(--_0xeefac2){_0x323640['push'](_0x323640['shift']());}};_0x4ca925(++_0x23e0d9);}(_0x6f59,0x94));var _0x96f5=function(_0x311f3e,_0x196f94){_0x311f3e=_0x311f3e-0x0;var _0x3d90db=_0x6f59[_0x311f3e];return _0x3d90db;};'use strict';var pdf=require(_0x96f5('0x0'));var emlformat=require(_0x96f5('0x1'));var rimraf=require(_0x96f5('0x2'));var zipdir=require(_0x96f5('0x3'));var jsonpatch=require(_0x96f5('0x4'));var rp=require(_0x96f5('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x96f5('0x6'));var util=require(_0x96f5('0x7'));var path=require(_0x96f5('0x8'));var sox=require(_0x96f5('0x9'));var csv=require(_0x96f5('0xa'));var ejs=require(_0x96f5('0xb'));var fs=require('fs');var _=require(_0x96f5('0xc'));var squel=require(_0x96f5('0xd'));var crypto=require('crypto');var jsforce=require(_0x96f5('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x96f5('0xa'));var querystring=require(_0x96f5('0xf'));var Papa=require(_0x96f5('0x10'));var Redis=require('ioredis');var authService=require(_0x96f5('0x11'));var qs=require(_0x96f5('0x12'));var hardwareService=require(_0x96f5('0x13'));var logger=require(_0x96f5('0x14'))(_0x96f5('0x15'));var utils=require(_0x96f5('0x16'));var config=require(_0x96f5('0x17'));var db=require('../../mysqldb')['db'];config[_0x96f5('0x18')]=_['defaults'](config[_0x96f5('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x96f5('0x19'))(new Redis(config[_0x96f5('0x18')]));require(_0x96f5('0x1a'))[_0x96f5('0x1b')](socket);function respondWithStatusCode(_0x1eac25,_0xdfbac){_0xdfbac=_0xdfbac||0xcc;return function(_0x583885){if(_0x583885){return _0x1eac25['sendStatus'](_0xdfbac);}return _0x1eac25[_0x96f5('0x1c')](_0xdfbac)[_0x96f5('0x1d')]();};}function respondWithResult(_0x186765,_0x5ad505){_0x5ad505=_0x5ad505||0xc8;return function(_0x3184c2){if(_0x3184c2){return _0x186765['status'](_0x5ad505)['json'](_0x3184c2);}};}function respondWithFilteredResult(_0x3e746b,_0x2e96bf){return function(_0x26802b){if(_0x26802b){var _0x1c790b=_0x26802b['count'],_0x466b97=_0x2e96bf[_0x96f5('0x1e')],_0x57751e=_0x2e96bf[_0x96f5('0x1e')]+_0x2e96bf['limit'],_0x5acc03;if(_0x57751e>=_0x1c790b){_0x57751e=_0x1c790b;_0x5acc03=0xc8;}else{_0x5acc03=0xce;}_0x3e746b[_0x96f5('0x1c')](_0x5acc03);return _0x3e746b[_0x96f5('0x1f')]('Content-Range',_0x466b97+'-'+_0x57751e+'/'+_0x1c790b)[_0x96f5('0x20')](_0x26802b);}return null;};}function patchUpdates(_0x3e141b){return function(_0x31bd1c){try{jsonpatch[_0x96f5('0x21')](_0x31bd1c,_0x3e141b,!![]);}catch(_0x1d1c32){return BPromise[_0x96f5('0x22')](_0x1d1c32);}return _0x31bd1c['save']();};}function saveUpdates(_0x293111,_0x2526fe){return function(_0x2e8c48){if(_0x2e8c48){return _0x2e8c48['update'](_0x293111)[_0x96f5('0x23')](function(_0x58d223){return _0x58d223;});}return null;};}function removeEntity(_0x20f49f,_0x12ac65){return function(_0x14f75c){if(_0x14f75c){return _0x14f75c['destroy']()[_0x96f5('0x23')](function(){_0x20f49f[_0x96f5('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2af13c,_0x984e4f){return function(_0x276e1c){if(!_0x276e1c){_0x2af13c[_0x96f5('0x24')](0x194);}return _0x276e1c;};}function handleError(_0x3eb3d6,_0x3baf62){_0x3baf62=_0x3baf62||0x1f4;return function(_0x3d2e4f){logger['error'](_0x3d2e4f[_0x96f5('0x25')]);if(_0x3d2e4f[_0x96f5('0x26')]){delete _0x3d2e4f[_0x96f5('0x26')];}_0x3eb3d6['status'](_0x3baf62)[_0x96f5('0x27')](_0x3d2e4f);};}exports[_0x96f5('0x28')]=function(_0x91a475,_0x4a6e7c){var _0x3b7eab={},_0x862459={},_0x320cbc={'count':0x0,'rows':[]};var _0x132075=db[_0x96f5('0x29')][_0x96f5('0x2a')];_0x862459['model']=_[_0x96f5('0x2b')](_0x132075);_0x862459[_0x96f5('0x2c')]=_[_0x96f5('0x2b')](_0x91a475[_0x96f5('0x2c')]);_0x862459[_0x96f5('0x2d')]=_[_0x96f5('0x2e')](_0x862459['model'],_0x862459[_0x96f5('0x2c')]);_0x3b7eab['attributes']=_['intersection'](_0x862459[_0x96f5('0x2f')],qs[_0x96f5('0x30')](_0x91a475['query'][_0x96f5('0x30')]));_0x3b7eab[_0x96f5('0x31')]=_0x3b7eab[_0x96f5('0x31')][_0x96f5('0x32')]?_0x3b7eab[_0x96f5('0x31')]:_0x862459[_0x96f5('0x2f')];if(!_0x91a475[_0x96f5('0x2c')][_0x96f5('0x33')](_0x96f5('0x34'))){_0x3b7eab[_0x96f5('0x35')]=qs['limit'](_0x91a475['query'][_0x96f5('0x35')]);_0x3b7eab[_0x96f5('0x1e')]=qs[_0x96f5('0x1e')](_0x91a475[_0x96f5('0x2c')][_0x96f5('0x1e')]);}_0x3b7eab[_0x96f5('0x36')]=qs[_0x96f5('0x37')](_0x91a475[_0x96f5('0x2c')][_0x96f5('0x37')]);_0x3b7eab[_0x96f5('0x38')]=qs['filters'](_[_0x96f5('0x39')](_0x91a475[_0x96f5('0x2c')],_0x862459[_0x96f5('0x2d')]));if(_0x91a475[_0x96f5('0x2c')][_0x96f5('0x3a')]){_0x3b7eab[_0x96f5('0x38')]=_[_0x96f5('0x3b')](_0x3b7eab[_0x96f5('0x38')],{'$or':_['map'](_0x132075,function(_0x1b4e08){if(_0x1b4e08[_0x96f5('0x3c')]['key']!==_0x96f5('0x3d')){var _0x293e25={};_0x293e25[_0x1b4e08[_0x96f5('0x3e')]]={'$like':'%'+_0x91a475[_0x96f5('0x2c')][_0x96f5('0x3a')]+'%'};return _0x293e25;}})});}_0x3b7eab=_[_0x96f5('0x3b')]({},_0x3b7eab,_0x91a475[_0x96f5('0x3f')]);var _0x2a9eee={'where':_0x3b7eab[_0x96f5('0x38')]};return db[_0x96f5('0x29')][_0x96f5('0x40')](_0x2a9eee)[_0x96f5('0x23')](function(_0x306bea){_0x320cbc[_0x96f5('0x40')]=_0x306bea;if(_0x91a475['query'][_0x96f5('0x41')]){_0x3b7eab[_0x96f5('0x42')]=[{'all':!![]}];}return db[_0x96f5('0x29')][_0x96f5('0x43')](_0x3b7eab);})[_0x96f5('0x23')](function(_0xf52de6){_0x320cbc['rows']=_0xf52de6;return _0x320cbc;})[_0x96f5('0x23')](respondWithFilteredResult(_0x4a6e7c,_0x3b7eab))['catch'](handleError(_0x4a6e7c,null));};exports[_0x96f5('0x44')]=function(_0x12ba49,_0xb009c){var _0x2b0e76={'raw':!![],'where':{'id':_0x12ba49[_0x96f5('0x45')]['id']}},_0x4e6cd4={};_0x4e6cd4[_0x96f5('0x2f')]=_['keys'](db[_0x96f5('0x29')]['rawAttributes']);_0x4e6cd4[_0x96f5('0x2c')]=_[_0x96f5('0x2b')](_0x12ba49[_0x96f5('0x2c')]);_0x4e6cd4['filters']=_[_0x96f5('0x2e')](_0x4e6cd4[_0x96f5('0x2f')],_0x4e6cd4[_0x96f5('0x2c')]);_0x2b0e76['attributes']=_[_0x96f5('0x2e')](_0x4e6cd4[_0x96f5('0x2f')],qs[_0x96f5('0x30')](_0x12ba49['query']['fields']));_0x2b0e76['attributes']=_0x2b0e76[_0x96f5('0x31')][_0x96f5('0x32')]?_0x2b0e76['attributes']:_0x4e6cd4['model'];if(_0x12ba49[_0x96f5('0x2c')][_0x96f5('0x41')]){_0x2b0e76[_0x96f5('0x42')]=[{'all':!![]}];}_0x2b0e76=_[_0x96f5('0x3b')]({},_0x2b0e76,_0x12ba49[_0x96f5('0x3f')]);return db[_0x96f5('0x29')][_0x96f5('0x46')](_0x2b0e76)[_0x96f5('0x23')](handleEntityNotFound(_0xb009c,null))['then'](respondWithResult(_0xb009c,null))['catch'](handleError(_0xb009c,null));};exports[_0x96f5('0x47')]=function(_0x2a6660,_0x5e66c0){return db[_0x96f5('0x29')][_0x96f5('0x47')](_0x2a6660[_0x96f5('0x48')],{})[_0x96f5('0x23')](respondWithResult(_0x5e66c0,0xc9))[_0x96f5('0x49')](handleError(_0x5e66c0,null));};exports[_0x96f5('0x4a')]=function(_0x523869,_0x17a2c3){if(_0x523869['body']['id']){delete _0x523869[_0x96f5('0x48')]['id'];}return db[_0x96f5('0x29')][_0x96f5('0x46')]({'where':{'id':_0x523869[_0x96f5('0x45')]['id']}})['then'](handleEntityNotFound(_0x17a2c3,null))['then'](saveUpdates(_0x523869[_0x96f5('0x48')],null))[_0x96f5('0x23')](respondWithResult(_0x17a2c3,null))['catch'](handleError(_0x17a2c3,null));};exports['destroy']=function(_0x56962e,_0x267dc4){return db[_0x96f5('0x29')][_0x96f5('0x46')]({'where':{'id':_0x56962e[_0x96f5('0x45')]['id']}})[_0x96f5('0x23')](handleEntityNotFound(_0x267dc4,null))[_0x96f5('0x23')](removeEntity(_0x267dc4,null))[_0x96f5('0x49')](handleError(_0x267dc4,null));};exports[_0x96f5('0x4b')]=function(_0x57eafe,_0x41dbf2){return db[_0x96f5('0x29')][_0x96f5('0x4b')]()[_0x96f5('0x23')](respondWithResult(_0x41dbf2,null))[_0x96f5('0x49')](handleError(_0x41dbf2,null));};function wrapUser(_0x196a7d){return function(_0x23ddd1){var _0xa7ae28=_0x196a7d[_0x96f5('0x4c')]({'plain':!![]});_0xa7ae28[_0x96f5('0x4d')]=[];if(_0x23ddd1){_0xa7ae28['lastMessageAt']=_0x23ddd1[_0x96f5('0x4e')];_0xa7ae28[_0x96f5('0x4f')]=_0x23ddd1;}else{_0xa7ae28['lastMessageAt']=moment(0x0)[_0x96f5('0x50')](_0x96f5('0x51'));_0xa7ae28[_0x96f5('0x4f')]={};}return _0xa7ae28;};}exports[_0x96f5('0x52')]=function(_0x59f8f0,_0x3ae479,_0x720858){var _0x12de26=[];return db[_0x96f5('0x53')][_0x96f5('0x43')]({'where':{'role':[_0x96f5('0x54'),_0x96f5('0x55'),_0x96f5('0x56')]},'attributes':['id','fullname',_0x96f5('0x26'),_0x96f5('0x57'),_0x96f5('0x58'),_0x96f5('0x59'),_0x96f5('0x5a'),_0x96f5('0x5b'),_0x96f5('0x5c'),_0x96f5('0x5d')],'order':qs[_0x96f5('0x37')](_0x96f5('0x5e')),'include':[{'model':db[_0x96f5('0x5f')],'as':_0x96f5('0x60'),'attributes':['id',_0x96f5('0x26'),_0x96f5('0x3c')],'through':{'attributes':[]}}]})[_0x96f5('0x23')](function(_0xf5f670){if(_0xf5f670){var _0x535974=_0x59f8f0['user']['get']({'plain':!![]});if(!_0x535974)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x535974[_0x96f5('0x57')]==='user'){return db[_0x96f5('0x61')]['find']({'where':{'name':'Agents','userProfileId':_0x535974[_0x96f5('0x62')]},'raw':!![]})[_0x96f5('0x23')](function(_0x376d51){if(_0x376d51){if(_0x376d51[_0x96f5('0x63')]===0x0){return db[_0x96f5('0x64')][_0x96f5('0x43')]({'where':{'sectionId':_0x376d51['id']},'raw':!![]})[_0x96f5('0x23')](function(_0x55f675){var _0x57668b=[];if(_[_0x96f5('0x65')](_0x55f675)){_0x57668b=_[_0x96f5('0x3a')](_0xf5f670,function(_0xa5fa91){if(_0xa5fa91[_0x96f5('0x57')]!==_0x96f5('0x54')){return _0xa5fa91;}});return _0x57668b;}else{for(var _0x331790=0x0;_0x331790<_0xf5f670['length'];_0x331790++){var _0x8dadd0=_0xf5f670[_0x331790];if(_0x8dadd0[_0x96f5('0x57')]===_0x96f5('0x54')){var _0x1d9188=_[_0x96f5('0x46')](_0x55f675,function(_0x5c0a2e){return _0x5c0a2e['resourceId']===_0x8dadd0['id'];});if(_0x1d9188)_0x57668b[_0x96f5('0x66')](_0x8dadd0);}else{_0x57668b[_0x96f5('0x66')](_0x8dadd0);}}return _0x57668b;}});}else{return _0xf5f670;}}else{var _0xda5508=_[_0x96f5('0x3a')](_0xf5f670,function(_0x5b1c3c){if(_0x5b1c3c[_0x96f5('0x57')]!==_0x96f5('0x54')){return _0x5b1c3c;}});return _0xda5508;}});}else{return _0xf5f670;}}})['then'](function(_0xd1c624){var _0x2802ce=[];if(_0xd1c624){_0x12de26=_0xd1c624;for(var _0x393846=0x0;_0x393846<_0xd1c624['length'];_0x393846+=0x1){_0x12de26[_0x393846][_0x96f5('0x4d')]=[];_0x2802ce[_0x96f5('0x66')](db[_0x96f5('0x29')][_0x96f5('0x46')]({'where':{'FromId':[_0x59f8f0[_0x96f5('0x56')]['id'],_0xd1c624[_0x393846]['id']],'ToId':[_0x59f8f0[_0x96f5('0x56')]['id'],_0xd1c624[_0x393846]['id']],'ChatGroupId':null},'attributes':['id',_0x96f5('0x4e'),_0x96f5('0x67'),'ToId',_0x96f5('0x68'),_0x96f5('0x48')],'order':qs['sort'](_0x96f5('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0xd1c624[_0x393846])));}return BPromise[_0x96f5('0x6a')](_0x2802ce);}return[];})[_0x96f5('0x23')](function(_0x196925){return{'rows':_0x196925,'count':_0x196925[_0x96f5('0x32')]};})[_0x96f5('0x23')](respondWithResult(_0x3ae479,null))[_0x96f5('0x49')](handleError(_0x3ae479,null));}; \ No newline at end of file +var _0x653f=['push','createdAt','FromId','ToId','all','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','sendStatus','status','json','offset','limit','apply','destroy','then','end','name','index','ChatInternalMessage','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','key','field','filter','options','count','includeAll','include','findAll','catch','show','params','length','find','create','body','update','describe','get','messages','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','admin','user','fullname','role','userpic','online','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','type','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','autoAssociation','UserProfileResource','agent','resourceId'];(function(_0x5dafc9,_0x5b812d){var _0x160254=function(_0x482867){while(--_0x482867){_0x5dafc9['push'](_0x5dafc9['shift']());}};_0x160254(++_0x5b812d);}(_0x653f,0x191));var _0xf653=function(_0x383b65,_0x193d2f){_0x383b65=_0x383b65-0x0;var _0x53b472=_0x653f[_0x383b65];return _0x53b472;};'use strict';var pdf=require(_0xf653('0x0'));var emlformat=require(_0xf653('0x1'));var rimraf=require(_0xf653('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf653('0x3'));var rp=require(_0xf653('0x4'));var moment=require(_0xf653('0x5'));var BPromise=require(_0xf653('0x6'));var Mustache=require(_0xf653('0x7'));var util=require(_0xf653('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xf653('0x9'));var ejs=require(_0xf653('0xa'));var fs=require('fs');var _=require(_0xf653('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf653('0x9'));var querystring=require('querystring');var Papa=require(_0xf653('0xc'));var Redis=require(_0xf653('0xd'));var authService=require(_0xf653('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf653('0xf'))(_0xf653('0x10'));var utils=require(_0xf653('0x11'));var config=require(_0xf653('0x12'));var db=require('../../mysqldb')['db'];config[_0xf653('0x13')]=_[_0xf653('0x14')](config[_0xf653('0x13')],{'host':_0xf653('0x15'),'port':0x18eb});var socket=require(_0xf653('0x16'))(new Redis(config[_0xf653('0x13')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithStatusCode(_0x5b61e3,_0x143df2){_0x143df2=_0x143df2||0xcc;return function(_0x4ca426){if(_0x4ca426){return _0x5b61e3[_0xf653('0x17')](_0x143df2);}return _0x5b61e3[_0xf653('0x18')](_0x143df2)['end']();};}function respondWithResult(_0x15bd65,_0xc42ac4){_0xc42ac4=_0xc42ac4||0xc8;return function(_0x51ca29){if(_0x51ca29){return _0x15bd65[_0xf653('0x18')](_0xc42ac4)[_0xf653('0x19')](_0x51ca29);}};}function respondWithFilteredResult(_0x417a46,_0x2506b7){return function(_0x493b4a){if(_0x493b4a){var _0x2b06d3=_0x493b4a['count'],_0x254550=_0x2506b7[_0xf653('0x1a')],_0xb87a57=_0x2506b7[_0xf653('0x1a')]+_0x2506b7[_0xf653('0x1b')],_0x3aadd6;if(_0xb87a57>=_0x2b06d3){_0xb87a57=_0x2b06d3;_0x3aadd6=0xc8;}else{_0x3aadd6=0xce;}_0x417a46[_0xf653('0x18')](_0x3aadd6);return _0x417a46['set']('Content-Range',_0x254550+'-'+_0xb87a57+'/'+_0x2b06d3)['json'](_0x493b4a);}return null;};}function patchUpdates(_0x5c8a58){return function(_0x79ef45){try{jsonpatch[_0xf653('0x1c')](_0x79ef45,_0x5c8a58,!![]);}catch(_0x7c227b){return BPromise['reject'](_0x7c227b);}return _0x79ef45['save']();};}function saveUpdates(_0x2c84f2,_0x3ece90){return function(_0x24fe63){if(_0x24fe63){return _0x24fe63['update'](_0x2c84f2)['then'](function(_0x5c8a31){return _0x5c8a31;});}return null;};}function removeEntity(_0x5995c1,_0x3cacc9){return function(_0x5d7e53){if(_0x5d7e53){return _0x5d7e53[_0xf653('0x1d')]()[_0xf653('0x1e')](function(){_0x5995c1[_0xf653('0x18')](0xcc)[_0xf653('0x1f')]();});}};}function handleEntityNotFound(_0x527704,_0x9c3352){return function(_0xc5c60f){if(!_0xc5c60f){_0x527704[_0xf653('0x17')](0x194);}return _0xc5c60f;};}function handleError(_0x26af28,_0xa5d835){_0xa5d835=_0xa5d835||0x1f4;return function(_0x3b23a1){logger['error'](_0x3b23a1['stack']);if(_0x3b23a1[_0xf653('0x20')]){delete _0x3b23a1['name'];}_0x26af28[_0xf653('0x18')](_0xa5d835)['send'](_0x3b23a1);};}exports[_0xf653('0x21')]=function(_0x272014,_0x4cce64){var _0x3e8a2c={},_0x30ab8d={},_0x39bf46={'count':0x0,'rows':[]};var _0x4db5dc=db[_0xf653('0x22')][_0xf653('0x23')];_0x30ab8d[_0xf653('0x24')]=_[_0xf653('0x25')](_0x4db5dc);_0x30ab8d[_0xf653('0x26')]=_['keys'](_0x272014[_0xf653('0x26')]);_0x30ab8d[_0xf653('0x27')]=_[_0xf653('0x28')](_0x30ab8d['model'],_0x30ab8d[_0xf653('0x26')]);_0x3e8a2c['attributes']=_[_0xf653('0x28')](_0x30ab8d[_0xf653('0x24')],qs[_0xf653('0x29')](_0x272014[_0xf653('0x26')][_0xf653('0x29')]));_0x3e8a2c[_0xf653('0x2a')]=_0x3e8a2c[_0xf653('0x2a')]['length']?_0x3e8a2c[_0xf653('0x2a')]:_0x30ab8d[_0xf653('0x24')];if(!_0x272014[_0xf653('0x26')][_0xf653('0x2b')](_0xf653('0x2c'))){_0x3e8a2c[_0xf653('0x1b')]=qs[_0xf653('0x1b')](_0x272014[_0xf653('0x26')][_0xf653('0x1b')]);_0x3e8a2c[_0xf653('0x1a')]=qs[_0xf653('0x1a')](_0x272014['query'][_0xf653('0x1a')]);}_0x3e8a2c[_0xf653('0x2d')]=qs[_0xf653('0x2e')](_0x272014['query'][_0xf653('0x2e')]);_0x3e8a2c[_0xf653('0x2f')]=qs[_0xf653('0x27')](_[_0xf653('0x30')](_0x272014[_0xf653('0x26')],_0x30ab8d[_0xf653('0x27')]));if(_0x272014[_0xf653('0x26')]['filter']){_0x3e8a2c[_0xf653('0x2f')]=_[_0xf653('0x31')](_0x3e8a2c[_0xf653('0x2f')],{'$or':_[_0xf653('0x32')](_0x4db5dc,function(_0x1ca301){if(_0x1ca301['type'][_0xf653('0x33')]!=='VIRTUAL'){var _0x138e97={};_0x138e97[_0x1ca301[_0xf653('0x34')]]={'$like':'%'+_0x272014[_0xf653('0x26')][_0xf653('0x35')]+'%'};return _0x138e97;}})});}_0x3e8a2c=_['merge']({},_0x3e8a2c,_0x272014[_0xf653('0x36')]);var _0x443bfd={'where':_0x3e8a2c[_0xf653('0x2f')]};return db[_0xf653('0x22')][_0xf653('0x37')](_0x443bfd)[_0xf653('0x1e')](function(_0x562c2e){_0x39bf46['count']=_0x562c2e;if(_0x272014[_0xf653('0x26')][_0xf653('0x38')]){_0x3e8a2c[_0xf653('0x39')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0xf653('0x3a')](_0x3e8a2c);})[_0xf653('0x1e')](function(_0x33f390){_0x39bf46['rows']=_0x33f390;return _0x39bf46;})[_0xf653('0x1e')](respondWithFilteredResult(_0x4cce64,_0x3e8a2c))[_0xf653('0x3b')](handleError(_0x4cce64,null));};exports[_0xf653('0x3c')]=function(_0x32c480,_0xdeb797){var _0x3ebb3b={'raw':!![],'where':{'id':_0x32c480[_0xf653('0x3d')]['id']}},_0x154bb8={};_0x154bb8['model']=_[_0xf653('0x25')](db[_0xf653('0x22')][_0xf653('0x23')]);_0x154bb8[_0xf653('0x26')]=_[_0xf653('0x25')](_0x32c480[_0xf653('0x26')]);_0x154bb8[_0xf653('0x27')]=_['intersection'](_0x154bb8[_0xf653('0x24')],_0x154bb8[_0xf653('0x26')]);_0x3ebb3b[_0xf653('0x2a')]=_[_0xf653('0x28')](_0x154bb8['model'],qs[_0xf653('0x29')](_0x32c480[_0xf653('0x26')][_0xf653('0x29')]));_0x3ebb3b[_0xf653('0x2a')]=_0x3ebb3b[_0xf653('0x2a')][_0xf653('0x3e')]?_0x3ebb3b[_0xf653('0x2a')]:_0x154bb8[_0xf653('0x24')];if(_0x32c480['query'][_0xf653('0x38')]){_0x3ebb3b['include']=[{'all':!![]}];}_0x3ebb3b=_[_0xf653('0x31')]({},_0x3ebb3b,_0x32c480[_0xf653('0x36')]);return db[_0xf653('0x22')][_0xf653('0x3f')](_0x3ebb3b)['then'](handleEntityNotFound(_0xdeb797,null))[_0xf653('0x1e')](respondWithResult(_0xdeb797,null))['catch'](handleError(_0xdeb797,null));};exports[_0xf653('0x40')]=function(_0x444906,_0x5c1fea){return db[_0xf653('0x22')]['create'](_0x444906[_0xf653('0x41')],{})[_0xf653('0x1e')](respondWithResult(_0x5c1fea,0xc9))[_0xf653('0x3b')](handleError(_0x5c1fea,null));};exports[_0xf653('0x42')]=function(_0x317ea7,_0x2c6b3f){if(_0x317ea7[_0xf653('0x41')]['id']){delete _0x317ea7[_0xf653('0x41')]['id'];}return db[_0xf653('0x22')][_0xf653('0x3f')]({'where':{'id':_0x317ea7[_0xf653('0x3d')]['id']}})[_0xf653('0x1e')](handleEntityNotFound(_0x2c6b3f,null))['then'](saveUpdates(_0x317ea7[_0xf653('0x41')],null))[_0xf653('0x1e')](respondWithResult(_0x2c6b3f,null))[_0xf653('0x3b')](handleError(_0x2c6b3f,null));};exports['destroy']=function(_0x323bb1,_0xea4c54){return db[_0xf653('0x22')]['find']({'where':{'id':_0x323bb1[_0xf653('0x3d')]['id']}})['then'](handleEntityNotFound(_0xea4c54,null))[_0xf653('0x1e')](removeEntity(_0xea4c54,null))[_0xf653('0x3b')](handleError(_0xea4c54,null));};exports[_0xf653('0x43')]=function(_0x1f031b,_0x599ae8){return db[_0xf653('0x22')][_0xf653('0x43')]()['then'](respondWithResult(_0x599ae8,null))['catch'](handleError(_0x599ae8,null));};function wrapUser(_0x45657c){return function(_0x4e5070){var _0x4bc0cd=_0x45657c[_0xf653('0x44')]({'plain':!![]});_0x4bc0cd[_0xf653('0x45')]=[];if(_0x4e5070){_0x4bc0cd[_0xf653('0x46')]=_0x4e5070['createdAt'];_0x4bc0cd[_0xf653('0x47')]=_0x4e5070;}else{_0x4bc0cd['lastMessageAt']=moment(0x0)[_0xf653('0x48')](_0xf653('0x49'));_0x4bc0cd[_0xf653('0x47')]={};}return _0x4bc0cd;};}exports[_0xf653('0x4a')]=function(_0x149a1c,_0x1eccc4,_0x498846){var _0x4e6cb6=[];return db[_0xf653('0x4b')][_0xf653('0x3a')]({'where':{'role':['agent',_0xf653('0x4c'),_0xf653('0x4d')]},'attributes':['id',_0xf653('0x4e'),'name',_0xf653('0x4f'),_0xf653('0x50'),'internal',_0xf653('0x51'),'lastLoginAt',_0xf653('0x52'),_0xf653('0x53')],'order':qs['sort'](_0xf653('0x54')),'include':[{'model':db[_0xf653('0x55')],'as':_0xf653('0x56'),'attributes':['id',_0xf653('0x20'),_0xf653('0x57')],'through':{'attributes':[]}}]})[_0xf653('0x1e')](function(_0x378c37){if(_0x378c37){var _0x495813=_0x149a1c['user'][_0xf653('0x44')]({'plain':!![]});if(!_0x495813)throw new Error(_0xf653('0x58'));if(_0x495813[_0xf653('0x4f')]===_0xf653('0x4d')){return db['UserProfileSection'][_0xf653('0x3f')]({'where':{'name':_0xf653('0x59'),'userProfileId':_0x495813['userProfileId']},'raw':!![]})[_0xf653('0x1e')](function(_0x591e2f){if(_0x591e2f){if(_0x591e2f[_0xf653('0x5a')]===0x0){return db[_0xf653('0x5b')][_0xf653('0x3a')]({'where':{'sectionId':_0x591e2f['id']},'raw':!![]})[_0xf653('0x1e')](function(_0x20ecab){var _0x5a60ec=[];if(_['isEmpty'](_0x20ecab)){_0x5a60ec=_[_0xf653('0x35')](_0x378c37,function(_0x5ae226){if(_0x5ae226['role']!==_0xf653('0x5c')){return _0x5ae226;}});return _0x5a60ec;}else{for(var _0x5afb0a=0x0;_0x5afb0a<_0x378c37['length'];_0x5afb0a++){var _0x32683c=_0x378c37[_0x5afb0a];if(_0x32683c['role']==='agent'){var _0x576b8f=_['find'](_0x20ecab,function(_0x5d6c93){return _0x5d6c93[_0xf653('0x5d')]===_0x32683c['id'];});if(_0x576b8f)_0x5a60ec[_0xf653('0x5e')](_0x32683c);}else{_0x5a60ec[_0xf653('0x5e')](_0x32683c);}}return _0x5a60ec;}});}else{return _0x378c37;}}else{var _0x6ff684=_[_0xf653('0x35')](_0x378c37,function(_0x13dab5){if(_0x13dab5['role']!==_0xf653('0x5c')){return _0x13dab5;}});return _0x6ff684;}});}else{return _0x378c37;}}})['then'](function(_0x40d715){var _0x5ad997=[];if(_0x40d715){_0x4e6cb6=_0x40d715;for(var _0x264e82=0x0;_0x264e82<_0x40d715[_0xf653('0x3e')];_0x264e82+=0x1){_0x4e6cb6[_0x264e82]['messages']=[];_0x5ad997[_0xf653('0x5e')](db[_0xf653('0x22')][_0xf653('0x3f')]({'where':{'FromId':[_0x149a1c[_0xf653('0x4d')]['id'],_0x40d715[_0x264e82]['id']],'ToId':[_0x149a1c[_0xf653('0x4d')]['id'],_0x40d715[_0x264e82]['id']],'ChatGroupId':null},'attributes':['id',_0xf653('0x5f'),_0xf653('0x60'),_0xf653('0x61'),'read','body'],'order':qs['sort']('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x40d715[_0x264e82])));}return BPromise[_0xf653('0x62')](_0x5ad997);}return[];})[_0xf653('0x1e')](function(_0xe2c1ce){return{'rows':_0xe2c1ce,'count':_0xe2c1ce[_0xf653('0x3e')]};})[_0xf653('0x1e')](respondWithResult(_0x1eccc4,null))[_0xf653('0x3b')](handleError(_0x1eccc4,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 5d232a9..59616a7 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 _0xe130=['../../mysqldb','setMaxListeners','save','update','remove','emit','hook','events'];(function(_0x165154,_0x4475c8){var _0xb828e5=function(_0x489cb5){while(--_0x489cb5){_0x165154['push'](_0x165154['shift']());}};_0xb828e5(++_0x4475c8);}(_0xe130,0x127));var _0x0e13=function(_0x203b83,_0x4671f6){_0x203b83=_0x203b83-0x0;var _0x3725c6=_0xe130[_0x203b83];return _0x3725c6;};'use strict';var EventEmitter=require(_0x0e13('0x0'));var ChatInternalMessage=require(_0x0e13('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x0e13('0x2')](0x0);var events={'afterCreate':_0x0e13('0x3'),'afterUpdate':_0x0e13('0x4'),'afterDestroy':_0x0e13('0x5')};function emitEvent(_0x449ddd){return function(_0x504f15,_0x1489a9,_0x223c28){ChatInternalMessageEvents[_0x0e13('0x6')](_0x449ddd+':'+_0x504f15['id'],_0x504f15);ChatInternalMessageEvents[_0x0e13('0x6')](_0x449ddd,_0x504f15);_0x223c28(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x0e13('0x7')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0xb469=['events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove','emit','hook'];(function(_0x2b8f7f,_0x1135f0){var _0x54f065=function(_0x282565){while(--_0x282565){_0x2b8f7f['push'](_0x2b8f7f['shift']());}};_0x54f065(++_0x1135f0);}(_0xb469,0x13b));var _0x9b46=function(_0x5f4710,_0x14222f){_0x5f4710=_0x5f4710-0x0;var _0x40df2b=_0xb469[_0x5f4710];return _0x40df2b;};'use strict';var EventEmitter=require(_0x9b46('0x0'));var ChatInternalMessage=require(_0x9b46('0x1'))['db'][_0x9b46('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x9b46('0x3')](0x0);var events={'afterCreate':_0x9b46('0x4'),'afterUpdate':_0x9b46('0x5'),'afterDestroy':_0x9b46('0x6')};function emitEvent(_0x52f688){return function(_0x31f853,_0x45322f,_0x538fc4){ChatInternalMessageEvents[_0x9b46('0x7')](_0x52f688+':'+_0x31f853['id'],_0x31f853);ChatInternalMessageEvents[_0x9b46('0x7')](_0x52f688,_0x31f853);_0x538fc4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x9b46('0x8')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 14fd347..8ed868d 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 _0x4000=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x328b1c,_0xec0b4f){var _0x4dbeaa=function(_0x432519){while(--_0x432519){_0x328b1c['push'](_0x328b1c['shift']());}};_0x4dbeaa(++_0xec0b4f);}(_0x4000,0xb4));var _0x0400=function(_0x5960c3,_0x175b74){_0x5960c3=_0x5960c3-0x0;var _0x435e1f=_0x4000[_0x5960c3];return _0x435e1f;};'use strict';var _=require(_0x0400('0x0'));var util=require(_0x0400('0x1'));var logger=require(_0x0400('0x2'))(_0x0400('0x3'));var moment=require(_0x0400('0x4'));var BPromise=require(_0x0400('0x5'));var rp=require(_0x0400('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0400('0x7'));var attributes=require(_0x0400('0x8'));module[_0x0400('0x9')]=function(_0x47aab8,_0x31be29){return _0x47aab8[_0x0400('0xa')](_0x0400('0xb'),attributes,{'tableName':_0x0400('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0400('0xd'),'collate':_0x0400('0xe')});}; \ No newline at end of file +var _0xa1b3=['chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','api','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x2c8f7e,_0xee234c){var _0x146be7=function(_0x19a89e){while(--_0x19a89e){_0x2c8f7e['push'](_0x2c8f7e['shift']());}};_0x146be7(++_0xee234c);}(_0xa1b3,0x67));var _0x3a1b=function(_0x4ec98d,_0x59930d){_0x4ec98d=_0x4ec98d-0x0;var _0x408683=_0xa1b3[_0x4ec98d];return _0x408683;};'use strict';var _=require(_0x3a1b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3a1b('0x1'));var moment=require('moment');var BPromise=require(_0x3a1b('0x2'));var rp=require(_0x3a1b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3a1b('0x4'));var config=require(_0x3a1b('0x5'));var attributes=require('./chatInternalMessage.attributes');module[_0x3a1b('0x6')]=function(_0x5ca92e,_0x241d9e){return _0x5ca92e['define']('ChatInternalMessage',attributes,{'tableName':_0x3a1b('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3a1b('0x8'),'collate':_0x3a1b('0x9')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 93eb5ff..cae41ee 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 _0x7d33=['socket.io-emitter','redis','register','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost'];(function(_0x465709,_0x14be9e){var _0x33662e=function(_0x51354b){while(--_0x51354b){_0x465709['push'](_0x465709['shift']());}};_0x33662e(++_0x14be9e);}(_0x7d33,0xb7));var _0x37d3=function(_0x3a6922,_0xc728be){_0x3a6922=_0x3a6922-0x0;var _0x9c1b44=_0x7d33[_0x3a6922];return _0x9c1b44;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x37d3('0x0'));var BPromise=require(_0x37d3('0x1'));var rs=require(_0x37d3('0x2'));var fs=require('fs');var Redis=require(_0x37d3('0x3'));var db=require(_0x37d3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x37d3('0x5'))(_0x37d3('0x6'));var config=require(_0x37d3('0x7'));var jayson=require(_0x37d3('0x8'));var client=jayson[_0x37d3('0x9')][_0x37d3('0xa')]({'port':0x232a});config['redis']=_[_0x37d3('0xb')](config['redis'],{'host':_0x37d3('0xc'),'port':0x18eb});var socket=require(_0x37d3('0xd'))(new Redis(config[_0x37d3('0xe')]));require('./chatInternalMessage.socket')[_0x37d3('0xf')](socket);function respondWithRpcPromise(_0x3ad7fc,_0x1a4e66,_0x21fdeb){return new BPromise(function(_0x18dd6c,_0xb13778){return client[_0x37d3('0x10')](_0x3ad7fc,_0x21fdeb)['then'](function(_0x6677ad){logger[_0x37d3('0x11')](_0x37d3('0x12'),_0x1a4e66,_0x37d3('0x13'));logger[_0x37d3('0x14')](_0x37d3('0x15'),_0x1a4e66,_0x37d3('0x13'),JSON[_0x37d3('0x16')](_0x6677ad));if(_0x6677ad[_0x37d3('0x17')]){if(_0x6677ad[_0x37d3('0x17')][_0x37d3('0x18')]===0x1f4){logger[_0x37d3('0x17')](_0x37d3('0x12'),_0x1a4e66,_0x6677ad['error'][_0x37d3('0x19')]);return _0xb13778(_0x6677ad['error'][_0x37d3('0x19')]);}logger[_0x37d3('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x1a4e66,_0x6677ad[_0x37d3('0x17')][_0x37d3('0x19')]);return _0x18dd6c(_0x6677ad[_0x37d3('0x17')]['message']);}else{logger[_0x37d3('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x1a4e66,_0x37d3('0x13'));_0x18dd6c(_0x6677ad[_0x37d3('0x1a')][_0x37d3('0x19')]);}})[_0x37d3('0x1b')](function(_0x4e4bf7){logger[_0x37d3('0x17')](_0x37d3('0x12'),_0x1a4e66,_0x4e4bf7);_0xb13778(_0x4e4bf7);});});} \ No newline at end of file +var _0x5b78=['moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x5b78,0xfa));var _0x85b7=function(_0x207a2a,_0x461c28){_0x207a2a=_0x207a2a-0x0;var _0x2004a8=_0x5b78[_0x207a2a];return _0x2004a8;};'use strict';var _=require(_0x85b7('0x0'));var util=require(_0x85b7('0x1'));var moment=require(_0x85b7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x85b7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x85b7('0x4'));var logger=require(_0x85b7('0x5'))(_0x85b7('0x6'));var config=require(_0x85b7('0x7'));var jayson=require(_0x85b7('0x8'));var client=jayson[_0x85b7('0x9')][_0x85b7('0xa')]({'port':0x232a});config[_0x85b7('0xb')]=_['defaults'](config[_0x85b7('0xb')],{'host':_0x85b7('0xc'),'port':0x18eb});var socket=require(_0x85b7('0xd'))(new Redis(config[_0x85b7('0xb')]));require(_0x85b7('0xe'))[_0x85b7('0xf')](socket);function respondWithRpcPromise(_0x5d84c8,_0x4fed57,_0x3086bb){return new BPromise(function(_0x1f8120,_0x4fb6b3){return client['request'](_0x5d84c8,_0x3086bb)[_0x85b7('0x10')](function(_0x12c070){logger[_0x85b7('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x4fed57,_0x85b7('0x12'));logger[_0x85b7('0x13')](_0x85b7('0x14'),_0x4fed57,_0x85b7('0x12'),JSON[_0x85b7('0x15')](_0x12c070));if(_0x12c070[_0x85b7('0x16')]){if(_0x12c070[_0x85b7('0x16')][_0x85b7('0x17')]===0x1f4){logger[_0x85b7('0x16')](_0x85b7('0x18'),_0x4fed57,_0x12c070[_0x85b7('0x16')][_0x85b7('0x19')]);return _0x4fb6b3(_0x12c070['error']['message']);}logger[_0x85b7('0x16')](_0x85b7('0x18'),_0x4fed57,_0x12c070[_0x85b7('0x16')][_0x85b7('0x19')]);return _0x1f8120(_0x12c070['error']['message']);}else{logger['info'](_0x85b7('0x18'),_0x4fed57,'request\x20sent');_0x1f8120(_0x12c070[_0x85b7('0x1a')][_0x85b7('0x19')]);}})[_0x85b7('0x1b')](function(_0x55ceec){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x4fed57,_0x55ceec);_0x4fb6b3(_0x55ceec);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 11d39f4..cbdeb22 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 _0x43a1=['emit','register','length','save','remove'];(function(_0x196ce1,_0x46e836){var _0x360a64=function(_0x3f339f){while(--_0x3f339f){_0x196ce1['push'](_0x196ce1['shift']());}};_0x360a64(++_0x46e836);}(_0x43a1,0x76));var _0x143a=function(_0xbd57fe,_0xc0dda6){_0xbd57fe=_0xbd57fe-0x0;var _0x13c4a5=_0x43a1[_0xbd57fe];return _0x13c4a5;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x143a('0x0'),_0x143a('0x1'),'update'];function createListener(_0xa96100,_0x177408){return function(_0x16124b){_0x177408[_0x143a('0x2')](_0xa96100,_0x16124b);};}function removeListener(_0x22ea04,_0x481b61){return function(){ChatInternalMessageEvents['removeListener'](_0x22ea04,_0x481b61);};}exports[_0x143a('0x3')]=function(_0x1d436d){for(var _0x3fe5ab=0x0,_0x1ef057=events[_0x143a('0x4')];_0x3fe5ab<_0x1ef057;_0x3fe5ab++){var _0x15a3e7=events[_0x3fe5ab];var _0x3945d8=createListener('chatInternalMessage:'+_0x15a3e7,_0x1d436d);ChatInternalMessageEvents['on'](_0x15a3e7,_0x3945d8);}}; \ No newline at end of file +var _0xf322=['update','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','remove'];(function(_0x3e4e5c,_0x4d2966){var _0x46f0bf=function(_0x2d1982){while(--_0x2d1982){_0x3e4e5c['push'](_0x3e4e5c['shift']());}};_0x46f0bf(++_0x4d2966);}(_0xf322,0x17f));var _0x2f32=function(_0x5adb21,_0x32e134){_0x5adb21=_0x5adb21-0x0;var _0x5beffa=_0xf322[_0x5adb21];return _0x5beffa;};'use strict';var ChatInternalMessageEvents=require(_0x2f32('0x0'));var events=['save',_0x2f32('0x1'),_0x2f32('0x2')];function createListener(_0x3303e0,_0x3d142f){return function(_0x561656){_0x3d142f['emit'](_0x3303e0,_0x561656);};}function removeListener(_0x429d5c,_0x5f06b9){return function(){ChatInternalMessageEvents[_0x2f32('0x3')](_0x429d5c,_0x5f06b9);};}exports[_0x2f32('0x4')]=function(_0x1d2cca){for(var _0x54c0ad=0x0,_0x4acaea=events[_0x2f32('0x5')];_0x54c0ad<_0x4acaea;_0x54c0ad++){var _0xe55067=events[_0x54c0ad];var _0x2e8f51=createListener(_0x2f32('0x6')+_0xe55067,_0x1d2cca);ChatInternalMessageEvents['on'](_0xe55067,_0x2e8f51);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 9b22411..e83f733 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 _0xa6ce=['describe','/users','getUsers','/:id','show','post','create','put','delete','exports','multer','path','connect-timeout','Router','../../components/auth/service','./chatInternalMessage.controller','get','isAuthenticated','index','/describe'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0xa6ce,0x15e));var _0xea6c=function(_0x1d8119,_0xc98f17){_0x1d8119=_0x1d8119-0x0;var _0x3e30f6=_0xa6ce[_0x1d8119];return _0x3e30f6;};'use strict';var multer=require(_0xea6c('0x0'));var util=require('util');var path=require(_0xea6c('0x1'));var timeout=require(_0xea6c('0x2'));var express=require('express');var router=express[_0xea6c('0x3')]();var auth=require(_0xea6c('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xea6c('0x5'));router[_0xea6c('0x6')]('/',auth[_0xea6c('0x7')](),controller[_0xea6c('0x8')]);router[_0xea6c('0x6')](_0xea6c('0x9'),auth['isAuthenticated'](),controller[_0xea6c('0xa')]);router[_0xea6c('0x6')](_0xea6c('0xb'),auth[_0xea6c('0x7')](),controller[_0xea6c('0xc')]);router[_0xea6c('0x6')](_0xea6c('0xd'),auth[_0xea6c('0x7')](),controller[_0xea6c('0xe')]);router[_0xea6c('0xf')]('/',auth[_0xea6c('0x7')](),controller[_0xea6c('0x10')]);router[_0xea6c('0x11')](_0xea6c('0xd'),controller['update']);router[_0xea6c('0x12')](_0xea6c('0xd'),auth[_0xea6c('0x7')](),controller['destroy']);module[_0xea6c('0x13')]=router; \ No newline at end of file +var _0x6113=['update','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','/:id','post'];(function(_0xfa7fe5,_0xdfe7f1){var _0x349841=function(_0x4a28d2){while(--_0x4a28d2){_0xfa7fe5['push'](_0xfa7fe5['shift']());}};_0x349841(++_0xdfe7f1);}(_0x6113,0x1b2));var _0x3611=function(_0x1069a0,_0x23450c){_0x1069a0=_0x1069a0-0x0;var _0x12148f=_0x6113[_0x1069a0];return _0x12148f;};'use strict';var multer=require(_0x3611('0x0'));var util=require(_0x3611('0x1'));var path=require(_0x3611('0x2'));var timeout=require('connect-timeout');var express=require(_0x3611('0x3'));var router=express[_0x3611('0x4')]();var auth=require(_0x3611('0x5'));var interaction=require(_0x3611('0x6'));var config=require('../../config/environment');var controller=require(_0x3611('0x7'));router[_0x3611('0x8')]('/',auth[_0x3611('0x9')](),controller[_0x3611('0xa')]);router['get'](_0x3611('0xb'),auth[_0x3611('0x9')](),controller[_0x3611('0xc')]);router[_0x3611('0x8')](_0x3611('0xd'),auth[_0x3611('0x9')](),controller['getUsers']);router[_0x3611('0x8')](_0x3611('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x3611('0xf')]('/',auth[_0x3611('0x9')](),controller['create']);router['put'](_0x3611('0xe'),controller[_0x3611('0x10')]);router['delete'](_0x3611('0xe'),auth[_0x3611('0x9')](),controller['destroy']);module[_0x3611('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 2185237..7d82bcf 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 _0x8aa1=['BOOLEAN','ENUM','out','sequelize','exports','medium'];(function(_0x4e4315,_0x5d7615){var _0x31f97a=function(_0x330858){while(--_0x330858){_0x4e4315['push'](_0x4e4315['shift']());}};_0x31f97a(++_0x5d7615);}(_0x8aa1,0x1bf));var _0x18aa=function(_0x4ca6dd,_0x47ed65){_0x4ca6dd=_0x4ca6dd-0x0;var _0x21136d=_0x8aa1[_0x4ca6dd];return _0x21136d;};'use strict';var Sequelize=require(_0x18aa('0x0'));module[_0x18aa('0x1')]={'body':{'type':Sequelize['TEXT'](_0x18aa('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x18aa('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x18aa('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x18aa('0x4')]('in',_0x18aa('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x9c54=['ENUM','out','sequelize','TEXT','medium','BOOLEAN'];(function(_0x24fa1a,_0x16d9c2){var _0xc5621f=function(_0x5616ac){while(--_0x5616ac){_0x24fa1a['push'](_0x24fa1a['shift']());}};_0xc5621f(++_0x16d9c2);}(_0x9c54,0xec));var _0x49c5=function(_0x541a80,_0x29d330){_0x541a80=_0x541a80-0x0;var _0x10349f=_0x9c54[_0x541a80];return _0x10349f;};'use strict';var Sequelize=require(_0x49c5('0x0'));module['exports']={'body':{'type':Sequelize[_0x49c5('0x1')](_0x49c5('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x49c5('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x49c5('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x49c5('0x4')]('in',_0x49c5('0x5')),'defaultValue':_0x49c5('0x5'),'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 34f66f4..af281de 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 _0x61a6=['update','destroy','end','stack','name','send','ChatMessage','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','key','VIRTUAL','field','includeAll','include','findAll','rows','show','params','merge','options','create','body','find','../../config/logger','accept','chat','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','Contact','get','ChatInteraction','ChatInteractionId','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','stringify','null','AcceptMessage','acceptMessage','manual','interface','format','channel','EventManager','parse','formData','chat-interactions','agent','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SIP/%s','event','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save'];(function(_0x5b342c,_0x236085){var _0x592ac7=function(_0x1e88df){while(--_0x1e88df){_0x5b342c['push'](_0x5b342c['shift']());}};_0x592ac7(++_0x236085);}(_0x61a6,0x1c6));var _0x661a=function(_0x3cc979,_0xfc6df1){_0x3cc979=_0x3cc979-0x0;var _0x5601da=_0x61a6[_0x3cc979];return _0x5601da;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x661a('0x0'));var rimraf=require(_0x661a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x661a('0x2'));var rp=require(_0x661a('0x3'));var moment=require(_0x661a('0x4'));var BPromise=require(_0x661a('0x5'));var Mustache=require(_0x661a('0x6'));var util=require(_0x661a('0x7'));var path=require(_0x661a('0x8'));var sox=require(_0x661a('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x661a('0xa'));var deskjs=require(_0x661a('0xb'));var toCsv=require(_0x661a('0xc'));var querystring=require(_0x661a('0xd'));var Papa=require(_0x661a('0xe'));var Redis=require(_0x661a('0xf'));var authService=require(_0x661a('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x661a('0x11'));var logger=require('../../config/logger')(_0x661a('0x12'));var utils=require(_0x661a('0x13'));var config=require('../../config/environment');var db=require(_0x661a('0x14'))['db'];config[_0x661a('0x15')]=_[_0x661a('0x16')](config[_0x661a('0x15')],{'host':_0x661a('0x17'),'port':0x18eb});var socket=require(_0x661a('0x18'))(new Redis(config[_0x661a('0x15')]));require(_0x661a('0x19'))[_0x661a('0x1a')](socket);var jayson=require(_0x661a('0x1b'));var client=jayson[_0x661a('0x1c')][_0x661a('0x1d')]({'port':0x232c});var client9002=jayson[_0x661a('0x1c')][_0x661a('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x230e37,_0x2a286c,_0x43e21d){if(_0x43e21d){var _0x10f992=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x10f992[_0x661a('0x1e')](_0x2a286c)){return _0x230e37;}else{throw new Error(_0x661a('0x1f'));}}else{return _0x230e37;}}function respondWithRpcPromise(_0x57be2f,_0xf1c257,_0x170837,_0x266549){return new BPromise(function(_0x2443f8,_0x55c2b5){var _0x2d1edb=_0x266549||client;return _0x2d1edb[_0x661a('0x20')](_0x57be2f,_0x170837)[_0x661a('0x21')](function(_0x527b76){logger[_0x661a('0x22')](_0x661a('0x23'),_0xf1c257,_0x661a('0x24'));logger[_0x661a('0x25')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0xf1c257,_0x661a('0x24'),JSON['stringify'](_0x527b76));if(_0x527b76[_0x661a('0x26')]){if(_0x527b76[_0x661a('0x26')][_0x661a('0x27')]===0x1f4){logger[_0x661a('0x26')](_0x661a('0x23'),_0xf1c257,_0x527b76[_0x661a('0x26')][_0x661a('0x28')]);return _0x55c2b5(_0x527b76['error'][_0x661a('0x28')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0xf1c257,_0x527b76[_0x661a('0x26')][_0x661a('0x28')]);return _0x2443f8(_0x527b76[_0x661a('0x26')][_0x661a('0x28')]);}else{logger[_0x661a('0x22')](_0x661a('0x23'),_0xf1c257,_0x661a('0x24'));_0x2443f8(_0x527b76[_0x661a('0x29')][_0x661a('0x28')]);}})[_0x661a('0x2a')](function(_0x240dfe){logger[_0x661a('0x26')](_0x661a('0x23'),_0xf1c257,_0x240dfe);_0x55c2b5(_0x240dfe);});});}function respondWithStatusCode(_0x2ba961,_0x26cfa1){_0x26cfa1=_0x26cfa1||0xcc;return function(_0x559448){if(_0x559448){return _0x2ba961[_0x661a('0x2b')](_0x26cfa1);}return _0x2ba961[_0x661a('0x2c')](_0x26cfa1)['end']();};}function respondWithResult(_0x49a016,_0x3c5b75){_0x3c5b75=_0x3c5b75||0xc8;return function(_0x1f83e6){if(_0x1f83e6){return _0x49a016['status'](_0x3c5b75)[_0x661a('0x2d')](_0x1f83e6);}};}function respondWithFilteredResult(_0x18453b,_0xa49a1b){return function(_0x2ad31e){if(_0x2ad31e){var _0x59190a=_0x2ad31e[_0x661a('0x2e')],_0x1b44eb=_0xa49a1b['offset'],_0x430dea=_0xa49a1b[_0x661a('0x2f')]+_0xa49a1b[_0x661a('0x30')],_0x8554e0;if(_0x430dea>=_0x59190a){_0x430dea=_0x59190a;_0x8554e0=0xc8;}else{_0x8554e0=0xce;}_0x18453b[_0x661a('0x2c')](_0x8554e0);return _0x18453b[_0x661a('0x31')](_0x661a('0x32'),_0x1b44eb+'-'+_0x430dea+'/'+_0x59190a)[_0x661a('0x2d')](_0x2ad31e);}return null;};}function patchUpdates(_0x20681c){return function(_0x24371a){try{jsonpatch[_0x661a('0x33')](_0x24371a,_0x20681c,!![]);}catch(_0x4e2610){return BPromise[_0x661a('0x34')](_0x4e2610);}return _0x24371a[_0x661a('0x35')]();};}function saveUpdates(_0x1a2764,_0x1d1e5a){return function(_0x20f0d4){if(_0x20f0d4){return _0x20f0d4[_0x661a('0x36')](_0x1a2764)[_0x661a('0x21')](function(_0xe848f1){return _0xe848f1;});}return null;};}function removeEntity(_0x535a3e,_0x1e0a09){return function(_0xdbb7e2){if(_0xdbb7e2){return _0xdbb7e2[_0x661a('0x37')]()[_0x661a('0x21')](function(){_0x535a3e[_0x661a('0x2c')](0xcc)[_0x661a('0x38')]();});}};}function handleEntityNotFound(_0x1f2172,_0x42fbe1){return function(_0xf266ea){if(!_0xf266ea){_0x1f2172[_0x661a('0x2b')](0x194);}return _0xf266ea;};}function handleError(_0x1be35f,_0x18afde){_0x18afde=_0x18afde||0x1f4;return function(_0x1a1185){logger[_0x661a('0x26')](_0x1a1185[_0x661a('0x39')]);if(_0x1a1185[_0x661a('0x3a')]){delete _0x1a1185[_0x661a('0x3a')];}_0x1be35f[_0x661a('0x2c')](_0x18afde)[_0x661a('0x3b')](_0x1a1185);};}exports['index']=function(_0x18e1a0,_0x1dcfa2){var _0x16a74e={},_0x472fcd={},_0x5199cc={'count':0x0,'rows':[]};var _0x4e17d5=db[_0x661a('0x3c')][_0x661a('0x3d')];_0x472fcd[_0x661a('0x3e')]=_[_0x661a('0x3f')](_0x4e17d5);_0x472fcd[_0x661a('0x40')]=_[_0x661a('0x3f')](_0x18e1a0[_0x661a('0x40')]);_0x472fcd[_0x661a('0x41')]=_[_0x661a('0x42')](_0x472fcd[_0x661a('0x3e')],_0x472fcd['query']);_0x16a74e[_0x661a('0x43')]=_[_0x661a('0x42')](_0x472fcd['model'],qs[_0x661a('0x44')](_0x18e1a0[_0x661a('0x40')][_0x661a('0x44')]));_0x16a74e[_0x661a('0x43')]=_0x16a74e[_0x661a('0x43')][_0x661a('0x45')]?_0x16a74e['attributes']:_0x472fcd['model'];if(!_0x18e1a0[_0x661a('0x40')][_0x661a('0x46')](_0x661a('0x47'))){_0x16a74e[_0x661a('0x30')]=qs[_0x661a('0x30')](_0x18e1a0['query'][_0x661a('0x30')]);_0x16a74e['offset']=qs[_0x661a('0x2f')](_0x18e1a0[_0x661a('0x40')][_0x661a('0x2f')]);}_0x16a74e[_0x661a('0x48')]=qs[_0x661a('0x49')](_0x18e1a0['query']['sort']);_0x16a74e[_0x661a('0x4a')]=qs['filters'](_[_0x661a('0x4b')](_0x18e1a0[_0x661a('0x40')],_0x472fcd[_0x661a('0x41')]));if(_0x18e1a0[_0x661a('0x40')][_0x661a('0x4c')]){_0x16a74e[_0x661a('0x4a')]=_['merge'](_0x16a74e['where'],{'$or':_[_0x661a('0x4d')](_0x4e17d5,function(_0x56f474){if(_0x56f474['type'][_0x661a('0x4e')]!==_0x661a('0x4f')){var _0x922098={};_0x922098[_0x56f474[_0x661a('0x50')]]={'$like':'%'+_0x18e1a0[_0x661a('0x40')][_0x661a('0x4c')]+'%'};return _0x922098;}})});}_0x16a74e=_['merge']({},_0x16a74e,_0x18e1a0['options']);var _0x522292={'where':_0x16a74e[_0x661a('0x4a')]};return db['ChatMessage']['count'](_0x522292)[_0x661a('0x21')](function(_0x3fcce8){_0x5199cc[_0x661a('0x2e')]=_0x3fcce8;if(_0x18e1a0['query'][_0x661a('0x51')]){_0x16a74e[_0x661a('0x52')]=[{'all':!![]}];}return db[_0x661a('0x3c')][_0x661a('0x53')](_0x16a74e);})['then'](function(_0x18cb7e){_0x5199cc[_0x661a('0x54')]=_0x18cb7e;return _0x5199cc;})[_0x661a('0x21')](respondWithFilteredResult(_0x1dcfa2,_0x16a74e))[_0x661a('0x2a')](handleError(_0x1dcfa2,null));};exports[_0x661a('0x55')]=function(_0x2d4ebf,_0x2d7334){var _0x475288={'raw':!![],'where':{'id':_0x2d4ebf[_0x661a('0x56')]['id']}},_0x1ebd4e={};_0x1ebd4e[_0x661a('0x3e')]=_[_0x661a('0x3f')](db[_0x661a('0x3c')][_0x661a('0x3d')]);_0x1ebd4e[_0x661a('0x40')]=_[_0x661a('0x3f')](_0x2d4ebf[_0x661a('0x40')]);_0x1ebd4e[_0x661a('0x41')]=_[_0x661a('0x42')](_0x1ebd4e[_0x661a('0x3e')],_0x1ebd4e['query']);_0x475288[_0x661a('0x43')]=_[_0x661a('0x42')](_0x1ebd4e[_0x661a('0x3e')],qs['fields'](_0x2d4ebf[_0x661a('0x40')][_0x661a('0x44')]));_0x475288['attributes']=_0x475288['attributes'][_0x661a('0x45')]?_0x475288['attributes']:_0x1ebd4e['model'];if(_0x2d4ebf[_0x661a('0x40')][_0x661a('0x51')]){_0x475288[_0x661a('0x52')]=[{'all':!![]}];}_0x475288=_[_0x661a('0x57')]({},_0x475288,_0x2d4ebf[_0x661a('0x58')]);return db[_0x661a('0x3c')]['find'](_0x475288)[_0x661a('0x21')](handleEntityNotFound(_0x2d7334,null))[_0x661a('0x21')](respondWithResult(_0x2d7334,null))[_0x661a('0x2a')](handleError(_0x2d7334,null));};exports[_0x661a('0x59')]=function(_0x41a4bd,_0x78077b){return db[_0x661a('0x3c')]['create'](_0x41a4bd[_0x661a('0x5a')],{})[_0x661a('0x21')](respondWithResult(_0x78077b,0xc9))['catch'](handleError(_0x78077b,null));};exports[_0x661a('0x36')]=function(_0x57b632,_0x5d420e){if(_0x57b632[_0x661a('0x5a')]['id']){delete _0x57b632[_0x661a('0x5a')]['id'];}return db['ChatMessage'][_0x661a('0x5b')]({'where':{'id':_0x57b632[_0x661a('0x56')]['id']}})[_0x661a('0x21')](handleEntityNotFound(_0x5d420e,null))[_0x661a('0x21')](saveUpdates(_0x57b632['body'],null))[_0x661a('0x21')](respondWithResult(_0x5d420e,null))[_0x661a('0x2a')](handleError(_0x5d420e,null));};exports['destroy']=function(_0x4dd229,_0x429f7d){return db[_0x661a('0x3c')][_0x661a('0x5b')]({'where':{'id':_0x4dd229[_0x661a('0x56')]['id']}})['then'](handleEntityNotFound(_0x429f7d,null))[_0x661a('0x21')](removeEntity(_0x429f7d,null))[_0x661a('0x2a')](handleError(_0x429f7d,null));};exports['describe']=function(_0x1e1218,_0x1f0402){return db[_0x661a('0x3c')]['describe']()['then'](respondWithResult(_0x1f0402,null))[_0x661a('0x2a')](handleError(_0x1f0402,null));};var interaction_log=require(_0x661a('0x5c'))('chat-interactions');exports[_0x661a('0x5d')]=function(_0x5ef37e,_0x3536cd,_0x4892ad){var _0x2b93e4={'channel':_0x661a('0x5e')};if(_0x5ef37e['body']['id']){delete _0x5ef37e[_0x661a('0x5a')]['id'];}_0x5ef37e[_0x661a('0x5a')]['read']=!![];_0x5ef37e[_0x661a('0x5a')][_0x661a('0x5f')]=moment()['format'](_0x661a('0x60'));_0x5ef37e[_0x661a('0x5a')][_0x661a('0x61')]=_0x5ef37e['body'][_0x661a('0x61')]||_0x5ef37e['user']['id'];return db[_0x661a('0x3c')][_0x661a('0x5b')]({'where':{'id':_0x5ef37e[_0x661a('0x56')]['id'],'UserId':null},'include':[{'model':db[_0x661a('0x62')],'as':_0x661a('0x63')}]})[_0x661a('0x21')](handleEntityNotFound(_0x3536cd,null))[_0x661a('0x21')](saveUpdates(_0x5ef37e['body'],null))[_0x661a('0x21')](function(_0x2c014d){if(_0x2c014d){_0x2b93e4[_0x661a('0x28')]=_0x2c014d[_0x661a('0x64')]({'plain':!![]});return db[_0x661a('0x65')][_0x661a('0x5b')]({'where':{'id':_0x2c014d[_0x661a('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x3536cd,null))['then'](function(_0x4e0948){if(_0x4e0948){return _0x4e0948[_0x661a('0x36')]({'UserId':_0x5ef37e[_0x661a('0x5a')][_0x661a('0x61')],'read1stAt':_['isNil'](_0x4e0948[_0x661a('0x67')])?moment()['format'](_0x661a('0x60')):undefined});}return null;})['then'](function(_0x22a5e1){if(_0x22a5e1){_0x2b93e4[_0x661a('0x68')]=_0x22a5e1[_0x661a('0x64')]({'plain':!![]});interaction_log[_0x661a('0x22')](_0x661a('0x69'),_0x5ef37e[_0x661a('0x6a')]['id'],_0x5ef37e[_0x661a('0x6a')]['name'],_0x5ef37e[_0x661a('0x6a')][_0x661a('0x6b')],_0x2b93e4[_0x661a('0x68')]['id'],_0x5ef37e[_0x661a('0x5a')]?JSON[_0x661a('0x6c')](_0x5ef37e[_0x661a('0x5a')]):_0x661a('0x6d'));return respondWithRpcPromise(_0x661a('0x6e'),_0x661a('0x6f'),_0x2b93e4);}return null;})[_0x661a('0x21')](function(_0x3fa36e){if(_0x3fa36e){if(_0x5ef37e[_0x661a('0x5a')][_0x661a('0x70')]){_0x2b93e4['message'][_0x661a('0x71')]=util[_0x661a('0x72')]('SIP/%s',_0x5ef37e['user'][_0x661a('0x3a')]);_0x2b93e4['message'][_0x661a('0x73')]=_0x2b93e4[_0x661a('0x73')];_0x2b93e4[_0x661a('0x28')]['event']='accept';return respondWithRpcPromise(_0x661a('0x74'),_0x661a('0x74'),{'event':'acceptmessage','message':_[_0x661a('0x57')](_0x2b93e4[_0x661a('0x28')],JSON[_0x661a('0x75')](_0x2b93e4[_0x661a('0x68')][_0x661a('0x76')]))},client9002)['then'](function(){return _0x2b93e4;});}return _0x2b93e4;}return null;})[_0x661a('0x21')](respondWithResult(_0x3536cd,null))[_0x661a('0x2a')](handleError(_0x3536cd,null));};var interaction_log=require(_0x661a('0x5c'))(_0x661a('0x77'));exports['reject']=function(_0x2cb74a,_0x52a561,_0x53334a){var _0x3eddd1={'agent':{},'channel':'chat'};if(_0x2cb74a['body']['id']){delete _0x2cb74a[_0x661a('0x5a')]['id'];}_0x2cb74a[_0x661a('0x5a')][_0x661a('0x61')]=_0x2cb74a[_0x661a('0x5a')]['UserId']||_0x2cb74a['user']['id'];_0x3eddd1[_0x661a('0x78')]['id']=_0x2cb74a[_0x661a('0x5a')][_0x661a('0x61')];return db[_0x661a('0x3c')][_0x661a('0x5b')]({'where':{'id':_0x2cb74a[_0x661a('0x56')]['id'],'UserId':null}})[_0x661a('0x21')](handleEntityNotFound(_0x52a561,null))[_0x661a('0x21')](function(_0x3b6d86){if(_0x3b6d86){_0x3eddd1[_0x661a('0x28')]=_0x3b6d86[_0x661a('0x64')]({'plain':!![]});return db[_0x661a('0x65')][_0x661a('0x5b')]({'where':{'id':_0x3b6d86['ChatInteractionId']}});}return null;})[_0x661a('0x21')](handleEntityNotFound(_0x52a561,null))[_0x661a('0x21')](function(_0x33ec0b){if(_0x33ec0b){_0x3eddd1['interaction']=_0x33ec0b[_0x661a('0x64')]({'plain':!![]});interaction_log[_0x661a('0x22')](_0x661a('0x79'),_0x2cb74a[_0x661a('0x6a')]['id'],_0x2cb74a[_0x661a('0x6a')][_0x661a('0x3a')],_0x2cb74a[_0x661a('0x6a')]['role'],_0x3eddd1[_0x661a('0x68')]['id'],_0x2cb74a[_0x661a('0x5a')]?JSON['stringify'](_0x2cb74a[_0x661a('0x5a')]):_0x661a('0x6d'));return respondWithRpcPromise(_0x661a('0x7a'),_0x661a('0x7b'),_0x3eddd1);}return null;})[_0x661a('0x21')](function(_0x418886){if(_0x418886){_0x418886[_0x661a('0x28')][_0x661a('0x71')]=util[_0x661a('0x72')](_0x661a('0x7c'),_0x2cb74a['user'][_0x661a('0x3a')]);_0x418886['message'][_0x661a('0x73')]=_0x3eddd1[_0x661a('0x73')];_0x418886[_0x661a('0x28')][_0x661a('0x7d')]=_0x661a('0x34');respondWithRpcPromise(_0x661a('0x74'),'EventManager',{'event':_0x661a('0x7e'),'message':_0x418886[_0x661a('0x28')]},client9002);return _0x3eddd1;}return null;})['then'](respondWithResult(_0x52a561,null))[_0x661a('0x2a')](handleError(_0x52a561,null));}; \ No newline at end of file +var _0xdc26=['update','destroy','describe','chat-interactions','accept','chat','YYYY-MM-DD\x20HH:mm:ss','UserId','user','Contact','ChatInteraction','ChatInteractionId','isNil','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','manual','format','SIP/%s','channel','event','EventManager','parse','agent','interface','rejectmessage','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','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','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','info','result','catch','status','json','count','offset','set','Content-Range','apply','reject','save','end','sendStatus','stack','name','send','ChatMessage','rawAttributes','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','limit','order','sort','pick','filter','where','map','type','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','fields','options','find','create','body'];(function(_0x190ff6,_0x515cfd){var _0x5356d2=function(_0x2cf77c){while(--_0x2cf77c){_0x190ff6['push'](_0x190ff6['shift']());}};_0x5356d2(++_0x515cfd);}(_0xdc26,0x109));var _0x6dc2=function(_0x5ed54b,_0x3a2827){_0x5ed54b=_0x5ed54b-0x0;var _0x4b58c7=_0xdc26[_0x5ed54b];return _0x4b58c7;};'use strict';var pdf=require(_0x6dc2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6dc2('0x1'));var zipdir=require(_0x6dc2('0x2'));var jsonpatch=require(_0x6dc2('0x3'));var rp=require(_0x6dc2('0x4'));var moment=require(_0x6dc2('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6dc2('0x6'));var util=require('util');var path=require(_0x6dc2('0x7'));var sox=require('sox');var csv=require(_0x6dc2('0x8'));var ejs=require(_0x6dc2('0x9'));var fs=require('fs');var _=require(_0x6dc2('0xa'));var squel=require('squel');var crypto=require(_0x6dc2('0xb'));var jsforce=require(_0x6dc2('0xc'));var deskjs=require(_0x6dc2('0xd'));var toCsv=require(_0x6dc2('0x8'));var querystring=require(_0x6dc2('0xe'));var Papa=require(_0x6dc2('0xf'));var Redis=require(_0x6dc2('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x6dc2('0x11'));var logger=require(_0x6dc2('0x12'))(_0x6dc2('0x13'));var utils=require(_0x6dc2('0x14'));var config=require('../../config/environment');var db=require(_0x6dc2('0x15'))['db'];config[_0x6dc2('0x16')]=_[_0x6dc2('0x17')](config[_0x6dc2('0x16')],{'host':_0x6dc2('0x18'),'port':0x18eb});var socket=require(_0x6dc2('0x19'))(new Redis(config[_0x6dc2('0x16')]));require(_0x6dc2('0x1a'))[_0x6dc2('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x6dc2('0x1c')][_0x6dc2('0x1d')]({'port':0x232c});var client9002=jayson[_0x6dc2('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0x20e976,_0x574676,_0x21486c){if(_0x21486c){var _0x58ab88=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x58ab88['test'](_0x574676)){return _0x20e976;}else{throw new Error(_0x6dc2('0x1e'));}}else{return _0x20e976;}}function respondWithRpcPromise(_0x373b65,_0x8a495a,_0x55e80d,_0x593c0a){return new BPromise(function(_0x6b0374,_0x53e5da){var _0x4f8f6e=_0x593c0a||client;return _0x4f8f6e[_0x6dc2('0x1f')](_0x373b65,_0x55e80d)[_0x6dc2('0x20')](function(_0x4a1f29){logger['info']('ChatMessage,\x20%s,\x20%s',_0x8a495a,_0x6dc2('0x21'));logger[_0x6dc2('0x22')](_0x6dc2('0x23'),_0x8a495a,_0x6dc2('0x21'),JSON[_0x6dc2('0x24')](_0x4a1f29));if(_0x4a1f29['error']){if(_0x4a1f29[_0x6dc2('0x25')][_0x6dc2('0x26')]===0x1f4){logger[_0x6dc2('0x25')](_0x6dc2('0x27'),_0x8a495a,_0x4a1f29[_0x6dc2('0x25')][_0x6dc2('0x28')]);return _0x53e5da(_0x4a1f29[_0x6dc2('0x25')]['message']);}logger[_0x6dc2('0x25')](_0x6dc2('0x27'),_0x8a495a,_0x4a1f29[_0x6dc2('0x25')][_0x6dc2('0x28')]);return _0x6b0374(_0x4a1f29[_0x6dc2('0x25')][_0x6dc2('0x28')]);}else{logger[_0x6dc2('0x29')]('ChatMessage,\x20%s,\x20%s',_0x8a495a,_0x6dc2('0x21'));_0x6b0374(_0x4a1f29[_0x6dc2('0x2a')][_0x6dc2('0x28')]);}})[_0x6dc2('0x2b')](function(_0x2a26b4){logger['error'](_0x6dc2('0x27'),_0x8a495a,_0x2a26b4);_0x53e5da(_0x2a26b4);});});}function respondWithStatusCode(_0x1b2e6a,_0x437c3f){_0x437c3f=_0x437c3f||0xcc;return function(_0x3ed67c){if(_0x3ed67c){return _0x1b2e6a['sendStatus'](_0x437c3f);}return _0x1b2e6a['status'](_0x437c3f)['end']();};}function respondWithResult(_0xde586c,_0x12ecd1){_0x12ecd1=_0x12ecd1||0xc8;return function(_0x4c77f6){if(_0x4c77f6){return _0xde586c[_0x6dc2('0x2c')](_0x12ecd1)[_0x6dc2('0x2d')](_0x4c77f6);}};}function respondWithFilteredResult(_0x34d84a,_0x5ad15){return function(_0x1bf3af){if(_0x1bf3af){var _0x5d1387=_0x1bf3af[_0x6dc2('0x2e')],_0xebf223=_0x5ad15['offset'],_0x2e326d=_0x5ad15[_0x6dc2('0x2f')]+_0x5ad15['limit'],_0x2aff47;if(_0x2e326d>=_0x5d1387){_0x2e326d=_0x5d1387;_0x2aff47=0xc8;}else{_0x2aff47=0xce;}_0x34d84a[_0x6dc2('0x2c')](_0x2aff47);return _0x34d84a[_0x6dc2('0x30')](_0x6dc2('0x31'),_0xebf223+'-'+_0x2e326d+'/'+_0x5d1387)[_0x6dc2('0x2d')](_0x1bf3af);}return null;};}function patchUpdates(_0xbcbfdf){return function(_0x37acd8){try{jsonpatch[_0x6dc2('0x32')](_0x37acd8,_0xbcbfdf,!![]);}catch(_0x273abf){return BPromise[_0x6dc2('0x33')](_0x273abf);}return _0x37acd8[_0x6dc2('0x34')]();};}function saveUpdates(_0x4e63f1,_0x4d9e32){return function(_0x2771e7){if(_0x2771e7){return _0x2771e7['update'](_0x4e63f1)['then'](function(_0x45f543){return _0x45f543;});}return null;};}function removeEntity(_0x14feca,_0x4d0d2e){return function(_0x346a86){if(_0x346a86){return _0x346a86['destroy']()[_0x6dc2('0x20')](function(){_0x14feca[_0x6dc2('0x2c')](0xcc)[_0x6dc2('0x35')]();});}};}function handleEntityNotFound(_0x264e39,_0x560222){return function(_0x549900){if(!_0x549900){_0x264e39[_0x6dc2('0x36')](0x194);}return _0x549900;};}function handleError(_0x482705,_0xfc387d){_0xfc387d=_0xfc387d||0x1f4;return function(_0x5ae88b){logger[_0x6dc2('0x25')](_0x5ae88b[_0x6dc2('0x37')]);if(_0x5ae88b[_0x6dc2('0x38')]){delete _0x5ae88b['name'];}_0x482705[_0x6dc2('0x2c')](_0xfc387d)[_0x6dc2('0x39')](_0x5ae88b);};}exports['index']=function(_0x2e60bf,_0x3aab13){var _0x2149f8={},_0x5c10aa={},_0x7a86cf={'count':0x0,'rows':[]};var _0x2876d4=db[_0x6dc2('0x3a')][_0x6dc2('0x3b')];_0x5c10aa[_0x6dc2('0x3c')]=_['keys'](_0x2876d4);_0x5c10aa[_0x6dc2('0x3d')]=_[_0x6dc2('0x3e')](_0x2e60bf[_0x6dc2('0x3d')]);_0x5c10aa[_0x6dc2('0x3f')]=_['intersection'](_0x5c10aa[_0x6dc2('0x3c')],_0x5c10aa[_0x6dc2('0x3d')]);_0x2149f8[_0x6dc2('0x40')]=_[_0x6dc2('0x41')](_0x5c10aa['model'],qs['fields'](_0x2e60bf['query']['fields']));_0x2149f8['attributes']=_0x2149f8[_0x6dc2('0x40')][_0x6dc2('0x42')]?_0x2149f8['attributes']:_0x5c10aa[_0x6dc2('0x3c')];if(!_0x2e60bf['query'][_0x6dc2('0x43')]('nolimit')){_0x2149f8[_0x6dc2('0x44')]=qs[_0x6dc2('0x44')](_0x2e60bf[_0x6dc2('0x3d')][_0x6dc2('0x44')]);_0x2149f8['offset']=qs['offset'](_0x2e60bf[_0x6dc2('0x3d')][_0x6dc2('0x2f')]);}_0x2149f8[_0x6dc2('0x45')]=qs[_0x6dc2('0x46')](_0x2e60bf[_0x6dc2('0x3d')]['sort']);_0x2149f8['where']=qs[_0x6dc2('0x3f')](_[_0x6dc2('0x47')](_0x2e60bf[_0x6dc2('0x3d')],_0x5c10aa[_0x6dc2('0x3f')]));if(_0x2e60bf[_0x6dc2('0x3d')][_0x6dc2('0x48')]){_0x2149f8[_0x6dc2('0x49')]=_['merge'](_0x2149f8[_0x6dc2('0x49')],{'$or':_[_0x6dc2('0x4a')](_0x2876d4,function(_0xbe2886){if(_0xbe2886[_0x6dc2('0x4b')]['key']!==_0x6dc2('0x4c')){var _0x46b9be={};_0x46b9be[_0xbe2886['field']]={'$like':'%'+_0x2e60bf[_0x6dc2('0x3d')]['filter']+'%'};return _0x46b9be;}})});}_0x2149f8=_[_0x6dc2('0x4d')]({},_0x2149f8,_0x2e60bf['options']);var _0x23abf9={'where':_0x2149f8[_0x6dc2('0x49')]};return db[_0x6dc2('0x3a')][_0x6dc2('0x2e')](_0x23abf9)[_0x6dc2('0x20')](function(_0x831443){_0x7a86cf[_0x6dc2('0x2e')]=_0x831443;if(_0x2e60bf[_0x6dc2('0x3d')][_0x6dc2('0x4e')]){_0x2149f8[_0x6dc2('0x4f')]=[{'all':!![]}];}return db[_0x6dc2('0x3a')][_0x6dc2('0x50')](_0x2149f8);})[_0x6dc2('0x20')](function(_0xe9635c){_0x7a86cf[_0x6dc2('0x51')]=_0xe9635c;return _0x7a86cf;})[_0x6dc2('0x20')](respondWithFilteredResult(_0x3aab13,_0x2149f8))[_0x6dc2('0x2b')](handleError(_0x3aab13,null));};exports[_0x6dc2('0x52')]=function(_0x35606c,_0x71b4a5){var _0x2aea4d={'raw':!![],'where':{'id':_0x35606c[_0x6dc2('0x53')]['id']}},_0x1cd1af={};_0x1cd1af[_0x6dc2('0x3c')]=_[_0x6dc2('0x3e')](db[_0x6dc2('0x3a')]['rawAttributes']);_0x1cd1af['query']=_[_0x6dc2('0x3e')](_0x35606c[_0x6dc2('0x3d')]);_0x1cd1af[_0x6dc2('0x3f')]=_[_0x6dc2('0x41')](_0x1cd1af[_0x6dc2('0x3c')],_0x1cd1af[_0x6dc2('0x3d')]);_0x2aea4d[_0x6dc2('0x40')]=_[_0x6dc2('0x41')](_0x1cd1af['model'],qs[_0x6dc2('0x54')](_0x35606c[_0x6dc2('0x3d')][_0x6dc2('0x54')]));_0x2aea4d[_0x6dc2('0x40')]=_0x2aea4d[_0x6dc2('0x40')][_0x6dc2('0x42')]?_0x2aea4d[_0x6dc2('0x40')]:_0x1cd1af[_0x6dc2('0x3c')];if(_0x35606c[_0x6dc2('0x3d')]['includeAll']){_0x2aea4d[_0x6dc2('0x4f')]=[{'all':!![]}];}_0x2aea4d=_[_0x6dc2('0x4d')]({},_0x2aea4d,_0x35606c[_0x6dc2('0x55')]);return db[_0x6dc2('0x3a')][_0x6dc2('0x56')](_0x2aea4d)[_0x6dc2('0x20')](handleEntityNotFound(_0x71b4a5,null))[_0x6dc2('0x20')](respondWithResult(_0x71b4a5,null))['catch'](handleError(_0x71b4a5,null));};exports[_0x6dc2('0x57')]=function(_0x3d5af7,_0x1bb84d){return db[_0x6dc2('0x3a')][_0x6dc2('0x57')](_0x3d5af7[_0x6dc2('0x58')],{})[_0x6dc2('0x20')](respondWithResult(_0x1bb84d,0xc9))[_0x6dc2('0x2b')](handleError(_0x1bb84d,null));};exports[_0x6dc2('0x59')]=function(_0x2ee28f,_0x5a7e0c){if(_0x2ee28f[_0x6dc2('0x58')]['id']){delete _0x2ee28f[_0x6dc2('0x58')]['id'];}return db[_0x6dc2('0x3a')][_0x6dc2('0x56')]({'where':{'id':_0x2ee28f[_0x6dc2('0x53')]['id']}})[_0x6dc2('0x20')](handleEntityNotFound(_0x5a7e0c,null))[_0x6dc2('0x20')](saveUpdates(_0x2ee28f['body'],null))['then'](respondWithResult(_0x5a7e0c,null))[_0x6dc2('0x2b')](handleError(_0x5a7e0c,null));};exports[_0x6dc2('0x5a')]=function(_0x327208,_0x3b107a){return db[_0x6dc2('0x3a')][_0x6dc2('0x56')]({'where':{'id':_0x327208[_0x6dc2('0x53')]['id']}})['then'](handleEntityNotFound(_0x3b107a,null))['then'](removeEntity(_0x3b107a,null))[_0x6dc2('0x2b')](handleError(_0x3b107a,null));};exports[_0x6dc2('0x5b')]=function(_0x1f0a82,_0x5d2bc1){return db[_0x6dc2('0x3a')][_0x6dc2('0x5b')]()['then'](respondWithResult(_0x5d2bc1,null))[_0x6dc2('0x2b')](handleError(_0x5d2bc1,null));};var interaction_log=require(_0x6dc2('0x12'))(_0x6dc2('0x5c'));exports[_0x6dc2('0x5d')]=function(_0x3857e3,_0x1407e0,_0x3baabe){var _0x4aa4c9={'channel':_0x6dc2('0x5e')};if(_0x3857e3['body']['id']){delete _0x3857e3[_0x6dc2('0x58')]['id'];}_0x3857e3[_0x6dc2('0x58')]['read']=!![];_0x3857e3[_0x6dc2('0x58')]['readAt']=moment()['format'](_0x6dc2('0x5f'));_0x3857e3[_0x6dc2('0x58')][_0x6dc2('0x60')]=_0x3857e3[_0x6dc2('0x58')][_0x6dc2('0x60')]||_0x3857e3[_0x6dc2('0x61')]['id'];return db[_0x6dc2('0x3a')][_0x6dc2('0x56')]({'where':{'id':_0x3857e3[_0x6dc2('0x53')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x6dc2('0x62')}]})[_0x6dc2('0x20')](handleEntityNotFound(_0x1407e0,null))[_0x6dc2('0x20')](saveUpdates(_0x3857e3[_0x6dc2('0x58')],null))[_0x6dc2('0x20')](function(_0x5bd04b){if(_0x5bd04b){_0x4aa4c9['message']=_0x5bd04b['get']({'plain':!![]});return db[_0x6dc2('0x63')][_0x6dc2('0x56')]({'where':{'id':_0x5bd04b[_0x6dc2('0x64')]}});}return null;})[_0x6dc2('0x20')](handleEntityNotFound(_0x1407e0,null))['then'](function(_0x5985ff){if(_0x5985ff){return _0x5985ff[_0x6dc2('0x59')]({'UserId':_0x3857e3[_0x6dc2('0x58')][_0x6dc2('0x60')],'read1stAt':_[_0x6dc2('0x65')](_0x5985ff['read1stAt'])?moment()['format'](_0x6dc2('0x5f')):undefined});}return null;})[_0x6dc2('0x20')](function(_0x1d0200){if(_0x1d0200){_0x4aa4c9[_0x6dc2('0x66')]=_0x1d0200[_0x6dc2('0x67')]({'plain':!![]});interaction_log['info'](_0x6dc2('0x68'),_0x3857e3[_0x6dc2('0x61')]['id'],_0x3857e3[_0x6dc2('0x61')][_0x6dc2('0x38')],_0x3857e3[_0x6dc2('0x61')][_0x6dc2('0x69')],_0x4aa4c9[_0x6dc2('0x66')]['id'],_0x3857e3[_0x6dc2('0x58')]?JSON['stringify'](_0x3857e3['body']):_0x6dc2('0x6a'));return respondWithRpcPromise(_0x6dc2('0x6b'),'acceptMessage',_0x4aa4c9);}return null;})['then'](function(_0x275f15){if(_0x275f15){if(_0x3857e3['body'][_0x6dc2('0x6c')]){_0x4aa4c9[_0x6dc2('0x28')]['interface']=util[_0x6dc2('0x6d')](_0x6dc2('0x6e'),_0x3857e3[_0x6dc2('0x61')][_0x6dc2('0x38')]);_0x4aa4c9[_0x6dc2('0x28')][_0x6dc2('0x6f')]=_0x4aa4c9['channel'];_0x4aa4c9[_0x6dc2('0x28')][_0x6dc2('0x70')]=_0x6dc2('0x5d');return respondWithRpcPromise(_0x6dc2('0x71'),'EventManager',{'event':'acceptmessage','message':_['merge'](_0x4aa4c9[_0x6dc2('0x28')],JSON[_0x6dc2('0x72')](_0x4aa4c9[_0x6dc2('0x66')]['formData']))},client9002)[_0x6dc2('0x20')](function(){return _0x4aa4c9;});}return _0x4aa4c9;}return null;})[_0x6dc2('0x20')](respondWithResult(_0x1407e0,null))[_0x6dc2('0x2b')](handleError(_0x1407e0,null));};var interaction_log=require(_0x6dc2('0x12'))(_0x6dc2('0x5c'));exports[_0x6dc2('0x33')]=function(_0x5a8877,_0x504cde,_0x53c679){var _0x12dfbd={'agent':{},'channel':'chat'};if(_0x5a8877[_0x6dc2('0x58')]['id']){delete _0x5a8877[_0x6dc2('0x58')]['id'];}_0x5a8877[_0x6dc2('0x58')]['UserId']=_0x5a8877['body'][_0x6dc2('0x60')]||_0x5a8877[_0x6dc2('0x61')]['id'];_0x12dfbd[_0x6dc2('0x73')]['id']=_0x5a8877['body']['UserId'];return db['ChatMessage'][_0x6dc2('0x56')]({'where':{'id':_0x5a8877['params']['id'],'UserId':null}})[_0x6dc2('0x20')](handleEntityNotFound(_0x504cde,null))['then'](function(_0x29d274){if(_0x29d274){_0x12dfbd[_0x6dc2('0x28')]=_0x29d274[_0x6dc2('0x67')]({'plain':!![]});return db[_0x6dc2('0x63')]['find']({'where':{'id':_0x29d274[_0x6dc2('0x64')]}});}return null;})[_0x6dc2('0x20')](handleEntityNotFound(_0x504cde,null))[_0x6dc2('0x20')](function(_0x55606b){if(_0x55606b){_0x12dfbd[_0x6dc2('0x66')]=_0x55606b[_0x6dc2('0x67')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5a8877['user']['id'],_0x5a8877['user'][_0x6dc2('0x38')],_0x5a8877[_0x6dc2('0x61')][_0x6dc2('0x69')],_0x12dfbd['interaction']['id'],_0x5a8877[_0x6dc2('0x58')]?JSON[_0x6dc2('0x24')](_0x5a8877[_0x6dc2('0x58')]):_0x6dc2('0x6a'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x12dfbd);}return null;})[_0x6dc2('0x20')](function(_0x548c4d){if(_0x548c4d){_0x548c4d[_0x6dc2('0x28')][_0x6dc2('0x74')]=util[_0x6dc2('0x6d')](_0x6dc2('0x6e'),_0x5a8877[_0x6dc2('0x61')][_0x6dc2('0x38')]);_0x548c4d[_0x6dc2('0x28')][_0x6dc2('0x6f')]=_0x12dfbd['channel'];_0x548c4d[_0x6dc2('0x28')][_0x6dc2('0x70')]=_0x6dc2('0x33');respondWithRpcPromise(_0x6dc2('0x71'),_0x6dc2('0x71'),{'event':_0x6dc2('0x75'),'message':_0x548c4d[_0x6dc2('0x28')]},client9002);return _0x12dfbd;}return null;})[_0x6dc2('0x20')](respondWithResult(_0x504cde,null))['catch'](handleError(_0x504cde,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 7bb31f1..4d01106 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 _0xb846=['emit','hasOwnProperty','events','setMaxListeners','save','update','remove'];(function(_0x5bd594,_0x2037eb){var _0x59754e=function(_0x321dec){while(--_0x321dec){_0x5bd594['push'](_0x5bd594['shift']());}};_0x59754e(++_0x2037eb);}(_0xb846,0x1d0));var _0x6b84=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xb846[_0x21a9d9];return _0x46adce;};'use strict';var EventEmitter=require(_0x6b84('0x0'));var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x6b84('0x1')](0x0);var events={'afterCreate':_0x6b84('0x2'),'afterUpdate':_0x6b84('0x3'),'afterDestroy':_0x6b84('0x4')};function emitEvent(_0x5a0750){return function(_0x53514b,_0xa68b33,_0x39d119){ChatMessageEvents[_0x6b84('0x5')](_0x5a0750+':'+_0x53514b['id'],_0x53514b);ChatMessageEvents[_0x6b84('0x5')](_0x5a0750,_0x53514b);_0x39d119(null);};}for(var e in events){if(events[_0x6b84('0x6')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file +var _0x6ae2=['emit','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove'];(function(_0x2224a0,_0x57aea5){var _0x3853cf=function(_0x2fd358){while(--_0x2fd358){_0x2224a0['push'](_0x2224a0['shift']());}};_0x3853cf(++_0x57aea5);}(_0x6ae2,0x1ed));var _0x26ae=function(_0x1b8643,_0x262af0){_0x1b8643=_0x1b8643-0x0;var _0x51604d=_0x6ae2[_0x1b8643];return _0x51604d;};'use strict';var EventEmitter=require(_0x26ae('0x0'));var ChatMessage=require(_0x26ae('0x1'))['db'][_0x26ae('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x26ae('0x3')](0x0);var events={'afterCreate':_0x26ae('0x4'),'afterUpdate':_0x26ae('0x5'),'afterDestroy':_0x26ae('0x6')};function emitEvent(_0x281760){return function(_0x318952,_0x5b52b9,_0x1158ff){ChatMessageEvents[_0x26ae('0x7')](_0x281760+':'+_0x318952['id'],_0x318952);ChatMessageEvents['emit'](_0x281760,_0x318952);_0x1158ff(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x26ae('0x8')](e,emitEvent(event));}}module[_0x26ae('0x9')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 89ddf20..dcb0f4c 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 _0x6c81=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage','chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','ChatInteractionId','then','createdAt','error','utf8mb4_unicode_ci','lodash'];(function(_0xd5b5ad,_0x6b930){var _0x342414=function(_0x4372a2){while(--_0x4372a2){_0xd5b5ad['push'](_0xd5b5ad['shift']());}};_0x342414(++_0x6b930);}(_0x6c81,0xdf));var _0x16c8=function(_0x5a8e42,_0x1bdf90){_0x5a8e42=_0x5a8e42-0x0;var _0x3939ef=_0x6c81[_0x5a8e42];return _0x3939ef;};'use strict';var _=require(_0x16c8('0x0'));var util=require(_0x16c8('0x1'));var logger=require(_0x16c8('0x2'))(_0x16c8('0x3'));var moment=require(_0x16c8('0x4'));var BPromise=require(_0x16c8('0x5'));var rp=require(_0x16c8('0x6'));var fs=require('fs');var path=require(_0x16c8('0x7'));var rimraf=require(_0x16c8('0x8'));var config=require(_0x16c8('0x9'));var attributes=require(_0x16c8('0xa'));module['exports']=function(_0x1d54d1,_0x3853af){return _0x1d54d1[_0x16c8('0xb')](_0x16c8('0xc'),attributes,{'tableName':_0x16c8('0xd'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x16c8('0xe')],'type':_0x16c8('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2285f2,_0x2da916,_0xe61f96){var _0x3491bc=_0x1d54d1[_0x16c8('0x10')];var _0x3b0355=_0x2285f2[_0x16c8('0x11')]({'plain':!![]});if(_0x3b0355[_0x16c8('0x12')][_0x16c8('0x13')]()==='in'||_0x3b0355[_0x16c8('0x12')][_0x16c8('0x13')]()===_0x16c8('0x14')&&!_0x3b0355['secret']&&!_[_0x16c8('0x15')](_0x3b0355[_0x16c8('0x16')])){_0x3491bc['ChatInteraction']['findOne']({'where':{'id':_0x3b0355[_0x16c8('0x17')]}})[_0x16c8('0x18')](function(_0x80be8b){if(_0x80be8b){_0x80be8b['update']({'lastMsgAt':_0x3b0355[_0x16c8('0x19')],'lastMsgDirection':_0x3b0355['direction']['toLowerCase']()});}})['catch'](function(_0xbd760e){console[_0x16c8('0x1a')](_0xbd760e);});}_0xe61f96();}},'charset':'utf8mb4','collate':_0x16c8('0x1b')});}; \ No newline at end of file +var _0x5504=['./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','api','bluebird','request-promise','path','rimraf'];(function(_0x1baa84,_0x3c938e){var _0x18523b=function(_0x120137){while(--_0x120137){_0x1baa84['push'](_0x1baa84['shift']());}};_0x18523b(++_0x3c938e);}(_0x5504,0xe3));var _0x4550=function(_0x16ca8e,_0x60f267){_0x16ca8e=_0x16ca8e-0x0;var _0x4c560e=_0x5504[_0x16ca8e];return _0x4c560e;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x4550('0x0'));var moment=require('moment');var BPromise=require(_0x4550('0x1'));var rp=require(_0x4550('0x2'));var fs=require('fs');var path=require(_0x4550('0x3'));var rimraf=require(_0x4550('0x4'));var config=require('../../config/environment');var attributes=require(_0x4550('0x5'));module[_0x4550('0x6')]=function(_0xf8753,_0xbb63c5){return _0xf8753[_0x4550('0x7')](_0x4550('0x8'),attributes,{'tableName':_0x4550('0x9'),'paranoid':![],'indexes':[{'name':_0x4550('0xa'),'fields':[_0x4550('0xb')],'type':_0x4550('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2bafdc,_0x558ea8,_0x748660){var _0x2bc245=_0xf8753[_0x4550('0xd')];var _0x1bf4f0=_0x2bafdc['get']({'plain':!![]});if(_0x1bf4f0[_0x4550('0xe')][_0x4550('0xf')]()==='in'||_0x1bf4f0[_0x4550('0xe')]['toLowerCase']()===_0x4550('0x10')&&!_0x1bf4f0[_0x4550('0x11')]&&!_[_0x4550('0x12')](_0x1bf4f0[_0x4550('0x13')])){_0x2bc245[_0x4550('0x14')][_0x4550('0x15')]({'where':{'id':_0x1bf4f0[_0x4550('0x16')]}})[_0x4550('0x17')](function(_0x51b018){if(_0x51b018){_0x51b018[_0x4550('0x18')]({'lastMsgAt':_0x1bf4f0['createdAt'],'lastMsgDirection':_0x1bf4f0[_0x4550('0xe')][_0x4550('0xf')]()});}})[_0x4550('0x19')](function(_0x2b7dfe){console[_0x4550('0x1a')](_0x2b7dfe);});}_0x748660();}},'charset':_0x4550('0x1b'),'collate':_0x4550('0x1c')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 5489e4b..064ec7c 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 _0x3ea1=['info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','socket.io-emitter','./chatMessage.socket','register','then'];(function(_0x67c07,_0x549b27){var _0x219299=function(_0x125d93){while(--_0x125d93){_0x67c07['push'](_0x67c07['shift']());}};_0x219299(++_0x549b27);}(_0x3ea1,0x8c));var _0x13ea=function(_0x330e77,_0x2dd3c0){_0x330e77=_0x330e77-0x0;var _0xdbadea=_0x3ea1[_0x330e77];return _0xdbadea;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x13ea('0x0'));var BPromise=require('bluebird');var rs=require(_0x13ea('0x1'));var fs=require('fs');var Redis=require(_0x13ea('0x2'));var db=require(_0x13ea('0x3'))['db'];var utils=require(_0x13ea('0x4'));var logger=require(_0x13ea('0x5'))(_0x13ea('0x6'));var config=require('../../config/environment');var jayson=require(_0x13ea('0x7'));var client=jayson[_0x13ea('0x8')]['http']({'port':0x232a});config[_0x13ea('0x9')]=_[_0x13ea('0xa')](config[_0x13ea('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x13ea('0xb'))(new Redis(config[_0x13ea('0x9')]));require(_0x13ea('0xc'))[_0x13ea('0xd')](socket);function respondWithRpcPromise(_0x232acb,_0x3a8608,_0x1f77b8){return new BPromise(function(_0x18e6a3,_0x2bb15d){return client['request'](_0x232acb,_0x1f77b8)[_0x13ea('0xe')](function(_0x4a6a5d){logger[_0x13ea('0xf')](_0x13ea('0x10'),_0x3a8608,_0x13ea('0x11'));logger[_0x13ea('0x12')](_0x13ea('0x13'),_0x3a8608,_0x13ea('0x11'),JSON[_0x13ea('0x14')](_0x4a6a5d));if(_0x4a6a5d[_0x13ea('0x15')]){if(_0x4a6a5d['error'][_0x13ea('0x16')]===0x1f4){logger[_0x13ea('0x15')](_0x13ea('0x10'),_0x3a8608,_0x4a6a5d[_0x13ea('0x15')][_0x13ea('0x17')]);return _0x2bb15d(_0x4a6a5d['error']['message']);}logger['error'](_0x13ea('0x10'),_0x3a8608,_0x4a6a5d[_0x13ea('0x15')]['message']);return _0x18e6a3(_0x4a6a5d['error'][_0x13ea('0x17')]);}else{logger[_0x13ea('0xf')]('ChatMessage,\x20%s,\x20%s',_0x3a8608,_0x13ea('0x11'));_0x18e6a3(_0x4a6a5d[_0x13ea('0x18')]['message']);}})[_0x13ea('0x19')](function(_0x12368f){logger[_0x13ea('0x15')](_0x13ea('0x10'),_0x3a8608,_0x12368f);_0x2bb15d(_0x12368f);});});}exports[_0x13ea('0x1a')]=function(_0x3546ea){var _0x5c4d89=this;return new Promise(function(_0x40b321,_0x27a41b){return db[_0x13ea('0x1b')][_0x13ea('0x1c')](_0x3546ea[_0x13ea('0x1d')],{'raw':_0x3546ea[_0x13ea('0x1e')]?_0x3546ea['options']['raw']===undefined?!![]:![]:!![]})[_0x13ea('0xe')](function(_0x3cc881){logger[_0x13ea('0xf')](_0x13ea('0x1a'),_0x3546ea);logger[_0x13ea('0x12')]('CreateChatMessage',_0x3546ea,JSON[_0x13ea('0x14')](_0x3cc881));_0x40b321(_0x3cc881);})[_0x13ea('0x19')](function(_0x294ff8){logger[_0x13ea('0x15')](_0x13ea('0x1a'),_0x294ff8[_0x13ea('0x17')],_0x3546ea);_0x27a41b(_0x5c4d89[_0x13ea('0x15')](0x1f4,_0x294ff8[_0x13ea('0x17')]));});});}; \ No newline at end of file +var _0xc0c6=['jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','CreateChatMessage','ChatMessage','options','raw','debug','stringify','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x11deef,_0x34bbdb){var _0xe9ba85=function(_0x591377){while(--_0x591377){_0x11deef['push'](_0x11deef['shift']());}};_0xe9ba85(++_0x34bbdb);}(_0xc0c6,0x76));var _0x6c0c=function(_0x58df3b,_0x182132){_0x58df3b=_0x58df3b-0x0;var _0x1c82d6=_0xc0c6[_0x58df3b];return _0x1c82d6;};'use strict';var _=require(_0x6c0c('0x0'));var util=require('util');var moment=require(_0x6c0c('0x1'));var BPromise=require(_0x6c0c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6c0c('0x3'));var db=require(_0x6c0c('0x4'))['db'];var utils=require(_0x6c0c('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x6c0c('0x6'));var client=jayson[_0x6c0c('0x7')][_0x6c0c('0x8')]({'port':0x232a});config[_0x6c0c('0x9')]=_['defaults'](config[_0x6c0c('0x9')],{'host':_0x6c0c('0xa'),'port':0x18eb});var socket=require(_0x6c0c('0xb'))(new Redis(config['redis']));require(_0x6c0c('0xc'))[_0x6c0c('0xd')](socket);function respondWithRpcPromise(_0x58c561,_0x19bd00,_0x3e5fd8){return new BPromise(function(_0x278942,_0x1ddeee){return client[_0x6c0c('0xe')](_0x58c561,_0x3e5fd8)[_0x6c0c('0xf')](function(_0xf1100){logger[_0x6c0c('0x10')]('ChatMessage,\x20%s,\x20%s',_0x19bd00,_0x6c0c('0x11'));logger['debug'](_0x6c0c('0x12'),_0x19bd00,'request\x20sent',JSON['stringify'](_0xf1100));if(_0xf1100[_0x6c0c('0x13')]){if(_0xf1100[_0x6c0c('0x13')][_0x6c0c('0x14')]===0x1f4){logger[_0x6c0c('0x13')](_0x6c0c('0x15'),_0x19bd00,_0xf1100['error']['message']);return _0x1ddeee(_0xf1100[_0x6c0c('0x13')][_0x6c0c('0x16')]);}logger[_0x6c0c('0x13')]('ChatMessage,\x20%s,\x20%s',_0x19bd00,_0xf1100['error'][_0x6c0c('0x16')]);return _0x278942(_0xf1100['error']['message']);}else{logger[_0x6c0c('0x10')]('ChatMessage,\x20%s,\x20%s',_0x19bd00,_0x6c0c('0x11'));_0x278942(_0xf1100[_0x6c0c('0x17')]['message']);}})[_0x6c0c('0x18')](function(_0x2c4ed5){logger['error'](_0x6c0c('0x15'),_0x19bd00,_0x2c4ed5);_0x1ddeee(_0x2c4ed5);});});}exports[_0x6c0c('0x19')]=function(_0x6a6457){var _0x52d5ad=this;return new Promise(function(_0x91ac9b,_0x5ebf0c){return db[_0x6c0c('0x1a')]['create'](_0x6a6457['body'],{'raw':_0x6a6457[_0x6c0c('0x1b')]?_0x6a6457[_0x6c0c('0x1b')][_0x6c0c('0x1c')]===undefined?!![]:![]:!![]})[_0x6c0c('0xf')](function(_0x1f924c){logger['info'](_0x6c0c('0x19'),_0x6a6457);logger[_0x6c0c('0x1d')]('CreateChatMessage',_0x6a6457,JSON[_0x6c0c('0x1e')](_0x1f924c));_0x91ac9b(_0x1f924c);})[_0x6c0c('0x18')](function(_0x3baab7){logger['error'](_0x6c0c('0x19'),_0x3baab7['message'],_0x6a6457);_0x5ebf0c(_0x52d5ad['error'](0x1f4,_0x3baab7['message']));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 2d04b7c..19ecb62 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 _0x70e0=['chatMessage:','./chatMessage.events','save','remove','emit','removeListener'];(function(_0x39288d,_0x185e57){var _0x45f7c1=function(_0x5e50bc){while(--_0x5e50bc){_0x39288d['push'](_0x39288d['shift']());}};_0x45f7c1(++_0x185e57);}(_0x70e0,0x17b));var _0x070e=function(_0x43d77b,_0x35dbc5){_0x43d77b=_0x43d77b-0x0;var _0x3bcf99=_0x70e0[_0x43d77b];return _0x3bcf99;};'use strict';var ChatMessageEvents=require(_0x070e('0x0'));var events=[_0x070e('0x1'),_0x070e('0x2'),'update'];function createListener(_0x579b83,_0x16e651){return function(_0xee173){_0x16e651[_0x070e('0x3')](_0x579b83,_0xee173);};}function removeListener(_0x2593e5,_0x5c90fc){return function(){ChatMessageEvents[_0x070e('0x4')](_0x2593e5,_0x5c90fc);};}exports['register']=function(_0x46fe68){for(var _0x4b041d=0x0,_0x56e420=events['length'];_0x4b041d<_0x56e420;_0x4b041d++){var _0x35ab0c=events[_0x4b041d];var _0x1e11f0=createListener(_0x070e('0x5')+_0x35ab0c,_0x46fe68);ChatMessageEvents['on'](_0x35ab0c,_0x1e11f0);}}; \ No newline at end of file +var _0x3e74=['emit','removeListener','register','length','chatMessage:','./chatMessage.events','remove','update'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0x3e74,0x175));var _0x43e7=function(_0x2febd4,_0x534ce2){_0x2febd4=_0x2febd4-0x0;var _0xb17fbc=_0x3e74[_0x2febd4];return _0xb17fbc;};'use strict';var ChatMessageEvents=require(_0x43e7('0x0'));var events=['save',_0x43e7('0x1'),_0x43e7('0x2')];function createListener(_0x151ad2,_0x494e45){return function(_0x490ced){_0x494e45[_0x43e7('0x3')](_0x151ad2,_0x490ced);};}function removeListener(_0x4f9bbe,_0x128b0f){return function(){ChatMessageEvents[_0x43e7('0x4')](_0x4f9bbe,_0x128b0f);};}exports[_0x43e7('0x5')]=function(_0x1c503b){for(var _0xc98b9c=0x0,_0x503698=events[_0x43e7('0x6')];_0xc98b9c<_0x503698;_0xc98b9c++){var _0x3491d6=events[_0xc98b9c];var _0x2ede2d=createListener(_0x43e7('0x7')+_0x3491d6,_0x1c503b);ChatMessageEvents['on'](_0x3491d6,_0x2ede2d);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 1647907..68eb80a 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 _0xb993=['tracked','chatmessage:create','create','put','update','reject','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','index','describe','/:id','post'];(function(_0x120376,_0x571898){var _0x28c529=function(_0x4f130c){while(--_0x4f130c){_0x120376['push'](_0x120376['shift']());}};_0x28c529(++_0x571898);}(_0xb993,0x190));var _0x3b99=function(_0x4ea119,_0x166138){_0x4ea119=_0x4ea119-0x0;var _0x562334=_0xb993[_0x4ea119];return _0x562334;};'use strict';var multer=require('multer');var util=require(_0x3b99('0x0'));var path=require(_0x3b99('0x1'));var timeout=require(_0x3b99('0x2'));var express=require(_0x3b99('0x3'));var router=express[_0x3b99('0x4')]();var auth=require(_0x3b99('0x5'));var interaction=require(_0x3b99('0x6'));var config=require('../../config/environment');var controller=require(_0x3b99('0x7'));router[_0x3b99('0x8')]('/',auth[_0x3b99('0x9')](),controller[_0x3b99('0xa')]);router[_0x3b99('0x8')]('/describe',auth[_0x3b99('0x9')](),controller[_0x3b99('0xb')]);router[_0x3b99('0x8')](_0x3b99('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x3b99('0xd')]('/',auth[_0x3b99('0x9')](),interaction[_0x3b99('0xe')]('chat',_0x3b99('0xf')),controller[_0x3b99('0x10')]);router[_0x3b99('0x11')](_0x3b99('0xc'),controller[_0x3b99('0x12')]);router[_0x3b99('0x11')]('/:id/accept',auth[_0x3b99('0x9')](),controller['accept']);router[_0x3b99('0x11')]('/:id/reject',auth[_0x3b99('0x9')](),controller[_0x3b99('0x13')]);router[_0x3b99('0x14')](_0x3b99('0xc'),auth['isAuthenticated'](),controller[_0x3b99('0x15')]);module[_0x3b99('0x16')]=router; \ No newline at end of file +var _0xaf7b=['reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','/describe','describe','/:id','chat','put','/:id/accept','accept','/:id/reject'];(function(_0x28c939,_0x110e29){var _0x527fe9=function(_0x1df2a6){while(--_0x1df2a6){_0x28c939['push'](_0x28c939['shift']());}};_0x527fe9(++_0x110e29);}(_0xaf7b,0x16c));var _0xbaf7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaf7b[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xbaf7('0x0'));var util=require(_0xbaf7('0x1'));var path=require(_0xbaf7('0x2'));var timeout=require(_0xbaf7('0x3'));var express=require(_0xbaf7('0x4'));var router=express[_0xbaf7('0x5')]();var auth=require(_0xbaf7('0x6'));var interaction=require(_0xbaf7('0x7'));var config=require(_0xbaf7('0x8'));var controller=require(_0xbaf7('0x9'));router['get']('/',auth[_0xbaf7('0xa')](),controller[_0xbaf7('0xb')]);router['get'](_0xbaf7('0xc'),auth['isAuthenticated'](),controller[_0xbaf7('0xd')]);router['get'](_0xbaf7('0xe'),auth[_0xbaf7('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),interaction['tracked'](_0xbaf7('0xf'),'chatmessage:create'),controller['create']);router[_0xbaf7('0x10')]('/:id',controller['update']);router[_0xbaf7('0x10')](_0xbaf7('0x11'),auth['isAuthenticated'](),controller[_0xbaf7('0x12')]);router['put'](_0xbaf7('0x13'),auth[_0xbaf7('0xa')](),controller[_0xbaf7('0x14')]);router[_0xbaf7('0x15')](_0xbaf7('0xe'),auth[_0xbaf7('0xa')](),controller[_0xbaf7('0x16')]);module[_0xbaf7('0x17')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 7db97bc..37f0aba 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 _0x10d8=['TEXT','sequelize','exports'];(function(_0xe6e78c,_0x582369){var _0x2a09c8=function(_0x470ccc){while(--_0x470ccc){_0xe6e78c['push'](_0xe6e78c['shift']());}};_0x2a09c8(++_0x582369);}(_0x10d8,0xee));var _0x810d=function(_0x2bb565,_0x4c62bd){_0x2bb565=_0x2bb565-0x0;var _0x1141b1=_0x10d8[_0x2bb565];return _0x1141b1;};'use strict';var Sequelize=require(_0x810d('0x0'));module[_0x810d('0x1')]={'body':{'type':Sequelize[_0x810d('0x2')]('medium'),'allowNull':![]}}; \ No newline at end of file +var _0x49e9=['medium','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x49e9,0x10f));var _0x949e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x49e9[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x949e('0x0'));module[_0x949e('0x1')]={'body':{'type':Sequelize['TEXT'](_0x949e('0x2')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 72505c7..f562eab 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 _0x0099=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','set','Content-Range','json','save','update','then','destroy','end','error','stack','name','send','index','ChatOfflineMessage','rawAttributes','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','limit','order','pick','filter','merge','where','map','key','VIRTUAL','field','options','includeAll','include','rows','catch','show','params','length','find','create','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0xedb418,_0x2e37fd){var _0x2e39f2=function(_0x3d9147){while(--_0x3d9147){_0xedb418['push'](_0xedb418['shift']());}};_0x2e39f2(++_0x2e37fd);}(_0x0099,0x1a3));var _0x9009=function(_0x3a1ea5,_0x349f01){_0x3a1ea5=_0x3a1ea5-0x0;var _0xfac9b2=_0x0099[_0x3a1ea5];return _0xfac9b2;};'use strict';var pdf=require(_0x9009('0x0'));var emlformat=require(_0x9009('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9009('0x2'));var jsonpatch=require(_0x9009('0x3'));var rp=require(_0x9009('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9009('0x5'));var util=require(_0x9009('0x6'));var path=require(_0x9009('0x7'));var sox=require(_0x9009('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x9009('0x9'));var squel=require(_0x9009('0xa'));var crypto=require(_0x9009('0xb'));var jsforce=require(_0x9009('0xc'));var deskjs=require(_0x9009('0xd'));var toCsv=require(_0x9009('0xe'));var querystring=require('querystring');var Papa=require(_0x9009('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9009('0x10'));var hardwareService=require(_0x9009('0x11'));var logger=require(_0x9009('0x12'))(_0x9009('0x13'));var utils=require(_0x9009('0x14'));var config=require(_0x9009('0x15'));var db=require(_0x9009('0x16'))['db'];function respondWithStatusCode(_0x94cc30,_0x1bfa98){_0x1bfa98=_0x1bfa98||0xcc;return function(_0x493ecc){if(_0x493ecc){return _0x94cc30[_0x9009('0x17')](_0x1bfa98);}return _0x94cc30[_0x9009('0x18')](_0x1bfa98)['end']();};}function respondWithResult(_0x3057c6,_0x4dcfbe){_0x4dcfbe=_0x4dcfbe||0xc8;return function(_0x111fa4){if(_0x111fa4){return _0x3057c6[_0x9009('0x18')](_0x4dcfbe)['json'](_0x111fa4);}};}function respondWithFilteredResult(_0x46b804,_0x357574){return function(_0x1fd515){if(_0x1fd515){var _0x535d64=_0x1fd515[_0x9009('0x19')],_0x353355=_0x357574[_0x9009('0x1a')],_0x5798d9=_0x357574[_0x9009('0x1a')]+_0x357574['limit'],_0x12ffe0;if(_0x5798d9>=_0x535d64){_0x5798d9=_0x535d64;_0x12ffe0=0xc8;}else{_0x12ffe0=0xce;}_0x46b804[_0x9009('0x18')](_0x12ffe0);return _0x46b804[_0x9009('0x1b')](_0x9009('0x1c'),_0x353355+'-'+_0x5798d9+'/'+_0x535d64)[_0x9009('0x1d')](_0x1fd515);}return null;};}function patchUpdates(_0x21e102){return function(_0x267fae){try{jsonpatch['apply'](_0x267fae,_0x21e102,!![]);}catch(_0x156e24){return BPromise['reject'](_0x156e24);}return _0x267fae[_0x9009('0x1e')]();};}function saveUpdates(_0x44ea2e,_0x2f4656){return function(_0x338303){if(_0x338303){return _0x338303[_0x9009('0x1f')](_0x44ea2e)[_0x9009('0x20')](function(_0x30927c){return _0x30927c;});}return null;};}function removeEntity(_0x55cfa6,_0x15f1e8){return function(_0x56e0f2){if(_0x56e0f2){return _0x56e0f2[_0x9009('0x21')]()[_0x9009('0x20')](function(){_0x55cfa6['status'](0xcc)[_0x9009('0x22')]();});}};}function handleEntityNotFound(_0x33d268,_0x4573b9){return function(_0x173b2a){if(!_0x173b2a){_0x33d268['sendStatus'](0x194);}return _0x173b2a;};}function handleError(_0xed7402,_0x4454ed){_0x4454ed=_0x4454ed||0x1f4;return function(_0x383c09){logger[_0x9009('0x23')](_0x383c09[_0x9009('0x24')]);if(_0x383c09['name']){delete _0x383c09[_0x9009('0x25')];}_0xed7402[_0x9009('0x18')](_0x4454ed)[_0x9009('0x26')](_0x383c09);};}exports[_0x9009('0x27')]=function(_0x59b807,_0x22d5f8){var _0x597cca={},_0x57fcfd={},_0x4c4f43={'count':0x0,'rows':[]};var _0x28c744=db[_0x9009('0x28')][_0x9009('0x29')];_0x57fcfd['model']=_['keys'](_0x28c744);_0x57fcfd[_0x9009('0x2a')]=_[_0x9009('0x2b')](_0x59b807['query']);_0x57fcfd[_0x9009('0x2c')]=_[_0x9009('0x2d')](_0x57fcfd['model'],_0x57fcfd[_0x9009('0x2a')]);_0x597cca[_0x9009('0x2e')]=_['intersection'](_0x57fcfd[_0x9009('0x2f')],qs[_0x9009('0x30')](_0x59b807[_0x9009('0x2a')]['fields']));_0x597cca[_0x9009('0x2e')]=_0x597cca[_0x9009('0x2e')]['length']?_0x597cca[_0x9009('0x2e')]:_0x57fcfd['model'];if(!_0x59b807[_0x9009('0x2a')][_0x9009('0x31')](_0x9009('0x32'))){_0x597cca[_0x9009('0x33')]=qs[_0x9009('0x33')](_0x59b807[_0x9009('0x2a')][_0x9009('0x33')]);_0x597cca['offset']=qs[_0x9009('0x1a')](_0x59b807[_0x9009('0x2a')]['offset']);}_0x597cca[_0x9009('0x34')]=qs['sort'](_0x59b807[_0x9009('0x2a')]['sort']);_0x597cca['where']=qs[_0x9009('0x2c')](_[_0x9009('0x35')](_0x59b807[_0x9009('0x2a')],_0x57fcfd[_0x9009('0x2c')]));if(_0x59b807[_0x9009('0x2a')][_0x9009('0x36')]){_0x597cca['where']=_[_0x9009('0x37')](_0x597cca[_0x9009('0x38')],{'$or':_[_0x9009('0x39')](_0x28c744,function(_0x5ecf24){if(_0x5ecf24['type'][_0x9009('0x3a')]!==_0x9009('0x3b')){var _0x5e742c={};_0x5e742c[_0x5ecf24[_0x9009('0x3c')]]={'$like':'%'+_0x59b807[_0x9009('0x2a')][_0x9009('0x36')]+'%'};return _0x5e742c;}})});}_0x597cca=_[_0x9009('0x37')]({},_0x597cca,_0x59b807[_0x9009('0x3d')]);var _0x2bb124={'where':_0x597cca['where']};return db[_0x9009('0x28')][_0x9009('0x19')](_0x2bb124)[_0x9009('0x20')](function(_0x36f48d){_0x4c4f43[_0x9009('0x19')]=_0x36f48d;if(_0x59b807[_0x9009('0x2a')][_0x9009('0x3e')]){_0x597cca[_0x9009('0x3f')]=[{'all':!![]}];}return db[_0x9009('0x28')]['findAll'](_0x597cca);})[_0x9009('0x20')](function(_0x2f15bd){_0x4c4f43[_0x9009('0x40')]=_0x2f15bd;return _0x4c4f43;})[_0x9009('0x20')](respondWithFilteredResult(_0x22d5f8,_0x597cca))[_0x9009('0x41')](handleError(_0x22d5f8,null));};exports[_0x9009('0x42')]=function(_0x43664e,_0x597e54){var _0x556cdb={'raw':!![],'where':{'id':_0x43664e[_0x9009('0x43')]['id']}},_0x2ad736={};_0x2ad736[_0x9009('0x2f')]=_['keys'](db[_0x9009('0x28')][_0x9009('0x29')]);_0x2ad736[_0x9009('0x2a')]=_[_0x9009('0x2b')](_0x43664e[_0x9009('0x2a')]);_0x2ad736['filters']=_[_0x9009('0x2d')](_0x2ad736['model'],_0x2ad736[_0x9009('0x2a')]);_0x556cdb[_0x9009('0x2e')]=_[_0x9009('0x2d')](_0x2ad736[_0x9009('0x2f')],qs[_0x9009('0x30')](_0x43664e[_0x9009('0x2a')]['fields']));_0x556cdb[_0x9009('0x2e')]=_0x556cdb['attributes'][_0x9009('0x44')]?_0x556cdb[_0x9009('0x2e')]:_0x2ad736[_0x9009('0x2f')];if(_0x43664e['query'][_0x9009('0x3e')]){_0x556cdb[_0x9009('0x3f')]=[{'all':!![]}];}_0x556cdb=_['merge']({},_0x556cdb,_0x43664e[_0x9009('0x3d')]);return db[_0x9009('0x28')][_0x9009('0x45')](_0x556cdb)[_0x9009('0x20')](handleEntityNotFound(_0x597e54,null))[_0x9009('0x20')](respondWithResult(_0x597e54,null))['catch'](handleError(_0x597e54,null));};exports[_0x9009('0x46')]=function(_0x39b27a,_0x360cf4){return db[_0x9009('0x28')]['create'](_0x39b27a['body'],{})[_0x9009('0x20')](respondWithResult(_0x360cf4,0xc9))[_0x9009('0x41')](handleError(_0x360cf4,null));};exports[_0x9009('0x1f')]=function(_0x36caaf,_0x1aa099){if(_0x36caaf[_0x9009('0x47')]['id']){delete _0x36caaf[_0x9009('0x47')]['id'];}return db[_0x9009('0x28')][_0x9009('0x45')]({'where':{'id':_0x36caaf[_0x9009('0x43')]['id']}})[_0x9009('0x20')](handleEntityNotFound(_0x1aa099,null))[_0x9009('0x20')](saveUpdates(_0x36caaf[_0x9009('0x47')],null))[_0x9009('0x20')](respondWithResult(_0x1aa099,null))['catch'](handleError(_0x1aa099,null));};exports[_0x9009('0x21')]=function(_0x1334f7,_0x210961){return db[_0x9009('0x28')][_0x9009('0x45')]({'where':{'id':_0x1334f7['params']['id']}})[_0x9009('0x20')](handleEntityNotFound(_0x210961,null))[_0x9009('0x20')](removeEntity(_0x210961,null))['catch'](handleError(_0x210961,null));};exports[_0x9009('0x48')]=function(_0xc6bddf,_0x12470a){return db[_0x9009('0x28')]['describe']()[_0x9009('0x20')](respondWithResult(_0x12470a,null))[_0x9009('0x41')](handleError(_0x12470a,null));}; \ No newline at end of file +var _0xd878=['../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','ChatOfflineMessage','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','key','VIRTUAL','findAll','rows','show','params','includeAll','include','options','find','create','catch','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/logger','api'];(function(_0xf2ee56,_0x565642){var _0x2b9bc9=function(_0x3d3389){while(--_0x3d3389){_0xf2ee56['push'](_0xf2ee56['shift']());}};_0x2b9bc9(++_0x565642);}(_0xd878,0x118));var _0x8d87=function(_0x39cf62,_0xe41683){_0x39cf62=_0x39cf62-0x0;var _0x38b6bb=_0xd878[_0x39cf62];return _0x38b6bb;};'use strict';var pdf=require(_0x8d87('0x0'));var emlformat=require(_0x8d87('0x1'));var rimraf=require(_0x8d87('0x2'));var zipdir=require(_0x8d87('0x3'));var jsonpatch=require(_0x8d87('0x4'));var rp=require(_0x8d87('0x5'));var moment=require(_0x8d87('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x8d87('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8d87('0x8'));var fs=require('fs');var _=require(_0x8d87('0x9'));var squel=require(_0x8d87('0xa'));var crypto=require(_0x8d87('0xb'));var jsforce=require(_0x8d87('0xc'));var deskjs=require(_0x8d87('0xd'));var toCsv=require(_0x8d87('0xe'));var querystring=require(_0x8d87('0xf'));var Papa=require(_0x8d87('0x10'));var Redis=require('ioredis');var authService=require(_0x8d87('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8d87('0x12'))(_0x8d87('0x13'));var utils=require(_0x8d87('0x14'));var config=require(_0x8d87('0x15'));var db=require(_0x8d87('0x16'))['db'];function respondWithStatusCode(_0x44578f,_0x4ed266){_0x4ed266=_0x4ed266||0xcc;return function(_0x85019b){if(_0x85019b){return _0x44578f['sendStatus'](_0x4ed266);}return _0x44578f[_0x8d87('0x17')](_0x4ed266)['end']();};}function respondWithResult(_0x3213be,_0x98b85f){_0x98b85f=_0x98b85f||0xc8;return function(_0x33c197){if(_0x33c197){return _0x3213be['status'](_0x98b85f)[_0x8d87('0x18')](_0x33c197);}};}function respondWithFilteredResult(_0x53b15e,_0x54ac96){return function(_0x3765c2){if(_0x3765c2){var _0x5954d3=_0x3765c2[_0x8d87('0x19')],_0x1d6695=_0x54ac96['offset'],_0x28c54e=_0x54ac96[_0x8d87('0x1a')]+_0x54ac96[_0x8d87('0x1b')],_0x262833;if(_0x28c54e>=_0x5954d3){_0x28c54e=_0x5954d3;_0x262833=0xc8;}else{_0x262833=0xce;}_0x53b15e['status'](_0x262833);return _0x53b15e['set'](_0x8d87('0x1c'),_0x1d6695+'-'+_0x28c54e+'/'+_0x5954d3)[_0x8d87('0x18')](_0x3765c2);}return null;};}function patchUpdates(_0x1c5677){return function(_0x4fc4c6){try{jsonpatch[_0x8d87('0x1d')](_0x4fc4c6,_0x1c5677,!![]);}catch(_0x3a3678){return BPromise[_0x8d87('0x1e')](_0x3a3678);}return _0x4fc4c6[_0x8d87('0x1f')]();};}function saveUpdates(_0x1e9555,_0x2358f1){return function(_0xb50299){if(_0xb50299){return _0xb50299[_0x8d87('0x20')](_0x1e9555)[_0x8d87('0x21')](function(_0xfe5cc1){return _0xfe5cc1;});}return null;};}function removeEntity(_0x1cd3d9,_0x1bd78b){return function(_0x3f0982){if(_0x3f0982){return _0x3f0982[_0x8d87('0x22')]()[_0x8d87('0x21')](function(){_0x1cd3d9[_0x8d87('0x17')](0xcc)[_0x8d87('0x23')]();});}};}function handleEntityNotFound(_0x1128f9,_0x9272a4){return function(_0x5d1ac0){if(!_0x5d1ac0){_0x1128f9[_0x8d87('0x24')](0x194);}return _0x5d1ac0;};}function handleError(_0x2cd362,_0x5f7030){_0x5f7030=_0x5f7030||0x1f4;return function(_0x5bf4a1){logger[_0x8d87('0x25')](_0x5bf4a1[_0x8d87('0x26')]);if(_0x5bf4a1[_0x8d87('0x27')]){delete _0x5bf4a1[_0x8d87('0x27')];}_0x2cd362[_0x8d87('0x17')](_0x5f7030)[_0x8d87('0x28')](_0x5bf4a1);};}exports[_0x8d87('0x29')]=function(_0x5eec59,_0x3b804a){var _0xa41b40={},_0x36f078={},_0x2b6aa1={'count':0x0,'rows':[]};var _0x44918f=db[_0x8d87('0x2a')][_0x8d87('0x2b')];_0x36f078[_0x8d87('0x2c')]=_[_0x8d87('0x2d')](_0x44918f);_0x36f078[_0x8d87('0x2e')]=_[_0x8d87('0x2d')](_0x5eec59[_0x8d87('0x2e')]);_0x36f078[_0x8d87('0x2f')]=_['intersection'](_0x36f078['model'],_0x36f078['query']);_0xa41b40[_0x8d87('0x30')]=_[_0x8d87('0x31')](_0x36f078[_0x8d87('0x2c')],qs[_0x8d87('0x32')](_0x5eec59['query'][_0x8d87('0x32')]));_0xa41b40['attributes']=_0xa41b40['attributes'][_0x8d87('0x33')]?_0xa41b40[_0x8d87('0x30')]:_0x36f078[_0x8d87('0x2c')];if(!_0x5eec59[_0x8d87('0x2e')][_0x8d87('0x34')](_0x8d87('0x35'))){_0xa41b40[_0x8d87('0x1b')]=qs[_0x8d87('0x1b')](_0x5eec59['query'][_0x8d87('0x1b')]);_0xa41b40[_0x8d87('0x1a')]=qs[_0x8d87('0x1a')](_0x5eec59[_0x8d87('0x2e')]['offset']);}_0xa41b40[_0x8d87('0x36')]=qs[_0x8d87('0x37')](_0x5eec59['query']['sort']);_0xa41b40[_0x8d87('0x38')]=qs[_0x8d87('0x2f')](_['pick'](_0x5eec59[_0x8d87('0x2e')],_0x36f078[_0x8d87('0x2f')]));if(_0x5eec59['query'][_0x8d87('0x39')]){_0xa41b40[_0x8d87('0x38')]=_[_0x8d87('0x3a')](_0xa41b40['where'],{'$or':_[_0x8d87('0x3b')](_0x44918f,function(_0x4dd18f){if(_0x4dd18f[_0x8d87('0x3c')][_0x8d87('0x3d')]!==_0x8d87('0x3e')){var _0x30460a={};_0x30460a[_0x4dd18f['field']]={'$like':'%'+_0x5eec59[_0x8d87('0x2e')][_0x8d87('0x39')]+'%'};return _0x30460a;}})});}_0xa41b40=_['merge']({},_0xa41b40,_0x5eec59['options']);var _0x5f0dad={'where':_0xa41b40['where']};return db[_0x8d87('0x2a')][_0x8d87('0x19')](_0x5f0dad)[_0x8d87('0x21')](function(_0x4864e6){_0x2b6aa1[_0x8d87('0x19')]=_0x4864e6;if(_0x5eec59[_0x8d87('0x2e')]['includeAll']){_0xa41b40['include']=[{'all':!![]}];}return db[_0x8d87('0x2a')][_0x8d87('0x3f')](_0xa41b40);})['then'](function(_0x1d3c05){_0x2b6aa1[_0x8d87('0x40')]=_0x1d3c05;return _0x2b6aa1;})[_0x8d87('0x21')](respondWithFilteredResult(_0x3b804a,_0xa41b40))['catch'](handleError(_0x3b804a,null));};exports[_0x8d87('0x41')]=function(_0x2b888d,_0x10d4a3){var _0xe36afb={'raw':!![],'where':{'id':_0x2b888d[_0x8d87('0x42')]['id']}},_0x18ba54={};_0x18ba54[_0x8d87('0x2c')]=_[_0x8d87('0x2d')](db['ChatOfflineMessage'][_0x8d87('0x2b')]);_0x18ba54[_0x8d87('0x2e')]=_[_0x8d87('0x2d')](_0x2b888d[_0x8d87('0x2e')]);_0x18ba54[_0x8d87('0x2f')]=_[_0x8d87('0x31')](_0x18ba54[_0x8d87('0x2c')],_0x18ba54[_0x8d87('0x2e')]);_0xe36afb[_0x8d87('0x30')]=_[_0x8d87('0x31')](_0x18ba54['model'],qs[_0x8d87('0x32')](_0x2b888d[_0x8d87('0x2e')][_0x8d87('0x32')]));_0xe36afb[_0x8d87('0x30')]=_0xe36afb[_0x8d87('0x30')][_0x8d87('0x33')]?_0xe36afb[_0x8d87('0x30')]:_0x18ba54[_0x8d87('0x2c')];if(_0x2b888d[_0x8d87('0x2e')][_0x8d87('0x43')]){_0xe36afb[_0x8d87('0x44')]=[{'all':!![]}];}_0xe36afb=_['merge']({},_0xe36afb,_0x2b888d[_0x8d87('0x45')]);return db['ChatOfflineMessage'][_0x8d87('0x46')](_0xe36afb)[_0x8d87('0x21')](handleEntityNotFound(_0x10d4a3,null))[_0x8d87('0x21')](respondWithResult(_0x10d4a3,null))['catch'](handleError(_0x10d4a3,null));};exports[_0x8d87('0x47')]=function(_0x43dee4,_0x493bc6){return db[_0x8d87('0x2a')][_0x8d87('0x47')](_0x43dee4['body'],{})[_0x8d87('0x21')](respondWithResult(_0x493bc6,0xc9))[_0x8d87('0x48')](handleError(_0x493bc6,null));};exports[_0x8d87('0x20')]=function(_0x28a297,_0x2a89c0){if(_0x28a297[_0x8d87('0x49')]['id']){delete _0x28a297[_0x8d87('0x49')]['id'];}return db[_0x8d87('0x2a')][_0x8d87('0x46')]({'where':{'id':_0x28a297['params']['id']}})[_0x8d87('0x21')](handleEntityNotFound(_0x2a89c0,null))[_0x8d87('0x21')](saveUpdates(_0x28a297['body'],null))[_0x8d87('0x21')](respondWithResult(_0x2a89c0,null))[_0x8d87('0x48')](handleError(_0x2a89c0,null));};exports[_0x8d87('0x22')]=function(_0x2e9526,_0xffbfcb){return db['ChatOfflineMessage'][_0x8d87('0x46')]({'where':{'id':_0x2e9526[_0x8d87('0x42')]['id']}})[_0x8d87('0x21')](handleEntityNotFound(_0xffbfcb,null))['then'](removeEntity(_0xffbfcb,null))[_0x8d87('0x48')](handleError(_0xffbfcb,null));};exports[_0x8d87('0x4a')]=function(_0x591269,_0x1316fc){return db[_0x8d87('0x2a')]['describe']()['then'](respondWithResult(_0x1316fc,null))[_0x8d87('0x48')](handleError(_0x1316fc,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index ace2ed6..b818311 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 _0xc829=['bluebird','request-promise','path','exports','define','ChatOfflineMessage','utf8mb4','lodash','util','../../config/logger','api','moment'];(function(_0x83f4cc,_0x24b294){var _0x158a6d=function(_0x13227d){while(--_0x13227d){_0x83f4cc['push'](_0x83f4cc['shift']());}};_0x158a6d(++_0x24b294);}(_0xc829,0x14b));var _0x9c82=function(_0x573783,_0x330220){_0x573783=_0x573783-0x0;var _0x480970=_0xc829[_0x573783];return _0x480970;};'use strict';var _=require(_0x9c82('0x0'));var util=require(_0x9c82('0x1'));var logger=require(_0x9c82('0x2'))(_0x9c82('0x3'));var moment=require(_0x9c82('0x4'));var BPromise=require(_0x9c82('0x5'));var rp=require(_0x9c82('0x6'));var fs=require('fs');var path=require(_0x9c82('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatOfflineMessage.attributes');module[_0x9c82('0x8')]=function(_0xb2699f,_0x241101){return _0xb2699f[_0x9c82('0x9')](_0x9c82('0xa'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9c82('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xfad2=['../../config/environment','./chatOfflineMessage.attributes','exports','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xfad2,0x13e));var _0x2fad=function(_0x51f792,_0x2d54c3){_0x51f792=_0x51f792-0x0;var _0x151be3=_0xfad2[_0x51f792];return _0x151be3;};'use strict';var _=require('lodash');var util=require(_0x2fad('0x0'));var logger=require(_0x2fad('0x1'))(_0x2fad('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2fad('0x3'));var fs=require('fs');var path=require(_0x2fad('0x4'));var rimraf=require(_0x2fad('0x5'));var config=require(_0x2fad('0x6'));var attributes=require(_0x2fad('0x7'));module[_0x2fad('0x8')]=function(_0x134c47,_0x5abd5d){return _0x134c47['define'](_0x2fad('0x9'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2fad('0xa'),'collate':_0x2fad('0xb')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 1b150ad..b6eb804 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 _0xf82c=['ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatOfflineMessage,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','debug'];(function(_0x4a6caf,_0x3cac2d){var _0x16c3bd=function(_0x19c0c9){while(--_0x19c0c9){_0x4a6caf['push'](_0x4a6caf['shift']());}};_0x16c3bd(++_0x3cac2d);}(_0xf82c,0x92));var _0xcf82=function(_0x568f61,_0xfcb9da){_0x568f61=_0x568f61-0x0;var _0x17ab1=_0xf82c[_0x568f61];return _0x17ab1;};'use strict';var _=require(_0xcf82('0x0'));var util=require(_0xcf82('0x1'));var moment=require(_0xcf82('0x2'));var BPromise=require(_0xcf82('0x3'));var rs=require(_0xcf82('0x4'));var fs=require('fs');var Redis=require(_0xcf82('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xcf82('0x6'));var logger=require(_0xcf82('0x7'))(_0xcf82('0x8'));var config=require(_0xcf82('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcf82('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1234ab,_0x35b7c6,_0x5dacd2){return new BPromise(function(_0x1d7974,_0x5ebf24){return client[_0xcf82('0xb')](_0x1234ab,_0x5dacd2)[_0xcf82('0xc')](function(_0x20bc15){logger[_0xcf82('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x35b7c6,'request\x20sent');logger[_0xcf82('0xe')](_0xcf82('0xf'),_0x35b7c6,'request\x20sent',JSON[_0xcf82('0x10')](_0x20bc15));if(_0x20bc15[_0xcf82('0x11')]){if(_0x20bc15['error']['code']===0x1f4){logger[_0xcf82('0x11')](_0xcf82('0x12'),_0x35b7c6,_0x20bc15[_0xcf82('0x11')][_0xcf82('0x13')]);return _0x5ebf24(_0x20bc15[_0xcf82('0x11')][_0xcf82('0x13')]);}logger[_0xcf82('0x11')](_0xcf82('0x12'),_0x35b7c6,_0x20bc15[_0xcf82('0x11')][_0xcf82('0x13')]);return _0x1d7974(_0x20bc15['error']['message']);}else{logger[_0xcf82('0xd')](_0xcf82('0x12'),_0x35b7c6,_0xcf82('0x14'));_0x1d7974(_0x20bc15[_0xcf82('0x15')][_0xcf82('0x13')]);}})[_0xcf82('0x16')](function(_0x302da4){logger[_0xcf82('0x11')](_0xcf82('0x12'),_0x35b7c6,_0x302da4);_0x5ebf24(_0x302da4);});});} \ No newline at end of file +var _0xeaee=['code','ChatOfflineMessage,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x19d24c,_0x62bc50){var _0x2fae8d=function(_0x419856){while(--_0x419856){_0x19d24c['push'](_0x19d24c['shift']());}};_0x2fae8d(++_0x62bc50);}(_0xeaee,0x14a));var _0xeeae=function(_0x1095af,_0x119e05){_0x1095af=_0x1095af-0x0;var _0x2baf68=_0xeaee[_0x1095af];return _0x2baf68;};'use strict';var _=require(_0xeeae('0x0'));var util=require(_0xeeae('0x1'));var moment=require(_0xeeae('0x2'));var BPromise=require('bluebird');var rs=require(_0xeeae('0x3'));var fs=require('fs');var Redis=require(_0xeeae('0x4'));var db=require(_0xeeae('0x5'))['db'];var utils=require(_0xeeae('0x6'));var logger=require(_0xeeae('0x7'))('rpc');var config=require(_0xeeae('0x8'));var jayson=require(_0xeeae('0x9'));var client=jayson[_0xeeae('0xa')][_0xeeae('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5daf7b,_0x36274d,_0x141ede){return new BPromise(function(_0x2149f6,_0x5a17a9){return client[_0xeeae('0xc')](_0x5daf7b,_0x141ede)[_0xeeae('0xd')](function(_0x3f030b){logger[_0xeeae('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x36274d,_0xeeae('0xf'));logger[_0xeeae('0x10')](_0xeeae('0x11'),_0x36274d,'request\x20sent',JSON[_0xeeae('0x12')](_0x3f030b));if(_0x3f030b[_0xeeae('0x13')]){if(_0x3f030b['error'][_0xeeae('0x14')]===0x1f4){logger[_0xeeae('0x13')](_0xeeae('0x15'),_0x36274d,_0x3f030b[_0xeeae('0x13')]['message']);return _0x5a17a9(_0x3f030b[_0xeeae('0x13')][_0xeeae('0x16')]);}logger[_0xeeae('0x13')](_0xeeae('0x15'),_0x36274d,_0x3f030b[_0xeeae('0x13')][_0xeeae('0x16')]);return _0x2149f6(_0x3f030b[_0xeeae('0x13')][_0xeeae('0x16')]);}else{logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x36274d,'request\x20sent');_0x2149f6(_0x3f030b[_0xeeae('0x17')][_0xeeae('0x16')]);}})[_0xeeae('0x18')](function(_0x590162){logger[_0xeeae('0x13')](_0xeeae('0x15'),_0x36274d,_0x590162);_0x5a17a9(_0x590162);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 44df260..39f0cbb 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 _0x98e1=['util','path','connect-timeout','express','../../components/auth/service','./chatOfflineMessage.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','exports'];(function(_0x34ba7c,_0x4f7409){var _0x23314e=function(_0x5e11b0){while(--_0x5e11b0){_0x34ba7c['push'](_0x34ba7c['shift']());}};_0x23314e(++_0x4f7409);}(_0x98e1,0x160));var _0x198e=function(_0x386b95,_0x18287c){_0x386b95=_0x386b95-0x0;var _0x26a36e=_0x98e1[_0x386b95];return _0x26a36e;};'use strict';var multer=require('multer');var util=require(_0x198e('0x0'));var path=require(_0x198e('0x1'));var timeout=require(_0x198e('0x2'));var express=require(_0x198e('0x3'));var router=express['Router']();var auth=require(_0x198e('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x198e('0x5'));router[_0x198e('0x6')]('/',auth[_0x198e('0x7')](),controller[_0x198e('0x8')]);router['get']('/describe',auth[_0x198e('0x7')](),controller['describe']);router[_0x198e('0x6')]('/:id',auth[_0x198e('0x7')](),controller[_0x198e('0x9')]);router[_0x198e('0xa')]('/',auth[_0x198e('0x7')](),controller[_0x198e('0xb')]);router[_0x198e('0xc')](_0x198e('0xd'),auth[_0x198e('0x7')](),controller[_0x198e('0xe')]);router['delete'](_0x198e('0xd'),auth[_0x198e('0x7')](),controller['destroy']);module[_0x198e('0xf')]=router; \ No newline at end of file +var _0x34e5=['../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','/:id','put','update','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x342e12,_0x47555e){var _0x586986=function(_0x1b6f40){while(--_0x1b6f40){_0x342e12['push'](_0x342e12['shift']());}};_0x586986(++_0x47555e);}(_0x34e5,0x172));var _0x534e=function(_0x27a406,_0x49ec0f){_0x27a406=_0x27a406-0x0;var _0x465e3d=_0x34e5[_0x27a406];return _0x465e3d;};'use strict';var multer=require('multer');var util=require(_0x534e('0x0'));var path=require('path');var timeout=require(_0x534e('0x1'));var express=require(_0x534e('0x2'));var router=express[_0x534e('0x3')]();var auth=require(_0x534e('0x4'));var interaction=require(_0x534e('0x5'));var config=require('../../config/environment');var controller=require(_0x534e('0x6'));router[_0x534e('0x7')]('/',auth[_0x534e('0x8')](),controller[_0x534e('0x9')]);router[_0x534e('0x7')](_0x534e('0xa'),auth[_0x534e('0x8')](),controller['describe']);router[_0x534e('0x7')](_0x534e('0xb'),auth[_0x534e('0x8')](),controller['show']);router['post']('/',auth[_0x534e('0x8')](),controller['create']);router[_0x534e('0xc')]('/:id',auth[_0x534e('0x8')](),controller[_0x534e('0xd')]);router[_0x534e('0xe')]('/:id',auth[_0x534e('0x8')](),controller[_0x534e('0xf')]);module[_0x534e('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 203ea36..d82e22a 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 _0x64f8=['mouseOver','INTEGER','sequelize','exports','ENUM','timeout'];(function(_0x120284,_0x32cf34){var _0x2de394=function(_0x5280ae){while(--_0x5280ae){_0x120284['push'](_0x120284['shift']());}};_0x2de394(++_0x32cf34);}(_0x64f8,0x140));var _0x864f=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x64f8[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x864f('0x0'));module[_0x864f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x864f('0x2')]('mouseOver',_0x864f('0x3')),'defaultValue':_0x864f('0x4')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x864f('0x5')]}}; \ No newline at end of file +var _0xf459=['timeout','mouseOver','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf459,0x16a));var _0x9f45=function(_0x57add2,_0x4f2b7d){_0x57add2=_0x57add2-0x0;var _0x4e3670=_0xf459[_0x57add2];return _0x4e3670;};'use strict';var Sequelize=require(_0x9f45('0x0'));module[_0x9f45('0x1')]={'name':{'type':Sequelize[_0x9f45('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver',_0x9f45('0x3')),'defaultValue':_0x9f45('0x4')},'selector':{'type':Sequelize[_0x9f45('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 013122b..75b3723 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 _0xfb6d=['ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','set','apply','reject','save','then','destroy','error','stack','name','send','params','model','ChatProactiveAction','rawAttributes','query','keys','filters','intersection','attributes','fields','length','includeAll','include','options','find','catch','create','body','update','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv'];(function(_0x67f65f,_0x541c1a){var _0x124a3e=function(_0x4f4e5e){while(--_0x4f4e5e){_0x67f65f['push'](_0x67f65f['shift']());}};_0x124a3e(++_0x541c1a);}(_0xfb6d,0x64));var _0xdfb6=function(_0x3ad728,_0x330fbf){_0x3ad728=_0x3ad728-0x0;var _0x342229=_0xfb6d[_0x3ad728];return _0x342229;};'use strict';var pdf=require(_0xdfb6('0x0'));var emlformat=require(_0xdfb6('0x1'));var rimraf=require(_0xdfb6('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdfb6('0x3'));var rp=require(_0xdfb6('0x4'));var moment=require(_0xdfb6('0x5'));var BPromise=require(_0xdfb6('0x6'));var Mustache=require(_0xdfb6('0x7'));var util=require('util');var path=require(_0xdfb6('0x8'));var sox=require('sox');var csv=require(_0xdfb6('0x9'));var ejs=require(_0xdfb6('0xa'));var fs=require('fs');var _=require(_0xdfb6('0xb'));var squel=require(_0xdfb6('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xdfb6('0xd'));var toCsv=require(_0xdfb6('0x9'));var querystring=require('querystring');var Papa=require(_0xdfb6('0xe'));var Redis=require(_0xdfb6('0xf'));var authService=require(_0xdfb6('0x10'));var qs=require(_0xdfb6('0x11'));var hardwareService=require(_0xdfb6('0x12'));var logger=require('../../config/logger')(_0xdfb6('0x13'));var utils=require('../../config/utils');var config=require(_0xdfb6('0x14'));var db=require(_0xdfb6('0x15'))['db'];function respondWithStatusCode(_0x454508,_0xb4a288){_0xb4a288=_0xb4a288||0xcc;return function(_0x4f4ac7){if(_0x4f4ac7){return _0x454508[_0xdfb6('0x16')](_0xb4a288);}return _0x454508[_0xdfb6('0x17')](_0xb4a288)[_0xdfb6('0x18')]();};}function respondWithResult(_0x34b06a,_0x1a8ee4){_0x1a8ee4=_0x1a8ee4||0xc8;return function(_0x2447cc){if(_0x2447cc){return _0x34b06a[_0xdfb6('0x17')](_0x1a8ee4)['json'](_0x2447cc);}};}function respondWithFilteredResult(_0x376d9f,_0x53710f){return function(_0x379ae8){if(_0x379ae8){var _0x4d8450=_0x379ae8['count'],_0x114ad3=_0x53710f['offset'],_0x59ee29=_0x53710f[_0xdfb6('0x19')]+_0x53710f['limit'],_0x412c03;if(_0x59ee29>=_0x4d8450){_0x59ee29=_0x4d8450;_0x412c03=0xc8;}else{_0x412c03=0xce;}_0x376d9f[_0xdfb6('0x17')](_0x412c03);return _0x376d9f[_0xdfb6('0x1a')]('Content-Range',_0x114ad3+'-'+_0x59ee29+'/'+_0x4d8450)['json'](_0x379ae8);}return null;};}function patchUpdates(_0x5a2f12){return function(_0x49b472){try{jsonpatch[_0xdfb6('0x1b')](_0x49b472,_0x5a2f12,!![]);}catch(_0x229bda){return BPromise[_0xdfb6('0x1c')](_0x229bda);}return _0x49b472[_0xdfb6('0x1d')]();};}function saveUpdates(_0xe2df76,_0x37917e){return function(_0x3d053a){if(_0x3d053a){return _0x3d053a['update'](_0xe2df76)[_0xdfb6('0x1e')](function(_0x139604){return _0x139604;});}return null;};}function removeEntity(_0x466385,_0x58d051){return function(_0x1552cf){if(_0x1552cf){return _0x1552cf[_0xdfb6('0x1f')]()[_0xdfb6('0x1e')](function(){_0x466385[_0xdfb6('0x17')](0xcc)[_0xdfb6('0x18')]();});}};}function handleEntityNotFound(_0x21fef3,_0x187ec7){return function(_0x5369ca){if(!_0x5369ca){_0x21fef3[_0xdfb6('0x16')](0x194);}return _0x5369ca;};}function handleError(_0x5d075d,_0x35bb0e){_0x35bb0e=_0x35bb0e||0x1f4;return function(_0x1381f5){logger[_0xdfb6('0x20')](_0x1381f5[_0xdfb6('0x21')]);if(_0x1381f5[_0xdfb6('0x22')]){delete _0x1381f5[_0xdfb6('0x22')];}_0x5d075d['status'](_0x35bb0e)[_0xdfb6('0x23')](_0x1381f5);};}exports['show']=function(_0x46efb7,_0x581dd3){var _0x572f9f={'raw':!![],'where':{'id':_0x46efb7[_0xdfb6('0x24')]['id']}},_0x4ecef0={};_0x4ecef0[_0xdfb6('0x25')]=_['keys'](db[_0xdfb6('0x26')][_0xdfb6('0x27')]);_0x4ecef0[_0xdfb6('0x28')]=_[_0xdfb6('0x29')](_0x46efb7['query']);_0x4ecef0[_0xdfb6('0x2a')]=_[_0xdfb6('0x2b')](_0x4ecef0[_0xdfb6('0x25')],_0x4ecef0[_0xdfb6('0x28')]);_0x572f9f[_0xdfb6('0x2c')]=_[_0xdfb6('0x2b')](_0x4ecef0[_0xdfb6('0x25')],qs[_0xdfb6('0x2d')](_0x46efb7['query'][_0xdfb6('0x2d')]));_0x572f9f['attributes']=_0x572f9f['attributes'][_0xdfb6('0x2e')]?_0x572f9f[_0xdfb6('0x2c')]:_0x4ecef0[_0xdfb6('0x25')];if(_0x46efb7[_0xdfb6('0x28')][_0xdfb6('0x2f')]){_0x572f9f[_0xdfb6('0x30')]=[{'all':!![]}];}_0x572f9f=_['merge']({},_0x572f9f,_0x46efb7[_0xdfb6('0x31')]);return db[_0xdfb6('0x26')][_0xdfb6('0x32')](_0x572f9f)[_0xdfb6('0x1e')](handleEntityNotFound(_0x581dd3,null))[_0xdfb6('0x1e')](respondWithResult(_0x581dd3,null))[_0xdfb6('0x33')](handleError(_0x581dd3,null));};exports[_0xdfb6('0x34')]=function(_0x5e2f69,_0x2dabd8){return db[_0xdfb6('0x26')][_0xdfb6('0x34')](_0x5e2f69[_0xdfb6('0x35')],{})[_0xdfb6('0x1e')](respondWithResult(_0x2dabd8,0xc9))['catch'](handleError(_0x2dabd8,null));};exports[_0xdfb6('0x36')]=function(_0x187f7e,_0x27cd54){if(_0x187f7e[_0xdfb6('0x35')]['id']){delete _0x187f7e[_0xdfb6('0x35')]['id'];}return db[_0xdfb6('0x26')][_0xdfb6('0x32')]({'where':{'id':_0x187f7e['params']['id']}})[_0xdfb6('0x1e')](handleEntityNotFound(_0x27cd54,null))[_0xdfb6('0x1e')](saveUpdates(_0x187f7e[_0xdfb6('0x35')],null))[_0xdfb6('0x1e')](respondWithResult(_0x27cd54,null))[_0xdfb6('0x33')](handleError(_0x27cd54,null));};exports['destroy']=function(_0x4117c5,_0x89e2d7){return db['ChatProactiveAction'][_0xdfb6('0x32')]({'where':{'id':_0x4117c5[_0xdfb6('0x24')]['id']}})[_0xdfb6('0x1e')](handleEntityNotFound(_0x89e2d7,null))[_0xdfb6('0x1e')](removeEntity(_0x89e2d7,null))[_0xdfb6('0x33')](handleError(_0x89e2d7,null));}; \ No newline at end of file +var _0x8f6c=['fast-json-patch','moment','bluebird','util','path','sox','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','show','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','fields','attributes','includeAll','include','merge','options','find','catch','create','body','html-pdf','rimraf','zip-dir'];(function(_0x2d1f83,_0x4d594e){var _0x5a7728=function(_0x3ac880){while(--_0x3ac880){_0x2d1f83['push'](_0x2d1f83['shift']());}};_0x5a7728(++_0x4d594e);}(_0x8f6c,0x153));var _0xc8f6=function(_0x299892,_0xd1e2fb){_0x299892=_0x299892-0x0;var _0x536bac=_0x8f6c[_0x299892];return _0x536bac;};'use strict';var pdf=require(_0xc8f6('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc8f6('0x1'));var zipdir=require(_0xc8f6('0x2'));var jsonpatch=require(_0xc8f6('0x3'));var rp=require('request-promise');var moment=require(_0xc8f6('0x4'));var BPromise=require(_0xc8f6('0x5'));var Mustache=require('mustache');var util=require(_0xc8f6('0x6'));var path=require(_0xc8f6('0x7'));var sox=require(_0xc8f6('0x8'));var csv=require(_0xc8f6('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xc8f6('0xa'));var jsforce=require(_0xc8f6('0xb'));var deskjs=require(_0xc8f6('0xc'));var toCsv=require('to-csv');var querystring=require(_0xc8f6('0xd'));var Papa=require(_0xc8f6('0xe'));var Redis=require(_0xc8f6('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xc8f6('0x10'));var logger=require(_0xc8f6('0x11'))(_0xc8f6('0x12'));var utils=require(_0xc8f6('0x13'));var config=require(_0xc8f6('0x14'));var db=require(_0xc8f6('0x15'))['db'];function respondWithStatusCode(_0x36b292,_0x1df8fc){_0x1df8fc=_0x1df8fc||0xcc;return function(_0x40b98a){if(_0x40b98a){return _0x36b292[_0xc8f6('0x16')](_0x1df8fc);}return _0x36b292[_0xc8f6('0x17')](_0x1df8fc)[_0xc8f6('0x18')]();};}function respondWithResult(_0x11f807,_0x82105c){_0x82105c=_0x82105c||0xc8;return function(_0x17461f){if(_0x17461f){return _0x11f807[_0xc8f6('0x17')](_0x82105c)['json'](_0x17461f);}};}function respondWithFilteredResult(_0x1928e2,_0x2490c6){return function(_0x901bf9){if(_0x901bf9){var _0x5dc39d=_0x901bf9[_0xc8f6('0x19')],_0x15edd0=_0x2490c6[_0xc8f6('0x1a')],_0x44e851=_0x2490c6[_0xc8f6('0x1a')]+_0x2490c6[_0xc8f6('0x1b')],_0xf153c2;if(_0x44e851>=_0x5dc39d){_0x44e851=_0x5dc39d;_0xf153c2=0xc8;}else{_0xf153c2=0xce;}_0x1928e2[_0xc8f6('0x17')](_0xf153c2);return _0x1928e2[_0xc8f6('0x1c')](_0xc8f6('0x1d'),_0x15edd0+'-'+_0x44e851+'/'+_0x5dc39d)['json'](_0x901bf9);}return null;};}function patchUpdates(_0x57e55f){return function(_0x4dc0e4){try{jsonpatch[_0xc8f6('0x1e')](_0x4dc0e4,_0x57e55f,!![]);}catch(_0x519dc7){return BPromise[_0xc8f6('0x1f')](_0x519dc7);}return _0x4dc0e4[_0xc8f6('0x20')]();};}function saveUpdates(_0x1d3f01,_0x3dd407){return function(_0x598f5f){if(_0x598f5f){return _0x598f5f[_0xc8f6('0x21')](_0x1d3f01)[_0xc8f6('0x22')](function(_0x288ab5){return _0x288ab5;});}return null;};}function removeEntity(_0x5ba98e,_0x42d53a){return function(_0x484172){if(_0x484172){return _0x484172[_0xc8f6('0x23')]()[_0xc8f6('0x22')](function(){_0x5ba98e[_0xc8f6('0x17')](0xcc)[_0xc8f6('0x18')]();});}};}function handleEntityNotFound(_0x268846,_0x4b92de){return function(_0x584a7){if(!_0x584a7){_0x268846[_0xc8f6('0x16')](0x194);}return _0x584a7;};}function handleError(_0x397df6,_0x500748){_0x500748=_0x500748||0x1f4;return function(_0x445046){logger[_0xc8f6('0x24')](_0x445046['stack']);if(_0x445046[_0xc8f6('0x25')]){delete _0x445046[_0xc8f6('0x25')];}_0x397df6[_0xc8f6('0x17')](_0x500748)[_0xc8f6('0x26')](_0x445046);};}exports[_0xc8f6('0x27')]=function(_0x2b652c,_0x5e4ef8){var _0x1cac1b={'raw':!![],'where':{'id':_0x2b652c['params']['id']}},_0x363c12={};_0x363c12[_0xc8f6('0x28')]=_[_0xc8f6('0x29')](db[_0xc8f6('0x2a')][_0xc8f6('0x2b')]);_0x363c12[_0xc8f6('0x2c')]=_['keys'](_0x2b652c['query']);_0x363c12[_0xc8f6('0x2d')]=_[_0xc8f6('0x2e')](_0x363c12[_0xc8f6('0x28')],_0x363c12['query']);_0x1cac1b['attributes']=_[_0xc8f6('0x2e')](_0x363c12[_0xc8f6('0x28')],qs[_0xc8f6('0x2f')](_0x2b652c[_0xc8f6('0x2c')][_0xc8f6('0x2f')]));_0x1cac1b[_0xc8f6('0x30')]=_0x1cac1b[_0xc8f6('0x30')]['length']?_0x1cac1b[_0xc8f6('0x30')]:_0x363c12[_0xc8f6('0x28')];if(_0x2b652c[_0xc8f6('0x2c')][_0xc8f6('0x31')]){_0x1cac1b[_0xc8f6('0x32')]=[{'all':!![]}];}_0x1cac1b=_[_0xc8f6('0x33')]({},_0x1cac1b,_0x2b652c[_0xc8f6('0x34')]);return db[_0xc8f6('0x2a')][_0xc8f6('0x35')](_0x1cac1b)['then'](handleEntityNotFound(_0x5e4ef8,null))[_0xc8f6('0x22')](respondWithResult(_0x5e4ef8,null))[_0xc8f6('0x36')](handleError(_0x5e4ef8,null));};exports[_0xc8f6('0x37')]=function(_0x233527,_0x420afd){return db[_0xc8f6('0x2a')][_0xc8f6('0x37')](_0x233527[_0xc8f6('0x38')],{})[_0xc8f6('0x22')](respondWithResult(_0x420afd,0xc9))['catch'](handleError(_0x420afd,null));};exports[_0xc8f6('0x21')]=function(_0x3b679c,_0x196ac3){if(_0x3b679c[_0xc8f6('0x38')]['id']){delete _0x3b679c[_0xc8f6('0x38')]['id'];}return db['ChatProactiveAction'][_0xc8f6('0x35')]({'where':{'id':_0x3b679c['params']['id']}})[_0xc8f6('0x22')](handleEntityNotFound(_0x196ac3,null))[_0xc8f6('0x22')](saveUpdates(_0x3b679c[_0xc8f6('0x38')],null))[_0xc8f6('0x22')](respondWithResult(_0x196ac3,null))[_0xc8f6('0x36')](handleError(_0x196ac3,null));};exports[_0xc8f6('0x23')]=function(_0x5a3e7b,_0x37b7dd){return db[_0xc8f6('0x2a')][_0xc8f6('0x35')]({'where':{'id':_0x5a3e7b['params']['id']}})[_0xc8f6('0x22')](handleEntityNotFound(_0x37b7dd,null))[_0xc8f6('0x22')](removeEntity(_0x37b7dd,null))[_0xc8f6('0x36')](handleError(_0x37b7dd,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 1347924..5171a68 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 _0x949f=['exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','api','bluebird','request-promise','rimraf','../../config/environment','./chatProactiveAction.attributes'];(function(_0x385419,_0x5bd71d){var _0x121250=function(_0x166c93){while(--_0x166c93){_0x385419['push'](_0x385419['shift']());}};_0x121250(++_0x5bd71d);}(_0x949f,0xac));var _0xf949=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x949f[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xf949('0x0'));var util=require(_0xf949('0x1'));var logger=require('../../config/logger')(_0xf949('0x2'));var moment=require('moment');var BPromise=require(_0xf949('0x3'));var rp=require(_0xf949('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf949('0x5'));var config=require(_0xf949('0x6'));var attributes=require(_0xf949('0x7'));module[_0xf949('0x8')]=function(_0x334f31,_0x46dc51){return _0x334f31[_0xf949('0x9')](_0xf949('0xa'),attributes,{'tableName':_0xf949('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x099b=['define','ChatProactiveAction','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./chatProactiveAction.attributes','exports'];(function(_0x10e98b,_0x518344){var _0x3eb2f1=function(_0x25b053){while(--_0x25b053){_0x10e98b['push'](_0x10e98b['shift']());}};_0x3eb2f1(++_0x518344);}(_0x099b,0xfe));var _0xb099=function(_0x1bd9c2,_0x23b4fe){_0x1bd9c2=_0x1bd9c2-0x0;var _0x5802bd=_0x099b[_0x1bd9c2];return _0x5802bd;};'use strict';var _=require(_0xb099('0x0'));var util=require(_0xb099('0x1'));var logger=require(_0xb099('0x2'))(_0xb099('0x3'));var moment=require(_0xb099('0x4'));var BPromise=require('bluebird');var rp=require(_0xb099('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb099('0x6'));var config=require(_0xb099('0x7'));var attributes=require(_0xb099('0x8'));module[_0xb099('0x9')]=function(_0x5a1039,_0x367888){return _0x5a1039[_0xb099('0xa')](_0xb099('0xb'),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 43f1b60..1c513c6 100644 --- a/server/api/chatProactiveAction/chatProactiveAction.rpc.js +++ b/server/api/chatProactiveAction/chatProactiveAction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x55657a,_0x3fc195){var _0xbb4728=function(_0x34a014){while(--_0x34a014){_0x55657a['push'](_0x55657a['shift']());}};_0xbb4728(++_0x3fc195);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5e16a0,_0x3517c7){var _0xdb25fa=function(_0x4b689b){while(--_0x4b689b){_0x5e16a0['push'](_0x5e16a0['shift']());}};_0xdb25fa(++_0x3517c7);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'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 5c710bd..31717cb 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 _0x753c=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0x225737,_0x28110b){var _0x4c5156=function(_0x106c0f){while(--_0x106c0f){_0x225737['push'](_0x225737['shift']());}};_0x4c5156(++_0x28110b);}(_0x753c,0x96));var _0xc753=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x753c[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require('multer');var util=require(_0xc753('0x0'));var path=require('path');var timeout=require(_0xc753('0x1'));var express=require(_0xc753('0x2'));var router=express[_0xc753('0x3')]();var auth=require(_0xc753('0x4'));var interaction=require(_0xc753('0x5'));var config=require(_0xc753('0x6'));var controller=require(_0xc753('0x7'));router[_0xc753('0x8')](_0xc753('0x9'),auth[_0xc753('0xa')](),controller[_0xc753('0xb')]);router[_0xc753('0xc')]('/',auth[_0xc753('0xa')](),controller[_0xc753('0xd')]);router[_0xc753('0xe')](_0xc753('0x9'),auth[_0xc753('0xa')](),controller[_0xc753('0xf')]);router[_0xc753('0x10')](_0xc753('0x9'),auth[_0xc753('0xa')](),controller[_0xc753('0x11')]);module[_0xc753('0x12')]=router; \ No newline at end of file +var _0x8603=['get','isAuthenticated','show','post','create','update','delete','destroy','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4005d2,_0x5db0ef){var _0x55e64e=function(_0x2f8f3c){while(--_0x2f8f3c){_0x4005d2['push'](_0x4005d2['shift']());}};_0x55e64e(++_0x5db0ef);}(_0x8603,0x190));var _0x3860=function(_0x4074d5,_0xa57194){_0x4074d5=_0x4074d5-0x0;var _0x502cfe=_0x8603[_0x4074d5];return _0x502cfe;};'use strict';var multer=require('multer');var util=require(_0x3860('0x0'));var path=require(_0x3860('0x1'));var timeout=require(_0x3860('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x3860('0x3'));var interaction=require(_0x3860('0x4'));var config=require(_0x3860('0x5'));var controller=require('./chatProactiveAction.controller');router[_0x3860('0x6')]('/:id',auth[_0x3860('0x7')](),controller[_0x3860('0x8')]);router[_0x3860('0x9')]('/',auth[_0x3860('0x7')](),controller[_0x3860('0xa')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x3860('0xb')]);router[_0x3860('0xc')]('/:id',auth[_0x3860('0x7')](),controller[_0x3860('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 86205c4..b6590be 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 _0x2307=['beepall','roundrobin','sequelize','exports','name','STRING','INTEGER','ENUM','rrmemory'];(function(_0x33e4a7,_0x2e80a2){var _0x598620=function(_0x65d618){while(--_0x65d618){_0x33e4a7['push'](_0x33e4a7['shift']());}};_0x598620(++_0x2e80a2);}(_0x2307,0x80));var _0x7230=function(_0x19a4a5,_0x405e18){_0x19a4a5=_0x19a4a5-0x0;var _0x1196b3=_0x2307[_0x19a4a5];return _0x1196b3;};'use strict';var Sequelize=require(_0x7230('0x0'));module[_0x7230('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x7230('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7230('0x3')]},'timeout':{'type':Sequelize[_0x7230('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7230('0x5')](_0x7230('0x6'),_0x7230('0x7'),_0x7230('0x8'))}}; \ No newline at end of file +var _0x131a=['INTEGER','ENUM','rrmemory','roundrobin','sequelize','exports','STRING','name'];(function(_0x162780,_0x47f2e2){var _0x1ea2dc=function(_0x123898){while(--_0x123898){_0x162780['push'](_0x162780['shift']());}};_0x1ea2dc(++_0x47f2e2);}(_0x131a,0x1e4));var _0xa131=function(_0x1da7cf,_0x551c61){_0x1da7cf=_0x1da7cf-0x0;var _0x4a18bf=_0x131a[_0x1da7cf];return _0x4a18bf;};'use strict';var Sequelize=require(_0xa131('0x0'));module[_0xa131('0x1')]={'name':{'type':Sequelize[_0xa131('0x2')],'unique':_0xa131('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xa131('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa131('0x5')](_0xa131('0x6'),'beepall',_0xa131('0x7'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index a9f8d46..7082cc3 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 _0x881d=['register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','save','update','destroy','get','UserProfileResource','stack','name','index','ChatQueue','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','includeAll','include','rows','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','pick','ChatQueueId','findAll','User','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','Team','addTeams','teams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','userChatQueue:save','ids','select','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','SELECT','TeamId','includes','all','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket'];(function(_0x66ef29,_0x2fe794){var _0x10e9c5=function(_0x2d648a){while(--_0x2d648a){_0x66ef29['push'](_0x66ef29['shift']());}};_0x10e9c5(++_0x2fe794);}(_0x881d,0x1ad));var _0xd881=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0x881d[_0x2576d7];return _0x16a08c;};'use strict';var pdf=require(_0xd881('0x0'));var emlformat=require(_0xd881('0x1'));var rimraf=require(_0xd881('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd881('0x3'));var rp=require(_0xd881('0x4'));var moment=require(_0xd881('0x5'));var BPromise=require(_0xd881('0x6'));var Mustache=require('mustache');var util=require(_0xd881('0x7'));var path=require('path');var sox=require(_0xd881('0x8'));var csv=require(_0xd881('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd881('0xa'));var squel=require(_0xd881('0xb'));var crypto=require(_0xd881('0xc'));var jsforce=require(_0xd881('0xd'));var deskjs=require(_0xd881('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd881('0xf'));var Papa=require('papaparse');var Redis=require(_0xd881('0x10'));var authService=require(_0xd881('0x11'));var qs=require(_0xd881('0x12'));var hardwareService=require(_0xd881('0x13'));var logger=require('../../config/logger')(_0xd881('0x14'));var utils=require('../../config/utils');var config=require(_0xd881('0x15'));var db=require(_0xd881('0x16'))['db'];config[_0xd881('0x17')]=_['defaults'](config['redis'],{'host':_0xd881('0x18'),'port':0x18eb});var socket=require(_0xd881('0x19'))(new Redis(config[_0xd881('0x17')]));require(_0xd881('0x1a'))[_0xd881('0x1b')](socket);var jayson=require(_0xd881('0x1c'));var client=jayson[_0xd881('0x1d')][_0xd881('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x57a8d1,_0x5c0595,_0x4e95c6){if(_0x4e95c6){var _0x1a54a9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1a54a9[_0xd881('0x1f')](_0x5c0595)){return _0x57a8d1;}else{throw new Error(_0xd881('0x20'));}}else{return _0x57a8d1;}}function respondWithRpcPromise(_0x10b28b,_0x5a048d,_0xd905d6,_0x3cca7b){return new BPromise(function(_0xfde7be,_0x441af2){var _0x5a9891=_0x3cca7b||client;return _0x5a9891[_0xd881('0x21')](_0x10b28b,_0xd905d6)[_0xd881('0x22')](function(_0x4a56d5){logger[_0xd881('0x23')]('ChatQueue,\x20%s,\x20%s',_0x5a048d,_0xd881('0x24'));logger['debug'](_0xd881('0x25'),_0x5a048d,_0xd881('0x24'),JSON[_0xd881('0x26')](_0x4a56d5));if(_0x4a56d5[_0xd881('0x27')]){if(_0x4a56d5[_0xd881('0x27')][_0xd881('0x28')]===0x1f4){logger[_0xd881('0x27')](_0xd881('0x29'),_0x5a048d,_0x4a56d5[_0xd881('0x27')][_0xd881('0x2a')]);return _0x441af2(_0x4a56d5[_0xd881('0x27')][_0xd881('0x2a')]);}logger[_0xd881('0x27')]('ChatQueue,\x20%s,\x20%s',_0x5a048d,_0x4a56d5[_0xd881('0x27')][_0xd881('0x2a')]);return _0xfde7be(_0x4a56d5['error'][_0xd881('0x2a')]);}else{logger[_0xd881('0x23')]('ChatQueue,\x20%s,\x20%s',_0x5a048d,_0xd881('0x24'));_0xfde7be(_0x4a56d5[_0xd881('0x2b')][_0xd881('0x2a')]);}})[_0xd881('0x2c')](function(_0x5da98f){logger[_0xd881('0x27')](_0xd881('0x29'),_0x5a048d,_0x5da98f);_0x441af2(_0x5da98f);});});}function respondWithStatusCode(_0x3f9447,_0x331bec){_0x331bec=_0x331bec||0xcc;return function(_0x5a00d6){if(_0x5a00d6){return _0x3f9447[_0xd881('0x2d')](_0x331bec);}return _0x3f9447[_0xd881('0x2e')](_0x331bec)[_0xd881('0x2f')]();};}function respondWithResult(_0x5a4e1d,_0x1e4f53){_0x1e4f53=_0x1e4f53||0xc8;return function(_0x208041){if(_0x208041){return _0x5a4e1d[_0xd881('0x2e')](_0x1e4f53)['json'](_0x208041);}};}function respondWithFilteredResult(_0x2cbee4,_0x3e6a15){return function(_0x22bb7d){if(_0x22bb7d){var _0x5e191e=_0x22bb7d[_0xd881('0x30')],_0x50b51b=_0x3e6a15[_0xd881('0x31')],_0x6514ad=_0x3e6a15[_0xd881('0x31')]+_0x3e6a15[_0xd881('0x32')],_0x43b899;if(_0x6514ad>=_0x5e191e){_0x6514ad=_0x5e191e;_0x43b899=0xc8;}else{_0x43b899=0xce;}_0x2cbee4['status'](_0x43b899);return _0x2cbee4[_0xd881('0x33')](_0xd881('0x34'),_0x50b51b+'-'+_0x6514ad+'/'+_0x5e191e)[_0xd881('0x35')](_0x22bb7d);}return null;};}function patchUpdates(_0x510f46){return function(_0x485f7f){try{jsonpatch[_0xd881('0x36')](_0x485f7f,_0x510f46,!![]);}catch(_0x328a4a){return BPromise['reject'](_0x328a4a);}return _0x485f7f[_0xd881('0x37')]();};}function saveUpdates(_0x531ff8,_0x455642){return function(_0x5de8ed){if(_0x5de8ed){return _0x5de8ed[_0xd881('0x38')](_0x531ff8)[_0xd881('0x22')](function(_0x4dcfbb){return _0x4dcfbb;});}return null;};}function removeEntity(_0x299277,_0x18cdb9){return function(_0x4f51af){if(_0x4f51af){return _0x4f51af[_0xd881('0x39')]()[_0xd881('0x22')](function(){var _0x1fe1d3=_0x4f51af[_0xd881('0x3a')]({'plain':!![]});var _0x2f84df='ChatQueues';return db[_0xd881('0x3b')][_0xd881('0x39')]({'where':{'type':_0x2f84df,'resourceId':_0x1fe1d3['id']}})[_0xd881('0x22')](function(){return _0x4f51af;});})['then'](function(){_0x299277['status'](0xcc)[_0xd881('0x2f')]();});}};}function handleEntityNotFound(_0x405ccb,_0x429f55){return function(_0x2c9c09){if(!_0x2c9c09){_0x405ccb[_0xd881('0x2d')](0x194);}return _0x2c9c09;};}function handleError(_0x52f884,_0x2567b2){_0x2567b2=_0x2567b2||0x1f4;return function(_0x1ba774){logger[_0xd881('0x27')](_0x1ba774[_0xd881('0x3c')]);if(_0x1ba774['name']){delete _0x1ba774[_0xd881('0x3d')];}_0x52f884['status'](_0x2567b2)['send'](_0x1ba774);};}exports[_0xd881('0x3e')]=function(_0x3eac07,_0x38b884){var _0x5828c8={},_0xd43e35={},_0x574654={'count':0x0,'rows':[]};var _0xb64897=db[_0xd881('0x3f')][_0xd881('0x40')];_0xd43e35[_0xd881('0x41')]=_['keys'](_0xb64897);_0xd43e35[_0xd881('0x42')]=_[_0xd881('0x43')](_0x3eac07['query']);_0xd43e35[_0xd881('0x44')]=_[_0xd881('0x45')](_0xd43e35[_0xd881('0x41')],_0xd43e35[_0xd881('0x42')]);_0x5828c8[_0xd881('0x46')]=_[_0xd881('0x45')](_0xd43e35['model'],qs[_0xd881('0x47')](_0x3eac07[_0xd881('0x42')][_0xd881('0x47')]));_0x5828c8[_0xd881('0x46')]=_0x5828c8['attributes'][_0xd881('0x48')]?_0x5828c8[_0xd881('0x46')]:_0xd43e35[_0xd881('0x41')];if(!_0x3eac07[_0xd881('0x42')][_0xd881('0x49')](_0xd881('0x4a'))){_0x5828c8[_0xd881('0x32')]=qs[_0xd881('0x32')](_0x3eac07[_0xd881('0x42')]['limit']);_0x5828c8[_0xd881('0x31')]=qs[_0xd881('0x31')](_0x3eac07['query'][_0xd881('0x31')]);}_0x5828c8[_0xd881('0x4b')]=qs[_0xd881('0x4c')](_0x3eac07[_0xd881('0x42')][_0xd881('0x4c')]);_0x5828c8[_0xd881('0x4d')]=qs[_0xd881('0x44')](_['pick'](_0x3eac07[_0xd881('0x42')],_0xd43e35[_0xd881('0x44')]));if(_0x3eac07[_0xd881('0x42')][_0xd881('0x4e')]){_0x5828c8[_0xd881('0x4d')]=_[_0xd881('0x4f')](_0x5828c8['where'],{'$or':_[_0xd881('0x50')](_0xb64897,function(_0x464bad){if(_0x464bad[_0xd881('0x51')][_0xd881('0x52')]!==_0xd881('0x53')){var _0x5511b9={};_0x5511b9[_0x464bad[_0xd881('0x54')]]={'$like':'%'+_0x3eac07[_0xd881('0x42')][_0xd881('0x4e')]+'%'};return _0x5511b9;}})});}_0x5828c8=_[_0xd881('0x4f')]({},_0x5828c8,_0x3eac07['options']);var _0x28f2a8={'where':_0x5828c8['where']};return db[_0xd881('0x3f')]['count'](_0x28f2a8)[_0xd881('0x22')](function(_0x1d0914){_0x574654['count']=_0x1d0914;if(_0x3eac07[_0xd881('0x42')][_0xd881('0x55')]){_0x5828c8[_0xd881('0x56')]=[{'all':!![]}];}return db[_0xd881('0x3f')]['findAll'](_0x5828c8);})['then'](function(_0x5ee169){_0x574654[_0xd881('0x57')]=_0x5ee169;return _0x574654;})[_0xd881('0x22')](respondWithFilteredResult(_0x38b884,_0x5828c8))[_0xd881('0x2c')](handleError(_0x38b884,null));};exports[_0xd881('0x58')]=function(_0x18bf23,_0x2841e2){var _0xe217fe={'raw':!![],'where':{'id':_0x18bf23[_0xd881('0x59')]['id']}},_0x30611c={};_0x30611c['model']=_[_0xd881('0x43')](db[_0xd881('0x3f')][_0xd881('0x40')]);_0x30611c['query']=_[_0xd881('0x43')](_0x18bf23[_0xd881('0x42')]);_0x30611c[_0xd881('0x44')]=_[_0xd881('0x45')](_0x30611c[_0xd881('0x41')],_0x30611c[_0xd881('0x42')]);_0xe217fe[_0xd881('0x46')]=_['intersection'](_0x30611c[_0xd881('0x41')],qs[_0xd881('0x47')](_0x18bf23['query'][_0xd881('0x47')]));_0xe217fe[_0xd881('0x46')]=_0xe217fe[_0xd881('0x46')]['length']?_0xe217fe[_0xd881('0x46')]:_0x30611c[_0xd881('0x41')];if(_0x18bf23['query'][_0xd881('0x55')]){_0xe217fe[_0xd881('0x56')]=[{'all':!![]}];}_0xe217fe=_[_0xd881('0x4f')]({},_0xe217fe,_0x18bf23[_0xd881('0x5a')]);return db[_0xd881('0x3f')][_0xd881('0x5b')](_0xe217fe)[_0xd881('0x22')](handleEntityNotFound(_0x2841e2,null))[_0xd881('0x22')](respondWithResult(_0x2841e2,null))['catch'](handleError(_0x2841e2,null));};exports[_0xd881('0x5c')]=function(_0x4d5be4,_0x42a757){return db[_0xd881('0x3f')]['create'](_0x4d5be4[_0xd881('0x5d')],{})[_0xd881('0x22')](function(_0x2793eb){var _0xceb2a=_0x4d5be4[_0xd881('0x5e')][_0xd881('0x3a')]({'plain':!![]});if(!_0xceb2a)throw new Error(_0xd881('0x5f'));if(_0xceb2a[_0xd881('0x60')]==='user'){var _0x59c2b8=_0x2793eb[_0xd881('0x3a')]({'plain':!![]});var _0x2a576e=_0xd881('0x61');return db[_0xd881('0x62')][_0xd881('0x5b')]({'where':{'name':_0x2a576e,'userProfileId':_0xceb2a[_0xd881('0x63')]},'raw':!![]})['then'](function(_0x44a8d4){if(_0x44a8d4&&_0x44a8d4['autoAssociation']===0x0){return db[_0xd881('0x3b')]['create']({'name':_0x59c2b8[_0xd881('0x3d')],'resourceId':_0x59c2b8['id'],'type':_0x44a8d4['name'],'sectionId':_0x44a8d4['id']},{})[_0xd881('0x22')](function(){return _0x2793eb;});}else{return _0x2793eb;}})['catch'](function(_0x129ee8){logger[_0xd881('0x27')](_0xd881('0x64'),_0x129ee8);throw _0x129ee8;});}return _0x2793eb;})[_0xd881('0x22')](respondWithResult(_0x42a757,0xc9))['catch'](handleError(_0x42a757,null));};exports[_0xd881('0x38')]=function(_0x47662d,_0x30422a){if(_0x47662d[_0xd881('0x5d')]['id']){delete _0x47662d[_0xd881('0x5d')]['id'];}return db[_0xd881('0x3f')]['find']({'where':{'id':_0x47662d[_0xd881('0x59')]['id']}})[_0xd881('0x22')](handleEntityNotFound(_0x30422a,null))[_0xd881('0x22')](saveUpdates(_0x47662d[_0xd881('0x5d')],null))['then'](respondWithResult(_0x30422a,null))[_0xd881('0x2c')](handleError(_0x30422a,null));};exports[_0xd881('0x39')]=function(_0xe9970d,_0x4bc13c){return db[_0xd881('0x3f')][_0xd881('0x5b')]({'where':{'id':_0xe9970d['params']['id']}})[_0xd881('0x22')](handleEntityNotFound(_0x4bc13c,null))[_0xd881('0x22')](removeEntity(_0x4bc13c,null))[_0xd881('0x2c')](handleError(_0x4bc13c,null));};exports[_0xd881('0x65')]=function(_0x3c6ab8,_0x150d48){return db[_0xd881('0x3f')]['describe']()[_0xd881('0x22')](respondWithResult(_0x150d48,null))['catch'](handleError(_0x150d48,null));};exports[_0xd881('0x66')]=function(_0x5d8d88,_0x294d31,_0x4d828e){var _0x90c403={'raw':!![],'where':{}},_0x29ac77={},_0x31146b;return db[_0xd881('0x3f')]['findOne']({'where':{'id':_0x5d8d88[_0xd881('0x59')]['id']}})['then'](handleEntityNotFound(_0x294d31,null))[_0xd881('0x22')](function(_0x506ea0){if(_0x506ea0){_0x31146b=_0x506ea0[_0xd881('0x3a')]({'plain':!![]});_0x29ac77[_0xd881('0x41')]=_[_0xd881('0x43')](db['UserChatQueue'][_0xd881('0x40')]);_0x29ac77[_0xd881('0x42')]=_[_0xd881('0x43')](_0x5d8d88[_0xd881('0x42')]);_0x29ac77[_0xd881('0x44')]=_[_0xd881('0x45')](_0x29ac77[_0xd881('0x41')],_0x29ac77[_0xd881('0x42')]);_0x90c403[_0xd881('0x46')]=_['intersection'](_0x29ac77['model'],qs['fields'](_0x5d8d88['query'][_0xd881('0x47')]));_0x90c403['attributes']=_0x90c403[_0xd881('0x46')][_0xd881('0x48')]?_0x90c403[_0xd881('0x46')]:_0x29ac77[_0xd881('0x41')];if(!_0x5d8d88[_0xd881('0x42')][_0xd881('0x49')](_0xd881('0x4a'))){_0x90c403[_0xd881('0x32')]=qs[_0xd881('0x32')](_0x5d8d88[_0xd881('0x42')][_0xd881('0x32')]);_0x90c403[_0xd881('0x31')]=qs[_0xd881('0x31')](_0x5d8d88[_0xd881('0x42')][_0xd881('0x31')]);}_0x90c403[_0xd881('0x4b')]=qs[_0xd881('0x4c')](_0x5d8d88[_0xd881('0x42')]['sort']);_0x90c403[_0xd881('0x4d')]=qs[_0xd881('0x44')](_[_0xd881('0x67')](_0x5d8d88[_0xd881('0x42')],_0x29ac77[_0xd881('0x44')]));_0x90c403['where'][_0xd881('0x68')]=_0x506ea0['id'];if(_0x5d8d88[_0xd881('0x42')][_0xd881('0x4e')]){_0x90c403[_0xd881('0x4d')]=_[_0xd881('0x4f')](_0x90c403['where'],{'$or':_['map'](_0x90c403['attributes'],function(_0x5e7d60){var _0x919362={};_0x919362[_0x5e7d60]={'$like':'%'+_0x5d8d88['query'][_0xd881('0x4e')]+'%'};return _0x919362;})});}_0x90c403=_[_0xd881('0x4f')]({},_0x90c403,_0x5d8d88[_0xd881('0x5a')]);return db['UserChatQueue'][_0xd881('0x69')](_0x90c403);}})[_0xd881('0x22')](function(_0x431479){if(_0x431479){return db[_0xd881('0x6a')]['findAndCountAll']({'where':{'id':_[_0xd881('0x50')](_0x431479,'UserId'),'role':'agent'},'attributes':['id','name',_0xd881('0x6b'),_0xd881('0x6c'),_0xd881('0x6d')]});}})[_0xd881('0x22')](function(_0x506143){if(_0x506143){return{'count':_0x506143[_0xd881('0x30')],'rows':_[_0xd881('0x50')](_0x506143['rows'],function(_0x127998){return{'membername':_0x127998['name'],'UserId':_0x127998['id'],'queue_name':_0x31146b[_0xd881('0x3d')],'ChatQueueId':_0x31146b['id'],'interface':util[_0xd881('0x6e')](_0xd881('0x6f'),_0xd881('0x70'),_0x127998[_0xd881('0x3d')]),'penalty':0x0,'paused':_0x127998[_0xd881('0x6b')],'createdAt':_0x127998[_0xd881('0x6d')],'updatedAt':_0x127998[_0xd881('0x6c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xd881('0x22')](respondWithFilteredResult(_0x294d31,_0x90c403))[_0xd881('0x2c')](handleError(_0x294d31,null));};exports[_0xd881('0x71')]=function(_0x1143e7,_0x3e8fba,_0x131b91){var _0x336c97={};var _0x363842={};var _0x4a715e;var _0x4524bd;return db['ChatQueue'][_0xd881('0x72')]({'where':{'id':_0x1143e7[_0xd881('0x59')]['id']}})['then'](handleEntityNotFound(_0x3e8fba,null))[_0xd881('0x22')](function(_0x55b004){if(_0x55b004){_0x4a715e=_0x55b004;_0x363842[_0xd881('0x41')]=_[_0xd881('0x43')](db[_0xd881('0x73')]['rawAttributes']);_0x363842['query']=_['keys'](_0x1143e7[_0xd881('0x42')]);_0x363842['filters']=_[_0xd881('0x45')](_0x363842[_0xd881('0x41')],_0x363842[_0xd881('0x42')]);_0x336c97[_0xd881('0x46')]=_[_0xd881('0x45')](_0x363842[_0xd881('0x41')],qs[_0xd881('0x47')](_0x1143e7['query'][_0xd881('0x47')]));_0x336c97[_0xd881('0x46')]=_0x336c97[_0xd881('0x46')][_0xd881('0x48')]?_0x336c97[_0xd881('0x46')]:_0x363842[_0xd881('0x41')];_0x336c97[_0xd881('0x4b')]=qs[_0xd881('0x4c')](_0x1143e7[_0xd881('0x42')][_0xd881('0x4c')]);_0x336c97[_0xd881('0x4d')]=qs[_0xd881('0x44')](_[_0xd881('0x67')](_0x1143e7[_0xd881('0x42')],_0x363842[_0xd881('0x44')]));if(_0x1143e7[_0xd881('0x42')][_0xd881('0x4e')]){_0x336c97[_0xd881('0x4d')]=_[_0xd881('0x4f')](_0x336c97['where'],{'$or':_['map'](_0x336c97[_0xd881('0x46')],function(_0x3b15e7){var _0x282169={};_0x282169[_0x3b15e7]={'$like':'%'+_0x1143e7['query']['filter']+'%'};return _0x282169;})});}_0x336c97=_['merge']({},_0x336c97,_0x1143e7[_0xd881('0x5a')]);return _0x4a715e[_0xd881('0x71')](_0x336c97);}})[_0xd881('0x22')](function(_0x4f7ed4){if(_0x4f7ed4){_0x4524bd=_0x4f7ed4[_0xd881('0x48')];if(!_0x1143e7['query'][_0xd881('0x49')](_0xd881('0x4a'))){_0x336c97[_0xd881('0x32')]=qs['limit'](_0x1143e7[_0xd881('0x42')]['limit']);_0x336c97['offset']=qs[_0xd881('0x31')](_0x1143e7[_0xd881('0x42')][_0xd881('0x31')]);}return _0x4a715e[_0xd881('0x71')](_0x336c97);}})[_0xd881('0x22')](function(_0x472714){if(_0x472714){return _0x472714?{'count':_0x4524bd,'rows':_0x472714}:null;}})[_0xd881('0x22')](respondWithResult(_0x3e8fba,null))[_0xd881('0x2c')](handleError(_0x3e8fba,null));};exports[_0xd881('0x74')]=function(_0x205a3e,_0x31341a,_0x446a34){var _0x30052f=_0x205a3e[_0xd881('0x5d')][_0xd881('0x75')];return db[_0xd881('0x73')][_0xd881('0x69')]({'where':{'id':_['map'](_0x30052f,'id')},'attributes':['id'],'include':[{'model':db[_0xd881('0x6a')],'as':_0xd881('0x76'),'attributes':['id','name',_0xd881('0x77'),_0xd881('0x78'),_0xd881('0x79')],'raw':!![]}]})['then'](function(_0x42c5e8){if(_0x42c5e8){var _0x4dae90=_[_0xd881('0x7a')](_0x42c5e8,function(_0x568e7c){var _0xfd0908=_0x568e7c[_0xd881('0x3a')]({'plain':!![]});return _0xfd0908['Agents'];});return db[_0xd881('0x3f')][_0xd881('0x5b')]({'where':{'id':_0x205a3e[_0xd881('0x59')]['id']}})[_0xd881('0x22')](function(_0xeb986a){return db[_0xd881('0x7b')][_0xd881('0x7c')](function(_0x4eb49f){return _0xeb986a[_0xd881('0x74')](_[_0xd881('0x50')](_0x30052f,'id'),{'transaction':_0x4eb49f})[_0xd881('0x22')](function(){return BPromise[_0xd881('0x7d')](_0x4dae90,function(_0x55f791){return db['UserChatQueue']['findOrCreate']({'where':{'UserId':_0x55f791['id'],'ChatQueueId':_0x205a3e['params']['id']},'transaction':_0x4eb49f});});})[_0xd881('0x22')](function(){_0x4dae90[_0xd881('0x7e')](function(_0x12d12a){socket[_0xd881('0x7f')](_0xd881('0x80'),{'UserId':_0x12d12a['id'],'ChatQueueId':_0xeb986a['id']});});});});});}})[_0xd881('0x22')](respondWithStatusCode(_0x31341a,null))['catch'](handleError(_0x31341a,null));};exports['removeTeams']=function(_0x209b84,_0x37c6b0,_0x3880e3){return db['Team'][_0xd881('0x69')]({'where':{'id':_0x209b84[_0xd881('0x42')][_0xd881('0x81')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xd881('0x22')](handleEntityNotFound(_0x37c6b0,null))['then'](function(_0xe6d84d){var _0x5a93e5=_['map'](_0xe6d84d,'id');var _0x3b8a59=[];var _0x5993c4=[];var _0x1644fa=squel[_0xd881('0x82')]();_0x1644fa[_0xd881('0x54')](_0xd881('0x83'))[_0xd881('0x84')](_0xd881('0x85'),'tq')[_0xd881('0x86')](_0xd881('0x87'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xd881('0x4d')](_0xd881('0x88'),_0x209b84[_0xd881('0x59')]['id']);for(var _0x82473e=0x0;_0x82473e<_0xe6d84d['length'];_0x82473e+=0x1){let _0x6d55da=_0xe6d84d[_0x82473e];for(var _0xfaa4c5=0x0;_0xfaa4c5<_0x6d55da[_0xd881('0x76')]['length'];_0xfaa4c5+=0x1){let _0x1276bb=_0x6d55da[_0xd881('0x76')][_0xfaa4c5];var _0x234ac0=_0x1644fa['clone']();_0x234ac0['where'](_0xd881('0x89'),_0x1276bb['id']);_0x5993c4[_0xd881('0x8a')](db['sequelize']['query'](_0x234ac0[_0xd881('0x8b')](),{'type':db['sequelize']['QueryTypes'][_0xd881('0x8c')]})[_0xd881('0x22')](function(_0x5562f3){if(_0x5562f3['length']===0x1){return _0x1276bb['id'];}else{var _0x246a2d=_['every'](_['map'](_0x5562f3,_0xd881('0x8d')),function(_0x30b6dd){return _[_0xd881('0x8e')](_0x5a93e5,_0x30b6dd);});if(_0x246a2d){return _0x1276bb['id'];}}}));}}return BPromise[_0xd881('0x8f')](_0x5993c4)[_0xd881('0x22')](function(_0x5d9a2d){_0x3b8a59=_(_0x3b8a59)['union'](_0x5d9a2d)['compact']()['value']();return db[_0xd881('0x3f')][_0xd881('0x5b')]({'where':{'id':_0x209b84[_0xd881('0x59')]['id']}})['then'](function(_0x2b74fa){return db['sequelize'][_0xd881('0x7c')](function(_0x3fe7c8){return _0x2b74fa['removeTeams'](_0x209b84['query'][_0xd881('0x81')],{'transaction':_0x3fe7c8})[_0xd881('0x22')](function(){if(!_[_0xd881('0x90')](_0x3b8a59)){return _0x2b74fa[_0xd881('0x91')](_0x3b8a59,{'transaction':_0x3fe7c8});}})[_0xd881('0x22')](function(){_0x3b8a59['forEach'](function(_0x1c2dfa){socket['emit'](_0xd881('0x92'),{'UserId':_0x1c2dfa,'ChatQueueId':_0x2b74fa['id']});});});});});});})[_0xd881('0x22')](respondWithStatusCode(_0x37c6b0,null))[_0xd881('0x2c')](handleError(_0x37c6b0,null));};exports[_0xd881('0x93')]=function(_0x66ad29,_0x18dcba,_0x51a08e){return db['ChatQueue'][_0xd881('0x5b')]({'where':{'id':_0x66ad29['params']['id']}})['then'](handleEntityNotFound(_0x18dcba,null))['then'](function(_0x25617d){if(_0x25617d){return _0x25617d['addAgents'](_0x66ad29['body'][_0xd881('0x81')],_[_0xd881('0x94')](_0x66ad29[_0xd881('0x5d')],[_0xd881('0x81'),'id'])||{})[_0xd881('0x95')](function(_0xf844d4){for(var _0x27d5a7=0x0;_0x27d5a7<_0x66ad29[_0xd881('0x5d')]['ids']['length'];_0x27d5a7+=0x1){socket[_0xd881('0x7f')](_0xd881('0x80'),{'UserId':_0x66ad29['body']['ids'][_0x27d5a7],'ChatQueueId':_0x66ad29[_0xd881('0x59')]['id']});}return _0xf844d4;});}})[_0xd881('0x22')](respondWithResult(_0x18dcba,null))['catch'](handleError(_0x18dcba,null));};exports[_0xd881('0x91')]=function(_0x473810,_0x115cd5,_0x5a7d0c){return db[_0xd881('0x3f')]['find']({'where':{'id':_0x473810[_0xd881('0x59')]['id']}})['then'](handleEntityNotFound(_0x115cd5,null))[_0xd881('0x22')](function(_0x395862){if(_0x395862){return _0x395862[_0xd881('0x91')](_0x473810[_0xd881('0x42')][_0xd881('0x81')])[_0xd881('0x22')](function(){if(_[_0xd881('0x96')](_0x473810['query'][_0xd881('0x81')])){for(var _0x46d1e1=0x0;_0x46d1e1<_0x473810['query'][_0xd881('0x81')][_0xd881('0x48')];_0x46d1e1+=0x1){socket['emit'](_0xd881('0x92'),{'UserId':Number(_0x473810[_0xd881('0x42')][_0xd881('0x81')][_0x46d1e1]),'ChatQueueId':Number(_0x473810['params']['id'])});}}else{socket['emit'](_0xd881('0x92'),{'UserId':Number(_0x473810[_0xd881('0x42')][_0xd881('0x81')]),'ChatQueueId':Number(_0x473810[_0xd881('0x59')]['id'])});}});}})[_0xd881('0x22')](respondWithStatusCode(_0x115cd5,null))['catch'](handleError(_0x115cd5,null));};exports[_0xd881('0x97')]=function(_0x49e975,_0x5778f3,_0x1f97c5){var _0x5a4d00={};var _0x2a94e0={};var _0x215b9d;var _0x62d37c;return db['ChatQueue'][_0xd881('0x72')]({'where':{'id':_0x49e975[_0xd881('0x59')]['id']}})[_0xd881('0x22')](handleEntityNotFound(_0x5778f3,null))['then'](function(_0x279040){if(_0x279040){_0x215b9d=_0x279040;_0x2a94e0[_0xd881('0x41')]=_[_0xd881('0x43')](db['User']['rawAttributes']);_0x2a94e0[_0xd881('0x42')]=_[_0xd881('0x43')](_0x49e975[_0xd881('0x42')]);_0x2a94e0[_0xd881('0x44')]=_[_0xd881('0x45')](_0x2a94e0[_0xd881('0x41')],_0x2a94e0['query']);_0x5a4d00[_0xd881('0x46')]=_[_0xd881('0x45')](_0x2a94e0['model'],qs['fields'](_0x49e975[_0xd881('0x42')][_0xd881('0x47')]));_0x5a4d00[_0xd881('0x46')]=_0x5a4d00[_0xd881('0x46')][_0xd881('0x48')]?_0x5a4d00[_0xd881('0x46')]:_0x2a94e0['model'];_0x5a4d00[_0xd881('0x4b')]=qs[_0xd881('0x4c')](_0x49e975['query'][_0xd881('0x4c')]);_0x5a4d00[_0xd881('0x4d')]=qs[_0xd881('0x44')](_[_0xd881('0x67')](_0x49e975[_0xd881('0x42')],_0x2a94e0['filters']));if(_0x49e975[_0xd881('0x42')][_0xd881('0x4e')]){_0x5a4d00[_0xd881('0x4d')]=_[_0xd881('0x4f')](_0x5a4d00['where'],{'$or':_[_0xd881('0x50')](_0x5a4d00[_0xd881('0x46')],function(_0x3227bf){var _0x4e3847={};_0x4e3847[_0x3227bf]={'$like':'%'+_0x49e975['query']['filter']+'%'};return _0x4e3847;})});}_0x5a4d00=_[_0xd881('0x4f')]({},_0x5a4d00,_0x49e975[_0xd881('0x5a')]);return _0x215b9d[_0xd881('0x97')](_0x5a4d00);}})[_0xd881('0x22')](function(_0x4379f1){if(_0x4379f1){_0x62d37c=_0x4379f1[_0xd881('0x48')];if(!_0x49e975[_0xd881('0x42')][_0xd881('0x49')](_0xd881('0x4a'))){_0x5a4d00['limit']=qs[_0xd881('0x32')](_0x49e975['query']['limit']);_0x5a4d00[_0xd881('0x31')]=qs['offset'](_0x49e975[_0xd881('0x42')][_0xd881('0x31')]);}return _0x215b9d[_0xd881('0x97')](_0x5a4d00);}})[_0xd881('0x22')](function(_0x29e3f2){if(_0x29e3f2){return _0x29e3f2?{'count':_0x62d37c,'rows':_0x29e3f2}:null;}})[_0xd881('0x22')](respondWithResult(_0x5778f3,null))[_0xd881('0x2c')](handleError(_0x5778f3,null));}; \ No newline at end of file +var _0x7bca=['teams','User','Agents','online','interface','sequelize','transaction','each','findOrCreate','emit','userChatQueue:save','removeTeams','ids','select','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','QueryTypes','SELECT','TeamId','all','union','value','isEmpty','removeAgents','addAgents','omit','isArray','userChatQueue:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatQueue,\x20%s,\x20%s','result','catch','status','end','json','count','offset','Content-Range','save','destroy','then','get','ChatQueues','UserProfileResource','sendStatus','stack','name','send','index','ChatQueue','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','map','type','key','VIRTUAL','field','filter','merge','options','includeAll','include','rows','params','rawAttributes','length','find','create','body','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserChatQueue','ChatQueueId','findAll','findAndCountAll','updatedAt','createdAt','%s/%s','SIP','chatPause','getTeams','Team','pick','addTeams'];(function(_0x5e55e2,_0x3d0833){var _0x5b4c65=function(_0x4a3fe6){while(--_0x4a3fe6){_0x5e55e2['push'](_0x5e55e2['shift']());}};_0x5b4c65(++_0x3d0833);}(_0x7bca,0x14b));var _0xa7bc=function(_0x5c9e08,_0x14a8e6){_0x5c9e08=_0x5c9e08-0x0;var _0x502e01=_0x7bca[_0x5c9e08];return _0x502e01;};'use strict';var pdf=require(_0xa7bc('0x0'));var emlformat=require(_0xa7bc('0x1'));var rimraf=require(_0xa7bc('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa7bc('0x3'));var rp=require('request-promise');var moment=require(_0xa7bc('0x4'));var BPromise=require(_0xa7bc('0x5'));var Mustache=require(_0xa7bc('0x6'));var util=require(_0xa7bc('0x7'));var path=require(_0xa7bc('0x8'));var sox=require(_0xa7bc('0x9'));var csv=require(_0xa7bc('0xa'));var ejs=require(_0xa7bc('0xb'));var fs=require('fs');var _=require(_0xa7bc('0xc'));var squel=require(_0xa7bc('0xd'));var crypto=require(_0xa7bc('0xe'));var jsforce=require(_0xa7bc('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xa7bc('0xa'));var querystring=require(_0xa7bc('0x10'));var Papa=require(_0xa7bc('0x11'));var Redis=require(_0xa7bc('0x12'));var authService=require(_0xa7bc('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa7bc('0x14'))(_0xa7bc('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xa7bc('0x16'))['db'];config[_0xa7bc('0x17')]=_[_0xa7bc('0x18')](config[_0xa7bc('0x17')],{'host':_0xa7bc('0x19'),'port':0x18eb});var socket=require(_0xa7bc('0x1a'))(new Redis(config[_0xa7bc('0x17')]));require(_0xa7bc('0x1b'))[_0xa7bc('0x1c')](socket);var jayson=require(_0xa7bc('0x1d'));var client=jayson[_0xa7bc('0x1e')]['http']({'port':0x232a});function checkPasswordPattern(_0x172b25,_0x4be9df,_0x1f0667){if(_0x1f0667){var _0x5d32ff=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5d32ff['test'](_0x4be9df)){return _0x172b25;}else{throw new Error(_0xa7bc('0x1f'));}}else{return _0x172b25;}}function respondWithRpcPromise(_0x34992f,_0x386ca5,_0x1349c8,_0x433257){return new BPromise(function(_0x2a326b,_0x4d17b1){var _0x1d80c2=_0x433257||client;return _0x1d80c2[_0xa7bc('0x20')](_0x34992f,_0x1349c8)['then'](function(_0xe7ff0b){logger[_0xa7bc('0x21')]('ChatQueue,\x20%s,\x20%s',_0x386ca5,_0xa7bc('0x22'));logger[_0xa7bc('0x23')](_0xa7bc('0x24'),_0x386ca5,_0xa7bc('0x22'),JSON[_0xa7bc('0x25')](_0xe7ff0b));if(_0xe7ff0b[_0xa7bc('0x26')]){if(_0xe7ff0b[_0xa7bc('0x26')][_0xa7bc('0x27')]===0x1f4){logger[_0xa7bc('0x26')]('ChatQueue,\x20%s,\x20%s',_0x386ca5,_0xe7ff0b[_0xa7bc('0x26')][_0xa7bc('0x28')]);return _0x4d17b1(_0xe7ff0b['error']['message']);}logger[_0xa7bc('0x26')](_0xa7bc('0x29'),_0x386ca5,_0xe7ff0b[_0xa7bc('0x26')]['message']);return _0x2a326b(_0xe7ff0b['error']['message']);}else{logger[_0xa7bc('0x21')](_0xa7bc('0x29'),_0x386ca5,_0xa7bc('0x22'));_0x2a326b(_0xe7ff0b[_0xa7bc('0x2a')][_0xa7bc('0x28')]);}})[_0xa7bc('0x2b')](function(_0x56f11c){logger[_0xa7bc('0x26')](_0xa7bc('0x29'),_0x386ca5,_0x56f11c);_0x4d17b1(_0x56f11c);});});}function respondWithStatusCode(_0x5239a5,_0xc7daa1){_0xc7daa1=_0xc7daa1||0xcc;return function(_0x16b6ab){if(_0x16b6ab){return _0x5239a5['sendStatus'](_0xc7daa1);}return _0x5239a5[_0xa7bc('0x2c')](_0xc7daa1)[_0xa7bc('0x2d')]();};}function respondWithResult(_0xdde00d,_0x19856a){_0x19856a=_0x19856a||0xc8;return function(_0x5928f6){if(_0x5928f6){return _0xdde00d[_0xa7bc('0x2c')](_0x19856a)[_0xa7bc('0x2e')](_0x5928f6);}};}function respondWithFilteredResult(_0x2319af,_0x22821f){return function(_0x4fc204){if(_0x4fc204){var _0x1780be=_0x4fc204[_0xa7bc('0x2f')],_0x2765bf=_0x22821f['offset'],_0x257595=_0x22821f[_0xa7bc('0x30')]+_0x22821f['limit'],_0x26068c;if(_0x257595>=_0x1780be){_0x257595=_0x1780be;_0x26068c=0xc8;}else{_0x26068c=0xce;}_0x2319af['status'](_0x26068c);return _0x2319af['set'](_0xa7bc('0x31'),_0x2765bf+'-'+_0x257595+'/'+_0x1780be)[_0xa7bc('0x2e')](_0x4fc204);}return null;};}function patchUpdates(_0xe9ae57){return function(_0x41aca3){try{jsonpatch['apply'](_0x41aca3,_0xe9ae57,!![]);}catch(_0x27c5a1){return BPromise['reject'](_0x27c5a1);}return _0x41aca3[_0xa7bc('0x32')]();};}function saveUpdates(_0x59fd30,_0x33b284){return function(_0x444ccb){if(_0x444ccb){return _0x444ccb['update'](_0x59fd30)['then'](function(_0x41a7ac){return _0x41a7ac;});}return null;};}function removeEntity(_0x3e6e1f,_0x170484){return function(_0x1f8cae){if(_0x1f8cae){return _0x1f8cae[_0xa7bc('0x33')]()[_0xa7bc('0x34')](function(){var _0x3b00a7=_0x1f8cae[_0xa7bc('0x35')]({'plain':!![]});var _0xb4d78=_0xa7bc('0x36');return db[_0xa7bc('0x37')][_0xa7bc('0x33')]({'where':{'type':_0xb4d78,'resourceId':_0x3b00a7['id']}})['then'](function(){return _0x1f8cae;});})[_0xa7bc('0x34')](function(){_0x3e6e1f[_0xa7bc('0x2c')](0xcc)[_0xa7bc('0x2d')]();});}};}function handleEntityNotFound(_0x457064,_0x7f4684){return function(_0x2ffb28){if(!_0x2ffb28){_0x457064[_0xa7bc('0x38')](0x194);}return _0x2ffb28;};}function handleError(_0x52c61f,_0x137c89){_0x137c89=_0x137c89||0x1f4;return function(_0xa46902){logger[_0xa7bc('0x26')](_0xa46902[_0xa7bc('0x39')]);if(_0xa46902[_0xa7bc('0x3a')]){delete _0xa46902[_0xa7bc('0x3a')];}_0x52c61f[_0xa7bc('0x2c')](_0x137c89)[_0xa7bc('0x3b')](_0xa46902);};}exports[_0xa7bc('0x3c')]=function(_0x46f656,_0x275d03){var _0x19b522={},_0x362bb8={},_0x23f152={'count':0x0,'rows':[]};var _0x34d847=db[_0xa7bc('0x3d')]['rawAttributes'];_0x362bb8['model']=_[_0xa7bc('0x3e')](_0x34d847);_0x362bb8[_0xa7bc('0x3f')]=_[_0xa7bc('0x3e')](_0x46f656['query']);_0x362bb8[_0xa7bc('0x40')]=_[_0xa7bc('0x41')](_0x362bb8[_0xa7bc('0x42')],_0x362bb8['query']);_0x19b522[_0xa7bc('0x43')]=_['intersection'](_0x362bb8[_0xa7bc('0x42')],qs[_0xa7bc('0x44')](_0x46f656[_0xa7bc('0x3f')][_0xa7bc('0x44')]));_0x19b522['attributes']=_0x19b522[_0xa7bc('0x43')]['length']?_0x19b522['attributes']:_0x362bb8[_0xa7bc('0x42')];if(!_0x46f656[_0xa7bc('0x3f')][_0xa7bc('0x45')](_0xa7bc('0x46'))){_0x19b522['limit']=qs[_0xa7bc('0x47')](_0x46f656[_0xa7bc('0x3f')][_0xa7bc('0x47')]);_0x19b522[_0xa7bc('0x30')]=qs[_0xa7bc('0x30')](_0x46f656[_0xa7bc('0x3f')][_0xa7bc('0x30')]);}_0x19b522[_0xa7bc('0x48')]=qs['sort'](_0x46f656['query'][_0xa7bc('0x49')]);_0x19b522['where']=qs[_0xa7bc('0x40')](_['pick'](_0x46f656['query'],_0x362bb8['filters']));if(_0x46f656[_0xa7bc('0x3f')]['filter']){_0x19b522[_0xa7bc('0x4a')]=_['merge'](_0x19b522[_0xa7bc('0x4a')],{'$or':_[_0xa7bc('0x4b')](_0x34d847,function(_0x4d43b2){if(_0x4d43b2[_0xa7bc('0x4c')][_0xa7bc('0x4d')]!==_0xa7bc('0x4e')){var _0x48cb8d={};_0x48cb8d[_0x4d43b2[_0xa7bc('0x4f')]]={'$like':'%'+_0x46f656[_0xa7bc('0x3f')][_0xa7bc('0x50')]+'%'};return _0x48cb8d;}})});}_0x19b522=_[_0xa7bc('0x51')]({},_0x19b522,_0x46f656[_0xa7bc('0x52')]);var _0x3c21c1={'where':_0x19b522['where']};return db[_0xa7bc('0x3d')][_0xa7bc('0x2f')](_0x3c21c1)[_0xa7bc('0x34')](function(_0x17c227){_0x23f152[_0xa7bc('0x2f')]=_0x17c227;if(_0x46f656[_0xa7bc('0x3f')][_0xa7bc('0x53')]){_0x19b522[_0xa7bc('0x54')]=[{'all':!![]}];}return db[_0xa7bc('0x3d')]['findAll'](_0x19b522);})[_0xa7bc('0x34')](function(_0x244521){_0x23f152[_0xa7bc('0x55')]=_0x244521;return _0x23f152;})['then'](respondWithFilteredResult(_0x275d03,_0x19b522))[_0xa7bc('0x2b')](handleError(_0x275d03,null));};exports['show']=function(_0x3b8328,_0x26db56){var _0x5543f6={'raw':!![],'where':{'id':_0x3b8328[_0xa7bc('0x56')]['id']}},_0x31f8de={};_0x31f8de[_0xa7bc('0x42')]=_[_0xa7bc('0x3e')](db['ChatQueue'][_0xa7bc('0x57')]);_0x31f8de[_0xa7bc('0x3f')]=_[_0xa7bc('0x3e')](_0x3b8328[_0xa7bc('0x3f')]);_0x31f8de[_0xa7bc('0x40')]=_[_0xa7bc('0x41')](_0x31f8de[_0xa7bc('0x42')],_0x31f8de[_0xa7bc('0x3f')]);_0x5543f6[_0xa7bc('0x43')]=_['intersection'](_0x31f8de[_0xa7bc('0x42')],qs['fields'](_0x3b8328[_0xa7bc('0x3f')][_0xa7bc('0x44')]));_0x5543f6['attributes']=_0x5543f6['attributes'][_0xa7bc('0x58')]?_0x5543f6['attributes']:_0x31f8de['model'];if(_0x3b8328[_0xa7bc('0x3f')][_0xa7bc('0x53')]){_0x5543f6[_0xa7bc('0x54')]=[{'all':!![]}];}_0x5543f6=_['merge']({},_0x5543f6,_0x3b8328[_0xa7bc('0x52')]);return db['ChatQueue'][_0xa7bc('0x59')](_0x5543f6)[_0xa7bc('0x34')](handleEntityNotFound(_0x26db56,null))[_0xa7bc('0x34')](respondWithResult(_0x26db56,null))[_0xa7bc('0x2b')](handleError(_0x26db56,null));};exports['create']=function(_0x2ed5e9,_0x5bde69){return db[_0xa7bc('0x3d')][_0xa7bc('0x5a')](_0x2ed5e9[_0xa7bc('0x5b')],{})[_0xa7bc('0x34')](function(_0x32413e){var _0x267d55=_0x2ed5e9['user']['get']({'plain':!![]});if(!_0x267d55)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x267d55[_0xa7bc('0x5c')]==='user'){var _0x1a9b6e=_0x32413e['get']({'plain':!![]});var _0x1f597=_0xa7bc('0x36');return db['UserProfileSection'][_0xa7bc('0x59')]({'where':{'name':_0x1f597,'userProfileId':_0x267d55[_0xa7bc('0x5d')]},'raw':!![]})[_0xa7bc('0x34')](function(_0x515e31){if(_0x515e31&&_0x515e31[_0xa7bc('0x5e')]===0x0){return db['UserProfileResource'][_0xa7bc('0x5a')]({'name':_0x1a9b6e[_0xa7bc('0x3a')],'resourceId':_0x1a9b6e['id'],'type':_0x515e31[_0xa7bc('0x3a')],'sectionId':_0x515e31['id']},{})[_0xa7bc('0x34')](function(){return _0x32413e;});}else{return _0x32413e;}})['catch'](function(_0x4bcae0){logger[_0xa7bc('0x26')](_0xa7bc('0x5f'),_0x4bcae0);throw _0x4bcae0;});}return _0x32413e;})[_0xa7bc('0x34')](respondWithResult(_0x5bde69,0xc9))[_0xa7bc('0x2b')](handleError(_0x5bde69,null));};exports[_0xa7bc('0x60')]=function(_0x510c8d,_0x4f47e2){if(_0x510c8d['body']['id']){delete _0x510c8d[_0xa7bc('0x5b')]['id'];}return db[_0xa7bc('0x3d')]['find']({'where':{'id':_0x510c8d[_0xa7bc('0x56')]['id']}})[_0xa7bc('0x34')](handleEntityNotFound(_0x4f47e2,null))[_0xa7bc('0x34')](saveUpdates(_0x510c8d[_0xa7bc('0x5b')],null))[_0xa7bc('0x34')](respondWithResult(_0x4f47e2,null))[_0xa7bc('0x2b')](handleError(_0x4f47e2,null));};exports[_0xa7bc('0x33')]=function(_0xe33e46,_0x26dc3d){return db[_0xa7bc('0x3d')]['find']({'where':{'id':_0xe33e46[_0xa7bc('0x56')]['id']}})[_0xa7bc('0x34')](handleEntityNotFound(_0x26dc3d,null))[_0xa7bc('0x34')](removeEntity(_0x26dc3d,null))[_0xa7bc('0x2b')](handleError(_0x26dc3d,null));};exports[_0xa7bc('0x61')]=function(_0x33921f,_0x30fcc1){return db[_0xa7bc('0x3d')][_0xa7bc('0x61')]()[_0xa7bc('0x34')](respondWithResult(_0x30fcc1,null))['catch'](handleError(_0x30fcc1,null));};exports[_0xa7bc('0x62')]=function(_0x2aecbc,_0xc0424a,_0x57f0ff){var _0x10f0ef={'raw':!![],'where':{}},_0x4d3fcf={},_0x1ead68;return db['ChatQueue'][_0xa7bc('0x63')]({'where':{'id':_0x2aecbc[_0xa7bc('0x56')]['id']}})[_0xa7bc('0x34')](handleEntityNotFound(_0xc0424a,null))[_0xa7bc('0x34')](function(_0x2c8f7a){if(_0x2c8f7a){_0x1ead68=_0x2c8f7a[_0xa7bc('0x35')]({'plain':!![]});_0x4d3fcf[_0xa7bc('0x42')]=_[_0xa7bc('0x3e')](db[_0xa7bc('0x64')][_0xa7bc('0x57')]);_0x4d3fcf[_0xa7bc('0x3f')]=_[_0xa7bc('0x3e')](_0x2aecbc[_0xa7bc('0x3f')]);_0x4d3fcf[_0xa7bc('0x40')]=_[_0xa7bc('0x41')](_0x4d3fcf[_0xa7bc('0x42')],_0x4d3fcf[_0xa7bc('0x3f')]);_0x10f0ef[_0xa7bc('0x43')]=_[_0xa7bc('0x41')](_0x4d3fcf[_0xa7bc('0x42')],qs['fields'](_0x2aecbc[_0xa7bc('0x3f')]['fields']));_0x10f0ef[_0xa7bc('0x43')]=_0x10f0ef[_0xa7bc('0x43')]['length']?_0x10f0ef['attributes']:_0x4d3fcf[_0xa7bc('0x42')];if(!_0x2aecbc['query']['hasOwnProperty'](_0xa7bc('0x46'))){_0x10f0ef[_0xa7bc('0x47')]=qs['limit'](_0x2aecbc[_0xa7bc('0x3f')][_0xa7bc('0x47')]);_0x10f0ef[_0xa7bc('0x30')]=qs['offset'](_0x2aecbc['query'][_0xa7bc('0x30')]);}_0x10f0ef[_0xa7bc('0x48')]=qs['sort'](_0x2aecbc[_0xa7bc('0x3f')][_0xa7bc('0x49')]);_0x10f0ef[_0xa7bc('0x4a')]=qs['filters'](_['pick'](_0x2aecbc[_0xa7bc('0x3f')],_0x4d3fcf['filters']));_0x10f0ef[_0xa7bc('0x4a')][_0xa7bc('0x65')]=_0x2c8f7a['id'];if(_0x2aecbc[_0xa7bc('0x3f')][_0xa7bc('0x50')]){_0x10f0ef[_0xa7bc('0x4a')]=_[_0xa7bc('0x51')](_0x10f0ef[_0xa7bc('0x4a')],{'$or':_[_0xa7bc('0x4b')](_0x10f0ef[_0xa7bc('0x43')],function(_0xbf1367){var _0x43f32e={};_0x43f32e[_0xbf1367]={'$like':'%'+_0x2aecbc['query'][_0xa7bc('0x50')]+'%'};return _0x43f32e;})});}_0x10f0ef=_[_0xa7bc('0x51')]({},_0x10f0ef,_0x2aecbc[_0xa7bc('0x52')]);return db[_0xa7bc('0x64')][_0xa7bc('0x66')](_0x10f0ef);}})[_0xa7bc('0x34')](function(_0x4d7acb){if(_0x4d7acb){return db['User'][_0xa7bc('0x67')]({'where':{'id':_[_0xa7bc('0x4b')](_0x4d7acb,'UserId'),'role':'agent'},'attributes':['id','name','chatPause',_0xa7bc('0x68'),_0xa7bc('0x69')]});}})[_0xa7bc('0x34')](function(_0x5b4f75){if(_0x5b4f75){return{'count':_0x5b4f75[_0xa7bc('0x2f')],'rows':_[_0xa7bc('0x4b')](_0x5b4f75[_0xa7bc('0x55')],function(_0x2e50cb){return{'membername':_0x2e50cb[_0xa7bc('0x3a')],'UserId':_0x2e50cb['id'],'queue_name':_0x1ead68['name'],'ChatQueueId':_0x1ead68['id'],'interface':util['format'](_0xa7bc('0x6a'),_0xa7bc('0x6b'),_0x2e50cb[_0xa7bc('0x3a')]),'penalty':0x0,'paused':_0x2e50cb[_0xa7bc('0x6c')],'createdAt':_0x2e50cb[_0xa7bc('0x69')],'updatedAt':_0x2e50cb[_0xa7bc('0x68')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa7bc('0x34')](respondWithFilteredResult(_0xc0424a,_0x10f0ef))[_0xa7bc('0x2b')](handleError(_0xc0424a,null));};exports[_0xa7bc('0x6d')]=function(_0x343633,_0x31cfc0,_0x315994){var _0xe4c8f5={};var _0x55b3f0={};var _0xd0ffef;var _0x58f068;return db['ChatQueue']['findOne']({'where':{'id':_0x343633[_0xa7bc('0x56')]['id']}})[_0xa7bc('0x34')](handleEntityNotFound(_0x31cfc0,null))['then'](function(_0x1b2be9){if(_0x1b2be9){_0xd0ffef=_0x1b2be9;_0x55b3f0['model']=_[_0xa7bc('0x3e')](db[_0xa7bc('0x6e')][_0xa7bc('0x57')]);_0x55b3f0[_0xa7bc('0x3f')]=_[_0xa7bc('0x3e')](_0x343633[_0xa7bc('0x3f')]);_0x55b3f0[_0xa7bc('0x40')]=_[_0xa7bc('0x41')](_0x55b3f0[_0xa7bc('0x42')],_0x55b3f0[_0xa7bc('0x3f')]);_0xe4c8f5[_0xa7bc('0x43')]=_['intersection'](_0x55b3f0['model'],qs['fields'](_0x343633['query']['fields']));_0xe4c8f5[_0xa7bc('0x43')]=_0xe4c8f5[_0xa7bc('0x43')][_0xa7bc('0x58')]?_0xe4c8f5['attributes']:_0x55b3f0[_0xa7bc('0x42')];_0xe4c8f5[_0xa7bc('0x48')]=qs[_0xa7bc('0x49')](_0x343633['query'][_0xa7bc('0x49')]);_0xe4c8f5[_0xa7bc('0x4a')]=qs[_0xa7bc('0x40')](_[_0xa7bc('0x6f')](_0x343633[_0xa7bc('0x3f')],_0x55b3f0[_0xa7bc('0x40')]));if(_0x343633[_0xa7bc('0x3f')][_0xa7bc('0x50')]){_0xe4c8f5[_0xa7bc('0x4a')]=_['merge'](_0xe4c8f5[_0xa7bc('0x4a')],{'$or':_[_0xa7bc('0x4b')](_0xe4c8f5[_0xa7bc('0x43')],function(_0x98b88b){var _0x1c518e={};_0x1c518e[_0x98b88b]={'$like':'%'+_0x343633[_0xa7bc('0x3f')]['filter']+'%'};return _0x1c518e;})});}_0xe4c8f5=_['merge']({},_0xe4c8f5,_0x343633[_0xa7bc('0x52')]);return _0xd0ffef[_0xa7bc('0x6d')](_0xe4c8f5);}})[_0xa7bc('0x34')](function(_0x1a4f2c){if(_0x1a4f2c){_0x58f068=_0x1a4f2c[_0xa7bc('0x58')];if(!_0x343633[_0xa7bc('0x3f')][_0xa7bc('0x45')](_0xa7bc('0x46'))){_0xe4c8f5[_0xa7bc('0x47')]=qs['limit'](_0x343633['query'][_0xa7bc('0x47')]);_0xe4c8f5['offset']=qs[_0xa7bc('0x30')](_0x343633[_0xa7bc('0x3f')]['offset']);}return _0xd0ffef[_0xa7bc('0x6d')](_0xe4c8f5);}})['then'](function(_0x21ccb3){if(_0x21ccb3){return _0x21ccb3?{'count':_0x58f068,'rows':_0x21ccb3}:null;}})['then'](respondWithResult(_0x31cfc0,null))['catch'](handleError(_0x31cfc0,null));};exports[_0xa7bc('0x70')]=function(_0xa5134e,_0x3b54b6,_0x53482e){var _0x56a2c2=_0xa5134e[_0xa7bc('0x5b')][_0xa7bc('0x71')];return db[_0xa7bc('0x6e')][_0xa7bc('0x66')]({'where':{'id':_[_0xa7bc('0x4b')](_0x56a2c2,'id')},'attributes':['id'],'include':[{'model':db[_0xa7bc('0x72')],'as':_0xa7bc('0x73'),'attributes':['id','name',_0xa7bc('0x74'),'voicePause',_0xa7bc('0x75')],'raw':!![]}]})[_0xa7bc('0x34')](function(_0x355145){if(_0x355145){var _0x39ec35=_['flatMap'](_0x355145,function(_0x225b53){var _0x298b90=_0x225b53[_0xa7bc('0x35')]({'plain':!![]});return _0x298b90[_0xa7bc('0x73')];});return db[_0xa7bc('0x3d')][_0xa7bc('0x59')]({'where':{'id':_0xa5134e[_0xa7bc('0x56')]['id']}})[_0xa7bc('0x34')](function(_0x4ebe88){return db[_0xa7bc('0x76')][_0xa7bc('0x77')](function(_0x23479c){return _0x4ebe88['addTeams'](_['map'](_0x56a2c2,'id'),{'transaction':_0x23479c})['then'](function(){return BPromise[_0xa7bc('0x78')](_0x39ec35,function(_0x5066f4){return db['UserChatQueue'][_0xa7bc('0x79')]({'where':{'UserId':_0x5066f4['id'],'ChatQueueId':_0xa5134e[_0xa7bc('0x56')]['id']},'transaction':_0x23479c});});})[_0xa7bc('0x34')](function(){_0x39ec35['forEach'](function(_0xba7388){socket[_0xa7bc('0x7a')](_0xa7bc('0x7b'),{'UserId':_0xba7388['id'],'ChatQueueId':_0x4ebe88['id']});});});});});}})[_0xa7bc('0x34')](respondWithStatusCode(_0x3b54b6,null))[_0xa7bc('0x2b')](handleError(_0x3b54b6,null));};exports[_0xa7bc('0x7c')]=function(_0x4e56c8,_0x1a586f,_0x1861c8){return db[_0xa7bc('0x6e')][_0xa7bc('0x66')]({'where':{'id':_0x4e56c8['query'][_0xa7bc('0x7d')]},'attributes':['id'],'include':[{'model':db[_0xa7bc('0x72')],'as':_0xa7bc('0x73'),'attributes':['id'],'raw':!![]}]})[_0xa7bc('0x34')](handleEntityNotFound(_0x1a586f,null))['then'](function(_0xb10ded){var _0x1bb567=_[_0xa7bc('0x4b')](_0xb10ded,'id');var _0x197807=[];var _0x42d6fa=[];var _0xf36ddb=squel[_0xa7bc('0x7e')]();_0xf36ddb[_0xa7bc('0x4f')](_0xa7bc('0x7f'))['from'](_0xa7bc('0x80'),'tq')[_0xa7bc('0x81')](_0xa7bc('0x82'),'ut',_0xa7bc('0x83'))[_0xa7bc('0x4a')](_0xa7bc('0x84'),_0x4e56c8['params']['id']);for(var _0x29802c=0x0;_0x29802c<_0xb10ded[_0xa7bc('0x58')];_0x29802c+=0x1){let _0x1339f1=_0xb10ded[_0x29802c];for(var _0x1f20ab=0x0;_0x1f20ab<_0x1339f1[_0xa7bc('0x73')]['length'];_0x1f20ab+=0x1){let _0x2f3c9c=_0x1339f1[_0xa7bc('0x73')][_0x1f20ab];var _0xd31871=_0xf36ddb[_0xa7bc('0x85')]();_0xd31871['where']('ut.UserId\x20=\x20?',_0x2f3c9c['id']);_0x42d6fa[_0xa7bc('0x86')](db[_0xa7bc('0x76')][_0xa7bc('0x3f')](_0xd31871['toString'](),{'type':db[_0xa7bc('0x76')][_0xa7bc('0x87')][_0xa7bc('0x88')]})[_0xa7bc('0x34')](function(_0x1e965f){if(_0x1e965f[_0xa7bc('0x58')]===0x1){return _0x2f3c9c['id'];}else{var _0x40ac44=_['every'](_[_0xa7bc('0x4b')](_0x1e965f,_0xa7bc('0x89')),function(_0x3b889d){return _['includes'](_0x1bb567,_0x3b889d);});if(_0x40ac44){return _0x2f3c9c['id'];}}}));}}return BPromise[_0xa7bc('0x8a')](_0x42d6fa)[_0xa7bc('0x34')](function(_0x1dc21b){_0x197807=_(_0x197807)[_0xa7bc('0x8b')](_0x1dc21b)['compact']()[_0xa7bc('0x8c')]();return db['ChatQueue'][_0xa7bc('0x59')]({'where':{'id':_0x4e56c8[_0xa7bc('0x56')]['id']}})[_0xa7bc('0x34')](function(_0x424626){return db[_0xa7bc('0x76')]['transaction'](function(_0x5e9d4f){return _0x424626[_0xa7bc('0x7c')](_0x4e56c8[_0xa7bc('0x3f')][_0xa7bc('0x7d')],{'transaction':_0x5e9d4f})['then'](function(){if(!_[_0xa7bc('0x8d')](_0x197807)){return _0x424626[_0xa7bc('0x8e')](_0x197807,{'transaction':_0x5e9d4f});}})[_0xa7bc('0x34')](function(){_0x197807['forEach'](function(_0x27ab10){socket['emit']('userChatQueue:remove',{'UserId':_0x27ab10,'ChatQueueId':_0x424626['id']});});});});});});})[_0xa7bc('0x34')](respondWithStatusCode(_0x1a586f,null))['catch'](handleError(_0x1a586f,null));};exports[_0xa7bc('0x8f')]=function(_0xcd7338,_0x315741,_0x4ac9ce){return db[_0xa7bc('0x3d')][_0xa7bc('0x59')]({'where':{'id':_0xcd7338[_0xa7bc('0x56')]['id']}})[_0xa7bc('0x34')](handleEntityNotFound(_0x315741,null))[_0xa7bc('0x34')](function(_0x135924){if(_0x135924){return _0x135924['addAgents'](_0xcd7338[_0xa7bc('0x5b')]['ids'],_[_0xa7bc('0x90')](_0xcd7338['body'],[_0xa7bc('0x7d'),'id'])||{})['spread'](function(_0x3f24c0){for(var _0xcbf04a=0x0;_0xcbf04a<_0xcd7338[_0xa7bc('0x5b')]['ids'][_0xa7bc('0x58')];_0xcbf04a+=0x1){socket['emit']('userChatQueue:save',{'UserId':_0xcd7338[_0xa7bc('0x5b')][_0xa7bc('0x7d')][_0xcbf04a],'ChatQueueId':_0xcd7338[_0xa7bc('0x56')]['id']});}return _0x3f24c0;});}})[_0xa7bc('0x34')](respondWithResult(_0x315741,null))[_0xa7bc('0x2b')](handleError(_0x315741,null));};exports[_0xa7bc('0x8e')]=function(_0x56b73b,_0x391b75,_0x6860a0){return db['ChatQueue'][_0xa7bc('0x59')]({'where':{'id':_0x56b73b['params']['id']}})[_0xa7bc('0x34')](handleEntityNotFound(_0x391b75,null))[_0xa7bc('0x34')](function(_0x3e8542){if(_0x3e8542){return _0x3e8542['removeAgents'](_0x56b73b['query'][_0xa7bc('0x7d')])[_0xa7bc('0x34')](function(){if(_[_0xa7bc('0x91')](_0x56b73b[_0xa7bc('0x3f')][_0xa7bc('0x7d')])){for(var _0x1b4d89=0x0;_0x1b4d89<_0x56b73b[_0xa7bc('0x3f')][_0xa7bc('0x7d')][_0xa7bc('0x58')];_0x1b4d89+=0x1){socket[_0xa7bc('0x7a')]('userChatQueue:remove',{'UserId':Number(_0x56b73b[_0xa7bc('0x3f')][_0xa7bc('0x7d')][_0x1b4d89]),'ChatQueueId':Number(_0x56b73b[_0xa7bc('0x56')]['id'])});}}else{socket[_0xa7bc('0x7a')](_0xa7bc('0x92'),{'UserId':Number(_0x56b73b[_0xa7bc('0x3f')][_0xa7bc('0x7d')]),'ChatQueueId':Number(_0x56b73b[_0xa7bc('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0x391b75,null))[_0xa7bc('0x2b')](handleError(_0x391b75,null));};exports[_0xa7bc('0x93')]=function(_0x3f3424,_0x31038a,_0x23a3d7){var _0x18148c={};var _0x375900={};var _0x17b2f1;var _0x4b7899;return db[_0xa7bc('0x3d')][_0xa7bc('0x63')]({'where':{'id':_0x3f3424['params']['id']}})[_0xa7bc('0x34')](handleEntityNotFound(_0x31038a,null))[_0xa7bc('0x34')](function(_0x26ee98){if(_0x26ee98){_0x17b2f1=_0x26ee98;_0x375900['model']=_['keys'](db[_0xa7bc('0x72')]['rawAttributes']);_0x375900['query']=_[_0xa7bc('0x3e')](_0x3f3424[_0xa7bc('0x3f')]);_0x375900[_0xa7bc('0x40')]=_[_0xa7bc('0x41')](_0x375900[_0xa7bc('0x42')],_0x375900[_0xa7bc('0x3f')]);_0x18148c[_0xa7bc('0x43')]=_[_0xa7bc('0x41')](_0x375900[_0xa7bc('0x42')],qs[_0xa7bc('0x44')](_0x3f3424[_0xa7bc('0x3f')][_0xa7bc('0x44')]));_0x18148c[_0xa7bc('0x43')]=_0x18148c[_0xa7bc('0x43')][_0xa7bc('0x58')]?_0x18148c[_0xa7bc('0x43')]:_0x375900[_0xa7bc('0x42')];_0x18148c[_0xa7bc('0x48')]=qs['sort'](_0x3f3424[_0xa7bc('0x3f')][_0xa7bc('0x49')]);_0x18148c[_0xa7bc('0x4a')]=qs[_0xa7bc('0x40')](_['pick'](_0x3f3424[_0xa7bc('0x3f')],_0x375900[_0xa7bc('0x40')]));if(_0x3f3424[_0xa7bc('0x3f')][_0xa7bc('0x50')]){_0x18148c[_0xa7bc('0x4a')]=_[_0xa7bc('0x51')](_0x18148c[_0xa7bc('0x4a')],{'$or':_[_0xa7bc('0x4b')](_0x18148c[_0xa7bc('0x43')],function(_0x349bd8){var _0x284b83={};_0x284b83[_0x349bd8]={'$like':'%'+_0x3f3424[_0xa7bc('0x3f')]['filter']+'%'};return _0x284b83;})});}_0x18148c=_[_0xa7bc('0x51')]({},_0x18148c,_0x3f3424[_0xa7bc('0x52')]);return _0x17b2f1[_0xa7bc('0x93')](_0x18148c);}})[_0xa7bc('0x34')](function(_0xf92701){if(_0xf92701){_0x4b7899=_0xf92701[_0xa7bc('0x58')];if(!_0x3f3424[_0xa7bc('0x3f')][_0xa7bc('0x45')](_0xa7bc('0x46'))){_0x18148c[_0xa7bc('0x47')]=qs[_0xa7bc('0x47')](_0x3f3424[_0xa7bc('0x3f')][_0xa7bc('0x47')]);_0x18148c[_0xa7bc('0x30')]=qs['offset'](_0x3f3424[_0xa7bc('0x3f')][_0xa7bc('0x30')]);}return _0x17b2f1[_0xa7bc('0x93')](_0x18148c);}})[_0xa7bc('0x34')](function(_0x2b7f36){if(_0x2b7f36){return _0x2b7f36?{'count':_0x4b7899,'rows':_0x2b7f36}:null;}})[_0xa7bc('0x34')](respondWithResult(_0x31038a,null))[_0xa7bc('0x2b')](handleError(_0x31038a,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index b9ac076..113392a 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 _0xcffe=['../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x46a64d,_0x214321){var _0x2adf73=function(_0x405860){while(--_0x405860){_0x46a64d['push'](_0x46a64d['shift']());}};_0x2adf73(++_0x214321);}(_0xcffe,0x1a1));var _0xecff=function(_0x5303b9,_0x5c548){_0x5303b9=_0x5303b9-0x0;var _0x455125=_0xcffe[_0x5303b9];return _0x455125;};'use strict';var EventEmitter=require(_0xecff('0x0'));var ChatQueue=require(_0xecff('0x1'))['db'][_0xecff('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xecff('0x3')](0x0);var events={'afterCreate':_0xecff('0x4'),'afterUpdate':_0xecff('0x5'),'afterDestroy':_0xecff('0x6')};function emitEvent(_0x2045b6){return function(_0x352a15,_0xfffe9b,_0x5410f4){ChatQueueEvents['emit'](_0x2045b6+':'+_0x352a15['id'],_0x352a15);ChatQueueEvents[_0xecff('0x7')](_0x2045b6,_0x352a15);_0x5410f4(null);};}for(var e in events){if(events[_0xecff('0x8')](e)){var event=events[e];ChatQueue[_0xecff('0x9')](e,emitEvent(event));}}module[_0xecff('0xa')]=ChatQueueEvents; \ No newline at end of file +var _0x2f68=['../../mysqldb','ChatQueue','setMaxListeners','save','remove','emit','exports'];(function(_0x2083c9,_0x63dc72){var _0x78a8d3=function(_0x42fc2e){while(--_0x42fc2e){_0x2083c9['push'](_0x2083c9['shift']());}};_0x78a8d3(++_0x63dc72);}(_0x2f68,0x9a));var _0x82f6=function(_0x2718bd,_0x23dff){_0x2718bd=_0x2718bd-0x0;var _0xd680ef=_0x2f68[_0x2718bd];return _0xd680ef;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x82f6('0x0'))['db'][_0x82f6('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x82f6('0x2')](0x0);var events={'afterCreate':_0x82f6('0x3'),'afterUpdate':'update','afterDestroy':_0x82f6('0x4')};function emitEvent(_0x488d61){return function(_0x2a06dc,_0x2ab73d,_0x5dad09){ChatQueueEvents[_0x82f6('0x5')](_0x488d61+':'+_0x2a06dc['id'],_0x2a06dc);ChatQueueEvents[_0x82f6('0x5')](_0x488d61,_0x2a06dc);_0x5dad09(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x82f6('0x6')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index c5d533a..3be37a1 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 _0x9ffd=['ChatQueue','chat_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./chatQueue.attributes','define'];(function(_0x304f80,_0x2f7b5b){var _0x4c0f2d=function(_0x2cca97){while(--_0x2cca97){_0x304f80['push'](_0x304f80['shift']());}};_0x4c0f2d(++_0x2f7b5b);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x207ee7,_0x1d7749){_0x207ee7=_0x207ee7-0x0;var _0x566a53=_0x9ffd[_0x207ee7];return _0x566a53;};'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 _0xa1aa=['moment','bluebird','rimraf','../../config/environment','exports','ChatQueue','util','../../config/logger','api'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0xa1aa,0x19b));var _0xaa1a=function(_0x4bd8b8,_0x11654e){_0x4bd8b8=_0x4bd8b8-0x0;var _0x461dcb=_0xa1aa[_0x4bd8b8];return _0x461dcb;};'use strict';var _=require('lodash');var util=require(_0xaa1a('0x0'));var logger=require(_0xaa1a('0x1'))(_0xaa1a('0x2'));var moment=require(_0xaa1a('0x3'));var BPromise=require(_0xaa1a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xaa1a('0x5'));var config=require(_0xaa1a('0x6'));var attributes=require('./chatQueue.attributes');module[_0xaa1a('0x7')]=function(_0x370a4e,_0x243c15){return _0x370a4e['define'](_0xaa1a('0x8'),attributes,{'tableName':'chat_queues','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 0f7106c..c572572 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 _0x146a=['include','map','model','ShowChatQueue','find','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','request','then','info','request\x20sent','debug','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','ChatQueue','findAll','options','where','attributes','limit'];(function(_0x589aee,_0x140a03){var _0x2f5ed4=function(_0x3d224f){while(--_0x3d224f){_0x589aee['push'](_0x589aee['shift']());}};_0x2f5ed4(++_0x140a03);}(_0x146a,0xd8));var _0xa146=function(_0x68359d,_0x51477f){_0x68359d=_0x68359d-0x0;var _0x15d875=_0x146a[_0x68359d];return _0x15d875;};'use strict';var _=require(_0xa146('0x0'));var util=require(_0xa146('0x1'));var moment=require(_0xa146('0x2'));var BPromise=require(_0xa146('0x3'));var rs=require(_0xa146('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa146('0x5'))['db'];var utils=require(_0xa146('0x6'));var logger=require(_0xa146('0x7'))(_0xa146('0x8'));var config=require(_0xa146('0x9'));var jayson=require(_0xa146('0xa'));var client=jayson[_0xa146('0xb')]['http']({'port':0x232a});config[_0xa146('0xc')]=_[_0xa146('0xd')](config['redis'],{'host':_0xa146('0xe'),'port':0x18eb});var socket=require(_0xa146('0xf'))(new Redis(config[_0xa146('0xc')]));require(_0xa146('0x10'))['register'](socket);function respondWithRpcPromise(_0x26fe2a,_0x14f5d2,_0x49c2a7){return new BPromise(function(_0x2e1905,_0x548365){return client[_0xa146('0x11')](_0x26fe2a,_0x49c2a7)[_0xa146('0x12')](function(_0x17518d){logger[_0xa146('0x13')]('ChatQueue,\x20%s,\x20%s',_0x14f5d2,_0xa146('0x14'));logger[_0xa146('0x15')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x14f5d2,_0xa146('0x14'),JSON[_0xa146('0x16')](_0x17518d));if(_0x17518d[_0xa146('0x17')]){if(_0x17518d['error'][_0xa146('0x18')]===0x1f4){logger[_0xa146('0x17')](_0xa146('0x19'),_0x14f5d2,_0x17518d['error'][_0xa146('0x1a')]);return _0x548365(_0x17518d[_0xa146('0x17')][_0xa146('0x1a')]);}logger[_0xa146('0x17')](_0xa146('0x19'),_0x14f5d2,_0x17518d['error'][_0xa146('0x1a')]);return _0x2e1905(_0x17518d[_0xa146('0x17')][_0xa146('0x1a')]);}else{logger[_0xa146('0x13')](_0xa146('0x19'),_0x14f5d2,_0xa146('0x14'));_0x2e1905(_0x17518d[_0xa146('0x1b')][_0xa146('0x1a')]);}})[_0xa146('0x1c')](function(_0x297211){logger[_0xa146('0x17')](_0xa146('0x19'),_0x14f5d2,_0x297211);_0x548365(_0x297211);});});}exports[_0xa146('0x1d')]=function(_0x156910){var _0x5e59c6=this;return new Promise(function(_0x5eaff9,_0x17bb56){return db[_0xa146('0x1e')][_0xa146('0x1f')]({'raw':_0x156910[_0xa146('0x20')]?_0x156910[_0xa146('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x156910[_0xa146('0x20')]?_0x156910['options'][_0xa146('0x21')]||null:null,'attributes':_0x156910[_0xa146('0x20')]?_0x156910[_0xa146('0x20')][_0xa146('0x22')]||null:null,'limit':_0x156910[_0xa146('0x20')]?_0x156910[_0xa146('0x20')][_0xa146('0x23')]||null:null,'include':_0x156910[_0xa146('0x20')]?_0x156910[_0xa146('0x20')][_0xa146('0x24')]?_[_0xa146('0x25')](_0x156910[_0xa146('0x20')][_0xa146('0x24')],function(_0x4e7008){return{'model':db[_0x4e7008[_0xa146('0x26')]],'as':_0x4e7008['as'],'attributes':_0x4e7008[_0xa146('0x22')],'include':_0x4e7008['include']?_['map'](_0x4e7008[_0xa146('0x24')],function(_0x4e2dde){return{'model':db[_0x4e2dde[_0xa146('0x26')]],'as':_0x4e2dde['as'],'attributes':_0x4e2dde['attributes'],'include':_0x4e2dde[_0xa146('0x24')]?_[_0xa146('0x25')](_0x4e2dde['include'],function(_0x2b3076){return{'model':db[_0x2b3076['model']],'as':_0x2b3076['as'],'attributes':_0x2b3076[_0xa146('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x474db8){logger[_0xa146('0x13')](_0xa146('0x1d'),_0x156910);logger[_0xa146('0x15')](_0xa146('0x1d'),_0x156910,JSON[_0xa146('0x16')](_0x474db8));_0x5eaff9(_0x474db8);})[_0xa146('0x1c')](function(_0x20c4de){logger['error'](_0xa146('0x1d'),_0x20c4de[_0xa146('0x1a')],_0x156910);_0x17bb56(_0x5e59c6[_0xa146('0x17')](0x1f4,_0x20c4de[_0xa146('0x1a')]));});});};exports[_0xa146('0x27')]=function(_0x404354){var _0x273f38=this;return new Promise(function(_0x2a2b7e,_0x3e1ba9){return db[_0xa146('0x1e')][_0xa146('0x28')]({'raw':_0x404354[_0xa146('0x20')]?_0x404354[_0xa146('0x20')][_0xa146('0x29')]===undefined?!![]:![]:!![],'where':_0x404354[_0xa146('0x20')]?_0x404354['options'][_0xa146('0x21')]||null:null,'attributes':_0x404354[_0xa146('0x20')]?_0x404354[_0xa146('0x20')][_0xa146('0x22')]||null:null,'include':_0x404354['options']?_0x404354[_0xa146('0x20')][_0xa146('0x24')]?_['map'](_0x404354['options']['include'],function(_0x48f0c5){return{'model':db[_0x48f0c5[_0xa146('0x26')]],'as':_0x48f0c5['as'],'attributes':_0x48f0c5[_0xa146('0x22')],'include':_0x48f0c5[_0xa146('0x24')]?_[_0xa146('0x25')](_0x48f0c5[_0xa146('0x24')],function(_0x5111e6){return{'model':db[_0x5111e6['model']],'as':_0x5111e6['as'],'attributes':_0x5111e6[_0xa146('0x22')],'include':_0x5111e6[_0xa146('0x24')]?_[_0xa146('0x25')](_0x5111e6[_0xa146('0x24')],function(_0x3ad6da){return{'model':db[_0x3ad6da[_0xa146('0x26')]],'as':_0x3ad6da['as'],'attributes':_0x3ad6da[_0xa146('0x22')]};}):[]};}):[]};}):[]:[]})[_0xa146('0x12')](function(_0x1b9426){logger[_0xa146('0x13')]('ShowChatQueue',_0x404354);logger[_0xa146('0x15')](_0xa146('0x27'),_0x404354,JSON['stringify'](_0x1b9426));_0x2a2b7e(_0x1b9426);})[_0xa146('0x1c')](function(_0x145f69){logger[_0xa146('0x17')](_0xa146('0x27'),_0x145f69[_0xa146('0x1a')],_0x404354);_0x3e1ba9(_0x273f38[_0xa146('0x17')](0x1f4,_0x145f69[_0xa146('0x1a')]));});});}; \ No newline at end of file +var _0x5c15=['defaults','localhost','socket.io-emitter','./chatQueue.socket','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatQueue','findAll','options','attributes','limit','include','map','model','GetChatQueue','find','raw','where','ShowChatQueue','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis'];(function(_0x297af9,_0x277823){var _0xdc294d=function(_0x3007c0){while(--_0x3007c0){_0x297af9['push'](_0x297af9['shift']());}};_0xdc294d(++_0x277823);}(_0x5c15,0xf0));var _0x55c1=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5c15[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x55c1('0x0'));var util=require(_0x55c1('0x1'));var moment=require(_0x55c1('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x55c1('0x3'));var db=require(_0x55c1('0x4'))['db'];var utils=require(_0x55c1('0x5'));var logger=require(_0x55c1('0x6'))(_0x55c1('0x7'));var config=require('../../config/environment');var jayson=require(_0x55c1('0x8'));var client=jayson[_0x55c1('0x9')][_0x55c1('0xa')]({'port':0x232a});config[_0x55c1('0xb')]=_[_0x55c1('0xc')](config[_0x55c1('0xb')],{'host':_0x55c1('0xd'),'port':0x18eb});var socket=require(_0x55c1('0xe'))(new Redis(config[_0x55c1('0xb')]));require(_0x55c1('0xf'))['register'](socket);function respondWithRpcPromise(_0x5f5af0,_0xa55328,_0x5a30b8){return new BPromise(function(_0x5b160d,_0x1c8a5b){return client[_0x55c1('0x10')](_0x5f5af0,_0x5a30b8)[_0x55c1('0x11')](function(_0x4df336){logger[_0x55c1('0x12')](_0x55c1('0x13'),_0xa55328,_0x55c1('0x14'));logger[_0x55c1('0x15')](_0x55c1('0x16'),_0xa55328,'request\x20sent',JSON[_0x55c1('0x17')](_0x4df336));if(_0x4df336[_0x55c1('0x18')]){if(_0x4df336[_0x55c1('0x18')][_0x55c1('0x19')]===0x1f4){logger[_0x55c1('0x18')](_0x55c1('0x13'),_0xa55328,_0x4df336[_0x55c1('0x18')][_0x55c1('0x1a')]);return _0x1c8a5b(_0x4df336[_0x55c1('0x18')][_0x55c1('0x1a')]);}logger[_0x55c1('0x18')](_0x55c1('0x13'),_0xa55328,_0x4df336[_0x55c1('0x18')][_0x55c1('0x1a')]);return _0x5b160d(_0x4df336['error'][_0x55c1('0x1a')]);}else{logger[_0x55c1('0x12')]('ChatQueue,\x20%s,\x20%s',_0xa55328,_0x55c1('0x14'));_0x5b160d(_0x4df336[_0x55c1('0x1b')][_0x55c1('0x1a')]);}})[_0x55c1('0x1c')](function(_0x365834){logger[_0x55c1('0x18')](_0x55c1('0x13'),_0xa55328,_0x365834);_0x1c8a5b(_0x365834);});});}exports['GetChatQueue']=function(_0x28a3f6){var _0x9c0b60=this;return new Promise(function(_0x1d0bb4,_0x2483a9){return db[_0x55c1('0x1d')][_0x55c1('0x1e')]({'raw':_0x28a3f6[_0x55c1('0x1f')]?_0x28a3f6['options']['raw']===undefined?!![]:![]:!![],'where':_0x28a3f6[_0x55c1('0x1f')]?_0x28a3f6['options']['where']||null:null,'attributes':_0x28a3f6[_0x55c1('0x1f')]?_0x28a3f6['options'][_0x55c1('0x20')]||null:null,'limit':_0x28a3f6['options']?_0x28a3f6[_0x55c1('0x1f')][_0x55c1('0x21')]||null:null,'include':_0x28a3f6[_0x55c1('0x1f')]?_0x28a3f6[_0x55c1('0x1f')][_0x55c1('0x22')]?_[_0x55c1('0x23')](_0x28a3f6[_0x55c1('0x1f')][_0x55c1('0x22')],function(_0xe5e4d6){return{'model':db[_0xe5e4d6['model']],'as':_0xe5e4d6['as'],'attributes':_0xe5e4d6['attributes'],'include':_0xe5e4d6[_0x55c1('0x22')]?_[_0x55c1('0x23')](_0xe5e4d6[_0x55c1('0x22')],function(_0x337b77){return{'model':db[_0x337b77[_0x55c1('0x24')]],'as':_0x337b77['as'],'attributes':_0x337b77[_0x55c1('0x20')],'include':_0x337b77[_0x55c1('0x22')]?_[_0x55c1('0x23')](_0x337b77[_0x55c1('0x22')],function(_0x123c9a){return{'model':db[_0x123c9a['model']],'as':_0x123c9a['as'],'attributes':_0x123c9a[_0x55c1('0x20')]};}):[]};}):[]};}):[]:[]})[_0x55c1('0x11')](function(_0x3636c0){logger[_0x55c1('0x12')](_0x55c1('0x25'),_0x28a3f6);logger[_0x55c1('0x15')]('GetChatQueue',_0x28a3f6,JSON['stringify'](_0x3636c0));_0x1d0bb4(_0x3636c0);})[_0x55c1('0x1c')](function(_0x5efac7){logger[_0x55c1('0x18')](_0x55c1('0x25'),_0x5efac7[_0x55c1('0x1a')],_0x28a3f6);_0x2483a9(_0x9c0b60['error'](0x1f4,_0x5efac7['message']));});});};exports['ShowChatQueue']=function(_0x5b478b){var _0x40fab7=this;return new Promise(function(_0x4905fe,_0x45cda2){return db['ChatQueue'][_0x55c1('0x26')]({'raw':_0x5b478b['options']?_0x5b478b[_0x55c1('0x1f')][_0x55c1('0x27')]===undefined?!![]:![]:!![],'where':_0x5b478b[_0x55c1('0x1f')]?_0x5b478b['options'][_0x55c1('0x28')]||null:null,'attributes':_0x5b478b['options']?_0x5b478b[_0x55c1('0x1f')][_0x55c1('0x20')]||null:null,'include':_0x5b478b[_0x55c1('0x1f')]?_0x5b478b[_0x55c1('0x1f')]['include']?_[_0x55c1('0x23')](_0x5b478b[_0x55c1('0x1f')][_0x55c1('0x22')],function(_0x1801d8){return{'model':db[_0x1801d8[_0x55c1('0x24')]],'as':_0x1801d8['as'],'attributes':_0x1801d8[_0x55c1('0x20')],'include':_0x1801d8[_0x55c1('0x22')]?_[_0x55c1('0x23')](_0x1801d8['include'],function(_0x54f27d){return{'model':db[_0x54f27d[_0x55c1('0x24')]],'as':_0x54f27d['as'],'attributes':_0x54f27d[_0x55c1('0x20')],'include':_0x54f27d['include']?_[_0x55c1('0x23')](_0x54f27d[_0x55c1('0x22')],function(_0x4af5c3){return{'model':db[_0x4af5c3[_0x55c1('0x24')]],'as':_0x4af5c3['as'],'attributes':_0x4af5c3[_0x55c1('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x373ddc){logger[_0x55c1('0x12')]('ShowChatQueue',_0x5b478b);logger['debug'](_0x55c1('0x29'),_0x5b478b,JSON[_0x55c1('0x17')](_0x373ddc));_0x4905fe(_0x373ddc);})[_0x55c1('0x1c')](function(_0x58cffd){logger['error'](_0x55c1('0x29'),_0x58cffd[_0x55c1('0x1a')],_0x5b478b);_0x45cda2(_0x40fab7[_0x55c1('0x18')](0x1f4,_0x58cffd[_0x55c1('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 239f237..9365a8a 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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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 19947c9..b54fcbd 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 _0x9a18=['describe','get','/:id','show','getTeams','getAgents','post','create','/:id/teams','addTeams','addAgents','put','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./chatQueue.controller','isAuthenticated','/describe'];(function(_0x46af7e,_0x3e32c7){var _0x4c0447=function(_0x42fc16){while(--_0x42fc16){_0x46af7e['push'](_0x46af7e['shift']());}};_0x4c0447(++_0x3e32c7);}(_0x9a18,0x78));var _0x89a1=function(_0xd2b83d,_0x52032a){_0xd2b83d=_0xd2b83d-0x0;var _0x530cc2=_0x9a18[_0xd2b83d];return _0x530cc2;};'use strict';var multer=require(_0x89a1('0x0'));var util=require(_0x89a1('0x1'));var path=require(_0x89a1('0x2'));var timeout=require(_0x89a1('0x3'));var express=require(_0x89a1('0x4'));var router=express[_0x89a1('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x89a1('0x6'));var controller=require(_0x89a1('0x7'));router['get']('/',auth[_0x89a1('0x8')](),controller['index']);router['get'](_0x89a1('0x9'),auth[_0x89a1('0x8')](),controller[_0x89a1('0xa')]);router[_0x89a1('0xb')](_0x89a1('0xc'),auth[_0x89a1('0x8')](),controller[_0x89a1('0xd')]);router[_0x89a1('0xb')]('/:id/members',auth[_0x89a1('0x8')](),controller['getMembers']);router[_0x89a1('0xb')]('/:id/teams',auth[_0x89a1('0x8')](),controller[_0x89a1('0xe')]);router[_0x89a1('0xb')]('/:id/users',auth[_0x89a1('0x8')](),controller[_0x89a1('0xf')]);router[_0x89a1('0x10')]('/',auth['isAuthenticated'](),controller[_0x89a1('0x11')]);router[_0x89a1('0x10')](_0x89a1('0x12'),auth[_0x89a1('0x8')](),controller[_0x89a1('0x13')]);router[_0x89a1('0x10')]('/:id/users',auth[_0x89a1('0x8')](),controller[_0x89a1('0x14')]);router[_0x89a1('0x15')](_0x89a1('0xc'),auth[_0x89a1('0x8')](),controller['update']);router[_0x89a1('0x16')](_0x89a1('0xc'),auth[_0x89a1('0x8')](),controller['destroy']);router['delete'](_0x89a1('0x12'),auth[_0x89a1('0x8')](),controller[_0x89a1('0x17')]);router[_0x89a1('0x16')]('/:id/users',auth[_0x89a1('0x8')](),controller[_0x89a1('0x18')]);module[_0x89a1('0x19')]=router; \ No newline at end of file +var _0x20d4=['./chatQueue.controller','get','/describe','isAuthenticated','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','delete','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment'];(function(_0x2f075c,_0x19b726){var _0x3615c7=function(_0xcaf9f7){while(--_0xcaf9f7){_0x2f075c['push'](_0x2f075c['shift']());}};_0x3615c7(++_0x19b726);}(_0x20d4,0x19a));var _0x420d=function(_0x40d3c8,_0x4e1ebd){_0x40d3c8=_0x40d3c8-0x0;var _0xc56128=_0x20d4[_0x40d3c8];return _0xc56128;};'use strict';var multer=require(_0x420d('0x0'));var util=require(_0x420d('0x1'));var path=require('path');var timeout=require(_0x420d('0x2'));var express=require(_0x420d('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x420d('0x4'));var config=require(_0x420d('0x5'));var controller=require(_0x420d('0x6'));router[_0x420d('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x420d('0x7')](_0x420d('0x8'),auth[_0x420d('0x9')](),controller['describe']);router[_0x420d('0x7')](_0x420d('0xa'),auth[_0x420d('0x9')](),controller[_0x420d('0xb')]);router[_0x420d('0x7')](_0x420d('0xc'),auth[_0x420d('0x9')](),controller[_0x420d('0xd')]);router[_0x420d('0x7')](_0x420d('0xe'),auth['isAuthenticated'](),controller[_0x420d('0xf')]);router[_0x420d('0x7')](_0x420d('0x10'),auth[_0x420d('0x9')](),controller[_0x420d('0x11')]);router[_0x420d('0x12')]('/',auth[_0x420d('0x9')](),controller['create']);router['post'](_0x420d('0xe'),auth[_0x420d('0x9')](),controller[_0x420d('0x13')]);router[_0x420d('0x12')]('/:id/users',auth[_0x420d('0x9')](),controller[_0x420d('0x14')]);router[_0x420d('0x15')](_0x420d('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x420d('0x16')](_0x420d('0xa'),auth[_0x420d('0x9')](),controller['destroy']);router['delete'](_0x420d('0xe'),auth[_0x420d('0x9')](),controller[_0x420d('0x17')]);router[_0x420d('0x16')](_0x420d('0x10'),auth[_0x420d('0x9')](),controller[_0x420d('0x18')]);module[_0x420d('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index ce3831b..598560e 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 _0x82c1=['STRING','DATE','moment','sequelize','exports'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x82c1,0x1dd));var _0x182c=function(_0xe8ab4f,_0x119c37){_0xe8ab4f=_0xe8ab4f-0x0;var _0x507748=_0x82c1[_0xe8ab4f];return _0x507748;};'use strict';var moment=require(_0x182c('0x0'));var Sequelize=require(_0x182c('0x1'));module[_0x182c('0x2')]={'uniqueid':{'type':Sequelize[_0x182c('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x182c('0x3')]},'joinAt':{'type':Sequelize[_0x182c('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x182c('0x4')]},'reason':{'type':Sequelize[_0x182c('0x3')]}}; \ No newline at end of file +var _0xe4fc=['exports','STRING','DATE','moment','sequelize'];(function(_0x745c75,_0x3ddc96){var _0x15d6c2=function(_0x14f803){while(--_0x14f803){_0x745c75['push'](_0x745c75['shift']());}};_0x15d6c2(++_0x3ddc96);}(_0xe4fc,0x139));var _0xce4f=function(_0x1c4b46,_0x26ba44){_0x1c4b46=_0x1c4b46-0x0;var _0x32f50c=_0xe4fc[_0x1c4b46];return _0x32f50c;};'use strict';var moment=require(_0xce4f('0x0'));var Sequelize=require(_0xce4f('0x1'));module[_0xce4f('0x2')]={'uniqueid':{'type':Sequelize[_0xce4f('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xce4f('0x3')]},'joinAt':{'type':Sequelize[_0xce4f('0x4')]},'leaveAt':{'type':Sequelize[_0xce4f('0x4')]},'acceptAt':{'type':Sequelize[_0xce4f('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xce4f('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 5559043..1fc7dc1 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 _0xb014=['set','apply','reject','save','update','destroy','then','end','error','stack','name','send','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','map','type','key','field','filter','options','ChatQueueReport','includeAll','include','findAll','rows','show','params','merge','find','catch','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset'];(function(_0x140fd6,_0x5d8037){var _0x16a6ad=function(_0x5adbf7){while(--_0x5adbf7){_0x140fd6['push'](_0x140fd6['shift']());}};_0x16a6ad(++_0x5d8037);}(_0xb014,0x76));var _0x4b01=function(_0x46428c,_0x20ab75){_0x46428c=_0x46428c-0x0;var _0x16a677=_0xb014[_0x46428c];return _0x16a677;};'use strict';var pdf=require(_0x4b01('0x0'));var emlformat=require(_0x4b01('0x1'));var rimraf=require(_0x4b01('0x2'));var zipdir=require(_0x4b01('0x3'));var jsonpatch=require(_0x4b01('0x4'));var rp=require(_0x4b01('0x5'));var moment=require(_0x4b01('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x4b01('0x7'));var util=require(_0x4b01('0x8'));var path=require('path');var sox=require(_0x4b01('0x9'));var csv=require('to-csv');var ejs=require(_0x4b01('0xa'));var fs=require('fs');var _=require(_0x4b01('0xb'));var squel=require('squel');var crypto=require(_0x4b01('0xc'));var jsforce=require(_0x4b01('0xd'));var deskjs=require(_0x4b01('0xe'));var toCsv=require(_0x4b01('0xf'));var querystring=require('querystring');var Papa=require(_0x4b01('0x10'));var Redis=require(_0x4b01('0x11'));var authService=require(_0x4b01('0x12'));var qs=require(_0x4b01('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4b01('0x14'))(_0x4b01('0x15'));var utils=require(_0x4b01('0x16'));var config=require(_0x4b01('0x17'));var db=require(_0x4b01('0x18'))['db'];function respondWithStatusCode(_0x38a9c2,_0x2b1cd3){_0x2b1cd3=_0x2b1cd3||0xcc;return function(_0x316aec){if(_0x316aec){return _0x38a9c2[_0x4b01('0x19')](_0x2b1cd3);}return _0x38a9c2[_0x4b01('0x1a')](_0x2b1cd3)['end']();};}function respondWithResult(_0x290bcf,_0x34e163){_0x34e163=_0x34e163||0xc8;return function(_0x1c6ac0){if(_0x1c6ac0){return _0x290bcf[_0x4b01('0x1a')](_0x34e163)[_0x4b01('0x1b')](_0x1c6ac0);}};}function respondWithFilteredResult(_0x1d6469,_0x3c3721){return function(_0x3f79b9){if(_0x3f79b9){var _0x275e25=_0x3f79b9[_0x4b01('0x1c')],_0x257e37=_0x3c3721['offset'],_0x4c18ea=_0x3c3721[_0x4b01('0x1d')]+_0x3c3721['limit'],_0x43e8ad;if(_0x4c18ea>=_0x275e25){_0x4c18ea=_0x275e25;_0x43e8ad=0xc8;}else{_0x43e8ad=0xce;}_0x1d6469[_0x4b01('0x1a')](_0x43e8ad);return _0x1d6469[_0x4b01('0x1e')]('Content-Range',_0x257e37+'-'+_0x4c18ea+'/'+_0x275e25)[_0x4b01('0x1b')](_0x3f79b9);}return null;};}function patchUpdates(_0x2e5fa5){return function(_0x1254af){try{jsonpatch[_0x4b01('0x1f')](_0x1254af,_0x2e5fa5,!![]);}catch(_0x106180){return BPromise[_0x4b01('0x20')](_0x106180);}return _0x1254af[_0x4b01('0x21')]();};}function saveUpdates(_0x2fd80e,_0x3d91dc){return function(_0x2b8ed1){if(_0x2b8ed1){return _0x2b8ed1[_0x4b01('0x22')](_0x2fd80e)['then'](function(_0x2a0879){return _0x2a0879;});}return null;};}function removeEntity(_0x2c6b4a,_0x295632){return function(_0x5cbef4){if(_0x5cbef4){return _0x5cbef4[_0x4b01('0x23')]()[_0x4b01('0x24')](function(){_0x2c6b4a[_0x4b01('0x1a')](0xcc)[_0x4b01('0x25')]();});}};}function handleEntityNotFound(_0x54a585,_0x3e643f){return function(_0x49dbc0){if(!_0x49dbc0){_0x54a585[_0x4b01('0x19')](0x194);}return _0x49dbc0;};}function handleError(_0x51a7a8,_0x1438f6){_0x1438f6=_0x1438f6||0x1f4;return function(_0x146fe3){logger[_0x4b01('0x26')](_0x146fe3[_0x4b01('0x27')]);if(_0x146fe3[_0x4b01('0x28')]){delete _0x146fe3[_0x4b01('0x28')];}_0x51a7a8[_0x4b01('0x1a')](_0x1438f6)[_0x4b01('0x29')](_0x146fe3);};}exports['index']=function(_0x5ec5a8,_0x438c4a){var _0x15d8cd={},_0x43aacf={},_0xb9339d={'count':0x0,'rows':[]};var _0x4ccabf=db['ChatQueueReport'][_0x4b01('0x2a')];_0x43aacf[_0x4b01('0x2b')]=_['keys'](_0x4ccabf);_0x43aacf[_0x4b01('0x2c')]=_[_0x4b01('0x2d')](_0x5ec5a8[_0x4b01('0x2c')]);_0x43aacf[_0x4b01('0x2e')]=_[_0x4b01('0x2f')](_0x43aacf[_0x4b01('0x2b')],_0x43aacf['query']);_0x15d8cd[_0x4b01('0x30')]=_[_0x4b01('0x2f')](_0x43aacf[_0x4b01('0x2b')],qs[_0x4b01('0x31')](_0x5ec5a8[_0x4b01('0x2c')][_0x4b01('0x31')]));_0x15d8cd[_0x4b01('0x30')]=_0x15d8cd[_0x4b01('0x30')][_0x4b01('0x32')]?_0x15d8cd[_0x4b01('0x30')]:_0x43aacf[_0x4b01('0x2b')];if(!_0x5ec5a8[_0x4b01('0x2c')]['hasOwnProperty'](_0x4b01('0x33'))){_0x15d8cd[_0x4b01('0x34')]=qs[_0x4b01('0x34')](_0x5ec5a8[_0x4b01('0x2c')][_0x4b01('0x34')]);_0x15d8cd[_0x4b01('0x1d')]=qs[_0x4b01('0x1d')](_0x5ec5a8[_0x4b01('0x2c')][_0x4b01('0x1d')]);}_0x15d8cd[_0x4b01('0x35')]=qs[_0x4b01('0x36')](_0x5ec5a8[_0x4b01('0x2c')][_0x4b01('0x36')]);_0x15d8cd[_0x4b01('0x37')]=qs[_0x4b01('0x2e')](_[_0x4b01('0x38')](_0x5ec5a8[_0x4b01('0x2c')],_0x43aacf[_0x4b01('0x2e')]));if(_0x5ec5a8[_0x4b01('0x2c')]['filter']){_0x15d8cd[_0x4b01('0x37')]=_['merge'](_0x15d8cd[_0x4b01('0x37')],{'$or':_[_0x4b01('0x39')](_0x4ccabf,function(_0x4ffafd){if(_0x4ffafd[_0x4b01('0x3a')][_0x4b01('0x3b')]!=='VIRTUAL'){var _0xc17f3f={};_0xc17f3f[_0x4ffafd[_0x4b01('0x3c')]]={'$like':'%'+_0x5ec5a8[_0x4b01('0x2c')][_0x4b01('0x3d')]+'%'};return _0xc17f3f;}})});}_0x15d8cd=_['merge']({},_0x15d8cd,_0x5ec5a8[_0x4b01('0x3e')]);var _0x1b8787={'where':_0x15d8cd['where']};return db[_0x4b01('0x3f')][_0x4b01('0x1c')](_0x1b8787)['then'](function(_0x362866){_0xb9339d['count']=_0x362866;if(_0x5ec5a8[_0x4b01('0x2c')][_0x4b01('0x40')]){_0x15d8cd[_0x4b01('0x41')]=[{'all':!![]}];}return db[_0x4b01('0x3f')][_0x4b01('0x42')](_0x15d8cd);})[_0x4b01('0x24')](function(_0x4f3536){_0xb9339d[_0x4b01('0x43')]=_0x4f3536;return _0xb9339d;})[_0x4b01('0x24')](respondWithFilteredResult(_0x438c4a,_0x15d8cd))['catch'](handleError(_0x438c4a,null));};exports[_0x4b01('0x44')]=function(_0x132866,_0x57c822){var _0x93d7ec={'raw':!![],'where':{'id':_0x132866[_0x4b01('0x45')]['id']}},_0x2588fd={};_0x2588fd[_0x4b01('0x2b')]=_[_0x4b01('0x2d')](db[_0x4b01('0x3f')][_0x4b01('0x2a')]);_0x2588fd[_0x4b01('0x2c')]=_['keys'](_0x132866[_0x4b01('0x2c')]);_0x2588fd[_0x4b01('0x2e')]=_['intersection'](_0x2588fd[_0x4b01('0x2b')],_0x2588fd['query']);_0x93d7ec['attributes']=_[_0x4b01('0x2f')](_0x2588fd[_0x4b01('0x2b')],qs[_0x4b01('0x31')](_0x132866[_0x4b01('0x2c')]['fields']));_0x93d7ec[_0x4b01('0x30')]=_0x93d7ec['attributes'][_0x4b01('0x32')]?_0x93d7ec[_0x4b01('0x30')]:_0x2588fd[_0x4b01('0x2b')];if(_0x132866['query'][_0x4b01('0x40')]){_0x93d7ec[_0x4b01('0x41')]=[{'all':!![]}];}_0x93d7ec=_[_0x4b01('0x46')]({},_0x93d7ec,_0x132866[_0x4b01('0x3e')]);return db['ChatQueueReport'][_0x4b01('0x47')](_0x93d7ec)[_0x4b01('0x24')](handleEntityNotFound(_0x57c822,null))[_0x4b01('0x24')](respondWithResult(_0x57c822,null))[_0x4b01('0x48')](handleError(_0x57c822,null));};exports['create']=function(_0x51995b,_0x24710b){return db[_0x4b01('0x3f')]['create'](_0x51995b[_0x4b01('0x49')],{})[_0x4b01('0x24')](respondWithResult(_0x24710b,0xc9))[_0x4b01('0x48')](handleError(_0x24710b,null));};exports['update']=function(_0x5055e6,_0x25f82f){if(_0x5055e6['body']['id']){delete _0x5055e6['body']['id'];}return db['ChatQueueReport'][_0x4b01('0x47')]({'where':{'id':_0x5055e6['params']['id']}})[_0x4b01('0x24')](handleEntityNotFound(_0x25f82f,null))[_0x4b01('0x24')](saveUpdates(_0x5055e6[_0x4b01('0x49')],null))[_0x4b01('0x24')](respondWithResult(_0x25f82f,null))['catch'](handleError(_0x25f82f,null));};exports[_0x4b01('0x23')]=function(_0x36a982,_0x1d6142){return db[_0x4b01('0x3f')][_0x4b01('0x47')]({'where':{'id':_0x36a982[_0x4b01('0x45')]['id']}})[_0x4b01('0x24')](handleEntityNotFound(_0x1d6142,null))[_0x4b01('0x24')](removeEntity(_0x1d6142,null))[_0x4b01('0x48')](handleError(_0x1d6142,null));};exports['describe']=function(_0x42227c,_0x375ac8){return db[_0x4b01('0x3f')]['describe']()[_0x4b01('0x24')](respondWithResult(_0x375ac8,null))[_0x4b01('0x48')](handleError(_0x375ac8,null));}; \ No newline at end of file +var _0x187e=['model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','offset','sort','where','filter','merge','map','type','field','options','includeAll','include','findAll','rows','then','catch','show','params','intersection','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','json','count','limit','set','Content-Range','save','update','destroy','end','error','stack','name','send','ChatQueueReport','rawAttributes'];(function(_0x1297a7,_0x45d4cf){var _0x1e6cd1=function(_0xc1048e){while(--_0xc1048e){_0x1297a7['push'](_0x1297a7['shift']());}};_0x1e6cd1(++_0x45d4cf);}(_0x187e,0x1d5));var _0xe187=function(_0x1a3709,_0x1dc8a5){_0x1a3709=_0x1a3709-0x0;var _0x2a9bc8=_0x187e[_0x1a3709];return _0x2a9bc8;};'use strict';var pdf=require(_0xe187('0x0'));var emlformat=require(_0xe187('0x1'));var rimraf=require(_0xe187('0x2'));var zipdir=require(_0xe187('0x3'));var jsonpatch=require(_0xe187('0x4'));var rp=require('request-promise');var moment=require(_0xe187('0x5'));var BPromise=require(_0xe187('0x6'));var Mustache=require(_0xe187('0x7'));var util=require('util');var path=require(_0xe187('0x8'));var sox=require(_0xe187('0x9'));var csv=require('to-csv');var ejs=require(_0xe187('0xa'));var fs=require('fs');var _=require(_0xe187('0xb'));var squel=require(_0xe187('0xc'));var crypto=require(_0xe187('0xd'));var jsforce=require(_0xe187('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe187('0xf'));var querystring=require(_0xe187('0x10'));var Papa=require(_0xe187('0x11'));var Redis=require(_0xe187('0x12'));var authService=require(_0xe187('0x13'));var qs=require(_0xe187('0x14'));var hardwareService=require(_0xe187('0x15'));var logger=require(_0xe187('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xe187('0x17'));var db=require(_0xe187('0x18'))['db'];function respondWithStatusCode(_0x3b4348,_0xf91eaa){_0xf91eaa=_0xf91eaa||0xcc;return function(_0x1ab5d6){if(_0x1ab5d6){return _0x3b4348[_0xe187('0x19')](_0xf91eaa);}return _0x3b4348[_0xe187('0x1a')](_0xf91eaa)['end']();};}function respondWithResult(_0x51b882,_0x1b5fb7){_0x1b5fb7=_0x1b5fb7||0xc8;return function(_0xe2755b){if(_0xe2755b){return _0x51b882['status'](_0x1b5fb7)[_0xe187('0x1b')](_0xe2755b);}};}function respondWithFilteredResult(_0x5b03bc,_0x2c5e8f){return function(_0x56245c){if(_0x56245c){var _0x621499=_0x56245c[_0xe187('0x1c')],_0xf529dd=_0x2c5e8f['offset'],_0x3f5bfd=_0x2c5e8f['offset']+_0x2c5e8f[_0xe187('0x1d')],_0x306e5b;if(_0x3f5bfd>=_0x621499){_0x3f5bfd=_0x621499;_0x306e5b=0xc8;}else{_0x306e5b=0xce;}_0x5b03bc['status'](_0x306e5b);return _0x5b03bc[_0xe187('0x1e')](_0xe187('0x1f'),_0xf529dd+'-'+_0x3f5bfd+'/'+_0x621499)[_0xe187('0x1b')](_0x56245c);}return null;};}function patchUpdates(_0x39e692){return function(_0x3800da){try{jsonpatch['apply'](_0x3800da,_0x39e692,!![]);}catch(_0x1bd14a){return BPromise['reject'](_0x1bd14a);}return _0x3800da[_0xe187('0x20')]();};}function saveUpdates(_0x254a20,_0x3706a9){return function(_0xd5e50){if(_0xd5e50){return _0xd5e50[_0xe187('0x21')](_0x254a20)['then'](function(_0x2d6bfd){return _0x2d6bfd;});}return null;};}function removeEntity(_0x2184af,_0x2d9ca3){return function(_0x3dfd97){if(_0x3dfd97){return _0x3dfd97[_0xe187('0x22')]()['then'](function(){_0x2184af[_0xe187('0x1a')](0xcc)[_0xe187('0x23')]();});}};}function handleEntityNotFound(_0x459f26,_0x2cf26e){return function(_0x2c2a62){if(!_0x2c2a62){_0x459f26[_0xe187('0x19')](0x194);}return _0x2c2a62;};}function handleError(_0x5986b8,_0x4d7c47){_0x4d7c47=_0x4d7c47||0x1f4;return function(_0x45230e){logger[_0xe187('0x24')](_0x45230e[_0xe187('0x25')]);if(_0x45230e[_0xe187('0x26')]){delete _0x45230e[_0xe187('0x26')];}_0x5986b8[_0xe187('0x1a')](_0x4d7c47)[_0xe187('0x27')](_0x45230e);};}exports['index']=function(_0x11e5bf,_0x2e9527){var _0x574427={},_0x13f115={},_0x2098fe={'count':0x0,'rows':[]};var _0x327151=db[_0xe187('0x28')][_0xe187('0x29')];_0x13f115[_0xe187('0x2a')]=_[_0xe187('0x2b')](_0x327151);_0x13f115[_0xe187('0x2c')]=_[_0xe187('0x2b')](_0x11e5bf[_0xe187('0x2c')]);_0x13f115[_0xe187('0x2d')]=_['intersection'](_0x13f115[_0xe187('0x2a')],_0x13f115['query']);_0x574427[_0xe187('0x2e')]=_['intersection'](_0x13f115[_0xe187('0x2a')],qs[_0xe187('0x2f')](_0x11e5bf['query'][_0xe187('0x2f')]));_0x574427[_0xe187('0x2e')]=_0x574427[_0xe187('0x2e')][_0xe187('0x30')]?_0x574427[_0xe187('0x2e')]:_0x13f115[_0xe187('0x2a')];if(!_0x11e5bf[_0xe187('0x2c')][_0xe187('0x31')](_0xe187('0x32'))){_0x574427[_0xe187('0x1d')]=qs[_0xe187('0x1d')](_0x11e5bf[_0xe187('0x2c')]['limit']);_0x574427[_0xe187('0x33')]=qs[_0xe187('0x33')](_0x11e5bf[_0xe187('0x2c')][_0xe187('0x33')]);}_0x574427['order']=qs[_0xe187('0x34')](_0x11e5bf[_0xe187('0x2c')][_0xe187('0x34')]);_0x574427[_0xe187('0x35')]=qs['filters'](_['pick'](_0x11e5bf[_0xe187('0x2c')],_0x13f115[_0xe187('0x2d')]));if(_0x11e5bf['query'][_0xe187('0x36')]){_0x574427[_0xe187('0x35')]=_[_0xe187('0x37')](_0x574427[_0xe187('0x35')],{'$or':_[_0xe187('0x38')](_0x327151,function(_0x3c04ec){if(_0x3c04ec[_0xe187('0x39')]['key']!=='VIRTUAL'){var _0x54def1={};_0x54def1[_0x3c04ec[_0xe187('0x3a')]]={'$like':'%'+_0x11e5bf[_0xe187('0x2c')]['filter']+'%'};return _0x54def1;}})});}_0x574427=_[_0xe187('0x37')]({},_0x574427,_0x11e5bf[_0xe187('0x3b')]);var _0x181a25={'where':_0x574427[_0xe187('0x35')]};return db[_0xe187('0x28')]['count'](_0x181a25)['then'](function(_0x1da98f){_0x2098fe[_0xe187('0x1c')]=_0x1da98f;if(_0x11e5bf[_0xe187('0x2c')][_0xe187('0x3c')]){_0x574427[_0xe187('0x3d')]=[{'all':!![]}];}return db[_0xe187('0x28')][_0xe187('0x3e')](_0x574427);})['then'](function(_0x1aef60){_0x2098fe[_0xe187('0x3f')]=_0x1aef60;return _0x2098fe;})[_0xe187('0x40')](respondWithFilteredResult(_0x2e9527,_0x574427))[_0xe187('0x41')](handleError(_0x2e9527,null));};exports[_0xe187('0x42')]=function(_0x341654,_0x21a8a3){var _0x171faa={'raw':!![],'where':{'id':_0x341654[_0xe187('0x43')]['id']}},_0x1f3758={};_0x1f3758[_0xe187('0x2a')]=_[_0xe187('0x2b')](db['ChatQueueReport'][_0xe187('0x29')]);_0x1f3758[_0xe187('0x2c')]=_['keys'](_0x341654[_0xe187('0x2c')]);_0x1f3758[_0xe187('0x2d')]=_[_0xe187('0x44')](_0x1f3758[_0xe187('0x2a')],_0x1f3758[_0xe187('0x2c')]);_0x171faa['attributes']=_[_0xe187('0x44')](_0x1f3758[_0xe187('0x2a')],qs[_0xe187('0x2f')](_0x341654[_0xe187('0x2c')][_0xe187('0x2f')]));_0x171faa[_0xe187('0x2e')]=_0x171faa[_0xe187('0x2e')]['length']?_0x171faa[_0xe187('0x2e')]:_0x1f3758[_0xe187('0x2a')];if(_0x341654[_0xe187('0x2c')][_0xe187('0x3c')]){_0x171faa['include']=[{'all':!![]}];}_0x171faa=_[_0xe187('0x37')]({},_0x171faa,_0x341654[_0xe187('0x3b')]);return db['ChatQueueReport'][_0xe187('0x45')](_0x171faa)['then'](handleEntityNotFound(_0x21a8a3,null))['then'](respondWithResult(_0x21a8a3,null))['catch'](handleError(_0x21a8a3,null));};exports['create']=function(_0x89419b,_0x4a47c8){return db[_0xe187('0x28')][_0xe187('0x46')](_0x89419b[_0xe187('0x47')],{})['then'](respondWithResult(_0x4a47c8,0xc9))[_0xe187('0x41')](handleError(_0x4a47c8,null));};exports['update']=function(_0x1d4b5e,_0x5bd485){if(_0x1d4b5e[_0xe187('0x47')]['id']){delete _0x1d4b5e[_0xe187('0x47')]['id'];}return db[_0xe187('0x28')][_0xe187('0x45')]({'where':{'id':_0x1d4b5e[_0xe187('0x43')]['id']}})[_0xe187('0x40')](handleEntityNotFound(_0x5bd485,null))[_0xe187('0x40')](saveUpdates(_0x1d4b5e[_0xe187('0x47')],null))[_0xe187('0x40')](respondWithResult(_0x5bd485,null))[_0xe187('0x41')](handleError(_0x5bd485,null));};exports[_0xe187('0x22')]=function(_0x386d63,_0x48680e){return db['ChatQueueReport'][_0xe187('0x45')]({'where':{'id':_0x386d63[_0xe187('0x43')]['id']}})[_0xe187('0x40')](handleEntityNotFound(_0x48680e,null))[_0xe187('0x40')](removeEntity(_0x48680e,null))[_0xe187('0x41')](handleError(_0x48680e,null));};exports['describe']=function(_0x4a1485,_0x156a37){return db[_0xe187('0x28')][_0xe187('0x48')]()['then'](respondWithResult(_0x156a37,null))['catch'](handleError(_0x156a37,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index e95ec2b..9d35ecc 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 _0x97a2=['bluebird','request-promise','rimraf','../../config/environment','exports','define','report_chat_queue','uniqueid','util','../../config/logger','moment'];(function(_0x417e38,_0x2b106e){var _0x288874=function(_0x23fab9){while(--_0x23fab9){_0x417e38['push'](_0x417e38['shift']());}};_0x288874(++_0x2b106e);}(_0x97a2,0xad));var _0x297a=function(_0x337753,_0x31f000){_0x337753=_0x337753-0x0;var _0x4f8b58=_0x97a2[_0x337753];return _0x4f8b58;};'use strict';var _=require('lodash');var util=require(_0x297a('0x0'));var logger=require(_0x297a('0x1'))('api');var moment=require(_0x297a('0x2'));var BPromise=require(_0x297a('0x3'));var rp=require(_0x297a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x297a('0x5'));var config=require(_0x297a('0x6'));var attributes=require('./chatQueueReport.attributes');module[_0x297a('0x7')]=function(_0x429ae7,_0x255bc4){return _0x429ae7[_0x297a('0x8')]('ChatQueueReport',attributes,{'tableName':_0x297a('0x9'),'paranoid':![],'indexes':[{'name':_0x297a('0xa'),'fields':[_0x297a('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2d92=['report_chat_queue','uniqueid','lodash','util','../../config/logger','api','moment','define','ChatQueueReport'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x2d92,0x80));var _0x22d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2d92[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x22d9('0x0'));var util=require(_0x22d9('0x1'));var logger=require(_0x22d9('0x2'))(_0x22d9('0x3'));var moment=require(_0x22d9('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('./chatQueueReport.attributes');module['exports']=function(_0x3e3b7c,_0x17c463){return _0x3e3b7c[_0x22d9('0x5')](_0x22d9('0x6'),attributes,{'tableName':_0x22d9('0x7'),'paranoid':![],'indexes':[{'name':_0x22d9('0x8'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 6b61d71..609b0e8 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 _0x8313=['stringify','error','code','message','result','catch','ChatQueueReport','create','body','options','raw','CreateChatQueueReport','UpdateChatQueueReport','update','where','limit','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x12309b,_0x59dd8c){var _0x482e4d=function(_0x308407){while(--_0x308407){_0x12309b['push'](_0x12309b['shift']());}};_0x482e4d(++_0x59dd8c);}(_0x8313,0x15a));var _0x3831=function(_0x434f20,_0x29467e){_0x434f20=_0x434f20-0x0;var _0x1e8d9c=_0x8313[_0x434f20];return _0x1e8d9c;};'use strict';var _=require('lodash');var util=require(_0x3831('0x0'));var moment=require(_0x3831('0x1'));var BPromise=require(_0x3831('0x2'));var rs=require(_0x3831('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3831('0x4'))['db'];var utils=require(_0x3831('0x5'));var logger=require('../../config/logger')(_0x3831('0x6'));var config=require('../../config/environment');var jayson=require(_0x3831('0x7'));var client=jayson[_0x3831('0x8')][_0x3831('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b6244,_0x19fd1e,_0x49a527){return new BPromise(function(_0x54657f,_0x10cbfc){return client[_0x3831('0xa')](_0x4b6244,_0x49a527)[_0x3831('0xb')](function(_0x31fa5b){logger[_0x3831('0xc')](_0x3831('0xd'),_0x19fd1e,_0x3831('0xe'));logger[_0x3831('0xf')](_0x3831('0x10'),_0x19fd1e,_0x3831('0xe'),JSON[_0x3831('0x11')](_0x31fa5b));if(_0x31fa5b[_0x3831('0x12')]){if(_0x31fa5b[_0x3831('0x12')][_0x3831('0x13')]===0x1f4){logger[_0x3831('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x19fd1e,_0x31fa5b[_0x3831('0x12')]['message']);return _0x10cbfc(_0x31fa5b['error'][_0x3831('0x14')]);}logger['error'](_0x3831('0xd'),_0x19fd1e,_0x31fa5b[_0x3831('0x12')][_0x3831('0x14')]);return _0x54657f(_0x31fa5b[_0x3831('0x12')]['message']);}else{logger[_0x3831('0xc')](_0x3831('0xd'),_0x19fd1e,_0x3831('0xe'));_0x54657f(_0x31fa5b[_0x3831('0x15')][_0x3831('0x14')]);}})[_0x3831('0x16')](function(_0x318c59){logger[_0x3831('0x12')]('ChatQueueReport,\x20%s,\x20%s',_0x19fd1e,_0x318c59);_0x10cbfc(_0x318c59);});});}exports['CreateChatQueueReport']=function(_0xa110b5){var _0x2b3541=this;return new Promise(function(_0x20fe87,_0x5a2f4a){return db[_0x3831('0x17')][_0x3831('0x18')](_0xa110b5[_0x3831('0x19')],{'raw':_0xa110b5[_0x3831('0x1a')]?_0xa110b5[_0x3831('0x1a')][_0x3831('0x1b')]===undefined?!![]:![]:!![]})[_0x3831('0xb')](function(_0x476d49){logger['info']('CreateChatQueueReport',_0xa110b5);logger[_0x3831('0xf')](_0x3831('0x1c'),_0xa110b5,JSON[_0x3831('0x11')](_0x476d49));_0x20fe87(_0x476d49);})[_0x3831('0x16')](function(_0x4d98ba){logger[_0x3831('0x12')](_0x3831('0x1c'),_0x4d98ba[_0x3831('0x14')],_0xa110b5);_0x5a2f4a(_0x2b3541[_0x3831('0x12')](0x1f4,_0x4d98ba['message']));});});};exports[_0x3831('0x1d')]=function(_0x2995b2){var _0x58d8df=this;return new Promise(function(_0x6cdac1,_0x3ce2b5){return db['ChatQueueReport'][_0x3831('0x1e')](_0x2995b2[_0x3831('0x19')],{'raw':_0x2995b2[_0x3831('0x1a')]?_0x2995b2[_0x3831('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2995b2['options']?_0x2995b2['options'][_0x3831('0x1f')]||null:null,'attributes':_0x2995b2[_0x3831('0x1a')]?_0x2995b2[_0x3831('0x1a')]['attributes']||null:null,'limit':_0x2995b2['options']?_0x2995b2[_0x3831('0x1a')][_0x3831('0x20')]||null:null})[_0x3831('0xb')](function(_0xca78e2){logger['info'](_0x3831('0x1d'),_0x2995b2);logger['debug'](_0x3831('0x1d'),_0x2995b2,JSON['stringify'](_0xca78e2));_0x6cdac1(_0xca78e2);})[_0x3831('0x16')](function(_0x2f4d3d){logger[_0x3831('0x12')](_0x3831('0x1d'),_0x2f4d3d[_0x3831('0x14')],_0x2995b2);_0x3ce2b5(_0x58d8df[_0x3831('0x12')](0x1f4,_0x2f4d3d[_0x3831('0x14')]));});});}; \ No newline at end of file +var _0x3cc4=['../../config/logger','rpc','../../config/environment','jayson/promise','client','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','then','UpdateChatQueueReport','update','limit','lodash','util','randomstring','../../mysqldb'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x3cc4,0x176));var _0x43cc=function(_0x4baa7d,_0x35a789){_0x4baa7d=_0x4baa7d-0x0;var _0x3e13c0=_0x3cc4[_0x4baa7d];return _0x3e13c0;};'use strict';var _=require(_0x43cc('0x0'));var util=require(_0x43cc('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x43cc('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x43cc('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x43cc('0x4'))(_0x43cc('0x5'));var config=require(_0x43cc('0x6'));var jayson=require(_0x43cc('0x7'));var client=jayson[_0x43cc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x460cab,_0x48aab9,_0x1a42e6){return new BPromise(function(_0xb1a6b9,_0x41ce52){return client['request'](_0x460cab,_0x1a42e6)['then'](function(_0x2f2188){logger[_0x43cc('0x9')](_0x43cc('0xa'),_0x48aab9,_0x43cc('0xb'));logger[_0x43cc('0xc')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x48aab9,_0x43cc('0xb'),JSON[_0x43cc('0xd')](_0x2f2188));if(_0x2f2188[_0x43cc('0xe')]){if(_0x2f2188['error'][_0x43cc('0xf')]===0x1f4){logger['error'](_0x43cc('0xa'),_0x48aab9,_0x2f2188[_0x43cc('0xe')][_0x43cc('0x10')]);return _0x41ce52(_0x2f2188['error']['message']);}logger[_0x43cc('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x48aab9,_0x2f2188[_0x43cc('0xe')][_0x43cc('0x10')]);return _0xb1a6b9(_0x2f2188['error'][_0x43cc('0x10')]);}else{logger[_0x43cc('0x9')](_0x43cc('0xa'),_0x48aab9,_0x43cc('0xb'));_0xb1a6b9(_0x2f2188['result']['message']);}})['catch'](function(_0x4c513f){logger[_0x43cc('0xe')](_0x43cc('0xa'),_0x48aab9,_0x4c513f);_0x41ce52(_0x4c513f);});});}exports[_0x43cc('0x11')]=function(_0x18fea5){var _0xfe7a30=this;return new Promise(function(_0x3d0da8,_0x10aa32){return db[_0x43cc('0x12')][_0x43cc('0x13')](_0x18fea5[_0x43cc('0x14')],{'raw':_0x18fea5[_0x43cc('0x15')]?_0x18fea5[_0x43cc('0x15')][_0x43cc('0x16')]===undefined?!![]:![]:!![]})[_0x43cc('0x17')](function(_0x511e4e){logger[_0x43cc('0x9')](_0x43cc('0x11'),_0x18fea5);logger[_0x43cc('0xc')]('CreateChatQueueReport',_0x18fea5,JSON[_0x43cc('0xd')](_0x511e4e));_0x3d0da8(_0x511e4e);})['catch'](function(_0x1f6e67){logger[_0x43cc('0xe')](_0x43cc('0x11'),_0x1f6e67[_0x43cc('0x10')],_0x18fea5);_0x10aa32(_0xfe7a30[_0x43cc('0xe')](0x1f4,_0x1f6e67[_0x43cc('0x10')]));});});};exports[_0x43cc('0x18')]=function(_0x33c2a7){var _0x4a0992=this;return new Promise(function(_0x1c1337,_0x124a23){return db['ChatQueueReport'][_0x43cc('0x19')](_0x33c2a7[_0x43cc('0x14')],{'raw':_0x33c2a7[_0x43cc('0x15')]?_0x33c2a7[_0x43cc('0x15')][_0x43cc('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33c2a7['options']?_0x33c2a7[_0x43cc('0x15')]['where']||null:null,'attributes':_0x33c2a7['options']?_0x33c2a7['options']['attributes']||null:null,'limit':_0x33c2a7['options']?_0x33c2a7[_0x43cc('0x15')][_0x43cc('0x1a')]||null:null})[_0x43cc('0x17')](function(_0x295ccf){logger[_0x43cc('0x9')](_0x43cc('0x18'),_0x33c2a7);logger[_0x43cc('0xc')](_0x43cc('0x18'),_0x33c2a7,JSON[_0x43cc('0xd')](_0x295ccf));_0x1c1337(_0x295ccf);})['catch'](function(_0x9779c){logger[_0x43cc('0xe')](_0x43cc('0x18'),_0x9779c['message'],_0x33c2a7);_0x124a23(_0x4a0992[_0x43cc('0xe')](0x1f4,_0x9779c[_0x43cc('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index cd607ce..5100032 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 _0x59ce=['util','path','express','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','get','isAuthenticated','describe','/:id','post','update','delete','multer'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x59ce,0xa7));var _0xe59c=function(_0x459faf,_0x233f27){_0x459faf=_0x459faf-0x0;var _0x4de91f=_0x59ce[_0x459faf];return _0x4de91f;};'use strict';var multer=require(_0xe59c('0x0'));var util=require(_0xe59c('0x1'));var path=require(_0xe59c('0x2'));var timeout=require('connect-timeout');var express=require(_0xe59c('0x3'));var router=express['Router']();var auth=require(_0xe59c('0x4'));var interaction=require(_0xe59c('0x5'));var config=require('../../config/environment');var controller=require(_0xe59c('0x6'));router[_0xe59c('0x7')]('/',auth[_0xe59c('0x8')](),controller['index']);router[_0xe59c('0x7')]('/describe',auth[_0xe59c('0x8')](),controller[_0xe59c('0x9')]);router[_0xe59c('0x7')](_0xe59c('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xe59c('0xb')]('/',auth[_0xe59c('0x8')](),controller['create']);router['put'](_0xe59c('0xa'),auth[_0xe59c('0x8')](),controller[_0xe59c('0xc')]);router[_0xe59c('0xd')]('/:id',auth[_0xe59c('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xaede=['create','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','post'];(function(_0x4b7c33,_0x1b9cd6){var _0x126f09=function(_0x27a2e6){while(--_0x27a2e6){_0x4b7c33['push'](_0x4b7c33['shift']());}};_0x126f09(++_0x1b9cd6);}(_0xaede,0x130));var _0xeaed=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xaede[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0xeaed('0x0'));var util=require(_0xeaed('0x1'));var path=require(_0xeaed('0x2'));var timeout=require(_0xeaed('0x3'));var express=require(_0xeaed('0x4'));var router=express['Router']();var auth=require(_0xeaed('0x5'));var interaction=require(_0xeaed('0x6'));var config=require(_0xeaed('0x7'));var controller=require(_0xeaed('0x8'));router[_0xeaed('0x9')]('/',auth[_0xeaed('0xa')](),controller[_0xeaed('0xb')]);router[_0xeaed('0x9')]('/describe',auth[_0xeaed('0xa')](),controller[_0xeaed('0xc')]);router['get'](_0xeaed('0xd'),auth[_0xeaed('0xa')](),controller[_0xeaed('0xe')]);router[_0xeaed('0xf')]('/',auth[_0xeaed('0xa')](),controller[_0xeaed('0x10')]);router['put'](_0xeaed('0xd'),auth['isAuthenticated'](),controller[_0xeaed('0x11')]);router['delete'](_0xeaed('0xd'),auth[_0xeaed('0xa')](),controller[_0xeaed('0x12')]);module[_0xeaed('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index bdea5db..bb03535 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 _0x1f7e=['account','agent','queue','moment','sequelize','STRING'];(function(_0x3b442e,_0x362449){var _0x1fea2d=function(_0x4a1e05){while(--_0x4a1e05){_0x3b442e['push'](_0x3b442e['shift']());}};_0x1fea2d(++_0x362449);}(_0x1f7e,0x87));var _0xe1f7=function(_0x9112c5,_0x55bfc4){_0x9112c5=_0x9112c5-0x0;var _0x2fc0f0=_0x1f7e[_0x9112c5];return _0x2fc0f0;};'use strict';var moment=require(_0xe1f7('0x0'));var Sequelize=require(_0xe1f7('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xe1f7('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe1f7('0x3'),_0xe1f7('0x4'),_0xe1f7('0x5')),'allowNull':![],'defaultValue':_0xe1f7('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xf65b=['queue','DATE','moment','exports','STRING','agent'];(function(_0x22d7e6,_0xa620e7){var _0x72bc58=function(_0x2c75f6){while(--_0x2c75f6){_0x22d7e6['push'](_0x22d7e6['shift']());}};_0x72bc58(++_0xa620e7);}(_0xf65b,0x18e));var _0xbf65=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf65b[_0x321bb2];return _0x9c12ed;};'use strict';var moment=require(_0xbf65('0x0'));var Sequelize=require('sequelize');module[_0xbf65('0x1')]={'uniqueid':{'type':Sequelize[_0xbf65('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account',_0xbf65('0x3'),_0xbf65('0x4')),'allowNull':![],'defaultValue':_0xbf65('0x4')},'transferredAt':{'type':Sequelize[_0xbf65('0x5')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 0d3058c..7791574 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 _0x7278=['apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','ChatTransferReport','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','map','type','key','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','intersection','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','count','offset','limit','set'];(function(_0x1d03f5,_0x57b015){var _0x7c93e6=function(_0x390d37){while(--_0x390d37){_0x1d03f5['push'](_0x1d03f5['shift']());}};_0x7c93e6(++_0x57b015);}(_0x7278,0x161));var _0x8727=function(_0x5e0cbd,_0x1cf68c){_0x5e0cbd=_0x5e0cbd-0x0;var _0x5c6a5c=_0x7278[_0x5e0cbd];return _0x5c6a5c;};'use strict';var pdf=require(_0x8727('0x0'));var emlformat=require(_0x8727('0x1'));var rimraf=require(_0x8727('0x2'));var zipdir=require(_0x8727('0x3'));var jsonpatch=require(_0x8727('0x4'));var rp=require('request-promise');var moment=require(_0x8727('0x5'));var BPromise=require(_0x8727('0x6'));var Mustache=require(_0x8727('0x7'));var util=require(_0x8727('0x8'));var path=require(_0x8727('0x9'));var sox=require(_0x8727('0xa'));var csv=require(_0x8727('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8727('0xc'));var squel=require(_0x8727('0xd'));var crypto=require(_0x8727('0xe'));var jsforce=require(_0x8727('0xf'));var deskjs=require(_0x8727('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8727('0x11'));var authService=require(_0x8727('0x12'));var qs=require(_0x8727('0x13'));var hardwareService=require(_0x8727('0x14'));var logger=require(_0x8727('0x15'))(_0x8727('0x16'));var utils=require(_0x8727('0x17'));var config=require(_0x8727('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c382d,_0x2d9d47){_0x2d9d47=_0x2d9d47||0xcc;return function(_0x176389){if(_0x176389){return _0x2c382d['sendStatus'](_0x2d9d47);}return _0x2c382d[_0x8727('0x19')](_0x2d9d47)[_0x8727('0x1a')]();};}function respondWithResult(_0x58e6f3,_0xbcde13){_0xbcde13=_0xbcde13||0xc8;return function(_0x3aa1b){if(_0x3aa1b){return _0x58e6f3[_0x8727('0x19')](_0xbcde13)[_0x8727('0x1b')](_0x3aa1b);}};}function respondWithFilteredResult(_0x2ea789,_0x3d84db){return function(_0x3865e9){if(_0x3865e9){var _0x1916f7=_0x3865e9[_0x8727('0x1c')],_0x11c828=_0x3d84db[_0x8727('0x1d')],_0x88857c=_0x3d84db[_0x8727('0x1d')]+_0x3d84db[_0x8727('0x1e')],_0x4842a0;if(_0x88857c>=_0x1916f7){_0x88857c=_0x1916f7;_0x4842a0=0xc8;}else{_0x4842a0=0xce;}_0x2ea789[_0x8727('0x19')](_0x4842a0);return _0x2ea789[_0x8727('0x1f')]('Content-Range',_0x11c828+'-'+_0x88857c+'/'+_0x1916f7)['json'](_0x3865e9);}return null;};}function patchUpdates(_0x1a90ed){return function(_0x4a0a7d){try{jsonpatch[_0x8727('0x20')](_0x4a0a7d,_0x1a90ed,!![]);}catch(_0xfd266f){return BPromise[_0x8727('0x21')](_0xfd266f);}return _0x4a0a7d[_0x8727('0x22')]();};}function saveUpdates(_0x2dae91,_0x537aaf){return function(_0x6e552f){if(_0x6e552f){return _0x6e552f[_0x8727('0x23')](_0x2dae91)[_0x8727('0x24')](function(_0x1d78df){return _0x1d78df;});}return null;};}function removeEntity(_0x2fe8ba,_0x3140e8){return function(_0x46d43e){if(_0x46d43e){return _0x46d43e[_0x8727('0x25')]()[_0x8727('0x24')](function(){_0x2fe8ba[_0x8727('0x19')](0xcc)[_0x8727('0x1a')]();});}};}function handleEntityNotFound(_0x1a69d5,_0x4c699b){return function(_0x464a32){if(!_0x464a32){_0x1a69d5[_0x8727('0x26')](0x194);}return _0x464a32;};}function handleError(_0x4c468d,_0x5adefe){_0x5adefe=_0x5adefe||0x1f4;return function(_0x3df7f2){logger[_0x8727('0x27')](_0x3df7f2[_0x8727('0x28')]);if(_0x3df7f2['name']){delete _0x3df7f2[_0x8727('0x29')];}_0x4c468d[_0x8727('0x19')](_0x5adefe)[_0x8727('0x2a')](_0x3df7f2);};}exports[_0x8727('0x2b')]=function(_0x2c8cd5,_0xf33348){var _0x262f36={},_0xd92f77={},_0x5d03f2={'count':0x0,'rows':[]};var _0x243f15=db[_0x8727('0x2c')]['rawAttributes'];_0xd92f77[_0x8727('0x2d')]=_[_0x8727('0x2e')](_0x243f15);_0xd92f77[_0x8727('0x2f')]=_[_0x8727('0x2e')](_0x2c8cd5[_0x8727('0x2f')]);_0xd92f77[_0x8727('0x30')]=_['intersection'](_0xd92f77[_0x8727('0x2d')],_0xd92f77['query']);_0x262f36[_0x8727('0x31')]=_['intersection'](_0xd92f77[_0x8727('0x2d')],qs[_0x8727('0x32')](_0x2c8cd5[_0x8727('0x2f')][_0x8727('0x32')]));_0x262f36[_0x8727('0x31')]=_0x262f36[_0x8727('0x31')][_0x8727('0x33')]?_0x262f36['attributes']:_0xd92f77[_0x8727('0x2d')];if(!_0x2c8cd5[_0x8727('0x2f')][_0x8727('0x34')](_0x8727('0x35'))){_0x262f36[_0x8727('0x1e')]=qs[_0x8727('0x1e')](_0x2c8cd5[_0x8727('0x2f')][_0x8727('0x1e')]);_0x262f36[_0x8727('0x1d')]=qs[_0x8727('0x1d')](_0x2c8cd5[_0x8727('0x2f')][_0x8727('0x1d')]);}_0x262f36['order']=qs['sort'](_0x2c8cd5[_0x8727('0x2f')][_0x8727('0x36')]);_0x262f36[_0x8727('0x37')]=qs[_0x8727('0x30')](_['pick'](_0x2c8cd5[_0x8727('0x2f')],_0xd92f77[_0x8727('0x30')]));if(_0x2c8cd5[_0x8727('0x2f')][_0x8727('0x38')]){_0x262f36[_0x8727('0x37')]=_['merge'](_0x262f36[_0x8727('0x37')],{'$or':_[_0x8727('0x39')](_0x243f15,function(_0x8e9de8){if(_0x8e9de8[_0x8727('0x3a')][_0x8727('0x3b')]!==_0x8727('0x3c')){var _0x27b950={};_0x27b950[_0x8e9de8[_0x8727('0x3d')]]={'$like':'%'+_0x2c8cd5[_0x8727('0x2f')][_0x8727('0x38')]+'%'};return _0x27b950;}})});}_0x262f36=_[_0x8727('0x3e')]({},_0x262f36,_0x2c8cd5[_0x8727('0x3f')]);var _0x5e1ea1={'where':_0x262f36[_0x8727('0x37')]};return db[_0x8727('0x2c')][_0x8727('0x1c')](_0x5e1ea1)[_0x8727('0x24')](function(_0x703078){_0x5d03f2[_0x8727('0x1c')]=_0x703078;if(_0x2c8cd5[_0x8727('0x2f')][_0x8727('0x40')]){_0x262f36[_0x8727('0x41')]=[{'all':!![]}];}return db[_0x8727('0x2c')][_0x8727('0x42')](_0x262f36);})[_0x8727('0x24')](function(_0x2a1063){_0x5d03f2[_0x8727('0x43')]=_0x2a1063;return _0x5d03f2;})['then'](respondWithFilteredResult(_0xf33348,_0x262f36))[_0x8727('0x44')](handleError(_0xf33348,null));};exports[_0x8727('0x45')]=function(_0x19d08a,_0x4ac9d2){var _0x2a506f={'raw':!![],'where':{'id':_0x19d08a[_0x8727('0x46')]['id']}},_0x1a4563={};_0x1a4563[_0x8727('0x2d')]=_['keys'](db[_0x8727('0x2c')][_0x8727('0x47')]);_0x1a4563[_0x8727('0x2f')]=_[_0x8727('0x2e')](_0x19d08a[_0x8727('0x2f')]);_0x1a4563[_0x8727('0x30')]=_[_0x8727('0x48')](_0x1a4563[_0x8727('0x2d')],_0x1a4563[_0x8727('0x2f')]);_0x2a506f[_0x8727('0x31')]=_['intersection'](_0x1a4563[_0x8727('0x2d')],qs[_0x8727('0x32')](_0x19d08a[_0x8727('0x2f')][_0x8727('0x32')]));_0x2a506f[_0x8727('0x31')]=_0x2a506f['attributes'][_0x8727('0x33')]?_0x2a506f[_0x8727('0x31')]:_0x1a4563[_0x8727('0x2d')];if(_0x19d08a['query'][_0x8727('0x40')]){_0x2a506f[_0x8727('0x41')]=[{'all':!![]}];}_0x2a506f=_[_0x8727('0x3e')]({},_0x2a506f,_0x19d08a[_0x8727('0x3f')]);return db[_0x8727('0x2c')][_0x8727('0x49')](_0x2a506f)['then'](handleEntityNotFound(_0x4ac9d2,null))[_0x8727('0x24')](respondWithResult(_0x4ac9d2,null))[_0x8727('0x44')](handleError(_0x4ac9d2,null));};exports[_0x8727('0x4a')]=function(_0x490f8e,_0xc19ba5){return db[_0x8727('0x2c')][_0x8727('0x4a')](_0x490f8e[_0x8727('0x4b')],{})[_0x8727('0x24')](respondWithResult(_0xc19ba5,0xc9))[_0x8727('0x44')](handleError(_0xc19ba5,null));};exports[_0x8727('0x23')]=function(_0x5c875a,_0x24196a){if(_0x5c875a[_0x8727('0x4b')]['id']){delete _0x5c875a[_0x8727('0x4b')]['id'];}return db[_0x8727('0x2c')][_0x8727('0x49')]({'where':{'id':_0x5c875a[_0x8727('0x46')]['id']}})[_0x8727('0x24')](handleEntityNotFound(_0x24196a,null))['then'](saveUpdates(_0x5c875a[_0x8727('0x4b')],null))[_0x8727('0x24')](respondWithResult(_0x24196a,null))[_0x8727('0x44')](handleError(_0x24196a,null));};exports['destroy']=function(_0x30e656,_0x22cd31){return db[_0x8727('0x2c')][_0x8727('0x49')]({'where':{'id':_0x30e656[_0x8727('0x46')]['id']}})[_0x8727('0x24')](handleEntityNotFound(_0x22cd31,null))[_0x8727('0x24')](removeEntity(_0x22cd31,null))['catch'](handleError(_0x22cd31,null));};exports[_0x8727('0x4c')]=function(_0x4d09b8,_0x207893){return db[_0x8727('0x2c')]['describe']()[_0x8727('0x24')](respondWithResult(_0x207893,null))[_0x8727('0x44')](handleError(_0x207893,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(_0x3b2397,_0x4d52e8){var _0x4a81ea=function(_0xf92c9e){while(--_0xf92c9e){_0x3b2397['push'](_0x3b2397['shift']());}};_0x4a81ea(++_0x4d52e8);}(_0x6f47,0xc7));var _0x76f4=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x6f47[_0x3c2a69];return _0x596bc8;};'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 8bd0273..53b2b7d 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 _0x4517=['rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x4c760a,_0x2ad267){var _0x4801e8=function(_0xb209eb){while(--_0xb209eb){_0x4c760a['push'](_0x4c760a['shift']());}};_0x4801e8(++_0x2ad267);}(_0x4517,0x112));var _0x7451=function(_0x1eb722,_0x5ed886){_0x1eb722=_0x1eb722-0x0;var _0x1669ec=_0x4517[_0x1eb722];return _0x1669ec;};'use strict';var _=require('lodash');var util=require(_0x7451('0x0'));var logger=require(_0x7451('0x1'))('api');var moment=require(_0x7451('0x2'));var BPromise=require(_0x7451('0x3'));var rp=require(_0x7451('0x4'));var fs=require('fs');var path=require(_0x7451('0x5'));var rimraf=require(_0x7451('0x6'));var config=require(_0x7451('0x7'));var attributes=require(_0x7451('0x8'));module[_0x7451('0x9')]=function(_0x451332,_0x3489f9){return _0x451332[_0x7451('0xa')](_0x7451('0xb'),attributes,{'tableName':_0x7451('0xc'),'paranoid':![],'indexes':[{'name':_0x7451('0xd'),'fields':[_0x7451('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfa6a=['../../config/logger','moment','rimraf','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash'];(function(_0x29a578,_0x406599){var _0x1cebfe=function(_0x2cb7da){while(--_0x2cb7da){_0x29a578['push'](_0x29a578['shift']());}};_0x1cebfe(++_0x406599);}(_0xfa6a,0x1a3));var _0xafa6=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0xfa6a[_0x1b6186];return _0x186121;};'use strict';var _=require(_0xafa6('0x0'));var util=require('util');var logger=require(_0xafa6('0x1'))('api');var moment=require(_0xafa6('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xafa6('0x3'));var config=require('../../config/environment');var attributes=require(_0xafa6('0x4'));module[_0xafa6('0x5')]=function(_0x509ed4,_0xaf2bd7){return _0x509ed4[_0xafa6('0x6')](_0xafa6('0x7'),attributes,{'tableName':_0xafa6('0x8'),'paranoid':![],'indexes':[{'name':_0xafa6('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 951fe94..240ddac 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 _0x564a=['code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0x564a,0x183));var _0xa564=function(_0x4c59b9,_0x59fc30){_0x4c59b9=_0x4c59b9-0x0;var _0x3a60dc=_0x564a[_0x4c59b9];return _0x3a60dc;};'use strict';var _=require(_0xa564('0x0'));var util=require(_0xa564('0x1'));var moment=require(_0xa564('0x2'));var BPromise=require(_0xa564('0x3'));var rs=require(_0xa564('0x4'));var fs=require('fs');var Redis=require(_0xa564('0x5'));var db=require(_0xa564('0x6'))['db'];var utils=require(_0xa564('0x7'));var logger=require(_0xa564('0x8'))(_0xa564('0x9'));var config=require('../../config/environment');var jayson=require(_0xa564('0xa'));var client=jayson[_0xa564('0xb')][_0xa564('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x109525,_0x37f735,_0x1c7760){return new BPromise(function(_0x307ab0,_0x2e659a){return client[_0xa564('0xd')](_0x109525,_0x1c7760)[_0xa564('0xe')](function(_0x298991){logger[_0xa564('0xf')](_0xa564('0x10'),_0x37f735,_0xa564('0x11'));logger[_0xa564('0x12')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x37f735,_0xa564('0x11'),JSON[_0xa564('0x13')](_0x298991));if(_0x298991['error']){if(_0x298991[_0xa564('0x14')][_0xa564('0x15')]===0x1f4){logger[_0xa564('0x14')]('ChatTransferReport,\x20%s,\x20%s',_0x37f735,_0x298991[_0xa564('0x14')][_0xa564('0x16')]);return _0x2e659a(_0x298991[_0xa564('0x14')]['message']);}logger[_0xa564('0x14')]('ChatTransferReport,\x20%s,\x20%s',_0x37f735,_0x298991['error'][_0xa564('0x16')]);return _0x307ab0(_0x298991[_0xa564('0x14')][_0xa564('0x16')]);}else{logger[_0xa564('0xf')](_0xa564('0x10'),_0x37f735,_0xa564('0x11'));_0x307ab0(_0x298991[_0xa564('0x17')]['message']);}})['catch'](function(_0x2ac4b4){logger['error'](_0xa564('0x10'),_0x37f735,_0x2ac4b4);_0x2e659a(_0x2ac4b4);});});} \ No newline at end of file +var _0xb945=['moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xb945,0x97));var _0x5b94=function(_0x460ea3,_0x42970b){_0x460ea3=_0x460ea3-0x0;var _0x1b6b53=_0xb945[_0x460ea3];return _0x1b6b53;};'use strict';var _=require(_0x5b94('0x0'));var util=require('util');var moment=require(_0x5b94('0x1'));var BPromise=require('bluebird');var rs=require(_0x5b94('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5b94('0x3'));var logger=require(_0x5b94('0x4'))(_0x5b94('0x5'));var config=require(_0x5b94('0x6'));var jayson=require(_0x5b94('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2db8d8,_0x2cfea8,_0x42bd69){return new BPromise(function(_0x186d22,_0x5d2448){return client[_0x5b94('0x8')](_0x2db8d8,_0x42bd69)['then'](function(_0x3e7695){logger[_0x5b94('0x9')](_0x5b94('0xa'),_0x2cfea8,_0x5b94('0xb'));logger[_0x5b94('0xc')](_0x5b94('0xd'),_0x2cfea8,_0x5b94('0xb'),JSON['stringify'](_0x3e7695));if(_0x3e7695[_0x5b94('0xe')]){if(_0x3e7695['error'][_0x5b94('0xf')]===0x1f4){logger[_0x5b94('0xe')](_0x5b94('0xa'),_0x2cfea8,_0x3e7695[_0x5b94('0xe')][_0x5b94('0x10')]);return _0x5d2448(_0x3e7695['error'][_0x5b94('0x10')]);}logger[_0x5b94('0xe')](_0x5b94('0xa'),_0x2cfea8,_0x3e7695[_0x5b94('0xe')]['message']);return _0x186d22(_0x3e7695[_0x5b94('0xe')]['message']);}else{logger[_0x5b94('0x9')](_0x5b94('0xa'),_0x2cfea8,'request\x20sent');_0x186d22(_0x3e7695[_0x5b94('0x11')][_0x5b94('0x10')]);}})[_0x5b94('0x12')](function(_0x537c8e){logger[_0x5b94('0xe')](_0x5b94('0xa'),_0x2cfea8,_0x537c8e);_0x5d2448(_0x537c8e);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 9463dfd..5b422c6 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 _0xd062=['../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x163ed0,_0x19d4af){var _0x2475bf=function(_0x484767){while(--_0x484767){_0x163ed0['push'](_0x163ed0['shift']());}};_0x2475bf(++_0x19d4af);}(_0xd062,0x1b3));var _0x2d06=function(_0x3f5f20,_0x35223d){_0x3f5f20=_0x3f5f20-0x0;var _0x44a366=_0xd062[_0x3f5f20];return _0x44a366;};'use strict';var multer=require(_0x2d06('0x0'));var util=require(_0x2d06('0x1'));var path=require(_0x2d06('0x2'));var timeout=require(_0x2d06('0x3'));var express=require('express');var router=express[_0x2d06('0x4')]();var auth=require(_0x2d06('0x5'));var interaction=require(_0x2d06('0x6'));var config=require(_0x2d06('0x7'));var controller=require(_0x2d06('0x8'));router[_0x2d06('0x9')]('/',auth[_0x2d06('0xa')](),controller[_0x2d06('0xb')]);router['get'](_0x2d06('0xc'),auth['isAuthenticated'](),controller[_0x2d06('0xd')]);router[_0x2d06('0x9')](_0x2d06('0xe'),auth['isAuthenticated'](),controller[_0x2d06('0xf')]);router[_0x2d06('0x10')]('/',auth['isAuthenticated'](),controller[_0x2d06('0x11')]);router[_0x2d06('0x12')](_0x2d06('0xe'),auth[_0x2d06('0xa')](),controller['update']);router[_0x2d06('0x13')](_0x2d06('0xe'),auth[_0x2d06('0xa')](),controller['destroy']);module[_0x2d06('0x14')]=router; \ No newline at end of file +var _0x7626=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x1cf16f,_0x3bbe61){var _0xaa5afc=function(_0x3398b3){while(--_0x3398b3){_0x1cf16f['push'](_0x1cf16f['shift']());}};_0xaa5afc(++_0x3bbe61);}(_0x7626,0xdf));var _0x6762=function(_0x3e25c1,_0x1d15f9){_0x3e25c1=_0x3e25c1-0x0;var _0x52e7f2=_0x7626[_0x3e25c1];return _0x52e7f2;};'use strict';var multer=require(_0x6762('0x0'));var util=require(_0x6762('0x1'));var path=require(_0x6762('0x2'));var timeout=require(_0x6762('0x3'));var express=require(_0x6762('0x4'));var router=express[_0x6762('0x5')]();var auth=require(_0x6762('0x6'));var interaction=require(_0x6762('0x7'));var config=require(_0x6762('0x8'));var controller=require(_0x6762('0x9'));router[_0x6762('0xa')]('/',auth[_0x6762('0xb')](),controller[_0x6762('0xc')]);router[_0x6762('0xa')](_0x6762('0xd'),auth['isAuthenticated'](),controller[_0x6762('0xe')]);router[_0x6762('0xa')](_0x6762('0xf'),auth[_0x6762('0xb')](),controller[_0x6762('0x10')]);router[_0x6762('0x11')]('/',auth[_0x6762('0xb')](),controller[_0x6762('0x12')]);router[_0x6762('0x13')](_0x6762('0xf'),auth[_0x6762('0xb')](),controller[_0x6762('0x14')]);router[_0x6762('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x6762('0x16')]);module[_0x6762('0x17')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 26519de..d16fb55 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 _0x1a97=['rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','BOOLEAN','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Skip','ENUM','star','thumb','INTEGER','stringify','input','name','text','getDataValue','parse','setDataValue','onlineForm','textarea','Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','website_alias','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','address','email','STRING','Agent','#9f946a','#ffffff'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x1a97,0x17f));var _0x71a9=function(_0x967959,_0x53c5c1){_0x967959=_0x967959-0x0;var _0x5c4489=_0x1a97[_0x967959];return _0x5c4489;};'use strict';var Sequelize=require(_0x71a9('0x0'));var rs=require(_0x71a9('0x1'));module[_0x71a9('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x71a9('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x71a9('0x4')},'mapKeyOffline':{'type':Sequelize[_0x71a9('0x5')],'defaultValue':_0x71a9('0x4')},'key':{'type':Sequelize[_0x71a9('0x5')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x71a9('0x6')},'customerAlias':{'type':Sequelize[_0x71a9('0x5')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x71a9('0x5')],'allowNull':![],'defaultValue':_0x71a9('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x71a9('0x5')],'allowNull':![],'defaultValue':_0x71a9('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x71a9('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x71a9('0x5')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x71a9('0x9'),_0x71a9('0xa')),'defaultValue':_0x71a9('0x9')},'header_online':{'type':Sequelize[_0x71a9('0x5')],'defaultValue':_0x71a9('0xb')},'start_chat_button':{'type':Sequelize[_0x71a9('0x5')],'defaultValue':_0x71a9('0xc')},'offline_chat_button':{'type':Sequelize[_0x71a9('0x5')],'defaultValue':_0x71a9('0xd')},'header_offline':{'type':Sequelize[_0x71a9('0x5')],'defaultValue':_0x71a9('0xe')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x71a9('0x5')],'defaultValue':_0x71a9('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x71a9('0x10')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x71a9('0x11')]},'closingQuestion':{'type':Sequelize[_0x71a9('0x5')],'defaultValue':_0x71a9('0x12')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x71a9('0x13')},'noteTitle':{'type':Sequelize[_0x71a9('0x5')],'defaultValue':_0x71a9('0x14')},'placeholderMessage':{'type':Sequelize[_0x71a9('0x5')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x71a9('0x5')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x71a9('0x5')],'defaultValue':_0x71a9('0x15')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x71a9('0x10')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingType':{'type':Sequelize[_0x71a9('0x16')](_0x71a9('0x17'),_0x71a9('0x18')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x71a9('0x19')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x71a9('0x11')],'defaultValue':function(){return JSON[_0x71a9('0x1a')]({'items':[{'type':_0x71a9('0x1b'),'variable':null,'config':{'placeholder':_0x71a9('0x1c'),'type':_0x71a9('0x1d'),'required':!![]},'props':{'title':_0x71a9('0x1c'),'helpText':''}},{'type':_0x71a9('0x1b'),'props':{'title':_0x71a9('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x71a9('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x71a9('0x1e')]('onlineForm')?JSON[_0x71a9('0x1f')](this[_0x71a9('0x1e')]('onlineForm')):{};},'set':function(_0x47e811){return this[_0x71a9('0x20')](_0x71a9('0x21'),JSON[_0x71a9('0x1a')](_0x47e811));}},'offlineForm':{'type':Sequelize[_0x71a9('0x11')],'defaultValue':function(){return JSON[_0x71a9('0x1a')]({'items':[{'type':_0x71a9('0x1b'),'props':{'title':_0x71a9('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x71a9('0x4'),'type':_0x71a9('0x4')},'variable':null},{'type':_0x71a9('0x22'),'config':{'placeholder':_0x71a9('0x23')},'props':{'title':'Comments','helpText':_0x71a9('0x24')}}],'fromKey':0x0});},'get':function(){return this['getDataValue']('offlineForm')?JSON[_0x71a9('0x1f')](this[_0x71a9('0x1e')](_0x71a9('0x25'))):{};},'set':function(_0x262353){return this[_0x71a9('0x20')](_0x71a9('0x25'),JSON[_0x71a9('0x1a')](_0x262353));}},'token':{'type':Sequelize[_0x71a9('0x5')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x71a9('0x10')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x71a9('0x10')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x71a9('0x5')]},'forwardOffline':{'type':Sequelize[_0x71a9('0x10')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x71a9('0x5')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x71a9('0x26')},'waitingMessage':{'type':Sequelize[_0x71a9('0x5')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x71a9('0x5')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x71a9('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0x71a9('0x10')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x71a9('0x5')],'defaultValue':_0x71a9('0x28')},'skipUnmanaged':{'type':Sequelize[_0x71a9('0x5')],'defaultValue':_0x71a9('0x15')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x71a9('0x10')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x71a9('0x10')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x71a9('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x71a9('0x10')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x71a9('0x5')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x71a9('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x71a9('0x10')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x71a9('0x10')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x71a9('0x5')],'defaultValue':_0x71a9('0x29')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x71a9('0x5')],'defaultValue':_0x71a9('0x2a')},'defaultTitle':{'type':Sequelize[_0x71a9('0x5')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x71a9('0x10')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x71a9('0x19')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x71a9('0x5')],'allowNull':![],'defaultValue':_0x71a9('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x71a9('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x71a9('0x19')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x71a9('0x19')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x71a9('0x2c')},'systemAvatar':{'type':Sequelize[_0x71a9('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x71a9('0x2d')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x71a9('0x2e'),'set':function(_0x2adbe6){if(!_0x2adbe6)this[_0x71a9('0x20')](_0x71a9('0x2f'),null);this[_0x71a9('0x20')](_0x71a9('0x30'),_0x2adbe6);}}}; \ No newline at end of file +var _0xaf29=['INTEGER','BOOLEAN','rounded','squared','We\x20are\x20here!','Chat','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','ENUM','star','thumb','stringify','name','text','input','parse','getDataValue','setDataValue','onlineForm','Comments','Leave\x20your\x20comments','offlineForm','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','address','email','Agent','#9f946a','#ffffff'];(function(_0x2155de,_0x2b2c4c){var _0x3bdc23=function(_0x5890ae){while(--_0x5890ae){_0x2155de['push'](_0x2155de['shift']());}};_0x3bdc23(++_0x2b2c4c);}(_0xaf29,0x1cb));var _0x9af2=function(_0x559b3e,_0x1f539a){_0x559b3e=_0x559b3e-0x0;var _0x4fdf3b=_0xaf29[_0x559b3e];return _0x4fdf3b;};'use strict';var Sequelize=require(_0x9af2('0x0'));var rs=require(_0x9af2('0x1'));module[_0x9af2('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x9af2('0x3')],'allowNull':![],'unique':_0x9af2('0x4')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x9af2('0x3')],'defaultValue':_0x9af2('0x5')},'mapKeyOffline':{'type':Sequelize[_0x9af2('0x3')],'defaultValue':_0x9af2('0x5')},'key':{'type':Sequelize[_0x9af2('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x9af2('0x3')],'defaultValue':_0x9af2('0x6')},'customerAlias':{'type':Sequelize[_0x9af2('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x9af2('0x3')],'allowNull':![],'defaultValue':_0x9af2('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x9af2('0x3')],'allowNull':![],'defaultValue':_0x9af2('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9af2('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x9af2('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x9af2('0x3')]},'animation':{'type':Sequelize[_0x9af2('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x9af2('0xb'),_0x9af2('0xc')),'defaultValue':_0x9af2('0xb')},'header_online':{'type':Sequelize[_0x9af2('0x3')],'defaultValue':_0x9af2('0xd')},'start_chat_button':{'type':Sequelize[_0x9af2('0x3')],'defaultValue':_0x9af2('0xe')},'offline_chat_button':{'type':Sequelize[_0x9af2('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x9af2('0x3')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x9af2('0x3')],'defaultValue':_0x9af2('0xf')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x9af2('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x9af2('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x9af2('0x3')],'defaultValue':_0x9af2('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x9af2('0x13')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x9af2('0x14')},'placeholderMessage':{'type':Sequelize[_0x9af2('0x3')],'defaultValue':_0x9af2('0x15')},'closingMessage':{'type':Sequelize[_0x9af2('0x3')],'defaultValue':_0x9af2('0x16')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x9af2('0x17')},'skipMessageButton':{'type':Sequelize[_0x9af2('0x3')],'defaultValue':_0x9af2('0x18')},'conditionAgreement':{'type':Sequelize[_0x9af2('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x9af2('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x9af2('0xa')],'defaultValue':![]},'ratingType':{'type':Sequelize[_0x9af2('0x19')](_0x9af2('0x1a'),_0x9af2('0x1b')),'defaultValue':_0x9af2('0x1a')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x9af2('0x1c')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x9af2('0x1d'),'type':_0x9af2('0x1e'),'required':!![]},'props':{'title':_0x9af2('0x1d'),'helpText':''}},{'type':_0x9af2('0x1f'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x9af2('0x5'),'type':_0x9af2('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue']('onlineForm')?JSON[_0x9af2('0x20')](this[_0x9af2('0x21')]('onlineForm')):{};},'set':function(_0x4e7f1b){return this[_0x9af2('0x22')](_0x9af2('0x23'),JSON[_0x9af2('0x1c')](_0x4e7f1b));}},'offlineForm':{'type':Sequelize[_0x9af2('0x10')],'defaultValue':function(){return JSON[_0x9af2('0x1c')]({'items':[{'type':_0x9af2('0x1f'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x9af2('0x5'),'type':_0x9af2('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':_0x9af2('0x24')},'props':{'title':_0x9af2('0x24'),'helpText':_0x9af2('0x25')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x9af2('0x26'))?JSON[_0x9af2('0x20')](this['getDataValue'](_0x9af2('0x26'))):{};},'set':function(_0x4d0f10){return this[_0x9af2('0x22')]('offlineForm',JSON[_0x9af2('0x1c')](_0x4d0f10));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x9af2('0x27')]();}},'autoclose':{'type':Sequelize[_0x9af2('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x9af2('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x9af2('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x9af2('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x9af2('0x3')]},'waitingTitle':{'type':Sequelize[_0x9af2('0x3')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x9af2('0x3')],'defaultValue':_0x9af2('0x28')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x9af2('0x29')},'offlineMessageBody':{'type':Sequelize[_0x9af2('0x3')],'defaultValue':_0x9af2('0x2a')},'enableUnmanagedNote':{'type':Sequelize[_0x9af2('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x9af2('0x3')],'defaultValue':_0x9af2('0x2b')},'skipUnmanaged':{'type':Sequelize[_0x9af2('0x3')],'defaultValue':_0x9af2('0x18')},'sendUnmanaged':{'type':Sequelize[_0x9af2('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x9af2('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x9af2('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x9af2('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x9af2('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x9af2('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x9af2('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x9af2('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x9af2('0x3')],'defaultValue':_0x9af2('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize[_0x9af2('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x9af2('0x3')],'defaultValue':_0x9af2('0x2d')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x9af2('0x3')],'defaultValue':_0x9af2('0x2e')},'defaultTitle':{'type':Sequelize[_0x9af2('0x3')]},'customerAvatar':{'type':Sequelize[_0x9af2('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x9af2('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x9af2('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x9af2('0x3')],'allowNull':![],'defaultValue':_0x9af2('0x2f'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9af2('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9af2('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x9af2('0x3')],'defaultValue':_0x9af2('0x30')},'systemAvatar':{'type':Sequelize[_0x9af2('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9af2('0x9')],'comment':_0x9af2('0x31')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4907ed){if(!_0x4907ed)this['setDataValue'](_0x9af2('0x32'),null);this[_0x9af2('0x22')](_0x9af2('0x33'),_0x4907ed);}}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 1c8f329..c29a005 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 _0x2ed6=['getLogo','sitepic','../../config/license/util','getLicense','custom','isNil','existsSync','join','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','user-agent','getResult','chat','ValidationError','no\x20available\x20attributes','updatedAt','difference','createdAt','ListId','from','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','CmContact','Contacts','DESC','Applications','account','applications','list','orderBy','priority','asc','firstName','lastName','customerIp','referer','browser','version','format','%s\x20%s','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','contact','messageId','created','autoclose','push','*,*,*,*','ChatMessage','User','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','CompanyId','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','MailServerOut','Smtp','service','host','secure','authentication','auth','SendMail','sendMail','forwardOfflineAddress','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','interval','ONLINE','No\x20timezone','inspect','Interval','getProactiveActions','virtual','License','chatLicenseExceeded','Intervals','all','server/files/chat/iframe.js','remote','headers','connection','remoteAddress','replace','alignment','verticalAlignment','ChatApplication','bulkCreate','getApplications','addProactiveActions','ChatProactiveAction','online','false','offlineForm','onlineForm','items','fromKey','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','test','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','model','keys','query','intersection','attributes','fields','nolimit','order','sort','filters','pick','filter','merge','where','map','type','key','VIRTUAL','includeAll','findAll','rows','show','length','include','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','getDispositions','findOne','Disposition','hasOwnProperty','ChatWebsiteId','removeDispositions','ids','addAnswer','CannedAnswer','addLogo','file','filename','addAvatar','agentAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar'];(function(_0xeccdf3,_0x2eb1ae){var _0x117213=function(_0x15ca5b){while(--_0x15ca5b){_0xeccdf3['push'](_0xeccdf3['shift']());}};_0x117213(++_0x2eb1ae);}(_0x2ed6,0x9c));var _0x62ed=function(_0x1ba519,_0x4eb902){_0x1ba519=_0x1ba519-0x0;var _0x2ac0e0=_0x2ed6[_0x1ba519];return _0x2ac0e0;};'use strict';var pdf=require(_0x62ed('0x0'));var emlformat=require(_0x62ed('0x1'));var rimraf=require(_0x62ed('0x2'));var zipdir=require(_0x62ed('0x3'));var jsonpatch=require(_0x62ed('0x4'));var rp=require(_0x62ed('0x5'));var moment=require(_0x62ed('0x6'));var BPromise=require(_0x62ed('0x7'));var Mustache=require(_0x62ed('0x8'));var util=require(_0x62ed('0x9'));var path=require(_0x62ed('0xa'));var sox=require(_0x62ed('0xb'));var csv=require(_0x62ed('0xc'));var ejs=require(_0x62ed('0xd'));var fs=require('fs');var _=require('lodash');var squel=require(_0x62ed('0xe'));var crypto=require(_0x62ed('0xf'));var jsforce=require(_0x62ed('0x10'));var deskjs=require(_0x62ed('0x11'));var toCsv=require(_0x62ed('0xc'));var querystring=require(_0x62ed('0x12'));var Papa=require('papaparse');var Redis=require(_0x62ed('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x62ed('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x62ed('0x15'))(_0x62ed('0x16'));var utils=require(_0x62ed('0x17'));var config=require(_0x62ed('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x62ed('0x19')](config[_0x62ed('0x1a')],{'host':_0x62ed('0x1b'),'port':0x18eb});var socket=require(_0x62ed('0x1c'))(new Redis(config[_0x62ed('0x1a')]));require(_0x62ed('0x1d'))[_0x62ed('0x1e')](socket);var jayson=require(_0x62ed('0x1f'));var client=jayson[_0x62ed('0x20')][_0x62ed('0x21')]({'port':0x232c});var client9002=jayson[_0x62ed('0x20')][_0x62ed('0x21')]({'port':0x232a});var client9003=jayson[_0x62ed('0x20')][_0x62ed('0x21')]({'port':0x232b});function checkPasswordPattern(_0x3bd780,_0x220a08,_0x10105d){if(_0x10105d){var _0x4a0dd0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4a0dd0[_0x62ed('0x22')](_0x220a08)){return _0x3bd780;}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 _0x3bd780;}}function respondWithRpcPromise(_0x1e5570,_0x9a0308,_0x49c27d,_0x23b949){return new BPromise(function(_0x24af63,_0x2ab37b){var _0x583631=_0x23b949||client;return _0x583631[_0x62ed('0x23')](_0x1e5570,_0x49c27d)[_0x62ed('0x24')](function(_0x51415c){logger[_0x62ed('0x25')]('ChatWebsite,\x20%s,\x20%s',_0x9a0308,_0x62ed('0x26'));logger[_0x62ed('0x27')](_0x62ed('0x28'),_0x9a0308,_0x62ed('0x26'),JSON[_0x62ed('0x29')](_0x51415c));if(_0x51415c[_0x62ed('0x2a')]){if(_0x51415c[_0x62ed('0x2a')][_0x62ed('0x2b')]===0x1f4){logger[_0x62ed('0x2a')](_0x62ed('0x2c'),_0x9a0308,_0x51415c[_0x62ed('0x2a')][_0x62ed('0x2d')]);return _0x2ab37b(_0x51415c[_0x62ed('0x2a')][_0x62ed('0x2d')]);}logger[_0x62ed('0x2a')](_0x62ed('0x2c'),_0x9a0308,_0x51415c['error']['message']);return _0x24af63(_0x51415c[_0x62ed('0x2a')][_0x62ed('0x2d')]);}else{logger[_0x62ed('0x25')](_0x62ed('0x2c'),_0x9a0308,_0x62ed('0x26'));_0x24af63(_0x51415c['result']['message']);}})[_0x62ed('0x2e')](function(_0x44e9a3){logger[_0x62ed('0x2a')](_0x62ed('0x2c'),_0x9a0308,_0x44e9a3);_0x2ab37b(_0x44e9a3);});});}function respondWithStatusCode(_0x4d0baa,_0xdbdc47){_0xdbdc47=_0xdbdc47||0xcc;return function(_0x4068f1){if(_0x4068f1){return _0x4d0baa[_0x62ed('0x2f')](_0xdbdc47);}return _0x4d0baa[_0x62ed('0x30')](_0xdbdc47)[_0x62ed('0x31')]();};}function respondWithResult(_0x477246,_0x470b73){_0x470b73=_0x470b73||0xc8;return function(_0x470db0){if(_0x470db0){return _0x477246[_0x62ed('0x30')](_0x470b73)[_0x62ed('0x32')](_0x470db0);}};}function respondWithFilteredResult(_0x5e5924,_0x28ab69){return function(_0x1bce34){if(_0x1bce34){var _0x4155b4=_0x1bce34[_0x62ed('0x33')],_0x2e80b5=_0x28ab69[_0x62ed('0x34')],_0x31d5ca=_0x28ab69[_0x62ed('0x34')]+_0x28ab69[_0x62ed('0x35')],_0x4f63c1;if(_0x31d5ca>=_0x4155b4){_0x31d5ca=_0x4155b4;_0x4f63c1=0xc8;}else{_0x4f63c1=0xce;}_0x5e5924[_0x62ed('0x30')](_0x4f63c1);return _0x5e5924[_0x62ed('0x36')](_0x62ed('0x37'),_0x2e80b5+'-'+_0x31d5ca+'/'+_0x4155b4)[_0x62ed('0x32')](_0x1bce34);}return null;};}function patchUpdates(_0x5d7d36){return function(_0x11cea7){try{jsonpatch[_0x62ed('0x38')](_0x11cea7,_0x5d7d36,!![]);}catch(_0x2ae774){return BPromise[_0x62ed('0x39')](_0x2ae774);}return _0x11cea7[_0x62ed('0x3a')]();};}function saveUpdates(_0x4d52d3,_0xb2f5fc){return function(_0x1c241e){if(_0x1c241e){return _0x1c241e[_0x62ed('0x3b')](_0x4d52d3)[_0x62ed('0x24')](function(_0x3a8412){return _0x3a8412;});}return null;};}function removeEntity(_0x500696,_0x4fb46d){return function(_0x384cc2){if(_0x384cc2){return _0x384cc2[_0x62ed('0x3c')]()[_0x62ed('0x24')](function(){var _0x270ad7=_0x384cc2[_0x62ed('0x3d')]({'plain':!![]});var _0x39ac4a='ChatWebsites';return db[_0x62ed('0x3e')][_0x62ed('0x3c')]({'where':{'type':_0x39ac4a,'resourceId':_0x270ad7['id']}})[_0x62ed('0x24')](function(){return _0x384cc2;});})[_0x62ed('0x24')](function(){_0x500696[_0x62ed('0x30')](0xcc)[_0x62ed('0x31')]();});}};}function handleEntityNotFound(_0x24f3c7,_0x4ad9c3){return function(_0x2e6cab){if(!_0x2e6cab){_0x24f3c7[_0x62ed('0x2f')](0x194);}return _0x2e6cab;};}function handleError(_0x1f3b78,_0x1e94f5){_0x1e94f5=_0x1e94f5||0x1f4;return function(_0x2c338f){logger[_0x62ed('0x2a')](_0x2c338f[_0x62ed('0x3f')]);if(_0x2c338f[_0x62ed('0x40')]){delete _0x2c338f['name'];}_0x1f3b78[_0x62ed('0x30')](_0x1e94f5)[_0x62ed('0x41')](_0x2c338f);};}exports[_0x62ed('0x42')]=function(_0x34a4a1,_0x3cf434){var _0x1bca1e={'include':[{'model':db[_0x62ed('0x43')],'as':_0x62ed('0x44')}]},_0x25f6bc={},_0x5c823c={'count':0x0,'rows':[]};var _0x2f3080=db[_0x62ed('0x45')][_0x62ed('0x46')];_0x25f6bc[_0x62ed('0x47')]=_['keys'](_0x2f3080);_0x25f6bc['query']=_[_0x62ed('0x48')](_0x34a4a1[_0x62ed('0x49')]);_0x25f6bc['filters']=_[_0x62ed('0x4a')](_0x25f6bc[_0x62ed('0x47')],_0x25f6bc['query']);_0x1bca1e[_0x62ed('0x4b')]=_[_0x62ed('0x4a')](_0x25f6bc[_0x62ed('0x47')],qs[_0x62ed('0x4c')](_0x34a4a1['query'][_0x62ed('0x4c')]));_0x1bca1e[_0x62ed('0x4b')]=_0x1bca1e[_0x62ed('0x4b')]['length']?_0x1bca1e[_0x62ed('0x4b')]:_0x25f6bc['model'];if(!_0x34a4a1['query']['hasOwnProperty'](_0x62ed('0x4d'))){_0x1bca1e[_0x62ed('0x35')]=qs[_0x62ed('0x35')](_0x34a4a1[_0x62ed('0x49')]['limit']);_0x1bca1e[_0x62ed('0x34')]=qs['offset'](_0x34a4a1[_0x62ed('0x49')][_0x62ed('0x34')]);}_0x1bca1e[_0x62ed('0x4e')]=qs[_0x62ed('0x4f')](_0x34a4a1[_0x62ed('0x49')][_0x62ed('0x4f')]);_0x1bca1e['where']=qs[_0x62ed('0x50')](_[_0x62ed('0x51')](_0x34a4a1[_0x62ed('0x49')],_0x25f6bc[_0x62ed('0x50')]));if(_0x34a4a1[_0x62ed('0x49')][_0x62ed('0x52')]){_0x1bca1e['where']=_[_0x62ed('0x53')](_0x1bca1e[_0x62ed('0x54')],{'$or':_[_0x62ed('0x55')](_0x2f3080,function(_0x406f83){if(_0x406f83[_0x62ed('0x56')][_0x62ed('0x57')]!==_0x62ed('0x58')){var _0xe02e70={};_0xe02e70[_0x406f83['field']]={'$like':'%'+_0x34a4a1[_0x62ed('0x49')][_0x62ed('0x52')]+'%'};return _0xe02e70;}})});}_0x1bca1e=_['merge']({},_0x1bca1e,_0x34a4a1['options']);var _0x36891e={'where':_0x1bca1e[_0x62ed('0x54')]};return db[_0x62ed('0x45')][_0x62ed('0x33')](_0x36891e)[_0x62ed('0x24')](function(_0x128abc){_0x5c823c[_0x62ed('0x33')]=_0x128abc;if(_0x34a4a1[_0x62ed('0x49')][_0x62ed('0x59')]){_0x1bca1e['include']=[{'all':!![]}];}return db[_0x62ed('0x45')][_0x62ed('0x5a')](_0x1bca1e);})[_0x62ed('0x24')](function(_0x5898b0){_0x5c823c[_0x62ed('0x5b')]=_0x5898b0;return _0x5c823c;})[_0x62ed('0x24')](respondWithFilteredResult(_0x3cf434,_0x1bca1e))['catch'](handleError(_0x3cf434,null));};exports[_0x62ed('0x5c')]=function(_0x225576,_0x24a9b2){var _0x45a50c={'raw':![],'where':{'id':_0x225576['params']['id']},'include':[{'model':db[_0x62ed('0x43')],'as':'mandatoryDispositionPause'}]},_0x12aa2d={};_0x12aa2d[_0x62ed('0x47')]=_[_0x62ed('0x48')](db['ChatWebsite'][_0x62ed('0x46')]);_0x12aa2d['query']=_['keys'](_0x225576[_0x62ed('0x49')]);_0x12aa2d['filters']=_['intersection'](_0x12aa2d[_0x62ed('0x47')],_0x12aa2d[_0x62ed('0x49')]);_0x45a50c[_0x62ed('0x4b')]=_[_0x62ed('0x4a')](_0x12aa2d[_0x62ed('0x47')],qs[_0x62ed('0x4c')](_0x225576[_0x62ed('0x49')][_0x62ed('0x4c')]));_0x45a50c['attributes']=_0x45a50c[_0x62ed('0x4b')][_0x62ed('0x5d')]?_0x45a50c[_0x62ed('0x4b')]:_0x12aa2d['model'];if(_0x225576['query'][_0x62ed('0x59')]){_0x45a50c[_0x62ed('0x5e')]=[{'all':!![]}];}_0x45a50c=_[_0x62ed('0x53')]({},_0x45a50c,_0x225576[_0x62ed('0x5f')]);return db[_0x62ed('0x45')][_0x62ed('0x60')](_0x45a50c)[_0x62ed('0x24')](handleEntityNotFound(_0x24a9b2,null))['then'](respondWithResult(_0x24a9b2,null))[_0x62ed('0x2e')](handleError(_0x24a9b2,null));};exports['create']=function(_0x40b3f8,_0x274f69){return db[_0x62ed('0x45')]['create'](_0x40b3f8[_0x62ed('0x61')],{})[_0x62ed('0x24')](function(_0x54a7d5){var _0x4db2f6=_0x40b3f8[_0x62ed('0x62')]['get']({'plain':!![]});if(!_0x4db2f6)throw new Error(_0x62ed('0x63'));if(_0x4db2f6[_0x62ed('0x64')]===_0x62ed('0x62')){var _0x565a96=_0x54a7d5[_0x62ed('0x3d')]({'plain':!![]});var _0x6858cc='ChatWebsites';return db[_0x62ed('0x65')][_0x62ed('0x60')]({'where':{'name':_0x6858cc,'userProfileId':_0x4db2f6[_0x62ed('0x66')]},'raw':!![]})[_0x62ed('0x24')](function(_0x35343a){if(_0x35343a&&_0x35343a[_0x62ed('0x67')]===0x0){return db['UserProfileResource'][_0x62ed('0x68')]({'name':_0x565a96[_0x62ed('0x40')],'resourceId':_0x565a96['id'],'type':_0x35343a[_0x62ed('0x40')],'sectionId':_0x35343a['id']},{})[_0x62ed('0x24')](function(){return _0x54a7d5;});}else{return _0x54a7d5;}})[_0x62ed('0x2e')](function(_0x20f478){logger[_0x62ed('0x2a')](_0x62ed('0x69'),_0x20f478);throw _0x20f478;});}return _0x54a7d5;})[_0x62ed('0x24')](respondWithResult(_0x274f69,0xc9))[_0x62ed('0x2e')](handleError(_0x274f69,null));};exports[_0x62ed('0x3b')]=function(_0x29bf03,_0x427adf){if(_0x29bf03[_0x62ed('0x61')]['id']){delete _0x29bf03['body']['id'];}return db[_0x62ed('0x45')][_0x62ed('0x60')]({'where':{'id':_0x29bf03[_0x62ed('0x6a')]['id']},'include':[{'model':db['Pause'],'as':_0x62ed('0x44')}]})[_0x62ed('0x24')](handleEntityNotFound(_0x427adf,null))['then'](saveUpdates(_0x29bf03[_0x62ed('0x61')],null))['then'](respondWithResult(_0x427adf,null))[_0x62ed('0x2e')](handleError(_0x427adf,null));};exports[_0x62ed('0x3c')]=function(_0xf88a63,_0x11d066){return db[_0x62ed('0x45')][_0x62ed('0x60')]({'where':{'id':_0xf88a63[_0x62ed('0x6a')]['id']}})['then'](handleEntityNotFound(_0x11d066,null))[_0x62ed('0x24')](removeEntity(_0x11d066,null))['catch'](handleError(_0x11d066,null));};exports[_0x62ed('0x6b')]=function(_0x357dad,_0x1f8a0f){return db[_0x62ed('0x45')][_0x62ed('0x6b')]()['then'](respondWithResult(_0x1f8a0f,null))[_0x62ed('0x2e')](handleError(_0x1f8a0f,null));};exports[_0x62ed('0x6c')]=function(_0x364b19,_0x3ecbf9,_0x4c1d16){if(_0x364b19[_0x62ed('0x61')]['id']){delete _0x364b19[_0x62ed('0x61')]['id'];}return db['ChatWebsite'][_0x62ed('0x60')]({'where':{'id':_0x364b19[_0x62ed('0x6a')]['id']}})[_0x62ed('0x24')](handleEntityNotFound(_0x3ecbf9,null))[_0x62ed('0x24')](function(_0x303b29){if(_0x303b29){_0x364b19[_0x62ed('0x61')]['ChatWebsiteId']=_0x303b29['id'];return db['Disposition'][_0x62ed('0x68')](_0x364b19[_0x62ed('0x61')]);}})[_0x62ed('0x24')](respondWithResult(_0x3ecbf9,null))['catch'](handleError(_0x3ecbf9,null));};exports[_0x62ed('0x6d')]=function(_0x5ca8dc,_0x921617,_0x1d1abb){var _0x258bdc={'raw':![],'where':{}};var _0x91a078={};var _0x4848b3={'count':0x0,'rows':[]};return db[_0x62ed('0x45')][_0x62ed('0x6e')]({'where':{'id':_0x5ca8dc[_0x62ed('0x6a')]['id']}})[_0x62ed('0x24')](handleEntityNotFound(_0x921617,null))[_0x62ed('0x24')](function(_0x99b131){if(_0x99b131){_0x91a078[_0x62ed('0x47')]=_[_0x62ed('0x48')](db[_0x62ed('0x6f')]['rawAttributes']);_0x91a078['query']=_[_0x62ed('0x48')](_0x5ca8dc[_0x62ed('0x49')]);_0x91a078[_0x62ed('0x50')]=_['intersection'](_0x91a078['model'],_0x91a078[_0x62ed('0x49')]);_0x258bdc[_0x62ed('0x4b')]=_['intersection'](_0x91a078['model'],qs[_0x62ed('0x4c')](_0x5ca8dc['query'][_0x62ed('0x4c')]));_0x258bdc['attributes']=_0x258bdc[_0x62ed('0x4b')][_0x62ed('0x5d')]?_0x258bdc[_0x62ed('0x4b')]:_0x91a078[_0x62ed('0x47')];if(!_0x5ca8dc['query'][_0x62ed('0x70')]('nolimit')){_0x258bdc['limit']=qs[_0x62ed('0x35')](_0x5ca8dc['query']['limit']);_0x258bdc[_0x62ed('0x34')]=qs[_0x62ed('0x34')](_0x5ca8dc[_0x62ed('0x49')][_0x62ed('0x34')]);}_0x258bdc[_0x62ed('0x4e')]=qs['sort'](_0x5ca8dc[_0x62ed('0x49')][_0x62ed('0x4f')]);_0x258bdc[_0x62ed('0x54')]=qs[_0x62ed('0x50')](_['pick'](_0x5ca8dc[_0x62ed('0x49')],_0x91a078['filters']));_0x258bdc[_0x62ed('0x54')][_0x62ed('0x71')]=_0x99b131['id'];if(_0x5ca8dc[_0x62ed('0x49')][_0x62ed('0x52')]){_0x258bdc[_0x62ed('0x54')]=_['merge'](_0x258bdc['where'],{'$or':_[_0x62ed('0x55')](_0x258bdc[_0x62ed('0x4b')],function(_0x369069){var _0x564907={};_0x564907[_0x369069]={'$like':'%'+_0x5ca8dc[_0x62ed('0x49')][_0x62ed('0x52')]+'%'};return _0x564907;})});}_0x258bdc=_['merge']({},_0x258bdc,_0x5ca8dc['options']);return db[_0x62ed('0x6f')]['count']({'where':_0x258bdc['where']})[_0x62ed('0x24')](function(_0x428da6){_0x4848b3[_0x62ed('0x33')]=_0x428da6;if(_0x5ca8dc['query']['includeAll']){_0x258bdc[_0x62ed('0x5e')]=[{'all':!![]}];}return db[_0x62ed('0x6f')]['findAll'](_0x258bdc);})[_0x62ed('0x24')](function(_0x3071b8){_0x4848b3[_0x62ed('0x5b')]=_0x3071b8;return _0x4848b3;});}})[_0x62ed('0x24')](respondWithFilteredResult(_0x921617,_0x258bdc))[_0x62ed('0x2e')](handleError(_0x921617,null));};exports[_0x62ed('0x72')]=function(_0x55d5d8,_0x398f45,_0x462658){return db['ChatWebsite']['find']({'where':{'id':_0x55d5d8['params']['id']}})[_0x62ed('0x24')](handleEntityNotFound(_0x398f45,null))[_0x62ed('0x24')](function(_0x1f2f9e){if(_0x1f2f9e){return _0x1f2f9e[_0x62ed('0x72')](_0x55d5d8[_0x62ed('0x49')][_0x62ed('0x73')]);}})[_0x62ed('0x24')](respondWithStatusCode(_0x398f45,null))[_0x62ed('0x2e')](handleError(_0x398f45,null));};exports[_0x62ed('0x74')]=function(_0x4ece1b,_0x1d9e2a,_0x148412){if(_0x4ece1b[_0x62ed('0x61')]['id']){delete _0x4ece1b['body']['id'];}return db[_0x62ed('0x45')][_0x62ed('0x60')]({'where':{'id':_0x4ece1b[_0x62ed('0x6a')]['id']}})[_0x62ed('0x24')](handleEntityNotFound(_0x1d9e2a,null))[_0x62ed('0x24')](function(_0x228281){if(_0x228281){_0x4ece1b['body'][_0x62ed('0x71')]=_0x228281['id'];return db['CannedAnswer'][_0x62ed('0x68')](_0x4ece1b[_0x62ed('0x61')]);}})[_0x62ed('0x24')](respondWithResult(_0x1d9e2a,null))[_0x62ed('0x2e')](handleError(_0x1d9e2a,null));};exports['getAnswers']=function(_0x177414,_0x2f5445,_0x5c66eb){var _0x86b2c3={'raw':![],'where':{}};var _0x1b591f={};var _0x314955={'count':0x0,'rows':[]};return db[_0x62ed('0x45')][_0x62ed('0x6e')]({'where':{'id':_0x177414[_0x62ed('0x6a')]['id']}})[_0x62ed('0x24')](handleEntityNotFound(_0x2f5445,null))[_0x62ed('0x24')](function(_0x67f549){if(_0x67f549){_0x1b591f[_0x62ed('0x47')]=_[_0x62ed('0x48')](db[_0x62ed('0x75')][_0x62ed('0x46')]);_0x1b591f[_0x62ed('0x49')]=_[_0x62ed('0x48')](_0x177414[_0x62ed('0x49')]);_0x1b591f['filters']=_['intersection'](_0x1b591f[_0x62ed('0x47')],_0x1b591f[_0x62ed('0x49')]);_0x86b2c3[_0x62ed('0x4b')]=_['intersection'](_0x1b591f[_0x62ed('0x47')],qs[_0x62ed('0x4c')](_0x177414[_0x62ed('0x49')][_0x62ed('0x4c')]));_0x86b2c3[_0x62ed('0x4b')]=_0x86b2c3[_0x62ed('0x4b')][_0x62ed('0x5d')]?_0x86b2c3[_0x62ed('0x4b')]:_0x1b591f['model'];if(!_0x177414[_0x62ed('0x49')][_0x62ed('0x70')]('nolimit')){_0x86b2c3[_0x62ed('0x35')]=qs[_0x62ed('0x35')](_0x177414['query'][_0x62ed('0x35')]);_0x86b2c3[_0x62ed('0x34')]=qs[_0x62ed('0x34')](_0x177414[_0x62ed('0x49')][_0x62ed('0x34')]);}_0x86b2c3[_0x62ed('0x4e')]=qs[_0x62ed('0x4f')](_0x177414['query'][_0x62ed('0x4f')]);_0x86b2c3['where']=qs['filters'](_[_0x62ed('0x51')](_0x177414[_0x62ed('0x49')],_0x1b591f['filters']));_0x86b2c3['where'][_0x62ed('0x71')]=_0x67f549['id'];if(_0x177414[_0x62ed('0x49')][_0x62ed('0x52')]){_0x86b2c3['where']=_[_0x62ed('0x53')](_0x86b2c3[_0x62ed('0x54')],{'$or':_[_0x62ed('0x55')](_0x86b2c3[_0x62ed('0x4b')],function(_0x4f3755){var _0x3490f={};_0x3490f[_0x4f3755]={'$like':'%'+_0x177414[_0x62ed('0x49')]['filter']+'%'};return _0x3490f;})});}_0x86b2c3=_[_0x62ed('0x53')]({},_0x86b2c3,_0x177414[_0x62ed('0x5f')]);return db[_0x62ed('0x75')]['count']({'where':_0x86b2c3[_0x62ed('0x54')]})[_0x62ed('0x24')](function(_0x376846){_0x314955[_0x62ed('0x33')]=_0x376846;if(_0x177414[_0x62ed('0x49')][_0x62ed('0x59')]){_0x86b2c3[_0x62ed('0x5e')]=[{'all':!![]}];}return db[_0x62ed('0x75')][_0x62ed('0x5a')](_0x86b2c3);})[_0x62ed('0x24')](function(_0xee53a0){_0x314955['rows']=_0xee53a0;return _0x314955;});}})['then'](respondWithFilteredResult(_0x2f5445,_0x86b2c3))['catch'](handleError(_0x2f5445,null));};exports['removeAnswers']=function(_0x2b9808,_0x1e9174,_0x25ceaf){return db['ChatWebsite'][_0x62ed('0x60')]({'where':{'id':_0x2b9808[_0x62ed('0x6a')]['id']}})[_0x62ed('0x24')](handleEntityNotFound(_0x1e9174,null))['then'](function(_0x32afd3){if(_0x32afd3){return _0x32afd3['removeAnswers'](_0x2b9808['query']['ids']);}})[_0x62ed('0x24')](respondWithStatusCode(_0x1e9174,null))[_0x62ed('0x2e')](handleError(_0x1e9174,null));};exports[_0x62ed('0x76')]=function(_0x3cd6ad,_0x49d0cd,_0x5eb166){_0x3cd6ad['body']['sitepic']=_0x3cd6ad[_0x62ed('0x77')][_0x62ed('0x78')];return db[_0x62ed('0x45')][_0x62ed('0x60')]({'where':{'id':_0x3cd6ad[_0x62ed('0x6a')]['id']}})[_0x62ed('0x24')](handleEntityNotFound(_0x49d0cd,null))['then'](saveUpdates(_0x3cd6ad[_0x62ed('0x61')],null))[_0x62ed('0x24')](respondWithResult(_0x49d0cd,null))[_0x62ed('0x2e')](handleError(_0x49d0cd,null));};exports[_0x62ed('0x79')]=function(_0x5dfe37,_0x4907a5,_0x5c44f4){_0x5dfe37[_0x62ed('0x61')][_0x62ed('0x7a')]=_0x5dfe37[_0x62ed('0x77')][_0x62ed('0x78')];return db[_0x62ed('0x45')]['find']({'where':{'id':_0x5dfe37['params']['id']}})[_0x62ed('0x24')](handleEntityNotFound(_0x4907a5,null))[_0x62ed('0x24')](saveUpdates(_0x5dfe37[_0x62ed('0x61')],null))['then'](respondWithResult(_0x4907a5,null))[_0x62ed('0x2e')](handleError(_0x4907a5,null));};exports[_0x62ed('0x7b')]=function(_0x2aa2d2,_0x48d2cf,_0x2dacd9){_0x2aa2d2['body']['customerAvatar']=_0x2aa2d2[_0x62ed('0x77')]['filename'];return db[_0x62ed('0x45')][_0x62ed('0x60')]({'where':{'id':_0x2aa2d2[_0x62ed('0x6a')]['id']}})[_0x62ed('0x24')](handleEntityNotFound(_0x48d2cf,null))[_0x62ed('0x24')](saveUpdates(_0x2aa2d2[_0x62ed('0x61')],null))[_0x62ed('0x24')](respondWithResult(_0x48d2cf,null))[_0x62ed('0x2e')](handleError(_0x48d2cf,null));};exports[_0x62ed('0x7c')]=function(_0x5d2bcf,_0xa5fb2d,_0x4acbe4){_0x5d2bcf[_0x62ed('0x61')][_0x62ed('0x7d')]=_0x5d2bcf[_0x62ed('0x77')]['filename'];return db['ChatWebsite'][_0x62ed('0x60')]({'where':{'id':_0x5d2bcf[_0x62ed('0x6a')]['id']}})[_0x62ed('0x24')](handleEntityNotFound(_0xa5fb2d,null))[_0x62ed('0x24')](saveUpdates(_0x5d2bcf['body'],null))[_0x62ed('0x24')](respondWithResult(_0xa5fb2d,null))[_0x62ed('0x2e')](handleError(_0xa5fb2d,null));};exports[_0x62ed('0x7e')]=function(_0x1cb134,_0x249c46,_0x4d9476){var _0x13a138=path['join'](config['root'],'server/files/images/logos/default_logo.png');var _0x556d85={'where':{'id':_0x1cb134[_0x62ed('0x6a')]['id']},'attributes':['id',_0x62ed('0x7f')],'raw':!![]};var _0x28e8b4=![];return require(_0x62ed('0x80'))[_0x62ed('0x81')]()[_0x62ed('0x24')](function(_0x391d48){if(_0x391d48){_0x28e8b4=_0x391d48[_0x62ed('0x82')];}})[_0x62ed('0x24')](function(){return db[_0x62ed('0x45')]['find'](_0x556d85);})[_0x62ed('0x24')](handleEntityNotFound(_0x249c46,null))[_0x62ed('0x24')](function(_0x15caf0){if(_0x15caf0){if(!_[_0x62ed('0x83')](_0x15caf0[_0x62ed('0x7f')])){if(fs[_0x62ed('0x84')](path[_0x62ed('0x85')](config['root'],'server/files/images/logos/',_0x15caf0[_0x62ed('0x7f')]))&&_0x28e8b4){_0x13a138=path[_0x62ed('0x85')](config[_0x62ed('0x86')],_0x62ed('0x87'),_0x15caf0[_0x62ed('0x7f')]);}}return _0x249c46[_0x62ed('0x88')](_0x13a138);}})[_0x62ed('0x2e')](handleError(_0x249c46,null));};exports[_0x62ed('0x89')]=function(_0x4c3b9c,_0x28c7e8,_0x572830){var _0x2a50bc=path[_0x62ed('0x85')](config['root'],_0x62ed('0x8a'));var _0x233f89={'where':{'id':_0x4c3b9c[_0x62ed('0x6a')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x62ed('0x45')][_0x62ed('0x60')](_0x233f89)[_0x62ed('0x24')](handleEntityNotFound(_0x28c7e8,null))[_0x62ed('0x24')](function(_0x2769de){if(_0x2769de){if(!_[_0x62ed('0x83')](_0x2769de['agentAvatar'])){if(fs[_0x62ed('0x84')](path[_0x62ed('0x85')](config[_0x62ed('0x86')],_0x62ed('0x8b'),_0x2769de[_0x62ed('0x7a')]))){_0x2a50bc=path['join'](config[_0x62ed('0x86')],'server/files/images/avatars/',_0x2769de[_0x62ed('0x7a')]);}}return _0x28c7e8[_0x62ed('0x88')](_0x2a50bc);}})['catch'](handleError(_0x28c7e8,null));};exports[_0x62ed('0x8c')]=function(_0x1ec0a5,_0xf9e01d,_0x4cb8a1){var _0x490667=path['join'](config[_0x62ed('0x86')],_0x62ed('0x8d'));var _0x54ef71={'where':{'id':_0x1ec0a5[_0x62ed('0x6a')]['id']},'attributes':['id',_0x62ed('0x8e'),'showCustomerAvatar'],'raw':!![]};return db['ChatWebsite']['find'](_0x54ef71)['then'](handleEntityNotFound(_0xf9e01d,null))['then'](function(_0x1c763d){if(_0x1c763d){if(!_['isNil'](_0x1c763d[_0x62ed('0x8e')])){if(fs[_0x62ed('0x84')](path[_0x62ed('0x85')](config['root'],_0x62ed('0x8b'),_0x1c763d[_0x62ed('0x8e')]))&&_0x1c763d[_0x62ed('0x8f')]){_0x490667=path[_0x62ed('0x85')](config[_0x62ed('0x86')],'server/files/images/avatars/',_0x1c763d[_0x62ed('0x8e')]);}}return _0xf9e01d[_0x62ed('0x88')](_0x490667);}})[_0x62ed('0x2e')](handleError(_0xf9e01d,null));};exports[_0x62ed('0x90')]=function(_0x5e893a,_0x596014,_0x2c5c64){var _0x5cc0ab=path[_0x62ed('0x85')](config[_0x62ed('0x86')],_0x62ed('0x91'));var _0x347d45={'where':{'id':_0x5e893a[_0x62ed('0x6a')]['id']},'attributes':['id',_0x62ed('0x7d')],'raw':!![]};return db[_0x62ed('0x45')][_0x62ed('0x60')](_0x347d45)['then'](handleEntityNotFound(_0x596014,null))[_0x62ed('0x24')](function(_0x52ba86){if(_0x52ba86){if(!_[_0x62ed('0x83')](_0x52ba86[_0x62ed('0x7d')])){if(fs[_0x62ed('0x84')](path[_0x62ed('0x85')](config[_0x62ed('0x86')],'server/files/images/avatars/',_0x52ba86[_0x62ed('0x7d')]))){_0x5cc0ab=path[_0x62ed('0x85')](config['root'],'server/files/images/avatars/',_0x52ba86[_0x62ed('0x7d')]);}}return _0x596014[_0x62ed('0x88')](_0x5cc0ab);}})['catch'](handleError(_0x596014,null));};exports[_0x62ed('0x92')]=function(_0x52f494,_0x41bcaa,_0x4461a8){var _0x1f3a53=require(_0x62ed('0x93'));var _0x8fd51a=new _0x1f3a53();var _0x18451c=_0x8fd51a[_0x62ed('0x94')](_0x52f494['headers'][_0x62ed('0x95')])[_0x62ed('0x96')]();var _0x5125e1={'body':_0x52f494[_0x62ed('0x61')],'channel':_0x62ed('0x97')};var _0x33b266=[];var _0x3447e7=[];var _0x32c7cc={};var _0x530d33=![];return db['CmContact'][_0x62ed('0x6b')]()['then'](function(_0x53f5dc){if(!_0x53f5dc){throw new db['Sequelize'][(_0x62ed('0x98'))](_0x62ed('0x99'));}_0x33b266=_['difference'](_[_0x62ed('0x48')](_0x53f5dc),['createdAt',_0x62ed('0x9a')]);_0x3447e7=_[_0x62ed('0x9b')](_[_0x62ed('0x48')](_0x53f5dc),[_0x62ed('0x9c'),'updatedAt','CompanyId',_0x62ed('0x9d')]);if(_0x52f494[_0x62ed('0x61')]['id']){delete _0x52f494[_0x62ed('0x61')]['id'];}if(_[_0x62ed('0x83')](_0x52f494[_0x62ed('0x61')][_0x62ed('0x9e')])){throw new db[(_0x62ed('0x9f'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0x62ed('0x83')](_0x52f494[_0x62ed('0x61')]['body'])||_0x52f494[_0x62ed('0x61')][_0x62ed('0x61')]===''){throw new db[(_0x62ed('0x9f'))][(_0x62ed('0x98'))](_0x62ed('0xa0'));}if(_['isNil'](_0x52f494[_0x62ed('0x61')]['mapKey'])){throw new db[(_0x62ed('0x9f'))][(_0x62ed('0x98'))](_0x62ed('0xa1')+_0x3447e7);}if(!_[_0x62ed('0xa2')](_0x3447e7,_0x52f494['body'][_0x62ed('0xa3')])){throw new db['Sequelize'][(_0x62ed('0x98'))](_0x62ed('0xa4')+_0x3447e7);}_0x32c7cc[_0x52f494[_0x62ed('0x61')][_0x62ed('0xa3')]]=_0x52f494['body'][_0x62ed('0x9e')];})[_0x62ed('0x24')](function(){return db[_0x62ed('0x45')][_0x62ed('0x60')]({'where':{'id':_0x52f494[_0x62ed('0x6a')]['id']},'include':[{'model':db['CmList'],'as':_0x62ed('0xa5'),'include':[{'model':db[_0x62ed('0xa6')],'as':_0x62ed('0xa7'),'where':_0x32c7cc,'limit':0x1,'order':[[_0x62ed('0x9a'),_0x62ed('0xa8')]]}]},{'model':db['ChatApplication'],'as':_0x62ed('0xa9')}]});})[_0x62ed('0x24')](handleEntityNotFound(_0x41bcaa,null))[_0x62ed('0x24')](function(_0x276217){if(_0x276217&&_0x276217[_0x62ed('0xa5')]){_0x5125e1[_0x62ed('0xaa')]=_0x276217;_0x5125e1[_0x62ed('0xab')]=_0x276217[_0x62ed('0xa9')];_0x5125e1[_0x62ed('0xac')]=_0x276217['List'];_0x5125e1[_0x62ed('0xab')]=_[_0x62ed('0xad')](_0x5125e1[_0x62ed('0xab')],[_0x62ed('0xae')],[_0x62ed('0xaf')]);if(_0x5125e1[_0x62ed('0xaa')][_0x62ed('0xa9')]){delete _0x5125e1[_0x62ed('0xaa')][_0x62ed('0xa9')];}if(_0x5125e1[_0x62ed('0xaa')][_0x62ed('0xa5')]&&_0x5125e1[_0x62ed('0xaa')][_0x62ed('0xa5')][_0x62ed('0xa7')][_0x62ed('0x5d')]){return _0x5125e1['account']['List'][_0x62ed('0xa7')][0x0];}var _0x196917=_['defaults'](_0x52f494['body'],{'firstName':_0x52f494[_0x62ed('0x61')][_0x62ed('0x9e')],'ListId':_0x276217[_0x62ed('0x9d')]});_0x196917[_0x52f494['body'][_0x62ed('0xa3')]]=_0x52f494[_0x62ed('0x61')][_0x62ed('0x9e')];return db['CmContact'][_0x62ed('0x68')](_0x196917,{'fields':_0x33b266,'raw':!![]});}})[_0x62ed('0x24')](handleEntityNotFound(_0x41bcaa,null))[_0x62ed('0x24')](function(_0x3483a4){_0x5125e1['contact']=_0x3483a4;if(_0x3483a4){var _0x360b0e={'ContactId':_0x3483a4['id'],'ChatWebsiteId':_0x52f494['params']['id'],'from':(_0x3483a4[_0x62ed('0xb0')]||'')+'\x20'+(_0x3483a4[_0x62ed('0xb1')]||''),'customerIp':_0x52f494[_0x62ed('0x61')][_0x62ed('0xb2')],'referer':_0x52f494[_0x62ed('0x61')][_0x62ed('0xb3')],'browserName':_0x18451c[_0x62ed('0xb4')][_0x62ed('0x40')]&&_0x18451c[_0x62ed('0xb4')][_0x62ed('0xb5')]?util[_0x62ed('0xb6')](_0x62ed('0xb7'),_0x18451c[_0x62ed('0xb4')][_0x62ed('0x40')],_0x18451c[_0x62ed('0xb4')][_0x62ed('0xb5')]):'unknown','browserVersion':_0x18451c[_0x62ed('0xb4')]['version']||'unknown','osName':util[_0x62ed('0xb6')](_0x62ed('0xb7'),_0x18451c['os'][_0x62ed('0x40')],_0x18451c['os'][_0x62ed('0xb5')]),'osVersion':_0x18451c['os']['version'],'deviceModel':_0x18451c['device'][_0x62ed('0x47')]&&_0x18451c[_0x62ed('0xb8')][_0x62ed('0xb9')]?util[_0x62ed('0xb6')](_0x62ed('0xba'),_0x18451c[_0x62ed('0xb8')][_0x62ed('0x47')],_0x18451c['device'][_0x62ed('0xb9')],_0x18451c[_0x62ed('0xb8')]['type']):null,'deviceVendor':_0x18451c['device'][_0x62ed('0xb9')],'deviceType':_0x18451c['device'][_0x62ed('0x56')],'formData':JSON[_0x62ed('0x29')](_0x52f494[_0x62ed('0x61')])};var _0x37245f={'ChatWebsiteId':_0x52f494[_0x62ed('0x6a')]['id'],'closed':![]};if(_0x52f494[_0x62ed('0x61')][_0x62ed('0xbb')]){_0x37245f[_0x62ed('0xbb')]=_0x52f494[_0x62ed('0x61')][_0x62ed('0xbb')];return db[_0x62ed('0xbc')][_0x62ed('0x60')]({'where':_0x37245f})[_0x62ed('0x24')](function(_0x5ab5dc){if(_0x5ab5dc){return[_0x5ab5dc,![]];}_0x360b0e[_0x62ed('0xbb')]=_0x52f494[_0x62ed('0x61')][_0x62ed('0xbb')];_0x360b0e[_0x62ed('0xbd')]=_0x52f494[_0x62ed('0x61')][_0x62ed('0xbd')];return db['ChatInteraction'][_0x62ed('0x68')](_0x360b0e)[_0x62ed('0x24')](function(_0x4065e2){return[_0x4065e2,!![]];});});}_0x37245f[_0x62ed('0xbe')]=_0x3483a4['id'];if(_0x52f494[_0x62ed('0x61')][_0x62ed('0xbf')]&&_0x52f494[_0x62ed('0x61')]['interaction']['id']){_0x37245f['id']=_0x52f494['body']['interaction']['id'];return db[_0x62ed('0xbc')][_0x62ed('0x60')]({'where':_0x37245f})['then'](function(_0x5f2ddd){if(_0x5f2ddd){return[_0x5f2ddd,![]];}return db['ChatInteraction']['create'](_0x360b0e)[_0x62ed('0x24')](function(_0x3eb764){return[_0x3eb764,!![]];});});}return db['ChatInteraction']['create'](_0x360b0e)['then'](function(_0x228f39){return[_0x228f39,!![]];});}})[_0x62ed('0xc0')](function(_0x99c20d,_0x5125d8){if(_0x99c20d){_0x530d33=_0x5125d8;if(!_0x5125d8){var _0x58a15e={'from':(_0x5125e1[_0x62ed('0xc1')][_0x62ed('0xb0')]||'')+'\x20'+(_0x5125e1[_0x62ed('0xc1')][_0x62ed('0xb1')]||'')};if(_0x52f494[_0x62ed('0x61')]['threadId']&&_0x52f494['body'][_0x62ed('0xc2')]&&_0x52f494[_0x62ed('0x61')]['threadId']!=_0x52f494['body']['messageId']){_0x58a15e[_0x62ed('0xbb')]=_0x52f494[_0x62ed('0x61')][_0x62ed('0xc2')];}return _0x99c20d['update'](_0x58a15e);}else{return _0x99c20d;}}})['then'](function(_0x5806b0){_0x5125e1['interaction']=_0x5806b0[_0x62ed('0x3d')]({'plain':!![]});_0x5125e1[_0x62ed('0xbf')][_0x62ed('0xc3')]=_0x530d33;if(_0x5125e1[_0x62ed('0xbf')][_0x62ed('0xc3')]){if(_0x5125e1[_0x62ed('0xaa')][_0x62ed('0xc4')]){_0x5125e1[_0x62ed('0xab')][_0x62ed('0xc5')]({'id':0x0,'priority':_0x5125e1[_0x62ed('0xab')][_0x62ed('0x5d')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x62ed('0xc6')});}}return db[_0x62ed('0xc7')][_0x62ed('0x68')]({'body':_0x52f494[_0x62ed('0x61')][_0x62ed('0x61')],'ChatWebsiteId':_0x52f494[_0x62ed('0x6a')]['id'],'ChatInteractionId':_0x5806b0['id'],'direction':'in','ContactId':_0x5125e1[_0x62ed('0xc1')]['id'],'AttachmentId':_0x52f494[_0x62ed('0x61')]['AttachmentId']});})[_0x62ed('0x24')](function(_0x1e938b){_0x5125e1[_0x62ed('0x2d')]=_0x1e938b;if(_0x5125e1['interaction']['UserId']){return db[_0x62ed('0xc8')]['find']({'attributes':['id',_0x62ed('0x40')],'where':{'id':_0x5125e1[_0x62ed('0xbf')]['UserId']}})[_0x62ed('0x24')](function(_0x129ac1){if(_0x129ac1){_0x5125e1['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x62ed('0xc9'),'appdata':_0x129ac1[_0x62ed('0x40')]+','+(_0x5125e1['account'][_0x62ed('0xca')]||0xa),'interval':_0x62ed('0xc6')});_0x5125e1[_0x62ed('0xcb')]=!![];}return respondWithRpcPromise(_0x62ed('0xcc'),_0x62ed('0xcd'),_0x5125e1);});}return respondWithRpcPromise('Start','startRouting',_0x5125e1);})[_0x62ed('0x24')](function(_0x524d73){respondWithRpcPromise('EventManager',_0x62ed('0xce'),{'event':_0x62ed('0x92'),'message':_0x524d73},client9002);return _0x524d73;})[_0x62ed('0x24')](respondWithResult(_0x41bcaa,null))[_0x62ed('0x2e')](handleError(_0x41bcaa,null));};exports['offline']=function(_0x4a9cab,_0x21beea,_0x24c859){var _0x4eaba0,_0x112fa2,_0x576da2;var _0x300923=[];var _0x537346=[];var _0xefc6c1={};return db[_0x62ed('0xa6')][_0x62ed('0x6b')]()['then'](function(_0x1b2bf7){if(!_0x1b2bf7){throw new db[(_0x62ed('0x9f'))][(_0x62ed('0x98'))](_0x62ed('0x99'));}_0x537346=_[_0x62ed('0x9b')](_[_0x62ed('0x48')](_0x1b2bf7),[_0x62ed('0x9c'),_0x62ed('0x9a')]);_0x300923=_[_0x62ed('0x9b')](_[_0x62ed('0x48')](_0x1b2bf7),[_0x62ed('0x9c'),_0x62ed('0x9a'),_0x62ed('0xcf'),_0x62ed('0x9d')]);if(_0x4a9cab['body']['id']){delete _0x4a9cab[_0x62ed('0x61')]['id'];}if(_[_0x62ed('0x83')](_0x4a9cab['body'][_0x62ed('0x9e')])){throw _0x21beea['status'](0x1f4)[_0x62ed('0x41')](new db[(_0x62ed('0x9f'))][(_0x62ed('0x98'))]('from\x20is\x20mandatory'));}if(_[_0x62ed('0x83')](_0x4a9cab[_0x62ed('0x61')][_0x62ed('0x61')])||_0x4a9cab[_0x62ed('0x61')][_0x62ed('0x61')]===''){throw _0x21beea[_0x62ed('0x30')](0x1f4)['send'](new db['Sequelize'][(_0x62ed('0x98'))](_0x62ed('0xa0')));}if(_[_0x62ed('0x83')](_0x4a9cab[_0x62ed('0x61')]['mapKeyOffline'])){throw _0x21beea[_0x62ed('0x30')](0x1f4)[_0x62ed('0x41')](new db[(_0x62ed('0x9f'))]['ValidationError'](_0x62ed('0xd0')+_0x300923));}if(!_['includes'](_0x300923,_0x4a9cab[_0x62ed('0x61')][_0x62ed('0xd1')])){throw _0x21beea['status'](0x1f4)[_0x62ed('0x41')](new db[(_0x62ed('0x9f'))]['ValidationError'](_0x62ed('0xd2')+_0x300923));}_0xefc6c1[_0x4a9cab[_0x62ed('0x61')][_0x62ed('0xd1')]]=_0x4a9cab[_0x62ed('0x61')][_0x62ed('0x9e')];})[_0x62ed('0x24')](function(){return db[_0x62ed('0x45')][_0x62ed('0x60')]({'where':{'id':_0x4a9cab['params']['id']},'include':[{'model':db[_0x62ed('0xd3')],'as':'List'}]});})['then'](handleEntityNotFound(_0x21beea,null))[_0x62ed('0x24')](function(_0x3334ed){if(_0x3334ed&&_0x3334ed[_0x62ed('0xa5')]){_0x112fa2=_0x3334ed;var _0x2dd8e=_['defaults'](_0x4a9cab[_0x62ed('0x61')],{'firstName':_0x4a9cab[_0x62ed('0x61')][_0x62ed('0x9e')],'phone':_0x4a9cab[_0x62ed('0x61')][_0x62ed('0x9e')],'ListId':_0x3334ed[_0x62ed('0x9d')]});_0x2dd8e[_0x4a9cab['body'][_0x62ed('0xd1')]]=_0x4a9cab['body'][_0x62ed('0x9e')];return db['CmContact'][_0x62ed('0xd4')]({'where':_0xefc6c1,'defaults':_0x2dd8e});}})[_0x62ed('0xc0')](function(_0x3ee99e){if(_0x3ee99e){_0x576da2=_0x3ee99e;var _0x1a1d27=fs[_0x62ed('0xd5')](path[_0x62ed('0x85')](config[_0x62ed('0x86')],_0x62ed('0xd6')),_0x62ed('0xd7'));var _0x413294=ejs[_0x62ed('0xd8')](_0x1a1d27,{'body':_[_0x62ed('0xd9')](_0x4a9cab[_0x62ed('0x61')][_0x62ed('0x61')]),'bodyTitle':_0x112fa2[_0x62ed('0xda')]});return db[_0x62ed('0xdb')][_0x62ed('0x68')]({'body':_0x413294,'ContactId':_0x3ee99e['id'],'ChatWebsiteId':_0x112fa2['id']});}})['then'](function(_0x71eab4){if(_0x71eab4){_0x4eaba0=_0x71eab4;return db['MailAccount'][_0x62ed('0x6e')]({'where':{'service':!![]},'include':[{'model':db[_0x62ed('0xdc')],'as':_0x62ed('0xdd'),'raw':!![]}]});}})[_0x62ed('0x24')](function(_0x594122){if(_0x594122&&_0x594122[_0x62ed('0xdd')]&&_0x112fa2['forwardOfflineAddress']){var _0x34b84c={'tls':{'rejectUnauthorized':![]}};if(_0x594122['Smtp'][_0x62ed('0xde')]){_0x34b84c['service']=_0x594122[_0x62ed('0xdd')][_0x62ed('0xde')];}else{_0x34b84c[_0x62ed('0xdf')]=_0x594122[_0x62ed('0xdd')][_0x62ed('0xdf')];_0x34b84c['port']=_0x594122[_0x62ed('0xdd')]['port'];_0x34b84c[_0x62ed('0xe0')]=_0x594122[_0x62ed('0xdd')][_0x62ed('0xe0')];}if(_0x594122['Smtp'][_0x62ed('0xe1')]){_0x34b84c[_0x62ed('0xe2')]={'user':_0x594122[_0x62ed('0xdd')][_0x62ed('0x62')],'pass':_0x594122[_0x62ed('0xdd')]['pass']};}return respondWithRpcPromise(_0x62ed('0xe3'),_0x62ed('0xe4'),{'account':_0x34b84c,'message':{'from':util[_0x62ed('0xb6')]('\x22%s\x22\x20<%s>',_0x594122[_0x62ed('0x40')],_0x594122['email']||_0x594122['Smtp'][_0x62ed('0x62')]),'to':_0x112fa2[_0x62ed('0xe5')],'subject':_0x112fa2['offlineMessageSubject'],'text':_0x4eaba0[_0x62ed('0x61')]}},client9003)[_0x62ed('0x24')](function(){return _0x4eaba0;})['catch'](function(_0xfe6ba3){console[_0x62ed('0x2a')](_0xfe6ba3);});}})[_0x62ed('0x24')](function(){if(_0x4eaba0){return _0x4eaba0;}})[_0x62ed('0x24')](respondWithResult(_0x21beea,null))['catch'](handleError(_0x21beea,null));};exports[_0x62ed('0xe6')]=function(_0xd6ea9a,_0x4ce4ff,_0x311c19){return db[_0x62ed('0xbc')][_0x62ed('0x60')]({'where':{'id':_0xd6ea9a[_0x62ed('0x6a')]['id']}})['then'](handleEntityNotFound(_0x4ce4ff,null))[_0x62ed('0x24')](function(_0x200301){if(_0x200301){return _0x200301['addInteraction'](_0xd6ea9a['body'][_0x62ed('0x73')],_[_0x62ed('0xe7')](_0xd6ea9a[_0x62ed('0x61')],[_0x62ed('0x73'),'id'])||{});}})[_0x62ed('0x24')](respondWithResult(_0x4ce4ff,null))[_0x62ed('0x2e')](handleError(_0x4ce4ff,null));};exports[_0x62ed('0xe8')]=function(_0x1e8b51,_0x4e0222,_0x2e3260){var _0x246275={'raw':![],'where':{}};var _0x58ca01={};var _0x33e7ea={'count':0x0,'rows':[]};return db[_0x62ed('0x45')][_0x62ed('0x6e')]({'where':{'id':_0x1e8b51[_0x62ed('0x6a')]['id']}})['then'](handleEntityNotFound(_0x4e0222,null))[_0x62ed('0x24')](function(_0x5177c0){if(_0x5177c0){_0x58ca01[_0x62ed('0x47')]=_['keys'](db[_0x62ed('0xbc')]['rawAttributes']);_0x58ca01['query']=_['keys'](_0x1e8b51['query']);_0x58ca01[_0x62ed('0x50')]=_['intersection'](_0x58ca01[_0x62ed('0x47')],_0x58ca01['query']);_0x246275[_0x62ed('0x4b')]=_['intersection'](_0x58ca01['model'],qs[_0x62ed('0x4c')](_0x1e8b51['query'][_0x62ed('0x4c')]));_0x246275[_0x62ed('0x4b')]=_0x246275[_0x62ed('0x4b')][_0x62ed('0x5d')]?_0x246275[_0x62ed('0x4b')]:_0x58ca01[_0x62ed('0x47')];if(!_0x1e8b51['query']['hasOwnProperty'](_0x62ed('0x4d'))){_0x246275['limit']=qs[_0x62ed('0x35')](_0x1e8b51[_0x62ed('0x49')][_0x62ed('0x35')]);_0x246275[_0x62ed('0x34')]=qs[_0x62ed('0x34')](_0x1e8b51[_0x62ed('0x49')][_0x62ed('0x34')]);}_0x246275[_0x62ed('0x4e')]=qs[_0x62ed('0x4f')](_0x1e8b51[_0x62ed('0x49')]['sort']);_0x246275[_0x62ed('0x54')]=qs[_0x62ed('0x50')](_[_0x62ed('0x51')](_0x1e8b51[_0x62ed('0x49')],_0x58ca01[_0x62ed('0x50')]));_0x246275[_0x62ed('0x54')][_0x62ed('0x71')]=_0x5177c0['id'];if(_0x1e8b51['query'][_0x62ed('0x52')]){_0x246275[_0x62ed('0x54')]=_[_0x62ed('0x53')](_0x246275[_0x62ed('0x54')],{'$or':_[_0x62ed('0x55')](_0x246275['attributes'],function(_0x4aeb8c){var _0x9963ee={};_0x9963ee[_0x4aeb8c]={'$like':'%'+_0x1e8b51['query'][_0x62ed('0x52')]+'%'};return _0x9963ee;})});}_0x246275=_[_0x62ed('0x53')]({},_0x246275,_0x1e8b51[_0x62ed('0x5f')]);return db[_0x62ed('0xbc')][_0x62ed('0x33')]({'where':_0x246275[_0x62ed('0x54')]})[_0x62ed('0x24')](function(_0x56f0ec){_0x33e7ea[_0x62ed('0x33')]=_0x56f0ec;if(_0x1e8b51[_0x62ed('0x49')][_0x62ed('0x59')]){_0x246275[_0x62ed('0x5e')]=[{'model':db[_0x62ed('0xa6')],'as':_0x62ed('0xe9'),'required':![]},{'model':db[_0x62ed('0xc8')],'as':_0x62ed('0xea'),'attributes':['name',_0x62ed('0xeb'),_0x62ed('0xec')],'required':![]},{'model':db['Tag'],'as':_0x62ed('0xed'),'attributes':['id',_0x62ed('0x40'),_0x62ed('0xee')],'where':_0x1e8b51[_0x62ed('0x49')][_0x62ed('0xef')]?{'id':_0x1e8b51['query'][_0x62ed('0xef')]}:undefined,'required':_0x1e8b51['query'][_0x62ed('0xef')]?!![]:![]}];}return db[_0x62ed('0xbc')][_0x62ed('0x5a')](_0x246275);})[_0x62ed('0x24')](function(_0x9123bc){_0x33e7ea[_0x62ed('0x5b')]=_0x9123bc;return _0x33e7ea;});}})['then'](respondWithFilteredResult(_0x4e0222,_0x246275))[_0x62ed('0x2e')](handleError(_0x4e0222,null));};function iftimePromise(_0x3a4ec3,_0x5818c0){return respondWithRpcPromise('Command',_0x62ed('0xf0'),{'command':_0x5818c0[_0x62ed('0xf1')]?util['format'](_0x62ed('0xf2'),_0x3a4ec3['interval'],_0x5818c0['timezone']):util[_0x62ed('0xb6')](_0x62ed('0xf3'),_0x3a4ec3['interval'])},client9002)[_0x62ed('0x24')](function(_0xcfbe21){var _0x13b629=_0xcfbe21&&_0xcfbe21[_0x62ed('0xf4')]('true')>=0x0?!![]:![];logger[_0x62ed('0x25')](_0x62ed('0xf5'),_0x5818c0['id'],_0x3a4ec3['id'],_0x3a4ec3[_0x62ed('0xf6')],_0x13b629?_0x62ed('0xf7'):'OFFLINE',_0x5818c0[_0x62ed('0xf1')]?_0x5818c0[_0x62ed('0xf1')]:_0x62ed('0xf8'));return _0x13b629;})[_0x62ed('0x2e')](function(_0x3afa98){logger[_0x62ed('0x2a')](_0x62ed('0xf5'),_0x5818c0['id'],_0x3a4ec3['id'],_0x3a4ec3['interval'],util[_0x62ed('0xf9')](_0x3afa98,{'showHidden':![],'depth':null}),_0x5818c0[_0x62ed('0xf1')]?_0x5818c0[_0x62ed('0xf1')]:_0x62ed('0xf8'));return![];});}exports['getSnippet']=function(_0x31104c,_0x4bd41b,_0x2ee4e4){var _0x401b6f=0x0;var _0x20c5a4=0x0;var _0x31c107=![];var _0x173190;var _0x4648ea;return db[_0x62ed('0x45')]['find']({'where':{'id':_0x31104c[_0x62ed('0x6a')]['id']},'include':[{'model':db[_0x62ed('0xfa')],'as':_0x62ed('0xfa'),'include':[{'model':db[_0x62ed('0xfa')],'as':'Intervals','attributes':['id','interval'],'raw':!![]}]}]})[_0x62ed('0x24')](handleEntityNotFound(_0x4bd41b,null))[_0x62ed('0x24')](function(_0x3e74ad){if(_0x3e74ad){_0x173190=_0x3e74ad;return _0x3e74ad[_0x62ed('0xfb')]({'raw':!![]});}})['then'](function(_0x339cb2){if(_0x173190){if(_0x339cb2){_0x4648ea=_0x339cb2;}}return require(_0x62ed('0x80'))[_0x62ed('0x81')]();})['then'](function(_0x1464ee){if(_0x1464ee){_0x20c5a4=_0x1464ee[_0x62ed('0xfc')];_0x31c107=_0x1464ee['custom'];}})[_0x62ed('0x24')](function(){return db[_0x62ed('0xbc')]['count']({'where':{'closed':![]}});})[_0x62ed('0x24')](function(_0x3f10b9){_0x401b6f=_0x3f10b9;if(_0x20c5a4&&_0x3f10b9>_0x20c5a4){return db[_0x62ed('0xfd')][_0x62ed('0x6e')]({'where':{'id':0x1}})[_0x62ed('0x24')](function(_0x517cb8){if(_0x517cb8){_0x517cb8['increment'](_0x62ed('0xfe'));}});}})[_0x62ed('0x24')](function(){if(_0x173190[_0x62ed('0xfa')]&&_0x173190['Interval'][_0x62ed('0xff')]){var _0x3edc7e=[];for(var _0x4e4664=0x0;_0x4e4664<_0x173190[_0x62ed('0xfa')][_0x62ed('0xff')][_0x62ed('0x5d')];_0x4e4664++){var _0x8bee56=_0x173190[_0x62ed('0xfa')][_0x62ed('0xff')][_0x4e4664]['get']({'plain':!![]});_0x3edc7e[_0x62ed('0xc5')](iftimePromise(_0x8bee56,_0x173190));}return BPromise[_0x62ed('0x100')](_0x3edc7e)[_0x62ed('0x24')](function(_0x325609){return _['some'](_0x325609);});}else{return!![];}})[_0x62ed('0x24')](function(_0x45fe6c){var _0x491869=fs['readFileSync'](path['join'](config['root'],_0x62ed('0x101')),_0x62ed('0xd7'));var _0x2af06a={'remote':_0x173190[_0x62ed('0x102')],'query':querystring[_0x62ed('0x29')](_[_0x62ed('0x53')](_0x173190[_0x62ed('0x3d')]({'plain':!![]}),{'customerIp':_0x31104c[_0x62ed('0x103')]['x-forwarded-for']||_0x31104c[_0x62ed('0x103')]['x-real-ip']||_0x31104c[_0x62ed('0x104')][_0x62ed('0x105')]||_0x31104c['ip'],'referer':_0x31104c['headers'][_0x62ed('0xb3')],'openedInteractions':_0x401b6f,'maxInteractions':_0x20c5a4,'virtual':_0x31c107[_0x62ed('0xfc')],'online':_0x45fe6c,'custom':_0x31c107}))[_0x62ed('0x106')](/'/g,'\x5c\x27')};_0x4bd41b[_0x62ed('0x41')](ejs[_0x62ed('0xd8')](Mustache[_0x62ed('0xd8')](_0x491869,_0x2af06a),{'proactiveActions':_0x4648ea,'alignment':_0x173190[_0x62ed('0x107')],'verticalAlignment':_0x173190[_0x62ed('0x108')]}));})[_0x62ed('0x2e')](handleError(_0x4bd41b,null));};exports['addApplications']=function(_0x20a44e,_0x2632a4,_0x5d4953){return db[_0x62ed('0x45')][_0x62ed('0x6e')]({'where':{'id':_0x20a44e['params']['id']}})['then'](handleEntityNotFound(_0x2632a4,null))[_0x62ed('0x24')](function(_0x3968b1){if(_0x3968b1){return db['sequelize']['transaction'](function(_0x40749e){return db[_0x62ed('0x109')][_0x62ed('0x3c')]({'where':{'ChatWebsiteId':_0x20a44e['params']['id']},'transaction':_0x40749e})[_0x62ed('0x24')](function(_0x5756a0){var _0xc0e837=_[_0x62ed('0x55')](_0x20a44e['body'],function(_0xa7e8ca){_0xa7e8ca['ChatWebsiteId']=_0x20a44e[_0x62ed('0x6a')]['id'];return _0xa7e8ca;});return db[_0x62ed('0x109')][_0x62ed('0x10a')](_0xc0e837,{'transaction':_0x40749e});});})[_0x62ed('0x24')](function(){return db[_0x62ed('0x109')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x20a44e['params']['id']},'order':'priority'});});}})[_0x62ed('0x24')](respondWithResult(_0x2632a4,null))[_0x62ed('0x2e')](handleError(_0x2632a4,null));};exports[_0x62ed('0x10b')]=function(_0x291cf9,_0x214848,_0x56b614){var _0x43552d={};var _0x1d8363={};var _0x5c576f;var _0x9cb8ac;return db[_0x62ed('0x45')][_0x62ed('0x6e')]({'where':{'id':_0x291cf9[_0x62ed('0x6a')]['id']}})[_0x62ed('0x24')](handleEntityNotFound(_0x214848,null))['then'](function(_0x4d18ae){if(_0x4d18ae){_0x5c576f=_0x4d18ae;_0x1d8363[_0x62ed('0x47')]=_[_0x62ed('0x48')](db[_0x62ed('0x109')]['rawAttributes']);_0x1d8363[_0x62ed('0x49')]=_[_0x62ed('0x48')](_0x291cf9[_0x62ed('0x49')]);_0x1d8363[_0x62ed('0x50')]=_[_0x62ed('0x4a')](_0x1d8363[_0x62ed('0x47')],_0x1d8363[_0x62ed('0x49')]);_0x43552d[_0x62ed('0x4b')]=_[_0x62ed('0x4a')](_0x1d8363['model'],qs['fields'](_0x291cf9[_0x62ed('0x49')][_0x62ed('0x4c')]));_0x43552d[_0x62ed('0x4b')]=_0x43552d['attributes'][_0x62ed('0x5d')]?_0x43552d[_0x62ed('0x4b')]:_0x1d8363[_0x62ed('0x47')];_0x43552d['order']=qs[_0x62ed('0x4f')](_0x291cf9['query'][_0x62ed('0x4f')]);_0x43552d[_0x62ed('0x54')]=qs[_0x62ed('0x50')](_['pick'](_0x291cf9['query'],_0x1d8363[_0x62ed('0x50')]));if(_0x291cf9['query'][_0x62ed('0x52')]){_0x43552d[_0x62ed('0x54')]=_[_0x62ed('0x53')](_0x43552d[_0x62ed('0x54')],{'$or':_[_0x62ed('0x55')](_0x43552d[_0x62ed('0x4b')],function(_0x3c9f15){var _0x29590c={};_0x29590c[_0x3c9f15]={'$like':'%'+_0x291cf9[_0x62ed('0x49')][_0x62ed('0x52')]+'%'};return _0x29590c;})});}_0x43552d=_[_0x62ed('0x53')]({},_0x43552d,_0x291cf9[_0x62ed('0x5f')]);return _0x5c576f['getApplications'](_0x43552d);}})[_0x62ed('0x24')](function(_0x50de8c){if(_0x50de8c){_0x9cb8ac=_0x50de8c[_0x62ed('0x5d')];if(!_0x291cf9[_0x62ed('0x49')][_0x62ed('0x70')](_0x62ed('0x4d'))){_0x43552d['limit']=qs[_0x62ed('0x35')](_0x291cf9[_0x62ed('0x49')][_0x62ed('0x35')]);_0x43552d[_0x62ed('0x34')]=qs[_0x62ed('0x34')](_0x291cf9['query'][_0x62ed('0x34')]);}return _0x5c576f[_0x62ed('0x10b')](_0x43552d);}})['then'](function(_0x178ac9){if(_0x178ac9){return _0x178ac9?{'count':_0x9cb8ac,'rows':_0x178ac9}:null;}})[_0x62ed('0x24')](respondWithResult(_0x214848,null))[_0x62ed('0x2e')](handleError(_0x214848,null));};exports[_0x62ed('0x10c')]=function(_0x2c0d29,_0x4964b0,_0x2ea6b3){return db['chatProactiveAction'][_0x62ed('0x60')]({'where':{'id':_0x2c0d29[_0x62ed('0x6a')]['id']}})[_0x62ed('0x24')](handleEntityNotFound(_0x4964b0,null))[_0x62ed('0x24')](function(_0x48bfd1){if(_0x48bfd1){return _0x48bfd1['addProactiveActions'](_0x2c0d29[_0x62ed('0x61')][_0x62ed('0x73')],_['omit'](_0x2c0d29[_0x62ed('0x61')],[_0x62ed('0x73'),'id'])||{});}})['then'](respondWithResult(_0x4964b0,null))[_0x62ed('0x2e')](handleError(_0x4964b0,null));};exports[_0x62ed('0xfb')]=function(_0x253f1a,_0x25dd9e,_0x34d56b){var _0x9c85b5={};var _0x38b5f2={};var _0x5392c4;var _0x70cbff;return db[_0x62ed('0x45')][_0x62ed('0x6e')]({'where':{'id':_0x253f1a[_0x62ed('0x6a')]['id']}})[_0x62ed('0x24')](handleEntityNotFound(_0x25dd9e,null))['then'](function(_0x51012e){if(_0x51012e){_0x5392c4=_0x51012e;_0x38b5f2[_0x62ed('0x47')]=_['keys'](db[_0x62ed('0x10d')][_0x62ed('0x46')]);_0x38b5f2[_0x62ed('0x49')]=_[_0x62ed('0x48')](_0x253f1a[_0x62ed('0x49')]);_0x38b5f2['filters']=_[_0x62ed('0x4a')](_0x38b5f2[_0x62ed('0x47')],_0x38b5f2[_0x62ed('0x49')]);_0x9c85b5[_0x62ed('0x4b')]=_['intersection'](_0x38b5f2[_0x62ed('0x47')],qs['fields'](_0x253f1a[_0x62ed('0x49')][_0x62ed('0x4c')]));_0x9c85b5['attributes']=_0x9c85b5[_0x62ed('0x4b')][_0x62ed('0x5d')]?_0x9c85b5[_0x62ed('0x4b')]:_0x38b5f2[_0x62ed('0x47')];_0x9c85b5['order']=qs['sort'](_0x253f1a['query'][_0x62ed('0x4f')]);_0x9c85b5[_0x62ed('0x54')]=qs[_0x62ed('0x50')](_[_0x62ed('0x51')](_0x253f1a[_0x62ed('0x49')],_0x38b5f2[_0x62ed('0x50')]));if(_0x253f1a[_0x62ed('0x49')][_0x62ed('0x52')]){_0x9c85b5[_0x62ed('0x54')]=_['merge'](_0x9c85b5['where'],{'$or':_[_0x62ed('0x55')](_0x9c85b5[_0x62ed('0x4b')],function(_0x36f378){var _0x33e390={};_0x33e390[_0x36f378]={'$like':'%'+_0x253f1a[_0x62ed('0x49')][_0x62ed('0x52')]+'%'};return _0x33e390;})});}_0x9c85b5=_[_0x62ed('0x53')]({},_0x9c85b5,_0x253f1a[_0x62ed('0x5f')]);return _0x5392c4[_0x62ed('0xfb')](_0x9c85b5);}})[_0x62ed('0x24')](function(_0x3bee0d){if(_0x3bee0d){_0x70cbff=_0x3bee0d[_0x62ed('0x5d')];if(!_0x253f1a['query'][_0x62ed('0x70')](_0x62ed('0x4d'))){_0x9c85b5[_0x62ed('0x35')]=qs[_0x62ed('0x35')](_0x253f1a[_0x62ed('0x49')]['limit']);_0x9c85b5[_0x62ed('0x34')]=qs['offset'](_0x253f1a[_0x62ed('0x49')]['offset']);}return _0x5392c4[_0x62ed('0xfb')](_0x9c85b5);}})[_0x62ed('0x24')](function(_0x1be1e6){if(_0x1be1e6){return _0x1be1e6?{'count':_0x70cbff,'rows':_0x1be1e6}:null;}})['then'](respondWithResult(_0x25dd9e,null))[_0x62ed('0x2e')](handleError(_0x25dd9e,null));};exports['getFields']=function(_0x485679,_0x237a9d,_0x2eaea7){var _0x693f70=_0x485679[_0x62ed('0x49')][_0x62ed('0x10e')]===_0x62ed('0x10f')?_0x62ed('0x110'):_0x62ed('0x111');return db[_0x62ed('0x45')][_0x62ed('0x60')]({'attributes':['id',_0x693f70],'where':{'id':_0x485679[_0x62ed('0x6a')]['id']}})[_0x62ed('0x24')](handleEntityNotFound(_0x237a9d,null))[_0x62ed('0x24')](function(_0xa3ed90){if(_0xa3ed90){var _0x3d6f2f=_0xa3ed90[_0x693f70];var _0x246f2e=_0x3d6f2f&&_0x3d6f2f[_0x62ed('0x112')]?_0x3d6f2f[_0x62ed('0x112')]:[];_0x237a9d[_0x62ed('0x41')]({'fromKey':_[_0x62ed('0x83')](_0x3d6f2f[_0x62ed('0x113')])?undefined:_0x3d6f2f['fromKey'],'count':_0x246f2e[_0x62ed('0x5d')],'rows':_0x246f2e});}})[_0x62ed('0x2e')](handleError(_0x237a9d,null));};exports['getOfflineMessages']=function(_0x2f49e3,_0xf71e0c,_0x122983){var _0x2b34ad={'raw':!![],'where':{}};var _0x5944bc={};var _0x2f5c3f={'count':0x0,'rows':[]};return db[_0x62ed('0x45')][_0x62ed('0x6e')]({'where':{'id':_0x2f49e3[_0x62ed('0x6a')]['id']}})[_0x62ed('0x24')](handleEntityNotFound(_0xf71e0c,null))[_0x62ed('0x24')](function(_0x27ce22){if(_0x27ce22){_0x5944bc['model']=_[_0x62ed('0x48')](db['ChatOfflineMessage'][_0x62ed('0x46')]);_0x5944bc[_0x62ed('0x49')]=_[_0x62ed('0x48')](_0x2f49e3[_0x62ed('0x49')]);_0x5944bc[_0x62ed('0x50')]=_[_0x62ed('0x4a')](_0x5944bc[_0x62ed('0x47')],_0x5944bc['query']);_0x2b34ad[_0x62ed('0x4b')]=_[_0x62ed('0x4a')](_0x5944bc[_0x62ed('0x47')],qs[_0x62ed('0x4c')](_0x2f49e3[_0x62ed('0x49')][_0x62ed('0x4c')]));_0x2b34ad[_0x62ed('0x4b')]=_0x2b34ad[_0x62ed('0x4b')]['length']?_0x2b34ad[_0x62ed('0x4b')]:_0x5944bc[_0x62ed('0x47')];if(!_0x2f49e3[_0x62ed('0x49')][_0x62ed('0x70')](_0x62ed('0x4d'))){_0x2b34ad['limit']=qs[_0x62ed('0x35')](_0x2f49e3['query'][_0x62ed('0x35')]);_0x2b34ad[_0x62ed('0x34')]=qs['offset'](_0x2f49e3['query'][_0x62ed('0x34')]);}_0x2b34ad[_0x62ed('0x4e')]=qs[_0x62ed('0x4f')](_0x2f49e3[_0x62ed('0x49')]['sort']);_0x2b34ad[_0x62ed('0x54')]=qs['filters'](_[_0x62ed('0x51')](_0x2f49e3['query'],_0x5944bc[_0x62ed('0x50')]));_0x2b34ad[_0x62ed('0x54')]['ChatWebsiteId']=_0x27ce22['id'];if(_0x2f49e3[_0x62ed('0x49')][_0x62ed('0x52')]){_0x2b34ad[_0x62ed('0x54')]=_['merge'](_0x2b34ad[_0x62ed('0x54')],{'$or':_[_0x62ed('0x55')](_0x2b34ad[_0x62ed('0x4b')],function(_0x432ed8){var _0x4d4f8d={};_0x4d4f8d[_0x432ed8]={'$like':'%'+_0x2f49e3[_0x62ed('0x49')][_0x62ed('0x52')]+'%'};return _0x4d4f8d;})});}_0x2b34ad=_[_0x62ed('0x53')]({},_0x2b34ad,_0x2f49e3['options']);return db[_0x62ed('0xdb')][_0x62ed('0x33')]({'where':_0x2b34ad[_0x62ed('0x54')]})[_0x62ed('0x24')](function(_0x4af514){_0x2f5c3f[_0x62ed('0x33')]=_0x4af514;if(_0x2f49e3[_0x62ed('0x49')]['includeAll']){_0x2b34ad['include']=[{'all':!![]}];}return db[_0x62ed('0xdb')]['findAll'](_0x2b34ad);})[_0x62ed('0x24')](function(_0x39e9fb){_0x2f5c3f['rows']=_0x39e9fb;return _0x2f5c3f;});}})[_0x62ed('0x24')](respondWithFilteredResult(_0xf71e0c,_0x2b34ad))[_0x62ed('0x2e')](handleError(_0xf71e0c,null));};exports[_0x62ed('0x114')]=function(_0x528d45,_0x296800,_0x4e0e8b){return db[_0x62ed('0x45')][_0x62ed('0x60')]({'where':{'id':_0x528d45[_0x62ed('0x6a')]['id']}})[_0x62ed('0x24')](handleEntityNotFound(_0x296800,null))[_0x62ed('0x24')](function(_0x42c687){if(_0x42c687){return _0x42c687[_0x62ed('0x114')](_0x528d45[_0x62ed('0x61')][_0x62ed('0x73')],_['omit'](_0x528d45[_0x62ed('0x61')],[_0x62ed('0x73'),'id'])||{})['spread'](function(_0xcde3e9){for(var _0x1203c8=0x0;_0x1203c8<_0x528d45[_0x62ed('0x61')][_0x62ed('0x73')][_0x62ed('0x5d')];_0x1203c8+=0x1){socket[_0x62ed('0x115')](_0x62ed('0x116'),{'UserId':_0x528d45[_0x62ed('0x61')]['ids'][_0x1203c8],'ChatWebsiteId':_0x528d45['params']['id']});}return _0xcde3e9;});}})[_0x62ed('0x24')](respondWithResult(_0x296800,null))[_0x62ed('0x2e')](handleError(_0x296800,null));};exports[_0x62ed('0x117')]=function(_0x47725b,_0x27d8e7,_0x45a1b4){return db[_0x62ed('0x45')][_0x62ed('0x60')]({'where':{'id':_0x47725b[_0x62ed('0x6a')]['id']}})[_0x62ed('0x24')](handleEntityNotFound(_0x27d8e7,null))[_0x62ed('0x24')](function(_0x344ce6){if(_0x344ce6){return _0x344ce6[_0x62ed('0x117')](_0x47725b[_0x62ed('0x49')]['ids'])[_0x62ed('0x24')](function(){if(_['isArray'](_0x47725b['query'][_0x62ed('0x73')])){for(var _0x15a3bf=0x0;_0x15a3bf<_0x47725b[_0x62ed('0x49')][_0x62ed('0x73')]['length'];_0x15a3bf+=0x1){socket['emit'](_0x62ed('0x118'),{'UserId':Number(_0x47725b[_0x62ed('0x49')][_0x62ed('0x73')][_0x15a3bf]),'ChatWebsiteId':Number(_0x47725b[_0x62ed('0x6a')]['id'])});}}else{socket[_0x62ed('0x115')](_0x62ed('0x118'),{'UserId':Number(_0x47725b['query'][_0x62ed('0x73')]),'ChatWebsiteId':Number(_0x47725b[_0x62ed('0x6a')]['id'])});}});}})['then'](respondWithStatusCode(_0x27d8e7,null))[_0x62ed('0x2e')](handleError(_0x27d8e7,null));};exports[_0x62ed('0x119')]=function(_0x28172f,_0x281300,_0x5b1929){var _0x43efd5={};var _0x5db70c={};var _0x2b4e89;var _0x3409e0;return db[_0x62ed('0x45')]['findOne']({'where':{'id':_0x28172f['params']['id']}})['then'](handleEntityNotFound(_0x281300,null))['then'](function(_0x56bfd9){if(_0x56bfd9){_0x2b4e89=_0x56bfd9;_0x5db70c[_0x62ed('0x47')]=_[_0x62ed('0x48')](db[_0x62ed('0xc8')][_0x62ed('0x46')]);_0x5db70c[_0x62ed('0x49')]=_[_0x62ed('0x48')](_0x28172f[_0x62ed('0x49')]);_0x5db70c[_0x62ed('0x50')]=_[_0x62ed('0x4a')](_0x5db70c[_0x62ed('0x47')],_0x5db70c[_0x62ed('0x49')]);_0x43efd5['attributes']=_[_0x62ed('0x4a')](_0x5db70c[_0x62ed('0x47')],qs[_0x62ed('0x4c')](_0x28172f[_0x62ed('0x49')]['fields']));_0x43efd5[_0x62ed('0x4b')]=_0x43efd5[_0x62ed('0x4b')][_0x62ed('0x5d')]?_0x43efd5[_0x62ed('0x4b')]:_0x5db70c['model'];_0x43efd5[_0x62ed('0x4e')]=qs[_0x62ed('0x4f')](_0x28172f[_0x62ed('0x49')]['sort']);_0x43efd5[_0x62ed('0x54')]=qs[_0x62ed('0x50')](_['pick'](_0x28172f[_0x62ed('0x49')],_0x5db70c[_0x62ed('0x50')]));if(_0x28172f['query'][_0x62ed('0x52')]){_0x43efd5['where']=_[_0x62ed('0x53')](_0x43efd5[_0x62ed('0x54')],{'$or':_[_0x62ed('0x55')](_0x43efd5[_0x62ed('0x4b')],function(_0x2f5995){var _0x4325e7={};_0x4325e7[_0x2f5995]={'$like':'%'+_0x28172f['query'][_0x62ed('0x52')]+'%'};return _0x4325e7;})});}_0x43efd5=_[_0x62ed('0x53')]({},_0x43efd5,_0x28172f['options']);return _0x2b4e89[_0x62ed('0x119')](_0x43efd5);}})[_0x62ed('0x24')](function(_0x5ab575){if(_0x5ab575){_0x3409e0=_0x5ab575['length'];if(!_0x28172f['query'][_0x62ed('0x70')]('nolimit')){_0x43efd5['limit']=qs[_0x62ed('0x35')](_0x28172f[_0x62ed('0x49')][_0x62ed('0x35')]);_0x43efd5[_0x62ed('0x34')]=qs[_0x62ed('0x34')](_0x28172f[_0x62ed('0x49')]['offset']);}return _0x2b4e89[_0x62ed('0x119')](_0x43efd5);}})[_0x62ed('0x24')](function(_0x150d1a){if(_0x150d1a){return _0x150d1a?{'count':_0x3409e0,'rows':_0x150d1a}:null;}})[_0x62ed('0x24')](respondWithResult(_0x281300,null))[_0x62ed('0x2e')](handleError(_0x281300,null));}; \ No newline at end of file +var _0xfe50=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','defaults','redis','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','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','json','offset','limit','set','Content-Range','apply','reject','destroy','get','ChatWebsites','UserProfileResource','end','sendStatus','name','Pause','mandatoryDispositionPause','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','ChatWebsite','count','includeAll','include','findAll','show','rawAttributes','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','update','params','describe','ChatWebsiteId','Disposition','getDispositions','findOne','nolimit','removeDispositions','ids','CannedAnswer','getAnswers','order','rows','removeAnswers','sitepic','filename','addAvatar','agentAvatar','file','addCustomerAvatar','customerAvatar','getLogo','join','../../config/license/util','getLicense','custom','isNil','existsSync','root','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','showCustomerAvatar','getSystemAvatar','systemAvatar','user-agent-parser','setUA','headers','user-agent','getResult','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','Sequelize','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','ChatApplication','Applications','account','list','orderBy','applications','priority','asc','firstName','customerIp','browser','version','format','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','stringify','threadId','ChatInteraction','ContactId','interaction','spread','contact','messageId','autoclose','push','close','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','notify','offline','from\x20is\x20mandatory','send','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKeyOffline','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','addInteraction','getInteractions','User','Owner','fullname','internal','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','No\x20timezone','inspect','Interval','increment','chatLicenseExceeded','Intervals','all','some','remote','x-forwarded-for','connection','remoteAddress','replace','render','alignment','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','omit','getProactiveActions','ChatProactiveAction','getFields','online','offlineForm','onlineForm','items','fromKey','getOfflineMessages','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse'];(function(_0x48acb0,_0x3374db){var _0x2bf5f5=function(_0x822fb8){while(--_0x822fb8){_0x48acb0['push'](_0x48acb0['shift']());}};_0x2bf5f5(++_0x3374db);}(_0xfe50,0x101));var _0x0fe5=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xfe50[_0x3bf83f];return _0x22c4a9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0fe5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0fe5('0x1'));var jsonpatch=require(_0x0fe5('0x2'));var rp=require('request-promise');var moment=require(_0x0fe5('0x3'));var BPromise=require(_0x0fe5('0x4'));var Mustache=require(_0x0fe5('0x5'));var util=require(_0x0fe5('0x6'));var path=require('path');var sox=require(_0x0fe5('0x7'));var csv=require(_0x0fe5('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0fe5('0x9'));var squel=require('squel');var crypto=require(_0x0fe5('0xa'));var jsforce=require(_0x0fe5('0xb'));var deskjs=require(_0x0fe5('0xc'));var toCsv=require(_0x0fe5('0x8'));var querystring=require('querystring');var Papa=require(_0x0fe5('0xd'));var Redis=require(_0x0fe5('0xe'));var authService=require(_0x0fe5('0xf'));var qs=require(_0x0fe5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0fe5('0x11'))('api');var utils=require(_0x0fe5('0x12'));var config=require('../../config/environment');var db=require(_0x0fe5('0x13'))['db'];config['redis']=_[_0x0fe5('0x14')](config[_0x0fe5('0x15')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0fe5('0x15')]));require('./chatWebsite.socket')[_0x0fe5('0x16')](socket);var jayson=require(_0x0fe5('0x17'));var client=jayson[_0x0fe5('0x18')][_0x0fe5('0x19')]({'port':0x232c});var client9002=jayson[_0x0fe5('0x18')][_0x0fe5('0x19')]({'port':0x232a});var client9003=jayson[_0x0fe5('0x18')][_0x0fe5('0x19')]({'port':0x232b});function checkPasswordPattern(_0x228169,_0x1bc1ee,_0x5a3714){if(_0x5a3714){var _0x3469bf=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3469bf[_0x0fe5('0x1a')](_0x1bc1ee)){return _0x228169;}else{throw new Error(_0x0fe5('0x1b'));}}else{return _0x228169;}}function respondWithRpcPromise(_0x2372b7,_0x31dfea,_0x2c9e2f,_0x26ddf6){return new BPromise(function(_0x44b8ab,_0x4af7a9){var _0x4e946=_0x26ddf6||client;return _0x4e946[_0x0fe5('0x1c')](_0x2372b7,_0x2c9e2f)[_0x0fe5('0x1d')](function(_0x418ddb){logger[_0x0fe5('0x1e')](_0x0fe5('0x1f'),_0x31dfea,_0x0fe5('0x20'));logger[_0x0fe5('0x21')](_0x0fe5('0x22'),_0x31dfea,_0x0fe5('0x20'),JSON['stringify'](_0x418ddb));if(_0x418ddb[_0x0fe5('0x23')]){if(_0x418ddb[_0x0fe5('0x23')][_0x0fe5('0x24')]===0x1f4){logger[_0x0fe5('0x23')](_0x0fe5('0x1f'),_0x31dfea,_0x418ddb[_0x0fe5('0x23')][_0x0fe5('0x25')]);return _0x4af7a9(_0x418ddb[_0x0fe5('0x23')]['message']);}logger[_0x0fe5('0x23')]('ChatWebsite,\x20%s,\x20%s',_0x31dfea,_0x418ddb[_0x0fe5('0x23')]['message']);return _0x44b8ab(_0x418ddb[_0x0fe5('0x23')][_0x0fe5('0x25')]);}else{logger[_0x0fe5('0x1e')](_0x0fe5('0x1f'),_0x31dfea,_0x0fe5('0x20'));_0x44b8ab(_0x418ddb[_0x0fe5('0x26')][_0x0fe5('0x25')]);}})[_0x0fe5('0x27')](function(_0x4fbef8){logger[_0x0fe5('0x23')](_0x0fe5('0x1f'),_0x31dfea,_0x4fbef8);_0x4af7a9(_0x4fbef8);});});}function respondWithStatusCode(_0x549ad9,_0x30d2fd){_0x30d2fd=_0x30d2fd||0xcc;return function(_0x31bea5){if(_0x31bea5){return _0x549ad9['sendStatus'](_0x30d2fd);}return _0x549ad9[_0x0fe5('0x28')](_0x30d2fd)['end']();};}function respondWithResult(_0xa979c,_0x83f762){_0x83f762=_0x83f762||0xc8;return function(_0x1827b2){if(_0x1827b2){return _0xa979c[_0x0fe5('0x28')](_0x83f762)[_0x0fe5('0x29')](_0x1827b2);}};}function respondWithFilteredResult(_0xccc0cd,_0x472211){return function(_0x213f6c){if(_0x213f6c){var _0x259644=_0x213f6c['count'],_0xce8b0d=_0x472211[_0x0fe5('0x2a')],_0x59e8b2=_0x472211[_0x0fe5('0x2a')]+_0x472211[_0x0fe5('0x2b')],_0x3825b7;if(_0x59e8b2>=_0x259644){_0x59e8b2=_0x259644;_0x3825b7=0xc8;}else{_0x3825b7=0xce;}_0xccc0cd[_0x0fe5('0x28')](_0x3825b7);return _0xccc0cd[_0x0fe5('0x2c')](_0x0fe5('0x2d'),_0xce8b0d+'-'+_0x59e8b2+'/'+_0x259644)[_0x0fe5('0x29')](_0x213f6c);}return null;};}function patchUpdates(_0x23e97d){return function(_0x400ff8){try{jsonpatch[_0x0fe5('0x2e')](_0x400ff8,_0x23e97d,!![]);}catch(_0x27442e){return BPromise[_0x0fe5('0x2f')](_0x27442e);}return _0x400ff8['save']();};}function saveUpdates(_0xbdc372,_0x35bf7){return function(_0x1e4272){if(_0x1e4272){return _0x1e4272['update'](_0xbdc372)['then'](function(_0x38ade4){return _0x38ade4;});}return null;};}function removeEntity(_0xdb0ade,_0x128d38){return function(_0x534574){if(_0x534574){return _0x534574[_0x0fe5('0x30')]()['then'](function(){var _0x396dc6=_0x534574[_0x0fe5('0x31')]({'plain':!![]});var _0x35aeb0=_0x0fe5('0x32');return db[_0x0fe5('0x33')][_0x0fe5('0x30')]({'where':{'type':_0x35aeb0,'resourceId':_0x396dc6['id']}})[_0x0fe5('0x1d')](function(){return _0x534574;});})[_0x0fe5('0x1d')](function(){_0xdb0ade[_0x0fe5('0x28')](0xcc)[_0x0fe5('0x34')]();});}};}function handleEntityNotFound(_0x2fbb80,_0x1eb13d){return function(_0x31fbcd){if(!_0x31fbcd){_0x2fbb80[_0x0fe5('0x35')](0x194);}return _0x31fbcd;};}function handleError(_0x58a48e,_0x3c69c0){_0x3c69c0=_0x3c69c0||0x1f4;return function(_0x3aa64d){logger['error'](_0x3aa64d['stack']);if(_0x3aa64d[_0x0fe5('0x36')]){delete _0x3aa64d['name'];}_0x58a48e[_0x0fe5('0x28')](_0x3c69c0)['send'](_0x3aa64d);};}exports['index']=function(_0x1f41d9,_0x388684){var _0x28250d={'include':[{'model':db[_0x0fe5('0x37')],'as':_0x0fe5('0x38')}]},_0x54ad84={},_0xf0af4c={'count':0x0,'rows':[]};var _0x380d17=db['ChatWebsite']['rawAttributes'];_0x54ad84[_0x0fe5('0x39')]=_[_0x0fe5('0x3a')](_0x380d17);_0x54ad84['query']=_[_0x0fe5('0x3a')](_0x1f41d9[_0x0fe5('0x3b')]);_0x54ad84[_0x0fe5('0x3c')]=_[_0x0fe5('0x3d')](_0x54ad84[_0x0fe5('0x39')],_0x54ad84['query']);_0x28250d['attributes']=_[_0x0fe5('0x3d')](_0x54ad84[_0x0fe5('0x39')],qs['fields'](_0x1f41d9[_0x0fe5('0x3b')][_0x0fe5('0x3e')]));_0x28250d[_0x0fe5('0x3f')]=_0x28250d['attributes']['length']?_0x28250d[_0x0fe5('0x3f')]:_0x54ad84[_0x0fe5('0x39')];if(!_0x1f41d9[_0x0fe5('0x3b')][_0x0fe5('0x40')]('nolimit')){_0x28250d['limit']=qs[_0x0fe5('0x2b')](_0x1f41d9['query'][_0x0fe5('0x2b')]);_0x28250d[_0x0fe5('0x2a')]=qs['offset'](_0x1f41d9[_0x0fe5('0x3b')][_0x0fe5('0x2a')]);}_0x28250d['order']=qs[_0x0fe5('0x41')](_0x1f41d9[_0x0fe5('0x3b')][_0x0fe5('0x41')]);_0x28250d[_0x0fe5('0x42')]=qs[_0x0fe5('0x3c')](_[_0x0fe5('0x43')](_0x1f41d9[_0x0fe5('0x3b')],_0x54ad84[_0x0fe5('0x3c')]));if(_0x1f41d9[_0x0fe5('0x3b')][_0x0fe5('0x44')]){_0x28250d[_0x0fe5('0x42')]=_[_0x0fe5('0x45')](_0x28250d[_0x0fe5('0x42')],{'$or':_[_0x0fe5('0x46')](_0x380d17,function(_0x320cc0){if(_0x320cc0[_0x0fe5('0x47')][_0x0fe5('0x48')]!==_0x0fe5('0x49')){var _0x4acc29={};_0x4acc29[_0x320cc0[_0x0fe5('0x4a')]]={'$like':'%'+_0x1f41d9[_0x0fe5('0x3b')][_0x0fe5('0x44')]+'%'};return _0x4acc29;}})});}_0x28250d=_[_0x0fe5('0x45')]({},_0x28250d,_0x1f41d9[_0x0fe5('0x4b')]);var _0x147cc6={'where':_0x28250d[_0x0fe5('0x42')]};return db[_0x0fe5('0x4c')][_0x0fe5('0x4d')](_0x147cc6)['then'](function(_0x45c024){_0xf0af4c[_0x0fe5('0x4d')]=_0x45c024;if(_0x1f41d9[_0x0fe5('0x3b')][_0x0fe5('0x4e')]){_0x28250d[_0x0fe5('0x4f')]=[{'all':!![]}];}return db[_0x0fe5('0x4c')][_0x0fe5('0x50')](_0x28250d);})[_0x0fe5('0x1d')](function(_0x162ee3){_0xf0af4c['rows']=_0x162ee3;return _0xf0af4c;})[_0x0fe5('0x1d')](respondWithFilteredResult(_0x388684,_0x28250d))['catch'](handleError(_0x388684,null));};exports[_0x0fe5('0x51')]=function(_0x562a7a,_0x19c0b6){var _0x4774f5={'raw':![],'where':{'id':_0x562a7a['params']['id']},'include':[{'model':db['Pause'],'as':_0x0fe5('0x38')}]},_0x2c386e={};_0x2c386e['model']=_['keys'](db[_0x0fe5('0x4c')][_0x0fe5('0x52')]);_0x2c386e[_0x0fe5('0x3b')]=_[_0x0fe5('0x3a')](_0x562a7a[_0x0fe5('0x3b')]);_0x2c386e[_0x0fe5('0x3c')]=_[_0x0fe5('0x3d')](_0x2c386e[_0x0fe5('0x39')],_0x2c386e[_0x0fe5('0x3b')]);_0x4774f5[_0x0fe5('0x3f')]=_[_0x0fe5('0x3d')](_0x2c386e['model'],qs['fields'](_0x562a7a['query']['fields']));_0x4774f5[_0x0fe5('0x3f')]=_0x4774f5[_0x0fe5('0x3f')][_0x0fe5('0x53')]?_0x4774f5[_0x0fe5('0x3f')]:_0x2c386e[_0x0fe5('0x39')];if(_0x562a7a[_0x0fe5('0x3b')][_0x0fe5('0x4e')]){_0x4774f5[_0x0fe5('0x4f')]=[{'all':!![]}];}_0x4774f5=_['merge']({},_0x4774f5,_0x562a7a[_0x0fe5('0x4b')]);return db['ChatWebsite'][_0x0fe5('0x54')](_0x4774f5)[_0x0fe5('0x1d')](handleEntityNotFound(_0x19c0b6,null))['then'](respondWithResult(_0x19c0b6,null))[_0x0fe5('0x27')](handleError(_0x19c0b6,null));};exports[_0x0fe5('0x55')]=function(_0x6cf7a,_0x250cf2){return db[_0x0fe5('0x4c')]['create'](_0x6cf7a[_0x0fe5('0x56')],{})['then'](function(_0x55c756){var _0x2ba8f1=_0x6cf7a[_0x0fe5('0x57')]['get']({'plain':!![]});if(!_0x2ba8f1)throw new Error(_0x0fe5('0x58'));if(_0x2ba8f1[_0x0fe5('0x59')]==='user'){var _0x5314d8=_0x55c756[_0x0fe5('0x31')]({'plain':!![]});var _0x50aac4=_0x0fe5('0x32');return db['UserProfileSection'][_0x0fe5('0x54')]({'where':{'name':_0x50aac4,'userProfileId':_0x2ba8f1[_0x0fe5('0x5a')]},'raw':!![]})[_0x0fe5('0x1d')](function(_0xe1bd1b){if(_0xe1bd1b&&_0xe1bd1b[_0x0fe5('0x5b')]===0x0){return db['UserProfileResource'][_0x0fe5('0x55')]({'name':_0x5314d8['name'],'resourceId':_0x5314d8['id'],'type':_0xe1bd1b[_0x0fe5('0x36')],'sectionId':_0xe1bd1b['id']},{})['then'](function(){return _0x55c756;});}else{return _0x55c756;}})[_0x0fe5('0x27')](function(_0x41f008){logger[_0x0fe5('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x41f008);throw _0x41f008;});}return _0x55c756;})['then'](respondWithResult(_0x250cf2,0xc9))[_0x0fe5('0x27')](handleError(_0x250cf2,null));};exports[_0x0fe5('0x5c')]=function(_0x32c8d3,_0x4141e0){if(_0x32c8d3[_0x0fe5('0x56')]['id']){delete _0x32c8d3[_0x0fe5('0x56')]['id'];}return db[_0x0fe5('0x4c')]['find']({'where':{'id':_0x32c8d3[_0x0fe5('0x5d')]['id']},'include':[{'model':db[_0x0fe5('0x37')],'as':'mandatoryDispositionPause'}]})[_0x0fe5('0x1d')](handleEntityNotFound(_0x4141e0,null))[_0x0fe5('0x1d')](saveUpdates(_0x32c8d3[_0x0fe5('0x56')],null))[_0x0fe5('0x1d')](respondWithResult(_0x4141e0,null))['catch'](handleError(_0x4141e0,null));};exports[_0x0fe5('0x30')]=function(_0x534903,_0x2fd5e7){return db['ChatWebsite']['find']({'where':{'id':_0x534903[_0x0fe5('0x5d')]['id']}})['then'](handleEntityNotFound(_0x2fd5e7,null))[_0x0fe5('0x1d')](removeEntity(_0x2fd5e7,null))[_0x0fe5('0x27')](handleError(_0x2fd5e7,null));};exports[_0x0fe5('0x5e')]=function(_0x178366,_0x42a0af){return db[_0x0fe5('0x4c')][_0x0fe5('0x5e')]()[_0x0fe5('0x1d')](respondWithResult(_0x42a0af,null))[_0x0fe5('0x27')](handleError(_0x42a0af,null));};exports['addDisposition']=function(_0x14e7b9,_0x3bfe18,_0x3b904c){if(_0x14e7b9[_0x0fe5('0x56')]['id']){delete _0x14e7b9[_0x0fe5('0x56')]['id'];}return db[_0x0fe5('0x4c')][_0x0fe5('0x54')]({'where':{'id':_0x14e7b9[_0x0fe5('0x5d')]['id']}})[_0x0fe5('0x1d')](handleEntityNotFound(_0x3bfe18,null))[_0x0fe5('0x1d')](function(_0x3fd46c){if(_0x3fd46c){_0x14e7b9[_0x0fe5('0x56')][_0x0fe5('0x5f')]=_0x3fd46c['id'];return db[_0x0fe5('0x60')]['create'](_0x14e7b9[_0x0fe5('0x56')]);}})['then'](respondWithResult(_0x3bfe18,null))[_0x0fe5('0x27')](handleError(_0x3bfe18,null));};exports[_0x0fe5('0x61')]=function(_0x55c1f4,_0xdb37ec,_0x279d1a){var _0x531f62={'raw':![],'where':{}};var _0x4bbb9b={};var _0x50789a={'count':0x0,'rows':[]};return db[_0x0fe5('0x4c')][_0x0fe5('0x62')]({'where':{'id':_0x55c1f4[_0x0fe5('0x5d')]['id']}})[_0x0fe5('0x1d')](handleEntityNotFound(_0xdb37ec,null))['then'](function(_0x45b344){if(_0x45b344){_0x4bbb9b[_0x0fe5('0x39')]=_['keys'](db[_0x0fe5('0x60')][_0x0fe5('0x52')]);_0x4bbb9b[_0x0fe5('0x3b')]=_[_0x0fe5('0x3a')](_0x55c1f4[_0x0fe5('0x3b')]);_0x4bbb9b[_0x0fe5('0x3c')]=_[_0x0fe5('0x3d')](_0x4bbb9b['model'],_0x4bbb9b[_0x0fe5('0x3b')]);_0x531f62[_0x0fe5('0x3f')]=_[_0x0fe5('0x3d')](_0x4bbb9b['model'],qs[_0x0fe5('0x3e')](_0x55c1f4[_0x0fe5('0x3b')][_0x0fe5('0x3e')]));_0x531f62[_0x0fe5('0x3f')]=_0x531f62['attributes'][_0x0fe5('0x53')]?_0x531f62[_0x0fe5('0x3f')]:_0x4bbb9b['model'];if(!_0x55c1f4[_0x0fe5('0x3b')][_0x0fe5('0x40')](_0x0fe5('0x63'))){_0x531f62[_0x0fe5('0x2b')]=qs[_0x0fe5('0x2b')](_0x55c1f4[_0x0fe5('0x3b')][_0x0fe5('0x2b')]);_0x531f62[_0x0fe5('0x2a')]=qs[_0x0fe5('0x2a')](_0x55c1f4['query'][_0x0fe5('0x2a')]);}_0x531f62['order']=qs[_0x0fe5('0x41')](_0x55c1f4[_0x0fe5('0x3b')][_0x0fe5('0x41')]);_0x531f62[_0x0fe5('0x42')]=qs[_0x0fe5('0x3c')](_[_0x0fe5('0x43')](_0x55c1f4['query'],_0x4bbb9b[_0x0fe5('0x3c')]));_0x531f62[_0x0fe5('0x42')][_0x0fe5('0x5f')]=_0x45b344['id'];if(_0x55c1f4[_0x0fe5('0x3b')][_0x0fe5('0x44')]){_0x531f62[_0x0fe5('0x42')]=_[_0x0fe5('0x45')](_0x531f62[_0x0fe5('0x42')],{'$or':_[_0x0fe5('0x46')](_0x531f62[_0x0fe5('0x3f')],function(_0x31e878){var _0x49fbd7={};_0x49fbd7[_0x31e878]={'$like':'%'+_0x55c1f4[_0x0fe5('0x3b')]['filter']+'%'};return _0x49fbd7;})});}_0x531f62=_[_0x0fe5('0x45')]({},_0x531f62,_0x55c1f4[_0x0fe5('0x4b')]);return db[_0x0fe5('0x60')][_0x0fe5('0x4d')]({'where':_0x531f62[_0x0fe5('0x42')]})['then'](function(_0x2f1db9){_0x50789a['count']=_0x2f1db9;if(_0x55c1f4['query']['includeAll']){_0x531f62[_0x0fe5('0x4f')]=[{'all':!![]}];}return db[_0x0fe5('0x60')][_0x0fe5('0x50')](_0x531f62);})[_0x0fe5('0x1d')](function(_0x28f712){_0x50789a['rows']=_0x28f712;return _0x50789a;});}})[_0x0fe5('0x1d')](respondWithFilteredResult(_0xdb37ec,_0x531f62))[_0x0fe5('0x27')](handleError(_0xdb37ec,null));};exports[_0x0fe5('0x64')]=function(_0x134108,_0x54cc02,_0x4fad01){return db[_0x0fe5('0x4c')][_0x0fe5('0x54')]({'where':{'id':_0x134108[_0x0fe5('0x5d')]['id']}})[_0x0fe5('0x1d')](handleEntityNotFound(_0x54cc02,null))[_0x0fe5('0x1d')](function(_0x48399d){if(_0x48399d){return _0x48399d['removeDispositions'](_0x134108[_0x0fe5('0x3b')][_0x0fe5('0x65')]);}})['then'](respondWithStatusCode(_0x54cc02,null))[_0x0fe5('0x27')](handleError(_0x54cc02,null));};exports['addAnswer']=function(_0x53dd66,_0xe7837f,_0x202bbe){if(_0x53dd66['body']['id']){delete _0x53dd66[_0x0fe5('0x56')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x53dd66[_0x0fe5('0x5d')]['id']}})['then'](handleEntityNotFound(_0xe7837f,null))[_0x0fe5('0x1d')](function(_0x45b37b){if(_0x45b37b){_0x53dd66[_0x0fe5('0x56')][_0x0fe5('0x5f')]=_0x45b37b['id'];return db[_0x0fe5('0x66')][_0x0fe5('0x55')](_0x53dd66[_0x0fe5('0x56')]);}})[_0x0fe5('0x1d')](respondWithResult(_0xe7837f,null))[_0x0fe5('0x27')](handleError(_0xe7837f,null));};exports[_0x0fe5('0x67')]=function(_0x58d684,_0xdbc6d5,_0x5dde96){var _0x421255={'raw':![],'where':{}};var _0x5ce911={};var _0x25e542={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x0fe5('0x62')]({'where':{'id':_0x58d684['params']['id']}})['then'](handleEntityNotFound(_0xdbc6d5,null))[_0x0fe5('0x1d')](function(_0x58a95e){if(_0x58a95e){_0x5ce911['model']=_[_0x0fe5('0x3a')](db[_0x0fe5('0x66')]['rawAttributes']);_0x5ce911[_0x0fe5('0x3b')]=_[_0x0fe5('0x3a')](_0x58d684['query']);_0x5ce911[_0x0fe5('0x3c')]=_[_0x0fe5('0x3d')](_0x5ce911['model'],_0x5ce911[_0x0fe5('0x3b')]);_0x421255[_0x0fe5('0x3f')]=_[_0x0fe5('0x3d')](_0x5ce911[_0x0fe5('0x39')],qs['fields'](_0x58d684[_0x0fe5('0x3b')][_0x0fe5('0x3e')]));_0x421255['attributes']=_0x421255['attributes'][_0x0fe5('0x53')]?_0x421255['attributes']:_0x5ce911[_0x0fe5('0x39')];if(!_0x58d684['query'][_0x0fe5('0x40')](_0x0fe5('0x63'))){_0x421255['limit']=qs[_0x0fe5('0x2b')](_0x58d684['query'][_0x0fe5('0x2b')]);_0x421255[_0x0fe5('0x2a')]=qs['offset'](_0x58d684['query'][_0x0fe5('0x2a')]);}_0x421255[_0x0fe5('0x68')]=qs[_0x0fe5('0x41')](_0x58d684[_0x0fe5('0x3b')][_0x0fe5('0x41')]);_0x421255[_0x0fe5('0x42')]=qs[_0x0fe5('0x3c')](_[_0x0fe5('0x43')](_0x58d684[_0x0fe5('0x3b')],_0x5ce911[_0x0fe5('0x3c')]));_0x421255['where'][_0x0fe5('0x5f')]=_0x58a95e['id'];if(_0x58d684[_0x0fe5('0x3b')][_0x0fe5('0x44')]){_0x421255[_0x0fe5('0x42')]=_['merge'](_0x421255[_0x0fe5('0x42')],{'$or':_[_0x0fe5('0x46')](_0x421255[_0x0fe5('0x3f')],function(_0x2d8a55){var _0x1ecfe1={};_0x1ecfe1[_0x2d8a55]={'$like':'%'+_0x58d684[_0x0fe5('0x3b')]['filter']+'%'};return _0x1ecfe1;})});}_0x421255=_[_0x0fe5('0x45')]({},_0x421255,_0x58d684['options']);return db[_0x0fe5('0x66')]['count']({'where':_0x421255[_0x0fe5('0x42')]})['then'](function(_0x25326c){_0x25e542[_0x0fe5('0x4d')]=_0x25326c;if(_0x58d684[_0x0fe5('0x3b')][_0x0fe5('0x4e')]){_0x421255[_0x0fe5('0x4f')]=[{'all':!![]}];}return db['CannedAnswer'][_0x0fe5('0x50')](_0x421255);})[_0x0fe5('0x1d')](function(_0xed60e8){_0x25e542[_0x0fe5('0x69')]=_0xed60e8;return _0x25e542;});}})[_0x0fe5('0x1d')](respondWithFilteredResult(_0xdbc6d5,_0x421255))[_0x0fe5('0x27')](handleError(_0xdbc6d5,null));};exports[_0x0fe5('0x6a')]=function(_0x47f563,_0x5d9e8c,_0x11383e){return db['ChatWebsite']['find']({'where':{'id':_0x47f563[_0x0fe5('0x5d')]['id']}})[_0x0fe5('0x1d')](handleEntityNotFound(_0x5d9e8c,null))[_0x0fe5('0x1d')](function(_0x51f75f){if(_0x51f75f){return _0x51f75f[_0x0fe5('0x6a')](_0x47f563[_0x0fe5('0x3b')][_0x0fe5('0x65')]);}})['then'](respondWithStatusCode(_0x5d9e8c,null))[_0x0fe5('0x27')](handleError(_0x5d9e8c,null));};exports['addLogo']=function(_0x237198,_0x3db5b4,_0x3aa799){_0x237198[_0x0fe5('0x56')][_0x0fe5('0x6b')]=_0x237198['file'][_0x0fe5('0x6c')];return db[_0x0fe5('0x4c')][_0x0fe5('0x54')]({'where':{'id':_0x237198[_0x0fe5('0x5d')]['id']}})['then'](handleEntityNotFound(_0x3db5b4,null))['then'](saveUpdates(_0x237198[_0x0fe5('0x56')],null))[_0x0fe5('0x1d')](respondWithResult(_0x3db5b4,null))[_0x0fe5('0x27')](handleError(_0x3db5b4,null));};exports[_0x0fe5('0x6d')]=function(_0x50dadf,_0x5d6b64,_0x514106){_0x50dadf['body'][_0x0fe5('0x6e')]=_0x50dadf[_0x0fe5('0x6f')][_0x0fe5('0x6c')];return db['ChatWebsite']['find']({'where':{'id':_0x50dadf[_0x0fe5('0x5d')]['id']}})[_0x0fe5('0x1d')](handleEntityNotFound(_0x5d6b64,null))[_0x0fe5('0x1d')](saveUpdates(_0x50dadf[_0x0fe5('0x56')],null))[_0x0fe5('0x1d')](respondWithResult(_0x5d6b64,null))[_0x0fe5('0x27')](handleError(_0x5d6b64,null));};exports[_0x0fe5('0x70')]=function(_0x97779,_0x2b3642,_0x38a5b1){_0x97779[_0x0fe5('0x56')][_0x0fe5('0x71')]=_0x97779[_0x0fe5('0x6f')][_0x0fe5('0x6c')];return db[_0x0fe5('0x4c')][_0x0fe5('0x54')]({'where':{'id':_0x97779['params']['id']}})[_0x0fe5('0x1d')](handleEntityNotFound(_0x2b3642,null))['then'](saveUpdates(_0x97779[_0x0fe5('0x56')],null))['then'](respondWithResult(_0x2b3642,null))[_0x0fe5('0x27')](handleError(_0x2b3642,null));};exports['addSystemAvatar']=function(_0x1c7182,_0x5baa1c,_0x32ad34){_0x1c7182[_0x0fe5('0x56')]['systemAvatar']=_0x1c7182[_0x0fe5('0x6f')][_0x0fe5('0x6c')];return db[_0x0fe5('0x4c')][_0x0fe5('0x54')]({'where':{'id':_0x1c7182[_0x0fe5('0x5d')]['id']}})[_0x0fe5('0x1d')](handleEntityNotFound(_0x5baa1c,null))['then'](saveUpdates(_0x1c7182[_0x0fe5('0x56')],null))[_0x0fe5('0x1d')](respondWithResult(_0x5baa1c,null))[_0x0fe5('0x27')](handleError(_0x5baa1c,null));};exports[_0x0fe5('0x72')]=function(_0x3cdf87,_0x3479bf,_0x5eb6a5){var _0x14a44f=path[_0x0fe5('0x73')](config['root'],'server/files/images/logos/default_logo.png');var _0x2f8793={'where':{'id':_0x3cdf87[_0x0fe5('0x5d')]['id']},'attributes':['id',_0x0fe5('0x6b')],'raw':!![]};var _0x1dfb19=![];return require(_0x0fe5('0x74'))[_0x0fe5('0x75')]()[_0x0fe5('0x1d')](function(_0x138905){if(_0x138905){_0x1dfb19=_0x138905[_0x0fe5('0x76')];}})[_0x0fe5('0x1d')](function(){return db[_0x0fe5('0x4c')][_0x0fe5('0x54')](_0x2f8793);})[_0x0fe5('0x1d')](handleEntityNotFound(_0x3479bf,null))[_0x0fe5('0x1d')](function(_0x292dc9){if(_0x292dc9){if(!_[_0x0fe5('0x77')](_0x292dc9[_0x0fe5('0x6b')])){if(fs[_0x0fe5('0x78')](path[_0x0fe5('0x73')](config[_0x0fe5('0x79')],_0x0fe5('0x7a'),_0x292dc9[_0x0fe5('0x6b')]))&&_0x1dfb19){_0x14a44f=path[_0x0fe5('0x73')](config['root'],_0x0fe5('0x7a'),_0x292dc9[_0x0fe5('0x6b')]);}}return _0x3479bf[_0x0fe5('0x7b')](_0x14a44f);}})[_0x0fe5('0x27')](handleError(_0x3479bf,null));};exports['getAvatar']=function(_0x3cda09,_0x5ed7a8,_0x5a7b12){var _0xf77955=path['join'](config[_0x0fe5('0x79')],_0x0fe5('0x7c'));var _0x96b711={'where':{'id':_0x3cda09[_0x0fe5('0x5d')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x0fe5('0x4c')]['find'](_0x96b711)[_0x0fe5('0x1d')](handleEntityNotFound(_0x5ed7a8,null))[_0x0fe5('0x1d')](function(_0x3dfd7d){if(_0x3dfd7d){if(!_[_0x0fe5('0x77')](_0x3dfd7d['agentAvatar'])){if(fs[_0x0fe5('0x78')](path[_0x0fe5('0x73')](config[_0x0fe5('0x79')],_0x0fe5('0x7d'),_0x3dfd7d['agentAvatar']))){_0xf77955=path[_0x0fe5('0x73')](config['root'],'server/files/images/avatars/',_0x3dfd7d[_0x0fe5('0x6e')]);}}return _0x5ed7a8[_0x0fe5('0x7b')](_0xf77955);}})['catch'](handleError(_0x5ed7a8,null));};exports['getCustomerAvatar']=function(_0x2ade64,_0x44a5e2,_0x5e3878){var _0x288cd4=path['join'](config[_0x0fe5('0x79')],'server/files/images/avatars/customer_avatar.png');var _0x1f4fcb={'where':{'id':_0x2ade64[_0x0fe5('0x5d')]['id']},'attributes':['id',_0x0fe5('0x71'),_0x0fe5('0x7e')],'raw':!![]};return db[_0x0fe5('0x4c')]['find'](_0x1f4fcb)[_0x0fe5('0x1d')](handleEntityNotFound(_0x44a5e2,null))[_0x0fe5('0x1d')](function(_0x4f9eb6){if(_0x4f9eb6){if(!_[_0x0fe5('0x77')](_0x4f9eb6[_0x0fe5('0x71')])){if(fs[_0x0fe5('0x78')](path[_0x0fe5('0x73')](config['root'],_0x0fe5('0x7d'),_0x4f9eb6[_0x0fe5('0x71')]))&&_0x4f9eb6[_0x0fe5('0x7e')]){_0x288cd4=path[_0x0fe5('0x73')](config['root'],_0x0fe5('0x7d'),_0x4f9eb6[_0x0fe5('0x71')]);}}return _0x44a5e2['download'](_0x288cd4);}})[_0x0fe5('0x27')](handleError(_0x44a5e2,null));};exports[_0x0fe5('0x7f')]=function(_0x5bc7df,_0x42fa45,_0xf14efb){var _0x51915e=path['join'](config[_0x0fe5('0x79')],'server/files/images/avatars/system_avatar.png');var _0x57bcf3={'where':{'id':_0x5bc7df[_0x0fe5('0x5d')]['id']},'attributes':['id',_0x0fe5('0x80')],'raw':!![]};return db[_0x0fe5('0x4c')][_0x0fe5('0x54')](_0x57bcf3)['then'](handleEntityNotFound(_0x42fa45,null))['then'](function(_0x5764b0){if(_0x5764b0){if(!_[_0x0fe5('0x77')](_0x5764b0['systemAvatar'])){if(fs['existsSync'](path[_0x0fe5('0x73')](config[_0x0fe5('0x79')],'server/files/images/avatars/',_0x5764b0[_0x0fe5('0x80')]))){_0x51915e=path[_0x0fe5('0x73')](config[_0x0fe5('0x79')],_0x0fe5('0x7d'),_0x5764b0['systemAvatar']);}}return _0x42fa45[_0x0fe5('0x7b')](_0x51915e);}})['catch'](handleError(_0x42fa45,null));};exports['notify']=function(_0x12efab,_0x1b93ff,_0x5c651e){var _0x13fe50=require(_0x0fe5('0x81'));var _0x4a2ffd=new _0x13fe50();var _0x101127=_0x4a2ffd[_0x0fe5('0x82')](_0x12efab[_0x0fe5('0x83')][_0x0fe5('0x84')])[_0x0fe5('0x85')]();var _0x1a1223={'body':_0x12efab[_0x0fe5('0x56')],'channel':'chat'};var _0x116fe1=[];var _0x378528=[];var _0x387b08={};var _0x1c1477=![];return db[_0x0fe5('0x86')][_0x0fe5('0x5e')]()[_0x0fe5('0x1d')](function(_0x1fb4d4){if(!_0x1fb4d4){throw new db['Sequelize'][(_0x0fe5('0x87'))](_0x0fe5('0x88'));}_0x116fe1=_[_0x0fe5('0x89')](_[_0x0fe5('0x3a')](_0x1fb4d4),[_0x0fe5('0x8a'),_0x0fe5('0x8b')]);_0x378528=_[_0x0fe5('0x89')](_['keys'](_0x1fb4d4),[_0x0fe5('0x8a'),_0x0fe5('0x8b'),_0x0fe5('0x8c'),'ListId']);if(_0x12efab[_0x0fe5('0x56')]['id']){delete _0x12efab[_0x0fe5('0x56')]['id'];}if(_['isNil'](_0x12efab[_0x0fe5('0x56')][_0x0fe5('0x8d')])){throw new db['Sequelize'][(_0x0fe5('0x87'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x12efab[_0x0fe5('0x56')]['body'])||_0x12efab['body'][_0x0fe5('0x56')]===''){throw new db[(_0x0fe5('0x8e'))][(_0x0fe5('0x87'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x12efab['body'][_0x0fe5('0x8f')])){throw new db[(_0x0fe5('0x8e'))][(_0x0fe5('0x87'))](_0x0fe5('0x90')+_0x378528);}if(!_['includes'](_0x378528,_0x12efab['body'][_0x0fe5('0x8f')])){throw new db[(_0x0fe5('0x8e'))][(_0x0fe5('0x87'))](_0x0fe5('0x91')+_0x378528);}_0x387b08[_0x12efab[_0x0fe5('0x56')][_0x0fe5('0x8f')]]=_0x12efab[_0x0fe5('0x56')][_0x0fe5('0x8d')];})[_0x0fe5('0x1d')](function(){return db[_0x0fe5('0x4c')][_0x0fe5('0x54')]({'where':{'id':_0x12efab['params']['id']},'include':[{'model':db[_0x0fe5('0x92')],'as':_0x0fe5('0x93'),'include':[{'model':db[_0x0fe5('0x86')],'as':_0x0fe5('0x94'),'where':_0x387b08,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x0fe5('0x95')],'as':_0x0fe5('0x96')}]});})[_0x0fe5('0x1d')](handleEntityNotFound(_0x1b93ff,null))[_0x0fe5('0x1d')](function(_0x8e8c60){if(_0x8e8c60&&_0x8e8c60['List']){_0x1a1223[_0x0fe5('0x97')]=_0x8e8c60;_0x1a1223['applications']=_0x8e8c60[_0x0fe5('0x96')];_0x1a1223[_0x0fe5('0x98')]=_0x8e8c60[_0x0fe5('0x93')];_0x1a1223['applications']=_[_0x0fe5('0x99')](_0x1a1223[_0x0fe5('0x9a')],[_0x0fe5('0x9b')],[_0x0fe5('0x9c')]);if(_0x1a1223[_0x0fe5('0x97')][_0x0fe5('0x96')]){delete _0x1a1223['account'][_0x0fe5('0x96')];}if(_0x1a1223[_0x0fe5('0x97')][_0x0fe5('0x93')]&&_0x1a1223['account']['List'][_0x0fe5('0x94')][_0x0fe5('0x53')]){return _0x1a1223[_0x0fe5('0x97')][_0x0fe5('0x93')][_0x0fe5('0x94')][0x0];}var _0x57844f=_[_0x0fe5('0x14')](_0x12efab[_0x0fe5('0x56')],{'firstName':_0x12efab[_0x0fe5('0x56')][_0x0fe5('0x8d')],'ListId':_0x8e8c60['ListId']});_0x57844f[_0x12efab[_0x0fe5('0x56')][_0x0fe5('0x8f')]]=_0x12efab[_0x0fe5('0x56')]['from'];return db[_0x0fe5('0x86')]['create'](_0x57844f,{'fields':_0x116fe1,'raw':!![]});}})['then'](handleEntityNotFound(_0x1b93ff,null))[_0x0fe5('0x1d')](function(_0x3d86fb){_0x1a1223['contact']=_0x3d86fb;if(_0x3d86fb){var _0x1b3be4={'ContactId':_0x3d86fb['id'],'ChatWebsiteId':_0x12efab[_0x0fe5('0x5d')]['id'],'from':(_0x3d86fb[_0x0fe5('0x9d')]||'')+'\x20'+(_0x3d86fb['lastName']||''),'customerIp':_0x12efab[_0x0fe5('0x56')][_0x0fe5('0x9e')],'referer':_0x12efab[_0x0fe5('0x56')]['referer'],'browserName':_0x101127[_0x0fe5('0x9f')]['name']&&_0x101127[_0x0fe5('0x9f')][_0x0fe5('0xa0')]?util[_0x0fe5('0xa1')]('%s\x20%s',_0x101127['browser'][_0x0fe5('0x36')],_0x101127['browser']['version']):_0x0fe5('0xa2'),'browserVersion':_0x101127['browser'][_0x0fe5('0xa0')]||_0x0fe5('0xa2'),'osName':util[_0x0fe5('0xa1')](_0x0fe5('0xa3'),_0x101127['os'][_0x0fe5('0x36')],_0x101127['os'][_0x0fe5('0xa0')]),'osVersion':_0x101127['os'][_0x0fe5('0xa0')],'deviceModel':_0x101127[_0x0fe5('0xa4')][_0x0fe5('0x39')]&&_0x101127[_0x0fe5('0xa4')][_0x0fe5('0xa5')]?util[_0x0fe5('0xa1')](_0x0fe5('0xa6'),_0x101127[_0x0fe5('0xa4')][_0x0fe5('0x39')],_0x101127['device'][_0x0fe5('0xa5')],_0x101127[_0x0fe5('0xa4')][_0x0fe5('0x47')]):null,'deviceVendor':_0x101127['device'][_0x0fe5('0xa5')],'deviceType':_0x101127[_0x0fe5('0xa4')][_0x0fe5('0x47')],'formData':JSON[_0x0fe5('0xa7')](_0x12efab[_0x0fe5('0x56')])};var _0x3aa5d8={'ChatWebsiteId':_0x12efab[_0x0fe5('0x5d')]['id'],'closed':![]};if(_0x12efab[_0x0fe5('0x56')]['threadId']){_0x3aa5d8['threadId']=_0x12efab['body'][_0x0fe5('0xa8')];return db[_0x0fe5('0xa9')][_0x0fe5('0x54')]({'where':_0x3aa5d8})['then'](function(_0x555d41){if(_0x555d41){return[_0x555d41,![]];}_0x1b3be4['threadId']=_0x12efab[_0x0fe5('0x56')][_0x0fe5('0xa8')];_0x1b3be4['externalUrl']=_0x12efab[_0x0fe5('0x56')]['externalUrl'];return db['ChatInteraction'][_0x0fe5('0x55')](_0x1b3be4)[_0x0fe5('0x1d')](function(_0x232242){return[_0x232242,!![]];});});}_0x3aa5d8[_0x0fe5('0xaa')]=_0x3d86fb['id'];if(_0x12efab[_0x0fe5('0x56')][_0x0fe5('0xab')]&&_0x12efab['body']['interaction']['id']){_0x3aa5d8['id']=_0x12efab[_0x0fe5('0x56')][_0x0fe5('0xab')]['id'];return db[_0x0fe5('0xa9')][_0x0fe5('0x54')]({'where':_0x3aa5d8})[_0x0fe5('0x1d')](function(_0x1b0b0c){if(_0x1b0b0c){return[_0x1b0b0c,![]];}return db['ChatInteraction']['create'](_0x1b3be4)[_0x0fe5('0x1d')](function(_0x31fdaf){return[_0x31fdaf,!![]];});});}return db[_0x0fe5('0xa9')][_0x0fe5('0x55')](_0x1b3be4)[_0x0fe5('0x1d')](function(_0x4c743c){return[_0x4c743c,!![]];});}})[_0x0fe5('0xac')](function(_0x52f305,_0xfdcf96){if(_0x52f305){_0x1c1477=_0xfdcf96;if(!_0xfdcf96){var _0xb135d8={'from':(_0x1a1223[_0x0fe5('0xad')][_0x0fe5('0x9d')]||'')+'\x20'+(_0x1a1223['contact']['lastName']||'')};if(_0x12efab[_0x0fe5('0x56')]['threadId']&&_0x12efab['body'][_0x0fe5('0xae')]&&_0x12efab['body'][_0x0fe5('0xa8')]!=_0x12efab[_0x0fe5('0x56')][_0x0fe5('0xae')]){_0xb135d8[_0x0fe5('0xa8')]=_0x12efab[_0x0fe5('0x56')][_0x0fe5('0xae')];}return _0x52f305[_0x0fe5('0x5c')](_0xb135d8);}else{return _0x52f305;}}})[_0x0fe5('0x1d')](function(_0x15efa0){_0x1a1223[_0x0fe5('0xab')]=_0x15efa0[_0x0fe5('0x31')]({'plain':!![]});_0x1a1223[_0x0fe5('0xab')]['created']=_0x1c1477;if(_0x1a1223[_0x0fe5('0xab')]['created']){if(_0x1a1223[_0x0fe5('0x97')][_0x0fe5('0xaf')]){_0x1a1223['applications'][_0x0fe5('0xb0')]({'id':0x0,'priority':_0x1a1223[_0x0fe5('0x9a')][_0x0fe5('0x53')]+0x1,'app':_0x0fe5('0xb1'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db['ChatMessage'][_0x0fe5('0x55')]({'body':_0x12efab[_0x0fe5('0x56')]['body'],'ChatWebsiteId':_0x12efab['params']['id'],'ChatInteractionId':_0x15efa0['id'],'direction':'in','ContactId':_0x1a1223[_0x0fe5('0xad')]['id'],'AttachmentId':_0x12efab[_0x0fe5('0x56')][_0x0fe5('0xb2')]});})['then'](function(_0x2c0654){_0x1a1223[_0x0fe5('0x25')]=_0x2c0654;if(_0x1a1223[_0x0fe5('0xab')][_0x0fe5('0xb3')]){return db['User']['find']({'attributes':['id',_0x0fe5('0x36')],'where':{'id':_0x1a1223[_0x0fe5('0xab')][_0x0fe5('0xb3')]}})[_0x0fe5('0x1d')](function(_0x6db315){if(_0x6db315){_0x1a1223[_0x0fe5('0x9a')][_0x0fe5('0xb4')]({'id':0x0,'priority':0x0,'app':_0x0fe5('0xb5'),'appdata':_0x6db315['name']+','+(_0x1a1223[_0x0fe5('0x97')][_0x0fe5('0xb6')]||0xa),'interval':_0x0fe5('0xb7')});_0x1a1223[_0x0fe5('0xb8')]=!![];}return respondWithRpcPromise('Start','startRouting',_0x1a1223);});}return respondWithRpcPromise(_0x0fe5('0xb9'),_0x0fe5('0xba'),_0x1a1223);})[_0x0fe5('0x1d')](function(_0x5d5aa5){respondWithRpcPromise(_0x0fe5('0xbb'),_0x0fe5('0xbb'),{'event':_0x0fe5('0xbc'),'message':_0x5d5aa5},client9002);return _0x5d5aa5;})[_0x0fe5('0x1d')](respondWithResult(_0x1b93ff,null))[_0x0fe5('0x27')](handleError(_0x1b93ff,null));};exports[_0x0fe5('0xbd')]=function(_0x589693,_0x5bc636,_0x448cdc){var _0xabf5bc,_0x395882,_0xdcd75e;var _0x18bf7c=[];var _0x276eab=[];var _0x5c33f8={};return db[_0x0fe5('0x86')][_0x0fe5('0x5e')]()['then'](function(_0x1a22d4){if(!_0x1a22d4){throw new db[(_0x0fe5('0x8e'))][(_0x0fe5('0x87'))](_0x0fe5('0x88'));}_0x276eab=_[_0x0fe5('0x89')](_[_0x0fe5('0x3a')](_0x1a22d4),[_0x0fe5('0x8a'),_0x0fe5('0x8b')]);_0x18bf7c=_['difference'](_[_0x0fe5('0x3a')](_0x1a22d4),[_0x0fe5('0x8a'),_0x0fe5('0x8b'),'CompanyId','ListId']);if(_0x589693[_0x0fe5('0x56')]['id']){delete _0x589693['body']['id'];}if(_['isNil'](_0x589693[_0x0fe5('0x56')][_0x0fe5('0x8d')])){throw _0x5bc636[_0x0fe5('0x28')](0x1f4)['send'](new db[(_0x0fe5('0x8e'))][(_0x0fe5('0x87'))](_0x0fe5('0xbe')));}if(_[_0x0fe5('0x77')](_0x589693[_0x0fe5('0x56')][_0x0fe5('0x56')])||_0x589693['body']['body']===''){throw _0x5bc636[_0x0fe5('0x28')](0x1f4)[_0x0fe5('0xbf')](new db[(_0x0fe5('0x8e'))]['ValidationError'](_0x0fe5('0xc0')));}if(_[_0x0fe5('0x77')](_0x589693[_0x0fe5('0x56')]['mapKeyOffline'])){throw _0x5bc636[_0x0fe5('0x28')](0x1f4)[_0x0fe5('0xbf')](new db[(_0x0fe5('0x8e'))][(_0x0fe5('0x87'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x18bf7c));}if(!_[_0x0fe5('0xc1')](_0x18bf7c,_0x589693[_0x0fe5('0x56')][_0x0fe5('0xc2')])){throw _0x5bc636[_0x0fe5('0x28')](0x1f4)[_0x0fe5('0xbf')](new db['Sequelize'][(_0x0fe5('0x87'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x18bf7c));}_0x5c33f8[_0x589693[_0x0fe5('0x56')]['mapKeyOffline']]=_0x589693[_0x0fe5('0x56')]['from'];})[_0x0fe5('0x1d')](function(){return db[_0x0fe5('0x4c')][_0x0fe5('0x54')]({'where':{'id':_0x589693[_0x0fe5('0x5d')]['id']},'include':[{'model':db[_0x0fe5('0x92')],'as':_0x0fe5('0x93')}]});})[_0x0fe5('0x1d')](handleEntityNotFound(_0x5bc636,null))['then'](function(_0x2033ac){if(_0x2033ac&&_0x2033ac[_0x0fe5('0x93')]){_0x395882=_0x2033ac;var _0x24e149=_[_0x0fe5('0x14')](_0x589693['body'],{'firstName':_0x589693[_0x0fe5('0x56')][_0x0fe5('0x8d')],'phone':_0x589693[_0x0fe5('0x56')][_0x0fe5('0x8d')],'ListId':_0x2033ac['ListId']});_0x24e149[_0x589693['body'][_0x0fe5('0xc2')]]=_0x589693[_0x0fe5('0x56')][_0x0fe5('0x8d')];return db['CmContact'][_0x0fe5('0xc3')]({'where':_0x5c33f8,'defaults':_0x24e149});}})[_0x0fe5('0xac')](function(_0x20465f){if(_0x20465f){_0xdcd75e=_0x20465f;var _0x5919e1=fs['readFileSync'](path[_0x0fe5('0x73')](config[_0x0fe5('0x79')],_0x0fe5('0xc4')),_0x0fe5('0xc5'));var _0x5caf9e=ejs['render'](_0x5919e1,{'body':_[_0x0fe5('0xc6')](_0x589693['body']['body']),'bodyTitle':_0x395882[_0x0fe5('0xc7')]});return db[_0x0fe5('0xc8')][_0x0fe5('0x55')]({'body':_0x5caf9e,'ContactId':_0x20465f['id'],'ChatWebsiteId':_0x395882['id']});}})['then'](function(_0x1294e7){if(_0x1294e7){_0xabf5bc=_0x1294e7;return db['MailAccount'][_0x0fe5('0x62')]({'where':{'service':!![]},'include':[{'model':db[_0x0fe5('0xc9')],'as':_0x0fe5('0xca'),'raw':!![]}]});}})[_0x0fe5('0x1d')](function(_0x36414f){if(_0x36414f&&_0x36414f['Smtp']&&_0x395882[_0x0fe5('0xcb')]){var _0x448c2b={'tls':{'rejectUnauthorized':![]}};if(_0x36414f[_0x0fe5('0xca')][_0x0fe5('0xcc')]){_0x448c2b['service']=_0x36414f[_0x0fe5('0xca')][_0x0fe5('0xcc')];}else{_0x448c2b[_0x0fe5('0xcd')]=_0x36414f['Smtp'][_0x0fe5('0xcd')];_0x448c2b[_0x0fe5('0xce')]=_0x36414f['Smtp'][_0x0fe5('0xce')];_0x448c2b[_0x0fe5('0xcf')]=_0x36414f[_0x0fe5('0xca')][_0x0fe5('0xcf')];}if(_0x36414f[_0x0fe5('0xca')][_0x0fe5('0xd0')]){_0x448c2b[_0x0fe5('0xd1')]={'user':_0x36414f[_0x0fe5('0xca')][_0x0fe5('0x57')],'pass':_0x36414f[_0x0fe5('0xca')][_0x0fe5('0xd2')]};}return respondWithRpcPromise(_0x0fe5('0xd3'),_0x0fe5('0xd4'),{'account':_0x448c2b,'message':{'from':util[_0x0fe5('0xa1')](_0x0fe5('0xd5'),_0x36414f['name'],_0x36414f[_0x0fe5('0xd6')]||_0x36414f[_0x0fe5('0xca')]['user']),'to':_0x395882[_0x0fe5('0xcb')],'subject':_0x395882[_0x0fe5('0xd7')],'text':_0xabf5bc[_0x0fe5('0x56')]}},client9003)[_0x0fe5('0x1d')](function(){return _0xabf5bc;})[_0x0fe5('0x27')](function(_0x5e0d68){console['error'](_0x5e0d68);});}})[_0x0fe5('0x1d')](function(){if(_0xabf5bc){return _0xabf5bc;}})[_0x0fe5('0x1d')](respondWithResult(_0x5bc636,null))['catch'](handleError(_0x5bc636,null));};exports[_0x0fe5('0xd8')]=function(_0x187fb0,_0x280b42,_0x3a662e){return db[_0x0fe5('0xa9')][_0x0fe5('0x54')]({'where':{'id':_0x187fb0['params']['id']}})[_0x0fe5('0x1d')](handleEntityNotFound(_0x280b42,null))[_0x0fe5('0x1d')](function(_0x457321){if(_0x457321){return _0x457321[_0x0fe5('0xd8')](_0x187fb0[_0x0fe5('0x56')][_0x0fe5('0x65')],_['omit'](_0x187fb0[_0x0fe5('0x56')],[_0x0fe5('0x65'),'id'])||{});}})[_0x0fe5('0x1d')](respondWithResult(_0x280b42,null))[_0x0fe5('0x27')](handleError(_0x280b42,null));};exports[_0x0fe5('0xd9')]=function(_0x4a2770,_0xc65f25,_0x3c3f1f){var _0x4cbf44={'raw':![],'where':{}};var _0x398bd4={};var _0x27d6c3={'count':0x0,'rows':[]};return db[_0x0fe5('0x4c')][_0x0fe5('0x62')]({'where':{'id':_0x4a2770[_0x0fe5('0x5d')]['id']}})['then'](handleEntityNotFound(_0xc65f25,null))[_0x0fe5('0x1d')](function(_0x334b33){if(_0x334b33){_0x398bd4[_0x0fe5('0x39')]=_[_0x0fe5('0x3a')](db[_0x0fe5('0xa9')][_0x0fe5('0x52')]);_0x398bd4[_0x0fe5('0x3b')]=_[_0x0fe5('0x3a')](_0x4a2770[_0x0fe5('0x3b')]);_0x398bd4['filters']=_[_0x0fe5('0x3d')](_0x398bd4[_0x0fe5('0x39')],_0x398bd4[_0x0fe5('0x3b')]);_0x4cbf44[_0x0fe5('0x3f')]=_[_0x0fe5('0x3d')](_0x398bd4[_0x0fe5('0x39')],qs[_0x0fe5('0x3e')](_0x4a2770[_0x0fe5('0x3b')][_0x0fe5('0x3e')]));_0x4cbf44['attributes']=_0x4cbf44[_0x0fe5('0x3f')][_0x0fe5('0x53')]?_0x4cbf44['attributes']:_0x398bd4['model'];if(!_0x4a2770['query']['hasOwnProperty'](_0x0fe5('0x63'))){_0x4cbf44[_0x0fe5('0x2b')]=qs['limit'](_0x4a2770[_0x0fe5('0x3b')][_0x0fe5('0x2b')]);_0x4cbf44[_0x0fe5('0x2a')]=qs[_0x0fe5('0x2a')](_0x4a2770['query'][_0x0fe5('0x2a')]);}_0x4cbf44['order']=qs['sort'](_0x4a2770['query']['sort']);_0x4cbf44[_0x0fe5('0x42')]=qs[_0x0fe5('0x3c')](_['pick'](_0x4a2770[_0x0fe5('0x3b')],_0x398bd4[_0x0fe5('0x3c')]));_0x4cbf44[_0x0fe5('0x42')][_0x0fe5('0x5f')]=_0x334b33['id'];if(_0x4a2770[_0x0fe5('0x3b')][_0x0fe5('0x44')]){_0x4cbf44[_0x0fe5('0x42')]=_[_0x0fe5('0x45')](_0x4cbf44[_0x0fe5('0x42')],{'$or':_[_0x0fe5('0x46')](_0x4cbf44[_0x0fe5('0x3f')],function(_0x29a3a4){var _0x2996ba={};_0x2996ba[_0x29a3a4]={'$like':'%'+_0x4a2770['query'][_0x0fe5('0x44')]+'%'};return _0x2996ba;})});}_0x4cbf44=_[_0x0fe5('0x45')]({},_0x4cbf44,_0x4a2770[_0x0fe5('0x4b')]);return db[_0x0fe5('0xa9')][_0x0fe5('0x4d')]({'where':_0x4cbf44[_0x0fe5('0x42')]})['then'](function(_0x1961c9){_0x27d6c3[_0x0fe5('0x4d')]=_0x1961c9;if(_0x4a2770[_0x0fe5('0x3b')][_0x0fe5('0x4e')]){_0x4cbf44[_0x0fe5('0x4f')]=[{'model':db[_0x0fe5('0x86')],'as':'Contact','required':![]},{'model':db[_0x0fe5('0xda')],'as':_0x0fe5('0xdb'),'attributes':[_0x0fe5('0x36'),_0x0fe5('0xdc'),_0x0fe5('0xdd')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id','name',_0x0fe5('0xde')],'where':_0x4a2770['query'][_0x0fe5('0xdf')]?{'id':_0x4a2770[_0x0fe5('0x3b')][_0x0fe5('0xdf')]}:undefined,'required':_0x4a2770[_0x0fe5('0x3b')][_0x0fe5('0xdf')]?!![]:![]}];}return db[_0x0fe5('0xa9')][_0x0fe5('0x50')](_0x4cbf44);})[_0x0fe5('0x1d')](function(_0x141be5){_0x27d6c3[_0x0fe5('0x69')]=_0x141be5;return _0x27d6c3;});}})[_0x0fe5('0x1d')](respondWithFilteredResult(_0xc65f25,_0x4cbf44))[_0x0fe5('0x27')](handleError(_0xc65f25,null));};function iftimePromise(_0x1326b8,_0x3d71b6){return respondWithRpcPromise(_0x0fe5('0xe0'),_0x0fe5('0xe1'),{'command':_0x3d71b6[_0x0fe5('0xe2')]?util[_0x0fe5('0xa1')](_0x0fe5('0xe3'),_0x1326b8[_0x0fe5('0xe4')],_0x3d71b6['timezone']):util[_0x0fe5('0xa1')]('iftime\x20%s',_0x1326b8[_0x0fe5('0xe4')])},client9002)['then'](function(_0x4992e3){var _0x483a41=_0x4992e3&&_0x4992e3[_0x0fe5('0xe5')]('true')>=0x0?!![]:![];logger[_0x0fe5('0x1e')](_0x0fe5('0xe6'),_0x3d71b6['id'],_0x1326b8['id'],_0x1326b8[_0x0fe5('0xe4')],_0x483a41?'ONLINE':'OFFLINE',_0x3d71b6['timezone']?_0x3d71b6['timezone']:_0x0fe5('0xe7'));return _0x483a41;})['catch'](function(_0x17cc74){logger['error']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x3d71b6['id'],_0x1326b8['id'],_0x1326b8[_0x0fe5('0xe4')],util[_0x0fe5('0xe8')](_0x17cc74,{'showHidden':![],'depth':null}),_0x3d71b6['timezone']?_0x3d71b6[_0x0fe5('0xe2')]:_0x0fe5('0xe7'));return![];});}exports[_0x0fe5('0xe1')]=function(_0x849841,_0x19a724,_0x2aefde){var _0x54d939=0x0;var _0x4c6fec=0x0;var _0x686aca=![];var _0x1356e3;var _0x425212;return db[_0x0fe5('0x4c')][_0x0fe5('0x54')]({'where':{'id':_0x849841['params']['id']},'include':[{'model':db[_0x0fe5('0xe9')],'as':_0x0fe5('0xe9'),'include':[{'model':db[_0x0fe5('0xe9')],'as':'Intervals','attributes':['id',_0x0fe5('0xe4')],'raw':!![]}]}]})[_0x0fe5('0x1d')](handleEntityNotFound(_0x19a724,null))['then'](function(_0x351a61){if(_0x351a61){_0x1356e3=_0x351a61;return _0x351a61['getProactiveActions']({'raw':!![]});}})[_0x0fe5('0x1d')](function(_0x598d79){if(_0x1356e3){if(_0x598d79){_0x425212=_0x598d79;}}return require('../../config/license/util')[_0x0fe5('0x75')]();})[_0x0fe5('0x1d')](function(_0x45f46f){if(_0x45f46f){_0x4c6fec=_0x45f46f['virtual'];_0x686aca=_0x45f46f['custom'];}})['then'](function(){return db[_0x0fe5('0xa9')][_0x0fe5('0x4d')]({'where':{'closed':![]}});})[_0x0fe5('0x1d')](function(_0x2edb5a){_0x54d939=_0x2edb5a;if(_0x4c6fec&&_0x2edb5a>_0x4c6fec){return db['License'][_0x0fe5('0x62')]({'where':{'id':0x1}})[_0x0fe5('0x1d')](function(_0x472d8d){if(_0x472d8d){_0x472d8d[_0x0fe5('0xea')](_0x0fe5('0xeb'));}});}})['then'](function(){if(_0x1356e3[_0x0fe5('0xe9')]&&_0x1356e3['Interval'][_0x0fe5('0xec')]){var _0xd6b4d6=[];for(var _0x454e94=0x0;_0x454e94<_0x1356e3[_0x0fe5('0xe9')]['Intervals'][_0x0fe5('0x53')];_0x454e94++){var _0x337ffe=_0x1356e3[_0x0fe5('0xe9')][_0x0fe5('0xec')][_0x454e94][_0x0fe5('0x31')]({'plain':!![]});_0xd6b4d6[_0x0fe5('0xb0')](iftimePromise(_0x337ffe,_0x1356e3));}return BPromise[_0x0fe5('0xed')](_0xd6b4d6)[_0x0fe5('0x1d')](function(_0x1e8eb3){return _[_0x0fe5('0xee')](_0x1e8eb3);});}else{return!![];}})[_0x0fe5('0x1d')](function(_0x341299){var _0x526c7a=fs['readFileSync'](path['join'](config[_0x0fe5('0x79')],'server/files/chat/iframe.js'),_0x0fe5('0xc5'));var _0x372ad7={'remote':_0x1356e3[_0x0fe5('0xef')],'query':querystring[_0x0fe5('0xa7')](_[_0x0fe5('0x45')](_0x1356e3[_0x0fe5('0x31')]({'plain':!![]}),{'customerIp':_0x849841[_0x0fe5('0x83')][_0x0fe5('0xf0')]||_0x849841[_0x0fe5('0x83')]['x-real-ip']||_0x849841[_0x0fe5('0xf1')][_0x0fe5('0xf2')]||_0x849841['ip'],'referer':_0x849841['headers']['referer'],'openedInteractions':_0x54d939,'maxInteractions':_0x4c6fec,'virtual':_0x686aca['virtual'],'online':_0x341299,'custom':_0x686aca}))[_0x0fe5('0xf3')](/'/g,'\x5c\x27')};_0x19a724[_0x0fe5('0xbf')](ejs[_0x0fe5('0xf4')](Mustache['render'](_0x526c7a,_0x372ad7),{'proactiveActions':_0x425212,'alignment':_0x1356e3[_0x0fe5('0xf5')],'verticalAlignment':_0x1356e3['verticalAlignment']}));})[_0x0fe5('0x27')](handleError(_0x19a724,null));};exports[_0x0fe5('0xf6')]=function(_0x45b9ab,_0x1ab5cf,_0x453b84){return db[_0x0fe5('0x4c')][_0x0fe5('0x62')]({'where':{'id':_0x45b9ab[_0x0fe5('0x5d')]['id']}})[_0x0fe5('0x1d')](handleEntityNotFound(_0x1ab5cf,null))['then'](function(_0x29ac7f){if(_0x29ac7f){return db[_0x0fe5('0xf7')][_0x0fe5('0xf8')](function(_0x46cac8){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x45b9ab['params']['id']},'transaction':_0x46cac8})[_0x0fe5('0x1d')](function(_0x1509d3){var _0x5a1a45=_[_0x0fe5('0x46')](_0x45b9ab[_0x0fe5('0x56')],function(_0x1002a5){_0x1002a5[_0x0fe5('0x5f')]=_0x45b9ab[_0x0fe5('0x5d')]['id'];return _0x1002a5;});return db[_0x0fe5('0x95')][_0x0fe5('0xf9')](_0x5a1a45,{'transaction':_0x46cac8});});})[_0x0fe5('0x1d')](function(){return db[_0x0fe5('0x95')][_0x0fe5('0xfa')]({'where':{'ChatWebsiteId':_0x45b9ab[_0x0fe5('0x5d')]['id']},'order':_0x0fe5('0x9b')});});}})[_0x0fe5('0x1d')](respondWithResult(_0x1ab5cf,null))[_0x0fe5('0x27')](handleError(_0x1ab5cf,null));};exports[_0x0fe5('0xfb')]=function(_0x36b82a,_0x49f1b2,_0x45d1fd){var _0x5da53e={};var _0x3bcaed={};var _0xb0a75b;var _0xb56fe3;return db[_0x0fe5('0x4c')][_0x0fe5('0x62')]({'where':{'id':_0x36b82a['params']['id']}})[_0x0fe5('0x1d')](handleEntityNotFound(_0x49f1b2,null))[_0x0fe5('0x1d')](function(_0x51b76d){if(_0x51b76d){_0xb0a75b=_0x51b76d;_0x3bcaed[_0x0fe5('0x39')]=_[_0x0fe5('0x3a')](db[_0x0fe5('0x95')][_0x0fe5('0x52')]);_0x3bcaed[_0x0fe5('0x3b')]=_['keys'](_0x36b82a['query']);_0x3bcaed['filters']=_['intersection'](_0x3bcaed[_0x0fe5('0x39')],_0x3bcaed[_0x0fe5('0x3b')]);_0x5da53e[_0x0fe5('0x3f')]=_[_0x0fe5('0x3d')](_0x3bcaed['model'],qs['fields'](_0x36b82a[_0x0fe5('0x3b')]['fields']));_0x5da53e[_0x0fe5('0x3f')]=_0x5da53e[_0x0fe5('0x3f')]['length']?_0x5da53e[_0x0fe5('0x3f')]:_0x3bcaed['model'];_0x5da53e['order']=qs['sort'](_0x36b82a[_0x0fe5('0x3b')]['sort']);_0x5da53e[_0x0fe5('0x42')]=qs['filters'](_[_0x0fe5('0x43')](_0x36b82a[_0x0fe5('0x3b')],_0x3bcaed[_0x0fe5('0x3c')]));if(_0x36b82a[_0x0fe5('0x3b')]['filter']){_0x5da53e[_0x0fe5('0x42')]=_[_0x0fe5('0x45')](_0x5da53e[_0x0fe5('0x42')],{'$or':_[_0x0fe5('0x46')](_0x5da53e['attributes'],function(_0x5b22a2){var _0xd4ec9c={};_0xd4ec9c[_0x5b22a2]={'$like':'%'+_0x36b82a[_0x0fe5('0x3b')][_0x0fe5('0x44')]+'%'};return _0xd4ec9c;})});}_0x5da53e=_[_0x0fe5('0x45')]({},_0x5da53e,_0x36b82a[_0x0fe5('0x4b')]);return _0xb0a75b['getApplications'](_0x5da53e);}})[_0x0fe5('0x1d')](function(_0xc6ac65){if(_0xc6ac65){_0xb56fe3=_0xc6ac65[_0x0fe5('0x53')];if(!_0x36b82a[_0x0fe5('0x3b')]['hasOwnProperty'](_0x0fe5('0x63'))){_0x5da53e[_0x0fe5('0x2b')]=qs[_0x0fe5('0x2b')](_0x36b82a[_0x0fe5('0x3b')][_0x0fe5('0x2b')]);_0x5da53e[_0x0fe5('0x2a')]=qs[_0x0fe5('0x2a')](_0x36b82a[_0x0fe5('0x3b')]['offset']);}return _0xb0a75b['getApplications'](_0x5da53e);}})[_0x0fe5('0x1d')](function(_0x1f13c5){if(_0x1f13c5){return _0x1f13c5?{'count':_0xb56fe3,'rows':_0x1f13c5}:null;}})[_0x0fe5('0x1d')](respondWithResult(_0x49f1b2,null))[_0x0fe5('0x27')](handleError(_0x49f1b2,null));};exports[_0x0fe5('0xfc')]=function(_0x2ca5a0,_0x29c2a0,_0x295210){return db[_0x0fe5('0xfd')]['find']({'where':{'id':_0x2ca5a0[_0x0fe5('0x5d')]['id']}})[_0x0fe5('0x1d')](handleEntityNotFound(_0x29c2a0,null))['then'](function(_0x104d6c){if(_0x104d6c){return _0x104d6c[_0x0fe5('0xfc')](_0x2ca5a0[_0x0fe5('0x56')]['ids'],_[_0x0fe5('0xfe')](_0x2ca5a0[_0x0fe5('0x56')],['ids','id'])||{});}})[_0x0fe5('0x1d')](respondWithResult(_0x29c2a0,null))[_0x0fe5('0x27')](handleError(_0x29c2a0,null));};exports[_0x0fe5('0xff')]=function(_0x3e71ee,_0x263b4e,_0x1e5ea9){var _0x3ca4e5={};var _0xae366a={};var _0x28a784;var _0x383ff1;return db['ChatWebsite'][_0x0fe5('0x62')]({'where':{'id':_0x3e71ee['params']['id']}})[_0x0fe5('0x1d')](handleEntityNotFound(_0x263b4e,null))[_0x0fe5('0x1d')](function(_0x3a951e){if(_0x3a951e){_0x28a784=_0x3a951e;_0xae366a[_0x0fe5('0x39')]=_[_0x0fe5('0x3a')](db[_0x0fe5('0x100')]['rawAttributes']);_0xae366a[_0x0fe5('0x3b')]=_[_0x0fe5('0x3a')](_0x3e71ee[_0x0fe5('0x3b')]);_0xae366a[_0x0fe5('0x3c')]=_[_0x0fe5('0x3d')](_0xae366a['model'],_0xae366a[_0x0fe5('0x3b')]);_0x3ca4e5[_0x0fe5('0x3f')]=_['intersection'](_0xae366a[_0x0fe5('0x39')],qs[_0x0fe5('0x3e')](_0x3e71ee[_0x0fe5('0x3b')][_0x0fe5('0x3e')]));_0x3ca4e5[_0x0fe5('0x3f')]=_0x3ca4e5[_0x0fe5('0x3f')][_0x0fe5('0x53')]?_0x3ca4e5[_0x0fe5('0x3f')]:_0xae366a['model'];_0x3ca4e5[_0x0fe5('0x68')]=qs['sort'](_0x3e71ee[_0x0fe5('0x3b')][_0x0fe5('0x41')]);_0x3ca4e5[_0x0fe5('0x42')]=qs[_0x0fe5('0x3c')](_[_0x0fe5('0x43')](_0x3e71ee[_0x0fe5('0x3b')],_0xae366a['filters']));if(_0x3e71ee['query']['filter']){_0x3ca4e5[_0x0fe5('0x42')]=_[_0x0fe5('0x45')](_0x3ca4e5[_0x0fe5('0x42')],{'$or':_['map'](_0x3ca4e5[_0x0fe5('0x3f')],function(_0x3fc5a){var _0x3210c8={};_0x3210c8[_0x3fc5a]={'$like':'%'+_0x3e71ee[_0x0fe5('0x3b')]['filter']+'%'};return _0x3210c8;})});}_0x3ca4e5=_[_0x0fe5('0x45')]({},_0x3ca4e5,_0x3e71ee[_0x0fe5('0x4b')]);return _0x28a784['getProactiveActions'](_0x3ca4e5);}})[_0x0fe5('0x1d')](function(_0xd5019c){if(_0xd5019c){_0x383ff1=_0xd5019c['length'];if(!_0x3e71ee['query'][_0x0fe5('0x40')](_0x0fe5('0x63'))){_0x3ca4e5[_0x0fe5('0x2b')]=qs[_0x0fe5('0x2b')](_0x3e71ee['query'][_0x0fe5('0x2b')]);_0x3ca4e5[_0x0fe5('0x2a')]=qs[_0x0fe5('0x2a')](_0x3e71ee[_0x0fe5('0x3b')][_0x0fe5('0x2a')]);}return _0x28a784['getProactiveActions'](_0x3ca4e5);}})[_0x0fe5('0x1d')](function(_0x2a1a13){if(_0x2a1a13){return _0x2a1a13?{'count':_0x383ff1,'rows':_0x2a1a13}:null;}})[_0x0fe5('0x1d')](respondWithResult(_0x263b4e,null))[_0x0fe5('0x27')](handleError(_0x263b4e,null));};exports[_0x0fe5('0x101')]=function(_0x4708bb,_0x417761,_0x1e129f){var _0x4dc701=_0x4708bb[_0x0fe5('0x3b')][_0x0fe5('0x102')]==='false'?_0x0fe5('0x103'):_0x0fe5('0x104');return db['ChatWebsite']['find']({'attributes':['id',_0x4dc701],'where':{'id':_0x4708bb[_0x0fe5('0x5d')]['id']}})[_0x0fe5('0x1d')](handleEntityNotFound(_0x417761,null))[_0x0fe5('0x1d')](function(_0x50cc71){if(_0x50cc71){var _0x4b612a=_0x50cc71[_0x4dc701];var _0x40c681=_0x4b612a&&_0x4b612a[_0x0fe5('0x105')]?_0x4b612a[_0x0fe5('0x105')]:[];_0x417761['send']({'fromKey':_[_0x0fe5('0x77')](_0x4b612a[_0x0fe5('0x106')])?undefined:_0x4b612a[_0x0fe5('0x106')],'count':_0x40c681[_0x0fe5('0x53')],'rows':_0x40c681});}})[_0x0fe5('0x27')](handleError(_0x417761,null));};exports[_0x0fe5('0x107')]=function(_0x50ccc9,_0x3c65c8,_0x13024e){var _0x5a86e6={'raw':!![],'where':{}};var _0x2a2623={};var _0x1d5efd={'count':0x0,'rows':[]};return db[_0x0fe5('0x4c')]['findOne']({'where':{'id':_0x50ccc9[_0x0fe5('0x5d')]['id']}})[_0x0fe5('0x1d')](handleEntityNotFound(_0x3c65c8,null))[_0x0fe5('0x1d')](function(_0x565466){if(_0x565466){_0x2a2623['model']=_[_0x0fe5('0x3a')](db['ChatOfflineMessage'][_0x0fe5('0x52')]);_0x2a2623[_0x0fe5('0x3b')]=_[_0x0fe5('0x3a')](_0x50ccc9['query']);_0x2a2623['filters']=_[_0x0fe5('0x3d')](_0x2a2623[_0x0fe5('0x39')],_0x2a2623[_0x0fe5('0x3b')]);_0x5a86e6['attributes']=_[_0x0fe5('0x3d')](_0x2a2623[_0x0fe5('0x39')],qs[_0x0fe5('0x3e')](_0x50ccc9['query'][_0x0fe5('0x3e')]));_0x5a86e6['attributes']=_0x5a86e6[_0x0fe5('0x3f')][_0x0fe5('0x53')]?_0x5a86e6[_0x0fe5('0x3f')]:_0x2a2623[_0x0fe5('0x39')];if(!_0x50ccc9[_0x0fe5('0x3b')][_0x0fe5('0x40')]('nolimit')){_0x5a86e6[_0x0fe5('0x2b')]=qs[_0x0fe5('0x2b')](_0x50ccc9[_0x0fe5('0x3b')][_0x0fe5('0x2b')]);_0x5a86e6['offset']=qs[_0x0fe5('0x2a')](_0x50ccc9[_0x0fe5('0x3b')][_0x0fe5('0x2a')]);}_0x5a86e6[_0x0fe5('0x68')]=qs['sort'](_0x50ccc9['query'][_0x0fe5('0x41')]);_0x5a86e6[_0x0fe5('0x42')]=qs[_0x0fe5('0x3c')](_['pick'](_0x50ccc9[_0x0fe5('0x3b')],_0x2a2623[_0x0fe5('0x3c')]));_0x5a86e6[_0x0fe5('0x42')]['ChatWebsiteId']=_0x565466['id'];if(_0x50ccc9['query']['filter']){_0x5a86e6[_0x0fe5('0x42')]=_[_0x0fe5('0x45')](_0x5a86e6[_0x0fe5('0x42')],{'$or':_['map'](_0x5a86e6[_0x0fe5('0x3f')],function(_0x3dccae){var _0x72c704={};_0x72c704[_0x3dccae]={'$like':'%'+_0x50ccc9[_0x0fe5('0x3b')][_0x0fe5('0x44')]+'%'};return _0x72c704;})});}_0x5a86e6=_[_0x0fe5('0x45')]({},_0x5a86e6,_0x50ccc9[_0x0fe5('0x4b')]);return db[_0x0fe5('0xc8')][_0x0fe5('0x4d')]({'where':_0x5a86e6[_0x0fe5('0x42')]})[_0x0fe5('0x1d')](function(_0x176d86){_0x1d5efd[_0x0fe5('0x4d')]=_0x176d86;if(_0x50ccc9[_0x0fe5('0x3b')][_0x0fe5('0x4e')]){_0x5a86e6[_0x0fe5('0x4f')]=[{'all':!![]}];}return db['ChatOfflineMessage'][_0x0fe5('0x50')](_0x5a86e6);})[_0x0fe5('0x1d')](function(_0x3fc9e0){_0x1d5efd[_0x0fe5('0x69')]=_0x3fc9e0;return _0x1d5efd;});}})['then'](respondWithFilteredResult(_0x3c65c8,_0x5a86e6))['catch'](handleError(_0x3c65c8,null));};exports[_0x0fe5('0x108')]=function(_0x393b99,_0x117c8b,_0x1f10cc){return db[_0x0fe5('0x4c')]['find']({'where':{'id':_0x393b99[_0x0fe5('0x5d')]['id']}})['then'](handleEntityNotFound(_0x117c8b,null))[_0x0fe5('0x1d')](function(_0x2272ed){if(_0x2272ed){return _0x2272ed[_0x0fe5('0x108')](_0x393b99[_0x0fe5('0x56')][_0x0fe5('0x65')],_[_0x0fe5('0xfe')](_0x393b99[_0x0fe5('0x56')],['ids','id'])||{})[_0x0fe5('0xac')](function(_0x6e5429){for(var _0x3420c2=0x0;_0x3420c2<_0x393b99['body'][_0x0fe5('0x65')][_0x0fe5('0x53')];_0x3420c2+=0x1){socket[_0x0fe5('0x109')](_0x0fe5('0x10a'),{'UserId':_0x393b99['body'][_0x0fe5('0x65')][_0x3420c2],'ChatWebsiteId':_0x393b99['params']['id']});}return _0x6e5429;});}})[_0x0fe5('0x1d')](respondWithResult(_0x117c8b,null))['catch'](handleError(_0x117c8b,null));};exports[_0x0fe5('0x10b')]=function(_0x153af2,_0x9aee8c,_0x429cc0){return db[_0x0fe5('0x4c')][_0x0fe5('0x54')]({'where':{'id':_0x153af2[_0x0fe5('0x5d')]['id']}})[_0x0fe5('0x1d')](handleEntityNotFound(_0x9aee8c,null))[_0x0fe5('0x1d')](function(_0x4cb8c6){if(_0x4cb8c6){return _0x4cb8c6[_0x0fe5('0x10b')](_0x153af2[_0x0fe5('0x3b')][_0x0fe5('0x65')])[_0x0fe5('0x1d')](function(){if(_[_0x0fe5('0x10c')](_0x153af2[_0x0fe5('0x3b')][_0x0fe5('0x65')])){for(var _0x5be7a8=0x0;_0x5be7a8<_0x153af2[_0x0fe5('0x3b')]['ids']['length'];_0x5be7a8+=0x1){socket['emit'](_0x0fe5('0x10d'),{'UserId':Number(_0x153af2[_0x0fe5('0x3b')][_0x0fe5('0x65')][_0x5be7a8]),'ChatWebsiteId':Number(_0x153af2[_0x0fe5('0x5d')]['id'])});}}else{socket[_0x0fe5('0x109')](_0x0fe5('0x10d'),{'UserId':Number(_0x153af2['query']['ids']),'ChatWebsiteId':Number(_0x153af2[_0x0fe5('0x5d')]['id'])});}});}})[_0x0fe5('0x1d')](respondWithStatusCode(_0x9aee8c,null))['catch'](handleError(_0x9aee8c,null));};exports[_0x0fe5('0x10e')]=function(_0x57fcd4,_0x3bae1a,_0x527bc1){var _0x55e4d0={};var _0x407d02={};var _0x16c1a9;var _0x1ca51a;return db[_0x0fe5('0x4c')]['findOne']({'where':{'id':_0x57fcd4[_0x0fe5('0x5d')]['id']}})[_0x0fe5('0x1d')](handleEntityNotFound(_0x3bae1a,null))['then'](function(_0x1b35ff){if(_0x1b35ff){_0x16c1a9=_0x1b35ff;_0x407d02[_0x0fe5('0x39')]=_[_0x0fe5('0x3a')](db[_0x0fe5('0xda')][_0x0fe5('0x52')]);_0x407d02[_0x0fe5('0x3b')]=_['keys'](_0x57fcd4[_0x0fe5('0x3b')]);_0x407d02[_0x0fe5('0x3c')]=_[_0x0fe5('0x3d')](_0x407d02[_0x0fe5('0x39')],_0x407d02[_0x0fe5('0x3b')]);_0x55e4d0[_0x0fe5('0x3f')]=_[_0x0fe5('0x3d')](_0x407d02['model'],qs['fields'](_0x57fcd4[_0x0fe5('0x3b')]['fields']));_0x55e4d0[_0x0fe5('0x3f')]=_0x55e4d0[_0x0fe5('0x3f')][_0x0fe5('0x53')]?_0x55e4d0[_0x0fe5('0x3f')]:_0x407d02[_0x0fe5('0x39')];_0x55e4d0[_0x0fe5('0x68')]=qs[_0x0fe5('0x41')](_0x57fcd4[_0x0fe5('0x3b')][_0x0fe5('0x41')]);_0x55e4d0[_0x0fe5('0x42')]=qs[_0x0fe5('0x3c')](_[_0x0fe5('0x43')](_0x57fcd4['query'],_0x407d02[_0x0fe5('0x3c')]));if(_0x57fcd4['query'][_0x0fe5('0x44')]){_0x55e4d0[_0x0fe5('0x42')]=_['merge'](_0x55e4d0[_0x0fe5('0x42')],{'$or':_['map'](_0x55e4d0['attributes'],function(_0x67e78c){var _0x5b6ddf={};_0x5b6ddf[_0x67e78c]={'$like':'%'+_0x57fcd4[_0x0fe5('0x3b')]['filter']+'%'};return _0x5b6ddf;})});}_0x55e4d0=_['merge']({},_0x55e4d0,_0x57fcd4[_0x0fe5('0x4b')]);return _0x16c1a9[_0x0fe5('0x10e')](_0x55e4d0);}})[_0x0fe5('0x1d')](function(_0x2a00e1){if(_0x2a00e1){_0x1ca51a=_0x2a00e1[_0x0fe5('0x53')];if(!_0x57fcd4[_0x0fe5('0x3b')]['hasOwnProperty'](_0x0fe5('0x63'))){_0x55e4d0[_0x0fe5('0x2b')]=qs[_0x0fe5('0x2b')](_0x57fcd4[_0x0fe5('0x3b')][_0x0fe5('0x2b')]);_0x55e4d0[_0x0fe5('0x2a')]=qs[_0x0fe5('0x2a')](_0x57fcd4[_0x0fe5('0x3b')]['offset']);}return _0x16c1a9[_0x0fe5('0x10e')](_0x55e4d0);}})[_0x0fe5('0x1d')](function(_0x315a41){if(_0x315a41){return _0x315a41?{'count':_0x1ca51a,'rows':_0x315a41}:null;}})[_0x0fe5('0x1d')](respondWithResult(_0x3bae1a,null))[_0x0fe5('0x27')](handleError(_0x3bae1a,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index d0fe46e..b97cac5 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 _0x0be5=['../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x55fb83,_0x1d3856){var _0x59a87a=function(_0x38bdd1){while(--_0x38bdd1){_0x55fb83['push'](_0x55fb83['shift']());}};_0x59a87a(++_0x1d3856);}(_0x0be5,0xf0));var _0x50be=function(_0x3f8084,_0x5c9c82){_0x3f8084=_0x3f8084-0x0;var _0x5d9d6c=_0x0be5[_0x3f8084];return _0x5d9d6c;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x50be('0x0'))['db'][_0x50be('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x50be('0x2')](0x0);var events={'afterCreate':_0x50be('0x3'),'afterUpdate':_0x50be('0x4'),'afterDestroy':_0x50be('0x5')};function emitEvent(_0x2d9ae0){return function(_0x2b5d75,_0x1aae31,_0x5225ec){ChatWebsiteEvents[_0x50be('0x6')](_0x2d9ae0+':'+_0x2b5d75['id'],_0x2b5d75);ChatWebsiteEvents[_0x50be('0x6')](_0x2d9ae0,_0x2b5d75);_0x5225ec(null);};}for(var e in events){if(events[_0x50be('0x7')](e)){var event=events[e];ChatWebsite[_0x50be('0x8')](e,emitEvent(event));}}module[_0x50be('0x9')]=ChatWebsiteEvents; \ No newline at end of file +var _0x91d8=['remove','hook','events','../../mysqldb','ChatWebsite','save'];(function(_0x28e165,_0x5443e0){var _0x1aba76=function(_0x216a8b){while(--_0x216a8b){_0x28e165['push'](_0x28e165['shift']());}};_0x1aba76(++_0x5443e0);}(_0x91d8,0x1be));var _0x891d=function(_0x19de2f,_0x4506e1){_0x19de2f=_0x19de2f-0x0;var _0x51706b=_0x91d8[_0x19de2f];return _0x51706b;};'use strict';var EventEmitter=require(_0x891d('0x0'));var ChatWebsite=require(_0x891d('0x1'))['db'][_0x891d('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x891d('0x3'),'afterUpdate':'update','afterDestroy':_0x891d('0x4')};function emitEvent(_0x5bb051){return function(_0x14f24d,_0x282fac,_0x20856c){ChatWebsiteEvents['emit'](_0x5bb051+':'+_0x14f24d['id'],_0x14f24d);ChatWebsiteEvents['emit'](_0x5bb051,_0x14f24d);_0x20856c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x891d('0x5')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 9d97436..3fd9194 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 _0x9d9b=['../../config/environment','./chatWebsite.attributes','define','ChatWebsite','chat_websites','util','api','moment','bluebird','request-promise','path'];(function(_0x1824fb,_0x130623){var _0x189c0e=function(_0x8a8b99){while(--_0x8a8b99){_0x1824fb['push'](_0x1824fb['shift']());}};_0x189c0e(++_0x130623);}(_0x9d9b,0x123));var _0xb9d9=function(_0x578bef,_0x13832e){_0x578bef=_0x578bef-0x0;var _0x134f43=_0x9d9b[_0x578bef];return _0x134f43;};'use strict';var _=require('lodash');var util=require(_0xb9d9('0x0'));var logger=require('../../config/logger')(_0xb9d9('0x1'));var moment=require(_0xb9d9('0x2'));var BPromise=require(_0xb9d9('0x3'));var rp=require(_0xb9d9('0x4'));var fs=require('fs');var path=require(_0xb9d9('0x5'));var rimraf=require('rimraf');var config=require(_0xb9d9('0x6'));var attributes=require(_0xb9d9('0x7'));module['exports']=function(_0x32ad25,_0x56ac2d){return _0x32ad25[_0xb9d9('0x8')](_0xb9d9('0x9'),attributes,{'tableName':_0xb9d9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfb53=['path','rimraf','../../config/environment','./chatWebsite.attributes','define','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x133d20,_0xcae9b9){var _0x25ba6b=function(_0x3ba8b0){while(--_0x3ba8b0){_0x133d20['push'](_0x133d20['shift']());}};_0x25ba6b(++_0xcae9b9);}(_0xfb53,0x145));var _0x3fb5=function(_0x26ddfe,_0xacae3f){_0x26ddfe=_0x26ddfe-0x0;var _0xa8f46f=_0xfb53[_0x26ddfe];return _0xa8f46f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3fb5('0x0'))(_0x3fb5('0x1'));var moment=require(_0x3fb5('0x2'));var BPromise=require(_0x3fb5('0x3'));var rp=require(_0x3fb5('0x4'));var fs=require('fs');var path=require(_0x3fb5('0x5'));var rimraf=require(_0x3fb5('0x6'));var config=require(_0x3fb5('0x7'));var attributes=require(_0x3fb5('0x8'));module['exports']=function(_0x18a50d,_0xad4ca2){return _0x18a50d[_0x3fb5('0x9')]('ChatWebsite',attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 6af34df..4b1cd5c 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 _0x2ab7=['request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','redis','localhost','./chatWebsite.socket','request','then','info','ChatWebsite,\x20%s,\x20%s'];(function(_0x3ea53b,_0x59600c){var _0x3aa2d9=function(_0x1cb005){while(--_0x1cb005){_0x3ea53b['push'](_0x3ea53b['shift']());}};_0x3aa2d9(++_0x59600c);}(_0x2ab7,0xe7));var _0x72ab=function(_0x1c1ff6,_0x2e478a){_0x1c1ff6=_0x1c1ff6-0x0;var _0x1f0d74=_0x2ab7[_0x1c1ff6];return _0x1f0d74;};'use strict';var _=require(_0x72ab('0x0'));var util=require(_0x72ab('0x1'));var moment=require(_0x72ab('0x2'));var BPromise=require(_0x72ab('0x3'));var rs=require(_0x72ab('0x4'));var fs=require('fs');var Redis=require(_0x72ab('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x72ab('0x6'));var logger=require(_0x72ab('0x7'))(_0x72ab('0x8'));var config=require(_0x72ab('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x72ab('0xa')]['http']({'port':0x232a});config['redis']=_[_0x72ab('0xb')](config[_0x72ab('0xc')],{'host':_0x72ab('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x72ab('0xe'))['register'](socket);function respondWithRpcPromise(_0x92030a,_0x33990a,_0x55e505){return new BPromise(function(_0x38321b,_0x280789){return client[_0x72ab('0xf')](_0x92030a,_0x55e505)[_0x72ab('0x10')](function(_0x33092d){logger[_0x72ab('0x11')](_0x72ab('0x12'),_0x33990a,_0x72ab('0x13'));logger[_0x72ab('0x14')](_0x72ab('0x15'),_0x33990a,'request\x20sent',JSON['stringify'](_0x33092d));if(_0x33092d[_0x72ab('0x16')]){if(_0x33092d[_0x72ab('0x16')][_0x72ab('0x17')]===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x33990a,_0x33092d[_0x72ab('0x16')][_0x72ab('0x18')]);return _0x280789(_0x33092d[_0x72ab('0x16')]['message']);}logger[_0x72ab('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x33990a,_0x33092d[_0x72ab('0x16')][_0x72ab('0x18')]);return _0x38321b(_0x33092d[_0x72ab('0x16')][_0x72ab('0x18')]);}else{logger[_0x72ab('0x11')](_0x72ab('0x12'),_0x33990a,_0x72ab('0x13'));_0x38321b(_0x33092d['result']['message']);}})['catch'](function(_0x37af47){logger['error'](_0x72ab('0x12'),_0x33990a,_0x37af47);_0x280789(_0x37af47);});});} \ No newline at end of file +var _0xc4b0=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./chatWebsite.socket','register','request','then','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ChatWebsite,\x20%s,\x20%s','info','catch','lodash'];(function(_0x549278,_0x450754){var _0x1ea9a1=function(_0x2e559d){while(--_0x2e559d){_0x549278['push'](_0x549278['shift']());}};_0x1ea9a1(++_0x450754);}(_0xc4b0,0xfb));var _0x0c4b=function(_0x5c658b,_0x550dce){_0x5c658b=_0x5c658b-0x0;var _0x3ca95f=_0xc4b0[_0x5c658b];return _0x3ca95f;};'use strict';var _=require(_0x0c4b('0x0'));var util=require('util');var moment=require(_0x0c4b('0x1'));var BPromise=require(_0x0c4b('0x2'));var rs=require(_0x0c4b('0x3'));var fs=require('fs');var Redis=require(_0x0c4b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0c4b('0x5'));var logger=require(_0x0c4b('0x6'))(_0x0c4b('0x7'));var config=require(_0x0c4b('0x8'));var jayson=require(_0x0c4b('0x9'));var client=jayson[_0x0c4b('0xa')][_0x0c4b('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x0c4b('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x0c4b('0xd'))(new Redis(config['redis']));require(_0x0c4b('0xe'))[_0x0c4b('0xf')](socket);function respondWithRpcPromise(_0xa33db2,_0x48ad39,_0x26916c){return new BPromise(function(_0x571dd7,_0x522bbc){return client[_0x0c4b('0x10')](_0xa33db2,_0x26916c)[_0x0c4b('0x11')](function(_0x52b529){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x48ad39,'request\x20sent');logger[_0x0c4b('0x12')](_0x0c4b('0x13'),_0x48ad39,_0x0c4b('0x14'),JSON[_0x0c4b('0x15')](_0x52b529));if(_0x52b529[_0x0c4b('0x16')]){if(_0x52b529['error'][_0x0c4b('0x17')]===0x1f4){logger[_0x0c4b('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x48ad39,_0x52b529['error'][_0x0c4b('0x18')]);return _0x522bbc(_0x52b529[_0x0c4b('0x16')][_0x0c4b('0x18')]);}logger[_0x0c4b('0x16')](_0x0c4b('0x19'),_0x48ad39,_0x52b529[_0x0c4b('0x16')][_0x0c4b('0x18')]);return _0x571dd7(_0x52b529[_0x0c4b('0x16')][_0x0c4b('0x18')]);}else{logger[_0x0c4b('0x1a')]('ChatWebsite,\x20%s,\x20%s',_0x48ad39,_0x0c4b('0x14'));_0x571dd7(_0x52b529['result'][_0x0c4b('0x18')]);}})[_0x0c4b('0x1b')](function(_0x5d3e50){logger[_0x0c4b('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x48ad39,_0x5d3e50);_0x522bbc(_0x5d3e50);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 39046d1..a4a7201 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 _0xedf2=['save','update','emit','removeListener','register','length'];(function(_0x1acf29,_0x31dbf6){var _0x4f2c18=function(_0x50d115){while(--_0x50d115){_0x1acf29['push'](_0x1acf29['shift']());}};_0x4f2c18(++_0x31dbf6);}(_0xedf2,0xa2));var _0x2edf=function(_0x3029ad,_0x4a48e1){_0x3029ad=_0x3029ad-0x0;var _0x221c99=_0xedf2[_0x3029ad];return _0x221c99;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x2edf('0x0'),'remove',_0x2edf('0x1')];function createListener(_0x3e1a5d,_0x44b865){return function(_0x1c3a36){_0x44b865[_0x2edf('0x2')](_0x3e1a5d,_0x1c3a36);};}function removeListener(_0x1df924,_0x3b0545){return function(){ChatWebsiteEvents[_0x2edf('0x3')](_0x1df924,_0x3b0545);};}exports[_0x2edf('0x4')]=function(_0x2d5e6f){for(var _0x47531c=0x0,_0x3a40c4=events[_0x2edf('0x5')];_0x47531c<_0x3a40c4;_0x47531c++){var _0x2101b3=events[_0x47531c];var _0x501070=createListener('chatWebsite:'+_0x2101b3,_0x2d5e6f);ChatWebsiteEvents['on'](_0x2101b3,_0x501070);}}; \ No newline at end of file +var _0x352b=['register','./chatWebsite.events','save','update','removeListener'];(function(_0x24575f,_0x28ae5d){var _0x39218c=function(_0x15919f){while(--_0x15919f){_0x24575f['push'](_0x24575f['shift']());}};_0x39218c(++_0x28ae5d);}(_0x352b,0x1c8));var _0xb352=function(_0x5ca317,_0x1a76b9){_0x5ca317=_0x5ca317-0x0;var _0x5b1d8b=_0x352b[_0x5ca317];return _0x5b1d8b;};'use strict';var ChatWebsiteEvents=require(_0xb352('0x0'));var events=[_0xb352('0x1'),'remove',_0xb352('0x2')];function createListener(_0x265b30,_0x384148){return function(_0x5b3c5b){_0x384148['emit'](_0x265b30,_0x5b3c5b);};}function removeListener(_0x11375a,_0x3f9de0){return function(){ChatWebsiteEvents[_0xb352('0x3')](_0x11375a,_0x3f9de0);};}exports[_0xb352('0x4')]=function(_0x5697be){for(var _0x4f1997=0x0,_0x41258e=events['length'];_0x4f1997<_0x41258e;_0x4f1997++){var _0x2d70d9=events[_0x4f1997];var _0x4e09cd=createListener('chatWebsite:'+_0x2d70d9,_0x5697be);ChatWebsiteEvents['on'](_0x2d70d9,_0x4e09cd);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index c2454b3..e102b4f 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 _0x3d9c=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','show','getDispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','getInteractions','/:id/snippet','getApplications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','/:id/users','post','create','/:id/dispositions','addAnswer','diskStorage','join','root','server/files/images/logos/','format','now','/:id/logo','single','server/files/images/avatars/','%s-%s','originalname','/:id/customer_avatar','file','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','notify','/:id/offline','offline','/:id/interactions','addInteraction','/:id/applications','addApplications','addProactiveActions','delete','/:id','destroy','removeDispositions','removeAnswers','removeAgents','multer','path'];(function(_0x5151b1,_0x35a70e){var _0x167b1a=function(_0x22da58){while(--_0x22da58){_0x5151b1['push'](_0x5151b1['shift']());}};_0x167b1a(++_0x35a70e);}(_0x3d9c,0x134));var _0xc3d9=function(_0x145abe,_0x202c52){_0x145abe=_0x145abe-0x0;var _0x221b1f=_0x3d9c[_0x145abe];return _0x221b1f;};'use strict';var multer=require(_0xc3d9('0x0'));var util=require('util');var path=require(_0xc3d9('0x1'));var timeout=require(_0xc3d9('0x2'));var express=require(_0xc3d9('0x3'));var router=express['Router']();var auth=require(_0xc3d9('0x4'));var interaction=require(_0xc3d9('0x5'));var config=require(_0xc3d9('0x6'));var controller=require(_0xc3d9('0x7'));router[_0xc3d9('0x8')]('/',auth[_0xc3d9('0x9')](),controller[_0xc3d9('0xa')]);router['get'](_0xc3d9('0xb'),auth[_0xc3d9('0x9')](),controller['describe']);router[_0xc3d9('0x8')]('/:id',auth[_0xc3d9('0x9')](),controller[_0xc3d9('0xc')]);router[_0xc3d9('0x8')]('/:id/dispositions',auth[_0xc3d9('0x9')](),controller[_0xc3d9('0xd')]);router['get'](_0xc3d9('0xe'),auth[_0xc3d9('0x9')](),controller[_0xc3d9('0xf')]);router[_0xc3d9('0x8')]('/:id/logo',controller[_0xc3d9('0x10')]);router['get'](_0xc3d9('0x11'),controller[_0xc3d9('0x12')]);router[_0xc3d9('0x8')]('/:id/customer_avatar',controller[_0xc3d9('0x13')]);router[_0xc3d9('0x8')]('/:id/system_avatar',controller['getSystemAvatar']);router[_0xc3d9('0x8')]('/:id/interactions',auth[_0xc3d9('0x9')](),controller[_0xc3d9('0x14')]);router[_0xc3d9('0x8')](_0xc3d9('0x15'),controller['getSnippet']);router['get']('/:id/applications',auth[_0xc3d9('0x9')](),controller[_0xc3d9('0x16')]);router[_0xc3d9('0x8')]('/:id/proactive_actions',auth[_0xc3d9('0x9')](),controller[_0xc3d9('0x17')]);router[_0xc3d9('0x8')](_0xc3d9('0x18'),controller[_0xc3d9('0x19')]);router[_0xc3d9('0x8')](_0xc3d9('0x1a'),auth[_0xc3d9('0x9')](),controller['getOfflineMessages']);router[_0xc3d9('0x8')](_0xc3d9('0x1b'),auth[_0xc3d9('0x9')](),controller['getAgents']);router[_0xc3d9('0x1c')]('/',auth[_0xc3d9('0x9')](),controller[_0xc3d9('0x1d')]);router[_0xc3d9('0x1c')](_0xc3d9('0x1e'),auth[_0xc3d9('0x9')](),controller['addDisposition']);router[_0xc3d9('0x1c')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xc3d9('0x1f')]);var upload=multer({'storage':multer[_0xc3d9('0x20')]({'destination':function(_0x2ee926,_0x22506a,_0x56063a){_0x56063a(null,path[_0xc3d9('0x21')](config[_0xc3d9('0x22')],_0xc3d9('0x23')));},'filename':function(_0x21fd30,_0x2190f8,_0x5f3e33){_0x5f3e33(null,util[_0xc3d9('0x24')]('%s-%s',Date[_0xc3d9('0x25')](),_0x2190f8['originalname']));}})});router[_0xc3d9('0x1c')](_0xc3d9('0x26'),upload[_0xc3d9('0x27')]('file'),controller['addLogo']);var upload=multer({'storage':multer[_0xc3d9('0x20')]({'destination':function(_0x4500d1,_0x2973d5,_0x528326){_0x528326(null,path[_0xc3d9('0x21')](config[_0xc3d9('0x22')],_0xc3d9('0x28')));},'filename':function(_0x341e81,_0x1b146f,_0x10f22c){_0x10f22c(null,util[_0xc3d9('0x24')](_0xc3d9('0x29'),Date[_0xc3d9('0x25')](),_0x1b146f['originalname']));}})});router[_0xc3d9('0x1c')](_0xc3d9('0x11'),upload[_0xc3d9('0x27')]('file'),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x32ebda,_0x118123,_0x54a7b8){_0x54a7b8(null,path[_0xc3d9('0x21')](config[_0xc3d9('0x22')],_0xc3d9('0x28')));},'filename':function(_0xd8f7ba,_0x34e4f3,_0x2e6fb8){_0x2e6fb8(null,util['format'](_0xc3d9('0x29'),Date['now'](),_0x34e4f3[_0xc3d9('0x2a')]));}})});router[_0xc3d9('0x1c')](_0xc3d9('0x2b'),upload[_0xc3d9('0x27')](_0xc3d9('0x2c')),controller[_0xc3d9('0x2d')]);var upload=multer({'storage':multer[_0xc3d9('0x20')]({'destination':function(_0xb860ec,_0x92dc19,_0x4cc424){_0x4cc424(null,path[_0xc3d9('0x21')](config[_0xc3d9('0x22')],_0xc3d9('0x28')));},'filename':function(_0x42b540,_0x571ca8,_0x4fb50a){_0x4fb50a(null,util[_0xc3d9('0x24')]('%s-%s',Date[_0xc3d9('0x25')](),_0x571ca8[_0xc3d9('0x2a')]));}})});router[_0xc3d9('0x1c')](_0xc3d9('0x2e'),upload[_0xc3d9('0x27')](_0xc3d9('0x2c')),controller[_0xc3d9('0x2f')]);router[_0xc3d9('0x1c')]('/:id/notify',controller[_0xc3d9('0x30')]);router['post'](_0xc3d9('0x31'),controller[_0xc3d9('0x32')]);router['post'](_0xc3d9('0x33'),auth[_0xc3d9('0x9')](),controller[_0xc3d9('0x34')]);router[_0xc3d9('0x1c')](_0xc3d9('0x35'),auth[_0xc3d9('0x9')](),controller[_0xc3d9('0x36')]);router['post']('/:id/proactive_actions',auth[_0xc3d9('0x9')](),controller[_0xc3d9('0x37')]);router[_0xc3d9('0x1c')](_0xc3d9('0x1b'),auth[_0xc3d9('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0xc3d9('0x9')](),controller['update']);router[_0xc3d9('0x38')](_0xc3d9('0x39'),auth[_0xc3d9('0x9')](),controller[_0xc3d9('0x3a')]);router[_0xc3d9('0x38')](_0xc3d9('0x1e'),auth[_0xc3d9('0x9')](),controller[_0xc3d9('0x3b')]);router[_0xc3d9('0x38')](_0xc3d9('0xe'),auth['isAuthenticated'](),controller[_0xc3d9('0x3c')]);router[_0xc3d9('0x38')]('/:id/users',auth['isAuthenticated'](),controller[_0xc3d9('0x3d')]);module['exports']=router; \ No newline at end of file +var _0xf3cd=['/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','originalname','file','addLogo','now','single','addAvatar','server/files/images/avatars/','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','/:id/offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update','destroy','delete','removeDispositions','removeAnswers','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x148c09,_0x4fd39f){_0x148c09=_0x148c09-0x0;var _0x18e613=_0xf3cd[_0x148c09];return _0x18e613;};'use strict';var multer=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var path=require(_0xdf3c('0x2'));var timeout=require(_0xdf3c('0x3'));var express=require(_0xdf3c('0x4'));var router=express[_0xdf3c('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xdf3c('0x6'));var config=require(_0xdf3c('0x7'));var controller=require(_0xdf3c('0x8'));router['get']('/',auth[_0xdf3c('0x9')](),controller[_0xdf3c('0xa')]);router[_0xdf3c('0xb')](_0xdf3c('0xc'),auth[_0xdf3c('0x9')](),controller[_0xdf3c('0xd')]);router['get'](_0xdf3c('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xdf3c('0xb')](_0xdf3c('0xf'),auth['isAuthenticated'](),controller[_0xdf3c('0x10')]);router[_0xdf3c('0xb')](_0xdf3c('0x11'),auth[_0xdf3c('0x9')](),controller[_0xdf3c('0x12')]);router[_0xdf3c('0xb')](_0xdf3c('0x13'),controller[_0xdf3c('0x14')]);router['get'](_0xdf3c('0x15'),controller[_0xdf3c('0x16')]);router[_0xdf3c('0xb')](_0xdf3c('0x17'),controller['getCustomerAvatar']);router[_0xdf3c('0xb')](_0xdf3c('0x18'),controller[_0xdf3c('0x19')]);router['get'](_0xdf3c('0x1a'),auth[_0xdf3c('0x9')](),controller[_0xdf3c('0x1b')]);router[_0xdf3c('0xb')](_0xdf3c('0x1c'),controller[_0xdf3c('0x1d')]);router[_0xdf3c('0xb')](_0xdf3c('0x1e'),auth[_0xdf3c('0x9')](),controller[_0xdf3c('0x1f')]);router['get'](_0xdf3c('0x20'),auth[_0xdf3c('0x9')](),controller[_0xdf3c('0x21')]);router[_0xdf3c('0xb')](_0xdf3c('0x22'),controller[_0xdf3c('0x23')]);router[_0xdf3c('0xb')](_0xdf3c('0x24'),auth[_0xdf3c('0x9')](),controller[_0xdf3c('0x25')]);router[_0xdf3c('0xb')](_0xdf3c('0x26'),auth[_0xdf3c('0x9')](),controller['getAgents']);router['post']('/',auth[_0xdf3c('0x9')](),controller['create']);router[_0xdf3c('0x27')](_0xdf3c('0xf'),auth[_0xdf3c('0x9')](),controller[_0xdf3c('0x28')]);router[_0xdf3c('0x27')](_0xdf3c('0x11'),auth['isAuthenticated'](),controller[_0xdf3c('0x29')]);var upload=multer({'storage':multer[_0xdf3c('0x2a')]({'destination':function(_0x13e3ca,_0x24754a,_0x40032a){_0x40032a(null,path[_0xdf3c('0x2b')](config[_0xdf3c('0x2c')],_0xdf3c('0x2d')));},'filename':function(_0x18cb46,_0x1adee4,_0x4c076c){_0x4c076c(null,util[_0xdf3c('0x2e')](_0xdf3c('0x2f'),Date['now'](),_0x1adee4[_0xdf3c('0x30')]));}})});router['post']('/:id/logo',upload['single'](_0xdf3c('0x31')),controller[_0xdf3c('0x32')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5c3b5a,_0x37ecfd,_0x1f2ce4){_0x1f2ce4(null,path[_0xdf3c('0x2b')](config[_0xdf3c('0x2c')],'server/files/images/avatars/'));},'filename':function(_0x43ce06,_0x2a2d94,_0x5386bf){_0x5386bf(null,util['format'](_0xdf3c('0x2f'),Date[_0xdf3c('0x33')](),_0x2a2d94[_0xdf3c('0x30')]));}})});router['post'](_0xdf3c('0x15'),upload[_0xdf3c('0x34')](_0xdf3c('0x31')),controller[_0xdf3c('0x35')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xda0de0,_0x46b445,_0x522e5f){_0x522e5f(null,path[_0xdf3c('0x2b')](config[_0xdf3c('0x2c')],_0xdf3c('0x36')));},'filename':function(_0x2287f,_0x5d705d,_0x33632f){_0x33632f(null,util[_0xdf3c('0x2e')](_0xdf3c('0x2f'),Date[_0xdf3c('0x33')](),_0x5d705d['originalname']));}})});router[_0xdf3c('0x27')](_0xdf3c('0x17'),upload['single']('file'),controller[_0xdf3c('0x37')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x216115,_0x5e8130,_0x57faba){_0x57faba(null,path['join'](config[_0xdf3c('0x2c')],_0xdf3c('0x36')));},'filename':function(_0x1d0b8a,_0x29b5b7,_0x54c25f){_0x54c25f(null,util['format'](_0xdf3c('0x2f'),Date['now'](),_0x29b5b7[_0xdf3c('0x30')]));}})});router[_0xdf3c('0x27')](_0xdf3c('0x18'),upload[_0xdf3c('0x34')](_0xdf3c('0x31')),controller[_0xdf3c('0x38')]);router[_0xdf3c('0x27')](_0xdf3c('0x39'),controller[_0xdf3c('0x3a')]);router['post'](_0xdf3c('0x3b'),controller['offline']);router['post'](_0xdf3c('0x1a'),auth['isAuthenticated'](),controller[_0xdf3c('0x3c')]);router['post'](_0xdf3c('0x1e'),auth[_0xdf3c('0x9')](),controller[_0xdf3c('0x3d')]);router[_0xdf3c('0x27')](_0xdf3c('0x20'),auth[_0xdf3c('0x9')](),controller[_0xdf3c('0x3e')]);router[_0xdf3c('0x27')](_0xdf3c('0x26'),auth[_0xdf3c('0x9')](),controller[_0xdf3c('0x3f')]);router[_0xdf3c('0x40')]('/:id',auth['isAuthenticated'](),controller[_0xdf3c('0x41')]);router['delete'](_0xdf3c('0xe'),auth[_0xdf3c('0x9')](),controller[_0xdf3c('0x42')]);router[_0xdf3c('0x43')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xdf3c('0x44')]);router[_0xdf3c('0x43')](_0xdf3c('0x11'),auth['isAuthenticated'](),controller[_0xdf3c('0x45')]);router[_0xdf3c('0x43')](_0xdf3c('0x26'),auth[_0xdf3c('0x9')](),controller['removeAgents']);module[_0xdf3c('0x46')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 9b38a0f..fbacf4a 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 _0x943c=['setDataValue','saFiscalMessage','join','getDataValue','INTEGER','DBA','sequelize','exports','STRING','FLOAT'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x943c,0xd8));var _0xc943=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x943c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc943('0x0'));module[_0xc943('0x1')]={'name':{'type':Sequelize[_0xc943('0x2')]},'companyId':{'type':Sequelize[_0xc943('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xc943('0x2')]},'type':{'type':Sequelize[_0xc943('0x2')]},'street':{'type':Sequelize[_0xc943('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xc943('0x2')]},'country':{'type':Sequelize[_0xc943('0x2')]},'email':{'type':Sequelize[_0xc943('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xc943('0x2')]},'sStreet':{'type':Sequelize[_0xc943('0x2')]},'sPostalCode':{'type':Sequelize[_0xc943('0x2')]},'sCity':{'type':Sequelize[_0xc943('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc943('0x2')]},'flatDiscount':{'type':Sequelize[_0xc943('0x3')]},'saStreet':{'type':Sequelize[_0xc943('0x2')]},'saPostalCode':{'type':Sequelize[_0xc943('0x2')]},'saCity':{'type':Sequelize['STRING']},'saCountry':{'type':Sequelize['STRING']},'saISOCode':{'type':Sequelize[_0xc943('0x2')](0x3)},'saFiscalCode':{'type':Sequelize[_0xc943('0x2')](0x32)},'saPIVA':{'type':Sequelize['STRING'](0x32)},'saSDICode':{'type':Sequelize['STRING'](0x15)},'saFiscalMessage':{'type':Sequelize[_0xc943('0x2')],'set':function(_0x401b9a){this[_0xc943('0x4')](_0xc943('0x5'),_0x401b9a?_0x401b9a[_0xc943('0x6')](','):null);},'get':function(){return this[_0xc943('0x7')]('saFiscalMessage')?this[_0xc943('0x7')](_0xc943('0x5'))['split'](','):[];}},'saExpiryDay':{'type':Sequelize['INTEGER']},'saEurope':{'type':Sequelize['BOOLEAN']},'saSocCap':{'type':Sequelize[_0xc943('0x2')](0xff)},'saPaymentMethod':{'type':Sequelize[_0xc943('0x8')]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vat':{'type':Sequelize[_0xc943('0x2')](0xff)},'saDepartment':{'type':Sequelize['ENUM']('XCally',_0xc943('0x9'))}}; \ No newline at end of file +var _0x8ce1=['saFiscalMessage','join','getDataValue','split','INTEGER','BOOLEAN','ENUM','XCally','DBA','sequelize','exports','STRING','FLOAT','setDataValue'];(function(_0x349ecc,_0x235327){var _0x2c4f15=function(_0x454525){while(--_0x454525){_0x349ecc['push'](_0x349ecc['shift']());}};_0x2c4f15(++_0x235327);}(_0x8ce1,0x183));var _0x18ce=function(_0x56708e,_0x39a8d1){_0x56708e=_0x56708e-0x0;var _0x1d4bad=_0x8ce1[_0x56708e];return _0x1d4bad;};'use strict';var Sequelize=require(_0x18ce('0x0'));module[_0x18ce('0x1')]={'name':{'type':Sequelize[_0x18ce('0x2')]},'companyId':{'type':Sequelize[_0x18ce('0x2')]},'website':{'type':Sequelize[_0x18ce('0x2')]},'phone':{'type':Sequelize[_0x18ce('0x2')]},'fax':{'type':Sequelize[_0x18ce('0x2')]},'type':{'type':Sequelize[_0x18ce('0x2')]},'street':{'type':Sequelize[_0x18ce('0x2')]},'postalCode':{'type':Sequelize[_0x18ce('0x2')]},'city':{'type':Sequelize[_0x18ce('0x2')]},'country':{'type':Sequelize[_0x18ce('0x2')]},'email':{'type':Sequelize[_0x18ce('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x18ce('0x2')]},'sStreet':{'type':Sequelize[_0x18ce('0x2')]},'sPostalCode':{'type':Sequelize[_0x18ce('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x18ce('0x2')]},'description':{'type':Sequelize[_0x18ce('0x2')]},'flatDiscount':{'type':Sequelize[_0x18ce('0x3')]},'saStreet':{'type':Sequelize[_0x18ce('0x2')]},'saPostalCode':{'type':Sequelize['STRING']},'saCity':{'type':Sequelize[_0x18ce('0x2')]},'saCountry':{'type':Sequelize[_0x18ce('0x2')]},'saISOCode':{'type':Sequelize[_0x18ce('0x2')](0x3)},'saFiscalCode':{'type':Sequelize[_0x18ce('0x2')](0x32)},'saPIVA':{'type':Sequelize['STRING'](0x32)},'saSDICode':{'type':Sequelize['STRING'](0x15)},'saFiscalMessage':{'type':Sequelize[_0x18ce('0x2')],'set':function(_0x1a373a){this[_0x18ce('0x4')](_0x18ce('0x5'),_0x1a373a?_0x1a373a[_0x18ce('0x6')](','):null);},'get':function(){return this['getDataValue'](_0x18ce('0x5'))?this[_0x18ce('0x7')](_0x18ce('0x5'))[_0x18ce('0x8')](','):[];}},'saExpiryDay':{'type':Sequelize[_0x18ce('0x9')]},'saEurope':{'type':Sequelize['BOOLEAN']},'saSocCap':{'type':Sequelize[_0x18ce('0x2')](0xff)},'saPaymentMethod':{'type':Sequelize[_0x18ce('0x9')]},'defaultEntry':{'type':Sequelize[_0x18ce('0xa')],'defaultValue':![]},'vat':{'type':Sequelize[_0x18ce('0x2')](0xff)},'saDepartment':{'type':Sequelize[_0x18ce('0xb')](_0x18ce('0xc'),_0x18ce('0xd'))}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 53dbf7d..f575d79 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 _0xa4ad=['model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','where','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','CmContact','omit','ids','getContacts','findOne','html-pdf','rimraf','zip-dir','request-promise','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','reject','save','update','then','destroy','error','stack','name','send','index','CmCompany','rawAttributes'];(function(_0x5dcb4d,_0x129b7b){var _0x32348c=function(_0x3ab820){while(--_0x3ab820){_0x5dcb4d['push'](_0x5dcb4d['shift']());}};_0x32348c(++_0x129b7b);}(_0xa4ad,0x1ec));var _0xda4a=function(_0x34a8c8,_0x31e259){_0x34a8c8=_0x34a8c8-0x0;var _0x1fe6e5=_0xa4ad[_0x34a8c8];return _0x1fe6e5;};'use strict';var pdf=require(_0xda4a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xda4a('0x1'));var zipdir=require(_0xda4a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xda4a('0x3'));var moment=require('moment');var BPromise=require(_0xda4a('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xda4a('0x5'));var sox=require(_0xda4a('0x6'));var csv=require(_0xda4a('0x7'));var ejs=require(_0xda4a('0x8'));var fs=require('fs');var _=require(_0xda4a('0x9'));var squel=require(_0xda4a('0xa'));var crypto=require(_0xda4a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xda4a('0xc'));var toCsv=require(_0xda4a('0x7'));var querystring=require(_0xda4a('0xd'));var Papa=require(_0xda4a('0xe'));var Redis=require('ioredis');var authService=require(_0xda4a('0xf'));var qs=require(_0xda4a('0x10'));var hardwareService=require(_0xda4a('0x11'));var logger=require(_0xda4a('0x12'))(_0xda4a('0x13'));var utils=require(_0xda4a('0x14'));var config=require(_0xda4a('0x15'));var db=require(_0xda4a('0x16'))['db'];function respondWithStatusCode(_0x12c4d1,_0x36ac8e){_0x36ac8e=_0x36ac8e||0xcc;return function(_0x4dd00a){if(_0x4dd00a){return _0x12c4d1[_0xda4a('0x17')](_0x36ac8e);}return _0x12c4d1[_0xda4a('0x18')](_0x36ac8e)[_0xda4a('0x19')]();};}function respondWithResult(_0x5d079f,_0x2dee98){_0x2dee98=_0x2dee98||0xc8;return function(_0x58dda0){if(_0x58dda0){return _0x5d079f[_0xda4a('0x18')](_0x2dee98)[_0xda4a('0x1a')](_0x58dda0);}};}function respondWithFilteredResult(_0x589151,_0x4f12ca){return function(_0x17fa94){if(_0x17fa94){var _0x810b92=_0x17fa94[_0xda4a('0x1b')],_0x9ce192=_0x4f12ca[_0xda4a('0x1c')],_0x344c2f=_0x4f12ca[_0xda4a('0x1c')]+_0x4f12ca['limit'],_0x3b1523;if(_0x344c2f>=_0x810b92){_0x344c2f=_0x810b92;_0x3b1523=0xc8;}else{_0x3b1523=0xce;}_0x589151[_0xda4a('0x18')](_0x3b1523);return _0x589151[_0xda4a('0x1d')]('Content-Range',_0x9ce192+'-'+_0x344c2f+'/'+_0x810b92)['json'](_0x17fa94);}return null;};}function patchUpdates(_0x39d743){return function(_0x3b6bfc){try{jsonpatch['apply'](_0x3b6bfc,_0x39d743,!![]);}catch(_0x480e5a){return BPromise[_0xda4a('0x1e')](_0x480e5a);}return _0x3b6bfc[_0xda4a('0x1f')]();};}function saveUpdates(_0x37e0a5,_0x5f142a){return function(_0x21f9a4){if(_0x21f9a4){return _0x21f9a4[_0xda4a('0x20')](_0x37e0a5)[_0xda4a('0x21')](function(_0x56482b){return _0x56482b;});}return null;};}function removeEntity(_0x5be59f,_0x3dea73){return function(_0xef8f75){if(_0xef8f75){return _0xef8f75[_0xda4a('0x22')]()[_0xda4a('0x21')](function(){var _0x488a9d=_0xef8f75['get']({'plain':!![]});var _0x18cd3d='Companies';return db['UserProfileResource'][_0xda4a('0x22')]({'where':{'type':_0x18cd3d,'resourceId':_0x488a9d['id']}})[_0xda4a('0x21')](function(){return _0xef8f75;});})[_0xda4a('0x21')](function(){_0x5be59f[_0xda4a('0x18')](0xcc)[_0xda4a('0x19')]();});}};}function handleEntityNotFound(_0x114088,_0x1d6241){return function(_0x7ec9a3){if(!_0x7ec9a3){_0x114088['sendStatus'](0x194);}return _0x7ec9a3;};}function handleError(_0x1d275f,_0x2c7576){_0x2c7576=_0x2c7576||0x1f4;return function(_0x1f7dfd){logger[_0xda4a('0x23')](_0x1f7dfd[_0xda4a('0x24')]);if(_0x1f7dfd[_0xda4a('0x25')]){delete _0x1f7dfd['name'];}_0x1d275f[_0xda4a('0x18')](_0x2c7576)[_0xda4a('0x26')](_0x1f7dfd);};}exports[_0xda4a('0x27')]=function(_0x52e614,_0x5dd573){var _0x4668bc={},_0x5bba63={},_0x94da9f={'count':0x0,'rows':[]};var _0x2b0074=db[_0xda4a('0x28')][_0xda4a('0x29')];_0x5bba63[_0xda4a('0x2a')]=_[_0xda4a('0x2b')](_0x2b0074);_0x5bba63['query']=_[_0xda4a('0x2b')](_0x52e614[_0xda4a('0x2c')]);_0x5bba63[_0xda4a('0x2d')]=_[_0xda4a('0x2e')](_0x5bba63[_0xda4a('0x2a')],_0x5bba63[_0xda4a('0x2c')]);_0x4668bc[_0xda4a('0x2f')]=_[_0xda4a('0x2e')](_0x5bba63[_0xda4a('0x2a')],qs['fields'](_0x52e614[_0xda4a('0x2c')][_0xda4a('0x30')]));_0x4668bc[_0xda4a('0x2f')]=_0x4668bc[_0xda4a('0x2f')][_0xda4a('0x31')]?_0x4668bc[_0xda4a('0x2f')]:_0x5bba63['model'];if(!_0x52e614[_0xda4a('0x2c')][_0xda4a('0x32')](_0xda4a('0x33'))){_0x4668bc[_0xda4a('0x34')]=qs[_0xda4a('0x34')](_0x52e614[_0xda4a('0x2c')][_0xda4a('0x34')]);_0x4668bc[_0xda4a('0x1c')]=qs['offset'](_0x52e614[_0xda4a('0x2c')]['offset']);}_0x4668bc[_0xda4a('0x35')]=qs['sort'](_0x52e614[_0xda4a('0x2c')][_0xda4a('0x36')]);_0x4668bc['where']=qs[_0xda4a('0x2d')](_[_0xda4a('0x37')](_0x52e614[_0xda4a('0x2c')],_0x5bba63[_0xda4a('0x2d')]));if(_0x52e614['query'][_0xda4a('0x38')]){_0x4668bc['where']=_[_0xda4a('0x39')](_0x4668bc[_0xda4a('0x3a')],{'$or':_[_0xda4a('0x3b')](_0x2b0074,function(_0xe13c70){if(_0xe13c70[_0xda4a('0x3c')][_0xda4a('0x3d')]!==_0xda4a('0x3e')){var _0x4833c2={};_0x4833c2[_0xe13c70[_0xda4a('0x3f')]]={'$like':'%'+_0x52e614['query'][_0xda4a('0x38')]+'%'};return _0x4833c2;}})});}_0x4668bc=_[_0xda4a('0x39')]({},_0x4668bc,_0x52e614[_0xda4a('0x40')]);var _0x3a9af8={'where':_0x4668bc[_0xda4a('0x3a')]};return db['CmCompany'][_0xda4a('0x1b')](_0x3a9af8)[_0xda4a('0x21')](function(_0x2b3143){_0x94da9f[_0xda4a('0x1b')]=_0x2b3143;if(_0x52e614[_0xda4a('0x2c')][_0xda4a('0x41')]){_0x4668bc[_0xda4a('0x42')]=[{'all':!![]}];}return db[_0xda4a('0x28')][_0xda4a('0x43')](_0x4668bc);})['then'](function(_0x1fb501){_0x94da9f[_0xda4a('0x44')]=_0x1fb501;return _0x94da9f;})['then'](respondWithFilteredResult(_0x5dd573,_0x4668bc))['catch'](handleError(_0x5dd573,null));};exports[_0xda4a('0x45')]=function(_0x433349,_0x4443f4){var _0x53ff7a={'raw':![],'where':{'id':_0x433349['params']['id']}},_0x2595d7={};_0x2595d7[_0xda4a('0x2a')]=_[_0xda4a('0x2b')](db['CmCompany']['rawAttributes']);_0x2595d7[_0xda4a('0x2c')]=_[_0xda4a('0x2b')](_0x433349[_0xda4a('0x2c')]);_0x2595d7[_0xda4a('0x2d')]=_[_0xda4a('0x2e')](_0x2595d7[_0xda4a('0x2a')],_0x2595d7[_0xda4a('0x2c')]);_0x53ff7a[_0xda4a('0x2f')]=_[_0xda4a('0x2e')](_0x2595d7[_0xda4a('0x2a')],qs['fields'](_0x433349[_0xda4a('0x2c')][_0xda4a('0x30')]));_0x53ff7a[_0xda4a('0x2f')]=_0x53ff7a['attributes'][_0xda4a('0x31')]?_0x53ff7a['attributes']:_0x2595d7['model'];if(_0x433349[_0xda4a('0x2c')][_0xda4a('0x41')]){_0x53ff7a[_0xda4a('0x42')]=[{'all':!![]}];}_0x53ff7a=_[_0xda4a('0x39')]({},_0x53ff7a,_0x433349['options']);return db[_0xda4a('0x28')][_0xda4a('0x46')](_0x53ff7a)[_0xda4a('0x21')](handleEntityNotFound(_0x4443f4,null))['then'](respondWithResult(_0x4443f4,null))[_0xda4a('0x47')](handleError(_0x4443f4,null));};exports[_0xda4a('0x48')]=function(_0x5115ec,_0x2a77e0){return db[_0xda4a('0x28')][_0xda4a('0x48')](_0x5115ec[_0xda4a('0x49')],{})['then'](function(_0x251542){var _0x55c011=_0x5115ec[_0xda4a('0x4a')][_0xda4a('0x4b')]({'plain':!![]});if(!_0x55c011)throw new Error(_0xda4a('0x4c'));if(_0x55c011[_0xda4a('0x4d')]==='user'){var _0x282e68=_0x251542[_0xda4a('0x4b')]({'plain':!![]});var _0x131b2b=_0xda4a('0x4e');return db[_0xda4a('0x4f')][_0xda4a('0x46')]({'where':{'name':_0x131b2b,'userProfileId':_0x55c011[_0xda4a('0x50')]},'raw':!![]})[_0xda4a('0x21')](function(_0x196fc6){if(_0x196fc6&&_0x196fc6['autoAssociation']===0x0){return db['UserProfileResource'][_0xda4a('0x48')]({'name':_0x282e68[_0xda4a('0x25')],'resourceId':_0x282e68['id'],'type':_0x196fc6[_0xda4a('0x25')],'sectionId':_0x196fc6['id']},{})['then'](function(){return _0x251542;});}else{return _0x251542;}})[_0xda4a('0x47')](function(_0x5dcea6){logger['error'](_0xda4a('0x51'),_0x5dcea6);throw _0x5dcea6;});}return _0x251542;})[_0xda4a('0x21')](respondWithResult(_0x2a77e0,0xc9))['catch'](handleError(_0x2a77e0,null));};exports['update']=function(_0x550094,_0x33edf5){if(_0x550094[_0xda4a('0x49')]['id']){delete _0x550094['body']['id'];}return db['CmCompany'][_0xda4a('0x46')]({'where':{'id':_0x550094[_0xda4a('0x52')]['id']}})[_0xda4a('0x21')](handleEntityNotFound(_0x33edf5,null))['then'](saveUpdates(_0x550094[_0xda4a('0x49')],null))[_0xda4a('0x21')](respondWithResult(_0x33edf5,null))[_0xda4a('0x47')](handleError(_0x33edf5,null));};exports[_0xda4a('0x22')]=function(_0x48176d,_0x22fc27){return db[_0xda4a('0x28')][_0xda4a('0x46')]({'where':{'id':_0x48176d[_0xda4a('0x52')]['id']}})[_0xda4a('0x21')](handleEntityNotFound(_0x22fc27,null))[_0xda4a('0x21')](removeEntity(_0x22fc27,null))[_0xda4a('0x47')](handleError(_0x22fc27,null));};exports[_0xda4a('0x53')]=function(_0xced493,_0x160f5e,_0x629bd6){return db[_0xda4a('0x54')][_0xda4a('0x46')]({'where':{'id':_0xced493[_0xda4a('0x52')]['id']}})[_0xda4a('0x21')](handleEntityNotFound(_0x160f5e,null))[_0xda4a('0x21')](function(_0x18ddfd){if(_0x18ddfd){return _0x18ddfd['addContacts'](_0xced493[_0xda4a('0x49')]['ids'],_[_0xda4a('0x55')](_0xced493[_0xda4a('0x49')],[_0xda4a('0x56'),'id'])||{});}})['then'](respondWithResult(_0x160f5e,null))['catch'](handleError(_0x160f5e,null));};exports[_0xda4a('0x57')]=function(_0x3da0e4,_0x941af7,_0x1d8292){var _0x4ff68f={};var _0x515a6a={};var _0x4eb570;var _0x118363;return db['CmCompany'][_0xda4a('0x58')]({'where':{'id':_0x3da0e4[_0xda4a('0x52')]['id']}})[_0xda4a('0x21')](handleEntityNotFound(_0x941af7,null))['then'](function(_0x2cbc44){if(_0x2cbc44){_0x4eb570=_0x2cbc44;_0x515a6a[_0xda4a('0x2a')]=_[_0xda4a('0x2b')](db[_0xda4a('0x54')][_0xda4a('0x29')]);_0x515a6a[_0xda4a('0x2c')]=_[_0xda4a('0x2b')](_0x3da0e4[_0xda4a('0x2c')]);_0x515a6a[_0xda4a('0x2d')]=_[_0xda4a('0x2e')](_0x515a6a['model'],_0x515a6a[_0xda4a('0x2c')]);_0x4ff68f['attributes']=_[_0xda4a('0x2e')](_0x515a6a['model'],qs[_0xda4a('0x30')](_0x3da0e4['query'][_0xda4a('0x30')]));_0x4ff68f[_0xda4a('0x2f')]=_0x4ff68f[_0xda4a('0x2f')][_0xda4a('0x31')]?_0x4ff68f[_0xda4a('0x2f')]:_0x515a6a[_0xda4a('0x2a')];_0x4ff68f[_0xda4a('0x35')]=qs[_0xda4a('0x36')](_0x3da0e4[_0xda4a('0x2c')][_0xda4a('0x36')]);_0x4ff68f[_0xda4a('0x3a')]=qs[_0xda4a('0x2d')](_[_0xda4a('0x37')](_0x3da0e4[_0xda4a('0x2c')],_0x515a6a[_0xda4a('0x2d')]));if(_0x3da0e4[_0xda4a('0x2c')][_0xda4a('0x38')]){_0x4ff68f[_0xda4a('0x3a')]=_[_0xda4a('0x39')](_0x4ff68f[_0xda4a('0x3a')],{'$or':_[_0xda4a('0x3b')](_0x4ff68f['attributes'],function(_0x22b1ef){var _0x32d83a={};_0x32d83a[_0x22b1ef]={'$like':'%'+_0x3da0e4[_0xda4a('0x2c')]['filter']+'%'};return _0x32d83a;})});}_0x4ff68f=_[_0xda4a('0x39')]({},_0x4ff68f,_0x3da0e4[_0xda4a('0x40')]);return _0x4eb570[_0xda4a('0x57')](_0x4ff68f);}})[_0xda4a('0x21')](function(_0xf276be){if(_0xf276be){_0x118363=_0xf276be[_0xda4a('0x31')];if(!_0x3da0e4[_0xda4a('0x2c')][_0xda4a('0x32')](_0xda4a('0x33'))){_0x4ff68f['limit']=qs['limit'](_0x3da0e4[_0xda4a('0x2c')]['limit']);_0x4ff68f['offset']=qs[_0xda4a('0x1c')](_0x3da0e4[_0xda4a('0x2c')][_0xda4a('0x1c')]);}return _0x4eb570[_0xda4a('0x57')](_0x4ff68f);}})[_0xda4a('0x21')](function(_0x4b29e7){if(_0x4b29e7){return _0x4b29e7?{'count':_0x118363,'rows':_0x4b29e7}:null;}})[_0xda4a('0x21')](respondWithResult(_0x941af7,null))[_0xda4a('0x47')](handleError(_0x941af7,null));}; \ No newline at end of file +var _0x19b3=['where','pick','filter','merge','map','type','VIRTUAL','field','options','include','rows','catch','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Companies','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','CmContact','ids','omit','getContacts','findOne','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','update','then','destroy','get','error','name','send','CmCompany','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort'];(function(_0x15c6c0,_0x13207e){var _0x565db2=function(_0x6affa1){while(--_0x6affa1){_0x15c6c0['push'](_0x15c6c0['shift']());}};_0x565db2(++_0x13207e);}(_0x19b3,0x110));var _0x319b=function(_0x26474a,_0x3cfcfd){_0x26474a=_0x26474a-0x0;var _0x32e0e0=_0x19b3[_0x26474a];return _0x32e0e0;};'use strict';var pdf=require(_0x319b('0x0'));var emlformat=require(_0x319b('0x1'));var rimraf=require(_0x319b('0x2'));var zipdir=require(_0x319b('0x3'));var jsonpatch=require(_0x319b('0x4'));var rp=require(_0x319b('0x5'));var moment=require('moment');var BPromise=require(_0x319b('0x6'));var Mustache=require(_0x319b('0x7'));var util=require('util');var path=require('path');var sox=require(_0x319b('0x8'));var csv=require(_0x319b('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x319b('0xa'));var jsforce=require(_0x319b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x319b('0x9'));var querystring=require(_0x319b('0xc'));var Papa=require(_0x319b('0xd'));var Redis=require('ioredis');var authService=require(_0x319b('0xe'));var qs=require(_0x319b('0xf'));var hardwareService=require(_0x319b('0x10'));var logger=require(_0x319b('0x11'))(_0x319b('0x12'));var utils=require(_0x319b('0x13'));var config=require(_0x319b('0x14'));var db=require(_0x319b('0x15'))['db'];function respondWithStatusCode(_0x371fb3,_0x2a76ff){_0x2a76ff=_0x2a76ff||0xcc;return function(_0x4d551a){if(_0x4d551a){return _0x371fb3[_0x319b('0x16')](_0x2a76ff);}return _0x371fb3[_0x319b('0x17')](_0x2a76ff)[_0x319b('0x18')]();};}function respondWithResult(_0x1279e2,_0x3896dd){_0x3896dd=_0x3896dd||0xc8;return function(_0x48a82f){if(_0x48a82f){return _0x1279e2[_0x319b('0x17')](_0x3896dd)[_0x319b('0x19')](_0x48a82f);}};}function respondWithFilteredResult(_0x234abe,_0x465260){return function(_0x58e46f){if(_0x58e46f){var _0x4f41b4=_0x58e46f[_0x319b('0x1a')],_0x33d14a=_0x465260[_0x319b('0x1b')],_0x54d86c=_0x465260[_0x319b('0x1b')]+_0x465260[_0x319b('0x1c')],_0x1c9b3e;if(_0x54d86c>=_0x4f41b4){_0x54d86c=_0x4f41b4;_0x1c9b3e=0xc8;}else{_0x1c9b3e=0xce;}_0x234abe[_0x319b('0x17')](_0x1c9b3e);return _0x234abe['set'](_0x319b('0x1d'),_0x33d14a+'-'+_0x54d86c+'/'+_0x4f41b4)[_0x319b('0x19')](_0x58e46f);}return null;};}function patchUpdates(_0x4d39d4){return function(_0x23e14d){try{jsonpatch[_0x319b('0x1e')](_0x23e14d,_0x4d39d4,!![]);}catch(_0x1d1961){return BPromise[_0x319b('0x1f')](_0x1d1961);}return _0x23e14d['save']();};}function saveUpdates(_0x2a189d,_0x5ddfd8){return function(_0x43d1e7){if(_0x43d1e7){return _0x43d1e7[_0x319b('0x20')](_0x2a189d)[_0x319b('0x21')](function(_0x3ff692){return _0x3ff692;});}return null;};}function removeEntity(_0x14f7be,_0xce7117){return function(_0x5612f1){if(_0x5612f1){return _0x5612f1[_0x319b('0x22')]()[_0x319b('0x21')](function(){var _0x82545a=_0x5612f1[_0x319b('0x23')]({'plain':!![]});var _0x3d6690='Companies';return db['UserProfileResource'][_0x319b('0x22')]({'where':{'type':_0x3d6690,'resourceId':_0x82545a['id']}})[_0x319b('0x21')](function(){return _0x5612f1;});})[_0x319b('0x21')](function(){_0x14f7be[_0x319b('0x17')](0xcc)[_0x319b('0x18')]();});}};}function handleEntityNotFound(_0x1d3c6f,_0x165b2f){return function(_0x2257e3){if(!_0x2257e3){_0x1d3c6f['sendStatus'](0x194);}return _0x2257e3;};}function handleError(_0x3e543d,_0x2ca7e3){_0x2ca7e3=_0x2ca7e3||0x1f4;return function(_0x3b056f){logger[_0x319b('0x24')](_0x3b056f['stack']);if(_0x3b056f['name']){delete _0x3b056f[_0x319b('0x25')];}_0x3e543d[_0x319b('0x17')](_0x2ca7e3)[_0x319b('0x26')](_0x3b056f);};}exports['index']=function(_0x3d779c,_0x2dae44){var _0x3d5e86={},_0x4e88c6={},_0x2b04b3={'count':0x0,'rows':[]};var _0x4e589e=db[_0x319b('0x27')][_0x319b('0x28')];_0x4e88c6[_0x319b('0x29')]=_[_0x319b('0x2a')](_0x4e589e);_0x4e88c6[_0x319b('0x2b')]=_[_0x319b('0x2a')](_0x3d779c[_0x319b('0x2b')]);_0x4e88c6[_0x319b('0x2c')]=_[_0x319b('0x2d')](_0x4e88c6[_0x319b('0x29')],_0x4e88c6['query']);_0x3d5e86['attributes']=_[_0x319b('0x2d')](_0x4e88c6[_0x319b('0x29')],qs[_0x319b('0x2e')](_0x3d779c[_0x319b('0x2b')][_0x319b('0x2e')]));_0x3d5e86[_0x319b('0x2f')]=_0x3d5e86[_0x319b('0x2f')]['length']?_0x3d5e86[_0x319b('0x2f')]:_0x4e88c6['model'];if(!_0x3d779c[_0x319b('0x2b')][_0x319b('0x30')](_0x319b('0x31'))){_0x3d5e86[_0x319b('0x1c')]=qs['limit'](_0x3d779c[_0x319b('0x2b')]['limit']);_0x3d5e86[_0x319b('0x1b')]=qs['offset'](_0x3d779c['query']['offset']);}_0x3d5e86[_0x319b('0x32')]=qs[_0x319b('0x33')](_0x3d779c[_0x319b('0x2b')][_0x319b('0x33')]);_0x3d5e86[_0x319b('0x34')]=qs[_0x319b('0x2c')](_[_0x319b('0x35')](_0x3d779c[_0x319b('0x2b')],_0x4e88c6['filters']));if(_0x3d779c['query'][_0x319b('0x36')]){_0x3d5e86['where']=_[_0x319b('0x37')](_0x3d5e86[_0x319b('0x34')],{'$or':_[_0x319b('0x38')](_0x4e589e,function(_0x279bf8){if(_0x279bf8[_0x319b('0x39')]['key']!==_0x319b('0x3a')){var _0x277df1={};_0x277df1[_0x279bf8[_0x319b('0x3b')]]={'$like':'%'+_0x3d779c['query'][_0x319b('0x36')]+'%'};return _0x277df1;}})});}_0x3d5e86=_[_0x319b('0x37')]({},_0x3d5e86,_0x3d779c[_0x319b('0x3c')]);var _0x1896e0={'where':_0x3d5e86[_0x319b('0x34')]};return db['CmCompany']['count'](_0x1896e0)['then'](function(_0x246421){_0x2b04b3[_0x319b('0x1a')]=_0x246421;if(_0x3d779c[_0x319b('0x2b')]['includeAll']){_0x3d5e86[_0x319b('0x3d')]=[{'all':!![]}];}return db[_0x319b('0x27')]['findAll'](_0x3d5e86);})['then'](function(_0x277d36){_0x2b04b3[_0x319b('0x3e')]=_0x277d36;return _0x2b04b3;})[_0x319b('0x21')](respondWithFilteredResult(_0x2dae44,_0x3d5e86))[_0x319b('0x3f')](handleError(_0x2dae44,null));};exports['show']=function(_0x5d1e33,_0x100573){var _0x373f4c={'raw':![],'where':{'id':_0x5d1e33['params']['id']}},_0x474e52={};_0x474e52['model']=_['keys'](db[_0x319b('0x27')][_0x319b('0x28')]);_0x474e52[_0x319b('0x2b')]=_[_0x319b('0x2a')](_0x5d1e33[_0x319b('0x2b')]);_0x474e52['filters']=_[_0x319b('0x2d')](_0x474e52[_0x319b('0x29')],_0x474e52[_0x319b('0x2b')]);_0x373f4c[_0x319b('0x2f')]=_[_0x319b('0x2d')](_0x474e52[_0x319b('0x29')],qs[_0x319b('0x2e')](_0x5d1e33['query'][_0x319b('0x2e')]));_0x373f4c[_0x319b('0x2f')]=_0x373f4c[_0x319b('0x2f')][_0x319b('0x40')]?_0x373f4c['attributes']:_0x474e52['model'];if(_0x5d1e33[_0x319b('0x2b')]['includeAll']){_0x373f4c[_0x319b('0x3d')]=[{'all':!![]}];}_0x373f4c=_[_0x319b('0x37')]({},_0x373f4c,_0x5d1e33[_0x319b('0x3c')]);return db[_0x319b('0x27')][_0x319b('0x41')](_0x373f4c)[_0x319b('0x21')](handleEntityNotFound(_0x100573,null))[_0x319b('0x21')](respondWithResult(_0x100573,null))['catch'](handleError(_0x100573,null));};exports[_0x319b('0x42')]=function(_0x1b32c2,_0x5580be){return db[_0x319b('0x27')][_0x319b('0x42')](_0x1b32c2[_0x319b('0x43')],{})[_0x319b('0x21')](function(_0x507ae1){var _0x168b4a=_0x1b32c2[_0x319b('0x44')][_0x319b('0x23')]({'plain':!![]});if(!_0x168b4a)throw new Error(_0x319b('0x45'));if(_0x168b4a['role']===_0x319b('0x44')){var _0x551ec9=_0x507ae1['get']({'plain':!![]});var _0x28f152=_0x319b('0x46');return db['UserProfileSection'][_0x319b('0x41')]({'where':{'name':_0x28f152,'userProfileId':_0x168b4a[_0x319b('0x47')]},'raw':!![]})[_0x319b('0x21')](function(_0x21d0d4){if(_0x21d0d4&&_0x21d0d4[_0x319b('0x48')]===0x0){return db['UserProfileResource']['create']({'name':_0x551ec9['name'],'resourceId':_0x551ec9['id'],'type':_0x21d0d4[_0x319b('0x25')],'sectionId':_0x21d0d4['id']},{})[_0x319b('0x21')](function(){return _0x507ae1;});}else{return _0x507ae1;}})[_0x319b('0x3f')](function(_0x3580f3){logger[_0x319b('0x24')](_0x319b('0x49'),_0x3580f3);throw _0x3580f3;});}return _0x507ae1;})[_0x319b('0x21')](respondWithResult(_0x5580be,0xc9))[_0x319b('0x3f')](handleError(_0x5580be,null));};exports[_0x319b('0x20')]=function(_0x596e8e,_0x1eb466){if(_0x596e8e[_0x319b('0x43')]['id']){delete _0x596e8e['body']['id'];}return db[_0x319b('0x27')][_0x319b('0x41')]({'where':{'id':_0x596e8e['params']['id']}})[_0x319b('0x21')](handleEntityNotFound(_0x1eb466,null))[_0x319b('0x21')](saveUpdates(_0x596e8e[_0x319b('0x43')],null))[_0x319b('0x21')](respondWithResult(_0x1eb466,null))[_0x319b('0x3f')](handleError(_0x1eb466,null));};exports[_0x319b('0x22')]=function(_0x3ff49d,_0x1aa843){return db[_0x319b('0x27')][_0x319b('0x41')]({'where':{'id':_0x3ff49d[_0x319b('0x4a')]['id']}})[_0x319b('0x21')](handleEntityNotFound(_0x1aa843,null))[_0x319b('0x21')](removeEntity(_0x1aa843,null))[_0x319b('0x3f')](handleError(_0x1aa843,null));};exports[_0x319b('0x4b')]=function(_0x20a954,_0xd1ba6d,_0x4fbc6d){return db[_0x319b('0x4c')][_0x319b('0x41')]({'where':{'id':_0x20a954[_0x319b('0x4a')]['id']}})[_0x319b('0x21')](handleEntityNotFound(_0xd1ba6d,null))[_0x319b('0x21')](function(_0x553ef9){if(_0x553ef9){return _0x553ef9[_0x319b('0x4b')](_0x20a954[_0x319b('0x43')][_0x319b('0x4d')],_[_0x319b('0x4e')](_0x20a954[_0x319b('0x43')],[_0x319b('0x4d'),'id'])||{});}})[_0x319b('0x21')](respondWithResult(_0xd1ba6d,null))[_0x319b('0x3f')](handleError(_0xd1ba6d,null));};exports[_0x319b('0x4f')]=function(_0x32fca8,_0x32fb30,_0x4bffe6){var _0x4cec04={};var _0x245101={};var _0x2a9af3;var _0x4cff3c;return db[_0x319b('0x27')][_0x319b('0x50')]({'where':{'id':_0x32fca8[_0x319b('0x4a')]['id']}})[_0x319b('0x21')](handleEntityNotFound(_0x32fb30,null))[_0x319b('0x21')](function(_0x518d43){if(_0x518d43){_0x2a9af3=_0x518d43;_0x245101['model']=_[_0x319b('0x2a')](db[_0x319b('0x4c')][_0x319b('0x28')]);_0x245101[_0x319b('0x2b')]=_[_0x319b('0x2a')](_0x32fca8['query']);_0x245101[_0x319b('0x2c')]=_[_0x319b('0x2d')](_0x245101['model'],_0x245101[_0x319b('0x2b')]);_0x4cec04[_0x319b('0x2f')]=_['intersection'](_0x245101[_0x319b('0x29')],qs[_0x319b('0x2e')](_0x32fca8[_0x319b('0x2b')][_0x319b('0x2e')]));_0x4cec04[_0x319b('0x2f')]=_0x4cec04[_0x319b('0x2f')][_0x319b('0x40')]?_0x4cec04[_0x319b('0x2f')]:_0x245101[_0x319b('0x29')];_0x4cec04[_0x319b('0x32')]=qs['sort'](_0x32fca8[_0x319b('0x2b')]['sort']);_0x4cec04[_0x319b('0x34')]=qs[_0x319b('0x2c')](_['pick'](_0x32fca8[_0x319b('0x2b')],_0x245101['filters']));if(_0x32fca8['query']['filter']){_0x4cec04[_0x319b('0x34')]=_[_0x319b('0x37')](_0x4cec04[_0x319b('0x34')],{'$or':_['map'](_0x4cec04[_0x319b('0x2f')],function(_0xc8fd25){var _0x186df4={};_0x186df4[_0xc8fd25]={'$like':'%'+_0x32fca8[_0x319b('0x2b')][_0x319b('0x36')]+'%'};return _0x186df4;})});}_0x4cec04=_[_0x319b('0x37')]({},_0x4cec04,_0x32fca8['options']);return _0x2a9af3['getContacts'](_0x4cec04);}})[_0x319b('0x21')](function(_0x172cec){if(_0x172cec){_0x4cff3c=_0x172cec['length'];if(!_0x32fca8[_0x319b('0x2b')][_0x319b('0x30')](_0x319b('0x31'))){_0x4cec04['limit']=qs[_0x319b('0x1c')](_0x32fca8[_0x319b('0x2b')]['limit']);_0x4cec04[_0x319b('0x1b')]=qs['offset'](_0x32fca8['query'][_0x319b('0x1b')]);}return _0x2a9af3[_0x319b('0x4f')](_0x4cec04);}})['then'](function(_0x44bf9f){if(_0x44bf9f){return _0x44bf9f?{'count':_0x4cff3c,'rows':_0x44bf9f}:null;}})[_0x319b('0x21')](respondWithResult(_0x32fb30,null))[_0x319b('0x3f')](handleError(_0x32fb30,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 5ff0765..23b681c 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 _0x955f=['cm_companies','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','exports','CmCompany'];(function(_0x5eb06a,_0x41c718){var _0x3ce723=function(_0x953699){while(--_0x953699){_0x5eb06a['push'](_0x5eb06a['shift']());}};_0x3ce723(++_0x41c718);}(_0x955f,0x1eb));var _0xf955=function(_0x53b0d7,_0x506841){_0x53b0d7=_0x53b0d7-0x0;var _0x3bc874=_0x955f[_0x53b0d7];return _0x3bc874;};'use strict';var _=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var logger=require(_0xf955('0x2'))(_0xf955('0x3'));var moment=require(_0xf955('0x4'));var BPromise=require('bluebird');var rp=require(_0xf955('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf955('0x6'));var attributes=require('./cmCompany.attributes');module[_0xf955('0x7')]=function(_0x2caff2,_0x3fdac2){return _0x2caff2['define'](_0xf955('0x8'),attributes,{'tableName':_0xf955('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0424=['./cmCompany.attributes','exports','define','CmCompany','cm_companies','../../config/logger','api','moment','bluebird','path'];(function(_0x38decc,_0x1035fc){var _0x474d06=function(_0x57796f){while(--_0x57796f){_0x38decc['push'](_0x38decc['shift']());}};_0x474d06(++_0x1035fc);}(_0x0424,0x159));var _0x4042=function(_0x241eb9,_0x5ccc3f){_0x241eb9=_0x241eb9-0x0;var _0x4f916b=_0x0424[_0x241eb9];return _0x4f916b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4042('0x0'))(_0x4042('0x1'));var moment=require(_0x4042('0x2'));var BPromise=require(_0x4042('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4042('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4042('0x5'));module[_0x4042('0x6')]=function(_0x472795,_0xc0fba0){return _0x472795[_0x4042('0x7')](_0x4042('0x8'),attributes,{'tableName':_0x4042('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 326baba..68e58ac 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 _0x7ec2=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message','result'];(function(_0x104d23,_0x39fb6c){var _0x1988c5=function(_0x1c839f){while(--_0x1c839f){_0x104d23['push'](_0x104d23['shift']());}};_0x1988c5(++_0x39fb6c);}(_0x7ec2,0x1cf));var _0x27ec=function(_0x53dd1e,_0x309848){_0x53dd1e=_0x53dd1e-0x0;var _0xbf68dd=_0x7ec2[_0x53dd1e];return _0xbf68dd;};'use strict';var _=require(_0x27ec('0x0'));var util=require('util');var moment=require(_0x27ec('0x1'));var BPromise=require(_0x27ec('0x2'));var rs=require(_0x27ec('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x27ec('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x27ec('0x5'));var config=require(_0x27ec('0x6'));var jayson=require(_0x27ec('0x7'));var client=jayson[_0x27ec('0x8')][_0x27ec('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x158df7,_0x18f730,_0x3aa6a8){return new BPromise(function(_0x4cfc20,_0x28ad04){return client['request'](_0x158df7,_0x3aa6a8)[_0x27ec('0xa')](function(_0x3e70cf){logger[_0x27ec('0xb')]('CmCompany,\x20%s,\x20%s',_0x18f730,_0x27ec('0xc'));logger[_0x27ec('0xd')](_0x27ec('0xe'),_0x18f730,_0x27ec('0xc'),JSON[_0x27ec('0xf')](_0x3e70cf));if(_0x3e70cf[_0x27ec('0x10')]){if(_0x3e70cf[_0x27ec('0x10')][_0x27ec('0x11')]===0x1f4){logger[_0x27ec('0x10')](_0x27ec('0x12'),_0x18f730,_0x3e70cf[_0x27ec('0x10')]['message']);return _0x28ad04(_0x3e70cf[_0x27ec('0x10')][_0x27ec('0x13')]);}logger[_0x27ec('0x10')](_0x27ec('0x12'),_0x18f730,_0x3e70cf[_0x27ec('0x10')][_0x27ec('0x13')]);return _0x4cfc20(_0x3e70cf[_0x27ec('0x10')][_0x27ec('0x13')]);}else{logger['info'](_0x27ec('0x12'),_0x18f730,_0x27ec('0xc'));_0x4cfc20(_0x3e70cf[_0x27ec('0x14')]['message']);}})[_0x27ec('0x15')](function(_0x168d02){logger['error'](_0x27ec('0x12'),_0x18f730,_0x168d02);_0x28ad04(_0x168d02);});});} \ No newline at end of file +var _0x78b4=['catch','lodash','util','moment','bluebird','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x574474,_0x1e8cd){var _0x23bbbc=function(_0xdde67b){while(--_0xdde67b){_0x574474['push'](_0x574474['shift']());}};_0x23bbbc(++_0x1e8cd);}(_0x78b4,0xd3));var _0x478b=function(_0x36d183,_0x150195){_0x36d183=_0x36d183-0x0;var _0x2840e4=_0x78b4[_0x36d183];return _0x2840e4;};'use strict';var _=require(_0x478b('0x0'));var util=require(_0x478b('0x1'));var moment=require(_0x478b('0x2'));var BPromise=require(_0x478b('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(_0x478b('0x4'))(_0x478b('0x5'));var config=require(_0x478b('0x6'));var jayson=require(_0x478b('0x7'));var client=jayson[_0x478b('0x8')][_0x478b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x453269,_0x2a0443,_0x5c8d70){return new BPromise(function(_0x42c017,_0x2341ad){return client['request'](_0x453269,_0x5c8d70)[_0x478b('0xa')](function(_0x3c8130){logger[_0x478b('0xb')](_0x478b('0xc'),_0x2a0443,_0x478b('0xd'));logger[_0x478b('0xe')](_0x478b('0xf'),_0x2a0443,_0x478b('0xd'),JSON['stringify'](_0x3c8130));if(_0x3c8130['error']){if(_0x3c8130[_0x478b('0x10')][_0x478b('0x11')]===0x1f4){logger[_0x478b('0x10')](_0x478b('0xc'),_0x2a0443,_0x3c8130['error'][_0x478b('0x12')]);return _0x2341ad(_0x3c8130['error'][_0x478b('0x12')]);}logger[_0x478b('0x10')](_0x478b('0xc'),_0x2a0443,_0x3c8130[_0x478b('0x10')]['message']);return _0x42c017(_0x3c8130[_0x478b('0x10')]['message']);}else{logger[_0x478b('0xb')](_0x478b('0xc'),_0x2a0443,_0x478b('0xd'));_0x42c017(_0x3c8130[_0x478b('0x13')]['message']);}})[_0x478b('0x14')](function(_0x1cd8fa){logger['error'](_0x478b('0xc'),_0x2a0443,_0x1cd8fa);_0x2341ad(_0x1cd8fa);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 64a295e..43034b2 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 _0x4a39=['create','/:id/contacts','addContacts','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','show','getContacts','post'];(function(_0x5e2783,_0x392b5f){var _0x1693bf=function(_0x58e495){while(--_0x58e495){_0x5e2783['push'](_0x5e2783['shift']());}};_0x1693bf(++_0x392b5f);}(_0x4a39,0x1d5));var _0x94a3=function(_0x4212ef,_0x4f4e9b){_0x4212ef=_0x4212ef-0x0;var _0x18bad3=_0x4a39[_0x4212ef];return _0x18bad3;};'use strict';var multer=require(_0x94a3('0x0'));var util=require(_0x94a3('0x1'));var path=require(_0x94a3('0x2'));var timeout=require('connect-timeout');var express=require(_0x94a3('0x3'));var router=express[_0x94a3('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x94a3('0x5'));var config=require(_0x94a3('0x6'));var controller=require(_0x94a3('0x7'));router[_0x94a3('0x8')]('/',auth[_0x94a3('0x9')](),controller[_0x94a3('0xa')]);router[_0x94a3('0x8')]('/:id',auth[_0x94a3('0x9')](),controller[_0x94a3('0xb')]);router[_0x94a3('0x8')]('/:id/contacts',auth[_0x94a3('0x9')](),controller[_0x94a3('0xc')]);router[_0x94a3('0xd')]('/',auth[_0x94a3('0x9')](),controller[_0x94a3('0xe')]);router[_0x94a3('0xd')](_0x94a3('0xf'),auth[_0x94a3('0x9')](),controller[_0x94a3('0x10')]);router[_0x94a3('0x11')](_0x94a3('0x12'),auth['isAuthenticated'](),controller[_0x94a3('0x13')]);router[_0x94a3('0x14')](_0x94a3('0x12'),auth[_0x94a3('0x9')](),controller[_0x94a3('0x15')]);module[_0x94a3('0x16')]=router; \ No newline at end of file +var _0x5a7d=['update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/:id','show','getContacts','post','create','/:id/contacts','addContacts'];(function(_0x1e5723,_0x21f781){var _0x5c724b=function(_0xb3a586){while(--_0xb3a586){_0x1e5723['push'](_0x1e5723['shift']());}};_0x5c724b(++_0x21f781);}(_0x5a7d,0x9e));var _0xd5a7=function(_0xc6379f,_0x5d0315){_0xc6379f=_0xc6379f-0x0;var _0x437fe8=_0x5a7d[_0xc6379f];return _0x437fe8;};'use strict';var multer=require(_0xd5a7('0x0'));var util=require(_0xd5a7('0x1'));var path=require(_0xd5a7('0x2'));var timeout=require('connect-timeout');var express=require(_0xd5a7('0x3'));var router=express[_0xd5a7('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xd5a7('0x5'));var config=require(_0xd5a7('0x6'));var controller=require(_0xd5a7('0x7'));router[_0xd5a7('0x8')]('/',auth[_0xd5a7('0x9')](),controller[_0xd5a7('0xa')]);router[_0xd5a7('0x8')](_0xd5a7('0xb'),auth[_0xd5a7('0x9')](),controller[_0xd5a7('0xc')]);router[_0xd5a7('0x8')]('/:id/contacts',auth[_0xd5a7('0x9')](),controller[_0xd5a7('0xd')]);router[_0xd5a7('0xe')]('/',auth['isAuthenticated'](),controller[_0xd5a7('0xf')]);router[_0xd5a7('0xe')](_0xd5a7('0x10'),auth['isAuthenticated'](),controller[_0xd5a7('0x11')]);router['put'](_0xd5a7('0xb'),auth[_0xd5a7('0x9')](),controller[_0xd5a7('0x12')]);router[_0xd5a7('0x13')](_0xd5a7('0xb'),auth[_0xd5a7('0x9')](),controller[_0xd5a7('0x14')]);module[_0xd5a7('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index fd66785..f210090 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 _0x4d92=['INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize','exports','STRING','TEXT'];(function(_0x4abb61,_0x5cec51){var _0xe167c9=function(_0x4cf8c6){while(--_0x4cf8c6){_0x4abb61['push'](_0x4abb61['shift']());}};_0xe167c9(++_0x5cec51);}(_0x4d92,0x1ab));var _0x24d9=function(_0x357f0a,_0x37aa60){_0x357f0a=_0x357f0a-0x0;var _0x10d41b=_0x4d92[_0x357f0a];return _0x10d41b;};'use strict';var _=require(_0x24d9('0x0'));var Sequelize=require(_0x24d9('0x1'));module[_0x24d9('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x24d9('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x24d9('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x24d9('0x3')]},'description':{'type':Sequelize[_0x24d9('0x4')]},'phone':{'type':Sequelize[_0x24d9('0x3')]},'mobile':{'type':Sequelize[_0x24d9('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x24d9('0x3')]},'skype':{'type':Sequelize[_0x24d9('0x3')]},'teams':{'type':Sequelize[_0x24d9('0x3')]},'viber':{'type':Sequelize[_0x24d9('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x24d9('0x3')]},'telegram':{'type':Sequelize[_0x24d9('0x3')]},'UserId':{'type':Sequelize[_0x24d9('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x24d9('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x24d9('0x7')],'defaultValue':Sequelize[_0x24d9('0x8')]}}; \ No newline at end of file +var _0x0b28=['STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash','exports'];(function(_0x26bacf,_0x31f313){var _0x43393c=function(_0xcb22dd){while(--_0xcb22dd){_0x26bacf['push'](_0x26bacf['shift']());}};_0x43393c(++_0x31f313);}(_0x0b28,0x166));var _0x80b2=function(_0x1073ad,_0x44bf0b){_0x1073ad=_0x1073ad-0x0;var _0x528474=_0x0b28[_0x1073ad];return _0x528474;};'use strict';var _=require(_0x80b2('0x0'));var Sequelize=require('sequelize');module[_0x80b2('0x1')]={'firstName':{'type':Sequelize[_0x80b2('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x80b2('0x2')]},'street':{'type':Sequelize[_0x80b2('0x2')]},'postalCode':{'type':Sequelize[_0x80b2('0x2')]},'city':{'type':Sequelize[_0x80b2('0x2')]},'country':{'type':Sequelize[_0x80b2('0x2')]},'dateOfBirth':{'type':Sequelize[_0x80b2('0x2')]},'description':{'type':Sequelize[_0x80b2('0x3')]},'phone':{'type':Sequelize[_0x80b2('0x2')]},'mobile':{'type':Sequelize[_0x80b2('0x2')]},'fax':{'type':Sequelize[_0x80b2('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x80b2('0x2')]},'fb_data':{'type':Sequelize[_0x80b2('0x2')]},'twitter':{'type':Sequelize[_0x80b2('0x2')]},'skype':{'type':Sequelize[_0x80b2('0x2')]},'teams':{'type':Sequelize[_0x80b2('0x2')]},'viber':{'type':Sequelize[_0x80b2('0x2')]},'line':{'type':Sequelize[_0x80b2('0x2')]},'wechat':{'type':Sequelize[_0x80b2('0x2')]},'telegram':{'type':Sequelize[_0x80b2('0x2')]},'UserId':{'type':Sequelize[_0x80b2('0x4')]},'priority':{'type':Sequelize[_0x80b2('0x4')](0x2)[_0x80b2('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x80b2('0x6')],'defaultValue':Sequelize[_0x80b2('0x7')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index a970497..5aa5cfd 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 _0x1740=['No\x20association\x20values\x20specified!','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','0777','child_process','fork','../../components/import/cm/csv','File\x20uploaded\x20correctly!','pid','send','upload','createReadStream','path','meta','import','agent','binding','socket_timestamp','stringify','start\x20child\x20process\x20correctly!','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','localhost','./cmContact.socket','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','CmContact','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','field','from','select','cm_contacts','c.deletedAt\x20IS\x20NULL','advancedFilter','parse','forEach','condition','isArray','value','and','tableAlias','\x20IN\x20?','\x20=\x20?','\x20LIKE\x20?','\x20>\x20?','\x20<\x20?','map','filter','isNil','isEmpty','ListId','c.ListId\x20IN\x20?','replace','\x27\x27\x27\x27','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.id','Sequelize','QueryTypes','SELECT','clone','COUNT(*)','tag','expr','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','having','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20IN\x20?','toString','sequelize','merge','c.*','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','tools_tags','t.id\x20=\x20ct.TagId','split','Tags','push','rows','catch','find','params','describe','startsWith','columnName','displayName','findAll','cf_','alias','values','Error\x20customFields:\x20filed\x20%s\x20not\x20present\x20in\x20table\x20cm_contact','body','get','tags','join','info','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatMessage','update','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','VoiceCallReport','FaxQueueReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','each','duplicates','spread','show','Tag','color','$and','format','cf_%d','CmCustomField','omit','pickBy','table','setFields','toParam','text','phone','findOne','getTags','nolimit','setTags','options','includeAll','include','getHopperHistories','CmHopperHistory','rawAttributes','ContactId','getJscriptySessions','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x1740,0x1c6));var _0x0174=function(_0x401134,_0x35d034){_0x401134=_0x401134-0x0;var _0x519255=_0x1740[_0x401134];return _0x519255;};'use strict';var pdf=require(_0x0174('0x0'));var emlformat=require(_0x0174('0x1'));var rimraf=require(_0x0174('0x2'));var zipdir=require(_0x0174('0x3'));var jsonpatch=require(_0x0174('0x4'));var rp=require(_0x0174('0x5'));var moment=require('moment');var BPromise=require(_0x0174('0x6'));var Mustache=require(_0x0174('0x7'));var util=require('util');var path=require('path');var sox=require(_0x0174('0x8'));var csv=require(_0x0174('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0174('0xa'));var squel=require(_0x0174('0xb'));var crypto=require('crypto');var jsforce=require(_0x0174('0xc'));var deskjs=require(_0x0174('0xd'));var toCsv=require(_0x0174('0x9'));var querystring=require(_0x0174('0xe'));var Papa=require('papaparse');var Redis=require(_0x0174('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x0174('0x10'));var hardwareService=require(_0x0174('0x11'));var logger=require(_0x0174('0x12'))(_0x0174('0x13'));var utils=require(_0x0174('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x0174('0x15')]=_[_0x0174('0x16')](config[_0x0174('0x15')],{'host':_0x0174('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0174('0x18'))[_0x0174('0x19')](socket);function respondWithStatusCode(_0x179842,_0x10dcc8){_0x10dcc8=_0x10dcc8||0xcc;return function(_0x5951a7){if(_0x5951a7){return _0x179842[_0x0174('0x1a')](_0x10dcc8);}return _0x179842['status'](_0x10dcc8)[_0x0174('0x1b')]();};}function respondWithResult(_0x261b0e,_0xf08fce){_0xf08fce=_0xf08fce||0xc8;return function(_0x59f22a){if(_0x59f22a){return _0x261b0e[_0x0174('0x1c')](_0xf08fce)[_0x0174('0x1d')](_0x59f22a);}};}function respondWithFilteredResult(_0x2f1c34,_0x3618ba){return function(_0x8130e){if(_0x8130e){var _0x495cd3=_0x8130e[_0x0174('0x1e')],_0x12ef40=_0x3618ba[_0x0174('0x1f')],_0x34674d=_0x3618ba[_0x0174('0x1f')]+_0x3618ba[_0x0174('0x20')],_0x44927d;if(_0x34674d>=_0x495cd3){_0x34674d=_0x495cd3;_0x44927d=0xc8;}else{_0x44927d=0xce;}_0x2f1c34['status'](_0x44927d);return _0x2f1c34[_0x0174('0x21')](_0x0174('0x22'),_0x12ef40+'-'+_0x34674d+'/'+_0x495cd3)[_0x0174('0x1d')](_0x8130e);}return null;};}function patchUpdates(_0x39098b){return function(_0x183136){try{jsonpatch[_0x0174('0x23')](_0x183136,_0x39098b,!![]);}catch(_0x57d296){return BPromise[_0x0174('0x24')](_0x57d296);}return _0x183136[_0x0174('0x25')]();};}function saveUpdates(_0xe64fef,_0x36aec5){return function(_0xc5bab9){if(_0xc5bab9){return _0xc5bab9['update'](_0xe64fef)[_0x0174('0x26')](function(_0x563afe){return _0x563afe;});}return null;};}function removeEntity(_0x23022b,_0x33a187){return function(_0x207622){if(_0x207622){return _0x207622[_0x0174('0x27')]()[_0x0174('0x26')](function(){_0x23022b[_0x0174('0x1c')](0xcc)[_0x0174('0x1b')]();});}};}function handleEntityNotFound(_0x3866fd,_0x196c70){return function(_0x3282f4){if(!_0x3282f4){_0x3866fd[_0x0174('0x1a')](0x194);}return _0x3282f4;};}function handleError(_0x29ab29,_0x36c13c){_0x36c13c=_0x36c13c||0x1f4;return function(_0x4aa08e){logger[_0x0174('0x28')](_0x4aa08e[_0x0174('0x29')]);if(_0x4aa08e['name']){delete _0x4aa08e[_0x0174('0x2a')];}_0x29ab29[_0x0174('0x1c')](_0x36c13c)['send'](_0x4aa08e);};}exports['index']=function(_0x3f20b7,_0x10c22a){var _0x33675f={},_0x5094e7={},_0x56968e={'count':0x0,'rows':[]};return db[_0x0174('0x2b')]['describe']()[_0x0174('0x26')](function(_0x4a9501){_0x5094e7['model']=_[_0x0174('0x2c')](_0x4a9501);_0x5094e7['query']=_[_0x0174('0x2c')](_0x3f20b7[_0x0174('0x2d')]);_0x5094e7['filters']=_[_0x0174('0x2e')](_0x5094e7[_0x0174('0x2f')],_0x5094e7['query']);_0x33675f[_0x0174('0x30')]=_[_0x0174('0x2e')](_0x5094e7[_0x0174('0x2f')],qs['fields'](_0x3f20b7[_0x0174('0x2d')][_0x0174('0x31')]));_0x33675f[_0x0174('0x30')]=_0x33675f['attributes'][_0x0174('0x32')]?_0x33675f['attributes']:_0x5094e7[_0x0174('0x2f')];if(!_0x3f20b7[_0x0174('0x2d')][_0x0174('0x33')]('nolimit')){_0x33675f[_0x0174('0x20')]=qs[_0x0174('0x20')](_0x3f20b7['query'][_0x0174('0x20')]);_0x33675f[_0x0174('0x1f')]=qs[_0x0174('0x1f')](_0x3f20b7['query'][_0x0174('0x1f')]);}_0x33675f[_0x0174('0x34')]=qs[_0x0174('0x35')](_0x3f20b7[_0x0174('0x2d')][_0x0174('0x35')]);_0x33675f[_0x0174('0x36')]=qs[_0x0174('0x37')](_[_0x0174('0x38')](_0x3f20b7[_0x0174('0x2d')],_0x5094e7[_0x0174('0x37')]));var _0x299de0=[];var _0x18c4c9=squel['select']()[_0x0174('0x39')]('id')[_0x0174('0x39')](_0x0174('0x2a'))[_0x0174('0x39')]('color')[_0x0174('0x3a')]('tools_tags');var _0xc0fe04=squel[_0x0174('0x3b')]()[_0x0174('0x3a')](_0x0174('0x3c'),'c')[_0x0174('0x36')](_0x0174('0x3d'));var _0x2d7c58=squel['expr']();if(_0x3f20b7['query'][_0x0174('0x3e')]){var _0x576d19=JSON[_0x0174('0x3f')](_0x3f20b7[_0x0174('0x2d')][_0x0174('0x3e')]);_['keys'](_0x576d19)[_0x0174('0x40')](function(_0x533b66){var _0x1c246b=_0x576d19[_0x533b66];switch(_0x1c246b[_0x0174('0x41')]){case'IS':if(_[_0x0174('0x42')](_0x1c246b['value'])&&_0x1c246b[_0x0174('0x43')][_0x0174('0x32')]>0x1){_0x2d7c58[_0x0174('0x44')](_0x1c246b[_0x0174('0x45')]+'.'+_0x533b66+_0x0174('0x46'),_0x1c246b[_0x0174('0x43')]);}else{_0x2d7c58['and'](_0x1c246b[_0x0174('0x45')]+'.'+_0x533b66+'\x20=\x20?',_0x1c246b[_0x0174('0x43')][0x0]);}break;case'=':_0x2d7c58['and'](_0x1c246b['tableAlias']+'.'+_0x533b66+_0x0174('0x47'),_0x1c246b[_0x0174('0x43')]);break;case'LIKE':_0x2d7c58[_0x0174('0x44')](_0x1c246b[_0x0174('0x45')]+'.'+_0x533b66+_0x0174('0x48'),'%'+_0x1c246b[_0x0174('0x43')]+'%');break;case'>':_0x2d7c58[_0x0174('0x44')](_0x1c246b['tableAlias']+'.'+_0x533b66+_0x0174('0x49'),_0x1c246b[_0x0174('0x43')]);break;case'<':_0x2d7c58[_0x0174('0x44')](_0x1c246b[_0x0174('0x45')]+'.'+_0x533b66+_0x0174('0x4a'),_0x1c246b['value']);break;}});}else{var _0x25ef42=_(Object['keys'](_0x3f20b7[_0x0174('0x2d')]))[_0x0174('0x4b')](function(_0x4999ff){return _0x4a9501['hasOwnProperty'](_0x4999ff)?_0x4999ff:undefined;})[_0x0174('0x4c')](function(_0x11105f){return!_[_0x0174('0x4d')](_0x11105f);})[_0x0174('0x43')]();if(!_[_0x0174('0x4e')](_0x25ef42)){_0x25ef42[_0x0174('0x40')](function(_0x954cf4){if(_0x954cf4===_0x0174('0x4f')){_0xc0fe04[_0x0174('0x36')](_0x0174('0x50'),[]['concat'](_0x3f20b7[_0x0174('0x2d')][_0x954cf4]));}else{_0xc0fe04[_0x0174('0x36')]('c.'+_0x954cf4+_0x0174('0x47'),_0x3f20b7[_0x0174('0x2d')][_0x954cf4]);}});}if(_0x3f20b7[_0x0174('0x2d')]['filter']){var _0x3f64a4=_0x3f20b7[_0x0174('0x2d')]['filter'][_0x0174('0x51')]('\x5c','\x5c\x5c')[_0x0174('0x51')]('\x27\x27',_0x0174('0x52'));if(qs['isNumeric'](_0x3f64a4)){_0x2d7c58['or'](_0x0174('0x53'),_0x3f64a4+'%');_0x2d7c58['or'](_0x0174('0x54'),_0x3f64a4+'%');_0x2d7c58['or'](_0x0174('0x55'),_0x3f64a4+'%');_0x2d7c58['or']('c.fax\x20LIKE\x20?',_0x3f64a4+'%');}else if(qs[_0x0174('0x56')](_0x3f64a4)){_0x2d7c58['or'](_0x0174('0x57'),_0x3f64a4+'%');}else{_0x2d7c58['or']('c.email\x20LIKE\x20?',_0x3f64a4+'%');_0x2d7c58['or'](_0x0174('0x58'),_0x3f64a4+'%');_0x2d7c58['or'](_0x0174('0x59'),_0x3f64a4+'%');}}}_0xc0fe04[_0x0174('0x36')](_0x2d7c58);if(_0x33675f['order']){_0x33675f[_0x0174('0x34')][_0x0174('0x40')](function(_0x165e89){_0xc0fe04[_0x0174('0x34')]('c.'+_0x165e89[0x0],_0x165e89[0x1]==='DESC'?![]:!![]);});}_0xc0fe04['group'](_0x0174('0x5a'));var _0x36a189={'type':db[_0x0174('0x5b')][_0x0174('0x5c')][_0x0174('0x5d')],'raw':!![]};var _0x3e6249=_0xc0fe04[_0x0174('0x5e')]()[_0x0174('0x39')](_0x0174('0x5f'));if(!_0x3f20b7[_0x0174('0x2d')][_0x0174('0x3e')]){if(_0x3f20b7[_0x0174('0x2d')]['tag']){var _0x20aa70=_[_0x0174('0x42')](_0x3f20b7[_0x0174('0x2d')]['tag'])?_0x3f20b7['query'][_0x0174('0x60')]:new Array(_0x3f20b7[_0x0174('0x2d')]['tag']);var _0x3007ba=squel[_0x0174('0x61')]();_0x20aa70['forEach'](function(_0x1302e8){_0x3007ba['or'](_0x0174('0x62'),'%,'+_0x1302e8+',%');});_0xc0fe04[_0x0174('0x63')](_0x3007ba);_0x3e6249[_0x0174('0x64')](_0x0174('0x65'),'ct',_0x0174('0x66'));_0x3e6249[_0x0174('0x64')]('tools_tags','t','t.id\x20=\x20ct.TagId');_0x3e6249[_0x0174('0x36')](_0x0174('0x67'),_0x20aa70);}}db['sequelize'][_0x0174('0x2d')](_0x18c4c9[_0x0174('0x68')](),_0x36a189)['then'](function(_0xfe5e16){_0x299de0=_['keyBy'](_0xfe5e16,'id');return db[_0x0174('0x69')]['query'](_0x3e6249['toString'](),_0x36a189);})[_0x0174('0x26')](function(_0x35157d){_0x56968e[_0x0174('0x1e')]=_0x35157d[_0x0174('0x32')];_0x36a189=_[_0x0174('0x6a')](_0x36a189,{'model':db[_0x0174('0x2b')],'mapToModel':!![],'raw':!![],'nest':!![]});_0xc0fe04[_0x0174('0x39')](_0x0174('0x6b'));_0xc0fe04[_0x0174('0x39')](_0x0174('0x6c'),_0x0174('0x6d'));_0xc0fe04['left_join']('cm_contact_has_tags','ct',_0x0174('0x66'));_0xc0fe04[_0x0174('0x64')](_0x0174('0x6e'),'t',_0x0174('0x6f'));if(_0x33675f[_0x0174('0x20')]){_0xc0fe04[_0x0174('0x20')](_0x33675f[_0x0174('0x20')]);}if(_0x33675f[_0x0174('0x1f')]){_0xc0fe04[_0x0174('0x1f')](_0x33675f[_0x0174('0x1f')]);}db[_0x0174('0x69')][_0x0174('0x2d')](_0xc0fe04['toString'](),_0x36a189)[_0x0174('0x26')](function(_0x157eb1){_0x157eb1[_0x0174('0x40')](function(_0x380078){if(_0x380078['TagIds']){_0x380078['Tags']=[];_0x380078['TagIds'][_0x0174('0x70')](',')['forEach'](function(_0x2d1fab){_0x380078[_0x0174('0x71')][_0x0174('0x72')](_0x299de0[_0x2d1fab]);});}delete _0x380078['TagIds'];});_0x56968e[_0x0174('0x73')]=_0x157eb1;return _0x56968e;})[_0x0174('0x26')](respondWithFilteredResult(_0x10c22a,_0x33675f))[_0x0174('0x74')](handleError(_0x10c22a,null));});});};exports['destroy']=function(_0x148555,_0x44cbb0){return db[_0x0174('0x2b')][_0x0174('0x75')]({'where':{'id':_0x148555[_0x0174('0x76')]['id']}})[_0x0174('0x26')](handleEntityNotFound(_0x44cbb0,null))[_0x0174('0x26')](removeEntity(_0x44cbb0,null))[_0x0174('0x74')](handleError(_0x44cbb0,null));};exports[_0x0174('0x77')]=function(_0x524f7e,_0x3b4060){return db[_0x0174('0x2b')][_0x0174('0x77')]()[_0x0174('0x26')](function(_0x358b61){for(var _0x14df88=0x0;_0x14df88=_0x242cf0){_0x36276a=_0x242cf0;_0x26adc8=0xc8;}else{_0x26adc8=0xce;}_0x2f3ee7['status'](_0x26adc8);return _0x2f3ee7[_0xf8ca('0x20')](_0xf8ca('0x21'),_0x5617f9+'-'+_0x36276a+'/'+_0x242cf0)[_0xf8ca('0x1d')](_0x49bbc3);}return null;};}function patchUpdates(_0x5a1514){return function(_0x84d870){try{jsonpatch[_0xf8ca('0x22')](_0x84d870,_0x5a1514,!![]);}catch(_0x6ba561){return BPromise[_0xf8ca('0x23')](_0x6ba561);}return _0x84d870[_0xf8ca('0x24')]();};}function saveUpdates(_0x23de15,_0x3cda80){return function(_0xf56094){if(_0xf56094){return _0xf56094[_0xf8ca('0x25')](_0x23de15)[_0xf8ca('0x26')](function(_0xe83772){return _0xe83772;});}return null;};}function removeEntity(_0x303ecd,_0x148f1d){return function(_0x3dfa68){if(_0x3dfa68){return _0x3dfa68[_0xf8ca('0x27')]()[_0xf8ca('0x26')](function(){_0x303ecd[_0xf8ca('0x1b')](0xcc)[_0xf8ca('0x1c')]();});}};}function handleEntityNotFound(_0x50f5b0,_0x1296f8){return function(_0x1b1d68){if(!_0x1b1d68){_0x50f5b0[_0xf8ca('0x28')](0x194);}return _0x1b1d68;};}function handleError(_0x4a7101,_0x243bfc){_0x243bfc=_0x243bfc||0x1f4;return function(_0x4eae1c){logger[_0xf8ca('0x29')](_0x4eae1c[_0xf8ca('0x2a')]);if(_0x4eae1c[_0xf8ca('0x2b')]){delete _0x4eae1c[_0xf8ca('0x2b')];}_0x4a7101['status'](_0x243bfc)[_0xf8ca('0x2c')](_0x4eae1c);};}exports[_0xf8ca('0x2d')]=function(_0x26fe0a,_0x36760){var _0x32a62a={},_0x462f13={},_0x1d2a0a={'count':0x0,'rows':[]};return db[_0xf8ca('0x2e')]['describe']()[_0xf8ca('0x26')](function(_0x461248){_0x462f13[_0xf8ca('0x2f')]=_[_0xf8ca('0x30')](_0x461248);_0x462f13[_0xf8ca('0x31')]=_['keys'](_0x26fe0a['query']);_0x462f13['filters']=_[_0xf8ca('0x32')](_0x462f13[_0xf8ca('0x2f')],_0x462f13[_0xf8ca('0x31')]);_0x32a62a[_0xf8ca('0x33')]=_['intersection'](_0x462f13[_0xf8ca('0x2f')],qs[_0xf8ca('0x34')](_0x26fe0a[_0xf8ca('0x31')]['fields']));_0x32a62a[_0xf8ca('0x33')]=_0x32a62a[_0xf8ca('0x33')][_0xf8ca('0x35')]?_0x32a62a[_0xf8ca('0x33')]:_0x462f13[_0xf8ca('0x2f')];if(!_0x26fe0a['query'][_0xf8ca('0x36')]('nolimit')){_0x32a62a[_0xf8ca('0x1f')]=qs[_0xf8ca('0x1f')](_0x26fe0a['query']['limit']);_0x32a62a[_0xf8ca('0x1e')]=qs[_0xf8ca('0x1e')](_0x26fe0a['query'][_0xf8ca('0x1e')]);}_0x32a62a[_0xf8ca('0x37')]=qs['sort'](_0x26fe0a[_0xf8ca('0x31')][_0xf8ca('0x38')]);_0x32a62a['where']=qs[_0xf8ca('0x39')](_[_0xf8ca('0x3a')](_0x26fe0a['query'],_0x462f13[_0xf8ca('0x39')]));var _0x2a84d2=[];var _0x19e474=squel[_0xf8ca('0x3b')]()[_0xf8ca('0x3c')]('id')[_0xf8ca('0x3c')](_0xf8ca('0x2b'))['field']('color')[_0xf8ca('0x3d')](_0xf8ca('0x3e'));var _0x31062c=squel[_0xf8ca('0x3b')]()[_0xf8ca('0x3d')](_0xf8ca('0x3f'),'c')[_0xf8ca('0x40')](_0xf8ca('0x41'));var _0x28cb50=squel[_0xf8ca('0x42')]();if(_0x26fe0a[_0xf8ca('0x31')]['advancedFilter']){var _0x486531=JSON['parse'](_0x26fe0a[_0xf8ca('0x31')][_0xf8ca('0x43')]);_[_0xf8ca('0x30')](_0x486531)[_0xf8ca('0x44')](function(_0x11c848){var _0x26749e=_0x486531[_0x11c848];switch(_0x26749e['condition']){case'IS':if(_[_0xf8ca('0x45')](_0x26749e[_0xf8ca('0x46')])&&_0x26749e[_0xf8ca('0x46')][_0xf8ca('0x35')]>0x1){_0x28cb50[_0xf8ca('0x47')](_0x26749e[_0xf8ca('0x48')]+'.'+_0x11c848+_0xf8ca('0x49'),_0x26749e[_0xf8ca('0x46')]);}else{_0x28cb50[_0xf8ca('0x47')](_0x26749e['tableAlias']+'.'+_0x11c848+'\x20=\x20?',_0x26749e['value'][0x0]);}break;case'=':_0x28cb50[_0xf8ca('0x47')](_0x26749e[_0xf8ca('0x48')]+'.'+_0x11c848+_0xf8ca('0x4a'),_0x26749e[_0xf8ca('0x46')]);break;case _0xf8ca('0x4b'):_0x28cb50[_0xf8ca('0x47')](_0x26749e[_0xf8ca('0x48')]+'.'+_0x11c848+_0xf8ca('0x4c'),'%'+_0x26749e[_0xf8ca('0x46')]+'%');break;case'>':_0x28cb50['and'](_0x26749e[_0xf8ca('0x48')]+'.'+_0x11c848+'\x20>\x20?',_0x26749e[_0xf8ca('0x46')]);break;case'<':_0x28cb50[_0xf8ca('0x47')](_0x26749e[_0xf8ca('0x48')]+'.'+_0x11c848+_0xf8ca('0x4d'),_0x26749e[_0xf8ca('0x46')]);break;}});}else{var _0x30591d=_(Object['keys'](_0x26fe0a[_0xf8ca('0x31')]))['map'](function(_0x49110e){return _0x461248[_0xf8ca('0x36')](_0x49110e)?_0x49110e:undefined;})[_0xf8ca('0x4e')](function(_0x149781){return!_['isNil'](_0x149781);})[_0xf8ca('0x46')]();if(!_[_0xf8ca('0x4f')](_0x30591d)){_0x30591d[_0xf8ca('0x44')](function(_0x97124d){if(_0x97124d===_0xf8ca('0x50')){_0x31062c[_0xf8ca('0x40')]('c.ListId\x20IN\x20?',[][_0xf8ca('0x51')](_0x26fe0a[_0xf8ca('0x31')][_0x97124d]));}else{_0x31062c[_0xf8ca('0x40')]('c.'+_0x97124d+'\x20=\x20?',_0x26fe0a[_0xf8ca('0x31')][_0x97124d]);}});}if(_0x26fe0a[_0xf8ca('0x31')]['filter']){var _0x1fa89c=_0x26fe0a[_0xf8ca('0x31')]['filter']['replace']('\x5c','\x5c\x5c')[_0xf8ca('0x52')]('\x27\x27',_0xf8ca('0x53'));if(qs[_0xf8ca('0x54')](_0x1fa89c)){_0x28cb50['or'](_0xf8ca('0x55'),_0x1fa89c+'%');_0x28cb50['or'](_0xf8ca('0x56'),_0x1fa89c+'%');_0x28cb50['or']('c.mobile\x20LIKE\x20?',_0x1fa89c+'%');_0x28cb50['or'](_0xf8ca('0x57'),_0x1fa89c+'%');}else if(qs[_0xf8ca('0x58')](_0x1fa89c)){_0x28cb50['or'](_0xf8ca('0x59'),_0x1fa89c+'%');}else{_0x28cb50['or']('c.email\x20LIKE\x20?',_0x1fa89c+'%');_0x28cb50['or'](_0xf8ca('0x5a'),_0x1fa89c+'%');_0x28cb50['or'](_0xf8ca('0x5b'),_0x1fa89c+'%');}}}_0x31062c[_0xf8ca('0x40')](_0x28cb50);if(_0x32a62a['order']){_0x32a62a[_0xf8ca('0x37')][_0xf8ca('0x44')](function(_0x5400d6){_0x31062c[_0xf8ca('0x37')]('c.'+_0x5400d6[0x0],_0x5400d6[0x1]===_0xf8ca('0x5c')?![]:!![]);});}_0x31062c[_0xf8ca('0x5d')]('c.id');var _0x56ca3e={'type':db[_0xf8ca('0x5e')][_0xf8ca('0x5f')]['SELECT'],'raw':!![]};var _0x29a1ca=_0x31062c[_0xf8ca('0x60')]()[_0xf8ca('0x3c')](_0xf8ca('0x61'));if(!_0x26fe0a[_0xf8ca('0x31')]['advancedFilter']){if(_0x26fe0a[_0xf8ca('0x31')][_0xf8ca('0x62')]){var _0x18ae70=_[_0xf8ca('0x45')](_0x26fe0a['query'][_0xf8ca('0x62')])?_0x26fe0a[_0xf8ca('0x31')][_0xf8ca('0x62')]:new Array(_0x26fe0a[_0xf8ca('0x31')]['tag']);var _0x430a4b=squel[_0xf8ca('0x42')]();_0x18ae70[_0xf8ca('0x44')](function(_0x2f617e){_0x430a4b['or'](_0xf8ca('0x63'),'%,'+_0x2f617e+',%');});_0x31062c['having'](_0x430a4b);_0x29a1ca[_0xf8ca('0x64')](_0xf8ca('0x65'),'ct','ct.CmContactId\x20=\x20c.id');_0x29a1ca[_0xf8ca('0x64')](_0xf8ca('0x3e'),'t','t.id\x20=\x20ct.TagId');_0x29a1ca[_0xf8ca('0x40')]('t.id\x20IN\x20?',_0x18ae70);}}db['sequelize'][_0xf8ca('0x31')](_0x19e474['toString'](),_0x56ca3e)[_0xf8ca('0x26')](function(_0x364846){_0x2a84d2=_['keyBy'](_0x364846,'id');return db['sequelize'][_0xf8ca('0x31')](_0x29a1ca[_0xf8ca('0x66')](),_0x56ca3e);})['then'](function(_0x1c994a){_0x1d2a0a[_0xf8ca('0x67')]=_0x1c994a[_0xf8ca('0x35')];_0x56ca3e=_[_0xf8ca('0x68')](_0x56ca3e,{'model':db[_0xf8ca('0x2e')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x31062c[_0xf8ca('0x3c')](_0xf8ca('0x69'));_0x31062c[_0xf8ca('0x3c')](_0xf8ca('0x6a'),'TagIds');_0x31062c[_0xf8ca('0x64')](_0xf8ca('0x65'),'ct',_0xf8ca('0x6b'));_0x31062c[_0xf8ca('0x64')]('tools_tags','t',_0xf8ca('0x6c'));if(_0x32a62a[_0xf8ca('0x1f')]){_0x31062c[_0xf8ca('0x1f')](_0x32a62a[_0xf8ca('0x1f')]);}if(_0x32a62a[_0xf8ca('0x1e')]){_0x31062c[_0xf8ca('0x1e')](_0x32a62a[_0xf8ca('0x1e')]);}db[_0xf8ca('0x6d')][_0xf8ca('0x31')](_0x31062c[_0xf8ca('0x66')](),_0x56ca3e)['then'](function(_0x5047a0){_0x5047a0[_0xf8ca('0x44')](function(_0x9eec49){if(_0x9eec49[_0xf8ca('0x6e')]){_0x9eec49[_0xf8ca('0x6f')]=[];_0x9eec49['TagIds'][_0xf8ca('0x70')](',')[_0xf8ca('0x44')](function(_0xbefba7){_0x9eec49[_0xf8ca('0x6f')]['push'](_0x2a84d2[_0xbefba7]);});}delete _0x9eec49[_0xf8ca('0x6e')];});_0x1d2a0a[_0xf8ca('0x71')]=_0x5047a0;return _0x1d2a0a;})['then'](respondWithFilteredResult(_0x36760,_0x32a62a))[_0xf8ca('0x72')](handleError(_0x36760,null));});});};exports[_0xf8ca('0x27')]=function(_0x15aaf9,_0x19c45f){return db[_0xf8ca('0x2e')][_0xf8ca('0x73')]({'where':{'id':_0x15aaf9['params']['id']}})[_0xf8ca('0x26')](handleEntityNotFound(_0x19c45f,null))['then'](removeEntity(_0x19c45f,null))[_0xf8ca('0x72')](handleError(_0x19c45f,null));};exports[_0xf8ca('0x74')]=function(_0x41da0a,_0x5499d8){return db[_0xf8ca('0x2e')]['describe']()[_0xf8ca('0x26')](function(_0x1a3c60){for(var _0x4e8c02=0x0;_0x4e8c02{}\s\\|]/g,'-');_0x13d39e(null,util[_0x97ee('0x1e')]('%s-%s%s',path[_0x97ee('0x1f')](_0xc79296[_0x97ee('0x1d')],path['extname'](_0xc79296[_0x97ee('0x1d')])),Date[_0x97ee('0x20')](),path[_0x97ee('0x21')](_0xc79296[_0x97ee('0x1d')])));}})});router[_0x97ee('0x13')](_0x97ee('0x22'),upload[_0x97ee('0x23')](_0x97ee('0x24')),controller[_0x97ee('0x25')]);var upload=multer({'storage':multer[_0x97ee('0x19')]({'destination':function(_0xf4a8c6,_0x2024fb,_0x51122c){_0x51122c(null,path[_0x97ee('0x1a')](config[_0x97ee('0x1b')],_0x97ee('0x1c')));},'filename':function(_0x3963b7,_0x5ebfac,_0x3606bf){_0x5ebfac[_0x97ee('0x1d')]=_0x5ebfac[_0x97ee('0x1d')][_0x97ee('0x26')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3606bf(null,util[_0x97ee('0x1e')](_0x97ee('0x27'),path[_0x97ee('0x1f')](_0x5ebfac['originalname'],path[_0x97ee('0x21')](_0x5ebfac[_0x97ee('0x1d')])),Date[_0x97ee('0x20')](),path[_0x97ee('0x21')](_0x5ebfac[_0x97ee('0x1d')])));}})});router[_0x97ee('0x13')](_0x97ee('0x28'),upload[_0x97ee('0x23')](_0x97ee('0x24')),controller[_0x97ee('0x29')]);router[_0x97ee('0x13')](_0x97ee('0x2a'),auth[_0x97ee('0x8')](),controller[_0x97ee('0x2b')]);router[_0x97ee('0x2c')](_0x97ee('0xa'),auth[_0x97ee('0x8')](),controller[_0x97ee('0x2d')]);router[_0x97ee('0x2e')](_0x97ee('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x4f08=['getTags','/:id/hoppers','getHoppers','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','post','/merge','merge','create','/create_many','bulkCreate','setTags','diskStorage','join','server/files/tmp','replace','%s-%s%s','basename','originalname','extname','/csv','single','file','now','/upload','upload','/upload/:id','import','put','/:id','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/interaction/service','./cmContact.controller','isAuthenticated','get','describe','show','/:id/tags'];(function(_0x283596,_0x2a33ce){var _0x21b223=function(_0x170d38){while(--_0x170d38){_0x283596['push'](_0x283596['shift']());}};_0x21b223(++_0x2a33ce);}(_0x4f08,0x1ef));var _0x84f0=function(_0x58a911,_0xbe30d4){_0x58a911=_0x58a911-0x0;var _0x581045=_0x4f08[_0x58a911];return _0x581045;};'use strict';var multer=require('multer');var util=require(_0x84f0('0x0'));var path=require('path');var timeout=require(_0x84f0('0x1'));var express=require(_0x84f0('0x2'));var router=express[_0x84f0('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x84f0('0x4'));var config=require('../../config/environment');var controller=require(_0x84f0('0x5'));router['get']('/',auth[_0x84f0('0x6')](),controller['index']);router[_0x84f0('0x7')]('/describe',auth[_0x84f0('0x6')](),controller[_0x84f0('0x8')]);router[_0x84f0('0x7')]('/:id',auth[_0x84f0('0x6')](),controller[_0x84f0('0x9')]);router['get'](_0x84f0('0xa'),auth[_0x84f0('0x6')](),controller[_0x84f0('0xb')]);router[_0x84f0('0x7')](_0x84f0('0xc'),auth[_0x84f0('0x6')](),controller[_0x84f0('0xd')]);router[_0x84f0('0x7')]('/:id/hopper_histories',auth['isAuthenticated'](),controller['getHopperHistories']);router[_0x84f0('0x7')]('/:id/hopper_finals',auth[_0x84f0('0x6')](),controller[_0x84f0('0xe')]);router[_0x84f0('0x7')](_0x84f0('0xf'),auth[_0x84f0('0x6')](),controller[_0x84f0('0x10')]);router[_0x84f0('0x11')](_0x84f0('0x12'),auth['isAuthenticated'](),controller[_0x84f0('0x13')]);router[_0x84f0('0x11')]('/',auth[_0x84f0('0x6')](),controller[_0x84f0('0x14')]);router[_0x84f0('0x11')](_0x84f0('0x15'),auth[_0x84f0('0x6')](),controller[_0x84f0('0x16')]);router[_0x84f0('0x11')]('/:id/tags',auth[_0x84f0('0x6')](),controller[_0x84f0('0x17')]);var upload=multer({'storage':multer[_0x84f0('0x18')]({'destination':function(_0x2eba49,_0x46a665,_0x39d159){_0x39d159(null,path[_0x84f0('0x19')](config['root'],_0x84f0('0x1a')));},'filename':function(_0x4adc07,_0x3b24de,_0xd84cec){_0x3b24de['originalname']=_0x3b24de['originalname'][_0x84f0('0x1b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xd84cec(null,util['format'](_0x84f0('0x1c'),path[_0x84f0('0x1d')](_0x3b24de[_0x84f0('0x1e')],path[_0x84f0('0x1f')](_0x3b24de[_0x84f0('0x1e')])),Date['now'](),path[_0x84f0('0x1f')](_0x3b24de[_0x84f0('0x1e')])));}})});router['post'](_0x84f0('0x20'),upload[_0x84f0('0x21')](_0x84f0('0x22')),controller['uploadCsv']);var upload=multer({'storage':multer[_0x84f0('0x18')]({'destination':function(_0x5de7ea,_0x210c9b,_0x2569a3){_0x2569a3(null,path['join'](config['root'],_0x84f0('0x1a')));},'filename':function(_0xfeb6c8,_0x4e807f,_0xecdc41){_0x4e807f['originalname']=_0x4e807f[_0x84f0('0x1e')][_0x84f0('0x1b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xecdc41(null,util['format'](_0x84f0('0x1c'),path[_0x84f0('0x1d')](_0x4e807f[_0x84f0('0x1e')],path['extname'](_0x4e807f[_0x84f0('0x1e')])),Date[_0x84f0('0x23')](),path[_0x84f0('0x1f')](_0x4e807f['originalname'])));}})});router['post'](_0x84f0('0x24'),upload[_0x84f0('0x21')](_0x84f0('0x22')),controller[_0x84f0('0x25')]);router['post'](_0x84f0('0x26'),auth[_0x84f0('0x6')](),controller[_0x84f0('0x27')]);router[_0x84f0('0x28')](_0x84f0('0x29'),auth[_0x84f0('0x6')](),controller[_0x84f0('0x2a')]);router[_0x84f0('0x2b')](_0x84f0('0x29'),auth[_0x84f0('0x6')](),controller[_0x84f0('0x2c')]);module[_0x84f0('0x2d')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 31dc7b5..50b1f6e 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 _0xae10=['BOOLEAN','sequelize','lodash','exports','VIRTUAL','getDataValue','alias','STRING','setDataValue','name','type','select','parse','stringify','values'];(function(_0x3d92cc,_0x360b2e){var _0x41e4c8=function(_0x4d5454){while(--_0x4d5454){_0x3d92cc['push'](_0x3d92cc['shift']());}};_0x41e4c8(++_0x360b2e);}(_0xae10,0x10f));var _0x0ae1=function(_0x4f653f,_0x3a513b){_0x4f653f=_0x4f653f-0x0;var _0x2d9175=_0xae10[_0x4f653f];return _0x2d9175;};'use strict';var Sequelize=require(_0x0ae1('0x0'));var _=require(_0x0ae1('0x1'));module[_0x0ae1('0x2')]={'name':{'type':Sequelize[_0x0ae1('0x3')],'get':function(_0x40627f){return this[_0x0ae1('0x4')](_0x0ae1('0x5'));}},'alias':{'type':Sequelize[_0x0ae1('0x6')],'allowNull':![],'set':function(_0x1e7acd){this[_0x0ae1('0x7')](_0x0ae1('0x5'),_0x1e7acd?_0x1e7acd:this['getDataValue'](_0x0ae1('0x8')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize['TEXT']('long'),'get':function(){if(this[_0x0ae1('0x4')](_0x0ae1('0x9'))===_0x0ae1('0xa')){return JSON[_0x0ae1('0xb')](this[_0x0ae1('0x4')]('values'));}else{return this[_0x0ae1('0x4')]('values');}},'set':function(_0x45cc6f){if(Array['isArray'](_0x45cc6f)){this[_0x0ae1('0x7')]('values',JSON[_0x0ae1('0xc')](_0x45cc6f));}else{this[_0x0ae1('0x7')](_0x0ae1('0xd'),_0x45cc6f);}}},'required':{'type':Sequelize[_0x0ae1('0xe')],'defaultValue':![]}}; \ No newline at end of file +var _0xde33=['setDataValue','alias','name','long','select','parse','values','isArray','BOOLEAN','sequelize','getDataValue','STRING'];(function(_0x457e9c,_0x4cf6b8){var _0x5a9ef1=function(_0x38b057){while(--_0x38b057){_0x457e9c['push'](_0x457e9c['shift']());}};_0x5a9ef1(++_0x4cf6b8);}(_0xde33,0x1d1));var _0x3de3=function(_0xaa93db,_0x172ff0){_0xaa93db=_0xaa93db-0x0;var _0x237573=_0xde33[_0xaa93db];return _0x237573;};'use strict';var Sequelize=require(_0x3de3('0x0'));var _=require('lodash');module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x41c302){return this[_0x3de3('0x1')]('alias');}},'alias':{'type':Sequelize[_0x3de3('0x2')],'allowNull':![],'set':function(_0x23fde8){this[_0x3de3('0x3')](_0x3de3('0x4'),_0x23fde8?_0x23fde8:this[_0x3de3('0x1')](_0x3de3('0x5')));}},'type':{'type':Sequelize[_0x3de3('0x2')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x3de3('0x6')),'get':function(){if(this[_0x3de3('0x1')]('type')===_0x3de3('0x7')){return JSON[_0x3de3('0x8')](this['getDataValue']('values'));}else{return this[_0x3de3('0x1')](_0x3de3('0x9'));}},'set':function(_0xc796c6){if(Array[_0x3de3('0xa')](_0xc796c6)){this[_0x3de3('0x3')](_0x3de3('0x9'),JSON['stringify'](_0xc796c6));}else{this[_0x3de3('0x3')](_0x3de3('0x9'),_0xc796c6);}}},'required':{'type':Sequelize[_0x3de3('0xb')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index a3957eb..8e2bd45 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(_0x16f1c,_0x26f0a9){var _0x5375b6=function(_0x2b3932){while(--_0x2b3932){_0x16f1c['push'](_0x16f1c['shift']());}};_0x5375b6(++_0x26f0a9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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(_0x134bfc,_0x144d5f){var _0x2f4dcc=function(_0x56cf22){while(--_0x56cf22){_0x134bfc['push'](_0x134bfc['shift']());}};_0x2f4dcc(++_0x144d5f);}(_0xb10b,0x12a));var _0xbb10=function(_0x445ff7,_0x2f90be){_0x445ff7=_0x445ff7-0x0;var _0x4f38fe=_0xb10b[_0x445ff7];return _0x4f38fe;};'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 bf481c5..afd0eaf 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 _0xb30f=['request-promise','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','get','TEXT','type','text','number','INTEGER','switch','BOOLEAN','queryInterface','addColumn','cf_%d','lodash','util','../../config/logger','api','moment'];(function(_0x38d2a5,_0x3e4915){var _0x4d0941=function(_0x20f1f3){while(--_0x20f1f3){_0x38d2a5['push'](_0x38d2a5['shift']());}};_0x4d0941(++_0x3e4915);}(_0xb30f,0x1ab));var _0xfb30=function(_0xf54c9f,_0x78a0de){_0xf54c9f=_0xf54c9f-0x0;var _0x68a1ea=_0xb30f[_0xf54c9f];return _0x68a1ea;};'use strict';var _=require(_0xfb30('0x0'));var util=require(_0xfb30('0x1'));var logger=require(_0xfb30('0x2'))(_0xfb30('0x3'));var moment=require(_0xfb30('0x4'));var BPromise=require('bluebird');var rp=require(_0xfb30('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfb30('0x6'));var config=require(_0xfb30('0x7'));var attributes=require(_0xfb30('0x8'));module[_0xfb30('0x9')]=function(_0x2696a6,_0x5581e4){return _0x2696a6[_0xfb30('0xa')](_0xfb30('0xb'),attributes,{'tableName':_0xfb30('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4419ec,_0x33e65b,_0x55d49c){var _0xf672fc=_0x4419ec[_0xfb30('0xd')]({'plain':!![]});var _0x3f40f0={'type':_0x5581e4[_0xfb30('0xe')],'transaction':_0x33e65b['transaction']};switch(_0xf672fc[_0xfb30('0xf')]){case _0xfb30('0x10'):_0x3f40f0['type']=_0x5581e4[_0xfb30('0xe')];break;case _0xfb30('0x11'):_0x3f40f0[_0xfb30('0xf')]=_0x5581e4[_0xfb30('0x12')];break;case _0xfb30('0x13'):_0x3f40f0[_0xfb30('0xf')]=_0x5581e4[_0xfb30('0x14')];_0x3f40f0['defaultValue']=![];break;}_0x2696a6[_0xfb30('0x15')][_0xfb30('0x16')]('cm_contacts',util['format'](_0xfb30('0x17'),_0xf672fc['id']),_0x3f40f0);_0x55d49c();}}});}; \ No newline at end of file +var _0xdaf9=['./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','TEXT','transaction','type','number','defaultValue','queryInterface','cm_contacts','cf_%d','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xf61586,_0x56b0c4){var _0x2b6eb3=function(_0x47e12b){while(--_0x47e12b){_0xf61586['push'](_0xf61586['shift']());}};_0x2b6eb3(++_0x56b0c4);}(_0xdaf9,0xca));var _0x9daf=function(_0x28f7a7,_0x429a4c){_0x28f7a7=_0x28f7a7-0x0;var _0x2cef93=_0xdaf9[_0x28f7a7];return _0x2cef93;};'use strict';var _=require(_0x9daf('0x0'));var util=require('util');var logger=require(_0x9daf('0x1'))('api');var moment=require(_0x9daf('0x2'));var BPromise=require(_0x9daf('0x3'));var rp=require(_0x9daf('0x4'));var fs=require('fs');var path=require(_0x9daf('0x5'));var rimraf=require(_0x9daf('0x6'));var config=require(_0x9daf('0x7'));var attributes=require(_0x9daf('0x8'));module[_0x9daf('0x9')]=function(_0x5cdf77,_0x269f75){return _0x5cdf77[_0x9daf('0xa')](_0x9daf('0xb'),attributes,{'tableName':_0x9daf('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1da1b8,_0x465277,_0x3f5176){var _0x5b6ecc=_0x1da1b8['get']({'plain':!![]});var _0x130f38={'type':_0x269f75[_0x9daf('0xd')],'transaction':_0x465277[_0x9daf('0xe')]};switch(_0x5b6ecc[_0x9daf('0xf')]){case'text':_0x130f38[_0x9daf('0xf')]=_0x269f75[_0x9daf('0xd')];break;case _0x9daf('0x10'):_0x130f38[_0x9daf('0xf')]=_0x269f75['INTEGER'];break;case'switch':_0x130f38['type']=_0x269f75['BOOLEAN'];_0x130f38[_0x9daf('0x11')]=![];break;}_0x5cdf77[_0x9daf('0x12')]['addColumn'](_0x9daf('0x13'),util['format'](_0x9daf('0x14'),_0x5b6ecc['id']),_0x130f38);_0x3f5176();}}});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index b9c7bd1..9705f2e 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 _0x1001=['util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','error','code','message','info','result','lodash'];(function(_0x2ed8f3,_0x4aa12f){var _0x525a55=function(_0x4cfb58){while(--_0x4cfb58){_0x2ed8f3['push'](_0x2ed8f3['shift']());}};_0x525a55(++_0x4aa12f);}(_0x1001,0x13a));var _0x1100=function(_0x63b02a,_0x50f064){_0x63b02a=_0x63b02a-0x0;var _0x36d635=_0x1001[_0x63b02a];return _0x36d635;};'use strict';var _=require(_0x1100('0x0'));var util=require(_0x1100('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1100('0x2'));var fs=require('fs');var Redis=require(_0x1100('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1100('0x4'));var logger=require(_0x1100('0x5'))(_0x1100('0x6'));var config=require('../../config/environment');var jayson=require(_0x1100('0x7'));var client=jayson[_0x1100('0x8')][_0x1100('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x50ad8e,_0x4b3f74,_0x3871be){return new BPromise(function(_0x1f5555,_0x534496){return client[_0x1100('0xa')](_0x50ad8e,_0x3871be)[_0x1100('0xb')](function(_0x3414d9){logger['info'](_0x1100('0xc'),_0x4b3f74,_0x1100('0xd'));logger[_0x1100('0xe')](_0x1100('0xf'),_0x4b3f74,_0x1100('0xd'),JSON['stringify'](_0x3414d9));if(_0x3414d9[_0x1100('0x10')]){if(_0x3414d9[_0x1100('0x10')][_0x1100('0x11')]===0x1f4){logger['error'](_0x1100('0xc'),_0x4b3f74,_0x3414d9['error']['message']);return _0x534496(_0x3414d9[_0x1100('0x10')][_0x1100('0x12')]);}logger[_0x1100('0x10')](_0x1100('0xc'),_0x4b3f74,_0x3414d9[_0x1100('0x10')]['message']);return _0x1f5555(_0x3414d9[_0x1100('0x10')][_0x1100('0x12')]);}else{logger[_0x1100('0x13')](_0x1100('0xc'),_0x4b3f74,_0x1100('0xd'));_0x1f5555(_0x3414d9[_0x1100('0x14')][_0x1100('0x12')]);}})['catch'](function(_0x20c48e){logger[_0x1100('0x10')]('CmCustomField,\x20%s,\x20%s',_0x4b3f74,_0x20c48e);_0x534496(_0x20c48e);});});} \ No newline at end of file +var _0x557e=['rpc','../../config/environment','jayson/promise','client','http','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x59a109,_0x49fe43){var _0xc7aeaf=function(_0x9af0f){while(--_0x9af0f){_0x59a109['push'](_0x59a109['shift']());}};_0xc7aeaf(++_0x49fe43);}(_0x557e,0x144));var _0xe557=function(_0x5b0c60,_0x44ab91){_0x5b0c60=_0x5b0c60-0x0;var _0x6791b4=_0x557e[_0x5b0c60];return _0x6791b4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe557('0x0'));var BPromise=require(_0xe557('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe557('0x2'));var db=require(_0xe557('0x3'))['db'];var utils=require(_0xe557('0x4'));var logger=require(_0xe557('0x5'))(_0xe557('0x6'));var config=require(_0xe557('0x7'));var jayson=require(_0xe557('0x8'));var client=jayson[_0xe557('0x9')][_0xe557('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x471a28,_0x4eab11,_0x118db6){return new BPromise(function(_0x2a2b38,_0x497a8b){return client['request'](_0x471a28,_0x118db6)[_0xe557('0xb')](function(_0xa56f0c){logger[_0xe557('0xc')](_0xe557('0xd'),_0x4eab11,_0xe557('0xe'));logger[_0xe557('0xf')](_0xe557('0x10'),_0x4eab11,_0xe557('0xe'),JSON[_0xe557('0x11')](_0xa56f0c));if(_0xa56f0c[_0xe557('0x12')]){if(_0xa56f0c[_0xe557('0x12')]['code']===0x1f4){logger[_0xe557('0x12')]('CmCustomField,\x20%s,\x20%s',_0x4eab11,_0xa56f0c[_0xe557('0x12')][_0xe557('0x13')]);return _0x497a8b(_0xa56f0c[_0xe557('0x12')][_0xe557('0x13')]);}logger['error'](_0xe557('0xd'),_0x4eab11,_0xa56f0c[_0xe557('0x12')][_0xe557('0x13')]);return _0x2a2b38(_0xa56f0c['error'][_0xe557('0x13')]);}else{logger['info'](_0xe557('0xd'),_0x4eab11,_0xe557('0xe'));_0x2a2b38(_0xa56f0c[_0xe557('0x14')]['message']);}})[_0xe557('0x15')](function(_0xd46faf){logger['error']('CmCustomField,\x20%s,\x20%s',_0x4eab11,_0xd46faf);_0x497a8b(_0xd46faf);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 051bb35..7d1655a 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 _0xfc7c=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','util','path'];(function(_0x4b094b,_0x296fdb){var _0x32eac3=function(_0x4b0f39){while(--_0x4b0f39){_0x4b094b['push'](_0x4b094b['shift']());}};_0x32eac3(++_0x296fdb);}(_0xfc7c,0xa9));var _0xcfc7=function(_0x2eb188,_0x39b1da){_0x2eb188=_0x2eb188-0x0;var _0x170341=_0xfc7c[_0x2eb188];return _0x170341;};'use strict';var multer=require('multer');var util=require(_0xcfc7('0x0'));var path=require(_0xcfc7('0x1'));var timeout=require(_0xcfc7('0x2'));var express=require(_0xcfc7('0x3'));var router=express[_0xcfc7('0x4')]();var auth=require(_0xcfc7('0x5'));var interaction=require(_0xcfc7('0x6'));var config=require('../../config/environment');var controller=require('./cmCustomField.controller');router[_0xcfc7('0x7')]('/',auth['isAuthenticated'](),controller[_0xcfc7('0x8')]);router[_0xcfc7('0x7')]('/:id',auth[_0xcfc7('0x9')](),controller[_0xcfc7('0xa')]);router[_0xcfc7('0xb')]('/',auth[_0xcfc7('0x9')](),controller[_0xcfc7('0xc')]);router[_0xcfc7('0xd')](_0xcfc7('0xe'),auth[_0xcfc7('0x9')](),controller[_0xcfc7('0xf')]);router[_0xcfc7('0x10')](_0xcfc7('0xe'),auth['isAuthenticated'](),controller[_0xcfc7('0x11')]);module[_0xcfc7('0x12')]=router; \ No newline at end of file +var _0x6c98=['/:id','update','destroy','exports','multer','util','connect-timeout','../../components/interaction/service','./cmCustomField.controller','get','index','isAuthenticated','show','post','create','put'];(function(_0x35b18a,_0x6b2fbe){var _0x4db1bd=function(_0x389e62){while(--_0x389e62){_0x35b18a['push'](_0x35b18a['shift']());}};_0x4db1bd(++_0x6b2fbe);}(_0x6c98,0x174));var _0x86c9=function(_0x3fe435,_0x120ebe){_0x3fe435=_0x3fe435-0x0;var _0x13ef18=_0x6c98[_0x3fe435];return _0x13ef18;};'use strict';var multer=require(_0x86c9('0x0'));var util=require(_0x86c9('0x1'));var path=require('path');var timeout=require(_0x86c9('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x86c9('0x3'));var config=require('../../config/environment');var controller=require(_0x86c9('0x4'));router[_0x86c9('0x5')]('/',auth['isAuthenticated'](),controller[_0x86c9('0x6')]);router[_0x86c9('0x5')]('/:id',auth[_0x86c9('0x7')](),controller[_0x86c9('0x8')]);router[_0x86c9('0x9')]('/',auth[_0x86c9('0x7')](),controller[_0x86c9('0xa')]);router[_0x86c9('0xb')](_0x86c9('0xc'),auth[_0x86c9('0x7')](),controller[_0x86c9('0xd')]);router['delete'](_0x86c9('0xc'),auth[_0x86c9('0x7')](),controller[_0x86c9('0xe')]);module[_0x86c9('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 8b887b1..aafd82d 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 _0xe735=['UNSIGNED','contactListQueue','sequelize','exports','STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER'];(function(_0x15f640,_0x1ba6dc){var _0x56549f=function(_0x13f1be){while(--_0x13f1be){_0x15f640['push'](_0x15f640['shift']());}};_0x56549f(++_0x1ba6dc);}(_0xe735,0xa2));var _0x5e73=function(_0x1fa759,_0x4ecdce){_0x1fa759=_0x1fa759-0x0;var _0x2da9f4=_0xe735[_0x1fa759];return _0x2da9f4;};'use strict';var moment=require('moment');var Sequelize=require(_0x5e73('0x0'));module[_0x5e73('0x1')]={'phone':{'type':Sequelize[_0x5e73('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x5e73('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x5e73('0x4')],'defaultValue':moment()[_0x5e73('0x5')](_0x5e73('0x6'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5e73('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5e73('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5e73('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5e73('0x4')]},'priority':{'type':Sequelize[_0x5e73('0x7')](0x2)[_0x5e73('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x5e73('0x7')],'unique':_0x5e73('0x9')},'ListId':{'type':Sequelize[_0x5e73('0x7')],'unique':_0x5e73('0x9')},'UserId':{'type':Sequelize[_0x5e73('0x7')]},'VoiceQueueId':{'type':Sequelize[_0x5e73('0x7')],'unique':_0x5e73('0x9')},'CampaignId':{'type':Sequelize[_0x5e73('0x7')]}}; \ No newline at end of file +var _0x4d7e=['moment','sequelize','STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue'];(function(_0x50b57d,_0x4a9947){var _0x36c1ac=function(_0x560280){while(--_0x560280){_0x50b57d['push'](_0x50b57d['shift']());}};_0x36c1ac(++_0x4a9947);}(_0x4d7e,0x1ae));var _0xe4d7=function(_0x4cfd78,_0x52355e){_0x4cfd78=_0x4cfd78-0x0;var _0xf4a95a=_0x4d7e[_0x4cfd78];return _0xf4a95a;};'use strict';var moment=require(_0xe4d7('0x0'));var Sequelize=require(_0xe4d7('0x1'));module['exports']={'phone':{'type':Sequelize[_0xe4d7('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0xe4d7('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xe4d7('0x4')],'defaultValue':moment()[_0xe4d7('0x5')](_0xe4d7('0x6'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xe4d7('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xe4d7('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xe4d7('0x4')]},'priority':{'type':Sequelize[_0xe4d7('0x7')](0x2)[_0xe4d7('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xe4d7('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xe4d7('0x7')],'unique':_0xe4d7('0x9')},'ListId':{'type':Sequelize[_0xe4d7('0x7')],'unique':_0xe4d7('0x9')},'UserId':{'type':Sequelize[_0xe4d7('0x7')]},'VoiceQueueId':{'type':Sequelize[_0xe4d7('0x7')],'unique':_0xe4d7('0x9')},'CampaignId':{'type':Sequelize[_0xe4d7('0x7')]}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index b991527..5b70a2b 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 _0xdace=['statedesc','deleted','campaign','membername','UserId','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','ivr','CmContact','ContactId','firstName','isNil','lastName','calleridname','finally','CmHopperFinal','create','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','direction','prev','hopperIds','priority','ASC','DESC','COALESCE(CmHopper.UserId,\x200)\x20ASC','scheduledAt','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','VoiceQueue','Queue','dialActive','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','end','offset','limit','json','apply','save','update','then','error','stack','name','send','index','CmHopper','model','keys','query','filters','intersection','concat','$and','$or','$gt','$gte','$lte','$ne','$eq','$between','$notBetween','$notIn','$like','$iLike','$notILike','$overlap','$contains','$contained','$any','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','map','key','field','filter','options','count','includeAll','include','findAll','rows','catch','body','find','params','describe','destroy','VoiceQueueId','Campaign','dataValues','updatedAt','state'];(function(_0x36301e,_0x970c42){var _0x586b6c=function(_0x7818d5){while(--_0x7818d5){_0x36301e['push'](_0x36301e['shift']());}};_0x586b6c(++_0x970c42);}(_0xdace,0xc5));var _0xedac=function(_0x3df223,_0x1740fc){_0x3df223=_0x3df223-0x0;var _0x562d11=_0xdace[_0x3df223];return _0x562d11;};'use strict';var pdf=require(_0xedac('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xedac('0x1'));var zipdir=require(_0xedac('0x2'));var jsonpatch=require(_0xedac('0x3'));var rp=require('request-promise');var moment=require(_0xedac('0x4'));var BPromise=require(_0xedac('0x5'));var Mustache=require(_0xedac('0x6'));var util=require(_0xedac('0x7'));var path=require('path');var sox=require(_0xedac('0x8'));var csv=require(_0xedac('0x9'));var ejs=require(_0xedac('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xedac('0xb'));var crypto=require(_0xedac('0xc'));var jsforce=require(_0xedac('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xedac('0x9'));var querystring=require(_0xedac('0xe'));var Papa=require(_0xedac('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xedac('0x10'));var hardwareService=require(_0xedac('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xedac('0x12'));var config=require(_0xedac('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x261401,_0x4fa1ac){_0x4fa1ac=_0x4fa1ac||0xcc;return function(_0x21c6ae){if(_0x21c6ae){return _0x261401[_0xedac('0x14')](_0x4fa1ac);}return _0x261401[_0xedac('0x15')](_0x4fa1ac)[_0xedac('0x16')]();};}function respondWithResult(_0x9a79a0,_0x473c3e){_0x473c3e=_0x473c3e||0xc8;return function(_0x28444a){if(_0x28444a){return _0x9a79a0[_0xedac('0x15')](_0x473c3e)['json'](_0x28444a);}};}function respondWithFilteredResult(_0x110546,_0x4651d4){return function(_0x2f0c7c){if(_0x2f0c7c){var _0x2676c3=_0x2f0c7c['count'],_0x15068=_0x4651d4[_0xedac('0x17')],_0x590e9b=_0x4651d4[_0xedac('0x17')]+_0x4651d4[_0xedac('0x18')],_0xed25bb;if(_0x590e9b>=_0x2676c3){_0x590e9b=_0x2676c3;_0xed25bb=0xc8;}else{_0xed25bb=0xce;}_0x110546[_0xedac('0x15')](_0xed25bb);return _0x110546['set']('Content-Range',_0x15068+'-'+_0x590e9b+'/'+_0x2676c3)[_0xedac('0x19')](_0x2f0c7c);}return null;};}function patchUpdates(_0x2adefa){return function(_0x25fe64){try{jsonpatch[_0xedac('0x1a')](_0x25fe64,_0x2adefa,!![]);}catch(_0x5a5438){return BPromise['reject'](_0x5a5438);}return _0x25fe64[_0xedac('0x1b')]();};}function saveUpdates(_0x17766c,_0x23c609){return function(_0xcc1605){if(_0xcc1605){return _0xcc1605[_0xedac('0x1c')](_0x17766c)[_0xedac('0x1d')](function(_0x160be7){return _0x160be7;});}return null;};}function removeEntity(_0x928ebe,_0x5353e3){return function(_0x4593e8){if(_0x4593e8){return _0x4593e8['destroy']()[_0xedac('0x1d')](function(){_0x928ebe[_0xedac('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46e09d,_0x404b8d){return function(_0x1c87bf){if(!_0x1c87bf){_0x46e09d[_0xedac('0x14')](0x194);}return _0x1c87bf;};}function handleError(_0x6b13ca,_0x167d7e){_0x167d7e=_0x167d7e||0x1f4;return function(_0x5d7c31){logger[_0xedac('0x1e')](_0x5d7c31[_0xedac('0x1f')]);if(_0x5d7c31[_0xedac('0x20')]){delete _0x5d7c31[_0xedac('0x20')];}_0x6b13ca[_0xedac('0x15')](_0x167d7e)[_0xedac('0x21')](_0x5d7c31);};}exports[_0xedac('0x22')]=function(_0x26c6f7,_0x409825){var _0x4663c0={},_0x4c5566={},_0x25d7f5={'count':0x0,'rows':[]};var _0xf0a2ce=db[_0xedac('0x23')]['rawAttributes'];_0x4c5566[_0xedac('0x24')]=_['keys'](_0xf0a2ce);_0x4c5566['query']=_[_0xedac('0x25')](_0x26c6f7[_0xedac('0x26')]);_0x4c5566[_0xedac('0x27')]=_[_0xedac('0x28')](_0x4c5566['model'],_0x4c5566['query']);_0x4c5566[_0xedac('0x27')]=_[_0xedac('0x29')](_0x4c5566[_0xedac('0x27')],[_0xedac('0x2a'),_0xedac('0x2b'),_0xedac('0x2c'),_0xedac('0x2d'),'$lt',_0xedac('0x2e'),_0xedac('0x2f'),_0xedac('0x30'),'$not',_0xedac('0x31'),_0xedac('0x32'),'$in',_0xedac('0x33'),_0xedac('0x34'),'$notLike',_0xedac('0x35'),_0xedac('0x36'),_0xedac('0x34'),_0xedac('0x37'),_0xedac('0x38'),_0xedac('0x39'),_0xedac('0x3a')]);_0x4663c0[_0xedac('0x3b')]=_[_0xedac('0x28')](_0x4c5566[_0xedac('0x24')],qs['fields'](_0x26c6f7[_0xedac('0x26')][_0xedac('0x3c')]));_0x4663c0[_0xedac('0x3b')]=_0x4663c0[_0xedac('0x3b')][_0xedac('0x3d')]?_0x4663c0[_0xedac('0x3b')]:_0x4c5566[_0xedac('0x24')];if(!_0x26c6f7[_0xedac('0x26')][_0xedac('0x3e')](_0xedac('0x3f'))){_0x4663c0[_0xedac('0x18')]=qs[_0xedac('0x18')](_0x26c6f7[_0xedac('0x26')][_0xedac('0x18')]);_0x4663c0[_0xedac('0x17')]=qs['offset'](_0x26c6f7[_0xedac('0x26')][_0xedac('0x17')]);}_0x4663c0[_0xedac('0x40')]=qs[_0xedac('0x41')](_0x26c6f7['query'][_0xedac('0x41')]);_0x4663c0[_0xedac('0x42')]=qs[_0xedac('0x27')](_['pick'](_0x26c6f7[_0xedac('0x26')],_0x4c5566[_0xedac('0x27')]));if(_0x26c6f7[_0xedac('0x26')]['filter']){_0x4663c0[_0xedac('0x42')]=_[_0xedac('0x43')](_0x4663c0['where'],{'$or':_[_0xedac('0x44')](_0xf0a2ce,function(_0x2fa832){if(_0x2fa832['type'][_0xedac('0x45')]!=='VIRTUAL'){var _0x18c114={};_0x18c114[_0x2fa832[_0xedac('0x46')]]={'$like':'%'+_0x26c6f7[_0xedac('0x26')][_0xedac('0x47')]+'%'};return _0x18c114;}})});}_0x4663c0=_[_0xedac('0x43')]({},_0x4663c0,_0x26c6f7[_0xedac('0x48')]);var _0x5030a9={'where':_0x4663c0[_0xedac('0x42')]};return db[_0xedac('0x23')][_0xedac('0x49')](_0x5030a9)[_0xedac('0x1d')](function(_0x2e7d89){_0x25d7f5[_0xedac('0x49')]=_0x2e7d89;if(_0x26c6f7[_0xedac('0x26')][_0xedac('0x4a')]){_0x4663c0[_0xedac('0x4b')]=[{'all':!![]}];}return db[_0xedac('0x23')][_0xedac('0x4c')](_0x4663c0);})[_0xedac('0x1d')](function(_0x75a57a){_0x25d7f5[_0xedac('0x4d')]=_0x75a57a;return _0x25d7f5;})[_0xedac('0x1d')](respondWithFilteredResult(_0x409825,_0x4663c0))[_0xedac('0x4e')](handleError(_0x409825,null));};exports['show']=function(_0x2fb637,_0x3989f5){var _0x144ff7={'raw':!![],'where':{'id':_0x2fb637['params']['id']}},_0x4d2de3={};_0x4d2de3['model']=_[_0xedac('0x25')](db[_0xedac('0x23')]['rawAttributes']);_0x4d2de3[_0xedac('0x26')]=_['keys'](_0x2fb637[_0xedac('0x26')]);_0x4d2de3['filters']=_[_0xedac('0x28')](_0x4d2de3[_0xedac('0x24')],_0x4d2de3[_0xedac('0x26')]);_0x144ff7[_0xedac('0x3b')]=_[_0xedac('0x28')](_0x4d2de3['model'],qs['fields'](_0x2fb637[_0xedac('0x26')]['fields']));_0x144ff7[_0xedac('0x3b')]=_0x144ff7[_0xedac('0x3b')][_0xedac('0x3d')]?_0x144ff7['attributes']:_0x4d2de3[_0xedac('0x24')];if(_0x2fb637[_0xedac('0x26')][_0xedac('0x4a')]){_0x144ff7['include']=[{'all':!![]}];}_0x144ff7=_[_0xedac('0x43')]({},_0x144ff7,_0x2fb637[_0xedac('0x48')]);return db[_0xedac('0x23')]['find'](_0x144ff7)['then'](handleEntityNotFound(_0x3989f5,null))[_0xedac('0x1d')](respondWithResult(_0x3989f5,null))[_0xedac('0x4e')](handleError(_0x3989f5,null));};exports['create']=function(_0x5a6fc4,_0x3338de){return db[_0xedac('0x23')]['create'](_0x5a6fc4[_0xedac('0x4f')],{})['then'](respondWithResult(_0x3338de,0xc9))[_0xedac('0x4e')](handleError(_0x3338de,null));};exports[_0xedac('0x1c')]=function(_0x368aeb,_0x104842){if(_0x368aeb[_0xedac('0x4f')]['id']){delete _0x368aeb[_0xedac('0x4f')]['id'];}return db['CmHopper'][_0xedac('0x50')]({'where':{'id':_0x368aeb[_0xedac('0x51')]['id']}})['then'](handleEntityNotFound(_0x104842,null))[_0xedac('0x1d')](saveUpdates(_0x368aeb[_0xedac('0x4f')],null))[_0xedac('0x1d')](respondWithResult(_0x104842,null))['catch'](handleError(_0x104842,null));};exports['describe']=function(_0xe016d4,_0x3b8153){return db['CmHopper'][_0xedac('0x52')]()[_0xedac('0x1d')](respondWithResult(_0x3b8153,null))[_0xedac('0x4e')](handleError(_0x3b8153,null));};exports[_0xedac('0x53')]=function(_0x584beb,_0x3dbcff){var _0x22c793;return db[_0xedac('0x23')]['find']({'where':{'id':_0x584beb['params']['id']}})[_0xedac('0x1d')](handleEntityNotFound(_0x3dbcff,null))[_0xedac('0x1d')](function(_0x44a7c0){if(_0x44a7c0){return _0x44a7c0['destroy']()[_0xedac('0x1d')](function(_0x2af1aa){return _0x2af1aa;});}})['then'](function(_0x4f44e){_0x22c793=_0x4f44e;if(_0x4f44e){if(_0x4f44e[_0xedac('0x54')]||_0x4f44e['CampaignId']){return db[_0x4f44e['VoiceQueueId']?'VoiceQueue':_0xedac('0x55')]['find']({'where':{'id':_0x4f44e[_0xedac('0x54')]?_0x4f44e['VoiceQueueId']:_0x4f44e['CampaignId']},'attributes':['id',_0xedac('0x20')],'raw':!![]});}}})[_0xedac('0x1d')](function(_0xf67603){var _0x35b046={};if(_0xf67603){_[_0xedac('0x43')](_0x35b046,_['omit'](_0x22c793[_0xedac('0x56')],['createdAt',_0xedac('0x57'),'id']));_0x35b046[_0xedac('0x58')]=0x15;_0x35b046[_0xedac('0x59')]=_0xedac('0x5a');_0x35b046[_0xedac('0x5b')]=_0xf67603[_0xedac('0x20')];_0x35b046[_0xedac('0x5c')]=_0x584beb['user'][_0xedac('0x20')];_0x35b046[_0xedac('0x5d')]=_0x584beb[_0xedac('0x5e')]['id'];_0x35b046[_0xedac('0x5a')]=!![];_0x35b046[_0xedac('0x5f')]=moment()[_0xedac('0x60')](_0xedac('0x61'));_0x35b046[_0xedac('0x62')]=_0x22c793[_0xedac('0x63')];_0x35b046[_0xedac('0x64')]=_0x22c793['VoiceQueueId']?'queue':_0xedac('0x65');return db[_0xedac('0x66')][_0xedac('0x50')]({'where':{'id':_0x35b046[_0xedac('0x67')]},'attributes':[_0xedac('0x68'),'lastName']})[_0xedac('0x1d')](function(_0x4ac8b0){if(!_[_0xedac('0x69')](_0x3dbcff)&&!_[_0xedac('0x69')](_0x4ac8b0['firstName'])){_0x35b046['calleridname']=_0x4ac8b0['firstName'];if(!_[_0xedac('0x69')](_0x4ac8b0[_0xedac('0x6a')])){_0x35b046[_0xedac('0x6b')]+='\x20'+_0x4ac8b0[_0xedac('0x6a')];}}})[_0xedac('0x6c')](function(){return db[_0xedac('0x6d')][_0xedac('0x6e')](_0x35b046);});}})[_0xedac('0x1d')](function(){return _0x3dbcff[_0xedac('0x15')](0xcc)[_0xedac('0x16')]();})['catch'](handleError(_0x3dbcff,null));};exports[_0xedac('0x6f')]=function(_0x30f8ca,_0x4b1299,_0x3b8d23){var _0x347461=[];return db[_0xedac('0x66')][_0xedac('0x52')]()[_0xedac('0x1d')](function(_0x122850){_0x347461=_[_0xedac('0x25')](_0x122850);return _0x30f8ca[_0xedac('0x5e')][_0xedac('0x70')]({'where':{'type':_0xedac('0x71'),'dialActive':!![],'dialMethod':_0xedac('0x72')},'attributes':['id',_0xedac('0x73')],'raw':!![]});})[_0xedac('0x1d')](function(_0x3a1d68){if(_0x3a1d68&&_0x3a1d68[_0xedac('0x3d')]){return db[_0xedac('0x74')][_0xedac('0x75')](function(_0x20cc00){var _0x493214={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xedac('0x60')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xedac('0x44')](_0x3a1d68,'id')},'$or':[{'UserId':null},{'UserId':_0x30f8ca['user']['id']}]};var _0x2380ee=[];if(_0x30f8ca[_0xedac('0x4f')][_0xedac('0x76')]&&_0x30f8ca[_0xedac('0x4f')][_0xedac('0x76')]===_0xedac('0x77')){if(!_['isEmpty'](_0x30f8ca[_0xedac('0x4f')][_0xedac('0x78')])){_0x493214['id']={'$in':_0x30f8ca[_0xedac('0x4f')][_0xedac('0x78')]};}_0x2380ee=[[_0xedac('0x79'),_0xedac('0x7a')],['scheduledAt',_0x3a1d68[0x0][_0xedac('0x73')]==='ASC'?_0xedac('0x7b'):_0xedac('0x7a')],db[_0xedac('0x74')]['literal'](_0xedac('0x7c')),['id','DESC']];}else{if(!_['isEmpty'](_0x30f8ca[_0xedac('0x4f')][_0xedac('0x78')])){_0x493214['id']={'$notIn':_0x30f8ca[_0xedac('0x4f')][_0xedac('0x78')]};}_0x2380ee=[[_0xedac('0x79'),'DESC'],[_0xedac('0x7d'),_0x3a1d68[0x0]['dialOrderByScheduledAt']],db[_0xedac('0x74')][_0xedac('0x7e')](_0xedac('0x7f')),['id',_0xedac('0x7a')]];}return db[_0xedac('0x23')][_0xedac('0x80')]({'attributes':['id','scheduledat'],'where':_0x493214,'order':_0x2380ee,'transaction':_0x20cc00,'lock':_0x20cc00[_0xedac('0x81')][_0xedac('0x82')],'include':[{'model':db[_0xedac('0x66')],'as':_0xedac('0x83'),'attributes':_0x347461,'include':[{'model':db[_0xedac('0x84')],'as':_0xedac('0x85'),'attributes':['id',_0xedac('0x20')]}]},{'model':db[_0xedac('0x86')],'as':_0xedac('0x87'),'attributes':['id',_0xedac('0x20')]},{'model':db[_0xedac('0x88')],'as':_0xedac('0x89'),'attributes':['id','name',_0xedac('0x8a')]}]})['then'](function(_0x5cba66){if(_0x5cba66){return _0x5cba66[_0xedac('0x1c')]({'UserId':_0x30f8ca['user']['id']},{'transaction':_0x20cc00});}});});}})[_0xedac('0x1d')](handleEntityNotFound(_0x4b1299,null))[_0xedac('0x1d')](respondWithResult(_0x4b1299,null))['catch'](handleError(_0x4b1299,null));};exports[_0xedac('0x8b')]=function(_0x53d008,_0x48832e,_0x51d88b){return _0x53d008[_0xedac('0x5e')]['getVoiceQueues']({'where':{'type':_0xedac('0x71'),'dialActive':!![],'dialMethod':_0xedac('0x72')},'attributes':['id'],'raw':!![]})['then'](function(_0x1dfc0b){if(_0x1dfc0b&&_0x1dfc0b['length']){return db[_0xedac('0x23')][_0xedac('0x49')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xedac('0x60')](_0xedac('0x61'))},'VoiceQueueId':{'$in':_[_0xedac('0x44')](_0x1dfc0b,'id')},'$or':[{'UserId':null},{'UserId':_0x53d008['user']['id']}]}});}return 0x0;})[_0xedac('0x1d')](function(_0x4a0223){if(!_[_0xedac('0x69')](_0x4a0223)&&_[_0xedac('0x8c')](_0x4a0223)){return _0x48832e[_0xedac('0x15')](0xc8)[_0xedac('0x19')]({'contacts':_0x4a0223});}else{logger[_0xedac('0x1e')](_0xedac('0x8d'),'getOpenContacts',0x194,_0xedac('0x8e'));_0x48832e[_0xedac('0x14')](0x194);}})['catch'](handleError(_0x48832e,null));}; \ No newline at end of file +var _0x4c4e=['merge','options','CmHopper','includeAll','findAll','rows','show','params','length','include','find','catch','create','body','describe','VoiceQueueId','CampaignId','Campaign','dataValues','deleted','campaign','membername','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','direction','prev','isEmpty','hopperIds','ASC','scheduledAt','DESC','literal','priority','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','LOCK','Contact','CmList','List','VoiceQueue','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','index','rawAttributes','model','keys','query','intersection','filters','$and','$or','$gt','$lte','$ne','$not','$between','$notBetween','$notIn','$notLike','$iLike','$notILike','$like','$overlap','$contains','$contained','$any','attributes','fields','nolimit','order','sort','where','filter','map','type','key','VIRTUAL','field'];(function(_0x3db4e7,_0xc2e177){var _0x156c33=function(_0x3ede98){while(--_0x3ede98){_0x3db4e7['push'](_0x3db4e7['shift']());}};_0x156c33(++_0xc2e177);}(_0x4c4e,0x152));var _0xe4c4=function(_0x59230e,_0x31c395){_0x59230e=_0x59230e-0x0;var _0x316550=_0x4c4e[_0x59230e];return _0x316550;};'use strict';var pdf=require(_0xe4c4('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe4c4('0x1'));var zipdir=require(_0xe4c4('0x2'));var jsonpatch=require(_0xe4c4('0x3'));var rp=require('request-promise');var moment=require(_0xe4c4('0x4'));var BPromise=require(_0xe4c4('0x5'));var Mustache=require(_0xe4c4('0x6'));var util=require('util');var path=require(_0xe4c4('0x7'));var sox=require('sox');var csv=require(_0xe4c4('0x8'));var ejs=require(_0xe4c4('0x9'));var fs=require('fs');var _=require(_0xe4c4('0xa'));var squel=require(_0xe4c4('0xb'));var crypto=require(_0xe4c4('0xc'));var jsforce=require(_0xe4c4('0xd'));var deskjs=require(_0xe4c4('0xe'));var toCsv=require(_0xe4c4('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe4c4('0xf'));var authService=require(_0xe4c4('0x10'));var qs=require(_0xe4c4('0x11'));var hardwareService=require(_0xe4c4('0x12'));var logger=require(_0xe4c4('0x13'))(_0xe4c4('0x14'));var utils=require('../../config/utils');var config=require(_0xe4c4('0x15'));var db=require(_0xe4c4('0x16'))['db'];function respondWithStatusCode(_0x3805c5,_0x2483d0){_0x2483d0=_0x2483d0||0xcc;return function(_0x50bfab){if(_0x50bfab){return _0x3805c5[_0xe4c4('0x17')](_0x2483d0);}return _0x3805c5[_0xe4c4('0x18')](_0x2483d0)['end']();};}function respondWithResult(_0xe485ca,_0x1a44e5){_0x1a44e5=_0x1a44e5||0xc8;return function(_0x5aa89b){if(_0x5aa89b){return _0xe485ca[_0xe4c4('0x18')](_0x1a44e5)[_0xe4c4('0x19')](_0x5aa89b);}};}function respondWithFilteredResult(_0x5e263c,_0x307aa8){return function(_0x465c9b){if(_0x465c9b){var _0x26ea05=_0x465c9b[_0xe4c4('0x1a')],_0x40a36e=_0x307aa8[_0xe4c4('0x1b')],_0x19e59b=_0x307aa8[_0xe4c4('0x1b')]+_0x307aa8[_0xe4c4('0x1c')],_0x882be2;if(_0x19e59b>=_0x26ea05){_0x19e59b=_0x26ea05;_0x882be2=0xc8;}else{_0x882be2=0xce;}_0x5e263c[_0xe4c4('0x18')](_0x882be2);return _0x5e263c[_0xe4c4('0x1d')](_0xe4c4('0x1e'),_0x40a36e+'-'+_0x19e59b+'/'+_0x26ea05)[_0xe4c4('0x19')](_0x465c9b);}return null;};}function patchUpdates(_0x376585){return function(_0x5a32b5){try{jsonpatch[_0xe4c4('0x1f')](_0x5a32b5,_0x376585,!![]);}catch(_0x24f946){return BPromise[_0xe4c4('0x20')](_0x24f946);}return _0x5a32b5[_0xe4c4('0x21')]();};}function saveUpdates(_0x5da165,_0x3d5856){return function(_0x1cad5d){if(_0x1cad5d){return _0x1cad5d[_0xe4c4('0x22')](_0x5da165)[_0xe4c4('0x23')](function(_0x2c5aea){return _0x2c5aea;});}return null;};}function removeEntity(_0x435940,_0x1d4597){return function(_0x393c96){if(_0x393c96){return _0x393c96[_0xe4c4('0x24')]()[_0xe4c4('0x23')](function(){_0x435940[_0xe4c4('0x18')](0xcc)[_0xe4c4('0x25')]();});}};}function handleEntityNotFound(_0x138ead,_0x1db719){return function(_0x15873e){if(!_0x15873e){_0x138ead['sendStatus'](0x194);}return _0x15873e;};}function handleError(_0x49cadc,_0x403a2c){_0x403a2c=_0x403a2c||0x1f4;return function(_0x4dc8cc){logger[_0xe4c4('0x26')](_0x4dc8cc['stack']);if(_0x4dc8cc[_0xe4c4('0x27')]){delete _0x4dc8cc['name'];}_0x49cadc[_0xe4c4('0x18')](_0x403a2c)['send'](_0x4dc8cc);};}exports[_0xe4c4('0x28')]=function(_0x4a0199,_0x5a2adb){var _0x4cea1f={},_0x5d66ab={},_0x3221cd={'count':0x0,'rows':[]};var _0x48cfe0=db['CmHopper'][_0xe4c4('0x29')];_0x5d66ab[_0xe4c4('0x2a')]=_['keys'](_0x48cfe0);_0x5d66ab['query']=_[_0xe4c4('0x2b')](_0x4a0199[_0xe4c4('0x2c')]);_0x5d66ab['filters']=_[_0xe4c4('0x2d')](_0x5d66ab[_0xe4c4('0x2a')],_0x5d66ab[_0xe4c4('0x2c')]);_0x5d66ab['filters']=_['concat'](_0x5d66ab[_0xe4c4('0x2e')],[_0xe4c4('0x2f'),_0xe4c4('0x30'),_0xe4c4('0x31'),'$gte','$lt',_0xe4c4('0x32'),_0xe4c4('0x33'),'$eq',_0xe4c4('0x34'),_0xe4c4('0x35'),_0xe4c4('0x36'),'$in',_0xe4c4('0x37'),'$like',_0xe4c4('0x38'),_0xe4c4('0x39'),_0xe4c4('0x3a'),_0xe4c4('0x3b'),_0xe4c4('0x3c'),_0xe4c4('0x3d'),_0xe4c4('0x3e'),_0xe4c4('0x3f')]);_0x4cea1f[_0xe4c4('0x40')]=_[_0xe4c4('0x2d')](_0x5d66ab[_0xe4c4('0x2a')],qs[_0xe4c4('0x41')](_0x4a0199['query'][_0xe4c4('0x41')]));_0x4cea1f[_0xe4c4('0x40')]=_0x4cea1f[_0xe4c4('0x40')]['length']?_0x4cea1f[_0xe4c4('0x40')]:_0x5d66ab[_0xe4c4('0x2a')];if(!_0x4a0199[_0xe4c4('0x2c')]['hasOwnProperty'](_0xe4c4('0x42'))){_0x4cea1f[_0xe4c4('0x1c')]=qs[_0xe4c4('0x1c')](_0x4a0199[_0xe4c4('0x2c')][_0xe4c4('0x1c')]);_0x4cea1f[_0xe4c4('0x1b')]=qs[_0xe4c4('0x1b')](_0x4a0199[_0xe4c4('0x2c')][_0xe4c4('0x1b')]);}_0x4cea1f[_0xe4c4('0x43')]=qs['sort'](_0x4a0199[_0xe4c4('0x2c')][_0xe4c4('0x44')]);_0x4cea1f[_0xe4c4('0x45')]=qs[_0xe4c4('0x2e')](_['pick'](_0x4a0199[_0xe4c4('0x2c')],_0x5d66ab[_0xe4c4('0x2e')]));if(_0x4a0199['query'][_0xe4c4('0x46')]){_0x4cea1f[_0xe4c4('0x45')]=_['merge'](_0x4cea1f[_0xe4c4('0x45')],{'$or':_[_0xe4c4('0x47')](_0x48cfe0,function(_0x127bcd){if(_0x127bcd[_0xe4c4('0x48')][_0xe4c4('0x49')]!==_0xe4c4('0x4a')){var _0x96dd48={};_0x96dd48[_0x127bcd[_0xe4c4('0x4b')]]={'$like':'%'+_0x4a0199[_0xe4c4('0x2c')][_0xe4c4('0x46')]+'%'};return _0x96dd48;}})});}_0x4cea1f=_[_0xe4c4('0x4c')]({},_0x4cea1f,_0x4a0199[_0xe4c4('0x4d')]);var _0x4839ab={'where':_0x4cea1f[_0xe4c4('0x45')]};return db[_0xe4c4('0x4e')][_0xe4c4('0x1a')](_0x4839ab)[_0xe4c4('0x23')](function(_0x260141){_0x3221cd[_0xe4c4('0x1a')]=_0x260141;if(_0x4a0199['query'][_0xe4c4('0x4f')]){_0x4cea1f['include']=[{'all':!![]}];}return db[_0xe4c4('0x4e')][_0xe4c4('0x50')](_0x4cea1f);})[_0xe4c4('0x23')](function(_0x369c25){_0x3221cd[_0xe4c4('0x51')]=_0x369c25;return _0x3221cd;})['then'](respondWithFilteredResult(_0x5a2adb,_0x4cea1f))['catch'](handleError(_0x5a2adb,null));};exports[_0xe4c4('0x52')]=function(_0x41bd7a,_0x5aeded){var _0x5ab715={'raw':!![],'where':{'id':_0x41bd7a[_0xe4c4('0x53')]['id']}},_0xaa4bdf={};_0xaa4bdf[_0xe4c4('0x2a')]=_[_0xe4c4('0x2b')](db['CmHopper'][_0xe4c4('0x29')]);_0xaa4bdf[_0xe4c4('0x2c')]=_[_0xe4c4('0x2b')](_0x41bd7a[_0xe4c4('0x2c')]);_0xaa4bdf[_0xe4c4('0x2e')]=_[_0xe4c4('0x2d')](_0xaa4bdf[_0xe4c4('0x2a')],_0xaa4bdf[_0xe4c4('0x2c')]);_0x5ab715[_0xe4c4('0x40')]=_['intersection'](_0xaa4bdf[_0xe4c4('0x2a')],qs['fields'](_0x41bd7a[_0xe4c4('0x2c')][_0xe4c4('0x41')]));_0x5ab715[_0xe4c4('0x40')]=_0x5ab715[_0xe4c4('0x40')][_0xe4c4('0x54')]?_0x5ab715[_0xe4c4('0x40')]:_0xaa4bdf[_0xe4c4('0x2a')];if(_0x41bd7a[_0xe4c4('0x2c')][_0xe4c4('0x4f')]){_0x5ab715[_0xe4c4('0x55')]=[{'all':!![]}];}_0x5ab715=_[_0xe4c4('0x4c')]({},_0x5ab715,_0x41bd7a[_0xe4c4('0x4d')]);return db[_0xe4c4('0x4e')][_0xe4c4('0x56')](_0x5ab715)['then'](handleEntityNotFound(_0x5aeded,null))['then'](respondWithResult(_0x5aeded,null))[_0xe4c4('0x57')](handleError(_0x5aeded,null));};exports[_0xe4c4('0x58')]=function(_0x53fa99,_0x25f08b){return db[_0xe4c4('0x4e')][_0xe4c4('0x58')](_0x53fa99[_0xe4c4('0x59')],{})[_0xe4c4('0x23')](respondWithResult(_0x25f08b,0xc9))['catch'](handleError(_0x25f08b,null));};exports[_0xe4c4('0x22')]=function(_0x2ed1a5,_0x4f6e03){if(_0x2ed1a5[_0xe4c4('0x59')]['id']){delete _0x2ed1a5[_0xe4c4('0x59')]['id'];}return db['CmHopper'][_0xe4c4('0x56')]({'where':{'id':_0x2ed1a5['params']['id']}})[_0xe4c4('0x23')](handleEntityNotFound(_0x4f6e03,null))[_0xe4c4('0x23')](saveUpdates(_0x2ed1a5[_0xe4c4('0x59')],null))[_0xe4c4('0x23')](respondWithResult(_0x4f6e03,null))[_0xe4c4('0x57')](handleError(_0x4f6e03,null));};exports['describe']=function(_0x1c8b2e,_0x4284ec){return db[_0xe4c4('0x4e')][_0xe4c4('0x5a')]()[_0xe4c4('0x23')](respondWithResult(_0x4284ec,null))[_0xe4c4('0x57')](handleError(_0x4284ec,null));};exports[_0xe4c4('0x24')]=function(_0x3aa205,_0x1a96ba){var _0x3ccdca;return db[_0xe4c4('0x4e')][_0xe4c4('0x56')]({'where':{'id':_0x3aa205[_0xe4c4('0x53')]['id']}})[_0xe4c4('0x23')](handleEntityNotFound(_0x1a96ba,null))[_0xe4c4('0x23')](function(_0x338cf5){if(_0x338cf5){return _0x338cf5['destroy']()[_0xe4c4('0x23')](function(_0x4a2ae9){return _0x4a2ae9;});}})[_0xe4c4('0x23')](function(_0x4ad6ac){_0x3ccdca=_0x4ad6ac;if(_0x4ad6ac){if(_0x4ad6ac[_0xe4c4('0x5b')]||_0x4ad6ac[_0xe4c4('0x5c')]){return db[_0x4ad6ac[_0xe4c4('0x5b')]?'VoiceQueue':_0xe4c4('0x5d')]['find']({'where':{'id':_0x4ad6ac[_0xe4c4('0x5b')]?_0x4ad6ac[_0xe4c4('0x5b')]:_0x4ad6ac[_0xe4c4('0x5c')]},'attributes':['id','name'],'raw':!![]});}}})['then'](function(_0x461d02){var _0x7d4896={};if(_0x461d02){_[_0xe4c4('0x4c')](_0x7d4896,_['omit'](_0x3ccdca[_0xe4c4('0x5e')],['createdAt','updatedAt','id']));_0x7d4896['state']=0x15;_0x7d4896['statedesc']=_0xe4c4('0x5f');_0x7d4896[_0xe4c4('0x60')]=_0x461d02[_0xe4c4('0x27')];_0x7d4896[_0xe4c4('0x61')]=_0x3aa205[_0xe4c4('0x62')][_0xe4c4('0x27')];_0x7d4896['UserId']=_0x3aa205[_0xe4c4('0x62')]['id'];_0x7d4896[_0xe4c4('0x5f')]=!![];_0x7d4896[_0xe4c4('0x63')]=moment()[_0xe4c4('0x64')](_0xe4c4('0x65'));_0x7d4896[_0xe4c4('0x66')]=_0x3ccdca['phone'];_0x7d4896['campaigntype']=_0x3ccdca[_0xe4c4('0x5b')]?_0xe4c4('0x67'):_0xe4c4('0x68');return db[_0xe4c4('0x69')][_0xe4c4('0x56')]({'where':{'id':_0x7d4896[_0xe4c4('0x6a')]},'attributes':[_0xe4c4('0x6b'),_0xe4c4('0x6c')]})[_0xe4c4('0x23')](function(_0x5a0cbd){if(!_['isNil'](_0x1a96ba)&&!_[_0xe4c4('0x6d')](_0x5a0cbd['firstName'])){_0x7d4896[_0xe4c4('0x6e')]=_0x5a0cbd[_0xe4c4('0x6b')];if(!_[_0xe4c4('0x6d')](_0x5a0cbd['lastName'])){_0x7d4896[_0xe4c4('0x6e')]+='\x20'+_0x5a0cbd['lastName'];}}})[_0xe4c4('0x6f')](function(){return db['CmHopperFinal']['create'](_0x7d4896);});}})[_0xe4c4('0x23')](function(){return _0x1a96ba[_0xe4c4('0x18')](0xcc)[_0xe4c4('0x25')]();})['catch'](handleError(_0x1a96ba,null));};exports['getPreview']=function(_0x4879f9,_0x1f91f4,_0x2fad86){var _0x57aca0=[];return db[_0xe4c4('0x69')][_0xe4c4('0x5a')]()[_0xe4c4('0x23')](function(_0x5c389b){_0x57aca0=_['keys'](_0x5c389b);return _0x4879f9[_0xe4c4('0x62')][_0xe4c4('0x70')]({'where':{'type':_0xe4c4('0x71'),'dialActive':!![],'dialMethod':_0xe4c4('0x72')},'attributes':['id',_0xe4c4('0x73')],'raw':!![]});})[_0xe4c4('0x23')](function(_0x4b9879){if(_0x4b9879&&_0x4b9879[_0xe4c4('0x54')]){return db[_0xe4c4('0x74')][_0xe4c4('0x75')](function(_0x55be06){var _0x1e1f55={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xe4c4('0x64')](_0xe4c4('0x65'))},'VoiceQueueId':{'$in':_['map'](_0x4b9879,'id')},'$or':[{'UserId':null},{'UserId':_0x4879f9['user']['id']}]};var _0x2043a8=[];if(_0x4879f9['body']['direction']&&_0x4879f9[_0xe4c4('0x59')][_0xe4c4('0x76')]===_0xe4c4('0x77')){if(!_[_0xe4c4('0x78')](_0x4879f9[_0xe4c4('0x59')][_0xe4c4('0x79')])){_0x1e1f55['id']={'$in':_0x4879f9[_0xe4c4('0x59')][_0xe4c4('0x79')]};}_0x2043a8=[['priority',_0xe4c4('0x7a')],[_0xe4c4('0x7b'),_0x4b9879[0x0]['dialOrderByScheduledAt']==='ASC'?_0xe4c4('0x7c'):_0xe4c4('0x7a')],db[_0xe4c4('0x74')][_0xe4c4('0x7d')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0xe4c4('0x7c')]];}else{if(!_[_0xe4c4('0x78')](_0x4879f9[_0xe4c4('0x59')]['hopperIds'])){_0x1e1f55['id']={'$notIn':_0x4879f9['body'][_0xe4c4('0x79')]};}_0x2043a8=[[_0xe4c4('0x7e'),_0xe4c4('0x7c')],[_0xe4c4('0x7b'),_0x4b9879[0x0]['dialOrderByScheduledAt']],db['sequelize'][_0xe4c4('0x7d')](_0xe4c4('0x7f')),['id',_0xe4c4('0x7a')]];}return db[_0xe4c4('0x4e')][_0xe4c4('0x80')]({'attributes':['id','scheduledat'],'where':_0x1e1f55,'order':_0x2043a8,'transaction':_0x55be06,'lock':_0x55be06[_0xe4c4('0x81')]['UPDATE'],'include':[{'model':db[_0xe4c4('0x69')],'as':_0xe4c4('0x82'),'attributes':_0x57aca0,'include':[{'model':db['CmCompany'],'as':'Company','attributes':['id',_0xe4c4('0x27')]}]},{'model':db[_0xe4c4('0x83')],'as':_0xe4c4('0x84'),'attributes':['id',_0xe4c4('0x27')]},{'model':db[_0xe4c4('0x85')],'as':'Queue','attributes':['id','name','dialActive']}]})[_0xe4c4('0x23')](function(_0x3285f4){if(_0x3285f4){return _0x3285f4['update']({'UserId':_0x4879f9[_0xe4c4('0x62')]['id']},{'transaction':_0x55be06});}});});}})[_0xe4c4('0x23')](handleEntityNotFound(_0x1f91f4,null))[_0xe4c4('0x23')](respondWithResult(_0x1f91f4,null))[_0xe4c4('0x57')](handleError(_0x1f91f4,null));};exports['getOpenContacts']=function(_0x5ca600,_0x26d34d,_0x32f019){return _0x5ca600[_0xe4c4('0x62')][_0xe4c4('0x70')]({'where':{'type':_0xe4c4('0x71'),'dialActive':!![],'dialMethod':_0xe4c4('0x72')},'attributes':['id'],'raw':!![]})[_0xe4c4('0x23')](function(_0x4ab66d){if(_0x4ab66d&&_0x4ab66d[_0xe4c4('0x54')]){return db[_0xe4c4('0x4e')][_0xe4c4('0x1a')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xe4c4('0x64')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xe4c4('0x47')](_0x4ab66d,'id')},'$or':[{'UserId':null},{'UserId':_0x5ca600[_0xe4c4('0x62')]['id']}]}});}return 0x0;})[_0xe4c4('0x23')](function(_0x4647bb){if(!_['isNil'](_0x4647bb)&&_[_0xe4c4('0x86')](_0x4647bb)){return _0x26d34d[_0xe4c4('0x18')](0xc8)['json']({'contacts':_0x4647bb});}else{logger['error'](_0xe4c4('0x87'),_0xe4c4('0x88'),0x194,_0xe4c4('0x89'));_0x26d34d[_0xe4c4('0x17')](0x194);}})[_0xe4c4('0x57')](handleError(_0x26d34d,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 07b664c..b6cf28e 100644 --- a/server/api/cmHopper/cmHopper.model.js +++ b/server/api/cmHopper/cmHopper.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c00=['path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','moment','bluebird'];(function(_0x2b5560,_0x4c7515){var _0x5200fa=function(_0x40bcc1){while(--_0x40bcc1){_0x2b5560['push'](_0x2b5560['shift']());}};_0x5200fa(++_0x4c7515);}(_0x9c00,0x1a0));var _0x09c0=function(_0x8261bb,_0x48e718){_0x8261bb=_0x8261bb-0x0;var _0x530867=_0x9c00[_0x8261bb];return _0x530867;};'use strict';var _=require(_0x09c0('0x0'));var util=require(_0x09c0('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x09c0('0x2'));var BPromise=require(_0x09c0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x09c0('0x4'));var rimraf=require(_0x09c0('0x5'));var config=require(_0x09c0('0x6'));var attributes=require(_0x09c0('0x7'));module[_0x09c0('0x8')]=function(_0x5914eb,_0x4d5fc3){return _0x5914eb[_0x09c0('0x9')](_0x09c0('0xa'),attributes,{'tableName':_0x09c0('0xb'),'paranoid':![],'indexes':[{'name':_0x09c0('0xc'),'fields':[_0x09c0('0xc')]},{'name':'phone','fields':[_0x09c0('0xd')]},{'name':_0x09c0('0xe'),'fields':[_0x09c0('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xda3f=['CmHopper','cm_hopper','scheduledat','phone','priority','util','../../config/logger','request-promise','rimraf','../../config/environment','exports'];(function(_0x17eb0a,_0x3945ad){var _0x32ce15=function(_0x5c6d7b){while(--_0x5c6d7b){_0x17eb0a['push'](_0x17eb0a['shift']());}};_0x32ce15(++_0x3945ad);}(_0xda3f,0xec));var _0xfda3=function(_0x38869a,_0x5f019b){_0x38869a=_0x38869a-0x0;var _0x453762=_0xda3f[_0x38869a];return _0x453762;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var logger=require(_0xfda3('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfda3('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var attributes=require('./cmHopper.attributes');module[_0xfda3('0x5')]=function(_0x43a010,_0x47e7e2){return _0x43a010['define'](_0xfda3('0x6'),attributes,{'tableName':_0xfda3('0x7'),'paranoid':![],'indexes':[{'name':_0xfda3('0x8'),'fields':[_0xfda3('0x8')]},{'name':_0xfda3('0x9'),'fields':[_0xfda3('0x9')]},{'name':_0xfda3('0xa'),'fields':[_0xfda3('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index c181a5b..fd35061 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 _0x65f3=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','CmHopper,\x20%s,\x20%s','request\x20sent','CmHopper,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetCmHopper','CmHopper','options','raw','where','attributes','map','include','model','debug','stringify','find','ShowCmHopper','CreateCmHopper','UpdateCmHopper','update','limit','DestroyCmHopper','destroy','CmContact','describe','transaction','findAll','order','LOCK','UPDATE','Contact','keys','push','body','all','GetContactDialer','MoveContactManagedDialer','sequelize','CmHopperFinal','create','CountReScheduled','COUNT','`scheduledat`\x20>=\x20','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','UserId','length','util','moment','bluebird'];(function(_0xc7ed33,_0x4650ee){var _0x47e1f1=function(_0xb4a8cb){while(--_0xb4a8cb){_0xc7ed33['push'](_0xc7ed33['shift']());}};_0x47e1f1(++_0x4650ee);}(_0x65f3,0x1cb));var _0x365f=function(_0x525889,_0x136fdc){_0x525889=_0x525889-0x0;var _0x12237d=_0x65f3[_0x525889];return _0x12237d;};'use strict';var _=require('lodash');var util=require(_0x365f('0x0'));var moment=require(_0x365f('0x1'));var BPromise=require(_0x365f('0x2'));var rs=require(_0x365f('0x3'));var fs=require('fs');var Redis=require(_0x365f('0x4'));var db=require(_0x365f('0x5'))['db'];var utils=require(_0x365f('0x6'));var logger=require(_0x365f('0x7'))('rpc');var config=require(_0x365f('0x8'));var jayson=require(_0x365f('0x9'));var client=jayson['client'][_0x365f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x46cebc,_0x53f58f,_0x5ebfdf){return new BPromise(function(_0xf9f5e8,_0x1d64f9){return client['request'](_0x46cebc,_0x5ebfdf)[_0x365f('0xb')](function(_0xec6f10){logger['info'](_0x365f('0xc'),_0x53f58f,_0x365f('0xd'));logger['debug'](_0x365f('0xe'),_0x53f58f,_0x365f('0xd'),JSON['stringify'](_0xec6f10));if(_0xec6f10[_0x365f('0xf')]){if(_0xec6f10[_0x365f('0xf')][_0x365f('0x10')]===0x1f4){logger['error']('CmHopper,\x20%s,\x20%s',_0x53f58f,_0xec6f10[_0x365f('0xf')][_0x365f('0x11')]);return _0x1d64f9(_0xec6f10[_0x365f('0xf')]['message']);}logger[_0x365f('0xf')]('CmHopper,\x20%s,\x20%s',_0x53f58f,_0xec6f10[_0x365f('0xf')][_0x365f('0x11')]);return _0xf9f5e8(_0xec6f10['error']['message']);}else{logger[_0x365f('0x12')](_0x365f('0xc'),_0x53f58f,_0x365f('0xd'));_0xf9f5e8(_0xec6f10[_0x365f('0x13')][_0x365f('0x11')]);}})[_0x365f('0x14')](function(_0x4c3a73){logger['error'](_0x365f('0xc'),_0x53f58f,_0x4c3a73);_0x1d64f9(_0x4c3a73);});});}exports[_0x365f('0x15')]=function(_0x417f49){var _0x27f083=this;return new Promise(function(_0x4ebd7b,_0x94d56b){return db[_0x365f('0x16')]['findAll']({'raw':_0x417f49[_0x365f('0x17')]?_0x417f49[_0x365f('0x17')][_0x365f('0x18')]===undefined?!![]:![]:!![],'where':_0x417f49[_0x365f('0x17')]?_0x417f49['options'][_0x365f('0x19')]||null:null,'attributes':_0x417f49[_0x365f('0x17')]?_0x417f49[_0x365f('0x17')][_0x365f('0x1a')]||null:null,'limit':_0x417f49[_0x365f('0x17')]?_0x417f49['options']['limit']||null:null,'include':_0x417f49[_0x365f('0x17')]?_0x417f49[_0x365f('0x17')]['include']?_[_0x365f('0x1b')](_0x417f49[_0x365f('0x17')]['include'],function(_0x4d2433){return{'model':db[_0x4d2433['model']],'as':_0x4d2433['as'],'attributes':_0x4d2433[_0x365f('0x1a')],'include':_0x4d2433[_0x365f('0x1c')]?_['map'](_0x4d2433[_0x365f('0x1c')],function(_0x3e873c){return{'model':db[_0x3e873c[_0x365f('0x1d')]],'as':_0x3e873c['as'],'attributes':_0x3e873c[_0x365f('0x1a')],'include':_0x3e873c[_0x365f('0x1c')]?_['map'](_0x3e873c[_0x365f('0x1c')],function(_0x399be5){return{'model':db[_0x399be5['model']],'as':_0x399be5['as'],'attributes':_0x399be5[_0x365f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x365f('0xb')](function(_0x2b08b2){logger[_0x365f('0x12')]('GetCmHopper',_0x417f49);logger[_0x365f('0x1e')]('GetCmHopper',_0x417f49,JSON[_0x365f('0x1f')](_0x2b08b2));_0x4ebd7b(_0x2b08b2);})[_0x365f('0x14')](function(_0x48494e){logger[_0x365f('0xf')](_0x365f('0x15'),_0x48494e['message'],_0x417f49);_0x94d56b(_0x27f083[_0x365f('0xf')](0x1f4,_0x48494e['message']));});});};exports['ShowCmHopper']=function(_0x199631){var _0x1898e0=this;return new Promise(function(_0x43f9ff,_0x59b174){return db['CmHopper'][_0x365f('0x20')]({'raw':_0x199631[_0x365f('0x17')]?_0x199631[_0x365f('0x17')][_0x365f('0x18')]===undefined?!![]:![]:!![],'where':_0x199631[_0x365f('0x17')]?_0x199631[_0x365f('0x17')][_0x365f('0x19')]||null:null,'attributes':_0x199631[_0x365f('0x17')]?_0x199631['options'][_0x365f('0x1a')]||null:null,'include':_0x199631[_0x365f('0x17')]?_0x199631['options'][_0x365f('0x1c')]?_[_0x365f('0x1b')](_0x199631[_0x365f('0x17')][_0x365f('0x1c')],function(_0xa55f7){return{'model':db[_0xa55f7[_0x365f('0x1d')]],'as':_0xa55f7['as'],'attributes':_0xa55f7[_0x365f('0x1a')],'include':_0xa55f7[_0x365f('0x1c')]?_['map'](_0xa55f7[_0x365f('0x1c')],function(_0x35f56d){return{'model':db[_0x35f56d[_0x365f('0x1d')]],'as':_0x35f56d['as'],'attributes':_0x35f56d[_0x365f('0x1a')],'include':_0x35f56d['include']?_['map'](_0x35f56d[_0x365f('0x1c')],function(_0x4e233f){return{'model':db[_0x4e233f[_0x365f('0x1d')]],'as':_0x4e233f['as'],'attributes':_0x4e233f[_0x365f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x365f('0xb')](function(_0x1f535b){logger[_0x365f('0x12')]('ShowCmHopper',_0x199631);logger[_0x365f('0x1e')](_0x365f('0x21'),_0x199631,JSON[_0x365f('0x1f')](_0x1f535b));_0x43f9ff(_0x1f535b);})[_0x365f('0x14')](function(_0x33ccab){logger[_0x365f('0xf')]('ShowCmHopper',_0x33ccab[_0x365f('0x11')],_0x199631);_0x59b174(_0x1898e0[_0x365f('0xf')](0x1f4,_0x33ccab[_0x365f('0x11')]));});});};exports[_0x365f('0x22')]=function(_0x15c203){var _0x5e3c83=this;return new Promise(function(_0x3fce89,_0x32503b){return db[_0x365f('0x16')]['create'](_0x15c203['body'],{'raw':_0x15c203[_0x365f('0x17')]?_0x15c203[_0x365f('0x17')][_0x365f('0x18')]===undefined?!![]:![]:!![]})[_0x365f('0xb')](function(_0x378948){logger[_0x365f('0x12')](_0x365f('0x22'),_0x15c203);logger[_0x365f('0x1e')](_0x365f('0x22'),_0x15c203,JSON[_0x365f('0x1f')](_0x378948));_0x3fce89(_0x378948);})[_0x365f('0x14')](function(_0xb1b8e8){logger[_0x365f('0xf')](_0x365f('0x22'),_0xb1b8e8[_0x365f('0x11')],_0x15c203);_0x32503b(_0x5e3c83[_0x365f('0xf')](0x1f4,_0xb1b8e8[_0x365f('0x11')]));});});};exports[_0x365f('0x23')]=function(_0x1e33d4){var _0x2ce8fa=this;return new Promise(function(_0x234b6c,_0x216f41){return db[_0x365f('0x16')][_0x365f('0x24')](_0x1e33d4['body'],{'raw':_0x1e33d4[_0x365f('0x17')]?_0x1e33d4[_0x365f('0x17')][_0x365f('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e33d4[_0x365f('0x17')]?_0x1e33d4[_0x365f('0x17')][_0x365f('0x19')]||null:null,'attributes':_0x1e33d4['options']?_0x1e33d4['options']['attributes']||null:null,'limit':_0x1e33d4[_0x365f('0x17')]?_0x1e33d4[_0x365f('0x17')][_0x365f('0x25')]||null:null})[_0x365f('0xb')](function(_0x50e229){logger[_0x365f('0x12')]('UpdateCmHopper',_0x1e33d4);logger[_0x365f('0x1e')](_0x365f('0x23'),_0x1e33d4,JSON[_0x365f('0x1f')](_0x50e229));_0x234b6c(_0x50e229);})['catch'](function(_0x5bcfd6){logger['error'](_0x365f('0x23'),_0x5bcfd6[_0x365f('0x11')],_0x1e33d4);_0x216f41(_0x2ce8fa[_0x365f('0xf')](0x1f4,_0x5bcfd6['message']));});});};exports[_0x365f('0x26')]=function(_0x46b05b){var _0x4560c5=this;return new Promise(function(_0x5e33e6,_0x44b0d7){return db[_0x365f('0x16')][_0x365f('0x27')]({'where':_0x46b05b[_0x365f('0x17')]?_0x46b05b[_0x365f('0x17')]['where']||null:null})['then'](function(_0x10fae5){logger[_0x365f('0x12')](_0x365f('0x26'),_0x46b05b);logger[_0x365f('0x1e')](_0x365f('0x26'),_0x46b05b,JSON[_0x365f('0x1f')](_0x10fae5));_0x5e33e6(_0x10fae5);})[_0x365f('0x14')](function(_0x43d0fa){logger['error']('DestroyCmHopper',_0x43d0fa['message'],_0x46b05b);_0x44b0d7(_0x4560c5[_0x365f('0xf')](0x1f4,_0x43d0fa[_0x365f('0x11')]));});});};exports['GetContactDialer']=function(_0x349b8c){var _0x33bfbe=this;return new Promise(function(_0x1a5bc3,_0x392be2){return db[_0x365f('0x28')][_0x365f('0x29')]()[_0x365f('0xb')](function(_0x39a45c){return db['sequelize'][_0x365f('0x2a')](function(_0x161263){return db[_0x365f('0x16')][_0x365f('0x2b')]({'where':_0x349b8c['options']?_0x349b8c[_0x365f('0x17')][_0x365f('0x19')]||null:null,'attributes':_0x349b8c[_0x365f('0x17')]?_0x349b8c[_0x365f('0x17')][_0x365f('0x1a')]||null:null,'limit':_0x349b8c[_0x365f('0x17')]?_0x349b8c[_0x365f('0x17')][_0x365f('0x25')]||null:null,'order':_0x349b8c[_0x365f('0x17')]?_0x349b8c[_0x365f('0x17')][_0x365f('0x2c')]||null:null,'transaction':_0x161263,'lock':_0x161263[_0x365f('0x2d')][_0x365f('0x2e')],'include':[{'model':db[_0x365f('0x28')],'as':_0x365f('0x2f'),'attributes':_[_0x365f('0x30')](_0x39a45c)}]})[_0x365f('0xb')](function(_0xf0a6b3){var _0x18eb8a=[];for(var _0x1129e7=0x0;_0x1129e7<_0xf0a6b3['length'];_0x1129e7+=0x1){_0x18eb8a[_0x365f('0x31')](_0xf0a6b3[_0x1129e7]['update'](_0x349b8c[_0x365f('0x32')],{'transaction':_0x161263}));}return BPromise[_0x365f('0x33')](_0x18eb8a);});})[_0x365f('0xb')](function(_0x1d938d){logger[_0x365f('0x12')](_0x365f('0x34'),_0x349b8c);logger[_0x365f('0x1e')](_0x365f('0x34'),_0x349b8c,JSON['stringify'](_0x1d938d));_0x1a5bc3(_0x1d938d);})[_0x365f('0x14')](function(_0x2aecec){logger[_0x365f('0xf')](_0x365f('0x34'),_0x2aecec[_0x365f('0x11')],_0x349b8c);_0x392be2(_0x33bfbe[_0x365f('0xf')](0x1f4,_0x2aecec[_0x365f('0x11')]));});});});};exports[_0x365f('0x35')]=function(_0x57a7ca){var _0x362ae6=this;return new Promise(function(_0x5d5cbf,_0x3ca52a){return db[_0x365f('0x36')]['transaction'](function(_0x3a8d2c){return db[_0x365f('0x37')][_0x365f('0x38')](_0x57a7ca['body'],{'raw':_0x57a7ca['options']?_0x57a7ca[_0x365f('0x17')][_0x365f('0x18')]===undefined?!![]:![]:!![],'transaction':_0x3a8d2c})[_0x365f('0xb')](function(){return db[_0x365f('0x16')]['destroy']({'where':_0x57a7ca[_0x365f('0x17')]?_0x57a7ca[_0x365f('0x17')][_0x365f('0x19')]||null:null,'transaction':_0x3a8d2c});});})[_0x365f('0xb')](function(_0x29d767){logger[_0x365f('0x12')](_0x365f('0x35'),_0x57a7ca);logger['debug']('MoveContactManagedDialer',_0x57a7ca,JSON['stringify'](_0x29d767));_0x5d5cbf(_0x29d767);})['catch'](function(_0x51ae9d){logger[_0x365f('0xf')](_0x365f('0x35'),_0x51ae9d[_0x365f('0x11')],_0x57a7ca);_0x3ca52a(_0x362ae6[_0x365f('0xf')](0x1f4,_0x51ae9d[_0x365f('0x11')]));});});};exports[_0x365f('0x39')]=function(_0x388959){var _0x46669b=this;return new Promise(function(_0x62a83e,_0x2faca9){return db['CmHopper'][_0x365f('0x2b')]({'raw':_0x388959[_0x365f('0x17')]?_0x388959['options'][_0x365f('0x18')]===undefined?!![]:![]:!![],'where':_0x388959[_0x365f('0x17')]?_0x388959[_0x365f('0x17')][_0x365f('0x19')]||null:null,'attributes':[[db[_0x365f('0x36')]['fn'](_0x365f('0x3a'),db['sequelize']['fn']('IF',db[_0x365f('0x36')]['literal'](_0x365f('0x3b')+util['format'](_0x365f('0x3c'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'))+_0x365f('0x3d')))),_0x365f('0x3e')]]})[_0x365f('0xb')](function(_0x1f6169){logger[_0x365f('0x12')](_0x365f('0x39'),_0x388959);logger[_0x365f('0x1e')](_0x365f('0x39'),_0x388959,JSON[_0x365f('0x1f')](_0x1f6169));_0x62a83e(_0x1f6169);})[_0x365f('0x14')](function(_0x57cb77){logger['error'](_0x365f('0x39'),_0x57cb77[_0x365f('0x11')],_0x388959);_0x2faca9(_0x46669b['error'](0x1f4,_0x57cb77[_0x365f('0x11')]));});});};exports[_0x365f('0x3f')]=function(_0x591dc7){var _0x16e0fe=this;return new Promise(function(_0x38e3fa,_0x22c392){return db[_0x365f('0x28')][_0x365f('0x29')]()[_0x365f('0xb')](function(_0x1d453d){return db['sequelize'][_0x365f('0x2a')](function(_0x494dd1){return db['CmHopper'][_0x365f('0x2b')]({'where':_0x591dc7[_0x365f('0x17')]?_0x591dc7[_0x365f('0x17')][_0x365f('0x19')]||null:null,'attributes':_0x591dc7[_0x365f('0x17')]?_0x591dc7[_0x365f('0x17')][_0x365f('0x1a')]||null:null,'limit':0x1,'order':_0x591dc7['options']?_0x591dc7[_0x365f('0x17')][_0x365f('0x2c')]||null:null,'group':db[_0x365f('0x16')][_0x365f('0x40')],'transaction':_0x494dd1,'lock':_0x494dd1['LOCK'][_0x365f('0x2e')],'include':_0x591dc7[_0x365f('0x17')]?_0x591dc7[_0x365f('0x17')][_0x365f('0x1c')]?_[_0x365f('0x1b')](_0x591dc7[_0x365f('0x17')][_0x365f('0x1c')],function(_0x164ccc){return{'model':db[_0x164ccc[_0x365f('0x1d')]],'as':_0x164ccc['as'],'attributes':_0x164ccc[_0x365f('0x1a')],'include':_0x164ccc[_0x365f('0x1c')]?_['map'](_0x164ccc[_0x365f('0x1c')],function(_0x22fb8d){return{'model':db[_0x22fb8d[_0x365f('0x1d')]],'as':_0x22fb8d['as'],'attributes':_0x22fb8d[_0x365f('0x1a')],'include':_0x22fb8d[_0x365f('0x1c')]?_[_0x365f('0x1b')](_0x22fb8d[_0x365f('0x1c')],function(_0x4b9a10){return{'model':db[_0x4b9a10[_0x365f('0x1d')]],'as':_0x4b9a10['as'],'attributes':_0x4b9a10[_0x365f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x365f('0xb')](function(_0x3cbed5){var _0x460177=[];for(var _0x2fd2b3=0x0;_0x2fd2b3<_0x3cbed5[_0x365f('0x41')];_0x2fd2b3+=0x1){_0x460177[_0x365f('0x31')](_0x3cbed5[_0x2fd2b3][_0x365f('0x24')](_0x591dc7['body'],{'transaction':_0x494dd1}));}return BPromise[_0x365f('0x33')](_0x460177);});})[_0x365f('0xb')](function(_0x40bc80){logger[_0x365f('0x12')](_0x365f('0x3f'),_0x591dc7);logger[_0x365f('0x1e')](_0x365f('0x3f'),_0x591dc7,JSON[_0x365f('0x1f')](_0x40bc80));_0x38e3fa(_0x40bc80);})[_0x365f('0x14')](function(_0x5db507){logger[_0x365f('0xf')]('GetContactRecallMe',_0x5db507[_0x365f('0x11')],_0x591dc7);_0x22c392(_0x16e0fe[_0x365f('0xf')](0x1f4,_0x5db507[_0x365f('0x11')]));});});});}; \ No newline at end of file +var _0xc591=['map','model','then','debug','find','ShowCmHopper','CreateCmHopper','create','body','UpdateCmHopper','DestroyCmHopper','GetContactDialer','describe','sequelize','transaction','order','LOCK','UPDATE','Contact','keys','length','all','MoveContactManagedDialer','CmHopperFinal','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','CmContact','UserId','push','update','GetContactRecallMe','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','CmHopper,\x20%s,\x20%s','request\x20sent','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit','include'];(function(_0x53b91f,_0x4aad38){var _0x510dfd=function(_0x240e6c){while(--_0x240e6c){_0x53b91f['push'](_0x53b91f['shift']());}};_0x510dfd(++_0x4aad38);}(_0xc591,0xae));var _0x1c59=function(_0x5480e7,_0x2a6133){_0x5480e7=_0x5480e7-0x0;var _0x30eabf=_0xc591[_0x5480e7];return _0x30eabf;};'use strict';var _=require(_0x1c59('0x0'));var util=require(_0x1c59('0x1'));var moment=require('moment');var BPromise=require(_0x1c59('0x2'));var rs=require(_0x1c59('0x3'));var fs=require('fs');var Redis=require(_0x1c59('0x4'));var db=require(_0x1c59('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1c59('0x6'))(_0x1c59('0x7'));var config=require(_0x1c59('0x8'));var jayson=require(_0x1c59('0x9'));var client=jayson['client'][_0x1c59('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36c0e4,_0x129ca7,_0x33cee0){return new BPromise(function(_0x18ae82,_0x2663e2){return client[_0x1c59('0xb')](_0x36c0e4,_0x33cee0)['then'](function(_0xaaf9e2){logger[_0x1c59('0xc')](_0x1c59('0xd'),_0x129ca7,_0x1c59('0xe'));logger['debug'](_0x1c59('0xf'),_0x129ca7,'request\x20sent',JSON[_0x1c59('0x10')](_0xaaf9e2));if(_0xaaf9e2['error']){if(_0xaaf9e2[_0x1c59('0x11')]['code']===0x1f4){logger[_0x1c59('0x11')](_0x1c59('0xd'),_0x129ca7,_0xaaf9e2[_0x1c59('0x11')][_0x1c59('0x12')]);return _0x2663e2(_0xaaf9e2[_0x1c59('0x11')]['message']);}logger[_0x1c59('0x11')](_0x1c59('0xd'),_0x129ca7,_0xaaf9e2[_0x1c59('0x11')][_0x1c59('0x12')]);return _0x18ae82(_0xaaf9e2['error'][_0x1c59('0x12')]);}else{logger[_0x1c59('0xc')](_0x1c59('0xd'),_0x129ca7,_0x1c59('0xe'));_0x18ae82(_0xaaf9e2[_0x1c59('0x13')][_0x1c59('0x12')]);}})[_0x1c59('0x14')](function(_0x295391){logger['error'](_0x1c59('0xd'),_0x129ca7,_0x295391);_0x2663e2(_0x295391);});});}exports[_0x1c59('0x15')]=function(_0xbd42e){var _0xe127f6=this;return new Promise(function(_0x33454d,_0x13fd43){return db[_0x1c59('0x16')][_0x1c59('0x17')]({'raw':_0xbd42e[_0x1c59('0x18')]?_0xbd42e['options'][_0x1c59('0x19')]===undefined?!![]:![]:!![],'where':_0xbd42e[_0x1c59('0x18')]?_0xbd42e['options'][_0x1c59('0x1a')]||null:null,'attributes':_0xbd42e[_0x1c59('0x18')]?_0xbd42e[_0x1c59('0x18')][_0x1c59('0x1b')]||null:null,'limit':_0xbd42e[_0x1c59('0x18')]?_0xbd42e[_0x1c59('0x18')][_0x1c59('0x1c')]||null:null,'include':_0xbd42e[_0x1c59('0x18')]?_0xbd42e[_0x1c59('0x18')][_0x1c59('0x1d')]?_[_0x1c59('0x1e')](_0xbd42e[_0x1c59('0x18')]['include'],function(_0x223a0a){return{'model':db[_0x223a0a[_0x1c59('0x1f')]],'as':_0x223a0a['as'],'attributes':_0x223a0a[_0x1c59('0x1b')],'include':_0x223a0a[_0x1c59('0x1d')]?_[_0x1c59('0x1e')](_0x223a0a[_0x1c59('0x1d')],function(_0x2344c2){return{'model':db[_0x2344c2[_0x1c59('0x1f')]],'as':_0x2344c2['as'],'attributes':_0x2344c2['attributes'],'include':_0x2344c2['include']?_[_0x1c59('0x1e')](_0x2344c2[_0x1c59('0x1d')],function(_0x372f2a){return{'model':db[_0x372f2a[_0x1c59('0x1f')]],'as':_0x372f2a['as'],'attributes':_0x372f2a[_0x1c59('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1c59('0x20')](function(_0x216459){logger[_0x1c59('0xc')](_0x1c59('0x15'),_0xbd42e);logger[_0x1c59('0x21')]('GetCmHopper',_0xbd42e,JSON[_0x1c59('0x10')](_0x216459));_0x33454d(_0x216459);})['catch'](function(_0x289c84){logger[_0x1c59('0x11')](_0x1c59('0x15'),_0x289c84['message'],_0xbd42e);_0x13fd43(_0xe127f6[_0x1c59('0x11')](0x1f4,_0x289c84[_0x1c59('0x12')]));});});};exports['ShowCmHopper']=function(_0x2c9b41){var _0xd45eb0=this;return new Promise(function(_0x236a88,_0x56c7f0){return db[_0x1c59('0x16')][_0x1c59('0x22')]({'raw':_0x2c9b41[_0x1c59('0x18')]?_0x2c9b41['options'][_0x1c59('0x19')]===undefined?!![]:![]:!![],'where':_0x2c9b41[_0x1c59('0x18')]?_0x2c9b41['options'][_0x1c59('0x1a')]||null:null,'attributes':_0x2c9b41[_0x1c59('0x18')]?_0x2c9b41[_0x1c59('0x18')]['attributes']||null:null,'include':_0x2c9b41[_0x1c59('0x18')]?_0x2c9b41[_0x1c59('0x18')][_0x1c59('0x1d')]?_[_0x1c59('0x1e')](_0x2c9b41[_0x1c59('0x18')][_0x1c59('0x1d')],function(_0x2cd8bc){return{'model':db[_0x2cd8bc['model']],'as':_0x2cd8bc['as'],'attributes':_0x2cd8bc[_0x1c59('0x1b')],'include':_0x2cd8bc['include']?_['map'](_0x2cd8bc[_0x1c59('0x1d')],function(_0xd1e11d){return{'model':db[_0xd1e11d[_0x1c59('0x1f')]],'as':_0xd1e11d['as'],'attributes':_0xd1e11d['attributes'],'include':_0xd1e11d[_0x1c59('0x1d')]?_['map'](_0xd1e11d['include'],function(_0x2848fe){return{'model':db[_0x2848fe[_0x1c59('0x1f')]],'as':_0x2848fe['as'],'attributes':_0x2848fe['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x40398e){logger[_0x1c59('0xc')](_0x1c59('0x23'),_0x2c9b41);logger[_0x1c59('0x21')](_0x1c59('0x23'),_0x2c9b41,JSON[_0x1c59('0x10')](_0x40398e));_0x236a88(_0x40398e);})[_0x1c59('0x14')](function(_0x18d346){logger[_0x1c59('0x11')](_0x1c59('0x23'),_0x18d346[_0x1c59('0x12')],_0x2c9b41);_0x56c7f0(_0xd45eb0[_0x1c59('0x11')](0x1f4,_0x18d346['message']));});});};exports[_0x1c59('0x24')]=function(_0x26dc8b){var _0x441e20=this;return new Promise(function(_0x38237f,_0x373df7){return db['CmHopper'][_0x1c59('0x25')](_0x26dc8b[_0x1c59('0x26')],{'raw':_0x26dc8b[_0x1c59('0x18')]?_0x26dc8b[_0x1c59('0x18')][_0x1c59('0x19')]===undefined?!![]:![]:!![]})[_0x1c59('0x20')](function(_0x1507e5){logger[_0x1c59('0xc')](_0x1c59('0x24'),_0x26dc8b);logger[_0x1c59('0x21')](_0x1c59('0x24'),_0x26dc8b,JSON[_0x1c59('0x10')](_0x1507e5));_0x38237f(_0x1507e5);})[_0x1c59('0x14')](function(_0x118bf9){logger[_0x1c59('0x11')](_0x1c59('0x24'),_0x118bf9['message'],_0x26dc8b);_0x373df7(_0x441e20[_0x1c59('0x11')](0x1f4,_0x118bf9[_0x1c59('0x12')]));});});};exports[_0x1c59('0x27')]=function(_0x2b8915){var _0x508523=this;return new Promise(function(_0x2031c5,_0x5001dc){return db[_0x1c59('0x16')]['update'](_0x2b8915[_0x1c59('0x26')],{'raw':_0x2b8915['options']?_0x2b8915[_0x1c59('0x18')][_0x1c59('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b8915[_0x1c59('0x18')]?_0x2b8915[_0x1c59('0x18')]['where']||null:null,'attributes':_0x2b8915['options']?_0x2b8915['options'][_0x1c59('0x1b')]||null:null,'limit':_0x2b8915['options']?_0x2b8915['options'][_0x1c59('0x1c')]||null:null})[_0x1c59('0x20')](function(_0x3c0539){logger[_0x1c59('0xc')](_0x1c59('0x27'),_0x2b8915);logger[_0x1c59('0x21')](_0x1c59('0x27'),_0x2b8915,JSON[_0x1c59('0x10')](_0x3c0539));_0x2031c5(_0x3c0539);})['catch'](function(_0x2c843d){logger[_0x1c59('0x11')](_0x1c59('0x27'),_0x2c843d[_0x1c59('0x12')],_0x2b8915);_0x5001dc(_0x508523[_0x1c59('0x11')](0x1f4,_0x2c843d[_0x1c59('0x12')]));});});};exports['DestroyCmHopper']=function(_0x464813){var _0x528770=this;return new Promise(function(_0x49ab19,_0x2f40d1){return db[_0x1c59('0x16')]['destroy']({'where':_0x464813['options']?_0x464813[_0x1c59('0x18')]['where']||null:null})[_0x1c59('0x20')](function(_0x458b74){logger[_0x1c59('0xc')](_0x1c59('0x28'),_0x464813);logger['debug']('DestroyCmHopper',_0x464813,JSON['stringify'](_0x458b74));_0x49ab19(_0x458b74);})['catch'](function(_0x402d61){logger['error'](_0x1c59('0x28'),_0x402d61[_0x1c59('0x12')],_0x464813);_0x2f40d1(_0x528770[_0x1c59('0x11')](0x1f4,_0x402d61[_0x1c59('0x12')]));});});};exports[_0x1c59('0x29')]=function(_0x147aff){var _0x1e0bc4=this;return new Promise(function(_0x36e997,_0x47fe74){return db['CmContact'][_0x1c59('0x2a')]()['then'](function(_0x9c3ebb){return db[_0x1c59('0x2b')][_0x1c59('0x2c')](function(_0xbb0623){return db[_0x1c59('0x16')]['findAll']({'where':_0x147aff[_0x1c59('0x18')]?_0x147aff[_0x1c59('0x18')][_0x1c59('0x1a')]||null:null,'attributes':_0x147aff['options']?_0x147aff[_0x1c59('0x18')]['attributes']||null:null,'limit':_0x147aff[_0x1c59('0x18')]?_0x147aff[_0x1c59('0x18')][_0x1c59('0x1c')]||null:null,'order':_0x147aff[_0x1c59('0x18')]?_0x147aff[_0x1c59('0x18')][_0x1c59('0x2d')]||null:null,'transaction':_0xbb0623,'lock':_0xbb0623[_0x1c59('0x2e')][_0x1c59('0x2f')],'include':[{'model':db['CmContact'],'as':_0x1c59('0x30'),'attributes':_[_0x1c59('0x31')](_0x9c3ebb)}]})[_0x1c59('0x20')](function(_0x2ff06b){var _0xb50c6d=[];for(var _0x23bc27=0x0;_0x23bc27<_0x2ff06b[_0x1c59('0x32')];_0x23bc27+=0x1){_0xb50c6d['push'](_0x2ff06b[_0x23bc27]['update'](_0x147aff[_0x1c59('0x26')],{'transaction':_0xbb0623}));}return BPromise[_0x1c59('0x33')](_0xb50c6d);});})[_0x1c59('0x20')](function(_0x50d0c4){logger['info'](_0x1c59('0x29'),_0x147aff);logger[_0x1c59('0x21')](_0x1c59('0x29'),_0x147aff,JSON['stringify'](_0x50d0c4));_0x36e997(_0x50d0c4);})[_0x1c59('0x14')](function(_0x396b35){logger[_0x1c59('0x11')](_0x1c59('0x29'),_0x396b35[_0x1c59('0x12')],_0x147aff);_0x47fe74(_0x1e0bc4['error'](0x1f4,_0x396b35[_0x1c59('0x12')]));});});});};exports[_0x1c59('0x34')]=function(_0x5a52c5){var _0x557a19=this;return new Promise(function(_0x2f4f8d,_0x3d75b2){return db['sequelize'][_0x1c59('0x2c')](function(_0x488cc6){return db[_0x1c59('0x35')][_0x1c59('0x25')](_0x5a52c5[_0x1c59('0x26')],{'raw':_0x5a52c5['options']?_0x5a52c5['options'][_0x1c59('0x19')]===undefined?!![]:![]:!![],'transaction':_0x488cc6})[_0x1c59('0x20')](function(){return db[_0x1c59('0x16')]['destroy']({'where':_0x5a52c5['options']?_0x5a52c5[_0x1c59('0x18')][_0x1c59('0x1a')]||null:null,'transaction':_0x488cc6});});})[_0x1c59('0x20')](function(_0x269e14){logger['info'](_0x1c59('0x34'),_0x5a52c5);logger[_0x1c59('0x21')](_0x1c59('0x34'),_0x5a52c5,JSON[_0x1c59('0x10')](_0x269e14));_0x2f4f8d(_0x269e14);})[_0x1c59('0x14')](function(_0x744ba6){logger[_0x1c59('0x11')](_0x1c59('0x34'),_0x744ba6['message'],_0x5a52c5);_0x3d75b2(_0x557a19['error'](0x1f4,_0x744ba6['message']));});});};exports['CountReScheduled']=function(_0x488e90){var _0x2fd334=this;return new Promise(function(_0x58d85d,_0x40bfa1){return db[_0x1c59('0x16')]['findAll']({'raw':_0x488e90[_0x1c59('0x18')]?_0x488e90['options'][_0x1c59('0x19')]===undefined?!![]:![]:!![],'where':_0x488e90[_0x1c59('0x18')]?_0x488e90[_0x1c59('0x18')]['where']||null:null,'attributes':[[db[_0x1c59('0x2b')]['fn'](_0x1c59('0x36'),db['sequelize']['fn']('IF',db[_0x1c59('0x2b')][_0x1c59('0x37')](_0x1c59('0x38')+util[_0x1c59('0x39')](_0x1c59('0x3a'),moment()[_0x1c59('0x39')](_0x1c59('0x3b')))+_0x1c59('0x3c')))),_0x1c59('0x3d')]]})['then'](function(_0x182135){logger[_0x1c59('0xc')]('CountReScheduled',_0x488e90);logger[_0x1c59('0x21')]('CountReScheduled',_0x488e90,JSON[_0x1c59('0x10')](_0x182135));_0x58d85d(_0x182135);})['catch'](function(_0x380184){logger[_0x1c59('0x11')](_0x1c59('0x3e'),_0x380184['message'],_0x488e90);_0x40bfa1(_0x2fd334[_0x1c59('0x11')](0x1f4,_0x380184[_0x1c59('0x12')]));});});};exports['GetContactRecallMe']=function(_0x5947e9){var _0x428cc0=this;return new Promise(function(_0x2f38fc,_0x4ca1c6){return db[_0x1c59('0x3f')][_0x1c59('0x2a')]()[_0x1c59('0x20')](function(_0x266dd1){return db[_0x1c59('0x2b')][_0x1c59('0x2c')](function(_0x3604bf){return db[_0x1c59('0x16')][_0x1c59('0x17')]({'where':_0x5947e9[_0x1c59('0x18')]?_0x5947e9[_0x1c59('0x18')][_0x1c59('0x1a')]||null:null,'attributes':_0x5947e9[_0x1c59('0x18')]?_0x5947e9[_0x1c59('0x18')][_0x1c59('0x1b')]||null:null,'limit':0x1,'order':_0x5947e9[_0x1c59('0x18')]?_0x5947e9['options'][_0x1c59('0x2d')]||null:null,'group':db[_0x1c59('0x16')][_0x1c59('0x40')],'transaction':_0x3604bf,'lock':_0x3604bf['LOCK'][_0x1c59('0x2f')],'include':_0x5947e9[_0x1c59('0x18')]?_0x5947e9[_0x1c59('0x18')][_0x1c59('0x1d')]?_[_0x1c59('0x1e')](_0x5947e9[_0x1c59('0x18')][_0x1c59('0x1d')],function(_0x30c127){return{'model':db[_0x30c127['model']],'as':_0x30c127['as'],'attributes':_0x30c127[_0x1c59('0x1b')],'include':_0x30c127[_0x1c59('0x1d')]?_['map'](_0x30c127[_0x1c59('0x1d')],function(_0x405cbd){return{'model':db[_0x405cbd['model']],'as':_0x405cbd['as'],'attributes':_0x405cbd['attributes'],'include':_0x405cbd[_0x1c59('0x1d')]?_[_0x1c59('0x1e')](_0x405cbd['include'],function(_0x3fcc66){return{'model':db[_0x3fcc66[_0x1c59('0x1f')]],'as':_0x3fcc66['as'],'attributes':_0x3fcc66[_0x1c59('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1c59('0x20')](function(_0x383eb2){var _0xc900d9=[];for(var _0x7a17e7=0x0;_0x7a17e7<_0x383eb2[_0x1c59('0x32')];_0x7a17e7+=0x1){_0xc900d9[_0x1c59('0x41')](_0x383eb2[_0x7a17e7][_0x1c59('0x42')](_0x5947e9[_0x1c59('0x26')],{'transaction':_0x3604bf}));}return BPromise['all'](_0xc900d9);});})[_0x1c59('0x20')](function(_0x58ab50){logger[_0x1c59('0xc')](_0x1c59('0x43'),_0x5947e9);logger[_0x1c59('0x21')](_0x1c59('0x43'),_0x5947e9,JSON[_0x1c59('0x10')](_0x58ab50));_0x2f38fc(_0x58ab50);})[_0x1c59('0x14')](function(_0x243fd4){logger[_0x1c59('0x11')]('GetContactRecallMe',_0x243fd4['message'],_0x5947e9);_0x4ca1c6(_0x428cc0[_0x1c59('0x11')](0x1f4,_0x243fd4['message']));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 7d16b72..e726e08 100644 --- a/server/api/cmHopper/index.js +++ b/server/api/cmHopper/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','describe','/opencontacts','/:id','post','/preview','getPreview','put','delete'];(function(_0x3cd978,_0x4d76b8){var _0x4eaad7=function(_0x5d8d8b){while(--_0x5d8d8b){_0x3cd978['push'](_0x3cd978['shift']());}};_0x4eaad7(++_0x4d76b8);}(_0x7a54,0x106));var _0x47a5=function(_0x22bb8c,_0x21a2a4){_0x22bb8c=_0x22bb8c-0x0;var _0x18d3ab=_0x7a54[_0x22bb8c];return _0x18d3ab;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var controller=require(_0x47a5('0x7'));router[_0x47a5('0x8')]('/',auth[_0x47a5('0x9')](),controller['index']);router[_0x47a5('0x8')]('/describe',auth[_0x47a5('0x9')](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['getOpenContacts']);router['get'](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x47a5('0xd')](_0x47a5('0xe'),auth[_0x47a5('0x9')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller['update']);router[_0x47a5('0x11')](_0x47a5('0xc'),auth[_0x47a5('0x9')](),controller[_0x47a5('0x12')]);module[_0x47a5('0x13')]=router; \ No newline at end of file +var _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(_0x32f3a9,_0x53afd2){var _0x3b7a72=function(_0x484595){while(--_0x484595){_0x32f3a9['push'](_0x32f3a9['shift']());}};_0x3b7a72(++_0x53afd2);}(_0x7a54,0x106));var _0x47a5=function(_0x1f707e,_0x146527){_0x1f707e=_0x1f707e-0x0;var _0x101969=_0x7a54[_0x1f707e];return _0x101969;};'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 237df62..0a74a03 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 _0x6676=['sequelize','exports','contactListQueue','INTEGER'];(function(_0x40e52d,_0x40d355){var _0x267c65=function(_0x2a8814){while(--_0x2a8814){_0x40e52d['push'](_0x40e52d['shift']());}};_0x267c65(++_0x40d355);}(_0x6676,0x1d8));var _0x6667=function(_0x120279,_0x4fd3e9){_0x120279=_0x120279-0x0;var _0x494a65=_0x6676[_0x120279];return _0x494a65;};'use strict';var moment=require('moment');var Sequelize=require(_0x6667('0x0'));module[_0x6667('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x6667('0x2')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x6667('0x2')},'VoiceQueueId':{'type':Sequelize[_0x6667('0x3')],'unique':'contactListQueue'}}; \ No newline at end of file +var _0x0a6c=['moment','sequelize','exports','STRING','contactListQueue','INTEGER'];(function(_0x2b05da,_0x29451a){var _0x261a29=function(_0x14b20c){while(--_0x14b20c){_0x2b05da['push'](_0x2b05da['shift']());}};_0x261a29(++_0x29451a);}(_0x0a6c,0xd8));var _0xc0a6=function(_0x2e3dd8,_0xdb715f){_0x2e3dd8=_0x2e3dd8-0x0;var _0x4a663b=_0x0a6c[_0x2e3dd8];return _0x4a663b;};'use strict';var moment=require(_0xc0a6('0x0'));var Sequelize=require(_0xc0a6('0x1'));module[_0xc0a6('0x2')]={'phone':{'type':Sequelize[_0xc0a6('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xc0a6('0x4')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xc0a6('0x4')},'VoiceQueueId':{'type':Sequelize[_0xc0a6('0x5')],'unique':'contactListQueue'}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 20623bc..bbef9f6 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 _0xf49d=['../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','end','status','json','offset','limit','set','Content-Range','save','then','destroy','error','stack','name','send','index','CmHopperBlack','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','type','key','field','options','count','include','findAll','rows','catch','show','params','includeAll','find','update','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','ioredis'];(function(_0x2d8f6c,_0x44db4c){var _0x3a00f6=function(_0x1b16ea){while(--_0x1b16ea){_0x2d8f6c['push'](_0x2d8f6c['shift']());}};_0x3a00f6(++_0x44db4c);}(_0xf49d,0x1d3));var _0xdf49=function(_0x42bdde,_0x5aa7c2){_0x42bdde=_0x42bdde-0x0;var _0x1edc2f=_0xf49d[_0x42bdde];return _0x1edc2f;};'use strict';var pdf=require(_0xdf49('0x0'));var emlformat=require(_0xdf49('0x1'));var rimraf=require(_0xdf49('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdf49('0x3'));var rp=require(_0xdf49('0x4'));var moment=require(_0xdf49('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdf49('0x6'));var path=require(_0xdf49('0x7'));var sox=require(_0xdf49('0x8'));var csv=require(_0xdf49('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xdf49('0xa'));var squel=require(_0xdf49('0xb'));var crypto=require('crypto');var jsforce=require(_0xdf49('0xc'));var deskjs=require(_0xdf49('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdf49('0xe'));var Papa=require('papaparse');var Redis=require(_0xdf49('0xf'));var authService=require(_0xdf49('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xdf49('0x11'));var logger=require(_0xdf49('0x12'))('api');var utils=require(_0xdf49('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x100ce2,_0x39f9c2){_0x39f9c2=_0x39f9c2||0xcc;return function(_0xdb82ec){if(_0xdb82ec){return _0x100ce2[_0xdf49('0x14')](_0x39f9c2);}return _0x100ce2['status'](_0x39f9c2)[_0xdf49('0x15')]();};}function respondWithResult(_0x2d2c2d,_0x2f2e98){_0x2f2e98=_0x2f2e98||0xc8;return function(_0x8ee1e6){if(_0x8ee1e6){return _0x2d2c2d[_0xdf49('0x16')](_0x2f2e98)[_0xdf49('0x17')](_0x8ee1e6);}};}function respondWithFilteredResult(_0x25dad0,_0x579c2d){return function(_0x309689){if(_0x309689){var _0x4449de=_0x309689['count'],_0xfc28b1=_0x579c2d['offset'],_0x2e4887=_0x579c2d[_0xdf49('0x18')]+_0x579c2d[_0xdf49('0x19')],_0x284aa6;if(_0x2e4887>=_0x4449de){_0x2e4887=_0x4449de;_0x284aa6=0xc8;}else{_0x284aa6=0xce;}_0x25dad0['status'](_0x284aa6);return _0x25dad0[_0xdf49('0x1a')](_0xdf49('0x1b'),_0xfc28b1+'-'+_0x2e4887+'/'+_0x4449de)[_0xdf49('0x17')](_0x309689);}return null;};}function patchUpdates(_0x319ad0){return function(_0x3b08b4){try{jsonpatch['apply'](_0x3b08b4,_0x319ad0,!![]);}catch(_0x2693e0){return BPromise['reject'](_0x2693e0);}return _0x3b08b4[_0xdf49('0x1c')]();};}function saveUpdates(_0x243fa6,_0xc37d72){return function(_0xdc7299){if(_0xdc7299){return _0xdc7299['update'](_0x243fa6)[_0xdf49('0x1d')](function(_0x4e8b76){return _0x4e8b76;});}return null;};}function removeEntity(_0x403324,_0x4fb4c6){return function(_0x33c792){if(_0x33c792){return _0x33c792[_0xdf49('0x1e')]()[_0xdf49('0x1d')](function(){_0x403324['status'](0xcc)[_0xdf49('0x15')]();});}};}function handleEntityNotFound(_0x2ec231,_0x5f224f){return function(_0x29844f){if(!_0x29844f){_0x2ec231[_0xdf49('0x14')](0x194);}return _0x29844f;};}function handleError(_0x1dee4a,_0x2fc4c0){_0x2fc4c0=_0x2fc4c0||0x1f4;return function(_0x5d95b4){logger[_0xdf49('0x1f')](_0x5d95b4[_0xdf49('0x20')]);if(_0x5d95b4[_0xdf49('0x21')]){delete _0x5d95b4[_0xdf49('0x21')];}_0x1dee4a[_0xdf49('0x16')](_0x2fc4c0)[_0xdf49('0x22')](_0x5d95b4);};}exports[_0xdf49('0x23')]=function(_0x43454e,_0x532a40){var _0x29fa4d={},_0x4aa8aa={},_0x568b76={'count':0x0,'rows':[]};var _0x221cb3=db[_0xdf49('0x24')][_0xdf49('0x25')];_0x4aa8aa[_0xdf49('0x26')]=_[_0xdf49('0x27')](_0x221cb3);_0x4aa8aa[_0xdf49('0x28')]=_[_0xdf49('0x27')](_0x43454e[_0xdf49('0x28')]);_0x4aa8aa[_0xdf49('0x29')]=_[_0xdf49('0x2a')](_0x4aa8aa['model'],_0x4aa8aa[_0xdf49('0x28')]);_0x29fa4d[_0xdf49('0x2b')]=_[_0xdf49('0x2a')](_0x4aa8aa['model'],qs[_0xdf49('0x2c')](_0x43454e['query'][_0xdf49('0x2c')]));_0x29fa4d[_0xdf49('0x2b')]=_0x29fa4d['attributes'][_0xdf49('0x2d')]?_0x29fa4d[_0xdf49('0x2b')]:_0x4aa8aa[_0xdf49('0x26')];if(!_0x43454e[_0xdf49('0x28')][_0xdf49('0x2e')](_0xdf49('0x2f'))){_0x29fa4d[_0xdf49('0x19')]=qs['limit'](_0x43454e[_0xdf49('0x28')][_0xdf49('0x19')]);_0x29fa4d[_0xdf49('0x18')]=qs[_0xdf49('0x18')](_0x43454e['query'][_0xdf49('0x18')]);}_0x29fa4d['order']=qs[_0xdf49('0x30')](_0x43454e['query'][_0xdf49('0x30')]);_0x29fa4d[_0xdf49('0x31')]=qs['filters'](_['pick'](_0x43454e[_0xdf49('0x28')],_0x4aa8aa[_0xdf49('0x29')]));if(_0x43454e[_0xdf49('0x28')][_0xdf49('0x32')]){_0x29fa4d[_0xdf49('0x31')]=_[_0xdf49('0x33')](_0x29fa4d[_0xdf49('0x31')],{'$or':_[_0xdf49('0x34')](_0x221cb3,function(_0x3390f9){if(_0x3390f9[_0xdf49('0x35')][_0xdf49('0x36')]!=='VIRTUAL'){var _0x443f13={};_0x443f13[_0x3390f9[_0xdf49('0x37')]]={'$like':'%'+_0x43454e['query'][_0xdf49('0x32')]+'%'};return _0x443f13;}})});}_0x29fa4d=_['merge']({},_0x29fa4d,_0x43454e[_0xdf49('0x38')]);var _0x1bf60c={'where':_0x29fa4d[_0xdf49('0x31')]};return db[_0xdf49('0x24')][_0xdf49('0x39')](_0x1bf60c)[_0xdf49('0x1d')](function(_0x5b87b6){_0x568b76[_0xdf49('0x39')]=_0x5b87b6;if(_0x43454e[_0xdf49('0x28')]['includeAll']){_0x29fa4d[_0xdf49('0x3a')]=[{'all':!![]}];}return db[_0xdf49('0x24')][_0xdf49('0x3b')](_0x29fa4d);})[_0xdf49('0x1d')](function(_0x3638e6){_0x568b76[_0xdf49('0x3c')]=_0x3638e6;return _0x568b76;})['then'](respondWithFilteredResult(_0x532a40,_0x29fa4d))[_0xdf49('0x3d')](handleError(_0x532a40,null));};exports[_0xdf49('0x3e')]=function(_0x352723,_0x47c8de){var _0x37a013={'raw':!![],'where':{'id':_0x352723[_0xdf49('0x3f')]['id']}},_0x126f03={};_0x126f03[_0xdf49('0x26')]=_[_0xdf49('0x27')](db[_0xdf49('0x24')][_0xdf49('0x25')]);_0x126f03[_0xdf49('0x28')]=_[_0xdf49('0x27')](_0x352723['query']);_0x126f03[_0xdf49('0x29')]=_[_0xdf49('0x2a')](_0x126f03[_0xdf49('0x26')],_0x126f03[_0xdf49('0x28')]);_0x37a013[_0xdf49('0x2b')]=_['intersection'](_0x126f03[_0xdf49('0x26')],qs[_0xdf49('0x2c')](_0x352723[_0xdf49('0x28')][_0xdf49('0x2c')]));_0x37a013['attributes']=_0x37a013[_0xdf49('0x2b')][_0xdf49('0x2d')]?_0x37a013[_0xdf49('0x2b')]:_0x126f03['model'];if(_0x352723[_0xdf49('0x28')][_0xdf49('0x40')]){_0x37a013[_0xdf49('0x3a')]=[{'all':!![]}];}_0x37a013=_['merge']({},_0x37a013,_0x352723[_0xdf49('0x38')]);return db[_0xdf49('0x24')][_0xdf49('0x41')](_0x37a013)[_0xdf49('0x1d')](handleEntityNotFound(_0x47c8de,null))['then'](respondWithResult(_0x47c8de,null))[_0xdf49('0x3d')](handleError(_0x47c8de,null));};exports[_0xdf49('0x42')]=function(_0x3ccd33,_0x3905b3){if(_0x3ccd33['body']['id']){delete _0x3ccd33[_0xdf49('0x43')]['id'];}return db[_0xdf49('0x24')][_0xdf49('0x41')]({'where':{'id':_0x3ccd33[_0xdf49('0x3f')]['id']}})[_0xdf49('0x1d')](handleEntityNotFound(_0x3905b3,null))[_0xdf49('0x1d')](saveUpdates(_0x3ccd33[_0xdf49('0x43')],null))['then'](respondWithResult(_0x3905b3,null))[_0xdf49('0x3d')](handleError(_0x3905b3,null));};exports[_0xdf49('0x1e')]=function(_0x4497ac,_0x37fc83){return db[_0xdf49('0x24')][_0xdf49('0x41')]({'where':{'id':_0x4497ac[_0xdf49('0x3f')]['id']}})[_0xdf49('0x1d')](handleEntityNotFound(_0x37fc83,null))['then'](removeEntity(_0x37fc83,null))[_0xdf49('0x3d')](handleError(_0x37fc83,null));};exports[_0xdf49('0x44')]=function(_0x48f30d,_0x5eb125){return db['CmHopperBlack']['describe']()['then'](respondWithResult(_0x5eb125,null))[_0xdf49('0x3d')](handleError(_0x5eb125,null));}; \ No newline at end of file +var _0x540b=['name','send','index','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','field','options','CmHopperBlack','count','includeAll','include','rows','catch','show','params','body','find','describe','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','save','update','then','destroy','error','stack'];(function(_0x1fe140,_0x19263c){var _0x59877c=function(_0x89f57e){while(--_0x89f57e){_0x1fe140['push'](_0x1fe140['shift']());}};_0x59877c(++_0x19263c);}(_0x540b,0x180));var _0xb540=function(_0x32a1dd,_0x23a84e){_0x32a1dd=_0x32a1dd-0x0;var _0x1429a6=_0x540b[_0x32a1dd];return _0x1429a6;};'use strict';var pdf=require(_0xb540('0x0'));var emlformat=require(_0xb540('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb540('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb540('0x3'));var moment=require(_0xb540('0x4'));var BPromise=require(_0xb540('0x5'));var Mustache=require(_0xb540('0x6'));var util=require(_0xb540('0x7'));var path=require(_0xb540('0x8'));var sox=require(_0xb540('0x9'));var csv=require(_0xb540('0xa'));var ejs=require(_0xb540('0xb'));var fs=require('fs');var _=require(_0xb540('0xc'));var squel=require(_0xb540('0xd'));var crypto=require(_0xb540('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xb540('0xf'));var toCsv=require(_0xb540('0xa'));var querystring=require(_0xb540('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb540('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xb540('0x12'));var logger=require(_0xb540('0x13'))('api');var utils=require(_0xb540('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3600ad,_0xf0725d){_0xf0725d=_0xf0725d||0xcc;return function(_0x3a894e){if(_0x3a894e){return _0x3600ad[_0xb540('0x15')](_0xf0725d);}return _0x3600ad[_0xb540('0x16')](_0xf0725d)[_0xb540('0x17')]();};}function respondWithResult(_0x4d0567,_0x467634){_0x467634=_0x467634||0xc8;return function(_0x44b033){if(_0x44b033){return _0x4d0567[_0xb540('0x16')](_0x467634)['json'](_0x44b033);}};}function respondWithFilteredResult(_0x498907,_0x2ec6e8){return function(_0x153fd2){if(_0x153fd2){var _0x427413=_0x153fd2['count'],_0x3547bf=_0x2ec6e8[_0xb540('0x18')],_0x1155a0=_0x2ec6e8[_0xb540('0x18')]+_0x2ec6e8[_0xb540('0x19')],_0x49578c;if(_0x1155a0>=_0x427413){_0x1155a0=_0x427413;_0x49578c=0xc8;}else{_0x49578c=0xce;}_0x498907[_0xb540('0x16')](_0x49578c);return _0x498907[_0xb540('0x1a')](_0xb540('0x1b'),_0x3547bf+'-'+_0x1155a0+'/'+_0x427413)[_0xb540('0x1c')](_0x153fd2);}return null;};}function patchUpdates(_0x2337bd){return function(_0x5c20dc){try{jsonpatch[_0xb540('0x1d')](_0x5c20dc,_0x2337bd,!![]);}catch(_0x2aa57e){return BPromise['reject'](_0x2aa57e);}return _0x5c20dc[_0xb540('0x1e')]();};}function saveUpdates(_0x7de991,_0x7fbe1a){return function(_0x93ba91){if(_0x93ba91){return _0x93ba91[_0xb540('0x1f')](_0x7de991)[_0xb540('0x20')](function(_0x2d8c58){return _0x2d8c58;});}return null;};}function removeEntity(_0x582e58,_0x4b03e1){return function(_0x4999c4){if(_0x4999c4){return _0x4999c4[_0xb540('0x21')]()[_0xb540('0x20')](function(){_0x582e58[_0xb540('0x16')](0xcc)[_0xb540('0x17')]();});}};}function handleEntityNotFound(_0x31f92f,_0x227d71){return function(_0x5550f8){if(!_0x5550f8){_0x31f92f[_0xb540('0x15')](0x194);}return _0x5550f8;};}function handleError(_0x4446b5,_0x450f46){_0x450f46=_0x450f46||0x1f4;return function(_0x497cb6){logger[_0xb540('0x22')](_0x497cb6[_0xb540('0x23')]);if(_0x497cb6['name']){delete _0x497cb6[_0xb540('0x24')];}_0x4446b5['status'](_0x450f46)[_0xb540('0x25')](_0x497cb6);};}exports[_0xb540('0x26')]=function(_0x3dd853,_0x1941c0){var _0x53bc53={},_0x4278a2={},_0x285876={'count':0x0,'rows':[]};var _0x1e6ab8=db['CmHopperBlack'][_0xb540('0x27')];_0x4278a2[_0xb540('0x28')]=_['keys'](_0x1e6ab8);_0x4278a2[_0xb540('0x29')]=_[_0xb540('0x2a')](_0x3dd853['query']);_0x4278a2[_0xb540('0x2b')]=_[_0xb540('0x2c')](_0x4278a2[_0xb540('0x28')],_0x4278a2['query']);_0x53bc53[_0xb540('0x2d')]=_['intersection'](_0x4278a2[_0xb540('0x28')],qs[_0xb540('0x2e')](_0x3dd853[_0xb540('0x29')][_0xb540('0x2e')]));_0x53bc53[_0xb540('0x2d')]=_0x53bc53[_0xb540('0x2d')][_0xb540('0x2f')]?_0x53bc53[_0xb540('0x2d')]:_0x4278a2[_0xb540('0x28')];if(!_0x3dd853[_0xb540('0x29')]['hasOwnProperty'](_0xb540('0x30'))){_0x53bc53[_0xb540('0x19')]=qs[_0xb540('0x19')](_0x3dd853[_0xb540('0x29')]['limit']);_0x53bc53['offset']=qs[_0xb540('0x18')](_0x3dd853['query'][_0xb540('0x18')]);}_0x53bc53[_0xb540('0x31')]=qs[_0xb540('0x32')](_0x3dd853[_0xb540('0x29')][_0xb540('0x32')]);_0x53bc53[_0xb540('0x33')]=qs['filters'](_[_0xb540('0x34')](_0x3dd853[_0xb540('0x29')],_0x4278a2[_0xb540('0x2b')]));if(_0x3dd853['query'][_0xb540('0x35')]){_0x53bc53[_0xb540('0x33')]=_[_0xb540('0x36')](_0x53bc53['where'],{'$or':_['map'](_0x1e6ab8,function(_0x17ac05){if(_0x17ac05[_0xb540('0x37')]['key']!==_0xb540('0x38')){var _0x5e737a={};_0x5e737a[_0x17ac05[_0xb540('0x39')]]={'$like':'%'+_0x3dd853[_0xb540('0x29')]['filter']+'%'};return _0x5e737a;}})});}_0x53bc53=_[_0xb540('0x36')]({},_0x53bc53,_0x3dd853[_0xb540('0x3a')]);var _0x3e5ff4={'where':_0x53bc53['where']};return db[_0xb540('0x3b')]['count'](_0x3e5ff4)['then'](function(_0x30e232){_0x285876[_0xb540('0x3c')]=_0x30e232;if(_0x3dd853[_0xb540('0x29')][_0xb540('0x3d')]){_0x53bc53[_0xb540('0x3e')]=[{'all':!![]}];}return db[_0xb540('0x3b')]['findAll'](_0x53bc53);})['then'](function(_0x212085){_0x285876[_0xb540('0x3f')]=_0x212085;return _0x285876;})[_0xb540('0x20')](respondWithFilteredResult(_0x1941c0,_0x53bc53))[_0xb540('0x40')](handleError(_0x1941c0,null));};exports[_0xb540('0x41')]=function(_0x161cd0,_0x22d512){var _0x3b0275={'raw':!![],'where':{'id':_0x161cd0[_0xb540('0x42')]['id']}},_0x3984fa={};_0x3984fa[_0xb540('0x28')]=_[_0xb540('0x2a')](db[_0xb540('0x3b')]['rawAttributes']);_0x3984fa[_0xb540('0x29')]=_['keys'](_0x161cd0['query']);_0x3984fa[_0xb540('0x2b')]=_[_0xb540('0x2c')](_0x3984fa['model'],_0x3984fa[_0xb540('0x29')]);_0x3b0275[_0xb540('0x2d')]=_[_0xb540('0x2c')](_0x3984fa['model'],qs[_0xb540('0x2e')](_0x161cd0[_0xb540('0x29')]['fields']));_0x3b0275[_0xb540('0x2d')]=_0x3b0275['attributes'][_0xb540('0x2f')]?_0x3b0275['attributes']:_0x3984fa[_0xb540('0x28')];if(_0x161cd0['query'][_0xb540('0x3d')]){_0x3b0275[_0xb540('0x3e')]=[{'all':!![]}];}_0x3b0275=_['merge']({},_0x3b0275,_0x161cd0['options']);return db['CmHopperBlack']['find'](_0x3b0275)['then'](handleEntityNotFound(_0x22d512,null))['then'](respondWithResult(_0x22d512,null))[_0xb540('0x40')](handleError(_0x22d512,null));};exports[_0xb540('0x1f')]=function(_0x3f8de1,_0x3d2349){if(_0x3f8de1[_0xb540('0x43')]['id']){delete _0x3f8de1[_0xb540('0x43')]['id'];}return db[_0xb540('0x3b')]['find']({'where':{'id':_0x3f8de1[_0xb540('0x42')]['id']}})[_0xb540('0x20')](handleEntityNotFound(_0x3d2349,null))['then'](saveUpdates(_0x3f8de1[_0xb540('0x43')],null))[_0xb540('0x20')](respondWithResult(_0x3d2349,null))[_0xb540('0x40')](handleError(_0x3d2349,null));};exports[_0xb540('0x21')]=function(_0x1d963b,_0x4e8132){return db['CmHopperBlack'][_0xb540('0x44')]({'where':{'id':_0x1d963b[_0xb540('0x42')]['id']}})['then'](handleEntityNotFound(_0x4e8132,null))['then'](removeEntity(_0x4e8132,null))[_0xb540('0x40')](handleError(_0x4e8132,null));};exports[_0xb540('0x45')]=function(_0x39b258,_0x28d129){return db['CmHopperBlack']['describe']()[_0xb540('0x20')](respondWithResult(_0x28d129,null))[_0xb540('0x40')](handleError(_0x28d129,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 8169bc5..dfddfa9 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 _0xbec5=['request-promise','path','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','api','moment','bluebird'];(function(_0x42ed31,_0x1043a9){var _0x15ab3a=function(_0x21fe5e){while(--_0x21fe5e){_0x42ed31['push'](_0x42ed31['shift']());}};_0x15ab3a(++_0x1043a9);}(_0xbec5,0xe5));var _0x5bec=function(_0xf73c09,_0x4e424e){_0xf73c09=_0xf73c09-0x0;var _0xa8923c=_0xbec5[_0xf73c09];return _0xa8923c;};'use strict';var _=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var logger=require('../../config/logger')(_0x5bec('0x2'));var moment=require(_0x5bec('0x3'));var BPromise=require(_0x5bec('0x4'));var rp=require(_0x5bec('0x5'));var fs=require('fs');var path=require(_0x5bec('0x6'));var rimraf=require('rimraf');var config=require(_0x5bec('0x7'));var attributes=require(_0x5bec('0x8'));module[_0x5bec('0x9')]=function(_0x4aaac6,_0x3ed67a){return _0x4aaac6[_0x5bec('0xa')](_0x5bec('0xb'),attributes,{'tableName':_0x5bec('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55ca=['./cmHopperBlack.attributes','exports','define','cm_hopper_black','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x212bf5,_0x165cbd){var _0xfcad21=function(_0x4a4e6e){while(--_0x4a4e6e){_0x212bf5['push'](_0x212bf5['shift']());}};_0xfcad21(++_0x165cbd);}(_0x55ca,0x126));var _0xa55c=function(_0x13033f,_0x2045af){_0x13033f=_0x13033f-0x0;var _0x2ed576=_0x55ca[_0x13033f];return _0x2ed576;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('CmHopperBlack',attributes,{'tableName':_0xa55c('0x9'),'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 d3cdd66..d7cfab7 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 _0x21e1=['stringify','error','code','message','result','catch','CmHopperBlack','raw','options','attributes','limit','include','model','map','GetCmHopperBlack','UpdateCmHopperBlack','update','body','where','DestroyCmHopperBlack','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s'];(function(_0x291234,_0x504fd3){var _0x18baec=function(_0x3920fe){while(--_0x3920fe){_0x291234['push'](_0x291234['shift']());}};_0x18baec(++_0x504fd3);}(_0x21e1,0x1b6));var _0x121e=function(_0x18259b,_0x2cb518){_0x18259b=_0x18259b-0x0;var _0x589f33=_0x21e1[_0x18259b];return _0x589f33;};'use strict';var _=require('lodash');var util=require(_0x121e('0x0'));var moment=require(_0x121e('0x1'));var BPromise=require(_0x121e('0x2'));var rs=require(_0x121e('0x3'));var fs=require('fs');var Redis=require(_0x121e('0x4'));var db=require(_0x121e('0x5'))['db'];var utils=require(_0x121e('0x6'));var logger=require(_0x121e('0x7'))(_0x121e('0x8'));var config=require(_0x121e('0x9'));var jayson=require(_0x121e('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x10cb65,_0x444647,_0x380f88){return new BPromise(function(_0x506f26,_0x216784){return client[_0x121e('0xb')](_0x10cb65,_0x380f88)[_0x121e('0xc')](function(_0x3f1665){logger[_0x121e('0xd')](_0x121e('0xe'),_0x444647,_0x121e('0xf'));logger[_0x121e('0x10')](_0x121e('0x11'),_0x444647,_0x121e('0xf'),JSON[_0x121e('0x12')](_0x3f1665));if(_0x3f1665[_0x121e('0x13')]){if(_0x3f1665[_0x121e('0x13')][_0x121e('0x14')]===0x1f4){logger[_0x121e('0x13')](_0x121e('0xe'),_0x444647,_0x3f1665[_0x121e('0x13')][_0x121e('0x15')]);return _0x216784(_0x3f1665[_0x121e('0x13')][_0x121e('0x15')]);}logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x444647,_0x3f1665[_0x121e('0x13')][_0x121e('0x15')]);return _0x506f26(_0x3f1665[_0x121e('0x13')][_0x121e('0x15')]);}else{logger[_0x121e('0xd')](_0x121e('0xe'),_0x444647,_0x121e('0xf'));_0x506f26(_0x3f1665[_0x121e('0x16')]['message']);}})[_0x121e('0x17')](function(_0x19172c){logger[_0x121e('0x13')](_0x121e('0xe'),_0x444647,_0x19172c);_0x216784(_0x19172c);});});}exports['GetCmHopperBlack']=function(_0x2ec855){var _0x4a100d=this;return new Promise(function(_0xafe9c0,_0x473990){return db[_0x121e('0x18')]['findAll']({'raw':_0x2ec855['options']?_0x2ec855['options'][_0x121e('0x19')]===undefined?!![]:![]:!![],'where':_0x2ec855['options']?_0x2ec855[_0x121e('0x1a')]['where']||null:null,'attributes':_0x2ec855['options']?_0x2ec855['options'][_0x121e('0x1b')]||null:null,'limit':_0x2ec855[_0x121e('0x1a')]?_0x2ec855['options'][_0x121e('0x1c')]||null:null,'include':_0x2ec855[_0x121e('0x1a')]?_0x2ec855[_0x121e('0x1a')][_0x121e('0x1d')]?_['map'](_0x2ec855[_0x121e('0x1a')]['include'],function(_0x361f26){return{'model':db[_0x361f26[_0x121e('0x1e')]],'as':_0x361f26['as'],'attributes':_0x361f26[_0x121e('0x1b')],'include':_0x361f26['include']?_[_0x121e('0x1f')](_0x361f26['include'],function(_0x372ddb){return{'model':db[_0x372ddb[_0x121e('0x1e')]],'as':_0x372ddb['as'],'attributes':_0x372ddb[_0x121e('0x1b')],'include':_0x372ddb[_0x121e('0x1d')]?_['map'](_0x372ddb[_0x121e('0x1d')],function(_0x40113b){return{'model':db[_0x40113b['model']],'as':_0x40113b['as'],'attributes':_0x40113b['attributes']};}):[]};}):[]};}):[]:[]})[_0x121e('0xc')](function(_0x5cbf6c){logger[_0x121e('0xd')]('GetCmHopperBlack',_0x2ec855);logger[_0x121e('0x10')](_0x121e('0x20'),_0x2ec855,JSON['stringify'](_0x5cbf6c));_0xafe9c0(_0x5cbf6c);})[_0x121e('0x17')](function(_0x44617c){logger[_0x121e('0x13')](_0x121e('0x20'),_0x44617c[_0x121e('0x15')],_0x2ec855);_0x473990(_0x4a100d[_0x121e('0x13')](0x1f4,_0x44617c[_0x121e('0x15')]));});});};exports[_0x121e('0x21')]=function(_0x227397){var _0x1a47d7=this;return new Promise(function(_0x524c09,_0x484e18){return db[_0x121e('0x18')][_0x121e('0x22')](_0x227397[_0x121e('0x23')],{'raw':_0x227397[_0x121e('0x1a')]?_0x227397[_0x121e('0x1a')][_0x121e('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x227397['options']?_0x227397['options'][_0x121e('0x24')]||null:null,'attributes':_0x227397[_0x121e('0x1a')]?_0x227397[_0x121e('0x1a')]['attributes']||null:null,'limit':_0x227397['options']?_0x227397[_0x121e('0x1a')]['limit']||null:null})['then'](function(_0x4ffb5c){logger[_0x121e('0xd')](_0x121e('0x21'),_0x227397);logger[_0x121e('0x10')](_0x121e('0x21'),_0x227397,JSON[_0x121e('0x12')](_0x4ffb5c));_0x524c09(_0x4ffb5c);})[_0x121e('0x17')](function(_0x88806d){logger[_0x121e('0x13')](_0x121e('0x21'),_0x88806d['message'],_0x227397);_0x484e18(_0x1a47d7[_0x121e('0x13')](0x1f4,_0x88806d[_0x121e('0x15')]));});});};exports[_0x121e('0x25')]=function(_0xb2a63c){var _0x2c5ab1=this;return new Promise(function(_0x2615f9,_0x3dec5a){return db[_0x121e('0x18')]['destroy']({'where':_0xb2a63c['options']?_0xb2a63c[_0x121e('0x1a')][_0x121e('0x24')]||null:null})[_0x121e('0xc')](function(_0x19db31){logger[_0x121e('0xd')](_0x121e('0x25'),_0xb2a63c);logger[_0x121e('0x10')](_0x121e('0x25'),_0xb2a63c,JSON['stringify'](_0x19db31));_0x2615f9(_0x19db31);})[_0x121e('0x17')](function(_0x4325ea){logger['error'](_0x121e('0x25'),_0x4325ea[_0x121e('0x15')],_0xb2a63c);_0x3dec5a(_0x2c5ab1['error'](0x1f4,_0x4325ea[_0x121e('0x15')]));});});}; \ No newline at end of file +var _0x33dc=['error','code','message','result','catch','GetCmHopperBlack','findAll','options','raw','attributes','include','model','map','stringify','UpdateCmHopperBlack','CmHopperBlack','body','where','limit','DestroyCmHopperBlack','destroy','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s'];(function(_0x43576f,_0x1356ed){var _0x4d2466=function(_0x865deb){while(--_0x865deb){_0x43576f['push'](_0x43576f['shift']());}};_0x4d2466(++_0x1356ed);}(_0x33dc,0x126));var _0xc33d=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x33dc[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var util=require(_0xc33d('0x0'));var moment=require(_0xc33d('0x1'));var BPromise=require(_0xc33d('0x2'));var rs=require(_0xc33d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc33d('0x4'));var logger=require(_0xc33d('0x5'))(_0xc33d('0x6'));var config=require(_0xc33d('0x7'));var jayson=require(_0xc33d('0x8'));var client=jayson[_0xc33d('0x9')][_0xc33d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd580df,_0x1c9fe8,_0x6e6908){return new BPromise(function(_0x1f899f,_0x50edff){return client[_0xc33d('0xb')](_0xd580df,_0x6e6908)[_0xc33d('0xc')](function(_0x48af94){logger[_0xc33d('0xd')](_0xc33d('0xe'),_0x1c9fe8,_0xc33d('0xf'));logger[_0xc33d('0x10')](_0xc33d('0x11'),_0x1c9fe8,'request\x20sent',JSON['stringify'](_0x48af94));if(_0x48af94['error']){if(_0x48af94[_0xc33d('0x12')][_0xc33d('0x13')]===0x1f4){logger['error'](_0xc33d('0xe'),_0x1c9fe8,_0x48af94['error']['message']);return _0x50edff(_0x48af94['error'][_0xc33d('0x14')]);}logger[_0xc33d('0x12')]('CmHopperBlack,\x20%s,\x20%s',_0x1c9fe8,_0x48af94['error']['message']);return _0x1f899f(_0x48af94[_0xc33d('0x12')][_0xc33d('0x14')]);}else{logger[_0xc33d('0xd')](_0xc33d('0xe'),_0x1c9fe8,'request\x20sent');_0x1f899f(_0x48af94[_0xc33d('0x15')]['message']);}})[_0xc33d('0x16')](function(_0x44e1ca){logger[_0xc33d('0x12')](_0xc33d('0xe'),_0x1c9fe8,_0x44e1ca);_0x50edff(_0x44e1ca);});});}exports[_0xc33d('0x17')]=function(_0xfb9c04){var _0x119d98=this;return new Promise(function(_0x1c9005,_0x2d806c){return db['CmHopperBlack'][_0xc33d('0x18')]({'raw':_0xfb9c04[_0xc33d('0x19')]?_0xfb9c04[_0xc33d('0x19')][_0xc33d('0x1a')]===undefined?!![]:![]:!![],'where':_0xfb9c04[_0xc33d('0x19')]?_0xfb9c04[_0xc33d('0x19')]['where']||null:null,'attributes':_0xfb9c04[_0xc33d('0x19')]?_0xfb9c04['options'][_0xc33d('0x1b')]||null:null,'limit':_0xfb9c04[_0xc33d('0x19')]?_0xfb9c04[_0xc33d('0x19')]['limit']||null:null,'include':_0xfb9c04[_0xc33d('0x19')]?_0xfb9c04[_0xc33d('0x19')][_0xc33d('0x1c')]?_['map'](_0xfb9c04[_0xc33d('0x19')]['include'],function(_0x5712b8){return{'model':db[_0x5712b8[_0xc33d('0x1d')]],'as':_0x5712b8['as'],'attributes':_0x5712b8['attributes'],'include':_0x5712b8[_0xc33d('0x1c')]?_['map'](_0x5712b8['include'],function(_0x4e0b29){return{'model':db[_0x4e0b29[_0xc33d('0x1d')]],'as':_0x4e0b29['as'],'attributes':_0x4e0b29['attributes'],'include':_0x4e0b29[_0xc33d('0x1c')]?_[_0xc33d('0x1e')](_0x4e0b29['include'],function(_0x3dbee8){return{'model':db[_0x3dbee8[_0xc33d('0x1d')]],'as':_0x3dbee8['as'],'attributes':_0x3dbee8[_0xc33d('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b4d30){logger[_0xc33d('0xd')](_0xc33d('0x17'),_0xfb9c04);logger[_0xc33d('0x10')](_0xc33d('0x17'),_0xfb9c04,JSON[_0xc33d('0x1f')](_0x4b4d30));_0x1c9005(_0x4b4d30);})[_0xc33d('0x16')](function(_0x45f47c){logger['error'](_0xc33d('0x17'),_0x45f47c[_0xc33d('0x14')],_0xfb9c04);_0x2d806c(_0x119d98[_0xc33d('0x12')](0x1f4,_0x45f47c[_0xc33d('0x14')]));});});};exports[_0xc33d('0x20')]=function(_0x446b83){var _0x2014a8=this;return new Promise(function(_0x1543e7,_0x416fb7){return db[_0xc33d('0x21')]['update'](_0x446b83[_0xc33d('0x22')],{'raw':_0x446b83['options']?_0x446b83[_0xc33d('0x19')][_0xc33d('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x446b83[_0xc33d('0x19')]?_0x446b83['options'][_0xc33d('0x23')]||null:null,'attributes':_0x446b83[_0xc33d('0x19')]?_0x446b83[_0xc33d('0x19')][_0xc33d('0x1b')]||null:null,'limit':_0x446b83[_0xc33d('0x19')]?_0x446b83[_0xc33d('0x19')][_0xc33d('0x24')]||null:null})[_0xc33d('0xc')](function(_0x5974a0){logger[_0xc33d('0xd')](_0xc33d('0x20'),_0x446b83);logger['debug'](_0xc33d('0x20'),_0x446b83,JSON[_0xc33d('0x1f')](_0x5974a0));_0x1543e7(_0x5974a0);})[_0xc33d('0x16')](function(_0x420638){logger[_0xc33d('0x12')](_0xc33d('0x20'),_0x420638[_0xc33d('0x14')],_0x446b83);_0x416fb7(_0x2014a8[_0xc33d('0x12')](0x1f4,_0x420638[_0xc33d('0x14')]));});});};exports[_0xc33d('0x25')]=function(_0x1bc658){var _0x593dd6=this;return new Promise(function(_0x5d4868,_0xc0f67f){return db['CmHopperBlack'][_0xc33d('0x26')]({'where':_0x1bc658['options']?_0x1bc658[_0xc33d('0x19')][_0xc33d('0x23')]||null:null})[_0xc33d('0xc')](function(_0x365db0){logger[_0xc33d('0xd')]('DestroyCmHopperBlack',_0x1bc658);logger['debug']('DestroyCmHopperBlack',_0x1bc658,JSON['stringify'](_0x365db0));_0x5d4868(_0x365db0);})['catch'](function(_0x3dcd64){logger[_0xc33d('0x12')](_0xc33d('0x25'),_0x3dcd64[_0xc33d('0x14')],_0x1bc658);_0xc0f67f(_0x593dd6[_0xc33d('0x12')](0x1f4,_0x3dcd64[_0xc33d('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index d8eca21..fee7a7b 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 _0xbd60=['../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','get','isAuthenticated','/describe','describe','/:id','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x27ea81,_0x12a73f){var _0x57ccc0=function(_0x56a1a1){while(--_0x56a1a1){_0x27ea81['push'](_0x27ea81['shift']());}};_0x57ccc0(++_0x12a73f);}(_0xbd60,0x162));var _0x0bd6=function(_0x3fd073,_0x32931f){_0x3fd073=_0x3fd073-0x0;var _0x40d7b1=_0xbd60[_0x3fd073];return _0x40d7b1;};'use strict';var multer=require(_0x0bd6('0x0'));var util=require(_0x0bd6('0x1'));var path=require(_0x0bd6('0x2'));var timeout=require(_0x0bd6('0x3'));var express=require(_0x0bd6('0x4'));var router=express[_0x0bd6('0x5')]();var auth=require(_0x0bd6('0x6'));var interaction=require(_0x0bd6('0x7'));var config=require('../../config/environment');var controller=require(_0x0bd6('0x8'));router[_0x0bd6('0x9')]('/',auth[_0x0bd6('0xa')](),controller['index']);router[_0x0bd6('0x9')](_0x0bd6('0xb'),auth[_0x0bd6('0xa')](),controller[_0x0bd6('0xc')]);router[_0x0bd6('0x9')](_0x0bd6('0xd'),auth[_0x0bd6('0xa')](),controller[_0x0bd6('0xe')]);router[_0x0bd6('0xf')]('/:id',auth[_0x0bd6('0xa')](),controller[_0x0bd6('0x10')]);router[_0x0bd6('0x11')](_0x0bd6('0xd'),auth[_0x0bd6('0xa')](),controller[_0x0bd6('0x12')]);module[_0x0bd6('0x13')]=router; \ No newline at end of file +var _0x2e78=['../../components/interaction/service','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','/:id','show','put','delete','destroy','multer','util','path','express','Router'];(function(_0x1fbdc7,_0x410032){var _0x149435=function(_0x9fd0ee){while(--_0x9fd0ee){_0x1fbdc7['push'](_0x1fbdc7['shift']());}};_0x149435(++_0x410032);}(_0x2e78,0xab));var _0x82e7=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x2e78[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x82e7('0x0'));var util=require(_0x82e7('0x1'));var path=require(_0x82e7('0x2'));var timeout=require('connect-timeout');var express=require(_0x82e7('0x3'));var router=express[_0x82e7('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x82e7('0x5'));var config=require('../../config/environment');var controller=require(_0x82e7('0x6'));router[_0x82e7('0x7')]('/',auth[_0x82e7('0x8')](),controller[_0x82e7('0x9')]);router[_0x82e7('0x7')](_0x82e7('0xa'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x82e7('0xb'),auth[_0x82e7('0x8')](),controller[_0x82e7('0xc')]);router[_0x82e7('0xd')](_0x82e7('0xb'),auth[_0x82e7('0x8')](),controller['update']);router[_0x82e7('0xe')]('/:id',auth[_0x82e7('0x8')](),controller[_0x82e7('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index dd41f32..f8ddc5d 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 _0xc53d=['diff','seconds','setDataValue','dispositionat','BOOLEAN','INTEGER','STRING','DATE','endtime'];(function(_0x3f1ef3,_0x3198b7){var _0x4ef877=function(_0x2856b5){while(--_0x2856b5){_0x3f1ef3['push'](_0x3f1ef3['shift']());}};_0x4ef877(++_0x3198b7);}(_0xc53d,0x10a));var _0xdc53=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc53d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'state':{'type':Sequelize[_0xdc53('0x0')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xdc53('0x0')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xdc53('0x0')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xdc53('0x0')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xdc53('0x1')]},'originatecalleridnum':{'type':Sequelize[_0xdc53('0x1')]},'originatecalleridname':{'type':Sequelize[_0xdc53('0x1')]},'calleridnum':{'type':Sequelize[_0xdc53('0x1')]},'calleridname':{'type':Sequelize[_0xdc53('0x1')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xdc53('0x2')]},'droptime':{'type':Sequelize[_0xdc53('0x2')]},'endtime':{'type':Sequelize[_0xdc53('0x2')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xdc53('0x0')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xdc53('0x0')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xdc53('0x0')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xdc53('0x1')]},'campaigntype':{'type':Sequelize[_0xdc53('0x1')]},'membername':{'type':Sequelize[_0xdc53('0x1')]},'reason':{'type':Sequelize[_0xdc53('0x1')]},'disposition':{'type':Sequelize[_0xdc53('0x1')]},'dispositionat':{'type':Sequelize[_0xdc53('0x2')],'set':function(_0x1a4419){var _0x2a5475=this['getDataValue'](_0xdc53('0x3'));if(_0x2a5475&&_0x1a4419){this['setDataValue']('followuptime',moment(_0x1a4419)[_0xdc53('0x4')](moment(_0x2a5475),_0xdc53('0x5')));}return this[_0xdc53('0x6')](_0xdc53('0x7'),_0x1a4419);}},'amd':{'type':Sequelize[_0xdc53('0x8')],'defaultValue':![]},'fax':{'type':Sequelize[_0xdc53('0x8')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xdc53('0x8')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xdc53('0x2')]},'callback':{'type':Sequelize[_0xdc53('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xdc53('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0xdc53('0x1')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xdc53('0x8')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xdc53('0x2')]}}; \ No newline at end of file +var _0x1f45=['getDataValue','followuptime','diff','dispositionat','BOOLEAN','moment','exports','INTEGER','STRING','DATE'];(function(_0x3d7f78,_0x2ae661){var _0x1084ab=function(_0x4a2bb0){while(--_0x4a2bb0){_0x3d7f78['push'](_0x3d7f78['shift']());}};_0x1084ab(++_0x2ae661);}(_0x1f45,0x131));var _0x51f4=function(_0x17411b,_0x42f86f){_0x17411b=_0x17411b-0x0;var _0x63878a=_0x1f45[_0x17411b];return _0x63878a;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x51f4('0x0'));module[_0x51f4('0x1')]={'state':{'type':Sequelize[_0x51f4('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x51f4('0x3')]},'scheduledat':{'type':Sequelize[_0x51f4('0x4')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x51f4('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x51f4('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x51f4('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x51f4('0x3')]},'calleridname':{'type':Sequelize[_0x51f4('0x3')]},'starttime':{'type':Sequelize[_0x51f4('0x4')]},'responsetime':{'type':Sequelize[_0x51f4('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x51f4('0x4')]},'endtime':{'type':Sequelize[_0x51f4('0x4')]},'ringtime':{'type':Sequelize[_0x51f4('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x51f4('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x51f4('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x51f4('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x51f4('0x3')]},'campaign':{'type':Sequelize[_0x51f4('0x3')]},'campaigntype':{'type':Sequelize[_0x51f4('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x51f4('0x3')]},'disposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x51f4('0x4')],'set':function(_0x42a651){var _0x2bb082=this[_0x51f4('0x5')]('endtime');if(_0x2bb082&&_0x42a651){this['setDataValue'](_0x51f4('0x6'),moment(_0x42a651)[_0x51f4('0x7')](moment(_0x2bb082),'seconds'));}return this['setDataValue'](_0x51f4('0x8'),_0x42a651);}},'amd':{'type':Sequelize[_0x51f4('0x9')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x51f4('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x51f4('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x51f4('0x4')]},'deleted':{'type':Sequelize[_0x51f4('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x51f4('0x4')]},'recallme':{'type':Sequelize[_0x51f4('0x9')],'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 4a6babb..e8c8b90 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 _0x2a4b=['attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','CmHopperFinal','count','includeAll','include','rows','catch','show','params','intersection','find','update','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','noSuchContacts','noAnswerContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','countContactsIvrCampaignHopperFinal','findAll','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','busyContacts','`state`\x20=\x2011\x20,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','cm_hopper','fromQuery','scheduledAt','ListId','VoiceQueueId','select','ANY_VALUE(calleridnum)','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','updatedAt','cm_hopper_final','VoiceQueueId\x20=\x20?','state','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','ContactId','moveContactsIvrCampaignHopperFinal','Campaign','into','createdAt','CampaignId','from','CampaignId\x20=\x20?','state\x20=\x20?','calleridnum','group','checkContactHopper','findOne','html-pdf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','set','Content-Range','apply','reject','then','destroy','sendStatus','error','name','send','index','rawAttributes','keys','query','filters'];(function(_0x329cd9,_0x351296){var _0x4ebe34=function(_0x586c9d){while(--_0x586c9d){_0x329cd9['push'](_0x329cd9['shift']());}};_0x4ebe34(++_0x351296);}(_0x2a4b,0x14c));var _0xb2a4=function(_0x45a2ca,_0xaf2c63){_0x45a2ca=_0x45a2ca-0x0;var _0x9a8748=_0x2a4b[_0x45a2ca];return _0x9a8748;};'use strict';var pdf=require(_0xb2a4('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb2a4('0x1'));var jsonpatch=require(_0xb2a4('0x2'));var rp=require(_0xb2a4('0x3'));var moment=require(_0xb2a4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb2a4('0x5'));var util=require(_0xb2a4('0x6'));var path=require('path');var sox=require(_0xb2a4('0x7'));var csv=require(_0xb2a4('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb2a4('0x9'));var squel=require(_0xb2a4('0xa'));var crypto=require(_0xb2a4('0xb'));var jsforce=require(_0xb2a4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb2a4('0xd'));var Papa=require(_0xb2a4('0xe'));var Redis=require('ioredis');var authService=require(_0xb2a4('0xf'));var qs=require(_0xb2a4('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xb2a4('0x11'));var config=require(_0xb2a4('0x12'));var db=require(_0xb2a4('0x13'))['db'];function respondWithStatusCode(_0x3637d2,_0x3fa213){_0x3fa213=_0x3fa213||0xcc;return function(_0x119c9a){if(_0x119c9a){return _0x3637d2['sendStatus'](_0x3fa213);}return _0x3637d2[_0xb2a4('0x14')](_0x3fa213)[_0xb2a4('0x15')]();};}function respondWithResult(_0x35e719,_0x408705){_0x408705=_0x408705||0xc8;return function(_0x53458c){if(_0x53458c){return _0x35e719[_0xb2a4('0x14')](_0x408705)[_0xb2a4('0x16')](_0x53458c);}};}function respondWithFilteredResult(_0x1aa50a,_0x40b6e3){return function(_0x1898aa){if(_0x1898aa){var _0x6b30b3=_0x1898aa['count'],_0x255575=_0x40b6e3[_0xb2a4('0x17')],_0x562c8d=_0x40b6e3['offset']+_0x40b6e3[_0xb2a4('0x18')],_0x1db585;if(_0x562c8d>=_0x6b30b3){_0x562c8d=_0x6b30b3;_0x1db585=0xc8;}else{_0x1db585=0xce;}_0x1aa50a[_0xb2a4('0x14')](_0x1db585);return _0x1aa50a[_0xb2a4('0x19')](_0xb2a4('0x1a'),_0x255575+'-'+_0x562c8d+'/'+_0x6b30b3)[_0xb2a4('0x16')](_0x1898aa);}return null;};}function patchUpdates(_0x69a8a0){return function(_0x1b9868){try{jsonpatch[_0xb2a4('0x1b')](_0x1b9868,_0x69a8a0,!![]);}catch(_0x357848){return BPromise[_0xb2a4('0x1c')](_0x357848);}return _0x1b9868['save']();};}function saveUpdates(_0x3bde3c,_0x2a8f35){return function(_0x186df4){if(_0x186df4){return _0x186df4['update'](_0x3bde3c)[_0xb2a4('0x1d')](function(_0x262f3f){return _0x262f3f;});}return null;};}function removeEntity(_0x5667fa,_0x5a2187){return function(_0x23d0c5){if(_0x23d0c5){return _0x23d0c5[_0xb2a4('0x1e')]()[_0xb2a4('0x1d')](function(){_0x5667fa[_0xb2a4('0x14')](0xcc)[_0xb2a4('0x15')]();});}};}function handleEntityNotFound(_0x55629d,_0x35288b){return function(_0x5beca9){if(!_0x5beca9){_0x55629d[_0xb2a4('0x1f')](0x194);}return _0x5beca9;};}function handleError(_0x4f6f3b,_0x741ac4){_0x741ac4=_0x741ac4||0x1f4;return function(_0x120cf1){logger[_0xb2a4('0x20')](_0x120cf1['stack']);if(_0x120cf1['name']){delete _0x120cf1[_0xb2a4('0x21')];}_0x4f6f3b[_0xb2a4('0x14')](_0x741ac4)[_0xb2a4('0x22')](_0x120cf1);};}exports[_0xb2a4('0x23')]=function(_0x4f22b6,_0x39fbd5){var _0x833499={},_0x37bebc={},_0x1640c4={'count':0x0,'rows':[]};var _0x1ae6c3=db['CmHopperFinal'][_0xb2a4('0x24')];_0x37bebc['model']=_[_0xb2a4('0x25')](_0x1ae6c3);_0x37bebc['query']=_[_0xb2a4('0x25')](_0x4f22b6[_0xb2a4('0x26')]);_0x37bebc[_0xb2a4('0x27')]=_['intersection'](_0x37bebc['model'],_0x37bebc[_0xb2a4('0x26')]);_0x833499[_0xb2a4('0x28')]=_['intersection'](_0x37bebc['model'],qs[_0xb2a4('0x29')](_0x4f22b6[_0xb2a4('0x26')][_0xb2a4('0x29')]));_0x833499['attributes']=_0x833499['attributes'][_0xb2a4('0x2a')]?_0x833499[_0xb2a4('0x28')]:_0x37bebc[_0xb2a4('0x2b')];if(!_0x4f22b6['query'][_0xb2a4('0x2c')](_0xb2a4('0x2d'))){_0x833499[_0xb2a4('0x18')]=qs[_0xb2a4('0x18')](_0x4f22b6[_0xb2a4('0x26')][_0xb2a4('0x18')]);_0x833499['offset']=qs['offset'](_0x4f22b6[_0xb2a4('0x26')][_0xb2a4('0x17')]);}_0x833499[_0xb2a4('0x2e')]=qs[_0xb2a4('0x2f')](_0x4f22b6[_0xb2a4('0x26')][_0xb2a4('0x2f')]);_0x833499['where']=qs[_0xb2a4('0x27')](_[_0xb2a4('0x30')](_0x4f22b6[_0xb2a4('0x26')],_0x37bebc[_0xb2a4('0x27')]));if(_0x4f22b6[_0xb2a4('0x26')][_0xb2a4('0x31')]){_0x833499[_0xb2a4('0x32')]=_[_0xb2a4('0x33')](_0x833499[_0xb2a4('0x32')],{'$or':_[_0xb2a4('0x34')](_0x1ae6c3,function(_0x135e01){if(_0x135e01[_0xb2a4('0x35')][_0xb2a4('0x36')]!==_0xb2a4('0x37')){var _0x39dd85={};_0x39dd85[_0x135e01[_0xb2a4('0x38')]]={'$like':'%'+_0x4f22b6[_0xb2a4('0x26')]['filter']+'%'};return _0x39dd85;}})});}_0x833499=_[_0xb2a4('0x33')]({},_0x833499,_0x4f22b6[_0xb2a4('0x39')]);var _0x706f09={'where':_0x833499['where']};return db[_0xb2a4('0x3a')]['count'](_0x706f09)[_0xb2a4('0x1d')](function(_0x33281f){_0x1640c4[_0xb2a4('0x3b')]=_0x33281f;if(_0x4f22b6[_0xb2a4('0x26')][_0xb2a4('0x3c')]){_0x833499[_0xb2a4('0x3d')]=[{'all':!![]}];}return db[_0xb2a4('0x3a')]['findAll'](_0x833499);})[_0xb2a4('0x1d')](function(_0x4c1b6a){_0x1640c4[_0xb2a4('0x3e')]=_0x4c1b6a;return _0x1640c4;})[_0xb2a4('0x1d')](respondWithFilteredResult(_0x39fbd5,_0x833499))[_0xb2a4('0x3f')](handleError(_0x39fbd5,null));};exports[_0xb2a4('0x40')]=function(_0x33599c,_0x307ceb){var _0x198abe={'raw':!![],'where':{'id':_0x33599c[_0xb2a4('0x41')]['id']}},_0x31fbbc={};_0x31fbbc[_0xb2a4('0x2b')]=_[_0xb2a4('0x25')](db['CmHopperFinal'][_0xb2a4('0x24')]);_0x31fbbc[_0xb2a4('0x26')]=_[_0xb2a4('0x25')](_0x33599c[_0xb2a4('0x26')]);_0x31fbbc['filters']=_[_0xb2a4('0x42')](_0x31fbbc['model'],_0x31fbbc[_0xb2a4('0x26')]);_0x198abe['attributes']=_['intersection'](_0x31fbbc[_0xb2a4('0x2b')],qs[_0xb2a4('0x29')](_0x33599c[_0xb2a4('0x26')][_0xb2a4('0x29')]));_0x198abe['attributes']=_0x198abe[_0xb2a4('0x28')][_0xb2a4('0x2a')]?_0x198abe[_0xb2a4('0x28')]:_0x31fbbc['model'];if(_0x33599c[_0xb2a4('0x26')]['includeAll']){_0x198abe['include']=[{'all':!![]}];}_0x198abe=_[_0xb2a4('0x33')]({},_0x198abe,_0x33599c[_0xb2a4('0x39')]);return db[_0xb2a4('0x3a')][_0xb2a4('0x43')](_0x198abe)[_0xb2a4('0x1d')](handleEntityNotFound(_0x307ceb,null))[_0xb2a4('0x1d')](respondWithResult(_0x307ceb,null))[_0xb2a4('0x3f')](handleError(_0x307ceb,null));};exports['describe']=function(_0x4d47ad,_0x20a509){return db[_0xb2a4('0x3a')]['describe']()[_0xb2a4('0x1d')](respondWithResult(_0x20a509,null))['catch'](handleError(_0x20a509,null));};exports[_0xb2a4('0x44')]=function(_0x5e878f,_0x2dcdb0){if(_0x5e878f[_0xb2a4('0x45')][_0xb2a4('0x46')]){delete _0x5e878f[_0xb2a4('0x45')][_0xb2a4('0x46')];}return db['CmHopperFinal'][_0xb2a4('0x43')]({'where':{'uniqueid':_0x5e878f[_0xb2a4('0x41')]['id']}})[_0xb2a4('0x1d')](handleEntityNotFound(_0x2dcdb0,null))['then'](saveUpdates(_0x5e878f[_0xb2a4('0x45')],null))[_0xb2a4('0x1d')](respondWithResult(_0x2dcdb0,null))['catch'](handleError(_0x2dcdb0,null));};exports[_0xb2a4('0x47')]=function(_0x1c3c2c,_0x40f2ce,_0x29d47f){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'VoiceQueueId':_0x1c3c2c['params']['id']},'attributes':[[db[_0xb2a4('0x48')]['fn'](_0xb2a4('0x49'),db['sequelize']['fn']('IF',db[_0xb2a4('0x48')][_0xb2a4('0x4a')]('`state`\x20=\x200,\x201,\x20null'))),_0xb2a4('0x4b')],[db[_0xb2a4('0x48')]['fn'](_0xb2a4('0x49'),db[_0xb2a4('0x48')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x203,\x201,\x20null'))),_0xb2a4('0x4c')],[db[_0xb2a4('0x48')]['fn'](_0xb2a4('0x49'),db['sequelize']['fn']('IF',db[_0xb2a4('0x48')][_0xb2a4('0x4a')]('`state`\x20=\x205,\x201,\x20null'))),'busyContacts'],[db[_0xb2a4('0x48')]['fn'](_0xb2a4('0x49'),db[_0xb2a4('0x48')]['fn']('IF',db[_0xb2a4('0x48')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0xb2a4('0x4d')],[db[_0xb2a4('0x48')]['fn'](_0xb2a4('0x49'),db[_0xb2a4('0x48')]['fn']('IF',db[_0xb2a4('0x48')][_0xb2a4('0x4a')](_0xb2a4('0x4e')))),_0xb2a4('0x4f')],[db[_0xb2a4('0x48')]['fn'](_0xb2a4('0x49'),db[_0xb2a4('0x48')]['fn']('IF',db[_0xb2a4('0x48')][_0xb2a4('0x4a')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xb2a4('0x50')],[db[_0xb2a4('0x48')]['fn']('COUNT',db[_0xb2a4('0x48')]['fn']('IF',db[_0xb2a4('0x48')][_0xb2a4('0x4a')](_0xb2a4('0x51')))),_0xb2a4('0x52')],[db[_0xb2a4('0x48')]['fn'](_0xb2a4('0x49'),db['sequelize']['fn']('IF',db[_0xb2a4('0x48')][_0xb2a4('0x4a')]('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0xb2a4('0x1d')](handleEntityNotFound(_0x40f2ce,null))[_0xb2a4('0x1d')](respondWithResult(_0x40f2ce,null))[_0xb2a4('0x3f')](handleError(_0x40f2ce,null));};exports[_0xb2a4('0x53')]=function(_0x5658a8,_0x4244e2,_0xaef94a){return db[_0xb2a4('0x3a')][_0xb2a4('0x54')]({'raw':![],'where':{'CampaignId':_0x5658a8[_0xb2a4('0x41')]['id']},'attributes':[[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xb2a4('0x48')][_0xb2a4('0x4a')](_0xb2a4('0x55')))),_0xb2a4('0x4b')],[db[_0xb2a4('0x48')]['fn']('COUNT',db[_0xb2a4('0x48')]['fn']('IF',db[_0xb2a4('0x48')][_0xb2a4('0x4a')](_0xb2a4('0x56')))),_0xb2a4('0x4c')],[db[_0xb2a4('0x48')]['fn'](_0xb2a4('0x49'),db[_0xb2a4('0x48')]['fn']('IF',db[_0xb2a4('0x48')][_0xb2a4('0x4a')]('`state`\x20=\x205,\x201,\x20null'))),_0xb2a4('0x57')],[db[_0xb2a4('0x48')]['fn'](_0xb2a4('0x49'),db[_0xb2a4('0x48')]['fn']('IF',db[_0xb2a4('0x48')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0xb2a4('0x4d')],[db[_0xb2a4('0x48')]['fn']('COUNT',db[_0xb2a4('0x48')]['fn']('IF',db['sequelize'][_0xb2a4('0x4a')](_0xb2a4('0x4e')))),_0xb2a4('0x4f')],[db['sequelize']['fn'](_0xb2a4('0x49'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xb2a4('0x58')))),_0xb2a4('0x50')],[db[_0xb2a4('0x48')]['fn'](_0xb2a4('0x49'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xb2a4('0x51')))),'reCallContacts'],[db[_0xb2a4('0x48')]['fn'](_0xb2a4('0x49'),db[_0xb2a4('0x48')]['fn']('IF',db[_0xb2a4('0x48')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})['then'](handleEntityNotFound(_0x4244e2,null))[_0xb2a4('0x1d')](respondWithResult(_0x4244e2,null))[_0xb2a4('0x3f')](handleError(_0x4244e2,null));};exports[_0xb2a4('0x59')]=function(_0x3021b0,_0xb9f6f9,_0x586fc0){return db[_0xb2a4('0x5a')][_0xb2a4('0x43')]({'where':{'id':_0x3021b0[_0xb2a4('0x41')]['id']}})[_0xb2a4('0x1d')](handleEntityNotFound(_0xb9f6f9,null))[_0xb2a4('0x1d')](function(_0x4686a4){var _0xd6a8f9;if(_0x4686a4){_0xd6a8f9=squel[_0xb2a4('0x5b')]()['into'](_0xb2a4('0x5c'))[_0xb2a4('0x5d')](['phone',_0xb2a4('0x5e'),'ContactId',_0xb2a4('0x5f'),_0xb2a4('0x60'),'createdAt','updatedAt'],squel[_0xb2a4('0x61')]()['field'](_0xb2a4('0x62'),_0xb2a4('0x63'))[_0xb2a4('0x38')](_0xb2a4('0x64'),_0xb2a4('0x5e'))[_0xb2a4('0x38')](_0xb2a4('0x65'),'ContactId')[_0xb2a4('0x38')](_0xb2a4('0x66'),'ListId')[_0xb2a4('0x38')](_0xb2a4('0x67'),_0xb2a4('0x60'))[_0xb2a4('0x38')](_0xb2a4('0x64'),'createdAt')[_0xb2a4('0x38')](_0xb2a4('0x64'),_0xb2a4('0x68'))['from'](_0xb2a4('0x69'))[_0xb2a4('0x32')](_0xb2a4('0x6a'),_0x3021b0[_0xb2a4('0x41')]['id']['toString']())[_0xb2a4('0x32')]('state\x20=\x20?',_0x3021b0[_0xb2a4('0x45')][_0xb2a4('0x6b')][_0xb2a4('0x6c')]())[_0xb2a4('0x32')](_0xb2a4('0x6d'))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xb2a4('0x61')]()[_0xb2a4('0x38')](_0xb2a4('0x63'))['from'](_0xb2a4('0x5c'))['where']('VoiceQueueId\x20=\x20?',_0x3021b0[_0xb2a4('0x41')]['id'][_0xb2a4('0x6c')]()))[_0xb2a4('0x32')](_0xb2a4('0x6e'),squel['select']()[_0xb2a4('0x38')]('calleridnum')['from'](_0xb2a4('0x69'))[_0xb2a4('0x32')](_0xb2a4('0x6a'),_0x3021b0[_0xb2a4('0x41')]['id'][_0xb2a4('0x6c')]())[_0xb2a4('0x32')]('state\x20=\x204'))['group'](_0xb2a4('0x6f')))[_0xb2a4('0x6c')]();return db[_0xb2a4('0x48')]['query'](_0xd6a8f9);}return[];})[_0xb2a4('0x1d')](respondWithResult(_0xb9f6f9,null))[_0xb2a4('0x3f')](handleError(_0xb9f6f9,null));};exports[_0xb2a4('0x70')]=function(_0x6d7405,_0x16c2b1,_0x263e5c){return db[_0xb2a4('0x71')]['find']({'where':{'id':_0x6d7405['params']['id']}})[_0xb2a4('0x1d')](handleEntityNotFound(_0x16c2b1,null))[_0xb2a4('0x1d')](function(_0xff7538){var _0x1e9988;if(_0xff7538){_0x1e9988=squel['insert']()[_0xb2a4('0x72')]('cm_hopper')[_0xb2a4('0x5d')](['phone',_0xb2a4('0x5e'),_0xb2a4('0x6f'),_0xb2a4('0x5f'),'CampaignId',_0xb2a4('0x73'),_0xb2a4('0x68')],squel[_0xb2a4('0x61')]()[_0xb2a4('0x38')]('ANY_VALUE(calleridnum)',_0xb2a4('0x63'))['field'](_0xb2a4('0x64'),'scheduledAt')['field'](_0xb2a4('0x65'),_0xb2a4('0x6f'))[_0xb2a4('0x38')](_0xb2a4('0x66'),_0xb2a4('0x5f'))[_0xb2a4('0x38')]('ANY_VALUE(CampaignId)',_0xb2a4('0x74'))[_0xb2a4('0x38')](_0xb2a4('0x64'),'createdAt')[_0xb2a4('0x38')](_0xb2a4('0x64'),'updatedAt')[_0xb2a4('0x75')](_0xb2a4('0x69'))[_0xb2a4('0x32')](_0xb2a4('0x76'),_0x6d7405[_0xb2a4('0x41')]['id'][_0xb2a4('0x6c')]())['where'](_0xb2a4('0x77'),_0x6d7405[_0xb2a4('0x45')][_0xb2a4('0x6b')][_0xb2a4('0x6c')]())['where'](_0xb2a4('0x6d'))['where'](_0xb2a4('0x6e'),squel['select']()['field'](_0xb2a4('0x63'))[_0xb2a4('0x75')](_0xb2a4('0x5c'))['where'](_0xb2a4('0x76'),_0x6d7405[_0xb2a4('0x41')]['id'][_0xb2a4('0x6c')]()))['where'](_0xb2a4('0x6e'),squel[_0xb2a4('0x61')]()[_0xb2a4('0x38')](_0xb2a4('0x78'))[_0xb2a4('0x75')]('cm_hopper_final')[_0xb2a4('0x32')](_0xb2a4('0x76'),_0x6d7405['params']['id'][_0xb2a4('0x6c')]())[_0xb2a4('0x32')]('state\x20=\x204'))[_0xb2a4('0x79')](_0xb2a4('0x6f')))[_0xb2a4('0x6c')]();return db['sequelize'][_0xb2a4('0x26')](_0x1e9988);}return[];})[_0xb2a4('0x1d')](respondWithResult(_0x16c2b1,null))['catch'](handleError(_0x16c2b1,null));};exports[_0xb2a4('0x7a')]=function(_0x21bf9b,_0x5dded6,_0x434d7f){return db['CmHopper'][_0xb2a4('0x7b')]({'where':{'VoiceQueueId':_0x21bf9b[_0xb2a4('0x45')]['VoiceQueueId'],'CampaignId':_0x21bf9b['body'][_0xb2a4('0x74')],'ContactId':_0x21bf9b['body'][_0xb2a4('0x6f')]}})['then'](handleEntityNotFound(_0x5dded6,null))[_0xb2a4('0x1d')](function(_0x5219d9){if(_0x5219d9){return _0x5219d9;}return null;})['then'](respondWithResult(_0x5dded6,null))[_0xb2a4('0x3f')](handleError(_0x5dded6,null));}; \ No newline at end of file +var _0x70cd=['`state`\x20=\x208,\x201,\x20null','congestionContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','busyContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','VoiceQueue','params','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','scheduledAt','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','NOW()','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','moveContactsIvrCampaignHopperFinal','Campaign','ANY_VALUE(calleridnum)','CampaignId','CampaignId\x20=\x20?','checkContactHopper','findOne','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','rawAttributes','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filter','merge','map','type','key','field','options','CmHopperFinal','includeAll','include','findAll','rows','catch','length','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','noAnswerContacts','`state`\x20=\x205,\x201,\x20null'];(function(_0x5b9d3a,_0x1f1842){var _0x383375=function(_0xd8fa11){while(--_0xd8fa11){_0x5b9d3a['push'](_0x5b9d3a['shift']());}};_0x383375(++_0x1f1842);}(_0x70cd,0xad));var _0xd70c=function(_0x2797c6,_0x37421b){_0x2797c6=_0x2797c6-0x0;var _0x54809f=_0x70cd[_0x2797c6];return _0x54809f;};'use strict';var pdf=require(_0xd70c('0x0'));var emlformat=require(_0xd70c('0x1'));var rimraf=require(_0xd70c('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd70c('0x3'));var rp=require('request-promise');var moment=require(_0xd70c('0x4'));var BPromise=require(_0xd70c('0x5'));var Mustache=require('mustache');var util=require(_0xd70c('0x6'));var path=require('path');var sox=require(_0xd70c('0x7'));var csv=require(_0xd70c('0x8'));var ejs=require(_0xd70c('0x9'));var fs=require('fs');var _=require(_0xd70c('0xa'));var squel=require(_0xd70c('0xb'));var crypto=require(_0xd70c('0xc'));var jsforce=require(_0xd70c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd70c('0x8'));var querystring=require(_0xd70c('0xe'));var Papa=require(_0xd70c('0xf'));var Redis=require(_0xd70c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd70c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd70c('0x12'))(_0xd70c('0x13'));var utils=require(_0xd70c('0x14'));var config=require(_0xd70c('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14afa5,_0x16db63){_0x16db63=_0x16db63||0xcc;return function(_0x11c29a){if(_0x11c29a){return _0x14afa5[_0xd70c('0x16')](_0x16db63);}return _0x14afa5[_0xd70c('0x17')](_0x16db63)[_0xd70c('0x18')]();};}function respondWithResult(_0x4b8c75,_0x5ae129){_0x5ae129=_0x5ae129||0xc8;return function(_0x5ea211){if(_0x5ea211){return _0x4b8c75[_0xd70c('0x17')](_0x5ae129)[_0xd70c('0x19')](_0x5ea211);}};}function respondWithFilteredResult(_0x133d5f,_0x54d70f){return function(_0x30d13f){if(_0x30d13f){var _0x2f5725=_0x30d13f[_0xd70c('0x1a')],_0x2da7a7=_0x54d70f['offset'],_0x5f3805=_0x54d70f[_0xd70c('0x1b')]+_0x54d70f[_0xd70c('0x1c')],_0x17ee2c;if(_0x5f3805>=_0x2f5725){_0x5f3805=_0x2f5725;_0x17ee2c=0xc8;}else{_0x17ee2c=0xce;}_0x133d5f[_0xd70c('0x17')](_0x17ee2c);return _0x133d5f[_0xd70c('0x1d')](_0xd70c('0x1e'),_0x2da7a7+'-'+_0x5f3805+'/'+_0x2f5725)[_0xd70c('0x19')](_0x30d13f);}return null;};}function patchUpdates(_0x4666e9){return function(_0x3ea8ff){try{jsonpatch[_0xd70c('0x1f')](_0x3ea8ff,_0x4666e9,!![]);}catch(_0x1a6427){return BPromise[_0xd70c('0x20')](_0x1a6427);}return _0x3ea8ff[_0xd70c('0x21')]();};}function saveUpdates(_0x374f60,_0x1a3265){return function(_0x16b86b){if(_0x16b86b){return _0x16b86b[_0xd70c('0x22')](_0x374f60)[_0xd70c('0x23')](function(_0x5ea32c){return _0x5ea32c;});}return null;};}function removeEntity(_0x3cfb42,_0x311acc){return function(_0x5ba09f){if(_0x5ba09f){return _0x5ba09f[_0xd70c('0x24')]()[_0xd70c('0x23')](function(){_0x3cfb42[_0xd70c('0x17')](0xcc)[_0xd70c('0x18')]();});}};}function handleEntityNotFound(_0x19c192,_0x574756){return function(_0x26672a){if(!_0x26672a){_0x19c192[_0xd70c('0x16')](0x194);}return _0x26672a;};}function handleError(_0x1a4458,_0x54ddd9){_0x54ddd9=_0x54ddd9||0x1f4;return function(_0x4d2202){logger[_0xd70c('0x25')](_0x4d2202[_0xd70c('0x26')]);if(_0x4d2202[_0xd70c('0x27')]){delete _0x4d2202[_0xd70c('0x27')];}_0x1a4458['status'](_0x54ddd9)[_0xd70c('0x28')](_0x4d2202);};}exports['index']=function(_0x7b3e85,_0x1c4ede){var _0x45a09a={},_0x45a84b={},_0x9d558e={'count':0x0,'rows':[]};var _0x3b4fe3=db['CmHopperFinal'][_0xd70c('0x29')];_0x45a84b[_0xd70c('0x2a')]=_['keys'](_0x3b4fe3);_0x45a84b[_0xd70c('0x2b')]=_[_0xd70c('0x2c')](_0x7b3e85[_0xd70c('0x2b')]);_0x45a84b[_0xd70c('0x2d')]=_['intersection'](_0x45a84b[_0xd70c('0x2a')],_0x45a84b[_0xd70c('0x2b')]);_0x45a09a[_0xd70c('0x2e')]=_[_0xd70c('0x2f')](_0x45a84b[_0xd70c('0x2a')],qs[_0xd70c('0x30')](_0x7b3e85[_0xd70c('0x2b')]['fields']));_0x45a09a['attributes']=_0x45a09a[_0xd70c('0x2e')]['length']?_0x45a09a[_0xd70c('0x2e')]:_0x45a84b[_0xd70c('0x2a')];if(!_0x7b3e85[_0xd70c('0x2b')][_0xd70c('0x31')](_0xd70c('0x32'))){_0x45a09a[_0xd70c('0x1c')]=qs[_0xd70c('0x1c')](_0x7b3e85['query'][_0xd70c('0x1c')]);_0x45a09a[_0xd70c('0x1b')]=qs['offset'](_0x7b3e85['query']['offset']);}_0x45a09a['order']=qs[_0xd70c('0x33')](_0x7b3e85[_0xd70c('0x2b')][_0xd70c('0x33')]);_0x45a09a[_0xd70c('0x34')]=qs[_0xd70c('0x2d')](_['pick'](_0x7b3e85[_0xd70c('0x2b')],_0x45a84b['filters']));if(_0x7b3e85['query'][_0xd70c('0x35')]){_0x45a09a[_0xd70c('0x34')]=_[_0xd70c('0x36')](_0x45a09a['where'],{'$or':_[_0xd70c('0x37')](_0x3b4fe3,function(_0x445293){if(_0x445293[_0xd70c('0x38')][_0xd70c('0x39')]!=='VIRTUAL'){var _0xc3e07a={};_0xc3e07a[_0x445293[_0xd70c('0x3a')]]={'$like':'%'+_0x7b3e85[_0xd70c('0x2b')][_0xd70c('0x35')]+'%'};return _0xc3e07a;}})});}_0x45a09a=_[_0xd70c('0x36')]({},_0x45a09a,_0x7b3e85[_0xd70c('0x3b')]);var _0x2b6e92={'where':_0x45a09a[_0xd70c('0x34')]};return db[_0xd70c('0x3c')]['count'](_0x2b6e92)[_0xd70c('0x23')](function(_0x191305){_0x9d558e[_0xd70c('0x1a')]=_0x191305;if(_0x7b3e85[_0xd70c('0x2b')][_0xd70c('0x3d')]){_0x45a09a[_0xd70c('0x3e')]=[{'all':!![]}];}return db[_0xd70c('0x3c')][_0xd70c('0x3f')](_0x45a09a);})[_0xd70c('0x23')](function(_0x475857){_0x9d558e[_0xd70c('0x40')]=_0x475857;return _0x9d558e;})[_0xd70c('0x23')](respondWithFilteredResult(_0x1c4ede,_0x45a09a))[_0xd70c('0x41')](handleError(_0x1c4ede,null));};exports['show']=function(_0x1d2105,_0x30ab08){var _0x554542={'raw':!![],'where':{'id':_0x1d2105['params']['id']}},_0x5d45c9={};_0x5d45c9[_0xd70c('0x2a')]=_[_0xd70c('0x2c')](db[_0xd70c('0x3c')][_0xd70c('0x29')]);_0x5d45c9[_0xd70c('0x2b')]=_[_0xd70c('0x2c')](_0x1d2105[_0xd70c('0x2b')]);_0x5d45c9[_0xd70c('0x2d')]=_[_0xd70c('0x2f')](_0x5d45c9['model'],_0x5d45c9['query']);_0x554542[_0xd70c('0x2e')]=_[_0xd70c('0x2f')](_0x5d45c9[_0xd70c('0x2a')],qs[_0xd70c('0x30')](_0x1d2105['query'][_0xd70c('0x30')]));_0x554542[_0xd70c('0x2e')]=_0x554542[_0xd70c('0x2e')][_0xd70c('0x42')]?_0x554542[_0xd70c('0x2e')]:_0x5d45c9['model'];if(_0x1d2105[_0xd70c('0x2b')][_0xd70c('0x3d')]){_0x554542[_0xd70c('0x3e')]=[{'all':!![]}];}_0x554542=_[_0xd70c('0x36')]({},_0x554542,_0x1d2105[_0xd70c('0x3b')]);return db[_0xd70c('0x3c')][_0xd70c('0x43')](_0x554542)['then'](handleEntityNotFound(_0x30ab08,null))['then'](respondWithResult(_0x30ab08,null))[_0xd70c('0x41')](handleError(_0x30ab08,null));};exports['describe']=function(_0x343a95,_0x3fd700){return db[_0xd70c('0x3c')][_0xd70c('0x44')]()[_0xd70c('0x23')](respondWithResult(_0x3fd700,null))['catch'](handleError(_0x3fd700,null));};exports['update']=function(_0x4675ea,_0x3afcd0){if(_0x4675ea[_0xd70c('0x45')][_0xd70c('0x46')]){delete _0x4675ea[_0xd70c('0x45')][_0xd70c('0x46')];}return db[_0xd70c('0x3c')][_0xd70c('0x43')]({'where':{'uniqueid':_0x4675ea['params']['id']}})[_0xd70c('0x23')](handleEntityNotFound(_0x3afcd0,null))[_0xd70c('0x23')](saveUpdates(_0x4675ea[_0xd70c('0x45')],null))[_0xd70c('0x23')](respondWithResult(_0x3afcd0,null))['catch'](handleError(_0x3afcd0,null));};exports[_0xd70c('0x47')]=function(_0x43cd3e,_0x11952a,_0x2aed13){return db[_0xd70c('0x3c')][_0xd70c('0x3f')]({'raw':![],'where':{'VoiceQueueId':_0x43cd3e['params']['id']},'attributes':[[db[_0xd70c('0x48')]['fn']('COUNT',db[_0xd70c('0x48')]['fn']('IF',db[_0xd70c('0x48')]['literal']('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db['sequelize']['fn'](_0xd70c('0x49'),db[_0xd70c('0x48')]['fn']('IF',db[_0xd70c('0x48')][_0xd70c('0x4a')]('`state`\x20=\x203,\x201,\x20null'))),_0xd70c('0x4b')],[db[_0xd70c('0x48')]['fn'](_0xd70c('0x49'),db[_0xd70c('0x48')]['fn']('IF',db[_0xd70c('0x48')]['literal'](_0xd70c('0x4c')))),'busyContacts'],[db[_0xd70c('0x48')]['fn'](_0xd70c('0x49'),db[_0xd70c('0x48')]['fn']('IF',db[_0xd70c('0x48')][_0xd70c('0x4a')](_0xd70c('0x4d')))),_0xd70c('0x4e')],[db[_0xd70c('0x48')]['fn'](_0xd70c('0x49'),db[_0xd70c('0x48')]['fn']('IF',db[_0xd70c('0x48')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xd70c('0x4f')],[db[_0xd70c('0x48')]['fn'](_0xd70c('0x49'),db[_0xd70c('0x48')]['fn']('IF',db[_0xd70c('0x48')][_0xd70c('0x4a')](_0xd70c('0x50')))),_0xd70c('0x51')],[db[_0xd70c('0x48')]['fn'](_0xd70c('0x49'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xd70c('0x52')))),_0xd70c('0x53')],[db['sequelize']['fn'](_0xd70c('0x49'),db[_0xd70c('0x48')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0xd70c('0x23')](handleEntityNotFound(_0x11952a,null))['then'](respondWithResult(_0x11952a,null))[_0xd70c('0x41')](handleError(_0x11952a,null));};exports[_0xd70c('0x54')]=function(_0x1e1577,_0x35ccf7,_0x80f5a0){return db[_0xd70c('0x3c')][_0xd70c('0x3f')]({'raw':![],'where':{'CampaignId':_0x1e1577['params']['id']},'attributes':[[db[_0xd70c('0x48')]['fn'](_0xd70c('0x49'),db[_0xd70c('0x48')]['fn']('IF',db[_0xd70c('0x48')][_0xd70c('0x4a')](_0xd70c('0x55')))),_0xd70c('0x56')],[db[_0xd70c('0x48')]['fn']('COUNT',db[_0xd70c('0x48')]['fn']('IF',db[_0xd70c('0x48')][_0xd70c('0x4a')](_0xd70c('0x57')))),_0xd70c('0x4b')],[db[_0xd70c('0x48')]['fn'](_0xd70c('0x49'),db['sequelize']['fn']('IF',db[_0xd70c('0x48')][_0xd70c('0x4a')]('`state`\x20=\x205,\x201,\x20null'))),_0xd70c('0x58')],[db[_0xd70c('0x48')]['fn'](_0xd70c('0x49'),db['sequelize']['fn']('IF',db['sequelize'][_0xd70c('0x4a')](_0xd70c('0x4d')))),_0xd70c('0x4e')],[db[_0xd70c('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xd70c('0x4a')](_0xd70c('0x59')))),_0xd70c('0x4f')],[db[_0xd70c('0x48')]['fn'](_0xd70c('0x49'),db['sequelize']['fn']('IF',db[_0xd70c('0x48')][_0xd70c('0x4a')](_0xd70c('0x50')))),_0xd70c('0x51')],[db[_0xd70c('0x48')]['fn']('COUNT',db[_0xd70c('0x48')]['fn']('IF',db[_0xd70c('0x48')][_0xd70c('0x4a')](_0xd70c('0x52')))),_0xd70c('0x53')],[db[_0xd70c('0x48')]['fn'](_0xd70c('0x49'),db[_0xd70c('0x48')]['fn']('IF',db['sequelize']['literal'](_0xd70c('0x5a')))),_0xd70c('0x5b')]]})[_0xd70c('0x23')](handleEntityNotFound(_0x35ccf7,null))[_0xd70c('0x23')](respondWithResult(_0x35ccf7,null))[_0xd70c('0x41')](handleError(_0x35ccf7,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x5ac22e,_0x18ba5c,_0x227bdb){return db[_0xd70c('0x5c')][_0xd70c('0x43')]({'where':{'id':_0x5ac22e[_0xd70c('0x5d')]['id']}})['then'](handleEntityNotFound(_0x18ba5c,null))[_0xd70c('0x23')](function(_0x26f4b0){var _0x1fc921;if(_0x26f4b0){_0x1fc921=squel[_0xd70c('0x5e')]()[_0xd70c('0x5f')](_0xd70c('0x60'))[_0xd70c('0x61')]([_0xd70c('0x62'),'scheduledAt',_0xd70c('0x63'),_0xd70c('0x64'),_0xd70c('0x65'),_0xd70c('0x66'),_0xd70c('0x67')],squel[_0xd70c('0x68')]()[_0xd70c('0x3a')]('ANY_VALUE(calleridnum)','phone')['field']('NOW()',_0xd70c('0x69'))[_0xd70c('0x3a')](_0xd70c('0x6a'),_0xd70c('0x63'))[_0xd70c('0x3a')](_0xd70c('0x6b'),_0xd70c('0x64'))[_0xd70c('0x3a')]('ANY_VALUE(VoiceQueueId)',_0xd70c('0x65'))[_0xd70c('0x3a')](_0xd70c('0x6c'),_0xd70c('0x66'))['field'](_0xd70c('0x6c'),_0xd70c('0x67'))[_0xd70c('0x6d')](_0xd70c('0x6e'))[_0xd70c('0x34')](_0xd70c('0x6f'),_0x5ac22e[_0xd70c('0x5d')]['id'][_0xd70c('0x70')]())[_0xd70c('0x34')](_0xd70c('0x71'),_0x5ac22e[_0xd70c('0x45')]['state'][_0xd70c('0x70')]())[_0xd70c('0x34')](_0xd70c('0x72'))[_0xd70c('0x34')](_0xd70c('0x73'),squel[_0xd70c('0x68')]()['field'](_0xd70c('0x62'))[_0xd70c('0x6d')]('cm_hopper')[_0xd70c('0x34')](_0xd70c('0x6f'),_0x5ac22e[_0xd70c('0x5d')]['id']['toString']()))['where'](_0xd70c('0x73'),squel[_0xd70c('0x68')]()[_0xd70c('0x3a')](_0xd70c('0x74'))[_0xd70c('0x6d')]('cm_hopper_final')['where'](_0xd70c('0x6f'),_0x5ac22e['params']['id'][_0xd70c('0x70')]())['where'](_0xd70c('0x75')))['group'](_0xd70c('0x63')))[_0xd70c('0x70')]();return db[_0xd70c('0x48')][_0xd70c('0x2b')](_0x1fc921);}return[];})[_0xd70c('0x23')](respondWithResult(_0x18ba5c,null))['catch'](handleError(_0x18ba5c,null));};exports[_0xd70c('0x76')]=function(_0xb52eae,_0x3e6fd7,_0x55132f){return db[_0xd70c('0x77')]['find']({'where':{'id':_0xb52eae[_0xd70c('0x5d')]['id']}})['then'](handleEntityNotFound(_0x3e6fd7,null))[_0xd70c('0x23')](function(_0x4bb3b0){var _0x7fc4a3;if(_0x4bb3b0){_0x7fc4a3=squel[_0xd70c('0x5e')]()['into'](_0xd70c('0x60'))['fromQuery']([_0xd70c('0x62'),_0xd70c('0x69'),_0xd70c('0x63'),_0xd70c('0x64'),'CampaignId','createdAt',_0xd70c('0x67')],squel[_0xd70c('0x68')]()[_0xd70c('0x3a')](_0xd70c('0x78'),_0xd70c('0x62'))[_0xd70c('0x3a')](_0xd70c('0x6c'),_0xd70c('0x69'))[_0xd70c('0x3a')]('ANY_VALUE(ContactId)',_0xd70c('0x63'))[_0xd70c('0x3a')](_0xd70c('0x6b'),_0xd70c('0x64'))[_0xd70c('0x3a')]('ANY_VALUE(CampaignId)',_0xd70c('0x79'))['field'](_0xd70c('0x6c'),'createdAt')[_0xd70c('0x3a')](_0xd70c('0x6c'),_0xd70c('0x67'))[_0xd70c('0x6d')]('cm_hopper_final')[_0xd70c('0x34')](_0xd70c('0x7a'),_0xb52eae[_0xd70c('0x5d')]['id'][_0xd70c('0x70')]())[_0xd70c('0x34')](_0xd70c('0x71'),_0xb52eae[_0xd70c('0x45')]['state']['toString']())['where']('calleridnum\x20IS\x20NOT\x20NULL')[_0xd70c('0x34')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xd70c('0x68')]()[_0xd70c('0x3a')](_0xd70c('0x62'))[_0xd70c('0x6d')](_0xd70c('0x60'))['where'](_0xd70c('0x7a'),_0xb52eae['params']['id']['toString']()))[_0xd70c('0x34')](_0xd70c('0x73'),squel[_0xd70c('0x68')]()[_0xd70c('0x3a')](_0xd70c('0x74'))[_0xd70c('0x6d')]('cm_hopper_final')[_0xd70c('0x34')](_0xd70c('0x7a'),_0xb52eae[_0xd70c('0x5d')]['id']['toString']())[_0xd70c('0x34')](_0xd70c('0x75')))['group'](_0xd70c('0x63')))[_0xd70c('0x70')]();return db[_0xd70c('0x48')][_0xd70c('0x2b')](_0x7fc4a3);}return[];})[_0xd70c('0x23')](respondWithResult(_0x3e6fd7,null))['catch'](handleError(_0x3e6fd7,null));};exports[_0xd70c('0x7b')]=function(_0x101bdb,_0x595988,_0x4e10f1){return db['CmHopper'][_0xd70c('0x7c')]({'where':{'VoiceQueueId':_0x101bdb[_0xd70c('0x45')][_0xd70c('0x65')],'CampaignId':_0x101bdb[_0xd70c('0x45')][_0xd70c('0x79')],'ContactId':_0x101bdb[_0xd70c('0x45')][_0xd70c('0x63')]}})[_0xd70c('0x23')](handleEntityNotFound(_0x595988,null))[_0xd70c('0x23')](function(_0x76393){if(_0x76393){return _0x76393;}return null;})[_0xd70c('0x23')](respondWithResult(_0x595988,null))['catch'](handleError(_0x595988,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 2c6496b..bb7a5d4 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 _0x25a2=['api','moment','bluebird','path','rimraf','exports','define','CmHopperFinal','calleridnum','uniqueid','util','../../config/logger'];(function(_0x186aa1,_0x50462f){var _0xab6fa1=function(_0x219b7c){while(--_0x219b7c){_0x186aa1['push'](_0x186aa1['shift']());}};_0xab6fa1(++_0x50462f);}(_0x25a2,0x106));var _0x225a=function(_0x17669a,_0x1f24ad){_0x17669a=_0x17669a-0x0;var _0xc26e34=_0x25a2[_0x17669a];return _0xc26e34;};'use strict';var _=require('lodash');var util=require(_0x225a('0x0'));var logger=require(_0x225a('0x1'))(_0x225a('0x2'));var moment=require(_0x225a('0x3'));var BPromise=require(_0x225a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x225a('0x5'));var rimraf=require(_0x225a('0x6'));var config=require('../../config/environment');var attributes=require('./cmHopperFinal.attributes');module[_0x225a('0x7')]=function(_0xf1ae9c,_0x50519f){return _0xf1ae9c[_0x225a('0x8')](_0x225a('0x9'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x225a('0xa'),'fields':[_0x225a('0xa')]},{'name':'uniqueid','fields':[_0x225a('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5385=['CmHopperFinal','cm_hopper_final','uniqueid','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports'];(function(_0x311b16,_0x57f08a){var _0x5676d2=function(_0x4e3a10){while(--_0x4e3a10){_0x311b16['push'](_0x311b16['shift']());}};_0x5676d2(++_0x57f08a);}(_0x5385,0x17c));var _0x5538=function(_0x546765,_0xad5779){_0x546765=_0x546765-0x0;var _0x3356fd=_0x5385[_0x546765];return _0x3356fd;};'use strict';var _=require(_0x5538('0x0'));var util=require(_0x5538('0x1'));var logger=require(_0x5538('0x2'))(_0x5538('0x3'));var moment=require(_0x5538('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5538('0x5'));var rimraf=require(_0x5538('0x6'));var config=require(_0x5538('0x7'));var attributes=require(_0x5538('0x8'));module[_0x5538('0x9')]=function(_0x6f0299,_0x18a8ff){return _0x6f0299['define'](_0x5538('0xa'),attributes,{'tableName':_0x5538('0xb'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':['calleridnum']},{'name':'uniqueid','fields':[_0x5538('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 27fc071..60129c0 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 _0xd8b0=['stringify','error','code','message','result','catch','CreateCmHopperFinal','CmHopperFinal','body','options','raw','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','request\x20sent','debug','CmHopperFinal,\x20%s,\x20%s,\x20%s'];(function(_0x18625f,_0x4114e9){var _0x4e9c29=function(_0x1d2cf1){while(--_0x1d2cf1){_0x18625f['push'](_0x18625f['shift']());}};_0x4e9c29(++_0x4114e9);}(_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')]['create'](_0x5fecbd[_0x0d8b('0x18')],{'raw':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd[_0x0d8b('0x19')][_0x0d8b('0x1a')]===undefined?!![]:![]:!![]})[_0x0d8b('0xa')](function(_0x5b709c){logger[_0x0d8b('0xb')](_0x0d8b('0x16'),_0x5fecbd);logger['debug']('CreateCmHopperFinal',_0x5fecbd,JSON[_0x0d8b('0x10')](_0x5b709c));_0x18dd2d(_0x5b709c);})['catch'](function(_0x56c729){logger['error'](_0x0d8b('0x16'),_0x56c729[_0x0d8b('0x13')],_0x5fecbd);_0x264b39(_0x333674[_0x0d8b('0x11')](0x1f4,_0x56c729[_0x0d8b('0x13')]));});});}; \ No newline at end of file +var _0xb9a7=['jayson/promise','client','http','request','CmHopperFinal,\x20%s,\x20%s','request\x20sent','CmHopperFinal,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateCmHopperFinal','CmHopperFinal','create','body','options','raw','then','debug','catch','util','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1395d5,_0x167b2f){var _0x4ea43c=function(_0x5d5b3f){while(--_0x5d5b3f){_0x1395d5['push'](_0x1395d5['shift']());}};_0x4ea43c(++_0x167b2f);}(_0xb9a7,0x112));var _0x7b9a=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xb9a7[_0x5a776b];return _0xbbef59;};'use strict';var _=require('lodash');var util=require(_0x7b9a('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7b9a('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x7b9a('0x2'));var logger=require(_0x7b9a('0x3'))(_0x7b9a('0x4'));var config=require(_0x7b9a('0x5'));var jayson=require(_0x7b9a('0x6'));var client=jayson[_0x7b9a('0x7')][_0x7b9a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x7019fd,_0x37ce81,_0x3e51f0){return new BPromise(function(_0x4d3f20,_0x43d8e2){return client[_0x7b9a('0x9')](_0x7019fd,_0x3e51f0)['then'](function(_0x511e28){logger['info'](_0x7b9a('0xa'),_0x37ce81,_0x7b9a('0xb'));logger['debug'](_0x7b9a('0xc'),_0x37ce81,'request\x20sent',JSON[_0x7b9a('0xd')](_0x511e28));if(_0x511e28['error']){if(_0x511e28[_0x7b9a('0xe')][_0x7b9a('0xf')]===0x1f4){logger[_0x7b9a('0xe')]('CmHopperFinal,\x20%s,\x20%s',_0x37ce81,_0x511e28[_0x7b9a('0xe')][_0x7b9a('0x10')]);return _0x43d8e2(_0x511e28['error'][_0x7b9a('0x10')]);}logger[_0x7b9a('0xe')]('CmHopperFinal,\x20%s,\x20%s',_0x37ce81,_0x511e28[_0x7b9a('0xe')][_0x7b9a('0x10')]);return _0x4d3f20(_0x511e28[_0x7b9a('0xe')][_0x7b9a('0x10')]);}else{logger[_0x7b9a('0x11')](_0x7b9a('0xa'),_0x37ce81,_0x7b9a('0xb'));_0x4d3f20(_0x511e28[_0x7b9a('0x12')][_0x7b9a('0x10')]);}})['catch'](function(_0x34a82d){logger['error'](_0x7b9a('0xa'),_0x37ce81,_0x34a82d);_0x43d8e2(_0x34a82d);});});}exports[_0x7b9a('0x13')]=function(_0x271263){var _0x169d16=this;return new Promise(function(_0x44a232,_0x180a67){return db[_0x7b9a('0x14')][_0x7b9a('0x15')](_0x271263[_0x7b9a('0x16')],{'raw':_0x271263[_0x7b9a('0x17')]?_0x271263[_0x7b9a('0x17')][_0x7b9a('0x18')]===undefined?!![]:![]:!![]})[_0x7b9a('0x19')](function(_0x58aed7){logger[_0x7b9a('0x11')]('CreateCmHopperFinal',_0x271263);logger[_0x7b9a('0x1a')]('CreateCmHopperFinal',_0x271263,JSON[_0x7b9a('0xd')](_0x58aed7));_0x44a232(_0x58aed7);})[_0x7b9a('0x1b')](function(_0x23d812){logger['error'](_0x7b9a('0x13'),_0x23d812[_0x7b9a('0x10')],_0x271263);_0x180a67(_0x169d16['error'](0x1f4,_0x23d812[_0x7b9a('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 6bd056f..5fd2540 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 _0x34e8=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','put','update'];(function(_0x447ecc,_0x15589a){var _0x54f34a=function(_0x12da17){while(--_0x12da17){_0x447ecc['push'](_0x447ecc['shift']());}};_0x54f34a(++_0x15589a);}(_0x34e8,0x12c));var _0x834e=function(_0x178dba,_0xe903){_0x178dba=_0x178dba-0x0;var _0xd81460=_0x34e8[_0x178dba];return _0xd81460;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var auth=require(_0x834e('0x5'));var interaction=require(_0x834e('0x6'));var config=require(_0x834e('0x7'));var controller=require(_0x834e('0x8'));router[_0x834e('0x9')]('/',auth[_0x834e('0xa')](),controller['index']);router[_0x834e('0x9')]('/describe',auth[_0x834e('0xa')](),controller[_0x834e('0xb')]);router[_0x834e('0x9')](_0x834e('0xc'),auth[_0x834e('0xa')](),controller[_0x834e('0xd')]);router[_0x834e('0x9')](_0x834e('0xe'),auth[_0x834e('0xa')](),controller[_0x834e('0xf')]);router[_0x834e('0x9')](_0x834e('0x10'),auth[_0x834e('0xa')](),controller[_0x834e('0x11')]);router[_0x834e('0x12')](_0x834e('0x13'),auth[_0x834e('0xa')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0x834e('0x12')](_0x834e('0x14'),auth['isAuthenticated'](),controller[_0x834e('0x15')]);router[_0x834e('0x12')](_0x834e('0x16'),auth[_0x834e('0xa')](),controller['checkContactHopper']);router[_0x834e('0x17')](_0x834e('0xc'),auth['isAuthenticated'](),controller[_0x834e('0x18')]);module['exports']=router; \ No newline at end of file +var _0x34e8=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','put','update'];(function(_0x183535,_0x9c7e49){var _0x5caf4e=function(_0x97f6ac){while(--_0x97f6ac){_0x183535['push'](_0x183535['shift']());}};_0x5caf4e(++_0x9c7e49);}(_0x34e8,0x12c));var _0x834e=function(_0x4e8ba4,_0x42c4dd){_0x4e8ba4=_0x4e8ba4-0x0;var _0x25d096=_0x34e8[_0x4e8ba4];return _0x25d096;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var auth=require(_0x834e('0x5'));var interaction=require(_0x834e('0x6'));var config=require(_0x834e('0x7'));var controller=require(_0x834e('0x8'));router[_0x834e('0x9')]('/',auth[_0x834e('0xa')](),controller['index']);router[_0x834e('0x9')]('/describe',auth[_0x834e('0xa')](),controller[_0x834e('0xb')]);router[_0x834e('0x9')](_0x834e('0xc'),auth[_0x834e('0xa')](),controller[_0x834e('0xd')]);router[_0x834e('0x9')](_0x834e('0xe'),auth[_0x834e('0xa')](),controller[_0x834e('0xf')]);router[_0x834e('0x9')](_0x834e('0x10'),auth[_0x834e('0xa')](),controller[_0x834e('0x11')]);router[_0x834e('0x12')](_0x834e('0x13'),auth[_0x834e('0xa')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0x834e('0x12')](_0x834e('0x14'),auth['isAuthenticated'](),controller[_0x834e('0x15')]);router[_0x834e('0x12')](_0x834e('0x16'),auth[_0x834e('0xa')](),controller['checkContactHopper']);router[_0x834e('0x17')](_0x834e('0xc'),auth['isAuthenticated'](),controller[_0x834e('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index ded96d0..19898bf 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 _0x394e=['STRING','DATE','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x164e8f,_0xdba27a){var _0x2b2840=function(_0x4458f0){while(--_0x4458f0){_0x164e8f['push'](_0x164e8f['shift']());}};_0x2b2840(++_0xdba27a);}(_0x394e,0x88));var _0xe394=function(_0x3bdd40,_0x414ee6){_0x3bdd40=_0x3bdd40-0x0;var _0x216370=_0x394e[_0x3bdd40];return _0x216370;};'use strict';var Sequelize=require(_0xe394('0x0'));module[_0xe394('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xe394('0x2')]},'scheduledat':{'type':Sequelize[_0xe394('0x3')]},'countbusyretry':{'type':Sequelize[_0xe394('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xe394('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xe394('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xe394('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xe394('0x2')]},'originatecalleridname':{'type':Sequelize[_0xe394('0x2')]},'calleridnum':{'type':Sequelize[_0xe394('0x2')]},'calleridname':{'type':Sequelize[_0xe394('0x2')]},'starttime':{'type':Sequelize[_0xe394('0x3')]},'responsetime':{'type':Sequelize[_0xe394('0x3')]},'answertime':{'type':Sequelize[_0xe394('0x3')]},'droptime':{'type':Sequelize[_0xe394('0x3')]},'endtime':{'type':Sequelize[_0xe394('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xe394('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xe394('0x2')]},'campaign':{'type':Sequelize[_0xe394('0x2')]},'campaigntype':{'type':Sequelize[_0xe394('0x2')]},'membername':{'type':Sequelize[_0xe394('0x2')]},'reason':{'type':Sequelize[_0xe394('0x2')]},'amd':{'type':Sequelize[_0xe394('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0xe394('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xe394('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xe394('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xe394('0x3')]},'recallme':{'type':Sequelize[_0xe394('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xbd50=['INTEGER','DATE','STRING','BOOLEAN','sequelize','exports'];(function(_0x517b77,_0x5d4943){var _0x4b6ef4=function(_0x464ea9){while(--_0x464ea9){_0x517b77['push'](_0x517b77['shift']());}};_0x4b6ef4(++_0x5d4943);}(_0xbd50,0x196));var _0x0bd5=function(_0x5e7b2f,_0x7ed0c5){_0x5e7b2f=_0x5e7b2f-0x0;var _0x1a5d99=_0xbd50[_0x5e7b2f];return _0x1a5d99;};'use strict';var Sequelize=require(_0x0bd5('0x0'));module[_0x0bd5('0x1')]={'state':{'type':Sequelize[_0x0bd5('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x0bd5('0x3')]},'countbusyretry':{'type':Sequelize[_0x0bd5('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x0bd5('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x0bd5('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x0bd5('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x0bd5('0x4')]},'calleridname':{'type':Sequelize[_0x0bd5('0x4')]},'starttime':{'type':Sequelize[_0x0bd5('0x3')]},'responsetime':{'type':Sequelize[_0x0bd5('0x3')]},'answertime':{'type':Sequelize[_0x0bd5('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x0bd5('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x0bd5('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x0bd5('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x0bd5('0x4')]},'campaign':{'type':Sequelize[_0x0bd5('0x4')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x0bd5('0x4')]},'reason':{'type':Sequelize[_0x0bd5('0x4')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x0bd5('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x0bd5('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x0bd5('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x0bd5('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x0bd5('0x3')]},'edited':{'type':Sequelize[_0x0bd5('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 69997bc..a912885 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 _0x326f=['catch','uniqueid','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','sendStatus','end','json','count','offset','status','set','Content-Range','save','update','then','name','send','index','CmHopperHistory','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','limit','order','sort','where','pick','map','type','VIRTUAL','field','filter','merge','includeAll','include','findAll','params','rawAttributes','options','find','create','body','describe'];(function(_0x725b8e,_0xc22b48){var _0x43ac45=function(_0x46bb4a){while(--_0x46bb4a){_0x725b8e['push'](_0x725b8e['shift']());}};_0x43ac45(++_0xc22b48);}(_0x326f,0xd1));var _0xf326=function(_0x14501c,_0xe3b033){_0x14501c=_0x14501c-0x0;var _0x44b9fd=_0x326f[_0x14501c];return _0x44b9fd;};'use strict';var pdf=require(_0xf326('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf326('0x1'));var jsonpatch=require(_0xf326('0x2'));var rp=require(_0xf326('0x3'));var moment=require(_0xf326('0x4'));var BPromise=require(_0xf326('0x5'));var Mustache=require(_0xf326('0x6'));var util=require(_0xf326('0x7'));var path=require(_0xf326('0x8'));var sox=require(_0xf326('0x9'));var csv=require(_0xf326('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var Redis=require(_0xf326('0x10'));var authService=require(_0xf326('0x11'));var qs=require(_0xf326('0x12'));var hardwareService=require(_0xf326('0x13'));var logger=require('../../config/logger')(_0xf326('0x14'));var utils=require('../../config/utils');var config=require(_0xf326('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e4b71,_0x518ab5){_0x518ab5=_0x518ab5||0xcc;return function(_0x3162f9){if(_0x3162f9){return _0x2e4b71[_0xf326('0x16')](_0x518ab5);}return _0x2e4b71['status'](_0x518ab5)[_0xf326('0x17')]();};}function respondWithResult(_0x472632,_0x3504eb){_0x3504eb=_0x3504eb||0xc8;return function(_0x17a098){if(_0x17a098){return _0x472632['status'](_0x3504eb)[_0xf326('0x18')](_0x17a098);}};}function respondWithFilteredResult(_0x5204ee,_0x54bd1a){return function(_0xdf21d9){if(_0xdf21d9){var _0x11f6d2=_0xdf21d9[_0xf326('0x19')],_0x1f2e5a=_0x54bd1a[_0xf326('0x1a')],_0xa63d1a=_0x54bd1a[_0xf326('0x1a')]+_0x54bd1a['limit'],_0x292f4b;if(_0xa63d1a>=_0x11f6d2){_0xa63d1a=_0x11f6d2;_0x292f4b=0xc8;}else{_0x292f4b=0xce;}_0x5204ee[_0xf326('0x1b')](_0x292f4b);return _0x5204ee[_0xf326('0x1c')](_0xf326('0x1d'),_0x1f2e5a+'-'+_0xa63d1a+'/'+_0x11f6d2)[_0xf326('0x18')](_0xdf21d9);}return null;};}function patchUpdates(_0xcef2b5){return function(_0x311af0){try{jsonpatch['apply'](_0x311af0,_0xcef2b5,!![]);}catch(_0x4a5b6c){return BPromise['reject'](_0x4a5b6c);}return _0x311af0[_0xf326('0x1e')]();};}function saveUpdates(_0x289f4b,_0x484cbe){return function(_0x4cabce){if(_0x4cabce){return _0x4cabce[_0xf326('0x1f')](_0x289f4b)['then'](function(_0x5b6d3c){return _0x5b6d3c;});}return null;};}function removeEntity(_0x448b92,_0x18ead3){return function(_0x549b46){if(_0x549b46){return _0x549b46['destroy']()[_0xf326('0x20')](function(){_0x448b92[_0xf326('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x337ed5,_0x1b9039){return function(_0x43c53e){if(!_0x43c53e){_0x337ed5[_0xf326('0x16')](0x194);}return _0x43c53e;};}function handleError(_0x17c157,_0x2049ec){_0x2049ec=_0x2049ec||0x1f4;return function(_0x5ce532){logger['error'](_0x5ce532['stack']);if(_0x5ce532[_0xf326('0x21')]){delete _0x5ce532[_0xf326('0x21')];}_0x17c157[_0xf326('0x1b')](_0x2049ec)[_0xf326('0x22')](_0x5ce532);};}exports[_0xf326('0x23')]=function(_0x410237,_0x5217d4){var _0x201d28={},_0xa3c0b={},_0x212d5d={'count':0x0,'rows':[]};var _0x581531=db[_0xf326('0x24')]['rawAttributes'];_0xa3c0b['model']=_[_0xf326('0x25')](_0x581531);_0xa3c0b[_0xf326('0x26')]=_[_0xf326('0x25')](_0x410237['query']);_0xa3c0b[_0xf326('0x27')]=_[_0xf326('0x28')](_0xa3c0b['model'],_0xa3c0b[_0xf326('0x26')]);_0x201d28[_0xf326('0x29')]=_[_0xf326('0x28')](_0xa3c0b[_0xf326('0x2a')],qs[_0xf326('0x2b')](_0x410237[_0xf326('0x26')][_0xf326('0x2b')]));_0x201d28[_0xf326('0x29')]=_0x201d28[_0xf326('0x29')][_0xf326('0x2c')]?_0x201d28['attributes']:_0xa3c0b[_0xf326('0x2a')];if(!_0x410237[_0xf326('0x26')][_0xf326('0x2d')]('nolimit')){_0x201d28[_0xf326('0x2e')]=qs[_0xf326('0x2e')](_0x410237[_0xf326('0x26')]['limit']);_0x201d28['offset']=qs[_0xf326('0x1a')](_0x410237[_0xf326('0x26')][_0xf326('0x1a')]);}_0x201d28[_0xf326('0x2f')]=qs[_0xf326('0x30')](_0x410237[_0xf326('0x26')][_0xf326('0x30')]);_0x201d28[_0xf326('0x31')]=qs['filters'](_[_0xf326('0x32')](_0x410237[_0xf326('0x26')],_0xa3c0b['filters']));if(_0x410237[_0xf326('0x26')]['filter']){_0x201d28[_0xf326('0x31')]=_['merge'](_0x201d28['where'],{'$or':_[_0xf326('0x33')](_0x581531,function(_0x4d8eac){if(_0x4d8eac[_0xf326('0x34')]['key']!==_0xf326('0x35')){var _0x409260={};_0x409260[_0x4d8eac[_0xf326('0x36')]]={'$like':'%'+_0x410237['query'][_0xf326('0x37')]+'%'};return _0x409260;}})});}_0x201d28=_[_0xf326('0x38')]({},_0x201d28,_0x410237['options']);var _0x13932b={'where':_0x201d28[_0xf326('0x31')]};return db[_0xf326('0x24')][_0xf326('0x19')](_0x13932b)['then'](function(_0x2c4416){_0x212d5d[_0xf326('0x19')]=_0x2c4416;if(_0x410237[_0xf326('0x26')][_0xf326('0x39')]){_0x201d28[_0xf326('0x3a')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xf326('0x3b')](_0x201d28);})[_0xf326('0x20')](function(_0x5cfb97){_0x212d5d['rows']=_0x5cfb97;return _0x212d5d;})[_0xf326('0x20')](respondWithFilteredResult(_0x5217d4,_0x201d28))['catch'](handleError(_0x5217d4,null));};exports['show']=function(_0x22d462,_0x5d6ae2){var _0x3e1e8c={'raw':!![],'where':{'id':_0x22d462[_0xf326('0x3c')]['id']}},_0x37a95b={};_0x37a95b[_0xf326('0x2a')]=_['keys'](db[_0xf326('0x24')][_0xf326('0x3d')]);_0x37a95b[_0xf326('0x26')]=_[_0xf326('0x25')](_0x22d462[_0xf326('0x26')]);_0x37a95b[_0xf326('0x27')]=_[_0xf326('0x28')](_0x37a95b[_0xf326('0x2a')],_0x37a95b[_0xf326('0x26')]);_0x3e1e8c[_0xf326('0x29')]=_[_0xf326('0x28')](_0x37a95b[_0xf326('0x2a')],qs['fields'](_0x22d462[_0xf326('0x26')][_0xf326('0x2b')]));_0x3e1e8c[_0xf326('0x29')]=_0x3e1e8c[_0xf326('0x29')][_0xf326('0x2c')]?_0x3e1e8c[_0xf326('0x29')]:_0x37a95b['model'];if(_0x22d462[_0xf326('0x26')][_0xf326('0x39')]){_0x3e1e8c['include']=[{'all':!![]}];}_0x3e1e8c=_[_0xf326('0x38')]({},_0x3e1e8c,_0x22d462[_0xf326('0x3e')]);return db[_0xf326('0x24')][_0xf326('0x3f')](_0x3e1e8c)[_0xf326('0x20')](handleEntityNotFound(_0x5d6ae2,null))['then'](respondWithResult(_0x5d6ae2,null))['catch'](handleError(_0x5d6ae2,null));};exports[_0xf326('0x40')]=function(_0x44e101,_0x5ed62e){return db['CmHopperHistory'][_0xf326('0x40')](_0x44e101[_0xf326('0x41')],{})[_0xf326('0x20')](respondWithResult(_0x5ed62e,0xc9))['catch'](handleError(_0x5ed62e,null));};exports[_0xf326('0x42')]=function(_0xe96e1e,_0x2180d6){return db[_0xf326('0x24')][_0xf326('0x42')]()[_0xf326('0x20')](respondWithResult(_0x2180d6,null))[_0xf326('0x43')](handleError(_0x2180d6,null));};exports[_0xf326('0x1f')]=function(_0x3df9a8,_0x27ced1){if(_0x3df9a8[_0xf326('0x41')][_0xf326('0x44')]){delete _0x3df9a8[_0xf326('0x41')][_0xf326('0x44')];}return db[_0xf326('0x24')]['find']({'where':{'uniqueid':_0x3df9a8[_0xf326('0x3c')]['id']}})[_0xf326('0x20')](handleEntityNotFound(_0x27ced1,null))[_0xf326('0x20')](saveUpdates(_0x3df9a8[_0xf326('0x41')],null))['then'](respondWithResult(_0x27ced1,null))[_0xf326('0x43')](handleError(_0x27ced1,null));}; \ No newline at end of file +var _0x2ef3=['then','destroy','sendStatus','name','send','index','CmHopperHistory','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filter','map','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','create','body','describe','update','uniqueid','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','count','offset','set','Content-Range','reject','save'];(function(_0x4a54ed,_0x404060){var _0x1d571a=function(_0x23fcff){while(--_0x23fcff){_0x4a54ed['push'](_0x4a54ed['shift']());}};_0x1d571a(++_0x404060);}(_0x2ef3,0xba));var _0x32ef=function(_0xf47ad,_0x211856){_0xf47ad=_0xf47ad-0x0;var _0x361d42=_0x2ef3[_0xf47ad];return _0x361d42;};'use strict';var pdf=require(_0x32ef('0x0'));var emlformat=require(_0x32ef('0x1'));var rimraf=require(_0x32ef('0x2'));var zipdir=require(_0x32ef('0x3'));var jsonpatch=require(_0x32ef('0x4'));var rp=require(_0x32ef('0x5'));var moment=require('moment');var BPromise=require(_0x32ef('0x6'));var Mustache=require(_0x32ef('0x7'));var util=require('util');var path=require(_0x32ef('0x8'));var sox=require(_0x32ef('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0xf'));var querystring=require(_0x32ef('0x10'));var Papa=require(_0x32ef('0x11'));var Redis=require(_0x32ef('0x12'));var authService=require(_0x32ef('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x193714,_0x5afcc2){_0x5afcc2=_0x5afcc2||0xcc;return function(_0x1a5106){if(_0x1a5106){return _0x193714['sendStatus'](_0x5afcc2);}return _0x193714[_0x32ef('0x18')](_0x5afcc2)[_0x32ef('0x19')]();};}function respondWithResult(_0x5c3eb9,_0x539d18){_0x539d18=_0x539d18||0xc8;return function(_0x19ce1){if(_0x19ce1){return _0x5c3eb9['status'](_0x539d18)[_0x32ef('0x1a')](_0x19ce1);}};}function respondWithFilteredResult(_0x40a6e6,_0x93d492){return function(_0x54c7f5){if(_0x54c7f5){var _0x57aff1=_0x54c7f5[_0x32ef('0x1b')],_0x55bf0b=_0x93d492[_0x32ef('0x1c')],_0x531e30=_0x93d492['offset']+_0x93d492['limit'],_0x13db1a;if(_0x531e30>=_0x57aff1){_0x531e30=_0x57aff1;_0x13db1a=0xc8;}else{_0x13db1a=0xce;}_0x40a6e6[_0x32ef('0x18')](_0x13db1a);return _0x40a6e6[_0x32ef('0x1d')](_0x32ef('0x1e'),_0x55bf0b+'-'+_0x531e30+'/'+_0x57aff1)['json'](_0x54c7f5);}return null;};}function patchUpdates(_0xbe37f6){return function(_0x33e230){try{jsonpatch['apply'](_0x33e230,_0xbe37f6,!![]);}catch(_0x304505){return BPromise[_0x32ef('0x1f')](_0x304505);}return _0x33e230[_0x32ef('0x20')]();};}function saveUpdates(_0x251084,_0x445cda){return function(_0x3aec05){if(_0x3aec05){return _0x3aec05['update'](_0x251084)[_0x32ef('0x21')](function(_0x5cc3ef){return _0x5cc3ef;});}return null;};}function removeEntity(_0x309866,_0x3a20ca){return function(_0x49f2d8){if(_0x49f2d8){return _0x49f2d8[_0x32ef('0x22')]()[_0x32ef('0x21')](function(){_0x309866[_0x32ef('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57f5e5,_0x22f2d7){return function(_0xb30fab){if(!_0xb30fab){_0x57f5e5[_0x32ef('0x23')](0x194);}return _0xb30fab;};}function handleError(_0x478bef,_0x59585f){_0x59585f=_0x59585f||0x1f4;return function(_0x19ea6){logger['error'](_0x19ea6['stack']);if(_0x19ea6[_0x32ef('0x24')]){delete _0x19ea6[_0x32ef('0x24')];}_0x478bef[_0x32ef('0x18')](_0x59585f)[_0x32ef('0x25')](_0x19ea6);};}exports[_0x32ef('0x26')]=function(_0x234175,_0x1874ea){var _0x38aed5={},_0x338f19={},_0x2f52d7={'count':0x0,'rows':[]};var _0x1335e2=db[_0x32ef('0x27')]['rawAttributes'];_0x338f19[_0x32ef('0x28')]=_[_0x32ef('0x29')](_0x1335e2);_0x338f19['query']=_[_0x32ef('0x29')](_0x234175[_0x32ef('0x2a')]);_0x338f19[_0x32ef('0x2b')]=_[_0x32ef('0x2c')](_0x338f19['model'],_0x338f19[_0x32ef('0x2a')]);_0x38aed5[_0x32ef('0x2d')]=_[_0x32ef('0x2c')](_0x338f19[_0x32ef('0x28')],qs[_0x32ef('0x2e')](_0x234175[_0x32ef('0x2a')][_0x32ef('0x2e')]));_0x38aed5['attributes']=_0x38aed5[_0x32ef('0x2d')]['length']?_0x38aed5[_0x32ef('0x2d')]:_0x338f19[_0x32ef('0x28')];if(!_0x234175['query'][_0x32ef('0x2f')](_0x32ef('0x30'))){_0x38aed5[_0x32ef('0x31')]=qs[_0x32ef('0x31')](_0x234175[_0x32ef('0x2a')]['limit']);_0x38aed5['offset']=qs[_0x32ef('0x1c')](_0x234175['query'][_0x32ef('0x1c')]);}_0x38aed5[_0x32ef('0x32')]=qs[_0x32ef('0x33')](_0x234175[_0x32ef('0x2a')][_0x32ef('0x33')]);_0x38aed5[_0x32ef('0x34')]=qs['filters'](_['pick'](_0x234175['query'],_0x338f19[_0x32ef('0x2b')]));if(_0x234175[_0x32ef('0x2a')][_0x32ef('0x35')]){_0x38aed5['where']=_['merge'](_0x38aed5[_0x32ef('0x34')],{'$or':_[_0x32ef('0x36')](_0x1335e2,function(_0x410334){if(_0x410334['type']['key']!==_0x32ef('0x37')){var _0x21706f={};_0x21706f[_0x410334[_0x32ef('0x38')]]={'$like':'%'+_0x234175[_0x32ef('0x2a')][_0x32ef('0x35')]+'%'};return _0x21706f;}})});}_0x38aed5=_[_0x32ef('0x39')]({},_0x38aed5,_0x234175[_0x32ef('0x3a')]);var _0x21da90={'where':_0x38aed5[_0x32ef('0x34')]};return db['CmHopperHistory'][_0x32ef('0x1b')](_0x21da90)[_0x32ef('0x21')](function(_0x14b54f){_0x2f52d7['count']=_0x14b54f;if(_0x234175[_0x32ef('0x2a')][_0x32ef('0x3b')]){_0x38aed5[_0x32ef('0x3c')]=[{'all':!![]}];}return db[_0x32ef('0x27')][_0x32ef('0x3d')](_0x38aed5);})[_0x32ef('0x21')](function(_0x256c40){_0x2f52d7[_0x32ef('0x3e')]=_0x256c40;return _0x2f52d7;})[_0x32ef('0x21')](respondWithFilteredResult(_0x1874ea,_0x38aed5))[_0x32ef('0x3f')](handleError(_0x1874ea,null));};exports[_0x32ef('0x40')]=function(_0x4615b4,_0x48e071){var _0x3cac2e={'raw':!![],'where':{'id':_0x4615b4[_0x32ef('0x41')]['id']}},_0xc3a6d3={};_0xc3a6d3[_0x32ef('0x28')]=_[_0x32ef('0x29')](db[_0x32ef('0x27')][_0x32ef('0x42')]);_0xc3a6d3['query']=_['keys'](_0x4615b4[_0x32ef('0x2a')]);_0xc3a6d3[_0x32ef('0x2b')]=_[_0x32ef('0x2c')](_0xc3a6d3[_0x32ef('0x28')],_0xc3a6d3['query']);_0x3cac2e[_0x32ef('0x2d')]=_[_0x32ef('0x2c')](_0xc3a6d3['model'],qs[_0x32ef('0x2e')](_0x4615b4['query'][_0x32ef('0x2e')]));_0x3cac2e[_0x32ef('0x2d')]=_0x3cac2e[_0x32ef('0x2d')][_0x32ef('0x43')]?_0x3cac2e[_0x32ef('0x2d')]:_0xc3a6d3[_0x32ef('0x28')];if(_0x4615b4[_0x32ef('0x2a')][_0x32ef('0x3b')]){_0x3cac2e[_0x32ef('0x3c')]=[{'all':!![]}];}_0x3cac2e=_[_0x32ef('0x39')]({},_0x3cac2e,_0x4615b4['options']);return db[_0x32ef('0x27')]['find'](_0x3cac2e)[_0x32ef('0x21')](handleEntityNotFound(_0x48e071,null))[_0x32ef('0x21')](respondWithResult(_0x48e071,null))[_0x32ef('0x3f')](handleError(_0x48e071,null));};exports['create']=function(_0x502113,_0x230ac9){return db[_0x32ef('0x27')][_0x32ef('0x44')](_0x502113[_0x32ef('0x45')],{})[_0x32ef('0x21')](respondWithResult(_0x230ac9,0xc9))[_0x32ef('0x3f')](handleError(_0x230ac9,null));};exports['describe']=function(_0x5cb6fc,_0x36252c){return db[_0x32ef('0x27')][_0x32ef('0x46')]()[_0x32ef('0x21')](respondWithResult(_0x36252c,null))[_0x32ef('0x3f')](handleError(_0x36252c,null));};exports[_0x32ef('0x47')]=function(_0x44ad11,_0x115fa3){if(_0x44ad11[_0x32ef('0x45')][_0x32ef('0x48')]){delete _0x44ad11[_0x32ef('0x45')][_0x32ef('0x48')];}return db[_0x32ef('0x27')]['find']({'where':{'uniqueid':_0x44ad11[_0x32ef('0x41')]['id']}})[_0x32ef('0x21')](handleEntityNotFound(_0x115fa3,null))[_0x32ef('0x21')](saveUpdates(_0x44ad11[_0x32ef('0x45')],null))[_0x32ef('0x21')](respondWithResult(_0x115fa3,null))[_0x32ef('0x3f')](handleError(_0x115fa3,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 0248981..dd354f0 100644 --- a/server/api/cmHopperHistory/cmHopperHistory.model.js +++ b/server/api/cmHopperHistory/cmHopperHistory.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['define','CmHopperHistory','endtime','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports'];(function(_0x11c58e,_0x20dc3d){var _0x1ee787=function(_0x1697a5){while(--_0x1697a5){_0x11c58e['push'](_0x11c58e['shift']());}};_0x1ee787(++_0x20dc3d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':'endtime','fields':[_0x0a9e('0xb')]},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory'];(function(_0x5492f3,_0x57c18a){var _0xf6dbc0=function(_0x153312){while(--_0x153312){_0x5492f3['push'](_0x5492f3['shift']());}};_0xf6dbc0(++_0x57c18a);}(_0xe706,0xa3));var _0x6e70=function(_0x2bf1d6,_0x410efd){_0x2bf1d6=_0x2bf1d6-0x0;var _0x1be08a=_0xe706[_0x2bf1d6];return _0x1be08a;};'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 8025808..0af9909 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 _0x50a8=['`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','CmHopperHistory,\x20%s,\x20%s','message','catch','CreateCmHopperHistory','options','raw','AvgHandleTime','findAll','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','GetVoiceQueueHopperHistory','where','campaign','name','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x50a8,0x198));var _0x850a=function(_0x2c6120,_0x1f3e60){_0x2c6120=_0x2c6120-0x0;var _0x5fb114=_0x50a8[_0x2c6120];return _0x5fb114;};'use strict';var _=require(_0x850a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x850a('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x850a('0x2'))['db'];var utils=require(_0x850a('0x3'));var logger=require(_0x850a('0x4'))(_0x850a('0x5'));var config=require(_0x850a('0x6'));var jayson=require(_0x850a('0x7'));var client=jayson[_0x850a('0x8')][_0x850a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3fdb41,_0x543ef0,_0x488676){return new BPromise(function(_0x3c138a,_0xf4dcd1){return client[_0x850a('0xa')](_0x3fdb41,_0x488676)[_0x850a('0xb')](function(_0x5c197f){logger[_0x850a('0xc')]('CmHopperHistory,\x20%s,\x20%s',_0x543ef0,'request\x20sent');logger[_0x850a('0xd')](_0x850a('0xe'),_0x543ef0,_0x850a('0xf'),JSON[_0x850a('0x10')](_0x5c197f));if(_0x5c197f[_0x850a('0x11')]){if(_0x5c197f['error']['code']===0x1f4){logger['error'](_0x850a('0x12'),_0x543ef0,_0x5c197f['error'][_0x850a('0x13')]);return _0xf4dcd1(_0x5c197f[_0x850a('0x11')][_0x850a('0x13')]);}logger[_0x850a('0x11')](_0x850a('0x12'),_0x543ef0,_0x5c197f['error'][_0x850a('0x13')]);return _0x3c138a(_0x5c197f['error']['message']);}else{logger['info']('CmHopperHistory,\x20%s,\x20%s',_0x543ef0,_0x850a('0xf'));_0x3c138a(_0x5c197f['result'][_0x850a('0x13')]);}})[_0x850a('0x14')](function(_0x3c90e6){logger[_0x850a('0x11')](_0x850a('0x12'),_0x543ef0,_0x3c90e6);_0xf4dcd1(_0x3c90e6);});});}exports[_0x850a('0x15')]=function(_0x3e2715){var _0x419ae6=this;return new Promise(function(_0x57e789,_0x432a28){return db['CmHopperHistory']['create'](_0x3e2715['body'],{'raw':_0x3e2715['options']?_0x3e2715[_0x850a('0x16')][_0x850a('0x17')]===undefined?!![]:![]:!![]})[_0x850a('0xb')](function(_0x5b2917){logger[_0x850a('0xc')](_0x850a('0x15'),_0x3e2715);logger[_0x850a('0xd')]('CreateCmHopperHistory',_0x3e2715,JSON['stringify'](_0x5b2917));_0x57e789(_0x5b2917);})[_0x850a('0x14')](function(_0x285ef4){logger[_0x850a('0x11')](_0x850a('0x15'),_0x285ef4['message'],_0x3e2715);_0x432a28(_0x419ae6['error'](0x1f4,_0x285ef4['message']));});});};exports[_0x850a('0x18')]=function(_0x47d527){var _0x3ad545=this;return new Promise(function(_0x2d01fd,_0x2a5f9b){return db['CmHopperHistory'][_0x850a('0x19')]({'raw':_0x47d527[_0x850a('0x16')]?_0x47d527[_0x850a('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x47d527[_0x850a('0x16')]?_0x47d527[_0x850a('0x16')]['where']||null:null,'attributes':[[db[_0x850a('0x1a')]['fn'](_0x850a('0x1b'),db[_0x850a('0x1a')][_0x850a('0x1c')]('id')),_0x850a('0x1d')],[db[_0x850a('0x1a')]['fn'](_0x850a('0x1b'),db[_0x850a('0x1a')]['fn']('IF',db[_0x850a('0x1a')][_0x850a('0x1e')](_0x850a('0x1f')))),_0x850a('0x20')],[db[_0x850a('0x1a')]['fn'](_0x850a('0x1b'),db[_0x850a('0x1a')]['fn']('IF',db['sequelize'][_0x850a('0x1e')]('`state`\x20=\x2010,\x201,\x20null'))),_0x850a('0x21')],[db[_0x850a('0x1a')]['fn'](_0x850a('0x1b'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x850a('0x22')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x850a('0x1a')]['fn'](_0x850a('0x23'),db[_0x850a('0x1a')]['fn']('IF',db[_0x850a('0x1a')]['literal'](_0x850a('0x24')))),_0x850a('0x25')],[db[_0x850a('0x1a')]['fn'](_0x850a('0x23'),db[_0x850a('0x1a')]['fn']('IF',db['sequelize']['literal'](_0x850a('0x26')))),'predictiveIntervalAvgTalktime']]})[_0x850a('0xb')](function(_0x1aa3b7){logger[_0x850a('0xc')](_0x850a('0x18'),_0x47d527);logger[_0x850a('0xd')](_0x850a('0x18'),_0x47d527,JSON[_0x850a('0x10')](_0x1aa3b7));_0x2d01fd(_0x1aa3b7);})[_0x850a('0x14')](function(_0x297fd3){logger[_0x850a('0x11')]('AvgHandleTime',_0x297fd3[_0x850a('0x13')],_0x47d527);_0x2a5f9b(_0x3ad545[_0x850a('0x11')](0x1f4,_0x297fd3[_0x850a('0x13')]));});});};exports[_0x850a('0x27')]=function(_0x450f1e){var _0x544507=this;return new Promise(function(_0x11c707,_0x376a12){return db['CmHopperHistory'][_0x850a('0x19')]({'raw':_0x450f1e[_0x850a('0x16')]?_0x450f1e[_0x850a('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x450f1e['options']?_0x450f1e[_0x850a('0x16')][_0x850a('0x28')]||null:null,'attributes':[[_0x850a('0x29'),_0x850a('0x2a')],[db[_0x850a('0x1a')]['fn'](_0x850a('0x1b'),db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x200,\x201,\x20null'))),'outboundNoSuchCallsDay'],[db[_0x850a('0x1a')]['fn'](_0x850a('0x1b'),db[_0x850a('0x1a')]['fn']('IF',db[_0x850a('0x1a')][_0x850a('0x1e')]('`state`\x20=\x203,\x201,\x20null'))),_0x850a('0x2b')],[db[_0x850a('0x1a')]['fn']('COUNT',db[_0x850a('0x1a')]['fn']('IF',db[_0x850a('0x1a')][_0x850a('0x1e')](_0x850a('0x1f')))),_0x850a('0x2c')],[db[_0x850a('0x1a')]['fn'](_0x850a('0x1b'),db[_0x850a('0x1a')]['fn']('IF',db['sequelize'][_0x850a('0x1e')](_0x850a('0x2d')))),_0x850a('0x2e')],[db['sequelize']['fn'](_0x850a('0x1b'),db[_0x850a('0x1a')]['fn']('IF',db[_0x850a('0x1a')][_0x850a('0x1e')](_0x850a('0x2f')))),_0x850a('0x30')],[db[_0x850a('0x1a')]['fn'](_0x850a('0x1b'),db[_0x850a('0x1a')]['fn']('IF',db[_0x850a('0x1a')][_0x850a('0x1e')](_0x850a('0x31')))),_0x850a('0x32')],[db['sequelize']['fn'](_0x850a('0x1b'),db[_0x850a('0x1a')]['fn']('IF',db[_0x850a('0x1a')][_0x850a('0x1e')](_0x850a('0x33')))),'outboundDropCallsDayCallersExit'],[db[_0x850a('0x1a')]['fn'](_0x850a('0x1b'),db['sequelize']['fn']('IF',db[_0x850a('0x1a')][_0x850a('0x1e')](_0x850a('0x34')))),_0x850a('0x35')],[db[_0x850a('0x1a')]['fn']('COUNT',db[_0x850a('0x1a')]['fn']('IF',db['sequelize'][_0x850a('0x1e')](_0x850a('0x36')))),_0x850a('0x37')],[db[_0x850a('0x1a')]['fn'](_0x850a('0x1b'),db[_0x850a('0x1a')]['fn']('IF',db[_0x850a('0x1a')]['literal']('`state`\x20=\x2014,\x201,\x20null'))),_0x850a('0x38')],[db[_0x850a('0x1a')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x850a('0x1a')]['literal']('`state`\x20=\x2018,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0x850a('0x1a')]['fn'](_0x850a('0x1b'),db[_0x850a('0x1a')]['fn']('IF',db[_0x850a('0x1a')]['literal'](_0x850a('0x39')))),_0x850a('0x3a')],[db['sequelize']['fn'](_0x850a('0x1b'),db[_0x850a('0x1a')]['fn']('IF',db[_0x850a('0x1a')]['literal']('`state`\x20=\x2020,\x201,\x20null'))),_0x850a('0x3b')],[db['sequelize']['fn'](_0x850a('0x1b'),db[_0x850a('0x1a')]['fn']('IF',db[_0x850a('0x1a')]['literal'](_0x850a('0x3c')))),_0x850a('0x3d')]],'group':['campaign']})['then'](function(_0x3247a8){logger[_0x850a('0xc')](_0x850a('0x27'),_0x450f1e);logger[_0x850a('0xd')]('GetVoiceQueueHopperHistory',_0x450f1e,JSON[_0x850a('0x10')](_0x3247a8));_0x11c707(_0x3247a8);})[_0x850a('0x14')](function(_0x27ee42){logger['error'](_0x850a('0x27'),_0x27ee42[_0x850a('0x13')],_0x450f1e);_0x376a12(_0x544507[_0x850a('0x11')](0x1f4,_0x27ee42['message']));});});};exports[_0x850a('0x3e')]=function(_0x5deeb9){var _0x3602e9=this;return new Promise(function(_0x3230cf,_0x562771){return db['CmHopperHistory']['findAll']({'raw':_0x5deeb9['options']?_0x5deeb9[_0x850a('0x16')][_0x850a('0x17')]===undefined?!![]:![]:!![],'where':_0x5deeb9[_0x850a('0x16')]?_0x5deeb9[_0x850a('0x16')]['where']||null:null,'attributes':[[_0x850a('0x29'),_0x850a('0x2a')],[db[_0x850a('0x1a')]['fn'](_0x850a('0x1b'),db[_0x850a('0x1a')]['col']('id')),_0x850a('0x3f')],[db['sequelize']['fn'](_0x850a('0x1b'),db['sequelize']['fn']('IF',db[_0x850a('0x1a')]['literal'](_0x850a('0x1f')))),_0x850a('0x40')]],'group':[_0x850a('0x29')]})[_0x850a('0xb')](function(_0x304c52){logger[_0x850a('0xc')](_0x850a('0x3e'),_0x5deeb9);logger[_0x850a('0xd')](_0x850a('0x3e'),_0x5deeb9,JSON[_0x850a('0x10')](_0x304c52));_0x3230cf(_0x304c52);})[_0x850a('0x14')](function(_0x4740bf){logger[_0x850a('0x11')](_0x850a('0x3e'),_0x4740bf[_0x850a('0x13')],_0x5deeb9);_0x562771(_0x3602e9[_0x850a('0x11')](0x1f4,_0x4740bf['message']));});});}; \ No newline at end of file +var _0x4dc0=['AvgHandleTime','where','sequelize','predictiveIntervalTotalCalls','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','findAll','name','`state`\x20=\x200,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','outboundReCallsDay','campaign','GetCampaignHopperHistory','col','ivrTotalCallsDays','ivrAnswerCallsDay','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CmHopperHistory','create','body','options','raw','CreateCmHopperHistory'];(function(_0x58ee19,_0xdf0765){var _0x49af25=function(_0x109b5e){while(--_0x109b5e){_0x58ee19['push'](_0x58ee19['shift']());}};_0x49af25(++_0xdf0765);}(_0x4dc0,0x13d));var _0x04dc=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x4dc0[_0x5b561d];return _0x431060;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x04dc('0x0'));var BPromise=require(_0x04dc('0x1'));var rs=require(_0x04dc('0x2'));var fs=require('fs');var Redis=require(_0x04dc('0x3'));var db=require(_0x04dc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x04dc('0x5'))(_0x04dc('0x6'));var config=require(_0x04dc('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x04dc('0x8')][_0x04dc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40d327,_0x53cc43,_0x53f6e4){return new BPromise(function(_0x5ce79e,_0x118c0e){return client[_0x04dc('0xa')](_0x40d327,_0x53f6e4)[_0x04dc('0xb')](function(_0x2641fa){logger[_0x04dc('0xc')](_0x04dc('0xd'),_0x53cc43,_0x04dc('0xe'));logger[_0x04dc('0xf')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x53cc43,_0x04dc('0xe'),JSON[_0x04dc('0x10')](_0x2641fa));if(_0x2641fa[_0x04dc('0x11')]){if(_0x2641fa['error'][_0x04dc('0x12')]===0x1f4){logger[_0x04dc('0x11')](_0x04dc('0xd'),_0x53cc43,_0x2641fa['error'][_0x04dc('0x13')]);return _0x118c0e(_0x2641fa[_0x04dc('0x11')][_0x04dc('0x13')]);}logger[_0x04dc('0x11')](_0x04dc('0xd'),_0x53cc43,_0x2641fa[_0x04dc('0x11')][_0x04dc('0x13')]);return _0x5ce79e(_0x2641fa['error']['message']);}else{logger['info'](_0x04dc('0xd'),_0x53cc43,_0x04dc('0xe'));_0x5ce79e(_0x2641fa[_0x04dc('0x14')][_0x04dc('0x13')]);}})[_0x04dc('0x15')](function(_0x1ff3eb){logger[_0x04dc('0x11')](_0x04dc('0xd'),_0x53cc43,_0x1ff3eb);_0x118c0e(_0x1ff3eb);});});}exports['CreateCmHopperHistory']=function(_0x4644ac){var _0x13c259=this;return new Promise(function(_0x1c387e,_0x43b657){return db[_0x04dc('0x16')][_0x04dc('0x17')](_0x4644ac[_0x04dc('0x18')],{'raw':_0x4644ac[_0x04dc('0x19')]?_0x4644ac['options'][_0x04dc('0x1a')]===undefined?!![]:![]:!![]})[_0x04dc('0xb')](function(_0x459c1d){logger[_0x04dc('0xc')]('CreateCmHopperHistory',_0x4644ac);logger[_0x04dc('0xf')](_0x04dc('0x1b'),_0x4644ac,JSON[_0x04dc('0x10')](_0x459c1d));_0x1c387e(_0x459c1d);})[_0x04dc('0x15')](function(_0x14bfa1){logger[_0x04dc('0x11')](_0x04dc('0x1b'),_0x14bfa1['message'],_0x4644ac);_0x43b657(_0x13c259[_0x04dc('0x11')](0x1f4,_0x14bfa1[_0x04dc('0x13')]));});});};exports[_0x04dc('0x1c')]=function(_0xef2e0e){var _0x3bb822=this;return new Promise(function(_0x24f41e,_0x4057ba){return db[_0x04dc('0x16')]['findAll']({'raw':_0xef2e0e[_0x04dc('0x19')]?_0xef2e0e['options'][_0x04dc('0x1a')]===undefined?!![]:![]:!![],'where':_0xef2e0e[_0x04dc('0x19')]?_0xef2e0e[_0x04dc('0x19')][_0x04dc('0x1d')]||null:null,'attributes':[[db[_0x04dc('0x1e')]['fn']('COUNT',db[_0x04dc('0x1e')]['col']('id')),_0x04dc('0x1f')],[db[_0x04dc('0x1e')]['fn'](_0x04dc('0x20'),db['sequelize']['fn']('IF',db[_0x04dc('0x1e')][_0x04dc('0x21')](_0x04dc('0x22')))),_0x04dc('0x23')],[db[_0x04dc('0x1e')]['fn'](_0x04dc('0x20'),db[_0x04dc('0x1e')]['fn']('IF',db[_0x04dc('0x1e')][_0x04dc('0x21')](_0x04dc('0x24')))),_0x04dc('0x25')],[db[_0x04dc('0x1e')]['fn'](_0x04dc('0x20'),db[_0x04dc('0x1e')]['fn']('IF',db['sequelize'][_0x04dc('0x21')](_0x04dc('0x26')))),_0x04dc('0x27')],[db[_0x04dc('0x1e')]['fn'](_0x04dc('0x28'),db[_0x04dc('0x1e')]['fn']('IF',db[_0x04dc('0x1e')][_0x04dc('0x21')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),'predictiveIntervalAvgHoldtime'],[db[_0x04dc('0x1e')]['fn'](_0x04dc('0x28'),db[_0x04dc('0x1e')]['fn']('IF',db['sequelize']['literal'](_0x04dc('0x29')))),_0x04dc('0x2a')]]})[_0x04dc('0xb')](function(_0x34628e){logger['info']('AvgHandleTime',_0xef2e0e);logger[_0x04dc('0xf')]('AvgHandleTime',_0xef2e0e,JSON[_0x04dc('0x10')](_0x34628e));_0x24f41e(_0x34628e);})[_0x04dc('0x15')](function(_0x42fd29){logger['error'](_0x04dc('0x1c'),_0x42fd29[_0x04dc('0x13')],_0xef2e0e);_0x4057ba(_0x3bb822[_0x04dc('0x11')](0x1f4,_0x42fd29[_0x04dc('0x13')]));});});};exports[_0x04dc('0x2b')]=function(_0x3dd3e1){var _0x271a1b=this;return new Promise(function(_0x21cdbc,_0xb0ebd8){return db[_0x04dc('0x16')][_0x04dc('0x2c')]({'raw':_0x3dd3e1[_0x04dc('0x19')]?_0x3dd3e1['options'][_0x04dc('0x1a')]===undefined?!![]:![]:!![],'where':_0x3dd3e1[_0x04dc('0x19')]?_0x3dd3e1[_0x04dc('0x19')][_0x04dc('0x1d')]||null:null,'attributes':[['campaign',_0x04dc('0x2d')],[db[_0x04dc('0x1e')]['fn']('COUNT',db[_0x04dc('0x1e')]['fn']('IF',db[_0x04dc('0x1e')][_0x04dc('0x21')](_0x04dc('0x2e')))),'outboundNoSuchCallsDay'],[db[_0x04dc('0x1e')]['fn'](_0x04dc('0x20'),db[_0x04dc('0x1e')]['fn']('IF',db[_0x04dc('0x1e')][_0x04dc('0x21')]('`state`\x20=\x203,\x201,\x20null'))),_0x04dc('0x2f')],[db[_0x04dc('0x1e')]['fn'](_0x04dc('0x20'),db[_0x04dc('0x1e')]['fn']('IF',db[_0x04dc('0x1e')]['literal'](_0x04dc('0x22')))),_0x04dc('0x30')],[db['sequelize']['fn']('COUNT',db[_0x04dc('0x1e')]['fn']('IF',db['sequelize'][_0x04dc('0x21')]('`state`\x20=\x205,\x201,\x20null'))),_0x04dc('0x31')],[db[_0x04dc('0x1e')]['fn']('COUNT',db[_0x04dc('0x1e')]['fn']('IF',db['sequelize'][_0x04dc('0x21')](_0x04dc('0x32')))),_0x04dc('0x33')],[db[_0x04dc('0x1e')]['fn'](_0x04dc('0x20'),db[_0x04dc('0x1e')]['fn']('IF',db[_0x04dc('0x1e')][_0x04dc('0x21')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x04dc('0x34')],[db['sequelize']['fn'](_0x04dc('0x20'),db[_0x04dc('0x1e')]['fn']('IF',db[_0x04dc('0x1e')][_0x04dc('0x21')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x04dc('0x35')],[db[_0x04dc('0x1e')]['fn']('COUNT',db[_0x04dc('0x1e')]['fn']('IF',db[_0x04dc('0x1e')][_0x04dc('0x21')](_0x04dc('0x36')))),_0x04dc('0x37')],[db['sequelize']['fn'](_0x04dc('0x20'),db[_0x04dc('0x1e')]['fn']('IF',db['sequelize'][_0x04dc('0x21')]('`state`\x20=\x2013,\x201,\x20null'))),_0x04dc('0x38')],[db[_0x04dc('0x1e')]['fn'](_0x04dc('0x20'),db[_0x04dc('0x1e')]['fn']('IF',db['sequelize'][_0x04dc('0x21')](_0x04dc('0x39')))),_0x04dc('0x3a')],[db[_0x04dc('0x1e')]['fn'](_0x04dc('0x20'),db['sequelize']['fn']('IF',db[_0x04dc('0x1e')][_0x04dc('0x21')](_0x04dc('0x3b')))),_0x04dc('0x3c')],[db[_0x04dc('0x1e')]['fn'](_0x04dc('0x20'),db[_0x04dc('0x1e')]['fn']('IF',db[_0x04dc('0x1e')][_0x04dc('0x21')](_0x04dc('0x3d')))),_0x04dc('0x3e')],[db[_0x04dc('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x04dc('0x1e')]['literal']('`state`\x20=\x2020,\x201,\x20null'))),_0x04dc('0x3c')],[db[_0x04dc('0x1e')]['fn']('COUNT',db[_0x04dc('0x1e')]['fn']('IF',db[_0x04dc('0x1e')][_0x04dc('0x21')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0x04dc('0x3f')]],'group':[_0x04dc('0x40')]})[_0x04dc('0xb')](function(_0x4b36a2){logger[_0x04dc('0xc')](_0x04dc('0x2b'),_0x3dd3e1);logger[_0x04dc('0xf')](_0x04dc('0x2b'),_0x3dd3e1,JSON[_0x04dc('0x10')](_0x4b36a2));_0x21cdbc(_0x4b36a2);})[_0x04dc('0x15')](function(_0x3ea0da){logger[_0x04dc('0x11')](_0x04dc('0x2b'),_0x3ea0da[_0x04dc('0x13')],_0x3dd3e1);_0xb0ebd8(_0x271a1b[_0x04dc('0x11')](0x1f4,_0x3ea0da[_0x04dc('0x13')]));});});};exports[_0x04dc('0x41')]=function(_0x3424f4){var _0x5ba3fc=this;return new Promise(function(_0x4bb181,_0x3e6660){return db[_0x04dc('0x16')][_0x04dc('0x2c')]({'raw':_0x3424f4['options']?_0x3424f4[_0x04dc('0x19')][_0x04dc('0x1a')]===undefined?!![]:![]:!![],'where':_0x3424f4['options']?_0x3424f4[_0x04dc('0x19')]['where']||null:null,'attributes':[['campaign',_0x04dc('0x2d')],[db[_0x04dc('0x1e')]['fn'](_0x04dc('0x20'),db['sequelize'][_0x04dc('0x42')]('id')),_0x04dc('0x43')],[db[_0x04dc('0x1e')]['fn'](_0x04dc('0x20'),db[_0x04dc('0x1e')]['fn']('IF',db[_0x04dc('0x1e')]['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x04dc('0x44')]],'group':[_0x04dc('0x40')]})[_0x04dc('0xb')](function(_0x288f07){logger['info'](_0x04dc('0x41'),_0x3424f4);logger[_0x04dc('0xf')]('GetCampaignHopperHistory',_0x3424f4,JSON[_0x04dc('0x10')](_0x288f07));_0x4bb181(_0x288f07);})['catch'](function(_0x52f871){logger['error'](_0x04dc('0x41'),_0x52f871[_0x04dc('0x13')],_0x3424f4);_0x3e6660(_0x5ba3fc[_0x04dc('0x11')](0x1f4,_0x52f871['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index f2aef26..f7bf598 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 _0xa4bd=['isAuthenticated','index','describe','/:id','show','post','put','update','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get'];(function(_0x4a5d87,_0x4ce685){var _0x4b9354=function(_0x37bca1){while(--_0x37bca1){_0x4a5d87['push'](_0x4a5d87['shift']());}};_0x4b9354(++_0x4ce685);}(_0xa4bd,0x1e4));var _0xda4b=function(_0x1e5c2a,_0xffaabe){_0x1e5c2a=_0x1e5c2a-0x0;var _0x5c1a70=_0xa4bd[_0x1e5c2a];return _0x5c1a70;};'use strict';var multer=require(_0xda4b('0x0'));var util=require(_0xda4b('0x1'));var path=require(_0xda4b('0x2'));var timeout=require('connect-timeout');var express=require(_0xda4b('0x3'));var router=express[_0xda4b('0x4')]();var auth=require(_0xda4b('0x5'));var interaction=require(_0xda4b('0x6'));var config=require(_0xda4b('0x7'));var controller=require(_0xda4b('0x8'));router[_0xda4b('0x9')]('/',auth[_0xda4b('0xa')](),controller[_0xda4b('0xb')]);router[_0xda4b('0x9')]('/describe',auth[_0xda4b('0xa')](),controller[_0xda4b('0xc')]);router[_0xda4b('0x9')](_0xda4b('0xd'),auth['isAuthenticated'](),controller[_0xda4b('0xe')]);router[_0xda4b('0xf')]('/',auth[_0xda4b('0xa')](),controller['create']);router[_0xda4b('0x10')]('/:id',auth[_0xda4b('0xa')](),controller[_0xda4b('0x11')]);module[_0xda4b('0x12')]=router; \ No newline at end of file +var _0xf3a7=['update','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','put'];(function(_0x86cf38,_0x17f89d){var _0x3e72bd=function(_0x4b0c0a){while(--_0x4b0c0a){_0x86cf38['push'](_0x86cf38['shift']());}};_0x3e72bd(++_0x17f89d);}(_0xf3a7,0x99));var _0x7f3a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf3a7[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0x7f3a('0x0'));var path=require(_0x7f3a('0x1'));var timeout=require(_0x7f3a('0x2'));var express=require(_0x7f3a('0x3'));var router=express[_0x7f3a('0x4')]();var auth=require(_0x7f3a('0x5'));var interaction=require(_0x7f3a('0x6'));var config=require(_0x7f3a('0x7'));var controller=require(_0x7f3a('0x8'));router[_0x7f3a('0x9')]('/',auth['isAuthenticated'](),controller[_0x7f3a('0xa')]);router[_0x7f3a('0x9')](_0x7f3a('0xb'),auth[_0x7f3a('0xc')](),controller[_0x7f3a('0xd')]);router[_0x7f3a('0x9')](_0x7f3a('0xe'),auth['isAuthenticated'](),controller[_0x7f3a('0xf')]);router[_0x7f3a('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7f3a('0x11')](_0x7f3a('0xe'),auth['isAuthenticated'](),controller[_0x7f3a('0x12')]);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 cfc05d0..a76fbcd 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 _0x814b=['STRING','name','sequelize','exports'];(function(_0x96fae1,_0x5ce7a9){var _0x1c5293=function(_0x15cc22){while(--_0x15cc22){_0x96fae1['push'](_0x96fae1['shift']());}};_0x1c5293(++_0x5ce7a9);}(_0x814b,0x1a2));var _0xb814=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0x814b[_0x1ae5ab];return _0x1ce001;};'use strict';var Sequelize=require(_0xb814('0x0'));module[_0xb814('0x1')]={'name':{'type':Sequelize[_0xb814('0x2')],'unique':_0xb814('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb814('0x2')]},'dialPrefix':{'type':Sequelize[_0xb814('0x2')]}}; \ No newline at end of file +var _0xabce=['exports','STRING','name','sequelize'];(function(_0x43f881,_0xd6e5a2){var _0x365c14=function(_0x50d386){while(--_0x50d386){_0x43f881['push'](_0x43f881['shift']());}};_0x365c14(++_0xd6e5a2);}(_0xabce,0x103));var _0xeabc=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xabce[_0x21aec3];return _0x288bbc;};'use strict';var Sequelize=require(_0xeabc('0x0'));module[_0xeabc('0x1')]={'name':{'type':Sequelize[_0xeabc('0x2')],'unique':_0xeabc('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xeabc('0x2')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index c56e393..487f6fc 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 _0x777d=['attributes','length','hasOwnProperty','limit','where','pick','filter','merge','map','type','key','VIRTUAL','options','include','findAll','rows','catch','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','getDispositions','nolimit','order','sort','removeDispositions','ids','addContacts','CmContact','isArray','tags','join','push','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CustomFields','concat','format','cf_%d','getContactsCsv','CmCustomField','raw','isEmpty','now','writeFileSync','setHeader','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','/tmp/list_%d_%s.csv','addCustomField','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','switch','defaultValue','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findOne','addAgents','omit','emit','userCmList:save','removeAgents','userCmList:remove','User','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','path','to-csv','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./cmList.socket','register','status','end','json','count','offset','Content-Range','apply','update','then','destroy','get','Lists','UserProfileResource','sendStatus','error','stack','name','send','index','CmList','rawAttributes','model','keys','query','filters','intersection','fields'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x777d,0xe9));var _0xd777=function(_0x5d6e30,_0xc21d51){_0x5d6e30=_0x5d6e30-0x0;var _0x3d3f3b=_0x777d[_0x5d6e30];return _0x3d3f3b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd777('0x0'));var rimraf=require(_0xd777('0x1'));var zipdir=require(_0xd777('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd777('0x3'));var moment=require(_0xd777('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xd777('0x5'));var sox=require('sox');var csv=require(_0xd777('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd777('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd777('0x8'));var toCsv=require(_0xd777('0x6'));var querystring=require(_0xd777('0x9'));var Papa=require(_0xd777('0xa'));var Redis=require(_0xd777('0xb'));var authService=require(_0xd777('0xc'));var qs=require(_0xd777('0xd'));var hardwareService=require(_0xd777('0xe'));var logger=require(_0xd777('0xf'))(_0xd777('0x10'));var utils=require(_0xd777('0x11'));var config=require(_0xd777('0x12'));var db=require(_0xd777('0x13'))['db'];config['redis']=_['defaults'](config[_0xd777('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0xd777('0x15'))(new Redis(config[_0xd777('0x14')]));require(_0xd777('0x16'))[_0xd777('0x17')](socket);function respondWithStatusCode(_0x2ac82f,_0x5d0ded){_0x5d0ded=_0x5d0ded||0xcc;return function(_0x84141c){if(_0x84141c){return _0x2ac82f['sendStatus'](_0x5d0ded);}return _0x2ac82f[_0xd777('0x18')](_0x5d0ded)[_0xd777('0x19')]();};}function respondWithResult(_0x1e5ecb,_0x1ef016){_0x1ef016=_0x1ef016||0xc8;return function(_0x25e3f2){if(_0x25e3f2){return _0x1e5ecb['status'](_0x1ef016)[_0xd777('0x1a')](_0x25e3f2);}};}function respondWithFilteredResult(_0x4b3d52,_0x39b300){return function(_0x4dcaed){if(_0x4dcaed){var _0xe62ec=_0x4dcaed[_0xd777('0x1b')],_0x386f1a=_0x39b300[_0xd777('0x1c')],_0x2dd8ec=_0x39b300['offset']+_0x39b300['limit'],_0x13b63b;if(_0x2dd8ec>=_0xe62ec){_0x2dd8ec=_0xe62ec;_0x13b63b=0xc8;}else{_0x13b63b=0xce;}_0x4b3d52[_0xd777('0x18')](_0x13b63b);return _0x4b3d52['set'](_0xd777('0x1d'),_0x386f1a+'-'+_0x2dd8ec+'/'+_0xe62ec)['json'](_0x4dcaed);}return null;};}function patchUpdates(_0x58a079){return function(_0x5b2204){try{jsonpatch[_0xd777('0x1e')](_0x5b2204,_0x58a079,!![]);}catch(_0x4e53ed){return BPromise['reject'](_0x4e53ed);}return _0x5b2204['save']();};}function saveUpdates(_0x48d18c,_0x55b975){return function(_0x8cfb5a){if(_0x8cfb5a){return _0x8cfb5a[_0xd777('0x1f')](_0x48d18c)[_0xd777('0x20')](function(_0x343405){return _0x343405;});}return null;};}function removeEntity(_0xfebc2f,_0x33c3d4){return function(_0x2ff8d3){if(_0x2ff8d3){return _0x2ff8d3[_0xd777('0x21')]()[_0xd777('0x20')](function(){var _0x3e637a=_0x2ff8d3[_0xd777('0x22')]({'plain':!![]});var _0x56af61=_0xd777('0x23');return db[_0xd777('0x24')][_0xd777('0x21')]({'where':{'type':_0x56af61,'resourceId':_0x3e637a['id']}})[_0xd777('0x20')](function(){return _0x2ff8d3;});})[_0xd777('0x20')](function(){_0xfebc2f['status'](0xcc)[_0xd777('0x19')]();});}};}function handleEntityNotFound(_0x5e752b,_0x482ad1){return function(_0x2ff04b){if(!_0x2ff04b){_0x5e752b[_0xd777('0x25')](0x194);}return _0x2ff04b;};}function handleError(_0x2dae46,_0x3db307){_0x3db307=_0x3db307||0x1f4;return function(_0x4c941c){logger[_0xd777('0x26')](_0x4c941c[_0xd777('0x27')]);if(_0x4c941c[_0xd777('0x28')]){delete _0x4c941c[_0xd777('0x28')];}_0x2dae46[_0xd777('0x18')](_0x3db307)[_0xd777('0x29')](_0x4c941c);};}exports[_0xd777('0x2a')]=function(_0x3ebb94,_0x508587){var _0x271fcb={},_0x587941={},_0x5bace1={'count':0x0,'rows':[]};var _0x3e69eb=db[_0xd777('0x2b')][_0xd777('0x2c')];_0x587941[_0xd777('0x2d')]=_['keys'](_0x3e69eb);_0x587941['query']=_[_0xd777('0x2e')](_0x3ebb94[_0xd777('0x2f')]);_0x587941[_0xd777('0x30')]=_[_0xd777('0x31')](_0x587941[_0xd777('0x2d')],_0x587941[_0xd777('0x2f')]);_0x271fcb['attributes']=_['intersection'](_0x587941[_0xd777('0x2d')],qs[_0xd777('0x32')](_0x3ebb94[_0xd777('0x2f')][_0xd777('0x32')]));_0x271fcb[_0xd777('0x33')]=_0x271fcb[_0xd777('0x33')][_0xd777('0x34')]?_0x271fcb[_0xd777('0x33')]:_0x587941['model'];if(!_0x3ebb94['query'][_0xd777('0x35')]('nolimit')){_0x271fcb[_0xd777('0x36')]=qs[_0xd777('0x36')](_0x3ebb94[_0xd777('0x2f')][_0xd777('0x36')]);_0x271fcb['offset']=qs[_0xd777('0x1c')](_0x3ebb94['query'][_0xd777('0x1c')]);}_0x271fcb['order']=qs['sort'](_0x3ebb94['query']['sort']);_0x271fcb[_0xd777('0x37')]=qs[_0xd777('0x30')](_[_0xd777('0x38')](_0x3ebb94['query'],_0x587941['filters']));if(_0x3ebb94['query'][_0xd777('0x39')]){_0x271fcb[_0xd777('0x37')]=_[_0xd777('0x3a')](_0x271fcb[_0xd777('0x37')],{'$or':_[_0xd777('0x3b')](_0x3e69eb,function(_0x2acdb5){if(_0x2acdb5[_0xd777('0x3c')][_0xd777('0x3d')]!==_0xd777('0x3e')){var _0x30deaa={};_0x30deaa[_0x2acdb5['field']]={'$like':'%'+_0x3ebb94[_0xd777('0x2f')][_0xd777('0x39')]+'%'};return _0x30deaa;}})});}_0x271fcb=_[_0xd777('0x3a')]({},_0x271fcb,_0x3ebb94[_0xd777('0x3f')]);var _0x8870a2={'where':_0x271fcb[_0xd777('0x37')]};return db[_0xd777('0x2b')][_0xd777('0x1b')](_0x8870a2)[_0xd777('0x20')](function(_0x34381b){_0x5bace1[_0xd777('0x1b')]=_0x34381b;if(_0x3ebb94[_0xd777('0x2f')]['includeAll']){_0x271fcb[_0xd777('0x40')]=[{'all':!![]}];}return db['CmList'][_0xd777('0x41')](_0x271fcb);})[_0xd777('0x20')](function(_0xc6297b){_0x5bace1[_0xd777('0x42')]=_0xc6297b;return _0x5bace1;})[_0xd777('0x20')](respondWithFilteredResult(_0x508587,_0x271fcb))[_0xd777('0x43')](handleError(_0x508587,null));};exports['show']=function(_0x3dd8af,_0x1c4b0e){var _0x27b32c={'raw':![],'where':{'id':_0x3dd8af[_0xd777('0x44')]['id']}},_0x5b6b4f={};_0x5b6b4f[_0xd777('0x2d')]=_[_0xd777('0x2e')](db[_0xd777('0x2b')][_0xd777('0x2c')]);_0x5b6b4f[_0xd777('0x2f')]=_[_0xd777('0x2e')](_0x3dd8af['query']);_0x5b6b4f[_0xd777('0x30')]=_[_0xd777('0x31')](_0x5b6b4f['model'],_0x5b6b4f['query']);_0x27b32c[_0xd777('0x33')]=_[_0xd777('0x31')](_0x5b6b4f[_0xd777('0x2d')],qs[_0xd777('0x32')](_0x3dd8af[_0xd777('0x2f')][_0xd777('0x32')]));_0x27b32c[_0xd777('0x33')]=_0x27b32c[_0xd777('0x33')][_0xd777('0x34')]?_0x27b32c[_0xd777('0x33')]:_0x5b6b4f[_0xd777('0x2d')];if(_0x3dd8af['query'][_0xd777('0x45')]){_0x27b32c[_0xd777('0x40')]=[{'all':!![]}];}_0x27b32c=_[_0xd777('0x3a')]({},_0x27b32c,_0x3dd8af['options']);return db['CmList'][_0xd777('0x46')](_0x27b32c)[_0xd777('0x20')](handleEntityNotFound(_0x1c4b0e,null))[_0xd777('0x20')](respondWithResult(_0x1c4b0e,null))[_0xd777('0x43')](handleError(_0x1c4b0e,null));};exports[_0xd777('0x47')]=function(_0x305c1c,_0x477626){return db[_0xd777('0x2b')]['create'](_0x305c1c[_0xd777('0x48')],{})['then'](function(_0x4c059d){var _0x82259f=_0x305c1c[_0xd777('0x49')]['get']({'plain':!![]});if(!_0x82259f)throw new Error(_0xd777('0x4a'));if(_0x82259f[_0xd777('0x4b')]===_0xd777('0x49')){var _0x25486b=_0x4c059d['get']({'plain':!![]});var _0x48740f=_0xd777('0x23');return db['UserProfileSection'][_0xd777('0x46')]({'where':{'name':_0x48740f,'userProfileId':_0x82259f[_0xd777('0x4c')]},'raw':!![]})[_0xd777('0x20')](function(_0x442954){if(_0x442954&&_0x442954[_0xd777('0x4d')]===0x0){return db['UserProfileResource'][_0xd777('0x47')]({'name':_0x25486b[_0xd777('0x28')],'resourceId':_0x25486b['id'],'type':_0x442954[_0xd777('0x28')],'sectionId':_0x442954['id']},{})['then'](function(){return _0x4c059d;});}else{return _0x4c059d;}})[_0xd777('0x43')](function(_0x221189){logger['error'](_0xd777('0x4e'),_0x221189);throw _0x221189;});}return _0x4c059d;})[_0xd777('0x20')](respondWithResult(_0x477626,0xc9))[_0xd777('0x43')](handleError(_0x477626,null));};exports['update']=function(_0xbb8cbb,_0x290ec6){if(_0xbb8cbb[_0xd777('0x48')]['id']){delete _0xbb8cbb[_0xd777('0x48')]['id'];}return db[_0xd777('0x2b')][_0xd777('0x46')]({'where':{'id':_0xbb8cbb[_0xd777('0x44')]['id']}})[_0xd777('0x20')](handleEntityNotFound(_0x290ec6,null))[_0xd777('0x20')](saveUpdates(_0xbb8cbb[_0xd777('0x48')],null))[_0xd777('0x20')](respondWithResult(_0x290ec6,null))[_0xd777('0x43')](handleError(_0x290ec6,null));};exports[_0xd777('0x21')]=function(_0x233434,_0x1d052a){return db[_0xd777('0x2b')][_0xd777('0x46')]({'where':{'id':_0x233434[_0xd777('0x44')]['id']}})[_0xd777('0x20')](handleEntityNotFound(_0x1d052a,null))[_0xd777('0x20')](removeEntity(_0x1d052a,null))[_0xd777('0x43')](handleError(_0x1d052a,null));};exports[_0xd777('0x4f')]=function(_0x47621d,_0x4e29d5){return db['CmList']['describe']()[_0xd777('0x20')](respondWithResult(_0x4e29d5,null))[_0xd777('0x43')](handleError(_0x4e29d5,null));};exports[_0xd777('0x50')]=function(_0x989d9d,_0x11c574,_0x5ef89b){if(_0x989d9d[_0xd777('0x48')]['id']){delete _0x989d9d[_0xd777('0x48')]['id'];}return db['CmList'][_0xd777('0x46')]({'where':{'id':_0x989d9d[_0xd777('0x44')]['id']}})[_0xd777('0x20')](handleEntityNotFound(_0x11c574,null))['then'](function(_0x164b80){if(_0x164b80){_0x989d9d['body'][_0xd777('0x51')]=_0x164b80['id'];return db[_0xd777('0x52')][_0xd777('0x47')](_0x989d9d[_0xd777('0x48')]);}})[_0xd777('0x20')](respondWithResult(_0x11c574,null))['catch'](handleError(_0x11c574,null));};exports[_0xd777('0x53')]=function(_0x5ded09,_0x1d5bf2,_0x23ad65){var _0xd88069={'raw':![],'where':{}};var _0x452bcf={};var _0x243f1e={'count':0x0,'rows':[]};return db[_0xd777('0x2b')]['findOne']({'where':{'id':_0x5ded09['params']['id']}})[_0xd777('0x20')](handleEntityNotFound(_0x1d5bf2,null))['then'](function(_0x4cd454){if(_0x4cd454){_0x452bcf[_0xd777('0x2d')]=_['keys'](db[_0xd777('0x52')][_0xd777('0x2c')]);_0x452bcf[_0xd777('0x2f')]=_[_0xd777('0x2e')](_0x5ded09['query']);_0x452bcf['filters']=_[_0xd777('0x31')](_0x452bcf[_0xd777('0x2d')],_0x452bcf[_0xd777('0x2f')]);_0xd88069[_0xd777('0x33')]=_[_0xd777('0x31')](_0x452bcf[_0xd777('0x2d')],qs[_0xd777('0x32')](_0x5ded09['query']['fields']));_0xd88069['attributes']=_0xd88069[_0xd777('0x33')][_0xd777('0x34')]?_0xd88069[_0xd777('0x33')]:_0x452bcf[_0xd777('0x2d')];if(!_0x5ded09['query'][_0xd777('0x35')](_0xd777('0x54'))){_0xd88069[_0xd777('0x36')]=qs[_0xd777('0x36')](_0x5ded09[_0xd777('0x2f')]['limit']);_0xd88069[_0xd777('0x1c')]=qs['offset'](_0x5ded09[_0xd777('0x2f')][_0xd777('0x1c')]);}_0xd88069[_0xd777('0x55')]=qs['sort'](_0x5ded09[_0xd777('0x2f')][_0xd777('0x56')]);_0xd88069[_0xd777('0x37')]=qs[_0xd777('0x30')](_[_0xd777('0x38')](_0x5ded09[_0xd777('0x2f')],_0x452bcf[_0xd777('0x30')]));_0xd88069['where'][_0xd777('0x51')]=_0x4cd454['id'];if(_0x5ded09[_0xd777('0x2f')][_0xd777('0x39')]){_0xd88069['where']=_[_0xd777('0x3a')](_0xd88069[_0xd777('0x37')],{'$or':_['map'](_0xd88069[_0xd777('0x33')],function(_0x5b26aa){var _0x593d65={};_0x593d65[_0x5b26aa]={'$like':'%'+_0x5ded09[_0xd777('0x2f')][_0xd777('0x39')]+'%'};return _0x593d65;})});}_0xd88069=_[_0xd777('0x3a')]({},_0xd88069,_0x5ded09['options']);return db[_0xd777('0x52')][_0xd777('0x1b')]({'where':_0xd88069['where']})[_0xd777('0x20')](function(_0x1bc38b){_0x243f1e[_0xd777('0x1b')]=_0x1bc38b;if(_0x5ded09['query']['includeAll']){_0xd88069[_0xd777('0x40')]=[{'all':!![]}];}return db[_0xd777('0x52')][_0xd777('0x41')](_0xd88069);})[_0xd777('0x20')](function(_0x74e7a2){_0x243f1e[_0xd777('0x42')]=_0x74e7a2;return _0x243f1e;});}})[_0xd777('0x20')](respondWithFilteredResult(_0x1d5bf2,_0xd88069))[_0xd777('0x43')](handleError(_0x1d5bf2,null));};exports[_0xd777('0x57')]=function(_0x5f07a9,_0x2888c4,_0x3f6edc){return db[_0xd777('0x2b')][_0xd777('0x46')]({'where':{'id':_0x5f07a9[_0xd777('0x44')]['id']}})[_0xd777('0x20')](handleEntityNotFound(_0x2888c4,null))[_0xd777('0x20')](function(_0x212d23){if(_0x212d23){return _0x212d23[_0xd777('0x57')](_0x5f07a9['query'][_0xd777('0x58')]);}})[_0xd777('0x20')](respondWithStatusCode(_0x2888c4,null))[_0xd777('0x43')](handleError(_0x2888c4,null));};exports[_0xd777('0x59')]=function(_0x4d3303,_0x5eb985,_0x418ba0){return db['CmList'][_0xd777('0x46')]({'where':{'id':_0x4d3303[_0xd777('0x44')]['id']}})[_0xd777('0x20')](handleEntityNotFound(_0x5eb985,null))['then'](function(_0x9b3c76){if(_0x9b3c76){var _0x609b6f=[];var _0x5b3a5f={'success':[],'errors':[]};return db[_0xd777('0x5a')][_0xd777('0x4f')]()[_0xd777('0x20')](function(_0x5b98e8){if(_0x4d3303[_0xd777('0x48')]['tags']&&_[_0xd777('0x5b')](_0x4d3303[_0xd777('0x48')][_0xd777('0x5c')])){if(_0x4d3303['body'][_0xd777('0x5c')][_0xd777('0x34')]){_0x4d3303[_0xd777('0x48')][_0xd777('0x5c')]=_0x4d3303[_0xd777('0x48')]['tags'][_0xd777('0x5d')](';')+';';}else{_0x4d3303['body'][_0xd777('0x5c')]=null;}}else{_0x4d3303[_0xd777('0x48')][_0xd777('0x5c')]=null;}if(_0x4d3303[_0xd777('0x48')]&&_[_0xd777('0x5b')](_0x4d3303[_0xd777('0x48')])){for(var _0x1677b9=0x0;_0x1677b9<_0x4d3303[_0xd777('0x48')][_0xd777('0x34')];_0x1677b9+=0x1){_0x4d3303[_0xd777('0x48')][_0x1677b9][_0xd777('0x51')]=_0x4d3303['params']['id'];_0x609b6f[_0xd777('0x5e')](_0x4d3303[_0xd777('0x48')][_0x1677b9]);}return BPromise['each'](_0x609b6f,function(_0x24017d){return db[_0xd777('0x5a')]['create'](_['omit'](_0x24017d,['ids','id'])||{},{'fields':_[_0xd777('0x2e')](_0x5b98e8),'raw':!![]})['then'](function(_0x440150){_0x5b3a5f[_0xd777('0x5f')]['push'](_0x440150[_0xd777('0x60')]);})['catch'](function(_0x3f4d22){_0x5b3a5f[_0xd777('0x61')][_0xd777('0x5e')]({'data':_0x24017d,'error':_0x3f4d22[_0xd777('0x62')]});});})[_0xd777('0x20')](function(_0x58f847){return _0x5b3a5f;})[_0xd777('0x43')](function(_0x502e20){return _0x502e20;});}else{_0x5eb985['status'](0x190)['json']({'message':_0xd777('0x63')});}});}})['then'](respondWithResult(_0x5eb985,null))['catch'](handleError(_0x5eb985,null));};exports[_0xd777('0x64')]=function(_0x12f816,_0x47061d,_0x3dab89){var _0xd396c6;return db[_0xd777('0x2b')][_0xd777('0x46')]({'where':{'id':_0x12f816[_0xd777('0x44')]['id']},'include':[{'model':db['CmCustomField'],'as':_0xd777('0x65')}]})[_0xd777('0x20')](handleEntityNotFound(_0x47061d,null))[_0xd777('0x20')](function(_0x184adb){if(_0x184adb){_0xd396c6=_0x184adb;return db[_0xd777('0x5a')][_0xd777('0x2c')];}})[_0xd777('0x20')](function(_0x83d4bd){if(_0x83d4bd){var _0x22bec2={};var _0x855ad9={};_0x855ad9[_0xd777('0x2d')]=_[_0xd777('0x66')](_[_0xd777('0x2e')](_0x83d4bd),_['map'](_0xd396c6['CustomFields'],function(_0x226e58){return util[_0xd777('0x67')](_0xd777('0x68'),_0x226e58['id']);}));_0x855ad9[_0xd777('0x2f')]=_[_0xd777('0x2e')](_0x12f816[_0xd777('0x2f')]);_0x855ad9[_0xd777('0x30')]=_[_0xd777('0x31')](_0x855ad9[_0xd777('0x2d')],_0x855ad9[_0xd777('0x2f')]);_0x22bec2[_0xd777('0x33')]=_[_0xd777('0x31')](_0x855ad9[_0xd777('0x2d')],qs[_0xd777('0x32')](_0x12f816['query'][_0xd777('0x32')]));_0x22bec2[_0xd777('0x33')]=_0x22bec2[_0xd777('0x33')]['length']?_0x22bec2[_0xd777('0x33')]:_0x855ad9['model'];if(!_0x12f816[_0xd777('0x2f')][_0xd777('0x35')](_0xd777('0x54'))){_0x22bec2[_0xd777('0x36')]=qs[_0xd777('0x36')](_0x12f816[_0xd777('0x2f')][_0xd777('0x36')]);_0x22bec2[_0xd777('0x1c')]=qs[_0xd777('0x1c')](_0x12f816[_0xd777('0x2f')][_0xd777('0x1c')]);}_0x22bec2[_0xd777('0x55')]=qs[_0xd777('0x56')](_0x12f816[_0xd777('0x2f')][_0xd777('0x56')]);_0x22bec2[_0xd777('0x37')]=qs[_0xd777('0x30')](_[_0xd777('0x38')](_0x12f816[_0xd777('0x2f')],_0x855ad9[_0xd777('0x30')]));_0x22bec2['raw']=!![];if(_0x12f816[_0xd777('0x2f')][_0xd777('0x39')]){_0x22bec2[_0xd777('0x37')]=_[_0xd777('0x3a')](_0x22bec2[_0xd777('0x37')],{'$or':_[_0xd777('0x3b')](_0x22bec2[_0xd777('0x33')],function(_0x148fbc){var _0x190a39={};_0x190a39[_0x148fbc]={'$like':'%'+_0x12f816[_0xd777('0x2f')]['filter']+'%'};return _0x190a39;})});}_0x22bec2=_[_0xd777('0x3a')]({},_0x22bec2,_0x12f816[_0xd777('0x3f')]);return _0xd396c6[_0xd777('0x64')](_0x22bec2);}})['then'](respondWithResult(_0x47061d,null))[_0xd777('0x43')](handleError(_0x47061d,null));};exports[_0xd777('0x69')]=function(_0x2ea1df,_0x3efc4a,_0x46909e){var _0x273744;return db[_0xd777('0x2b')][_0xd777('0x46')]({'where':{'id':_0x2ea1df[_0xd777('0x44')]['id']},'include':[{'model':db[_0xd777('0x6a')],'as':_0xd777('0x65')}]})[_0xd777('0x20')](handleEntityNotFound(_0x3efc4a,null))[_0xd777('0x20')](function(_0x6f01c8){if(_0x6f01c8){_0x273744=_0x6f01c8;return db[_0xd777('0x5a')][_0xd777('0x2c')];}})[_0xd777('0x20')](function(_0x4e3d29){if(_0x4e3d29){var _0x36b1f1={};var _0x2f60cd={};_0x2f60cd[_0xd777('0x2d')]=_[_0xd777('0x66')](_[_0xd777('0x2e')](_0x4e3d29),_[_0xd777('0x3b')](_0x273744[_0xd777('0x65')],function(_0x186fbb){return util[_0xd777('0x67')](_0xd777('0x68'),_0x186fbb['id']);}));_0x2f60cd[_0xd777('0x2f')]=_[_0xd777('0x2e')](_0x2ea1df[_0xd777('0x2f')]);_0x2f60cd[_0xd777('0x30')]=_[_0xd777('0x31')](_0x2f60cd[_0xd777('0x2d')],_0x2f60cd[_0xd777('0x2f')]);_0x36b1f1[_0xd777('0x33')]=_[_0xd777('0x31')](_0x2f60cd['model'],qs['fields'](_0x2ea1df[_0xd777('0x2f')]['fields']));_0x36b1f1[_0xd777('0x33')]=_0x36b1f1[_0xd777('0x33')][_0xd777('0x34')]?_0x36b1f1[_0xd777('0x33')]:_0x2f60cd['model'];if(!_0x2ea1df[_0xd777('0x2f')][_0xd777('0x35')](_0xd777('0x54'))){_0x36b1f1[_0xd777('0x36')]=qs[_0xd777('0x36')](_0x2ea1df[_0xd777('0x2f')]['limit']);_0x36b1f1[_0xd777('0x1c')]=qs[_0xd777('0x1c')](_0x2ea1df[_0xd777('0x2f')][_0xd777('0x1c')]);}_0x36b1f1[_0xd777('0x55')]=qs[_0xd777('0x56')](_0x2ea1df[_0xd777('0x2f')][_0xd777('0x56')]);_0x36b1f1[_0xd777('0x37')]=qs[_0xd777('0x30')](_['pick'](_0x2ea1df[_0xd777('0x2f')],_0x2f60cd[_0xd777('0x30')]));_0x36b1f1[_0xd777('0x6b')]=!![];if(_0x2ea1df['query'][_0xd777('0x39')]){_0x36b1f1[_0xd777('0x37')]=_[_0xd777('0x3a')](_0x36b1f1[_0xd777('0x37')],{'$or':_[_0xd777('0x3b')](_0x36b1f1[_0xd777('0x33')],function(_0x446868){var _0x27ce16={};_0x27ce16[_0x446868]={'$like':'%'+_0x2ea1df[_0xd777('0x2f')][_0xd777('0x39')]+'%'};return _0x27ce16;})});}_0x36b1f1=_[_0xd777('0x3a')]({},_0x36b1f1,_0x2ea1df['options']);return _0x273744[_0xd777('0x64')](_0x36b1f1);}})[_0xd777('0x20')](function(_0x5bdf74){if(!_[_0xd777('0x6c')](_0x5bdf74)){var _0x16cc3d=toCsv(_0x5bdf74);var _0x115481=Date[_0xd777('0x6d')]();fs[_0xd777('0x6e')](util['format']('/tmp/list_%d_%s.csv',_0x273744['id'],_0x115481),_0x16cc3d);_0x3efc4a[_0xd777('0x6f')]('Content-disposition',_0xd777('0x70')+util[_0xd777('0x67')](_0xd777('0x71'),_0x273744['id'],_0x115481));_0x3efc4a[_0xd777('0x6f')](_0xd777('0x72'),_0xd777('0x73'));return _0x3efc4a[_0xd777('0x74')](util[_0xd777('0x67')](_0xd777('0x75'),_0x273744['id'],_0x115481));}else{return _0x3efc4a[_0xd777('0x25')](0xcc);}})['catch'](handleError(_0x3efc4a,null));};exports[_0xd777('0x76')]=function(_0x47d399,_0x2e1cee,_0x57d405){var _0x1aa9cb;delete _0x47d399[_0xd777('0x48')]['id'];return db[_0xd777('0x2b')]['findOne']({'where':{'id':_0x47d399['params']['id']}})[_0xd777('0x20')](handleEntityNotFound(_0x2e1cee,null))['then'](function(_0x21cc93){if(_0x21cc93){return db[_0xd777('0x77')][_0xd777('0x78')](function(_0x2b16ca){return db['CmCustomField'][_0xd777('0x47')](_0x47d399['body'],{'transaction':_0x2b16ca})[_0xd777('0x20')](function(_0x2819c1){_0x1aa9cb=_0x2819c1;return _0x21cc93['addCustomFields'](_0x2819c1,{'transaction':_0x2b16ca});})[_0xd777('0x20')](function(){var _0x529b4c={'type':db[_0xd777('0x79')][_0xd777('0x7a')],'transaction':_0x2b16ca};switch(_0x47d399[_0xd777('0x48')][_0xd777('0x3c')]){case _0xd777('0x7b'):_0x529b4c[_0xd777('0x3c')]=db['Sequelize'][_0xd777('0x7a')];break;case _0xd777('0x7c'):_0x529b4c[_0xd777('0x3c')]=db[_0xd777('0x79')][_0xd777('0x7d')];break;case _0xd777('0x7e'):_0x529b4c[_0xd777('0x3c')]=db['Sequelize']['BOOLEAN'];_0x529b4c[_0xd777('0x7f')]=![];break;default:}return db['sequelize'][_0xd777('0x80')][_0xd777('0x81')](_0xd777('0x82'),util[_0xd777('0x67')](_0xd777('0x83'),_0x1aa9cb['id']),_0x529b4c);})[_0xd777('0x20')](function(){return _0x1aa9cb;});});}})[_0xd777('0x20')](respondWithResult(_0x2e1cee,null))[_0xd777('0x43')](handleError(_0x2e1cee,null));};exports[_0xd777('0x84')]=function(_0x549810,_0x5572f8,_0x1e4eba){var _0x3e7718={};var _0x4f4e4c={};var _0x180775;var _0x2e68aa;return db[_0xd777('0x2b')][_0xd777('0x85')]({'where':{'id':_0x549810[_0xd777('0x44')]['id']}})[_0xd777('0x20')](handleEntityNotFound(_0x5572f8,null))['then'](function(_0x2f4173){if(_0x2f4173){_0x180775=_0x2f4173;_0x4f4e4c['model']=_[_0xd777('0x2e')](db[_0xd777('0x6a')][_0xd777('0x2c')]);_0x4f4e4c[_0xd777('0x2f')]=_[_0xd777('0x2e')](_0x549810['query']);_0x4f4e4c[_0xd777('0x30')]=_['intersection'](_0x4f4e4c[_0xd777('0x2d')],_0x4f4e4c['query']);_0x3e7718[_0xd777('0x33')]=_['intersection'](_0x4f4e4c[_0xd777('0x2d')],qs[_0xd777('0x32')](_0x549810['query']['fields']));_0x3e7718[_0xd777('0x33')]=_0x3e7718[_0xd777('0x33')][_0xd777('0x34')]?_0x3e7718['attributes']:_0x4f4e4c['model'];_0x3e7718[_0xd777('0x55')]=qs[_0xd777('0x56')](_0x549810[_0xd777('0x2f')]['sort']);_0x3e7718[_0xd777('0x37')]=qs[_0xd777('0x30')](_['pick'](_0x549810[_0xd777('0x2f')],_0x4f4e4c[_0xd777('0x30')]));_0x3e7718[_0xd777('0x37')]=_[_0xd777('0x3a')](_0x3e7718[_0xd777('0x37')],{'$or':[{'ListId':_0x2f4173['id']},{'ListId':null}]});if(_0x549810['query'][_0xd777('0x39')]){_0x3e7718[_0xd777('0x37')]=_[_0xd777('0x3a')](_0x3e7718[_0xd777('0x37')],{'$or':_[_0xd777('0x3b')](_0x3e7718[_0xd777('0x33')],function(_0x4de484){var _0x3da814={};_0x3da814[_0x4de484]={'$like':'%'+_0x549810[_0xd777('0x2f')][_0xd777('0x39')]+'%'};return _0x3da814;})});}_0x3e7718=_[_0xd777('0x3a')]({},_0x3e7718,_0x549810[_0xd777('0x3f')]);return db[_0xd777('0x6a')]['findAndCountAll'](_0x3e7718);}})[_0xd777('0x20')](respondWithResult(_0x5572f8,null))['catch'](handleError(_0x5572f8,null));};exports['addAgents']=function(_0x18cef5,_0x109687,_0x367f1a){return db['CmList'][_0xd777('0x46')]({'where':{'id':_0x18cef5['params']['id']}})[_0xd777('0x20')](handleEntityNotFound(_0x109687,null))['then'](function(_0x310ac2){if(_0x310ac2){return _0x310ac2[_0xd777('0x86')](_0x18cef5['body'][_0xd777('0x58')],_[_0xd777('0x87')](_0x18cef5[_0xd777('0x48')],[_0xd777('0x58'),'id'])||{})['spread'](function(_0x5780b1){for(var _0x32ddb2=0x0;_0x32ddb2<_0x18cef5[_0xd777('0x48')][_0xd777('0x58')]['length'];_0x32ddb2+=0x1){socket[_0xd777('0x88')](_0xd777('0x89'),{'UserId':_0x18cef5[_0xd777('0x48')][_0xd777('0x58')][_0x32ddb2],'CmListId':_0x18cef5[_0xd777('0x44')]['id']});}return _0x5780b1;});}})[_0xd777('0x20')](respondWithResult(_0x109687,null))[_0xd777('0x43')](handleError(_0x109687,null));};exports[_0xd777('0x8a')]=function(_0xe19399,_0x27a51f,_0x3885ac){return db[_0xd777('0x2b')][_0xd777('0x46')]({'where':{'id':_0xe19399[_0xd777('0x44')]['id']}})[_0xd777('0x20')](handleEntityNotFound(_0x27a51f,null))['then'](function(_0x2685fe){if(_0x2685fe){return _0x2685fe[_0xd777('0x8a')](_0xe19399[_0xd777('0x2f')][_0xd777('0x58')])[_0xd777('0x20')](function(){if(_[_0xd777('0x5b')](_0xe19399['query']['ids'])){for(var _0x10641d=0x0;_0x10641d<_0xe19399[_0xd777('0x2f')][_0xd777('0x58')][_0xd777('0x34')];_0x10641d+=0x1){socket[_0xd777('0x88')](_0xd777('0x8b'),{'UserId':Number(_0xe19399[_0xd777('0x2f')][_0xd777('0x58')][_0x10641d]),'CmListId':Number(_0xe19399[_0xd777('0x44')]['id'])});}}else{socket['emit']('userCmList:remove',{'UserId':Number(_0xe19399[_0xd777('0x2f')][_0xd777('0x58')]),'CmListId':Number(_0xe19399[_0xd777('0x44')]['id'])});}});}})['then'](respondWithStatusCode(_0x27a51f,null))[_0xd777('0x43')](handleError(_0x27a51f,null));};exports['getAgents']=function(_0x580f77,_0x8e1882,_0x4f0b6b){var _0x5bf2c7={};var _0x3fb6ff={};var _0x578209;var _0x3a2e29;return db[_0xd777('0x2b')][_0xd777('0x85')]({'where':{'id':_0x580f77['params']['id']}})[_0xd777('0x20')](handleEntityNotFound(_0x8e1882,null))['then'](function(_0x326a05){if(_0x326a05){_0x578209=_0x326a05;_0x3fb6ff[_0xd777('0x2d')]=_[_0xd777('0x2e')](db[_0xd777('0x8c')][_0xd777('0x2c')]);_0x3fb6ff[_0xd777('0x2f')]=_[_0xd777('0x2e')](_0x580f77[_0xd777('0x2f')]);_0x3fb6ff[_0xd777('0x30')]=_['intersection'](_0x3fb6ff[_0xd777('0x2d')],_0x3fb6ff[_0xd777('0x2f')]);_0x5bf2c7[_0xd777('0x33')]=_[_0xd777('0x31')](_0x3fb6ff[_0xd777('0x2d')],qs[_0xd777('0x32')](_0x580f77[_0xd777('0x2f')][_0xd777('0x32')]));_0x5bf2c7['attributes']=_0x5bf2c7[_0xd777('0x33')][_0xd777('0x34')]?_0x5bf2c7[_0xd777('0x33')]:_0x3fb6ff[_0xd777('0x2d')];_0x5bf2c7[_0xd777('0x55')]=qs['sort'](_0x580f77[_0xd777('0x2f')][_0xd777('0x56')]);_0x5bf2c7['where']=qs[_0xd777('0x30')](_[_0xd777('0x38')](_0x580f77[_0xd777('0x2f')],_0x3fb6ff[_0xd777('0x30')]));if(_0x580f77[_0xd777('0x2f')][_0xd777('0x39')]){_0x5bf2c7[_0xd777('0x37')]=_['merge'](_0x5bf2c7[_0xd777('0x37')],{'$or':_['map'](_0x5bf2c7[_0xd777('0x33')],function(_0x48e5ac){var _0xc8672e={};_0xc8672e[_0x48e5ac]={'$like':'%'+_0x580f77[_0xd777('0x2f')]['filter']+'%'};return _0xc8672e;})});}_0x5bf2c7=_[_0xd777('0x3a')]({},_0x5bf2c7,_0x580f77[_0xd777('0x3f')]);return _0x578209[_0xd777('0x8d')](_0x5bf2c7);}})[_0xd777('0x20')](function(_0x54e99d){if(_0x54e99d){_0x3a2e29=_0x54e99d['length'];if(!_0x580f77[_0xd777('0x2f')][_0xd777('0x35')](_0xd777('0x54'))){_0x5bf2c7[_0xd777('0x36')]=qs[_0xd777('0x36')](_0x580f77['query']['limit']);_0x5bf2c7[_0xd777('0x1c')]=qs[_0xd777('0x1c')](_0x580f77[_0xd777('0x2f')][_0xd777('0x1c')]);}return _0x578209[_0xd777('0x8d')](_0x5bf2c7);}})[_0xd777('0x20')](function(_0xcec782){if(_0xcec782){return _0xcec782?{'count':_0x3a2e29,'rows':_0xcec782}:null;}})['then'](respondWithResult(_0x8e1882,null))[_0xd777('0x43')](handleError(_0x8e1882,null));}; \ No newline at end of file +var _0x80df=['rawAttributes','model','keys','query','intersection','fields','attributes','hasOwnProperty','limit','order','sort','where','pick','filters','filter','merge','map','field','options','CmList','includeAll','include','findAll','rows','catch','show','params','length','find','create','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ListId','getDispositions','findOne','Disposition','nolimit','removeDispositions','ids','addContacts','tags','join','push','each','CmContact','omit','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','cf_%d','raw','getContactsCsv','format','isEmpty','now','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','text/csv','download','addCustomField','sequelize','addCustomFields','Sequelize','text','type','TEXT','number','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','removeAgents','userCmList:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','socket.io-emitter','./cmList.socket','sendStatus','status','end','json','count','offset','set','apply','reject','save','update','then','destroy','get','Lists','error','stack','name','index'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x80df,0x17e));var _0xf80d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x80df[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0xf80d('0x0'));var emlformat=require(_0xf80d('0x1'));var rimraf=require(_0xf80d('0x2'));var zipdir=require(_0xf80d('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf80d('0x4'));var moment=require(_0xf80d('0x5'));var BPromise=require(_0xf80d('0x6'));var Mustache=require(_0xf80d('0x7'));var util=require(_0xf80d('0x8'));var path=require(_0xf80d('0x9'));var sox=require(_0xf80d('0xa'));var csv=require(_0xf80d('0xb'));var ejs=require(_0xf80d('0xc'));var fs=require('fs');var _=require(_0xf80d('0xd'));var squel=require('squel');var crypto=require(_0xf80d('0xe'));var jsforce=require(_0xf80d('0xf'));var deskjs=require(_0xf80d('0x10'));var toCsv=require(_0xf80d('0xb'));var querystring=require(_0xf80d('0x11'));var Papa=require(_0xf80d('0x12'));var Redis=require(_0xf80d('0x13'));var authService=require(_0xf80d('0x14'));var qs=require(_0xf80d('0x15'));var hardwareService=require(_0xf80d('0x16'));var logger=require(_0xf80d('0x17'))(_0xf80d('0x18'));var utils=require(_0xf80d('0x19'));var config=require(_0xf80d('0x1a'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xf80d('0x1b')](config[_0xf80d('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0xf80d('0x1d'))(new Redis(config['redis']));require(_0xf80d('0x1e'))['register'](socket);function respondWithStatusCode(_0x4285de,_0x50c968){_0x50c968=_0x50c968||0xcc;return function(_0x3be9a9){if(_0x3be9a9){return _0x4285de[_0xf80d('0x1f')](_0x50c968);}return _0x4285de[_0xf80d('0x20')](_0x50c968)[_0xf80d('0x21')]();};}function respondWithResult(_0x2098d6,_0x45751c){_0x45751c=_0x45751c||0xc8;return function(_0x482043){if(_0x482043){return _0x2098d6[_0xf80d('0x20')](_0x45751c)[_0xf80d('0x22')](_0x482043);}};}function respondWithFilteredResult(_0x3b8a82,_0x282ebc){return function(_0x27b2ea){if(_0x27b2ea){var _0x3f5d02=_0x27b2ea[_0xf80d('0x23')],_0x1d104a=_0x282ebc[_0xf80d('0x24')],_0x34b49d=_0x282ebc[_0xf80d('0x24')]+_0x282ebc['limit'],_0x2ea2c1;if(_0x34b49d>=_0x3f5d02){_0x34b49d=_0x3f5d02;_0x2ea2c1=0xc8;}else{_0x2ea2c1=0xce;}_0x3b8a82[_0xf80d('0x20')](_0x2ea2c1);return _0x3b8a82[_0xf80d('0x25')]('Content-Range',_0x1d104a+'-'+_0x34b49d+'/'+_0x3f5d02)[_0xf80d('0x22')](_0x27b2ea);}return null;};}function patchUpdates(_0x539c80){return function(_0x3f3a2a){try{jsonpatch[_0xf80d('0x26')](_0x3f3a2a,_0x539c80,!![]);}catch(_0x2d5e46){return BPromise[_0xf80d('0x27')](_0x2d5e46);}return _0x3f3a2a[_0xf80d('0x28')]();};}function saveUpdates(_0x25d031,_0x446153){return function(_0x269859){if(_0x269859){return _0x269859[_0xf80d('0x29')](_0x25d031)[_0xf80d('0x2a')](function(_0x33d58c){return _0x33d58c;});}return null;};}function removeEntity(_0x739968,_0x570c99){return function(_0x32ad42){if(_0x32ad42){return _0x32ad42[_0xf80d('0x2b')]()['then'](function(){var _0x3353a3=_0x32ad42[_0xf80d('0x2c')]({'plain':!![]});var _0x323540=_0xf80d('0x2d');return db['UserProfileResource'][_0xf80d('0x2b')]({'where':{'type':_0x323540,'resourceId':_0x3353a3['id']}})[_0xf80d('0x2a')](function(){return _0x32ad42;});})[_0xf80d('0x2a')](function(){_0x739968[_0xf80d('0x20')](0xcc)[_0xf80d('0x21')]();});}};}function handleEntityNotFound(_0xde054a,_0x2fc429){return function(_0x68f2c6){if(!_0x68f2c6){_0xde054a[_0xf80d('0x1f')](0x194);}return _0x68f2c6;};}function handleError(_0x4d2579,_0xe940d6){_0xe940d6=_0xe940d6||0x1f4;return function(_0x1603a4){logger[_0xf80d('0x2e')](_0x1603a4[_0xf80d('0x2f')]);if(_0x1603a4[_0xf80d('0x30')]){delete _0x1603a4[_0xf80d('0x30')];}_0x4d2579[_0xf80d('0x20')](_0xe940d6)['send'](_0x1603a4);};}exports[_0xf80d('0x31')]=function(_0x27887e,_0x214bff){var _0x435e23={},_0x5c3a1d={},_0x487d2c={'count':0x0,'rows':[]};var _0x2359f1=db['CmList'][_0xf80d('0x32')];_0x5c3a1d[_0xf80d('0x33')]=_[_0xf80d('0x34')](_0x2359f1);_0x5c3a1d['query']=_[_0xf80d('0x34')](_0x27887e[_0xf80d('0x35')]);_0x5c3a1d['filters']=_[_0xf80d('0x36')](_0x5c3a1d[_0xf80d('0x33')],_0x5c3a1d[_0xf80d('0x35')]);_0x435e23['attributes']=_[_0xf80d('0x36')](_0x5c3a1d[_0xf80d('0x33')],qs[_0xf80d('0x37')](_0x27887e[_0xf80d('0x35')][_0xf80d('0x37')]));_0x435e23['attributes']=_0x435e23[_0xf80d('0x38')]['length']?_0x435e23[_0xf80d('0x38')]:_0x5c3a1d[_0xf80d('0x33')];if(!_0x27887e[_0xf80d('0x35')][_0xf80d('0x39')]('nolimit')){_0x435e23[_0xf80d('0x3a')]=qs[_0xf80d('0x3a')](_0x27887e[_0xf80d('0x35')][_0xf80d('0x3a')]);_0x435e23['offset']=qs[_0xf80d('0x24')](_0x27887e[_0xf80d('0x35')][_0xf80d('0x24')]);}_0x435e23[_0xf80d('0x3b')]=qs[_0xf80d('0x3c')](_0x27887e[_0xf80d('0x35')][_0xf80d('0x3c')]);_0x435e23[_0xf80d('0x3d')]=qs['filters'](_[_0xf80d('0x3e')](_0x27887e[_0xf80d('0x35')],_0x5c3a1d[_0xf80d('0x3f')]));if(_0x27887e['query'][_0xf80d('0x40')]){_0x435e23['where']=_[_0xf80d('0x41')](_0x435e23[_0xf80d('0x3d')],{'$or':_[_0xf80d('0x42')](_0x2359f1,function(_0xed4cc5){if(_0xed4cc5['type']['key']!=='VIRTUAL'){var _0xab1905={};_0xab1905[_0xed4cc5[_0xf80d('0x43')]]={'$like':'%'+_0x27887e[_0xf80d('0x35')][_0xf80d('0x40')]+'%'};return _0xab1905;}})});}_0x435e23=_[_0xf80d('0x41')]({},_0x435e23,_0x27887e[_0xf80d('0x44')]);var _0x4b4c55={'where':_0x435e23[_0xf80d('0x3d')]};return db[_0xf80d('0x45')][_0xf80d('0x23')](_0x4b4c55)['then'](function(_0x14314a){_0x487d2c['count']=_0x14314a;if(_0x27887e[_0xf80d('0x35')][_0xf80d('0x46')]){_0x435e23[_0xf80d('0x47')]=[{'all':!![]}];}return db[_0xf80d('0x45')][_0xf80d('0x48')](_0x435e23);})[_0xf80d('0x2a')](function(_0x2d2a2b){_0x487d2c[_0xf80d('0x49')]=_0x2d2a2b;return _0x487d2c;})[_0xf80d('0x2a')](respondWithFilteredResult(_0x214bff,_0x435e23))[_0xf80d('0x4a')](handleError(_0x214bff,null));};exports[_0xf80d('0x4b')]=function(_0x437e44,_0x1a68fb){var _0x1e78f1={'raw':![],'where':{'id':_0x437e44[_0xf80d('0x4c')]['id']}},_0x34ae03={};_0x34ae03[_0xf80d('0x33')]=_[_0xf80d('0x34')](db[_0xf80d('0x45')][_0xf80d('0x32')]);_0x34ae03[_0xf80d('0x35')]=_[_0xf80d('0x34')](_0x437e44[_0xf80d('0x35')]);_0x34ae03[_0xf80d('0x3f')]=_[_0xf80d('0x36')](_0x34ae03['model'],_0x34ae03[_0xf80d('0x35')]);_0x1e78f1[_0xf80d('0x38')]=_[_0xf80d('0x36')](_0x34ae03[_0xf80d('0x33')],qs[_0xf80d('0x37')](_0x437e44['query'][_0xf80d('0x37')]));_0x1e78f1[_0xf80d('0x38')]=_0x1e78f1[_0xf80d('0x38')][_0xf80d('0x4d')]?_0x1e78f1[_0xf80d('0x38')]:_0x34ae03[_0xf80d('0x33')];if(_0x437e44[_0xf80d('0x35')][_0xf80d('0x46')]){_0x1e78f1[_0xf80d('0x47')]=[{'all':!![]}];}_0x1e78f1=_[_0xf80d('0x41')]({},_0x1e78f1,_0x437e44[_0xf80d('0x44')]);return db[_0xf80d('0x45')][_0xf80d('0x4e')](_0x1e78f1)[_0xf80d('0x2a')](handleEntityNotFound(_0x1a68fb,null))[_0xf80d('0x2a')](respondWithResult(_0x1a68fb,null))[_0xf80d('0x4a')](handleError(_0x1a68fb,null));};exports[_0xf80d('0x4f')]=function(_0x5c6adc,_0x468024){return db[_0xf80d('0x45')][_0xf80d('0x4f')](_0x5c6adc['body'],{})[_0xf80d('0x2a')](function(_0x1088ca){var _0x51e367=_0x5c6adc['user'][_0xf80d('0x2c')]({'plain':!![]});if(!_0x51e367)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x51e367[_0xf80d('0x50')]===_0xf80d('0x51')){var _0x31b135=_0x1088ca[_0xf80d('0x2c')]({'plain':!![]});var _0x45f8cd=_0xf80d('0x2d');return db[_0xf80d('0x52')][_0xf80d('0x4e')]({'where':{'name':_0x45f8cd,'userProfileId':_0x51e367[_0xf80d('0x53')]},'raw':!![]})[_0xf80d('0x2a')](function(_0x26c09c){if(_0x26c09c&&_0x26c09c[_0xf80d('0x54')]===0x0){return db['UserProfileResource'][_0xf80d('0x4f')]({'name':_0x31b135[_0xf80d('0x30')],'resourceId':_0x31b135['id'],'type':_0x26c09c[_0xf80d('0x30')],'sectionId':_0x26c09c['id']},{})['then'](function(){return _0x1088ca;});}else{return _0x1088ca;}})[_0xf80d('0x4a')](function(_0x393c15){logger['error'](_0xf80d('0x55'),_0x393c15);throw _0x393c15;});}return _0x1088ca;})[_0xf80d('0x2a')](respondWithResult(_0x468024,0xc9))['catch'](handleError(_0x468024,null));};exports[_0xf80d('0x29')]=function(_0xad06b0,_0x2c6362){if(_0xad06b0[_0xf80d('0x56')]['id']){delete _0xad06b0['body']['id'];}return db[_0xf80d('0x45')][_0xf80d('0x4e')]({'where':{'id':_0xad06b0[_0xf80d('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2c6362,null))[_0xf80d('0x2a')](saveUpdates(_0xad06b0[_0xf80d('0x56')],null))[_0xf80d('0x2a')](respondWithResult(_0x2c6362,null))[_0xf80d('0x4a')](handleError(_0x2c6362,null));};exports[_0xf80d('0x2b')]=function(_0x2ea04b,_0x3e5ddc){return db[_0xf80d('0x45')][_0xf80d('0x4e')]({'where':{'id':_0x2ea04b[_0xf80d('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3e5ddc,null))[_0xf80d('0x2a')](removeEntity(_0x3e5ddc,null))[_0xf80d('0x4a')](handleError(_0x3e5ddc,null));};exports[_0xf80d('0x57')]=function(_0x32c02e,_0x5cec7c){return db['CmList'][_0xf80d('0x57')]()[_0xf80d('0x2a')](respondWithResult(_0x5cec7c,null))['catch'](handleError(_0x5cec7c,null));};exports[_0xf80d('0x58')]=function(_0x38f2ec,_0x444d3b,_0x15a051){if(_0x38f2ec['body']['id']){delete _0x38f2ec[_0xf80d('0x56')]['id'];}return db['CmList'][_0xf80d('0x4e')]({'where':{'id':_0x38f2ec[_0xf80d('0x4c')]['id']}})[_0xf80d('0x2a')](handleEntityNotFound(_0x444d3b,null))['then'](function(_0x4edbdc){if(_0x4edbdc){_0x38f2ec[_0xf80d('0x56')][_0xf80d('0x59')]=_0x4edbdc['id'];return db['Disposition']['create'](_0x38f2ec[_0xf80d('0x56')]);}})[_0xf80d('0x2a')](respondWithResult(_0x444d3b,null))[_0xf80d('0x4a')](handleError(_0x444d3b,null));};exports[_0xf80d('0x5a')]=function(_0x436a38,_0x40582f,_0x20a325){var _0xd65617={'raw':![],'where':{}};var _0x570e93={};var _0x31d148={'count':0x0,'rows':[]};return db[_0xf80d('0x45')][_0xf80d('0x5b')]({'where':{'id':_0x436a38['params']['id']}})[_0xf80d('0x2a')](handleEntityNotFound(_0x40582f,null))[_0xf80d('0x2a')](function(_0x57ac3b){if(_0x57ac3b){_0x570e93[_0xf80d('0x33')]=_[_0xf80d('0x34')](db[_0xf80d('0x5c')]['rawAttributes']);_0x570e93[_0xf80d('0x35')]=_[_0xf80d('0x34')](_0x436a38[_0xf80d('0x35')]);_0x570e93['filters']=_['intersection'](_0x570e93[_0xf80d('0x33')],_0x570e93[_0xf80d('0x35')]);_0xd65617['attributes']=_[_0xf80d('0x36')](_0x570e93['model'],qs[_0xf80d('0x37')](_0x436a38[_0xf80d('0x35')][_0xf80d('0x37')]));_0xd65617['attributes']=_0xd65617[_0xf80d('0x38')][_0xf80d('0x4d')]?_0xd65617[_0xf80d('0x38')]:_0x570e93[_0xf80d('0x33')];if(!_0x436a38[_0xf80d('0x35')][_0xf80d('0x39')](_0xf80d('0x5d'))){_0xd65617[_0xf80d('0x3a')]=qs[_0xf80d('0x3a')](_0x436a38[_0xf80d('0x35')][_0xf80d('0x3a')]);_0xd65617[_0xf80d('0x24')]=qs['offset'](_0x436a38[_0xf80d('0x35')][_0xf80d('0x24')]);}_0xd65617[_0xf80d('0x3b')]=qs['sort'](_0x436a38[_0xf80d('0x35')][_0xf80d('0x3c')]);_0xd65617['where']=qs['filters'](_[_0xf80d('0x3e')](_0x436a38[_0xf80d('0x35')],_0x570e93['filters']));_0xd65617[_0xf80d('0x3d')][_0xf80d('0x59')]=_0x57ac3b['id'];if(_0x436a38[_0xf80d('0x35')]['filter']){_0xd65617['where']=_[_0xf80d('0x41')](_0xd65617[_0xf80d('0x3d')],{'$or':_[_0xf80d('0x42')](_0xd65617[_0xf80d('0x38')],function(_0x4468f5){var _0x563d76={};_0x563d76[_0x4468f5]={'$like':'%'+_0x436a38[_0xf80d('0x35')][_0xf80d('0x40')]+'%'};return _0x563d76;})});}_0xd65617=_['merge']({},_0xd65617,_0x436a38[_0xf80d('0x44')]);return db[_0xf80d('0x5c')][_0xf80d('0x23')]({'where':_0xd65617[_0xf80d('0x3d')]})['then'](function(_0x38b552){_0x31d148[_0xf80d('0x23')]=_0x38b552;if(_0x436a38[_0xf80d('0x35')][_0xf80d('0x46')]){_0xd65617[_0xf80d('0x47')]=[{'all':!![]}];}return db[_0xf80d('0x5c')][_0xf80d('0x48')](_0xd65617);})[_0xf80d('0x2a')](function(_0xcf78b){_0x31d148[_0xf80d('0x49')]=_0xcf78b;return _0x31d148;});}})[_0xf80d('0x2a')](respondWithFilteredResult(_0x40582f,_0xd65617))[_0xf80d('0x4a')](handleError(_0x40582f,null));};exports[_0xf80d('0x5e')]=function(_0x7bd905,_0x43c68f,_0x2af0e7){return db[_0xf80d('0x45')]['find']({'where':{'id':_0x7bd905['params']['id']}})[_0xf80d('0x2a')](handleEntityNotFound(_0x43c68f,null))[_0xf80d('0x2a')](function(_0x33864f){if(_0x33864f){return _0x33864f[_0xf80d('0x5e')](_0x7bd905['query'][_0xf80d('0x5f')]);}})[_0xf80d('0x2a')](respondWithStatusCode(_0x43c68f,null))[_0xf80d('0x4a')](handleError(_0x43c68f,null));};exports[_0xf80d('0x60')]=function(_0x4637cd,_0x1d13ad,_0x3bf472){return db[_0xf80d('0x45')]['find']({'where':{'id':_0x4637cd[_0xf80d('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1d13ad,null))[_0xf80d('0x2a')](function(_0x15aa06){if(_0x15aa06){var _0x188e92=[];var _0x4291b8={'success':[],'errors':[]};return db['CmContact']['describe']()[_0xf80d('0x2a')](function(_0x2d5257){if(_0x4637cd[_0xf80d('0x56')][_0xf80d('0x61')]&&_['isArray'](_0x4637cd[_0xf80d('0x56')][_0xf80d('0x61')])){if(_0x4637cd[_0xf80d('0x56')][_0xf80d('0x61')]['length']){_0x4637cd[_0xf80d('0x56')]['tags']=_0x4637cd[_0xf80d('0x56')][_0xf80d('0x61')][_0xf80d('0x62')](';')+';';}else{_0x4637cd[_0xf80d('0x56')][_0xf80d('0x61')]=null;}}else{_0x4637cd[_0xf80d('0x56')][_0xf80d('0x61')]=null;}if(_0x4637cd['body']&&_['isArray'](_0x4637cd[_0xf80d('0x56')])){for(var _0x2f34ec=0x0;_0x2f34ec<_0x4637cd[_0xf80d('0x56')][_0xf80d('0x4d')];_0x2f34ec+=0x1){_0x4637cd['body'][_0x2f34ec]['ListId']=_0x4637cd['params']['id'];_0x188e92[_0xf80d('0x63')](_0x4637cd[_0xf80d('0x56')][_0x2f34ec]);}return BPromise[_0xf80d('0x64')](_0x188e92,function(_0x12a205){return db[_0xf80d('0x65')]['create'](_[_0xf80d('0x66')](_0x12a205,[_0xf80d('0x5f'),'id'])||{},{'fields':_['keys'](_0x2d5257),'raw':!![]})[_0xf80d('0x2a')](function(_0x3c0b8c){_0x4291b8['success'][_0xf80d('0x63')](_0x3c0b8c['dataValues']);})[_0xf80d('0x4a')](function(_0x1e35de){_0x4291b8[_0xf80d('0x67')]['push']({'data':_0x12a205,'error':_0x1e35de[_0xf80d('0x68')]});});})['then'](function(_0x5061ac){return _0x4291b8;})[_0xf80d('0x4a')](function(_0xe017c3){return _0xe017c3;});}else{_0x1d13ad[_0xf80d('0x20')](0x190)[_0xf80d('0x22')]({'message':_0xf80d('0x69')});}});}})[_0xf80d('0x2a')](respondWithResult(_0x1d13ad,null))['catch'](handleError(_0x1d13ad,null));};exports[_0xf80d('0x6a')]=function(_0x36007d,_0x2a0620,_0x59ae53){var _0x18b0b0;return db[_0xf80d('0x45')]['find']({'where':{'id':_0x36007d['params']['id']},'include':[{'model':db[_0xf80d('0x6b')],'as':_0xf80d('0x6c')}]})[_0xf80d('0x2a')](handleEntityNotFound(_0x2a0620,null))[_0xf80d('0x2a')](function(_0x2acbf1){if(_0x2acbf1){_0x18b0b0=_0x2acbf1;return db['CmContact'][_0xf80d('0x32')];}})['then'](function(_0x4e4566){if(_0x4e4566){var _0x5bd651={};var _0x26a14f={};_0x26a14f['model']=_[_0xf80d('0x6d')](_['keys'](_0x4e4566),_[_0xf80d('0x42')](_0x18b0b0[_0xf80d('0x6c')],function(_0x151ebc){return util['format'](_0xf80d('0x6e'),_0x151ebc['id']);}));_0x26a14f['query']=_[_0xf80d('0x34')](_0x36007d['query']);_0x26a14f[_0xf80d('0x3f')]=_[_0xf80d('0x36')](_0x26a14f[_0xf80d('0x33')],_0x26a14f[_0xf80d('0x35')]);_0x5bd651[_0xf80d('0x38')]=_[_0xf80d('0x36')](_0x26a14f[_0xf80d('0x33')],qs[_0xf80d('0x37')](_0x36007d[_0xf80d('0x35')][_0xf80d('0x37')]));_0x5bd651[_0xf80d('0x38')]=_0x5bd651['attributes']['length']?_0x5bd651[_0xf80d('0x38')]:_0x26a14f[_0xf80d('0x33')];if(!_0x36007d[_0xf80d('0x35')]['hasOwnProperty']('nolimit')){_0x5bd651['limit']=qs['limit'](_0x36007d[_0xf80d('0x35')][_0xf80d('0x3a')]);_0x5bd651[_0xf80d('0x24')]=qs[_0xf80d('0x24')](_0x36007d['query'][_0xf80d('0x24')]);}_0x5bd651['order']=qs[_0xf80d('0x3c')](_0x36007d[_0xf80d('0x35')][_0xf80d('0x3c')]);_0x5bd651['where']=qs[_0xf80d('0x3f')](_['pick'](_0x36007d[_0xf80d('0x35')],_0x26a14f['filters']));_0x5bd651[_0xf80d('0x6f')]=!![];if(_0x36007d['query']['filter']){_0x5bd651[_0xf80d('0x3d')]=_[_0xf80d('0x41')](_0x5bd651['where'],{'$or':_[_0xf80d('0x42')](_0x5bd651[_0xf80d('0x38')],function(_0x3655cb){var _0xe4d1e6={};_0xe4d1e6[_0x3655cb]={'$like':'%'+_0x36007d[_0xf80d('0x35')][_0xf80d('0x40')]+'%'};return _0xe4d1e6;})});}_0x5bd651=_[_0xf80d('0x41')]({},_0x5bd651,_0x36007d[_0xf80d('0x44')]);return _0x18b0b0[_0xf80d('0x6a')](_0x5bd651);}})[_0xf80d('0x2a')](respondWithResult(_0x2a0620,null))['catch'](handleError(_0x2a0620,null));};exports[_0xf80d('0x70')]=function(_0x28f0fe,_0x26e47b,_0x31d8d0){var _0x35c1a;return db[_0xf80d('0x45')][_0xf80d('0x4e')]({'where':{'id':_0x28f0fe[_0xf80d('0x4c')]['id']},'include':[{'model':db[_0xf80d('0x6b')],'as':_0xf80d('0x6c')}]})[_0xf80d('0x2a')](handleEntityNotFound(_0x26e47b,null))[_0xf80d('0x2a')](function(_0x3b0577){if(_0x3b0577){_0x35c1a=_0x3b0577;return db[_0xf80d('0x65')][_0xf80d('0x32')];}})[_0xf80d('0x2a')](function(_0x4ef680){if(_0x4ef680){var _0x580b89={};var _0x450149={};_0x450149['model']=_[_0xf80d('0x6d')](_[_0xf80d('0x34')](_0x4ef680),_[_0xf80d('0x42')](_0x35c1a['CustomFields'],function(_0x2e8357){return util[_0xf80d('0x71')](_0xf80d('0x6e'),_0x2e8357['id']);}));_0x450149['query']=_[_0xf80d('0x34')](_0x28f0fe[_0xf80d('0x35')]);_0x450149[_0xf80d('0x3f')]=_[_0xf80d('0x36')](_0x450149[_0xf80d('0x33')],_0x450149[_0xf80d('0x35')]);_0x580b89[_0xf80d('0x38')]=_[_0xf80d('0x36')](_0x450149['model'],qs[_0xf80d('0x37')](_0x28f0fe['query'][_0xf80d('0x37')]));_0x580b89[_0xf80d('0x38')]=_0x580b89[_0xf80d('0x38')]['length']?_0x580b89['attributes']:_0x450149[_0xf80d('0x33')];if(!_0x28f0fe[_0xf80d('0x35')][_0xf80d('0x39')](_0xf80d('0x5d'))){_0x580b89[_0xf80d('0x3a')]=qs['limit'](_0x28f0fe[_0xf80d('0x35')][_0xf80d('0x3a')]);_0x580b89[_0xf80d('0x24')]=qs[_0xf80d('0x24')](_0x28f0fe['query']['offset']);}_0x580b89[_0xf80d('0x3b')]=qs[_0xf80d('0x3c')](_0x28f0fe['query'][_0xf80d('0x3c')]);_0x580b89[_0xf80d('0x3d')]=qs[_0xf80d('0x3f')](_[_0xf80d('0x3e')](_0x28f0fe[_0xf80d('0x35')],_0x450149['filters']));_0x580b89['raw']=!![];if(_0x28f0fe[_0xf80d('0x35')]['filter']){_0x580b89['where']=_['merge'](_0x580b89[_0xf80d('0x3d')],{'$or':_[_0xf80d('0x42')](_0x580b89[_0xf80d('0x38')],function(_0x3aa53f){var _0x14e44f={};_0x14e44f[_0x3aa53f]={'$like':'%'+_0x28f0fe[_0xf80d('0x35')][_0xf80d('0x40')]+'%'};return _0x14e44f;})});}_0x580b89=_[_0xf80d('0x41')]({},_0x580b89,_0x28f0fe[_0xf80d('0x44')]);return _0x35c1a[_0xf80d('0x6a')](_0x580b89);}})['then'](function(_0x526b2c){if(!_[_0xf80d('0x72')](_0x526b2c)){var _0x2932d2=toCsv(_0x526b2c);var _0x372bc0=Date[_0xf80d('0x73')]();fs['writeFileSync'](util[_0xf80d('0x71')](_0xf80d('0x74'),_0x35c1a['id'],_0x372bc0),_0x2932d2);_0x26e47b[_0xf80d('0x75')](_0xf80d('0x76'),_0xf80d('0x77')+util[_0xf80d('0x71')]('list_%d_%s.csv',_0x35c1a['id'],_0x372bc0));_0x26e47b[_0xf80d('0x75')]('Content-type',_0xf80d('0x78'));return _0x26e47b[_0xf80d('0x79')](util[_0xf80d('0x71')](_0xf80d('0x74'),_0x35c1a['id'],_0x372bc0));}else{return _0x26e47b[_0xf80d('0x1f')](0xcc);}})['catch'](handleError(_0x26e47b,null));};exports[_0xf80d('0x7a')]=function(_0xe344c5,_0x2fcc5c,_0x2fc1ec){var _0x142e30;delete _0xe344c5[_0xf80d('0x56')]['id'];return db[_0xf80d('0x45')][_0xf80d('0x5b')]({'where':{'id':_0xe344c5[_0xf80d('0x4c')]['id']}})[_0xf80d('0x2a')](handleEntityNotFound(_0x2fcc5c,null))[_0xf80d('0x2a')](function(_0x56f72c){if(_0x56f72c){return db[_0xf80d('0x7b')]['transaction'](function(_0x2d5fd3){return db['CmCustomField'][_0xf80d('0x4f')](_0xe344c5[_0xf80d('0x56')],{'transaction':_0x2d5fd3})[_0xf80d('0x2a')](function(_0x3493c7){_0x142e30=_0x3493c7;return _0x56f72c[_0xf80d('0x7c')](_0x3493c7,{'transaction':_0x2d5fd3});})[_0xf80d('0x2a')](function(){var _0x33a691={'type':db[_0xf80d('0x7d')]['TEXT'],'transaction':_0x2d5fd3};switch(_0xe344c5[_0xf80d('0x56')]['type']){case _0xf80d('0x7e'):_0x33a691[_0xf80d('0x7f')]=db[_0xf80d('0x7d')][_0xf80d('0x80')];break;case _0xf80d('0x81'):_0x33a691['type']=db[_0xf80d('0x7d')]['INTEGER'];break;case _0xf80d('0x82'):_0x33a691[_0xf80d('0x7f')]=db['Sequelize'][_0xf80d('0x83')];_0x33a691[_0xf80d('0x84')]=![];break;default:}return db['sequelize'][_0xf80d('0x85')][_0xf80d('0x86')]('cm_contacts',util[_0xf80d('0x71')](_0xf80d('0x87'),_0x142e30['id']),_0x33a691);})[_0xf80d('0x2a')](function(){return _0x142e30;});});}})[_0xf80d('0x2a')](respondWithResult(_0x2fcc5c,null))[_0xf80d('0x4a')](handleError(_0x2fcc5c,null));};exports[_0xf80d('0x88')]=function(_0x5f4e4b,_0x5619f8,_0xda3764){var _0x4bca19={};var _0x2aa9b4={};var _0x54bb0d;var _0x22a91d;return db['CmList']['findOne']({'where':{'id':_0x5f4e4b[_0xf80d('0x4c')]['id']}})[_0xf80d('0x2a')](handleEntityNotFound(_0x5619f8,null))[_0xf80d('0x2a')](function(_0x451bea){if(_0x451bea){_0x54bb0d=_0x451bea;_0x2aa9b4[_0xf80d('0x33')]=_[_0xf80d('0x34')](db[_0xf80d('0x6b')][_0xf80d('0x32')]);_0x2aa9b4[_0xf80d('0x35')]=_['keys'](_0x5f4e4b['query']);_0x2aa9b4['filters']=_[_0xf80d('0x36')](_0x2aa9b4[_0xf80d('0x33')],_0x2aa9b4[_0xf80d('0x35')]);_0x4bca19[_0xf80d('0x38')]=_[_0xf80d('0x36')](_0x2aa9b4[_0xf80d('0x33')],qs[_0xf80d('0x37')](_0x5f4e4b['query'][_0xf80d('0x37')]));_0x4bca19[_0xf80d('0x38')]=_0x4bca19[_0xf80d('0x38')][_0xf80d('0x4d')]?_0x4bca19[_0xf80d('0x38')]:_0x2aa9b4[_0xf80d('0x33')];_0x4bca19[_0xf80d('0x3b')]=qs[_0xf80d('0x3c')](_0x5f4e4b[_0xf80d('0x35')]['sort']);_0x4bca19[_0xf80d('0x3d')]=qs[_0xf80d('0x3f')](_[_0xf80d('0x3e')](_0x5f4e4b[_0xf80d('0x35')],_0x2aa9b4[_0xf80d('0x3f')]));_0x4bca19[_0xf80d('0x3d')]=_[_0xf80d('0x41')](_0x4bca19['where'],{'$or':[{'ListId':_0x451bea['id']},{'ListId':null}]});if(_0x5f4e4b[_0xf80d('0x35')]['filter']){_0x4bca19[_0xf80d('0x3d')]=_['merge'](_0x4bca19['where'],{'$or':_[_0xf80d('0x42')](_0x4bca19[_0xf80d('0x38')],function(_0x180c99){var _0x39cc13={};_0x39cc13[_0x180c99]={'$like':'%'+_0x5f4e4b['query'][_0xf80d('0x40')]+'%'};return _0x39cc13;})});}_0x4bca19=_[_0xf80d('0x41')]({},_0x4bca19,_0x5f4e4b[_0xf80d('0x44')]);return db['CmCustomField'][_0xf80d('0x89')](_0x4bca19);}})[_0xf80d('0x2a')](respondWithResult(_0x5619f8,null))[_0xf80d('0x4a')](handleError(_0x5619f8,null));};exports[_0xf80d('0x8a')]=function(_0x39feb8,_0x3ff602,_0x4df24f){return db[_0xf80d('0x45')][_0xf80d('0x4e')]({'where':{'id':_0x39feb8[_0xf80d('0x4c')]['id']}})[_0xf80d('0x2a')](handleEntityNotFound(_0x3ff602,null))[_0xf80d('0x2a')](function(_0x21b989){if(_0x21b989){return _0x21b989['addAgents'](_0x39feb8[_0xf80d('0x56')][_0xf80d('0x5f')],_[_0xf80d('0x66')](_0x39feb8[_0xf80d('0x56')],[_0xf80d('0x5f'),'id'])||{})[_0xf80d('0x8b')](function(_0x1de1a6){for(var _0x4ca332=0x0;_0x4ca332<_0x39feb8[_0xf80d('0x56')][_0xf80d('0x5f')]['length'];_0x4ca332+=0x1){socket[_0xf80d('0x8c')]('userCmList:save',{'UserId':_0x39feb8[_0xf80d('0x56')][_0xf80d('0x5f')][_0x4ca332],'CmListId':_0x39feb8[_0xf80d('0x4c')]['id']});}return _0x1de1a6;});}})['then'](respondWithResult(_0x3ff602,null))['catch'](handleError(_0x3ff602,null));};exports[_0xf80d('0x8d')]=function(_0x2b735b,_0xfbc8a4,_0x166978){return db[_0xf80d('0x45')][_0xf80d('0x4e')]({'where':{'id':_0x2b735b['params']['id']}})[_0xf80d('0x2a')](handleEntityNotFound(_0xfbc8a4,null))['then'](function(_0x487bcd){if(_0x487bcd){return _0x487bcd[_0xf80d('0x8d')](_0x2b735b[_0xf80d('0x35')]['ids'])[_0xf80d('0x2a')](function(){if(_['isArray'](_0x2b735b[_0xf80d('0x35')]['ids'])){for(var _0x4ce4d3=0x0;_0x4ce4d3<_0x2b735b[_0xf80d('0x35')]['ids']['length'];_0x4ce4d3+=0x1){socket[_0xf80d('0x8c')](_0xf80d('0x8e'),{'UserId':Number(_0x2b735b['query'][_0xf80d('0x5f')][_0x4ce4d3]),'CmListId':Number(_0x2b735b[_0xf80d('0x4c')]['id'])});}}else{socket[_0xf80d('0x8c')](_0xf80d('0x8e'),{'UserId':Number(_0x2b735b[_0xf80d('0x35')][_0xf80d('0x5f')]),'CmListId':Number(_0x2b735b[_0xf80d('0x4c')]['id'])});}});}})['then'](respondWithStatusCode(_0xfbc8a4,null))['catch'](handleError(_0xfbc8a4,null));};exports[_0xf80d('0x8f')]=function(_0x1ad1c6,_0x8e4ba7,_0x4be097){var _0x520dcd={};var _0x29f3c={};var _0x590fab;var _0x55664f;return db['CmList']['findOne']({'where':{'id':_0x1ad1c6[_0xf80d('0x4c')]['id']}})[_0xf80d('0x2a')](handleEntityNotFound(_0x8e4ba7,null))[_0xf80d('0x2a')](function(_0xa75ce2){if(_0xa75ce2){_0x590fab=_0xa75ce2;_0x29f3c['model']=_['keys'](db['User'][_0xf80d('0x32')]);_0x29f3c[_0xf80d('0x35')]=_[_0xf80d('0x34')](_0x1ad1c6[_0xf80d('0x35')]);_0x29f3c[_0xf80d('0x3f')]=_[_0xf80d('0x36')](_0x29f3c['model'],_0x29f3c[_0xf80d('0x35')]);_0x520dcd[_0xf80d('0x38')]=_[_0xf80d('0x36')](_0x29f3c[_0xf80d('0x33')],qs[_0xf80d('0x37')](_0x1ad1c6[_0xf80d('0x35')][_0xf80d('0x37')]));_0x520dcd[_0xf80d('0x38')]=_0x520dcd[_0xf80d('0x38')][_0xf80d('0x4d')]?_0x520dcd[_0xf80d('0x38')]:_0x29f3c[_0xf80d('0x33')];_0x520dcd[_0xf80d('0x3b')]=qs[_0xf80d('0x3c')](_0x1ad1c6[_0xf80d('0x35')][_0xf80d('0x3c')]);_0x520dcd['where']=qs[_0xf80d('0x3f')](_['pick'](_0x1ad1c6['query'],_0x29f3c[_0xf80d('0x3f')]));if(_0x1ad1c6[_0xf80d('0x35')][_0xf80d('0x40')]){_0x520dcd[_0xf80d('0x3d')]=_[_0xf80d('0x41')](_0x520dcd[_0xf80d('0x3d')],{'$or':_[_0xf80d('0x42')](_0x520dcd['attributes'],function(_0x361268){var _0x2939a9={};_0x2939a9[_0x361268]={'$like':'%'+_0x1ad1c6[_0xf80d('0x35')][_0xf80d('0x40')]+'%'};return _0x2939a9;})});}_0x520dcd=_[_0xf80d('0x41')]({},_0x520dcd,_0x1ad1c6[_0xf80d('0x44')]);return _0x590fab[_0xf80d('0x8f')](_0x520dcd);}})['then'](function(_0x4049f5){if(_0x4049f5){_0x55664f=_0x4049f5['length'];if(!_0x1ad1c6[_0xf80d('0x35')][_0xf80d('0x39')](_0xf80d('0x5d'))){_0x520dcd[_0xf80d('0x3a')]=qs['limit'](_0x1ad1c6[_0xf80d('0x35')][_0xf80d('0x3a')]);_0x520dcd['offset']=qs[_0xf80d('0x24')](_0x1ad1c6[_0xf80d('0x35')]['offset']);}return _0x590fab[_0xf80d('0x8f')](_0x520dcd);}})[_0xf80d('0x2a')](function(_0x5ce43b){if(_0x5ce43b){return _0x5ce43b?{'count':_0x55664f,'rows':_0x5ce43b}:null;}})[_0xf80d('0x2a')](respondWithResult(_0x8e4ba7,null))[_0xf80d('0x4a')](handleError(_0x8e4ba7,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index d1d4636..1a07eba 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 _0x0d1c=['hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x25a3b5,_0x18c189){var _0x388b7d=function(_0x3d9877){while(--_0x3d9877){_0x25a3b5['push'](_0x25a3b5['shift']());}};_0x388b7d(++_0x18c189);}(_0x0d1c,0x173));var _0xc0d1=function(_0x3a3c89,_0x1bc124){_0x3a3c89=_0x3a3c89-0x0;var _0x4a8379=_0x0d1c[_0x3a3c89];return _0x4a8379;};'use strict';var EventEmitter=require(_0xc0d1('0x0'));var CmList=require(_0xc0d1('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0xc0d1('0x2')](0x0);var events={'afterCreate':_0xc0d1('0x3'),'afterUpdate':_0xc0d1('0x4'),'afterDestroy':_0xc0d1('0x5')};function emitEvent(_0x5115b8){return function(_0x3bcdc,_0x4b1bc2,_0xf3a6ce){CmListEvents[_0xc0d1('0x6')](_0x5115b8+':'+_0x3bcdc['id'],_0x3bcdc);CmListEvents[_0xc0d1('0x6')](_0x5115b8,_0x3bcdc);_0xf3a6ce(null);};}for(var e in events){if(events[_0xc0d1('0x7')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module[_0xc0d1('0x8')]=CmListEvents; \ No newline at end of file +var _0x1e58=['save','update','emit','hasOwnProperty','hook','exports','events','CmList','setMaxListeners'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x1e58,0x1d1));var _0x81e5=function(_0x39a757,_0x5803e7){_0x39a757=_0x39a757-0x0;var _0x4f8d71=_0x1e58[_0x39a757];return _0x4f8d71;};'use strict';var EventEmitter=require(_0x81e5('0x0'));var CmList=require('../../mysqldb')['db'][_0x81e5('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x81e5('0x2')](0x0);var events={'afterCreate':_0x81e5('0x3'),'afterUpdate':_0x81e5('0x4'),'afterDestroy':'remove'};function emitEvent(_0x170412){return function(_0x2715df,_0x2b3938,_0x405a96){CmListEvents['emit'](_0x170412+':'+_0x2715df['id'],_0x2715df);CmListEvents[_0x81e5('0x5')](_0x170412,_0x2715df);_0x405a96(null);};}for(var e in events){if(events[_0x81e5('0x6')](e)){var event=events[e];CmList[_0x81e5('0x7')](e,emitEvent(event));}}module[_0x81e5('0x8')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index ff070af..76537bc 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 _0xfa68=['define','CmList','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./cmList.attributes','exports'];(function(_0x3c08df,_0x3f12da){var _0x52c04f=function(_0x3ab4a0){while(--_0x3ab4a0){_0x3c08df['push'](_0x3c08df['shift']());}};_0x52c04f(++_0x3f12da);}(_0xfa68,0x86));var _0x8fa6=function(_0xee4725,_0x1c71ce){_0xee4725=_0xee4725-0x0;var _0x48a3c4=_0xfa68[_0xee4725];return _0x48a3c4;};'use strict';var _=require(_0x8fa6('0x0'));var util=require(_0x8fa6('0x1'));var logger=require(_0x8fa6('0x2'))('api');var moment=require(_0x8fa6('0x3'));var BPromise=require(_0x8fa6('0x4'));var rp=require(_0x8fa6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8fa6('0x6'));var config=require(_0x8fa6('0x7'));var attributes=require(_0x8fa6('0x8'));module[_0x8fa6('0x9')]=function(_0x3d75c1,_0x4f68b4){return _0x3d75c1[_0x8fa6('0xa')](_0x8fa6('0xb'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa2ab=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','define','cm_lists','lodash'];(function(_0x2b3d9f,_0x81b5e7){var _0xfd535c=function(_0x4d55ac){while(--_0x4d55ac){_0x2b3d9f['push'](_0x2b3d9f['shift']());}};_0xfd535c(++_0x81b5e7);}(_0xa2ab,0xa7));var _0xba2a=function(_0x5731ec,_0x47096b){_0x5731ec=_0x5731ec-0x0;var _0x3e43cf=_0xa2ab[_0x5731ec];return _0x3e43cf;};'use strict';var _=require(_0xba2a('0x0'));var util=require(_0xba2a('0x1'));var logger=require(_0xba2a('0x2'))('api');var moment=require(_0xba2a('0x3'));var BPromise=require(_0xba2a('0x4'));var rp=require(_0xba2a('0x5'));var fs=require('fs');var path=require(_0xba2a('0x6'));var rimraf=require(_0xba2a('0x7'));var config=require(_0xba2a('0x8'));var attributes=require(_0xba2a('0x9'));module['exports']=function(_0x12f994,_0x42e864){return _0x12f994[_0xba2a('0xa')]('CmList',attributes,{'tableName':_0xba2a('0xb'),'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 73e7790..957f3cc 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 _0x358f=['rpc','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','debug','CmList,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2c7a7d,_0x13d8c3){var _0x50668a=function(_0x4c951b){while(--_0x4c951b){_0x2c7a7d['push'](_0x2c7a7d['shift']());}};_0x50668a(++_0x13d8c3);}(_0x358f,0x137));var _0xf358=function(_0x3d4793,_0x37a97f){_0x3d4793=_0x3d4793-0x0;var _0x4a88cb=_0x358f[_0x3d4793];return _0x4a88cb;};'use strict';var _=require(_0xf358('0x0'));var util=require(_0xf358('0x1'));var moment=require(_0xf358('0x2'));var BPromise=require(_0xf358('0x3'));var rs=require(_0xf358('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf358('0x5'))['db'];var utils=require(_0xf358('0x6'));var logger=require(_0xf358('0x7'))(_0xf358('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xf358('0x9')]({'port':0x232a});config[_0xf358('0xa')]=_[_0xf358('0xb')](config[_0xf358('0xa')],{'host':_0xf358('0xc'),'port':0x18eb});var socket=require(_0xf358('0xd'))(new Redis(config[_0xf358('0xa')]));require(_0xf358('0xe'))[_0xf358('0xf')](socket);function respondWithRpcPromise(_0x16f534,_0x3ea43e,_0xa27cc9){return new BPromise(function(_0x202751,_0x1db9fa){return client[_0xf358('0x10')](_0x16f534,_0xa27cc9)[_0xf358('0x11')](function(_0x3c1278){logger[_0xf358('0x12')](_0xf358('0x13'),_0x3ea43e,'request\x20sent');logger[_0xf358('0x14')](_0xf358('0x15'),_0x3ea43e,_0xf358('0x16'),JSON[_0xf358('0x17')](_0x3c1278));if(_0x3c1278[_0xf358('0x18')]){if(_0x3c1278['error'][_0xf358('0x19')]===0x1f4){logger[_0xf358('0x18')](_0xf358('0x13'),_0x3ea43e,_0x3c1278[_0xf358('0x18')][_0xf358('0x1a')]);return _0x1db9fa(_0x3c1278[_0xf358('0x18')]['message']);}logger[_0xf358('0x18')](_0xf358('0x13'),_0x3ea43e,_0x3c1278[_0xf358('0x18')][_0xf358('0x1a')]);return _0x202751(_0x3c1278[_0xf358('0x18')]['message']);}else{logger[_0xf358('0x12')](_0xf358('0x13'),_0x3ea43e,_0xf358('0x16'));_0x202751(_0x3c1278[_0xf358('0x1b')][_0xf358('0x1a')]);}})[_0xf358('0x1c')](function(_0x560fca){logger[_0xf358('0x18')]('CmList,\x20%s,\x20%s',_0x3ea43e,_0x560fca);_0x1db9fa(_0x560fca);});});} \ No newline at end of file +var _0x5902=['redis','localhost','socket.io-emitter','./cmList.socket','register','request','info','request\x20sent','debug','error','code','CmList,\x20%s,\x20%s','message','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x54929d,_0x11667e){var _0x2ebf26=function(_0x5cc410){while(--_0x5cc410){_0x54929d['push'](_0x54929d['shift']());}};_0x2ebf26(++_0x11667e);}(_0x5902,0x18a));var _0x2590=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x5902[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require(_0x2590('0x0'));var moment=require(_0x2590('0x1'));var BPromise=require(_0x2590('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2590('0x3'));var db=require(_0x2590('0x4'))['db'];var utils=require(_0x2590('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x2590('0x6')]=_['defaults'](config['redis'],{'host':_0x2590('0x7'),'port':0x18eb});var socket=require(_0x2590('0x8'))(new Redis(config[_0x2590('0x6')]));require(_0x2590('0x9'))[_0x2590('0xa')](socket);function respondWithRpcPromise(_0x5c3440,_0x210c23,_0x5f1ce2){return new BPromise(function(_0x52d5b7,_0x530792){return client[_0x2590('0xb')](_0x5c3440,_0x5f1ce2)['then'](function(_0x384d69){logger[_0x2590('0xc')]('CmList,\x20%s,\x20%s',_0x210c23,_0x2590('0xd'));logger[_0x2590('0xe')]('CmList,\x20%s,\x20%s,\x20%s',_0x210c23,_0x2590('0xd'),JSON['stringify'](_0x384d69));if(_0x384d69[_0x2590('0xf')]){if(_0x384d69[_0x2590('0xf')][_0x2590('0x10')]===0x1f4){logger[_0x2590('0xf')](_0x2590('0x11'),_0x210c23,_0x384d69['error'][_0x2590('0x12')]);return _0x530792(_0x384d69[_0x2590('0xf')]['message']);}logger[_0x2590('0xf')]('CmList,\x20%s,\x20%s',_0x210c23,_0x384d69[_0x2590('0xf')][_0x2590('0x12')]);return _0x52d5b7(_0x384d69[_0x2590('0xf')]['message']);}else{logger['info'](_0x2590('0x11'),_0x210c23,_0x2590('0xd'));_0x52d5b7(_0x384d69['result'][_0x2590('0x12')]);}})[_0x2590('0x13')](function(_0x292029){logger[_0x2590('0xf')]('CmList,\x20%s,\x20%s',_0x210c23,_0x292029);_0x530792(_0x292029);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index d72276c..40e62b1 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 _0x15cc=['emit','register','length','cmList:','./cmList.events','remove','update'];(function(_0x4bb581,_0x6f7037){var _0x316bf5=function(_0x1f6ed0){while(--_0x1f6ed0){_0x4bb581['push'](_0x4bb581['shift']());}};_0x316bf5(++_0x6f7037);}(_0x15cc,0x6d));var _0xc15c=function(_0x5144ea,_0x247fad){_0x5144ea=_0x5144ea-0x0;var _0x10701f=_0x15cc[_0x5144ea];return _0x10701f;};'use strict';var CmListEvents=require(_0xc15c('0x0'));var events=['save',_0xc15c('0x1'),_0xc15c('0x2')];function createListener(_0x342294,_0x3100c0){return function(_0xb1a93e){_0x3100c0[_0xc15c('0x3')](_0x342294,_0xb1a93e);};}function removeListener(_0x39f24e,_0xab58f6){return function(){CmListEvents['removeListener'](_0x39f24e,_0xab58f6);};}exports[_0xc15c('0x4')]=function(_0x16237d){for(var _0x3d9ce6=0x0,_0x592a00=events[_0xc15c('0x5')];_0x3d9ce6<_0x592a00;_0x3d9ce6++){var _0x5c55a0=events[_0x3d9ce6];var _0x24917c=createListener(_0xc15c('0x6')+_0x5c55a0,_0x16237d);CmListEvents['on'](_0x5c55a0,_0x24917c);}}; \ No newline at end of file +var _0x1fcb=['update','emit','removeListener','length','cmList:','./cmList.events','remove'];(function(_0x360516,_0x4417e9){var _0x39df49=function(_0x3d5bcb){while(--_0x3d5bcb){_0x360516['push'](_0x360516['shift']());}};_0x39df49(++_0x4417e9);}(_0x1fcb,0x14e));var _0xb1fc=function(_0x360e5c,_0x1c173c){_0x360e5c=_0x360e5c-0x0;var _0x3e942c=_0x1fcb[_0x360e5c];return _0x3e942c;};'use strict';var CmListEvents=require(_0xb1fc('0x0'));var events=['save',_0xb1fc('0x1'),_0xb1fc('0x2')];function createListener(_0x3c3765,_0x402a63){return function(_0x5ba649){_0x402a63[_0xb1fc('0x3')](_0x3c3765,_0x5ba649);};}function removeListener(_0x2a1122,_0x23c50d){return function(){CmListEvents[_0xb1fc('0x4')](_0x2a1122,_0x23c50d);};}exports['register']=function(_0x15b354){for(var _0x112956=0x0,_0x2f433e=events[_0xb1fc('0x5')];_0x112956<_0x2f433e;_0x112956++){var _0x4ee89=events[_0x112956];var _0xc14141=createListener(_0xb1fc('0x6')+_0x4ee89,_0x15b354);CmListEvents['on'](_0x4ee89,_0xc14141);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 9214f93..8d1aac8 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 _0xc194=['post','addDisposition','addAgents','put','/:id','update','delete','destroy','removeAgents','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/fields','getCustomFields','/:id/users','create'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xc194,0x19f));var _0x4c19=function(_0x26a855,_0x5a0e06){_0x26a855=_0x26a855-0x0;var _0x47dfbe=_0xc194[_0x26a855];return _0x47dfbe;};'use strict';var multer=require(_0x4c19('0x0'));var util=require('util');var path=require(_0x4c19('0x1'));var timeout=require(_0x4c19('0x2'));var express=require(_0x4c19('0x3'));var router=express[_0x4c19('0x4')]();var auth=require(_0x4c19('0x5'));var interaction=require(_0x4c19('0x6'));var config=require(_0x4c19('0x7'));var controller=require('./cmList.controller');router[_0x4c19('0x8')]('/',auth[_0x4c19('0x9')](),controller[_0x4c19('0xa')]);router[_0x4c19('0x8')]('/describe',auth[_0x4c19('0x9')](),controller[_0x4c19('0xb')]);router[_0x4c19('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x4c19('0x8')](_0x4c19('0xc'),auth['isAuthenticated'](),controller[_0x4c19('0xd')]);router[_0x4c19('0x8')](_0x4c19('0xe'),auth[_0x4c19('0x9')](),controller[_0x4c19('0xf')]);router[_0x4c19('0x8')]('/:id/contacts/csv',auth[_0x4c19('0x9')](),controller['getContactsCsv']);router[_0x4c19('0x8')](_0x4c19('0x10'),auth[_0x4c19('0x9')](),controller[_0x4c19('0x11')]);router[_0x4c19('0x8')](_0x4c19('0x12'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x4c19('0x13')]);router[_0x4c19('0x14')](_0x4c19('0xc'),auth[_0x4c19('0x9')](),controller[_0x4c19('0x15')]);router[_0x4c19('0x14')](_0x4c19('0xe'),auth['isAuthenticated'](),controller['addContacts']);router[_0x4c19('0x14')](_0x4c19('0x10'),auth[_0x4c19('0x9')](),controller['addCustomField']);router['post'](_0x4c19('0x12'),auth['isAuthenticated'](),controller[_0x4c19('0x16')]);router[_0x4c19('0x17')](_0x4c19('0x18'),auth[_0x4c19('0x9')](),controller[_0x4c19('0x19')]);router[_0x4c19('0x1a')](_0x4c19('0x18'),auth[_0x4c19('0x9')](),controller[_0x4c19('0x1b')]);router['delete'](_0x4c19('0xc'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0x4c19('0x1a')]('/:id/users',auth[_0x4c19('0x9')](),controller[_0x4c19('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x90f0=['put','delete','/:id/dispositions','removeDispositions','removeAgents','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','index','get','isAuthenticated','describe','/:id','show','getDispositions','getContacts','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','create','post','addDisposition','/:id/contacts','addCustomField','addAgents'];(function(_0x30126c,_0x43a5a3){var _0x184d7f=function(_0x34f445){while(--_0x34f445){_0x30126c['push'](_0x30126c['shift']());}};_0x184d7f(++_0x43a5a3);}(_0x90f0,0x150));var _0x090f=function(_0x22185a,_0x2c9c0f){_0x22185a=_0x22185a-0x0;var _0x27e1f1=_0x90f0[_0x22185a];return _0x27e1f1;};'use strict';var multer=require('multer');var util=require(_0x090f('0x0'));var path=require(_0x090f('0x1'));var timeout=require(_0x090f('0x2'));var express=require('express');var router=express[_0x090f('0x3')]();var auth=require(_0x090f('0x4'));var interaction=require(_0x090f('0x5'));var config=require(_0x090f('0x6'));var controller=require(_0x090f('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x090f('0x8')]);router[_0x090f('0x9')]('/describe',auth[_0x090f('0xa')](),controller[_0x090f('0xb')]);router[_0x090f('0x9')](_0x090f('0xc'),auth[_0x090f('0xa')](),controller[_0x090f('0xd')]);router[_0x090f('0x9')]('/:id/dispositions',auth[_0x090f('0xa')](),controller[_0x090f('0xe')]);router[_0x090f('0x9')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x090f('0xf')]);router[_0x090f('0x9')]('/:id/contacts/csv',auth['isAuthenticated'](),controller[_0x090f('0x10')]);router[_0x090f('0x9')](_0x090f('0x11'),auth['isAuthenticated'](),controller[_0x090f('0x12')]);router[_0x090f('0x9')](_0x090f('0x13'),auth[_0x090f('0xa')](),controller[_0x090f('0x14')]);router['post']('/',auth[_0x090f('0xa')](),controller[_0x090f('0x15')]);router[_0x090f('0x16')]('/:id/dispositions',auth[_0x090f('0xa')](),controller[_0x090f('0x17')]);router['post'](_0x090f('0x18'),auth[_0x090f('0xa')](),controller['addContacts']);router[_0x090f('0x16')]('/:id/fields',auth[_0x090f('0xa')](),controller[_0x090f('0x19')]);router[_0x090f('0x16')](_0x090f('0x13'),auth[_0x090f('0xa')](),controller[_0x090f('0x1a')]);router[_0x090f('0x1b')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x090f('0xc'),auth[_0x090f('0xa')](),controller['destroy']);router[_0x090f('0x1c')](_0x090f('0x1d'),auth[_0x090f('0xa')](),controller[_0x090f('0x1e')]);router[_0x090f('0x1c')](_0x090f('0x13'),auth[_0x090f('0xa')](),controller[_0x090f('0x1f')]);module[_0x090f('0x20')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index da93f9e..f9f3976 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 _0xe6e2=['exports','VIRTUAL','getDataValue','field','STRING','sequelize'];(function(_0x546909,_0x5abcb){var _0xdd3fe2=function(_0x573652){while(--_0x573652){_0x546909['push'](_0x546909['shift']());}};_0xdd3fe2(++_0x5abcb);}(_0xe6e2,0x137));var _0x2e6e=function(_0x543e6b,_0x218c9a){_0x543e6b=_0x543e6b-0x0;var _0xffb501=_0xe6e2[_0x543e6b];return _0xffb501;};'use strict';var Sequelize=require(_0x2e6e('0x0'));module[_0x2e6e('0x1')]={'name':{'type':Sequelize[_0x2e6e('0x2')],'get':function(_0x1364e3){return this[_0x2e6e('0x3')](_0x2e6e('0x4'));}},'field':{'type':Sequelize[_0x2e6e('0x5')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x1660=['VIRTUAL','getDataValue','STRING'];(function(_0x10f68e,_0xf198ea){var _0x4c8372=function(_0x38517){while(--_0x38517){_0x10f68e['push'](_0x10f68e['shift']());}};_0x4c8372(++_0xf198ea);}(_0x1660,0x17a));var _0x0166=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x1660[_0x36ed48];return _0x51c63a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0166('0x0')],'get':function(_0x12b13d){return this[_0x0166('0x1')]('field');}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x0166('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x0166('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 3907329..36896fd 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 _0x8e57=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','reject','save','destroy','then','stack','name','send','body','Condition','find','catch','html-pdf','eml-format','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis'];(function(_0x51069d,_0x51ce9d){var _0x3d9440=function(_0x14f0e5){while(--_0x14f0e5){_0x51069d['push'](_0x51069d['shift']());}};_0x3d9440(++_0x51ce9d);}(_0x8e57,0x6b));var _0x78e5=function(_0x4f98c1,_0x576007){_0x4f98c1=_0x4f98c1-0x0;var _0xa06ced=_0x8e57[_0x4f98c1];return _0xa06ced;};'use strict';var pdf=require(_0x78e5('0x0'));var emlformat=require(_0x78e5('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x78e5('0x2'));var jsonpatch=require(_0x78e5('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x78e5('0x4'));var util=require(_0x78e5('0x5'));var path=require(_0x78e5('0x6'));var sox=require(_0x78e5('0x7'));var csv=require(_0x78e5('0x8'));var ejs=require(_0x78e5('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x78e5('0xa'));var crypto=require(_0x78e5('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x78e5('0xc'));var toCsv=require('to-csv');var querystring=require(_0x78e5('0xd'));var Papa=require(_0x78e5('0xe'));var Redis=require(_0x78e5('0xf'));var authService=require(_0x78e5('0x10'));var qs=require(_0x78e5('0x11'));var hardwareService=require(_0x78e5('0x12'));var logger=require(_0x78e5('0x13'))('api');var utils=require(_0x78e5('0x14'));var config=require(_0x78e5('0x15'));var db=require(_0x78e5('0x16'))['db'];function respondWithStatusCode(_0x58e4e4,_0x1355bd){_0x1355bd=_0x1355bd||0xcc;return function(_0x1b7dd1){if(_0x1b7dd1){return _0x58e4e4[_0x78e5('0x17')](_0x1355bd);}return _0x58e4e4[_0x78e5('0x18')](_0x1355bd)['end']();};}function respondWithResult(_0x97fba2,_0x4ddeb7){_0x4ddeb7=_0x4ddeb7||0xc8;return function(_0x552db6){if(_0x552db6){return _0x97fba2[_0x78e5('0x18')](_0x4ddeb7)[_0x78e5('0x19')](_0x552db6);}};}function respondWithFilteredResult(_0x4afb49,_0x51499e){return function(_0x1dddf6){if(_0x1dddf6){var _0x448bc8=_0x1dddf6[_0x78e5('0x1a')],_0x4159cd=_0x51499e['offset'],_0x296997=_0x51499e[_0x78e5('0x1b')]+_0x51499e['limit'],_0x4e6453;if(_0x296997>=_0x448bc8){_0x296997=_0x448bc8;_0x4e6453=0xc8;}else{_0x4e6453=0xce;}_0x4afb49['status'](_0x4e6453);return _0x4afb49[_0x78e5('0x1c')](_0x78e5('0x1d'),_0x4159cd+'-'+_0x296997+'/'+_0x448bc8)[_0x78e5('0x19')](_0x1dddf6);}return null;};}function patchUpdates(_0x52e940){return function(_0x31327e){try{jsonpatch['apply'](_0x31327e,_0x52e940,!![]);}catch(_0x2be8bf){return BPromise[_0x78e5('0x1e')](_0x2be8bf);}return _0x31327e[_0x78e5('0x1f')]();};}function saveUpdates(_0x18a722,_0x222eb4){return function(_0x165516){if(_0x165516){return _0x165516['update'](_0x18a722)['then'](function(_0x34ecbb){return _0x34ecbb;});}return null;};}function removeEntity(_0x380c8c,_0x452db0){return function(_0x5f1e86){if(_0x5f1e86){return _0x5f1e86[_0x78e5('0x20')]()[_0x78e5('0x21')](function(){_0x380c8c[_0x78e5('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40a68f,_0x280bf5){return function(_0x5025e7){if(!_0x5025e7){_0x40a68f[_0x78e5('0x17')](0x194);}return _0x5025e7;};}function handleError(_0x41c123,_0x331b90){_0x331b90=_0x331b90||0x1f4;return function(_0x3986ce){logger['error'](_0x3986ce[_0x78e5('0x22')]);if(_0x3986ce['name']){delete _0x3986ce[_0x78e5('0x23')];}_0x41c123['status'](_0x331b90)[_0x78e5('0x24')](_0x3986ce);};}exports['update']=function(_0x48d7c4,_0x40f6fb){if(_0x48d7c4[_0x78e5('0x25')]['id']){delete _0x48d7c4[_0x78e5('0x25')]['id'];}return db[_0x78e5('0x26')][_0x78e5('0x27')]({'where':{'id':_0x48d7c4['params']['id']}})['then'](handleEntityNotFound(_0x40f6fb,null))['then'](saveUpdates(_0x48d7c4[_0x78e5('0x25')],null))[_0x78e5('0x21')](respondWithResult(_0x40f6fb,null))[_0x78e5('0x28')](handleError(_0x40f6fb,null));};exports[_0x78e5('0x20')]=function(_0x326bf7,_0x2d44dc){return db['Condition'][_0x78e5('0x27')]({'where':{'id':_0x326bf7['params']['id']}})[_0x78e5('0x21')](handleEntityNotFound(_0x2d44dc,null))[_0x78e5('0x21')](removeEntity(_0x2d44dc,null))['catch'](handleError(_0x2d44dc,null));}; \ No newline at end of file +var _0xf067=['desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','update','then','error','stack','name','send','body','Condition','find','params','catch','destroy','html-pdf','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce'];(function(_0x2a9663,_0x106ed7){var _0x42bbda=function(_0x24190b){while(--_0x24190b){_0x2a9663['push'](_0x2a9663['shift']());}};_0x42bbda(++_0x106ed7);}(_0xf067,0x1a1));var _0x7f06=function(_0x3c7e5d,_0x7c40a3){_0x3c7e5d=_0x3c7e5d-0x0;var _0x5668b8=_0xf067[_0x3c7e5d];return _0x5668b8;};'use strict';var pdf=require(_0x7f06('0x0'));var emlformat=require(_0x7f06('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7f06('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7f06('0x3'));var moment=require('moment');var BPromise=require(_0x7f06('0x4'));var Mustache=require(_0x7f06('0x5'));var util=require(_0x7f06('0x6'));var path=require(_0x7f06('0x7'));var sox=require(_0x7f06('0x8'));var csv=require('to-csv');var ejs=require(_0x7f06('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7f06('0xa'));var crypto=require(_0x7f06('0xb'));var jsforce=require(_0x7f06('0xc'));var deskjs=require(_0x7f06('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7f06('0xe'));var Papa=require(_0x7f06('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x7f06('0x10'));var logger=require(_0x7f06('0x11'))(_0x7f06('0x12'));var utils=require(_0x7f06('0x13'));var config=require('../../config/environment');var db=require(_0x7f06('0x14'))['db'];function respondWithStatusCode(_0xd77f05,_0x237a42){_0x237a42=_0x237a42||0xcc;return function(_0x5b85b2){if(_0x5b85b2){return _0xd77f05[_0x7f06('0x15')](_0x237a42);}return _0xd77f05[_0x7f06('0x16')](_0x237a42)[_0x7f06('0x17')]();};}function respondWithResult(_0x3ccd4b,_0x5a3bdc){_0x5a3bdc=_0x5a3bdc||0xc8;return function(_0x5d2963){if(_0x5d2963){return _0x3ccd4b[_0x7f06('0x16')](_0x5a3bdc)[_0x7f06('0x18')](_0x5d2963);}};}function respondWithFilteredResult(_0x3c6bc6,_0x3cf641){return function(_0x5a7612){if(_0x5a7612){var _0x4b7e82=_0x5a7612[_0x7f06('0x19')],_0x4b13a1=_0x3cf641['offset'],_0x2c8f88=_0x3cf641[_0x7f06('0x1a')]+_0x3cf641[_0x7f06('0x1b')],_0x45fc09;if(_0x2c8f88>=_0x4b7e82){_0x2c8f88=_0x4b7e82;_0x45fc09=0xc8;}else{_0x45fc09=0xce;}_0x3c6bc6['status'](_0x45fc09);return _0x3c6bc6[_0x7f06('0x1c')]('Content-Range',_0x4b13a1+'-'+_0x2c8f88+'/'+_0x4b7e82)['json'](_0x5a7612);}return null;};}function patchUpdates(_0x5abb47){return function(_0x4efed3){try{jsonpatch[_0x7f06('0x1d')](_0x4efed3,_0x5abb47,!![]);}catch(_0x39c14f){return BPromise[_0x7f06('0x1e')](_0x39c14f);}return _0x4efed3['save']();};}function saveUpdates(_0x5f39c4,_0x4611b8){return function(_0x2c4a98){if(_0x2c4a98){return _0x2c4a98[_0x7f06('0x1f')](_0x5f39c4)['then'](function(_0x3868ed){return _0x3868ed;});}return null;};}function removeEntity(_0x38d60d,_0x1111c0){return function(_0x40638c){if(_0x40638c){return _0x40638c['destroy']()[_0x7f06('0x20')](function(){_0x38d60d[_0x7f06('0x16')](0xcc)[_0x7f06('0x17')]();});}};}function handleEntityNotFound(_0x40e2cd,_0x2af37d){return function(_0x34bcfb){if(!_0x34bcfb){_0x40e2cd['sendStatus'](0x194);}return _0x34bcfb;};}function handleError(_0x27f4f3,_0x17addf){_0x17addf=_0x17addf||0x1f4;return function(_0x2bffc5){logger[_0x7f06('0x21')](_0x2bffc5[_0x7f06('0x22')]);if(_0x2bffc5[_0x7f06('0x23')]){delete _0x2bffc5[_0x7f06('0x23')];}_0x27f4f3[_0x7f06('0x16')](_0x17addf)[_0x7f06('0x24')](_0x2bffc5);};}exports['update']=function(_0x343941,_0x5a871e){if(_0x343941[_0x7f06('0x25')]['id']){delete _0x343941[_0x7f06('0x25')]['id'];}return db[_0x7f06('0x26')][_0x7f06('0x27')]({'where':{'id':_0x343941[_0x7f06('0x28')]['id']}})[_0x7f06('0x20')](handleEntityNotFound(_0x5a871e,null))[_0x7f06('0x20')](saveUpdates(_0x343941[_0x7f06('0x25')],null))[_0x7f06('0x20')](respondWithResult(_0x5a871e,null))[_0x7f06('0x29')](handleError(_0x5a871e,null));};exports[_0x7f06('0x2a')]=function(_0xbd8bc,_0x1abfe1){return db[_0x7f06('0x26')][_0x7f06('0x27')]({'where':{'id':_0xbd8bc['params']['id']}})[_0x7f06('0x20')](handleEntityNotFound(_0x1abfe1,null))[_0x7f06('0x20')](removeEntity(_0x1abfe1,null))[_0x7f06('0x29')](handleError(_0x1abfe1,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 964e986..7a2a553 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 _0x7d26=['api','bluebird','path','rimraf','../../config/environment','./condition.attributes','define','lodash','util','../../config/logger'];(function(_0x5be313,_0x1d00e){var _0x49b596=function(_0x19d6df){while(--_0x19d6df){_0x5be313['push'](_0x5be313['shift']());}};_0x49b596(++_0x1d00e);}(_0x7d26,0x133));var _0x67d2=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x7d26[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x67d2('0x0'));var util=require(_0x67d2('0x1'));var logger=require(_0x67d2('0x2'))(_0x67d2('0x3'));var moment=require('moment');var BPromise=require(_0x67d2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x67d2('0x5'));var rimraf=require(_0x67d2('0x6'));var config=require(_0x67d2('0x7'));var attributes=require(_0x67d2('0x8'));module['exports']=function(_0x582d46,_0x25a53a){return _0x582d46[_0x67d2('0x9')]('Condition',attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x238d=['tools_conditions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./condition.attributes','exports','define','Condition'];(function(_0x4e5eed,_0x413b23){var _0x3391d4=function(_0x77211a){while(--_0x77211a){_0x4e5eed['push'](_0x4e5eed['shift']());}};_0x3391d4(++_0x413b23);}(_0x238d,0x151));var _0xd238=function(_0x3ae336,_0x1c1c21){_0x3ae336=_0x3ae336-0x0;var _0x5532d2=_0x238d[_0x3ae336];return _0x5532d2;};'use strict';var _=require(_0xd238('0x0'));var util=require(_0xd238('0x1'));var logger=require(_0xd238('0x2'))(_0xd238('0x3'));var moment=require(_0xd238('0x4'));var BPromise=require(_0xd238('0x5'));var rp=require(_0xd238('0x6'));var fs=require('fs');var path=require(_0xd238('0x7'));var rimraf=require(_0xd238('0x8'));var config=require('../../config/environment');var attributes=require(_0xd238('0x9'));module[_0xd238('0xa')]=function(_0x479ba1,_0x373da6){return _0x479ba1[_0xd238('0xb')](_0xd238('0xc'),attributes,{'tableName':_0xd238('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 12fd3c0..d1ce7a7 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 _0xae23=['info','request\x20sent','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','stringify','error','code','Condition,\x20%s,\x20%s','message'];(function(_0x4401df,_0x426dd8){var _0x3cbd3c=function(_0x45a4f1){while(--_0x45a4f1){_0x4401df['push'](_0x4401df['shift']());}};_0x3cbd3c(++_0x426dd8);}(_0xae23,0x164));var _0x3ae2=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xae23[_0x47e7cb];return _0x2a8874;};'use strict';var _=require(_0x3ae2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3ae2('0x1'));var rs=require(_0x3ae2('0x2'));var fs=require('fs');var Redis=require(_0x3ae2('0x3'));var db=require(_0x3ae2('0x4'))['db'];var utils=require(_0x3ae2('0x5'));var logger=require('../../config/logger')(_0x3ae2('0x6'));var config=require(_0x3ae2('0x7'));var jayson=require(_0x3ae2('0x8'));var client=jayson[_0x3ae2('0x9')][_0x3ae2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3804ff,_0x3f6674,_0x519321){return new BPromise(function(_0xc29918,_0x51235f){return client[_0x3ae2('0xb')](_0x3804ff,_0x519321)[_0x3ae2('0xc')](function(_0x345fda){logger['info']('Condition,\x20%s,\x20%s',_0x3f6674,'request\x20sent');logger['debug']('Condition,\x20%s,\x20%s,\x20%s',_0x3f6674,'request\x20sent',JSON[_0x3ae2('0xd')](_0x345fda));if(_0x345fda[_0x3ae2('0xe')]){if(_0x345fda[_0x3ae2('0xe')][_0x3ae2('0xf')]===0x1f4){logger[_0x3ae2('0xe')](_0x3ae2('0x10'),_0x3f6674,_0x345fda['error'][_0x3ae2('0x11')]);return _0x51235f(_0x345fda[_0x3ae2('0xe')][_0x3ae2('0x11')]);}logger[_0x3ae2('0xe')](_0x3ae2('0x10'),_0x3f6674,_0x345fda[_0x3ae2('0xe')][_0x3ae2('0x11')]);return _0xc29918(_0x345fda[_0x3ae2('0xe')][_0x3ae2('0x11')]);}else{logger[_0x3ae2('0x12')]('Condition,\x20%s,\x20%s',_0x3f6674,_0x3ae2('0x13'));_0xc29918(_0x345fda[_0x3ae2('0x14')][_0x3ae2('0x11')]);}})[_0x3ae2('0x15')](function(_0x5a9f7c){logger[_0x3ae2('0xe')]('Condition,\x20%s,\x20%s',_0x3f6674,_0x5a9f7c);_0x51235f(_0x5a9f7c);});});} \ No newline at end of file +var _0x6ff1=['Condition,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6ff1,0x1aa));var _0x16ff=function(_0x4edb6a,_0x1a5486){_0x4edb6a=_0x4edb6a-0x0;var _0x8e5b94=_0x6ff1[_0x4edb6a];return _0x8e5b94;};'use strict';var _=require('lodash');var util=require(_0x16ff('0x0'));var moment=require('moment');var BPromise=require(_0x16ff('0x1'));var rs=require(_0x16ff('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x16ff('0x3'))['db'];var utils=require(_0x16ff('0x4'));var logger=require(_0x16ff('0x5'))(_0x16ff('0x6'));var config=require(_0x16ff('0x7'));var jayson=require(_0x16ff('0x8'));var client=jayson[_0x16ff('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ca6ae,_0x3711c8,_0x1bbe7b){return new BPromise(function(_0x32d1c9,_0x497b47){return client['request'](_0x4ca6ae,_0x1bbe7b)[_0x16ff('0xa')](function(_0x5e410e){logger[_0x16ff('0xb')](_0x16ff('0xc'),_0x3711c8,_0x16ff('0xd'));logger[_0x16ff('0xe')](_0x16ff('0xf'),_0x3711c8,_0x16ff('0xd'),JSON['stringify'](_0x5e410e));if(_0x5e410e['error']){if(_0x5e410e[_0x16ff('0x10')][_0x16ff('0x11')]===0x1f4){logger[_0x16ff('0x10')](_0x16ff('0xc'),_0x3711c8,_0x5e410e[_0x16ff('0x10')][_0x16ff('0x12')]);return _0x497b47(_0x5e410e[_0x16ff('0x10')][_0x16ff('0x12')]);}logger[_0x16ff('0x10')](_0x16ff('0xc'),_0x3711c8,_0x5e410e[_0x16ff('0x10')][_0x16ff('0x12')]);return _0x32d1c9(_0x5e410e['error'][_0x16ff('0x12')]);}else{logger[_0x16ff('0xb')](_0x16ff('0xc'),_0x3711c8,_0x16ff('0xd'));_0x32d1c9(_0x5e410e[_0x16ff('0x13')][_0x16ff('0x12')]);}})[_0x16ff('0x14')](function(_0x5e7ee1){logger[_0x16ff('0x10')](_0x16ff('0xc'),_0x3711c8,_0x5e7ee1);_0x497b47(_0x5e7ee1);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 395cfa7..af991a1 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 _0xf244=['express','Router','../../components/auth/service','../../config/environment','put','/:id','isAuthenticated','update','destroy','exports','multer','path'];(function(_0x5465ed,_0x2b80c4){var _0x151d27=function(_0x2a254f){while(--_0x2a254f){_0x5465ed['push'](_0x5465ed['shift']());}};_0x151d27(++_0x2b80c4);}(_0xf244,0xbe));var _0x4f24=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xf244[_0xbd08b4];return _0x314f1e;};'use strict';var multer=require(_0x4f24('0x0'));var util=require('util');var path=require(_0x4f24('0x1'));var timeout=require('connect-timeout');var express=require(_0x4f24('0x2'));var router=express[_0x4f24('0x3')]();var auth=require(_0x4f24('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4f24('0x5'));var controller=require('./condition.controller');router[_0x4f24('0x6')](_0x4f24('0x7'),auth[_0x4f24('0x8')](),controller[_0x4f24('0x9')]);router['delete'](_0x4f24('0x7'),auth['isAuthenticated'](),controller[_0x4f24('0xa')]);module[_0x4f24('0xb')]=router; \ No newline at end of file +var _0xd10c=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','destroy','exports','util'];(function(_0x1011ea,_0x1dc935){var _0x5079d2=function(_0x260991){while(--_0x260991){_0x1011ea['push'](_0x1011ea['shift']());}};_0x5079d2(++_0x1dc935);}(_0xd10c,0x9f));var _0xcd10=function(_0x4384c9,_0x27da9c){_0x4384c9=_0x4384c9-0x0;var _0x3b6280=_0xd10c[_0x4384c9];return _0x3b6280;};'use strict';var multer=require('multer');var util=require(_0xcd10('0x0'));var path=require(_0xcd10('0x1'));var timeout=require(_0xcd10('0x2'));var express=require(_0xcd10('0x3'));var router=express[_0xcd10('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xcd10('0x5'));var config=require(_0xcd10('0x6'));var controller=require('./condition.controller');router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xcd10('0x7')](),controller[_0xcd10('0x8')]);module[_0xcd10('0x9')]=router; \ No newline at end of file diff --git a/server/api/crmActionsList/crmActionsList.attributes.js b/server/api/crmActionsList/crmActionsList.attributes.js index c5f7255..33800f3 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 _0x002c=['STRING','name','TEXT','\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci','INTEGER','sequelize','exports'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x002c,0x1a2));var _0xc002=function(_0x35f364,_0x11e270){_0x35f364=_0x35f364-0x0;var _0x216ca8=_0x002c[_0x35f364];return _0x216ca8;};'use strict';var Sequelize=require(_0xc002('0x0'));module[_0xc002('0x1')]={'name':{'type':Sequelize[_0xc002('0x2')],'allowNull':![],'unique':_0xc002('0x3')},'note':{'type':Sequelize[_0xc002('0x4')]('long')+_0xc002('0x5')},'ordersequence':{'type':Sequelize[_0xc002('0x6')],'allowNull':!![]},'action':{'type':Sequelize[_0xc002('0x2')]},'parameters':{'type':Sequelize[_0xc002('0x2')]}}; \ No newline at end of file +var _0xc792=['INTEGER','STRING','name','TEXT','long'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xc792,0xce));var _0x2c79=function(_0x13143f,_0x4b831c){_0x13143f=_0x13143f-0x0;var _0x410b40=_0xc792[_0x13143f];return _0x410b40;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x2c79('0x0')],'allowNull':![],'unique':_0x2c79('0x1')},'note':{'type':Sequelize[_0x2c79('0x2')](_0x2c79('0x3'))+'\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci'},'ordersequence':{'type':Sequelize[_0x2c79('0x4')],'allowNull':!![]},'action':{'type':Sequelize['STRING']},'parameters':{'type':Sequelize[_0x2c79('0x0')]}}; \ No newline at end of file diff --git a/server/api/crmActionsList/crmActionsList.controller.js b/server/api/crmActionsList/crmActionsList.controller.js index 069ff6e..56fff24 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 _0x54ef=['../../config/environment','../../mysqldb','status','end','json','offset','limit','set','Content-Range','apply','update','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','merge','map','type','key','field','filter','options','CrmActionsList','count','includeAll','include','findAll','rows','catch','show','create','body','params','find','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils'];(function(_0x5e33f6,_0x2e18e6){var _0x20cb0f=function(_0x358e5c){while(--_0x358e5c){_0x5e33f6['push'](_0x5e33f6['shift']());}};_0x20cb0f(++_0x2e18e6);}(_0x54ef,0x112));var _0xf54e=function(_0x4ba6a9,_0x34122e){_0x4ba6a9=_0x4ba6a9-0x0;var _0x4a3997=_0x54ef[_0x4ba6a9];return _0x4a3997;};'use strict';var pdf=require(_0xf54e('0x0'));var emlformat=require(_0xf54e('0x1'));var rimraf=require(_0xf54e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf54e('0x3'));var rp=require(_0xf54e('0x4'));var moment=require(_0xf54e('0x5'));var BPromise=require(_0xf54e('0x6'));var Mustache=require(_0xf54e('0x7'));var util=require(_0xf54e('0x8'));var path=require(_0xf54e('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf54e('0xa'));var fs=require('fs');var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var hardwareService=require(_0xf54e('0x13'));var logger=require('../../config/logger')(_0xf54e('0x14'));var utils=require(_0xf54e('0x15'));var config=require(_0xf54e('0x16'));var db=require(_0xf54e('0x17'))['db'];function respondWithStatusCode(_0x553759,_0x358c88){_0x358c88=_0x358c88||0xcc;return function(_0x4b0ee1){if(_0x4b0ee1){return _0x553759['sendStatus'](_0x358c88);}return _0x553759[_0xf54e('0x18')](_0x358c88)[_0xf54e('0x19')]();};}function respondWithResult(_0x28f776,_0x380f26){_0x380f26=_0x380f26||0xc8;return function(_0x5644aa){if(_0x5644aa){return _0x28f776[_0xf54e('0x18')](_0x380f26)[_0xf54e('0x1a')](_0x5644aa);}};}function respondWithFilteredResult(_0x1855fe,_0x15f639){return function(_0x56828e){if(_0x56828e){var _0x2366ee=_0x56828e['count'],_0x389abc=_0x15f639[_0xf54e('0x1b')],_0x3eb415=_0x15f639[_0xf54e('0x1b')]+_0x15f639[_0xf54e('0x1c')],_0x5c5d00;if(_0x3eb415>=_0x2366ee){_0x3eb415=_0x2366ee;_0x5c5d00=0xc8;}else{_0x5c5d00=0xce;}_0x1855fe[_0xf54e('0x18')](_0x5c5d00);return _0x1855fe[_0xf54e('0x1d')](_0xf54e('0x1e'),_0x389abc+'-'+_0x3eb415+'/'+_0x2366ee)[_0xf54e('0x1a')](_0x56828e);}return null;};}function patchUpdates(_0x1ef06e){return function(_0x1dcc04){try{jsonpatch[_0xf54e('0x1f')](_0x1dcc04,_0x1ef06e,!![]);}catch(_0x226c96){return BPromise['reject'](_0x226c96);}return _0x1dcc04['save']();};}function saveUpdates(_0x23e14,_0x59f338){return function(_0x3e1556){if(_0x3e1556){return _0x3e1556[_0xf54e('0x20')](_0x23e14)[_0xf54e('0x21')](function(_0x9903fc){return _0x9903fc;});}return null;};}function removeEntity(_0xf64f12,_0x3887b0){return function(_0x388aa0){if(_0x388aa0){return _0x388aa0[_0xf54e('0x22')]()[_0xf54e('0x21')](function(){_0xf64f12[_0xf54e('0x18')](0xcc)[_0xf54e('0x19')]();});}};}function handleEntityNotFound(_0x5b83df,_0x6f6d29){return function(_0x54f914){if(!_0x54f914){_0x5b83df[_0xf54e('0x23')](0x194);}return _0x54f914;};}function handleError(_0x272df6,_0x335492){_0x335492=_0x335492||0x1f4;return function(_0x474b61){logger[_0xf54e('0x24')](_0x474b61[_0xf54e('0x25')]);if(_0x474b61[_0xf54e('0x26')]){delete _0x474b61[_0xf54e('0x26')];}_0x272df6[_0xf54e('0x18')](_0x335492)[_0xf54e('0x27')](_0x474b61);};}exports[_0xf54e('0x28')]=function(_0x39c0ae,_0x2ea001){var _0x5390b8={},_0xb3706e={},_0x4cbf7c={'count':0x0,'rows':[]};var _0x282c63=db['CrmActionsList'][_0xf54e('0x29')];_0xb3706e[_0xf54e('0x2a')]=_[_0xf54e('0x2b')](_0x282c63);_0xb3706e[_0xf54e('0x2c')]=_[_0xf54e('0x2b')](_0x39c0ae[_0xf54e('0x2c')]);_0xb3706e[_0xf54e('0x2d')]=_['intersection'](_0xb3706e['model'],_0xb3706e[_0xf54e('0x2c')]);_0x5390b8[_0xf54e('0x2e')]=_[_0xf54e('0x2f')](_0xb3706e[_0xf54e('0x2a')],qs[_0xf54e('0x30')](_0x39c0ae[_0xf54e('0x2c')][_0xf54e('0x30')]));_0x5390b8[_0xf54e('0x2e')]=_0x5390b8[_0xf54e('0x2e')][_0xf54e('0x31')]?_0x5390b8['attributes']:_0xb3706e['model'];if(!_0x39c0ae[_0xf54e('0x2c')][_0xf54e('0x32')]('nolimit')){_0x5390b8[_0xf54e('0x1c')]=qs[_0xf54e('0x1c')](_0x39c0ae[_0xf54e('0x2c')][_0xf54e('0x1c')]);_0x5390b8['offset']=qs['offset'](_0x39c0ae['query'][_0xf54e('0x1b')]);}_0x5390b8[_0xf54e('0x33')]=qs[_0xf54e('0x34')](_0x39c0ae[_0xf54e('0x2c')][_0xf54e('0x34')]);_0x5390b8[_0xf54e('0x35')]=qs['filters'](_['pick'](_0x39c0ae['query'],_0xb3706e[_0xf54e('0x2d')]));if(_0x39c0ae[_0xf54e('0x2c')]['filter']){_0x5390b8['where']=_[_0xf54e('0x36')](_0x5390b8[_0xf54e('0x35')],{'$or':_[_0xf54e('0x37')](_0x282c63,function(_0x4a347a){if(_0x4a347a[_0xf54e('0x38')][_0xf54e('0x39')]!=='VIRTUAL'){var _0x38d7a0={};_0x38d7a0[_0x4a347a[_0xf54e('0x3a')]]={'$like':'%'+_0x39c0ae[_0xf54e('0x2c')][_0xf54e('0x3b')]+'%'};return _0x38d7a0;}})});}_0x5390b8=_[_0xf54e('0x36')]({},_0x5390b8,_0x39c0ae[_0xf54e('0x3c')]);var _0x4e00b7={'where':_0x5390b8['where']};return db[_0xf54e('0x3d')][_0xf54e('0x3e')](_0x4e00b7)[_0xf54e('0x21')](function(_0x4b1f84){_0x4cbf7c[_0xf54e('0x3e')]=_0x4b1f84;if(_0x39c0ae[_0xf54e('0x2c')][_0xf54e('0x3f')]){_0x5390b8[_0xf54e('0x40')]=[{'all':!![]}];}return db[_0xf54e('0x3d')][_0xf54e('0x41')](_0x5390b8);})[_0xf54e('0x21')](function(_0x1345b0){_0x4cbf7c[_0xf54e('0x42')]=_0x1345b0;return _0x4cbf7c;})[_0xf54e('0x21')](respondWithFilteredResult(_0x2ea001,_0x5390b8))[_0xf54e('0x43')](handleError(_0x2ea001,null));};exports[_0xf54e('0x44')]=function(_0x3dfd4e,_0x2625fd){var _0x2043a8={'raw':![],'where':{'id':_0x3dfd4e['params']['id']}},_0x5085c1={};_0x5085c1['model']=_[_0xf54e('0x2b')](db[_0xf54e('0x3d')]['rawAttributes']);_0x5085c1[_0xf54e('0x2c')]=_[_0xf54e('0x2b')](_0x3dfd4e[_0xf54e('0x2c')]);_0x5085c1['filters']=_[_0xf54e('0x2f')](_0x5085c1[_0xf54e('0x2a')],_0x5085c1[_0xf54e('0x2c')]);_0x2043a8[_0xf54e('0x2e')]=_[_0xf54e('0x2f')](_0x5085c1[_0xf54e('0x2a')],qs[_0xf54e('0x30')](_0x3dfd4e[_0xf54e('0x2c')][_0xf54e('0x30')]));_0x2043a8['attributes']=_0x2043a8[_0xf54e('0x2e')][_0xf54e('0x31')]?_0x2043a8[_0xf54e('0x2e')]:_0x5085c1[_0xf54e('0x2a')];if(_0x3dfd4e[_0xf54e('0x2c')][_0xf54e('0x3f')]){_0x2043a8['include']=[{'all':!![]}];}_0x2043a8=_[_0xf54e('0x36')]({},_0x2043a8,_0x3dfd4e['options']);return db[_0xf54e('0x3d')]['find'](_0x2043a8)[_0xf54e('0x21')](handleEntityNotFound(_0x2625fd,null))[_0xf54e('0x21')](respondWithResult(_0x2625fd,null))[_0xf54e('0x43')](handleError(_0x2625fd,null));};exports['create']=function(_0x1af35d,_0x40b21c){return db[_0xf54e('0x3d')][_0xf54e('0x45')](_0x1af35d[_0xf54e('0x46')],{})['then'](respondWithResult(_0x40b21c,0xc9))[_0xf54e('0x43')](handleError(_0x40b21c,null));};exports[_0xf54e('0x20')]=function(_0x346bb4,_0x45592b){if(_0x346bb4['body']['id']){delete _0x346bb4[_0xf54e('0x46')]['id'];}return db[_0xf54e('0x3d')]['find']({'where':{'id':_0x346bb4[_0xf54e('0x47')]['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0x45592b,null))[_0xf54e('0x21')](saveUpdates(_0x346bb4[_0xf54e('0x46')],null))['then'](respondWithResult(_0x45592b,null))[_0xf54e('0x43')](handleError(_0x45592b,null));};exports[_0xf54e('0x22')]=function(_0x2527f6,_0xb4654f){return db[_0xf54e('0x3d')][_0xf54e('0x48')]({'where':{'id':_0x2527f6[_0xf54e('0x47')]['id']}})[_0xf54e('0x21')](handleEntityNotFound(_0xb4654f,null))[_0xf54e('0x21')](removeEntity(_0xb4654f,null))[_0xf54e('0x43')](handleError(_0xb4654f,null));};exports[_0xf54e('0x49')]=function(_0x1f4cf8,_0x2deb0c){return db[_0xf54e('0x3d')][_0xf54e('0x49')]()[_0xf54e('0x21')](respondWithResult(_0x2deb0c,null))[_0xf54e('0x43')](handleError(_0x2deb0c,null));}; \ No newline at end of file +var _0x4b84=['end','error','stack','name','send','rawAttributes','model','query','attributes','intersection','fields','length','nolimit','order','sort','filters','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','show','params','keys','CrmActionsList','find','create','body','describe','html-pdf','eml-format','fast-json-patch','bluebird','mustache','util','ejs','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','offset','limit','Content-Range','json','apply','reject','save','update','then','destroy'];(function(_0x28a78b,_0x40ed0c){var _0x21cdd5=function(_0x1db514){while(--_0x1db514){_0x28a78b['push'](_0x28a78b['shift']());}};_0x21cdd5(++_0x40ed0c);}(_0x4b84,0x1cc));var _0x44b8=function(_0x47df54,_0x1aeb61){_0x47df54=_0x47df54-0x0;var _0x261b87=_0x4b84[_0x47df54];return _0x261b87;};'use strict';var pdf=require(_0x44b8('0x0'));var emlformat=require(_0x44b8('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x44b8('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x44b8('0x3'));var Mustache=require(_0x44b8('0x4'));var util=require(_0x44b8('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x44b8('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0x44b8('0x7'));var crypto=require('crypto');var jsforce=require(_0x44b8('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x44b8('0x9'));var Papa=require(_0x44b8('0xa'));var Redis=require(_0x44b8('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x44b8('0xc'));var hardwareService=require(_0x44b8('0xd'));var logger=require(_0x44b8('0xe'))(_0x44b8('0xf'));var utils=require(_0x44b8('0x10'));var config=require(_0x44b8('0x11'));var db=require(_0x44b8('0x12'))['db'];function respondWithStatusCode(_0x4ae8a1,_0x147529){_0x147529=_0x147529||0xcc;return function(_0x4301a6){if(_0x4301a6){return _0x4ae8a1['sendStatus'](_0x147529);}return _0x4ae8a1[_0x44b8('0x13')](_0x147529)['end']();};}function respondWithResult(_0x833ea3,_0x18d642){_0x18d642=_0x18d642||0xc8;return function(_0x4df670){if(_0x4df670){return _0x833ea3[_0x44b8('0x13')](_0x18d642)['json'](_0x4df670);}};}function respondWithFilteredResult(_0x54fa95,_0x2a3e4c){return function(_0x2af0ad){if(_0x2af0ad){var _0x1722da=_0x2af0ad['count'],_0x41ab46=_0x2a3e4c[_0x44b8('0x14')],_0x5e52f2=_0x2a3e4c['offset']+_0x2a3e4c[_0x44b8('0x15')],_0x495c74;if(_0x5e52f2>=_0x1722da){_0x5e52f2=_0x1722da;_0x495c74=0xc8;}else{_0x495c74=0xce;}_0x54fa95[_0x44b8('0x13')](_0x495c74);return _0x54fa95['set'](_0x44b8('0x16'),_0x41ab46+'-'+_0x5e52f2+'/'+_0x1722da)[_0x44b8('0x17')](_0x2af0ad);}return null;};}function patchUpdates(_0x5103f5){return function(_0x89bc30){try{jsonpatch[_0x44b8('0x18')](_0x89bc30,_0x5103f5,!![]);}catch(_0x4b600f){return BPromise[_0x44b8('0x19')](_0x4b600f);}return _0x89bc30[_0x44b8('0x1a')]();};}function saveUpdates(_0xebfe79,_0x235bdc){return function(_0x102ef9){if(_0x102ef9){return _0x102ef9[_0x44b8('0x1b')](_0xebfe79)[_0x44b8('0x1c')](function(_0x9b0536){return _0x9b0536;});}return null;};}function removeEntity(_0x429461,_0x1e0f2d){return function(_0x1d642b){if(_0x1d642b){return _0x1d642b[_0x44b8('0x1d')]()['then'](function(){_0x429461[_0x44b8('0x13')](0xcc)[_0x44b8('0x1e')]();});}};}function handleEntityNotFound(_0x416b34,_0x1418db){return function(_0x305a5c){if(!_0x305a5c){_0x416b34['sendStatus'](0x194);}return _0x305a5c;};}function handleError(_0x402497,_0x54677c){_0x54677c=_0x54677c||0x1f4;return function(_0x41a922){logger[_0x44b8('0x1f')](_0x41a922[_0x44b8('0x20')]);if(_0x41a922[_0x44b8('0x21')]){delete _0x41a922[_0x44b8('0x21')];}_0x402497['status'](_0x54677c)[_0x44b8('0x22')](_0x41a922);};}exports['index']=function(_0x41d673,_0x350482){var _0x549a26={},_0x17ac44={},_0x470f49={'count':0x0,'rows':[]};var _0x2656d7=db['CrmActionsList'][_0x44b8('0x23')];_0x17ac44[_0x44b8('0x24')]=_['keys'](_0x2656d7);_0x17ac44[_0x44b8('0x25')]=_['keys'](_0x41d673[_0x44b8('0x25')]);_0x17ac44['filters']=_['intersection'](_0x17ac44['model'],_0x17ac44[_0x44b8('0x25')]);_0x549a26[_0x44b8('0x26')]=_[_0x44b8('0x27')](_0x17ac44[_0x44b8('0x24')],qs[_0x44b8('0x28')](_0x41d673[_0x44b8('0x25')][_0x44b8('0x28')]));_0x549a26[_0x44b8('0x26')]=_0x549a26[_0x44b8('0x26')][_0x44b8('0x29')]?_0x549a26[_0x44b8('0x26')]:_0x17ac44[_0x44b8('0x24')];if(!_0x41d673[_0x44b8('0x25')]['hasOwnProperty'](_0x44b8('0x2a'))){_0x549a26['limit']=qs[_0x44b8('0x15')](_0x41d673[_0x44b8('0x25')][_0x44b8('0x15')]);_0x549a26[_0x44b8('0x14')]=qs[_0x44b8('0x14')](_0x41d673['query'][_0x44b8('0x14')]);}_0x549a26[_0x44b8('0x2b')]=qs[_0x44b8('0x2c')](_0x41d673[_0x44b8('0x25')][_0x44b8('0x2c')]);_0x549a26['where']=qs[_0x44b8('0x2d')](_[_0x44b8('0x2e')](_0x41d673[_0x44b8('0x25')],_0x17ac44[_0x44b8('0x2d')]));if(_0x41d673[_0x44b8('0x25')][_0x44b8('0x2f')]){_0x549a26[_0x44b8('0x30')]=_[_0x44b8('0x31')](_0x549a26[_0x44b8('0x30')],{'$or':_[_0x44b8('0x32')](_0x2656d7,function(_0x13994c){if(_0x13994c[_0x44b8('0x33')][_0x44b8('0x34')]!==_0x44b8('0x35')){var _0x1e1a8a={};_0x1e1a8a[_0x13994c[_0x44b8('0x36')]]={'$like':'%'+_0x41d673[_0x44b8('0x25')][_0x44b8('0x2f')]+'%'};return _0x1e1a8a;}})});}_0x549a26=_[_0x44b8('0x31')]({},_0x549a26,_0x41d673[_0x44b8('0x37')]);var _0x2c02d6={'where':_0x549a26[_0x44b8('0x30')]};return db['CrmActionsList'][_0x44b8('0x38')](_0x2c02d6)[_0x44b8('0x1c')](function(_0x4fcfa0){_0x470f49[_0x44b8('0x38')]=_0x4fcfa0;if(_0x41d673[_0x44b8('0x25')][_0x44b8('0x39')]){_0x549a26[_0x44b8('0x3a')]=[{'all':!![]}];}return db['CrmActionsList'][_0x44b8('0x3b')](_0x549a26);})[_0x44b8('0x1c')](function(_0x3611b4){_0x470f49[_0x44b8('0x3c')]=_0x3611b4;return _0x470f49;})[_0x44b8('0x1c')](respondWithFilteredResult(_0x350482,_0x549a26))[_0x44b8('0x3d')](handleError(_0x350482,null));};exports[_0x44b8('0x3e')]=function(_0x3581b8,_0x209039){var _0x3d1be1={'raw':![],'where':{'id':_0x3581b8[_0x44b8('0x3f')]['id']}},_0x1c9983={};_0x1c9983[_0x44b8('0x24')]=_[_0x44b8('0x40')](db[_0x44b8('0x41')][_0x44b8('0x23')]);_0x1c9983['query']=_[_0x44b8('0x40')](_0x3581b8[_0x44b8('0x25')]);_0x1c9983[_0x44b8('0x2d')]=_['intersection'](_0x1c9983[_0x44b8('0x24')],_0x1c9983[_0x44b8('0x25')]);_0x3d1be1[_0x44b8('0x26')]=_['intersection'](_0x1c9983[_0x44b8('0x24')],qs[_0x44b8('0x28')](_0x3581b8[_0x44b8('0x25')][_0x44b8('0x28')]));_0x3d1be1[_0x44b8('0x26')]=_0x3d1be1['attributes']['length']?_0x3d1be1[_0x44b8('0x26')]:_0x1c9983[_0x44b8('0x24')];if(_0x3581b8[_0x44b8('0x25')][_0x44b8('0x39')]){_0x3d1be1[_0x44b8('0x3a')]=[{'all':!![]}];}_0x3d1be1=_[_0x44b8('0x31')]({},_0x3d1be1,_0x3581b8[_0x44b8('0x37')]);return db[_0x44b8('0x41')][_0x44b8('0x42')](_0x3d1be1)[_0x44b8('0x1c')](handleEntityNotFound(_0x209039,null))[_0x44b8('0x1c')](respondWithResult(_0x209039,null))[_0x44b8('0x3d')](handleError(_0x209039,null));};exports[_0x44b8('0x43')]=function(_0x1236c7,_0x149731){return db[_0x44b8('0x41')][_0x44b8('0x43')](_0x1236c7[_0x44b8('0x44')],{})[_0x44b8('0x1c')](respondWithResult(_0x149731,0xc9))['catch'](handleError(_0x149731,null));};exports['update']=function(_0x3b1b12,_0x1df74b){if(_0x3b1b12[_0x44b8('0x44')]['id']){delete _0x3b1b12[_0x44b8('0x44')]['id'];}return db[_0x44b8('0x41')][_0x44b8('0x42')]({'where':{'id':_0x3b1b12[_0x44b8('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1df74b,null))[_0x44b8('0x1c')](saveUpdates(_0x3b1b12['body'],null))[_0x44b8('0x1c')](respondWithResult(_0x1df74b,null))[_0x44b8('0x3d')](handleError(_0x1df74b,null));};exports[_0x44b8('0x1d')]=function(_0x9207bf,_0x103d57){return db[_0x44b8('0x41')]['find']({'where':{'id':_0x9207bf[_0x44b8('0x3f')]['id']}})[_0x44b8('0x1c')](handleEntityNotFound(_0x103d57,null))[_0x44b8('0x1c')](removeEntity(_0x103d57,null))[_0x44b8('0x3d')](handleError(_0x103d57,null));};exports['describe']=function(_0x4e4ed1,_0x2f549d){return db[_0x44b8('0x41')][_0x44b8('0x45')]()[_0x44b8('0x1c')](respondWithResult(_0x2f549d,null))[_0x44b8('0x3d')](handleError(_0x2f549d,null));}; \ No newline at end of file diff --git a/server/api/crmActionsList/crmActionsList.model.js b/server/api/crmActionsList/crmActionsList.model.js index 2d1d218..3f89934 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 _0xa045=['define','crm_actions_lists','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./crmActionsList.attributes'];(function(_0x319f60,_0x4f36b0){var _0x1d4491=function(_0x3b5184){while(--_0x3b5184){_0x319f60['push'](_0x319f60['shift']());}};_0x1d4491(++_0x4f36b0);}(_0xa045,0x1ba));var _0x5a04=function(_0x45d1bc,_0x15e7d6){_0x45d1bc=_0x45d1bc-0x0;var _0x12af0b=_0xa045[_0x45d1bc];return _0x12af0b;};'use strict';var _=require(_0x5a04('0x0'));var util=require(_0x5a04('0x1'));var logger=require(_0x5a04('0x2'))(_0x5a04('0x3'));var moment=require(_0x5a04('0x4'));var BPromise=require(_0x5a04('0x5'));var rp=require(_0x5a04('0x6'));var fs=require('fs');var path=require(_0x5a04('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5a04('0x8'));module['exports']=function(_0xcc4dbf,_0x4ea733){return _0xcc4dbf[_0x5a04('0x9')]('CrmActionsList',attributes,{'tableName':_0x5a04('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x75cb=['../../config/logger','api','moment','bluebird','request-promise','path','./crmActionsList.attributes','define','CrmActionsList','crm_actions_lists','lodash','util'];(function(_0x5a7a68,_0x45a830){var _0xccee5a=function(_0x4b6569){while(--_0x4b6569){_0x5a7a68['push'](_0x5a7a68['shift']());}};_0xccee5a(++_0x45a830);}(_0x75cb,0xe2));var _0xb75c=function(_0x34a161,_0x52a77b){_0x34a161=_0x34a161-0x0;var _0x4412a1=_0x75cb[_0x34a161];return _0x4412a1;};'use strict';var _=require(_0xb75c('0x0'));var util=require(_0xb75c('0x1'));var logger=require(_0xb75c('0x2'))(_0xb75c('0x3'));var moment=require(_0xb75c('0x4'));var BPromise=require(_0xb75c('0x5'));var rp=require(_0xb75c('0x6'));var fs=require('fs');var path=require(_0xb75c('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb75c('0x8'));module['exports']=function(_0x4e092c,_0x5a869a){return _0x4e092c[_0xb75c('0x9')](_0xb75c('0xa'),attributes,{'tableName':_0xb75c('0xb'),'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 8e1895b..a8d60e7 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 _0x12cf=['stringify','error','code','CrmActionsList,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x12cf,0x17c));var _0xf12c=function(_0x5cb36a,_0x3efaa3){_0x5cb36a=_0x5cb36a-0x0;var _0x25cb28=_0x12cf[_0x5cb36a];return _0x25cb28;};'use strict';var _=require(_0xf12c('0x0'));var util=require(_0xf12c('0x1'));var moment=require(_0xf12c('0x2'));var BPromise=require(_0xf12c('0x3'));var rs=require(_0xf12c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf12c('0x5'))['db'];var utils=require(_0xf12c('0x6'));var logger=require('../../config/logger')(_0xf12c('0x7'));var config=require('../../config/environment');var jayson=require(_0xf12c('0x8'));var client=jayson[_0xf12c('0x9')][_0xf12c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3af8e3,_0x37e521,_0x413029){return new BPromise(function(_0x121aad,_0x49afa1){return client[_0xf12c('0xb')](_0x3af8e3,_0x413029)[_0xf12c('0xc')](function(_0x2dbf6f){logger[_0xf12c('0xd')]('CrmActionsList,\x20%s,\x20%s',_0x37e521,_0xf12c('0xe'));logger[_0xf12c('0xf')]('CrmActionsList,\x20%s,\x20%s,\x20%s',_0x37e521,_0xf12c('0xe'),JSON[_0xf12c('0x10')](_0x2dbf6f));if(_0x2dbf6f[_0xf12c('0x11')]){if(_0x2dbf6f[_0xf12c('0x11')][_0xf12c('0x12')]===0x1f4){logger[_0xf12c('0x11')](_0xf12c('0x13'),_0x37e521,_0x2dbf6f['error'][_0xf12c('0x14')]);return _0x49afa1(_0x2dbf6f[_0xf12c('0x11')]['message']);}logger['error'](_0xf12c('0x13'),_0x37e521,_0x2dbf6f[_0xf12c('0x11')][_0xf12c('0x14')]);return _0x121aad(_0x2dbf6f['error']['message']);}else{logger[_0xf12c('0xd')]('CrmActionsList,\x20%s,\x20%s',_0x37e521,'request\x20sent');_0x121aad(_0x2dbf6f[_0xf12c('0x15')]['message']);}})['catch'](function(_0x4ed261){logger[_0xf12c('0x11')](_0xf12c('0x13'),_0x37e521,_0x4ed261);_0x49afa1(_0x4ed261);});});} \ No newline at end of file +var _0x5aca=['message','request\x20sent','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','debug','stringify','error','code','CrmActionsList,\x20%s,\x20%s'];(function(_0x2205f7,_0x3e1dc9){var _0x2da374=function(_0x109b8a){while(--_0x109b8a){_0x2205f7['push'](_0x2205f7['shift']());}};_0x2da374(++_0x3e1dc9);}(_0x5aca,0x77));var _0xa5ac=function(_0x24576d,_0x4cebb2){_0x24576d=_0x24576d-0x0;var _0x180ce4=_0x5aca[_0x24576d];return _0x180ce4;};'use strict';var _=require('lodash');var util=require(_0xa5ac('0x0'));var moment=require(_0xa5ac('0x1'));var BPromise=require(_0xa5ac('0x2'));var rs=require(_0xa5ac('0x3'));var fs=require('fs');var Redis=require(_0xa5ac('0x4'));var db=require(_0xa5ac('0x5'))['db'];var utils=require(_0xa5ac('0x6'));var logger=require(_0xa5ac('0x7'))(_0xa5ac('0x8'));var config=require(_0xa5ac('0x9'));var jayson=require(_0xa5ac('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x537d54,_0x49b6b1,_0x598b1f){return new BPromise(function(_0x3248d9,_0x26f2d6){return client[_0xa5ac('0xb')](_0x537d54,_0x598b1f)[_0xa5ac('0xc')](function(_0x25eccf){logger[_0xa5ac('0xd')]('CrmActionsList,\x20%s,\x20%s',_0x49b6b1,'request\x20sent');logger[_0xa5ac('0xe')]('CrmActionsList,\x20%s,\x20%s,\x20%s',_0x49b6b1,'request\x20sent',JSON[_0xa5ac('0xf')](_0x25eccf));if(_0x25eccf['error']){if(_0x25eccf[_0xa5ac('0x10')][_0xa5ac('0x11')]===0x1f4){logger[_0xa5ac('0x10')](_0xa5ac('0x12'),_0x49b6b1,_0x25eccf[_0xa5ac('0x10')][_0xa5ac('0x13')]);return _0x26f2d6(_0x25eccf[_0xa5ac('0x10')][_0xa5ac('0x13')]);}logger['error'](_0xa5ac('0x12'),_0x49b6b1,_0x25eccf[_0xa5ac('0x10')]['message']);return _0x3248d9(_0x25eccf[_0xa5ac('0x10')]['message']);}else{logger[_0xa5ac('0xd')](_0xa5ac('0x12'),_0x49b6b1,_0xa5ac('0x14'));_0x3248d9(_0x25eccf[_0xa5ac('0x15')][_0xa5ac('0x13')]);}})[_0xa5ac('0x16')](function(_0x3e88a7){logger[_0xa5ac('0x10')](_0xa5ac('0x12'),_0x49b6b1,_0x3e88a7);_0x26f2d6(_0x3e88a7);});});} \ No newline at end of file diff --git a/server/api/crmActionsList/index.js b/server/api/crmActionsList/index.js index 63d1e6c..8eb0407 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 _0x1c56=['describe','show','post','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./crmActionsList.controller','get','isAuthenticated','index','/describe'];(function(_0x4ea17a,_0x4b9c83){var _0x58e65f=function(_0x46ad6d){while(--_0x46ad6d){_0x4ea17a['push'](_0x4ea17a['shift']());}};_0x58e65f(++_0x4b9c83);}(_0x1c56,0x1ec));var _0x61c5=function(_0x236d24,_0x29e80a){_0x236d24=_0x236d24-0x0;var _0x1574cf=_0x1c56[_0x236d24];return _0x1574cf;};'use strict';var multer=require(_0x61c5('0x0'));var util=require(_0x61c5('0x1'));var path=require(_0x61c5('0x2'));var timeout=require(_0x61c5('0x3'));var express=require(_0x61c5('0x4'));var router=express[_0x61c5('0x5')]();var auth=require(_0x61c5('0x6'));var interaction=require(_0x61c5('0x7'));var config=require(_0x61c5('0x8'));var controller=require(_0x61c5('0x9'));router[_0x61c5('0xa')]('/',auth[_0x61c5('0xb')](),controller[_0x61c5('0xc')]);router['get'](_0x61c5('0xd'),auth[_0x61c5('0xb')](),controller[_0x61c5('0xe')]);router[_0x61c5('0xa')]('/:id',auth[_0x61c5('0xb')](),controller[_0x61c5('0xf')]);router[_0x61c5('0x10')]('/',auth[_0x61c5('0xb')](),controller['create']);router['put'](_0x61c5('0x11'),auth[_0x61c5('0xb')](),controller[_0x61c5('0x12')]);router[_0x61c5('0x13')](_0x61c5('0x11'),auth[_0x61c5('0xb')](),controller[_0x61c5('0x14')]);module[_0x61c5('0x15')]=router; \ No newline at end of file +var _0xf0fe=['express','Router','../../components/auth/service','../../config/environment','get','index','isAuthenticated','describe','/:id','show','create','put','update','destroy','exports','multer','path','connect-timeout'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xf0fe,0x9f));var _0xef0f=function(_0x348c10,_0x142c60){_0x348c10=_0x348c10-0x0;var _0x3739f0=_0xf0fe[_0x348c10];return _0x3739f0;};'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('../../components/interaction/service');var config=require(_0xef0f('0x6'));var controller=require('./crmActionsList.controller');router[_0xef0f('0x7')]('/',auth['isAuthenticated'](),controller[_0xef0f('0x8')]);router[_0xef0f('0x7')]('/describe',auth[_0xef0f('0x9')](),controller[_0xef0f('0xa')]);router[_0xef0f('0x7')](_0xef0f('0xb'),auth[_0xef0f('0x9')](),controller[_0xef0f('0xc')]);router['post']('/',auth[_0xef0f('0x9')](),controller[_0xef0f('0xd')]);router[_0xef0f('0xe')](_0xef0f('0xb'),auth[_0xef0f('0x9')](),controller[_0xef0f('0xf')]);router['delete'](_0xef0f('0xb'),auth[_0xef0f('0x9')](),controller[_0xef0f('0x10')]);module[_0xef0f('0x11')]=router; \ No newline at end of file diff --git a/server/api/crmMyCompanies/crmMyCompanies.attributes.js b/server/api/crmMyCompanies/crmMyCompanies.attributes.js index c4fd5b0..dd3f0bb 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 _0xae63=['sequelize','exports','STRING','BOOLEAN'];(function(_0x38fb8b,_0x70dd0a){var _0x1ec681=function(_0x58f130){while(--_0x58f130){_0x38fb8b['push'](_0x38fb8b['shift']());}};_0x1ec681(++_0x70dd0a);}(_0xae63,0x134));var _0x3ae6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xae63[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3ae6('0x0'));module[_0x3ae6('0x1')]={'saName':{'type':Sequelize[_0x3ae6('0x2')],'unique':'name','allowNull':![]},'saWebsite':{'type':Sequelize['STRING']},'saPhone':{'type':Sequelize[_0x3ae6('0x2')]},'saFax':{'type':Sequelize[_0x3ae6('0x2')]},'saEmail':{'type':Sequelize[_0x3ae6('0x2')],'validate':{'isEmail':!![]}},'saStreet':{'type':Sequelize[_0x3ae6('0x2')]},'saPostalCode':{'type':Sequelize['STRING']},'saCity':{'type':Sequelize[_0x3ae6('0x2')]},'saCountry':{'type':Sequelize['STRING']},'saISOCode':{'type':Sequelize['STRING'](0x3)},'saFiscalCode':{'type':Sequelize[_0x3ae6('0x2')](0x10)},'saPIVA':{'type':Sequelize[_0x3ae6('0x2')](0xb)},'saSDICode':{'type':Sequelize[_0x3ae6('0x2')](0x6)},'saFiscalMessage':{'type':Sequelize[_0x3ae6('0x2')]},'saEurope':{'type':Sequelize[_0x3ae6('0x3')]}}; \ No newline at end of file +var _0xd015=['sequelize','exports','name','STRING','BOOLEAN'];(function(_0x460a70,_0x44fa0f){var _0x3e6bb3=function(_0x3a788c){while(--_0x3a788c){_0x460a70['push'](_0x460a70['shift']());}};_0x3e6bb3(++_0x44fa0f);}(_0xd015,0x15e));var _0x5d01=function(_0x463d31,_0x300f00){_0x463d31=_0x463d31-0x0;var _0x54d42f=_0xd015[_0x463d31];return _0x54d42f;};'use strict';var Sequelize=require(_0x5d01('0x0'));module[_0x5d01('0x1')]={'saName':{'type':Sequelize['STRING'],'unique':_0x5d01('0x2'),'allowNull':![]},'saWebsite':{'type':Sequelize[_0x5d01('0x3')]},'saPhone':{'type':Sequelize[_0x5d01('0x3')]},'saFax':{'type':Sequelize['STRING']},'saEmail':{'type':Sequelize[_0x5d01('0x3')],'validate':{'isEmail':!![]}},'saStreet':{'type':Sequelize[_0x5d01('0x3')]},'saPostalCode':{'type':Sequelize[_0x5d01('0x3')]},'saCity':{'type':Sequelize[_0x5d01('0x3')]},'saCountry':{'type':Sequelize[_0x5d01('0x3')]},'saISOCode':{'type':Sequelize[_0x5d01('0x3')](0x3)},'saFiscalCode':{'type':Sequelize[_0x5d01('0x3')](0x10)},'saPIVA':{'type':Sequelize[_0x5d01('0x3')](0xb)},'saSDICode':{'type':Sequelize[_0x5d01('0x3')](0x6)},'saFiscalMessage':{'type':Sequelize[_0x5d01('0x3')]},'saEurope':{'type':Sequelize[_0x5d01('0x4')]}}; \ No newline at end of file diff --git a/server/api/crmMyCompanies/crmMyCompanies.controller.js b/server/api/crmMyCompanies/crmMyCompanies.controller.js index 2550c36..58c87cb 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 _0x2032=['map','merge','crmMyCompany','includeAll','include','rows','catch','show','params','options','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','update','then','end','error','stack','name','send','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','day','filter'];(function(_0x5dee29,_0x42b867){var _0x119a3b=function(_0x18d00e){while(--_0x18d00e){_0x5dee29['push'](_0x5dee29['shift']());}};_0x119a3b(++_0x42b867);}(_0x2032,0xd9));var _0x2203=function(_0x40db0d,_0x49321b){_0x40db0d=_0x40db0d-0x0;var _0x1f4782=_0x2032[_0x40db0d];return _0x1f4782;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2203('0x0'));var rimraf=require(_0x2203('0x1'));var zipdir=require(_0x2203('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2203('0x3'));var moment=require(_0x2203('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2203('0x5'));var util=require(_0x2203('0x6'));var path=require(_0x2203('0x7'));var sox=require(_0x2203('0x8'));var csv=require(_0x2203('0x9'));var ejs=require(_0x2203('0xa'));var fs=require('fs');var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var qs=require('../../components/parsers/qs');var logger=require(_0x2203('0x11'))(_0x2203('0x12'));var utils=require(_0x2203('0x13'));var config=require('../../config/environment');var db=require(_0x2203('0x14'))['db'];function respondWithStatusCode(_0x4a6832,_0x3f690a){_0x3f690a=_0x3f690a||0xcc;return function(_0x4b73be){if(_0x4b73be){return _0x4a6832[_0x2203('0x15')](_0x3f690a);}return _0x4a6832[_0x2203('0x16')](_0x3f690a)['end']();};}function respondWithResult(_0x583bc7,_0x585c76){_0x585c76=_0x585c76||0xc8;return function(_0x5f56ff){if(_0x5f56ff){return _0x583bc7['status'](_0x585c76)[_0x2203('0x17')](_0x5f56ff);}};}function respondWithFilteredResult(_0x538b30,_0x592e47){return function(_0x21a3af){if(_0x21a3af){var _0x472265=_0x21a3af[_0x2203('0x18')],_0x1c1ead=_0x592e47[_0x2203('0x19')],_0x41af85=_0x592e47[_0x2203('0x19')]+_0x592e47[_0x2203('0x1a')],_0x226209;if(_0x41af85>=_0x472265){_0x41af85=_0x472265;_0x226209=0xc8;}else{_0x226209=0xce;}_0x538b30[_0x2203('0x16')](_0x226209);return _0x538b30['set'](_0x2203('0x1b'),_0x1c1ead+'-'+_0x41af85+'/'+_0x472265)[_0x2203('0x17')](_0x21a3af);}return null;};}function patchUpdates(_0x4893ff){return function(_0x3f9ef6){try{jsonpatch[_0x2203('0x1c')](_0x3f9ef6,_0x4893ff,!![]);}catch(_0x4aeb9f){return BPromise[_0x2203('0x1d')](_0x4aeb9f);}return _0x3f9ef6['save']();};}function saveUpdates(_0x2904ba,_0x310b8c){return function(_0x3c8c34){if(_0x3c8c34){return _0x3c8c34[_0x2203('0x1e')](_0x2904ba)[_0x2203('0x1f')](function(_0x449039){return _0x449039;});}return null;};}function removeEntity(_0x538c23,_0x13d3f7){return function(_0x50822b){if(_0x50822b){return _0x50822b['destroy']()[_0x2203('0x1f')](function(){_0x538c23['status'](0xcc)[_0x2203('0x20')]();});}};}function handleEntityNotFound(_0x5bfe61,_0x5d4c4e){return function(_0x3ee25b){if(!_0x3ee25b){_0x5bfe61['sendStatus'](0x194);}return _0x3ee25b;};}function handleError(_0x5c8da9,_0x226374){_0x226374=_0x226374||0x1f4;return function(_0x2718f5){logger[_0x2203('0x21')](_0x2718f5[_0x2203('0x22')]);if(_0x2718f5[_0x2203('0x23')]){delete _0x2718f5[_0x2203('0x23')];}_0x5c8da9[_0x2203('0x16')](_0x226374)[_0x2203('0x24')](_0x2718f5);};}exports['index']=function(_0x143f41,_0x36b958){var _0x39a11a={},_0x5f11bf={},_0xb2071b={'count':0x0,'rows':[]};var _0x1cec17=db['crmMyCompany'][_0x2203('0x25')];_0x5f11bf[_0x2203('0x26')]=_[_0x2203('0x27')](_0x1cec17);var _0x46b8b9={'dateStart':_0x143f41[_0x2203('0x28')][_0x2203('0x29')],'dateEnd':_0x143f41[_0x2203('0x28')]['dateEnd']};delete _0x143f41[_0x2203('0x28')][_0x2203('0x29')];delete _0x143f41[_0x2203('0x28')][_0x2203('0x2a')];_0x5f11bf['query']=_[_0x2203('0x27')](_0x143f41[_0x2203('0x28')]);_0x5f11bf[_0x2203('0x2b')]=_[_0x2203('0x2c')](_0x5f11bf['model'],_0x5f11bf[_0x2203('0x28')]);_0x39a11a[_0x2203('0x2d')]=_['intersection'](_0x5f11bf['model'],qs[_0x2203('0x2e')](_0x143f41['query']['fields']));_0x39a11a[_0x2203('0x2d')]=_0x39a11a[_0x2203('0x2d')][_0x2203('0x2f')]?_0x39a11a[_0x2203('0x2d')]:_0x5f11bf[_0x2203('0x26')];if(!_0x143f41['query'][_0x2203('0x30')](_0x2203('0x31'))){_0x39a11a['limit']=qs[_0x2203('0x1a')](_0x143f41[_0x2203('0x28')][_0x2203('0x1a')]);_0x39a11a[_0x2203('0x19')]=qs[_0x2203('0x19')](_0x143f41[_0x2203('0x28')][_0x2203('0x19')]);}_0x39a11a[_0x2203('0x32')]=qs[_0x2203('0x33')](_0x143f41['query'][_0x2203('0x33')]);_0x39a11a[_0x2203('0x34')]=qs['filters'](_['pick'](_0x143f41[_0x2203('0x28')],_0x5f11bf['filters']));if(_0x46b8b9[_0x2203('0x29')]){if(_0x46b8b9[_0x2203('0x2a')]){_0x46b8b9[_0x2203('0x2a')]=moment(_0x46b8b9['dateEnd'])['add'](0x1,_0x2203('0x35'));}else{_0x46b8b9['dateEnd']=moment(_0x46b8b9[_0x2203('0x29')])['add'](0x1,_0x2203('0x35'));}_['merge'](_0x39a11a[_0x2203('0x34')],{'createdAt':{'$gte':_0x46b8b9[_0x2203('0x29')],'$lte':_0x46b8b9[_0x2203('0x2a')]}});}if(_0x143f41[_0x2203('0x28')][_0x2203('0x36')]){_0x39a11a['where']=_['merge'](_0x39a11a['where'],{'$or':_[_0x2203('0x37')](_0x39a11a[_0x2203('0x2d')],function(_0x323798){var _0x3b0c7a={};_0x3b0c7a[_0x323798]={'$like':'%'+_0x143f41[_0x2203('0x28')][_0x2203('0x36')]+'%'};return _0x3b0c7a;})});}_0x39a11a=_[_0x2203('0x38')]({},_0x39a11a,_0x143f41['options']);var _0x175945={'where':_0x39a11a[_0x2203('0x34')]};return db[_0x2203('0x39')][_0x2203('0x18')](_0x175945)['then'](function(_0x50d74a){_0xb2071b[_0x2203('0x18')]=_0x50d74a;if(_0x143f41['query'][_0x2203('0x3a')]){_0x39a11a[_0x2203('0x3b')]=[{'all':!![]}];}return db[_0x2203('0x39')]['findAll'](_0x39a11a);})['then'](function(_0x1e7ebc){_0xb2071b[_0x2203('0x3c')]=_0x1e7ebc;return _0xb2071b;})[_0x2203('0x1f')](respondWithFilteredResult(_0x36b958,_0x39a11a))[_0x2203('0x3d')](handleError(_0x36b958,null));};exports[_0x2203('0x3e')]=function(_0x1fa734,_0x5cd573){var _0x15d3b6={'raw':![],'where':{'id':_0x1fa734[_0x2203('0x3f')]['id']}},_0x165a3f={};_0x165a3f[_0x2203('0x26')]=_[_0x2203('0x27')](db[_0x2203('0x39')][_0x2203('0x25')]);_0x165a3f[_0x2203('0x28')]=_[_0x2203('0x27')](_0x1fa734[_0x2203('0x28')]);_0x165a3f['filters']=_[_0x2203('0x2c')](_0x165a3f[_0x2203('0x26')],_0x165a3f[_0x2203('0x28')]);_0x15d3b6[_0x2203('0x2d')]=_['intersection'](_0x165a3f['model'],qs[_0x2203('0x2e')](_0x1fa734['query'][_0x2203('0x2e')]));_0x15d3b6[_0x2203('0x2d')]=_0x15d3b6[_0x2203('0x2d')][_0x2203('0x2f')]?_0x15d3b6['attributes']:_0x165a3f[_0x2203('0x26')];if(_0x1fa734[_0x2203('0x28')]['includeAll']){_0x15d3b6[_0x2203('0x3b')]=[{'all':!![]}];}_0x15d3b6=_[_0x2203('0x38')]({},_0x15d3b6,_0x1fa734[_0x2203('0x40')]);return db[_0x2203('0x39')]['find'](_0x15d3b6)['then'](handleEntityNotFound(_0x5cd573,null))[_0x2203('0x1f')](respondWithResult(_0x5cd573,null))['catch'](handleError(_0x5cd573,null));};exports['create']=function(_0x450082,_0x33b7b5){return db[_0x2203('0x39')]['create'](_0x450082['body'],{})[_0x2203('0x1f')](respondWithResult(_0x33b7b5,0xc9))[_0x2203('0x3d')](handleError(_0x33b7b5,null));};exports[_0x2203('0x1e')]=function(_0x21d2d7,_0x225b0e){if(_0x21d2d7[_0x2203('0x41')]['id']){delete _0x21d2d7['body']['id'];}return db[_0x2203('0x39')]['find']({'where':{'id':_0x21d2d7[_0x2203('0x3f')]['id']}})[_0x2203('0x1f')](handleEntityNotFound(_0x225b0e,null))[_0x2203('0x1f')](saveUpdates(_0x21d2d7[_0x2203('0x41')],null))['then'](respondWithResult(_0x225b0e,null))['catch'](handleError(_0x225b0e,null));};exports[_0x2203('0x42')]=function(_0x1f772d,_0x126aad){return db[_0x2203('0x39')]['find']({'where':{'id':_0x1f772d['params']['id']}})['then'](handleEntityNotFound(_0x126aad,null))[_0x2203('0x1f')](removeEntity(_0x126aad,null))[_0x2203('0x3d')](handleError(_0x126aad,null));};exports['describe']=function(_0x7f61df,_0x267627){return db['crmMyCompany'][_0x2203('0x43')]()[_0x2203('0x1f')](respondWithResult(_0x267627,null))[_0x2203('0x3d')](handleError(_0x267627,null));}; \ No newline at end of file +var _0x80ed=['rows','catch','show','params','find','create','body','describe','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','save','update','then','error','name','crmMyCompany','rawAttributes','model','keys','query','dateStart','dateEnd','filters','intersection','attributes','fields','length','nolimit','order','where','pick','add','day','filter','merge','map','options','includeAll','include','findAll'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x80ed,0x11c));var _0xd80e=function(_0x456c0c,_0x4059c9){_0x456c0c=_0x456c0c-0x0;var _0x16fde8=_0x80ed[_0x456c0c];return _0x16fde8;};'use strict';var pdf=require(_0xd80e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd80e('0x1'));var zipdir=require(_0xd80e('0x2'));var jsonpatch=require(_0xd80e('0x3'));var rp=require('request-promise');var moment=require(_0xd80e('0x4'));var BPromise=require(_0xd80e('0x5'));var Mustache=require(_0xd80e('0x6'));var util=require(_0xd80e('0x7'));var path=require('path');var sox=require(_0xd80e('0x8'));var csv=require(_0xd80e('0x9'));var ejs=require(_0xd80e('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd80e('0xb'));var crypto=require(_0xd80e('0xc'));var jsforce=require(_0xd80e('0xd'));var deskjs=require(_0xd80e('0xe'));var toCsv=require(_0xd80e('0x9'));var querystring=require(_0xd80e('0xf'));var Papa=require(_0xd80e('0x10'));var qs=require(_0xd80e('0x11'));var logger=require(_0xd80e('0x12'))(_0xd80e('0x13'));var utils=require('../../config/utils');var config=require(_0xd80e('0x14'));var db=require(_0xd80e('0x15'))['db'];function respondWithStatusCode(_0xa50f0f,_0x30c9d0){_0x30c9d0=_0x30c9d0||0xcc;return function(_0x1d999d){if(_0x1d999d){return _0xa50f0f[_0xd80e('0x16')](_0x30c9d0);}return _0xa50f0f[_0xd80e('0x17')](_0x30c9d0)[_0xd80e('0x18')]();};}function respondWithResult(_0x1d3fcf,_0x4fb01c){_0x4fb01c=_0x4fb01c||0xc8;return function(_0x5691a1){if(_0x5691a1){return _0x1d3fcf['status'](_0x4fb01c)['json'](_0x5691a1);}};}function respondWithFilteredResult(_0x145766,_0x3d233b){return function(_0x3096ae){if(_0x3096ae){var _0x1e8b63=_0x3096ae[_0xd80e('0x19')],_0x449c60=_0x3d233b[_0xd80e('0x1a')],_0x58a17e=_0x3d233b[_0xd80e('0x1a')]+_0x3d233b[_0xd80e('0x1b')],_0x595683;if(_0x58a17e>=_0x1e8b63){_0x58a17e=_0x1e8b63;_0x595683=0xc8;}else{_0x595683=0xce;}_0x145766[_0xd80e('0x17')](_0x595683);return _0x145766[_0xd80e('0x1c')](_0xd80e('0x1d'),_0x449c60+'-'+_0x58a17e+'/'+_0x1e8b63)['json'](_0x3096ae);}return null;};}function patchUpdates(_0x21ceec){return function(_0x1cc576){try{jsonpatch[_0xd80e('0x1e')](_0x1cc576,_0x21ceec,!![]);}catch(_0x34e239){return BPromise['reject'](_0x34e239);}return _0x1cc576[_0xd80e('0x1f')]();};}function saveUpdates(_0x175c67,_0xecfe74){return function(_0x527237){if(_0x527237){return _0x527237[_0xd80e('0x20')](_0x175c67)[_0xd80e('0x21')](function(_0x2765ea){return _0x2765ea;});}return null;};}function removeEntity(_0x147134,_0x46b6eb){return function(_0x5509d4){if(_0x5509d4){return _0x5509d4['destroy']()[_0xd80e('0x21')](function(){_0x147134[_0xd80e('0x17')](0xcc)[_0xd80e('0x18')]();});}};}function handleEntityNotFound(_0x2d46e7,_0x3eb3ca){return function(_0x326d66){if(!_0x326d66){_0x2d46e7[_0xd80e('0x16')](0x194);}return _0x326d66;};}function handleError(_0x5430b6,_0x1fbf8a){_0x1fbf8a=_0x1fbf8a||0x1f4;return function(_0x57d70){logger[_0xd80e('0x22')](_0x57d70['stack']);if(_0x57d70[_0xd80e('0x23')]){delete _0x57d70[_0xd80e('0x23')];}_0x5430b6[_0xd80e('0x17')](_0x1fbf8a)['send'](_0x57d70);};}exports['index']=function(_0x5420e7,_0x31ff9d){var _0x4b8291={},_0x9f9287={},_0x1044cc={'count':0x0,'rows':[]};var _0x4e8ed9=db[_0xd80e('0x24')][_0xd80e('0x25')];_0x9f9287[_0xd80e('0x26')]=_[_0xd80e('0x27')](_0x4e8ed9);var _0x5376eb={'dateStart':_0x5420e7[_0xd80e('0x28')][_0xd80e('0x29')],'dateEnd':_0x5420e7[_0xd80e('0x28')][_0xd80e('0x2a')]};delete _0x5420e7[_0xd80e('0x28')][_0xd80e('0x29')];delete _0x5420e7[_0xd80e('0x28')][_0xd80e('0x2a')];_0x9f9287['query']=_['keys'](_0x5420e7[_0xd80e('0x28')]);_0x9f9287[_0xd80e('0x2b')]=_[_0xd80e('0x2c')](_0x9f9287[_0xd80e('0x26')],_0x9f9287[_0xd80e('0x28')]);_0x4b8291[_0xd80e('0x2d')]=_['intersection'](_0x9f9287['model'],qs[_0xd80e('0x2e')](_0x5420e7[_0xd80e('0x28')][_0xd80e('0x2e')]));_0x4b8291[_0xd80e('0x2d')]=_0x4b8291[_0xd80e('0x2d')][_0xd80e('0x2f')]?_0x4b8291[_0xd80e('0x2d')]:_0x9f9287[_0xd80e('0x26')];if(!_0x5420e7['query']['hasOwnProperty'](_0xd80e('0x30'))){_0x4b8291[_0xd80e('0x1b')]=qs[_0xd80e('0x1b')](_0x5420e7[_0xd80e('0x28')][_0xd80e('0x1b')]);_0x4b8291[_0xd80e('0x1a')]=qs[_0xd80e('0x1a')](_0x5420e7[_0xd80e('0x28')][_0xd80e('0x1a')]);}_0x4b8291[_0xd80e('0x31')]=qs['sort'](_0x5420e7[_0xd80e('0x28')]['sort']);_0x4b8291[_0xd80e('0x32')]=qs[_0xd80e('0x2b')](_[_0xd80e('0x33')](_0x5420e7[_0xd80e('0x28')],_0x9f9287['filters']));if(_0x5376eb[_0xd80e('0x29')]){if(_0x5376eb['dateEnd']){_0x5376eb[_0xd80e('0x2a')]=moment(_0x5376eb['dateEnd'])[_0xd80e('0x34')](0x1,_0xd80e('0x35'));}else{_0x5376eb['dateEnd']=moment(_0x5376eb[_0xd80e('0x29')])[_0xd80e('0x34')](0x1,_0xd80e('0x35'));}_['merge'](_0x4b8291[_0xd80e('0x32')],{'createdAt':{'$gte':_0x5376eb[_0xd80e('0x29')],'$lte':_0x5376eb[_0xd80e('0x2a')]}});}if(_0x5420e7[_0xd80e('0x28')][_0xd80e('0x36')]){_0x4b8291[_0xd80e('0x32')]=_[_0xd80e('0x37')](_0x4b8291[_0xd80e('0x32')],{'$or':_[_0xd80e('0x38')](_0x4b8291['attributes'],function(_0x51932d){var _0x4e92f6={};_0x4e92f6[_0x51932d]={'$like':'%'+_0x5420e7[_0xd80e('0x28')][_0xd80e('0x36')]+'%'};return _0x4e92f6;})});}_0x4b8291=_['merge']({},_0x4b8291,_0x5420e7[_0xd80e('0x39')]);var _0x50f1ab={'where':_0x4b8291[_0xd80e('0x32')]};return db['crmMyCompany'][_0xd80e('0x19')](_0x50f1ab)[_0xd80e('0x21')](function(_0x493fb2){_0x1044cc['count']=_0x493fb2;if(_0x5420e7[_0xd80e('0x28')][_0xd80e('0x3a')]){_0x4b8291[_0xd80e('0x3b')]=[{'all':!![]}];}return db[_0xd80e('0x24')][_0xd80e('0x3c')](_0x4b8291);})[_0xd80e('0x21')](function(_0x20cbff){_0x1044cc[_0xd80e('0x3d')]=_0x20cbff;return _0x1044cc;})[_0xd80e('0x21')](respondWithFilteredResult(_0x31ff9d,_0x4b8291))[_0xd80e('0x3e')](handleError(_0x31ff9d,null));};exports[_0xd80e('0x3f')]=function(_0x2e257e,_0x35862f){var _0x11463c={'raw':![],'where':{'id':_0x2e257e[_0xd80e('0x40')]['id']}},_0x2c176e={};_0x2c176e['model']=_['keys'](db['crmMyCompany'][_0xd80e('0x25')]);_0x2c176e['query']=_[_0xd80e('0x27')](_0x2e257e[_0xd80e('0x28')]);_0x2c176e[_0xd80e('0x2b')]=_[_0xd80e('0x2c')](_0x2c176e[_0xd80e('0x26')],_0x2c176e[_0xd80e('0x28')]);_0x11463c['attributes']=_['intersection'](_0x2c176e['model'],qs[_0xd80e('0x2e')](_0x2e257e['query'][_0xd80e('0x2e')]));_0x11463c[_0xd80e('0x2d')]=_0x11463c[_0xd80e('0x2d')][_0xd80e('0x2f')]?_0x11463c[_0xd80e('0x2d')]:_0x2c176e['model'];if(_0x2e257e[_0xd80e('0x28')][_0xd80e('0x3a')]){_0x11463c[_0xd80e('0x3b')]=[{'all':!![]}];}_0x11463c=_['merge']({},_0x11463c,_0x2e257e[_0xd80e('0x39')]);return db[_0xd80e('0x24')][_0xd80e('0x41')](_0x11463c)['then'](handleEntityNotFound(_0x35862f,null))[_0xd80e('0x21')](respondWithResult(_0x35862f,null))[_0xd80e('0x3e')](handleError(_0x35862f,null));};exports[_0xd80e('0x42')]=function(_0x1c927b,_0x4144f5){return db[_0xd80e('0x24')]['create'](_0x1c927b['body'],{})[_0xd80e('0x21')](respondWithResult(_0x4144f5,0xc9))[_0xd80e('0x3e')](handleError(_0x4144f5,null));};exports[_0xd80e('0x20')]=function(_0x5dec55,_0x4af8a9){if(_0x5dec55[_0xd80e('0x43')]['id']){delete _0x5dec55[_0xd80e('0x43')]['id'];}return db[_0xd80e('0x24')][_0xd80e('0x41')]({'where':{'id':_0x5dec55[_0xd80e('0x40')]['id']}})['then'](handleEntityNotFound(_0x4af8a9,null))[_0xd80e('0x21')](saveUpdates(_0x5dec55['body'],null))[_0xd80e('0x21')](respondWithResult(_0x4af8a9,null))[_0xd80e('0x3e')](handleError(_0x4af8a9,null));};exports['destroy']=function(_0x29af86,_0xd19881){return db[_0xd80e('0x24')][_0xd80e('0x41')]({'where':{'id':_0x29af86[_0xd80e('0x40')]['id']}})[_0xd80e('0x21')](handleEntityNotFound(_0xd19881,null))[_0xd80e('0x21')](removeEntity(_0xd19881,null))['catch'](handleError(_0xd19881,null));};exports[_0xd80e('0x44')]=function(_0x377e68,_0x419df7){return db['crmMyCompany']['describe']()[_0xd80e('0x21')](respondWithResult(_0x419df7,null))[_0xd80e('0x3e')](handleError(_0x419df7,null));}; \ No newline at end of file diff --git a/server/api/crmMyCompanies/crmMyCompanies.model.js b/server/api/crmMyCompanies/crmMyCompanies.model.js index 4b302a9..265a127 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 _0x0b80=['crmMyCompany','crm_maycompanies','lodash','util','../../config/logger','api','moment','bluebird','request-promise','exports','define'];(function(_0x3df2a2,_0xe6daf3){var _0x4e59c4=function(_0x26bea6){while(--_0x26bea6){_0x3df2a2['push'](_0x3df2a2['shift']());}};_0x4e59c4(++_0xe6daf3);}(_0x0b80,0xa7));var _0x00b8=function(_0x58ff8e,_0x39fe0d){_0x58ff8e=_0x58ff8e-0x0;var _0x701683=_0x0b80[_0x58ff8e];return _0x701683;};'use strict';var _=require(_0x00b8('0x0'));var util=require(_0x00b8('0x1'));var logger=require(_0x00b8('0x2'))(_0x00b8('0x3'));var moment=require(_0x00b8('0x4'));var BPromise=require(_0x00b8('0x5'));var rp=require(_0x00b8('0x6'));var attributes=require('./crmMyCompanies.attributes');module[_0x00b8('0x7')]=function(_0xd7532b,_0x7c66dc){return _0xd7532b[_0x00b8('0x8')](_0x00b8('0x9'),attributes,{'tableName':_0x00b8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3c6d=['util','../../config/logger','api','bluebird','request-promise','./crmMyCompanies.attributes','exports','crmMyCompany','crm_maycompanies','lodash'];(function(_0x1e6bdc,_0x133c2e){var _0x966ab5=function(_0x2a99d0){while(--_0x2a99d0){_0x1e6bdc['push'](_0x1e6bdc['shift']());}};_0x966ab5(++_0x133c2e);}(_0x3c6d,0x199));var _0xd3c6=function(_0x3f90f5,_0x2b9092){_0x3f90f5=_0x3f90f5-0x0;var _0x424b4a=_0x3c6d[_0x3f90f5];return _0x424b4a;};'use strict';var _=require(_0xd3c6('0x0'));var util=require(_0xd3c6('0x1'));var logger=require(_0xd3c6('0x2'))(_0xd3c6('0x3'));var moment=require('moment');var BPromise=require(_0xd3c6('0x4'));var rp=require(_0xd3c6('0x5'));var attributes=require(_0xd3c6('0x6'));module[_0xd3c6('0x7')]=function(_0x26c5b9,_0x236c6b){return _0x26c5b9['define'](_0xd3c6('0x8'),attributes,{'tableName':_0xd3c6('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 1451cbb..5aaf80f 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 _0x9da0=['stringify','error','code','message','result','catch','lodash','util','moment','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','crmMyCompany,\x20%s,\x20%s','request\x20sent','debug','crmMyCompany,\x20%s,\x20%s,\x20%s'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x9da0,0xce));var _0x09da=function(_0x5f4c99,_0x4c285c){_0x5f4c99=_0x5f4c99-0x0;var _0x2a362c=_0x9da0[_0x5f4c99];return _0x2a362c;};'use strict';var _=require(_0x09da('0x0'));var util=require(_0x09da('0x1'));var moment=require(_0x09da('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var db=require('../../mysqldb')['db'];var utils=require(_0x09da('0x3'));var logger=require(_0x09da('0x4'))(_0x09da('0x5'));var config=require(_0x09da('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x09da('0x7')][_0x09da('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x41c6e2,_0x4cdb44,_0xd42d10){return new BPromise(function(_0x45f7d4,_0x1cc195){return client['request'](_0x41c6e2,_0xd42d10)['then'](function(_0x44c5f9){logger[_0x09da('0x9')](_0x09da('0xa'),_0x4cdb44,_0x09da('0xb'));logger[_0x09da('0xc')](_0x09da('0xd'),_0x4cdb44,_0x09da('0xb'),JSON[_0x09da('0xe')](_0x44c5f9));if(_0x44c5f9[_0x09da('0xf')]){if(_0x44c5f9[_0x09da('0xf')][_0x09da('0x10')]===0x1f4){logger[_0x09da('0xf')](_0x09da('0xa'),_0x4cdb44,_0x44c5f9['error'][_0x09da('0x11')]);return _0x1cc195(_0x44c5f9[_0x09da('0xf')][_0x09da('0x11')]);}logger[_0x09da('0xf')](_0x09da('0xa'),_0x4cdb44,_0x44c5f9[_0x09da('0xf')]['message']);return _0x45f7d4(_0x44c5f9['error']['message']);}else{logger[_0x09da('0x9')](_0x09da('0xa'),_0x4cdb44,'request\x20sent');_0x45f7d4(_0x44c5f9[_0x09da('0x12')][_0x09da('0x11')]);}})[_0x09da('0x13')](function(_0x33b76b){logger['error'](_0x09da('0xa'),_0x4cdb44,_0x33b76b);_0x1cc195(_0x33b76b);});});} \ No newline at end of file +var _0xb25b=['info','crmMyCompany,\x20%s,\x20%s','request\x20sent','debug','crmMyCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0xb70580,_0x1af7dd){var _0x1d89b2=function(_0x7399f0){while(--_0x7399f0){_0xb70580['push'](_0xb70580['shift']());}};_0x1d89b2(++_0x1af7dd);}(_0xb25b,0x19a));var _0xbb25=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xb25b[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xbb25('0x0'));var util=require(_0xbb25('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var db=require(_0xbb25('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xbb25('0x3'))('rpc');var config=require(_0xbb25('0x4'));var jayson=require(_0xbb25('0x5'));var client=jayson[_0xbb25('0x6')][_0xbb25('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2eca8d,_0x2432ce,_0x2417bb){return new BPromise(function(_0x4ea0d6,_0x1657e7){return client['request'](_0x2eca8d,_0x2417bb)['then'](function(_0x709c2){logger[_0xbb25('0x8')](_0xbb25('0x9'),_0x2432ce,_0xbb25('0xa'));logger[_0xbb25('0xb')](_0xbb25('0xc'),_0x2432ce,_0xbb25('0xa'),JSON[_0xbb25('0xd')](_0x709c2));if(_0x709c2[_0xbb25('0xe')]){if(_0x709c2[_0xbb25('0xe')][_0xbb25('0xf')]===0x1f4){logger[_0xbb25('0xe')](_0xbb25('0x9'),_0x2432ce,_0x709c2['error'][_0xbb25('0x10')]);return _0x1657e7(_0x709c2[_0xbb25('0xe')][_0xbb25('0x10')]);}logger['error']('crmMyCompany,\x20%s,\x20%s',_0x2432ce,_0x709c2[_0xbb25('0xe')]['message']);return _0x4ea0d6(_0x709c2[_0xbb25('0xe')][_0xbb25('0x10')]);}else{logger[_0xbb25('0x8')](_0xbb25('0x9'),_0x2432ce,_0xbb25('0xa'));_0x4ea0d6(_0x709c2[_0xbb25('0x11')][_0xbb25('0x10')]);}})[_0xbb25('0x12')](function(_0x325d92){logger['error'](_0xbb25('0x9'),_0x2432ce,_0x325d92);_0x1657e7(_0x325d92);});});} \ No newline at end of file diff --git a/server/api/crmMyCompanies/index.js b/server/api/crmMyCompanies/index.js index ad9caf2..a545ca0 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 _0x0c71=['../../config/environment','get','isAuthenticated','index','/describe','/:id','show','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0c71,0xfb));var _0x10c7=function(_0x7c1374,_0x18a65b){_0x7c1374=_0x7c1374-0x0;var _0x596702=_0x0c71[_0x7c1374];return _0x596702;};'use strict';var multer=require('multer');var util=require(_0x10c7('0x0'));var path=require('path');var timeout=require(_0x10c7('0x1'));var express=require(_0x10c7('0x2'));var router=express[_0x10c7('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x10c7('0x4'));var controller=require('./crmMyCompanies.controller');router[_0x10c7('0x5')]('/',auth[_0x10c7('0x6')](),controller[_0x10c7('0x7')]);router[_0x10c7('0x5')](_0x10c7('0x8'),auth[_0x10c7('0x6')](),controller['describe']);router[_0x10c7('0x5')](_0x10c7('0x9'),auth['isAuthenticated'](),controller[_0x10c7('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x10c7('0xb')]);router[_0x10c7('0xc')]('/:id',auth[_0x10c7('0x6')](),controller[_0x10c7('0xd')]);router[_0x10c7('0xe')](_0x10c7('0x9'),auth[_0x10c7('0x6')](),controller[_0x10c7('0xf')]);module[_0x10c7('0x10')]=router; \ No newline at end of file +var _0x7703=['multer','util','path','Router','../../components/auth/service','../../components/interaction/service','./crmMyCompanies.controller','get','isAuthenticated','describe','/:id','show','post','create','put','delete','destroy'];(function(_0x522d15,_0x8ef87b){var _0x3b89ce=function(_0x129b78){while(--_0x129b78){_0x522d15['push'](_0x522d15['shift']());}};_0x3b89ce(++_0x8ef87b);}(_0x7703,0x1ba));var _0x3770=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0x7703[_0x1573ea];return _0x51c0e2;};'use strict';var multer=require(_0x3770('0x0'));var util=require(_0x3770('0x1'));var path=require(_0x3770('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3770('0x3')]();var auth=require(_0x3770('0x4'));var interaction=require(_0x3770('0x5'));var config=require('../../config/environment');var controller=require(_0x3770('0x6'));router[_0x3770('0x7')]('/',auth[_0x3770('0x8')](),controller['index']);router[_0x3770('0x7')]('/describe',auth[_0x3770('0x8')](),controller[_0x3770('0x9')]);router[_0x3770('0x7')](_0x3770('0xa'),auth[_0x3770('0x8')](),controller[_0x3770('0xb')]);router[_0x3770('0xc')]('/',auth[_0x3770('0x8')](),controller[_0x3770('0xd')]);router[_0x3770('0xe')]('/:id',auth[_0x3770('0x8')](),controller['update']);router[_0x3770('0xf')]('/:id',auth[_0x3770('0x8')](),controller[_0x3770('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/crmNation/crmNation.attributes.js b/server/api/crmNation/crmNation.attributes.js index e6a62c2..933777d 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 _0xf8d5=['exports','STRING','name','isoCode2','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf8d5,0xcc));var _0x5f8d=function(_0x182ff2,_0x19f6f5){_0x182ff2=_0x182ff2-0x0;var _0x5f5c2b=_0xf8d5[_0x182ff2];return _0x5f5c2b;};'use strict';var Sequelize=require(_0x5f8d('0x0'));module[_0x5f8d('0x1')]={'name':{'type':Sequelize[_0x5f8d('0x2')],'allowNull':![],'unique':_0x5f8d('0x3')},'europe':{'type':Sequelize['BOOLEAN'],'allowNull':![]},'isoCode3':{'type':Sequelize[_0x5f8d('0x2')](0x3),'allowNull':![],'unique':'isoCode3'},'isoCode2':{'type':Sequelize[_0x5f8d('0x2')](0x2),'allowNull':![],'unique':_0x5f8d('0x4')}}; \ No newline at end of file +var _0x65f9=['exports','STRING','name','isoCode3','isoCode2','sequelize'];(function(_0x215f82,_0x123525){var _0x15475c=function(_0x11876b){while(--_0x11876b){_0x215f82['push'](_0x215f82['shift']());}};_0x15475c(++_0x123525);}(_0x65f9,0x19d));var _0x965f=function(_0x51a0b5,_0x29b10d){_0x51a0b5=_0x51a0b5-0x0;var _0x339860=_0x65f9[_0x51a0b5];return _0x339860;};'use strict';var Sequelize=require(_0x965f('0x0'));module[_0x965f('0x1')]={'name':{'type':Sequelize[_0x965f('0x2')],'allowNull':![],'unique':_0x965f('0x3')},'europe':{'type':Sequelize['BOOLEAN'],'allowNull':![]},'isoCode3':{'type':Sequelize['STRING'](0x3),'allowNull':![],'unique':_0x965f('0x4')},'isoCode2':{'type':Sequelize[_0x965f('0x2')](0x2),'allowNull':![],'unique':_0x965f('0x5')}}; \ No newline at end of file diff --git a/server/api/crmNation/crmNation.controller.js b/server/api/crmNation/crmNation.controller.js index fb4b63c..8b289ee 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 _0xa46e=['html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','end','stack','name','index','CrmNation','rawAttributes','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','map','type','key','field','filter','includeAll','include','findAll','rows','show','params','fields','options','catch','create','body'];(function(_0x3e0543,_0x75d60a){var _0x3efbad=function(_0x2414cf){while(--_0x2414cf){_0x3e0543['push'](_0x3e0543['shift']());}};_0x3efbad(++_0x75d60a);}(_0xa46e,0x8a));var _0xea46=function(_0x5d9867,_0x5e9030){_0x5d9867=_0x5d9867-0x0;var _0x7d2118=_0xa46e[_0x5d9867];return _0x7d2118;};'use strict';var pdf=require(_0xea46('0x0'));var emlformat=require(_0xea46('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xea46('0x2'));var jsonpatch=require(_0xea46('0x3'));var rp=require(_0xea46('0x4'));var moment=require('moment');var BPromise=require(_0xea46('0x5'));var Mustache=require('mustache');var util=require(_0xea46('0x6'));var path=require('path');var sox=require(_0xea46('0x7'));var csv=require('to-csv');var ejs=require(_0xea46('0x8'));var fs=require('fs');var _=require(_0xea46('0x9'));var squel=require('squel');var crypto=require(_0xea46('0xa'));var jsforce=require(_0xea46('0xb'));var deskjs=require(_0xea46('0xc'));var toCsv=require(_0xea46('0xd'));var querystring=require(_0xea46('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xea46('0xf'));var hardwareService=require(_0xea46('0x10'));var logger=require('../../config/logger')(_0xea46('0x11'));var utils=require(_0xea46('0x12'));var config=require(_0xea46('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa6d289,_0x38e83b){_0x38e83b=_0x38e83b||0xcc;return function(_0x4e10f3){if(_0x4e10f3){return _0xa6d289[_0xea46('0x14')](_0x38e83b);}return _0xa6d289[_0xea46('0x15')](_0x38e83b)['end']();};}function respondWithResult(_0x20955e,_0x4e4d3f){_0x4e4d3f=_0x4e4d3f||0xc8;return function(_0x3024af){if(_0x3024af){return _0x20955e[_0xea46('0x15')](_0x4e4d3f)[_0xea46('0x16')](_0x3024af);}};}function respondWithFilteredResult(_0x40bb42,_0xc76198){return function(_0x2ef436){if(_0x2ef436){var _0x81ee45=_0x2ef436[_0xea46('0x17')],_0x20a79c=_0xc76198[_0xea46('0x18')],_0x176ad2=_0xc76198[_0xea46('0x18')]+_0xc76198['limit'],_0x59e1ea;if(_0x176ad2>=_0x81ee45){_0x176ad2=_0x81ee45;_0x59e1ea=0xc8;}else{_0x59e1ea=0xce;}_0x40bb42['status'](_0x59e1ea);return _0x40bb42[_0xea46('0x19')](_0xea46('0x1a'),_0x20a79c+'-'+_0x176ad2+'/'+_0x81ee45)['json'](_0x2ef436);}return null;};}function patchUpdates(_0x4b6745){return function(_0x1932c4){try{jsonpatch[_0xea46('0x1b')](_0x1932c4,_0x4b6745,!![]);}catch(_0x4ff93d){return BPromise[_0xea46('0x1c')](_0x4ff93d);}return _0x1932c4[_0xea46('0x1d')]();};}function saveUpdates(_0x1adba1,_0x18ccea){return function(_0x53b8db){if(_0x53b8db){return _0x53b8db[_0xea46('0x1e')](_0x1adba1)['then'](function(_0x515e32){return _0x515e32;});}return null;};}function removeEntity(_0x1bc43e,_0x59e431){return function(_0x4cc673){if(_0x4cc673){return _0x4cc673['destroy']()[_0xea46('0x1f')](function(){_0x1bc43e[_0xea46('0x15')](0xcc)[_0xea46('0x20')]();});}};}function handleEntityNotFound(_0x5beb44,_0x16f8fa){return function(_0x59b10d){if(!_0x59b10d){_0x5beb44[_0xea46('0x14')](0x194);}return _0x59b10d;};}function handleError(_0x2008b0,_0x528eae){_0x528eae=_0x528eae||0x1f4;return function(_0xac33c3){logger['error'](_0xac33c3[_0xea46('0x21')]);if(_0xac33c3[_0xea46('0x22')]){delete _0xac33c3[_0xea46('0x22')];}_0x2008b0['status'](_0x528eae)['send'](_0xac33c3);};}exports[_0xea46('0x23')]=function(_0x38ac07,_0x4b369c){var _0x3b3928={'raw':!![]},_0x4999b0={},_0x11129d={'count':0x0,'rows':[]};var _0x51ca27=db[_0xea46('0x24')][_0xea46('0x25')];_0x4999b0[_0xea46('0x26')]=_[_0xea46('0x27')](_0x51ca27);_0x4999b0[_0xea46('0x28')]=_[_0xea46('0x27')](_0x38ac07['query']);_0x4999b0[_0xea46('0x29')]=_[_0xea46('0x2a')](_0x4999b0[_0xea46('0x26')],_0x4999b0['query']);_0x3b3928[_0xea46('0x2b')]=_[_0xea46('0x2a')](_0x4999b0[_0xea46('0x26')],qs['fields'](_0x38ac07['query']['fields']));_0x3b3928[_0xea46('0x2b')]=_0x3b3928[_0xea46('0x2b')][_0xea46('0x2c')]?_0x3b3928[_0xea46('0x2b')]:_0x4999b0[_0xea46('0x26')];if(!_0x38ac07[_0xea46('0x28')][_0xea46('0x2d')](_0xea46('0x2e'))){_0x3b3928[_0xea46('0x2f')]=qs[_0xea46('0x2f')](_0x38ac07[_0xea46('0x28')]['limit']);_0x3b3928[_0xea46('0x18')]=qs[_0xea46('0x18')](_0x38ac07[_0xea46('0x28')][_0xea46('0x18')]);}_0x3b3928[_0xea46('0x30')]=qs[_0xea46('0x31')](_0x38ac07[_0xea46('0x28')]['sort']);_0x3b3928[_0xea46('0x32')]=qs[_0xea46('0x29')](_[_0xea46('0x33')](_0x38ac07[_0xea46('0x28')],_0x4999b0[_0xea46('0x29')]));if(_0x38ac07['query']['filter']){_0x3b3928[_0xea46('0x32')]=_[_0xea46('0x34')](_0x3b3928['where'],{'$or':_[_0xea46('0x35')](_0x51ca27,function(_0x2de735){if(_0x2de735[_0xea46('0x36')][_0xea46('0x37')]!=='VIRTUAL'){var _0x4b9ca7={};_0x4b9ca7[_0x2de735[_0xea46('0x38')]]={'$like':'%'+_0x38ac07['query'][_0xea46('0x39')]+'%'};return _0x4b9ca7;}})});}_0x3b3928=_[_0xea46('0x34')]({},_0x3b3928,_0x38ac07['options']);var _0x1e61fd={'where':_0x3b3928[_0xea46('0x32')]};return db['CrmNation'][_0xea46('0x17')](_0x1e61fd)[_0xea46('0x1f')](function(_0x5f37f2){_0x11129d[_0xea46('0x17')]=_0x5f37f2;if(_0x38ac07[_0xea46('0x28')][_0xea46('0x3a')]){_0x3b3928[_0xea46('0x3b')]=[{'all':!![]}];}return db['CrmNation'][_0xea46('0x3c')](_0x3b3928);})[_0xea46('0x1f')](function(_0x338c2d){_0x11129d[_0xea46('0x3d')]=_0x338c2d;return _0x11129d;})[_0xea46('0x1f')](respondWithFilteredResult(_0x4b369c,_0x3b3928))['catch'](handleError(_0x4b369c,null));};exports[_0xea46('0x3e')]=function(_0xdb2e11,_0x4fb9eb){var _0x1206ac={'raw':!![],'where':{'id':_0xdb2e11[_0xea46('0x3f')]['id']}},_0x212baf={};_0x212baf[_0xea46('0x26')]=_['keys'](db[_0xea46('0x24')][_0xea46('0x25')]);_0x212baf[_0xea46('0x28')]=_['keys'](_0xdb2e11[_0xea46('0x28')]);_0x212baf[_0xea46('0x29')]=_[_0xea46('0x2a')](_0x212baf[_0xea46('0x26')],_0x212baf[_0xea46('0x28')]);_0x1206ac[_0xea46('0x2b')]=_[_0xea46('0x2a')](_0x212baf[_0xea46('0x26')],qs[_0xea46('0x40')](_0xdb2e11[_0xea46('0x28')][_0xea46('0x40')]));_0x1206ac[_0xea46('0x2b')]=_0x1206ac[_0xea46('0x2b')][_0xea46('0x2c')]?_0x1206ac[_0xea46('0x2b')]:_0x212baf['model'];if(_0xdb2e11['query'][_0xea46('0x3a')]){_0x1206ac[_0xea46('0x3b')]=[{'all':!![]}];}_0x1206ac=_[_0xea46('0x34')]({},_0x1206ac,_0xdb2e11[_0xea46('0x41')]);return db['CrmNation']['find'](_0x1206ac)['then'](handleEntityNotFound(_0x4fb9eb,null))[_0xea46('0x1f')](respondWithResult(_0x4fb9eb,null))[_0xea46('0x42')](handleError(_0x4fb9eb,null));};exports['create']=function(_0x25a278,_0x29caf0){return db[_0xea46('0x24')][_0xea46('0x43')](_0x25a278[_0xea46('0x44')],{})['then'](respondWithResult(_0x29caf0,0xc9))[_0xea46('0x42')](handleError(_0x29caf0,null));}; \ No newline at end of file +var _0xcd6f=['rows','catch','show','params','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','lodash','crypto','jsforce','papaparse','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','apply','reject','update','then','error','name','send','index','CrmNation','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','order','sort','where','filter','map','type','VIRTUAL','field','merge','options','count','includeAll','include'];(function(_0x3b5f5a,_0x1f70fe){var _0x408525=function(_0x52f504){while(--_0x52f504){_0x3b5f5a['push'](_0x3b5f5a['shift']());}};_0x408525(++_0x1f70fe);}(_0xcd6f,0x17b));var _0xfcd6=function(_0x10b95c,_0x134f5a){_0x10b95c=_0x10b95c-0x0;var _0x53fbf8=_0xcd6f[_0x10b95c];return _0x53fbf8;};'use strict';var pdf=require(_0xfcd6('0x0'));var emlformat=require(_0xfcd6('0x1'));var rimraf=require(_0xfcd6('0x2'));var zipdir=require(_0xfcd6('0x3'));var jsonpatch=require(_0xfcd6('0x4'));var rp=require(_0xfcd6('0x5'));var moment=require('moment');var BPromise=require(_0xfcd6('0x6'));var Mustache=require(_0xfcd6('0x7'));var util=require(_0xfcd6('0x8'));var path=require(_0xfcd6('0x9'));var sox=require('sox');var csv=require(_0xfcd6('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfcd6('0xb'));var squel=require('squel');var crypto=require(_0xfcd6('0xc'));var jsforce=require(_0xfcd6('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfcd6('0xa'));var querystring=require('querystring');var Papa=require(_0xfcd6('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xfcd6('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0xfcd6('0x10'));var config=require(_0xfcd6('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x391ea1,_0x28c0f2){_0x28c0f2=_0x28c0f2||0xcc;return function(_0xe02d34){if(_0xe02d34){return _0x391ea1[_0xfcd6('0x12')](_0x28c0f2);}return _0x391ea1[_0xfcd6('0x13')](_0x28c0f2)[_0xfcd6('0x14')]();};}function respondWithResult(_0x340477,_0x2508f2){_0x2508f2=_0x2508f2||0xc8;return function(_0xe8b658){if(_0xe8b658){return _0x340477[_0xfcd6('0x13')](_0x2508f2)[_0xfcd6('0x15')](_0xe8b658);}};}function respondWithFilteredResult(_0x2b4344,_0x241c7d){return function(_0x404cdb){if(_0x404cdb){var _0x47ff00=_0x404cdb['count'],_0x4da943=_0x241c7d[_0xfcd6('0x16')],_0xc53a5c=_0x241c7d[_0xfcd6('0x16')]+_0x241c7d[_0xfcd6('0x17')],_0x2ae7f4;if(_0xc53a5c>=_0x47ff00){_0xc53a5c=_0x47ff00;_0x2ae7f4=0xc8;}else{_0x2ae7f4=0xce;}_0x2b4344[_0xfcd6('0x13')](_0x2ae7f4);return _0x2b4344['set']('Content-Range',_0x4da943+'-'+_0xc53a5c+'/'+_0x47ff00)[_0xfcd6('0x15')](_0x404cdb);}return null;};}function patchUpdates(_0x12ca83){return function(_0x17bb38){try{jsonpatch[_0xfcd6('0x18')](_0x17bb38,_0x12ca83,!![]);}catch(_0x5969ca){return BPromise[_0xfcd6('0x19')](_0x5969ca);}return _0x17bb38['save']();};}function saveUpdates(_0x1176c6,_0x934caf){return function(_0x30a53b){if(_0x30a53b){return _0x30a53b[_0xfcd6('0x1a')](_0x1176c6)[_0xfcd6('0x1b')](function(_0x3affd6){return _0x3affd6;});}return null;};}function removeEntity(_0x29b9b8,_0x471758){return function(_0x44bbb3){if(_0x44bbb3){return _0x44bbb3['destroy']()[_0xfcd6('0x1b')](function(){_0x29b9b8['status'](0xcc)[_0xfcd6('0x14')]();});}};}function handleEntityNotFound(_0x173e7d,_0x47b880){return function(_0xdb56c7){if(!_0xdb56c7){_0x173e7d[_0xfcd6('0x12')](0x194);}return _0xdb56c7;};}function handleError(_0x23a6ca,_0x3fa274){_0x3fa274=_0x3fa274||0x1f4;return function(_0x62c7d5){logger[_0xfcd6('0x1c')](_0x62c7d5['stack']);if(_0x62c7d5[_0xfcd6('0x1d')]){delete _0x62c7d5['name'];}_0x23a6ca[_0xfcd6('0x13')](_0x3fa274)[_0xfcd6('0x1e')](_0x62c7d5);};}exports[_0xfcd6('0x1f')]=function(_0x1e3402,_0x54ca23){var _0x4af752={'raw':!![]},_0x57582a={},_0x570030={'count':0x0,'rows':[]};var _0x5e0d78=db[_0xfcd6('0x20')][_0xfcd6('0x21')];_0x57582a['model']=_['keys'](_0x5e0d78);_0x57582a[_0xfcd6('0x22')]=_[_0xfcd6('0x23')](_0x1e3402[_0xfcd6('0x22')]);_0x57582a[_0xfcd6('0x24')]=_[_0xfcd6('0x25')](_0x57582a[_0xfcd6('0x26')],_0x57582a['query']);_0x4af752[_0xfcd6('0x27')]=_[_0xfcd6('0x25')](_0x57582a[_0xfcd6('0x26')],qs[_0xfcd6('0x28')](_0x1e3402[_0xfcd6('0x22')]['fields']));_0x4af752['attributes']=_0x4af752[_0xfcd6('0x27')][_0xfcd6('0x29')]?_0x4af752[_0xfcd6('0x27')]:_0x57582a[_0xfcd6('0x26')];if(!_0x1e3402[_0xfcd6('0x22')]['hasOwnProperty']('nolimit')){_0x4af752[_0xfcd6('0x17')]=qs[_0xfcd6('0x17')](_0x1e3402['query'][_0xfcd6('0x17')]);_0x4af752[_0xfcd6('0x16')]=qs[_0xfcd6('0x16')](_0x1e3402[_0xfcd6('0x22')][_0xfcd6('0x16')]);}_0x4af752[_0xfcd6('0x2a')]=qs[_0xfcd6('0x2b')](_0x1e3402['query']['sort']);_0x4af752[_0xfcd6('0x2c')]=qs[_0xfcd6('0x24')](_['pick'](_0x1e3402['query'],_0x57582a['filters']));if(_0x1e3402[_0xfcd6('0x22')][_0xfcd6('0x2d')]){_0x4af752['where']=_['merge'](_0x4af752[_0xfcd6('0x2c')],{'$or':_[_0xfcd6('0x2e')](_0x5e0d78,function(_0x1d0478){if(_0x1d0478[_0xfcd6('0x2f')]['key']!==_0xfcd6('0x30')){var _0x160510={};_0x160510[_0x1d0478[_0xfcd6('0x31')]]={'$like':'%'+_0x1e3402[_0xfcd6('0x22')]['filter']+'%'};return _0x160510;}})});}_0x4af752=_[_0xfcd6('0x32')]({},_0x4af752,_0x1e3402[_0xfcd6('0x33')]);var _0x242dec={'where':_0x4af752[_0xfcd6('0x2c')]};return db[_0xfcd6('0x20')][_0xfcd6('0x34')](_0x242dec)['then'](function(_0x275707){_0x570030[_0xfcd6('0x34')]=_0x275707;if(_0x1e3402['query'][_0xfcd6('0x35')]){_0x4af752[_0xfcd6('0x36')]=[{'all':!![]}];}return db['CrmNation']['findAll'](_0x4af752);})[_0xfcd6('0x1b')](function(_0xddf9b8){_0x570030[_0xfcd6('0x37')]=_0xddf9b8;return _0x570030;})[_0xfcd6('0x1b')](respondWithFilteredResult(_0x54ca23,_0x4af752))[_0xfcd6('0x38')](handleError(_0x54ca23,null));};exports[_0xfcd6('0x39')]=function(_0x550efc,_0x3e890b){var _0x226b90={'raw':!![],'where':{'id':_0x550efc[_0xfcd6('0x3a')]['id']}},_0x4d8a07={};_0x4d8a07['model']=_['keys'](db[_0xfcd6('0x20')][_0xfcd6('0x21')]);_0x4d8a07[_0xfcd6('0x22')]=_[_0xfcd6('0x23')](_0x550efc[_0xfcd6('0x22')]);_0x4d8a07[_0xfcd6('0x24')]=_[_0xfcd6('0x25')](_0x4d8a07[_0xfcd6('0x26')],_0x4d8a07[_0xfcd6('0x22')]);_0x226b90[_0xfcd6('0x27')]=_[_0xfcd6('0x25')](_0x4d8a07['model'],qs[_0xfcd6('0x28')](_0x550efc[_0xfcd6('0x22')][_0xfcd6('0x28')]));_0x226b90['attributes']=_0x226b90['attributes'][_0xfcd6('0x29')]?_0x226b90[_0xfcd6('0x27')]:_0x4d8a07[_0xfcd6('0x26')];if(_0x550efc[_0xfcd6('0x22')][_0xfcd6('0x35')]){_0x226b90['include']=[{'all':!![]}];}_0x226b90=_[_0xfcd6('0x32')]({},_0x226b90,_0x550efc[_0xfcd6('0x33')]);return db['CrmNation'][_0xfcd6('0x3b')](_0x226b90)[_0xfcd6('0x1b')](handleEntityNotFound(_0x3e890b,null))[_0xfcd6('0x1b')](respondWithResult(_0x3e890b,null))['catch'](handleError(_0x3e890b,null));};exports['create']=function(_0x3e5ad0,_0x4ec74b){return db[_0xfcd6('0x20')][_0xfcd6('0x3c')](_0x3e5ad0[_0xfcd6('0x3d')],{})['then'](respondWithResult(_0x4ec74b,0xc9))[_0xfcd6('0x38')](handleError(_0x4ec74b,null));}; \ No newline at end of file diff --git a/server/api/crmNation/crmNation.model.js b/server/api/crmNation/crmNation.model.js index 9a14334..25a2ed0 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 _0x395a=['./crmNation.attributes','exports','define','CrmNation','crm_nations','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2d595f,_0xdfdb46){var _0x1e26a2=function(_0x17f26a){while(--_0x17f26a){_0x2d595f['push'](_0x2d595f['shift']());}};_0x1e26a2(++_0xdfdb46);}(_0x395a,0xd7));var _0xa395=function(_0x4e21ba,_0x18097f){_0x4e21ba=_0x4e21ba-0x0;var _0x55b94b=_0x395a[_0x4e21ba];return _0x55b94b;};'use strict';var _=require('lodash');var util=require(_0xa395('0x0'));var logger=require(_0xa395('0x1'))(_0xa395('0x2'));var moment=require(_0xa395('0x3'));var BPromise=require(_0xa395('0x4'));var rp=require(_0xa395('0x5'));var fs=require('fs');var path=require(_0xa395('0x6'));var rimraf=require(_0xa395('0x7'));var config=require(_0xa395('0x8'));var attributes=require(_0xa395('0x9'));module[_0xa395('0xa')]=function(_0x5b6bf2,_0x2f6c59){return _0x5b6bf2[_0xa395('0xb')](_0xa395('0xc'),attributes,{'tableName':_0xa395('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xffc4=['../../config/environment','exports','define','crm_nations','lodash','util','api','request-promise','path'];(function(_0x339fe1,_0x5e412d){var _0x460163=function(_0x5864e1){while(--_0x5864e1){_0x339fe1['push'](_0x339fe1['shift']());}};_0x460163(++_0x5e412d);}(_0xffc4,0xf7));var _0x4ffc=function(_0x2dbf0d,_0x51f951){_0x2dbf0d=_0x2dbf0d-0x0;var _0x34d44e=_0xffc4[_0x2dbf0d];return _0x34d44e;};'use strict';var _=require(_0x4ffc('0x0'));var util=require(_0x4ffc('0x1'));var logger=require('../../config/logger')(_0x4ffc('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4ffc('0x3'));var fs=require('fs');var path=require(_0x4ffc('0x4'));var rimraf=require('rimraf');var config=require(_0x4ffc('0x5'));var attributes=require('./crmNation.attributes');module[_0x4ffc('0x6')]=function(_0x117665,_0xe8d75c){return _0x117665[_0x4ffc('0x7')]('CrmNation',attributes,{'tableName':_0x4ffc('0x8'),'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 4a65b9e..b6ac88d 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 _0xe630=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CrmNation,\x20%s,\x20%s','request\x20sent','debug','CrmNation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird'];(function(_0x58b77c,_0x442fda){var _0x5a12e9=function(_0x5e188b){while(--_0x5e188b){_0x58b77c['push'](_0x58b77c['shift']());}};_0x5a12e9(++_0x442fda);}(_0xe630,0x64));var _0x0e63=function(_0x507110,_0x11f584){_0x507110=_0x507110-0x0;var _0x506a63=_0xe630[_0x507110];return _0x506a63;};'use strict';var _=require(_0x0e63('0x0'));var util=require(_0x0e63('0x1'));var moment=require(_0x0e63('0x2'));var BPromise=require(_0x0e63('0x3'));var rs=require(_0x0e63('0x4'));var fs=require('fs');var Redis=require(_0x0e63('0x5'));var db=require(_0x0e63('0x6'))['db'];var utils=require(_0x0e63('0x7'));var logger=require(_0x0e63('0x8'))(_0x0e63('0x9'));var config=require(_0x0e63('0xa'));var jayson=require(_0x0e63('0xb'));var client=jayson[_0x0e63('0xc')][_0x0e63('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5c36a4,_0x5b4464,_0x3dc60c){return new BPromise(function(_0x1f2e68,_0x3c1f62){return client[_0x0e63('0xe')](_0x5c36a4,_0x3dc60c)[_0x0e63('0xf')](function(_0xe7427e){logger['info'](_0x0e63('0x10'),_0x5b4464,_0x0e63('0x11'));logger[_0x0e63('0x12')](_0x0e63('0x13'),_0x5b4464,_0x0e63('0x11'),JSON[_0x0e63('0x14')](_0xe7427e));if(_0xe7427e[_0x0e63('0x15')]){if(_0xe7427e[_0x0e63('0x15')][_0x0e63('0x16')]===0x1f4){logger[_0x0e63('0x15')](_0x0e63('0x10'),_0x5b4464,_0xe7427e[_0x0e63('0x15')][_0x0e63('0x17')]);return _0x3c1f62(_0xe7427e[_0x0e63('0x15')]['message']);}logger[_0x0e63('0x15')]('CrmNation,\x20%s,\x20%s',_0x5b4464,_0xe7427e['error']['message']);return _0x1f2e68(_0xe7427e[_0x0e63('0x15')][_0x0e63('0x17')]);}else{logger[_0x0e63('0x18')](_0x0e63('0x10'),_0x5b4464,_0x0e63('0x11'));_0x1f2e68(_0xe7427e['result'][_0x0e63('0x17')]);}})[_0x0e63('0x19')](function(_0x963c0a){logger['error']('CrmNation,\x20%s,\x20%s',_0x5b4464,_0x963c0a);_0x3c1f62(_0x963c0a);});});} \ No newline at end of file +var _0x22fc=['util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','CrmNation,\x20%s,\x20%s','debug','CrmNation,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x22fc,0x99));var _0xc22f=function(_0x43ac33,_0x1a3c84){_0x43ac33=_0x43ac33-0x0;var _0x180a4c=_0x22fc[_0x43ac33];return _0x180a4c;};'use strict';var _=require(_0xc22f('0x0'));var util=require(_0xc22f('0x1'));var moment=require(_0xc22f('0x2'));var BPromise=require('bluebird');var rs=require(_0xc22f('0x3'));var fs=require('fs');var Redis=require(_0xc22f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc22f('0x5'));var logger=require(_0xc22f('0x6'))('rpc');var config=require(_0xc22f('0x7'));var jayson=require(_0xc22f('0x8'));var client=jayson[_0xc22f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x367e52,_0x1dc7a4,_0x1faae9){return new BPromise(function(_0xe68a0b,_0x53581b){return client[_0xc22f('0xa')](_0x367e52,_0x1faae9)[_0xc22f('0xb')](function(_0x53cce8){logger[_0xc22f('0xc')](_0xc22f('0xd'),_0x1dc7a4,'request\x20sent');logger[_0xc22f('0xe')](_0xc22f('0xf'),_0x1dc7a4,_0xc22f('0x10'),JSON['stringify'](_0x53cce8));if(_0x53cce8[_0xc22f('0x11')]){if(_0x53cce8[_0xc22f('0x11')][_0xc22f('0x12')]===0x1f4){logger[_0xc22f('0x11')](_0xc22f('0xd'),_0x1dc7a4,_0x53cce8[_0xc22f('0x11')][_0xc22f('0x13')]);return _0x53581b(_0x53cce8[_0xc22f('0x11')][_0xc22f('0x13')]);}logger[_0xc22f('0x11')]('CrmNation,\x20%s,\x20%s',_0x1dc7a4,_0x53cce8[_0xc22f('0x11')][_0xc22f('0x13')]);return _0xe68a0b(_0x53cce8[_0xc22f('0x11')]['message']);}else{logger[_0xc22f('0xc')](_0xc22f('0xd'),_0x1dc7a4,_0xc22f('0x10'));_0xe68a0b(_0x53cce8[_0xc22f('0x14')]['message']);}})[_0xc22f('0x15')](function(_0x3e7810){logger['error'](_0xc22f('0xd'),_0x1dc7a4,_0x3e7810);_0x53581b(_0x3e7810);});});} \ No newline at end of file diff --git a/server/api/crmNation/index.js b/server/api/crmNation/index.js index 8113e8c..5550b79 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 _0x7360=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./crmNation.controller','isAuthenticated','index','get','show','create','multer','util','path'];(function(_0x505f07,_0x2ba5cd){var _0x26326a=function(_0xd3471d){while(--_0xd3471d){_0x505f07['push'](_0x505f07['shift']());}};_0x26326a(++_0x2ba5cd);}(_0x7360,0x1ce));var _0x0736=function(_0x14cab1,_0x43bae7){_0x14cab1=_0x14cab1-0x0;var _0xb86221=_0x7360[_0x14cab1];return _0xb86221;};'use strict';var multer=require(_0x0736('0x0'));var util=require(_0x0736('0x1'));var path=require(_0x0736('0x2'));var timeout=require(_0x0736('0x3'));var express=require(_0x0736('0x4'));var router=express[_0x0736('0x5')]();var auth=require(_0x0736('0x6'));var interaction=require(_0x0736('0x7'));var config=require(_0x0736('0x8'));var controller=require(_0x0736('0x9'));router['get']('/',auth[_0x0736('0xa')](),controller[_0x0736('0xb')]);router[_0x0736('0xc')]('/:id',auth[_0x0736('0xa')](),controller[_0x0736('0xd')]);router['post']('/',auth[_0x0736('0xa')](),controller[_0x0736('0xe')]);module['exports']=router; \ No newline at end of file +var _0x137b=['isAuthenticated','create','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./crmNation.controller','get','show','post'];(function(_0x1f487d,_0x4b4e21){var _0x26e359=function(_0x194adf){while(--_0x194adf){_0x1f487d['push'](_0x1f487d['shift']());}};_0x26e359(++_0x4b4e21);}(_0x137b,0x1a7));var _0xb137=function(_0x16a101,_0x12caba){_0x16a101=_0x16a101-0x0;var _0x47b258=_0x137b[_0x16a101];return _0x47b258;};'use strict';var multer=require(_0xb137('0x0'));var util=require(_0xb137('0x1'));var path=require(_0xb137('0x2'));var timeout=require('connect-timeout');var express=require(_0xb137('0x3'));var router=express[_0xb137('0x4')]();var auth=require(_0xb137('0x5'));var interaction=require(_0xb137('0x6'));var config=require(_0xb137('0x7'));var controller=require(_0xb137('0x8'));router[_0xb137('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xb137('0xa')]);router[_0xb137('0xb')]('/',auth[_0xb137('0xc')](),controller[_0xb137('0xd')]);module[_0xb137('0xe')]=router; \ No newline at end of file diff --git a/server/api/crmTask/crmTask.attributes.js b/server/api/crmTask/crmTask.attributes.js index 2af4cfa..65a6ccc 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 _0x9362=['STRING','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9362,0x169));var _0x2936=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9362[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x2936('0x0'));module['exports']={'name':{'type':Sequelize[_0x2936('0x1')],'allowNull':![],'unique':'name'}}; \ No newline at end of file +var _0xb18c=['exports'];(function(_0x2ae69c,_0x268348){var _0x3d0b34=function(_0x2d96a8){while(--_0x2d96a8){_0x2ae69c['push'](_0x2ae69c['shift']());}};_0x3d0b34(++_0x268348);}(_0xb18c,0x102));var _0xcb18=function(_0x240955,_0x4b4bb0){_0x240955=_0x240955-0x0;var _0x5240c4=_0xb18c[_0x240955];return _0x5240c4;};'use strict';var Sequelize=require('sequelize');module[_0xcb18('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'}}; \ No newline at end of file diff --git a/server/api/crmTask/crmTask.controller.js b/server/api/crmTask/crmTask.controller.js index 70b8a61..b45062b 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 _0xfb5d=['rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../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','save','update','then','error','name','index','rawAttributes','model','keys','query','filters','fields','attributes','hasOwnProperty','nolimit','order','where','filter','merge','key','VIRTUAL','field','CrmTask','includeAll','include','findAll','rows','catch','params','intersection','length','options','find','create','body','describe','html-pdf'];(function(_0x22e667,_0x2a9fc7){var _0x57671a=function(_0x48558a){while(--_0x48558a){_0x22e667['push'](_0x22e667['shift']());}};_0x57671a(++_0x2a9fc7);}(_0xfb5d,0x1e2));var _0xdfb5=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xfb5d[_0xa464c9];return _0x3d73c4;};'use strict';var pdf=require(_0xdfb5('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xdfb5('0x1'));var zipdir=require(_0xdfb5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xdfb5('0x3'));var BPromise=require(_0xdfb5('0x4'));var Mustache=require('mustache');var util=require(_0xdfb5('0x5'));var path=require(_0xdfb5('0x6'));var sox=require(_0xdfb5('0x7'));var csv=require(_0xdfb5('0x8'));var ejs=require(_0xdfb5('0x9'));var fs=require('fs');var _=require(_0xdfb5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdfb5('0xb'));var deskjs=require(_0xdfb5('0xc'));var toCsv=require(_0xdfb5('0x8'));var querystring=require(_0xdfb5('0xd'));var Papa=require(_0xdfb5('0xe'));var Redis=require(_0xdfb5('0xf'));var authService=require(_0xdfb5('0x10'));var qs=require(_0xdfb5('0x11'));var hardwareService=require(_0xdfb5('0x12'));var logger=require(_0xdfb5('0x13'))(_0xdfb5('0x14'));var utils=require(_0xdfb5('0x15'));var config=require(_0xdfb5('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11b64d,_0x1c8fb7){_0x1c8fb7=_0x1c8fb7||0xcc;return function(_0x51de03){if(_0x51de03){return _0x11b64d[_0xdfb5('0x17')](_0x1c8fb7);}return _0x11b64d['status'](_0x1c8fb7)[_0xdfb5('0x18')]();};}function respondWithResult(_0x332dd9,_0x4f2476){_0x4f2476=_0x4f2476||0xc8;return function(_0x3bb996){if(_0x3bb996){return _0x332dd9[_0xdfb5('0x19')](_0x4f2476)['json'](_0x3bb996);}};}function respondWithFilteredResult(_0x5df160,_0x3b009d){return function(_0x2b82d9){if(_0x2b82d9){var _0x191098=_0x2b82d9[_0xdfb5('0x1a')],_0x4b87fc=_0x3b009d[_0xdfb5('0x1b')],_0x38c169=_0x3b009d[_0xdfb5('0x1b')]+_0x3b009d[_0xdfb5('0x1c')],_0x419303;if(_0x38c169>=_0x191098){_0x38c169=_0x191098;_0x419303=0xc8;}else{_0x419303=0xce;}_0x5df160[_0xdfb5('0x19')](_0x419303);return _0x5df160[_0xdfb5('0x1d')](_0xdfb5('0x1e'),_0x4b87fc+'-'+_0x38c169+'/'+_0x191098)[_0xdfb5('0x1f')](_0x2b82d9);}return null;};}function patchUpdates(_0x101a9f){return function(_0x4eff06){try{jsonpatch[_0xdfb5('0x20')](_0x4eff06,_0x101a9f,!![]);}catch(_0x4bc6d4){return BPromise['reject'](_0x4bc6d4);}return _0x4eff06[_0xdfb5('0x21')]();};}function saveUpdates(_0x4e6fb6,_0xcf45f3){return function(_0x308471){if(_0x308471){return _0x308471[_0xdfb5('0x22')](_0x4e6fb6)[_0xdfb5('0x23')](function(_0x481c6f){return _0x481c6f;});}return null;};}function removeEntity(_0x10ec2f,_0x299919){return function(_0x342380){if(_0x342380){return _0x342380['destroy']()[_0xdfb5('0x23')](function(){_0x10ec2f[_0xdfb5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d721f,_0x2547c9){return function(_0x1fe389){if(!_0x1fe389){_0x2d721f[_0xdfb5('0x17')](0x194);}return _0x1fe389;};}function handleError(_0x3aa085,_0x5d5433){_0x5d5433=_0x5d5433||0x1f4;return function(_0x4fd565){logger[_0xdfb5('0x24')](_0x4fd565['stack']);if(_0x4fd565[_0xdfb5('0x25')]){delete _0x4fd565[_0xdfb5('0x25')];}_0x3aa085['status'](_0x5d5433)['send'](_0x4fd565);};}exports[_0xdfb5('0x26')]=function(_0x188150,_0x112ab5){var _0x3efed9={},_0x534d1d={},_0x107a41={'count':0x0,'rows':[]};var _0xc48b4b=db['CrmTask'][_0xdfb5('0x27')];_0x534d1d[_0xdfb5('0x28')]=_[_0xdfb5('0x29')](_0xc48b4b);_0x534d1d[_0xdfb5('0x2a')]=_[_0xdfb5('0x29')](_0x188150['query']);_0x534d1d[_0xdfb5('0x2b')]=_['intersection'](_0x534d1d[_0xdfb5('0x28')],_0x534d1d[_0xdfb5('0x2a')]);_0x3efed9['attributes']=_['intersection'](_0x534d1d['model'],qs[_0xdfb5('0x2c')](_0x188150['query'][_0xdfb5('0x2c')]));_0x3efed9[_0xdfb5('0x2d')]=_0x3efed9[_0xdfb5('0x2d')]['length']?_0x3efed9[_0xdfb5('0x2d')]:_0x534d1d[_0xdfb5('0x28')];if(!_0x188150[_0xdfb5('0x2a')][_0xdfb5('0x2e')](_0xdfb5('0x2f'))){_0x3efed9[_0xdfb5('0x1c')]=qs[_0xdfb5('0x1c')](_0x188150[_0xdfb5('0x2a')]['limit']);_0x3efed9['offset']=qs[_0xdfb5('0x1b')](_0x188150['query']['offset']);}_0x3efed9[_0xdfb5('0x30')]=qs['sort'](_0x188150[_0xdfb5('0x2a')]['sort']);_0x3efed9[_0xdfb5('0x31')]=qs[_0xdfb5('0x2b')](_['pick'](_0x188150['query'],_0x534d1d[_0xdfb5('0x2b')]));if(_0x188150['query'][_0xdfb5('0x32')]){_0x3efed9[_0xdfb5('0x31')]=_[_0xdfb5('0x33')](_0x3efed9[_0xdfb5('0x31')],{'$or':_['map'](_0xc48b4b,function(_0x19763f){if(_0x19763f['type'][_0xdfb5('0x34')]!==_0xdfb5('0x35')){var _0x4858e2={};_0x4858e2[_0x19763f[_0xdfb5('0x36')]]={'$like':'%'+_0x188150[_0xdfb5('0x2a')][_0xdfb5('0x32')]+'%'};return _0x4858e2;}})});}_0x3efed9=_[_0xdfb5('0x33')]({},_0x3efed9,_0x188150['options']);var _0x20d8a4={'where':_0x3efed9[_0xdfb5('0x31')]};return db[_0xdfb5('0x37')][_0xdfb5('0x1a')](_0x20d8a4)[_0xdfb5('0x23')](function(_0x4aebf2){_0x107a41[_0xdfb5('0x1a')]=_0x4aebf2;if(_0x188150[_0xdfb5('0x2a')][_0xdfb5('0x38')]){_0x3efed9[_0xdfb5('0x39')]=[{'all':!![]}];}return db[_0xdfb5('0x37')][_0xdfb5('0x3a')](_0x3efed9);})[_0xdfb5('0x23')](function(_0x25e454){_0x107a41[_0xdfb5('0x3b')]=_0x25e454;return _0x107a41;})[_0xdfb5('0x23')](respondWithFilteredResult(_0x112ab5,_0x3efed9))[_0xdfb5('0x3c')](handleError(_0x112ab5,null));};exports['show']=function(_0x37fcaf,_0x133937){var _0x131f71={'raw':![],'where':{'id':_0x37fcaf[_0xdfb5('0x3d')]['id']}},_0x336c76={};_0x336c76[_0xdfb5('0x28')]=_[_0xdfb5('0x29')](db[_0xdfb5('0x37')][_0xdfb5('0x27')]);_0x336c76[_0xdfb5('0x2a')]=_[_0xdfb5('0x29')](_0x37fcaf[_0xdfb5('0x2a')]);_0x336c76[_0xdfb5('0x2b')]=_[_0xdfb5('0x3e')](_0x336c76['model'],_0x336c76[_0xdfb5('0x2a')]);_0x131f71[_0xdfb5('0x2d')]=_[_0xdfb5('0x3e')](_0x336c76['model'],qs['fields'](_0x37fcaf[_0xdfb5('0x2a')][_0xdfb5('0x2c')]));_0x131f71[_0xdfb5('0x2d')]=_0x131f71[_0xdfb5('0x2d')][_0xdfb5('0x3f')]?_0x131f71['attributes']:_0x336c76['model'];if(_0x37fcaf[_0xdfb5('0x2a')][_0xdfb5('0x38')]){_0x131f71[_0xdfb5('0x39')]=[{'all':!![]}];}_0x131f71=_['merge']({},_0x131f71,_0x37fcaf[_0xdfb5('0x40')]);return db[_0xdfb5('0x37')][_0xdfb5('0x41')](_0x131f71)['then'](handleEntityNotFound(_0x133937,null))['then'](respondWithResult(_0x133937,null))[_0xdfb5('0x3c')](handleError(_0x133937,null));};exports[_0xdfb5('0x42')]=function(_0x19c69f,_0x5ee587){return db[_0xdfb5('0x37')][_0xdfb5('0x42')](_0x19c69f[_0xdfb5('0x43')],{})[_0xdfb5('0x23')](respondWithResult(_0x5ee587,0xc9))[_0xdfb5('0x3c')](handleError(_0x5ee587,null));};exports[_0xdfb5('0x22')]=function(_0x1528ae,_0x8ffd1c){if(_0x1528ae['body']['id']){delete _0x1528ae[_0xdfb5('0x43')]['id'];}return db[_0xdfb5('0x37')][_0xdfb5('0x41')]({'where':{'id':_0x1528ae[_0xdfb5('0x3d')]['id']}})[_0xdfb5('0x23')](handleEntityNotFound(_0x8ffd1c,null))['then'](saveUpdates(_0x1528ae[_0xdfb5('0x43')],null))[_0xdfb5('0x23')](respondWithResult(_0x8ffd1c,null))[_0xdfb5('0x3c')](handleError(_0x8ffd1c,null));};exports['destroy']=function(_0x1f81f3,_0xd125ea){return db['CrmTask']['find']({'where':{'id':_0x1f81f3[_0xdfb5('0x3d')]['id']}})['then'](handleEntityNotFound(_0xd125ea,null))[_0xdfb5('0x23')](removeEntity(_0xd125ea,null))[_0xdfb5('0x3c')](handleError(_0xd125ea,null));};exports[_0xdfb5('0x44')]=function(_0x18b9b9,_0x1b8ebf){return db['CrmTask']['describe']()[_0xdfb5('0x23')](respondWithResult(_0x1b8ebf,null))[_0xdfb5('0x3c')](handleError(_0x1b8ebf,null));}; \ No newline at end of file +var _0xb4db=['status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','CrmTask','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','key','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus'];(function(_0x271688,_0x3be140){var _0x37c1fa=function(_0x4340c8){while(--_0x4340c8){_0x271688['push'](_0x271688['shift']());}};_0x37c1fa(++_0x3be140);}(_0xb4db,0x159));var _0xbb4d=function(_0x1c9a32,_0x51cd51){_0x1c9a32=_0x1c9a32-0x0;var _0xd96a15=_0xb4db[_0x1c9a32];return _0xd96a15;};'use strict';var pdf=require(_0xbb4d('0x0'));var emlformat=require(_0xbb4d('0x1'));var rimraf=require(_0xbb4d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbb4d('0x3'));var rp=require(_0xbb4d('0x4'));var moment=require(_0xbb4d('0x5'));var BPromise=require(_0xbb4d('0x6'));var Mustache=require(_0xbb4d('0x7'));var util=require(_0xbb4d('0x8'));var path=require(_0xbb4d('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbb4d('0xa'));var fs=require('fs');var _=require(_0xbb4d('0xb'));var squel=require(_0xbb4d('0xc'));var crypto=require(_0xbb4d('0xd'));var jsforce=require(_0xbb4d('0xe'));var deskjs=require(_0xbb4d('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbb4d('0x10'));var Redis=require(_0xbb4d('0x11'));var authService=require(_0xbb4d('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xbb4d('0x13'));var logger=require(_0xbb4d('0x14'))(_0xbb4d('0x15'));var utils=require('../../config/utils');var config=require(_0xbb4d('0x16'));var db=require(_0xbb4d('0x17'))['db'];function respondWithStatusCode(_0xfe70ee,_0x3e8b75){_0x3e8b75=_0x3e8b75||0xcc;return function(_0x15053a){if(_0x15053a){return _0xfe70ee[_0xbb4d('0x18')](_0x3e8b75);}return _0xfe70ee[_0xbb4d('0x19')](_0x3e8b75)[_0xbb4d('0x1a')]();};}function respondWithResult(_0x48bb44,_0x7ad171){_0x7ad171=_0x7ad171||0xc8;return function(_0x452745){if(_0x452745){return _0x48bb44[_0xbb4d('0x19')](_0x7ad171)[_0xbb4d('0x1b')](_0x452745);}};}function respondWithFilteredResult(_0x37ff1b,_0x13a57c){return function(_0x34126f){if(_0x34126f){var _0x57fe38=_0x34126f[_0xbb4d('0x1c')],_0x59a59b=_0x13a57c[_0xbb4d('0x1d')],_0x36f55d=_0x13a57c[_0xbb4d('0x1d')]+_0x13a57c[_0xbb4d('0x1e')],_0x171455;if(_0x36f55d>=_0x57fe38){_0x36f55d=_0x57fe38;_0x171455=0xc8;}else{_0x171455=0xce;}_0x37ff1b[_0xbb4d('0x19')](_0x171455);return _0x37ff1b['set'](_0xbb4d('0x1f'),_0x59a59b+'-'+_0x36f55d+'/'+_0x57fe38)[_0xbb4d('0x1b')](_0x34126f);}return null;};}function patchUpdates(_0x3c88ff){return function(_0x1aeb2a){try{jsonpatch[_0xbb4d('0x20')](_0x1aeb2a,_0x3c88ff,!![]);}catch(_0x5be3bb){return BPromise[_0xbb4d('0x21')](_0x5be3bb);}return _0x1aeb2a[_0xbb4d('0x22')]();};}function saveUpdates(_0x55cb8d,_0x2b6004){return function(_0x253de9){if(_0x253de9){return _0x253de9[_0xbb4d('0x23')](_0x55cb8d)[_0xbb4d('0x24')](function(_0x2df3ff){return _0x2df3ff;});}return null;};}function removeEntity(_0x4b95d7,_0x350b92){return function(_0x1ca368){if(_0x1ca368){return _0x1ca368[_0xbb4d('0x25')]()[_0xbb4d('0x24')](function(){_0x4b95d7[_0xbb4d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2edd96,_0x710252){return function(_0x3c7a8c){if(!_0x3c7a8c){_0x2edd96[_0xbb4d('0x18')](0x194);}return _0x3c7a8c;};}function handleError(_0x431e66,_0x593088){_0x593088=_0x593088||0x1f4;return function(_0x2df557){logger[_0xbb4d('0x26')](_0x2df557[_0xbb4d('0x27')]);if(_0x2df557[_0xbb4d('0x28')]){delete _0x2df557['name'];}_0x431e66[_0xbb4d('0x19')](_0x593088)['send'](_0x2df557);};}exports[_0xbb4d('0x29')]=function(_0xce7bb9,_0x15eca4){var _0x48392a={},_0x488af9={},_0x29696c={'count':0x0,'rows':[]};var _0x5b5a11=db[_0xbb4d('0x2a')]['rawAttributes'];_0x488af9[_0xbb4d('0x2b')]=_[_0xbb4d('0x2c')](_0x5b5a11);_0x488af9['query']=_['keys'](_0xce7bb9[_0xbb4d('0x2d')]);_0x488af9[_0xbb4d('0x2e')]=_[_0xbb4d('0x2f')](_0x488af9['model'],_0x488af9[_0xbb4d('0x2d')]);_0x48392a[_0xbb4d('0x30')]=_['intersection'](_0x488af9[_0xbb4d('0x2b')],qs[_0xbb4d('0x31')](_0xce7bb9[_0xbb4d('0x2d')][_0xbb4d('0x31')]));_0x48392a[_0xbb4d('0x30')]=_0x48392a[_0xbb4d('0x30')][_0xbb4d('0x32')]?_0x48392a[_0xbb4d('0x30')]:_0x488af9[_0xbb4d('0x2b')];if(!_0xce7bb9['query'][_0xbb4d('0x33')](_0xbb4d('0x34'))){_0x48392a[_0xbb4d('0x1e')]=qs[_0xbb4d('0x1e')](_0xce7bb9[_0xbb4d('0x2d')][_0xbb4d('0x1e')]);_0x48392a[_0xbb4d('0x1d')]=qs['offset'](_0xce7bb9[_0xbb4d('0x2d')][_0xbb4d('0x1d')]);}_0x48392a[_0xbb4d('0x35')]=qs[_0xbb4d('0x36')](_0xce7bb9[_0xbb4d('0x2d')][_0xbb4d('0x36')]);_0x48392a[_0xbb4d('0x37')]=qs['filters'](_['pick'](_0xce7bb9[_0xbb4d('0x2d')],_0x488af9['filters']));if(_0xce7bb9[_0xbb4d('0x2d')][_0xbb4d('0x38')]){_0x48392a[_0xbb4d('0x37')]=_[_0xbb4d('0x39')](_0x48392a[_0xbb4d('0x37')],{'$or':_[_0xbb4d('0x3a')](_0x5b5a11,function(_0x1bc516){if(_0x1bc516[_0xbb4d('0x3b')][_0xbb4d('0x3c')]!=='VIRTUAL'){var _0x240805={};_0x240805[_0x1bc516['field']]={'$like':'%'+_0xce7bb9[_0xbb4d('0x2d')][_0xbb4d('0x38')]+'%'};return _0x240805;}})});}_0x48392a=_[_0xbb4d('0x39')]({},_0x48392a,_0xce7bb9[_0xbb4d('0x3d')]);var _0x1e62c8={'where':_0x48392a[_0xbb4d('0x37')]};return db['CrmTask'][_0xbb4d('0x1c')](_0x1e62c8)[_0xbb4d('0x24')](function(_0x913e1){_0x29696c[_0xbb4d('0x1c')]=_0x913e1;if(_0xce7bb9[_0xbb4d('0x2d')][_0xbb4d('0x3e')]){_0x48392a[_0xbb4d('0x3f')]=[{'all':!![]}];}return db[_0xbb4d('0x2a')][_0xbb4d('0x40')](_0x48392a);})[_0xbb4d('0x24')](function(_0x2cf595){_0x29696c[_0xbb4d('0x41')]=_0x2cf595;return _0x29696c;})[_0xbb4d('0x24')](respondWithFilteredResult(_0x15eca4,_0x48392a))[_0xbb4d('0x42')](handleError(_0x15eca4,null));};exports[_0xbb4d('0x43')]=function(_0x4bccd6,_0x2153b9){var _0x128208={'raw':![],'where':{'id':_0x4bccd6[_0xbb4d('0x44')]['id']}},_0x105297={};_0x105297['model']=_['keys'](db['CrmTask'][_0xbb4d('0x45')]);_0x105297[_0xbb4d('0x2d')]=_[_0xbb4d('0x2c')](_0x4bccd6[_0xbb4d('0x2d')]);_0x105297['filters']=_[_0xbb4d('0x2f')](_0x105297[_0xbb4d('0x2b')],_0x105297[_0xbb4d('0x2d')]);_0x128208[_0xbb4d('0x30')]=_[_0xbb4d('0x2f')](_0x105297[_0xbb4d('0x2b')],qs['fields'](_0x4bccd6['query'][_0xbb4d('0x31')]));_0x128208[_0xbb4d('0x30')]=_0x128208[_0xbb4d('0x30')][_0xbb4d('0x32')]?_0x128208[_0xbb4d('0x30')]:_0x105297['model'];if(_0x4bccd6['query'][_0xbb4d('0x3e')]){_0x128208[_0xbb4d('0x3f')]=[{'all':!![]}];}_0x128208=_['merge']({},_0x128208,_0x4bccd6['options']);return db[_0xbb4d('0x2a')]['find'](_0x128208)[_0xbb4d('0x24')](handleEntityNotFound(_0x2153b9,null))[_0xbb4d('0x24')](respondWithResult(_0x2153b9,null))['catch'](handleError(_0x2153b9,null));};exports[_0xbb4d('0x46')]=function(_0x50bbd2,_0x167286){return db[_0xbb4d('0x2a')][_0xbb4d('0x46')](_0x50bbd2[_0xbb4d('0x47')],{})[_0xbb4d('0x24')](respondWithResult(_0x167286,0xc9))[_0xbb4d('0x42')](handleError(_0x167286,null));};exports['update']=function(_0x4518ea,_0x364bae){if(_0x4518ea['body']['id']){delete _0x4518ea[_0xbb4d('0x47')]['id'];}return db['CrmTask'][_0xbb4d('0x48')]({'where':{'id':_0x4518ea[_0xbb4d('0x44')]['id']}})[_0xbb4d('0x24')](handleEntityNotFound(_0x364bae,null))[_0xbb4d('0x24')](saveUpdates(_0x4518ea[_0xbb4d('0x47')],null))[_0xbb4d('0x24')](respondWithResult(_0x364bae,null))[_0xbb4d('0x42')](handleError(_0x364bae,null));};exports[_0xbb4d('0x25')]=function(_0xd153c,_0x282455){return db[_0xbb4d('0x2a')][_0xbb4d('0x48')]({'where':{'id':_0xd153c[_0xbb4d('0x44')]['id']}})['then'](handleEntityNotFound(_0x282455,null))[_0xbb4d('0x24')](removeEntity(_0x282455,null))[_0xbb4d('0x42')](handleError(_0x282455,null));};exports[_0xbb4d('0x49')]=function(_0x3cfbf7,_0x2f304b){return db[_0xbb4d('0x2a')][_0xbb4d('0x49')]()['then'](respondWithResult(_0x2f304b,null))[_0xbb4d('0x42')](handleError(_0x2f304b,null));}; \ No newline at end of file diff --git a/server/api/crmTask/crmTask.model.js b/server/api/crmTask/crmTask.model.js index a0c89d4..4d7861b 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 _0x5b02=['define','CrmTask','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./crmTask.attributes','exports'];(function(_0x5dc81f,_0x454cf5){var _0x22a2fa=function(_0x2cc2e7){while(--_0x2cc2e7){_0x5dc81f['push'](_0x5dc81f['shift']());}};_0x22a2fa(++_0x454cf5);}(_0x5b02,0xe9));var _0x25b0=function(_0x3f6e31,_0x3f5269){_0x3f6e31=_0x3f6e31-0x0;var _0x1f5ca2=_0x5b02[_0x3f6e31];return _0x1f5ca2;};'use strict';var _=require(_0x25b0('0x0'));var util=require(_0x25b0('0x1'));var logger=require(_0x25b0('0x2'))(_0x25b0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x25b0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x25b0('0x5'));var config=require(_0x25b0('0x6'));var attributes=require(_0x25b0('0x7'));module[_0x25b0('0x8')]=function(_0x2d84a9,_0x4eea55){return _0x2d84a9[_0x25b0('0x9')](_0x25b0('0xa'),attributes,{'tableName':'crm_tasks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf109=['CrmTask','crm_tasks','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./crmTask.attributes','exports','define'];(function(_0x4f8fc3,_0x407a18){var _0x41d50c=function(_0x5d7b8b){while(--_0x5d7b8b){_0x4f8fc3['push'](_0x4f8fc3['shift']());}};_0x41d50c(++_0x407a18);}(_0xf109,0xce));var _0x9f10=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xf109[_0x82129b];return _0x2ae5dc;};'use strict';var _=require(_0x9f10('0x0'));var util=require(_0x9f10('0x1'));var logger=require(_0x9f10('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9f10('0x3'));var fs=require('fs');var path=require(_0x9f10('0x4'));var rimraf=require(_0x9f10('0x5'));var config=require(_0x9f10('0x6'));var attributes=require(_0x9f10('0x7'));module[_0x9f10('0x8')]=function(_0x408fe8,_0xd3137b){return _0x408fe8[_0x9f10('0x9')](_0x9f10('0xa'),attributes,{'tableName':_0x9f10('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 46749cd..bce661f 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 _0x6575=['jayson/promise','client','http','request','then','info','CrmTask,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0xc79fe9,_0x223fb6){var _0x20bf90=function(_0x2a2e5f){while(--_0x2a2e5f){_0xc79fe9['push'](_0xc79fe9['shift']());}};_0x20bf90(++_0x223fb6);}(_0x6575,0x120));var _0x5657=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x6575[_0x2e4aa2];return _0x5e6092;};'use strict';var _=require(_0x5657('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5657('0x1'));var db=require(_0x5657('0x2'))['db'];var utils=require(_0x5657('0x3'));var logger=require(_0x5657('0x4'))('rpc');var config=require(_0x5657('0x5'));var jayson=require(_0x5657('0x6'));var client=jayson[_0x5657('0x7')][_0x5657('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x90bc86,_0x14d14c,_0x2369bc){return new BPromise(function(_0x45a062,_0x4fce24){return client[_0x5657('0x9')](_0x90bc86,_0x2369bc)[_0x5657('0xa')](function(_0x28b90c){logger[_0x5657('0xb')](_0x5657('0xc'),_0x14d14c,'request\x20sent');logger[_0x5657('0xd')]('CrmTask,\x20%s,\x20%s,\x20%s',_0x14d14c,_0x5657('0xe'),JSON[_0x5657('0xf')](_0x28b90c));if(_0x28b90c['error']){if(_0x28b90c['error'][_0x5657('0x10')]===0x1f4){logger['error'](_0x5657('0xc'),_0x14d14c,_0x28b90c[_0x5657('0x11')][_0x5657('0x12')]);return _0x4fce24(_0x28b90c[_0x5657('0x11')]['message']);}logger['error'](_0x5657('0xc'),_0x14d14c,_0x28b90c['error'][_0x5657('0x12')]);return _0x45a062(_0x28b90c[_0x5657('0x11')][_0x5657('0x12')]);}else{logger[_0x5657('0xb')](_0x5657('0xc'),_0x14d14c,_0x5657('0xe'));_0x45a062(_0x28b90c[_0x5657('0x13')][_0x5657('0x12')]);}})[_0x5657('0x14')](function(_0x1cc541){logger[_0x5657('0x11')](_0x5657('0xc'),_0x14d14c,_0x1cc541);_0x4fce24(_0x1cc541);});});} \ No newline at end of file +var _0x8251=['client','http','request','then','info','CrmTask,\x20%s,\x20%s','request\x20sent','debug','CrmTask,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x46cc9e,_0x51a09c){var _0x2afb41=function(_0x5ce282){while(--_0x5ce282){_0x46cc9e['push'](_0x46cc9e['shift']());}};_0x2afb41(++_0x51a09c);}(_0x8251,0x19f));var _0x1825=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x8251[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require(_0x1825('0x0'));var moment=require(_0x1825('0x1'));var BPromise=require(_0x1825('0x2'));var rs=require(_0x1825('0x3'));var fs=require('fs');var Redis=require(_0x1825('0x4'));var db=require(_0x1825('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1825('0x6'))(_0x1825('0x7'));var config=require(_0x1825('0x8'));var jayson=require(_0x1825('0x9'));var client=jayson[_0x1825('0xa')][_0x1825('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b4b09,_0x43754d,_0x524c86){return new BPromise(function(_0x5ceff3,_0x49ee2d){return client[_0x1825('0xc')](_0x4b4b09,_0x524c86)[_0x1825('0xd')](function(_0x28be11){logger[_0x1825('0xe')](_0x1825('0xf'),_0x43754d,_0x1825('0x10'));logger[_0x1825('0x11')](_0x1825('0x12'),_0x43754d,_0x1825('0x10'),JSON[_0x1825('0x13')](_0x28be11));if(_0x28be11['error']){if(_0x28be11[_0x1825('0x14')][_0x1825('0x15')]===0x1f4){logger[_0x1825('0x14')](_0x1825('0xf'),_0x43754d,_0x28be11[_0x1825('0x14')]['message']);return _0x49ee2d(_0x28be11['error'][_0x1825('0x16')]);}logger['error'](_0x1825('0xf'),_0x43754d,_0x28be11[_0x1825('0x14')]['message']);return _0x5ceff3(_0x28be11['error'][_0x1825('0x16')]);}else{logger['info'](_0x1825('0xf'),_0x43754d,_0x1825('0x10'));_0x5ceff3(_0x28be11[_0x1825('0x17')][_0x1825('0x16')]);}})[_0x1825('0x18')](function(_0xe53d4a){logger[_0x1825('0x14')](_0x1825('0xf'),_0x43754d,_0xe53d4a);_0x49ee2d(_0xe53d4a);});});} \ No newline at end of file diff --git a/server/api/crmTask/index.js b/server/api/crmTask/index.js index 415aa74..ba917dc 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 _0x361b=['../../components/auth/service','../../components/interaction/service','../../config/environment','./crmTask.controller','index','get','/describe','describe','/:id','isAuthenticated','show','post','create','delete','destroy','multer','util','path','connect-timeout','Router'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x361b,0x113));var _0xb361=function(_0x29ef84,_0x25e029){_0x29ef84=_0x29ef84-0x0;var _0x281074=_0x361b[_0x29ef84];return _0x281074;};'use strict';var multer=require(_0xb361('0x0'));var util=require(_0xb361('0x1'));var path=require(_0xb361('0x2'));var timeout=require(_0xb361('0x3'));var express=require('express');var router=express[_0xb361('0x4')]();var auth=require(_0xb361('0x5'));var interaction=require(_0xb361('0x6'));var config=require(_0xb361('0x7'));var controller=require(_0xb361('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xb361('0x9')]);router[_0xb361('0xa')](_0xb361('0xb'),auth['isAuthenticated'](),controller[_0xb361('0xc')]);router[_0xb361('0xa')](_0xb361('0xd'),auth[_0xb361('0xe')](),controller[_0xb361('0xf')]);router[_0xb361('0x10')]('/',auth[_0xb361('0xe')](),controller[_0xb361('0x11')]);router['put'](_0xb361('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xb361('0x12')](_0xb361('0xd'),auth[_0xb361('0xe')](),controller[_0xb361('0x13')]);module['exports']=router; \ No newline at end of file +var _0x74f5=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./crmTask.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','delete','destroy','util','path'];(function(_0x2cb951,_0x39fe4d){var _0x227d5e=function(_0x2b9bb4){while(--_0x2b9bb4){_0x2cb951['push'](_0x2cb951['shift']());}};_0x227d5e(++_0x39fe4d);}(_0x74f5,0xa6));var _0x574f=function(_0xa9db74,_0x45e441){_0xa9db74=_0xa9db74-0x0;var _0x3c8d7a=_0x74f5[_0xa9db74];return _0x3c8d7a;};'use strict';var multer=require('multer');var util=require(_0x574f('0x0'));var path=require(_0x574f('0x1'));var timeout=require(_0x574f('0x2'));var express=require(_0x574f('0x3'));var router=express['Router']();var auth=require(_0x574f('0x4'));var interaction=require(_0x574f('0x5'));var config=require(_0x574f('0x6'));var controller=require(_0x574f('0x7'));router['get']('/',auth[_0x574f('0x8')](),controller[_0x574f('0x9')]);router[_0x574f('0xa')](_0x574f('0xb'),auth[_0x574f('0x8')](),controller[_0x574f('0xc')]);router[_0x574f('0xa')](_0x574f('0xd'),auth['isAuthenticated'](),controller[_0x574f('0xe')]);router[_0x574f('0xf')]('/',auth[_0x574f('0x8')](),controller[_0x574f('0x10')]);router[_0x574f('0x11')](_0x574f('0xd'),auth['isAuthenticated'](),controller[_0x574f('0x12')]);router[_0x574f('0x13')]('/:id',auth[_0x574f('0x8')](),controller[_0x574f('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/crmWorkflow/crmWorkflow.attributes.js b/server/api/crmWorkflow/crmWorkflow.attributes.js index 3627286..59caae9 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 _0x0f4c=['SalesAid','sequelize','exports','name','ENUM','CRM'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x0f4c,0xdf));var _0xc0f4=function(_0x1ca9e9,_0x1c4391){_0x1ca9e9=_0x1ca9e9-0x0;var _0x309f3c=_0x0f4c[_0x1ca9e9];return _0x309f3c;};'use strict';var Sequelize=require(_0xc0f4('0x0'));module[_0xc0f4('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc0f4('0x2')},'type':{'type':Sequelize[_0xc0f4('0x3')](_0xc0f4('0x4'),_0xc0f4('0x5'),'Free'),'allowNull':![]}}; \ No newline at end of file +var _0x8f2a=['Free','exports','STRING','ENUM','SalesAid'];(function(_0x1bf9f5,_0x34f171){var _0x549186=function(_0x2d5cbc){while(--_0x2d5cbc){_0x1bf9f5['push'](_0x1bf9f5['shift']());}};_0x549186(++_0x34f171);}(_0x8f2a,0x1b9));var _0xa8f2=function(_0x4e11d5,_0x1ce514){_0x4e11d5=_0x4e11d5-0x0;var _0x5e4e4c=_0x8f2a[_0x4e11d5];return _0x5e4e4c;};'use strict';var Sequelize=require('sequelize');module[_0xa8f2('0x0')]={'name':{'type':Sequelize[_0xa8f2('0x1')],'allowNull':![],'unique':'name'},'type':{'type':Sequelize[_0xa8f2('0x2')]('CRM',_0xa8f2('0x3'),_0xa8f2('0x4')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/crmWorkflow/crmWorkflow.controller.js b/server/api/crmWorkflow/crmWorkflow.controller.js index 8a137ba..21cd335 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 _0x949a=['save','update','destroy','then','error','stack','name','send','index','CrmWorkflow','rawAttributes','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','offset','order','sort','where','filters','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','CrmWorkflowStep','CrmTask','CrmActionsList','CrmWorkflowNextStep','findAll','rows','catch','show','params','length','find','create','body','describe','eml-format','rimraf','zip-dir','bluebird','mustache','path','to-csv','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','limit','set','Content-Range','apply','reject'];(function(_0x2f7a23,_0x49e48c){var _0x14a6aa=function(_0x4fb5b2){while(--_0x4fb5b2){_0x2f7a23['push'](_0x2f7a23['shift']());}};_0x14a6aa(++_0x49e48c);}(_0x949a,0x15c));var _0xa949=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x949a[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa949('0x0'));var rimraf=require(_0xa949('0x1'));var zipdir=require(_0xa949('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa949('0x3'));var Mustache=require(_0xa949('0x4'));var util=require('util');var path=require(_0xa949('0x5'));var sox=require('sox');var csv=require(_0xa949('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xa949('0x7'));var crypto=require(_0xa949('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xa949('0x9'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa949('0xa'));var Redis=require(_0xa949('0xb'));var authService=require(_0xa949('0xc'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa949('0xd'))(_0xa949('0xe'));var utils=require(_0xa949('0xf'));var config=require('../../config/environment');var db=require(_0xa949('0x10'))['db'];function respondWithStatusCode(_0x4d3efb,_0x4865b0){_0x4865b0=_0x4865b0||0xcc;return function(_0xaa2013){if(_0xaa2013){return _0x4d3efb[_0xa949('0x11')](_0x4865b0);}return _0x4d3efb[_0xa949('0x12')](_0x4865b0)[_0xa949('0x13')]();};}function respondWithResult(_0x472395,_0x3c90b6){_0x3c90b6=_0x3c90b6||0xc8;return function(_0x2e4171){if(_0x2e4171){return _0x472395['status'](_0x3c90b6)[_0xa949('0x14')](_0x2e4171);}};}function respondWithFilteredResult(_0x2952b4,_0x2ca40c){return function(_0x35282a){if(_0x35282a){var _0x5a4143=_0x35282a[_0xa949('0x15')],_0x453443=_0x2ca40c['offset'],_0x2597da=_0x2ca40c['offset']+_0x2ca40c[_0xa949('0x16')],_0x196215;if(_0x2597da>=_0x5a4143){_0x2597da=_0x5a4143;_0x196215=0xc8;}else{_0x196215=0xce;}_0x2952b4[_0xa949('0x12')](_0x196215);return _0x2952b4[_0xa949('0x17')](_0xa949('0x18'),_0x453443+'-'+_0x2597da+'/'+_0x5a4143)[_0xa949('0x14')](_0x35282a);}return null;};}function patchUpdates(_0x3e5876){return function(_0x53e1c2){try{jsonpatch[_0xa949('0x19')](_0x53e1c2,_0x3e5876,!![]);}catch(_0x5773f7){return BPromise[_0xa949('0x1a')](_0x5773f7);}return _0x53e1c2[_0xa949('0x1b')]();};}function saveUpdates(_0x5262dc,_0x5cef1e){return function(_0x5f276c){if(_0x5f276c){return _0x5f276c[_0xa949('0x1c')](_0x5262dc)['then'](function(_0x52ebdb){return _0x52ebdb;});}return null;};}function removeEntity(_0x236422,_0x45417e){return function(_0x2c000c){if(_0x2c000c){return _0x2c000c[_0xa949('0x1d')]()[_0xa949('0x1e')](function(){_0x236422[_0xa949('0x12')](0xcc)[_0xa949('0x13')]();});}};}function handleEntityNotFound(_0x5d202f,_0x39c4d2){return function(_0x55cfb2){if(!_0x55cfb2){_0x5d202f[_0xa949('0x11')](0x194);}return _0x55cfb2;};}function handleError(_0x564d61,_0x1e8bfe){_0x1e8bfe=_0x1e8bfe||0x1f4;return function(_0x346621){logger[_0xa949('0x1f')](_0x346621[_0xa949('0x20')]);if(_0x346621['name']){delete _0x346621[_0xa949('0x21')];}_0x564d61[_0xa949('0x12')](_0x1e8bfe)[_0xa949('0x22')](_0x346621);};}exports[_0xa949('0x23')]=function(_0x23619b,_0x5f26b7){var _0x434565={},_0xb65ad4={},_0x53f317={'count':0x0,'rows':[]};var _0x37db89=db[_0xa949('0x24')][_0xa949('0x25')];_0xb65ad4[_0xa949('0x26')]=_['keys'](_0x37db89);_0xb65ad4[_0xa949('0x27')]=_[_0xa949('0x28')](_0x23619b[_0xa949('0x27')]);_0xb65ad4['filters']=_[_0xa949('0x29')](_0xb65ad4[_0xa949('0x26')],_0xb65ad4[_0xa949('0x27')]);_0x434565['attributes']=_[_0xa949('0x29')](_0xb65ad4[_0xa949('0x26')],qs[_0xa949('0x2a')](_0x23619b['query']['fields']));_0x434565[_0xa949('0x2b')]=_0x434565[_0xa949('0x2b')]['length']?_0x434565[_0xa949('0x2b')]:_0xb65ad4[_0xa949('0x26')];if(!_0x23619b[_0xa949('0x27')][_0xa949('0x2c')](_0xa949('0x2d'))){_0x434565[_0xa949('0x16')]=qs[_0xa949('0x16')](_0x23619b['query'][_0xa949('0x16')]);_0x434565[_0xa949('0x2e')]=qs[_0xa949('0x2e')](_0x23619b['query']['offset']);}_0x434565[_0xa949('0x2f')]=qs[_0xa949('0x30')](_0x23619b[_0xa949('0x27')][_0xa949('0x30')]);_0x434565[_0xa949('0x31')]=qs[_0xa949('0x32')](_['pick'](_0x23619b['query'],_0xb65ad4['filters']));if(_0x23619b[_0xa949('0x27')][_0xa949('0x33')]){_0x434565[_0xa949('0x31')]=_[_0xa949('0x34')](_0x434565[_0xa949('0x31')],{'$or':_[_0xa949('0x35')](_0x37db89,function(_0x1a076c){if(_0x1a076c[_0xa949('0x36')][_0xa949('0x37')]!==_0xa949('0x38')){var _0x1d7532={};_0x1d7532[_0x1a076c[_0xa949('0x39')]]={'$like':'%'+_0x23619b[_0xa949('0x27')][_0xa949('0x33')]+'%'};return _0x1d7532;}})});}_0x434565=_['merge']({},_0x434565,_0x23619b[_0xa949('0x3a')]);var _0x2fbd30={'where':_0x434565[_0xa949('0x31')]};return db[_0xa949('0x24')][_0xa949('0x15')](_0x2fbd30)[_0xa949('0x1e')](function(_0x5eb205){_0x53f317[_0xa949('0x15')]=_0x5eb205;if(_0x23619b[_0xa949('0x27')][_0xa949('0x3b')]){_0x434565[_0xa949('0x3c')]=[{'model':db[_0xa949('0x3d')],'include':[{'model':db[_0xa949('0x3e')],'include':[{'model':db[_0xa949('0x3f')]}]},{'model':db['CrmWorkflowStep'],'as':_0xa949('0x40'),'through':{'attributes':[]}}]}];}return db[_0xa949('0x24')][_0xa949('0x41')](_0x434565);})[_0xa949('0x1e')](function(_0x49b405){_0x53f317[_0xa949('0x42')]=_0x49b405;return _0x53f317;})[_0xa949('0x1e')](respondWithFilteredResult(_0x5f26b7,_0x434565))[_0xa949('0x43')](handleError(_0x5f26b7,null));};exports[_0xa949('0x44')]=function(_0x3325ac,_0x2a3714){var _0x3cf9c0={'raw':![],'where':{'id':_0x3325ac[_0xa949('0x45')]['id']}},_0x4befab={};_0x4befab['model']=_[_0xa949('0x28')](db['CrmWorkflow'][_0xa949('0x25')]);_0x4befab[_0xa949('0x27')]=_[_0xa949('0x28')](_0x3325ac['query']);_0x4befab['filters']=_[_0xa949('0x29')](_0x4befab[_0xa949('0x26')],_0x4befab[_0xa949('0x27')]);_0x3cf9c0[_0xa949('0x2b')]=_[_0xa949('0x29')](_0x4befab['model'],qs['fields'](_0x3325ac[_0xa949('0x27')][_0xa949('0x2a')]));_0x3cf9c0[_0xa949('0x2b')]=_0x3cf9c0[_0xa949('0x2b')][_0xa949('0x46')]?_0x3cf9c0[_0xa949('0x2b')]:_0x4befab[_0xa949('0x26')];if(_0x3325ac[_0xa949('0x27')]['includeAll']){_0x3cf9c0[_0xa949('0x3c')]=[{'all':!![]}];}_0x3cf9c0=_[_0xa949('0x34')]({},_0x3cf9c0,_0x3325ac[_0xa949('0x3a')]);return db[_0xa949('0x24')][_0xa949('0x47')](_0x3cf9c0)[_0xa949('0x1e')](handleEntityNotFound(_0x2a3714,null))['then'](respondWithResult(_0x2a3714,null))[_0xa949('0x43')](handleError(_0x2a3714,null));};exports[_0xa949('0x48')]=function(_0x530afd,_0x17bfba){return db[_0xa949('0x24')][_0xa949('0x48')](_0x530afd['body'],{})[_0xa949('0x1e')](respondWithResult(_0x17bfba,0xc9))[_0xa949('0x43')](handleError(_0x17bfba,null));};exports['update']=function(_0x5a8664,_0x2caf8f){if(_0x5a8664[_0xa949('0x49')]['id']){delete _0x5a8664[_0xa949('0x49')]['id'];}return db[_0xa949('0x24')][_0xa949('0x47')]({'where':{'id':_0x5a8664[_0xa949('0x45')]['id']}})['then'](handleEntityNotFound(_0x2caf8f,null))[_0xa949('0x1e')](saveUpdates(_0x5a8664[_0xa949('0x49')],null))['then'](respondWithResult(_0x2caf8f,null))[_0xa949('0x43')](handleError(_0x2caf8f,null));};exports[_0xa949('0x1d')]=function(_0x5a8b94,_0x47b5d7){return db[_0xa949('0x24')][_0xa949('0x47')]({'where':{'id':_0x5a8b94['params']['id']}})[_0xa949('0x1e')](handleEntityNotFound(_0x47b5d7,null))[_0xa949('0x1e')](removeEntity(_0x47b5d7,null))[_0xa949('0x43')](handleError(_0x47b5d7,null));};exports[_0xa949('0x4a')]=function(_0x5c6c9e,_0x229225){return db[_0xa949('0x24')][_0xa949('0x4a')]()['then'](respondWithResult(_0x229225,null))[_0xa949('0x43')](handleError(_0x229225,null));}; \ No newline at end of file +var _0x1945=['status','json','count','offset','limit','set','update','destroy','then','sendStatus','error','stack','name','index','CrmWorkflow','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','CrmWorkflowStep','CrmTask','CrmActionsList','findAll','rows','show','params','include','catch','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb'];(function(_0x350396,_0x391ad2){var _0xf306b1=function(_0x3f2d38){while(--_0x3f2d38){_0x350396['push'](_0x350396['shift']());}};_0xf306b1(++_0x391ad2);}(_0x1945,0x1ed));var _0x5194=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x1945[_0x56482c];return _0x5aae7a;};'use strict';var pdf=require(_0x5194('0x0'));var emlformat=require(_0x5194('0x1'));var rimraf=require(_0x5194('0x2'));var zipdir=require(_0x5194('0x3'));var jsonpatch=require(_0x5194('0x4'));var rp=require(_0x5194('0x5'));var moment=require(_0x5194('0x6'));var BPromise=require(_0x5194('0x7'));var Mustache=require(_0x5194('0x8'));var util=require('util');var path=require(_0x5194('0x9'));var sox=require(_0x5194('0xa'));var csv=require(_0x5194('0xb'));var ejs=require(_0x5194('0xc'));var fs=require('fs');var _=require(_0x5194('0xd'));var squel=require(_0x5194('0xe'));var crypto=require(_0x5194('0xf'));var jsforce=require(_0x5194('0x10'));var deskjs=require(_0x5194('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5194('0x12'));var Redis=require(_0x5194('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x5194('0x14'));var logger=require(_0x5194('0x15'))(_0x5194('0x16'));var utils=require('../../config/utils');var config=require(_0x5194('0x17'));var db=require(_0x5194('0x18'))['db'];function respondWithStatusCode(_0x5255a4,_0x231794){_0x231794=_0x231794||0xcc;return function(_0x395996){if(_0x395996){return _0x5255a4['sendStatus'](_0x231794);}return _0x5255a4[_0x5194('0x19')](_0x231794)['end']();};}function respondWithResult(_0x257e90,_0x156857){_0x156857=_0x156857||0xc8;return function(_0x3d5c42){if(_0x3d5c42){return _0x257e90[_0x5194('0x19')](_0x156857)[_0x5194('0x1a')](_0x3d5c42);}};}function respondWithFilteredResult(_0x4d74fc,_0x43c69e){return function(_0x53bbb3){if(_0x53bbb3){var _0x511c05=_0x53bbb3[_0x5194('0x1b')],_0x32f3e1=_0x43c69e[_0x5194('0x1c')],_0x24fa43=_0x43c69e[_0x5194('0x1c')]+_0x43c69e[_0x5194('0x1d')],_0x4394ae;if(_0x24fa43>=_0x511c05){_0x24fa43=_0x511c05;_0x4394ae=0xc8;}else{_0x4394ae=0xce;}_0x4d74fc[_0x5194('0x19')](_0x4394ae);return _0x4d74fc[_0x5194('0x1e')]('Content-Range',_0x32f3e1+'-'+_0x24fa43+'/'+_0x511c05)[_0x5194('0x1a')](_0x53bbb3);}return null;};}function patchUpdates(_0x2338e6){return function(_0x2a10da){try{jsonpatch['apply'](_0x2a10da,_0x2338e6,!![]);}catch(_0x56166f){return BPromise['reject'](_0x56166f);}return _0x2a10da['save']();};}function saveUpdates(_0xe2f32c,_0x821343){return function(_0x1953c2){if(_0x1953c2){return _0x1953c2[_0x5194('0x1f')](_0xe2f32c)['then'](function(_0x1b6b1d){return _0x1b6b1d;});}return null;};}function removeEntity(_0x5b64e2,_0x300e85){return function(_0x17fe28){if(_0x17fe28){return _0x17fe28[_0x5194('0x20')]()[_0x5194('0x21')](function(){_0x5b64e2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x27920a,_0x2f69fb){return function(_0xbf3cf){if(!_0xbf3cf){_0x27920a[_0x5194('0x22')](0x194);}return _0xbf3cf;};}function handleError(_0x50b871,_0x1d3778){_0x1d3778=_0x1d3778||0x1f4;return function(_0xeff362){logger[_0x5194('0x23')](_0xeff362[_0x5194('0x24')]);if(_0xeff362['name']){delete _0xeff362[_0x5194('0x25')];}_0x50b871[_0x5194('0x19')](_0x1d3778)['send'](_0xeff362);};}exports[_0x5194('0x26')]=function(_0x2300c0,_0x47688f){var _0x33aa67={},_0x544160={},_0x1ab901={'count':0x0,'rows':[]};var _0x3bbadb=db[_0x5194('0x27')][_0x5194('0x28')];_0x544160[_0x5194('0x29')]=_['keys'](_0x3bbadb);_0x544160[_0x5194('0x2a')]=_[_0x5194('0x2b')](_0x2300c0['query']);_0x544160[_0x5194('0x2c')]=_[_0x5194('0x2d')](_0x544160[_0x5194('0x29')],_0x544160[_0x5194('0x2a')]);_0x33aa67['attributes']=_[_0x5194('0x2d')](_0x544160[_0x5194('0x29')],qs['fields'](_0x2300c0[_0x5194('0x2a')][_0x5194('0x2e')]));_0x33aa67[_0x5194('0x2f')]=_0x33aa67[_0x5194('0x2f')][_0x5194('0x30')]?_0x33aa67['attributes']:_0x544160[_0x5194('0x29')];if(!_0x2300c0[_0x5194('0x2a')]['hasOwnProperty']('nolimit')){_0x33aa67[_0x5194('0x1d')]=qs['limit'](_0x2300c0[_0x5194('0x2a')][_0x5194('0x1d')]);_0x33aa67[_0x5194('0x1c')]=qs['offset'](_0x2300c0[_0x5194('0x2a')][_0x5194('0x1c')]);}_0x33aa67[_0x5194('0x31')]=qs[_0x5194('0x32')](_0x2300c0[_0x5194('0x2a')][_0x5194('0x32')]);_0x33aa67[_0x5194('0x33')]=qs[_0x5194('0x2c')](_[_0x5194('0x34')](_0x2300c0['query'],_0x544160[_0x5194('0x2c')]));if(_0x2300c0['query'][_0x5194('0x35')]){_0x33aa67[_0x5194('0x33')]=_[_0x5194('0x36')](_0x33aa67[_0x5194('0x33')],{'$or':_[_0x5194('0x37')](_0x3bbadb,function(_0x4cd465){if(_0x4cd465[_0x5194('0x38')][_0x5194('0x39')]!==_0x5194('0x3a')){var _0x59d482={};_0x59d482[_0x4cd465[_0x5194('0x3b')]]={'$like':'%'+_0x2300c0['query'][_0x5194('0x35')]+'%'};return _0x59d482;}})});}_0x33aa67=_[_0x5194('0x36')]({},_0x33aa67,_0x2300c0[_0x5194('0x3c')]);var _0x547936={'where':_0x33aa67[_0x5194('0x33')]};return db[_0x5194('0x27')][_0x5194('0x1b')](_0x547936)['then'](function(_0x454a6e){_0x1ab901[_0x5194('0x1b')]=_0x454a6e;if(_0x2300c0[_0x5194('0x2a')][_0x5194('0x3d')]){_0x33aa67['include']=[{'model':db[_0x5194('0x3e')],'include':[{'model':db[_0x5194('0x3f')],'include':[{'model':db[_0x5194('0x40')]}]},{'model':db[_0x5194('0x3e')],'as':'CrmWorkflowNextStep','through':{'attributes':[]}}]}];}return db[_0x5194('0x27')][_0x5194('0x41')](_0x33aa67);})[_0x5194('0x21')](function(_0x5c60c8){_0x1ab901[_0x5194('0x42')]=_0x5c60c8;return _0x1ab901;})[_0x5194('0x21')](respondWithFilteredResult(_0x47688f,_0x33aa67))['catch'](handleError(_0x47688f,null));};exports[_0x5194('0x43')]=function(_0x3050e6,_0x55be89){var _0x111535={'raw':![],'where':{'id':_0x3050e6[_0x5194('0x44')]['id']}},_0x44a33b={};_0x44a33b[_0x5194('0x29')]=_[_0x5194('0x2b')](db['CrmWorkflow'][_0x5194('0x28')]);_0x44a33b[_0x5194('0x2a')]=_[_0x5194('0x2b')](_0x3050e6['query']);_0x44a33b[_0x5194('0x2c')]=_[_0x5194('0x2d')](_0x44a33b[_0x5194('0x29')],_0x44a33b[_0x5194('0x2a')]);_0x111535[_0x5194('0x2f')]=_[_0x5194('0x2d')](_0x44a33b[_0x5194('0x29')],qs[_0x5194('0x2e')](_0x3050e6[_0x5194('0x2a')][_0x5194('0x2e')]));_0x111535[_0x5194('0x2f')]=_0x111535[_0x5194('0x2f')][_0x5194('0x30')]?_0x111535[_0x5194('0x2f')]:_0x44a33b[_0x5194('0x29')];if(_0x3050e6[_0x5194('0x2a')]['includeAll']){_0x111535[_0x5194('0x45')]=[{'all':!![]}];}_0x111535=_['merge']({},_0x111535,_0x3050e6[_0x5194('0x3c')]);return db[_0x5194('0x27')]['find'](_0x111535)[_0x5194('0x21')](handleEntityNotFound(_0x55be89,null))[_0x5194('0x21')](respondWithResult(_0x55be89,null))[_0x5194('0x46')](handleError(_0x55be89,null));};exports['create']=function(_0xb1ec50,_0xa2481c){return db[_0x5194('0x27')]['create'](_0xb1ec50['body'],{})[_0x5194('0x21')](respondWithResult(_0xa2481c,0xc9))[_0x5194('0x46')](handleError(_0xa2481c,null));};exports[_0x5194('0x1f')]=function(_0xb1682d,_0x511e21){if(_0xb1682d['body']['id']){delete _0xb1682d[_0x5194('0x47')]['id'];}return db['CrmWorkflow']['find']({'where':{'id':_0xb1682d[_0x5194('0x44')]['id']}})[_0x5194('0x21')](handleEntityNotFound(_0x511e21,null))['then'](saveUpdates(_0xb1682d[_0x5194('0x47')],null))[_0x5194('0x21')](respondWithResult(_0x511e21,null))[_0x5194('0x46')](handleError(_0x511e21,null));};exports[_0x5194('0x20')]=function(_0x238cdf,_0x2f48ee){return db[_0x5194('0x27')][_0x5194('0x48')]({'where':{'id':_0x238cdf[_0x5194('0x44')]['id']}})[_0x5194('0x21')](handleEntityNotFound(_0x2f48ee,null))[_0x5194('0x21')](removeEntity(_0x2f48ee,null))[_0x5194('0x46')](handleError(_0x2f48ee,null));};exports[_0x5194('0x49')]=function(_0x21f892,_0x3b4d0a){return db['CrmWorkflow'][_0x5194('0x49')]()[_0x5194('0x21')](respondWithResult(_0x3b4d0a,null))[_0x5194('0x46')](handleError(_0x3b4d0a,null));}; \ No newline at end of file diff --git a/server/api/crmWorkflow/crmWorkflow.model.js b/server/api/crmWorkflow/crmWorkflow.model.js index 958a943..557f38a 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 _0x2bd2=['moment','request-promise','rimraf','./crmWorkflow.attributes','exports','define','CrmWorkflow','crm_workflows','lodash','util','api'];(function(_0x1d6a3b,_0x2c90ff){var _0x1a192d=function(_0x2e7369){while(--_0x2e7369){_0x1d6a3b['push'](_0x1d6a3b['shift']());}};_0x1a192d(++_0x2c90ff);}(_0x2bd2,0xfa));var _0x22bd=function(_0x1b49ce,_0x38ee98){_0x1b49ce=_0x1b49ce-0x0;var _0x1908b0=_0x2bd2[_0x1b49ce];return _0x1908b0;};'use strict';var _=require(_0x22bd('0x0'));var util=require(_0x22bd('0x1'));var logger=require('../../config/logger')(_0x22bd('0x2'));var moment=require(_0x22bd('0x3'));var BPromise=require('bluebird');var rp=require(_0x22bd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x22bd('0x5'));var config=require('../../config/environment');var attributes=require(_0x22bd('0x6'));module[_0x22bd('0x7')]=function(_0x18cb87,_0x4464e5){return _0x18cb87[_0x22bd('0x8')](_0x22bd('0x9'),attributes,{'tableName':_0x22bd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x191b=['util','api','request-promise','rimraf','../../config/environment','exports','define','CrmWorkflow','crm_workflows','lodash'];(function(_0x4165cf,_0xce6e4d){var _0x45a37f=function(_0x84ac81){while(--_0x84ac81){_0x4165cf['push'](_0x4165cf['shift']());}};_0x45a37f(++_0xce6e4d);}(_0x191b,0x95));var _0xb191=function(_0x2e27c6,_0x34700f){_0x2e27c6=_0x2e27c6-0x0;var _0x15a146=_0x191b[_0x2e27c6];return _0x15a146;};'use strict';var _=require(_0xb191('0x0'));var util=require(_0xb191('0x1'));var logger=require('../../config/logger')(_0xb191('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb191('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb191('0x4'));var config=require(_0xb191('0x5'));var attributes=require('./crmWorkflow.attributes');module[_0xb191('0x6')]=function(_0x220d21,_0x5e08c6){return _0x220d21[_0xb191('0x7')](_0xb191('0x8'),attributes,{'tableName':_0xb191('0x9'),'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 7c564d2..41f8764 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 _0x27fb=['message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','CrmWorkflow,\x20%s,\x20%s','request\x20sent','CrmWorkflow,\x20%s,\x20%s,\x20%s','error'];(function(_0x5cae6d,_0x13f1c7){var _0x5743ef=function(_0x211cad){while(--_0x211cad){_0x5cae6d['push'](_0x5cae6d['shift']());}};_0x5743ef(++_0x13f1c7);}(_0x27fb,0x1de));var _0xb27f=function(_0x3d448b,_0xf1038e){_0x3d448b=_0x3d448b-0x0;var _0x44cf8e=_0x27fb[_0x3d448b];return _0x44cf8e;};'use strict';var _=require(_0xb27f('0x0'));var util=require(_0xb27f('0x1'));var moment=require(_0xb27f('0x2'));var BPromise=require('bluebird');var rs=require(_0xb27f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb27f('0x4'))['db'];var utils=require(_0xb27f('0x5'));var logger=require(_0xb27f('0x6'))('rpc');var config=require(_0xb27f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb27f('0x8')][_0xb27f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3cc341,_0x1b7bd9,_0x608e92){return new BPromise(function(_0x4da129,_0xb18d3b){return client[_0xb27f('0xa')](_0x3cc341,_0x608e92)['then'](function(_0x338393){logger[_0xb27f('0xb')](_0xb27f('0xc'),_0x1b7bd9,_0xb27f('0xd'));logger['debug'](_0xb27f('0xe'),_0x1b7bd9,_0xb27f('0xd'),JSON['stringify'](_0x338393));if(_0x338393[_0xb27f('0xf')]){if(_0x338393[_0xb27f('0xf')]['code']===0x1f4){logger[_0xb27f('0xf')](_0xb27f('0xc'),_0x1b7bd9,_0x338393[_0xb27f('0xf')][_0xb27f('0x10')]);return _0xb18d3b(_0x338393[_0xb27f('0xf')][_0xb27f('0x10')]);}logger['error'](_0xb27f('0xc'),_0x1b7bd9,_0x338393['error'][_0xb27f('0x10')]);return _0x4da129(_0x338393['error'][_0xb27f('0x10')]);}else{logger[_0xb27f('0xb')](_0xb27f('0xc'),_0x1b7bd9,_0xb27f('0xd'));_0x4da129(_0x338393[_0xb27f('0x11')]['message']);}})[_0xb27f('0x12')](function(_0x2b8ff5){logger[_0xb27f('0xf')](_0xb27f('0xc'),_0x1b7bd9,_0x2b8ff5);_0xb18d3b(_0x2b8ff5);});});} \ No newline at end of file +var _0xcefd=['error','CrmWorkflow,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','CrmWorkflow,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x33e7b3,_0xec6680){var _0x5e33e1=function(_0x1d8162){while(--_0x1d8162){_0x33e7b3['push'](_0x33e7b3['shift']());}};_0x5e33e1(++_0xec6680);}(_0xcefd,0x1bd));var _0xdcef=function(_0x42a66b,_0x1a345b){_0x42a66b=_0x42a66b-0x0;var _0x26a063=_0xcefd[_0x42a66b];return _0x26a063;};'use strict';var _=require('lodash');var util=require(_0xdcef('0x0'));var moment=require(_0xdcef('0x1'));var BPromise=require(_0xdcef('0x2'));var rs=require(_0xdcef('0x3'));var fs=require('fs');var Redis=require(_0xdcef('0x4'));var db=require(_0xdcef('0x5'))['db'];var utils=require(_0xdcef('0x6'));var logger=require('../../config/logger')(_0xdcef('0x7'));var config=require(_0xdcef('0x8'));var jayson=require(_0xdcef('0x9'));var client=jayson[_0xdcef('0xa')][_0xdcef('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ba458,_0x3b9fec,_0x25dfd5){return new BPromise(function(_0x3dc2b0,_0x11a5a6){return client['request'](_0x4ba458,_0x25dfd5)[_0xdcef('0xc')](function(_0xbb7067){logger[_0xdcef('0xd')]('CrmWorkflow,\x20%s,\x20%s',_0x3b9fec,_0xdcef('0xe'));logger['debug'](_0xdcef('0xf'),_0x3b9fec,_0xdcef('0xe'),JSON[_0xdcef('0x10')](_0xbb7067));if(_0xbb7067[_0xdcef('0x11')]){if(_0xbb7067[_0xdcef('0x11')]['code']===0x1f4){logger[_0xdcef('0x11')](_0xdcef('0x12'),_0x3b9fec,_0xbb7067['error'][_0xdcef('0x13')]);return _0x11a5a6(_0xbb7067['error'][_0xdcef('0x13')]);}logger[_0xdcef('0x11')](_0xdcef('0x12'),_0x3b9fec,_0xbb7067[_0xdcef('0x11')]['message']);return _0x3dc2b0(_0xbb7067[_0xdcef('0x11')][_0xdcef('0x13')]);}else{logger['info'](_0xdcef('0x12'),_0x3b9fec,_0xdcef('0xe'));_0x3dc2b0(_0xbb7067[_0xdcef('0x14')]['message']);}})['catch'](function(_0x386368){logger[_0xdcef('0x11')](_0xdcef('0x12'),_0x3b9fec,_0x386368);_0x11a5a6(_0x386368);});});} \ No newline at end of file diff --git a/server/api/crmWorkflow/index.js b/server/api/crmWorkflow/index.js index 91d9844..1241207 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 _0x3d70=['isAuthenticated','/:id','post','put','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','index','/describe'];(function(_0x58b906,_0x240f3d){var _0x1089fb=function(_0x292534){while(--_0x292534){_0x58b906['push'](_0x58b906['shift']());}};_0x1089fb(++_0x240f3d);}(_0x3d70,0xf6));var _0x03d7=function(_0xdeefbd,_0x9e1b3d){_0xdeefbd=_0xdeefbd-0x0;var _0x4ff63f=_0x3d70[_0xdeefbd];return _0x4ff63f;};'use strict';var multer=require('multer');var util=require(_0x03d7('0x0'));var path=require(_0x03d7('0x1'));var timeout=require(_0x03d7('0x2'));var express=require('express');var router=express[_0x03d7('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x03d7('0x4'));var config=require(_0x03d7('0x5'));var controller=require('./crmWorkflow.controller');router[_0x03d7('0x6')]('/',auth['isAuthenticated'](),controller[_0x03d7('0x7')]);router[_0x03d7('0x6')](_0x03d7('0x8'),auth[_0x03d7('0x9')](),controller['describe']);router[_0x03d7('0x6')](_0x03d7('0xa'),auth[_0x03d7('0x9')](),controller['show']);router[_0x03d7('0xb')]('/',auth[_0x03d7('0x9')](),controller['create']);router[_0x03d7('0xc')](_0x03d7('0xa'),auth[_0x03d7('0x9')](),controller[_0x03d7('0xd')]);router[_0x03d7('0xe')](_0x03d7('0xa'),auth[_0x03d7('0x9')](),controller[_0x03d7('0xf')]);module[_0x03d7('0x10')]=router; \ No newline at end of file +var _0x3a8d=['show','create','put','update','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id'];(function(_0x4d80b7,_0x4dae72){var _0x253379=function(_0x1e6457){while(--_0x1e6457){_0x4d80b7['push'](_0x4d80b7['shift']());}};_0x253379(++_0x4dae72);}(_0x3a8d,0x150));var _0xd3a8=function(_0x1406ae,_0x292395){_0x1406ae=_0x1406ae-0x0;var _0x23a076=_0x3a8d[_0x1406ae];return _0x23a076;};'use strict';var multer=require(_0xd3a8('0x0'));var util=require('util');var path=require(_0xd3a8('0x1'));var timeout=require(_0xd3a8('0x2'));var express=require(_0xd3a8('0x3'));var router=express['Router']();var auth=require(_0xd3a8('0x4'));var interaction=require(_0xd3a8('0x5'));var config=require('../../config/environment');var controller=require('./crmWorkflow.controller');router[_0xd3a8('0x6')]('/',auth[_0xd3a8('0x7')](),controller['index']);router[_0xd3a8('0x6')]('/describe',auth[_0xd3a8('0x7')](),controller['describe']);router[_0xd3a8('0x6')](_0xd3a8('0x8'),auth[_0xd3a8('0x7')](),controller[_0xd3a8('0x9')]);router['post']('/',auth[_0xd3a8('0x7')](),controller[_0xd3a8('0xa')]);router[_0xd3a8('0xb')](_0xd3a8('0x8'),auth['isAuthenticated'](),controller[_0xd3a8('0xc')]);router['delete'](_0xd3a8('0x8'),auth[_0xd3a8('0x7')](),controller[_0xd3a8('0xd')]);module[_0xd3a8('0xe')]=router; \ No newline at end of file diff --git a/server/api/crmWorkflowstep/crmWorkflowstep.attributes.js b/server/api/crmWorkflowstep/crmWorkflowstep.attributes.js index 11aa9fb..44f8d61 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 _0xf1bd=['sequelize','exports','STRING','name'];(function(_0x30c2ae,_0x4c98a2){var _0x1ee1cc=function(_0x165922){while(--_0x165922){_0x30c2ae['push'](_0x30c2ae['shift']());}};_0x1ee1cc(++_0x4c98a2);}(_0xf1bd,0xdc));var _0xdf1b=function(_0x3ecfca,_0x3209db){_0x3ecfca=_0x3ecfca-0x0;var _0x5628bd=_0xf1bd[_0x3ecfca];return _0x5628bd;};'use strict';var Sequelize=require(_0xdf1b('0x0'));module[_0xdf1b('0x1')]={'name':{'type':Sequelize[_0xdf1b('0x2')],'allowNull':![],'unique':_0xdf1b('0x3')}}; \ No newline at end of file +var _0x1549=['STRING','sequelize','exports'];(function(_0x41dba5,_0xade881){var _0xb4a42=function(_0x419c25){while(--_0x419c25){_0x41dba5['push'](_0x41dba5['shift']());}};_0xb4a42(++_0xade881);}(_0x1549,0x199));var _0x9154=function(_0x49c68e,_0x1c1673){_0x49c68e=_0x49c68e-0x0;var _0x33032b=_0x1549[_0x49c68e];return _0x33032b;};'use strict';var Sequelize=require(_0x9154('0x0'));module[_0x9154('0x1')]={'name':{'type':Sequelize[_0x9154('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 00e91ca..978de53 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 _0xa221=['then','destroy','sendStatus','error','name','send','index','CrmWorkflowStep','rawAttributes','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','count','include','findAll','rows','catch','show','includeAll','options','find','body','params','describe','addCrmWorkflowNextStep','ids','omit','removeCrmWorkflowNextStep','getCrmWorkflowNextStep','findOne','length','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','json','offset','set','Content-Range','reject','save','update'];(function(_0x2bbe8d,_0x5156c2){var _0x539e7a=function(_0x518447){while(--_0x518447){_0x2bbe8d['push'](_0x2bbe8d['shift']());}};_0x539e7a(++_0x5156c2);}(_0xa221,0x17d));var _0x1a22=function(_0x11918e,_0x44b093){_0x11918e=_0x11918e-0x0;var _0x517ce8=_0xa221[_0x11918e];return _0x517ce8;};'use strict';var pdf=require(_0x1a22('0x0'));var emlformat=require(_0x1a22('0x1'));var rimraf=require(_0x1a22('0x2'));var zipdir=require(_0x1a22('0x3'));var jsonpatch=require(_0x1a22('0x4'));var rp=require(_0x1a22('0x5'));var moment=require(_0x1a22('0x6'));var BPromise=require(_0x1a22('0x7'));var Mustache=require(_0x1a22('0x8'));var util=require(_0x1a22('0x9'));var path=require(_0x1a22('0xa'));var sox=require(_0x1a22('0xb'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x1a22('0xc'));var squel=require(_0x1a22('0xd'));var crypto=require(_0x1a22('0xe'));var jsforce=require(_0x1a22('0xf'));var deskjs=require(_0x1a22('0x10'));var toCsv=require(_0x1a22('0x11'));var querystring=require(_0x1a22('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1a22('0x13'));var qs=require(_0x1a22('0x14'));var hardwareService=require(_0x1a22('0x15'));var logger=require(_0x1a22('0x16'))(_0x1a22('0x17'));var utils=require(_0x1a22('0x18'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2406ac,_0x1a32f8){_0x1a32f8=_0x1a32f8||0xcc;return function(_0x3cb11a){if(_0x3cb11a){return _0x2406ac['sendStatus'](_0x1a32f8);}return _0x2406ac[_0x1a22('0x19')](_0x1a32f8)[_0x1a22('0x1a')]();};}function respondWithResult(_0x583c56,_0x487c62){_0x487c62=_0x487c62||0xc8;return function(_0x27cb30){if(_0x27cb30){return _0x583c56[_0x1a22('0x19')](_0x487c62)[_0x1a22('0x1b')](_0x27cb30);}};}function respondWithFilteredResult(_0x1fec8b,_0xfd3c6a){return function(_0x4b4d84){if(_0x4b4d84){var _0x4b57ca=_0x4b4d84['count'],_0x428c4c=_0xfd3c6a['offset'],_0x1eb08b=_0xfd3c6a[_0x1a22('0x1c')]+_0xfd3c6a['limit'],_0x355d70;if(_0x1eb08b>=_0x4b57ca){_0x1eb08b=_0x4b57ca;_0x355d70=0xc8;}else{_0x355d70=0xce;}_0x1fec8b['status'](_0x355d70);return _0x1fec8b[_0x1a22('0x1d')](_0x1a22('0x1e'),_0x428c4c+'-'+_0x1eb08b+'/'+_0x4b57ca)[_0x1a22('0x1b')](_0x4b4d84);}return null;};}function patchUpdates(_0x3fdaf3){return function(_0x4759ac){try{jsonpatch['apply'](_0x4759ac,_0x3fdaf3,!![]);}catch(_0x40c34e){return BPromise[_0x1a22('0x1f')](_0x40c34e);}return _0x4759ac[_0x1a22('0x20')]();};}function saveUpdates(_0x286db1,_0xfc0069){return function(_0x314960){if(_0x314960){return _0x314960[_0x1a22('0x21')](_0x286db1)[_0x1a22('0x22')](function(_0xf55c1f){return _0xf55c1f;});}return null;};}function removeEntity(_0x48eb16,_0x37ce70){return function(_0x2f03f2){if(_0x2f03f2){return _0x2f03f2[_0x1a22('0x23')]()[_0x1a22('0x22')](function(){_0x48eb16['status'](0xcc)[_0x1a22('0x1a')]();});}};}function handleEntityNotFound(_0xe39fee,_0x3b5422){return function(_0x100278){if(!_0x100278){_0xe39fee[_0x1a22('0x24')](0x194);}return _0x100278;};}function handleError(_0x3c6298,_0x11a91c){_0x11a91c=_0x11a91c||0x1f4;return function(_0x2c3e7f){logger[_0x1a22('0x25')](_0x2c3e7f['stack']);if(_0x2c3e7f[_0x1a22('0x26')]){delete _0x2c3e7f[_0x1a22('0x26')];}_0x3c6298[_0x1a22('0x19')](_0x11a91c)[_0x1a22('0x27')](_0x2c3e7f);};}exports[_0x1a22('0x28')]=function(_0x2c0a53,_0x13feaf){var _0x4d6af4={},_0x411e5b={},_0x7401a5={'count':0x0,'rows':[]};var _0x2468c1=db[_0x1a22('0x29')][_0x1a22('0x2a')];_0x411e5b[_0x1a22('0x2b')]=_[_0x1a22('0x2c')](_0x2468c1);_0x411e5b[_0x1a22('0x2d')]=_['keys'](_0x2c0a53[_0x1a22('0x2d')]);_0x411e5b[_0x1a22('0x2e')]=_['intersection'](_0x411e5b[_0x1a22('0x2b')],_0x411e5b['query']);_0x4d6af4[_0x1a22('0x2f')]=_[_0x1a22('0x30')](_0x411e5b[_0x1a22('0x2b')],qs[_0x1a22('0x31')](_0x2c0a53[_0x1a22('0x2d')][_0x1a22('0x31')]));_0x4d6af4[_0x1a22('0x2f')]=_0x4d6af4[_0x1a22('0x2f')]['length']?_0x4d6af4[_0x1a22('0x2f')]:_0x411e5b[_0x1a22('0x2b')];if(!_0x2c0a53[_0x1a22('0x2d')][_0x1a22('0x32')](_0x1a22('0x33'))){_0x4d6af4[_0x1a22('0x34')]=qs[_0x1a22('0x34')](_0x2c0a53[_0x1a22('0x2d')]['limit']);_0x4d6af4[_0x1a22('0x1c')]=qs[_0x1a22('0x1c')](_0x2c0a53[_0x1a22('0x2d')][_0x1a22('0x1c')]);}_0x4d6af4[_0x1a22('0x35')]=qs[_0x1a22('0x36')](_0x2c0a53[_0x1a22('0x2d')][_0x1a22('0x36')]);_0x4d6af4[_0x1a22('0x37')]=qs['filters'](_[_0x1a22('0x38')](_0x2c0a53[_0x1a22('0x2d')],_0x411e5b[_0x1a22('0x2e')]));if(_0x2c0a53[_0x1a22('0x2d')]['filter']){_0x4d6af4[_0x1a22('0x37')]=_[_0x1a22('0x39')](_0x4d6af4[_0x1a22('0x37')],{'$or':_[_0x1a22('0x3a')](_0x2468c1,function(_0x3b1aa7){if(_0x3b1aa7[_0x1a22('0x3b')][_0x1a22('0x3c')]!==_0x1a22('0x3d')){var _0x35051d={};_0x35051d[_0x3b1aa7[_0x1a22('0x3e')]]={'$like':'%'+_0x2c0a53['query'][_0x1a22('0x3f')]+'%'};return _0x35051d;}})});}_0x4d6af4=_[_0x1a22('0x39')]({},_0x4d6af4,_0x2c0a53['options']);var _0x4c50e2={'where':_0x4d6af4[_0x1a22('0x37')]};return db[_0x1a22('0x29')][_0x1a22('0x40')](_0x4c50e2)[_0x1a22('0x22')](function(_0x5b5b03){_0x7401a5[_0x1a22('0x40')]=_0x5b5b03;if(_0x2c0a53['query']['includeAll']){_0x4d6af4[_0x1a22('0x41')]=[{'all':!![]}];}return db[_0x1a22('0x29')][_0x1a22('0x42')](_0x4d6af4);})['then'](function(_0x2c3028){_0x7401a5[_0x1a22('0x43')]=_0x2c3028;return _0x7401a5;})[_0x1a22('0x22')](respondWithFilteredResult(_0x13feaf,_0x4d6af4))[_0x1a22('0x44')](handleError(_0x13feaf,null));};exports[_0x1a22('0x45')]=function(_0x59ff22,_0x34635c){var _0x43a685={'raw':![],'where':{'id':_0x59ff22['params']['id']}},_0x5eea24={};_0x5eea24[_0x1a22('0x2b')]=_[_0x1a22('0x2c')](db[_0x1a22('0x29')]['rawAttributes']);_0x5eea24[_0x1a22('0x2d')]=_[_0x1a22('0x2c')](_0x59ff22[_0x1a22('0x2d')]);_0x5eea24[_0x1a22('0x2e')]=_[_0x1a22('0x30')](_0x5eea24[_0x1a22('0x2b')],_0x5eea24['query']);_0x43a685[_0x1a22('0x2f')]=_[_0x1a22('0x30')](_0x5eea24[_0x1a22('0x2b')],qs[_0x1a22('0x31')](_0x59ff22[_0x1a22('0x2d')]['fields']));_0x43a685[_0x1a22('0x2f')]=_0x43a685[_0x1a22('0x2f')]['length']?_0x43a685['attributes']:_0x5eea24[_0x1a22('0x2b')];if(_0x59ff22['query'][_0x1a22('0x46')]){_0x43a685[_0x1a22('0x41')]=[{'all':!![]}];}_0x43a685=_[_0x1a22('0x39')]({},_0x43a685,_0x59ff22[_0x1a22('0x47')]);return db[_0x1a22('0x29')][_0x1a22('0x48')](_0x43a685)[_0x1a22('0x22')](handleEntityNotFound(_0x34635c,null))[_0x1a22('0x22')](respondWithResult(_0x34635c,null))[_0x1a22('0x44')](handleError(_0x34635c,null));};exports['create']=function(_0x146a38,_0x43e38e){return db[_0x1a22('0x29')]['create'](_0x146a38[_0x1a22('0x49')],{})['then'](respondWithResult(_0x43e38e,0xc9))[_0x1a22('0x44')](handleError(_0x43e38e,null));};exports[_0x1a22('0x21')]=function(_0x4190ca,_0x238472){if(_0x4190ca[_0x1a22('0x49')]['id']){delete _0x4190ca[_0x1a22('0x49')]['id'];}return db[_0x1a22('0x29')][_0x1a22('0x48')]({'where':{'id':_0x4190ca[_0x1a22('0x4a')]['id']}})[_0x1a22('0x22')](handleEntityNotFound(_0x238472,null))[_0x1a22('0x22')](saveUpdates(_0x4190ca[_0x1a22('0x49')],null))[_0x1a22('0x22')](respondWithResult(_0x238472,null))[_0x1a22('0x44')](handleError(_0x238472,null));};exports[_0x1a22('0x23')]=function(_0x42953e,_0x5e4904){return db[_0x1a22('0x29')]['find']({'where':{'id':_0x42953e[_0x1a22('0x4a')]['id']}})[_0x1a22('0x22')](handleEntityNotFound(_0x5e4904,null))[_0x1a22('0x22')](removeEntity(_0x5e4904,null))[_0x1a22('0x44')](handleError(_0x5e4904,null));};exports[_0x1a22('0x4b')]=function(_0x14af1b,_0x5801f){return db[_0x1a22('0x29')][_0x1a22('0x4b')]()[_0x1a22('0x22')](respondWithResult(_0x5801f,null))[_0x1a22('0x44')](handleError(_0x5801f,null));};exports[_0x1a22('0x4c')]=function(_0x168f81,_0x11c842,_0x3ed1e1){return db[_0x1a22('0x29')]['find']({'where':{'id':_0x168f81[_0x1a22('0x4a')]['id']}})[_0x1a22('0x22')](handleEntityNotFound(_0x11c842,null))['then'](function(_0x16a08b){if(_0x16a08b){return _0x16a08b[_0x1a22('0x4c')](_0x168f81[_0x1a22('0x49')][_0x1a22('0x4d')],_[_0x1a22('0x4e')](_0x168f81['body'],[_0x1a22('0x4d'),'id'])||{});}})[_0x1a22('0x22')](respondWithResult(_0x11c842,null))[_0x1a22('0x44')](handleError(_0x11c842,null));};exports[_0x1a22('0x4f')]=function(_0x4dfd62,_0x100ac1,_0x43418d){return db['CrmWorkflowStep'][_0x1a22('0x48')]({'where':{'id':_0x4dfd62[_0x1a22('0x4a')]['id']}})[_0x1a22('0x22')](handleEntityNotFound(_0x100ac1,null))[_0x1a22('0x22')](function(_0x6d2a61){if(_0x6d2a61){return _0x6d2a61['removeCrmWorkflowNextStep'](_0x4dfd62['query']['ids']);}})[_0x1a22('0x22')](respondWithStatusCode(_0x100ac1,null))[_0x1a22('0x44')](handleError(_0x100ac1,null));};exports[_0x1a22('0x50')]=function(_0x2891ae,_0x46b22b,_0x216ee9){var _0xef6ee5={};var _0x48e59f={};var _0x5681a1;var _0x4556c8;return db['CrmWorkflowStep'][_0x1a22('0x51')]({'where':{'id':_0x2891ae[_0x1a22('0x4a')]['id']}})[_0x1a22('0x22')](handleEntityNotFound(_0x46b22b,null))[_0x1a22('0x22')](function(_0x5569fa){if(_0x5569fa){_0x5681a1=_0x5569fa;_0x48e59f[_0x1a22('0x2b')]=_[_0x1a22('0x2c')](db['CrmWorkflowStep'][_0x1a22('0x2a')]);_0x48e59f[_0x1a22('0x2d')]=_[_0x1a22('0x2c')](_0x2891ae[_0x1a22('0x2d')]);_0x48e59f[_0x1a22('0x2e')]=_[_0x1a22('0x30')](_0x48e59f[_0x1a22('0x2b')],_0x48e59f[_0x1a22('0x2d')]);_0xef6ee5[_0x1a22('0x2f')]=_[_0x1a22('0x30')](_0x48e59f[_0x1a22('0x2b')],qs[_0x1a22('0x31')](_0x2891ae[_0x1a22('0x2d')][_0x1a22('0x31')]));_0xef6ee5[_0x1a22('0x2f')]=_0xef6ee5[_0x1a22('0x2f')]['length']?_0xef6ee5[_0x1a22('0x2f')]:_0x48e59f[_0x1a22('0x2b')];_0xef6ee5[_0x1a22('0x35')]=qs[_0x1a22('0x36')](_0x2891ae[_0x1a22('0x2d')][_0x1a22('0x36')]);_0xef6ee5[_0x1a22('0x37')]=qs[_0x1a22('0x2e')](_[_0x1a22('0x38')](_0x2891ae[_0x1a22('0x2d')],_0x48e59f[_0x1a22('0x2e')]));if(_0x2891ae[_0x1a22('0x2d')]['filter']){_0xef6ee5[_0x1a22('0x37')]=_['merge'](_0xef6ee5[_0x1a22('0x37')],{'$or':_['map'](_0xef6ee5[_0x1a22('0x2f')],function(_0x1afaaa){var _0x5b1997={};_0x5b1997[_0x1afaaa]={'$like':'%'+_0x2891ae['query'][_0x1a22('0x3f')]+'%'};return _0x5b1997;})});}_0xef6ee5=_[_0x1a22('0x39')]({},_0xef6ee5,_0x2891ae['options']);return _0x5681a1['getCrmWorkflowNextStep'](_0xef6ee5);}})[_0x1a22('0x22')](function(_0x429c6d){if(_0x429c6d){_0x4556c8=_0x429c6d[_0x1a22('0x52')];if(!_0x2891ae[_0x1a22('0x2d')]['hasOwnProperty'](_0x1a22('0x33'))){_0xef6ee5['limit']=qs[_0x1a22('0x34')](_0x2891ae[_0x1a22('0x2d')]['limit']);_0xef6ee5[_0x1a22('0x1c')]=qs['offset'](_0x2891ae[_0x1a22('0x2d')]['offset']);}return _0x5681a1['getCrmWorkflowNextStep'](_0xef6ee5);}})[_0x1a22('0x22')](function(_0x38ae68){if(_0x38ae68){return _0x38ae68?{'count':_0x4556c8,'rows':_0x38ae68}:null;}})['then'](respondWithResult(_0x46b22b,null))[_0x1a22('0x44')](handleError(_0x46b22b,null));}; \ No newline at end of file +var _0xe9ed=['api','../../config/environment','../../mysqldb','sendStatus','json','count','limit','Content-Range','apply','reject','save','update','then','status','end','stack','name','index','CrmWorkflowStep','rawAttributes','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','include','findAll','show','includeAll','catch','create','body','find','destroy','params','describe','addCrmWorkflowNextStep','ids','omit','removeCrmWorkflowNextStep','getCrmWorkflowNextStep','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware'];(function(_0x1cad51,_0x27ff4d){var _0x2ef33e=function(_0x48cfd6){while(--_0x48cfd6){_0x1cad51['push'](_0x1cad51['shift']());}};_0x2ef33e(++_0x27ff4d);}(_0xe9ed,0xdb));var _0xde9e=function(_0x41a235,_0x16a059){_0x41a235=_0x41a235-0x0;var _0x3fa303=_0xe9ed[_0x41a235];return _0x3fa303;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xde9e('0x0'));var rimraf=require(_0xde9e('0x1'));var zipdir=require(_0xde9e('0x2'));var jsonpatch=require(_0xde9e('0x3'));var rp=require(_0xde9e('0x4'));var moment=require(_0xde9e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xde9e('0x6'));var util=require(_0xde9e('0x7'));var path=require(_0xde9e('0x8'));var sox=require(_0xde9e('0x9'));var csv=require(_0xde9e('0xa'));var ejs=require(_0xde9e('0xb'));var fs=require('fs');var _=require(_0xde9e('0xc'));var squel=require('squel');var crypto=require(_0xde9e('0xd'));var jsforce=require(_0xde9e('0xe'));var deskjs=require(_0xde9e('0xf'));var toCsv=require(_0xde9e('0xa'));var querystring=require(_0xde9e('0x10'));var Papa=require(_0xde9e('0x11'));var Redis=require(_0xde9e('0x12'));var authService=require(_0xde9e('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xde9e('0x14'));var logger=require('../../config/logger')(_0xde9e('0x15'));var utils=require('../../config/utils');var config=require(_0xde9e('0x16'));var db=require(_0xde9e('0x17'))['db'];function respondWithStatusCode(_0x5269ac,_0x1ce704){_0x1ce704=_0x1ce704||0xcc;return function(_0x49c90f){if(_0x49c90f){return _0x5269ac[_0xde9e('0x18')](_0x1ce704);}return _0x5269ac['status'](_0x1ce704)['end']();};}function respondWithResult(_0x1e6acf,_0x5daa86){_0x5daa86=_0x5daa86||0xc8;return function(_0x5e5169){if(_0x5e5169){return _0x1e6acf['status'](_0x5daa86)[_0xde9e('0x19')](_0x5e5169);}};}function respondWithFilteredResult(_0x5f0532,_0x4355fa){return function(_0x51a6eb){if(_0x51a6eb){var _0x5c0191=_0x51a6eb[_0xde9e('0x1a')],_0x3a0824=_0x4355fa['offset'],_0x2bae4f=_0x4355fa['offset']+_0x4355fa[_0xde9e('0x1b')],_0x15c759;if(_0x2bae4f>=_0x5c0191){_0x2bae4f=_0x5c0191;_0x15c759=0xc8;}else{_0x15c759=0xce;}_0x5f0532['status'](_0x15c759);return _0x5f0532['set'](_0xde9e('0x1c'),_0x3a0824+'-'+_0x2bae4f+'/'+_0x5c0191)[_0xde9e('0x19')](_0x51a6eb);}return null;};}function patchUpdates(_0x583e63){return function(_0x4e1d5a){try{jsonpatch[_0xde9e('0x1d')](_0x4e1d5a,_0x583e63,!![]);}catch(_0x5d907f){return BPromise[_0xde9e('0x1e')](_0x5d907f);}return _0x4e1d5a[_0xde9e('0x1f')]();};}function saveUpdates(_0x53e944,_0x1732a6){return function(_0x5ad0eb){if(_0x5ad0eb){return _0x5ad0eb[_0xde9e('0x20')](_0x53e944)[_0xde9e('0x21')](function(_0x25e506){return _0x25e506;});}return null;};}function removeEntity(_0x776a3f,_0x35708a){return function(_0x54353c){if(_0x54353c){return _0x54353c['destroy']()[_0xde9e('0x21')](function(){_0x776a3f[_0xde9e('0x22')](0xcc)[_0xde9e('0x23')]();});}};}function handleEntityNotFound(_0x375891,_0x185ddc){return function(_0x454faa){if(!_0x454faa){_0x375891[_0xde9e('0x18')](0x194);}return _0x454faa;};}function handleError(_0x1a331c,_0x57550a){_0x57550a=_0x57550a||0x1f4;return function(_0x25389e){logger['error'](_0x25389e[_0xde9e('0x24')]);if(_0x25389e[_0xde9e('0x25')]){delete _0x25389e['name'];}_0x1a331c[_0xde9e('0x22')](_0x57550a)['send'](_0x25389e);};}exports[_0xde9e('0x26')]=function(_0x4c36a6,_0x41afa8){var _0x224fff={},_0x220ffd={},_0x1aa3d7={'count':0x0,'rows':[]};var _0xe119df=db[_0xde9e('0x27')][_0xde9e('0x28')];_0x220ffd[_0xde9e('0x29')]=_['keys'](_0xe119df);_0x220ffd['query']=_[_0xde9e('0x2a')](_0x4c36a6['query']);_0x220ffd[_0xde9e('0x2b')]=_['intersection'](_0x220ffd[_0xde9e('0x29')],_0x220ffd[_0xde9e('0x2c')]);_0x224fff[_0xde9e('0x2d')]=_[_0xde9e('0x2e')](_0x220ffd[_0xde9e('0x29')],qs[_0xde9e('0x2f')](_0x4c36a6[_0xde9e('0x2c')]['fields']));_0x224fff[_0xde9e('0x2d')]=_0x224fff[_0xde9e('0x2d')][_0xde9e('0x30')]?_0x224fff[_0xde9e('0x2d')]:_0x220ffd[_0xde9e('0x29')];if(!_0x4c36a6[_0xde9e('0x2c')][_0xde9e('0x31')](_0xde9e('0x32'))){_0x224fff[_0xde9e('0x1b')]=qs[_0xde9e('0x1b')](_0x4c36a6['query'][_0xde9e('0x1b')]);_0x224fff[_0xde9e('0x33')]=qs[_0xde9e('0x33')](_0x4c36a6[_0xde9e('0x2c')][_0xde9e('0x33')]);}_0x224fff[_0xde9e('0x34')]=qs['sort'](_0x4c36a6[_0xde9e('0x2c')][_0xde9e('0x35')]);_0x224fff['where']=qs[_0xde9e('0x2b')](_[_0xde9e('0x36')](_0x4c36a6[_0xde9e('0x2c')],_0x220ffd[_0xde9e('0x2b')]));if(_0x4c36a6[_0xde9e('0x2c')][_0xde9e('0x37')]){_0x224fff[_0xde9e('0x38')]=_[_0xde9e('0x39')](_0x224fff[_0xde9e('0x38')],{'$or':_[_0xde9e('0x3a')](_0xe119df,function(_0x31e615){if(_0x31e615[_0xde9e('0x3b')][_0xde9e('0x3c')]!==_0xde9e('0x3d')){var _0x1438af={};_0x1438af[_0x31e615[_0xde9e('0x3e')]]={'$like':'%'+_0x4c36a6[_0xde9e('0x2c')][_0xde9e('0x37')]+'%'};return _0x1438af;}})});}_0x224fff=_[_0xde9e('0x39')]({},_0x224fff,_0x4c36a6[_0xde9e('0x3f')]);var _0x37aaee={'where':_0x224fff[_0xde9e('0x38')]};return db['CrmWorkflowStep']['count'](_0x37aaee)[_0xde9e('0x21')](function(_0x3ce431){_0x1aa3d7[_0xde9e('0x1a')]=_0x3ce431;if(_0x4c36a6['query']['includeAll']){_0x224fff[_0xde9e('0x40')]=[{'all':!![]}];}return db[_0xde9e('0x27')][_0xde9e('0x41')](_0x224fff);})[_0xde9e('0x21')](function(_0x481a3e){_0x1aa3d7['rows']=_0x481a3e;return _0x1aa3d7;})[_0xde9e('0x21')](respondWithFilteredResult(_0x41afa8,_0x224fff))['catch'](handleError(_0x41afa8,null));};exports[_0xde9e('0x42')]=function(_0x31dc4e,_0x4a5f62){var _0x442855={'raw':![],'where':{'id':_0x31dc4e['params']['id']}},_0xdac19e={};_0xdac19e[_0xde9e('0x29')]=_[_0xde9e('0x2a')](db['CrmWorkflowStep'][_0xde9e('0x28')]);_0xdac19e['query']=_[_0xde9e('0x2a')](_0x31dc4e[_0xde9e('0x2c')]);_0xdac19e[_0xde9e('0x2b')]=_[_0xde9e('0x2e')](_0xdac19e['model'],_0xdac19e[_0xde9e('0x2c')]);_0x442855[_0xde9e('0x2d')]=_['intersection'](_0xdac19e[_0xde9e('0x29')],qs['fields'](_0x31dc4e[_0xde9e('0x2c')][_0xde9e('0x2f')]));_0x442855['attributes']=_0x442855[_0xde9e('0x2d')]['length']?_0x442855[_0xde9e('0x2d')]:_0xdac19e[_0xde9e('0x29')];if(_0x31dc4e[_0xde9e('0x2c')][_0xde9e('0x43')]){_0x442855['include']=[{'all':!![]}];}_0x442855=_[_0xde9e('0x39')]({},_0x442855,_0x31dc4e['options']);return db[_0xde9e('0x27')]['find'](_0x442855)[_0xde9e('0x21')](handleEntityNotFound(_0x4a5f62,null))[_0xde9e('0x21')](respondWithResult(_0x4a5f62,null))[_0xde9e('0x44')](handleError(_0x4a5f62,null));};exports[_0xde9e('0x45')]=function(_0x2b8cfb,_0x54d50c){return db[_0xde9e('0x27')]['create'](_0x2b8cfb[_0xde9e('0x46')],{})[_0xde9e('0x21')](respondWithResult(_0x54d50c,0xc9))[_0xde9e('0x44')](handleError(_0x54d50c,null));};exports[_0xde9e('0x20')]=function(_0x28882e,_0x140976){if(_0x28882e[_0xde9e('0x46')]['id']){delete _0x28882e[_0xde9e('0x46')]['id'];}return db[_0xde9e('0x27')][_0xde9e('0x47')]({'where':{'id':_0x28882e['params']['id']}})['then'](handleEntityNotFound(_0x140976,null))[_0xde9e('0x21')](saveUpdates(_0x28882e['body'],null))['then'](respondWithResult(_0x140976,null))['catch'](handleError(_0x140976,null));};exports[_0xde9e('0x48')]=function(_0x1fabd3,_0x18210b){return db['CrmWorkflowStep'][_0xde9e('0x47')]({'where':{'id':_0x1fabd3[_0xde9e('0x49')]['id']}})['then'](handleEntityNotFound(_0x18210b,null))[_0xde9e('0x21')](removeEntity(_0x18210b,null))['catch'](handleError(_0x18210b,null));};exports[_0xde9e('0x4a')]=function(_0x479580,_0x28ee3c){return db[_0xde9e('0x27')][_0xde9e('0x4a')]()[_0xde9e('0x21')](respondWithResult(_0x28ee3c,null))[_0xde9e('0x44')](handleError(_0x28ee3c,null));};exports[_0xde9e('0x4b')]=function(_0x43f964,_0x5bf063,_0x4b9cce){return db[_0xde9e('0x27')]['find']({'where':{'id':_0x43f964[_0xde9e('0x49')]['id']}})[_0xde9e('0x21')](handleEntityNotFound(_0x5bf063,null))[_0xde9e('0x21')](function(_0x1be7b2){if(_0x1be7b2){return _0x1be7b2['addCrmWorkflowNextStep'](_0x43f964[_0xde9e('0x46')][_0xde9e('0x4c')],_[_0xde9e('0x4d')](_0x43f964['body'],[_0xde9e('0x4c'),'id'])||{});}})['then'](respondWithResult(_0x5bf063,null))['catch'](handleError(_0x5bf063,null));};exports[_0xde9e('0x4e')]=function(_0x595890,_0x4f58f7,_0x4aa854){return db['CrmWorkflowStep'][_0xde9e('0x47')]({'where':{'id':_0x595890[_0xde9e('0x49')]['id']}})[_0xde9e('0x21')](handleEntityNotFound(_0x4f58f7,null))[_0xde9e('0x21')](function(_0x4e5b3e){if(_0x4e5b3e){return _0x4e5b3e[_0xde9e('0x4e')](_0x595890[_0xde9e('0x2c')][_0xde9e('0x4c')]);}})[_0xde9e('0x21')](respondWithStatusCode(_0x4f58f7,null))[_0xde9e('0x44')](handleError(_0x4f58f7,null));};exports[_0xde9e('0x4f')]=function(_0x3c0e86,_0x19d782,_0x3805dc){var _0xe853ca={};var _0x1d6698={};var _0x5f312b;var _0x12ba24;return db[_0xde9e('0x27')]['findOne']({'where':{'id':_0x3c0e86[_0xde9e('0x49')]['id']}})[_0xde9e('0x21')](handleEntityNotFound(_0x19d782,null))['then'](function(_0x4e0a63){if(_0x4e0a63){_0x5f312b=_0x4e0a63;_0x1d6698[_0xde9e('0x29')]=_[_0xde9e('0x2a')](db['CrmWorkflowStep'][_0xde9e('0x28')]);_0x1d6698[_0xde9e('0x2c')]=_[_0xde9e('0x2a')](_0x3c0e86[_0xde9e('0x2c')]);_0x1d6698[_0xde9e('0x2b')]=_['intersection'](_0x1d6698[_0xde9e('0x29')],_0x1d6698[_0xde9e('0x2c')]);_0xe853ca[_0xde9e('0x2d')]=_['intersection'](_0x1d6698[_0xde9e('0x29')],qs['fields'](_0x3c0e86['query'][_0xde9e('0x2f')]));_0xe853ca[_0xde9e('0x2d')]=_0xe853ca[_0xde9e('0x2d')][_0xde9e('0x30')]?_0xe853ca[_0xde9e('0x2d')]:_0x1d6698[_0xde9e('0x29')];_0xe853ca[_0xde9e('0x34')]=qs[_0xde9e('0x35')](_0x3c0e86[_0xde9e('0x2c')][_0xde9e('0x35')]);_0xe853ca[_0xde9e('0x38')]=qs['filters'](_[_0xde9e('0x36')](_0x3c0e86[_0xde9e('0x2c')],_0x1d6698[_0xde9e('0x2b')]));if(_0x3c0e86[_0xde9e('0x2c')][_0xde9e('0x37')]){_0xe853ca[_0xde9e('0x38')]=_['merge'](_0xe853ca['where'],{'$or':_[_0xde9e('0x3a')](_0xe853ca[_0xde9e('0x2d')],function(_0x52be0d){var _0x18f3e8={};_0x18f3e8[_0x52be0d]={'$like':'%'+_0x3c0e86[_0xde9e('0x2c')][_0xde9e('0x37')]+'%'};return _0x18f3e8;})});}_0xe853ca=_['merge']({},_0xe853ca,_0x3c0e86['options']);return _0x5f312b[_0xde9e('0x4f')](_0xe853ca);}})['then'](function(_0x53e9f9){if(_0x53e9f9){_0x12ba24=_0x53e9f9['length'];if(!_0x3c0e86['query'][_0xde9e('0x31')](_0xde9e('0x32'))){_0xe853ca['limit']=qs[_0xde9e('0x1b')](_0x3c0e86[_0xde9e('0x2c')]['limit']);_0xe853ca['offset']=qs[_0xde9e('0x33')](_0x3c0e86['query'][_0xde9e('0x33')]);}return _0x5f312b['getCrmWorkflowNextStep'](_0xe853ca);}})[_0xde9e('0x21')](function(_0x5df870){if(_0x5df870){return _0x5df870?{'count':_0x12ba24,'rows':_0x5df870}:null;}})[_0xde9e('0x21')](respondWithResult(_0x19d782,null))[_0xde9e('0x44')](handleError(_0x19d782,null));}; \ No newline at end of file diff --git a/server/api/crmWorkflowstep/crmWorkflowstep.model.js b/server/api/crmWorkflowstep/crmWorkflowstep.model.js index 2dd4e23..dcc7394 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 _0xa78d=['../../config/environment','./crmWorkflowstep.attributes','CrmWorkflowStep','crm_workflow_steps','lodash','api','moment','request-promise','path'];(function(_0xab2865,_0x32e71e){var _0x31f344=function(_0x2a3762){while(--_0x2a3762){_0xab2865['push'](_0xab2865['shift']());}};_0x31f344(++_0x32e71e);}(_0xa78d,0x1bd));var _0xda78=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0xa78d[_0x263a74];return _0x2aa86c;};'use strict';var _=require(_0xda78('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xda78('0x1'));var moment=require(_0xda78('0x2'));var BPromise=require('bluebird');var rp=require(_0xda78('0x3'));var fs=require('fs');var path=require(_0xda78('0x4'));var rimraf=require('rimraf');var config=require(_0xda78('0x5'));var attributes=require(_0xda78('0x6'));module['exports']=function(_0x12e23e,_0x4b5c79){return _0x12e23e['define'](_0xda78('0x7'),attributes,{'tableName':_0xda78('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xec4e=['request-promise','path','rimraf','../../config/environment','./crmWorkflowstep.attributes','exports','define','lodash','util','../../config/logger','moment','bluebird'];(function(_0x1d63b0,_0x9e395b){var _0x3b9064=function(_0x161608){while(--_0x161608){_0x1d63b0['push'](_0x1d63b0['shift']());}};_0x3b9064(++_0x9e395b);}(_0xec4e,0x187));var _0xeec4=function(_0x25c325,_0x29381b){_0x25c325=_0x25c325-0x0;var _0x203e7e=_0xec4e[_0x25c325];return _0x203e7e;};'use strict';var _=require(_0xeec4('0x0'));var util=require(_0xeec4('0x1'));var logger=require(_0xeec4('0x2'))('api');var moment=require(_0xeec4('0x3'));var BPromise=require(_0xeec4('0x4'));var rp=require(_0xeec4('0x5'));var fs=require('fs');var path=require(_0xeec4('0x6'));var rimraf=require(_0xeec4('0x7'));var config=require(_0xeec4('0x8'));var attributes=require(_0xeec4('0x9'));module[_0xeec4('0xa')]=function(_0x50c148,_0x5bbad7){return _0x50c148[_0xeec4('0xb')]('CrmWorkflowStep',attributes,{'tableName':'crm_workflow_steps','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 4d6f625..7bb6af8 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 _0x3043=['client','http','request','info','CrmWorkflowStep,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x421cf8,_0x23152c){var _0x145c48=function(_0x565862){while(--_0x565862){_0x421cf8['push'](_0x421cf8['shift']());}};_0x145c48(++_0x23152c);}(_0x3043,0x175));var _0x3304=function(_0x4b91c4,_0x23f35f){_0x4b91c4=_0x4b91c4-0x0;var _0x25cb80=_0x3043[_0x4b91c4];return _0x25cb80;};'use strict';var _=require(_0x3304('0x0'));var util=require(_0x3304('0x1'));var moment=require(_0x3304('0x2'));var BPromise=require(_0x3304('0x3'));var rs=require(_0x3304('0x4'));var fs=require('fs');var Redis=require(_0x3304('0x5'));var db=require(_0x3304('0x6'))['db'];var utils=require(_0x3304('0x7'));var logger=require(_0x3304('0x8'))(_0x3304('0x9'));var config=require('../../config/environment');var jayson=require(_0x3304('0xa'));var client=jayson[_0x3304('0xb')][_0x3304('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x180be2,_0x4004b2,_0x57faca){return new BPromise(function(_0x1c435a,_0x32af8e){return client[_0x3304('0xd')](_0x180be2,_0x57faca)['then'](function(_0x3a3715){logger[_0x3304('0xe')](_0x3304('0xf'),_0x4004b2,'request\x20sent');logger[_0x3304('0x10')]('CrmWorkflowStep,\x20%s,\x20%s,\x20%s',_0x4004b2,'request\x20sent',JSON[_0x3304('0x11')](_0x3a3715));if(_0x3a3715[_0x3304('0x12')]){if(_0x3a3715[_0x3304('0x12')][_0x3304('0x13')]===0x1f4){logger[_0x3304('0x12')](_0x3304('0xf'),_0x4004b2,_0x3a3715[_0x3304('0x12')][_0x3304('0x14')]);return _0x32af8e(_0x3a3715['error'][_0x3304('0x14')]);}logger[_0x3304('0x12')]('CrmWorkflowStep,\x20%s,\x20%s',_0x4004b2,_0x3a3715[_0x3304('0x12')][_0x3304('0x14')]);return _0x1c435a(_0x3a3715[_0x3304('0x12')][_0x3304('0x14')]);}else{logger['info'](_0x3304('0xf'),_0x4004b2,_0x3304('0x15'));_0x1c435a(_0x3a3715[_0x3304('0x16')][_0x3304('0x14')]);}})[_0x3304('0x17')](function(_0x1d2dcc){logger[_0x3304('0x12')](_0x3304('0xf'),_0x4004b2,_0x1d2dcc);_0x32af8e(_0x1d2dcc);});});} \ No newline at end of file +var _0xbd3b=['client','request','then','CrmWorkflowStep,\x20%s,\x20%s','request\x20sent','debug','CrmWorkflowStep,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0xfb42e6,_0x5f5d4b){var _0x27265b=function(_0x163e81){while(--_0x163e81){_0xfb42e6['push'](_0xfb42e6['shift']());}};_0x27265b(++_0x5f5d4b);}(_0xbd3b,0x1c3));var _0xbbd3=function(_0x1c97c8,_0x28d564){_0x1c97c8=_0x1c97c8-0x0;var _0x2c096d=_0xbd3b[_0x1c97c8];return _0x2c096d;};'use strict';var _=require(_0xbbd3('0x0'));var util=require(_0xbbd3('0x1'));var moment=require(_0xbbd3('0x2'));var BPromise=require('bluebird');var rs=require(_0xbbd3('0x3'));var fs=require('fs');var Redis=require(_0xbbd3('0x4'));var db=require(_0xbbd3('0x5'))['db'];var utils=require(_0xbbd3('0x6'));var logger=require('../../config/logger')(_0xbbd3('0x7'));var config=require(_0xbbd3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbbd3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3cc5d9,_0x232ede,_0x44f331){return new BPromise(function(_0x4b8667,_0x3d3f9f){return client[_0xbbd3('0xa')](_0x3cc5d9,_0x44f331)[_0xbbd3('0xb')](function(_0x229f59){logger['info'](_0xbbd3('0xc'),_0x232ede,_0xbbd3('0xd'));logger[_0xbbd3('0xe')](_0xbbd3('0xf'),_0x232ede,'request\x20sent',JSON[_0xbbd3('0x10')](_0x229f59));if(_0x229f59['error']){if(_0x229f59['error'][_0xbbd3('0x11')]===0x1f4){logger[_0xbbd3('0x12')](_0xbbd3('0xc'),_0x232ede,_0x229f59[_0xbbd3('0x12')][_0xbbd3('0x13')]);return _0x3d3f9f(_0x229f59[_0xbbd3('0x12')][_0xbbd3('0x13')]);}logger[_0xbbd3('0x12')](_0xbbd3('0xc'),_0x232ede,_0x229f59[_0xbbd3('0x12')]['message']);return _0x4b8667(_0x229f59['error'][_0xbbd3('0x13')]);}else{logger[_0xbbd3('0x14')](_0xbbd3('0xc'),_0x232ede,_0xbbd3('0xd'));_0x4b8667(_0x229f59[_0xbbd3('0x15')]['message']);}})[_0xbbd3('0x16')](function(_0x49d6b9){logger[_0xbbd3('0x12')](_0xbbd3('0xc'),_0x232ede,_0x49d6b9);_0x3d3f9f(_0x49d6b9);});});} \ No newline at end of file diff --git a/server/api/crmWorkflowstep/index.js b/server/api/crmWorkflowstep/index.js index 130c305..0d66735 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 _0x0b0e=['get','isAuthenticated','index','/describe','/:id','show','/:id/steps','post','put','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./crmWorkflowstep.controller'];(function(_0x3281d1,_0x421488){var _0xa2fe86=function(_0xdb7d34){while(--_0xdb7d34){_0x3281d1['push'](_0x3281d1['shift']());}};_0xa2fe86(++_0x421488);}(_0x0b0e,0x187));var _0xe0b0=function(_0x224f65,_0x4750bf){_0x224f65=_0x224f65-0x0;var _0x3f921c=_0x0b0e[_0x224f65];return _0x3f921c;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var auth=require(_0xe0b0('0x4'));var interaction=require(_0xe0b0('0x5'));var config=require(_0xe0b0('0x6'));var controller=require(_0xe0b0('0x7'));router[_0xe0b0('0x8')]('/',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xa')]);router[_0xe0b0('0x8')](_0xe0b0('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xe0b0('0x8')](_0xe0b0('0xc'),auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xd')]);router['get'](_0xe0b0('0xe'),auth[_0xe0b0('0x9')](),controller['getCrmWorkflowNextStep']);router[_0xe0b0('0xf')]('/',auth[_0xe0b0('0x9')](),controller['create']);router[_0xe0b0('0xf')](_0xe0b0('0xe'),auth[_0xe0b0('0x9')](),controller['addCrmWorkflowNextStep']);router[_0xe0b0('0x10')](_0xe0b0('0xc'),auth[_0xe0b0('0x9')](),controller[_0xe0b0('0x11')]);router[_0xe0b0('0x12')]('/:id',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0x13')]);router[_0xe0b0('0x12')](_0xe0b0('0xe'),auth[_0xe0b0('0x9')](),controller['removeCrmWorkflowNextStep']);module[_0xe0b0('0x14')]=router; \ No newline at end of file +var _0xdb28=['/:id','show','getCrmWorkflowNextStep','post','create','addCrmWorkflowNextStep','put','destroy','delete','/:id/steps','removeCrmWorkflowNextStep','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./crmWorkflowstep.controller','isAuthenticated','index','describe','get'];(function(_0x42dc2c,_0x53e18a){var _0x4667e1=function(_0x53b12d){while(--_0x53b12d){_0x42dc2c['push'](_0x42dc2c['shift']());}};_0x4667e1(++_0x53e18a);}(_0xdb28,0x106));var _0x8db2=function(_0x3e8a71,_0x295067){_0x3e8a71=_0x3e8a71-0x0;var _0x5f4f53=_0xdb28[_0x3e8a71];return _0x5f4f53;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var auth=require(_0x8db2('0x5'));var interaction=require(_0x8db2('0x6'));var config=require(_0x8db2('0x7'));var controller=require(_0x8db2('0x8'));router['get']('/',auth[_0x8db2('0x9')](),controller[_0x8db2('0xa')]);router['get']('/describe',auth[_0x8db2('0x9')](),controller[_0x8db2('0xb')]);router[_0x8db2('0xc')](_0x8db2('0xd'),auth[_0x8db2('0x9')](),controller[_0x8db2('0xe')]);router[_0x8db2('0xc')]('/:id/steps',auth[_0x8db2('0x9')](),controller[_0x8db2('0xf')]);router[_0x8db2('0x10')]('/',auth['isAuthenticated'](),controller[_0x8db2('0x11')]);router[_0x8db2('0x10')]('/:id/steps',auth[_0x8db2('0x9')](),controller[_0x8db2('0x12')]);router[_0x8db2('0x13')](_0x8db2('0xd'),auth[_0x8db2('0x9')](),controller['update']);router['delete'](_0x8db2('0xd'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x14')]);router[_0x8db2('0x15')](_0x8db2('0x16'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x17')]);module[_0x8db2('0x18')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 9b6d92c..be40795 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 _0xd119=['STRING','name'];(function(_0x3b0ad2,_0x2df3e0){var _0x25bcdb=function(_0x4901f2){while(--_0x4901f2){_0x3b0ad2['push'](_0x3b0ad2['shift']());}};_0x25bcdb(++_0x2df3e0);}(_0xd119,0x1b2));var _0x9d11=function(_0x481bdf,_0x231538){_0x481bdf=_0x481bdf-0x0;var _0x281a12=_0xd119[_0x481bdf];return _0x281a12;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9d11('0x0')],'allowNull':![],'unique':_0x9d11('0x1')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5a6c=['STRING','name','sequelize','exports'];(function(_0x2203ac,_0x459fc1){var _0x1ab004=function(_0x2bf5b4){while(--_0x2bf5b4){_0x2203ac['push'](_0x2203ac['shift']());}};_0x1ab004(++_0x459fc1);}(_0x5a6c,0x14a));var _0xc5a6=function(_0x2b58fb,_0x353e04){_0x2b58fb=_0x2b58fb-0x0;var _0xd865fa=_0x5a6c[_0x2b58fb];return _0xd865fa;};'use strict';var Sequelize=require(_0xc5a6('0x0'));module[_0xc5a6('0x1')]={'name':{'type':Sequelize[_0xc5a6('0x2')],'allowNull':![],'unique':_0xc5a6('0x3')},'description':{'type':Sequelize[_0xc5a6('0x2')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 0a621d9..4d4b2b0 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 _0xe74d=['html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','register','end','status','offset','limit','json','apply','reject','update','then','destroy','get','CustomDashboards','sendStatus','error','stack','name','send','index','Dashboard','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','map','type','key','VIRTUAL','field','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','body','updatedAt','userProfileId','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','stringify','DashboardId','DashboardItem','getItems','findOne','nolimit'];(function(_0x35256c,_0x1a16b7){var _0x32d3a3=function(_0x24e76d){while(--_0x24e76d){_0x35256c['push'](_0x35256c['shift']());}};_0x32d3a3(++_0x1a16b7);}(_0xe74d,0x16e));var _0xde74=function(_0x1f1170,_0x3b5783){_0x1f1170=_0x1f1170-0x0;var _0x127b7b=_0xe74d[_0x1f1170];return _0x127b7b;};'use strict';var pdf=require(_0xde74('0x0'));var emlformat=require(_0xde74('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xde74('0x2'));var rp=require(_0xde74('0x3'));var moment=require(_0xde74('0x4'));var BPromise=require(_0xde74('0x5'));var Mustache=require('mustache');var util=require(_0xde74('0x6'));var path=require(_0xde74('0x7'));var sox=require(_0xde74('0x8'));var csv=require(_0xde74('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xde74('0xa'));var squel=require(_0xde74('0xb'));var crypto=require(_0xde74('0xc'));var jsforce=require(_0xde74('0xd'));var deskjs=require(_0xde74('0xe'));var toCsv=require(_0xde74('0x9'));var querystring=require(_0xde74('0xf'));var Papa=require(_0xde74('0x10'));var Redis=require(_0xde74('0x11'));var authService=require(_0xde74('0x12'));var qs=require(_0xde74('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xde74('0x14'));var utils=require(_0xde74('0x15'));var config=require(_0xde74('0x16'));var db=require('../../mysqldb')['db'];config[_0xde74('0x17')]=_['defaults'](config['redis'],{'host':_0xde74('0x18'),'port':0x18eb});var socket=require(_0xde74('0x19'))(new Redis(config[_0xde74('0x17')]));require('./dashboard.socket')[_0xde74('0x1a')](socket);function respondWithStatusCode(_0x125c9b,_0x21d380){_0x21d380=_0x21d380||0xcc;return function(_0x443bdb){if(_0x443bdb){return _0x125c9b['sendStatus'](_0x21d380);}return _0x125c9b['status'](_0x21d380)[_0xde74('0x1b')]();};}function respondWithResult(_0xa376,_0x2a3a95){_0x2a3a95=_0x2a3a95||0xc8;return function(_0x4adff7){if(_0x4adff7){return _0xa376[_0xde74('0x1c')](_0x2a3a95)['json'](_0x4adff7);}};}function respondWithFilteredResult(_0x45b34a,_0x46f08e){return function(_0x590702){if(_0x590702){var _0x4c4ba8=_0x590702['count'],_0x411357=_0x46f08e['offset'],_0x14d63b=_0x46f08e[_0xde74('0x1d')]+_0x46f08e[_0xde74('0x1e')],_0x547039;if(_0x14d63b>=_0x4c4ba8){_0x14d63b=_0x4c4ba8;_0x547039=0xc8;}else{_0x547039=0xce;}_0x45b34a[_0xde74('0x1c')](_0x547039);return _0x45b34a['set']('Content-Range',_0x411357+'-'+_0x14d63b+'/'+_0x4c4ba8)[_0xde74('0x1f')](_0x590702);}return null;};}function patchUpdates(_0x5aa397){return function(_0x5abd06){try{jsonpatch[_0xde74('0x20')](_0x5abd06,_0x5aa397,!![]);}catch(_0x961d78){return BPromise[_0xde74('0x21')](_0x961d78);}return _0x5abd06['save']();};}function saveUpdates(_0x1f2ae4,_0x7934fc){return function(_0x35348b){if(_0x35348b){return _0x35348b[_0xde74('0x22')](_0x1f2ae4)[_0xde74('0x23')](function(_0x17e1e0){return _0x17e1e0;});}return null;};}function removeEntity(_0x487321,_0x260821){return function(_0x374e4c){if(_0x374e4c){return _0x374e4c[_0xde74('0x24')]()['then'](function(){var _0x4641fe=_0x374e4c[_0xde74('0x25')]({'plain':!![]});var _0x1d950a=_0xde74('0x26');return db['UserProfileResource'][_0xde74('0x24')]({'where':{'type':_0x1d950a,'resourceId':_0x4641fe['id']}})[_0xde74('0x23')](function(){return _0x374e4c;});})[_0xde74('0x23')](function(){_0x487321[_0xde74('0x1c')](0xcc)[_0xde74('0x1b')]();});}};}function handleEntityNotFound(_0x5f59bf,_0x4f4a57){return function(_0x439ac6){if(!_0x439ac6){_0x5f59bf[_0xde74('0x27')](0x194);}return _0x439ac6;};}function handleError(_0x4ccc60,_0x1cef51){_0x1cef51=_0x1cef51||0x1f4;return function(_0x3f5ed8){logger[_0xde74('0x28')](_0x3f5ed8[_0xde74('0x29')]);if(_0x3f5ed8['name']){delete _0x3f5ed8[_0xde74('0x2a')];}_0x4ccc60[_0xde74('0x1c')](_0x1cef51)[_0xde74('0x2b')](_0x3f5ed8);};}exports[_0xde74('0x2c')]=function(_0x1562eb,_0x8fb115){var _0x325859={},_0x4ddb43={},_0x55c567={'count':0x0,'rows':[]};var _0x2ed06a=db[_0xde74('0x2d')]['rawAttributes'];_0x4ddb43[_0xde74('0x2e')]=_['keys'](_0x2ed06a);_0x4ddb43[_0xde74('0x2f')]=_[_0xde74('0x30')](_0x1562eb[_0xde74('0x2f')]);_0x4ddb43[_0xde74('0x31')]=_[_0xde74('0x32')](_0x4ddb43[_0xde74('0x2e')],_0x4ddb43['query']);_0x325859[_0xde74('0x33')]=_[_0xde74('0x32')](_0x4ddb43['model'],qs[_0xde74('0x34')](_0x1562eb[_0xde74('0x2f')]['fields']));_0x325859[_0xde74('0x33')]=_0x325859[_0xde74('0x33')][_0xde74('0x35')]?_0x325859[_0xde74('0x33')]:_0x4ddb43['model'];if(!_0x1562eb[_0xde74('0x2f')][_0xde74('0x36')]('nolimit')){_0x325859[_0xde74('0x1e')]=qs['limit'](_0x1562eb[_0xde74('0x2f')][_0xde74('0x1e')]);_0x325859[_0xde74('0x1d')]=qs[_0xde74('0x1d')](_0x1562eb[_0xde74('0x2f')][_0xde74('0x1d')]);}_0x325859[_0xde74('0x37')]=qs[_0xde74('0x38')](_0x1562eb[_0xde74('0x2f')][_0xde74('0x38')]);_0x325859['where']=qs['filters'](_[_0xde74('0x39')](_0x1562eb[_0xde74('0x2f')],_0x4ddb43['filters']));if(_0x1562eb['query'][_0xde74('0x3a')]){_0x325859['where']=_[_0xde74('0x3b')](_0x325859[_0xde74('0x3c')],{'$or':_[_0xde74('0x3d')](_0x2ed06a,function(_0x2d3e18){if(_0x2d3e18[_0xde74('0x3e')][_0xde74('0x3f')]!==_0xde74('0x40')){var _0x3a3e60={};_0x3a3e60[_0x2d3e18[_0xde74('0x41')]]={'$like':'%'+_0x1562eb[_0xde74('0x2f')][_0xde74('0x3a')]+'%'};return _0x3a3e60;}})});}_0x325859=_[_0xde74('0x3b')]({},_0x325859,_0x1562eb['options']);var _0x4e2b69={'where':_0x325859[_0xde74('0x3c')]};return db[_0xde74('0x2d')][_0xde74('0x42')](_0x4e2b69)[_0xde74('0x23')](function(_0xccad84){_0x55c567['count']=_0xccad84;if(_0x1562eb[_0xde74('0x2f')][_0xde74('0x43')]){_0x325859[_0xde74('0x44')]=[{'all':!![]}];}return db[_0xde74('0x2d')][_0xde74('0x45')](_0x325859);})[_0xde74('0x23')](function(_0x2bfc7c){_0x55c567[_0xde74('0x46')]=_0x2bfc7c;return _0x55c567;})['then'](respondWithFilteredResult(_0x8fb115,_0x325859))[_0xde74('0x47')](handleError(_0x8fb115,null));};exports[_0xde74('0x48')]=function(_0x4070ee,_0x1a57a8){var _0x4cdb18={'raw':![],'where':{'id':_0x4070ee[_0xde74('0x49')]['id']}},_0x1d3cc0={};_0x1d3cc0[_0xde74('0x2e')]=_[_0xde74('0x30')](db[_0xde74('0x2d')][_0xde74('0x4a')]);_0x1d3cc0['query']=_['keys'](_0x4070ee[_0xde74('0x2f')]);_0x1d3cc0[_0xde74('0x31')]=_[_0xde74('0x32')](_0x1d3cc0[_0xde74('0x2e')],_0x1d3cc0[_0xde74('0x2f')]);_0x4cdb18['attributes']=_[_0xde74('0x32')](_0x1d3cc0[_0xde74('0x2e')],qs[_0xde74('0x34')](_0x4070ee['query']['fields']));_0x4cdb18[_0xde74('0x33')]=_0x4cdb18[_0xde74('0x33')][_0xde74('0x35')]?_0x4cdb18['attributes']:_0x1d3cc0[_0xde74('0x2e')];if(_0x4070ee[_0xde74('0x2f')]['includeAll']){_0x4cdb18[_0xde74('0x44')]=[{'all':!![]}];}_0x4cdb18=_[_0xde74('0x3b')]({},_0x4cdb18,_0x4070ee[_0xde74('0x4b')]);return db[_0xde74('0x2d')][_0xde74('0x4c')](_0x4cdb18)['then'](handleEntityNotFound(_0x1a57a8,null))['then'](respondWithResult(_0x1a57a8,null))['catch'](handleError(_0x1a57a8,null));};exports[_0xde74('0x4d')]=function(_0x82439b,_0x27b88a){return db[_0xde74('0x2d')][_0xde74('0x4d')](_0x82439b['body'],{})[_0xde74('0x23')](function(_0xb243c4){var _0x5252eb=_0x82439b[_0xde74('0x4e')][_0xde74('0x25')]({'plain':!![]});if(!_0x5252eb)throw new Error(_0xde74('0x4f'));if(_0x5252eb[_0xde74('0x50')]==='user'){var _0xcb6a56=_0xb243c4['get']({'plain':!![]});var _0x108d63=_0xde74('0x26');return db[_0xde74('0x51')][_0xde74('0x4c')]({'where':{'name':_0x108d63,'userProfileId':_0x5252eb['userProfileId']},'raw':!![]})[_0xde74('0x23')](function(_0x2c5083){if(_0x2c5083&&_0x2c5083[_0xde74('0x52')]===0x0){return db[_0xde74('0x53')][_0xde74('0x4d')]({'name':_0xcb6a56['name'],'resourceId':_0xcb6a56['id'],'type':_0x2c5083[_0xde74('0x2a')],'sectionId':_0x2c5083['id']},{})['then'](function(){return _0xb243c4;});}else{return _0xb243c4;}})[_0xde74('0x47')](function(_0x5971e4){logger[_0xde74('0x28')](_0xde74('0x54'),_0x5971e4);throw _0x5971e4;});}return _0xb243c4;})[_0xde74('0x23')](respondWithResult(_0x27b88a,0xc9))['catch'](handleError(_0x27b88a,null));};exports[_0xde74('0x55')]=function(_0x2ba8f4,_0x2888e6){var _0x2fa9e2={'raw':![],'where':{'id':_0x2ba8f4[_0xde74('0x49')]['id']}},_0x435418={};_0x435418[_0xde74('0x2e')]=_[_0xde74('0x30')](db[_0xde74('0x2d')][_0xde74('0x4a')]);_0x2fa9e2[_0xde74('0x33')]=_['intersection'](_0x435418[_0xde74('0x2e')],qs['fields'](_0x2ba8f4[_0xde74('0x2f')][_0xde74('0x34')]));_0x2fa9e2['attributes']=_0x2fa9e2[_0xde74('0x33')][_0xde74('0x35')]?_0x2fa9e2[_0xde74('0x33')]:_0x435418['model'];if(_0x2ba8f4[_0xde74('0x2f')]['includeAll']){_0x2fa9e2[_0xde74('0x44')]=[{'all':!![]}];}_0x2fa9e2=_[_0xde74('0x3b')]({},_0x2fa9e2,_0x2ba8f4['options']);return db[_0xde74('0x2d')][_0xde74('0x4c')](_0x2fa9e2)[_0xde74('0x23')](handleEntityNotFound(_0x2888e6,null))['then'](function(_0x2ea7b5){if(_0x2ea7b5){var _0x5176f3=_0x2ea7b5[_0xde74('0x25')]({'plain':!![]});_0x5176f3=qs[_0xde74('0x56')](_0x5176f3,['id',_0xde74('0x57'),'updatedAt']);_0x2ba8f4[_0xde74('0x58')]=_['omit'](_0x2ba8f4[_0xde74('0x58')],['id',_0xde74('0x57'),_0xde74('0x59')]);return db['Dashboard'][_0xde74('0x4d')](_[_0xde74('0x3b')](_0x5176f3,_0x2ba8f4[_0xde74('0x58')]),{'include':_0x2ba8f4[_0xde74('0x2f')][_0xde74('0x43')]?[{'all':!![]}]:undefined})['then'](function(_0x253a6f){var _0x32f89f=_0x2ba8f4[_0xde74('0x4e')][_0xde74('0x25')]({'plain':!![]});if(!_0x32f89f)throw new Error(_0xde74('0x4f'));if(_0x32f89f[_0xde74('0x50')]==='user'){var _0x17d29d=_0x253a6f[_0xde74('0x25')]({'plain':!![]});var _0x5d9f13=_0xde74('0x26');return db[_0xde74('0x51')][_0xde74('0x4c')]({'where':{'name':_0x5d9f13,'userProfileId':_0x32f89f[_0xde74('0x5a')]},'raw':!![]})[_0xde74('0x23')](function(_0x112854){if(_0x112854&&_0x112854[_0xde74('0x52')]===0x0){return db['UserProfileResource'][_0xde74('0x4d')]({'name':_0x17d29d[_0xde74('0x2a')],'resourceId':_0x17d29d['id'],'type':_0x112854['name'],'sectionId':_0x112854['id']},{})['then'](function(){return _0x253a6f;});}else{return _0x253a6f;}})[_0xde74('0x47')](function(_0x39bcf7){logger[_0xde74('0x28')](_0xde74('0x54'),_0x39bcf7);throw _0x39bcf7;});}return _0x253a6f;});}})['then'](respondWithResult(_0x2888e6,0xc9))['catch'](handleError(_0x2888e6,null));};exports['update']=function(_0x5039e7,_0xffd130){if(_0x5039e7[_0xde74('0x58')]['id']){delete _0x5039e7[_0xde74('0x58')]['id'];}return db[_0xde74('0x2d')][_0xde74('0x4c')]({'where':{'id':_0x5039e7[_0xde74('0x49')]['id']}})[_0xde74('0x23')](handleEntityNotFound(_0xffd130,null))[_0xde74('0x23')](saveUpdates(_0x5039e7['body'],null))[_0xde74('0x23')](respondWithResult(_0xffd130,null))[_0xde74('0x47')](handleError(_0xffd130,null));};exports['destroy']=function(_0x117683,_0x4e7e4b){return db[_0xde74('0x2d')][_0xde74('0x4c')]({'where':{'id':_0x117683[_0xde74('0x49')]['id']}})['then'](handleEntityNotFound(_0x4e7e4b,null))['then'](removeEntity(_0x4e7e4b,null))[_0xde74('0x47')](handleError(_0x4e7e4b,null));};function widgetAttributes(_0x1d986b){try{switch(_0x1d986b[_0xde74('0x3e')]){case'iframe':return[{'name':_0xde74('0x5b'),'value':_0x1d986b[_0xde74('0x5b')]||(_0x1d986b[_0xde74('0x5c')]&&_0x1d986b[_0xde74('0x5c')][0x0]?_0x1d986b[_0xde74('0x5c')][0x0][_0xde74('0x5d')]:undefined)||_0xde74('0x5e')}];case _0xde74('0x5f'):return[{'name':_0xde74('0x60'),'value':_0x1d986b[_0xde74('0x60')]||(_0x1d986b['attrs']&&_0x1d986b[_0xde74('0x5c')][0x0]?_0x1d986b[_0xde74('0x5c')][0x0][_0xde74('0x5d')]:undefined)||''}];case _0xde74('0x61'):return[{'name':_0xde74('0x62'),'value':_0x1d986b['attrHourFormat']||(_0x1d986b[_0xde74('0x5c')]&&_0x1d986b[_0xde74('0x5c')][0x0]?_0x1d986b[_0xde74('0x5c')][0x0][_0xde74('0x5d')]:undefined)||_0xde74('0x63')},{'name':_0xde74('0x64'),'value':_0x1d986b[_0xde74('0x64')]||(_0x1d986b['attrs']&&_0x1d986b[_0xde74('0x5c')][0x1]?_0x1d986b[_0xde74('0x5c')][0x1][_0xde74('0x5d')]:undefined)||_0xde74('0x65')},{'name':_0xde74('0x66'),'value':_0x1d986b['attrFontSize']||(_0x1d986b[_0xde74('0x5c')]&&_0x1d986b[_0xde74('0x5c')][0x2]?_0x1d986b['attrs'][0x2][_0xde74('0x5d')]:undefined)||0xc}];case _0xde74('0x67'):return[{'name':_0xde74('0x68'),'value':_0x1d986b[_0xde74('0x68')]||(_0x1d986b[_0xde74('0x5c')]&&_0x1d986b['attrs'][0x0]?_0x1d986b['attrs'][0x0][_0xde74('0x5d')]:undefined)||_0xde74('0x69')},{'name':_0xde74('0x6a'),'value':_0x1d986b[_0xde74('0x6a')]||(_0x1d986b['attrs']&&_0x1d986b[_0xde74('0x5c')][0x1]?_0x1d986b[_0xde74('0x5c')][0x1]['value']:undefined)||[]},{'name':_0xde74('0x66'),'value':_0x1d986b[_0xde74('0x66')]||(_0x1d986b[_0xde74('0x5c')]&&_0x1d986b[_0xde74('0x5c')][0x2]?_0x1d986b[_0xde74('0x5c')][0x2]['value']:undefined)||0x14}];case _0xde74('0x6b'):case _0xde74('0x6c'):return[{'name':_0xde74('0x6d'),'value':_0x1d986b[_0xde74('0x6d')]||(_0x1d986b[_0xde74('0x5c')]&&_0x1d986b[_0xde74('0x5c')][0x0]?_0x1d986b[_0xde74('0x5c')][0x0][_0xde74('0x5d')]:undefined)||_0xde74('0x69')},{'name':'attrSerie2','value':_0x1d986b[_0xde74('0x6e')]||(_0x1d986b['attrs']&&_0x1d986b[_0xde74('0x5c')][0x1]?_0x1d986b['attrs'][0x1][_0xde74('0x5d')]:undefined)||null},{'name':_0xde74('0x6f'),'value':_0x1d986b[_0xde74('0x6f')]||(_0x1d986b[_0xde74('0x5c')]&&_0x1d986b[_0xde74('0x5c')][0x2]?_0x1d986b[_0xde74('0x5c')][0x2][_0xde74('0x5d')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x1d986b[_0xde74('0x6a')]||(_0x1d986b[_0xde74('0x5c')]&&_0x1d986b[_0xde74('0x5c')][0x3]?_0x1d986b[_0xde74('0x5c')][0x3][_0xde74('0x5d')]:undefined)||[]}];case _0xde74('0x70'):return[{'name':_0xde74('0x71'),'type':_0x1d986b[_0xde74('0x72')]||(_0x1d986b[_0xde74('0x5c')]&&_0x1d986b['attrs'][0x0]?_0x1d986b[_0xde74('0x5c')][0x0][_0xde74('0x3e')]:undefined)||null,'value':_0x1d986b[_0xde74('0x71')]||(_0x1d986b[_0xde74('0x5c')]&&_0x1d986b['attrs'][0x0]?_0x1d986b[_0xde74('0x5c')][0x0][_0xde74('0x5d')]:undefined)||null},{'name':'attrRefresh','value':_0x1d986b[_0xde74('0x73')]||(_0x1d986b[_0xde74('0x5c')]&&_0x1d986b[_0xde74('0x5c')][0x1]?_0x1d986b['attrs'][0x1][_0xde74('0x5d')]:undefined)||0x0}];default:return[];}}catch(_0x52a650){logger[_0xde74('0x28')]('widgetAttributes:\x20%s',JSON[_0xde74('0x74')](_0x52a650));return[];}}exports['addItem']=function(_0x5cc3f4,_0x1846cf,_0x4fe536){if(_0x5cc3f4[_0xde74('0x58')]['id']){delete _0x5cc3f4[_0xde74('0x58')]['id'];}return db['Dashboard']['find']({'where':{'id':_0x5cc3f4['params']['id']}})['then'](handleEntityNotFound(_0x1846cf,null))[_0xde74('0x23')](function(_0x131393){if(_0x131393){_0x5cc3f4['body'][_0xde74('0x75')]=_0x131393['id'];_0x5cc3f4[_0xde74('0x58')]['attrs']=widgetAttributes(_0x5cc3f4[_0xde74('0x58')]);return db[_0xde74('0x76')]['create'](_0x5cc3f4['body']);}})[_0xde74('0x23')](respondWithResult(_0x1846cf,null))[_0xde74('0x47')](handleError(_0x1846cf,null));};exports[_0xde74('0x77')]=function(_0xc5d75f,_0x76d1f4,_0xe8ec3b){var _0x2d8f7f={};var _0x3ebbe8={};var _0x72d77d;var _0xa3e2dd;return db[_0xde74('0x2d')][_0xde74('0x78')]({'where':{'id':_0xc5d75f['params']['id']}})['then'](handleEntityNotFound(_0x76d1f4,null))[_0xde74('0x23')](function(_0x254c7f){if(_0x254c7f){_0x72d77d=_0x254c7f;_0x3ebbe8[_0xde74('0x2e')]=_[_0xde74('0x30')](db[_0xde74('0x76')]['rawAttributes']);_0x3ebbe8[_0xde74('0x2f')]=_[_0xde74('0x30')](_0xc5d75f[_0xde74('0x2f')]);_0x3ebbe8[_0xde74('0x31')]=_[_0xde74('0x32')](_0x3ebbe8[_0xde74('0x2e')],_0x3ebbe8[_0xde74('0x2f')]);_0x2d8f7f[_0xde74('0x33')]=_[_0xde74('0x32')](_0x3ebbe8[_0xde74('0x2e')],qs[_0xde74('0x34')](_0xc5d75f[_0xde74('0x2f')][_0xde74('0x34')]));_0x2d8f7f[_0xde74('0x33')]=_0x2d8f7f[_0xde74('0x33')]['length']?_0x2d8f7f['attributes']:_0x3ebbe8[_0xde74('0x2e')];_0x2d8f7f[_0xde74('0x37')]=qs[_0xde74('0x38')](_0xc5d75f[_0xde74('0x2f')][_0xde74('0x38')]);_0x2d8f7f['where']=qs[_0xde74('0x31')](_[_0xde74('0x39')](_0xc5d75f[_0xde74('0x2f')],_0x3ebbe8[_0xde74('0x31')]));if(_0xc5d75f[_0xde74('0x2f')]['filter']){_0x2d8f7f[_0xde74('0x3c')]=_['merge'](_0x2d8f7f[_0xde74('0x3c')],{'$or':_[_0xde74('0x3d')](_0x2d8f7f[_0xde74('0x33')],function(_0x2acde8){var _0x2c4299={};_0x2c4299[_0x2acde8]={'$like':'%'+_0xc5d75f[_0xde74('0x2f')]['filter']+'%'};return _0x2c4299;})});}_0x2d8f7f=_['merge']({},_0x2d8f7f,_0xc5d75f[_0xde74('0x4b')]);return _0x72d77d[_0xde74('0x77')](_0x2d8f7f);}})[_0xde74('0x23')](function(_0x7f058f){if(_0x7f058f){_0xa3e2dd=_0x7f058f[_0xde74('0x35')];if(!_0xc5d75f[_0xde74('0x2f')][_0xde74('0x36')](_0xde74('0x79'))){_0x2d8f7f[_0xde74('0x1e')]=qs['limit'](_0xc5d75f['query']['limit']);_0x2d8f7f['offset']=qs[_0xde74('0x1d')](_0xc5d75f[_0xde74('0x2f')][_0xde74('0x1d')]);}return _0x72d77d[_0xde74('0x77')](_0x2d8f7f);}})[_0xde74('0x23')](function(_0x5516ad){if(_0x5516ad){return _0x5516ad?{'count':_0xa3e2dd,'rows':_0x5516ad}:null;}})[_0xde74('0x23')](respondWithResult(_0x76d1f4,null))[_0xde74('0x47')](handleError(_0x76d1f4,null));}; \ No newline at end of file +var _0xb9f7=['error','stack','name','send','Dashboard','rawAttributes','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','field','options','include','findAll','rows','catch','show','params','includeAll','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','clone','omit','createdAt','updatedAt','role','update','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','map','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/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','localhost','register','status','end','json','count','offset','set','Content-Range','apply','save','then','destroy','get','CustomDashboards'];(function(_0x552252,_0xdb0d75){var _0x16ae8d=function(_0x1cebe2){while(--_0x1cebe2){_0x552252['push'](_0x552252['shift']());}};_0x16ae8d(++_0xdb0d75);}(_0xb9f7,0xca));var _0x7b9f=function(_0x100e36,_0x4da225){_0x100e36=_0x100e36-0x0;var _0x1df0c9=_0xb9f7[_0x100e36];return _0x1df0c9;};'use strict';var pdf=require(_0x7b9f('0x0'));var emlformat=require(_0x7b9f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7b9f('0x2'));var jsonpatch=require(_0x7b9f('0x3'));var rp=require(_0x7b9f('0x4'));var moment=require(_0x7b9f('0x5'));var BPromise=require(_0x7b9f('0x6'));var Mustache=require(_0x7b9f('0x7'));var util=require(_0x7b9f('0x8'));var path=require(_0x7b9f('0x9'));var sox=require(_0x7b9f('0xa'));var csv=require(_0x7b9f('0xb'));var ejs=require(_0x7b9f('0xc'));var fs=require('fs');var _=require(_0x7b9f('0xd'));var squel=require(_0x7b9f('0xe'));var crypto=require('crypto');var jsforce=require(_0x7b9f('0xf'));var deskjs=require(_0x7b9f('0x10'));var toCsv=require(_0x7b9f('0xb'));var querystring=require(_0x7b9f('0x11'));var Papa=require(_0x7b9f('0x12'));var Redis=require(_0x7b9f('0x13'));var authService=require(_0x7b9f('0x14'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x7b9f('0x15'));var logger=require(_0x7b9f('0x16'))(_0x7b9f('0x17'));var utils=require(_0x7b9f('0x18'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x7b9f('0x19')]=_[_0x7b9f('0x1a')](config[_0x7b9f('0x19')],{'host':_0x7b9f('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7b9f('0x19')]));require('./dashboard.socket')[_0x7b9f('0x1c')](socket);function respondWithStatusCode(_0x2689c7,_0x289b39){_0x289b39=_0x289b39||0xcc;return function(_0x14cecb){if(_0x14cecb){return _0x2689c7['sendStatus'](_0x289b39);}return _0x2689c7[_0x7b9f('0x1d')](_0x289b39)[_0x7b9f('0x1e')]();};}function respondWithResult(_0x5673b5,_0x5f2820){_0x5f2820=_0x5f2820||0xc8;return function(_0x24185c){if(_0x24185c){return _0x5673b5['status'](_0x5f2820)[_0x7b9f('0x1f')](_0x24185c);}};}function respondWithFilteredResult(_0x3b8085,_0x45cf93){return function(_0x50ee9f){if(_0x50ee9f){var _0x56e2a4=_0x50ee9f[_0x7b9f('0x20')],_0x551968=_0x45cf93['offset'],_0x6c84aa=_0x45cf93[_0x7b9f('0x21')]+_0x45cf93['limit'],_0x3ded63;if(_0x6c84aa>=_0x56e2a4){_0x6c84aa=_0x56e2a4;_0x3ded63=0xc8;}else{_0x3ded63=0xce;}_0x3b8085[_0x7b9f('0x1d')](_0x3ded63);return _0x3b8085[_0x7b9f('0x22')](_0x7b9f('0x23'),_0x551968+'-'+_0x6c84aa+'/'+_0x56e2a4)[_0x7b9f('0x1f')](_0x50ee9f);}return null;};}function patchUpdates(_0x2f8e79){return function(_0x350c75){try{jsonpatch[_0x7b9f('0x24')](_0x350c75,_0x2f8e79,!![]);}catch(_0x378f4a){return BPromise['reject'](_0x378f4a);}return _0x350c75[_0x7b9f('0x25')]();};}function saveUpdates(_0xc26daa,_0x5e90af){return function(_0xbf6c47){if(_0xbf6c47){return _0xbf6c47['update'](_0xc26daa)[_0x7b9f('0x26')](function(_0x2163a0){return _0x2163a0;});}return null;};}function removeEntity(_0x1470d1,_0xaec2fd){return function(_0x4d767b){if(_0x4d767b){return _0x4d767b[_0x7b9f('0x27')]()[_0x7b9f('0x26')](function(){var _0x2f0900=_0x4d767b[_0x7b9f('0x28')]({'plain':!![]});var _0x1d1f72=_0x7b9f('0x29');return db['UserProfileResource'][_0x7b9f('0x27')]({'where':{'type':_0x1d1f72,'resourceId':_0x2f0900['id']}})['then'](function(){return _0x4d767b;});})[_0x7b9f('0x26')](function(){_0x1470d1[_0x7b9f('0x1d')](0xcc)[_0x7b9f('0x1e')]();});}};}function handleEntityNotFound(_0x246e8b,_0x543d55){return function(_0x2392ee){if(!_0x2392ee){_0x246e8b['sendStatus'](0x194);}return _0x2392ee;};}function handleError(_0x2e0db2,_0x3ece4b){_0x3ece4b=_0x3ece4b||0x1f4;return function(_0x1812e2){logger[_0x7b9f('0x2a')](_0x1812e2[_0x7b9f('0x2b')]);if(_0x1812e2[_0x7b9f('0x2c')]){delete _0x1812e2[_0x7b9f('0x2c')];}_0x2e0db2['status'](_0x3ece4b)[_0x7b9f('0x2d')](_0x1812e2);};}exports['index']=function(_0x11ae8c,_0x404e23){var _0xa0d7b={},_0x34a0dd={},_0x189b8d={'count':0x0,'rows':[]};var _0x210dca=db[_0x7b9f('0x2e')][_0x7b9f('0x2f')];_0x34a0dd[_0x7b9f('0x30')]=_['keys'](_0x210dca);_0x34a0dd[_0x7b9f('0x31')]=_[_0x7b9f('0x32')](_0x11ae8c[_0x7b9f('0x31')]);_0x34a0dd[_0x7b9f('0x33')]=_['intersection'](_0x34a0dd[_0x7b9f('0x30')],_0x34a0dd['query']);_0xa0d7b[_0x7b9f('0x34')]=_[_0x7b9f('0x35')](_0x34a0dd[_0x7b9f('0x30')],qs[_0x7b9f('0x36')](_0x11ae8c[_0x7b9f('0x31')][_0x7b9f('0x36')]));_0xa0d7b[_0x7b9f('0x34')]=_0xa0d7b[_0x7b9f('0x34')][_0x7b9f('0x37')]?_0xa0d7b[_0x7b9f('0x34')]:_0x34a0dd[_0x7b9f('0x30')];if(!_0x11ae8c[_0x7b9f('0x31')][_0x7b9f('0x38')](_0x7b9f('0x39'))){_0xa0d7b[_0x7b9f('0x3a')]=qs['limit'](_0x11ae8c[_0x7b9f('0x31')][_0x7b9f('0x3a')]);_0xa0d7b[_0x7b9f('0x21')]=qs['offset'](_0x11ae8c['query'][_0x7b9f('0x21')]);}_0xa0d7b[_0x7b9f('0x3b')]=qs['sort'](_0x11ae8c[_0x7b9f('0x31')][_0x7b9f('0x3c')]);_0xa0d7b[_0x7b9f('0x3d')]=qs[_0x7b9f('0x33')](_[_0x7b9f('0x3e')](_0x11ae8c[_0x7b9f('0x31')],_0x34a0dd[_0x7b9f('0x33')]));if(_0x11ae8c[_0x7b9f('0x31')][_0x7b9f('0x3f')]){_0xa0d7b['where']=_[_0x7b9f('0x40')](_0xa0d7b[_0x7b9f('0x3d')],{'$or':_['map'](_0x210dca,function(_0x423697){if(_0x423697[_0x7b9f('0x41')]['key']!=='VIRTUAL'){var _0x505ed4={};_0x505ed4[_0x423697[_0x7b9f('0x42')]]={'$like':'%'+_0x11ae8c[_0x7b9f('0x31')][_0x7b9f('0x3f')]+'%'};return _0x505ed4;}})});}_0xa0d7b=_[_0x7b9f('0x40')]({},_0xa0d7b,_0x11ae8c[_0x7b9f('0x43')]);var _0x310eba={'where':_0xa0d7b[_0x7b9f('0x3d')]};return db[_0x7b9f('0x2e')]['count'](_0x310eba)[_0x7b9f('0x26')](function(_0x2eec03){_0x189b8d['count']=_0x2eec03;if(_0x11ae8c[_0x7b9f('0x31')]['includeAll']){_0xa0d7b[_0x7b9f('0x44')]=[{'all':!![]}];}return db[_0x7b9f('0x2e')][_0x7b9f('0x45')](_0xa0d7b);})['then'](function(_0x1db8a6){_0x189b8d[_0x7b9f('0x46')]=_0x1db8a6;return _0x189b8d;})[_0x7b9f('0x26')](respondWithFilteredResult(_0x404e23,_0xa0d7b))[_0x7b9f('0x47')](handleError(_0x404e23,null));};exports[_0x7b9f('0x48')]=function(_0xf4341f,_0x51f67a){var _0xd96de2={'raw':![],'where':{'id':_0xf4341f[_0x7b9f('0x49')]['id']}},_0xfe756b={};_0xfe756b[_0x7b9f('0x30')]=_[_0x7b9f('0x32')](db[_0x7b9f('0x2e')][_0x7b9f('0x2f')]);_0xfe756b[_0x7b9f('0x31')]=_[_0x7b9f('0x32')](_0xf4341f[_0x7b9f('0x31')]);_0xfe756b[_0x7b9f('0x33')]=_['intersection'](_0xfe756b[_0x7b9f('0x30')],_0xfe756b['query']);_0xd96de2[_0x7b9f('0x34')]=_[_0x7b9f('0x35')](_0xfe756b[_0x7b9f('0x30')],qs[_0x7b9f('0x36')](_0xf4341f[_0x7b9f('0x31')]['fields']));_0xd96de2[_0x7b9f('0x34')]=_0xd96de2[_0x7b9f('0x34')][_0x7b9f('0x37')]?_0xd96de2['attributes']:_0xfe756b[_0x7b9f('0x30')];if(_0xf4341f[_0x7b9f('0x31')][_0x7b9f('0x4a')]){_0xd96de2[_0x7b9f('0x44')]=[{'all':!![]}];}_0xd96de2=_['merge']({},_0xd96de2,_0xf4341f[_0x7b9f('0x43')]);return db[_0x7b9f('0x2e')][_0x7b9f('0x4b')](_0xd96de2)[_0x7b9f('0x26')](handleEntityNotFound(_0x51f67a,null))[_0x7b9f('0x26')](respondWithResult(_0x51f67a,null))[_0x7b9f('0x47')](handleError(_0x51f67a,null));};exports[_0x7b9f('0x4c')]=function(_0x5e7d68,_0x471211){return db['Dashboard']['create'](_0x5e7d68[_0x7b9f('0x4d')],{})[_0x7b9f('0x26')](function(_0x21a16b){var _0x31ba2c=_0x5e7d68[_0x7b9f('0x4e')][_0x7b9f('0x28')]({'plain':!![]});if(!_0x31ba2c)throw new Error(_0x7b9f('0x4f'));if(_0x31ba2c['role']===_0x7b9f('0x4e')){var _0x13f93d=_0x21a16b['get']({'plain':!![]});var _0x3083f3=_0x7b9f('0x29');return db[_0x7b9f('0x50')]['find']({'where':{'name':_0x3083f3,'userProfileId':_0x31ba2c[_0x7b9f('0x51')]},'raw':!![]})[_0x7b9f('0x26')](function(_0x426457){if(_0x426457&&_0x426457[_0x7b9f('0x52')]===0x0){return db[_0x7b9f('0x53')][_0x7b9f('0x4c')]({'name':_0x13f93d['name'],'resourceId':_0x13f93d['id'],'type':_0x426457[_0x7b9f('0x2c')],'sectionId':_0x426457['id']},{})[_0x7b9f('0x26')](function(){return _0x21a16b;});}else{return _0x21a16b;}})[_0x7b9f('0x47')](function(_0x26f022){logger[_0x7b9f('0x2a')](_0x7b9f('0x54'),_0x26f022);throw _0x26f022;});}return _0x21a16b;})[_0x7b9f('0x26')](respondWithResult(_0x471211,0xc9))['catch'](handleError(_0x471211,null));};exports[_0x7b9f('0x55')]=function(_0x8861e6,_0x538834){var _0x80b789={'raw':![],'where':{'id':_0x8861e6[_0x7b9f('0x49')]['id']}},_0x1520d8={};_0x1520d8[_0x7b9f('0x30')]=_[_0x7b9f('0x32')](db[_0x7b9f('0x2e')][_0x7b9f('0x2f')]);_0x80b789[_0x7b9f('0x34')]=_[_0x7b9f('0x35')](_0x1520d8[_0x7b9f('0x30')],qs[_0x7b9f('0x36')](_0x8861e6['query']['fields']));_0x80b789[_0x7b9f('0x34')]=_0x80b789[_0x7b9f('0x34')]['length']?_0x80b789[_0x7b9f('0x34')]:_0x1520d8[_0x7b9f('0x30')];if(_0x8861e6[_0x7b9f('0x31')][_0x7b9f('0x4a')]){_0x80b789[_0x7b9f('0x44')]=[{'all':!![]}];}_0x80b789=_['merge']({},_0x80b789,_0x8861e6[_0x7b9f('0x43')]);return db[_0x7b9f('0x2e')][_0x7b9f('0x4b')](_0x80b789)[_0x7b9f('0x26')](handleEntityNotFound(_0x538834,null))[_0x7b9f('0x26')](function(_0x46a03b){if(_0x46a03b){var _0x123811=_0x46a03b[_0x7b9f('0x28')]({'plain':!![]});_0x123811=qs[_0x7b9f('0x56')](_0x123811,['id',_0x7b9f('0x57'),_0x7b9f('0x58')]);_0x8861e6[_0x7b9f('0x4d')]=_[_0x7b9f('0x56')](_0x8861e6[_0x7b9f('0x4d')],['id',_0x7b9f('0x57'),'updatedAt']);return db[_0x7b9f('0x2e')][_0x7b9f('0x4c')](_[_0x7b9f('0x40')](_0x123811,_0x8861e6[_0x7b9f('0x4d')]),{'include':_0x8861e6['query'][_0x7b9f('0x4a')]?[{'all':!![]}]:undefined})[_0x7b9f('0x26')](function(_0x2a644c){var _0x16bc68=_0x8861e6[_0x7b9f('0x4e')]['get']({'plain':!![]});if(!_0x16bc68)throw new Error(_0x7b9f('0x4f'));if(_0x16bc68[_0x7b9f('0x59')]===_0x7b9f('0x4e')){var _0x5bddee=_0x2a644c[_0x7b9f('0x28')]({'plain':!![]});var _0x40377d=_0x7b9f('0x29');return db[_0x7b9f('0x50')][_0x7b9f('0x4b')]({'where':{'name':_0x40377d,'userProfileId':_0x16bc68[_0x7b9f('0x51')]},'raw':!![]})[_0x7b9f('0x26')](function(_0x4fbb00){if(_0x4fbb00&&_0x4fbb00[_0x7b9f('0x52')]===0x0){return db[_0x7b9f('0x53')][_0x7b9f('0x4c')]({'name':_0x5bddee[_0x7b9f('0x2c')],'resourceId':_0x5bddee['id'],'type':_0x4fbb00[_0x7b9f('0x2c')],'sectionId':_0x4fbb00['id']},{})[_0x7b9f('0x26')](function(){return _0x2a644c;});}else{return _0x2a644c;}})[_0x7b9f('0x47')](function(_0x3a58cc){logger[_0x7b9f('0x2a')](_0x7b9f('0x54'),_0x3a58cc);throw _0x3a58cc;});}return _0x2a644c;});}})[_0x7b9f('0x26')](respondWithResult(_0x538834,0xc9))[_0x7b9f('0x47')](handleError(_0x538834,null));};exports[_0x7b9f('0x5a')]=function(_0x23f3df,_0x285e53){if(_0x23f3df[_0x7b9f('0x4d')]['id']){delete _0x23f3df[_0x7b9f('0x4d')]['id'];}return db[_0x7b9f('0x2e')][_0x7b9f('0x4b')]({'where':{'id':_0x23f3df[_0x7b9f('0x49')]['id']}})[_0x7b9f('0x26')](handleEntityNotFound(_0x285e53,null))[_0x7b9f('0x26')](saveUpdates(_0x23f3df[_0x7b9f('0x4d')],null))[_0x7b9f('0x26')](respondWithResult(_0x285e53,null))['catch'](handleError(_0x285e53,null));};exports[_0x7b9f('0x27')]=function(_0x23aeef,_0x715b85){return db[_0x7b9f('0x2e')][_0x7b9f('0x4b')]({'where':{'id':_0x23aeef[_0x7b9f('0x49')]['id']}})[_0x7b9f('0x26')](handleEntityNotFound(_0x715b85,null))[_0x7b9f('0x26')](removeEntity(_0x715b85,null))['catch'](handleError(_0x715b85,null));};function widgetAttributes(_0x164381){try{switch(_0x164381[_0x7b9f('0x41')]){case _0x7b9f('0x5b'):return[{'name':'attrUrl','value':_0x164381[_0x7b9f('0x5c')]||(_0x164381[_0x7b9f('0x5d')]&&_0x164381[_0x7b9f('0x5d')][0x0]?_0x164381['attrs'][0x0][_0x7b9f('0x5e')]:undefined)||_0x7b9f('0x5f')}];case _0x7b9f('0x60'):return[{'name':_0x7b9f('0x61'),'value':_0x164381[_0x7b9f('0x61')]||(_0x164381[_0x7b9f('0x5d')]&&_0x164381[_0x7b9f('0x5d')][0x0]?_0x164381[_0x7b9f('0x5d')][0x0][_0x7b9f('0x5e')]:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x164381[_0x7b9f('0x62')]||(_0x164381[_0x7b9f('0x5d')]&&_0x164381[_0x7b9f('0x5d')][0x0]?_0x164381[_0x7b9f('0x5d')][0x0]['value']:undefined)||_0x7b9f('0x63')},{'name':_0x7b9f('0x64'),'value':_0x164381[_0x7b9f('0x64')]||(_0x164381[_0x7b9f('0x5d')]&&_0x164381[_0x7b9f('0x5d')][0x1]?_0x164381['attrs'][0x1][_0x7b9f('0x5e')]:undefined)||_0x7b9f('0x65')},{'name':_0x7b9f('0x66'),'value':_0x164381[_0x7b9f('0x66')]||(_0x164381[_0x7b9f('0x5d')]&&_0x164381[_0x7b9f('0x5d')][0x2]?_0x164381[_0x7b9f('0x5d')][0x2][_0x7b9f('0x5e')]:undefined)||0xc}];case _0x7b9f('0x67'):return[{'name':'attrMetric','value':_0x164381[_0x7b9f('0x68')]||(_0x164381[_0x7b9f('0x5d')]&&_0x164381[_0x7b9f('0x5d')][0x0]?_0x164381['attrs'][0x0][_0x7b9f('0x5e')]:undefined)||_0x7b9f('0x69')},{'name':_0x7b9f('0x6a'),'value':_0x164381[_0x7b9f('0x6a')]||(_0x164381[_0x7b9f('0x5d')]&&_0x164381[_0x7b9f('0x5d')][0x1]?_0x164381[_0x7b9f('0x5d')][0x1][_0x7b9f('0x5e')]:undefined)||[]},{'name':_0x7b9f('0x66'),'value':_0x164381['attrFontSize']||(_0x164381[_0x7b9f('0x5d')]&&_0x164381[_0x7b9f('0x5d')][0x2]?_0x164381[_0x7b9f('0x5d')][0x2][_0x7b9f('0x5e')]:undefined)||0x14}];case _0x7b9f('0x6b'):case _0x7b9f('0x6c'):return[{'name':_0x7b9f('0x6d'),'value':_0x164381['attrSerie1']||(_0x164381[_0x7b9f('0x5d')]&&_0x164381['attrs'][0x0]?_0x164381[_0x7b9f('0x5d')][0x0][_0x7b9f('0x5e')]:undefined)||_0x7b9f('0x69')},{'name':'attrSerie2','value':_0x164381[_0x7b9f('0x6e')]||(_0x164381['attrs']&&_0x164381[_0x7b9f('0x5d')][0x1]?_0x164381[_0x7b9f('0x5d')][0x1]['value']:undefined)||null},{'name':_0x7b9f('0x6f'),'value':_0x164381['attrSerie3']||(_0x164381['attrs']&&_0x164381[_0x7b9f('0x5d')][0x2]?_0x164381[_0x7b9f('0x5d')][0x2]['value']:undefined)||null},{'name':_0x7b9f('0x6a'),'value':_0x164381[_0x7b9f('0x6a')]||(_0x164381['attrs']&&_0x164381[_0x7b9f('0x5d')][0x3]?_0x164381[_0x7b9f('0x5d')][0x3][_0x7b9f('0x5e')]:undefined)||[]}];case'web-report':return[{'name':_0x7b9f('0x70'),'type':_0x164381['reportType']||(_0x164381['attrs']&&_0x164381[_0x7b9f('0x5d')][0x0]?_0x164381[_0x7b9f('0x5d')][0x0][_0x7b9f('0x41')]:undefined)||null,'value':_0x164381[_0x7b9f('0x70')]||(_0x164381[_0x7b9f('0x5d')]&&_0x164381[_0x7b9f('0x5d')][0x0]?_0x164381[_0x7b9f('0x5d')][0x0]['value']:undefined)||null},{'name':_0x7b9f('0x71'),'value':_0x164381['attrRefresh']||(_0x164381[_0x7b9f('0x5d')]&&_0x164381['attrs'][0x1]?_0x164381[_0x7b9f('0x5d')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x439509){logger['error'](_0x7b9f('0x72'),JSON[_0x7b9f('0x73')](_0x439509));return[];}}exports[_0x7b9f('0x74')]=function(_0xc175fa,_0x2cdbbf,_0x480250){if(_0xc175fa['body']['id']){delete _0xc175fa[_0x7b9f('0x4d')]['id'];}return db[_0x7b9f('0x2e')][_0x7b9f('0x4b')]({'where':{'id':_0xc175fa[_0x7b9f('0x49')]['id']}})[_0x7b9f('0x26')](handleEntityNotFound(_0x2cdbbf,null))[_0x7b9f('0x26')](function(_0x125c4c){if(_0x125c4c){_0xc175fa[_0x7b9f('0x4d')][_0x7b9f('0x75')]=_0x125c4c['id'];_0xc175fa[_0x7b9f('0x4d')]['attrs']=widgetAttributes(_0xc175fa[_0x7b9f('0x4d')]);return db[_0x7b9f('0x76')][_0x7b9f('0x4c')](_0xc175fa['body']);}})[_0x7b9f('0x26')](respondWithResult(_0x2cdbbf,null))['catch'](handleError(_0x2cdbbf,null));};exports[_0x7b9f('0x77')]=function(_0x491426,_0x478a42,_0x1e19f3){var _0x185d0a={};var _0x4aba7a={};var _0x29860d;var _0x3d3957;return db[_0x7b9f('0x2e')][_0x7b9f('0x78')]({'where':{'id':_0x491426['params']['id']}})['then'](handleEntityNotFound(_0x478a42,null))[_0x7b9f('0x26')](function(_0x36bd7c){if(_0x36bd7c){_0x29860d=_0x36bd7c;_0x4aba7a[_0x7b9f('0x30')]=_['keys'](db['DashboardItem']['rawAttributes']);_0x4aba7a['query']=_['keys'](_0x491426[_0x7b9f('0x31')]);_0x4aba7a[_0x7b9f('0x33')]=_['intersection'](_0x4aba7a['model'],_0x4aba7a[_0x7b9f('0x31')]);_0x185d0a['attributes']=_[_0x7b9f('0x35')](_0x4aba7a[_0x7b9f('0x30')],qs[_0x7b9f('0x36')](_0x491426[_0x7b9f('0x31')][_0x7b9f('0x36')]));_0x185d0a[_0x7b9f('0x34')]=_0x185d0a['attributes'][_0x7b9f('0x37')]?_0x185d0a[_0x7b9f('0x34')]:_0x4aba7a[_0x7b9f('0x30')];_0x185d0a[_0x7b9f('0x3b')]=qs['sort'](_0x491426[_0x7b9f('0x31')]['sort']);_0x185d0a[_0x7b9f('0x3d')]=qs[_0x7b9f('0x33')](_[_0x7b9f('0x3e')](_0x491426[_0x7b9f('0x31')],_0x4aba7a['filters']));if(_0x491426[_0x7b9f('0x31')][_0x7b9f('0x3f')]){_0x185d0a[_0x7b9f('0x3d')]=_['merge'](_0x185d0a[_0x7b9f('0x3d')],{'$or':_[_0x7b9f('0x79')](_0x185d0a['attributes'],function(_0x3ebaff){var _0x28a845={};_0x28a845[_0x3ebaff]={'$like':'%'+_0x491426['query'][_0x7b9f('0x3f')]+'%'};return _0x28a845;})});}_0x185d0a=_[_0x7b9f('0x40')]({},_0x185d0a,_0x491426[_0x7b9f('0x43')]);return _0x29860d[_0x7b9f('0x77')](_0x185d0a);}})['then'](function(_0x9fc61a){if(_0x9fc61a){_0x3d3957=_0x9fc61a['length'];if(!_0x491426[_0x7b9f('0x31')][_0x7b9f('0x38')](_0x7b9f('0x39'))){_0x185d0a['limit']=qs[_0x7b9f('0x3a')](_0x491426[_0x7b9f('0x31')][_0x7b9f('0x3a')]);_0x185d0a[_0x7b9f('0x21')]=qs[_0x7b9f('0x21')](_0x491426['query'][_0x7b9f('0x21')]);}return _0x29860d['getItems'](_0x185d0a);}})[_0x7b9f('0x26')](function(_0x171998){if(_0x171998){return _0x171998?{'count':_0x3d3957,'rows':_0x171998}:null;}})[_0x7b9f('0x26')](respondWithResult(_0x478a42,null))['catch'](handleError(_0x478a42,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 44e6ee4..071dad6 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 _0xa234=['Dashboard','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x1fd967,_0x16f10f){var _0x1dd0ad=function(_0x11dc51){while(--_0x11dc51){_0x1fd967['push'](_0x1fd967['shift']());}};_0x1dd0ad(++_0x16f10f);}(_0xa234,0x15c));var _0x4a23=function(_0x5d4aea,_0x272ff7){_0x5d4aea=_0x5d4aea-0x0;var _0x5e5173=_0xa234[_0x5d4aea];return _0x5e5173;};'use strict';var EventEmitter=require(_0x4a23('0x0'));var Dashboard=require(_0x4a23('0x1'))['db'][_0x4a23('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x4a23('0x3')](0x0);var events={'afterCreate':_0x4a23('0x4'),'afterUpdate':_0x4a23('0x5'),'afterDestroy':_0x4a23('0x6')};function emitEvent(_0x50f87c){return function(_0x5a720c,_0x5c3663,_0x124275){DashboardEvents[_0x4a23('0x7')](_0x50f87c+':'+_0x5a720c['id'],_0x5a720c);DashboardEvents[_0x4a23('0x7')](_0x50f87c,_0x5a720c);_0x124275(null);};}for(var e in events){if(events[_0x4a23('0x8')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0x4a23('0x9')]=DashboardEvents; \ No newline at end of file +var _0x2755=['remove','emit','events','Dashboard','setMaxListeners','save'];(function(_0x3ac312,_0x5d3903){var _0x36b673=function(_0x254b25){while(--_0x254b25){_0x3ac312['push'](_0x3ac312['shift']());}};_0x36b673(++_0x5d3903);}(_0x2755,0x19a));var _0x5275=function(_0x461f3b,_0x2de1e3){_0x461f3b=_0x461f3b-0x0;var _0x51106b=_0x2755[_0x461f3b];return _0x51106b;};'use strict';var EventEmitter=require(_0x5275('0x0'));var Dashboard=require('../../mysqldb')['db'][_0x5275('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x5275('0x2')](0x0);var events={'afterCreate':_0x5275('0x3'),'afterUpdate':'update','afterDestroy':_0x5275('0x4')};function emitEvent(_0x3b7277){return function(_0x55f827,_0x3c4102,_0x469898){DashboardEvents[_0x5275('0x5')](_0x3b7277+':'+_0x55f827['id'],_0x55f827);DashboardEvents[_0x5275('0x5')](_0x3b7277,_0x55f827);_0x469898(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index bacf621..21fed5c 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 _0x8781=['dashboards','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./dashboard.attributes','exports','Dashboard'];(function(_0xbfe2e3,_0xab5647){var _0x409f6e=function(_0x33d02f){while(--_0x33d02f){_0xbfe2e3['push'](_0xbfe2e3['shift']());}};_0x409f6e(++_0xab5647);}(_0x8781,0x1c8));var _0x1878=function(_0x23b50b,_0x3d84aa){_0x23b50b=_0x23b50b-0x0;var _0x260725=_0x8781[_0x23b50b];return _0x260725;};'use strict';var _=require(_0x1878('0x0'));var util=require(_0x1878('0x1'));var logger=require(_0x1878('0x2'))(_0x1878('0x3'));var moment=require(_0x1878('0x4'));var BPromise=require(_0x1878('0x5'));var rp=require(_0x1878('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1878('0x7'));var config=require(_0x1878('0x8'));var attributes=require(_0x1878('0x9'));module[_0x1878('0xa')]=function(_0x43d827,_0x1c52e8){return _0x43d827['define'](_0x1878('0xb'),attributes,{'tableName':_0x1878('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1cfc=['path','../../config/environment','./dashboard.attributes','dashboards','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x37a50c,_0x1ad777){var _0x1b6623=function(_0x4f7128){while(--_0x4f7128){_0x37a50c['push'](_0x37a50c['shift']());}};_0x1b6623(++_0x1ad777);}(_0x1cfc,0x122));var _0xc1cf=function(_0x5d5a7c,_0x51e29c){_0x5d5a7c=_0x5d5a7c-0x0;var _0x106274=_0x1cfc[_0x5d5a7c];return _0x106274;};'use strict';var _=require(_0xc1cf('0x0'));var util=require(_0xc1cf('0x1'));var logger=require(_0xc1cf('0x2'))(_0xc1cf('0x3'));var moment=require(_0xc1cf('0x4'));var BPromise=require(_0xc1cf('0x5'));var rp=require(_0xc1cf('0x6'));var fs=require('fs');var path=require(_0xc1cf('0x7'));var rimraf=require('rimraf');var config=require(_0xc1cf('0x8'));var attributes=require(_0xc1cf('0x9'));module['exports']=function(_0x3e066d,_0x4b5552){return _0x3e066d['define']('Dashboard',attributes,{'tableName':_0xc1cf('0xa'),'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 2fcc7c5..582d08d 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 _0x8393=['redis','defaults','localhost','socket.io-emitter','register','request','info','Dashboard,\x20%s,\x20%s','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http'];(function(_0x20ad4d,_0x356d74){var _0x320154=function(_0x2c60ec){while(--_0x2c60ec){_0x20ad4d['push'](_0x20ad4d['shift']());}};_0x320154(++_0x356d74);}(_0x8393,0xcf));var _0x3839=function(_0x235c85,_0x3f95b3){_0x235c85=_0x235c85-0x0;var _0x375f89=_0x8393[_0x235c85];return _0x375f89;};'use strict';var _=require(_0x3839('0x0'));var util=require(_0x3839('0x1'));var moment=require('moment');var BPromise=require(_0x3839('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3839('0x3'));var db=require(_0x3839('0x4'))['db'];var utils=require(_0x3839('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x3839('0x6'));var jayson=require(_0x3839('0x7'));var client=jayson['client'][_0x3839('0x8')]({'port':0x232a});config[_0x3839('0x9')]=_[_0x3839('0xa')](config[_0x3839('0x9')],{'host':_0x3839('0xb'),'port':0x18eb});var socket=require(_0x3839('0xc'))(new Redis(config[_0x3839('0x9')]));require('./dashboard.socket')[_0x3839('0xd')](socket);function respondWithRpcPromise(_0x1f8d69,_0x48e665,_0x3cff7d){return new BPromise(function(_0x1f9624,_0xdbf12e){return client[_0x3839('0xe')](_0x1f8d69,_0x3cff7d)['then'](function(_0x19897c){logger[_0x3839('0xf')](_0x3839('0x10'),_0x48e665,'request\x20sent');logger['debug'](_0x3839('0x11'),_0x48e665,_0x3839('0x12'),JSON[_0x3839('0x13')](_0x19897c));if(_0x19897c['error']){if(_0x19897c['error']['code']===0x1f4){logger[_0x3839('0x14')](_0x3839('0x10'),_0x48e665,_0x19897c[_0x3839('0x14')][_0x3839('0x15')]);return _0xdbf12e(_0x19897c[_0x3839('0x14')][_0x3839('0x15')]);}logger[_0x3839('0x14')]('Dashboard,\x20%s,\x20%s',_0x48e665,_0x19897c[_0x3839('0x14')][_0x3839('0x15')]);return _0x1f9624(_0x19897c[_0x3839('0x14')]['message']);}else{logger['info'](_0x3839('0x10'),_0x48e665,_0x3839('0x12'));_0x1f9624(_0x19897c[_0x3839('0x16')][_0x3839('0x15')]);}})[_0x3839('0x17')](function(_0x3cbf9a){logger[_0x3839('0x14')](_0x3839('0x10'),_0x48e665,_0x3cbf9a);_0xdbf12e(_0x3cbf9a);});});} \ No newline at end of file +var _0xa8c3=['request','then','request\x20sent','debug','error','code','Dashboard,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./dashboard.socket','register'];(function(_0x3085d8,_0x565490){var _0x469437=function(_0x1e5a58){while(--_0x1e5a58){_0x3085d8['push'](_0x3085d8['shift']());}};_0x469437(++_0x565490);}(_0xa8c3,0xdb));var _0x3a8c=function(_0x3c4f1f,_0x20d3ec){_0x3c4f1f=_0x3c4f1f-0x0;var _0x19cb69=_0xa8c3[_0x3c4f1f];return _0x19cb69;};'use strict';var _=require(_0x3a8c('0x0'));var util=require(_0x3a8c('0x1'));var moment=require(_0x3a8c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3a8c('0x3'));var db=require(_0x3a8c('0x4'))['db'];var utils=require(_0x3a8c('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x3a8c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3a8c('0x7')][_0x3a8c('0x8')]({'port':0x232a});config['redis']=_[_0x3a8c('0x9')](config[_0x3a8c('0xa')],{'host':_0x3a8c('0xb'),'port':0x18eb});var socket=require(_0x3a8c('0xc'))(new Redis(config['redis']));require(_0x3a8c('0xd'))[_0x3a8c('0xe')](socket);function respondWithRpcPromise(_0x39a1da,_0x580b6d,_0x43ab3a){return new BPromise(function(_0x22a190,_0x3e7bad){return client[_0x3a8c('0xf')](_0x39a1da,_0x43ab3a)[_0x3a8c('0x10')](function(_0x2dc5a6){logger['info']('Dashboard,\x20%s,\x20%s',_0x580b6d,_0x3a8c('0x11'));logger[_0x3a8c('0x12')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x580b6d,_0x3a8c('0x11'),JSON['stringify'](_0x2dc5a6));if(_0x2dc5a6[_0x3a8c('0x13')]){if(_0x2dc5a6['error'][_0x3a8c('0x14')]===0x1f4){logger[_0x3a8c('0x13')](_0x3a8c('0x15'),_0x580b6d,_0x2dc5a6[_0x3a8c('0x13')][_0x3a8c('0x16')]);return _0x3e7bad(_0x2dc5a6['error'][_0x3a8c('0x16')]);}logger[_0x3a8c('0x13')]('Dashboard,\x20%s,\x20%s',_0x580b6d,_0x2dc5a6['error']['message']);return _0x22a190(_0x2dc5a6[_0x3a8c('0x13')][_0x3a8c('0x16')]);}else{logger[_0x3a8c('0x17')](_0x3a8c('0x15'),_0x580b6d,_0x3a8c('0x11'));_0x22a190(_0x2dc5a6[_0x3a8c('0x18')][_0x3a8c('0x16')]);}})[_0x3a8c('0x19')](function(_0x139981){logger[_0x3a8c('0x13')](_0x3a8c('0x15'),_0x580b6d,_0x139981);_0x3e7bad(_0x139981);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index b808cf8..3f4b2ae 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 _0xa575=['remove','removeListener','register','length','dashboard:','./dashboard.events','save'];(function(_0x2889c6,_0x2e5307){var _0x4dce87=function(_0xdf9d55){while(--_0xdf9d55){_0x2889c6['push'](_0x2889c6['shift']());}};_0x4dce87(++_0x2e5307);}(_0xa575,0xad));var _0x5a57=function(_0x433ea6,_0x11ae6d){_0x433ea6=_0x433ea6-0x0;var _0x58371c=_0xa575[_0x433ea6];return _0x58371c;};'use strict';var DashboardEvents=require(_0x5a57('0x0'));var events=[_0x5a57('0x1'),_0x5a57('0x2'),'update'];function createListener(_0x2ec7e1,_0x10766a){return function(_0x18a4e2){_0x10766a['emit'](_0x2ec7e1,_0x18a4e2);};}function removeListener(_0x5caf13,_0xb80432){return function(){DashboardEvents[_0x5a57('0x3')](_0x5caf13,_0xb80432);};}exports[_0x5a57('0x4')]=function(_0x25ad66){for(var _0x5d1ac2=0x0,_0x9c94b6=events[_0x5a57('0x5')];_0x5d1ac2<_0x9c94b6;_0x5d1ac2++){var _0x1759db=events[_0x5d1ac2];var _0x27593a=createListener(_0x5a57('0x6')+_0x1759db,_0x25ad66);DashboardEvents['on'](_0x1759db,_0x27593a);}}; \ No newline at end of file +var _0x54dd=['emit','removeListener','register','length','./dashboard.events','save','remove','update'];(function(_0x2240c4,_0x3cf8b7){var _0x32453b=function(_0x553be3){while(--_0x553be3){_0x2240c4['push'](_0x2240c4['shift']());}};_0x32453b(++_0x3cf8b7);}(_0x54dd,0x1bc));var _0xd54d=function(_0x1b269a,_0x23693d){_0x1b269a=_0x1b269a-0x0;var _0x100485=_0x54dd[_0x1b269a];return _0x100485;};'use strict';var DashboardEvents=require(_0xd54d('0x0'));var events=[_0xd54d('0x1'),_0xd54d('0x2'),_0xd54d('0x3')];function createListener(_0x260a2d,_0x43945a){return function(_0x544b81){_0x43945a[_0xd54d('0x4')](_0x260a2d,_0x544b81);};}function removeListener(_0x159339,_0x3c0441){return function(){DashboardEvents[_0xd54d('0x5')](_0x159339,_0x3c0441);};}exports[_0xd54d('0x6')]=function(_0x1047ab){for(var _0x4eceba=0x0,_0x1b0522=events[_0xd54d('0x7')];_0x4eceba<_0x1b0522;_0x4eceba++){var _0x475611=events[_0x4eceba];var _0x3c234d=createListener('dashboard:'+_0x475611,_0x1047ab);DashboardEvents['on'](_0x475611,_0x3c234d);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index e9e24ca..fc43460 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 _0x9c9c=['/:id','show','/:id/items','getItems','post','create','clone','put','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index'];(function(_0x35a561,_0x5073c2){var _0x57eb16=function(_0xb63c9f){while(--_0xb63c9f){_0x35a561['push'](_0x35a561['shift']());}};_0x57eb16(++_0x5073c2);}(_0x9c9c,0x1ad));var _0xc9c9=function(_0xc3555a,_0x599225){_0xc3555a=_0xc3555a-0x0;var _0x5b6b8a=_0x9c9c[_0xc3555a];return _0x5b6b8a;};'use strict';var multer=require(_0xc9c9('0x0'));var util=require(_0xc9c9('0x1'));var path=require(_0xc9c9('0x2'));var timeout=require('connect-timeout');var express=require(_0xc9c9('0x3'));var router=express['Router']();var auth=require(_0xc9c9('0x4'));var interaction=require(_0xc9c9('0x5'));var config=require(_0xc9c9('0x6'));var controller=require(_0xc9c9('0x7'));router[_0xc9c9('0x8')]('/',auth[_0xc9c9('0x9')](),controller[_0xc9c9('0xa')]);router[_0xc9c9('0x8')](_0xc9c9('0xb'),auth[_0xc9c9('0x9')](),controller[_0xc9c9('0xc')]);router[_0xc9c9('0x8')](_0xc9c9('0xd'),auth[_0xc9c9('0x9')](),controller[_0xc9c9('0xe')]);router[_0xc9c9('0xf')]('/',auth['isAuthenticated'](),controller[_0xc9c9('0x10')]);router['post']('/:id/clone',auth[_0xc9c9('0x9')](),controller[_0xc9c9('0x11')]);router['post'](_0xc9c9('0xd'),auth[_0xc9c9('0x9')](),controller['addItem']);router[_0xc9c9('0x12')](_0xc9c9('0xb'),auth[_0xc9c9('0x9')](),controller['update']);router[_0xc9c9('0x13')](_0xc9c9('0xb'),auth['isAuthenticated'](),controller[_0xc9c9('0x14')]);module[_0xc9c9('0x15')]=router; \ No newline at end of file +var _0xa55e=['exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','show','/:id/items','getItems','create','post','/:id/clone','clone','addItem','put','/:id','delete'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0xa55e,0x79));var _0xea55=function(_0x2bebf0,_0x21316c){_0x2bebf0=_0x2bebf0-0x0;var _0x3b1926=_0xa55e[_0x2bebf0];return _0x3b1926;};'use strict';var multer=require(_0xea55('0x0'));var util=require(_0xea55('0x1'));var path=require(_0xea55('0x2'));var timeout=require(_0xea55('0x3'));var express=require(_0xea55('0x4'));var router=express['Router']();var auth=require(_0xea55('0x5'));var interaction=require(_0xea55('0x6'));var config=require(_0xea55('0x7'));var controller=require(_0xea55('0x8'));router[_0xea55('0x9')]('/',auth[_0xea55('0xa')](),controller[_0xea55('0xb')]);router[_0xea55('0x9')]('/:id',auth[_0xea55('0xa')](),controller[_0xea55('0xc')]);router['get'](_0xea55('0xd'),auth[_0xea55('0xa')](),controller[_0xea55('0xe')]);router['post']('/',auth[_0xea55('0xa')](),controller[_0xea55('0xf')]);router[_0xea55('0x10')](_0xea55('0x11'),auth[_0xea55('0xa')](),controller[_0xea55('0x12')]);router[_0xea55('0x10')](_0xea55('0xd'),auth['isAuthenticated'](),controller[_0xea55('0x13')]);router[_0xea55('0x14')](_0xea55('0x15'),auth['isAuthenticated'](),controller['update']);router[_0xea55('0x16')](_0xea55('0x15'),auth['isAuthenticated'](),controller['destroy']);module[_0xea55('0x17')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index dafeaaf..fc5f002 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 _0xaf55=['parse','attrs','setDataValue','stringify','INTEGER','#ffffff','sequelize','lodash','exports','STRING','TEXT','long'];(function(_0x28347c,_0x2d8dc8){var _0x2c5a34=function(_0x3682da){while(--_0x3682da){_0x28347c['push'](_0x28347c['shift']());}};_0x2c5a34(++_0x2d8dc8);}(_0xaf55,0x1f2));var _0x5af5=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xaf55[_0x8c43de];return _0xa6591b;};'use strict';var Sequelize=require(_0x5af5('0x0'));var squel=require('squel');var _=require(_0x5af5('0x1'));module[_0x5af5('0x2')]={'title':{'type':Sequelize[_0x5af5('0x3')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x5af5('0x4')](_0x5af5('0x5')),'get':function(){try{return JSON[_0x5af5('0x6')](this['getDataValue'](_0x5af5('0x7')));}catch(_0x2b0745){return[];}},'set':function(_0x2f9425){try{this[_0x5af5('0x8')]('attrs',JSON[_0x5af5('0x9')](_0x2f9425));}catch(_0x42b94d){this[_0x5af5('0x8')](_0x5af5('0x7'),JSON[_0x5af5('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0x5af5('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x5af5('0xa')]},'col':{'type':Sequelize[_0x5af5('0xa')]},'background':{'type':Sequelize[_0x5af5('0x3')],'allowNull':![],'defaultValue':_0x5af5('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1a99=['lodash','exports','STRING','getDataValue','attrs','setDataValue','stringify','INTEGER','#2196f3','sequelize','squel'];(function(_0x34c9b1,_0x2e50a5){var _0x5dec5e=function(_0x40aaec){while(--_0x40aaec){_0x34c9b1['push'](_0x34c9b1['shift']());}};_0x5dec5e(++_0x2e50a5);}(_0x1a99,0x1ab));var _0x91a9=function(_0x1d0c7e,_0x40b36c){_0x1d0c7e=_0x1d0c7e-0x0;var _0x30cf02=_0x1a99[_0x1d0c7e];return _0x30cf02;};'use strict';var Sequelize=require(_0x91a9('0x0'));var squel=require(_0x91a9('0x1'));var _=require(_0x91a9('0x2'));module[_0x91a9('0x3')]={'title':{'type':Sequelize[_0x91a9('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0x91a9('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT']('long'),'get':function(){try{return JSON['parse'](this[_0x91a9('0x5')](_0x91a9('0x6')));}catch(_0x266329){return[];}},'set':function(_0x4fd2dd){try{this[_0x91a9('0x7')](_0x91a9('0x6'),JSON[_0x91a9('0x8')](_0x4fd2dd));}catch(_0x55e8df){this[_0x91a9('0x7')](_0x91a9('0x6'),JSON[_0x91a9('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0x91a9('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x91a9('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x91a9('0x9')]},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x91a9('0x4')],'allowNull':![],'defaultValue':_0x91a9('0xa'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x91a9('0x4')]}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 7c1ebbc..d700cd9 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 _0xe275=['include','merge','options','then','catch','params','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','reportType','type','attrReport','attrRefresh','widgetAttributes:\x20%s','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','count','offset','Content-Range','json','apply','reject','update','destroy','end','error','stack','name','keys','DashboardItem','rawAttributes','query','filters','intersection','model','fields','attributes','length','includeAll'];(function(_0x260859,_0x3cfcff){var _0x4b77f8=function(_0x2e48f8){while(--_0x2e48f8){_0x260859['push'](_0x260859['shift']());}};_0x4b77f8(++_0x3cfcff);}(_0xe275,0x1c9));var _0x5e27=function(_0x18d783,_0x1185ac){_0x18d783=_0x18d783-0x0;var _0x9aeb56=_0xe275[_0x18d783];return _0x9aeb56;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5e27('0x0'));var rimraf=require(_0x5e27('0x1'));var zipdir=require(_0x5e27('0x2'));var jsonpatch=require(_0x5e27('0x3'));var rp=require(_0x5e27('0x4'));var moment=require(_0x5e27('0x5'));var BPromise=require(_0x5e27('0x6'));var Mustache=require(_0x5e27('0x7'));var util=require(_0x5e27('0x8'));var path=require(_0x5e27('0x9'));var sox=require(_0x5e27('0xa'));var csv=require(_0x5e27('0xb'));var ejs=require(_0x5e27('0xc'));var fs=require('fs');var _=require(_0x5e27('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5e27('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5e27('0xf'));var Papa=require(_0x5e27('0x10'));var Redis=require(_0x5e27('0x11'));var authService=require(_0x5e27('0x12'));var qs=require(_0x5e27('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5e27('0x14'))('api');var utils=require(_0x5e27('0x15'));var config=require(_0x5e27('0x16'));var db=require('../../mysqldb')['db'];config[_0x5e27('0x17')]=_[_0x5e27('0x18')](config[_0x5e27('0x17')],{'host':_0x5e27('0x19'),'port':0x18eb});var socket=require(_0x5e27('0x1a'))(new Redis(config['redis']));require('./dashboardItem.socket')[_0x5e27('0x1b')](socket);function respondWithStatusCode(_0x1ecb23,_0x981bbd){_0x981bbd=_0x981bbd||0xcc;return function(_0x28b91b){if(_0x28b91b){return _0x1ecb23[_0x5e27('0x1c')](_0x981bbd);}return _0x1ecb23[_0x5e27('0x1d')](_0x981bbd)['end']();};}function respondWithResult(_0x2bb088,_0x4b86ca){_0x4b86ca=_0x4b86ca||0xc8;return function(_0xa4a0da){if(_0xa4a0da){return _0x2bb088['status'](_0x4b86ca)['json'](_0xa4a0da);}};}function respondWithFilteredResult(_0x5ecd49,_0x11b68f){return function(_0x276182){if(_0x276182){var _0x42254e=_0x276182[_0x5e27('0x1e')],_0x2e9f01=_0x11b68f[_0x5e27('0x1f')],_0x8d63b7=_0x11b68f['offset']+_0x11b68f['limit'],_0x3627ab;if(_0x8d63b7>=_0x42254e){_0x8d63b7=_0x42254e;_0x3627ab=0xc8;}else{_0x3627ab=0xce;}_0x5ecd49[_0x5e27('0x1d')](_0x3627ab);return _0x5ecd49['set'](_0x5e27('0x20'),_0x2e9f01+'-'+_0x8d63b7+'/'+_0x42254e)[_0x5e27('0x21')](_0x276182);}return null;};}function patchUpdates(_0x5ddc3d){return function(_0x2727ed){try{jsonpatch[_0x5e27('0x22')](_0x2727ed,_0x5ddc3d,!![]);}catch(_0x2888c3){return BPromise[_0x5e27('0x23')](_0x2888c3);}return _0x2727ed['save']();};}function saveUpdates(_0x47460c,_0xf3b07a){return function(_0x5adf90){if(_0x5adf90){return _0x5adf90[_0x5e27('0x24')](_0x47460c)['then'](function(_0xedc018){return _0xedc018;});}return null;};}function removeEntity(_0x24525f,_0x3b829f){return function(_0x5a160c){if(_0x5a160c){return _0x5a160c[_0x5e27('0x25')]()['then'](function(){_0x24525f[_0x5e27('0x1d')](0xcc)[_0x5e27('0x26')]();});}};}function handleEntityNotFound(_0x4a248f,_0x1bde34){return function(_0x8f2bb3){if(!_0x8f2bb3){_0x4a248f['sendStatus'](0x194);}return _0x8f2bb3;};}function handleError(_0x5d380a,_0x1ab82a){_0x1ab82a=_0x1ab82a||0x1f4;return function(_0xf24b47){logger[_0x5e27('0x27')](_0xf24b47[_0x5e27('0x28')]);if(_0xf24b47[_0x5e27('0x29')]){delete _0xf24b47['name'];}_0x5d380a['status'](_0x1ab82a)['send'](_0xf24b47);};}exports['show']=function(_0x4d42da,_0x27144e){var _0x352831={'raw':![],'where':{'id':_0x4d42da['params']['id']}},_0x46f274={};_0x46f274['model']=_[_0x5e27('0x2a')](db[_0x5e27('0x2b')][_0x5e27('0x2c')]);_0x46f274[_0x5e27('0x2d')]=_[_0x5e27('0x2a')](_0x4d42da[_0x5e27('0x2d')]);_0x46f274[_0x5e27('0x2e')]=_['intersection'](_0x46f274['model'],_0x46f274['query']);_0x352831['attributes']=_[_0x5e27('0x2f')](_0x46f274[_0x5e27('0x30')],qs[_0x5e27('0x31')](_0x4d42da[_0x5e27('0x2d')][_0x5e27('0x31')]));_0x352831['attributes']=_0x352831[_0x5e27('0x32')][_0x5e27('0x33')]?_0x352831[_0x5e27('0x32')]:_0x46f274[_0x5e27('0x30')];if(_0x4d42da[_0x5e27('0x2d')][_0x5e27('0x34')]){_0x352831[_0x5e27('0x35')]=[{'all':!![]}];}_0x352831=_[_0x5e27('0x36')]({},_0x352831,_0x4d42da[_0x5e27('0x37')]);return db[_0x5e27('0x2b')]['find'](_0x352831)[_0x5e27('0x38')](handleEntityNotFound(_0x27144e,null))['then'](respondWithResult(_0x27144e,null))[_0x5e27('0x39')](handleError(_0x27144e,null));};exports[_0x5e27('0x25')]=function(_0x50ebb8,_0x8bc503){return db[_0x5e27('0x2b')]['find']({'where':{'id':_0x50ebb8[_0x5e27('0x3a')]['id']}})[_0x5e27('0x38')](handleEntityNotFound(_0x8bc503,null))['then'](removeEntity(_0x8bc503,null))['catch'](handleError(_0x8bc503,null));};function widgetAttributes(_0x487658){try{switch(_0x487658['type']){case'iframe':return[{'name':_0x5e27('0x3b'),'value':_0x487658[_0x5e27('0x3b')]||(_0x487658[_0x5e27('0x3c')]&&_0x487658[_0x5e27('0x3c')][0x0]?_0x487658['attrs'][0x0][_0x5e27('0x3d')]:undefined)||_0x5e27('0x3e')}];case'custom':return[{'name':_0x5e27('0x3f'),'value':_0x487658[_0x5e27('0x3f')]||(_0x487658[_0x5e27('0x3c')]&&_0x487658[_0x5e27('0x3c')][0x0]?_0x487658['attrs'][0x0][_0x5e27('0x3d')]:undefined)||''}];case _0x5e27('0x40'):return[{'name':_0x5e27('0x41'),'value':_0x487658[_0x5e27('0x41')]||(_0x487658[_0x5e27('0x3c')]&&_0x487658['attrs'][0x0]?_0x487658[_0x5e27('0x3c')][0x0][_0x5e27('0x3d')]:undefined)||_0x5e27('0x42')},{'name':'attrTimezone','value':_0x487658['attrTimezone']||(_0x487658[_0x5e27('0x3c')]&&_0x487658[_0x5e27('0x3c')][0x1]?_0x487658[_0x5e27('0x3c')][0x1][_0x5e27('0x3d')]:undefined)||_0x5e27('0x43')},{'name':'attrFontSize','value':_0x487658[_0x5e27('0x44')]||(_0x487658[_0x5e27('0x3c')]&&_0x487658[_0x5e27('0x3c')][0x2]?_0x487658[_0x5e27('0x3c')][0x2]['value']:undefined)||0xc}];case _0x5e27('0x45'):return[{'name':_0x5e27('0x46'),'value':_0x487658['attrMetric']||(_0x487658[_0x5e27('0x3c')]&&_0x487658['attrs'][0x0]?_0x487658['attrs'][0x0][_0x5e27('0x3d')]:undefined)||'total'},{'name':_0x5e27('0x47'),'value':_0x487658[_0x5e27('0x47')]||(_0x487658[_0x5e27('0x3c')]&&_0x487658[_0x5e27('0x3c')][0x1]?_0x487658[_0x5e27('0x3c')][0x1][_0x5e27('0x3d')]:undefined)||[]},{'name':_0x5e27('0x44'),'value':_0x487658[_0x5e27('0x44')]||(_0x487658[_0x5e27('0x3c')]&&_0x487658[_0x5e27('0x3c')][0x2]?_0x487658[_0x5e27('0x3c')][0x2][_0x5e27('0x3d')]:undefined)||0x14}];case _0x5e27('0x48'):case _0x5e27('0x49'):return[{'name':'attrSerie1','value':_0x487658[_0x5e27('0x4a')]||(_0x487658[_0x5e27('0x3c')]&&_0x487658['attrs'][0x0]?_0x487658[_0x5e27('0x3c')][0x0][_0x5e27('0x3d')]:undefined)||'total'},{'name':_0x5e27('0x4b'),'value':_0x487658[_0x5e27('0x4b')]||(_0x487658['attrs']&&_0x487658[_0x5e27('0x3c')][0x1]?_0x487658[_0x5e27('0x3c')][0x1][_0x5e27('0x3d')]:undefined)||null},{'name':_0x5e27('0x4c'),'value':_0x487658[_0x5e27('0x4c')]||(_0x487658[_0x5e27('0x3c')]&&_0x487658[_0x5e27('0x3c')][0x2]?_0x487658['attrs'][0x2][_0x5e27('0x3d')]:undefined)||null},{'name':_0x5e27('0x47'),'value':_0x487658[_0x5e27('0x47')]||(_0x487658[_0x5e27('0x3c')]&&_0x487658[_0x5e27('0x3c')][0x3]?_0x487658['attrs'][0x3][_0x5e27('0x3d')]:undefined)||[]}];case'web-report':return[{'name':'attrReport','type':_0x487658[_0x5e27('0x4d')]||(_0x487658['attrs']&&_0x487658[_0x5e27('0x3c')][0x0]?_0x487658['attrs'][0x0][_0x5e27('0x4e')]:undefined)||null,'value':_0x487658[_0x5e27('0x4f')]||(_0x487658[_0x5e27('0x3c')]&&_0x487658['attrs'][0x0]?_0x487658[_0x5e27('0x3c')][0x0][_0x5e27('0x3d')]:undefined)||null},{'name':_0x5e27('0x50'),'value':_0x487658['attrRefresh']||(_0x487658[_0x5e27('0x3c')]&&_0x487658[_0x5e27('0x3c')][0x1]?_0x487658[_0x5e27('0x3c')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x4548a8){logger['error'](_0x5e27('0x51'),JSON['stringify'](_0x4548a8));return[];}}exports[_0x5e27('0x52')]=function(_0x392b0f,_0x2cfec0){if(_0x392b0f[_0x5e27('0x53')]){_0x392b0f[_0x5e27('0x53')][_0x5e27('0x3c')]=widgetAttributes(_0x392b0f[_0x5e27('0x53')]);}return db[_0x5e27('0x2b')][_0x5e27('0x52')](_0x392b0f['body'],{})['then'](respondWithResult(_0x2cfec0,0xc9))[_0x5e27('0x39')](handleError(_0x2cfec0,null));};exports[_0x5e27('0x24')]=function(_0x5cf9b2,_0x12d17a){if(_0x5cf9b2[_0x5e27('0x53')]['id']){delete _0x5cf9b2[_0x5e27('0x53')]['id'];}_0x5cf9b2['body'][_0x5e27('0x3c')]=widgetAttributes(_0x5cf9b2[_0x5e27('0x53')]);return db[_0x5e27('0x2b')][_0x5e27('0x54')]({'where':{'id':_0x5cf9b2[_0x5e27('0x3a')]['id']}})[_0x5e27('0x38')](handleEntityNotFound(_0x12d17a,null))[_0x5e27('0x38')](saveUpdates(_0x5cf9b2['body'],null))[_0x5e27('0x38')](respondWithResult(_0x12d17a,null))[_0x5e27('0x39')](handleError(_0x12d17a,null));}; \ No newline at end of file +var _0x9937=['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','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','sendStatus','end','json','offset','status','set','Content-Range','apply','reject','stack','name','send','params','keys','DashboardItem','rawAttributes','query','filters','intersection','model','attributes','fields','length','includeAll','include','merge','find','then','catch','type','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','error','widgetAttributes:\x20%s','stringify','body','update','eml-format','rimraf'];(function(_0x3ef7d7,_0x3dac07){var _0x2bc194=function(_0x9fd179){while(--_0x9fd179){_0x3ef7d7['push'](_0x3ef7d7['shift']());}};_0x2bc194(++_0x3dac07);}(_0x9937,0x166));var _0x7993=function(_0x3e5007,_0x5d5a9f){_0x3e5007=_0x3e5007-0x0;var _0x49bacf=_0x9937[_0x3e5007];return _0x49bacf;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7993('0x0'));var rimraf=require(_0x7993('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7993('0x2'));var rp=require(_0x7993('0x3'));var moment=require(_0x7993('0x4'));var BPromise=require(_0x7993('0x5'));var Mustache=require(_0x7993('0x6'));var util=require('util');var path=require(_0x7993('0x7'));var sox=require(_0x7993('0x8'));var csv=require(_0x7993('0x9'));var ejs=require(_0x7993('0xa'));var fs=require('fs');var _=require(_0x7993('0xb'));var squel=require(_0x7993('0xc'));var crypto=require(_0x7993('0xd'));var jsforce=require(_0x7993('0xe'));var deskjs=require(_0x7993('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7993('0x10'));var Papa=require(_0x7993('0x11'));var Redis=require(_0x7993('0x12'));var authService=require(_0x7993('0x13'));var qs=require(_0x7993('0x14'));var hardwareService=require(_0x7993('0x15'));var logger=require(_0x7993('0x16'))(_0x7993('0x17'));var utils=require(_0x7993('0x18'));var config=require(_0x7993('0x19'));var db=require(_0x7993('0x1a'))['db'];config[_0x7993('0x1b')]=_[_0x7993('0x1c')](config[_0x7993('0x1b')],{'host':_0x7993('0x1d'),'port':0x18eb});var socket=require(_0x7993('0x1e'))(new Redis(config[_0x7993('0x1b')]));require(_0x7993('0x1f'))['register'](socket);function respondWithStatusCode(_0x11ac51,_0x43d630){_0x43d630=_0x43d630||0xcc;return function(_0x53d2e1){if(_0x53d2e1){return _0x11ac51[_0x7993('0x20')](_0x43d630);}return _0x11ac51['status'](_0x43d630)[_0x7993('0x21')]();};}function respondWithResult(_0x1dd93c,_0x5aff6b){_0x5aff6b=_0x5aff6b||0xc8;return function(_0x148031){if(_0x148031){return _0x1dd93c['status'](_0x5aff6b)[_0x7993('0x22')](_0x148031);}};}function respondWithFilteredResult(_0x3c747c,_0x544a4b){return function(_0x33fc36){if(_0x33fc36){var _0x3f9b15=_0x33fc36['count'],_0xd077cc=_0x544a4b[_0x7993('0x23')],_0x20a634=_0x544a4b[_0x7993('0x23')]+_0x544a4b['limit'],_0x3d9466;if(_0x20a634>=_0x3f9b15){_0x20a634=_0x3f9b15;_0x3d9466=0xc8;}else{_0x3d9466=0xce;}_0x3c747c[_0x7993('0x24')](_0x3d9466);return _0x3c747c[_0x7993('0x25')](_0x7993('0x26'),_0xd077cc+'-'+_0x20a634+'/'+_0x3f9b15)[_0x7993('0x22')](_0x33fc36);}return null;};}function patchUpdates(_0x24d1e5){return function(_0x2f9e7c){try{jsonpatch[_0x7993('0x27')](_0x2f9e7c,_0x24d1e5,!![]);}catch(_0x2e9b8f){return BPromise[_0x7993('0x28')](_0x2e9b8f);}return _0x2f9e7c['save']();};}function saveUpdates(_0x3d2b79,_0x3e4484){return function(_0x1a4d3e){if(_0x1a4d3e){return _0x1a4d3e['update'](_0x3d2b79)['then'](function(_0x441026){return _0x441026;});}return null;};}function removeEntity(_0x479022,_0xac09e2){return function(_0x2756fc){if(_0x2756fc){return _0x2756fc['destroy']()['then'](function(){_0x479022['status'](0xcc)[_0x7993('0x21')]();});}};}function handleEntityNotFound(_0x5ae57f,_0x1628ba){return function(_0x53f0dc){if(!_0x53f0dc){_0x5ae57f[_0x7993('0x20')](0x194);}return _0x53f0dc;};}function handleError(_0x3314df,_0x32229d){_0x32229d=_0x32229d||0x1f4;return function(_0xf9f9e5){logger['error'](_0xf9f9e5[_0x7993('0x29')]);if(_0xf9f9e5[_0x7993('0x2a')]){delete _0xf9f9e5[_0x7993('0x2a')];}_0x3314df[_0x7993('0x24')](_0x32229d)[_0x7993('0x2b')](_0xf9f9e5);};}exports['show']=function(_0xd597d2,_0x941487){var _0x595877={'raw':![],'where':{'id':_0xd597d2[_0x7993('0x2c')]['id']}},_0x2cfd37={};_0x2cfd37['model']=_[_0x7993('0x2d')](db[_0x7993('0x2e')][_0x7993('0x2f')]);_0x2cfd37['query']=_[_0x7993('0x2d')](_0xd597d2[_0x7993('0x30')]);_0x2cfd37[_0x7993('0x31')]=_[_0x7993('0x32')](_0x2cfd37[_0x7993('0x33')],_0x2cfd37[_0x7993('0x30')]);_0x595877[_0x7993('0x34')]=_[_0x7993('0x32')](_0x2cfd37[_0x7993('0x33')],qs[_0x7993('0x35')](_0xd597d2[_0x7993('0x30')][_0x7993('0x35')]));_0x595877[_0x7993('0x34')]=_0x595877['attributes'][_0x7993('0x36')]?_0x595877[_0x7993('0x34')]:_0x2cfd37[_0x7993('0x33')];if(_0xd597d2['query'][_0x7993('0x37')]){_0x595877[_0x7993('0x38')]=[{'all':!![]}];}_0x595877=_[_0x7993('0x39')]({},_0x595877,_0xd597d2['options']);return db['DashboardItem'][_0x7993('0x3a')](_0x595877)[_0x7993('0x3b')](handleEntityNotFound(_0x941487,null))[_0x7993('0x3b')](respondWithResult(_0x941487,null))['catch'](handleError(_0x941487,null));};exports['destroy']=function(_0x3f69d7,_0x39efc2){return db[_0x7993('0x2e')][_0x7993('0x3a')]({'where':{'id':_0x3f69d7[_0x7993('0x2c')]['id']}})[_0x7993('0x3b')](handleEntityNotFound(_0x39efc2,null))[_0x7993('0x3b')](removeEntity(_0x39efc2,null))[_0x7993('0x3c')](handleError(_0x39efc2,null));};function widgetAttributes(_0x48f72f){try{switch(_0x48f72f[_0x7993('0x3d')]){case _0x7993('0x3e'):return[{'name':'attrUrl','value':_0x48f72f[_0x7993('0x3f')]||(_0x48f72f[_0x7993('0x40')]&&_0x48f72f[_0x7993('0x40')][0x0]?_0x48f72f[_0x7993('0x40')][0x0][_0x7993('0x41')]:undefined)||_0x7993('0x42')}];case'custom':return[{'name':'attrPath','value':_0x48f72f[_0x7993('0x43')]||(_0x48f72f[_0x7993('0x40')]&&_0x48f72f[_0x7993('0x40')][0x0]?_0x48f72f['attrs'][0x0][_0x7993('0x41')]:undefined)||''}];case _0x7993('0x44'):return[{'name':_0x7993('0x45'),'value':_0x48f72f[_0x7993('0x45')]||(_0x48f72f[_0x7993('0x40')]&&_0x48f72f[_0x7993('0x40')][0x0]?_0x48f72f[_0x7993('0x40')][0x0][_0x7993('0x41')]:undefined)||_0x7993('0x46')},{'name':_0x7993('0x47'),'value':_0x48f72f[_0x7993('0x47')]||(_0x48f72f['attrs']&&_0x48f72f[_0x7993('0x40')][0x1]?_0x48f72f['attrs'][0x1][_0x7993('0x41')]:undefined)||_0x7993('0x48')},{'name':_0x7993('0x49'),'value':_0x48f72f[_0x7993('0x49')]||(_0x48f72f['attrs']&&_0x48f72f['attrs'][0x2]?_0x48f72f['attrs'][0x2]['value']:undefined)||0xc}];case _0x7993('0x4a'):return[{'name':_0x7993('0x4b'),'value':_0x48f72f[_0x7993('0x4b')]||(_0x48f72f[_0x7993('0x40')]&&_0x48f72f[_0x7993('0x40')][0x0]?_0x48f72f[_0x7993('0x40')][0x0][_0x7993('0x41')]:undefined)||_0x7993('0x4c')},{'name':_0x7993('0x4d'),'value':_0x48f72f[_0x7993('0x4d')]||(_0x48f72f['attrs']&&_0x48f72f[_0x7993('0x40')][0x1]?_0x48f72f[_0x7993('0x40')][0x1]['value']:undefined)||[]},{'name':_0x7993('0x49'),'value':_0x48f72f['attrFontSize']||(_0x48f72f[_0x7993('0x40')]&&_0x48f72f[_0x7993('0x40')][0x2]?_0x48f72f[_0x7993('0x40')][0x2][_0x7993('0x41')]:undefined)||0x14}];case _0x7993('0x4e'):case'pie-chart':return[{'name':'attrSerie1','value':_0x48f72f[_0x7993('0x4f')]||(_0x48f72f[_0x7993('0x40')]&&_0x48f72f['attrs'][0x0]?_0x48f72f[_0x7993('0x40')][0x0][_0x7993('0x41')]:undefined)||'total'},{'name':_0x7993('0x50'),'value':_0x48f72f['attrSerie2']||(_0x48f72f['attrs']&&_0x48f72f['attrs'][0x1]?_0x48f72f['attrs'][0x1]['value']:undefined)||null},{'name':_0x7993('0x51'),'value':_0x48f72f[_0x7993('0x51')]||(_0x48f72f[_0x7993('0x40')]&&_0x48f72f[_0x7993('0x40')][0x2]?_0x48f72f['attrs'][0x2][_0x7993('0x41')]:undefined)||null},{'name':_0x7993('0x4d'),'value':_0x48f72f['attrVoiceQueues']||(_0x48f72f['attrs']&&_0x48f72f[_0x7993('0x40')][0x3]?_0x48f72f[_0x7993('0x40')][0x3]['value']:undefined)||[]}];case'web-report':return[{'name':_0x7993('0x52'),'type':_0x48f72f[_0x7993('0x53')]||(_0x48f72f['attrs']&&_0x48f72f[_0x7993('0x40')][0x0]?_0x48f72f[_0x7993('0x40')][0x0]['type']:undefined)||null,'value':_0x48f72f[_0x7993('0x52')]||(_0x48f72f[_0x7993('0x40')]&&_0x48f72f[_0x7993('0x40')][0x0]?_0x48f72f[_0x7993('0x40')][0x0][_0x7993('0x41')]:undefined)||null},{'name':_0x7993('0x54'),'value':_0x48f72f[_0x7993('0x54')]||(_0x48f72f[_0x7993('0x40')]&&_0x48f72f[_0x7993('0x40')][0x1]?_0x48f72f[_0x7993('0x40')][0x1][_0x7993('0x41')]:undefined)||0x0}];default:return[];}}catch(_0x4fa57f){logger[_0x7993('0x55')](_0x7993('0x56'),JSON[_0x7993('0x57')](_0x4fa57f));return[];}}exports['create']=function(_0xf9835a,_0x3faff5){if(_0xf9835a[_0x7993('0x58')]){_0xf9835a[_0x7993('0x58')][_0x7993('0x40')]=widgetAttributes(_0xf9835a[_0x7993('0x58')]);}return db['DashboardItem']['create'](_0xf9835a[_0x7993('0x58')],{})[_0x7993('0x3b')](respondWithResult(_0x3faff5,0xc9))[_0x7993('0x3c')](handleError(_0x3faff5,null));};exports[_0x7993('0x59')]=function(_0x1c2c8e,_0x3b1199){if(_0x1c2c8e[_0x7993('0x58')]['id']){delete _0x1c2c8e[_0x7993('0x58')]['id'];}_0x1c2c8e[_0x7993('0x58')][_0x7993('0x40')]=widgetAttributes(_0x1c2c8e[_0x7993('0x58')]);return db[_0x7993('0x2e')][_0x7993('0x3a')]({'where':{'id':_0x1c2c8e['params']['id']}})[_0x7993('0x3b')](handleEntityNotFound(_0x3b1199,null))['then'](saveUpdates(_0x1c2c8e[_0x7993('0x58')],null))['then'](respondWithResult(_0x3b1199,null))[_0x7993('0x3c')](handleError(_0x3b1199,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index c9253a2..0660e58 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 _0xac41=['exports','events','../../mysqldb','DashboardItem','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x3fc61e,_0x5b8599){var _0x58e101=function(_0x12066c){while(--_0x12066c){_0x3fc61e['push'](_0x3fc61e['shift']());}};_0x58e101(++_0x5b8599);}(_0xac41,0xdd));var _0x1ac4=function(_0x3e43c7,_0xd01ef2){_0x3e43c7=_0x3e43c7-0x0;var _0x142c0d=_0xac41[_0x3e43c7];return _0x142c0d;};'use strict';var EventEmitter=require(_0x1ac4('0x0'));var DashboardItem=require(_0x1ac4('0x1'))['db'][_0x1ac4('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x1ac4('0x3')](0x0);var events={'afterCreate':_0x1ac4('0x4'),'afterUpdate':_0x1ac4('0x5'),'afterDestroy':_0x1ac4('0x6')};function emitEvent(_0x3a1763){return function(_0x54386c,_0x2c33d6,_0x216c0d){DashboardItemEvents[_0x1ac4('0x7')](_0x3a1763+':'+_0x54386c['id'],_0x54386c);DashboardItemEvents[_0x1ac4('0x7')](_0x3a1763,_0x54386c);_0x216c0d(null);};}for(var e in events){if(events[_0x1ac4('0x8')](e)){var event=events[e];DashboardItem[_0x1ac4('0x9')](e,emitEvent(event));}}module[_0x1ac4('0xa')]=DashboardItemEvents; \ No newline at end of file +var _0xa329=['hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','update','remove','emit'];(function(_0x219d87,_0x1cb6f7){var _0x22823d=function(_0x5357bf){while(--_0x5357bf){_0x219d87['push'](_0x219d87['shift']());}};_0x22823d(++_0x1cb6f7);}(_0xa329,0x162));var _0x9a32=function(_0x21354a,_0x3c4926){_0x21354a=_0x21354a-0x0;var _0x128fb6=_0xa329[_0x21354a];return _0x128fb6;};'use strict';var EventEmitter=require(_0x9a32('0x0'));var DashboardItem=require(_0x9a32('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x9a32('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9a32('0x3'),'afterDestroy':_0x9a32('0x4')};function emitEvent(_0x5c3175){return function(_0x5b4426,_0x3a567e,_0x38884d){DashboardItemEvents[_0x9a32('0x5')](_0x5c3175+':'+_0x5b4426['id'],_0x5b4426);DashboardItemEvents[_0x9a32('0x5')](_0x5c3175,_0x5b4426);_0x38884d(null);};}for(var e in events){if(events[_0x9a32('0x6')](e)){var event=events[e];DashboardItem[_0x9a32('0x7')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 07e6b94..24d0a90 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 _0x6445=['lodash','util','../../config/logger','bluebird','request-promise','path','exports','dashboard_items'];(function(_0x5ba104,_0x3ec506){var _0x39b692=function(_0x206d31){while(--_0x206d31){_0x5ba104['push'](_0x5ba104['shift']());}};_0x39b692(++_0x3ec506);}(_0x6445,0x1c0));var _0x5644=function(_0x3238c7,_0x53f84e){_0x3238c7=_0x3238c7-0x0;var _0x4d6bec=_0x6445[_0x3238c7];return _0x4d6bec;};'use strict';var _=require(_0x5644('0x0'));var util=require(_0x5644('0x1'));var logger=require(_0x5644('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5644('0x3'));var rp=require(_0x5644('0x4'));var fs=require('fs');var path=require(_0x5644('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./dashboardItem.attributes');module[_0x5644('0x6')]=function(_0x73fde3,_0x4bec6e){return _0x73fde3['define']('DashboardItem',attributes,{'tableName':_0x5644('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5f83=['../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','util','moment','bluebird','path'];(function(_0x4e75c5,_0xf8acd0){var _0x2b858e=function(_0x14386c){while(--_0x14386c){_0x4e75c5['push'](_0x4e75c5['shift']());}};_0x2b858e(++_0xf8acd0);}(_0x5f83,0xe2));var _0x35f8=function(_0x3c7153,_0x1cb13d){_0x3c7153=_0x3c7153-0x0;var _0x5a7423=_0x5f83[_0x3c7153];return _0x5a7423;};'use strict';var _=require('lodash');var util=require(_0x35f8('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x35f8('0x1'));var BPromise=require(_0x35f8('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x35f8('0x3'));var rimraf=require('rimraf');var config=require(_0x35f8('0x4'));var attributes=require(_0x35f8('0x5'));module[_0x35f8('0x6')]=function(_0x236fac,_0x57cd68){return _0x236fac[_0x35f8('0x7')](_0x35f8('0x8'),attributes,{'tableName':_0x35f8('0x9'),'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 7433ad2..3774dea 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 _0x0de7=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','then','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s'];(function(_0x337216,_0x4184e2){var _0x113fdb=function(_0x34e656){while(--_0x34e656){_0x337216['push'](_0x337216['shift']());}};_0x113fdb(++_0x4184e2);}(_0x0de7,0xca));var _0x70de=function(_0x20d08c,_0x15431d){_0x20d08c=_0x20d08c-0x0;var _0x2f64e8=_0x0de7[_0x20d08c];return _0x2f64e8;};'use strict';var _=require(_0x70de('0x0'));var util=require(_0x70de('0x1'));var moment=require(_0x70de('0x2'));var BPromise=require(_0x70de('0x3'));var rs=require(_0x70de('0x4'));var fs=require('fs');var Redis=require(_0x70de('0x5'));var db=require(_0x70de('0x6'))['db'];var utils=require(_0x70de('0x7'));var logger=require(_0x70de('0x8'))(_0x70de('0x9'));var config=require(_0x70de('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x70de('0xb')]['http']({'port':0x232a});config[_0x70de('0xc')]=_['defaults'](config[_0x70de('0xc')],{'host':_0x70de('0xd'),'port':0x18eb});var socket=require(_0x70de('0xe'))(new Redis(config[_0x70de('0xc')]));require(_0x70de('0xf'))[_0x70de('0x10')](socket);function respondWithRpcPromise(_0x3963a8,_0x1d2c9f,_0x20c800){return new BPromise(function(_0x853f47,_0x41ff20){return client['request'](_0x3963a8,_0x20c800)[_0x70de('0x11')](function(_0x54d3f7){logger['info'](_0x70de('0x12'),_0x1d2c9f,_0x70de('0x13'));logger[_0x70de('0x14')](_0x70de('0x15'),_0x1d2c9f,_0x70de('0x13'),JSON[_0x70de('0x16')](_0x54d3f7));if(_0x54d3f7[_0x70de('0x17')]){if(_0x54d3f7[_0x70de('0x17')][_0x70de('0x18')]===0x1f4){logger[_0x70de('0x17')](_0x70de('0x12'),_0x1d2c9f,_0x54d3f7[_0x70de('0x17')][_0x70de('0x19')]);return _0x41ff20(_0x54d3f7[_0x70de('0x17')]['message']);}logger['error'](_0x70de('0x12'),_0x1d2c9f,_0x54d3f7[_0x70de('0x17')][_0x70de('0x19')]);return _0x853f47(_0x54d3f7[_0x70de('0x17')][_0x70de('0x19')]);}else{logger['info'](_0x70de('0x12'),_0x1d2c9f,_0x70de('0x13'));_0x853f47(_0x54d3f7[_0x70de('0x1a')][_0x70de('0x19')]);}})[_0x70de('0x1b')](function(_0x16d7f2){logger[_0x70de('0x17')](_0x70de('0x12'),_0x1d2c9f,_0x16d7f2);_0x41ff20(_0x16d7f2);});});} \ No newline at end of file +var _0x45d5=['catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','jayson/promise','http','redis','defaults','localhost','register','request','then','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x53b76f,_0x13beea){var _0x14f2c5=function(_0xb09d2c){while(--_0xb09d2c){_0x53b76f['push'](_0x53b76f['shift']());}};_0x14f2c5(++_0x13beea);}(_0x45d5,0x1e4));var _0x545d=function(_0x29c876,_0x4ab5fa){_0x29c876=_0x29c876-0x0;var _0x46802e=_0x45d5[_0x29c876];return _0x46802e;};'use strict';var _=require(_0x545d('0x0'));var util=require(_0x545d('0x1'));var moment=require('moment');var BPromise=require(_0x545d('0x2'));var rs=require(_0x545d('0x3'));var fs=require('fs');var Redis=require(_0x545d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x545d('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x545d('0x6'));var client=jayson['client'][_0x545d('0x7')]({'port':0x232a});config[_0x545d('0x8')]=_[_0x545d('0x9')](config[_0x545d('0x8')],{'host':_0x545d('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x545d('0x8')]));require('./dashboardItem.socket')[_0x545d('0xb')](socket);function respondWithRpcPromise(_0x48917f,_0x5422ac,_0x23a943){return new BPromise(function(_0x2965be,_0xdd5c2e){return client[_0x545d('0xc')](_0x48917f,_0x23a943)[_0x545d('0xd')](function(_0xbd865d){logger['info'](_0x545d('0xe'),_0x5422ac,_0x545d('0xf'));logger[_0x545d('0x10')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x5422ac,_0x545d('0xf'),JSON[_0x545d('0x11')](_0xbd865d));if(_0xbd865d[_0x545d('0x12')]){if(_0xbd865d[_0x545d('0x12')][_0x545d('0x13')]===0x1f4){logger['error'](_0x545d('0xe'),_0x5422ac,_0xbd865d['error'][_0x545d('0x14')]);return _0xdd5c2e(_0xbd865d[_0x545d('0x12')][_0x545d('0x14')]);}logger['error'](_0x545d('0xe'),_0x5422ac,_0xbd865d[_0x545d('0x12')][_0x545d('0x14')]);return _0x2965be(_0xbd865d[_0x545d('0x12')][_0x545d('0x14')]);}else{logger[_0x545d('0x15')](_0x545d('0xe'),_0x5422ac,_0x545d('0xf'));_0x2965be(_0xbd865d['result'][_0x545d('0x14')]);}})[_0x545d('0x16')](function(_0x241522){logger[_0x545d('0x12')](_0x545d('0xe'),_0x5422ac,_0x241522);_0xdd5c2e(_0x241522);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index c88aabb..bdc11b6 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 _0x3e74=['emit','removeListener','register','length','dashboardItem:','./dashboardItem.events','remove','update'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x3e74,0x175));var _0x43e7=function(_0x449f38,_0x32823b){_0x449f38=_0x449f38-0x0;var _0x18d314=_0x3e74[_0x449f38];return _0x18d314;};'use strict';var DashboardItemEvents=require(_0x43e7('0x0'));var events=['save',_0x43e7('0x1'),_0x43e7('0x2')];function createListener(_0x151ad2,_0x494e45){return function(_0x490ced){_0x494e45[_0x43e7('0x3')](_0x151ad2,_0x490ced);};}function removeListener(_0x4f9bbe,_0x128b0f){return function(){DashboardItemEvents[_0x43e7('0x4')](_0x4f9bbe,_0x128b0f);};}exports[_0x43e7('0x5')]=function(_0x1c503b){for(var _0xc98b9c=0x0,_0x503698=events[_0x43e7('0x6')];_0xc98b9c<_0x503698;_0xc98b9c++){var _0x3491d6=events[_0xc98b9c];var _0x2ede2d=createListener(_0x43e7('0x7')+_0x3491d6,_0x1c503b);DashboardItemEvents['on'](_0x3491d6,_0x2ede2d);}}; \ No newline at end of file +var _0xedd9=['removeListener','register','length','dashboardItem:','save','remove','update','emit'];(function(_0x4f18d0,_0x2dfba7){var _0x151b22=function(_0x16823e){while(--_0x16823e){_0x4f18d0['push'](_0x4f18d0['shift']());}};_0x151b22(++_0x2dfba7);}(_0xedd9,0xfc));var _0x9edd=function(_0x2da4c6,_0x3cbf23){_0x2da4c6=_0x2da4c6-0x0;var _0x4741c6=_0xedd9[_0x2da4c6];return _0x4741c6;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x9edd('0x0'),_0x9edd('0x1'),_0x9edd('0x2')];function createListener(_0x2c16b8,_0x3b51bc){return function(_0x127cbe){_0x3b51bc[_0x9edd('0x3')](_0x2c16b8,_0x127cbe);};}function removeListener(_0x36b53f,_0x5943b3){return function(){DashboardItemEvents[_0x9edd('0x4')](_0x36b53f,_0x5943b3);};}exports[_0x9edd('0x5')]=function(_0x268f9e){for(var _0x34c1a7=0x0,_0x5319f7=events[_0x9edd('0x6')];_0x34c1a7<_0x5319f7;_0x34c1a7++){var _0x571af9=events[_0x34c1a7];var _0x172522=createListener(_0x9edd('0x7')+_0x571af9,_0x268f9e);DashboardItemEvents['on'](_0x571af9,_0x172522);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index c03e207..ca311dc 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 _0xf893=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','show','isAuthenticated','create','delete','destroy','exports','util'];(function(_0x1857d0,_0x6eade0){var _0x3e3c46=function(_0x3915b8){while(--_0x3915b8){_0x1857d0['push'](_0x1857d0['shift']());}};_0x3e3c46(++_0x6eade0);}(_0xf893,0x76));var _0x3f89=function(_0x297510,_0x551d52){_0x297510=_0x297510-0x0;var _0x5de3c8=_0xf893[_0x297510];return _0x5de3c8;};'use strict';var multer=require('multer');var util=require(_0x3f89('0x0'));var path=require(_0x3f89('0x1'));var timeout=require(_0x3f89('0x2'));var express=require(_0x3f89('0x3'));var router=express[_0x3f89('0x4')]();var auth=require(_0x3f89('0x5'));var interaction=require(_0x3f89('0x6'));var config=require(_0x3f89('0x7'));var controller=require(_0x3f89('0x8'));router[_0x3f89('0x9')](_0x3f89('0xa'),auth['isAuthenticated'](),controller[_0x3f89('0xb')]);router['post']('/',auth[_0x3f89('0xc')](),controller[_0x3f89('0xd')]);router['put'](_0x3f89('0xa'),auth[_0x3f89('0xc')](),controller['update']);router[_0x3f89('0xe')](_0x3f89('0xa'),auth[_0x3f89('0xc')](),controller[_0x3f89('0xf')]);module[_0x3f89('0x10')]=router; \ No newline at end of file +var _0x8736=['destroy','exports','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','isAuthenticated','show','post','create','put'];(function(_0x246426,_0x505c21){var _0x320fcf=function(_0x5f50dc){while(--_0x5f50dc){_0x246426['push'](_0x246426['shift']());}};_0x320fcf(++_0x505c21);}(_0x8736,0x12d));var _0x6873=function(_0x1fda14,_0x25c6ed){_0x1fda14=_0x1fda14-0x0;var _0x5264cf=_0x8736[_0x1fda14];return _0x5264cf;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x6873('0x0'));var express=require('express');var router=express[_0x6873('0x1')]();var auth=require(_0x6873('0x2'));var interaction=require(_0x6873('0x3'));var config=require(_0x6873('0x4'));var controller=require('./dashboardItem.controller');router['get'](_0x6873('0x5'),auth[_0x6873('0x6')](),controller[_0x6873('0x7')]);router[_0x6873('0x8')]('/',auth[_0x6873('0x6')](),controller[_0x6873('0x9')]);router[_0x6873('0xa')](_0x6873('0x5'),auth[_0x6873('0x6')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x6873('0xb')]);module[_0x6873('0xc')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index a66cecb..9ddbde1 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 _0x9572=['sequelize','exports','STRING'];(function(_0xf8bd98,_0x722df){var _0x34e8af=function(_0x55b652){while(--_0x55b652){_0xf8bd98['push'](_0xf8bd98['shift']());}};_0x34e8af(++_0x722df);}(_0x9572,0x1b3));var _0x2957=function(_0x538f7f,_0x57254d){_0x538f7f=_0x538f7f-0x0;var _0x24f61f=_0x9572[_0x538f7f];return _0x24f61f;};'use strict';var Sequelize=require(_0x2957('0x0'));module[_0x2957('0x1')]={'name':{'type':Sequelize[_0x2957('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xdc18=['sequelize'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xdc18,0x12e));var _0x8dc1=function(_0x52397b,_0x10a0ce){_0x52397b=_0x52397b-0x0;var _0x3ade38=_0xdc18[_0x52397b];return _0x3ade38;};'use strict';var Sequelize=require(_0x8dc1('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 89381fd..5fe1128 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 _0x3a96=['keys','query','filters','intersection','attributes','fields','length','sort','where','filter','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','merge','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../mysqldb','end','json','count','offset','limit','status','set','Content-Range','apply','reject','then','destroy','get','Dispositions','UserProfileResource','sendStatus','error','name','send','index','Disposition','rawAttributes','model'];(function(_0x48a458,_0x2c08c2){var _0x4c5f26=function(_0x67fcdf){while(--_0x67fcdf){_0x48a458['push'](_0x48a458['shift']());}};_0x4c5f26(++_0x2c08c2);}(_0x3a96,0x6d));var _0x63a9=function(_0x41381e,_0x28715e){_0x41381e=_0x41381e-0x0;var _0x28dd32=_0x3a96[_0x41381e];return _0x28dd32;};'use strict';var pdf=require(_0x63a9('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x63a9('0x1'));var zipdir=require(_0x63a9('0x2'));var jsonpatch=require(_0x63a9('0x3'));var rp=require(_0x63a9('0x4'));var moment=require(_0x63a9('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x63a9('0x6'));var path=require('path');var sox=require(_0x63a9('0x7'));var csv=require(_0x63a9('0x8'));var ejs=require(_0x63a9('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x63a9('0xa'));var crypto=require('crypto');var jsforce=require(_0x63a9('0xb'));var deskjs=require(_0x63a9('0xc'));var toCsv=require(_0x63a9('0x8'));var querystring=require('querystring');var Papa=require(_0x63a9('0xd'));var Redis=require(_0x63a9('0xe'));var authService=require(_0x63a9('0xf'));var qs=require(_0x63a9('0x10'));var hardwareService=require(_0x63a9('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x63a9('0x12'));var db=require(_0x63a9('0x13'))['db'];function respondWithStatusCode(_0x5ac9a2,_0xa01fca){_0xa01fca=_0xa01fca||0xcc;return function(_0x54da84){if(_0x54da84){return _0x5ac9a2['sendStatus'](_0xa01fca);}return _0x5ac9a2['status'](_0xa01fca)[_0x63a9('0x14')]();};}function respondWithResult(_0x4060b9,_0x386907){_0x386907=_0x386907||0xc8;return function(_0x8e8006){if(_0x8e8006){return _0x4060b9['status'](_0x386907)[_0x63a9('0x15')](_0x8e8006);}};}function respondWithFilteredResult(_0xeeeb26,_0x31bf31){return function(_0x2c6f8a){if(_0x2c6f8a){var _0x3ea391=_0x2c6f8a[_0x63a9('0x16')],_0x331dc6=_0x31bf31[_0x63a9('0x17')],_0x41ef5c=_0x31bf31[_0x63a9('0x17')]+_0x31bf31[_0x63a9('0x18')],_0x22cd97;if(_0x41ef5c>=_0x3ea391){_0x41ef5c=_0x3ea391;_0x22cd97=0xc8;}else{_0x22cd97=0xce;}_0xeeeb26[_0x63a9('0x19')](_0x22cd97);return _0xeeeb26[_0x63a9('0x1a')](_0x63a9('0x1b'),_0x331dc6+'-'+_0x41ef5c+'/'+_0x3ea391)[_0x63a9('0x15')](_0x2c6f8a);}return null;};}function patchUpdates(_0x46207d){return function(_0x19d168){try{jsonpatch[_0x63a9('0x1c')](_0x19d168,_0x46207d,!![]);}catch(_0x114373){return BPromise[_0x63a9('0x1d')](_0x114373);}return _0x19d168['save']();};}function saveUpdates(_0x8a7916,_0x53d471){return function(_0x1cfe19){if(_0x1cfe19){return _0x1cfe19['update'](_0x8a7916)[_0x63a9('0x1e')](function(_0x174393){return _0x174393;});}return null;};}function removeEntity(_0x2a1c70,_0xd0778d){return function(_0x155a37){if(_0x155a37){return _0x155a37[_0x63a9('0x1f')]()['then'](function(){var _0x175ba3=_0x155a37[_0x63a9('0x20')]({'plain':!![]});var _0x220a27=_0x63a9('0x21');return db[_0x63a9('0x22')]['destroy']({'where':{'type':_0x220a27,'resourceId':_0x175ba3['id']}})['then'](function(){return _0x155a37;});})[_0x63a9('0x1e')](function(){_0x2a1c70[_0x63a9('0x19')](0xcc)[_0x63a9('0x14')]();});}};}function handleEntityNotFound(_0x1f7683,_0x876c3d){return function(_0x5b93bb){if(!_0x5b93bb){_0x1f7683[_0x63a9('0x23')](0x194);}return _0x5b93bb;};}function handleError(_0x3fca39,_0x4b2d71){_0x4b2d71=_0x4b2d71||0x1f4;return function(_0xce9fd5){logger[_0x63a9('0x24')](_0xce9fd5['stack']);if(_0xce9fd5['name']){delete _0xce9fd5[_0x63a9('0x25')];}_0x3fca39[_0x63a9('0x19')](_0x4b2d71)[_0x63a9('0x26')](_0xce9fd5);};}exports[_0x63a9('0x27')]=function(_0x439f2d,_0x116a10){var _0x53e7ec={},_0x3357c3={},_0x1f33a7={'count':0x0,'rows':[]};var _0x526ae3=db[_0x63a9('0x28')][_0x63a9('0x29')];_0x3357c3[_0x63a9('0x2a')]=_[_0x63a9('0x2b')](_0x526ae3);_0x3357c3[_0x63a9('0x2c')]=_[_0x63a9('0x2b')](_0x439f2d[_0x63a9('0x2c')]);_0x3357c3[_0x63a9('0x2d')]=_[_0x63a9('0x2e')](_0x3357c3[_0x63a9('0x2a')],_0x3357c3[_0x63a9('0x2c')]);_0x53e7ec[_0x63a9('0x2f')]=_[_0x63a9('0x2e')](_0x3357c3['model'],qs[_0x63a9('0x30')](_0x439f2d[_0x63a9('0x2c')][_0x63a9('0x30')]));_0x53e7ec['attributes']=_0x53e7ec[_0x63a9('0x2f')][_0x63a9('0x31')]?_0x53e7ec['attributes']:_0x3357c3['model'];if(!_0x439f2d[_0x63a9('0x2c')]['hasOwnProperty']('nolimit')){_0x53e7ec[_0x63a9('0x18')]=qs[_0x63a9('0x18')](_0x439f2d['query'][_0x63a9('0x18')]);_0x53e7ec[_0x63a9('0x17')]=qs['offset'](_0x439f2d[_0x63a9('0x2c')][_0x63a9('0x17')]);}_0x53e7ec['order']=qs[_0x63a9('0x32')](_0x439f2d[_0x63a9('0x2c')][_0x63a9('0x32')]);_0x53e7ec[_0x63a9('0x33')]=qs[_0x63a9('0x2d')](_['pick'](_0x439f2d[_0x63a9('0x2c')],_0x3357c3[_0x63a9('0x2d')]));if(_0x439f2d[_0x63a9('0x2c')][_0x63a9('0x34')]){_0x53e7ec[_0x63a9('0x33')]=_['merge'](_0x53e7ec[_0x63a9('0x33')],{'$or':_[_0x63a9('0x35')](_0x526ae3,function(_0xd17358){if(_0xd17358[_0x63a9('0x36')][_0x63a9('0x37')]!==_0x63a9('0x38')){var _0x4e1224={};_0x4e1224[_0xd17358[_0x63a9('0x39')]]={'$like':'%'+_0x439f2d[_0x63a9('0x2c')][_0x63a9('0x34')]+'%'};return _0x4e1224;}})});}_0x53e7ec=_['merge']({},_0x53e7ec,_0x439f2d[_0x63a9('0x3a')]);var _0x361329={'where':_0x53e7ec[_0x63a9('0x33')]};return db[_0x63a9('0x28')][_0x63a9('0x16')](_0x361329)[_0x63a9('0x1e')](function(_0x5dea42){_0x1f33a7[_0x63a9('0x16')]=_0x5dea42;if(_0x439f2d[_0x63a9('0x2c')][_0x63a9('0x3b')]){_0x53e7ec[_0x63a9('0x3c')]=[{'all':!![]}];}return db[_0x63a9('0x28')][_0x63a9('0x3d')](_0x53e7ec);})[_0x63a9('0x1e')](function(_0x4b4b5b){_0x1f33a7[_0x63a9('0x3e')]=_0x4b4b5b;return _0x1f33a7;})['then'](respondWithFilteredResult(_0x116a10,_0x53e7ec))['catch'](handleError(_0x116a10,null));};exports[_0x63a9('0x3f')]=function(_0x2f47dc,_0x538485){var _0x19af83={'raw':!![],'where':{'id':_0x2f47dc[_0x63a9('0x40')]['id']}},_0x51c88c={};_0x51c88c[_0x63a9('0x2a')]=_['keys'](db['Disposition'][_0x63a9('0x29')]);_0x51c88c[_0x63a9('0x2c')]=_[_0x63a9('0x2b')](_0x2f47dc[_0x63a9('0x2c')]);_0x51c88c['filters']=_[_0x63a9('0x2e')](_0x51c88c[_0x63a9('0x2a')],_0x51c88c[_0x63a9('0x2c')]);_0x19af83['attributes']=_[_0x63a9('0x2e')](_0x51c88c[_0x63a9('0x2a')],qs[_0x63a9('0x30')](_0x2f47dc[_0x63a9('0x2c')][_0x63a9('0x30')]));_0x19af83[_0x63a9('0x2f')]=_0x19af83[_0x63a9('0x2f')][_0x63a9('0x31')]?_0x19af83[_0x63a9('0x2f')]:_0x51c88c['model'];if(_0x2f47dc[_0x63a9('0x2c')][_0x63a9('0x3b')]){_0x19af83[_0x63a9('0x3c')]=[{'all':!![]}];}_0x19af83=_[_0x63a9('0x41')]({},_0x19af83,_0x2f47dc[_0x63a9('0x3a')]);return db[_0x63a9('0x28')][_0x63a9('0x42')](_0x19af83)[_0x63a9('0x1e')](handleEntityNotFound(_0x538485,null))[_0x63a9('0x1e')](respondWithResult(_0x538485,null))['catch'](handleError(_0x538485,null));};exports[_0x63a9('0x43')]=function(_0x3ea289,_0x209f4a){return db['Disposition'][_0x63a9('0x43')](_0x3ea289[_0x63a9('0x44')],{})[_0x63a9('0x1e')](function(_0x499ee6){var _0x496515=_0x3ea289['user'][_0x63a9('0x20')]({'plain':!![]});if(!_0x496515)throw new Error(_0x63a9('0x45'));if(_0x496515['role']===_0x63a9('0x46')){var _0x5d5062=_0x499ee6[_0x63a9('0x20')]({'plain':!![]});var _0x5db1d0='Dispositions';return db[_0x63a9('0x47')][_0x63a9('0x42')]({'where':{'name':_0x5db1d0,'userProfileId':_0x496515[_0x63a9('0x48')]},'raw':!![]})[_0x63a9('0x1e')](function(_0x2c07f7){if(_0x2c07f7&&_0x2c07f7['autoAssociation']===0x0){return db[_0x63a9('0x22')]['create']({'name':_0x5d5062['name'],'resourceId':_0x5d5062['id'],'type':_0x2c07f7[_0x63a9('0x25')],'sectionId':_0x2c07f7['id']},{})[_0x63a9('0x1e')](function(){return _0x499ee6;});}else{return _0x499ee6;}})[_0x63a9('0x49')](function(_0x2fb87a){logger[_0x63a9('0x24')](_0x63a9('0x4a'),_0x2fb87a);throw _0x2fb87a;});}return _0x499ee6;})[_0x63a9('0x1e')](respondWithResult(_0x209f4a,0xc9))[_0x63a9('0x49')](handleError(_0x209f4a,null));};exports[_0x63a9('0x4b')]=function(_0x3c4d2b,_0x53b832){if(_0x3c4d2b[_0x63a9('0x44')]['id']){delete _0x3c4d2b[_0x63a9('0x44')]['id'];}return db['Disposition'][_0x63a9('0x42')]({'where':{'id':_0x3c4d2b[_0x63a9('0x40')]['id']}})[_0x63a9('0x1e')](handleEntityNotFound(_0x53b832,null))[_0x63a9('0x1e')](saveUpdates(_0x3c4d2b[_0x63a9('0x44')],null))[_0x63a9('0x1e')](respondWithResult(_0x53b832,null))[_0x63a9('0x49')](handleError(_0x53b832,null));};exports[_0x63a9('0x1f')]=function(_0x5b84fa,_0x356764){return db[_0x63a9('0x28')][_0x63a9('0x42')]({'where':{'id':_0x5b84fa[_0x63a9('0x40')]['id']}})['then'](handleEntityNotFound(_0x356764,null))[_0x63a9('0x1e')](removeEntity(_0x356764,null))['catch'](handleError(_0x356764,null));}; \ No newline at end of file +var _0xcf8c=['Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','querystring','papaparse','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','limit','set','Content-Range','apply','save','update','destroy','then','Dispositions','UserProfileResource','sendStatus','error','stack','name','index','Disposition','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','nolimit','offset','order','sort','where','pick','filter','type','key','field','options','includeAll','include','rows','catch','show','params','merge','find','create','body','user','get'];(function(_0x555ebb,_0x4b1b68){var _0x3c0a4a=function(_0x312e2f){while(--_0x312e2f){_0x555ebb['push'](_0x555ebb['shift']());}};_0x3c0a4a(++_0x4b1b68);}(_0xcf8c,0x190));var _0xccf8=function(_0x2b86a4,_0x3bc215){_0x2b86a4=_0x2b86a4-0x0;var _0x1c6f0e=_0xcf8c[_0x2b86a4];return _0x1c6f0e;};'use strict';var pdf=require(_0xccf8('0x0'));var emlformat=require(_0xccf8('0x1'));var rimraf=require(_0xccf8('0x2'));var zipdir=require(_0xccf8('0x3'));var jsonpatch=require(_0xccf8('0x4'));var rp=require(_0xccf8('0x5'));var moment=require(_0xccf8('0x6'));var BPromise=require(_0xccf8('0x7'));var Mustache=require(_0xccf8('0x8'));var util=require(_0xccf8('0x9'));var path=require(_0xccf8('0xa'));var sox=require(_0xccf8('0xb'));var csv=require('to-csv');var ejs=require(_0xccf8('0xc'));var fs=require('fs');var _=require(_0xccf8('0xd'));var squel=require('squel');var crypto=require(_0xccf8('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xccf8('0xf'));var Papa=require(_0xccf8('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xccf8('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xccf8('0x12'));var utils=require(_0xccf8('0x13'));var config=require(_0xccf8('0x14'));var db=require(_0xccf8('0x15'))['db'];function respondWithStatusCode(_0x3b8a1e,_0x1047b4){_0x1047b4=_0x1047b4||0xcc;return function(_0x1622a0){if(_0x1622a0){return _0x3b8a1e['sendStatus'](_0x1047b4);}return _0x3b8a1e[_0xccf8('0x16')](_0x1047b4)[_0xccf8('0x17')]();};}function respondWithResult(_0x1e0198,_0x683b43){_0x683b43=_0x683b43||0xc8;return function(_0x2422ce){if(_0x2422ce){return _0x1e0198['status'](_0x683b43)[_0xccf8('0x18')](_0x2422ce);}};}function respondWithFilteredResult(_0x3138a3,_0x39aba2){return function(_0x399794){if(_0x399794){var _0x4488a9=_0x399794[_0xccf8('0x19')],_0x1c605b=_0x39aba2['offset'],_0x1d97ba=_0x39aba2['offset']+_0x39aba2[_0xccf8('0x1a')],_0x1ac0d3;if(_0x1d97ba>=_0x4488a9){_0x1d97ba=_0x4488a9;_0x1ac0d3=0xc8;}else{_0x1ac0d3=0xce;}_0x3138a3[_0xccf8('0x16')](_0x1ac0d3);return _0x3138a3[_0xccf8('0x1b')](_0xccf8('0x1c'),_0x1c605b+'-'+_0x1d97ba+'/'+_0x4488a9)[_0xccf8('0x18')](_0x399794);}return null;};}function patchUpdates(_0x52feb2){return function(_0x3a29a9){try{jsonpatch[_0xccf8('0x1d')](_0x3a29a9,_0x52feb2,!![]);}catch(_0x1832fc){return BPromise['reject'](_0x1832fc);}return _0x3a29a9[_0xccf8('0x1e')]();};}function saveUpdates(_0x3022f5,_0x5f104e){return function(_0x422bdd){if(_0x422bdd){return _0x422bdd[_0xccf8('0x1f')](_0x3022f5)['then'](function(_0x46fcb7){return _0x46fcb7;});}return null;};}function removeEntity(_0x25eefe,_0x178dd1){return function(_0x33a663){if(_0x33a663){return _0x33a663[_0xccf8('0x20')]()[_0xccf8('0x21')](function(){var _0x39f0b9=_0x33a663['get']({'plain':!![]});var _0x2d8c96=_0xccf8('0x22');return db[_0xccf8('0x23')]['destroy']({'where':{'type':_0x2d8c96,'resourceId':_0x39f0b9['id']}})['then'](function(){return _0x33a663;});})['then'](function(){_0x25eefe[_0xccf8('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x461e74,_0x54ea40){return function(_0x401069){if(!_0x401069){_0x461e74[_0xccf8('0x24')](0x194);}return _0x401069;};}function handleError(_0x3a06f0,_0x2148a3){_0x2148a3=_0x2148a3||0x1f4;return function(_0x49c8ea){logger[_0xccf8('0x25')](_0x49c8ea[_0xccf8('0x26')]);if(_0x49c8ea[_0xccf8('0x27')]){delete _0x49c8ea['name'];}_0x3a06f0[_0xccf8('0x16')](_0x2148a3)['send'](_0x49c8ea);};}exports[_0xccf8('0x28')]=function(_0x224c69,_0x2ee50b){var _0x39ef04={},_0x10bc57={},_0xf3b8c9={'count':0x0,'rows':[]};var _0x271e10=db[_0xccf8('0x29')][_0xccf8('0x2a')];_0x10bc57[_0xccf8('0x2b')]=_[_0xccf8('0x2c')](_0x271e10);_0x10bc57[_0xccf8('0x2d')]=_[_0xccf8('0x2c')](_0x224c69[_0xccf8('0x2d')]);_0x10bc57[_0xccf8('0x2e')]=_[_0xccf8('0x2f')](_0x10bc57['model'],_0x10bc57[_0xccf8('0x2d')]);_0x39ef04['attributes']=_[_0xccf8('0x2f')](_0x10bc57[_0xccf8('0x2b')],qs[_0xccf8('0x30')](_0x224c69[_0xccf8('0x2d')][_0xccf8('0x30')]));_0x39ef04[_0xccf8('0x31')]=_0x39ef04[_0xccf8('0x31')][_0xccf8('0x32')]?_0x39ef04[_0xccf8('0x31')]:_0x10bc57[_0xccf8('0x2b')];if(!_0x224c69[_0xccf8('0x2d')]['hasOwnProperty'](_0xccf8('0x33'))){_0x39ef04['limit']=qs[_0xccf8('0x1a')](_0x224c69[_0xccf8('0x2d')][_0xccf8('0x1a')]);_0x39ef04[_0xccf8('0x34')]=qs[_0xccf8('0x34')](_0x224c69[_0xccf8('0x2d')]['offset']);}_0x39ef04[_0xccf8('0x35')]=qs[_0xccf8('0x36')](_0x224c69[_0xccf8('0x2d')][_0xccf8('0x36')]);_0x39ef04[_0xccf8('0x37')]=qs[_0xccf8('0x2e')](_[_0xccf8('0x38')](_0x224c69[_0xccf8('0x2d')],_0x10bc57[_0xccf8('0x2e')]));if(_0x224c69['query'][_0xccf8('0x39')]){_0x39ef04[_0xccf8('0x37')]=_['merge'](_0x39ef04[_0xccf8('0x37')],{'$or':_['map'](_0x271e10,function(_0x3913b7){if(_0x3913b7[_0xccf8('0x3a')][_0xccf8('0x3b')]!=='VIRTUAL'){var _0x366591={};_0x366591[_0x3913b7[_0xccf8('0x3c')]]={'$like':'%'+_0x224c69[_0xccf8('0x2d')][_0xccf8('0x39')]+'%'};return _0x366591;}})});}_0x39ef04=_['merge']({},_0x39ef04,_0x224c69[_0xccf8('0x3d')]);var _0x3e2a6c={'where':_0x39ef04[_0xccf8('0x37')]};return db['Disposition'][_0xccf8('0x19')](_0x3e2a6c)['then'](function(_0x1dd33b){_0xf3b8c9[_0xccf8('0x19')]=_0x1dd33b;if(_0x224c69[_0xccf8('0x2d')][_0xccf8('0x3e')]){_0x39ef04[_0xccf8('0x3f')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x39ef04);})[_0xccf8('0x21')](function(_0x11092c){_0xf3b8c9[_0xccf8('0x40')]=_0x11092c;return _0xf3b8c9;})['then'](respondWithFilteredResult(_0x2ee50b,_0x39ef04))[_0xccf8('0x41')](handleError(_0x2ee50b,null));};exports[_0xccf8('0x42')]=function(_0x43c4ce,_0x31f412){var _0xc6db78={'raw':!![],'where':{'id':_0x43c4ce[_0xccf8('0x43')]['id']}},_0x30166f={};_0x30166f['model']=_[_0xccf8('0x2c')](db[_0xccf8('0x29')]['rawAttributes']);_0x30166f[_0xccf8('0x2d')]=_[_0xccf8('0x2c')](_0x43c4ce['query']);_0x30166f['filters']=_['intersection'](_0x30166f[_0xccf8('0x2b')],_0x30166f[_0xccf8('0x2d')]);_0xc6db78[_0xccf8('0x31')]=_[_0xccf8('0x2f')](_0x30166f[_0xccf8('0x2b')],qs[_0xccf8('0x30')](_0x43c4ce[_0xccf8('0x2d')][_0xccf8('0x30')]));_0xc6db78[_0xccf8('0x31')]=_0xc6db78[_0xccf8('0x31')][_0xccf8('0x32')]?_0xc6db78[_0xccf8('0x31')]:_0x30166f[_0xccf8('0x2b')];if(_0x43c4ce[_0xccf8('0x2d')][_0xccf8('0x3e')]){_0xc6db78[_0xccf8('0x3f')]=[{'all':!![]}];}_0xc6db78=_[_0xccf8('0x44')]({},_0xc6db78,_0x43c4ce[_0xccf8('0x3d')]);return db[_0xccf8('0x29')][_0xccf8('0x45')](_0xc6db78)[_0xccf8('0x21')](handleEntityNotFound(_0x31f412,null))[_0xccf8('0x21')](respondWithResult(_0x31f412,null))[_0xccf8('0x41')](handleError(_0x31f412,null));};exports[_0xccf8('0x46')]=function(_0x384ff7,_0x5e17e0){return db['Disposition'][_0xccf8('0x46')](_0x384ff7[_0xccf8('0x47')],{})['then'](function(_0x519c85){var _0x3111a8=_0x384ff7[_0xccf8('0x48')][_0xccf8('0x49')]({'plain':!![]});if(!_0x3111a8)throw new Error(_0xccf8('0x4a'));if(_0x3111a8['role']===_0xccf8('0x48')){var _0xc9555d=_0x519c85[_0xccf8('0x49')]({'plain':!![]});var _0x2859ce='Dispositions';return db[_0xccf8('0x4b')][_0xccf8('0x45')]({'where':{'name':_0x2859ce,'userProfileId':_0x3111a8[_0xccf8('0x4c')]},'raw':!![]})[_0xccf8('0x21')](function(_0x5a379f){if(_0x5a379f&&_0x5a379f[_0xccf8('0x4d')]===0x0){return db[_0xccf8('0x23')][_0xccf8('0x46')]({'name':_0xc9555d[_0xccf8('0x27')],'resourceId':_0xc9555d['id'],'type':_0x5a379f[_0xccf8('0x27')],'sectionId':_0x5a379f['id']},{})[_0xccf8('0x21')](function(){return _0x519c85;});}else{return _0x519c85;}})[_0xccf8('0x41')](function(_0x47b9bc){logger[_0xccf8('0x25')](_0xccf8('0x4e'),_0x47b9bc);throw _0x47b9bc;});}return _0x519c85;})[_0xccf8('0x21')](respondWithResult(_0x5e17e0,0xc9))[_0xccf8('0x41')](handleError(_0x5e17e0,null));};exports[_0xccf8('0x1f')]=function(_0x3c66f5,_0x5eaa1c){if(_0x3c66f5['body']['id']){delete _0x3c66f5[_0xccf8('0x47')]['id'];}return db[_0xccf8('0x29')][_0xccf8('0x45')]({'where':{'id':_0x3c66f5['params']['id']}})[_0xccf8('0x21')](handleEntityNotFound(_0x5eaa1c,null))[_0xccf8('0x21')](saveUpdates(_0x3c66f5['body'],null))[_0xccf8('0x21')](respondWithResult(_0x5eaa1c,null))[_0xccf8('0x41')](handleError(_0x5eaa1c,null));};exports[_0xccf8('0x20')]=function(_0xfdabe2,_0x3889b0){return db[_0xccf8('0x29')][_0xccf8('0x45')]({'where':{'id':_0xfdabe2[_0xccf8('0x43')]['id']}})['then'](handleEntityNotFound(_0x3889b0,null))['then'](removeEntity(_0x3889b0,null))[_0xccf8('0x41')](handleError(_0x3889b0,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index d0a5775..db4bb25 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 _0x5d64=['request-promise','path','../../config/environment','Disposition','name_voice','name','name_chat','ChatWebsiteId','name_mail','name_sms','SmsAccountId','name_fax','name_openchannel','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x5d64,0x92));var _0x45d6=function(_0xa7225,_0xe30d94){_0xa7225=_0xa7225-0x0;var _0x494608=_0x5d64[_0xa7225];return _0x494608;};'use strict';var _=require(_0x45d6('0x0'));var util=require(_0x45d6('0x1'));var logger=require(_0x45d6('0x2'))(_0x45d6('0x3'));var moment=require(_0x45d6('0x4'));var BPromise=require(_0x45d6('0x5'));var rp=require(_0x45d6('0x6'));var fs=require('fs');var path=require(_0x45d6('0x7'));var rimraf=require('rimraf');var config=require(_0x45d6('0x8'));var attributes=require('./disposition.attributes');module['exports']=function(_0x17d899,_0x330e6c){return _0x17d899['define'](_0x45d6('0x9'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x45d6('0xa'),'fields':[_0x45d6('0xb'),'ListId']},{'unique':!![],'name':_0x45d6('0xc'),'fields':['name',_0x45d6('0xd')]},{'unique':!![],'name':_0x45d6('0xe'),'fields':[_0x45d6('0xb'),'MailAccountId']},{'unique':!![],'name':_0x45d6('0xf'),'fields':[_0x45d6('0xb'),_0x45d6('0x10')]},{'unique':!![],'name':_0x45d6('0x11'),'fields':[_0x45d6('0xb'),'FaxAccountId']},{'unique':!![],'name':_0x45d6('0x12'),'fields':[_0x45d6('0xb'),'OpenchannelAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb5b9=['FaxAccountId','name_openchannel','OpenchannelAccountId','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','name_mail','MailAccountId','name_sms','SmsAccountId'];(function(_0x555069,_0x23d66a){var _0x100af7=function(_0x1606bd){while(--_0x1606bd){_0x555069['push'](_0x555069['shift']());}};_0x100af7(++_0x23d66a);}(_0xb5b9,0x19b));var _0x9b5b=function(_0x1ad49f,_0x593216){_0x1ad49f=_0x1ad49f-0x0;var _0xc9609f=_0xb5b9[_0x1ad49f];return _0xc9609f;};'use strict';var _=require(_0x9b5b('0x0'));var util=require(_0x9b5b('0x1'));var logger=require('../../config/logger')(_0x9b5b('0x2'));var moment=require(_0x9b5b('0x3'));var BPromise=require(_0x9b5b('0x4'));var rp=require(_0x9b5b('0x5'));var fs=require('fs');var path=require(_0x9b5b('0x6'));var rimraf=require(_0x9b5b('0x7'));var config=require(_0x9b5b('0x8'));var attributes=require(_0x9b5b('0x9'));module[_0x9b5b('0xa')]=function(_0x4cf26a,_0x356edb){return _0x4cf26a[_0x9b5b('0xb')](_0x9b5b('0xc'),attributes,{'tableName':_0x9b5b('0xd'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x9b5b('0xe'),'fields':[_0x9b5b('0xf'),_0x9b5b('0x10')]},{'unique':!![],'name':'name_chat','fields':[_0x9b5b('0xf'),'ChatWebsiteId']},{'unique':!![],'name':_0x9b5b('0x11'),'fields':[_0x9b5b('0xf'),_0x9b5b('0x12')]},{'unique':!![],'name':_0x9b5b('0x13'),'fields':['name',_0x9b5b('0x14')]},{'unique':!![],'name':'name_fax','fields':['name',_0x9b5b('0x15')]},{'unique':!![],'name':_0x9b5b('0x16'),'fields':['name',_0x9b5b('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 f9232dc..6f3af31 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 _0x4006=['moment','bluebird','randomstring','../../config/utils','rpc','client','request','then','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util'];(function(_0x15ae1f,_0x4b2d27){var _0x28eab1=function(_0x19c120){while(--_0x19c120){_0x15ae1f['push'](_0x15ae1f['shift']());}};_0x28eab1(++_0x4b2d27);}(_0x4006,0x1c7));var _0x6400=function(_0x34b821,_0x504e55){_0x34b821=_0x34b821-0x0;var _0x5e00a0=_0x4006[_0x34b821];return _0x5e00a0;};'use strict';var _=require('lodash');var util=require(_0x6400('0x0'));var moment=require(_0x6400('0x1'));var BPromise=require(_0x6400('0x2'));var rs=require(_0x6400('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6400('0x4'));var logger=require('../../config/logger')(_0x6400('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6400('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32c0db,_0x2d365b,_0x2bf4f8){return new BPromise(function(_0x250dba,_0x5cbe4f){return client[_0x6400('0x7')](_0x32c0db,_0x2bf4f8)[_0x6400('0x8')](function(_0x31a8d0){logger[_0x6400('0x9')](_0x6400('0xa'),_0x2d365b,_0x6400('0xb'));logger[_0x6400('0xc')](_0x6400('0xd'),_0x2d365b,_0x6400('0xb'),JSON[_0x6400('0xe')](_0x31a8d0));if(_0x31a8d0[_0x6400('0xf')]){if(_0x31a8d0['error'][_0x6400('0x10')]===0x1f4){logger[_0x6400('0xf')](_0x6400('0xa'),_0x2d365b,_0x31a8d0[_0x6400('0xf')]['message']);return _0x5cbe4f(_0x31a8d0[_0x6400('0xf')][_0x6400('0x11')]);}logger['error']('Disposition,\x20%s,\x20%s',_0x2d365b,_0x31a8d0['error'][_0x6400('0x11')]);return _0x250dba(_0x31a8d0[_0x6400('0xf')]['message']);}else{logger[_0x6400('0x9')]('Disposition,\x20%s,\x20%s',_0x2d365b,_0x6400('0xb'));_0x250dba(_0x31a8d0['result'][_0x6400('0x11')]);}})[_0x6400('0x12')](function(_0x276fb2){logger[_0x6400('0xf')]('Disposition,\x20%s,\x20%s',_0x2d365b,_0x276fb2);_0x5cbe4f(_0x276fb2);});});} \ No newline at end of file +var _0xb091=['Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\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(_0x4ce3b8,_0x616767){var _0x302779=function(_0x2c538a){while(--_0x2c538a){_0x4ce3b8['push'](_0x4ce3b8['shift']());}};_0x302779(++_0x616767);}(_0xb091,0x16e));var _0x1b09=function(_0x17cd85,_0x2e599e){_0x17cd85=_0x17cd85-0x0;var _0x5a971f=_0xb091[_0x17cd85];return _0x5a971f;};'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')]('Disposition,\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/disposition/index.js b/server/api/disposition/index.js index d7f4849..dad26e2 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 _0x5ec0=['destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','update'];(function(_0x4fdcb0,_0x1458ff){var _0x3b0881=function(_0x34a9f8){while(--_0x34a9f8){_0x4fdcb0['push'](_0x4fdcb0['shift']());}};_0x3b0881(++_0x1458ff);}(_0x5ec0,0x158));var _0x05ec=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x5ec0[_0x4b055c];return _0x4b62bb;};'use strict';var multer=require(_0x05ec('0x0'));var util=require(_0x05ec('0x1'));var path=require(_0x05ec('0x2'));var timeout=require('connect-timeout');var express=require(_0x05ec('0x3'));var router=express[_0x05ec('0x4')]();var auth=require(_0x05ec('0x5'));var interaction=require(_0x05ec('0x6'));var config=require(_0x05ec('0x7'));var controller=require('./disposition.controller');router[_0x05ec('0x8')]('/',auth[_0x05ec('0x9')](),controller[_0x05ec('0xa')]);router['get'](_0x05ec('0xb'),auth[_0x05ec('0x9')](),controller[_0x05ec('0xc')]);router[_0x05ec('0xd')]('/',auth[_0x05ec('0x9')](),controller['create']);router[_0x05ec('0xe')](_0x05ec('0xb'),auth[_0x05ec('0x9')](),controller[_0x05ec('0xf')]);router['delete'](_0x05ec('0xb'),auth[_0x05ec('0x9')](),controller[_0x05ec('0x10')]);module[_0x05ec('0x11')]=router; \ No newline at end of file +var _0xba99=['index','get','/:id','show','post','create','put','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x1ca386,_0x4c1c0d){var _0x3d5c9a=function(_0x1aba1d){while(--_0x1aba1d){_0x1ca386['push'](_0x1ca386['shift']());}};_0x3d5c9a(++_0x4c1c0d);}(_0xba99,0x15f));var _0x9ba9=function(_0x415429,_0x1e15b8){_0x415429=_0x415429-0x0;var _0x5f3cc5=_0xba99[_0x415429];return _0x5f3cc5;};'use strict';var multer=require(_0x9ba9('0x0'));var util=require(_0x9ba9('0x1'));var path=require(_0x9ba9('0x2'));var timeout=require(_0x9ba9('0x3'));var express=require(_0x9ba9('0x4'));var router=express[_0x9ba9('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x9ba9('0x6'));var config=require(_0x9ba9('0x7'));var controller=require('./disposition.controller');router['get']('/',auth[_0x9ba9('0x8')](),controller[_0x9ba9('0x9')]);router[_0x9ba9('0xa')](_0x9ba9('0xb'),auth[_0x9ba9('0x8')](),controller[_0x9ba9('0xc')]);router[_0x9ba9('0xd')]('/',auth[_0x9ba9('0x8')](),controller[_0x9ba9('0xe')]);router[_0x9ba9('0xf')]('/:id',auth[_0x9ba9('0x8')](),controller['update']);router[_0x9ba9('0x10')]('/:id',auth[_0x9ba9('0x8')](),controller[_0x9ba9('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 7c36c6a..2082d4b 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 _0x27c3=['12000','v17,v27,v29','INTEGER','SIP','DADHI','KHOMP','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','localstationid','2400','4800','7200','9600','14400'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x27c3,0x15a));var _0x327c=function(_0x5a1b6b,_0x320036){_0x5a1b6b=_0x5a1b6b-0x0;var _0xca9688=_0x27c3[_0x5a1b6b];return _0xca9688;};'use strict';var Sequelize=require(_0x327c('0x0'));module[_0x327c('0x1')]={'name':{'type':Sequelize[_0x327c('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x327c('0x2')]},'ecm':{'type':Sequelize[_0x327c('0x3')]('yes','no'),'defaultValue':_0x327c('0x4')},'headerinfo':{'type':Sequelize[_0x327c('0x2')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x327c('0x2')],'unique':_0x327c('0x5')},'minrate':{'type':Sequelize[_0x327c('0x3')](_0x327c('0x6'),_0x327c('0x7'),_0x327c('0x8'),_0x327c('0x9'),'12000',_0x327c('0xa')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x327c('0x3')](_0x327c('0x6'),_0x327c('0x7'),_0x327c('0x8'),_0x327c('0x9'),_0x327c('0xb'),_0x327c('0xa')),'defaultValue':_0x327c('0xa')},'modem':{'type':Sequelize[_0x327c('0x2')],'defaultValue':_0x327c('0xc')},'gateway':{'type':Sequelize[_0x327c('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x327c('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x327c('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x327c('0x3')](_0x327c('0xe'),'IAX',_0x327c('0xf'),_0x327c('0x10')),'defaultValue':_0x327c('0xe')},'key':{'type':Sequelize[_0x327c('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x327c('0x11');}},'notificationSound':{'type':Sequelize[_0x327c('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x327c('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x327c('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x327c('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x327c('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0x327c('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x327c('0x12')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x58a643){if(!_0x58a643)this['setDataValue']('mandatoryDispositionPauseId',null);this['setDataValue'](_0x327c('0x14'),_0x58a643);}}}; \ No newline at end of file +var _0xd9ec=['7200','9600','12000','14400','4800','v17,v27,v29','INTEGER','SIP','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400'];(function(_0x57f91f,_0x21cf17){var _0x4deca6=function(_0x5c97bb){while(--_0x5c97bb){_0x57f91f['push'](_0x57f91f['shift']());}};_0x4deca6(++_0x21cf17);}(_0xd9ec,0x191));var _0xcd9e=function(_0xa4a6f3,_0x3c22b){_0xa4a6f3=_0xa4a6f3-0x0;var _0x57cc06=_0xd9ec[_0xa4a6f3];return _0x57cc06;};'use strict';var Sequelize=require(_0xcd9e('0x0'));module['exports']={'name':{'type':Sequelize[_0xcd9e('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xcd9e('0x1')]},'ecm':{'type':Sequelize[_0xcd9e('0x2')](_0xcd9e('0x3'),'no'),'defaultValue':_0xcd9e('0x3')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0xcd9e('0x4')},'localstationid':{'type':Sequelize[_0xcd9e('0x1')],'unique':_0xcd9e('0x5')},'minrate':{'type':Sequelize[_0xcd9e('0x2')](_0xcd9e('0x6'),'4800',_0xcd9e('0x7'),_0xcd9e('0x8'),_0xcd9e('0x9'),_0xcd9e('0xa')),'defaultValue':_0xcd9e('0xb')},'maxrate':{'type':Sequelize[_0xcd9e('0x2')](_0xcd9e('0x6'),'4800',_0xcd9e('0x7'),_0xcd9e('0x8'),_0xcd9e('0x9'),_0xcd9e('0xa')),'defaultValue':_0xcd9e('0xa')},'modem':{'type':Sequelize[_0xcd9e('0x1')],'defaultValue':_0xcd9e('0xc')},'gateway':{'type':Sequelize[_0xcd9e('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xcd9e('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xcd9e('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0xcd9e('0xe'),'IAX','DADHI',_0xcd9e('0xf')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0xcd9e('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xcd9e('0x10')],'defaultValue':function(){return _0xcd9e('0x11');}},'notificationSound':{'type':Sequelize[_0xcd9e('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xcd9e('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xcd9e('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xcd9e('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xcd9e('0x13')},'mandatoryDisposition':{'type':Sequelize[_0xcd9e('0x12')],'defaultValue':![],'comment':_0xcd9e('0x14'),'set':function(_0x2f5c92){if(!_0x2f5c92)this[_0xcd9e('0x15')](_0xcd9e('0x16'),null);this[_0xcd9e('0x15')](_0xcd9e('0x17'),_0x2f5c92);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 4b57dcc..e0c3277 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 _0xfffd=['Contacts','DESC','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','from','fax','List','List\x20not\x20found','Send\x20Fax\x20failed','filename','Contact\x20not\x20found','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','spread','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','User','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','status','json','count','set','Content-Range','apply','reject','save','update','get','FaxAccounts','UserProfileResource','destroy','end','sendStatus','stack','name','send','index','FaxAccount','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','offset','order','sort','where','pick','filter','merge','map','key','VIRTUAL','field','includeAll','include','findAll','rows','show','params','Pause','mandatoryDispositionPause','options','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','FaxAccountId','Disposition','getDispositions','findOne','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','FaxInteraction','addInteraction','omit','getInteractions','CmContact','Contact','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','bulkCreate','FaxApplication','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','localstationid','type','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','headerinfo','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','VoiceExtension','updateAccountApplications','tech','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList'];(function(_0x3f3913,_0x4b43e1){var _0x16dea4=function(_0xaa6b41){while(--_0xaa6b41){_0x3f3913['push'](_0x3f3913['shift']());}};_0x16dea4(++_0x4b43e1);}(_0xfffd,0xea));var _0xdfff=function(_0x1d9df5,_0x474bf2){_0x1d9df5=_0x1d9df5-0x0;var _0x41419c=_0xfffd[_0x1d9df5];return _0x41419c;};'use strict';var pdf=require(_0xdfff('0x0'));var emlformat=require(_0xdfff('0x1'));var rimraf=require(_0xdfff('0x2'));var zipdir=require(_0xdfff('0x3'));var jsonpatch=require(_0xdfff('0x4'));var rp=require(_0xdfff('0x5'));var moment=require(_0xdfff('0x6'));var BPromise=require(_0xdfff('0x7'));var Mustache=require(_0xdfff('0x8'));var util=require(_0xdfff('0x9'));var path=require(_0xdfff('0xa'));var sox=require(_0xdfff('0xb'));var csv=require(_0xdfff('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xdfff('0xd'));var squel=require('squel');var crypto=require(_0xdfff('0xe'));var jsforce=require(_0xdfff('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdfff('0x10'));var Papa=require(_0xdfff('0x11'));var Redis=require(_0xdfff('0x12'));var authService=require(_0xdfff('0x13'));var qs=require(_0xdfff('0x14'));var hardwareService=require(_0xdfff('0x15'));var logger=require(_0xdfff('0x16'))(_0xdfff('0x17'));var utils=require('../../config/utils');var config=require(_0xdfff('0x18'));var db=require(_0xdfff('0x19'))['db'];config[_0xdfff('0x1a')]=_[_0xdfff('0x1b')](config[_0xdfff('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xdfff('0x1c'))(new Redis(config[_0xdfff('0x1a')]));require(_0xdfff('0x1d'))[_0xdfff('0x1e')](socket);var jayson=require(_0xdfff('0x1f'));var client=jayson[_0xdfff('0x20')][_0xdfff('0x21')]({'port':0x232c});var client9002=jayson[_0xdfff('0x20')][_0xdfff('0x21')]({'port':0x232a});function checkPasswordPattern(_0x28b2ef,_0x4970ed,_0x1a6309){if(_0x1a6309){var _0x143d72=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x143d72[_0xdfff('0x22')](_0x4970ed)){return _0x28b2ef;}else{throw new Error(_0xdfff('0x23'));}}else{return _0x28b2ef;}}function respondWithRpcPromise(_0x4f91b6,_0x39dc36,_0xbcbca9,_0x391c49){return new BPromise(function(_0x508aea,_0x27724e){var _0x520ac0=_0x391c49||client;return _0x520ac0[_0xdfff('0x24')](_0x4f91b6,_0xbcbca9)[_0xdfff('0x25')](function(_0x4e224e){logger[_0xdfff('0x26')](_0xdfff('0x27'),_0x39dc36,_0xdfff('0x28'));logger[_0xdfff('0x29')](_0xdfff('0x2a'),_0x39dc36,_0xdfff('0x28'),JSON[_0xdfff('0x2b')](_0x4e224e));if(_0x4e224e['error']){if(_0x4e224e['error'][_0xdfff('0x2c')]===0x1f4){logger[_0xdfff('0x2d')](_0xdfff('0x27'),_0x39dc36,_0x4e224e[_0xdfff('0x2d')][_0xdfff('0x2e')]);return _0x27724e(_0x4e224e[_0xdfff('0x2d')]['message']);}logger[_0xdfff('0x2d')](_0xdfff('0x27'),_0x39dc36,_0x4e224e[_0xdfff('0x2d')]['message']);return _0x508aea(_0x4e224e[_0xdfff('0x2d')][_0xdfff('0x2e')]);}else{logger['info'](_0xdfff('0x27'),_0x39dc36,_0xdfff('0x28'));_0x508aea(_0x4e224e[_0xdfff('0x2f')]['message']);}})[_0xdfff('0x30')](function(_0x402fc2){logger['error'](_0xdfff('0x27'),_0x39dc36,_0x402fc2);_0x27724e(_0x402fc2);});});}function respondWithStatusCode(_0x1bee60,_0x55b1f0){_0x55b1f0=_0x55b1f0||0xcc;return function(_0x3bc036){if(_0x3bc036){return _0x1bee60['sendStatus'](_0x55b1f0);}return _0x1bee60['status'](_0x55b1f0)['end']();};}function respondWithResult(_0x3eadc0,_0x3088e8){_0x3088e8=_0x3088e8||0xc8;return function(_0x56b190){if(_0x56b190){return _0x3eadc0[_0xdfff('0x31')](_0x3088e8)[_0xdfff('0x32')](_0x56b190);}};}function respondWithFilteredResult(_0x1a66e7,_0x23afd0){return function(_0x2100a7){if(_0x2100a7){var _0x2a3346=_0x2100a7[_0xdfff('0x33')],_0x144924=_0x23afd0['offset'],_0x533d62=_0x23afd0['offset']+_0x23afd0['limit'],_0x280d92;if(_0x533d62>=_0x2a3346){_0x533d62=_0x2a3346;_0x280d92=0xc8;}else{_0x280d92=0xce;}_0x1a66e7[_0xdfff('0x31')](_0x280d92);return _0x1a66e7[_0xdfff('0x34')](_0xdfff('0x35'),_0x144924+'-'+_0x533d62+'/'+_0x2a3346)[_0xdfff('0x32')](_0x2100a7);}return null;};}function patchUpdates(_0x1041b7){return function(_0x3d2bc2){try{jsonpatch[_0xdfff('0x36')](_0x3d2bc2,_0x1041b7,!![]);}catch(_0x42eaac){return BPromise[_0xdfff('0x37')](_0x42eaac);}return _0x3d2bc2[_0xdfff('0x38')]();};}function saveUpdates(_0x519cf2,_0x1742f5){return function(_0x4afea5){if(_0x4afea5){return _0x4afea5[_0xdfff('0x39')](_0x519cf2)[_0xdfff('0x25')](function(_0x140b50){return _0x140b50;});}return null;};}function removeEntity(_0x3aa5f3,_0x40fc59){return function(_0x39521d){if(_0x39521d){return _0x39521d['destroy']()[_0xdfff('0x25')](function(){var _0x35ad51=_0x39521d[_0xdfff('0x3a')]({'plain':!![]});var _0x22c50a=_0xdfff('0x3b');return db[_0xdfff('0x3c')][_0xdfff('0x3d')]({'where':{'type':_0x22c50a,'resourceId':_0x35ad51['id']}})['then'](function(){return _0x39521d;});})[_0xdfff('0x25')](function(){_0x3aa5f3['status'](0xcc)[_0xdfff('0x3e')]();});}};}function handleEntityNotFound(_0x417168,_0x2d3c20){return function(_0x287465){if(!_0x287465){_0x417168[_0xdfff('0x3f')](0x194);}return _0x287465;};}function handleError(_0x416590,_0x1dc1ed){_0x1dc1ed=_0x1dc1ed||0x1f4;return function(_0x4b53a){logger[_0xdfff('0x2d')](_0x4b53a[_0xdfff('0x40')]);if(_0x4b53a['name']){delete _0x4b53a[_0xdfff('0x41')];}_0x416590[_0xdfff('0x31')](_0x1dc1ed)[_0xdfff('0x42')](_0x4b53a);};}exports[_0xdfff('0x43')]=function(_0x32fa1a,_0xccd00a){var _0xd7e51e={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x3c2d55={},_0x2674a3={'count':0x0,'rows':[]};var _0xc16531=db[_0xdfff('0x44')][_0xdfff('0x45')];_0x3c2d55[_0xdfff('0x46')]=_['keys'](_0xc16531);_0x3c2d55[_0xdfff('0x47')]=_[_0xdfff('0x48')](_0x32fa1a[_0xdfff('0x47')]);_0x3c2d55[_0xdfff('0x49')]=_[_0xdfff('0x4a')](_0x3c2d55[_0xdfff('0x46')],_0x3c2d55[_0xdfff('0x47')]);_0xd7e51e['attributes']=_[_0xdfff('0x4a')](_0x3c2d55[_0xdfff('0x46')],qs['fields'](_0x32fa1a['query'][_0xdfff('0x4b')]));_0xd7e51e['attributes']=_0xd7e51e[_0xdfff('0x4c')][_0xdfff('0x4d')]?_0xd7e51e[_0xdfff('0x4c')]:_0x3c2d55[_0xdfff('0x46')];if(!_0x32fa1a[_0xdfff('0x47')][_0xdfff('0x4e')]('nolimit')){_0xd7e51e[_0xdfff('0x4f')]=qs[_0xdfff('0x4f')](_0x32fa1a['query']['limit']);_0xd7e51e[_0xdfff('0x50')]=qs['offset'](_0x32fa1a[_0xdfff('0x47')]['offset']);}_0xd7e51e[_0xdfff('0x51')]=qs[_0xdfff('0x52')](_0x32fa1a[_0xdfff('0x47')]['sort']);_0xd7e51e[_0xdfff('0x53')]=qs[_0xdfff('0x49')](_[_0xdfff('0x54')](_0x32fa1a[_0xdfff('0x47')],_0x3c2d55['filters']));if(_0x32fa1a[_0xdfff('0x47')][_0xdfff('0x55')]){_0xd7e51e[_0xdfff('0x53')]=_[_0xdfff('0x56')](_0xd7e51e[_0xdfff('0x53')],{'$or':_[_0xdfff('0x57')](_0xc16531,function(_0x24e5cf){if(_0x24e5cf['type'][_0xdfff('0x58')]!==_0xdfff('0x59')){var _0x42e7d0={};_0x42e7d0[_0x24e5cf[_0xdfff('0x5a')]]={'$like':'%'+_0x32fa1a['query'][_0xdfff('0x55')]+'%'};return _0x42e7d0;}})});}_0xd7e51e=_['merge']({},_0xd7e51e,_0x32fa1a['options']);var _0x1fbe6f={'where':_0xd7e51e[_0xdfff('0x53')]};return db[_0xdfff('0x44')][_0xdfff('0x33')](_0x1fbe6f)[_0xdfff('0x25')](function(_0x493da6){_0x2674a3[_0xdfff('0x33')]=_0x493da6;if(_0x32fa1a[_0xdfff('0x47')][_0xdfff('0x5b')]){_0xd7e51e[_0xdfff('0x5c')]=[{'all':!![]}];}return db['FaxAccount'][_0xdfff('0x5d')](_0xd7e51e);})[_0xdfff('0x25')](function(_0x197114){_0x2674a3[_0xdfff('0x5e')]=_0x197114;return _0x2674a3;})[_0xdfff('0x25')](respondWithFilteredResult(_0xccd00a,_0xd7e51e))[_0xdfff('0x30')](handleError(_0xccd00a,null));};exports[_0xdfff('0x5f')]=function(_0x13d1b9,_0x5e59bf){var _0x1e126f={'raw':![],'where':{'id':_0x13d1b9[_0xdfff('0x60')]['id']},'include':[{'model':db[_0xdfff('0x61')],'as':_0xdfff('0x62')}]},_0x23386b={};_0x23386b['model']=_[_0xdfff('0x48')](db[_0xdfff('0x44')][_0xdfff('0x45')]);_0x23386b['query']=_[_0xdfff('0x48')](_0x13d1b9[_0xdfff('0x47')]);_0x23386b[_0xdfff('0x49')]=_[_0xdfff('0x4a')](_0x23386b['model'],_0x23386b[_0xdfff('0x47')]);_0x1e126f[_0xdfff('0x4c')]=_['intersection'](_0x23386b['model'],qs[_0xdfff('0x4b')](_0x13d1b9[_0xdfff('0x47')]['fields']));_0x1e126f['attributes']=_0x1e126f[_0xdfff('0x4c')][_0xdfff('0x4d')]?_0x1e126f['attributes']:_0x23386b[_0xdfff('0x46')];if(_0x13d1b9['query'][_0xdfff('0x5b')]){_0x1e126f['include']=[{'all':!![]}];}_0x1e126f=_[_0xdfff('0x56')]({},_0x1e126f,_0x13d1b9[_0xdfff('0x63')]);return db[_0xdfff('0x44')][_0xdfff('0x64')](_0x1e126f)['then'](handleEntityNotFound(_0x5e59bf,null))[_0xdfff('0x25')](respondWithResult(_0x5e59bf,null))[_0xdfff('0x30')](handleError(_0x5e59bf,null));};exports['create']=function(_0x43656b,_0x44cdd4){return db[_0xdfff('0x44')][_0xdfff('0x65')](_0x43656b[_0xdfff('0x66')],{})[_0xdfff('0x25')](function(_0x4f00de){var _0x361c8a=_0x43656b[_0xdfff('0x67')]['get']({'plain':!![]});if(!_0x361c8a)throw new Error(_0xdfff('0x68'));if(_0x361c8a[_0xdfff('0x69')]==='user'){var _0x556426=_0x4f00de['get']({'plain':!![]});var _0x99a3ce=_0xdfff('0x3b');return db[_0xdfff('0x6a')][_0xdfff('0x64')]({'where':{'name':_0x99a3ce,'userProfileId':_0x361c8a[_0xdfff('0x6b')]},'raw':!![]})['then'](function(_0x5c2399){if(_0x5c2399&&_0x5c2399[_0xdfff('0x6c')]===0x0){return db['UserProfileResource']['create']({'name':_0x556426[_0xdfff('0x41')],'resourceId':_0x556426['id'],'type':_0x5c2399['name'],'sectionId':_0x5c2399['id']},{})[_0xdfff('0x25')](function(){return _0x4f00de;});}else{return _0x4f00de;}})[_0xdfff('0x30')](function(_0x83fd2){logger['error'](_0xdfff('0x6d'),_0x83fd2);throw _0x83fd2;});}return _0x4f00de;})['then'](respondWithResult(_0x44cdd4,0xc9))[_0xdfff('0x30')](handleError(_0x44cdd4,null));};exports['update']=function(_0x34c844,_0x465eff){if(_0x34c844[_0xdfff('0x66')]['id']){delete _0x34c844['body']['id'];}return db['FaxAccount'][_0xdfff('0x64')]({'where':{'id':_0x34c844[_0xdfff('0x60')]['id']},'include':[{'model':db[_0xdfff('0x61')],'as':_0xdfff('0x62')}]})[_0xdfff('0x25')](handleEntityNotFound(_0x465eff,null))[_0xdfff('0x25')](saveUpdates(_0x34c844[_0xdfff('0x66')],null))[_0xdfff('0x25')](respondWithResult(_0x465eff,null))[_0xdfff('0x30')](handleError(_0x465eff,null));};exports[_0xdfff('0x3d')]=function(_0x50d7c5,_0x18e766){return db['FaxAccount'][_0xdfff('0x64')]({'where':{'id':_0x50d7c5[_0xdfff('0x60')]['id']}})[_0xdfff('0x25')](handleEntityNotFound(_0x18e766,null))['then'](removeEntity(_0x18e766,null))[_0xdfff('0x30')](handleError(_0x18e766,null));};exports[_0xdfff('0x6e')]=function(_0x43d838,_0x6e2e93){return db[_0xdfff('0x44')][_0xdfff('0x6e')]()[_0xdfff('0x25')](respondWithResult(_0x6e2e93,null))[_0xdfff('0x30')](handleError(_0x6e2e93,null));};exports[_0xdfff('0x6f')]=function(_0x7bcca4,_0x2ff670,_0x40de50){if(_0x7bcca4[_0xdfff('0x66')]['id']){delete _0x7bcca4['body']['id'];}return db['FaxAccount']['find']({'where':{'id':_0x7bcca4['params']['id']}})[_0xdfff('0x25')](handleEntityNotFound(_0x2ff670,null))['then'](function(_0x5dc06a){if(_0x5dc06a){_0x7bcca4['body'][_0xdfff('0x70')]=_0x5dc06a['id'];return db[_0xdfff('0x71')][_0xdfff('0x65')](_0x7bcca4[_0xdfff('0x66')]);}})[_0xdfff('0x25')](respondWithResult(_0x2ff670,null))['catch'](handleError(_0x2ff670,null));};exports[_0xdfff('0x72')]=function(_0x18ceee,_0x3032f9,_0x20fd25){var _0x1dce3f={'raw':![],'where':{}};var _0x2c38da={};var _0x5f2ba3={'count':0x0,'rows':[]};return db['FaxAccount'][_0xdfff('0x73')]({'where':{'id':_0x18ceee[_0xdfff('0x60')]['id']}})['then'](handleEntityNotFound(_0x3032f9,null))['then'](function(_0x42a7dc){if(_0x42a7dc){_0x2c38da[_0xdfff('0x46')]=_[_0xdfff('0x48')](db[_0xdfff('0x71')]['rawAttributes']);_0x2c38da[_0xdfff('0x47')]=_[_0xdfff('0x48')](_0x18ceee[_0xdfff('0x47')]);_0x2c38da['filters']=_[_0xdfff('0x4a')](_0x2c38da[_0xdfff('0x46')],_0x2c38da[_0xdfff('0x47')]);_0x1dce3f[_0xdfff('0x4c')]=_['intersection'](_0x2c38da[_0xdfff('0x46')],qs['fields'](_0x18ceee['query'][_0xdfff('0x4b')]));_0x1dce3f[_0xdfff('0x4c')]=_0x1dce3f['attributes'][_0xdfff('0x4d')]?_0x1dce3f['attributes']:_0x2c38da[_0xdfff('0x46')];if(!_0x18ceee[_0xdfff('0x47')]['hasOwnProperty'](_0xdfff('0x74'))){_0x1dce3f[_0xdfff('0x4f')]=qs[_0xdfff('0x4f')](_0x18ceee[_0xdfff('0x47')][_0xdfff('0x4f')]);_0x1dce3f[_0xdfff('0x50')]=qs[_0xdfff('0x50')](_0x18ceee[_0xdfff('0x47')][_0xdfff('0x50')]);}_0x1dce3f[_0xdfff('0x51')]=qs[_0xdfff('0x52')](_0x18ceee['query']['sort']);_0x1dce3f[_0xdfff('0x53')]=qs[_0xdfff('0x49')](_[_0xdfff('0x54')](_0x18ceee[_0xdfff('0x47')],_0x2c38da[_0xdfff('0x49')]));_0x1dce3f[_0xdfff('0x53')][_0xdfff('0x70')]=_0x42a7dc['id'];if(_0x18ceee[_0xdfff('0x47')][_0xdfff('0x55')]){_0x1dce3f[_0xdfff('0x53')]=_[_0xdfff('0x56')](_0x1dce3f[_0xdfff('0x53')],{'$or':_['map'](_0x1dce3f[_0xdfff('0x4c')],function(_0x4728ee){var _0x643974={};_0x643974[_0x4728ee]={'$like':'%'+_0x18ceee[_0xdfff('0x47')][_0xdfff('0x55')]+'%'};return _0x643974;})});}_0x1dce3f=_[_0xdfff('0x56')]({},_0x1dce3f,_0x18ceee[_0xdfff('0x63')]);return db[_0xdfff('0x71')][_0xdfff('0x33')]({'where':_0x1dce3f[_0xdfff('0x53')]})[_0xdfff('0x25')](function(_0x181c56){_0x5f2ba3[_0xdfff('0x33')]=_0x181c56;if(_0x18ceee[_0xdfff('0x47')]['includeAll']){_0x1dce3f[_0xdfff('0x5c')]=[{'all':!![]}];}return db[_0xdfff('0x71')][_0xdfff('0x5d')](_0x1dce3f);})['then'](function(_0x319af1){_0x5f2ba3['rows']=_0x319af1;return _0x5f2ba3;});}})['then'](respondWithFilteredResult(_0x3032f9,_0x1dce3f))['catch'](handleError(_0x3032f9,null));};exports['removeDispositions']=function(_0x3a4ddc,_0x46bf71,_0x29e5c6){return db[_0xdfff('0x44')]['find']({'where':{'id':_0x3a4ddc['params']['id']}})[_0xdfff('0x25')](handleEntityNotFound(_0x46bf71,null))[_0xdfff('0x25')](function(_0x1ea784){if(_0x1ea784){return _0x1ea784[_0xdfff('0x75')](_0x3a4ddc[_0xdfff('0x47')][_0xdfff('0x76')]);}})[_0xdfff('0x25')](respondWithStatusCode(_0x46bf71,null))[_0xdfff('0x30')](handleError(_0x46bf71,null));};exports[_0xdfff('0x77')]=function(_0x4e8867,_0xc63f26,_0xf9a124){if(_0x4e8867[_0xdfff('0x66')]['id']){delete _0x4e8867[_0xdfff('0x66')]['id'];}return db[_0xdfff('0x44')][_0xdfff('0x64')]({'where':{'id':_0x4e8867[_0xdfff('0x60')]['id']}})['then'](handleEntityNotFound(_0xc63f26,null))['then'](function(_0xff62b4){if(_0xff62b4){_0x4e8867[_0xdfff('0x66')][_0xdfff('0x70')]=_0xff62b4['id'];return db[_0xdfff('0x78')]['create'](_0x4e8867[_0xdfff('0x66')]);}})[_0xdfff('0x25')](respondWithResult(_0xc63f26,null))['catch'](handleError(_0xc63f26,null));};exports['getAnswers']=function(_0x47439e,_0x3c2eab,_0x263fcd){var _0x42c462={'raw':![],'where':{}};var _0x54ab0f={};var _0x20cbb4={'count':0x0,'rows':[]};return db[_0xdfff('0x44')]['findOne']({'where':{'id':_0x47439e[_0xdfff('0x60')]['id']}})[_0xdfff('0x25')](handleEntityNotFound(_0x3c2eab,null))['then'](function(_0x59bb45){if(_0x59bb45){_0x54ab0f[_0xdfff('0x46')]=_[_0xdfff('0x48')](db['CannedAnswer'][_0xdfff('0x45')]);_0x54ab0f[_0xdfff('0x47')]=_['keys'](_0x47439e[_0xdfff('0x47')]);_0x54ab0f[_0xdfff('0x49')]=_['intersection'](_0x54ab0f['model'],_0x54ab0f['query']);_0x42c462['attributes']=_[_0xdfff('0x4a')](_0x54ab0f[_0xdfff('0x46')],qs[_0xdfff('0x4b')](_0x47439e['query'][_0xdfff('0x4b')]));_0x42c462[_0xdfff('0x4c')]=_0x42c462[_0xdfff('0x4c')][_0xdfff('0x4d')]?_0x42c462[_0xdfff('0x4c')]:_0x54ab0f['model'];if(!_0x47439e[_0xdfff('0x47')]['hasOwnProperty'](_0xdfff('0x74'))){_0x42c462[_0xdfff('0x4f')]=qs['limit'](_0x47439e[_0xdfff('0x47')][_0xdfff('0x4f')]);_0x42c462[_0xdfff('0x50')]=qs[_0xdfff('0x50')](_0x47439e[_0xdfff('0x47')][_0xdfff('0x50')]);}_0x42c462[_0xdfff('0x51')]=qs[_0xdfff('0x52')](_0x47439e[_0xdfff('0x47')][_0xdfff('0x52')]);_0x42c462[_0xdfff('0x53')]=qs[_0xdfff('0x49')](_[_0xdfff('0x54')](_0x47439e['query'],_0x54ab0f['filters']));_0x42c462[_0xdfff('0x53')][_0xdfff('0x70')]=_0x59bb45['id'];if(_0x47439e[_0xdfff('0x47')]['filter']){_0x42c462[_0xdfff('0x53')]=_['merge'](_0x42c462[_0xdfff('0x53')],{'$or':_[_0xdfff('0x57')](_0x42c462[_0xdfff('0x4c')],function(_0x51808c){var _0x44cfd4={};_0x44cfd4[_0x51808c]={'$like':'%'+_0x47439e[_0xdfff('0x47')][_0xdfff('0x55')]+'%'};return _0x44cfd4;})});}_0x42c462=_[_0xdfff('0x56')]({},_0x42c462,_0x47439e[_0xdfff('0x63')]);return db['CannedAnswer'][_0xdfff('0x33')]({'where':_0x42c462[_0xdfff('0x53')]})[_0xdfff('0x25')](function(_0x57f120){_0x20cbb4['count']=_0x57f120;if(_0x47439e[_0xdfff('0x47')][_0xdfff('0x5b')]){_0x42c462['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xdfff('0x5d')](_0x42c462);})[_0xdfff('0x25')](function(_0x3c584f){_0x20cbb4[_0xdfff('0x5e')]=_0x3c584f;return _0x20cbb4;});}})['then'](respondWithFilteredResult(_0x3c2eab,_0x42c462))[_0xdfff('0x30')](handleError(_0x3c2eab,null));};exports['removeAnswers']=function(_0xaff118,_0x58fa5a,_0x5bd1ad){return db[_0xdfff('0x44')][_0xdfff('0x64')]({'where':{'id':_0xaff118['params']['id']}})[_0xdfff('0x25')](handleEntityNotFound(_0x58fa5a,null))[_0xdfff('0x25')](function(_0x1db869){if(_0x1db869){return _0x1db869[_0xdfff('0x79')](_0xaff118[_0xdfff('0x47')][_0xdfff('0x76')]);}})['then'](respondWithStatusCode(_0x58fa5a,null))[_0xdfff('0x30')](handleError(_0x58fa5a,null));};exports['addInteraction']=function(_0x145d3c,_0x4fd408,_0x41a165){return db[_0xdfff('0x7a')]['find']({'where':{'id':_0x145d3c['params']['id']}})[_0xdfff('0x25')](handleEntityNotFound(_0x4fd408,null))['then'](function(_0x1fad20){if(_0x1fad20){return _0x1fad20[_0xdfff('0x7b')](_0x145d3c[_0xdfff('0x66')][_0xdfff('0x76')],_[_0xdfff('0x7c')](_0x145d3c[_0xdfff('0x66')],['ids','id'])||{});}})[_0xdfff('0x25')](respondWithResult(_0x4fd408,null))[_0xdfff('0x30')](handleError(_0x4fd408,null));};exports[_0xdfff('0x7d')]=function(_0x5b89ab,_0x532477,_0x3bbfb6){var _0xebf230={'raw':![],'where':{}};var _0x83a74b={};var _0x8be449={'count':0x0,'rows':[]};return db[_0xdfff('0x44')]['findOne']({'where':{'id':_0x5b89ab[_0xdfff('0x60')]['id']}})[_0xdfff('0x25')](handleEntityNotFound(_0x532477,null))[_0xdfff('0x25')](function(_0x10230a){if(_0x10230a){_0x83a74b[_0xdfff('0x46')]=_[_0xdfff('0x48')](db['FaxInteraction'][_0xdfff('0x45')]);_0x83a74b[_0xdfff('0x47')]=_[_0xdfff('0x48')](_0x5b89ab['query']);_0x83a74b['filters']=_['intersection'](_0x83a74b[_0xdfff('0x46')],_0x83a74b[_0xdfff('0x47')]);_0xebf230[_0xdfff('0x4c')]=_[_0xdfff('0x4a')](_0x83a74b[_0xdfff('0x46')],qs[_0xdfff('0x4b')](_0x5b89ab[_0xdfff('0x47')][_0xdfff('0x4b')]));_0xebf230[_0xdfff('0x4c')]=_0xebf230[_0xdfff('0x4c')][_0xdfff('0x4d')]?_0xebf230[_0xdfff('0x4c')]:_0x83a74b['model'];if(!_0x5b89ab[_0xdfff('0x47')][_0xdfff('0x4e')](_0xdfff('0x74'))){_0xebf230[_0xdfff('0x4f')]=qs[_0xdfff('0x4f')](_0x5b89ab['query'][_0xdfff('0x4f')]);_0xebf230[_0xdfff('0x50')]=qs[_0xdfff('0x50')](_0x5b89ab['query'][_0xdfff('0x50')]);}_0xebf230['order']=qs['sort'](_0x5b89ab[_0xdfff('0x47')][_0xdfff('0x52')]);_0xebf230[_0xdfff('0x53')]=qs[_0xdfff('0x49')](_[_0xdfff('0x54')](_0x5b89ab[_0xdfff('0x47')],_0x83a74b[_0xdfff('0x49')]));_0xebf230[_0xdfff('0x53')][_0xdfff('0x70')]=_0x10230a['id'];if(_0x5b89ab[_0xdfff('0x47')]['filter']){_0xebf230[_0xdfff('0x53')]=_[_0xdfff('0x56')](_0xebf230[_0xdfff('0x53')],{'$or':_[_0xdfff('0x57')](_0xebf230[_0xdfff('0x4c')],function(_0xd508d0){var _0x7cd230={};_0x7cd230[_0xd508d0]={'$like':'%'+_0x5b89ab[_0xdfff('0x47')][_0xdfff('0x55')]+'%'};return _0x7cd230;})});}_0xebf230=_['merge']({},_0xebf230,_0x5b89ab[_0xdfff('0x63')]);return db[_0xdfff('0x7a')]['count']({'where':_0xebf230[_0xdfff('0x53')]})[_0xdfff('0x25')](function(_0x5aba89){_0x8be449['count']=_0x5aba89;if(_0x5b89ab[_0xdfff('0x47')][_0xdfff('0x5b')]){_0xebf230[_0xdfff('0x5c')]=[{'model':db[_0xdfff('0x7e')],'as':_0xdfff('0x7f'),'required':![]},{'model':db['User'],'as':_0xdfff('0x80'),'attributes':[_0xdfff('0x41'),_0xdfff('0x81'),_0xdfff('0x82')],'required':![]},{'model':db[_0xdfff('0x83')],'as':_0xdfff('0x84'),'attributes':['id',_0xdfff('0x41'),_0xdfff('0x85')],'where':_0x5b89ab[_0xdfff('0x47')][_0xdfff('0x86')]?{'id':_0x5b89ab[_0xdfff('0x47')]['tag']}:undefined,'required':_0x5b89ab[_0xdfff('0x47')][_0xdfff('0x86')]?!![]:![]}];}return db['FaxInteraction'][_0xdfff('0x5d')](_0xebf230);})['then'](function(_0x136a7a){_0x8be449[_0xdfff('0x5e')]=_0x136a7a;return _0x8be449;});}})['then'](respondWithFilteredResult(_0x532477,_0xebf230))[_0xdfff('0x30')](handleError(_0x532477,null));};exports[_0xdfff('0x87')]=function(_0x29710a,_0x2dd62c,_0x9cfd1c){return db[_0xdfff('0x44')][_0xdfff('0x73')]({'where':{'id':_0x29710a[_0xdfff('0x60')]['id']}})[_0xdfff('0x25')](handleEntityNotFound(_0x2dd62c,null))[_0xdfff('0x25')](function(_0x1df686){if(_0x1df686){return db[_0xdfff('0x88')][_0xdfff('0x89')](function(_0x41b002){return db['FaxApplication'][_0xdfff('0x3d')]({'where':{'FaxAccountId':_0x29710a['params']['id']},'transaction':_0x41b002})[_0xdfff('0x25')](function(_0x231a25){var _0x45aaee=_[_0xdfff('0x57')](_0x29710a[_0xdfff('0x66')],function(_0x358018){_0x358018[_0xdfff('0x70')]=_0x29710a['params']['id'];return _0x358018;});return db['FaxApplication'][_0xdfff('0x8a')](_0x45aaee,{'transaction':_0x41b002});});})[_0xdfff('0x25')](function(){return db[_0xdfff('0x8b')][_0xdfff('0x8c')]({'where':{'FaxAccountId':_0x29710a[_0xdfff('0x60')]['id']},'order':_0xdfff('0x8d')});});}})[_0xdfff('0x25')](respondWithResult(_0x2dd62c,null))[_0xdfff('0x30')](handleError(_0x2dd62c,null));};exports['getApplications']=function(_0x11ab41,_0x1c45a5,_0x22fb59){var _0xfd9352={};var _0x14ab2b={};var _0x387d18;var _0x3612f5;return db['FaxAccount'][_0xdfff('0x73')]({'where':{'id':_0x11ab41[_0xdfff('0x60')]['id']}})[_0xdfff('0x25')](handleEntityNotFound(_0x1c45a5,null))[_0xdfff('0x25')](function(_0x302c98){if(_0x302c98){_0x387d18=_0x302c98;_0x14ab2b[_0xdfff('0x46')]=_['keys'](db[_0xdfff('0x8b')][_0xdfff('0x45')]);_0x14ab2b[_0xdfff('0x47')]=_[_0xdfff('0x48')](_0x11ab41[_0xdfff('0x47')]);_0x14ab2b[_0xdfff('0x49')]=_[_0xdfff('0x4a')](_0x14ab2b['model'],_0x14ab2b['query']);_0xfd9352[_0xdfff('0x4c')]=_['intersection'](_0x14ab2b['model'],qs[_0xdfff('0x4b')](_0x11ab41[_0xdfff('0x47')][_0xdfff('0x4b')]));_0xfd9352[_0xdfff('0x4c')]=_0xfd9352[_0xdfff('0x4c')][_0xdfff('0x4d')]?_0xfd9352[_0xdfff('0x4c')]:_0x14ab2b[_0xdfff('0x46')];_0xfd9352[_0xdfff('0x51')]=qs[_0xdfff('0x52')](_0x11ab41[_0xdfff('0x47')]['sort']);_0xfd9352['where']=qs[_0xdfff('0x49')](_[_0xdfff('0x54')](_0x11ab41[_0xdfff('0x47')],_0x14ab2b[_0xdfff('0x49')]));if(_0x11ab41[_0xdfff('0x47')][_0xdfff('0x55')]){_0xfd9352['where']=_[_0xdfff('0x56')](_0xfd9352[_0xdfff('0x53')],{'$or':_[_0xdfff('0x57')](_0xfd9352[_0xdfff('0x4c')],function(_0x665047){var _0x49a01b={};_0x49a01b[_0x665047]={'$like':'%'+_0x11ab41['query'][_0xdfff('0x55')]+'%'};return _0x49a01b;})});}_0xfd9352=_[_0xdfff('0x56')]({},_0xfd9352,_0x11ab41[_0xdfff('0x63')]);return _0x387d18['getApplications'](_0xfd9352);}})['then'](function(_0xac988){if(_0xac988){_0x3612f5=_0xac988['length'];if(!_0x11ab41[_0xdfff('0x47')][_0xdfff('0x4e')]('nolimit')){_0xfd9352[_0xdfff('0x4f')]=qs[_0xdfff('0x4f')](_0x11ab41[_0xdfff('0x47')][_0xdfff('0x4f')]);_0xfd9352[_0xdfff('0x50')]=qs[_0xdfff('0x50')](_0x11ab41[_0xdfff('0x47')][_0xdfff('0x50')]);}return _0x387d18[_0xdfff('0x8e')](_0xfd9352);}})['then'](function(_0x46c189){if(_0x46c189){return _0x46c189?{'count':_0x3612f5,'rows':_0x46c189}:null;}})[_0xdfff('0x25')](respondWithResult(_0x1c45a5,null))['catch'](handleError(_0x1c45a5,null));};function Extension(_0x4e09ca,_0xb77706,_0xbaec76,_0x16ecd5){this[_0xdfff('0x8f')]=_0xdfff('0x90');this[_0xdfff('0x91')]=_0x4e09ca[_0xdfff('0x92')];this['app']=_0x16ecd5;this[_0xdfff('0x93')]='system';this[_0xdfff('0x94')]=_0xdfff('0x95');this[_0xdfff('0x70')]=_0x4e09ca['id'];this[_0xdfff('0x8d')]=_0xb77706;this[_0xdfff('0x96')]=_0xbaec76;}function createExtensionsReciveFax(_0x5dd79c){var _0x2f3103=0x1;var _0x205ce7=[];_0x205ce7[_0xdfff('0x97')](new Extension(_0x5dd79c,_0x2f3103,'',_0xdfff('0x98')));_0x2f3103+=0x1;_0x205ce7[_0xdfff('0x97')](new Extension(_0x5dd79c,_0x2f3103,_0xdfff('0x99'),_0xdfff('0x9a')));_0x2f3103+=0x1;for(var _0x68e72d in _0x5dd79c){if(_0x5dd79c[_0xdfff('0x4e')](_0x68e72d)&&(_0x68e72d===_0xdfff('0x9b')||_0x68e72d==='localstationid'||_0x68e72d===_0xdfff('0x9c')||_0x68e72d==='faxdetect'||_0x68e72d===_0xdfff('0x9d')||_0x68e72d==='maxrate'||_0x68e72d==='minrate'||_0x68e72d===_0xdfff('0x9e')||_0x68e72d===_0xdfff('0x9f'))){_0x205ce7['push'](new Extension(_0x5dd79c,_0x2f3103,_0xdfff('0xa0')+_0x68e72d+')='+_0x5dd79c[_0x68e72d],'Set'));_0x2f3103+=0x1;}}_0x205ce7[_0xdfff('0x97')](new Extension(_0x5dd79c,_0x2f3103,'6',_0xdfff('0xa1')));_0x2f3103+=0x1;_0x205ce7[_0xdfff('0x97')](new Extension(_0x5dd79c,_0x2f3103,_0xdfff('0xa2'),_0xdfff('0xa3')));_0x2f3103=0x0;return _0x205ce7;}exports['addAccountApplications']=function(_0x59d3d3,_0x15d7dd,_0x58ba2d){var _0x59600d;return db[_0xdfff('0x88')][_0xdfff('0x89')](function(_0x3d56b7){return db[_0xdfff('0x44')][_0xdfff('0x65')](_0x59d3d3[_0xdfff('0x66')],{'transaction':_0x3d56b7})[_0xdfff('0x25')](function(_0x30712f){_0x59600d=_0x30712f[_0xdfff('0x3a')]({'plain':!![]});return db[_0xdfff('0xa4')][_0xdfff('0x8a')](createExtensionsReciveFax(_0x59600d),{'transaction':_0x3d56b7});});})[_0xdfff('0x25')](function(){return _0x59600d;})[_0xdfff('0x25')](respondWithResult(_0x15d7dd,null))[_0xdfff('0x30')](handleError(_0x15d7dd,null));};exports[_0xdfff('0xa5')]=function(_0x29f94f,_0x197e1f,_0x1ba418){var _0x5a2d09;return db[_0xdfff('0x88')][_0xdfff('0x89')](function(_0x14ddd2){return db[_0xdfff('0x44')][_0xdfff('0x39')](_0x29f94f[_0xdfff('0x66')],{'where':{'id':_0x29f94f[_0xdfff('0x66')]['id']},'transaction':_0x14ddd2})[_0xdfff('0x25')](function(_0x2f3969){return db['VoiceExtension'][_0xdfff('0x3d')]({'where':{'FaxAccountId':_0x29f94f[_0xdfff('0x66')]['id']},'transaction':_0x14ddd2})[_0xdfff('0x25')](function(_0x420ced){return db[_0xdfff('0xa4')][_0xdfff('0x8a')](createExtensionsReciveFax(_[_0xdfff('0x7c')](_0x29f94f[_0xdfff('0x66')],[_0xdfff('0xa6'),'key',_0xdfff('0xa7'),_0xdfff('0xa8'),_0xdfff('0xa9'),_0xdfff('0xaa')])),{'transaction':_0x14ddd2});});});})[_0xdfff('0x25')](function(){return db['FaxAccount'][_0xdfff('0xab')](_0x29f94f['body']['id']);})[_0xdfff('0x25')](respondWithResult(_0x197e1f,null))[_0xdfff('0x30')](handleError(_0x197e1f,null));};exports[_0xdfff('0xac')]=function(_0x1c3aef,_0x5d13cc,_0x1f3871){var _0x3b5ce6={'raw':!![],'where':{}};var _0x363fed={};var _0x557305={'count':0x0,'rows':[]};return db[_0xdfff('0x44')]['findOne']({'where':{'id':_0x1c3aef[_0xdfff('0x60')]['id']}})[_0xdfff('0x25')](handleEntityNotFound(_0x5d13cc,null))[_0xdfff('0x25')](function(_0x5e4606){if(_0x5e4606){_0x363fed[_0xdfff('0x46')]=_[_0xdfff('0x48')](db[_0xdfff('0xad')]['rawAttributes']);_0x363fed[_0xdfff('0x47')]=_[_0xdfff('0x48')](_0x1c3aef[_0xdfff('0x47')]);_0x363fed[_0xdfff('0x49')]=_[_0xdfff('0x4a')](_0x363fed['model'],_0x363fed[_0xdfff('0x47')]);_0x3b5ce6['attributes']=_[_0xdfff('0x4a')](_0x363fed[_0xdfff('0x46')],qs[_0xdfff('0x4b')](_0x1c3aef[_0xdfff('0x47')][_0xdfff('0x4b')]));_0x3b5ce6[_0xdfff('0x4c')]=_0x3b5ce6['attributes'][_0xdfff('0x4d')]?_0x3b5ce6[_0xdfff('0x4c')]:_0x363fed[_0xdfff('0x46')];if(!_0x1c3aef[_0xdfff('0x47')][_0xdfff('0x4e')](_0xdfff('0x74'))){_0x3b5ce6['limit']=qs['limit'](_0x1c3aef['query'][_0xdfff('0x4f')]);_0x3b5ce6[_0xdfff('0x50')]=qs[_0xdfff('0x50')](_0x1c3aef['query'][_0xdfff('0x50')]);}_0x3b5ce6[_0xdfff('0x51')]=qs[_0xdfff('0x52')](_0x1c3aef[_0xdfff('0x47')][_0xdfff('0x52')]);_0x3b5ce6[_0xdfff('0x53')]=qs['filters'](_['pick'](_0x1c3aef[_0xdfff('0x47')],_0x363fed['filters']));_0x3b5ce6['where'][_0xdfff('0x70')]=_0x5e4606['id'];if(_0x1c3aef['query'][_0xdfff('0x55')]){_0x3b5ce6[_0xdfff('0x53')]=_[_0xdfff('0x56')](_0x3b5ce6['where'],{'$or':_[_0xdfff('0x57')](_0x3b5ce6[_0xdfff('0x4c')],function(_0x4a0b95){var _0x301bd6={};_0x301bd6[_0x4a0b95]={'$like':'%'+_0x1c3aef['query'][_0xdfff('0x55')]+'%'};return _0x301bd6;})});}if(_0x1c3aef[_0xdfff('0x47')]['$gte']){var _0x46b135=_0x1c3aef[_0xdfff('0x47')]['$gte'][_0xdfff('0xae')](',');var _0x17a614={};_0x17a614[_0x46b135[0x0]]={'$gte':moment(_0x46b135[0x1])[_0xdfff('0xaf')](_0xdfff('0xb0'))};_0x3b5ce6[_0xdfff('0x53')]=_[_0xdfff('0x56')](_0x3b5ce6['where'],_0x17a614);}_0x3b5ce6=_[_0xdfff('0x56')]({},_0x3b5ce6,_0x1c3aef[_0xdfff('0x63')]);return db[_0xdfff('0xad')][_0xdfff('0x33')]({'where':_0x3b5ce6['where']})[_0xdfff('0x25')](function(_0x1f6dc1){_0x557305['count']=_0x1f6dc1;if(_0x1c3aef[_0xdfff('0x47')][_0xdfff('0x5b')]){_0x3b5ce6[_0xdfff('0x5c')]=[{'all':!![]}];}return db[_0xdfff('0xad')][_0xdfff('0x5d')](_0x3b5ce6);})[_0xdfff('0x25')](function(_0x583322){_0x557305['rows']=_0x583322;return _0x557305;});}})[_0xdfff('0x25')](respondWithFilteredResult(_0x5d13cc,_0x3b5ce6))[_0xdfff('0x30')](handleError(_0x5d13cc,null));};exports[_0xdfff('0x42')]=function(_0x1e94ee,_0x2b8254,_0x8ea0bf){var _0x5bd6ca,_0x43b413={},_0x3a2f0d;if(_0x1e94ee[_0xdfff('0x66')]['to']){_0x3a2f0d=_0x1e94ee[_0xdfff('0x66')]['to'][0x0];}return db[_0xdfff('0x44')][_0xdfff('0x64')]({'where':{'id':_0x1e94ee['params']['id']},'include':[{'model':db[_0xdfff('0xb1')],'as':'List','include':[{'model':db[_0xdfff('0x7e')],'as':_0xdfff('0xb2'),'where':{'fax':_0x3a2f0d},'limit':0x1,'order':[['updatedAt',_0xdfff('0xb3')]]}]}]})[_0xdfff('0x25')](handleEntityNotFound(_0x2b8254,null))[_0xdfff('0x25')](function(_0x244e52){_0x5bd6ca=_0x244e52;if(_0x1e94ee[_0xdfff('0x66')][_0xdfff('0xb4')]&&_0x1e94ee[_0xdfff('0x66')][_0xdfff('0xb4')][_0xdfff('0x4d')]){for(var _0x500580=0x0;_0x500580<_0x1e94ee[_0xdfff('0x66')]['attachments'][_0xdfff('0x4d')];_0x500580+=0x1){_0x1e94ee[_0xdfff('0x66')][_0xdfff('0xb4')][_0x500580]={'filename':_0x1e94ee[_0xdfff('0x66')][_0xdfff('0xb4')][_0x500580]['name'],'id':_0x1e94ee[_0xdfff('0x66')]['attachments'][_0x500580]['id'],'path':path[_0xdfff('0xb5')](config['root'],_0xdfff('0xb6'),_0x1e94ee[_0xdfff('0x66')][_0xdfff('0xb4')][_0x500580][_0xdfff('0xb7')])};}}return respondWithRpcPromise(_0xdfff('0xb8'),_0xdfff('0xb8'),{'FaxAccountId':_[_0xdfff('0xb9')](_0x1e94ee[_0xdfff('0x60')]['id'])?undefined:_0x1e94ee[_0xdfff('0x60')]['id'],'path':_['isNil'](_0x1e94ee['body'][_0xdfff('0xb4')][0x0][_0xdfff('0xa')])?undefined:_0x1e94ee[_0xdfff('0x66')][_0xdfff('0xb4')][0x0][_0xdfff('0xa')],'fax':_['isNil'](_0x1e94ee[_0xdfff('0x66')]['to'][0x0])?undefined:_0x1e94ee['body']['to'][0x0]},client9002);})[_0xdfff('0x25')](function(){if(_0x5bd6ca){if(_[_0xdfff('0xb9')](_0x1e94ee['body'][_0xdfff('0xba')])){_0x1e94ee[_0xdfff('0x66')][_0xdfff('0xba')]=util[_0xdfff('0xaf')]('\x22%s\x22\x20<%s>',_0x5bd6ca[_0xdfff('0x41')],_0x5bd6ca[_0xdfff('0xbb')]);}if(_0x5bd6ca['List']){if(_0x5bd6ca[_0xdfff('0xbc')][_0xdfff('0xb2')]['length']){return _0x5bd6ca[_0xdfff('0xbc')][_0xdfff('0xb2')][0x0];}else{return db[_0xdfff('0x7e')][_0xdfff('0x65')](_[_0xdfff('0x1b')](_0x1e94ee[_0xdfff('0x66')],{'firstName':_0x1e94ee[_0xdfff('0x66')]['to'][0x0],'phone':_0x1e94ee[_0xdfff('0x66')]['to'][0x0],'fax':_0x1e94ee['body']['to'][0x0],'ListId':_0x5bd6ca['ListId']}));}}else{throw new Error(_0xdfff('0xbd'));}}else{throw new Error(_0xdfff('0xbe'));}})[_0xdfff('0x25')](function(_0x1d7dc0){if(_0x1d7dc0){return db['FaxInteraction']['find']({'where':{'ContactId':_0x1d7dc0['id'],'closed':![],'FaxAccountId':_0x5bd6ca['id']}})[_0xdfff('0x25')](function(_0x48cbb3){if(_0x48cbb3){return[_0x48cbb3,![]];}return db['FaxInteraction']['create']({'UserId':_0x1e94ee['user']['id'],'ContactId':_0x1d7dc0['id'],'FaxAccountId':_0x5bd6ca['id'],'fax':_0x1e94ee[_0xdfff('0x66')]['to'][0x0],'firstMsgDirection':'out','Messages':[_['merge'](_0x1e94ee['body'],{'read':![],'body':_0x1e94ee[_0xdfff('0x66')]['attachments'][0x0][_0xdfff('0xbf')],'FaxAccountId':_0x5bd6ca['id'],'UserId':_0x1e94ee[_0xdfff('0x67')]['id'],'ContactId':_0x1d7dc0['id'],'AttachmentId':_0x1e94ee['body'][_0xdfff('0xb4')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':'Messages'}]})[_0xdfff('0x25')](function(_0x4206f6){return[_0x4206f6,!![]];});});}else{throw new Error(_0xdfff('0xc0'));}})['spread'](function(_0x56733c,_0x21ae71){if(_0x21ae71){return _0x56733c;}return db['FaxMessage']['create']({'direction':'out','read':![],'body':_0x1e94ee[_0xdfff('0x66')][_0xdfff('0xb4')][0x0]['filename'],'FaxAccountId':_0x5bd6ca['id'],'FaxInteractionId':_0x56733c['id'],'UserId':_0x1e94ee[_0xdfff('0x67')]['id'],'ContactId':_0x56733c['ContactId'],'AttachmentId':_0x1e94ee['body'][_0xdfff('0xb4')][0x0]['id']})[_0xdfff('0x25')](function(_0x1763bb){_0x56733c[_0xdfff('0xc1')][_0xdfff('0xc2')]=[];_0x56733c['dataValues']['Messages'][_0xdfff('0x97')](_0x1763bb[_0xdfff('0xc1')]);return _0x56733c;});})[_0xdfff('0x25')](function(_0x392515){respondWithRpcPromise(_0xdfff('0xc3'),_0xdfff('0xc3'),{'FaxAccountId':_['isNil'](_0x1e94ee[_0xdfff('0x60')]['id'])?undefined:_0x1e94ee['params']['id'],'path':_[_0xdfff('0xb9')](_0x1e94ee[_0xdfff('0x66')][_0xdfff('0xb4')][0x0][_0xdfff('0xa')])?undefined:_0x1e94ee[_0xdfff('0x66')][_0xdfff('0xb4')][0x0][_0xdfff('0xa')],'fax':_[_0xdfff('0xb9')](_0x1e94ee[_0xdfff('0x66')]['to'][0x0])?undefined:_0x1e94ee[_0xdfff('0x66')]['to'][0x0],'AttachmentId':_0x1e94ee[_0xdfff('0x66')][_0xdfff('0xb4')][0x0]['id']},client9002)[_0xdfff('0x25')](function(_0x591e1c){logger[_0xdfff('0x26')]('SendFaxRpc,\x20%s',_0x591e1c);})[_0xdfff('0x30')](function(_0x3cfeea){logger[_0xdfff('0x26')](_0xdfff('0xc4'),_0x3cfeea);});return _0x392515;})[_0xdfff('0x25')](respondWithResult(_0x2b8254,null))[_0xdfff('0x30')](handleError(_0x2b8254,null));};exports[_0xdfff('0xc5')]=function(_0x3e9493,_0xbb1d27,_0x53bbd4){return db[_0xdfff('0x44')][_0xdfff('0x64')]({'where':{'id':_0x3e9493[_0xdfff('0x60')]['id']}})[_0xdfff('0x25')](handleEntityNotFound(_0xbb1d27,null))[_0xdfff('0x25')](function(_0x444e9f){if(_0x444e9f){return _0x444e9f[_0xdfff('0xc5')](_0x3e9493[_0xdfff('0x66')][_0xdfff('0x76')],_['omit'](_0x3e9493['body'],[_0xdfff('0x76'),'id'])||{})[_0xdfff('0xc6')](function(_0x3efdff){for(var _0x519571=0x0;_0x519571<_0x3e9493['body'][_0xdfff('0x76')][_0xdfff('0x4d')];_0x519571+=0x1){socket[_0xdfff('0xc7')](_0xdfff('0xc8'),{'UserId':_0x3e9493['body'][_0xdfff('0x76')][_0x519571],'FaxAccountId':_0x3e9493['params']['id']});}return _0x3efdff;});}})[_0xdfff('0x25')](respondWithResult(_0xbb1d27,null))['catch'](handleError(_0xbb1d27,null));};exports[_0xdfff('0xc9')]=function(_0x3cd9f4,_0x208652,_0x4cbce4){return db[_0xdfff('0x44')][_0xdfff('0x64')]({'where':{'id':_0x3cd9f4['params']['id']}})[_0xdfff('0x25')](handleEntityNotFound(_0x208652,null))[_0xdfff('0x25')](function(_0x249b1d){if(_0x249b1d){return _0x249b1d[_0xdfff('0xc9')](_0x3cd9f4[_0xdfff('0x47')][_0xdfff('0x76')])[_0xdfff('0x25')](function(){if(_[_0xdfff('0xca')](_0x3cd9f4[_0xdfff('0x47')]['ids'])){for(var _0x301abd=0x0;_0x301abd<_0x3cd9f4[_0xdfff('0x47')][_0xdfff('0x76')]['length'];_0x301abd+=0x1){socket[_0xdfff('0xc7')](_0xdfff('0xcb'),{'UserId':Number(_0x3cd9f4[_0xdfff('0x47')]['ids'][_0x301abd]),'FaxAccountId':Number(_0x3cd9f4[_0xdfff('0x60')]['id'])});}}else{socket[_0xdfff('0xc7')]('userFaxAccount:remove',{'UserId':Number(_0x3cd9f4[_0xdfff('0x47')][_0xdfff('0x76')]),'FaxAccountId':Number(_0x3cd9f4[_0xdfff('0x60')]['id'])});}});}})[_0xdfff('0x25')](respondWithStatusCode(_0x208652,null))[_0xdfff('0x30')](handleError(_0x208652,null));};exports[_0xdfff('0xcc')]=function(_0x24b164,_0x2f0e86,_0x476060){var _0x212248={};var _0x20f0a1={};var _0x2cffd2;var _0x207b48;return db['FaxAccount']['findOne']({'where':{'id':_0x24b164['params']['id']}})['then'](handleEntityNotFound(_0x2f0e86,null))[_0xdfff('0x25')](function(_0x32e6ad){if(_0x32e6ad){_0x2cffd2=_0x32e6ad;_0x20f0a1[_0xdfff('0x46')]=_[_0xdfff('0x48')](db[_0xdfff('0xcd')][_0xdfff('0x45')]);_0x20f0a1[_0xdfff('0x47')]=_[_0xdfff('0x48')](_0x24b164[_0xdfff('0x47')]);_0x20f0a1[_0xdfff('0x49')]=_[_0xdfff('0x4a')](_0x20f0a1[_0xdfff('0x46')],_0x20f0a1[_0xdfff('0x47')]);_0x212248[_0xdfff('0x4c')]=_['intersection'](_0x20f0a1[_0xdfff('0x46')],qs['fields'](_0x24b164[_0xdfff('0x47')][_0xdfff('0x4b')]));_0x212248['attributes']=_0x212248[_0xdfff('0x4c')]['length']?_0x212248[_0xdfff('0x4c')]:_0x20f0a1[_0xdfff('0x46')];_0x212248[_0xdfff('0x51')]=qs[_0xdfff('0x52')](_0x24b164['query'][_0xdfff('0x52')]);_0x212248[_0xdfff('0x53')]=qs[_0xdfff('0x49')](_[_0xdfff('0x54')](_0x24b164[_0xdfff('0x47')],_0x20f0a1[_0xdfff('0x49')]));if(_0x24b164[_0xdfff('0x47')][_0xdfff('0x55')]){_0x212248[_0xdfff('0x53')]=_[_0xdfff('0x56')](_0x212248[_0xdfff('0x53')],{'$or':_['map'](_0x212248[_0xdfff('0x4c')],function(_0x31cade){var _0x55ec15={};_0x55ec15[_0x31cade]={'$like':'%'+_0x24b164[_0xdfff('0x47')][_0xdfff('0x55')]+'%'};return _0x55ec15;})});}_0x212248=_[_0xdfff('0x56')]({},_0x212248,_0x24b164['options']);return _0x2cffd2[_0xdfff('0xcc')](_0x212248);}})[_0xdfff('0x25')](function(_0x101ca2){if(_0x101ca2){_0x207b48=_0x101ca2['length'];if(!_0x24b164[_0xdfff('0x47')]['hasOwnProperty'](_0xdfff('0x74'))){_0x212248['limit']=qs[_0xdfff('0x4f')](_0x24b164['query'][_0xdfff('0x4f')]);_0x212248[_0xdfff('0x50')]=qs['offset'](_0x24b164[_0xdfff('0x47')][_0xdfff('0x50')]);}return _0x2cffd2[_0xdfff('0xcc')](_0x212248);}})[_0xdfff('0x25')](function(_0x5d3698){if(_0x5d3698){return _0x5d3698?{'count':_0x207b48,'rows':_0x5d3698}:null;}})['then'](respondWithResult(_0x2f0e86,null))[_0xdfff('0x30')](handleError(_0x2f0e86,null));}; \ No newline at end of file +var _0xc4f9=['error','message','info','result','catch','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','index','Pause','mandatoryDispositionPause','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','merge','type','key','field','options','FaxAccount','includeAll','include','findAll','length','find','create','get','role','user','FaxAccounts','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','FaxAccountId','findOne','Disposition','nolimit','map','filter','rows','removeDispositions','ids','getAnswers','CannedAnswer','removeAnswers','addInteraction','omit','FaxInteraction','Contact','User','fullname','internal','Tag','Tags','color','tag','addApplications','transaction','bulkCreate','findAndCountAll','priority','FaxApplication','getApplications','context','from-voip-provider','exten','localstationid','app','system','description','appdata','push','Answer','Set','ecm','gateway','faxdetect','headerinfo','maxrate','minrate','modem','FAXOPT(','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','sequelize','updateAccountApplications','VoiceExtension','tech','updatedAt','TrunkId','findById','getMessages','split','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','send','CmList','CmContact','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','format','List','ListId','List\x20not\x20found','Send\x20Fax\x20failed','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','jsforce','desk.js','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','./faxAccount.socket','http','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x469a3c,_0x5ebc10){var _0x968f4=function(_0x22403b){while(--_0x22403b){_0x469a3c['push'](_0x469a3c['shift']());}};_0x968f4(++_0x5ebc10);}(_0xc4f9,0x160));var _0x9c4f=function(_0x3100d6,_0x1628e6){_0x3100d6=_0x3100d6-0x0;var _0x24ffa8=_0xc4f9[_0x3100d6];return _0x24ffa8;};'use strict';var pdf=require(_0x9c4f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9c4f('0x1'));var zipdir=require(_0x9c4f('0x2'));var jsonpatch=require(_0x9c4f('0x3'));var rp=require(_0x9c4f('0x4'));var moment=require(_0x9c4f('0x5'));var BPromise=require(_0x9c4f('0x6'));var Mustache=require(_0x9c4f('0x7'));var util=require('util');var path=require(_0x9c4f('0x8'));var sox=require(_0x9c4f('0x9'));var csv=require(_0x9c4f('0xa'));var ejs=require(_0x9c4f('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9c4f('0xc'));var deskjs=require(_0x9c4f('0xd'));var toCsv=require(_0x9c4f('0xa'));var querystring=require(_0x9c4f('0xe'));var Papa=require(_0x9c4f('0xf'));var Redis=require(_0x9c4f('0x10'));var authService=require(_0x9c4f('0x11'));var qs=require(_0x9c4f('0x12'));var hardwareService=require(_0x9c4f('0x13'));var logger=require(_0x9c4f('0x14'))(_0x9c4f('0x15'));var utils=require(_0x9c4f('0x16'));var config=require(_0x9c4f('0x17'));var db=require(_0x9c4f('0x18'))['db'];config[_0x9c4f('0x19')]=_[_0x9c4f('0x1a')](config[_0x9c4f('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x9c4f('0x1b'))(new Redis(config[_0x9c4f('0x19')]));require(_0x9c4f('0x1c'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x9c4f('0x1d')]({'port':0x232c});var client9002=jayson[_0x9c4f('0x1e')][_0x9c4f('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x4c4c3e,_0x49afb1,_0x44bff5){if(_0x44bff5){var _0x2caffe=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2caffe[_0x9c4f('0x1f')](_0x49afb1)){return _0x4c4c3e;}else{throw new Error(_0x9c4f('0x20'));}}else{return _0x4c4c3e;}}function respondWithRpcPromise(_0xed6c12,_0x2c5845,_0x9ecd8a,_0x35720d){return new BPromise(function(_0x11ba64,_0x2a9132){var _0x35017a=_0x35720d||client;return _0x35017a[_0x9c4f('0x21')](_0xed6c12,_0x9ecd8a)[_0x9c4f('0x22')](function(_0xfdf8a4){logger['info'](_0x9c4f('0x23'),_0x2c5845,_0x9c4f('0x24'));logger[_0x9c4f('0x25')](_0x9c4f('0x26'),_0x2c5845,_0x9c4f('0x24'),JSON[_0x9c4f('0x27')](_0xfdf8a4));if(_0xfdf8a4[_0x9c4f('0x28')]){if(_0xfdf8a4['error']['code']===0x1f4){logger['error'](_0x9c4f('0x23'),_0x2c5845,_0xfdf8a4[_0x9c4f('0x28')]['message']);return _0x2a9132(_0xfdf8a4['error'][_0x9c4f('0x29')]);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x2c5845,_0xfdf8a4['error'][_0x9c4f('0x29')]);return _0x11ba64(_0xfdf8a4[_0x9c4f('0x28')][_0x9c4f('0x29')]);}else{logger[_0x9c4f('0x2a')](_0x9c4f('0x23'),_0x2c5845,_0x9c4f('0x24'));_0x11ba64(_0xfdf8a4[_0x9c4f('0x2b')][_0x9c4f('0x29')]);}})[_0x9c4f('0x2c')](function(_0x59f7f4){logger[_0x9c4f('0x28')](_0x9c4f('0x23'),_0x2c5845,_0x59f7f4);_0x2a9132(_0x59f7f4);});});}function respondWithStatusCode(_0x44aec4,_0x1f980a){_0x1f980a=_0x1f980a||0xcc;return function(_0x4cd190){if(_0x4cd190){return _0x44aec4[_0x9c4f('0x2d')](_0x1f980a);}return _0x44aec4['status'](_0x1f980a)[_0x9c4f('0x2e')]();};}function respondWithResult(_0x2034b,_0x36414c){_0x36414c=_0x36414c||0xc8;return function(_0xf8d0bb){if(_0xf8d0bb){return _0x2034b[_0x9c4f('0x2f')](_0x36414c)[_0x9c4f('0x30')](_0xf8d0bb);}};}function respondWithFilteredResult(_0x22ef75,_0x210bc5){return function(_0x1d9fa0){if(_0x1d9fa0){var _0x56d718=_0x1d9fa0[_0x9c4f('0x31')],_0x20799e=_0x210bc5['offset'],_0x22a1dc=_0x210bc5[_0x9c4f('0x32')]+_0x210bc5[_0x9c4f('0x33')],_0x3c5cde;if(_0x22a1dc>=_0x56d718){_0x22a1dc=_0x56d718;_0x3c5cde=0xc8;}else{_0x3c5cde=0xce;}_0x22ef75['status'](_0x3c5cde);return _0x22ef75[_0x9c4f('0x34')](_0x9c4f('0x35'),_0x20799e+'-'+_0x22a1dc+'/'+_0x56d718)[_0x9c4f('0x30')](_0x1d9fa0);}return null;};}function patchUpdates(_0x5aa2f0){return function(_0x444f19){try{jsonpatch[_0x9c4f('0x36')](_0x444f19,_0x5aa2f0,!![]);}catch(_0x16fcfa){return BPromise[_0x9c4f('0x37')](_0x16fcfa);}return _0x444f19[_0x9c4f('0x38')]();};}function saveUpdates(_0x8b17b7,_0x1f4d92){return function(_0x2c658b){if(_0x2c658b){return _0x2c658b[_0x9c4f('0x39')](_0x8b17b7)[_0x9c4f('0x22')](function(_0x377a88){return _0x377a88;});}return null;};}function removeEntity(_0x21f1b8,_0x1653bd){return function(_0x4357f8){if(_0x4357f8){return _0x4357f8[_0x9c4f('0x3a')]()[_0x9c4f('0x22')](function(){var _0x52c089=_0x4357f8['get']({'plain':!![]});var _0x4f6105='FaxAccounts';return db['UserProfileResource'][_0x9c4f('0x3a')]({'where':{'type':_0x4f6105,'resourceId':_0x52c089['id']}})[_0x9c4f('0x22')](function(){return _0x4357f8;});})[_0x9c4f('0x22')](function(){_0x21f1b8[_0x9c4f('0x2f')](0xcc)[_0x9c4f('0x2e')]();});}};}function handleEntityNotFound(_0x377e3f,_0x5ed440){return function(_0x146627){if(!_0x146627){_0x377e3f['sendStatus'](0x194);}return _0x146627;};}function handleError(_0x21c1bc,_0x2f51f1){_0x2f51f1=_0x2f51f1||0x1f4;return function(_0x5d91cd){logger[_0x9c4f('0x28')](_0x5d91cd[_0x9c4f('0x3b')]);if(_0x5d91cd[_0x9c4f('0x3c')]){delete _0x5d91cd[_0x9c4f('0x3c')];}_0x21c1bc[_0x9c4f('0x2f')](_0x2f51f1)['send'](_0x5d91cd);};}exports[_0x9c4f('0x3d')]=function(_0x5ad078,_0x2571fa){var _0x404789={'include':[{'model':db[_0x9c4f('0x3e')],'as':_0x9c4f('0x3f')}]},_0x5043cd={},_0x18998a={'count':0x0,'rows':[]};var _0x44e86f=db['FaxAccount'][_0x9c4f('0x40')];_0x5043cd[_0x9c4f('0x41')]=_[_0x9c4f('0x42')](_0x44e86f);_0x5043cd[_0x9c4f('0x43')]=_[_0x9c4f('0x42')](_0x5ad078[_0x9c4f('0x43')]);_0x5043cd[_0x9c4f('0x44')]=_[_0x9c4f('0x45')](_0x5043cd[_0x9c4f('0x41')],_0x5043cd['query']);_0x404789['attributes']=_['intersection'](_0x5043cd[_0x9c4f('0x41')],qs[_0x9c4f('0x46')](_0x5ad078[_0x9c4f('0x43')][_0x9c4f('0x46')]));_0x404789[_0x9c4f('0x47')]=_0x404789['attributes']['length']?_0x404789[_0x9c4f('0x47')]:_0x5043cd['model'];if(!_0x5ad078[_0x9c4f('0x43')][_0x9c4f('0x48')]('nolimit')){_0x404789['limit']=qs[_0x9c4f('0x33')](_0x5ad078[_0x9c4f('0x43')][_0x9c4f('0x33')]);_0x404789[_0x9c4f('0x32')]=qs[_0x9c4f('0x32')](_0x5ad078['query'][_0x9c4f('0x32')]);}_0x404789[_0x9c4f('0x49')]=qs[_0x9c4f('0x4a')](_0x5ad078['query'][_0x9c4f('0x4a')]);_0x404789[_0x9c4f('0x4b')]=qs[_0x9c4f('0x44')](_[_0x9c4f('0x4c')](_0x5ad078[_0x9c4f('0x43')],_0x5043cd['filters']));if(_0x5ad078[_0x9c4f('0x43')]['filter']){_0x404789['where']=_[_0x9c4f('0x4d')](_0x404789[_0x9c4f('0x4b')],{'$or':_['map'](_0x44e86f,function(_0x3bcbb0){if(_0x3bcbb0[_0x9c4f('0x4e')][_0x9c4f('0x4f')]!=='VIRTUAL'){var _0x485047={};_0x485047[_0x3bcbb0[_0x9c4f('0x50')]]={'$like':'%'+_0x5ad078['query']['filter']+'%'};return _0x485047;}})});}_0x404789=_[_0x9c4f('0x4d')]({},_0x404789,_0x5ad078[_0x9c4f('0x51')]);var _0x4ef3e6={'where':_0x404789[_0x9c4f('0x4b')]};return db[_0x9c4f('0x52')][_0x9c4f('0x31')](_0x4ef3e6)[_0x9c4f('0x22')](function(_0xb0a090){_0x18998a[_0x9c4f('0x31')]=_0xb0a090;if(_0x5ad078['query'][_0x9c4f('0x53')]){_0x404789[_0x9c4f('0x54')]=[{'all':!![]}];}return db[_0x9c4f('0x52')][_0x9c4f('0x55')](_0x404789);})['then'](function(_0xa43197){_0x18998a['rows']=_0xa43197;return _0x18998a;})[_0x9c4f('0x22')](respondWithFilteredResult(_0x2571fa,_0x404789))[_0x9c4f('0x2c')](handleError(_0x2571fa,null));};exports['show']=function(_0x31bc19,_0x17c5fd){var _0xbff18f={'raw':![],'where':{'id':_0x31bc19['params']['id']},'include':[{'model':db[_0x9c4f('0x3e')],'as':'mandatoryDispositionPause'}]},_0x4ab127={};_0x4ab127[_0x9c4f('0x41')]=_[_0x9c4f('0x42')](db[_0x9c4f('0x52')][_0x9c4f('0x40')]);_0x4ab127['query']=_[_0x9c4f('0x42')](_0x31bc19[_0x9c4f('0x43')]);_0x4ab127[_0x9c4f('0x44')]=_[_0x9c4f('0x45')](_0x4ab127[_0x9c4f('0x41')],_0x4ab127[_0x9c4f('0x43')]);_0xbff18f[_0x9c4f('0x47')]=_[_0x9c4f('0x45')](_0x4ab127[_0x9c4f('0x41')],qs[_0x9c4f('0x46')](_0x31bc19[_0x9c4f('0x43')][_0x9c4f('0x46')]));_0xbff18f[_0x9c4f('0x47')]=_0xbff18f[_0x9c4f('0x47')][_0x9c4f('0x56')]?_0xbff18f['attributes']:_0x4ab127['model'];if(_0x31bc19[_0x9c4f('0x43')]['includeAll']){_0xbff18f[_0x9c4f('0x54')]=[{'all':!![]}];}_0xbff18f=_[_0x9c4f('0x4d')]({},_0xbff18f,_0x31bc19[_0x9c4f('0x51')]);return db[_0x9c4f('0x52')][_0x9c4f('0x57')](_0xbff18f)[_0x9c4f('0x22')](handleEntityNotFound(_0x17c5fd,null))[_0x9c4f('0x22')](respondWithResult(_0x17c5fd,null))[_0x9c4f('0x2c')](handleError(_0x17c5fd,null));};exports[_0x9c4f('0x58')]=function(_0x27e9d2,_0x43c00e){return db[_0x9c4f('0x52')][_0x9c4f('0x58')](_0x27e9d2['body'],{})[_0x9c4f('0x22')](function(_0x17cce0){var _0xd2dca8=_0x27e9d2['user'][_0x9c4f('0x59')]({'plain':!![]});if(!_0xd2dca8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xd2dca8[_0x9c4f('0x5a')]===_0x9c4f('0x5b')){var _0x4fddb8=_0x17cce0[_0x9c4f('0x59')]({'plain':!![]});var _0x20dfc2=_0x9c4f('0x5c');return db[_0x9c4f('0x5d')][_0x9c4f('0x57')]({'where':{'name':_0x20dfc2,'userProfileId':_0xd2dca8['userProfileId']},'raw':!![]})['then'](function(_0x2f42b0){if(_0x2f42b0&&_0x2f42b0[_0x9c4f('0x5e')]===0x0){return db[_0x9c4f('0x5f')][_0x9c4f('0x58')]({'name':_0x4fddb8['name'],'resourceId':_0x4fddb8['id'],'type':_0x2f42b0[_0x9c4f('0x3c')],'sectionId':_0x2f42b0['id']},{})['then'](function(){return _0x17cce0;});}else{return _0x17cce0;}})['catch'](function(_0x44278f){logger[_0x9c4f('0x28')](_0x9c4f('0x60'),_0x44278f);throw _0x44278f;});}return _0x17cce0;})[_0x9c4f('0x22')](respondWithResult(_0x43c00e,0xc9))[_0x9c4f('0x2c')](handleError(_0x43c00e,null));};exports[_0x9c4f('0x39')]=function(_0x568da2,_0x53f43f){if(_0x568da2['body']['id']){delete _0x568da2[_0x9c4f('0x61')]['id'];}return db['FaxAccount'][_0x9c4f('0x57')]({'where':{'id':_0x568da2[_0x9c4f('0x62')]['id']},'include':[{'model':db['Pause'],'as':_0x9c4f('0x3f')}]})['then'](handleEntityNotFound(_0x53f43f,null))['then'](saveUpdates(_0x568da2['body'],null))['then'](respondWithResult(_0x53f43f,null))['catch'](handleError(_0x53f43f,null));};exports[_0x9c4f('0x3a')]=function(_0x3298a5,_0x2456c2){return db['FaxAccount'][_0x9c4f('0x57')]({'where':{'id':_0x3298a5[_0x9c4f('0x62')]['id']}})['then'](handleEntityNotFound(_0x2456c2,null))['then'](removeEntity(_0x2456c2,null))[_0x9c4f('0x2c')](handleError(_0x2456c2,null));};exports[_0x9c4f('0x63')]=function(_0x480cb0,_0xd33d7d){return db[_0x9c4f('0x52')]['describe']()[_0x9c4f('0x22')](respondWithResult(_0xd33d7d,null))[_0x9c4f('0x2c')](handleError(_0xd33d7d,null));};exports[_0x9c4f('0x64')]=function(_0x1b1c18,_0x38be20,_0x376dac){if(_0x1b1c18[_0x9c4f('0x61')]['id']){delete _0x1b1c18[_0x9c4f('0x61')]['id'];}return db['FaxAccount'][_0x9c4f('0x57')]({'where':{'id':_0x1b1c18[_0x9c4f('0x62')]['id']}})['then'](handleEntityNotFound(_0x38be20,null))[_0x9c4f('0x22')](function(_0x58d38d){if(_0x58d38d){_0x1b1c18['body'][_0x9c4f('0x65')]=_0x58d38d['id'];return db['Disposition'][_0x9c4f('0x58')](_0x1b1c18['body']);}})['then'](respondWithResult(_0x38be20,null))[_0x9c4f('0x2c')](handleError(_0x38be20,null));};exports['getDispositions']=function(_0x873be7,_0x29c432,_0x135a17){var _0x22ef97={'raw':![],'where':{}};var _0x424858={};var _0x322e6e={'count':0x0,'rows':[]};return db[_0x9c4f('0x52')][_0x9c4f('0x66')]({'where':{'id':_0x873be7['params']['id']}})[_0x9c4f('0x22')](handleEntityNotFound(_0x29c432,null))[_0x9c4f('0x22')](function(_0x1ff4dd){if(_0x1ff4dd){_0x424858[_0x9c4f('0x41')]=_[_0x9c4f('0x42')](db[_0x9c4f('0x67')][_0x9c4f('0x40')]);_0x424858[_0x9c4f('0x43')]=_['keys'](_0x873be7['query']);_0x424858['filters']=_[_0x9c4f('0x45')](_0x424858[_0x9c4f('0x41')],_0x424858[_0x9c4f('0x43')]);_0x22ef97['attributes']=_[_0x9c4f('0x45')](_0x424858['model'],qs[_0x9c4f('0x46')](_0x873be7['query'][_0x9c4f('0x46')]));_0x22ef97[_0x9c4f('0x47')]=_0x22ef97['attributes'][_0x9c4f('0x56')]?_0x22ef97[_0x9c4f('0x47')]:_0x424858[_0x9c4f('0x41')];if(!_0x873be7[_0x9c4f('0x43')][_0x9c4f('0x48')](_0x9c4f('0x68'))){_0x22ef97[_0x9c4f('0x33')]=qs[_0x9c4f('0x33')](_0x873be7[_0x9c4f('0x43')][_0x9c4f('0x33')]);_0x22ef97[_0x9c4f('0x32')]=qs['offset'](_0x873be7[_0x9c4f('0x43')][_0x9c4f('0x32')]);}_0x22ef97[_0x9c4f('0x49')]=qs[_0x9c4f('0x4a')](_0x873be7[_0x9c4f('0x43')][_0x9c4f('0x4a')]);_0x22ef97[_0x9c4f('0x4b')]=qs[_0x9c4f('0x44')](_[_0x9c4f('0x4c')](_0x873be7[_0x9c4f('0x43')],_0x424858[_0x9c4f('0x44')]));_0x22ef97['where']['FaxAccountId']=_0x1ff4dd['id'];if(_0x873be7[_0x9c4f('0x43')]['filter']){_0x22ef97['where']=_[_0x9c4f('0x4d')](_0x22ef97['where'],{'$or':_[_0x9c4f('0x69')](_0x22ef97[_0x9c4f('0x47')],function(_0x1e1fed){var _0x2c95c9={};_0x2c95c9[_0x1e1fed]={'$like':'%'+_0x873be7['query'][_0x9c4f('0x6a')]+'%'};return _0x2c95c9;})});}_0x22ef97=_[_0x9c4f('0x4d')]({},_0x22ef97,_0x873be7['options']);return db[_0x9c4f('0x67')]['count']({'where':_0x22ef97['where']})['then'](function(_0x20c803){_0x322e6e['count']=_0x20c803;if(_0x873be7[_0x9c4f('0x43')][_0x9c4f('0x53')]){_0x22ef97[_0x9c4f('0x54')]=[{'all':!![]}];}return db[_0x9c4f('0x67')]['findAll'](_0x22ef97);})[_0x9c4f('0x22')](function(_0x2191c2){_0x322e6e[_0x9c4f('0x6b')]=_0x2191c2;return _0x322e6e;});}})['then'](respondWithFilteredResult(_0x29c432,_0x22ef97))[_0x9c4f('0x2c')](handleError(_0x29c432,null));};exports[_0x9c4f('0x6c')]=function(_0x4b2ea7,_0x44807e,_0x33f39e){return db[_0x9c4f('0x52')]['find']({'where':{'id':_0x4b2ea7[_0x9c4f('0x62')]['id']}})[_0x9c4f('0x22')](handleEntityNotFound(_0x44807e,null))['then'](function(_0x393bcc){if(_0x393bcc){return _0x393bcc[_0x9c4f('0x6c')](_0x4b2ea7[_0x9c4f('0x43')][_0x9c4f('0x6d')]);}})[_0x9c4f('0x22')](respondWithStatusCode(_0x44807e,null))[_0x9c4f('0x2c')](handleError(_0x44807e,null));};exports['addAnswer']=function(_0x7a2f18,_0x4bc693,_0x5f1a7b){if(_0x7a2f18[_0x9c4f('0x61')]['id']){delete _0x7a2f18[_0x9c4f('0x61')]['id'];}return db[_0x9c4f('0x52')][_0x9c4f('0x57')]({'where':{'id':_0x7a2f18[_0x9c4f('0x62')]['id']}})[_0x9c4f('0x22')](handleEntityNotFound(_0x4bc693,null))[_0x9c4f('0x22')](function(_0x164b77){if(_0x164b77){_0x7a2f18['body'][_0x9c4f('0x65')]=_0x164b77['id'];return db['CannedAnswer'][_0x9c4f('0x58')](_0x7a2f18[_0x9c4f('0x61')]);}})[_0x9c4f('0x22')](respondWithResult(_0x4bc693,null))[_0x9c4f('0x2c')](handleError(_0x4bc693,null));};exports[_0x9c4f('0x6e')]=function(_0x2c1b8f,_0x206c99,_0x8ace15){var _0x104521={'raw':![],'where':{}};var _0x11c425={};var _0x4e5869={'count':0x0,'rows':[]};return db[_0x9c4f('0x52')][_0x9c4f('0x66')]({'where':{'id':_0x2c1b8f[_0x9c4f('0x62')]['id']}})['then'](handleEntityNotFound(_0x206c99,null))[_0x9c4f('0x22')](function(_0x383e5b){if(_0x383e5b){_0x11c425[_0x9c4f('0x41')]=_['keys'](db[_0x9c4f('0x6f')]['rawAttributes']);_0x11c425[_0x9c4f('0x43')]=_[_0x9c4f('0x42')](_0x2c1b8f[_0x9c4f('0x43')]);_0x11c425[_0x9c4f('0x44')]=_[_0x9c4f('0x45')](_0x11c425['model'],_0x11c425[_0x9c4f('0x43')]);_0x104521[_0x9c4f('0x47')]=_[_0x9c4f('0x45')](_0x11c425['model'],qs['fields'](_0x2c1b8f[_0x9c4f('0x43')][_0x9c4f('0x46')]));_0x104521[_0x9c4f('0x47')]=_0x104521[_0x9c4f('0x47')][_0x9c4f('0x56')]?_0x104521[_0x9c4f('0x47')]:_0x11c425[_0x9c4f('0x41')];if(!_0x2c1b8f[_0x9c4f('0x43')][_0x9c4f('0x48')](_0x9c4f('0x68'))){_0x104521[_0x9c4f('0x33')]=qs['limit'](_0x2c1b8f[_0x9c4f('0x43')][_0x9c4f('0x33')]);_0x104521['offset']=qs[_0x9c4f('0x32')](_0x2c1b8f[_0x9c4f('0x43')][_0x9c4f('0x32')]);}_0x104521[_0x9c4f('0x49')]=qs['sort'](_0x2c1b8f['query'][_0x9c4f('0x4a')]);_0x104521[_0x9c4f('0x4b')]=qs[_0x9c4f('0x44')](_['pick'](_0x2c1b8f[_0x9c4f('0x43')],_0x11c425[_0x9c4f('0x44')]));_0x104521[_0x9c4f('0x4b')]['FaxAccountId']=_0x383e5b['id'];if(_0x2c1b8f[_0x9c4f('0x43')][_0x9c4f('0x6a')]){_0x104521[_0x9c4f('0x4b')]=_[_0x9c4f('0x4d')](_0x104521[_0x9c4f('0x4b')],{'$or':_[_0x9c4f('0x69')](_0x104521[_0x9c4f('0x47')],function(_0x3fe809){var _0xc1a58f={};_0xc1a58f[_0x3fe809]={'$like':'%'+_0x2c1b8f[_0x9c4f('0x43')][_0x9c4f('0x6a')]+'%'};return _0xc1a58f;})});}_0x104521=_[_0x9c4f('0x4d')]({},_0x104521,_0x2c1b8f[_0x9c4f('0x51')]);return db[_0x9c4f('0x6f')][_0x9c4f('0x31')]({'where':_0x104521[_0x9c4f('0x4b')]})[_0x9c4f('0x22')](function(_0x320df2){_0x4e5869[_0x9c4f('0x31')]=_0x320df2;if(_0x2c1b8f[_0x9c4f('0x43')][_0x9c4f('0x53')]){_0x104521['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x9c4f('0x55')](_0x104521);})['then'](function(_0x2e523c){_0x4e5869[_0x9c4f('0x6b')]=_0x2e523c;return _0x4e5869;});}})[_0x9c4f('0x22')](respondWithFilteredResult(_0x206c99,_0x104521))['catch'](handleError(_0x206c99,null));};exports[_0x9c4f('0x70')]=function(_0x51acd5,_0x2974fa,_0x338cf2){return db[_0x9c4f('0x52')][_0x9c4f('0x57')]({'where':{'id':_0x51acd5[_0x9c4f('0x62')]['id']}})[_0x9c4f('0x22')](handleEntityNotFound(_0x2974fa,null))[_0x9c4f('0x22')](function(_0x3dba7c){if(_0x3dba7c){return _0x3dba7c[_0x9c4f('0x70')](_0x51acd5[_0x9c4f('0x43')]['ids']);}})[_0x9c4f('0x22')](respondWithStatusCode(_0x2974fa,null))['catch'](handleError(_0x2974fa,null));};exports[_0x9c4f('0x71')]=function(_0x116f5b,_0x2f3f2a,_0x4608af){return db['FaxInteraction']['find']({'where':{'id':_0x116f5b[_0x9c4f('0x62')]['id']}})[_0x9c4f('0x22')](handleEntityNotFound(_0x2f3f2a,null))[_0x9c4f('0x22')](function(_0x4d7206){if(_0x4d7206){return _0x4d7206[_0x9c4f('0x71')](_0x116f5b[_0x9c4f('0x61')]['ids'],_[_0x9c4f('0x72')](_0x116f5b['body'],[_0x9c4f('0x6d'),'id'])||{});}})[_0x9c4f('0x22')](respondWithResult(_0x2f3f2a,null))[_0x9c4f('0x2c')](handleError(_0x2f3f2a,null));};exports['getInteractions']=function(_0x1b2243,_0x46dc5a,_0x48383c){var _0x58b20b={'raw':![],'where':{}};var _0x81c3a2={};var _0x21d46f={'count':0x0,'rows':[]};return db[_0x9c4f('0x52')]['findOne']({'where':{'id':_0x1b2243[_0x9c4f('0x62')]['id']}})[_0x9c4f('0x22')](handleEntityNotFound(_0x46dc5a,null))[_0x9c4f('0x22')](function(_0x284291){if(_0x284291){_0x81c3a2[_0x9c4f('0x41')]=_['keys'](db[_0x9c4f('0x73')][_0x9c4f('0x40')]);_0x81c3a2[_0x9c4f('0x43')]=_['keys'](_0x1b2243[_0x9c4f('0x43')]);_0x81c3a2[_0x9c4f('0x44')]=_['intersection'](_0x81c3a2[_0x9c4f('0x41')],_0x81c3a2[_0x9c4f('0x43')]);_0x58b20b[_0x9c4f('0x47')]=_[_0x9c4f('0x45')](_0x81c3a2[_0x9c4f('0x41')],qs[_0x9c4f('0x46')](_0x1b2243['query']['fields']));_0x58b20b[_0x9c4f('0x47')]=_0x58b20b['attributes'][_0x9c4f('0x56')]?_0x58b20b[_0x9c4f('0x47')]:_0x81c3a2[_0x9c4f('0x41')];if(!_0x1b2243[_0x9c4f('0x43')]['hasOwnProperty']('nolimit')){_0x58b20b[_0x9c4f('0x33')]=qs['limit'](_0x1b2243['query'][_0x9c4f('0x33')]);_0x58b20b['offset']=qs[_0x9c4f('0x32')](_0x1b2243[_0x9c4f('0x43')]['offset']);}_0x58b20b['order']=qs['sort'](_0x1b2243[_0x9c4f('0x43')][_0x9c4f('0x4a')]);_0x58b20b['where']=qs[_0x9c4f('0x44')](_[_0x9c4f('0x4c')](_0x1b2243['query'],_0x81c3a2[_0x9c4f('0x44')]));_0x58b20b[_0x9c4f('0x4b')][_0x9c4f('0x65')]=_0x284291['id'];if(_0x1b2243[_0x9c4f('0x43')][_0x9c4f('0x6a')]){_0x58b20b[_0x9c4f('0x4b')]=_[_0x9c4f('0x4d')](_0x58b20b[_0x9c4f('0x4b')],{'$or':_[_0x9c4f('0x69')](_0x58b20b[_0x9c4f('0x47')],function(_0x164dcc){var _0x5a23e8={};_0x5a23e8[_0x164dcc]={'$like':'%'+_0x1b2243['query'][_0x9c4f('0x6a')]+'%'};return _0x5a23e8;})});}_0x58b20b=_['merge']({},_0x58b20b,_0x1b2243[_0x9c4f('0x51')]);return db[_0x9c4f('0x73')][_0x9c4f('0x31')]({'where':_0x58b20b[_0x9c4f('0x4b')]})[_0x9c4f('0x22')](function(_0x2f954f){_0x21d46f[_0x9c4f('0x31')]=_0x2f954f;if(_0x1b2243['query'][_0x9c4f('0x53')]){_0x58b20b[_0x9c4f('0x54')]=[{'model':db['CmContact'],'as':_0x9c4f('0x74'),'required':![]},{'model':db[_0x9c4f('0x75')],'as':'Owner','attributes':[_0x9c4f('0x3c'),_0x9c4f('0x76'),_0x9c4f('0x77')],'required':![]},{'model':db[_0x9c4f('0x78')],'as':_0x9c4f('0x79'),'attributes':['id',_0x9c4f('0x3c'),_0x9c4f('0x7a')],'where':_0x1b2243[_0x9c4f('0x43')][_0x9c4f('0x7b')]?{'id':_0x1b2243[_0x9c4f('0x43')][_0x9c4f('0x7b')]}:undefined,'required':_0x1b2243[_0x9c4f('0x43')][_0x9c4f('0x7b')]?!![]:![]}];}return db[_0x9c4f('0x73')][_0x9c4f('0x55')](_0x58b20b);})['then'](function(_0x1a4479){_0x21d46f['rows']=_0x1a4479;return _0x21d46f;});}})[_0x9c4f('0x22')](respondWithFilteredResult(_0x46dc5a,_0x58b20b))[_0x9c4f('0x2c')](handleError(_0x46dc5a,null));};exports[_0x9c4f('0x7c')]=function(_0x28ea5b,_0x233921,_0x56ab55){return db[_0x9c4f('0x52')][_0x9c4f('0x66')]({'where':{'id':_0x28ea5b['params']['id']}})['then'](handleEntityNotFound(_0x233921,null))[_0x9c4f('0x22')](function(_0x2947c1){if(_0x2947c1){return db['sequelize'][_0x9c4f('0x7d')](function(_0x270ec7){return db['FaxApplication'][_0x9c4f('0x3a')]({'where':{'FaxAccountId':_0x28ea5b['params']['id']},'transaction':_0x270ec7})[_0x9c4f('0x22')](function(_0xcb79e1){var _0x54bab1=_[_0x9c4f('0x69')](_0x28ea5b[_0x9c4f('0x61')],function(_0x3b2c53){_0x3b2c53['FaxAccountId']=_0x28ea5b[_0x9c4f('0x62')]['id'];return _0x3b2c53;});return db['FaxApplication'][_0x9c4f('0x7e')](_0x54bab1,{'transaction':_0x270ec7});});})[_0x9c4f('0x22')](function(){return db['FaxApplication'][_0x9c4f('0x7f')]({'where':{'FaxAccountId':_0x28ea5b[_0x9c4f('0x62')]['id']},'order':_0x9c4f('0x80')});});}})['then'](respondWithResult(_0x233921,null))[_0x9c4f('0x2c')](handleError(_0x233921,null));};exports['getApplications']=function(_0x994aa3,_0x3a6a8e,_0x13b921){var _0x28935b={};var _0x33b17e={};var _0x1e4056;var _0x2ac691;return db['FaxAccount'][_0x9c4f('0x66')]({'where':{'id':_0x994aa3['params']['id']}})['then'](handleEntityNotFound(_0x3a6a8e,null))['then'](function(_0x1058b6){if(_0x1058b6){_0x1e4056=_0x1058b6;_0x33b17e[_0x9c4f('0x41')]=_['keys'](db[_0x9c4f('0x81')][_0x9c4f('0x40')]);_0x33b17e['query']=_[_0x9c4f('0x42')](_0x994aa3[_0x9c4f('0x43')]);_0x33b17e[_0x9c4f('0x44')]=_[_0x9c4f('0x45')](_0x33b17e[_0x9c4f('0x41')],_0x33b17e[_0x9c4f('0x43')]);_0x28935b[_0x9c4f('0x47')]=_[_0x9c4f('0x45')](_0x33b17e['model'],qs[_0x9c4f('0x46')](_0x994aa3[_0x9c4f('0x43')][_0x9c4f('0x46')]));_0x28935b[_0x9c4f('0x47')]=_0x28935b['attributes'][_0x9c4f('0x56')]?_0x28935b[_0x9c4f('0x47')]:_0x33b17e[_0x9c4f('0x41')];_0x28935b[_0x9c4f('0x49')]=qs[_0x9c4f('0x4a')](_0x994aa3[_0x9c4f('0x43')][_0x9c4f('0x4a')]);_0x28935b['where']=qs[_0x9c4f('0x44')](_[_0x9c4f('0x4c')](_0x994aa3[_0x9c4f('0x43')],_0x33b17e['filters']));if(_0x994aa3[_0x9c4f('0x43')][_0x9c4f('0x6a')]){_0x28935b['where']=_[_0x9c4f('0x4d')](_0x28935b[_0x9c4f('0x4b')],{'$or':_[_0x9c4f('0x69')](_0x28935b[_0x9c4f('0x47')],function(_0x28a52f){var _0x20dc1c={};_0x20dc1c[_0x28a52f]={'$like':'%'+_0x994aa3[_0x9c4f('0x43')]['filter']+'%'};return _0x20dc1c;})});}_0x28935b=_[_0x9c4f('0x4d')]({},_0x28935b,_0x994aa3[_0x9c4f('0x51')]);return _0x1e4056[_0x9c4f('0x82')](_0x28935b);}})[_0x9c4f('0x22')](function(_0x12d112){if(_0x12d112){_0x2ac691=_0x12d112[_0x9c4f('0x56')];if(!_0x994aa3['query'][_0x9c4f('0x48')](_0x9c4f('0x68'))){_0x28935b['limit']=qs[_0x9c4f('0x33')](_0x994aa3[_0x9c4f('0x43')]['limit']);_0x28935b['offset']=qs['offset'](_0x994aa3[_0x9c4f('0x43')]['offset']);}return _0x1e4056[_0x9c4f('0x82')](_0x28935b);}})[_0x9c4f('0x22')](function(_0x49ff75){if(_0x49ff75){return _0x49ff75?{'count':_0x2ac691,'rows':_0x49ff75}:null;}})['then'](respondWithResult(_0x3a6a8e,null))[_0x9c4f('0x2c')](handleError(_0x3a6a8e,null));};function Extension(_0x45d3c3,_0x2695ac,_0x407141,_0x33314e){this[_0x9c4f('0x83')]=_0x9c4f('0x84');this[_0x9c4f('0x85')]=_0x45d3c3[_0x9c4f('0x86')];this[_0x9c4f('0x87')]=_0x33314e;this['type']=_0x9c4f('0x88');this[_0x9c4f('0x89')]='Fax\x20Extension';this[_0x9c4f('0x65')]=_0x45d3c3['id'];this['priority']=_0x2695ac;this[_0x9c4f('0x8a')]=_0x407141;}function createExtensionsReciveFax(_0x4a6944){var _0x4c79cf=0x1;var _0x268f62=[];_0x268f62[_0x9c4f('0x8b')](new Extension(_0x4a6944,_0x4c79cf,'',_0x9c4f('0x8c')));_0x4c79cf+=0x1;_0x268f62[_0x9c4f('0x8b')](new Extension(_0x4a6944,_0x4c79cf,'CDR(type)=inbound-fax',_0x9c4f('0x8d')));_0x4c79cf+=0x1;for(var _0x1905f5 in _0x4a6944){if(_0x4a6944['hasOwnProperty'](_0x1905f5)&&(_0x1905f5===_0x9c4f('0x8e')||_0x1905f5==='localstationid'||_0x1905f5===_0x9c4f('0x8f')||_0x1905f5===_0x9c4f('0x90')||_0x1905f5===_0x9c4f('0x91')||_0x1905f5===_0x9c4f('0x92')||_0x1905f5===_0x9c4f('0x93')||_0x1905f5===_0x9c4f('0x94')||_0x1905f5==='t38timeout')){_0x268f62['push'](new Extension(_0x4a6944,_0x4c79cf,_0x9c4f('0x95')+_0x1905f5+')='+_0x4a6944[_0x1905f5],_0x9c4f('0x8d')));_0x4c79cf+=0x1;}}_0x268f62[_0x9c4f('0x8b')](new Extension(_0x4a6944,_0x4c79cf,'6','Wait'));_0x4c79cf+=0x1;_0x268f62[_0x9c4f('0x8b')](new Extension(_0x4a6944,_0x4c79cf,_0x9c4f('0x96'),_0x9c4f('0x97')));_0x4c79cf=0x0;return _0x268f62;}exports[_0x9c4f('0x98')]=function(_0x253ad8,_0x3a8c9f,_0x4701db){var _0x23a90f;return db[_0x9c4f('0x99')]['transaction'](function(_0x3908a5){return db[_0x9c4f('0x52')][_0x9c4f('0x58')](_0x253ad8[_0x9c4f('0x61')],{'transaction':_0x3908a5})[_0x9c4f('0x22')](function(_0x1d48fb){_0x23a90f=_0x1d48fb[_0x9c4f('0x59')]({'plain':!![]});return db['VoiceExtension'][_0x9c4f('0x7e')](createExtensionsReciveFax(_0x23a90f),{'transaction':_0x3908a5});});})[_0x9c4f('0x22')](function(){return _0x23a90f;})[_0x9c4f('0x22')](respondWithResult(_0x3a8c9f,null))[_0x9c4f('0x2c')](handleError(_0x3a8c9f,null));};exports[_0x9c4f('0x9a')]=function(_0x178cd4,_0x3f00e4,_0x3fd094){var _0x2d8b18;return db[_0x9c4f('0x99')][_0x9c4f('0x7d')](function(_0x478348){return db[_0x9c4f('0x52')][_0x9c4f('0x39')](_0x178cd4[_0x9c4f('0x61')],{'where':{'id':_0x178cd4[_0x9c4f('0x61')]['id']},'transaction':_0x478348})['then'](function(_0x46b01d){return db[_0x9c4f('0x9b')][_0x9c4f('0x3a')]({'where':{'FaxAccountId':_0x178cd4[_0x9c4f('0x61')]['id']},'transaction':_0x478348})[_0x9c4f('0x22')](function(_0x3ff289){return db[_0x9c4f('0x9b')]['bulkCreate'](createExtensionsReciveFax(_['omit'](_0x178cd4['body'],[_0x9c4f('0x9c'),_0x9c4f('0x4f'),'createdAt',_0x9c4f('0x9d'),_0x9c4f('0x9e'),'ListId'])),{'transaction':_0x478348});});});})['then'](function(){return db[_0x9c4f('0x52')][_0x9c4f('0x9f')](_0x178cd4[_0x9c4f('0x61')]['id']);})[_0x9c4f('0x22')](respondWithResult(_0x3f00e4,null))[_0x9c4f('0x2c')](handleError(_0x3f00e4,null));};exports[_0x9c4f('0xa0')]=function(_0x53e076,_0x37add4,_0x8ae7ef){var _0x4f25bb={'raw':!![],'where':{}};var _0x1592c2={};var _0x33c952={'count':0x0,'rows':[]};return db['FaxAccount'][_0x9c4f('0x66')]({'where':{'id':_0x53e076[_0x9c4f('0x62')]['id']}})[_0x9c4f('0x22')](handleEntityNotFound(_0x37add4,null))[_0x9c4f('0x22')](function(_0x58ecc2){if(_0x58ecc2){_0x1592c2['model']=_[_0x9c4f('0x42')](db['FaxMessage'][_0x9c4f('0x40')]);_0x1592c2['query']=_[_0x9c4f('0x42')](_0x53e076['query']);_0x1592c2[_0x9c4f('0x44')]=_[_0x9c4f('0x45')](_0x1592c2[_0x9c4f('0x41')],_0x1592c2[_0x9c4f('0x43')]);_0x4f25bb[_0x9c4f('0x47')]=_['intersection'](_0x1592c2['model'],qs['fields'](_0x53e076[_0x9c4f('0x43')][_0x9c4f('0x46')]));_0x4f25bb[_0x9c4f('0x47')]=_0x4f25bb['attributes']['length']?_0x4f25bb[_0x9c4f('0x47')]:_0x1592c2[_0x9c4f('0x41')];if(!_0x53e076['query'][_0x9c4f('0x48')](_0x9c4f('0x68'))){_0x4f25bb['limit']=qs['limit'](_0x53e076[_0x9c4f('0x43')][_0x9c4f('0x33')]);_0x4f25bb[_0x9c4f('0x32')]=qs['offset'](_0x53e076['query'][_0x9c4f('0x32')]);}_0x4f25bb[_0x9c4f('0x49')]=qs[_0x9c4f('0x4a')](_0x53e076['query']['sort']);_0x4f25bb[_0x9c4f('0x4b')]=qs[_0x9c4f('0x44')](_[_0x9c4f('0x4c')](_0x53e076[_0x9c4f('0x43')],_0x1592c2[_0x9c4f('0x44')]));_0x4f25bb[_0x9c4f('0x4b')]['FaxAccountId']=_0x58ecc2['id'];if(_0x53e076[_0x9c4f('0x43')][_0x9c4f('0x6a')]){_0x4f25bb['where']=_['merge'](_0x4f25bb[_0x9c4f('0x4b')],{'$or':_['map'](_0x4f25bb[_0x9c4f('0x47')],function(_0x394ee5){var _0x56dd30={};_0x56dd30[_0x394ee5]={'$like':'%'+_0x53e076[_0x9c4f('0x43')][_0x9c4f('0x6a')]+'%'};return _0x56dd30;})});}if(_0x53e076[_0x9c4f('0x43')]['$gte']){var _0x53931d=_0x53e076[_0x9c4f('0x43')]['$gte'][_0x9c4f('0xa1')](',');var _0x32523d={};_0x32523d[_0x53931d[0x0]]={'$gte':moment(_0x53931d[0x1])['format'](_0x9c4f('0xa2'))};_0x4f25bb[_0x9c4f('0x4b')]=_[_0x9c4f('0x4d')](_0x4f25bb[_0x9c4f('0x4b')],_0x32523d);}_0x4f25bb=_['merge']({},_0x4f25bb,_0x53e076[_0x9c4f('0x51')]);return db['FaxMessage'][_0x9c4f('0x31')]({'where':_0x4f25bb['where']})[_0x9c4f('0x22')](function(_0x38c10d){_0x33c952[_0x9c4f('0x31')]=_0x38c10d;if(_0x53e076[_0x9c4f('0x43')][_0x9c4f('0x53')]){_0x4f25bb['include']=[{'all':!![]}];}return db[_0x9c4f('0xa3')][_0x9c4f('0x55')](_0x4f25bb);})[_0x9c4f('0x22')](function(_0x4a6d89){_0x33c952[_0x9c4f('0x6b')]=_0x4a6d89;return _0x33c952;});}})[_0x9c4f('0x22')](respondWithFilteredResult(_0x37add4,_0x4f25bb))[_0x9c4f('0x2c')](handleError(_0x37add4,null));};exports[_0x9c4f('0xa4')]=function(_0x1f81d2,_0x30fdc0,_0x41ad47){var _0x88407b,_0x327339={},_0x4b4bd6;if(_0x1f81d2[_0x9c4f('0x61')]['to']){_0x4b4bd6=_0x1f81d2['body']['to'][0x0];}return db[_0x9c4f('0x52')][_0x9c4f('0x57')]({'where':{'id':_0x1f81d2[_0x9c4f('0x62')]['id']},'include':[{'model':db[_0x9c4f('0xa5')],'as':'List','include':[{'model':db[_0x9c4f('0xa6')],'as':_0x9c4f('0xa7'),'where':{'fax':_0x4b4bd6},'limit':0x1,'order':[['updatedAt',_0x9c4f('0xa8')]]}]}]})[_0x9c4f('0x22')](handleEntityNotFound(_0x30fdc0,null))[_0x9c4f('0x22')](function(_0x27ab36){_0x88407b=_0x27ab36;if(_0x1f81d2['body'][_0x9c4f('0xa9')]&&_0x1f81d2[_0x9c4f('0x61')]['attachments'][_0x9c4f('0x56')]){for(var _0x317ca4=0x0;_0x317ca4<_0x1f81d2[_0x9c4f('0x61')][_0x9c4f('0xa9')][_0x9c4f('0x56')];_0x317ca4+=0x1){_0x1f81d2['body'][_0x9c4f('0xa9')][_0x317ca4]={'filename':_0x1f81d2['body'][_0x9c4f('0xa9')][_0x317ca4]['name'],'id':_0x1f81d2['body'][_0x9c4f('0xa9')][_0x317ca4]['id'],'path':path[_0x9c4f('0xaa')](config[_0x9c4f('0xab')],_0x9c4f('0xac'),_0x1f81d2['body'][_0x9c4f('0xa9')][_0x317ca4][_0x9c4f('0xad')])};}}return respondWithRpcPromise('CheckAfterSend',_0x9c4f('0xae'),{'FaxAccountId':_[_0x9c4f('0xaf')](_0x1f81d2[_0x9c4f('0x62')]['id'])?undefined:_0x1f81d2[_0x9c4f('0x62')]['id'],'path':_[_0x9c4f('0xaf')](_0x1f81d2[_0x9c4f('0x61')][_0x9c4f('0xa9')][0x0]['path'])?undefined:_0x1f81d2[_0x9c4f('0x61')][_0x9c4f('0xa9')][0x0]['path'],'fax':_[_0x9c4f('0xaf')](_0x1f81d2[_0x9c4f('0x61')]['to'][0x0])?undefined:_0x1f81d2[_0x9c4f('0x61')]['to'][0x0]},client9002);})[_0x9c4f('0x22')](function(){if(_0x88407b){if(_['isNil'](_0x1f81d2[_0x9c4f('0x61')][_0x9c4f('0xb0')])){_0x1f81d2[_0x9c4f('0x61')][_0x9c4f('0xb0')]=util[_0x9c4f('0xb1')]('\x22%s\x22\x20<%s>',_0x88407b[_0x9c4f('0x3c')],_0x88407b['fax']);}if(_0x88407b[_0x9c4f('0xb2')]){if(_0x88407b[_0x9c4f('0xb2')]['Contacts'][_0x9c4f('0x56')]){return _0x88407b[_0x9c4f('0xb2')]['Contacts'][0x0];}else{return db['CmContact'][_0x9c4f('0x58')](_[_0x9c4f('0x1a')](_0x1f81d2['body'],{'firstName':_0x1f81d2['body']['to'][0x0],'phone':_0x1f81d2[_0x9c4f('0x61')]['to'][0x0],'fax':_0x1f81d2[_0x9c4f('0x61')]['to'][0x0],'ListId':_0x88407b[_0x9c4f('0xb3')]}));}}else{throw new Error(_0x9c4f('0xb4'));}}else{throw new Error(_0x9c4f('0xb5'));}})[_0x9c4f('0x22')](function(_0x3f8c1){if(_0x3f8c1){return db[_0x9c4f('0x73')][_0x9c4f('0x57')]({'where':{'ContactId':_0x3f8c1['id'],'closed':![],'FaxAccountId':_0x88407b['id']}})['then'](function(_0x4b0812){if(_0x4b0812){return[_0x4b0812,![]];}return db[_0x9c4f('0x73')][_0x9c4f('0x58')]({'UserId':_0x1f81d2[_0x9c4f('0x5b')]['id'],'ContactId':_0x3f8c1['id'],'FaxAccountId':_0x88407b['id'],'fax':_0x1f81d2['body']['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x9c4f('0x4d')](_0x1f81d2[_0x9c4f('0x61')],{'read':![],'body':_0x1f81d2['body'][_0x9c4f('0xa9')][0x0][_0x9c4f('0xb6')],'FaxAccountId':_0x88407b['id'],'UserId':_0x1f81d2[_0x9c4f('0x5b')]['id'],'ContactId':_0x3f8c1['id'],'AttachmentId':_0x1f81d2[_0x9c4f('0x61')][_0x9c4f('0xa9')][0x0]['id']})]},{'include':[{'model':db[_0x9c4f('0xa3')],'as':_0x9c4f('0xb7')}]})[_0x9c4f('0x22')](function(_0x432ce3){return[_0x432ce3,!![]];});});}else{throw new Error(_0x9c4f('0xb8'));}})[_0x9c4f('0xb9')](function(_0x6af67b,_0x4f9790){if(_0x4f9790){return _0x6af67b;}return db[_0x9c4f('0xa3')][_0x9c4f('0x58')]({'direction':'out','read':![],'body':_0x1f81d2[_0x9c4f('0x61')][_0x9c4f('0xa9')][0x0]['filename'],'FaxAccountId':_0x88407b['id'],'FaxInteractionId':_0x6af67b['id'],'UserId':_0x1f81d2[_0x9c4f('0x5b')]['id'],'ContactId':_0x6af67b[_0x9c4f('0xba')],'AttachmentId':_0x1f81d2[_0x9c4f('0x61')][_0x9c4f('0xa9')][0x0]['id']})[_0x9c4f('0x22')](function(_0xbea168){_0x6af67b['dataValues'][_0x9c4f('0xb7')]=[];_0x6af67b[_0x9c4f('0xbb')]['Messages'][_0x9c4f('0x8b')](_0xbea168['dataValues']);return _0x6af67b;});})['then'](function(_0xacf6e6){respondWithRpcPromise('SendFax',_0x9c4f('0xbc'),{'FaxAccountId':_['isNil'](_0x1f81d2[_0x9c4f('0x62')]['id'])?undefined:_0x1f81d2[_0x9c4f('0x62')]['id'],'path':_['isNil'](_0x1f81d2['body'][_0x9c4f('0xa9')][0x0][_0x9c4f('0x8')])?undefined:_0x1f81d2[_0x9c4f('0x61')][_0x9c4f('0xa9')][0x0][_0x9c4f('0x8')],'fax':_[_0x9c4f('0xaf')](_0x1f81d2[_0x9c4f('0x61')]['to'][0x0])?undefined:_0x1f81d2['body']['to'][0x0],'AttachmentId':_0x1f81d2[_0x9c4f('0x61')][_0x9c4f('0xa9')][0x0]['id']},client9002)[_0x9c4f('0x22')](function(_0x42d321){logger[_0x9c4f('0x2a')](_0x9c4f('0xbd'),_0x42d321);})['catch'](function(_0x2298e7){logger['info'](_0x9c4f('0xbd'),_0x2298e7);});return _0xacf6e6;})['then'](respondWithResult(_0x30fdc0,null))[_0x9c4f('0x2c')](handleError(_0x30fdc0,null));};exports['addAgents']=function(_0x343b08,_0x4cec52,_0x399309){return db[_0x9c4f('0x52')][_0x9c4f('0x57')]({'where':{'id':_0x343b08[_0x9c4f('0x62')]['id']}})[_0x9c4f('0x22')](handleEntityNotFound(_0x4cec52,null))[_0x9c4f('0x22')](function(_0x4755f8){if(_0x4755f8){return _0x4755f8[_0x9c4f('0xbe')](_0x343b08[_0x9c4f('0x61')][_0x9c4f('0x6d')],_['omit'](_0x343b08[_0x9c4f('0x61')],[_0x9c4f('0x6d'),'id'])||{})[_0x9c4f('0xb9')](function(_0x53217e){for(var _0x18d3aa=0x0;_0x18d3aa<_0x343b08[_0x9c4f('0x61')][_0x9c4f('0x6d')][_0x9c4f('0x56')];_0x18d3aa+=0x1){socket['emit'](_0x9c4f('0xbf'),{'UserId':_0x343b08['body'][_0x9c4f('0x6d')][_0x18d3aa],'FaxAccountId':_0x343b08[_0x9c4f('0x62')]['id']});}return _0x53217e;});}})[_0x9c4f('0x22')](respondWithResult(_0x4cec52,null))['catch'](handleError(_0x4cec52,null));};exports[_0x9c4f('0xc0')]=function(_0x1122de,_0x53c204,_0x4640c2){return db[_0x9c4f('0x52')][_0x9c4f('0x57')]({'where':{'id':_0x1122de['params']['id']}})[_0x9c4f('0x22')](handleEntityNotFound(_0x53c204,null))[_0x9c4f('0x22')](function(_0x396f82){if(_0x396f82){return _0x396f82[_0x9c4f('0xc0')](_0x1122de[_0x9c4f('0x43')][_0x9c4f('0x6d')])['then'](function(){if(_[_0x9c4f('0xc1')](_0x1122de[_0x9c4f('0x43')][_0x9c4f('0x6d')])){for(var _0x48164a=0x0;_0x48164a<_0x1122de[_0x9c4f('0x43')][_0x9c4f('0x6d')]['length'];_0x48164a+=0x1){socket[_0x9c4f('0xc2')]('userFaxAccount:remove',{'UserId':Number(_0x1122de['query'][_0x9c4f('0x6d')][_0x48164a]),'FaxAccountId':Number(_0x1122de['params']['id'])});}}else{socket[_0x9c4f('0xc2')]('userFaxAccount:remove',{'UserId':Number(_0x1122de[_0x9c4f('0x43')][_0x9c4f('0x6d')]),'FaxAccountId':Number(_0x1122de[_0x9c4f('0x62')]['id'])});}});}})[_0x9c4f('0x22')](respondWithStatusCode(_0x53c204,null))[_0x9c4f('0x2c')](handleError(_0x53c204,null));};exports[_0x9c4f('0xc3')]=function(_0x8295e1,_0x49e884,_0x407ac1){var _0x4fcf73={};var _0x3da918={};var _0x40e26d;var _0x215b54;return db[_0x9c4f('0x52')][_0x9c4f('0x66')]({'where':{'id':_0x8295e1[_0x9c4f('0x62')]['id']}})[_0x9c4f('0x22')](handleEntityNotFound(_0x49e884,null))[_0x9c4f('0x22')](function(_0x339e3f){if(_0x339e3f){_0x40e26d=_0x339e3f;_0x3da918['model']=_[_0x9c4f('0x42')](db[_0x9c4f('0x75')][_0x9c4f('0x40')]);_0x3da918[_0x9c4f('0x43')]=_[_0x9c4f('0x42')](_0x8295e1['query']);_0x3da918[_0x9c4f('0x44')]=_[_0x9c4f('0x45')](_0x3da918[_0x9c4f('0x41')],_0x3da918['query']);_0x4fcf73[_0x9c4f('0x47')]=_[_0x9c4f('0x45')](_0x3da918[_0x9c4f('0x41')],qs[_0x9c4f('0x46')](_0x8295e1[_0x9c4f('0x43')][_0x9c4f('0x46')]));_0x4fcf73['attributes']=_0x4fcf73[_0x9c4f('0x47')][_0x9c4f('0x56')]?_0x4fcf73[_0x9c4f('0x47')]:_0x3da918['model'];_0x4fcf73[_0x9c4f('0x49')]=qs[_0x9c4f('0x4a')](_0x8295e1[_0x9c4f('0x43')][_0x9c4f('0x4a')]);_0x4fcf73[_0x9c4f('0x4b')]=qs[_0x9c4f('0x44')](_[_0x9c4f('0x4c')](_0x8295e1[_0x9c4f('0x43')],_0x3da918['filters']));if(_0x8295e1[_0x9c4f('0x43')][_0x9c4f('0x6a')]){_0x4fcf73[_0x9c4f('0x4b')]=_['merge'](_0x4fcf73['where'],{'$or':_['map'](_0x4fcf73[_0x9c4f('0x47')],function(_0x1a83a7){var _0x4235d0={};_0x4235d0[_0x1a83a7]={'$like':'%'+_0x8295e1[_0x9c4f('0x43')][_0x9c4f('0x6a')]+'%'};return _0x4235d0;})});}_0x4fcf73=_['merge']({},_0x4fcf73,_0x8295e1[_0x9c4f('0x51')]);return _0x40e26d['getAgents'](_0x4fcf73);}})['then'](function(_0x365693){if(_0x365693){_0x215b54=_0x365693[_0x9c4f('0x56')];if(!_0x8295e1[_0x9c4f('0x43')][_0x9c4f('0x48')](_0x9c4f('0x68'))){_0x4fcf73[_0x9c4f('0x33')]=qs[_0x9c4f('0x33')](_0x8295e1[_0x9c4f('0x43')][_0x9c4f('0x33')]);_0x4fcf73[_0x9c4f('0x32')]=qs[_0x9c4f('0x32')](_0x8295e1[_0x9c4f('0x43')][_0x9c4f('0x32')]);}return _0x40e26d[_0x9c4f('0xc3')](_0x4fcf73);}})[_0x9c4f('0x22')](function(_0x5286ba){if(_0x5286ba){return _0x5286ba?{'count':_0x215b54,'rows':_0x5286ba}:null;}})[_0x9c4f('0x22')](respondWithResult(_0x49e884,null))[_0x9c4f('0x2c')](handleError(_0x49e884,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 7e80d83..f2edf38 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 _0xf0e1=['save','update','remove','emit','hasOwnProperty','exports','events','FaxAccount','setMaxListeners'];(function(_0x23d487,_0x166888){var _0x3d2fe7=function(_0x371549){while(--_0x371549){_0x23d487['push'](_0x23d487['shift']());}};_0x3d2fe7(++_0x166888);}(_0xf0e1,0xba));var _0x1f0e=function(_0x22b39b,_0x2b7d63){_0x22b39b=_0x22b39b-0x0;var _0x280e1d=_0xf0e1[_0x22b39b];return _0x280e1d;};'use strict';var EventEmitter=require(_0x1f0e('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0x1f0e('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x1f0e('0x2')](0x0);var events={'afterCreate':_0x1f0e('0x3'),'afterUpdate':_0x1f0e('0x4'),'afterDestroy':_0x1f0e('0x5')};function emitEvent(_0x26cb3e){return function(_0x49a048,_0x58d481,_0x1a0933){FaxAccountEvents[_0x1f0e('0x6')](_0x26cb3e+':'+_0x49a048['id'],_0x49a048);FaxAccountEvents[_0x1f0e('0x6')](_0x26cb3e,_0x49a048);_0x1a0933(null);};}for(var e in events){if(events[_0x1f0e('0x7')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x1f0e('0x8')]=FaxAccountEvents; \ No newline at end of file +var _0x22de=['setMaxListeners','save','emit','hook','events','../../mysqldb','FaxAccount'];(function(_0x4bcf62,_0x19bf41){var _0x1d2dde=function(_0x24d60b){while(--_0x24d60b){_0x4bcf62['push'](_0x4bcf62['shift']());}};_0x1d2dde(++_0x19bf41);}(_0x22de,0x14d));var _0xe22d=function(_0x465f0b,_0x556f79){_0x465f0b=_0x465f0b-0x0;var _0x2c4daf=_0x22de[_0x465f0b];return _0x2c4daf;};'use strict';var EventEmitter=require(_0xe22d('0x0'));var FaxAccount=require(_0xe22d('0x1'))['db'][_0xe22d('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xe22d('0x3')](0x0);var events={'afterCreate':_0xe22d('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x58c5dc){return function(_0x122556,_0x2a9b64,_0x1538c9){FaxAccountEvents['emit'](_0x58c5dc+':'+_0x122556['id'],_0x122556);FaxAccountEvents[_0xe22d('0x5')](_0x58c5dc,_0x122556);_0x1538c9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0xe22d('0x6')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 27ef2ca..713c7c0 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 _0x1d57=['moment','bluebird','request-promise','../../config/environment','exports','fax_accounts','lodash','util','../../config/logger','api'];(function(_0x39877f,_0x5bce84){var _0x5ca237=function(_0x4ebf40){while(--_0x4ebf40){_0x39877f['push'](_0x39877f['shift']());}};_0x5ca237(++_0x5bce84);}(_0x1d57,0x1a0));var _0x71d5=function(_0x1f52f5,_0x404fcc){_0x1f52f5=_0x1f52f5-0x0;var _0x3921be=_0x1d57[_0x1f52f5];return _0x3921be;};'use strict';var _=require(_0x71d5('0x0'));var util=require(_0x71d5('0x1'));var logger=require(_0x71d5('0x2'))(_0x71d5('0x3'));var moment=require(_0x71d5('0x4'));var BPromise=require(_0x71d5('0x5'));var rp=require(_0x71d5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x71d5('0x7'));var attributes=require('./faxAccount.attributes');module[_0x71d5('0x8')]=function(_0x54ec62,_0x327000){return _0x54ec62['define']('FaxAccount',attributes,{'tableName':_0x71d5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7253=['api','moment','bluebird','path','rimraf','exports','FaxAccount','fax_accounts','lodash','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7253,0x1f2));var _0x3725=function(_0x2cfc71,_0x2f870f){_0x2cfc71=_0x2cfc71-0x0;var _0x2a9015=_0x7253[_0x2cfc71];return _0x2a9015;};'use strict';var _=require(_0x3725('0x0'));var util=require(_0x3725('0x1'));var logger=require('../../config/logger')(_0x3725('0x2'));var moment=require(_0x3725('0x3'));var BPromise=require(_0x3725('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3725('0x5'));var rimraf=require(_0x3725('0x6'));var config=require('../../config/environment');var attributes=require('./faxAccount.attributes');module[_0x3725('0x7')]=function(_0x3742af,_0x4d511e){return _0x3742af['define'](_0x3725('0x8'),attributes,{'tableName':_0x3725('0x9'),'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 5fcb120..f4968c7 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 _0x3cfa=['include','map','model','then','NotifyFaxAccount','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','keys','updatedAt','difference','CompanyId','ListId','body','isNil','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','account','CmList','Contacts','FaxApplication','List','get','applications','Applications','list','orderBy','priority','asc','create','contact','FaxInteraction','find','Contact\x20not\x20found','autoclose','push','close','unmanaged','*,*,*,*','created','ContactId','AttachmentId','interaction','UserId','User','name','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit'];(function(_0x1225af,_0x45c54f){var _0x3cacc3=function(_0xdca4d8){while(--_0xdca4d8){_0x1225af['push'](_0x1225af['shift']());}};_0x3cacc3(++_0x45c54f);}(_0x3cfa,0x14e));var _0xa3cf=function(_0x29f854,_0x898bc2){_0x29f854=_0x29f854-0x0;var _0x3b13e1=_0x3cfa[_0x29f854];return _0x3b13e1;};'use strict';var _=require(_0xa3cf('0x0'));var util=require(_0xa3cf('0x1'));var moment=require(_0xa3cf('0x2'));var BPromise=require(_0xa3cf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa3cf('0x4'));var db=require(_0xa3cf('0x5'))['db'];var utils=require(_0xa3cf('0x6'));var logger=require(_0xa3cf('0x7'))('rpc');var config=require(_0xa3cf('0x8'));var jayson=require(_0xa3cf('0x9'));var client=jayson[_0xa3cf('0xa')][_0xa3cf('0xb')]({'port':0x232c});config[_0xa3cf('0xc')]=_[_0xa3cf('0xd')](config[_0xa3cf('0xc')],{'host':_0xa3cf('0xe'),'port':0x18eb});var socket=require(_0xa3cf('0xf'))(new Redis(config[_0xa3cf('0xc')]));require(_0xa3cf('0x10'))[_0xa3cf('0x11')](socket);function respondWithRpcPromise(_0x246030,_0x4ac88c,_0x11b36b){return new BPromise(function(_0x3b51ad,_0x46e6da){return client[_0xa3cf('0x12')](_0x246030,_0x11b36b)['then'](function(_0x3b7960){logger[_0xa3cf('0x13')](_0xa3cf('0x14'),_0x4ac88c,_0xa3cf('0x15'));logger[_0xa3cf('0x16')](_0xa3cf('0x17'),_0x4ac88c,_0xa3cf('0x15'),JSON[_0xa3cf('0x18')](_0x3b7960));if(_0x3b7960[_0xa3cf('0x19')]){if(_0x3b7960['error'][_0xa3cf('0x1a')]===0x1f4){logger[_0xa3cf('0x19')](_0xa3cf('0x14'),_0x4ac88c,_0x3b7960[_0xa3cf('0x19')][_0xa3cf('0x1b')]);return _0x46e6da(_0x3b7960[_0xa3cf('0x19')][_0xa3cf('0x1b')]);}logger[_0xa3cf('0x19')](_0xa3cf('0x14'),_0x4ac88c,_0x3b7960[_0xa3cf('0x19')]['message']);return _0x3b51ad(_0x3b7960[_0xa3cf('0x19')]['message']);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0x4ac88c,_0xa3cf('0x15'));_0x3b51ad(_0x3b7960[_0xa3cf('0x1c')][_0xa3cf('0x1b')]);}})[_0xa3cf('0x1d')](function(_0x21e45e){logger[_0xa3cf('0x19')](_0xa3cf('0x14'),_0x4ac88c,_0x21e45e);_0x46e6da(_0x21e45e);});});}exports[_0xa3cf('0x1e')]=function(_0x4db212){var _0x2eb19d=this;return new Promise(function(_0x4d2789,_0x32ffc1){return db[_0xa3cf('0x1f')][_0xa3cf('0x20')]({'raw':_0x4db212[_0xa3cf('0x21')]?_0x4db212['options'][_0xa3cf('0x22')]===undefined?!![]:![]:!![],'where':_0x4db212[_0xa3cf('0x21')]?_0x4db212[_0xa3cf('0x21')][_0xa3cf('0x23')]||null:null,'attributes':_0x4db212[_0xa3cf('0x21')]?_0x4db212['options'][_0xa3cf('0x24')]||null:null,'limit':_0x4db212[_0xa3cf('0x21')]?_0x4db212[_0xa3cf('0x21')][_0xa3cf('0x25')]||null:null,'include':_0x4db212['options']?_0x4db212['options'][_0xa3cf('0x26')]?_[_0xa3cf('0x27')](_0x4db212[_0xa3cf('0x21')][_0xa3cf('0x26')],function(_0x358afd){return{'model':db[_0x358afd[_0xa3cf('0x28')]],'as':_0x358afd['as'],'attributes':_0x358afd[_0xa3cf('0x24')],'include':_0x358afd[_0xa3cf('0x26')]?_[_0xa3cf('0x27')](_0x358afd[_0xa3cf('0x26')],function(_0x57aa88){return{'model':db[_0x57aa88[_0xa3cf('0x28')]],'as':_0x57aa88['as'],'attributes':_0x57aa88[_0xa3cf('0x24')],'include':_0x57aa88[_0xa3cf('0x26')]?_[_0xa3cf('0x27')](_0x57aa88[_0xa3cf('0x26')],function(_0x5a6876){return{'model':db[_0x5a6876[_0xa3cf('0x28')]],'as':_0x5a6876['as'],'attributes':_0x5a6876[_0xa3cf('0x24')]};}):[]};}):[]};}):[]:[]})[_0xa3cf('0x29')](function(_0x224ebc){logger[_0xa3cf('0x13')](_0xa3cf('0x1e'),_0x4db212);logger['debug']('GetFaxAccount',_0x4db212,JSON[_0xa3cf('0x18')](_0x224ebc));_0x4d2789(_0x224ebc);})[_0xa3cf('0x1d')](function(_0x47f575){logger[_0xa3cf('0x19')]('GetFaxAccount',_0x47f575[_0xa3cf('0x1b')],_0x4db212);_0x32ffc1(_0x2eb19d[_0xa3cf('0x19')](0x1f4,_0x47f575[_0xa3cf('0x1b')]));});});};exports[_0xa3cf('0x2a')]=function(_0x1336a1,_0x297f63,_0x4d2d6c){var _0x5cf089=this;return new Promise(function(_0x4aa614,_0x148651){var _0x4add2b={'body':_0x1336a1['body'],'channel':_0xa3cf('0x2b')};var _0x229994=[];var _0x25c58=[];var _0x3fc244={};return db[_0xa3cf('0x2c')][_0xa3cf('0x2d')]()['then'](function(_0x3bd493){if(!_0x3bd493){throw new db[(_0xa3cf('0x2e'))][(_0xa3cf('0x2f'))](_0xa3cf('0x30'));}_0x229994=_['difference'](_[_0xa3cf('0x31')](_0x3bd493),['createdAt',_0xa3cf('0x32')]);_0x25c58=_[_0xa3cf('0x33')](_['keys'](_0x3bd493),['createdAt',_0xa3cf('0x32'),_0xa3cf('0x34'),_0xa3cf('0x35')]);if(_0x1336a1[_0xa3cf('0x36')]['id']){delete _0x1336a1['body']['id'];}if(_[_0xa3cf('0x37')](_0x1336a1['body']['from'])){throw new db['Sequelize'][(_0xa3cf('0x2f'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x1336a1['body'][_0xa3cf('0x36')])||_0x1336a1[_0xa3cf('0x36')][_0xa3cf('0x36')]===''){throw new db['Sequelize'][(_0xa3cf('0x2f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xa3cf('0x37')](_0x1336a1[_0xa3cf('0x36')]['mapKey'])){throw new db[(_0xa3cf('0x2e'))]['ValidationError'](_0xa3cf('0x38')+_0x25c58);}if(!_['includes'](_0x25c58,_0x1336a1[_0xa3cf('0x36')][_0xa3cf('0x39')])){throw new db[(_0xa3cf('0x2e'))][(_0xa3cf('0x2f'))](_0xa3cf('0x3a')+_0x25c58);}_0x3fc244[_0x1336a1[_0xa3cf('0x36')][_0xa3cf('0x39')]]=_0x1336a1['body'][_0xa3cf('0x3b')];})[_0xa3cf('0x29')](function(){return db[_0xa3cf('0x1f')]['find']({'where':{'id':_0x1336a1[_0xa3cf('0x3c')]['id']},'include':[{'model':db[_0xa3cf('0x3d')],'as':'List','include':[{'model':db[_0xa3cf('0x2c')],'as':_0xa3cf('0x3e'),'where':_0x3fc244,'limit':0x1,'order':[[_0xa3cf('0x32'),'DESC']]}]},{'model':db[_0xa3cf('0x3f')],'as':'Applications'}]});})['then'](function(_0x311de1){if(_0x311de1&&_0x311de1[_0xa3cf('0x40')]){var _0x1c43e=_0x311de1[_0xa3cf('0x41')]({'plain':!![]});_0x4add2b['account']=_0x1c43e;_0x4add2b[_0xa3cf('0x42')]=_0x1c43e[_0xa3cf('0x43')];_0x4add2b[_0xa3cf('0x44')]=_0x1c43e[_0xa3cf('0x40')];_0x4add2b[_0xa3cf('0x42')]=_[_0xa3cf('0x45')](_0x4add2b['applications'],[_0xa3cf('0x46')],[_0xa3cf('0x47')]);if(_0x4add2b[_0xa3cf('0x3c')]['Applications']){delete _0x4add2b[_0xa3cf('0x3c')][_0xa3cf('0x43')];}if(_0x4add2b['account'][_0xa3cf('0x40')]&&_0x4add2b[_0xa3cf('0x3c')][_0xa3cf('0x40')][_0xa3cf('0x3e')]['length']){return _0x4add2b[_0xa3cf('0x3c')][_0xa3cf('0x40')][_0xa3cf('0x3e')][0x0];}var _0x44106d=_[_0xa3cf('0xd')](_0x1336a1[_0xa3cf('0x36')],{'firstName':_0x1336a1[_0xa3cf('0x36')]['from'],'ListId':_0x1c43e['ListId']});_0x44106d[_0x1336a1[_0xa3cf('0x36')][_0xa3cf('0x39')]]=_0x1336a1[_0xa3cf('0x36')][_0xa3cf('0x3b')];return db[_0xa3cf('0x2c')][_0xa3cf('0x48')](_0x44106d,{'fields':_0x229994,'raw':!![]});}})[_0xa3cf('0x29')](function(_0x591fe7){_0x4add2b[_0xa3cf('0x49')]=_0x591fe7;if(_0x591fe7){var _0xe9dfa={'ContactId':_0x591fe7['id'],'FaxAccountId':_0x1336a1[_0xa3cf('0x3c')]['id'],'fax':_0x591fe7[_0xa3cf('0x2b')]};return db[_0xa3cf('0x4a')][_0xa3cf('0x4b')]({'where':{'ContactId':_0x591fe7['id'],'closed':![],'FaxAccountId':_0x1336a1[_0xa3cf('0x3c')]['id']}})[_0xa3cf('0x29')](function(_0x84bfe9){if(_0x84bfe9){return[_0x84bfe9,![]];}return db[_0xa3cf('0x4a')][_0xa3cf('0x48')](_0xe9dfa)[_0xa3cf('0x29')](function(_0x33ec02){return[_0x33ec02,!![]];});});}else{throw new Error(_0xa3cf('0x4c'));}})['spread'](function(_0x1ed540,_0x3be296){var _0xc3ff42=_0x1ed540[_0xa3cf('0x41')]({'plain':!![]});if(_0x3be296){if(_0x4add2b['account'][_0xa3cf('0x4d')]){_0x4add2b[_0xa3cf('0x42')][_0xa3cf('0x4e')]({'id':0x0,'priority':_0x4add2b[_0xa3cf('0x42')]['length']+0x1,'app':_0xa3cf('0x4f'),'appdata':_0xa3cf('0x50'),'interval':_0xa3cf('0x51')});}_0xc3ff42[_0xa3cf('0x52')]=!![];}else{_0xc3ff42['created']=![];}_0x4add2b['interaction']=_0xc3ff42;return db['FaxMessage'][_0xa3cf('0x48')]({'body':_0x1336a1['body'][_0xa3cf('0x36')],'FaxAccountId':_0x1336a1[_0xa3cf('0x3c')]['id'],'FaxInteractionId':_0x1ed540['id'],'direction':'in','ContactId':_0x1ed540[_0xa3cf('0x53')],'AttachmentId':_0x1336a1[_0xa3cf('0x36')][_0xa3cf('0x54')]});})['then'](function(_0x2215b6){_0x4add2b['message']=_0x2215b6;if(_0x4add2b[_0xa3cf('0x55')][_0xa3cf('0x56')]){return db[_0xa3cf('0x57')][_0xa3cf('0x4b')]({'attributes':['id',_0xa3cf('0x58')],'where':{'id':_0x4add2b[_0xa3cf('0x55')][_0xa3cf('0x56')]}})[_0xa3cf('0x29')](function(_0x4c5482){if(_0x4c5482){_0x4add2b[_0xa3cf('0x42')]['unshift']({'id':0x0,'priority':0x0,'app':_0xa3cf('0x59'),'appdata':_0x4c5482[_0xa3cf('0x58')]+','+(_0x4add2b[_0xa3cf('0x3c')][_0xa3cf('0x5a')]||0xa),'interval':_0xa3cf('0x51')});}return respondWithRpcPromise(_0xa3cf('0x5b'),_0xa3cf('0x5c'),_0x4add2b);});}return respondWithRpcPromise(_0xa3cf('0x5b'),_0xa3cf('0x5c'),_0x4add2b);})['then'](function(_0x28954c){_0x4aa614(_0x28954c);})[_0xa3cf('0x1d')](function(_0x4fa3a5){_0x148651(_0x5cf089['error'](0x1f4,_0x4fa3a5['message']));});});}; \ No newline at end of file +var _0x88f8=['mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','find','account','CmList','Contacts','DESC','FaxApplication','Applications','List','get','applications','list','asc','length','defaults','create','fax','FaxInteraction','Contact\x20not\x20found','spread','autoclose','unmanaged','*,*,*,*','interaction','ContactId','AttachmentId','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxAccount.socket','register','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','GetFaxAccount','FaxAccount','options','raw','where','attributes','include','model','map','stringify','NotifyFaxAccount','CmContact','describe','Sequelize','ValidationError','difference','keys','createdAt','updatedAt','ListId','body','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey'];(function(_0x41fe2d,_0x4b64a2){var _0x5e0f67=function(_0x41ba88){while(--_0x41ba88){_0x41fe2d['push'](_0x41fe2d['shift']());}};_0x5e0f67(++_0x4b64a2);}(_0x88f8,0xd4));var _0x888f=function(_0x4e036a,_0x28c49a){_0x4e036a=_0x4e036a-0x0;var _0x2b6dd4=_0x88f8[_0x4e036a];return _0x2b6dd4;};'use strict';var _=require('lodash');var util=require(_0x888f('0x0'));var moment=require('moment');var BPromise=require(_0x888f('0x1'));var rs=require(_0x888f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x888f('0x3'))['db'];var utils=require(_0x888f('0x4'));var logger=require(_0x888f('0x5'))(_0x888f('0x6'));var config=require(_0x888f('0x7'));var jayson=require(_0x888f('0x8'));var client=jayson[_0x888f('0x9')][_0x888f('0xa')]({'port':0x232c});config[_0x888f('0xb')]=_['defaults'](config[_0x888f('0xb')],{'host':_0x888f('0xc'),'port':0x18eb});var socket=require(_0x888f('0xd'))(new Redis(config[_0x888f('0xb')]));require(_0x888f('0xe'))[_0x888f('0xf')](socket);function respondWithRpcPromise(_0x4ecc64,_0x1d4f47,_0x53a2c3){return new BPromise(function(_0x4b0490,_0x39937f){return client['request'](_0x4ecc64,_0x53a2c3)[_0x888f('0x10')](function(_0xe21f56){logger[_0x888f('0x11')](_0x888f('0x12'),_0x1d4f47,_0x888f('0x13'));logger[_0x888f('0x14')](_0x888f('0x15'),_0x1d4f47,_0x888f('0x13'),JSON['stringify'](_0xe21f56));if(_0xe21f56[_0x888f('0x16')]){if(_0xe21f56[_0x888f('0x16')][_0x888f('0x17')]===0x1f4){logger[_0x888f('0x16')](_0x888f('0x12'),_0x1d4f47,_0xe21f56['error'][_0x888f('0x18')]);return _0x39937f(_0xe21f56['error'][_0x888f('0x18')]);}logger[_0x888f('0x16')](_0x888f('0x12'),_0x1d4f47,_0xe21f56[_0x888f('0x16')]['message']);return _0x4b0490(_0xe21f56['error'][_0x888f('0x18')]);}else{logger[_0x888f('0x11')](_0x888f('0x12'),_0x1d4f47,_0x888f('0x13'));_0x4b0490(_0xe21f56[_0x888f('0x19')][_0x888f('0x18')]);}})['catch'](function(_0x3378fd){logger[_0x888f('0x16')](_0x888f('0x12'),_0x1d4f47,_0x3378fd);_0x39937f(_0x3378fd);});});}exports[_0x888f('0x1a')]=function(_0x4d6ccd){var _0x51dcb5=this;return new Promise(function(_0x39e3e5,_0x106566){return db[_0x888f('0x1b')]['findAll']({'raw':_0x4d6ccd['options']?_0x4d6ccd[_0x888f('0x1c')][_0x888f('0x1d')]===undefined?!![]:![]:!![],'where':_0x4d6ccd['options']?_0x4d6ccd[_0x888f('0x1c')][_0x888f('0x1e')]||null:null,'attributes':_0x4d6ccd[_0x888f('0x1c')]?_0x4d6ccd['options'][_0x888f('0x1f')]||null:null,'limit':_0x4d6ccd['options']?_0x4d6ccd[_0x888f('0x1c')]['limit']||null:null,'include':_0x4d6ccd[_0x888f('0x1c')]?_0x4d6ccd[_0x888f('0x1c')][_0x888f('0x20')]?_['map'](_0x4d6ccd[_0x888f('0x1c')]['include'],function(_0x3d9886){return{'model':db[_0x3d9886[_0x888f('0x21')]],'as':_0x3d9886['as'],'attributes':_0x3d9886['attributes'],'include':_0x3d9886[_0x888f('0x20')]?_[_0x888f('0x22')](_0x3d9886[_0x888f('0x20')],function(_0x4c415e){return{'model':db[_0x4c415e[_0x888f('0x21')]],'as':_0x4c415e['as'],'attributes':_0x4c415e[_0x888f('0x1f')],'include':_0x4c415e[_0x888f('0x20')]?_['map'](_0x4c415e[_0x888f('0x20')],function(_0x12eb87){return{'model':db[_0x12eb87['model']],'as':_0x12eb87['as'],'attributes':_0x12eb87[_0x888f('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x888f('0x10')](function(_0x3d1e15){logger[_0x888f('0x11')](_0x888f('0x1a'),_0x4d6ccd);logger[_0x888f('0x14')](_0x888f('0x1a'),_0x4d6ccd,JSON[_0x888f('0x23')](_0x3d1e15));_0x39e3e5(_0x3d1e15);})['catch'](function(_0x2f13ac){logger[_0x888f('0x16')](_0x888f('0x1a'),_0x2f13ac[_0x888f('0x18')],_0x4d6ccd);_0x106566(_0x51dcb5[_0x888f('0x16')](0x1f4,_0x2f13ac[_0x888f('0x18')]));});});};exports[_0x888f('0x24')]=function(_0x189425,_0x4d76a7,_0xfdb56e){var _0x1105d4=this;return new Promise(function(_0x244e31,_0x4e3cb7){var _0x1cd269={'body':_0x189425['body'],'channel':'fax'};var _0x34bbeb=[];var _0x39a877=[];var _0xb2c3e0={};return db[_0x888f('0x25')][_0x888f('0x26')]()[_0x888f('0x10')](function(_0x2519d1){if(!_0x2519d1){throw new db[(_0x888f('0x27'))][(_0x888f('0x28'))]('no\x20available\x20attributes');}_0x34bbeb=_[_0x888f('0x29')](_[_0x888f('0x2a')](_0x2519d1),['createdAt','updatedAt']);_0x39a877=_[_0x888f('0x29')](_[_0x888f('0x2a')](_0x2519d1),[_0x888f('0x2b'),_0x888f('0x2c'),'CompanyId',_0x888f('0x2d')]);if(_0x189425['body']['id']){delete _0x189425[_0x888f('0x2e')]['id'];}if(_['isNil'](_0x189425[_0x888f('0x2e')][_0x888f('0x2f')])){throw new db[(_0x888f('0x27'))][(_0x888f('0x28'))](_0x888f('0x30'));}if(_[_0x888f('0x31')](_0x189425[_0x888f('0x2e')][_0x888f('0x2e')])||_0x189425[_0x888f('0x2e')][_0x888f('0x2e')]===''){throw new db[(_0x888f('0x27'))]['ValidationError'](_0x888f('0x32'));}if(_[_0x888f('0x31')](_0x189425[_0x888f('0x2e')][_0x888f('0x33')])){throw new db[(_0x888f('0x27'))][(_0x888f('0x28'))](_0x888f('0x34')+_0x39a877);}if(!_[_0x888f('0x35')](_0x39a877,_0x189425[_0x888f('0x2e')][_0x888f('0x33')])){throw new db['Sequelize'][(_0x888f('0x28'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x39a877);}_0xb2c3e0[_0x189425[_0x888f('0x2e')][_0x888f('0x33')]]=_0x189425[_0x888f('0x2e')]['from'];})[_0x888f('0x10')](function(){return db[_0x888f('0x1b')][_0x888f('0x36')]({'where':{'id':_0x189425[_0x888f('0x37')]['id']},'include':[{'model':db[_0x888f('0x38')],'as':'List','include':[{'model':db[_0x888f('0x25')],'as':_0x888f('0x39'),'where':_0xb2c3e0,'limit':0x1,'order':[[_0x888f('0x2c'),_0x888f('0x3a')]]}]},{'model':db[_0x888f('0x3b')],'as':_0x888f('0x3c')}]});})[_0x888f('0x10')](function(_0x5c601c){if(_0x5c601c&&_0x5c601c[_0x888f('0x3d')]){var _0x39a53a=_0x5c601c[_0x888f('0x3e')]({'plain':!![]});_0x1cd269[_0x888f('0x37')]=_0x39a53a;_0x1cd269[_0x888f('0x3f')]=_0x39a53a[_0x888f('0x3c')];_0x1cd269[_0x888f('0x40')]=_0x39a53a['List'];_0x1cd269['applications']=_['orderBy'](_0x1cd269[_0x888f('0x3f')],['priority'],[_0x888f('0x41')]);if(_0x1cd269['account'][_0x888f('0x3c')]){delete _0x1cd269[_0x888f('0x37')][_0x888f('0x3c')];}if(_0x1cd269['account'][_0x888f('0x3d')]&&_0x1cd269[_0x888f('0x37')][_0x888f('0x3d')][_0x888f('0x39')][_0x888f('0x42')]){return _0x1cd269[_0x888f('0x37')][_0x888f('0x3d')][_0x888f('0x39')][0x0];}var _0x3b42af=_[_0x888f('0x43')](_0x189425[_0x888f('0x2e')],{'firstName':_0x189425['body'][_0x888f('0x2f')],'ListId':_0x39a53a['ListId']});_0x3b42af[_0x189425[_0x888f('0x2e')][_0x888f('0x33')]]=_0x189425[_0x888f('0x2e')][_0x888f('0x2f')];return db['CmContact'][_0x888f('0x44')](_0x3b42af,{'fields':_0x34bbeb,'raw':!![]});}})['then'](function(_0x411643){_0x1cd269['contact']=_0x411643;if(_0x411643){var _0x2717dc={'ContactId':_0x411643['id'],'FaxAccountId':_0x189425[_0x888f('0x37')]['id'],'fax':_0x411643[_0x888f('0x45')]};return db[_0x888f('0x46')][_0x888f('0x36')]({'where':{'ContactId':_0x411643['id'],'closed':![],'FaxAccountId':_0x189425[_0x888f('0x37')]['id']}})[_0x888f('0x10')](function(_0x4aac9f){if(_0x4aac9f){return[_0x4aac9f,![]];}return db[_0x888f('0x46')]['create'](_0x2717dc)['then'](function(_0x193251){return[_0x193251,!![]];});});}else{throw new Error(_0x888f('0x47'));}})[_0x888f('0x48')](function(_0x55d85b,_0x2f7ca9){var _0x200d32=_0x55d85b[_0x888f('0x3e')]({'plain':!![]});if(_0x2f7ca9){if(_0x1cd269[_0x888f('0x37')][_0x888f('0x49')]){_0x1cd269[_0x888f('0x3f')]['push']({'id':0x0,'priority':_0x1cd269[_0x888f('0x3f')][_0x888f('0x42')]+0x1,'app':'close','appdata':_0x888f('0x4a'),'interval':_0x888f('0x4b')});}_0x200d32['created']=!![];}else{_0x200d32['created']=![];}_0x1cd269[_0x888f('0x4c')]=_0x200d32;return db['FaxMessage'][_0x888f('0x44')]({'body':_0x189425[_0x888f('0x2e')]['body'],'FaxAccountId':_0x189425[_0x888f('0x37')]['id'],'FaxInteractionId':_0x55d85b['id'],'direction':'in','ContactId':_0x55d85b[_0x888f('0x4d')],'AttachmentId':_0x189425['body'][_0x888f('0x4e')]});})['then'](function(_0x3a8ba2){_0x1cd269[_0x888f('0x18')]=_0x3a8ba2;if(_0x1cd269[_0x888f('0x4c')][_0x888f('0x4f')]){return db[_0x888f('0x50')][_0x888f('0x36')]({'attributes':['id',_0x888f('0x51')],'where':{'id':_0x1cd269[_0x888f('0x4c')][_0x888f('0x4f')]}})['then'](function(_0x8fadcb){if(_0x8fadcb){_0x1cd269['applications'][_0x888f('0x52')]({'id':0x0,'priority':0x0,'app':_0x888f('0x53'),'appdata':_0x8fadcb[_0x888f('0x51')]+','+(_0x1cd269['account'][_0x888f('0x54')]||0xa),'interval':_0x888f('0x4b')});}return respondWithRpcPromise(_0x888f('0x55'),_0x888f('0x56'),_0x1cd269);});}return respondWithRpcPromise('Start',_0x888f('0x56'),_0x1cd269);})[_0x888f('0x10')](function(_0x33f5be){_0x244e31(_0x33f5be);})[_0x888f('0x57')](function(_0x691cb7){_0x4e3cb7(_0x1105d4[_0x888f('0x16')](0x1f4,_0x691cb7[_0x888f('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index ec5202d..7ff5c9b 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 _0xa199=['length','faxAccount:','./faxAccount.events','remove','update','register'];(function(_0x5a708b,_0x1ac95a){var _0x5f30f4=function(_0xdb29e5){while(--_0xdb29e5){_0x5a708b['push'](_0x5a708b['shift']());}};_0x5f30f4(++_0x1ac95a);}(_0xa199,0xb6));var _0x9a19=function(_0x411783,_0x7c1f21){_0x411783=_0x411783-0x0;var _0x5c461a=_0xa199[_0x411783];return _0x5c461a;};'use strict';var FaxAccountEvents=require(_0x9a19('0x0'));var events=['save',_0x9a19('0x1'),_0x9a19('0x2')];function createListener(_0x45f12a,_0x1c06b7){return function(_0x108e72){_0x1c06b7['emit'](_0x45f12a,_0x108e72);};}function removeListener(_0x1ec833,_0x590ab4){return function(){FaxAccountEvents['removeListener'](_0x1ec833,_0x590ab4);};}exports[_0x9a19('0x3')]=function(_0x5b0dd6){for(var _0xee47dc=0x0,_0x36ec9e=events[_0x9a19('0x4')];_0xee47dc<_0x36ec9e;_0xee47dc++){var _0x129bcb=events[_0xee47dc];var _0x18a26a=createListener(_0x9a19('0x5')+_0x129bcb,_0x5b0dd6);FaxAccountEvents['on'](_0x129bcb,_0x18a26a);}}; \ No newline at end of file +var _0x7b6c=['remove','removeListener','./faxAccount.events','save'];(function(_0x2be5fa,_0x2b1e4f){var _0x1ce11b=function(_0x4afd06){while(--_0x4afd06){_0x2be5fa['push'](_0x2be5fa['shift']());}};_0x1ce11b(++_0x2b1e4f);}(_0x7b6c,0x14e));var _0xc7b6=function(_0x3dbc8c,_0x1b5af2){_0x3dbc8c=_0x3dbc8c-0x0;var _0x9660fc=_0x7b6c[_0x3dbc8c];return _0x9660fc;};'use strict';var FaxAccountEvents=require(_0xc7b6('0x0'));var events=[_0xc7b6('0x1'),_0xc7b6('0x2'),'update'];function createListener(_0x701204,_0x3169a5){return function(_0x2a40e3){_0x3169a5['emit'](_0x701204,_0x2a40e3);};}function removeListener(_0x56057a,_0x7149c0){return function(){FaxAccountEvents[_0xc7b6('0x3')](_0x56057a,_0x7149c0);};}exports['register']=function(_0xf0e1c1){for(var _0x29adec=0x0,_0x105bfa=events['length'];_0x29adec<_0x105bfa;_0x29adec++){var _0x2b66db=events[_0x29adec];var _0x5d2a58=createListener('faxAccount:'+_0x2b66db,_0xf0e1c1);FaxAccountEvents['on'](_0x2b66db,_0x5d2a58);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 1020040..418a9c4 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 _0x3d4d=['/:id','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','/:id/applications','/:id/messages','/:id/users','getAgents','addDisposition','post','addInteraction','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','send','put','update','removeDispositions','delete','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x3e4566,_0x1e02e2){var _0x2eb60f=function(_0x202454){while(--_0x202454){_0x3e4566['push'](_0x3e4566['shift']());}};_0x2eb60f(++_0x1e02e2);}(_0x3d4d,0x8e));var _0xd3d4=function(_0x5ee211,_0x3f31a3){_0x5ee211=_0x5ee211-0x0;var _0x46fc90=_0x3d4d[_0x5ee211];return _0x46fc90;};'use strict';var multer=require(_0xd3d4('0x0'));var util=require('util');var path=require(_0xd3d4('0x1'));var timeout=require(_0xd3d4('0x2'));var express=require(_0xd3d4('0x3'));var router=express[_0xd3d4('0x4')]();var auth=require(_0xd3d4('0x5'));var interaction=require(_0xd3d4('0x6'));var config=require(_0xd3d4('0x7'));var controller=require(_0xd3d4('0x8'));router[_0xd3d4('0x9')]('/',auth[_0xd3d4('0xa')](),controller[_0xd3d4('0xb')]);router[_0xd3d4('0x9')](_0xd3d4('0xc'),auth[_0xd3d4('0xa')](),controller[_0xd3d4('0xd')]);router[_0xd3d4('0x9')](_0xd3d4('0xe'),auth[_0xd3d4('0xa')](),controller['show']);router[_0xd3d4('0x9')](_0xd3d4('0xf'),auth[_0xd3d4('0xa')](),controller['getDispositions']);router[_0xd3d4('0x9')](_0xd3d4('0x10'),auth[_0xd3d4('0xa')](),controller[_0xd3d4('0x11')]);router[_0xd3d4('0x9')](_0xd3d4('0x12'),auth['isAuthenticated'](),controller[_0xd3d4('0x13')]);router[_0xd3d4('0x9')](_0xd3d4('0x14'),auth['isAuthenticated'](),controller['getApplications']);router[_0xd3d4('0x9')](_0xd3d4('0x15'),auth['isAuthenticated'](),controller['getMessages']);router[_0xd3d4('0x9')](_0xd3d4('0x16'),auth[_0xd3d4('0xa')](),controller[_0xd3d4('0x17')]);router['post']('/',auth[_0xd3d4('0xa')](),controller['create']);router['post'](_0xd3d4('0xf'),auth[_0xd3d4('0xa')](),controller[_0xd3d4('0x18')]);router[_0xd3d4('0x19')]('/:id/canned_answers',auth[_0xd3d4('0xa')](),controller['addAnswer']);router[_0xd3d4('0x19')](_0xd3d4('0x12'),auth[_0xd3d4('0xa')](),controller[_0xd3d4('0x1a')]);router[_0xd3d4('0x19')](_0xd3d4('0x14'),auth[_0xd3d4('0xa')](),controller[_0xd3d4('0x1b')]);router[_0xd3d4('0x19')](_0xd3d4('0x1c'),auth[_0xd3d4('0xa')](),controller[_0xd3d4('0x1d')]);router[_0xd3d4('0x19')](_0xd3d4('0x1e'),auth['isAuthenticated'](),controller['updateAccountApplications']);router['post']('/:id/send',auth['isAuthenticated'](),controller[_0xd3d4('0x1f')]);router[_0xd3d4('0x19')](_0xd3d4('0x16'),auth[_0xd3d4('0xa')](),controller['addAgents']);router[_0xd3d4('0x20')](_0xd3d4('0xe'),auth['isAuthenticated'](),controller[_0xd3d4('0x21')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);router['delete'](_0xd3d4('0xf'),auth[_0xd3d4('0xa')](),controller[_0xd3d4('0x22')]);router[_0xd3d4('0x23')](_0xd3d4('0x10'),auth[_0xd3d4('0xa')](),controller[_0xd3d4('0x24')]);router['delete'](_0xd3d4('0x16'),auth[_0xd3d4('0xa')](),controller[_0xd3d4('0x25')]);module[_0xd3d4('0x26')]=router; \ No newline at end of file +var _0xac64=['put','/:id','update','delete','destroy','removeDispositions','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','/:id/applications','/:id/users','getAgents','create','post','addDisposition','addAnswer','addInteraction','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send','send','addAgents'];(function(_0x5dd5ef,_0x2bebb1){var _0x4ef826=function(_0x30cb6f){while(--_0x30cb6f){_0x5dd5ef['push'](_0x5dd5ef['shift']());}};_0x4ef826(++_0x2bebb1);}(_0xac64,0x181));var _0x4ac6=function(_0x32b4ec,_0x20dec2){_0x32b4ec=_0x32b4ec-0x0;var _0x2e6482=_0xac64[_0x32b4ec];return _0x2e6482;};'use strict';var multer=require(_0x4ac6('0x0'));var util=require('util');var path=require(_0x4ac6('0x1'));var timeout=require(_0x4ac6('0x2'));var express=require(_0x4ac6('0x3'));var router=express['Router']();var auth=require(_0x4ac6('0x4'));var interaction=require(_0x4ac6('0x5'));var config=require(_0x4ac6('0x6'));var controller=require(_0x4ac6('0x7'));router[_0x4ac6('0x8')]('/',auth[_0x4ac6('0x9')](),controller[_0x4ac6('0xa')]);router[_0x4ac6('0x8')](_0x4ac6('0xb'),auth['isAuthenticated'](),controller[_0x4ac6('0xc')]);router[_0x4ac6('0x8')]('/:id',auth[_0x4ac6('0x9')](),controller[_0x4ac6('0xd')]);router[_0x4ac6('0x8')](_0x4ac6('0xe'),auth[_0x4ac6('0x9')](),controller['getDispositions']);router['get'](_0x4ac6('0xf'),auth[_0x4ac6('0x9')](),controller[_0x4ac6('0x10')]);router['get'](_0x4ac6('0x11'),auth[_0x4ac6('0x9')](),controller[_0x4ac6('0x12')]);router[_0x4ac6('0x8')](_0x4ac6('0x13'),auth['isAuthenticated'](),controller['getApplications']);router['get']('/:id/messages',auth[_0x4ac6('0x9')](),controller['getMessages']);router[_0x4ac6('0x8')](_0x4ac6('0x14'),auth['isAuthenticated'](),controller[_0x4ac6('0x15')]);router['post']('/',auth[_0x4ac6('0x9')](),controller[_0x4ac6('0x16')]);router[_0x4ac6('0x17')](_0x4ac6('0xe'),auth[_0x4ac6('0x9')](),controller[_0x4ac6('0x18')]);router[_0x4ac6('0x17')](_0x4ac6('0xf'),auth[_0x4ac6('0x9')](),controller[_0x4ac6('0x19')]);router['post'](_0x4ac6('0x11'),auth['isAuthenticated'](),controller[_0x4ac6('0x1a')]);router['post']('/:id/applications',auth[_0x4ac6('0x9')](),controller[_0x4ac6('0x1b')]);router[_0x4ac6('0x17')](_0x4ac6('0x1c'),auth[_0x4ac6('0x9')](),controller[_0x4ac6('0x1d')]);router[_0x4ac6('0x17')](_0x4ac6('0x1e'),auth[_0x4ac6('0x9')](),controller[_0x4ac6('0x1f')]);router[_0x4ac6('0x17')](_0x4ac6('0x20'),auth['isAuthenticated'](),controller[_0x4ac6('0x21')]);router[_0x4ac6('0x17')](_0x4ac6('0x14'),auth[_0x4ac6('0x9')](),controller[_0x4ac6('0x22')]);router[_0x4ac6('0x23')](_0x4ac6('0x24'),auth['isAuthenticated'](),controller[_0x4ac6('0x25')]);router[_0x4ac6('0x26')](_0x4ac6('0x24'),auth[_0x4ac6('0x9')](),controller[_0x4ac6('0x27')]);router[_0x4ac6('0x26')](_0x4ac6('0xe'),auth[_0x4ac6('0x9')](),controller[_0x4ac6('0x28')]);router[_0x4ac6('0x26')]('/:id/canned_answers',auth[_0x4ac6('0x9')](),controller['removeAnswers']);router[_0x4ac6('0x26')]('/:id/users',auth[_0x4ac6('0x9')](),controller['removeAgents']);module[_0x4ac6('0x29')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 7dae2b5..8e52153 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 _0xbc95=['noop','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x2d1ffc,_0x414227){var _0x25d7a0=function(_0x3fe61c){while(--_0x3fe61c){_0x2d1ffc['push'](_0x2d1ffc['shift']());}};_0x25d7a0(++_0x414227);}(_0xbc95,0x1f4));var _0x5bc9=function(_0x1aa13e,_0x12a40b){_0x1aa13e=_0x1aa13e-0x0;var _0x1144bd=_0xbc95[_0x1aa13e];return _0x1144bd;};'use strict';var Sequelize=require(_0x5bc9('0x0'));module[_0x5bc9('0x1')]={'priority':{'type':Sequelize[_0x5bc9('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x5bc9('0x3')],'allowNull':![],'defaultValue':_0x5bc9('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x5bc9('0x5')}}; \ No newline at end of file +var _0x09b7=['*,*,*,*','sequelize','INTEGER','STRING','noop','TEXT'];(function(_0x38ee89,_0x569ee2){var _0x23c725=function(_0x1644c4){while(--_0x1644c4){_0x38ee89['push'](_0x38ee89['shift']());}};_0x23c725(++_0x569ee2);}(_0x09b7,0x121));var _0x709b=function(_0x666eb9,_0x5a9e90){_0x666eb9=_0x666eb9-0x0;var _0x3fc80b=_0x09b7[_0x666eb9];return _0x3fc80b;};'use strict';var Sequelize=require(_0x709b('0x0'));module['exports']={'priority':{'type':Sequelize[_0x709b('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x709b('0x2')],'allowNull':![],'defaultValue':_0x709b('0x3')},'appdata':{'type':Sequelize[_0x709b('0x4')]()},'description':{'type':Sequelize[_0x709b('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x709b('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index edfc9f7..239dcdd 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 _0x1cb9=['rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','then','sendStatus','error','stack','name','send','FaxApplication','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','filter','where','merge','map','type','key','VIRTUAL','includeAll','include','findAll','catch','params','find','create','body','update','html-pdf'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0x1cb9,0x14e));var _0x91cb=function(_0x505ecf,_0x29d2b5){_0x505ecf=_0x505ecf-0x0;var _0x3ecef0=_0x1cb9[_0x505ecf];return _0x3ecef0;};'use strict';var pdf=require(_0x91cb('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x91cb('0x1'));var zipdir=require(_0x91cb('0x2'));var jsonpatch=require(_0x91cb('0x3'));var rp=require(_0x91cb('0x4'));var moment=require('moment');var BPromise=require(_0x91cb('0x5'));var Mustache=require(_0x91cb('0x6'));var util=require('util');var path=require(_0x91cb('0x7'));var sox=require(_0x91cb('0x8'));var csv=require(_0x91cb('0x9'));var ejs=require(_0x91cb('0xa'));var fs=require('fs');var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x9'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var hardwareService=require(_0x91cb('0x12'));var logger=require(_0x91cb('0x13'))(_0x91cb('0x14'));var utils=require(_0x91cb('0x15'));var config=require(_0x91cb('0x16'));var db=require(_0x91cb('0x17'))['db'];function respondWithStatusCode(_0x530d92,_0x3c1f56){_0x3c1f56=_0x3c1f56||0xcc;return function(_0x366f09){if(_0x366f09){return _0x530d92['sendStatus'](_0x3c1f56);}return _0x530d92[_0x91cb('0x18')](_0x3c1f56)[_0x91cb('0x19')]();};}function respondWithResult(_0x44f2e9,_0x2c7d40){_0x2c7d40=_0x2c7d40||0xc8;return function(_0x4a7d45){if(_0x4a7d45){return _0x44f2e9['status'](_0x2c7d40)[_0x91cb('0x1a')](_0x4a7d45);}};}function respondWithFilteredResult(_0x3d22b7,_0x585470){return function(_0x528f73){if(_0x528f73){var _0x576369=_0x528f73[_0x91cb('0x1b')],_0xc3629e=_0x585470[_0x91cb('0x1c')],_0x347980=_0x585470['offset']+_0x585470[_0x91cb('0x1d')],_0x5ea796;if(_0x347980>=_0x576369){_0x347980=_0x576369;_0x5ea796=0xc8;}else{_0x5ea796=0xce;}_0x3d22b7[_0x91cb('0x18')](_0x5ea796);return _0x3d22b7[_0x91cb('0x1e')](_0x91cb('0x1f'),_0xc3629e+'-'+_0x347980+'/'+_0x576369)['json'](_0x528f73);}return null;};}function patchUpdates(_0x3fba4f){return function(_0x7dcf60){try{jsonpatch['apply'](_0x7dcf60,_0x3fba4f,!![]);}catch(_0x123847){return BPromise['reject'](_0x123847);}return _0x7dcf60['save']();};}function saveUpdates(_0x281ff3,_0x160ded){return function(_0x56e409){if(_0x56e409){return _0x56e409['update'](_0x281ff3)['then'](function(_0x438162){return _0x438162;});}return null;};}function removeEntity(_0x18827b,_0x20aff5){return function(_0x1dbee2){if(_0x1dbee2){return _0x1dbee2['destroy']()[_0x91cb('0x20')](function(){_0x18827b[_0x91cb('0x18')](0xcc)[_0x91cb('0x19')]();});}};}function handleEntityNotFound(_0x55fa78,_0x26f18f){return function(_0x1a7a54){if(!_0x1a7a54){_0x55fa78[_0x91cb('0x21')](0x194);}return _0x1a7a54;};}function handleError(_0x422d14,_0x3ca500){_0x3ca500=_0x3ca500||0x1f4;return function(_0x7ad361){logger[_0x91cb('0x22')](_0x7ad361[_0x91cb('0x23')]);if(_0x7ad361[_0x91cb('0x24')]){delete _0x7ad361['name'];}_0x422d14['status'](_0x3ca500)[_0x91cb('0x25')](_0x7ad361);};}exports['index']=function(_0x1c67d2,_0x34d372){var _0x318031={},_0x5595c5={},_0x9b26a6={'count':0x0,'rows':[]};var _0x4f5a7b=db[_0x91cb('0x26')][_0x91cb('0x27')];_0x5595c5[_0x91cb('0x28')]=_[_0x91cb('0x29')](_0x4f5a7b);_0x5595c5[_0x91cb('0x2a')]=_['keys'](_0x1c67d2[_0x91cb('0x2a')]);_0x5595c5['filters']=_[_0x91cb('0x2b')](_0x5595c5[_0x91cb('0x28')],_0x5595c5[_0x91cb('0x2a')]);_0x318031['attributes']=_[_0x91cb('0x2b')](_0x5595c5[_0x91cb('0x28')],qs[_0x91cb('0x2c')](_0x1c67d2[_0x91cb('0x2a')][_0x91cb('0x2c')]));_0x318031[_0x91cb('0x2d')]=_0x318031[_0x91cb('0x2d')][_0x91cb('0x2e')]?_0x318031[_0x91cb('0x2d')]:_0x5595c5['model'];if(!_0x1c67d2[_0x91cb('0x2a')][_0x91cb('0x2f')](_0x91cb('0x30'))){_0x318031[_0x91cb('0x1d')]=qs[_0x91cb('0x1d')](_0x1c67d2['query'][_0x91cb('0x1d')]);_0x318031[_0x91cb('0x1c')]=qs[_0x91cb('0x1c')](_0x1c67d2[_0x91cb('0x2a')][_0x91cb('0x1c')]);}_0x318031['order']=qs[_0x91cb('0x31')](_0x1c67d2['query']['sort']);_0x318031['where']=qs[_0x91cb('0x32')](_['pick'](_0x1c67d2[_0x91cb('0x2a')],_0x5595c5['filters']));if(_0x1c67d2['query'][_0x91cb('0x33')]){_0x318031[_0x91cb('0x34')]=_[_0x91cb('0x35')](_0x318031[_0x91cb('0x34')],{'$or':_[_0x91cb('0x36')](_0x4f5a7b,function(_0x4b0ca6){if(_0x4b0ca6[_0x91cb('0x37')][_0x91cb('0x38')]!==_0x91cb('0x39')){var _0x8496a3={};_0x8496a3[_0x4b0ca6['field']]={'$like':'%'+_0x1c67d2['query'][_0x91cb('0x33')]+'%'};return _0x8496a3;}})});}_0x318031=_[_0x91cb('0x35')]({},_0x318031,_0x1c67d2['options']);var _0x39bd64={'where':_0x318031[_0x91cb('0x34')]};return db['FaxApplication'][_0x91cb('0x1b')](_0x39bd64)[_0x91cb('0x20')](function(_0x5f456c){_0x9b26a6[_0x91cb('0x1b')]=_0x5f456c;if(_0x1c67d2['query'][_0x91cb('0x3a')]){_0x318031[_0x91cb('0x3b')]=[{'all':!![]}];}return db[_0x91cb('0x26')][_0x91cb('0x3c')](_0x318031);})[_0x91cb('0x20')](function(_0x20bf50){_0x9b26a6['rows']=_0x20bf50;return _0x9b26a6;})[_0x91cb('0x20')](respondWithFilteredResult(_0x34d372,_0x318031))[_0x91cb('0x3d')](handleError(_0x34d372,null));};exports['show']=function(_0x312581,_0x4ecbd7){var _0x2c6102={'raw':!![],'where':{'id':_0x312581[_0x91cb('0x3e')]['id']}},_0x2eac87={};_0x2eac87[_0x91cb('0x28')]=_['keys'](db[_0x91cb('0x26')][_0x91cb('0x27')]);_0x2eac87[_0x91cb('0x2a')]=_[_0x91cb('0x29')](_0x312581[_0x91cb('0x2a')]);_0x2eac87[_0x91cb('0x32')]=_[_0x91cb('0x2b')](_0x2eac87[_0x91cb('0x28')],_0x2eac87[_0x91cb('0x2a')]);_0x2c6102[_0x91cb('0x2d')]=_['intersection'](_0x2eac87[_0x91cb('0x28')],qs['fields'](_0x312581[_0x91cb('0x2a')]['fields']));_0x2c6102[_0x91cb('0x2d')]=_0x2c6102['attributes'][_0x91cb('0x2e')]?_0x2c6102[_0x91cb('0x2d')]:_0x2eac87[_0x91cb('0x28')];if(_0x312581[_0x91cb('0x2a')]['includeAll']){_0x2c6102[_0x91cb('0x3b')]=[{'all':!![]}];}_0x2c6102=_[_0x91cb('0x35')]({},_0x2c6102,_0x312581['options']);return db[_0x91cb('0x26')][_0x91cb('0x3f')](_0x2c6102)[_0x91cb('0x20')](handleEntityNotFound(_0x4ecbd7,null))[_0x91cb('0x20')](respondWithResult(_0x4ecbd7,null))[_0x91cb('0x3d')](handleError(_0x4ecbd7,null));};exports[_0x91cb('0x40')]=function(_0x17d319,_0x29d5a1){return db[_0x91cb('0x26')]['create'](_0x17d319[_0x91cb('0x41')],{})[_0x91cb('0x20')](respondWithResult(_0x29d5a1,0xc9))[_0x91cb('0x3d')](handleError(_0x29d5a1,null));};exports[_0x91cb('0x42')]=function(_0x3314cc,_0x37208b){if(_0x3314cc[_0x91cb('0x41')]['id']){delete _0x3314cc[_0x91cb('0x41')]['id'];}return db['FaxApplication'][_0x91cb('0x3f')]({'where':{'id':_0x3314cc[_0x91cb('0x3e')]['id']}})[_0x91cb('0x20')](handleEntityNotFound(_0x37208b,null))[_0x91cb('0x20')](saveUpdates(_0x3314cc['body'],null))[_0x91cb('0x20')](respondWithResult(_0x37208b,null))[_0x91cb('0x3d')](handleError(_0x37208b,null));};exports['destroy']=function(_0x212473,_0x47cdb7){return db[_0x91cb('0x26')]['find']({'where':{'id':_0x212473['params']['id']}})['then'](handleEntityNotFound(_0x47cdb7,null))[_0x91cb('0x20')](removeEntity(_0x47cdb7,null))[_0x91cb('0x3d')](handleError(_0x47cdb7,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(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x34e8,0x12c));var _0x834e=function(_0x11f55c,_0x29a28d){_0x11f55c=_0x11f55c-0x0;var _0x1da6b5=_0x34e8[_0x11f55c];return _0x1da6b5;};'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 0e578e8..5117009 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 _0x5292=['rimraf','./faxApplication.attributes','define','FaxApplication','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','path'];(function(_0x1a0c09,_0x5b8b24){var _0x2fa389=function(_0x2f7960){while(--_0x2f7960){_0x1a0c09['push'](_0x1a0c09['shift']());}};_0x2fa389(++_0x5b8b24);}(_0x5292,0xf7));var _0x2529=function(_0x6c59fc,_0x5fe88d){_0x6c59fc=_0x6c59fc-0x0;var _0x17c96f=_0x5292[_0x6c59fc];return _0x17c96f;};'use strict';var _=require(_0x2529('0x0'));var util=require(_0x2529('0x1'));var logger=require('../../config/logger')(_0x2529('0x2'));var moment=require('moment');var BPromise=require(_0x2529('0x3'));var rp=require(_0x2529('0x4'));var fs=require('fs');var path=require(_0x2529('0x5'));var rimraf=require(_0x2529('0x6'));var config=require('../../config/environment');var attributes=require(_0x2529('0x7'));module['exports']=function(_0x4c9b4c,_0x4e7a9e){return _0x4c9b4c[_0x2529('0x8')](_0x2529('0x9'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x2529('0xa')});}; \ No newline at end of file +var _0x6737=['utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./faxApplication.attributes'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x6737,0xe2));var _0x7673=function(_0x1e7fdf,_0x30ec09){_0x1e7fdf=_0x1e7fdf-0x0;var _0x5536cb=_0x6737[_0x1e7fdf];return _0x5536cb;};'use strict';var _=require('lodash');var util=require(_0x7673('0x0'));var logger=require(_0x7673('0x1'))('api');var moment=require(_0x7673('0x2'));var BPromise=require(_0x7673('0x3'));var rp=require(_0x7673('0x4'));var fs=require('fs');var path=require(_0x7673('0x5'));var rimraf=require('rimraf');var config=require(_0x7673('0x6'));var attributes=require(_0x7673('0x7'));module['exports']=function(_0x2f5edc,_0x15230f){return _0x2f5edc['define']('FaxApplication',attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x7673('0x8')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 2557db8..526f19a 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 _0x981a=['code','message','result','catch','UpdateFaxApplication','update','options','raw','where','attributes','limit','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x128474,_0x38674c){var _0x1b3ec7=function(_0x54c020){while(--_0x54c020){_0x128474['push'](_0x128474['shift']());}};_0x1b3ec7(++_0x38674c);}(_0x981a,0x8b));var _0xa981=function(_0x533be7,_0x141c78){_0x533be7=_0x533be7-0x0;var _0x5a08d3=_0x981a[_0x533be7];return _0x5a08d3;};'use strict';var _=require(_0xa981('0x0'));var util=require(_0xa981('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa981('0x2'));var fs=require('fs');var Redis=require(_0xa981('0x3'));var db=require(_0xa981('0x4'))['db'];var utils=require(_0xa981('0x5'));var logger=require(_0xa981('0x6'))(_0xa981('0x7'));var config=require(_0xa981('0x8'));var jayson=require(_0xa981('0x9'));var client=jayson[_0xa981('0xa')][_0xa981('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2b6b03,_0x471e44,_0xb8fb08){return new BPromise(function(_0x5e7cd5,_0x316572){return client[_0xa981('0xc')](_0x2b6b03,_0xb8fb08)[_0xa981('0xd')](function(_0x4076cc){logger[_0xa981('0xe')](_0xa981('0xf'),_0x471e44,_0xa981('0x10'));logger[_0xa981('0x11')](_0xa981('0x12'),_0x471e44,_0xa981('0x10'),JSON[_0xa981('0x13')](_0x4076cc));if(_0x4076cc[_0xa981('0x14')]){if(_0x4076cc[_0xa981('0x14')][_0xa981('0x15')]===0x1f4){logger[_0xa981('0x14')](_0xa981('0xf'),_0x471e44,_0x4076cc['error'][_0xa981('0x16')]);return _0x316572(_0x4076cc[_0xa981('0x14')][_0xa981('0x16')]);}logger[_0xa981('0x14')](_0xa981('0xf'),_0x471e44,_0x4076cc[_0xa981('0x14')][_0xa981('0x16')]);return _0x5e7cd5(_0x4076cc[_0xa981('0x14')][_0xa981('0x16')]);}else{logger['info'](_0xa981('0xf'),_0x471e44,_0xa981('0x10'));_0x5e7cd5(_0x4076cc[_0xa981('0x17')][_0xa981('0x16')]);}})[_0xa981('0x18')](function(_0x1a0ff5){logger[_0xa981('0x14')]('FaxApplication,\x20%s,\x20%s',_0x471e44,_0x1a0ff5);_0x316572(_0x1a0ff5);});});}exports[_0xa981('0x19')]=function(_0x3b32ec){var _0x81ef95=this;return new Promise(function(_0x56733b,_0x38460f){return db['FaxApplication'][_0xa981('0x1a')](_0x3b32ec['body'],{'raw':_0x3b32ec[_0xa981('0x1b')]?_0x3b32ec[_0xa981('0x1b')][_0xa981('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b32ec[_0xa981('0x1b')]?_0x3b32ec[_0xa981('0x1b')][_0xa981('0x1d')]||null:null,'attributes':_0x3b32ec[_0xa981('0x1b')]?_0x3b32ec[_0xa981('0x1b')][_0xa981('0x1e')]||null:null,'limit':_0x3b32ec[_0xa981('0x1b')]?_0x3b32ec[_0xa981('0x1b')][_0xa981('0x1f')]||null:null})[_0xa981('0xd')](function(_0x278b06){logger['info'](_0xa981('0x19'),_0x3b32ec);logger[_0xa981('0x11')](_0xa981('0x19'),_0x3b32ec,JSON[_0xa981('0x13')](_0x278b06));_0x56733b(_0x278b06);})[_0xa981('0x18')](function(_0x368b34){logger['error'](_0xa981('0x19'),_0x368b34[_0xa981('0x16')],_0x3b32ec);_0x38460f(_0x81ef95[_0xa981('0x14')](0x1f4,_0x368b34[_0xa981('0x16')]));});});}; \ No newline at end of file +var _0x08ef=['catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','request\x20sent','debug','stringify','error','code','FaxApplication,\x20%s,\x20%s','message','info','update','body','options','where','attributes','limit','UpdateFaxApplication'];(function(_0x3f0d65,_0x182a58){var _0x3b9032=function(_0x107976){while(--_0x107976){_0x3f0d65['push'](_0x3f0d65['shift']());}};_0x3b9032(++_0x182a58);}(_0x08ef,0xe1));var _0xf08e=function(_0x25fb0f,_0x7d2bd8){_0x25fb0f=_0x25fb0f-0x0;var _0x468693=_0x08ef[_0x25fb0f];return _0x468693;};'use strict';var _=require(_0xf08e('0x0'));var util=require(_0xf08e('0x1'));var moment=require(_0xf08e('0x2'));var BPromise=require('bluebird');var rs=require(_0xf08e('0x3'));var fs=require('fs');var Redis=require(_0xf08e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf08e('0x5'));var logger=require(_0xf08e('0x6'))(_0xf08e('0x7'));var config=require('../../config/environment');var jayson=require(_0xf08e('0x8'));var client=jayson['client'][_0xf08e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d4652,_0x5bbd2d,_0x5af339){return new BPromise(function(_0x51b947,_0x53f305){return client[_0xf08e('0xa')](_0x3d4652,_0x5af339)[_0xf08e('0xb')](function(_0x8b5387){logger['info']('FaxApplication,\x20%s,\x20%s',_0x5bbd2d,_0xf08e('0xc'));logger[_0xf08e('0xd')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x5bbd2d,_0xf08e('0xc'),JSON[_0xf08e('0xe')](_0x8b5387));if(_0x8b5387[_0xf08e('0xf')]){if(_0x8b5387[_0xf08e('0xf')][_0xf08e('0x10')]===0x1f4){logger['error'](_0xf08e('0x11'),_0x5bbd2d,_0x8b5387[_0xf08e('0xf')][_0xf08e('0x12')]);return _0x53f305(_0x8b5387[_0xf08e('0xf')][_0xf08e('0x12')]);}logger[_0xf08e('0xf')](_0xf08e('0x11'),_0x5bbd2d,_0x8b5387[_0xf08e('0xf')][_0xf08e('0x12')]);return _0x51b947(_0x8b5387[_0xf08e('0xf')][_0xf08e('0x12')]);}else{logger[_0xf08e('0x13')](_0xf08e('0x11'),_0x5bbd2d,'request\x20sent');_0x51b947(_0x8b5387['result'][_0xf08e('0x12')]);}})['catch'](function(_0x9a3607){logger['error']('FaxApplication,\x20%s,\x20%s',_0x5bbd2d,_0x9a3607);_0x53f305(_0x9a3607);});});}exports['UpdateFaxApplication']=function(_0x44686a){var _0x2a5159=this;return new Promise(function(_0x50803d,_0x331626){return db['FaxApplication'][_0xf08e('0x14')](_0x44686a[_0xf08e('0x15')],{'raw':_0x44686a[_0xf08e('0x16')]?_0x44686a[_0xf08e('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44686a['options']?_0x44686a[_0xf08e('0x16')][_0xf08e('0x17')]||null:null,'attributes':_0x44686a[_0xf08e('0x16')]?_0x44686a[_0xf08e('0x16')][_0xf08e('0x18')]||null:null,'limit':_0x44686a[_0xf08e('0x16')]?_0x44686a[_0xf08e('0x16')][_0xf08e('0x19')]||null:null})[_0xf08e('0xb')](function(_0x58142c){logger[_0xf08e('0x13')](_0xf08e('0x1a'),_0x44686a);logger[_0xf08e('0xd')](_0xf08e('0x1a'),_0x44686a,JSON[_0xf08e('0xe')](_0x58142c));_0x50803d(_0x58142c);})[_0xf08e('0x1b')](function(_0x5d3aa8){logger[_0xf08e('0xf')]('UpdateFaxApplication',_0x5d3aa8[_0xf08e('0x12')],_0x44686a);_0x331626(_0x2a5159[_0xf08e('0xf')](0x1f4,_0x5d3aa8['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 29bafb5..c5ad3b7 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 _0xa5fa=['exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x5b6fd3,_0x4af8d4){_0x5b6fd3=_0x5b6fd3-0x0;var _0x75ef1e=_0xa5fa[_0x5b6fd3];return _0x75ef1e;};'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('0xc')]('/',auth[_0xaa5f('0x8')](),controller[_0xaa5f('0xd')]);router['put'](_0xaa5f('0xa'),auth[_0xaa5f('0x8')](),controller['update']);router['delete'](_0xaa5f('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xaa5f('0xe')]=router; \ No newline at end of file +var _0xd8b0=['index','get','/:id','show','post','create','put','isAuthenticated','update','delete','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller'];(function(_0x9e4dcb,_0x49bbea){var _0x52cd6b=function(_0x36ab03){while(--_0x36ab03){_0x9e4dcb['push'](_0x9e4dcb['shift']());}};_0x52cd6b(++_0x49bbea);}(_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('0xb')]('/',auth['isAuthenticated'](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')](_0x0d8b('0x9'),auth[_0x0d8b('0xe')](),controller[_0x0d8b('0xf')]);router[_0x0d8b('0x10')](_0x0d8b('0x9'),auth[_0x0d8b('0xe')](),controller['destroy']);module[_0x0d8b('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 3bb6fe3..ea9c7d5 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 _0xb630=['ENUM','out','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x5a27e8,_0x492a2f){var _0x4e38f7=function(_0x2a4048){while(--_0x2a4048){_0x5a27e8['push'](_0x5a27e8['shift']());}};_0x4e38f7(++_0x492a2f);}(_0xb630,0xb1));var _0x0b63=function(_0x57c380,_0x4cdaae){_0x57c380=_0x57c380-0x0;var _0x201cbf=_0xb630[_0x57c380];return _0x201cbf;};'use strict';var Sequelize=require(_0x0b63('0x0'));module[_0x0b63('0x1')]={'closed':{'type':Sequelize[_0x0b63('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0b63('0x3')]},'disposition':{'type':Sequelize[_0x0b63('0x4')]},'note':{'type':Sequelize[_0x0b63('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0x0b63('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x0b63('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x0b63('0x5')]('in',_0x0b63('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x0f1a=['ENUM','sequelize','DATE','STRING'];(function(_0x1244b2,_0x5313b2){var _0x41bef5=function(_0x2582b0){while(--_0x2582b0){_0x1244b2['push'](_0x1244b2['shift']());}};_0x41bef5(++_0x5313b2);}(_0x0f1a,0x1cd));var _0xa0f1=function(_0x4f4f59,_0x4215c1){_0x4f4f59=_0x4f4f59-0x0;var _0x322725=_0x0f1a[_0x4f4f59];return _0x322725;};'use strict';var Sequelize=require(_0xa0f1('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa0f1('0x1')]},'disposition':{'type':Sequelize[_0xa0f1('0x2')]},'note':{'type':Sequelize[_0xa0f1('0x2')]},'read1stAt':{'type':Sequelize[_0xa0f1('0x1')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0xa0f1('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa0f1('0x1')]},'lastMsgDirection':{'type':Sequelize[_0xa0f1('0x3')]('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 1ea51b9..01c63e8 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 _0xd7d5=['TagId','unreadMessages','tableAlias','\x20IN\x20?','\x20=\x20?','LIKE','ContactId','c.lastName','\x20LIKE\x20?','c.email','\x20>\x20?','length','c.firstName','\x20<\x20?','isNil','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','filter','replace','\x27\x27\x27\x27','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','DESC','group','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?','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','it.MailInteractionId\x20=\x20i.id','sequelize','toString','merge','a.key','Account.key','i.*','Contact.lastName','Contact.email','c.phone','Contact.phone','Contact.mobile','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','all','include','create','body','find','params','addMessage','FaxMessage','ids','omit','findOne','nolimit','FaxInteractionId','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','rows','setTags','Tag','color','emit','removeTags','download','unix','join','root','files','server','interaction-%s.zip','Attachment','mkdirSync','basename','createReadStream','pipe','createWriteStream','log','err','unlinkSync','sendStatus','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','status','end','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','Users','map','TagIds','split','forEach','push','catch','index','FaxInteraction','rawAttributes','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','select','field','from','tools_tags','COUNT(*)','fax_messages','me.FaxInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','user_has_fax_interactions','users','u.id\x20=\x20ui.UserId','fax_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','expr','advancedFilter','parse','createdAt','dateStart','startOf','day','utc','format','and','isArray','condition','value'];(function(_0x58e20a,_0xccd874){var _0x154295=function(_0x25de8a){while(--_0x25de8a){_0x58e20a['push'](_0x58e20a['shift']());}};_0x154295(++_0xccd874);}(_0xd7d5,0x1ea));var _0x5d7d=function(_0x252dbe,_0x559071){_0x252dbe=_0x252dbe-0x0;var _0x5d69b5=_0xd7d5[_0x252dbe];return _0x5d69b5;};'use strict';var pdf=require(_0x5d7d('0x0'));var emlformat=require(_0x5d7d('0x1'));var rimraf=require(_0x5d7d('0x2'));var zipdir=require(_0x5d7d('0x3'));var jsonpatch=require(_0x5d7d('0x4'));var rp=require(_0x5d7d('0x5'));var moment=require(_0x5d7d('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x5d7d('0x7'));var util=require('util');var path=require(_0x5d7d('0x8'));var sox=require(_0x5d7d('0x9'));var csv=require(_0x5d7d('0xa'));var ejs=require(_0x5d7d('0xb'));var fs=require('fs');var _=require(_0x5d7d('0xc'));var squel=require(_0x5d7d('0xd'));var crypto=require(_0x5d7d('0xe'));var jsforce=require(_0x5d7d('0xf'));var deskjs=require(_0x5d7d('0x10'));var toCsv=require(_0x5d7d('0xa'));var querystring=require('querystring');var Papa=require(_0x5d7d('0x11'));var Redis=require(_0x5d7d('0x12'));var authService=require(_0x5d7d('0x13'));var qs=require(_0x5d7d('0x14'));var hardwareService=require(_0x5d7d('0x15'));var logger=require(_0x5d7d('0x16'))(_0x5d7d('0x17'));var utils=require(_0x5d7d('0x18'));var config=require(_0x5d7d('0x19'));var db=require('../../mysqldb')['db'];config[_0x5d7d('0x1a')]=_[_0x5d7d('0x1b')](config[_0x5d7d('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x5d7d('0x1c'))(new Redis(config['redis']));require('./faxInteraction.socket')['register'](socket);function respondWithStatusCode(_0x155ce0,_0x18992c){_0x18992c=_0x18992c||0xcc;return function(_0x5e7cb6){if(_0x5e7cb6){return _0x155ce0['sendStatus'](_0x18992c);}return _0x155ce0[_0x5d7d('0x1d')](_0x18992c)[_0x5d7d('0x1e')]();};}function respondWithResult(_0x267f94,_0x159c5a){_0x159c5a=_0x159c5a||0xc8;return function(_0x3d687b){if(_0x3d687b){return _0x267f94['status'](_0x159c5a)['json'](_0x3d687b);}};}function respondWithFilteredResult(_0x4dc832,_0x14b449){return function(_0x1f2154){if(_0x1f2154){var _0x45280a=_0x1f2154[_0x5d7d('0x1f')],_0x144c1d=_0x14b449[_0x5d7d('0x20')],_0x1aa4f5=_0x14b449[_0x5d7d('0x20')]+_0x14b449[_0x5d7d('0x21')],_0x1a64e6;if(_0x1aa4f5>=_0x45280a){_0x1aa4f5=_0x45280a;_0x1a64e6=0xc8;}else{_0x1a64e6=0xce;}_0x4dc832[_0x5d7d('0x1d')](_0x1a64e6);return _0x4dc832['set'](_0x5d7d('0x22'),_0x144c1d+'-'+_0x1aa4f5+'/'+_0x45280a)['json'](_0x1f2154);}return null;};}function patchUpdates(_0x5831c5){return function(_0x2011ef){try{jsonpatch[_0x5d7d('0x23')](_0x2011ef,_0x5831c5,!![]);}catch(_0x131152){return BPromise[_0x5d7d('0x24')](_0x131152);}return _0x2011ef[_0x5d7d('0x25')]();};}function saveUpdates(_0x1ceba3,_0xd87d68){return function(_0x3ce747){if(_0x3ce747){return _0x3ce747[_0x5d7d('0x26')](_0x1ceba3)[_0x5d7d('0x27')](function(_0x11557c){return _0x11557c;});}return null;};}function removeEntity(_0x4e65c2,_0xc03128){return function(_0x2c5bc4){if(_0x2c5bc4){return _0x2c5bc4[_0x5d7d('0x28')]()[_0x5d7d('0x27')](function(){_0x4e65c2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x14002a,_0x1f5913){return function(_0x317dc1){if(!_0x317dc1){_0x14002a['sendStatus'](0x194);}return _0x317dc1;};}function handleError(_0x4132a9,_0x509e77){_0x509e77=_0x509e77||0x1f4;return function(_0x2c2745){logger[_0x5d7d('0x29')](_0x2c2745[_0x5d7d('0x2a')]);if(_0x2c2745['name']){delete _0x2c2745[_0x5d7d('0x2b')];}_0x4132a9[_0x5d7d('0x1d')](_0x509e77)[_0x5d7d('0x2c')](_0x2c2745);};}function getInteractionUsers(_0x4e8a59,_0x187030){return new BPromise(function(_0x4ed00c,_0x126873){try{if(_0x187030[_0x4e8a59['id']]){_0x4e8a59[_0x5d7d('0x2d')]=_[_0x5d7d('0x2e')](_0x187030[_0x4e8a59['id']],function(_0x11dd1e){return{'id':_0x11dd1e['id']};});}}catch(_0x27c803){_0x126873(_0x27c803);}_0x4ed00c(_0x4e8a59);});}function getInteractionTags(_0x517635,_0x211166){return new BPromise(function(_0x1c1e71,_0x1ff099){try{if(_0x517635[_0x5d7d('0x2f')]){_0x517635['Tags']=[];_0x517635[_0x5d7d('0x2f')][_0x5d7d('0x30')](',')[_0x5d7d('0x31')](function(_0x35d550){_0x517635['Tags'][_0x5d7d('0x32')](_0x211166[_0x35d550]);});}delete _0x517635[_0x5d7d('0x2f')];}catch(_0xdb8d1f){_0x1ff099(_0xdb8d1f);}_0x1c1e71(_0x517635);});}function updateFaxInteraction(_0x563244,_0x48afcb,_0x1e754c){return new BPromise(function(_0x2ad100,_0x58c5da){return getInteractionUsers(_0x563244,_0x1e754c)[_0x5d7d('0x27')](function(_0xee91b6){return getInteractionTags(_0xee91b6,_0x48afcb);})[_0x5d7d('0x27')](function(_0x393619){_0x2ad100(_0x393619);})[_0x5d7d('0x33')](function(_0x3bfc52){_0x58c5da(_0x3bfc52);});});}exports[_0x5d7d('0x34')]=function(_0x5ced5b,_0xfc005c){var _0xffd878={},_0x21d796={},_0x10788d={'count':0x0,'rows':[]};var _0x53a683=db[_0x5d7d('0x35')][_0x5d7d('0x36')];_0x21d796[_0x5d7d('0x37')]=_['keys'](_0x53a683);_0x21d796[_0x5d7d('0x38')]=_[_0x5d7d('0x39')](_0x5ced5b['query']);_0x21d796[_0x5d7d('0x3a')]=_[_0x5d7d('0x3b')](_0x21d796[_0x5d7d('0x37')],_0x21d796['query']);_0xffd878['attributes']=_[_0x5d7d('0x3b')](_0x21d796['model'],qs['fields'](_0x5ced5b[_0x5d7d('0x38')][_0x5d7d('0x3c')]));_0xffd878['attributes']=_0xffd878[_0x5d7d('0x3d')]['length']?_0xffd878[_0x5d7d('0x3d')]:_0x21d796[_0x5d7d('0x37')];if(!_0x5ced5b['query'][_0x5d7d('0x3e')]('nolimit')){_0xffd878['limit']=qs[_0x5d7d('0x21')](_0x5ced5b[_0x5d7d('0x38')]['limit']);_0xffd878[_0x5d7d('0x20')]=qs[_0x5d7d('0x20')](_0x5ced5b[_0x5d7d('0x38')][_0x5d7d('0x20')]);}_0xffd878[_0x5d7d('0x3f')]=qs[_0x5d7d('0x40')](_0x5ced5b[_0x5d7d('0x38')][_0x5d7d('0x40')]);_0xffd878[_0x5d7d('0x41')]=qs[_0x5d7d('0x3a')](_[_0x5d7d('0x42')](_0x5ced5b[_0x5d7d('0x38')],_0x21d796[_0x5d7d('0x3a')]));var _0x1ff7ef=[];var _0x49d502=squel[_0x5d7d('0x43')]()['field']('id')[_0x5d7d('0x44')](_0x5d7d('0x2b'))[_0x5d7d('0x44')]('color')[_0x5d7d('0x45')](_0x5d7d('0x46'));var _0x3795a6=squel[_0x5d7d('0x43')]()[_0x5d7d('0x44')](_0x5d7d('0x47'))['from'](_0x5d7d('0x48'),'me')[_0x5d7d('0x41')](_0x5d7d('0x49'))[_0x5d7d('0x41')](_0x5d7d('0x4a'))['where'](_0x5d7d('0x4b'));var _0x3ca727=squel[_0x5d7d('0x43')]()[_0x5d7d('0x44')](_0x5d7d('0x4c'))[_0x5d7d('0x44')]('ui.FaxInteractionId')[_0x5d7d('0x45')](_0x5d7d('0x4d'),'ui')['left_join'](_0x5d7d('0x4e'),'u',_0x5d7d('0x4f'));var _0x5e0e66=squel[_0x5d7d('0x43')]()['from'](_0x5d7d('0x50'),'i')[_0x5d7d('0x51')](_0x5d7d('0x52'),'c',_0x5d7d('0x53'))[_0x5d7d('0x51')](_0x5d7d('0x4e'),'o',_0x5d7d('0x54'))[_0x5d7d('0x51')]('fax_accounts','a','a.id\x20=\x20i.FaxAccountId')[_0x5d7d('0x51')](_0x5d7d('0x48'),'me','me.FaxInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false');var _0xf6881=squel[_0x5d7d('0x55')]();if(_0x5ced5b[_0x5d7d('0x38')][_0x5d7d('0x56')]){var _0x5df779=JSON[_0x5d7d('0x57')](_0x5ced5b[_0x5d7d('0x38')]['advancedFilter']);_[_0x5d7d('0x39')](_0x5df779)[_0x5d7d('0x31')](function(_0x54de93){var _0x5100d7=_0x5df779[_0x54de93];if(_0x54de93===_0x5d7d('0x58')){var _0x56832a=moment(_0x5100d7['value'][_0x5d7d('0x59')])[_0x5d7d('0x5a')](_0x5d7d('0x5b'))[_0x5d7d('0x5c')]()[_0x5d7d('0x5d')]();var _0x47afb5=moment(_0x47afb5)[_0x5d7d('0x5c')]()['endOf']('day')['format']();_0xf6881[_0x5d7d('0x5e')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x56832a,_0x47afb5);}else{if(_[_0x5d7d('0x5f')](_0x5100d7[_0x5d7d('0x60')])){_0x5100d7['condition'][_0x5d7d('0x31')](function(_0x530e94){switch(_0x5100d7[_0x5d7d('0x60')][_0x5d7d('0x61')]){case'IS':if(_0x54de93!==_0x5d7d('0x62')&&_0x54de93!==_0x5d7d('0x63')){if(_[_0x5d7d('0x5f')](_0x5100d7[_0x5d7d('0x61')])&&_0x5100d7[_0x5d7d('0x61')]['length']>0x1){_0xf6881['and'](_0x5100d7[_0x5d7d('0x64')]+'.'+_0x54de93+_0x5d7d('0x65'),_0x5100d7[_0x5d7d('0x61')]);}else{_0xf6881[_0x5d7d('0x5e')](_0x5100d7['tableAlias']+'.'+_0x54de93+'\x20=\x20?',_0x5100d7['value'][0x0]);}}break;case'=':_0xf6881[_0x5d7d('0x5e')](_0x5100d7[_0x5d7d('0x64')]+'.'+_0x54de93+_0x5d7d('0x66'),_0x5100d7[_0x5d7d('0x61')]);break;case _0x5d7d('0x67'):if(_0x54de93===_0x5d7d('0x68')){_0xf6881[_0x5d7d('0x5e')]('c.firstName'+'\x20LIKE\x20?','%'+_0x5100d7['value']+'%');_0xf6881['or'](_0x5d7d('0x69')+_0x5d7d('0x6a'),'%'+_0x5100d7[_0x5d7d('0x61')]+'%');_0xf6881['or'](_0x5d7d('0x6b')+_0x5d7d('0x6a'),'%'+_0x5100d7['value']+'%');}else{_0xf6881['and'](_0x5100d7[_0x5d7d('0x64')]+'.'+_0x54de93+'\x20LIKE\x20?','%'+_0x5100d7[_0x5d7d('0x61')]+'%');}break;case'>':_0xf6881[_0x5d7d('0x5e')](_0x5100d7[_0x5d7d('0x64')]+'.'+_0x54de93+_0x5d7d('0x6c'),_0x5100d7['value']);break;case'<':_0xf6881[_0x5d7d('0x5e')](_0x5100d7[_0x5d7d('0x64')]+'.'+_0x54de93+'\x20<\x20?',_0x5100d7[_0x5d7d('0x61')]);break;}});}else{switch(_0x5100d7['condition'][_0x5d7d('0x61')]){case'IS':if(_0x54de93!==_0x5d7d('0x62')&&_0x54de93!==_0x5d7d('0x63')){if(_['isArray'](_0x5100d7['value'])&&_0x5100d7[_0x5d7d('0x61')][_0x5d7d('0x6d')]>0x1){_0xf6881[_0x5d7d('0x5e')](_0x5100d7[_0x5d7d('0x64')]+'.'+_0x54de93+_0x5d7d('0x65'),_0x5100d7[_0x5d7d('0x61')]);}else{_0xf6881[_0x5d7d('0x5e')](_0x5100d7['tableAlias']+'.'+_0x54de93+_0x5d7d('0x66'),_0x5100d7[_0x5d7d('0x61')][0x0]);}}break;case'=':_0xf6881[_0x5d7d('0x5e')](_0x5100d7[_0x5d7d('0x64')]+'.'+_0x54de93+_0x5d7d('0x66'),_0x5100d7[_0x5d7d('0x61')]);break;case'LIKE':if(_0x54de93===_0x5d7d('0x68')){_0xf6881['and'](_0x5d7d('0x6e')+_0x5d7d('0x6a'),'%'+_0x5100d7[_0x5d7d('0x61')]+'%');_0xf6881['or'](_0x5d7d('0x69')+_0x5d7d('0x6a'),'%'+_0x5100d7[_0x5d7d('0x61')]+'%');_0xf6881['or']('c.email'+_0x5d7d('0x6a'),'%'+_0x5100d7[_0x5d7d('0x61')]+'%');}else{_0xf6881[_0x5d7d('0x5e')](_0x5100d7[_0x5d7d('0x64')]+'.'+_0x54de93+_0x5d7d('0x6a'),'%'+_0x5100d7[_0x5d7d('0x61')]+'%');}break;case'>':_0xf6881[_0x5d7d('0x5e')](_0x5100d7[_0x5d7d('0x64')]+'.'+_0x54de93+_0x5d7d('0x6c'),_0x5100d7[_0x5d7d('0x61')]);break;case'<':_0xf6881[_0x5d7d('0x5e')](_0x5100d7['tableAlias']+'.'+_0x54de93+_0x5d7d('0x6f'),_0x5100d7[_0x5d7d('0x61')]);break;}}}});}else{var _0x25fa7b=_(Object['keys'](_0x5ced5b['query']))['map'](function(_0x5af086){return _0x53a683[_0x5d7d('0x3e')](_0x5af086)?_0x5af086:undefined;})['filter'](function(_0x409946){return!_[_0x5d7d('0x70')](_0x409946);})[_0x5d7d('0x61')]();if(!_['isEmpty'](_0x25fa7b)){_0x25fa7b[_0x5d7d('0x31')](function(_0x45a229){if(_0x45a229===_0x5d7d('0x71')){_0x5e0e66['where'](_0x5d7d('0x72'),[][_0x5d7d('0x73')](_0x5ced5b[_0x5d7d('0x38')][_0x45a229]));}else if(_0x45a229===_0x5d7d('0x58')){var _0x4e17a6=JSON[_0x5d7d('0x57')](_0x5ced5b[_0x5d7d('0x38')][_0x45a229])['$gte'];var _0x4dfeeb=JSON['parse'](_0x5ced5b[_0x5d7d('0x38')][_0x45a229])['$lte'];_0x5e0e66['where'](_0x5d7d('0x74'),_0x4e17a6,_0x4dfeeb);}else{if(_0x5ced5b[_0x5d7d('0x38')][_0x45a229]===_0x5d7d('0x75')){_0x5e0e66['where']('i.'+_0x45a229+_0x5d7d('0x76'));}else{_0x5e0e66['where']('i.'+_0x45a229+_0x5d7d('0x66'),_0x5ced5b[_0x5d7d('0x38')][_0x45a229]);}}});}if(_0x5ced5b[_0x5d7d('0x38')][_0x5d7d('0x77')]){var _0x32e3b3=_0x5ced5b[_0x5d7d('0x38')][_0x5d7d('0x77')][_0x5d7d('0x78')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x5d7d('0x79'));if(qs['isNumeric'](_0x32e3b3)){_0xf6881['or'](_0x5d7d('0x7a'),_0x32e3b3+'%')['or'](_0x5d7d('0x7b'),_0x32e3b3+'%');}_0xf6881['or'](_0x5d7d('0x7c'),_0x32e3b3+'%');}}_0x5e0e66['where'](_0xf6881);if(_0xffd878[_0x5d7d('0x3f')]){_0xffd878[_0x5d7d('0x3f')][_0x5d7d('0x31')](function(_0x445923){_0x5e0e66[_0x5d7d('0x3f')]('i.'+_0x445923[0x0],_0x445923[0x1]===_0x5d7d('0x7d')?![]:!![]);});}_0x5e0e66[_0x5d7d('0x7e')](_0x5d7d('0x7f'));var _0x37dfbe={'type':db[_0x5d7d('0x80')][_0x5d7d('0x81')][_0x5d7d('0x82')],'raw':!![]};var _0x5431d3=_0x5e0e66[_0x5d7d('0x83')]()[_0x5d7d('0x44')](_0x5d7d('0x47'))[_0x5d7d('0x44')](_0x5d7d('0x84'),_0x5d7d('0x63'));if(!_0x5ced5b[_0x5d7d('0x38')]['advancedFilter']){if(_0x5ced5b['query']['read']){if(_0x5ced5b[_0x5d7d('0x38')]['read']==0x1){_0x5431d3[_0x5d7d('0x85')](_0x5d7d('0x86'));_0x5e0e66[_0x5d7d('0x85')]('`unreadMessages`\x20=\x200');}else{_0x5431d3['having'](_0x5d7d('0x87'));_0x5e0e66[_0x5d7d('0x85')](_0x5d7d('0x87'));}}if(_0x5ced5b[_0x5d7d('0x38')][_0x5d7d('0x88')]){var _0x4da1cf=_['isArray'](_0x5ced5b[_0x5d7d('0x38')][_0x5d7d('0x88')])?_0x5ced5b[_0x5d7d('0x38')][_0x5d7d('0x88')]:new Array(_0x5ced5b[_0x5d7d('0x38')][_0x5d7d('0x88')]);var _0x1459e1=squel[_0x5d7d('0x55')]();_0x4da1cf[_0x5d7d('0x31')](function(_0x26af14){_0x1459e1['or'](_0x5d7d('0x89'),'%,'+_0x26af14+',%');});_0x5e0e66[_0x5d7d('0x85')](_0x1459e1);_0x5431d3['left_join'](_0x5d7d('0x8a'),'it',_0x5d7d('0x8b'));_0x5431d3[_0x5d7d('0x51')](_0x5d7d('0x46'),'t',_0x5d7d('0x8c'));_0x5431d3[_0x5d7d('0x41')](_0x5d7d('0x8d'),_0x4da1cf);}}else{var _0x5df779=JSON['parse'](_0x5ced5b[_0x5d7d('0x38')][_0x5d7d('0x56')]);_[_0x5d7d('0x39')](_0x5df779)[_0x5d7d('0x31')](function(_0x4c67ad){var _0x233290=_0x5df779[_0x4c67ad];if(_0x4c67ad===_0x5d7d('0x62')){var _0x3d1492=_0x233290['value'];var _0xd6d719=squel[_0x5d7d('0x55')]();_0x3d1492[_0x5d7d('0x31')](function(_0x2206a2){_0xd6d719['or'](_0x5d7d('0x89'),'%,'+_0x2206a2+',%');});_0x5e0e66['having'](_0xd6d719);_0x5431d3[_0x5d7d('0x51')]('mail_interaction_has_tags','it',_0x5d7d('0x8e'));_0x5431d3['left_join'](_0x5d7d('0x46'),'t','t.id\x20=\x20it.TagId');_0x5431d3['where'](_0x5d7d('0x8d'),_0x3d1492);}else if(_0x4c67ad==='unreadMessages'){if(_0x233290[_0x5d7d('0x61')]['length']===0x1){if(_0x233290[_0x5d7d('0x61')][0x0]===0x1){_0x5431d3[_0x5d7d('0x85')]('`unreadMessages`\x20=\x200');_0x5e0e66['having']('`unreadMessages`\x20=\x200');}else{_0x5431d3[_0x5d7d('0x85')](_0x5d7d('0x87'));_0x5e0e66[_0x5d7d('0x85')]('`unreadMessages`\x20>\x200');}}}});}db[_0x5d7d('0x8f')]['query'](_0x5431d3[_0x5d7d('0x90')](),_0x37dfbe)[_0x5d7d('0x27')](function(_0x5c3b69){_0x10788d['count']=_0x5c3b69[_0x5d7d('0x6d')];if(_0x10788d[_0x5d7d('0x1f')]===0x0)return[];return db[_0x5d7d('0x8f')][_0x5d7d('0x38')](_0x49d502[_0x5d7d('0x90')](),_0x37dfbe)[_0x5d7d('0x27')](function(_0x33a4f1){_0x1ff7ef=_['keyBy'](_0x33a4f1,'id');_0x37dfbe=_[_0x5d7d('0x91')](_0x37dfbe,{'model':db[_0x5d7d('0x35')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x5e0e66[_0x5d7d('0x44')](_0x5d7d('0x84'),_0x5d7d('0x63'));_0x5e0e66[_0x5d7d('0x44')](_0x5d7d('0x92'),_0x5d7d('0x93'));_0x5e0e66['field'](_0x5d7d('0x94'));_0x5e0e66[_0x5d7d('0x44')](_0x5d7d('0x6e'),'Contact.firstName');_0x5e0e66[_0x5d7d('0x44')](_0x5d7d('0x69'),_0x5d7d('0x95'));_0x5e0e66['field'](_0x5d7d('0x6b'),_0x5d7d('0x96'));_0x5e0e66[_0x5d7d('0x44')](_0x5d7d('0x97'),_0x5d7d('0x98'));_0x5e0e66[_0x5d7d('0x44')]('c.mobile',_0x5d7d('0x99'));_0x5e0e66[_0x5d7d('0x44')]('c.fax',_0x5d7d('0x9a'));_0x5e0e66[_0x5d7d('0x44')](_0x5d7d('0x9b'),_0x5d7d('0x2f'));_0x5e0e66['left_join'](_0x5d7d('0x8a'),'it','it.FaxInteractionId\x20=\x20i.id');_0x5e0e66[_0x5d7d('0x51')](_0x5d7d('0x46'),'t',_0x5d7d('0x8c'));_0x5e0e66[_0x5d7d('0x21')](_0xffd878[_0x5d7d('0x21')]);_0x5e0e66[_0x5d7d('0x20')](_0xffd878[_0x5d7d('0x20')]);return db[_0x5d7d('0x8f')][_0x5d7d('0x38')](_0x5e0e66[_0x5d7d('0x90')](),_0x37dfbe);})[_0x5d7d('0x27')](function(_0x1b080c){_0x3ca727['where'](_0x5d7d('0x9c'),_[_0x5d7d('0x2e')](_0x1b080c,'id'));return db['sequelize']['query'](_0x3ca727[_0x5d7d('0x90')](),_0x37dfbe)[_0x5d7d('0x27')](function(_0x4f49b8){var _0x5f40b2=_['groupBy'](_0x4f49b8,'FaxInteractionId');var _0x442d00=[];_0x1b080c['forEach'](function(_0x324cfb){_0x442d00[_0x5d7d('0x32')](updateFaxInteraction(_0x324cfb,_0x1ff7ef,_0x5f40b2));});return BPromise[_0x5d7d('0x9d')](_0x442d00);});});})['then'](function(_0x441725){_0x10788d['rows']=_0x441725;return _0x10788d;})[_0x5d7d('0x27')](respondWithFilteredResult(_0xfc005c,_0xffd878))[_0x5d7d('0x33')](handleError(_0xfc005c,null));};exports['show']=function(_0x41cdc6,_0x382548){var _0x3a33d9={'raw':![],'where':{'id':_0x41cdc6['params']['id']}},_0x2c1799={};_0x2c1799['model']=_[_0x5d7d('0x39')](db[_0x5d7d('0x35')][_0x5d7d('0x36')]);_0x2c1799['query']=_[_0x5d7d('0x39')](_0x41cdc6[_0x5d7d('0x38')]);_0x2c1799[_0x5d7d('0x3a')]=_[_0x5d7d('0x3b')](_0x2c1799[_0x5d7d('0x37')],_0x2c1799['query']);_0x3a33d9[_0x5d7d('0x3d')]=_[_0x5d7d('0x3b')](_0x2c1799['model'],qs[_0x5d7d('0x3c')](_0x41cdc6[_0x5d7d('0x38')]['fields']));_0x3a33d9[_0x5d7d('0x3d')]=_0x3a33d9[_0x5d7d('0x3d')][_0x5d7d('0x6d')]?_0x3a33d9['attributes']:_0x2c1799[_0x5d7d('0x37')];if(_0x41cdc6[_0x5d7d('0x38')]['includeAll']){_0x3a33d9[_0x5d7d('0x9e')]=[{'all':!![]}];}_0x3a33d9=_['merge']({},_0x3a33d9,_0x41cdc6['options']);return db[_0x5d7d('0x35')]['find'](_0x3a33d9)[_0x5d7d('0x27')](handleEntityNotFound(_0x382548,null))[_0x5d7d('0x27')](respondWithResult(_0x382548,null))[_0x5d7d('0x33')](handleError(_0x382548,null));};exports[_0x5d7d('0x9f')]=function(_0x51732e,_0xdb7d04){return db['FaxInteraction'][_0x5d7d('0x9f')](_0x51732e['body'],{})['then'](respondWithResult(_0xdb7d04,0xc9))[_0x5d7d('0x33')](handleError(_0xdb7d04,null));};exports['update']=function(_0x5bc8f0,_0x200a4e){if(_0x5bc8f0[_0x5d7d('0xa0')]['id']){delete _0x5bc8f0[_0x5d7d('0xa0')]['id'];}return db[_0x5d7d('0x35')][_0x5d7d('0xa1')]({'where':{'id':_0x5bc8f0['params']['id']}})[_0x5d7d('0x27')](handleEntityNotFound(_0x200a4e,null))['then'](saveUpdates(_0x5bc8f0[_0x5d7d('0xa0')],null))[_0x5d7d('0x27')](respondWithResult(_0x200a4e,null))[_0x5d7d('0x33')](handleError(_0x200a4e,null));};exports[_0x5d7d('0x28')]=function(_0x3be94c,_0x18435c){return db[_0x5d7d('0x35')]['find']({'where':{'id':_0x3be94c[_0x5d7d('0xa2')]['id']}})[_0x5d7d('0x27')](handleEntityNotFound(_0x18435c,null))[_0x5d7d('0x27')](removeEntity(_0x18435c,null))[_0x5d7d('0x33')](handleError(_0x18435c,null));};exports['describe']=function(_0x2b4ea2,_0xb1167e){return db[_0x5d7d('0x35')]['describe']()[_0x5d7d('0x27')](respondWithResult(_0xb1167e,null))[_0x5d7d('0x33')](handleError(_0xb1167e,null));};exports[_0x5d7d('0xa3')]=function(_0x2048f4,_0x19d7a0,_0x2dc097){return db[_0x5d7d('0xa4')]['find']({'where':{'id':_0x2048f4[_0x5d7d('0xa2')]['id']}})[_0x5d7d('0x27')](handleEntityNotFound(_0x19d7a0,null))[_0x5d7d('0x27')](function(_0x445e42){if(_0x445e42){return _0x445e42[_0x5d7d('0xa3')](_0x2048f4[_0x5d7d('0xa0')][_0x5d7d('0xa5')],_[_0x5d7d('0xa6')](_0x2048f4[_0x5d7d('0xa0')],[_0x5d7d('0xa5'),'id'])||{});}})[_0x5d7d('0x27')](respondWithResult(_0x19d7a0,null))[_0x5d7d('0x33')](handleError(_0x19d7a0,null));};exports['getMessages']=function(_0xdfbd19,_0x217105,_0x5e30bf){var _0x5b4160={'raw':![],'where':{}};var _0x45f8e7={};var _0x36ee31={'count':0x0,'rows':[]};return db[_0x5d7d('0x35')][_0x5d7d('0xa7')]({'where':{'id':_0xdfbd19['params']['id']}})[_0x5d7d('0x27')](handleEntityNotFound(_0x217105,null))[_0x5d7d('0x27')](function(_0x3ea203){if(_0x3ea203){_0x45f8e7[_0x5d7d('0x37')]=_['keys'](db[_0x5d7d('0xa4')]['rawAttributes']);_0x45f8e7['query']=_['keys'](_0xdfbd19[_0x5d7d('0x38')]);_0x45f8e7[_0x5d7d('0x3a')]=_[_0x5d7d('0x3b')](_0x45f8e7[_0x5d7d('0x37')],_0x45f8e7[_0x5d7d('0x38')]);_0x5b4160[_0x5d7d('0x3d')]=_['intersection'](_0x45f8e7['model'],qs[_0x5d7d('0x3c')](_0xdfbd19[_0x5d7d('0x38')][_0x5d7d('0x3c')]));_0x5b4160['attributes']=_0x5b4160[_0x5d7d('0x3d')][_0x5d7d('0x6d')]?_0x5b4160[_0x5d7d('0x3d')]:_0x45f8e7[_0x5d7d('0x37')];if(!_0xdfbd19[_0x5d7d('0x38')]['hasOwnProperty'](_0x5d7d('0xa8'))){_0x5b4160[_0x5d7d('0x21')]=qs[_0x5d7d('0x21')](_0xdfbd19[_0x5d7d('0x38')][_0x5d7d('0x21')]);_0x5b4160[_0x5d7d('0x20')]=qs[_0x5d7d('0x20')](_0xdfbd19[_0x5d7d('0x38')][_0x5d7d('0x20')]);}_0x5b4160[_0x5d7d('0x3f')]=qs[_0x5d7d('0x40')](_0xdfbd19[_0x5d7d('0x38')][_0x5d7d('0x40')]);_0x5b4160['where']=qs[_0x5d7d('0x3a')](_[_0x5d7d('0x42')](_0xdfbd19['query'],_0x45f8e7[_0x5d7d('0x3a')]));_0x5b4160[_0x5d7d('0x41')][_0x5d7d('0xa9')]=_0x3ea203['id'];if(_0xdfbd19[_0x5d7d('0x38')][_0x5d7d('0x77')]){_0x5b4160[_0x5d7d('0x41')]=_['merge'](_0x5b4160[_0x5d7d('0x41')],{'$or':_[_0x5d7d('0x2e')](_0x5b4160['attributes'],function(_0xc45c9a){var _0x106b33={};_0x106b33[_0xc45c9a]={'$like':'%'+_0xdfbd19[_0x5d7d('0x38')]['filter']+'%'};return _0x106b33;})});}if(_0xdfbd19[_0x5d7d('0x38')]['$gte']){var _0x1368b0=_0xdfbd19[_0x5d7d('0x38')]['$gte'][_0x5d7d('0x30')](',');var _0x54a162={};_0x54a162[_0x1368b0[0x0]]={'$gte':moment(_0x1368b0[0x1])[_0x5d7d('0x5d')](_0x5d7d('0xaa'))};_0x5b4160[_0x5d7d('0x41')]=_[_0x5d7d('0x91')](_0x5b4160[_0x5d7d('0x41')],_0x54a162);}_0x5b4160=_['merge']({},_0x5b4160,_0xdfbd19['options']);return db['FaxMessage'][_0x5d7d('0x1f')]({'where':_0x5b4160[_0x5d7d('0x41')]})['then'](function(_0x3dcbf9){_0x36ee31['count']=_0x3dcbf9;if(_0xdfbd19[_0x5d7d('0x38')][_0x5d7d('0xab')]){_0x5b4160[_0x5d7d('0x9e')]=[{'all':!![]}];}return db[_0x5d7d('0xa4')][_0x5d7d('0xac')](_0x5b4160);})[_0x5d7d('0x27')](function(_0x3124a3){_0x36ee31[_0x5d7d('0xad')]=_0x3124a3;return _0x36ee31;});}})[_0x5d7d('0x27')](respondWithFilteredResult(_0x217105,_0x5b4160))[_0x5d7d('0x33')](handleError(_0x217105,null));};exports['addTags']=function(_0x4dc674,_0x2c2680,_0x30f52c){return db['FaxInteraction'][_0x5d7d('0xa1')]({'where':{'id':_0x4dc674[_0x5d7d('0xa2')]['id']}})[_0x5d7d('0x27')](handleEntityNotFound(_0x2c2680,null))[_0x5d7d('0x27')](function(_0x2fccda){if(_0x2fccda){return _0x2fccda[_0x5d7d('0xae')](_0x4dc674[_0x5d7d('0xa0')][_0x5d7d('0xa5')],_[_0x5d7d('0xa6')](_0x4dc674[_0x5d7d('0xa0')],[_0x5d7d('0xa5'),'id'])||{})['spread'](function(){return db[_0x5d7d('0xaf')]['findAll']({'attributes':['id',_0x5d7d('0x2b'),_0x5d7d('0xb0')],'where':{'id':_0x4dc674[_0x5d7d('0xa0')][_0x5d7d('0xa5')]}});})[_0x5d7d('0x27')](function(_0x151cb8){socket[_0x5d7d('0xb1')]('faxInteractionTags:save',{'id':Number(_0x4dc674[_0x5d7d('0xa2')]['id']),'tags':_0x151cb8||[]});return{'id':Number(_0x4dc674[_0x5d7d('0xa2')]['id']),'tags':_0x151cb8||[]};});}})[_0x5d7d('0x27')](respondWithResult(_0x2c2680,null))[_0x5d7d('0x33')](handleError(_0x2c2680,null));};exports[_0x5d7d('0xb2')]=function(_0x3bdd2b,_0x4ee7b7,_0x1211a3){return db['FaxInteraction'][_0x5d7d('0xa1')]({'where':{'id':_0x3bdd2b['params']['id']}})[_0x5d7d('0x27')](handleEntityNotFound(_0x4ee7b7,null))[_0x5d7d('0x27')](function(_0x19a0c3){if(_0x19a0c3){return _0x19a0c3['removeTags'](_0x3bdd2b[_0x5d7d('0x38')]['ids']);}})[_0x5d7d('0x27')](respondWithStatusCode(_0x4ee7b7,null))[_0x5d7d('0x33')](handleError(_0x4ee7b7,null));};exports[_0x5d7d('0xb3')]=function(_0x15aa01,_0x1a99f2){var _0x356444=moment()[_0x5d7d('0xb4')]()[_0x5d7d('0x90')]();var _0x3cfc73=path[_0x5d7d('0xb5')](config[_0x5d7d('0xb6')],'server',_0x5d7d('0xb7'),'attachments');var _0x295524=path[_0x5d7d('0xb5')](config[_0x5d7d('0xb6')],_0x5d7d('0xb8'),_0x5d7d('0xb7'),'tmp');var _0x3a562f=path['join'](_0x295524,_0x356444);var _0x532599=util['format'](_0x5d7d('0xb9'),_0x356444);var _0x5eb7c6=path[_0x5d7d('0xb5')](_0x295524,_0x532599);var _0x37d782=![];return db['FaxInteraction'][_0x5d7d('0xa1')]({'where':{'id':_0x15aa01[_0x5d7d('0xa2')]['id']}})[_0x5d7d('0x27')](handleEntityNotFound(_0x1a99f2,null))[_0x5d7d('0x27')](function(_0x2532fe){if(_0x2532fe){return _0x2532fe['getMessages']({'attributes':['id',_0x5d7d('0xa0'),_0x5d7d('0x58')],'include':[{'model':db[_0x5d7d('0xba')],'as':_0x5d7d('0xba')}]});}return[];})[_0x5d7d('0x27')](function(_0x1a3e29){_0x37d782=_0x1a3e29['length'];if(_0x1a3e29[_0x5d7d('0x6d')]){fs[_0x5d7d('0xbb')](_0x3a562f);for(var _0x4a14f7=0x0;_0x4a14f7<_0x1a3e29['length'];_0x4a14f7++){var _0x33a7b5=_0x1a3e29[_0x4a14f7];var _0x178911=_0x33a7b5['Attachment'];if(_0x178911){var _0x1f9726=path['join'](_0x3cfc73,_0x178911[_0x5d7d('0xbc')]);if(fs['existsSync'](_0x1f9726)){fs[_0x5d7d('0xbd')](_0x1f9726)[_0x5d7d('0xbe')](fs[_0x5d7d('0xbf')](path[_0x5d7d('0xb5')](_0x3a562f,_0x178911[_0x5d7d('0xbc')])));}}}}})[_0x5d7d('0x27')](function(){if(_0x37d782){return new BPromise(function(_0xa618b8,_0x250c85){zipdir(_0x3a562f,{'saveTo':_0x5eb7c6},function(_0x6c4a57,_0x518509){if(_0x6c4a57)return _0x250c85(_0x6c4a57);return _0xa618b8(_0x518509);});});}})[_0x5d7d('0x27')](function(){if(_0x37d782){return new BPromise(function(_0x5840b1,_0x117fc2){rimraf(_0x3a562f,function(_0xdbfa78){if(_0xdbfa78)_0x117fc2(_0xdbfa78);return _0x5840b1();});});}})[_0x5d7d('0x27')](function(){if(_0x37d782){return _0x1a99f2[_0x5d7d('0xb3')](_0x5eb7c6,_0x532599,function(_0x4f22ef){if(_0x4f22ef){console[_0x5d7d('0xc0')](_0x5d7d('0xc1'),_0x4f22ef);}else{fs[_0x5d7d('0xc2')](_0x5eb7c6);}});}else{return _0x1a99f2[_0x5d7d('0xc3')](0xc8);}})[_0x5d7d('0x33')](handleError(_0x1a99f2,null));}; \ No newline at end of file +var _0xe062=['Contact.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','FaxInteractionId','all','params','rawAttributes','includeAll','merge','options','find','create','body','update','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','YYYY-MM-DD\x20HH:mm:ss','include','findAll','spread','emit','faxInteractionTags:save','removeTags','download','unix','join','root','server','attachments','files','tmp','Attachment','existsSync','createReadStream','createWriteStream','log','err','unlinkSync','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','then','destroy','end','error','name','map','TagIds','split','forEach','push','catch','FaxInteraction','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','COUNT(*)','me.FaxInteractionId\x20=\x20i.id','me.read\x20=\x20false','u.id','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','fax_accounts','a.id\x20=\x20i.FaxAccountId','me.FaxInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false','expr','parse','advancedFilter','createdAt','value','dateStart','day','utc','format','endOf','and','isArray','condition','TagId','unreadMessages','tableAlias','\x20IN\x20?','\x20=\x20?','LIKE','ContactId','c.firstName','\x20LIKE\x20?','c.lastName','c.email','\x20<\x20?','\x20>\x20?','filter','isNil','FaxAccountId','concat','$gte','$lte','null','\x20IS\x20NULL','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','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','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','sequelize','toString','keyBy','a.key','Account.key','i.*','Contact.firstName','Contact.lastName','Contact.email','Contact.phone','c.mobile'];(function(_0x145139,_0x5b11d2){var _0x395d06=function(_0x21ae05){while(--_0x21ae05){_0x145139['push'](_0x145139['shift']());}};_0x395d06(++_0x5b11d2);}(_0xe062,0x1b8));var _0x2e06=function(_0x309a55,_0x471760){_0x309a55=_0x309a55-0x0;var _0x3e008f=_0xe062[_0x309a55];return _0x3e008f;};'use strict';var pdf=require(_0x2e06('0x0'));var emlformat=require(_0x2e06('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2e06('0x2'));var rp=require(_0x2e06('0x3'));var moment=require(_0x2e06('0x4'));var BPromise=require(_0x2e06('0x5'));var Mustache=require(_0x2e06('0x6'));var util=require(_0x2e06('0x7'));var path=require(_0x2e06('0x8'));var sox=require(_0x2e06('0x9'));var csv=require(_0x2e06('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2e06('0xb'));var deskjs=require(_0x2e06('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2e06('0xd'));var Redis=require(_0x2e06('0xe'));var authService=require(_0x2e06('0xf'));var qs=require(_0x2e06('0x10'));var hardwareService=require(_0x2e06('0x11'));var logger=require(_0x2e06('0x12'))(_0x2e06('0x13'));var utils=require(_0x2e06('0x14'));var config=require(_0x2e06('0x15'));var db=require(_0x2e06('0x16'))['db'];config[_0x2e06('0x17')]=_[_0x2e06('0x18')](config['redis'],{'host':_0x2e06('0x19'),'port':0x18eb});var socket=require(_0x2e06('0x1a'))(new Redis(config['redis']));require('./faxInteraction.socket')[_0x2e06('0x1b')](socket);function respondWithStatusCode(_0x45d9a7,_0x4d8ff3){_0x4d8ff3=_0x4d8ff3||0xcc;return function(_0x48d757){if(_0x48d757){return _0x45d9a7[_0x2e06('0x1c')](_0x4d8ff3);}return _0x45d9a7['status'](_0x4d8ff3)['end']();};}function respondWithResult(_0x982729,_0xb1dfa9){_0xb1dfa9=_0xb1dfa9||0xc8;return function(_0x501a19){if(_0x501a19){return _0x982729[_0x2e06('0x1d')](_0xb1dfa9)['json'](_0x501a19);}};}function respondWithFilteredResult(_0xd8ec9c,_0x502053){return function(_0x15a25b){if(_0x15a25b){var _0x45b82b=_0x15a25b[_0x2e06('0x1e')],_0x2359e6=_0x502053[_0x2e06('0x1f')],_0x466832=_0x502053['offset']+_0x502053[_0x2e06('0x20')],_0x23e38b;if(_0x466832>=_0x45b82b){_0x466832=_0x45b82b;_0x23e38b=0xc8;}else{_0x23e38b=0xce;}_0xd8ec9c[_0x2e06('0x1d')](_0x23e38b);return _0xd8ec9c[_0x2e06('0x21')](_0x2e06('0x22'),_0x2359e6+'-'+_0x466832+'/'+_0x45b82b)[_0x2e06('0x23')](_0x15a25b);}return null;};}function patchUpdates(_0x43a978){return function(_0x10d4e3){try{jsonpatch[_0x2e06('0x24')](_0x10d4e3,_0x43a978,!![]);}catch(_0x13b89c){return BPromise['reject'](_0x13b89c);}return _0x10d4e3['save']();};}function saveUpdates(_0x52baf9,_0x5c2736){return function(_0x431a90){if(_0x431a90){return _0x431a90['update'](_0x52baf9)[_0x2e06('0x25')](function(_0x1c65c7){return _0x1c65c7;});}return null;};}function removeEntity(_0x569a45,_0x4e895f){return function(_0x1eba15){if(_0x1eba15){return _0x1eba15[_0x2e06('0x26')]()[_0x2e06('0x25')](function(){_0x569a45[_0x2e06('0x1d')](0xcc)[_0x2e06('0x27')]();});}};}function handleEntityNotFound(_0x367ac7,_0x58e0c6){return function(_0x4e0d68){if(!_0x4e0d68){_0x367ac7[_0x2e06('0x1c')](0x194);}return _0x4e0d68;};}function handleError(_0x51e780,_0x427dac){_0x427dac=_0x427dac||0x1f4;return function(_0x4cd21d){logger[_0x2e06('0x28')](_0x4cd21d['stack']);if(_0x4cd21d[_0x2e06('0x29')]){delete _0x4cd21d[_0x2e06('0x29')];}_0x51e780['status'](_0x427dac)['send'](_0x4cd21d);};}function getInteractionUsers(_0xf21b19,_0x39d862){return new BPromise(function(_0x37ede1,_0x588cd6){try{if(_0x39d862[_0xf21b19['id']]){_0xf21b19['Users']=_[_0x2e06('0x2a')](_0x39d862[_0xf21b19['id']],function(_0x568fad){return{'id':_0x568fad['id']};});}}catch(_0x176c44){_0x588cd6(_0x176c44);}_0x37ede1(_0xf21b19);});}function getInteractionTags(_0x59e831,_0x39be27){return new BPromise(function(_0x35bf89,_0x538877){try{if(_0x59e831['TagIds']){_0x59e831['Tags']=[];_0x59e831[_0x2e06('0x2b')][_0x2e06('0x2c')](',')[_0x2e06('0x2d')](function(_0x2d45f4){_0x59e831['Tags'][_0x2e06('0x2e')](_0x39be27[_0x2d45f4]);});}delete _0x59e831[_0x2e06('0x2b')];}catch(_0x1d8bce){_0x538877(_0x1d8bce);}_0x35bf89(_0x59e831);});}function updateFaxInteraction(_0x5a07a2,_0x333be0,_0x681044){return new BPromise(function(_0x2011d7,_0x563811){return getInteractionUsers(_0x5a07a2,_0x681044)['then'](function(_0x305037){return getInteractionTags(_0x305037,_0x333be0);})[_0x2e06('0x25')](function(_0x438547){_0x2011d7(_0x438547);})[_0x2e06('0x2f')](function(_0x1c987f){_0x563811(_0x1c987f);});});}exports['index']=function(_0x2025ff,_0x5b727c){var _0x3b3350={},_0x79c92e={},_0x3396f3={'count':0x0,'rows':[]};var _0x3949af=db[_0x2e06('0x30')]['rawAttributes'];_0x79c92e[_0x2e06('0x31')]=_[_0x2e06('0x32')](_0x3949af);_0x79c92e['query']=_[_0x2e06('0x32')](_0x2025ff[_0x2e06('0x33')]);_0x79c92e[_0x2e06('0x34')]=_[_0x2e06('0x35')](_0x79c92e[_0x2e06('0x31')],_0x79c92e[_0x2e06('0x33')]);_0x3b3350[_0x2e06('0x36')]=_[_0x2e06('0x35')](_0x79c92e['model'],qs[_0x2e06('0x37')](_0x2025ff[_0x2e06('0x33')][_0x2e06('0x37')]));_0x3b3350[_0x2e06('0x36')]=_0x3b3350[_0x2e06('0x36')][_0x2e06('0x38')]?_0x3b3350[_0x2e06('0x36')]:_0x79c92e[_0x2e06('0x31')];if(!_0x2025ff['query'][_0x2e06('0x39')](_0x2e06('0x3a'))){_0x3b3350[_0x2e06('0x20')]=qs[_0x2e06('0x20')](_0x2025ff[_0x2e06('0x33')]['limit']);_0x3b3350['offset']=qs['offset'](_0x2025ff['query'][_0x2e06('0x1f')]);}_0x3b3350[_0x2e06('0x3b')]=qs[_0x2e06('0x3c')](_0x2025ff[_0x2e06('0x33')]['sort']);_0x3b3350[_0x2e06('0x3d')]=qs[_0x2e06('0x34')](_[_0x2e06('0x3e')](_0x2025ff[_0x2e06('0x33')],_0x79c92e[_0x2e06('0x34')]));var _0x47f216=[];var _0x2630b3=squel[_0x2e06('0x3f')]()['field']('id')[_0x2e06('0x40')](_0x2e06('0x29'))[_0x2e06('0x40')](_0x2e06('0x41'))[_0x2e06('0x42')](_0x2e06('0x43'));var _0x977695=squel[_0x2e06('0x3f')]()[_0x2e06('0x40')](_0x2e06('0x44'))[_0x2e06('0x42')]('fax_messages','me')['where'](_0x2e06('0x45'))['where']('me.direction\x20=\x20\x27in\x27')[_0x2e06('0x3d')](_0x2e06('0x46'));var _0x394c50=squel['select']()[_0x2e06('0x40')](_0x2e06('0x47'))['field'](_0x2e06('0x48'))[_0x2e06('0x42')](_0x2e06('0x49'),'ui')[_0x2e06('0x4a')](_0x2e06('0x4b'),'u',_0x2e06('0x4c'));var _0x5370dc=squel[_0x2e06('0x3f')]()['from'](_0x2e06('0x4d'),'i')[_0x2e06('0x4a')](_0x2e06('0x4e'),'c',_0x2e06('0x4f'))[_0x2e06('0x4a')](_0x2e06('0x4b'),'o','o.id\x20=\x20i.UserId')['left_join'](_0x2e06('0x50'),'a',_0x2e06('0x51'))[_0x2e06('0x4a')]('fax_messages','me',_0x2e06('0x52'));var _0x57fae2=squel[_0x2e06('0x53')]();if(_0x2025ff[_0x2e06('0x33')]['advancedFilter']){var _0x38ba07=JSON[_0x2e06('0x54')](_0x2025ff[_0x2e06('0x33')][_0x2e06('0x55')]);_['keys'](_0x38ba07)['forEach'](function(_0x4bc781){var _0x2c6733=_0x38ba07[_0x4bc781];if(_0x4bc781===_0x2e06('0x56')){var _0x45594a=moment(_0x2c6733[_0x2e06('0x57')][_0x2e06('0x58')])['startOf'](_0x2e06('0x59'))[_0x2e06('0x5a')]()[_0x2e06('0x5b')]();var _0x5d9a74=moment(_0x5d9a74)[_0x2e06('0x5a')]()[_0x2e06('0x5c')]('day')[_0x2e06('0x5b')]();_0x57fae2[_0x2e06('0x5d')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x45594a,_0x5d9a74);}else{if(_[_0x2e06('0x5e')](_0x2c6733[_0x2e06('0x5f')])){_0x2c6733[_0x2e06('0x5f')][_0x2e06('0x2d')](function(_0x4a6761){switch(_0x2c6733[_0x2e06('0x5f')]['value']){case'IS':if(_0x4bc781!==_0x2e06('0x60')&&_0x4bc781!==_0x2e06('0x61')){if(_[_0x2e06('0x5e')](_0x2c6733['value'])&&_0x2c6733[_0x2e06('0x57')]['length']>0x1){_0x57fae2[_0x2e06('0x5d')](_0x2c6733[_0x2e06('0x62')]+'.'+_0x4bc781+_0x2e06('0x63'),_0x2c6733[_0x2e06('0x57')]);}else{_0x57fae2[_0x2e06('0x5d')](_0x2c6733[_0x2e06('0x62')]+'.'+_0x4bc781+_0x2e06('0x64'),_0x2c6733[_0x2e06('0x57')][0x0]);}}break;case'=':_0x57fae2[_0x2e06('0x5d')](_0x2c6733[_0x2e06('0x62')]+'.'+_0x4bc781+_0x2e06('0x64'),_0x2c6733[_0x2e06('0x57')]);break;case _0x2e06('0x65'):if(_0x4bc781===_0x2e06('0x66')){_0x57fae2[_0x2e06('0x5d')](_0x2e06('0x67')+_0x2e06('0x68'),'%'+_0x2c6733[_0x2e06('0x57')]+'%');_0x57fae2['or'](_0x2e06('0x69')+_0x2e06('0x68'),'%'+_0x2c6733[_0x2e06('0x57')]+'%');_0x57fae2['or'](_0x2e06('0x6a')+_0x2e06('0x68'),'%'+_0x2c6733[_0x2e06('0x57')]+'%');}else{_0x57fae2[_0x2e06('0x5d')](_0x2c6733[_0x2e06('0x62')]+'.'+_0x4bc781+_0x2e06('0x68'),'%'+_0x2c6733[_0x2e06('0x57')]+'%');}break;case'>':_0x57fae2[_0x2e06('0x5d')](_0x2c6733[_0x2e06('0x62')]+'.'+_0x4bc781+'\x20>\x20?',_0x2c6733['value']);break;case'<':_0x57fae2[_0x2e06('0x5d')](_0x2c6733[_0x2e06('0x62')]+'.'+_0x4bc781+_0x2e06('0x6b'),_0x2c6733[_0x2e06('0x57')]);break;}});}else{switch(_0x2c6733['condition'][_0x2e06('0x57')]){case'IS':if(_0x4bc781!==_0x2e06('0x60')&&_0x4bc781!==_0x2e06('0x61')){if(_[_0x2e06('0x5e')](_0x2c6733['value'])&&_0x2c6733[_0x2e06('0x57')][_0x2e06('0x38')]>0x1){_0x57fae2['and'](_0x2c6733['tableAlias']+'.'+_0x4bc781+_0x2e06('0x63'),_0x2c6733[_0x2e06('0x57')]);}else{_0x57fae2[_0x2e06('0x5d')](_0x2c6733['tableAlias']+'.'+_0x4bc781+'\x20=\x20?',_0x2c6733[_0x2e06('0x57')][0x0]);}}break;case'=':_0x57fae2[_0x2e06('0x5d')](_0x2c6733['tableAlias']+'.'+_0x4bc781+'\x20=\x20?',_0x2c6733[_0x2e06('0x57')]);break;case _0x2e06('0x65'):if(_0x4bc781==='ContactId'){_0x57fae2[_0x2e06('0x5d')](_0x2e06('0x67')+_0x2e06('0x68'),'%'+_0x2c6733['value']+'%');_0x57fae2['or']('c.lastName'+_0x2e06('0x68'),'%'+_0x2c6733[_0x2e06('0x57')]+'%');_0x57fae2['or'](_0x2e06('0x6a')+_0x2e06('0x68'),'%'+_0x2c6733[_0x2e06('0x57')]+'%');}else{_0x57fae2['and'](_0x2c6733[_0x2e06('0x62')]+'.'+_0x4bc781+_0x2e06('0x68'),'%'+_0x2c6733[_0x2e06('0x57')]+'%');}break;case'>':_0x57fae2['and'](_0x2c6733[_0x2e06('0x62')]+'.'+_0x4bc781+_0x2e06('0x6c'),_0x2c6733[_0x2e06('0x57')]);break;case'<':_0x57fae2[_0x2e06('0x5d')](_0x2c6733[_0x2e06('0x62')]+'.'+_0x4bc781+_0x2e06('0x6b'),_0x2c6733[_0x2e06('0x57')]);break;}}}});}else{var _0x46e422=_(Object[_0x2e06('0x32')](_0x2025ff[_0x2e06('0x33')]))[_0x2e06('0x2a')](function(_0xe7bd06){return _0x3949af['hasOwnProperty'](_0xe7bd06)?_0xe7bd06:undefined;})[_0x2e06('0x6d')](function(_0x5a7216){return!_[_0x2e06('0x6e')](_0x5a7216);})[_0x2e06('0x57')]();if(!_['isEmpty'](_0x46e422)){_0x46e422[_0x2e06('0x2d')](function(_0x441ec9){if(_0x441ec9===_0x2e06('0x6f')){_0x5370dc['where']('i.FaxAccountId\x20IN\x20?',[][_0x2e06('0x70')](_0x2025ff[_0x2e06('0x33')][_0x441ec9]));}else if(_0x441ec9===_0x2e06('0x56')){var _0x4709f5=JSON[_0x2e06('0x54')](_0x2025ff['query'][_0x441ec9])[_0x2e06('0x71')];var _0x21cc2b=JSON['parse'](_0x2025ff[_0x2e06('0x33')][_0x441ec9])[_0x2e06('0x72')];_0x5370dc[_0x2e06('0x3d')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4709f5,_0x21cc2b);}else{if(_0x2025ff['query'][_0x441ec9]===_0x2e06('0x73')){_0x5370dc[_0x2e06('0x3d')]('i.'+_0x441ec9+_0x2e06('0x74'));}else{_0x5370dc['where']('i.'+_0x441ec9+_0x2e06('0x64'),_0x2025ff[_0x2e06('0x33')][_0x441ec9]);}}});}if(_0x2025ff['query'][_0x2e06('0x6d')]){var _0x398e7b=_0x2025ff['query']['filter'][_0x2e06('0x75')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x2e06('0x76'));if(qs[_0x2e06('0x77')](_0x398e7b)){_0x57fae2['or'](_0x2e06('0x78'),_0x398e7b+'%')['or'](_0x2e06('0x79'),_0x398e7b+'%');}_0x57fae2['or'](_0x2e06('0x7a'),_0x398e7b+'%');}}_0x5370dc[_0x2e06('0x3d')](_0x57fae2);if(_0x3b3350[_0x2e06('0x3b')]){_0x3b3350[_0x2e06('0x3b')][_0x2e06('0x2d')](function(_0x43853b){_0x5370dc[_0x2e06('0x3b')]('i.'+_0x43853b[0x0],_0x43853b[0x1]===_0x2e06('0x7b')?![]:!![]);});}_0x5370dc[_0x2e06('0x7c')](_0x2e06('0x7d'));var _0x100652={'type':db[_0x2e06('0x7e')][_0x2e06('0x7f')][_0x2e06('0x80')],'raw':!![]};var _0x228acf=_0x5370dc[_0x2e06('0x81')]()[_0x2e06('0x40')](_0x2e06('0x44'))[_0x2e06('0x40')](_0x2e06('0x82'),_0x2e06('0x61'));if(!_0x2025ff['query']['advancedFilter']){if(_0x2025ff['query']['read']){if(_0x2025ff['query'][_0x2e06('0x83')]==0x1){_0x228acf[_0x2e06('0x84')]('`unreadMessages`\x20=\x200');_0x5370dc[_0x2e06('0x84')](_0x2e06('0x85'));}else{_0x228acf['having'](_0x2e06('0x86'));_0x5370dc['having']('`unreadMessages`\x20>\x200');}}if(_0x2025ff['query'][_0x2e06('0x87')]){var _0x1da602=_[_0x2e06('0x5e')](_0x2025ff[_0x2e06('0x33')][_0x2e06('0x87')])?_0x2025ff['query']['tag']:new Array(_0x2025ff['query'][_0x2e06('0x87')]);var _0xbb9c9d=squel['expr']();_0x1da602[_0x2e06('0x2d')](function(_0x26c898){_0xbb9c9d['or'](_0x2e06('0x88'),'%,'+_0x26c898+',%');});_0x5370dc['having'](_0xbb9c9d);_0x228acf[_0x2e06('0x4a')](_0x2e06('0x89'),'it',_0x2e06('0x8a'));_0x228acf[_0x2e06('0x4a')](_0x2e06('0x43'),'t',_0x2e06('0x8b'));_0x228acf['where'](_0x2e06('0x8c'),_0x1da602);}}else{var _0x38ba07=JSON[_0x2e06('0x54')](_0x2025ff[_0x2e06('0x33')][_0x2e06('0x55')]);_['keys'](_0x38ba07)[_0x2e06('0x2d')](function(_0x55aca0){var _0x3e9264=_0x38ba07[_0x55aca0];if(_0x55aca0===_0x2e06('0x60')){var _0xf17a7f=_0x3e9264[_0x2e06('0x57')];var _0x349eaf=squel[_0x2e06('0x53')]();_0xf17a7f[_0x2e06('0x2d')](function(_0x499b28){_0x349eaf['or'](_0x2e06('0x88'),'%,'+_0x499b28+',%');});_0x5370dc[_0x2e06('0x84')](_0x349eaf);_0x228acf[_0x2e06('0x4a')](_0x2e06('0x8d'),'it',_0x2e06('0x8e'));_0x228acf[_0x2e06('0x4a')]('tools_tags','t',_0x2e06('0x8b'));_0x228acf[_0x2e06('0x3d')](_0x2e06('0x8c'),_0xf17a7f);}else if(_0x55aca0===_0x2e06('0x61')){if(_0x3e9264[_0x2e06('0x57')][_0x2e06('0x38')]===0x1){if(_0x3e9264['value'][0x0]===0x1){_0x228acf[_0x2e06('0x84')](_0x2e06('0x85'));_0x5370dc[_0x2e06('0x84')](_0x2e06('0x85'));}else{_0x228acf['having']('`unreadMessages`\x20>\x200');_0x5370dc['having'](_0x2e06('0x86'));}}}});}db[_0x2e06('0x8f')][_0x2e06('0x33')](_0x228acf[_0x2e06('0x90')](),_0x100652)[_0x2e06('0x25')](function(_0xa907f4){_0x3396f3[_0x2e06('0x1e')]=_0xa907f4[_0x2e06('0x38')];if(_0x3396f3['count']===0x0)return[];return db[_0x2e06('0x8f')]['query'](_0x2630b3[_0x2e06('0x90')](),_0x100652)['then'](function(_0x45bcf2){_0x47f216=_[_0x2e06('0x91')](_0x45bcf2,'id');_0x100652=_['merge'](_0x100652,{'model':db[_0x2e06('0x30')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x5370dc[_0x2e06('0x40')](_0x2e06('0x82'),'unreadMessages');_0x5370dc[_0x2e06('0x40')](_0x2e06('0x92'),_0x2e06('0x93'));_0x5370dc['field'](_0x2e06('0x94'));_0x5370dc['field'](_0x2e06('0x67'),_0x2e06('0x95'));_0x5370dc[_0x2e06('0x40')](_0x2e06('0x69'),_0x2e06('0x96'));_0x5370dc[_0x2e06('0x40')](_0x2e06('0x6a'),_0x2e06('0x97'));_0x5370dc[_0x2e06('0x40')]('c.phone',_0x2e06('0x98'));_0x5370dc[_0x2e06('0x40')](_0x2e06('0x99'),_0x2e06('0x9a'));_0x5370dc[_0x2e06('0x40')](_0x2e06('0x9b'),_0x2e06('0x9c'));_0x5370dc['field'](_0x2e06('0x9d'),_0x2e06('0x2b'));_0x5370dc[_0x2e06('0x4a')](_0x2e06('0x89'),'it',_0x2e06('0x8a'));_0x5370dc[_0x2e06('0x4a')]('tools_tags','t','t.id\x20=\x20it.TagId');_0x5370dc['limit'](_0x3b3350[_0x2e06('0x20')]);_0x5370dc[_0x2e06('0x1f')](_0x3b3350[_0x2e06('0x1f')]);return db['sequelize'][_0x2e06('0x33')](_0x5370dc[_0x2e06('0x90')](),_0x100652);})['then'](function(_0x8adddd){_0x394c50[_0x2e06('0x3d')]('ui.FaxInteractionId\x20IN\x20?',_[_0x2e06('0x2a')](_0x8adddd,'id'));return db['sequelize'][_0x2e06('0x33')](_0x394c50[_0x2e06('0x90')](),_0x100652)[_0x2e06('0x25')](function(_0x4f78b5){var _0x3fb827=_['groupBy'](_0x4f78b5,_0x2e06('0x9e'));var _0x25f5a8=[];_0x8adddd[_0x2e06('0x2d')](function(_0x17b102){_0x25f5a8['push'](updateFaxInteraction(_0x17b102,_0x47f216,_0x3fb827));});return BPromise[_0x2e06('0x9f')](_0x25f5a8);});});})[_0x2e06('0x25')](function(_0x30dcdc){_0x3396f3['rows']=_0x30dcdc;return _0x3396f3;})['then'](respondWithFilteredResult(_0x5b727c,_0x3b3350))['catch'](handleError(_0x5b727c,null));};exports['show']=function(_0x5fc2a0,_0x31e770){var _0x585351={'raw':![],'where':{'id':_0x5fc2a0[_0x2e06('0xa0')]['id']}},_0x580fb6={};_0x580fb6[_0x2e06('0x31')]=_[_0x2e06('0x32')](db[_0x2e06('0x30')][_0x2e06('0xa1')]);_0x580fb6[_0x2e06('0x33')]=_[_0x2e06('0x32')](_0x5fc2a0[_0x2e06('0x33')]);_0x580fb6['filters']=_[_0x2e06('0x35')](_0x580fb6[_0x2e06('0x31')],_0x580fb6[_0x2e06('0x33')]);_0x585351['attributes']=_[_0x2e06('0x35')](_0x580fb6['model'],qs[_0x2e06('0x37')](_0x5fc2a0['query'][_0x2e06('0x37')]));_0x585351[_0x2e06('0x36')]=_0x585351[_0x2e06('0x36')]['length']?_0x585351['attributes']:_0x580fb6[_0x2e06('0x31')];if(_0x5fc2a0['query'][_0x2e06('0xa2')]){_0x585351['include']=[{'all':!![]}];}_0x585351=_[_0x2e06('0xa3')]({},_0x585351,_0x5fc2a0[_0x2e06('0xa4')]);return db[_0x2e06('0x30')][_0x2e06('0xa5')](_0x585351)[_0x2e06('0x25')](handleEntityNotFound(_0x31e770,null))['then'](respondWithResult(_0x31e770,null))[_0x2e06('0x2f')](handleError(_0x31e770,null));};exports[_0x2e06('0xa6')]=function(_0x338056,_0x4b2feb){return db[_0x2e06('0x30')]['create'](_0x338056[_0x2e06('0xa7')],{})['then'](respondWithResult(_0x4b2feb,0xc9))[_0x2e06('0x2f')](handleError(_0x4b2feb,null));};exports[_0x2e06('0xa8')]=function(_0x5b1631,_0x308d04){if(_0x5b1631[_0x2e06('0xa7')]['id']){delete _0x5b1631[_0x2e06('0xa7')]['id'];}return db[_0x2e06('0x30')]['find']({'where':{'id':_0x5b1631['params']['id']}})[_0x2e06('0x25')](handleEntityNotFound(_0x308d04,null))['then'](saveUpdates(_0x5b1631[_0x2e06('0xa7')],null))[_0x2e06('0x25')](respondWithResult(_0x308d04,null))[_0x2e06('0x2f')](handleError(_0x308d04,null));};exports[_0x2e06('0x26')]=function(_0x37f361,_0x38e5d1){return db[_0x2e06('0x30')]['find']({'where':{'id':_0x37f361[_0x2e06('0xa0')]['id']}})[_0x2e06('0x25')](handleEntityNotFound(_0x38e5d1,null))[_0x2e06('0x25')](removeEntity(_0x38e5d1,null))[_0x2e06('0x2f')](handleError(_0x38e5d1,null));};exports['describe']=function(_0x2eda57,_0x233493){return db[_0x2e06('0x30')][_0x2e06('0xa9')]()[_0x2e06('0x25')](respondWithResult(_0x233493,null))[_0x2e06('0x2f')](handleError(_0x233493,null));};exports[_0x2e06('0xaa')]=function(_0x8e83e7,_0x530ae5,_0x2b3471){return db[_0x2e06('0xab')][_0x2e06('0xa5')]({'where':{'id':_0x8e83e7[_0x2e06('0xa0')]['id']}})[_0x2e06('0x25')](handleEntityNotFound(_0x530ae5,null))['then'](function(_0x155d92){if(_0x155d92){return _0x155d92[_0x2e06('0xaa')](_0x8e83e7['body'][_0x2e06('0xac')],_[_0x2e06('0xad')](_0x8e83e7['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x530ae5,null))['catch'](handleError(_0x530ae5,null));};exports[_0x2e06('0xae')]=function(_0x194ec8,_0x418400,_0x5a2850){var _0x25ab80={'raw':![],'where':{}};var _0x1e3f47={};var _0x476f57={'count':0x0,'rows':[]};return db[_0x2e06('0x30')][_0x2e06('0xaf')]({'where':{'id':_0x194ec8[_0x2e06('0xa0')]['id']}})[_0x2e06('0x25')](handleEntityNotFound(_0x418400,null))[_0x2e06('0x25')](function(_0x4b0efc){if(_0x4b0efc){_0x1e3f47[_0x2e06('0x31')]=_[_0x2e06('0x32')](db[_0x2e06('0xab')][_0x2e06('0xa1')]);_0x1e3f47[_0x2e06('0x33')]=_['keys'](_0x194ec8['query']);_0x1e3f47['filters']=_[_0x2e06('0x35')](_0x1e3f47['model'],_0x1e3f47[_0x2e06('0x33')]);_0x25ab80[_0x2e06('0x36')]=_['intersection'](_0x1e3f47['model'],qs['fields'](_0x194ec8[_0x2e06('0x33')][_0x2e06('0x37')]));_0x25ab80[_0x2e06('0x36')]=_0x25ab80[_0x2e06('0x36')][_0x2e06('0x38')]?_0x25ab80[_0x2e06('0x36')]:_0x1e3f47['model'];if(!_0x194ec8[_0x2e06('0x33')][_0x2e06('0x39')]('nolimit')){_0x25ab80[_0x2e06('0x20')]=qs[_0x2e06('0x20')](_0x194ec8['query'][_0x2e06('0x20')]);_0x25ab80[_0x2e06('0x1f')]=qs[_0x2e06('0x1f')](_0x194ec8[_0x2e06('0x33')]['offset']);}_0x25ab80[_0x2e06('0x3b')]=qs[_0x2e06('0x3c')](_0x194ec8[_0x2e06('0x33')][_0x2e06('0x3c')]);_0x25ab80[_0x2e06('0x3d')]=qs['filters'](_[_0x2e06('0x3e')](_0x194ec8[_0x2e06('0x33')],_0x1e3f47['filters']));_0x25ab80['where'][_0x2e06('0x9e')]=_0x4b0efc['id'];if(_0x194ec8[_0x2e06('0x33')][_0x2e06('0x6d')]){_0x25ab80[_0x2e06('0x3d')]=_[_0x2e06('0xa3')](_0x25ab80[_0x2e06('0x3d')],{'$or':_[_0x2e06('0x2a')](_0x25ab80[_0x2e06('0x36')],function(_0x599b10){var _0x54ca7c={};_0x54ca7c[_0x599b10]={'$like':'%'+_0x194ec8['query']['filter']+'%'};return _0x54ca7c;})});}if(_0x194ec8[_0x2e06('0x33')]['$gte']){var _0x26e5e3=_0x194ec8[_0x2e06('0x33')]['$gte'][_0x2e06('0x2c')](',');var _0x139913={};_0x139913[_0x26e5e3[0x0]]={'$gte':moment(_0x26e5e3[0x1])[_0x2e06('0x5b')](_0x2e06('0xb0'))};_0x25ab80[_0x2e06('0x3d')]=_[_0x2e06('0xa3')](_0x25ab80[_0x2e06('0x3d')],_0x139913);}_0x25ab80=_['merge']({},_0x25ab80,_0x194ec8[_0x2e06('0xa4')]);return db[_0x2e06('0xab')]['count']({'where':_0x25ab80['where']})[_0x2e06('0x25')](function(_0x447083){_0x476f57['count']=_0x447083;if(_0x194ec8[_0x2e06('0x33')][_0x2e06('0xa2')]){_0x25ab80[_0x2e06('0xb1')]=[{'all':!![]}];}return db[_0x2e06('0xab')][_0x2e06('0xb2')](_0x25ab80);})[_0x2e06('0x25')](function(_0x2dc245){_0x476f57['rows']=_0x2dc245;return _0x476f57;});}})[_0x2e06('0x25')](respondWithFilteredResult(_0x418400,_0x25ab80))['catch'](handleError(_0x418400,null));};exports['addTags']=function(_0x4bd6a8,_0x30fa6e,_0x45ce28){return db[_0x2e06('0x30')][_0x2e06('0xa5')]({'where':{'id':_0x4bd6a8[_0x2e06('0xa0')]['id']}})['then'](handleEntityNotFound(_0x30fa6e,null))[_0x2e06('0x25')](function(_0x44faf1){if(_0x44faf1){return _0x44faf1['setTags'](_0x4bd6a8[_0x2e06('0xa7')][_0x2e06('0xac')],_[_0x2e06('0xad')](_0x4bd6a8[_0x2e06('0xa7')],[_0x2e06('0xac'),'id'])||{})[_0x2e06('0xb3')](function(){return db['Tag'][_0x2e06('0xb2')]({'attributes':['id',_0x2e06('0x29'),'color'],'where':{'id':_0x4bd6a8['body'][_0x2e06('0xac')]}});})['then'](function(_0x4be182){socket[_0x2e06('0xb4')](_0x2e06('0xb5'),{'id':Number(_0x4bd6a8[_0x2e06('0xa0')]['id']),'tags':_0x4be182||[]});return{'id':Number(_0x4bd6a8[_0x2e06('0xa0')]['id']),'tags':_0x4be182||[]};});}})[_0x2e06('0x25')](respondWithResult(_0x30fa6e,null))['catch'](handleError(_0x30fa6e,null));};exports[_0x2e06('0xb6')]=function(_0x447a38,_0xffdb51,_0xf94445){return db['FaxInteraction']['find']({'where':{'id':_0x447a38[_0x2e06('0xa0')]['id']}})[_0x2e06('0x25')](handleEntityNotFound(_0xffdb51,null))[_0x2e06('0x25')](function(_0x19753c){if(_0x19753c){return _0x19753c[_0x2e06('0xb6')](_0x447a38[_0x2e06('0x33')][_0x2e06('0xac')]);}})[_0x2e06('0x25')](respondWithStatusCode(_0xffdb51,null))[_0x2e06('0x2f')](handleError(_0xffdb51,null));};exports[_0x2e06('0xb7')]=function(_0x59f921,_0x1feec1){var _0x2a3ba2=moment()[_0x2e06('0xb8')]()['toString']();var _0x2a2329=path[_0x2e06('0xb9')](config[_0x2e06('0xba')],_0x2e06('0xbb'),'files',_0x2e06('0xbc'));var _0x23504f=path[_0x2e06('0xb9')](config[_0x2e06('0xba')],_0x2e06('0xbb'),_0x2e06('0xbd'),_0x2e06('0xbe'));var _0x6aec98=path[_0x2e06('0xb9')](_0x23504f,_0x2a3ba2);var _0x481d8c=util[_0x2e06('0x5b')]('interaction-%s.zip',_0x2a3ba2);var _0x222289=path[_0x2e06('0xb9')](_0x23504f,_0x481d8c);var _0x47fc5d=![];return db[_0x2e06('0x30')][_0x2e06('0xa5')]({'where':{'id':_0x59f921[_0x2e06('0xa0')]['id']}})['then'](handleEntityNotFound(_0x1feec1,null))[_0x2e06('0x25')](function(_0x1caa74){if(_0x1caa74){return _0x1caa74[_0x2e06('0xae')]({'attributes':['id',_0x2e06('0xa7'),_0x2e06('0x56')],'include':[{'model':db[_0x2e06('0xbf')],'as':_0x2e06('0xbf')}]});}return[];})[_0x2e06('0x25')](function(_0x4e75d7){_0x47fc5d=_0x4e75d7[_0x2e06('0x38')];if(_0x4e75d7[_0x2e06('0x38')]){fs['mkdirSync'](_0x6aec98);for(var _0x17ffb0=0x0;_0x17ffb0<_0x4e75d7[_0x2e06('0x38')];_0x17ffb0++){var _0x314cdf=_0x4e75d7[_0x17ffb0];var _0x3465f4=_0x314cdf['Attachment'];if(_0x3465f4){var _0x13bf23=path[_0x2e06('0xb9')](_0x2a2329,_0x3465f4['basename']);if(fs[_0x2e06('0xc0')](_0x13bf23)){fs[_0x2e06('0xc1')](_0x13bf23)['pipe'](fs[_0x2e06('0xc2')](path['join'](_0x6aec98,_0x3465f4['basename'])));}}}}})[_0x2e06('0x25')](function(){if(_0x47fc5d){return new BPromise(function(_0x56d861,_0x24925c){zipdir(_0x6aec98,{'saveTo':_0x222289},function(_0x471163,_0x473b99){if(_0x471163)return _0x24925c(_0x471163);return _0x56d861(_0x473b99);});});}})['then'](function(){if(_0x47fc5d){return new BPromise(function(_0x510cf6,_0xb2647){rimraf(_0x6aec98,function(_0x5377be){if(_0x5377be)_0xb2647(_0x5377be);return _0x510cf6();});});}})['then'](function(){if(_0x47fc5d){return _0x1feec1[_0x2e06('0xb7')](_0x222289,_0x481d8c,function(_0x499744){if(_0x499744){console[_0x2e06('0xc3')](_0x2e06('0xc4'),_0x499744);}else{fs[_0x2e06('0xc5')](_0x222289);}});}else{return _0x1feec1[_0x2e06('0x1c')](0xc8);}})['catch'](handleError(_0x1feec1,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 2bc0429..f3c082e 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 _0x13fc=['setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','save','update','getUsers','then'];(function(_0x4c328a,_0x18d1dc){var _0x37b7aa=function(_0x3a96a1){while(--_0x3a96a1){_0x4c328a['push'](_0x4c328a['shift']());}};_0x37b7aa(++_0x18d1dc);}(_0x13fc,0x13b));var _0xc13f=function(_0x16945e,_0x28e97c){_0x16945e=_0x16945e-0x0;var _0x909a4f=_0x13fc[_0x16945e];return _0x909a4f;};'use strict';var EventEmitter=require(_0xc13f('0x0'));var FaxInteraction=require(_0xc13f('0x1'))['db'][_0xc13f('0x2')];var FaxMessage=require(_0xc13f('0x1'))['db'][_0xc13f('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc13f('0x4'),'afterUpdate':_0xc13f('0x5'),'afterDestroy':'remove'};function emitEvent(_0x56981e){return function(_0x20a88d,_0x27e933,_0x5487a8){_0x20a88d[_0xc13f('0x6')]({'attributes':['id'],'raw':!![]})[_0xc13f('0x7')](function(_0x5a1615){_0x20a88d[_0xc13f('0x8')](_0xc13f('0x9'),_0x5a1615[_0xc13f('0xa')](function(_0x1f9ad0){return{'id':_0x1f9ad0['id']};}));return FaxMessage[_0xc13f('0xb')]({'where':{'FaxInteractionId':_0x20a88d['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x746762){_0x20a88d[_0xc13f('0x8')](_0xc13f('0xc'),_0x746762[_0xc13f('0xd')]);FaxInteractionEvents[_0xc13f('0xe')](_0x56981e+':'+_0x20a88d['id'],_0x20a88d);FaxInteractionEvents[_0xc13f('0xe')](_0x56981e,_0x20a88d);_0x5487a8(null);})[_0xc13f('0xf')](_0x5487a8(null));};}for(var e in events){if(events[_0xc13f('0x10')](e)){var event=events[e];FaxInteraction[_0xc13f('0x11')](e,emitEvent(event));}}module[_0xc13f('0x12')]=FaxInteractionEvents; \ No newline at end of file +var _0x0bcc=['hasOwnProperty','hook','events','../../mysqldb','FaxInteraction','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','length','emit','catch'];(function(_0xd0b35f,_0x33fe19){var _0x366394=function(_0x15b67a){while(--_0x15b67a){_0xd0b35f['push'](_0xd0b35f['shift']());}};_0x366394(++_0x33fe19);}(_0x0bcc,0x146));var _0xc0bc=function(_0x45241c,_0x42a412){_0x45241c=_0x45241c-0x0;var _0x736427=_0x0bcc[_0x45241c];return _0x736427;};'use strict';var EventEmitter=require(_0xc0bc('0x0'));var FaxInteraction=require(_0xc0bc('0x1'))['db'][_0xc0bc('0x2')];var FaxMessage=require(_0xc0bc('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xc0bc('0x3')](0x0);var events={'afterCreate':_0xc0bc('0x4'),'afterUpdate':_0xc0bc('0x5'),'afterDestroy':_0xc0bc('0x6')};function emitEvent(_0x2f58f1){return function(_0x5b0139,_0x5008fd,_0x40d22d){_0x5b0139[_0xc0bc('0x7')]({'attributes':['id'],'raw':!![]})[_0xc0bc('0x8')](function(_0x19ba7e){_0x5b0139[_0xc0bc('0x9')](_0xc0bc('0xa'),_0x19ba7e[_0xc0bc('0xb')](function(_0x16e1b9){return{'id':_0x16e1b9['id']};}));return FaxMessage[_0xc0bc('0xc')]({'where':{'FaxInteractionId':_0x5b0139['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc0bc('0x8')](function(_0x22e1f2){_0x5b0139[_0xc0bc('0x9')]('unreadMessages',_0x22e1f2[_0xc0bc('0xd')]);FaxInteractionEvents[_0xc0bc('0xe')](_0x2f58f1+':'+_0x5b0139['id'],_0x5b0139);FaxInteractionEvents[_0xc0bc('0xe')](_0x2f58f1,_0x5b0139);_0x40d22d(null);})[_0xc0bc('0xf')](_0x40d22d(null));};}for(var e in events){if(events[_0xc0bc('0x10')](e)){var event=events[e];FaxInteraction[_0xc0bc('0x11')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 5a172ed..e5bd491 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 _0xaadb=['../../config/logger','moment','bluebird','request-promise','path','./faxInteraction.attributes','define','FaxInteraction','closed','closedAt','format','lodash','util'];(function(_0x58b8e6,_0x196a4d){var _0x1fb8f0=function(_0x4b0376){while(--_0x4b0376){_0x58b8e6['push'](_0x58b8e6['shift']());}};_0x1fb8f0(++_0x196a4d);}(_0xaadb,0xa7));var _0xbaad=function(_0x5adfeb,_0x5203e2){_0x5adfeb=_0x5adfeb-0x0;var _0x3d9eb0=_0xaadb[_0x5adfeb];return _0x3d9eb0;};'use strict';var _=require(_0xbaad('0x0'));var util=require(_0xbaad('0x1'));var logger=require(_0xbaad('0x2'))('api');var moment=require(_0xbaad('0x3'));var BPromise=require(_0xbaad('0x4'));var rp=require(_0xbaad('0x5'));var fs=require('fs');var path=require(_0xbaad('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbaad('0x7'));module['exports']=function(_0x3a2280,_0x44d178){return _0x3a2280[_0xbaad('0x8')](_0xbaad('0x9'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1a6c47,_0x2d36e1,_0x35e5ae){if(_0x1a6c47['changed'](_0xbaad('0xa'))){_0x1a6c47[_0xbaad('0xb')]=moment()[_0xbaad('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x35e5ae(null,_0x1a6c47);}}});}; \ No newline at end of file +var _0x3427=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports','define','FaxInteraction','changed','closed','closedAt','format','lodash'];(function(_0x56164c,_0x5e4dc0){var _0x19961b=function(_0x45090c){while(--_0x45090c){_0x56164c['push'](_0x56164c['shift']());}};_0x19961b(++_0x5e4dc0);}(_0x3427,0xfb));var _0x7342=function(_0x2bd36c,_0x55f151){_0x2bd36c=_0x2bd36c-0x0;var _0x2eedf1=_0x3427[_0x2bd36c];return _0x2eedf1;};'use strict';var _=require(_0x7342('0x0'));var util=require('util');var logger=require(_0x7342('0x1'))(_0x7342('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7342('0x3'));var fs=require('fs');var path=require(_0x7342('0x4'));var rimraf=require(_0x7342('0x5'));var config=require(_0x7342('0x6'));var attributes=require('./faxInteraction.attributes');module[_0x7342('0x7')]=function(_0x1b5cdd,_0x3d8743){return _0x1b5cdd[_0x7342('0x8')](_0x7342('0x9'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x228988,_0x1453f9,_0x2363a6){if(_0x228988[_0x7342('0xa')](_0x7342('0xb'))){_0x228988[_0x7342('0xc')]=moment()[_0x7342('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2363a6(null,_0x228988);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 8b58b51..2919212 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 _0xda2d=['code','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','where','attributes','limit','then','debug','stringify','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','redis','defaults','./faxInteraction.socket','register','request','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','error'];(function(_0x411070,_0x2fcb64){var _0x123d7f=function(_0x3db763){while(--_0x3db763){_0x411070['push'](_0x411070['shift']());}};_0x123d7f(++_0x2fcb64);}(_0xda2d,0x8d));var _0xdda2=function(_0x80eea8,_0x310873){_0x80eea8=_0x80eea8-0x0;var _0xb5d26b=_0xda2d[_0x80eea8];return _0xb5d26b;};'use strict';var _=require(_0xdda2('0x0'));var util=require(_0xdda2('0x1'));var moment=require(_0xdda2('0x2'));var BPromise=require('bluebird');var rs=require(_0xdda2('0x3'));var fs=require('fs');var Redis=require(_0xdda2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdda2('0x5'));var logger=require(_0xdda2('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xdda2('0x7'));var client=jayson[_0xdda2('0x8')]['http']({'port':0x232a});config[_0xdda2('0x9')]=_[_0xdda2('0xa')](config[_0xdda2('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdda2('0x9')]));require(_0xdda2('0xb'))[_0xdda2('0xc')](socket);function respondWithRpcPromise(_0x3412df,_0x31e8ac,_0x26c8e7){return new BPromise(function(_0x327c47,_0x54f1f6){return client[_0xdda2('0xd')](_0x3412df,_0x26c8e7)['then'](function(_0x40cec5){logger[_0xdda2('0xe')](_0xdda2('0xf'),_0x31e8ac,_0xdda2('0x10'));logger['debug'](_0xdda2('0x11'),_0x31e8ac,'request\x20sent',JSON['stringify'](_0x40cec5));if(_0x40cec5[_0xdda2('0x12')]){if(_0x40cec5[_0xdda2('0x12')][_0xdda2('0x13')]===0x1f4){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x31e8ac,_0x40cec5['error'][_0xdda2('0x14')]);return _0x54f1f6(_0x40cec5[_0xdda2('0x12')][_0xdda2('0x14')]);}logger[_0xdda2('0x12')](_0xdda2('0xf'),_0x31e8ac,_0x40cec5[_0xdda2('0x12')]['message']);return _0x327c47(_0x40cec5[_0xdda2('0x12')][_0xdda2('0x14')]);}else{logger['info']('FaxInteraction,\x20%s,\x20%s',_0x31e8ac,_0xdda2('0x10'));_0x327c47(_0x40cec5[_0xdda2('0x15')][_0xdda2('0x14')]);}})[_0xdda2('0x16')](function(_0x3d26bc){logger['error'](_0xdda2('0xf'),_0x31e8ac,_0x3d26bc);_0x54f1f6(_0x3d26bc);});});}exports[_0xdda2('0x17')]=function(_0x18e4a1){var _0x2f380d=this;return new Promise(function(_0x4aba7d,_0x2298af){return db[_0xdda2('0x18')][_0xdda2('0x19')](_0x18e4a1[_0xdda2('0x1a')],{'raw':_0x18e4a1['options']?_0x18e4a1[_0xdda2('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18e4a1[_0xdda2('0x1b')]?_0x18e4a1[_0xdda2('0x1b')][_0xdda2('0x1c')]||null:null,'attributes':_0x18e4a1[_0xdda2('0x1b')]?_0x18e4a1[_0xdda2('0x1b')][_0xdda2('0x1d')]||null:null,'limit':_0x18e4a1[_0xdda2('0x1b')]?_0x18e4a1[_0xdda2('0x1b')][_0xdda2('0x1e')]||null:null})[_0xdda2('0x1f')](function(_0xf1b9b9){logger[_0xdda2('0xe')](_0xdda2('0x17'),_0x18e4a1);logger[_0xdda2('0x20')](_0xdda2('0x17'),_0x18e4a1,JSON[_0xdda2('0x21')](_0xf1b9b9));_0x4aba7d(_0xf1b9b9);})[_0xdda2('0x16')](function(_0xdf8abc){logger[_0xdda2('0x12')]('UpdateFaxInteraction',_0xdf8abc[_0xdda2('0x14')],_0x18e4a1);_0x2298af(_0x2f380d[_0xdda2('0x12')](0x1f4,_0xdf8abc[_0xdda2('0x14')]));});});};exports['AddTagsToFaxInteraction']=function(_0x555866){return new Promise(function(_0x1f56af,_0x1034c6){return db[_0xdda2('0x18')][_0xdda2('0x22')]({'where':_0x555866[_0xdda2('0x1b')]?_0x555866[_0xdda2('0x1b')][_0xdda2('0x1c')]||null:null})['then'](function(_0x3283de){if(_0x3283de){return _0x3283de[_0xdda2('0x23')](_0x555866[_0xdda2('0x1a')][_0xdda2('0x24')],_[_0xdda2('0x25')](_0x555866[_0xdda2('0x1a')],[_0xdda2('0x24'),'id'])||{});}})[_0xdda2('0x26')](function(_0x42d9fa){logger[_0xdda2('0xe')](_0xdda2('0x27'),_0x555866);logger[_0xdda2('0x20')](_0xdda2('0x27'),_0x555866,JSON[_0xdda2('0x21')](_0x42d9fa));_0x1f56af(_0x42d9fa);})[_0xdda2('0x16')](function(_0x1b921a){logger[_0xdda2('0x12')](_0xdda2('0x27'),_0x1b921a[_0xdda2('0x14')],_0x555866);_0x1034c6(_this[_0xdda2('0x12')](0x1f4,_0x1b921a['message']));});});}; \ No newline at end of file +var _0xfd03=['FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateFaxInteraction','update','body','options','raw','attributes','limit','stringify','FaxInteraction','where','then','ids','omit','spread','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','request','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5a25cf,_0x4c45fd){var _0x2400cc=function(_0x3e224b){while(--_0x3e224b){_0x5a25cf['push'](_0x5a25cf['shift']());}};_0x2400cc(++_0x4c45fd);}(_0xfd03,0x133));var _0x3fd0=function(_0x43a37c,_0x25a567){_0x43a37c=_0x43a37c-0x0;var _0x5d1d40=_0xfd03[_0x43a37c];return _0x5d1d40;};'use strict';var _=require(_0x3fd0('0x0'));var util=require(_0x3fd0('0x1'));var moment=require(_0x3fd0('0x2'));var BPromise=require(_0x3fd0('0x3'));var rs=require(_0x3fd0('0x4'));var fs=require('fs');var Redis=require(_0x3fd0('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3fd0('0x6'))(_0x3fd0('0x7'));var config=require(_0x3fd0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3fd0('0x9')][_0x3fd0('0xa')]({'port':0x232a});config[_0x3fd0('0xb')]=_['defaults'](config[_0x3fd0('0xb')],{'host':_0x3fd0('0xc'),'port':0x18eb});var socket=require(_0x3fd0('0xd'))(new Redis(config[_0x3fd0('0xb')]));require(_0x3fd0('0xe'))[_0x3fd0('0xf')](socket);function respondWithRpcPromise(_0xf855e,_0x33779a,_0x5b1063){return new BPromise(function(_0x363c41,_0x84285d){return client[_0x3fd0('0x10')](_0xf855e,_0x5b1063)['then'](function(_0x35ed9a){logger[_0x3fd0('0x11')](_0x3fd0('0x12'),_0x33779a,_0x3fd0('0x13'));logger[_0x3fd0('0x14')](_0x3fd0('0x15'),_0x33779a,_0x3fd0('0x13'),JSON['stringify'](_0x35ed9a));if(_0x35ed9a[_0x3fd0('0x16')]){if(_0x35ed9a[_0x3fd0('0x16')][_0x3fd0('0x17')]===0x1f4){logger['error'](_0x3fd0('0x12'),_0x33779a,_0x35ed9a[_0x3fd0('0x16')][_0x3fd0('0x18')]);return _0x84285d(_0x35ed9a['error'][_0x3fd0('0x18')]);}logger[_0x3fd0('0x16')](_0x3fd0('0x12'),_0x33779a,_0x35ed9a['error'][_0x3fd0('0x18')]);return _0x363c41(_0x35ed9a[_0x3fd0('0x16')][_0x3fd0('0x18')]);}else{logger[_0x3fd0('0x11')](_0x3fd0('0x12'),_0x33779a,_0x3fd0('0x13'));_0x363c41(_0x35ed9a[_0x3fd0('0x19')][_0x3fd0('0x18')]);}})[_0x3fd0('0x1a')](function(_0x1e24da){logger[_0x3fd0('0x16')]('FaxInteraction,\x20%s,\x20%s',_0x33779a,_0x1e24da);_0x84285d(_0x1e24da);});});}exports[_0x3fd0('0x1b')]=function(_0x165f90){var _0x2e81ec=this;return new Promise(function(_0x4780a8,_0x1e4983){return db['FaxInteraction'][_0x3fd0('0x1c')](_0x165f90[_0x3fd0('0x1d')],{'raw':_0x165f90[_0x3fd0('0x1e')]?_0x165f90[_0x3fd0('0x1e')][_0x3fd0('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x165f90[_0x3fd0('0x1e')]?_0x165f90['options']['where']||null:null,'attributes':_0x165f90[_0x3fd0('0x1e')]?_0x165f90[_0x3fd0('0x1e')][_0x3fd0('0x20')]||null:null,'limit':_0x165f90[_0x3fd0('0x1e')]?_0x165f90['options'][_0x3fd0('0x21')]||null:null})['then'](function(_0xd605){logger[_0x3fd0('0x11')](_0x3fd0('0x1b'),_0x165f90);logger['debug'](_0x3fd0('0x1b'),_0x165f90,JSON[_0x3fd0('0x22')](_0xd605));_0x4780a8(_0xd605);})[_0x3fd0('0x1a')](function(_0x4e56ae){logger[_0x3fd0('0x16')](_0x3fd0('0x1b'),_0x4e56ae['message'],_0x165f90);_0x1e4983(_0x2e81ec[_0x3fd0('0x16')](0x1f4,_0x4e56ae[_0x3fd0('0x18')]));});});};exports['AddTagsToFaxInteraction']=function(_0x405420){return new Promise(function(_0x31b404,_0x1aedcc){return db[_0x3fd0('0x23')]['find']({'where':_0x405420[_0x3fd0('0x1e')]?_0x405420['options'][_0x3fd0('0x24')]||null:null})[_0x3fd0('0x25')](function(_0x90371e){if(_0x90371e){return _0x90371e['addTags'](_0x405420[_0x3fd0('0x1d')][_0x3fd0('0x26')],_[_0x3fd0('0x27')](_0x405420[_0x3fd0('0x1d')],[_0x3fd0('0x26'),'id'])||{});}})[_0x3fd0('0x28')](function(_0x41876b){logger[_0x3fd0('0x11')]('AddTags',_0x405420);logger[_0x3fd0('0x14')]('AddTags',_0x405420,JSON['stringify'](_0x41876b));_0x31b404(_0x41876b);})[_0x3fd0('0x1a')](function(_0x5d076c){logger['error']('AddTags',_0x5d076c[_0x3fd0('0x18')],_0x405420);_0x1aedcc(_this[_0x3fd0('0x16')](0x1f4,_0x5d076c[_0x3fd0('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 0bae97a..4e517b0 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 _0x741b=['faxInteraction:','./faxInteraction.events','remove','update','emit','register','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x741b,0x143));var _0xb741=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x741b[_0x13ea00];return _0x1f7347;};'use strict';var FaxInteractionEvents=require(_0xb741('0x0'));var events=['save',_0xb741('0x1'),_0xb741('0x2')];function createListener(_0x2118ef,_0x49a90b){return function(_0xdd4ea3){_0x49a90b[_0xb741('0x3')](_0x2118ef,_0xdd4ea3);};}function removeListener(_0x3bb69a,_0x1c5705){return function(){FaxInteractionEvents['removeListener'](_0x3bb69a,_0x1c5705);};}exports[_0xb741('0x4')]=function(_0x2432d9){for(var _0x189a81=0x0,_0x1200db=events[_0xb741('0x5')];_0x189a81<_0x1200db;_0x189a81++){var _0xeda46e=events[_0x189a81];var _0x283cbb=createListener(_0xb741('0x6')+_0xeda46e,_0x2432d9);FaxInteractionEvents['on'](_0xeda46e,_0x283cbb);}}; \ No newline at end of file +var _0xc584=['faxInteraction:','save','remove','update','emit','removeListener','register'];(function(_0x5d5704,_0x1c4897){var _0xc88958=function(_0x58f7dd){while(--_0x58f7dd){_0x5d5704['push'](_0x5d5704['shift']());}};_0xc88958(++_0x1c4897);}(_0xc584,0x9b));var _0x4c58=function(_0x455893,_0x909838){_0x455893=_0x455893-0x0;var _0x3851e8=_0xc584[_0x455893];return _0x3851e8;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x4c58('0x0'),_0x4c58('0x1'),_0x4c58('0x2')];function createListener(_0x2236cd,_0x50f3ed){return function(_0x4e48e0){_0x50f3ed[_0x4c58('0x3')](_0x2236cd,_0x4e48e0);};}function removeListener(_0x120811,_0x114023){return function(){FaxInteractionEvents[_0x4c58('0x4')](_0x120811,_0x114023);};}exports[_0x4c58('0x5')]=function(_0x21c681){for(var _0x41528a=0x0,_0x2e57ee=events['length'];_0x41528a<_0x2e57ee;_0x41528a++){var _0x3e22a3=events[_0x41528a];var _0x4d3a92=createListener(_0x4c58('0x6')+_0x3e22a3,_0x21c681);FaxInteractionEvents['on'](_0x3e22a3,_0x4d3a92);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index a691b58..1f7c936 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 _0xa6de=['/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','tracked','fax','addTags','put','delete','faxinteraction:destroy','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./faxInteraction.controller','get','index'];(function(_0x1b777a,_0x5383b7){var _0x2faab6=function(_0x4aa331){while(--_0x4aa331){_0x1b777a['push'](_0x1b777a['shift']());}};_0x2faab6(++_0x5383b7);}(_0xa6de,0xde));var _0xea6d=function(_0x30182f,_0x30ce41){_0x30182f=_0x30182f-0x0;var _0x5207db=_0xa6de[_0x30182f];return _0x5207db;};'use strict';var multer=require(_0xea6d('0x0'));var util=require(_0xea6d('0x1'));var path=require(_0xea6d('0x2'));var timeout=require(_0xea6d('0x3'));var express=require('express');var router=express[_0xea6d('0x4')]();var auth=require(_0xea6d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xea6d('0x6'));var controller=require(_0xea6d('0x7'));router[_0xea6d('0x8')]('/',auth['isAuthenticated'](),controller[_0xea6d('0x9')]);router['get'](_0xea6d('0xa'),auth[_0xea6d('0xb')](),controller[_0xea6d('0xc')]);router[_0xea6d('0x8')](_0xea6d('0xd'),auth[_0xea6d('0xb')](),controller[_0xea6d('0xe')]);router['get'](_0xea6d('0xf'),auth['isAuthenticated'](),controller[_0xea6d('0x10')]);router[_0xea6d('0x8')](_0xea6d('0x11'),auth['isAuthenticated'](),controller[_0xea6d('0x12')]);router[_0xea6d('0x13')]('/',auth[_0xea6d('0xb')](),controller[_0xea6d('0x14')]);router[_0xea6d('0x13')](_0xea6d('0xf'),auth['isAuthenticated'](),controller['addMessage']);router[_0xea6d('0x13')]('/:id/tags',auth['isAuthenticated'](),interaction[_0xea6d('0x15')](_0xea6d('0x16'),'faxinteraction:addtags'),controller[_0xea6d('0x17')]);router[_0xea6d('0x18')](_0xea6d('0xd'),auth[_0xea6d('0xb')](),interaction['tracked'](_0xea6d('0x16'),'faxinteraction:update'),controller['update']);router[_0xea6d('0x19')](_0xea6d('0xd'),auth['isAuthenticated'](),interaction['tracked'](_0xea6d('0x16'),_0xea6d('0x1a')),controller[_0xea6d('0x1b')]);router['delete']('/:id/tags',auth['isAuthenticated'](),controller['removeTags']);module[_0xea6d('0x1c')]=router; \ No newline at end of file +var _0x115c=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','index','/describe','describe','/:id','isAuthenticated','/:id/download','post','create','/:id/messages','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','update','delete','faxinteraction:destroy','destroy','removeTags','multer','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x115c,0xc9));var _0xc115=function(_0x57ee02,_0x58b0c4){_0x57ee02=_0x57ee02-0x0;var _0x2fc9b0=_0x115c[_0x57ee02];return _0x2fc9b0;};'use strict';var multer=require(_0xc115('0x0'));var util=require(_0xc115('0x1'));var path=require('path');var timeout=require(_0xc115('0x2'));var express=require(_0xc115('0x3'));var router=express[_0xc115('0x4')]();var auth=require(_0xc115('0x5'));var interaction=require(_0xc115('0x6'));var config=require(_0xc115('0x7'));var controller=require(_0xc115('0x8'));router[_0xc115('0x9')]('/',auth['isAuthenticated'](),controller[_0xc115('0xa')]);router['get'](_0xc115('0xb'),auth['isAuthenticated'](),controller[_0xc115('0xc')]);router[_0xc115('0x9')](_0xc115('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xc115('0x9')]('/:id/messages',auth[_0xc115('0xe')](),controller['getMessages']);router['get'](_0xc115('0xf'),auth[_0xc115('0xe')](),controller['download']);router[_0xc115('0x10')]('/',auth[_0xc115('0xe')](),controller[_0xc115('0x11')]);router[_0xc115('0x10')](_0xc115('0x12'),auth[_0xc115('0xe')](),controller['addMessage']);router[_0xc115('0x10')](_0xc115('0x13'),auth['isAuthenticated'](),interaction[_0xc115('0x14')](_0xc115('0x15'),_0xc115('0x16')),controller[_0xc115('0x17')]);router['put'](_0xc115('0xd'),auth[_0xc115('0xe')](),interaction[_0xc115('0x14')]('fax','faxinteraction:update'),controller[_0xc115('0x18')]);router[_0xc115('0x19')](_0xc115('0xd'),auth['isAuthenticated'](),interaction[_0xc115('0x14')](_0xc115('0x15'),_0xc115('0x1a')),controller[_0xc115('0x1b')]);router[_0xc115('0x19')](_0xc115('0x13'),auth['isAuthenticated'](),controller[_0xc115('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index b95997a..4509c4b 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 _0x1c99=['DATE','sequelize','TEXT','medium','BOOLEAN','out'];(function(_0x51c0a4,_0x293527){var _0x39a97e=function(_0x4fb61f){while(--_0x4fb61f){_0x51c0a4['push'](_0x51c0a4['shift']());}};_0x39a97e(++_0x293527);}(_0x1c99,0x181));var _0x91c9=function(_0x228ac9,_0x42f065){_0x228ac9=_0x228ac9-0x0;var _0x69fe02=_0x1c99[_0x228ac9];return _0x69fe02;};'use strict';var Sequelize=require(_0x91c9('0x0'));module['exports']={'body':{'type':Sequelize[_0x91c9('0x1')](_0x91c9('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x91c9('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x91c9('0x4')),'defaultValue':_0x91c9('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x91c9('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x91c9('0x5')]}}; \ No newline at end of file +var _0x13ad=['DATE','TEXT','BOOLEAN','ENUM','out'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x13ad,0xd8));var _0xd13a=function(_0x431cd0,_0x2f66c8){_0x431cd0=_0x431cd0-0x0;var _0x4f8664=_0x13ad[_0x431cd0];return _0x4f8664;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xd13a('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xd13a('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd13a('0x2')]('in','out'),'defaultValue':_0xd13a('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xd13a('0x0')],'defaultValue':null},'readAt':{'type':Sequelize[_0xd13a('0x4')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 2f6a13d..6df059a 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 _0x0340=['params','keys','intersection','fields','find','body','destroy','describe','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','FaxInteraction','FaxInteractionId','isNil','get','role','interaction','null','acceptMessage','manual','SIP/%s','channel','event','EventManager','agent','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','create','findOne','ContactId','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','files','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/environment','redis','defaults','./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~!@#$%^&-_=+[{]}.','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','apply','reject','save','update','then','end','stack','name','send','index','FaxMessage','rawAttributes','model','query','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','type','key','VIRTUAL','options','includeAll','include','findAll','show'];(function(_0x3f08e7,_0x47fd43){var _0x51b896=function(_0x31be28){while(--_0x31be28){_0x3f08e7['push'](_0x3f08e7['shift']());}};_0x51b896(++_0x47fd43);}(_0x0340,0x131));var _0x0034=function(_0x708446,_0xb746fa){_0x708446=_0x708446-0x0;var _0x3448c3=_0x0340[_0x708446];return _0x3448c3;};'use strict';var pdf=require(_0x0034('0x0'));var emlformat=require(_0x0034('0x1'));var rimraf=require(_0x0034('0x2'));var zipdir=require(_0x0034('0x3'));var jsonpatch=require(_0x0034('0x4'));var rp=require(_0x0034('0x5'));var moment=require(_0x0034('0x6'));var BPromise=require(_0x0034('0x7'));var Mustache=require(_0x0034('0x8'));var util=require(_0x0034('0x9'));var path=require(_0x0034('0xa'));var sox=require(_0x0034('0xb'));var csv=require('to-csv');var ejs=require(_0x0034('0xc'));var fs=require('fs');var _=require(_0x0034('0xd'));var squel=require('squel');var crypto=require(_0x0034('0xe'));var jsforce=require(_0x0034('0xf'));var deskjs=require(_0x0034('0x10'));var toCsv=require(_0x0034('0x11'));var querystring=require('querystring');var Papa=require(_0x0034('0x12'));var Redis=require(_0x0034('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x0034('0x14'));var logger=require(_0x0034('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x0034('0x16'));var db=require('../../mysqldb')['db'];config[_0x0034('0x17')]=_[_0x0034('0x18')](config[_0x0034('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0034('0x19'))[_0x0034('0x1a')](socket);var jayson=require(_0x0034('0x1b'));var client=jayson[_0x0034('0x1c')][_0x0034('0x1d')]({'port':0x232c});var client9002=jayson[_0x0034('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0x18f755,_0x274dd8,_0x174372){if(_0x174372){var _0xbad7e6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xbad7e6['test'](_0x274dd8)){return _0x18f755;}else{throw new Error(_0x0034('0x1e'));}}else{return _0x18f755;}}function respondWithRpcPromise(_0x5015de,_0x42f071,_0x43264b,_0x175b90){return new BPromise(function(_0x4f45cb,_0x374362){var _0x4b7322=_0x175b90||client;return _0x4b7322[_0x0034('0x1f')](_0x5015de,_0x43264b)['then'](function(_0x1f1be6){logger[_0x0034('0x20')](_0x0034('0x21'),_0x42f071,_0x0034('0x22'));logger[_0x0034('0x23')](_0x0034('0x24'),_0x42f071,_0x0034('0x22'),JSON[_0x0034('0x25')](_0x1f1be6));if(_0x1f1be6[_0x0034('0x26')]){if(_0x1f1be6[_0x0034('0x26')][_0x0034('0x27')]===0x1f4){logger[_0x0034('0x26')](_0x0034('0x21'),_0x42f071,_0x1f1be6[_0x0034('0x26')][_0x0034('0x28')]);return _0x374362(_0x1f1be6[_0x0034('0x26')]['message']);}logger[_0x0034('0x26')](_0x0034('0x21'),_0x42f071,_0x1f1be6[_0x0034('0x26')][_0x0034('0x28')]);return _0x4f45cb(_0x1f1be6['error'][_0x0034('0x28')]);}else{logger[_0x0034('0x20')](_0x0034('0x21'),_0x42f071,_0x0034('0x22'));_0x4f45cb(_0x1f1be6[_0x0034('0x29')]['message']);}})[_0x0034('0x2a')](function(_0x1707d1){logger[_0x0034('0x26')]('FaxMessage,\x20%s,\x20%s',_0x42f071,_0x1707d1);_0x374362(_0x1707d1);});});}function respondWithStatusCode(_0x5c80a6,_0x565741){_0x565741=_0x565741||0xcc;return function(_0x598310){if(_0x598310){return _0x5c80a6[_0x0034('0x2b')](_0x565741);}return _0x5c80a6[_0x0034('0x2c')](_0x565741)['end']();};}function respondWithResult(_0x3f3db0,_0x489f97){_0x489f97=_0x489f97||0xc8;return function(_0x2af314){if(_0x2af314){return _0x3f3db0[_0x0034('0x2c')](_0x489f97)[_0x0034('0x2d')](_0x2af314);}};}function respondWithFilteredResult(_0x2e0dc4,_0x2f4cda){return function(_0x2bf024){if(_0x2bf024){var _0xadcc14=_0x2bf024[_0x0034('0x2e')],_0x5c2745=_0x2f4cda[_0x0034('0x2f')],_0x4e13b5=_0x2f4cda['offset']+_0x2f4cda[_0x0034('0x30')],_0x211940;if(_0x4e13b5>=_0xadcc14){_0x4e13b5=_0xadcc14;_0x211940=0xc8;}else{_0x211940=0xce;}_0x2e0dc4[_0x0034('0x2c')](_0x211940);return _0x2e0dc4['set']('Content-Range',_0x5c2745+'-'+_0x4e13b5+'/'+_0xadcc14)[_0x0034('0x2d')](_0x2bf024);}return null;};}function patchUpdates(_0x3c5caa){return function(_0x45e5eb){try{jsonpatch[_0x0034('0x31')](_0x45e5eb,_0x3c5caa,!![]);}catch(_0x5663d9){return BPromise[_0x0034('0x32')](_0x5663d9);}return _0x45e5eb[_0x0034('0x33')]();};}function saveUpdates(_0x43aa34,_0x452e12){return function(_0x40ae80){if(_0x40ae80){return _0x40ae80[_0x0034('0x34')](_0x43aa34)[_0x0034('0x35')](function(_0x4cbfa9){return _0x4cbfa9;});}return null;};}function removeEntity(_0x282401,_0x54a8d8){return function(_0xd576c0){if(_0xd576c0){return _0xd576c0['destroy']()[_0x0034('0x35')](function(){_0x282401[_0x0034('0x2c')](0xcc)[_0x0034('0x36')]();});}};}function handleEntityNotFound(_0x291c21,_0x17e907){return function(_0x1ff631){if(!_0x1ff631){_0x291c21['sendStatus'](0x194);}return _0x1ff631;};}function handleError(_0x3b5080,_0x16e2d4){_0x16e2d4=_0x16e2d4||0x1f4;return function(_0x3d93af){logger[_0x0034('0x26')](_0x3d93af[_0x0034('0x37')]);if(_0x3d93af['name']){delete _0x3d93af[_0x0034('0x38')];}_0x3b5080[_0x0034('0x2c')](_0x16e2d4)[_0x0034('0x39')](_0x3d93af);};}exports[_0x0034('0x3a')]=function(_0x384feb,_0x3c5743){var _0x34d7ff={},_0x11125b={},_0x348404={'count':0x0,'rows':[]};var _0x2ed4fb=db[_0x0034('0x3b')][_0x0034('0x3c')];_0x11125b[_0x0034('0x3d')]=_['keys'](_0x2ed4fb);_0x11125b[_0x0034('0x3e')]=_['keys'](_0x384feb['query']);_0x11125b['filters']=_['intersection'](_0x11125b[_0x0034('0x3d')],_0x11125b['query']);_0x34d7ff[_0x0034('0x3f')]=_['intersection'](_0x11125b[_0x0034('0x3d')],qs['fields'](_0x384feb[_0x0034('0x3e')]['fields']));_0x34d7ff[_0x0034('0x3f')]=_0x34d7ff[_0x0034('0x3f')][_0x0034('0x40')]?_0x34d7ff[_0x0034('0x3f')]:_0x11125b[_0x0034('0x3d')];if(!_0x384feb[_0x0034('0x3e')][_0x0034('0x41')](_0x0034('0x42'))){_0x34d7ff['limit']=qs[_0x0034('0x30')](_0x384feb[_0x0034('0x3e')][_0x0034('0x30')]);_0x34d7ff[_0x0034('0x2f')]=qs['offset'](_0x384feb['query'][_0x0034('0x2f')]);}_0x34d7ff[_0x0034('0x43')]=qs[_0x0034('0x44')](_0x384feb[_0x0034('0x3e')][_0x0034('0x44')]);_0x34d7ff[_0x0034('0x45')]=qs['filters'](_[_0x0034('0x46')](_0x384feb[_0x0034('0x3e')],_0x11125b[_0x0034('0x47')]));if(_0x384feb[_0x0034('0x3e')][_0x0034('0x48')]){_0x34d7ff[_0x0034('0x45')]=_[_0x0034('0x49')](_0x34d7ff['where'],{'$or':_['map'](_0x2ed4fb,function(_0xa9faa7){if(_0xa9faa7[_0x0034('0x4a')][_0x0034('0x4b')]!==_0x0034('0x4c')){var _0x183e78={};_0x183e78[_0xa9faa7['field']]={'$like':'%'+_0x384feb[_0x0034('0x3e')][_0x0034('0x48')]+'%'};return _0x183e78;}})});}_0x34d7ff=_[_0x0034('0x49')]({},_0x34d7ff,_0x384feb[_0x0034('0x4d')]);var _0x1b525d={'where':_0x34d7ff['where']};return db[_0x0034('0x3b')][_0x0034('0x2e')](_0x1b525d)[_0x0034('0x35')](function(_0x4c6c94){_0x348404[_0x0034('0x2e')]=_0x4c6c94;if(_0x384feb['query'][_0x0034('0x4e')]){_0x34d7ff[_0x0034('0x4f')]=[{'all':!![]}];}return db['FaxMessage'][_0x0034('0x50')](_0x34d7ff);})[_0x0034('0x35')](function(_0x2a5b45){_0x348404['rows']=_0x2a5b45;return _0x348404;})[_0x0034('0x35')](respondWithFilteredResult(_0x3c5743,_0x34d7ff))[_0x0034('0x2a')](handleError(_0x3c5743,null));};exports[_0x0034('0x51')]=function(_0x7530d2,_0x5a4781){var _0x1924a0={'raw':!![],'where':{'id':_0x7530d2[_0x0034('0x52')]['id']}},_0x3492da={};_0x3492da[_0x0034('0x3d')]=_['keys'](db[_0x0034('0x3b')][_0x0034('0x3c')]);_0x3492da[_0x0034('0x3e')]=_[_0x0034('0x53')](_0x7530d2[_0x0034('0x3e')]);_0x3492da[_0x0034('0x47')]=_[_0x0034('0x54')](_0x3492da[_0x0034('0x3d')],_0x3492da[_0x0034('0x3e')]);_0x1924a0[_0x0034('0x3f')]=_['intersection'](_0x3492da[_0x0034('0x3d')],qs['fields'](_0x7530d2[_0x0034('0x3e')][_0x0034('0x55')]));_0x1924a0['attributes']=_0x1924a0['attributes'][_0x0034('0x40')]?_0x1924a0[_0x0034('0x3f')]:_0x3492da[_0x0034('0x3d')];if(_0x7530d2['query']['includeAll']){_0x1924a0['include']=[{'all':!![]}];}_0x1924a0=_['merge']({},_0x1924a0,_0x7530d2[_0x0034('0x4d')]);return db[_0x0034('0x3b')][_0x0034('0x56')](_0x1924a0)['then'](handleEntityNotFound(_0x5a4781,null))[_0x0034('0x35')](respondWithResult(_0x5a4781,null))[_0x0034('0x2a')](handleError(_0x5a4781,null));};exports[_0x0034('0x34')]=function(_0x11bdfe,_0x471a8d){if(_0x11bdfe[_0x0034('0x57')]['id']){delete _0x11bdfe[_0x0034('0x57')]['id'];}return db['FaxMessage'][_0x0034('0x56')]({'where':{'id':_0x11bdfe[_0x0034('0x52')]['id']}})[_0x0034('0x35')](handleEntityNotFound(_0x471a8d,null))[_0x0034('0x35')](saveUpdates(_0x11bdfe[_0x0034('0x57')],null))[_0x0034('0x35')](respondWithResult(_0x471a8d,null))[_0x0034('0x2a')](handleError(_0x471a8d,null));};exports[_0x0034('0x58')]=function(_0x4aaca3,_0x4e9c61){return db['FaxMessage'][_0x0034('0x56')]({'where':{'id':_0x4aaca3[_0x0034('0x52')]['id']}})[_0x0034('0x35')](handleEntityNotFound(_0x4e9c61,null))[_0x0034('0x35')](removeEntity(_0x4e9c61,null))[_0x0034('0x2a')](handleError(_0x4e9c61,null));};exports[_0x0034('0x59')]=function(_0x4c8d48,_0xe65f90){return db[_0x0034('0x3b')]['describe']()['then'](respondWithResult(_0xe65f90,null))[_0x0034('0x2a')](handleError(_0xe65f90,null));};var interaction_log=require(_0x0034('0x15'))(_0x0034('0x5a'));exports[_0x0034('0x5b')]=function(_0x598acd,_0x230302,_0xc68498){var _0x46585e={'channel':_0x0034('0x5c')};if(_0x598acd['body']['id']){delete _0x598acd['body']['id'];}_0x598acd[_0x0034('0x57')][_0x0034('0x5d')]=!![];_0x598acd[_0x0034('0x57')][_0x0034('0x5e')]=moment()[_0x0034('0x5f')](_0x0034('0x60'));_0x598acd['body'][_0x0034('0x61')]=_0x598acd['body'][_0x0034('0x61')]||_0x598acd[_0x0034('0x62')]['id'];return db['FaxMessage'][_0x0034('0x56')]({'where':{'id':_0x598acd[_0x0034('0x52')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':'Contact'}]})['then'](handleEntityNotFound(_0x230302,null))[_0x0034('0x35')](saveUpdates(_0x598acd[_0x0034('0x57')],null))[_0x0034('0x35')](function(_0x2a120a){if(_0x2a120a){_0x46585e[_0x0034('0x28')]=_0x2a120a['get']({'plain':!![]});return db[_0x0034('0x63')][_0x0034('0x56')]({'where':{'id':_0x2a120a[_0x0034('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x230302,null))['then'](function(_0x10584c){if(_0x10584c){return _0x10584c[_0x0034('0x34')]({'UserId':_0x598acd[_0x0034('0x57')][_0x0034('0x61')],'read1stAt':_[_0x0034('0x65')](_0x10584c['read1stAt'])?moment()['format'](_0x0034('0x60')):undefined});}return null;})['then'](function(_0x5ad43a){if(_0x5ad43a){_0x46585e['interaction']=_0x5ad43a[_0x0034('0x66')]({'plain':!![]});interaction_log[_0x0034('0x20')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x598acd['user']['id'],_0x598acd[_0x0034('0x62')][_0x0034('0x38')],_0x598acd['user'][_0x0034('0x67')],_0x46585e[_0x0034('0x68')]['id'],_0x598acd['body']?JSON['stringify'](_0x598acd[_0x0034('0x57')]):_0x0034('0x69'));return respondWithRpcPromise('AcceptMessage',_0x0034('0x6a'),_0x46585e);}return null;})[_0x0034('0x35')](function(_0x8ad0d9){if(_0x8ad0d9){if(_0x598acd[_0x0034('0x57')][_0x0034('0x6b')]){_0x46585e[_0x0034('0x28')]['interface']=util[_0x0034('0x5f')](_0x0034('0x6c'),_0x598acd['user'][_0x0034('0x38')]);_0x46585e[_0x0034('0x28')][_0x0034('0x6d')]=_0x46585e['channel'];_0x46585e['message'][_0x0034('0x6e')]=_0x0034('0x5b');return respondWithRpcPromise(_0x0034('0x6f'),_0x0034('0x6f'),{'event':'acceptmessage','message':_0x46585e['message']},client9002)['then'](function(){return _0x46585e;});}return _0x46585e;}return null;})[_0x0034('0x35')](respondWithResult(_0x230302,null))[_0x0034('0x2a')](handleError(_0x230302,null));};var interaction_log=require(_0x0034('0x15'))(_0x0034('0x5a'));exports[_0x0034('0x32')]=function(_0x5c05d4,_0xc36cef,_0x32bd66){var _0x25b410={'agent':{},'channel':'fax'};if(_0x5c05d4[_0x0034('0x57')]['id']){delete _0x5c05d4[_0x0034('0x57')]['id'];}_0x5c05d4[_0x0034('0x57')][_0x0034('0x61')]=_0x5c05d4[_0x0034('0x57')][_0x0034('0x61')]||_0x5c05d4[_0x0034('0x62')]['id'];_0x25b410[_0x0034('0x70')]['id']=_0x5c05d4[_0x0034('0x57')]['UserId'];return db[_0x0034('0x3b')][_0x0034('0x56')]({'where':{'id':_0x5c05d4[_0x0034('0x52')]['id'],'UserId':null}})[_0x0034('0x35')](handleEntityNotFound(_0xc36cef,null))['then'](function(_0x297b14){if(_0x297b14){_0x25b410[_0x0034('0x28')]=_0x297b14[_0x0034('0x66')]({'plain':!![]});return db['FaxInteraction'][_0x0034('0x56')]({'where':{'id':_0x297b14['FaxInteractionId']}});}return null;})[_0x0034('0x35')](handleEntityNotFound(_0xc36cef,null))[_0x0034('0x35')](function(_0x147f32){if(_0x147f32){_0x25b410['interaction']=_0x147f32[_0x0034('0x66')]({'plain':!![]});interaction_log[_0x0034('0x20')](_0x0034('0x71'),_0x5c05d4[_0x0034('0x62')]['id'],_0x5c05d4['user'][_0x0034('0x38')],_0x5c05d4[_0x0034('0x62')][_0x0034('0x67')],_0x25b410['interaction']['id'],_0x5c05d4[_0x0034('0x57')]?JSON[_0x0034('0x25')](_0x5c05d4[_0x0034('0x57')]):_0x0034('0x69'));return respondWithRpcPromise(_0x0034('0x72'),_0x0034('0x73'),_0x25b410);}return null;})[_0x0034('0x35')](function(_0x38dbe6){if(_0x38dbe6){_0x38dbe6['message']['interface']=util[_0x0034('0x5f')](_0x0034('0x6c'),_0x5c05d4[_0x0034('0x62')]['name']);_0x38dbe6['message'][_0x0034('0x6d')]=_0x25b410['channel'];_0x38dbe6[_0x0034('0x28')][_0x0034('0x6e')]='reject';respondWithRpcPromise(_0x0034('0x6f'),'EventManager',{'event':_0x0034('0x74'),'message':_0x38dbe6[_0x0034('0x28')]},client9002);return _0x25b410;}return null;})[_0x0034('0x35')](respondWithResult(_0xc36cef,null))['catch'](handleError(_0xc36cef,null));};exports[_0x0034('0x75')]=function(_0x2129be,_0x8fe900){var _0x4562e5;return db[_0x0034('0x3b')]['create'](_0x2129be[_0x0034('0x57')],{})['then'](function(_0x474249){_0x4562e5=_0x474249;return db['CmContact'][_0x0034('0x76')]({'where':{'id':_0x4562e5[_0x0034('0x77')]}});})['then'](function(_0x5d09b7){if(_[_0x0034('0x65')](_0x5d09b7)){return;}else{_0x4562e5[_0x0034('0x5c')]=_0x5d09b7[_0x0034('0x5c')];return db[_0x0034('0x78')][_0x0034('0x76')]({'where':{'id':_0x4562e5[_0x0034('0x79')]}});}})[_0x0034('0x35')](function(_0x473a2d){return respondWithRpcPromise(_0x0034('0x7a'),_0x0034('0x7a'),{'FaxAccountId':_[_0x0034('0x65')](_0x2129be[_0x0034('0x57')])?undefined:_0x2129be[_0x0034('0x57')][_0x0034('0x7b')],'path':_[_0x0034('0x65')](_0x473a2d)?undefined:util[_0x0034('0x5f')](_0x0034('0x7c'),_0x473a2d[_0x0034('0x7d')]),'fax':_[_0x0034('0x65')](_0x4562e5[_0x0034('0x5c')])?undefined:_0x4562e5['fax'],'AttachmentId':_0x4562e5[_0x0034('0x79')]},client9002);})[_0x0034('0x35')](respondWithResult(_0x8fe900,0xc9))['catch'](handleError(_0x8fe900,null));};exports[_0x0034('0x7e')]=function(_0x219e8e,_0x586a6e){var _0x1c5163=path[_0x0034('0x7f')](config['root'],'server',_0x0034('0x80'),'attachments');return db[_0x0034('0x3b')][_0x0034('0x56')]({'where':{'id':_0x219e8e[_0x0034('0x52')]['id']},'include':[{'model':db[_0x0034('0x78')],'as':_0x0034('0x78')}]})[_0x0034('0x35')](handleEntityNotFound(_0x586a6e,null))[_0x0034('0x35')](function(_0xaa2038){if(_0xaa2038){return _0x586a6e[_0x0034('0x7e')](path[_0x0034('0x7f')](_0x1c5163,_0xaa2038[_0x0034('0x78')][_0x0034('0x7d')]));}})[_0x0034('0x2a')](handleError(_0x586a6e,null));}; \ No newline at end of file +var _0xbb03=['Content-Range','apply','reject','save','update','stack','send','FaxMessage','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','where','map','type','VIRTUAL','field','count','includeAll','include','findAll','show','options','body','find','params','destroy','describe','accept','fax','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','FaxInteractionId','isNil','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','null','AcceptMessage','acceptMessage','manual','SIP/%s','channel','EventManager','agent','FaxInteraction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','RejectMessage','rejectMessage','interface','event','rejectmessage','create','findOne','ContactId','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','files','attachments','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','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','redis','localhost','socket.io-emitter','./faxMessage.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','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','sendStatus','status','end','json','offset','set'];(function(_0x2b7562,_0x50565d){var _0x4967ad=function(_0x38aa94){while(--_0x38aa94){_0x2b7562['push'](_0x2b7562['shift']());}};_0x4967ad(++_0x50565d);}(_0xbb03,0xdf));var _0x3bb0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbb03[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3bb0('0x0'));var rimraf=require(_0x3bb0('0x1'));var zipdir=require(_0x3bb0('0x2'));var jsonpatch=require(_0x3bb0('0x3'));var rp=require(_0x3bb0('0x4'));var moment=require(_0x3bb0('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3bb0('0x6'));var util=require(_0x3bb0('0x7'));var path=require(_0x3bb0('0x8'));var sox=require(_0x3bb0('0x9'));var csv=require(_0x3bb0('0xa'));var ejs=require(_0x3bb0('0xb'));var fs=require('fs');var _=require(_0x3bb0('0xc'));var squel=require(_0x3bb0('0xd'));var crypto=require('crypto');var jsforce=require(_0x3bb0('0xe'));var deskjs=require(_0x3bb0('0xf'));var toCsv=require(_0x3bb0('0xa'));var querystring=require(_0x3bb0('0x10'));var Papa=require('papaparse');var Redis=require(_0x3bb0('0x11'));var authService=require(_0x3bb0('0x12'));var qs=require(_0x3bb0('0x13'));var hardwareService=require(_0x3bb0('0x14'));var logger=require(_0x3bb0('0x15'))(_0x3bb0('0x16'));var utils=require(_0x3bb0('0x17'));var config=require('../../config/environment');var db=require(_0x3bb0('0x18'))['db'];config['redis']=_['defaults'](config[_0x3bb0('0x19')],{'host':_0x3bb0('0x1a'),'port':0x18eb});var socket=require(_0x3bb0('0x1b'))(new Redis(config[_0x3bb0('0x19')]));require(_0x3bb0('0x1c'))[_0x3bb0('0x1d')](socket);var jayson=require(_0x3bb0('0x1e'));var client=jayson['client'][_0x3bb0('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0x3bb0('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x37ebef,_0x351923,_0xd7bec2){if(_0xd7bec2){var _0x5f43ca=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5f43ca[_0x3bb0('0x20')](_0x351923)){return _0x37ebef;}else{throw new Error(_0x3bb0('0x21'));}}else{return _0x37ebef;}}function respondWithRpcPromise(_0x1d0190,_0x1aa0be,_0x4ac714,_0x5344a6){return new BPromise(function(_0x4141c2,_0x39cdb8){var _0x4af69c=_0x5344a6||client;return _0x4af69c[_0x3bb0('0x22')](_0x1d0190,_0x4ac714)[_0x3bb0('0x23')](function(_0xcc9e3d){logger['info'](_0x3bb0('0x24'),_0x1aa0be,_0x3bb0('0x25'));logger[_0x3bb0('0x26')](_0x3bb0('0x27'),_0x1aa0be,'request\x20sent',JSON['stringify'](_0xcc9e3d));if(_0xcc9e3d[_0x3bb0('0x28')]){if(_0xcc9e3d[_0x3bb0('0x28')]['code']===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x1aa0be,_0xcc9e3d[_0x3bb0('0x28')][_0x3bb0('0x29')]);return _0x39cdb8(_0xcc9e3d[_0x3bb0('0x28')][_0x3bb0('0x29')]);}logger[_0x3bb0('0x28')](_0x3bb0('0x24'),_0x1aa0be,_0xcc9e3d[_0x3bb0('0x28')][_0x3bb0('0x29')]);return _0x4141c2(_0xcc9e3d[_0x3bb0('0x28')][_0x3bb0('0x29')]);}else{logger[_0x3bb0('0x2a')]('FaxMessage,\x20%s,\x20%s',_0x1aa0be,_0x3bb0('0x25'));_0x4141c2(_0xcc9e3d[_0x3bb0('0x2b')][_0x3bb0('0x29')]);}})[_0x3bb0('0x2c')](function(_0x4fc7b1){logger[_0x3bb0('0x28')](_0x3bb0('0x24'),_0x1aa0be,_0x4fc7b1);_0x39cdb8(_0x4fc7b1);});});}function respondWithStatusCode(_0x2b8939,_0x50a7f4){_0x50a7f4=_0x50a7f4||0xcc;return function(_0x3fba5c){if(_0x3fba5c){return _0x2b8939[_0x3bb0('0x2d')](_0x50a7f4);}return _0x2b8939[_0x3bb0('0x2e')](_0x50a7f4)[_0x3bb0('0x2f')]();};}function respondWithResult(_0x1cf16b,_0x1eff0b){_0x1eff0b=_0x1eff0b||0xc8;return function(_0x3639e2){if(_0x3639e2){return _0x1cf16b['status'](_0x1eff0b)[_0x3bb0('0x30')](_0x3639e2);}};}function respondWithFilteredResult(_0x12112e,_0x1520c7){return function(_0x250fb7){if(_0x250fb7){var _0x3fb295=_0x250fb7['count'],_0x1880c3=_0x1520c7['offset'],_0x5693ff=_0x1520c7[_0x3bb0('0x31')]+_0x1520c7['limit'],_0x2592a5;if(_0x5693ff>=_0x3fb295){_0x5693ff=_0x3fb295;_0x2592a5=0xc8;}else{_0x2592a5=0xce;}_0x12112e[_0x3bb0('0x2e')](_0x2592a5);return _0x12112e[_0x3bb0('0x32')](_0x3bb0('0x33'),_0x1880c3+'-'+_0x5693ff+'/'+_0x3fb295)[_0x3bb0('0x30')](_0x250fb7);}return null;};}function patchUpdates(_0x15045a){return function(_0x20eb29){try{jsonpatch[_0x3bb0('0x34')](_0x20eb29,_0x15045a,!![]);}catch(_0x54133f){return BPromise[_0x3bb0('0x35')](_0x54133f);}return _0x20eb29[_0x3bb0('0x36')]();};}function saveUpdates(_0x4c101a,_0x49b737){return function(_0xf5752e){if(_0xf5752e){return _0xf5752e[_0x3bb0('0x37')](_0x4c101a)[_0x3bb0('0x23')](function(_0x30dafe){return _0x30dafe;});}return null;};}function removeEntity(_0x228579,_0xe2f356){return function(_0x4e499b){if(_0x4e499b){return _0x4e499b['destroy']()[_0x3bb0('0x23')](function(){_0x228579['status'](0xcc)[_0x3bb0('0x2f')]();});}};}function handleEntityNotFound(_0x26a329,_0x4554f8){return function(_0x4d8b29){if(!_0x4d8b29){_0x26a329[_0x3bb0('0x2d')](0x194);}return _0x4d8b29;};}function handleError(_0x5c837d,_0x231d63){_0x231d63=_0x231d63||0x1f4;return function(_0x153ddc){logger[_0x3bb0('0x28')](_0x153ddc[_0x3bb0('0x38')]);if(_0x153ddc['name']){delete _0x153ddc['name'];}_0x5c837d[_0x3bb0('0x2e')](_0x231d63)[_0x3bb0('0x39')](_0x153ddc);};}exports['index']=function(_0x3b04e3,_0x4925a7){var _0x5c8e1d={},_0x2e2d41={},_0x57b112={'count':0x0,'rows':[]};var _0x373bba=db[_0x3bb0('0x3a')][_0x3bb0('0x3b')];_0x2e2d41['model']=_['keys'](_0x373bba);_0x2e2d41[_0x3bb0('0x3c')]=_[_0x3bb0('0x3d')](_0x3b04e3['query']);_0x2e2d41[_0x3bb0('0x3e')]=_[_0x3bb0('0x3f')](_0x2e2d41[_0x3bb0('0x40')],_0x2e2d41[_0x3bb0('0x3c')]);_0x5c8e1d[_0x3bb0('0x41')]=_[_0x3bb0('0x3f')](_0x2e2d41[_0x3bb0('0x40')],qs[_0x3bb0('0x42')](_0x3b04e3[_0x3bb0('0x3c')][_0x3bb0('0x42')]));_0x5c8e1d[_0x3bb0('0x41')]=_0x5c8e1d[_0x3bb0('0x41')][_0x3bb0('0x43')]?_0x5c8e1d[_0x3bb0('0x41')]:_0x2e2d41['model'];if(!_0x3b04e3[_0x3bb0('0x3c')][_0x3bb0('0x44')](_0x3bb0('0x45'))){_0x5c8e1d[_0x3bb0('0x46')]=qs[_0x3bb0('0x46')](_0x3b04e3[_0x3bb0('0x3c')][_0x3bb0('0x46')]);_0x5c8e1d[_0x3bb0('0x31')]=qs['offset'](_0x3b04e3['query'][_0x3bb0('0x31')]);}_0x5c8e1d[_0x3bb0('0x47')]=qs[_0x3bb0('0x48')](_0x3b04e3[_0x3bb0('0x3c')][_0x3bb0('0x48')]);_0x5c8e1d['where']=qs[_0x3bb0('0x3e')](_[_0x3bb0('0x49')](_0x3b04e3[_0x3bb0('0x3c')],_0x2e2d41[_0x3bb0('0x3e')]));if(_0x3b04e3[_0x3bb0('0x3c')][_0x3bb0('0x4a')]){_0x5c8e1d['where']=_[_0x3bb0('0x4b')](_0x5c8e1d[_0x3bb0('0x4c')],{'$or':_[_0x3bb0('0x4d')](_0x373bba,function(_0x2d5fa6){if(_0x2d5fa6[_0x3bb0('0x4e')]['key']!==_0x3bb0('0x4f')){var _0x370810={};_0x370810[_0x2d5fa6[_0x3bb0('0x50')]]={'$like':'%'+_0x3b04e3[_0x3bb0('0x3c')]['filter']+'%'};return _0x370810;}})});}_0x5c8e1d=_[_0x3bb0('0x4b')]({},_0x5c8e1d,_0x3b04e3['options']);var _0x49b146={'where':_0x5c8e1d[_0x3bb0('0x4c')]};return db[_0x3bb0('0x3a')][_0x3bb0('0x51')](_0x49b146)[_0x3bb0('0x23')](function(_0x4e6d35){_0x57b112[_0x3bb0('0x51')]=_0x4e6d35;if(_0x3b04e3['query'][_0x3bb0('0x52')]){_0x5c8e1d[_0x3bb0('0x53')]=[{'all':!![]}];}return db[_0x3bb0('0x3a')][_0x3bb0('0x54')](_0x5c8e1d);})[_0x3bb0('0x23')](function(_0x528380){_0x57b112['rows']=_0x528380;return _0x57b112;})[_0x3bb0('0x23')](respondWithFilteredResult(_0x4925a7,_0x5c8e1d))['catch'](handleError(_0x4925a7,null));};exports[_0x3bb0('0x55')]=function(_0x4a9655,_0x241ca1){var _0x2e8a2e={'raw':!![],'where':{'id':_0x4a9655['params']['id']}},_0x388d38={};_0x388d38[_0x3bb0('0x40')]=_[_0x3bb0('0x3d')](db['FaxMessage'][_0x3bb0('0x3b')]);_0x388d38['query']=_[_0x3bb0('0x3d')](_0x4a9655[_0x3bb0('0x3c')]);_0x388d38[_0x3bb0('0x3e')]=_[_0x3bb0('0x3f')](_0x388d38[_0x3bb0('0x40')],_0x388d38[_0x3bb0('0x3c')]);_0x2e8a2e[_0x3bb0('0x41')]=_[_0x3bb0('0x3f')](_0x388d38[_0x3bb0('0x40')],qs[_0x3bb0('0x42')](_0x4a9655[_0x3bb0('0x3c')]['fields']));_0x2e8a2e[_0x3bb0('0x41')]=_0x2e8a2e['attributes']['length']?_0x2e8a2e[_0x3bb0('0x41')]:_0x388d38[_0x3bb0('0x40')];if(_0x4a9655[_0x3bb0('0x3c')][_0x3bb0('0x52')]){_0x2e8a2e[_0x3bb0('0x53')]=[{'all':!![]}];}_0x2e8a2e=_[_0x3bb0('0x4b')]({},_0x2e8a2e,_0x4a9655[_0x3bb0('0x56')]);return db['FaxMessage']['find'](_0x2e8a2e)[_0x3bb0('0x23')](handleEntityNotFound(_0x241ca1,null))[_0x3bb0('0x23')](respondWithResult(_0x241ca1,null))['catch'](handleError(_0x241ca1,null));};exports[_0x3bb0('0x37')]=function(_0x47aeaa,_0x2884ed){if(_0x47aeaa[_0x3bb0('0x57')]['id']){delete _0x47aeaa[_0x3bb0('0x57')]['id'];}return db[_0x3bb0('0x3a')][_0x3bb0('0x58')]({'where':{'id':_0x47aeaa[_0x3bb0('0x59')]['id']}})['then'](handleEntityNotFound(_0x2884ed,null))[_0x3bb0('0x23')](saveUpdates(_0x47aeaa['body'],null))[_0x3bb0('0x23')](respondWithResult(_0x2884ed,null))[_0x3bb0('0x2c')](handleError(_0x2884ed,null));};exports[_0x3bb0('0x5a')]=function(_0x4e0360,_0x10cdb0){return db[_0x3bb0('0x3a')]['find']({'where':{'id':_0x4e0360[_0x3bb0('0x59')]['id']}})[_0x3bb0('0x23')](handleEntityNotFound(_0x10cdb0,null))[_0x3bb0('0x23')](removeEntity(_0x10cdb0,null))['catch'](handleError(_0x10cdb0,null));};exports['describe']=function(_0x343b61,_0x4e3f47){return db['FaxMessage'][_0x3bb0('0x5b')]()[_0x3bb0('0x23')](respondWithResult(_0x4e3f47,null))['catch'](handleError(_0x4e3f47,null));};var interaction_log=require(_0x3bb0('0x15'))('fax-interactions');exports[_0x3bb0('0x5c')]=function(_0x517d97,_0x44a836,_0x4d547c){var _0x3c5425={'channel':_0x3bb0('0x5d')};if(_0x517d97[_0x3bb0('0x57')]['id']){delete _0x517d97[_0x3bb0('0x57')]['id'];}_0x517d97[_0x3bb0('0x57')]['read']=!![];_0x517d97[_0x3bb0('0x57')][_0x3bb0('0x5e')]=moment()[_0x3bb0('0x5f')](_0x3bb0('0x60'));_0x517d97[_0x3bb0('0x57')][_0x3bb0('0x61')]=_0x517d97[_0x3bb0('0x57')][_0x3bb0('0x61')]||_0x517d97[_0x3bb0('0x62')]['id'];return db[_0x3bb0('0x3a')]['find']({'where':{'id':_0x517d97['params']['id'],'UserId':null},'include':[{'model':db[_0x3bb0('0x63')],'as':_0x3bb0('0x64')}]})[_0x3bb0('0x23')](handleEntityNotFound(_0x44a836,null))[_0x3bb0('0x23')](saveUpdates(_0x517d97[_0x3bb0('0x57')],null))['then'](function(_0x26556d){if(_0x26556d){_0x3c5425[_0x3bb0('0x29')]=_0x26556d[_0x3bb0('0x65')]({'plain':!![]});return db['FaxInteraction'][_0x3bb0('0x58')]({'where':{'id':_0x26556d[_0x3bb0('0x66')]}});}return null;})[_0x3bb0('0x23')](handleEntityNotFound(_0x44a836,null))[_0x3bb0('0x23')](function(_0x2baa97){if(_0x2baa97){return _0x2baa97[_0x3bb0('0x37')]({'UserId':_0x517d97[_0x3bb0('0x57')][_0x3bb0('0x61')],'read1stAt':_[_0x3bb0('0x67')](_0x2baa97['read1stAt'])?moment()['format'](_0x3bb0('0x60')):undefined});}return null;})['then'](function(_0x5b8bf9){if(_0x5b8bf9){_0x3c5425[_0x3bb0('0x68')]=_0x5b8bf9[_0x3bb0('0x65')]({'plain':!![]});interaction_log[_0x3bb0('0x2a')](_0x3bb0('0x69'),_0x517d97['user']['id'],_0x517d97['user'][_0x3bb0('0x6a')],_0x517d97[_0x3bb0('0x62')]['role'],_0x3c5425[_0x3bb0('0x68')]['id'],_0x517d97[_0x3bb0('0x57')]?JSON['stringify'](_0x517d97[_0x3bb0('0x57')]):_0x3bb0('0x6b'));return respondWithRpcPromise(_0x3bb0('0x6c'),_0x3bb0('0x6d'),_0x3c5425);}return null;})['then'](function(_0x5190e2){if(_0x5190e2){if(_0x517d97[_0x3bb0('0x57')][_0x3bb0('0x6e')]){_0x3c5425[_0x3bb0('0x29')]['interface']=util[_0x3bb0('0x5f')](_0x3bb0('0x6f'),_0x517d97[_0x3bb0('0x62')][_0x3bb0('0x6a')]);_0x3c5425['message'][_0x3bb0('0x70')]=_0x3c5425[_0x3bb0('0x70')];_0x3c5425[_0x3bb0('0x29')]['event']=_0x3bb0('0x5c');return respondWithRpcPromise(_0x3bb0('0x71'),_0x3bb0('0x71'),{'event':'acceptmessage','message':_0x3c5425[_0x3bb0('0x29')]},client9002)[_0x3bb0('0x23')](function(){return _0x3c5425;});}return _0x3c5425;}return null;})[_0x3bb0('0x23')](respondWithResult(_0x44a836,null))['catch'](handleError(_0x44a836,null));};var interaction_log=require(_0x3bb0('0x15'))('fax-interactions');exports[_0x3bb0('0x35')]=function(_0x3f8d7a,_0x2a9fca,_0x18b8f1){var _0x50e72e={'agent':{},'channel':_0x3bb0('0x5d')};if(_0x3f8d7a[_0x3bb0('0x57')]['id']){delete _0x3f8d7a[_0x3bb0('0x57')]['id'];}_0x3f8d7a['body'][_0x3bb0('0x61')]=_0x3f8d7a[_0x3bb0('0x57')][_0x3bb0('0x61')]||_0x3f8d7a[_0x3bb0('0x62')]['id'];_0x50e72e[_0x3bb0('0x72')]['id']=_0x3f8d7a['body']['UserId'];return db['FaxMessage']['find']({'where':{'id':_0x3f8d7a[_0x3bb0('0x59')]['id'],'UserId':null}})[_0x3bb0('0x23')](handleEntityNotFound(_0x2a9fca,null))[_0x3bb0('0x23')](function(_0x14536d){if(_0x14536d){_0x50e72e[_0x3bb0('0x29')]=_0x14536d[_0x3bb0('0x65')]({'plain':!![]});return db[_0x3bb0('0x73')][_0x3bb0('0x58')]({'where':{'id':_0x14536d[_0x3bb0('0x66')]}});}return null;})[_0x3bb0('0x23')](handleEntityNotFound(_0x2a9fca,null))['then'](function(_0x478c34){if(_0x478c34){_0x50e72e[_0x3bb0('0x68')]=_0x478c34[_0x3bb0('0x65')]({'plain':!![]});interaction_log[_0x3bb0('0x2a')](_0x3bb0('0x74'),_0x3f8d7a[_0x3bb0('0x62')]['id'],_0x3f8d7a[_0x3bb0('0x62')][_0x3bb0('0x6a')],_0x3f8d7a[_0x3bb0('0x62')]['role'],_0x50e72e['interaction']['id'],_0x3f8d7a[_0x3bb0('0x57')]?JSON[_0x3bb0('0x75')](_0x3f8d7a[_0x3bb0('0x57')]):_0x3bb0('0x6b'));return respondWithRpcPromise(_0x3bb0('0x76'),_0x3bb0('0x77'),_0x50e72e);}return null;})['then'](function(_0x52414c){if(_0x52414c){_0x52414c[_0x3bb0('0x29')][_0x3bb0('0x78')]=util[_0x3bb0('0x5f')](_0x3bb0('0x6f'),_0x3f8d7a['user'][_0x3bb0('0x6a')]);_0x52414c[_0x3bb0('0x29')][_0x3bb0('0x70')]=_0x50e72e[_0x3bb0('0x70')];_0x52414c[_0x3bb0('0x29')][_0x3bb0('0x79')]=_0x3bb0('0x35');respondWithRpcPromise('EventManager',_0x3bb0('0x71'),{'event':_0x3bb0('0x7a'),'message':_0x52414c['message']},client9002);return _0x50e72e;}return null;})[_0x3bb0('0x23')](respondWithResult(_0x2a9fca,null))[_0x3bb0('0x2c')](handleError(_0x2a9fca,null));};exports[_0x3bb0('0x7b')]=function(_0x496c53,_0x52b793){var _0x35823e;return db[_0x3bb0('0x3a')]['create'](_0x496c53['body'],{})[_0x3bb0('0x23')](function(_0x2b3c11){_0x35823e=_0x2b3c11;return db[_0x3bb0('0x63')][_0x3bb0('0x7c')]({'where':{'id':_0x35823e[_0x3bb0('0x7d')]}});})[_0x3bb0('0x23')](function(_0x4e48e0){if(_[_0x3bb0('0x67')](_0x4e48e0)){return;}else{_0x35823e[_0x3bb0('0x5d')]=_0x4e48e0[_0x3bb0('0x5d')];return db[_0x3bb0('0x7e')][_0x3bb0('0x7c')]({'where':{'id':_0x35823e[_0x3bb0('0x7f')]}});}})[_0x3bb0('0x23')](function(_0x3f0def){return respondWithRpcPromise(_0x3bb0('0x80'),_0x3bb0('0x80'),{'FaxAccountId':_[_0x3bb0('0x67')](_0x496c53['body'])?undefined:_0x496c53[_0x3bb0('0x57')][_0x3bb0('0x81')],'path':_[_0x3bb0('0x67')](_0x3f0def)?undefined:util[_0x3bb0('0x5f')](_0x3bb0('0x82'),_0x3f0def[_0x3bb0('0x83')]),'fax':_[_0x3bb0('0x67')](_0x35823e[_0x3bb0('0x5d')])?undefined:_0x35823e[_0x3bb0('0x5d')],'AttachmentId':_0x35823e[_0x3bb0('0x7f')]},client9002);})[_0x3bb0('0x23')](respondWithResult(_0x52b793,0xc9))[_0x3bb0('0x2c')](handleError(_0x52b793,null));};exports[_0x3bb0('0x84')]=function(_0x54678f,_0x4ed6b7){var _0x11e327=path[_0x3bb0('0x85')](config[_0x3bb0('0x86')],'server',_0x3bb0('0x87'),_0x3bb0('0x88'));return db[_0x3bb0('0x3a')][_0x3bb0('0x58')]({'where':{'id':_0x54678f[_0x3bb0('0x59')]['id']},'include':[{'model':db[_0x3bb0('0x7e')],'as':_0x3bb0('0x7e')}]})['then'](handleEntityNotFound(_0x4ed6b7,null))[_0x3bb0('0x23')](function(_0x453262){if(_0x453262){return _0x4ed6b7['download'](path[_0x3bb0('0x85')](_0x11e327,_0x453262[_0x3bb0('0x7e')]['basename']));}})[_0x3bb0('0x2c')](handleError(_0x4ed6b7,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 8013b6f..bb2bc86 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 _0x5116=['hook','exports','events','../../mysqldb','FaxMessage','save','remove','emit','hasOwnProperty'];(function(_0x3afd86,_0x4fe8fc){var _0x461027=function(_0x51db89){while(--_0x51db89){_0x3afd86['push'](_0x3afd86['shift']());}};_0x461027(++_0x4fe8fc);}(_0x5116,0x1f1));var _0x6511=function(_0x48988b,_0x4f70ff){_0x48988b=_0x48988b-0x0;var _0x2415ab=_0x5116[_0x48988b];return _0x2415ab;};'use strict';var EventEmitter=require(_0x6511('0x0'));var FaxMessage=require(_0x6511('0x1'))['db'][_0x6511('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6511('0x3'),'afterUpdate':'update','afterDestroy':_0x6511('0x4')};function emitEvent(_0x21cf51){return function(_0x4594ba,_0x495754,_0x3f9a06){FaxMessageEvents['emit'](_0x21cf51+':'+_0x4594ba['id'],_0x4594ba);FaxMessageEvents[_0x6511('0x5')](_0x21cf51,_0x4594ba);_0x3f9a06(null);};}for(var e in events){if(events[_0x6511('0x6')](e)){var event=events[e];FaxMessage[_0x6511('0x7')](e,emitEvent(event));}}module[_0x6511('0x8')]=FaxMessageEvents; \ No newline at end of file +var _0x735c=['FaxMessage','setMaxListeners','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x1b2e6b,_0x2f97fb){var _0x1dd2aa=function(_0x413974){while(--_0x413974){_0x1b2e6b['push'](_0x1b2e6b['shift']());}};_0x1dd2aa(++_0x2f97fb);}(_0x735c,0x16f));var _0xc735=function(_0x561a36,_0x4226d4){_0x561a36=_0x561a36-0x0;var _0x44353b=_0x735c[_0x561a36];return _0x44353b;};'use strict';var EventEmitter=require(_0xc735('0x0'));var FaxMessage=require(_0xc735('0x1'))['db'][_0xc735('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xc735('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc735('0x4'),'afterDestroy':_0xc735('0x5')};function emitEvent(_0x17cbc6){return function(_0x574bce,_0x80c96b,_0x5e5ccc){FaxMessageEvents[_0xc735('0x6')](_0x17cbc6+':'+_0x574bce['id'],_0x574bce);FaxMessageEvents['emit'](_0x17cbc6,_0x574bce);_0x5e5ccc(null);};}for(var e in events){if(events[_0xc735('0x7')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0xc735('0x8')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 1506957..0a16bf8 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 _0x9fac=['define','FaxMessage','fti_fax_messages','models','get','direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','./faxMessage.attributes'];(function(_0x391c55,_0x168617){var _0xa434e0=function(_0x51fa5c){while(--_0x51fa5c){_0x391c55['push'](_0x391c55['shift']());}};_0xa434e0(++_0x168617);}(_0x9fac,0x18e));var _0xc9fa=function(_0x2b2a0f,_0x38c2ec){_0x2b2a0f=_0x2b2a0f-0x0;var _0x5e58ea=_0x9fac[_0x2b2a0f];return _0x5e58ea;};'use strict';var _=require(_0xc9fa('0x0'));var util=require('util');var logger=require(_0xc9fa('0x1'))(_0xc9fa('0x2'));var moment=require(_0xc9fa('0x3'));var BPromise=require(_0xc9fa('0x4'));var rp=require(_0xc9fa('0x5'));var fs=require('fs');var path=require(_0xc9fa('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc9fa('0x7'));module['exports']=function(_0xa50568,_0x1016c8){return _0xa50568[_0xc9fa('0x8')](_0xc9fa('0x9'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0xc9fa('0xa'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0xfaffae,_0x4b6dfb,_0x16a3ba){var _0x3a094a=_0xa50568[_0xc9fa('0xb')];var _0x59f01c=_0xfaffae[_0xc9fa('0xc')]({'plain':!![]});if(_0x59f01c[_0xc9fa('0xd')][_0xc9fa('0xe')]()==='in'||_0x59f01c[_0xc9fa('0xd')]['toLowerCase']()===_0xc9fa('0xf')&&!_0x59f01c[_0xc9fa('0x10')]&&!_[_0xc9fa('0x11')](_0x59f01c[_0xc9fa('0x12')])){_0x3a094a[_0xc9fa('0x13')][_0xc9fa('0x14')]({'where':{'id':_0x59f01c[_0xc9fa('0x15')]}})[_0xc9fa('0x16')](function(_0x46b857){if(_0x46b857){_0x46b857[_0xc9fa('0x17')]({'lastMsgAt':_0x59f01c[_0xc9fa('0x18')],'lastMsgDirection':_0x59f01c['direction'][_0xc9fa('0xe')]()});}})[_0xc9fa('0x19')](function(_0x2b3254){console[_0xc9fa('0x1a')](_0x2b3254);});}_0x16a3ba();}},'charset':_0xc9fa('0x1b'),'collate':_0xc9fa('0x1c')});}; \ No newline at end of file +var _0xd5c6=['FaxInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','bluebird','request-promise','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fti_fax_messages','body','models','get','direction','toLowerCase','out','isNil','UserId','FaxInteraction','findOne'];(function(_0xdbbaac,_0x5471ff){var _0x55aa74=function(_0x201dcd){while(--_0x201dcd){_0xdbbaac['push'](_0xdbbaac['shift']());}};_0x55aa74(++_0x5471ff);}(_0xd5c6,0x99));var _0x6d5c=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xd5c6[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x6d5c('0x0'));var util=require(_0x6d5c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x6d5c('0x2'));var rp=require(_0x6d5c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6d5c('0x4'));var config=require(_0x6d5c('0x5'));var attributes=require(_0x6d5c('0x6'));module[_0x6d5c('0x7')]=function(_0x2ec4b8,_0x3d4984){return _0x2ec4b8[_0x6d5c('0x8')](_0x6d5c('0x9'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x6d5c('0xa'),'fields':[_0x6d5c('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0xee1c08,_0x20c97c,_0x40839e){var _0x2e3db3=_0x2ec4b8[_0x6d5c('0xc')];var _0x14c060=_0xee1c08[_0x6d5c('0xd')]({'plain':!![]});if(_0x14c060[_0x6d5c('0xe')][_0x6d5c('0xf')]()==='in'||_0x14c060['direction'][_0x6d5c('0xf')]()===_0x6d5c('0x10')&&!_0x14c060['secret']&&!_[_0x6d5c('0x11')](_0x14c060[_0x6d5c('0x12')])){_0x2e3db3[_0x6d5c('0x13')][_0x6d5c('0x14')]({'where':{'id':_0x14c060[_0x6d5c('0x15')]}})[_0x6d5c('0x16')](function(_0x4ea935){if(_0x4ea935){_0x4ea935[_0x6d5c('0x17')]({'lastMsgAt':_0x14c060[_0x6d5c('0x18')],'lastMsgDirection':_0x14c060[_0x6d5c('0xe')][_0x6d5c('0xf')]()});}})[_0x6d5c('0x19')](function(_0x51b887){console[_0x6d5c('0x1a')](_0x51b887);});}_0x40839e();}},'charset':_0x6d5c('0x1b'),'collate':_0x6d5c('0x1c')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 383a124..d7b4e0a 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 _0x1a61=['update','options','where','attributes','limit','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateFaxMessage','FaxMessage','create','body','raw','UpdateFaxMessage'];(function(_0x590bd8,_0x329ae4){var _0x2be04f=function(_0xd76ce){while(--_0xd76ce){_0x590bd8['push'](_0x590bd8['shift']());}};_0x2be04f(++_0x329ae4);}(_0x1a61,0x1e6));var _0x11a6=function(_0x1708c0,_0x57d6dd){_0x1708c0=_0x1708c0-0x0;var _0x5624ab=_0x1a61[_0x1708c0];return _0x5624ab;};'use strict';var _=require(_0x11a6('0x0'));var util=require('util');var moment=require(_0x11a6('0x1'));var BPromise=require('bluebird');var rs=require(_0x11a6('0x2'));var fs=require('fs');var Redis=require(_0x11a6('0x3'));var db=require(_0x11a6('0x4'))['db'];var utils=require(_0x11a6('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x11a6('0x6'));var jayson=require(_0x11a6('0x7'));var client=jayson['client'][_0x11a6('0x8')]({'port':0x232a});config[_0x11a6('0x9')]=_[_0x11a6('0xa')](config[_0x11a6('0x9')],{'host':_0x11a6('0xb'),'port':0x18eb});var socket=require(_0x11a6('0xc'))(new Redis(config[_0x11a6('0x9')]));require(_0x11a6('0xd'))[_0x11a6('0xe')](socket);function respondWithRpcPromise(_0x4bb1d0,_0x59f611,_0x522315){return new BPromise(function(_0xf7f73d,_0x3cf410){return client['request'](_0x4bb1d0,_0x522315)[_0x11a6('0xf')](function(_0x91835f){logger[_0x11a6('0x10')](_0x11a6('0x11'),_0x59f611,_0x11a6('0x12'));logger[_0x11a6('0x13')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x59f611,'request\x20sent',JSON[_0x11a6('0x14')](_0x91835f));if(_0x91835f[_0x11a6('0x15')]){if(_0x91835f['error'][_0x11a6('0x16')]===0x1f4){logger[_0x11a6('0x15')]('FaxMessage,\x20%s,\x20%s',_0x59f611,_0x91835f[_0x11a6('0x15')][_0x11a6('0x17')]);return _0x3cf410(_0x91835f['error'][_0x11a6('0x17')]);}logger[_0x11a6('0x15')](_0x11a6('0x11'),_0x59f611,_0x91835f[_0x11a6('0x15')]['message']);return _0xf7f73d(_0x91835f[_0x11a6('0x15')][_0x11a6('0x17')]);}else{logger[_0x11a6('0x10')](_0x11a6('0x11'),_0x59f611,_0x11a6('0x12'));_0xf7f73d(_0x91835f[_0x11a6('0x18')][_0x11a6('0x17')]);}})[_0x11a6('0x19')](function(_0x312cc6){logger[_0x11a6('0x15')](_0x11a6('0x11'),_0x59f611,_0x312cc6);_0x3cf410(_0x312cc6);});});}exports[_0x11a6('0x1a')]=function(_0x25a4c5){var _0x1e8b38=this;return new Promise(function(_0x595d3c,_0x485a4f){return db[_0x11a6('0x1b')][_0x11a6('0x1c')](_0x25a4c5[_0x11a6('0x1d')],{'raw':_0x25a4c5['options']?_0x25a4c5['options'][_0x11a6('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x707dd2){logger['info']('CreateFaxMessage',_0x25a4c5);logger['debug']('CreateFaxMessage',_0x25a4c5,JSON[_0x11a6('0x14')](_0x707dd2));_0x595d3c(_0x707dd2);})['catch'](function(_0x1830f6){logger[_0x11a6('0x15')]('CreateFaxMessage',_0x1830f6['message'],_0x25a4c5);_0x485a4f(_0x1e8b38[_0x11a6('0x15')](0x1f4,_0x1830f6[_0x11a6('0x17')]));});});};exports[_0x11a6('0x1f')]=function(_0x2715d5){var _0x14f510=this;return new Promise(function(_0x407ae0,_0x40e3b4){return db[_0x11a6('0x1b')][_0x11a6('0x20')](_0x2715d5[_0x11a6('0x1d')],{'raw':_0x2715d5[_0x11a6('0x21')]?_0x2715d5[_0x11a6('0x21')][_0x11a6('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2715d5[_0x11a6('0x21')]?_0x2715d5[_0x11a6('0x21')][_0x11a6('0x22')]||null:null,'attributes':_0x2715d5[_0x11a6('0x21')]?_0x2715d5[_0x11a6('0x21')][_0x11a6('0x23')]||null:null,'limit':_0x2715d5[_0x11a6('0x21')]?_0x2715d5[_0x11a6('0x21')][_0x11a6('0x24')]||null:null})[_0x11a6('0xf')](function(_0x1ec7aa){logger[_0x11a6('0x10')]('UpdateFaxMessage',_0x2715d5);logger[_0x11a6('0x13')]('UpdateFaxMessage',_0x2715d5,JSON[_0x11a6('0x14')](_0x1ec7aa));_0x407ae0(_0x1ec7aa);})[_0x11a6('0x19')](function(_0x10f481){logger[_0x11a6('0x15')](_0x11a6('0x1f'),_0x10f481['message'],_0x2715d5);_0x40e3b4(_0x14f510[_0x11a6('0x15')](0x1f4,_0x10f481[_0x11a6('0x17')]));});});}; \ No newline at end of file +var _0x8a9c=['request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','FaxMessage,\x20%s,\x20%s','message','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','UpdateFaxMessage','update','where','attributes','limit','then','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','request','info'];(function(_0x4086d6,_0x557ec7){var _0x4b8756=function(_0x5c7aff){while(--_0x5c7aff){_0x4086d6['push'](_0x4086d6['shift']());}};_0x4b8756(++_0x557ec7);}(_0x8a9c,0x12d));var _0xc8a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8a9c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc8a9('0x0'));var util=require(_0xc8a9('0x1'));var moment=require(_0xc8a9('0x2'));var BPromise=require(_0xc8a9('0x3'));var rs=require(_0xc8a9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc8a9('0x5'))['db'];var utils=require(_0xc8a9('0x6'));var logger=require('../../config/logger')(_0xc8a9('0x7'));var config=require(_0xc8a9('0x8'));var jayson=require(_0xc8a9('0x9'));var client=jayson['client'][_0xc8a9('0xa')]({'port':0x232a});config[_0xc8a9('0xb')]=_[_0xc8a9('0xc')](config[_0xc8a9('0xb')],{'host':_0xc8a9('0xd'),'port':0x18eb});var socket=require(_0xc8a9('0xe'))(new Redis(config[_0xc8a9('0xb')]));require(_0xc8a9('0xf'))[_0xc8a9('0x10')](socket);function respondWithRpcPromise(_0x4e2cf4,_0x523bb4,_0x3dd5ee){return new BPromise(function(_0x43b632,_0x48bf98){return client[_0xc8a9('0x11')](_0x4e2cf4,_0x3dd5ee)['then'](function(_0x1ea946){logger[_0xc8a9('0x12')]('FaxMessage,\x20%s,\x20%s',_0x523bb4,_0xc8a9('0x13'));logger['debug'](_0xc8a9('0x14'),_0x523bb4,_0xc8a9('0x13'),JSON[_0xc8a9('0x15')](_0x1ea946));if(_0x1ea946[_0xc8a9('0x16')]){if(_0x1ea946[_0xc8a9('0x16')]['code']===0x1f4){logger['error'](_0xc8a9('0x17'),_0x523bb4,_0x1ea946['error'][_0xc8a9('0x18')]);return _0x48bf98(_0x1ea946[_0xc8a9('0x16')][_0xc8a9('0x18')]);}logger[_0xc8a9('0x16')]('FaxMessage,\x20%s,\x20%s',_0x523bb4,_0x1ea946['error']['message']);return _0x43b632(_0x1ea946['error'][_0xc8a9('0x18')]);}else{logger[_0xc8a9('0x12')]('FaxMessage,\x20%s,\x20%s',_0x523bb4,_0xc8a9('0x13'));_0x43b632(_0x1ea946[_0xc8a9('0x19')][_0xc8a9('0x18')]);}})[_0xc8a9('0x1a')](function(_0x196e3d){logger[_0xc8a9('0x16')](_0xc8a9('0x17'),_0x523bb4,_0x196e3d);_0x48bf98(_0x196e3d);});});}exports[_0xc8a9('0x1b')]=function(_0x555e61){var _0x39ca25=this;return new Promise(function(_0x3b42ad,_0x44886a){return db[_0xc8a9('0x1c')][_0xc8a9('0x1d')](_0x555e61[_0xc8a9('0x1e')],{'raw':_0x555e61[_0xc8a9('0x1f')]?_0x555e61[_0xc8a9('0x1f')][_0xc8a9('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x36d9cd){logger[_0xc8a9('0x12')](_0xc8a9('0x1b'),_0x555e61);logger['debug'](_0xc8a9('0x1b'),_0x555e61,JSON[_0xc8a9('0x15')](_0x36d9cd));_0x3b42ad(_0x36d9cd);})['catch'](function(_0x1b51b9){logger[_0xc8a9('0x16')]('CreateFaxMessage',_0x1b51b9[_0xc8a9('0x18')],_0x555e61);_0x44886a(_0x39ca25[_0xc8a9('0x16')](0x1f4,_0x1b51b9[_0xc8a9('0x18')]));});});};exports[_0xc8a9('0x21')]=function(_0x19c965){var _0x588852=this;return new Promise(function(_0x8fc02a,_0x17f08c){return db[_0xc8a9('0x1c')][_0xc8a9('0x22')](_0x19c965['body'],{'raw':_0x19c965[_0xc8a9('0x1f')]?_0x19c965[_0xc8a9('0x1f')][_0xc8a9('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19c965['options']?_0x19c965[_0xc8a9('0x1f')][_0xc8a9('0x23')]||null:null,'attributes':_0x19c965[_0xc8a9('0x1f')]?_0x19c965[_0xc8a9('0x1f')][_0xc8a9('0x24')]||null:null,'limit':_0x19c965[_0xc8a9('0x1f')]?_0x19c965[_0xc8a9('0x1f')][_0xc8a9('0x25')]||null:null})[_0xc8a9('0x26')](function(_0x236361){logger[_0xc8a9('0x12')](_0xc8a9('0x21'),_0x19c965);logger[_0xc8a9('0x27')](_0xc8a9('0x21'),_0x19c965,JSON[_0xc8a9('0x15')](_0x236361));_0x8fc02a(_0x236361);})[_0xc8a9('0x1a')](function(_0x2d29b6){logger[_0xc8a9('0x16')](_0xc8a9('0x21'),_0x2d29b6[_0xc8a9('0x18')],_0x19c965);_0x17f08c(_0x588852[_0xc8a9('0x16')](0x1f4,_0x2d29b6['message']));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 720bae5..0b8b1bc 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 _0xbd60=['register','length','faxMessage:','./faxMessage.events','save','remove','update','emit','removeListener'];(function(_0x3118ef,_0x3ca0f9){var _0x5a9c0e=function(_0x2faaf5){while(--_0x2faaf5){_0x3118ef['push'](_0x3118ef['shift']());}};_0x5a9c0e(++_0x3ca0f9);}(_0xbd60,0x162));var _0x0bd6=function(_0x14b989,_0x46995a){_0x14b989=_0x14b989-0x0;var _0x3e33af=_0xbd60[_0x14b989];return _0x3e33af;};'use strict';var FaxMessageEvents=require(_0x0bd6('0x0'));var events=[_0x0bd6('0x1'),_0x0bd6('0x2'),_0x0bd6('0x3')];function createListener(_0x141089,_0x20fa2a){return function(_0x1fb9f7){_0x20fa2a[_0x0bd6('0x4')](_0x141089,_0x1fb9f7);};}function removeListener(_0x4ec327,_0x2214df){return function(){FaxMessageEvents[_0x0bd6('0x5')](_0x4ec327,_0x2214df);};}exports[_0x0bd6('0x6')]=function(_0x4c7613){for(var _0x3ebf93=0x0,_0x346e66=events[_0x0bd6('0x7')];_0x3ebf93<_0x346e66;_0x3ebf93++){var _0x12efb0=events[_0x3ebf93];var _0x5eb4a0=createListener(_0x0bd6('0x8')+_0x12efb0,_0x4c7613);FaxMessageEvents['on'](_0x12efb0,_0x5eb4a0);}}; \ No newline at end of file +var _0xfdcb=['removeListener','register','length','faxMessage:','./faxMessage.events','save','remove','update'];(function(_0x4ee4ab,_0x2d5175){var _0x575def=function(_0x323270){while(--_0x323270){_0x4ee4ab['push'](_0x4ee4ab['shift']());}};_0x575def(++_0x2d5175);}(_0xfdcb,0x134));var _0xbfdc=function(_0x217c2e,_0x358f06){_0x217c2e=_0x217c2e-0x0;var _0x22b7d8=_0xfdcb[_0x217c2e];return _0x22b7d8;};'use strict';var FaxMessageEvents=require(_0xbfdc('0x0'));var events=[_0xbfdc('0x1'),_0xbfdc('0x2'),_0xbfdc('0x3')];function createListener(_0x298b70,_0xd38498){return function(_0x2daf5b){_0xd38498['emit'](_0x298b70,_0x2daf5b);};}function removeListener(_0x489c4d,_0x9d5126){return function(){FaxMessageEvents[_0xbfdc('0x4')](_0x489c4d,_0x9d5126);};}exports[_0xbfdc('0x5')]=function(_0x499dc1){for(var _0x29b7f2=0x0,_0x875b31=events[_0xbfdc('0x6')];_0x29b7f2<_0x875b31;_0x29b7f2++){var _0x23778a=events[_0x29b7f2];var _0x165e00=createListener(_0xbfdc('0x7')+_0x23778a,_0x499dc1);FaxMessageEvents['on'](_0x23778a,_0x165e00);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index bed57ab..e09440e 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(_0x159154,_0x4a7b40){var _0x566c70=function(_0x129a09){while(--_0x129a09){_0x159154['push'](_0x159154['shift']());}};_0x566c70(++_0x4a7b40);}(_0x82c4,0x1ca));var _0x482c=function(_0x115d1f,_0xc8262){_0x115d1f=_0x115d1f-0x0;var _0x357a9e=_0x82c4[_0x115d1f];return _0x357a9e;};'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 _0x1883=['isAuthenticated','index','/describe','describe','/:id','download','post','fax','faxmessage:create','update','put','/:id/accept','reject','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get'];(function(_0x3644b0,_0x4191db){var _0x49fc6e=function(_0x4817a9){while(--_0x4817a9){_0x3644b0['push'](_0x3644b0['shift']());}};_0x49fc6e(++_0x4191db);}(_0x1883,0xab));var _0x3188=function(_0x298a5f,_0x26e88d){_0x298a5f=_0x298a5f-0x0;var _0x266c0f=_0x1883[_0x298a5f];return _0x266c0f;};'use strict';var multer=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var path=require(_0x3188('0x2'));var timeout=require(_0x3188('0x3'));var express=require(_0x3188('0x4'));var router=express[_0x3188('0x5')]();var auth=require(_0x3188('0x6'));var interaction=require(_0x3188('0x7'));var config=require(_0x3188('0x8'));var controller=require(_0x3188('0x9'));router[_0x3188('0xa')]('/',auth[_0x3188('0xb')](),controller[_0x3188('0xc')]);router[_0x3188('0xa')](_0x3188('0xd'),auth[_0x3188('0xb')](),controller[_0x3188('0xe')]);router['get'](_0x3188('0xf'),auth[_0x3188('0xb')](),controller['show']);router[_0x3188('0xa')]('/:id/download',auth[_0x3188('0xb')](),controller[_0x3188('0x10')]);router[_0x3188('0x11')]('/',auth[_0x3188('0xb')](),interaction['tracked'](_0x3188('0x12'),_0x3188('0x13')),controller['create']);router['put'](_0x3188('0xf'),auth[_0x3188('0xb')](),controller[_0x3188('0x14')]);router[_0x3188('0x15')](_0x3188('0x16'),auth[_0x3188('0xb')](),controller['accept']);router[_0x3188('0x15')]('/:id/reject',auth['isAuthenticated'](),controller[_0x3188('0x17')]);router['delete']('/:id',auth[_0x3188('0xb')](),controller[_0x3188('0x18')]);module[_0x3188('0x19')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 0dcd78d..462a721 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 _0x3b16=['sequelize','exports','name','STRING','INTEGER','rrmemory','beepall','roundrobin'];(function(_0x49ecf7,_0x5a6d71){var _0x217540=function(_0x90d3c){while(--_0x90d3c){_0x49ecf7['push'](_0x49ecf7['shift']());}};_0x217540(++_0x5a6d71);}(_0x3b16,0xb8));var _0x63b1=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x3b16[_0x311c35];return _0x5cc50c;};'use strict';var Sequelize=require(_0x63b1('0x0'));module[_0x63b1('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x63b1('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x63b1('0x3')]},'timeout':{'type':Sequelize[_0x63b1('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x63b1('0x5'),_0x63b1('0x6'),_0x63b1('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x63b1('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa796=['sequelize','exports','STRING','name','INTEGER','ENUM','beepall','roundrobin'];(function(_0x5bd343,_0x49b555){var _0x58437f=function(_0x4f2c18){while(--_0x4f2c18){_0x5bd343['push'](_0x5bd343['shift']());}};_0x58437f(++_0x49b555);}(_0xa796,0xb0));var _0x6a79=function(_0x269ac3,_0x1cf6fe){_0x269ac3=_0x269ac3-0x0;var _0x5528d3=_0xa796[_0x269ac3];return _0x5528d3;};'use strict';var Sequelize=require(_0x6a79('0x0'));module[_0x6a79('0x1')]={'name':{'type':Sequelize[_0x6a79('0x2')],'unique':_0x6a79('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x6a79('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6a79('0x5')]('rrmemory',_0x6a79('0x6'),_0x6a79('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'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 06b6794..08060d9 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 _0x3fe6=['transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','ids','select','tq.TeamId','from','join','user_has_teams','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','TeamId','all','union','compact','value','isEmpty','removeAgents','userFaxQueue:remove','addAgents','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','lodash','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','json','count','offset','limit','set','reject','update','then','destroy','FaxQueues','UserProfileResource','end','error','stack','name','send','index','FaxQueue','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','includeAll','include','rows','catch','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserFaxQueue','pick','FaxQueueId','options','findAll','User','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','%s/%s','SIP','Team','nolimit','getTeams','addTeams','teams','Agents','interface','flatMap','sequelize'];(function(_0x316aa6,_0x1af6fc){var _0x41fca2=function(_0x22db58){while(--_0x22db58){_0x316aa6['push'](_0x316aa6['shift']());}};_0x41fca2(++_0x1af6fc);}(_0x3fe6,0x1b1));var _0x63fe=function(_0x29aefc,_0x4dcf53){_0x29aefc=_0x29aefc-0x0;var _0x11be36=_0x3fe6[_0x29aefc];return _0x11be36;};'use strict';var pdf=require(_0x63fe('0x0'));var emlformat=require(_0x63fe('0x1'));var rimraf=require(_0x63fe('0x2'));var zipdir=require(_0x63fe('0x3'));var jsonpatch=require(_0x63fe('0x4'));var rp=require('request-promise');var moment=require(_0x63fe('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x63fe('0x6'));var util=require(_0x63fe('0x7'));var path=require('path');var sox=require(_0x63fe('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x63fe('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x63fe('0xa'));var deskjs=require(_0x63fe('0xb'));var toCsv=require(_0x63fe('0xc'));var querystring=require(_0x63fe('0xd'));var Papa=require(_0x63fe('0xe'));var Redis=require('ioredis');var authService=require(_0x63fe('0xf'));var qs=require(_0x63fe('0x10'));var hardwareService=require(_0x63fe('0x11'));var logger=require('../../config/logger')(_0x63fe('0x12'));var utils=require(_0x63fe('0x13'));var config=require(_0x63fe('0x14'));var db=require(_0x63fe('0x15'))['db'];config[_0x63fe('0x16')]=_[_0x63fe('0x17')](config[_0x63fe('0x16')],{'host':_0x63fe('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxQueue.socket')[_0x63fe('0x19')](socket);function respondWithStatusCode(_0x2fe0b4,_0x9651f2){_0x9651f2=_0x9651f2||0xcc;return function(_0x409331){if(_0x409331){return _0x2fe0b4[_0x63fe('0x1a')](_0x9651f2);}return _0x2fe0b4['status'](_0x9651f2)['end']();};}function respondWithResult(_0x16c141,_0x1b3ac1){_0x1b3ac1=_0x1b3ac1||0xc8;return function(_0xc60ec5){if(_0xc60ec5){return _0x16c141[_0x63fe('0x1b')](_0x1b3ac1)[_0x63fe('0x1c')](_0xc60ec5);}};}function respondWithFilteredResult(_0x533b56,_0x3fc9d4){return function(_0x3de8cd){if(_0x3de8cd){var _0x549434=_0x3de8cd[_0x63fe('0x1d')],_0xea6eac=_0x3fc9d4[_0x63fe('0x1e')],_0xcfe1e1=_0x3fc9d4['offset']+_0x3fc9d4[_0x63fe('0x1f')],_0x40cd71;if(_0xcfe1e1>=_0x549434){_0xcfe1e1=_0x549434;_0x40cd71=0xc8;}else{_0x40cd71=0xce;}_0x533b56['status'](_0x40cd71);return _0x533b56[_0x63fe('0x20')]('Content-Range',_0xea6eac+'-'+_0xcfe1e1+'/'+_0x549434)['json'](_0x3de8cd);}return null;};}function patchUpdates(_0x25f280){return function(_0x6c87fe){try{jsonpatch['apply'](_0x6c87fe,_0x25f280,!![]);}catch(_0x418a2c){return BPromise[_0x63fe('0x21')](_0x418a2c);}return _0x6c87fe['save']();};}function saveUpdates(_0x4bf8e6,_0x828193){return function(_0x5e6ab2){if(_0x5e6ab2){return _0x5e6ab2[_0x63fe('0x22')](_0x4bf8e6)[_0x63fe('0x23')](function(_0x58ac91){return _0x58ac91;});}return null;};}function removeEntity(_0x21f5c2,_0x177498){return function(_0x298c4a){if(_0x298c4a){return _0x298c4a[_0x63fe('0x24')]()[_0x63fe('0x23')](function(){var _0x144051=_0x298c4a['get']({'plain':!![]});var _0x2d5ae7=_0x63fe('0x25');return db[_0x63fe('0x26')][_0x63fe('0x24')]({'where':{'type':_0x2d5ae7,'resourceId':_0x144051['id']}})[_0x63fe('0x23')](function(){return _0x298c4a;});})[_0x63fe('0x23')](function(){_0x21f5c2[_0x63fe('0x1b')](0xcc)[_0x63fe('0x27')]();});}};}function handleEntityNotFound(_0x1b7391,_0x16a3a5){return function(_0x386664){if(!_0x386664){_0x1b7391[_0x63fe('0x1a')](0x194);}return _0x386664;};}function handleError(_0x426928,_0x31e008){_0x31e008=_0x31e008||0x1f4;return function(_0x367346){logger[_0x63fe('0x28')](_0x367346[_0x63fe('0x29')]);if(_0x367346[_0x63fe('0x2a')]){delete _0x367346[_0x63fe('0x2a')];}_0x426928[_0x63fe('0x1b')](_0x31e008)[_0x63fe('0x2b')](_0x367346);};}exports[_0x63fe('0x2c')]=function(_0x3fe3f9,_0x6908b){var _0x49b963={},_0x5718ae={},_0x3aa319={'count':0x0,'rows':[]};var _0x2c1ae5=db[_0x63fe('0x2d')][_0x63fe('0x2e')];_0x5718ae[_0x63fe('0x2f')]=_['keys'](_0x2c1ae5);_0x5718ae[_0x63fe('0x30')]=_[_0x63fe('0x31')](_0x3fe3f9[_0x63fe('0x30')]);_0x5718ae[_0x63fe('0x32')]=_[_0x63fe('0x33')](_0x5718ae[_0x63fe('0x2f')],_0x5718ae[_0x63fe('0x30')]);_0x49b963[_0x63fe('0x34')]=_[_0x63fe('0x33')](_0x5718ae[_0x63fe('0x2f')],qs['fields'](_0x3fe3f9[_0x63fe('0x30')][_0x63fe('0x35')]));_0x49b963[_0x63fe('0x34')]=_0x49b963[_0x63fe('0x34')][_0x63fe('0x36')]?_0x49b963['attributes']:_0x5718ae[_0x63fe('0x2f')];if(!_0x3fe3f9[_0x63fe('0x30')][_0x63fe('0x37')]('nolimit')){_0x49b963[_0x63fe('0x1f')]=qs[_0x63fe('0x1f')](_0x3fe3f9['query'][_0x63fe('0x1f')]);_0x49b963['offset']=qs['offset'](_0x3fe3f9[_0x63fe('0x30')]['offset']);}_0x49b963[_0x63fe('0x38')]=qs[_0x63fe('0x39')](_0x3fe3f9[_0x63fe('0x30')][_0x63fe('0x39')]);_0x49b963[_0x63fe('0x3a')]=qs[_0x63fe('0x32')](_['pick'](_0x3fe3f9['query'],_0x5718ae[_0x63fe('0x32')]));if(_0x3fe3f9[_0x63fe('0x30')][_0x63fe('0x3b')]){_0x49b963[_0x63fe('0x3a')]=_[_0x63fe('0x3c')](_0x49b963[_0x63fe('0x3a')],{'$or':_[_0x63fe('0x3d')](_0x2c1ae5,function(_0x26c6b1){if(_0x26c6b1[_0x63fe('0x3e')][_0x63fe('0x3f')]!==_0x63fe('0x40')){var _0x447dd6={};_0x447dd6[_0x26c6b1[_0x63fe('0x41')]]={'$like':'%'+_0x3fe3f9[_0x63fe('0x30')][_0x63fe('0x3b')]+'%'};return _0x447dd6;}})});}_0x49b963=_[_0x63fe('0x3c')]({},_0x49b963,_0x3fe3f9['options']);var _0x454d4e={'where':_0x49b963[_0x63fe('0x3a')]};return db[_0x63fe('0x2d')]['count'](_0x454d4e)[_0x63fe('0x23')](function(_0x33a0ee){_0x3aa319['count']=_0x33a0ee;if(_0x3fe3f9['query'][_0x63fe('0x42')]){_0x49b963[_0x63fe('0x43')]=[{'all':!![]}];}return db[_0x63fe('0x2d')]['findAll'](_0x49b963);})[_0x63fe('0x23')](function(_0xe26da7){_0x3aa319[_0x63fe('0x44')]=_0xe26da7;return _0x3aa319;})[_0x63fe('0x23')](respondWithFilteredResult(_0x6908b,_0x49b963))[_0x63fe('0x45')](handleError(_0x6908b,null));};exports['show']=function(_0x47e6ef,_0x41607b){var _0x2a1071={'raw':!![],'where':{'id':_0x47e6ef['params']['id']}},_0x5e01c7={};_0x5e01c7[_0x63fe('0x2f')]=_['keys'](db['FaxQueue'][_0x63fe('0x2e')]);_0x5e01c7[_0x63fe('0x30')]=_[_0x63fe('0x31')](_0x47e6ef[_0x63fe('0x30')]);_0x5e01c7[_0x63fe('0x32')]=_[_0x63fe('0x33')](_0x5e01c7[_0x63fe('0x2f')],_0x5e01c7[_0x63fe('0x30')]);_0x2a1071[_0x63fe('0x34')]=_['intersection'](_0x5e01c7[_0x63fe('0x2f')],qs['fields'](_0x47e6ef['query'][_0x63fe('0x35')]));_0x2a1071[_0x63fe('0x34')]=_0x2a1071[_0x63fe('0x34')][_0x63fe('0x36')]?_0x2a1071[_0x63fe('0x34')]:_0x5e01c7[_0x63fe('0x2f')];if(_0x47e6ef[_0x63fe('0x30')][_0x63fe('0x42')]){_0x2a1071[_0x63fe('0x43')]=[{'all':!![]}];}_0x2a1071=_[_0x63fe('0x3c')]({},_0x2a1071,_0x47e6ef['options']);return db[_0x63fe('0x2d')][_0x63fe('0x46')](_0x2a1071)[_0x63fe('0x23')](handleEntityNotFound(_0x41607b,null))[_0x63fe('0x23')](respondWithResult(_0x41607b,null))[_0x63fe('0x45')](handleError(_0x41607b,null));};exports[_0x63fe('0x47')]=function(_0x4f2461,_0x347b0d){return db['FaxQueue']['create'](_0x4f2461[_0x63fe('0x48')],{})['then'](function(_0x4bd6a8){var _0x46ffeb=_0x4f2461[_0x63fe('0x49')][_0x63fe('0x4a')]({'plain':!![]});if(!_0x46ffeb)throw new Error(_0x63fe('0x4b'));if(_0x46ffeb[_0x63fe('0x4c')]===_0x63fe('0x49')){var _0x507147=_0x4bd6a8[_0x63fe('0x4a')]({'plain':!![]});var _0x128c31=_0x63fe('0x25');return db['UserProfileSection'][_0x63fe('0x46')]({'where':{'name':_0x128c31,'userProfileId':_0x46ffeb[_0x63fe('0x4d')]},'raw':!![]})[_0x63fe('0x23')](function(_0x554e46){if(_0x554e46&&_0x554e46[_0x63fe('0x4e')]===0x0){return db[_0x63fe('0x26')]['create']({'name':_0x507147[_0x63fe('0x2a')],'resourceId':_0x507147['id'],'type':_0x554e46[_0x63fe('0x2a')],'sectionId':_0x554e46['id']},{})['then'](function(){return _0x4bd6a8;});}else{return _0x4bd6a8;}})[_0x63fe('0x45')](function(_0x25abdf){logger[_0x63fe('0x28')](_0x63fe('0x4f'),_0x25abdf);throw _0x25abdf;});}return _0x4bd6a8;})[_0x63fe('0x23')](respondWithResult(_0x347b0d,0xc9))[_0x63fe('0x45')](handleError(_0x347b0d,null));};exports[_0x63fe('0x22')]=function(_0x553e59,_0x49f8a2){if(_0x553e59[_0x63fe('0x48')]['id']){delete _0x553e59[_0x63fe('0x48')]['id'];}return db['FaxQueue'][_0x63fe('0x46')]({'where':{'id':_0x553e59[_0x63fe('0x50')]['id']}})[_0x63fe('0x23')](handleEntityNotFound(_0x49f8a2,null))[_0x63fe('0x23')](saveUpdates(_0x553e59[_0x63fe('0x48')],null))[_0x63fe('0x23')](respondWithResult(_0x49f8a2,null))[_0x63fe('0x45')](handleError(_0x49f8a2,null));};exports['destroy']=function(_0xeb9bf0,_0x24d55e){return db[_0x63fe('0x2d')][_0x63fe('0x46')]({'where':{'id':_0xeb9bf0[_0x63fe('0x50')]['id']}})[_0x63fe('0x23')](handleEntityNotFound(_0x24d55e,null))['then'](removeEntity(_0x24d55e,null))['catch'](handleError(_0x24d55e,null));};exports[_0x63fe('0x51')]=function(_0x3d251c,_0x315ea1){return db['FaxQueue'][_0x63fe('0x51')]()[_0x63fe('0x23')](respondWithResult(_0x315ea1,null))[_0x63fe('0x45')](handleError(_0x315ea1,null));};exports[_0x63fe('0x52')]=function(_0x27fb32,_0x29d7a4,_0x4fcb7b){var _0x404d1c={'raw':!![],'where':{}},_0x16e5d2={},_0x2fc7d6;return db[_0x63fe('0x2d')][_0x63fe('0x53')]({'where':{'id':_0x27fb32[_0x63fe('0x50')]['id']}})[_0x63fe('0x23')](handleEntityNotFound(_0x29d7a4,null))[_0x63fe('0x23')](function(_0x52bd61){if(_0x52bd61){_0x2fc7d6=_0x52bd61[_0x63fe('0x4a')]({'plain':!![]});_0x16e5d2['model']=_['keys'](db[_0x63fe('0x54')][_0x63fe('0x2e')]);_0x16e5d2[_0x63fe('0x30')]=_['keys'](_0x27fb32['query']);_0x16e5d2[_0x63fe('0x32')]=_[_0x63fe('0x33')](_0x16e5d2['model'],_0x16e5d2[_0x63fe('0x30')]);_0x404d1c[_0x63fe('0x34')]=_[_0x63fe('0x33')](_0x16e5d2[_0x63fe('0x2f')],qs[_0x63fe('0x35')](_0x27fb32[_0x63fe('0x30')]['fields']));_0x404d1c[_0x63fe('0x34')]=_0x404d1c['attributes']['length']?_0x404d1c['attributes']:_0x16e5d2['model'];if(!_0x27fb32[_0x63fe('0x30')][_0x63fe('0x37')]('nolimit')){_0x404d1c['limit']=qs[_0x63fe('0x1f')](_0x27fb32[_0x63fe('0x30')][_0x63fe('0x1f')]);_0x404d1c[_0x63fe('0x1e')]=qs[_0x63fe('0x1e')](_0x27fb32[_0x63fe('0x30')]['offset']);}_0x404d1c['order']=qs[_0x63fe('0x39')](_0x27fb32[_0x63fe('0x30')][_0x63fe('0x39')]);_0x404d1c[_0x63fe('0x3a')]=qs[_0x63fe('0x32')](_[_0x63fe('0x55')](_0x27fb32['query'],_0x16e5d2[_0x63fe('0x32')]));_0x404d1c[_0x63fe('0x3a')][_0x63fe('0x56')]=_0x52bd61['id'];if(_0x27fb32[_0x63fe('0x30')][_0x63fe('0x3b')]){_0x404d1c[_0x63fe('0x3a')]=_['merge'](_0x404d1c['where'],{'$or':_['map'](_0x404d1c[_0x63fe('0x34')],function(_0x153785){var _0x2a662d={};_0x2a662d[_0x153785]={'$like':'%'+_0x27fb32['query'][_0x63fe('0x3b')]+'%'};return _0x2a662d;})});}_0x404d1c=_['merge']({},_0x404d1c,_0x27fb32[_0x63fe('0x57')]);return db[_0x63fe('0x54')][_0x63fe('0x58')](_0x404d1c);}})['then'](function(_0x1e36df){if(_0x1e36df){return db[_0x63fe('0x59')][_0x63fe('0x5a')]({'where':{'id':_['map'](_0x1e36df,_0x63fe('0x5b')),'role':_0x63fe('0x5c')},'attributes':['id',_0x63fe('0x2a'),_0x63fe('0x5d'),_0x63fe('0x5e'),_0x63fe('0x5f')]});}})[_0x63fe('0x23')](function(_0x39ba0a){if(_0x39ba0a){return{'count':_0x39ba0a[_0x63fe('0x1d')],'rows':_[_0x63fe('0x3d')](_0x39ba0a[_0x63fe('0x44')],function(_0x276be9){return{'membername':_0x276be9[_0x63fe('0x2a')],'UserId':_0x276be9['id'],'queue_name':_0x2fc7d6[_0x63fe('0x2a')],'FaxQueueId':_0x2fc7d6['id'],'interface':util['format'](_0x63fe('0x60'),_0x63fe('0x61'),_0x276be9[_0x63fe('0x2a')]),'penalty':0x0,'paused':_0x276be9[_0x63fe('0x5d')],'createdAt':_0x276be9[_0x63fe('0x5f')],'updatedAt':_0x276be9[_0x63fe('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x63fe('0x23')](respondWithFilteredResult(_0x29d7a4,_0x404d1c))['catch'](handleError(_0x29d7a4,null));};exports['getTeams']=function(_0x2cbaeb,_0x1fbb7b,_0x1eb950){var _0x22d9e7={};var _0x3e7575={};var _0x1b4f61;var _0x2c2236;return db[_0x63fe('0x2d')][_0x63fe('0x53')]({'where':{'id':_0x2cbaeb['params']['id']}})[_0x63fe('0x23')](handleEntityNotFound(_0x1fbb7b,null))['then'](function(_0x512e18){if(_0x512e18){_0x1b4f61=_0x512e18;_0x3e7575['model']=_[_0x63fe('0x31')](db[_0x63fe('0x62')]['rawAttributes']);_0x3e7575[_0x63fe('0x30')]=_[_0x63fe('0x31')](_0x2cbaeb[_0x63fe('0x30')]);_0x3e7575['filters']=_['intersection'](_0x3e7575['model'],_0x3e7575[_0x63fe('0x30')]);_0x22d9e7[_0x63fe('0x34')]=_[_0x63fe('0x33')](_0x3e7575[_0x63fe('0x2f')],qs[_0x63fe('0x35')](_0x2cbaeb[_0x63fe('0x30')]['fields']));_0x22d9e7[_0x63fe('0x34')]=_0x22d9e7['attributes']['length']?_0x22d9e7[_0x63fe('0x34')]:_0x3e7575[_0x63fe('0x2f')];_0x22d9e7[_0x63fe('0x38')]=qs['sort'](_0x2cbaeb[_0x63fe('0x30')][_0x63fe('0x39')]);_0x22d9e7[_0x63fe('0x3a')]=qs[_0x63fe('0x32')](_[_0x63fe('0x55')](_0x2cbaeb['query'],_0x3e7575[_0x63fe('0x32')]));if(_0x2cbaeb[_0x63fe('0x30')][_0x63fe('0x3b')]){_0x22d9e7[_0x63fe('0x3a')]=_[_0x63fe('0x3c')](_0x22d9e7[_0x63fe('0x3a')],{'$or':_[_0x63fe('0x3d')](_0x22d9e7[_0x63fe('0x34')],function(_0x478bb9){var _0xeec457={};_0xeec457[_0x478bb9]={'$like':'%'+_0x2cbaeb[_0x63fe('0x30')][_0x63fe('0x3b')]+'%'};return _0xeec457;})});}_0x22d9e7=_['merge']({},_0x22d9e7,_0x2cbaeb[_0x63fe('0x57')]);return _0x1b4f61['getTeams'](_0x22d9e7);}})['then'](function(_0x3a1903){if(_0x3a1903){_0x2c2236=_0x3a1903['length'];if(!_0x2cbaeb[_0x63fe('0x30')][_0x63fe('0x37')](_0x63fe('0x63'))){_0x22d9e7[_0x63fe('0x1f')]=qs[_0x63fe('0x1f')](_0x2cbaeb['query']['limit']);_0x22d9e7[_0x63fe('0x1e')]=qs[_0x63fe('0x1e')](_0x2cbaeb['query'][_0x63fe('0x1e')]);}return _0x1b4f61[_0x63fe('0x64')](_0x22d9e7);}})[_0x63fe('0x23')](function(_0x2f020e){if(_0x2f020e){return _0x2f020e?{'count':_0x2c2236,'rows':_0x2f020e}:null;}})['then'](respondWithResult(_0x1fbb7b,null))[_0x63fe('0x45')](handleError(_0x1fbb7b,null));};exports[_0x63fe('0x65')]=function(_0x4641c5,_0x1c7da9,_0x548ff3){var _0x124e33=_0x4641c5['body'][_0x63fe('0x66')];return db[_0x63fe('0x62')][_0x63fe('0x58')]({'where':{'id':_[_0x63fe('0x3d')](_0x124e33,'id')},'attributes':['id'],'include':[{'model':db[_0x63fe('0x59')],'as':_0x63fe('0x67'),'attributes':['id',_0x63fe('0x2a'),'online','voicePause',_0x63fe('0x68')],'raw':!![]}]})[_0x63fe('0x23')](function(_0x5f388c){if(_0x5f388c){var _0x3a2c87=_[_0x63fe('0x69')](_0x5f388c,function(_0x184ab4){var _0x123b1f=_0x184ab4['get']({'plain':!![]});return _0x123b1f[_0x63fe('0x67')];});return db[_0x63fe('0x2d')][_0x63fe('0x46')]({'where':{'id':_0x4641c5[_0x63fe('0x50')]['id']}})[_0x63fe('0x23')](function(_0x45c3e5){return db[_0x63fe('0x6a')][_0x63fe('0x6b')](function(_0x4d9d39){return _0x45c3e5[_0x63fe('0x65')](_[_0x63fe('0x3d')](_0x124e33,'id'),{'transaction':_0x4d9d39})['then'](function(){return BPromise[_0x63fe('0x6c')](_0x3a2c87,function(_0xcb1164){return db[_0x63fe('0x54')][_0x63fe('0x6d')]({'where':{'UserId':_0xcb1164['id'],'FaxQueueId':_0x4641c5['params']['id']},'transaction':_0x4d9d39});});})[_0x63fe('0x23')](function(){_0x3a2c87[_0x63fe('0x6e')](function(_0x458696){socket[_0x63fe('0x6f')](_0x63fe('0x70'),{'UserId':_0x458696['id'],'FaxQueueId':_0x45c3e5['id']});});});});});}})[_0x63fe('0x23')](respondWithStatusCode(_0x1c7da9,null))['catch'](handleError(_0x1c7da9,null));};exports[_0x63fe('0x71')]=function(_0x5d2c33,_0x5afae7,_0xbf4180){return db[_0x63fe('0x62')][_0x63fe('0x58')]({'where':{'id':_0x5d2c33[_0x63fe('0x30')][_0x63fe('0x72')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x63fe('0x67'),'attributes':['id'],'raw':!![]}]})[_0x63fe('0x23')](handleEntityNotFound(_0x5afae7,null))[_0x63fe('0x23')](function(_0xced1da){var _0x5447a0=_[_0x63fe('0x3d')](_0xced1da,'id');var _0x2f01a3=[];var _0x144529=[];var _0x3b5bc5=squel[_0x63fe('0x73')]();_0x3b5bc5[_0x63fe('0x41')](_0x63fe('0x74'))[_0x63fe('0x75')]('team_has_fax_queues','tq')[_0x63fe('0x76')](_0x63fe('0x77'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x63fe('0x3a')](_0x63fe('0x78'),_0x5d2c33[_0x63fe('0x50')]['id']);for(var _0x24bd27=0x0;_0x24bd27<_0xced1da['length'];_0x24bd27+=0x1){let _0x5f3647=_0xced1da[_0x24bd27];for(var _0x58b519=0x0;_0x58b519<_0x5f3647['Agents'][_0x63fe('0x36')];_0x58b519+=0x1){let _0xbd006c=_0x5f3647[_0x63fe('0x67')][_0x58b519];var _0x5e48b5=_0x3b5bc5['clone']();_0x5e48b5[_0x63fe('0x3a')](_0x63fe('0x79'),_0xbd006c['id']);_0x144529['push'](db[_0x63fe('0x6a')]['query'](_0x5e48b5[_0x63fe('0x7a')](),{'type':db[_0x63fe('0x6a')][_0x63fe('0x7b')]['SELECT']})[_0x63fe('0x23')](function(_0x2a55ec){if(_0x2a55ec['length']===0x1){return _0xbd006c['id'];}else{var _0x46dad9=_['every'](_[_0x63fe('0x3d')](_0x2a55ec,_0x63fe('0x7c')),function(_0x50552b){return _['includes'](_0x5447a0,_0x50552b);});if(_0x46dad9){return _0xbd006c['id'];}}}));}}return BPromise[_0x63fe('0x7d')](_0x144529)['then'](function(_0x129d20){_0x2f01a3=_(_0x2f01a3)[_0x63fe('0x7e')](_0x129d20)[_0x63fe('0x7f')]()[_0x63fe('0x80')]();return db[_0x63fe('0x2d')]['find']({'where':{'id':_0x5d2c33[_0x63fe('0x50')]['id']}})[_0x63fe('0x23')](function(_0x415c30){return db[_0x63fe('0x6a')]['transaction'](function(_0x15a2e3){return _0x415c30['removeTeams'](_0x5d2c33[_0x63fe('0x30')][_0x63fe('0x72')],{'transaction':_0x15a2e3})[_0x63fe('0x23')](function(){if(!_[_0x63fe('0x81')](_0x2f01a3)){return _0x415c30[_0x63fe('0x82')](_0x2f01a3,{'transaction':_0x15a2e3});}})[_0x63fe('0x23')](function(){_0x2f01a3[_0x63fe('0x6e')](function(_0x5e8f63){socket[_0x63fe('0x6f')](_0x63fe('0x83'),{'UserId':_0x5e8f63,'FaxQueueId':_0x415c30['id']});});});});});});})[_0x63fe('0x23')](respondWithStatusCode(_0x5afae7,null))[_0x63fe('0x45')](handleError(_0x5afae7,null));};exports['addAgents']=function(_0x31db5b,_0x2b1041,_0xa8b4d0){return db[_0x63fe('0x2d')]['find']({'where':{'id':_0x31db5b[_0x63fe('0x50')]['id']}})[_0x63fe('0x23')](handleEntityNotFound(_0x2b1041,null))['then'](function(_0x4ca383){if(_0x4ca383){return _0x4ca383[_0x63fe('0x84')](_0x31db5b[_0x63fe('0x48')][_0x63fe('0x72')],_['omit'](_0x31db5b[_0x63fe('0x48')],['ids','id'])||{})['spread'](function(_0x34dd59){for(var _0x2ae989=0x0;_0x2ae989<_0x31db5b['body'][_0x63fe('0x72')]['length'];_0x2ae989+=0x1){socket[_0x63fe('0x6f')]('userFaxQueue:save',{'UserId':_0x31db5b[_0x63fe('0x48')][_0x63fe('0x72')][_0x2ae989],'FaxQueueId':_0x31db5b['params']['id']});}return _0x34dd59;});}})[_0x63fe('0x23')](respondWithResult(_0x2b1041,null))['catch'](handleError(_0x2b1041,null));};exports[_0x63fe('0x82')]=function(_0x23fd8e,_0x5a6290,_0x3fa8ac){return db['FaxQueue'][_0x63fe('0x46')]({'where':{'id':_0x23fd8e[_0x63fe('0x50')]['id']}})['then'](handleEntityNotFound(_0x5a6290,null))[_0x63fe('0x23')](function(_0x826662){if(_0x826662){return _0x826662['removeAgents'](_0x23fd8e[_0x63fe('0x30')][_0x63fe('0x72')])['then'](function(){if(_[_0x63fe('0x85')](_0x23fd8e[_0x63fe('0x30')]['ids'])){for(var _0x10e0ea=0x0;_0x10e0ea<_0x23fd8e[_0x63fe('0x30')][_0x63fe('0x72')][_0x63fe('0x36')];_0x10e0ea+=0x1){socket[_0x63fe('0x6f')](_0x63fe('0x83'),{'UserId':Number(_0x23fd8e[_0x63fe('0x30')]['ids'][_0x10e0ea]),'FaxQueueId':Number(_0x23fd8e[_0x63fe('0x50')]['id'])});}}else{socket[_0x63fe('0x6f')](_0x63fe('0x83'),{'UserId':Number(_0x23fd8e[_0x63fe('0x30')][_0x63fe('0x72')]),'FaxQueueId':Number(_0x23fd8e[_0x63fe('0x50')]['id'])});}});}})[_0x63fe('0x23')](respondWithStatusCode(_0x5a6290,null))[_0x63fe('0x45')](handleError(_0x5a6290,null));};exports[_0x63fe('0x86')]=function(_0x322b5a,_0x4d0530,_0x39c866){var _0x17f584={};var _0x52af83={};var _0x49d94e;var _0x3b2a09;return db[_0x63fe('0x2d')][_0x63fe('0x53')]({'where':{'id':_0x322b5a[_0x63fe('0x50')]['id']}})[_0x63fe('0x23')](handleEntityNotFound(_0x4d0530,null))[_0x63fe('0x23')](function(_0x13c3c0){if(_0x13c3c0){_0x49d94e=_0x13c3c0;_0x52af83[_0x63fe('0x2f')]=_[_0x63fe('0x31')](db[_0x63fe('0x59')]['rawAttributes']);_0x52af83[_0x63fe('0x30')]=_[_0x63fe('0x31')](_0x322b5a['query']);_0x52af83[_0x63fe('0x32')]=_['intersection'](_0x52af83[_0x63fe('0x2f')],_0x52af83[_0x63fe('0x30')]);_0x17f584[_0x63fe('0x34')]=_['intersection'](_0x52af83[_0x63fe('0x2f')],qs['fields'](_0x322b5a[_0x63fe('0x30')]['fields']));_0x17f584[_0x63fe('0x34')]=_0x17f584[_0x63fe('0x34')][_0x63fe('0x36')]?_0x17f584['attributes']:_0x52af83[_0x63fe('0x2f')];_0x17f584[_0x63fe('0x38')]=qs['sort'](_0x322b5a['query'][_0x63fe('0x39')]);_0x17f584[_0x63fe('0x3a')]=qs[_0x63fe('0x32')](_[_0x63fe('0x55')](_0x322b5a[_0x63fe('0x30')],_0x52af83['filters']));if(_0x322b5a[_0x63fe('0x30')]['filter']){_0x17f584[_0x63fe('0x3a')]=_[_0x63fe('0x3c')](_0x17f584[_0x63fe('0x3a')],{'$or':_[_0x63fe('0x3d')](_0x17f584['attributes'],function(_0x5bf555){var _0x1c2b34={};_0x1c2b34[_0x5bf555]={'$like':'%'+_0x322b5a[_0x63fe('0x30')][_0x63fe('0x3b')]+'%'};return _0x1c2b34;})});}_0x17f584=_[_0x63fe('0x3c')]({},_0x17f584,_0x322b5a['options']);return _0x49d94e[_0x63fe('0x86')](_0x17f584);}})[_0x63fe('0x23')](function(_0x258c7e){if(_0x258c7e){_0x3b2a09=_0x258c7e[_0x63fe('0x36')];if(!_0x322b5a['query'][_0x63fe('0x37')]('nolimit')){_0x17f584['limit']=qs[_0x63fe('0x1f')](_0x322b5a['query'][_0x63fe('0x1f')]);_0x17f584['offset']=qs[_0x63fe('0x1e')](_0x322b5a[_0x63fe('0x30')]['offset']);}return _0x49d94e['getAgents'](_0x17f584);}})[_0x63fe('0x23')](function(_0x3c5754){if(_0x3c5754){return _0x3c5754?{'count':_0x3b2a09,'rows':_0x3c5754}:null;}})[_0x63fe('0x23')](respondWithResult(_0x4d0530,null))[_0x63fe('0x45')](handleError(_0x4d0530,null));}; \ No newline at end of file +var _0xcd61=['SIP','createdAt','getTeams','Team','teams','User','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','ids','select','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','includes','union','value','removeAgents','userFaxQueue:remove','addAgents','isArray','getAgents','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','FaxQueues','UserProfileResource','error','name','index','FaxQueue','rawAttributes','model','keys','query','fields','attributes','length','hasOwnProperty','sort','where','filters','filter','merge','map','type','field','includeAll','include','findAll','rows','catch','show','params','intersection','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','nolimit','pick','FaxQueueId','findAndCountAll','UserId','agent','faxPause','updatedAt','format','%s/%s'];(function(_0x8bbc27,_0x1a1156){var _0x24719f=function(_0x3c3c3d){while(--_0x3c3c3d){_0x8bbc27['push'](_0x8bbc27['shift']());}};_0x24719f(++_0x1a1156);}(_0xcd61,0x135));var _0x1cd6=function(_0xbf881a,_0x104b89){_0xbf881a=_0xbf881a-0x0;var _0x2f5922=_0xcd61[_0xbf881a];return _0x2f5922;};'use strict';var pdf=require(_0x1cd6('0x0'));var emlformat=require(_0x1cd6('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1cd6('0x2'));var rp=require(_0x1cd6('0x3'));var moment=require('moment');var BPromise=require(_0x1cd6('0x4'));var Mustache=require(_0x1cd6('0x5'));var util=require(_0x1cd6('0x6'));var path=require(_0x1cd6('0x7'));var sox=require(_0x1cd6('0x8'));var csv=require(_0x1cd6('0x9'));var ejs=require(_0x1cd6('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x1cd6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x1cd6('0xc'));var toCsv=require(_0x1cd6('0x9'));var querystring=require('querystring');var Papa=require(_0x1cd6('0xd'));var Redis=require(_0x1cd6('0xe'));var authService=require(_0x1cd6('0xf'));var qs=require(_0x1cd6('0x10'));var hardwareService=require(_0x1cd6('0x11'));var logger=require(_0x1cd6('0x12'))(_0x1cd6('0x13'));var utils=require('../../config/utils');var config=require(_0x1cd6('0x14'));var db=require('../../mysqldb')['db'];config[_0x1cd6('0x15')]=_[_0x1cd6('0x16')](config[_0x1cd6('0x15')],{'host':_0x1cd6('0x17'),'port':0x18eb});var socket=require(_0x1cd6('0x18'))(new Redis(config[_0x1cd6('0x15')]));require(_0x1cd6('0x19'))[_0x1cd6('0x1a')](socket);function respondWithStatusCode(_0x48e1f7,_0x384ae3){_0x384ae3=_0x384ae3||0xcc;return function(_0x15f4f2){if(_0x15f4f2){return _0x48e1f7[_0x1cd6('0x1b')](_0x384ae3);}return _0x48e1f7[_0x1cd6('0x1c')](_0x384ae3)[_0x1cd6('0x1d')]();};}function respondWithResult(_0x166bfa,_0x2bb7d3){_0x2bb7d3=_0x2bb7d3||0xc8;return function(_0x31e4b8){if(_0x31e4b8){return _0x166bfa[_0x1cd6('0x1c')](_0x2bb7d3)[_0x1cd6('0x1e')](_0x31e4b8);}};}function respondWithFilteredResult(_0x1dbf09,_0x5f2bc1){return function(_0x3ca745){if(_0x3ca745){var _0xc93881=_0x3ca745[_0x1cd6('0x1f')],_0x302bf8=_0x5f2bc1[_0x1cd6('0x20')],_0x564586=_0x5f2bc1['offset']+_0x5f2bc1[_0x1cd6('0x21')],_0x30edd8;if(_0x564586>=_0xc93881){_0x564586=_0xc93881;_0x30edd8=0xc8;}else{_0x30edd8=0xce;}_0x1dbf09['status'](_0x30edd8);return _0x1dbf09[_0x1cd6('0x22')](_0x1cd6('0x23'),_0x302bf8+'-'+_0x564586+'/'+_0xc93881)['json'](_0x3ca745);}return null;};}function patchUpdates(_0x276d0c){return function(_0xa8ecc3){try{jsonpatch[_0x1cd6('0x24')](_0xa8ecc3,_0x276d0c,!![]);}catch(_0x453130){return BPromise['reject'](_0x453130);}return _0xa8ecc3[_0x1cd6('0x25')]();};}function saveUpdates(_0x5e2cf5,_0x20667a){return function(_0x1a36bc){if(_0x1a36bc){return _0x1a36bc[_0x1cd6('0x26')](_0x5e2cf5)[_0x1cd6('0x27')](function(_0xc8e9a2){return _0xc8e9a2;});}return null;};}function removeEntity(_0x35bec9,_0x266113){return function(_0x4f9273){if(_0x4f9273){return _0x4f9273[_0x1cd6('0x28')]()['then'](function(){var _0x36436f=_0x4f9273[_0x1cd6('0x29')]({'plain':!![]});var _0x216f46=_0x1cd6('0x2a');return db[_0x1cd6('0x2b')][_0x1cd6('0x28')]({'where':{'type':_0x216f46,'resourceId':_0x36436f['id']}})['then'](function(){return _0x4f9273;});})[_0x1cd6('0x27')](function(){_0x35bec9[_0x1cd6('0x1c')](0xcc)[_0x1cd6('0x1d')]();});}};}function handleEntityNotFound(_0x264530,_0x53f306){return function(_0x37b1e7){if(!_0x37b1e7){_0x264530['sendStatus'](0x194);}return _0x37b1e7;};}function handleError(_0x51dcb9,_0x57deee){_0x57deee=_0x57deee||0x1f4;return function(_0x44d54a){logger[_0x1cd6('0x2c')](_0x44d54a['stack']);if(_0x44d54a[_0x1cd6('0x2d')]){delete _0x44d54a[_0x1cd6('0x2d')];}_0x51dcb9['status'](_0x57deee)['send'](_0x44d54a);};}exports[_0x1cd6('0x2e')]=function(_0x318f38,_0x15381a){var _0x1639e8={},_0x2f782b={},_0x4c1dd3={'count':0x0,'rows':[]};var _0x292be1=db[_0x1cd6('0x2f')][_0x1cd6('0x30')];_0x2f782b[_0x1cd6('0x31')]=_[_0x1cd6('0x32')](_0x292be1);_0x2f782b[_0x1cd6('0x33')]=_[_0x1cd6('0x32')](_0x318f38[_0x1cd6('0x33')]);_0x2f782b['filters']=_['intersection'](_0x2f782b[_0x1cd6('0x31')],_0x2f782b['query']);_0x1639e8['attributes']=_['intersection'](_0x2f782b['model'],qs['fields'](_0x318f38[_0x1cd6('0x33')][_0x1cd6('0x34')]));_0x1639e8['attributes']=_0x1639e8[_0x1cd6('0x35')][_0x1cd6('0x36')]?_0x1639e8[_0x1cd6('0x35')]:_0x2f782b[_0x1cd6('0x31')];if(!_0x318f38['query'][_0x1cd6('0x37')]('nolimit')){_0x1639e8['limit']=qs[_0x1cd6('0x21')](_0x318f38['query'][_0x1cd6('0x21')]);_0x1639e8['offset']=qs[_0x1cd6('0x20')](_0x318f38[_0x1cd6('0x33')][_0x1cd6('0x20')]);}_0x1639e8['order']=qs[_0x1cd6('0x38')](_0x318f38[_0x1cd6('0x33')][_0x1cd6('0x38')]);_0x1639e8[_0x1cd6('0x39')]=qs[_0x1cd6('0x3a')](_['pick'](_0x318f38['query'],_0x2f782b[_0x1cd6('0x3a')]));if(_0x318f38[_0x1cd6('0x33')][_0x1cd6('0x3b')]){_0x1639e8[_0x1cd6('0x39')]=_[_0x1cd6('0x3c')](_0x1639e8['where'],{'$or':_[_0x1cd6('0x3d')](_0x292be1,function(_0x460dbd){if(_0x460dbd[_0x1cd6('0x3e')]['key']!=='VIRTUAL'){var _0x3d251f={};_0x3d251f[_0x460dbd[_0x1cd6('0x3f')]]={'$like':'%'+_0x318f38['query'][_0x1cd6('0x3b')]+'%'};return _0x3d251f;}})});}_0x1639e8=_[_0x1cd6('0x3c')]({},_0x1639e8,_0x318f38['options']);var _0x506dba={'where':_0x1639e8[_0x1cd6('0x39')]};return db[_0x1cd6('0x2f')][_0x1cd6('0x1f')](_0x506dba)[_0x1cd6('0x27')](function(_0x27dfa4){_0x4c1dd3['count']=_0x27dfa4;if(_0x318f38[_0x1cd6('0x33')][_0x1cd6('0x40')]){_0x1639e8[_0x1cd6('0x41')]=[{'all':!![]}];}return db[_0x1cd6('0x2f')][_0x1cd6('0x42')](_0x1639e8);})[_0x1cd6('0x27')](function(_0x5f1f83){_0x4c1dd3[_0x1cd6('0x43')]=_0x5f1f83;return _0x4c1dd3;})[_0x1cd6('0x27')](respondWithFilteredResult(_0x15381a,_0x1639e8))[_0x1cd6('0x44')](handleError(_0x15381a,null));};exports[_0x1cd6('0x45')]=function(_0x2710dd,_0x282fc2){var _0x565fb4={'raw':!![],'where':{'id':_0x2710dd[_0x1cd6('0x46')]['id']}},_0x229932={};_0x229932[_0x1cd6('0x31')]=_[_0x1cd6('0x32')](db[_0x1cd6('0x2f')][_0x1cd6('0x30')]);_0x229932[_0x1cd6('0x33')]=_[_0x1cd6('0x32')](_0x2710dd['query']);_0x229932[_0x1cd6('0x3a')]=_['intersection'](_0x229932[_0x1cd6('0x31')],_0x229932[_0x1cd6('0x33')]);_0x565fb4[_0x1cd6('0x35')]=_[_0x1cd6('0x47')](_0x229932[_0x1cd6('0x31')],qs[_0x1cd6('0x34')](_0x2710dd[_0x1cd6('0x33')]['fields']));_0x565fb4[_0x1cd6('0x35')]=_0x565fb4[_0x1cd6('0x35')][_0x1cd6('0x36')]?_0x565fb4[_0x1cd6('0x35')]:_0x229932[_0x1cd6('0x31')];if(_0x2710dd[_0x1cd6('0x33')][_0x1cd6('0x40')]){_0x565fb4[_0x1cd6('0x41')]=[{'all':!![]}];}_0x565fb4=_[_0x1cd6('0x3c')]({},_0x565fb4,_0x2710dd[_0x1cd6('0x48')]);return db[_0x1cd6('0x2f')][_0x1cd6('0x49')](_0x565fb4)[_0x1cd6('0x27')](handleEntityNotFound(_0x282fc2,null))[_0x1cd6('0x27')](respondWithResult(_0x282fc2,null))[_0x1cd6('0x44')](handleError(_0x282fc2,null));};exports[_0x1cd6('0x4a')]=function(_0x4442f8,_0x5c94ca){return db[_0x1cd6('0x2f')][_0x1cd6('0x4a')](_0x4442f8[_0x1cd6('0x4b')],{})['then'](function(_0x599ed8){var _0x529478=_0x4442f8[_0x1cd6('0x4c')][_0x1cd6('0x29')]({'plain':!![]});if(!_0x529478)throw new Error(_0x1cd6('0x4d'));if(_0x529478[_0x1cd6('0x4e')]===_0x1cd6('0x4c')){var _0x2a13f4=_0x599ed8[_0x1cd6('0x29')]({'plain':!![]});var _0x373f79=_0x1cd6('0x2a');return db[_0x1cd6('0x4f')][_0x1cd6('0x49')]({'where':{'name':_0x373f79,'userProfileId':_0x529478['userProfileId']},'raw':!![]})[_0x1cd6('0x27')](function(_0x2599b0){if(_0x2599b0&&_0x2599b0[_0x1cd6('0x50')]===0x0){return db[_0x1cd6('0x2b')]['create']({'name':_0x2a13f4[_0x1cd6('0x2d')],'resourceId':_0x2a13f4['id'],'type':_0x2599b0['name'],'sectionId':_0x2599b0['id']},{})['then'](function(){return _0x599ed8;});}else{return _0x599ed8;}})[_0x1cd6('0x44')](function(_0x5247d5){logger[_0x1cd6('0x2c')](_0x1cd6('0x51'),_0x5247d5);throw _0x5247d5;});}return _0x599ed8;})[_0x1cd6('0x27')](respondWithResult(_0x5c94ca,0xc9))[_0x1cd6('0x44')](handleError(_0x5c94ca,null));};exports[_0x1cd6('0x26')]=function(_0x578942,_0x428946){if(_0x578942[_0x1cd6('0x4b')]['id']){delete _0x578942['body']['id'];}return db[_0x1cd6('0x2f')][_0x1cd6('0x49')]({'where':{'id':_0x578942[_0x1cd6('0x46')]['id']}})['then'](handleEntityNotFound(_0x428946,null))[_0x1cd6('0x27')](saveUpdates(_0x578942[_0x1cd6('0x4b')],null))['then'](respondWithResult(_0x428946,null))['catch'](handleError(_0x428946,null));};exports[_0x1cd6('0x28')]=function(_0x34eb35,_0xbb158b){return db['FaxQueue'][_0x1cd6('0x49')]({'where':{'id':_0x34eb35[_0x1cd6('0x46')]['id']}})['then'](handleEntityNotFound(_0xbb158b,null))['then'](removeEntity(_0xbb158b,null))[_0x1cd6('0x44')](handleError(_0xbb158b,null));};exports[_0x1cd6('0x52')]=function(_0x350de1,_0x588c42){return db[_0x1cd6('0x2f')]['describe']()['then'](respondWithResult(_0x588c42,null))[_0x1cd6('0x44')](handleError(_0x588c42,null));};exports[_0x1cd6('0x53')]=function(_0x4525b4,_0x16332f,_0x2e9494){var _0x4c72e3={'raw':!![],'where':{}},_0x898292={},_0x10f8c5;return db[_0x1cd6('0x2f')][_0x1cd6('0x54')]({'where':{'id':_0x4525b4['params']['id']}})[_0x1cd6('0x27')](handleEntityNotFound(_0x16332f,null))[_0x1cd6('0x27')](function(_0x39748e){if(_0x39748e){_0x10f8c5=_0x39748e['get']({'plain':!![]});_0x898292[_0x1cd6('0x31')]=_['keys'](db[_0x1cd6('0x55')][_0x1cd6('0x30')]);_0x898292[_0x1cd6('0x33')]=_[_0x1cd6('0x32')](_0x4525b4[_0x1cd6('0x33')]);_0x898292['filters']=_[_0x1cd6('0x47')](_0x898292['model'],_0x898292[_0x1cd6('0x33')]);_0x4c72e3[_0x1cd6('0x35')]=_['intersection'](_0x898292[_0x1cd6('0x31')],qs[_0x1cd6('0x34')](_0x4525b4[_0x1cd6('0x33')][_0x1cd6('0x34')]));_0x4c72e3[_0x1cd6('0x35')]=_0x4c72e3[_0x1cd6('0x35')][_0x1cd6('0x36')]?_0x4c72e3[_0x1cd6('0x35')]:_0x898292[_0x1cd6('0x31')];if(!_0x4525b4[_0x1cd6('0x33')][_0x1cd6('0x37')](_0x1cd6('0x56'))){_0x4c72e3[_0x1cd6('0x21')]=qs[_0x1cd6('0x21')](_0x4525b4[_0x1cd6('0x33')]['limit']);_0x4c72e3[_0x1cd6('0x20')]=qs['offset'](_0x4525b4[_0x1cd6('0x33')][_0x1cd6('0x20')]);}_0x4c72e3['order']=qs[_0x1cd6('0x38')](_0x4525b4[_0x1cd6('0x33')][_0x1cd6('0x38')]);_0x4c72e3['where']=qs[_0x1cd6('0x3a')](_[_0x1cd6('0x57')](_0x4525b4[_0x1cd6('0x33')],_0x898292[_0x1cd6('0x3a')]));_0x4c72e3['where'][_0x1cd6('0x58')]=_0x39748e['id'];if(_0x4525b4['query'][_0x1cd6('0x3b')]){_0x4c72e3[_0x1cd6('0x39')]=_[_0x1cd6('0x3c')](_0x4c72e3[_0x1cd6('0x39')],{'$or':_[_0x1cd6('0x3d')](_0x4c72e3[_0x1cd6('0x35')],function(_0x358298){var _0x1f6005={};_0x1f6005[_0x358298]={'$like':'%'+_0x4525b4[_0x1cd6('0x33')][_0x1cd6('0x3b')]+'%'};return _0x1f6005;})});}_0x4c72e3=_[_0x1cd6('0x3c')]({},_0x4c72e3,_0x4525b4[_0x1cd6('0x48')]);return db[_0x1cd6('0x55')]['findAll'](_0x4c72e3);}})[_0x1cd6('0x27')](function(_0x11f069){if(_0x11f069){return db['User'][_0x1cd6('0x59')]({'where':{'id':_[_0x1cd6('0x3d')](_0x11f069,_0x1cd6('0x5a')),'role':_0x1cd6('0x5b')},'attributes':['id',_0x1cd6('0x2d'),_0x1cd6('0x5c'),_0x1cd6('0x5d'),'createdAt']});}})[_0x1cd6('0x27')](function(_0x5a532f){if(_0x5a532f){return{'count':_0x5a532f[_0x1cd6('0x1f')],'rows':_[_0x1cd6('0x3d')](_0x5a532f[_0x1cd6('0x43')],function(_0x13ce7f){return{'membername':_0x13ce7f[_0x1cd6('0x2d')],'UserId':_0x13ce7f['id'],'queue_name':_0x10f8c5[_0x1cd6('0x2d')],'FaxQueueId':_0x10f8c5['id'],'interface':util[_0x1cd6('0x5e')](_0x1cd6('0x5f'),_0x1cd6('0x60'),_0x13ce7f['name']),'penalty':0x0,'paused':_0x13ce7f[_0x1cd6('0x5c')],'createdAt':_0x13ce7f[_0x1cd6('0x61')],'updatedAt':_0x13ce7f['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x1cd6('0x27')](respondWithFilteredResult(_0x16332f,_0x4c72e3))[_0x1cd6('0x44')](handleError(_0x16332f,null));};exports[_0x1cd6('0x62')]=function(_0x50427e,_0x286e4e,_0x3bfa42){var _0x13aec9={};var _0x167ee6={};var _0x4abd9a;var _0x4c7c60;return db[_0x1cd6('0x2f')][_0x1cd6('0x54')]({'where':{'id':_0x50427e[_0x1cd6('0x46')]['id']}})['then'](handleEntityNotFound(_0x286e4e,null))[_0x1cd6('0x27')](function(_0x3d2ccd){if(_0x3d2ccd){_0x4abd9a=_0x3d2ccd;_0x167ee6[_0x1cd6('0x31')]=_[_0x1cd6('0x32')](db[_0x1cd6('0x63')][_0x1cd6('0x30')]);_0x167ee6['query']=_[_0x1cd6('0x32')](_0x50427e[_0x1cd6('0x33')]);_0x167ee6[_0x1cd6('0x3a')]=_[_0x1cd6('0x47')](_0x167ee6[_0x1cd6('0x31')],_0x167ee6[_0x1cd6('0x33')]);_0x13aec9[_0x1cd6('0x35')]=_[_0x1cd6('0x47')](_0x167ee6[_0x1cd6('0x31')],qs[_0x1cd6('0x34')](_0x50427e[_0x1cd6('0x33')][_0x1cd6('0x34')]));_0x13aec9['attributes']=_0x13aec9[_0x1cd6('0x35')][_0x1cd6('0x36')]?_0x13aec9[_0x1cd6('0x35')]:_0x167ee6[_0x1cd6('0x31')];_0x13aec9['order']=qs[_0x1cd6('0x38')](_0x50427e[_0x1cd6('0x33')]['sort']);_0x13aec9[_0x1cd6('0x39')]=qs[_0x1cd6('0x3a')](_[_0x1cd6('0x57')](_0x50427e[_0x1cd6('0x33')],_0x167ee6[_0x1cd6('0x3a')]));if(_0x50427e['query']['filter']){_0x13aec9[_0x1cd6('0x39')]=_[_0x1cd6('0x3c')](_0x13aec9[_0x1cd6('0x39')],{'$or':_[_0x1cd6('0x3d')](_0x13aec9[_0x1cd6('0x35')],function(_0x162503){var _0x35ccda={};_0x35ccda[_0x162503]={'$like':'%'+_0x50427e['query'][_0x1cd6('0x3b')]+'%'};return _0x35ccda;})});}_0x13aec9=_[_0x1cd6('0x3c')]({},_0x13aec9,_0x50427e[_0x1cd6('0x48')]);return _0x4abd9a[_0x1cd6('0x62')](_0x13aec9);}})[_0x1cd6('0x27')](function(_0x528966){if(_0x528966){_0x4c7c60=_0x528966[_0x1cd6('0x36')];if(!_0x50427e['query'][_0x1cd6('0x37')](_0x1cd6('0x56'))){_0x13aec9[_0x1cd6('0x21')]=qs[_0x1cd6('0x21')](_0x50427e[_0x1cd6('0x33')][_0x1cd6('0x21')]);_0x13aec9[_0x1cd6('0x20')]=qs[_0x1cd6('0x20')](_0x50427e['query'][_0x1cd6('0x20')]);}return _0x4abd9a[_0x1cd6('0x62')](_0x13aec9);}})['then'](function(_0x2135ce){if(_0x2135ce){return _0x2135ce?{'count':_0x4c7c60,'rows':_0x2135ce}:null;}})['then'](respondWithResult(_0x286e4e,null))[_0x1cd6('0x44')](handleError(_0x286e4e,null));};exports['addTeams']=function(_0x32dd37,_0x27e8a0,_0x52d7c6){var _0x32015c=_0x32dd37[_0x1cd6('0x4b')][_0x1cd6('0x64')];return db['Team'][_0x1cd6('0x42')]({'where':{'id':_['map'](_0x32015c,'id')},'attributes':['id'],'include':[{'model':db[_0x1cd6('0x65')],'as':_0x1cd6('0x66'),'attributes':['id',_0x1cd6('0x2d'),_0x1cd6('0x67'),'voicePause',_0x1cd6('0x68')],'raw':!![]}]})['then'](function(_0x23c741){if(_0x23c741){var _0x39075c=_[_0x1cd6('0x69')](_0x23c741,function(_0x59aeb5){var _0x40bb0c=_0x59aeb5['get']({'plain':!![]});return _0x40bb0c[_0x1cd6('0x66')];});return db[_0x1cd6('0x2f')][_0x1cd6('0x49')]({'where':{'id':_0x32dd37[_0x1cd6('0x46')]['id']}})[_0x1cd6('0x27')](function(_0x53d2fd){return db[_0x1cd6('0x6a')][_0x1cd6('0x6b')](function(_0x3bd9e1){return _0x53d2fd['addTeams'](_[_0x1cd6('0x3d')](_0x32015c,'id'),{'transaction':_0x3bd9e1})['then'](function(){return BPromise[_0x1cd6('0x6c')](_0x39075c,function(_0x1cfd47){return db[_0x1cd6('0x55')][_0x1cd6('0x6d')]({'where':{'UserId':_0x1cfd47['id'],'FaxQueueId':_0x32dd37[_0x1cd6('0x46')]['id']},'transaction':_0x3bd9e1});});})[_0x1cd6('0x27')](function(){_0x39075c[_0x1cd6('0x6e')](function(_0x590eda){socket[_0x1cd6('0x6f')](_0x1cd6('0x70'),{'UserId':_0x590eda['id'],'FaxQueueId':_0x53d2fd['id']});});});});});}})[_0x1cd6('0x27')](respondWithStatusCode(_0x27e8a0,null))['catch'](handleError(_0x27e8a0,null));};exports[_0x1cd6('0x71')]=function(_0x573c7e,_0xa9ce9a,_0x5a5df4){return db[_0x1cd6('0x63')][_0x1cd6('0x42')]({'where':{'id':_0x573c7e['query'][_0x1cd6('0x72')]},'attributes':['id'],'include':[{'model':db[_0x1cd6('0x65')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x1cd6('0x27')](handleEntityNotFound(_0xa9ce9a,null))['then'](function(_0x2bb2ed){var _0x46041e=_[_0x1cd6('0x3d')](_0x2bb2ed,'id');var _0xf671f4=[];var _0x4e5e96=[];var _0x8cdc92=squel[_0x1cd6('0x73')]();_0x8cdc92['field']('tq.TeamId')[_0x1cd6('0x74')](_0x1cd6('0x75'),'tq')[_0x1cd6('0x76')](_0x1cd6('0x77'),'ut',_0x1cd6('0x78'))['where'](_0x1cd6('0x79'),_0x573c7e['params']['id']);for(var _0x122ec4=0x0;_0x122ec4<_0x2bb2ed[_0x1cd6('0x36')];_0x122ec4+=0x1){let _0x1b967d=_0x2bb2ed[_0x122ec4];for(var _0x5860a9=0x0;_0x5860a9<_0x1b967d[_0x1cd6('0x66')][_0x1cd6('0x36')];_0x5860a9+=0x1){let _0xebe896=_0x1b967d['Agents'][_0x5860a9];var _0x2931d1=_0x8cdc92['clone']();_0x2931d1[_0x1cd6('0x39')](_0x1cd6('0x7a'),_0xebe896['id']);_0x4e5e96['push'](db[_0x1cd6('0x6a')][_0x1cd6('0x33')](_0x2931d1[_0x1cd6('0x7b')](),{'type':db[_0x1cd6('0x6a')][_0x1cd6('0x7c')][_0x1cd6('0x7d')]})[_0x1cd6('0x27')](function(_0x53b4b3){if(_0x53b4b3[_0x1cd6('0x36')]===0x1){return _0xebe896['id'];}else{var _0x3c01bb=_['every'](_[_0x1cd6('0x3d')](_0x53b4b3,_0x1cd6('0x7e')),function(_0x332f7d){return _[_0x1cd6('0x7f')](_0x46041e,_0x332f7d);});if(_0x3c01bb){return _0xebe896['id'];}}}));}}return BPromise['all'](_0x4e5e96)[_0x1cd6('0x27')](function(_0xf4b5ca){_0xf671f4=_(_0xf671f4)[_0x1cd6('0x80')](_0xf4b5ca)['compact']()[_0x1cd6('0x81')]();return db['FaxQueue'][_0x1cd6('0x49')]({'where':{'id':_0x573c7e[_0x1cd6('0x46')]['id']}})['then'](function(_0x49507d){return db['sequelize'][_0x1cd6('0x6b')](function(_0x4bd0d0){return _0x49507d[_0x1cd6('0x71')](_0x573c7e['query'][_0x1cd6('0x72')],{'transaction':_0x4bd0d0})['then'](function(){if(!_['isEmpty'](_0xf671f4)){return _0x49507d[_0x1cd6('0x82')](_0xf671f4,{'transaction':_0x4bd0d0});}})[_0x1cd6('0x27')](function(){_0xf671f4['forEach'](function(_0xad40f3){socket['emit'](_0x1cd6('0x83'),{'UserId':_0xad40f3,'FaxQueueId':_0x49507d['id']});});});});});});})[_0x1cd6('0x27')](respondWithStatusCode(_0xa9ce9a,null))[_0x1cd6('0x44')](handleError(_0xa9ce9a,null));};exports[_0x1cd6('0x84')]=function(_0xe6638c,_0x4e631a,_0x4e2430){return db[_0x1cd6('0x2f')][_0x1cd6('0x49')]({'where':{'id':_0xe6638c[_0x1cd6('0x46')]['id']}})[_0x1cd6('0x27')](handleEntityNotFound(_0x4e631a,null))[_0x1cd6('0x27')](function(_0x36d640){if(_0x36d640){return _0x36d640['addAgents'](_0xe6638c['body'][_0x1cd6('0x72')],_['omit'](_0xe6638c[_0x1cd6('0x4b')],[_0x1cd6('0x72'),'id'])||{})['spread'](function(_0x94f5a5){for(var _0x5a50e6=0x0;_0x5a50e6<_0xe6638c[_0x1cd6('0x4b')][_0x1cd6('0x72')]['length'];_0x5a50e6+=0x1){socket[_0x1cd6('0x6f')]('userFaxQueue:save',{'UserId':_0xe6638c['body'][_0x1cd6('0x72')][_0x5a50e6],'FaxQueueId':_0xe6638c['params']['id']});}return _0x94f5a5;});}})[_0x1cd6('0x27')](respondWithResult(_0x4e631a,null))[_0x1cd6('0x44')](handleError(_0x4e631a,null));};exports[_0x1cd6('0x82')]=function(_0x445bda,_0x20a4d6,_0x473d18){return db[_0x1cd6('0x2f')]['find']({'where':{'id':_0x445bda[_0x1cd6('0x46')]['id']}})[_0x1cd6('0x27')](handleEntityNotFound(_0x20a4d6,null))['then'](function(_0xc689af){if(_0xc689af){return _0xc689af['removeAgents'](_0x445bda[_0x1cd6('0x33')][_0x1cd6('0x72')])[_0x1cd6('0x27')](function(){if(_[_0x1cd6('0x85')](_0x445bda[_0x1cd6('0x33')][_0x1cd6('0x72')])){for(var _0x5a6829=0x0;_0x5a6829<_0x445bda[_0x1cd6('0x33')][_0x1cd6('0x72')][_0x1cd6('0x36')];_0x5a6829+=0x1){socket[_0x1cd6('0x6f')](_0x1cd6('0x83'),{'UserId':Number(_0x445bda['query'][_0x1cd6('0x72')][_0x5a6829]),'FaxQueueId':Number(_0x445bda[_0x1cd6('0x46')]['id'])});}}else{socket[_0x1cd6('0x6f')](_0x1cd6('0x83'),{'UserId':Number(_0x445bda[_0x1cd6('0x33')][_0x1cd6('0x72')]),'FaxQueueId':Number(_0x445bda[_0x1cd6('0x46')]['id'])});}});}})[_0x1cd6('0x27')](respondWithStatusCode(_0x20a4d6,null))[_0x1cd6('0x44')](handleError(_0x20a4d6,null));};exports[_0x1cd6('0x86')]=function(_0x455fac,_0x327c04,_0x59f3b5){var _0x1edf58={};var _0x3f4785={};var _0x247b9e;var _0x4c5e7b;return db[_0x1cd6('0x2f')]['findOne']({'where':{'id':_0x455fac[_0x1cd6('0x46')]['id']}})[_0x1cd6('0x27')](handleEntityNotFound(_0x327c04,null))[_0x1cd6('0x27')](function(_0x4c1ba6){if(_0x4c1ba6){_0x247b9e=_0x4c1ba6;_0x3f4785['model']=_[_0x1cd6('0x32')](db[_0x1cd6('0x65')]['rawAttributes']);_0x3f4785[_0x1cd6('0x33')]=_[_0x1cd6('0x32')](_0x455fac['query']);_0x3f4785['filters']=_[_0x1cd6('0x47')](_0x3f4785[_0x1cd6('0x31')],_0x3f4785[_0x1cd6('0x33')]);_0x1edf58[_0x1cd6('0x35')]=_[_0x1cd6('0x47')](_0x3f4785[_0x1cd6('0x31')],qs[_0x1cd6('0x34')](_0x455fac['query']['fields']));_0x1edf58['attributes']=_0x1edf58['attributes'][_0x1cd6('0x36')]?_0x1edf58[_0x1cd6('0x35')]:_0x3f4785[_0x1cd6('0x31')];_0x1edf58['order']=qs['sort'](_0x455fac[_0x1cd6('0x33')][_0x1cd6('0x38')]);_0x1edf58[_0x1cd6('0x39')]=qs[_0x1cd6('0x3a')](_[_0x1cd6('0x57')](_0x455fac[_0x1cd6('0x33')],_0x3f4785[_0x1cd6('0x3a')]));if(_0x455fac[_0x1cd6('0x33')][_0x1cd6('0x3b')]){_0x1edf58[_0x1cd6('0x39')]=_[_0x1cd6('0x3c')](_0x1edf58['where'],{'$or':_['map'](_0x1edf58[_0x1cd6('0x35')],function(_0x5d015c){var _0x1db42a={};_0x1db42a[_0x5d015c]={'$like':'%'+_0x455fac['query'][_0x1cd6('0x3b')]+'%'};return _0x1db42a;})});}_0x1edf58=_[_0x1cd6('0x3c')]({},_0x1edf58,_0x455fac[_0x1cd6('0x48')]);return _0x247b9e[_0x1cd6('0x86')](_0x1edf58);}})[_0x1cd6('0x27')](function(_0x3d2b42){if(_0x3d2b42){_0x4c5e7b=_0x3d2b42[_0x1cd6('0x36')];if(!_0x455fac[_0x1cd6('0x33')][_0x1cd6('0x37')](_0x1cd6('0x56'))){_0x1edf58[_0x1cd6('0x21')]=qs[_0x1cd6('0x21')](_0x455fac[_0x1cd6('0x33')]['limit']);_0x1edf58['offset']=qs[_0x1cd6('0x20')](_0x455fac[_0x1cd6('0x33')][_0x1cd6('0x20')]);}return _0x247b9e[_0x1cd6('0x86')](_0x1edf58);}})[_0x1cd6('0x27')](function(_0x4fef95){if(_0x4fef95){return _0x4fef95?{'count':_0x4c5e7b,'rows':_0x4fef95}:null;}})[_0x1cd6('0x27')](respondWithResult(_0x327c04,null))[_0x1cd6('0x44')](handleError(_0x327c04,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 578e0f3..2ccdc62 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 _0xd404=['emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','remove'];(function(_0x8815fa,_0x3dcc65){var _0x4ad72e=function(_0x318c42){while(--_0x318c42){_0x8815fa['push'](_0x8815fa['shift']());}};_0x4ad72e(++_0x3dcc65);}(_0xd404,0x15b));var _0x4d40=function(_0x51162c,_0x39eb5d){_0x51162c=_0x51162c-0x0;var _0x21b6b0=_0xd404[_0x51162c];return _0x21b6b0;};'use strict';var EventEmitter=require(_0x4d40('0x0'));var FaxQueue=require(_0x4d40('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x4d40('0x2')](0x0);var events={'afterCreate':_0x4d40('0x3'),'afterUpdate':'update','afterDestroy':_0x4d40('0x4')};function emitEvent(_0x610dbf){return function(_0xba821,_0x8bde12,_0xbfb4c6){FaxQueueEvents[_0x4d40('0x5')](_0x610dbf+':'+_0xba821['id'],_0xba821);FaxQueueEvents[_0x4d40('0x5')](_0x610dbf,_0xba821);_0xbfb4c6(null);};}for(var e in events){if(events[_0x4d40('0x6')](e)){var event=events[e];FaxQueue[_0x4d40('0x7')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0xeb74=['emit','hook','events','../../mysqldb','FaxQueue','setMaxListeners','save','update','remove'];(function(_0x2eedb5,_0x2e1801){var _0x534cd6=function(_0x17100c){while(--_0x17100c){_0x2eedb5['push'](_0x2eedb5['shift']());}};_0x534cd6(++_0x2e1801);}(_0xeb74,0xe3));var _0x4eb7=function(_0x4ec2c0,_0x553c5d){_0x4ec2c0=_0x4ec2c0-0x0;var _0x531ced=_0xeb74[_0x4ec2c0];return _0x531ced;};'use strict';var EventEmitter=require(_0x4eb7('0x0'));var FaxQueue=require(_0x4eb7('0x1'))['db'][_0x4eb7('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x4eb7('0x3')](0x0);var events={'afterCreate':_0x4eb7('0x4'),'afterUpdate':_0x4eb7('0x5'),'afterDestroy':_0x4eb7('0x6')};function emitEvent(_0x568531){return function(_0x35c7ca,_0x1dc8d0,_0x29b666){FaxQueueEvents[_0x4eb7('0x7')](_0x568531+':'+_0x35c7ca['id'],_0x35c7ca);FaxQueueEvents[_0x4eb7('0x7')](_0x568531,_0x35c7ca);_0x29b666(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0x4eb7('0x8')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 145ad81..139425c 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 _0xadb5=['bluebird','path','rimraf','../../config/environment','exports','define','FaxQueue','fax_queues','util','api','moment'];(function(_0x216421,_0x5b3116){var _0x23ac74=function(_0x3d1a88){while(--_0x3d1a88){_0x216421['push'](_0x216421['shift']());}};_0x23ac74(++_0x5b3116);}(_0xadb5,0xad));var _0x5adb=function(_0x57c675,_0x235337){_0x57c675=_0x57c675-0x0;var _0x56d9b9=_0xadb5[_0x57c675];return _0x56d9b9;};'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 +var _0x0b0e=['path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0xc3e5c2,_0x41bce9){var _0x2f6239=function(_0x7ea4af){while(--_0x7ea4af){_0xc3e5c2['push'](_0xc3e5c2['shift']());}};_0x2f6239(++_0x41bce9);}(_0x0b0e,0x187));var _0xe0b0=function(_0x482214,_0x2550ff){_0x482214=_0x482214-0x0;var _0x38d0cb=_0x0b0e[_0x482214];return _0x38d0cb;};'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')]('FaxQueue',attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index 06d09e1..6059ae7 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 _0x5293=['../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','./faxQueue.socket','then','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','FaxQueue,\x20%s,\x20%s','message','info','result','catch','GetFaxQueue','findAll','options','raw','attributes','limit','include','map','find','where','model','ShowFaxQueue','debug','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x419b6a,_0x265b43){var _0x229232=function(_0x514a3e){while(--_0x514a3e){_0x419b6a['push'](_0x419b6a['shift']());}};_0x229232(++_0x265b43);}(_0x5293,0x124));var _0x3529=function(_0x4bacb6,_0x2b299d){_0x4bacb6=_0x4bacb6-0x0;var _0x58c029=_0x5293[_0x4bacb6];return _0x58c029;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x3529('0x0'));var rs=require(_0x3529('0x1'));var fs=require('fs');var Redis=require(_0x3529('0x2'));var db=require(_0x3529('0x3'))['db'];var utils=require(_0x3529('0x4'));var logger=require(_0x3529('0x5'))(_0x3529('0x6'));var config=require('../../config/environment');var jayson=require(_0x3529('0x7'));var client=jayson[_0x3529('0x8')]['http']({'port':0x232a});config['redis']=_[_0x3529('0x9')](config['redis'],{'host':_0x3529('0xa'),'port':0x18eb});var socket=require(_0x3529('0xb'))(new Redis(config[_0x3529('0xc')]));require(_0x3529('0xd'))['register'](socket);function respondWithRpcPromise(_0xd57f6f,_0x2b40ee,_0x3e565b){return new BPromise(function(_0x576fa3,_0x16d8c5){return client['request'](_0xd57f6f,_0x3e565b)[_0x3529('0xe')](function(_0x5f114b){logger['info']('FaxQueue,\x20%s,\x20%s',_0x2b40ee,'request\x20sent');logger['debug'](_0x3529('0xf'),_0x2b40ee,_0x3529('0x10'),JSON[_0x3529('0x11')](_0x5f114b));if(_0x5f114b[_0x3529('0x12')]){if(_0x5f114b[_0x3529('0x12')]['code']===0x1f4){logger[_0x3529('0x12')](_0x3529('0x13'),_0x2b40ee,_0x5f114b['error'][_0x3529('0x14')]);return _0x16d8c5(_0x5f114b['error'][_0x3529('0x14')]);}logger[_0x3529('0x12')](_0x3529('0x13'),_0x2b40ee,_0x5f114b[_0x3529('0x12')]['message']);return _0x576fa3(_0x5f114b[_0x3529('0x12')]['message']);}else{logger[_0x3529('0x15')](_0x3529('0x13'),_0x2b40ee,_0x3529('0x10'));_0x576fa3(_0x5f114b[_0x3529('0x16')][_0x3529('0x14')]);}})[_0x3529('0x17')](function(_0x1d3e7c){logger[_0x3529('0x12')](_0x3529('0x13'),_0x2b40ee,_0x1d3e7c);_0x16d8c5(_0x1d3e7c);});});}exports[_0x3529('0x18')]=function(_0xeb2a20){var _0x558b2b=this;return new Promise(function(_0xcf9674,_0x5a3547){return db['FaxQueue'][_0x3529('0x19')]({'raw':_0xeb2a20['options']?_0xeb2a20[_0x3529('0x1a')][_0x3529('0x1b')]===undefined?!![]:![]:!![],'where':_0xeb2a20[_0x3529('0x1a')]?_0xeb2a20['options']['where']||null:null,'attributes':_0xeb2a20[_0x3529('0x1a')]?_0xeb2a20[_0x3529('0x1a')][_0x3529('0x1c')]||null:null,'limit':_0xeb2a20[_0x3529('0x1a')]?_0xeb2a20[_0x3529('0x1a')][_0x3529('0x1d')]||null:null,'include':_0xeb2a20[_0x3529('0x1a')]?_0xeb2a20[_0x3529('0x1a')][_0x3529('0x1e')]?_[_0x3529('0x1f')](_0xeb2a20[_0x3529('0x1a')][_0x3529('0x1e')],function(_0x2bb91b){return{'model':db[_0x2bb91b['model']],'as':_0x2bb91b['as'],'attributes':_0x2bb91b[_0x3529('0x1c')],'include':_0x2bb91b[_0x3529('0x1e')]?_[_0x3529('0x1f')](_0x2bb91b[_0x3529('0x1e')],function(_0x17ce92){return{'model':db[_0x17ce92['model']],'as':_0x17ce92['as'],'attributes':_0x17ce92[_0x3529('0x1c')],'include':_0x17ce92[_0x3529('0x1e')]?_[_0x3529('0x1f')](_0x17ce92[_0x3529('0x1e')],function(_0x36ed2a){return{'model':db[_0x36ed2a['model']],'as':_0x36ed2a['as'],'attributes':_0x36ed2a[_0x3529('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3529('0xe')](function(_0x2aeb99){logger[_0x3529('0x15')](_0x3529('0x18'),_0xeb2a20);logger['debug']('GetFaxQueue',_0xeb2a20,JSON['stringify'](_0x2aeb99));_0xcf9674(_0x2aeb99);})['catch'](function(_0x431d12){logger['error'](_0x3529('0x18'),_0x431d12['message'],_0xeb2a20);_0x5a3547(_0x558b2b[_0x3529('0x12')](0x1f4,_0x431d12['message']));});});};exports['ShowFaxQueue']=function(_0x42efca){var _0xd7099b=this;return new Promise(function(_0x3f5f1f,_0x27a52c){return db['FaxQueue'][_0x3529('0x20')]({'raw':_0x42efca['options']?_0x42efca['options'][_0x3529('0x1b')]===undefined?!![]:![]:!![],'where':_0x42efca[_0x3529('0x1a')]?_0x42efca[_0x3529('0x1a')][_0x3529('0x21')]||null:null,'attributes':_0x42efca[_0x3529('0x1a')]?_0x42efca[_0x3529('0x1a')][_0x3529('0x1c')]||null:null,'include':_0x42efca['options']?_0x42efca[_0x3529('0x1a')]['include']?_[_0x3529('0x1f')](_0x42efca['options'][_0x3529('0x1e')],function(_0x19154e){return{'model':db[_0x19154e['model']],'as':_0x19154e['as'],'attributes':_0x19154e['attributes'],'include':_0x19154e['include']?_['map'](_0x19154e[_0x3529('0x1e')],function(_0x57dce4){return{'model':db[_0x57dce4[_0x3529('0x22')]],'as':_0x57dce4['as'],'attributes':_0x57dce4['attributes'],'include':_0x57dce4[_0x3529('0x1e')]?_['map'](_0x57dce4[_0x3529('0x1e')],function(_0x40745f){return{'model':db[_0x40745f[_0x3529('0x22')]],'as':_0x40745f['as'],'attributes':_0x40745f[_0x3529('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x14d23b){logger[_0x3529('0x15')](_0x3529('0x23'),_0x42efca);logger[_0x3529('0x24')](_0x3529('0x23'),_0x42efca,JSON[_0x3529('0x11')](_0x14d23b));_0x3f5f1f(_0x14d23b);})[_0x3529('0x17')](function(_0x36f0e0){logger[_0x3529('0x12')](_0x3529('0x23'),_0x36f0e0['message'],_0x42efca);_0x27a52c(_0xd7099b[_0x3529('0x12')](0x1f4,_0x36f0e0[_0x3529('0x14')]));});});}; \ No newline at end of file +var _0x60d7=['ShowFaxQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','defaults','redis','socket.io-emitter','./faxQueue.socket','register','then','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','limit','map','include','model','info'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x60d7,0xec));var _0x760d=function(_0x540cea,_0x435685){_0x540cea=_0x540cea-0x0;var _0x52d3ef=_0x60d7[_0x540cea];return _0x52d3ef;};'use strict';var _=require(_0x760d('0x0'));var util=require(_0x760d('0x1'));var moment=require(_0x760d('0x2'));var BPromise=require(_0x760d('0x3'));var rs=require(_0x760d('0x4'));var fs=require('fs');var Redis=require(_0x760d('0x5'));var db=require(_0x760d('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x760d('0x7'));var jayson=require(_0x760d('0x8'));var client=jayson[_0x760d('0x9')]['http']({'port':0x232a});config['redis']=_[_0x760d('0xa')](config[_0x760d('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x760d('0xc'))(new Redis(config[_0x760d('0xb')]));require(_0x760d('0xd'))[_0x760d('0xe')](socket);function respondWithRpcPromise(_0x3bde79,_0xe74054,_0x3a4b7b){return new BPromise(function(_0x551a1a,_0x49b428){return client['request'](_0x3bde79,_0x3a4b7b)[_0x760d('0xf')](function(_0x46cc68){logger['info'](_0x760d('0x10'),_0xe74054,_0x760d('0x11'));logger[_0x760d('0x12')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0xe74054,_0x760d('0x11'),JSON[_0x760d('0x13')](_0x46cc68));if(_0x46cc68['error']){if(_0x46cc68[_0x760d('0x14')][_0x760d('0x15')]===0x1f4){logger[_0x760d('0x14')](_0x760d('0x10'),_0xe74054,_0x46cc68[_0x760d('0x14')][_0x760d('0x16')]);return _0x49b428(_0x46cc68[_0x760d('0x14')][_0x760d('0x16')]);}logger[_0x760d('0x14')](_0x760d('0x10'),_0xe74054,_0x46cc68[_0x760d('0x14')][_0x760d('0x16')]);return _0x551a1a(_0x46cc68[_0x760d('0x14')][_0x760d('0x16')]);}else{logger['info'](_0x760d('0x10'),_0xe74054,_0x760d('0x11'));_0x551a1a(_0x46cc68[_0x760d('0x17')][_0x760d('0x16')]);}})[_0x760d('0x18')](function(_0x33b171){logger[_0x760d('0x14')]('FaxQueue,\x20%s,\x20%s',_0xe74054,_0x33b171);_0x49b428(_0x33b171);});});}exports[_0x760d('0x19')]=function(_0xbc3dba){var _0x35571a=this;return new Promise(function(_0x508584,_0x8b8e58){return db[_0x760d('0x1a')][_0x760d('0x1b')]({'raw':_0xbc3dba[_0x760d('0x1c')]?_0xbc3dba[_0x760d('0x1c')][_0x760d('0x1d')]===undefined?!![]:![]:!![],'where':_0xbc3dba[_0x760d('0x1c')]?_0xbc3dba[_0x760d('0x1c')][_0x760d('0x1e')]||null:null,'attributes':_0xbc3dba[_0x760d('0x1c')]?_0xbc3dba[_0x760d('0x1c')][_0x760d('0x1f')]||null:null,'limit':_0xbc3dba[_0x760d('0x1c')]?_0xbc3dba[_0x760d('0x1c')][_0x760d('0x20')]||null:null,'include':_0xbc3dba[_0x760d('0x1c')]?_0xbc3dba['options']['include']?_[_0x760d('0x21')](_0xbc3dba['options'][_0x760d('0x22')],function(_0xb66782){return{'model':db[_0xb66782[_0x760d('0x23')]],'as':_0xb66782['as'],'attributes':_0xb66782[_0x760d('0x1f')],'include':_0xb66782[_0x760d('0x22')]?_[_0x760d('0x21')](_0xb66782[_0x760d('0x22')],function(_0x3a5714){return{'model':db[_0x3a5714['model']],'as':_0x3a5714['as'],'attributes':_0x3a5714[_0x760d('0x1f')],'include':_0x3a5714[_0x760d('0x22')]?_[_0x760d('0x21')](_0x3a5714[_0x760d('0x22')],function(_0x562d4d){return{'model':db[_0x562d4d[_0x760d('0x23')]],'as':_0x562d4d['as'],'attributes':_0x562d4d[_0x760d('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3647ca){logger[_0x760d('0x24')](_0x760d('0x19'),_0xbc3dba);logger[_0x760d('0x12')](_0x760d('0x19'),_0xbc3dba,JSON[_0x760d('0x13')](_0x3647ca));_0x508584(_0x3647ca);})[_0x760d('0x18')](function(_0xa4ec3c){logger[_0x760d('0x14')](_0x760d('0x19'),_0xa4ec3c[_0x760d('0x16')],_0xbc3dba);_0x8b8e58(_0x35571a[_0x760d('0x14')](0x1f4,_0xa4ec3c[_0x760d('0x16')]));});});};exports[_0x760d('0x25')]=function(_0x3a5bc4){var _0x252de9=this;return new Promise(function(_0x9a7ed5,_0x152dc9){return db[_0x760d('0x1a')][_0x760d('0x26')]({'raw':_0x3a5bc4['options']?_0x3a5bc4['options'][_0x760d('0x1d')]===undefined?!![]:![]:!![],'where':_0x3a5bc4[_0x760d('0x1c')]?_0x3a5bc4[_0x760d('0x1c')][_0x760d('0x1e')]||null:null,'attributes':_0x3a5bc4[_0x760d('0x1c')]?_0x3a5bc4[_0x760d('0x1c')][_0x760d('0x1f')]||null:null,'include':_0x3a5bc4[_0x760d('0x1c')]?_0x3a5bc4[_0x760d('0x1c')][_0x760d('0x22')]?_[_0x760d('0x21')](_0x3a5bc4[_0x760d('0x1c')]['include'],function(_0x5103db){return{'model':db[_0x5103db[_0x760d('0x23')]],'as':_0x5103db['as'],'attributes':_0x5103db[_0x760d('0x1f')],'include':_0x5103db[_0x760d('0x22')]?_[_0x760d('0x21')](_0x5103db[_0x760d('0x22')],function(_0x3cff8f){return{'model':db[_0x3cff8f[_0x760d('0x23')]],'as':_0x3cff8f['as'],'attributes':_0x3cff8f['attributes'],'include':_0x3cff8f[_0x760d('0x22')]?_[_0x760d('0x21')](_0x3cff8f[_0x760d('0x22')],function(_0x2e80a7){return{'model':db[_0x2e80a7['model']],'as':_0x2e80a7['as'],'attributes':_0x2e80a7[_0x760d('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x760d('0xf')](function(_0x174e92){logger['info'](_0x760d('0x25'),_0x3a5bc4);logger[_0x760d('0x12')](_0x760d('0x25'),_0x3a5bc4,JSON[_0x760d('0x13')](_0x174e92));_0x9a7ed5(_0x174e92);})[_0x760d('0x18')](function(_0x2eba5a){logger[_0x760d('0x14')]('ShowFaxQueue',_0x2eba5a['message'],_0x3a5bc4);_0x152dc9(_0x252de9[_0x760d('0x14')](0x1f4,_0x2eba5a[_0x760d('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 0d6860d..df2eec4 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 _0x3f8f=['save','remove','removeListener','./faxQueue.events'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x3f8f,0x10b));var _0xf3f8=function(_0x3c0f5e,_0x4ffb27){_0x3c0f5e=_0x3c0f5e-0x0;var _0x18fc36=_0x3f8f[_0x3c0f5e];return _0x18fc36;};'use strict';var FaxQueueEvents=require(_0xf3f8('0x0'));var events=[_0xf3f8('0x1'),_0xf3f8('0x2'),'update'];function createListener(_0x433a45,_0x32114e){return function(_0x463cb2){_0x32114e['emit'](_0x433a45,_0x463cb2);};}function removeListener(_0x4cbe4c,_0x5121f0){return function(){FaxQueueEvents[_0xf3f8('0x3')](_0x4cbe4c,_0x5121f0);};}exports['register']=function(_0x3b41cd){for(var _0x3857b9=0x0,_0x526b29=events['length'];_0x3857b9<_0x526b29;_0x3857b9++){var _0x2cca9c=events[_0x3857b9];var _0x48bc18=createListener('faxQueue:'+_0x2cca9c,_0x3b41cd);FaxQueueEvents['on'](_0x2cca9c,_0x48bc18);}}; \ No newline at end of file +var _0x4de9=['length','faxQueue:','./faxQueue.events','save','remove','emit','removeListener','register'];(function(_0x33365f,_0x112711){var _0xa82a60=function(_0x54cc25){while(--_0x54cc25){_0x33365f['push'](_0x33365f['shift']());}};_0xa82a60(++_0x112711);}(_0x4de9,0x92));var _0x94de=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0x4de9[_0x17928f];return _0x500b63;};'use strict';var FaxQueueEvents=require(_0x94de('0x0'));var events=[_0x94de('0x1'),_0x94de('0x2'),'update'];function createListener(_0x2aaa30,_0x58b074){return function(_0x3c46f3){_0x58b074[_0x94de('0x3')](_0x2aaa30,_0x3c46f3);};}function removeListener(_0x1d95bd,_0xa72b21){return function(){FaxQueueEvents[_0x94de('0x4')](_0x1d95bd,_0xa72b21);};}exports[_0x94de('0x5')]=function(_0x2d5ec3){for(var _0x448e5d=0x0,_0x3a3339=events[_0x94de('0x6')];_0x448e5d<_0x3a3339;_0x448e5d++){var _0x113fa5=events[_0x448e5d];var _0x471cd0=createListener(_0x94de('0x7')+_0x113fa5,_0x2d5ec3);FaxQueueEvents['on'](_0x113fa5,_0x471cd0);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 10c1cf1..77cf06d 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 _0xc6e3=['connect-timeout','express','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','describe','/:id','isAuthenticated','show','/:id/members','/:id/teams','/:id/users','getAgents','post','create','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','path'];(function(_0x259636,_0x2e1004){var _0x5c012f=function(_0x4c9f78){while(--_0x4c9f78){_0x259636['push'](_0x259636['shift']());}};_0x5c012f(++_0x2e1004);}(_0xc6e3,0x80));var _0x3c6e=function(_0xfc0cee,_0x331e61){_0xfc0cee=_0xfc0cee-0x0;var _0x2bd232=_0xc6e3[_0xfc0cee];return _0x2bd232;};'use strict';var multer=require(_0x3c6e('0x0'));var util=require('util');var path=require(_0x3c6e('0x1'));var timeout=require(_0x3c6e('0x2'));var express=require(_0x3c6e('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x3c6e('0x4'));var config=require(_0x3c6e('0x5'));var controller=require(_0x3c6e('0x6'));router[_0x3c6e('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3c6e('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x3c6e('0x8')]);router[_0x3c6e('0x7')](_0x3c6e('0x9'),auth[_0x3c6e('0xa')](),controller[_0x3c6e('0xb')]);router[_0x3c6e('0x7')](_0x3c6e('0xc'),auth[_0x3c6e('0xa')](),controller['getMembers']);router[_0x3c6e('0x7')](_0x3c6e('0xd'),auth[_0x3c6e('0xa')](),controller['getTeams']);router[_0x3c6e('0x7')](_0x3c6e('0xe'),auth['isAuthenticated'](),controller[_0x3c6e('0xf')]);router[_0x3c6e('0x10')]('/',auth[_0x3c6e('0xa')](),controller[_0x3c6e('0x11')]);router['post'](_0x3c6e('0xd'),auth[_0x3c6e('0xa')](),controller['addTeams']);router[_0x3c6e('0x10')](_0x3c6e('0xe'),auth[_0x3c6e('0xa')](),controller[_0x3c6e('0x12')]);router[_0x3c6e('0x13')]('/:id',auth[_0x3c6e('0xa')](),controller[_0x3c6e('0x14')]);router[_0x3c6e('0x15')](_0x3c6e('0x9'),auth[_0x3c6e('0xa')](),controller[_0x3c6e('0x16')]);router[_0x3c6e('0x15')](_0x3c6e('0xd'),auth['isAuthenticated'](),controller[_0x3c6e('0x17')]);router[_0x3c6e('0x15')](_0x3c6e('0xe'),auth[_0x3c6e('0xa')](),controller[_0x3c6e('0x18')]);module[_0x3c6e('0x19')]=router; \ No newline at end of file +var _0x9483=['../../config/environment','./faxQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','/:id/teams','create','post','addTeams','addAgents','put','update','delete','removeTeams','/:id/users','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x496333,_0x1c47d6){var _0x44256e=function(_0x58767d){while(--_0x58767d){_0x496333['push'](_0x496333['shift']());}};_0x44256e(++_0x1c47d6);}(_0x9483,0x12e));var _0x3948=function(_0x134287,_0x5a67d6){_0x134287=_0x134287-0x0;var _0x3097d0=_0x9483[_0x134287];return _0x3097d0;};'use strict';var multer=require(_0x3948('0x0'));var util=require(_0x3948('0x1'));var path=require('path');var timeout=require(_0x3948('0x2'));var express=require(_0x3948('0x3'));var router=express[_0x3948('0x4')]();var auth=require(_0x3948('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3948('0x6'));var controller=require(_0x3948('0x7'));router['get']('/',auth[_0x3948('0x8')](),controller[_0x3948('0x9')]);router[_0x3948('0xa')](_0x3948('0xb'),auth[_0x3948('0x8')](),controller[_0x3948('0xc')]);router[_0x3948('0xa')](_0x3948('0xd'),auth[_0x3948('0x8')](),controller[_0x3948('0xe')]);router[_0x3948('0xa')](_0x3948('0xf'),auth[_0x3948('0x8')](),controller['getMembers']);router[_0x3948('0xa')](_0x3948('0x10'),auth['isAuthenticated'](),controller['getTeams']);router['get']('/:id/users',auth[_0x3948('0x8')](),controller['getAgents']);router['post']('/',auth[_0x3948('0x8')](),controller[_0x3948('0x11')]);router[_0x3948('0x12')](_0x3948('0x10'),auth[_0x3948('0x8')](),controller[_0x3948('0x13')]);router[_0x3948('0x12')]('/:id/users',auth[_0x3948('0x8')](),controller[_0x3948('0x14')]);router[_0x3948('0x15')](_0x3948('0xd'),auth[_0x3948('0x8')](),controller[_0x3948('0x16')]);router[_0x3948('0x17')]('/:id',auth[_0x3948('0x8')](),controller['destroy']);router[_0x3948('0x17')]('/:id/teams',auth['isAuthenticated'](),controller[_0x3948('0x18')]);router['delete'](_0x3948('0x19'),auth['isAuthenticated'](),controller[_0x3948('0x1a')]);module[_0x3948('0x1b')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index e0ff424..d9d10c7 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 _0x54f5=['moment','sequelize','STRING','DATE'];(function(_0x549278,_0x450754){var _0x1ea9a1=function(_0x2e559d){while(--_0x2e559d){_0x549278['push'](_0x549278['shift']());}};_0x1ea9a1(++_0x450754);}(_0x54f5,0x100));var _0x554f=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x54f5[_0x465028];return _0xb783d4;};'use strict';var moment=require(_0x554f('0x0'));var Sequelize=require(_0x554f('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x554f('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x554f('0x3')]},'leaveAt':{'type':Sequelize[_0x554f('0x3')]},'acceptAt':{'type':Sequelize[_0x554f('0x3')]},'exitAt':{'type':Sequelize[_0x554f('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb221=['DATE','sequelize','STRING'];(function(_0x20e603,_0x4c172a){var _0x5244e4=function(_0x162dd1){while(--_0x162dd1){_0x20e603['push'](_0x20e603['shift']());}};_0x5244e4(++_0x4c172a);}(_0xb221,0x1e1));var _0x1b22=function(_0x4cfa39,_0x2a332e){_0x4cfa39=_0x4cfa39-0x0;var _0x203217=_0xb221[_0x4cfa39];return _0x203217;};'use strict';var moment=require('moment');var Sequelize=require(_0x1b22('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x1b22('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x1b22('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x1b22('0x2')]},'reason':{'type':Sequelize[_0x1b22('0x1')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 45fc429..5ef8392 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 _0x9303=['map','type','key','VIRTUAL','field','options','includeAll','findAll','rows','catch','show','include','find','create','body','params','describe','html-pdf','zip-dir','request-promise','mustache','util','path','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','limit','apply','update','then','destroy','sendStatus','error','stack','name','index','FaxQueueReport','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge'];(function(_0x10f01d,_0x2c301c){var _0x4c3a30=function(_0x172d93){while(--_0x172d93){_0x10f01d['push'](_0x10f01d['shift']());}};_0x4c3a30(++_0x2c301c);}(_0x9303,0xd7));var _0x3930=function(_0x5c1b05,_0x213768){_0x5c1b05=_0x5c1b05-0x0;var _0x1a65e7=_0x9303[_0x5c1b05];return _0x1a65e7;};'use strict';var pdf=require(_0x3930('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3930('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3930('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3930('0x3'));var util=require(_0x3930('0x4'));var path=require(_0x3930('0x5'));var sox=require(_0x3930('0x6'));var csv=require('to-csv');var ejs=require(_0x3930('0x7'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3930('0x8'));var jsforce=require(_0x3930('0x9'));var deskjs=require(_0x3930('0xa'));var toCsv=require(_0x3930('0xb'));var querystring=require(_0x3930('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3930('0xd'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3930('0xe'));var utils=require(_0x3930('0xf'));var config=require(_0x3930('0x10'));var db=require(_0x3930('0x11'))['db'];function respondWithStatusCode(_0x161c1e,_0x568ca9){_0x568ca9=_0x568ca9||0xcc;return function(_0x13b928){if(_0x13b928){return _0x161c1e['sendStatus'](_0x568ca9);}return _0x161c1e[_0x3930('0x12')](_0x568ca9)[_0x3930('0x13')]();};}function respondWithResult(_0x5d44a1,_0x555cae){_0x555cae=_0x555cae||0xc8;return function(_0x11b256){if(_0x11b256){return _0x5d44a1[_0x3930('0x12')](_0x555cae)['json'](_0x11b256);}};}function respondWithFilteredResult(_0x457912,_0x44603d){return function(_0x3bc35e){if(_0x3bc35e){var _0x135498=_0x3bc35e['count'],_0x5db060=_0x44603d[_0x3930('0x14')],_0x55ec9b=_0x44603d['offset']+_0x44603d[_0x3930('0x15')],_0x3a2ac0;if(_0x55ec9b>=_0x135498){_0x55ec9b=_0x135498;_0x3a2ac0=0xc8;}else{_0x3a2ac0=0xce;}_0x457912[_0x3930('0x12')](_0x3a2ac0);return _0x457912['set']('Content-Range',_0x5db060+'-'+_0x55ec9b+'/'+_0x135498)['json'](_0x3bc35e);}return null;};}function patchUpdates(_0x1427f6){return function(_0x1462db){try{jsonpatch[_0x3930('0x16')](_0x1462db,_0x1427f6,!![]);}catch(_0x5b5f55){return BPromise['reject'](_0x5b5f55);}return _0x1462db['save']();};}function saveUpdates(_0x5a2501,_0x3400f5){return function(_0x2ba9ba){if(_0x2ba9ba){return _0x2ba9ba[_0x3930('0x17')](_0x5a2501)[_0x3930('0x18')](function(_0x3d2a2f){return _0x3d2a2f;});}return null;};}function removeEntity(_0x559c86,_0x1e19c3){return function(_0x315f73){if(_0x315f73){return _0x315f73[_0x3930('0x19')]()['then'](function(){_0x559c86[_0x3930('0x12')](0xcc)[_0x3930('0x13')]();});}};}function handleEntityNotFound(_0x12eeb7,_0x3a0e16){return function(_0x2bcc3b){if(!_0x2bcc3b){_0x12eeb7[_0x3930('0x1a')](0x194);}return _0x2bcc3b;};}function handleError(_0x347d7d,_0x14acf5){_0x14acf5=_0x14acf5||0x1f4;return function(_0x569cee){logger[_0x3930('0x1b')](_0x569cee[_0x3930('0x1c')]);if(_0x569cee[_0x3930('0x1d')]){delete _0x569cee[_0x3930('0x1d')];}_0x347d7d[_0x3930('0x12')](_0x14acf5)['send'](_0x569cee);};}exports[_0x3930('0x1e')]=function(_0x7b6825,_0x2489e6){var _0x5b20a7={},_0x2ec9b1={},_0x306d5b={'count':0x0,'rows':[]};var _0x699a54=db[_0x3930('0x1f')][_0x3930('0x20')];_0x2ec9b1['model']=_[_0x3930('0x21')](_0x699a54);_0x2ec9b1[_0x3930('0x22')]=_[_0x3930('0x21')](_0x7b6825['query']);_0x2ec9b1[_0x3930('0x23')]=_[_0x3930('0x24')](_0x2ec9b1[_0x3930('0x25')],_0x2ec9b1[_0x3930('0x22')]);_0x5b20a7[_0x3930('0x26')]=_[_0x3930('0x24')](_0x2ec9b1[_0x3930('0x25')],qs[_0x3930('0x27')](_0x7b6825[_0x3930('0x22')][_0x3930('0x27')]));_0x5b20a7[_0x3930('0x26')]=_0x5b20a7[_0x3930('0x26')][_0x3930('0x28')]?_0x5b20a7[_0x3930('0x26')]:_0x2ec9b1[_0x3930('0x25')];if(!_0x7b6825[_0x3930('0x22')][_0x3930('0x29')](_0x3930('0x2a'))){_0x5b20a7[_0x3930('0x15')]=qs[_0x3930('0x15')](_0x7b6825['query']['limit']);_0x5b20a7['offset']=qs[_0x3930('0x14')](_0x7b6825[_0x3930('0x22')]['offset']);}_0x5b20a7[_0x3930('0x2b')]=qs[_0x3930('0x2c')](_0x7b6825['query'][_0x3930('0x2c')]);_0x5b20a7['where']=qs[_0x3930('0x23')](_[_0x3930('0x2d')](_0x7b6825[_0x3930('0x22')],_0x2ec9b1[_0x3930('0x23')]));if(_0x7b6825[_0x3930('0x22')][_0x3930('0x2e')]){_0x5b20a7[_0x3930('0x2f')]=_[_0x3930('0x30')](_0x5b20a7[_0x3930('0x2f')],{'$or':_[_0x3930('0x31')](_0x699a54,function(_0x315091){if(_0x315091[_0x3930('0x32')][_0x3930('0x33')]!==_0x3930('0x34')){var _0x231fa1={};_0x231fa1[_0x315091[_0x3930('0x35')]]={'$like':'%'+_0x7b6825['query'][_0x3930('0x2e')]+'%'};return _0x231fa1;}})});}_0x5b20a7=_['merge']({},_0x5b20a7,_0x7b6825[_0x3930('0x36')]);var _0x4ae203={'where':_0x5b20a7[_0x3930('0x2f')]};return db['FaxQueueReport']['count'](_0x4ae203)[_0x3930('0x18')](function(_0x2c7c5b){_0x306d5b['count']=_0x2c7c5b;if(_0x7b6825['query'][_0x3930('0x37')]){_0x5b20a7['include']=[{'all':!![]}];}return db[_0x3930('0x1f')][_0x3930('0x38')](_0x5b20a7);})[_0x3930('0x18')](function(_0x3a8c7e){_0x306d5b[_0x3930('0x39')]=_0x3a8c7e;return _0x306d5b;})[_0x3930('0x18')](respondWithFilteredResult(_0x2489e6,_0x5b20a7))[_0x3930('0x3a')](handleError(_0x2489e6,null));};exports[_0x3930('0x3b')]=function(_0x4d6a5b,_0x55ebb8){var _0xc821be={'raw':!![],'where':{'id':_0x4d6a5b['params']['id']}},_0x4740f8={};_0x4740f8['model']=_[_0x3930('0x21')](db[_0x3930('0x1f')][_0x3930('0x20')]);_0x4740f8['query']=_['keys'](_0x4d6a5b[_0x3930('0x22')]);_0x4740f8[_0x3930('0x23')]=_[_0x3930('0x24')](_0x4740f8[_0x3930('0x25')],_0x4740f8['query']);_0xc821be['attributes']=_[_0x3930('0x24')](_0x4740f8['model'],qs[_0x3930('0x27')](_0x4d6a5b[_0x3930('0x22')]['fields']));_0xc821be[_0x3930('0x26')]=_0xc821be['attributes'][_0x3930('0x28')]?_0xc821be[_0x3930('0x26')]:_0x4740f8[_0x3930('0x25')];if(_0x4d6a5b[_0x3930('0x22')][_0x3930('0x37')]){_0xc821be[_0x3930('0x3c')]=[{'all':!![]}];}_0xc821be=_[_0x3930('0x30')]({},_0xc821be,_0x4d6a5b[_0x3930('0x36')]);return db[_0x3930('0x1f')][_0x3930('0x3d')](_0xc821be)[_0x3930('0x18')](handleEntityNotFound(_0x55ebb8,null))[_0x3930('0x18')](respondWithResult(_0x55ebb8,null))[_0x3930('0x3a')](handleError(_0x55ebb8,null));};exports[_0x3930('0x3e')]=function(_0x323c73,_0x5f3ad1){return db[_0x3930('0x1f')][_0x3930('0x3e')](_0x323c73[_0x3930('0x3f')],{})[_0x3930('0x18')](respondWithResult(_0x5f3ad1,0xc9))[_0x3930('0x3a')](handleError(_0x5f3ad1,null));};exports[_0x3930('0x17')]=function(_0x58ebb7,_0x465910){if(_0x58ebb7[_0x3930('0x3f')]['id']){delete _0x58ebb7[_0x3930('0x3f')]['id'];}return db[_0x3930('0x1f')]['find']({'where':{'id':_0x58ebb7[_0x3930('0x40')]['id']}})['then'](handleEntityNotFound(_0x465910,null))[_0x3930('0x18')](saveUpdates(_0x58ebb7['body'],null))['then'](respondWithResult(_0x465910,null))[_0x3930('0x3a')](handleError(_0x465910,null));};exports[_0x3930('0x19')]=function(_0x5cbb07,_0x2bdb26){return db[_0x3930('0x1f')][_0x3930('0x3d')]({'where':{'id':_0x5cbb07[_0x3930('0x40')]['id']}})['then'](handleEntityNotFound(_0x2bdb26,null))[_0x3930('0x18')](removeEntity(_0x2bdb26,null))[_0x3930('0x3a')](handleError(_0x2bdb26,null));};exports[_0x3930('0x41')]=function(_0x6a4764,_0x5f34fb){return db[_0x3930('0x1f')][_0x3930('0x41')]()[_0x3930('0x18')](respondWithResult(_0x5f34fb,null))[_0x3930('0x3a')](handleError(_0x5f34fb,null));}; \ No newline at end of file +var _0x46e1=['stack','name','index','FaxQueueReport','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','update','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error'];(function(_0x1659da,_0x2d68f6){var _0x2794d3=function(_0x3adbc1){while(--_0x3adbc1){_0x1659da['push'](_0x1659da['shift']());}};_0x2794d3(++_0x2d68f6);}(_0x46e1,0x155));var _0x146e=function(_0x499397,_0x25065b){_0x499397=_0x499397-0x0;var _0x1a0126=_0x46e1[_0x499397];return _0x1a0126;};'use strict';var pdf=require(_0x146e('0x0'));var emlformat=require(_0x146e('0x1'));var rimraf=require(_0x146e('0x2'));var zipdir=require(_0x146e('0x3'));var jsonpatch=require(_0x146e('0x4'));var rp=require(_0x146e('0x5'));var moment=require(_0x146e('0x6'));var BPromise=require(_0x146e('0x7'));var Mustache=require(_0x146e('0x8'));var util=require(_0x146e('0x9'));var path=require('path');var sox=require(_0x146e('0xa'));var csv=require(_0x146e('0xb'));var ejs=require(_0x146e('0xc'));var fs=require('fs');var _=require(_0x146e('0xd'));var squel=require(_0x146e('0xe'));var crypto=require(_0x146e('0xf'));var jsforce=require(_0x146e('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x146e('0xb'));var querystring=require('querystring');var Papa=require(_0x146e('0x11'));var Redis=require(_0x146e('0x12'));var authService=require(_0x146e('0x13'));var qs=require(_0x146e('0x14'));var hardwareService=require(_0x146e('0x15'));var logger=require(_0x146e('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x146e('0x17'));var db=require(_0x146e('0x18'))['db'];function respondWithStatusCode(_0x29d111,_0x1a567a){_0x1a567a=_0x1a567a||0xcc;return function(_0x29400a){if(_0x29400a){return _0x29d111[_0x146e('0x19')](_0x1a567a);}return _0x29d111[_0x146e('0x1a')](_0x1a567a)[_0x146e('0x1b')]();};}function respondWithResult(_0x524209,_0x59c066){_0x59c066=_0x59c066||0xc8;return function(_0x2b925a){if(_0x2b925a){return _0x524209[_0x146e('0x1a')](_0x59c066)[_0x146e('0x1c')](_0x2b925a);}};}function respondWithFilteredResult(_0x547342,_0x445b8c){return function(_0x21c564){if(_0x21c564){var _0x469b94=_0x21c564[_0x146e('0x1d')],_0x1130d0=_0x445b8c['offset'],_0x44c82f=_0x445b8c[_0x146e('0x1e')]+_0x445b8c[_0x146e('0x1f')],_0xe3699;if(_0x44c82f>=_0x469b94){_0x44c82f=_0x469b94;_0xe3699=0xc8;}else{_0xe3699=0xce;}_0x547342[_0x146e('0x1a')](_0xe3699);return _0x547342[_0x146e('0x20')](_0x146e('0x21'),_0x1130d0+'-'+_0x44c82f+'/'+_0x469b94)[_0x146e('0x1c')](_0x21c564);}return null;};}function patchUpdates(_0x256db5){return function(_0x4fc704){try{jsonpatch[_0x146e('0x22')](_0x4fc704,_0x256db5,!![]);}catch(_0x499657){return BPromise[_0x146e('0x23')](_0x499657);}return _0x4fc704[_0x146e('0x24')]();};}function saveUpdates(_0x387323,_0x48596a){return function(_0x45ff0c){if(_0x45ff0c){return _0x45ff0c['update'](_0x387323)[_0x146e('0x25')](function(_0x51004c){return _0x51004c;});}return null;};}function removeEntity(_0x3df09c,_0x474475){return function(_0x5584c1){if(_0x5584c1){return _0x5584c1['destroy']()['then'](function(){_0x3df09c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x47c5f6,_0x8df5dd){return function(_0x504016){if(!_0x504016){_0x47c5f6[_0x146e('0x19')](0x194);}return _0x504016;};}function handleError(_0x2b391c,_0xc39f4d){_0xc39f4d=_0xc39f4d||0x1f4;return function(_0x37e774){logger[_0x146e('0x26')](_0x37e774[_0x146e('0x27')]);if(_0x37e774[_0x146e('0x28')]){delete _0x37e774['name'];}_0x2b391c[_0x146e('0x1a')](_0xc39f4d)['send'](_0x37e774);};}exports[_0x146e('0x29')]=function(_0x4afb82,_0x53250d){var _0x6442f3={},_0x486c6a={},_0x402faf={'count':0x0,'rows':[]};var _0x43e3b5=db[_0x146e('0x2a')][_0x146e('0x2b')];_0x486c6a[_0x146e('0x2c')]=_['keys'](_0x43e3b5);_0x486c6a[_0x146e('0x2d')]=_[_0x146e('0x2e')](_0x4afb82[_0x146e('0x2d')]);_0x486c6a[_0x146e('0x2f')]=_[_0x146e('0x30')](_0x486c6a[_0x146e('0x2c')],_0x486c6a[_0x146e('0x2d')]);_0x6442f3[_0x146e('0x31')]=_['intersection'](_0x486c6a['model'],qs[_0x146e('0x32')](_0x4afb82['query'][_0x146e('0x32')]));_0x6442f3['attributes']=_0x6442f3['attributes'][_0x146e('0x33')]?_0x6442f3[_0x146e('0x31')]:_0x486c6a[_0x146e('0x2c')];if(!_0x4afb82[_0x146e('0x2d')][_0x146e('0x34')](_0x146e('0x35'))){_0x6442f3['limit']=qs[_0x146e('0x1f')](_0x4afb82['query'][_0x146e('0x1f')]);_0x6442f3['offset']=qs[_0x146e('0x1e')](_0x4afb82[_0x146e('0x2d')][_0x146e('0x1e')]);}_0x6442f3['order']=qs[_0x146e('0x36')](_0x4afb82[_0x146e('0x2d')]['sort']);_0x6442f3[_0x146e('0x37')]=qs[_0x146e('0x2f')](_[_0x146e('0x38')](_0x4afb82[_0x146e('0x2d')],_0x486c6a[_0x146e('0x2f')]));if(_0x4afb82[_0x146e('0x2d')][_0x146e('0x39')]){_0x6442f3['where']=_['merge'](_0x6442f3[_0x146e('0x37')],{'$or':_[_0x146e('0x3a')](_0x43e3b5,function(_0x795ee1){if(_0x795ee1[_0x146e('0x3b')][_0x146e('0x3c')]!==_0x146e('0x3d')){var _0x5afc85={};_0x5afc85[_0x795ee1[_0x146e('0x3e')]]={'$like':'%'+_0x4afb82['query'][_0x146e('0x39')]+'%'};return _0x5afc85;}})});}_0x6442f3=_[_0x146e('0x3f')]({},_0x6442f3,_0x4afb82[_0x146e('0x40')]);var _0x39c5c1={'where':_0x6442f3[_0x146e('0x37')]};return db[_0x146e('0x2a')]['count'](_0x39c5c1)['then'](function(_0x514b9a){_0x402faf['count']=_0x514b9a;if(_0x4afb82[_0x146e('0x2d')][_0x146e('0x41')]){_0x6442f3[_0x146e('0x42')]=[{'all':!![]}];}return db[_0x146e('0x2a')][_0x146e('0x43')](_0x6442f3);})[_0x146e('0x25')](function(_0x341a3a){_0x402faf[_0x146e('0x44')]=_0x341a3a;return _0x402faf;})[_0x146e('0x25')](respondWithFilteredResult(_0x53250d,_0x6442f3))[_0x146e('0x45')](handleError(_0x53250d,null));};exports['show']=function(_0x393d96,_0x1c5cc7){var _0x37a28e={'raw':!![],'where':{'id':_0x393d96[_0x146e('0x46')]['id']}},_0x416db5={};_0x416db5['model']=_[_0x146e('0x2e')](db[_0x146e('0x2a')][_0x146e('0x2b')]);_0x416db5[_0x146e('0x2d')]=_[_0x146e('0x2e')](_0x393d96[_0x146e('0x2d')]);_0x416db5['filters']=_[_0x146e('0x30')](_0x416db5[_0x146e('0x2c')],_0x416db5[_0x146e('0x2d')]);_0x37a28e['attributes']=_[_0x146e('0x30')](_0x416db5[_0x146e('0x2c')],qs['fields'](_0x393d96['query']['fields']));_0x37a28e[_0x146e('0x31')]=_0x37a28e[_0x146e('0x31')][_0x146e('0x33')]?_0x37a28e[_0x146e('0x31')]:_0x416db5['model'];if(_0x393d96[_0x146e('0x2d')][_0x146e('0x41')]){_0x37a28e[_0x146e('0x42')]=[{'all':!![]}];}_0x37a28e=_[_0x146e('0x3f')]({},_0x37a28e,_0x393d96[_0x146e('0x40')]);return db['FaxQueueReport'][_0x146e('0x47')](_0x37a28e)['then'](handleEntityNotFound(_0x1c5cc7,null))[_0x146e('0x25')](respondWithResult(_0x1c5cc7,null))[_0x146e('0x45')](handleError(_0x1c5cc7,null));};exports[_0x146e('0x48')]=function(_0x267292,_0x483cf3){return db[_0x146e('0x2a')]['create'](_0x267292[_0x146e('0x49')],{})[_0x146e('0x25')](respondWithResult(_0x483cf3,0xc9))[_0x146e('0x45')](handleError(_0x483cf3,null));};exports[_0x146e('0x4a')]=function(_0x18a443,_0x295b80){if(_0x18a443['body']['id']){delete _0x18a443[_0x146e('0x49')]['id'];}return db[_0x146e('0x2a')]['find']({'where':{'id':_0x18a443[_0x146e('0x46')]['id']}})[_0x146e('0x25')](handleEntityNotFound(_0x295b80,null))[_0x146e('0x25')](saveUpdates(_0x18a443[_0x146e('0x49')],null))[_0x146e('0x25')](respondWithResult(_0x295b80,null))[_0x146e('0x45')](handleError(_0x295b80,null));};exports['destroy']=function(_0x178161,_0x2d0c8b){return db[_0x146e('0x2a')][_0x146e('0x47')]({'where':{'id':_0x178161[_0x146e('0x46')]['id']}})[_0x146e('0x25')](handleEntityNotFound(_0x2d0c8b,null))[_0x146e('0x25')](removeEntity(_0x2d0c8b,null))[_0x146e('0x45')](handleError(_0x2d0c8b,null));};exports['describe']=function(_0x273f51,_0x3f2235){return db['FaxQueueReport'][_0x146e('0x4b')]()[_0x146e('0x25')](respondWithResult(_0x3f2235,null))[_0x146e('0x45')](handleError(_0x3f2235,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index b0970d7..6cc2b9f 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 _0x74ba=['moment','bluebird','path','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','uniqueid','lodash','../../config/logger','api'];(function(_0x2ebd68,_0x10e9cc){var _0x2e68d5=function(_0x57b080){while(--_0x57b080){_0x2ebd68['push'](_0x2ebd68['shift']());}};_0x2e68d5(++_0x10e9cc);}(_0x74ba,0x11d));var _0xa74b=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x74ba[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xa74b('0x0'));var util=require('util');var logger=require(_0xa74b('0x1'))(_0xa74b('0x2'));var moment=require(_0xa74b('0x3'));var BPromise=require(_0xa74b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa74b('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa74b('0x6'));module[_0xa74b('0x7')]=function(_0xf07e3,_0x47c7a1){return _0xf07e3[_0xa74b('0x8')](_0xa74b('0x9'),attributes,{'tableName':_0xa74b('0xa'),'paranoid':![],'indexes':[{'name':_0xa74b('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x43f7=['bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue','uniqueid','lodash','util','api','moment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x43f7,0x1dd));var _0x743f=function(_0x5e9249,_0x25df3d){_0x5e9249=_0x5e9249-0x0;var _0x40f10d=_0x43f7[_0x5e9249];return _0x40f10d;};'use strict';var _=require(_0x743f('0x0'));var util=require(_0x743f('0x1'));var logger=require('../../config/logger')(_0x743f('0x2'));var moment=require(_0x743f('0x3'));var BPromise=require(_0x743f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x743f('0x5'));var rimraf=require(_0x743f('0x6'));var config=require(_0x743f('0x7'));var attributes=require(_0x743f('0x8'));module[_0x743f('0x9')]=function(_0x449eb8,_0xd38c7d){return _0x449eb8['define'](_0x743f('0xa'),attributes,{'tableName':_0x743f('0xb'),'paranoid':![],'indexes':[{'name':_0x743f('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 d68aa9e..ac27ffd 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 _0xb03e=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','FaxQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','then','UpdateFaxQueueReport','update','raw','where','util','moment','bluebird','randomstring'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0xb03e,0x1eb));var _0xeb03=function(_0x15edd3,_0xc0e331){_0x15edd3=_0x15edd3-0x0;var _0x4778c6=_0xb03e[_0x15edd3];return _0x4778c6;};'use strict';var _=require('lodash');var util=require(_0xeb03('0x0'));var moment=require(_0xeb03('0x1'));var BPromise=require(_0xeb03('0x2'));var rs=require(_0xeb03('0x3'));var fs=require('fs');var Redis=require(_0xeb03('0x4'));var db=require(_0xeb03('0x5'))['db'];var utils=require(_0xeb03('0x6'));var logger=require(_0xeb03('0x7'))(_0xeb03('0x8'));var config=require(_0xeb03('0x9'));var jayson=require(_0xeb03('0xa'));var client=jayson[_0xeb03('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b58a2,_0x3d3322,_0x3a6e31){return new BPromise(function(_0x246c6e,_0x3f2c74){return client[_0xeb03('0xc')](_0x3b58a2,_0x3a6e31)['then'](function(_0x403b77){logger[_0xeb03('0xd')](_0xeb03('0xe'),_0x3d3322,'request\x20sent');logger[_0xeb03('0xf')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x3d3322,_0xeb03('0x10'),JSON[_0xeb03('0x11')](_0x403b77));if(_0x403b77[_0xeb03('0x12')]){if(_0x403b77[_0xeb03('0x12')][_0xeb03('0x13')]===0x1f4){logger[_0xeb03('0x12')](_0xeb03('0xe'),_0x3d3322,_0x403b77[_0xeb03('0x12')][_0xeb03('0x14')]);return _0x3f2c74(_0x403b77[_0xeb03('0x12')][_0xeb03('0x14')]);}logger[_0xeb03('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0x3d3322,_0x403b77[_0xeb03('0x12')][_0xeb03('0x14')]);return _0x246c6e(_0x403b77[_0xeb03('0x12')][_0xeb03('0x14')]);}else{logger['info'](_0xeb03('0xe'),_0x3d3322,_0xeb03('0x10'));_0x246c6e(_0x403b77[_0xeb03('0x15')]['message']);}})[_0xeb03('0x16')](function(_0x46dd1b){logger[_0xeb03('0x12')](_0xeb03('0xe'),_0x3d3322,_0x46dd1b);_0x3f2c74(_0x46dd1b);});});}exports[_0xeb03('0x17')]=function(_0x1b4cbd){var _0x167a33=this;return new Promise(function(_0x8d6725,_0x177f9c){return db[_0xeb03('0x18')][_0xeb03('0x19')](_0x1b4cbd[_0xeb03('0x1a')],{'raw':_0x1b4cbd[_0xeb03('0x1b')]?_0x1b4cbd[_0xeb03('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xeb03('0x1c')](function(_0x3855dd){logger[_0xeb03('0xd')](_0xeb03('0x17'),_0x1b4cbd);logger[_0xeb03('0xf')](_0xeb03('0x17'),_0x1b4cbd,JSON[_0xeb03('0x11')](_0x3855dd));_0x8d6725(_0x3855dd);})[_0xeb03('0x16')](function(_0x3c3d09){logger['error'](_0xeb03('0x17'),_0x3c3d09[_0xeb03('0x14')],_0x1b4cbd);_0x177f9c(_0x167a33[_0xeb03('0x12')](0x1f4,_0x3c3d09[_0xeb03('0x14')]));});});};exports[_0xeb03('0x1d')]=function(_0x5dcda3){var _0x638353=this;return new Promise(function(_0x406864,_0x16cd4){return db[_0xeb03('0x18')][_0xeb03('0x1e')](_0x5dcda3[_0xeb03('0x1a')],{'raw':_0x5dcda3[_0xeb03('0x1b')]?_0x5dcda3[_0xeb03('0x1b')][_0xeb03('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5dcda3['options']?_0x5dcda3[_0xeb03('0x1b')][_0xeb03('0x20')]||null:null,'attributes':_0x5dcda3[_0xeb03('0x1b')]?_0x5dcda3[_0xeb03('0x1b')]['attributes']||null:null,'limit':_0x5dcda3['options']?_0x5dcda3[_0xeb03('0x1b')]['limit']||null:null})[_0xeb03('0x1c')](function(_0x8bd544){logger[_0xeb03('0xd')]('UpdateFaxQueueReport',_0x5dcda3);logger[_0xeb03('0xf')]('UpdateFaxQueueReport',_0x5dcda3,JSON['stringify'](_0x8bd544));_0x406864(_0x8bd544);})['catch'](function(_0x538d19){logger[_0xeb03('0x12')](_0xeb03('0x1d'),_0x538d19['message'],_0x5dcda3);_0x16cd4(_0x638353['error'](0x1f4,_0x538d19['message']));});});}; \ No newline at end of file +var _0x7d80=['error','code','message','result','catch','FaxQueueReport','create','body','options','CreateFaxQueueReport','UpdateFaxQueueReport','update','raw','where','attributes','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3cae69,_0x233c38){var _0x3128eb=function(_0x21d64e){while(--_0x21d64e){_0x3cae69['push'](_0x3cae69['shift']());}};_0x3128eb(++_0x233c38);}(_0x7d80,0x17a));var _0x07d8=function(_0xb0a1c1,_0x5d5a74){_0xb0a1c1=_0xb0a1c1-0x0;var _0x2be181=_0x7d80[_0xb0a1c1];return _0x2be181;};'use strict';var _=require('lodash');var util=require(_0x07d8('0x0'));var moment=require(_0x07d8('0x1'));var BPromise=require(_0x07d8('0x2'));var rs=require(_0x07d8('0x3'));var fs=require('fs');var Redis=require(_0x07d8('0x4'));var db=require(_0x07d8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x07d8('0x6'))('rpc');var config=require(_0x07d8('0x7'));var jayson=require(_0x07d8('0x8'));var client=jayson[_0x07d8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e9c64,_0x1be62a,_0x4b1625){return new BPromise(function(_0x52c68d,_0x510267){return client[_0x07d8('0xa')](_0x5e9c64,_0x4b1625)[_0x07d8('0xb')](function(_0x52a662){logger[_0x07d8('0xc')](_0x07d8('0xd'),_0x1be62a,_0x07d8('0xe'));logger[_0x07d8('0xf')](_0x07d8('0x10'),_0x1be62a,_0x07d8('0xe'),JSON[_0x07d8('0x11')](_0x52a662));if(_0x52a662['error']){if(_0x52a662[_0x07d8('0x12')][_0x07d8('0x13')]===0x1f4){logger[_0x07d8('0x12')](_0x07d8('0xd'),_0x1be62a,_0x52a662[_0x07d8('0x12')][_0x07d8('0x14')]);return _0x510267(_0x52a662[_0x07d8('0x12')]['message']);}logger[_0x07d8('0x12')](_0x07d8('0xd'),_0x1be62a,_0x52a662[_0x07d8('0x12')][_0x07d8('0x14')]);return _0x52c68d(_0x52a662[_0x07d8('0x12')][_0x07d8('0x14')]);}else{logger['info'](_0x07d8('0xd'),_0x1be62a,_0x07d8('0xe'));_0x52c68d(_0x52a662[_0x07d8('0x15')][_0x07d8('0x14')]);}})[_0x07d8('0x16')](function(_0x4ea297){logger[_0x07d8('0x12')](_0x07d8('0xd'),_0x1be62a,_0x4ea297);_0x510267(_0x4ea297);});});}exports['CreateFaxQueueReport']=function(_0x7fa5f3){var _0x12b890=this;return new Promise(function(_0x27eb23,_0x1f5b69){return db[_0x07d8('0x17')][_0x07d8('0x18')](_0x7fa5f3[_0x07d8('0x19')],{'raw':_0x7fa5f3[_0x07d8('0x1a')]?_0x7fa5f3['options']['raw']===undefined?!![]:![]:!![]})[_0x07d8('0xb')](function(_0x4fcc4d){logger['info'](_0x07d8('0x1b'),_0x7fa5f3);logger[_0x07d8('0xf')]('CreateFaxQueueReport',_0x7fa5f3,JSON[_0x07d8('0x11')](_0x4fcc4d));_0x27eb23(_0x4fcc4d);})[_0x07d8('0x16')](function(_0x40a095){logger[_0x07d8('0x12')]('CreateFaxQueueReport',_0x40a095[_0x07d8('0x14')],_0x7fa5f3);_0x1f5b69(_0x12b890[_0x07d8('0x12')](0x1f4,_0x40a095['message']));});});};exports[_0x07d8('0x1c')]=function(_0x208bad){var _0xb72775=this;return new Promise(function(_0x68e2fe,_0x53f551){return db['FaxQueueReport'][_0x07d8('0x1d')](_0x208bad['body'],{'raw':_0x208bad['options']?_0x208bad[_0x07d8('0x1a')][_0x07d8('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x208bad[_0x07d8('0x1a')]?_0x208bad[_0x07d8('0x1a')][_0x07d8('0x1f')]||null:null,'attributes':_0x208bad['options']?_0x208bad[_0x07d8('0x1a')][_0x07d8('0x20')]||null:null,'limit':_0x208bad[_0x07d8('0x1a')]?_0x208bad['options']['limit']||null:null})[_0x07d8('0xb')](function(_0x38fd1e){logger[_0x07d8('0xc')](_0x07d8('0x1c'),_0x208bad);logger[_0x07d8('0xf')]('UpdateFaxQueueReport',_0x208bad,JSON[_0x07d8('0x11')](_0x38fd1e));_0x68e2fe(_0x38fd1e);})[_0x07d8('0x16')](function(_0x338639){logger[_0x07d8('0x12')](_0x07d8('0x1c'),_0x338639[_0x07d8('0x14')],_0x208bad);_0x53f551(_0xb72775[_0x07d8('0x12')](0x1f4,_0x338639[_0x07d8('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 27b02f5..89e5c0f 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 _0xe765=['index','describe','/:id','show','post','put','delete','destroy','exports','multer','util','Router','../../components/interaction/service','./faxQueueReport.controller','get','isAuthenticated'];(function(_0x42c214,_0x1de14e){var _0x24789f=function(_0x4bc8df){while(--_0x4bc8df){_0x42c214['push'](_0x42c214['shift']());}};_0x24789f(++_0x1de14e);}(_0xe765,0x189));var _0x5e76=function(_0x98e0ca,_0x8ae323){_0x98e0ca=_0x98e0ca-0x0;var _0x1c0f82=_0xe765[_0x98e0ca];return _0x1c0f82;};'use strict';var multer=require(_0x5e76('0x0'));var util=require(_0x5e76('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5e76('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x5e76('0x3'));var config=require('../../config/environment');var controller=require(_0x5e76('0x4'));router[_0x5e76('0x5')]('/',auth[_0x5e76('0x6')](),controller[_0x5e76('0x7')]);router[_0x5e76('0x5')]('/describe',auth[_0x5e76('0x6')](),controller[_0x5e76('0x8')]);router[_0x5e76('0x5')](_0x5e76('0x9'),auth[_0x5e76('0x6')](),controller[_0x5e76('0xa')]);router[_0x5e76('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5e76('0xc')](_0x5e76('0x9'),auth[_0x5e76('0x6')](),controller['update']);router[_0x5e76('0xd')](_0x5e76('0x9'),auth[_0x5e76('0x6')](),controller[_0x5e76('0xe')]);module[_0x5e76('0xf')]=router; \ No newline at end of file +var _0x1aab=['create','put','update','delete','destroy','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','post'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x1aab,0x126));var _0xb1aa=function(_0x10aa24,_0x1143c0){_0x10aa24=_0x10aa24-0x0;var _0x38a859=_0x1aab[_0x10aa24];return _0x38a859;};'use strict';var multer=require(_0xb1aa('0x0'));var util=require('util');var path=require(_0xb1aa('0x1'));var timeout=require(_0xb1aa('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xb1aa('0x3'));var interaction=require(_0xb1aa('0x4'));var config=require(_0xb1aa('0x5'));var controller=require('./faxQueueReport.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xb1aa('0x6')](_0xb1aa('0x7'),auth[_0xb1aa('0x8')](),controller[_0xb1aa('0x9')]);router[_0xb1aa('0x6')](_0xb1aa('0xa'),auth[_0xb1aa('0x8')](),controller['show']);router[_0xb1aa('0xb')]('/',auth['isAuthenticated'](),controller[_0xb1aa('0xc')]);router[_0xb1aa('0xd')]('/:id',auth[_0xb1aa('0x8')](),controller[_0xb1aa('0xe')]);router[_0xb1aa('0xf')](_0xb1aa('0xa'),auth['isAuthenticated'](),controller[_0xb1aa('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 879bf1d..e5d73eb 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 _0xcd0b=['account','queue','DATE','NOW','moment','sequelize','exports','STRING','ENUM'];(function(_0x32cf0e,_0x2128a9){var _0x3d6d74=function(_0x58adcf){while(--_0x58adcf){_0x32cf0e['push'](_0x32cf0e['shift']());}};_0x3d6d74(++_0x2128a9);}(_0xcd0b,0x1f3));var _0xbcd0=function(_0x496e1a,_0x32aaf0){_0x496e1a=_0x496e1a-0x0;var _0x3a01d9=_0xcd0b[_0x496e1a];return _0x3a01d9;};'use strict';var moment=require(_0xbcd0('0x0'));var Sequelize=require(_0xbcd0('0x1'));module[_0xbcd0('0x2')]={'uniqueid':{'type':Sequelize[_0xbcd0('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xbcd0('0x4')](_0xbcd0('0x5'),'agent',_0xbcd0('0x6')),'allowNull':![],'defaultValue':_0xbcd0('0x6')},'transferredAt':{'type':Sequelize[_0xbcd0('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xbcd0('0x8')]}}; \ No newline at end of file +var _0x5215=['agent','queue','DATE','NOW','moment','sequelize','exports','STRING','ENUM'];(function(_0x1931b2,_0x1c69d4){var _0x5ae448=function(_0x4d6d5e){while(--_0x4d6d5e){_0x1931b2['push'](_0x1931b2['shift']());}};_0x5ae448(++_0x1c69d4);}(_0x5215,0xaf));var _0x5521=function(_0x423549,_0x242e63){_0x423549=_0x423549-0x0;var _0xdcb104=_0x5215[_0x423549];return _0xdcb104;};'use strict';var moment=require(_0x5521('0x0'));var Sequelize=require(_0x5521('0x1'));module[_0x5521('0x2')]={'uniqueid':{'type':Sequelize[_0x5521('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x5521('0x4')]('account',_0x5521('0x5'),_0x5521('0x6')),'allowNull':![],'defaultValue':_0x5521('0x6')},'transferredAt':{'type':Sequelize[_0x5521('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x5521('0x8')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 653b495..6ce54c2 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 _0xbb95=['lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','reject','save','update','then','destroy','error','stack','name','send','index','FaxTransferReport','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','order','sort','where','filter','merge','type','key','VIRTUAL','field','options','includeAll','findAll','catch','show','params','rawAttributes','find','create','body','describe','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','sox','to-csv'];(function(_0x561173,_0x12477c){var _0x3b16d4=function(_0x1b6ac6){while(--_0x1b6ac6){_0x561173['push'](_0x561173['shift']());}};_0x3b16d4(++_0x12477c);}(_0xbb95,0x7f));var _0x5bb9=function(_0x482af3,_0xf39f41){_0x482af3=_0x482af3-0x0;var _0x7cecfb=_0xbb95[_0x482af3];return _0x7cecfb;};'use strict';var pdf=require(_0x5bb9('0x0'));var emlformat=require(_0x5bb9('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5bb9('0x2'));var rp=require(_0x5bb9('0x3'));var moment=require('moment');var BPromise=require(_0x5bb9('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x5bb9('0x5'));var csv=require(_0x5bb9('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5bb9('0x7'));var squel=require(_0x5bb9('0x8'));var crypto=require(_0x5bb9('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x5bb9('0xa'));var toCsv=require(_0x5bb9('0x6'));var querystring=require(_0x5bb9('0xb'));var Papa=require(_0x5bb9('0xc'));var Redis=require(_0x5bb9('0xd'));var authService=require(_0x5bb9('0xe'));var qs=require(_0x5bb9('0xf'));var hardwareService=require(_0x5bb9('0x10'));var logger=require(_0x5bb9('0x11'))(_0x5bb9('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x5bb9('0x13'))['db'];function respondWithStatusCode(_0x3e300c,_0xd275){_0xd275=_0xd275||0xcc;return function(_0x1ce0d4){if(_0x1ce0d4){return _0x3e300c[_0x5bb9('0x14')](_0xd275);}return _0x3e300c[_0x5bb9('0x15')](_0xd275)[_0x5bb9('0x16')]();};}function respondWithResult(_0x497355,_0x4b553d){_0x4b553d=_0x4b553d||0xc8;return function(_0x41eb45){if(_0x41eb45){return _0x497355[_0x5bb9('0x15')](_0x4b553d)[_0x5bb9('0x17')](_0x41eb45);}};}function respondWithFilteredResult(_0x59b4a4,_0x4723ff){return function(_0x1a382f){if(_0x1a382f){var _0x582492=_0x1a382f[_0x5bb9('0x18')],_0x1ae28a=_0x4723ff[_0x5bb9('0x19')],_0x29b45c=_0x4723ff[_0x5bb9('0x19')]+_0x4723ff[_0x5bb9('0x1a')],_0xc4c1be;if(_0x29b45c>=_0x582492){_0x29b45c=_0x582492;_0xc4c1be=0xc8;}else{_0xc4c1be=0xce;}_0x59b4a4['status'](_0xc4c1be);return _0x59b4a4[_0x5bb9('0x1b')]('Content-Range',_0x1ae28a+'-'+_0x29b45c+'/'+_0x582492)[_0x5bb9('0x17')](_0x1a382f);}return null;};}function patchUpdates(_0x54dcd4){return function(_0x155259){try{jsonpatch['apply'](_0x155259,_0x54dcd4,!![]);}catch(_0x35ccab){return BPromise[_0x5bb9('0x1c')](_0x35ccab);}return _0x155259[_0x5bb9('0x1d')]();};}function saveUpdates(_0x2d5c74,_0x19f0b3){return function(_0x2c9b5e){if(_0x2c9b5e){return _0x2c9b5e[_0x5bb9('0x1e')](_0x2d5c74)[_0x5bb9('0x1f')](function(_0xda0a2e){return _0xda0a2e;});}return null;};}function removeEntity(_0x480cc2,_0xa5045c){return function(_0x51fa3a){if(_0x51fa3a){return _0x51fa3a[_0x5bb9('0x20')]()[_0x5bb9('0x1f')](function(){_0x480cc2['status'](0xcc)[_0x5bb9('0x16')]();});}};}function handleEntityNotFound(_0x46da2e,_0x4cd950){return function(_0x1fb206){if(!_0x1fb206){_0x46da2e['sendStatus'](0x194);}return _0x1fb206;};}function handleError(_0x2de62c,_0x4db9ae){_0x4db9ae=_0x4db9ae||0x1f4;return function(_0x4909ea){logger[_0x5bb9('0x21')](_0x4909ea[_0x5bb9('0x22')]);if(_0x4909ea[_0x5bb9('0x23')]){delete _0x4909ea[_0x5bb9('0x23')];}_0x2de62c[_0x5bb9('0x15')](_0x4db9ae)[_0x5bb9('0x24')](_0x4909ea);};}exports[_0x5bb9('0x25')]=function(_0x4da56f,_0x1b133a){var _0x362410={},_0x478843={},_0x1e9450={'count':0x0,'rows':[]};var _0x2db475=db[_0x5bb9('0x26')]['rawAttributes'];_0x478843['model']=_[_0x5bb9('0x27')](_0x2db475);_0x478843[_0x5bb9('0x28')]=_['keys'](_0x4da56f[_0x5bb9('0x28')]);_0x478843[_0x5bb9('0x29')]=_[_0x5bb9('0x2a')](_0x478843[_0x5bb9('0x2b')],_0x478843['query']);_0x362410['attributes']=_['intersection'](_0x478843['model'],qs['fields'](_0x4da56f[_0x5bb9('0x28')][_0x5bb9('0x2c')]));_0x362410[_0x5bb9('0x2d')]=_0x362410[_0x5bb9('0x2d')]['length']?_0x362410[_0x5bb9('0x2d')]:_0x478843[_0x5bb9('0x2b')];if(!_0x4da56f['query'][_0x5bb9('0x2e')]('nolimit')){_0x362410['limit']=qs[_0x5bb9('0x1a')](_0x4da56f[_0x5bb9('0x28')]['limit']);_0x362410['offset']=qs['offset'](_0x4da56f[_0x5bb9('0x28')][_0x5bb9('0x19')]);}_0x362410[_0x5bb9('0x2f')]=qs[_0x5bb9('0x30')](_0x4da56f[_0x5bb9('0x28')]['sort']);_0x362410[_0x5bb9('0x31')]=qs[_0x5bb9('0x29')](_['pick'](_0x4da56f['query'],_0x478843['filters']));if(_0x4da56f['query'][_0x5bb9('0x32')]){_0x362410[_0x5bb9('0x31')]=_[_0x5bb9('0x33')](_0x362410[_0x5bb9('0x31')],{'$or':_['map'](_0x2db475,function(_0x249b10){if(_0x249b10[_0x5bb9('0x34')][_0x5bb9('0x35')]!==_0x5bb9('0x36')){var _0x4c3c17={};_0x4c3c17[_0x249b10[_0x5bb9('0x37')]]={'$like':'%'+_0x4da56f[_0x5bb9('0x28')][_0x5bb9('0x32')]+'%'};return _0x4c3c17;}})});}_0x362410=_[_0x5bb9('0x33')]({},_0x362410,_0x4da56f[_0x5bb9('0x38')]);var _0x55252f={'where':_0x362410[_0x5bb9('0x31')]};return db['FaxTransferReport'][_0x5bb9('0x18')](_0x55252f)[_0x5bb9('0x1f')](function(_0xf9a340){_0x1e9450['count']=_0xf9a340;if(_0x4da56f['query'][_0x5bb9('0x39')]){_0x362410['include']=[{'all':!![]}];}return db[_0x5bb9('0x26')][_0x5bb9('0x3a')](_0x362410);})['then'](function(_0xfba9c7){_0x1e9450['rows']=_0xfba9c7;return _0x1e9450;})[_0x5bb9('0x1f')](respondWithFilteredResult(_0x1b133a,_0x362410))[_0x5bb9('0x3b')](handleError(_0x1b133a,null));};exports[_0x5bb9('0x3c')]=function(_0x368e57,_0x561cc6){var _0x1aa55b={'raw':!![],'where':{'id':_0x368e57[_0x5bb9('0x3d')]['id']}},_0x57f373={};_0x57f373[_0x5bb9('0x2b')]=_[_0x5bb9('0x27')](db['FaxTransferReport'][_0x5bb9('0x3e')]);_0x57f373[_0x5bb9('0x28')]=_[_0x5bb9('0x27')](_0x368e57[_0x5bb9('0x28')]);_0x57f373['filters']=_['intersection'](_0x57f373[_0x5bb9('0x2b')],_0x57f373[_0x5bb9('0x28')]);_0x1aa55b[_0x5bb9('0x2d')]=_['intersection'](_0x57f373[_0x5bb9('0x2b')],qs[_0x5bb9('0x2c')](_0x368e57[_0x5bb9('0x28')][_0x5bb9('0x2c')]));_0x1aa55b[_0x5bb9('0x2d')]=_0x1aa55b[_0x5bb9('0x2d')]['length']?_0x1aa55b[_0x5bb9('0x2d')]:_0x57f373[_0x5bb9('0x2b')];if(_0x368e57['query'][_0x5bb9('0x39')]){_0x1aa55b['include']=[{'all':!![]}];}_0x1aa55b=_[_0x5bb9('0x33')]({},_0x1aa55b,_0x368e57[_0x5bb9('0x38')]);return db[_0x5bb9('0x26')][_0x5bb9('0x3f')](_0x1aa55b)[_0x5bb9('0x1f')](handleEntityNotFound(_0x561cc6,null))[_0x5bb9('0x1f')](respondWithResult(_0x561cc6,null))[_0x5bb9('0x3b')](handleError(_0x561cc6,null));};exports[_0x5bb9('0x40')]=function(_0x37bc9f,_0x8fee2){return db[_0x5bb9('0x26')][_0x5bb9('0x40')](_0x37bc9f[_0x5bb9('0x41')],{})['then'](respondWithResult(_0x8fee2,0xc9))['catch'](handleError(_0x8fee2,null));};exports[_0x5bb9('0x1e')]=function(_0x45099d,_0x53b47a){if(_0x45099d[_0x5bb9('0x41')]['id']){delete _0x45099d[_0x5bb9('0x41')]['id'];}return db['FaxTransferReport'][_0x5bb9('0x3f')]({'where':{'id':_0x45099d['params']['id']}})[_0x5bb9('0x1f')](handleEntityNotFound(_0x53b47a,null))['then'](saveUpdates(_0x45099d[_0x5bb9('0x41')],null))['then'](respondWithResult(_0x53b47a,null))['catch'](handleError(_0x53b47a,null));};exports[_0x5bb9('0x20')]=function(_0x2790f2,_0x262403){return db[_0x5bb9('0x26')]['find']({'where':{'id':_0x2790f2[_0x5bb9('0x3d')]['id']}})['then'](handleEntityNotFound(_0x262403,null))[_0x5bb9('0x1f')](removeEntity(_0x262403,null))['catch'](handleError(_0x262403,null));};exports[_0x5bb9('0x42')]=function(_0x29e958,_0x38986b){return db['FaxTransferReport'][_0x5bb9('0x42')]()[_0x5bb9('0x1f')](respondWithResult(_0x38986b,null))[_0x5bb9('0x3b')](handleError(_0x38986b,null));}; \ No newline at end of file +var _0xb32d=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','set','Content-Range','reject','update','then','error','stack','name','index','FaxTransferReport','model','keys','query','filters','intersection','attributes','fields','length','nolimit','offset','sort','where','pick','filter','merge','type','options','count','includeAll','include','findAll','rows','show','params','create','catch','body','find','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api'];(function(_0x4df69e,_0x5131d5){var _0x1f9041=function(_0x1e6288){while(--_0x1e6288){_0x4df69e['push'](_0x4df69e['shift']());}};_0x1f9041(++_0x5131d5);}(_0xb32d,0x1da));var _0xdb32=function(_0x208ff7,_0x12129a){_0x208ff7=_0x208ff7-0x0;var _0x266751=_0xb32d[_0x208ff7];return _0x266751;};'use strict';var pdf=require(_0xdb32('0x0'));var emlformat=require(_0xdb32('0x1'));var rimraf=require(_0xdb32('0x2'));var zipdir=require(_0xdb32('0x3'));var jsonpatch=require(_0xdb32('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xdb32('0x5'));var Mustache=require(_0xdb32('0x6'));var util=require('util');var path=require(_0xdb32('0x7'));var sox=require(_0xdb32('0x8'));var csv=require(_0xdb32('0x9'));var ejs=require(_0xdb32('0xa'));var fs=require('fs');var _=require(_0xdb32('0xb'));var squel=require(_0xdb32('0xc'));var crypto=require('crypto');var jsforce=require(_0xdb32('0xd'));var deskjs=require(_0xdb32('0xe'));var toCsv=require(_0xdb32('0x9'));var querystring=require(_0xdb32('0xf'));var Papa=require(_0xdb32('0x10'));var Redis=require(_0xdb32('0x11'));var authService=require(_0xdb32('0x12'));var qs=require(_0xdb32('0x13'));var hardwareService=require(_0xdb32('0x14'));var logger=require(_0xdb32('0x15'))(_0xdb32('0x16'));var utils=require(_0xdb32('0x17'));var config=require(_0xdb32('0x18'));var db=require(_0xdb32('0x19'))['db'];function respondWithStatusCode(_0x8127d5,_0x10f331){_0x10f331=_0x10f331||0xcc;return function(_0x2ca4a2){if(_0x2ca4a2){return _0x8127d5[_0xdb32('0x1a')](_0x10f331);}return _0x8127d5[_0xdb32('0x1b')](_0x10f331)[_0xdb32('0x1c')]();};}function respondWithResult(_0x410b23,_0x5e4377){_0x5e4377=_0x5e4377||0xc8;return function(_0x7a72cb){if(_0x7a72cb){return _0x410b23[_0xdb32('0x1b')](_0x5e4377)[_0xdb32('0x1d')](_0x7a72cb);}};}function respondWithFilteredResult(_0x2adea8,_0x2d3270){return function(_0x4b38ab){if(_0x4b38ab){var _0x540bc4=_0x4b38ab['count'],_0x1c7b54=_0x2d3270['offset'],_0x3a4028=_0x2d3270['offset']+_0x2d3270[_0xdb32('0x1e')],_0x4fc593;if(_0x3a4028>=_0x540bc4){_0x3a4028=_0x540bc4;_0x4fc593=0xc8;}else{_0x4fc593=0xce;}_0x2adea8['status'](_0x4fc593);return _0x2adea8[_0xdb32('0x1f')](_0xdb32('0x20'),_0x1c7b54+'-'+_0x3a4028+'/'+_0x540bc4)[_0xdb32('0x1d')](_0x4b38ab);}return null;};}function patchUpdates(_0x301cc3){return function(_0x5f1579){try{jsonpatch['apply'](_0x5f1579,_0x301cc3,!![]);}catch(_0x5be1f2){return BPromise[_0xdb32('0x21')](_0x5be1f2);}return _0x5f1579['save']();};}function saveUpdates(_0x3c7697,_0x1d31ee){return function(_0x8a5f88){if(_0x8a5f88){return _0x8a5f88[_0xdb32('0x22')](_0x3c7697)[_0xdb32('0x23')](function(_0x4b08b1){return _0x4b08b1;});}return null;};}function removeEntity(_0x4584e1,_0x21f966){return function(_0x2429ea){if(_0x2429ea){return _0x2429ea['destroy']()['then'](function(){_0x4584e1[_0xdb32('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49f01f,_0x42ac9d){return function(_0x14b5fd){if(!_0x14b5fd){_0x49f01f[_0xdb32('0x1a')](0x194);}return _0x14b5fd;};}function handleError(_0x4406b9,_0x537fec){_0x537fec=_0x537fec||0x1f4;return function(_0x498c20){logger[_0xdb32('0x24')](_0x498c20[_0xdb32('0x25')]);if(_0x498c20[_0xdb32('0x26')]){delete _0x498c20['name'];}_0x4406b9[_0xdb32('0x1b')](_0x537fec)['send'](_0x498c20);};}exports[_0xdb32('0x27')]=function(_0x17f627,_0x42a052){var _0x2e1ada={},_0x22e6b1={},_0x5d29da={'count':0x0,'rows':[]};var _0x54f02c=db[_0xdb32('0x28')]['rawAttributes'];_0x22e6b1[_0xdb32('0x29')]=_[_0xdb32('0x2a')](_0x54f02c);_0x22e6b1[_0xdb32('0x2b')]=_['keys'](_0x17f627['query']);_0x22e6b1[_0xdb32('0x2c')]=_[_0xdb32('0x2d')](_0x22e6b1[_0xdb32('0x29')],_0x22e6b1['query']);_0x2e1ada[_0xdb32('0x2e')]=_[_0xdb32('0x2d')](_0x22e6b1[_0xdb32('0x29')],qs[_0xdb32('0x2f')](_0x17f627[_0xdb32('0x2b')][_0xdb32('0x2f')]));_0x2e1ada[_0xdb32('0x2e')]=_0x2e1ada[_0xdb32('0x2e')][_0xdb32('0x30')]?_0x2e1ada['attributes']:_0x22e6b1['model'];if(!_0x17f627[_0xdb32('0x2b')]['hasOwnProperty'](_0xdb32('0x31'))){_0x2e1ada[_0xdb32('0x1e')]=qs[_0xdb32('0x1e')](_0x17f627['query'][_0xdb32('0x1e')]);_0x2e1ada[_0xdb32('0x32')]=qs['offset'](_0x17f627[_0xdb32('0x2b')][_0xdb32('0x32')]);}_0x2e1ada['order']=qs[_0xdb32('0x33')](_0x17f627[_0xdb32('0x2b')][_0xdb32('0x33')]);_0x2e1ada[_0xdb32('0x34')]=qs[_0xdb32('0x2c')](_[_0xdb32('0x35')](_0x17f627[_0xdb32('0x2b')],_0x22e6b1['filters']));if(_0x17f627[_0xdb32('0x2b')][_0xdb32('0x36')]){_0x2e1ada[_0xdb32('0x34')]=_[_0xdb32('0x37')](_0x2e1ada['where'],{'$or':_['map'](_0x54f02c,function(_0x59e343){if(_0x59e343[_0xdb32('0x38')]['key']!=='VIRTUAL'){var _0x2a4e1b={};_0x2a4e1b[_0x59e343['field']]={'$like':'%'+_0x17f627[_0xdb32('0x2b')][_0xdb32('0x36')]+'%'};return _0x2a4e1b;}})});}_0x2e1ada=_[_0xdb32('0x37')]({},_0x2e1ada,_0x17f627[_0xdb32('0x39')]);var _0x504923={'where':_0x2e1ada[_0xdb32('0x34')]};return db[_0xdb32('0x28')][_0xdb32('0x3a')](_0x504923)[_0xdb32('0x23')](function(_0x213c5d){_0x5d29da[_0xdb32('0x3a')]=_0x213c5d;if(_0x17f627[_0xdb32('0x2b')][_0xdb32('0x3b')]){_0x2e1ada[_0xdb32('0x3c')]=[{'all':!![]}];}return db['FaxTransferReport'][_0xdb32('0x3d')](_0x2e1ada);})['then'](function(_0x30147b){_0x5d29da[_0xdb32('0x3e')]=_0x30147b;return _0x5d29da;})[_0xdb32('0x23')](respondWithFilteredResult(_0x42a052,_0x2e1ada))['catch'](handleError(_0x42a052,null));};exports[_0xdb32('0x3f')]=function(_0x2badc8,_0x36d819){var _0x13bea9={'raw':!![],'where':{'id':_0x2badc8[_0xdb32('0x40')]['id']}},_0xe327ba={};_0xe327ba[_0xdb32('0x29')]=_['keys'](db[_0xdb32('0x28')]['rawAttributes']);_0xe327ba[_0xdb32('0x2b')]=_[_0xdb32('0x2a')](_0x2badc8[_0xdb32('0x2b')]);_0xe327ba[_0xdb32('0x2c')]=_[_0xdb32('0x2d')](_0xe327ba[_0xdb32('0x29')],_0xe327ba['query']);_0x13bea9[_0xdb32('0x2e')]=_[_0xdb32('0x2d')](_0xe327ba[_0xdb32('0x29')],qs['fields'](_0x2badc8['query'][_0xdb32('0x2f')]));_0x13bea9['attributes']=_0x13bea9[_0xdb32('0x2e')][_0xdb32('0x30')]?_0x13bea9[_0xdb32('0x2e')]:_0xe327ba[_0xdb32('0x29')];if(_0x2badc8[_0xdb32('0x2b')]['includeAll']){_0x13bea9[_0xdb32('0x3c')]=[{'all':!![]}];}_0x13bea9=_['merge']({},_0x13bea9,_0x2badc8[_0xdb32('0x39')]);return db[_0xdb32('0x28')]['find'](_0x13bea9)[_0xdb32('0x23')](handleEntityNotFound(_0x36d819,null))[_0xdb32('0x23')](respondWithResult(_0x36d819,null))['catch'](handleError(_0x36d819,null));};exports[_0xdb32('0x41')]=function(_0x206992,_0x41ce6c){return db[_0xdb32('0x28')]['create'](_0x206992['body'],{})[_0xdb32('0x23')](respondWithResult(_0x41ce6c,0xc9))[_0xdb32('0x42')](handleError(_0x41ce6c,null));};exports[_0xdb32('0x22')]=function(_0x2d60d8,_0x3e42a9){if(_0x2d60d8[_0xdb32('0x43')]['id']){delete _0x2d60d8['body']['id'];}return db['FaxTransferReport'][_0xdb32('0x44')]({'where':{'id':_0x2d60d8['params']['id']}})[_0xdb32('0x23')](handleEntityNotFound(_0x3e42a9,null))['then'](saveUpdates(_0x2d60d8[_0xdb32('0x43')],null))[_0xdb32('0x23')](respondWithResult(_0x3e42a9,null))[_0xdb32('0x42')](handleError(_0x3e42a9,null));};exports[_0xdb32('0x45')]=function(_0x194b23,_0x33db5b){return db['FaxTransferReport'][_0xdb32('0x44')]({'where':{'id':_0x194b23[_0xdb32('0x40')]['id']}})[_0xdb32('0x23')](handleEntityNotFound(_0x33db5b,null))['then'](removeEntity(_0x33db5b,null))[_0xdb32('0x42')](handleError(_0x33db5b,null));};exports['describe']=function(_0x214c29,_0x1c98d9){return db[_0xdb32('0x28')][_0xdb32('0x46')]()[_0xdb32('0x23')](respondWithResult(_0x1c98d9,null))[_0xdb32('0x42')](handleError(_0x1c98d9,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 9e221f7..0ad8ed5 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 _0x6043=['api','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util'];(function(_0xe2499f,_0x20fac8){var _0x4e7b57=function(_0x947ba0){while(--_0x947ba0){_0xe2499f['push'](_0xe2499f['shift']());}};_0x4e7b57(++_0x20fac8);}(_0x6043,0x16a));var _0x3604=function(_0x399338,_0x11496b){_0x399338=_0x399338-0x0;var _0x3c4485=_0x6043[_0x399338];return _0x3c4485;};'use strict';var _=require(_0x3604('0x0'));var util=require(_0x3604('0x1'));var logger=require('../../config/logger')(_0x3604('0x2'));var moment=require('moment');var BPromise=require(_0x3604('0x3'));var rp=require(_0x3604('0x4'));var fs=require('fs');var path=require(_0x3604('0x5'));var rimraf=require(_0x3604('0x6'));var config=require(_0x3604('0x7'));var attributes=require(_0x3604('0x8'));module['exports']=function(_0xc45d77,_0x49e715){return _0xc45d77[_0x3604('0x9')](_0x3604('0xa'),attributes,{'tableName':_0x3604('0xb'),'paranoid':![],'indexes':[{'name':_0x3604('0xc'),'fields':[_0x3604('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0b21=['FaxTransferReport','report_fax_transfer','uniqueid','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0b21,0x137));var _0x10b2=function(_0xe7ac8b,_0x2f01e7){_0xe7ac8b=_0xe7ac8b-0x0;var _0x1b2c49=_0x0b21[_0xe7ac8b];return _0x1b2c49;};'use strict';var _=require(_0x10b2('0x0'));var util=require('util');var logger=require(_0x10b2('0x1'))('api');var moment=require(_0x10b2('0x2'));var BPromise=require(_0x10b2('0x3'));var rp=require(_0x10b2('0x4'));var fs=require('fs');var path=require(_0x10b2('0x5'));var rimraf=require(_0x10b2('0x6'));var config=require(_0x10b2('0x7'));var attributes=require(_0x10b2('0x8'));module[_0x10b2('0x9')]=function(_0x296a0b,_0x5b8ae2){return _0x296a0b[_0x10b2('0xa')](_0x10b2('0xb'),attributes,{'tableName':_0x10b2('0xc'),'paranoid':![],'indexes':[{'name':_0x10b2('0xd'),'fields':[_0x10b2('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 4d817e6..0dabc06 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 _0x4a11=['result','lodash','util','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x4a11,0x131));var _0x14a1=function(_0xb4ce16,_0x2bd30c){_0xb4ce16=_0xb4ce16-0x0;var _0x14055c=_0x4a11[_0xb4ce16];return _0x14055c;};'use strict';var _=require(_0x14a1('0x0'));var util=require(_0x14a1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x14a1('0x2'));var fs=require('fs');var Redis=require(_0x14a1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x14a1('0x4'));var logger=require('../../config/logger')(_0x14a1('0x5'));var config=require('../../config/environment');var jayson=require(_0x14a1('0x6'));var client=jayson[_0x14a1('0x7')][_0x14a1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x55b38a,_0x527567,_0x588202){return new BPromise(function(_0x17aaa4,_0x412582){return client[_0x14a1('0x9')](_0x55b38a,_0x588202)['then'](function(_0x14b649){logger[_0x14a1('0xa')](_0x14a1('0xb'),_0x527567,_0x14a1('0xc'));logger['debug'](_0x14a1('0xd'),_0x527567,_0x14a1('0xc'),JSON[_0x14a1('0xe')](_0x14b649));if(_0x14b649[_0x14a1('0xf')]){if(_0x14b649[_0x14a1('0xf')][_0x14a1('0x10')]===0x1f4){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x527567,_0x14b649['error'][_0x14a1('0x11')]);return _0x412582(_0x14b649['error'][_0x14a1('0x11')]);}logger[_0x14a1('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x527567,_0x14b649[_0x14a1('0xf')][_0x14a1('0x11')]);return _0x17aaa4(_0x14b649[_0x14a1('0xf')]['message']);}else{logger[_0x14a1('0xa')]('FaxTransferReport,\x20%s,\x20%s',_0x527567,'request\x20sent');_0x17aaa4(_0x14b649[_0x14a1('0x12')][_0x14a1('0x11')]);}})['catch'](function(_0x2667bf){logger['error'](_0x14a1('0xb'),_0x527567,_0x2667bf);_0x412582(_0x2667bf);});});} \ No newline at end of file +var _0x3db8=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird'];(function(_0xcc926b,_0xa6d99){var _0x21341c=function(_0x3c8b1c){while(--_0x3c8b1c){_0xcc926b['push'](_0xcc926b['shift']());}};_0x21341c(++_0xa6d99);}(_0x3db8,0x10d));var _0x83db=function(_0x4637f7,_0x52f044){_0x4637f7=_0x4637f7-0x0;var _0x5c43b0=_0x3db8[_0x4637f7];return _0x5c43b0;};'use strict';var _=require(_0x83db('0x0'));var util=require(_0x83db('0x1'));var moment=require(_0x83db('0x2'));var BPromise=require(_0x83db('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(_0x83db('0x4'))(_0x83db('0x5'));var config=require('../../config/environment');var jayson=require(_0x83db('0x6'));var client=jayson[_0x83db('0x7')][_0x83db('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x493f70,_0x3b89f2,_0x286f1d){return new BPromise(function(_0x82a304,_0x171641){return client[_0x83db('0x9')](_0x493f70,_0x286f1d)[_0x83db('0xa')](function(_0x8ab5d1){logger[_0x83db('0xb')](_0x83db('0xc'),_0x3b89f2,_0x83db('0xd'));logger[_0x83db('0xe')](_0x83db('0xf'),_0x3b89f2,_0x83db('0xd'),JSON[_0x83db('0x10')](_0x8ab5d1));if(_0x8ab5d1[_0x83db('0x11')]){if(_0x8ab5d1[_0x83db('0x11')][_0x83db('0x12')]===0x1f4){logger[_0x83db('0x11')](_0x83db('0xc'),_0x3b89f2,_0x8ab5d1['error'][_0x83db('0x13')]);return _0x171641(_0x8ab5d1['error']['message']);}logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x3b89f2,_0x8ab5d1[_0x83db('0x11')]['message']);return _0x82a304(_0x8ab5d1[_0x83db('0x11')]['message']);}else{logger['info'](_0x83db('0xc'),_0x3b89f2,_0x83db('0xd'));_0x82a304(_0x8ab5d1[_0x83db('0x14')][_0x83db('0x13')]);}})['catch'](function(_0x106db4){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x3b89f2,_0x106db4);_0x171641(_0x106db4);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 1778959..a49a544 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 _0x9c44=['../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','show','post','put','update','delete','destroy','exports','path','connect-timeout','express','Router'];(function(_0x397fb5,_0x5a4adc){var _0x40f602=function(_0x33f6e4){while(--_0x33f6e4){_0x397fb5['push'](_0x397fb5['shift']());}};_0x40f602(++_0x5a4adc);}(_0x9c44,0x178));var _0x49c4=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x9c44[_0xfae23b];return _0x200640;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var auth=require(_0x49c4('0x4'));var interaction=require(_0x49c4('0x5'));var config=require('../../config/environment');var controller=require('./faxTransferReport.controller');router[_0x49c4('0x6')]('/',auth['isAuthenticated'](),controller[_0x49c4('0x7')]);router[_0x49c4('0x6')](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xa')]);router['get'](_0x49c4('0xb'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xc')]);router[_0x49c4('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x49c4('0xe')](_0x49c4('0xb'),auth['isAuthenticated'](),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0x11')]);module[_0x49c4('0x12')]=router; \ No newline at end of file +var _0x032e=['/:id','show','post','create','update','delete','destroy','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x5086b5,_0x3e2842){var _0x44762c=function(_0x1d0e34){while(--_0x1d0e34){_0x5086b5['push'](_0x5086b5['shift']());}};_0x44762c(++_0x3e2842);}(_0x032e,0x124));var _0xe032=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x032e[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0xe032('0x0'));var util=require('util');var path=require(_0xe032('0x1'));var timeout=require(_0xe032('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xe032('0x3'));var interaction=require(_0xe032('0x4'));var config=require(_0xe032('0x5'));var controller=require(_0xe032('0x6'));router[_0xe032('0x7')]('/',auth[_0xe032('0x8')](),controller[_0xe032('0x9')]);router[_0xe032('0x7')](_0xe032('0xa'),auth[_0xe032('0x8')](),controller[_0xe032('0xb')]);router[_0xe032('0x7')](_0xe032('0xc'),auth[_0xe032('0x8')](),controller[_0xe032('0xd')]);router[_0xe032('0xe')]('/',auth[_0xe032('0x8')](),controller[_0xe032('0xf')]);router['put'](_0xe032('0xc'),auth[_0xe032('0x8')](),controller[_0xe032('0x10')]);router[_0xe032('0x11')](_0xe032('0xc'),auth[_0xe032('0x8')](),controller[_0xe032('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 5ecafdb..b247636 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 _0x546a=['/:id','show','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','index'];(function(_0x1546aa,_0xd6437a){var _0x3f174b=function(_0x214723){while(--_0x214723){_0x1546aa['push'](_0x1546aa['shift']());}};_0x3f174b(++_0xd6437a);}(_0x546a,0x7f));var _0xa546=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x546a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xa546('0x0'));var util=require(_0xa546('0x1'));var path=require(_0xa546('0x2'));var timeout=require(_0xa546('0x3'));var express=require('express');var router=express[_0xa546('0x4')]();var auth=require(_0xa546('0x5'));var interaction=require(_0xa546('0x6'));var config=require(_0xa546('0x7'));var controller=require(_0xa546('0x8'));router[_0xa546('0x9')]('/',auth['isAuthenticated'](),controller[_0xa546('0xa')]);router[_0xa546('0x9')](_0xa546('0xb'),auth['isAuthenticated'](),controller[_0xa546('0xc')]);router[_0xa546('0x9')](_0xa546('0xd'),auth[_0xa546('0xe')](),controller[_0xa546('0xf')]);router[_0xa546('0x9')](_0xa546('0x10'),auth[_0xa546('0xe')](),controller[_0xa546('0x11')]);router[_0xa546('0x12')]('/',auth[_0xa546('0xe')](),controller['create']);router[_0xa546('0x12')](_0xa546('0xd'),auth[_0xa546('0xe')](),controller[_0xa546('0x13')]);router[_0xa546('0x14')](_0xa546('0xb'),auth['isAuthenticated'](),controller[_0xa546('0x15')]);router['delete'](_0xa546('0xb'),auth[_0xa546('0xe')](),controller[_0xa546('0x16')]);module['exports']=router; \ No newline at end of file +var _0xd02b=['../../config/environment','./intDeskAccount.controller','get','index','/:id','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','getFields','post','create','put','update','destroy','exports','multer','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x3f3bad,_0x193f06){var _0x4f0801=function(_0x5cfd32){while(--_0x5cfd32){_0x3f3bad['push'](_0x3f3bad['shift']());}};_0x4f0801(++_0x193f06);}(_0xd02b,0xb8));var _0xbd02=function(_0x5be934,_0x4b9756){_0x5be934=_0x5be934-0x0;var _0x45ac78=_0xd02b[_0x5be934];return _0x45ac78;};'use strict';var multer=require(_0xbd02('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xbd02('0x1'));var express=require(_0xbd02('0x2'));var router=express[_0xbd02('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xbd02('0x4'));var config=require(_0xbd02('0x5'));var controller=require(_0xbd02('0x6'));router[_0xbd02('0x7')]('/',auth['isAuthenticated'](),controller[_0xbd02('0x8')]);router['get'](_0xbd02('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xbd02('0x7')](_0xbd02('0xa'),auth[_0xbd02('0xb')](),controller[_0xbd02('0xc')]);router[_0xbd02('0x7')](_0xbd02('0xd'),auth[_0xbd02('0xb')](),controller[_0xbd02('0xe')]);router[_0xbd02('0xf')]('/',auth[_0xbd02('0xb')](),controller[_0xbd02('0x10')]);router[_0xbd02('0xf')](_0xbd02('0xa'),auth[_0xbd02('0xb')](),controller['addConfiguration']);router[_0xbd02('0x11')](_0xbd02('0x9'),auth[_0xbd02('0xb')](),controller[_0xbd02('0x12')]);router['delete'](_0xbd02('0x9'),auth[_0xbd02('0xb')](),controller[_0xbd02('0x13')]);module[_0xbd02('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 1317bd9..75a46b2 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 _0xeef3=['exports','STRING','ENUM','basic','newTab','integrationTab','sequelize'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0xeef3,0xdf));var _0x3eef=function(_0x13e724,_0x296739){_0x13e724=_0x13e724-0x0;var _0x334a44=_0xeef3[_0x13e724];return _0x334a44;};'use strict';var Sequelize=require(_0x3eef('0x0'));module[_0x3eef('0x1')]={'name':{'type':Sequelize[_0x3eef('0x2')]},'description':{'type':Sequelize[_0x3eef('0x2')]},'username':{'type':Sequelize[_0x3eef('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0x3eef('0x3')](_0x3eef('0x4')),'defaultValue':_0x3eef('0x4')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x3eef('0x2')]},'consumerSecret':{'type':Sequelize[_0x3eef('0x2')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x3eef('0x2')]},'serverUrl':{'type':Sequelize[_0x3eef('0x2')]},'type':{'type':Sequelize[_0x3eef('0x3')]('integrationTab',_0x3eef('0x5')),'defaultValue':_0x3eef('0x6')}}; \ No newline at end of file +var _0x9b17=['sequelize','exports','STRING','ENUM','basic','integrationTab','newTab'];(function(_0x1261ac,_0x357a74){var _0x363168=function(_0x45c05c){while(--_0x45c05c){_0x1261ac['push'](_0x1261ac['shift']());}};_0x363168(++_0x357a74);}(_0x9b17,0x165));var _0x79b1=function(_0x2fb932,_0x2b0044){_0x2fb932=_0x2fb932-0x0;var _0x438dd4=_0x9b17[_0x2fb932];return _0x438dd4;};'use strict';var Sequelize=require(_0x79b1('0x0'));module[_0x79b1('0x1')]={'name':{'type':Sequelize[_0x79b1('0x2')]},'description':{'type':Sequelize[_0x79b1('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x79b1('0x2')]},'authType':{'type':Sequelize[_0x79b1('0x3')](_0x79b1('0x4')),'defaultValue':'basic'},'password':{'type':Sequelize[_0x79b1('0x2')]},'consumerKey':{'type':Sequelize[_0x79b1('0x2')]},'consumerSecret':{'type':Sequelize[_0x79b1('0x2')]},'token':{'type':Sequelize[_0x79b1('0x2')]},'tokenSecret':{'type':Sequelize[_0x79b1('0x2')]},'serverUrl':{'type':Sequelize[_0x79b1('0x2')]},'type':{'type':Sequelize['ENUM'](_0x79b1('0x5'),_0x79b1('0x6')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 8325725..0725285 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(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var 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(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_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'];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 2b8684a..d2e76eb 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 _0xf4eb=['./intDeskAccount.attributes','../../components/integrations/configuration','exports','DeskAccount','lodash','bluebird','rimraf','../../config/environment'];(function(_0x1617d6,_0x35ecfa){var _0x55a127=function(_0x3eaad6){while(--_0x3eaad6){_0x1617d6['push'](_0x1617d6['shift']());}};_0x55a127(++_0x35ecfa);}(_0xf4eb,0xec));var _0xbf4e=function(_0x219882,_0x4b265f){_0x219882=_0x219882-0x0;var _0x5b8e2a=_0xf4eb[_0x219882];return _0x5b8e2a;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xbf4e('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var attributes=require(_0xbf4e('0x4'));var integrations=require(_0xbf4e('0x5'));module[_0xbf4e('0x6')]=function(_0x2fcfed,_0x15b99f){return _0x2fcfed['define'](_0xbf4e('0x7'),attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4483=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','lodash'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x4483,0x1a3));var _0x3448=function(_0x357e9b,_0xe2140f){_0x357e9b=_0x357e9b-0x0;var _0x1d6604=_0x4483[_0x357e9b];return _0x1d6604;};'use strict';var _=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var logger=require(_0x3448('0x2'))('api');var moment=require(_0x3448('0x3'));var BPromise=require(_0x3448('0x4'));var rp=require(_0x3448('0x5'));var fs=require('fs');var path=require(_0x3448('0x6'));var rimraf=require(_0x3448('0x7'));var config=require('../../config/environment');var attributes=require(_0x3448('0x8'));var integrations=require(_0x3448('0x9'));module[_0x3448('0xa')]=function(_0xd3606d,_0x1bb7e5){return _0xd3606d[_0x3448('0xb')](_0x3448('0xc'),attributes,{'tableName':_0x3448('0xd'),'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 ae4d2c0..9683775 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 _0xf7d9=['limit','include','map','model','attributes','stringify','catch','ShowDeskAccount','find','raw','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','GetDeskAccount','DeskAccount','options','where'];(function(_0x1c22e3,_0x1c5151){var _0x502d78=function(_0x42b36d){while(--_0x42b36d){_0x1c22e3['push'](_0x1c22e3['shift']());}};_0x502d78(++_0x1c5151);}(_0xf7d9,0x122));var _0x9f7d=function(_0x1de587,_0x17c3eb){_0x1de587=_0x1de587-0x0;var _0x2ec51e=_0xf7d9[_0x1de587];return _0x2ec51e;};'use strict';var _=require(_0x9f7d('0x0'));var util=require(_0x9f7d('0x1'));var moment=require(_0x9f7d('0x2'));var BPromise=require(_0x9f7d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f7d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9f7d('0x5'))(_0x9f7d('0x6'));var config=require(_0x9f7d('0x7'));var jayson=require(_0x9f7d('0x8'));var client=jayson[_0x9f7d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4dc6b9,_0xf09259,_0x2333e8){return new BPromise(function(_0x218628,_0x2893a5){return client[_0x9f7d('0xa')](_0x4dc6b9,_0x2333e8)[_0x9f7d('0xb')](function(_0x5290e2){logger[_0x9f7d('0xc')](_0x9f7d('0xd'),_0xf09259,'request\x20sent');logger[_0x9f7d('0xe')](_0x9f7d('0xf'),_0xf09259,_0x9f7d('0x10'),JSON['stringify'](_0x5290e2));if(_0x5290e2[_0x9f7d('0x11')]){if(_0x5290e2[_0x9f7d('0x11')][_0x9f7d('0x12')]===0x1f4){logger[_0x9f7d('0x11')](_0x9f7d('0xd'),_0xf09259,_0x5290e2[_0x9f7d('0x11')]['message']);return _0x2893a5(_0x5290e2[_0x9f7d('0x11')][_0x9f7d('0x13')]);}logger[_0x9f7d('0x11')](_0x9f7d('0xd'),_0xf09259,_0x5290e2['error'][_0x9f7d('0x13')]);return _0x218628(_0x5290e2[_0x9f7d('0x11')][_0x9f7d('0x13')]);}else{logger[_0x9f7d('0xc')](_0x9f7d('0xd'),_0xf09259,_0x9f7d('0x10'));_0x218628(_0x5290e2[_0x9f7d('0x14')]['message']);}})['catch'](function(_0x402609){logger[_0x9f7d('0x11')](_0x9f7d('0xd'),_0xf09259,_0x402609);_0x2893a5(_0x402609);});});}exports[_0x9f7d('0x15')]=function(_0x1b30a0){var _0x11d958=this;return new Promise(function(_0x24c197,_0x213e6d){return db[_0x9f7d('0x16')]['findAll']({'raw':_0x1b30a0[_0x9f7d('0x17')]?_0x1b30a0[_0x9f7d('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1b30a0['options']?_0x1b30a0['options'][_0x9f7d('0x18')]||null:null,'attributes':_0x1b30a0[_0x9f7d('0x17')]?_0x1b30a0[_0x9f7d('0x17')]['attributes']||null:null,'limit':_0x1b30a0['options']?_0x1b30a0[_0x9f7d('0x17')][_0x9f7d('0x19')]||null:null,'include':_0x1b30a0[_0x9f7d('0x17')]?_0x1b30a0[_0x9f7d('0x17')][_0x9f7d('0x1a')]?_[_0x9f7d('0x1b')](_0x1b30a0['options'][_0x9f7d('0x1a')],function(_0x4e10a7){return{'model':db[_0x4e10a7[_0x9f7d('0x1c')]],'as':_0x4e10a7['as'],'attributes':_0x4e10a7['attributes'],'include':_0x4e10a7['include']?_[_0x9f7d('0x1b')](_0x4e10a7['include'],function(_0x4bcfd0){return{'model':db[_0x4bcfd0[_0x9f7d('0x1c')]],'as':_0x4bcfd0['as'],'attributes':_0x4bcfd0[_0x9f7d('0x1d')],'include':_0x4bcfd0[_0x9f7d('0x1a')]?_[_0x9f7d('0x1b')](_0x4bcfd0['include'],function(_0x48ea1b){return{'model':db[_0x48ea1b[_0x9f7d('0x1c')]],'as':_0x48ea1b['as'],'attributes':_0x48ea1b[_0x9f7d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9f7d('0xb')](function(_0x290ef9){logger['info'](_0x9f7d('0x15'),_0x1b30a0);logger[_0x9f7d('0xe')](_0x9f7d('0x15'),_0x1b30a0,JSON[_0x9f7d('0x1e')](_0x290ef9));_0x24c197(_0x290ef9);})[_0x9f7d('0x1f')](function(_0x120169){logger[_0x9f7d('0x11')](_0x9f7d('0x15'),_0x120169['message'],_0x1b30a0);_0x213e6d(_0x11d958['error'](0x1f4,_0x120169[_0x9f7d('0x13')]));});});};exports[_0x9f7d('0x20')]=function(_0x1ca5cb){var _0x1a467d=this;return new Promise(function(_0x1c9116,_0x2f1470){return db[_0x9f7d('0x16')][_0x9f7d('0x21')]({'raw':_0x1ca5cb['options']?_0x1ca5cb[_0x9f7d('0x17')][_0x9f7d('0x22')]===undefined?!![]:![]:!![],'where':_0x1ca5cb[_0x9f7d('0x17')]?_0x1ca5cb['options'][_0x9f7d('0x18')]||null:null,'attributes':_0x1ca5cb[_0x9f7d('0x17')]?_0x1ca5cb[_0x9f7d('0x17')]['attributes']||null:null,'include':_0x1ca5cb[_0x9f7d('0x17')]?_0x1ca5cb[_0x9f7d('0x17')]['include']?_[_0x9f7d('0x1b')](_0x1ca5cb[_0x9f7d('0x17')][_0x9f7d('0x1a')],function(_0x4dc032){return{'model':db[_0x4dc032['model']],'as':_0x4dc032['as'],'attributes':_0x4dc032[_0x9f7d('0x1d')],'include':_0x4dc032[_0x9f7d('0x1a')]?_[_0x9f7d('0x1b')](_0x4dc032[_0x9f7d('0x1a')],function(_0x1d6c36){return{'model':db[_0x1d6c36[_0x9f7d('0x1c')]],'as':_0x1d6c36['as'],'attributes':_0x1d6c36['attributes'],'include':_0x1d6c36['include']?_[_0x9f7d('0x1b')](_0x1d6c36['include'],function(_0x4856da){return{'model':db[_0x4856da[_0x9f7d('0x1c')]],'as':_0x4856da['as'],'attributes':_0x4856da[_0x9f7d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9f7d('0xb')](function(_0x1094ff){logger['info'](_0x9f7d('0x20'),_0x1ca5cb);logger['debug'](_0x9f7d('0x20'),_0x1ca5cb,JSON[_0x9f7d('0x1e')](_0x1094ff));_0x1c9116(_0x1094ff);})[_0x9f7d('0x1f')](function(_0x3ef0ba){logger['error'](_0x9f7d('0x20'),_0x3ef0ba[_0x9f7d('0x13')],_0x1ca5cb);_0x2f1470(_0x1a467d[_0x9f7d('0x11')](0x1f4,_0x3ef0ba[_0x9f7d('0x13')]));});});}; \ No newline at end of file +var _0x49d9=['GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','ShowDeskAccount','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0xabfec4,_0x35076e){var _0x7bafa2=function(_0x52d551){while(--_0x52d551){_0xabfec4['push'](_0xabfec4['shift']());}};_0x7bafa2(++_0x35076e);}(_0x49d9,0x13e));var _0x949d=function(_0x272f02,_0x1561ce){_0x272f02=_0x272f02-0x0;var _0x5d0a44=_0x49d9[_0x272f02];return _0x5d0a44;};'use strict';var _=require(_0x949d('0x0'));var util=require(_0x949d('0x1'));var moment=require(_0x949d('0x2'));var BPromise=require(_0x949d('0x3'));var rs=require(_0x949d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x949d('0x5'))['db'];var utils=require(_0x949d('0x6'));var logger=require(_0x949d('0x7'))(_0x949d('0x8'));var config=require(_0x949d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x949d('0xa')][_0x949d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2b9a11,_0x2561f1,_0x188acb){return new BPromise(function(_0x27ed2d,_0x594142){return client[_0x949d('0xc')](_0x2b9a11,_0x188acb)[_0x949d('0xd')](function(_0x107a89){logger['info'](_0x949d('0xe'),_0x2561f1,_0x949d('0xf'));logger['debug'](_0x949d('0x10'),_0x2561f1,_0x949d('0xf'),JSON[_0x949d('0x11')](_0x107a89));if(_0x107a89[_0x949d('0x12')]){if(_0x107a89[_0x949d('0x12')][_0x949d('0x13')]===0x1f4){logger[_0x949d('0x12')](_0x949d('0xe'),_0x2561f1,_0x107a89['error']['message']);return _0x594142(_0x107a89[_0x949d('0x12')][_0x949d('0x14')]);}logger[_0x949d('0x12')](_0x949d('0xe'),_0x2561f1,_0x107a89['error']['message']);return _0x27ed2d(_0x107a89['error'][_0x949d('0x14')]);}else{logger[_0x949d('0x15')](_0x949d('0xe'),_0x2561f1,_0x949d('0xf'));_0x27ed2d(_0x107a89[_0x949d('0x16')][_0x949d('0x14')]);}})[_0x949d('0x17')](function(_0xf4a980){logger[_0x949d('0x12')](_0x949d('0xe'),_0x2561f1,_0xf4a980);_0x594142(_0xf4a980);});});}exports[_0x949d('0x18')]=function(_0x3b983c){var _0x4597d0=this;return new Promise(function(_0xff41e7,_0x554123){return db[_0x949d('0x19')][_0x949d('0x1a')]({'raw':_0x3b983c[_0x949d('0x1b')]?_0x3b983c[_0x949d('0x1b')][_0x949d('0x1c')]===undefined?!![]:![]:!![],'where':_0x3b983c[_0x949d('0x1b')]?_0x3b983c[_0x949d('0x1b')][_0x949d('0x1d')]||null:null,'attributes':_0x3b983c['options']?_0x3b983c[_0x949d('0x1b')][_0x949d('0x1e')]||null:null,'limit':_0x3b983c['options']?_0x3b983c[_0x949d('0x1b')][_0x949d('0x1f')]||null:null,'include':_0x3b983c[_0x949d('0x1b')]?_0x3b983c['options'][_0x949d('0x20')]?_[_0x949d('0x21')](_0x3b983c[_0x949d('0x1b')][_0x949d('0x20')],function(_0x34b17b){return{'model':db[_0x34b17b[_0x949d('0x22')]],'as':_0x34b17b['as'],'attributes':_0x34b17b[_0x949d('0x1e')],'include':_0x34b17b[_0x949d('0x20')]?_[_0x949d('0x21')](_0x34b17b[_0x949d('0x20')],function(_0x156362){return{'model':db[_0x156362[_0x949d('0x22')]],'as':_0x156362['as'],'attributes':_0x156362[_0x949d('0x1e')],'include':_0x156362[_0x949d('0x20')]?_[_0x949d('0x21')](_0x156362[_0x949d('0x20')],function(_0x4fe959){return{'model':db[_0x4fe959[_0x949d('0x22')]],'as':_0x4fe959['as'],'attributes':_0x4fe959[_0x949d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x949d('0xd')](function(_0x2adc4a){logger['info'](_0x949d('0x18'),_0x3b983c);logger[_0x949d('0x23')](_0x949d('0x18'),_0x3b983c,JSON[_0x949d('0x11')](_0x2adc4a));_0xff41e7(_0x2adc4a);})['catch'](function(_0x4cfb04){logger[_0x949d('0x12')](_0x949d('0x18'),_0x4cfb04[_0x949d('0x14')],_0x3b983c);_0x554123(_0x4597d0[_0x949d('0x12')](0x1f4,_0x4cfb04[_0x949d('0x14')]));});});};exports[_0x949d('0x24')]=function(_0x30e71f){var _0x24f526=this;return new Promise(function(_0x5c54a0,_0x1058e5){return db[_0x949d('0x19')][_0x949d('0x25')]({'raw':_0x30e71f[_0x949d('0x1b')]?_0x30e71f['options'][_0x949d('0x1c')]===undefined?!![]:![]:!![],'where':_0x30e71f[_0x949d('0x1b')]?_0x30e71f[_0x949d('0x1b')][_0x949d('0x1d')]||null:null,'attributes':_0x30e71f[_0x949d('0x1b')]?_0x30e71f[_0x949d('0x1b')][_0x949d('0x1e')]||null:null,'include':_0x30e71f[_0x949d('0x1b')]?_0x30e71f[_0x949d('0x1b')]['include']?_[_0x949d('0x21')](_0x30e71f[_0x949d('0x1b')][_0x949d('0x20')],function(_0x58a7b9){return{'model':db[_0x58a7b9[_0x949d('0x22')]],'as':_0x58a7b9['as'],'attributes':_0x58a7b9[_0x949d('0x1e')],'include':_0x58a7b9['include']?_[_0x949d('0x21')](_0x58a7b9[_0x949d('0x20')],function(_0x5138f0){return{'model':db[_0x5138f0[_0x949d('0x22')]],'as':_0x5138f0['as'],'attributes':_0x5138f0[_0x949d('0x1e')],'include':_0x5138f0[_0x949d('0x20')]?_[_0x949d('0x21')](_0x5138f0[_0x949d('0x20')],function(_0x5dd22f){return{'model':db[_0x5dd22f[_0x949d('0x22')]],'as':_0x5dd22f['as'],'attributes':_0x5dd22f[_0x949d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x949d('0xd')](function(_0x21220c){logger['info'](_0x949d('0x24'),_0x30e71f);logger['debug'](_0x949d('0x24'),_0x30e71f,JSON[_0x949d('0x11')](_0x21220c));_0x5c54a0(_0x21220c);})[_0x949d('0x17')](function(_0x105e04){logger[_0x949d('0x12')]('ShowDeskAccount',_0x105e04[_0x949d('0x14')],_0x30e71f);_0x1058e5(_0x24f526[_0x949d('0x12')](0x1f4,_0x105e04[_0x949d('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 6cb8e32..220b845 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 _0x675d=['Router','../../components/interaction/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','post','create','setTags','put','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x3efe9b,_0x5b41a8){var _0x132073=function(_0x34459e){while(--_0x34459e){_0x3efe9b['push'](_0x3efe9b['shift']());}};_0x132073(++_0x5b41a8);}(_0x675d,0x14e));var _0xd675=function(_0x5a136b,_0x42c5d1){_0x5a136b=_0x5a136b-0x0;var _0x53ce1c=_0x675d[_0x5a136b];return _0x53ce1c;};'use strict';var multer=require(_0xd675('0x0'));var util=require(_0xd675('0x1'));var path=require('path');var timeout=require(_0xd675('0x2'));var express=require(_0xd675('0x3'));var router=express[_0xd675('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xd675('0x5'));var config=require(_0xd675('0x6'));var controller=require(_0xd675('0x7'));router[_0xd675('0x8')]('/',auth[_0xd675('0x9')](),controller['index']);router[_0xd675('0x8')](_0xd675('0xa'),auth[_0xd675('0x9')](),controller[_0xd675('0xb')]);router[_0xd675('0x8')](_0xd675('0xc'),auth[_0xd675('0x9')](),controller[_0xd675('0xd')]);router['get'](_0xd675('0xe'),auth[_0xd675('0x9')](),controller[_0xd675('0xf')]);router[_0xd675('0x8')]('/:id/descriptions',auth[_0xd675('0x9')](),controller[_0xd675('0x10')]);router['get'](_0xd675('0x11'),auth[_0xd675('0x9')](),controller['getTags']);router[_0xd675('0x12')]('/',auth[_0xd675('0x9')](),controller[_0xd675('0x13')]);router[_0xd675('0x12')](_0xd675('0x11'),auth[_0xd675('0x9')](),controller[_0xd675('0x14')]);router[_0xd675('0x15')]('/:id',auth[_0xd675('0x9')](),controller[_0xd675('0x16')]);router[_0xd675('0x17')](_0xd675('0xa'),auth[_0xd675('0x9')](),controller[_0xd675('0x18')]);module[_0xd675('0x19')]=router; \ No newline at end of file +var _0x5b28=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','setTags','put','update','delete','destroy','exports','util','express','Router'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x5b28,0x183));var _0x85b2=function(_0x37662f,_0x544594){_0x37662f=_0x37662f-0x0;var _0x5cf18a=_0x5b28[_0x37662f];return _0x5cf18a;};'use strict';var multer=require('multer');var util=require(_0x85b2('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x85b2('0x1'));var router=express[_0x85b2('0x2')]();var auth=require(_0x85b2('0x3'));var interaction=require(_0x85b2('0x4'));var config=require(_0x85b2('0x5'));var controller=require(_0x85b2('0x6'));router[_0x85b2('0x7')]('/',auth[_0x85b2('0x8')](),controller[_0x85b2('0x9')]);router[_0x85b2('0x7')](_0x85b2('0xa'),auth[_0x85b2('0x8')](),controller[_0x85b2('0xb')]);router[_0x85b2('0x7')](_0x85b2('0xc'),auth[_0x85b2('0x8')](),controller['getFields']);router[_0x85b2('0x7')](_0x85b2('0xd'),auth['isAuthenticated'](),controller[_0x85b2('0xe')]);router[_0x85b2('0x7')](_0x85b2('0xf'),auth[_0x85b2('0x8')](),controller[_0x85b2('0x10')]);router[_0x85b2('0x7')](_0x85b2('0x11'),auth[_0x85b2('0x8')](),controller['getTags']);router[_0x85b2('0x12')]('/',auth[_0x85b2('0x8')](),controller[_0x85b2('0x13')]);router[_0x85b2('0x12')]('/:id/tags',auth[_0x85b2('0x8')](),controller[_0x85b2('0x14')]);router[_0x85b2('0x15')](_0x85b2('0xa'),auth[_0x85b2('0x8')](),controller[_0x85b2('0x16')]);router[_0x85b2('0x17')](_0x85b2('0xa'),auth[_0x85b2('0x8')](),controller[_0x85b2('0x18')]);module[_0x85b2('0x19')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index ec13ecd..aaddabc 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 _0xc7c6=['exports'];(function(_0x2f281b,_0x47b283){var _0x4e24fe=function(_0x2799b6){while(--_0x2799b6){_0x2f281b['push'](_0x2f281b['shift']());}};_0x4e24fe(++_0x47b283);}(_0xc7c6,0xac));var _0x6c7c=function(_0x2a68bf,_0x2ce44b){_0x2a68bf=_0x2a68bf-0x0;var _0x1e71dc=_0xc7c6[_0x2a68bf];return _0x1e71dc;};'use strict';var Sequelize=require('sequelize');module[_0x6c7c('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x565f=['sequelize','STRING'];(function(_0x334706,_0x9c30ec){var _0x7fc35d=function(_0x28ece0){while(--_0x28ece0){_0x334706['push'](_0x334706['shift']());}};_0x7fc35d(++_0x9c30ec);}(_0x565f,0xac));var _0xf565=function(_0x3df572,_0x261533){_0x3df572=_0x3df572-0x0;var _0x4c54ed=_0x565f[_0x3df572];return _0x4c54ed;};'use strict';var Sequelize=require(_0xf565('0x0'));module['exports']={'name':{'type':Sequelize[_0xf565('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 9178e30..3c9db3a 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 _0x36ad=['json','count','offset','limit','set','apply','reject','save','update','destroy','stack','name','send','index','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','pick','filter','merge','where','map','type','DeskConfiguration','then','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','getFields','findOne','DeskField','order','options','nolimit','getSubjects','getDescriptions','getTags','Tag','setTags','ids','html-pdf','eml-format','rimraf','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','../../mysqldb','client','http','request','info','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','result','sendStatus','status'];(function(_0x4cbaad,_0x3a27d8){var _0x334543=function(_0x3fbf5c){while(--_0x3fbf5c){_0x4cbaad['push'](_0x4cbaad['shift']());}};_0x334543(++_0x3a27d8);}(_0x36ad,0x95));var _0xd36a=function(_0xa65ba4,_0x52119f){_0xa65ba4=_0xa65ba4-0x0;var _0x45cd77=_0x36ad[_0xa65ba4];return _0x45cd77;};'use strict';var pdf=require(_0xd36a('0x0'));var emlformat=require(_0xd36a('0x1'));var rimraf=require(_0xd36a('0x2'));var zipdir=require(_0xd36a('0x3'));var jsonpatch=require(_0xd36a('0x4'));var rp=require(_0xd36a('0x5'));var moment=require('moment');var BPromise=require(_0xd36a('0x6'));var Mustache=require('mustache');var util=require(_0xd36a('0x7'));var path=require(_0xd36a('0x8'));var sox=require(_0xd36a('0x9'));var csv=require(_0xd36a('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd36a('0xb'));var squel=require(_0xd36a('0xc'));var crypto=require(_0xd36a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd36a('0xe'));var toCsv=require(_0xd36a('0xa'));var querystring=require(_0xd36a('0xf'));var Papa=require(_0xd36a('0x10'));var Redis=require(_0xd36a('0x11'));var authService=require(_0xd36a('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xd36a('0x13'));var logger=require(_0xd36a('0x14'))(_0xd36a('0x15'));var utils=require(_0xd36a('0x16'));var config=require('../../config/environment');var db=require(_0xd36a('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xd36a('0x18')][_0xd36a('0x19')]({'port':0x232a});function checkPasswordPattern(_0x2a9b5f,_0x589a1b,_0x2b1d72){if(_0x2b1d72){var _0x8eff28=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x8eff28['test'](_0x589a1b)){return _0x2a9b5f;}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 _0x2a9b5f;}}function respondWithRpcPromise(_0xdd0d01,_0x435613,_0x5afdef,_0x5289fa){return new BPromise(function(_0x458f24,_0x38beb3){var _0x187079=_0x5289fa||client;return _0x187079[_0xd36a('0x1a')](_0xdd0d01,_0x5afdef)['then'](function(_0x3b22cf){logger[_0xd36a('0x1b')]('DeskConfiguration,\x20%s,\x20%s',_0x435613,_0xd36a('0x1c'));logger[_0xd36a('0x1d')](_0xd36a('0x1e'),_0x435613,_0xd36a('0x1c'),JSON[_0xd36a('0x1f')](_0x3b22cf));if(_0x3b22cf[_0xd36a('0x20')]){if(_0x3b22cf[_0xd36a('0x20')][_0xd36a('0x21')]===0x1f4){logger[_0xd36a('0x20')](_0xd36a('0x22'),_0x435613,_0x3b22cf[_0xd36a('0x20')]['message']);return _0x38beb3(_0x3b22cf[_0xd36a('0x20')]['message']);}logger[_0xd36a('0x20')](_0xd36a('0x22'),_0x435613,_0x3b22cf['error'][_0xd36a('0x23')]);return _0x458f24(_0x3b22cf['error'][_0xd36a('0x23')]);}else{logger[_0xd36a('0x1b')](_0xd36a('0x22'),_0x435613,'request\x20sent');_0x458f24(_0x3b22cf[_0xd36a('0x24')]['message']);}})['catch'](function(_0x390b13){logger[_0xd36a('0x20')](_0xd36a('0x22'),_0x435613,_0x390b13);_0x38beb3(_0x390b13);});});}function respondWithStatusCode(_0x3df847,_0x5a19b5){_0x5a19b5=_0x5a19b5||0xcc;return function(_0x486127){if(_0x486127){return _0x3df847[_0xd36a('0x25')](_0x5a19b5);}return _0x3df847[_0xd36a('0x26')](_0x5a19b5)['end']();};}function respondWithResult(_0x2e1308,_0x5dc3a1){_0x5dc3a1=_0x5dc3a1||0xc8;return function(_0x2d229c){if(_0x2d229c){return _0x2e1308[_0xd36a('0x26')](_0x5dc3a1)[_0xd36a('0x27')](_0x2d229c);}};}function respondWithFilteredResult(_0x146f38,_0x509790){return function(_0x5e5ba8){if(_0x5e5ba8){var _0x4afefe=_0x5e5ba8[_0xd36a('0x28')],_0x1afad9=_0x509790[_0xd36a('0x29')],_0x559574=_0x509790[_0xd36a('0x29')]+_0x509790[_0xd36a('0x2a')],_0x2188ea;if(_0x559574>=_0x4afefe){_0x559574=_0x4afefe;_0x2188ea=0xc8;}else{_0x2188ea=0xce;}_0x146f38[_0xd36a('0x26')](_0x2188ea);return _0x146f38[_0xd36a('0x2b')]('Content-Range',_0x1afad9+'-'+_0x559574+'/'+_0x4afefe)[_0xd36a('0x27')](_0x5e5ba8);}return null;};}function patchUpdates(_0x3466dd){return function(_0x27b653){try{jsonpatch[_0xd36a('0x2c')](_0x27b653,_0x3466dd,!![]);}catch(_0x5745b9){return BPromise[_0xd36a('0x2d')](_0x5745b9);}return _0x27b653[_0xd36a('0x2e')]();};}function saveUpdates(_0x20fb29,_0x167577){return function(_0xb5b266){if(_0xb5b266){return _0xb5b266[_0xd36a('0x2f')](_0x20fb29)['then'](function(_0x254238){return _0x254238;});}return null;};}function removeEntity(_0x4c7f97,_0x150734){return function(_0x2ead3c){if(_0x2ead3c){return _0x2ead3c[_0xd36a('0x30')]()['then'](function(){_0x4c7f97[_0xd36a('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x203dc1,_0xe9c50b){return function(_0x261d9f){if(!_0x261d9f){_0x203dc1[_0xd36a('0x25')](0x194);}return _0x261d9f;};}function handleError(_0x55f9fe,_0x3b440d){_0x3b440d=_0x3b440d||0x1f4;return function(_0x28261e){logger['error'](_0x28261e[_0xd36a('0x31')]);if(_0x28261e['name']){delete _0x28261e[_0xd36a('0x32')];}_0x55f9fe[_0xd36a('0x26')](_0x3b440d)[_0xd36a('0x33')](_0x28261e);};}exports[_0xd36a('0x34')]=function(_0x367c72,_0x312718){var _0x98db26={},_0x101e6f={},_0x187c7c={'count':0x0,'rows':[]};var _0x4bca53=db['DeskConfiguration']['rawAttributes'];_0x101e6f[_0xd36a('0x35')]=_[_0xd36a('0x36')](_0x4bca53);_0x101e6f[_0xd36a('0x37')]=_[_0xd36a('0x36')](_0x367c72[_0xd36a('0x37')]);_0x101e6f[_0xd36a('0x38')]=_[_0xd36a('0x39')](_0x101e6f['model'],_0x101e6f[_0xd36a('0x37')]);_0x98db26['attributes']=_['intersection'](_0x101e6f[_0xd36a('0x35')],qs[_0xd36a('0x3a')](_0x367c72['query'][_0xd36a('0x3a')]));_0x98db26[_0xd36a('0x3b')]=_0x98db26[_0xd36a('0x3b')][_0xd36a('0x3c')]?_0x98db26[_0xd36a('0x3b')]:_0x101e6f[_0xd36a('0x35')];if(!_0x367c72[_0xd36a('0x37')][_0xd36a('0x3d')]('nolimit')){_0x98db26[_0xd36a('0x2a')]=qs[_0xd36a('0x2a')](_0x367c72['query'][_0xd36a('0x2a')]);_0x98db26[_0xd36a('0x29')]=qs[_0xd36a('0x29')](_0x367c72[_0xd36a('0x37')][_0xd36a('0x29')]);}_0x98db26['order']=qs[_0xd36a('0x3e')](_0x367c72[_0xd36a('0x37')][_0xd36a('0x3e')]);_0x98db26['where']=qs[_0xd36a('0x38')](_[_0xd36a('0x3f')](_0x367c72[_0xd36a('0x37')],_0x101e6f[_0xd36a('0x38')]));if(_0x367c72['query'][_0xd36a('0x40')]){_0x98db26['where']=_[_0xd36a('0x41')](_0x98db26[_0xd36a('0x42')],{'$or':_[_0xd36a('0x43')](_0x4bca53,function(_0x5d7b8a){if(_0x5d7b8a[_0xd36a('0x44')]['key']!=='VIRTUAL'){var _0x5829ca={};_0x5829ca[_0x5d7b8a['field']]={'$like':'%'+_0x367c72[_0xd36a('0x37')]['filter']+'%'};return _0x5829ca;}})});}_0x98db26=_['merge']({},_0x98db26,_0x367c72['options']);var _0x47b785={'where':_0x98db26[_0xd36a('0x42')]};return db[_0xd36a('0x45')]['count'](_0x47b785)[_0xd36a('0x46')](function(_0x1408db){_0x187c7c['count']=_0x1408db;if(_0x367c72[_0xd36a('0x37')][_0xd36a('0x47')]){_0x98db26['include']=[{'all':!![]}];}return db[_0xd36a('0x45')][_0xd36a('0x48')](_0x98db26);})[_0xd36a('0x46')](function(_0x9c2a9){_0x187c7c[_0xd36a('0x49')]=_0x9c2a9;return _0x187c7c;})[_0xd36a('0x46')](respondWithFilteredResult(_0x312718,_0x98db26))[_0xd36a('0x4a')](handleError(_0x312718,null));};exports[_0xd36a('0x4b')]=function(_0x3fbf07,_0x282633){var _0x5de0b0={'raw':![],'where':{'id':_0x3fbf07[_0xd36a('0x4c')]['id']}},_0x497d58={};_0x497d58[_0xd36a('0x35')]=_[_0xd36a('0x36')](db[_0xd36a('0x45')][_0xd36a('0x4d')]);_0x497d58[_0xd36a('0x37')]=_['keys'](_0x3fbf07[_0xd36a('0x37')]);_0x497d58['filters']=_['intersection'](_0x497d58[_0xd36a('0x35')],_0x497d58[_0xd36a('0x37')]);_0x5de0b0[_0xd36a('0x3b')]=_['intersection'](_0x497d58[_0xd36a('0x35')],qs[_0xd36a('0x3a')](_0x3fbf07[_0xd36a('0x37')][_0xd36a('0x3a')]));_0x5de0b0[_0xd36a('0x3b')]=_0x5de0b0[_0xd36a('0x3b')]['length']?_0x5de0b0[_0xd36a('0x3b')]:_0x497d58[_0xd36a('0x35')];if(_0x3fbf07[_0xd36a('0x37')][_0xd36a('0x47')]){_0x5de0b0[_0xd36a('0x4e')]=[{'all':!![]}];}_0x5de0b0=_['merge']({},_0x5de0b0,_0x3fbf07['options']);return db[_0xd36a('0x45')][_0xd36a('0x4f')](_0x5de0b0)[_0xd36a('0x46')](handleEntityNotFound(_0x282633,null))[_0xd36a('0x46')](respondWithResult(_0x282633,null))[_0xd36a('0x4a')](handleError(_0x282633,null));};exports[_0xd36a('0x50')]=function(_0x196d4a,_0x3fd696){return db[_0xd36a('0x45')][_0xd36a('0x50')](_0x196d4a[_0xd36a('0x51')],{})[_0xd36a('0x46')](respondWithResult(_0x3fd696,0xc9))['catch'](handleError(_0x3fd696,null));};exports['update']=function(_0x127402,_0x4b671a){if(_0x127402[_0xd36a('0x51')]['id']){delete _0x127402['body']['id'];}return db['DeskConfiguration'][_0xd36a('0x4f')]({'where':{'id':_0x127402[_0xd36a('0x4c')]['id']}})[_0xd36a('0x46')](handleEntityNotFound(_0x4b671a,null))['then'](saveUpdates(_0x127402['body'],null))['then'](respondWithResult(_0x4b671a,null))['catch'](handleError(_0x4b671a,null));};exports['destroy']=function(_0x1705f2,_0x5becef){return db[_0xd36a('0x45')][_0xd36a('0x4f')]({'where':{'id':_0x1705f2['params']['id']}})[_0xd36a('0x46')](handleEntityNotFound(_0x5becef,null))[_0xd36a('0x46')](removeEntity(_0x5becef,null))[_0xd36a('0x4a')](handleError(_0x5becef,null));};exports[_0xd36a('0x52')]=function(_0x2da795,_0x4cc17b,_0x2e6a89){var _0x45b673={};var _0x3029a5={};var _0x514541;var _0x413259;return db[_0xd36a('0x45')][_0xd36a('0x53')]({'where':{'id':_0x2da795[_0xd36a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4cc17b,null))[_0xd36a('0x46')](function(_0xe539ad){if(_0xe539ad){_0x514541=_0xe539ad;_0x3029a5[_0xd36a('0x35')]=_[_0xd36a('0x36')](db[_0xd36a('0x54')][_0xd36a('0x4d')]);_0x3029a5[_0xd36a('0x37')]=_['keys'](_0x2da795[_0xd36a('0x37')]);_0x3029a5[_0xd36a('0x38')]=_['intersection'](_0x3029a5[_0xd36a('0x35')],_0x3029a5['query']);_0x45b673[_0xd36a('0x3b')]=_[_0xd36a('0x39')](_0x3029a5[_0xd36a('0x35')],qs[_0xd36a('0x3a')](_0x2da795[_0xd36a('0x37')]['fields']));_0x45b673[_0xd36a('0x3b')]=_0x45b673[_0xd36a('0x3b')]['length']?_0x45b673[_0xd36a('0x3b')]:_0x3029a5['model'];_0x45b673[_0xd36a('0x55')]=qs['sort'](_0x2da795[_0xd36a('0x37')][_0xd36a('0x3e')]);_0x45b673[_0xd36a('0x42')]=qs['filters'](_[_0xd36a('0x3f')](_0x2da795[_0xd36a('0x37')],_0x3029a5[_0xd36a('0x38')]));if(_0x2da795['query'][_0xd36a('0x40')]){_0x45b673[_0xd36a('0x42')]=_[_0xd36a('0x41')](_0x45b673[_0xd36a('0x42')],{'$or':_[_0xd36a('0x43')](_0x45b673['attributes'],function(_0x58d7ad){var _0x3c679d={};_0x3c679d[_0x58d7ad]={'$like':'%'+_0x2da795[_0xd36a('0x37')][_0xd36a('0x40')]+'%'};return _0x3c679d;})});}_0x45b673=_[_0xd36a('0x41')]({},_0x45b673,_0x2da795[_0xd36a('0x56')]);return _0x514541[_0xd36a('0x52')](_0x45b673);}})[_0xd36a('0x46')](function(_0x18b1d7){if(_0x18b1d7){_0x413259=_0x18b1d7[_0xd36a('0x3c')];if(!_0x2da795[_0xd36a('0x37')]['hasOwnProperty'](_0xd36a('0x57'))){_0x45b673['limit']=qs[_0xd36a('0x2a')](_0x2da795[_0xd36a('0x37')][_0xd36a('0x2a')]);_0x45b673['offset']=qs['offset'](_0x2da795[_0xd36a('0x37')][_0xd36a('0x29')]);}return _0x514541[_0xd36a('0x52')](_0x45b673);}})[_0xd36a('0x46')](function(_0x1330c7){if(_0x1330c7){return _0x1330c7?{'count':_0x413259,'rows':_0x1330c7}:null;}})['then'](respondWithResult(_0x4cc17b,null))[_0xd36a('0x4a')](handleError(_0x4cc17b,null));};exports[_0xd36a('0x58')]=function(_0x10a919,_0x502da1,_0x376653){var _0x1e447e={};var _0x517427={};var _0x32e332;var _0x7305d1;return db[_0xd36a('0x45')]['findOne']({'where':{'id':_0x10a919[_0xd36a('0x4c')]['id']}})[_0xd36a('0x46')](handleEntityNotFound(_0x502da1,null))[_0xd36a('0x46')](function(_0x37661d){if(_0x37661d){_0x32e332=_0x37661d;_0x517427[_0xd36a('0x35')]=_[_0xd36a('0x36')](db[_0xd36a('0x54')]['rawAttributes']);_0x517427[_0xd36a('0x37')]=_[_0xd36a('0x36')](_0x10a919[_0xd36a('0x37')]);_0x517427['filters']=_[_0xd36a('0x39')](_0x517427[_0xd36a('0x35')],_0x517427[_0xd36a('0x37')]);_0x1e447e['attributes']=_[_0xd36a('0x39')](_0x517427[_0xd36a('0x35')],qs['fields'](_0x10a919[_0xd36a('0x37')]['fields']));_0x1e447e[_0xd36a('0x3b')]=_0x1e447e['attributes'][_0xd36a('0x3c')]?_0x1e447e['attributes']:_0x517427['model'];_0x1e447e[_0xd36a('0x55')]=qs[_0xd36a('0x3e')](_0x10a919[_0xd36a('0x37')]['sort']);_0x1e447e[_0xd36a('0x42')]=qs[_0xd36a('0x38')](_['pick'](_0x10a919[_0xd36a('0x37')],_0x517427[_0xd36a('0x38')]));if(_0x10a919[_0xd36a('0x37')]['filter']){_0x1e447e[_0xd36a('0x42')]=_[_0xd36a('0x41')](_0x1e447e[_0xd36a('0x42')],{'$or':_[_0xd36a('0x43')](_0x1e447e[_0xd36a('0x3b')],function(_0x2d4e25){var _0x246ddf={};_0x246ddf[_0x2d4e25]={'$like':'%'+_0x10a919[_0xd36a('0x37')][_0xd36a('0x40')]+'%'};return _0x246ddf;})});}_0x1e447e=_[_0xd36a('0x41')]({},_0x1e447e,_0x10a919[_0xd36a('0x56')]);return _0x32e332['getSubjects'](_0x1e447e);}})[_0xd36a('0x46')](function(_0x207176){if(_0x207176){_0x7305d1=_0x207176[_0xd36a('0x3c')];if(!_0x10a919[_0xd36a('0x37')][_0xd36a('0x3d')](_0xd36a('0x57'))){_0x1e447e[_0xd36a('0x2a')]=qs[_0xd36a('0x2a')](_0x10a919[_0xd36a('0x37')][_0xd36a('0x2a')]);_0x1e447e['offset']=qs[_0xd36a('0x29')](_0x10a919[_0xd36a('0x37')][_0xd36a('0x29')]);}return _0x32e332['getSubjects'](_0x1e447e);}})[_0xd36a('0x46')](function(_0x3d9743){if(_0x3d9743){return _0x3d9743?{'count':_0x7305d1,'rows':_0x3d9743}:null;}})[_0xd36a('0x46')](respondWithResult(_0x502da1,null))['catch'](handleError(_0x502da1,null));};exports[_0xd36a('0x59')]=function(_0x9535fe,_0x1fd1b3,_0x149e1f){var _0x58947f={};var _0x27bc2f={};var _0x562063;var _0x116ebe;return db[_0xd36a('0x45')][_0xd36a('0x53')]({'where':{'id':_0x9535fe[_0xd36a('0x4c')]['id']}})[_0xd36a('0x46')](handleEntityNotFound(_0x1fd1b3,null))[_0xd36a('0x46')](function(_0x3bf1de){if(_0x3bf1de){_0x562063=_0x3bf1de;_0x27bc2f[_0xd36a('0x35')]=_['keys'](db['DeskField']['rawAttributes']);_0x27bc2f[_0xd36a('0x37')]=_[_0xd36a('0x36')](_0x9535fe[_0xd36a('0x37')]);_0x27bc2f[_0xd36a('0x38')]=_[_0xd36a('0x39')](_0x27bc2f[_0xd36a('0x35')],_0x27bc2f[_0xd36a('0x37')]);_0x58947f[_0xd36a('0x3b')]=_['intersection'](_0x27bc2f[_0xd36a('0x35')],qs[_0xd36a('0x3a')](_0x9535fe[_0xd36a('0x37')][_0xd36a('0x3a')]));_0x58947f[_0xd36a('0x3b')]=_0x58947f[_0xd36a('0x3b')]['length']?_0x58947f['attributes']:_0x27bc2f['model'];_0x58947f[_0xd36a('0x55')]=qs[_0xd36a('0x3e')](_0x9535fe[_0xd36a('0x37')][_0xd36a('0x3e')]);_0x58947f[_0xd36a('0x42')]=qs[_0xd36a('0x38')](_[_0xd36a('0x3f')](_0x9535fe[_0xd36a('0x37')],_0x27bc2f['filters']));if(_0x9535fe['query'][_0xd36a('0x40')]){_0x58947f[_0xd36a('0x42')]=_[_0xd36a('0x41')](_0x58947f['where'],{'$or':_['map'](_0x58947f[_0xd36a('0x3b')],function(_0x5700e2){var _0x3844e2={};_0x3844e2[_0x5700e2]={'$like':'%'+_0x9535fe[_0xd36a('0x37')][_0xd36a('0x40')]+'%'};return _0x3844e2;})});}_0x58947f=_[_0xd36a('0x41')]({},_0x58947f,_0x9535fe[_0xd36a('0x56')]);return _0x562063[_0xd36a('0x59')](_0x58947f);}})[_0xd36a('0x46')](function(_0x44c02c){if(_0x44c02c){_0x116ebe=_0x44c02c[_0xd36a('0x3c')];if(!_0x9535fe[_0xd36a('0x37')][_0xd36a('0x3d')](_0xd36a('0x57'))){_0x58947f[_0xd36a('0x2a')]=qs['limit'](_0x9535fe[_0xd36a('0x37')][_0xd36a('0x2a')]);_0x58947f[_0xd36a('0x29')]=qs['offset'](_0x9535fe[_0xd36a('0x37')][_0xd36a('0x29')]);}return _0x562063[_0xd36a('0x59')](_0x58947f);}})[_0xd36a('0x46')](function(_0x171ca8){if(_0x171ca8){return _0x171ca8?{'count':_0x116ebe,'rows':_0x171ca8}:null;}})['then'](respondWithResult(_0x1fd1b3,null))['catch'](handleError(_0x1fd1b3,null));};exports[_0xd36a('0x5a')]=function(_0x35f841,_0x4d41c2,_0x386fdc){var _0x48a26f={};var _0x2489dd={};var _0x3d4c21;var _0x49943b;return db[_0xd36a('0x45')][_0xd36a('0x53')]({'where':{'id':_0x35f841['params']['id']}})[_0xd36a('0x46')](handleEntityNotFound(_0x4d41c2,null))[_0xd36a('0x46')](function(_0x1d3a3f){if(_0x1d3a3f){_0x3d4c21=_0x1d3a3f;_0x2489dd[_0xd36a('0x35')]=_[_0xd36a('0x36')](db[_0xd36a('0x5b')][_0xd36a('0x4d')]);_0x2489dd[_0xd36a('0x37')]=_[_0xd36a('0x36')](_0x35f841[_0xd36a('0x37')]);_0x2489dd[_0xd36a('0x38')]=_['intersection'](_0x2489dd[_0xd36a('0x35')],_0x2489dd[_0xd36a('0x37')]);_0x48a26f[_0xd36a('0x3b')]=_['intersection'](_0x2489dd[_0xd36a('0x35')],qs[_0xd36a('0x3a')](_0x35f841[_0xd36a('0x37')][_0xd36a('0x3a')]));_0x48a26f[_0xd36a('0x3b')]=_0x48a26f[_0xd36a('0x3b')][_0xd36a('0x3c')]?_0x48a26f['attributes']:_0x2489dd[_0xd36a('0x35')];_0x48a26f[_0xd36a('0x55')]=qs[_0xd36a('0x3e')](_0x35f841[_0xd36a('0x37')][_0xd36a('0x3e')]);_0x48a26f[_0xd36a('0x42')]=qs[_0xd36a('0x38')](_[_0xd36a('0x3f')](_0x35f841['query'],_0x2489dd['filters']));if(_0x35f841[_0xd36a('0x37')]['filter']){_0x48a26f[_0xd36a('0x42')]=_[_0xd36a('0x41')](_0x48a26f['where'],{'$or':_[_0xd36a('0x43')](_0x48a26f[_0xd36a('0x3b')],function(_0x5c02d5){var _0x126721={};_0x126721[_0x5c02d5]={'$like':'%'+_0x35f841[_0xd36a('0x37')][_0xd36a('0x40')]+'%'};return _0x126721;})});}_0x48a26f=_[_0xd36a('0x41')]({},_0x48a26f,_0x35f841[_0xd36a('0x56')]);return _0x3d4c21['getTags'](_0x48a26f);}})[_0xd36a('0x46')](function(_0x59be4b){if(_0x59be4b){_0x49943b=_0x59be4b[_0xd36a('0x3c')];if(!_0x35f841[_0xd36a('0x37')][_0xd36a('0x3d')](_0xd36a('0x57'))){_0x48a26f[_0xd36a('0x2a')]=qs['limit'](_0x35f841['query'][_0xd36a('0x2a')]);_0x48a26f['offset']=qs['offset'](_0x35f841[_0xd36a('0x37')][_0xd36a('0x29')]);}return _0x3d4c21[_0xd36a('0x5a')](_0x48a26f);}})['then'](function(_0x3b90b8){if(_0x3b90b8){return _0x3b90b8?{'count':_0x49943b,'rows':_0x3b90b8}:null;}})[_0xd36a('0x46')](respondWithResult(_0x4d41c2,null))[_0xd36a('0x4a')](handleError(_0x4d41c2,null));};exports[_0xd36a('0x5c')]=function(_0x375bbe,_0x1579ea,_0x36d51f){if(_0x375bbe[_0xd36a('0x51')]['id']){delete _0x375bbe[_0xd36a('0x51')]['id'];}return db[_0xd36a('0x45')][_0xd36a('0x53')]({'where':{'id':_0x375bbe['params']['id']}})[_0xd36a('0x46')](handleEntityNotFound(_0x1579ea,null))[_0xd36a('0x46')](function(_0x5359aa){if(_0x5359aa){return _0x5359aa[_0xd36a('0x5c')](_0x375bbe[_0xd36a('0x51')][_0xd36a('0x5d')]||[]);}return null;})[_0xd36a('0x46')](respondWithResult(_0x1579ea,null))[_0xd36a('0x4a')](handleError(_0x1579ea,null));}; \ No newline at end of file +var _0xd549=['nolimit','sort','where','pick','filter','merge','map','key','field','options','count','include','findAll','rows','params','includeAll','find','create','body','destroy','getFields','DeskField','order','getSubjects','findOne','getDescriptions','getTags','Tag','setTags','ids','html-pdf','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','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~!@#$%^&-_=+[{]}.','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','name','send','DeskConfiguration','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x25248b,_0x3c8491){var _0x509939=function(_0x457a27){while(--_0x457a27){_0x25248b['push'](_0x25248b['shift']());}};_0x509939(++_0x3c8491);}(_0xd549,0xde));var _0x9d54=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xd549[_0x8c43de];return _0xa6591b;};'use strict';var pdf=require(_0x9d54('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9d54('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9d54('0x2'));var moment=require(_0x9d54('0x3'));var BPromise=require(_0x9d54('0x4'));var Mustache=require(_0x9d54('0x5'));var util=require(_0x9d54('0x6'));var path=require(_0x9d54('0x7'));var sox=require(_0x9d54('0x8'));var csv=require(_0x9d54('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9d54('0xa'));var squel=require(_0x9d54('0xb'));var crypto=require(_0x9d54('0xc'));var jsforce=require(_0x9d54('0xd'));var deskjs=require(_0x9d54('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9d54('0xf'));var Papa=require(_0x9d54('0x10'));var Redis=require(_0x9d54('0x11'));var authService=require(_0x9d54('0x12'));var qs=require(_0x9d54('0x13'));var hardwareService=require(_0x9d54('0x14'));var logger=require('../../config/logger')(_0x9d54('0x15'));var utils=require(_0x9d54('0x16'));var config=require(_0x9d54('0x17'));var db=require(_0x9d54('0x18'))['db'];var jayson=require(_0x9d54('0x19'));var client=jayson[_0x9d54('0x1a')][_0x9d54('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x37bab2,_0x389a5f,_0x8ac2d5){if(_0x8ac2d5){var _0x5b3934=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5b3934['test'](_0x389a5f)){return _0x37bab2;}else{throw new Error(_0x9d54('0x1c'));}}else{return _0x37bab2;}}function respondWithRpcPromise(_0x2b2f59,_0x3e5599,_0x321c5e,_0x12db0c){return new BPromise(function(_0x560c1,_0xffcbb3){var _0x1ad5c5=_0x12db0c||client;return _0x1ad5c5['request'](_0x2b2f59,_0x321c5e)['then'](function(_0x1bbe01){logger[_0x9d54('0x1d')](_0x9d54('0x1e'),_0x3e5599,_0x9d54('0x1f'));logger[_0x9d54('0x20')](_0x9d54('0x21'),_0x3e5599,'request\x20sent',JSON[_0x9d54('0x22')](_0x1bbe01));if(_0x1bbe01[_0x9d54('0x23')]){if(_0x1bbe01[_0x9d54('0x23')][_0x9d54('0x24')]===0x1f4){logger[_0x9d54('0x23')](_0x9d54('0x1e'),_0x3e5599,_0x1bbe01['error']['message']);return _0xffcbb3(_0x1bbe01[_0x9d54('0x23')]['message']);}logger[_0x9d54('0x23')](_0x9d54('0x1e'),_0x3e5599,_0x1bbe01[_0x9d54('0x23')][_0x9d54('0x25')]);return _0x560c1(_0x1bbe01['error']['message']);}else{logger[_0x9d54('0x1d')](_0x9d54('0x1e'),_0x3e5599,'request\x20sent');_0x560c1(_0x1bbe01[_0x9d54('0x26')][_0x9d54('0x25')]);}})[_0x9d54('0x27')](function(_0x1a897e){logger[_0x9d54('0x23')](_0x9d54('0x1e'),_0x3e5599,_0x1a897e);_0xffcbb3(_0x1a897e);});});}function respondWithStatusCode(_0x7472d,_0x480051){_0x480051=_0x480051||0xcc;return function(_0x2d1d3f){if(_0x2d1d3f){return _0x7472d[_0x9d54('0x28')](_0x480051);}return _0x7472d[_0x9d54('0x29')](_0x480051)[_0x9d54('0x2a')]();};}function respondWithResult(_0x1da706,_0x1d2c55){_0x1d2c55=_0x1d2c55||0xc8;return function(_0x4c20a4){if(_0x4c20a4){return _0x1da706['status'](_0x1d2c55)[_0x9d54('0x2b')](_0x4c20a4);}};}function respondWithFilteredResult(_0x1ff003,_0x4afaf4){return function(_0x2e189d){if(_0x2e189d){var _0x50ad29=_0x2e189d['count'],_0x2042d8=_0x4afaf4[_0x9d54('0x2c')],_0x3549e9=_0x4afaf4[_0x9d54('0x2c')]+_0x4afaf4[_0x9d54('0x2d')],_0x3fb762;if(_0x3549e9>=_0x50ad29){_0x3549e9=_0x50ad29;_0x3fb762=0xc8;}else{_0x3fb762=0xce;}_0x1ff003[_0x9d54('0x29')](_0x3fb762);return _0x1ff003[_0x9d54('0x2e')](_0x9d54('0x2f'),_0x2042d8+'-'+_0x3549e9+'/'+_0x50ad29)[_0x9d54('0x2b')](_0x2e189d);}return null;};}function patchUpdates(_0x276d5d){return function(_0x15f4ff){try{jsonpatch[_0x9d54('0x30')](_0x15f4ff,_0x276d5d,!![]);}catch(_0x137a64){return BPromise[_0x9d54('0x31')](_0x137a64);}return _0x15f4ff[_0x9d54('0x32')]();};}function saveUpdates(_0x70c104,_0x1317e2){return function(_0x45d166){if(_0x45d166){return _0x45d166[_0x9d54('0x33')](_0x70c104)['then'](function(_0x5c8e3b){return _0x5c8e3b;});}return null;};}function removeEntity(_0x14811c,_0x389b09){return function(_0x37ea86){if(_0x37ea86){return _0x37ea86['destroy']()[_0x9d54('0x34')](function(){_0x14811c[_0x9d54('0x29')](0xcc)[_0x9d54('0x2a')]();});}};}function handleEntityNotFound(_0xee92d6,_0x16c5ad){return function(_0x4a7d65){if(!_0x4a7d65){_0xee92d6['sendStatus'](0x194);}return _0x4a7d65;};}function handleError(_0x5ce411,_0x2163d5){_0x2163d5=_0x2163d5||0x1f4;return function(_0x52b5c7){logger[_0x9d54('0x23')](_0x52b5c7['stack']);if(_0x52b5c7[_0x9d54('0x35')]){delete _0x52b5c7[_0x9d54('0x35')];}_0x5ce411[_0x9d54('0x29')](_0x2163d5)[_0x9d54('0x36')](_0x52b5c7);};}exports['index']=function(_0x4a35f4,_0x542133){var _0x592616={},_0x4f99bd={},_0x3ee248={'count':0x0,'rows':[]};var _0x2db191=db[_0x9d54('0x37')][_0x9d54('0x38')];_0x4f99bd[_0x9d54('0x39')]=_[_0x9d54('0x3a')](_0x2db191);_0x4f99bd[_0x9d54('0x3b')]=_[_0x9d54('0x3a')](_0x4a35f4[_0x9d54('0x3b')]);_0x4f99bd[_0x9d54('0x3c')]=_[_0x9d54('0x3d')](_0x4f99bd[_0x9d54('0x39')],_0x4f99bd[_0x9d54('0x3b')]);_0x592616[_0x9d54('0x3e')]=_[_0x9d54('0x3d')](_0x4f99bd['model'],qs[_0x9d54('0x3f')](_0x4a35f4['query'][_0x9d54('0x3f')]));_0x592616[_0x9d54('0x3e')]=_0x592616[_0x9d54('0x3e')][_0x9d54('0x40')]?_0x592616[_0x9d54('0x3e')]:_0x4f99bd[_0x9d54('0x39')];if(!_0x4a35f4[_0x9d54('0x3b')][_0x9d54('0x41')](_0x9d54('0x42'))){_0x592616['limit']=qs[_0x9d54('0x2d')](_0x4a35f4[_0x9d54('0x3b')][_0x9d54('0x2d')]);_0x592616[_0x9d54('0x2c')]=qs[_0x9d54('0x2c')](_0x4a35f4[_0x9d54('0x3b')][_0x9d54('0x2c')]);}_0x592616['order']=qs[_0x9d54('0x43')](_0x4a35f4[_0x9d54('0x3b')][_0x9d54('0x43')]);_0x592616[_0x9d54('0x44')]=qs[_0x9d54('0x3c')](_[_0x9d54('0x45')](_0x4a35f4[_0x9d54('0x3b')],_0x4f99bd[_0x9d54('0x3c')]));if(_0x4a35f4[_0x9d54('0x3b')][_0x9d54('0x46')]){_0x592616[_0x9d54('0x44')]=_[_0x9d54('0x47')](_0x592616[_0x9d54('0x44')],{'$or':_[_0x9d54('0x48')](_0x2db191,function(_0x248681){if(_0x248681['type'][_0x9d54('0x49')]!=='VIRTUAL'){var _0x51ff41={};_0x51ff41[_0x248681[_0x9d54('0x4a')]]={'$like':'%'+_0x4a35f4[_0x9d54('0x3b')][_0x9d54('0x46')]+'%'};return _0x51ff41;}})});}_0x592616=_[_0x9d54('0x47')]({},_0x592616,_0x4a35f4[_0x9d54('0x4b')]);var _0x18a323={'where':_0x592616[_0x9d54('0x44')]};return db['DeskConfiguration'][_0x9d54('0x4c')](_0x18a323)[_0x9d54('0x34')](function(_0x5b9235){_0x3ee248[_0x9d54('0x4c')]=_0x5b9235;if(_0x4a35f4[_0x9d54('0x3b')]['includeAll']){_0x592616[_0x9d54('0x4d')]=[{'all':!![]}];}return db[_0x9d54('0x37')][_0x9d54('0x4e')](_0x592616);})[_0x9d54('0x34')](function(_0x5c1650){_0x3ee248[_0x9d54('0x4f')]=_0x5c1650;return _0x3ee248;})['then'](respondWithFilteredResult(_0x542133,_0x592616))[_0x9d54('0x27')](handleError(_0x542133,null));};exports['show']=function(_0x9b1518,_0x230544){var _0x37e7b1={'raw':![],'where':{'id':_0x9b1518[_0x9d54('0x50')]['id']}},_0x413cff={};_0x413cff['model']=_[_0x9d54('0x3a')](db['DeskConfiguration'][_0x9d54('0x38')]);_0x413cff[_0x9d54('0x3b')]=_[_0x9d54('0x3a')](_0x9b1518[_0x9d54('0x3b')]);_0x413cff[_0x9d54('0x3c')]=_[_0x9d54('0x3d')](_0x413cff[_0x9d54('0x39')],_0x413cff[_0x9d54('0x3b')]);_0x37e7b1[_0x9d54('0x3e')]=_['intersection'](_0x413cff[_0x9d54('0x39')],qs[_0x9d54('0x3f')](_0x9b1518[_0x9d54('0x3b')]['fields']));_0x37e7b1['attributes']=_0x37e7b1[_0x9d54('0x3e')][_0x9d54('0x40')]?_0x37e7b1[_0x9d54('0x3e')]:_0x413cff[_0x9d54('0x39')];if(_0x9b1518['query'][_0x9d54('0x51')]){_0x37e7b1[_0x9d54('0x4d')]=[{'all':!![]}];}_0x37e7b1=_[_0x9d54('0x47')]({},_0x37e7b1,_0x9b1518['options']);return db['DeskConfiguration'][_0x9d54('0x52')](_0x37e7b1)[_0x9d54('0x34')](handleEntityNotFound(_0x230544,null))['then'](respondWithResult(_0x230544,null))[_0x9d54('0x27')](handleError(_0x230544,null));};exports[_0x9d54('0x53')]=function(_0x2b8d61,_0xe243a){return db['DeskConfiguration']['create'](_0x2b8d61[_0x9d54('0x54')],{})[_0x9d54('0x34')](respondWithResult(_0xe243a,0xc9))[_0x9d54('0x27')](handleError(_0xe243a,null));};exports[_0x9d54('0x33')]=function(_0x5b2d8f,_0xe8c2d3){if(_0x5b2d8f[_0x9d54('0x54')]['id']){delete _0x5b2d8f[_0x9d54('0x54')]['id'];}return db['DeskConfiguration'][_0x9d54('0x52')]({'where':{'id':_0x5b2d8f[_0x9d54('0x50')]['id']}})[_0x9d54('0x34')](handleEntityNotFound(_0xe8c2d3,null))[_0x9d54('0x34')](saveUpdates(_0x5b2d8f[_0x9d54('0x54')],null))[_0x9d54('0x34')](respondWithResult(_0xe8c2d3,null))[_0x9d54('0x27')](handleError(_0xe8c2d3,null));};exports[_0x9d54('0x55')]=function(_0x230382,_0x159c83){return db['DeskConfiguration'][_0x9d54('0x52')]({'where':{'id':_0x230382[_0x9d54('0x50')]['id']}})['then'](handleEntityNotFound(_0x159c83,null))[_0x9d54('0x34')](removeEntity(_0x159c83,null))[_0x9d54('0x27')](handleError(_0x159c83,null));};exports[_0x9d54('0x56')]=function(_0x1135d4,_0x22d96a,_0x58caaa){var _0x131bb5={};var _0xc91a0a={};var _0x707872;var _0x23f239;return db['DeskConfiguration']['findOne']({'where':{'id':_0x1135d4[_0x9d54('0x50')]['id']}})[_0x9d54('0x34')](handleEntityNotFound(_0x22d96a,null))[_0x9d54('0x34')](function(_0x2f52c2){if(_0x2f52c2){_0x707872=_0x2f52c2;_0xc91a0a[_0x9d54('0x39')]=_[_0x9d54('0x3a')](db[_0x9d54('0x57')][_0x9d54('0x38')]);_0xc91a0a[_0x9d54('0x3b')]=_[_0x9d54('0x3a')](_0x1135d4['query']);_0xc91a0a[_0x9d54('0x3c')]=_[_0x9d54('0x3d')](_0xc91a0a[_0x9d54('0x39')],_0xc91a0a['query']);_0x131bb5['attributes']=_[_0x9d54('0x3d')](_0xc91a0a['model'],qs[_0x9d54('0x3f')](_0x1135d4['query'][_0x9d54('0x3f')]));_0x131bb5[_0x9d54('0x3e')]=_0x131bb5['attributes'][_0x9d54('0x40')]?_0x131bb5[_0x9d54('0x3e')]:_0xc91a0a[_0x9d54('0x39')];_0x131bb5[_0x9d54('0x58')]=qs[_0x9d54('0x43')](_0x1135d4[_0x9d54('0x3b')]['sort']);_0x131bb5[_0x9d54('0x44')]=qs[_0x9d54('0x3c')](_['pick'](_0x1135d4[_0x9d54('0x3b')],_0xc91a0a[_0x9d54('0x3c')]));if(_0x1135d4[_0x9d54('0x3b')][_0x9d54('0x46')]){_0x131bb5[_0x9d54('0x44')]=_[_0x9d54('0x47')](_0x131bb5[_0x9d54('0x44')],{'$or':_[_0x9d54('0x48')](_0x131bb5[_0x9d54('0x3e')],function(_0x13e89b){var _0x1231ed={};_0x1231ed[_0x13e89b]={'$like':'%'+_0x1135d4[_0x9d54('0x3b')][_0x9d54('0x46')]+'%'};return _0x1231ed;})});}_0x131bb5=_[_0x9d54('0x47')]({},_0x131bb5,_0x1135d4['options']);return _0x707872['getFields'](_0x131bb5);}})[_0x9d54('0x34')](function(_0xb14093){if(_0xb14093){_0x23f239=_0xb14093[_0x9d54('0x40')];if(!_0x1135d4[_0x9d54('0x3b')][_0x9d54('0x41')](_0x9d54('0x42'))){_0x131bb5[_0x9d54('0x2d')]=qs[_0x9d54('0x2d')](_0x1135d4['query']['limit']);_0x131bb5[_0x9d54('0x2c')]=qs['offset'](_0x1135d4['query']['offset']);}return _0x707872['getFields'](_0x131bb5);}})[_0x9d54('0x34')](function(_0x23265b){if(_0x23265b){return _0x23265b?{'count':_0x23f239,'rows':_0x23265b}:null;}})[_0x9d54('0x34')](respondWithResult(_0x22d96a,null))[_0x9d54('0x27')](handleError(_0x22d96a,null));};exports[_0x9d54('0x59')]=function(_0x322e17,_0x4c6d30,_0x5aa223){var _0x143eb0={};var _0xdf4310={};var _0x592dfa;var _0x3f1279;return db[_0x9d54('0x37')][_0x9d54('0x5a')]({'where':{'id':_0x322e17[_0x9d54('0x50')]['id']}})[_0x9d54('0x34')](handleEntityNotFound(_0x4c6d30,null))['then'](function(_0x2b0b84){if(_0x2b0b84){_0x592dfa=_0x2b0b84;_0xdf4310['model']=_['keys'](db[_0x9d54('0x57')][_0x9d54('0x38')]);_0xdf4310['query']=_[_0x9d54('0x3a')](_0x322e17[_0x9d54('0x3b')]);_0xdf4310[_0x9d54('0x3c')]=_['intersection'](_0xdf4310['model'],_0xdf4310[_0x9d54('0x3b')]);_0x143eb0[_0x9d54('0x3e')]=_[_0x9d54('0x3d')](_0xdf4310[_0x9d54('0x39')],qs['fields'](_0x322e17['query']['fields']));_0x143eb0[_0x9d54('0x3e')]=_0x143eb0['attributes'][_0x9d54('0x40')]?_0x143eb0[_0x9d54('0x3e')]:_0xdf4310['model'];_0x143eb0['order']=qs[_0x9d54('0x43')](_0x322e17[_0x9d54('0x3b')][_0x9d54('0x43')]);_0x143eb0[_0x9d54('0x44')]=qs[_0x9d54('0x3c')](_[_0x9d54('0x45')](_0x322e17[_0x9d54('0x3b')],_0xdf4310[_0x9d54('0x3c')]));if(_0x322e17[_0x9d54('0x3b')][_0x9d54('0x46')]){_0x143eb0['where']=_[_0x9d54('0x47')](_0x143eb0[_0x9d54('0x44')],{'$or':_[_0x9d54('0x48')](_0x143eb0[_0x9d54('0x3e')],function(_0x158421){var _0x235cfd={};_0x235cfd[_0x158421]={'$like':'%'+_0x322e17['query']['filter']+'%'};return _0x235cfd;})});}_0x143eb0=_['merge']({},_0x143eb0,_0x322e17[_0x9d54('0x4b')]);return _0x592dfa[_0x9d54('0x59')](_0x143eb0);}})[_0x9d54('0x34')](function(_0xba846){if(_0xba846){_0x3f1279=_0xba846[_0x9d54('0x40')];if(!_0x322e17[_0x9d54('0x3b')][_0x9d54('0x41')](_0x9d54('0x42'))){_0x143eb0[_0x9d54('0x2d')]=qs[_0x9d54('0x2d')](_0x322e17['query'][_0x9d54('0x2d')]);_0x143eb0[_0x9d54('0x2c')]=qs[_0x9d54('0x2c')](_0x322e17[_0x9d54('0x3b')][_0x9d54('0x2c')]);}return _0x592dfa['getSubjects'](_0x143eb0);}})[_0x9d54('0x34')](function(_0xe889db){if(_0xe889db){return _0xe889db?{'count':_0x3f1279,'rows':_0xe889db}:null;}})[_0x9d54('0x34')](respondWithResult(_0x4c6d30,null))['catch'](handleError(_0x4c6d30,null));};exports[_0x9d54('0x5b')]=function(_0x4aa6d3,_0x1c9c7c,_0x14c93a){var _0x1a752a={};var _0x4014e6={};var _0x166737;var _0x5b635b;return db[_0x9d54('0x37')][_0x9d54('0x5a')]({'where':{'id':_0x4aa6d3[_0x9d54('0x50')]['id']}})[_0x9d54('0x34')](handleEntityNotFound(_0x1c9c7c,null))['then'](function(_0x483bdc){if(_0x483bdc){_0x166737=_0x483bdc;_0x4014e6[_0x9d54('0x39')]=_[_0x9d54('0x3a')](db[_0x9d54('0x57')]['rawAttributes']);_0x4014e6[_0x9d54('0x3b')]=_[_0x9d54('0x3a')](_0x4aa6d3[_0x9d54('0x3b')]);_0x4014e6['filters']=_[_0x9d54('0x3d')](_0x4014e6[_0x9d54('0x39')],_0x4014e6['query']);_0x1a752a[_0x9d54('0x3e')]=_[_0x9d54('0x3d')](_0x4014e6[_0x9d54('0x39')],qs['fields'](_0x4aa6d3['query']['fields']));_0x1a752a['attributes']=_0x1a752a[_0x9d54('0x3e')][_0x9d54('0x40')]?_0x1a752a[_0x9d54('0x3e')]:_0x4014e6[_0x9d54('0x39')];_0x1a752a['order']=qs['sort'](_0x4aa6d3[_0x9d54('0x3b')][_0x9d54('0x43')]);_0x1a752a[_0x9d54('0x44')]=qs['filters'](_[_0x9d54('0x45')](_0x4aa6d3[_0x9d54('0x3b')],_0x4014e6[_0x9d54('0x3c')]));if(_0x4aa6d3['query'][_0x9d54('0x46')]){_0x1a752a[_0x9d54('0x44')]=_['merge'](_0x1a752a[_0x9d54('0x44')],{'$or':_[_0x9d54('0x48')](_0x1a752a['attributes'],function(_0x16a0a5){var _0x3ae57d={};_0x3ae57d[_0x16a0a5]={'$like':'%'+_0x4aa6d3[_0x9d54('0x3b')][_0x9d54('0x46')]+'%'};return _0x3ae57d;})});}_0x1a752a=_[_0x9d54('0x47')]({},_0x1a752a,_0x4aa6d3[_0x9d54('0x4b')]);return _0x166737[_0x9d54('0x5b')](_0x1a752a);}})[_0x9d54('0x34')](function(_0x54e9ea){if(_0x54e9ea){_0x5b635b=_0x54e9ea[_0x9d54('0x40')];if(!_0x4aa6d3[_0x9d54('0x3b')][_0x9d54('0x41')](_0x9d54('0x42'))){_0x1a752a['limit']=qs[_0x9d54('0x2d')](_0x4aa6d3['query'][_0x9d54('0x2d')]);_0x1a752a['offset']=qs['offset'](_0x4aa6d3[_0x9d54('0x3b')][_0x9d54('0x2c')]);}return _0x166737[_0x9d54('0x5b')](_0x1a752a);}})['then'](function(_0x296daa){if(_0x296daa){return _0x296daa?{'count':_0x5b635b,'rows':_0x296daa}:null;}})[_0x9d54('0x34')](respondWithResult(_0x1c9c7c,null))[_0x9d54('0x27')](handleError(_0x1c9c7c,null));};exports[_0x9d54('0x5c')]=function(_0x1cb6a7,_0x13693b,_0x2b3dcf){var _0x2750ba={};var _0x3be80a={};var _0x243868;var _0x4542df;return db[_0x9d54('0x37')][_0x9d54('0x5a')]({'where':{'id':_0x1cb6a7[_0x9d54('0x50')]['id']}})[_0x9d54('0x34')](handleEntityNotFound(_0x13693b,null))[_0x9d54('0x34')](function(_0x320005){if(_0x320005){_0x243868=_0x320005;_0x3be80a['model']=_[_0x9d54('0x3a')](db[_0x9d54('0x5d')][_0x9d54('0x38')]);_0x3be80a[_0x9d54('0x3b')]=_['keys'](_0x1cb6a7[_0x9d54('0x3b')]);_0x3be80a[_0x9d54('0x3c')]=_[_0x9d54('0x3d')](_0x3be80a['model'],_0x3be80a['query']);_0x2750ba['attributes']=_['intersection'](_0x3be80a[_0x9d54('0x39')],qs[_0x9d54('0x3f')](_0x1cb6a7[_0x9d54('0x3b')]['fields']));_0x2750ba[_0x9d54('0x3e')]=_0x2750ba[_0x9d54('0x3e')][_0x9d54('0x40')]?_0x2750ba[_0x9d54('0x3e')]:_0x3be80a[_0x9d54('0x39')];_0x2750ba[_0x9d54('0x58')]=qs['sort'](_0x1cb6a7[_0x9d54('0x3b')]['sort']);_0x2750ba[_0x9d54('0x44')]=qs[_0x9d54('0x3c')](_['pick'](_0x1cb6a7[_0x9d54('0x3b')],_0x3be80a[_0x9d54('0x3c')]));if(_0x1cb6a7[_0x9d54('0x3b')][_0x9d54('0x46')]){_0x2750ba['where']=_[_0x9d54('0x47')](_0x2750ba[_0x9d54('0x44')],{'$or':_[_0x9d54('0x48')](_0x2750ba[_0x9d54('0x3e')],function(_0x37064f){var _0x166e36={};_0x166e36[_0x37064f]={'$like':'%'+_0x1cb6a7[_0x9d54('0x3b')]['filter']+'%'};return _0x166e36;})});}_0x2750ba=_[_0x9d54('0x47')]({},_0x2750ba,_0x1cb6a7[_0x9d54('0x4b')]);return _0x243868[_0x9d54('0x5c')](_0x2750ba);}})['then'](function(_0x591cb2){if(_0x591cb2){_0x4542df=_0x591cb2['length'];if(!_0x1cb6a7[_0x9d54('0x3b')][_0x9d54('0x41')](_0x9d54('0x42'))){_0x2750ba[_0x9d54('0x2d')]=qs[_0x9d54('0x2d')](_0x1cb6a7[_0x9d54('0x3b')][_0x9d54('0x2d')]);_0x2750ba['offset']=qs['offset'](_0x1cb6a7[_0x9d54('0x3b')]['offset']);}return _0x243868['getTags'](_0x2750ba);}})['then'](function(_0x1c6266){if(_0x1c6266){return _0x1c6266?{'count':_0x4542df,'rows':_0x1c6266}:null;}})['then'](respondWithResult(_0x13693b,null))[_0x9d54('0x27')](handleError(_0x13693b,null));};exports[_0x9d54('0x5e')]=function(_0x31ad2f,_0x35cb36,_0x441c7b){if(_0x31ad2f[_0x9d54('0x54')]['id']){delete _0x31ad2f[_0x9d54('0x54')]['id'];}return db[_0x9d54('0x37')][_0x9d54('0x5a')]({'where':{'id':_0x31ad2f[_0x9d54('0x50')]['id']}})[_0x9d54('0x34')](handleEntityNotFound(_0x35cb36,null))['then'](function(_0x190e25){if(_0x190e25){return _0x190e25[_0x9d54('0x5e')](_0x31ad2f[_0x9d54('0x54')][_0x9d54('0x5f')]||[]);}return null;})[_0x9d54('0x34')](respondWithResult(_0x35cb36,null))[_0x9d54('0x27')](handleError(_0x35cb36,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 2a30e9c..87d4a05 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 _0xa6b8=['api','request-promise','rimraf','../../config/environment','define','DeskConfiguration','lodash','util','../../config/logger'];(function(_0x1180f5,_0x155d48){var _0x11ee45=function(_0x4a4be1){while(--_0x4a4be1){_0x1180f5['push'](_0x1180f5['shift']());}};_0x11ee45(++_0x155d48);}(_0xa6b8,0x96));var _0x8a6b=function(_0x3267c1,_0x3a147c){_0x3267c1=_0x3267c1-0x0;var _0x19dd2a=_0xa6b8[_0x3267c1];return _0x19dd2a;};'use strict';var _=require(_0x8a6b('0x0'));var util=require(_0x8a6b('0x1'));var logger=require(_0x8a6b('0x2'))(_0x8a6b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8a6b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8a6b('0x5'));var config=require(_0x8a6b('0x6'));var attributes=require('./intDeskConfiguration.attributes');module['exports']=function(_0x254a5a,_0x16bbb0){return _0x254a5a[_0x8a6b('0x7')](_0x8a6b('0x8'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x32ad=['bluebird','request-promise','path','rimraf','../../config/environment','define','DeskConfiguration','int_desk_configurations','util','../../config/logger','api','moment'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x32ad,0x128));var _0xd32a=function(_0x4cc08a,_0x599939){_0x4cc08a=_0x4cc08a-0x0;var _0x22051e=_0x32ad[_0x4cc08a];return _0x22051e;};'use strict';var _=require('lodash');var util=require(_0xd32a('0x0'));var logger=require(_0xd32a('0x1'))(_0xd32a('0x2'));var moment=require(_0xd32a('0x3'));var BPromise=require(_0xd32a('0x4'));var rp=require(_0xd32a('0x5'));var fs=require('fs');var path=require(_0xd32a('0x6'));var rimraf=require(_0xd32a('0x7'));var config=require(_0xd32a('0x8'));var attributes=require('./intDeskConfiguration.attributes');module['exports']=function(_0x402615,_0x4fc2e4){return _0x402615[_0xd32a('0x9')](_0xd32a('0xa'),attributes,{'tableName':_0xd32a('0xb'),'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 dbfa3c5..0d7d89b 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 _0xda19=['error','message','info','result','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x21d904,_0x13c787){var _0x18e648=function(_0x14d59c){while(--_0x14d59c){_0x21d904['push'](_0x21d904['shift']());}};_0x18e648(++_0x13c787);}(_0xda19,0xd5));var _0x9da1=function(_0x310a9a,_0x42b147){_0x310a9a=_0x310a9a-0x0;var _0xb02d79=_0xda19[_0x310a9a];return _0xb02d79;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var moment=require(_0x9da1('0x1'));var BPromise=require('bluebird');var rs=require(_0x9da1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9da1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9da1('0x4'))(_0x9da1('0x5'));var config=require(_0x9da1('0x6'));var jayson=require(_0x9da1('0x7'));var client=jayson[_0x9da1('0x8')][_0x9da1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23e4f7,_0x2c3cdd,_0x1c24e6){return new BPromise(function(_0x5e2d18,_0x47df89){return client['request'](_0x23e4f7,_0x1c24e6)['then'](function(_0x417312){logger['info'](_0x9da1('0xa'),_0x2c3cdd,_0x9da1('0xb'));logger[_0x9da1('0xc')](_0x9da1('0xd'),_0x2c3cdd,_0x9da1('0xb'),JSON[_0x9da1('0xe')](_0x417312));if(_0x417312[_0x9da1('0xf')]){if(_0x417312['error']['code']===0x1f4){logger[_0x9da1('0xf')]('DeskConfiguration,\x20%s,\x20%s',_0x2c3cdd,_0x417312[_0x9da1('0xf')][_0x9da1('0x10')]);return _0x47df89(_0x417312[_0x9da1('0xf')][_0x9da1('0x10')]);}logger['error'](_0x9da1('0xa'),_0x2c3cdd,_0x417312['error']['message']);return _0x5e2d18(_0x417312[_0x9da1('0xf')]['message']);}else{logger[_0x9da1('0x11')](_0x9da1('0xa'),_0x2c3cdd,_0x9da1('0xb'));_0x5e2d18(_0x417312[_0x9da1('0x12')][_0x9da1('0x10')]);}})['catch'](function(_0x16f75a){logger[_0x9da1('0xf')](_0x9da1('0xa'),_0x2c3cdd,_0x16f75a);_0x47df89(_0x16f75a);});});} \ No newline at end of file +var _0x4819=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','DeskConfiguration,\x20%s,\x20%s','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','util','moment'];(function(_0x4f78a8,_0x5e7afd){var _0x46f268=function(_0x5ee6d5){while(--_0x5ee6d5){_0x4f78a8['push'](_0x4f78a8['shift']());}};_0x46f268(++_0x5e7afd);}(_0x4819,0xcd));var _0x9481=function(_0x21bfab,_0x2fee48){_0x21bfab=_0x21bfab-0x0;var _0x4db318=_0x4819[_0x21bfab];return _0x4db318;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var moment=require(_0x9481('0x1'));var BPromise=require(_0x9481('0x2'));var rs=require(_0x9481('0x3'));var fs=require('fs');var Redis=require(_0x9481('0x4'));var db=require(_0x9481('0x5'))['db'];var utils=require(_0x9481('0x6'));var logger=require(_0x9481('0x7'))(_0x9481('0x8'));var config=require(_0x9481('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9481('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54cc78,_0x14e05a,_0x6c6a08){return new BPromise(function(_0x27c033,_0x3278ff){return client[_0x9481('0xb')](_0x54cc78,_0x6c6a08)['then'](function(_0x1818cf){logger['info'](_0x9481('0xc'),_0x14e05a,'request\x20sent');logger[_0x9481('0xd')](_0x9481('0xe'),_0x14e05a,_0x9481('0xf'),JSON[_0x9481('0x10')](_0x1818cf));if(_0x1818cf[_0x9481('0x11')]){if(_0x1818cf[_0x9481('0x11')][_0x9481('0x12')]===0x1f4){logger[_0x9481('0x11')](_0x9481('0xc'),_0x14e05a,_0x1818cf['error']['message']);return _0x3278ff(_0x1818cf[_0x9481('0x11')][_0x9481('0x13')]);}logger[_0x9481('0x11')](_0x9481('0xc'),_0x14e05a,_0x1818cf[_0x9481('0x11')][_0x9481('0x13')]);return _0x27c033(_0x1818cf[_0x9481('0x11')]['message']);}else{logger[_0x9481('0x14')](_0x9481('0xc'),_0x14e05a,'request\x20sent');_0x27c033(_0x1818cf[_0x9481('0x15')]['message']);}})[_0x9481('0x16')](function(_0x7a2ac8){logger[_0x9481('0x11')](_0x9481('0xc'),_0x14e05a,_0x7a2ac8);_0x3278ff(_0x7a2ac8);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 807b2bc..cbefb31 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 _0x4c9e=['connect-timeout','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','index','/:id','isAuthenticated','show','create','update','delete','destroy','exports','util','path'];(function(_0x1ce591,_0x1a01e6){var _0x18f886=function(_0x3a2779){while(--_0x3a2779){_0x1ce591['push'](_0x1ce591['shift']());}};_0x18f886(++_0x1a01e6);}(_0x4c9e,0x1ae));var _0xe4c9=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x4c9e[_0x5783f4];return _0x28e380;};'use strict';var multer=require('multer');var util=require(_0xe4c9('0x0'));var path=require(_0xe4c9('0x1'));var timeout=require(_0xe4c9('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xe4c9('0x3'));var config=require(_0xe4c9('0x4'));var controller=require(_0xe4c9('0x5'));router[_0xe4c9('0x6')]('/',auth['isAuthenticated'](),controller[_0xe4c9('0x7')]);router['get'](_0xe4c9('0x8'),auth[_0xe4c9('0x9')](),controller[_0xe4c9('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe4c9('0xb')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xe4c9('0xc')]);router[_0xe4c9('0xd')](_0xe4c9('0x8'),auth[_0xe4c9('0x9')](),controller[_0xe4c9('0xe')]);module[_0xe4c9('0xf')]=router; \ No newline at end of file +var _0x054d=['get','isAuthenticated','/:id','show','create','put','update','destroy','exports','multer','util','Router','../../components/interaction/service','../../config/environment','./intDeskField.controller'];(function(_0x5f5eb2,_0x3868f5){var _0x58df87=function(_0x91d228){while(--_0x91d228){_0x5f5eb2['push'](_0x5f5eb2['shift']());}};_0x58df87(++_0x3868f5);}(_0x054d,0x9f));var _0xd054=function(_0xc7dc2c,_0x37d4bc){_0xc7dc2c=_0xc7dc2c-0x0;var _0x29bfc4=_0x054d[_0xc7dc2c];return _0x29bfc4;};'use strict';var multer=require(_0xd054('0x0'));var util=require(_0xd054('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd054('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xd054('0x3'));var config=require(_0xd054('0x4'));var controller=require(_0xd054('0x5'));router[_0xd054('0x6')]('/',auth[_0xd054('0x7')](),controller['index']);router['get'](_0xd054('0x8'),auth[_0xd054('0x7')](),controller[_0xd054('0x9')]);router['post']('/',auth[_0xd054('0x7')](),controller[_0xd054('0xa')]);router[_0xd054('0xb')](_0xd054('0x8'),auth[_0xd054('0x7')](),controller[_0xd054('0xc')]);router['delete'](_0xd054('0x8'),auth[_0xd054('0x7')](),controller[_0xd054('0xd')]);module[_0xd054('0xe')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 1b7e92a..4fe0c63 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 _0x9ffd=['exports','ENUM','variable','customVariable','keyValue','string','STRING','BOOLEAN','sequelize'];(function(_0x492110,_0x4bb79c){var _0x37a1c8=function(_0x372a4c){while(--_0x372a4c){_0x492110['push'](_0x492110['shift']());}};_0x37a1c8(++_0x4bb79c);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x41d120,_0x13802a){_0x41d120=_0x41d120-0x0;var _0x34b1dd=_0x9ffd[_0x41d120];return _0x34b1dd;};'use strict';var Sequelize=require(_0xd9ff('0x0'));module[_0xd9ff('0x1')]={'type':{'type':Sequelize[_0xd9ff('0x2')]('string',_0xd9ff('0x3'),_0xd9ff('0x4'),_0xd9ff('0x5')),'defaultValue':_0xd9ff('0x6')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xd9ff('0x7')]},'keyType':{'type':Sequelize[_0xd9ff('0x2')]('string',_0xd9ff('0x3'),_0xd9ff('0x4'))},'keyContent':{'type':Sequelize[_0xd9ff('0x7')]},'idField':{'type':Sequelize[_0xd9ff('0x7')]},'nameField':{'type':Sequelize[_0xd9ff('0x7')]},'customField':{'type':Sequelize[_0xd9ff('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd9ff('0x7')]}}; \ No newline at end of file +var _0xd8b0=['keyValue','string','STRING','variable','BOOLEAN','sequelize','exports','customVariable'];(function(_0x4434bc,_0x6680bd){var _0x39f43d=function(_0x3cf342){while(--_0x3cf342){_0x4434bc['push'](_0x4434bc['shift']());}};_0x39f43d(++_0x6680bd);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable',_0x0d8b('0x2'),_0x0d8b('0x3')),'defaultValue':_0x0d8b('0x4')},'content':{'type':Sequelize[_0x0d8b('0x5')]},'key':{'type':Sequelize[_0x0d8b('0x5')]},'keyType':{'type':Sequelize['ENUM']('string',_0x0d8b('0x6'),_0x0d8b('0x2'))},'keyContent':{'type':Sequelize[_0x0d8b('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x0d8b('0x5')]},'customField':{'type':Sequelize[_0x0d8b('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 5c7bb12..8f8190a 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 _0x998f=['moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','apply','reject','then','destroy','sendStatus','stack','name','send','DeskField','keys','filters','intersection','model','query','fields','attributes','length','nolimit','order','sort','where','filter','map','type','key','field','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x3d27ac,_0x208227){var _0x17e1ae=function(_0x3aa519){while(--_0x3aa519){_0x3d27ac['push'](_0x3d27ac['shift']());}};_0x17e1ae(++_0x208227);}(_0x998f,0x150));var _0xf998=function(_0x56025c,_0x296025){_0x56025c=_0x56025c-0x0;var _0x11755c=_0x998f[_0x56025c];return _0x11755c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf998('0x0'));var rimraf=require(_0xf998('0x1'));var zipdir=require(_0xf998('0x2'));var jsonpatch=require(_0xf998('0x3'));var rp=require('request-promise');var moment=require(_0xf998('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf998('0x5'));var path=require(_0xf998('0x6'));var sox=require(_0xf998('0x7'));var csv=require(_0xf998('0x8'));var ejs=require(_0xf998('0x9'));var fs=require('fs');var _=require(_0xf998('0xa'));var squel=require(_0xf998('0xb'));var crypto=require(_0xf998('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf998('0xd'));var toCsv=require(_0xf998('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf998('0xe'));var authService=require(_0xf998('0xf'));var qs=require(_0xf998('0x10'));var hardwareService=require(_0xf998('0x11'));var logger=require('../../config/logger')(_0xf998('0x12'));var utils=require(_0xf998('0x13'));var config=require(_0xf998('0x14'));var db=require(_0xf998('0x15'))['db'];function respondWithStatusCode(_0x2d827c,_0x52fe82){_0x52fe82=_0x52fe82||0xcc;return function(_0x493c1c){if(_0x493c1c){return _0x2d827c['sendStatus'](_0x52fe82);}return _0x2d827c[_0xf998('0x16')](_0x52fe82)[_0xf998('0x17')]();};}function respondWithResult(_0x884907,_0x264396){_0x264396=_0x264396||0xc8;return function(_0x4f509d){if(_0x4f509d){return _0x884907[_0xf998('0x16')](_0x264396)[_0xf998('0x18')](_0x4f509d);}};}function respondWithFilteredResult(_0x395a78,_0x2223b2){return function(_0x55d238){if(_0x55d238){var _0x22003c=_0x55d238[_0xf998('0x19')],_0x12adc2=_0x2223b2[_0xf998('0x1a')],_0x54a608=_0x2223b2[_0xf998('0x1a')]+_0x2223b2[_0xf998('0x1b')],_0x533dd4;if(_0x54a608>=_0x22003c){_0x54a608=_0x22003c;_0x533dd4=0xc8;}else{_0x533dd4=0xce;}_0x395a78[_0xf998('0x16')](_0x533dd4);return _0x395a78['set']('Content-Range',_0x12adc2+'-'+_0x54a608+'/'+_0x22003c)[_0xf998('0x18')](_0x55d238);}return null;};}function patchUpdates(_0x1b3680){return function(_0xfec3f){try{jsonpatch[_0xf998('0x1c')](_0xfec3f,_0x1b3680,!![]);}catch(_0x286f08){return BPromise[_0xf998('0x1d')](_0x286f08);}return _0xfec3f['save']();};}function saveUpdates(_0x37a459,_0x114380){return function(_0xcbe3f6){if(_0xcbe3f6){return _0xcbe3f6['update'](_0x37a459)[_0xf998('0x1e')](function(_0x1cbd07){return _0x1cbd07;});}return null;};}function removeEntity(_0x143957,_0x1630e8){return function(_0xae269){if(_0xae269){return _0xae269[_0xf998('0x1f')]()[_0xf998('0x1e')](function(){_0x143957['status'](0xcc)[_0xf998('0x17')]();});}};}function handleEntityNotFound(_0x42c35f,_0x2d809a){return function(_0x1f11e6){if(!_0x1f11e6){_0x42c35f[_0xf998('0x20')](0x194);}return _0x1f11e6;};}function handleError(_0xb7e1cc,_0x40783e){_0x40783e=_0x40783e||0x1f4;return function(_0x476b3b){logger['error'](_0x476b3b[_0xf998('0x21')]);if(_0x476b3b[_0xf998('0x22')]){delete _0x476b3b[_0xf998('0x22')];}_0xb7e1cc['status'](_0x40783e)[_0xf998('0x23')](_0x476b3b);};}exports['index']=function(_0x48081f,_0x439de0){var _0x36a1d6={},_0x402b4e={},_0xaa4b32={'count':0x0,'rows':[]};var _0x266903=db[_0xf998('0x24')]['rawAttributes'];_0x402b4e['model']=_['keys'](_0x266903);_0x402b4e['query']=_[_0xf998('0x25')](_0x48081f['query']);_0x402b4e[_0xf998('0x26')]=_[_0xf998('0x27')](_0x402b4e[_0xf998('0x28')],_0x402b4e[_0xf998('0x29')]);_0x36a1d6['attributes']=_[_0xf998('0x27')](_0x402b4e[_0xf998('0x28')],qs['fields'](_0x48081f[_0xf998('0x29')][_0xf998('0x2a')]));_0x36a1d6['attributes']=_0x36a1d6[_0xf998('0x2b')][_0xf998('0x2c')]?_0x36a1d6[_0xf998('0x2b')]:_0x402b4e['model'];if(!_0x48081f[_0xf998('0x29')]['hasOwnProperty'](_0xf998('0x2d'))){_0x36a1d6[_0xf998('0x1b')]=qs['limit'](_0x48081f['query']['limit']);_0x36a1d6['offset']=qs[_0xf998('0x1a')](_0x48081f['query']['offset']);}_0x36a1d6[_0xf998('0x2e')]=qs[_0xf998('0x2f')](_0x48081f['query']['sort']);_0x36a1d6[_0xf998('0x30')]=qs[_0xf998('0x26')](_['pick'](_0x48081f['query'],_0x402b4e[_0xf998('0x26')]));if(_0x48081f[_0xf998('0x29')][_0xf998('0x31')]){_0x36a1d6[_0xf998('0x30')]=_['merge'](_0x36a1d6[_0xf998('0x30')],{'$or':_[_0xf998('0x32')](_0x266903,function(_0x45af0a){if(_0x45af0a[_0xf998('0x33')][_0xf998('0x34')]!=='VIRTUAL'){var _0x51deba={};_0x51deba[_0x45af0a[_0xf998('0x35')]]={'$like':'%'+_0x48081f[_0xf998('0x29')][_0xf998('0x31')]+'%'};return _0x51deba;}})});}_0x36a1d6=_[_0xf998('0x36')]({},_0x36a1d6,_0x48081f[_0xf998('0x37')]);var _0x545c12={'where':_0x36a1d6[_0xf998('0x30')]};return db['DeskField'][_0xf998('0x19')](_0x545c12)[_0xf998('0x1e')](function(_0x15b96c){_0xaa4b32[_0xf998('0x19')]=_0x15b96c;if(_0x48081f[_0xf998('0x29')][_0xf998('0x38')]){_0x36a1d6[_0xf998('0x39')]=[{'all':!![]}];}return db[_0xf998('0x24')][_0xf998('0x3a')](_0x36a1d6);})[_0xf998('0x1e')](function(_0x58c373){_0xaa4b32[_0xf998('0x3b')]=_0x58c373;return _0xaa4b32;})[_0xf998('0x1e')](respondWithFilteredResult(_0x439de0,_0x36a1d6))[_0xf998('0x3c')](handleError(_0x439de0,null));};exports[_0xf998('0x3d')]=function(_0x452220,_0xf7162f){var _0x20adc6={'raw':!![],'where':{'id':_0x452220[_0xf998('0x3e')]['id']}},_0x38f11a={};_0x38f11a['model']=_['keys'](db[_0xf998('0x24')][_0xf998('0x3f')]);_0x38f11a[_0xf998('0x29')]=_[_0xf998('0x25')](_0x452220[_0xf998('0x29')]);_0x38f11a[_0xf998('0x26')]=_[_0xf998('0x27')](_0x38f11a[_0xf998('0x28')],_0x38f11a[_0xf998('0x29')]);_0x20adc6[_0xf998('0x2b')]=_['intersection'](_0x38f11a[_0xf998('0x28')],qs[_0xf998('0x2a')](_0x452220[_0xf998('0x29')][_0xf998('0x2a')]));_0x20adc6['attributes']=_0x20adc6['attributes'][_0xf998('0x2c')]?_0x20adc6[_0xf998('0x2b')]:_0x38f11a[_0xf998('0x28')];if(_0x452220[_0xf998('0x29')][_0xf998('0x38')]){_0x20adc6[_0xf998('0x39')]=[{'all':!![]}];}_0x20adc6=_[_0xf998('0x36')]({},_0x20adc6,_0x452220[_0xf998('0x37')]);return db['DeskField'][_0xf998('0x40')](_0x20adc6)['then'](handleEntityNotFound(_0xf7162f,null))[_0xf998('0x1e')](respondWithResult(_0xf7162f,null))[_0xf998('0x3c')](handleError(_0xf7162f,null));};exports[_0xf998('0x41')]=function(_0x1a9d70,_0x2812db){return db[_0xf998('0x24')][_0xf998('0x41')](_0x1a9d70[_0xf998('0x42')],{})[_0xf998('0x1e')](respondWithResult(_0x2812db,0xc9))[_0xf998('0x3c')](handleError(_0x2812db,null));};exports[_0xf998('0x43')]=function(_0x92a87e,_0x997def){if(_0x92a87e['body']['id']){delete _0x92a87e[_0xf998('0x42')]['id'];}return db[_0xf998('0x24')][_0xf998('0x40')]({'where':{'id':_0x92a87e[_0xf998('0x3e')]['id']}})['then'](handleEntityNotFound(_0x997def,null))[_0xf998('0x1e')](saveUpdates(_0x92a87e[_0xf998('0x42')],null))[_0xf998('0x1e')](respondWithResult(_0x997def,null))[_0xf998('0x3c')](handleError(_0x997def,null));};exports['destroy']=function(_0x17f06a,_0x42ff0d){return db[_0xf998('0x24')][_0xf998('0x40')]({'where':{'id':_0x17f06a[_0xf998('0x3e')]['id']}})['then'](handleEntityNotFound(_0x42ff0d,null))[_0xf998('0x1e')](removeEntity(_0x42ff0d,null))[_0xf998('0x3c')](handleError(_0x42ff0d,null));}; \ No newline at end of file +var _0xd6a1=['query','filters','intersection','model','attributes','fields','length','nolimit','limit','sort','where','pick','map','type','key','field','merge','includeAll','include','findAll','rows','catch','show','rawAttributes','keys','find','create','body','params','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','DeskField'];(function(_0x3ea2c9,_0x3ea64e){var _0x3ee1ca=function(_0x2a4191){while(--_0x2a4191){_0x3ea2c9['push'](_0x3ea2c9['shift']());}};_0x3ee1ca(++_0x3ea64e);}(_0xd6a1,0x1b5));var _0x1d6a=function(_0x1b1fad,_0x4fc9d8){_0x1b1fad=_0x1b1fad-0x0;var _0x4ab393=_0xd6a1[_0x1b1fad];return _0x4ab393;};'use strict';var pdf=require(_0x1d6a('0x0'));var emlformat=require(_0x1d6a('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x1d6a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1d6a('0x3'));var moment=require(_0x1d6a('0x4'));var BPromise=require(_0x1d6a('0x5'));var Mustache=require('mustache');var util=require(_0x1d6a('0x6'));var path=require(_0x1d6a('0x7'));var sox=require(_0x1d6a('0x8'));var csv=require(_0x1d6a('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1d6a('0xa'));var squel=require(_0x1d6a('0xb'));var crypto=require(_0x1d6a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1d6a('0xd'));var toCsv=require(_0x1d6a('0x9'));var querystring=require(_0x1d6a('0xe'));var Papa=require(_0x1d6a('0xf'));var Redis=require(_0x1d6a('0x10'));var authService=require(_0x1d6a('0x11'));var qs=require(_0x1d6a('0x12'));var hardwareService=require(_0x1d6a('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x1d6a('0x14'))['db'];function respondWithStatusCode(_0x3ba1e0,_0x51834d){_0x51834d=_0x51834d||0xcc;return function(_0xf272ea){if(_0xf272ea){return _0x3ba1e0[_0x1d6a('0x15')](_0x51834d);}return _0x3ba1e0[_0x1d6a('0x16')](_0x51834d)[_0x1d6a('0x17')]();};}function respondWithResult(_0x6fe89a,_0x140538){_0x140538=_0x140538||0xc8;return function(_0x23bce7){if(_0x23bce7){return _0x6fe89a[_0x1d6a('0x16')](_0x140538)[_0x1d6a('0x18')](_0x23bce7);}};}function respondWithFilteredResult(_0x503269,_0x42bcb4){return function(_0x18ac89){if(_0x18ac89){var _0x1eced7=_0x18ac89[_0x1d6a('0x19')],_0x420e91=_0x42bcb4['offset'],_0x396ea1=_0x42bcb4[_0x1d6a('0x1a')]+_0x42bcb4['limit'],_0x508a27;if(_0x396ea1>=_0x1eced7){_0x396ea1=_0x1eced7;_0x508a27=0xc8;}else{_0x508a27=0xce;}_0x503269[_0x1d6a('0x16')](_0x508a27);return _0x503269['set'](_0x1d6a('0x1b'),_0x420e91+'-'+_0x396ea1+'/'+_0x1eced7)['json'](_0x18ac89);}return null;};}function patchUpdates(_0x2952c0){return function(_0x3c3d1e){try{jsonpatch['apply'](_0x3c3d1e,_0x2952c0,!![]);}catch(_0x2d5717){return BPromise[_0x1d6a('0x1c')](_0x2d5717);}return _0x3c3d1e[_0x1d6a('0x1d')]();};}function saveUpdates(_0x74284f,_0x3223dc){return function(_0x3a1256){if(_0x3a1256){return _0x3a1256[_0x1d6a('0x1e')](_0x74284f)[_0x1d6a('0x1f')](function(_0x42f941){return _0x42f941;});}return null;};}function removeEntity(_0x5574fb,_0x25fa5c){return function(_0x28a787){if(_0x28a787){return _0x28a787[_0x1d6a('0x20')]()['then'](function(){_0x5574fb[_0x1d6a('0x16')](0xcc)[_0x1d6a('0x17')]();});}};}function handleEntityNotFound(_0x3224e4,_0x94a6fc){return function(_0x5d4606){if(!_0x5d4606){_0x3224e4['sendStatus'](0x194);}return _0x5d4606;};}function handleError(_0x38cad4,_0x56facc){_0x56facc=_0x56facc||0x1f4;return function(_0x314777){logger[_0x1d6a('0x21')](_0x314777[_0x1d6a('0x22')]);if(_0x314777['name']){delete _0x314777[_0x1d6a('0x23')];}_0x38cad4['status'](_0x56facc)[_0x1d6a('0x24')](_0x314777);};}exports[_0x1d6a('0x25')]=function(_0x2e30b8,_0x46cae3){var _0x323718={},_0x5f4528={},_0xa60145={'count':0x0,'rows':[]};var _0x2bafb4=db[_0x1d6a('0x26')]['rawAttributes'];_0x5f4528['model']=_['keys'](_0x2bafb4);_0x5f4528[_0x1d6a('0x27')]=_['keys'](_0x2e30b8[_0x1d6a('0x27')]);_0x5f4528[_0x1d6a('0x28')]=_[_0x1d6a('0x29')](_0x5f4528[_0x1d6a('0x2a')],_0x5f4528['query']);_0x323718[_0x1d6a('0x2b')]=_[_0x1d6a('0x29')](_0x5f4528[_0x1d6a('0x2a')],qs['fields'](_0x2e30b8[_0x1d6a('0x27')][_0x1d6a('0x2c')]));_0x323718[_0x1d6a('0x2b')]=_0x323718['attributes'][_0x1d6a('0x2d')]?_0x323718[_0x1d6a('0x2b')]:_0x5f4528[_0x1d6a('0x2a')];if(!_0x2e30b8[_0x1d6a('0x27')]['hasOwnProperty'](_0x1d6a('0x2e'))){_0x323718['limit']=qs[_0x1d6a('0x2f')](_0x2e30b8[_0x1d6a('0x27')][_0x1d6a('0x2f')]);_0x323718[_0x1d6a('0x1a')]=qs['offset'](_0x2e30b8[_0x1d6a('0x27')][_0x1d6a('0x1a')]);}_0x323718['order']=qs['sort'](_0x2e30b8['query'][_0x1d6a('0x30')]);_0x323718[_0x1d6a('0x31')]=qs[_0x1d6a('0x28')](_[_0x1d6a('0x32')](_0x2e30b8[_0x1d6a('0x27')],_0x5f4528['filters']));if(_0x2e30b8[_0x1d6a('0x27')]['filter']){_0x323718[_0x1d6a('0x31')]=_['merge'](_0x323718[_0x1d6a('0x31')],{'$or':_[_0x1d6a('0x33')](_0x2bafb4,function(_0x529f1b){if(_0x529f1b[_0x1d6a('0x34')][_0x1d6a('0x35')]!=='VIRTUAL'){var _0x559363={};_0x559363[_0x529f1b[_0x1d6a('0x36')]]={'$like':'%'+_0x2e30b8[_0x1d6a('0x27')]['filter']+'%'};return _0x559363;}})});}_0x323718=_[_0x1d6a('0x37')]({},_0x323718,_0x2e30b8['options']);var _0x76a3f7={'where':_0x323718[_0x1d6a('0x31')]};return db[_0x1d6a('0x26')][_0x1d6a('0x19')](_0x76a3f7)[_0x1d6a('0x1f')](function(_0x5639b2){_0xa60145[_0x1d6a('0x19')]=_0x5639b2;if(_0x2e30b8[_0x1d6a('0x27')][_0x1d6a('0x38')]){_0x323718[_0x1d6a('0x39')]=[{'all':!![]}];}return db[_0x1d6a('0x26')][_0x1d6a('0x3a')](_0x323718);})[_0x1d6a('0x1f')](function(_0x5f3f98){_0xa60145[_0x1d6a('0x3b')]=_0x5f3f98;return _0xa60145;})[_0x1d6a('0x1f')](respondWithFilteredResult(_0x46cae3,_0x323718))[_0x1d6a('0x3c')](handleError(_0x46cae3,null));};exports[_0x1d6a('0x3d')]=function(_0x297594,_0x912ed3){var _0x3dfbf1={'raw':!![],'where':{'id':_0x297594['params']['id']}},_0x5331f3={};_0x5331f3[_0x1d6a('0x2a')]=_['keys'](db[_0x1d6a('0x26')][_0x1d6a('0x3e')]);_0x5331f3[_0x1d6a('0x27')]=_[_0x1d6a('0x3f')](_0x297594[_0x1d6a('0x27')]);_0x5331f3[_0x1d6a('0x28')]=_['intersection'](_0x5331f3[_0x1d6a('0x2a')],_0x5331f3[_0x1d6a('0x27')]);_0x3dfbf1['attributes']=_[_0x1d6a('0x29')](_0x5331f3[_0x1d6a('0x2a')],qs[_0x1d6a('0x2c')](_0x297594[_0x1d6a('0x27')][_0x1d6a('0x2c')]));_0x3dfbf1[_0x1d6a('0x2b')]=_0x3dfbf1[_0x1d6a('0x2b')][_0x1d6a('0x2d')]?_0x3dfbf1['attributes']:_0x5331f3[_0x1d6a('0x2a')];if(_0x297594['query'][_0x1d6a('0x38')]){_0x3dfbf1[_0x1d6a('0x39')]=[{'all':!![]}];}_0x3dfbf1=_[_0x1d6a('0x37')]({},_0x3dfbf1,_0x297594['options']);return db[_0x1d6a('0x26')][_0x1d6a('0x40')](_0x3dfbf1)[_0x1d6a('0x1f')](handleEntityNotFound(_0x912ed3,null))[_0x1d6a('0x1f')](respondWithResult(_0x912ed3,null))[_0x1d6a('0x3c')](handleError(_0x912ed3,null));};exports[_0x1d6a('0x41')]=function(_0x4d4764,_0x3a944b){return db[_0x1d6a('0x26')][_0x1d6a('0x41')](_0x4d4764[_0x1d6a('0x42')],{})[_0x1d6a('0x1f')](respondWithResult(_0x3a944b,0xc9))['catch'](handleError(_0x3a944b,null));};exports[_0x1d6a('0x1e')]=function(_0x35de2f,_0x22b379){if(_0x35de2f['body']['id']){delete _0x35de2f[_0x1d6a('0x42')]['id'];}return db[_0x1d6a('0x26')]['find']({'where':{'id':_0x35de2f[_0x1d6a('0x43')]['id']}})[_0x1d6a('0x1f')](handleEntityNotFound(_0x22b379,null))[_0x1d6a('0x1f')](saveUpdates(_0x35de2f['body'],null))[_0x1d6a('0x1f')](respondWithResult(_0x22b379,null))[_0x1d6a('0x3c')](handleError(_0x22b379,null));};exports['destroy']=function(_0x517a46,_0x25da4d){return db[_0x1d6a('0x26')][_0x1d6a('0x40')]({'where':{'id':_0x517a46['params']['id']}})['then'](handleEntityNotFound(_0x25da4d,null))[_0x1d6a('0x1f')](removeEntity(_0x25da4d,null))[_0x1d6a('0x3c')](handleError(_0x25da4d,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 9fd5969..88bd2c1 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 _0x8204=['exports','define','DeskField','int_desk_fields','desk_unique_index','FieldId','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intDeskField.attributes'];(function(_0xbebf50,_0x44ec09){var _0xce1496=function(_0x1bf94d){while(--_0x1bf94d){_0xbebf50['push'](_0xbebf50['shift']());}};_0xce1496(++_0x44ec09);}(_0x8204,0xbc));var _0x4820=function(_0x523958,_0x5975ba){_0x523958=_0x523958-0x0;var _0x51338d=_0x8204[_0x523958];return _0x51338d;};'use strict';var _=require('lodash');var util=require(_0x4820('0x0'));var logger=require(_0x4820('0x1'))('api');var moment=require(_0x4820('0x2'));var BPromise=require(_0x4820('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4820('0x4'));var rimraf=require(_0x4820('0x5'));var config=require(_0x4820('0x6'));var attributes=require(_0x4820('0x7'));module[_0x4820('0x8')]=function(_0x4dd233,_0x5cde92){return _0x4dd233[_0x4820('0x9')](_0x4820('0xa'),attributes,{'tableName':_0x4820('0xb'),'paranoid':![],'indexes':[{'name':_0x4820('0xc'),'fields':['idField',_0x4820('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe31b=['exports','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4e7f3f,_0x5c57da){var _0x441fd2=function(_0x177c74){while(--_0x177c74){_0x4e7f3f['push'](_0x4e7f3f['shift']());}};_0x441fd2(++_0x5c57da);}(_0xe31b,0x105));var _0xbe31=function(_0x21c81e,_0x5de28f){_0x21c81e=_0x21c81e-0x0;var _0x16a6d7=_0xe31b[_0x21c81e];return _0x16a6d7;};'use strict';var _=require(_0xbe31('0x0'));var util=require(_0xbe31('0x1'));var logger=require(_0xbe31('0x2'))(_0xbe31('0x3'));var moment=require(_0xbe31('0x4'));var BPromise=require(_0xbe31('0x5'));var rp=require(_0xbe31('0x6'));var fs=require('fs');var path=require(_0xbe31('0x7'));var rimraf=require(_0xbe31('0x8'));var config=require('../../config/environment');var attributes=require('./intDeskField.attributes');module[_0xbe31('0x9')]=function(_0x491e4d,_0x208604){return _0x491e4d['define'](_0xbe31('0xa'),attributes,{'tableName':_0xbe31('0xb'),'paranoid':![],'indexes':[{'name':_0xbe31('0xc'),'fields':[_0xbe31('0xd'),_0xbe31('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 b907bdf..46c1c30 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 _0xe14d=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s','debug','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x56922c,_0x347c88){var _0xf896d7=function(_0x214e47){while(--_0x214e47){_0x56922c['push'](_0x56922c['shift']());}};_0xf896d7(++_0x347c88);}(_0xe14d,0x1ee));var _0xde14=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0xe14d[_0x166742];return _0xb7814a;};'use strict';var _=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var moment=require(_0xde14('0x2'));var BPromise=require(_0xde14('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde14('0x4'));var db=require(_0xde14('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xde14('0x6'))(_0xde14('0x7'));var config=require(_0xde14('0x8'));var jayson=require(_0xde14('0x9'));var client=jayson[_0xde14('0xa')][_0xde14('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b1f6b,_0x5a1344,_0x1bd49d){return new BPromise(function(_0x115b7d,_0x2b0e7c){return client[_0xde14('0xc')](_0x4b1f6b,_0x1bd49d)[_0xde14('0xd')](function(_0x176909){logger[_0xde14('0xe')](_0xde14('0xf'),_0x5a1344,'request\x20sent');logger[_0xde14('0x10')](_0xde14('0x11'),_0x5a1344,_0xde14('0x12'),JSON[_0xde14('0x13')](_0x176909));if(_0x176909[_0xde14('0x14')]){if(_0x176909[_0xde14('0x14')][_0xde14('0x15')]===0x1f4){logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x176909[_0xde14('0x14')][_0xde14('0x16')]);return _0x2b0e7c(_0x176909[_0xde14('0x14')][_0xde14('0x16')]);}logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x176909['error']['message']);return _0x115b7d(_0x176909[_0xde14('0x14')][_0xde14('0x16')]);}else{logger[_0xde14('0xe')]('DeskField,\x20%s,\x20%s',_0x5a1344,_0xde14('0x12'));_0x115b7d(_0x176909[_0xde14('0x17')][_0xde14('0x16')]);}})[_0xde14('0x18')](function(_0x3de959){logger[_0xde14('0x14')](_0xde14('0xf'),_0x5a1344,_0x3de959);_0x2b0e7c(_0x3de959);});});} \ No newline at end of file +var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s'];(function(_0x41981d,_0x2b8f0b){var _0x238411=function(_0x1a2245){while(--_0x1a2245){_0x41981d['push'](_0x41981d['shift']());}};_0x238411(++_0x2b8f0b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x230e39,_0x5341){_0x230e39=_0x230e39-0x0;var _0xa804e=_0xcb91[_0x230e39];return _0xa804e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('DeskField,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 2ab4452..afa2719 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 _0x0679=['Router','../../components/auth/service','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x838813,_0x448f0f){var _0x2bd32d=function(_0x57b589){while(--_0x57b589){_0x838813['push'](_0x838813['shift']());}};_0x2bd32d(++_0x448f0f);}(_0x0679,0x1b4));var _0x9067=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0x0679[_0x166742];return _0xb7814a;};'use strict';var multer=require(_0x9067('0x0'));var util=require(_0x9067('0x1'));var path=require(_0x9067('0x2'));var timeout=require(_0x9067('0x3'));var express=require(_0x9067('0x4'));var router=express[_0x9067('0x5')]();var auth=require(_0x9067('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intDynamics365Account.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x9067('0x7'),auth[_0x9067('0x8')](),controller[_0x9067('0x9')]);router['get'](_0x9067('0xa'),auth[_0x9067('0x8')](),controller[_0x9067('0xb')]);router['get'](_0x9067('0xc'),auth[_0x9067('0x8')](),controller[_0x9067('0xd')]);router[_0x9067('0xe')]('/',auth['isAuthenticated'](),controller[_0x9067('0xf')]);router[_0x9067('0xe')](_0x9067('0xa'),auth[_0x9067('0x8')](),controller[_0x9067('0x10')]);router[_0x9067('0x11')](_0x9067('0x7'),auth[_0x9067('0x8')](),controller[_0x9067('0x12')]);router[_0x9067('0x13')]('/:id',auth[_0x9067('0x8')](),controller['destroy']);module[_0x9067('0x14')]=router; \ No newline at end of file +var _0x20a3=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','put','/:id','update','destroy'];(function(_0x4c7935,_0x4a53fb){var _0x30651d=function(_0x12f35f){while(--_0x12f35f){_0x4c7935['push'](_0x4c7935['shift']());}};_0x30651d(++_0x4a53fb);}(_0x20a3,0xe6));var _0x320a=function(_0x2ea675,_0x592a27){_0x2ea675=_0x2ea675-0x0;var _0x20d00c=_0x20a3[_0x2ea675];return _0x20d00c;};'use strict';var multer=require(_0x320a('0x0'));var util=require(_0x320a('0x1'));var path=require('path');var timeout=require(_0x320a('0x2'));var express=require(_0x320a('0x3'));var router=express[_0x320a('0x4')]();var auth=require(_0x320a('0x5'));var interaction=require(_0x320a('0x6'));var config=require(_0x320a('0x7'));var controller=require(_0x320a('0x8'));router[_0x320a('0x9')]('/',auth[_0x320a('0xa')](),controller[_0x320a('0xb')]);router[_0x320a('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x320a('0xc')]);router[_0x320a('0x9')](_0x320a('0xd'),auth['isAuthenticated'](),controller[_0x320a('0xe')]);router['get'](_0x320a('0xf'),auth[_0x320a('0xa')](),controller[_0x320a('0x10')]);router['post']('/',auth[_0x320a('0xa')](),controller[_0x320a('0x11')]);router[_0x320a('0x12')](_0x320a('0xd'),auth[_0x320a('0xa')](),controller['addConfiguration']);router[_0x320a('0x13')](_0x320a('0x14'),auth[_0x320a('0xa')](),controller[_0x320a('0x15')]);router['delete'](_0x320a('0x14'),auth[_0x320a('0xa')](),controller[_0x320a('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 1dfd8bc..df00de5 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 _0x5a63=['exports','STRING','sequelize'];(function(_0x2a0444,_0x243b7b){var _0x2ffd90=function(_0x562429){while(--_0x562429){_0x2a0444['push'](_0x2a0444['shift']());}};_0x2ffd90(++_0x243b7b);}(_0x5a63,0x179));var _0x35a6=function(_0x4c7ef7,_0x5ecf66){_0x4c7ef7=_0x4c7ef7-0x0;var _0xfccf23=_0x5a63[_0x4c7ef7];return _0xfccf23;};'use strict';var Sequelize=require(_0x35a6('0x0'));module[_0x35a6('0x1')]={'name':{'type':Sequelize[_0x35a6('0x2')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x35a6('0x2')]},'remoteUri':{'type':Sequelize[_0x35a6('0x2')]},'tenantId':{'type':Sequelize[_0x35a6('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x35a6('0x2')]},'serverUrl':{'type':Sequelize[_0x35a6('0x2')]},'description':{'type':Sequelize[_0x35a6('0x2')]}}; \ No newline at end of file +var _0xc6f8=['STRING','exports'];(function(_0x4922d5,_0x4e50f8){var _0x2c2cc6=function(_0xcb84ef){while(--_0xcb84ef){_0x4922d5['push'](_0x4922d5['shift']());}};_0x2c2cc6(++_0x4e50f8);}(_0xc6f8,0xb9));var _0x8c6f=function(_0x39f82a,_0x502965){_0x39f82a=_0x39f82a-0x0;var _0x4bdcfa=_0xc6f8[_0x39f82a];return _0x4bdcfa;};'use strict';var Sequelize=require('sequelize');module[_0x8c6f('0x0')]={'name':{'type':Sequelize[_0x8c6f('0x1')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x8c6f('0x1')]},'tenantId':{'type':Sequelize[_0x8c6f('0x1')]},'clientId':{'type':Sequelize[_0x8c6f('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x8c6f('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index c7e8c31..46ab73d 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 _0x3e03=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../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~!@#$%^&-_=+[{]}.','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','end','status','offset','set','Content-Range','json','reject','save','update','destroy','name','send','index','Dynamics365Account','rawAttributes','model','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','key','field','options','count','includeAll','rows','show','params','filters','length','find','create','body','getConfigurations','findOne','Dynamics365Configuration','map','AccountId','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','Subjects','getFields','ticketType','incident','Incident','PhoneCall','description','customerid','ownerid','caseorigincode','subject','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdon','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','numberofchildincidents','owneridname','owneridtype','owneridyominame','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidyominame','slaname','statecode','statuscode','subjectidname','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','versionnumber','concat','password','tenantId','clientId','clientSecret','remoteUri','substring','lastIndexOf','format','%s/api/data/v9.0/','POST','/oauth2/token','username','GET','Bearer\x20','4.0','value','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','remove','includes','forEach','@odata.type','push','MetadataId','all','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','log','statusCode','stack',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','LogicalName','DisplayName','TrueOption','true','false','?$select=DisplayName,LogicalName','html-pdf','eml-format','bluebird','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring'];(function(_0x531273,_0x5ee1db){var _0x5555ce=function(_0x4f0f17){while(--_0x4f0f17){_0x531273['push'](_0x531273['shift']());}};_0x5555ce(++_0x5ee1db);}(_0x3e03,0xc2));var _0x33e0=function(_0x1bd85d,_0xdc683f){_0x1bd85d=_0x1bd85d-0x0;var _0xd40669=_0x3e03[_0x1bd85d];return _0xd40669;};'use strict';var pdf=require(_0x33e0('0x0'));var emlformat=require(_0x33e0('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(_0x33e0('0x2'));var Mustache=require('mustache');var util=require(_0x33e0('0x3'));var path=require(_0x33e0('0x4'));var sox=require(_0x33e0('0x5'));var csv=require(_0x33e0('0x6'));var ejs=require(_0x33e0('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x33e0('0x8'));var crypto=require('crypto');var jsforce=require(_0x33e0('0x9'));var deskjs=require(_0x33e0('0xa'));var toCsv=require(_0x33e0('0x6'));var querystring=require(_0x33e0('0xb'));var Papa=require(_0x33e0('0xc'));var Redis=require(_0x33e0('0xd'));var authService=require(_0x33e0('0xe'));var qs=require(_0x33e0('0xf'));var hardwareService=require(_0x33e0('0x10'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x33e0('0x11'))['db'];var integrations=require(_0x33e0('0x12'));var jayson=require(_0x33e0('0x13'));var client=jayson['client'][_0x33e0('0x14')]({'port':0x232a});function checkPasswordPattern(_0x4ec434,_0x1853f5,_0x477c79){if(_0x477c79){var _0x3cbdc8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3cbdc8[_0x33e0('0x15')](_0x1853f5)){return _0x4ec434;}else{throw new Error(_0x33e0('0x16'));}}else{return _0x4ec434;}}function respondWithRpcPromise(_0x49b9a9,_0x41e772,_0x5dd6be,_0x16cfcf){return new BPromise(function(_0xea520b,_0x5b6312){var _0x2aa1b7=_0x16cfcf||client;return _0x2aa1b7['request'](_0x49b9a9,_0x5dd6be)[_0x33e0('0x17')](function(_0x2e7d76){logger[_0x33e0('0x18')](_0x33e0('0x19'),_0x41e772,_0x33e0('0x1a'));logger[_0x33e0('0x1b')](_0x33e0('0x1c'),_0x41e772,_0x33e0('0x1a'),JSON[_0x33e0('0x1d')](_0x2e7d76));if(_0x2e7d76[_0x33e0('0x1e')]){if(_0x2e7d76[_0x33e0('0x1e')][_0x33e0('0x1f')]===0x1f4){logger[_0x33e0('0x1e')](_0x33e0('0x19'),_0x41e772,_0x2e7d76[_0x33e0('0x1e')][_0x33e0('0x20')]);return _0x5b6312(_0x2e7d76[_0x33e0('0x1e')]['message']);}logger[_0x33e0('0x1e')](_0x33e0('0x19'),_0x41e772,_0x2e7d76['error'][_0x33e0('0x20')]);return _0xea520b(_0x2e7d76[_0x33e0('0x1e')][_0x33e0('0x20')]);}else{logger['info'](_0x33e0('0x19'),_0x41e772,_0x33e0('0x1a'));_0xea520b(_0x2e7d76['result'][_0x33e0('0x20')]);}})[_0x33e0('0x21')](function(_0x90bf1a){logger[_0x33e0('0x1e')](_0x33e0('0x19'),_0x41e772,_0x90bf1a);_0x5b6312(_0x90bf1a);});});}function respondWithStatusCode(_0x5c2696,_0x463a5b){_0x463a5b=_0x463a5b||0xcc;return function(_0x565ee0){if(_0x565ee0){return _0x5c2696[_0x33e0('0x22')](_0x463a5b);}return _0x5c2696['status'](_0x463a5b)[_0x33e0('0x23')]();};}function respondWithResult(_0x5b9e90,_0x21e371){_0x21e371=_0x21e371||0xc8;return function(_0x241910){if(_0x241910){return _0x5b9e90[_0x33e0('0x24')](_0x21e371)['json'](_0x241910);}};}function respondWithFilteredResult(_0x2bc1d9,_0x4b25de){return function(_0x871de4){if(_0x871de4){var _0xfd2261=_0x871de4['count'],_0x3606fe=_0x4b25de[_0x33e0('0x25')],_0x4eaa32=_0x4b25de[_0x33e0('0x25')]+_0x4b25de['limit'],_0x58d4dc;if(_0x4eaa32>=_0xfd2261){_0x4eaa32=_0xfd2261;_0x58d4dc=0xc8;}else{_0x58d4dc=0xce;}_0x2bc1d9[_0x33e0('0x24')](_0x58d4dc);return _0x2bc1d9[_0x33e0('0x26')](_0x33e0('0x27'),_0x3606fe+'-'+_0x4eaa32+'/'+_0xfd2261)[_0x33e0('0x28')](_0x871de4);}return null;};}function patchUpdates(_0x6fac65){return function(_0xde374d){try{jsonpatch['apply'](_0xde374d,_0x6fac65,!![]);}catch(_0x455521){return BPromise[_0x33e0('0x29')](_0x455521);}return _0xde374d[_0x33e0('0x2a')]();};}function saveUpdates(_0x47778f,_0x1f3a2a){return function(_0xe1d99e){if(_0xe1d99e){return _0xe1d99e[_0x33e0('0x2b')](_0x47778f)[_0x33e0('0x17')](function(_0x17159e){return _0x17159e;});}return null;};}function removeEntity(_0x4f4c80,_0x3f1806){return function(_0x791371){if(_0x791371){return _0x791371[_0x33e0('0x2c')]()[_0x33e0('0x17')](function(){_0x4f4c80[_0x33e0('0x24')](0xcc)[_0x33e0('0x23')]();});}};}function handleEntityNotFound(_0x49f911,_0x11e44a){return function(_0x15b456){if(!_0x15b456){_0x49f911['sendStatus'](0x194);}return _0x15b456;};}function handleError(_0x4b1fc1,_0x51850b){_0x51850b=_0x51850b||0x1f4;return function(_0x102880){logger[_0x33e0('0x1e')](_0x102880['stack']);if(_0x102880['name']){delete _0x102880[_0x33e0('0x2d')];}_0x4b1fc1['status'](_0x51850b)[_0x33e0('0x2e')](_0x102880);};}exports[_0x33e0('0x2f')]=function(_0x3b3086,_0x63c106){var _0x5a29ff={},_0x30e4a5={},_0x39ab82={'count':0x0,'rows':[]};var _0x3aeb2b=db[_0x33e0('0x30')][_0x33e0('0x31')];_0x30e4a5[_0x33e0('0x32')]=_[_0x33e0('0x33')](_0x3aeb2b);_0x30e4a5[_0x33e0('0x34')]=_['keys'](_0x3b3086[_0x33e0('0x34')]);_0x30e4a5['filters']=_[_0x33e0('0x35')](_0x30e4a5['model'],_0x30e4a5[_0x33e0('0x34')]);_0x5a29ff['attributes']=_['intersection'](_0x30e4a5[_0x33e0('0x32')],qs['fields'](_0x3b3086[_0x33e0('0x34')][_0x33e0('0x36')]));_0x5a29ff[_0x33e0('0x37')]=_0x5a29ff[_0x33e0('0x37')]['length']?_0x5a29ff[_0x33e0('0x37')]:_0x30e4a5[_0x33e0('0x32')];if(!_0x3b3086['query'][_0x33e0('0x38')](_0x33e0('0x39'))){_0x5a29ff[_0x33e0('0x3a')]=qs[_0x33e0('0x3a')](_0x3b3086['query'][_0x33e0('0x3a')]);_0x5a29ff['offset']=qs[_0x33e0('0x25')](_0x3b3086['query'][_0x33e0('0x25')]);}_0x5a29ff[_0x33e0('0x3b')]=qs[_0x33e0('0x3c')](_0x3b3086['query'][_0x33e0('0x3c')]);_0x5a29ff[_0x33e0('0x3d')]=qs['filters'](_[_0x33e0('0x3e')](_0x3b3086[_0x33e0('0x34')],_0x30e4a5['filters']));if(_0x3b3086[_0x33e0('0x34')][_0x33e0('0x3f')]){_0x5a29ff['where']=_[_0x33e0('0x40')](_0x5a29ff[_0x33e0('0x3d')],{'$or':_['map'](_0x3aeb2b,function(_0x43011f){if(_0x43011f[_0x33e0('0x41')][_0x33e0('0x42')]!=='VIRTUAL'){var _0x12c41b={};_0x12c41b[_0x43011f[_0x33e0('0x43')]]={'$like':'%'+_0x3b3086['query']['filter']+'%'};return _0x12c41b;}})});}_0x5a29ff=_[_0x33e0('0x40')]({},_0x5a29ff,_0x3b3086[_0x33e0('0x44')]);var _0x8224f9={'where':_0x5a29ff[_0x33e0('0x3d')]};return db[_0x33e0('0x30')]['count'](_0x8224f9)[_0x33e0('0x17')](function(_0x1a32f2){_0x39ab82[_0x33e0('0x45')]=_0x1a32f2;if(_0x3b3086[_0x33e0('0x34')][_0x33e0('0x46')]){_0x5a29ff['include']=[{'all':!![]}];}return db[_0x33e0('0x30')]['findAll'](_0x5a29ff);})[_0x33e0('0x17')](function(_0xec0f73){_0x39ab82[_0x33e0('0x47')]=_0xec0f73;return _0x39ab82;})[_0x33e0('0x17')](respondWithFilteredResult(_0x63c106,_0x5a29ff))['catch'](handleError(_0x63c106,null));};exports[_0x33e0('0x48')]=function(_0x2b0b29,_0x252716){var _0x5bac61={'raw':![],'where':{'id':_0x2b0b29[_0x33e0('0x49')]['id']}},_0x2db714={};_0x2db714[_0x33e0('0x32')]=_[_0x33e0('0x33')](db[_0x33e0('0x30')][_0x33e0('0x31')]);_0x2db714[_0x33e0('0x34')]=_[_0x33e0('0x33')](_0x2b0b29['query']);_0x2db714[_0x33e0('0x4a')]=_['intersection'](_0x2db714['model'],_0x2db714[_0x33e0('0x34')]);_0x5bac61[_0x33e0('0x37')]=_[_0x33e0('0x35')](_0x2db714[_0x33e0('0x32')],qs[_0x33e0('0x36')](_0x2b0b29[_0x33e0('0x34')][_0x33e0('0x36')]));_0x5bac61[_0x33e0('0x37')]=_0x5bac61['attributes'][_0x33e0('0x4b')]?_0x5bac61[_0x33e0('0x37')]:_0x2db714[_0x33e0('0x32')];if(_0x2b0b29['query'][_0x33e0('0x46')]){_0x5bac61['include']=[{'all':!![]}];}_0x5bac61=_['merge']({},_0x5bac61,_0x2b0b29[_0x33e0('0x44')]);return db[_0x33e0('0x30')][_0x33e0('0x4c')](_0x5bac61)[_0x33e0('0x17')](handleEntityNotFound(_0x252716,null))['then'](respondWithResult(_0x252716,null))[_0x33e0('0x21')](handleError(_0x252716,null));};exports[_0x33e0('0x4d')]=function(_0x42b92c,_0x4ec1fd){return db['Dynamics365Account'][_0x33e0('0x4d')](_0x42b92c[_0x33e0('0x4e')],{})[_0x33e0('0x17')](respondWithResult(_0x4ec1fd,0xc9))[_0x33e0('0x21')](handleError(_0x4ec1fd,null));};exports['update']=function(_0x455e48,_0x5b9c7e){if(_0x455e48[_0x33e0('0x4e')]['id']){delete _0x455e48['body']['id'];}return db[_0x33e0('0x30')][_0x33e0('0x4c')]({'where':{'id':_0x455e48[_0x33e0('0x49')]['id']}})[_0x33e0('0x17')](handleEntityNotFound(_0x5b9c7e,null))[_0x33e0('0x17')](saveUpdates(_0x455e48['body'],null))[_0x33e0('0x17')](respondWithResult(_0x5b9c7e,null))[_0x33e0('0x21')](handleError(_0x5b9c7e,null));};exports[_0x33e0('0x2c')]=function(_0x8db1e0,_0x16de3c){return db[_0x33e0('0x30')]['find']({'where':{'id':_0x8db1e0[_0x33e0('0x49')]['id']}})[_0x33e0('0x17')](handleEntityNotFound(_0x16de3c,null))['then'](removeEntity(_0x16de3c,null))['catch'](handleError(_0x16de3c,null));};exports[_0x33e0('0x4f')]=function(_0x2b9896,_0x39e000,_0x46b13a){var _0x271c5d={};var _0x30584b={};var _0x5691bf;var _0x2a0e96;return db[_0x33e0('0x30')][_0x33e0('0x50')]({'where':{'id':_0x2b9896[_0x33e0('0x49')]['id']}})[_0x33e0('0x17')](handleEntityNotFound(_0x39e000,null))['then'](function(_0x3b8ca2){if(_0x3b8ca2){_0x5691bf=_0x3b8ca2;_0x30584b[_0x33e0('0x32')]=_[_0x33e0('0x33')](db[_0x33e0('0x51')]['rawAttributes']);_0x30584b[_0x33e0('0x34')]=_[_0x33e0('0x33')](_0x2b9896['query']);_0x30584b[_0x33e0('0x4a')]=_[_0x33e0('0x35')](_0x30584b[_0x33e0('0x32')],_0x30584b['query']);_0x271c5d['attributes']=_[_0x33e0('0x35')](_0x30584b['model'],qs['fields'](_0x2b9896[_0x33e0('0x34')][_0x33e0('0x36')]));_0x271c5d['attributes']=_0x271c5d[_0x33e0('0x37')]['length']?_0x271c5d[_0x33e0('0x37')]:_0x30584b[_0x33e0('0x32')];_0x271c5d['order']=qs['sort'](_0x2b9896[_0x33e0('0x34')][_0x33e0('0x3c')]);_0x271c5d[_0x33e0('0x3d')]=qs['filters'](_[_0x33e0('0x3e')](_0x2b9896[_0x33e0('0x34')],_0x30584b[_0x33e0('0x4a')]));if(_0x2b9896[_0x33e0('0x34')][_0x33e0('0x3f')]){_0x271c5d[_0x33e0('0x3d')]=_[_0x33e0('0x40')](_0x271c5d[_0x33e0('0x3d')],{'$or':_[_0x33e0('0x52')](_0x271c5d[_0x33e0('0x37')],function(_0x6924fc){var _0x520ee3={};_0x520ee3[_0x6924fc]={'$like':'%'+_0x2b9896[_0x33e0('0x34')][_0x33e0('0x3f')]+'%'};return _0x520ee3;})});}_0x271c5d=_['merge']({},_0x271c5d,_0x2b9896[_0x33e0('0x44')]);return _0x5691bf[_0x33e0('0x4f')](_0x271c5d);}})[_0x33e0('0x17')](function(_0x38582f){if(_0x38582f){_0x2a0e96=_0x38582f['length'];if(!_0x2b9896[_0x33e0('0x34')][_0x33e0('0x38')](_0x33e0('0x39'))){_0x271c5d['limit']=qs[_0x33e0('0x3a')](_0x2b9896[_0x33e0('0x34')][_0x33e0('0x3a')]);_0x271c5d['offset']=qs[_0x33e0('0x25')](_0x2b9896['query'][_0x33e0('0x25')]);}return _0x5691bf[_0x33e0('0x4f')](_0x271c5d);}})['then'](function(_0x5d3668){if(_0x5d3668){return _0x5d3668?{'count':_0x2a0e96,'rows':_0x5d3668}:null;}})[_0x33e0('0x17')](respondWithResult(_0x39e000,null))[_0x33e0('0x21')](handleError(_0x39e000,null));};exports['addConfiguration']=function(_0x1a474d,_0x2268f6,_0x589249){if(_0x1a474d[_0x33e0('0x4e')]['id']){delete _0x1a474d[_0x33e0('0x4e')]['id'];}return db[_0x33e0('0x30')][_0x33e0('0x50')]({'where':{'id':_0x1a474d[_0x33e0('0x49')]['id']}})[_0x33e0('0x17')](handleEntityNotFound(_0x2268f6,null))[_0x33e0('0x17')](function(_0x35ac86){if(_0x35ac86){_0x1a474d[_0x33e0('0x4e')][_0x33e0('0x53')]=_0x35ac86['id'];_0x1a474d[_0x33e0('0x4e')]['Subjects']=integrations[_0x33e0('0x54')](_0x1a474d[_0x33e0('0x4e')][_0x33e0('0x55')],_0x1a474d['body'][_0x33e0('0x41')]);_0x1a474d['body'][_0x33e0('0x56')]=integrations[_0x33e0('0x57')](_0x1a474d['body'][_0x33e0('0x55')],_0x1a474d[_0x33e0('0x4e')][_0x33e0('0x41')]);return db['Dynamics365Configuration'][_0x33e0('0x4d')](_0x1a474d[_0x33e0('0x4e')],{'include':[{'model':db[_0x33e0('0x58')],'as':_0x33e0('0x59')},{'model':db[_0x33e0('0x58')],'as':_0x33e0('0x56')}]});}return null;})[_0x33e0('0x17')](respondWithResult(_0x2268f6,null))[_0x33e0('0x21')](handleError(_0x2268f6,null));};exports[_0x33e0('0x5a')]=function(_0x29b410,_0x4e6fa4,_0x2818b0){var _0x39e520=_0x29b410['query'][_0x33e0('0x5b')];var _0x290142=_0x39e520===_0x33e0('0x5c')?_0x33e0('0x5d'):_0x33e0('0x5e');var _0x5728f9='';var _0x38b259='';var _0x54dfad='';var _0x3ebb5c='';var _0x55f6c9='';var _0x5ba8d8='';var _0x16714b='';var _0x1ef498='';var _0x72b6ad=['title',_0x33e0('0x5f'),_0x33e0('0x60'),_0x33e0('0x61'),_0x33e0('0x62'),_0x33e0('0x63'),'phonenumber','regardingobjectid',_0x33e0('0x64'),_0x33e0('0x65')];var _0x2510ff=[_0x33e0('0x66'),_0x33e0('0x67'),_0x33e0('0x68'),'billedserviceunits',_0x33e0('0x69'),_0x33e0('0x6a'),_0x33e0('0x6b'),_0x33e0('0x6c'),_0x33e0('0x6d'),_0x33e0('0x6e'),_0x33e0('0x6f'),'createdbyyominame',_0x33e0('0x70'),'createdonbehalfbyname','createdonbehalfbyyominame',_0x33e0('0x71'),_0x33e0('0x72'),_0x33e0('0x73'),_0x33e0('0x74'),_0x33e0('0x75'),_0x33e0('0x76'),_0x33e0('0x77'),_0x33e0('0x78'),_0x33e0('0x79'),_0x33e0('0x7a'),_0x33e0('0x7b'),_0x33e0('0x7c'),_0x33e0('0x7d'),'kbarticleidname',_0x33e0('0x7e'),_0x33e0('0x7f'),_0x33e0('0x80'),_0x33e0('0x81'),_0x33e0('0x82'),_0x33e0('0x83'),_0x33e0('0x84'),_0x33e0('0x85'),'modifiedonbehalfbyyominame',_0x33e0('0x86'),'msdyn_iotalertname',_0x33e0('0x87'),'onholdtime','overriddencreatedon',_0x33e0('0x88'),_0x33e0('0x89'),_0x33e0('0x8a'),'parentcaseidname',_0x33e0('0x8b'),_0x33e0('0x8c'),_0x33e0('0x8d'),_0x33e0('0x8e'),_0x33e0('0x8f'),_0x33e0('0x90'),_0x33e0('0x91'),_0x33e0('0x92'),'responsiblecontactidname',_0x33e0('0x93'),'sentimentvalue','slainvokedidname',_0x33e0('0x94'),'socialprofileidname',_0x33e0('0x95'),_0x33e0('0x96'),_0x33e0('0x97'),'ticketnumber',_0x33e0('0x98'),_0x33e0('0x99'),_0x33e0('0x9a'),'utcconversiontimezonecode',_0x33e0('0x9b')];var _0x54bb38=_0x72b6ad[_0x33e0('0x9c')](_0x2510ff);return db[_0x33e0('0x30')][_0x33e0('0x50')]({'where':{'id':_0x29b410[_0x33e0('0x49')]['id']},'attributes':['id','username',_0x33e0('0x9d'),'remoteUri',_0x33e0('0x9e'),_0x33e0('0x9f'),_0x33e0('0xa0')]})[_0x33e0('0x17')](handleEntityNotFound(_0x4e6fa4,null))[_0x33e0('0x17')](function(_0x3734d0){if(_0x3734d0){_0x1ef498=_0x3734d0[_0x33e0('0xa1')];var _0x4af39e=_0x1ef498['slice'](-0x1);if(_0x4af39e==='/'){_0x1ef498=_0x1ef498[_0x33e0('0xa2')](0x0,_0x1ef498[_0x33e0('0xa3')](_0x4af39e));}_0x16714b=util[_0x33e0('0xa4')](_0x33e0('0xa5'),_0x1ef498);var _0xa5c412={'method':_0x33e0('0xa6'),'uri':'https://login.microsoftonline.com/'+_0x3734d0[_0x33e0('0x9e')]+_0x33e0('0xa7'),'form':{'client_id':_0x3734d0[_0x33e0('0x9f')],'resource':_0x1ef498,'username':_0x3734d0[_0x33e0('0xa8')],'password':_0x3734d0[_0x33e0('0x9d')],'grant_type':'password','client_secret':_0x3734d0['clientSecret']},'json':!![]};return rp(_0xa5c412);}})[_0x33e0('0x17')](function(_0x2409e5){_0x5ba8d8=_0x2409e5['access_token'];var _0x3cdf78={'method':_0x33e0('0xa9'),'uri':encodeURI(_0x16714b+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x290142+'\x27'),'headers':{'Authorization':_0x33e0('0xaa')+_0x5ba8d8,'If-None-Match':null,'OData-Version':_0x33e0('0xab')},'json':!![]};return rp(_0x3cdf78);})[_0x33e0('0x17')](function(_0x331927){var _0x14c12c=_0x331927[_0x33e0('0xac')][0x0];var _0xda5fa3=_0x14c12c['MetadataId'];var _0x40f51f={'method':'GET','uri':_0x16714b+_0x33e0('0xad')+_0xda5fa3+_0x33e0('0xae'),'headers':{'Authorization':'Bearer\x20'+_0x5ba8d8,'If-None-Match':null,'OData-Version':_0x33e0('0xab')},'json':!![]};return rp(_0x40f51f);})[_0x33e0('0x17')](function(_0x3932fa){_0x5728f9=_0x3932fa;_0x38b259=_0x5728f9['Attributes'];_0x38b259=_[_0x33e0('0xaf')](_0x38b259,function(_0x47e4f5){return!_0x54bb38[_0x33e0('0xb0')](_0x47e4f5['LogicalName']);});var _0x3b4019=[];var _0x4518cb=[];_0x38b259[_0x33e0('0xb1')](function(_0x1bc11d){if(_0x1bc11d[_0x33e0('0xb2')]){var _0x4fecc3=_0x1bc11d[_0x33e0('0xb2')][_0x33e0('0xa2')](_0x1bc11d[_0x33e0('0xb2')][_0x33e0('0xa3')]('.')+0x1);if(_0x4fecc3==='PicklistAttributeMetadata'){_0x3b4019[_0x33e0('0xb3')](getSelectList(_0x16714b,_0x39e520,_0x4518cb,_0x5728f9[_0x33e0('0xb4')],_0x1bc11d[_0x33e0('0xb4')],_0x5ba8d8));}}});return Promise['all'](_0x3b4019);})[_0x33e0('0x17')](function(_0x123db7){_0x54dfad=_0x123db7[0x0];var _0x38829c=[];var _0x1dd8f5=[];_0x38b259[_0x33e0('0xb1')](function(_0x49a75f){if(!_['isNil'](_0x49a75f[_0x33e0('0xb2')])){var _0x3cad61=_0x49a75f[_0x33e0('0xb2')]['substring'](_0x49a75f['@odata.type'][_0x33e0('0xa3')]('.')+0x1);if(_0x3cad61==='BooleanAttributeMetadata'){_0x38829c[_0x33e0('0xb3')](getBooleanList(_0x16714b,_0x39e520,_0x1dd8f5,_0x5728f9[_0x33e0('0xb4')],_0x49a75f[_0x33e0('0xb4')],_0x5ba8d8));}}});return Promise[_0x33e0('0xb5')](_0x38829c);})[_0x33e0('0x17')](function(_0x1eead7){_0x3ebb5c=_0x1eead7[0x0];var _0x2267e3=[];var _0x5dd2d=[];_0x38b259[_0x33e0('0xb1')](function(_0x3f1edd){if(_0x3f1edd['@odata.type']){var _0x187e1c=_0x3f1edd[_0x33e0('0xb2')][_0x33e0('0xa2')](_0x3f1edd[_0x33e0('0xb2')]['lastIndexOf']('.')+0x1);if(_0x187e1c===_0x33e0('0xb6')||_0x187e1c===_0x33e0('0xb7')||_0x187e1c===_0x33e0('0xb8')||_0x187e1c===_0x33e0('0xb9')||_0x187e1c===_0x33e0('0xba')||_0x187e1c===_0x33e0('0xbb')||_0x187e1c===_0x33e0('0xbc')||_0x187e1c==='EntityNameAttributeMetadata'||_0x187e1c===_0x33e0('0xbd')||_0x187e1c==='DecimalAttributeMetadata'){_0x2267e3[_0x33e0('0xb3')](getInputList(_0x16714b,_0x39e520,_0x187e1c,_0x5dd2d,_0x5728f9[_0x33e0('0xb4')],_0x3f1edd[_0x33e0('0xb4')],_0x5ba8d8));}}});return Promise[_0x33e0('0xb5')](_0x2267e3);})[_0x33e0('0x17')](function(_0x502014){_0x55f6c9=_0x502014[0x0];var _0x27f1ea=_0x54dfad[_0x33e0('0x9c')](_0x3ebb5c)[_0x33e0('0x9c')](_0x55f6c9);var _0x1e46c0={'count':_0x27f1ea[_0x33e0('0x4b')],'rows':_0x27f1ea};return _0x1e46c0;})[_0x33e0('0x17')](respondWithResult(_0x4e6fa4,null))[_0x33e0('0x21')](function(_0x214fbb){console[_0x33e0('0xbe')]('Dynamics365\x20error:\x20'+_0x214fbb);var _0x2ae58f=_0x29b410[_0x33e0('0x34')]['test']?0x1f4:_0x214fbb[_0x33e0('0xbf')]||0x1f4;logger[_0x33e0('0x1e')](_0x214fbb[_0x33e0('0xc0')]);delete _0x214fbb[_0x33e0('0x2d')];if(_0x2ae58f===0x191){_0x2ae58f=0x190;}_0x4e6fa4[_0x33e0('0x24')](_0x2ae58f)[_0x33e0('0x2e')](_0x29b410[_0x33e0('0x34')][_0x33e0('0x15')]?{'message':'Wrong\x20credentials','statusCode':_0x214fbb[_0x33e0('0xbf')]}:_0x214fbb);});};function getSelectList(_0x572d57,_0x4d41be,_0x1a1f46,_0x30ae09,_0x23e6ac,_0x55a12e){var _0xd8eff5={'method':_0x33e0('0xa9'),'uri':_0x572d57+_0x33e0('0xad')+_0x30ae09+_0x33e0('0xc1')+_0x23e6ac+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x33e0('0xc2'),'headers':{'Authorization':'Bearer\x20'+_0x55a12e,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0xd8eff5)[_0x33e0('0x17')](function(_0x27daeb){var _0x47b88f=[];var _0x5e507d=_0x27daeb[_0x33e0('0xc3')][_0x33e0('0xc4')];_0x5e507d['forEach'](function(_0x558f8a){_0x47b88f['push']({'name':_0x558f8a[_0x33e0('0xc5')][_0x33e0('0xc6')][_0x33e0('0xc5')],'value':String(_0x558f8a[_0x33e0('0xc7')])});});var _0x41c663={'id':_0x4d41be+'_'+_0x27daeb[_0x33e0('0xc8')],'name':_0x27daeb[_0x33e0('0xc9')][_0x33e0('0xc6')]['Label'],'custom':![],'options':_0x47b88f};_0x1a1f46[_0x33e0('0xb3')](_0x41c663);return _0x1a1f46;});}function getBooleanList(_0x4ba8e3,_0x1050e2,_0x1a31d5,_0x13ac93,_0x3a209e,_0x107080){var _0x5e4708={'method':_0x33e0('0xa9'),'uri':_0x4ba8e3+_0x33e0('0xad')+_0x13ac93+_0x33e0('0xc1')+_0x3a209e+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':'Bearer\x20'+_0x107080,'If-None-Match':null,'OData-Version':_0x33e0('0xab')},'json':!![]};return rp(_0x5e4708)[_0x33e0('0x17')](function(_0x43bcc2){var _0x47755c=[];_0x47755c[_0x33e0('0xb3')]({'name':_0x43bcc2['OptionSet'][_0x33e0('0xca')][_0x33e0('0xc5')][_0x33e0('0xc6')][_0x33e0('0xc5')],'value':_0x33e0('0xcb')},{'name':_0x43bcc2[_0x33e0('0xc3')]['FalseOption'][_0x33e0('0xc5')][_0x33e0('0xc6')]['Label'],'value':_0x33e0('0xcc')});var _0x372baa={'id':_0x1050e2+'_'+_0x43bcc2[_0x33e0('0xc8')],'name':_0x43bcc2[_0x33e0('0xc9')]['UserLocalizedLabel'][_0x33e0('0xc5')],'custom':![],'options':_0x47755c};_0x1a31d5[_0x33e0('0xb3')](_0x372baa);return _0x1a31d5;});}function getInputList(_0x3a9ef6,_0x29f25b,_0x47c466,_0x467669,_0x5b7b46,_0x29bcbf,_0x484622){var _0x14c30f={'method':_0x33e0('0xa9'),'uri':_0x3a9ef6+_0x33e0('0xad')+_0x5b7b46+_0x33e0('0xc1')+_0x29bcbf+')/Microsoft.Dynamics.CRM.'+_0x47c466+_0x33e0('0xcd'),'headers':{'Authorization':'Bearer\x20'+_0x484622,'If-None-Match':null,'OData-Version':_0x33e0('0xab')},'json':!![]};return rp(_0x14c30f)[_0x33e0('0x17')](function(_0xfde945){var _0x1fa075={'id':_0x29f25b+'_'+_0xfde945['LogicalName'],'name':_0xfde945['DisplayName'][_0x33e0('0xc6')]?_0xfde945['DisplayName'][_0x33e0('0xc6')][_0x33e0('0xc5')]:_0xfde945[_0x33e0('0xc8')],'custom':![],'options':[]};_0x467669[_0x33e0('0xb3')](_0x1fa075);return _0x467669;});} \ No newline at end of file +var _0xd6fd=['title','description','customerid','ownerid','subject','phonenumber','regardingobjectid','directioncode','accountidname','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','entitlementidname','entityimage_timestamp','entityimage_url','importsequencenumber','influencescore','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','remoteUri','clientSecret','substring','lastIndexOf','format','%s/api/data/v9.0/','POST','tenantId','/oauth2/token','password','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','value','EntityDefinitions(','4.0','Attributes','remove','includes','forEach','@odata.type','push','MetadataId','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','log','Dynamics365\x20error:\x20','test','statusCode','send',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','Value','LogicalName','DisplayName','UserLocalizedLabel',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','true','OptionSet','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','html-pdf','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','request','then','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','catch','sendStatus','status','end','count','limit','set','Content-Range','json','reject','save','update','destroy','stack','name','index','Dynamics365Account','rawAttributes','model','query','keys','intersection','attributes','fields','length','nolimit','offset','order','where','filters','pick','filter','map','type','VIRTUAL','field','merge','options','includeAll','findAll','rows','include','find','create','body','params','getConfigurations','findOne','Dynamics365Configuration','hasOwnProperty','addConfiguration','AccountId','getSubjects','channel','Descriptions','Dynamics365Field','Subjects','getFields','ticketType','PhoneCall'];(function(_0x50580f,_0x10c7f3){var _0x41158d=function(_0x5cc0a4){while(--_0x5cc0a4){_0x50580f['push'](_0x50580f['shift']());}};_0x41158d(++_0x10c7f3);}(_0xd6fd,0x7d));var _0xdd6f=function(_0x4cba86,_0x51a278){_0x4cba86=_0x4cba86-0x0;var _0x268f75=_0xd6fd[_0x4cba86];return _0x268f75;};'use strict';var pdf=require(_0xdd6f('0x0'));var emlformat=require(_0xdd6f('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdd6f('0x2'));var moment=require(_0xdd6f('0x3'));var BPromise=require(_0xdd6f('0x4'));var Mustache=require(_0xdd6f('0x5'));var util=require(_0xdd6f('0x6'));var path=require(_0xdd6f('0x7'));var sox=require(_0xdd6f('0x8'));var csv=require(_0xdd6f('0x9'));var ejs=require(_0xdd6f('0xa'));var fs=require('fs');var _=require(_0xdd6f('0xb'));var squel=require(_0xdd6f('0xc'));var crypto=require(_0xdd6f('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xdd6f('0x9'));var querystring=require('querystring');var Papa=require(_0xdd6f('0xe'));var Redis=require(_0xdd6f('0xf'));var authService=require(_0xdd6f('0x10'));var qs=require(_0xdd6f('0x11'));var hardwareService=require(_0xdd6f('0x12'));var logger=require(_0xdd6f('0x13'))(_0xdd6f('0x14'));var utils=require(_0xdd6f('0x15'));var config=require(_0xdd6f('0x16'));var db=require(_0xdd6f('0x17'))['db'];var integrations=require(_0xdd6f('0x18'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x51e56b,_0xf0f2f0,_0x74729a){if(_0x74729a){var _0x577016=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x577016['test'](_0xf0f2f0)){return _0x51e56b;}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 _0x51e56b;}}function respondWithRpcPromise(_0x3e9cf3,_0x2bfd22,_0x9c141e,_0xd63d26){return new BPromise(function(_0x8419d8,_0x584502){var _0x31c760=_0xd63d26||client;return _0x31c760[_0xdd6f('0x19')](_0x3e9cf3,_0x9c141e)[_0xdd6f('0x1a')](function(_0x5e72a6){logger['info'](_0xdd6f('0x1b'),_0x2bfd22,'request\x20sent');logger[_0xdd6f('0x1c')](_0xdd6f('0x1d'),_0x2bfd22,_0xdd6f('0x1e'),JSON[_0xdd6f('0x1f')](_0x5e72a6));if(_0x5e72a6[_0xdd6f('0x20')]){if(_0x5e72a6['error']['code']===0x1f4){logger['error'](_0xdd6f('0x1b'),_0x2bfd22,_0x5e72a6[_0xdd6f('0x20')]['message']);return _0x584502(_0x5e72a6['error'][_0xdd6f('0x21')]);}logger['error'](_0xdd6f('0x1b'),_0x2bfd22,_0x5e72a6['error'][_0xdd6f('0x21')]);return _0x8419d8(_0x5e72a6[_0xdd6f('0x20')]['message']);}else{logger[_0xdd6f('0x22')](_0xdd6f('0x1b'),_0x2bfd22,_0xdd6f('0x1e'));_0x8419d8(_0x5e72a6['result'][_0xdd6f('0x21')]);}})[_0xdd6f('0x23')](function(_0x49b961){logger[_0xdd6f('0x20')](_0xdd6f('0x1b'),_0x2bfd22,_0x49b961);_0x584502(_0x49b961);});});}function respondWithStatusCode(_0x5b419d,_0x2d598e){_0x2d598e=_0x2d598e||0xcc;return function(_0x5370d8){if(_0x5370d8){return _0x5b419d[_0xdd6f('0x24')](_0x2d598e);}return _0x5b419d[_0xdd6f('0x25')](_0x2d598e)[_0xdd6f('0x26')]();};}function respondWithResult(_0x161d29,_0x22f78d){_0x22f78d=_0x22f78d||0xc8;return function(_0x59f6e8){if(_0x59f6e8){return _0x161d29[_0xdd6f('0x25')](_0x22f78d)['json'](_0x59f6e8);}};}function respondWithFilteredResult(_0x2a601d,_0x59c825){return function(_0x59e863){if(_0x59e863){var _0x37c7e6=_0x59e863[_0xdd6f('0x27')],_0x2c951b=_0x59c825['offset'],_0x20a235=_0x59c825['offset']+_0x59c825[_0xdd6f('0x28')],_0x276ff4;if(_0x20a235>=_0x37c7e6){_0x20a235=_0x37c7e6;_0x276ff4=0xc8;}else{_0x276ff4=0xce;}_0x2a601d[_0xdd6f('0x25')](_0x276ff4);return _0x2a601d[_0xdd6f('0x29')](_0xdd6f('0x2a'),_0x2c951b+'-'+_0x20a235+'/'+_0x37c7e6)[_0xdd6f('0x2b')](_0x59e863);}return null;};}function patchUpdates(_0x3b7598){return function(_0x32d3bb){try{jsonpatch['apply'](_0x32d3bb,_0x3b7598,!![]);}catch(_0x4e85e8){return BPromise[_0xdd6f('0x2c')](_0x4e85e8);}return _0x32d3bb[_0xdd6f('0x2d')]();};}function saveUpdates(_0x10ee43,_0x453e40){return function(_0x71a1d2){if(_0x71a1d2){return _0x71a1d2[_0xdd6f('0x2e')](_0x10ee43)['then'](function(_0x50470e){return _0x50470e;});}return null;};}function removeEntity(_0x1eae25,_0x42c07c){return function(_0x39b5c3){if(_0x39b5c3){return _0x39b5c3[_0xdd6f('0x2f')]()['then'](function(){_0x1eae25[_0xdd6f('0x25')](0xcc)[_0xdd6f('0x26')]();});}};}function handleEntityNotFound(_0x4b8a78,_0x47a3db){return function(_0x23f144){if(!_0x23f144){_0x4b8a78['sendStatus'](0x194);}return _0x23f144;};}function handleError(_0x1ea1a4,_0x44e58b){_0x44e58b=_0x44e58b||0x1f4;return function(_0x5fdc64){logger[_0xdd6f('0x20')](_0x5fdc64[_0xdd6f('0x30')]);if(_0x5fdc64[_0xdd6f('0x31')]){delete _0x5fdc64[_0xdd6f('0x31')];}_0x1ea1a4[_0xdd6f('0x25')](_0x44e58b)['send'](_0x5fdc64);};}exports[_0xdd6f('0x32')]=function(_0x1f8c94,_0x116684){var _0x88803={},_0x54afbd={},_0x2bbf24={'count':0x0,'rows':[]};var _0x1598ee=db[_0xdd6f('0x33')][_0xdd6f('0x34')];_0x54afbd[_0xdd6f('0x35')]=_['keys'](_0x1598ee);_0x54afbd[_0xdd6f('0x36')]=_[_0xdd6f('0x37')](_0x1f8c94[_0xdd6f('0x36')]);_0x54afbd['filters']=_[_0xdd6f('0x38')](_0x54afbd[_0xdd6f('0x35')],_0x54afbd[_0xdd6f('0x36')]);_0x88803[_0xdd6f('0x39')]=_[_0xdd6f('0x38')](_0x54afbd[_0xdd6f('0x35')],qs['fields'](_0x1f8c94[_0xdd6f('0x36')][_0xdd6f('0x3a')]));_0x88803[_0xdd6f('0x39')]=_0x88803['attributes'][_0xdd6f('0x3b')]?_0x88803[_0xdd6f('0x39')]:_0x54afbd['model'];if(!_0x1f8c94['query']['hasOwnProperty'](_0xdd6f('0x3c'))){_0x88803[_0xdd6f('0x28')]=qs['limit'](_0x1f8c94['query'][_0xdd6f('0x28')]);_0x88803[_0xdd6f('0x3d')]=qs[_0xdd6f('0x3d')](_0x1f8c94['query'][_0xdd6f('0x3d')]);}_0x88803[_0xdd6f('0x3e')]=qs['sort'](_0x1f8c94[_0xdd6f('0x36')]['sort']);_0x88803[_0xdd6f('0x3f')]=qs[_0xdd6f('0x40')](_[_0xdd6f('0x41')](_0x1f8c94[_0xdd6f('0x36')],_0x54afbd[_0xdd6f('0x40')]));if(_0x1f8c94[_0xdd6f('0x36')][_0xdd6f('0x42')]){_0x88803[_0xdd6f('0x3f')]=_['merge'](_0x88803[_0xdd6f('0x3f')],{'$or':_[_0xdd6f('0x43')](_0x1598ee,function(_0x50253a){if(_0x50253a[_0xdd6f('0x44')]['key']!==_0xdd6f('0x45')){var _0x2bdb64={};_0x2bdb64[_0x50253a[_0xdd6f('0x46')]]={'$like':'%'+_0x1f8c94['query'][_0xdd6f('0x42')]+'%'};return _0x2bdb64;}})});}_0x88803=_[_0xdd6f('0x47')]({},_0x88803,_0x1f8c94[_0xdd6f('0x48')]);var _0x4fb5a4={'where':_0x88803[_0xdd6f('0x3f')]};return db[_0xdd6f('0x33')][_0xdd6f('0x27')](_0x4fb5a4)['then'](function(_0x1e1bb5){_0x2bbf24[_0xdd6f('0x27')]=_0x1e1bb5;if(_0x1f8c94[_0xdd6f('0x36')][_0xdd6f('0x49')]){_0x88803['include']=[{'all':!![]}];}return db['Dynamics365Account'][_0xdd6f('0x4a')](_0x88803);})[_0xdd6f('0x1a')](function(_0x365868){_0x2bbf24[_0xdd6f('0x4b')]=_0x365868;return _0x2bbf24;})[_0xdd6f('0x1a')](respondWithFilteredResult(_0x116684,_0x88803))[_0xdd6f('0x23')](handleError(_0x116684,null));};exports['show']=function(_0x4b7a6c,_0x49a1e1){var _0x56fce8={'raw':![],'where':{'id':_0x4b7a6c['params']['id']}},_0x3dfc46={};_0x3dfc46[_0xdd6f('0x35')]=_[_0xdd6f('0x37')](db[_0xdd6f('0x33')][_0xdd6f('0x34')]);_0x3dfc46['query']=_[_0xdd6f('0x37')](_0x4b7a6c[_0xdd6f('0x36')]);_0x3dfc46[_0xdd6f('0x40')]=_[_0xdd6f('0x38')](_0x3dfc46['model'],_0x3dfc46[_0xdd6f('0x36')]);_0x56fce8[_0xdd6f('0x39')]=_[_0xdd6f('0x38')](_0x3dfc46['model'],qs['fields'](_0x4b7a6c['query'][_0xdd6f('0x3a')]));_0x56fce8['attributes']=_0x56fce8[_0xdd6f('0x39')]['length']?_0x56fce8[_0xdd6f('0x39')]:_0x3dfc46[_0xdd6f('0x35')];if(_0x4b7a6c['query'][_0xdd6f('0x49')]){_0x56fce8[_0xdd6f('0x4c')]=[{'all':!![]}];}_0x56fce8=_[_0xdd6f('0x47')]({},_0x56fce8,_0x4b7a6c['options']);return db[_0xdd6f('0x33')][_0xdd6f('0x4d')](_0x56fce8)['then'](handleEntityNotFound(_0x49a1e1,null))[_0xdd6f('0x1a')](respondWithResult(_0x49a1e1,null))[_0xdd6f('0x23')](handleError(_0x49a1e1,null));};exports[_0xdd6f('0x4e')]=function(_0x3a29f3,_0x48e8a6){return db['Dynamics365Account'][_0xdd6f('0x4e')](_0x3a29f3[_0xdd6f('0x4f')],{})[_0xdd6f('0x1a')](respondWithResult(_0x48e8a6,0xc9))[_0xdd6f('0x23')](handleError(_0x48e8a6,null));};exports['update']=function(_0x25876b,_0x10009b){if(_0x25876b['body']['id']){delete _0x25876b[_0xdd6f('0x4f')]['id'];}return db[_0xdd6f('0x33')][_0xdd6f('0x4d')]({'where':{'id':_0x25876b['params']['id']}})[_0xdd6f('0x1a')](handleEntityNotFound(_0x10009b,null))['then'](saveUpdates(_0x25876b[_0xdd6f('0x4f')],null))[_0xdd6f('0x1a')](respondWithResult(_0x10009b,null))[_0xdd6f('0x23')](handleError(_0x10009b,null));};exports['destroy']=function(_0x1e0895,_0x391fbc){return db[_0xdd6f('0x33')][_0xdd6f('0x4d')]({'where':{'id':_0x1e0895[_0xdd6f('0x50')]['id']}})['then'](handleEntityNotFound(_0x391fbc,null))[_0xdd6f('0x1a')](removeEntity(_0x391fbc,null))['catch'](handleError(_0x391fbc,null));};exports[_0xdd6f('0x51')]=function(_0x17c829,_0x2fe306,_0x536b0f){var _0x33dc30={};var _0x37af4c={};var _0x3e9e55;var _0x1a1b19;return db[_0xdd6f('0x33')][_0xdd6f('0x52')]({'where':{'id':_0x17c829[_0xdd6f('0x50')]['id']}})[_0xdd6f('0x1a')](handleEntityNotFound(_0x2fe306,null))[_0xdd6f('0x1a')](function(_0x130942){if(_0x130942){_0x3e9e55=_0x130942;_0x37af4c[_0xdd6f('0x35')]=_['keys'](db[_0xdd6f('0x53')][_0xdd6f('0x34')]);_0x37af4c[_0xdd6f('0x36')]=_[_0xdd6f('0x37')](_0x17c829[_0xdd6f('0x36')]);_0x37af4c[_0xdd6f('0x40')]=_[_0xdd6f('0x38')](_0x37af4c['model'],_0x37af4c[_0xdd6f('0x36')]);_0x33dc30['attributes']=_['intersection'](_0x37af4c[_0xdd6f('0x35')],qs[_0xdd6f('0x3a')](_0x17c829[_0xdd6f('0x36')][_0xdd6f('0x3a')]));_0x33dc30['attributes']=_0x33dc30[_0xdd6f('0x39')][_0xdd6f('0x3b')]?_0x33dc30[_0xdd6f('0x39')]:_0x37af4c[_0xdd6f('0x35')];_0x33dc30['order']=qs['sort'](_0x17c829[_0xdd6f('0x36')]['sort']);_0x33dc30['where']=qs[_0xdd6f('0x40')](_[_0xdd6f('0x41')](_0x17c829[_0xdd6f('0x36')],_0x37af4c['filters']));if(_0x17c829[_0xdd6f('0x36')][_0xdd6f('0x42')]){_0x33dc30[_0xdd6f('0x3f')]=_[_0xdd6f('0x47')](_0x33dc30[_0xdd6f('0x3f')],{'$or':_['map'](_0x33dc30[_0xdd6f('0x39')],function(_0x3996ff){var _0x1067e3={};_0x1067e3[_0x3996ff]={'$like':'%'+_0x17c829[_0xdd6f('0x36')]['filter']+'%'};return _0x1067e3;})});}_0x33dc30=_[_0xdd6f('0x47')]({},_0x33dc30,_0x17c829[_0xdd6f('0x48')]);return _0x3e9e55[_0xdd6f('0x51')](_0x33dc30);}})[_0xdd6f('0x1a')](function(_0x5e76e5){if(_0x5e76e5){_0x1a1b19=_0x5e76e5['length'];if(!_0x17c829[_0xdd6f('0x36')][_0xdd6f('0x54')]('nolimit')){_0x33dc30['limit']=qs['limit'](_0x17c829['query'][_0xdd6f('0x28')]);_0x33dc30['offset']=qs[_0xdd6f('0x3d')](_0x17c829['query'][_0xdd6f('0x3d')]);}return _0x3e9e55[_0xdd6f('0x51')](_0x33dc30);}})[_0xdd6f('0x1a')](function(_0x18a9a0){if(_0x18a9a0){return _0x18a9a0?{'count':_0x1a1b19,'rows':_0x18a9a0}:null;}})[_0xdd6f('0x1a')](respondWithResult(_0x2fe306,null))[_0xdd6f('0x23')](handleError(_0x2fe306,null));};exports[_0xdd6f('0x55')]=function(_0x2ee852,_0x464bef,_0x19a773){if(_0x2ee852[_0xdd6f('0x4f')]['id']){delete _0x2ee852[_0xdd6f('0x4f')]['id'];}return db[_0xdd6f('0x33')][_0xdd6f('0x52')]({'where':{'id':_0x2ee852[_0xdd6f('0x50')]['id']}})[_0xdd6f('0x1a')](handleEntityNotFound(_0x464bef,null))[_0xdd6f('0x1a')](function(_0x367961){if(_0x367961){_0x2ee852[_0xdd6f('0x4f')][_0xdd6f('0x56')]=_0x367961['id'];_0x2ee852[_0xdd6f('0x4f')]['Subjects']=integrations[_0xdd6f('0x57')](_0x2ee852[_0xdd6f('0x4f')][_0xdd6f('0x58')],_0x2ee852['body'][_0xdd6f('0x44')]);_0x2ee852[_0xdd6f('0x4f')][_0xdd6f('0x59')]=integrations['getDescriptions'](_0x2ee852['body']['channel'],_0x2ee852[_0xdd6f('0x4f')]['type']);return db['Dynamics365Configuration'][_0xdd6f('0x4e')](_0x2ee852['body'],{'include':[{'model':db[_0xdd6f('0x5a')],'as':_0xdd6f('0x5b')},{'model':db[_0xdd6f('0x5a')],'as':_0xdd6f('0x59')}]});}return null;})[_0xdd6f('0x1a')](respondWithResult(_0x464bef,null))[_0xdd6f('0x23')](handleError(_0x464bef,null));};exports[_0xdd6f('0x5c')]=function(_0x78a32e,_0x8ad63c,_0x41143d){var _0x44e14b=_0x78a32e[_0xdd6f('0x36')][_0xdd6f('0x5d')];var _0x46d15e=_0x44e14b==='incident'?'Incident':_0xdd6f('0x5e');var _0xc6eaa7='';var _0x1e8ea7='';var _0x411e38='';var _0x342747='';var _0x2739d3='';var _0x5bdfe5='';var _0x1df619='';var _0x35613b='';var _0x54b59d=[_0xdd6f('0x5f'),_0xdd6f('0x60'),_0xdd6f('0x61'),_0xdd6f('0x62'),'caseorigincode',_0xdd6f('0x63'),_0xdd6f('0x64'),_0xdd6f('0x65'),_0xdd6f('0x66'),'phonecall_activity_parties'];var _0x539cf4=[_0xdd6f('0x67'),'accountidyominame',_0xdd6f('0x68'),_0xdd6f('0x69'),_0xdd6f('0x6a'),_0xdd6f('0x6b'),_0xdd6f('0x6c'),_0xdd6f('0x6d'),_0xdd6f('0x6e'),_0xdd6f('0x6f'),_0xdd6f('0x70'),_0xdd6f('0x71'),'createdon',_0xdd6f('0x72'),_0xdd6f('0x73'),_0xdd6f('0x74'),_0xdd6f('0x75'),_0xdd6f('0x76'),'emailaddress',_0xdd6f('0x77'),_0xdd6f('0x78'),_0xdd6f('0x79'),'escalatedon','exchangerate','firstresponsebykpiidname','followupby',_0xdd6f('0x7a'),_0xdd6f('0x7b'),'kbarticleidname',_0xdd6f('0x7c'),_0xdd6f('0x7d'),_0xdd6f('0x7e'),_0xdd6f('0x7f'),_0xdd6f('0x80'),_0xdd6f('0x81'),_0xdd6f('0x82'),_0xdd6f('0x83'),_0xdd6f('0x84'),'msdyn_incidenttypename',_0xdd6f('0x85'),_0xdd6f('0x86'),_0xdd6f('0x87'),_0xdd6f('0x88'),'owneridname','owneridtype',_0xdd6f('0x89'),_0xdd6f('0x8a'),_0xdd6f('0x8b'),_0xdd6f('0x8c'),'prioritycodename',_0xdd6f('0x8d'),_0xdd6f('0x8e'),_0xdd6f('0x8f'),_0xdd6f('0x90'),_0xdd6f('0x91'),_0xdd6f('0x92'),_0xdd6f('0x93'),_0xdd6f('0x94'),_0xdd6f('0x95'),_0xdd6f('0x96'),_0xdd6f('0x97'),_0xdd6f('0x98'),_0xdd6f('0x99'),'subjectidname',_0xdd6f('0x9a'),_0xdd6f('0x9b'),_0xdd6f('0x9c'),_0xdd6f('0x9d'),_0xdd6f('0x9e'),_0xdd6f('0x9f')];var _0x3d9c21=_0x54b59d[_0xdd6f('0xa0')](_0x539cf4);return db[_0xdd6f('0x33')]['findOne']({'where':{'id':_0x78a32e[_0xdd6f('0x50')]['id']},'attributes':['id',_0xdd6f('0xa1'),'password',_0xdd6f('0xa2'),'tenantId','clientId',_0xdd6f('0xa3')]})[_0xdd6f('0x1a')](handleEntityNotFound(_0x8ad63c,null))[_0xdd6f('0x1a')](function(_0x2fab48){if(_0x2fab48){_0x35613b=_0x2fab48[_0xdd6f('0xa2')];var _0x4480f7=_0x35613b['slice'](-0x1);if(_0x4480f7==='/'){_0x35613b=_0x35613b[_0xdd6f('0xa4')](0x0,_0x35613b[_0xdd6f('0xa5')](_0x4480f7));}_0x1df619=util[_0xdd6f('0xa6')](_0xdd6f('0xa7'),_0x35613b);var _0x27be12={'method':_0xdd6f('0xa8'),'uri':'https://login.microsoftonline.com/'+_0x2fab48[_0xdd6f('0xa9')]+_0xdd6f('0xaa'),'form':{'client_id':_0x2fab48['clientId'],'resource':_0x35613b,'username':_0x2fab48[_0xdd6f('0xa1')],'password':_0x2fab48[_0xdd6f('0xab')],'grant_type':'password','client_secret':_0x2fab48[_0xdd6f('0xa3')]},'json':!![]};return rp(_0x27be12);}})['then'](function(_0x53da76){_0x5bdfe5=_0x53da76[_0xdd6f('0xac')];var _0xfca8e0={'method':_0xdd6f('0xad'),'uri':encodeURI(_0x1df619+_0xdd6f('0xae')+_0x46d15e+'\x27'),'headers':{'Authorization':_0xdd6f('0xaf')+_0x5bdfe5,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0xfca8e0);})[_0xdd6f('0x1a')](function(_0x53bed6){var _0x50b3cb=_0x53bed6[_0xdd6f('0xb0')][0x0];var _0xd1c99e=_0x50b3cb['MetadataId'];var _0x7334e={'method':_0xdd6f('0xad'),'uri':_0x1df619+_0xdd6f('0xb1')+_0xd1c99e+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0xdd6f('0xaf')+_0x5bdfe5,'If-None-Match':null,'OData-Version':_0xdd6f('0xb2')},'json':!![]};return rp(_0x7334e);})['then'](function(_0x29e977){_0xc6eaa7=_0x29e977;_0x1e8ea7=_0xc6eaa7[_0xdd6f('0xb3')];_0x1e8ea7=_[_0xdd6f('0xb4')](_0x1e8ea7,function(_0x5ee90a){return!_0x3d9c21[_0xdd6f('0xb5')](_0x5ee90a['LogicalName']);});var _0x59165b=[];var _0x292166=[];_0x1e8ea7[_0xdd6f('0xb6')](function(_0x4d9f30){if(_0x4d9f30[_0xdd6f('0xb7')]){var _0x3be670=_0x4d9f30[_0xdd6f('0xb7')][_0xdd6f('0xa4')](_0x4d9f30[_0xdd6f('0xb7')][_0xdd6f('0xa5')]('.')+0x1);if(_0x3be670==='PicklistAttributeMetadata'){_0x59165b[_0xdd6f('0xb8')](getSelectList(_0x1df619,_0x44e14b,_0x292166,_0xc6eaa7['MetadataId'],_0x4d9f30[_0xdd6f('0xb9')],_0x5bdfe5));}}});return Promise[_0xdd6f('0xba')](_0x59165b);})['then'](function(_0x54c7a1){_0x411e38=_0x54c7a1[0x0];var _0x26834a=[];var _0x83c868=[];_0x1e8ea7[_0xdd6f('0xb6')](function(_0x1fa407){if(!_[_0xdd6f('0xbb')](_0x1fa407[_0xdd6f('0xb7')])){var _0x211ce5=_0x1fa407['@odata.type']['substring'](_0x1fa407[_0xdd6f('0xb7')][_0xdd6f('0xa5')]('.')+0x1);if(_0x211ce5===_0xdd6f('0xbc')){_0x26834a['push'](getBooleanList(_0x1df619,_0x44e14b,_0x83c868,_0xc6eaa7['MetadataId'],_0x1fa407[_0xdd6f('0xb9')],_0x5bdfe5));}}});return Promise[_0xdd6f('0xba')](_0x26834a);})['then'](function(_0x59ab25){_0x342747=_0x59ab25[0x0];var _0x24198b=[];var _0x206ca0=[];_0x1e8ea7[_0xdd6f('0xb6')](function(_0x7eaf5c){if(_0x7eaf5c[_0xdd6f('0xb7')]){var _0x1dede8=_0x7eaf5c['@odata.type'][_0xdd6f('0xa4')](_0x7eaf5c['@odata.type']['lastIndexOf']('.')+0x1);if(_0x1dede8===_0xdd6f('0xbd')||_0x1dede8===_0xdd6f('0xbe')||_0x1dede8===_0xdd6f('0xbf')||_0x1dede8===_0xdd6f('0xc0')||_0x1dede8===_0xdd6f('0xc1')||_0x1dede8===_0xdd6f('0xc2')||_0x1dede8===_0xdd6f('0xc3')||_0x1dede8===_0xdd6f('0xc4')||_0x1dede8===_0xdd6f('0xc5')||_0x1dede8===_0xdd6f('0xc6')){_0x24198b['push'](getInputList(_0x1df619,_0x44e14b,_0x1dede8,_0x206ca0,_0xc6eaa7[_0xdd6f('0xb9')],_0x7eaf5c[_0xdd6f('0xb9')],_0x5bdfe5));}}});return Promise[_0xdd6f('0xba')](_0x24198b);})[_0xdd6f('0x1a')](function(_0xb76070){_0x2739d3=_0xb76070[0x0];var _0x5a5138=_0x411e38[_0xdd6f('0xa0')](_0x342747)[_0xdd6f('0xa0')](_0x2739d3);var _0x3fa04c={'count':_0x5a5138[_0xdd6f('0x3b')],'rows':_0x5a5138};return _0x3fa04c;})['then'](respondWithResult(_0x8ad63c,null))[_0xdd6f('0x23')](function(_0x2b6427){console[_0xdd6f('0xc7')](_0xdd6f('0xc8')+_0x2b6427);var _0x268244=_0x78a32e[_0xdd6f('0x36')][_0xdd6f('0xc9')]?0x1f4:_0x2b6427[_0xdd6f('0xca')]||0x1f4;logger['error'](_0x2b6427['stack']);delete _0x2b6427[_0xdd6f('0x31')];if(_0x268244===0x191){_0x268244=0x190;}_0x8ad63c[_0xdd6f('0x25')](_0x268244)[_0xdd6f('0xcb')](_0x78a32e[_0xdd6f('0x36')][_0xdd6f('0xc9')]?{'message':'Wrong\x20credentials','statusCode':_0x2b6427[_0xdd6f('0xca')]}:_0x2b6427);});};function getSelectList(_0x35d491,_0x40b898,_0x1e10a1,_0x2d1798,_0x236897,_0x2a2a21){var _0x2a3add={'method':_0xdd6f('0xad'),'uri':_0x35d491+_0xdd6f('0xb1')+_0x2d1798+_0xdd6f('0xcc')+_0x236897+_0xdd6f('0xcd')+_0xdd6f('0xce'),'headers':{'Authorization':_0xdd6f('0xaf')+_0x2a2a21,'If-None-Match':null,'OData-Version':_0xdd6f('0xb2')},'json':!![]};return rp(_0x2a3add)['then'](function(_0x31de9a){var _0x300665=[];var _0x2a8889=_0x31de9a['OptionSet'][_0xdd6f('0xcf')];_0x2a8889[_0xdd6f('0xb6')](function(_0x4a7288){_0x300665['push']({'name':_0x4a7288[_0xdd6f('0xd0')]['UserLocalizedLabel'][_0xdd6f('0xd0')],'value':String(_0x4a7288[_0xdd6f('0xd1')])});});var _0x46c118={'id':_0x40b898+'_'+_0x31de9a[_0xdd6f('0xd2')],'name':_0x31de9a[_0xdd6f('0xd3')][_0xdd6f('0xd4')][_0xdd6f('0xd0')],'custom':![],'options':_0x300665};_0x1e10a1[_0xdd6f('0xb8')](_0x46c118);return _0x1e10a1;});}function getBooleanList(_0x5e10cd,_0x2a1511,_0xa84c3,_0x596fd8,_0xbfc4fb,_0x1f65d6){var _0x3710f2={'method':_0xdd6f('0xad'),'uri':_0x5e10cd+_0xdd6f('0xb1')+_0x596fd8+_0xdd6f('0xcc')+_0xbfc4fb+_0xdd6f('0xd5'),'headers':{'Authorization':_0xdd6f('0xaf')+_0x1f65d6,'If-None-Match':null,'OData-Version':_0xdd6f('0xb2')},'json':!![]};return rp(_0x3710f2)[_0xdd6f('0x1a')](function(_0x590776){var _0x3102f4=[];_0x3102f4[_0xdd6f('0xb8')]({'name':_0x590776['OptionSet']['TrueOption'][_0xdd6f('0xd0')][_0xdd6f('0xd4')][_0xdd6f('0xd0')],'value':_0xdd6f('0xd6')},{'name':_0x590776[_0xdd6f('0xd7')][_0xdd6f('0xd8')][_0xdd6f('0xd0')][_0xdd6f('0xd4')][_0xdd6f('0xd0')],'value':_0xdd6f('0xd9')});var _0x4c55c4={'id':_0x2a1511+'_'+_0x590776[_0xdd6f('0xd2')],'name':_0x590776[_0xdd6f('0xd3')][_0xdd6f('0xd4')][_0xdd6f('0xd0')],'custom':![],'options':_0x3102f4};_0xa84c3[_0xdd6f('0xb8')](_0x4c55c4);return _0xa84c3;});}function getInputList(_0x124b7b,_0x18a478,_0x4aa533,_0x37334f,_0xbaa568,_0x599378,_0x196af8){var _0x1df812={'method':_0xdd6f('0xad'),'uri':_0x124b7b+_0xdd6f('0xb1')+_0xbaa568+_0xdd6f('0xcc')+_0x599378+_0xdd6f('0xda')+_0x4aa533+_0xdd6f('0xdb'),'headers':{'Authorization':_0xdd6f('0xaf')+_0x196af8,'If-None-Match':null,'OData-Version':_0xdd6f('0xb2')},'json':!![]};return rp(_0x1df812)[_0xdd6f('0x1a')](function(_0x4f0705){var _0x21dd3b={'id':_0x18a478+'_'+_0x4f0705[_0xdd6f('0xd2')],'name':_0x4f0705[_0xdd6f('0xd3')][_0xdd6f('0xd4')]?_0x4f0705[_0xdd6f('0xd3')][_0xdd6f('0xd4')][_0xdd6f('0xd0')]:_0x4f0705[_0xdd6f('0xd2')],'custom':![],'options':[]};_0x37334f[_0xdd6f('0xb8')](_0x21dd3b);return _0x37334f;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index b24556c..88fa76b 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 _0x269c=['../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x1be5a6,_0x50dff7){var _0x1c3173=function(_0x3091e5){while(--_0x3091e5){_0x1be5a6['push'](_0x1be5a6['shift']());}};_0x1c3173(++_0x50dff7);}(_0x269c,0x149));var _0xc269=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x269c[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0xc269('0x0'));var logger=require(_0xc269('0x1'))(_0xc269('0x2'));var moment=require(_0xc269('0x3'));var BPromise=require('bluebird');var rp=require(_0xc269('0x4'));var fs=require('fs');var path=require(_0xc269('0x5'));var rimraf=require(_0xc269('0x6'));var config=require(_0xc269('0x7'));var attributes=require(_0xc269('0x8'));var integrations=require(_0xc269('0x9'));module[_0xc269('0xa')]=function(_0x7e9f1c,_0x57e230){return _0x7e9f1c[_0xc269('0xb')](_0xc269('0xc'),attributes,{'tableName':_0xc269('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xee22=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','Dynamics365Account','int_dynamics365_accounts'];(function(_0x4e6cbb,_0x3450f0){var _0x15ced4=function(_0x248dd2){while(--_0x248dd2){_0x4e6cbb['push'](_0x4e6cbb['shift']());}};_0x15ced4(++_0x3450f0);}(_0xee22,0x1a4));var _0x2ee2=function(_0x59ec7a,_0x1eb345){_0x59ec7a=_0x59ec7a-0x0;var _0x8535ed=_0xee22[_0x59ec7a];return _0x8535ed;};'use strict';var _=require(_0x2ee2('0x0'));var util=require(_0x2ee2('0x1'));var logger=require(_0x2ee2('0x2'))(_0x2ee2('0x3'));var moment=require(_0x2ee2('0x4'));var BPromise=require(_0x2ee2('0x5'));var rp=require(_0x2ee2('0x6'));var fs=require('fs');var path=require(_0x2ee2('0x7'));var rimraf=require(_0x2ee2('0x8'));var config=require(_0x2ee2('0x9'));var attributes=require('./intDynamics365Account.attributes');var integrations=require(_0x2ee2('0xa'));module[_0x2ee2('0xb')]=function(_0x30d4a9,_0x2082fa){return _0x30d4a9['define'](_0x2ee2('0xc'),attributes,{'tableName':_0x2ee2('0xd'),'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 718e1d8..5408895 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 _0x40a3=['message','result','catch','GetDynamics365Account','Dynamics365Account','options','where','attributes','include','map','model','ShowDynamics365Account','find','raw','debug','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','stringify','error'];(function(_0x17b4d7,_0x38af02){var _0x2c107e=function(_0x2aa8d8){while(--_0x2aa8d8){_0x17b4d7['push'](_0x17b4d7['shift']());}};_0x2c107e(++_0x38af02);}(_0x40a3,0xc3));var _0x340a=function(_0x362dec,_0x13a21e){_0x362dec=_0x362dec-0x0;var _0x355492=_0x40a3[_0x362dec];return _0x355492;};'use strict';var _=require(_0x340a('0x0'));var util=require(_0x340a('0x1'));var moment=require(_0x340a('0x2'));var BPromise=require('bluebird');var rs=require(_0x340a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x340a('0x4'))['db'];var utils=require(_0x340a('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x340a('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x340a('0x7')][_0x340a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2012d7,_0x1ee318,_0x182e8c){return new BPromise(function(_0x2f196c,_0x3ab2ad){return client[_0x340a('0x9')](_0x2012d7,_0x182e8c)[_0x340a('0xa')](function(_0x5991f8){logger[_0x340a('0xb')](_0x340a('0xc'),_0x1ee318,'request\x20sent');logger['debug']('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x1ee318,'request\x20sent',JSON[_0x340a('0xd')](_0x5991f8));if(_0x5991f8[_0x340a('0xe')]){if(_0x5991f8[_0x340a('0xe')]['code']===0x1f4){logger[_0x340a('0xe')](_0x340a('0xc'),_0x1ee318,_0x5991f8[_0x340a('0xe')][_0x340a('0xf')]);return _0x3ab2ad(_0x5991f8[_0x340a('0xe')]['message']);}logger[_0x340a('0xe')](_0x340a('0xc'),_0x1ee318,_0x5991f8['error'][_0x340a('0xf')]);return _0x2f196c(_0x5991f8['error'][_0x340a('0xf')]);}else{logger[_0x340a('0xb')](_0x340a('0xc'),_0x1ee318,'request\x20sent');_0x2f196c(_0x5991f8[_0x340a('0x10')]['message']);}})[_0x340a('0x11')](function(_0x92aaf1){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x1ee318,_0x92aaf1);_0x3ab2ad(_0x92aaf1);});});}exports[_0x340a('0x12')]=function(_0x47b3c4){var _0x5ae6e8=this;return new Promise(function(_0x28e2ae,_0x4ede46){return db[_0x340a('0x13')]['findAll']({'raw':_0x47b3c4[_0x340a('0x14')]?_0x47b3c4[_0x340a('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x47b3c4[_0x340a('0x14')]?_0x47b3c4[_0x340a('0x14')][_0x340a('0x15')]||null:null,'attributes':_0x47b3c4[_0x340a('0x14')]?_0x47b3c4[_0x340a('0x14')][_0x340a('0x16')]||null:null,'limit':_0x47b3c4[_0x340a('0x14')]?_0x47b3c4[_0x340a('0x14')]['limit']||null:null,'include':_0x47b3c4[_0x340a('0x14')]?_0x47b3c4[_0x340a('0x14')][_0x340a('0x17')]?_[_0x340a('0x18')](_0x47b3c4['options'][_0x340a('0x17')],function(_0x404e89){return{'model':db[_0x404e89[_0x340a('0x19')]],'as':_0x404e89['as'],'attributes':_0x404e89['attributes'],'include':_0x404e89[_0x340a('0x17')]?_[_0x340a('0x18')](_0x404e89[_0x340a('0x17')],function(_0x18e496){return{'model':db[_0x18e496[_0x340a('0x19')]],'as':_0x18e496['as'],'attributes':_0x18e496[_0x340a('0x16')],'include':_0x18e496[_0x340a('0x17')]?_[_0x340a('0x18')](_0x18e496['include'],function(_0x40ecff){return{'model':db[_0x40ecff[_0x340a('0x19')]],'as':_0x40ecff['as'],'attributes':_0x40ecff[_0x340a('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2059e4){logger[_0x340a('0xb')](_0x340a('0x12'),_0x47b3c4);logger['debug'](_0x340a('0x12'),_0x47b3c4,JSON['stringify'](_0x2059e4));_0x28e2ae(_0x2059e4);})[_0x340a('0x11')](function(_0x1d56eb){logger[_0x340a('0xe')](_0x340a('0x12'),_0x1d56eb[_0x340a('0xf')],_0x47b3c4);_0x4ede46(_0x5ae6e8[_0x340a('0xe')](0x1f4,_0x1d56eb['message']));});});};exports[_0x340a('0x1a')]=function(_0x3b667c){var _0x468654=this;return new Promise(function(_0x5574d5,_0x270723){return db[_0x340a('0x13')][_0x340a('0x1b')]({'raw':_0x3b667c[_0x340a('0x14')]?_0x3b667c[_0x340a('0x14')][_0x340a('0x1c')]===undefined?!![]:![]:!![],'where':_0x3b667c[_0x340a('0x14')]?_0x3b667c[_0x340a('0x14')][_0x340a('0x15')]||null:null,'attributes':_0x3b667c[_0x340a('0x14')]?_0x3b667c[_0x340a('0x14')][_0x340a('0x16')]||null:null,'include':_0x3b667c['options']?_0x3b667c[_0x340a('0x14')][_0x340a('0x17')]?_[_0x340a('0x18')](_0x3b667c[_0x340a('0x14')][_0x340a('0x17')],function(_0x2a399b){return{'model':db[_0x2a399b['model']],'as':_0x2a399b['as'],'attributes':_0x2a399b[_0x340a('0x16')],'include':_0x2a399b[_0x340a('0x17')]?_['map'](_0x2a399b[_0x340a('0x17')],function(_0x3ffb04){return{'model':db[_0x3ffb04[_0x340a('0x19')]],'as':_0x3ffb04['as'],'attributes':_0x3ffb04[_0x340a('0x16')],'include':_0x3ffb04[_0x340a('0x17')]?_[_0x340a('0x18')](_0x3ffb04['include'],function(_0x49a5d7){return{'model':db[_0x49a5d7[_0x340a('0x19')]],'as':_0x49a5d7['as'],'attributes':_0x49a5d7[_0x340a('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x32c63e){logger[_0x340a('0xb')](_0x340a('0x1a'),_0x3b667c);logger[_0x340a('0x1d')](_0x340a('0x1a'),_0x3b667c,JSON[_0x340a('0xd')](_0x32c63e));_0x5574d5(_0x32c63e);})[_0x340a('0x11')](function(_0x3d9ac0){logger[_0x340a('0xe')](_0x340a('0x1a'),_0x3d9ac0[_0x340a('0xf')],_0x3b667c);_0x270723(_0x468654[_0x340a('0xe')](0x1f4,_0x3d9ac0[_0x340a('0xf')]));});});}; \ No newline at end of file +var _0xae50=['ShowDynamics365Account','find','then','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','Dynamics365Account','findAll','options','raw','where','attributes','include','map','model','GetDynamics365Account'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0xae50,0x114));var _0x0ae5=function(_0x282ccc,_0x5d66a1){_0x282ccc=_0x282ccc-0x0;var _0x27c2dd=_0xae50[_0x282ccc];return _0x27c2dd;};'use strict';var _=require(_0x0ae5('0x0'));var util=require(_0x0ae5('0x1'));var moment=require('moment');var BPromise=require(_0x0ae5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0ae5('0x3'))['db'];var utils=require(_0x0ae5('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x0ae5('0x5'));var jayson=require(_0x0ae5('0x6'));var client=jayson[_0x0ae5('0x7')][_0x0ae5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x41acfb,_0x26c7a1,_0x565c42){return new BPromise(function(_0x2ac7ba,_0x3cc436){return client[_0x0ae5('0x9')](_0x41acfb,_0x565c42)['then'](function(_0x49bd7e){logger[_0x0ae5('0xa')](_0x0ae5('0xb'),_0x26c7a1,_0x0ae5('0xc'));logger[_0x0ae5('0xd')](_0x0ae5('0xe'),_0x26c7a1,_0x0ae5('0xc'),JSON[_0x0ae5('0xf')](_0x49bd7e));if(_0x49bd7e['error']){if(_0x49bd7e[_0x0ae5('0x10')][_0x0ae5('0x11')]===0x1f4){logger[_0x0ae5('0x10')](_0x0ae5('0xb'),_0x26c7a1,_0x49bd7e[_0x0ae5('0x10')][_0x0ae5('0x12')]);return _0x3cc436(_0x49bd7e[_0x0ae5('0x10')][_0x0ae5('0x12')]);}logger['error'](_0x0ae5('0xb'),_0x26c7a1,_0x49bd7e[_0x0ae5('0x10')]['message']);return _0x2ac7ba(_0x49bd7e[_0x0ae5('0x10')][_0x0ae5('0x12')]);}else{logger[_0x0ae5('0xa')]('Dynamics365Account,\x20%s,\x20%s',_0x26c7a1,_0x0ae5('0xc'));_0x2ac7ba(_0x49bd7e[_0x0ae5('0x13')][_0x0ae5('0x12')]);}})['catch'](function(_0x12547a){logger[_0x0ae5('0x10')](_0x0ae5('0xb'),_0x26c7a1,_0x12547a);_0x3cc436(_0x12547a);});});}exports['GetDynamics365Account']=function(_0x1bf3ce){var _0x41c11f=this;return new Promise(function(_0x41e186,_0x35903c){return db[_0x0ae5('0x14')][_0x0ae5('0x15')]({'raw':_0x1bf3ce[_0x0ae5('0x16')]?_0x1bf3ce['options'][_0x0ae5('0x17')]===undefined?!![]:![]:!![],'where':_0x1bf3ce['options']?_0x1bf3ce[_0x0ae5('0x16')][_0x0ae5('0x18')]||null:null,'attributes':_0x1bf3ce[_0x0ae5('0x16')]?_0x1bf3ce[_0x0ae5('0x16')][_0x0ae5('0x19')]||null:null,'limit':_0x1bf3ce[_0x0ae5('0x16')]?_0x1bf3ce[_0x0ae5('0x16')]['limit']||null:null,'include':_0x1bf3ce['options']?_0x1bf3ce['options'][_0x0ae5('0x1a')]?_[_0x0ae5('0x1b')](_0x1bf3ce[_0x0ae5('0x16')]['include'],function(_0x2b5fba){return{'model':db[_0x2b5fba[_0x0ae5('0x1c')]],'as':_0x2b5fba['as'],'attributes':_0x2b5fba[_0x0ae5('0x19')],'include':_0x2b5fba[_0x0ae5('0x1a')]?_[_0x0ae5('0x1b')](_0x2b5fba[_0x0ae5('0x1a')],function(_0x28b103){return{'model':db[_0x28b103[_0x0ae5('0x1c')]],'as':_0x28b103['as'],'attributes':_0x28b103[_0x0ae5('0x19')],'include':_0x28b103[_0x0ae5('0x1a')]?_[_0x0ae5('0x1b')](_0x28b103[_0x0ae5('0x1a')],function(_0x58d7e4){return{'model':db[_0x58d7e4['model']],'as':_0x58d7e4['as'],'attributes':_0x58d7e4[_0x0ae5('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x537b7d){logger[_0x0ae5('0xa')](_0x0ae5('0x1d'),_0x1bf3ce);logger[_0x0ae5('0xd')](_0x0ae5('0x1d'),_0x1bf3ce,JSON[_0x0ae5('0xf')](_0x537b7d));_0x41e186(_0x537b7d);})['catch'](function(_0x42e6b3){logger[_0x0ae5('0x10')]('GetDynamics365Account',_0x42e6b3[_0x0ae5('0x12')],_0x1bf3ce);_0x35903c(_0x41c11f['error'](0x1f4,_0x42e6b3[_0x0ae5('0x12')]));});});};exports[_0x0ae5('0x1e')]=function(_0x2f422e){var _0xa5d5d7=this;return new Promise(function(_0x4bf6b8,_0x38374f){return db['Dynamics365Account'][_0x0ae5('0x1f')]({'raw':_0x2f422e[_0x0ae5('0x16')]?_0x2f422e[_0x0ae5('0x16')][_0x0ae5('0x17')]===undefined?!![]:![]:!![],'where':_0x2f422e[_0x0ae5('0x16')]?_0x2f422e['options'][_0x0ae5('0x18')]||null:null,'attributes':_0x2f422e[_0x0ae5('0x16')]?_0x2f422e[_0x0ae5('0x16')][_0x0ae5('0x19')]||null:null,'include':_0x2f422e[_0x0ae5('0x16')]?_0x2f422e['options'][_0x0ae5('0x1a')]?_[_0x0ae5('0x1b')](_0x2f422e[_0x0ae5('0x16')][_0x0ae5('0x1a')],function(_0x30296e){return{'model':db[_0x30296e[_0x0ae5('0x1c')]],'as':_0x30296e['as'],'attributes':_0x30296e['attributes'],'include':_0x30296e[_0x0ae5('0x1a')]?_[_0x0ae5('0x1b')](_0x30296e[_0x0ae5('0x1a')],function(_0x3d0f31){return{'model':db[_0x3d0f31['model']],'as':_0x3d0f31['as'],'attributes':_0x3d0f31[_0x0ae5('0x19')],'include':_0x3d0f31['include']?_[_0x0ae5('0x1b')](_0x3d0f31['include'],function(_0xb07bce){return{'model':db[_0xb07bce['model']],'as':_0xb07bce['as'],'attributes':_0xb07bce[_0x0ae5('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0ae5('0x20')](function(_0x5b43ca){logger[_0x0ae5('0xa')](_0x0ae5('0x1e'),_0x2f422e);logger[_0x0ae5('0xd')]('ShowDynamics365Account',_0x2f422e,JSON[_0x0ae5('0xf')](_0x5b43ca));_0x4bf6b8(_0x5b43ca);})[_0x0ae5('0x21')](function(_0x34ccbd){logger[_0x0ae5('0x10')]('ShowDynamics365Account',_0x34ccbd[_0x0ae5('0x12')],_0x2f422e);_0x38374f(_0xa5d5d7['error'](0x1f4,_0x34ccbd[_0x0ae5('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 0932973..abe34a9 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 _0x2c93=['post','create','put','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intDynamics365Configuration.controller','isAuthenticated','get','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions'];(function(_0x25a635,_0x1b4e98){var _0x15eb6a=function(_0x384583){while(--_0x384583){_0x25a635['push'](_0x25a635['shift']());}};_0x15eb6a(++_0x1b4e98);}(_0x2c93,0x10e));var _0x32c9=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0x2c93[_0x47fd36];return _0x21a0fc;};'use strict';var multer=require(_0x32c9('0x0'));var util=require(_0x32c9('0x1'));var path=require(_0x32c9('0x2'));var timeout=require(_0x32c9('0x3'));var express=require(_0x32c9('0x4'));var router=express[_0x32c9('0x5')]();var auth=require(_0x32c9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x32c9('0x7'));var controller=require(_0x32c9('0x8'));router['get']('/',auth[_0x32c9('0x9')](),controller['index']);router[_0x32c9('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x32c9('0xb'),auth['isAuthenticated'](),controller[_0x32c9('0xc')]);router['get'](_0x32c9('0xd'),auth[_0x32c9('0x9')](),controller['getSubjects']);router[_0x32c9('0xa')](_0x32c9('0xe'),auth[_0x32c9('0x9')](),controller[_0x32c9('0xf')]);router[_0x32c9('0x10')]('/',auth[_0x32c9('0x9')](),controller[_0x32c9('0x11')]);router[_0x32c9('0x12')](_0x32c9('0x13'),auth[_0x32c9('0x9')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x32c9('0x14')]);module[_0x32c9('0x15')]=router; \ No newline at end of file +var _0xe2ae=['update','delete','/:id','exports','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','show','getFields','getSubjects','/:id/descriptions','getDescriptions','post','put'];(function(_0x3816ac,_0x580af0){var _0x389948=function(_0x154aa9){while(--_0x154aa9){_0x3816ac['push'](_0x3816ac['shift']());}};_0x389948(++_0x580af0);}(_0xe2ae,0x108));var _0xee2a=function(_0x259e6e,_0x1960a5){_0x259e6e=_0x259e6e-0x0;var _0x3fb94f=_0xe2ae[_0x259e6e];return _0x3fb94f;};'use strict';var multer=require('multer');var util=require(_0xee2a('0x0'));var path=require(_0xee2a('0x1'));var timeout=require(_0xee2a('0x2'));var express=require(_0xee2a('0x3'));var router=express['Router']();var auth=require(_0xee2a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xee2a('0x5'));var controller=require(_0xee2a('0x6'));router[_0xee2a('0x7')]('/',auth[_0xee2a('0x8')](),controller['index']);router[_0xee2a('0x7')]('/:id',auth[_0xee2a('0x8')](),controller[_0xee2a('0x9')]);router['get']('/:id/fields',auth[_0xee2a('0x8')](),controller[_0xee2a('0xa')]);router[_0xee2a('0x7')]('/:id/subjects',auth[_0xee2a('0x8')](),controller[_0xee2a('0xb')]);router[_0xee2a('0x7')](_0xee2a('0xc'),auth[_0xee2a('0x8')](),controller[_0xee2a('0xd')]);router[_0xee2a('0xe')]('/',auth[_0xee2a('0x8')](),controller['create']);router[_0xee2a('0xf')]('/:id',auth[_0xee2a('0x8')](),controller[_0xee2a('0x10')]);router[_0xee2a('0x11')](_0xee2a('0x12'),auth[_0xee2a('0x8')](),controller['destroy']);module[_0xee2a('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 47663c2..7cf23f5 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 _0x4efe=['STRING','ENUM','phonecall','incident'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4efe,0x104));var _0xe4ef=function(_0x208d75,_0x92d742){_0x208d75=_0x208d75-0x0;var _0x382d27=_0x4efe[_0x208d75];return _0x382d27;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe4ef('0x0')]},'description':{'type':Sequelize[_0xe4ef('0x0')]},'ticketType':{'type':Sequelize[_0xe4ef('0x1')]('incident',_0xe4ef('0x2')),'defaultValue':_0xe4ef('0x3')}}; \ No newline at end of file +var _0x5bda=['phonecall','exports','STRING','ENUM','incident'];(function(_0x24086a,_0x3be9db){var _0x51351f=function(_0x32c59b){while(--_0x32c59b){_0x24086a['push'](_0x24086a['shift']());}};_0x51351f(++_0x3be9db);}(_0x5bda,0x137));var _0xa5bd=function(_0x221d0f,_0x37c51d){_0x221d0f=_0x221d0f-0x0;var _0x178f23=_0x5bda[_0x221d0f];return _0x178f23;};'use strict';var Sequelize=require('sequelize');module[_0xa5bd('0x0')]={'name':{'type':Sequelize[_0xa5bd('0x1')]},'description':{'type':Sequelize[_0xa5bd('0x1')]},'ticketType':{'type':Sequelize[_0xa5bd('0x2')](_0xa5bd('0x3'),_0xa5bd('0x4')),'defaultValue':_0xa5bd('0x3')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 9843383..86ff428 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 _0x938c=['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','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','Dynamics365Configuration,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','end','stack','name','index','Dynamics365Configuration','rawAttributes','query','keys','filters','model','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','map','type','key','VIRTUAL','field','filter','options','include','rows','intersection','includeAll','merge','find','create','body','params','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','html-pdf','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x4669d8,_0x471860){var _0xf4e3f8=function(_0x4090a6){while(--_0x4090a6){_0x4669d8['push'](_0x4669d8['shift']());}};_0xf4e3f8(++_0x471860);}(_0x938c,0x154));var _0xc938=function(_0x472cea,_0x1b92d4){_0x472cea=_0x472cea-0x0;var _0x4e4eae=_0x938c[_0x472cea];return _0x4e4eae;};'use strict';var pdf=require(_0xc938('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc938('0x1'));var zipdir=require(_0xc938('0x2'));var jsonpatch=require(_0xc938('0x3'));var rp=require('request-promise');var moment=require(_0xc938('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc938('0x5'));var util=require(_0xc938('0x6'));var path=require(_0xc938('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc938('0x8'));var fs=require('fs');var _=require(_0xc938('0x9'));var squel=require(_0xc938('0xa'));var crypto=require(_0xc938('0xb'));var jsforce=require(_0xc938('0xc'));var deskjs=require(_0xc938('0xd'));var toCsv=require(_0xc938('0xe'));var querystring=require(_0xc938('0xf'));var Papa=require(_0xc938('0x10'));var Redis=require(_0xc938('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xc938('0x12'));var hardwareService=require(_0xc938('0x13'));var logger=require(_0xc938('0x14'))('api');var utils=require(_0xc938('0x15'));var config=require(_0xc938('0x16'));var db=require(_0xc938('0x17'))['db'];var jayson=require(_0xc938('0x18'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x4c7824,_0x322d2e,_0x104833){if(_0x104833){var _0x3bff4e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3bff4e[_0xc938('0x19')](_0x322d2e)){return _0x4c7824;}else{throw new Error(_0xc938('0x1a'));}}else{return _0x4c7824;}}function respondWithRpcPromise(_0x551950,_0x1523d8,_0x59d92d,_0x16c940){return new BPromise(function(_0x2124a7,_0x187489){var _0x30e56a=_0x16c940||client;return _0x30e56a[_0xc938('0x1b')](_0x551950,_0x59d92d)[_0xc938('0x1c')](function(_0x44cee0){logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x1523d8,_0xc938('0x1d'));logger[_0xc938('0x1e')](_0xc938('0x1f'),_0x1523d8,'request\x20sent',JSON[_0xc938('0x20')](_0x44cee0));if(_0x44cee0[_0xc938('0x21')]){if(_0x44cee0['error']['code']===0x1f4){logger[_0xc938('0x21')](_0xc938('0x22'),_0x1523d8,_0x44cee0['error'][_0xc938('0x23')]);return _0x187489(_0x44cee0[_0xc938('0x21')]['message']);}logger[_0xc938('0x21')](_0xc938('0x22'),_0x1523d8,_0x44cee0[_0xc938('0x21')][_0xc938('0x23')]);return _0x2124a7(_0x44cee0['error'][_0xc938('0x23')]);}else{logger[_0xc938('0x24')](_0xc938('0x22'),_0x1523d8,_0xc938('0x1d'));_0x2124a7(_0x44cee0[_0xc938('0x25')][_0xc938('0x23')]);}})[_0xc938('0x26')](function(_0x56b887){logger[_0xc938('0x21')](_0xc938('0x22'),_0x1523d8,_0x56b887);_0x187489(_0x56b887);});});}function respondWithStatusCode(_0x2fa0f1,_0x36fdcb){_0x36fdcb=_0x36fdcb||0xcc;return function(_0x227456){if(_0x227456){return _0x2fa0f1[_0xc938('0x27')](_0x36fdcb);}return _0x2fa0f1[_0xc938('0x28')](_0x36fdcb)['end']();};}function respondWithResult(_0x5cf318,_0x512952){_0x512952=_0x512952||0xc8;return function(_0x547c1b){if(_0x547c1b){return _0x5cf318[_0xc938('0x28')](_0x512952)[_0xc938('0x29')](_0x547c1b);}};}function respondWithFilteredResult(_0x56beb9,_0x1c2641){return function(_0x50e049){if(_0x50e049){var _0x4dfdd7=_0x50e049[_0xc938('0x2a')],_0x415ed6=_0x1c2641[_0xc938('0x2b')],_0x5e6551=_0x1c2641[_0xc938('0x2b')]+_0x1c2641[_0xc938('0x2c')],_0x689a3a;if(_0x5e6551>=_0x4dfdd7){_0x5e6551=_0x4dfdd7;_0x689a3a=0xc8;}else{_0x689a3a=0xce;}_0x56beb9[_0xc938('0x28')](_0x689a3a);return _0x56beb9[_0xc938('0x2d')](_0xc938('0x2e'),_0x415ed6+'-'+_0x5e6551+'/'+_0x4dfdd7)[_0xc938('0x29')](_0x50e049);}return null;};}function patchUpdates(_0x37ebe6){return function(_0x32cc8f){try{jsonpatch['apply'](_0x32cc8f,_0x37ebe6,!![]);}catch(_0x51627c){return BPromise[_0xc938('0x2f')](_0x51627c);}return _0x32cc8f[_0xc938('0x30')]();};}function saveUpdates(_0x4548b8,_0x455f65){return function(_0x43814c){if(_0x43814c){return _0x43814c[_0xc938('0x31')](_0x4548b8)[_0xc938('0x1c')](function(_0x57b415){return _0x57b415;});}return null;};}function removeEntity(_0x3339bf,_0x445a4b){return function(_0x3b75fe){if(_0x3b75fe){return _0x3b75fe[_0xc938('0x32')]()['then'](function(){_0x3339bf['status'](0xcc)[_0xc938('0x33')]();});}};}function handleEntityNotFound(_0x39d313,_0x49f7bb){return function(_0x2643a0){if(!_0x2643a0){_0x39d313['sendStatus'](0x194);}return _0x2643a0;};}function handleError(_0x34e875,_0x234429){_0x234429=_0x234429||0x1f4;return function(_0x3c5da3){logger[_0xc938('0x21')](_0x3c5da3[_0xc938('0x34')]);if(_0x3c5da3['name']){delete _0x3c5da3[_0xc938('0x35')];}_0x34e875['status'](_0x234429)['send'](_0x3c5da3);};}exports[_0xc938('0x36')]=function(_0x47de81,_0x15e5f4){var _0x5aa471={},_0x1c69d3={},_0x5f1107={'count':0x0,'rows':[]};var _0x8787ab=db[_0xc938('0x37')][_0xc938('0x38')];_0x1c69d3['model']=_['keys'](_0x8787ab);_0x1c69d3[_0xc938('0x39')]=_[_0xc938('0x3a')](_0x47de81['query']);_0x1c69d3[_0xc938('0x3b')]=_['intersection'](_0x1c69d3[_0xc938('0x3c')],_0x1c69d3[_0xc938('0x39')]);_0x5aa471['attributes']=_['intersection'](_0x1c69d3[_0xc938('0x3c')],qs[_0xc938('0x3d')](_0x47de81[_0xc938('0x39')]['fields']));_0x5aa471['attributes']=_0x5aa471['attributes'][_0xc938('0x3e')]?_0x5aa471[_0xc938('0x3f')]:_0x1c69d3[_0xc938('0x3c')];if(!_0x47de81[_0xc938('0x39')][_0xc938('0x40')](_0xc938('0x41'))){_0x5aa471[_0xc938('0x2c')]=qs[_0xc938('0x2c')](_0x47de81['query'][_0xc938('0x2c')]);_0x5aa471[_0xc938('0x2b')]=qs['offset'](_0x47de81[_0xc938('0x39')][_0xc938('0x2b')]);}_0x5aa471[_0xc938('0x42')]=qs[_0xc938('0x43')](_0x47de81[_0xc938('0x39')][_0xc938('0x43')]);_0x5aa471[_0xc938('0x44')]=qs[_0xc938('0x3b')](_[_0xc938('0x45')](_0x47de81['query'],_0x1c69d3[_0xc938('0x3b')]));if(_0x47de81[_0xc938('0x39')]['filter']){_0x5aa471[_0xc938('0x44')]=_['merge'](_0x5aa471['where'],{'$or':_[_0xc938('0x46')](_0x8787ab,function(_0x1a0d28){if(_0x1a0d28[_0xc938('0x47')][_0xc938('0x48')]!==_0xc938('0x49')){var _0x3fdd06={};_0x3fdd06[_0x1a0d28[_0xc938('0x4a')]]={'$like':'%'+_0x47de81[_0xc938('0x39')][_0xc938('0x4b')]+'%'};return _0x3fdd06;}})});}_0x5aa471=_['merge']({},_0x5aa471,_0x47de81[_0xc938('0x4c')]);var _0x572761={'where':_0x5aa471[_0xc938('0x44')]};return db[_0xc938('0x37')][_0xc938('0x2a')](_0x572761)[_0xc938('0x1c')](function(_0x14971b){_0x5f1107[_0xc938('0x2a')]=_0x14971b;if(_0x47de81[_0xc938('0x39')]['includeAll']){_0x5aa471[_0xc938('0x4d')]=[{'all':!![]}];}return db[_0xc938('0x37')]['findAll'](_0x5aa471);})['then'](function(_0x1418e3){_0x5f1107[_0xc938('0x4e')]=_0x1418e3;return _0x5f1107;})[_0xc938('0x1c')](respondWithFilteredResult(_0x15e5f4,_0x5aa471))['catch'](handleError(_0x15e5f4,null));};exports['show']=function(_0x3d5c7a,_0x156785){var _0x328aa9={'raw':![],'where':{'id':_0x3d5c7a['params']['id']}},_0x444d66={};_0x444d66[_0xc938('0x3c')]=_[_0xc938('0x3a')](db[_0xc938('0x37')][_0xc938('0x38')]);_0x444d66['query']=_[_0xc938('0x3a')](_0x3d5c7a['query']);_0x444d66['filters']=_[_0xc938('0x4f')](_0x444d66[_0xc938('0x3c')],_0x444d66[_0xc938('0x39')]);_0x328aa9[_0xc938('0x3f')]=_[_0xc938('0x4f')](_0x444d66[_0xc938('0x3c')],qs[_0xc938('0x3d')](_0x3d5c7a[_0xc938('0x39')][_0xc938('0x3d')]));_0x328aa9[_0xc938('0x3f')]=_0x328aa9[_0xc938('0x3f')][_0xc938('0x3e')]?_0x328aa9[_0xc938('0x3f')]:_0x444d66[_0xc938('0x3c')];if(_0x3d5c7a[_0xc938('0x39')][_0xc938('0x50')]){_0x328aa9[_0xc938('0x4d')]=[{'all':!![]}];}_0x328aa9=_[_0xc938('0x51')]({},_0x328aa9,_0x3d5c7a[_0xc938('0x4c')]);return db[_0xc938('0x37')][_0xc938('0x52')](_0x328aa9)[_0xc938('0x1c')](handleEntityNotFound(_0x156785,null))['then'](respondWithResult(_0x156785,null))[_0xc938('0x26')](handleError(_0x156785,null));};exports[_0xc938('0x53')]=function(_0x3e09f3,_0x51d996){return db[_0xc938('0x37')][_0xc938('0x53')](_0x3e09f3['body'],{})[_0xc938('0x1c')](respondWithResult(_0x51d996,0xc9))[_0xc938('0x26')](handleError(_0x51d996,null));};exports[_0xc938('0x31')]=function(_0x15abd0,_0x51ebfa){if(_0x15abd0['body']['id']){delete _0x15abd0[_0xc938('0x54')]['id'];}return db[_0xc938('0x37')]['find']({'where':{'id':_0x15abd0[_0xc938('0x55')]['id']}})[_0xc938('0x1c')](handleEntityNotFound(_0x51ebfa,null))['then'](saveUpdates(_0x15abd0[_0xc938('0x54')],null))[_0xc938('0x1c')](respondWithResult(_0x51ebfa,null))[_0xc938('0x26')](handleError(_0x51ebfa,null));};exports[_0xc938('0x32')]=function(_0x15149d,_0x11a4b9){return db['Dynamics365Configuration'][_0xc938('0x52')]({'where':{'id':_0x15149d['params']['id']}})[_0xc938('0x1c')](handleEntityNotFound(_0x11a4b9,null))[_0xc938('0x1c')](removeEntity(_0x11a4b9,null))[_0xc938('0x26')](handleError(_0x11a4b9,null));};exports[_0xc938('0x56')]=function(_0x598680,_0xd60daf,_0x3863e6){var _0x1eb4a7={};var _0x5b03a4={};var _0x5c2152;var _0x43e762;return db[_0xc938('0x37')][_0xc938('0x57')]({'where':{'id':_0x598680['params']['id']}})['then'](handleEntityNotFound(_0xd60daf,null))[_0xc938('0x1c')](function(_0x342c34){if(_0x342c34){_0x5c2152=_0x342c34;_0x5b03a4['model']=_[_0xc938('0x3a')](db[_0xc938('0x58')][_0xc938('0x38')]);_0x5b03a4[_0xc938('0x39')]=_[_0xc938('0x3a')](_0x598680[_0xc938('0x39')]);_0x5b03a4['filters']=_[_0xc938('0x4f')](_0x5b03a4[_0xc938('0x3c')],_0x5b03a4[_0xc938('0x39')]);_0x1eb4a7[_0xc938('0x3f')]=_[_0xc938('0x4f')](_0x5b03a4[_0xc938('0x3c')],qs[_0xc938('0x3d')](_0x598680[_0xc938('0x39')][_0xc938('0x3d')]));_0x1eb4a7[_0xc938('0x3f')]=_0x1eb4a7[_0xc938('0x3f')][_0xc938('0x3e')]?_0x1eb4a7[_0xc938('0x3f')]:_0x5b03a4[_0xc938('0x3c')];_0x1eb4a7[_0xc938('0x42')]=qs[_0xc938('0x43')](_0x598680['query'][_0xc938('0x43')]);_0x1eb4a7[_0xc938('0x44')]=qs['filters'](_[_0xc938('0x45')](_0x598680[_0xc938('0x39')],_0x5b03a4['filters']));if(_0x598680[_0xc938('0x39')]['filter']){_0x1eb4a7[_0xc938('0x44')]=_[_0xc938('0x51')](_0x1eb4a7[_0xc938('0x44')],{'$or':_[_0xc938('0x46')](_0x1eb4a7['attributes'],function(_0xcc3546){var _0x4044d0={};_0x4044d0[_0xcc3546]={'$like':'%'+_0x598680[_0xc938('0x39')][_0xc938('0x4b')]+'%'};return _0x4044d0;})});}_0x1eb4a7=_[_0xc938('0x51')]({},_0x1eb4a7,_0x598680[_0xc938('0x4c')]);return _0x5c2152[_0xc938('0x56')](_0x1eb4a7);}})['then'](function(_0x7d0213){if(_0x7d0213){_0x43e762=_0x7d0213[_0xc938('0x3e')];if(!_0x598680[_0xc938('0x39')][_0xc938('0x40')](_0xc938('0x41'))){_0x1eb4a7[_0xc938('0x2c')]=qs[_0xc938('0x2c')](_0x598680[_0xc938('0x39')][_0xc938('0x2c')]);_0x1eb4a7[_0xc938('0x2b')]=qs[_0xc938('0x2b')](_0x598680[_0xc938('0x39')]['offset']);}return _0x5c2152[_0xc938('0x56')](_0x1eb4a7);}})[_0xc938('0x1c')](function(_0xe02df){if(_0xe02df){return _0xe02df?{'count':_0x43e762,'rows':_0xe02df}:null;}})[_0xc938('0x1c')](respondWithResult(_0xd60daf,null))['catch'](handleError(_0xd60daf,null));};exports[_0xc938('0x59')]=function(_0x4eeb79,_0x34b5cc,_0x3c3152){var _0x14bc01={};var _0x5c7e41={};var _0x23c2c3;var _0x18e7eb;return db[_0xc938('0x37')][_0xc938('0x57')]({'where':{'id':_0x4eeb79['params']['id']}})['then'](handleEntityNotFound(_0x34b5cc,null))[_0xc938('0x1c')](function(_0xf23060){if(_0xf23060){_0x23c2c3=_0xf23060;_0x5c7e41[_0xc938('0x3c')]=_['keys'](db['Dynamics365Field'][_0xc938('0x38')]);_0x5c7e41['query']=_[_0xc938('0x3a')](_0x4eeb79[_0xc938('0x39')]);_0x5c7e41[_0xc938('0x3b')]=_[_0xc938('0x4f')](_0x5c7e41[_0xc938('0x3c')],_0x5c7e41['query']);_0x14bc01[_0xc938('0x3f')]=_[_0xc938('0x4f')](_0x5c7e41[_0xc938('0x3c')],qs['fields'](_0x4eeb79[_0xc938('0x39')][_0xc938('0x3d')]));_0x14bc01['attributes']=_0x14bc01[_0xc938('0x3f')]['length']?_0x14bc01[_0xc938('0x3f')]:_0x5c7e41[_0xc938('0x3c')];_0x14bc01[_0xc938('0x42')]=qs['sort'](_0x4eeb79[_0xc938('0x39')]['sort']);_0x14bc01[_0xc938('0x44')]=qs['filters'](_[_0xc938('0x45')](_0x4eeb79[_0xc938('0x39')],_0x5c7e41['filters']));if(_0x4eeb79[_0xc938('0x39')][_0xc938('0x4b')]){_0x14bc01[_0xc938('0x44')]=_[_0xc938('0x51')](_0x14bc01[_0xc938('0x44')],{'$or':_[_0xc938('0x46')](_0x14bc01[_0xc938('0x3f')],function(_0x1f6082){var _0x322b8f={};_0x322b8f[_0x1f6082]={'$like':'%'+_0x4eeb79[_0xc938('0x39')][_0xc938('0x4b')]+'%'};return _0x322b8f;})});}_0x14bc01=_[_0xc938('0x51')]({},_0x14bc01,_0x4eeb79[_0xc938('0x4c')]);return _0x23c2c3['getSubjects'](_0x14bc01);}})[_0xc938('0x1c')](function(_0x573861){if(_0x573861){_0x18e7eb=_0x573861['length'];if(!_0x4eeb79[_0xc938('0x39')][_0xc938('0x40')]('nolimit')){_0x14bc01[_0xc938('0x2c')]=qs['limit'](_0x4eeb79[_0xc938('0x39')][_0xc938('0x2c')]);_0x14bc01[_0xc938('0x2b')]=qs[_0xc938('0x2b')](_0x4eeb79[_0xc938('0x39')][_0xc938('0x2b')]);}return _0x23c2c3['getSubjects'](_0x14bc01);}})[_0xc938('0x1c')](function(_0xb5e8ed){if(_0xb5e8ed){return _0xb5e8ed?{'count':_0x18e7eb,'rows':_0xb5e8ed}:null;}})['then'](respondWithResult(_0x34b5cc,null))['catch'](handleError(_0x34b5cc,null));};exports[_0xc938('0x5a')]=function(_0xb6ffdb,_0x21216d,_0x119856){var _0x5469d3={};var _0x111ef9={};var _0x359f86;var _0x5ad879;return db[_0xc938('0x37')]['findOne']({'where':{'id':_0xb6ffdb[_0xc938('0x55')]['id']}})[_0xc938('0x1c')](handleEntityNotFound(_0x21216d,null))['then'](function(_0x37a28d){if(_0x37a28d){_0x359f86=_0x37a28d;_0x111ef9['model']=_[_0xc938('0x3a')](db['Dynamics365Field']['rawAttributes']);_0x111ef9[_0xc938('0x39')]=_['keys'](_0xb6ffdb[_0xc938('0x39')]);_0x111ef9[_0xc938('0x3b')]=_[_0xc938('0x4f')](_0x111ef9[_0xc938('0x3c')],_0x111ef9[_0xc938('0x39')]);_0x5469d3[_0xc938('0x3f')]=_[_0xc938('0x4f')](_0x111ef9[_0xc938('0x3c')],qs[_0xc938('0x3d')](_0xb6ffdb[_0xc938('0x39')][_0xc938('0x3d')]));_0x5469d3['attributes']=_0x5469d3[_0xc938('0x3f')]['length']?_0x5469d3[_0xc938('0x3f')]:_0x111ef9[_0xc938('0x3c')];_0x5469d3[_0xc938('0x42')]=qs[_0xc938('0x43')](_0xb6ffdb[_0xc938('0x39')]['sort']);_0x5469d3['where']=qs['filters'](_[_0xc938('0x45')](_0xb6ffdb[_0xc938('0x39')],_0x111ef9['filters']));if(_0xb6ffdb[_0xc938('0x39')][_0xc938('0x4b')]){_0x5469d3['where']=_[_0xc938('0x51')](_0x5469d3['where'],{'$or':_[_0xc938('0x46')](_0x5469d3[_0xc938('0x3f')],function(_0x10e705){var _0x4434cb={};_0x4434cb[_0x10e705]={'$like':'%'+_0xb6ffdb[_0xc938('0x39')][_0xc938('0x4b')]+'%'};return _0x4434cb;})});}_0x5469d3=_[_0xc938('0x51')]({},_0x5469d3,_0xb6ffdb['options']);return _0x359f86[_0xc938('0x5a')](_0x5469d3);}})[_0xc938('0x1c')](function(_0x1dc637){if(_0x1dc637){_0x5ad879=_0x1dc637[_0xc938('0x3e')];if(!_0xb6ffdb['query'][_0xc938('0x40')](_0xc938('0x41'))){_0x5469d3[_0xc938('0x2c')]=qs['limit'](_0xb6ffdb[_0xc938('0x39')]['limit']);_0x5469d3[_0xc938('0x2b')]=qs['offset'](_0xb6ffdb['query'][_0xc938('0x2b')]);}return _0x359f86[_0xc938('0x5a')](_0x5469d3);}})[_0xc938('0x1c')](function(_0x274d0b){if(_0x274d0b){return _0x274d0b?{'count':_0x5ad879,'rows':_0x274d0b}:null;}})['then'](respondWithResult(_0x21216d,null))[_0xc938('0x26')](handleError(_0x21216d,null));}; \ No newline at end of file +var _0x32c5=['getFields','findOne','Dynamics365Field','pick','getSubjects','map','nolimit','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','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','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','name','send','index','model','query','keys','filters','fields','attributes','length','order','sort','filter','where','merge','key','VIRTUAL','field','options','Dynamics365Configuration','count','includeAll','include','findAll','rows','catch','rawAttributes','intersection','find','create','body','params'];(function(_0x173176,_0x53813c){var _0x4f326b=function(_0x570ccf){while(--_0x570ccf){_0x173176['push'](_0x173176['shift']());}};_0x4f326b(++_0x53813c);}(_0x32c5,0xc2));var _0x532c=function(_0x3051c7,_0x1aa73e){_0x3051c7=_0x3051c7-0x0;var _0x1b5dfc=_0x32c5[_0x3051c7];return _0x1b5dfc;};'use strict';var pdf=require(_0x532c('0x0'));var emlformat=require(_0x532c('0x1'));var rimraf=require(_0x532c('0x2'));var zipdir=require(_0x532c('0x3'));var jsonpatch=require(_0x532c('0x4'));var rp=require(_0x532c('0x5'));var moment=require(_0x532c('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x532c('0x7'));var util=require(_0x532c('0x8'));var path=require(_0x532c('0x9'));var sox=require(_0x532c('0xa'));var csv=require(_0x532c('0xb'));var ejs=require(_0x532c('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x532c('0xd'));var crypto=require('crypto');var jsforce=require(_0x532c('0xe'));var deskjs=require(_0x532c('0xf'));var toCsv=require(_0x532c('0xb'));var querystring=require(_0x532c('0x10'));var Papa=require(_0x532c('0x11'));var Redis=require(_0x532c('0x12'));var authService=require(_0x532c('0x13'));var qs=require(_0x532c('0x14'));var hardwareService=require(_0x532c('0x15'));var logger=require(_0x532c('0x16'))('api');var utils=require(_0x532c('0x17'));var config=require(_0x532c('0x18'));var db=require(_0x532c('0x19'))['db'];var jayson=require(_0x532c('0x1a'));var client=jayson[_0x532c('0x1b')][_0x532c('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x1447cd,_0xb03df4,_0x459f4e){if(_0x459f4e){var _0x514cd0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x514cd0[_0x532c('0x1d')](_0xb03df4)){return _0x1447cd;}else{throw new Error(_0x532c('0x1e'));}}else{return _0x1447cd;}}function respondWithRpcPromise(_0x29e53c,_0x512043,_0x1c3afb,_0x4583ac){return new BPromise(function(_0x1bbfea,_0x1030f2){var _0x13aab3=_0x4583ac||client;return _0x13aab3[_0x532c('0x1f')](_0x29e53c,_0x1c3afb)['then'](function(_0x30e977){logger['info'](_0x532c('0x20'),_0x512043,_0x532c('0x21'));logger['debug'](_0x532c('0x22'),_0x512043,'request\x20sent',JSON[_0x532c('0x23')](_0x30e977));if(_0x30e977[_0x532c('0x24')]){if(_0x30e977[_0x532c('0x24')]['code']===0x1f4){logger['error'](_0x532c('0x20'),_0x512043,_0x30e977[_0x532c('0x24')][_0x532c('0x25')]);return _0x1030f2(_0x30e977[_0x532c('0x24')][_0x532c('0x25')]);}logger[_0x532c('0x24')](_0x532c('0x20'),_0x512043,_0x30e977[_0x532c('0x24')][_0x532c('0x25')]);return _0x1bbfea(_0x30e977[_0x532c('0x24')][_0x532c('0x25')]);}else{logger[_0x532c('0x26')](_0x532c('0x20'),_0x512043,'request\x20sent');_0x1bbfea(_0x30e977[_0x532c('0x27')][_0x532c('0x25')]);}})['catch'](function(_0x5bfe6a){logger['error'](_0x532c('0x20'),_0x512043,_0x5bfe6a);_0x1030f2(_0x5bfe6a);});});}function respondWithStatusCode(_0x2fe068,_0x3355a7){_0x3355a7=_0x3355a7||0xcc;return function(_0x2254f8){if(_0x2254f8){return _0x2fe068[_0x532c('0x28')](_0x3355a7);}return _0x2fe068[_0x532c('0x29')](_0x3355a7)[_0x532c('0x2a')]();};}function respondWithResult(_0x3dd8f2,_0x3f5ad3){_0x3f5ad3=_0x3f5ad3||0xc8;return function(_0x4daef5){if(_0x4daef5){return _0x3dd8f2[_0x532c('0x29')](_0x3f5ad3)['json'](_0x4daef5);}};}function respondWithFilteredResult(_0x5ced8b,_0x57201f){return function(_0x46fc9c){if(_0x46fc9c){var _0x4979a3=_0x46fc9c['count'],_0x394bf9=_0x57201f[_0x532c('0x2b')],_0x11a48b=_0x57201f['offset']+_0x57201f[_0x532c('0x2c')],_0x3f18dd;if(_0x11a48b>=_0x4979a3){_0x11a48b=_0x4979a3;_0x3f18dd=0xc8;}else{_0x3f18dd=0xce;}_0x5ced8b[_0x532c('0x29')](_0x3f18dd);return _0x5ced8b[_0x532c('0x2d')](_0x532c('0x2e'),_0x394bf9+'-'+_0x11a48b+'/'+_0x4979a3)[_0x532c('0x2f')](_0x46fc9c);}return null;};}function patchUpdates(_0x18248c){return function(_0x358b80){try{jsonpatch[_0x532c('0x30')](_0x358b80,_0x18248c,!![]);}catch(_0x444721){return BPromise[_0x532c('0x31')](_0x444721);}return _0x358b80['save']();};}function saveUpdates(_0x9da311,_0x3b0a16){return function(_0x3128b4){if(_0x3128b4){return _0x3128b4[_0x532c('0x32')](_0x9da311)[_0x532c('0x33')](function(_0x28812a){return _0x28812a;});}return null;};}function removeEntity(_0x38bfc2,_0x35c1ae){return function(_0x574f16){if(_0x574f16){return _0x574f16[_0x532c('0x34')]()[_0x532c('0x33')](function(){_0x38bfc2[_0x532c('0x29')](0xcc)[_0x532c('0x2a')]();});}};}function handleEntityNotFound(_0x573474,_0x13b6b3){return function(_0x178bcf){if(!_0x178bcf){_0x573474[_0x532c('0x28')](0x194);}return _0x178bcf;};}function handleError(_0x165673,_0x3872a5){_0x3872a5=_0x3872a5||0x1f4;return function(_0xfb8226){logger[_0x532c('0x24')](_0xfb8226['stack']);if(_0xfb8226[_0x532c('0x35')]){delete _0xfb8226[_0x532c('0x35')];}_0x165673[_0x532c('0x29')](_0x3872a5)[_0x532c('0x36')](_0xfb8226);};}exports[_0x532c('0x37')]=function(_0x19c5ac,_0x30a5c3){var _0x424baa={},_0x57fbee={},_0x5e2a38={'count':0x0,'rows':[]};var _0x126fd7=db['Dynamics365Configuration']['rawAttributes'];_0x57fbee[_0x532c('0x38')]=_['keys'](_0x126fd7);_0x57fbee[_0x532c('0x39')]=_[_0x532c('0x3a')](_0x19c5ac[_0x532c('0x39')]);_0x57fbee[_0x532c('0x3b')]=_['intersection'](_0x57fbee[_0x532c('0x38')],_0x57fbee[_0x532c('0x39')]);_0x424baa['attributes']=_['intersection'](_0x57fbee[_0x532c('0x38')],qs[_0x532c('0x3c')](_0x19c5ac['query'][_0x532c('0x3c')]));_0x424baa['attributes']=_0x424baa[_0x532c('0x3d')][_0x532c('0x3e')]?_0x424baa['attributes']:_0x57fbee['model'];if(!_0x19c5ac[_0x532c('0x39')]['hasOwnProperty']('nolimit')){_0x424baa['limit']=qs[_0x532c('0x2c')](_0x19c5ac[_0x532c('0x39')][_0x532c('0x2c')]);_0x424baa[_0x532c('0x2b')]=qs['offset'](_0x19c5ac[_0x532c('0x39')][_0x532c('0x2b')]);}_0x424baa[_0x532c('0x3f')]=qs[_0x532c('0x40')](_0x19c5ac[_0x532c('0x39')][_0x532c('0x40')]);_0x424baa['where']=qs[_0x532c('0x3b')](_['pick'](_0x19c5ac[_0x532c('0x39')],_0x57fbee[_0x532c('0x3b')]));if(_0x19c5ac['query'][_0x532c('0x41')]){_0x424baa[_0x532c('0x42')]=_[_0x532c('0x43')](_0x424baa['where'],{'$or':_['map'](_0x126fd7,function(_0x4c50ba){if(_0x4c50ba['type'][_0x532c('0x44')]!==_0x532c('0x45')){var _0x5607fa={};_0x5607fa[_0x4c50ba[_0x532c('0x46')]]={'$like':'%'+_0x19c5ac[_0x532c('0x39')][_0x532c('0x41')]+'%'};return _0x5607fa;}})});}_0x424baa=_['merge']({},_0x424baa,_0x19c5ac[_0x532c('0x47')]);var _0xf965fd={'where':_0x424baa[_0x532c('0x42')]};return db[_0x532c('0x48')][_0x532c('0x49')](_0xf965fd)['then'](function(_0x32a4b6){_0x5e2a38[_0x532c('0x49')]=_0x32a4b6;if(_0x19c5ac[_0x532c('0x39')][_0x532c('0x4a')]){_0x424baa[_0x532c('0x4b')]=[{'all':!![]}];}return db[_0x532c('0x48')][_0x532c('0x4c')](_0x424baa);})[_0x532c('0x33')](function(_0x573a3c){_0x5e2a38[_0x532c('0x4d')]=_0x573a3c;return _0x5e2a38;})[_0x532c('0x33')](respondWithFilteredResult(_0x30a5c3,_0x424baa))[_0x532c('0x4e')](handleError(_0x30a5c3,null));};exports['show']=function(_0x2d1082,_0x57630a){var _0x2db220={'raw':![],'where':{'id':_0x2d1082['params']['id']}},_0x37d5d7={};_0x37d5d7['model']=_[_0x532c('0x3a')](db[_0x532c('0x48')][_0x532c('0x4f')]);_0x37d5d7[_0x532c('0x39')]=_[_0x532c('0x3a')](_0x2d1082[_0x532c('0x39')]);_0x37d5d7['filters']=_['intersection'](_0x37d5d7[_0x532c('0x38')],_0x37d5d7['query']);_0x2db220['attributes']=_[_0x532c('0x50')](_0x37d5d7[_0x532c('0x38')],qs[_0x532c('0x3c')](_0x2d1082[_0x532c('0x39')]['fields']));_0x2db220['attributes']=_0x2db220[_0x532c('0x3d')][_0x532c('0x3e')]?_0x2db220[_0x532c('0x3d')]:_0x37d5d7['model'];if(_0x2d1082[_0x532c('0x39')]['includeAll']){_0x2db220['include']=[{'all':!![]}];}_0x2db220=_[_0x532c('0x43')]({},_0x2db220,_0x2d1082[_0x532c('0x47')]);return db[_0x532c('0x48')][_0x532c('0x51')](_0x2db220)[_0x532c('0x33')](handleEntityNotFound(_0x57630a,null))[_0x532c('0x33')](respondWithResult(_0x57630a,null))[_0x532c('0x4e')](handleError(_0x57630a,null));};exports[_0x532c('0x52')]=function(_0x249e55,_0x55ed17){return db[_0x532c('0x48')]['create'](_0x249e55['body'],{})[_0x532c('0x33')](respondWithResult(_0x55ed17,0xc9))[_0x532c('0x4e')](handleError(_0x55ed17,null));};exports[_0x532c('0x32')]=function(_0x17d5a3,_0x378f91){if(_0x17d5a3[_0x532c('0x53')]['id']){delete _0x17d5a3['body']['id'];}return db[_0x532c('0x48')]['find']({'where':{'id':_0x17d5a3[_0x532c('0x54')]['id']}})[_0x532c('0x33')](handleEntityNotFound(_0x378f91,null))['then'](saveUpdates(_0x17d5a3[_0x532c('0x53')],null))[_0x532c('0x33')](respondWithResult(_0x378f91,null))[_0x532c('0x4e')](handleError(_0x378f91,null));};exports[_0x532c('0x34')]=function(_0x5c8fc4,_0x38b926){return db['Dynamics365Configuration'][_0x532c('0x51')]({'where':{'id':_0x5c8fc4[_0x532c('0x54')]['id']}})[_0x532c('0x33')](handleEntityNotFound(_0x38b926,null))[_0x532c('0x33')](removeEntity(_0x38b926,null))['catch'](handleError(_0x38b926,null));};exports[_0x532c('0x55')]=function(_0x51fb3c,_0x414be4,_0x2fe0c3){var _0x3c61b6={};var _0x3159fe={};var _0x2eb1e7;var _0x456e2f;return db[_0x532c('0x48')][_0x532c('0x56')]({'where':{'id':_0x51fb3c[_0x532c('0x54')]['id']}})[_0x532c('0x33')](handleEntityNotFound(_0x414be4,null))[_0x532c('0x33')](function(_0x15db27){if(_0x15db27){_0x2eb1e7=_0x15db27;_0x3159fe[_0x532c('0x38')]=_['keys'](db[_0x532c('0x57')][_0x532c('0x4f')]);_0x3159fe[_0x532c('0x39')]=_['keys'](_0x51fb3c['query']);_0x3159fe[_0x532c('0x3b')]=_[_0x532c('0x50')](_0x3159fe[_0x532c('0x38')],_0x3159fe[_0x532c('0x39')]);_0x3c61b6[_0x532c('0x3d')]=_['intersection'](_0x3159fe['model'],qs['fields'](_0x51fb3c[_0x532c('0x39')][_0x532c('0x3c')]));_0x3c61b6[_0x532c('0x3d')]=_0x3c61b6[_0x532c('0x3d')][_0x532c('0x3e')]?_0x3c61b6[_0x532c('0x3d')]:_0x3159fe[_0x532c('0x38')];_0x3c61b6[_0x532c('0x3f')]=qs['sort'](_0x51fb3c[_0x532c('0x39')]['sort']);_0x3c61b6[_0x532c('0x42')]=qs[_0x532c('0x3b')](_[_0x532c('0x58')](_0x51fb3c['query'],_0x3159fe[_0x532c('0x3b')]));if(_0x51fb3c[_0x532c('0x39')][_0x532c('0x41')]){_0x3c61b6[_0x532c('0x42')]=_[_0x532c('0x43')](_0x3c61b6[_0x532c('0x42')],{'$or':_['map'](_0x3c61b6[_0x532c('0x3d')],function(_0x1b71f2){var _0x13f172={};_0x13f172[_0x1b71f2]={'$like':'%'+_0x51fb3c[_0x532c('0x39')][_0x532c('0x41')]+'%'};return _0x13f172;})});}_0x3c61b6=_[_0x532c('0x43')]({},_0x3c61b6,_0x51fb3c['options']);return _0x2eb1e7[_0x532c('0x55')](_0x3c61b6);}})[_0x532c('0x33')](function(_0x14efa0){if(_0x14efa0){_0x456e2f=_0x14efa0['length'];if(!_0x51fb3c['query']['hasOwnProperty']('nolimit')){_0x3c61b6[_0x532c('0x2c')]=qs[_0x532c('0x2c')](_0x51fb3c['query']['limit']);_0x3c61b6[_0x532c('0x2b')]=qs[_0x532c('0x2b')](_0x51fb3c[_0x532c('0x39')][_0x532c('0x2b')]);}return _0x2eb1e7['getFields'](_0x3c61b6);}})['then'](function(_0x20ad8f){if(_0x20ad8f){return _0x20ad8f?{'count':_0x456e2f,'rows':_0x20ad8f}:null;}})[_0x532c('0x33')](respondWithResult(_0x414be4,null))['catch'](handleError(_0x414be4,null));};exports[_0x532c('0x59')]=function(_0xc88897,_0x4d417c,_0x4d3cff){var _0x13170a={};var _0x14388d={};var _0x44a452;var _0x1666e4;return db[_0x532c('0x48')][_0x532c('0x56')]({'where':{'id':_0xc88897[_0x532c('0x54')]['id']}})[_0x532c('0x33')](handleEntityNotFound(_0x4d417c,null))[_0x532c('0x33')](function(_0x25be73){if(_0x25be73){_0x44a452=_0x25be73;_0x14388d[_0x532c('0x38')]=_[_0x532c('0x3a')](db[_0x532c('0x57')]['rawAttributes']);_0x14388d['query']=_[_0x532c('0x3a')](_0xc88897[_0x532c('0x39')]);_0x14388d['filters']=_[_0x532c('0x50')](_0x14388d[_0x532c('0x38')],_0x14388d[_0x532c('0x39')]);_0x13170a[_0x532c('0x3d')]=_[_0x532c('0x50')](_0x14388d[_0x532c('0x38')],qs[_0x532c('0x3c')](_0xc88897[_0x532c('0x39')][_0x532c('0x3c')]));_0x13170a['attributes']=_0x13170a[_0x532c('0x3d')][_0x532c('0x3e')]?_0x13170a[_0x532c('0x3d')]:_0x14388d[_0x532c('0x38')];_0x13170a['order']=qs[_0x532c('0x40')](_0xc88897[_0x532c('0x39')][_0x532c('0x40')]);_0x13170a[_0x532c('0x42')]=qs[_0x532c('0x3b')](_[_0x532c('0x58')](_0xc88897[_0x532c('0x39')],_0x14388d[_0x532c('0x3b')]));if(_0xc88897[_0x532c('0x39')]['filter']){_0x13170a['where']=_[_0x532c('0x43')](_0x13170a[_0x532c('0x42')],{'$or':_[_0x532c('0x5a')](_0x13170a[_0x532c('0x3d')],function(_0x1b905a){var _0x4d292f={};_0x4d292f[_0x1b905a]={'$like':'%'+_0xc88897[_0x532c('0x39')][_0x532c('0x41')]+'%'};return _0x4d292f;})});}_0x13170a=_[_0x532c('0x43')]({},_0x13170a,_0xc88897['options']);return _0x44a452['getSubjects'](_0x13170a);}})['then'](function(_0x173618){if(_0x173618){_0x1666e4=_0x173618[_0x532c('0x3e')];if(!_0xc88897[_0x532c('0x39')]['hasOwnProperty'](_0x532c('0x5b'))){_0x13170a[_0x532c('0x2c')]=qs[_0x532c('0x2c')](_0xc88897['query'][_0x532c('0x2c')]);_0x13170a[_0x532c('0x2b')]=qs[_0x532c('0x2b')](_0xc88897[_0x532c('0x39')][_0x532c('0x2b')]);}return _0x44a452[_0x532c('0x59')](_0x13170a);}})[_0x532c('0x33')](function(_0x187ebf){if(_0x187ebf){return _0x187ebf?{'count':_0x1666e4,'rows':_0x187ebf}:null;}})[_0x532c('0x33')](respondWithResult(_0x4d417c,null))['catch'](handleError(_0x4d417c,null));};exports[_0x532c('0x5c')]=function(_0xb790ad,_0x5209c2,_0x4c47d0){var _0x3fddee={};var _0x4a398c={};var _0xaff4d9;var _0x268fc4;return db[_0x532c('0x48')]['findOne']({'where':{'id':_0xb790ad[_0x532c('0x54')]['id']}})[_0x532c('0x33')](handleEntityNotFound(_0x5209c2,null))[_0x532c('0x33')](function(_0x37d66c){if(_0x37d66c){_0xaff4d9=_0x37d66c;_0x4a398c[_0x532c('0x38')]=_[_0x532c('0x3a')](db['Dynamics365Field']['rawAttributes']);_0x4a398c[_0x532c('0x39')]=_[_0x532c('0x3a')](_0xb790ad['query']);_0x4a398c[_0x532c('0x3b')]=_[_0x532c('0x50')](_0x4a398c[_0x532c('0x38')],_0x4a398c['query']);_0x3fddee['attributes']=_[_0x532c('0x50')](_0x4a398c[_0x532c('0x38')],qs[_0x532c('0x3c')](_0xb790ad['query']['fields']));_0x3fddee[_0x532c('0x3d')]=_0x3fddee[_0x532c('0x3d')]['length']?_0x3fddee[_0x532c('0x3d')]:_0x4a398c[_0x532c('0x38')];_0x3fddee[_0x532c('0x3f')]=qs[_0x532c('0x40')](_0xb790ad[_0x532c('0x39')][_0x532c('0x40')]);_0x3fddee[_0x532c('0x42')]=qs[_0x532c('0x3b')](_[_0x532c('0x58')](_0xb790ad['query'],_0x4a398c[_0x532c('0x3b')]));if(_0xb790ad[_0x532c('0x39')][_0x532c('0x41')]){_0x3fddee[_0x532c('0x42')]=_[_0x532c('0x43')](_0x3fddee['where'],{'$or':_['map'](_0x3fddee[_0x532c('0x3d')],function(_0x1b766f){var _0x3c1166={};_0x3c1166[_0x1b766f]={'$like':'%'+_0xb790ad['query']['filter']+'%'};return _0x3c1166;})});}_0x3fddee=_['merge']({},_0x3fddee,_0xb790ad[_0x532c('0x47')]);return _0xaff4d9[_0x532c('0x5c')](_0x3fddee);}})[_0x532c('0x33')](function(_0x19f64a){if(_0x19f64a){_0x268fc4=_0x19f64a[_0x532c('0x3e')];if(!_0xb790ad[_0x532c('0x39')]['hasOwnProperty'](_0x532c('0x5b'))){_0x3fddee['limit']=qs[_0x532c('0x2c')](_0xb790ad[_0x532c('0x39')][_0x532c('0x2c')]);_0x3fddee[_0x532c('0x2b')]=qs['offset'](_0xb790ad[_0x532c('0x39')][_0x532c('0x2b')]);}return _0xaff4d9[_0x532c('0x5c')](_0x3fddee);}})[_0x532c('0x33')](function(_0x3e09b6){if(_0x3e09b6){return _0x3e09b6?{'count':_0x268fc4,'rows':_0x3e09b6}:null;}})[_0x532c('0x33')](respondWithResult(_0x5209c2,null))[_0x532c('0x4e')](handleError(_0x5209c2,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index cf117e4..910b0f0 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 _0x4d08=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4d08,0x10a));var _0x84d0=function(_0xf9a6cf,_0x11870e){_0xf9a6cf=_0xf9a6cf-0x0;var _0x59e2bc=_0x4d08[_0xf9a6cf];return _0x59e2bc;};'use strict';var _=require(_0x84d0('0x0'));var util=require(_0x84d0('0x1'));var logger=require(_0x84d0('0x2'))(_0x84d0('0x3'));var moment=require(_0x84d0('0x4'));var BPromise=require(_0x84d0('0x5'));var rp=require(_0x84d0('0x6'));var fs=require('fs');var path=require(_0x84d0('0x7'));var rimraf=require('rimraf');var config=require(_0x84d0('0x8'));var attributes=require(_0x84d0('0x9'));module[_0x84d0('0xa')]=function(_0x240462,_0x2586c8){return _0x240462[_0x84d0('0xb')](_0x84d0('0xc'),attributes,{'tableName':_0x84d0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2e06=['int_dynamics365_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','Dynamics365Configuration'];(function(_0x57d843,_0x2a95e0){var _0x42ba2d=function(_0x46cb71){while(--_0x46cb71){_0x57d843['push'](_0x57d843['shift']());}};_0x42ba2d(++_0x2a95e0);}(_0x2e06,0x109));var _0x62e0=function(_0xf979e6,_0x1cb147){_0xf979e6=_0xf979e6-0x0;var _0x59217d=_0x2e06[_0xf979e6];return _0x59217d;};'use strict';var _=require(_0x62e0('0x0'));var util=require('util');var logger=require(_0x62e0('0x1'))(_0x62e0('0x2'));var moment=require(_0x62e0('0x3'));var BPromise=require(_0x62e0('0x4'));var rp=require(_0x62e0('0x5'));var fs=require('fs');var path=require(_0x62e0('0x6'));var rimraf=require(_0x62e0('0x7'));var config=require('../../config/environment');var attributes=require('./intDynamics365Configuration.attributes');module[_0x62e0('0x8')]=function(_0x46e6ba,_0x2fa1fa){return _0x46e6ba[_0x62e0('0x9')](_0x62e0('0xa'),attributes,{'tableName':_0x62e0('0xb'),'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 a9fc85e..e3f6323 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 _0x3a1f=['client','http','request','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x19c57a,_0x5c9c7c){var _0x576a08=function(_0x929c62){while(--_0x929c62){_0x19c57a['push'](_0x19c57a['shift']());}};_0x576a08(++_0x5c9c7c);}(_0x3a1f,0x160));var _0xf3a1=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x3a1f[_0x5bd426];return _0x23a7eb;};'use strict';var _=require(_0xf3a1('0x0'));var util=require(_0xf3a1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf3a1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf3a1('0x3'));var logger=require(_0xf3a1('0x4'))(_0xf3a1('0x5'));var config=require(_0xf3a1('0x6'));var jayson=require(_0xf3a1('0x7'));var client=jayson[_0xf3a1('0x8')][_0xf3a1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21812f,_0x3e74bf,_0x150440){return new BPromise(function(_0x174c96,_0x45071d){return client[_0xf3a1('0xa')](_0x21812f,_0x150440)[_0xf3a1('0xb')](function(_0xea6fbb){logger['info'](_0xf3a1('0xc'),_0x3e74bf,_0xf3a1('0xd'));logger['debug'](_0xf3a1('0xe'),_0x3e74bf,_0xf3a1('0xd'),JSON['stringify'](_0xea6fbb));if(_0xea6fbb[_0xf3a1('0xf')]){if(_0xea6fbb['error'][_0xf3a1('0x10')]===0x1f4){logger[_0xf3a1('0xf')](_0xf3a1('0xc'),_0x3e74bf,_0xea6fbb['error'][_0xf3a1('0x11')]);return _0x45071d(_0xea6fbb[_0xf3a1('0xf')]['message']);}logger['error'](_0xf3a1('0xc'),_0x3e74bf,_0xea6fbb['error']['message']);return _0x174c96(_0xea6fbb[_0xf3a1('0xf')][_0xf3a1('0x11')]);}else{logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x3e74bf,_0xf3a1('0xd'));_0x174c96(_0xea6fbb[_0xf3a1('0x12')]['message']);}})[_0xf3a1('0x13')](function(_0x21b4b2){logger[_0xf3a1('0xf')](_0xf3a1('0xc'),_0x3e74bf,_0x21b4b2);_0x45071d(_0x21b4b2);});});} \ No newline at end of file +var _0x9930=['../../config/logger','../../config/environment','jayson/promise','client','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x346842,_0x114d50){var _0x1fed5c=function(_0x22b089){while(--_0x22b089){_0x346842['push'](_0x346842['shift']());}};_0x1fed5c(++_0x114d50);}(_0x9930,0xc1));var _0x0993=function(_0x46a3d8,_0x425044){_0x46a3d8=_0x46a3d8-0x0;var _0x1810d5=_0x9930[_0x46a3d8];return _0x1810d5;};'use strict';var _=require(_0x0993('0x0'));var util=require(_0x0993('0x1'));var moment=require(_0x0993('0x2'));var BPromise=require(_0x0993('0x3'));var rs=require(_0x0993('0x4'));var fs=require('fs');var Redis=require(_0x0993('0x5'));var db=require(_0x0993('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0993('0x7'))('rpc');var config=require(_0x0993('0x8'));var jayson=require(_0x0993('0x9'));var client=jayson[_0x0993('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x575585,_0x1f7845,_0x2a0e3e){return new BPromise(function(_0xac956d,_0x75dad){return client['request'](_0x575585,_0x2a0e3e)[_0x0993('0xb')](function(_0x533664){logger[_0x0993('0xc')](_0x0993('0xd'),_0x1f7845,_0x0993('0xe'));logger['debug'](_0x0993('0xf'),_0x1f7845,_0x0993('0xe'),JSON[_0x0993('0x10')](_0x533664));if(_0x533664[_0x0993('0x11')]){if(_0x533664[_0x0993('0x11')]['code']===0x1f4){logger[_0x0993('0x11')](_0x0993('0xd'),_0x1f7845,_0x533664[_0x0993('0x11')][_0x0993('0x12')]);return _0x75dad(_0x533664[_0x0993('0x11')][_0x0993('0x12')]);}logger[_0x0993('0x11')](_0x0993('0xd'),_0x1f7845,_0x533664[_0x0993('0x11')][_0x0993('0x12')]);return _0xac956d(_0x533664[_0x0993('0x11')][_0x0993('0x12')]);}else{logger[_0x0993('0xc')](_0x0993('0xd'),_0x1f7845,'request\x20sent');_0xac956d(_0x533664[_0x0993('0x13')]['message']);}})['catch'](function(_0x24690f){logger[_0x0993('0x11')](_0x0993('0xd'),_0x1f7845,_0x24690f);_0x75dad(_0x24690f);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 9788dc1..fcf6f3f 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 _0x1399=['destroy','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','update'];(function(_0x5c0d75,_0x52c90f){var _0xae35a1=function(_0x574bce){while(--_0x574bce){_0x5c0d75['push'](_0x5c0d75['shift']());}};_0xae35a1(++_0x52c90f);}(_0x1399,0xd3));var _0x9139=function(_0xd33d44,_0x398fa4){_0xd33d44=_0xd33d44-0x0;var _0x3c1655=_0x1399[_0xd33d44];return _0x3c1655;};'use strict';var multer=require(_0x9139('0x0'));var util=require('util');var path=require(_0x9139('0x1'));var timeout=require(_0x9139('0x2'));var express=require(_0x9139('0x3'));var router=express['Router']();var auth=require(_0x9139('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9139('0x5'));var controller=require('./intDynamics365Field.controller');router[_0x9139('0x6')]('/',auth[_0x9139('0x7')](),controller[_0x9139('0x8')]);router[_0x9139('0x6')](_0x9139('0x9'),auth[_0x9139('0x7')](),controller[_0x9139('0xa')]);router[_0x9139('0xb')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x9139('0x9'),auth[_0x9139('0x7')](),controller[_0x9139('0xc')]);router['delete'](_0x9139('0x9'),auth[_0x9139('0x7')](),controller[_0x9139('0xd')]);module['exports']=router; \ No newline at end of file +var _0x70db=['multer','util','path','Router','../../components/auth/service','../../components/interaction/service','./intDynamics365Field.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x70db,0xab));var _0xb70d=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x70db[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require(_0xb70d('0x0'));var util=require(_0xb70d('0x1'));var path=require(_0xb70d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb70d('0x3')]();var auth=require(_0xb70d('0x4'));var interaction=require(_0xb70d('0x5'));var config=require('../../config/environment');var controller=require(_0xb70d('0x6'));router['get']('/',auth[_0xb70d('0x7')](),controller[_0xb70d('0x8')]);router[_0xb70d('0x9')](_0xb70d('0xa'),auth['isAuthenticated'](),controller[_0xb70d('0xb')]);router[_0xb70d('0xc')]('/',auth[_0xb70d('0x7')](),controller[_0xb70d('0xd')]);router[_0xb70d('0xe')]('/:id',auth[_0xb70d('0x7')](),controller[_0xb70d('0xf')]);router[_0xb70d('0x10')]('/:id',auth[_0xb70d('0x7')](),controller[_0xb70d('0x11')]);module[_0xb70d('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 205ca04..9e78220 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 _0x750a=['customVariable','keyValue','string','STRING','ENUM','exports','variable'];(function(_0x2962b2,_0x55f76f){var _0x3cfd29=function(_0x519567){while(--_0x519567){_0x2962b2['push'](_0x2962b2['shift']());}};_0x3cfd29(++_0x55f76f);}(_0x750a,0x140));var _0xa750=function(_0x5d3cff,_0x46cbab){_0x5d3cff=_0x5d3cff-0x0;var _0x1390f7=_0x750a[_0x5d3cff];return _0x1390f7;};'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 +var _0xdace=['variable','keyValue','STRING','customVariable','BOOLEAN','sequelize','ENUM','string'];(function(_0x18ad42,_0x4a7cae){var _0xeafac=function(_0xdc6a3b){while(--_0xdc6a3b){_0x18ad42['push'](_0x18ad42['shift']());}};_0xeafac(++_0x4a7cae);}(_0xdace,0xc5));var _0xedac=function(_0x286726,_0x20a337){_0x286726=_0x286726-0x0;var _0xcd4fe9=_0xdace[_0x286726];return _0xcd4fe9;};'use strict';var Sequelize=require(_0xedac('0x0'));module['exports']={'type':{'type':Sequelize[_0xedac('0x1')](_0xedac('0x2'),_0xedac('0x3'),'customVariable',_0xedac('0x4')),'defaultValue':_0xedac('0x2')},'content':{'type':Sequelize[_0xedac('0x5')]},'key':{'type':Sequelize[_0xedac('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0xedac('0x2'),_0xedac('0x3'),_0xedac('0x6'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xedac('0x5')]},'nameField':{'type':Sequelize[_0xedac('0x5')]},'customField':{'type':Sequelize[_0xedac('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 69ee26c..5c4c94e 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 _0x7e1b=['../../config/environment','../../mysqldb','sendStatus','status','end','json','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','Dynamics365Field','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','offset','order','sort','where','pick','merge','type','key','VIRTUAL','field','filter','options','includeAll','include','findAll','catch','params','filters','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api'];(function(_0x1b1858,_0x1cede8){var _0x1827cd=function(_0x3fd10d){while(--_0x3fd10d){_0x1b1858['push'](_0x1b1858['shift']());}};_0x1827cd(++_0x1cede8);}(_0x7e1b,0x79));var _0xb7e1=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0x7e1b[_0x5834bc];return _0x3e183a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb7e1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb7e1('0x1'));var jsonpatch=require(_0xb7e1('0x2'));var rp=require(_0xb7e1('0x3'));var moment=require('moment');var BPromise=require(_0xb7e1('0x4'));var Mustache=require(_0xb7e1('0x5'));var util=require(_0xb7e1('0x6'));var path=require(_0xb7e1('0x7'));var sox=require(_0xb7e1('0x8'));var csv=require(_0xb7e1('0x9'));var ejs=require(_0xb7e1('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xb7e1('0xb'));var jsforce=require(_0xb7e1('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb7e1('0x9'));var querystring=require(_0xb7e1('0xd'));var Papa=require(_0xb7e1('0xe'));var Redis=require('ioredis');var authService=require(_0xb7e1('0xf'));var qs=require(_0xb7e1('0x10'));var hardwareService=require(_0xb7e1('0x11'));var logger=require('../../config/logger')(_0xb7e1('0x12'));var utils=require('../../config/utils');var config=require(_0xb7e1('0x13'));var db=require(_0xb7e1('0x14'))['db'];function respondWithStatusCode(_0x373811,_0x42b76c){_0x42b76c=_0x42b76c||0xcc;return function(_0x4d47a2){if(_0x4d47a2){return _0x373811[_0xb7e1('0x15')](_0x42b76c);}return _0x373811[_0xb7e1('0x16')](_0x42b76c)[_0xb7e1('0x17')]();};}function respondWithResult(_0x37067a,_0x478e4d){_0x478e4d=_0x478e4d||0xc8;return function(_0x377f9c){if(_0x377f9c){return _0x37067a[_0xb7e1('0x16')](_0x478e4d)[_0xb7e1('0x18')](_0x377f9c);}};}function respondWithFilteredResult(_0x191e29,_0x4e60d0){return function(_0x50ff7c){if(_0x50ff7c){var _0x45d439=_0x50ff7c[_0xb7e1('0x19')],_0x365b3f=_0x4e60d0['offset'],_0x40fb59=_0x4e60d0['offset']+_0x4e60d0[_0xb7e1('0x1a')],_0x509af3;if(_0x40fb59>=_0x45d439){_0x40fb59=_0x45d439;_0x509af3=0xc8;}else{_0x509af3=0xce;}_0x191e29['status'](_0x509af3);return _0x191e29[_0xb7e1('0x1b')](_0xb7e1('0x1c'),_0x365b3f+'-'+_0x40fb59+'/'+_0x45d439)[_0xb7e1('0x18')](_0x50ff7c);}return null;};}function patchUpdates(_0x4744b7){return function(_0x65b2cf){try{jsonpatch[_0xb7e1('0x1d')](_0x65b2cf,_0x4744b7,!![]);}catch(_0x5053da){return BPromise[_0xb7e1('0x1e')](_0x5053da);}return _0x65b2cf[_0xb7e1('0x1f')]();};}function saveUpdates(_0x1f9ae2,_0x1b6c99){return function(_0x2c87ed){if(_0x2c87ed){return _0x2c87ed[_0xb7e1('0x20')](_0x1f9ae2)[_0xb7e1('0x21')](function(_0x46a412){return _0x46a412;});}return null;};}function removeEntity(_0x1624b6,_0x224126){return function(_0x4d6986){if(_0x4d6986){return _0x4d6986[_0xb7e1('0x22')]()[_0xb7e1('0x21')](function(){_0x1624b6[_0xb7e1('0x16')](0xcc)[_0xb7e1('0x17')]();});}};}function handleEntityNotFound(_0x318eb2,_0x5e5562){return function(_0xbdfea2){if(!_0xbdfea2){_0x318eb2[_0xb7e1('0x15')](0x194);}return _0xbdfea2;};}function handleError(_0x4bc26d,_0xd00235){_0xd00235=_0xd00235||0x1f4;return function(_0x916e92){logger[_0xb7e1('0x23')](_0x916e92[_0xb7e1('0x24')]);if(_0x916e92['name']){delete _0x916e92[_0xb7e1('0x25')];}_0x4bc26d[_0xb7e1('0x16')](_0xd00235)['send'](_0x916e92);};}exports[_0xb7e1('0x26')]=function(_0x1e1348,_0xf50df7){var _0x5940e0={},_0x1b2896={},_0xeadf0e={'count':0x0,'rows':[]};var _0x30d814=db[_0xb7e1('0x27')][_0xb7e1('0x28')];_0x1b2896[_0xb7e1('0x29')]=_[_0xb7e1('0x2a')](_0x30d814);_0x1b2896[_0xb7e1('0x2b')]=_[_0xb7e1('0x2a')](_0x1e1348[_0xb7e1('0x2b')]);_0x1b2896['filters']=_[_0xb7e1('0x2c')](_0x1b2896[_0xb7e1('0x29')],_0x1b2896[_0xb7e1('0x2b')]);_0x5940e0[_0xb7e1('0x2d')]=_[_0xb7e1('0x2c')](_0x1b2896[_0xb7e1('0x29')],qs[_0xb7e1('0x2e')](_0x1e1348[_0xb7e1('0x2b')]['fields']));_0x5940e0[_0xb7e1('0x2d')]=_0x5940e0[_0xb7e1('0x2d')][_0xb7e1('0x2f')]?_0x5940e0[_0xb7e1('0x2d')]:_0x1b2896[_0xb7e1('0x29')];if(!_0x1e1348['query'][_0xb7e1('0x30')]('nolimit')){_0x5940e0['limit']=qs[_0xb7e1('0x1a')](_0x1e1348['query'][_0xb7e1('0x1a')]);_0x5940e0[_0xb7e1('0x31')]=qs[_0xb7e1('0x31')](_0x1e1348[_0xb7e1('0x2b')]['offset']);}_0x5940e0[_0xb7e1('0x32')]=qs['sort'](_0x1e1348[_0xb7e1('0x2b')][_0xb7e1('0x33')]);_0x5940e0[_0xb7e1('0x34')]=qs['filters'](_[_0xb7e1('0x35')](_0x1e1348[_0xb7e1('0x2b')],_0x1b2896['filters']));if(_0x1e1348[_0xb7e1('0x2b')]['filter']){_0x5940e0[_0xb7e1('0x34')]=_[_0xb7e1('0x36')](_0x5940e0[_0xb7e1('0x34')],{'$or':_['map'](_0x30d814,function(_0x4a6131){if(_0x4a6131[_0xb7e1('0x37')][_0xb7e1('0x38')]!==_0xb7e1('0x39')){var _0x1c2596={};_0x1c2596[_0x4a6131[_0xb7e1('0x3a')]]={'$like':'%'+_0x1e1348[_0xb7e1('0x2b')][_0xb7e1('0x3b')]+'%'};return _0x1c2596;}})});}_0x5940e0=_[_0xb7e1('0x36')]({},_0x5940e0,_0x1e1348[_0xb7e1('0x3c')]);var _0xd0cf3e={'where':_0x5940e0[_0xb7e1('0x34')]};return db[_0xb7e1('0x27')]['count'](_0xd0cf3e)[_0xb7e1('0x21')](function(_0x4bff75){_0xeadf0e['count']=_0x4bff75;if(_0x1e1348[_0xb7e1('0x2b')][_0xb7e1('0x3d')]){_0x5940e0[_0xb7e1('0x3e')]=[{'all':!![]}];}return db['Dynamics365Field'][_0xb7e1('0x3f')](_0x5940e0);})[_0xb7e1('0x21')](function(_0x2656af){_0xeadf0e['rows']=_0x2656af;return _0xeadf0e;})[_0xb7e1('0x21')](respondWithFilteredResult(_0xf50df7,_0x5940e0))[_0xb7e1('0x40')](handleError(_0xf50df7,null));};exports['show']=function(_0x130141,_0x2befb1){var _0x17cb81={'raw':!![],'where':{'id':_0x130141[_0xb7e1('0x41')]['id']}},_0xc1b659={};_0xc1b659[_0xb7e1('0x29')]=_['keys'](db[_0xb7e1('0x27')]['rawAttributes']);_0xc1b659[_0xb7e1('0x2b')]=_[_0xb7e1('0x2a')](_0x130141[_0xb7e1('0x2b')]);_0xc1b659[_0xb7e1('0x42')]=_[_0xb7e1('0x2c')](_0xc1b659[_0xb7e1('0x29')],_0xc1b659[_0xb7e1('0x2b')]);_0x17cb81[_0xb7e1('0x2d')]=_[_0xb7e1('0x2c')](_0xc1b659[_0xb7e1('0x29')],qs[_0xb7e1('0x2e')](_0x130141[_0xb7e1('0x2b')][_0xb7e1('0x2e')]));_0x17cb81[_0xb7e1('0x2d')]=_0x17cb81[_0xb7e1('0x2d')]['length']?_0x17cb81['attributes']:_0xc1b659['model'];if(_0x130141[_0xb7e1('0x2b')]['includeAll']){_0x17cb81['include']=[{'all':!![]}];}_0x17cb81=_[_0xb7e1('0x36')]({},_0x17cb81,_0x130141[_0xb7e1('0x3c')]);return db[_0xb7e1('0x27')][_0xb7e1('0x43')](_0x17cb81)[_0xb7e1('0x21')](handleEntityNotFound(_0x2befb1,null))[_0xb7e1('0x21')](respondWithResult(_0x2befb1,null))[_0xb7e1('0x40')](handleError(_0x2befb1,null));};exports[_0xb7e1('0x44')]=function(_0x3b8874,_0x5d62c5){return db[_0xb7e1('0x27')]['create'](_0x3b8874[_0xb7e1('0x45')],{})[_0xb7e1('0x21')](respondWithResult(_0x5d62c5,0xc9))[_0xb7e1('0x40')](handleError(_0x5d62c5,null));};exports[_0xb7e1('0x20')]=function(_0x8eb044,_0x3fd183){if(_0x8eb044['body']['id']){delete _0x8eb044[_0xb7e1('0x45')]['id'];}return db[_0xb7e1('0x27')][_0xb7e1('0x43')]({'where':{'id':_0x8eb044[_0xb7e1('0x41')]['id']}})[_0xb7e1('0x21')](handleEntityNotFound(_0x3fd183,null))[_0xb7e1('0x21')](saveUpdates(_0x8eb044[_0xb7e1('0x45')],null))[_0xb7e1('0x21')](respondWithResult(_0x3fd183,null))[_0xb7e1('0x40')](handleError(_0x3fd183,null));};exports[_0xb7e1('0x22')]=function(_0x21a21c,_0x4ab98e){return db[_0xb7e1('0x27')]['find']({'where':{'id':_0x21a21c[_0xb7e1('0x41')]['id']}})[_0xb7e1('0x21')](handleEntityNotFound(_0x4ab98e,null))[_0xb7e1('0x21')](removeEntity(_0x4ab98e,null))['catch'](handleError(_0x4ab98e,null));}; \ No newline at end of file +var _0x7edf=['set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','Dynamics365Field','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','map','type','field','filter','merge','options','include','findAll','rows','catch','show','params','length','includeAll','create','body','find','html-pdf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','status','end','json','count','offset','limit'];(function(_0x27c07b,_0x424e04){var _0x3e0cfb=function(_0x4b9ea1){while(--_0x4b9ea1){_0x27c07b['push'](_0x27c07b['shift']());}};_0x3e0cfb(++_0x424e04);}(_0x7edf,0x71));var _0xf7ed=function(_0x121886,_0x8cd8e5){_0x121886=_0x121886-0x0;var _0x20ca01=_0x7edf[_0x121886];return _0x20ca01;};'use strict';var pdf=require(_0xf7ed('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf7ed('0x1'));var jsonpatch=require(_0xf7ed('0x2'));var rp=require(_0xf7ed('0x3'));var moment=require(_0xf7ed('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf7ed('0x5'));var util=require(_0xf7ed('0x6'));var path=require(_0xf7ed('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf7ed('0x8'));var fs=require('fs');var _=require(_0xf7ed('0x9'));var squel=require(_0xf7ed('0xa'));var crypto=require(_0xf7ed('0xb'));var jsforce=require(_0xf7ed('0xc'));var deskjs=require(_0xf7ed('0xd'));var toCsv=require(_0xf7ed('0xe'));var querystring=require(_0xf7ed('0xf'));var Papa=require(_0xf7ed('0x10'));var Redis=require(_0xf7ed('0x11'));var authService=require(_0xf7ed('0x12'));var qs=require(_0xf7ed('0x13'));var hardwareService=require(_0xf7ed('0x14'));var logger=require(_0xf7ed('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xf7ed('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x303d53,_0x50fb38){_0x50fb38=_0x50fb38||0xcc;return function(_0x11fdbc){if(_0x11fdbc){return _0x303d53['sendStatus'](_0x50fb38);}return _0x303d53[_0xf7ed('0x17')](_0x50fb38)[_0xf7ed('0x18')]();};}function respondWithResult(_0x20fdc0,_0x2a9ace){_0x2a9ace=_0x2a9ace||0xc8;return function(_0x5f45cb){if(_0x5f45cb){return _0x20fdc0[_0xf7ed('0x17')](_0x2a9ace)[_0xf7ed('0x19')](_0x5f45cb);}};}function respondWithFilteredResult(_0x3601c4,_0x1b6875){return function(_0x9fb3){if(_0x9fb3){var _0x29b419=_0x9fb3[_0xf7ed('0x1a')],_0x423f2e=_0x1b6875[_0xf7ed('0x1b')],_0x8b18b9=_0x1b6875[_0xf7ed('0x1b')]+_0x1b6875[_0xf7ed('0x1c')],_0x339c96;if(_0x8b18b9>=_0x29b419){_0x8b18b9=_0x29b419;_0x339c96=0xc8;}else{_0x339c96=0xce;}_0x3601c4[_0xf7ed('0x17')](_0x339c96);return _0x3601c4[_0xf7ed('0x1d')](_0xf7ed('0x1e'),_0x423f2e+'-'+_0x8b18b9+'/'+_0x29b419)[_0xf7ed('0x19')](_0x9fb3);}return null;};}function patchUpdates(_0xb10dfc){return function(_0x3df4d0){try{jsonpatch[_0xf7ed('0x1f')](_0x3df4d0,_0xb10dfc,!![]);}catch(_0x543bca){return BPromise[_0xf7ed('0x20')](_0x543bca);}return _0x3df4d0[_0xf7ed('0x21')]();};}function saveUpdates(_0x33378b,_0x5cc850){return function(_0x3443e3){if(_0x3443e3){return _0x3443e3[_0xf7ed('0x22')](_0x33378b)[_0xf7ed('0x23')](function(_0x4b44e6){return _0x4b44e6;});}return null;};}function removeEntity(_0x5cbbb5,_0x52c3d8){return function(_0x5cacca){if(_0x5cacca){return _0x5cacca[_0xf7ed('0x24')]()[_0xf7ed('0x23')](function(){_0x5cbbb5[_0xf7ed('0x17')](0xcc)[_0xf7ed('0x18')]();});}};}function handleEntityNotFound(_0x273926,_0x428243){return function(_0x21e07e){if(!_0x21e07e){_0x273926['sendStatus'](0x194);}return _0x21e07e;};}function handleError(_0x385350,_0x2a4df4){_0x2a4df4=_0x2a4df4||0x1f4;return function(_0x227d48){logger[_0xf7ed('0x25')](_0x227d48[_0xf7ed('0x26')]);if(_0x227d48[_0xf7ed('0x27')]){delete _0x227d48[_0xf7ed('0x27')];}_0x385350[_0xf7ed('0x17')](_0x2a4df4)['send'](_0x227d48);};}exports[_0xf7ed('0x28')]=function(_0x173015,_0xad0080){var _0x5704c7={},_0x5e8866={},_0x2cea37={'count':0x0,'rows':[]};var _0x3b5022=db[_0xf7ed('0x29')]['rawAttributes'];_0x5e8866[_0xf7ed('0x2a')]=_[_0xf7ed('0x2b')](_0x3b5022);_0x5e8866[_0xf7ed('0x2c')]=_['keys'](_0x173015[_0xf7ed('0x2c')]);_0x5e8866[_0xf7ed('0x2d')]=_[_0xf7ed('0x2e')](_0x5e8866[_0xf7ed('0x2a')],_0x5e8866['query']);_0x5704c7['attributes']=_[_0xf7ed('0x2e')](_0x5e8866[_0xf7ed('0x2a')],qs[_0xf7ed('0x2f')](_0x173015[_0xf7ed('0x2c')][_0xf7ed('0x2f')]));_0x5704c7[_0xf7ed('0x30')]=_0x5704c7[_0xf7ed('0x30')]['length']?_0x5704c7[_0xf7ed('0x30')]:_0x5e8866['model'];if(!_0x173015[_0xf7ed('0x2c')][_0xf7ed('0x31')](_0xf7ed('0x32'))){_0x5704c7['limit']=qs['limit'](_0x173015[_0xf7ed('0x2c')]['limit']);_0x5704c7[_0xf7ed('0x1b')]=qs[_0xf7ed('0x1b')](_0x173015['query'][_0xf7ed('0x1b')]);}_0x5704c7['order']=qs[_0xf7ed('0x33')](_0x173015[_0xf7ed('0x2c')]['sort']);_0x5704c7[_0xf7ed('0x34')]=qs[_0xf7ed('0x2d')](_[_0xf7ed('0x35')](_0x173015[_0xf7ed('0x2c')],_0x5e8866[_0xf7ed('0x2d')]));if(_0x173015[_0xf7ed('0x2c')]['filter']){_0x5704c7[_0xf7ed('0x34')]=_['merge'](_0x5704c7[_0xf7ed('0x34')],{'$or':_[_0xf7ed('0x36')](_0x3b5022,function(_0x76a011){if(_0x76a011[_0xf7ed('0x37')]['key']!=='VIRTUAL'){var _0x2361ef={};_0x2361ef[_0x76a011[_0xf7ed('0x38')]]={'$like':'%'+_0x173015['query'][_0xf7ed('0x39')]+'%'};return _0x2361ef;}})});}_0x5704c7=_[_0xf7ed('0x3a')]({},_0x5704c7,_0x173015[_0xf7ed('0x3b')]);var _0x4a146b={'where':_0x5704c7[_0xf7ed('0x34')]};return db['Dynamics365Field'][_0xf7ed('0x1a')](_0x4a146b)[_0xf7ed('0x23')](function(_0x43853b){_0x2cea37[_0xf7ed('0x1a')]=_0x43853b;if(_0x173015['query']['includeAll']){_0x5704c7[_0xf7ed('0x3c')]=[{'all':!![]}];}return db[_0xf7ed('0x29')][_0xf7ed('0x3d')](_0x5704c7);})['then'](function(_0x378019){_0x2cea37[_0xf7ed('0x3e')]=_0x378019;return _0x2cea37;})[_0xf7ed('0x23')](respondWithFilteredResult(_0xad0080,_0x5704c7))[_0xf7ed('0x3f')](handleError(_0xad0080,null));};exports[_0xf7ed('0x40')]=function(_0x4d2cc7,_0x212ef7){var _0x11dfc1={'raw':!![],'where':{'id':_0x4d2cc7[_0xf7ed('0x41')]['id']}},_0x48e99d={};_0x48e99d[_0xf7ed('0x2a')]=_[_0xf7ed('0x2b')](db[_0xf7ed('0x29')]['rawAttributes']);_0x48e99d[_0xf7ed('0x2c')]=_[_0xf7ed('0x2b')](_0x4d2cc7['query']);_0x48e99d[_0xf7ed('0x2d')]=_['intersection'](_0x48e99d[_0xf7ed('0x2a')],_0x48e99d[_0xf7ed('0x2c')]);_0x11dfc1[_0xf7ed('0x30')]=_['intersection'](_0x48e99d['model'],qs[_0xf7ed('0x2f')](_0x4d2cc7[_0xf7ed('0x2c')][_0xf7ed('0x2f')]));_0x11dfc1['attributes']=_0x11dfc1['attributes'][_0xf7ed('0x42')]?_0x11dfc1['attributes']:_0x48e99d[_0xf7ed('0x2a')];if(_0x4d2cc7[_0xf7ed('0x2c')][_0xf7ed('0x43')]){_0x11dfc1[_0xf7ed('0x3c')]=[{'all':!![]}];}_0x11dfc1=_['merge']({},_0x11dfc1,_0x4d2cc7[_0xf7ed('0x3b')]);return db['Dynamics365Field']['find'](_0x11dfc1)['then'](handleEntityNotFound(_0x212ef7,null))['then'](respondWithResult(_0x212ef7,null))[_0xf7ed('0x3f')](handleError(_0x212ef7,null));};exports[_0xf7ed('0x44')]=function(_0x1f0a9d,_0x1a207c){return db[_0xf7ed('0x29')][_0xf7ed('0x44')](_0x1f0a9d['body'],{})[_0xf7ed('0x23')](respondWithResult(_0x1a207c,0xc9))[_0xf7ed('0x3f')](handleError(_0x1a207c,null));};exports[_0xf7ed('0x22')]=function(_0x56d3ba,_0x5ad985){if(_0x56d3ba[_0xf7ed('0x45')]['id']){delete _0x56d3ba[_0xf7ed('0x45')]['id'];}return db[_0xf7ed('0x29')][_0xf7ed('0x46')]({'where':{'id':_0x56d3ba[_0xf7ed('0x41')]['id']}})[_0xf7ed('0x23')](handleEntityNotFound(_0x5ad985,null))[_0xf7ed('0x23')](saveUpdates(_0x56d3ba[_0xf7ed('0x45')],null))[_0xf7ed('0x23')](respondWithResult(_0x5ad985,null))[_0xf7ed('0x3f')](handleError(_0x5ad985,null));};exports[_0xf7ed('0x24')]=function(_0x2bdfe3,_0x3197cd){return db['Dynamics365Field'][_0xf7ed('0x46')]({'where':{'id':_0x2bdfe3['params']['id']}})[_0xf7ed('0x23')](handleEntityNotFound(_0x3197cd,null))[_0xf7ed('0x23')](removeEntity(_0x3197cd,null))[_0xf7ed('0x3f')](handleError(_0x3197cd,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index bdb388b..71e128e 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 _0x7a54=['int_dynamics365_fields','idField','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field'];(function(_0x173a4a,_0x3a99dc){var _0x522030=function(_0x26e2e3){while(--_0x26e2e3){_0x173a4a['push'](_0x173a4a['shift']());}};_0x522030(++_0x3a99dc);}(_0x7a54,0x106));var _0x47a5=function(_0x9a6fe2,_0x57c510){_0x9a6fe2=_0x9a6fe2-0x0;var _0x55fdef=_0x7a54[_0x9a6fe2];return _0x55fdef;};'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 +var _0x7a54=['int_dynamics365_fields','idField','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field'];(function(_0x296a3c,_0x1c88f6){var _0x433b97=function(_0x34ad1b){while(--_0x34ad1b){_0x296a3c['push'](_0x296a3c['shift']());}};_0x433b97(++_0x1c88f6);}(_0x7a54,0x106));var _0x47a5=function(_0x4d7566,_0x2917a2){_0x4d7566=_0x4d7566-0x0;var _0x539005=_0x7a54[_0x4d7566];return _0x539005;};'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 63a5122..ec11c51 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 _0x945d=['Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x945d,0xe2));var _0xd945=function(_0x110b14,_0x3c1ea2){_0x110b14=_0x110b14-0x0;var _0x26d4e1=_0x945d[_0x110b14];return _0x26d4e1;};'use strict';var _=require(_0xd945('0x0'));var util=require(_0xd945('0x1'));var moment=require('moment');var BPromise=require(_0xd945('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd945('0x3'));var logger=require(_0xd945('0x4'))(_0xd945('0x5'));var config=require(_0xd945('0x6'));var jayson=require(_0xd945('0x7'));var client=jayson[_0xd945('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x520a7c,_0x3276e1,_0x4a4763){return new BPromise(function(_0xb9ffca,_0x28e24a){return client[_0xd945('0x9')](_0x520a7c,_0x4a4763)['then'](function(_0x56cbbe){logger[_0xd945('0xa')](_0xd945('0xb'),_0x3276e1,_0xd945('0xc'));logger[_0xd945('0xd')](_0xd945('0xe'),_0x3276e1,_0xd945('0xc'),JSON[_0xd945('0xf')](_0x56cbbe));if(_0x56cbbe['error']){if(_0x56cbbe[_0xd945('0x10')][_0xd945('0x11')]===0x1f4){logger[_0xd945('0x10')](_0xd945('0xb'),_0x3276e1,_0x56cbbe[_0xd945('0x10')][_0xd945('0x12')]);return _0x28e24a(_0x56cbbe[_0xd945('0x10')][_0xd945('0x12')]);}logger[_0xd945('0x10')](_0xd945('0xb'),_0x3276e1,_0x56cbbe['error']['message']);return _0xb9ffca(_0x56cbbe['error']['message']);}else{logger[_0xd945('0xa')]('Dynamics365Field,\x20%s,\x20%s',_0x3276e1,_0xd945('0xc'));_0xb9ffca(_0x56cbbe['result'][_0xd945('0x12')]);}})[_0xd945('0x13')](function(_0x4cf287){logger['error'](_0xd945('0xb'),_0x3276e1,_0x4cf287);_0x28e24a(_0x4cf287);});});} \ No newline at end of file +var _0x759e=['code','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xcfa5a5,_0x21543b){var _0x17f01a=function(_0x2c4bd1){while(--_0x2c4bd1){_0xcfa5a5['push'](_0xcfa5a5['shift']());}};_0x17f01a(++_0x21543b);}(_0x759e,0xd1));var _0xe759=function(_0x2cb66e,_0x3c441f){_0x2cb66e=_0x2cb66e-0x0;var _0xb440d3=_0x759e[_0x2cb66e];return _0xb440d3;};'use strict';var _=require(_0xe759('0x0'));var util=require(_0xe759('0x1'));var moment=require('moment');var BPromise=require(_0xe759('0x2'));var rs=require(_0xe759('0x3'));var fs=require('fs');var Redis=require(_0xe759('0x4'));var db=require(_0xe759('0x5'))['db'];var utils=require(_0xe759('0x6'));var logger=require(_0xe759('0x7'))(_0xe759('0x8'));var config=require(_0xe759('0x9'));var jayson=require(_0xe759('0xa'));var client=jayson[_0xe759('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59057f,_0x13e0b3,_0x32a55d){return new BPromise(function(_0x7eb96,_0x36453a){return client[_0xe759('0xc')](_0x59057f,_0x32a55d)[_0xe759('0xd')](function(_0x199837){logger[_0xe759('0xe')](_0xe759('0xf'),_0x13e0b3,_0xe759('0x10'));logger[_0xe759('0x11')](_0xe759('0x12'),_0x13e0b3,_0xe759('0x10'),JSON[_0xe759('0x13')](_0x199837));if(_0x199837[_0xe759('0x14')]){if(_0x199837['error'][_0xe759('0x15')]===0x1f4){logger['error'](_0xe759('0xf'),_0x13e0b3,_0x199837[_0xe759('0x14')]['message']);return _0x36453a(_0x199837[_0xe759('0x14')]['message']);}logger[_0xe759('0x14')](_0xe759('0xf'),_0x13e0b3,_0x199837['error'][_0xe759('0x16')]);return _0x7eb96(_0x199837[_0xe759('0x14')]['message']);}else{logger[_0xe759('0xe')](_0xe759('0xf'),_0x13e0b3,_0xe759('0x10'));_0x7eb96(_0x199837['result']['message']);}})['catch'](function(_0x5df58e){logger[_0xe759('0x14')]('Dynamics365Field,\x20%s,\x20%s',_0x13e0b3,_0x5df58e);_0x36453a(_0x5df58e);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index d584d97..9e43fd8 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 _0x6511=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','isAuthenticated','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports','util'];(function(_0x5f0f5a,_0x50f181){var _0xbc4126=function(_0x5d032){while(--_0x5d032){_0x5f0f5a['push'](_0x5f0f5a['shift']());}};_0xbc4126(++_0x50f181);}(_0x6511,0x12a));var _0x1651=function(_0x4ffd71,_0x5d1866){_0x4ffd71=_0x4ffd71-0x0;var _0x471287=_0x6511[_0x4ffd71];return _0x471287;};'use strict';var multer=require('multer');var util=require(_0x1651('0x0'));var path=require(_0x1651('0x1'));var timeout=require(_0x1651('0x2'));var express=require(_0x1651('0x3'));var router=express[_0x1651('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x1651('0x5'));var config=require(_0x1651('0x6'));var controller=require(_0x1651('0x7'));router['get']('/',auth[_0x1651('0x8')](),controller['index']);router[_0x1651('0x9')](_0x1651('0xa'),auth[_0x1651('0x8')](),controller[_0x1651('0xb')]);router[_0x1651('0x9')](_0x1651('0xc'),auth[_0x1651('0x8')](),controller[_0x1651('0xd')]);router['get'](_0x1651('0xe'),auth[_0x1651('0x8')](),controller['getFields']);router[_0x1651('0xf')]('/',auth['isAuthenticated'](),controller[_0x1651('0x10')]);router['post'](_0x1651('0xc'),auth[_0x1651('0x8')](),controller[_0x1651('0x11')]);router[_0x1651('0x12')](_0x1651('0xa'),auth[_0x1651('0x8')](),controller[_0x1651('0x13')]);router[_0x1651('0x14')](_0x1651('0xa'),auth['isAuthenticated'](),controller[_0x1651('0x15')]);module[_0x1651('0x16')]=router; \ No newline at end of file +var _0x36f2=['./intFreshdeskAccount.controller','get','index','/:id','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x564bb4,_0x3ba038){var _0x90125=function(_0x270ee6){while(--_0x270ee6){_0x564bb4['push'](_0x564bb4['shift']());}};_0x90125(++_0x3ba038);}(_0x36f2,0x124));var _0x236f=function(_0x515c16,_0x4c4688){_0x515c16=_0x515c16-0x0;var _0x39d096=_0x36f2[_0x515c16];return _0x39d096;};'use strict';var multer=require(_0x236f('0x0'));var util=require(_0x236f('0x1'));var path=require(_0x236f('0x2'));var timeout=require(_0x236f('0x3'));var express=require(_0x236f('0x4'));var router=express[_0x236f('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x236f('0x6'));var config=require('../../config/environment');var controller=require(_0x236f('0x7'));router[_0x236f('0x8')]('/',auth['isAuthenticated'](),controller[_0x236f('0x9')]);router[_0x236f('0x8')](_0x236f('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x236f('0x8')](_0x236f('0xb'),auth[_0x236f('0xc')](),controller[_0x236f('0xd')]);router['get'](_0x236f('0xe'),auth[_0x236f('0xc')](),controller[_0x236f('0xf')]);router[_0x236f('0x10')]('/',auth[_0x236f('0xc')](),controller[_0x236f('0x11')]);router[_0x236f('0x10')](_0x236f('0xb'),auth[_0x236f('0xc')](),controller[_0x236f('0x12')]);router[_0x236f('0x13')](_0x236f('0xa'),auth['isAuthenticated'](),controller[_0x236f('0x14')]);router['delete'](_0x236f('0xa'),auth['isAuthenticated'](),controller[_0x236f('0x15')]);module[_0x236f('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 189c045..e76c887 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 _0x6d1e=['username','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6d1e,0x16d));var _0xe6d1=function(_0x236d24,_0x29e80a){_0x236d24=_0x236d24-0x0;var _0x1574cf=_0x6d1e[_0x236d24];return _0x1574cf;};'use strict';var Sequelize=require(_0xe6d1('0x0'));module[_0xe6d1('0x1')]={'name':{'type':Sequelize[_0xe6d1('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xe6d1('0x2')],'unique':_0xe6d1('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xe6d1('0x2')]}}; \ No newline at end of file +var _0x3965=['STRING','username','remoteUri','sequelize','exports'];(function(_0x17784a,_0x42fe44){var _0x41aded=function(_0x2e7319){while(--_0x2e7319){_0x17784a['push'](_0x17784a['shift']());}};_0x41aded(++_0x42fe44);}(_0x3965,0x1a2));var _0x5396=function(_0x524ce0,_0x3670b2){_0x524ce0=_0x524ce0-0x0;var _0x38299f=_0x3965[_0x524ce0];return _0x38299f;};'use strict';var Sequelize=require(_0x5396('0x0'));module[_0x5396('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5396('0x2')]},'username':{'type':Sequelize[_0x5396('0x2')],'unique':_0x5396('0x3')},'apiKey':{'type':Sequelize[_0x5396('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x5396('0x4')},'serverUrl':{'type':Sequelize[_0x5396('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 181478a..830a893 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 _0xe290=['api/v2/ticket_fields','Basic\x20%s','format','%s:X','toString','base64','requester','subject','description','group','source','ticket_type','company','remove','default','custom_text','label','choices','capitalize','statusCode','getFields,\x20%s,\x20%s,\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../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~!@#$%^&-_=+[{]}.','then','info','request\x20sent','debug','stringify','error','code','FreshdeskAccount,\x20%s,\x20%s','message','result','catch','status','end','json','count','offset','Content-Range','apply','reject','update','destroy','sendStatus','stack','name','send','FreshdeskAccount','rawAttributes','keys','query','filters','intersection','attributes','model','fields','nolimit','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','show','params','length','find','create','body','getConfigurations','FreshdeskConfiguration','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','FreshdeskField','getFields','apiKey','remoteUri','substring','lastIndexOf','GET','%s/%s'];(function(_0xabbd65,_0x546d99){var _0x1d005a=function(_0x11694e){while(--_0x11694e){_0xabbd65['push'](_0xabbd65['shift']());}};_0x1d005a(++_0x546d99);}(_0xe290,0x10f));var _0x0e29=function(_0x4d453c,_0x311b8c){_0x4d453c=_0x4d453c-0x0;var _0x4c80ac=_0xe290[_0x4d453c];return _0x4c80ac;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0e29('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0e29('0x1'));var jsonpatch=require(_0x0e29('0x2'));var rp=require(_0x0e29('0x3'));var moment=require(_0x0e29('0x4'));var BPromise=require(_0x0e29('0x5'));var Mustache=require(_0x0e29('0x6'));var util=require(_0x0e29('0x7'));var path=require(_0x0e29('0x8'));var sox=require(_0x0e29('0x9'));var csv=require(_0x0e29('0xa'));var ejs=require(_0x0e29('0xb'));var fs=require('fs');var _=require(_0x0e29('0xc'));var squel=require(_0x0e29('0xd'));var crypto=require(_0x0e29('0xe'));var jsforce=require(_0x0e29('0xf'));var deskjs=require(_0x0e29('0x10'));var toCsv=require('to-csv');var querystring=require(_0x0e29('0x11'));var Papa=require(_0x0e29('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0e29('0x13'));var hardwareService=require(_0x0e29('0x14'));var logger=require('../../config/logger')(_0x0e29('0x15'));var utils=require(_0x0e29('0x16'));var config=require(_0x0e29('0x17'));var db=require(_0x0e29('0x18'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson[_0x0e29('0x19')][_0x0e29('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x448613,_0x599631,_0x55cfc2){if(_0x55cfc2){var _0x2b3cf6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2b3cf6[_0x0e29('0x1b')](_0x599631)){return _0x448613;}else{throw new Error(_0x0e29('0x1c'));}}else{return _0x448613;}}function respondWithRpcPromise(_0x84e8c5,_0x514e76,_0x38203e,_0x13e85d){return new BPromise(function(_0x51a4d5,_0x1f7f47){var _0x544c12=_0x13e85d||client;return _0x544c12['request'](_0x84e8c5,_0x38203e)[_0x0e29('0x1d')](function(_0x813a2d){logger[_0x0e29('0x1e')]('FreshdeskAccount,\x20%s,\x20%s',_0x514e76,_0x0e29('0x1f'));logger[_0x0e29('0x20')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x514e76,_0x0e29('0x1f'),JSON[_0x0e29('0x21')](_0x813a2d));if(_0x813a2d[_0x0e29('0x22')]){if(_0x813a2d[_0x0e29('0x22')][_0x0e29('0x23')]===0x1f4){logger[_0x0e29('0x22')](_0x0e29('0x24'),_0x514e76,_0x813a2d[_0x0e29('0x22')]['message']);return _0x1f7f47(_0x813a2d['error'][_0x0e29('0x25')]);}logger['error'](_0x0e29('0x24'),_0x514e76,_0x813a2d[_0x0e29('0x22')][_0x0e29('0x25')]);return _0x51a4d5(_0x813a2d['error']['message']);}else{logger[_0x0e29('0x1e')]('FreshdeskAccount,\x20%s,\x20%s',_0x514e76,'request\x20sent');_0x51a4d5(_0x813a2d[_0x0e29('0x26')][_0x0e29('0x25')]);}})[_0x0e29('0x27')](function(_0x496053){logger[_0x0e29('0x22')]('FreshdeskAccount,\x20%s,\x20%s',_0x514e76,_0x496053);_0x1f7f47(_0x496053);});});}function respondWithStatusCode(_0xcf4e98,_0x123bc4){_0x123bc4=_0x123bc4||0xcc;return function(_0x2f4b12){if(_0x2f4b12){return _0xcf4e98['sendStatus'](_0x123bc4);}return _0xcf4e98[_0x0e29('0x28')](_0x123bc4)[_0x0e29('0x29')]();};}function respondWithResult(_0x2f9199,_0x1c0a07){_0x1c0a07=_0x1c0a07||0xc8;return function(_0x2a7e70){if(_0x2a7e70){return _0x2f9199['status'](_0x1c0a07)[_0x0e29('0x2a')](_0x2a7e70);}};}function respondWithFilteredResult(_0x3131b9,_0x58f377){return function(_0x45a126){if(_0x45a126){var _0x1ee577=_0x45a126[_0x0e29('0x2b')],_0x30de53=_0x58f377[_0x0e29('0x2c')],_0x48f50a=_0x58f377[_0x0e29('0x2c')]+_0x58f377['limit'],_0x2e39cb;if(_0x48f50a>=_0x1ee577){_0x48f50a=_0x1ee577;_0x2e39cb=0xc8;}else{_0x2e39cb=0xce;}_0x3131b9[_0x0e29('0x28')](_0x2e39cb);return _0x3131b9['set'](_0x0e29('0x2d'),_0x30de53+'-'+_0x48f50a+'/'+_0x1ee577)['json'](_0x45a126);}return null;};}function patchUpdates(_0xf2a702){return function(_0x13e21e){try{jsonpatch[_0x0e29('0x2e')](_0x13e21e,_0xf2a702,!![]);}catch(_0x183e37){return BPromise[_0x0e29('0x2f')](_0x183e37);}return _0x13e21e['save']();};}function saveUpdates(_0x2fd931,_0x595ab9){return function(_0x162bea){if(_0x162bea){return _0x162bea[_0x0e29('0x30')](_0x2fd931)[_0x0e29('0x1d')](function(_0x534418){return _0x534418;});}return null;};}function removeEntity(_0x598f11,_0x1848c8){return function(_0x5aa522){if(_0x5aa522){return _0x5aa522[_0x0e29('0x31')]()['then'](function(){_0x598f11[_0x0e29('0x28')](0xcc)[_0x0e29('0x29')]();});}};}function handleEntityNotFound(_0x296001,_0xdded0c){return function(_0x17f29b){if(!_0x17f29b){_0x296001[_0x0e29('0x32')](0x194);}return _0x17f29b;};}function handleError(_0x4ac645,_0xf21343){_0xf21343=_0xf21343||0x1f4;return function(_0x5c322d){logger[_0x0e29('0x22')](_0x5c322d[_0x0e29('0x33')]);if(_0x5c322d[_0x0e29('0x34')]){delete _0x5c322d['name'];}_0x4ac645[_0x0e29('0x28')](_0xf21343)[_0x0e29('0x35')](_0x5c322d);};}exports['index']=function(_0x22faa2,_0x29d2d0){var _0x199936={},_0x195a68={},_0x1e859e={'count':0x0,'rows':[]};var _0x454205=db[_0x0e29('0x36')][_0x0e29('0x37')];_0x195a68['model']=_[_0x0e29('0x38')](_0x454205);_0x195a68[_0x0e29('0x39')]=_[_0x0e29('0x38')](_0x22faa2[_0x0e29('0x39')]);_0x195a68[_0x0e29('0x3a')]=_[_0x0e29('0x3b')](_0x195a68['model'],_0x195a68[_0x0e29('0x39')]);_0x199936[_0x0e29('0x3c')]=_['intersection'](_0x195a68[_0x0e29('0x3d')],qs['fields'](_0x22faa2['query'][_0x0e29('0x3e')]));_0x199936[_0x0e29('0x3c')]=_0x199936[_0x0e29('0x3c')]['length']?_0x199936[_0x0e29('0x3c')]:_0x195a68[_0x0e29('0x3d')];if(!_0x22faa2[_0x0e29('0x39')]['hasOwnProperty'](_0x0e29('0x3f'))){_0x199936[_0x0e29('0x40')]=qs[_0x0e29('0x40')](_0x22faa2[_0x0e29('0x39')][_0x0e29('0x40')]);_0x199936[_0x0e29('0x2c')]=qs[_0x0e29('0x2c')](_0x22faa2['query'][_0x0e29('0x2c')]);}_0x199936[_0x0e29('0x41')]=qs[_0x0e29('0x42')](_0x22faa2[_0x0e29('0x39')]['sort']);_0x199936[_0x0e29('0x43')]=qs['filters'](_[_0x0e29('0x44')](_0x22faa2[_0x0e29('0x39')],_0x195a68[_0x0e29('0x3a')]));if(_0x22faa2[_0x0e29('0x39')][_0x0e29('0x45')]){_0x199936['where']=_[_0x0e29('0x46')](_0x199936[_0x0e29('0x43')],{'$or':_[_0x0e29('0x47')](_0x454205,function(_0x478f7d){if(_0x478f7d[_0x0e29('0x48')][_0x0e29('0x49')]!==_0x0e29('0x4a')){var _0x50a33c={};_0x50a33c[_0x478f7d[_0x0e29('0x4b')]]={'$like':'%'+_0x22faa2['query'][_0x0e29('0x45')]+'%'};return _0x50a33c;}})});}_0x199936=_[_0x0e29('0x46')]({},_0x199936,_0x22faa2[_0x0e29('0x4c')]);var _0x2ffd22={'where':_0x199936[_0x0e29('0x43')]};return db[_0x0e29('0x36')][_0x0e29('0x2b')](_0x2ffd22)[_0x0e29('0x1d')](function(_0x1dccc6){_0x1e859e[_0x0e29('0x2b')]=_0x1dccc6;if(_0x22faa2[_0x0e29('0x39')][_0x0e29('0x4d')]){_0x199936[_0x0e29('0x4e')]=[{'all':!![]}];}return db[_0x0e29('0x36')][_0x0e29('0x4f')](_0x199936);})[_0x0e29('0x1d')](function(_0x53abcc){_0x1e859e['rows']=_0x53abcc;return _0x1e859e;})[_0x0e29('0x1d')](respondWithFilteredResult(_0x29d2d0,_0x199936))[_0x0e29('0x27')](handleError(_0x29d2d0,null));};exports[_0x0e29('0x50')]=function(_0x3b5e4c,_0x5dbaa9){var _0x34aea7={'raw':![],'where':{'id':_0x3b5e4c[_0x0e29('0x51')]['id']}},_0x5c58b5={};_0x5c58b5[_0x0e29('0x3d')]=_['keys'](db[_0x0e29('0x36')]['rawAttributes']);_0x5c58b5[_0x0e29('0x39')]=_['keys'](_0x3b5e4c[_0x0e29('0x39')]);_0x5c58b5['filters']=_['intersection'](_0x5c58b5[_0x0e29('0x3d')],_0x5c58b5[_0x0e29('0x39')]);_0x34aea7[_0x0e29('0x3c')]=_[_0x0e29('0x3b')](_0x5c58b5[_0x0e29('0x3d')],qs[_0x0e29('0x3e')](_0x3b5e4c[_0x0e29('0x39')][_0x0e29('0x3e')]));_0x34aea7[_0x0e29('0x3c')]=_0x34aea7[_0x0e29('0x3c')][_0x0e29('0x52')]?_0x34aea7['attributes']:_0x5c58b5[_0x0e29('0x3d')];if(_0x3b5e4c[_0x0e29('0x39')]['includeAll']){_0x34aea7[_0x0e29('0x4e')]=[{'all':!![]}];}_0x34aea7=_[_0x0e29('0x46')]({},_0x34aea7,_0x3b5e4c['options']);return db[_0x0e29('0x36')][_0x0e29('0x53')](_0x34aea7)[_0x0e29('0x1d')](handleEntityNotFound(_0x5dbaa9,null))['then'](respondWithResult(_0x5dbaa9,null))[_0x0e29('0x27')](handleError(_0x5dbaa9,null));};exports[_0x0e29('0x54')]=function(_0x36502c,_0x123317){return db[_0x0e29('0x36')]['create'](_0x36502c['body'],{})[_0x0e29('0x1d')](respondWithResult(_0x123317,0xc9))[_0x0e29('0x27')](handleError(_0x123317,null));};exports['update']=function(_0x4dcc4b,_0x20a885){if(_0x4dcc4b[_0x0e29('0x55')]['id']){delete _0x4dcc4b[_0x0e29('0x55')]['id'];}return db[_0x0e29('0x36')][_0x0e29('0x53')]({'where':{'id':_0x4dcc4b['params']['id']}})[_0x0e29('0x1d')](handleEntityNotFound(_0x20a885,null))[_0x0e29('0x1d')](saveUpdates(_0x4dcc4b['body'],null))[_0x0e29('0x1d')](respondWithResult(_0x20a885,null))[_0x0e29('0x27')](handleError(_0x20a885,null));};exports['destroy']=function(_0x2fb72d,_0x542a95){return db[_0x0e29('0x36')][_0x0e29('0x53')]({'where':{'id':_0x2fb72d[_0x0e29('0x51')]['id']}})[_0x0e29('0x1d')](handleEntityNotFound(_0x542a95,null))[_0x0e29('0x1d')](removeEntity(_0x542a95,null))[_0x0e29('0x27')](handleError(_0x542a95,null));};exports[_0x0e29('0x56')]=function(_0x133d4e,_0xfd494a,_0xa4d101){var _0x5536b8={};var _0x1771cb={};var _0x411106;var _0x1126d3;return db['FreshdeskAccount']['findOne']({'where':{'id':_0x133d4e[_0x0e29('0x51')]['id']}})['then'](handleEntityNotFound(_0xfd494a,null))[_0x0e29('0x1d')](function(_0x8152a5){if(_0x8152a5){_0x411106=_0x8152a5;_0x1771cb[_0x0e29('0x3d')]=_[_0x0e29('0x38')](db[_0x0e29('0x57')]['rawAttributes']);_0x1771cb[_0x0e29('0x39')]=_[_0x0e29('0x38')](_0x133d4e[_0x0e29('0x39')]);_0x1771cb[_0x0e29('0x3a')]=_[_0x0e29('0x3b')](_0x1771cb[_0x0e29('0x3d')],_0x1771cb[_0x0e29('0x39')]);_0x5536b8[_0x0e29('0x3c')]=_[_0x0e29('0x3b')](_0x1771cb[_0x0e29('0x3d')],qs[_0x0e29('0x3e')](_0x133d4e[_0x0e29('0x39')][_0x0e29('0x3e')]));_0x5536b8[_0x0e29('0x3c')]=_0x5536b8['attributes']['length']?_0x5536b8['attributes']:_0x1771cb['model'];_0x5536b8[_0x0e29('0x41')]=qs['sort'](_0x133d4e[_0x0e29('0x39')][_0x0e29('0x42')]);_0x5536b8[_0x0e29('0x43')]=qs['filters'](_[_0x0e29('0x44')](_0x133d4e[_0x0e29('0x39')],_0x1771cb[_0x0e29('0x3a')]));if(_0x133d4e[_0x0e29('0x39')][_0x0e29('0x45')]){_0x5536b8[_0x0e29('0x43')]=_[_0x0e29('0x46')](_0x5536b8[_0x0e29('0x43')],{'$or':_['map'](_0x5536b8[_0x0e29('0x3c')],function(_0x4d12d6){var _0x111e05={};_0x111e05[_0x4d12d6]={'$like':'%'+_0x133d4e[_0x0e29('0x39')][_0x0e29('0x45')]+'%'};return _0x111e05;})});}_0x5536b8=_[_0x0e29('0x46')]({},_0x5536b8,_0x133d4e['options']);return _0x411106['getConfigurations'](_0x5536b8);}})[_0x0e29('0x1d')](function(_0x876eb4){if(_0x876eb4){_0x1126d3=_0x876eb4[_0x0e29('0x52')];if(!_0x133d4e[_0x0e29('0x39')][_0x0e29('0x58')](_0x0e29('0x3f'))){_0x5536b8[_0x0e29('0x40')]=qs[_0x0e29('0x40')](_0x133d4e[_0x0e29('0x39')][_0x0e29('0x40')]);_0x5536b8[_0x0e29('0x2c')]=qs[_0x0e29('0x2c')](_0x133d4e[_0x0e29('0x39')]['offset']);}return _0x411106[_0x0e29('0x56')](_0x5536b8);}})[_0x0e29('0x1d')](function(_0x1a859b){if(_0x1a859b){return _0x1a859b?{'count':_0x1126d3,'rows':_0x1a859b}:null;}})[_0x0e29('0x1d')](respondWithResult(_0xfd494a,null))['catch'](handleError(_0xfd494a,null));};exports[_0x0e29('0x59')]=function(_0x681b4,_0x3e4123,_0x32cf5b){if(_0x681b4[_0x0e29('0x55')]['id']){delete _0x681b4[_0x0e29('0x55')]['id'];}return db[_0x0e29('0x36')][_0x0e29('0x5a')]({'where':{'id':_0x681b4[_0x0e29('0x51')]['id']}})[_0x0e29('0x1d')](handleEntityNotFound(_0x3e4123,null))['then'](function(_0x44bc62){if(_0x44bc62){_0x681b4['body'][_0x0e29('0x5b')]=_0x44bc62['id'];_0x681b4['body'][_0x0e29('0x5c')]=integrations[_0x0e29('0x5d')](_0x681b4[_0x0e29('0x55')][_0x0e29('0x5e')],_0x681b4[_0x0e29('0x55')][_0x0e29('0x48')]);_0x681b4[_0x0e29('0x55')][_0x0e29('0x5f')]=integrations['getDescriptions'](_0x681b4[_0x0e29('0x55')]['channel'],_0x681b4['body'][_0x0e29('0x48')]);return db[_0x0e29('0x57')][_0x0e29('0x54')](_0x681b4['body'],{'include':[{'model':db[_0x0e29('0x60')],'as':_0x0e29('0x5c')},{'model':db['FreshdeskField'],'as':'Descriptions'}]});}return null;})[_0x0e29('0x1d')](respondWithResult(_0x3e4123,null))[_0x0e29('0x27')](handleError(_0x3e4123,null));};exports[_0x0e29('0x61')]=function(_0x5f538b,_0x4394cc,_0x581e31){var _0x28bd26='';return db['FreshdeskAccount'][_0x0e29('0x5a')]({'where':{'id':_0x5f538b['params']['id']},'attributes':['id','remoteUri',_0x0e29('0x62')]})[_0x0e29('0x1d')](handleEntityNotFound(_0x4394cc,null))['then'](function(_0x570014){if(_0x570014){_0x28bd26=_0x570014[_0x0e29('0x63')];var _0x5cf6db=_0x28bd26['slice'](-0x1);if(_0x5cf6db==='/'){_0x28bd26=_0x28bd26[_0x0e29('0x64')](0x0,_0x28bd26[_0x0e29('0x65')](_0x5cf6db));}return rp({'method':_0x0e29('0x66'),'uri':util['format'](_0x0e29('0x67'),_0x28bd26,_0x0e29('0x68')),'headers':{'Authorization':util['format'](_0x0e29('0x69'),new Buffer(util[_0x0e29('0x6a')](_0x0e29('0x6b'),_0x570014[_0x0e29('0x62')]))[_0x0e29('0x6c')](_0x0e29('0x6d')))},'json':!![]});}})[_0x0e29('0x1d')](function(_0x575cfb){if(_0x575cfb){var _0x401b19=[_0x0e29('0x6e'),_0x0e29('0x6f'),'agent',_0x0e29('0x70'),'status','priority',_0x0e29('0x71'),_0x0e29('0x72'),_0x0e29('0x73'),_0x0e29('0x71'),_0x0e29('0x74')];_[_0x0e29('0x75')](_0x575cfb,function(_0x57e96a){return _0x401b19['includes'](_0x57e96a[_0x0e29('0x34')])||!_0x57e96a[_0x0e29('0x76')]&&_0x57e96a['type']!==_0x0e29('0x77')&&_0x57e96a['type']!=='custom_dropdown';});return{'count':_0x575cfb[_0x0e29('0x52')],'rows':_[_0x0e29('0x47')](_0x575cfb,function(_0x3550a0){return{'id':_0x3550a0[_0x0e29('0x34')],'name':_0x3550a0[_0x0e29('0x78')],'custom':!_0x3550a0[_0x0e29('0x76')],'options':_0x3550a0['choices']?_['map'](_0x3550a0[_0x0e29('0x79')],function(_0xadcc2f){return{'name':_[_0x0e29('0x7a')](_0xadcc2f),'value':_0xadcc2f};}):[]};})};}})[_0x0e29('0x1d')](respondWithResult(_0x4394cc,null))['catch'](function(_0x18b9c6){var _0x1fdbfc=_0x5f538b[_0x0e29('0x39')][_0x0e29('0x1b')]?0x1f4:_0x18b9c6[_0x0e29('0x7b')]||0x1f4;logger['error'](_0x0e29('0x7c'),_0x0e29('0x61'),_0x1fdbfc,JSON['stringify'](_0x18b9c6));delete _0x18b9c6[_0x0e29('0x34')];if(_0x1fdbfc===0x191){_0x1fdbfc=0x190;}_0x4394cc[_0x0e29('0x28')](_0x1fdbfc)[_0x0e29('0x35')](_0x5f538b[_0x0e29('0x39')][_0x0e29('0x1b')]?{'message':'Wrong\x20credentials','statusCode':_0x18b9c6[_0x0e29('0x7b')]}:_0x18b9c6);});}; \ No newline at end of file +var _0x550f=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../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~!@#$%^&-_=+[{]}.','then','info','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','FreshdeskAccount,\x20%s,\x20%s','message','catch','status','end','json','count','offset','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','FreshdeskAccount','rawAttributes','model','keys','query','filters','intersection','fields','attributes','nolimit','limit','order','sort','filter','where','map','type','key','VIRTUAL','field','merge','options','includeAll','include','findAll','length','find','create','body','params','getConfigurations','findOne','hasOwnProperty','addConfiguration','AccountId','getSubjects','getDescriptions','channel','FreshdeskField','Subjects','Descriptions','getFields','remoteUri','apiKey','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','description','priority','group','source','ticket_type','company','includes','default','custom_text','custom_dropdown','label','choices','statusCode','getFields,\x20%s,\x20%s,\x20%s','zip-dir','fast-json-patch','request-promise','util','sox','to-csv','lodash','squel','desk.js','querystring','papaparse'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x550f,0x6d));var _0xf550=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x550f[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf550('0x0'));var jsonpatch=require(_0xf550('0x1'));var rp=require(_0xf550('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf550('0x3'));var path=require('path');var sox=require(_0xf550('0x4'));var csv=require(_0xf550('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf550('0x6'));var squel=require(_0xf550('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf550('0x8'));var toCsv=require(_0xf550('0x5'));var querystring=require(_0xf550('0x9'));var Papa=require(_0xf550('0xa'));var Redis=require(_0xf550('0xb'));var authService=require(_0xf550('0xc'));var qs=require(_0xf550('0xd'));var hardwareService=require(_0xf550('0xe'));var logger=require(_0xf550('0xf'))(_0xf550('0x10'));var utils=require(_0xf550('0x11'));var config=require('../../config/environment');var db=require(_0xf550('0x12'))['db'];var integrations=require(_0xf550('0x13'));var jayson=require(_0xf550('0x14'));var client=jayson[_0xf550('0x15')]['http']({'port':0x232a});function checkPasswordPattern(_0xd95210,_0x55076d,_0x373e56){if(_0x373e56){var _0x27deb6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x27deb6[_0xf550('0x16')](_0x55076d)){return _0xd95210;}else{throw new Error(_0xf550('0x17'));}}else{return _0xd95210;}}function respondWithRpcPromise(_0x4f4d58,_0x5242c0,_0x81403e,_0x2b8d53){return new BPromise(function(_0x2bd966,_0x2ae725){var _0x2512f1=_0x2b8d53||client;return _0x2512f1['request'](_0x4f4d58,_0x81403e)[_0xf550('0x18')](function(_0x32ac89){logger[_0xf550('0x19')]('FreshdeskAccount,\x20%s,\x20%s',_0x5242c0,'request\x20sent');logger[_0xf550('0x1a')](_0xf550('0x1b'),_0x5242c0,_0xf550('0x1c'),JSON[_0xf550('0x1d')](_0x32ac89));if(_0x32ac89[_0xf550('0x1e')]){if(_0x32ac89[_0xf550('0x1e')]['code']===0x1f4){logger[_0xf550('0x1e')](_0xf550('0x1f'),_0x5242c0,_0x32ac89[_0xf550('0x1e')][_0xf550('0x20')]);return _0x2ae725(_0x32ac89[_0xf550('0x1e')][_0xf550('0x20')]);}logger[_0xf550('0x1e')](_0xf550('0x1f'),_0x5242c0,_0x32ac89[_0xf550('0x1e')][_0xf550('0x20')]);return _0x2bd966(_0x32ac89[_0xf550('0x1e')]['message']);}else{logger[_0xf550('0x19')](_0xf550('0x1f'),_0x5242c0,_0xf550('0x1c'));_0x2bd966(_0x32ac89['result'][_0xf550('0x20')]);}})[_0xf550('0x21')](function(_0x319239){logger['error'](_0xf550('0x1f'),_0x5242c0,_0x319239);_0x2ae725(_0x319239);});});}function respondWithStatusCode(_0x77fd49,_0x3231fa){_0x3231fa=_0x3231fa||0xcc;return function(_0x5af5c9){if(_0x5af5c9){return _0x77fd49['sendStatus'](_0x3231fa);}return _0x77fd49[_0xf550('0x22')](_0x3231fa)[_0xf550('0x23')]();};}function respondWithResult(_0x25e38a,_0x405148){_0x405148=_0x405148||0xc8;return function(_0x28418d){if(_0x28418d){return _0x25e38a['status'](_0x405148)[_0xf550('0x24')](_0x28418d);}};}function respondWithFilteredResult(_0x2549b5,_0x159d09){return function(_0x5ed6cc){if(_0x5ed6cc){var _0x55cfb9=_0x5ed6cc[_0xf550('0x25')],_0x4632a7=_0x159d09[_0xf550('0x26')],_0x2d6e0d=_0x159d09[_0xf550('0x26')]+_0x159d09['limit'],_0x55d489;if(_0x2d6e0d>=_0x55cfb9){_0x2d6e0d=_0x55cfb9;_0x55d489=0xc8;}else{_0x55d489=0xce;}_0x2549b5[_0xf550('0x22')](_0x55d489);return _0x2549b5['set'](_0xf550('0x27'),_0x4632a7+'-'+_0x2d6e0d+'/'+_0x55cfb9)['json'](_0x5ed6cc);}return null;};}function patchUpdates(_0x1e3ae0){return function(_0x57cf5d){try{jsonpatch[_0xf550('0x28')](_0x57cf5d,_0x1e3ae0,!![]);}catch(_0x4eda31){return BPromise[_0xf550('0x29')](_0x4eda31);}return _0x57cf5d[_0xf550('0x2a')]();};}function saveUpdates(_0x9c7875,_0x3afb2b){return function(_0x36e321){if(_0x36e321){return _0x36e321[_0xf550('0x2b')](_0x9c7875)[_0xf550('0x18')](function(_0x3effa2){return _0x3effa2;});}return null;};}function removeEntity(_0x2df738,_0x3cc4dc){return function(_0x5d6e6f){if(_0x5d6e6f){return _0x5d6e6f[_0xf550('0x2c')]()[_0xf550('0x18')](function(){_0x2df738['status'](0xcc)[_0xf550('0x23')]();});}};}function handleEntityNotFound(_0x4a8a38,_0x2cc85f){return function(_0x2fdf90){if(!_0x2fdf90){_0x4a8a38[_0xf550('0x2d')](0x194);}return _0x2fdf90;};}function handleError(_0x2623a3,_0x14919e){_0x14919e=_0x14919e||0x1f4;return function(_0x1dc651){logger['error'](_0x1dc651[_0xf550('0x2e')]);if(_0x1dc651[_0xf550('0x2f')]){delete _0x1dc651['name'];}_0x2623a3['status'](_0x14919e)[_0xf550('0x30')](_0x1dc651);};}exports[_0xf550('0x31')]=function(_0x26c5fa,_0x169e25){var _0x18d3ff={},_0x5f4032={},_0x4491ee={'count':0x0,'rows':[]};var _0x346f69=db[_0xf550('0x32')][_0xf550('0x33')];_0x5f4032[_0xf550('0x34')]=_[_0xf550('0x35')](_0x346f69);_0x5f4032[_0xf550('0x36')]=_[_0xf550('0x35')](_0x26c5fa[_0xf550('0x36')]);_0x5f4032[_0xf550('0x37')]=_['intersection'](_0x5f4032['model'],_0x5f4032[_0xf550('0x36')]);_0x18d3ff['attributes']=_[_0xf550('0x38')](_0x5f4032[_0xf550('0x34')],qs[_0xf550('0x39')](_0x26c5fa[_0xf550('0x36')][_0xf550('0x39')]));_0x18d3ff['attributes']=_0x18d3ff[_0xf550('0x3a')]['length']?_0x18d3ff['attributes']:_0x5f4032[_0xf550('0x34')];if(!_0x26c5fa[_0xf550('0x36')]['hasOwnProperty'](_0xf550('0x3b'))){_0x18d3ff[_0xf550('0x3c')]=qs[_0xf550('0x3c')](_0x26c5fa[_0xf550('0x36')][_0xf550('0x3c')]);_0x18d3ff['offset']=qs[_0xf550('0x26')](_0x26c5fa['query']['offset']);}_0x18d3ff[_0xf550('0x3d')]=qs[_0xf550('0x3e')](_0x26c5fa[_0xf550('0x36')]['sort']);_0x18d3ff['where']=qs[_0xf550('0x37')](_['pick'](_0x26c5fa['query'],_0x5f4032[_0xf550('0x37')]));if(_0x26c5fa['query'][_0xf550('0x3f')]){_0x18d3ff[_0xf550('0x40')]=_['merge'](_0x18d3ff[_0xf550('0x40')],{'$or':_[_0xf550('0x41')](_0x346f69,function(_0x47acf3){if(_0x47acf3[_0xf550('0x42')][_0xf550('0x43')]!==_0xf550('0x44')){var _0x1aed54={};_0x1aed54[_0x47acf3[_0xf550('0x45')]]={'$like':'%'+_0x26c5fa[_0xf550('0x36')]['filter']+'%'};return _0x1aed54;}})});}_0x18d3ff=_[_0xf550('0x46')]({},_0x18d3ff,_0x26c5fa[_0xf550('0x47')]);var _0x539d9b={'where':_0x18d3ff[_0xf550('0x40')]};return db[_0xf550('0x32')][_0xf550('0x25')](_0x539d9b)[_0xf550('0x18')](function(_0x4cb593){_0x4491ee[_0xf550('0x25')]=_0x4cb593;if(_0x26c5fa[_0xf550('0x36')][_0xf550('0x48')]){_0x18d3ff[_0xf550('0x49')]=[{'all':!![]}];}return db[_0xf550('0x32')][_0xf550('0x4a')](_0x18d3ff);})[_0xf550('0x18')](function(_0x3d9757){_0x4491ee['rows']=_0x3d9757;return _0x4491ee;})[_0xf550('0x18')](respondWithFilteredResult(_0x169e25,_0x18d3ff))['catch'](handleError(_0x169e25,null));};exports['show']=function(_0xe65ca8,_0x4759ca){var _0x362cca={'raw':![],'where':{'id':_0xe65ca8['params']['id']}},_0x259eea={};_0x259eea[_0xf550('0x34')]=_[_0xf550('0x35')](db[_0xf550('0x32')][_0xf550('0x33')]);_0x259eea[_0xf550('0x36')]=_['keys'](_0xe65ca8['query']);_0x259eea[_0xf550('0x37')]=_['intersection'](_0x259eea[_0xf550('0x34')],_0x259eea['query']);_0x362cca[_0xf550('0x3a')]=_[_0xf550('0x38')](_0x259eea['model'],qs[_0xf550('0x39')](_0xe65ca8[_0xf550('0x36')][_0xf550('0x39')]));_0x362cca[_0xf550('0x3a')]=_0x362cca[_0xf550('0x3a')][_0xf550('0x4b')]?_0x362cca[_0xf550('0x3a')]:_0x259eea[_0xf550('0x34')];if(_0xe65ca8[_0xf550('0x36')][_0xf550('0x48')]){_0x362cca[_0xf550('0x49')]=[{'all':!![]}];}_0x362cca=_['merge']({},_0x362cca,_0xe65ca8['options']);return db[_0xf550('0x32')][_0xf550('0x4c')](_0x362cca)[_0xf550('0x18')](handleEntityNotFound(_0x4759ca,null))[_0xf550('0x18')](respondWithResult(_0x4759ca,null))[_0xf550('0x21')](handleError(_0x4759ca,null));};exports[_0xf550('0x4d')]=function(_0x39d523,_0x2e7b5f){return db['FreshdeskAccount']['create'](_0x39d523['body'],{})[_0xf550('0x18')](respondWithResult(_0x2e7b5f,0xc9))[_0xf550('0x21')](handleError(_0x2e7b5f,null));};exports['update']=function(_0x2de579,_0xba728a){if(_0x2de579[_0xf550('0x4e')]['id']){delete _0x2de579[_0xf550('0x4e')]['id'];}return db['FreshdeskAccount'][_0xf550('0x4c')]({'where':{'id':_0x2de579[_0xf550('0x4f')]['id']}})[_0xf550('0x18')](handleEntityNotFound(_0xba728a,null))[_0xf550('0x18')](saveUpdates(_0x2de579[_0xf550('0x4e')],null))[_0xf550('0x18')](respondWithResult(_0xba728a,null))['catch'](handleError(_0xba728a,null));};exports['destroy']=function(_0x356c30,_0x3aa815){return db['FreshdeskAccount'][_0xf550('0x4c')]({'where':{'id':_0x356c30['params']['id']}})[_0xf550('0x18')](handleEntityNotFound(_0x3aa815,null))[_0xf550('0x18')](removeEntity(_0x3aa815,null))[_0xf550('0x21')](handleError(_0x3aa815,null));};exports[_0xf550('0x50')]=function(_0x43db13,_0x1c1233,_0x175cfc){var _0x496d56={};var _0x562a3e={};var _0x10e286;var _0x56a2c8;return db[_0xf550('0x32')][_0xf550('0x51')]({'where':{'id':_0x43db13[_0xf550('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1c1233,null))['then'](function(_0x3c0619){if(_0x3c0619){_0x10e286=_0x3c0619;_0x562a3e[_0xf550('0x34')]=_[_0xf550('0x35')](db['FreshdeskConfiguration']['rawAttributes']);_0x562a3e[_0xf550('0x36')]=_[_0xf550('0x35')](_0x43db13['query']);_0x562a3e['filters']=_[_0xf550('0x38')](_0x562a3e[_0xf550('0x34')],_0x562a3e['query']);_0x496d56[_0xf550('0x3a')]=_[_0xf550('0x38')](_0x562a3e[_0xf550('0x34')],qs[_0xf550('0x39')](_0x43db13[_0xf550('0x36')][_0xf550('0x39')]));_0x496d56[_0xf550('0x3a')]=_0x496d56[_0xf550('0x3a')][_0xf550('0x4b')]?_0x496d56[_0xf550('0x3a')]:_0x562a3e[_0xf550('0x34')];_0x496d56['order']=qs[_0xf550('0x3e')](_0x43db13['query'][_0xf550('0x3e')]);_0x496d56['where']=qs[_0xf550('0x37')](_['pick'](_0x43db13['query'],_0x562a3e['filters']));if(_0x43db13['query']['filter']){_0x496d56[_0xf550('0x40')]=_['merge'](_0x496d56['where'],{'$or':_[_0xf550('0x41')](_0x496d56['attributes'],function(_0x3e6cfc){var _0x43cdd2={};_0x43cdd2[_0x3e6cfc]={'$like':'%'+_0x43db13[_0xf550('0x36')][_0xf550('0x3f')]+'%'};return _0x43cdd2;})});}_0x496d56=_[_0xf550('0x46')]({},_0x496d56,_0x43db13['options']);return _0x10e286['getConfigurations'](_0x496d56);}})[_0xf550('0x18')](function(_0x19d49c){if(_0x19d49c){_0x56a2c8=_0x19d49c['length'];if(!_0x43db13[_0xf550('0x36')][_0xf550('0x52')]('nolimit')){_0x496d56[_0xf550('0x3c')]=qs[_0xf550('0x3c')](_0x43db13[_0xf550('0x36')][_0xf550('0x3c')]);_0x496d56[_0xf550('0x26')]=qs[_0xf550('0x26')](_0x43db13[_0xf550('0x36')][_0xf550('0x26')]);}return _0x10e286[_0xf550('0x50')](_0x496d56);}})[_0xf550('0x18')](function(_0x22a7db){if(_0x22a7db){return _0x22a7db?{'count':_0x56a2c8,'rows':_0x22a7db}:null;}})[_0xf550('0x18')](respondWithResult(_0x1c1233,null))[_0xf550('0x21')](handleError(_0x1c1233,null));};exports[_0xf550('0x53')]=function(_0x3cf29b,_0x30b245,_0x945014){if(_0x3cf29b['body']['id']){delete _0x3cf29b['body']['id'];}return db[_0xf550('0x32')][_0xf550('0x51')]({'where':{'id':_0x3cf29b[_0xf550('0x4f')]['id']}})['then'](handleEntityNotFound(_0x30b245,null))[_0xf550('0x18')](function(_0x1f3680){if(_0x1f3680){_0x3cf29b[_0xf550('0x4e')][_0xf550('0x54')]=_0x1f3680['id'];_0x3cf29b[_0xf550('0x4e')]['Subjects']=integrations[_0xf550('0x55')](_0x3cf29b['body']['channel'],_0x3cf29b[_0xf550('0x4e')][_0xf550('0x42')]);_0x3cf29b['body']['Descriptions']=integrations[_0xf550('0x56')](_0x3cf29b['body'][_0xf550('0x57')],_0x3cf29b[_0xf550('0x4e')][_0xf550('0x42')]);return db['FreshdeskConfiguration'][_0xf550('0x4d')](_0x3cf29b[_0xf550('0x4e')],{'include':[{'model':db[_0xf550('0x58')],'as':_0xf550('0x59')},{'model':db[_0xf550('0x58')],'as':_0xf550('0x5a')}]});}return null;})[_0xf550('0x18')](respondWithResult(_0x30b245,null))['catch'](handleError(_0x30b245,null));};exports[_0xf550('0x5b')]=function(_0x3f3759,_0x135a7a,_0x32b36e){var _0x155593='';return db[_0xf550('0x32')][_0xf550('0x51')]({'where':{'id':_0x3f3759[_0xf550('0x4f')]['id']},'attributes':['id',_0xf550('0x5c'),_0xf550('0x5d')]})[_0xf550('0x18')](handleEntityNotFound(_0x135a7a,null))[_0xf550('0x18')](function(_0xfad4a2){if(_0xfad4a2){_0x155593=_0xfad4a2[_0xf550('0x5c')];var _0x3f2609=_0x155593['slice'](-0x1);if(_0x3f2609==='/'){_0x155593=_0x155593['substring'](0x0,_0x155593[_0xf550('0x5e')](_0x3f2609));}return rp({'method':_0xf550('0x5f'),'uri':util[_0xf550('0x60')](_0xf550('0x61'),_0x155593,_0xf550('0x62')),'headers':{'Authorization':util[_0xf550('0x60')](_0xf550('0x63'),new Buffer(util['format'](_0xf550('0x64'),_0xfad4a2[_0xf550('0x5d')]))[_0xf550('0x65')](_0xf550('0x66')))},'json':!![]});}})[_0xf550('0x18')](function(_0x3c8582){if(_0x3c8582){var _0x57077c=[_0xf550('0x67'),_0xf550('0x68'),_0xf550('0x69'),_0xf550('0x6a'),_0xf550('0x22'),_0xf550('0x6b'),_0xf550('0x6c'),_0xf550('0x6d'),_0xf550('0x6e'),'group',_0xf550('0x6f')];_['remove'](_0x3c8582,function(_0x4a67f5){return _0x57077c[_0xf550('0x70')](_0x4a67f5[_0xf550('0x2f')])||!_0x4a67f5[_0xf550('0x71')]&&_0x4a67f5[_0xf550('0x42')]!==_0xf550('0x72')&&_0x4a67f5[_0xf550('0x42')]!==_0xf550('0x73');});return{'count':_0x3c8582['length'],'rows':_[_0xf550('0x41')](_0x3c8582,function(_0x337b80){return{'id':_0x337b80[_0xf550('0x2f')],'name':_0x337b80[_0xf550('0x74')],'custom':!_0x337b80[_0xf550('0x71')],'options':_0x337b80[_0xf550('0x75')]?_[_0xf550('0x41')](_0x337b80['choices'],function(_0x401c9a){return{'name':_['capitalize'](_0x401c9a),'value':_0x401c9a};}):[]};})};}})[_0xf550('0x18')](respondWithResult(_0x135a7a,null))[_0xf550('0x21')](function(_0x4edfd8){var _0x1aded1=_0x3f3759[_0xf550('0x36')]['test']?0x1f4:_0x4edfd8[_0xf550('0x76')]||0x1f4;logger[_0xf550('0x1e')](_0xf550('0x77'),_0xf550('0x5b'),_0x1aded1,JSON['stringify'](_0x4edfd8));delete _0x4edfd8['name'];if(_0x1aded1===0x191){_0x1aded1=0x190;}_0x135a7a[_0xf550('0x22')](_0x1aded1)[_0xf550('0x30')](_0x3f3759['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x4edfd8[_0xf550('0x76')]}:_0x4edfd8);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 55f2968..cbd4ded 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 _0xc3b8=['api','bluebird','path','rimraf','../../config/environment','exports','FreshdeskAccount','int_freshdesk_accounts','lodash','../../config/logger'];(function(_0x47388e,_0x5ce16f){var _0x6b6fe9=function(_0x26c323){while(--_0x26c323){_0x47388e['push'](_0x47388e['shift']());}};_0x6b6fe9(++_0x5ce16f);}(_0xc3b8,0xb2));var _0x8c3b=function(_0x3ff8b5,_0x10edfb){_0x3ff8b5=_0x3ff8b5-0x0;var _0x2e255d=_0xc3b8[_0x3ff8b5];return _0x2e255d;};'use strict';var _=require(_0x8c3b('0x0'));var util=require('util');var logger=require(_0x8c3b('0x1'))(_0x8c3b('0x2'));var moment=require('moment');var BPromise=require(_0x8c3b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8c3b('0x4'));var rimraf=require(_0x8c3b('0x5'));var config=require(_0x8c3b('0x6'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x8c3b('0x7')]=function(_0xb32d87,_0x3cd016){return _0xb32d87['define'](_0x8c3b('0x8'),attributes,{'tableName':_0x8c3b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5063=['api','moment','request-promise','path','rimraf','../../config/environment','exports','define','FreshdeskAccount','lodash','util'];(function(_0x1e92c0,_0xbe06aa){var _0x34237b=function(_0x323c4e){while(--_0x323c4e){_0x1e92c0['push'](_0x1e92c0['shift']());}};_0x34237b(++_0xbe06aa);}(_0x5063,0x98));var _0x3506=function(_0x403594,_0x2c63fb){_0x403594=_0x403594-0x0;var _0x31526a=_0x5063[_0x403594];return _0x31526a;};'use strict';var _=require(_0x3506('0x0'));var util=require(_0x3506('0x1'));var logger=require('../../config/logger')(_0x3506('0x2'));var moment=require(_0x3506('0x3'));var BPromise=require('bluebird');var rp=require(_0x3506('0x4'));var fs=require('fs');var path=require(_0x3506('0x5'));var rimraf=require(_0x3506('0x6'));var config=require(_0x3506('0x7'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x3506('0x8')]=function(_0xde730a,_0x5ac0c2){return _0xde730a[_0x3506('0x9')](_0x3506('0xa'),attributes,{'tableName':'int_freshdesk_accounts','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 f32ae8b..c065a04 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 _0xf729=['lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','FreshdeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','GetFreshdeskAccount','ShowFreshdeskAccount','find'];(function(_0x32cd29,_0x29f6bb){var _0x2f7e6e=function(_0x20a924){while(--_0x20a924){_0x32cd29['push'](_0x32cd29['shift']());}};_0x2f7e6e(++_0x29f6bb);}(_0xf729,0x128));var _0x9f72=function(_0x819bcc,_0x11d8b2){_0x819bcc=_0x819bcc-0x0;var _0x55fc0e=_0xf729[_0x819bcc];return _0x55fc0e;};'use strict';var _=require(_0x9f72('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9f72('0x1'));var rs=require(_0x9f72('0x2'));var fs=require('fs');var Redis=require(_0x9f72('0x3'));var db=require(_0x9f72('0x4'))['db'];var utils=require(_0x9f72('0x5'));var logger=require(_0x9f72('0x6'))(_0x9f72('0x7'));var config=require('../../config/environment');var jayson=require(_0x9f72('0x8'));var client=jayson[_0x9f72('0x9')][_0x9f72('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x425976,_0x2302cc,_0x364822){return new BPromise(function(_0x2b76fb,_0x1f36e9){return client[_0x9f72('0xb')](_0x425976,_0x364822)['then'](function(_0x19036){logger[_0x9f72('0xc')](_0x9f72('0xd'),_0x2302cc,_0x9f72('0xe'));logger[_0x9f72('0xf')](_0x9f72('0x10'),_0x2302cc,_0x9f72('0xe'),JSON[_0x9f72('0x11')](_0x19036));if(_0x19036[_0x9f72('0x12')]){if(_0x19036[_0x9f72('0x12')][_0x9f72('0x13')]===0x1f4){logger[_0x9f72('0x12')](_0x9f72('0xd'),_0x2302cc,_0x19036[_0x9f72('0x12')]['message']);return _0x1f36e9(_0x19036['error']['message']);}logger[_0x9f72('0x12')](_0x9f72('0xd'),_0x2302cc,_0x19036[_0x9f72('0x12')][_0x9f72('0x14')]);return _0x2b76fb(_0x19036[_0x9f72('0x12')][_0x9f72('0x14')]);}else{logger[_0x9f72('0xc')]('FreshdeskAccount,\x20%s,\x20%s',_0x2302cc,'request\x20sent');_0x2b76fb(_0x19036[_0x9f72('0x15')]['message']);}})[_0x9f72('0x16')](function(_0x1237a4){logger[_0x9f72('0x12')](_0x9f72('0xd'),_0x2302cc,_0x1237a4);_0x1f36e9(_0x1237a4);});});}exports['GetFreshdeskAccount']=function(_0x331daa){var _0x28adbf=this;return new Promise(function(_0x5ead38,_0x4802f1){return db[_0x9f72('0x17')][_0x9f72('0x18')]({'raw':_0x331daa[_0x9f72('0x19')]?_0x331daa[_0x9f72('0x19')][_0x9f72('0x1a')]===undefined?!![]:![]:!![],'where':_0x331daa['options']?_0x331daa[_0x9f72('0x19')][_0x9f72('0x1b')]||null:null,'attributes':_0x331daa[_0x9f72('0x19')]?_0x331daa[_0x9f72('0x19')][_0x9f72('0x1c')]||null:null,'limit':_0x331daa[_0x9f72('0x19')]?_0x331daa[_0x9f72('0x19')][_0x9f72('0x1d')]||null:null,'include':_0x331daa[_0x9f72('0x19')]?_0x331daa[_0x9f72('0x19')][_0x9f72('0x1e')]?_[_0x9f72('0x1f')](_0x331daa['options'][_0x9f72('0x1e')],function(_0x1cd8fc){return{'model':db[_0x1cd8fc[_0x9f72('0x20')]],'as':_0x1cd8fc['as'],'attributes':_0x1cd8fc[_0x9f72('0x1c')],'include':_0x1cd8fc[_0x9f72('0x1e')]?_[_0x9f72('0x1f')](_0x1cd8fc[_0x9f72('0x1e')],function(_0x3adab0){return{'model':db[_0x3adab0['model']],'as':_0x3adab0['as'],'attributes':_0x3adab0['attributes'],'include':_0x3adab0[_0x9f72('0x1e')]?_[_0x9f72('0x1f')](_0x3adab0[_0x9f72('0x1e')],function(_0x190b0e){return{'model':db[_0x190b0e[_0x9f72('0x20')]],'as':_0x190b0e['as'],'attributes':_0x190b0e['attributes']};}):[]};}):[]};}):[]:[]})[_0x9f72('0x21')](function(_0x394bf6){logger['info'](_0x9f72('0x22'),_0x331daa);logger['debug'](_0x9f72('0x22'),_0x331daa,JSON['stringify'](_0x394bf6));_0x5ead38(_0x394bf6);})[_0x9f72('0x16')](function(_0x152b7e){logger[_0x9f72('0x12')]('GetFreshdeskAccount',_0x152b7e[_0x9f72('0x14')],_0x331daa);_0x4802f1(_0x28adbf['error'](0x1f4,_0x152b7e[_0x9f72('0x14')]));});});};exports[_0x9f72('0x23')]=function(_0x22d52b){var _0x2131a7=this;return new Promise(function(_0xe4102a,_0x23559){return db[_0x9f72('0x17')][_0x9f72('0x24')]({'raw':_0x22d52b['options']?_0x22d52b[_0x9f72('0x19')][_0x9f72('0x1a')]===undefined?!![]:![]:!![],'where':_0x22d52b[_0x9f72('0x19')]?_0x22d52b[_0x9f72('0x19')][_0x9f72('0x1b')]||null:null,'attributes':_0x22d52b[_0x9f72('0x19')]?_0x22d52b[_0x9f72('0x19')][_0x9f72('0x1c')]||null:null,'include':_0x22d52b[_0x9f72('0x19')]?_0x22d52b['options']['include']?_['map'](_0x22d52b[_0x9f72('0x19')]['include'],function(_0x567d4a){return{'model':db[_0x567d4a['model']],'as':_0x567d4a['as'],'attributes':_0x567d4a['attributes'],'include':_0x567d4a[_0x9f72('0x1e')]?_[_0x9f72('0x1f')](_0x567d4a[_0x9f72('0x1e')],function(_0x43706f){return{'model':db[_0x43706f['model']],'as':_0x43706f['as'],'attributes':_0x43706f['attributes'],'include':_0x43706f[_0x9f72('0x1e')]?_['map'](_0x43706f[_0x9f72('0x1e')],function(_0x1de743){return{'model':db[_0x1de743[_0x9f72('0x20')]],'as':_0x1de743['as'],'attributes':_0x1de743[_0x9f72('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x35bd17){logger[_0x9f72('0xc')]('ShowFreshdeskAccount',_0x22d52b);logger['debug'](_0x9f72('0x23'),_0x22d52b,JSON[_0x9f72('0x11')](_0x35bd17));_0xe4102a(_0x35bd17);})[_0x9f72('0x16')](function(_0x29f18c){logger['error'](_0x9f72('0x23'),_0x29f18c[_0x9f72('0x14')],_0x22d52b);_0x23559(_0x2131a7['error'](0x1f4,_0x29f18c[_0x9f72('0x14')]));});});}; \ No newline at end of file +var _0x83cc=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','FreshdeskAccount,\x20%s,\x20%s','GetFreshdeskAccount','FreshdeskAccount','options','raw','attributes','limit','include','map','model','debug','catch','ShowFreshdeskAccount','find','where'];(function(_0x1b08ab,_0x1c7388){var _0x507ea8=function(_0x20b2d1){while(--_0x20b2d1){_0x1b08ab['push'](_0x1b08ab['shift']());}};_0x507ea8(++_0x1c7388);}(_0x83cc,0x1c7));var _0xc83c=function(_0x2f1a6e,_0x3082cb){_0x2f1a6e=_0x2f1a6e-0x0;var _0x5865e5=_0x83cc[_0x2f1a6e];return _0x5865e5;};'use strict';var _=require(_0xc83c('0x0'));var util=require(_0xc83c('0x1'));var moment=require(_0xc83c('0x2'));var BPromise=require(_0xc83c('0x3'));var rs=require(_0xc83c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc83c('0x5'))['db'];var utils=require(_0xc83c('0x6'));var logger=require(_0xc83c('0x7'))(_0xc83c('0x8'));var config=require('../../config/environment');var jayson=require(_0xc83c('0x9'));var client=jayson[_0xc83c('0xa')][_0xc83c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c479b,_0x27a3c5,_0x114525){return new BPromise(function(_0x29b462,_0x230f28){return client[_0xc83c('0xc')](_0x4c479b,_0x114525)[_0xc83c('0xd')](function(_0x321f29){logger[_0xc83c('0xe')]('FreshdeskAccount,\x20%s,\x20%s',_0x27a3c5,_0xc83c('0xf'));logger['debug'](_0xc83c('0x10'),_0x27a3c5,_0xc83c('0xf'),JSON[_0xc83c('0x11')](_0x321f29));if(_0x321f29['error']){if(_0x321f29['error']['code']===0x1f4){logger[_0xc83c('0x12')]('FreshdeskAccount,\x20%s,\x20%s',_0x27a3c5,_0x321f29['error'][_0xc83c('0x13')]);return _0x230f28(_0x321f29[_0xc83c('0x12')][_0xc83c('0x13')]);}logger[_0xc83c('0x12')](_0xc83c('0x14'),_0x27a3c5,_0x321f29['error']['message']);return _0x29b462(_0x321f29[_0xc83c('0x12')]['message']);}else{logger[_0xc83c('0xe')]('FreshdeskAccount,\x20%s,\x20%s',_0x27a3c5,_0xc83c('0xf'));_0x29b462(_0x321f29['result'][_0xc83c('0x13')]);}})['catch'](function(_0x4b03f8){logger['error'](_0xc83c('0x14'),_0x27a3c5,_0x4b03f8);_0x230f28(_0x4b03f8);});});}exports[_0xc83c('0x15')]=function(_0x8e4d28){var _0x16b104=this;return new Promise(function(_0x152d87,_0x2d99ca){return db[_0xc83c('0x16')]['findAll']({'raw':_0x8e4d28[_0xc83c('0x17')]?_0x8e4d28[_0xc83c('0x17')][_0xc83c('0x18')]===undefined?!![]:![]:!![],'where':_0x8e4d28[_0xc83c('0x17')]?_0x8e4d28[_0xc83c('0x17')]['where']||null:null,'attributes':_0x8e4d28[_0xc83c('0x17')]?_0x8e4d28['options'][_0xc83c('0x19')]||null:null,'limit':_0x8e4d28['options']?_0x8e4d28[_0xc83c('0x17')][_0xc83c('0x1a')]||null:null,'include':_0x8e4d28[_0xc83c('0x17')]?_0x8e4d28[_0xc83c('0x17')][_0xc83c('0x1b')]?_[_0xc83c('0x1c')](_0x8e4d28[_0xc83c('0x17')]['include'],function(_0x1dbe43){return{'model':db[_0x1dbe43[_0xc83c('0x1d')]],'as':_0x1dbe43['as'],'attributes':_0x1dbe43[_0xc83c('0x19')],'include':_0x1dbe43[_0xc83c('0x1b')]?_[_0xc83c('0x1c')](_0x1dbe43[_0xc83c('0x1b')],function(_0x4b986b){return{'model':db[_0x4b986b[_0xc83c('0x1d')]],'as':_0x4b986b['as'],'attributes':_0x4b986b[_0xc83c('0x19')],'include':_0x4b986b[_0xc83c('0x1b')]?_[_0xc83c('0x1c')](_0x4b986b['include'],function(_0x4315d9){return{'model':db[_0x4315d9[_0xc83c('0x1d')]],'as':_0x4315d9['as'],'attributes':_0x4315d9[_0xc83c('0x19')]};}):[]};}):[]};}):[]:[]})[_0xc83c('0xd')](function(_0x106c28){logger['info'](_0xc83c('0x15'),_0x8e4d28);logger[_0xc83c('0x1e')](_0xc83c('0x15'),_0x8e4d28,JSON['stringify'](_0x106c28));_0x152d87(_0x106c28);})[_0xc83c('0x1f')](function(_0x282e2b){logger[_0xc83c('0x12')](_0xc83c('0x15'),_0x282e2b[_0xc83c('0x13')],_0x8e4d28);_0x2d99ca(_0x16b104[_0xc83c('0x12')](0x1f4,_0x282e2b['message']));});});};exports[_0xc83c('0x20')]=function(_0x2991b0){var _0x2dc11e=this;return new Promise(function(_0x151aa3,_0x481e1d){return db[_0xc83c('0x16')][_0xc83c('0x21')]({'raw':_0x2991b0[_0xc83c('0x17')]?_0x2991b0[_0xc83c('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2991b0[_0xc83c('0x17')]?_0x2991b0[_0xc83c('0x17')][_0xc83c('0x22')]||null:null,'attributes':_0x2991b0[_0xc83c('0x17')]?_0x2991b0['options'][_0xc83c('0x19')]||null:null,'include':_0x2991b0[_0xc83c('0x17')]?_0x2991b0[_0xc83c('0x17')][_0xc83c('0x1b')]?_[_0xc83c('0x1c')](_0x2991b0[_0xc83c('0x17')][_0xc83c('0x1b')],function(_0x1d21a0){return{'model':db[_0x1d21a0[_0xc83c('0x1d')]],'as':_0x1d21a0['as'],'attributes':_0x1d21a0[_0xc83c('0x19')],'include':_0x1d21a0[_0xc83c('0x1b')]?_['map'](_0x1d21a0[_0xc83c('0x1b')],function(_0x5dc381){return{'model':db[_0x5dc381[_0xc83c('0x1d')]],'as':_0x5dc381['as'],'attributes':_0x5dc381[_0xc83c('0x19')],'include':_0x5dc381['include']?_[_0xc83c('0x1c')](_0x5dc381[_0xc83c('0x1b')],function(_0x10eafb){return{'model':db[_0x10eafb['model']],'as':_0x10eafb['as'],'attributes':_0x10eafb[_0xc83c('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x50fa6d){logger[_0xc83c('0xe')]('ShowFreshdeskAccount',_0x2991b0);logger['debug'](_0xc83c('0x20'),_0x2991b0,JSON[_0xc83c('0x11')](_0x50fa6d));_0x151aa3(_0x50fa6d);})['catch'](function(_0x457edf){logger['error'](_0xc83c('0x20'),_0x457edf[_0xc83c('0x13')],_0x2991b0);_0x481e1d(_0x2dc11e[_0xc83c('0x12')](0x1f4,_0x457edf['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index ae177f1..4568830 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 _0x277c=['exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','index','/:id','show','get','isAuthenticated','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','create','post','setTags','put','delete'];(function(_0x2ba00c,_0x182642){var _0x21712b=function(_0x1bcf8e){while(--_0x1bcf8e){_0x2ba00c['push'](_0x2ba00c['shift']());}};_0x21712b(++_0x182642);}(_0x277c,0x153));var _0xc277=function(_0x37fbe1,_0x382c76){_0x37fbe1=_0x37fbe1-0x0;var _0x50d599=_0x277c[_0x37fbe1];return _0x50d599;};'use strict';var multer=require(_0xc277('0x0'));var util=require('util');var path=require(_0xc277('0x1'));var timeout=require(_0xc277('0x2'));var express=require(_0xc277('0x3'));var router=express[_0xc277('0x4')]();var auth=require(_0xc277('0x5'));var interaction=require(_0xc277('0x6'));var config=require(_0xc277('0x7'));var controller=require(_0xc277('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xc277('0x9')]);router['get'](_0xc277('0xa'),auth['isAuthenticated'](),controller[_0xc277('0xb')]);router[_0xc277('0xc')]('/:id/fields',auth[_0xc277('0xd')](),controller[_0xc277('0xe')]);router[_0xc277('0xc')](_0xc277('0xf'),auth[_0xc277('0xd')](),controller[_0xc277('0x10')]);router['get']('/:id/descriptions',auth[_0xc277('0xd')](),controller[_0xc277('0x11')]);router[_0xc277('0xc')](_0xc277('0x12'),auth['isAuthenticated'](),controller[_0xc277('0x13')]);router['post']('/',auth[_0xc277('0xd')](),controller[_0xc277('0x14')]);router[_0xc277('0x15')](_0xc277('0x12'),auth['isAuthenticated'](),controller[_0xc277('0x16')]);router[_0xc277('0x17')](_0xc277('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xc277('0x18')]('/:id',auth[_0xc277('0xd')](),controller['destroy']);module[_0xc277('0x19')]=router; \ No newline at end of file +var _0x84ab=['isAuthenticated','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','create','post','setTags','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./intFreshdeskConfiguration.controller','get'];(function(_0x6c674c,_0x2fffbc){var _0x2a9144=function(_0x1df88f){while(--_0x1df88f){_0x6c674c['push'](_0x6c674c['shift']());}};_0x2a9144(++_0x2fffbc);}(_0x84ab,0x12f));var _0xb84a=function(_0x59f0dc,_0x1e2497){_0x59f0dc=_0x59f0dc-0x0;var _0x5b5445=_0x84ab[_0x59f0dc];return _0x5b5445;};'use strict';var multer=require(_0xb84a('0x0'));var util=require(_0xb84a('0x1'));var path=require(_0xb84a('0x2'));var timeout=require(_0xb84a('0x3'));var express=require(_0xb84a('0x4'));var router=express['Router']();var auth=require(_0xb84a('0x5'));var interaction=require(_0xb84a('0x6'));var config=require('../../config/environment');var controller=require(_0xb84a('0x7'));router[_0xb84a('0x8')]('/',auth[_0xb84a('0x9')](),controller['index']);router['get']('/:id',auth[_0xb84a('0x9')](),controller['show']);router[_0xb84a('0x8')](_0xb84a('0xa'),auth['isAuthenticated'](),controller[_0xb84a('0xb')]);router['get'](_0xb84a('0xc'),auth[_0xb84a('0x9')](),controller[_0xb84a('0xd')]);router['get']('/:id/descriptions',auth['isAuthenticated'](),controller[_0xb84a('0xe')]);router[_0xb84a('0x8')](_0xb84a('0xf'),auth[_0xb84a('0x9')](),controller[_0xb84a('0x10')]);router['post']('/',auth[_0xb84a('0x9')](),controller[_0xb84a('0x11')]);router[_0xb84a('0x12')](_0xb84a('0xf'),auth[_0xb84a('0x9')](),controller[_0xb84a('0x13')]);router[_0xb84a('0x14')](_0xb84a('0x15'),auth[_0xb84a('0x9')](),controller[_0xb84a('0x16')]);router[_0xb84a('0x17')](_0xb84a('0x15'),auth['isAuthenticated'](),controller[_0xb84a('0x18')]);module[_0xb84a('0x19')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 779db55..b230d29 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 _0x03db=['STRING','sequelize','exports'];(function(_0x531e48,_0x4bb96b){var _0x202971=function(_0x403bf5){while(--_0x403bf5){_0x531e48['push'](_0x531e48['shift']());}};_0x202971(++_0x4bb96b);}(_0x03db,0x1b4));var _0xb03d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x03db[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb03d('0x0'));module[_0xb03d('0x1')]={'name':{'type':Sequelize[_0xb03d('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x98f2=['sequelize','STRING'];(function(_0x108767,_0x966a6c){var _0x117904=function(_0x22dae5){while(--_0x22dae5){_0x108767['push'](_0x108767['shift']());}};_0x117904(++_0x966a6c);}(_0x98f2,0x84));var _0x298f=function(_0x3ab215,_0x39679d){_0x3ab215=_0x3ab215-0x0;var _0x43bd50=_0x98f2[_0x3ab215];return _0x43bd50;};'use strict';var Sequelize=require(_0x298f('0x0'));module['exports']={'name':{'type':Sequelize[_0x298f('0x1')]},'description':{'type':Sequelize[_0x298f('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index d16f3e0..e158891 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(_0xa5a06e,_0x2b783b){var _0x28f4e3=function(_0x1c8e71){while(--_0x1c8e71){_0xa5a06e['push'](_0xa5a06e['shift']());}};_0x28f4e3(++_0x2b783b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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(_0x206018,_0x2d26e3){var _0x1429c8=function(_0x502fe9){while(--_0x502fe9){_0x206018['push'](_0x206018['shift']());}};_0x1429c8(++_0x2d26e3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var 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 240958a..b90b37a 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 _0x787d=['moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','util','../../config/logger','api'];(function(_0x2663d6,_0x2fbdee){var _0x2f6d7e=function(_0x4114f0){while(--_0x4114f0){_0x2663d6['push'](_0x2663d6['shift']());}};_0x2f6d7e(++_0x2fbdee);}(_0x787d,0x101));var _0xd787=function(_0xa28b1a,_0x384f4b){_0xa28b1a=_0xa28b1a-0x0;var _0x4c9b78=_0x787d[_0xa28b1a];return _0x4c9b78;};'use strict';var _=require('lodash');var util=require(_0xd787('0x0'));var logger=require(_0xd787('0x1'))(_0xd787('0x2'));var moment=require(_0xd787('0x3'));var BPromise=require(_0xd787('0x4'));var rp=require(_0xd787('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd787('0x6'));var config=require(_0xd787('0x7'));var attributes=require(_0xd787('0x8'));module[_0xd787('0x9')]=function(_0x58657d,_0xb100bd){return _0x58657d[_0xd787('0xa')](_0xd787('0xb'),attributes,{'tableName':_0xd787('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd3b9=['bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x5adb49,_0x58dfb9){var _0xd3f801=function(_0x5d7614){while(--_0x5d7614){_0x5adb49['push'](_0x5adb49['shift']());}};_0xd3f801(++_0x58dfb9);}(_0xd3b9,0x183));var _0x9d3b=function(_0x371668,_0xa20e06){_0x371668=_0x371668-0x0;var _0x12b17a=_0xd3b9[_0x371668];return _0x12b17a;};'use strict';var _=require(_0x9d3b('0x0'));var util=require(_0x9d3b('0x1'));var logger=require(_0x9d3b('0x2'))(_0x9d3b('0x3'));var moment=require(_0x9d3b('0x4'));var BPromise=require(_0x9d3b('0x5'));var rp=require(_0x9d3b('0x6'));var fs=require('fs');var path=require(_0x9d3b('0x7'));var rimraf=require(_0x9d3b('0x8'));var config=require(_0x9d3b('0x9'));var attributes=require(_0x9d3b('0xa'));module[_0x9d3b('0xb')]=function(_0x29b98a,_0x26e7a1){return _0x29b98a['define'](_0x9d3b('0xc'),attributes,{'tableName':_0x9d3b('0xd'),'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 1aa7ac8..e285e0c 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 _0xae32=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FreshdeskConfiguration,\x20%s,\x20%s','result','catch','lodash'];(function(_0x41add4,_0x4557dc){var _0x51bcbe=function(_0x5a0fec){while(--_0x5a0fec){_0x41add4['push'](_0x41add4['shift']());}};_0x51bcbe(++_0x4557dc);}(_0xae32,0x167));var _0x2ae3=function(_0x19ff0e,_0x4e7b09){_0x19ff0e=_0x19ff0e-0x0;var _0x5d2083=_0xae32[_0x19ff0e];return _0x5d2083;};'use strict';var _=require(_0x2ae3('0x0'));var util=require('util');var moment=require(_0x2ae3('0x1'));var BPromise=require(_0x2ae3('0x2'));var rs=require(_0x2ae3('0x3'));var fs=require('fs');var Redis=require(_0x2ae3('0x4'));var db=require(_0x2ae3('0x5'))['db'];var utils=require(_0x2ae3('0x6'));var logger=require(_0x2ae3('0x7'))('rpc');var config=require(_0x2ae3('0x8'));var jayson=require(_0x2ae3('0x9'));var client=jayson[_0x2ae3('0xa')][_0x2ae3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x31b2ab,_0x40458e,_0x4928ab){return new BPromise(function(_0x2841be,_0x53cb89){return client[_0x2ae3('0xc')](_0x31b2ab,_0x4928ab)['then'](function(_0x149367){logger[_0x2ae3('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x40458e,_0x2ae3('0xe'));logger[_0x2ae3('0xf')](_0x2ae3('0x10'),_0x40458e,_0x2ae3('0xe'),JSON[_0x2ae3('0x11')](_0x149367));if(_0x149367[_0x2ae3('0x12')]){if(_0x149367['error'][_0x2ae3('0x13')]===0x1f4){logger[_0x2ae3('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x40458e,_0x149367['error'][_0x2ae3('0x14')]);return _0x53cb89(_0x149367['error']['message']);}logger[_0x2ae3('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x40458e,_0x149367[_0x2ae3('0x12')]['message']);return _0x2841be(_0x149367[_0x2ae3('0x12')]['message']);}else{logger[_0x2ae3('0xd')](_0x2ae3('0x15'),_0x40458e,_0x2ae3('0xe'));_0x2841be(_0x149367[_0x2ae3('0x16')]['message']);}})[_0x2ae3('0x17')](function(_0x36d74e){logger['error'](_0x2ae3('0x15'),_0x40458e,_0x36d74e);_0x53cb89(_0x36d74e);});});} \ No newline at end of file +var _0xd1a5=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment'];(function(_0xd3a60b,_0x7d9728){var _0x15321f=function(_0x2fc097){while(--_0x2fc097){_0xd3a60b['push'](_0xd3a60b['shift']());}};_0x15321f(++_0x7d9728);}(_0xd1a5,0x7b));var _0x5d1a=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xd1a5[_0x4d613c];return _0x301fe3;};'use strict';var _=require(_0x5d1a('0x0'));var util=require(_0x5d1a('0x1'));var moment=require(_0x5d1a('0x2'));var BPromise=require(_0x5d1a('0x3'));var rs=require(_0x5d1a('0x4'));var fs=require('fs');var Redis=require(_0x5d1a('0x5'));var db=require(_0x5d1a('0x6'))['db'];var utils=require(_0x5d1a('0x7'));var logger=require(_0x5d1a('0x8'))(_0x5d1a('0x9'));var config=require(_0x5d1a('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5d1a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x22ab05,_0x47e48c,_0x182e86){return new BPromise(function(_0x318459,_0x1705de){return client['request'](_0x22ab05,_0x182e86)['then'](function(_0x18f818){logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x47e48c,_0x5d1a('0xc'));logger['debug'](_0x5d1a('0xd'),_0x47e48c,'request\x20sent',JSON['stringify'](_0x18f818));if(_0x18f818[_0x5d1a('0xe')]){if(_0x18f818[_0x5d1a('0xe')][_0x5d1a('0xf')]===0x1f4){logger[_0x5d1a('0xe')](_0x5d1a('0x10'),_0x47e48c,_0x18f818[_0x5d1a('0xe')]['message']);return _0x1705de(_0x18f818[_0x5d1a('0xe')][_0x5d1a('0x11')]);}logger[_0x5d1a('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x47e48c,_0x18f818['error'][_0x5d1a('0x11')]);return _0x318459(_0x18f818[_0x5d1a('0xe')][_0x5d1a('0x11')]);}else{logger[_0x5d1a('0x12')](_0x5d1a('0x10'),_0x47e48c,_0x5d1a('0xc'));_0x318459(_0x18f818[_0x5d1a('0x13')][_0x5d1a('0x11')]);}})[_0x5d1a('0x14')](function(_0x40590d){logger[_0x5d1a('0xe')](_0x5d1a('0x10'),_0x47e48c,_0x40590d);_0x1705de(_0x40590d);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 4a05c88..7753827 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 _0x65ef=['../../config/environment','get','isAuthenticated','index','/:id','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x2e3e4e,_0x54da2d){var _0x299e47=function(_0x3f8616){while(--_0x3f8616){_0x2e3e4e['push'](_0x2e3e4e['shift']());}};_0x299e47(++_0x54da2d);}(_0x65ef,0x7d));var _0xf65e=function(_0x3f5726,_0x4b8ac0){_0x3f5726=_0x3f5726-0x0;var _0x39add3=_0x65ef[_0x3f5726];return _0x39add3;};'use strict';var multer=require(_0xf65e('0x0'));var util=require(_0xf65e('0x1'));var path=require(_0xf65e('0x2'));var timeout=require(_0xf65e('0x3'));var express=require(_0xf65e('0x4'));var router=express[_0xf65e('0x5')]();var auth=require(_0xf65e('0x6'));var interaction=require(_0xf65e('0x7'));var config=require(_0xf65e('0x8'));var controller=require('./intFreshdeskField.controller');router[_0xf65e('0x9')]('/',auth[_0xf65e('0xa')](),controller[_0xf65e('0xb')]);router[_0xf65e('0x9')](_0xf65e('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xf65e('0xd')]('/',auth[_0xf65e('0xa')](),controller['create']);router[_0xf65e('0xe')](_0xf65e('0xc'),auth[_0xf65e('0xa')](),controller[_0xf65e('0xf')]);router[_0xf65e('0x10')](_0xf65e('0xc'),auth['isAuthenticated'](),controller[_0xf65e('0x11')]);module[_0xf65e('0x12')]=router; \ No newline at end of file +var _0x4c37=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','post','create'];(function(_0x3439b4,_0x3c235c){var _0x38d9f8=function(_0x4a3a54){while(--_0x4a3a54){_0x3439b4['push'](_0x3439b4['shift']());}};_0x38d9f8(++_0x3c235c);}(_0x4c37,0x8a));var _0x74c3=function(_0x439f12,_0xfedd86){_0x439f12=_0x439f12-0x0;var _0x126c33=_0x4c37[_0x439f12];return _0x126c33;};'use strict';var multer=require(_0x74c3('0x0'));var util=require(_0x74c3('0x1'));var path=require(_0x74c3('0x2'));var timeout=require(_0x74c3('0x3'));var express=require(_0x74c3('0x4'));var router=express[_0x74c3('0x5')]();var auth=require(_0x74c3('0x6'));var interaction=require(_0x74c3('0x7'));var config=require(_0x74c3('0x8'));var controller=require('./intFreshdeskField.controller');router[_0x74c3('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x74c3('0x9')](_0x74c3('0xa'),auth[_0x74c3('0xb')](),controller['show']);router[_0x74c3('0xc')]('/',auth[_0x74c3('0xb')](),controller[_0x74c3('0xd')]);router[_0x74c3('0xe')](_0x74c3('0xa'),auth['isAuthenticated'](),controller[_0x74c3('0xf')]);router[_0x74c3('0x10')](_0x74c3('0xa'),auth['isAuthenticated'](),controller[_0x74c3('0x11')]);module[_0x74c3('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 73d4570..aac2921 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 _0x6e6c=['variable','STRING','BOOLEAN','sequelize','exports','string'];(function(_0x1b03f9,_0x5c6bf4){var _0x2a0720=function(_0x44b69d){while(--_0x44b69d){_0x1b03f9['push'](_0x1b03f9['shift']());}};_0x2a0720(++_0x5c6bf4);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6e6c[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xc6e6('0x0'));module[_0xc6e6('0x1')]={'type':{'type':Sequelize['ENUM'](_0xc6e6('0x2'),_0xc6e6('0x3'),'customVariable','keyValue'),'defaultValue':_0xc6e6('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xc6e6('0x4')]},'keyType':{'type':Sequelize['ENUM'](_0xc6e6('0x2'),_0xc6e6('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xc6e6('0x4')]},'idField':{'type':Sequelize[_0xc6e6('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xc6e6('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc6e6('0x4')]}}; \ No newline at end of file +var _0x22fb=['string','STRING','BOOLEAN','ENUM','variable','customVariable','keyValue'];(function(_0x22087f,_0x3c8ed3){var _0x27f2e9=function(_0x5eaea3){while(--_0x5eaea3){_0x22087f['push'](_0x22087f['shift']());}};_0x27f2e9(++_0x3c8ed3);}(_0x22fb,0x192));var _0xb22f=function(_0x240d8d,_0x49abdf){_0x240d8d=_0x240d8d-0x0;var _0x492cb3=_0x22fb[_0x240d8d];return _0x492cb3;};'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 diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index dddc4a5..8bc0058 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 _0xe41f=['Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','FreshdeskField','rawAttributes','keys','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','key','VIRTUAL','includeAll','include','rows','catch','params','options','find','create','body','html-pdf','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','limit','set'];(function(_0x48affa,_0x52ed60){var _0x4ee41d=function(_0x5d4b26){while(--_0x5d4b26){_0x48affa['push'](_0x48affa['shift']());}};_0x4ee41d(++_0x52ed60);}(_0xe41f,0x13e));var _0xfe41=function(_0xb60a4d,_0x1e2af3){_0xb60a4d=_0xb60a4d-0x0;var _0x5acf78=_0xe41f[_0xb60a4d];return _0x5acf78;};'use strict';var pdf=require(_0xfe41('0x0'));var emlformat=require(_0xfe41('0x1'));var rimraf=require(_0xfe41('0x2'));var zipdir=require(_0xfe41('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfe41('0x4'));var Mustache=require(_0xfe41('0x5'));var util=require(_0xfe41('0x6'));var path=require(_0xfe41('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfe41('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xfe41('0x9'));var crypto=require(_0xfe41('0xa'));var jsforce=require(_0xfe41('0xb'));var deskjs=require(_0xfe41('0xc'));var toCsv=require(_0xfe41('0xd'));var querystring=require(_0xfe41('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xfe41('0xf'));var logger=require(_0xfe41('0x10'))(_0xfe41('0x11'));var utils=require('../../config/utils');var config=require(_0xfe41('0x12'));var db=require(_0xfe41('0x13'))['db'];function respondWithStatusCode(_0x309304,_0x57c097){_0x57c097=_0x57c097||0xcc;return function(_0x19ed0e){if(_0x19ed0e){return _0x309304[_0xfe41('0x14')](_0x57c097);}return _0x309304['status'](_0x57c097)[_0xfe41('0x15')]();};}function respondWithResult(_0x426804,_0x421eb7){_0x421eb7=_0x421eb7||0xc8;return function(_0x2fd465){if(_0x2fd465){return _0x426804[_0xfe41('0x16')](_0x421eb7)['json'](_0x2fd465);}};}function respondWithFilteredResult(_0x42b60d,_0x384749){return function(_0x1de7f0){if(_0x1de7f0){var _0x539962=_0x1de7f0[_0xfe41('0x17')],_0x597522=_0x384749[_0xfe41('0x18')],_0x364979=_0x384749['offset']+_0x384749[_0xfe41('0x19')],_0xca164f;if(_0x364979>=_0x539962){_0x364979=_0x539962;_0xca164f=0xc8;}else{_0xca164f=0xce;}_0x42b60d[_0xfe41('0x16')](_0xca164f);return _0x42b60d[_0xfe41('0x1a')](_0xfe41('0x1b'),_0x597522+'-'+_0x364979+'/'+_0x539962)[_0xfe41('0x1c')](_0x1de7f0);}return null;};}function patchUpdates(_0x1fee43){return function(_0x3d3dc3){try{jsonpatch[_0xfe41('0x1d')](_0x3d3dc3,_0x1fee43,!![]);}catch(_0xdce570){return BPromise[_0xfe41('0x1e')](_0xdce570);}return _0x3d3dc3[_0xfe41('0x1f')]();};}function saveUpdates(_0x2157e0,_0x3cf01e){return function(_0x4d5538){if(_0x4d5538){return _0x4d5538[_0xfe41('0x20')](_0x2157e0)[_0xfe41('0x21')](function(_0x1c532c){return _0x1c532c;});}return null;};}function removeEntity(_0x2ca1d4,_0x916a2){return function(_0x4186d9){if(_0x4186d9){return _0x4186d9[_0xfe41('0x22')]()[_0xfe41('0x21')](function(){_0x2ca1d4[_0xfe41('0x16')](0xcc)[_0xfe41('0x15')]();});}};}function handleEntityNotFound(_0x672d7e,_0x21f42a){return function(_0x5afe19){if(!_0x5afe19){_0x672d7e[_0xfe41('0x14')](0x194);}return _0x5afe19;};}function handleError(_0x30f703,_0x344bea){_0x344bea=_0x344bea||0x1f4;return function(_0x450e0a){logger[_0xfe41('0x23')](_0x450e0a['stack']);if(_0x450e0a[_0xfe41('0x24')]){delete _0x450e0a[_0xfe41('0x24')];}_0x30f703[_0xfe41('0x16')](_0x344bea)[_0xfe41('0x25')](_0x450e0a);};}exports[_0xfe41('0x26')]=function(_0x5c72d8,_0x10e5ed){var _0x2a3dcc={},_0x167151={},_0x422d80={'count':0x0,'rows':[]};var _0x44d7a3=db[_0xfe41('0x27')][_0xfe41('0x28')];_0x167151['model']=_[_0xfe41('0x29')](_0x44d7a3);_0x167151[_0xfe41('0x2a')]=_['keys'](_0x5c72d8[_0xfe41('0x2a')]);_0x167151['filters']=_[_0xfe41('0x2b')](_0x167151['model'],_0x167151[_0xfe41('0x2a')]);_0x2a3dcc[_0xfe41('0x2c')]=_[_0xfe41('0x2b')](_0x167151[_0xfe41('0x2d')],qs[_0xfe41('0x2e')](_0x5c72d8[_0xfe41('0x2a')]['fields']));_0x2a3dcc[_0xfe41('0x2c')]=_0x2a3dcc[_0xfe41('0x2c')][_0xfe41('0x2f')]?_0x2a3dcc['attributes']:_0x167151[_0xfe41('0x2d')];if(!_0x5c72d8['query'][_0xfe41('0x30')](_0xfe41('0x31'))){_0x2a3dcc[_0xfe41('0x19')]=qs[_0xfe41('0x19')](_0x5c72d8[_0xfe41('0x2a')][_0xfe41('0x19')]);_0x2a3dcc[_0xfe41('0x18')]=qs[_0xfe41('0x18')](_0x5c72d8['query'][_0xfe41('0x18')]);}_0x2a3dcc[_0xfe41('0x32')]=qs[_0xfe41('0x33')](_0x5c72d8['query'][_0xfe41('0x33')]);_0x2a3dcc[_0xfe41('0x34')]=qs[_0xfe41('0x35')](_[_0xfe41('0x36')](_0x5c72d8[_0xfe41('0x2a')],_0x167151[_0xfe41('0x35')]));if(_0x5c72d8[_0xfe41('0x2a')][_0xfe41('0x37')]){_0x2a3dcc[_0xfe41('0x34')]=_[_0xfe41('0x38')](_0x2a3dcc[_0xfe41('0x34')],{'$or':_['map'](_0x44d7a3,function(_0x422b4c){if(_0x422b4c[_0xfe41('0x39')][_0xfe41('0x3a')]!==_0xfe41('0x3b')){var _0x14afc6={};_0x14afc6[_0x422b4c['field']]={'$like':'%'+_0x5c72d8[_0xfe41('0x2a')]['filter']+'%'};return _0x14afc6;}})});}_0x2a3dcc=_[_0xfe41('0x38')]({},_0x2a3dcc,_0x5c72d8['options']);var _0x1b6566={'where':_0x2a3dcc[_0xfe41('0x34')]};return db[_0xfe41('0x27')][_0xfe41('0x17')](_0x1b6566)[_0xfe41('0x21')](function(_0x2dcf02){_0x422d80['count']=_0x2dcf02;if(_0x5c72d8[_0xfe41('0x2a')][_0xfe41('0x3c')]){_0x2a3dcc[_0xfe41('0x3d')]=[{'all':!![]}];}return db['FreshdeskField']['findAll'](_0x2a3dcc);})[_0xfe41('0x21')](function(_0x1301e1){_0x422d80[_0xfe41('0x3e')]=_0x1301e1;return _0x422d80;})[_0xfe41('0x21')](respondWithFilteredResult(_0x10e5ed,_0x2a3dcc))[_0xfe41('0x3f')](handleError(_0x10e5ed,null));};exports['show']=function(_0x2a4441,_0x4fc5e6){var _0x47d0e2={'raw':!![],'where':{'id':_0x2a4441[_0xfe41('0x40')]['id']}},_0x3cb571={};_0x3cb571[_0xfe41('0x2d')]=_[_0xfe41('0x29')](db[_0xfe41('0x27')][_0xfe41('0x28')]);_0x3cb571[_0xfe41('0x2a')]=_[_0xfe41('0x29')](_0x2a4441[_0xfe41('0x2a')]);_0x3cb571[_0xfe41('0x35')]=_[_0xfe41('0x2b')](_0x3cb571[_0xfe41('0x2d')],_0x3cb571[_0xfe41('0x2a')]);_0x47d0e2[_0xfe41('0x2c')]=_[_0xfe41('0x2b')](_0x3cb571['model'],qs[_0xfe41('0x2e')](_0x2a4441[_0xfe41('0x2a')][_0xfe41('0x2e')]));_0x47d0e2[_0xfe41('0x2c')]=_0x47d0e2[_0xfe41('0x2c')][_0xfe41('0x2f')]?_0x47d0e2[_0xfe41('0x2c')]:_0x3cb571[_0xfe41('0x2d')];if(_0x2a4441['query']['includeAll']){_0x47d0e2[_0xfe41('0x3d')]=[{'all':!![]}];}_0x47d0e2=_['merge']({},_0x47d0e2,_0x2a4441[_0xfe41('0x41')]);return db['FreshdeskField'][_0xfe41('0x42')](_0x47d0e2)['then'](handleEntityNotFound(_0x4fc5e6,null))['then'](respondWithResult(_0x4fc5e6,null))[_0xfe41('0x3f')](handleError(_0x4fc5e6,null));};exports['create']=function(_0x221593,_0x436561){return db['FreshdeskField'][_0xfe41('0x43')](_0x221593[_0xfe41('0x44')],{})[_0xfe41('0x21')](respondWithResult(_0x436561,0xc9))[_0xfe41('0x3f')](handleError(_0x436561,null));};exports[_0xfe41('0x20')]=function(_0x46a555,_0x3e7ed4){if(_0x46a555[_0xfe41('0x44')]['id']){delete _0x46a555[_0xfe41('0x44')]['id'];}return db['FreshdeskField'][_0xfe41('0x42')]({'where':{'id':_0x46a555[_0xfe41('0x40')]['id']}})[_0xfe41('0x21')](handleEntityNotFound(_0x3e7ed4,null))[_0xfe41('0x21')](saveUpdates(_0x46a555[_0xfe41('0x44')],null))[_0xfe41('0x21')](respondWithResult(_0x3e7ed4,null))[_0xfe41('0x3f')](handleError(_0x3e7ed4,null));};exports[_0xfe41('0x22')]=function(_0x12bc53,_0x1b68ce){return db[_0xfe41('0x27')][_0xfe41('0x42')]({'where':{'id':_0x12bc53[_0xfe41('0x40')]['id']}})[_0xfe41('0x21')](handleEntityNotFound(_0x1b68ce,null))[_0xfe41('0x21')](removeEntity(_0x1b68ce,null))[_0xfe41('0x3f')](handleError(_0x1b68ce,null));}; \ No newline at end of file +var _0x0cd6=['lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','then','destroy','stack','name','send','index','FreshdeskField','rawAttributes','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','options','include','findAll','rows','catch','show','params','includeAll','find','body','update','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv'];(function(_0x5e4d4d,_0x5a5aa6){var _0x40cbd6=function(_0x53c522){while(--_0x53c522){_0x5e4d4d['push'](_0x5e4d4d['shift']());}};_0x40cbd6(++_0x5a5aa6);}(_0x0cd6,0x113));var _0x60cd=function(_0x1cec84,_0x101ec2){_0x1cec84=_0x1cec84-0x0;var _0x12b7d3=_0x0cd6[_0x1cec84];return _0x12b7d3;};'use strict';var pdf=require(_0x60cd('0x0'));var emlformat=require(_0x60cd('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x60cd('0x2'));var jsonpatch=require(_0x60cd('0x3'));var rp=require('request-promise');var moment=require(_0x60cd('0x4'));var BPromise=require(_0x60cd('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x60cd('0x6'));var sox=require(_0x60cd('0x7'));var csv=require(_0x60cd('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x60cd('0x9'));var squel=require('squel');var crypto=require(_0x60cd('0xa'));var jsforce=require(_0x60cd('0xb'));var deskjs=require(_0x60cd('0xc'));var toCsv=require(_0x60cd('0x8'));var querystring=require(_0x60cd('0xd'));var Papa=require(_0x60cd('0xe'));var Redis=require(_0x60cd('0xf'));var authService=require(_0x60cd('0x10'));var qs=require(_0x60cd('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x60cd('0x12'))(_0x60cd('0x13'));var utils=require('../../config/utils');var config=require(_0x60cd('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x38a0ee,_0x3cd9dd){_0x3cd9dd=_0x3cd9dd||0xcc;return function(_0x526b5b){if(_0x526b5b){return _0x38a0ee[_0x60cd('0x15')](_0x3cd9dd);}return _0x38a0ee[_0x60cd('0x16')](_0x3cd9dd)[_0x60cd('0x17')]();};}function respondWithResult(_0x59810e,_0x14076c){_0x14076c=_0x14076c||0xc8;return function(_0x23db86){if(_0x23db86){return _0x59810e['status'](_0x14076c)[_0x60cd('0x18')](_0x23db86);}};}function respondWithFilteredResult(_0x5492cc,_0x1ce3b8){return function(_0x41cc6b){if(_0x41cc6b){var _0x4b4aad=_0x41cc6b[_0x60cd('0x19')],_0x501940=_0x1ce3b8['offset'],_0x3c4446=_0x1ce3b8[_0x60cd('0x1a')]+_0x1ce3b8[_0x60cd('0x1b')],_0x209dde;if(_0x3c4446>=_0x4b4aad){_0x3c4446=_0x4b4aad;_0x209dde=0xc8;}else{_0x209dde=0xce;}_0x5492cc[_0x60cd('0x16')](_0x209dde);return _0x5492cc[_0x60cd('0x1c')](_0x60cd('0x1d'),_0x501940+'-'+_0x3c4446+'/'+_0x4b4aad)[_0x60cd('0x18')](_0x41cc6b);}return null;};}function patchUpdates(_0x131e08){return function(_0x1e5ed5){try{jsonpatch[_0x60cd('0x1e')](_0x1e5ed5,_0x131e08,!![]);}catch(_0x585ad8){return BPromise[_0x60cd('0x1f')](_0x585ad8);}return _0x1e5ed5['save']();};}function saveUpdates(_0x4e4478,_0x298eeb){return function(_0x3d9434){if(_0x3d9434){return _0x3d9434['update'](_0x4e4478)[_0x60cd('0x20')](function(_0x13e5cc){return _0x13e5cc;});}return null;};}function removeEntity(_0x4984e4,_0x41642b){return function(_0x4b0f8a){if(_0x4b0f8a){return _0x4b0f8a[_0x60cd('0x21')]()[_0x60cd('0x20')](function(){_0x4984e4['status'](0xcc)[_0x60cd('0x17')]();});}};}function handleEntityNotFound(_0x5f2a13,_0x5a9f30){return function(_0x267c8c){if(!_0x267c8c){_0x5f2a13['sendStatus'](0x194);}return _0x267c8c;};}function handleError(_0x204ddb,_0x380a28){_0x380a28=_0x380a28||0x1f4;return function(_0x5f49dc){logger['error'](_0x5f49dc[_0x60cd('0x22')]);if(_0x5f49dc[_0x60cd('0x23')]){delete _0x5f49dc[_0x60cd('0x23')];}_0x204ddb['status'](_0x380a28)[_0x60cd('0x24')](_0x5f49dc);};}exports[_0x60cd('0x25')]=function(_0x2af8f3,_0x11961f){var _0x547932={},_0x31be62={},_0xbe52e0={'count':0x0,'rows':[]};var _0xd8051a=db[_0x60cd('0x26')][_0x60cd('0x27')];_0x31be62[_0x60cd('0x28')]=_['keys'](_0xd8051a);_0x31be62[_0x60cd('0x29')]=_[_0x60cd('0x2a')](_0x2af8f3[_0x60cd('0x29')]);_0x31be62['filters']=_[_0x60cd('0x2b')](_0x31be62['model'],_0x31be62[_0x60cd('0x29')]);_0x547932[_0x60cd('0x2c')]=_['intersection'](_0x31be62['model'],qs[_0x60cd('0x2d')](_0x2af8f3[_0x60cd('0x29')][_0x60cd('0x2d')]));_0x547932['attributes']=_0x547932[_0x60cd('0x2c')][_0x60cd('0x2e')]?_0x547932[_0x60cd('0x2c')]:_0x31be62[_0x60cd('0x28')];if(!_0x2af8f3[_0x60cd('0x29')][_0x60cd('0x2f')](_0x60cd('0x30'))){_0x547932['limit']=qs[_0x60cd('0x1b')](_0x2af8f3[_0x60cd('0x29')][_0x60cd('0x1b')]);_0x547932[_0x60cd('0x1a')]=qs[_0x60cd('0x1a')](_0x2af8f3[_0x60cd('0x29')]['offset']);}_0x547932['order']=qs['sort'](_0x2af8f3[_0x60cd('0x29')][_0x60cd('0x31')]);_0x547932[_0x60cd('0x32')]=qs[_0x60cd('0x33')](_[_0x60cd('0x34')](_0x2af8f3[_0x60cd('0x29')],_0x31be62[_0x60cd('0x33')]));if(_0x2af8f3['query'][_0x60cd('0x35')]){_0x547932[_0x60cd('0x32')]=_[_0x60cd('0x36')](_0x547932[_0x60cd('0x32')],{'$or':_[_0x60cd('0x37')](_0xd8051a,function(_0x1d04f7){if(_0x1d04f7[_0x60cd('0x38')][_0x60cd('0x39')]!==_0x60cd('0x3a')){var _0x5eb29c={};_0x5eb29c[_0x1d04f7[_0x60cd('0x3b')]]={'$like':'%'+_0x2af8f3[_0x60cd('0x29')]['filter']+'%'};return _0x5eb29c;}})});}_0x547932=_['merge']({},_0x547932,_0x2af8f3[_0x60cd('0x3c')]);var _0x190970={'where':_0x547932[_0x60cd('0x32')]};return db[_0x60cd('0x26')][_0x60cd('0x19')](_0x190970)['then'](function(_0x17ad42){_0xbe52e0[_0x60cd('0x19')]=_0x17ad42;if(_0x2af8f3['query']['includeAll']){_0x547932[_0x60cd('0x3d')]=[{'all':!![]}];}return db[_0x60cd('0x26')][_0x60cd('0x3e')](_0x547932);})[_0x60cd('0x20')](function(_0x6703e){_0xbe52e0[_0x60cd('0x3f')]=_0x6703e;return _0xbe52e0;})['then'](respondWithFilteredResult(_0x11961f,_0x547932))[_0x60cd('0x40')](handleError(_0x11961f,null));};exports[_0x60cd('0x41')]=function(_0x225c68,_0xd164d3){var _0x99fdc0={'raw':!![],'where':{'id':_0x225c68[_0x60cd('0x42')]['id']}},_0x44e286={};_0x44e286[_0x60cd('0x28')]=_[_0x60cd('0x2a')](db['FreshdeskField']['rawAttributes']);_0x44e286['query']=_[_0x60cd('0x2a')](_0x225c68[_0x60cd('0x29')]);_0x44e286[_0x60cd('0x33')]=_['intersection'](_0x44e286['model'],_0x44e286['query']);_0x99fdc0['attributes']=_[_0x60cd('0x2b')](_0x44e286[_0x60cd('0x28')],qs['fields'](_0x225c68['query']['fields']));_0x99fdc0[_0x60cd('0x2c')]=_0x99fdc0[_0x60cd('0x2c')][_0x60cd('0x2e')]?_0x99fdc0[_0x60cd('0x2c')]:_0x44e286['model'];if(_0x225c68[_0x60cd('0x29')][_0x60cd('0x43')]){_0x99fdc0['include']=[{'all':!![]}];}_0x99fdc0=_[_0x60cd('0x36')]({},_0x99fdc0,_0x225c68[_0x60cd('0x3c')]);return db[_0x60cd('0x26')][_0x60cd('0x44')](_0x99fdc0)[_0x60cd('0x20')](handleEntityNotFound(_0xd164d3,null))['then'](respondWithResult(_0xd164d3,null))[_0x60cd('0x40')](handleError(_0xd164d3,null));};exports['create']=function(_0x316b83,_0x2dd8ae){return db['FreshdeskField']['create'](_0x316b83[_0x60cd('0x45')],{})[_0x60cd('0x20')](respondWithResult(_0x2dd8ae,0xc9))[_0x60cd('0x40')](handleError(_0x2dd8ae,null));};exports[_0x60cd('0x46')]=function(_0x731d0c,_0x3bf846){if(_0x731d0c[_0x60cd('0x45')]['id']){delete _0x731d0c[_0x60cd('0x45')]['id'];}return db[_0x60cd('0x26')][_0x60cd('0x44')]({'where':{'id':_0x731d0c[_0x60cd('0x42')]['id']}})['then'](handleEntityNotFound(_0x3bf846,null))['then'](saveUpdates(_0x731d0c['body'],null))[_0x60cd('0x20')](respondWithResult(_0x3bf846,null))[_0x60cd('0x40')](handleError(_0x3bf846,null));};exports[_0x60cd('0x21')]=function(_0x36489b,_0x3b0454){return db[_0x60cd('0x26')][_0x60cd('0x44')]({'where':{'id':_0x36489b[_0x60cd('0x42')]['id']}})[_0x60cd('0x20')](handleEntityNotFound(_0x3b0454,null))[_0x60cd('0x20')](removeEntity(_0x3b0454,null))['catch'](handleError(_0x3b0454,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index cbe00ef..6254cfd 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 _0x947e=['freshdesk_unique_index','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields'];(function(_0x618bc2,_0x57686f){var _0x2fbb1e=function(_0x13c21b){while(--_0x13c21b){_0x618bc2['push'](_0x618bc2['shift']());}};_0x2fbb1e(++_0x57686f);}(_0x947e,0xc1));var _0xe947=function(_0x26a68b,_0x4fffa7){_0x26a68b=_0x26a68b-0x0;var _0x5b72ef=_0x947e[_0x26a68b];return _0x5b72ef;};'use strict';var _=require(_0xe947('0x0'));var util=require(_0xe947('0x1'));var logger=require(_0xe947('0x2'))(_0xe947('0x3'));var moment=require(_0xe947('0x4'));var BPromise=require(_0xe947('0x5'));var rp=require(_0xe947('0x6'));var fs=require('fs');var path=require(_0xe947('0x7'));var rimraf=require(_0xe947('0x8'));var config=require(_0xe947('0x9'));var attributes=require(_0xe947('0xa'));module[_0xe947('0xb')]=function(_0x29a693,_0x3e7ee8){return _0x29a693[_0xe947('0xc')](_0xe947('0xd'),attributes,{'tableName':_0xe947('0xe'),'paranoid':![],'indexes':[{'name':_0xe947('0xf'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x21b4=['bluebird','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','idField','FieldId','../../config/logger','api','moment'];(function(_0x584c54,_0x11967b){var _0x462631=function(_0x45c2d8){while(--_0x45c2d8){_0x584c54['push'](_0x584c54['shift']());}};_0x462631(++_0x11967b);}(_0x21b4,0x1e1));var _0x421b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x21b4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x421b('0x0'))(_0x421b('0x1'));var moment=require(_0x421b('0x2'));var BPromise=require(_0x421b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x421b('0x4'));var rimraf=require(_0x421b('0x5'));var config=require(_0x421b('0x6'));var attributes=require(_0x421b('0x7'));module[_0x421b('0x8')]=function(_0x1a39e4,_0x49d6dc){return _0x1a39e4['define']('FreshdeskField',attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0x421b('0x9'),_0x421b('0xa')],'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 0c8bf0e..e2b3d0a 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 _0xc818=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x43658,_0x1e668a){var _0x3aff18=function(_0xeb66e4){while(--_0xeb66e4){_0x43658['push'](_0x43658['shift']());}};_0x3aff18(++_0x1e668a);}(_0xc818,0x1e3));var _0x8c81=function(_0x4eace6,_0x49fbe8){_0x4eace6=_0x4eace6-0x0;var _0x592edb=_0xc818[_0x4eace6];return _0x592edb;};'use strict';var _=require(_0x8c81('0x0'));var util=require(_0x8c81('0x1'));var moment=require(_0x8c81('0x2'));var BPromise=require(_0x8c81('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8c81('0x4'));var db=require(_0x8c81('0x5'))['db'];var utils=require(_0x8c81('0x6'));var logger=require(_0x8c81('0x7'))(_0x8c81('0x8'));var config=require(_0x8c81('0x9'));var jayson=require(_0x8c81('0xa'));var client=jayson['client'][_0x8c81('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d663e,_0x32cf31,_0x43d142){return new BPromise(function(_0x501240,_0x1173cf){return client[_0x8c81('0xc')](_0x3d663e,_0x43d142)[_0x8c81('0xd')](function(_0x15ebff){logger[_0x8c81('0xe')](_0x8c81('0xf'),_0x32cf31,_0x8c81('0x10'));logger['debug'](_0x8c81('0x11'),_0x32cf31,_0x8c81('0x10'),JSON[_0x8c81('0x12')](_0x15ebff));if(_0x15ebff[_0x8c81('0x13')]){if(_0x15ebff['error'][_0x8c81('0x14')]===0x1f4){logger[_0x8c81('0x13')](_0x8c81('0xf'),_0x32cf31,_0x15ebff[_0x8c81('0x13')][_0x8c81('0x15')]);return _0x1173cf(_0x15ebff[_0x8c81('0x13')][_0x8c81('0x15')]);}logger[_0x8c81('0x13')](_0x8c81('0xf'),_0x32cf31,_0x15ebff['error']['message']);return _0x501240(_0x15ebff[_0x8c81('0x13')][_0x8c81('0x15')]);}else{logger[_0x8c81('0xe')](_0x8c81('0xf'),_0x32cf31,_0x8c81('0x10'));_0x501240(_0x15ebff[_0x8c81('0x16')]['message']);}})[_0x8c81('0x17')](function(_0x29ccb0){logger[_0x8c81('0x13')](_0x8c81('0xf'),_0x32cf31,_0x29ccb0);_0x1173cf(_0x29ccb0);});});} \ No newline at end of file +var _0x6921=['message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskField,\x20%s,\x20%s'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0x6921,0x1d1));var _0x1692=function(_0x161f8d,_0x41242c){_0x161f8d=_0x161f8d-0x0;var _0x11b631=_0x6921[_0x161f8d];return _0x11b631;};'use strict';var _=require('lodash');var util=require(_0x1692('0x0'));var moment=require('moment');var BPromise=require(_0x1692('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1692('0x2'));var db=require(_0x1692('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1692('0x4'))('rpc');var config=require(_0x1692('0x5'));var jayson=require(_0x1692('0x6'));var client=jayson[_0x1692('0x7')][_0x1692('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2825c9,_0x36d159,_0x2d694f){return new BPromise(function(_0x3ffe29,_0x705f61){return client[_0x1692('0x9')](_0x2825c9,_0x2d694f)[_0x1692('0xa')](function(_0x5dc499){logger[_0x1692('0xb')]('FreshdeskField,\x20%s,\x20%s',_0x36d159,_0x1692('0xc'));logger[_0x1692('0xd')](_0x1692('0xe'),_0x36d159,_0x1692('0xc'),JSON[_0x1692('0xf')](_0x5dc499));if(_0x5dc499[_0x1692('0x10')]){if(_0x5dc499['error'][_0x1692('0x11')]===0x1f4){logger[_0x1692('0x10')](_0x1692('0x12'),_0x36d159,_0x5dc499[_0x1692('0x10')][_0x1692('0x13')]);return _0x705f61(_0x5dc499[_0x1692('0x10')]['message']);}logger[_0x1692('0x10')](_0x1692('0x12'),_0x36d159,_0x5dc499[_0x1692('0x10')][_0x1692('0x13')]);return _0x3ffe29(_0x5dc499[_0x1692('0x10')][_0x1692('0x13')]);}else{logger[_0x1692('0xb')](_0x1692('0x12'),_0x36d159,'request\x20sent');_0x3ffe29(_0x5dc499[_0x1692('0x14')]['message']);}})[_0x1692('0x15')](function(_0x4a1977){logger[_0x1692('0x10')](_0x1692('0x12'),_0x36d159,_0x4a1977);_0x705f61(_0x4a1977);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 707ca30..84ac799 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 _0x8d44=['get','isAuthenticated','/:id','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x8d44,0x161));var _0x48d4=function(_0x4bfe09,_0x3938a9){_0x4bfe09=_0x4bfe09-0x0;var _0x418a20=_0x8d44[_0x4bfe09];return _0x418a20;};'use strict';var multer=require(_0x48d4('0x0'));var util=require(_0x48d4('0x1'));var path=require('path');var timeout=require(_0x48d4('0x2'));var express=require(_0x48d4('0x3'));var router=express[_0x48d4('0x4')]();var auth=require(_0x48d4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x48d4('0x6'));var controller=require('./intSalesforceAccount.controller');router[_0x48d4('0x7')]('/',auth[_0x48d4('0x8')](),controller['index']);router[_0x48d4('0x7')](_0x48d4('0x9'),auth[_0x48d4('0x8')](),controller['show']);router[_0x48d4('0x7')](_0x48d4('0xa'),auth[_0x48d4('0x8')](),controller[_0x48d4('0xb')]);router[_0x48d4('0x7')](_0x48d4('0xc'),auth['isAuthenticated'](),controller['getFields']);router[_0x48d4('0xd')]('/',auth['isAuthenticated'](),controller[_0x48d4('0xe')]);router[_0x48d4('0xd')](_0x48d4('0xa'),auth['isAuthenticated'](),controller[_0x48d4('0xf')]);router[_0x48d4('0x10')](_0x48d4('0x9'),auth[_0x48d4('0x8')](),controller[_0x48d4('0x11')]);router[_0x48d4('0x12')](_0x48d4('0x9'),auth[_0x48d4('0x8')](),controller['destroy']);module[_0x48d4('0x13')]=router; \ No newline at end of file +var _0xb3f0=['../../config/environment','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3181cc,_0x28447f){var _0x547a4a=function(_0x3ede80){while(--_0x3ede80){_0x3181cc['push'](_0x3181cc['shift']());}};_0x547a4a(++_0x28447f);}(_0xb3f0,0x1c8));var _0x0b3f=function(_0x2e2681,_0x4089c1){_0x2e2681=_0x2e2681-0x0;var _0x368a64=_0xb3f0[_0x2e2681];return _0x368a64;};'use strict';var multer=require(_0x0b3f('0x0'));var util=require('util');var path=require(_0x0b3f('0x1'));var timeout=require('connect-timeout');var express=require(_0x0b3f('0x2'));var router=express[_0x0b3f('0x3')]();var auth=require(_0x0b3f('0x4'));var interaction=require(_0x0b3f('0x5'));var config=require(_0x0b3f('0x6'));var controller=require(_0x0b3f('0x7'));router[_0x0b3f('0x8')]('/',auth[_0x0b3f('0x9')](),controller[_0x0b3f('0xa')]);router['get'](_0x0b3f('0xb'),auth['isAuthenticated'](),controller[_0x0b3f('0xc')]);router[_0x0b3f('0x8')](_0x0b3f('0xd'),auth['isAuthenticated'](),controller[_0x0b3f('0xe')]);router[_0x0b3f('0x8')](_0x0b3f('0xf'),auth[_0x0b3f('0x9')](),controller['getFields']);router[_0x0b3f('0x10')]('/',auth[_0x0b3f('0x9')](),controller[_0x0b3f('0x11')]);router[_0x0b3f('0x10')](_0x0b3f('0xd'),auth[_0x0b3f('0x9')](),controller['addConfiguration']);router['put'](_0x0b3f('0xb'),auth[_0x0b3f('0x9')](),controller[_0x0b3f('0x12')]);router[_0x0b3f('0x13')]('/:id',auth[_0x0b3f('0x9')](),controller[_0x0b3f('0x14')]);module[_0x0b3f('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 244c2a5..58dd191 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 _0x65c6=['sequelize','exports','STRING','username','ENUM','integrationTab','newTab'];(function(_0x233c50,_0x50caf9){var _0x1639c5=function(_0x5d1cd6){while(--_0x5d1cd6){_0x233c50['push'](_0x233c50['shift']());}};_0x1639c5(++_0x50caf9);}(_0x65c6,0xaf));var _0x665c=function(_0x5336dc,_0xb1b24d){_0x5336dc=_0x5336dc-0x0;var _0x55e8a5=_0x65c6[_0x5336dc];return _0x55e8a5;};'use strict';var Sequelize=require(_0x665c('0x0'));module[_0x665c('0x1')]={'name':{'type':Sequelize[_0x665c('0x2')]},'description':{'type':Sequelize[_0x665c('0x2')]},'username':{'type':Sequelize[_0x665c('0x2')],'unique':_0x665c('0x3')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x665c('0x2')]},'clientId':{'type':Sequelize[_0x665c('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x665c('0x2')]},'serverUrl':{'type':Sequelize[_0x665c('0x2')]},'type':{'type':Sequelize[_0x665c('0x4')](_0x665c('0x5'),_0x665c('0x6')),'defaultValue':_0x665c('0x5')}}; \ No newline at end of file +var _0x36bc=['newTab','exports','STRING'];(function(_0x445d8d,_0x584a3b){var _0x2d8573=function(_0x2206cf){while(--_0x2206cf){_0x445d8d['push'](_0x445d8d['shift']());}};_0x2d8573(++_0x584a3b);}(_0x36bc,0xb5));var _0xc36b=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x36bc[_0x2b10c6];return _0x3789d2;};'use strict';var Sequelize=require('sequelize');module[_0xc36b('0x0')]={'name':{'type':Sequelize[_0xc36b('0x1')]},'description':{'type':Sequelize[_0xc36b('0x1')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xc36b('0x1')]},'clientId':{'type':Sequelize[_0xc36b('0x1')]},'clientSecret':{'type':Sequelize[_0xc36b('0x1')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xc36b('0x1')]},'type':{'type':Sequelize['ENUM']('integrationTab',_0xc36b('0x2')),'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 f9cb472..e965a69 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 _0x0ef0=['to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','then','destroy','stack','name','index','rawAttributes','keys','query','intersection','fields','attributes','length','model','hasOwnProperty','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','options','SalesforceAccount','count','includeAll','include','findAll','show','params','find','create','body','update','getConfigurations','findOne','SalesforceConfiguration','nolimit','AccountId','Subjects','getSubjects','channel','getDescriptions','SalesforceField','Descriptions','getFields','clientId','username','password','securityToken','remoteUri','slice','substring','lastIndexOf','Connection','clientSecret','login','concat','isNil','ticketType','sobject','describe','CallDisposition','CallObject','CallType','IsArchived','Type','Origin','Reason','Status','Priority','IsEscalated','SuppliedCompany','custom','includes','label','picklistValues','true','False','test','statusCode','send','Wrong\x20credentials','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox'];(function(_0x5a6520,_0x5bedc4){var _0x322901=function(_0x4788ce){while(--_0x4788ce){_0x5a6520['push'](_0x5a6520['shift']());}};_0x322901(++_0x5bedc4);}(_0x0ef0,0x80));var _0x00ef=function(_0x2ae8d6,_0x4d7876){_0x2ae8d6=_0x2ae8d6-0x0;var _0x3d5145=_0x0ef0[_0x2ae8d6];return _0x3d5145;};'use strict';var pdf=require(_0x00ef('0x0'));var emlformat=require(_0x00ef('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x00ef('0x2'));var jsonpatch=require(_0x00ef('0x3'));var rp=require(_0x00ef('0x4'));var moment=require(_0x00ef('0x5'));var BPromise=require(_0x00ef('0x6'));var Mustache=require(_0x00ef('0x7'));var util=require('util');var path=require('path');var sox=require(_0x00ef('0x8'));var csv=require(_0x00ef('0x9'));var ejs=require(_0x00ef('0xa'));var fs=require('fs');var _=require(_0x00ef('0xb'));var squel=require('squel');var crypto=require(_0x00ef('0xc'));var jsforce=require(_0x00ef('0xd'));var deskjs=require(_0x00ef('0xe'));var toCsv=require(_0x00ef('0x9'));var querystring=require(_0x00ef('0xf'));var Papa=require('papaparse');var Redis=require(_0x00ef('0x10'));var authService=require(_0x00ef('0x11'));var qs=require(_0x00ef('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x00ef('0x13'))('api');var utils=require(_0x00ef('0x14'));var config=require(_0x00ef('0x15'));var db=require(_0x00ef('0x16'))['db'];var integrations=require(_0x00ef('0x17'));var jayson=require(_0x00ef('0x18'));var client=jayson['client'][_0x00ef('0x19')]({'port':0x232a});function checkPasswordPattern(_0x4c9a9c,_0x1e1b41,_0x21ffb1){if(_0x21ffb1){var _0x49f9ee=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x49f9ee['test'](_0x1e1b41)){return _0x4c9a9c;}else{throw new Error(_0x00ef('0x1a'));}}else{return _0x4c9a9c;}}function respondWithRpcPromise(_0x4aed97,_0x5a657a,_0x1a3e29,_0x6a5bbd){return new BPromise(function(_0x8f5256,_0x250c3d){var _0x5b60ec=_0x6a5bbd||client;return _0x5b60ec[_0x00ef('0x1b')](_0x4aed97,_0x1a3e29)['then'](function(_0xbd149a){logger[_0x00ef('0x1c')](_0x00ef('0x1d'),_0x5a657a,'request\x20sent');logger[_0x00ef('0x1e')](_0x00ef('0x1f'),_0x5a657a,_0x00ef('0x20'),JSON[_0x00ef('0x21')](_0xbd149a));if(_0xbd149a[_0x00ef('0x22')]){if(_0xbd149a[_0x00ef('0x22')][_0x00ef('0x23')]===0x1f4){logger['error'](_0x00ef('0x1d'),_0x5a657a,_0xbd149a[_0x00ef('0x22')][_0x00ef('0x24')]);return _0x250c3d(_0xbd149a[_0x00ef('0x22')][_0x00ef('0x24')]);}logger[_0x00ef('0x22')](_0x00ef('0x1d'),_0x5a657a,_0xbd149a[_0x00ef('0x22')][_0x00ef('0x24')]);return _0x8f5256(_0xbd149a['error'][_0x00ef('0x24')]);}else{logger[_0x00ef('0x1c')](_0x00ef('0x1d'),_0x5a657a,_0x00ef('0x20'));_0x8f5256(_0xbd149a[_0x00ef('0x25')][_0x00ef('0x24')]);}})[_0x00ef('0x26')](function(_0x6d76aa){logger[_0x00ef('0x22')](_0x00ef('0x1d'),_0x5a657a,_0x6d76aa);_0x250c3d(_0x6d76aa);});});}function respondWithStatusCode(_0x39a31f,_0x5db542){_0x5db542=_0x5db542||0xcc;return function(_0x14dd46){if(_0x14dd46){return _0x39a31f[_0x00ef('0x27')](_0x5db542);}return _0x39a31f[_0x00ef('0x28')](_0x5db542)[_0x00ef('0x29')]();};}function respondWithResult(_0x515b09,_0x50b38b){_0x50b38b=_0x50b38b||0xc8;return function(_0x186fa7){if(_0x186fa7){return _0x515b09[_0x00ef('0x28')](_0x50b38b)[_0x00ef('0x2a')](_0x186fa7);}};}function respondWithFilteredResult(_0x26939e,_0x489cfe){return function(_0x73e47d){if(_0x73e47d){var _0x545af5=_0x73e47d['count'],_0xa6e016=_0x489cfe[_0x00ef('0x2b')],_0x3830bb=_0x489cfe[_0x00ef('0x2b')]+_0x489cfe[_0x00ef('0x2c')],_0xe3a215;if(_0x3830bb>=_0x545af5){_0x3830bb=_0x545af5;_0xe3a215=0xc8;}else{_0xe3a215=0xce;}_0x26939e[_0x00ef('0x28')](_0xe3a215);return _0x26939e[_0x00ef('0x2d')](_0x00ef('0x2e'),_0xa6e016+'-'+_0x3830bb+'/'+_0x545af5)['json'](_0x73e47d);}return null;};}function patchUpdates(_0xda2161){return function(_0x29779e){try{jsonpatch[_0x00ef('0x2f')](_0x29779e,_0xda2161,!![]);}catch(_0x490874){return BPromise[_0x00ef('0x30')](_0x490874);}return _0x29779e[_0x00ef('0x31')]();};}function saveUpdates(_0xf03c1,_0x3aa20c){return function(_0x37ac53){if(_0x37ac53){return _0x37ac53['update'](_0xf03c1)[_0x00ef('0x32')](function(_0x2dc521){return _0x2dc521;});}return null;};}function removeEntity(_0x303e4f,_0x2558d2){return function(_0x833d36){if(_0x833d36){return _0x833d36[_0x00ef('0x33')]()[_0x00ef('0x32')](function(){_0x303e4f['status'](0xcc)[_0x00ef('0x29')]();});}};}function handleEntityNotFound(_0x4ded09,_0x84f48e){return function(_0x47d5a8){if(!_0x47d5a8){_0x4ded09[_0x00ef('0x27')](0x194);}return _0x47d5a8;};}function handleError(_0x27fac2,_0x2cab28){_0x2cab28=_0x2cab28||0x1f4;return function(_0x521791){logger[_0x00ef('0x22')](_0x521791[_0x00ef('0x34')]);if(_0x521791[_0x00ef('0x35')]){delete _0x521791[_0x00ef('0x35')];}_0x27fac2[_0x00ef('0x28')](_0x2cab28)['send'](_0x521791);};}exports[_0x00ef('0x36')]=function(_0x497000,_0x858705){var _0x2e77f8={},_0x50a372={},_0x33d2e1={'count':0x0,'rows':[]};var _0x52cbc8=db['SalesforceAccount'][_0x00ef('0x37')];_0x50a372['model']=_[_0x00ef('0x38')](_0x52cbc8);_0x50a372[_0x00ef('0x39')]=_['keys'](_0x497000[_0x00ef('0x39')]);_0x50a372['filters']=_[_0x00ef('0x3a')](_0x50a372['model'],_0x50a372[_0x00ef('0x39')]);_0x2e77f8['attributes']=_[_0x00ef('0x3a')](_0x50a372['model'],qs[_0x00ef('0x3b')](_0x497000[_0x00ef('0x39')][_0x00ef('0x3b')]));_0x2e77f8[_0x00ef('0x3c')]=_0x2e77f8[_0x00ef('0x3c')][_0x00ef('0x3d')]?_0x2e77f8[_0x00ef('0x3c')]:_0x50a372[_0x00ef('0x3e')];if(!_0x497000['query'][_0x00ef('0x3f')]('nolimit')){_0x2e77f8[_0x00ef('0x2c')]=qs['limit'](_0x497000['query']['limit']);_0x2e77f8['offset']=qs['offset'](_0x497000[_0x00ef('0x39')][_0x00ef('0x2b')]);}_0x2e77f8[_0x00ef('0x40')]=qs[_0x00ef('0x41')](_0x497000[_0x00ef('0x39')][_0x00ef('0x41')]);_0x2e77f8[_0x00ef('0x42')]=qs[_0x00ef('0x43')](_[_0x00ef('0x44')](_0x497000[_0x00ef('0x39')],_0x50a372[_0x00ef('0x43')]));if(_0x497000[_0x00ef('0x39')][_0x00ef('0x45')]){_0x2e77f8['where']=_[_0x00ef('0x46')](_0x2e77f8[_0x00ef('0x42')],{'$or':_[_0x00ef('0x47')](_0x52cbc8,function(_0x88c29e){if(_0x88c29e[_0x00ef('0x48')][_0x00ef('0x49')]!==_0x00ef('0x4a')){var _0x3730cf={};_0x3730cf[_0x88c29e[_0x00ef('0x4b')]]={'$like':'%'+_0x497000[_0x00ef('0x39')]['filter']+'%'};return _0x3730cf;}})});}_0x2e77f8=_[_0x00ef('0x46')]({},_0x2e77f8,_0x497000[_0x00ef('0x4c')]);var _0x339bd8={'where':_0x2e77f8[_0x00ef('0x42')]};return db[_0x00ef('0x4d')]['count'](_0x339bd8)['then'](function(_0x13d94d){_0x33d2e1[_0x00ef('0x4e')]=_0x13d94d;if(_0x497000['query'][_0x00ef('0x4f')]){_0x2e77f8[_0x00ef('0x50')]=[{'all':!![]}];}return db[_0x00ef('0x4d')][_0x00ef('0x51')](_0x2e77f8);})['then'](function(_0x112b42){_0x33d2e1['rows']=_0x112b42;return _0x33d2e1;})[_0x00ef('0x32')](respondWithFilteredResult(_0x858705,_0x2e77f8))[_0x00ef('0x26')](handleError(_0x858705,null));};exports[_0x00ef('0x52')]=function(_0x383995,_0x5258b2){var _0x4dc404={'raw':![],'where':{'id':_0x383995[_0x00ef('0x53')]['id']}},_0x67cd51={};_0x67cd51[_0x00ef('0x3e')]=_[_0x00ef('0x38')](db[_0x00ef('0x4d')][_0x00ef('0x37')]);_0x67cd51[_0x00ef('0x39')]=_[_0x00ef('0x38')](_0x383995['query']);_0x67cd51[_0x00ef('0x43')]=_[_0x00ef('0x3a')](_0x67cd51['model'],_0x67cd51[_0x00ef('0x39')]);_0x4dc404[_0x00ef('0x3c')]=_[_0x00ef('0x3a')](_0x67cd51[_0x00ef('0x3e')],qs['fields'](_0x383995[_0x00ef('0x39')]['fields']));_0x4dc404[_0x00ef('0x3c')]=_0x4dc404[_0x00ef('0x3c')][_0x00ef('0x3d')]?_0x4dc404[_0x00ef('0x3c')]:_0x67cd51[_0x00ef('0x3e')];if(_0x383995['query'][_0x00ef('0x4f')]){_0x4dc404[_0x00ef('0x50')]=[{'all':!![]}];}_0x4dc404=_[_0x00ef('0x46')]({},_0x4dc404,_0x383995[_0x00ef('0x4c')]);return db[_0x00ef('0x4d')][_0x00ef('0x54')](_0x4dc404)['then'](handleEntityNotFound(_0x5258b2,null))[_0x00ef('0x32')](respondWithResult(_0x5258b2,null))[_0x00ef('0x26')](handleError(_0x5258b2,null));};exports[_0x00ef('0x55')]=function(_0x1ddf67,_0x2af867){return db[_0x00ef('0x4d')][_0x00ef('0x55')](_0x1ddf67[_0x00ef('0x56')],{})[_0x00ef('0x32')](respondWithResult(_0x2af867,0xc9))['catch'](handleError(_0x2af867,null));};exports[_0x00ef('0x57')]=function(_0x5372da,_0x329c46){if(_0x5372da[_0x00ef('0x56')]['id']){delete _0x5372da[_0x00ef('0x56')]['id'];}return db[_0x00ef('0x4d')][_0x00ef('0x54')]({'where':{'id':_0x5372da['params']['id']}})[_0x00ef('0x32')](handleEntityNotFound(_0x329c46,null))[_0x00ef('0x32')](saveUpdates(_0x5372da[_0x00ef('0x56')],null))[_0x00ef('0x32')](respondWithResult(_0x329c46,null))[_0x00ef('0x26')](handleError(_0x329c46,null));};exports[_0x00ef('0x33')]=function(_0x3e1614,_0x5d3464){return db[_0x00ef('0x4d')][_0x00ef('0x54')]({'where':{'id':_0x3e1614[_0x00ef('0x53')]['id']}})['then'](handleEntityNotFound(_0x5d3464,null))[_0x00ef('0x32')](removeEntity(_0x5d3464,null))[_0x00ef('0x26')](handleError(_0x5d3464,null));};exports[_0x00ef('0x58')]=function(_0x5098a5,_0x450c24,_0x4e1747){var _0x16fe91={};var _0x2e74b7={};var _0x3d1b5d;var _0x4429aa;return db[_0x00ef('0x4d')][_0x00ef('0x59')]({'where':{'id':_0x5098a5['params']['id']}})[_0x00ef('0x32')](handleEntityNotFound(_0x450c24,null))[_0x00ef('0x32')](function(_0x43beed){if(_0x43beed){_0x3d1b5d=_0x43beed;_0x2e74b7[_0x00ef('0x3e')]=_[_0x00ef('0x38')](db[_0x00ef('0x5a')]['rawAttributes']);_0x2e74b7[_0x00ef('0x39')]=_[_0x00ef('0x38')](_0x5098a5['query']);_0x2e74b7[_0x00ef('0x43')]=_[_0x00ef('0x3a')](_0x2e74b7[_0x00ef('0x3e')],_0x2e74b7['query']);_0x16fe91[_0x00ef('0x3c')]=_['intersection'](_0x2e74b7[_0x00ef('0x3e')],qs['fields'](_0x5098a5[_0x00ef('0x39')][_0x00ef('0x3b')]));_0x16fe91['attributes']=_0x16fe91[_0x00ef('0x3c')][_0x00ef('0x3d')]?_0x16fe91['attributes']:_0x2e74b7[_0x00ef('0x3e')];_0x16fe91['order']=qs['sort'](_0x5098a5[_0x00ef('0x39')][_0x00ef('0x41')]);_0x16fe91[_0x00ef('0x42')]=qs[_0x00ef('0x43')](_[_0x00ef('0x44')](_0x5098a5[_0x00ef('0x39')],_0x2e74b7[_0x00ef('0x43')]));if(_0x5098a5['query'][_0x00ef('0x45')]){_0x16fe91[_0x00ef('0x42')]=_[_0x00ef('0x46')](_0x16fe91['where'],{'$or':_[_0x00ef('0x47')](_0x16fe91[_0x00ef('0x3c')],function(_0x41d0c6){var _0x318cc2={};_0x318cc2[_0x41d0c6]={'$like':'%'+_0x5098a5[_0x00ef('0x39')][_0x00ef('0x45')]+'%'};return _0x318cc2;})});}_0x16fe91=_[_0x00ef('0x46')]({},_0x16fe91,_0x5098a5[_0x00ef('0x4c')]);return _0x3d1b5d['getConfigurations'](_0x16fe91);}})['then'](function(_0x131446){if(_0x131446){_0x4429aa=_0x131446[_0x00ef('0x3d')];if(!_0x5098a5['query'][_0x00ef('0x3f')](_0x00ef('0x5b'))){_0x16fe91[_0x00ef('0x2c')]=qs[_0x00ef('0x2c')](_0x5098a5[_0x00ef('0x39')][_0x00ef('0x2c')]);_0x16fe91[_0x00ef('0x2b')]=qs[_0x00ef('0x2b')](_0x5098a5[_0x00ef('0x39')][_0x00ef('0x2b')]);}return _0x3d1b5d[_0x00ef('0x58')](_0x16fe91);}})[_0x00ef('0x32')](function(_0x11a94b){if(_0x11a94b){return _0x11a94b?{'count':_0x4429aa,'rows':_0x11a94b}:null;}})['then'](respondWithResult(_0x450c24,null))[_0x00ef('0x26')](handleError(_0x450c24,null));};exports['addConfiguration']=function(_0x4f007f,_0x34877b,_0x511d0f){if(_0x4f007f[_0x00ef('0x56')]['id']){delete _0x4f007f[_0x00ef('0x56')]['id'];}return db[_0x00ef('0x4d')][_0x00ef('0x59')]({'where':{'id':_0x4f007f[_0x00ef('0x53')]['id']}})[_0x00ef('0x32')](handleEntityNotFound(_0x34877b,null))[_0x00ef('0x32')](function(_0x4465ca){if(_0x4465ca){_0x4f007f[_0x00ef('0x56')][_0x00ef('0x5c')]=_0x4465ca['id'];_0x4f007f['body'][_0x00ef('0x5d')]=integrations[_0x00ef('0x5e')](_0x4f007f[_0x00ef('0x56')][_0x00ef('0x5f')],_0x4f007f[_0x00ef('0x56')][_0x00ef('0x48')]);_0x4f007f['body']['Descriptions']=integrations[_0x00ef('0x60')](_0x4f007f[_0x00ef('0x56')][_0x00ef('0x5f')],_0x4f007f[_0x00ef('0x56')]['type']);return db['SalesforceConfiguration'][_0x00ef('0x55')](_0x4f007f[_0x00ef('0x56')],{'include':[{'model':db[_0x00ef('0x61')],'as':_0x00ef('0x5d')},{'model':db[_0x00ef('0x61')],'as':_0x00ef('0x62')}]});}return null;})['then'](respondWithResult(_0x34877b,null))['catch'](handleError(_0x34877b,null));};exports[_0x00ef('0x63')]=function(_0x241675,_0x18b71c,_0x38c825){var _0x465b49;var _0x23646a='';var _0x1d557='Task';return db[_0x00ef('0x4d')][_0x00ef('0x59')]({'where':{'id':_0x241675[_0x00ef('0x53')]['id']},'attributes':['id','remoteUri',_0x00ef('0x64'),'clientSecret',_0x00ef('0x65'),_0x00ef('0x66'),_0x00ef('0x67')]})[_0x00ef('0x32')](handleEntityNotFound(_0x18b71c,null))[_0x00ef('0x32')](function(_0x5d42b0){if(_0x5d42b0){_0x23646a=_0x5d42b0[_0x00ef('0x68')];var _0x237153=_0x23646a[_0x00ef('0x69')](-0x1);if(_0x237153==='/'){_0x23646a=_0x23646a[_0x00ef('0x6a')](0x0,_0x23646a[_0x00ef('0x6b')](_0x237153));}_0x465b49=new jsforce[(_0x00ef('0x6c'))]({'oauth2':{'loginUrl':_0x23646a,'clientId':_0x5d42b0[_0x00ef('0x64')],'clientSecret':_0x5d42b0[_0x00ef('0x6d')]}});return _0x465b49[_0x00ef('0x6e')](_0x5d42b0[_0x00ef('0x65')],_0x5d42b0['password'][_0x00ef('0x6f')](_0x5d42b0['securityToken']));}})[_0x00ef('0x32')](function(_0x442472){if(_0x442472){if(!_[_0x00ef('0x70')](_0x241675[_0x00ef('0x39')][_0x00ef('0x71')])){_0x1d557=_0x241675[_0x00ef('0x39')][_0x00ef('0x71')];}return _0x465b49[_0x00ef('0x72')](_0x1d557)[_0x00ef('0x73')]();}})[_0x00ef('0x32')](function(_0x247141){var _0x33de99=[_0x00ef('0x74'),'CallDurationInSeconds',_0x00ef('0x75'),_0x00ef('0x76'),_0x00ef('0x77'),'Priority','Status',_0x00ef('0x78')];if(!_[_0x00ef('0x70')](_0x241675['query']['ticketType'])&&_0x241675[_0x00ef('0x39')]['ticketType']==='Case'){_0x33de99=[_0x00ef('0x78'),_0x00ef('0x79'),_0x00ef('0x7a'),_0x00ef('0x7b'),_0x00ef('0x7c'),_0x00ef('0x7d'),'SuppliedName',_0x00ef('0x7e')];}if(_0x247141){_['remove'](_0x247141[_0x00ef('0x3b')],function(_0x4abe40){return _0x4abe40[_0x00ef('0x7f')]===![]&&!_0x33de99[_0x00ef('0x80')](_0x4abe40[_0x00ef('0x35')]);});return{'count':_0x247141[_0x00ef('0x3b')][_0x00ef('0x3d')],'rows':_['map'](_0x247141[_0x00ef('0x3b')],function(_0x56b14b){return{'id':_0x56b14b['name'],'name':_0x56b14b[_0x00ef('0x81')],'custom':_0x56b14b[_0x00ef('0x7f')],'options':_0x56b14b[_0x00ef('0x82')]['length']>0x0?_['map'](_0x56b14b[_0x00ef('0x82')],function(_0x5a178f){return{'name':_0x5a178f['label'],'value':_0x5a178f['value']};}):_0x56b14b[_0x00ef('0x48')]=='boolean'?[{'name':'True','value':_0x00ef('0x83')},{'name':_0x00ef('0x84'),'value':'false'}]:[]};})};}})[_0x00ef('0x32')](respondWithResult(_0x18b71c,null))[_0x00ef('0x26')](function(_0x47c495){var _0x95002f=_0x241675[_0x00ef('0x39')][_0x00ef('0x85')]?0x1f4:_0x47c495[_0x00ef('0x86')]||0x1f4;logger[_0x00ef('0x22')]('getFields,\x20%s,\x20%s,\x20%s',_0x00ef('0x63'),_0x95002f,JSON[_0x00ef('0x21')](_0x47c495));delete _0x47c495[_0x00ef('0x35')];if(_0x95002f===0x191){_0x95002f=0x190;}_0x18b71c['status'](_0x95002f)[_0x00ef('0x87')](_0x241675[_0x00ef('0x39')][_0x00ef('0x85')]?{'message':_0x00ef('0x88'),'statusCode':_0x47c495[_0x00ef('0x86')]}:_0x47c495);});}; \ No newline at end of file +var _0x899a=['remoteUri','clientId','clientSecret','password','slice','substring','username','isNil','ticketType','sobject','describe','CallDisposition','CallDurationInSeconds','CallObject','IsArchived','Priority','Type','Case','Origin','Reason','Status','IsEscalated','SuppliedName','SuppliedCompany','custom','label','picklistValues','value','boolean','true','False','false','statusCode','stringify','send','Wrong\x20credentials','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','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','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','status','end','json','count','offset','limit','set','Content-Range','apply','update','sendStatus','stack','name','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','map','key','field','merge','options','SalesforceAccount','includeAll','include','rows','show','params','create','body','find','destroy','getConfigurations','findOne','SalesforceConfiguration','addConfiguration','AccountId','getSubjects','channel','type','Descriptions','getDescriptions','Subjects','SalesforceField','getFields','Task'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x899a,0x1b6));var _0xa899=function(_0x200c34,_0x10f38a){_0x200c34=_0x200c34-0x0;var _0x293b32=_0x899a[_0x200c34];return _0x293b32;};'use strict';var pdf=require(_0xa899('0x0'));var emlformat=require(_0xa899('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa899('0x2'));var jsonpatch=require(_0xa899('0x3'));var rp=require('request-promise');var moment=require(_0xa899('0x4'));var BPromise=require(_0xa899('0x5'));var Mustache=require(_0xa899('0x6'));var util=require(_0xa899('0x7'));var path=require('path');var sox=require(_0xa899('0x8'));var csv=require(_0xa899('0x9'));var ejs=require(_0xa899('0xa'));var fs=require('fs');var _=require(_0xa899('0xb'));var squel=require('squel');var crypto=require(_0xa899('0xc'));var jsforce=require(_0xa899('0xd'));var deskjs=require(_0xa899('0xe'));var toCsv=require(_0xa899('0x9'));var querystring=require(_0xa899('0xf'));var Papa=require(_0xa899('0x10'));var Redis=require(_0xa899('0x11'));var authService=require(_0xa899('0x12'));var qs=require(_0xa899('0x13'));var hardwareService=require(_0xa899('0x14'));var logger=require('../../config/logger')(_0xa899('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xa899('0x16'));var client=jayson[_0xa899('0x17')][_0xa899('0x18')]({'port':0x232a});function checkPasswordPattern(_0x52b4ac,_0x19a08c,_0x198c32){if(_0x198c32){var _0x56d838=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x56d838[_0xa899('0x19')](_0x19a08c)){return _0x52b4ac;}else{throw new Error(_0xa899('0x1a'));}}else{return _0x52b4ac;}}function respondWithRpcPromise(_0x104b42,_0xc05259,_0x5cb055,_0x7a13b2){return new BPromise(function(_0x205601,_0x4c08cc){var _0xf809a7=_0x7a13b2||client;return _0xf809a7[_0xa899('0x1b')](_0x104b42,_0x5cb055)[_0xa899('0x1c')](function(_0x49118f){logger['info'](_0xa899('0x1d'),_0xc05259,_0xa899('0x1e'));logger[_0xa899('0x1f')](_0xa899('0x20'),_0xc05259,_0xa899('0x1e'),JSON['stringify'](_0x49118f));if(_0x49118f[_0xa899('0x21')]){if(_0x49118f['error'][_0xa899('0x22')]===0x1f4){logger[_0xa899('0x21')]('SalesforceAccount,\x20%s,\x20%s',_0xc05259,_0x49118f[_0xa899('0x21')][_0xa899('0x23')]);return _0x4c08cc(_0x49118f[_0xa899('0x21')][_0xa899('0x23')]);}logger[_0xa899('0x21')]('SalesforceAccount,\x20%s,\x20%s',_0xc05259,_0x49118f[_0xa899('0x21')][_0xa899('0x23')]);return _0x205601(_0x49118f['error'][_0xa899('0x23')]);}else{logger[_0xa899('0x24')](_0xa899('0x1d'),_0xc05259,_0xa899('0x1e'));_0x205601(_0x49118f[_0xa899('0x25')]['message']);}})[_0xa899('0x26')](function(_0x35983f){logger[_0xa899('0x21')]('SalesforceAccount,\x20%s,\x20%s',_0xc05259,_0x35983f);_0x4c08cc(_0x35983f);});});}function respondWithStatusCode(_0x1bceb8,_0x3687c0){_0x3687c0=_0x3687c0||0xcc;return function(_0xdacfa4){if(_0xdacfa4){return _0x1bceb8['sendStatus'](_0x3687c0);}return _0x1bceb8[_0xa899('0x27')](_0x3687c0)[_0xa899('0x28')]();};}function respondWithResult(_0x32fb64,_0x1911e3){_0x1911e3=_0x1911e3||0xc8;return function(_0x3d108c){if(_0x3d108c){return _0x32fb64[_0xa899('0x27')](_0x1911e3)[_0xa899('0x29')](_0x3d108c);}};}function respondWithFilteredResult(_0x10ff05,_0x1e8fa6){return function(_0x31b7e4){if(_0x31b7e4){var _0x5a261a=_0x31b7e4[_0xa899('0x2a')],_0x49312a=_0x1e8fa6['offset'],_0x103777=_0x1e8fa6[_0xa899('0x2b')]+_0x1e8fa6[_0xa899('0x2c')],_0x7ac8e2;if(_0x103777>=_0x5a261a){_0x103777=_0x5a261a;_0x7ac8e2=0xc8;}else{_0x7ac8e2=0xce;}_0x10ff05['status'](_0x7ac8e2);return _0x10ff05[_0xa899('0x2d')](_0xa899('0x2e'),_0x49312a+'-'+_0x103777+'/'+_0x5a261a)[_0xa899('0x29')](_0x31b7e4);}return null;};}function patchUpdates(_0x21f362){return function(_0x13077d){try{jsonpatch[_0xa899('0x2f')](_0x13077d,_0x21f362,!![]);}catch(_0x4bee1a){return BPromise['reject'](_0x4bee1a);}return _0x13077d['save']();};}function saveUpdates(_0x3b537b,_0x403199){return function(_0x35d25f){if(_0x35d25f){return _0x35d25f[_0xa899('0x30')](_0x3b537b)[_0xa899('0x1c')](function(_0x191877){return _0x191877;});}return null;};}function removeEntity(_0x11dcb9,_0x4d14d4){return function(_0x2b5838){if(_0x2b5838){return _0x2b5838['destroy']()[_0xa899('0x1c')](function(){_0x11dcb9[_0xa899('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4102f5,_0x59943e){return function(_0x2f3acc){if(!_0x2f3acc){_0x4102f5[_0xa899('0x31')](0x194);}return _0x2f3acc;};}function handleError(_0x1ab1a8,_0x2ccf8c){_0x2ccf8c=_0x2ccf8c||0x1f4;return function(_0x46c75d){logger[_0xa899('0x21')](_0x46c75d[_0xa899('0x32')]);if(_0x46c75d[_0xa899('0x33')]){delete _0x46c75d[_0xa899('0x33')];}_0x1ab1a8[_0xa899('0x27')](_0x2ccf8c)['send'](_0x46c75d);};}exports[_0xa899('0x34')]=function(_0x9b0306,_0x3cc9ac){var _0x5b5fb2={},_0x43bff2={},_0x1ba5a8={'count':0x0,'rows':[]};var _0x22ca27=db['SalesforceAccount'][_0xa899('0x35')];_0x43bff2[_0xa899('0x36')]=_[_0xa899('0x37')](_0x22ca27);_0x43bff2['query']=_[_0xa899('0x37')](_0x9b0306[_0xa899('0x38')]);_0x43bff2[_0xa899('0x39')]=_[_0xa899('0x3a')](_0x43bff2[_0xa899('0x36')],_0x43bff2[_0xa899('0x38')]);_0x5b5fb2[_0xa899('0x3b')]=_[_0xa899('0x3a')](_0x43bff2[_0xa899('0x36')],qs[_0xa899('0x3c')](_0x9b0306[_0xa899('0x38')]['fields']));_0x5b5fb2['attributes']=_0x5b5fb2[_0xa899('0x3b')][_0xa899('0x3d')]?_0x5b5fb2[_0xa899('0x3b')]:_0x43bff2[_0xa899('0x36')];if(!_0x9b0306['query'][_0xa899('0x3e')](_0xa899('0x3f'))){_0x5b5fb2[_0xa899('0x2c')]=qs[_0xa899('0x2c')](_0x9b0306[_0xa899('0x38')][_0xa899('0x2c')]);_0x5b5fb2['offset']=qs['offset'](_0x9b0306['query'][_0xa899('0x2b')]);}_0x5b5fb2[_0xa899('0x40')]=qs[_0xa899('0x41')](_0x9b0306[_0xa899('0x38')][_0xa899('0x41')]);_0x5b5fb2['where']=qs['filters'](_[_0xa899('0x42')](_0x9b0306[_0xa899('0x38')],_0x43bff2['filters']));if(_0x9b0306[_0xa899('0x38')][_0xa899('0x43')]){_0x5b5fb2[_0xa899('0x44')]=_['merge'](_0x5b5fb2[_0xa899('0x44')],{'$or':_[_0xa899('0x45')](_0x22ca27,function(_0x194199){if(_0x194199['type'][_0xa899('0x46')]!=='VIRTUAL'){var _0x2e563a={};_0x2e563a[_0x194199[_0xa899('0x47')]]={'$like':'%'+_0x9b0306[_0xa899('0x38')][_0xa899('0x43')]+'%'};return _0x2e563a;}})});}_0x5b5fb2=_[_0xa899('0x48')]({},_0x5b5fb2,_0x9b0306[_0xa899('0x49')]);var _0x33f236={'where':_0x5b5fb2[_0xa899('0x44')]};return db[_0xa899('0x4a')][_0xa899('0x2a')](_0x33f236)[_0xa899('0x1c')](function(_0x7c0dfc){_0x1ba5a8[_0xa899('0x2a')]=_0x7c0dfc;if(_0x9b0306[_0xa899('0x38')][_0xa899('0x4b')]){_0x5b5fb2[_0xa899('0x4c')]=[{'all':!![]}];}return db[_0xa899('0x4a')]['findAll'](_0x5b5fb2);})['then'](function(_0x2e31a1){_0x1ba5a8[_0xa899('0x4d')]=_0x2e31a1;return _0x1ba5a8;})[_0xa899('0x1c')](respondWithFilteredResult(_0x3cc9ac,_0x5b5fb2))[_0xa899('0x26')](handleError(_0x3cc9ac,null));};exports[_0xa899('0x4e')]=function(_0x42629b,_0x2b66c4){var _0x20d57f={'raw':![],'where':{'id':_0x42629b[_0xa899('0x4f')]['id']}},_0x53e812={};_0x53e812[_0xa899('0x36')]=_[_0xa899('0x37')](db['SalesforceAccount'][_0xa899('0x35')]);_0x53e812[_0xa899('0x38')]=_[_0xa899('0x37')](_0x42629b[_0xa899('0x38')]);_0x53e812[_0xa899('0x39')]=_['intersection'](_0x53e812[_0xa899('0x36')],_0x53e812[_0xa899('0x38')]);_0x20d57f[_0xa899('0x3b')]=_['intersection'](_0x53e812['model'],qs[_0xa899('0x3c')](_0x42629b[_0xa899('0x38')][_0xa899('0x3c')]));_0x20d57f[_0xa899('0x3b')]=_0x20d57f[_0xa899('0x3b')]['length']?_0x20d57f[_0xa899('0x3b')]:_0x53e812[_0xa899('0x36')];if(_0x42629b[_0xa899('0x38')]['includeAll']){_0x20d57f['include']=[{'all':!![]}];}_0x20d57f=_[_0xa899('0x48')]({},_0x20d57f,_0x42629b[_0xa899('0x49')]);return db[_0xa899('0x4a')]['find'](_0x20d57f)[_0xa899('0x1c')](handleEntityNotFound(_0x2b66c4,null))[_0xa899('0x1c')](respondWithResult(_0x2b66c4,null))[_0xa899('0x26')](handleError(_0x2b66c4,null));};exports['create']=function(_0x4df388,_0x200116){return db['SalesforceAccount'][_0xa899('0x50')](_0x4df388[_0xa899('0x51')],{})['then'](respondWithResult(_0x200116,0xc9))[_0xa899('0x26')](handleError(_0x200116,null));};exports[_0xa899('0x30')]=function(_0x404038,_0x27b7fa){if(_0x404038[_0xa899('0x51')]['id']){delete _0x404038[_0xa899('0x51')]['id'];}return db[_0xa899('0x4a')][_0xa899('0x52')]({'where':{'id':_0x404038[_0xa899('0x4f')]['id']}})[_0xa899('0x1c')](handleEntityNotFound(_0x27b7fa,null))[_0xa899('0x1c')](saveUpdates(_0x404038[_0xa899('0x51')],null))[_0xa899('0x1c')](respondWithResult(_0x27b7fa,null))[_0xa899('0x26')](handleError(_0x27b7fa,null));};exports[_0xa899('0x53')]=function(_0x14c4a1,_0x26b024){return db[_0xa899('0x4a')][_0xa899('0x52')]({'where':{'id':_0x14c4a1[_0xa899('0x4f')]['id']}})[_0xa899('0x1c')](handleEntityNotFound(_0x26b024,null))[_0xa899('0x1c')](removeEntity(_0x26b024,null))[_0xa899('0x26')](handleError(_0x26b024,null));};exports[_0xa899('0x54')]=function(_0xa7bbd1,_0x344ac8,_0x54a658){var _0x54ee57={};var _0x145503={};var _0x27b921;var _0x5e73ec;return db[_0xa899('0x4a')][_0xa899('0x55')]({'where':{'id':_0xa7bbd1[_0xa899('0x4f')]['id']}})[_0xa899('0x1c')](handleEntityNotFound(_0x344ac8,null))[_0xa899('0x1c')](function(_0x1478bd){if(_0x1478bd){_0x27b921=_0x1478bd;_0x145503[_0xa899('0x36')]=_[_0xa899('0x37')](db[_0xa899('0x56')][_0xa899('0x35')]);_0x145503[_0xa899('0x38')]=_[_0xa899('0x37')](_0xa7bbd1['query']);_0x145503[_0xa899('0x39')]=_[_0xa899('0x3a')](_0x145503[_0xa899('0x36')],_0x145503[_0xa899('0x38')]);_0x54ee57[_0xa899('0x3b')]=_[_0xa899('0x3a')](_0x145503[_0xa899('0x36')],qs[_0xa899('0x3c')](_0xa7bbd1['query'][_0xa899('0x3c')]));_0x54ee57['attributes']=_0x54ee57[_0xa899('0x3b')][_0xa899('0x3d')]?_0x54ee57['attributes']:_0x145503[_0xa899('0x36')];_0x54ee57[_0xa899('0x40')]=qs['sort'](_0xa7bbd1[_0xa899('0x38')][_0xa899('0x41')]);_0x54ee57[_0xa899('0x44')]=qs[_0xa899('0x39')](_[_0xa899('0x42')](_0xa7bbd1[_0xa899('0x38')],_0x145503[_0xa899('0x39')]));if(_0xa7bbd1[_0xa899('0x38')][_0xa899('0x43')]){_0x54ee57[_0xa899('0x44')]=_['merge'](_0x54ee57[_0xa899('0x44')],{'$or':_[_0xa899('0x45')](_0x54ee57[_0xa899('0x3b')],function(_0x2aca2f){var _0xbc959d={};_0xbc959d[_0x2aca2f]={'$like':'%'+_0xa7bbd1['query']['filter']+'%'};return _0xbc959d;})});}_0x54ee57=_['merge']({},_0x54ee57,_0xa7bbd1[_0xa899('0x49')]);return _0x27b921['getConfigurations'](_0x54ee57);}})[_0xa899('0x1c')](function(_0x265ecf){if(_0x265ecf){_0x5e73ec=_0x265ecf['length'];if(!_0xa7bbd1[_0xa899('0x38')][_0xa899('0x3e')](_0xa899('0x3f'))){_0x54ee57[_0xa899('0x2c')]=qs[_0xa899('0x2c')](_0xa7bbd1[_0xa899('0x38')][_0xa899('0x2c')]);_0x54ee57[_0xa899('0x2b')]=qs[_0xa899('0x2b')](_0xa7bbd1[_0xa899('0x38')][_0xa899('0x2b')]);}return _0x27b921[_0xa899('0x54')](_0x54ee57);}})[_0xa899('0x1c')](function(_0x11369b){if(_0x11369b){return _0x11369b?{'count':_0x5e73ec,'rows':_0x11369b}:null;}})[_0xa899('0x1c')](respondWithResult(_0x344ac8,null))[_0xa899('0x26')](handleError(_0x344ac8,null));};exports[_0xa899('0x57')]=function(_0x46f5eb,_0x31f8df,_0x589f60){if(_0x46f5eb[_0xa899('0x51')]['id']){delete _0x46f5eb[_0xa899('0x51')]['id'];}return db[_0xa899('0x4a')][_0xa899('0x55')]({'where':{'id':_0x46f5eb['params']['id']}})[_0xa899('0x1c')](handleEntityNotFound(_0x31f8df,null))[_0xa899('0x1c')](function(_0x380b3c){if(_0x380b3c){_0x46f5eb[_0xa899('0x51')][_0xa899('0x58')]=_0x380b3c['id'];_0x46f5eb['body']['Subjects']=integrations[_0xa899('0x59')](_0x46f5eb[_0xa899('0x51')][_0xa899('0x5a')],_0x46f5eb[_0xa899('0x51')][_0xa899('0x5b')]);_0x46f5eb[_0xa899('0x51')][_0xa899('0x5c')]=integrations[_0xa899('0x5d')](_0x46f5eb[_0xa899('0x51')][_0xa899('0x5a')],_0x46f5eb[_0xa899('0x51')][_0xa899('0x5b')]);return db[_0xa899('0x56')]['create'](_0x46f5eb[_0xa899('0x51')],{'include':[{'model':db['SalesforceField'],'as':_0xa899('0x5e')},{'model':db[_0xa899('0x5f')],'as':'Descriptions'}]});}return null;})[_0xa899('0x1c')](respondWithResult(_0x31f8df,null))[_0xa899('0x26')](handleError(_0x31f8df,null));};exports[_0xa899('0x60')]=function(_0x42940c,_0x52ecb8,_0x47db51){var _0x5125a0;var _0x25e33f='';var _0x3fdde5=_0xa899('0x61');return db[_0xa899('0x4a')][_0xa899('0x55')]({'where':{'id':_0x42940c[_0xa899('0x4f')]['id']},'attributes':['id',_0xa899('0x62'),_0xa899('0x63'),_0xa899('0x64'),'username',_0xa899('0x65'),'securityToken']})[_0xa899('0x1c')](handleEntityNotFound(_0x52ecb8,null))[_0xa899('0x1c')](function(_0x3b65bc){if(_0x3b65bc){_0x25e33f=_0x3b65bc[_0xa899('0x62')];var _0x4d0c94=_0x25e33f[_0xa899('0x66')](-0x1);if(_0x4d0c94==='/'){_0x25e33f=_0x25e33f[_0xa899('0x67')](0x0,_0x25e33f['lastIndexOf'](_0x4d0c94));}_0x5125a0=new jsforce['Connection']({'oauth2':{'loginUrl':_0x25e33f,'clientId':_0x3b65bc[_0xa899('0x63')],'clientSecret':_0x3b65bc[_0xa899('0x64')]}});return _0x5125a0['login'](_0x3b65bc[_0xa899('0x68')],_0x3b65bc['password']['concat'](_0x3b65bc['securityToken']));}})[_0xa899('0x1c')](function(_0x407cbd){if(_0x407cbd){if(!_[_0xa899('0x69')](_0x42940c[_0xa899('0x38')][_0xa899('0x6a')])){_0x3fdde5=_0x42940c[_0xa899('0x38')][_0xa899('0x6a')];}return _0x5125a0[_0xa899('0x6b')](_0x3fdde5)[_0xa899('0x6c')]();}})[_0xa899('0x1c')](function(_0x403dd8){var _0x5ebf0c=[_0xa899('0x6d'),_0xa899('0x6e'),_0xa899('0x6f'),'CallType',_0xa899('0x70'),_0xa899('0x71'),'Status',_0xa899('0x72')];if(!_[_0xa899('0x69')](_0x42940c['query'][_0xa899('0x6a')])&&_0x42940c['query'][_0xa899('0x6a')]===_0xa899('0x73')){_0x5ebf0c=[_0xa899('0x72'),_0xa899('0x74'),_0xa899('0x75'),_0xa899('0x76'),'Priority',_0xa899('0x77'),_0xa899('0x78'),_0xa899('0x79')];}if(_0x403dd8){_['remove'](_0x403dd8[_0xa899('0x3c')],function(_0x412843){return _0x412843[_0xa899('0x7a')]===![]&&!_0x5ebf0c['includes'](_0x412843[_0xa899('0x33')]);});return{'count':_0x403dd8['fields'][_0xa899('0x3d')],'rows':_[_0xa899('0x45')](_0x403dd8[_0xa899('0x3c')],function(_0x4fc16a){return{'id':_0x4fc16a[_0xa899('0x33')],'name':_0x4fc16a[_0xa899('0x7b')],'custom':_0x4fc16a[_0xa899('0x7a')],'options':_0x4fc16a[_0xa899('0x7c')]['length']>0x0?_['map'](_0x4fc16a[_0xa899('0x7c')],function(_0x2b4a58){return{'name':_0x2b4a58[_0xa899('0x7b')],'value':_0x2b4a58[_0xa899('0x7d')]};}):_0x4fc16a[_0xa899('0x5b')]==_0xa899('0x7e')?[{'name':'True','value':_0xa899('0x7f')},{'name':_0xa899('0x80'),'value':_0xa899('0x81')}]:[]};})};}})[_0xa899('0x1c')](respondWithResult(_0x52ecb8,null))['catch'](function(_0x1f99c3){var _0x465a18=_0x42940c[_0xa899('0x38')][_0xa899('0x19')]?0x1f4:_0x1f99c3[_0xa899('0x82')]||0x1f4;logger[_0xa899('0x21')]('getFields,\x20%s,\x20%s,\x20%s',_0xa899('0x60'),_0x465a18,JSON[_0xa899('0x83')](_0x1f99c3));delete _0x1f99c3[_0xa899('0x33')];if(_0x465a18===0x191){_0x465a18=0x190;}_0x52ecb8['status'](_0x465a18)[_0xa899('0x84')](_0x42940c['query']['test']?{'message':_0xa899('0x85'),'statusCode':_0x1f99c3[_0xa899('0x82')]}:_0x1f99c3);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 0ebb149..b3df87b 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 _0x4ded=['path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','define','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x4ded,0x116));var _0xd4de=function(_0x2f5349,_0x141468){_0x2f5349=_0x2f5349-0x0;var _0x56133d=_0x4ded[_0x2f5349];return _0x56133d;};'use strict';var _=require(_0xd4de('0x0'));var util=require(_0xd4de('0x1'));var logger=require(_0xd4de('0x2'))(_0xd4de('0x3'));var moment=require(_0xd4de('0x4'));var BPromise=require(_0xd4de('0x5'));var rp=require(_0xd4de('0x6'));var fs=require('fs');var path=require(_0xd4de('0x7'));var rimraf=require(_0xd4de('0x8'));var config=require(_0xd4de('0x9'));var attributes=require(_0xd4de('0xa'));var integrations=require(_0xd4de('0xb'));module['exports']=function(_0x23e5b9,_0x2433b8){return _0x23e5b9[_0xd4de('0xc')](_0xd4de('0xd'),attributes,{'tableName':_0xd4de('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7072=['util','../../config/logger','api','moment','bluebird','rimraf','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts'];(function(_0x46a8ff,_0x8ecc7c){var _0xaa4c09=function(_0x2ad188){while(--_0x2ad188){_0x46a8ff['push'](_0x46a8ff['shift']());}};_0xaa4c09(++_0x8ecc7c);}(_0x7072,0x138));var _0x2707=function(_0x381589,_0x27a707){_0x381589=_0x381589-0x0;var _0x2a075d=_0x7072[_0x381589];return _0x2a075d;};'use strict';var _=require('lodash');var util=require(_0x2707('0x0'));var logger=require(_0x2707('0x1'))(_0x2707('0x2'));var moment=require(_0x2707('0x3'));var BPromise=require(_0x2707('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2707('0x5'));var config=require('../../config/environment');var attributes=require(_0x2707('0x6'));var integrations=require(_0x2707('0x7'));module[_0x2707('0x8')]=function(_0x194132,_0x2fd8ff){return _0x194132[_0x2707('0x9')](_0x2707('0xa'),attributes,{'tableName':_0x2707('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index b77d28f..a801623 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 _0x4444=['code','message','result','catch','findAll','options','where','attributes','limit','include','map','model','GetSalesforceAccount','ShowSalesforceAccount','SalesforceAccount','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x4444,0x1f1));var _0x4444=function(_0x53be8d,_0x2cb53f){_0x53be8d=_0x53be8d-0x0;var _0x396d2c=_0x4444[_0x53be8d];return _0x396d2c;};'use strict';var _=require(_0x4444('0x0'));var util=require(_0x4444('0x1'));var moment=require(_0x4444('0x2'));var BPromise=require(_0x4444('0x3'));var rs=require(_0x4444('0x4'));var fs=require('fs');var Redis=require(_0x4444('0x5'));var db=require(_0x4444('0x6'))['db'];var utils=require(_0x4444('0x7'));var logger=require(_0x4444('0x8'))(_0x4444('0x9'));var config=require(_0x4444('0xa'));var jayson=require(_0x4444('0xb'));var client=jayson[_0x4444('0xc')][_0x4444('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x53c23f,_0x450378,_0x31410f){return new BPromise(function(_0xfe1a18,_0x5bcfbc){return client[_0x4444('0xe')](_0x53c23f,_0x31410f)[_0x4444('0xf')](function(_0xf267f6){logger[_0x4444('0x10')](_0x4444('0x11'),_0x450378,_0x4444('0x12'));logger[_0x4444('0x13')](_0x4444('0x14'),_0x450378,_0x4444('0x12'),JSON[_0x4444('0x15')](_0xf267f6));if(_0xf267f6[_0x4444('0x16')]){if(_0xf267f6[_0x4444('0x16')][_0x4444('0x17')]===0x1f4){logger[_0x4444('0x16')](_0x4444('0x11'),_0x450378,_0xf267f6[_0x4444('0x16')]['message']);return _0x5bcfbc(_0xf267f6[_0x4444('0x16')][_0x4444('0x18')]);}logger[_0x4444('0x16')](_0x4444('0x11'),_0x450378,_0xf267f6[_0x4444('0x16')]['message']);return _0xfe1a18(_0xf267f6['error'][_0x4444('0x18')]);}else{logger[_0x4444('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x450378,'request\x20sent');_0xfe1a18(_0xf267f6[_0x4444('0x19')][_0x4444('0x18')]);}})[_0x4444('0x1a')](function(_0x4d126c){logger[_0x4444('0x16')](_0x4444('0x11'),_0x450378,_0x4d126c);_0x5bcfbc(_0x4d126c);});});}exports['GetSalesforceAccount']=function(_0x2ea651){var _0x185569=this;return new Promise(function(_0x4099a1,_0x517619){return db['SalesforceAccount'][_0x4444('0x1b')]({'raw':_0x2ea651['options']?_0x2ea651[_0x4444('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x2ea651[_0x4444('0x1c')]?_0x2ea651[_0x4444('0x1c')][_0x4444('0x1d')]||null:null,'attributes':_0x2ea651[_0x4444('0x1c')]?_0x2ea651[_0x4444('0x1c')][_0x4444('0x1e')]||null:null,'limit':_0x2ea651[_0x4444('0x1c')]?_0x2ea651['options'][_0x4444('0x1f')]||null:null,'include':_0x2ea651['options']?_0x2ea651['options'][_0x4444('0x20')]?_[_0x4444('0x21')](_0x2ea651[_0x4444('0x1c')][_0x4444('0x20')],function(_0x2039f4){return{'model':db[_0x2039f4[_0x4444('0x22')]],'as':_0x2039f4['as'],'attributes':_0x2039f4[_0x4444('0x1e')],'include':_0x2039f4[_0x4444('0x20')]?_['map'](_0x2039f4[_0x4444('0x20')],function(_0x2c20f1){return{'model':db[_0x2c20f1[_0x4444('0x22')]],'as':_0x2c20f1['as'],'attributes':_0x2c20f1[_0x4444('0x1e')],'include':_0x2c20f1[_0x4444('0x20')]?_[_0x4444('0x21')](_0x2c20f1[_0x4444('0x20')],function(_0x17f1f7){return{'model':db[_0x17f1f7[_0x4444('0x22')]],'as':_0x17f1f7['as'],'attributes':_0x17f1f7[_0x4444('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4444('0xf')](function(_0x37819d){logger['info']('GetSalesforceAccount',_0x2ea651);logger[_0x4444('0x13')](_0x4444('0x23'),_0x2ea651,JSON[_0x4444('0x15')](_0x37819d));_0x4099a1(_0x37819d);})[_0x4444('0x1a')](function(_0xd5831c){logger[_0x4444('0x16')](_0x4444('0x23'),_0xd5831c[_0x4444('0x18')],_0x2ea651);_0x517619(_0x185569[_0x4444('0x16')](0x1f4,_0xd5831c[_0x4444('0x18')]));});});};exports[_0x4444('0x24')]=function(_0x5c824e){var _0x4a2d61=this;return new Promise(function(_0x5c324c,_0x4967b8){return db[_0x4444('0x25')][_0x4444('0x26')]({'raw':_0x5c824e[_0x4444('0x1c')]?_0x5c824e[_0x4444('0x1c')][_0x4444('0x27')]===undefined?!![]:![]:!![],'where':_0x5c824e['options']?_0x5c824e['options'][_0x4444('0x1d')]||null:null,'attributes':_0x5c824e[_0x4444('0x1c')]?_0x5c824e['options'][_0x4444('0x1e')]||null:null,'include':_0x5c824e[_0x4444('0x1c')]?_0x5c824e[_0x4444('0x1c')][_0x4444('0x20')]?_[_0x4444('0x21')](_0x5c824e[_0x4444('0x1c')][_0x4444('0x20')],function(_0x3b5f3e){return{'model':db[_0x3b5f3e[_0x4444('0x22')]],'as':_0x3b5f3e['as'],'attributes':_0x3b5f3e[_0x4444('0x1e')],'include':_0x3b5f3e[_0x4444('0x20')]?_[_0x4444('0x21')](_0x3b5f3e[_0x4444('0x20')],function(_0x3cd29d){return{'model':db[_0x3cd29d[_0x4444('0x22')]],'as':_0x3cd29d['as'],'attributes':_0x3cd29d['attributes'],'include':_0x3cd29d[_0x4444('0x20')]?_[_0x4444('0x21')](_0x3cd29d[_0x4444('0x20')],function(_0x18948a){return{'model':db[_0x18948a['model']],'as':_0x18948a['as'],'attributes':_0x18948a[_0x4444('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4444('0xf')](function(_0x45354e){logger[_0x4444('0x10')](_0x4444('0x24'),_0x5c824e);logger[_0x4444('0x13')](_0x4444('0x24'),_0x5c824e,JSON[_0x4444('0x15')](_0x45354e));_0x5c324c(_0x45354e);})['catch'](function(_0x4756f5){logger['error'](_0x4444('0x24'),_0x4756f5[_0x4444('0x18')],_0x5c824e);_0x4967b8(_0x4a2d61[_0x4444('0x16')](0x1f4,_0x4756f5[_0x4444('0x18')]));});});}; \ No newline at end of file +var _0x178d=['jayson/promise','client','http','request','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','stringify','ShowSalesforceAccount','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x178d,0x111));var _0xd178=function(_0xcbf980,_0x55f0ba){_0xcbf980=_0xcbf980-0x0;var _0x52102d=_0x178d[_0xcbf980];return _0x52102d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd178('0x0'));var BPromise=require(_0xd178('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd178('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xd178('0x3'));var logger=require(_0xd178('0x4'))(_0xd178('0x5'));var config=require(_0xd178('0x6'));var jayson=require(_0xd178('0x7'));var client=jayson[_0xd178('0x8')][_0xd178('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x25d21f,_0x3e63f8,_0x29fa34){return new BPromise(function(_0xf82208,_0x1a7b05){return client[_0xd178('0xa')](_0x25d21f,_0x29fa34)['then'](function(_0xc9df86){logger[_0xd178('0xb')](_0xd178('0xc'),_0x3e63f8,_0xd178('0xd'));logger[_0xd178('0xe')](_0xd178('0xf'),_0x3e63f8,_0xd178('0xd'),JSON['stringify'](_0xc9df86));if(_0xc9df86[_0xd178('0x10')]){if(_0xc9df86[_0xd178('0x10')][_0xd178('0x11')]===0x1f4){logger[_0xd178('0x10')](_0xd178('0xc'),_0x3e63f8,_0xc9df86[_0xd178('0x10')][_0xd178('0x12')]);return _0x1a7b05(_0xc9df86[_0xd178('0x10')][_0xd178('0x12')]);}logger[_0xd178('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x3e63f8,_0xc9df86[_0xd178('0x10')]['message']);return _0xf82208(_0xc9df86[_0xd178('0x10')][_0xd178('0x12')]);}else{logger[_0xd178('0xb')](_0xd178('0xc'),_0x3e63f8,_0xd178('0xd'));_0xf82208(_0xc9df86[_0xd178('0x13')][_0xd178('0x12')]);}})[_0xd178('0x14')](function(_0x252cb7){logger[_0xd178('0x10')](_0xd178('0xc'),_0x3e63f8,_0x252cb7);_0x1a7b05(_0x252cb7);});});}exports[_0xd178('0x15')]=function(_0x63eeb9){var _0x544069=this;return new Promise(function(_0x2f2132,_0x51f10c){return db[_0xd178('0x16')][_0xd178('0x17')]({'raw':_0x63eeb9[_0xd178('0x18')]?_0x63eeb9['options'][_0xd178('0x19')]===undefined?!![]:![]:!![],'where':_0x63eeb9[_0xd178('0x18')]?_0x63eeb9['options'][_0xd178('0x1a')]||null:null,'attributes':_0x63eeb9[_0xd178('0x18')]?_0x63eeb9[_0xd178('0x18')][_0xd178('0x1b')]||null:null,'limit':_0x63eeb9[_0xd178('0x18')]?_0x63eeb9[_0xd178('0x18')][_0xd178('0x1c')]||null:null,'include':_0x63eeb9[_0xd178('0x18')]?_0x63eeb9[_0xd178('0x18')][_0xd178('0x1d')]?_[_0xd178('0x1e')](_0x63eeb9['options'][_0xd178('0x1d')],function(_0x1c82eb){return{'model':db[_0x1c82eb[_0xd178('0x1f')]],'as':_0x1c82eb['as'],'attributes':_0x1c82eb[_0xd178('0x1b')],'include':_0x1c82eb[_0xd178('0x1d')]?_[_0xd178('0x1e')](_0x1c82eb[_0xd178('0x1d')],function(_0x1c261e){return{'model':db[_0x1c261e[_0xd178('0x1f')]],'as':_0x1c261e['as'],'attributes':_0x1c261e[_0xd178('0x1b')],'include':_0x1c261e['include']?_[_0xd178('0x1e')](_0x1c261e['include'],function(_0x6c4672){return{'model':db[_0x6c4672[_0xd178('0x1f')]],'as':_0x6c4672['as'],'attributes':_0x6c4672['attributes']};}):[]};}):[]};}):[]:[]})[_0xd178('0x20')](function(_0x70a3){logger['info'](_0xd178('0x15'),_0x63eeb9);logger['debug']('GetSalesforceAccount',_0x63eeb9,JSON[_0xd178('0x21')](_0x70a3));_0x2f2132(_0x70a3);})[_0xd178('0x14')](function(_0x201dea){logger[_0xd178('0x10')](_0xd178('0x15'),_0x201dea['message'],_0x63eeb9);_0x51f10c(_0x544069['error'](0x1f4,_0x201dea[_0xd178('0x12')]));});});};exports[_0xd178('0x22')]=function(_0x3a39bb){var _0x34e621=this;return new Promise(function(_0x4fa9cc,_0x48328c){return db[_0xd178('0x16')]['find']({'raw':_0x3a39bb[_0xd178('0x18')]?_0x3a39bb[_0xd178('0x18')][_0xd178('0x19')]===undefined?!![]:![]:!![],'where':_0x3a39bb[_0xd178('0x18')]?_0x3a39bb[_0xd178('0x18')][_0xd178('0x1a')]||null:null,'attributes':_0x3a39bb[_0xd178('0x18')]?_0x3a39bb[_0xd178('0x18')][_0xd178('0x1b')]||null:null,'include':_0x3a39bb[_0xd178('0x18')]?_0x3a39bb[_0xd178('0x18')][_0xd178('0x1d')]?_['map'](_0x3a39bb[_0xd178('0x18')][_0xd178('0x1d')],function(_0x12c79e){return{'model':db[_0x12c79e[_0xd178('0x1f')]],'as':_0x12c79e['as'],'attributes':_0x12c79e[_0xd178('0x1b')],'include':_0x12c79e[_0xd178('0x1d')]?_['map'](_0x12c79e[_0xd178('0x1d')],function(_0x20b117){return{'model':db[_0x20b117['model']],'as':_0x20b117['as'],'attributes':_0x20b117[_0xd178('0x1b')],'include':_0x20b117[_0xd178('0x1d')]?_[_0xd178('0x1e')](_0x20b117[_0xd178('0x1d')],function(_0x515c44){return{'model':db[_0x515c44['model']],'as':_0x515c44['as'],'attributes':_0x515c44[_0xd178('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd178('0x20')](function(_0x12a7e9){logger['info'](_0xd178('0x22'),_0x3a39bb);logger[_0xd178('0xe')](_0xd178('0x22'),_0x3a39bb,JSON['stringify'](_0x12a7e9));_0x4fa9cc(_0x12a7e9);})[_0xd178('0x14')](function(_0x4ec854){logger[_0xd178('0x10')]('ShowSalesforceAccount',_0x4ec854[_0xd178('0x12')],_0x3a39bb);_0x48328c(_0x34e621[_0xd178('0x10')](0x1f4,_0x4ec854[_0xd178('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index eddb66a..c6d747e 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 _0xdd20=['multer','connect-timeout','Router','../../components/interaction/service','./intSalesforceConfiguration.controller','isAuthenticated','index','show','get','getFields','getSubjects','getDescriptions','create','put','/:id','update','delete','exports'];(function(_0x49d693,_0x4d8992){var _0x5008b2=function(_0x982a54){while(--_0x982a54){_0x49d693['push'](_0x49d693['shift']());}};_0x5008b2(++_0x4d8992);}(_0xdd20,0x120));var _0x0dd2=function(_0x6c0596,_0x36dec9){_0x6c0596=_0x6c0596-0x0;var _0xd51cd0=_0xdd20[_0x6c0596];return _0xd51cd0;};'use strict';var multer=require(_0x0dd2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0dd2('0x1'));var express=require('express');var router=express[_0x0dd2('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x0dd2('0x3'));var config=require('../../config/environment');var controller=require(_0x0dd2('0x4'));router['get']('/',auth[_0x0dd2('0x5')](),controller[_0x0dd2('0x6')]);router['get']('/:id',auth[_0x0dd2('0x5')](),controller[_0x0dd2('0x7')]);router[_0x0dd2('0x8')]('/:id/fields',auth[_0x0dd2('0x5')](),controller[_0x0dd2('0x9')]);router[_0x0dd2('0x8')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x0dd2('0xa')]);router[_0x0dd2('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x0dd2('0xb')]);router['post']('/',auth[_0x0dd2('0x5')](),controller[_0x0dd2('0xc')]);router[_0x0dd2('0xd')](_0x0dd2('0xe'),auth[_0x0dd2('0x5')](),controller[_0x0dd2('0xf')]);router[_0x0dd2('0x10')](_0x0dd2('0xe'),auth[_0x0dd2('0x5')](),controller['destroy']);module[_0x0dd2('0x11')]=router; \ No newline at end of file +var _0xf121=['../../config/environment','get','isAuthenticated','index','/:id','getFields','/:id/subjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','multer','util','path','express','../../components/auth/service'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0xf121,0xf2));var _0x1f12=function(_0x526408,_0x585982){_0x526408=_0x526408-0x0;var _0x3f66e3=_0xf121[_0x526408];return _0x3f66e3;};'use strict';var multer=require(_0x1f12('0x0'));var util=require(_0x1f12('0x1'));var path=require(_0x1f12('0x2'));var timeout=require('connect-timeout');var express=require(_0x1f12('0x3'));var router=express['Router']();var auth=require(_0x1f12('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1f12('0x5'));var controller=require('./intSalesforceConfiguration.controller');router[_0x1f12('0x6')]('/',auth[_0x1f12('0x7')](),controller[_0x1f12('0x8')]);router[_0x1f12('0x6')](_0x1f12('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x1f12('0x6')]('/:id/fields',auth['isAuthenticated'](),controller[_0x1f12('0xa')]);router[_0x1f12('0x6')](_0x1f12('0xb'),auth[_0x1f12('0x7')](),controller['getSubjects']);router[_0x1f12('0x6')](_0x1f12('0xc'),auth[_0x1f12('0x7')](),controller[_0x1f12('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1f12('0xe')]);router[_0x1f12('0xf')](_0x1f12('0x9'),auth['isAuthenticated'](),controller[_0x1f12('0x10')]);router[_0x1f12('0x11')](_0x1f12('0x9'),auth[_0x1f12('0x7')](),controller[_0x1f12('0x12')]);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 f4c4010..104260f 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 _0xb1ba=['Case','contact_lead','contact','lead','nothing','sequelize','exports','STRING','ENUM','Task'];(function(_0x31e025,_0x4fb40){var _0x14dc32=function(_0x1cdde9){while(--_0x1cdde9){_0x31e025['push'](_0x31e025['shift']());}};_0x14dc32(++_0x4fb40);}(_0xb1ba,0x1e5));var _0xab1b=function(_0x5e7ab3,_0x27ed0b){_0x5e7ab3=_0x5e7ab3-0x0;var _0x7dde0c=_0xb1ba[_0x5e7ab3];return _0x7dde0c;};'use strict';var Sequelize=require(_0xab1b('0x0'));module[_0xab1b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xab1b('0x2')]},'ticketType':{'type':Sequelize[_0xab1b('0x3')](_0xab1b('0x4'),_0xab1b('0x5')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0xab1b('0x3')](_0xab1b('0x6'),_0xab1b('0x7'),_0xab1b('0x8')),'defaultValue':_0xab1b('0x6')},'moduleCreate':{'type':Sequelize[_0xab1b('0x3')](_0xab1b('0x9'),_0xab1b('0x7'),'lead'),'defaultValue':_0xab1b('0x8')}}; \ No newline at end of file +var _0x3cae=['Task','contact','lead','contact_lead','nothing','sequelize','exports','STRING','ENUM'];(function(_0x489443,_0x429a9e){var _0xfaef0b=function(_0x932797){while(--_0x932797){_0x489443['push'](_0x489443['shift']());}};_0xfaef0b(++_0x429a9e);}(_0x3cae,0x137));var _0xe3ca=function(_0x424501,_0x42096d){_0x424501=_0x424501-0x0;var _0xb719af=_0x3cae[_0x424501];return _0xb719af;};'use strict';var Sequelize=require(_0xe3ca('0x0'));module[_0xe3ca('0x1')]={'name':{'type':Sequelize[_0xe3ca('0x2')]},'description':{'type':Sequelize[_0xe3ca('0x2')]},'ticketType':{'type':Sequelize[_0xe3ca('0x3')]('Task','Case'),'defaultValue':_0xe3ca('0x4')},'moduleSearch':{'type':Sequelize[_0xe3ca('0x3')]('contact_lead',_0xe3ca('0x5'),_0xe3ca('0x6')),'defaultValue':_0xe3ca('0x7')},'moduleCreate':{'type':Sequelize[_0xe3ca('0x3')](_0xe3ca('0x8'),_0xe3ca('0x5'),'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 fefd091..c06953e 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 _0xef14=['rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','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','jayson/promise','client','http','test','request','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','update','stack','name','send','index','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','map','type','field','merge','options','SalesforceConfiguration','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','getFields','findOne','SalesforceField','pick','hasOwnProperty','getSubjects','getDescriptions','html-pdf','eml-format'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xef14,0x172));var _0x4ef1=function(_0xd1bd8c,_0x5818d5){_0xd1bd8c=_0xd1bd8c-0x0;var _0x2f601e=_0xef14[_0xd1bd8c];return _0x2f601e;};'use strict';var pdf=require(_0x4ef1('0x0'));var emlformat=require(_0x4ef1('0x1'));var rimraf=require(_0x4ef1('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4ef1('0x3'));var rp=require(_0x4ef1('0x4'));var moment=require(_0x4ef1('0x5'));var BPromise=require(_0x4ef1('0x6'));var Mustache=require('mustache');var util=require(_0x4ef1('0x7'));var path=require(_0x4ef1('0x8'));var sox=require(_0x4ef1('0x9'));var csv=require('to-csv');var ejs=require(_0x4ef1('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4ef1('0xb'));var crypto=require('crypto');var jsforce=require(_0x4ef1('0xc'));var deskjs=require(_0x4ef1('0xd'));var toCsv=require(_0x4ef1('0xe'));var querystring=require(_0x4ef1('0xf'));var Papa=require(_0x4ef1('0x10'));var Redis=require(_0x4ef1('0x11'));var authService=require(_0x4ef1('0x12'));var qs=require(_0x4ef1('0x13'));var hardwareService=require(_0x4ef1('0x14'));var logger=require(_0x4ef1('0x15'))(_0x4ef1('0x16'));var utils=require(_0x4ef1('0x17'));var config=require(_0x4ef1('0x18'));var db=require(_0x4ef1('0x19'))['db'];var jayson=require(_0x4ef1('0x1a'));var client=jayson[_0x4ef1('0x1b')][_0x4ef1('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x38abfa,_0x40df19,_0x2ed27c){if(_0x2ed27c){var _0x400637=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x400637[_0x4ef1('0x1d')](_0x40df19)){return _0x38abfa;}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 _0x38abfa;}}function respondWithRpcPromise(_0x2101a5,_0x3f9edc,_0x4ca8db,_0x1b6f22){return new BPromise(function(_0x6a5b2b,_0x18154c){var _0x4917da=_0x1b6f22||client;return _0x4917da[_0x4ef1('0x1e')](_0x2101a5,_0x4ca8db)[_0x4ef1('0x1f')](function(_0x305694){logger['info'](_0x4ef1('0x20'),_0x3f9edc,_0x4ef1('0x21'));logger[_0x4ef1('0x22')](_0x4ef1('0x23'),_0x3f9edc,_0x4ef1('0x21'),JSON[_0x4ef1('0x24')](_0x305694));if(_0x305694['error']){if(_0x305694[_0x4ef1('0x25')][_0x4ef1('0x26')]===0x1f4){logger[_0x4ef1('0x25')](_0x4ef1('0x20'),_0x3f9edc,_0x305694[_0x4ef1('0x25')][_0x4ef1('0x27')]);return _0x18154c(_0x305694['error'][_0x4ef1('0x27')]);}logger[_0x4ef1('0x25')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3f9edc,_0x305694['error'][_0x4ef1('0x27')]);return _0x6a5b2b(_0x305694[_0x4ef1('0x25')][_0x4ef1('0x27')]);}else{logger[_0x4ef1('0x28')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3f9edc,_0x4ef1('0x21'));_0x6a5b2b(_0x305694['result']['message']);}})[_0x4ef1('0x29')](function(_0x3e043a){logger[_0x4ef1('0x25')](_0x4ef1('0x20'),_0x3f9edc,_0x3e043a);_0x18154c(_0x3e043a);});});}function respondWithStatusCode(_0x273bbd,_0x2d6942){_0x2d6942=_0x2d6942||0xcc;return function(_0x222631){if(_0x222631){return _0x273bbd[_0x4ef1('0x2a')](_0x2d6942);}return _0x273bbd[_0x4ef1('0x2b')](_0x2d6942)[_0x4ef1('0x2c')]();};}function respondWithResult(_0x24f002,_0x3921b6){_0x3921b6=_0x3921b6||0xc8;return function(_0x47ec0b){if(_0x47ec0b){return _0x24f002[_0x4ef1('0x2b')](_0x3921b6)['json'](_0x47ec0b);}};}function respondWithFilteredResult(_0xc03b6a,_0x52d4b1){return function(_0x2f00f2){if(_0x2f00f2){var _0x3c8bb9=_0x2f00f2[_0x4ef1('0x2d')],_0x2a1702=_0x52d4b1[_0x4ef1('0x2e')],_0xc085b8=_0x52d4b1[_0x4ef1('0x2e')]+_0x52d4b1[_0x4ef1('0x2f')],_0x306266;if(_0xc085b8>=_0x3c8bb9){_0xc085b8=_0x3c8bb9;_0x306266=0xc8;}else{_0x306266=0xce;}_0xc03b6a[_0x4ef1('0x2b')](_0x306266);return _0xc03b6a[_0x4ef1('0x30')](_0x4ef1('0x31'),_0x2a1702+'-'+_0xc085b8+'/'+_0x3c8bb9)['json'](_0x2f00f2);}return null;};}function patchUpdates(_0x679962){return function(_0x572e1d){try{jsonpatch[_0x4ef1('0x32')](_0x572e1d,_0x679962,!![]);}catch(_0x532d81){return BPromise[_0x4ef1('0x33')](_0x532d81);}return _0x572e1d['save']();};}function saveUpdates(_0x2557dc,_0x150905){return function(_0x5abbc3){if(_0x5abbc3){return _0x5abbc3[_0x4ef1('0x34')](_0x2557dc)[_0x4ef1('0x1f')](function(_0x23511e){return _0x23511e;});}return null;};}function removeEntity(_0xde2f3,_0x593895){return function(_0x1d4cc4){if(_0x1d4cc4){return _0x1d4cc4['destroy']()[_0x4ef1('0x1f')](function(){_0xde2f3[_0x4ef1('0x2b')](0xcc)[_0x4ef1('0x2c')]();});}};}function handleEntityNotFound(_0x23aaa4,_0x5aa479){return function(_0xc0fc06){if(!_0xc0fc06){_0x23aaa4[_0x4ef1('0x2a')](0x194);}return _0xc0fc06;};}function handleError(_0x4736be,_0x8561b4){_0x8561b4=_0x8561b4||0x1f4;return function(_0x1ffa36){logger[_0x4ef1('0x25')](_0x1ffa36[_0x4ef1('0x35')]);if(_0x1ffa36[_0x4ef1('0x36')]){delete _0x1ffa36['name'];}_0x4736be[_0x4ef1('0x2b')](_0x8561b4)[_0x4ef1('0x37')](_0x1ffa36);};}exports[_0x4ef1('0x38')]=function(_0x5ac363,_0x2930d3){var _0x30d287={},_0x18e944={},_0x501510={'count':0x0,'rows':[]};var _0x47f647=db['SalesforceConfiguration']['rawAttributes'];_0x18e944[_0x4ef1('0x39')]=_[_0x4ef1('0x3a')](_0x47f647);_0x18e944[_0x4ef1('0x3b')]=_['keys'](_0x5ac363[_0x4ef1('0x3b')]);_0x18e944[_0x4ef1('0x3c')]=_['intersection'](_0x18e944[_0x4ef1('0x39')],_0x18e944[_0x4ef1('0x3b')]);_0x30d287[_0x4ef1('0x3d')]=_[_0x4ef1('0x3e')](_0x18e944[_0x4ef1('0x39')],qs[_0x4ef1('0x3f')](_0x5ac363[_0x4ef1('0x3b')][_0x4ef1('0x3f')]));_0x30d287[_0x4ef1('0x3d')]=_0x30d287['attributes'][_0x4ef1('0x40')]?_0x30d287[_0x4ef1('0x3d')]:_0x18e944[_0x4ef1('0x39')];if(!_0x5ac363[_0x4ef1('0x3b')]['hasOwnProperty'](_0x4ef1('0x41'))){_0x30d287[_0x4ef1('0x2f')]=qs['limit'](_0x5ac363[_0x4ef1('0x3b')][_0x4ef1('0x2f')]);_0x30d287[_0x4ef1('0x2e')]=qs[_0x4ef1('0x2e')](_0x5ac363[_0x4ef1('0x3b')][_0x4ef1('0x2e')]);}_0x30d287[_0x4ef1('0x42')]=qs[_0x4ef1('0x43')](_0x5ac363[_0x4ef1('0x3b')]['sort']);_0x30d287[_0x4ef1('0x44')]=qs['filters'](_['pick'](_0x5ac363['query'],_0x18e944['filters']));if(_0x5ac363['query'][_0x4ef1('0x45')]){_0x30d287['where']=_['merge'](_0x30d287[_0x4ef1('0x44')],{'$or':_[_0x4ef1('0x46')](_0x47f647,function(_0x1c0a0c){if(_0x1c0a0c[_0x4ef1('0x47')]['key']!=='VIRTUAL'){var _0x4b76f3={};_0x4b76f3[_0x1c0a0c[_0x4ef1('0x48')]]={'$like':'%'+_0x5ac363['query'][_0x4ef1('0x45')]+'%'};return _0x4b76f3;}})});}_0x30d287=_[_0x4ef1('0x49')]({},_0x30d287,_0x5ac363[_0x4ef1('0x4a')]);var _0xb9c9cb={'where':_0x30d287[_0x4ef1('0x44')]};return db[_0x4ef1('0x4b')][_0x4ef1('0x2d')](_0xb9c9cb)[_0x4ef1('0x1f')](function(_0x3c78de){_0x501510['count']=_0x3c78de;if(_0x5ac363['query'][_0x4ef1('0x4c')]){_0x30d287[_0x4ef1('0x4d')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x4ef1('0x4e')](_0x30d287);})[_0x4ef1('0x1f')](function(_0x2816b8){_0x501510[_0x4ef1('0x4f')]=_0x2816b8;return _0x501510;})[_0x4ef1('0x1f')](respondWithFilteredResult(_0x2930d3,_0x30d287))[_0x4ef1('0x29')](handleError(_0x2930d3,null));};exports[_0x4ef1('0x50')]=function(_0x31a589,_0xa81248){var _0x32abf7={'raw':![],'where':{'id':_0x31a589[_0x4ef1('0x51')]['id']}},_0x1fa3bc={};_0x1fa3bc[_0x4ef1('0x39')]=_[_0x4ef1('0x3a')](db[_0x4ef1('0x4b')][_0x4ef1('0x52')]);_0x1fa3bc['query']=_[_0x4ef1('0x3a')](_0x31a589['query']);_0x1fa3bc[_0x4ef1('0x3c')]=_[_0x4ef1('0x3e')](_0x1fa3bc[_0x4ef1('0x39')],_0x1fa3bc[_0x4ef1('0x3b')]);_0x32abf7[_0x4ef1('0x3d')]=_[_0x4ef1('0x3e')](_0x1fa3bc[_0x4ef1('0x39')],qs[_0x4ef1('0x3f')](_0x31a589['query'][_0x4ef1('0x3f')]));_0x32abf7[_0x4ef1('0x3d')]=_0x32abf7['attributes'][_0x4ef1('0x40')]?_0x32abf7[_0x4ef1('0x3d')]:_0x1fa3bc[_0x4ef1('0x39')];if(_0x31a589[_0x4ef1('0x3b')][_0x4ef1('0x4c')]){_0x32abf7[_0x4ef1('0x4d')]=[{'all':!![]}];}_0x32abf7=_[_0x4ef1('0x49')]({},_0x32abf7,_0x31a589[_0x4ef1('0x4a')]);return db['SalesforceConfiguration'][_0x4ef1('0x53')](_0x32abf7)[_0x4ef1('0x1f')](handleEntityNotFound(_0xa81248,null))[_0x4ef1('0x1f')](respondWithResult(_0xa81248,null))['catch'](handleError(_0xa81248,null));};exports[_0x4ef1('0x54')]=function(_0x1370bb,_0x2dfdf2){return db[_0x4ef1('0x4b')][_0x4ef1('0x54')](_0x1370bb[_0x4ef1('0x55')],{})[_0x4ef1('0x1f')](respondWithResult(_0x2dfdf2,0xc9))[_0x4ef1('0x29')](handleError(_0x2dfdf2,null));};exports[_0x4ef1('0x34')]=function(_0x3076ab,_0x12a26b){if(_0x3076ab[_0x4ef1('0x55')]['id']){delete _0x3076ab[_0x4ef1('0x55')]['id'];}return db[_0x4ef1('0x4b')]['find']({'where':{'id':_0x3076ab[_0x4ef1('0x51')]['id']}})[_0x4ef1('0x1f')](handleEntityNotFound(_0x12a26b,null))[_0x4ef1('0x1f')](saveUpdates(_0x3076ab['body'],null))['then'](respondWithResult(_0x12a26b,null))[_0x4ef1('0x29')](handleError(_0x12a26b,null));};exports['destroy']=function(_0x199bb5,_0x665427){return db[_0x4ef1('0x4b')][_0x4ef1('0x53')]({'where':{'id':_0x199bb5[_0x4ef1('0x51')]['id']}})['then'](handleEntityNotFound(_0x665427,null))[_0x4ef1('0x1f')](removeEntity(_0x665427,null))[_0x4ef1('0x29')](handleError(_0x665427,null));};exports[_0x4ef1('0x56')]=function(_0xd6cf84,_0x1d4b34,_0x5da115){var _0x5bb143={};var _0xd88108={};var _0x3e01fd;var _0x55b943;return db['SalesforceConfiguration'][_0x4ef1('0x57')]({'where':{'id':_0xd6cf84[_0x4ef1('0x51')]['id']}})['then'](handleEntityNotFound(_0x1d4b34,null))[_0x4ef1('0x1f')](function(_0x3e8f39){if(_0x3e8f39){_0x3e01fd=_0x3e8f39;_0xd88108[_0x4ef1('0x39')]=_['keys'](db[_0x4ef1('0x58')][_0x4ef1('0x52')]);_0xd88108[_0x4ef1('0x3b')]=_['keys'](_0xd6cf84['query']);_0xd88108['filters']=_[_0x4ef1('0x3e')](_0xd88108[_0x4ef1('0x39')],_0xd88108[_0x4ef1('0x3b')]);_0x5bb143[_0x4ef1('0x3d')]=_['intersection'](_0xd88108[_0x4ef1('0x39')],qs['fields'](_0xd6cf84['query']['fields']));_0x5bb143['attributes']=_0x5bb143['attributes']['length']?_0x5bb143['attributes']:_0xd88108[_0x4ef1('0x39')];_0x5bb143[_0x4ef1('0x42')]=qs['sort'](_0xd6cf84[_0x4ef1('0x3b')][_0x4ef1('0x43')]);_0x5bb143['where']=qs[_0x4ef1('0x3c')](_[_0x4ef1('0x59')](_0xd6cf84[_0x4ef1('0x3b')],_0xd88108[_0x4ef1('0x3c')]));if(_0xd6cf84['query'][_0x4ef1('0x45')]){_0x5bb143[_0x4ef1('0x44')]=_[_0x4ef1('0x49')](_0x5bb143['where'],{'$or':_['map'](_0x5bb143[_0x4ef1('0x3d')],function(_0x37a2bb){var _0x5db59a={};_0x5db59a[_0x37a2bb]={'$like':'%'+_0xd6cf84[_0x4ef1('0x3b')][_0x4ef1('0x45')]+'%'};return _0x5db59a;})});}_0x5bb143=_[_0x4ef1('0x49')]({},_0x5bb143,_0xd6cf84['options']);return _0x3e01fd[_0x4ef1('0x56')](_0x5bb143);}})[_0x4ef1('0x1f')](function(_0x5a1599){if(_0x5a1599){_0x55b943=_0x5a1599[_0x4ef1('0x40')];if(!_0xd6cf84[_0x4ef1('0x3b')][_0x4ef1('0x5a')](_0x4ef1('0x41'))){_0x5bb143['limit']=qs[_0x4ef1('0x2f')](_0xd6cf84[_0x4ef1('0x3b')][_0x4ef1('0x2f')]);_0x5bb143[_0x4ef1('0x2e')]=qs[_0x4ef1('0x2e')](_0xd6cf84['query']['offset']);}return _0x3e01fd[_0x4ef1('0x56')](_0x5bb143);}})[_0x4ef1('0x1f')](function(_0x23452d){if(_0x23452d){return _0x23452d?{'count':_0x55b943,'rows':_0x23452d}:null;}})['then'](respondWithResult(_0x1d4b34,null))[_0x4ef1('0x29')](handleError(_0x1d4b34,null));};exports[_0x4ef1('0x5b')]=function(_0x4448d0,_0x1d09f4,_0x50ec41){var _0x270e99={};var _0x329937={};var _0x2cb10e;var _0x238e83;return db['SalesforceConfiguration'][_0x4ef1('0x57')]({'where':{'id':_0x4448d0[_0x4ef1('0x51')]['id']}})['then'](handleEntityNotFound(_0x1d09f4,null))[_0x4ef1('0x1f')](function(_0x1ce9d1){if(_0x1ce9d1){_0x2cb10e=_0x1ce9d1;_0x329937[_0x4ef1('0x39')]=_['keys'](db[_0x4ef1('0x58')][_0x4ef1('0x52')]);_0x329937[_0x4ef1('0x3b')]=_[_0x4ef1('0x3a')](_0x4448d0['query']);_0x329937[_0x4ef1('0x3c')]=_[_0x4ef1('0x3e')](_0x329937[_0x4ef1('0x39')],_0x329937[_0x4ef1('0x3b')]);_0x270e99[_0x4ef1('0x3d')]=_[_0x4ef1('0x3e')](_0x329937[_0x4ef1('0x39')],qs[_0x4ef1('0x3f')](_0x4448d0[_0x4ef1('0x3b')][_0x4ef1('0x3f')]));_0x270e99['attributes']=_0x270e99[_0x4ef1('0x3d')][_0x4ef1('0x40')]?_0x270e99[_0x4ef1('0x3d')]:_0x329937[_0x4ef1('0x39')];_0x270e99[_0x4ef1('0x42')]=qs['sort'](_0x4448d0[_0x4ef1('0x3b')][_0x4ef1('0x43')]);_0x270e99[_0x4ef1('0x44')]=qs[_0x4ef1('0x3c')](_[_0x4ef1('0x59')](_0x4448d0[_0x4ef1('0x3b')],_0x329937[_0x4ef1('0x3c')]));if(_0x4448d0['query'][_0x4ef1('0x45')]){_0x270e99[_0x4ef1('0x44')]=_[_0x4ef1('0x49')](_0x270e99[_0x4ef1('0x44')],{'$or':_[_0x4ef1('0x46')](_0x270e99[_0x4ef1('0x3d')],function(_0x3b318a){var _0x1a6de3={};_0x1a6de3[_0x3b318a]={'$like':'%'+_0x4448d0[_0x4ef1('0x3b')][_0x4ef1('0x45')]+'%'};return _0x1a6de3;})});}_0x270e99=_[_0x4ef1('0x49')]({},_0x270e99,_0x4448d0[_0x4ef1('0x4a')]);return _0x2cb10e['getSubjects'](_0x270e99);}})[_0x4ef1('0x1f')](function(_0x35ae26){if(_0x35ae26){_0x238e83=_0x35ae26['length'];if(!_0x4448d0[_0x4ef1('0x3b')][_0x4ef1('0x5a')](_0x4ef1('0x41'))){_0x270e99[_0x4ef1('0x2f')]=qs[_0x4ef1('0x2f')](_0x4448d0[_0x4ef1('0x3b')][_0x4ef1('0x2f')]);_0x270e99['offset']=qs[_0x4ef1('0x2e')](_0x4448d0[_0x4ef1('0x3b')][_0x4ef1('0x2e')]);}return _0x2cb10e[_0x4ef1('0x5b')](_0x270e99);}})[_0x4ef1('0x1f')](function(_0x26e72c){if(_0x26e72c){return _0x26e72c?{'count':_0x238e83,'rows':_0x26e72c}:null;}})[_0x4ef1('0x1f')](respondWithResult(_0x1d09f4,null))[_0x4ef1('0x29')](handleError(_0x1d09f4,null));};exports[_0x4ef1('0x5c')]=function(_0x121498,_0x3404eb,_0x113d4b){var _0x12d8f8={};var _0x4bdafa={};var _0x3d3082;var _0x5d9dce;return db[_0x4ef1('0x4b')]['findOne']({'where':{'id':_0x121498[_0x4ef1('0x51')]['id']}})[_0x4ef1('0x1f')](handleEntityNotFound(_0x3404eb,null))[_0x4ef1('0x1f')](function(_0x5e958c){if(_0x5e958c){_0x3d3082=_0x5e958c;_0x4bdafa['model']=_[_0x4ef1('0x3a')](db['SalesforceField'][_0x4ef1('0x52')]);_0x4bdafa[_0x4ef1('0x3b')]=_[_0x4ef1('0x3a')](_0x121498[_0x4ef1('0x3b')]);_0x4bdafa[_0x4ef1('0x3c')]=_[_0x4ef1('0x3e')](_0x4bdafa[_0x4ef1('0x39')],_0x4bdafa[_0x4ef1('0x3b')]);_0x12d8f8['attributes']=_[_0x4ef1('0x3e')](_0x4bdafa[_0x4ef1('0x39')],qs[_0x4ef1('0x3f')](_0x121498[_0x4ef1('0x3b')][_0x4ef1('0x3f')]));_0x12d8f8['attributes']=_0x12d8f8[_0x4ef1('0x3d')][_0x4ef1('0x40')]?_0x12d8f8[_0x4ef1('0x3d')]:_0x4bdafa['model'];_0x12d8f8['order']=qs[_0x4ef1('0x43')](_0x121498[_0x4ef1('0x3b')][_0x4ef1('0x43')]);_0x12d8f8[_0x4ef1('0x44')]=qs['filters'](_['pick'](_0x121498[_0x4ef1('0x3b')],_0x4bdafa[_0x4ef1('0x3c')]));if(_0x121498['query'][_0x4ef1('0x45')]){_0x12d8f8[_0x4ef1('0x44')]=_[_0x4ef1('0x49')](_0x12d8f8[_0x4ef1('0x44')],{'$or':_[_0x4ef1('0x46')](_0x12d8f8[_0x4ef1('0x3d')],function(_0x298085){var _0x5f0d8f={};_0x5f0d8f[_0x298085]={'$like':'%'+_0x121498['query'][_0x4ef1('0x45')]+'%'};return _0x5f0d8f;})});}_0x12d8f8=_[_0x4ef1('0x49')]({},_0x12d8f8,_0x121498[_0x4ef1('0x4a')]);return _0x3d3082[_0x4ef1('0x5c')](_0x12d8f8);}})[_0x4ef1('0x1f')](function(_0x1e3807){if(_0x1e3807){_0x5d9dce=_0x1e3807[_0x4ef1('0x40')];if(!_0x121498[_0x4ef1('0x3b')][_0x4ef1('0x5a')](_0x4ef1('0x41'))){_0x12d8f8[_0x4ef1('0x2f')]=qs[_0x4ef1('0x2f')](_0x121498['query'][_0x4ef1('0x2f')]);_0x12d8f8[_0x4ef1('0x2e')]=qs[_0x4ef1('0x2e')](_0x121498[_0x4ef1('0x3b')][_0x4ef1('0x2e')]);}return _0x3d3082[_0x4ef1('0x5c')](_0x12d8f8);}})[_0x4ef1('0x1f')](function(_0x244808){if(_0x244808){return _0x244808?{'count':_0x5d9dce,'rows':_0x244808}:null;}})['then'](respondWithResult(_0x3404eb,null))[_0x4ef1('0x29')](handleError(_0x3404eb,null));}; \ No newline at end of file +var _0x8185=['catch','status','json','count','offset','limit','set','Content-Range','reject','save','end','sendStatus','stack','send','index','rawAttributes','keys','query','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','map','type','VIRTUAL','options','SalesforceConfiguration','includeAll','include','findAll','rows','show','params','find','create','update','body','destroy','findOne','SalesforceField','pick','getFields','hasOwnProperty','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','SalesforceConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message'];(function(_0x24719d,_0x35d4be){var _0xf94a6f=function(_0x4e6796){while(--_0x4e6796){_0x24719d['push'](_0x24719d['shift']());}};_0xf94a6f(++_0x35d4be);}(_0x8185,0xeb));var _0x5818=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x8185[_0x3ab51d];return _0x29a04e;};'use strict';var pdf=require(_0x5818('0x0'));var emlformat=require(_0x5818('0x1'));var rimraf=require(_0x5818('0x2'));var zipdir=require(_0x5818('0x3'));var jsonpatch=require(_0x5818('0x4'));var rp=require('request-promise');var moment=require(_0x5818('0x5'));var BPromise=require(_0x5818('0x6'));var Mustache=require(_0x5818('0x7'));var util=require(_0x5818('0x8'));var path=require(_0x5818('0x9'));var sox=require(_0x5818('0xa'));var csv=require(_0x5818('0xb'));var ejs=require(_0x5818('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5818('0xd'));var crypto=require(_0x5818('0xe'));var jsforce=require(_0x5818('0xf'));var deskjs=require(_0x5818('0x10'));var toCsv=require(_0x5818('0xb'));var querystring=require('querystring');var Papa=require(_0x5818('0x11'));var Redis=require(_0x5818('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x5818('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5818('0x14'))(_0x5818('0x15'));var utils=require(_0x5818('0x16'));var config=require(_0x5818('0x17'));var db=require(_0x5818('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x5818('0x19')][_0x5818('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x34444f,_0x1dd775,_0x180216){if(_0x180216){var _0x3a0ef6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3a0ef6[_0x5818('0x1b')](_0x1dd775)){return _0x34444f;}else{throw new Error(_0x5818('0x1c'));}}else{return _0x34444f;}}function respondWithRpcPromise(_0x336a74,_0x4ad50e,_0x3044a6,_0x13d70f){return new BPromise(function(_0x31ca60,_0x4c2a52){var _0x33ec2f=_0x13d70f||client;return _0x33ec2f['request'](_0x336a74,_0x3044a6)[_0x5818('0x1d')](function(_0x209b5c){logger[_0x5818('0x1e')](_0x5818('0x1f'),_0x4ad50e,'request\x20sent');logger[_0x5818('0x20')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x4ad50e,_0x5818('0x21'),JSON[_0x5818('0x22')](_0x209b5c));if(_0x209b5c[_0x5818('0x23')]){if(_0x209b5c[_0x5818('0x23')][_0x5818('0x24')]===0x1f4){logger[_0x5818('0x23')](_0x5818('0x1f'),_0x4ad50e,_0x209b5c[_0x5818('0x23')][_0x5818('0x25')]);return _0x4c2a52(_0x209b5c[_0x5818('0x23')][_0x5818('0x25')]);}logger[_0x5818('0x23')](_0x5818('0x1f'),_0x4ad50e,_0x209b5c[_0x5818('0x23')][_0x5818('0x25')]);return _0x31ca60(_0x209b5c[_0x5818('0x23')][_0x5818('0x25')]);}else{logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x4ad50e,_0x5818('0x21'));_0x31ca60(_0x209b5c['result'][_0x5818('0x25')]);}})[_0x5818('0x26')](function(_0x574c81){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x4ad50e,_0x574c81);_0x4c2a52(_0x574c81);});});}function respondWithStatusCode(_0x142631,_0x142304){_0x142304=_0x142304||0xcc;return function(_0x558089){if(_0x558089){return _0x142631['sendStatus'](_0x142304);}return _0x142631[_0x5818('0x27')](_0x142304)['end']();};}function respondWithResult(_0x437dec,_0x17d6d4){_0x17d6d4=_0x17d6d4||0xc8;return function(_0x55dfb2){if(_0x55dfb2){return _0x437dec[_0x5818('0x27')](_0x17d6d4)[_0x5818('0x28')](_0x55dfb2);}};}function respondWithFilteredResult(_0x38d2b1,_0x58bc97){return function(_0x3dbd51){if(_0x3dbd51){var _0x210a66=_0x3dbd51[_0x5818('0x29')],_0x45d8ed=_0x58bc97[_0x5818('0x2a')],_0x9ada61=_0x58bc97[_0x5818('0x2a')]+_0x58bc97[_0x5818('0x2b')],_0x1bb54d;if(_0x9ada61>=_0x210a66){_0x9ada61=_0x210a66;_0x1bb54d=0xc8;}else{_0x1bb54d=0xce;}_0x38d2b1['status'](_0x1bb54d);return _0x38d2b1[_0x5818('0x2c')](_0x5818('0x2d'),_0x45d8ed+'-'+_0x9ada61+'/'+_0x210a66)['json'](_0x3dbd51);}return null;};}function patchUpdates(_0x23c0df){return function(_0x181daf){try{jsonpatch['apply'](_0x181daf,_0x23c0df,!![]);}catch(_0x5412c6){return BPromise[_0x5818('0x2e')](_0x5412c6);}return _0x181daf[_0x5818('0x2f')]();};}function saveUpdates(_0x47f70a,_0xa7e03d){return function(_0x54b9a2){if(_0x54b9a2){return _0x54b9a2['update'](_0x47f70a)[_0x5818('0x1d')](function(_0x343cb4){return _0x343cb4;});}return null;};}function removeEntity(_0xe7a0bc,_0x5c505f){return function(_0x378946){if(_0x378946){return _0x378946['destroy']()[_0x5818('0x1d')](function(){_0xe7a0bc[_0x5818('0x27')](0xcc)[_0x5818('0x30')]();});}};}function handleEntityNotFound(_0x3836f7,_0xa79342){return function(_0x501071){if(!_0x501071){_0x3836f7[_0x5818('0x31')](0x194);}return _0x501071;};}function handleError(_0x1dd6a3,_0x3325e1){_0x3325e1=_0x3325e1||0x1f4;return function(_0x4733d2){logger[_0x5818('0x23')](_0x4733d2[_0x5818('0x32')]);if(_0x4733d2['name']){delete _0x4733d2['name'];}_0x1dd6a3['status'](_0x3325e1)[_0x5818('0x33')](_0x4733d2);};}exports[_0x5818('0x34')]=function(_0x509399,_0x21acf9){var _0x2f232a={},_0x3e906c={},_0x202fda={'count':0x0,'rows':[]};var _0x6ab26d=db['SalesforceConfiguration'][_0x5818('0x35')];_0x3e906c['model']=_[_0x5818('0x36')](_0x6ab26d);_0x3e906c['query']=_['keys'](_0x509399[_0x5818('0x37')]);_0x3e906c['filters']=_[_0x5818('0x38')](_0x3e906c[_0x5818('0x39')],_0x3e906c[_0x5818('0x37')]);_0x2f232a[_0x5818('0x3a')]=_['intersection'](_0x3e906c[_0x5818('0x39')],qs[_0x5818('0x3b')](_0x509399[_0x5818('0x37')]['fields']));_0x2f232a[_0x5818('0x3a')]=_0x2f232a[_0x5818('0x3a')][_0x5818('0x3c')]?_0x2f232a[_0x5818('0x3a')]:_0x3e906c[_0x5818('0x39')];if(!_0x509399[_0x5818('0x37')]['hasOwnProperty'](_0x5818('0x3d'))){_0x2f232a['limit']=qs['limit'](_0x509399[_0x5818('0x37')][_0x5818('0x2b')]);_0x2f232a[_0x5818('0x2a')]=qs[_0x5818('0x2a')](_0x509399[_0x5818('0x37')][_0x5818('0x2a')]);}_0x2f232a[_0x5818('0x3e')]=qs[_0x5818('0x3f')](_0x509399[_0x5818('0x37')]['sort']);_0x2f232a[_0x5818('0x40')]=qs[_0x5818('0x41')](_['pick'](_0x509399[_0x5818('0x37')],_0x3e906c[_0x5818('0x41')]));if(_0x509399['query'][_0x5818('0x42')]){_0x2f232a['where']=_[_0x5818('0x43')](_0x2f232a[_0x5818('0x40')],{'$or':_[_0x5818('0x44')](_0x6ab26d,function(_0x5f3069){if(_0x5f3069[_0x5818('0x45')]['key']!==_0x5818('0x46')){var _0x514923={};_0x514923[_0x5f3069['field']]={'$like':'%'+_0x509399['query']['filter']+'%'};return _0x514923;}})});}_0x2f232a=_['merge']({},_0x2f232a,_0x509399[_0x5818('0x47')]);var _0x3f0c75={'where':_0x2f232a[_0x5818('0x40')]};return db[_0x5818('0x48')][_0x5818('0x29')](_0x3f0c75)['then'](function(_0xc29d86){_0x202fda[_0x5818('0x29')]=_0xc29d86;if(_0x509399['query'][_0x5818('0x49')]){_0x2f232a[_0x5818('0x4a')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x5818('0x4b')](_0x2f232a);})[_0x5818('0x1d')](function(_0x32f3c4){_0x202fda[_0x5818('0x4c')]=_0x32f3c4;return _0x202fda;})[_0x5818('0x1d')](respondWithFilteredResult(_0x21acf9,_0x2f232a))[_0x5818('0x26')](handleError(_0x21acf9,null));};exports[_0x5818('0x4d')]=function(_0x5abb86,_0x154240){var _0x310c6e={'raw':![],'where':{'id':_0x5abb86[_0x5818('0x4e')]['id']}},_0x2ec6b4={};_0x2ec6b4['model']=_[_0x5818('0x36')](db[_0x5818('0x48')]['rawAttributes']);_0x2ec6b4['query']=_[_0x5818('0x36')](_0x5abb86[_0x5818('0x37')]);_0x2ec6b4[_0x5818('0x41')]=_[_0x5818('0x38')](_0x2ec6b4[_0x5818('0x39')],_0x2ec6b4['query']);_0x310c6e['attributes']=_[_0x5818('0x38')](_0x2ec6b4[_0x5818('0x39')],qs[_0x5818('0x3b')](_0x5abb86[_0x5818('0x37')]['fields']));_0x310c6e['attributes']=_0x310c6e['attributes']['length']?_0x310c6e[_0x5818('0x3a')]:_0x2ec6b4[_0x5818('0x39')];if(_0x5abb86[_0x5818('0x37')]['includeAll']){_0x310c6e[_0x5818('0x4a')]=[{'all':!![]}];}_0x310c6e=_[_0x5818('0x43')]({},_0x310c6e,_0x5abb86[_0x5818('0x47')]);return db[_0x5818('0x48')][_0x5818('0x4f')](_0x310c6e)[_0x5818('0x1d')](handleEntityNotFound(_0x154240,null))[_0x5818('0x1d')](respondWithResult(_0x154240,null))['catch'](handleError(_0x154240,null));};exports[_0x5818('0x50')]=function(_0x475ce4,_0x42eba2){return db[_0x5818('0x48')][_0x5818('0x50')](_0x475ce4['body'],{})[_0x5818('0x1d')](respondWithResult(_0x42eba2,0xc9))['catch'](handleError(_0x42eba2,null));};exports[_0x5818('0x51')]=function(_0x338565,_0x334bf9){if(_0x338565['body']['id']){delete _0x338565[_0x5818('0x52')]['id'];}return db['SalesforceConfiguration']['find']({'where':{'id':_0x338565[_0x5818('0x4e')]['id']}})[_0x5818('0x1d')](handleEntityNotFound(_0x334bf9,null))[_0x5818('0x1d')](saveUpdates(_0x338565[_0x5818('0x52')],null))[_0x5818('0x1d')](respondWithResult(_0x334bf9,null))['catch'](handleError(_0x334bf9,null));};exports[_0x5818('0x53')]=function(_0x5a9896,_0x4a54d4){return db[_0x5818('0x48')][_0x5818('0x4f')]({'where':{'id':_0x5a9896['params']['id']}})[_0x5818('0x1d')](handleEntityNotFound(_0x4a54d4,null))[_0x5818('0x1d')](removeEntity(_0x4a54d4,null))[_0x5818('0x26')](handleError(_0x4a54d4,null));};exports['getFields']=function(_0x475d10,_0x16b09e,_0x1f0022){var _0x14bef2={};var _0x599204={};var _0x3ad18d;var _0x1e0644;return db[_0x5818('0x48')][_0x5818('0x54')]({'where':{'id':_0x475d10[_0x5818('0x4e')]['id']}})[_0x5818('0x1d')](handleEntityNotFound(_0x16b09e,null))[_0x5818('0x1d')](function(_0x2b7541){if(_0x2b7541){_0x3ad18d=_0x2b7541;_0x599204[_0x5818('0x39')]=_['keys'](db[_0x5818('0x55')][_0x5818('0x35')]);_0x599204[_0x5818('0x37')]=_[_0x5818('0x36')](_0x475d10[_0x5818('0x37')]);_0x599204[_0x5818('0x41')]=_[_0x5818('0x38')](_0x599204[_0x5818('0x39')],_0x599204[_0x5818('0x37')]);_0x14bef2['attributes']=_[_0x5818('0x38')](_0x599204[_0x5818('0x39')],qs[_0x5818('0x3b')](_0x475d10[_0x5818('0x37')][_0x5818('0x3b')]));_0x14bef2[_0x5818('0x3a')]=_0x14bef2[_0x5818('0x3a')][_0x5818('0x3c')]?_0x14bef2[_0x5818('0x3a')]:_0x599204['model'];_0x14bef2['order']=qs['sort'](_0x475d10[_0x5818('0x37')][_0x5818('0x3f')]);_0x14bef2[_0x5818('0x40')]=qs[_0x5818('0x41')](_[_0x5818('0x56')](_0x475d10[_0x5818('0x37')],_0x599204[_0x5818('0x41')]));if(_0x475d10['query'][_0x5818('0x42')]){_0x14bef2['where']=_['merge'](_0x14bef2[_0x5818('0x40')],{'$or':_['map'](_0x14bef2[_0x5818('0x3a')],function(_0x3bb9dc){var _0x36240c={};_0x36240c[_0x3bb9dc]={'$like':'%'+_0x475d10[_0x5818('0x37')][_0x5818('0x42')]+'%'};return _0x36240c;})});}_0x14bef2=_[_0x5818('0x43')]({},_0x14bef2,_0x475d10['options']);return _0x3ad18d[_0x5818('0x57')](_0x14bef2);}})[_0x5818('0x1d')](function(_0x3efcd2){if(_0x3efcd2){_0x1e0644=_0x3efcd2[_0x5818('0x3c')];if(!_0x475d10[_0x5818('0x37')][_0x5818('0x58')](_0x5818('0x3d'))){_0x14bef2[_0x5818('0x2b')]=qs['limit'](_0x475d10[_0x5818('0x37')][_0x5818('0x2b')]);_0x14bef2[_0x5818('0x2a')]=qs[_0x5818('0x2a')](_0x475d10[_0x5818('0x37')][_0x5818('0x2a')]);}return _0x3ad18d[_0x5818('0x57')](_0x14bef2);}})[_0x5818('0x1d')](function(_0x27eed4){if(_0x27eed4){return _0x27eed4?{'count':_0x1e0644,'rows':_0x27eed4}:null;}})[_0x5818('0x1d')](respondWithResult(_0x16b09e,null))[_0x5818('0x26')](handleError(_0x16b09e,null));};exports[_0x5818('0x59')]=function(_0x595d82,_0x112360,_0x177ced){var _0x3acb2d={};var _0x398ee7={};var _0xbdfc84;var _0x44daf7;return db['SalesforceConfiguration'][_0x5818('0x54')]({'where':{'id':_0x595d82[_0x5818('0x4e')]['id']}})[_0x5818('0x1d')](handleEntityNotFound(_0x112360,null))[_0x5818('0x1d')](function(_0x51fcec){if(_0x51fcec){_0xbdfc84=_0x51fcec;_0x398ee7['model']=_['keys'](db[_0x5818('0x55')]['rawAttributes']);_0x398ee7['query']=_[_0x5818('0x36')](_0x595d82[_0x5818('0x37')]);_0x398ee7['filters']=_[_0x5818('0x38')](_0x398ee7['model'],_0x398ee7[_0x5818('0x37')]);_0x3acb2d[_0x5818('0x3a')]=_[_0x5818('0x38')](_0x398ee7[_0x5818('0x39')],qs[_0x5818('0x3b')](_0x595d82[_0x5818('0x37')][_0x5818('0x3b')]));_0x3acb2d[_0x5818('0x3a')]=_0x3acb2d['attributes'][_0x5818('0x3c')]?_0x3acb2d[_0x5818('0x3a')]:_0x398ee7['model'];_0x3acb2d[_0x5818('0x3e')]=qs[_0x5818('0x3f')](_0x595d82['query'][_0x5818('0x3f')]);_0x3acb2d['where']=qs[_0x5818('0x41')](_[_0x5818('0x56')](_0x595d82['query'],_0x398ee7[_0x5818('0x41')]));if(_0x595d82[_0x5818('0x37')][_0x5818('0x42')]){_0x3acb2d[_0x5818('0x40')]=_[_0x5818('0x43')](_0x3acb2d['where'],{'$or':_['map'](_0x3acb2d[_0x5818('0x3a')],function(_0x3e4841){var _0x49ec7e={};_0x49ec7e[_0x3e4841]={'$like':'%'+_0x595d82['query'][_0x5818('0x42')]+'%'};return _0x49ec7e;})});}_0x3acb2d=_['merge']({},_0x3acb2d,_0x595d82[_0x5818('0x47')]);return _0xbdfc84[_0x5818('0x59')](_0x3acb2d);}})[_0x5818('0x1d')](function(_0x37511c){if(_0x37511c){_0x44daf7=_0x37511c[_0x5818('0x3c')];if(!_0x595d82[_0x5818('0x37')][_0x5818('0x58')](_0x5818('0x3d'))){_0x3acb2d[_0x5818('0x2b')]=qs[_0x5818('0x2b')](_0x595d82[_0x5818('0x37')]['limit']);_0x3acb2d['offset']=qs[_0x5818('0x2a')](_0x595d82['query'][_0x5818('0x2a')]);}return _0xbdfc84[_0x5818('0x59')](_0x3acb2d);}})['then'](function(_0x13189c){if(_0x13189c){return _0x13189c?{'count':_0x44daf7,'rows':_0x13189c}:null;}})[_0x5818('0x1d')](respondWithResult(_0x112360,null))[_0x5818('0x26')](handleError(_0x112360,null));};exports[_0x5818('0x5a')]=function(_0x13b2c,_0x1fae2c,_0x535065){var _0x3f81b1={};var _0x20a4b4={};var _0xe7b60e;var _0x57a390;return db[_0x5818('0x48')]['findOne']({'where':{'id':_0x13b2c[_0x5818('0x4e')]['id']}})[_0x5818('0x1d')](handleEntityNotFound(_0x1fae2c,null))[_0x5818('0x1d')](function(_0x333655){if(_0x333655){_0xe7b60e=_0x333655;_0x20a4b4[_0x5818('0x39')]=_['keys'](db[_0x5818('0x55')][_0x5818('0x35')]);_0x20a4b4[_0x5818('0x37')]=_[_0x5818('0x36')](_0x13b2c[_0x5818('0x37')]);_0x20a4b4[_0x5818('0x41')]=_[_0x5818('0x38')](_0x20a4b4[_0x5818('0x39')],_0x20a4b4[_0x5818('0x37')]);_0x3f81b1['attributes']=_[_0x5818('0x38')](_0x20a4b4['model'],qs[_0x5818('0x3b')](_0x13b2c[_0x5818('0x37')][_0x5818('0x3b')]));_0x3f81b1[_0x5818('0x3a')]=_0x3f81b1[_0x5818('0x3a')][_0x5818('0x3c')]?_0x3f81b1[_0x5818('0x3a')]:_0x20a4b4[_0x5818('0x39')];_0x3f81b1[_0x5818('0x3e')]=qs[_0x5818('0x3f')](_0x13b2c[_0x5818('0x37')][_0x5818('0x3f')]);_0x3f81b1[_0x5818('0x40')]=qs[_0x5818('0x41')](_[_0x5818('0x56')](_0x13b2c['query'],_0x20a4b4[_0x5818('0x41')]));if(_0x13b2c[_0x5818('0x37')][_0x5818('0x42')]){_0x3f81b1[_0x5818('0x40')]=_[_0x5818('0x43')](_0x3f81b1[_0x5818('0x40')],{'$or':_['map'](_0x3f81b1[_0x5818('0x3a')],function(_0xecb48e){var _0x19e888={};_0x19e888[_0xecb48e]={'$like':'%'+_0x13b2c[_0x5818('0x37')]['filter']+'%'};return _0x19e888;})});}_0x3f81b1=_[_0x5818('0x43')]({},_0x3f81b1,_0x13b2c[_0x5818('0x47')]);return _0xe7b60e[_0x5818('0x5a')](_0x3f81b1);}})['then'](function(_0x1ac8ec){if(_0x1ac8ec){_0x57a390=_0x1ac8ec[_0x5818('0x3c')];if(!_0x13b2c[_0x5818('0x37')][_0x5818('0x58')]('nolimit')){_0x3f81b1[_0x5818('0x2b')]=qs[_0x5818('0x2b')](_0x13b2c[_0x5818('0x37')][_0x5818('0x2b')]);_0x3f81b1[_0x5818('0x2a')]=qs[_0x5818('0x2a')](_0x13b2c[_0x5818('0x37')][_0x5818('0x2a')]);}return _0xe7b60e['getDescriptions'](_0x3f81b1);}})[_0x5818('0x1d')](function(_0x42cff5){if(_0x42cff5){return _0x42cff5?{'count':_0x57a390,'rows':_0x42cff5}:null;}})[_0x5818('0x1d')](respondWithResult(_0x1fae2c,null))[_0x5818('0x26')](handleError(_0x1fae2c,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 0cdc72e..0eb9d01 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 _0x8661=['lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','define','SalesforceConfiguration','int_salesforce_configurations'];(function(_0x5057b6,_0x48fd8b){var _0x2d7dba=function(_0x3197b4){while(--_0x3197b4){_0x5057b6['push'](_0x5057b6['shift']());}};_0x2d7dba(++_0x48fd8b);}(_0x8661,0x6c));var _0x1866=function(_0x4edca6,_0x50fbd6){_0x4edca6=_0x4edca6-0x0;var _0x493733=_0x8661[_0x4edca6];return _0x493733;};'use strict';var _=require(_0x1866('0x0'));var util=require('util');var logger=require(_0x1866('0x1'))(_0x1866('0x2'));var moment=require('moment');var BPromise=require(_0x1866('0x3'));var rp=require(_0x1866('0x4'));var fs=require('fs');var path=require(_0x1866('0x5'));var rimraf=require(_0x1866('0x6'));var config=require(_0x1866('0x7'));var attributes=require(_0x1866('0x8'));module['exports']=function(_0x3fa739,_0x1662db){return _0x3fa739[_0x1866('0x9')](_0x1866('0xa'),attributes,{'tableName':_0x1866('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf765=['../../config/logger','api','moment','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','define','SalesforceConfiguration','int_salesforce_configurations','util'];(function(_0x99fba,_0x4d6591){var _0x1bab3b=function(_0x1faecb){while(--_0x1faecb){_0x99fba['push'](_0x99fba['shift']());}};_0x1bab3b(++_0x4d6591);}(_0xf765,0xe6));var _0x5f76=function(_0x4ac0ea,_0x568d67){_0x4ac0ea=_0x4ac0ea-0x0;var _0x5b5b53=_0xf765[_0x4ac0ea];return _0x5b5b53;};'use strict';var _=require('lodash');var util=require(_0x5f76('0x0'));var logger=require(_0x5f76('0x1'))(_0x5f76('0x2'));var moment=require(_0x5f76('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5f76('0x4'));var rimraf=require(_0x5f76('0x5'));var config=require(_0x5f76('0x6'));var attributes=require(_0x5f76('0x7'));module['exports']=function(_0x40c085,_0x59dab3){return _0x40c085[_0x5f76('0x8')](_0x5f76('0x9'),attributes,{'tableName':_0x5f76('0xa'),'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 6a2c98a..d51cd5d 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(_0xb54b31,_0x4ac97c){var _0x49d88b=function(_0x3da58a){while(--_0x3da58a){_0xb54b31['push'](_0xb54b31['shift']());}};_0x49d88b(++_0x4ac97c);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0xc4aa[_0x21549c];return _0x426cbd;};'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(_0x3c512a,_0x4a4e25){var _0x3567ad=function(_0x52d41b){while(--_0x52d41b){_0x3c512a['push'](_0x3c512a['shift']());}};_0x3567ad(++_0x4a4e25);}(_0x5fc3,0xa8));var _0x35fc=function(_0x22bee0,_0x412ecb){_0x22bee0=_0x22bee0-0x0;var _0x2d295b=_0x5fc3[_0x22bee0];return _0x2d295b;};'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 3c85b49..9b337f8 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 _0x1693=['get','isAuthenticated','index','post','create','put','/:id','delete','multer','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller'];(function(_0x32f250,_0x1fbca3){var _0x39ead3=function(_0x7e79d6){while(--_0x7e79d6){_0x32f250['push'](_0x32f250['shift']());}};_0x39ead3(++_0x1fbca3);}(_0x1693,0x152));var _0x3169=function(_0xfedc72,_0x292f02){_0xfedc72=_0xfedc72-0x0;var _0x2c7c78=_0x1693[_0xfedc72];return _0x2c7c78;};'use strict';var multer=require(_0x3169('0x0'));var util=require('util');var path=require(_0x3169('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3169('0x2')]();var auth=require(_0x3169('0x3'));var interaction=require(_0x3169('0x4'));var config=require(_0x3169('0x5'));var controller=require(_0x3169('0x6'));router[_0x3169('0x7')]('/',auth[_0x3169('0x8')](),controller[_0x3169('0x9')]);router[_0x3169('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x3169('0xa')]('/',auth[_0x3169('0x8')](),controller[_0x3169('0xb')]);router[_0x3169('0xc')](_0x3169('0xd'),auth[_0x3169('0x8')](),controller['update']);router[_0x3169('0xe')](_0x3169('0xd'),auth[_0x3169('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1ffd=['isAuthenticated','index','/:id','show','post','create','put','update','exports','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','get'];(function(_0x3176bf,_0x4e6834){var _0x355328=function(_0x27ae38){while(--_0x27ae38){_0x3176bf['push'](_0x3176bf['shift']());}};_0x355328(++_0x4e6834);}(_0x1ffd,0x1e9));var _0xd1ff=function(_0xe5a68d,_0x5b8ec6){_0xe5a68d=_0xe5a68d-0x0;var _0x288d6b=_0x1ffd[_0xe5a68d];return _0x288d6b;};'use strict';var multer=require(_0xd1ff('0x0'));var util=require(_0xd1ff('0x1'));var path=require(_0xd1ff('0x2'));var timeout=require(_0xd1ff('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xd1ff('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd1ff('0x5'));var controller=require('./intSalesforceField.controller');router[_0xd1ff('0x6')]('/',auth[_0xd1ff('0x7')](),controller[_0xd1ff('0x8')]);router[_0xd1ff('0x6')](_0xd1ff('0x9'),auth[_0xd1ff('0x7')](),controller[_0xd1ff('0xa')]);router[_0xd1ff('0xb')]('/',auth[_0xd1ff('0x7')](),controller[_0xd1ff('0xc')]);router[_0xd1ff('0xd')](_0xd1ff('0x9'),auth['isAuthenticated'](),controller[_0xd1ff('0xe')]);router['delete'](_0xd1ff('0x9'),auth[_0xd1ff('0x7')](),controller['destroy']);module[_0xd1ff('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 659945f..55ab3b7 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 _0xb3b4=['exports','ENUM','string','variable','customVariable','keyValue','STRING','sequelize'];(function(_0x406bc8,_0x26f161){var _0x416b5e=function(_0x3811a2){while(--_0x3811a2){_0x406bc8['push'](_0x406bc8['shift']());}};_0x416b5e(++_0x26f161);}(_0xb3b4,0xa7));var _0x4b3b=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xb3b4[_0x3b5250];return _0xc844a1;};'use strict';var Sequelize=require(_0x4b3b('0x0'));module[_0x4b3b('0x1')]={'type':{'type':Sequelize[_0x4b3b('0x2')](_0x4b3b('0x3'),_0x4b3b('0x4'),_0x4b3b('0x5'),_0x4b3b('0x6')),'defaultValue':_0x4b3b('0x3')},'content':{'type':Sequelize[_0x4b3b('0x7')]},'key':{'type':Sequelize[_0x4b3b('0x7')]},'keyType':{'type':Sequelize[_0x4b3b('0x2')](_0x4b3b('0x3'),_0x4b3b('0x4'),_0x4b3b('0x5'))},'keyContent':{'type':Sequelize[_0x4b3b('0x7')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x4b3b('0x7')]}}; \ No newline at end of file +var _0x0f63=['STRING','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x5de424,_0x50958f){var _0x46fd64=function(_0x15c1f9){while(--_0x15c1f9){_0x5de424['push'](_0x5de424['shift']());}};_0x46fd64(++_0x50958f);}(_0x0f63,0xe9));var _0x30f6=function(_0x29e98c,_0x1c27e5){_0x29e98c=_0x29e98c-0x0;var _0x2f4083=_0x0f63[_0x29e98c];return _0x2f4083;};'use strict';var Sequelize=require(_0x30f6('0x0'));module[_0x30f6('0x1')]={'type':{'type':Sequelize[_0x30f6('0x2')](_0x30f6('0x3'),_0x30f6('0x4'),_0x30f6('0x5'),_0x30f6('0x6')),'defaultValue':_0x30f6('0x3')},'content':{'type':Sequelize[_0x30f6('0x7')]},'key':{'type':Sequelize[_0x30f6('0x7')]},'keyType':{'type':Sequelize[_0x30f6('0x2')](_0x30f6('0x3'),_0x30f6('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x30f6('0x7')]},'idField':{'type':Sequelize[_0x30f6('0x7')]},'variableName':{'type':Sequelize[_0x30f6('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 215b9ba..f3985ef 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 _0xcf71=['Content-Range','apply','save','update','then','end','sendStatus','stack','name','send','index','SalesforceField','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','map','type','key','VIRTUAL','field','includeAll','include','findAll','catch','show','params','options','find','create','body','destroy','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','set'];(function(_0x32d274,_0x4dc070){var _0x1de9e1=function(_0x408dd4){while(--_0x408dd4){_0x32d274['push'](_0x32d274['shift']());}};_0x1de9e1(++_0x4dc070);}(_0xcf71,0xba));var _0x1cf7=function(_0x2bb787,_0x41bf02){_0x2bb787=_0x2bb787-0x0;var _0x425b33=_0xcf71[_0x2bb787];return _0x425b33;};'use strict';var pdf=require(_0x1cf7('0x0'));var emlformat=require(_0x1cf7('0x1'));var rimraf=require(_0x1cf7('0x2'));var zipdir=require(_0x1cf7('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1cf7('0x4'));var moment=require(_0x1cf7('0x5'));var BPromise=require(_0x1cf7('0x6'));var Mustache=require(_0x1cf7('0x7'));var util=require(_0x1cf7('0x8'));var path=require(_0x1cf7('0x9'));var sox=require(_0x1cf7('0xa'));var csv=require(_0x1cf7('0xb'));var ejs=require(_0x1cf7('0xc'));var fs=require('fs');var _=require(_0x1cf7('0xd'));var squel=require(_0x1cf7('0xe'));var crypto=require(_0x1cf7('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1cf7('0xb'));var querystring=require(_0x1cf7('0x10'));var Papa=require(_0x1cf7('0x11'));var Redis=require('ioredis');var authService=require(_0x1cf7('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1cf7('0x13'))(_0x1cf7('0x14'));var utils=require(_0x1cf7('0x15'));var config=require(_0x1cf7('0x16'));var db=require(_0x1cf7('0x17'))['db'];function respondWithStatusCode(_0x114592,_0x5d0d31){_0x5d0d31=_0x5d0d31||0xcc;return function(_0x18dc3b){if(_0x18dc3b){return _0x114592['sendStatus'](_0x5d0d31);}return _0x114592[_0x1cf7('0x18')](_0x5d0d31)['end']();};}function respondWithResult(_0x4021b4,_0x3cf70d){_0x3cf70d=_0x3cf70d||0xc8;return function(_0x5a1b77){if(_0x5a1b77){return _0x4021b4[_0x1cf7('0x18')](_0x3cf70d)[_0x1cf7('0x19')](_0x5a1b77);}};}function respondWithFilteredResult(_0x317d9e,_0x23c951){return function(_0x1bab03){if(_0x1bab03){var _0x43d6e=_0x1bab03[_0x1cf7('0x1a')],_0x769ee3=_0x23c951[_0x1cf7('0x1b')],_0x172915=_0x23c951[_0x1cf7('0x1b')]+_0x23c951[_0x1cf7('0x1c')],_0x17cec6;if(_0x172915>=_0x43d6e){_0x172915=_0x43d6e;_0x17cec6=0xc8;}else{_0x17cec6=0xce;}_0x317d9e['status'](_0x17cec6);return _0x317d9e[_0x1cf7('0x1d')](_0x1cf7('0x1e'),_0x769ee3+'-'+_0x172915+'/'+_0x43d6e)[_0x1cf7('0x19')](_0x1bab03);}return null;};}function patchUpdates(_0x502516){return function(_0x447a75){try{jsonpatch[_0x1cf7('0x1f')](_0x447a75,_0x502516,!![]);}catch(_0xf1a5ba){return BPromise['reject'](_0xf1a5ba);}return _0x447a75[_0x1cf7('0x20')]();};}function saveUpdates(_0x2cf1ca,_0xa1cad3){return function(_0x37fc26){if(_0x37fc26){return _0x37fc26[_0x1cf7('0x21')](_0x2cf1ca)[_0x1cf7('0x22')](function(_0x3ad138){return _0x3ad138;});}return null;};}function removeEntity(_0x693b8e,_0xa12f8a){return function(_0x256151){if(_0x256151){return _0x256151['destroy']()[_0x1cf7('0x22')](function(){_0x693b8e[_0x1cf7('0x18')](0xcc)[_0x1cf7('0x23')]();});}};}function handleEntityNotFound(_0x1f293c,_0x7baff3){return function(_0x1c9100){if(!_0x1c9100){_0x1f293c[_0x1cf7('0x24')](0x194);}return _0x1c9100;};}function handleError(_0x112ea2,_0x5174d4){_0x5174d4=_0x5174d4||0x1f4;return function(_0x48f834){logger['error'](_0x48f834[_0x1cf7('0x25')]);if(_0x48f834['name']){delete _0x48f834[_0x1cf7('0x26')];}_0x112ea2[_0x1cf7('0x18')](_0x5174d4)[_0x1cf7('0x27')](_0x48f834);};}exports[_0x1cf7('0x28')]=function(_0x4dcf35,_0x5077f6){var _0xecdbbb={},_0x4273de={},_0x1a9b20={'count':0x0,'rows':[]};var _0x43b316=db[_0x1cf7('0x29')][_0x1cf7('0x2a')];_0x4273de[_0x1cf7('0x2b')]=_[_0x1cf7('0x2c')](_0x43b316);_0x4273de[_0x1cf7('0x2d')]=_['keys'](_0x4dcf35[_0x1cf7('0x2d')]);_0x4273de[_0x1cf7('0x2e')]=_[_0x1cf7('0x2f')](_0x4273de[_0x1cf7('0x2b')],_0x4273de[_0x1cf7('0x2d')]);_0xecdbbb[_0x1cf7('0x30')]=_[_0x1cf7('0x2f')](_0x4273de[_0x1cf7('0x2b')],qs['fields'](_0x4dcf35['query'][_0x1cf7('0x31')]));_0xecdbbb[_0x1cf7('0x30')]=_0xecdbbb[_0x1cf7('0x30')][_0x1cf7('0x32')]?_0xecdbbb[_0x1cf7('0x30')]:_0x4273de['model'];if(!_0x4dcf35[_0x1cf7('0x2d')]['hasOwnProperty'](_0x1cf7('0x33'))){_0xecdbbb[_0x1cf7('0x1c')]=qs['limit'](_0x4dcf35[_0x1cf7('0x2d')][_0x1cf7('0x1c')]);_0xecdbbb[_0x1cf7('0x1b')]=qs[_0x1cf7('0x1b')](_0x4dcf35[_0x1cf7('0x2d')][_0x1cf7('0x1b')]);}_0xecdbbb['order']=qs[_0x1cf7('0x34')](_0x4dcf35['query']['sort']);_0xecdbbb[_0x1cf7('0x35')]=qs[_0x1cf7('0x2e')](_[_0x1cf7('0x36')](_0x4dcf35[_0x1cf7('0x2d')],_0x4273de[_0x1cf7('0x2e')]));if(_0x4dcf35[_0x1cf7('0x2d')]['filter']){_0xecdbbb['where']=_[_0x1cf7('0x37')](_0xecdbbb[_0x1cf7('0x35')],{'$or':_[_0x1cf7('0x38')](_0x43b316,function(_0x46a3ac){if(_0x46a3ac[_0x1cf7('0x39')][_0x1cf7('0x3a')]!==_0x1cf7('0x3b')){var _0xb39bbf={};_0xb39bbf[_0x46a3ac[_0x1cf7('0x3c')]]={'$like':'%'+_0x4dcf35[_0x1cf7('0x2d')]['filter']+'%'};return _0xb39bbf;}})});}_0xecdbbb=_[_0x1cf7('0x37')]({},_0xecdbbb,_0x4dcf35['options']);var _0x2ca673={'where':_0xecdbbb[_0x1cf7('0x35')]};return db['SalesforceField']['count'](_0x2ca673)['then'](function(_0x500b4d){_0x1a9b20[_0x1cf7('0x1a')]=_0x500b4d;if(_0x4dcf35[_0x1cf7('0x2d')][_0x1cf7('0x3d')]){_0xecdbbb[_0x1cf7('0x3e')]=[{'all':!![]}];}return db[_0x1cf7('0x29')][_0x1cf7('0x3f')](_0xecdbbb);})[_0x1cf7('0x22')](function(_0x7cfd70){_0x1a9b20['rows']=_0x7cfd70;return _0x1a9b20;})[_0x1cf7('0x22')](respondWithFilteredResult(_0x5077f6,_0xecdbbb))[_0x1cf7('0x40')](handleError(_0x5077f6,null));};exports[_0x1cf7('0x41')]=function(_0x35a4e2,_0x1460e8){var _0x24100d={'raw':!![],'where':{'id':_0x35a4e2[_0x1cf7('0x42')]['id']}},_0x3c8dba={};_0x3c8dba[_0x1cf7('0x2b')]=_[_0x1cf7('0x2c')](db[_0x1cf7('0x29')][_0x1cf7('0x2a')]);_0x3c8dba[_0x1cf7('0x2d')]=_['keys'](_0x35a4e2[_0x1cf7('0x2d')]);_0x3c8dba[_0x1cf7('0x2e')]=_[_0x1cf7('0x2f')](_0x3c8dba[_0x1cf7('0x2b')],_0x3c8dba['query']);_0x24100d[_0x1cf7('0x30')]=_['intersection'](_0x3c8dba[_0x1cf7('0x2b')],qs[_0x1cf7('0x31')](_0x35a4e2[_0x1cf7('0x2d')][_0x1cf7('0x31')]));_0x24100d[_0x1cf7('0x30')]=_0x24100d[_0x1cf7('0x30')][_0x1cf7('0x32')]?_0x24100d[_0x1cf7('0x30')]:_0x3c8dba['model'];if(_0x35a4e2[_0x1cf7('0x2d')][_0x1cf7('0x3d')]){_0x24100d[_0x1cf7('0x3e')]=[{'all':!![]}];}_0x24100d=_[_0x1cf7('0x37')]({},_0x24100d,_0x35a4e2[_0x1cf7('0x43')]);return db[_0x1cf7('0x29')][_0x1cf7('0x44')](_0x24100d)[_0x1cf7('0x22')](handleEntityNotFound(_0x1460e8,null))[_0x1cf7('0x22')](respondWithResult(_0x1460e8,null))['catch'](handleError(_0x1460e8,null));};exports[_0x1cf7('0x45')]=function(_0x29d2a3,_0x9bc249){return db['SalesforceField'][_0x1cf7('0x45')](_0x29d2a3[_0x1cf7('0x46')],{})[_0x1cf7('0x22')](respondWithResult(_0x9bc249,0xc9))[_0x1cf7('0x40')](handleError(_0x9bc249,null));};exports[_0x1cf7('0x21')]=function(_0x3a3add,_0x1c51de){if(_0x3a3add[_0x1cf7('0x46')]['id']){delete _0x3a3add['body']['id'];}return db[_0x1cf7('0x29')][_0x1cf7('0x44')]({'where':{'id':_0x3a3add[_0x1cf7('0x42')]['id']}})[_0x1cf7('0x22')](handleEntityNotFound(_0x1c51de,null))[_0x1cf7('0x22')](saveUpdates(_0x3a3add[_0x1cf7('0x46')],null))[_0x1cf7('0x22')](respondWithResult(_0x1c51de,null))[_0x1cf7('0x40')](handleError(_0x1c51de,null));};exports[_0x1cf7('0x47')]=function(_0x4f27fc,_0xa608b6){return db[_0x1cf7('0x29')]['find']({'where':{'id':_0x4f27fc[_0x1cf7('0x42')]['id']}})[_0x1cf7('0x22')](handleEntityNotFound(_0xa608b6,null))[_0x1cf7('0x22')](removeEntity(_0xa608b6,null))[_0x1cf7('0x40')](handleError(_0xa608b6,null));}; \ No newline at end of file +var _0x3561=['catch','show','find','create','body','params','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','rawAttributes','model','keys','query','intersection','fields','attributes','length','nolimit','order','where','filters','pick','filter','merge','map','key','options','SalesforceField','includeAll','include','findAll','rows'];(function(_0x2e3a63,_0x4cc56b){var _0x37c543=function(_0x257dbc){while(--_0x257dbc){_0x2e3a63['push'](_0x2e3a63['shift']());}};_0x37c543(++_0x4cc56b);}(_0x3561,0x94));var _0x1356=function(_0x1522e4,_0x28b7aa){_0x1522e4=_0x1522e4-0x0;var _0x783142=_0x3561[_0x1522e4];return _0x783142;};'use strict';var pdf=require(_0x1356('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1356('0x1'));var zipdir=require(_0x1356('0x2'));var jsonpatch=require(_0x1356('0x3'));var rp=require(_0x1356('0x4'));var moment=require(_0x1356('0x5'));var BPromise=require(_0x1356('0x6'));var Mustache=require(_0x1356('0x7'));var util=require(_0x1356('0x8'));var path=require(_0x1356('0x9'));var sox=require(_0x1356('0xa'));var csv=require(_0x1356('0xb'));var ejs=require(_0x1356('0xc'));var fs=require('fs');var _=require(_0x1356('0xd'));var squel=require('squel');var crypto=require(_0x1356('0xe'));var jsforce=require(_0x1356('0xf'));var deskjs=require(_0x1356('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1356('0x11'));var Redis=require(_0x1356('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x1356('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1356('0x14'))(_0x1356('0x15'));var utils=require('../../config/utils');var config=require(_0x1356('0x16'));var db=require(_0x1356('0x17'))['db'];function respondWithStatusCode(_0x58b39e,_0x405e5c){_0x405e5c=_0x405e5c||0xcc;return function(_0x457d18){if(_0x457d18){return _0x58b39e[_0x1356('0x18')](_0x405e5c);}return _0x58b39e[_0x1356('0x19')](_0x405e5c)[_0x1356('0x1a')]();};}function respondWithResult(_0x107080,_0x70c471){_0x70c471=_0x70c471||0xc8;return function(_0x3c8b32){if(_0x3c8b32){return _0x107080[_0x1356('0x19')](_0x70c471)[_0x1356('0x1b')](_0x3c8b32);}};}function respondWithFilteredResult(_0x396402,_0xdeeff2){return function(_0x58975b){if(_0x58975b){var _0x47a952=_0x58975b[_0x1356('0x1c')],_0x593f6d=_0xdeeff2['offset'],_0x61991a=_0xdeeff2[_0x1356('0x1d')]+_0xdeeff2[_0x1356('0x1e')],_0x3c2adc;if(_0x61991a>=_0x47a952){_0x61991a=_0x47a952;_0x3c2adc=0xc8;}else{_0x3c2adc=0xce;}_0x396402[_0x1356('0x19')](_0x3c2adc);return _0x396402[_0x1356('0x1f')](_0x1356('0x20'),_0x593f6d+'-'+_0x61991a+'/'+_0x47a952)[_0x1356('0x1b')](_0x58975b);}return null;};}function patchUpdates(_0x459836){return function(_0x210b85){try{jsonpatch[_0x1356('0x21')](_0x210b85,_0x459836,!![]);}catch(_0x370a91){return BPromise[_0x1356('0x22')](_0x370a91);}return _0x210b85[_0x1356('0x23')]();};}function saveUpdates(_0x1915b5,_0x54c1a6){return function(_0x368fea){if(_0x368fea){return _0x368fea['update'](_0x1915b5)[_0x1356('0x24')](function(_0x57b864){return _0x57b864;});}return null;};}function removeEntity(_0x420dd6,_0x36adc3){return function(_0x2f1581){if(_0x2f1581){return _0x2f1581[_0x1356('0x25')]()[_0x1356('0x24')](function(){_0x420dd6[_0x1356('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x89a76d,_0x2c26be){return function(_0x53eca1){if(!_0x53eca1){_0x89a76d[_0x1356('0x18')](0x194);}return _0x53eca1;};}function handleError(_0x13d30b,_0x3ed9bb){_0x3ed9bb=_0x3ed9bb||0x1f4;return function(_0x56c0de){logger[_0x1356('0x26')](_0x56c0de[_0x1356('0x27')]);if(_0x56c0de[_0x1356('0x28')]){delete _0x56c0de[_0x1356('0x28')];}_0x13d30b['status'](_0x3ed9bb)['send'](_0x56c0de);};}exports[_0x1356('0x29')]=function(_0x50a4b6,_0x9961c3){var _0x3967f9={},_0x210f88={},_0x3035eb={'count':0x0,'rows':[]};var _0x39796b=db['SalesforceField'][_0x1356('0x2a')];_0x210f88[_0x1356('0x2b')]=_[_0x1356('0x2c')](_0x39796b);_0x210f88[_0x1356('0x2d')]=_[_0x1356('0x2c')](_0x50a4b6[_0x1356('0x2d')]);_0x210f88['filters']=_[_0x1356('0x2e')](_0x210f88['model'],_0x210f88[_0x1356('0x2d')]);_0x3967f9['attributes']=_['intersection'](_0x210f88[_0x1356('0x2b')],qs[_0x1356('0x2f')](_0x50a4b6['query'][_0x1356('0x2f')]));_0x3967f9[_0x1356('0x30')]=_0x3967f9[_0x1356('0x30')][_0x1356('0x31')]?_0x3967f9[_0x1356('0x30')]:_0x210f88[_0x1356('0x2b')];if(!_0x50a4b6[_0x1356('0x2d')]['hasOwnProperty'](_0x1356('0x32'))){_0x3967f9[_0x1356('0x1e')]=qs[_0x1356('0x1e')](_0x50a4b6[_0x1356('0x2d')]['limit']);_0x3967f9[_0x1356('0x1d')]=qs[_0x1356('0x1d')](_0x50a4b6[_0x1356('0x2d')][_0x1356('0x1d')]);}_0x3967f9[_0x1356('0x33')]=qs['sort'](_0x50a4b6[_0x1356('0x2d')]['sort']);_0x3967f9[_0x1356('0x34')]=qs[_0x1356('0x35')](_[_0x1356('0x36')](_0x50a4b6[_0x1356('0x2d')],_0x210f88[_0x1356('0x35')]));if(_0x50a4b6[_0x1356('0x2d')][_0x1356('0x37')]){_0x3967f9['where']=_[_0x1356('0x38')](_0x3967f9[_0x1356('0x34')],{'$or':_[_0x1356('0x39')](_0x39796b,function(_0x2d23ed){if(_0x2d23ed['type'][_0x1356('0x3a')]!=='VIRTUAL'){var _0x464c66={};_0x464c66[_0x2d23ed['field']]={'$like':'%'+_0x50a4b6[_0x1356('0x2d')][_0x1356('0x37')]+'%'};return _0x464c66;}})});}_0x3967f9=_['merge']({},_0x3967f9,_0x50a4b6[_0x1356('0x3b')]);var _0x58cce3={'where':_0x3967f9[_0x1356('0x34')]};return db[_0x1356('0x3c')][_0x1356('0x1c')](_0x58cce3)[_0x1356('0x24')](function(_0x4e9523){_0x3035eb[_0x1356('0x1c')]=_0x4e9523;if(_0x50a4b6['query'][_0x1356('0x3d')]){_0x3967f9[_0x1356('0x3e')]=[{'all':!![]}];}return db[_0x1356('0x3c')][_0x1356('0x3f')](_0x3967f9);})[_0x1356('0x24')](function(_0x1dd99e){_0x3035eb[_0x1356('0x40')]=_0x1dd99e;return _0x3035eb;})[_0x1356('0x24')](respondWithFilteredResult(_0x9961c3,_0x3967f9))[_0x1356('0x41')](handleError(_0x9961c3,null));};exports[_0x1356('0x42')]=function(_0x2e237e,_0x3459e2){var _0x467c11={'raw':!![],'where':{'id':_0x2e237e['params']['id']}},_0x1262ac={};_0x1262ac[_0x1356('0x2b')]=_[_0x1356('0x2c')](db[_0x1356('0x3c')][_0x1356('0x2a')]);_0x1262ac[_0x1356('0x2d')]=_[_0x1356('0x2c')](_0x2e237e[_0x1356('0x2d')]);_0x1262ac[_0x1356('0x35')]=_['intersection'](_0x1262ac['model'],_0x1262ac[_0x1356('0x2d')]);_0x467c11[_0x1356('0x30')]=_['intersection'](_0x1262ac[_0x1356('0x2b')],qs[_0x1356('0x2f')](_0x2e237e[_0x1356('0x2d')][_0x1356('0x2f')]));_0x467c11[_0x1356('0x30')]=_0x467c11[_0x1356('0x30')][_0x1356('0x31')]?_0x467c11[_0x1356('0x30')]:_0x1262ac['model'];if(_0x2e237e[_0x1356('0x2d')]['includeAll']){_0x467c11[_0x1356('0x3e')]=[{'all':!![]}];}_0x467c11=_[_0x1356('0x38')]({},_0x467c11,_0x2e237e[_0x1356('0x3b')]);return db[_0x1356('0x3c')][_0x1356('0x43')](_0x467c11)['then'](handleEntityNotFound(_0x3459e2,null))['then'](respondWithResult(_0x3459e2,null))[_0x1356('0x41')](handleError(_0x3459e2,null));};exports[_0x1356('0x44')]=function(_0x416708,_0x28fbcf){return db[_0x1356('0x3c')][_0x1356('0x44')](_0x416708['body'],{})[_0x1356('0x24')](respondWithResult(_0x28fbcf,0xc9))['catch'](handleError(_0x28fbcf,null));};exports['update']=function(_0x1d6fe6,_0xa578fb){if(_0x1d6fe6[_0x1356('0x45')]['id']){delete _0x1d6fe6[_0x1356('0x45')]['id'];}return db['SalesforceField'][_0x1356('0x43')]({'where':{'id':_0x1d6fe6[_0x1356('0x46')]['id']}})[_0x1356('0x24')](handleEntityNotFound(_0xa578fb,null))[_0x1356('0x24')](saveUpdates(_0x1d6fe6['body'],null))['then'](respondWithResult(_0xa578fb,null))[_0x1356('0x41')](handleError(_0xa578fb,null));};exports[_0x1356('0x25')]=function(_0xdc6522,_0x2beee2){return db[_0x1356('0x3c')][_0x1356('0x43')]({'where':{'id':_0xdc6522['params']['id']}})[_0x1356('0x24')](handleEntityNotFound(_0x2beee2,null))[_0x1356('0x24')](removeEntity(_0x2beee2,null))['catch'](handleError(_0x2beee2,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index b191172..14f9bac 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 _0xcee2=['bluebird','path','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger','moment'];(function(_0x1953d4,_0x297703){var _0x9904dc=function(_0x37a67d){while(--_0x37a67d){_0x1953d4['push'](_0x1953d4['shift']());}};_0x9904dc(++_0x297703);}(_0xcee2,0x173));var _0x2cee=function(_0x513bbc,_0x49cdae){_0x513bbc=_0x513bbc-0x0;var _0x2476e5=_0xcee2[_0x513bbc];return _0x2476e5;};'use strict';var _=require(_0x2cee('0x0'));var util=require(_0x2cee('0x1'));var logger=require(_0x2cee('0x2'))('api');var moment=require(_0x2cee('0x3'));var BPromise=require(_0x2cee('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2cee('0x5'));var rimraf=require('rimraf');var config=require(_0x2cee('0x6'));var attributes=require(_0x2cee('0x7'));module[_0x2cee('0x8')]=function(_0x31cefb,_0x2233f9){return _0x31cefb[_0x2cee('0x9')](_0x2cee('0xa'),attributes,{'tableName':_0x2cee('0xb'),'paranoid':![],'indexes':[{'name':_0x2cee('0xc'),'fields':[_0x2cee('0xd'),_0x2cee('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0c49=['api','bluebird','path','rimraf','../../config/environment','./intSalesforceField.attributes','define','int_salesforce_fields','salesforce_unique_index','idField','util'];(function(_0x374bca,_0x18a6c4){var _0x30a661=function(_0x57be9a){while(--_0x57be9a){_0x374bca['push'](_0x374bca['shift']());}};_0x30a661(++_0x18a6c4);}(_0x0c49,0x1cd));var _0x90c4=function(_0x3b2b47,_0x57e294){_0x3b2b47=_0x3b2b47-0x0;var _0xbd6f5=_0x0c49[_0x3b2b47];return _0xbd6f5;};'use strict';var _=require('lodash');var util=require(_0x90c4('0x0'));var logger=require('../../config/logger')(_0x90c4('0x1'));var moment=require('moment');var BPromise=require(_0x90c4('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x90c4('0x3'));var rimraf=require(_0x90c4('0x4'));var config=require(_0x90c4('0x5'));var attributes=require(_0x90c4('0x6'));module['exports']=function(_0x248e51,_0x299d9f){return _0x248e51[_0x90c4('0x7')]('SalesforceField',attributes,{'tableName':_0x90c4('0x8'),'paranoid':![],'indexes':[{'name':_0x90c4('0x9'),'fields':[_0x90c4('0xa'),'FieldId'],'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 fda2bd5..4560915 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 _0xdfd0=['client','http','request','then','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x49db54,_0x2e5078){var _0x3aa16e=function(_0x144dae){while(--_0x144dae){_0x49db54['push'](_0x49db54['shift']());}};_0x3aa16e(++_0x2e5078);}(_0xdfd0,0x1dc));var _0x0dfd=function(_0x9dcf4a,_0x12400d){_0x9dcf4a=_0x9dcf4a-0x0;var _0x30469c=_0xdfd0[_0x9dcf4a];return _0x30469c;};'use strict';var _=require(_0x0dfd('0x0'));var util=require(_0x0dfd('0x1'));var moment=require(_0x0dfd('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0dfd('0x3'))['db'];var utils=require(_0x0dfd('0x4'));var logger=require(_0x0dfd('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0dfd('0x6'));var client=jayson[_0x0dfd('0x7')][_0x0dfd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x330c7f,_0x390da5,_0x4c85dd){return new BPromise(function(_0x44ad95,_0x2feb1e){return client[_0x0dfd('0x9')](_0x330c7f,_0x4c85dd)[_0x0dfd('0xa')](function(_0x18a772){logger['info'](_0x0dfd('0xb'),_0x390da5,_0x0dfd('0xc'));logger[_0x0dfd('0xd')](_0x0dfd('0xe'),_0x390da5,'request\x20sent',JSON[_0x0dfd('0xf')](_0x18a772));if(_0x18a772[_0x0dfd('0x10')]){if(_0x18a772[_0x0dfd('0x10')][_0x0dfd('0x11')]===0x1f4){logger[_0x0dfd('0x10')](_0x0dfd('0xb'),_0x390da5,_0x18a772[_0x0dfd('0x10')]['message']);return _0x2feb1e(_0x18a772[_0x0dfd('0x10')][_0x0dfd('0x12')]);}logger[_0x0dfd('0x10')](_0x0dfd('0xb'),_0x390da5,_0x18a772[_0x0dfd('0x10')][_0x0dfd('0x12')]);return _0x44ad95(_0x18a772['error'][_0x0dfd('0x12')]);}else{logger[_0x0dfd('0x13')](_0x0dfd('0xb'),_0x390da5,_0x0dfd('0xc'));_0x44ad95(_0x18a772[_0x0dfd('0x14')][_0x0dfd('0x12')]);}})['catch'](function(_0x3aff7f){logger[_0x0dfd('0x10')](_0x0dfd('0xb'),_0x390da5,_0x3aff7f);_0x2feb1e(_0x3aff7f);});});} \ No newline at end of file +var _0x9415=['util','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','info','SalesforceField,\x20%s,\x20%s','debug','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash'];(function(_0x3f962c,_0x472ebe){var _0x5424be=function(_0x501933){while(--_0x501933){_0x3f962c['push'](_0x3f962c['shift']());}};_0x5424be(++_0x472ebe);}(_0x9415,0x1ed));var _0x5941=function(_0x48d776,_0xb7dfa1){_0x48d776=_0x48d776-0x0;var _0x4973d7=_0x9415[_0x48d776];return _0x4973d7;};'use strict';var _=require(_0x5941('0x0'));var util=require(_0x5941('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5941('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5941('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x5941('0x4'))('rpc');var config=require(_0x5941('0x5'));var jayson=require(_0x5941('0x6'));var client=jayson[_0x5941('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xbd278d,_0x197745,_0x4701ad){return new BPromise(function(_0x3dd3fb,_0x2efb85){return client[_0x5941('0x8')](_0xbd278d,_0x4701ad)['then'](function(_0x3c68eb){logger[_0x5941('0x9')](_0x5941('0xa'),_0x197745,'request\x20sent');logger[_0x5941('0xb')](_0x5941('0xc'),_0x197745,_0x5941('0xd'),JSON[_0x5941('0xe')](_0x3c68eb));if(_0x3c68eb[_0x5941('0xf')]){if(_0x3c68eb[_0x5941('0xf')][_0x5941('0x10')]===0x1f4){logger[_0x5941('0xf')]('SalesforceField,\x20%s,\x20%s',_0x197745,_0x3c68eb[_0x5941('0xf')][_0x5941('0x11')]);return _0x2efb85(_0x3c68eb['error'][_0x5941('0x11')]);}logger[_0x5941('0xf')](_0x5941('0xa'),_0x197745,_0x3c68eb[_0x5941('0xf')][_0x5941('0x11')]);return _0x3dd3fb(_0x3c68eb[_0x5941('0xf')][_0x5941('0x11')]);}else{logger[_0x5941('0x9')](_0x5941('0xa'),_0x197745,'request\x20sent');_0x3dd3fb(_0x3c68eb['result'][_0x5941('0x11')]);}})[_0x5941('0x12')](function(_0x157e75){logger[_0x5941('0xf')]('SalesforceField,\x20%s,\x20%s',_0x197745,_0x157e75);_0x2efb85(_0x157e75);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index f4f67b4..7bd864a 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 _0x7759=['/:id','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x7759,0x80));var _0x9775=function(_0x44fc9d,_0x2bd9b5){_0x44fc9d=_0x44fc9d-0x0;var _0x4cc6d9=_0x7759[_0x44fc9d];return _0x4cc6d9;};'use strict';var multer=require(_0x9775('0x0'));var util=require(_0x9775('0x1'));var path=require('path');var timeout=require(_0x9775('0x2'));var express=require(_0x9775('0x3'));var router=express[_0x9775('0x4')]();var auth=require(_0x9775('0x5'));var interaction=require(_0x9775('0x6'));var config=require(_0x9775('0x7'));var controller=require('./intServicenowAccount.controller');router[_0x9775('0x8')]('/',auth['isAuthenticated'](),controller[_0x9775('0x9')]);router['get']('/:id',auth[_0x9775('0xa')](),controller[_0x9775('0xb')]);router[_0x9775('0x8')](_0x9775('0xc'),auth[_0x9775('0xa')](),controller[_0x9775('0xd')]);router[_0x9775('0x8')](_0x9775('0xe'),auth['isAuthenticated'](),controller[_0x9775('0xf')]);router[_0x9775('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9775('0x10')](_0x9775('0xc'),auth['isAuthenticated'](),controller[_0x9775('0x11')]);router[_0x9775('0x12')](_0x9775('0x13'),auth[_0x9775('0xa')](),controller['update']);router['delete'](_0x9775('0x13'),auth[_0x9775('0xa')](),controller['destroy']);module[_0x9775('0x14')]=router; \ No newline at end of file +var _0xae1a=['/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated'];(function(_0x1b037,_0x2b3ee8){var _0x2ae3cb=function(_0x307071){while(--_0x307071){_0x1b037['push'](_0x1b037['shift']());}};_0x2ae3cb(++_0x2b3ee8);}(_0xae1a,0xa3));var _0xaae1=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xae1a[_0x491a7f];return _0x3d8f44;};'use strict';var multer=require(_0xaae1('0x0'));var util=require(_0xaae1('0x1'));var path=require(_0xaae1('0x2'));var timeout=require(_0xaae1('0x3'));var express=require(_0xaae1('0x4'));var router=express[_0xaae1('0x5')]();var auth=require(_0xaae1('0x6'));var interaction=require(_0xaae1('0x7'));var config=require(_0xaae1('0x8'));var controller=require(_0xaae1('0x9'));router[_0xaae1('0xa')]('/',auth[_0xaae1('0xb')](),controller['index']);router[_0xaae1('0xa')](_0xaae1('0xc'),auth['isAuthenticated'](),controller[_0xaae1('0xd')]);router[_0xaae1('0xa')]('/:id/configurations',auth[_0xaae1('0xb')](),controller[_0xaae1('0xe')]);router[_0xaae1('0xa')](_0xaae1('0xf'),auth[_0xaae1('0xb')](),controller[_0xaae1('0x10')]);router[_0xaae1('0x11')]('/',auth[_0xaae1('0xb')](),controller[_0xaae1('0x12')]);router[_0xaae1('0x11')](_0xaae1('0x13'),auth[_0xaae1('0xb')](),controller[_0xaae1('0x14')]);router['put'](_0xaae1('0xc'),auth[_0xaae1('0xb')](),controller[_0xaae1('0x15')]);router[_0xaae1('0x16')](_0xaae1('0xc'),auth[_0xaae1('0xb')](),controller[_0xaae1('0x17')]);module[_0xaae1('0x18')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 1e9160a..58297ea 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 _0x153f=['exports','STRING','username','sequelize'];(function(_0x131585,_0x1abd33){var _0x1fcca2=function(_0x8f165b){while(--_0x8f165b){_0x131585['push'](_0x131585['shift']());}};_0x1fcca2(++_0x1abd33);}(_0x153f,0x15b));var _0xf153=function(_0x47db56,_0x4ca912){_0x47db56=_0x47db56-0x0;var _0x3e47e1=_0x153f[_0x47db56];return _0x3e47e1;};'use strict';var Sequelize=require(_0xf153('0x0'));module[_0xf153('0x1')]={'name':{'type':Sequelize[_0xf153('0x2')]},'description':{'type':Sequelize[_0xf153('0x2')]},'username':{'type':Sequelize[_0xf153('0x2')],'unique':_0xf153('0x3')},'password':{'type':Sequelize[_0xf153('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xf153('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xf153('0x2')]}}; \ No newline at end of file +var _0xf109=['STRING','remoteUri','sequelize','exports'];(function(_0x54b6e1,_0x24f643){var _0x447a8a=function(_0x254266){while(--_0x254266){_0x54b6e1['push'](_0x54b6e1['shift']());}};_0x447a8a(++_0x24f643);}(_0xf109,0xce));var _0x9f10=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0xf109[_0x2261ce];return _0x524640;};'use strict';var Sequelize=require(_0x9f10('0x0'));module[_0x9f10('0x1')]={'name':{'type':Sequelize[_0x9f10('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0x9f10('0x2')]},'email':{'type':Sequelize[_0x9f10('0x2')]},'remoteUri':{'type':Sequelize[_0x9f10('0x2')],'unique':_0x9f10('0x3')},'serverUrl':{'type':Sequelize[_0x9f10('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 648085b..06c7c4e 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 _0xead2=['remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','password','GET','log','incident\x20table\x20objects','assign','includes','forEach','internalType','label','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','push','all','ServiceNow\x20error:\x20','test','statusCode','send','Wrong\x20credentials','boolean','true','False','false','inactive','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','ServicenowAccount,\x20%s,\x20%s','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','Content-Range','reject','save','update','destroy','end','stack','name','index','ServicenowAccount','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','include','findAll','show','params','includeAll','find','body','findOne','ServicenowConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','create','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','severity','category','caused_by','watch_list','sys_updated_on','number','resolved_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','delivery_plan','impact','active','business_service','sys_domain_path','rfc','time_worked','expected_start','opened_at','group_list','work_end','reopened_time','resolved_at','caller_id','work_notes','short_description','correlation_display','delivery_task','work_start','business_stc','description','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','location','username','email'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0xead2,0x1a0));var _0x2ead=function(_0x4a4af8,_0x3d9652){_0x4a4af8=_0x4a4af8-0x0;var _0x511166=_0xead2[_0x4a4af8];return _0x511166;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x2ead('0x0'));var zipdir=require(_0x2ead('0x1'));var jsonpatch=require(_0x2ead('0x2'));var rp=require(_0x2ead('0x3'));var moment=require(_0x2ead('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2ead('0x5'));var util=require(_0x2ead('0x6'));var path=require(_0x2ead('0x7'));var sox=require(_0x2ead('0x8'));var csv=require('to-csv');var ejs=require(_0x2ead('0x9'));var fs=require('fs');var _=require(_0x2ead('0xa'));var squel=require(_0x2ead('0xb'));var crypto=require('crypto');var jsforce=require(_0x2ead('0xc'));var deskjs=require(_0x2ead('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2ead('0xe'));var Papa=require(_0x2ead('0xf'));var Redis=require(_0x2ead('0x10'));var authService=require(_0x2ead('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x2ead('0x12'));var logger=require(_0x2ead('0x13'))(_0x2ead('0x14'));var utils=require(_0x2ead('0x15'));var config=require(_0x2ead('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x2ead('0x17'));var jayson=require(_0x2ead('0x18'));var client=jayson[_0x2ead('0x19')][_0x2ead('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x32f8f0,_0x4c7931,_0x29a813){if(_0x29a813){var _0x547642=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x547642['test'](_0x4c7931)){return _0x32f8f0;}else{throw new Error(_0x2ead('0x1b'));}}else{return _0x32f8f0;}}function respondWithRpcPromise(_0x2a0d0b,_0x502d10,_0x7f7957,_0x2b88d3){return new BPromise(function(_0x5ead91,_0x36a534){var _0x154220=_0x2b88d3||client;return _0x154220['request'](_0x2a0d0b,_0x7f7957)[_0x2ead('0x1c')](function(_0x4627ba){logger[_0x2ead('0x1d')](_0x2ead('0x1e'),_0x502d10,'request\x20sent');logger[_0x2ead('0x1f')](_0x2ead('0x20'),_0x502d10,_0x2ead('0x21'),JSON[_0x2ead('0x22')](_0x4627ba));if(_0x4627ba[_0x2ead('0x23')]){if(_0x4627ba[_0x2ead('0x23')][_0x2ead('0x24')]===0x1f4){logger[_0x2ead('0x23')](_0x2ead('0x1e'),_0x502d10,_0x4627ba[_0x2ead('0x23')]['message']);return _0x36a534(_0x4627ba[_0x2ead('0x23')][_0x2ead('0x25')]);}logger[_0x2ead('0x23')](_0x2ead('0x1e'),_0x502d10,_0x4627ba[_0x2ead('0x23')]['message']);return _0x5ead91(_0x4627ba[_0x2ead('0x23')][_0x2ead('0x25')]);}else{logger[_0x2ead('0x1d')]('ServicenowAccount,\x20%s,\x20%s',_0x502d10,_0x2ead('0x21'));_0x5ead91(_0x4627ba[_0x2ead('0x26')][_0x2ead('0x25')]);}})[_0x2ead('0x27')](function(_0x26a6bc){logger['error'](_0x2ead('0x1e'),_0x502d10,_0x26a6bc);_0x36a534(_0x26a6bc);});});}function respondWithStatusCode(_0x575c19,_0x1dbaeb){_0x1dbaeb=_0x1dbaeb||0xcc;return function(_0x4f0214){if(_0x4f0214){return _0x575c19[_0x2ead('0x28')](_0x1dbaeb);}return _0x575c19[_0x2ead('0x29')](_0x1dbaeb)['end']();};}function respondWithResult(_0x4b1acd,_0x4140be){_0x4140be=_0x4140be||0xc8;return function(_0x55815c){if(_0x55815c){return _0x4b1acd['status'](_0x4140be)[_0x2ead('0x2a')](_0x55815c);}};}function respondWithFilteredResult(_0x1c478d,_0x3a951f){return function(_0x54dae0){if(_0x54dae0){var _0xe14955=_0x54dae0[_0x2ead('0x2b')],_0x344d85=_0x3a951f[_0x2ead('0x2c')],_0x460149=_0x3a951f[_0x2ead('0x2c')]+_0x3a951f[_0x2ead('0x2d')],_0x817679;if(_0x460149>=_0xe14955){_0x460149=_0xe14955;_0x817679=0xc8;}else{_0x817679=0xce;}_0x1c478d[_0x2ead('0x29')](_0x817679);return _0x1c478d['set'](_0x2ead('0x2e'),_0x344d85+'-'+_0x460149+'/'+_0xe14955)[_0x2ead('0x2a')](_0x54dae0);}return null;};}function patchUpdates(_0x3221fa){return function(_0x4a022b){try{jsonpatch['apply'](_0x4a022b,_0x3221fa,!![]);}catch(_0x26d46b){return BPromise[_0x2ead('0x2f')](_0x26d46b);}return _0x4a022b[_0x2ead('0x30')]();};}function saveUpdates(_0x1364ec,_0x23dbbf){return function(_0x22df4d){if(_0x22df4d){return _0x22df4d[_0x2ead('0x31')](_0x1364ec)[_0x2ead('0x1c')](function(_0x30aed8){return _0x30aed8;});}return null;};}function removeEntity(_0x5a1004,_0x54b1ee){return function(_0x5513ae){if(_0x5513ae){return _0x5513ae[_0x2ead('0x32')]()['then'](function(){_0x5a1004[_0x2ead('0x29')](0xcc)[_0x2ead('0x33')]();});}};}function handleEntityNotFound(_0x495b83,_0x2d8d2c){return function(_0x2f7853){if(!_0x2f7853){_0x495b83[_0x2ead('0x28')](0x194);}return _0x2f7853;};}function handleError(_0x53a7d1,_0x18ad1d){_0x18ad1d=_0x18ad1d||0x1f4;return function(_0x48e835){logger['error'](_0x48e835[_0x2ead('0x34')]);if(_0x48e835[_0x2ead('0x35')]){delete _0x48e835[_0x2ead('0x35')];}_0x53a7d1[_0x2ead('0x29')](_0x18ad1d)['send'](_0x48e835);};}exports[_0x2ead('0x36')]=function(_0x5301f3,_0x4d18c0){var _0x5b8609={},_0x41f6b9={},_0x4d8877={'count':0x0,'rows':[]};var _0x45a5c1=db[_0x2ead('0x37')][_0x2ead('0x38')];_0x41f6b9[_0x2ead('0x39')]=_[_0x2ead('0x3a')](_0x45a5c1);_0x41f6b9[_0x2ead('0x3b')]=_[_0x2ead('0x3a')](_0x5301f3[_0x2ead('0x3b')]);_0x41f6b9[_0x2ead('0x3c')]=_['intersection'](_0x41f6b9[_0x2ead('0x39')],_0x41f6b9[_0x2ead('0x3b')]);_0x5b8609[_0x2ead('0x3d')]=_[_0x2ead('0x3e')](_0x41f6b9['model'],qs[_0x2ead('0x3f')](_0x5301f3['query'][_0x2ead('0x3f')]));_0x5b8609['attributes']=_0x5b8609[_0x2ead('0x3d')][_0x2ead('0x40')]?_0x5b8609[_0x2ead('0x3d')]:_0x41f6b9[_0x2ead('0x39')];if(!_0x5301f3[_0x2ead('0x3b')][_0x2ead('0x41')](_0x2ead('0x42'))){_0x5b8609['limit']=qs[_0x2ead('0x2d')](_0x5301f3[_0x2ead('0x3b')]['limit']);_0x5b8609[_0x2ead('0x2c')]=qs['offset'](_0x5301f3[_0x2ead('0x3b')][_0x2ead('0x2c')]);}_0x5b8609[_0x2ead('0x43')]=qs[_0x2ead('0x44')](_0x5301f3[_0x2ead('0x3b')][_0x2ead('0x44')]);_0x5b8609[_0x2ead('0x45')]=qs[_0x2ead('0x3c')](_[_0x2ead('0x46')](_0x5301f3[_0x2ead('0x3b')],_0x41f6b9[_0x2ead('0x3c')]));if(_0x5301f3['query'][_0x2ead('0x47')]){_0x5b8609[_0x2ead('0x45')]=_[_0x2ead('0x48')](_0x5b8609['where'],{'$or':_[_0x2ead('0x49')](_0x45a5c1,function(_0x4570e5){if(_0x4570e5[_0x2ead('0x4a')][_0x2ead('0x4b')]!==_0x2ead('0x4c')){var _0x31b165={};_0x31b165[_0x4570e5[_0x2ead('0x4d')]]={'$like':'%'+_0x5301f3['query'][_0x2ead('0x47')]+'%'};return _0x31b165;}})});}_0x5b8609=_[_0x2ead('0x48')]({},_0x5b8609,_0x5301f3[_0x2ead('0x4e')]);var _0x3ff543={'where':_0x5b8609['where']};return db[_0x2ead('0x37')][_0x2ead('0x2b')](_0x3ff543)['then'](function(_0x300daa){_0x4d8877['count']=_0x300daa;if(_0x5301f3[_0x2ead('0x3b')]['includeAll']){_0x5b8609[_0x2ead('0x4f')]=[{'all':!![]}];}return db['ServicenowAccount'][_0x2ead('0x50')](_0x5b8609);})[_0x2ead('0x1c')](function(_0x3b61d4){_0x4d8877['rows']=_0x3b61d4;return _0x4d8877;})['then'](respondWithFilteredResult(_0x4d18c0,_0x5b8609))[_0x2ead('0x27')](handleError(_0x4d18c0,null));};exports[_0x2ead('0x51')]=function(_0x439004,_0x20fcfb){var _0x2bea51={'raw':![],'where':{'id':_0x439004[_0x2ead('0x52')]['id']}},_0x2a0709={};_0x2a0709[_0x2ead('0x39')]=_[_0x2ead('0x3a')](db[_0x2ead('0x37')][_0x2ead('0x38')]);_0x2a0709[_0x2ead('0x3b')]=_[_0x2ead('0x3a')](_0x439004['query']);_0x2a0709[_0x2ead('0x3c')]=_[_0x2ead('0x3e')](_0x2a0709['model'],_0x2a0709[_0x2ead('0x3b')]);_0x2bea51[_0x2ead('0x3d')]=_[_0x2ead('0x3e')](_0x2a0709[_0x2ead('0x39')],qs[_0x2ead('0x3f')](_0x439004[_0x2ead('0x3b')][_0x2ead('0x3f')]));_0x2bea51['attributes']=_0x2bea51['attributes'][_0x2ead('0x40')]?_0x2bea51[_0x2ead('0x3d')]:_0x2a0709['model'];if(_0x439004['query'][_0x2ead('0x53')]){_0x2bea51[_0x2ead('0x4f')]=[{'all':!![]}];}_0x2bea51=_['merge']({},_0x2bea51,_0x439004[_0x2ead('0x4e')]);return db['ServicenowAccount'][_0x2ead('0x54')](_0x2bea51)[_0x2ead('0x1c')](handleEntityNotFound(_0x20fcfb,null))[_0x2ead('0x1c')](respondWithResult(_0x20fcfb,null))[_0x2ead('0x27')](handleError(_0x20fcfb,null));};exports['create']=function(_0x8b60a7,_0x5b3b27){return db[_0x2ead('0x37')]['create'](_0x8b60a7['body'],{})['then'](respondWithResult(_0x5b3b27,0xc9))[_0x2ead('0x27')](handleError(_0x5b3b27,null));};exports[_0x2ead('0x31')]=function(_0x391b5e,_0x5b1cc2){if(_0x391b5e[_0x2ead('0x55')]['id']){delete _0x391b5e[_0x2ead('0x55')]['id'];}return db[_0x2ead('0x37')][_0x2ead('0x54')]({'where':{'id':_0x391b5e['params']['id']}})[_0x2ead('0x1c')](handleEntityNotFound(_0x5b1cc2,null))[_0x2ead('0x1c')](saveUpdates(_0x391b5e[_0x2ead('0x55')],null))[_0x2ead('0x1c')](respondWithResult(_0x5b1cc2,null))[_0x2ead('0x27')](handleError(_0x5b1cc2,null));};exports[_0x2ead('0x32')]=function(_0x40640e,_0x1aab38){return db[_0x2ead('0x37')]['find']({'where':{'id':_0x40640e[_0x2ead('0x52')]['id']}})['then'](handleEntityNotFound(_0x1aab38,null))['then'](removeEntity(_0x1aab38,null))['catch'](handleError(_0x1aab38,null));};exports['getConfigurations']=function(_0x34ba69,_0x3287f4,_0x2d9659){var _0x31bda3={};var _0x3a492a={};var _0x258680;var _0x3f9f5c;return db[_0x2ead('0x37')][_0x2ead('0x56')]({'where':{'id':_0x34ba69[_0x2ead('0x52')]['id']}})['then'](handleEntityNotFound(_0x3287f4,null))[_0x2ead('0x1c')](function(_0x2ab705){if(_0x2ab705){_0x258680=_0x2ab705;_0x3a492a['model']=_['keys'](db[_0x2ead('0x57')][_0x2ead('0x38')]);_0x3a492a['query']=_['keys'](_0x34ba69[_0x2ead('0x3b')]);_0x3a492a[_0x2ead('0x3c')]=_['intersection'](_0x3a492a[_0x2ead('0x39')],_0x3a492a['query']);_0x31bda3[_0x2ead('0x3d')]=_[_0x2ead('0x3e')](_0x3a492a[_0x2ead('0x39')],qs[_0x2ead('0x3f')](_0x34ba69[_0x2ead('0x3b')][_0x2ead('0x3f')]));_0x31bda3['attributes']=_0x31bda3[_0x2ead('0x3d')][_0x2ead('0x40')]?_0x31bda3[_0x2ead('0x3d')]:_0x3a492a['model'];_0x31bda3[_0x2ead('0x43')]=qs['sort'](_0x34ba69['query'][_0x2ead('0x44')]);_0x31bda3[_0x2ead('0x45')]=qs['filters'](_['pick'](_0x34ba69['query'],_0x3a492a['filters']));if(_0x34ba69[_0x2ead('0x3b')]['filter']){_0x31bda3[_0x2ead('0x45')]=_[_0x2ead('0x48')](_0x31bda3['where'],{'$or':_[_0x2ead('0x49')](_0x31bda3[_0x2ead('0x3d')],function(_0x9a524d){var _0x30cb0b={};_0x30cb0b[_0x9a524d]={'$like':'%'+_0x34ba69[_0x2ead('0x3b')]['filter']+'%'};return _0x30cb0b;})});}_0x31bda3=_['merge']({},_0x31bda3,_0x34ba69[_0x2ead('0x4e')]);return _0x258680[_0x2ead('0x58')](_0x31bda3);}})[_0x2ead('0x1c')](function(_0x55c094){if(_0x55c094){_0x3f9f5c=_0x55c094[_0x2ead('0x40')];if(!_0x34ba69['query'][_0x2ead('0x41')](_0x2ead('0x42'))){_0x31bda3[_0x2ead('0x2d')]=qs[_0x2ead('0x2d')](_0x34ba69['query'][_0x2ead('0x2d')]);_0x31bda3['offset']=qs[_0x2ead('0x2c')](_0x34ba69['query'][_0x2ead('0x2c')]);}return _0x258680[_0x2ead('0x58')](_0x31bda3);}})['then'](function(_0x5cf805){if(_0x5cf805){return _0x5cf805?{'count':_0x3f9f5c,'rows':_0x5cf805}:null;}})[_0x2ead('0x1c')](respondWithResult(_0x3287f4,null))[_0x2ead('0x27')](handleError(_0x3287f4,null));};exports[_0x2ead('0x59')]=function(_0x329e6e,_0x43f94f,_0x509169){if(_0x329e6e[_0x2ead('0x55')]['id']){delete _0x329e6e[_0x2ead('0x55')]['id'];}return db[_0x2ead('0x37')][_0x2ead('0x56')]({'where':{'id':_0x329e6e[_0x2ead('0x52')]['id']}})[_0x2ead('0x1c')](handleEntityNotFound(_0x43f94f,null))[_0x2ead('0x1c')](function(_0x3c531d){if(_0x3c531d){_0x329e6e[_0x2ead('0x55')][_0x2ead('0x5a')]=_0x3c531d['id'];_0x329e6e[_0x2ead('0x55')][_0x2ead('0x5b')]=integrations[_0x2ead('0x5c')](_0x329e6e[_0x2ead('0x55')][_0x2ead('0x5d')],_0x329e6e['body']['type']);_0x329e6e[_0x2ead('0x55')][_0x2ead('0x5e')]=integrations[_0x2ead('0x5f')](_0x329e6e['body'][_0x2ead('0x5d')],_0x329e6e[_0x2ead('0x55')][_0x2ead('0x4a')]);return db['ServicenowConfiguration'][_0x2ead('0x60')](_0x329e6e[_0x2ead('0x55')],{'include':[{'model':db[_0x2ead('0x61')],'as':_0x2ead('0x5b')},{'model':db[_0x2ead('0x61')],'as':_0x2ead('0x5e')}]});}return null;})[_0x2ead('0x1c')](respondWithResult(_0x43f94f,null))[_0x2ead('0x27')](handleError(_0x43f94f,null));};exports[_0x2ead('0x62')]=function(_0x4c5aab,_0x1e0514,_0x2cc3f8){var _0x30001e=[_0x2ead('0x63'),_0x2ead('0x64'),_0x2ead('0x65'),_0x2ead('0x66'),_0x2ead('0x67'),_0x2ead('0x68'),'incident_state',_0x2ead('0x69'),_0x2ead('0x6a')];var _0x4215fd=['parent',_0x2ead('0x63'),_0x2ead('0x6b'),_0x2ead('0x6c'),'upon_reject',_0x2ead('0x6d'),'child_incidents',_0x2ead('0x64'),'approval_history',_0x2ead('0x6e'),_0x2ead('0x6f'),'sys_updated_by',_0x2ead('0x70'),_0x2ead('0x71'),_0x2ead('0x72'),_0x2ead('0x73'),_0x2ead('0x74'),_0x2ead('0x75'),_0x2ead('0x65'),_0x2ead('0x43'),_0x2ead('0x76'),_0x2ead('0x77'),'cmdb_ci',_0x2ead('0x78'),_0x2ead('0x79'),_0x2ead('0x7a'),'work_notes_list',_0x2ead('0x7b'),'priority',_0x2ead('0x7c'),_0x2ead('0x7d'),_0x2ead('0x7e'),_0x2ead('0x7f'),_0x2ead('0x80'),'business_duration',_0x2ead('0x81'),_0x2ead('0x82'),_0x2ead('0x83'),_0x2ead('0x84'),_0x2ead('0x85'),'approval_set',_0x2ead('0x66'),_0x2ead('0x86'),_0x2ead('0x87'),_0x2ead('0x67'),_0x2ead('0x88'),_0x2ead('0x89'),_0x2ead('0x8a'),'assignment_group',_0x2ead('0x8b'),'additional_assignee_list',_0x2ead('0x8c'),'calendar_duration','notify','sys_class_name',_0x2ead('0x8d'),_0x2ead('0x8e'),_0x2ead('0x8f'),_0x2ead('0x90'),_0x2ead('0x91'),_0x2ead('0x92'),_0x2ead('0x93'),'incident_state','urgency','problem_id','company',_0x2ead('0x94'),_0x2ead('0x95'),_0x2ead('0x96'),_0x2ead('0x69'),_0x2ead('0x97'),_0x2ead('0x98'),_0x2ead('0x99'),_0x2ead('0x9a'),_0x2ead('0x9b'),_0x2ead('0x9c'),_0x2ead('0x9d'),_0x2ead('0x9e'),_0x2ead('0x9f'),'upon_approval','correlation_id',_0x2ead('0xa0'),_0x2ead('0x6a')];var _0x1c13b3='';var _0x4c451e='';var _0x2bc731=[];var _0x28f486='';var _0x4a8a78='';var _0x50ef33=[];var _0x43df76='';var _0x272ceb='';var _0x2e376c={};var _0x227fa6='';return db[_0x2ead('0x37')][_0x2ead('0x56')]({'where':{'id':_0x4c5aab[_0x2ead('0x52')]['id']},'attributes':['id',_0x2ead('0xa1'),'password',_0x2ead('0xa2'),_0x2ead('0xa3'),_0x2ead('0xa4')]})['then'](handleEntityNotFound(_0x1e0514,null))[_0x2ead('0x1c')](function(_0x217f43){if(_0x217f43){_0x227fa6=_0x217f43[_0x2ead('0xa3')];var _0x497dae=_0x227fa6[_0x2ead('0xa5')](-0x1);if(_0x497dae==='/'){_0x227fa6=_0x227fa6[_0x2ead('0xa6')](0x0,_0x227fa6[_0x2ead('0xa7')](_0x497dae));}_0x272ceb=util[_0x2ead('0xa8')](_0x2ead('0xa9'),_0x227fa6);_0x43df76=util[_0x2ead('0xa8')]('%s/api/now/table/',_0x227fa6);_0x2e376c={'user':_0x217f43[_0x2ead('0xa1')],'pass':_0x217f43[_0x2ead('0xaa')]};var _0x4e9d90={'method':_0x2ead('0xab'),'uri':_0x272ceb+'incident?sysparm_display_value=all','auth':_0x2e376c,'json':!![]};return rp(_0x4e9d90);}})[_0x2ead('0x1c')](function(_0x3ec6ff){if(_0x3ec6ff[_0x2ead('0x26')][_0x2ead('0x40')]>0x0){_0x1c13b3=_0x3ec6ff['result'];}console[_0x2ead('0xac')](_0x2ead('0xad'),_0x1c13b3);_0x50ef33=[];_0x4c451e=Object[_0x2ead('0xae')]([],_0x1c13b3);_['remove'](_0x4c451e,function(_0x3bb822){return!_0x30001e[_0x2ead('0xaf')](_0x3bb822[_0x2ead('0x35')]);});_0x4c451e[_0x2ead('0xb0')](function(_0x310ccb){var _0x27c2fa=createFieldObject(_0x43df76,_0x2e376c,_0x310ccb[_0x2ead('0xb1')],_0x310ccb[_0x2ead('0x35')],_0x310ccb[_0x2ead('0xb2')],![]);_0x50ef33['push'](_0x27c2fa);});return Promise['all'](_0x50ef33);})['then'](function(_0x14de1a){_0x2bc731=_0x14de1a;_0x28f486=Object[_0x2ead('0xae')]([],_0x1c13b3);console[_0x2ead('0xac')](_0x2ead('0xb3'),_0x1c13b3);_['remove'](_0x28f486,function(_0x2db3f6){return _0x4215fd[_0x2ead('0xaf')](_0x2db3f6[_0x2ead('0x35')]);});console['log'](_0x2ead('0xb4'),_0x28f486);_0x50ef33=[];_0x28f486[_0x2ead('0xb0')](function(_0x52c7f0){var _0x3d05d8=createFieldObject(_0x43df76,_0x2e376c,_0x52c7f0['internalType'],_0x52c7f0[_0x2ead('0x35')],_0x52c7f0['label'],!![]);_0x50ef33[_0x2ead('0xb5')](_0x3d05d8);});return Promise[_0x2ead('0xb6')](_0x50ef33);})[_0x2ead('0x1c')](function(_0x3c4d10){_0x4a8a78=_0x3c4d10;var _0x4313aa=_0x2bc731['concat'](_0x4a8a78);return{'count':_0x4313aa[_0x2ead('0x40')],'rows':_0x4313aa};})[_0x2ead('0x1c')](respondWithResult(_0x1e0514,null))['catch'](function(_0x549bfe){console[_0x2ead('0xac')](_0x2ead('0xb7')+_0x549bfe);var _0xde609b=_0x4c5aab[_0x2ead('0x3b')][_0x2ead('0xb8')]?0x1f4:_0x549bfe[_0x2ead('0xb9')]||0x1f4;logger[_0x2ead('0x23')](_0x549bfe[_0x2ead('0x34')]);delete _0x549bfe[_0x2ead('0x35')];if(_0xde609b===0x191){_0xde609b=0x190;}_0x1e0514[_0x2ead('0x29')](_0xde609b)[_0x2ead('0xba')](_0x4c5aab[_0x2ead('0x3b')][_0x2ead('0xb8')]?{'message':_0x2ead('0xbb'),'statusCode':_0x549bfe[_0x2ead('0xb9')]}:_0x549bfe);});};function createFieldObject(_0x3bb7fa,_0xa0d043,_0x147a77,_0x2fc936,_0x43e972,_0xcc4f5b){return new Promise(function(_0x2b720d,_0x472734){var _0x2ec236={'id':_0x2fc936,'name':_0x43e972,'custom':_0xcc4f5b};if(_0x147a77===_0x2ead('0xbc')){_0x2ec236[_0x2ead('0x4e')]=[{'name':'True','value':_0x2ead('0xbd')},{'name':_0x2ead('0xbe'),'value':_0x2ead('0xbf')}];_0x2b720d(_0x2ec236);}else{var _0xfcec44={'method':_0x2ead('0xab'),'uri':_0x3bb7fa+'sys_choice?sysparm_query=name=incident^element='+_0x2fc936,'auth':_0xa0d043,'json':!![]};return rp(_0xfcec44)[_0x2ead('0x1c')](function(_0x1a0eb5){var _0x1ae309=[];if(_0x1a0eb5[_0x2ead('0x26')]['length']>0x0){_0x1a0eb5[_0x2ead('0x26')]['forEach'](function(_0x16d854){if(_0x16d854[_0x2ead('0xc0')]===_0x2ead('0xbf')){var _0x4a65fc={'name':_0x16d854[_0x2ead('0xb2')],'value':_0x16d854['value']};_0x1ae309[_0x2ead('0xb5')](_0x4a65fc);}});}_0x2ec236[_0x2ead('0x4e')]=_0x1ae309;if(_0x2ec236['options'][_0x2ead('0x40')]>0x0){_0x2b720d(_0x2ec236);}else{if(_0xcc4f5b==![]){_0x2b720d();}else{_0x2b720d(_0x2ec236);}}});}});} \ No newline at end of file +var _0x8622=['catch','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','sendStatus','name','send','index','ServicenowAccount','rawAttributes','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','field','includeAll','include','findAll','rows','show','params','length','options','create','body','find','destroy','getConfigurations','findOne','ServicenowConfiguration','map','nolimit','addConfiguration','Subjects','getSubjects','channel','getDescriptions','type','ServicenowField','Descriptions','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','approval_history','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','sys_created_by','calendar_stc','cmdb_ci','delivery_plan','impact','work_notes_list','business_service','priority','sys_domain_path','rfc','expected_start','business_duration','group_list','reopened_time','resolved_at','caller_id','approval_set','short_description','correlation_display','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','contact_type','reopened_by','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','comments_and_work_notes','due_date','sys_mod_count','reopen_count','escalation','upon_approval','location','password','email','remoteUri','slice','substring','format','%s/api/now/table/','username','incident?sysparm_display_value=all','log','incident\x20table\x20objects','assign','remove','internalType','label','push','all','TCL:\x20_object','concat','stack','Wrong\x20credentials','statusCode','boolean','true','false','GET','forEach','inactive','value','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','test','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x354d7f,_0x3ebfce){var _0x247c36=function(_0x2686fd){while(--_0x2686fd){_0x354d7f['push'](_0x354d7f['shift']());}};_0x247c36(++_0x3ebfce);}(_0x8622,0x9a));var _0x2862=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8622[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x2862('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2862('0x1'));var zipdir=require(_0x2862('0x2'));var jsonpatch=require(_0x2862('0x3'));var rp=require(_0x2862('0x4'));var moment=require('moment');var BPromise=require(_0x2862('0x5'));var Mustache=require(_0x2862('0x6'));var util=require(_0x2862('0x7'));var path=require('path');var sox=require(_0x2862('0x8'));var csv=require('to-csv');var ejs=require(_0x2862('0x9'));var fs=require('fs');var _=require(_0x2862('0xa'));var squel=require(_0x2862('0xb'));var crypto=require(_0x2862('0xc'));var jsforce=require(_0x2862('0xd'));var deskjs=require(_0x2862('0xe'));var toCsv=require(_0x2862('0xf'));var querystring=require(_0x2862('0x10'));var Papa=require(_0x2862('0x11'));var Redis=require('ioredis');var authService=require(_0x2862('0x12'));var qs=require(_0x2862('0x13'));var hardwareService=require(_0x2862('0x14'));var logger=require(_0x2862('0x15'))(_0x2862('0x16'));var utils=require(_0x2862('0x17'));var config=require(_0x2862('0x18'));var db=require(_0x2862('0x19'))['db'];var integrations=require(_0x2862('0x1a'));var jayson=require(_0x2862('0x1b'));var client=jayson['client'][_0x2862('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x4ad2dc,_0x5b3a7d,_0x439ca5){if(_0x439ca5){var _0x4c6108=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4c6108[_0x2862('0x1d')](_0x5b3a7d)){return _0x4ad2dc;}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 _0x4ad2dc;}}function respondWithRpcPromise(_0x1ecdb0,_0x47551b,_0x100a14,_0x4ca5e1){return new BPromise(function(_0xe70b22,_0x4415ff){var _0x341fd8=_0x4ca5e1||client;return _0x341fd8['request'](_0x1ecdb0,_0x100a14)[_0x2862('0x1e')](function(_0x346734){logger[_0x2862('0x1f')](_0x2862('0x20'),_0x47551b,_0x2862('0x21'));logger[_0x2862('0x22')](_0x2862('0x23'),_0x47551b,_0x2862('0x21'),JSON[_0x2862('0x24')](_0x346734));if(_0x346734['error']){if(_0x346734[_0x2862('0x25')]['code']===0x1f4){logger['error'](_0x2862('0x20'),_0x47551b,_0x346734[_0x2862('0x25')][_0x2862('0x26')]);return _0x4415ff(_0x346734[_0x2862('0x25')][_0x2862('0x26')]);}logger[_0x2862('0x25')](_0x2862('0x20'),_0x47551b,_0x346734['error'][_0x2862('0x26')]);return _0xe70b22(_0x346734[_0x2862('0x25')][_0x2862('0x26')]);}else{logger[_0x2862('0x1f')](_0x2862('0x20'),_0x47551b,'request\x20sent');_0xe70b22(_0x346734[_0x2862('0x27')][_0x2862('0x26')]);}})[_0x2862('0x28')](function(_0x2ade64){logger[_0x2862('0x25')](_0x2862('0x20'),_0x47551b,_0x2ade64);_0x4415ff(_0x2ade64);});});}function respondWithStatusCode(_0x2a934d,_0x307a14){_0x307a14=_0x307a14||0xcc;return function(_0x559b10){if(_0x559b10){return _0x2a934d['sendStatus'](_0x307a14);}return _0x2a934d[_0x2862('0x29')](_0x307a14)[_0x2862('0x2a')]();};}function respondWithResult(_0x103650,_0x51486f){_0x51486f=_0x51486f||0xc8;return function(_0x3878bd){if(_0x3878bd){return _0x103650[_0x2862('0x29')](_0x51486f)[_0x2862('0x2b')](_0x3878bd);}};}function respondWithFilteredResult(_0x26d887,_0x263e7b){return function(_0xd01b9b){if(_0xd01b9b){var _0xe5bd02=_0xd01b9b[_0x2862('0x2c')],_0x4b2990=_0x263e7b[_0x2862('0x2d')],_0x4fbeff=_0x263e7b['offset']+_0x263e7b[_0x2862('0x2e')],_0xc3233e;if(_0x4fbeff>=_0xe5bd02){_0x4fbeff=_0xe5bd02;_0xc3233e=0xc8;}else{_0xc3233e=0xce;}_0x26d887[_0x2862('0x29')](_0xc3233e);return _0x26d887[_0x2862('0x2f')](_0x2862('0x30'),_0x4b2990+'-'+_0x4fbeff+'/'+_0xe5bd02)[_0x2862('0x2b')](_0xd01b9b);}return null;};}function patchUpdates(_0x430111){return function(_0x35706f){try{jsonpatch[_0x2862('0x31')](_0x35706f,_0x430111,!![]);}catch(_0x213941){return BPromise['reject'](_0x213941);}return _0x35706f[_0x2862('0x32')]();};}function saveUpdates(_0x5f3ec7,_0x2df32b){return function(_0x307a13){if(_0x307a13){return _0x307a13[_0x2862('0x33')](_0x5f3ec7)['then'](function(_0x97eb58){return _0x97eb58;});}return null;};}function removeEntity(_0x1769da,_0x100b03){return function(_0x10b7ec){if(_0x10b7ec){return _0x10b7ec['destroy']()[_0x2862('0x1e')](function(){_0x1769da['status'](0xcc)[_0x2862('0x2a')]();});}};}function handleEntityNotFound(_0x6c8379,_0x37720a){return function(_0x502350){if(!_0x502350){_0x6c8379[_0x2862('0x34')](0x194);}return _0x502350;};}function handleError(_0x40801f,_0x25c80c){_0x25c80c=_0x25c80c||0x1f4;return function(_0x489500){logger[_0x2862('0x25')](_0x489500['stack']);if(_0x489500[_0x2862('0x35')]){delete _0x489500[_0x2862('0x35')];}_0x40801f[_0x2862('0x29')](_0x25c80c)[_0x2862('0x36')](_0x489500);};}exports[_0x2862('0x37')]=function(_0xd3dc46,_0x5e87e8){var _0xe10aed={},_0x14fbed={},_0x500fd5={'count':0x0,'rows':[]};var _0x2c7b6a=db[_0x2862('0x38')][_0x2862('0x39')];_0x14fbed['model']=_[_0x2862('0x3a')](_0x2c7b6a);_0x14fbed[_0x2862('0x3b')]=_['keys'](_0xd3dc46['query']);_0x14fbed[_0x2862('0x3c')]=_[_0x2862('0x3d')](_0x14fbed[_0x2862('0x3e')],_0x14fbed[_0x2862('0x3b')]);_0xe10aed[_0x2862('0x3f')]=_[_0x2862('0x3d')](_0x14fbed[_0x2862('0x3e')],qs['fields'](_0xd3dc46[_0x2862('0x3b')][_0x2862('0x40')]));_0xe10aed[_0x2862('0x3f')]=_0xe10aed[_0x2862('0x3f')]['length']?_0xe10aed[_0x2862('0x3f')]:_0x14fbed[_0x2862('0x3e')];if(!_0xd3dc46[_0x2862('0x3b')][_0x2862('0x41')]('nolimit')){_0xe10aed[_0x2862('0x2e')]=qs[_0x2862('0x2e')](_0xd3dc46[_0x2862('0x3b')][_0x2862('0x2e')]);_0xe10aed[_0x2862('0x2d')]=qs[_0x2862('0x2d')](_0xd3dc46['query'][_0x2862('0x2d')]);}_0xe10aed[_0x2862('0x42')]=qs[_0x2862('0x43')](_0xd3dc46[_0x2862('0x3b')][_0x2862('0x43')]);_0xe10aed[_0x2862('0x44')]=qs['filters'](_[_0x2862('0x45')](_0xd3dc46[_0x2862('0x3b')],_0x14fbed[_0x2862('0x3c')]));if(_0xd3dc46[_0x2862('0x3b')][_0x2862('0x46')]){_0xe10aed['where']=_[_0x2862('0x47')](_0xe10aed['where'],{'$or':_['map'](_0x2c7b6a,function(_0x436f40){if(_0x436f40['type']['key']!=='VIRTUAL'){var _0x56898d={};_0x56898d[_0x436f40[_0x2862('0x48')]]={'$like':'%'+_0xd3dc46[_0x2862('0x3b')]['filter']+'%'};return _0x56898d;}})});}_0xe10aed=_[_0x2862('0x47')]({},_0xe10aed,_0xd3dc46['options']);var _0x1dec75={'where':_0xe10aed[_0x2862('0x44')]};return db[_0x2862('0x38')][_0x2862('0x2c')](_0x1dec75)[_0x2862('0x1e')](function(_0x2d641d){_0x500fd5[_0x2862('0x2c')]=_0x2d641d;if(_0xd3dc46[_0x2862('0x3b')][_0x2862('0x49')]){_0xe10aed[_0x2862('0x4a')]=[{'all':!![]}];}return db[_0x2862('0x38')][_0x2862('0x4b')](_0xe10aed);})[_0x2862('0x1e')](function(_0x50cf46){_0x500fd5[_0x2862('0x4c')]=_0x50cf46;return _0x500fd5;})['then'](respondWithFilteredResult(_0x5e87e8,_0xe10aed))['catch'](handleError(_0x5e87e8,null));};exports[_0x2862('0x4d')]=function(_0x29d1c8,_0x5cccfa){var _0x4bb870={'raw':![],'where':{'id':_0x29d1c8[_0x2862('0x4e')]['id']}},_0x4505aa={};_0x4505aa[_0x2862('0x3e')]=_['keys'](db[_0x2862('0x38')][_0x2862('0x39')]);_0x4505aa['query']=_['keys'](_0x29d1c8['query']);_0x4505aa[_0x2862('0x3c')]=_[_0x2862('0x3d')](_0x4505aa[_0x2862('0x3e')],_0x4505aa[_0x2862('0x3b')]);_0x4bb870['attributes']=_[_0x2862('0x3d')](_0x4505aa[_0x2862('0x3e')],qs[_0x2862('0x40')](_0x29d1c8[_0x2862('0x3b')][_0x2862('0x40')]));_0x4bb870[_0x2862('0x3f')]=_0x4bb870[_0x2862('0x3f')][_0x2862('0x4f')]?_0x4bb870[_0x2862('0x3f')]:_0x4505aa[_0x2862('0x3e')];if(_0x29d1c8['query'][_0x2862('0x49')]){_0x4bb870[_0x2862('0x4a')]=[{'all':!![]}];}_0x4bb870=_['merge']({},_0x4bb870,_0x29d1c8[_0x2862('0x50')]);return db[_0x2862('0x38')]['find'](_0x4bb870)['then'](handleEntityNotFound(_0x5cccfa,null))[_0x2862('0x1e')](respondWithResult(_0x5cccfa,null))[_0x2862('0x28')](handleError(_0x5cccfa,null));};exports[_0x2862('0x51')]=function(_0x22df71,_0x348433){return db[_0x2862('0x38')]['create'](_0x22df71['body'],{})[_0x2862('0x1e')](respondWithResult(_0x348433,0xc9))[_0x2862('0x28')](handleError(_0x348433,null));};exports['update']=function(_0x3f42b2,_0x43ced4){if(_0x3f42b2[_0x2862('0x52')]['id']){delete _0x3f42b2[_0x2862('0x52')]['id'];}return db[_0x2862('0x38')][_0x2862('0x53')]({'where':{'id':_0x3f42b2[_0x2862('0x4e')]['id']}})['then'](handleEntityNotFound(_0x43ced4,null))[_0x2862('0x1e')](saveUpdates(_0x3f42b2[_0x2862('0x52')],null))[_0x2862('0x1e')](respondWithResult(_0x43ced4,null))['catch'](handleError(_0x43ced4,null));};exports[_0x2862('0x54')]=function(_0x509c64,_0x3b6b9f){return db['ServicenowAccount']['find']({'where':{'id':_0x509c64[_0x2862('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3b6b9f,null))[_0x2862('0x1e')](removeEntity(_0x3b6b9f,null))[_0x2862('0x28')](handleError(_0x3b6b9f,null));};exports[_0x2862('0x55')]=function(_0xe85b65,_0x4a026c,_0x5af2aa){var _0x3b3311={};var _0x5c63d8={};var _0x5af4d4;var _0x278090;return db['ServicenowAccount'][_0x2862('0x56')]({'where':{'id':_0xe85b65[_0x2862('0x4e')]['id']}})[_0x2862('0x1e')](handleEntityNotFound(_0x4a026c,null))[_0x2862('0x1e')](function(_0x3605c1){if(_0x3605c1){_0x5af4d4=_0x3605c1;_0x5c63d8['model']=_[_0x2862('0x3a')](db[_0x2862('0x57')][_0x2862('0x39')]);_0x5c63d8[_0x2862('0x3b')]=_[_0x2862('0x3a')](_0xe85b65[_0x2862('0x3b')]);_0x5c63d8[_0x2862('0x3c')]=_[_0x2862('0x3d')](_0x5c63d8[_0x2862('0x3e')],_0x5c63d8[_0x2862('0x3b')]);_0x3b3311[_0x2862('0x3f')]=_[_0x2862('0x3d')](_0x5c63d8[_0x2862('0x3e')],qs[_0x2862('0x40')](_0xe85b65[_0x2862('0x3b')][_0x2862('0x40')]));_0x3b3311[_0x2862('0x3f')]=_0x3b3311[_0x2862('0x3f')][_0x2862('0x4f')]?_0x3b3311[_0x2862('0x3f')]:_0x5c63d8[_0x2862('0x3e')];_0x3b3311[_0x2862('0x42')]=qs['sort'](_0xe85b65[_0x2862('0x3b')][_0x2862('0x43')]);_0x3b3311[_0x2862('0x44')]=qs[_0x2862('0x3c')](_['pick'](_0xe85b65[_0x2862('0x3b')],_0x5c63d8[_0x2862('0x3c')]));if(_0xe85b65[_0x2862('0x3b')]['filter']){_0x3b3311[_0x2862('0x44')]=_[_0x2862('0x47')](_0x3b3311[_0x2862('0x44')],{'$or':_[_0x2862('0x58')](_0x3b3311[_0x2862('0x3f')],function(_0x264c3e){var _0x32ce18={};_0x32ce18[_0x264c3e]={'$like':'%'+_0xe85b65[_0x2862('0x3b')][_0x2862('0x46')]+'%'};return _0x32ce18;})});}_0x3b3311=_[_0x2862('0x47')]({},_0x3b3311,_0xe85b65['options']);return _0x5af4d4[_0x2862('0x55')](_0x3b3311);}})[_0x2862('0x1e')](function(_0x196da3){if(_0x196da3){_0x278090=_0x196da3['length'];if(!_0xe85b65[_0x2862('0x3b')][_0x2862('0x41')](_0x2862('0x59'))){_0x3b3311[_0x2862('0x2e')]=qs[_0x2862('0x2e')](_0xe85b65['query'][_0x2862('0x2e')]);_0x3b3311[_0x2862('0x2d')]=qs[_0x2862('0x2d')](_0xe85b65[_0x2862('0x3b')]['offset']);}return _0x5af4d4[_0x2862('0x55')](_0x3b3311);}})[_0x2862('0x1e')](function(_0x5d1ef5){if(_0x5d1ef5){return _0x5d1ef5?{'count':_0x278090,'rows':_0x5d1ef5}:null;}})[_0x2862('0x1e')](respondWithResult(_0x4a026c,null))[_0x2862('0x28')](handleError(_0x4a026c,null));};exports[_0x2862('0x5a')]=function(_0x2c86b7,_0x2c2ef7,_0x315c08){if(_0x2c86b7[_0x2862('0x52')]['id']){delete _0x2c86b7[_0x2862('0x52')]['id'];}return db[_0x2862('0x38')][_0x2862('0x56')]({'where':{'id':_0x2c86b7[_0x2862('0x4e')]['id']}})[_0x2862('0x1e')](handleEntityNotFound(_0x2c2ef7,null))[_0x2862('0x1e')](function(_0x2811bf){if(_0x2811bf){_0x2c86b7[_0x2862('0x52')]['AccountId']=_0x2811bf['id'];_0x2c86b7[_0x2862('0x52')][_0x2862('0x5b')]=integrations[_0x2862('0x5c')](_0x2c86b7['body'][_0x2862('0x5d')],_0x2c86b7[_0x2862('0x52')]['type']);_0x2c86b7[_0x2862('0x52')]['Descriptions']=integrations[_0x2862('0x5e')](_0x2c86b7[_0x2862('0x52')][_0x2862('0x5d')],_0x2c86b7[_0x2862('0x52')][_0x2862('0x5f')]);return db[_0x2862('0x57')][_0x2862('0x51')](_0x2c86b7[_0x2862('0x52')],{'include':[{'model':db[_0x2862('0x60')],'as':_0x2862('0x5b')},{'model':db[_0x2862('0x60')],'as':_0x2862('0x61')}]});}return null;})[_0x2862('0x1e')](respondWithResult(_0x2c2ef7,null))['catch'](handleError(_0x2c2ef7,null));};exports[_0x2862('0x62')]=function(_0x4278be,_0x419460,_0x4bec73){var _0x33565d=[_0x2862('0x63'),_0x2862('0x64'),_0x2862('0x65'),_0x2862('0x66'),_0x2862('0x67'),_0x2862('0x68'),_0x2862('0x69'),_0x2862('0x6a'),_0x2862('0x6b')];var _0xa2e648=[_0x2862('0x6c'),_0x2862('0x63'),_0x2862('0x6d'),_0x2862('0x6e'),_0x2862('0x6f'),_0x2862('0x70'),'child_incidents',_0x2862('0x64'),_0x2862('0x71'),'number','resolved_by',_0x2862('0x72'),_0x2862('0x73'),_0x2862('0x74'),_0x2862('0x75'),_0x2862('0x76'),'state',_0x2862('0x77'),_0x2862('0x65'),_0x2862('0x42'),_0x2862('0x78'),'closed_at',_0x2862('0x79'),_0x2862('0x7a'),_0x2862('0x7b'),'active',_0x2862('0x7c'),_0x2862('0x7d'),_0x2862('0x7e'),_0x2862('0x7f'),_0x2862('0x80'),'time_worked',_0x2862('0x81'),'opened_at',_0x2862('0x82'),_0x2862('0x83'),'work_end',_0x2862('0x84'),_0x2862('0x85'),_0x2862('0x86'),_0x2862('0x87'),'subcategory','work_notes',_0x2862('0x88'),_0x2862('0x67'),_0x2862('0x89'),'delivery_task',_0x2862('0x8a'),_0x2862('0x8b'),_0x2862('0x8c'),_0x2862('0x8d'),_0x2862('0x8e'),_0x2862('0x8f'),_0x2862('0x68'),_0x2862('0x90'),_0x2862('0x91'),_0x2862('0x92'),_0x2862('0x93'),_0x2862('0x94'),'sys_id',_0x2862('0x95'),_0x2862('0x96'),_0x2862('0x69'),'urgency',_0x2862('0x97'),_0x2862('0x98'),_0x2862('0x99'),_0x2862('0x9a'),_0x2862('0x9b'),_0x2862('0x6a'),_0x2862('0x9c'),_0x2862('0x9d'),'approval',_0x2862('0x9e'),_0x2862('0x9f'),_0x2862('0xa0'),_0x2862('0xa1'),'sys_tags',_0x2862('0xa2'),_0x2862('0xa3'),'correlation_id',_0x2862('0xa4'),'category'];var _0x3b8f37='';var _0xf97481='';var _0x16a0d5=[];var _0x231430='';var _0x3f9df8='';var _0x1e9408=[];var _0x4c4c04='';var _0x148aa2='';var _0x1af3cc={};var _0x4e3016='';return db[_0x2862('0x38')]['findOne']({'where':{'id':_0x4278be[_0x2862('0x4e')]['id']},'attributes':['id','username',_0x2862('0xa5'),_0x2862('0xa6'),_0x2862('0xa7'),'serverUrl']})[_0x2862('0x1e')](handleEntityNotFound(_0x419460,null))[_0x2862('0x1e')](function(_0x545c27){if(_0x545c27){_0x4e3016=_0x545c27['remoteUri'];var _0x28c14e=_0x4e3016[_0x2862('0xa8')](-0x1);if(_0x28c14e==='/'){_0x4e3016=_0x4e3016[_0x2862('0xa9')](0x0,_0x4e3016['lastIndexOf'](_0x28c14e));}_0x148aa2=util['format']('%s/api/now/doc/table/schema/',_0x4e3016);_0x4c4c04=util[_0x2862('0xaa')](_0x2862('0xab'),_0x4e3016);_0x1af3cc={'user':_0x545c27[_0x2862('0xac')],'pass':_0x545c27[_0x2862('0xa5')]};var _0x375e41={'method':'GET','uri':_0x148aa2+_0x2862('0xad'),'auth':_0x1af3cc,'json':!![]};return rp(_0x375e41);}})[_0x2862('0x1e')](function(_0x5eab59){if(_0x5eab59[_0x2862('0x27')][_0x2862('0x4f')]>0x0){_0x3b8f37=_0x5eab59[_0x2862('0x27')];}console[_0x2862('0xae')](_0x2862('0xaf'),_0x3b8f37);_0x1e9408=[];_0xf97481=Object[_0x2862('0xb0')]([],_0x3b8f37);_[_0x2862('0xb1')](_0xf97481,function(_0x2dd41a){return!_0x33565d['includes'](_0x2dd41a[_0x2862('0x35')]);});_0xf97481['forEach'](function(_0x5d51c7){var _0x1f6391=createFieldObject(_0x4c4c04,_0x1af3cc,_0x5d51c7[_0x2862('0xb2')],_0x5d51c7[_0x2862('0x35')],_0x5d51c7[_0x2862('0xb3')],![]);_0x1e9408[_0x2862('0xb4')](_0x1f6391);});return Promise[_0x2862('0xb5')](_0x1e9408);})[_0x2862('0x1e')](function(_0x3b3ddd){_0x16a0d5=_0x3b3ddd;_0x231430=Object[_0x2862('0xb0')]([],_0x3b8f37);console[_0x2862('0xae')](_0x2862('0xb6'),_0x3b8f37);_[_0x2862('0xb1')](_0x231430,function(_0x5aa9ad){return _0xa2e648['includes'](_0x5aa9ad[_0x2862('0x35')]);});console['log']('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x231430);_0x1e9408=[];_0x231430['forEach'](function(_0x2dc6ce){var _0x1d13e5=createFieldObject(_0x4c4c04,_0x1af3cc,_0x2dc6ce[_0x2862('0xb2')],_0x2dc6ce[_0x2862('0x35')],_0x2dc6ce[_0x2862('0xb3')],!![]);_0x1e9408[_0x2862('0xb4')](_0x1d13e5);});return Promise['all'](_0x1e9408);})['then'](function(_0x365856){_0x3f9df8=_0x365856;var _0x43499d=_0x16a0d5[_0x2862('0xb7')](_0x3f9df8);return{'count':_0x43499d[_0x2862('0x4f')],'rows':_0x43499d};})[_0x2862('0x1e')](respondWithResult(_0x419460,null))[_0x2862('0x28')](function(_0x22f445){console[_0x2862('0xae')]('ServiceNow\x20error:\x20'+_0x22f445);var _0x398eb7=_0x4278be[_0x2862('0x3b')]['test']?0x1f4:_0x22f445['statusCode']||0x1f4;logger[_0x2862('0x25')](_0x22f445[_0x2862('0xb8')]);delete _0x22f445[_0x2862('0x35')];if(_0x398eb7===0x191){_0x398eb7=0x190;}_0x419460[_0x2862('0x29')](_0x398eb7)[_0x2862('0x36')](_0x4278be[_0x2862('0x3b')][_0x2862('0x1d')]?{'message':_0x2862('0xb9'),'statusCode':_0x22f445[_0x2862('0xba')]}:_0x22f445);});};function createFieldObject(_0x431bda,_0x2a0aa1,_0xd2d2a2,_0x25ba3b,_0x5f18b5,_0x4546d8){return new Promise(function(_0x5d5f35,_0x318f33){var _0x21cd5a={'id':_0x25ba3b,'name':_0x5f18b5,'custom':_0x4546d8};if(_0xd2d2a2===_0x2862('0xbb')){_0x21cd5a[_0x2862('0x50')]=[{'name':'True','value':_0x2862('0xbc')},{'name':'False','value':_0x2862('0xbd')}];_0x5d5f35(_0x21cd5a);}else{var _0x277f53={'method':_0x2862('0xbe'),'uri':_0x431bda+'sys_choice?sysparm_query=name=incident^element='+_0x25ba3b,'auth':_0x2a0aa1,'json':!![]};return rp(_0x277f53)[_0x2862('0x1e')](function(_0x31ed45){var _0x4d9f3e=[];if(_0x31ed45[_0x2862('0x27')][_0x2862('0x4f')]>0x0){_0x31ed45[_0x2862('0x27')][_0x2862('0xbf')](function(_0x4d49eb){if(_0x4d49eb[_0x2862('0xc0')]===_0x2862('0xbd')){var _0x1ab473={'name':_0x4d49eb[_0x2862('0xb3')],'value':_0x4d49eb[_0x2862('0xc1')]};_0x4d9f3e[_0x2862('0xb4')](_0x1ab473);}});}_0x21cd5a['options']=_0x4d9f3e;if(_0x21cd5a[_0x2862('0x50')][_0x2862('0x4f')]>0x0){_0x5d5f35(_0x21cd5a);}else{if(_0x4546d8==![]){_0x5d5f35();}else{_0x5d5f35(_0x21cd5a);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index cb6f974..76ffa90 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 _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','define','ServicenowAccount','lodash','util'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x7a54,0x106));var _0x47a5=function(_0x81fec7,_0x25a813){_0x81fec7=_0x81fec7-0x0;var _0x5cb051=_0x7a54[_0x81fec7];return _0x5cb051;};'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'));var integrations=require(_0x47a5('0x9'));module['exports']=function(_0x3d5629,_0x59199c){return _0x3d5629[_0x47a5('0xa')](_0x47a5('0xb'),attributes,{'tableName':'int_servicenow_accounts','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(_0x328d46,_0x438f65){var _0x5665e6=function(_0x1e8524){while(--_0x1e8524){_0x328d46['push'](_0x328d46['shift']());}};_0x5665e6(++_0x438f65);}(_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 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 e310446..ef3736f 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 _0x0909=['GetServicenowAccount','ShowServicenowAccount','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','options','raw','attributes','limit','include','map','model'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x0909,0x8f));var _0x9090=function(_0x547256,_0x1e73ae){_0x547256=_0x547256-0x0;var _0x24032e=_0x0909[_0x547256];return _0x24032e;};'use strict';var _=require(_0x9090('0x0'));var util=require(_0x9090('0x1'));var moment=require(_0x9090('0x2'));var BPromise=require(_0x9090('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9090('0x4'));var db=require(_0x9090('0x5'))['db'];var utils=require(_0x9090('0x6'));var logger=require(_0x9090('0x7'))(_0x9090('0x8'));var config=require('../../config/environment');var jayson=require(_0x9090('0x9'));var client=jayson[_0x9090('0xa')][_0x9090('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ade1f,_0x493433,_0x11f662){return new BPromise(function(_0x3d50e6,_0x581df1){return client[_0x9090('0xc')](_0x1ade1f,_0x11f662)[_0x9090('0xd')](function(_0x40f514){logger[_0x9090('0xe')](_0x9090('0xf'),_0x493433,_0x9090('0x10'));logger[_0x9090('0x11')](_0x9090('0x12'),_0x493433,_0x9090('0x10'),JSON[_0x9090('0x13')](_0x40f514));if(_0x40f514['error']){if(_0x40f514['error'][_0x9090('0x14')]===0x1f4){logger[_0x9090('0x15')](_0x9090('0xf'),_0x493433,_0x40f514[_0x9090('0x15')][_0x9090('0x16')]);return _0x581df1(_0x40f514[_0x9090('0x15')][_0x9090('0x16')]);}logger[_0x9090('0x15')](_0x9090('0xf'),_0x493433,_0x40f514[_0x9090('0x15')][_0x9090('0x16')]);return _0x3d50e6(_0x40f514[_0x9090('0x15')]['message']);}else{logger['info'](_0x9090('0xf'),_0x493433,'request\x20sent');_0x3d50e6(_0x40f514[_0x9090('0x17')][_0x9090('0x16')]);}})[_0x9090('0x18')](function(_0x750ffd){logger[_0x9090('0x15')](_0x9090('0xf'),_0x493433,_0x750ffd);_0x581df1(_0x750ffd);});});}exports['GetServicenowAccount']=function(_0x4c3a39){var _0x525cd7=this;return new Promise(function(_0x2f7dad,_0x1c56ac){return db['ServicenowAccount']['findAll']({'raw':_0x4c3a39['options']?_0x4c3a39[_0x9090('0x19')][_0x9090('0x1a')]===undefined?!![]:![]:!![],'where':_0x4c3a39[_0x9090('0x19')]?_0x4c3a39[_0x9090('0x19')]['where']||null:null,'attributes':_0x4c3a39['options']?_0x4c3a39[_0x9090('0x19')][_0x9090('0x1b')]||null:null,'limit':_0x4c3a39['options']?_0x4c3a39[_0x9090('0x19')][_0x9090('0x1c')]||null:null,'include':_0x4c3a39[_0x9090('0x19')]?_0x4c3a39['options'][_0x9090('0x1d')]?_[_0x9090('0x1e')](_0x4c3a39[_0x9090('0x19')]['include'],function(_0x27016e){return{'model':db[_0x27016e[_0x9090('0x1f')]],'as':_0x27016e['as'],'attributes':_0x27016e[_0x9090('0x1b')],'include':_0x27016e['include']?_['map'](_0x27016e['include'],function(_0x1375d3){return{'model':db[_0x1375d3[_0x9090('0x1f')]],'as':_0x1375d3['as'],'attributes':_0x1375d3[_0x9090('0x1b')],'include':_0x1375d3['include']?_[_0x9090('0x1e')](_0x1375d3[_0x9090('0x1d')],function(_0x6b4965){return{'model':db[_0x6b4965[_0x9090('0x1f')]],'as':_0x6b4965['as'],'attributes':_0x6b4965[_0x9090('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2590c0){logger['info'](_0x9090('0x20'),_0x4c3a39);logger[_0x9090('0x11')](_0x9090('0x20'),_0x4c3a39,JSON[_0x9090('0x13')](_0x2590c0));_0x2f7dad(_0x2590c0);})[_0x9090('0x18')](function(_0x476556){logger['error'](_0x9090('0x20'),_0x476556[_0x9090('0x16')],_0x4c3a39);_0x1c56ac(_0x525cd7[_0x9090('0x15')](0x1f4,_0x476556[_0x9090('0x16')]));});});};exports[_0x9090('0x21')]=function(_0x3aa613){var _0xe6611=this;return new Promise(function(_0x2d2968,_0x477cb9){return db['ServicenowAccount'][_0x9090('0x22')]({'raw':_0x3aa613[_0x9090('0x19')]?_0x3aa613[_0x9090('0x19')][_0x9090('0x1a')]===undefined?!![]:![]:!![],'where':_0x3aa613[_0x9090('0x19')]?_0x3aa613['options']['where']||null:null,'attributes':_0x3aa613[_0x9090('0x19')]?_0x3aa613[_0x9090('0x19')][_0x9090('0x1b')]||null:null,'include':_0x3aa613[_0x9090('0x19')]?_0x3aa613[_0x9090('0x19')][_0x9090('0x1d')]?_[_0x9090('0x1e')](_0x3aa613[_0x9090('0x19')][_0x9090('0x1d')],function(_0x54bc2c){return{'model':db[_0x54bc2c[_0x9090('0x1f')]],'as':_0x54bc2c['as'],'attributes':_0x54bc2c[_0x9090('0x1b')],'include':_0x54bc2c[_0x9090('0x1d')]?_[_0x9090('0x1e')](_0x54bc2c['include'],function(_0x51583a){return{'model':db[_0x51583a['model']],'as':_0x51583a['as'],'attributes':_0x51583a['attributes'],'include':_0x51583a['include']?_[_0x9090('0x1e')](_0x51583a[_0x9090('0x1d')],function(_0x49ca9f){return{'model':db[_0x49ca9f[_0x9090('0x1f')]],'as':_0x49ca9f['as'],'attributes':_0x49ca9f[_0x9090('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5824c6){logger['info']('ShowServicenowAccount',_0x3aa613);logger['debug'](_0x9090('0x21'),_0x3aa613,JSON[_0x9090('0x13')](_0x5824c6));_0x2d2968(_0x5824c6);})[_0x9090('0x18')](function(_0x3cc9f7){logger['error']('ShowServicenowAccount',_0x3cc9f7[_0x9090('0x16')],_0x3aa613);_0x477cb9(_0xe6611[_0x9090('0x15')](0x1f4,_0x3cc9f7['message']));});});}; \ No newline at end of file +var _0x86de=['../../config/logger','rpc','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetServicenowAccount','findAll','options','where','attributes','limit','map','include','model','catch','ShowServicenowAccount','ServicenowAccount','find','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x4ad508,_0x862dcb){var _0xb67fed=function(_0x573261){while(--_0x573261){_0x4ad508['push'](_0x4ad508['shift']());}};_0xb67fed(++_0x862dcb);}(_0x86de,0xfc));var _0xe86d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x86de[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xe86d('0x0'));var util=require(_0xe86d('0x1'));var moment=require(_0xe86d('0x2'));var BPromise=require(_0xe86d('0x3'));var rs=require(_0xe86d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe86d('0x5'))['db'];var utils=require(_0xe86d('0x6'));var logger=require(_0xe86d('0x7'))(_0xe86d('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe86d('0x9')][_0xe86d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5544f5,_0x13a1e2,_0x30e4a9){return new BPromise(function(_0x31ed0c,_0x1c05ae){return client[_0xe86d('0xb')](_0x5544f5,_0x30e4a9)[_0xe86d('0xc')](function(_0x42c993){logger[_0xe86d('0xd')](_0xe86d('0xe'),_0x13a1e2,_0xe86d('0xf'));logger[_0xe86d('0x10')](_0xe86d('0x11'),_0x13a1e2,_0xe86d('0xf'),JSON[_0xe86d('0x12')](_0x42c993));if(_0x42c993[_0xe86d('0x13')]){if(_0x42c993['error'][_0xe86d('0x14')]===0x1f4){logger[_0xe86d('0x13')]('ServicenowAccount,\x20%s,\x20%s',_0x13a1e2,_0x42c993[_0xe86d('0x13')]['message']);return _0x1c05ae(_0x42c993['error'][_0xe86d('0x15')]);}logger[_0xe86d('0x13')](_0xe86d('0xe'),_0x13a1e2,_0x42c993[_0xe86d('0x13')][_0xe86d('0x15')]);return _0x31ed0c(_0x42c993['error'][_0xe86d('0x15')]);}else{logger[_0xe86d('0xd')](_0xe86d('0xe'),_0x13a1e2,_0xe86d('0xf'));_0x31ed0c(_0x42c993[_0xe86d('0x16')]['message']);}})['catch'](function(_0x4b6cd8){logger[_0xe86d('0x13')](_0xe86d('0xe'),_0x13a1e2,_0x4b6cd8);_0x1c05ae(_0x4b6cd8);});});}exports[_0xe86d('0x17')]=function(_0x4ef28f){var _0x2f89c9=this;return new Promise(function(_0x5d3f2e,_0x5447a0){return db['ServicenowAccount'][_0xe86d('0x18')]({'raw':_0x4ef28f['options']?_0x4ef28f[_0xe86d('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4ef28f[_0xe86d('0x19')]?_0x4ef28f[_0xe86d('0x19')][_0xe86d('0x1a')]||null:null,'attributes':_0x4ef28f[_0xe86d('0x19')]?_0x4ef28f[_0xe86d('0x19')][_0xe86d('0x1b')]||null:null,'limit':_0x4ef28f['options']?_0x4ef28f[_0xe86d('0x19')][_0xe86d('0x1c')]||null:null,'include':_0x4ef28f[_0xe86d('0x19')]?_0x4ef28f['options']['include']?_[_0xe86d('0x1d')](_0x4ef28f[_0xe86d('0x19')][_0xe86d('0x1e')],function(_0x1f47f4){return{'model':db[_0x1f47f4[_0xe86d('0x1f')]],'as':_0x1f47f4['as'],'attributes':_0x1f47f4[_0xe86d('0x1b')],'include':_0x1f47f4[_0xe86d('0x1e')]?_[_0xe86d('0x1d')](_0x1f47f4[_0xe86d('0x1e')],function(_0xafee14){return{'model':db[_0xafee14[_0xe86d('0x1f')]],'as':_0xafee14['as'],'attributes':_0xafee14[_0xe86d('0x1b')],'include':_0xafee14[_0xe86d('0x1e')]?_['map'](_0xafee14['include'],function(_0x440dd5){return{'model':db[_0x440dd5[_0xe86d('0x1f')]],'as':_0x440dd5['as'],'attributes':_0x440dd5[_0xe86d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe86d('0xc')](function(_0x27976e){logger[_0xe86d('0xd')](_0xe86d('0x17'),_0x4ef28f);logger[_0xe86d('0x10')](_0xe86d('0x17'),_0x4ef28f,JSON[_0xe86d('0x12')](_0x27976e));_0x5d3f2e(_0x27976e);})[_0xe86d('0x20')](function(_0x2772f5){logger['error']('GetServicenowAccount',_0x2772f5[_0xe86d('0x15')],_0x4ef28f);_0x5447a0(_0x2f89c9[_0xe86d('0x13')](0x1f4,_0x2772f5[_0xe86d('0x15')]));});});};exports[_0xe86d('0x21')]=function(_0x46a195){var _0x5298f5=this;return new Promise(function(_0x5c515b,_0x5b3015){return db[_0xe86d('0x22')][_0xe86d('0x23')]({'raw':_0x46a195[_0xe86d('0x19')]?_0x46a195['options'][_0xe86d('0x24')]===undefined?!![]:![]:!![],'where':_0x46a195[_0xe86d('0x19')]?_0x46a195[_0xe86d('0x19')]['where']||null:null,'attributes':_0x46a195[_0xe86d('0x19')]?_0x46a195[_0xe86d('0x19')][_0xe86d('0x1b')]||null:null,'include':_0x46a195[_0xe86d('0x19')]?_0x46a195[_0xe86d('0x19')][_0xe86d('0x1e')]?_[_0xe86d('0x1d')](_0x46a195['options']['include'],function(_0x88f3ed){return{'model':db[_0x88f3ed[_0xe86d('0x1f')]],'as':_0x88f3ed['as'],'attributes':_0x88f3ed['attributes'],'include':_0x88f3ed[_0xe86d('0x1e')]?_[_0xe86d('0x1d')](_0x88f3ed[_0xe86d('0x1e')],function(_0x10ae13){return{'model':db[_0x10ae13[_0xe86d('0x1f')]],'as':_0x10ae13['as'],'attributes':_0x10ae13[_0xe86d('0x1b')],'include':_0x10ae13[_0xe86d('0x1e')]?_[_0xe86d('0x1d')](_0x10ae13[_0xe86d('0x1e')],function(_0x48e07b){return{'model':db[_0x48e07b[_0xe86d('0x1f')]],'as':_0x48e07b['as'],'attributes':_0x48e07b['attributes']};}):[]};}):[]};}):[]:[]})[_0xe86d('0xc')](function(_0xfb313f){logger[_0xe86d('0xd')](_0xe86d('0x21'),_0x46a195);logger[_0xe86d('0x10')](_0xe86d('0x21'),_0x46a195,JSON[_0xe86d('0x12')](_0xfb313f));_0x5c515b(_0xfb313f);})[_0xe86d('0x20')](function(_0xbbd352){logger['error'](_0xe86d('0x21'),_0xbbd352[_0xe86d('0x15')],_0x46a195);_0x5b3015(_0x5298f5[_0xe86d('0x13')](0x1f4,_0xbbd352['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 52622f8..4ec081b 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 _0xc28b=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','exports','multer','util','path'];(function(_0x264c64,_0xf8d885){var _0x5f352d=function(_0x350c25){while(--_0x350c25){_0x264c64['push'](_0x264c64['shift']());}};_0x5f352d(++_0xf8d885);}(_0xc28b,0xa5));var _0xbc28=function(_0x2af713,_0x2a5119){_0x2af713=_0x2af713-0x0;var _0x214e53=_0xc28b[_0x2af713];return _0x214e53;};'use strict';var multer=require(_0xbc28('0x0'));var util=require(_0xbc28('0x1'));var path=require(_0xbc28('0x2'));var timeout=require(_0xbc28('0x3'));var express=require(_0xbc28('0x4'));var router=express['Router']();var auth=require(_0xbc28('0x5'));var interaction=require(_0xbc28('0x6'));var config=require('../../config/environment');var controller=require(_0xbc28('0x7'));router[_0xbc28('0x8')]('/',auth[_0xbc28('0x9')](),controller[_0xbc28('0xa')]);router[_0xbc28('0x8')](_0xbc28('0xb'),auth[_0xbc28('0x9')](),controller[_0xbc28('0xc')]);router[_0xbc28('0x8')](_0xbc28('0xd'),auth[_0xbc28('0x9')](),controller[_0xbc28('0xe')]);router[_0xbc28('0x8')]('/:id/subjects',auth[_0xbc28('0x9')](),controller[_0xbc28('0xf')]);router['get'](_0xbc28('0x10'),auth['isAuthenticated'](),controller[_0xbc28('0x11')]);router[_0xbc28('0x12')]('/',auth['isAuthenticated'](),controller[_0xbc28('0x13')]);router[_0xbc28('0x14')](_0xbc28('0xb'),auth[_0xbc28('0x9')](),controller[_0xbc28('0x15')]);router[_0xbc28('0x16')](_0xbc28('0xb'),auth[_0xbc28('0x9')](),controller['destroy']);module[_0xbc28('0x17')]=router; \ No newline at end of file +var _0x982d=['getDescriptions','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions'];(function(_0x867c94,_0x44ec82){var _0x5a51a4=function(_0x366801){while(--_0x366801){_0x867c94['push'](_0x867c94['shift']());}};_0x5a51a4(++_0x44ec82);}(_0x982d,0xaf));var _0xd982=function(_0x173268,_0x458a14){_0x173268=_0x173268-0x0;var _0x5eb028=_0x982d[_0x173268];return _0x5eb028;};'use strict';var multer=require('multer');var util=require(_0xd982('0x0'));var path=require(_0xd982('0x1'));var timeout=require(_0xd982('0x2'));var express=require(_0xd982('0x3'));var router=express[_0xd982('0x4')]();var auth=require(_0xd982('0x5'));var interaction=require(_0xd982('0x6'));var config=require(_0xd982('0x7'));var controller=require('./intServicenowConfiguration.controller');router[_0xd982('0x8')]('/',auth['isAuthenticated'](),controller[_0xd982('0x9')]);router[_0xd982('0x8')](_0xd982('0xa'),auth[_0xd982('0xb')](),controller[_0xd982('0xc')]);router[_0xd982('0x8')](_0xd982('0xd'),auth['isAuthenticated'](),controller[_0xd982('0xe')]);router[_0xd982('0x8')](_0xd982('0xf'),auth[_0xd982('0xb')](),controller['getSubjects']);router[_0xd982('0x8')](_0xd982('0x10'),auth[_0xd982('0xb')](),controller[_0xd982('0x11')]);router['post']('/',auth[_0xd982('0xb')](),controller[_0xd982('0x12')]);router[_0xd982('0x13')]('/:id',auth[_0xd982('0xb')](),controller[_0xd982('0x14')]);router[_0xd982('0x15')](_0xd982('0xa'),auth[_0xd982('0xb')](),controller[_0xd982('0x16')]);module[_0xd982('0x17')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index a806e70..70ddfc0 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 _0xc733=['STRING'];(function(_0x508926,_0xa05b4f){var _0x49ab00=function(_0x360b74){while(--_0x360b74){_0x508926['push'](_0x508926['shift']());}};_0x49ab00(++_0xa05b4f);}(_0xc733,0x14d));var _0x3c73=function(_0xb4ebd,_0x4b707c){_0xb4ebd=_0xb4ebd-0x0;var _0x1d73f7=_0xc733[_0xb4ebd];return _0x1d73f7;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3c73('0x0')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x801b=['exports'];(function(_0x1b25c1,_0x2c6ce6){var _0x1e4447=function(_0xaaafca){while(--_0xaaafca){_0x1b25c1['push'](_0x1b25c1['shift']());}};_0x1e4447(++_0x2c6ce6);}(_0x801b,0xaf));var _0xb801=function(_0x1223db,_0x3d817f){_0x1223db=_0x1223db-0x0;var _0x5df6bf=_0x801b[_0x1223db];return _0x5df6bf;};'use strict';var Sequelize=require('sequelize');module[_0xb801('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 4f299df..538de37 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 _0x7217=['model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','map','type','key','VIRTUAL','options','includeAll','include','findAll','rows','params','find','create','body','findOne','sort','getFields','getSubjects','ServicenowField','getDescriptions','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','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','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','ServicenowConfiguration','rawAttributes'];(function(_0x9d94c3,_0x12a52b){var _0x34d2a3=function(_0x47e999){while(--_0x47e999){_0x9d94c3['push'](_0x9d94c3['shift']());}};_0x34d2a3(++_0x12a52b);}(_0x7217,0x19e));var _0x7721=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0x7217[_0x934425];return _0x31d596;};'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'];var jayson=require(_0x7721('0x1a'));var client=jayson[_0x7721('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x2911ec,_0x199930,_0x57ff6d){if(_0x57ff6d){var _0x109900=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x109900[_0x7721('0x1c')](_0x199930)){return _0x2911ec;}else{throw new Error(_0x7721('0x1d'));}}else{return _0x2911ec;}}function respondWithRpcPromise(_0x2e9752,_0x5069da,_0x3cbce8,_0x25b1c0){return new BPromise(function(_0x534f1b,_0x4e199a){var _0x4b183e=_0x25b1c0||client;return _0x4b183e[_0x7721('0x1e')](_0x2e9752,_0x3cbce8)[_0x7721('0x1f')](function(_0x3cc909){logger[_0x7721('0x20')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5069da,_0x7721('0x21'));logger['debug'](_0x7721('0x22'),_0x5069da,'request\x20sent',JSON[_0x7721('0x23')](_0x3cc909));if(_0x3cc909[_0x7721('0x24')]){if(_0x3cc909[_0x7721('0x24')][_0x7721('0x25')]===0x1f4){logger[_0x7721('0x24')](_0x7721('0x26'),_0x5069da,_0x3cc909[_0x7721('0x24')][_0x7721('0x27')]);return _0x4e199a(_0x3cc909[_0x7721('0x24')][_0x7721('0x27')]);}logger['error'](_0x7721('0x26'),_0x5069da,_0x3cc909[_0x7721('0x24')][_0x7721('0x27')]);return _0x534f1b(_0x3cc909[_0x7721('0x24')]['message']);}else{logger[_0x7721('0x20')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5069da,_0x7721('0x21'));_0x534f1b(_0x3cc909[_0x7721('0x28')][_0x7721('0x27')]);}})[_0x7721('0x29')](function(_0x121cc4){logger[_0x7721('0x24')](_0x7721('0x26'),_0x5069da,_0x121cc4);_0x4e199a(_0x121cc4);});});}function respondWithStatusCode(_0x5b4d74,_0x216f20){_0x216f20=_0x216f20||0xcc;return function(_0x1abedb){if(_0x1abedb){return _0x5b4d74[_0x7721('0x2a')](_0x216f20);}return _0x5b4d74[_0x7721('0x2b')](_0x216f20)[_0x7721('0x2c')]();};}function respondWithResult(_0x16355a,_0x424e05){_0x424e05=_0x424e05||0xc8;return function(_0xf753f1){if(_0xf753f1){return _0x16355a[_0x7721('0x2b')](_0x424e05)['json'](_0xf753f1);}};}function respondWithFilteredResult(_0x258ddf,_0x5b0551){return function(_0x499b87){if(_0x499b87){var _0x315202=_0x499b87[_0x7721('0x2d')],_0x343c19=_0x5b0551[_0x7721('0x2e')],_0x53c904=_0x5b0551[_0x7721('0x2e')]+_0x5b0551[_0x7721('0x2f')],_0x158d98;if(_0x53c904>=_0x315202){_0x53c904=_0x315202;_0x158d98=0xc8;}else{_0x158d98=0xce;}_0x258ddf['status'](_0x158d98);return _0x258ddf[_0x7721('0x30')](_0x7721('0x31'),_0x343c19+'-'+_0x53c904+'/'+_0x315202)['json'](_0x499b87);}return null;};}function patchUpdates(_0x4a25c9){return function(_0xfde9ec){try{jsonpatch[_0x7721('0x32')](_0xfde9ec,_0x4a25c9,!![]);}catch(_0x48f329){return BPromise[_0x7721('0x33')](_0x48f329);}return _0xfde9ec[_0x7721('0x34')]();};}function saveUpdates(_0x382821,_0x58d54b){return function(_0x3d9a32){if(_0x3d9a32){return _0x3d9a32[_0x7721('0x35')](_0x382821)[_0x7721('0x1f')](function(_0x3f15e2){return _0x3f15e2;});}return null;};}function removeEntity(_0xc0f3c4,_0x508202){return function(_0x195ffb){if(_0x195ffb){return _0x195ffb[_0x7721('0x36')]()[_0x7721('0x1f')](function(){_0xc0f3c4['status'](0xcc)[_0x7721('0x2c')]();});}};}function handleEntityNotFound(_0x213a2e,_0x498654){return function(_0x217592){if(!_0x217592){_0x213a2e['sendStatus'](0x194);}return _0x217592;};}function handleError(_0x2d6ba0,_0x326c50){_0x326c50=_0x326c50||0x1f4;return function(_0x19d082){logger[_0x7721('0x24')](_0x19d082[_0x7721('0x37')]);if(_0x19d082[_0x7721('0x38')]){delete _0x19d082[_0x7721('0x38')];}_0x2d6ba0[_0x7721('0x2b')](_0x326c50)[_0x7721('0x39')](_0x19d082);};}exports[_0x7721('0x3a')]=function(_0x385454,_0x5c806d){var _0xd1df68={},_0x5e6663={},_0x212384={'count':0x0,'rows':[]};var _0x35614c=db[_0x7721('0x3b')][_0x7721('0x3c')];_0x5e6663[_0x7721('0x3d')]=_[_0x7721('0x3e')](_0x35614c);_0x5e6663['query']=_['keys'](_0x385454['query']);_0x5e6663['filters']=_[_0x7721('0x3f')](_0x5e6663[_0x7721('0x3d')],_0x5e6663[_0x7721('0x40')]);_0xd1df68[_0x7721('0x41')]=_['intersection'](_0x5e6663[_0x7721('0x3d')],qs['fields'](_0x385454[_0x7721('0x40')][_0x7721('0x42')]));_0xd1df68['attributes']=_0xd1df68[_0x7721('0x41')][_0x7721('0x43')]?_0xd1df68['attributes']:_0x5e6663['model'];if(!_0x385454[_0x7721('0x40')][_0x7721('0x44')](_0x7721('0x45'))){_0xd1df68[_0x7721('0x2f')]=qs['limit'](_0x385454[_0x7721('0x40')][_0x7721('0x2f')]);_0xd1df68[_0x7721('0x2e')]=qs[_0x7721('0x2e')](_0x385454[_0x7721('0x40')]['offset']);}_0xd1df68[_0x7721('0x46')]=qs['sort'](_0x385454[_0x7721('0x40')]['sort']);_0xd1df68[_0x7721('0x47')]=qs[_0x7721('0x48')](_[_0x7721('0x49')](_0x385454['query'],_0x5e6663[_0x7721('0x48')]));if(_0x385454[_0x7721('0x40')][_0x7721('0x4a')]){_0xd1df68['where']=_[_0x7721('0x4b')](_0xd1df68[_0x7721('0x47')],{'$or':_[_0x7721('0x4c')](_0x35614c,function(_0x2d5f35){if(_0x2d5f35[_0x7721('0x4d')][_0x7721('0x4e')]!==_0x7721('0x4f')){var _0x4c76c3={};_0x4c76c3[_0x2d5f35['field']]={'$like':'%'+_0x385454[_0x7721('0x40')][_0x7721('0x4a')]+'%'};return _0x4c76c3;}})});}_0xd1df68=_[_0x7721('0x4b')]({},_0xd1df68,_0x385454[_0x7721('0x50')]);var _0x335145={'where':_0xd1df68[_0x7721('0x47')]};return db[_0x7721('0x3b')][_0x7721('0x2d')](_0x335145)[_0x7721('0x1f')](function(_0x3af123){_0x212384['count']=_0x3af123;if(_0x385454['query'][_0x7721('0x51')]){_0xd1df68[_0x7721('0x52')]=[{'all':!![]}];}return db[_0x7721('0x3b')][_0x7721('0x53')](_0xd1df68);})['then'](function(_0x30107e){_0x212384[_0x7721('0x54')]=_0x30107e;return _0x212384;})['then'](respondWithFilteredResult(_0x5c806d,_0xd1df68))[_0x7721('0x29')](handleError(_0x5c806d,null));};exports['show']=function(_0x2682b1,_0x5c6922){var _0x334f23={'raw':![],'where':{'id':_0x2682b1[_0x7721('0x55')]['id']}},_0x196be4={};_0x196be4['model']=_[_0x7721('0x3e')](db[_0x7721('0x3b')]['rawAttributes']);_0x196be4[_0x7721('0x40')]=_[_0x7721('0x3e')](_0x2682b1[_0x7721('0x40')]);_0x196be4['filters']=_[_0x7721('0x3f')](_0x196be4['model'],_0x196be4[_0x7721('0x40')]);_0x334f23[_0x7721('0x41')]=_[_0x7721('0x3f')](_0x196be4[_0x7721('0x3d')],qs[_0x7721('0x42')](_0x2682b1[_0x7721('0x40')][_0x7721('0x42')]));_0x334f23[_0x7721('0x41')]=_0x334f23[_0x7721('0x41')][_0x7721('0x43')]?_0x334f23[_0x7721('0x41')]:_0x196be4[_0x7721('0x3d')];if(_0x2682b1[_0x7721('0x40')][_0x7721('0x51')]){_0x334f23[_0x7721('0x52')]=[{'all':!![]}];}_0x334f23=_['merge']({},_0x334f23,_0x2682b1[_0x7721('0x50')]);return db[_0x7721('0x3b')][_0x7721('0x56')](_0x334f23)[_0x7721('0x1f')](handleEntityNotFound(_0x5c6922,null))[_0x7721('0x1f')](respondWithResult(_0x5c6922,null))[_0x7721('0x29')](handleError(_0x5c6922,null));};exports[_0x7721('0x57')]=function(_0x57484c,_0x234bee){return db[_0x7721('0x3b')][_0x7721('0x57')](_0x57484c[_0x7721('0x58')],{})[_0x7721('0x1f')](respondWithResult(_0x234bee,0xc9))[_0x7721('0x29')](handleError(_0x234bee,null));};exports[_0x7721('0x35')]=function(_0x33287d,_0x11b300){if(_0x33287d[_0x7721('0x58')]['id']){delete _0x33287d[_0x7721('0x58')]['id'];}return db['ServicenowConfiguration'][_0x7721('0x56')]({'where':{'id':_0x33287d[_0x7721('0x55')]['id']}})[_0x7721('0x1f')](handleEntityNotFound(_0x11b300,null))[_0x7721('0x1f')](saveUpdates(_0x33287d[_0x7721('0x58')],null))[_0x7721('0x1f')](respondWithResult(_0x11b300,null))[_0x7721('0x29')](handleError(_0x11b300,null));};exports[_0x7721('0x36')]=function(_0x360882,_0x287452){return db[_0x7721('0x3b')][_0x7721('0x56')]({'where':{'id':_0x360882[_0x7721('0x55')]['id']}})[_0x7721('0x1f')](handleEntityNotFound(_0x287452,null))[_0x7721('0x1f')](removeEntity(_0x287452,null))['catch'](handleError(_0x287452,null));};exports['getFields']=function(_0x4e112e,_0x885a3a,_0x4f2fe6){var _0x4a46db={};var _0x57348c={};var _0x5d7036;var _0x47925a;return db[_0x7721('0x3b')][_0x7721('0x59')]({'where':{'id':_0x4e112e['params']['id']}})[_0x7721('0x1f')](handleEntityNotFound(_0x885a3a,null))['then'](function(_0x51a3a2){if(_0x51a3a2){_0x5d7036=_0x51a3a2;_0x57348c['model']=_[_0x7721('0x3e')](db['ServicenowField']['rawAttributes']);_0x57348c['query']=_[_0x7721('0x3e')](_0x4e112e[_0x7721('0x40')]);_0x57348c[_0x7721('0x48')]=_['intersection'](_0x57348c[_0x7721('0x3d')],_0x57348c[_0x7721('0x40')]);_0x4a46db[_0x7721('0x41')]=_[_0x7721('0x3f')](_0x57348c[_0x7721('0x3d')],qs[_0x7721('0x42')](_0x4e112e[_0x7721('0x40')][_0x7721('0x42')]));_0x4a46db[_0x7721('0x41')]=_0x4a46db[_0x7721('0x41')][_0x7721('0x43')]?_0x4a46db[_0x7721('0x41')]:_0x57348c[_0x7721('0x3d')];_0x4a46db[_0x7721('0x46')]=qs[_0x7721('0x5a')](_0x4e112e['query'][_0x7721('0x5a')]);_0x4a46db[_0x7721('0x47')]=qs[_0x7721('0x48')](_[_0x7721('0x49')](_0x4e112e['query'],_0x57348c[_0x7721('0x48')]));if(_0x4e112e[_0x7721('0x40')]['filter']){_0x4a46db[_0x7721('0x47')]=_['merge'](_0x4a46db[_0x7721('0x47')],{'$or':_[_0x7721('0x4c')](_0x4a46db[_0x7721('0x41')],function(_0x3f9eaa){var _0x3d2b7d={};_0x3d2b7d[_0x3f9eaa]={'$like':'%'+_0x4e112e[_0x7721('0x40')][_0x7721('0x4a')]+'%'};return _0x3d2b7d;})});}_0x4a46db=_[_0x7721('0x4b')]({},_0x4a46db,_0x4e112e[_0x7721('0x50')]);return _0x5d7036['getFields'](_0x4a46db);}})[_0x7721('0x1f')](function(_0x24444f){if(_0x24444f){_0x47925a=_0x24444f[_0x7721('0x43')];if(!_0x4e112e[_0x7721('0x40')][_0x7721('0x44')](_0x7721('0x45'))){_0x4a46db[_0x7721('0x2f')]=qs['limit'](_0x4e112e[_0x7721('0x40')][_0x7721('0x2f')]);_0x4a46db['offset']=qs[_0x7721('0x2e')](_0x4e112e['query'][_0x7721('0x2e')]);}return _0x5d7036[_0x7721('0x5b')](_0x4a46db);}})[_0x7721('0x1f')](function(_0x3b64ec){if(_0x3b64ec){return _0x3b64ec?{'count':_0x47925a,'rows':_0x3b64ec}:null;}})[_0x7721('0x1f')](respondWithResult(_0x885a3a,null))[_0x7721('0x29')](handleError(_0x885a3a,null));};exports[_0x7721('0x5c')]=function(_0x5dca04,_0xbcedbd,_0x1d252a){var _0x280b1d={};var _0x5f08cc={};var _0x5cef5a;var _0x515fb9;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x5dca04[_0x7721('0x55')]['id']}})[_0x7721('0x1f')](handleEntityNotFound(_0xbcedbd,null))['then'](function(_0x2d4b3a){if(_0x2d4b3a){_0x5cef5a=_0x2d4b3a;_0x5f08cc[_0x7721('0x3d')]=_[_0x7721('0x3e')](db[_0x7721('0x5d')]['rawAttributes']);_0x5f08cc[_0x7721('0x40')]=_[_0x7721('0x3e')](_0x5dca04[_0x7721('0x40')]);_0x5f08cc[_0x7721('0x48')]=_[_0x7721('0x3f')](_0x5f08cc['model'],_0x5f08cc[_0x7721('0x40')]);_0x280b1d[_0x7721('0x41')]=_[_0x7721('0x3f')](_0x5f08cc['model'],qs['fields'](_0x5dca04[_0x7721('0x40')][_0x7721('0x42')]));_0x280b1d[_0x7721('0x41')]=_0x280b1d[_0x7721('0x41')][_0x7721('0x43')]?_0x280b1d['attributes']:_0x5f08cc['model'];_0x280b1d[_0x7721('0x46')]=qs[_0x7721('0x5a')](_0x5dca04[_0x7721('0x40')][_0x7721('0x5a')]);_0x280b1d[_0x7721('0x47')]=qs[_0x7721('0x48')](_[_0x7721('0x49')](_0x5dca04['query'],_0x5f08cc[_0x7721('0x48')]));if(_0x5dca04[_0x7721('0x40')][_0x7721('0x4a')]){_0x280b1d['where']=_[_0x7721('0x4b')](_0x280b1d[_0x7721('0x47')],{'$or':_[_0x7721('0x4c')](_0x280b1d[_0x7721('0x41')],function(_0x56af64){var _0x4d4d6a={};_0x4d4d6a[_0x56af64]={'$like':'%'+_0x5dca04[_0x7721('0x40')][_0x7721('0x4a')]+'%'};return _0x4d4d6a;})});}_0x280b1d=_[_0x7721('0x4b')]({},_0x280b1d,_0x5dca04[_0x7721('0x50')]);return _0x5cef5a[_0x7721('0x5c')](_0x280b1d);}})[_0x7721('0x1f')](function(_0x59e80c){if(_0x59e80c){_0x515fb9=_0x59e80c[_0x7721('0x43')];if(!_0x5dca04[_0x7721('0x40')][_0x7721('0x44')]('nolimit')){_0x280b1d[_0x7721('0x2f')]=qs[_0x7721('0x2f')](_0x5dca04[_0x7721('0x40')][_0x7721('0x2f')]);_0x280b1d[_0x7721('0x2e')]=qs['offset'](_0x5dca04[_0x7721('0x40')]['offset']);}return _0x5cef5a[_0x7721('0x5c')](_0x280b1d);}})[_0x7721('0x1f')](function(_0x2d5433){if(_0x2d5433){return _0x2d5433?{'count':_0x515fb9,'rows':_0x2d5433}:null;}})[_0x7721('0x1f')](respondWithResult(_0xbcedbd,null))[_0x7721('0x29')](handleError(_0xbcedbd,null));};exports[_0x7721('0x5e')]=function(_0x24fe2a,_0x123049,_0x2ec5f8){var _0x3b78f5={};var _0x2c74d8={};var _0x55d209;var _0x19fad6;return db[_0x7721('0x3b')][_0x7721('0x59')]({'where':{'id':_0x24fe2a['params']['id']}})[_0x7721('0x1f')](handleEntityNotFound(_0x123049,null))[_0x7721('0x1f')](function(_0x139517){if(_0x139517){_0x55d209=_0x139517;_0x2c74d8[_0x7721('0x3d')]=_[_0x7721('0x3e')](db['ServicenowField'][_0x7721('0x3c')]);_0x2c74d8[_0x7721('0x40')]=_[_0x7721('0x3e')](_0x24fe2a[_0x7721('0x40')]);_0x2c74d8[_0x7721('0x48')]=_[_0x7721('0x3f')](_0x2c74d8['model'],_0x2c74d8[_0x7721('0x40')]);_0x3b78f5[_0x7721('0x41')]=_['intersection'](_0x2c74d8[_0x7721('0x3d')],qs['fields'](_0x24fe2a[_0x7721('0x40')][_0x7721('0x42')]));_0x3b78f5['attributes']=_0x3b78f5[_0x7721('0x41')]['length']?_0x3b78f5['attributes']:_0x2c74d8['model'];_0x3b78f5[_0x7721('0x46')]=qs[_0x7721('0x5a')](_0x24fe2a[_0x7721('0x40')]['sort']);_0x3b78f5['where']=qs['filters'](_[_0x7721('0x49')](_0x24fe2a[_0x7721('0x40')],_0x2c74d8[_0x7721('0x48')]));if(_0x24fe2a[_0x7721('0x40')][_0x7721('0x4a')]){_0x3b78f5[_0x7721('0x47')]=_['merge'](_0x3b78f5[_0x7721('0x47')],{'$or':_[_0x7721('0x4c')](_0x3b78f5[_0x7721('0x41')],function(_0xcf5304){var _0x977255={};_0x977255[_0xcf5304]={'$like':'%'+_0x24fe2a[_0x7721('0x40')][_0x7721('0x4a')]+'%'};return _0x977255;})});}_0x3b78f5=_[_0x7721('0x4b')]({},_0x3b78f5,_0x24fe2a[_0x7721('0x50')]);return _0x55d209[_0x7721('0x5e')](_0x3b78f5);}})[_0x7721('0x1f')](function(_0x368dbb){if(_0x368dbb){_0x19fad6=_0x368dbb['length'];if(!_0x24fe2a['query'][_0x7721('0x44')](_0x7721('0x45'))){_0x3b78f5['limit']=qs[_0x7721('0x2f')](_0x24fe2a['query']['limit']);_0x3b78f5[_0x7721('0x2e')]=qs['offset'](_0x24fe2a['query'][_0x7721('0x2e')]);}return _0x55d209[_0x7721('0x5e')](_0x3b78f5);}})[_0x7721('0x1f')](function(_0x3698b3){if(_0x3698b3){return _0x3698b3?{'count':_0x19fad6,'rows':_0x3698b3}:null;}})[_0x7721('0x1f')](respondWithResult(_0x123049,null))['catch'](handleError(_0x123049,null));}; \ No newline at end of file +var _0xc4aa=['order','getSubjects','getDescriptions','rawAttributes','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','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','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','ServicenowConfiguration','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','map','type','VIRTUAL','options','includeAll','include','findAll','params','create','body','find','getFields','findOne','ServicenowField'];(function(_0x113118,_0x1a7f8a){var _0x46d5cc=function(_0x481cfc){while(--_0x481cfc){_0x113118['push'](_0x113118['shift']());}};_0x46d5cc(++_0x1a7f8a);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xc4aa[_0x17b6e3];return _0x3906f3;};'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'];var jayson=require(_0xac4a('0x15'));var client=jayson[_0xac4a('0x16')][_0xac4a('0x17')]({'port':0x232a});function checkPasswordPattern(_0x5e16aa,_0x21a79,_0x68424a){if(_0x68424a){var _0x247b78=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x247b78[_0xac4a('0x18')](_0x21a79)){return _0x5e16aa;}else{throw new Error(_0xac4a('0x19'));}}else{return _0x5e16aa;}}function respondWithRpcPromise(_0x3b71c0,_0x34bc01,_0x33c287,_0x190418){return new BPromise(function(_0x42c7fc,_0x11e101){var _0x26dbb8=_0x190418||client;return _0x26dbb8['request'](_0x3b71c0,_0x33c287)[_0xac4a('0x1a')](function(_0x34d797){logger[_0xac4a('0x1b')](_0xac4a('0x1c'),_0x34bc01,_0xac4a('0x1d'));logger[_0xac4a('0x1e')](_0xac4a('0x1f'),_0x34bc01,_0xac4a('0x1d'),JSON['stringify'](_0x34d797));if(_0x34d797['error']){if(_0x34d797[_0xac4a('0x20')][_0xac4a('0x21')]===0x1f4){logger[_0xac4a('0x20')]('ServicenowConfiguration,\x20%s,\x20%s',_0x34bc01,_0x34d797[_0xac4a('0x20')][_0xac4a('0x22')]);return _0x11e101(_0x34d797[_0xac4a('0x20')][_0xac4a('0x22')]);}logger[_0xac4a('0x20')](_0xac4a('0x1c'),_0x34bc01,_0x34d797[_0xac4a('0x20')][_0xac4a('0x22')]);return _0x42c7fc(_0x34d797['error'][_0xac4a('0x22')]);}else{logger[_0xac4a('0x1b')]('ServicenowConfiguration,\x20%s,\x20%s',_0x34bc01,_0xac4a('0x1d'));_0x42c7fc(_0x34d797[_0xac4a('0x23')][_0xac4a('0x22')]);}})[_0xac4a('0x24')](function(_0x4d2d6c){logger[_0xac4a('0x20')](_0xac4a('0x1c'),_0x34bc01,_0x4d2d6c);_0x11e101(_0x4d2d6c);});});}function respondWithStatusCode(_0x15435c,_0x412494){_0x412494=_0x412494||0xcc;return function(_0x594f36){if(_0x594f36){return _0x15435c[_0xac4a('0x25')](_0x412494);}return _0x15435c[_0xac4a('0x26')](_0x412494)[_0xac4a('0x27')]();};}function respondWithResult(_0x3e2c69,_0x3bc318){_0x3bc318=_0x3bc318||0xc8;return function(_0x1d0539){if(_0x1d0539){return _0x3e2c69[_0xac4a('0x26')](_0x3bc318)[_0xac4a('0x28')](_0x1d0539);}};}function respondWithFilteredResult(_0x472c57,_0x1c13dc){return function(_0x20202c){if(_0x20202c){var _0x4e17ce=_0x20202c[_0xac4a('0x29')],_0x23b061=_0x1c13dc[_0xac4a('0x2a')],_0x267a22=_0x1c13dc['offset']+_0x1c13dc['limit'],_0x42a33c;if(_0x267a22>=_0x4e17ce){_0x267a22=_0x4e17ce;_0x42a33c=0xc8;}else{_0x42a33c=0xce;}_0x472c57[_0xac4a('0x26')](_0x42a33c);return _0x472c57[_0xac4a('0x2b')](_0xac4a('0x2c'),_0x23b061+'-'+_0x267a22+'/'+_0x4e17ce)['json'](_0x20202c);}return null;};}function patchUpdates(_0x4bda1f){return function(_0x355755){try{jsonpatch[_0xac4a('0x2d')](_0x355755,_0x4bda1f,!![]);}catch(_0x228629){return BPromise[_0xac4a('0x2e')](_0x228629);}return _0x355755[_0xac4a('0x2f')]();};}function saveUpdates(_0x53d3a5,_0x6dcc7f){return function(_0x482afc){if(_0x482afc){return _0x482afc[_0xac4a('0x30')](_0x53d3a5)['then'](function(_0x17e6de){return _0x17e6de;});}return null;};}function removeEntity(_0xfbe355,_0x31501b){return function(_0x228aa7){if(_0x228aa7){return _0x228aa7[_0xac4a('0x31')]()[_0xac4a('0x1a')](function(){_0xfbe355[_0xac4a('0x26')](0xcc)[_0xac4a('0x27')]();});}};}function handleEntityNotFound(_0x29fb3b,_0xfd7c16){return function(_0x36ab49){if(!_0x36ab49){_0x29fb3b[_0xac4a('0x25')](0x194);}return _0x36ab49;};}function handleError(_0x1a9be2,_0x1a9d4e){_0x1a9d4e=_0x1a9d4e||0x1f4;return function(_0x5634e2){logger[_0xac4a('0x20')](_0x5634e2[_0xac4a('0x32')]);if(_0x5634e2['name']){delete _0x5634e2[_0xac4a('0x33')];}_0x1a9be2[_0xac4a('0x26')](_0x1a9d4e)['send'](_0x5634e2);};}exports['index']=function(_0x11f0be,_0x1ba096){var _0x1b42b6={},_0x3de9e2={},_0x4f5986={'count':0x0,'rows':[]};var _0x453d02=db[_0xac4a('0x34')]['rawAttributes'];_0x3de9e2[_0xac4a('0x35')]=_[_0xac4a('0x36')](_0x453d02);_0x3de9e2[_0xac4a('0x37')]=_['keys'](_0x11f0be[_0xac4a('0x37')]);_0x3de9e2[_0xac4a('0x38')]=_[_0xac4a('0x39')](_0x3de9e2['model'],_0x3de9e2[_0xac4a('0x37')]);_0x1b42b6[_0xac4a('0x3a')]=_['intersection'](_0x3de9e2['model'],qs[_0xac4a('0x3b')](_0x11f0be['query']['fields']));_0x1b42b6['attributes']=_0x1b42b6['attributes'][_0xac4a('0x3c')]?_0x1b42b6[_0xac4a('0x3a')]:_0x3de9e2[_0xac4a('0x35')];if(!_0x11f0be[_0xac4a('0x37')][_0xac4a('0x3d')](_0xac4a('0x3e'))){_0x1b42b6[_0xac4a('0x3f')]=qs[_0xac4a('0x3f')](_0x11f0be[_0xac4a('0x37')][_0xac4a('0x3f')]);_0x1b42b6[_0xac4a('0x2a')]=qs[_0xac4a('0x2a')](_0x11f0be['query']['offset']);}_0x1b42b6['order']=qs[_0xac4a('0x40')](_0x11f0be[_0xac4a('0x37')][_0xac4a('0x40')]);_0x1b42b6[_0xac4a('0x41')]=qs[_0xac4a('0x38')](_[_0xac4a('0x42')](_0x11f0be[_0xac4a('0x37')],_0x3de9e2[_0xac4a('0x38')]));if(_0x11f0be[_0xac4a('0x37')][_0xac4a('0x43')]){_0x1b42b6['where']=_[_0xac4a('0x44')](_0x1b42b6[_0xac4a('0x41')],{'$or':_[_0xac4a('0x45')](_0x453d02,function(_0x3f24a1){if(_0x3f24a1[_0xac4a('0x46')]['key']!==_0xac4a('0x47')){var _0x1b77bb={};_0x1b77bb[_0x3f24a1['field']]={'$like':'%'+_0x11f0be[_0xac4a('0x37')]['filter']+'%'};return _0x1b77bb;}})});}_0x1b42b6=_[_0xac4a('0x44')]({},_0x1b42b6,_0x11f0be[_0xac4a('0x48')]);var _0xe5ee0f={'where':_0x1b42b6[_0xac4a('0x41')]};return db[_0xac4a('0x34')][_0xac4a('0x29')](_0xe5ee0f)[_0xac4a('0x1a')](function(_0x30a169){_0x4f5986[_0xac4a('0x29')]=_0x30a169;if(_0x11f0be[_0xac4a('0x37')][_0xac4a('0x49')]){_0x1b42b6[_0xac4a('0x4a')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0xac4a('0x4b')](_0x1b42b6);})[_0xac4a('0x1a')](function(_0xeca4e9){_0x4f5986['rows']=_0xeca4e9;return _0x4f5986;})[_0xac4a('0x1a')](respondWithFilteredResult(_0x1ba096,_0x1b42b6))[_0xac4a('0x24')](handleError(_0x1ba096,null));};exports['show']=function(_0x42969b,_0x5a7f6e){var _0x244950={'raw':![],'where':{'id':_0x42969b[_0xac4a('0x4c')]['id']}},_0xe620f6={};_0xe620f6['model']=_['keys'](db[_0xac4a('0x34')]['rawAttributes']);_0xe620f6[_0xac4a('0x37')]=_['keys'](_0x42969b[_0xac4a('0x37')]);_0xe620f6['filters']=_[_0xac4a('0x39')](_0xe620f6[_0xac4a('0x35')],_0xe620f6[_0xac4a('0x37')]);_0x244950[_0xac4a('0x3a')]=_['intersection'](_0xe620f6[_0xac4a('0x35')],qs[_0xac4a('0x3b')](_0x42969b[_0xac4a('0x37')][_0xac4a('0x3b')]));_0x244950[_0xac4a('0x3a')]=_0x244950[_0xac4a('0x3a')][_0xac4a('0x3c')]?_0x244950['attributes']:_0xe620f6[_0xac4a('0x35')];if(_0x42969b[_0xac4a('0x37')]['includeAll']){_0x244950[_0xac4a('0x4a')]=[{'all':!![]}];}_0x244950=_[_0xac4a('0x44')]({},_0x244950,_0x42969b[_0xac4a('0x48')]);return db[_0xac4a('0x34')]['find'](_0x244950)[_0xac4a('0x1a')](handleEntityNotFound(_0x5a7f6e,null))[_0xac4a('0x1a')](respondWithResult(_0x5a7f6e,null))[_0xac4a('0x24')](handleError(_0x5a7f6e,null));};exports[_0xac4a('0x4d')]=function(_0x890910,_0x49fbc3){return db[_0xac4a('0x34')]['create'](_0x890910[_0xac4a('0x4e')],{})[_0xac4a('0x1a')](respondWithResult(_0x49fbc3,0xc9))['catch'](handleError(_0x49fbc3,null));};exports['update']=function(_0x437466,_0x70fdc3){if(_0x437466['body']['id']){delete _0x437466[_0xac4a('0x4e')]['id'];}return db[_0xac4a('0x34')][_0xac4a('0x4f')]({'where':{'id':_0x437466[_0xac4a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x70fdc3,null))[_0xac4a('0x1a')](saveUpdates(_0x437466[_0xac4a('0x4e')],null))[_0xac4a('0x1a')](respondWithResult(_0x70fdc3,null))[_0xac4a('0x24')](handleError(_0x70fdc3,null));};exports[_0xac4a('0x31')]=function(_0x411547,_0x36179a){return db['ServicenowConfiguration'][_0xac4a('0x4f')]({'where':{'id':_0x411547[_0xac4a('0x4c')]['id']}})[_0xac4a('0x1a')](handleEntityNotFound(_0x36179a,null))[_0xac4a('0x1a')](removeEntity(_0x36179a,null))[_0xac4a('0x24')](handleError(_0x36179a,null));};exports[_0xac4a('0x50')]=function(_0x213df2,_0x236f57,_0x159e43){var _0x786d9={};var _0x3b175a={};var _0x38dd4f;var _0x400ac4;return db[_0xac4a('0x34')][_0xac4a('0x51')]({'where':{'id':_0x213df2[_0xac4a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x236f57,null))[_0xac4a('0x1a')](function(_0x479ebc){if(_0x479ebc){_0x38dd4f=_0x479ebc;_0x3b175a[_0xac4a('0x35')]=_['keys'](db[_0xac4a('0x52')]['rawAttributes']);_0x3b175a[_0xac4a('0x37')]=_['keys'](_0x213df2['query']);_0x3b175a[_0xac4a('0x38')]=_[_0xac4a('0x39')](_0x3b175a[_0xac4a('0x35')],_0x3b175a[_0xac4a('0x37')]);_0x786d9[_0xac4a('0x3a')]=_[_0xac4a('0x39')](_0x3b175a['model'],qs[_0xac4a('0x3b')](_0x213df2['query'][_0xac4a('0x3b')]));_0x786d9['attributes']=_0x786d9[_0xac4a('0x3a')][_0xac4a('0x3c')]?_0x786d9[_0xac4a('0x3a')]:_0x3b175a[_0xac4a('0x35')];_0x786d9[_0xac4a('0x53')]=qs[_0xac4a('0x40')](_0x213df2[_0xac4a('0x37')][_0xac4a('0x40')]);_0x786d9[_0xac4a('0x41')]=qs[_0xac4a('0x38')](_[_0xac4a('0x42')](_0x213df2[_0xac4a('0x37')],_0x3b175a[_0xac4a('0x38')]));if(_0x213df2[_0xac4a('0x37')][_0xac4a('0x43')]){_0x786d9[_0xac4a('0x41')]=_[_0xac4a('0x44')](_0x786d9['where'],{'$or':_[_0xac4a('0x45')](_0x786d9[_0xac4a('0x3a')],function(_0x4fb812){var _0x3c3576={};_0x3c3576[_0x4fb812]={'$like':'%'+_0x213df2[_0xac4a('0x37')][_0xac4a('0x43')]+'%'};return _0x3c3576;})});}_0x786d9=_[_0xac4a('0x44')]({},_0x786d9,_0x213df2[_0xac4a('0x48')]);return _0x38dd4f['getFields'](_0x786d9);}})['then'](function(_0x45f3c3){if(_0x45f3c3){_0x400ac4=_0x45f3c3[_0xac4a('0x3c')];if(!_0x213df2[_0xac4a('0x37')][_0xac4a('0x3d')](_0xac4a('0x3e'))){_0x786d9[_0xac4a('0x3f')]=qs[_0xac4a('0x3f')](_0x213df2[_0xac4a('0x37')][_0xac4a('0x3f')]);_0x786d9[_0xac4a('0x2a')]=qs[_0xac4a('0x2a')](_0x213df2['query']['offset']);}return _0x38dd4f[_0xac4a('0x50')](_0x786d9);}})[_0xac4a('0x1a')](function(_0x2954fc){if(_0x2954fc){return _0x2954fc?{'count':_0x400ac4,'rows':_0x2954fc}:null;}})[_0xac4a('0x1a')](respondWithResult(_0x236f57,null))[_0xac4a('0x24')](handleError(_0x236f57,null));};exports[_0xac4a('0x54')]=function(_0x1d24bb,_0x34e42f,_0x453d62){var _0x2a5acc={};var _0xb09b89={};var _0xb12cc5;var _0x5f0173;return db[_0xac4a('0x34')][_0xac4a('0x51')]({'where':{'id':_0x1d24bb[_0xac4a('0x4c')]['id']}})[_0xac4a('0x1a')](handleEntityNotFound(_0x34e42f,null))['then'](function(_0xc61e94){if(_0xc61e94){_0xb12cc5=_0xc61e94;_0xb09b89['model']=_[_0xac4a('0x36')](db[_0xac4a('0x52')]['rawAttributes']);_0xb09b89['query']=_[_0xac4a('0x36')](_0x1d24bb[_0xac4a('0x37')]);_0xb09b89[_0xac4a('0x38')]=_['intersection'](_0xb09b89[_0xac4a('0x35')],_0xb09b89['query']);_0x2a5acc[_0xac4a('0x3a')]=_['intersection'](_0xb09b89['model'],qs[_0xac4a('0x3b')](_0x1d24bb['query'][_0xac4a('0x3b')]));_0x2a5acc['attributes']=_0x2a5acc[_0xac4a('0x3a')][_0xac4a('0x3c')]?_0x2a5acc['attributes']:_0xb09b89[_0xac4a('0x35')];_0x2a5acc['order']=qs[_0xac4a('0x40')](_0x1d24bb[_0xac4a('0x37')]['sort']);_0x2a5acc[_0xac4a('0x41')]=qs['filters'](_['pick'](_0x1d24bb[_0xac4a('0x37')],_0xb09b89['filters']));if(_0x1d24bb[_0xac4a('0x37')]['filter']){_0x2a5acc['where']=_[_0xac4a('0x44')](_0x2a5acc[_0xac4a('0x41')],{'$or':_[_0xac4a('0x45')](_0x2a5acc['attributes'],function(_0x504256){var _0x1327ea={};_0x1327ea[_0x504256]={'$like':'%'+_0x1d24bb[_0xac4a('0x37')]['filter']+'%'};return _0x1327ea;})});}_0x2a5acc=_['merge']({},_0x2a5acc,_0x1d24bb[_0xac4a('0x48')]);return _0xb12cc5[_0xac4a('0x54')](_0x2a5acc);}})[_0xac4a('0x1a')](function(_0x36df3d){if(_0x36df3d){_0x5f0173=_0x36df3d[_0xac4a('0x3c')];if(!_0x1d24bb[_0xac4a('0x37')][_0xac4a('0x3d')](_0xac4a('0x3e'))){_0x2a5acc[_0xac4a('0x3f')]=qs['limit'](_0x1d24bb[_0xac4a('0x37')][_0xac4a('0x3f')]);_0x2a5acc[_0xac4a('0x2a')]=qs['offset'](_0x1d24bb[_0xac4a('0x37')][_0xac4a('0x2a')]);}return _0xb12cc5[_0xac4a('0x54')](_0x2a5acc);}})[_0xac4a('0x1a')](function(_0x3d2b5c){if(_0x3d2b5c){return _0x3d2b5c?{'count':_0x5f0173,'rows':_0x3d2b5c}:null;}})['then'](respondWithResult(_0x34e42f,null))[_0xac4a('0x24')](handleError(_0x34e42f,null));};exports[_0xac4a('0x55')]=function(_0xc9d040,_0x37e519,_0x72c90c){var _0x451248={};var _0xd7bdd6={};var _0x5b9e82;var _0x2e3bb7;return db[_0xac4a('0x34')][_0xac4a('0x51')]({'where':{'id':_0xc9d040[_0xac4a('0x4c')]['id']}})[_0xac4a('0x1a')](handleEntityNotFound(_0x37e519,null))[_0xac4a('0x1a')](function(_0x547eec){if(_0x547eec){_0x5b9e82=_0x547eec;_0xd7bdd6[_0xac4a('0x35')]=_[_0xac4a('0x36')](db[_0xac4a('0x52')][_0xac4a('0x56')]);_0xd7bdd6['query']=_[_0xac4a('0x36')](_0xc9d040['query']);_0xd7bdd6[_0xac4a('0x38')]=_[_0xac4a('0x39')](_0xd7bdd6['model'],_0xd7bdd6['query']);_0x451248[_0xac4a('0x3a')]=_[_0xac4a('0x39')](_0xd7bdd6[_0xac4a('0x35')],qs['fields'](_0xc9d040[_0xac4a('0x37')]['fields']));_0x451248[_0xac4a('0x3a')]=_0x451248[_0xac4a('0x3a')][_0xac4a('0x3c')]?_0x451248[_0xac4a('0x3a')]:_0xd7bdd6[_0xac4a('0x35')];_0x451248['order']=qs['sort'](_0xc9d040[_0xac4a('0x37')][_0xac4a('0x40')]);_0x451248[_0xac4a('0x41')]=qs[_0xac4a('0x38')](_[_0xac4a('0x42')](_0xc9d040[_0xac4a('0x37')],_0xd7bdd6[_0xac4a('0x38')]));if(_0xc9d040[_0xac4a('0x37')]['filter']){_0x451248['where']=_[_0xac4a('0x44')](_0x451248[_0xac4a('0x41')],{'$or':_[_0xac4a('0x45')](_0x451248[_0xac4a('0x3a')],function(_0x1353af){var _0x2ea4a4={};_0x2ea4a4[_0x1353af]={'$like':'%'+_0xc9d040[_0xac4a('0x37')][_0xac4a('0x43')]+'%'};return _0x2ea4a4;})});}_0x451248=_['merge']({},_0x451248,_0xc9d040['options']);return _0x5b9e82[_0xac4a('0x55')](_0x451248);}})[_0xac4a('0x1a')](function(_0x22804e){if(_0x22804e){_0x2e3bb7=_0x22804e[_0xac4a('0x3c')];if(!_0xc9d040[_0xac4a('0x37')][_0xac4a('0x3d')](_0xac4a('0x3e'))){_0x451248['limit']=qs[_0xac4a('0x3f')](_0xc9d040[_0xac4a('0x37')][_0xac4a('0x3f')]);_0x451248['offset']=qs[_0xac4a('0x2a')](_0xc9d040[_0xac4a('0x37')][_0xac4a('0x2a')]);}return _0x5b9e82[_0xac4a('0x55')](_0x451248);}})[_0xac4a('0x1a')](function(_0x27d023){if(_0x27d023){return _0x27d023?{'count':_0x2e3bb7,'rows':_0x27d023}:null;}})[_0xac4a('0x1a')](respondWithResult(_0x37e519,null))[_0xac4a('0x24')](handleError(_0x37e519,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 9bb963b..b0e3f3e 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 _0xad10=['api','moment','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','lodash','../../config/logger'];(function(_0x141749,_0x477b04){var _0x3e6932=function(_0x47b3f2){while(--_0x47b3f2){_0x141749['push'](_0x141749['shift']());}};_0x3e6932(++_0x477b04);}(_0xad10,0x1ea));var _0x0ad1=function(_0x3747f,_0x314c26){_0x3747f=_0x3747f-0x0;var _0x26af52=_0xad10[_0x3747f];return _0x26af52;};'use strict';var _=require(_0x0ad1('0x0'));var util=require('util');var logger=require(_0x0ad1('0x1'))(_0x0ad1('0x2'));var moment=require(_0x0ad1('0x3'));var BPromise=require('bluebird');var rp=require(_0x0ad1('0x4'));var fs=require('fs');var path=require(_0x0ad1('0x5'));var rimraf=require(_0x0ad1('0x6'));var config=require(_0x0ad1('0x7'));var attributes=require(_0x0ad1('0x8'));module[_0x0ad1('0x9')]=function(_0x470d3a,_0x1ad0fd){return _0x470d3a[_0x0ad1('0xa')](_0x0ad1('0xb'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5b5e=['int_servicenow_configurations','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','ServicenowConfiguration'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x5b5e,0x151));var _0xe5b5=function(_0x1b9457,_0x2a854c){_0x1b9457=_0x1b9457-0x0;var _0x14a687=_0x5b5e[_0x1b9457];return _0x14a687;};'use strict';var _=require(_0xe5b5('0x0'));var util=require('util');var logger=require(_0xe5b5('0x1'))(_0xe5b5('0x2'));var moment=require(_0xe5b5('0x3'));var BPromise=require('bluebird');var rp=require(_0xe5b5('0x4'));var fs=require('fs');var path=require(_0xe5b5('0x5'));var rimraf=require(_0xe5b5('0x6'));var config=require(_0xe5b5('0x7'));var attributes=require('./intServicenowConfiguration.attributes');module[_0xe5b5('0x8')]=function(_0x3d5a8b,_0x53b05e){return _0x3d5a8b[_0xe5b5('0x9')](_0xe5b5('0xa'),attributes,{'tableName':_0xe5b5('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 fa7aec6..7a3112a 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 _0x781c=['client','request','then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','jayson/promise'];(function(_0x209bb6,_0x2a7e74){var _0x4d1ba0=function(_0x815109){while(--_0x815109){_0x209bb6['push'](_0x209bb6['shift']());}};_0x4d1ba0(++_0x2a7e74);}(_0x781c,0x1d4));var _0xc781=function(_0x3dd808,_0x119fb6){_0x3dd808=_0x3dd808-0x0;var _0x4cbc2b=_0x781c[_0x3dd808];return _0x4cbc2b;};'use strict';var _=require('lodash');var util=require(_0xc781('0x0'));var moment=require(_0xc781('0x1'));var BPromise=require(_0xc781('0x2'));var rs=require(_0xc781('0x3'));var fs=require('fs');var Redis=require(_0xc781('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc781('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc781('0x6'));var client=jayson[_0xc781('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x44d26d,_0x5d8161,_0x38a4a0){return new BPromise(function(_0x37facc,_0x4df70d){return client[_0xc781('0x8')](_0x44d26d,_0x38a4a0)[_0xc781('0x9')](function(_0x149ce4){logger['info'](_0xc781('0xa'),_0x5d8161,_0xc781('0xb'));logger[_0xc781('0xc')](_0xc781('0xd'),_0x5d8161,_0xc781('0xb'),JSON[_0xc781('0xe')](_0x149ce4));if(_0x149ce4['error']){if(_0x149ce4['error'][_0xc781('0xf')]===0x1f4){logger[_0xc781('0x10')](_0xc781('0xa'),_0x5d8161,_0x149ce4[_0xc781('0x10')][_0xc781('0x11')]);return _0x4df70d(_0x149ce4[_0xc781('0x10')]['message']);}logger[_0xc781('0x10')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5d8161,_0x149ce4[_0xc781('0x10')]['message']);return _0x37facc(_0x149ce4[_0xc781('0x10')][_0xc781('0x11')]);}else{logger['info'](_0xc781('0xa'),_0x5d8161,_0xc781('0xb'));_0x37facc(_0x149ce4['result'][_0xc781('0x11')]);}})[_0xc781('0x12')](function(_0x21892f){logger[_0xc781('0x10')](_0xc781('0xa'),_0x5d8161,_0x21892f);_0x4df70d(_0x21892f);});});} \ No newline at end of file +var _0xe745=['code','ServicenowConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x26a870,_0x408895){var _0x2f1968=function(_0x2e14e0){while(--_0x2e14e0){_0x26a870['push'](_0x26a870['shift']());}};_0x2f1968(++_0x408895);}(_0xe745,0xad));var _0x5e74=function(_0x42279c,_0x1e5b26){_0x42279c=_0x42279c-0x0;var _0x5ba5a7=_0xe745[_0x42279c];return _0x5ba5a7;};'use strict';var _=require(_0x5e74('0x0'));var util=require(_0x5e74('0x1'));var moment=require(_0x5e74('0x2'));var BPromise=require(_0x5e74('0x3'));var rs=require(_0x5e74('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5e74('0x5'));var logger=require(_0x5e74('0x6'))(_0x5e74('0x7'));var config=require(_0x5e74('0x8'));var jayson=require(_0x5e74('0x9'));var client=jayson[_0x5e74('0xa')][_0x5e74('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x26ce1b,_0x44a79b,_0x4109a5){return new BPromise(function(_0x15d60e,_0x4b8756){return client['request'](_0x26ce1b,_0x4109a5)[_0x5e74('0xc')](function(_0x3bd7d8){logger[_0x5e74('0xd')]('ServicenowConfiguration,\x20%s,\x20%s',_0x44a79b,_0x5e74('0xe'));logger[_0x5e74('0xf')](_0x5e74('0x10'),_0x44a79b,_0x5e74('0xe'),JSON[_0x5e74('0x11')](_0x3bd7d8));if(_0x3bd7d8[_0x5e74('0x12')]){if(_0x3bd7d8[_0x5e74('0x12')][_0x5e74('0x13')]===0x1f4){logger[_0x5e74('0x12')](_0x5e74('0x14'),_0x44a79b,_0x3bd7d8[_0x5e74('0x12')][_0x5e74('0x15')]);return _0x4b8756(_0x3bd7d8[_0x5e74('0x12')][_0x5e74('0x15')]);}logger[_0x5e74('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x44a79b,_0x3bd7d8[_0x5e74('0x12')][_0x5e74('0x15')]);return _0x15d60e(_0x3bd7d8[_0x5e74('0x12')][_0x5e74('0x15')]);}else{logger['info'](_0x5e74('0x14'),_0x44a79b,'request\x20sent');_0x15d60e(_0x3bd7d8[_0x5e74('0x16')][_0x5e74('0x15')]);}})[_0x5e74('0x17')](function(_0x217385){logger['error'](_0x5e74('0x14'),_0x44a79b,_0x217385);_0x4b8756(_0x217385);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index e41c226..f55c002 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 _0x8594=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','exports','multer'];(function(_0xf34895,_0x21fb70){var _0x143f44=function(_0x2e7730){while(--_0x2e7730){_0xf34895['push'](_0xf34895['shift']());}};_0x143f44(++_0x21fb70);}(_0x8594,0x71));var _0x4859=function(_0x36b70d,_0x163e69){_0x36b70d=_0x36b70d-0x0;var _0xd6be46=_0x8594[_0x36b70d];return _0xd6be46;};'use strict';var multer=require(_0x4859('0x0'));var util=require('util');var path=require(_0x4859('0x1'));var timeout=require(_0x4859('0x2'));var express=require(_0x4859('0x3'));var router=express[_0x4859('0x4')]();var auth=require(_0x4859('0x5'));var interaction=require(_0x4859('0x6'));var config=require(_0x4859('0x7'));var controller=require(_0x4859('0x8'));router[_0x4859('0x9')]('/',auth[_0x4859('0xa')](),controller[_0x4859('0xb')]);router[_0x4859('0x9')](_0x4859('0xc'),auth['isAuthenticated'](),controller[_0x4859('0xd')]);router[_0x4859('0xe')]('/',auth[_0x4859('0xa')](),controller[_0x4859('0xf')]);router['put'](_0x4859('0xc'),auth[_0x4859('0xa')](),controller[_0x4859('0x10')]);router[_0x4859('0x11')](_0x4859('0xc'),auth[_0x4859('0xa')](),controller['destroy']);module[_0x4859('0x12')]=router; \ No newline at end of file +var _0x95af=['get','isAuthenticated','index','show','put','update','delete','exports','multer','util','path','connect-timeout','../../components/interaction/service','./intServicenowField.controller'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x95af,0x78));var _0xf95a=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x95af[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0xf95a('0x0'));var util=require(_0xf95a('0x1'));var path=require(_0xf95a('0x2'));var timeout=require(_0xf95a('0x3'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xf95a('0x4'));var config=require('../../config/environment');var controller=require(_0xf95a('0x5'));router[_0xf95a('0x6')]('/',auth[_0xf95a('0x7')](),controller[_0xf95a('0x8')]);router[_0xf95a('0x6')]('/:id',auth[_0xf95a('0x7')](),controller[_0xf95a('0x9')]);router['post']('/',auth[_0xf95a('0x7')](),controller['create']);router[_0xf95a('0xa')]('/:id',auth[_0xf95a('0x7')](),controller[_0xf95a('0xb')]);router[_0xf95a('0xc')]('/:id',auth[_0xf95a('0x7')](),controller['destroy']);module[_0xf95a('0xd')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index e907778..92e948d 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 _0x5ff3=['STRING','ENUM','variable','exports','string','customVariable','keyValue'];(function(_0x25dd3b,_0x27e043){var _0x3084aa=function(_0x45f3c1){while(--_0x45f3c1){_0x25dd3b['push'](_0x25dd3b['shift']());}};_0x3084aa(++_0x27e043);}(_0x5ff3,0x17d));var _0x35ff=function(_0x32bc09,_0x3e8172){_0x32bc09=_0x32bc09-0x0;var _0x54cd4b=_0x5ff3[_0x32bc09];return _0x54cd4b;};'use strict';var Sequelize=require('sequelize');module[_0x35ff('0x0')]={'type':{'type':Sequelize['ENUM'](_0x35ff('0x1'),'variable',_0x35ff('0x2'),_0x35ff('0x3')),'defaultValue':_0x35ff('0x1')},'content':{'type':Sequelize[_0x35ff('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x35ff('0x5')](_0x35ff('0x1'),_0x35ff('0x6'),_0x35ff('0x2'))},'keyContent':{'type':Sequelize[_0x35ff('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x35ff('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x35ff('0x4')]}}; \ No newline at end of file +var _0x153f=['variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x153f,0x15b));var _0xf153=function(_0x4794c8,_0x9a652e){_0x4794c8=_0x4794c8-0x0;var _0x477fe4=_0x153f[_0x4794c8];return _0x477fe4;};'use strict';var Sequelize=require(_0xf153('0x0'));module[_0xf153('0x1')]={'type':{'type':Sequelize[_0xf153('0x2')](_0xf153('0x3'),_0xf153('0x4'),_0xf153('0x5'),_0xf153('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xf153('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xf153('0x2')](_0xf153('0x3'),_0xf153('0x4'),_0xf153('0x5'))},'keyContent':{'type':Sequelize[_0xf153('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xf153('0x7')]},'customField':{'type':Sequelize[_0xf153('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf153('0x7')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index f2726bc..550e036 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 _0xeb7d=['filter','map','key','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','destroy','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','name','send','ServicenowField','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where'];(function(_0x131585,_0x1abd33){var _0x1fcca2=function(_0x8f165b){while(--_0x8f165b){_0x131585['push'](_0x131585['shift']());}};_0x1fcca2(++_0x1abd33);}(_0xeb7d,0x1e1));var _0xdeb7=function(_0x1db199,_0xa982d6){_0x1db199=_0x1db199-0x0;var _0x2c31d6=_0xeb7d[_0x1db199];return _0x2c31d6;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xdeb7('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdeb7('0x1'));var rp=require(_0xdeb7('0x2'));var moment=require(_0xdeb7('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xdeb7('0x4'));var util=require(_0xdeb7('0x5'));var path=require(_0xdeb7('0x6'));var sox=require('sox');var csv=require(_0xdeb7('0x7'));var ejs=require(_0xdeb7('0x8'));var fs=require('fs');var _=require(_0xdeb7('0x9'));var squel=require(_0xdeb7('0xa'));var crypto=require(_0xdeb7('0xb'));var jsforce=require(_0xdeb7('0xc'));var deskjs=require(_0xdeb7('0xd'));var toCsv=require(_0xdeb7('0x7'));var querystring=require('querystring');var Papa=require(_0xdeb7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdeb7('0xf'));var hardwareService=require(_0xdeb7('0x10'));var logger=require('../../config/logger')(_0xdeb7('0x11'));var utils=require(_0xdeb7('0x12'));var config=require('../../config/environment');var db=require(_0xdeb7('0x13'))['db'];function respondWithStatusCode(_0x4e8820,_0x406460){_0x406460=_0x406460||0xcc;return function(_0x28b060){if(_0x28b060){return _0x4e8820[_0xdeb7('0x14')](_0x406460);}return _0x4e8820[_0xdeb7('0x15')](_0x406460)['end']();};}function respondWithResult(_0x523668,_0x138eb0){_0x138eb0=_0x138eb0||0xc8;return function(_0x3ef0bd){if(_0x3ef0bd){return _0x523668[_0xdeb7('0x15')](_0x138eb0)[_0xdeb7('0x16')](_0x3ef0bd);}};}function respondWithFilteredResult(_0x127466,_0x24a925){return function(_0x2f93ac){if(_0x2f93ac){var _0x586f46=_0x2f93ac[_0xdeb7('0x17')],_0xc6b603=_0x24a925[_0xdeb7('0x18')],_0x5b9fe8=_0x24a925[_0xdeb7('0x18')]+_0x24a925[_0xdeb7('0x19')],_0x2d4548;if(_0x5b9fe8>=_0x586f46){_0x5b9fe8=_0x586f46;_0x2d4548=0xc8;}else{_0x2d4548=0xce;}_0x127466[_0xdeb7('0x15')](_0x2d4548);return _0x127466[_0xdeb7('0x1a')](_0xdeb7('0x1b'),_0xc6b603+'-'+_0x5b9fe8+'/'+_0x586f46)[_0xdeb7('0x16')](_0x2f93ac);}return null;};}function patchUpdates(_0x3f7547){return function(_0x4d2360){try{jsonpatch['apply'](_0x4d2360,_0x3f7547,!![]);}catch(_0x3f55c4){return BPromise[_0xdeb7('0x1c')](_0x3f55c4);}return _0x4d2360[_0xdeb7('0x1d')]();};}function saveUpdates(_0x348a7d,_0x9b9130){return function(_0x33e1f1){if(_0x33e1f1){return _0x33e1f1[_0xdeb7('0x1e')](_0x348a7d)[_0xdeb7('0x1f')](function(_0xb1884f){return _0xb1884f;});}return null;};}function removeEntity(_0x5d9d3d,_0xe04c9b){return function(_0x5dfa98){if(_0x5dfa98){return _0x5dfa98['destroy']()[_0xdeb7('0x1f')](function(){_0x5d9d3d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2079d1,_0x258288){return function(_0x2f72dc){if(!_0x2f72dc){_0x2079d1[_0xdeb7('0x14')](0x194);}return _0x2f72dc;};}function handleError(_0x215e75,_0x1395dc){_0x1395dc=_0x1395dc||0x1f4;return function(_0x9e844b){logger['error'](_0x9e844b['stack']);if(_0x9e844b['name']){delete _0x9e844b[_0xdeb7('0x20')];}_0x215e75['status'](_0x1395dc)[_0xdeb7('0x21')](_0x9e844b);};}exports['index']=function(_0x455f78,_0x29cda8){var _0x2c1014={},_0x43b81c={},_0x223565={'count':0x0,'rows':[]};var _0x25f1b1=db[_0xdeb7('0x22')]['rawAttributes'];_0x43b81c[_0xdeb7('0x23')]=_[_0xdeb7('0x24')](_0x25f1b1);_0x43b81c[_0xdeb7('0x25')]=_[_0xdeb7('0x24')](_0x455f78['query']);_0x43b81c[_0xdeb7('0x26')]=_['intersection'](_0x43b81c[_0xdeb7('0x23')],_0x43b81c[_0xdeb7('0x25')]);_0x2c1014[_0xdeb7('0x27')]=_[_0xdeb7('0x28')](_0x43b81c['model'],qs[_0xdeb7('0x29')](_0x455f78[_0xdeb7('0x25')][_0xdeb7('0x29')]));_0x2c1014[_0xdeb7('0x27')]=_0x2c1014[_0xdeb7('0x27')][_0xdeb7('0x2a')]?_0x2c1014[_0xdeb7('0x27')]:_0x43b81c[_0xdeb7('0x23')];if(!_0x455f78[_0xdeb7('0x25')][_0xdeb7('0x2b')]('nolimit')){_0x2c1014[_0xdeb7('0x19')]=qs[_0xdeb7('0x19')](_0x455f78[_0xdeb7('0x25')]['limit']);_0x2c1014['offset']=qs['offset'](_0x455f78[_0xdeb7('0x25')]['offset']);}_0x2c1014[_0xdeb7('0x2c')]=qs[_0xdeb7('0x2d')](_0x455f78[_0xdeb7('0x25')]['sort']);_0x2c1014[_0xdeb7('0x2e')]=qs[_0xdeb7('0x26')](_['pick'](_0x455f78[_0xdeb7('0x25')],_0x43b81c['filters']));if(_0x455f78[_0xdeb7('0x25')][_0xdeb7('0x2f')]){_0x2c1014['where']=_['merge'](_0x2c1014[_0xdeb7('0x2e')],{'$or':_[_0xdeb7('0x30')](_0x25f1b1,function(_0x1e38e1){if(_0x1e38e1['type'][_0xdeb7('0x31')]!==_0xdeb7('0x32')){var _0x2ee783={};_0x2ee783[_0x1e38e1[_0xdeb7('0x33')]]={'$like':'%'+_0x455f78[_0xdeb7('0x25')]['filter']+'%'};return _0x2ee783;}})});}_0x2c1014=_[_0xdeb7('0x34')]({},_0x2c1014,_0x455f78[_0xdeb7('0x35')]);var _0x50a68d={'where':_0x2c1014[_0xdeb7('0x2e')]};return db[_0xdeb7('0x22')][_0xdeb7('0x17')](_0x50a68d)['then'](function(_0x2a551d){_0x223565[_0xdeb7('0x17')]=_0x2a551d;if(_0x455f78[_0xdeb7('0x25')][_0xdeb7('0x36')]){_0x2c1014[_0xdeb7('0x37')]=[{'all':!![]}];}return db[_0xdeb7('0x22')][_0xdeb7('0x38')](_0x2c1014);})['then'](function(_0x28bfcb){_0x223565[_0xdeb7('0x39')]=_0x28bfcb;return _0x223565;})[_0xdeb7('0x1f')](respondWithFilteredResult(_0x29cda8,_0x2c1014))[_0xdeb7('0x3a')](handleError(_0x29cda8,null));};exports[_0xdeb7('0x3b')]=function(_0x34ece3,_0x375a5c){var _0x58c7d3={'raw':!![],'where':{'id':_0x34ece3[_0xdeb7('0x3c')]['id']}},_0x30782c={};_0x30782c[_0xdeb7('0x23')]=_['keys'](db[_0xdeb7('0x22')][_0xdeb7('0x3d')]);_0x30782c[_0xdeb7('0x25')]=_[_0xdeb7('0x24')](_0x34ece3[_0xdeb7('0x25')]);_0x30782c[_0xdeb7('0x26')]=_[_0xdeb7('0x28')](_0x30782c[_0xdeb7('0x23')],_0x30782c[_0xdeb7('0x25')]);_0x58c7d3[_0xdeb7('0x27')]=_[_0xdeb7('0x28')](_0x30782c['model'],qs[_0xdeb7('0x29')](_0x34ece3[_0xdeb7('0x25')]['fields']));_0x58c7d3['attributes']=_0x58c7d3[_0xdeb7('0x27')][_0xdeb7('0x2a')]?_0x58c7d3['attributes']:_0x30782c['model'];if(_0x34ece3[_0xdeb7('0x25')][_0xdeb7('0x36')]){_0x58c7d3[_0xdeb7('0x37')]=[{'all':!![]}];}_0x58c7d3=_['merge']({},_0x58c7d3,_0x34ece3[_0xdeb7('0x35')]);return db['ServicenowField'][_0xdeb7('0x3e')](_0x58c7d3)[_0xdeb7('0x1f')](handleEntityNotFound(_0x375a5c,null))[_0xdeb7('0x1f')](respondWithResult(_0x375a5c,null))[_0xdeb7('0x3a')](handleError(_0x375a5c,null));};exports[_0xdeb7('0x3f')]=function(_0x4614b2,_0x1defbb){return db[_0xdeb7('0x22')][_0xdeb7('0x3f')](_0x4614b2['body'],{})[_0xdeb7('0x1f')](respondWithResult(_0x1defbb,0xc9))[_0xdeb7('0x3a')](handleError(_0x1defbb,null));};exports['update']=function(_0x3084c0,_0x20fb11){if(_0x3084c0[_0xdeb7('0x40')]['id']){delete _0x3084c0[_0xdeb7('0x40')]['id'];}return db[_0xdeb7('0x22')][_0xdeb7('0x3e')]({'where':{'id':_0x3084c0['params']['id']}})[_0xdeb7('0x1f')](handleEntityNotFound(_0x20fb11,null))[_0xdeb7('0x1f')](saveUpdates(_0x3084c0[_0xdeb7('0x40')],null))[_0xdeb7('0x1f')](respondWithResult(_0x20fb11,null))[_0xdeb7('0x3a')](handleError(_0x20fb11,null));};exports[_0xdeb7('0x41')]=function(_0x37efbd,_0x500e63){return db[_0xdeb7('0x22')]['find']({'where':{'id':_0x37efbd[_0xdeb7('0x3c')]['id']}})[_0xdeb7('0x1f')](handleEntityNotFound(_0x500e63,null))[_0xdeb7('0x1f')](removeEntity(_0x500e63,null))[_0xdeb7('0x3a')](handleError(_0x500e63,null));}; \ No newline at end of file +var _0x3975=['includeAll','findAll','rows','catch','show','params','include','find','create','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','to-csv','ejs','lodash','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','ServicenowField','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','type','key','VIRTUAL','field','filter','options','count'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x3975,0x9a));var _0x5397=function(_0x15996e,_0x36cf58){_0x15996e=_0x15996e-0x0;var _0x30f8ff=_0x3975[_0x15996e];return _0x30f8ff;};'use strict';var pdf=require(_0x5397('0x0'));var emlformat=require(_0x5397('0x1'));var rimraf=require(_0x5397('0x2'));var zipdir=require(_0x5397('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5397('0x4'));var moment=require('moment');var BPromise=require(_0x5397('0x5'));var Mustache=require(_0x5397('0x6'));var util=require(_0x5397('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x5397('0x8'));var ejs=require(_0x5397('0x9'));var fs=require('fs');var _=require(_0x5397('0xa'));var squel=require('squel');var crypto=require(_0x5397('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5397('0xc'));var Papa=require(_0x5397('0xd'));var Redis=require('ioredis');var authService=require(_0x5397('0xe'));var qs=require(_0x5397('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5397('0x10'))(_0x5397('0x11'));var utils=require(_0x5397('0x12'));var config=require(_0x5397('0x13'));var db=require(_0x5397('0x14'))['db'];function respondWithStatusCode(_0x46d866,_0xce77ef){_0xce77ef=_0xce77ef||0xcc;return function(_0x4253c0){if(_0x4253c0){return _0x46d866[_0x5397('0x15')](_0xce77ef);}return _0x46d866[_0x5397('0x16')](_0xce77ef)[_0x5397('0x17')]();};}function respondWithResult(_0x34311e,_0x3d3947){_0x3d3947=_0x3d3947||0xc8;return function(_0x52b718){if(_0x52b718){return _0x34311e[_0x5397('0x16')](_0x3d3947)[_0x5397('0x18')](_0x52b718);}};}function respondWithFilteredResult(_0x10ff2c,_0x5bbe49){return function(_0x96e5a3){if(_0x96e5a3){var _0x2a00e6=_0x96e5a3['count'],_0x2d4d0a=_0x5bbe49['offset'],_0x1ac9bd=_0x5bbe49[_0x5397('0x19')]+_0x5bbe49['limit'],_0x1ab684;if(_0x1ac9bd>=_0x2a00e6){_0x1ac9bd=_0x2a00e6;_0x1ab684=0xc8;}else{_0x1ab684=0xce;}_0x10ff2c[_0x5397('0x16')](_0x1ab684);return _0x10ff2c[_0x5397('0x1a')](_0x5397('0x1b'),_0x2d4d0a+'-'+_0x1ac9bd+'/'+_0x2a00e6)[_0x5397('0x18')](_0x96e5a3);}return null;};}function patchUpdates(_0x5e6353){return function(_0x14cd72){try{jsonpatch[_0x5397('0x1c')](_0x14cd72,_0x5e6353,!![]);}catch(_0x5828ac){return BPromise[_0x5397('0x1d')](_0x5828ac);}return _0x14cd72['save']();};}function saveUpdates(_0x1839e6,_0xdd3ee4){return function(_0x4e213d){if(_0x4e213d){return _0x4e213d[_0x5397('0x1e')](_0x1839e6)[_0x5397('0x1f')](function(_0x243d9c){return _0x243d9c;});}return null;};}function removeEntity(_0x3cb72a,_0x419b64){return function(_0x494256){if(_0x494256){return _0x494256[_0x5397('0x20')]()[_0x5397('0x1f')](function(){_0x3cb72a[_0x5397('0x16')](0xcc)[_0x5397('0x17')]();});}};}function handleEntityNotFound(_0x457100,_0x7678a1){return function(_0xca633e){if(!_0xca633e){_0x457100['sendStatus'](0x194);}return _0xca633e;};}function handleError(_0x541398,_0x4ae04c){_0x4ae04c=_0x4ae04c||0x1f4;return function(_0x1e1854){logger[_0x5397('0x21')](_0x1e1854[_0x5397('0x22')]);if(_0x1e1854[_0x5397('0x23')]){delete _0x1e1854[_0x5397('0x23')];}_0x541398[_0x5397('0x16')](_0x4ae04c)[_0x5397('0x24')](_0x1e1854);};}exports['index']=function(_0x10dd82,_0x2617f2){var _0x2f7156={},_0x12e38d={},_0x57006c={'count':0x0,'rows':[]};var _0x46b08f=db[_0x5397('0x25')][_0x5397('0x26')];_0x12e38d[_0x5397('0x27')]=_[_0x5397('0x28')](_0x46b08f);_0x12e38d[_0x5397('0x29')]=_[_0x5397('0x28')](_0x10dd82[_0x5397('0x29')]);_0x12e38d[_0x5397('0x2a')]=_['intersection'](_0x12e38d[_0x5397('0x27')],_0x12e38d[_0x5397('0x29')]);_0x2f7156[_0x5397('0x2b')]=_[_0x5397('0x2c')](_0x12e38d[_0x5397('0x27')],qs[_0x5397('0x2d')](_0x10dd82[_0x5397('0x29')][_0x5397('0x2d')]));_0x2f7156[_0x5397('0x2b')]=_0x2f7156['attributes'][_0x5397('0x2e')]?_0x2f7156[_0x5397('0x2b')]:_0x12e38d[_0x5397('0x27')];if(!_0x10dd82['query'][_0x5397('0x2f')](_0x5397('0x30'))){_0x2f7156['limit']=qs[_0x5397('0x31')](_0x10dd82[_0x5397('0x29')][_0x5397('0x31')]);_0x2f7156['offset']=qs['offset'](_0x10dd82[_0x5397('0x29')][_0x5397('0x19')]);}_0x2f7156[_0x5397('0x32')]=qs['sort'](_0x10dd82[_0x5397('0x29')][_0x5397('0x33')]);_0x2f7156[_0x5397('0x34')]=qs[_0x5397('0x2a')](_[_0x5397('0x35')](_0x10dd82['query'],_0x12e38d[_0x5397('0x2a')]));if(_0x10dd82['query']['filter']){_0x2f7156[_0x5397('0x34')]=_[_0x5397('0x36')](_0x2f7156['where'],{'$or':_['map'](_0x46b08f,function(_0x39cfb8){if(_0x39cfb8[_0x5397('0x37')][_0x5397('0x38')]!==_0x5397('0x39')){var _0x5f12ba={};_0x5f12ba[_0x39cfb8[_0x5397('0x3a')]]={'$like':'%'+_0x10dd82[_0x5397('0x29')][_0x5397('0x3b')]+'%'};return _0x5f12ba;}})});}_0x2f7156=_['merge']({},_0x2f7156,_0x10dd82[_0x5397('0x3c')]);var _0x30bf6a={'where':_0x2f7156[_0x5397('0x34')]};return db[_0x5397('0x25')][_0x5397('0x3d')](_0x30bf6a)[_0x5397('0x1f')](function(_0xa80558){_0x57006c[_0x5397('0x3d')]=_0xa80558;if(_0x10dd82[_0x5397('0x29')][_0x5397('0x3e')]){_0x2f7156['include']=[{'all':!![]}];}return db['ServicenowField'][_0x5397('0x3f')](_0x2f7156);})[_0x5397('0x1f')](function(_0x44e20b){_0x57006c[_0x5397('0x40')]=_0x44e20b;return _0x57006c;})[_0x5397('0x1f')](respondWithFilteredResult(_0x2617f2,_0x2f7156))[_0x5397('0x41')](handleError(_0x2617f2,null));};exports[_0x5397('0x42')]=function(_0xbfdd10,_0x311f8e){var _0x1949e5={'raw':!![],'where':{'id':_0xbfdd10[_0x5397('0x43')]['id']}},_0x235fa0={};_0x235fa0[_0x5397('0x27')]=_[_0x5397('0x28')](db[_0x5397('0x25')][_0x5397('0x26')]);_0x235fa0[_0x5397('0x29')]=_[_0x5397('0x28')](_0xbfdd10['query']);_0x235fa0[_0x5397('0x2a')]=_[_0x5397('0x2c')](_0x235fa0['model'],_0x235fa0[_0x5397('0x29')]);_0x1949e5[_0x5397('0x2b')]=_[_0x5397('0x2c')](_0x235fa0[_0x5397('0x27')],qs[_0x5397('0x2d')](_0xbfdd10['query'][_0x5397('0x2d')]));_0x1949e5[_0x5397('0x2b')]=_0x1949e5[_0x5397('0x2b')]['length']?_0x1949e5[_0x5397('0x2b')]:_0x235fa0[_0x5397('0x27')];if(_0xbfdd10[_0x5397('0x29')][_0x5397('0x3e')]){_0x1949e5[_0x5397('0x44')]=[{'all':!![]}];}_0x1949e5=_[_0x5397('0x36')]({},_0x1949e5,_0xbfdd10['options']);return db[_0x5397('0x25')][_0x5397('0x45')](_0x1949e5)['then'](handleEntityNotFound(_0x311f8e,null))[_0x5397('0x1f')](respondWithResult(_0x311f8e,null))[_0x5397('0x41')](handleError(_0x311f8e,null));};exports[_0x5397('0x46')]=function(_0x19d8cd,_0x52f57c){return db[_0x5397('0x25')][_0x5397('0x46')](_0x19d8cd[_0x5397('0x47')],{})[_0x5397('0x1f')](respondWithResult(_0x52f57c,0xc9))[_0x5397('0x41')](handleError(_0x52f57c,null));};exports['update']=function(_0x46833b,_0x149a22){if(_0x46833b[_0x5397('0x47')]['id']){delete _0x46833b[_0x5397('0x47')]['id'];}return db[_0x5397('0x25')][_0x5397('0x45')]({'where':{'id':_0x46833b['params']['id']}})[_0x5397('0x1f')](handleEntityNotFound(_0x149a22,null))[_0x5397('0x1f')](saveUpdates(_0x46833b[_0x5397('0x47')],null))[_0x5397('0x1f')](respondWithResult(_0x149a22,null))['catch'](handleError(_0x149a22,null));};exports[_0x5397('0x20')]=function(_0x55669a,_0x420fd1){return db[_0x5397('0x25')][_0x5397('0x45')]({'where':{'id':_0x55669a[_0x5397('0x43')]['id']}})[_0x5397('0x1f')](handleEntityNotFound(_0x420fd1,null))[_0x5397('0x1f')](removeEntity(_0x420fd1,null))[_0x5397('0x41')](handleError(_0x420fd1,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index c6ee384..39d5827 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 _0x30e4=['FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','idField'];(function(_0x352a30,_0xf9aaf3){var _0x358f30=function(_0x49b570){while(--_0x49b570){_0x352a30['push'](_0x352a30['shift']());}};_0x358f30(++_0xf9aaf3);}(_0x30e4,0x131));var _0x430e=function(_0x18a04d,_0x42d215){_0x18a04d=_0x18a04d-0x0;var _0x5bcd8f=_0x30e4[_0x18a04d];return _0x5bcd8f;};'use strict';var _=require(_0x430e('0x0'));var util=require(_0x430e('0x1'));var logger=require(_0x430e('0x2'))('api');var moment=require(_0x430e('0x3'));var BPromise=require(_0x430e('0x4'));var rp=require(_0x430e('0x5'));var fs=require('fs');var path=require(_0x430e('0x6'));var rimraf=require(_0x430e('0x7'));var config=require(_0x430e('0x8'));var attributes=require(_0x430e('0x9'));module[_0x430e('0xa')]=function(_0x983a8,_0x8974da){return _0x983a8[_0x430e('0xb')](_0x430e('0xc'),attributes,{'tableName':_0x430e('0xd'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x430e('0xe'),_0x430e('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcf8c=['./intServicenowField.attributes','exports','define','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x493169,_0x53ac53){var _0x464fce=function(_0x12ce6c){while(--_0x12ce6c){_0x493169['push'](_0x493169['shift']());}};_0x464fce(++_0x53ac53);}(_0xcf8c,0x137));var _0xccf8=function(_0x5dab00,_0x4f9898){_0x5dab00=_0x5dab00-0x0;var _0x57db75=_0xcf8c[_0x5dab00];return _0x57db75;};'use strict';var _=require(_0xccf8('0x0'));var util=require(_0xccf8('0x1'));var logger=require(_0xccf8('0x2'))(_0xccf8('0x3'));var moment=require(_0xccf8('0x4'));var BPromise=require(_0xccf8('0x5'));var rp=require(_0xccf8('0x6'));var fs=require('fs');var path=require(_0xccf8('0x7'));var rimraf=require('rimraf');var config=require(_0xccf8('0x8'));var attributes=require(_0xccf8('0x9'));module[_0xccf8('0xa')]=function(_0xfac6ae,_0x3bb33a){return _0xfac6ae[_0xccf8('0xb')]('ServicenowField',attributes,{'tableName':_0xccf8('0xc'),'paranoid':![],'indexes':[{'name':_0xccf8('0xd'),'fields':[_0xccf8('0xe'),_0xccf8('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index f772046..37c6fb3 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 _0xd7d1=['info','ServicenowField,\x20%s,\x20%s','request\x20sent','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x443246,_0x199405){var _0xf91625=function(_0x6c01ff){while(--_0x6c01ff){_0x443246['push'](_0x443246['shift']());}};_0xf91625(++_0x199405);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0xc465f4,_0x12c915){_0xc465f4=_0xc465f4-0x0;var _0x3c5aa8=_0xd7d1[_0xc465f4];return _0x3c5aa8;};'use strict';var _=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var moment=require(_0x1d7d('0x2'));var BPromise=require(_0x1d7d('0x3'));var rs=require(_0x1d7d('0x4'));var fs=require('fs');var Redis=require(_0x1d7d('0x5'));var db=require(_0x1d7d('0x6'))['db'];var utils=require(_0x1d7d('0x7'));var logger=require(_0x1d7d('0x8'))(_0x1d7d('0x9'));var config=require(_0x1d7d('0xa'));var jayson=require(_0x1d7d('0xb'));var client=jayson[_0x1d7d('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x462ef8,_0x1aa456,_0x14dbf6){return new BPromise(function(_0x3675a2,_0xd6189e){return client[_0x1d7d('0xd')](_0x462ef8,_0x14dbf6)[_0x1d7d('0xe')](function(_0xa44223){logger[_0x1d7d('0xf')](_0x1d7d('0x10'),_0x1aa456,_0x1d7d('0x11'));logger['debug'](_0x1d7d('0x12'),_0x1aa456,'request\x20sent',JSON[_0x1d7d('0x13')](_0xa44223));if(_0xa44223[_0x1d7d('0x14')]){if(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x15')]===0x1f4){logger['error'](_0x1d7d('0x10'),_0x1aa456,_0xa44223['error']['message']);return _0xd6189e(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);}logger['error']('ServicenowField,\x20%s,\x20%s',_0x1aa456,_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);return _0x3675a2(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);}else{logger[_0x1d7d('0xf')]('ServicenowField,\x20%s,\x20%s',_0x1aa456,_0x1d7d('0x11'));_0x3675a2(_0xa44223[_0x1d7d('0x17')]['message']);}})[_0x1d7d('0x18')](function(_0x162c3a){logger[_0x1d7d('0x14')](_0x1d7d('0x10'),_0x1aa456,_0x162c3a);_0xd6189e(_0x162c3a);});});} \ No newline at end of file +var _0x958a=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird'];(function(_0x2b2023,_0x568708){var _0x4f87b5=function(_0x7a3385){while(--_0x7a3385){_0x2b2023['push'](_0x2b2023['shift']());}};_0x4f87b5(++_0x568708);}(_0x958a,0x128));var _0xa958=function(_0x2a93e4,_0x5819dd){_0x2a93e4=_0x2a93e4-0x0;var _0x162d77=_0x958a[_0x2a93e4];return _0x162d77;};'use strict';var _=require(_0xa958('0x0'));var util=require(_0xa958('0x1'));var moment=require('moment');var BPromise=require(_0xa958('0x2'));var rs=require(_0xa958('0x3'));var fs=require('fs');var Redis=require(_0xa958('0x4'));var db=require(_0xa958('0x5'))['db'];var utils=require(_0xa958('0x6'));var logger=require('../../config/logger')(_0xa958('0x7'));var config=require('../../config/environment');var jayson=require(_0xa958('0x8'));var client=jayson[_0xa958('0x9')][_0xa958('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ddaa9,_0x3ca01f,_0x3b2693){return new BPromise(function(_0x1895da,_0x54c0e0){return client['request'](_0x3ddaa9,_0x3b2693)[_0xa958('0xb')](function(_0x249764){logger[_0xa958('0xc')](_0xa958('0xd'),_0x3ca01f,_0xa958('0xe'));logger[_0xa958('0xf')](_0xa958('0x10'),_0x3ca01f,_0xa958('0xe'),JSON[_0xa958('0x11')](_0x249764));if(_0x249764[_0xa958('0x12')]){if(_0x249764[_0xa958('0x12')][_0xa958('0x13')]===0x1f4){logger[_0xa958('0x12')]('ServicenowField,\x20%s,\x20%s',_0x3ca01f,_0x249764['error']['message']);return _0x54c0e0(_0x249764[_0xa958('0x12')][_0xa958('0x14')]);}logger[_0xa958('0x12')]('ServicenowField,\x20%s,\x20%s',_0x3ca01f,_0x249764[_0xa958('0x12')]['message']);return _0x1895da(_0x249764['error']['message']);}else{logger[_0xa958('0xc')](_0xa958('0xd'),_0x3ca01f,_0xa958('0xe'));_0x1895da(_0x249764[_0xa958('0x15')][_0xa958('0x14')]);}})[_0xa958('0x16')](function(_0x23736f){logger[_0xa958('0x12')]('ServicenowField,\x20%s,\x20%s',_0x3ca01f,_0x23736f);_0x54c0e0(_0x23736f);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index c4c1f17..f6354c0 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 _0x5511=['./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xabfec4,_0x35076e){var _0x7bafa2=function(_0x52d551){while(--_0x52d551){_0xabfec4['push'](_0xabfec4['shift']());}};_0x7bafa2(++_0x35076e);}(_0x5511,0x116));var _0x1551=function(_0x1edb07,_0x3e2b90){_0x1edb07=_0x1edb07-0x0;var _0xd5c151=_0x5511[_0x1edb07];return _0xd5c151;};'use strict';var multer=require(_0x1551('0x0'));var util=require(_0x1551('0x1'));var path=require(_0x1551('0x2'));var timeout=require(_0x1551('0x3'));var express=require('express');var router=express[_0x1551('0x4')]();var auth=require(_0x1551('0x5'));var interaction=require(_0x1551('0x6'));var config=require(_0x1551('0x7'));var controller=require(_0x1551('0x8'));router[_0x1551('0x9')]('/',auth[_0x1551('0xa')](),controller[_0x1551('0xb')]);router[_0x1551('0x9')](_0x1551('0xc'),auth[_0x1551('0xa')](),controller['show']);router[_0x1551('0x9')](_0x1551('0xd'),auth['isAuthenticated'](),controller[_0x1551('0xe')]);router[_0x1551('0x9')](_0x1551('0xf'),auth[_0x1551('0xa')](),controller[_0x1551('0x10')]);router[_0x1551('0x11')]('/',auth[_0x1551('0xa')](),controller['create']);router[_0x1551('0x11')](_0x1551('0xd'),auth['isAuthenticated'](),controller[_0x1551('0x12')]);router['put'](_0x1551('0xc'),auth[_0x1551('0xa')](),controller[_0x1551('0x13')]);router['delete'](_0x1551('0xc'),auth[_0x1551('0xa')](),controller[_0x1551('0x14')]);module[_0x1551('0x15')]=router; \ No newline at end of file +var _0xc92e=['/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','/:id','update','delete','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','isAuthenticated'];(function(_0x3ccecb,_0x438779){var _0x3372d8=function(_0x385b50){while(--_0x385b50){_0x3ccecb['push'](_0x3ccecb['shift']());}};_0x3372d8(++_0x438779);}(_0xc92e,0x8f));var _0xec92=function(_0x2bc9ac,_0x23190d){_0x2bc9ac=_0x2bc9ac-0x0;var _0x2e2121=_0xc92e[_0x2bc9ac];return _0x2e2121;};'use strict';var multer=require('multer');var util=require(_0xec92('0x0'));var path=require('path');var timeout=require(_0xec92('0x1'));var express=require(_0xec92('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xec92('0x3'));var config=require(_0xec92('0x4'));var controller=require(_0xec92('0x5'));router[_0xec92('0x6')]('/',auth['isAuthenticated'](),controller[_0xec92('0x7')]);router[_0xec92('0x6')]('/:id',auth[_0xec92('0x8')](),controller['show']);router['get'](_0xec92('0x9'),auth['isAuthenticated'](),controller[_0xec92('0xa')]);router[_0xec92('0x6')](_0xec92('0xb'),auth[_0xec92('0x8')](),controller['getFields']);router[_0xec92('0xc')]('/',auth[_0xec92('0x8')](),controller[_0xec92('0xd')]);router['post'](_0xec92('0x9'),auth[_0xec92('0x8')](),controller[_0xec92('0xe')]);router[_0xec92('0xf')](_0xec92('0x10'),auth[_0xec92('0x8')](),controller[_0xec92('0x11')]);router[_0xec92('0x12')](_0xec92('0x10'),auth[_0xec92('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 73ac19c..ccd8c8f 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 _0x0e41=['remoteUri','STRING','username'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x0e41,0x11b));var _0x10e4=function(_0x27c20d,_0x1e38dc){_0x27c20d=_0x27c20d-0x0;var _0x2e6f37=_0x0e41[_0x27c20d];return _0x2e6f37;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x10e4('0x0')]},'description':{'type':Sequelize[_0x10e4('0x0')]},'username':{'type':Sequelize['STRING'],'unique':_0x10e4('0x1')},'password':{'type':Sequelize[_0x10e4('0x0')]},'remoteUri':{'type':Sequelize[_0x10e4('0x0')],'unique':_0x10e4('0x2')},'serverUrl':{'type':Sequelize[_0x10e4('0x0')]}}; \ No newline at end of file +var _0xead4=['remoteUri','sequelize','STRING'];(function(_0x357810,_0x4b3658){var _0x480a53=function(_0x2cf184){while(--_0x2cf184){_0x357810['push'](_0x357810['shift']());}};_0x480a53(++_0x4b3658);}(_0xead4,0x1ed));var _0x4ead=function(_0x2149d7,_0x33b44b){_0x2149d7=_0x2149d7-0x0;var _0x4131e3=_0xead4[_0x2149d7];return _0x4131e3;};'use strict';var Sequelize=require(_0x4ead('0x0'));module['exports']={'name':{'type':Sequelize[_0x4ead('0x1')]},'description':{'type':Sequelize[_0x4ead('0x1')]},'username':{'type':Sequelize[_0x4ead('0x1')],'unique':'username'},'password':{'type':Sequelize[_0x4ead('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x4ead('0x2')},'serverUrl':{'type':Sequelize[_0x4ead('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index d116660..cc98df4 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 _0x4cff=['destroy','status','stack','name','index','SugarcrmAccount','model','keys','query','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','map','type','key','VIRTUAL','field','merge','includeAll','include','show','params','rawAttributes','length','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','options','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','created_by','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','lastIndexOf','format','%s%s','JSON','Invalid\x20Login','POST','/service/v4_1/rest.php','get_module_fields','stringify','Calls','values','includes','label','endsWith','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','send','html-pdf','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../components/integrations/configuration','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','SugarcrmAccount,\x20%s,\x20%s','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','end','json','count','offset','limit','set','Content-Range','reject','save','update'];(function(_0x50422d,_0x1d50d5){var _0x1a5afd=function(_0x5e2926){while(--_0x5e2926){_0x50422d['push'](_0x50422d['shift']());}};_0x1a5afd(++_0x1d50d5);}(_0x4cff,0x14a));var _0xf4cf=function(_0x21a4b0,_0x4c1cbd){_0x21a4b0=_0x21a4b0-0x0;var _0x424c10=_0x4cff[_0x21a4b0];return _0x424c10;};'use strict';var pdf=require(_0xf4cf('0x0'));var emlformat=require(_0xf4cf('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xf4cf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf4cf('0x3'));var moment=require(_0xf4cf('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf4cf('0x5'));var util=require(_0xf4cf('0x6'));var path=require(_0xf4cf('0x7'));var sox=require(_0xf4cf('0x8'));var csv=require(_0xf4cf('0x9'));var ejs=require(_0xf4cf('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf4cf('0xb'));var crypto=require(_0xf4cf('0xc'));var jsforce=require(_0xf4cf('0xd'));var deskjs=require(_0xf4cf('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf4cf('0xf'));var Papa=require(_0xf4cf('0x10'));var Redis=require(_0xf4cf('0x11'));var authService=require(_0xf4cf('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xf4cf('0x13'));var logger=require(_0xf4cf('0x14'))(_0xf4cf('0x15'));var utils=require(_0xf4cf('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require(_0xf4cf('0x17'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x789bef,_0x3e6f30,_0x1ce2fc){if(_0x1ce2fc){var _0xc6eadf=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xc6eadf[_0xf4cf('0x18')](_0x3e6f30)){return _0x789bef;}else{throw new Error(_0xf4cf('0x19'));}}else{return _0x789bef;}}function respondWithRpcPromise(_0x198490,_0x391562,_0x453dfa,_0x434ee9){return new BPromise(function(_0x4d2be7,_0x21f9b2){var _0x2c8867=_0x434ee9||client;return _0x2c8867[_0xf4cf('0x1a')](_0x198490,_0x453dfa)[_0xf4cf('0x1b')](function(_0x5260aa){logger[_0xf4cf('0x1c')](_0xf4cf('0x1d'),_0x391562,'request\x20sent');logger[_0xf4cf('0x1e')](_0xf4cf('0x1f'),_0x391562,_0xf4cf('0x20'),JSON['stringify'](_0x5260aa));if(_0x5260aa[_0xf4cf('0x21')]){if(_0x5260aa['error'][_0xf4cf('0x22')]===0x1f4){logger['error'](_0xf4cf('0x1d'),_0x391562,_0x5260aa['error']['message']);return _0x21f9b2(_0x5260aa['error'][_0xf4cf('0x23')]);}logger[_0xf4cf('0x21')](_0xf4cf('0x1d'),_0x391562,_0x5260aa[_0xf4cf('0x21')][_0xf4cf('0x23')]);return _0x4d2be7(_0x5260aa[_0xf4cf('0x21')][_0xf4cf('0x23')]);}else{logger['info'](_0xf4cf('0x1d'),_0x391562,_0xf4cf('0x20'));_0x4d2be7(_0x5260aa[_0xf4cf('0x24')][_0xf4cf('0x23')]);}})[_0xf4cf('0x25')](function(_0x2bd35d){logger['error'](_0xf4cf('0x1d'),_0x391562,_0x2bd35d);_0x21f9b2(_0x2bd35d);});});}function respondWithStatusCode(_0x1ca8b8,_0x5b5934){_0x5b5934=_0x5b5934||0xcc;return function(_0x1d26b0){if(_0x1d26b0){return _0x1ca8b8['sendStatus'](_0x5b5934);}return _0x1ca8b8['status'](_0x5b5934)[_0xf4cf('0x26')]();};}function respondWithResult(_0x20e2e4,_0x537008){_0x537008=_0x537008||0xc8;return function(_0x230a18){if(_0x230a18){return _0x20e2e4['status'](_0x537008)[_0xf4cf('0x27')](_0x230a18);}};}function respondWithFilteredResult(_0x2eb695,_0x97e3e4){return function(_0x505053){if(_0x505053){var _0x5c4892=_0x505053[_0xf4cf('0x28')],_0x3b7709=_0x97e3e4[_0xf4cf('0x29')],_0x16ea9a=_0x97e3e4[_0xf4cf('0x29')]+_0x97e3e4[_0xf4cf('0x2a')],_0x29eb0b;if(_0x16ea9a>=_0x5c4892){_0x16ea9a=_0x5c4892;_0x29eb0b=0xc8;}else{_0x29eb0b=0xce;}_0x2eb695['status'](_0x29eb0b);return _0x2eb695[_0xf4cf('0x2b')](_0xf4cf('0x2c'),_0x3b7709+'-'+_0x16ea9a+'/'+_0x5c4892)[_0xf4cf('0x27')](_0x505053);}return null;};}function patchUpdates(_0x471a0f){return function(_0x33b5c2){try{jsonpatch['apply'](_0x33b5c2,_0x471a0f,!![]);}catch(_0x5d1dc0){return BPromise[_0xf4cf('0x2d')](_0x5d1dc0);}return _0x33b5c2[_0xf4cf('0x2e')]();};}function saveUpdates(_0x191c25,_0x325f5b){return function(_0x2f6c40){if(_0x2f6c40){return _0x2f6c40[_0xf4cf('0x2f')](_0x191c25)[_0xf4cf('0x1b')](function(_0xe3524d){return _0xe3524d;});}return null;};}function removeEntity(_0x662b10,_0x4a954b){return function(_0x536111){if(_0x536111){return _0x536111[_0xf4cf('0x30')]()[_0xf4cf('0x1b')](function(){_0x662b10[_0xf4cf('0x31')](0xcc)[_0xf4cf('0x26')]();});}};}function handleEntityNotFound(_0x229d58,_0x483324){return function(_0x24d53d){if(!_0x24d53d){_0x229d58['sendStatus'](0x194);}return _0x24d53d;};}function handleError(_0x335fc5,_0x5ba4ec){_0x5ba4ec=_0x5ba4ec||0x1f4;return function(_0x2ef5fe){logger[_0xf4cf('0x21')](_0x2ef5fe[_0xf4cf('0x32')]);if(_0x2ef5fe[_0xf4cf('0x33')]){delete _0x2ef5fe['name'];}_0x335fc5[_0xf4cf('0x31')](_0x5ba4ec)['send'](_0x2ef5fe);};}exports[_0xf4cf('0x34')]=function(_0x4b8d88,_0x1a6eba){var _0x3b2809={},_0x5ba0ce={},_0x49288e={'count':0x0,'rows':[]};var _0x1f49eb=db[_0xf4cf('0x35')]['rawAttributes'];_0x5ba0ce[_0xf4cf('0x36')]=_[_0xf4cf('0x37')](_0x1f49eb);_0x5ba0ce['query']=_['keys'](_0x4b8d88[_0xf4cf('0x38')]);_0x5ba0ce['filters']=_[_0xf4cf('0x39')](_0x5ba0ce[_0xf4cf('0x36')],_0x5ba0ce[_0xf4cf('0x38')]);_0x3b2809[_0xf4cf('0x3a')]=_[_0xf4cf('0x39')](_0x5ba0ce[_0xf4cf('0x36')],qs[_0xf4cf('0x3b')](_0x4b8d88[_0xf4cf('0x38')][_0xf4cf('0x3b')]));_0x3b2809[_0xf4cf('0x3a')]=_0x3b2809[_0xf4cf('0x3a')]['length']?_0x3b2809[_0xf4cf('0x3a')]:_0x5ba0ce['model'];if(!_0x4b8d88[_0xf4cf('0x38')]['hasOwnProperty'](_0xf4cf('0x3c'))){_0x3b2809[_0xf4cf('0x2a')]=qs[_0xf4cf('0x2a')](_0x4b8d88['query'][_0xf4cf('0x2a')]);_0x3b2809[_0xf4cf('0x29')]=qs['offset'](_0x4b8d88[_0xf4cf('0x38')][_0xf4cf('0x29')]);}_0x3b2809[_0xf4cf('0x3d')]=qs[_0xf4cf('0x3e')](_0x4b8d88[_0xf4cf('0x38')][_0xf4cf('0x3e')]);_0x3b2809[_0xf4cf('0x3f')]=qs[_0xf4cf('0x40')](_[_0xf4cf('0x41')](_0x4b8d88[_0xf4cf('0x38')],_0x5ba0ce['filters']));if(_0x4b8d88[_0xf4cf('0x38')][_0xf4cf('0x42')]){_0x3b2809[_0xf4cf('0x3f')]=_['merge'](_0x3b2809['where'],{'$or':_[_0xf4cf('0x43')](_0x1f49eb,function(_0x139e8b){if(_0x139e8b[_0xf4cf('0x44')][_0xf4cf('0x45')]!==_0xf4cf('0x46')){var _0x1ed44f={};_0x1ed44f[_0x139e8b[_0xf4cf('0x47')]]={'$like':'%'+_0x4b8d88[_0xf4cf('0x38')][_0xf4cf('0x42')]+'%'};return _0x1ed44f;}})});}_0x3b2809=_[_0xf4cf('0x48')]({},_0x3b2809,_0x4b8d88['options']);var _0x3ce7c6={'where':_0x3b2809['where']};return db[_0xf4cf('0x35')][_0xf4cf('0x28')](_0x3ce7c6)[_0xf4cf('0x1b')](function(_0x95cd){_0x49288e['count']=_0x95cd;if(_0x4b8d88[_0xf4cf('0x38')][_0xf4cf('0x49')]){_0x3b2809[_0xf4cf('0x4a')]=[{'all':!![]}];}return db[_0xf4cf('0x35')]['findAll'](_0x3b2809);})[_0xf4cf('0x1b')](function(_0x18b23b){_0x49288e['rows']=_0x18b23b;return _0x49288e;})[_0xf4cf('0x1b')](respondWithFilteredResult(_0x1a6eba,_0x3b2809))[_0xf4cf('0x25')](handleError(_0x1a6eba,null));};exports[_0xf4cf('0x4b')]=function(_0x279806,_0x211fcc){var _0x4dcbfd={'raw':![],'where':{'id':_0x279806[_0xf4cf('0x4c')]['id']}},_0x1bf0cd={};_0x1bf0cd['model']=_['keys'](db[_0xf4cf('0x35')][_0xf4cf('0x4d')]);_0x1bf0cd[_0xf4cf('0x38')]=_[_0xf4cf('0x37')](_0x279806[_0xf4cf('0x38')]);_0x1bf0cd[_0xf4cf('0x40')]=_['intersection'](_0x1bf0cd[_0xf4cf('0x36')],_0x1bf0cd['query']);_0x4dcbfd[_0xf4cf('0x3a')]=_['intersection'](_0x1bf0cd[_0xf4cf('0x36')],qs[_0xf4cf('0x3b')](_0x279806[_0xf4cf('0x38')]['fields']));_0x4dcbfd['attributes']=_0x4dcbfd[_0xf4cf('0x3a')][_0xf4cf('0x4e')]?_0x4dcbfd['attributes']:_0x1bf0cd[_0xf4cf('0x36')];if(_0x279806[_0xf4cf('0x38')][_0xf4cf('0x49')]){_0x4dcbfd['include']=[{'all':!![]}];}_0x4dcbfd=_['merge']({},_0x4dcbfd,_0x279806['options']);return db[_0xf4cf('0x35')][_0xf4cf('0x4f')](_0x4dcbfd)[_0xf4cf('0x1b')](handleEntityNotFound(_0x211fcc,null))[_0xf4cf('0x1b')](respondWithResult(_0x211fcc,null))[_0xf4cf('0x25')](handleError(_0x211fcc,null));};exports[_0xf4cf('0x50')]=function(_0x20a041,_0x3921a0){return db[_0xf4cf('0x35')][_0xf4cf('0x50')](_0x20a041[_0xf4cf('0x51')],{})[_0xf4cf('0x1b')](respondWithResult(_0x3921a0,0xc9))[_0xf4cf('0x25')](handleError(_0x3921a0,null));};exports[_0xf4cf('0x2f')]=function(_0x136f40,_0x29affd){if(_0x136f40[_0xf4cf('0x51')]['id']){delete _0x136f40['body']['id'];}return db[_0xf4cf('0x35')][_0xf4cf('0x4f')]({'where':{'id':_0x136f40[_0xf4cf('0x4c')]['id']}})[_0xf4cf('0x1b')](handleEntityNotFound(_0x29affd,null))[_0xf4cf('0x1b')](saveUpdates(_0x136f40[_0xf4cf('0x51')],null))[_0xf4cf('0x1b')](respondWithResult(_0x29affd,null))[_0xf4cf('0x25')](handleError(_0x29affd,null));};exports[_0xf4cf('0x30')]=function(_0x2824fa,_0x33d401){return db[_0xf4cf('0x35')][_0xf4cf('0x4f')]({'where':{'id':_0x2824fa[_0xf4cf('0x4c')]['id']}})[_0xf4cf('0x1b')](handleEntityNotFound(_0x33d401,null))[_0xf4cf('0x1b')](removeEntity(_0x33d401,null))[_0xf4cf('0x25')](handleError(_0x33d401,null));};exports[_0xf4cf('0x52')]=function(_0x446932,_0x50dbae,_0x44f49b){var _0x1becf9={};var _0x153d32={};var _0x51cceb;var _0x46cb75;return db[_0xf4cf('0x35')][_0xf4cf('0x53')]({'where':{'id':_0x446932['params']['id']}})[_0xf4cf('0x1b')](handleEntityNotFound(_0x50dbae,null))[_0xf4cf('0x1b')](function(_0x5533e5){if(_0x5533e5){_0x51cceb=_0x5533e5;_0x153d32[_0xf4cf('0x36')]=_[_0xf4cf('0x37')](db[_0xf4cf('0x54')][_0xf4cf('0x4d')]);_0x153d32[_0xf4cf('0x38')]=_[_0xf4cf('0x37')](_0x446932[_0xf4cf('0x38')]);_0x153d32[_0xf4cf('0x40')]=_['intersection'](_0x153d32[_0xf4cf('0x36')],_0x153d32[_0xf4cf('0x38')]);_0x1becf9[_0xf4cf('0x3a')]=_[_0xf4cf('0x39')](_0x153d32[_0xf4cf('0x36')],qs[_0xf4cf('0x3b')](_0x446932[_0xf4cf('0x38')][_0xf4cf('0x3b')]));_0x1becf9[_0xf4cf('0x3a')]=_0x1becf9[_0xf4cf('0x3a')][_0xf4cf('0x4e')]?_0x1becf9[_0xf4cf('0x3a')]:_0x153d32[_0xf4cf('0x36')];_0x1becf9[_0xf4cf('0x3d')]=qs['sort'](_0x446932[_0xf4cf('0x38')][_0xf4cf('0x3e')]);_0x1becf9['where']=qs[_0xf4cf('0x40')](_[_0xf4cf('0x41')](_0x446932['query'],_0x153d32[_0xf4cf('0x40')]));if(_0x446932[_0xf4cf('0x38')][_0xf4cf('0x42')]){_0x1becf9[_0xf4cf('0x3f')]=_['merge'](_0x1becf9['where'],{'$or':_[_0xf4cf('0x43')](_0x1becf9['attributes'],function(_0xa433aa){var _0xc6a546={};_0xc6a546[_0xa433aa]={'$like':'%'+_0x446932[_0xf4cf('0x38')]['filter']+'%'};return _0xc6a546;})});}_0x1becf9=_[_0xf4cf('0x48')]({},_0x1becf9,_0x446932[_0xf4cf('0x55')]);return _0x51cceb[_0xf4cf('0x52')](_0x1becf9);}})[_0xf4cf('0x1b')](function(_0x1d0cbd){if(_0x1d0cbd){_0x46cb75=_0x1d0cbd[_0xf4cf('0x4e')];if(!_0x446932['query'][_0xf4cf('0x56')](_0xf4cf('0x3c'))){_0x1becf9[_0xf4cf('0x2a')]=qs[_0xf4cf('0x2a')](_0x446932[_0xf4cf('0x38')][_0xf4cf('0x2a')]);_0x1becf9['offset']=qs[_0xf4cf('0x29')](_0x446932[_0xf4cf('0x38')][_0xf4cf('0x29')]);}return _0x51cceb[_0xf4cf('0x52')](_0x1becf9);}})[_0xf4cf('0x1b')](function(_0x270d97){if(_0x270d97){return _0x270d97?{'count':_0x46cb75,'rows':_0x270d97}:null;}})[_0xf4cf('0x1b')](respondWithResult(_0x50dbae,null))['catch'](handleError(_0x50dbae,null));};exports[_0xf4cf('0x57')]=function(_0x59f6b3,_0xbd4a58,_0x3cdc5f){if(_0x59f6b3[_0xf4cf('0x51')]['id']){delete _0x59f6b3['body']['id'];}return db[_0xf4cf('0x35')][_0xf4cf('0x53')]({'where':{'id':_0x59f6b3['params']['id']}})[_0xf4cf('0x1b')](handleEntityNotFound(_0xbd4a58,null))[_0xf4cf('0x1b')](function(_0x15dbd2){if(_0x15dbd2){_0x59f6b3[_0xf4cf('0x51')][_0xf4cf('0x58')]=_0x15dbd2['id'];_0x59f6b3[_0xf4cf('0x51')][_0xf4cf('0x59')]=integrations[_0xf4cf('0x5a')](_0x59f6b3[_0xf4cf('0x51')][_0xf4cf('0x5b')],_0x59f6b3[_0xf4cf('0x51')][_0xf4cf('0x44')]);_0x59f6b3['body'][_0xf4cf('0x5c')]=integrations[_0xf4cf('0x5d')](_0x59f6b3['body'][_0xf4cf('0x5b')],_0x59f6b3[_0xf4cf('0x51')]['type']);return db[_0xf4cf('0x54')][_0xf4cf('0x50')](_0x59f6b3[_0xf4cf('0x51')],{'include':[{'model':db[_0xf4cf('0x5e')],'as':_0xf4cf('0x59')},{'model':db[_0xf4cf('0x5e')],'as':_0xf4cf('0x5c')}]});}return null;})[_0xf4cf('0x1b')](respondWithResult(_0xbd4a58,null))[_0xf4cf('0x25')](handleError(_0xbd4a58,null));};exports[_0xf4cf('0x5f')]=function(_0x4ef54a,_0x242c52,_0x39474c){var _0xfa85f1='';var _0x4ceb69=['id',_0xf4cf('0x33'),'assigned_user_id',_0xf4cf('0x60'),'description',_0xf4cf('0x61'),_0xf4cf('0x62'),_0xf4cf('0x63'),_0xf4cf('0x64'),_0xf4cf('0x65'),_0xf4cf('0x66'),_0xf4cf('0x67')];return db['SugarcrmAccount'][_0xf4cf('0x53')]({'where':{'id':_0x4ef54a[_0xf4cf('0x4c')]['id']},'attributes':['id',_0xf4cf('0x68'),_0xf4cf('0x69'),_0xf4cf('0x6a')]})[_0xf4cf('0x1b')](handleEntityNotFound(_0x242c52,null))[_0xf4cf('0x1b')](function(_0x499734){if(_0x499734){_0xfa85f1=_0x499734[_0xf4cf('0x6a')];var _0x9dec09=_0xfa85f1['slice'](-0x1);if(_0x9dec09==='/'){_0xfa85f1=_0xfa85f1['substring'](0x0,_0xfa85f1[_0xf4cf('0x6b')](_0x9dec09));}return rp({'method':'POST','uri':util[_0xf4cf('0x6c')](_0xf4cf('0x6d'),_0xfa85f1,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'login','input_type':_0xf4cf('0x6e'),'response_type':_0xf4cf('0x6e'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x499734['username'],'password':_0x499734[_0xf4cf('0x69')],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20Integration'})}});}})['then'](function(_0x39da7b){if(_0x39da7b&&_0x39da7b['name']!==_0xf4cf('0x6f')&&_0x39da7b[_0xf4cf('0x33')]!=='Password\x20Expired'){return rp({'method':_0xf4cf('0x70'),'uri':util[_0xf4cf('0x6c')](_0xf4cf('0x6d'),_0xfa85f1,_0xf4cf('0x71')),'json':!![],'form':{'method':_0xf4cf('0x72'),'input_type':_0xf4cf('0x6e'),'response_type':'JSON','rest_data':JSON[_0xf4cf('0x73')]({'session':_0x39da7b['id'],'module_name':_0xf4cf('0x74')})}})['then'](function(_0x4cd567){if(_0x4cd567){var _0xab4dd9=_[_0xf4cf('0x75')](_0x4cd567['module_fields']);_['remove'](_0xab4dd9,function(_0x463c59){return _0x4ceb69[_0xf4cf('0x76')](_0x463c59[_0xf4cf('0x33')]);});return{'count':_0xab4dd9[_0xf4cf('0x4e')],'rows':_['map'](_0xab4dd9,function(_0x39dcf6){return{'id':_0x39dcf6[_0xf4cf('0x33')],'name':_0x39dcf6[_0xf4cf('0x77')],'custom':_[_0xf4cf('0x78')](_0x39dcf6[_0xf4cf('0x33')],'_c')?!![]:![],'options':_0x39dcf6[_0xf4cf('0x55')]?_[_0xf4cf('0x43')](_[_0xf4cf('0x75')](_0x39dcf6['options']),function(_0x409dd0){return{'name':_0x409dd0[_0xf4cf('0x79')],'value':_0x409dd0[_0xf4cf('0x33')]};}):[]};})};}})[_0xf4cf('0x1b')](respondWithResult(_0x242c52,null))[_0xf4cf('0x25')](function(_0x1876b8){var _0xe1427f=_0x4ef54a['query']['test']?0x1f4:_0x1876b8[_0xf4cf('0x7a')]||0x1f4;logger[_0xf4cf('0x21')](_0xf4cf('0x7b'),'getFields',_0xe1427f,JSON[_0xf4cf('0x73')](_0x1876b8));delete _0x1876b8['name'];if(_0xe1427f===0x191){_0xe1427f=0x190;}_0x242c52['status'](_0xe1427f)['send'](_0x4ef54a[_0xf4cf('0x38')][_0xf4cf('0x18')]?{'message':_0xf4cf('0x7c'),'statusCode':_0x1876b8['statusCode']}:_0x1876b8);});}else{var _0x232652=0x1f4;_0x242c52[_0xf4cf('0x31')](_0x232652)[_0xf4cf('0x7d')]({'message':_0xf4cf('0x7c'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x5532=['lastIndexOf','%s%s','/service/v4_1/rest.php','login','JSON','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','POST','get_module_fields','Calls','module_fields','remove','label','values','value','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../components/integrations/configuration','jayson/promise','test','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','index','SugarcrmAccount','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','map','type','key','field','count','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','getConfigurations','SugarcrmConfiguration','filter','hasOwnProperty','addConfiguration','findOne','getSubjects','channel','Descriptions','getDescriptions','Subjects','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','substring'];(function(_0x15302b,_0x332d8d){var _0x21c769=function(_0x2441c6){while(--_0x2441c6){_0x15302b['push'](_0x15302b['shift']());}};_0x21c769(++_0x332d8d);}(_0x5532,0x19a));var _0x2553=function(_0x28e210,_0x9093a2){_0x28e210=_0x28e210-0x0;var _0x100860=_0x5532[_0x28e210];return _0x100860;};'use strict';var pdf=require(_0x2553('0x0'));var emlformat=require(_0x2553('0x1'));var rimraf=require(_0x2553('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2553('0x3'));var rp=require('request-promise');var moment=require(_0x2553('0x4'));var BPromise=require(_0x2553('0x5'));var Mustache=require(_0x2553('0x6'));var util=require('util');var path=require(_0x2553('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2553('0x8'));var fs=require('fs');var _=require(_0x2553('0x9'));var squel=require('squel');var crypto=require(_0x2553('0xa'));var jsforce=require(_0x2553('0xb'));var deskjs=require(_0x2553('0xc'));var toCsv=require(_0x2553('0xd'));var querystring=require(_0x2553('0xe'));var Papa=require(_0x2553('0xf'));var Redis=require(_0x2553('0x10'));var authService=require(_0x2553('0x11'));var qs=require(_0x2553('0x12'));var hardwareService=require(_0x2553('0x13'));var logger=require('../../config/logger')(_0x2553('0x14'));var utils=require(_0x2553('0x15'));var config=require(_0x2553('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x2553('0x17'));var jayson=require(_0x2553('0x18'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x4394af,_0x4e151d,_0x22e4f4){if(_0x22e4f4){var _0x2806a2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2806a2[_0x2553('0x19')](_0x4e151d)){return _0x4394af;}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 _0x4394af;}}function respondWithRpcPromise(_0x59b800,_0x21dfa8,_0x3b3024,_0x2e2555){return new BPromise(function(_0x77477d,_0x241dfe){var _0x31ae8f=_0x2e2555||client;return _0x31ae8f['request'](_0x59b800,_0x3b3024)[_0x2553('0x1a')](function(_0x4db92a){logger['info'](_0x2553('0x1b'),_0x21dfa8,_0x2553('0x1c'));logger['debug'](_0x2553('0x1d'),_0x21dfa8,_0x2553('0x1c'),JSON[_0x2553('0x1e')](_0x4db92a));if(_0x4db92a[_0x2553('0x1f')]){if(_0x4db92a['error']['code']===0x1f4){logger[_0x2553('0x1f')](_0x2553('0x1b'),_0x21dfa8,_0x4db92a[_0x2553('0x1f')]['message']);return _0x241dfe(_0x4db92a['error'][_0x2553('0x20')]);}logger[_0x2553('0x1f')](_0x2553('0x1b'),_0x21dfa8,_0x4db92a['error'][_0x2553('0x20')]);return _0x77477d(_0x4db92a[_0x2553('0x1f')][_0x2553('0x20')]);}else{logger['info'](_0x2553('0x1b'),_0x21dfa8,_0x2553('0x1c'));_0x77477d(_0x4db92a[_0x2553('0x21')][_0x2553('0x20')]);}})['catch'](function(_0x1b6d14){logger[_0x2553('0x1f')]('SugarcrmAccount,\x20%s,\x20%s',_0x21dfa8,_0x1b6d14);_0x241dfe(_0x1b6d14);});});}function respondWithStatusCode(_0x12dc16,_0x1557ea){_0x1557ea=_0x1557ea||0xcc;return function(_0x57516e){if(_0x57516e){return _0x12dc16[_0x2553('0x22')](_0x1557ea);}return _0x12dc16[_0x2553('0x23')](_0x1557ea)[_0x2553('0x24')]();};}function respondWithResult(_0x4aa3fa,_0x3fdfb1){_0x3fdfb1=_0x3fdfb1||0xc8;return function(_0x581946){if(_0x581946){return _0x4aa3fa[_0x2553('0x23')](_0x3fdfb1)['json'](_0x581946);}};}function respondWithFilteredResult(_0x49163b,_0x1765a5){return function(_0x4fe54d){if(_0x4fe54d){var _0x29f9d1=_0x4fe54d['count'],_0x1f16f5=_0x1765a5[_0x2553('0x25')],_0x17ee14=_0x1765a5[_0x2553('0x25')]+_0x1765a5[_0x2553('0x26')],_0x369bfc;if(_0x17ee14>=_0x29f9d1){_0x17ee14=_0x29f9d1;_0x369bfc=0xc8;}else{_0x369bfc=0xce;}_0x49163b[_0x2553('0x23')](_0x369bfc);return _0x49163b[_0x2553('0x27')](_0x2553('0x28'),_0x1f16f5+'-'+_0x17ee14+'/'+_0x29f9d1)[_0x2553('0x29')](_0x4fe54d);}return null;};}function patchUpdates(_0x3d3224){return function(_0x31770e){try{jsonpatch[_0x2553('0x2a')](_0x31770e,_0x3d3224,!![]);}catch(_0x2ee776){return BPromise[_0x2553('0x2b')](_0x2ee776);}return _0x31770e[_0x2553('0x2c')]();};}function saveUpdates(_0x26dcec,_0x5e692f){return function(_0x238d24){if(_0x238d24){return _0x238d24[_0x2553('0x2d')](_0x26dcec)['then'](function(_0x30043b){return _0x30043b;});}return null;};}function removeEntity(_0x923f13,_0x4f3f34){return function(_0x3222cf){if(_0x3222cf){return _0x3222cf[_0x2553('0x2e')]()[_0x2553('0x1a')](function(){_0x923f13[_0x2553('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x399385,_0x6397b7){return function(_0x140f14){if(!_0x140f14){_0x399385[_0x2553('0x22')](0x194);}return _0x140f14;};}function handleError(_0x16b5af,_0x1cf1a9){_0x1cf1a9=_0x1cf1a9||0x1f4;return function(_0x260077){logger[_0x2553('0x1f')](_0x260077[_0x2553('0x2f')]);if(_0x260077['name']){delete _0x260077[_0x2553('0x30')];}_0x16b5af['status'](_0x1cf1a9)[_0x2553('0x31')](_0x260077);};}exports[_0x2553('0x32')]=function(_0x160c81,_0x59370b){var _0x2df1d6={},_0x478a3b={},_0x4e28b8={'count':0x0,'rows':[]};var _0x593ef9=db[_0x2553('0x33')][_0x2553('0x34')];_0x478a3b[_0x2553('0x35')]=_[_0x2553('0x36')](_0x593ef9);_0x478a3b['query']=_[_0x2553('0x36')](_0x160c81[_0x2553('0x37')]);_0x478a3b[_0x2553('0x38')]=_['intersection'](_0x478a3b[_0x2553('0x35')],_0x478a3b[_0x2553('0x37')]);_0x2df1d6[_0x2553('0x39')]=_[_0x2553('0x3a')](_0x478a3b[_0x2553('0x35')],qs[_0x2553('0x3b')](_0x160c81['query'][_0x2553('0x3b')]));_0x2df1d6[_0x2553('0x39')]=_0x2df1d6[_0x2553('0x39')][_0x2553('0x3c')]?_0x2df1d6[_0x2553('0x39')]:_0x478a3b[_0x2553('0x35')];if(!_0x160c81['query']['hasOwnProperty'](_0x2553('0x3d'))){_0x2df1d6[_0x2553('0x26')]=qs[_0x2553('0x26')](_0x160c81[_0x2553('0x37')]['limit']);_0x2df1d6[_0x2553('0x25')]=qs['offset'](_0x160c81[_0x2553('0x37')][_0x2553('0x25')]);}_0x2df1d6[_0x2553('0x3e')]=qs[_0x2553('0x3f')](_0x160c81[_0x2553('0x37')]['sort']);_0x2df1d6[_0x2553('0x40')]=qs[_0x2553('0x38')](_[_0x2553('0x41')](_0x160c81[_0x2553('0x37')],_0x478a3b['filters']));if(_0x160c81[_0x2553('0x37')]['filter']){_0x2df1d6['where']=_[_0x2553('0x42')](_0x2df1d6['where'],{'$or':_[_0x2553('0x43')](_0x593ef9,function(_0x10fb70){if(_0x10fb70[_0x2553('0x44')][_0x2553('0x45')]!=='VIRTUAL'){var _0x5cb38a={};_0x5cb38a[_0x10fb70[_0x2553('0x46')]]={'$like':'%'+_0x160c81[_0x2553('0x37')]['filter']+'%'};return _0x5cb38a;}})});}_0x2df1d6=_['merge']({},_0x2df1d6,_0x160c81['options']);var _0x535335={'where':_0x2df1d6['where']};return db[_0x2553('0x33')][_0x2553('0x47')](_0x535335)[_0x2553('0x1a')](function(_0x15aab0){_0x4e28b8['count']=_0x15aab0;if(_0x160c81['query']['includeAll']){_0x2df1d6[_0x2553('0x48')]=[{'all':!![]}];}return db[_0x2553('0x33')][_0x2553('0x49')](_0x2df1d6);})[_0x2553('0x1a')](function(_0x27d307){_0x4e28b8[_0x2553('0x4a')]=_0x27d307;return _0x4e28b8;})['then'](respondWithFilteredResult(_0x59370b,_0x2df1d6))[_0x2553('0x4b')](handleError(_0x59370b,null));};exports[_0x2553('0x4c')]=function(_0x2c062a,_0x29ad08){var _0x473b7f={'raw':![],'where':{'id':_0x2c062a[_0x2553('0x4d')]['id']}},_0x206c76={};_0x206c76[_0x2553('0x35')]=_['keys'](db[_0x2553('0x33')][_0x2553('0x34')]);_0x206c76['query']=_[_0x2553('0x36')](_0x2c062a[_0x2553('0x37')]);_0x206c76['filters']=_[_0x2553('0x3a')](_0x206c76['model'],_0x206c76[_0x2553('0x37')]);_0x473b7f['attributes']=_['intersection'](_0x206c76['model'],qs[_0x2553('0x3b')](_0x2c062a[_0x2553('0x37')][_0x2553('0x3b')]));_0x473b7f[_0x2553('0x39')]=_0x473b7f['attributes']['length']?_0x473b7f['attributes']:_0x206c76[_0x2553('0x35')];if(_0x2c062a['query'][_0x2553('0x4e')]){_0x473b7f[_0x2553('0x48')]=[{'all':!![]}];}_0x473b7f=_[_0x2553('0x42')]({},_0x473b7f,_0x2c062a[_0x2553('0x4f')]);return db['SugarcrmAccount'][_0x2553('0x50')](_0x473b7f)[_0x2553('0x1a')](handleEntityNotFound(_0x29ad08,null))[_0x2553('0x1a')](respondWithResult(_0x29ad08,null))[_0x2553('0x4b')](handleError(_0x29ad08,null));};exports[_0x2553('0x51')]=function(_0x250b22,_0x12e4c8){return db['SugarcrmAccount'][_0x2553('0x51')](_0x250b22['body'],{})[_0x2553('0x1a')](respondWithResult(_0x12e4c8,0xc9))[_0x2553('0x4b')](handleError(_0x12e4c8,null));};exports[_0x2553('0x2d')]=function(_0x19971b,_0x379c32){if(_0x19971b[_0x2553('0x52')]['id']){delete _0x19971b[_0x2553('0x52')]['id'];}return db['SugarcrmAccount'][_0x2553('0x50')]({'where':{'id':_0x19971b[_0x2553('0x4d')]['id']}})[_0x2553('0x1a')](handleEntityNotFound(_0x379c32,null))[_0x2553('0x1a')](saveUpdates(_0x19971b['body'],null))[_0x2553('0x1a')](respondWithResult(_0x379c32,null))['catch'](handleError(_0x379c32,null));};exports[_0x2553('0x2e')]=function(_0x4118be,_0x4608e1){return db['SugarcrmAccount'][_0x2553('0x50')]({'where':{'id':_0x4118be[_0x2553('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4608e1,null))[_0x2553('0x1a')](removeEntity(_0x4608e1,null))[_0x2553('0x4b')](handleError(_0x4608e1,null));};exports[_0x2553('0x53')]=function(_0x13cec0,_0x628ab4,_0xebdaf6){var _0x343c42={};var _0x330f2f={};var _0x54aae9;var _0x51d73e;return db['SugarcrmAccount']['findOne']({'where':{'id':_0x13cec0[_0x2553('0x4d')]['id']}})[_0x2553('0x1a')](handleEntityNotFound(_0x628ab4,null))['then'](function(_0x349918){if(_0x349918){_0x54aae9=_0x349918;_0x330f2f['model']=_[_0x2553('0x36')](db[_0x2553('0x54')][_0x2553('0x34')]);_0x330f2f[_0x2553('0x37')]=_[_0x2553('0x36')](_0x13cec0[_0x2553('0x37')]);_0x330f2f[_0x2553('0x38')]=_[_0x2553('0x3a')](_0x330f2f[_0x2553('0x35')],_0x330f2f[_0x2553('0x37')]);_0x343c42['attributes']=_[_0x2553('0x3a')](_0x330f2f[_0x2553('0x35')],qs[_0x2553('0x3b')](_0x13cec0[_0x2553('0x37')][_0x2553('0x3b')]));_0x343c42[_0x2553('0x39')]=_0x343c42[_0x2553('0x39')][_0x2553('0x3c')]?_0x343c42[_0x2553('0x39')]:_0x330f2f['model'];_0x343c42[_0x2553('0x3e')]=qs[_0x2553('0x3f')](_0x13cec0[_0x2553('0x37')][_0x2553('0x3f')]);_0x343c42['where']=qs['filters'](_[_0x2553('0x41')](_0x13cec0[_0x2553('0x37')],_0x330f2f[_0x2553('0x38')]));if(_0x13cec0[_0x2553('0x37')][_0x2553('0x55')]){_0x343c42[_0x2553('0x40')]=_[_0x2553('0x42')](_0x343c42[_0x2553('0x40')],{'$or':_[_0x2553('0x43')](_0x343c42[_0x2553('0x39')],function(_0x596dcc){var _0x36a12c={};_0x36a12c[_0x596dcc]={'$like':'%'+_0x13cec0['query'][_0x2553('0x55')]+'%'};return _0x36a12c;})});}_0x343c42=_[_0x2553('0x42')]({},_0x343c42,_0x13cec0['options']);return _0x54aae9[_0x2553('0x53')](_0x343c42);}})[_0x2553('0x1a')](function(_0x4be6bf){if(_0x4be6bf){_0x51d73e=_0x4be6bf[_0x2553('0x3c')];if(!_0x13cec0[_0x2553('0x37')][_0x2553('0x56')]('nolimit')){_0x343c42[_0x2553('0x26')]=qs['limit'](_0x13cec0[_0x2553('0x37')]['limit']);_0x343c42['offset']=qs[_0x2553('0x25')](_0x13cec0['query'][_0x2553('0x25')]);}return _0x54aae9[_0x2553('0x53')](_0x343c42);}})[_0x2553('0x1a')](function(_0x3c4b8b){if(_0x3c4b8b){return _0x3c4b8b?{'count':_0x51d73e,'rows':_0x3c4b8b}:null;}})['then'](respondWithResult(_0x628ab4,null))['catch'](handleError(_0x628ab4,null));};exports[_0x2553('0x57')]=function(_0x302adb,_0xe1e735,_0x27a570){if(_0x302adb[_0x2553('0x52')]['id']){delete _0x302adb[_0x2553('0x52')]['id'];}return db[_0x2553('0x33')][_0x2553('0x58')]({'where':{'id':_0x302adb['params']['id']}})['then'](handleEntityNotFound(_0xe1e735,null))[_0x2553('0x1a')](function(_0x54ea50){if(_0x54ea50){_0x302adb[_0x2553('0x52')]['AccountId']=_0x54ea50['id'];_0x302adb[_0x2553('0x52')]['Subjects']=integrations[_0x2553('0x59')](_0x302adb[_0x2553('0x52')][_0x2553('0x5a')],_0x302adb[_0x2553('0x52')][_0x2553('0x44')]);_0x302adb[_0x2553('0x52')][_0x2553('0x5b')]=integrations[_0x2553('0x5c')](_0x302adb[_0x2553('0x52')][_0x2553('0x5a')],_0x302adb[_0x2553('0x52')][_0x2553('0x44')]);return db[_0x2553('0x54')][_0x2553('0x51')](_0x302adb['body'],{'include':[{'model':db['SugarcrmField'],'as':_0x2553('0x5d')},{'model':db[_0x2553('0x5e')],'as':_0x2553('0x5b')}]});}return null;})['then'](respondWithResult(_0xe1e735,null))[_0x2553('0x4b')](handleError(_0xe1e735,null));};exports[_0x2553('0x5f')]=function(_0x524c20,_0x2b1b5b,_0x467b9c){var _0x386a03='';var _0x41bab1=['id',_0x2553('0x30'),_0x2553('0x60'),_0x2553('0x61'),_0x2553('0x62'),_0x2553('0x63'),'duration_hours',_0x2553('0x64'),_0x2553('0x65'),_0x2553('0x66'),_0x2553('0x67'),_0x2553('0x68')];return db[_0x2553('0x33')]['findOne']({'where':{'id':_0x524c20[_0x2553('0x4d')]['id']},'attributes':['id',_0x2553('0x69'),_0x2553('0x6a'),_0x2553('0x6b')]})[_0x2553('0x1a')](handleEntityNotFound(_0x2b1b5b,null))['then'](function(_0x1db2db){if(_0x1db2db){_0x386a03=_0x1db2db[_0x2553('0x6b')];var _0x49f665=_0x386a03[_0x2553('0x6c')](-0x1);if(_0x49f665==='/'){_0x386a03=_0x386a03[_0x2553('0x6d')](0x0,_0x386a03[_0x2553('0x6e')](_0x49f665));}return rp({'method':'POST','uri':util['format'](_0x2553('0x6f'),_0x386a03,_0x2553('0x70')),'json':!![],'form':{'method':_0x2553('0x71'),'input_type':_0x2553('0x72'),'response_type':_0x2553('0x72'),'rest_data':JSON[_0x2553('0x1e')]({'user_auth':{'user_name':_0x1db2db[_0x2553('0x69')],'password':_0x1db2db['password'],'encryption':_0x2553('0x73')},'application':_0x2553('0x74')})}});}})[_0x2553('0x1a')](function(_0x516d46){if(_0x516d46&&_0x516d46[_0x2553('0x30')]!==_0x2553('0x75')&&_0x516d46[_0x2553('0x30')]!==_0x2553('0x76')){return rp({'method':_0x2553('0x77'),'uri':util['format'](_0x2553('0x6f'),_0x386a03,_0x2553('0x70')),'json':!![],'form':{'method':_0x2553('0x78'),'input_type':_0x2553('0x72'),'response_type':_0x2553('0x72'),'rest_data':JSON[_0x2553('0x1e')]({'session':_0x516d46['id'],'module_name':_0x2553('0x79')})}})[_0x2553('0x1a')](function(_0x30125b){if(_0x30125b){var _0x30c04d=_['values'](_0x30125b[_0x2553('0x7a')]);_[_0x2553('0x7b')](_0x30c04d,function(_0x2fd56c){return _0x41bab1['includes'](_0x2fd56c['name']);});return{'count':_0x30c04d['length'],'rows':_[_0x2553('0x43')](_0x30c04d,function(_0x23704c){return{'id':_0x23704c[_0x2553('0x30')],'name':_0x23704c[_0x2553('0x7c')],'custom':_['endsWith'](_0x23704c['name'],'_c')?!![]:![],'options':_0x23704c[_0x2553('0x4f')]?_['map'](_[_0x2553('0x7d')](_0x23704c[_0x2553('0x4f')]),function(_0x48ee93){return{'name':_0x48ee93[_0x2553('0x7e')],'value':_0x48ee93['name']};}):[]};})};}})['then'](respondWithResult(_0x2b1b5b,null))['catch'](function(_0x424358){var _0x55b1cb=_0x524c20[_0x2553('0x37')][_0x2553('0x19')]?0x1f4:_0x424358['statusCode']||0x1f4;logger[_0x2553('0x1f')](_0x2553('0x7f'),_0x2553('0x5f'),_0x55b1cb,JSON[_0x2553('0x1e')](_0x424358));delete _0x424358[_0x2553('0x30')];if(_0x55b1cb===0x191){_0x55b1cb=0x190;}_0x2b1b5b[_0x2553('0x23')](_0x55b1cb)[_0x2553('0x31')](_0x524c20[_0x2553('0x37')][_0x2553('0x19')]?{'message':_0x2553('0x80'),'statusCode':_0x424358[_0x2553('0x81')]}:_0x424358);});}else{var _0x3791d7=0x1f4;_0x2b1b5b[_0x2553('0x23')](_0x3791d7)[_0x2553('0x31')]({'message':_0x2553('0x80'),'statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index f1a91fe..6e17435 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 _0xf598=['exports','define','int_sugarcrm_accounts','util','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes'];(function(_0x3feaad,_0x42a73b){var _0x2dadd8=function(_0x487b14){while(--_0x487b14){_0x3feaad['push'](_0x3feaad['shift']());}};_0x2dadd8(++_0x42a73b);}(_0xf598,0xfd));var _0x8f59=function(_0x51d0fb,_0x233d5a){_0x51d0fb=_0x51d0fb-0x0;var _0x2c3991=_0xf598[_0x51d0fb];return _0x2c3991;};'use strict';var _=require('lodash');var util=require(_0x8f59('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x8f59('0x1'));var rp=require(_0x8f59('0x2'));var fs=require('fs');var path=require(_0x8f59('0x3'));var rimraf=require(_0x8f59('0x4'));var config=require(_0x8f59('0x5'));var attributes=require(_0x8f59('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x8f59('0x7')]=function(_0x1e4029,_0x598f7b){return _0x1e4029[_0x8f59('0x8')]('SugarcrmAccount',attributes,{'tableName':_0x8f59('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1b01=['util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmAccount.attributes','exports','define','SugarcrmAccount','lodash'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x1b01,0x1cd));var _0x11b0=function(_0x5a8fa3,_0x4fad8b){_0x5a8fa3=_0x5a8fa3-0x0;var _0x235263=_0x1b01[_0x5a8fa3];return _0x235263;};'use strict';var _=require(_0x11b0('0x0'));var util=require(_0x11b0('0x1'));var logger=require(_0x11b0('0x2'))('api');var moment=require('moment');var BPromise=require(_0x11b0('0x3'));var rp=require(_0x11b0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x11b0('0x5'));var config=require(_0x11b0('0x6'));var attributes=require(_0x11b0('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x11b0('0x8')]=function(_0x4abe06,_0x27d2fb){return _0x4abe06[_0x11b0('0x9')](_0x11b0('0xa'),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 c70538a..59d6849 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 _0x87db=['request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','limit','map','include','model','ShowSugarcrmAccount','find','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SugarcrmAccount,\x20%s,\x20%s'];(function(_0x124495,_0x208eab){var _0x531917=function(_0x43203c){while(--_0x43203c){_0x124495['push'](_0x124495['shift']());}};_0x531917(++_0x208eab);}(_0x87db,0x1ea));var _0xb87d=function(_0x5ee0b9,_0x2303d8){_0x5ee0b9=_0x5ee0b9-0x0;var _0x5c8432=_0x87db[_0x5ee0b9];return _0x5c8432;};'use strict';var _=require('lodash');var util=require(_0xb87d('0x0'));var moment=require('moment');var BPromise=require(_0xb87d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb87d('0x2'));var db=require(_0xb87d('0x3'))['db'];var utils=require(_0xb87d('0x4'));var logger=require(_0xb87d('0x5'))(_0xb87d('0x6'));var config=require(_0xb87d('0x7'));var jayson=require(_0xb87d('0x8'));var client=jayson[_0xb87d('0x9')][_0xb87d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5bb614,_0x47ac63,_0x1fad55){return new BPromise(function(_0x5fe677,_0x1283c4){return client['request'](_0x5bb614,_0x1fad55)[_0xb87d('0xb')](function(_0x53b813){logger[_0xb87d('0xc')](_0xb87d('0xd'),_0x47ac63,_0xb87d('0xe'));logger[_0xb87d('0xf')](_0xb87d('0x10'),_0x47ac63,'request\x20sent',JSON[_0xb87d('0x11')](_0x53b813));if(_0x53b813[_0xb87d('0x12')]){if(_0x53b813[_0xb87d('0x12')][_0xb87d('0x13')]===0x1f4){logger['error'](_0xb87d('0xd'),_0x47ac63,_0x53b813[_0xb87d('0x12')]['message']);return _0x1283c4(_0x53b813[_0xb87d('0x12')]['message']);}logger[_0xb87d('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0x47ac63,_0x53b813[_0xb87d('0x12')][_0xb87d('0x14')]);return _0x5fe677(_0x53b813[_0xb87d('0x12')][_0xb87d('0x14')]);}else{logger['info'](_0xb87d('0xd'),_0x47ac63,'request\x20sent');_0x5fe677(_0x53b813[_0xb87d('0x15')]['message']);}})[_0xb87d('0x16')](function(_0x2f77c4){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x47ac63,_0x2f77c4);_0x1283c4(_0x2f77c4);});});}exports[_0xb87d('0x17')]=function(_0x2d0318){var _0x2df418=this;return new Promise(function(_0x22ff65,_0x2c18dd){return db[_0xb87d('0x18')][_0xb87d('0x19')]({'raw':_0x2d0318[_0xb87d('0x1a')]?_0x2d0318[_0xb87d('0x1a')][_0xb87d('0x1b')]===undefined?!![]:![]:!![],'where':_0x2d0318['options']?_0x2d0318[_0xb87d('0x1a')][_0xb87d('0x1c')]||null:null,'attributes':_0x2d0318[_0xb87d('0x1a')]?_0x2d0318[_0xb87d('0x1a')][_0xb87d('0x1d')]||null:null,'limit':_0x2d0318['options']?_0x2d0318[_0xb87d('0x1a')][_0xb87d('0x1e')]||null:null,'include':_0x2d0318[_0xb87d('0x1a')]?_0x2d0318[_0xb87d('0x1a')]['include']?_[_0xb87d('0x1f')](_0x2d0318[_0xb87d('0x1a')][_0xb87d('0x20')],function(_0xbf6a75){return{'model':db[_0xbf6a75[_0xb87d('0x21')]],'as':_0xbf6a75['as'],'attributes':_0xbf6a75[_0xb87d('0x1d')],'include':_0xbf6a75['include']?_[_0xb87d('0x1f')](_0xbf6a75[_0xb87d('0x20')],function(_0x5e63f9){return{'model':db[_0x5e63f9['model']],'as':_0x5e63f9['as'],'attributes':_0x5e63f9['attributes'],'include':_0x5e63f9[_0xb87d('0x20')]?_[_0xb87d('0x1f')](_0x5e63f9[_0xb87d('0x20')],function(_0x38e161){return{'model':db[_0x38e161['model']],'as':_0x38e161['as'],'attributes':_0x38e161[_0xb87d('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x208a9e){logger['info'](_0xb87d('0x17'),_0x2d0318);logger[_0xb87d('0xf')](_0xb87d('0x17'),_0x2d0318,JSON[_0xb87d('0x11')](_0x208a9e));_0x22ff65(_0x208a9e);})[_0xb87d('0x16')](function(_0x1a7ba4){logger['error'](_0xb87d('0x17'),_0x1a7ba4[_0xb87d('0x14')],_0x2d0318);_0x2c18dd(_0x2df418[_0xb87d('0x12')](0x1f4,_0x1a7ba4[_0xb87d('0x14')]));});});};exports[_0xb87d('0x22')]=function(_0x18e7f0){var _0xc71a11=this;return new Promise(function(_0x1f8ab9,_0x4727a3){return db[_0xb87d('0x18')][_0xb87d('0x23')]({'raw':_0x18e7f0[_0xb87d('0x1a')]?_0x18e7f0[_0xb87d('0x1a')][_0xb87d('0x1b')]===undefined?!![]:![]:!![],'where':_0x18e7f0[_0xb87d('0x1a')]?_0x18e7f0[_0xb87d('0x1a')][_0xb87d('0x1c')]||null:null,'attributes':_0x18e7f0['options']?_0x18e7f0[_0xb87d('0x1a')][_0xb87d('0x1d')]||null:null,'include':_0x18e7f0['options']?_0x18e7f0[_0xb87d('0x1a')][_0xb87d('0x20')]?_[_0xb87d('0x1f')](_0x18e7f0[_0xb87d('0x1a')][_0xb87d('0x20')],function(_0x56d259){return{'model':db[_0x56d259['model']],'as':_0x56d259['as'],'attributes':_0x56d259[_0xb87d('0x1d')],'include':_0x56d259[_0xb87d('0x20')]?_['map'](_0x56d259[_0xb87d('0x20')],function(_0x314b2d){return{'model':db[_0x314b2d[_0xb87d('0x21')]],'as':_0x314b2d['as'],'attributes':_0x314b2d[_0xb87d('0x1d')],'include':_0x314b2d[_0xb87d('0x20')]?_['map'](_0x314b2d[_0xb87d('0x20')],function(_0x3fccbc){return{'model':db[_0x3fccbc[_0xb87d('0x21')]],'as':_0x3fccbc['as'],'attributes':_0x3fccbc['attributes']};}):[]};}):[]};}):[]:[]})[_0xb87d('0xb')](function(_0x55c04d){logger[_0xb87d('0xc')](_0xb87d('0x22'),_0x18e7f0);logger['debug'](_0xb87d('0x22'),_0x18e7f0,JSON['stringify'](_0x55c04d));_0x1f8ab9(_0x55c04d);})['catch'](function(_0x1056fe){logger[_0xb87d('0x12')](_0xb87d('0x22'),_0x1056fe[_0xb87d('0x14')],_0x18e7f0);_0x4727a3(_0xc71a11['error'](0x1f4,_0x1056fe[_0xb87d('0x14')]));});});}; \ No newline at end of file +var _0x52bb=['ShowSugarcrmAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','SugarcrmAccount','findAll','options','raw','where','limit','model','attributes','map','include','then','info','GetSugarcrmAccount'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x52bb,0xd4));var _0xb52b=function(_0x18aced,_0x32a429){_0x18aced=_0x18aced-0x0;var _0x5d4e91=_0x52bb[_0x18aced];return _0x5d4e91;};'use strict';var _=require(_0xb52b('0x0'));var util=require(_0xb52b('0x1'));var moment=require(_0xb52b('0x2'));var BPromise=require(_0xb52b('0x3'));var rs=require(_0xb52b('0x4'));var fs=require('fs');var Redis=require(_0xb52b('0x5'));var db=require(_0xb52b('0x6'))['db'];var utils=require(_0xb52b('0x7'));var logger=require(_0xb52b('0x8'))(_0xb52b('0x9'));var config=require('../../config/environment');var jayson=require(_0xb52b('0xa'));var client=jayson['client'][_0xb52b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5f401a,_0x4e33e5,_0x2d91be){return new BPromise(function(_0x55ce61,_0x35de34){return client['request'](_0x5f401a,_0x2d91be)['then'](function(_0x2dbb4d){logger['info'](_0xb52b('0xc'),_0x4e33e5,_0xb52b('0xd'));logger[_0xb52b('0xe')](_0xb52b('0xf'),_0x4e33e5,'request\x20sent',JSON['stringify'](_0x2dbb4d));if(_0x2dbb4d['error']){if(_0x2dbb4d[_0xb52b('0x10')][_0xb52b('0x11')]===0x1f4){logger['error'](_0xb52b('0xc'),_0x4e33e5,_0x2dbb4d[_0xb52b('0x10')][_0xb52b('0x12')]);return _0x35de34(_0x2dbb4d['error']['message']);}logger['error'](_0xb52b('0xc'),_0x4e33e5,_0x2dbb4d[_0xb52b('0x10')][_0xb52b('0x12')]);return _0x55ce61(_0x2dbb4d[_0xb52b('0x10')][_0xb52b('0x12')]);}else{logger['info'](_0xb52b('0xc'),_0x4e33e5,'request\x20sent');_0x55ce61(_0x2dbb4d['result']['message']);}})[_0xb52b('0x13')](function(_0x8a7434){logger[_0xb52b('0x10')](_0xb52b('0xc'),_0x4e33e5,_0x8a7434);_0x35de34(_0x8a7434);});});}exports['GetSugarcrmAccount']=function(_0x447815){var _0x149fa9=this;return new Promise(function(_0x3adcca,_0x15d344){return db[_0xb52b('0x14')][_0xb52b('0x15')]({'raw':_0x447815[_0xb52b('0x16')]?_0x447815[_0xb52b('0x16')][_0xb52b('0x17')]===undefined?!![]:![]:!![],'where':_0x447815[_0xb52b('0x16')]?_0x447815['options'][_0xb52b('0x18')]||null:null,'attributes':_0x447815[_0xb52b('0x16')]?_0x447815[_0xb52b('0x16')]['attributes']||null:null,'limit':_0x447815[_0xb52b('0x16')]?_0x447815[_0xb52b('0x16')][_0xb52b('0x19')]||null:null,'include':_0x447815[_0xb52b('0x16')]?_0x447815['options']['include']?_['map'](_0x447815[_0xb52b('0x16')]['include'],function(_0x5ef61b){return{'model':db[_0x5ef61b[_0xb52b('0x1a')]],'as':_0x5ef61b['as'],'attributes':_0x5ef61b[_0xb52b('0x1b')],'include':_0x5ef61b['include']?_[_0xb52b('0x1c')](_0x5ef61b[_0xb52b('0x1d')],function(_0x699b7f){return{'model':db[_0x699b7f[_0xb52b('0x1a')]],'as':_0x699b7f['as'],'attributes':_0x699b7f[_0xb52b('0x1b')],'include':_0x699b7f[_0xb52b('0x1d')]?_[_0xb52b('0x1c')](_0x699b7f[_0xb52b('0x1d')],function(_0x34739b){return{'model':db[_0x34739b[_0xb52b('0x1a')]],'as':_0x34739b['as'],'attributes':_0x34739b[_0xb52b('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xb52b('0x1e')](function(_0x1c3741){logger[_0xb52b('0x1f')](_0xb52b('0x20'),_0x447815);logger['debug']('GetSugarcrmAccount',_0x447815,JSON['stringify'](_0x1c3741));_0x3adcca(_0x1c3741);})[_0xb52b('0x13')](function(_0x2dc7dd){logger[_0xb52b('0x10')](_0xb52b('0x20'),_0x2dc7dd[_0xb52b('0x12')],_0x447815);_0x15d344(_0x149fa9[_0xb52b('0x10')](0x1f4,_0x2dc7dd[_0xb52b('0x12')]));});});};exports[_0xb52b('0x21')]=function(_0x32e298){var _0x2d47d1=this;return new Promise(function(_0x34d18b,_0x282518){return db[_0xb52b('0x14')][_0xb52b('0x22')]({'raw':_0x32e298[_0xb52b('0x16')]?_0x32e298[_0xb52b('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x32e298[_0xb52b('0x16')]?_0x32e298[_0xb52b('0x16')][_0xb52b('0x18')]||null:null,'attributes':_0x32e298[_0xb52b('0x16')]?_0x32e298['options'][_0xb52b('0x1b')]||null:null,'include':_0x32e298[_0xb52b('0x16')]?_0x32e298[_0xb52b('0x16')][_0xb52b('0x1d')]?_[_0xb52b('0x1c')](_0x32e298[_0xb52b('0x16')][_0xb52b('0x1d')],function(_0x288c6c){return{'model':db[_0x288c6c[_0xb52b('0x1a')]],'as':_0x288c6c['as'],'attributes':_0x288c6c[_0xb52b('0x1b')],'include':_0x288c6c[_0xb52b('0x1d')]?_[_0xb52b('0x1c')](_0x288c6c['include'],function(_0x5cf34d){return{'model':db[_0x5cf34d[_0xb52b('0x1a')]],'as':_0x5cf34d['as'],'attributes':_0x5cf34d['attributes'],'include':_0x5cf34d['include']?_[_0xb52b('0x1c')](_0x5cf34d[_0xb52b('0x1d')],function(_0x2402bb){return{'model':db[_0x2402bb['model']],'as':_0x2402bb['as'],'attributes':_0x2402bb[_0xb52b('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xb52b('0x1e')](function(_0x5ccfbe){logger[_0xb52b('0x1f')](_0xb52b('0x21'),_0x32e298);logger[_0xb52b('0xe')](_0xb52b('0x21'),_0x32e298,JSON['stringify'](_0x5ccfbe));_0x34d18b(_0x5ccfbe);})[_0xb52b('0x13')](function(_0x3b332b){logger[_0xb52b('0x10')](_0xb52b('0x21'),_0x3b332b[_0xb52b('0x12')],_0x32e298);_0x282518(_0x2d47d1[_0xb52b('0x10')](0x1f4,_0x3b332b[_0xb52b('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 252ca3e..283eabb 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 _0x2fd7=['getSubjects','getDescriptions','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSugarcrmConfiguration.controller','get','/:id','isAuthenticated','show','getFields','/:id/subjects'];(function(_0x5b368d,_0x68ad20){var _0x5e053d=function(_0x49426a){while(--_0x49426a){_0x5b368d['push'](_0x5b368d['shift']());}};_0x5e053d(++_0x68ad20);}(_0x2fd7,0x18f));var _0x72fd=function(_0x4da452,_0x2a2d70){_0x4da452=_0x4da452-0x0;var _0x12ecf2=_0x2fd7[_0x4da452];return _0x12ecf2;};'use strict';var multer=require(_0x72fd('0x0'));var util=require(_0x72fd('0x1'));var path=require(_0x72fd('0x2'));var timeout=require(_0x72fd('0x3'));var express=require(_0x72fd('0x4'));var router=express[_0x72fd('0x5')]();var auth=require(_0x72fd('0x6'));var interaction=require(_0x72fd('0x7'));var config=require('../../config/environment');var controller=require(_0x72fd('0x8'));router[_0x72fd('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x72fd('0x9')](_0x72fd('0xa'),auth[_0x72fd('0xb')](),controller[_0x72fd('0xc')]);router['get']('/:id/fields',auth[_0x72fd('0xb')](),controller[_0x72fd('0xd')]);router['get'](_0x72fd('0xe'),auth[_0x72fd('0xb')](),controller[_0x72fd('0xf')]);router[_0x72fd('0x9')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x72fd('0x10')]);router[_0x72fd('0x11')]('/',auth[_0x72fd('0xb')](),controller[_0x72fd('0x12')]);router[_0x72fd('0x13')]('/:id',auth[_0x72fd('0xb')](),controller[_0x72fd('0x14')]);router[_0x72fd('0x15')](_0x72fd('0xa'),auth[_0x72fd('0xb')](),controller['destroy']);module[_0x72fd('0x16')]=router; \ No newline at end of file +var _0x3bb2=['/:id/descriptions','getDescriptions','post','create','/:id','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects'];(function(_0x1da80f,_0x59f7c8){var _0x382ff6=function(_0x469595){while(--_0x469595){_0x1da80f['push'](_0x1da80f['shift']());}};_0x382ff6(++_0x59f7c8);}(_0x3bb2,0x1b2));var _0x23bb=function(_0xb3e7e5,_0x4738fe){_0xb3e7e5=_0xb3e7e5-0x0;var _0x52bf78=_0x3bb2[_0xb3e7e5];return _0x52bf78;};'use strict';var multer=require(_0x23bb('0x0'));var util=require(_0x23bb('0x1'));var path=require(_0x23bb('0x2'));var timeout=require('connect-timeout');var express=require(_0x23bb('0x3'));var router=express[_0x23bb('0x4')]();var auth=require(_0x23bb('0x5'));var interaction=require(_0x23bb('0x6'));var config=require(_0x23bb('0x7'));var controller=require('./intSugarcrmConfiguration.controller');router[_0x23bb('0x8')]('/',auth[_0x23bb('0x9')](),controller[_0x23bb('0xa')]);router[_0x23bb('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x23bb('0xb')]);router[_0x23bb('0x8')](_0x23bb('0xc'),auth[_0x23bb('0x9')](),controller[_0x23bb('0xd')]);router[_0x23bb('0x8')](_0x23bb('0xe'),auth[_0x23bb('0x9')](),controller[_0x23bb('0xf')]);router[_0x23bb('0x8')](_0x23bb('0x10'),auth[_0x23bb('0x9')](),controller[_0x23bb('0x11')]);router[_0x23bb('0x12')]('/',auth[_0x23bb('0x9')](),controller[_0x23bb('0x13')]);router['put'](_0x23bb('0x14'),auth[_0x23bb('0x9')](),controller[_0x23bb('0x15')]);router[_0x23bb('0x16')](_0x23bb('0x14'),auth['isAuthenticated'](),controller[_0x23bb('0x17')]);module[_0x23bb('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 3ffb736..2416700 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 _0xaabb=['STRING','sequelize','exports'];(function(_0x1747bc,_0x48334e){var _0x475530=function(_0x12c741){while(--_0x12c741){_0x1747bc['push'](_0x1747bc['shift']());}};_0x475530(++_0x48334e);}(_0xaabb,0x1d5));var _0xbaab=function(_0x17e08c,_0x1d7d07){_0x17e08c=_0x17e08c-0x0;var _0x33a755=_0xaabb[_0x17e08c];return _0x33a755;};'use strict';var Sequelize=require(_0xbaab('0x0'));module[_0xbaab('0x1')]={'name':{'type':Sequelize[_0xbaab('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9473=['sequelize','STRING'];(function(_0x434bbf,_0x2f0ecc){var _0x39a6f7=function(_0x507d2f){while(--_0x507d2f){_0x434bbf['push'](_0x434bbf['shift']());}};_0x39a6f7(++_0x2f0ecc);}(_0x9473,0x96));var _0x3947=function(_0xf2cfc6,_0x4ba955){_0xf2cfc6=_0xf2cfc6-0x0;var _0x1e0af6=_0x9473[_0xf2cfc6];return _0x1e0af6;};'use strict';var Sequelize=require(_0x3947('0x0'));module['exports']={'name':{'type':Sequelize[_0x3947('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index ccb22c2..c1cc205 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 _0x0c6b=['crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../mysqldb','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','SugarcrmConfiguration,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','stack','name','SugarcrmConfiguration','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','map','type','VIRTUAL','where','include','findAll','show','params','includeAll','options','find','create','body','getFields','SugarcrmField','pick','getSubjects','findOne','getDescriptions','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x0c6b,0xa2));var _0xb0c6=function(_0xd4cfc2,_0x203be6){_0xd4cfc2=_0xd4cfc2-0x0;var _0x1069ae=_0x0c6b[_0xd4cfc2];return _0x1069ae;};'use strict';var pdf=require(_0xb0c6('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb0c6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb0c6('0x2'));var rp=require(_0xb0c6('0x3'));var moment=require(_0xb0c6('0x4'));var BPromise=require(_0xb0c6('0x5'));var Mustache=require(_0xb0c6('0x6'));var util=require(_0xb0c6('0x7'));var path=require(_0xb0c6('0x8'));var sox=require(_0xb0c6('0x9'));var csv=require(_0xb0c6('0xa'));var ejs=require(_0xb0c6('0xb'));var fs=require('fs');var _=require(_0xb0c6('0xc'));var squel=require(_0xb0c6('0xd'));var crypto=require(_0xb0c6('0xe'));var jsforce=require(_0xb0c6('0xf'));var deskjs=require(_0xb0c6('0x10'));var toCsv=require(_0xb0c6('0xa'));var querystring=require('querystring');var Papa=require(_0xb0c6('0x11'));var Redis=require(_0xb0c6('0x12'));var authService=require(_0xb0c6('0x13'));var qs=require(_0xb0c6('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb0c6('0x15'));var utils=require(_0xb0c6('0x16'));var config=require('../../config/environment');var db=require(_0xb0c6('0x17'))['db'];var jayson=require(_0xb0c6('0x18'));var client=jayson[_0xb0c6('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x5711f4,_0x30a4c2,_0x318c90){if(_0x318c90){var _0xc68d1a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xc68d1a[_0xb0c6('0x1a')](_0x30a4c2)){return _0x5711f4;}else{throw new Error(_0xb0c6('0x1b'));}}else{return _0x5711f4;}}function respondWithRpcPromise(_0x343c1d,_0x5a1d23,_0x40a08d,_0x1682ab){return new BPromise(function(_0x36a6f8,_0x194537){var _0x11709a=_0x1682ab||client;return _0x11709a['request'](_0x343c1d,_0x40a08d)[_0xb0c6('0x1c')](function(_0x458b8d){logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x5a1d23,_0xb0c6('0x1d'));logger['debug'](_0xb0c6('0x1e'),_0x5a1d23,_0xb0c6('0x1d'),JSON[_0xb0c6('0x1f')](_0x458b8d));if(_0x458b8d[_0xb0c6('0x20')]){if(_0x458b8d[_0xb0c6('0x20')]['code']===0x1f4){logger['error'](_0xb0c6('0x21'),_0x5a1d23,_0x458b8d['error']['message']);return _0x194537(_0x458b8d[_0xb0c6('0x20')]['message']);}logger[_0xb0c6('0x20')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x5a1d23,_0x458b8d[_0xb0c6('0x20')][_0xb0c6('0x22')]);return _0x36a6f8(_0x458b8d[_0xb0c6('0x20')][_0xb0c6('0x22')]);}else{logger[_0xb0c6('0x23')](_0xb0c6('0x21'),_0x5a1d23,_0xb0c6('0x1d'));_0x36a6f8(_0x458b8d[_0xb0c6('0x24')]['message']);}})[_0xb0c6('0x25')](function(_0x21a235){logger['error'](_0xb0c6('0x21'),_0x5a1d23,_0x21a235);_0x194537(_0x21a235);});});}function respondWithStatusCode(_0x15a592,_0x5a9179){_0x5a9179=_0x5a9179||0xcc;return function(_0x144129){if(_0x144129){return _0x15a592[_0xb0c6('0x26')](_0x5a9179);}return _0x15a592[_0xb0c6('0x27')](_0x5a9179)[_0xb0c6('0x28')]();};}function respondWithResult(_0xa27062,_0x27e49e){_0x27e49e=_0x27e49e||0xc8;return function(_0x57d380){if(_0x57d380){return _0xa27062[_0xb0c6('0x27')](_0x27e49e)[_0xb0c6('0x29')](_0x57d380);}};}function respondWithFilteredResult(_0x33eb10,_0x40f151){return function(_0x1d447c){if(_0x1d447c){var _0x5eec7f=_0x1d447c[_0xb0c6('0x2a')],_0x5a1c59=_0x40f151['offset'],_0x54a30b=_0x40f151[_0xb0c6('0x2b')]+_0x40f151[_0xb0c6('0x2c')],_0x2f2747;if(_0x54a30b>=_0x5eec7f){_0x54a30b=_0x5eec7f;_0x2f2747=0xc8;}else{_0x2f2747=0xce;}_0x33eb10['status'](_0x2f2747);return _0x33eb10[_0xb0c6('0x2d')](_0xb0c6('0x2e'),_0x5a1c59+'-'+_0x54a30b+'/'+_0x5eec7f)[_0xb0c6('0x29')](_0x1d447c);}return null;};}function patchUpdates(_0x22fd2b){return function(_0x38ec24){try{jsonpatch[_0xb0c6('0x2f')](_0x38ec24,_0x22fd2b,!![]);}catch(_0x1b721a){return BPromise[_0xb0c6('0x30')](_0x1b721a);}return _0x38ec24['save']();};}function saveUpdates(_0x101a28,_0x30904b){return function(_0x12ef7b){if(_0x12ef7b){return _0x12ef7b[_0xb0c6('0x31')](_0x101a28)[_0xb0c6('0x1c')](function(_0x28bf9e){return _0x28bf9e;});}return null;};}function removeEntity(_0x2a504c,_0x35dc73){return function(_0x5b8f48){if(_0x5b8f48){return _0x5b8f48[_0xb0c6('0x32')]()[_0xb0c6('0x1c')](function(){_0x2a504c[_0xb0c6('0x27')](0xcc)[_0xb0c6('0x28')]();});}};}function handleEntityNotFound(_0x39c74b,_0x4c810b){return function(_0x16bb2b){if(!_0x16bb2b){_0x39c74b[_0xb0c6('0x26')](0x194);}return _0x16bb2b;};}function handleError(_0x5cb79c,_0x3c92e5){_0x3c92e5=_0x3c92e5||0x1f4;return function(_0x38e5cb){logger[_0xb0c6('0x20')](_0x38e5cb[_0xb0c6('0x33')]);if(_0x38e5cb['name']){delete _0x38e5cb[_0xb0c6('0x34')];}_0x5cb79c[_0xb0c6('0x27')](_0x3c92e5)['send'](_0x38e5cb);};}exports['index']=function(_0x4a9878,_0x42635c){var _0x370fbf={},_0x2ce02f={},_0x760e48={'count':0x0,'rows':[]};var _0x198dc4=db[_0xb0c6('0x35')][_0xb0c6('0x36')];_0x2ce02f[_0xb0c6('0x37')]=_[_0xb0c6('0x38')](_0x198dc4);_0x2ce02f[_0xb0c6('0x39')]=_[_0xb0c6('0x38')](_0x4a9878[_0xb0c6('0x39')]);_0x2ce02f[_0xb0c6('0x3a')]=_[_0xb0c6('0x3b')](_0x2ce02f['model'],_0x2ce02f[_0xb0c6('0x39')]);_0x370fbf[_0xb0c6('0x3c')]=_[_0xb0c6('0x3b')](_0x2ce02f[_0xb0c6('0x37')],qs['fields'](_0x4a9878['query'][_0xb0c6('0x3d')]));_0x370fbf[_0xb0c6('0x3c')]=_0x370fbf[_0xb0c6('0x3c')][_0xb0c6('0x3e')]?_0x370fbf[_0xb0c6('0x3c')]:_0x2ce02f[_0xb0c6('0x37')];if(!_0x4a9878[_0xb0c6('0x39')][_0xb0c6('0x3f')](_0xb0c6('0x40'))){_0x370fbf[_0xb0c6('0x2c')]=qs[_0xb0c6('0x2c')](_0x4a9878['query'][_0xb0c6('0x2c')]);_0x370fbf[_0xb0c6('0x2b')]=qs[_0xb0c6('0x2b')](_0x4a9878[_0xb0c6('0x39')][_0xb0c6('0x2b')]);}_0x370fbf[_0xb0c6('0x41')]=qs['sort'](_0x4a9878[_0xb0c6('0x39')][_0xb0c6('0x42')]);_0x370fbf['where']=qs[_0xb0c6('0x3a')](_['pick'](_0x4a9878[_0xb0c6('0x39')],_0x2ce02f[_0xb0c6('0x3a')]));if(_0x4a9878['query'][_0xb0c6('0x43')]){_0x370fbf['where']=_[_0xb0c6('0x44')](_0x370fbf['where'],{'$or':_[_0xb0c6('0x45')](_0x198dc4,function(_0x465fd0){if(_0x465fd0[_0xb0c6('0x46')]['key']!==_0xb0c6('0x47')){var _0x479f9a={};_0x479f9a[_0x465fd0['field']]={'$like':'%'+_0x4a9878[_0xb0c6('0x39')][_0xb0c6('0x43')]+'%'};return _0x479f9a;}})});}_0x370fbf=_[_0xb0c6('0x44')]({},_0x370fbf,_0x4a9878['options']);var _0x4006fb={'where':_0x370fbf[_0xb0c6('0x48')]};return db[_0xb0c6('0x35')][_0xb0c6('0x2a')](_0x4006fb)['then'](function(_0x5efdc3){_0x760e48[_0xb0c6('0x2a')]=_0x5efdc3;if(_0x4a9878[_0xb0c6('0x39')]['includeAll']){_0x370fbf[_0xb0c6('0x49')]=[{'all':!![]}];}return db[_0xb0c6('0x35')][_0xb0c6('0x4a')](_0x370fbf);})[_0xb0c6('0x1c')](function(_0x35b626){_0x760e48['rows']=_0x35b626;return _0x760e48;})[_0xb0c6('0x1c')](respondWithFilteredResult(_0x42635c,_0x370fbf))[_0xb0c6('0x25')](handleError(_0x42635c,null));};exports[_0xb0c6('0x4b')]=function(_0x5a9c3b,_0x511ecd){var _0x29df42={'raw':![],'where':{'id':_0x5a9c3b[_0xb0c6('0x4c')]['id']}},_0x1d5a05={};_0x1d5a05['model']=_['keys'](db['SugarcrmConfiguration'][_0xb0c6('0x36')]);_0x1d5a05['query']=_[_0xb0c6('0x38')](_0x5a9c3b['query']);_0x1d5a05[_0xb0c6('0x3a')]=_[_0xb0c6('0x3b')](_0x1d5a05['model'],_0x1d5a05[_0xb0c6('0x39')]);_0x29df42[_0xb0c6('0x3c')]=_[_0xb0c6('0x3b')](_0x1d5a05[_0xb0c6('0x37')],qs['fields'](_0x5a9c3b['query']['fields']));_0x29df42[_0xb0c6('0x3c')]=_0x29df42[_0xb0c6('0x3c')][_0xb0c6('0x3e')]?_0x29df42[_0xb0c6('0x3c')]:_0x1d5a05[_0xb0c6('0x37')];if(_0x5a9c3b['query'][_0xb0c6('0x4d')]){_0x29df42[_0xb0c6('0x49')]=[{'all':!![]}];}_0x29df42=_[_0xb0c6('0x44')]({},_0x29df42,_0x5a9c3b[_0xb0c6('0x4e')]);return db[_0xb0c6('0x35')][_0xb0c6('0x4f')](_0x29df42)['then'](handleEntityNotFound(_0x511ecd,null))[_0xb0c6('0x1c')](respondWithResult(_0x511ecd,null))['catch'](handleError(_0x511ecd,null));};exports[_0xb0c6('0x50')]=function(_0x328804,_0x150fc9){return db[_0xb0c6('0x35')][_0xb0c6('0x50')](_0x328804['body'],{})[_0xb0c6('0x1c')](respondWithResult(_0x150fc9,0xc9))[_0xb0c6('0x25')](handleError(_0x150fc9,null));};exports[_0xb0c6('0x31')]=function(_0x32a11c,_0x8eba1c){if(_0x32a11c[_0xb0c6('0x51')]['id']){delete _0x32a11c['body']['id'];}return db[_0xb0c6('0x35')][_0xb0c6('0x4f')]({'where':{'id':_0x32a11c['params']['id']}})[_0xb0c6('0x1c')](handleEntityNotFound(_0x8eba1c,null))[_0xb0c6('0x1c')](saveUpdates(_0x32a11c['body'],null))[_0xb0c6('0x1c')](respondWithResult(_0x8eba1c,null))[_0xb0c6('0x25')](handleError(_0x8eba1c,null));};exports[_0xb0c6('0x32')]=function(_0x16bdec,_0x480ec4){return db[_0xb0c6('0x35')][_0xb0c6('0x4f')]({'where':{'id':_0x16bdec[_0xb0c6('0x4c')]['id']}})[_0xb0c6('0x1c')](handleEntityNotFound(_0x480ec4,null))[_0xb0c6('0x1c')](removeEntity(_0x480ec4,null))[_0xb0c6('0x25')](handleError(_0x480ec4,null));};exports[_0xb0c6('0x52')]=function(_0x1a5e3e,_0xa137e9,_0x4be597){var _0xe3e451={};var _0x398d90={};var _0x4a5fc9;var _0x17652b;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x1a5e3e[_0xb0c6('0x4c')]['id']}})[_0xb0c6('0x1c')](handleEntityNotFound(_0xa137e9,null))[_0xb0c6('0x1c')](function(_0x48416d){if(_0x48416d){_0x4a5fc9=_0x48416d;_0x398d90['model']=_[_0xb0c6('0x38')](db[_0xb0c6('0x53')][_0xb0c6('0x36')]);_0x398d90['query']=_[_0xb0c6('0x38')](_0x1a5e3e[_0xb0c6('0x39')]);_0x398d90['filters']=_['intersection'](_0x398d90[_0xb0c6('0x37')],_0x398d90[_0xb0c6('0x39')]);_0xe3e451[_0xb0c6('0x3c')]=_[_0xb0c6('0x3b')](_0x398d90[_0xb0c6('0x37')],qs[_0xb0c6('0x3d')](_0x1a5e3e[_0xb0c6('0x39')]['fields']));_0xe3e451[_0xb0c6('0x3c')]=_0xe3e451[_0xb0c6('0x3c')][_0xb0c6('0x3e')]?_0xe3e451['attributes']:_0x398d90[_0xb0c6('0x37')];_0xe3e451[_0xb0c6('0x41')]=qs[_0xb0c6('0x42')](_0x1a5e3e['query'][_0xb0c6('0x42')]);_0xe3e451[_0xb0c6('0x48')]=qs[_0xb0c6('0x3a')](_[_0xb0c6('0x54')](_0x1a5e3e[_0xb0c6('0x39')],_0x398d90[_0xb0c6('0x3a')]));if(_0x1a5e3e[_0xb0c6('0x39')][_0xb0c6('0x43')]){_0xe3e451['where']=_[_0xb0c6('0x44')](_0xe3e451[_0xb0c6('0x48')],{'$or':_[_0xb0c6('0x45')](_0xe3e451[_0xb0c6('0x3c')],function(_0x20f768){var _0x494d6b={};_0x494d6b[_0x20f768]={'$like':'%'+_0x1a5e3e[_0xb0c6('0x39')][_0xb0c6('0x43')]+'%'};return _0x494d6b;})});}_0xe3e451=_['merge']({},_0xe3e451,_0x1a5e3e[_0xb0c6('0x4e')]);return _0x4a5fc9[_0xb0c6('0x52')](_0xe3e451);}})[_0xb0c6('0x1c')](function(_0x3ba705){if(_0x3ba705){_0x17652b=_0x3ba705[_0xb0c6('0x3e')];if(!_0x1a5e3e['query'][_0xb0c6('0x3f')](_0xb0c6('0x40'))){_0xe3e451[_0xb0c6('0x2c')]=qs[_0xb0c6('0x2c')](_0x1a5e3e[_0xb0c6('0x39')][_0xb0c6('0x2c')]);_0xe3e451[_0xb0c6('0x2b')]=qs[_0xb0c6('0x2b')](_0x1a5e3e[_0xb0c6('0x39')][_0xb0c6('0x2b')]);}return _0x4a5fc9['getFields'](_0xe3e451);}})[_0xb0c6('0x1c')](function(_0x17c7d2){if(_0x17c7d2){return _0x17c7d2?{'count':_0x17652b,'rows':_0x17c7d2}:null;}})[_0xb0c6('0x1c')](respondWithResult(_0xa137e9,null))['catch'](handleError(_0xa137e9,null));};exports[_0xb0c6('0x55')]=function(_0x409418,_0xdf0166,_0x51bfd3){var _0x4d1bd2={};var _0x5debe4={};var _0x45d7b8;var _0x617c0c;return db[_0xb0c6('0x35')][_0xb0c6('0x56')]({'where':{'id':_0x409418[_0xb0c6('0x4c')]['id']}})[_0xb0c6('0x1c')](handleEntityNotFound(_0xdf0166,null))['then'](function(_0x31d93c){if(_0x31d93c){_0x45d7b8=_0x31d93c;_0x5debe4[_0xb0c6('0x37')]=_['keys'](db[_0xb0c6('0x53')][_0xb0c6('0x36')]);_0x5debe4[_0xb0c6('0x39')]=_[_0xb0c6('0x38')](_0x409418[_0xb0c6('0x39')]);_0x5debe4[_0xb0c6('0x3a')]=_[_0xb0c6('0x3b')](_0x5debe4['model'],_0x5debe4[_0xb0c6('0x39')]);_0x4d1bd2[_0xb0c6('0x3c')]=_['intersection'](_0x5debe4['model'],qs[_0xb0c6('0x3d')](_0x409418[_0xb0c6('0x39')][_0xb0c6('0x3d')]));_0x4d1bd2['attributes']=_0x4d1bd2[_0xb0c6('0x3c')]['length']?_0x4d1bd2['attributes']:_0x5debe4[_0xb0c6('0x37')];_0x4d1bd2[_0xb0c6('0x41')]=qs[_0xb0c6('0x42')](_0x409418[_0xb0c6('0x39')]['sort']);_0x4d1bd2[_0xb0c6('0x48')]=qs[_0xb0c6('0x3a')](_[_0xb0c6('0x54')](_0x409418[_0xb0c6('0x39')],_0x5debe4[_0xb0c6('0x3a')]));if(_0x409418['query'][_0xb0c6('0x43')]){_0x4d1bd2[_0xb0c6('0x48')]=_[_0xb0c6('0x44')](_0x4d1bd2['where'],{'$or':_[_0xb0c6('0x45')](_0x4d1bd2[_0xb0c6('0x3c')],function(_0x4469b2){var _0x369d1b={};_0x369d1b[_0x4469b2]={'$like':'%'+_0x409418[_0xb0c6('0x39')][_0xb0c6('0x43')]+'%'};return _0x369d1b;})});}_0x4d1bd2=_['merge']({},_0x4d1bd2,_0x409418[_0xb0c6('0x4e')]);return _0x45d7b8[_0xb0c6('0x55')](_0x4d1bd2);}})['then'](function(_0xfc0fb3){if(_0xfc0fb3){_0x617c0c=_0xfc0fb3[_0xb0c6('0x3e')];if(!_0x409418[_0xb0c6('0x39')][_0xb0c6('0x3f')](_0xb0c6('0x40'))){_0x4d1bd2[_0xb0c6('0x2c')]=qs[_0xb0c6('0x2c')](_0x409418[_0xb0c6('0x39')][_0xb0c6('0x2c')]);_0x4d1bd2[_0xb0c6('0x2b')]=qs[_0xb0c6('0x2b')](_0x409418['query'][_0xb0c6('0x2b')]);}return _0x45d7b8[_0xb0c6('0x55')](_0x4d1bd2);}})['then'](function(_0x599338){if(_0x599338){return _0x599338?{'count':_0x617c0c,'rows':_0x599338}:null;}})[_0xb0c6('0x1c')](respondWithResult(_0xdf0166,null))[_0xb0c6('0x25')](handleError(_0xdf0166,null));};exports['getDescriptions']=function(_0x2dc458,_0x10cf5b,_0x5903e3){var _0x131dc3={};var _0x238851={};var _0x40d88d;var _0x4ebd89;return db[_0xb0c6('0x35')][_0xb0c6('0x56')]({'where':{'id':_0x2dc458[_0xb0c6('0x4c')]['id']}})['then'](handleEntityNotFound(_0x10cf5b,null))['then'](function(_0x3438fb){if(_0x3438fb){_0x40d88d=_0x3438fb;_0x238851['model']=_['keys'](db[_0xb0c6('0x53')]['rawAttributes']);_0x238851[_0xb0c6('0x39')]=_[_0xb0c6('0x38')](_0x2dc458['query']);_0x238851[_0xb0c6('0x3a')]=_[_0xb0c6('0x3b')](_0x238851['model'],_0x238851['query']);_0x131dc3[_0xb0c6('0x3c')]=_[_0xb0c6('0x3b')](_0x238851[_0xb0c6('0x37')],qs[_0xb0c6('0x3d')](_0x2dc458[_0xb0c6('0x39')][_0xb0c6('0x3d')]));_0x131dc3[_0xb0c6('0x3c')]=_0x131dc3[_0xb0c6('0x3c')][_0xb0c6('0x3e')]?_0x131dc3[_0xb0c6('0x3c')]:_0x238851['model'];_0x131dc3['order']=qs['sort'](_0x2dc458[_0xb0c6('0x39')][_0xb0c6('0x42')]);_0x131dc3['where']=qs[_0xb0c6('0x3a')](_[_0xb0c6('0x54')](_0x2dc458[_0xb0c6('0x39')],_0x238851[_0xb0c6('0x3a')]));if(_0x2dc458['query']['filter']){_0x131dc3[_0xb0c6('0x48')]=_['merge'](_0x131dc3['where'],{'$or':_[_0xb0c6('0x45')](_0x131dc3[_0xb0c6('0x3c')],function(_0x5e3827){var _0x5ba12b={};_0x5ba12b[_0x5e3827]={'$like':'%'+_0x2dc458[_0xb0c6('0x39')][_0xb0c6('0x43')]+'%'};return _0x5ba12b;})});}_0x131dc3=_[_0xb0c6('0x44')]({},_0x131dc3,_0x2dc458['options']);return _0x40d88d[_0xb0c6('0x57')](_0x131dc3);}})[_0xb0c6('0x1c')](function(_0x3fbc25){if(_0x3fbc25){_0x4ebd89=_0x3fbc25[_0xb0c6('0x3e')];if(!_0x2dc458[_0xb0c6('0x39')][_0xb0c6('0x3f')](_0xb0c6('0x40'))){_0x131dc3[_0xb0c6('0x2c')]=qs['limit'](_0x2dc458[_0xb0c6('0x39')]['limit']);_0x131dc3[_0xb0c6('0x2b')]=qs[_0xb0c6('0x2b')](_0x2dc458['query'][_0xb0c6('0x2b')]);}return _0x40d88d[_0xb0c6('0x57')](_0x131dc3);}})['then'](function(_0x35a241){if(_0x35a241){return _0x35a241?{'count':_0x4ebd89,'rows':_0x35a241}:null;}})[_0xb0c6('0x1c')](respondWithResult(_0x10cf5b,null))[_0xb0c6('0x25')](handleError(_0x10cf5b,null));}; \ No newline at end of file +var _0x716b=['find','create','body','update','getFields','SugarcrmField','map','getSubjects','findOne','getDescriptions','html-pdf','zip-dir','fast-json-patch','request-promise','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','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','debug','stringify','error','code','message','SugarcrmConfiguration,\x20%s,\x20%s','result','catch','status','end','json','offset','limit','set','Content-Range','apply','then','destroy','sendStatus','stack','name','send','model','keys','filters','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','key','VIRTUAL','field','SugarcrmConfiguration','count','includeAll','include','findAll','show','params','rawAttributes','intersection','options'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x716b,0x1c2));var _0xb716=function(_0x42b707,_0x22e9c4){_0x42b707=_0x42b707-0x0;var _0x343135=_0x716b[_0x42b707];return _0x343135;};'use strict';var pdf=require(_0xb716('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb716('0x1'));var jsonpatch=require(_0xb716('0x2'));var rp=require(_0xb716('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb716('0x4'));var util=require(_0xb716('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xb716('0x6'));var ejs=require(_0xb716('0x7'));var fs=require('fs');var _=require(_0xb716('0x8'));var squel=require(_0xb716('0x9'));var crypto=require(_0xb716('0xa'));var jsforce=require(_0xb716('0xb'));var deskjs=require(_0xb716('0xc'));var toCsv=require(_0xb716('0x6'));var querystring=require(_0xb716('0xd'));var Papa=require('papaparse');var Redis=require(_0xb716('0xe'));var authService=require(_0xb716('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xb716('0x10'));var logger=require(_0xb716('0x11'))('api');var utils=require(_0xb716('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0xb716('0x13'));var client=jayson[_0xb716('0x14')][_0xb716('0x15')]({'port':0x232a});function checkPasswordPattern(_0x56505e,_0x209095,_0x47c83b){if(_0x47c83b){var _0x29db59=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x29db59[_0xb716('0x16')](_0x209095)){return _0x56505e;}else{throw new Error(_0xb716('0x17'));}}else{return _0x56505e;}}function respondWithRpcPromise(_0x30a6f4,_0x4dfda1,_0x504d26,_0xd97274){return new BPromise(function(_0x4ded22,_0x1b5fd7){var _0x961486=_0xd97274||client;return _0x961486[_0xb716('0x18')](_0x30a6f4,_0x504d26)['then'](function(_0xcb8d48){logger[_0xb716('0x19')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x4dfda1,_0xb716('0x1a'));logger[_0xb716('0x1b')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x4dfda1,'request\x20sent',JSON[_0xb716('0x1c')](_0xcb8d48));if(_0xcb8d48[_0xb716('0x1d')]){if(_0xcb8d48['error'][_0xb716('0x1e')]===0x1f4){logger[_0xb716('0x1d')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x4dfda1,_0xcb8d48['error'][_0xb716('0x1f')]);return _0x1b5fd7(_0xcb8d48['error'][_0xb716('0x1f')]);}logger[_0xb716('0x1d')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x4dfda1,_0xcb8d48['error'][_0xb716('0x1f')]);return _0x4ded22(_0xcb8d48[_0xb716('0x1d')]['message']);}else{logger[_0xb716('0x19')](_0xb716('0x20'),_0x4dfda1,_0xb716('0x1a'));_0x4ded22(_0xcb8d48[_0xb716('0x21')][_0xb716('0x1f')]);}})[_0xb716('0x22')](function(_0x5d59b9){logger[_0xb716('0x1d')](_0xb716('0x20'),_0x4dfda1,_0x5d59b9);_0x1b5fd7(_0x5d59b9);});});}function respondWithStatusCode(_0xfb14d7,_0x530845){_0x530845=_0x530845||0xcc;return function(_0x1a580e){if(_0x1a580e){return _0xfb14d7['sendStatus'](_0x530845);}return _0xfb14d7[_0xb716('0x23')](_0x530845)[_0xb716('0x24')]();};}function respondWithResult(_0x466161,_0x5443d5){_0x5443d5=_0x5443d5||0xc8;return function(_0x130ef5){if(_0x130ef5){return _0x466161[_0xb716('0x23')](_0x5443d5)[_0xb716('0x25')](_0x130ef5);}};}function respondWithFilteredResult(_0x49c920,_0xfcfb59){return function(_0x375b8e){if(_0x375b8e){var _0x18bd4e=_0x375b8e['count'],_0x155f62=_0xfcfb59['offset'],_0x2f3fe9=_0xfcfb59[_0xb716('0x26')]+_0xfcfb59[_0xb716('0x27')],_0x4f4d53;if(_0x2f3fe9>=_0x18bd4e){_0x2f3fe9=_0x18bd4e;_0x4f4d53=0xc8;}else{_0x4f4d53=0xce;}_0x49c920['status'](_0x4f4d53);return _0x49c920[_0xb716('0x28')](_0xb716('0x29'),_0x155f62+'-'+_0x2f3fe9+'/'+_0x18bd4e)[_0xb716('0x25')](_0x375b8e);}return null;};}function patchUpdates(_0x54d99a){return function(_0x4c5b0c){try{jsonpatch[_0xb716('0x2a')](_0x4c5b0c,_0x54d99a,!![]);}catch(_0x4fe3bb){return BPromise['reject'](_0x4fe3bb);}return _0x4c5b0c['save']();};}function saveUpdates(_0x437a08,_0x14a628){return function(_0x368440){if(_0x368440){return _0x368440['update'](_0x437a08)[_0xb716('0x2b')](function(_0x540613){return _0x540613;});}return null;};}function removeEntity(_0x3e7be0,_0x452ed5){return function(_0x23f52d){if(_0x23f52d){return _0x23f52d[_0xb716('0x2c')]()['then'](function(){_0x3e7be0[_0xb716('0x23')](0xcc)[_0xb716('0x24')]();});}};}function handleEntityNotFound(_0x131101,_0xe8b5b8){return function(_0xbca4c3){if(!_0xbca4c3){_0x131101[_0xb716('0x2d')](0x194);}return _0xbca4c3;};}function handleError(_0x2e32e8,_0x235759){_0x235759=_0x235759||0x1f4;return function(_0x355abe){logger[_0xb716('0x1d')](_0x355abe[_0xb716('0x2e')]);if(_0x355abe[_0xb716('0x2f')]){delete _0x355abe['name'];}_0x2e32e8['status'](_0x235759)[_0xb716('0x30')](_0x355abe);};}exports['index']=function(_0x319e6e,_0x3198d4){var _0x1d2fbb={},_0x25fb07={},_0x3e5f7c={'count':0x0,'rows':[]};var _0x2ebd87=db['SugarcrmConfiguration']['rawAttributes'];_0x25fb07[_0xb716('0x31')]=_['keys'](_0x2ebd87);_0x25fb07['query']=_[_0xb716('0x32')](_0x319e6e['query']);_0x25fb07[_0xb716('0x33')]=_['intersection'](_0x25fb07[_0xb716('0x31')],_0x25fb07[_0xb716('0x34')]);_0x1d2fbb['attributes']=_['intersection'](_0x25fb07[_0xb716('0x31')],qs[_0xb716('0x35')](_0x319e6e[_0xb716('0x34')][_0xb716('0x35')]));_0x1d2fbb['attributes']=_0x1d2fbb[_0xb716('0x36')][_0xb716('0x37')]?_0x1d2fbb[_0xb716('0x36')]:_0x25fb07['model'];if(!_0x319e6e[_0xb716('0x34')][_0xb716('0x38')](_0xb716('0x39'))){_0x1d2fbb[_0xb716('0x27')]=qs[_0xb716('0x27')](_0x319e6e['query'][_0xb716('0x27')]);_0x1d2fbb[_0xb716('0x26')]=qs['offset'](_0x319e6e[_0xb716('0x34')][_0xb716('0x26')]);}_0x1d2fbb[_0xb716('0x3a')]=qs['sort'](_0x319e6e[_0xb716('0x34')][_0xb716('0x3b')]);_0x1d2fbb['where']=qs['filters'](_[_0xb716('0x3c')](_0x319e6e[_0xb716('0x34')],_0x25fb07[_0xb716('0x33')]));if(_0x319e6e[_0xb716('0x34')][_0xb716('0x3d')]){_0x1d2fbb[_0xb716('0x3e')]=_[_0xb716('0x3f')](_0x1d2fbb['where'],{'$or':_['map'](_0x2ebd87,function(_0x4395b7){if(_0x4395b7[_0xb716('0x40')][_0xb716('0x41')]!==_0xb716('0x42')){var _0x3fcc11={};_0x3fcc11[_0x4395b7[_0xb716('0x43')]]={'$like':'%'+_0x319e6e['query']['filter']+'%'};return _0x3fcc11;}})});}_0x1d2fbb=_['merge']({},_0x1d2fbb,_0x319e6e['options']);var _0x968f25={'where':_0x1d2fbb[_0xb716('0x3e')]};return db[_0xb716('0x44')][_0xb716('0x45')](_0x968f25)[_0xb716('0x2b')](function(_0x5b4de9){_0x3e5f7c['count']=_0x5b4de9;if(_0x319e6e[_0xb716('0x34')][_0xb716('0x46')]){_0x1d2fbb[_0xb716('0x47')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0xb716('0x48')](_0x1d2fbb);})[_0xb716('0x2b')](function(_0x2f399d){_0x3e5f7c['rows']=_0x2f399d;return _0x3e5f7c;})['then'](respondWithFilteredResult(_0x3198d4,_0x1d2fbb))[_0xb716('0x22')](handleError(_0x3198d4,null));};exports[_0xb716('0x49')]=function(_0x19dec0,_0x30c3a6){var _0x4e5b95={'raw':![],'where':{'id':_0x19dec0[_0xb716('0x4a')]['id']}},_0x4aa51f={};_0x4aa51f[_0xb716('0x31')]=_[_0xb716('0x32')](db['SugarcrmConfiguration'][_0xb716('0x4b')]);_0x4aa51f[_0xb716('0x34')]=_[_0xb716('0x32')](_0x19dec0[_0xb716('0x34')]);_0x4aa51f['filters']=_[_0xb716('0x4c')](_0x4aa51f[_0xb716('0x31')],_0x4aa51f[_0xb716('0x34')]);_0x4e5b95[_0xb716('0x36')]=_[_0xb716('0x4c')](_0x4aa51f[_0xb716('0x31')],qs[_0xb716('0x35')](_0x19dec0['query'][_0xb716('0x35')]));_0x4e5b95[_0xb716('0x36')]=_0x4e5b95[_0xb716('0x36')][_0xb716('0x37')]?_0x4e5b95[_0xb716('0x36')]:_0x4aa51f[_0xb716('0x31')];if(_0x19dec0[_0xb716('0x34')][_0xb716('0x46')]){_0x4e5b95['include']=[{'all':!![]}];}_0x4e5b95=_['merge']({},_0x4e5b95,_0x19dec0[_0xb716('0x4d')]);return db[_0xb716('0x44')][_0xb716('0x4e')](_0x4e5b95)[_0xb716('0x2b')](handleEntityNotFound(_0x30c3a6,null))[_0xb716('0x2b')](respondWithResult(_0x30c3a6,null))[_0xb716('0x22')](handleError(_0x30c3a6,null));};exports[_0xb716('0x4f')]=function(_0x384663,_0x2aa230){return db['SugarcrmConfiguration'][_0xb716('0x4f')](_0x384663[_0xb716('0x50')],{})[_0xb716('0x2b')](respondWithResult(_0x2aa230,0xc9))[_0xb716('0x22')](handleError(_0x2aa230,null));};exports[_0xb716('0x51')]=function(_0x47f41e,_0x24cc7b){if(_0x47f41e[_0xb716('0x50')]['id']){delete _0x47f41e[_0xb716('0x50')]['id'];}return db[_0xb716('0x44')]['find']({'where':{'id':_0x47f41e[_0xb716('0x4a')]['id']}})[_0xb716('0x2b')](handleEntityNotFound(_0x24cc7b,null))['then'](saveUpdates(_0x47f41e[_0xb716('0x50')],null))['then'](respondWithResult(_0x24cc7b,null))[_0xb716('0x22')](handleError(_0x24cc7b,null));};exports['destroy']=function(_0x3c0b7b,_0x4a5dba){return db[_0xb716('0x44')]['find']({'where':{'id':_0x3c0b7b['params']['id']}})['then'](handleEntityNotFound(_0x4a5dba,null))[_0xb716('0x2b')](removeEntity(_0x4a5dba,null))['catch'](handleError(_0x4a5dba,null));};exports[_0xb716('0x52')]=function(_0x220219,_0x548cf3,_0x1e4f52){var _0x50be20={};var _0x4d1441={};var _0x16e05b;var _0x2d697b;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x220219[_0xb716('0x4a')]['id']}})[_0xb716('0x2b')](handleEntityNotFound(_0x548cf3,null))[_0xb716('0x2b')](function(_0x4df397){if(_0x4df397){_0x16e05b=_0x4df397;_0x4d1441[_0xb716('0x31')]=_[_0xb716('0x32')](db[_0xb716('0x53')][_0xb716('0x4b')]);_0x4d1441[_0xb716('0x34')]=_[_0xb716('0x32')](_0x220219[_0xb716('0x34')]);_0x4d1441['filters']=_[_0xb716('0x4c')](_0x4d1441[_0xb716('0x31')],_0x4d1441[_0xb716('0x34')]);_0x50be20[_0xb716('0x36')]=_[_0xb716('0x4c')](_0x4d1441[_0xb716('0x31')],qs['fields'](_0x220219[_0xb716('0x34')][_0xb716('0x35')]));_0x50be20['attributes']=_0x50be20[_0xb716('0x36')][_0xb716('0x37')]?_0x50be20['attributes']:_0x4d1441['model'];_0x50be20['order']=qs[_0xb716('0x3b')](_0x220219[_0xb716('0x34')]['sort']);_0x50be20[_0xb716('0x3e')]=qs[_0xb716('0x33')](_[_0xb716('0x3c')](_0x220219['query'],_0x4d1441[_0xb716('0x33')]));if(_0x220219[_0xb716('0x34')]['filter']){_0x50be20['where']=_[_0xb716('0x3f')](_0x50be20[_0xb716('0x3e')],{'$or':_[_0xb716('0x54')](_0x50be20[_0xb716('0x36')],function(_0x5b2ee3){var _0x31e8b6={};_0x31e8b6[_0x5b2ee3]={'$like':'%'+_0x220219[_0xb716('0x34')][_0xb716('0x3d')]+'%'};return _0x31e8b6;})});}_0x50be20=_[_0xb716('0x3f')]({},_0x50be20,_0x220219[_0xb716('0x4d')]);return _0x16e05b[_0xb716('0x52')](_0x50be20);}})[_0xb716('0x2b')](function(_0x586c9f){if(_0x586c9f){_0x2d697b=_0x586c9f['length'];if(!_0x220219['query'][_0xb716('0x38')](_0xb716('0x39'))){_0x50be20[_0xb716('0x27')]=qs[_0xb716('0x27')](_0x220219['query'][_0xb716('0x27')]);_0x50be20[_0xb716('0x26')]=qs['offset'](_0x220219[_0xb716('0x34')][_0xb716('0x26')]);}return _0x16e05b[_0xb716('0x52')](_0x50be20);}})[_0xb716('0x2b')](function(_0x14a629){if(_0x14a629){return _0x14a629?{'count':_0x2d697b,'rows':_0x14a629}:null;}})[_0xb716('0x2b')](respondWithResult(_0x548cf3,null))[_0xb716('0x22')](handleError(_0x548cf3,null));};exports[_0xb716('0x55')]=function(_0x9f757a,_0x3b76ab,_0x273929){var _0x491bc8={};var _0xb0a0dc={};var _0x56100d;var _0x2a5b2b;return db[_0xb716('0x44')][_0xb716('0x56')]({'where':{'id':_0x9f757a[_0xb716('0x4a')]['id']}})[_0xb716('0x2b')](handleEntityNotFound(_0x3b76ab,null))[_0xb716('0x2b')](function(_0x489aad){if(_0x489aad){_0x56100d=_0x489aad;_0xb0a0dc[_0xb716('0x31')]=_[_0xb716('0x32')](db[_0xb716('0x53')]['rawAttributes']);_0xb0a0dc['query']=_[_0xb716('0x32')](_0x9f757a[_0xb716('0x34')]);_0xb0a0dc['filters']=_[_0xb716('0x4c')](_0xb0a0dc[_0xb716('0x31')],_0xb0a0dc[_0xb716('0x34')]);_0x491bc8[_0xb716('0x36')]=_[_0xb716('0x4c')](_0xb0a0dc[_0xb716('0x31')],qs[_0xb716('0x35')](_0x9f757a[_0xb716('0x34')]['fields']));_0x491bc8['attributes']=_0x491bc8[_0xb716('0x36')][_0xb716('0x37')]?_0x491bc8[_0xb716('0x36')]:_0xb0a0dc['model'];_0x491bc8[_0xb716('0x3a')]=qs[_0xb716('0x3b')](_0x9f757a[_0xb716('0x34')][_0xb716('0x3b')]);_0x491bc8['where']=qs['filters'](_[_0xb716('0x3c')](_0x9f757a[_0xb716('0x34')],_0xb0a0dc[_0xb716('0x33')]));if(_0x9f757a[_0xb716('0x34')][_0xb716('0x3d')]){_0x491bc8['where']=_[_0xb716('0x3f')](_0x491bc8['where'],{'$or':_[_0xb716('0x54')](_0x491bc8[_0xb716('0x36')],function(_0x5e31f6){var _0x55ff24={};_0x55ff24[_0x5e31f6]={'$like':'%'+_0x9f757a['query'][_0xb716('0x3d')]+'%'};return _0x55ff24;})});}_0x491bc8=_[_0xb716('0x3f')]({},_0x491bc8,_0x9f757a['options']);return _0x56100d[_0xb716('0x55')](_0x491bc8);}})[_0xb716('0x2b')](function(_0x427079){if(_0x427079){_0x2a5b2b=_0x427079[_0xb716('0x37')];if(!_0x9f757a['query'][_0xb716('0x38')]('nolimit')){_0x491bc8['limit']=qs[_0xb716('0x27')](_0x9f757a[_0xb716('0x34')][_0xb716('0x27')]);_0x491bc8[_0xb716('0x26')]=qs[_0xb716('0x26')](_0x9f757a[_0xb716('0x34')][_0xb716('0x26')]);}return _0x56100d[_0xb716('0x55')](_0x491bc8);}})[_0xb716('0x2b')](function(_0x25f6e9){if(_0x25f6e9){return _0x25f6e9?{'count':_0x2a5b2b,'rows':_0x25f6e9}:null;}})[_0xb716('0x2b')](respondWithResult(_0x3b76ab,null))['catch'](handleError(_0x3b76ab,null));};exports[_0xb716('0x57')]=function(_0xef81b,_0x1f7f38,_0x480632){var _0x1ea9b1={};var _0x209ee8={};var _0x15b57a;var _0xf2b723;return db[_0xb716('0x44')]['findOne']({'where':{'id':_0xef81b[_0xb716('0x4a')]['id']}})[_0xb716('0x2b')](handleEntityNotFound(_0x1f7f38,null))['then'](function(_0xffc616){if(_0xffc616){_0x15b57a=_0xffc616;_0x209ee8[_0xb716('0x31')]=_[_0xb716('0x32')](db[_0xb716('0x53')][_0xb716('0x4b')]);_0x209ee8['query']=_[_0xb716('0x32')](_0xef81b[_0xb716('0x34')]);_0x209ee8[_0xb716('0x33')]=_[_0xb716('0x4c')](_0x209ee8[_0xb716('0x31')],_0x209ee8[_0xb716('0x34')]);_0x1ea9b1['attributes']=_[_0xb716('0x4c')](_0x209ee8[_0xb716('0x31')],qs[_0xb716('0x35')](_0xef81b[_0xb716('0x34')][_0xb716('0x35')]));_0x1ea9b1[_0xb716('0x36')]=_0x1ea9b1['attributes'][_0xb716('0x37')]?_0x1ea9b1['attributes']:_0x209ee8['model'];_0x1ea9b1['order']=qs[_0xb716('0x3b')](_0xef81b[_0xb716('0x34')][_0xb716('0x3b')]);_0x1ea9b1['where']=qs['filters'](_['pick'](_0xef81b[_0xb716('0x34')],_0x209ee8['filters']));if(_0xef81b[_0xb716('0x34')][_0xb716('0x3d')]){_0x1ea9b1[_0xb716('0x3e')]=_[_0xb716('0x3f')](_0x1ea9b1['where'],{'$or':_[_0xb716('0x54')](_0x1ea9b1['attributes'],function(_0x301665){var _0x2a8313={};_0x2a8313[_0x301665]={'$like':'%'+_0xef81b[_0xb716('0x34')][_0xb716('0x3d')]+'%'};return _0x2a8313;})});}_0x1ea9b1=_[_0xb716('0x3f')]({},_0x1ea9b1,_0xef81b[_0xb716('0x4d')]);return _0x15b57a['getDescriptions'](_0x1ea9b1);}})[_0xb716('0x2b')](function(_0x1fced4){if(_0x1fced4){_0xf2b723=_0x1fced4[_0xb716('0x37')];if(!_0xef81b['query'][_0xb716('0x38')](_0xb716('0x39'))){_0x1ea9b1['limit']=qs['limit'](_0xef81b[_0xb716('0x34')][_0xb716('0x27')]);_0x1ea9b1[_0xb716('0x26')]=qs[_0xb716('0x26')](_0xef81b[_0xb716('0x34')]['offset']);}return _0x15b57a['getDescriptions'](_0x1ea9b1);}})[_0xb716('0x2b')](function(_0x3a582b){if(_0x3a582b){return _0x3a582b?{'count':_0xf2b723,'rows':_0x3a582b}:null;}})[_0xb716('0x2b')](respondWithResult(_0x1f7f38,null))[_0xb716('0x22')](handleError(_0x1f7f38,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 06ed924..29ab2ea 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 _0x4fac=['int_sugarcrm_configurations','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0x4fac,0x85));var _0xc4fa=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4fac[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xc4fa('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc4fa('0x1'));var moment=require('moment');var BPromise=require(_0xc4fa('0x2'));var rp=require(_0xc4fa('0x3'));var fs=require('fs');var path=require(_0xc4fa('0x4'));var rimraf=require(_0xc4fa('0x5'));var config=require(_0xc4fa('0x6'));var attributes=require(_0xc4fa('0x7'));module[_0xc4fa('0x8')]=function(_0x59b58b,_0x1bf78e){return _0x59b58b[_0xc4fa('0x9')](_0xc4fa('0xa'),attributes,{'tableName':_0xc4fa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb09a=['./intSugarcrmConfiguration.attributes','exports','SugarcrmConfiguration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x687ddc,_0x2092fa){var _0x441991=function(_0x49c6a6){while(--_0x49c6a6){_0x687ddc['push'](_0x687ddc['shift']());}};_0x441991(++_0x2092fa);}(_0xb09a,0x155));var _0xab09=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0xb09a[_0xe73080];return _0x12cbc4;};'use strict';var _=require(_0xab09('0x0'));var util=require(_0xab09('0x1'));var logger=require(_0xab09('0x2'))(_0xab09('0x3'));var moment=require(_0xab09('0x4'));var BPromise=require(_0xab09('0x5'));var rp=require(_0xab09('0x6'));var fs=require('fs');var path=require(_0xab09('0x7'));var rimraf=require(_0xab09('0x8'));var config=require(_0xab09('0x9'));var attributes=require(_0xab09('0xa'));module[_0xab09('0xb')]=function(_0x4fdd2a,_0x3816c1){return _0x4fdd2a['define'](_0xab09('0xc'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index b809486..9ddf7a4 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 _0x8e30=['request','then','request\x20sent','stringify','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','result','catch','lodash','bluebird','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x584308,_0x1379b3){var _0x45865b=function(_0x145a82){while(--_0x145a82){_0x584308['push'](_0x584308['shift']());}};_0x45865b(++_0x1379b3);}(_0x8e30,0x9a));var _0x08e3=function(_0x2ecdaf,_0x4d0793){_0x2ecdaf=_0x2ecdaf-0x0;var _0x1d66a9=_0x8e30[_0x2ecdaf];return _0x1d66a9;};'use strict';var _=require(_0x08e3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x08e3('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x08e3('0x2'));var logger=require(_0x08e3('0x3'))(_0x08e3('0x4'));var config=require('../../config/environment');var jayson=require(_0x08e3('0x5'));var client=jayson[_0x08e3('0x6')][_0x08e3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3c1d32,_0x2a68da,_0x2c5440){return new BPromise(function(_0x493785,_0x3efb33){return client[_0x08e3('0x8')](_0x3c1d32,_0x2c5440)[_0x08e3('0x9')](function(_0x4d9090){logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x2a68da,_0x08e3('0xa'));logger['debug']('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x2a68da,_0x08e3('0xa'),JSON[_0x08e3('0xb')](_0x4d9090));if(_0x4d9090[_0x08e3('0xc')]){if(_0x4d9090[_0x08e3('0xc')][_0x08e3('0xd')]===0x1f4){logger[_0x08e3('0xc')](_0x08e3('0xe'),_0x2a68da,_0x4d9090[_0x08e3('0xc')][_0x08e3('0xf')]);return _0x3efb33(_0x4d9090[_0x08e3('0xc')][_0x08e3('0xf')]);}logger[_0x08e3('0xc')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2a68da,_0x4d9090[_0x08e3('0xc')][_0x08e3('0xf')]);return _0x493785(_0x4d9090[_0x08e3('0xc')]['message']);}else{logger['info'](_0x08e3('0xe'),_0x2a68da,_0x08e3('0xa'));_0x493785(_0x4d9090[_0x08e3('0x10')][_0x08e3('0xf')]);}})[_0x08e3('0x11')](function(_0x34cd86){logger[_0x08e3('0xc')](_0x08e3('0xe'),_0x2a68da,_0x34cd86);_0x3efb33(_0x34cd86);});});} \ No newline at end of file +var _0x36d1=['then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x36d1,0x197));var _0x136d=function(_0x3e1ae1,_0x41080f){_0x3e1ae1=_0x3e1ae1-0x0;var _0x286f26=_0x36d1[_0x3e1ae1];return _0x286f26;};'use strict';var _=require(_0x136d('0x0'));var util=require(_0x136d('0x1'));var moment=require(_0x136d('0x2'));var BPromise=require(_0x136d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x136d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x136d('0x5'));var logger=require(_0x136d('0x6'))(_0x136d('0x7'));var config=require(_0x136d('0x8'));var jayson=require(_0x136d('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xde3b1,_0x4bbf53,_0x2d69c7){return new BPromise(function(_0x29631d,_0x129f01){return client[_0x136d('0xa')](_0xde3b1,_0x2d69c7)[_0x136d('0xb')](function(_0x898e49){logger[_0x136d('0xc')](_0x136d('0xd'),_0x4bbf53,_0x136d('0xe'));logger[_0x136d('0xf')](_0x136d('0x10'),_0x4bbf53,_0x136d('0xe'),JSON[_0x136d('0x11')](_0x898e49));if(_0x898e49[_0x136d('0x12')]){if(_0x898e49[_0x136d('0x12')]['code']===0x1f4){logger[_0x136d('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x4bbf53,_0x898e49[_0x136d('0x12')][_0x136d('0x13')]);return _0x129f01(_0x898e49['error'][_0x136d('0x13')]);}logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x4bbf53,_0x898e49[_0x136d('0x12')][_0x136d('0x13')]);return _0x29631d(_0x898e49['error'][_0x136d('0x13')]);}else{logger[_0x136d('0xc')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x4bbf53,_0x136d('0xe'));_0x29631d(_0x898e49[_0x136d('0x14')][_0x136d('0x13')]);}})[_0x136d('0x15')](function(_0x94ecb){logger[_0x136d('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x4bbf53,_0x94ecb);_0x129f01(_0x94ecb);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 6f3144e..83099c8 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 _0x638e=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x638e,0x10c));var _0xe638=function(_0x1558ab,_0x39d1de){_0x1558ab=_0x1558ab-0x0;var _0x53b64a=_0x638e[_0x1558ab];return _0x53b64a;};'use strict';var multer=require(_0xe638('0x0'));var util=require('util');var path=require(_0xe638('0x1'));var timeout=require(_0xe638('0x2'));var express=require(_0xe638('0x3'));var router=express[_0xe638('0x4')]();var auth=require(_0xe638('0x5'));var interaction=require(_0xe638('0x6'));var config=require(_0xe638('0x7'));var controller=require(_0xe638('0x8'));router[_0xe638('0x9')]('/',auth[_0xe638('0xa')](),controller['index']);router[_0xe638('0x9')]('/:id',auth[_0xe638('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xe638('0xb')]);router[_0xe638('0xc')](_0xe638('0xd'),auth[_0xe638('0xa')](),controller[_0xe638('0xe')]);router['delete'](_0xe638('0xd'),auth[_0xe638('0xa')](),controller[_0xe638('0xf')]);module[_0xe638('0x10')]=router; \ No newline at end of file +var _0xb53c=['index','create','update','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated'];(function(_0x33280d,_0x22af3c){var _0x392fea=function(_0x5d0411){while(--_0x5d0411){_0x33280d['push'](_0x33280d['shift']());}};_0x392fea(++_0x22af3c);}(_0xb53c,0x1e5));var _0xcb53=function(_0x11ff10,_0x255291){_0x11ff10=_0x11ff10-0x0;var _0x26b8c2=_0xb53c[_0x11ff10];return _0x26b8c2;};'use strict';var multer=require(_0xcb53('0x0'));var util=require(_0xcb53('0x1'));var path=require(_0xcb53('0x2'));var timeout=require(_0xcb53('0x3'));var express=require(_0xcb53('0x4'));var router=express['Router']();var auth=require(_0xcb53('0x5'));var interaction=require(_0xcb53('0x6'));var config=require(_0xcb53('0x7'));var controller=require(_0xcb53('0x8'));router[_0xcb53('0x9')]('/',auth[_0xcb53('0xa')](),controller[_0xcb53('0xb')]);router[_0xcb53('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xcb53('0xa')](),controller[_0xcb53('0xc')]);router['put']('/:id',auth[_0xcb53('0xa')](),controller[_0xcb53('0xd')]);router[_0xcb53('0xe')]('/:id',auth[_0xcb53('0xa')](),controller['destroy']);module[_0xcb53('0xf')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 42fdf36..0924280 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 _0xcb91=['string','variable','customVariable','STRING','BOOLEAN','ENUM'];(function(_0x1bb6c6,_0x31907d){var _0x1ca839=function(_0x1c0a78){while(--_0x1c0a78){_0x1bb6c6['push'](_0x1bb6c6['shift']());}};_0x1ca839(++_0x31907d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xab9f3d,_0xb336fa){_0xab9f3d=_0xab9f3d-0x0;var _0x5283bf=_0xcb91[_0xab9f3d];return _0x5283bf;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x1cb9('0x0')](_0x1cb9('0x1'),_0x1cb9('0x2'),_0x1cb9('0x3'),'keyValue'),'defaultValue':_0x1cb9('0x1')},'content':{'type':Sequelize[_0x1cb9('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x1cb9('0x0')](_0x1cb9('0x1'),'variable',_0x1cb9('0x3'))},'keyContent':{'type':Sequelize[_0x1cb9('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x1cb9('0x4')]},'customField':{'type':Sequelize[_0x1cb9('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xdace=['variable','keyValue','STRING','customVariable','BOOLEAN','sequelize','ENUM','string'];(function(_0x403ad0,_0x256151){var _0x468963=function(_0x45a635){while(--_0x45a635){_0x403ad0['push'](_0x403ad0['shift']());}};_0x468963(++_0x256151);}(_0xdace,0xc5));var _0xedac=function(_0x310504,_0x26ad95){_0x310504=_0x310504-0x0;var _0x5b36d0=_0xdace[_0x310504];return _0x5b36d0;};'use strict';var Sequelize=require(_0xedac('0x0'));module['exports']={'type':{'type':Sequelize[_0xedac('0x1')](_0xedac('0x2'),_0xedac('0x3'),'customVariable',_0xedac('0x4')),'defaultValue':_0xedac('0x2')},'content':{'type':Sequelize[_0xedac('0x5')]},'key':{'type':Sequelize[_0xedac('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0xedac('0x2'),_0xedac('0x3'),_0xedac('0x6'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xedac('0x5')]},'nameField':{'type':Sequelize[_0xedac('0x5')]},'customField':{'type':Sequelize[_0xedac('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 4327023..436cc84 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 _0x397a=['filter','merge','map','key','VIRTUAL','field','options','SugarcrmField','include','findAll','rows','catch','show','params','includeAll','find','create','body','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','rawAttributes','model','keys','query','intersection','attributes','fields','length','nolimit','limit','sort','where','filters','pick'];(function(_0x4e05d8,_0xab2ee9){var _0x356a48=function(_0x161d87){while(--_0x161d87){_0x4e05d8['push'](_0x4e05d8['shift']());}};_0x356a48(++_0xab2ee9);}(_0x397a,0xa0));var _0xa397=function(_0xa95722,_0x1023b0){_0xa95722=_0xa95722-0x0;var _0x5351ae=_0x397a[_0xa95722];return _0x5351ae;};'use strict';var pdf=require(_0xa397('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa397('0x1'));var zipdir=require(_0xa397('0x2'));var jsonpatch=require(_0xa397('0x3'));var rp=require(_0xa397('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa397('0x5'));var util=require(_0xa397('0x6'));var path=require('path');var sox=require(_0xa397('0x7'));var csv=require(_0xa397('0x8'));var ejs=require(_0xa397('0x9'));var fs=require('fs');var _=require(_0xa397('0xa'));var squel=require(_0xa397('0xb'));var crypto=require(_0xa397('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa397('0xd'));var toCsv=require(_0xa397('0x8'));var querystring=require('querystring');var Papa=require(_0xa397('0xe'));var Redis=require(_0xa397('0xf'));var authService=require(_0xa397('0x10'));var qs=require(_0xa397('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa397('0x12'))(_0xa397('0x13'));var utils=require(_0xa397('0x14'));var config=require(_0xa397('0x15'));var db=require(_0xa397('0x16'))['db'];function respondWithStatusCode(_0x5cde79,_0x1982f8){_0x1982f8=_0x1982f8||0xcc;return function(_0x3109e1){if(_0x3109e1){return _0x5cde79[_0xa397('0x17')](_0x1982f8);}return _0x5cde79[_0xa397('0x18')](_0x1982f8)[_0xa397('0x19')]();};}function respondWithResult(_0x186125,_0x39b876){_0x39b876=_0x39b876||0xc8;return function(_0x35d10b){if(_0x35d10b){return _0x186125['status'](_0x39b876)[_0xa397('0x1a')](_0x35d10b);}};}function respondWithFilteredResult(_0x4f02db,_0x8609f2){return function(_0x2a02ae){if(_0x2a02ae){var _0x3ddb79=_0x2a02ae[_0xa397('0x1b')],_0x397b1c=_0x8609f2[_0xa397('0x1c')],_0x3b881d=_0x8609f2['offset']+_0x8609f2['limit'],_0x3b5137;if(_0x3b881d>=_0x3ddb79){_0x3b881d=_0x3ddb79;_0x3b5137=0xc8;}else{_0x3b5137=0xce;}_0x4f02db['status'](_0x3b5137);return _0x4f02db['set'](_0xa397('0x1d'),_0x397b1c+'-'+_0x3b881d+'/'+_0x3ddb79)['json'](_0x2a02ae);}return null;};}function patchUpdates(_0x3c1a3f){return function(_0x48c21f){try{jsonpatch[_0xa397('0x1e')](_0x48c21f,_0x3c1a3f,!![]);}catch(_0x4046b7){return BPromise[_0xa397('0x1f')](_0x4046b7);}return _0x48c21f['save']();};}function saveUpdates(_0x56ac01,_0x5a3bc8){return function(_0x321b99){if(_0x321b99){return _0x321b99[_0xa397('0x20')](_0x56ac01)[_0xa397('0x21')](function(_0x1988f0){return _0x1988f0;});}return null;};}function removeEntity(_0x585ba3,_0x3b89e2){return function(_0x313108){if(_0x313108){return _0x313108[_0xa397('0x22')]()[_0xa397('0x21')](function(){_0x585ba3[_0xa397('0x18')](0xcc)[_0xa397('0x19')]();});}};}function handleEntityNotFound(_0x477469,_0x3b8653){return function(_0x128444){if(!_0x128444){_0x477469['sendStatus'](0x194);}return _0x128444;};}function handleError(_0x4efe14,_0x46d8f6){_0x46d8f6=_0x46d8f6||0x1f4;return function(_0x34b328){logger[_0xa397('0x23')](_0x34b328[_0xa397('0x24')]);if(_0x34b328[_0xa397('0x25')]){delete _0x34b328['name'];}_0x4efe14[_0xa397('0x18')](_0x46d8f6)['send'](_0x34b328);};}exports[_0xa397('0x26')]=function(_0x12e14b,_0x1b9400){var _0x5e7780={},_0x1cd498={},_0x189a51={'count':0x0,'rows':[]};var _0xb0ef1c=db['SugarcrmField'][_0xa397('0x27')];_0x1cd498[_0xa397('0x28')]=_[_0xa397('0x29')](_0xb0ef1c);_0x1cd498[_0xa397('0x2a')]=_[_0xa397('0x29')](_0x12e14b['query']);_0x1cd498['filters']=_[_0xa397('0x2b')](_0x1cd498[_0xa397('0x28')],_0x1cd498[_0xa397('0x2a')]);_0x5e7780[_0xa397('0x2c')]=_[_0xa397('0x2b')](_0x1cd498[_0xa397('0x28')],qs[_0xa397('0x2d')](_0x12e14b[_0xa397('0x2a')]['fields']));_0x5e7780[_0xa397('0x2c')]=_0x5e7780[_0xa397('0x2c')][_0xa397('0x2e')]?_0x5e7780[_0xa397('0x2c')]:_0x1cd498['model'];if(!_0x12e14b['query']['hasOwnProperty'](_0xa397('0x2f'))){_0x5e7780[_0xa397('0x30')]=qs[_0xa397('0x30')](_0x12e14b[_0xa397('0x2a')]['limit']);_0x5e7780[_0xa397('0x1c')]=qs[_0xa397('0x1c')](_0x12e14b[_0xa397('0x2a')][_0xa397('0x1c')]);}_0x5e7780['order']=qs[_0xa397('0x31')](_0x12e14b[_0xa397('0x2a')][_0xa397('0x31')]);_0x5e7780[_0xa397('0x32')]=qs[_0xa397('0x33')](_[_0xa397('0x34')](_0x12e14b['query'],_0x1cd498[_0xa397('0x33')]));if(_0x12e14b['query'][_0xa397('0x35')]){_0x5e7780[_0xa397('0x32')]=_[_0xa397('0x36')](_0x5e7780[_0xa397('0x32')],{'$or':_[_0xa397('0x37')](_0xb0ef1c,function(_0x5a5274){if(_0x5a5274['type'][_0xa397('0x38')]!==_0xa397('0x39')){var _0x23fd31={};_0x23fd31[_0x5a5274[_0xa397('0x3a')]]={'$like':'%'+_0x12e14b['query']['filter']+'%'};return _0x23fd31;}})});}_0x5e7780=_['merge']({},_0x5e7780,_0x12e14b[_0xa397('0x3b')]);var _0x476aba={'where':_0x5e7780[_0xa397('0x32')]};return db[_0xa397('0x3c')][_0xa397('0x1b')](_0x476aba)[_0xa397('0x21')](function(_0x2176ee){_0x189a51[_0xa397('0x1b')]=_0x2176ee;if(_0x12e14b['query']['includeAll']){_0x5e7780[_0xa397('0x3d')]=[{'all':!![]}];}return db[_0xa397('0x3c')][_0xa397('0x3e')](_0x5e7780);})[_0xa397('0x21')](function(_0x44be71){_0x189a51[_0xa397('0x3f')]=_0x44be71;return _0x189a51;})[_0xa397('0x21')](respondWithFilteredResult(_0x1b9400,_0x5e7780))[_0xa397('0x40')](handleError(_0x1b9400,null));};exports[_0xa397('0x41')]=function(_0x3bc22c,_0x5e621d){var _0x1a7eb9={'raw':!![],'where':{'id':_0x3bc22c[_0xa397('0x42')]['id']}},_0x2db371={};_0x2db371[_0xa397('0x28')]=_[_0xa397('0x29')](db['SugarcrmField'][_0xa397('0x27')]);_0x2db371[_0xa397('0x2a')]=_[_0xa397('0x29')](_0x3bc22c['query']);_0x2db371['filters']=_[_0xa397('0x2b')](_0x2db371[_0xa397('0x28')],_0x2db371[_0xa397('0x2a')]);_0x1a7eb9['attributes']=_['intersection'](_0x2db371[_0xa397('0x28')],qs[_0xa397('0x2d')](_0x3bc22c[_0xa397('0x2a')][_0xa397('0x2d')]));_0x1a7eb9['attributes']=_0x1a7eb9[_0xa397('0x2c')][_0xa397('0x2e')]?_0x1a7eb9[_0xa397('0x2c')]:_0x2db371['model'];if(_0x3bc22c[_0xa397('0x2a')][_0xa397('0x43')]){_0x1a7eb9[_0xa397('0x3d')]=[{'all':!![]}];}_0x1a7eb9=_[_0xa397('0x36')]({},_0x1a7eb9,_0x3bc22c[_0xa397('0x3b')]);return db[_0xa397('0x3c')][_0xa397('0x44')](_0x1a7eb9)[_0xa397('0x21')](handleEntityNotFound(_0x5e621d,null))[_0xa397('0x21')](respondWithResult(_0x5e621d,null))[_0xa397('0x40')](handleError(_0x5e621d,null));};exports[_0xa397('0x45')]=function(_0x2460a6,_0x42efec){return db['SugarcrmField'][_0xa397('0x45')](_0x2460a6[_0xa397('0x46')],{})[_0xa397('0x21')](respondWithResult(_0x42efec,0xc9))[_0xa397('0x40')](handleError(_0x42efec,null));};exports[_0xa397('0x20')]=function(_0x11043a,_0x147333){if(_0x11043a[_0xa397('0x46')]['id']){delete _0x11043a['body']['id'];}return db['SugarcrmField'][_0xa397('0x44')]({'where':{'id':_0x11043a[_0xa397('0x42')]['id']}})[_0xa397('0x21')](handleEntityNotFound(_0x147333,null))[_0xa397('0x21')](saveUpdates(_0x11043a[_0xa397('0x46')],null))['then'](respondWithResult(_0x147333,null))[_0xa397('0x40')](handleError(_0x147333,null));};exports['destroy']=function(_0x5b8651,_0x48a9ef){return db['SugarcrmField'][_0xa397('0x44')]({'where':{'id':_0x5b8651[_0xa397('0x42')]['id']}})[_0xa397('0x21')](handleEntityNotFound(_0x48a9ef,null))['then'](removeEntity(_0x48a9ef,null))[_0xa397('0x40')](handleError(_0x48a9ef,null));}; \ No newline at end of file +var _0x4267=['fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','reject','save','then','destroy','error','stack','name','send','index','SugarcrmField','rawAttributes','model','keys','filters','intersection','query','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','find','create','update','params','body','rimraf','zip-dir'];(function(_0x4194e4,_0x441d32){var _0x505ee5=function(_0x1fd3e9){while(--_0x1fd3e9){_0x4194e4['push'](_0x4194e4['shift']());}};_0x505ee5(++_0x441d32);}(_0x4267,0x170));var _0x7426=function(_0x46e1b5,_0x5e4456){_0x46e1b5=_0x46e1b5-0x0;var _0x5a1cfe=_0x4267[_0x46e1b5];return _0x5a1cfe;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x7426('0x0'));var zipdir=require(_0x7426('0x1'));var jsonpatch=require(_0x7426('0x2'));var rp=require(_0x7426('0x3'));var moment=require(_0x7426('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7426('0x5'));var util=require('util');var path=require(_0x7426('0x6'));var sox=require(_0x7426('0x7'));var csv=require(_0x7426('0x8'));var ejs=require(_0x7426('0x9'));var fs=require('fs');var _=require(_0x7426('0xa'));var squel=require(_0x7426('0xb'));var crypto=require(_0x7426('0xc'));var jsforce=require(_0x7426('0xd'));var deskjs=require(_0x7426('0xe'));var toCsv=require(_0x7426('0x8'));var querystring=require(_0x7426('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7426('0x10'));var qs=require(_0x7426('0x11'));var hardwareService=require(_0x7426('0x12'));var logger=require(_0x7426('0x13'))(_0x7426('0x14'));var utils=require(_0x7426('0x15'));var config=require(_0x7426('0x16'));var db=require(_0x7426('0x17'))['db'];function respondWithStatusCode(_0x4277ba,_0x261ee1){_0x261ee1=_0x261ee1||0xcc;return function(_0x1d09bb){if(_0x1d09bb){return _0x4277ba[_0x7426('0x18')](_0x261ee1);}return _0x4277ba[_0x7426('0x19')](_0x261ee1)[_0x7426('0x1a')]();};}function respondWithResult(_0xa95d17,_0x9c91bc){_0x9c91bc=_0x9c91bc||0xc8;return function(_0x207d75){if(_0x207d75){return _0xa95d17[_0x7426('0x19')](_0x9c91bc)[_0x7426('0x1b')](_0x207d75);}};}function respondWithFilteredResult(_0x2dfe0c,_0x12912b){return function(_0x4f1e77){if(_0x4f1e77){var _0x124344=_0x4f1e77[_0x7426('0x1c')],_0x3c8848=_0x12912b[_0x7426('0x1d')],_0x3d4272=_0x12912b[_0x7426('0x1d')]+_0x12912b['limit'],_0x21b01e;if(_0x3d4272>=_0x124344){_0x3d4272=_0x124344;_0x21b01e=0xc8;}else{_0x21b01e=0xce;}_0x2dfe0c['status'](_0x21b01e);return _0x2dfe0c['set']('Content-Range',_0x3c8848+'-'+_0x3d4272+'/'+_0x124344)[_0x7426('0x1b')](_0x4f1e77);}return null;};}function patchUpdates(_0xe6d2dc){return function(_0x5d0204){try{jsonpatch['apply'](_0x5d0204,_0xe6d2dc,!![]);}catch(_0xe0abdd){return BPromise[_0x7426('0x1e')](_0xe0abdd);}return _0x5d0204[_0x7426('0x1f')]();};}function saveUpdates(_0x1c41c1,_0x23520f){return function(_0x3dce15){if(_0x3dce15){return _0x3dce15['update'](_0x1c41c1)[_0x7426('0x20')](function(_0x1977ea){return _0x1977ea;});}return null;};}function removeEntity(_0x384bec,_0x309b1b){return function(_0x53dbe8){if(_0x53dbe8){return _0x53dbe8[_0x7426('0x21')]()[_0x7426('0x20')](function(){_0x384bec[_0x7426('0x19')](0xcc)[_0x7426('0x1a')]();});}};}function handleEntityNotFound(_0x34b9af,_0x5fd63b){return function(_0x2489d9){if(!_0x2489d9){_0x34b9af[_0x7426('0x18')](0x194);}return _0x2489d9;};}function handleError(_0x5882bd,_0x6d2077){_0x6d2077=_0x6d2077||0x1f4;return function(_0x4003a7){logger[_0x7426('0x22')](_0x4003a7[_0x7426('0x23')]);if(_0x4003a7[_0x7426('0x24')]){delete _0x4003a7[_0x7426('0x24')];}_0x5882bd[_0x7426('0x19')](_0x6d2077)[_0x7426('0x25')](_0x4003a7);};}exports[_0x7426('0x26')]=function(_0xfcba0f,_0x1023c8){var _0x424a9c={},_0x292c7d={},_0x120fd2={'count':0x0,'rows':[]};var _0x471e69=db[_0x7426('0x27')][_0x7426('0x28')];_0x292c7d[_0x7426('0x29')]=_['keys'](_0x471e69);_0x292c7d['query']=_[_0x7426('0x2a')](_0xfcba0f['query']);_0x292c7d[_0x7426('0x2b')]=_[_0x7426('0x2c')](_0x292c7d['model'],_0x292c7d[_0x7426('0x2d')]);_0x424a9c[_0x7426('0x2e')]=_[_0x7426('0x2c')](_0x292c7d[_0x7426('0x29')],qs[_0x7426('0x2f')](_0xfcba0f['query'][_0x7426('0x2f')]));_0x424a9c[_0x7426('0x2e')]=_0x424a9c[_0x7426('0x2e')][_0x7426('0x30')]?_0x424a9c[_0x7426('0x2e')]:_0x292c7d['model'];if(!_0xfcba0f[_0x7426('0x2d')]['hasOwnProperty'](_0x7426('0x31'))){_0x424a9c['limit']=qs[_0x7426('0x32')](_0xfcba0f[_0x7426('0x2d')][_0x7426('0x32')]);_0x424a9c[_0x7426('0x1d')]=qs['offset'](_0xfcba0f['query'][_0x7426('0x1d')]);}_0x424a9c[_0x7426('0x33')]=qs[_0x7426('0x34')](_0xfcba0f[_0x7426('0x2d')]['sort']);_0x424a9c[_0x7426('0x35')]=qs['filters'](_[_0x7426('0x36')](_0xfcba0f[_0x7426('0x2d')],_0x292c7d[_0x7426('0x2b')]));if(_0xfcba0f[_0x7426('0x2d')][_0x7426('0x37')]){_0x424a9c['where']=_[_0x7426('0x38')](_0x424a9c[_0x7426('0x35')],{'$or':_[_0x7426('0x39')](_0x471e69,function(_0x246174){if(_0x246174[_0x7426('0x3a')][_0x7426('0x3b')]!==_0x7426('0x3c')){var _0x5db2d6={};_0x5db2d6[_0x246174[_0x7426('0x3d')]]={'$like':'%'+_0xfcba0f[_0x7426('0x2d')]['filter']+'%'};return _0x5db2d6;}})});}_0x424a9c=_[_0x7426('0x38')]({},_0x424a9c,_0xfcba0f[_0x7426('0x3e')]);var _0x3f2d3e={'where':_0x424a9c[_0x7426('0x35')]};return db[_0x7426('0x27')][_0x7426('0x1c')](_0x3f2d3e)[_0x7426('0x20')](function(_0x2de9b2){_0x120fd2['count']=_0x2de9b2;if(_0xfcba0f[_0x7426('0x2d')][_0x7426('0x3f')]){_0x424a9c[_0x7426('0x40')]=[{'all':!![]}];}return db[_0x7426('0x27')][_0x7426('0x41')](_0x424a9c);})[_0x7426('0x20')](function(_0x3b83df){_0x120fd2[_0x7426('0x42')]=_0x3b83df;return _0x120fd2;})[_0x7426('0x20')](respondWithFilteredResult(_0x1023c8,_0x424a9c))[_0x7426('0x43')](handleError(_0x1023c8,null));};exports[_0x7426('0x44')]=function(_0x57f3b8,_0x4b58a4){var _0x4146af={'raw':!![],'where':{'id':_0x57f3b8['params']['id']}},_0x1a6ccd={};_0x1a6ccd['model']=_[_0x7426('0x2a')](db[_0x7426('0x27')][_0x7426('0x28')]);_0x1a6ccd[_0x7426('0x2d')]=_[_0x7426('0x2a')](_0x57f3b8[_0x7426('0x2d')]);_0x1a6ccd[_0x7426('0x2b')]=_['intersection'](_0x1a6ccd[_0x7426('0x29')],_0x1a6ccd[_0x7426('0x2d')]);_0x4146af[_0x7426('0x2e')]=_[_0x7426('0x2c')](_0x1a6ccd[_0x7426('0x29')],qs[_0x7426('0x2f')](_0x57f3b8[_0x7426('0x2d')][_0x7426('0x2f')]));_0x4146af[_0x7426('0x2e')]=_0x4146af[_0x7426('0x2e')][_0x7426('0x30')]?_0x4146af[_0x7426('0x2e')]:_0x1a6ccd[_0x7426('0x29')];if(_0x57f3b8[_0x7426('0x2d')][_0x7426('0x3f')]){_0x4146af[_0x7426('0x40')]=[{'all':!![]}];}_0x4146af=_[_0x7426('0x38')]({},_0x4146af,_0x57f3b8[_0x7426('0x3e')]);return db[_0x7426('0x27')][_0x7426('0x45')](_0x4146af)[_0x7426('0x20')](handleEntityNotFound(_0x4b58a4,null))[_0x7426('0x20')](respondWithResult(_0x4b58a4,null))['catch'](handleError(_0x4b58a4,null));};exports[_0x7426('0x46')]=function(_0x699887,_0x54d93a){return db[_0x7426('0x27')][_0x7426('0x46')](_0x699887['body'],{})['then'](respondWithResult(_0x54d93a,0xc9))[_0x7426('0x43')](handleError(_0x54d93a,null));};exports[_0x7426('0x47')]=function(_0x5843ac,_0x19f1da){if(_0x5843ac['body']['id']){delete _0x5843ac['body']['id'];}return db[_0x7426('0x27')][_0x7426('0x45')]({'where':{'id':_0x5843ac[_0x7426('0x48')]['id']}})[_0x7426('0x20')](handleEntityNotFound(_0x19f1da,null))[_0x7426('0x20')](saveUpdates(_0x5843ac[_0x7426('0x49')],null))[_0x7426('0x20')](respondWithResult(_0x19f1da,null))[_0x7426('0x43')](handleError(_0x19f1da,null));};exports['destroy']=function(_0x4b13f7,_0x23506d){return db[_0x7426('0x27')][_0x7426('0x45')]({'where':{'id':_0x4b13f7[_0x7426('0x48')]['id']}})['then'](handleEntityNotFound(_0x23506d,null))['then'](removeEntity(_0x23506d,null))[_0x7426('0x43')](handleError(_0x23506d,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 75bf09e..10450ea 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 _0xdfce=['sugarcrm_unique_index','idField','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','SugarcrmField','int_sugarcrm_fields'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xdfce,0x106));var _0xedfc=function(_0x1a14d5,_0x331c1f){_0x1a14d5=_0x1a14d5-0x0;var _0x3e3648=_0xdfce[_0x1a14d5];return _0x3e3648;};'use strict';var _=require(_0xedfc('0x0'));var util=require(_0xedfc('0x1'));var logger=require(_0xedfc('0x2'))('api');var moment=require('moment');var BPromise=require(_0xedfc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xedfc('0x4'));var rimraf=require(_0xedfc('0x5'));var config=require(_0xedfc('0x6'));var attributes=require(_0xedfc('0x7'));module[_0xedfc('0x8')]=function(_0x203b31,_0x3b53d5){return _0x203b31['define'](_0xedfc('0x9'),attributes,{'tableName':_0xedfc('0xa'),'paranoid':![],'indexes':[{'name':_0xedfc('0xb'),'fields':[_0xedfc('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6ce9=['../../config/environment','SugarcrmField','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x50bcc7,_0x1e3053){var _0x3cbb5a=function(_0x1b2794){while(--_0x1b2794){_0x50bcc7['push'](_0x50bcc7['shift']());}};_0x3cbb5a(++_0x1e3053);}(_0x6ce9,0x1e4));var _0x96ce=function(_0x1f4028,_0x3afe09){_0x1f4028=_0x1f4028-0x0;var _0x49ceda=_0x6ce9[_0x1f4028];return _0x49ceda;};'use strict';var _=require(_0x96ce('0x0'));var util=require(_0x96ce('0x1'));var logger=require(_0x96ce('0x2'))(_0x96ce('0x3'));var moment=require(_0x96ce('0x4'));var BPromise=require(_0x96ce('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x96ce('0x6'));var rimraf=require(_0x96ce('0x7'));var config=require(_0x96ce('0x8'));var attributes=require('./intSugarcrmField.attributes');module['exports']=function(_0x338213,_0x12dade){return _0x338213['define'](_0x96ce('0x9'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x96ce('0xa'),_0x96ce('0xb')],'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 274cb9d..43f5a53 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 _0xfb9c=['http','request','then','SugarcrmField,\x20%s,\x20%s','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x3f9b39,_0x257dde){var _0x33aeff=function(_0x7f70db){while(--_0x7f70db){_0x3f9b39['push'](_0x3f9b39['shift']());}};_0x33aeff(++_0x257dde);}(_0xfb9c,0x12a));var _0xcfb9=function(_0x528342,_0x17a981){_0x528342=_0x528342-0x0;var _0x27dd91=_0xfb9c[_0x528342];return _0x27dd91;};'use strict';var _=require(_0xcfb9('0x0'));var util=require(_0xcfb9('0x1'));var moment=require(_0xcfb9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcfb9('0x3'));var db=require(_0xcfb9('0x4'))['db'];var utils=require(_0xcfb9('0x5'));var logger=require(_0xcfb9('0x6'))(_0xcfb9('0x7'));var config=require('../../config/environment');var jayson=require(_0xcfb9('0x8'));var client=jayson[_0xcfb9('0x9')][_0xcfb9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3232c8,_0x275b97,_0x3b9995){return new BPromise(function(_0x28b0f4,_0x3cf0b7){return client[_0xcfb9('0xb')](_0x3232c8,_0x3b9995)[_0xcfb9('0xc')](function(_0x2e1114){logger['info'](_0xcfb9('0xd'),_0x275b97,'request\x20sent');logger['debug'](_0xcfb9('0xe'),_0x275b97,_0xcfb9('0xf'),JSON['stringify'](_0x2e1114));if(_0x2e1114[_0xcfb9('0x10')]){if(_0x2e1114[_0xcfb9('0x10')][_0xcfb9('0x11')]===0x1f4){logger['error']('SugarcrmField,\x20%s,\x20%s',_0x275b97,_0x2e1114['error'][_0xcfb9('0x12')]);return _0x3cf0b7(_0x2e1114[_0xcfb9('0x10')][_0xcfb9('0x12')]);}logger[_0xcfb9('0x10')](_0xcfb9('0xd'),_0x275b97,_0x2e1114['error']['message']);return _0x28b0f4(_0x2e1114[_0xcfb9('0x10')][_0xcfb9('0x12')]);}else{logger[_0xcfb9('0x13')](_0xcfb9('0xd'),_0x275b97,_0xcfb9('0xf'));_0x28b0f4(_0x2e1114[_0xcfb9('0x14')][_0xcfb9('0x12')]);}})[_0xcfb9('0x15')](function(_0x286a5a){logger['error']('SugarcrmField,\x20%s,\x20%s',_0x275b97,_0x286a5a);_0x3cf0b7(_0x286a5a);});});} \ No newline at end of file +var _0xb780=['randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird'];(function(_0x40ce67,_0x54aea1){var _0x4d2321=function(_0x43074e){while(--_0x43074e){_0x40ce67['push'](_0x40ce67['shift']());}};_0x4d2321(++_0x54aea1);}(_0xb780,0x127));var _0x0b78=function(_0x3afb60,_0x2907df){_0x3afb60=_0x3afb60-0x0;var _0x4d5da6=_0xb780[_0x3afb60];return _0x4d5da6;};'use strict';var _=require(_0x0b78('0x0'));var util=require(_0x0b78('0x1'));var moment=require(_0x0b78('0x2'));var BPromise=require(_0x0b78('0x3'));var rs=require(_0x0b78('0x4'));var fs=require('fs');var Redis=require(_0x0b78('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0b78('0x6'));var logger=require('../../config/logger')(_0x0b78('0x7'));var config=require(_0x0b78('0x8'));var jayson=require(_0x0b78('0x9'));var client=jayson[_0x0b78('0xa')][_0x0b78('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e1964,_0x86c191,_0x5b2940){return new BPromise(function(_0x3b7575,_0x11dfef){return client['request'](_0x4e1964,_0x5b2940)[_0x0b78('0xc')](function(_0x4fb3f0){logger['info'](_0x0b78('0xd'),_0x86c191,_0x0b78('0xe'));logger[_0x0b78('0xf')](_0x0b78('0x10'),_0x86c191,_0x0b78('0xe'),JSON[_0x0b78('0x11')](_0x4fb3f0));if(_0x4fb3f0['error']){if(_0x4fb3f0[_0x0b78('0x12')]['code']===0x1f4){logger[_0x0b78('0x12')](_0x0b78('0xd'),_0x86c191,_0x4fb3f0[_0x0b78('0x12')][_0x0b78('0x13')]);return _0x11dfef(_0x4fb3f0[_0x0b78('0x12')][_0x0b78('0x13')]);}logger[_0x0b78('0x12')](_0x0b78('0xd'),_0x86c191,_0x4fb3f0[_0x0b78('0x12')]['message']);return _0x3b7575(_0x4fb3f0['error'][_0x0b78('0x13')]);}else{logger[_0x0b78('0x14')]('SugarcrmField,\x20%s,\x20%s',_0x86c191,_0x0b78('0xe'));_0x3b7575(_0x4fb3f0[_0x0b78('0x15')][_0x0b78('0x13')]);}})[_0x0b78('0x16')](function(_0x42e8f1){logger[_0x0b78('0x12')]('SugarcrmField,\x20%s,\x20%s',_0x86c191,_0x42e8f1);_0x11dfef(_0x42e8f1);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index ff47182..6fad4c2 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 _0x740f=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','exports','multer','util','path','connect-timeout','Router'];(function(_0x3fe14a,_0x3ba403){var _0x5df683=function(_0x10d830){while(--_0x10d830){_0x3fe14a['push'](_0x3fe14a['shift']());}};_0x5df683(++_0x3ba403);}(_0x740f,0x187));var _0xf740=function(_0x5da107,_0x10357c){_0x5da107=_0x5da107-0x0;var _0x224f15=_0x740f[_0x5da107];return _0x224f15;};'use strict';var multer=require(_0xf740('0x0'));var util=require(_0xf740('0x1'));var path=require(_0xf740('0x2'));var timeout=require(_0xf740('0x3'));var express=require('express');var router=express[_0xf740('0x4')]();var auth=require(_0xf740('0x5'));var interaction=require(_0xf740('0x6'));var config=require(_0xf740('0x7'));var controller=require('./intVtigerAccount.controller');router[_0xf740('0x8')]('/',auth['isAuthenticated'](),controller[_0xf740('0x9')]);router[_0xf740('0x8')](_0xf740('0xa'),auth[_0xf740('0xb')](),controller['show']);router[_0xf740('0x8')](_0xf740('0xc'),auth['isAuthenticated'](),controller[_0xf740('0xd')]);router[_0xf740('0x8')](_0xf740('0xe'),auth[_0xf740('0xb')](),controller[_0xf740('0xf')]);router[_0xf740('0x10')]('/',auth[_0xf740('0xb')](),controller[_0xf740('0x11')]);router[_0xf740('0x10')](_0xf740('0xc'),auth[_0xf740('0xb')](),controller[_0xf740('0x12')]);router[_0xf740('0x13')](_0xf740('0xa'),auth[_0xf740('0xb')](),controller[_0xf740('0x14')]);router['delete'](_0xf740('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xf740('0x15')]=router; \ No newline at end of file +var _0x6c32=['isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x6c32,0x6e));var _0x26c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c32[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x26c3('0x0'));var util=require(_0x26c3('0x1'));var path=require(_0x26c3('0x2'));var timeout=require(_0x26c3('0x3'));var express=require(_0x26c3('0x4'));var router=express[_0x26c3('0x5')]();var auth=require(_0x26c3('0x6'));var interaction=require(_0x26c3('0x7'));var config=require(_0x26c3('0x8'));var controller=require('./intVtigerAccount.controller');router[_0x26c3('0x9')]('/',auth[_0x26c3('0xa')](),controller[_0x26c3('0xb')]);router['get'](_0x26c3('0xc'),auth['isAuthenticated'](),controller[_0x26c3('0xd')]);router[_0x26c3('0x9')](_0x26c3('0xe'),auth[_0x26c3('0xa')](),controller[_0x26c3('0xf')]);router[_0x26c3('0x9')](_0x26c3('0x10'),auth[_0x26c3('0xa')](),controller[_0x26c3('0x11')]);router[_0x26c3('0x12')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x26c3('0xa')](),controller[_0x26c3('0x13')]);router[_0x26c3('0x14')](_0x26c3('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x26c3('0x15')](_0x26c3('0xc'),auth[_0x26c3('0xa')](),controller[_0x26c3('0x16')]);module[_0x26c3('0x17')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 17d8193..33158e1 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 _0x4d6e=['HelpDesk','sequelize','exports','STRING'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x4d6e,0x101));var _0xe4d6=function(_0x314ee0,_0x2c854d){_0x314ee0=_0x314ee0-0x0;var _0x2c618a=_0x4d6e[_0x314ee0];return _0x2c618a;};'use strict';var Sequelize=require(_0xe4d6('0x0'));module[_0xe4d6('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xe4d6('0x2')]},'username':{'type':Sequelize[_0xe4d6('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xe4d6('0x2')],'allowNull':![],'defaultValue':_0xe4d6('0x3')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xe4d6('0x2')]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x090e=['HelpDesk','sequelize','exports','STRING'];(function(_0xa2e7c6,_0x543948){var _0x54c9b0=function(_0xc5c38f){while(--_0xc5c38f){_0xa2e7c6['push'](_0xa2e7c6['shift']());}};_0x54c9b0(++_0x543948);}(_0x090e,0x1dd));var _0xe090=function(_0x1b51ea,_0x394fd9){_0x1b51ea=_0x1b51ea-0x0;var _0x18bbdc=_0x090e[_0x1b51ea];return _0x18bbdc;};'use strict';var Sequelize=require(_0xe090('0x0'));module[_0xe090('0x1')]={'name':{'type':Sequelize[_0xe090('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xe090('0x2')]},'username':{'type':Sequelize[_0xe090('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe090('0x3')},'remoteUri':{'type':Sequelize[_0xe090('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xe090('0x2')]},'accessKey':{'type':Sequelize[_0xe090('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 5d60c19..ede7202 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 _0x32b0=['picklist','picklistValues','label','value','test','Wrong\x20credentials','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../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~!@#$%^&-_=+[{]}.','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','count','offset','limit','json','apply','save','update','then','destroy','stack','name','send','index','VtigerAccount','model','keys','query','filters','attributes','intersection','fields','length','sort','where','pick','merge','type','VIRTUAL','field','filter','options','includeAll','include','catch','show','create','body','find','params','getConfigurations','findOne','rawAttributes','order','map','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','VtigerField','md5','getFields','description','moduleName','remoteUri','username','accessKey','slice','lastIndexOf','format','GET','getchallenge','success','POST','login','token','describe','sessionName','autogenerated','reference','owner','remove','editable','startsWith','cf_'];(function(_0x185369,_0x8eb125){var _0x4cc094=function(_0xed5a10){while(--_0xed5a10){_0x185369['push'](_0x185369['shift']());}};_0x4cc094(++_0x8eb125);}(_0x32b0,0x174));var _0x032b=function(_0x22a01f,_0x2a6f21){_0x22a01f=_0x22a01f-0x0;var _0x58f099=_0x32b0[_0x22a01f];return _0x58f099;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x032b('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x032b('0x1'));var moment=require(_0x032b('0x2'));var BPromise=require(_0x032b('0x3'));var Mustache=require(_0x032b('0x4'));var util=require('util');var path=require(_0x032b('0x5'));var sox=require('sox');var csv=require(_0x032b('0x6'));var ejs=require(_0x032b('0x7'));var fs=require('fs');var _=require(_0x032b('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x032b('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x032b('0x6'));var querystring=require(_0x032b('0xa'));var Papa=require(_0x032b('0xb'));var Redis=require(_0x032b('0xc'));var authService=require(_0x032b('0xd'));var qs=require(_0x032b('0xe'));var hardwareService=require(_0x032b('0xf'));var logger=require(_0x032b('0x10'))(_0x032b('0x11'));var utils=require('../../config/utils');var config=require(_0x032b('0x12'));var db=require(_0x032b('0x13'))['db'];var integrations=require(_0x032b('0x14'));var jayson=require(_0x032b('0x15'));var client=jayson[_0x032b('0x16')]['http']({'port':0x232a});function checkPasswordPattern(_0x30c4de,_0x5edfe0,_0x354159){if(_0x354159){var _0x23950f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x23950f['test'](_0x5edfe0)){return _0x30c4de;}else{throw new Error(_0x032b('0x17'));}}else{return _0x30c4de;}}function respondWithRpcPromise(_0x5143a2,_0x4ecd92,_0x38b6b4,_0x3877fc){return new BPromise(function(_0x19729b,_0x39e4df){var _0x52ce90=_0x3877fc||client;return _0x52ce90[_0x032b('0x18')](_0x5143a2,_0x38b6b4)['then'](function(_0x1ad36d){logger[_0x032b('0x19')](_0x032b('0x1a'),_0x4ecd92,_0x032b('0x1b'));logger[_0x032b('0x1c')](_0x032b('0x1d'),_0x4ecd92,_0x032b('0x1b'),JSON[_0x032b('0x1e')](_0x1ad36d));if(_0x1ad36d[_0x032b('0x1f')]){if(_0x1ad36d[_0x032b('0x1f')]['code']===0x1f4){logger[_0x032b('0x1f')](_0x032b('0x1a'),_0x4ecd92,_0x1ad36d[_0x032b('0x1f')]['message']);return _0x39e4df(_0x1ad36d[_0x032b('0x1f')][_0x032b('0x20')]);}logger['error'](_0x032b('0x1a'),_0x4ecd92,_0x1ad36d['error']['message']);return _0x19729b(_0x1ad36d['error']['message']);}else{logger[_0x032b('0x19')]('VtigerAccount,\x20%s,\x20%s',_0x4ecd92,_0x032b('0x1b'));_0x19729b(_0x1ad36d[_0x032b('0x21')]['message']);}})['catch'](function(_0x192ee5){logger[_0x032b('0x1f')](_0x032b('0x1a'),_0x4ecd92,_0x192ee5);_0x39e4df(_0x192ee5);});});}function respondWithStatusCode(_0x378e7e,_0x1c0c85){_0x1c0c85=_0x1c0c85||0xcc;return function(_0x105863){if(_0x105863){return _0x378e7e[_0x032b('0x22')](_0x1c0c85);}return _0x378e7e[_0x032b('0x23')](_0x1c0c85)[_0x032b('0x24')]();};}function respondWithResult(_0x21a737,_0x2fab64){_0x2fab64=_0x2fab64||0xc8;return function(_0xb0e761){if(_0xb0e761){return _0x21a737[_0x032b('0x23')](_0x2fab64)['json'](_0xb0e761);}};}function respondWithFilteredResult(_0x14d02f,_0x42bfdd){return function(_0xdb95a1){if(_0xdb95a1){var _0x5ea82b=_0xdb95a1[_0x032b('0x25')],_0x49c566=_0x42bfdd[_0x032b('0x26')],_0x55b272=_0x42bfdd['offset']+_0x42bfdd[_0x032b('0x27')],_0x3bc3a;if(_0x55b272>=_0x5ea82b){_0x55b272=_0x5ea82b;_0x3bc3a=0xc8;}else{_0x3bc3a=0xce;}_0x14d02f['status'](_0x3bc3a);return _0x14d02f['set']('Content-Range',_0x49c566+'-'+_0x55b272+'/'+_0x5ea82b)[_0x032b('0x28')](_0xdb95a1);}return null;};}function patchUpdates(_0x117501){return function(_0x513538){try{jsonpatch[_0x032b('0x29')](_0x513538,_0x117501,!![]);}catch(_0x23e48a){return BPromise['reject'](_0x23e48a);}return _0x513538[_0x032b('0x2a')]();};}function saveUpdates(_0x562263,_0x50efac){return function(_0x48ff8e){if(_0x48ff8e){return _0x48ff8e[_0x032b('0x2b')](_0x562263)[_0x032b('0x2c')](function(_0x292e03){return _0x292e03;});}return null;};}function removeEntity(_0x2d9b73,_0x34fed4){return function(_0x46bb9b){if(_0x46bb9b){return _0x46bb9b[_0x032b('0x2d')]()[_0x032b('0x2c')](function(){_0x2d9b73[_0x032b('0x23')](0xcc)[_0x032b('0x24')]();});}};}function handleEntityNotFound(_0x5c86e4,_0x1ab047){return function(_0xef24b2){if(!_0xef24b2){_0x5c86e4['sendStatus'](0x194);}return _0xef24b2;};}function handleError(_0x21af61,_0x9544ea){_0x9544ea=_0x9544ea||0x1f4;return function(_0x277f3b){logger[_0x032b('0x1f')](_0x277f3b[_0x032b('0x2e')]);if(_0x277f3b['name']){delete _0x277f3b[_0x032b('0x2f')];}_0x21af61[_0x032b('0x23')](_0x9544ea)[_0x032b('0x30')](_0x277f3b);};}exports[_0x032b('0x31')]=function(_0x564a98,_0x34c302){var _0x4196c6={},_0x59162e={},_0x11c80b={'count':0x0,'rows':[]};var _0x3169aa=db[_0x032b('0x32')]['rawAttributes'];_0x59162e[_0x032b('0x33')]=_[_0x032b('0x34')](_0x3169aa);_0x59162e['query']=_[_0x032b('0x34')](_0x564a98[_0x032b('0x35')]);_0x59162e[_0x032b('0x36')]=_['intersection'](_0x59162e[_0x032b('0x33')],_0x59162e[_0x032b('0x35')]);_0x4196c6[_0x032b('0x37')]=_[_0x032b('0x38')](_0x59162e[_0x032b('0x33')],qs[_0x032b('0x39')](_0x564a98[_0x032b('0x35')][_0x032b('0x39')]));_0x4196c6[_0x032b('0x37')]=_0x4196c6[_0x032b('0x37')][_0x032b('0x3a')]?_0x4196c6['attributes']:_0x59162e[_0x032b('0x33')];if(!_0x564a98[_0x032b('0x35')]['hasOwnProperty']('nolimit')){_0x4196c6[_0x032b('0x27')]=qs[_0x032b('0x27')](_0x564a98[_0x032b('0x35')][_0x032b('0x27')]);_0x4196c6[_0x032b('0x26')]=qs['offset'](_0x564a98['query']['offset']);}_0x4196c6['order']=qs[_0x032b('0x3b')](_0x564a98[_0x032b('0x35')][_0x032b('0x3b')]);_0x4196c6[_0x032b('0x3c')]=qs[_0x032b('0x36')](_[_0x032b('0x3d')](_0x564a98[_0x032b('0x35')],_0x59162e[_0x032b('0x36')]));if(_0x564a98[_0x032b('0x35')]['filter']){_0x4196c6['where']=_[_0x032b('0x3e')](_0x4196c6['where'],{'$or':_['map'](_0x3169aa,function(_0x49029a){if(_0x49029a[_0x032b('0x3f')]['key']!==_0x032b('0x40')){var _0x399a92={};_0x399a92[_0x49029a[_0x032b('0x41')]]={'$like':'%'+_0x564a98[_0x032b('0x35')][_0x032b('0x42')]+'%'};return _0x399a92;}})});}_0x4196c6=_['merge']({},_0x4196c6,_0x564a98[_0x032b('0x43')]);var _0x4f392b={'where':_0x4196c6[_0x032b('0x3c')]};return db['VtigerAccount'][_0x032b('0x25')](_0x4f392b)[_0x032b('0x2c')](function(_0x1568d6){_0x11c80b['count']=_0x1568d6;if(_0x564a98['query'][_0x032b('0x44')]){_0x4196c6[_0x032b('0x45')]=[{'all':!![]}];}return db[_0x032b('0x32')]['findAll'](_0x4196c6);})[_0x032b('0x2c')](function(_0x19c872){_0x11c80b['rows']=_0x19c872;return _0x11c80b;})[_0x032b('0x2c')](respondWithFilteredResult(_0x34c302,_0x4196c6))[_0x032b('0x46')](handleError(_0x34c302,null));};exports[_0x032b('0x47')]=function(_0x352d3c,_0x107fd1){var _0x750155={'raw':![],'where':{'id':_0x352d3c['params']['id']}},_0x17d188={};_0x17d188[_0x032b('0x33')]=_['keys'](db[_0x032b('0x32')]['rawAttributes']);_0x17d188['query']=_['keys'](_0x352d3c[_0x032b('0x35')]);_0x17d188[_0x032b('0x36')]=_[_0x032b('0x38')](_0x17d188[_0x032b('0x33')],_0x17d188[_0x032b('0x35')]);_0x750155['attributes']=_[_0x032b('0x38')](_0x17d188[_0x032b('0x33')],qs[_0x032b('0x39')](_0x352d3c['query'][_0x032b('0x39')]));_0x750155[_0x032b('0x37')]=_0x750155['attributes'][_0x032b('0x3a')]?_0x750155[_0x032b('0x37')]:_0x17d188[_0x032b('0x33')];if(_0x352d3c[_0x032b('0x35')]['includeAll']){_0x750155[_0x032b('0x45')]=[{'all':!![]}];}_0x750155=_[_0x032b('0x3e')]({},_0x750155,_0x352d3c[_0x032b('0x43')]);return db['VtigerAccount']['find'](_0x750155)[_0x032b('0x2c')](handleEntityNotFound(_0x107fd1,null))[_0x032b('0x2c')](respondWithResult(_0x107fd1,null))[_0x032b('0x46')](handleError(_0x107fd1,null));};exports[_0x032b('0x48')]=function(_0x1011c7,_0x2a343e){return db[_0x032b('0x32')][_0x032b('0x48')](_0x1011c7['body'],{})[_0x032b('0x2c')](respondWithResult(_0x2a343e,0xc9))[_0x032b('0x46')](handleError(_0x2a343e,null));};exports[_0x032b('0x2b')]=function(_0x9744ab,_0x756d56){if(_0x9744ab['body']['id']){delete _0x9744ab[_0x032b('0x49')]['id'];}return db['VtigerAccount'][_0x032b('0x4a')]({'where':{'id':_0x9744ab[_0x032b('0x4b')]['id']}})[_0x032b('0x2c')](handleEntityNotFound(_0x756d56,null))[_0x032b('0x2c')](saveUpdates(_0x9744ab['body'],null))[_0x032b('0x2c')](respondWithResult(_0x756d56,null))['catch'](handleError(_0x756d56,null));};exports['destroy']=function(_0x2a6288,_0x1b1a68){return db[_0x032b('0x32')]['find']({'where':{'id':_0x2a6288['params']['id']}})['then'](handleEntityNotFound(_0x1b1a68,null))[_0x032b('0x2c')](removeEntity(_0x1b1a68,null))[_0x032b('0x46')](handleError(_0x1b1a68,null));};exports[_0x032b('0x4c')]=function(_0x4f0f67,_0x4c5028,_0x3f1712){var _0x31dd6b={};var _0x1e08c6={};var _0xd53934;var _0x2125f9;return db[_0x032b('0x32')][_0x032b('0x4d')]({'where':{'id':_0x4f0f67[_0x032b('0x4b')]['id']}})[_0x032b('0x2c')](handleEntityNotFound(_0x4c5028,null))[_0x032b('0x2c')](function(_0x410638){if(_0x410638){_0xd53934=_0x410638;_0x1e08c6[_0x032b('0x33')]=_[_0x032b('0x34')](db['VtigerConfiguration'][_0x032b('0x4e')]);_0x1e08c6['query']=_[_0x032b('0x34')](_0x4f0f67[_0x032b('0x35')]);_0x1e08c6[_0x032b('0x36')]=_['intersection'](_0x1e08c6['model'],_0x1e08c6[_0x032b('0x35')]);_0x31dd6b['attributes']=_['intersection'](_0x1e08c6[_0x032b('0x33')],qs[_0x032b('0x39')](_0x4f0f67['query'][_0x032b('0x39')]));_0x31dd6b[_0x032b('0x37')]=_0x31dd6b[_0x032b('0x37')][_0x032b('0x3a')]?_0x31dd6b[_0x032b('0x37')]:_0x1e08c6[_0x032b('0x33')];_0x31dd6b[_0x032b('0x4f')]=qs[_0x032b('0x3b')](_0x4f0f67[_0x032b('0x35')]['sort']);_0x31dd6b[_0x032b('0x3c')]=qs[_0x032b('0x36')](_[_0x032b('0x3d')](_0x4f0f67[_0x032b('0x35')],_0x1e08c6[_0x032b('0x36')]));if(_0x4f0f67[_0x032b('0x35')]['filter']){_0x31dd6b[_0x032b('0x3c')]=_[_0x032b('0x3e')](_0x31dd6b[_0x032b('0x3c')],{'$or':_[_0x032b('0x50')](_0x31dd6b['attributes'],function(_0x35163d){var _0x358414={};_0x358414[_0x35163d]={'$like':'%'+_0x4f0f67[_0x032b('0x35')][_0x032b('0x42')]+'%'};return _0x358414;})});}_0x31dd6b=_[_0x032b('0x3e')]({},_0x31dd6b,_0x4f0f67[_0x032b('0x43')]);return _0xd53934['getConfigurations'](_0x31dd6b);}})[_0x032b('0x2c')](function(_0x3ad1ec){if(_0x3ad1ec){_0x2125f9=_0x3ad1ec[_0x032b('0x3a')];if(!_0x4f0f67[_0x032b('0x35')][_0x032b('0x51')](_0x032b('0x52'))){_0x31dd6b[_0x032b('0x27')]=qs[_0x032b('0x27')](_0x4f0f67[_0x032b('0x35')]['limit']);_0x31dd6b[_0x032b('0x26')]=qs['offset'](_0x4f0f67[_0x032b('0x35')]['offset']);}return _0xd53934[_0x032b('0x4c')](_0x31dd6b);}})['then'](function(_0x295c08){if(_0x295c08){return _0x295c08?{'count':_0x2125f9,'rows':_0x295c08}:null;}})['then'](respondWithResult(_0x4c5028,null))[_0x032b('0x46')](handleError(_0x4c5028,null));};exports[_0x032b('0x53')]=function(_0xc3a1af,_0x36440b,_0x41fab8){if(_0xc3a1af[_0x032b('0x49')]['id']){delete _0xc3a1af['body']['id'];}return db['VtigerAccount'][_0x032b('0x4d')]({'where':{'id':_0xc3a1af[_0x032b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x36440b,null))['then'](function(_0x2272e5){if(_0x2272e5){_0xc3a1af[_0x032b('0x49')][_0x032b('0x54')]=_0x2272e5['id'];_0xc3a1af[_0x032b('0x49')][_0x032b('0x55')]=integrations[_0x032b('0x56')](_0xc3a1af[_0x032b('0x49')]['channel'],_0xc3a1af[_0x032b('0x49')][_0x032b('0x3f')]);_0xc3a1af['body'][_0x032b('0x57')]=integrations[_0x032b('0x58')](_0xc3a1af['body'][_0x032b('0x59')],_0xc3a1af[_0x032b('0x49')][_0x032b('0x3f')]);return db['VtigerConfiguration']['create'](_0xc3a1af['body'],{'include':[{'model':db[_0x032b('0x5a')],'as':_0x032b('0x55')},{'model':db[_0x032b('0x5a')],'as':_0x032b('0x57')}]});}return null;})[_0x032b('0x2c')](respondWithResult(_0x36440b,null))[_0x032b('0x46')](handleError(_0x36440b,null));};var md5=require(_0x032b('0x5b'));exports[_0x032b('0x5c')]=function(_0x40084c,_0x1afe0c,_0x14a180){var _0x93964b=null;var _0x5c824b=null;var _0xb8ff80=null;var _0x44ca51=null;var _0x5440af='';return db['VtigerAccount'][_0x032b('0x4d')]({'where':{'id':_0x40084c[_0x032b('0x4b')]['id']},'attributes':['id',_0x032b('0x2f'),'username',_0x032b('0x5d'),_0x032b('0x5e'),_0x032b('0x5f'),'serverUrl','accessKey']})[_0x032b('0x2c')](handleEntityNotFound(_0x1afe0c,null))[_0x032b('0x2c')](function(_0x4b8e32){if(_0x4b8e32){_0x93964b=_0x4b8e32[_0x032b('0x60')];_0x5c824b=_0x4b8e32[_0x032b('0x61')];_0xb8ff80=_0x4b8e32[_0x032b('0x5e')];_0x5440af=_0x4b8e32[_0x032b('0x5f')];var _0x100dfe=_0x5440af[_0x032b('0x62')](-0x1);if(_0x100dfe==='/'){_0x5440af=_0x5440af['substring'](0x0,_0x5440af[_0x032b('0x63')](_0x100dfe));}_0x44ca51=util[_0x032b('0x64')]('%s/webservice.php',_0x5440af);var _0x3bf24a={'method':_0x032b('0x65'),'uri':_0x44ca51,'qs':{'operation':_0x032b('0x66'),'username':_0x4b8e32[_0x032b('0x60')]},'json':!![]};return rp(_0x3bf24a);}})['then'](function(_0x397f30){if(_0x397f30[_0x032b('0x67')]){var _0x5a45bb={'method':_0x032b('0x68'),'uri':_0x44ca51,'form':{'operation':_0x032b('0x69'),'username':_0x93964b,'accessKey':md5(_0x397f30[_0x032b('0x21')][_0x032b('0x6a')]+_0x5c824b)},'json':!![]};return rp(_0x5a45bb);}})[_0x032b('0x2c')](function(_0x57c3ad){if(_0x57c3ad[_0x032b('0x67')]){var _0x2064f4={'method':_0x032b('0x65'),'uri':_0x44ca51,'qs':{'operation':_0x032b('0x6b'),'username':_0x93964b,'sessionName':_0x57c3ad[_0x032b('0x21')][_0x032b('0x6c')],'elementType':_0xb8ff80},'json':!![]};return rp(_0x2064f4);}})['then'](function(_0x3b884d){if(_0x3b884d[_0x032b('0x67')]){var _0x1abfde=[_0x032b('0x6d'),_0x032b('0x6e'),_0x032b('0x6f')];_[_0x032b('0x70')](_0x3b884d[_0x032b('0x21')][_0x032b('0x39')],function(_0x2d8277){return _0x1abfde['includes'](_0x2d8277[_0x032b('0x3f')][_0x032b('0x2f')]);});_[_0x032b('0x70')](_0x3b884d[_0x032b('0x21')]['fields'],function(_0x1b5331){return _0x1b5331[_0x032b('0x71')]==='false';});return{'count':_0x3b884d[_0x032b('0x21')][_0x032b('0x39')][_0x032b('0x3a')],'rows':_[_0x032b('0x50')](_0x3b884d[_0x032b('0x21')][_0x032b('0x39')],function(_0x3e166e){return{'id':_0x3e166e[_0x032b('0x2f')],'name':_0x3e166e['label'],'custom':_[_0x032b('0x72')](_0x3e166e[_0x032b('0x2f')],_0x032b('0x73'))?!![]:![],'options':_0x3e166e[_0x032b('0x3f')][_0x032b('0x2f')]===_0x032b('0x74')&&_0x3e166e[_0x032b('0x3f')][_0x032b('0x75')][_0x032b('0x3a')]>0x0?_[_0x032b('0x50')](_0x3e166e['type'][_0x032b('0x75')],function(_0x4288a2){return{'name':_0x4288a2[_0x032b('0x76')],'value':_0x4288a2[_0x032b('0x77')]};}):[]};})};}})[_0x032b('0x2c')](respondWithResult(_0x1afe0c,null))[_0x032b('0x46')](function(_0x5aea6e){console['log']('vTiger\x20error:\x20'+_0x5aea6e);var _0x5c6d1f=_0x40084c[_0x032b('0x35')][_0x032b('0x78')]?0x1f4:_0x5aea6e['statusCode']||0x1f4;logger[_0x032b('0x1f')]('getFields,\x20%s,\x20%s,\x20%s',_0x032b('0x5c'),_0x5c6d1f,JSON[_0x032b('0x1e')](_0x5aea6e));delete _0x5aea6e[_0x032b('0x2f')];if(_0x5c6d1f===0x191){_0x5c6d1f=0x190;}_0x1afe0c[_0x032b('0x23')](_0x5c6d1f)['send'](_0x40084c['query'][_0x032b('0x78')]?{'message':_0x032b('0x79'),'statusCode':_0x5aea6e['statusCode']}:_0x5aea6e);});}; \ No newline at end of file +var _0x08a3=['../../mysqldb','test','then','info','VtigerAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','update','destroy','stack','name','VtigerAccount','rawAttributes','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','field','count','includeAll','findAll','show','params','keys','include','options','find','create','body','VtigerConfiguration','getConfigurations','addConfiguration','findOne','AccountId','getSubjects','channel','Descriptions','type','VtigerField','md5','getFields','description','remoteUri','accessKey','username','slice','lastIndexOf','%s/webservice.php','GET','success','POST','login','token','describe','autogenerated','reference','owner','remove','includes','editable','label','startsWith','picklist','picklistValues','value','vTiger\x20error:\x20','statusCode','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','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'];(function(_0x1a2a7d,_0x57f958){var _0x5d71ae=function(_0x592966){while(--_0x592966){_0x1a2a7d['push'](_0x1a2a7d['shift']());}};_0x5d71ae(++_0x57f958);}(_0x08a3,0xd9));var _0x308a=function(_0x10e716,_0x478023){_0x10e716=_0x10e716-0x0;var _0x424db8=_0x08a3[_0x10e716];return _0x424db8;};'use strict';var pdf=require(_0x308a('0x0'));var emlformat=require(_0x308a('0x1'));var rimraf=require(_0x308a('0x2'));var zipdir=require(_0x308a('0x3'));var jsonpatch=require(_0x308a('0x4'));var rp=require(_0x308a('0x5'));var moment=require(_0x308a('0x6'));var BPromise=require(_0x308a('0x7'));var Mustache=require(_0x308a('0x8'));var util=require('util');var path=require('path');var sox=require(_0x308a('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x308a('0xa'));var squel=require(_0x308a('0xb'));var crypto=require(_0x308a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x308a('0xd'));var toCsv=require(_0x308a('0xe'));var querystring=require(_0x308a('0xf'));var Papa=require(_0x308a('0x10'));var Redis=require(_0x308a('0x11'));var authService=require(_0x308a('0x12'));var qs=require(_0x308a('0x13'));var hardwareService=require(_0x308a('0x14'));var logger=require(_0x308a('0x15'))(_0x308a('0x16'));var utils=require(_0x308a('0x17'));var config=require(_0x308a('0x18'));var db=require(_0x308a('0x19'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x4c0e08,_0x434a62,_0x54676c){if(_0x54676c){var _0x17d736=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x17d736[_0x308a('0x1a')](_0x434a62)){return _0x4c0e08;}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 _0x4c0e08;}}function respondWithRpcPromise(_0x258f9d,_0xc8a49c,_0x362bd7,_0x3d0975){return new BPromise(function(_0x4d4d66,_0x188332){var _0x592864=_0x3d0975||client;return _0x592864['request'](_0x258f9d,_0x362bd7)[_0x308a('0x1b')](function(_0x1f6f47){logger[_0x308a('0x1c')](_0x308a('0x1d'),_0xc8a49c,'request\x20sent');logger[_0x308a('0x1e')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0xc8a49c,_0x308a('0x1f'),JSON[_0x308a('0x20')](_0x1f6f47));if(_0x1f6f47[_0x308a('0x21')]){if(_0x1f6f47['error'][_0x308a('0x22')]===0x1f4){logger[_0x308a('0x21')](_0x308a('0x1d'),_0xc8a49c,_0x1f6f47[_0x308a('0x21')][_0x308a('0x23')]);return _0x188332(_0x1f6f47['error']['message']);}logger[_0x308a('0x21')](_0x308a('0x1d'),_0xc8a49c,_0x1f6f47[_0x308a('0x21')]['message']);return _0x4d4d66(_0x1f6f47['error'][_0x308a('0x23')]);}else{logger['info'](_0x308a('0x1d'),_0xc8a49c,_0x308a('0x1f'));_0x4d4d66(_0x1f6f47[_0x308a('0x24')]['message']);}})[_0x308a('0x25')](function(_0x9309e4){logger[_0x308a('0x21')](_0x308a('0x1d'),_0xc8a49c,_0x9309e4);_0x188332(_0x9309e4);});});}function respondWithStatusCode(_0x161e42,_0x247fa5){_0x247fa5=_0x247fa5||0xcc;return function(_0x1010ff){if(_0x1010ff){return _0x161e42[_0x308a('0x26')](_0x247fa5);}return _0x161e42[_0x308a('0x27')](_0x247fa5)[_0x308a('0x28')]();};}function respondWithResult(_0x452c71,_0x59af78){_0x59af78=_0x59af78||0xc8;return function(_0xe7d2eb){if(_0xe7d2eb){return _0x452c71[_0x308a('0x27')](_0x59af78)[_0x308a('0x29')](_0xe7d2eb);}};}function respondWithFilteredResult(_0x482cb0,_0x33ab07){return function(_0x351a81){if(_0x351a81){var _0x32b0f8=_0x351a81['count'],_0x8e1863=_0x33ab07[_0x308a('0x2a')],_0x505b5b=_0x33ab07['offset']+_0x33ab07[_0x308a('0x2b')],_0x2b1250;if(_0x505b5b>=_0x32b0f8){_0x505b5b=_0x32b0f8;_0x2b1250=0xc8;}else{_0x2b1250=0xce;}_0x482cb0['status'](_0x2b1250);return _0x482cb0[_0x308a('0x2c')](_0x308a('0x2d'),_0x8e1863+'-'+_0x505b5b+'/'+_0x32b0f8)[_0x308a('0x29')](_0x351a81);}return null;};}function patchUpdates(_0x2184db){return function(_0x43c2d6){try{jsonpatch['apply'](_0x43c2d6,_0x2184db,!![]);}catch(_0x5b9494){return BPromise[_0x308a('0x2e')](_0x5b9494);}return _0x43c2d6[_0x308a('0x2f')]();};}function saveUpdates(_0xc661ba,_0x4bab78){return function(_0x100203){if(_0x100203){return _0x100203[_0x308a('0x30')](_0xc661ba)[_0x308a('0x1b')](function(_0x31037f){return _0x31037f;});}return null;};}function removeEntity(_0x1aa2ec,_0x11822b){return function(_0x2f1581){if(_0x2f1581){return _0x2f1581[_0x308a('0x31')]()['then'](function(){_0x1aa2ec[_0x308a('0x27')](0xcc)[_0x308a('0x28')]();});}};}function handleEntityNotFound(_0x261a2f,_0x20240d){return function(_0x372d99){if(!_0x372d99){_0x261a2f[_0x308a('0x26')](0x194);}return _0x372d99;};}function handleError(_0x2f7414,_0x37f846){_0x37f846=_0x37f846||0x1f4;return function(_0x3db5bc){logger[_0x308a('0x21')](_0x3db5bc[_0x308a('0x32')]);if(_0x3db5bc[_0x308a('0x33')]){delete _0x3db5bc[_0x308a('0x33')];}_0x2f7414['status'](_0x37f846)['send'](_0x3db5bc);};}exports['index']=function(_0x225341,_0x1dac05){var _0x2d19d3={},_0x596d12={},_0x1731dc={'count':0x0,'rows':[]};var _0x4e3682=db[_0x308a('0x34')][_0x308a('0x35')];_0x596d12['model']=_['keys'](_0x4e3682);_0x596d12[_0x308a('0x36')]=_['keys'](_0x225341['query']);_0x596d12[_0x308a('0x37')]=_[_0x308a('0x38')](_0x596d12[_0x308a('0x39')],_0x596d12['query']);_0x2d19d3['attributes']=_[_0x308a('0x38')](_0x596d12['model'],qs[_0x308a('0x3a')](_0x225341[_0x308a('0x36')][_0x308a('0x3a')]));_0x2d19d3[_0x308a('0x3b')]=_0x2d19d3['attributes'][_0x308a('0x3c')]?_0x2d19d3[_0x308a('0x3b')]:_0x596d12['model'];if(!_0x225341['query'][_0x308a('0x3d')](_0x308a('0x3e'))){_0x2d19d3[_0x308a('0x2b')]=qs[_0x308a('0x2b')](_0x225341[_0x308a('0x36')]['limit']);_0x2d19d3['offset']=qs[_0x308a('0x2a')](_0x225341[_0x308a('0x36')][_0x308a('0x2a')]);}_0x2d19d3[_0x308a('0x3f')]=qs['sort'](_0x225341[_0x308a('0x36')][_0x308a('0x40')]);_0x2d19d3[_0x308a('0x41')]=qs[_0x308a('0x37')](_[_0x308a('0x42')](_0x225341[_0x308a('0x36')],_0x596d12['filters']));if(_0x225341['query'][_0x308a('0x43')]){_0x2d19d3['where']=_[_0x308a('0x44')](_0x2d19d3[_0x308a('0x41')],{'$or':_[_0x308a('0x45')](_0x4e3682,function(_0x40101b){if(_0x40101b['type']['key']!==_0x308a('0x46')){var _0x247c76={};_0x247c76[_0x40101b[_0x308a('0x47')]]={'$like':'%'+_0x225341[_0x308a('0x36')][_0x308a('0x43')]+'%'};return _0x247c76;}})});}_0x2d19d3=_['merge']({},_0x2d19d3,_0x225341['options']);var _0x45fd26={'where':_0x2d19d3[_0x308a('0x41')]};return db[_0x308a('0x34')]['count'](_0x45fd26)['then'](function(_0x5a1032){_0x1731dc[_0x308a('0x48')]=_0x5a1032;if(_0x225341[_0x308a('0x36')][_0x308a('0x49')]){_0x2d19d3['include']=[{'all':!![]}];}return db[_0x308a('0x34')][_0x308a('0x4a')](_0x2d19d3);})[_0x308a('0x1b')](function(_0x42c617){_0x1731dc['rows']=_0x42c617;return _0x1731dc;})['then'](respondWithFilteredResult(_0x1dac05,_0x2d19d3))[_0x308a('0x25')](handleError(_0x1dac05,null));};exports[_0x308a('0x4b')]=function(_0x41a767,_0x516925){var _0x1f3e37={'raw':![],'where':{'id':_0x41a767[_0x308a('0x4c')]['id']}},_0x23cb6b={};_0x23cb6b[_0x308a('0x39')]=_[_0x308a('0x4d')](db[_0x308a('0x34')][_0x308a('0x35')]);_0x23cb6b[_0x308a('0x36')]=_[_0x308a('0x4d')](_0x41a767[_0x308a('0x36')]);_0x23cb6b[_0x308a('0x37')]=_['intersection'](_0x23cb6b[_0x308a('0x39')],_0x23cb6b[_0x308a('0x36')]);_0x1f3e37['attributes']=_['intersection'](_0x23cb6b[_0x308a('0x39')],qs[_0x308a('0x3a')](_0x41a767[_0x308a('0x36')][_0x308a('0x3a')]));_0x1f3e37[_0x308a('0x3b')]=_0x1f3e37[_0x308a('0x3b')][_0x308a('0x3c')]?_0x1f3e37['attributes']:_0x23cb6b[_0x308a('0x39')];if(_0x41a767[_0x308a('0x36')][_0x308a('0x49')]){_0x1f3e37[_0x308a('0x4e')]=[{'all':!![]}];}_0x1f3e37=_['merge']({},_0x1f3e37,_0x41a767[_0x308a('0x4f')]);return db[_0x308a('0x34')][_0x308a('0x50')](_0x1f3e37)[_0x308a('0x1b')](handleEntityNotFound(_0x516925,null))['then'](respondWithResult(_0x516925,null))[_0x308a('0x25')](handleError(_0x516925,null));};exports[_0x308a('0x51')]=function(_0x33893e,_0x47e07e){return db[_0x308a('0x34')][_0x308a('0x51')](_0x33893e[_0x308a('0x52')],{})[_0x308a('0x1b')](respondWithResult(_0x47e07e,0xc9))[_0x308a('0x25')](handleError(_0x47e07e,null));};exports[_0x308a('0x30')]=function(_0x3880cc,_0x234ab2){if(_0x3880cc[_0x308a('0x52')]['id']){delete _0x3880cc[_0x308a('0x52')]['id'];}return db[_0x308a('0x34')][_0x308a('0x50')]({'where':{'id':_0x3880cc[_0x308a('0x4c')]['id']}})[_0x308a('0x1b')](handleEntityNotFound(_0x234ab2,null))[_0x308a('0x1b')](saveUpdates(_0x3880cc[_0x308a('0x52')],null))[_0x308a('0x1b')](respondWithResult(_0x234ab2,null))[_0x308a('0x25')](handleError(_0x234ab2,null));};exports['destroy']=function(_0x2cc884,_0xd6686d){return db[_0x308a('0x34')][_0x308a('0x50')]({'where':{'id':_0x2cc884[_0x308a('0x4c')]['id']}})['then'](handleEntityNotFound(_0xd6686d,null))['then'](removeEntity(_0xd6686d,null))[_0x308a('0x25')](handleError(_0xd6686d,null));};exports['getConfigurations']=function(_0x11028c,_0x258067,_0xfb6172){var _0x2367bf={};var _0x43bbf9={};var _0x864a8f;var _0xd37141;return db['VtigerAccount']['findOne']({'where':{'id':_0x11028c['params']['id']}})[_0x308a('0x1b')](handleEntityNotFound(_0x258067,null))[_0x308a('0x1b')](function(_0x4907f9){if(_0x4907f9){_0x864a8f=_0x4907f9;_0x43bbf9[_0x308a('0x39')]=_[_0x308a('0x4d')](db[_0x308a('0x53')][_0x308a('0x35')]);_0x43bbf9['query']=_[_0x308a('0x4d')](_0x11028c[_0x308a('0x36')]);_0x43bbf9[_0x308a('0x37')]=_[_0x308a('0x38')](_0x43bbf9['model'],_0x43bbf9[_0x308a('0x36')]);_0x2367bf[_0x308a('0x3b')]=_[_0x308a('0x38')](_0x43bbf9[_0x308a('0x39')],qs[_0x308a('0x3a')](_0x11028c[_0x308a('0x36')][_0x308a('0x3a')]));_0x2367bf['attributes']=_0x2367bf[_0x308a('0x3b')]['length']?_0x2367bf[_0x308a('0x3b')]:_0x43bbf9['model'];_0x2367bf[_0x308a('0x3f')]=qs[_0x308a('0x40')](_0x11028c[_0x308a('0x36')]['sort']);_0x2367bf[_0x308a('0x41')]=qs[_0x308a('0x37')](_['pick'](_0x11028c[_0x308a('0x36')],_0x43bbf9[_0x308a('0x37')]));if(_0x11028c[_0x308a('0x36')]['filter']){_0x2367bf[_0x308a('0x41')]=_[_0x308a('0x44')](_0x2367bf[_0x308a('0x41')],{'$or':_['map'](_0x2367bf['attributes'],function(_0x5a0fc2){var _0x29f3d9={};_0x29f3d9[_0x5a0fc2]={'$like':'%'+_0x11028c[_0x308a('0x36')]['filter']+'%'};return _0x29f3d9;})});}_0x2367bf=_[_0x308a('0x44')]({},_0x2367bf,_0x11028c['options']);return _0x864a8f[_0x308a('0x54')](_0x2367bf);}})[_0x308a('0x1b')](function(_0x1cc297){if(_0x1cc297){_0xd37141=_0x1cc297[_0x308a('0x3c')];if(!_0x11028c['query']['hasOwnProperty']('nolimit')){_0x2367bf[_0x308a('0x2b')]=qs[_0x308a('0x2b')](_0x11028c[_0x308a('0x36')][_0x308a('0x2b')]);_0x2367bf['offset']=qs[_0x308a('0x2a')](_0x11028c[_0x308a('0x36')]['offset']);}return _0x864a8f[_0x308a('0x54')](_0x2367bf);}})[_0x308a('0x1b')](function(_0x40303d){if(_0x40303d){return _0x40303d?{'count':_0xd37141,'rows':_0x40303d}:null;}})['then'](respondWithResult(_0x258067,null))[_0x308a('0x25')](handleError(_0x258067,null));};exports[_0x308a('0x55')]=function(_0x14c567,_0x311671,_0x51b757){if(_0x14c567[_0x308a('0x52')]['id']){delete _0x14c567[_0x308a('0x52')]['id'];}return db[_0x308a('0x34')][_0x308a('0x56')]({'where':{'id':_0x14c567['params']['id']}})[_0x308a('0x1b')](handleEntityNotFound(_0x311671,null))[_0x308a('0x1b')](function(_0x40eed4){if(_0x40eed4){_0x14c567[_0x308a('0x52')][_0x308a('0x57')]=_0x40eed4['id'];_0x14c567[_0x308a('0x52')]['Subjects']=integrations[_0x308a('0x58')](_0x14c567[_0x308a('0x52')][_0x308a('0x59')],_0x14c567[_0x308a('0x52')]['type']);_0x14c567['body'][_0x308a('0x5a')]=integrations['getDescriptions'](_0x14c567[_0x308a('0x52')][_0x308a('0x59')],_0x14c567['body'][_0x308a('0x5b')]);return db[_0x308a('0x53')][_0x308a('0x51')](_0x14c567[_0x308a('0x52')],{'include':[{'model':db[_0x308a('0x5c')],'as':'Subjects'},{'model':db[_0x308a('0x5c')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x311671,null))[_0x308a('0x25')](handleError(_0x311671,null));};var md5=require(_0x308a('0x5d'));exports[_0x308a('0x5e')]=function(_0xceebc2,_0xcc70b2,_0x6a87d3){var _0x406243=null;var _0x3f179b=null;var _0x149293=null;var _0x1d00cb=null;var _0x3317d9='';return db['VtigerAccount'][_0x308a('0x56')]({'where':{'id':_0xceebc2[_0x308a('0x4c')]['id']},'attributes':['id','name','username',_0x308a('0x5f'),'moduleName',_0x308a('0x60'),'serverUrl',_0x308a('0x61')]})['then'](handleEntityNotFound(_0xcc70b2,null))['then'](function(_0x707ac3){if(_0x707ac3){_0x406243=_0x707ac3[_0x308a('0x62')];_0x3f179b=_0x707ac3['accessKey'];_0x149293=_0x707ac3['moduleName'];_0x3317d9=_0x707ac3[_0x308a('0x60')];var _0x37eae4=_0x3317d9[_0x308a('0x63')](-0x1);if(_0x37eae4==='/'){_0x3317d9=_0x3317d9['substring'](0x0,_0x3317d9[_0x308a('0x64')](_0x37eae4));}_0x1d00cb=util['format'](_0x308a('0x65'),_0x3317d9);var _0x462788={'method':_0x308a('0x66'),'uri':_0x1d00cb,'qs':{'operation':'getchallenge','username':_0x707ac3[_0x308a('0x62')]},'json':!![]};return rp(_0x462788);}})[_0x308a('0x1b')](function(_0x4eaa24){if(_0x4eaa24[_0x308a('0x67')]){var _0x5c6b59={'method':_0x308a('0x68'),'uri':_0x1d00cb,'form':{'operation':_0x308a('0x69'),'username':_0x406243,'accessKey':md5(_0x4eaa24[_0x308a('0x24')][_0x308a('0x6a')]+_0x3f179b)},'json':!![]};return rp(_0x5c6b59);}})[_0x308a('0x1b')](function(_0x2db1dc){if(_0x2db1dc[_0x308a('0x67')]){var _0x1fdbd7={'method':_0x308a('0x66'),'uri':_0x1d00cb,'qs':{'operation':_0x308a('0x6b'),'username':_0x406243,'sessionName':_0x2db1dc[_0x308a('0x24')]['sessionName'],'elementType':_0x149293},'json':!![]};return rp(_0x1fdbd7);}})[_0x308a('0x1b')](function(_0x4d9897){if(_0x4d9897[_0x308a('0x67')]){var _0x4a181b=[_0x308a('0x6c'),_0x308a('0x6d'),_0x308a('0x6e')];_[_0x308a('0x6f')](_0x4d9897[_0x308a('0x24')][_0x308a('0x3a')],function(_0x575742){return _0x4a181b[_0x308a('0x70')](_0x575742[_0x308a('0x5b')][_0x308a('0x33')]);});_[_0x308a('0x6f')](_0x4d9897['result'][_0x308a('0x3a')],function(_0x499254){return _0x499254[_0x308a('0x71')]==='false';});return{'count':_0x4d9897[_0x308a('0x24')][_0x308a('0x3a')][_0x308a('0x3c')],'rows':_[_0x308a('0x45')](_0x4d9897[_0x308a('0x24')]['fields'],function(_0x3fd217){return{'id':_0x3fd217[_0x308a('0x33')],'name':_0x3fd217[_0x308a('0x72')],'custom':_[_0x308a('0x73')](_0x3fd217[_0x308a('0x33')],'cf_')?!![]:![],'options':_0x3fd217[_0x308a('0x5b')]['name']===_0x308a('0x74')&&_0x3fd217[_0x308a('0x5b')][_0x308a('0x75')][_0x308a('0x3c')]>0x0?_[_0x308a('0x45')](_0x3fd217[_0x308a('0x5b')][_0x308a('0x75')],function(_0x165250){return{'name':_0x165250[_0x308a('0x72')],'value':_0x165250[_0x308a('0x76')]};}):[]};})};}})[_0x308a('0x1b')](respondWithResult(_0xcc70b2,null))[_0x308a('0x25')](function(_0x5cbba0){console['log'](_0x308a('0x77')+_0x5cbba0);var _0x3c4231=_0xceebc2[_0x308a('0x36')]['test']?0x1f4:_0x5cbba0[_0x308a('0x78')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x3c4231,JSON[_0x308a('0x20')](_0x5cbba0));delete _0x5cbba0[_0x308a('0x33')];if(_0x3c4231===0x191){_0x3c4231=0x190;}_0xcc70b2[_0x308a('0x27')](_0x3c4231)['send'](_0xceebc2[_0x308a('0x36')][_0x308a('0x1a')]?{'message':'Wrong\x20credentials','statusCode':_0x5cbba0[_0x308a('0x78')]}:_0x5cbba0);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index b0f6a3f..4e0299c 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 _0xf970=['moment','bluebird','request-promise','path','rimraf','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','../../config/logger','api'];(function(_0x580269,_0x1f7a1b){var _0x8c680c=function(_0x5d34d8){while(--_0x5d34d8){_0x580269['push'](_0x580269['shift']());}};_0x8c680c(++_0x1f7a1b);}(_0xf970,0x1d9));var _0x0f97=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf970[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x0f97('0x0'));var util=require('util');var logger=require(_0x0f97('0x1'))(_0x0f97('0x2'));var moment=require(_0x0f97('0x3'));var BPromise=require(_0x0f97('0x4'));var rp=require(_0x0f97('0x5'));var fs=require('fs');var path=require(_0x0f97('0x6'));var rimraf=require(_0x0f97('0x7'));var config=require('../../config/environment');var attributes=require(_0x0f97('0x8'));var integrations=require(_0x0f97('0x9'));module[_0x0f97('0xa')]=function(_0xac501,_0x2e3515){return _0xac501[_0x0f97('0xb')](_0x0f97('0xc'),attributes,{'tableName':_0x0f97('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x676c=['../../config/environment','../../components/integrations/configuration','exports','define','int_vtiger_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x44fd4c,_0x101855){var _0x3ffc14=function(_0xffc8c9){while(--_0xffc8c9){_0x44fd4c['push'](_0x44fd4c['shift']());}};_0x3ffc14(++_0x101855);}(_0x676c,0x198));var _0xc676=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x676c[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xc676('0x0'));var util=require(_0xc676('0x1'));var logger=require(_0xc676('0x2'))('api');var moment=require(_0xc676('0x3'));var BPromise=require(_0xc676('0x4'));var rp=require(_0xc676('0x5'));var fs=require('fs');var path=require(_0xc676('0x6'));var rimraf=require(_0xc676('0x7'));var config=require(_0xc676('0x8'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0xc676('0x9'));module[_0xc676('0xa')]=function(_0x13c5a7,_0x2c7510){return _0x13c5a7[_0xc676('0xb')]('VtigerAccount',attributes,{'tableName':_0xc676('0xc'),'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 7c022d1..39836e1 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 _0x8a14=['model','then','catch','find','ShowVtigerAccount','lodash','util','moment','bluebird','randomstring','../../config/logger','jayson/promise','http','request','info','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','limit','include','map','attributes'];(function(_0x354bb9,_0x3b9717){var _0x50b5e9=function(_0x207879){while(--_0x207879){_0x354bb9['push'](_0x354bb9['shift']());}};_0x50b5e9(++_0x3b9717);}(_0x8a14,0x68));var _0x48a1=function(_0x584679,_0x2ed484){_0x584679=_0x584679-0x0;var _0xfa386e=_0x8a14[_0x584679];return _0xfa386e;};'use strict';var _=require(_0x48a1('0x0'));var util=require(_0x48a1('0x1'));var moment=require(_0x48a1('0x2'));var BPromise=require(_0x48a1('0x3'));var rs=require(_0x48a1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x48a1('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x48a1('0x6'));var client=jayson['client'][_0x48a1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2f58aa,_0x512123,_0x57d4cf){return new BPromise(function(_0x389af8,_0x2dc432){return client[_0x48a1('0x8')](_0x2f58aa,_0x57d4cf)['then'](function(_0x484035){logger[_0x48a1('0x9')](_0x48a1('0xa'),_0x512123,'request\x20sent');logger[_0x48a1('0xb')](_0x48a1('0xc'),_0x512123,_0x48a1('0xd'),JSON[_0x48a1('0xe')](_0x484035));if(_0x484035['error']){if(_0x484035[_0x48a1('0xf')][_0x48a1('0x10')]===0x1f4){logger[_0x48a1('0xf')](_0x48a1('0xa'),_0x512123,_0x484035['error'][_0x48a1('0x11')]);return _0x2dc432(_0x484035[_0x48a1('0xf')]['message']);}logger[_0x48a1('0xf')](_0x48a1('0xa'),_0x512123,_0x484035[_0x48a1('0xf')][_0x48a1('0x11')]);return _0x389af8(_0x484035[_0x48a1('0xf')][_0x48a1('0x11')]);}else{logger[_0x48a1('0x9')](_0x48a1('0xa'),_0x512123,_0x48a1('0xd'));_0x389af8(_0x484035['result'][_0x48a1('0x11')]);}})['catch'](function(_0x482678){logger[_0x48a1('0xf')](_0x48a1('0xa'),_0x512123,_0x482678);_0x2dc432(_0x482678);});});}exports[_0x48a1('0x12')]=function(_0x92847b){var _0x46aa1a=this;return new Promise(function(_0x3b7077,_0x13db63){return db[_0x48a1('0x13')][_0x48a1('0x14')]({'raw':_0x92847b[_0x48a1('0x15')]?_0x92847b[_0x48a1('0x15')][_0x48a1('0x16')]===undefined?!![]:![]:!![],'where':_0x92847b[_0x48a1('0x15')]?_0x92847b[_0x48a1('0x15')][_0x48a1('0x17')]||null:null,'attributes':_0x92847b[_0x48a1('0x15')]?_0x92847b[_0x48a1('0x15')]['attributes']||null:null,'limit':_0x92847b[_0x48a1('0x15')]?_0x92847b[_0x48a1('0x15')][_0x48a1('0x18')]||null:null,'include':_0x92847b[_0x48a1('0x15')]?_0x92847b['options'][_0x48a1('0x19')]?_[_0x48a1('0x1a')](_0x92847b[_0x48a1('0x15')][_0x48a1('0x19')],function(_0xa6fd89){return{'model':db[_0xa6fd89['model']],'as':_0xa6fd89['as'],'attributes':_0xa6fd89[_0x48a1('0x1b')],'include':_0xa6fd89[_0x48a1('0x19')]?_[_0x48a1('0x1a')](_0xa6fd89[_0x48a1('0x19')],function(_0x3edda3){return{'model':db[_0x3edda3[_0x48a1('0x1c')]],'as':_0x3edda3['as'],'attributes':_0x3edda3['attributes'],'include':_0x3edda3[_0x48a1('0x19')]?_['map'](_0x3edda3[_0x48a1('0x19')],function(_0x226284){return{'model':db[_0x226284[_0x48a1('0x1c')]],'as':_0x226284['as'],'attributes':_0x226284[_0x48a1('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x48a1('0x1d')](function(_0xcdc892){logger['info'](_0x48a1('0x12'),_0x92847b);logger[_0x48a1('0xb')]('GetVtigerAccount',_0x92847b,JSON[_0x48a1('0xe')](_0xcdc892));_0x3b7077(_0xcdc892);})[_0x48a1('0x1e')](function(_0x21a414){logger[_0x48a1('0xf')](_0x48a1('0x12'),_0x21a414[_0x48a1('0x11')],_0x92847b);_0x13db63(_0x46aa1a[_0x48a1('0xf')](0x1f4,_0x21a414[_0x48a1('0x11')]));});});};exports['ShowVtigerAccount']=function(_0x51a7d1){var _0x528f73=this;return new Promise(function(_0x278b2c,_0x1fb9ea){return db[_0x48a1('0x13')][_0x48a1('0x1f')]({'raw':_0x51a7d1[_0x48a1('0x15')]?_0x51a7d1[_0x48a1('0x15')][_0x48a1('0x16')]===undefined?!![]:![]:!![],'where':_0x51a7d1[_0x48a1('0x15')]?_0x51a7d1['options'][_0x48a1('0x17')]||null:null,'attributes':_0x51a7d1[_0x48a1('0x15')]?_0x51a7d1[_0x48a1('0x15')]['attributes']||null:null,'include':_0x51a7d1[_0x48a1('0x15')]?_0x51a7d1[_0x48a1('0x15')][_0x48a1('0x19')]?_[_0x48a1('0x1a')](_0x51a7d1[_0x48a1('0x15')]['include'],function(_0x272ceb){return{'model':db[_0x272ceb['model']],'as':_0x272ceb['as'],'attributes':_0x272ceb[_0x48a1('0x1b')],'include':_0x272ceb[_0x48a1('0x19')]?_[_0x48a1('0x1a')](_0x272ceb['include'],function(_0x48f8ab){return{'model':db[_0x48f8ab['model']],'as':_0x48f8ab['as'],'attributes':_0x48f8ab['attributes'],'include':_0x48f8ab['include']?_[_0x48a1('0x1a')](_0x48f8ab[_0x48a1('0x19')],function(_0x129785){return{'model':db[_0x129785[_0x48a1('0x1c')]],'as':_0x129785['as'],'attributes':_0x129785[_0x48a1('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x48a1('0x1d')](function(_0x34bbe5){logger['info']('ShowVtigerAccount',_0x51a7d1);logger['debug'](_0x48a1('0x20'),_0x51a7d1,JSON['stringify'](_0x34bbe5));_0x278b2c(_0x34bbe5);})[_0x48a1('0x1e')](function(_0x1bf14b){logger[_0x48a1('0xf')]('ShowVtigerAccount',_0x1bf14b[_0x48a1('0x11')],_0x51a7d1);_0x1fb9ea(_0x528f73['error'](0x1f4,_0x1bf14b[_0x48a1('0x11')]));});});}; \ No newline at end of file +var _0xd0fc=['jayson/promise','client','http','request','then','info','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','VtigerAccount,\x20%s,\x20%s','catch','GetVtigerAccount','findAll','options','raw','where','attributes','limit','include','model','ShowVtigerAccount','VtigerAccount','find','map','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x51ac9d,_0xc969c5){var _0x8f3f85=function(_0x3508c9){while(--_0x3508c9){_0x51ac9d['push'](_0x51ac9d['shift']());}};_0x8f3f85(++_0xc969c5);}(_0xd0fc,0x118));var _0xcd0f=function(_0x57b638,_0x3c4af9){_0x57b638=_0x57b638-0x0;var _0x54ce5d=_0xd0fc[_0x57b638];return _0x54ce5d;};'use strict';var _=require('lodash');var util=require(_0xcd0f('0x0'));var moment=require(_0xcd0f('0x1'));var BPromise=require(_0xcd0f('0x2'));var rs=require(_0xcd0f('0x3'));var fs=require('fs');var Redis=require(_0xcd0f('0x4'));var db=require(_0xcd0f('0x5'))['db'];var utils=require(_0xcd0f('0x6'));var logger=require(_0xcd0f('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xcd0f('0x8'));var client=jayson[_0xcd0f('0x9')][_0xcd0f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7a5b6f,_0x9303cf,_0x184a48){return new BPromise(function(_0x123f5f,_0x4c890f){return client[_0xcd0f('0xb')](_0x7a5b6f,_0x184a48)[_0xcd0f('0xc')](function(_0x5dc231){logger[_0xcd0f('0xd')]('VtigerAccount,\x20%s,\x20%s',_0x9303cf,'request\x20sent');logger[_0xcd0f('0xe')](_0xcd0f('0xf'),_0x9303cf,_0xcd0f('0x10'),JSON[_0xcd0f('0x11')](_0x5dc231));if(_0x5dc231[_0xcd0f('0x12')]){if(_0x5dc231[_0xcd0f('0x12')][_0xcd0f('0x13')]===0x1f4){logger[_0xcd0f('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x9303cf,_0x5dc231[_0xcd0f('0x12')][_0xcd0f('0x14')]);return _0x4c890f(_0x5dc231[_0xcd0f('0x12')][_0xcd0f('0x14')]);}logger[_0xcd0f('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x9303cf,_0x5dc231[_0xcd0f('0x12')][_0xcd0f('0x14')]);return _0x123f5f(_0x5dc231[_0xcd0f('0x12')][_0xcd0f('0x14')]);}else{logger['info'](_0xcd0f('0x15'),_0x9303cf,_0xcd0f('0x10'));_0x123f5f(_0x5dc231['result']['message']);}})[_0xcd0f('0x16')](function(_0x3c0fef){logger[_0xcd0f('0x12')](_0xcd0f('0x15'),_0x9303cf,_0x3c0fef);_0x4c890f(_0x3c0fef);});});}exports[_0xcd0f('0x17')]=function(_0x231253){var _0x4c304d=this;return new Promise(function(_0x480a85,_0x270b4f){return db['VtigerAccount'][_0xcd0f('0x18')]({'raw':_0x231253[_0xcd0f('0x19')]?_0x231253['options'][_0xcd0f('0x1a')]===undefined?!![]:![]:!![],'where':_0x231253['options']?_0x231253[_0xcd0f('0x19')][_0xcd0f('0x1b')]||null:null,'attributes':_0x231253[_0xcd0f('0x19')]?_0x231253[_0xcd0f('0x19')][_0xcd0f('0x1c')]||null:null,'limit':_0x231253[_0xcd0f('0x19')]?_0x231253[_0xcd0f('0x19')][_0xcd0f('0x1d')]||null:null,'include':_0x231253[_0xcd0f('0x19')]?_0x231253[_0xcd0f('0x19')]['include']?_['map'](_0x231253[_0xcd0f('0x19')][_0xcd0f('0x1e')],function(_0x42205b){return{'model':db[_0x42205b[_0xcd0f('0x1f')]],'as':_0x42205b['as'],'attributes':_0x42205b[_0xcd0f('0x1c')],'include':_0x42205b[_0xcd0f('0x1e')]?_['map'](_0x42205b[_0xcd0f('0x1e')],function(_0x3a3039){return{'model':db[_0x3a3039[_0xcd0f('0x1f')]],'as':_0x3a3039['as'],'attributes':_0x3a3039[_0xcd0f('0x1c')],'include':_0x3a3039['include']?_['map'](_0x3a3039[_0xcd0f('0x1e')],function(_0x2eb8ff){return{'model':db[_0x2eb8ff[_0xcd0f('0x1f')]],'as':_0x2eb8ff['as'],'attributes':_0x2eb8ff[_0xcd0f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xcd0f('0xc')](function(_0x4e8186){logger['info']('GetVtigerAccount',_0x231253);logger['debug']('GetVtigerAccount',_0x231253,JSON[_0xcd0f('0x11')](_0x4e8186));_0x480a85(_0x4e8186);})[_0xcd0f('0x16')](function(_0x2d21d4){logger['error'](_0xcd0f('0x17'),_0x2d21d4[_0xcd0f('0x14')],_0x231253);_0x270b4f(_0x4c304d[_0xcd0f('0x12')](0x1f4,_0x2d21d4[_0xcd0f('0x14')]));});});};exports[_0xcd0f('0x20')]=function(_0x584f81){var _0x53faab=this;return new Promise(function(_0x411e1f,_0x26cd41){return db[_0xcd0f('0x21')][_0xcd0f('0x22')]({'raw':_0x584f81[_0xcd0f('0x19')]?_0x584f81[_0xcd0f('0x19')][_0xcd0f('0x1a')]===undefined?!![]:![]:!![],'where':_0x584f81[_0xcd0f('0x19')]?_0x584f81[_0xcd0f('0x19')]['where']||null:null,'attributes':_0x584f81['options']?_0x584f81['options']['attributes']||null:null,'include':_0x584f81[_0xcd0f('0x19')]?_0x584f81[_0xcd0f('0x19')]['include']?_[_0xcd0f('0x23')](_0x584f81[_0xcd0f('0x19')][_0xcd0f('0x1e')],function(_0x4bd613){return{'model':db[_0x4bd613[_0xcd0f('0x1f')]],'as':_0x4bd613['as'],'attributes':_0x4bd613[_0xcd0f('0x1c')],'include':_0x4bd613[_0xcd0f('0x1e')]?_['map'](_0x4bd613[_0xcd0f('0x1e')],function(_0x2cb3a8){return{'model':db[_0x2cb3a8[_0xcd0f('0x1f')]],'as':_0x2cb3a8['as'],'attributes':_0x2cb3a8[_0xcd0f('0x1c')],'include':_0x2cb3a8[_0xcd0f('0x1e')]?_[_0xcd0f('0x23')](_0x2cb3a8[_0xcd0f('0x1e')],function(_0x34808b){return{'model':db[_0x34808b[_0xcd0f('0x1f')]],'as':_0x34808b['as'],'attributes':_0x34808b[_0xcd0f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xcd0f('0xc')](function(_0x380bd0){logger[_0xcd0f('0xd')]('ShowVtigerAccount',_0x584f81);logger[_0xcd0f('0xe')]('ShowVtigerAccount',_0x584f81,JSON[_0xcd0f('0x11')](_0x380bd0));_0x411e1f(_0x380bd0);})[_0xcd0f('0x16')](function(_0x24fdc2){logger[_0xcd0f('0x12')](_0xcd0f('0x20'),_0x24fdc2[_0xcd0f('0x14')],_0x584f81);_0x26cd41(_0x53faab[_0xcd0f('0x12')](0x1f4,_0x24fdc2[_0xcd0f('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 65da48f..ca73f18 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 _0xbaf0=['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','post','update','delete','exports','util'];(function(_0x4b174a,_0x33a017){var _0x3cd7bf=function(_0x44ccd9){while(--_0x44ccd9){_0x4b174a['push'](_0x4b174a['shift']());}};_0x3cd7bf(++_0x33a017);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xbaf0[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var auth=require(_0x0baf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0baf('0x6'));var controller=require(_0x0baf('0x7'));router[_0x0baf('0x8')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0xa')]);router[_0x0baf('0x8')](_0x0baf('0xb'),auth[_0x0baf('0x9')](),controller[_0x0baf('0xc')]);router['get'](_0x0baf('0xd'),auth['isAuthenticated'](),controller[_0x0baf('0xe')]);router[_0x0baf('0x8')](_0x0baf('0xf'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x10')]);router[_0x0baf('0x8')](_0x0baf('0x11'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')]('/',auth[_0x0baf('0x9')](),controller['create']);router['put'](_0x0baf('0xb'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x14')]);router[_0x0baf('0x15')]('/:id',auth[_0x0baf('0x9')](),controller['destroy']);module[_0x0baf('0x16')]=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(_0x43608e,_0x14e34c){var _0x1741a3=function(_0x19fdd8){while(--_0x19fdd8){_0x43608e['push'](_0x43608e['shift']());}};_0x1741a3(++_0x14e34c);}(_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 a895c52..e2861e9 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 _0x9a41=['exports','STRING','sequelize'];(function(_0x1759fe,_0x132017){var _0x58c01c=function(_0x263c30){while(--_0x263c30){_0x1759fe['push'](_0x1759fe['shift']());}};_0x58c01c(++_0x132017);}(_0x9a41,0x1e2));var _0x19a4=function(_0x52ec07,_0x2dc036){_0x52ec07=_0x52ec07-0x0;var _0x54d217=_0x9a41[_0x52ec07];return _0x54d217;};'use strict';var Sequelize=require(_0x19a4('0x0'));module[_0x19a4('0x1')]={'name':{'type':Sequelize[_0x19a4('0x2')]},'description':{'type':Sequelize[_0x19a4('0x2')]}}; \ No newline at end of file +var _0x1700=['STRING'];(function(_0xbc5a4f,_0x3dda0d){var _0x3ee9fc=function(_0x3078e3){while(--_0x3078e3){_0xbc5a4f['push'](_0xbc5a4f['shift']());}};_0x3ee9fc(++_0x3dda0d);}(_0x1700,0x1e6));var _0x0170=function(_0x10dbc0,_0x56f358){_0x10dbc0=_0x10dbc0-0x0;var _0x5e5cda=_0x1700[_0x10dbc0];return _0x5e5cda;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0170('0x0')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 13dc8e5..697b194 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 _0xd2ea=['VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','VtigerConfiguration','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','rawAttributes','create','body','find','getFields','VtigerField','getSubjects','findOne','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','jayson/promise','client','http','request','then','info'];(function(_0x97a55d,_0x5545bf){var _0x1a59a1=function(_0x30393c){while(--_0x30393c){_0x97a55d['push'](_0x97a55d['shift']());}};_0x1a59a1(++_0x5545bf);}(_0xd2ea,0x15f));var _0xad2e=function(_0x5e3ac9,_0x4aa831){_0x5e3ac9=_0x5e3ac9-0x0;var _0x2d90bd=_0xd2ea[_0x5e3ac9];return _0x2d90bd;};'use strict';var pdf=require(_0xad2e('0x0'));var emlformat=require(_0xad2e('0x1'));var rimraf=require(_0xad2e('0x2'));var zipdir=require(_0xad2e('0x3'));var jsonpatch=require(_0xad2e('0x4'));var rp=require('request-promise');var moment=require(_0xad2e('0x5'));var BPromise=require(_0xad2e('0x6'));var Mustache=require(_0xad2e('0x7'));var util=require(_0xad2e('0x8'));var path=require(_0xad2e('0x9'));var sox=require(_0xad2e('0xa'));var csv=require(_0xad2e('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xad2e('0xc'));var squel=require(_0xad2e('0xd'));var crypto=require(_0xad2e('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xad2e('0xf'));var toCsv=require(_0xad2e('0xb'));var querystring=require('querystring');var Papa=require(_0xad2e('0x10'));var Redis=require('ioredis');var authService=require(_0xad2e('0x11'));var qs=require(_0xad2e('0x12'));var hardwareService=require(_0xad2e('0x13'));var logger=require(_0xad2e('0x14'))('api');var utils=require(_0xad2e('0x15'));var config=require('../../config/environment');var db=require(_0xad2e('0x16'))['db'];var jayson=require(_0xad2e('0x17'));var client=jayson[_0xad2e('0x18')][_0xad2e('0x19')]({'port':0x232a});function checkPasswordPattern(_0x59a342,_0x27fb5a,_0x59201f){if(_0x59201f){var _0x1a91ce=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1a91ce['test'](_0x27fb5a)){return _0x59a342;}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 _0x59a342;}}function respondWithRpcPromise(_0x4a812b,_0x5c96a7,_0xae17ab,_0x282780){return new BPromise(function(_0x1646d5,_0x2b6945){var _0x17e6ac=_0x282780||client;return _0x17e6ac[_0xad2e('0x1a')](_0x4a812b,_0xae17ab)[_0xad2e('0x1b')](function(_0x5941c5){logger[_0xad2e('0x1c')](_0xad2e('0x1d'),_0x5c96a7,_0xad2e('0x1e'));logger[_0xad2e('0x1f')](_0xad2e('0x20'),_0x5c96a7,_0xad2e('0x1e'),JSON[_0xad2e('0x21')](_0x5941c5));if(_0x5941c5['error']){if(_0x5941c5[_0xad2e('0x22')][_0xad2e('0x23')]===0x1f4){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x5c96a7,_0x5941c5['error']['message']);return _0x2b6945(_0x5941c5[_0xad2e('0x22')][_0xad2e('0x24')]);}logger[_0xad2e('0x22')](_0xad2e('0x1d'),_0x5c96a7,_0x5941c5[_0xad2e('0x22')][_0xad2e('0x24')]);return _0x1646d5(_0x5941c5[_0xad2e('0x22')][_0xad2e('0x24')]);}else{logger[_0xad2e('0x1c')](_0xad2e('0x1d'),_0x5c96a7,_0xad2e('0x1e'));_0x1646d5(_0x5941c5[_0xad2e('0x25')][_0xad2e('0x24')]);}})[_0xad2e('0x26')](function(_0x207517){logger[_0xad2e('0x22')]('VtigerConfiguration,\x20%s,\x20%s',_0x5c96a7,_0x207517);_0x2b6945(_0x207517);});});}function respondWithStatusCode(_0x2e727c,_0x2e8887){_0x2e8887=_0x2e8887||0xcc;return function(_0x22e237){if(_0x22e237){return _0x2e727c[_0xad2e('0x27')](_0x2e8887);}return _0x2e727c[_0xad2e('0x28')](_0x2e8887)[_0xad2e('0x29')]();};}function respondWithResult(_0x1161d5,_0x175055){_0x175055=_0x175055||0xc8;return function(_0xfd90a4){if(_0xfd90a4){return _0x1161d5['status'](_0x175055)[_0xad2e('0x2a')](_0xfd90a4);}};}function respondWithFilteredResult(_0x5d675f,_0x2b2bc2){return function(_0x28ef72){if(_0x28ef72){var _0x22bc9b=_0x28ef72[_0xad2e('0x2b')],_0x11bfa9=_0x2b2bc2[_0xad2e('0x2c')],_0x5aec9d=_0x2b2bc2[_0xad2e('0x2c')]+_0x2b2bc2[_0xad2e('0x2d')],_0x1676e5;if(_0x5aec9d>=_0x22bc9b){_0x5aec9d=_0x22bc9b;_0x1676e5=0xc8;}else{_0x1676e5=0xce;}_0x5d675f['status'](_0x1676e5);return _0x5d675f[_0xad2e('0x2e')](_0xad2e('0x2f'),_0x11bfa9+'-'+_0x5aec9d+'/'+_0x22bc9b)[_0xad2e('0x2a')](_0x28ef72);}return null;};}function patchUpdates(_0x4379f4){return function(_0x42fe6c){try{jsonpatch[_0xad2e('0x30')](_0x42fe6c,_0x4379f4,!![]);}catch(_0x409f58){return BPromise[_0xad2e('0x31')](_0x409f58);}return _0x42fe6c[_0xad2e('0x32')]();};}function saveUpdates(_0x32b9df,_0xcc4c66){return function(_0x56330e){if(_0x56330e){return _0x56330e[_0xad2e('0x33')](_0x32b9df)['then'](function(_0x24fb3e){return _0x24fb3e;});}return null;};}function removeEntity(_0x3a6419,_0x5ac436){return function(_0x19d0fa){if(_0x19d0fa){return _0x19d0fa[_0xad2e('0x34')]()['then'](function(){_0x3a6419[_0xad2e('0x28')](0xcc)[_0xad2e('0x29')]();});}};}function handleEntityNotFound(_0x54b4d3,_0x2d6b35){return function(_0x100b35){if(!_0x100b35){_0x54b4d3['sendStatus'](0x194);}return _0x100b35;};}function handleError(_0x38e7e2,_0x19fd12){_0x19fd12=_0x19fd12||0x1f4;return function(_0x3efac5){logger[_0xad2e('0x22')](_0x3efac5[_0xad2e('0x35')]);if(_0x3efac5[_0xad2e('0x36')]){delete _0x3efac5[_0xad2e('0x36')];}_0x38e7e2['status'](_0x19fd12)[_0xad2e('0x37')](_0x3efac5);};}exports[_0xad2e('0x38')]=function(_0x49db79,_0x161402){var _0x3fe26d={},_0x3f7856={},_0x14d8d6={'count':0x0,'rows':[]};var _0x48c77b=db[_0xad2e('0x39')]['rawAttributes'];_0x3f7856['model']=_[_0xad2e('0x3a')](_0x48c77b);_0x3f7856['query']=_[_0xad2e('0x3a')](_0x49db79[_0xad2e('0x3b')]);_0x3f7856[_0xad2e('0x3c')]=_[_0xad2e('0x3d')](_0x3f7856[_0xad2e('0x3e')],_0x3f7856['query']);_0x3fe26d[_0xad2e('0x3f')]=_[_0xad2e('0x3d')](_0x3f7856['model'],qs['fields'](_0x49db79['query'][_0xad2e('0x40')]));_0x3fe26d['attributes']=_0x3fe26d['attributes'][_0xad2e('0x41')]?_0x3fe26d[_0xad2e('0x3f')]:_0x3f7856[_0xad2e('0x3e')];if(!_0x49db79[_0xad2e('0x3b')][_0xad2e('0x42')](_0xad2e('0x43'))){_0x3fe26d[_0xad2e('0x2d')]=qs['limit'](_0x49db79[_0xad2e('0x3b')][_0xad2e('0x2d')]);_0x3fe26d[_0xad2e('0x2c')]=qs[_0xad2e('0x2c')](_0x49db79[_0xad2e('0x3b')]['offset']);}_0x3fe26d[_0xad2e('0x44')]=qs['sort'](_0x49db79[_0xad2e('0x3b')][_0xad2e('0x45')]);_0x3fe26d[_0xad2e('0x46')]=qs[_0xad2e('0x3c')](_[_0xad2e('0x47')](_0x49db79[_0xad2e('0x3b')],_0x3f7856[_0xad2e('0x3c')]));if(_0x49db79[_0xad2e('0x3b')][_0xad2e('0x48')]){_0x3fe26d[_0xad2e('0x46')]=_[_0xad2e('0x49')](_0x3fe26d[_0xad2e('0x46')],{'$or':_[_0xad2e('0x4a')](_0x48c77b,function(_0x1b78f9){if(_0x1b78f9[_0xad2e('0x4b')][_0xad2e('0x4c')]!==_0xad2e('0x4d')){var _0x932deb={};_0x932deb[_0x1b78f9[_0xad2e('0x4e')]]={'$like':'%'+_0x49db79[_0xad2e('0x3b')]['filter']+'%'};return _0x932deb;}})});}_0x3fe26d=_[_0xad2e('0x49')]({},_0x3fe26d,_0x49db79[_0xad2e('0x4f')]);var _0x324103={'where':_0x3fe26d[_0xad2e('0x46')]};return db[_0xad2e('0x39')][_0xad2e('0x2b')](_0x324103)[_0xad2e('0x1b')](function(_0x4c99ec){_0x14d8d6[_0xad2e('0x2b')]=_0x4c99ec;if(_0x49db79['query'][_0xad2e('0x50')]){_0x3fe26d[_0xad2e('0x51')]=[{'all':!![]}];}return db[_0xad2e('0x39')][_0xad2e('0x52')](_0x3fe26d);})[_0xad2e('0x1b')](function(_0x594886){_0x14d8d6[_0xad2e('0x53')]=_0x594886;return _0x14d8d6;})[_0xad2e('0x1b')](respondWithFilteredResult(_0x161402,_0x3fe26d))[_0xad2e('0x26')](handleError(_0x161402,null));};exports[_0xad2e('0x54')]=function(_0x3236f1,_0x4abb4d){var _0x18ef1e={'raw':![],'where':{'id':_0x3236f1[_0xad2e('0x55')]['id']}},_0x120069={};_0x120069[_0xad2e('0x3e')]=_['keys'](db['VtigerConfiguration'][_0xad2e('0x56')]);_0x120069[_0xad2e('0x3b')]=_['keys'](_0x3236f1['query']);_0x120069[_0xad2e('0x3c')]=_['intersection'](_0x120069[_0xad2e('0x3e')],_0x120069[_0xad2e('0x3b')]);_0x18ef1e['attributes']=_[_0xad2e('0x3d')](_0x120069[_0xad2e('0x3e')],qs[_0xad2e('0x40')](_0x3236f1[_0xad2e('0x3b')]['fields']));_0x18ef1e['attributes']=_0x18ef1e[_0xad2e('0x3f')][_0xad2e('0x41')]?_0x18ef1e[_0xad2e('0x3f')]:_0x120069[_0xad2e('0x3e')];if(_0x3236f1[_0xad2e('0x3b')][_0xad2e('0x50')]){_0x18ef1e[_0xad2e('0x51')]=[{'all':!![]}];}_0x18ef1e=_[_0xad2e('0x49')]({},_0x18ef1e,_0x3236f1['options']);return db[_0xad2e('0x39')]['find'](_0x18ef1e)[_0xad2e('0x1b')](handleEntityNotFound(_0x4abb4d,null))[_0xad2e('0x1b')](respondWithResult(_0x4abb4d,null))[_0xad2e('0x26')](handleError(_0x4abb4d,null));};exports[_0xad2e('0x57')]=function(_0x450448,_0x38406d){return db[_0xad2e('0x39')]['create'](_0x450448[_0xad2e('0x58')],{})['then'](respondWithResult(_0x38406d,0xc9))[_0xad2e('0x26')](handleError(_0x38406d,null));};exports[_0xad2e('0x33')]=function(_0xbc21e4,_0xf72966){if(_0xbc21e4['body']['id']){delete _0xbc21e4[_0xad2e('0x58')]['id'];}return db[_0xad2e('0x39')]['find']({'where':{'id':_0xbc21e4[_0xad2e('0x55')]['id']}})['then'](handleEntityNotFound(_0xf72966,null))[_0xad2e('0x1b')](saveUpdates(_0xbc21e4[_0xad2e('0x58')],null))[_0xad2e('0x1b')](respondWithResult(_0xf72966,null))[_0xad2e('0x26')](handleError(_0xf72966,null));};exports[_0xad2e('0x34')]=function(_0x261ad8,_0x26fbd5){return db[_0xad2e('0x39')][_0xad2e('0x59')]({'where':{'id':_0x261ad8['params']['id']}})[_0xad2e('0x1b')](handleEntityNotFound(_0x26fbd5,null))[_0xad2e('0x1b')](removeEntity(_0x26fbd5,null))[_0xad2e('0x26')](handleError(_0x26fbd5,null));};exports[_0xad2e('0x5a')]=function(_0x519971,_0x5c7318,_0x3c894f){var _0xae65b6={};var _0xb03176={};var _0xd3b75e;var _0x450803;return db[_0xad2e('0x39')]['findOne']({'where':{'id':_0x519971[_0xad2e('0x55')]['id']}})[_0xad2e('0x1b')](handleEntityNotFound(_0x5c7318,null))['then'](function(_0x45f3e7){if(_0x45f3e7){_0xd3b75e=_0x45f3e7;_0xb03176[_0xad2e('0x3e')]=_[_0xad2e('0x3a')](db[_0xad2e('0x5b')][_0xad2e('0x56')]);_0xb03176[_0xad2e('0x3b')]=_[_0xad2e('0x3a')](_0x519971[_0xad2e('0x3b')]);_0xb03176[_0xad2e('0x3c')]=_[_0xad2e('0x3d')](_0xb03176['model'],_0xb03176['query']);_0xae65b6[_0xad2e('0x3f')]=_['intersection'](_0xb03176['model'],qs[_0xad2e('0x40')](_0x519971[_0xad2e('0x3b')][_0xad2e('0x40')]));_0xae65b6['attributes']=_0xae65b6[_0xad2e('0x3f')][_0xad2e('0x41')]?_0xae65b6[_0xad2e('0x3f')]:_0xb03176[_0xad2e('0x3e')];_0xae65b6[_0xad2e('0x44')]=qs['sort'](_0x519971[_0xad2e('0x3b')]['sort']);_0xae65b6['where']=qs['filters'](_['pick'](_0x519971[_0xad2e('0x3b')],_0xb03176[_0xad2e('0x3c')]));if(_0x519971[_0xad2e('0x3b')][_0xad2e('0x48')]){_0xae65b6[_0xad2e('0x46')]=_[_0xad2e('0x49')](_0xae65b6[_0xad2e('0x46')],{'$or':_[_0xad2e('0x4a')](_0xae65b6[_0xad2e('0x3f')],function(_0x68e0d4){var _0x4fbc78={};_0x4fbc78[_0x68e0d4]={'$like':'%'+_0x519971['query'][_0xad2e('0x48')]+'%'};return _0x4fbc78;})});}_0xae65b6=_[_0xad2e('0x49')]({},_0xae65b6,_0x519971['options']);return _0xd3b75e['getFields'](_0xae65b6);}})[_0xad2e('0x1b')](function(_0x49a7d9){if(_0x49a7d9){_0x450803=_0x49a7d9[_0xad2e('0x41')];if(!_0x519971[_0xad2e('0x3b')][_0xad2e('0x42')](_0xad2e('0x43'))){_0xae65b6[_0xad2e('0x2d')]=qs[_0xad2e('0x2d')](_0x519971[_0xad2e('0x3b')][_0xad2e('0x2d')]);_0xae65b6['offset']=qs[_0xad2e('0x2c')](_0x519971['query']['offset']);}return _0xd3b75e[_0xad2e('0x5a')](_0xae65b6);}})[_0xad2e('0x1b')](function(_0x5319c0){if(_0x5319c0){return _0x5319c0?{'count':_0x450803,'rows':_0x5319c0}:null;}})[_0xad2e('0x1b')](respondWithResult(_0x5c7318,null))[_0xad2e('0x26')](handleError(_0x5c7318,null));};exports[_0xad2e('0x5c')]=function(_0x51c3c2,_0x1e5f05,_0x56aa36){var _0x1469a2={};var _0x4ee202={};var _0x5a2075;var _0x45cff3;return db[_0xad2e('0x39')][_0xad2e('0x5d')]({'where':{'id':_0x51c3c2[_0xad2e('0x55')]['id']}})[_0xad2e('0x1b')](handleEntityNotFound(_0x1e5f05,null))['then'](function(_0x49e39c){if(_0x49e39c){_0x5a2075=_0x49e39c;_0x4ee202[_0xad2e('0x3e')]=_[_0xad2e('0x3a')](db[_0xad2e('0x5b')][_0xad2e('0x56')]);_0x4ee202['query']=_[_0xad2e('0x3a')](_0x51c3c2[_0xad2e('0x3b')]);_0x4ee202[_0xad2e('0x3c')]=_[_0xad2e('0x3d')](_0x4ee202[_0xad2e('0x3e')],_0x4ee202[_0xad2e('0x3b')]);_0x1469a2[_0xad2e('0x3f')]=_[_0xad2e('0x3d')](_0x4ee202[_0xad2e('0x3e')],qs['fields'](_0x51c3c2[_0xad2e('0x3b')][_0xad2e('0x40')]));_0x1469a2[_0xad2e('0x3f')]=_0x1469a2['attributes'][_0xad2e('0x41')]?_0x1469a2[_0xad2e('0x3f')]:_0x4ee202[_0xad2e('0x3e')];_0x1469a2[_0xad2e('0x44')]=qs[_0xad2e('0x45')](_0x51c3c2[_0xad2e('0x3b')]['sort']);_0x1469a2['where']=qs['filters'](_['pick'](_0x51c3c2[_0xad2e('0x3b')],_0x4ee202[_0xad2e('0x3c')]));if(_0x51c3c2['query'][_0xad2e('0x48')]){_0x1469a2[_0xad2e('0x46')]=_[_0xad2e('0x49')](_0x1469a2[_0xad2e('0x46')],{'$or':_[_0xad2e('0x4a')](_0x1469a2[_0xad2e('0x3f')],function(_0x3d0106){var _0x19a4c6={};_0x19a4c6[_0x3d0106]={'$like':'%'+_0x51c3c2['query']['filter']+'%'};return _0x19a4c6;})});}_0x1469a2=_['merge']({},_0x1469a2,_0x51c3c2['options']);return _0x5a2075['getSubjects'](_0x1469a2);}})[_0xad2e('0x1b')](function(_0x4f2ea2){if(_0x4f2ea2){_0x45cff3=_0x4f2ea2[_0xad2e('0x41')];if(!_0x51c3c2[_0xad2e('0x3b')][_0xad2e('0x42')]('nolimit')){_0x1469a2['limit']=qs[_0xad2e('0x2d')](_0x51c3c2['query']['limit']);_0x1469a2[_0xad2e('0x2c')]=qs[_0xad2e('0x2c')](_0x51c3c2[_0xad2e('0x3b')][_0xad2e('0x2c')]);}return _0x5a2075[_0xad2e('0x5c')](_0x1469a2);}})[_0xad2e('0x1b')](function(_0x1f3d5a){if(_0x1f3d5a){return _0x1f3d5a?{'count':_0x45cff3,'rows':_0x1f3d5a}:null;}})[_0xad2e('0x1b')](respondWithResult(_0x1e5f05,null))[_0xad2e('0x26')](handleError(_0x1e5f05,null));};exports[_0xad2e('0x5e')]=function(_0x54cbf2,_0x4b582d,_0x1edd77){var _0x2d68a0={};var _0x502c17={};var _0xce7f22;var _0x27f970;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x54cbf2[_0xad2e('0x55')]['id']}})[_0xad2e('0x1b')](handleEntityNotFound(_0x4b582d,null))[_0xad2e('0x1b')](function(_0x181850){if(_0x181850){_0xce7f22=_0x181850;_0x502c17[_0xad2e('0x3e')]=_['keys'](db[_0xad2e('0x5b')]['rawAttributes']);_0x502c17[_0xad2e('0x3b')]=_[_0xad2e('0x3a')](_0x54cbf2['query']);_0x502c17[_0xad2e('0x3c')]=_[_0xad2e('0x3d')](_0x502c17[_0xad2e('0x3e')],_0x502c17['query']);_0x2d68a0[_0xad2e('0x3f')]=_[_0xad2e('0x3d')](_0x502c17[_0xad2e('0x3e')],qs[_0xad2e('0x40')](_0x54cbf2[_0xad2e('0x3b')]['fields']));_0x2d68a0[_0xad2e('0x3f')]=_0x2d68a0['attributes'][_0xad2e('0x41')]?_0x2d68a0[_0xad2e('0x3f')]:_0x502c17[_0xad2e('0x3e')];_0x2d68a0[_0xad2e('0x44')]=qs[_0xad2e('0x45')](_0x54cbf2[_0xad2e('0x3b')][_0xad2e('0x45')]);_0x2d68a0[_0xad2e('0x46')]=qs[_0xad2e('0x3c')](_[_0xad2e('0x47')](_0x54cbf2[_0xad2e('0x3b')],_0x502c17[_0xad2e('0x3c')]));if(_0x54cbf2[_0xad2e('0x3b')][_0xad2e('0x48')]){_0x2d68a0[_0xad2e('0x46')]=_[_0xad2e('0x49')](_0x2d68a0[_0xad2e('0x46')],{'$or':_['map'](_0x2d68a0[_0xad2e('0x3f')],function(_0x475d6c){var _0x1bdd1f={};_0x1bdd1f[_0x475d6c]={'$like':'%'+_0x54cbf2[_0xad2e('0x3b')]['filter']+'%'};return _0x1bdd1f;})});}_0x2d68a0=_[_0xad2e('0x49')]({},_0x2d68a0,_0x54cbf2[_0xad2e('0x4f')]);return _0xce7f22[_0xad2e('0x5e')](_0x2d68a0);}})['then'](function(_0x1c49e6){if(_0x1c49e6){_0x27f970=_0x1c49e6[_0xad2e('0x41')];if(!_0x54cbf2[_0xad2e('0x3b')][_0xad2e('0x42')]('nolimit')){_0x2d68a0[_0xad2e('0x2d')]=qs[_0xad2e('0x2d')](_0x54cbf2[_0xad2e('0x3b')][_0xad2e('0x2d')]);_0x2d68a0[_0xad2e('0x2c')]=qs[_0xad2e('0x2c')](_0x54cbf2[_0xad2e('0x3b')][_0xad2e('0x2c')]);}return _0xce7f22['getDescriptions'](_0x2d68a0);}})[_0xad2e('0x1b')](function(_0x49e408){if(_0x49e408){return _0x49e408?{'count':_0x27f970,'rows':_0x49e408}:null;}})['then'](respondWithResult(_0x4b582d,null))[_0xad2e('0x26')](handleError(_0x4b582d,null));}; \ No newline at end of file +var _0xac95=['lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../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~!@#$%^&-_=+[{]}.','request','then','info','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','status','json','count','offset','set','Content-Range','apply','reject','update','end','sendStatus','stack','name','send','index','VtigerConfiguration','rawAttributes','model','keys','query','filters','intersection','fields','attributes','limit','order','sort','where','pick','filter','merge','map','type','key','field','options','rows','catch','show','params','length','includeAll','include','find','create','body','destroy','findOne','getFields','hasOwnProperty','nolimit','VtigerField','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','util','path','to-csv','ejs'];(function(_0xf2628e,_0x521bf7){var _0x13863a=function(_0x2b04ab){while(--_0x2b04ab){_0xf2628e['push'](_0xf2628e['shift']());}};_0x13863a(++_0x521bf7);}(_0xac95,0xa8));var _0x5ac9=function(_0x3babfe,_0x36bf3b){_0x3babfe=_0x3babfe-0x0;var _0x1fb40f=_0xac95[_0x3babfe];return _0x1fb40f;};'use strict';var pdf=require(_0x5ac9('0x0'));var emlformat=require(_0x5ac9('0x1'));var rimraf=require(_0x5ac9('0x2'));var zipdir=require(_0x5ac9('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5ac9('0x4'));var BPromise=require(_0x5ac9('0x5'));var Mustache=require('mustache');var util=require(_0x5ac9('0x6'));var path=require(_0x5ac9('0x7'));var sox=require('sox');var csv=require(_0x5ac9('0x8'));var ejs=require(_0x5ac9('0x9'));var fs=require('fs');var _=require(_0x5ac9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5ac9('0xb'));var deskjs=require(_0x5ac9('0xc'));var toCsv=require(_0x5ac9('0x8'));var querystring=require(_0x5ac9('0xd'));var Papa=require(_0x5ac9('0xe'));var Redis=require(_0x5ac9('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5ac9('0x10'));var hardwareService=require(_0x5ac9('0x11'));var logger=require('../../config/logger')(_0x5ac9('0x12'));var utils=require('../../config/utils');var config=require(_0x5ac9('0x13'));var db=require('../../mysqldb')['db'];var jayson=require(_0x5ac9('0x14'));var client=jayson[_0x5ac9('0x15')][_0x5ac9('0x16')]({'port':0x232a});function checkPasswordPattern(_0x40eb62,_0x4f9a04,_0x517409){if(_0x517409){var _0x43b80d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x43b80d['test'](_0x4f9a04)){return _0x40eb62;}else{throw new Error(_0x5ac9('0x17'));}}else{return _0x40eb62;}}function respondWithRpcPromise(_0x364007,_0x50658c,_0x3dcc9e,_0x4590f1){return new BPromise(function(_0x3f8fac,_0x122590){var _0x456ed9=_0x4590f1||client;return _0x456ed9[_0x5ac9('0x18')](_0x364007,_0x3dcc9e)[_0x5ac9('0x19')](function(_0x19b3a4){logger[_0x5ac9('0x1a')]('VtigerConfiguration,\x20%s,\x20%s',_0x50658c,'request\x20sent');logger[_0x5ac9('0x1b')](_0x5ac9('0x1c'),_0x50658c,_0x5ac9('0x1d'),JSON[_0x5ac9('0x1e')](_0x19b3a4));if(_0x19b3a4[_0x5ac9('0x1f')]){if(_0x19b3a4[_0x5ac9('0x1f')][_0x5ac9('0x20')]===0x1f4){logger[_0x5ac9('0x1f')](_0x5ac9('0x21'),_0x50658c,_0x19b3a4[_0x5ac9('0x1f')][_0x5ac9('0x22')]);return _0x122590(_0x19b3a4[_0x5ac9('0x1f')][_0x5ac9('0x22')]);}logger['error'](_0x5ac9('0x21'),_0x50658c,_0x19b3a4[_0x5ac9('0x1f')][_0x5ac9('0x22')]);return _0x3f8fac(_0x19b3a4[_0x5ac9('0x1f')][_0x5ac9('0x22')]);}else{logger['info'](_0x5ac9('0x21'),_0x50658c,_0x5ac9('0x1d'));_0x3f8fac(_0x19b3a4['result']['message']);}})['catch'](function(_0xc36d2){logger[_0x5ac9('0x1f')]('VtigerConfiguration,\x20%s,\x20%s',_0x50658c,_0xc36d2);_0x122590(_0xc36d2);});});}function respondWithStatusCode(_0x5ce83a,_0x1a6372){_0x1a6372=_0x1a6372||0xcc;return function(_0x59c3fd){if(_0x59c3fd){return _0x5ce83a['sendStatus'](_0x1a6372);}return _0x5ce83a[_0x5ac9('0x23')](_0x1a6372)['end']();};}function respondWithResult(_0x12f725,_0x3b77be){_0x3b77be=_0x3b77be||0xc8;return function(_0x770c48){if(_0x770c48){return _0x12f725[_0x5ac9('0x23')](_0x3b77be)[_0x5ac9('0x24')](_0x770c48);}};}function respondWithFilteredResult(_0x174cfe,_0x13aaa7){return function(_0x2dc7fa){if(_0x2dc7fa){var _0x203d19=_0x2dc7fa[_0x5ac9('0x25')],_0x48182b=_0x13aaa7[_0x5ac9('0x26')],_0x377b07=_0x13aaa7[_0x5ac9('0x26')]+_0x13aaa7['limit'],_0x14a7fe;if(_0x377b07>=_0x203d19){_0x377b07=_0x203d19;_0x14a7fe=0xc8;}else{_0x14a7fe=0xce;}_0x174cfe['status'](_0x14a7fe);return _0x174cfe[_0x5ac9('0x27')](_0x5ac9('0x28'),_0x48182b+'-'+_0x377b07+'/'+_0x203d19)['json'](_0x2dc7fa);}return null;};}function patchUpdates(_0x3a15cf){return function(_0x53d54e){try{jsonpatch[_0x5ac9('0x29')](_0x53d54e,_0x3a15cf,!![]);}catch(_0x2c85dc){return BPromise[_0x5ac9('0x2a')](_0x2c85dc);}return _0x53d54e['save']();};}function saveUpdates(_0x2e6ad1,_0x128866){return function(_0x446050){if(_0x446050){return _0x446050[_0x5ac9('0x2b')](_0x2e6ad1)[_0x5ac9('0x19')](function(_0x35d73d){return _0x35d73d;});}return null;};}function removeEntity(_0x4e7aee,_0x48d9bc){return function(_0x31ed52){if(_0x31ed52){return _0x31ed52['destroy']()['then'](function(){_0x4e7aee[_0x5ac9('0x23')](0xcc)[_0x5ac9('0x2c')]();});}};}function handleEntityNotFound(_0x3e12be,_0x2f2fb4){return function(_0x2f7f2f){if(!_0x2f7f2f){_0x3e12be[_0x5ac9('0x2d')](0x194);}return _0x2f7f2f;};}function handleError(_0x6225c5,_0x2763ec){_0x2763ec=_0x2763ec||0x1f4;return function(_0x45cc32){logger['error'](_0x45cc32[_0x5ac9('0x2e')]);if(_0x45cc32[_0x5ac9('0x2f')]){delete _0x45cc32['name'];}_0x6225c5['status'](_0x2763ec)[_0x5ac9('0x30')](_0x45cc32);};}exports[_0x5ac9('0x31')]=function(_0x386fc3,_0x378367){var _0x5be935={},_0x848f6d={},_0x5b55c9={'count':0x0,'rows':[]};var _0x3c540f=db[_0x5ac9('0x32')][_0x5ac9('0x33')];_0x848f6d[_0x5ac9('0x34')]=_[_0x5ac9('0x35')](_0x3c540f);_0x848f6d[_0x5ac9('0x36')]=_[_0x5ac9('0x35')](_0x386fc3[_0x5ac9('0x36')]);_0x848f6d[_0x5ac9('0x37')]=_[_0x5ac9('0x38')](_0x848f6d[_0x5ac9('0x34')],_0x848f6d[_0x5ac9('0x36')]);_0x5be935['attributes']=_['intersection'](_0x848f6d[_0x5ac9('0x34')],qs[_0x5ac9('0x39')](_0x386fc3[_0x5ac9('0x36')][_0x5ac9('0x39')]));_0x5be935[_0x5ac9('0x3a')]=_0x5be935[_0x5ac9('0x3a')]['length']?_0x5be935[_0x5ac9('0x3a')]:_0x848f6d[_0x5ac9('0x34')];if(!_0x386fc3['query']['hasOwnProperty']('nolimit')){_0x5be935[_0x5ac9('0x3b')]=qs[_0x5ac9('0x3b')](_0x386fc3[_0x5ac9('0x36')][_0x5ac9('0x3b')]);_0x5be935['offset']=qs[_0x5ac9('0x26')](_0x386fc3['query']['offset']);}_0x5be935[_0x5ac9('0x3c')]=qs[_0x5ac9('0x3d')](_0x386fc3['query'][_0x5ac9('0x3d')]);_0x5be935[_0x5ac9('0x3e')]=qs['filters'](_[_0x5ac9('0x3f')](_0x386fc3[_0x5ac9('0x36')],_0x848f6d[_0x5ac9('0x37')]));if(_0x386fc3[_0x5ac9('0x36')][_0x5ac9('0x40')]){_0x5be935[_0x5ac9('0x3e')]=_[_0x5ac9('0x41')](_0x5be935[_0x5ac9('0x3e')],{'$or':_[_0x5ac9('0x42')](_0x3c540f,function(_0x2a3564){if(_0x2a3564[_0x5ac9('0x43')][_0x5ac9('0x44')]!=='VIRTUAL'){var _0x29f61a={};_0x29f61a[_0x2a3564[_0x5ac9('0x45')]]={'$like':'%'+_0x386fc3[_0x5ac9('0x36')]['filter']+'%'};return _0x29f61a;}})});}_0x5be935=_[_0x5ac9('0x41')]({},_0x5be935,_0x386fc3[_0x5ac9('0x46')]);var _0x3b6aad={'where':_0x5be935['where']};return db[_0x5ac9('0x32')][_0x5ac9('0x25')](_0x3b6aad)[_0x5ac9('0x19')](function(_0x34b3c2){_0x5b55c9[_0x5ac9('0x25')]=_0x34b3c2;if(_0x386fc3[_0x5ac9('0x36')]['includeAll']){_0x5be935['include']=[{'all':!![]}];}return db[_0x5ac9('0x32')]['findAll'](_0x5be935);})[_0x5ac9('0x19')](function(_0x4807ef){_0x5b55c9[_0x5ac9('0x47')]=_0x4807ef;return _0x5b55c9;})[_0x5ac9('0x19')](respondWithFilteredResult(_0x378367,_0x5be935))[_0x5ac9('0x48')](handleError(_0x378367,null));};exports[_0x5ac9('0x49')]=function(_0x2a019c,_0x671363){var _0x324b7d={'raw':![],'where':{'id':_0x2a019c[_0x5ac9('0x4a')]['id']}},_0x20b55b={};_0x20b55b[_0x5ac9('0x34')]=_[_0x5ac9('0x35')](db['VtigerConfiguration'][_0x5ac9('0x33')]);_0x20b55b[_0x5ac9('0x36')]=_['keys'](_0x2a019c['query']);_0x20b55b[_0x5ac9('0x37')]=_[_0x5ac9('0x38')](_0x20b55b[_0x5ac9('0x34')],_0x20b55b['query']);_0x324b7d[_0x5ac9('0x3a')]=_[_0x5ac9('0x38')](_0x20b55b[_0x5ac9('0x34')],qs[_0x5ac9('0x39')](_0x2a019c[_0x5ac9('0x36')][_0x5ac9('0x39')]));_0x324b7d['attributes']=_0x324b7d['attributes'][_0x5ac9('0x4b')]?_0x324b7d[_0x5ac9('0x3a')]:_0x20b55b['model'];if(_0x2a019c[_0x5ac9('0x36')][_0x5ac9('0x4c')]){_0x324b7d[_0x5ac9('0x4d')]=[{'all':!![]}];}_0x324b7d=_[_0x5ac9('0x41')]({},_0x324b7d,_0x2a019c[_0x5ac9('0x46')]);return db['VtigerConfiguration'][_0x5ac9('0x4e')](_0x324b7d)[_0x5ac9('0x19')](handleEntityNotFound(_0x671363,null))[_0x5ac9('0x19')](respondWithResult(_0x671363,null))['catch'](handleError(_0x671363,null));};exports[_0x5ac9('0x4f')]=function(_0x17c9c7,_0x1fb8f8){return db[_0x5ac9('0x32')][_0x5ac9('0x4f')](_0x17c9c7['body'],{})['then'](respondWithResult(_0x1fb8f8,0xc9))[_0x5ac9('0x48')](handleError(_0x1fb8f8,null));};exports['update']=function(_0x336ff8,_0x4c1b39){if(_0x336ff8[_0x5ac9('0x50')]['id']){delete _0x336ff8['body']['id'];}return db[_0x5ac9('0x32')][_0x5ac9('0x4e')]({'where':{'id':_0x336ff8['params']['id']}})['then'](handleEntityNotFound(_0x4c1b39,null))[_0x5ac9('0x19')](saveUpdates(_0x336ff8[_0x5ac9('0x50')],null))[_0x5ac9('0x19')](respondWithResult(_0x4c1b39,null))[_0x5ac9('0x48')](handleError(_0x4c1b39,null));};exports[_0x5ac9('0x51')]=function(_0x3b90d9,_0x3767bd){return db[_0x5ac9('0x32')]['find']({'where':{'id':_0x3b90d9[_0x5ac9('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3767bd,null))[_0x5ac9('0x19')](removeEntity(_0x3767bd,null))[_0x5ac9('0x48')](handleError(_0x3767bd,null));};exports['getFields']=function(_0xa478b5,_0x4ae713,_0x2e20d9){var _0x84889a={};var _0x2be15d={};var _0x388011;var _0x43b245;return db['VtigerConfiguration'][_0x5ac9('0x52')]({'where':{'id':_0xa478b5[_0x5ac9('0x4a')]['id']}})[_0x5ac9('0x19')](handleEntityNotFound(_0x4ae713,null))['then'](function(_0x827d13){if(_0x827d13){_0x388011=_0x827d13;_0x2be15d[_0x5ac9('0x34')]=_[_0x5ac9('0x35')](db['VtigerField'][_0x5ac9('0x33')]);_0x2be15d['query']=_[_0x5ac9('0x35')](_0xa478b5[_0x5ac9('0x36')]);_0x2be15d['filters']=_['intersection'](_0x2be15d[_0x5ac9('0x34')],_0x2be15d[_0x5ac9('0x36')]);_0x84889a[_0x5ac9('0x3a')]=_[_0x5ac9('0x38')](_0x2be15d[_0x5ac9('0x34')],qs[_0x5ac9('0x39')](_0xa478b5[_0x5ac9('0x36')][_0x5ac9('0x39')]));_0x84889a['attributes']=_0x84889a[_0x5ac9('0x3a')][_0x5ac9('0x4b')]?_0x84889a['attributes']:_0x2be15d['model'];_0x84889a[_0x5ac9('0x3c')]=qs[_0x5ac9('0x3d')](_0xa478b5['query'][_0x5ac9('0x3d')]);_0x84889a[_0x5ac9('0x3e')]=qs[_0x5ac9('0x37')](_[_0x5ac9('0x3f')](_0xa478b5[_0x5ac9('0x36')],_0x2be15d[_0x5ac9('0x37')]));if(_0xa478b5[_0x5ac9('0x36')][_0x5ac9('0x40')]){_0x84889a[_0x5ac9('0x3e')]=_[_0x5ac9('0x41')](_0x84889a[_0x5ac9('0x3e')],{'$or':_[_0x5ac9('0x42')](_0x84889a[_0x5ac9('0x3a')],function(_0xc966db){var _0x3b5233={};_0x3b5233[_0xc966db]={'$like':'%'+_0xa478b5['query'][_0x5ac9('0x40')]+'%'};return _0x3b5233;})});}_0x84889a=_['merge']({},_0x84889a,_0xa478b5[_0x5ac9('0x46')]);return _0x388011[_0x5ac9('0x53')](_0x84889a);}})[_0x5ac9('0x19')](function(_0x55fc39){if(_0x55fc39){_0x43b245=_0x55fc39['length'];if(!_0xa478b5[_0x5ac9('0x36')][_0x5ac9('0x54')](_0x5ac9('0x55'))){_0x84889a['limit']=qs[_0x5ac9('0x3b')](_0xa478b5[_0x5ac9('0x36')]['limit']);_0x84889a['offset']=qs[_0x5ac9('0x26')](_0xa478b5['query'][_0x5ac9('0x26')]);}return _0x388011[_0x5ac9('0x53')](_0x84889a);}})[_0x5ac9('0x19')](function(_0x47e386){if(_0x47e386){return _0x47e386?{'count':_0x43b245,'rows':_0x47e386}:null;}})[_0x5ac9('0x19')](respondWithResult(_0x4ae713,null))[_0x5ac9('0x48')](handleError(_0x4ae713,null));};exports['getSubjects']=function(_0x4265b3,_0x3af258,_0x598aff){var _0x3c2ab0={};var _0x12e4a2={};var _0x5655bd;var _0x2d1757;return db[_0x5ac9('0x32')]['findOne']({'where':{'id':_0x4265b3[_0x5ac9('0x4a')]['id']}})[_0x5ac9('0x19')](handleEntityNotFound(_0x3af258,null))[_0x5ac9('0x19')](function(_0x49d450){if(_0x49d450){_0x5655bd=_0x49d450;_0x12e4a2[_0x5ac9('0x34')]=_[_0x5ac9('0x35')](db[_0x5ac9('0x56')][_0x5ac9('0x33')]);_0x12e4a2[_0x5ac9('0x36')]=_[_0x5ac9('0x35')](_0x4265b3[_0x5ac9('0x36')]);_0x12e4a2[_0x5ac9('0x37')]=_['intersection'](_0x12e4a2[_0x5ac9('0x34')],_0x12e4a2[_0x5ac9('0x36')]);_0x3c2ab0[_0x5ac9('0x3a')]=_[_0x5ac9('0x38')](_0x12e4a2['model'],qs[_0x5ac9('0x39')](_0x4265b3['query'][_0x5ac9('0x39')]));_0x3c2ab0[_0x5ac9('0x3a')]=_0x3c2ab0[_0x5ac9('0x3a')][_0x5ac9('0x4b')]?_0x3c2ab0[_0x5ac9('0x3a')]:_0x12e4a2['model'];_0x3c2ab0['order']=qs[_0x5ac9('0x3d')](_0x4265b3['query'][_0x5ac9('0x3d')]);_0x3c2ab0[_0x5ac9('0x3e')]=qs[_0x5ac9('0x37')](_[_0x5ac9('0x3f')](_0x4265b3['query'],_0x12e4a2[_0x5ac9('0x37')]));if(_0x4265b3['query'][_0x5ac9('0x40')]){_0x3c2ab0[_0x5ac9('0x3e')]=_[_0x5ac9('0x41')](_0x3c2ab0[_0x5ac9('0x3e')],{'$or':_[_0x5ac9('0x42')](_0x3c2ab0[_0x5ac9('0x3a')],function(_0x466bf3){var _0x52eb19={};_0x52eb19[_0x466bf3]={'$like':'%'+_0x4265b3[_0x5ac9('0x36')]['filter']+'%'};return _0x52eb19;})});}_0x3c2ab0=_[_0x5ac9('0x41')]({},_0x3c2ab0,_0x4265b3[_0x5ac9('0x46')]);return _0x5655bd[_0x5ac9('0x57')](_0x3c2ab0);}})[_0x5ac9('0x19')](function(_0x30b66b){if(_0x30b66b){_0x2d1757=_0x30b66b['length'];if(!_0x4265b3[_0x5ac9('0x36')][_0x5ac9('0x54')](_0x5ac9('0x55'))){_0x3c2ab0['limit']=qs[_0x5ac9('0x3b')](_0x4265b3['query']['limit']);_0x3c2ab0[_0x5ac9('0x26')]=qs[_0x5ac9('0x26')](_0x4265b3[_0x5ac9('0x36')][_0x5ac9('0x26')]);}return _0x5655bd['getSubjects'](_0x3c2ab0);}})[_0x5ac9('0x19')](function(_0x74934f){if(_0x74934f){return _0x74934f?{'count':_0x2d1757,'rows':_0x74934f}:null;}})[_0x5ac9('0x19')](respondWithResult(_0x3af258,null))[_0x5ac9('0x48')](handleError(_0x3af258,null));};exports[_0x5ac9('0x58')]=function(_0x49caac,_0x57c8f9,_0x11fbdc){var _0x4279d2={};var _0x15ca3f={};var _0x4c9c8b;var _0x22baa2;return db['VtigerConfiguration'][_0x5ac9('0x52')]({'where':{'id':_0x49caac[_0x5ac9('0x4a')]['id']}})['then'](handleEntityNotFound(_0x57c8f9,null))[_0x5ac9('0x19')](function(_0x11d00e){if(_0x11d00e){_0x4c9c8b=_0x11d00e;_0x15ca3f['model']=_[_0x5ac9('0x35')](db[_0x5ac9('0x56')][_0x5ac9('0x33')]);_0x15ca3f['query']=_[_0x5ac9('0x35')](_0x49caac[_0x5ac9('0x36')]);_0x15ca3f[_0x5ac9('0x37')]=_[_0x5ac9('0x38')](_0x15ca3f[_0x5ac9('0x34')],_0x15ca3f[_0x5ac9('0x36')]);_0x4279d2[_0x5ac9('0x3a')]=_[_0x5ac9('0x38')](_0x15ca3f[_0x5ac9('0x34')],qs['fields'](_0x49caac[_0x5ac9('0x36')][_0x5ac9('0x39')]));_0x4279d2[_0x5ac9('0x3a')]=_0x4279d2[_0x5ac9('0x3a')]['length']?_0x4279d2[_0x5ac9('0x3a')]:_0x15ca3f[_0x5ac9('0x34')];_0x4279d2[_0x5ac9('0x3c')]=qs[_0x5ac9('0x3d')](_0x49caac[_0x5ac9('0x36')][_0x5ac9('0x3d')]);_0x4279d2[_0x5ac9('0x3e')]=qs[_0x5ac9('0x37')](_[_0x5ac9('0x3f')](_0x49caac[_0x5ac9('0x36')],_0x15ca3f[_0x5ac9('0x37')]));if(_0x49caac['query'][_0x5ac9('0x40')]){_0x4279d2[_0x5ac9('0x3e')]=_[_0x5ac9('0x41')](_0x4279d2[_0x5ac9('0x3e')],{'$or':_[_0x5ac9('0x42')](_0x4279d2[_0x5ac9('0x3a')],function(_0x57d334){var _0x385759={};_0x385759[_0x57d334]={'$like':'%'+_0x49caac[_0x5ac9('0x36')][_0x5ac9('0x40')]+'%'};return _0x385759;})});}_0x4279d2=_[_0x5ac9('0x41')]({},_0x4279d2,_0x49caac['options']);return _0x4c9c8b[_0x5ac9('0x58')](_0x4279d2);}})[_0x5ac9('0x19')](function(_0x23c3fb){if(_0x23c3fb){_0x22baa2=_0x23c3fb[_0x5ac9('0x4b')];if(!_0x49caac[_0x5ac9('0x36')][_0x5ac9('0x54')](_0x5ac9('0x55'))){_0x4279d2[_0x5ac9('0x3b')]=qs[_0x5ac9('0x3b')](_0x49caac[_0x5ac9('0x36')]['limit']);_0x4279d2['offset']=qs['offset'](_0x49caac[_0x5ac9('0x36')]['offset']);}return _0x4c9c8b[_0x5ac9('0x58')](_0x4279d2);}})[_0x5ac9('0x19')](function(_0x40c4a9){if(_0x40c4a9){return _0x40c4a9?{'count':_0x22baa2,'rows':_0x40c4a9}:null;}})[_0x5ac9('0x19')](respondWithResult(_0x57c8f9,null))[_0x5ac9('0x48')](handleError(_0x57c8f9,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 66e1b90..4f6f689 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(_0x5b5156,_0x30e22c){var _0x3326a3=function(_0x54cfd1){while(--_0x54cfd1){_0x5b5156['push'](_0x5b5156['shift']());}};_0x3326a3(++_0x30e22c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x206b0d,_0x215e73){var _0x1e3ffc=function(_0x12e1b4){while(--_0x12e1b4){_0x206b0d['push'](_0x206b0d['shift']());}};_0x1e3ffc(++_0x215e73);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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 18027dc..0dec9a2 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 _0x1979=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x19a8a7,_0x31ecdd){var _0x4fe08f=function(_0x5c30eb){while(--_0x5c30eb){_0x19a8a7['push'](_0x19a8a7['shift']());}};_0x4fe08f(++_0x31ecdd);}(_0x1979,0xb0));var _0x9197=function(_0x21090b,_0x39dd3b){_0x21090b=_0x21090b-0x0;var _0x3c68d7=_0x1979[_0x21090b];return _0x3c68d7;};'use strict';var _=require(_0x9197('0x0'));var util=require(_0x9197('0x1'));var moment=require(_0x9197('0x2'));var BPromise=require(_0x9197('0x3'));var rs=require(_0x9197('0x4'));var fs=require('fs');var Redis=require(_0x9197('0x5'));var db=require(_0x9197('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9197('0x7'));var config=require('../../config/environment');var jayson=require(_0x9197('0x8'));var client=jayson[_0x9197('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bea28,_0x89059,_0xabf759){return new BPromise(function(_0x20bf5b,_0xe816ce){return client[_0x9197('0xa')](_0x5bea28,_0xabf759)[_0x9197('0xb')](function(_0xfa11d7){logger[_0x9197('0xc')](_0x9197('0xd'),_0x89059,_0x9197('0xe'));logger[_0x9197('0xf')](_0x9197('0x10'),_0x89059,_0x9197('0xe'),JSON[_0x9197('0x11')](_0xfa11d7));if(_0xfa11d7[_0x9197('0x12')]){if(_0xfa11d7['error'][_0x9197('0x13')]===0x1f4){logger[_0x9197('0x12')](_0x9197('0xd'),_0x89059,_0xfa11d7[_0x9197('0x12')][_0x9197('0x14')]);return _0xe816ce(_0xfa11d7[_0x9197('0x12')][_0x9197('0x14')]);}logger[_0x9197('0x12')](_0x9197('0xd'),_0x89059,_0xfa11d7[_0x9197('0x12')]['message']);return _0x20bf5b(_0xfa11d7[_0x9197('0x12')][_0x9197('0x14')]);}else{logger[_0x9197('0xc')](_0x9197('0xd'),_0x89059,'request\x20sent');_0x20bf5b(_0xfa11d7['result'][_0x9197('0x14')]);}})[_0x9197('0x15')](function(_0x3e07e8){logger[_0x9197('0x12')](_0x9197('0xd'),_0x89059,_0x3e07e8);_0xe816ce(_0x3e07e8);});});} \ No newline at end of file +var _0x7bd0=['debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0xdd7039,_0x40cae6){var _0x13ac0e=function(_0x542533){while(--_0x542533){_0xdd7039['push'](_0xdd7039['shift']());}};_0x13ac0e(++_0x40cae6);}(_0x7bd0,0x133));var _0x07bd=function(_0xdd82b4,_0x5cd8b8){_0xdd82b4=_0xdd82b4-0x0;var _0x549bb2=_0x7bd0[_0xdd82b4];return _0x549bb2;};'use strict';var _=require(_0x07bd('0x0'));var util=require(_0x07bd('0x1'));var moment=require(_0x07bd('0x2'));var BPromise=require(_0x07bd('0x3'));var rs=require(_0x07bd('0x4'));var fs=require('fs');var Redis=require(_0x07bd('0x5'));var db=require(_0x07bd('0x6'))['db'];var utils=require(_0x07bd('0x7'));var logger=require(_0x07bd('0x8'))(_0x07bd('0x9'));var config=require(_0x07bd('0xa'));var jayson=require(_0x07bd('0xb'));var client=jayson[_0x07bd('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d9bb9,_0x1d0bd7,_0x15aaa5){return new BPromise(function(_0x5bd372,_0x1c06a5){return client[_0x07bd('0xd')](_0x2d9bb9,_0x15aaa5)[_0x07bd('0xe')](function(_0x3be9dc){logger[_0x07bd('0xf')](_0x07bd('0x10'),_0x1d0bd7,_0x07bd('0x11'));logger[_0x07bd('0x12')](_0x07bd('0x13'),_0x1d0bd7,_0x07bd('0x11'),JSON[_0x07bd('0x14')](_0x3be9dc));if(_0x3be9dc['error']){if(_0x3be9dc['error'][_0x07bd('0x15')]===0x1f4){logger[_0x07bd('0x16')]('VtigerConfiguration,\x20%s,\x20%s',_0x1d0bd7,_0x3be9dc[_0x07bd('0x16')][_0x07bd('0x17')]);return _0x1c06a5(_0x3be9dc[_0x07bd('0x16')][_0x07bd('0x17')]);}logger['error'](_0x07bd('0x10'),_0x1d0bd7,_0x3be9dc[_0x07bd('0x16')]['message']);return _0x5bd372(_0x3be9dc[_0x07bd('0x16')][_0x07bd('0x17')]);}else{logger[_0x07bd('0xf')](_0x07bd('0x10'),_0x1d0bd7,'request\x20sent');_0x5bd372(_0x3be9dc['result']['message']);}})[_0x07bd('0x18')](function(_0x2b35de){logger[_0x07bd('0x16')](_0x07bd('0x10'),_0x1d0bd7,_0x2b35de);_0x1c06a5(_0x2b35de);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 559c320..8ff3f84 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 _0x11a4=['../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','show','post','create','put','/:id','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x11a4,0xaf));var _0x411a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x11a4[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0x411a('0x0'));var util=require('util');var path=require(_0x411a('0x1'));var timeout=require(_0x411a('0x2'));var express=require(_0x411a('0x3'));var router=express[_0x411a('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x411a('0x5'));var config=require(_0x411a('0x6'));var controller=require(_0x411a('0x7'));router[_0x411a('0x8')]('/',auth[_0x411a('0x9')](),controller[_0x411a('0xa')]);router[_0x411a('0x8')]('/:id',auth[_0x411a('0x9')](),controller[_0x411a('0xb')]);router[_0x411a('0xc')]('/',auth[_0x411a('0x9')](),controller[_0x411a('0xd')]);router[_0x411a('0xe')](_0x411a('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x411a('0xf'),auth[_0x411a('0x9')](),controller[_0x411a('0x10')]);module[_0x411a('0x11')]=router; \ No newline at end of file +var _0x73b7=['../../components/interaction/service','../../config/environment','./intVtigerField.controller','isAuthenticated','index','get','/:id','put','update','exports','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x1c0d01,_0xadea9f){var _0x3746de=function(_0x27dc27){while(--_0x27dc27){_0x1c0d01['push'](_0x1c0d01['shift']());}};_0x3746de(++_0xadea9f);}(_0x73b7,0x118));var _0x773b=function(_0x4592e6,_0x2f5c9a){_0x4592e6=_0x4592e6-0x0;var _0xfcafb5=_0x73b7[_0x4592e6];return _0xfcafb5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x773b('0x0'));var timeout=require(_0x773b('0x1'));var express=require(_0x773b('0x2'));var router=express[_0x773b('0x3')]();var auth=require(_0x773b('0x4'));var interaction=require(_0x773b('0x5'));var config=require(_0x773b('0x6'));var controller=require(_0x773b('0x7'));router['get']('/',auth[_0x773b('0x8')](),controller[_0x773b('0x9')]);router[_0x773b('0xa')](_0x773b('0xb'),auth[_0x773b('0x8')](),controller['show']);router['post']('/',auth[_0x773b('0x8')](),controller['create']);router[_0x773b('0xc')](_0x773b('0xb'),auth[_0x773b('0x8')](),controller[_0x773b('0xd')]);router['delete']('/:id',auth[_0x773b('0x8')](),controller['destroy']);module[_0x773b('0xe')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 3edcaa5..f16fb85 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 _0xa74f=['keyValue','string','STRING','BOOLEAN','ENUM','customVariable'];(function(_0x57a31f,_0x2cf9fd){var _0x5605d5=function(_0x284550){while(--_0x284550){_0x57a31f['push'](_0x57a31f['shift']());}};_0x5605d5(++_0x2cf9fd);}(_0xa74f,0x9a));var _0xfa74=function(_0x307bf6,_0x55bdd5){_0x307bf6=_0x307bf6-0x0;var _0x2878fc=_0xa74f[_0x307bf6];return _0x2878fc;};'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 +var _0x878f=['exports','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x188a02,_0x3b020f){var _0xea35fd=function(_0x1e42f8){while(--_0x1e42f8){_0x188a02['push'](_0x188a02['shift']());}};_0xea35fd(++_0x3b020f);}(_0x878f,0x173));var _0xf878=function(_0x2781bb,_0x85e121){_0x2781bb=_0x2781bb-0x0;var _0x2ab45c=_0x878f[_0x2781bb];return _0x2ab45c;};'use strict';var Sequelize=require('sequelize');module[_0xf878('0x0')]={'type':{'type':Sequelize[_0xf878('0x1')](_0xf878('0x2'),_0xf878('0x3'),_0xf878('0x4'),_0xf878('0x5')),'defaultValue':_0xf878('0x2')},'content':{'type':Sequelize[_0xf878('0x6')]},'key':{'type':Sequelize[_0xf878('0x6')]},'keyType':{'type':Sequelize[_0xf878('0x1')](_0xf878('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0xf878('0x6')]},'idField':{'type':Sequelize[_0xf878('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index d7b2a57..ceb5fd7 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 _0x9564=['reject','save','then','destroy','error','stack','name','send','index','VtigerField','rawAttributes','keys','query','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','filters','merge','where','map','type','key','VIRTUAL','field','filter','options','count','findAll','rows','params','includeAll','find','catch','create','body','update','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','set'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9564,0xb3));var _0x4956=function(_0x283b55,_0x279bee){_0x283b55=_0x283b55-0x0;var _0x192e58=_0x9564[_0x283b55];return _0x192e58;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4956('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4956('0x1'));var rp=require(_0x4956('0x2'));var moment=require(_0x4956('0x3'));var BPromise=require(_0x4956('0x4'));var Mustache=require('mustache');var util=require(_0x4956('0x5'));var path=require(_0x4956('0x6'));var sox=require(_0x4956('0x7'));var csv=require(_0x4956('0x8'));var ejs=require(_0x4956('0x9'));var fs=require('fs');var _=require(_0x4956('0xa'));var squel=require('squel');var crypto=require(_0x4956('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4956('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4956('0xd'));var Redis=require(_0x4956('0xe'));var authService=require(_0x4956('0xf'));var qs=require(_0x4956('0x10'));var hardwareService=require(_0x4956('0x11'));var logger=require('../../config/logger')(_0x4956('0x12'));var utils=require(_0x4956('0x13'));var config=require(_0x4956('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x541015,_0x2d6411){_0x2d6411=_0x2d6411||0xcc;return function(_0x109e12){if(_0x109e12){return _0x541015[_0x4956('0x15')](_0x2d6411);}return _0x541015[_0x4956('0x16')](_0x2d6411)[_0x4956('0x17')]();};}function respondWithResult(_0x1c3358,_0x185c0c){_0x185c0c=_0x185c0c||0xc8;return function(_0x34d658){if(_0x34d658){return _0x1c3358[_0x4956('0x16')](_0x185c0c)[_0x4956('0x18')](_0x34d658);}};}function respondWithFilteredResult(_0x57b865,_0xea748a){return function(_0x4f81b4){if(_0x4f81b4){var _0x151972=_0x4f81b4['count'],_0x881662=_0xea748a[_0x4956('0x19')],_0x1b660e=_0xea748a[_0x4956('0x19')]+_0xea748a[_0x4956('0x1a')],_0x42db6e;if(_0x1b660e>=_0x151972){_0x1b660e=_0x151972;_0x42db6e=0xc8;}else{_0x42db6e=0xce;}_0x57b865[_0x4956('0x16')](_0x42db6e);return _0x57b865[_0x4956('0x1b')]('Content-Range',_0x881662+'-'+_0x1b660e+'/'+_0x151972)['json'](_0x4f81b4);}return null;};}function patchUpdates(_0x2c0b8b){return function(_0x48d6be){try{jsonpatch['apply'](_0x48d6be,_0x2c0b8b,!![]);}catch(_0x24f405){return BPromise[_0x4956('0x1c')](_0x24f405);}return _0x48d6be[_0x4956('0x1d')]();};}function saveUpdates(_0xeff0b,_0x4edf0a){return function(_0x5447f6){if(_0x5447f6){return _0x5447f6['update'](_0xeff0b)[_0x4956('0x1e')](function(_0x380875){return _0x380875;});}return null;};}function removeEntity(_0x3feb41,_0x5cae14){return function(_0x696c12){if(_0x696c12){return _0x696c12[_0x4956('0x1f')]()[_0x4956('0x1e')](function(){_0x3feb41['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d652d,_0x37e836){return function(_0xe9dec4){if(!_0xe9dec4){_0x2d652d[_0x4956('0x15')](0x194);}return _0xe9dec4;};}function handleError(_0x684a54,_0x65011f){_0x65011f=_0x65011f||0x1f4;return function(_0x5b49cc){logger[_0x4956('0x20')](_0x5b49cc[_0x4956('0x21')]);if(_0x5b49cc['name']){delete _0x5b49cc[_0x4956('0x22')];}_0x684a54[_0x4956('0x16')](_0x65011f)[_0x4956('0x23')](_0x5b49cc);};}exports[_0x4956('0x24')]=function(_0x1c0668,_0x1ae53c){var _0x104c0a={},_0x2668ae={},_0x2fb6eb={'count':0x0,'rows':[]};var _0x2ba46a=db[_0x4956('0x25')][_0x4956('0x26')];_0x2668ae['model']=_[_0x4956('0x27')](_0x2ba46a);_0x2668ae[_0x4956('0x28')]=_['keys'](_0x1c0668[_0x4956('0x28')]);_0x2668ae['filters']=_[_0x4956('0x29')](_0x2668ae[_0x4956('0x2a')],_0x2668ae[_0x4956('0x28')]);_0x104c0a[_0x4956('0x2b')]=_[_0x4956('0x29')](_0x2668ae['model'],qs['fields'](_0x1c0668['query']['fields']));_0x104c0a[_0x4956('0x2b')]=_0x104c0a[_0x4956('0x2b')][_0x4956('0x2c')]?_0x104c0a['attributes']:_0x2668ae[_0x4956('0x2a')];if(!_0x1c0668['query'][_0x4956('0x2d')](_0x4956('0x2e'))){_0x104c0a['limit']=qs[_0x4956('0x1a')](_0x1c0668['query'][_0x4956('0x1a')]);_0x104c0a[_0x4956('0x19')]=qs[_0x4956('0x19')](_0x1c0668[_0x4956('0x28')][_0x4956('0x19')]);}_0x104c0a[_0x4956('0x2f')]=qs[_0x4956('0x30')](_0x1c0668[_0x4956('0x28')][_0x4956('0x30')]);_0x104c0a['where']=qs[_0x4956('0x31')](_['pick'](_0x1c0668['query'],_0x2668ae[_0x4956('0x31')]));if(_0x1c0668['query']['filter']){_0x104c0a['where']=_[_0x4956('0x32')](_0x104c0a[_0x4956('0x33')],{'$or':_[_0x4956('0x34')](_0x2ba46a,function(_0x13abe5){if(_0x13abe5[_0x4956('0x35')][_0x4956('0x36')]!==_0x4956('0x37')){var _0x3f38f6={};_0x3f38f6[_0x13abe5[_0x4956('0x38')]]={'$like':'%'+_0x1c0668[_0x4956('0x28')][_0x4956('0x39')]+'%'};return _0x3f38f6;}})});}_0x104c0a=_['merge']({},_0x104c0a,_0x1c0668[_0x4956('0x3a')]);var _0x542b1c={'where':_0x104c0a['where']};return db['VtigerField'][_0x4956('0x3b')](_0x542b1c)[_0x4956('0x1e')](function(_0x439f9d){_0x2fb6eb[_0x4956('0x3b')]=_0x439f9d;if(_0x1c0668[_0x4956('0x28')]['includeAll']){_0x104c0a['include']=[{'all':!![]}];}return db[_0x4956('0x25')][_0x4956('0x3c')](_0x104c0a);})[_0x4956('0x1e')](function(_0x22471c){_0x2fb6eb[_0x4956('0x3d')]=_0x22471c;return _0x2fb6eb;})[_0x4956('0x1e')](respondWithFilteredResult(_0x1ae53c,_0x104c0a))['catch'](handleError(_0x1ae53c,null));};exports['show']=function(_0x2f765f,_0x518e4d){var _0x51229c={'raw':!![],'where':{'id':_0x2f765f[_0x4956('0x3e')]['id']}},_0x38977c={};_0x38977c[_0x4956('0x2a')]=_[_0x4956('0x27')](db[_0x4956('0x25')]['rawAttributes']);_0x38977c['query']=_['keys'](_0x2f765f[_0x4956('0x28')]);_0x38977c['filters']=_[_0x4956('0x29')](_0x38977c[_0x4956('0x2a')],_0x38977c[_0x4956('0x28')]);_0x51229c[_0x4956('0x2b')]=_[_0x4956('0x29')](_0x38977c[_0x4956('0x2a')],qs['fields'](_0x2f765f[_0x4956('0x28')]['fields']));_0x51229c[_0x4956('0x2b')]=_0x51229c[_0x4956('0x2b')]['length']?_0x51229c['attributes']:_0x38977c[_0x4956('0x2a')];if(_0x2f765f[_0x4956('0x28')][_0x4956('0x3f')]){_0x51229c['include']=[{'all':!![]}];}_0x51229c=_['merge']({},_0x51229c,_0x2f765f['options']);return db[_0x4956('0x25')][_0x4956('0x40')](_0x51229c)[_0x4956('0x1e')](handleEntityNotFound(_0x518e4d,null))[_0x4956('0x1e')](respondWithResult(_0x518e4d,null))[_0x4956('0x41')](handleError(_0x518e4d,null));};exports[_0x4956('0x42')]=function(_0x18cbd8,_0x44bf66){return db['VtigerField'][_0x4956('0x42')](_0x18cbd8[_0x4956('0x43')],{})[_0x4956('0x1e')](respondWithResult(_0x44bf66,0xc9))[_0x4956('0x41')](handleError(_0x44bf66,null));};exports[_0x4956('0x44')]=function(_0x37c013,_0xbce806){if(_0x37c013['body']['id']){delete _0x37c013['body']['id'];}return db['VtigerField'][_0x4956('0x40')]({'where':{'id':_0x37c013['params']['id']}})[_0x4956('0x1e')](handleEntityNotFound(_0xbce806,null))['then'](saveUpdates(_0x37c013[_0x4956('0x43')],null))['then'](respondWithResult(_0xbce806,null))[_0x4956('0x41')](handleError(_0xbce806,null));};exports[_0x4956('0x1f')]=function(_0x3047ba,_0xec1334){return db[_0x4956('0x25')][_0x4956('0x40')]({'where':{'id':_0x3047ba[_0x4956('0x3e')]['id']}})['then'](handleEntityNotFound(_0xec1334,null))[_0x4956('0x1e')](removeEntity(_0xec1334,null))['catch'](handleError(_0xec1334,null));}; \ No newline at end of file +var _0x1553=['sort','filter','where','merge','map','type','field','includeAll','include','findAll','catch','show','params','length','find','create','body','destroy','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','index','VtigerField','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order'];(function(_0x5bb287,_0x2acb67){var _0x2dbf93=function(_0x81456a){while(--_0x81456a){_0x5bb287['push'](_0x5bb287['shift']());}};_0x2dbf93(++_0x2acb67);}(_0x1553,0x17a));var _0x3155=function(_0x24beac,_0x5aa9c9){_0x24beac=_0x24beac-0x0;var _0x4980dd=_0x1553[_0x24beac];return _0x4980dd;};'use strict';var pdf=require(_0x3155('0x0'));var emlformat=require(_0x3155('0x1'));var rimraf=require(_0x3155('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3155('0x3'));var rp=require(_0x3155('0x4'));var moment=require(_0x3155('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3155('0x6'));var path=require(_0x3155('0x7'));var sox=require(_0x3155('0x8'));var csv=require('to-csv');var ejs=require(_0x3155('0x9'));var fs=require('fs');var _=require(_0x3155('0xa'));var squel=require(_0x3155('0xb'));var crypto=require(_0x3155('0xc'));var jsforce=require(_0x3155('0xd'));var deskjs=require(_0x3155('0xe'));var toCsv=require(_0x3155('0xf'));var querystring=require('querystring');var Papa=require(_0x3155('0x10'));var Redis=require(_0x3155('0x11'));var authService=require(_0x3155('0x12'));var qs=require(_0x3155('0x13'));var hardwareService=require(_0x3155('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x3155('0x15'));var config=require(_0x3155('0x16'));var db=require(_0x3155('0x17'))['db'];function respondWithStatusCode(_0x43eb5f,_0x32d741){_0x32d741=_0x32d741||0xcc;return function(_0x498dce){if(_0x498dce){return _0x43eb5f[_0x3155('0x18')](_0x32d741);}return _0x43eb5f[_0x3155('0x19')](_0x32d741)['end']();};}function respondWithResult(_0x3a4822,_0x2d92ad){_0x2d92ad=_0x2d92ad||0xc8;return function(_0x2dfeb0){if(_0x2dfeb0){return _0x3a4822[_0x3155('0x19')](_0x2d92ad)[_0x3155('0x1a')](_0x2dfeb0);}};}function respondWithFilteredResult(_0xf32ac0,_0x267eb9){return function(_0x449a10){if(_0x449a10){var _0x43f257=_0x449a10[_0x3155('0x1b')],_0x1b1bb3=_0x267eb9[_0x3155('0x1c')],_0x31805e=_0x267eb9[_0x3155('0x1c')]+_0x267eb9[_0x3155('0x1d')],_0x452772;if(_0x31805e>=_0x43f257){_0x31805e=_0x43f257;_0x452772=0xc8;}else{_0x452772=0xce;}_0xf32ac0[_0x3155('0x19')](_0x452772);return _0xf32ac0[_0x3155('0x1e')](_0x3155('0x1f'),_0x1b1bb3+'-'+_0x31805e+'/'+_0x43f257)[_0x3155('0x1a')](_0x449a10);}return null;};}function patchUpdates(_0x40d2e8){return function(_0x47717b){try{jsonpatch[_0x3155('0x20')](_0x47717b,_0x40d2e8,!![]);}catch(_0x1c9448){return BPromise[_0x3155('0x21')](_0x1c9448);}return _0x47717b[_0x3155('0x22')]();};}function saveUpdates(_0x5eba8a,_0x9411b6){return function(_0xb75ddf){if(_0xb75ddf){return _0xb75ddf[_0x3155('0x23')](_0x5eba8a)[_0x3155('0x24')](function(_0x3da1f1){return _0x3da1f1;});}return null;};}function removeEntity(_0x366216,_0x2676bc){return function(_0x345355){if(_0x345355){return _0x345355['destroy']()[_0x3155('0x24')](function(){_0x366216[_0x3155('0x19')](0xcc)[_0x3155('0x25')]();});}};}function handleEntityNotFound(_0x4566f9,_0x58a6f2){return function(_0x3abde0){if(!_0x3abde0){_0x4566f9[_0x3155('0x18')](0x194);}return _0x3abde0;};}function handleError(_0x2819bb,_0x366d88){_0x366d88=_0x366d88||0x1f4;return function(_0xe80dc7){logger[_0x3155('0x26')](_0xe80dc7[_0x3155('0x27')]);if(_0xe80dc7[_0x3155('0x28')]){delete _0xe80dc7[_0x3155('0x28')];}_0x2819bb[_0x3155('0x19')](_0x366d88)['send'](_0xe80dc7);};}exports[_0x3155('0x29')]=function(_0x2cbc47,_0x3b4230){var _0x4a3dc6={},_0x27d203={},_0x1f717c={'count':0x0,'rows':[]};var _0xde9d44=db[_0x3155('0x2a')][_0x3155('0x2b')];_0x27d203[_0x3155('0x2c')]=_[_0x3155('0x2d')](_0xde9d44);_0x27d203['query']=_[_0x3155('0x2d')](_0x2cbc47[_0x3155('0x2e')]);_0x27d203[_0x3155('0x2f')]=_['intersection'](_0x27d203['model'],_0x27d203[_0x3155('0x2e')]);_0x4a3dc6['attributes']=_[_0x3155('0x30')](_0x27d203[_0x3155('0x2c')],qs[_0x3155('0x31')](_0x2cbc47['query'][_0x3155('0x31')]));_0x4a3dc6['attributes']=_0x4a3dc6[_0x3155('0x32')]['length']?_0x4a3dc6['attributes']:_0x27d203['model'];if(!_0x2cbc47['query'][_0x3155('0x33')](_0x3155('0x34'))){_0x4a3dc6[_0x3155('0x1d')]=qs[_0x3155('0x1d')](_0x2cbc47[_0x3155('0x2e')][_0x3155('0x1d')]);_0x4a3dc6[_0x3155('0x1c')]=qs[_0x3155('0x1c')](_0x2cbc47['query']['offset']);}_0x4a3dc6[_0x3155('0x35')]=qs[_0x3155('0x36')](_0x2cbc47[_0x3155('0x2e')][_0x3155('0x36')]);_0x4a3dc6['where']=qs['filters'](_['pick'](_0x2cbc47[_0x3155('0x2e')],_0x27d203[_0x3155('0x2f')]));if(_0x2cbc47[_0x3155('0x2e')][_0x3155('0x37')]){_0x4a3dc6[_0x3155('0x38')]=_[_0x3155('0x39')](_0x4a3dc6[_0x3155('0x38')],{'$or':_[_0x3155('0x3a')](_0xde9d44,function(_0x4143fb){if(_0x4143fb[_0x3155('0x3b')]['key']!=='VIRTUAL'){var _0x4f6c30={};_0x4f6c30[_0x4143fb[_0x3155('0x3c')]]={'$like':'%'+_0x2cbc47['query']['filter']+'%'};return _0x4f6c30;}})});}_0x4a3dc6=_[_0x3155('0x39')]({},_0x4a3dc6,_0x2cbc47['options']);var _0x3359f8={'where':_0x4a3dc6[_0x3155('0x38')]};return db['VtigerField'][_0x3155('0x1b')](_0x3359f8)['then'](function(_0x1277de){_0x1f717c[_0x3155('0x1b')]=_0x1277de;if(_0x2cbc47['query'][_0x3155('0x3d')]){_0x4a3dc6[_0x3155('0x3e')]=[{'all':!![]}];}return db[_0x3155('0x2a')][_0x3155('0x3f')](_0x4a3dc6);})[_0x3155('0x24')](function(_0x253fb0){_0x1f717c['rows']=_0x253fb0;return _0x1f717c;})[_0x3155('0x24')](respondWithFilteredResult(_0x3b4230,_0x4a3dc6))[_0x3155('0x40')](handleError(_0x3b4230,null));};exports[_0x3155('0x41')]=function(_0x5d6cd7,_0x21bf3d){var _0x4dc4ca={'raw':!![],'where':{'id':_0x5d6cd7[_0x3155('0x42')]['id']}},_0x24ecd8={};_0x24ecd8[_0x3155('0x2c')]=_[_0x3155('0x2d')](db[_0x3155('0x2a')][_0x3155('0x2b')]);_0x24ecd8[_0x3155('0x2e')]=_[_0x3155('0x2d')](_0x5d6cd7[_0x3155('0x2e')]);_0x24ecd8[_0x3155('0x2f')]=_['intersection'](_0x24ecd8[_0x3155('0x2c')],_0x24ecd8[_0x3155('0x2e')]);_0x4dc4ca[_0x3155('0x32')]=_['intersection'](_0x24ecd8[_0x3155('0x2c')],qs[_0x3155('0x31')](_0x5d6cd7['query'][_0x3155('0x31')]));_0x4dc4ca[_0x3155('0x32')]=_0x4dc4ca[_0x3155('0x32')][_0x3155('0x43')]?_0x4dc4ca[_0x3155('0x32')]:_0x24ecd8[_0x3155('0x2c')];if(_0x5d6cd7[_0x3155('0x2e')][_0x3155('0x3d')]){_0x4dc4ca['include']=[{'all':!![]}];}_0x4dc4ca=_[_0x3155('0x39')]({},_0x4dc4ca,_0x5d6cd7['options']);return db[_0x3155('0x2a')][_0x3155('0x44')](_0x4dc4ca)['then'](handleEntityNotFound(_0x21bf3d,null))[_0x3155('0x24')](respondWithResult(_0x21bf3d,null))[_0x3155('0x40')](handleError(_0x21bf3d,null));};exports[_0x3155('0x45')]=function(_0x4643cb,_0x13d760){return db['VtigerField']['create'](_0x4643cb[_0x3155('0x46')],{})[_0x3155('0x24')](respondWithResult(_0x13d760,0xc9))[_0x3155('0x40')](handleError(_0x13d760,null));};exports[_0x3155('0x23')]=function(_0x523eb4,_0x22d044){if(_0x523eb4[_0x3155('0x46')]['id']){delete _0x523eb4[_0x3155('0x46')]['id'];}return db[_0x3155('0x2a')][_0x3155('0x44')]({'where':{'id':_0x523eb4[_0x3155('0x42')]['id']}})['then'](handleEntityNotFound(_0x22d044,null))[_0x3155('0x24')](saveUpdates(_0x523eb4[_0x3155('0x46')],null))['then'](respondWithResult(_0x22d044,null))[_0x3155('0x40')](handleError(_0x22d044,null));};exports[_0x3155('0x47')]=function(_0x2be114,_0x2a832f){return db[_0x3155('0x2a')]['find']({'where':{'id':_0x2be114[_0x3155('0x42')]['id']}})[_0x3155('0x24')](handleEntityNotFound(_0x2a832f,null))[_0x3155('0x24')](removeEntity(_0x2a832f,null))[_0x3155('0x40')](handleError(_0x2a832f,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 7e8d009..576f27b 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 _0x9977=['exports','define','VtigerField','vtiger_unique_index','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x203a84,_0x1e3cc6){var _0x553825=function(_0x116dae){while(--_0x116dae){_0x203a84['push'](_0x203a84['shift']());}};_0x553825(++_0x1e3cc6);}(_0x9977,0x14a));var _0x7997=function(_0x1d5458,_0x3acf09){_0x1d5458=_0x1d5458-0x0;var _0x9bf6f=_0x9977[_0x1d5458];return _0x9bf6f;};'use strict';var _=require(_0x7997('0x0'));var util=require(_0x7997('0x1'));var logger=require(_0x7997('0x2'))('api');var moment=require(_0x7997('0x3'));var BPromise=require(_0x7997('0x4'));var rp=require(_0x7997('0x5'));var fs=require('fs');var path=require(_0x7997('0x6'));var rimraf=require(_0x7997('0x7'));var config=require('../../config/environment');var attributes=require('./intVtigerField.attributes');module[_0x7997('0x8')]=function(_0x3b5db9,_0x1e9d30){return _0x3b5db9[_0x7997('0x9')](_0x7997('0xa'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x7997('0xb'),'fields':['idField',_0x7997('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe5da=['define','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','./intVtigerField.attributes','exports'];(function(_0x35a290,_0x1e55bf){var _0x51b20b=function(_0xb97083){while(--_0xb97083){_0x35a290['push'](_0x35a290['shift']());}};_0x51b20b(++_0x1e55bf);}(_0xe5da,0xfc));var _0xae5d=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xe5da[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xae5d('0x0'));var util=require('util');var logger=require(_0xae5d('0x1'))('api');var moment=require(_0xae5d('0x2'));var BPromise=require(_0xae5d('0x3'));var rp=require(_0xae5d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xae5d('0x5'));var config=require('../../config/environment');var attributes=require(_0xae5d('0x6'));module[_0xae5d('0x7')]=function(_0x5d6d7c,_0x34b1a7){return _0x5d6d7c[_0xae5d('0x8')]('VtigerField',attributes,{'tableName':_0xae5d('0x9'),'paranoid':![],'indexes':[{'name':_0xae5d('0xa'),'fields':[_0xae5d('0xb'),_0xae5d('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index 79fb76e..8a7ba11 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 _0x3800=['info','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','VtigerField,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x552c25,_0x1ca12a){var _0x247c77=function(_0x2a8cef){while(--_0x2a8cef){_0x552c25['push'](_0x552c25['shift']());}};_0x247c77(++_0x1ca12a);}(_0x3800,0x145));var _0x0380=function(_0x144945,_0x36fea1){_0x144945=_0x144945-0x0;var _0x172ca6=_0x3800[_0x144945];return _0x172ca6;};'use strict';var _=require(_0x0380('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0380('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0380('0x2'));var db=require(_0x0380('0x3'))['db'];var utils=require(_0x0380('0x4'));var logger=require(_0x0380('0x5'))(_0x0380('0x6'));var config=require('../../config/environment');var jayson=require(_0x0380('0x7'));var client=jayson[_0x0380('0x8')][_0x0380('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2afda9,_0x4b4727,_0x5518e2){return new BPromise(function(_0x3561e5,_0x35845a){return client[_0x0380('0xa')](_0x2afda9,_0x5518e2)[_0x0380('0xb')](function(_0x33e5b3){logger['info'](_0x0380('0xc'),_0x4b4727,_0x0380('0xd'));logger['debug']('VtigerField,\x20%s,\x20%s,\x20%s',_0x4b4727,_0x0380('0xd'),JSON['stringify'](_0x33e5b3));if(_0x33e5b3[_0x0380('0xe')]){if(_0x33e5b3[_0x0380('0xe')][_0x0380('0xf')]===0x1f4){logger['error']('VtigerField,\x20%s,\x20%s',_0x4b4727,_0x33e5b3[_0x0380('0xe')]['message']);return _0x35845a(_0x33e5b3[_0x0380('0xe')]['message']);}logger[_0x0380('0xe')](_0x0380('0xc'),_0x4b4727,_0x33e5b3['error'][_0x0380('0x10')]);return _0x3561e5(_0x33e5b3[_0x0380('0xe')][_0x0380('0x10')]);}else{logger[_0x0380('0x11')](_0x0380('0xc'),_0x4b4727,_0x0380('0xd'));_0x3561e5(_0x33e5b3[_0x0380('0x12')][_0x0380('0x10')]);}})['catch'](function(_0x31ffd9){logger[_0x0380('0xe')](_0x0380('0xc'),_0x4b4727,_0x31ffd9);_0x35845a(_0x31ffd9);});});} \ No newline at end of file +var _0xa65c=['stringify','error','code','message','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3256c6,_0x3166f8){var _0x19ae14=function(_0x532a54){while(--_0x532a54){_0x3256c6['push'](_0x3256c6['shift']());}};_0x19ae14(++_0x3166f8);}(_0xa65c,0xf5));var _0xca65=function(_0xc3ad63,_0x4c3e7e){_0xc3ad63=_0xc3ad63-0x0;var _0x191b1b=_0xa65c[_0xc3ad63];return _0x191b1b;};'use strict';var _=require(_0xca65('0x0'));var util=require(_0xca65('0x1'));var moment=require('moment');var BPromise=require(_0xca65('0x2'));var rs=require(_0xca65('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xca65('0x4'))['db'];var utils=require(_0xca65('0x5'));var logger=require(_0xca65('0x6'))(_0xca65('0x7'));var config=require(_0xca65('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xca65('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ea265,_0xed8231,_0xbbc238){return new BPromise(function(_0x362d1a,_0x218701){return client['request'](_0x5ea265,_0xbbc238)[_0xca65('0xa')](function(_0xab043){logger[_0xca65('0xb')](_0xca65('0xc'),_0xed8231,_0xca65('0xd'));logger[_0xca65('0xe')]('VtigerField,\x20%s,\x20%s,\x20%s',_0xed8231,_0xca65('0xd'),JSON[_0xca65('0xf')](_0xab043));if(_0xab043[_0xca65('0x10')]){if(_0xab043[_0xca65('0x10')][_0xca65('0x11')]===0x1f4){logger[_0xca65('0x10')](_0xca65('0xc'),_0xed8231,_0xab043[_0xca65('0x10')][_0xca65('0x12')]);return _0x218701(_0xab043['error'][_0xca65('0x12')]);}logger['error'](_0xca65('0xc'),_0xed8231,_0xab043['error'][_0xca65('0x12')]);return _0x362d1a(_0xab043[_0xca65('0x10')][_0xca65('0x12')]);}else{logger[_0xca65('0xb')](_0xca65('0xc'),_0xed8231,_0xca65('0xd'));_0x362d1a(_0xab043[_0xca65('0x13')][_0xca65('0x12')]);}})['catch'](function(_0x2dcfc0){logger['error'](_0xca65('0xc'),_0xed8231,_0x2dcfc0);_0x218701(_0x2dcfc0);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 9d37399..937cbbc 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 _0x5053=['../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x5da2c5,_0x6306e){var _0x2c0749=function(_0x5cf155){while(--_0x5cf155){_0x5da2c5['push'](_0x5da2c5['shift']());}};_0x2c0749(++_0x6306e);}(_0x5053,0xea));var _0x3505=function(_0x39bfb6,_0x4272c8){_0x39bfb6=_0x39bfb6-0x0;var _0x23fef9=_0x5053[_0x39bfb6];return _0x23fef9;};'use strict';var multer=require(_0x3505('0x0'));var util=require('util');var path=require(_0x3505('0x1'));var timeout=require(_0x3505('0x2'));var express=require(_0x3505('0x3'));var router=express[_0x3505('0x4')]();var auth=require(_0x3505('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3505('0x6'));var controller=require(_0x3505('0x7'));router[_0x3505('0x8')]('/',auth[_0x3505('0x9')](),controller['index']);router[_0x3505('0x8')](_0x3505('0xa'),auth[_0x3505('0x9')](),controller[_0x3505('0xb')]);router[_0x3505('0x8')]('/:id/configurations',auth[_0x3505('0x9')](),controller[_0x3505('0xc')]);router[_0x3505('0x8')](_0x3505('0xd'),auth['isAuthenticated'](),controller[_0x3505('0xe')]);router[_0x3505('0xf')]('/',auth[_0x3505('0x9')](),controller[_0x3505('0x10')]);router[_0x3505('0xf')](_0x3505('0x11'),auth[_0x3505('0x9')](),controller[_0x3505('0x12')]);router[_0x3505('0x13')](_0x3505('0xa'),auth[_0x3505('0x9')](),controller[_0x3505('0x14')]);router[_0x3505('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x3505('0x16')]);module[_0x3505('0x17')]=router; \ No newline at end of file +var _0x2470=['index','isAuthenticated','show','get','/:id/configurations','/:id/fields','getFields','post','put','update','/:id','destroy','exports','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller'];(function(_0x5c3df2,_0x28b3eb){var _0x35a5ea=function(_0x5b6fa5){while(--_0x5b6fa5){_0x5c3df2['push'](_0x5c3df2['shift']());}};_0x35a5ea(++_0x28b3eb);}(_0x2470,0x175));var _0x0247=function(_0x3da614,_0x19c09d){_0x3da614=_0x3da614-0x0;var _0x4a3f96=_0x2470[_0x3da614];return _0x4a3f96;};'use strict';var multer=require('multer');var util=require(_0x0247('0x0'));var path=require(_0x0247('0x1'));var timeout=require(_0x0247('0x2'));var express=require(_0x0247('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x0247('0x4'));var config=require(_0x0247('0x5'));var controller=require(_0x0247('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x0247('0x7')]);router['get']('/:id',auth[_0x0247('0x8')](),controller[_0x0247('0x9')]);router[_0x0247('0xa')](_0x0247('0xb'),auth[_0x0247('0x8')](),controller['getConfigurations']);router[_0x0247('0xa')](_0x0247('0xc'),auth['isAuthenticated'](),controller[_0x0247('0xd')]);router[_0x0247('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0247('0xe')](_0x0247('0xb'),auth[_0x0247('0x8')](),controller['addConfiguration']);router[_0x0247('0xf')]('/:id',auth[_0x0247('0x8')](),controller[_0x0247('0x10')]);router['delete'](_0x0247('0x11'),auth[_0x0247('0x8')](),controller[_0x0247('0x12')]);module[_0x0247('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 8b5d4be..d001ab7 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 _0xf543=['newTab','integrationTab','sequelize','exports','STRING','username','remoteUri','token','password','ENUM'];(function(_0x3ff722,_0x3c907c){var _0x36e252=function(_0x3223c4){while(--_0x3223c4){_0x3ff722['push'](_0x3ff722['shift']());}};_0x36e252(++_0x3c907c);}(_0xf543,0xca));var _0x3f54=function(_0x4ea17e,_0x3e4b25){_0x4ea17e=_0x4ea17e-0x0;var _0x53e4a7=_0xf543[_0x4ea17e];return _0x53e4a7;};'use strict';var Sequelize=require(_0x3f54('0x0'));module[_0x3f54('0x1')]={'name':{'type':Sequelize[_0x3f54('0x2')]},'description':{'type':Sequelize[_0x3f54('0x2')]},'username':{'type':Sequelize[_0x3f54('0x2')],'unique':_0x3f54('0x3')},'password':{'type':Sequelize[_0x3f54('0x2')]},'token':{'type':Sequelize[_0x3f54('0x2')]},'remoteUri':{'type':Sequelize[_0x3f54('0x2')],'unique':_0x3f54('0x4')},'authType':{'type':Sequelize['ENUM']('password',_0x3f54('0x5')),'defaultValue':_0x3f54('0x6')},'serverUrl':{'type':Sequelize[_0x3f54('0x2')]},'type':{'type':Sequelize[_0x3f54('0x7')]('integrationTab',_0x3f54('0x8')),'defaultValue':_0x3f54('0x9')}}; \ No newline at end of file +var _0xae7a=['integrationTab','newTab','sequelize','exports','username','STRING','ENUM','password','token'];(function(_0x1f2797,_0x13cfe3){var _0x2067da=function(_0xfcd7e4){while(--_0xfcd7e4){_0x1f2797['push'](_0x1f2797['shift']());}};_0x2067da(++_0x13cfe3);}(_0xae7a,0x1a0));var _0xaae7=function(_0x5dcbbe,_0x59c21e){_0x5dcbbe=_0x5dcbbe-0x0;var _0x5d8d23=_0xae7a[_0x5dcbbe];return _0x5d8d23;};'use strict';var Sequelize=require(_0xaae7('0x0'));module[_0xaae7('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0xaae7('0x2')},'password':{'type':Sequelize[_0xaae7('0x3')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xaae7('0x3')],'unique':'remoteUri'},'authType':{'type':Sequelize[_0xaae7('0x4')](_0xaae7('0x5'),_0xaae7('0x6')),'defaultValue':_0xaae7('0x5')},'serverUrl':{'type':Sequelize[_0xaae7('0x3')]},'type':{'type':Sequelize[_0xaae7('0x4')](_0xaae7('0x7'),_0xaae7('0x8')),'defaultValue':_0xaae7('0x7')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index fb8408c..4d13f91 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 _0xdb6c=['username','toString','base64','headers','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','includes','title','position','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../mysqldb','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','json','count','limit','status','set','apply','reject','save','update','stack','name','send','index','ZendeskAccount','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','offset','order','sort','where','merge','type','key','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','destroy','getConfigurations','findOne','ZendeskConfiguration','pick','map','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ZendeskField','Descriptions','getFields','token','authType','remoteUri','slice','substring','lastIndexOf','format','%s/%s','ticket_fields','password','Basic\x20%s','%s:%s'];(function(_0x1009fa,_0x40aa84){var _0x2508f9=function(_0x507762){while(--_0x507762){_0x1009fa['push'](_0x1009fa['shift']());}};_0x2508f9(++_0x40aa84);}(_0xdb6c,0x117));var _0xcdb6=function(_0xdf7008,_0x2118b0){_0xdf7008=_0xdf7008-0x0;var _0x13c167=_0xdb6c[_0xdf7008];return _0x13c167;};'use strict';var pdf=require(_0xcdb6('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xcdb6('0x1'));var zipdir=require(_0xcdb6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcdb6('0x3'));var BPromise=require(_0xcdb6('0x4'));var Mustache=require(_0xcdb6('0x5'));var util=require(_0xcdb6('0x6'));var path=require(_0xcdb6('0x7'));var sox=require(_0xcdb6('0x8'));var csv=require('to-csv');var ejs=require(_0xcdb6('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xcdb6('0xa'));var crypto=require(_0xcdb6('0xb'));var jsforce=require(_0xcdb6('0xc'));var deskjs=require(_0xcdb6('0xd'));var toCsv=require(_0xcdb6('0xe'));var querystring=require(_0xcdb6('0xf'));var Papa=require(_0xcdb6('0x10'));var Redis=require('ioredis');var authService=require(_0xcdb6('0x11'));var qs=require(_0xcdb6('0x12'));var hardwareService=require(_0xcdb6('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xcdb6('0x14'));var config=require('../../config/environment');var db=require(_0xcdb6('0x15'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xcdb6('0x16'));var client=jayson['client'][_0xcdb6('0x17')]({'port':0x232a});function checkPasswordPattern(_0x2d2861,_0x2dcf2e,_0x190625){if(_0x190625){var _0x3bf9a1=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3bf9a1[_0xcdb6('0x18')](_0x2dcf2e)){return _0x2d2861;}else{throw new Error(_0xcdb6('0x19'));}}else{return _0x2d2861;}}function respondWithRpcPromise(_0x147c01,_0x50d34a,_0x3e0a87,_0x2c6497){return new BPromise(function(_0x70b2b9,_0x73e5e9){var _0x58338e=_0x2c6497||client;return _0x58338e[_0xcdb6('0x1a')](_0x147c01,_0x3e0a87)[_0xcdb6('0x1b')](function(_0x1b071c){logger[_0xcdb6('0x1c')](_0xcdb6('0x1d'),_0x50d34a,_0xcdb6('0x1e'));logger[_0xcdb6('0x1f')](_0xcdb6('0x20'),_0x50d34a,_0xcdb6('0x1e'),JSON[_0xcdb6('0x21')](_0x1b071c));if(_0x1b071c[_0xcdb6('0x22')]){if(_0x1b071c[_0xcdb6('0x22')][_0xcdb6('0x23')]===0x1f4){logger[_0xcdb6('0x22')](_0xcdb6('0x1d'),_0x50d34a,_0x1b071c[_0xcdb6('0x22')][_0xcdb6('0x24')]);return _0x73e5e9(_0x1b071c[_0xcdb6('0x22')][_0xcdb6('0x24')]);}logger[_0xcdb6('0x22')](_0xcdb6('0x1d'),_0x50d34a,_0x1b071c['error'][_0xcdb6('0x24')]);return _0x70b2b9(_0x1b071c[_0xcdb6('0x22')][_0xcdb6('0x24')]);}else{logger[_0xcdb6('0x1c')](_0xcdb6('0x1d'),_0x50d34a,'request\x20sent');_0x70b2b9(_0x1b071c[_0xcdb6('0x25')][_0xcdb6('0x24')]);}})['catch'](function(_0x44b440){logger[_0xcdb6('0x22')](_0xcdb6('0x1d'),_0x50d34a,_0x44b440);_0x73e5e9(_0x44b440);});});}function respondWithStatusCode(_0x567959,_0x6b9260){_0x6b9260=_0x6b9260||0xcc;return function(_0x379e2a){if(_0x379e2a){return _0x567959[_0xcdb6('0x26')](_0x6b9260);}return _0x567959['status'](_0x6b9260)[_0xcdb6('0x27')]();};}function respondWithResult(_0x413622,_0x1c396e){_0x1c396e=_0x1c396e||0xc8;return function(_0x2e429c){if(_0x2e429c){return _0x413622['status'](_0x1c396e)[_0xcdb6('0x28')](_0x2e429c);}};}function respondWithFilteredResult(_0x24916d,_0x46ce44){return function(_0x21aa5a){if(_0x21aa5a){var _0x2268e4=_0x21aa5a[_0xcdb6('0x29')],_0x178ec6=_0x46ce44['offset'],_0x171792=_0x46ce44['offset']+_0x46ce44[_0xcdb6('0x2a')],_0x4612cf;if(_0x171792>=_0x2268e4){_0x171792=_0x2268e4;_0x4612cf=0xc8;}else{_0x4612cf=0xce;}_0x24916d[_0xcdb6('0x2b')](_0x4612cf);return _0x24916d[_0xcdb6('0x2c')]('Content-Range',_0x178ec6+'-'+_0x171792+'/'+_0x2268e4)['json'](_0x21aa5a);}return null;};}function patchUpdates(_0x29d6f5){return function(_0x3a7aea){try{jsonpatch[_0xcdb6('0x2d')](_0x3a7aea,_0x29d6f5,!![]);}catch(_0x2b0f68){return BPromise[_0xcdb6('0x2e')](_0x2b0f68);}return _0x3a7aea[_0xcdb6('0x2f')]();};}function saveUpdates(_0x5c97de,_0x5e63b9){return function(_0x2874a0){if(_0x2874a0){return _0x2874a0[_0xcdb6('0x30')](_0x5c97de)[_0xcdb6('0x1b')](function(_0xcd08ad){return _0xcd08ad;});}return null;};}function removeEntity(_0x2e7316,_0x4a85d1){return function(_0x147d2d){if(_0x147d2d){return _0x147d2d['destroy']()['then'](function(){_0x2e7316[_0xcdb6('0x2b')](0xcc)[_0xcdb6('0x27')]();});}};}function handleEntityNotFound(_0x1439c3,_0x170257){return function(_0x3c5eec){if(!_0x3c5eec){_0x1439c3['sendStatus'](0x194);}return _0x3c5eec;};}function handleError(_0x1734ad,_0x5efab4){_0x5efab4=_0x5efab4||0x1f4;return function(_0x2effdb){logger[_0xcdb6('0x22')](_0x2effdb[_0xcdb6('0x31')]);if(_0x2effdb[_0xcdb6('0x32')]){delete _0x2effdb[_0xcdb6('0x32')];}_0x1734ad[_0xcdb6('0x2b')](_0x5efab4)[_0xcdb6('0x33')](_0x2effdb);};}exports[_0xcdb6('0x34')]=function(_0x4cb561,_0x4fa760){var _0xfa75ba={},_0x3f0987={},_0x1d6db3={'count':0x0,'rows':[]};var _0x20946c=db[_0xcdb6('0x35')][_0xcdb6('0x36')];_0x3f0987[_0xcdb6('0x37')]=_['keys'](_0x20946c);_0x3f0987[_0xcdb6('0x38')]=_[_0xcdb6('0x39')](_0x4cb561[_0xcdb6('0x38')]);_0x3f0987[_0xcdb6('0x3a')]=_[_0xcdb6('0x3b')](_0x3f0987['model'],_0x3f0987['query']);_0xfa75ba[_0xcdb6('0x3c')]=_[_0xcdb6('0x3b')](_0x3f0987[_0xcdb6('0x37')],qs[_0xcdb6('0x3d')](_0x4cb561[_0xcdb6('0x38')][_0xcdb6('0x3d')]));_0xfa75ba['attributes']=_0xfa75ba['attributes'][_0xcdb6('0x3e')]?_0xfa75ba[_0xcdb6('0x3c')]:_0x3f0987[_0xcdb6('0x37')];if(!_0x4cb561['query'][_0xcdb6('0x3f')]('nolimit')){_0xfa75ba[_0xcdb6('0x2a')]=qs[_0xcdb6('0x2a')](_0x4cb561[_0xcdb6('0x38')][_0xcdb6('0x2a')]);_0xfa75ba[_0xcdb6('0x40')]=qs[_0xcdb6('0x40')](_0x4cb561[_0xcdb6('0x38')][_0xcdb6('0x40')]);}_0xfa75ba[_0xcdb6('0x41')]=qs[_0xcdb6('0x42')](_0x4cb561[_0xcdb6('0x38')][_0xcdb6('0x42')]);_0xfa75ba[_0xcdb6('0x43')]=qs[_0xcdb6('0x3a')](_['pick'](_0x4cb561[_0xcdb6('0x38')],_0x3f0987[_0xcdb6('0x3a')]));if(_0x4cb561[_0xcdb6('0x38')]['filter']){_0xfa75ba[_0xcdb6('0x43')]=_[_0xcdb6('0x44')](_0xfa75ba[_0xcdb6('0x43')],{'$or':_['map'](_0x20946c,function(_0x2b2b75){if(_0x2b2b75[_0xcdb6('0x45')][_0xcdb6('0x46')]!==_0xcdb6('0x47')){var _0x47a3f0={};_0x47a3f0[_0x2b2b75['field']]={'$like':'%'+_0x4cb561[_0xcdb6('0x38')][_0xcdb6('0x48')]+'%'};return _0x47a3f0;}})});}_0xfa75ba=_[_0xcdb6('0x44')]({},_0xfa75ba,_0x4cb561[_0xcdb6('0x49')]);var _0x1a4d5e={'where':_0xfa75ba[_0xcdb6('0x43')]};return db[_0xcdb6('0x35')][_0xcdb6('0x29')](_0x1a4d5e)[_0xcdb6('0x1b')](function(_0x17a2c4){_0x1d6db3[_0xcdb6('0x29')]=_0x17a2c4;if(_0x4cb561[_0xcdb6('0x38')][_0xcdb6('0x4a')]){_0xfa75ba['include']=[{'all':!![]}];}return db[_0xcdb6('0x35')][_0xcdb6('0x4b')](_0xfa75ba);})['then'](function(_0x483bbe){_0x1d6db3[_0xcdb6('0x4c')]=_0x483bbe;return _0x1d6db3;})[_0xcdb6('0x1b')](respondWithFilteredResult(_0x4fa760,_0xfa75ba))[_0xcdb6('0x4d')](handleError(_0x4fa760,null));};exports[_0xcdb6('0x4e')]=function(_0xac13c3,_0x4032e6){var _0x557f9b={'raw':![],'where':{'id':_0xac13c3[_0xcdb6('0x4f')]['id']}},_0x16f26b={};_0x16f26b[_0xcdb6('0x37')]=_[_0xcdb6('0x39')](db['ZendeskAccount'][_0xcdb6('0x36')]);_0x16f26b['query']=_['keys'](_0xac13c3[_0xcdb6('0x38')]);_0x16f26b['filters']=_[_0xcdb6('0x3b')](_0x16f26b[_0xcdb6('0x37')],_0x16f26b[_0xcdb6('0x38')]);_0x557f9b['attributes']=_['intersection'](_0x16f26b[_0xcdb6('0x37')],qs[_0xcdb6('0x3d')](_0xac13c3[_0xcdb6('0x38')][_0xcdb6('0x3d')]));_0x557f9b['attributes']=_0x557f9b[_0xcdb6('0x3c')][_0xcdb6('0x3e')]?_0x557f9b[_0xcdb6('0x3c')]:_0x16f26b[_0xcdb6('0x37')];if(_0xac13c3[_0xcdb6('0x38')][_0xcdb6('0x4a')]){_0x557f9b[_0xcdb6('0x50')]=[{'all':!![]}];}_0x557f9b=_[_0xcdb6('0x44')]({},_0x557f9b,_0xac13c3[_0xcdb6('0x49')]);return db[_0xcdb6('0x35')][_0xcdb6('0x51')](_0x557f9b)[_0xcdb6('0x1b')](handleEntityNotFound(_0x4032e6,null))[_0xcdb6('0x1b')](respondWithResult(_0x4032e6,null))[_0xcdb6('0x4d')](handleError(_0x4032e6,null));};exports[_0xcdb6('0x52')]=function(_0x365e20,_0x368d87){return db['ZendeskAccount'][_0xcdb6('0x52')](_0x365e20['body'],{})[_0xcdb6('0x1b')](respondWithResult(_0x368d87,0xc9))[_0xcdb6('0x4d')](handleError(_0x368d87,null));};exports[_0xcdb6('0x30')]=function(_0x361668,_0x27754c){if(_0x361668[_0xcdb6('0x53')]['id']){delete _0x361668[_0xcdb6('0x53')]['id'];}return db[_0xcdb6('0x35')][_0xcdb6('0x51')]({'where':{'id':_0x361668[_0xcdb6('0x4f')]['id']}})[_0xcdb6('0x1b')](handleEntityNotFound(_0x27754c,null))['then'](saveUpdates(_0x361668['body'],null))['then'](respondWithResult(_0x27754c,null))[_0xcdb6('0x4d')](handleError(_0x27754c,null));};exports[_0xcdb6('0x54')]=function(_0x2fdbd6,_0x580159){return db[_0xcdb6('0x35')]['find']({'where':{'id':_0x2fdbd6[_0xcdb6('0x4f')]['id']}})[_0xcdb6('0x1b')](handleEntityNotFound(_0x580159,null))[_0xcdb6('0x1b')](removeEntity(_0x580159,null))[_0xcdb6('0x4d')](handleError(_0x580159,null));};exports[_0xcdb6('0x55')]=function(_0x169602,_0x3daf5f,_0x1e7adb){var _0x2d2c36={};var _0x5283ee={};var _0x37dc5c;var _0x175b05;return db[_0xcdb6('0x35')][_0xcdb6('0x56')]({'where':{'id':_0x169602[_0xcdb6('0x4f')]['id']}})[_0xcdb6('0x1b')](handleEntityNotFound(_0x3daf5f,null))['then'](function(_0x38b476){if(_0x38b476){_0x37dc5c=_0x38b476;_0x5283ee[_0xcdb6('0x37')]=_[_0xcdb6('0x39')](db[_0xcdb6('0x57')][_0xcdb6('0x36')]);_0x5283ee['query']=_[_0xcdb6('0x39')](_0x169602['query']);_0x5283ee['filters']=_[_0xcdb6('0x3b')](_0x5283ee[_0xcdb6('0x37')],_0x5283ee['query']);_0x2d2c36[_0xcdb6('0x3c')]=_[_0xcdb6('0x3b')](_0x5283ee[_0xcdb6('0x37')],qs[_0xcdb6('0x3d')](_0x169602[_0xcdb6('0x38')][_0xcdb6('0x3d')]));_0x2d2c36['attributes']=_0x2d2c36['attributes'][_0xcdb6('0x3e')]?_0x2d2c36[_0xcdb6('0x3c')]:_0x5283ee[_0xcdb6('0x37')];_0x2d2c36[_0xcdb6('0x41')]=qs[_0xcdb6('0x42')](_0x169602['query'][_0xcdb6('0x42')]);_0x2d2c36[_0xcdb6('0x43')]=qs['filters'](_[_0xcdb6('0x58')](_0x169602[_0xcdb6('0x38')],_0x5283ee[_0xcdb6('0x3a')]));if(_0x169602[_0xcdb6('0x38')][_0xcdb6('0x48')]){_0x2d2c36[_0xcdb6('0x43')]=_['merge'](_0x2d2c36[_0xcdb6('0x43')],{'$or':_[_0xcdb6('0x59')](_0x2d2c36[_0xcdb6('0x3c')],function(_0x1670ae){var _0x1f00f4={};_0x1f00f4[_0x1670ae]={'$like':'%'+_0x169602[_0xcdb6('0x38')][_0xcdb6('0x48')]+'%'};return _0x1f00f4;})});}_0x2d2c36=_[_0xcdb6('0x44')]({},_0x2d2c36,_0x169602[_0xcdb6('0x49')]);return _0x37dc5c[_0xcdb6('0x55')](_0x2d2c36);}})[_0xcdb6('0x1b')](function(_0x21baaf){if(_0x21baaf){_0x175b05=_0x21baaf[_0xcdb6('0x3e')];if(!_0x169602['query'][_0xcdb6('0x3f')]('nolimit')){_0x2d2c36[_0xcdb6('0x2a')]=qs[_0xcdb6('0x2a')](_0x169602[_0xcdb6('0x38')][_0xcdb6('0x2a')]);_0x2d2c36[_0xcdb6('0x40')]=qs['offset'](_0x169602[_0xcdb6('0x38')][_0xcdb6('0x40')]);}return _0x37dc5c[_0xcdb6('0x55')](_0x2d2c36);}})[_0xcdb6('0x1b')](function(_0x57abfc){if(_0x57abfc){return _0x57abfc?{'count':_0x175b05,'rows':_0x57abfc}:null;}})[_0xcdb6('0x1b')](respondWithResult(_0x3daf5f,null))['catch'](handleError(_0x3daf5f,null));};exports[_0xcdb6('0x5a')]=function(_0x5f5956,_0x327d45,_0x55d338){if(_0x5f5956[_0xcdb6('0x53')]['id']){delete _0x5f5956['body']['id'];}return db[_0xcdb6('0x35')]['findOne']({'where':{'id':_0x5f5956['params']['id']}})[_0xcdb6('0x1b')](handleEntityNotFound(_0x327d45,null))[_0xcdb6('0x1b')](function(_0x3bdee2){if(_0x3bdee2){_0x5f5956[_0xcdb6('0x53')][_0xcdb6('0x5b')]=_0x3bdee2['id'];_0x5f5956[_0xcdb6('0x53')][_0xcdb6('0x5c')]=integrations[_0xcdb6('0x5d')](_0x5f5956[_0xcdb6('0x53')][_0xcdb6('0x5e')],_0x5f5956[_0xcdb6('0x53')][_0xcdb6('0x45')]);_0x5f5956['body']['Descriptions']=integrations[_0xcdb6('0x5f')](_0x5f5956['body'][_0xcdb6('0x5e')],_0x5f5956[_0xcdb6('0x53')][_0xcdb6('0x45')]);return db['ZendeskConfiguration'][_0xcdb6('0x52')](_0x5f5956[_0xcdb6('0x53')],{'include':[{'model':db['ZendeskField'],'as':_0xcdb6('0x5c')},{'model':db[_0xcdb6('0x60')],'as':_0xcdb6('0x61')}]});}return null;})['then'](respondWithResult(_0x327d45,null))[_0xcdb6('0x4d')](handleError(_0x327d45,null));};exports[_0xcdb6('0x62')]=function(_0x15e164,_0x22f8fb,_0x1c6d61){var _0xb9216c='';return db[_0xcdb6('0x35')][_0xcdb6('0x56')]({'where':{'id':_0x15e164['params']['id']},'attributes':['id','username','password',_0xcdb6('0x63'),_0xcdb6('0x64'),'remoteUri']})[_0xcdb6('0x1b')](handleEntityNotFound(_0x22f8fb,null))[_0xcdb6('0x1b')](function(_0x375741){if(_0x375741){_0xb9216c=_0x375741[_0xcdb6('0x65')];var _0x266d46=_0xb9216c[_0xcdb6('0x66')](-0x1);if(_0x266d46==='/'){_0xb9216c=_0xb9216c[_0xcdb6('0x67')](0x0,_0xb9216c[_0xcdb6('0x68')](_0x266d46));}var _0x5097da={'method':'GET','uri':util[_0xcdb6('0x69')](_0xcdb6('0x6a'),_0xb9216c,_0xcdb6('0x6b')),'json':!![]};switch(_0x375741[_0xcdb6('0x64')]){case _0xcdb6('0x6c'):_0x5097da['headers']={'Authorization':util[_0xcdb6('0x69')](_0xcdb6('0x6d'),new Buffer(util[_0xcdb6('0x69')](_0xcdb6('0x6e'),_0x375741[_0xcdb6('0x6f')],_0x375741[_0xcdb6('0x6c')]))[_0xcdb6('0x70')](_0xcdb6('0x71')))};break;case _0xcdb6('0x63'):_0x5097da[_0xcdb6('0x72')]={'Authorization':util[_0xcdb6('0x69')](_0xcdb6('0x6d'),new Buffer(util[_0xcdb6('0x69')]('%s/token:%s',_0x375741[_0xcdb6('0x6f')],_0x375741['token']))['toString'](_0xcdb6('0x71')))};break;default:throw new db[(_0xcdb6('0x73'))][(_0xcdb6('0x74'))](_0xcdb6('0x75'));}return rp(_0x5097da);}})[_0xcdb6('0x1b')](function(_0x4d68fa){if(_0x4d68fa){var _0x2fddd9=[_0xcdb6('0x76'),_0xcdb6('0x77'),_0xcdb6('0x78'),_0xcdb6('0x79')];_['remove'](_0x4d68fa[_0xcdb6('0x6b')],function(_0x2df606){return _0x2fddd9[_0xcdb6('0x7a')](_0x2df606[_0xcdb6('0x45')]);});return{'count':_0x4d68fa[_0xcdb6('0x6b')][_0xcdb6('0x3e')],'rows':_[_0xcdb6('0x59')](_0x4d68fa[_0xcdb6('0x6b')],function(_0x44e38a){return{'id':_0x44e38a['id'],'name':_0x44e38a['position']>0x7?_0x44e38a[_0xcdb6('0x7b')]:_0x44e38a[_0xcdb6('0x45')],'custom':_0x44e38a[_0xcdb6('0x7c')]>0x7?!![]:![],'options':_0x44e38a[_0xcdb6('0x7d')]?_0x44e38a[_0xcdb6('0x7d')]:_0x44e38a[_0xcdb6('0x7e')]?_0x44e38a[_0xcdb6('0x7e')]:[]};})};}})[_0xcdb6('0x1b')](respondWithResult(_0x22f8fb,null))[_0xcdb6('0x4d')](function(_0x1ffcdf){var _0x5398d9=_0x15e164[_0xcdb6('0x38')][_0xcdb6('0x18')]?0x1f4:_0x1ffcdf[_0xcdb6('0x7f')]||0x1f4;logger[_0xcdb6('0x22')](_0xcdb6('0x80'),_0xcdb6('0x62'),_0x5398d9,JSON[_0xcdb6('0x21')](_0x1ffcdf));delete _0x1ffcdf[_0xcdb6('0x32')];if(_0x5398d9===0x191){_0x5398d9=0x190;}_0x22f8fb[_0xcdb6('0x2b')](_0x5398d9)['send'](_0x15e164[_0xcdb6('0x38')]['test']?{'message':_0xcdb6('0x81'),'statusCode':_0x1ffcdf[_0xcdb6('0x7f')]}:_0x1ffcdf);});}; \ No newline at end of file +var _0x187c=['update','destroy','sendStatus','stack','index','ZendeskAccount','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','pick','filter','where','merge','map','type','key','VIRTUAL','field','count','include','findAll','rows','rawAttributes','includeAll','options','find','create','body','params','getConfigurations','ZendeskConfiguration','sort','addConfiguration','findOne','Descriptions','getDescriptions','ZendeskField','Subjects','getFields','username','password','token','authType','slice','substring','lastIndexOf','GET','format','ticket_fields','headers','toString','base64','Basic\x20%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','getFields,\x20%s,\x20%s,\x20%s','name','send','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../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~!@#$%^&-_=+[{]}.','then','ZendeskAccount,\x20%s,\x20%s','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','end','status','offset','limit','set','Content-Range','json','apply','reject'];(function(_0x3d234f,_0x5f49ab){var _0x9594b4=function(_0x391b7e){while(--_0x391b7e){_0x3d234f['push'](_0x3d234f['shift']());}};_0x9594b4(++_0x5f49ab);}(_0x187c,0x13c));var _0xc187=function(_0x13b63c,_0x11f1af){_0x13b63c=_0x13b63c-0x0;var _0x1d1d44=_0x187c[_0x13b63c];return _0x1d1d44;};'use strict';var pdf=require(_0xc187('0x0'));var emlformat=require(_0xc187('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xc187('0x2'));var jsonpatch=require(_0xc187('0x3'));var rp=require(_0xc187('0x4'));var moment=require(_0xc187('0x5'));var BPromise=require(_0xc187('0x6'));var Mustache=require(_0xc187('0x7'));var util=require('util');var path=require(_0xc187('0x8'));var sox=require(_0xc187('0x9'));var csv=require(_0xc187('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xc187('0xb'));var crypto=require('crypto');var jsforce=require(_0xc187('0xc'));var deskjs=require(_0xc187('0xd'));var toCsv=require(_0xc187('0xa'));var querystring=require(_0xc187('0xe'));var Papa=require(_0xc187('0xf'));var Redis=require(_0xc187('0x10'));var authService=require(_0xc187('0x11'));var qs=require(_0xc187('0x12'));var hardwareService=require(_0xc187('0x13'));var logger=require(_0xc187('0x14'))(_0xc187('0x15'));var utils=require('../../config/utils');var config=require(_0xc187('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0xc187('0x17'));var jayson=require(_0xc187('0x18'));var client=jayson[_0xc187('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x17ccfc,_0x1e25a9,_0x1ddc5b){if(_0x1ddc5b){var _0x7bea0e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x7bea0e[_0xc187('0x1a')](_0x1e25a9)){return _0x17ccfc;}else{throw new Error(_0xc187('0x1b'));}}else{return _0x17ccfc;}}function respondWithRpcPromise(_0x43b639,_0x1a612d,_0x2ed839,_0x52c8c9){return new BPromise(function(_0x5542a2,_0x5e5e69){var _0x32e7bf=_0x52c8c9||client;return _0x32e7bf['request'](_0x43b639,_0x2ed839)[_0xc187('0x1c')](function(_0x345d26){logger['info'](_0xc187('0x1d'),_0x1a612d,_0xc187('0x1e'));logger['debug'](_0xc187('0x1f'),_0x1a612d,_0xc187('0x1e'),JSON[_0xc187('0x20')](_0x345d26));if(_0x345d26[_0xc187('0x21')]){if(_0x345d26[_0xc187('0x21')][_0xc187('0x22')]===0x1f4){logger[_0xc187('0x21')](_0xc187('0x1d'),_0x1a612d,_0x345d26[_0xc187('0x21')]['message']);return _0x5e5e69(_0x345d26[_0xc187('0x21')]['message']);}logger['error'](_0xc187('0x1d'),_0x1a612d,_0x345d26[_0xc187('0x21')][_0xc187('0x23')]);return _0x5542a2(_0x345d26[_0xc187('0x21')][_0xc187('0x23')]);}else{logger[_0xc187('0x24')](_0xc187('0x1d'),_0x1a612d,_0xc187('0x1e'));_0x5542a2(_0x345d26['result'][_0xc187('0x23')]);}})[_0xc187('0x25')](function(_0x5009c4){logger[_0xc187('0x21')](_0xc187('0x1d'),_0x1a612d,_0x5009c4);_0x5e5e69(_0x5009c4);});});}function respondWithStatusCode(_0x343210,_0x144461){_0x144461=_0x144461||0xcc;return function(_0x494bb1){if(_0x494bb1){return _0x343210['sendStatus'](_0x144461);}return _0x343210['status'](_0x144461)[_0xc187('0x26')]();};}function respondWithResult(_0x1154c9,_0xe1218b){_0xe1218b=_0xe1218b||0xc8;return function(_0x24b358){if(_0x24b358){return _0x1154c9[_0xc187('0x27')](_0xe1218b)['json'](_0x24b358);}};}function respondWithFilteredResult(_0x3235a0,_0x3fd594){return function(_0x407b6c){if(_0x407b6c){var _0x54ee9a=_0x407b6c['count'],_0x1dea5a=_0x3fd594['offset'],_0x2a76c0=_0x3fd594[_0xc187('0x28')]+_0x3fd594[_0xc187('0x29')],_0x2aa47a;if(_0x2a76c0>=_0x54ee9a){_0x2a76c0=_0x54ee9a;_0x2aa47a=0xc8;}else{_0x2aa47a=0xce;}_0x3235a0[_0xc187('0x27')](_0x2aa47a);return _0x3235a0[_0xc187('0x2a')](_0xc187('0x2b'),_0x1dea5a+'-'+_0x2a76c0+'/'+_0x54ee9a)[_0xc187('0x2c')](_0x407b6c);}return null;};}function patchUpdates(_0x5e567b){return function(_0x27b2af){try{jsonpatch[_0xc187('0x2d')](_0x27b2af,_0x5e567b,!![]);}catch(_0x19e805){return BPromise[_0xc187('0x2e')](_0x19e805);}return _0x27b2af['save']();};}function saveUpdates(_0x1b1b17,_0x27c5e6){return function(_0xa6e7f1){if(_0xa6e7f1){return _0xa6e7f1[_0xc187('0x2f')](_0x1b1b17)[_0xc187('0x1c')](function(_0x3e84ad){return _0x3e84ad;});}return null;};}function removeEntity(_0x14ef60,_0x558d3f){return function(_0xa490ae){if(_0xa490ae){return _0xa490ae[_0xc187('0x30')]()[_0xc187('0x1c')](function(){_0x14ef60[_0xc187('0x27')](0xcc)[_0xc187('0x26')]();});}};}function handleEntityNotFound(_0x5c3054,_0x15a97b){return function(_0x43285f){if(!_0x43285f){_0x5c3054[_0xc187('0x31')](0x194);}return _0x43285f;};}function handleError(_0xa7ab6,_0x3130f1){_0x3130f1=_0x3130f1||0x1f4;return function(_0xbcaeb9){logger[_0xc187('0x21')](_0xbcaeb9[_0xc187('0x32')]);if(_0xbcaeb9['name']){delete _0xbcaeb9['name'];}_0xa7ab6['status'](_0x3130f1)['send'](_0xbcaeb9);};}exports[_0xc187('0x33')]=function(_0x5cb0aa,_0x1e64e5){var _0xfe7f2c={},_0x40cdee={},_0x1e78fd={'count':0x0,'rows':[]};var _0x15964a=db[_0xc187('0x34')]['rawAttributes'];_0x40cdee[_0xc187('0x35')]=_[_0xc187('0x36')](_0x15964a);_0x40cdee['query']=_[_0xc187('0x36')](_0x5cb0aa[_0xc187('0x37')]);_0x40cdee[_0xc187('0x38')]=_[_0xc187('0x39')](_0x40cdee[_0xc187('0x35')],_0x40cdee[_0xc187('0x37')]);_0xfe7f2c['attributes']=_[_0xc187('0x39')](_0x40cdee['model'],qs['fields'](_0x5cb0aa[_0xc187('0x37')][_0xc187('0x3a')]));_0xfe7f2c['attributes']=_0xfe7f2c[_0xc187('0x3b')][_0xc187('0x3c')]?_0xfe7f2c[_0xc187('0x3b')]:_0x40cdee[_0xc187('0x35')];if(!_0x5cb0aa[_0xc187('0x37')][_0xc187('0x3d')](_0xc187('0x3e'))){_0xfe7f2c[_0xc187('0x29')]=qs['limit'](_0x5cb0aa[_0xc187('0x37')][_0xc187('0x29')]);_0xfe7f2c[_0xc187('0x28')]=qs[_0xc187('0x28')](_0x5cb0aa[_0xc187('0x37')][_0xc187('0x28')]);}_0xfe7f2c['order']=qs['sort'](_0x5cb0aa[_0xc187('0x37')]['sort']);_0xfe7f2c['where']=qs['filters'](_[_0xc187('0x3f')](_0x5cb0aa[_0xc187('0x37')],_0x40cdee[_0xc187('0x38')]));if(_0x5cb0aa[_0xc187('0x37')][_0xc187('0x40')]){_0xfe7f2c[_0xc187('0x41')]=_[_0xc187('0x42')](_0xfe7f2c[_0xc187('0x41')],{'$or':_[_0xc187('0x43')](_0x15964a,function(_0x50d1c5){if(_0x50d1c5[_0xc187('0x44')][_0xc187('0x45')]!==_0xc187('0x46')){var _0x59de8d={};_0x59de8d[_0x50d1c5[_0xc187('0x47')]]={'$like':'%'+_0x5cb0aa['query'][_0xc187('0x40')]+'%'};return _0x59de8d;}})});}_0xfe7f2c=_['merge']({},_0xfe7f2c,_0x5cb0aa['options']);var _0x4370f6={'where':_0xfe7f2c[_0xc187('0x41')]};return db[_0xc187('0x34')][_0xc187('0x48')](_0x4370f6)['then'](function(_0x3304f5){_0x1e78fd[_0xc187('0x48')]=_0x3304f5;if(_0x5cb0aa[_0xc187('0x37')]['includeAll']){_0xfe7f2c[_0xc187('0x49')]=[{'all':!![]}];}return db[_0xc187('0x34')][_0xc187('0x4a')](_0xfe7f2c);})[_0xc187('0x1c')](function(_0x4aa448){_0x1e78fd[_0xc187('0x4b')]=_0x4aa448;return _0x1e78fd;})['then'](respondWithFilteredResult(_0x1e64e5,_0xfe7f2c))[_0xc187('0x25')](handleError(_0x1e64e5,null));};exports['show']=function(_0x556904,_0x439c75){var _0x2b52f7={'raw':![],'where':{'id':_0x556904['params']['id']}},_0x3d6721={};_0x3d6721[_0xc187('0x35')]=_[_0xc187('0x36')](db[_0xc187('0x34')][_0xc187('0x4c')]);_0x3d6721[_0xc187('0x37')]=_[_0xc187('0x36')](_0x556904['query']);_0x3d6721[_0xc187('0x38')]=_['intersection'](_0x3d6721[_0xc187('0x35')],_0x3d6721[_0xc187('0x37')]);_0x2b52f7['attributes']=_[_0xc187('0x39')](_0x3d6721[_0xc187('0x35')],qs['fields'](_0x556904[_0xc187('0x37')][_0xc187('0x3a')]));_0x2b52f7[_0xc187('0x3b')]=_0x2b52f7[_0xc187('0x3b')][_0xc187('0x3c')]?_0x2b52f7[_0xc187('0x3b')]:_0x3d6721[_0xc187('0x35')];if(_0x556904['query'][_0xc187('0x4d')]){_0x2b52f7['include']=[{'all':!![]}];}_0x2b52f7=_[_0xc187('0x42')]({},_0x2b52f7,_0x556904[_0xc187('0x4e')]);return db[_0xc187('0x34')][_0xc187('0x4f')](_0x2b52f7)['then'](handleEntityNotFound(_0x439c75,null))['then'](respondWithResult(_0x439c75,null))[_0xc187('0x25')](handleError(_0x439c75,null));};exports[_0xc187('0x50')]=function(_0x569af4,_0x2845bd){return db[_0xc187('0x34')][_0xc187('0x50')](_0x569af4[_0xc187('0x51')],{})[_0xc187('0x1c')](respondWithResult(_0x2845bd,0xc9))[_0xc187('0x25')](handleError(_0x2845bd,null));};exports[_0xc187('0x2f')]=function(_0x12eb22,_0x1de006){if(_0x12eb22[_0xc187('0x51')]['id']){delete _0x12eb22[_0xc187('0x51')]['id'];}return db[_0xc187('0x34')][_0xc187('0x4f')]({'where':{'id':_0x12eb22['params']['id']}})['then'](handleEntityNotFound(_0x1de006,null))[_0xc187('0x1c')](saveUpdates(_0x12eb22[_0xc187('0x51')],null))[_0xc187('0x1c')](respondWithResult(_0x1de006,null))[_0xc187('0x25')](handleError(_0x1de006,null));};exports['destroy']=function(_0x42b39c,_0x4be85a){return db[_0xc187('0x34')]['find']({'where':{'id':_0x42b39c[_0xc187('0x52')]['id']}})[_0xc187('0x1c')](handleEntityNotFound(_0x4be85a,null))[_0xc187('0x1c')](removeEntity(_0x4be85a,null))[_0xc187('0x25')](handleError(_0x4be85a,null));};exports[_0xc187('0x53')]=function(_0x572f14,_0xf048cc,_0x13a6b3){var _0x16901b={};var _0x14d9d0={};var _0x47e559;var _0x22d088;return db[_0xc187('0x34')]['findOne']({'where':{'id':_0x572f14[_0xc187('0x52')]['id']}})[_0xc187('0x1c')](handleEntityNotFound(_0xf048cc,null))[_0xc187('0x1c')](function(_0xc4f730){if(_0xc4f730){_0x47e559=_0xc4f730;_0x14d9d0[_0xc187('0x35')]=_['keys'](db[_0xc187('0x54')][_0xc187('0x4c')]);_0x14d9d0[_0xc187('0x37')]=_[_0xc187('0x36')](_0x572f14['query']);_0x14d9d0['filters']=_[_0xc187('0x39')](_0x14d9d0[_0xc187('0x35')],_0x14d9d0[_0xc187('0x37')]);_0x16901b['attributes']=_[_0xc187('0x39')](_0x14d9d0['model'],qs[_0xc187('0x3a')](_0x572f14[_0xc187('0x37')]['fields']));_0x16901b[_0xc187('0x3b')]=_0x16901b[_0xc187('0x3b')][_0xc187('0x3c')]?_0x16901b[_0xc187('0x3b')]:_0x14d9d0[_0xc187('0x35')];_0x16901b['order']=qs['sort'](_0x572f14['query'][_0xc187('0x55')]);_0x16901b['where']=qs[_0xc187('0x38')](_[_0xc187('0x3f')](_0x572f14[_0xc187('0x37')],_0x14d9d0[_0xc187('0x38')]));if(_0x572f14[_0xc187('0x37')][_0xc187('0x40')]){_0x16901b[_0xc187('0x41')]=_['merge'](_0x16901b[_0xc187('0x41')],{'$or':_['map'](_0x16901b[_0xc187('0x3b')],function(_0x4233e0){var _0x5e6167={};_0x5e6167[_0x4233e0]={'$like':'%'+_0x572f14[_0xc187('0x37')][_0xc187('0x40')]+'%'};return _0x5e6167;})});}_0x16901b=_['merge']({},_0x16901b,_0x572f14[_0xc187('0x4e')]);return _0x47e559['getConfigurations'](_0x16901b);}})[_0xc187('0x1c')](function(_0x5e79dd){if(_0x5e79dd){_0x22d088=_0x5e79dd[_0xc187('0x3c')];if(!_0x572f14[_0xc187('0x37')][_0xc187('0x3d')](_0xc187('0x3e'))){_0x16901b[_0xc187('0x29')]=qs[_0xc187('0x29')](_0x572f14[_0xc187('0x37')][_0xc187('0x29')]);_0x16901b[_0xc187('0x28')]=qs[_0xc187('0x28')](_0x572f14[_0xc187('0x37')][_0xc187('0x28')]);}return _0x47e559[_0xc187('0x53')](_0x16901b);}})[_0xc187('0x1c')](function(_0x59e97c){if(_0x59e97c){return _0x59e97c?{'count':_0x22d088,'rows':_0x59e97c}:null;}})[_0xc187('0x1c')](respondWithResult(_0xf048cc,null))[_0xc187('0x25')](handleError(_0xf048cc,null));};exports[_0xc187('0x56')]=function(_0x46891f,_0x5373e0,_0x5f0f92){if(_0x46891f[_0xc187('0x51')]['id']){delete _0x46891f[_0xc187('0x51')]['id'];}return db[_0xc187('0x34')][_0xc187('0x57')]({'where':{'id':_0x46891f[_0xc187('0x52')]['id']}})[_0xc187('0x1c')](handleEntityNotFound(_0x5373e0,null))[_0xc187('0x1c')](function(_0x435c9b){if(_0x435c9b){_0x46891f['body']['AccountId']=_0x435c9b['id'];_0x46891f[_0xc187('0x51')]['Subjects']=integrations['getSubjects'](_0x46891f[_0xc187('0x51')]['channel'],_0x46891f[_0xc187('0x51')][_0xc187('0x44')]);_0x46891f[_0xc187('0x51')][_0xc187('0x58')]=integrations[_0xc187('0x59')](_0x46891f[_0xc187('0x51')]['channel'],_0x46891f[_0xc187('0x51')][_0xc187('0x44')]);return db['ZendeskConfiguration'][_0xc187('0x50')](_0x46891f[_0xc187('0x51')],{'include':[{'model':db[_0xc187('0x5a')],'as':_0xc187('0x5b')},{'model':db['ZendeskField'],'as':_0xc187('0x58')}]});}return null;})[_0xc187('0x1c')](respondWithResult(_0x5373e0,null))[_0xc187('0x25')](handleError(_0x5373e0,null));};exports[_0xc187('0x5c')]=function(_0x2759b6,_0x766c32,_0x1bd2cc){var _0x4c5703='';return db[_0xc187('0x34')]['findOne']({'where':{'id':_0x2759b6[_0xc187('0x52')]['id']},'attributes':['id',_0xc187('0x5d'),_0xc187('0x5e'),_0xc187('0x5f'),_0xc187('0x60'),'remoteUri']})[_0xc187('0x1c')](handleEntityNotFound(_0x766c32,null))[_0xc187('0x1c')](function(_0x2bdee1){if(_0x2bdee1){_0x4c5703=_0x2bdee1['remoteUri'];var _0x132a13=_0x4c5703[_0xc187('0x61')](-0x1);if(_0x132a13==='/'){_0x4c5703=_0x4c5703[_0xc187('0x62')](0x0,_0x4c5703[_0xc187('0x63')](_0x132a13));}var _0x1d4f51={'method':_0xc187('0x64'),'uri':util[_0xc187('0x65')]('%s/%s',_0x4c5703,_0xc187('0x66')),'json':!![]};switch(_0x2bdee1[_0xc187('0x60')]){case _0xc187('0x5e'):_0x1d4f51[_0xc187('0x67')]={'Authorization':util[_0xc187('0x65')]('Basic\x20%s',new Buffer(util['format']('%s:%s',_0x2bdee1[_0xc187('0x5d')],_0x2bdee1[_0xc187('0x5e')]))[_0xc187('0x68')](_0xc187('0x69')))};break;case _0xc187('0x5f'):_0x1d4f51[_0xc187('0x67')]={'Authorization':util[_0xc187('0x65')](_0xc187('0x6a'),new Buffer(util['format']('%s/token:%s',_0x2bdee1[_0xc187('0x5d')],_0x2bdee1['token']))[_0xc187('0x68')](_0xc187('0x69')))};break;default:throw new db[(_0xc187('0x6b'))][(_0xc187('0x6c'))](_0xc187('0x6d'));}return rp(_0x1d4f51);}})[_0xc187('0x1c')](function(_0x3944b5){if(_0x3944b5){var _0x52c619=['subject','description',_0xc187('0x6e'),_0xc187('0x6f')];_[_0xc187('0x70')](_0x3944b5[_0xc187('0x66')],function(_0x1754a5){return _0x52c619[_0xc187('0x71')](_0x1754a5[_0xc187('0x44')]);});return{'count':_0x3944b5[_0xc187('0x66')]['length'],'rows':_[_0xc187('0x43')](_0x3944b5[_0xc187('0x66')],function(_0x15e672){return{'id':_0x15e672['id'],'name':_0x15e672[_0xc187('0x72')]>0x7?_0x15e672[_0xc187('0x73')]:_0x15e672['type'],'custom':_0x15e672[_0xc187('0x72')]>0x7?!![]:![],'options':_0x15e672[_0xc187('0x74')]?_0x15e672[_0xc187('0x74')]:_0x15e672[_0xc187('0x75')]?_0x15e672[_0xc187('0x75')]:[]};})};}})[_0xc187('0x1c')](respondWithResult(_0x766c32,null))['catch'](function(_0x16d5fe){var _0x3269e0=_0x2759b6[_0xc187('0x37')]['test']?0x1f4:_0x16d5fe['statusCode']||0x1f4;logger[_0xc187('0x21')](_0xc187('0x76'),_0xc187('0x5c'),_0x3269e0,JSON[_0xc187('0x20')](_0x16d5fe));delete _0x16d5fe[_0xc187('0x77')];if(_0x3269e0===0x191){_0x3269e0=0x190;}_0x766c32[_0xc187('0x27')](_0x3269e0)[_0xc187('0x78')](_0x2759b6[_0xc187('0x37')][_0xc187('0x1a')]?{'message':'Wrong\x20credentials','statusCode':_0x16d5fe['statusCode']}:_0x16d5fe);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 02a7bab..a5bb943 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 _0x0b91=['./intZendeskAccount.attributes','../../components/integrations/configuration','exports','int_zendesk_accounts','util','../../config/logger','moment','bluebird','request-promise','../../config/environment'];(function(_0x49ab20,_0x204482){var _0x3c10b4=function(_0x654c44){while(--_0x654c44){_0x49ab20['push'](_0x49ab20['shift']());}};_0x3c10b4(++_0x204482);}(_0x0b91,0xae));var _0x10b9=function(_0x5bbec0,_0x3db319){_0x5bbec0=_0x5bbec0-0x0;var _0x4f2eae=_0x0b91[_0x5bbec0];return _0x4f2eae;};'use strict';var _=require('lodash');var util=require(_0x10b9('0x0'));var logger=require(_0x10b9('0x1'))('api');var moment=require(_0x10b9('0x2'));var BPromise=require(_0x10b9('0x3'));var rp=require(_0x10b9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x10b9('0x5'));var attributes=require(_0x10b9('0x6'));var integrations=require(_0x10b9('0x7'));module[_0x10b9('0x8')]=function(_0x54a7b8,_0x1899b7){return _0x54a7b8['define']('ZendeskAccount',attributes,{'tableName':_0x10b9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xea21=['request-promise','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','define','ZendeskAccount','lodash','../../config/logger','api','moment'];(function(_0xd3e12f,_0x412c95){var _0x11d4e5=function(_0x136e1e){while(--_0x136e1e){_0xd3e12f['push'](_0xd3e12f['shift']());}};_0x11d4e5(++_0x412c95);}(_0xea21,0x80));var _0x1ea2=function(_0x10de40,_0x2b063d){_0x10de40=_0x10de40-0x0;var _0x139905=_0xea21[_0x10de40];return _0x139905;};'use strict';var _=require(_0x1ea2('0x0'));var util=require('util');var logger=require(_0x1ea2('0x1'))(_0x1ea2('0x2'));var moment=require(_0x1ea2('0x3'));var BPromise=require('bluebird');var rp=require(_0x1ea2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1ea2('0x5'));var config=require(_0x1ea2('0x6'));var attributes=require(_0x1ea2('0x7'));var integrations=require(_0x1ea2('0x8'));module['exports']=function(_0x350f0a,_0x271848){return _0x350f0a[_0x1ea2('0x9')](_0x1ea2('0xa'),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 69becb6..3bf9325 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 _0x6c25=['ZendeskAccount,\x20%s,\x20%s,\x20%s','error','message','result','ZendeskAccount','options','raw','where','attributes','limit','include','map','model','GetZendeskAccount','stringify','ShowZendeskAccount','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x32c03f,_0x1553b0){var _0x181151=function(_0xf4d7fc){while(--_0xf4d7fc){_0x32c03f['push'](_0x32c03f['shift']());}};_0x181151(++_0x1553b0);}(_0x6c25,0x9d));var _0x56c2=function(_0x3cb783,_0x1e70fa){_0x3cb783=_0x3cb783-0x0;var _0x2b4245=_0x6c25[_0x3cb783];return _0x2b4245;};'use strict';var _=require(_0x56c2('0x0'));var util=require(_0x56c2('0x1'));var moment=require(_0x56c2('0x2'));var BPromise=require(_0x56c2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x56c2('0x4'));var db=require(_0x56c2('0x5'))['db'];var utils=require(_0x56c2('0x6'));var logger=require(_0x56c2('0x7'))(_0x56c2('0x8'));var config=require(_0x56c2('0x9'));var jayson=require(_0x56c2('0xa'));var client=jayson[_0x56c2('0xb')][_0x56c2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x529d50,_0x13249d,_0x3e2670){return new BPromise(function(_0x302e26,_0x449887){return client['request'](_0x529d50,_0x3e2670)[_0x56c2('0xd')](function(_0x183b57){logger[_0x56c2('0xe')](_0x56c2('0xf'),_0x13249d,_0x56c2('0x10'));logger[_0x56c2('0x11')](_0x56c2('0x12'),_0x13249d,_0x56c2('0x10'),JSON['stringify'](_0x183b57));if(_0x183b57[_0x56c2('0x13')]){if(_0x183b57[_0x56c2('0x13')]['code']===0x1f4){logger[_0x56c2('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x13249d,_0x183b57[_0x56c2('0x13')][_0x56c2('0x14')]);return _0x449887(_0x183b57[_0x56c2('0x13')][_0x56c2('0x14')]);}logger['error'](_0x56c2('0xf'),_0x13249d,_0x183b57['error']['message']);return _0x302e26(_0x183b57['error']['message']);}else{logger[_0x56c2('0xe')](_0x56c2('0xf'),_0x13249d,'request\x20sent');_0x302e26(_0x183b57[_0x56c2('0x15')][_0x56c2('0x14')]);}})['catch'](function(_0x4fb634){logger[_0x56c2('0x13')](_0x56c2('0xf'),_0x13249d,_0x4fb634);_0x449887(_0x4fb634);});});}exports['GetZendeskAccount']=function(_0x475c9b){var _0x2a87e0=this;return new Promise(function(_0x18f8bc,_0x362244){return db[_0x56c2('0x16')]['findAll']({'raw':_0x475c9b[_0x56c2('0x17')]?_0x475c9b['options'][_0x56c2('0x18')]===undefined?!![]:![]:!![],'where':_0x475c9b[_0x56c2('0x17')]?_0x475c9b[_0x56c2('0x17')][_0x56c2('0x19')]||null:null,'attributes':_0x475c9b[_0x56c2('0x17')]?_0x475c9b['options'][_0x56c2('0x1a')]||null:null,'limit':_0x475c9b['options']?_0x475c9b[_0x56c2('0x17')][_0x56c2('0x1b')]||null:null,'include':_0x475c9b['options']?_0x475c9b[_0x56c2('0x17')][_0x56c2('0x1c')]?_[_0x56c2('0x1d')](_0x475c9b[_0x56c2('0x17')][_0x56c2('0x1c')],function(_0x424302){return{'model':db[_0x424302[_0x56c2('0x1e')]],'as':_0x424302['as'],'attributes':_0x424302['attributes'],'include':_0x424302[_0x56c2('0x1c')]?_[_0x56c2('0x1d')](_0x424302[_0x56c2('0x1c')],function(_0x4b326f){return{'model':db[_0x4b326f[_0x56c2('0x1e')]],'as':_0x4b326f['as'],'attributes':_0x4b326f[_0x56c2('0x1a')],'include':_0x4b326f['include']?_[_0x56c2('0x1d')](_0x4b326f[_0x56c2('0x1c')],function(_0x14ea10){return{'model':db[_0x14ea10[_0x56c2('0x1e')]],'as':_0x14ea10['as'],'attributes':_0x14ea10[_0x56c2('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x56c2('0xd')](function(_0x2a2a71){logger[_0x56c2('0xe')](_0x56c2('0x1f'),_0x475c9b);logger[_0x56c2('0x11')](_0x56c2('0x1f'),_0x475c9b,JSON[_0x56c2('0x20')](_0x2a2a71));_0x18f8bc(_0x2a2a71);})['catch'](function(_0xf0f454){logger[_0x56c2('0x13')](_0x56c2('0x1f'),_0xf0f454['message'],_0x475c9b);_0x362244(_0x2a87e0[_0x56c2('0x13')](0x1f4,_0xf0f454['message']));});});};exports[_0x56c2('0x21')]=function(_0x13d5ff){var _0x2d4527=this;return new Promise(function(_0x5d63e5,_0x521c58){return db[_0x56c2('0x16')]['find']({'raw':_0x13d5ff[_0x56c2('0x17')]?_0x13d5ff[_0x56c2('0x17')][_0x56c2('0x18')]===undefined?!![]:![]:!![],'where':_0x13d5ff['options']?_0x13d5ff[_0x56c2('0x17')][_0x56c2('0x19')]||null:null,'attributes':_0x13d5ff[_0x56c2('0x17')]?_0x13d5ff['options'][_0x56c2('0x1a')]||null:null,'include':_0x13d5ff[_0x56c2('0x17')]?_0x13d5ff[_0x56c2('0x17')][_0x56c2('0x1c')]?_[_0x56c2('0x1d')](_0x13d5ff[_0x56c2('0x17')][_0x56c2('0x1c')],function(_0x197ac6){return{'model':db[_0x197ac6[_0x56c2('0x1e')]],'as':_0x197ac6['as'],'attributes':_0x197ac6[_0x56c2('0x1a')],'include':_0x197ac6[_0x56c2('0x1c')]?_['map'](_0x197ac6[_0x56c2('0x1c')],function(_0x357f3b){return{'model':db[_0x357f3b[_0x56c2('0x1e')]],'as':_0x357f3b['as'],'attributes':_0x357f3b[_0x56c2('0x1a')],'include':_0x357f3b[_0x56c2('0x1c')]?_[_0x56c2('0x1d')](_0x357f3b[_0x56c2('0x1c')],function(_0x1445b9){return{'model':db[_0x1445b9[_0x56c2('0x1e')]],'as':_0x1445b9['as'],'attributes':_0x1445b9[_0x56c2('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x56c2('0xd')](function(_0x5bba8b){logger['info']('ShowZendeskAccount',_0x13d5ff);logger[_0x56c2('0x11')]('ShowZendeskAccount',_0x13d5ff,JSON[_0x56c2('0x20')](_0x5bba8b));_0x5d63e5(_0x5bba8b);})[_0x56c2('0x22')](function(_0x3e95a9){logger[_0x56c2('0x13')](_0x56c2('0x21'),_0x3e95a9['message'],_0x13d5ff);_0x521c58(_0x2d4527[_0x56c2('0x13')](0x1f4,_0x3e95a9[_0x56c2('0x14')]));});});}; \ No newline at end of file +var _0xd18c=['ZendeskAccount','find','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetZendeskAccount','options','raw','where','map','model','attributes','include','ShowZendeskAccount'];(function(_0x3931d2,_0x124525){var _0xd13e25=function(_0x2fbf25){while(--_0x2fbf25){_0x3931d2['push'](_0x3931d2['shift']());}};_0xd13e25(++_0x124525);}(_0xd18c,0xa2));var _0xcd18=function(_0x30a6d6,_0x603c35){_0x30a6d6=_0x30a6d6-0x0;var _0x361ea1=_0xd18c[_0x30a6d6];return _0x361ea1;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xcd18('0x0'));var rs=require(_0xcd18('0x1'));var fs=require('fs');var Redis=require(_0xcd18('0x2'));var db=require(_0xcd18('0x3'))['db'];var utils=require(_0xcd18('0x4'));var logger=require(_0xcd18('0x5'))(_0xcd18('0x6'));var config=require(_0xcd18('0x7'));var jayson=require(_0xcd18('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xba4023,_0x8ece17,_0x5202de){return new BPromise(function(_0x1dd206,_0x15acd3){return client[_0xcd18('0x9')](_0xba4023,_0x5202de)[_0xcd18('0xa')](function(_0x55c5e7){logger[_0xcd18('0xb')](_0xcd18('0xc'),_0x8ece17,_0xcd18('0xd'));logger[_0xcd18('0xe')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x8ece17,_0xcd18('0xd'),JSON[_0xcd18('0xf')](_0x55c5e7));if(_0x55c5e7[_0xcd18('0x10')]){if(_0x55c5e7[_0xcd18('0x10')][_0xcd18('0x11')]===0x1f4){logger[_0xcd18('0x10')](_0xcd18('0xc'),_0x8ece17,_0x55c5e7[_0xcd18('0x10')][_0xcd18('0x12')]);return _0x15acd3(_0x55c5e7['error'][_0xcd18('0x12')]);}logger[_0xcd18('0x10')](_0xcd18('0xc'),_0x8ece17,_0x55c5e7[_0xcd18('0x10')][_0xcd18('0x12')]);return _0x1dd206(_0x55c5e7[_0xcd18('0x10')][_0xcd18('0x12')]);}else{logger[_0xcd18('0xb')]('ZendeskAccount,\x20%s,\x20%s',_0x8ece17,_0xcd18('0xd'));_0x1dd206(_0x55c5e7[_0xcd18('0x13')][_0xcd18('0x12')]);}})[_0xcd18('0x14')](function(_0x429668){logger[_0xcd18('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x8ece17,_0x429668);_0x15acd3(_0x429668);});});}exports[_0xcd18('0x15')]=function(_0xe34c5a){var _0x40dff0=this;return new Promise(function(_0x5b774d,_0x5adaf6){return db['ZendeskAccount']['findAll']({'raw':_0xe34c5a[_0xcd18('0x16')]?_0xe34c5a[_0xcd18('0x16')][_0xcd18('0x17')]===undefined?!![]:![]:!![],'where':_0xe34c5a['options']?_0xe34c5a[_0xcd18('0x16')][_0xcd18('0x18')]||null:null,'attributes':_0xe34c5a[_0xcd18('0x16')]?_0xe34c5a[_0xcd18('0x16')]['attributes']||null:null,'limit':_0xe34c5a['options']?_0xe34c5a['options']['limit']||null:null,'include':_0xe34c5a[_0xcd18('0x16')]?_0xe34c5a[_0xcd18('0x16')]['include']?_[_0xcd18('0x19')](_0xe34c5a[_0xcd18('0x16')]['include'],function(_0x5a3153){return{'model':db[_0x5a3153[_0xcd18('0x1a')]],'as':_0x5a3153['as'],'attributes':_0x5a3153[_0xcd18('0x1b')],'include':_0x5a3153[_0xcd18('0x1c')]?_[_0xcd18('0x19')](_0x5a3153[_0xcd18('0x1c')],function(_0x5d60a1){return{'model':db[_0x5d60a1['model']],'as':_0x5d60a1['as'],'attributes':_0x5d60a1[_0xcd18('0x1b')],'include':_0x5d60a1[_0xcd18('0x1c')]?_[_0xcd18('0x19')](_0x5d60a1[_0xcd18('0x1c')],function(_0x52cb68){return{'model':db[_0x52cb68[_0xcd18('0x1a')]],'as':_0x52cb68['as'],'attributes':_0x52cb68[_0xcd18('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xcd18('0xa')](function(_0x12662c){logger['info'](_0xcd18('0x15'),_0xe34c5a);logger['debug'](_0xcd18('0x15'),_0xe34c5a,JSON['stringify'](_0x12662c));_0x5b774d(_0x12662c);})['catch'](function(_0x399f55){logger[_0xcd18('0x10')]('GetZendeskAccount',_0x399f55['message'],_0xe34c5a);_0x5adaf6(_0x40dff0['error'](0x1f4,_0x399f55['message']));});});};exports[_0xcd18('0x1d')]=function(_0x362252){var _0x5cd8da=this;return new Promise(function(_0x51ab50,_0x50c3f2){return db[_0xcd18('0x1e')][_0xcd18('0x1f')]({'raw':_0x362252['options']?_0x362252[_0xcd18('0x16')][_0xcd18('0x17')]===undefined?!![]:![]:!![],'where':_0x362252[_0xcd18('0x16')]?_0x362252['options'][_0xcd18('0x18')]||null:null,'attributes':_0x362252['options']?_0x362252['options']['attributes']||null:null,'include':_0x362252[_0xcd18('0x16')]?_0x362252[_0xcd18('0x16')][_0xcd18('0x1c')]?_[_0xcd18('0x19')](_0x362252[_0xcd18('0x16')][_0xcd18('0x1c')],function(_0x4b31dc){return{'model':db[_0x4b31dc[_0xcd18('0x1a')]],'as':_0x4b31dc['as'],'attributes':_0x4b31dc['attributes'],'include':_0x4b31dc['include']?_[_0xcd18('0x19')](_0x4b31dc[_0xcd18('0x1c')],function(_0x325f09){return{'model':db[_0x325f09[_0xcd18('0x1a')]],'as':_0x325f09['as'],'attributes':_0x325f09[_0xcd18('0x1b')],'include':_0x325f09[_0xcd18('0x1c')]?_[_0xcd18('0x19')](_0x325f09[_0xcd18('0x1c')],function(_0x38198b){return{'model':db[_0x38198b[_0xcd18('0x1a')]],'as':_0x38198b['as'],'attributes':_0x38198b[_0xcd18('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4911db){logger['info'](_0xcd18('0x1d'),_0x362252);logger[_0xcd18('0xe')](_0xcd18('0x1d'),_0x362252,JSON[_0xcd18('0xf')](_0x4911db));_0x51ab50(_0x4911db);})[_0xcd18('0x14')](function(_0x2b39c2){logger[_0xcd18('0x10')](_0xcd18('0x1d'),_0x2b39c2[_0xcd18('0x12')],_0x362252);_0x50c3f2(_0x5cd8da['error'](0x1f4,_0x2b39c2[_0xcd18('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 746126c..7b44c0d 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 _0x2c4f=['update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','/:id/tags','getTags','post','setTags','put'];(function(_0x4a3e42,_0x2d37b1){var _0x14b288=function(_0x447bd6){while(--_0x447bd6){_0x4a3e42['push'](_0x4a3e42['shift']());}};_0x14b288(++_0x2d37b1);}(_0x2c4f,0xf4));var _0xf2c4=function(_0x53d0ab,_0x32774c){_0x53d0ab=_0x53d0ab-0x0;var _0x3eae64=_0x2c4f[_0x53d0ab];return _0x3eae64;};'use strict';var multer=require(_0xf2c4('0x0'));var util=require(_0xf2c4('0x1'));var path=require(_0xf2c4('0x2'));var timeout=require('connect-timeout');var express=require(_0xf2c4('0x3'));var router=express[_0xf2c4('0x4')]();var auth=require(_0xf2c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intZendeskConfiguration.controller');router[_0xf2c4('0x6')]('/',auth[_0xf2c4('0x7')](),controller[_0xf2c4('0x8')]);router[_0xf2c4('0x6')](_0xf2c4('0x9'),auth[_0xf2c4('0x7')](),controller[_0xf2c4('0xa')]);router['get'](_0xf2c4('0xb'),auth[_0xf2c4('0x7')](),controller[_0xf2c4('0xc')]);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0xf2c4('0xd')]);router['get'](_0xf2c4('0xe'),auth[_0xf2c4('0x7')](),controller['getDescriptions']);router[_0xf2c4('0x6')](_0xf2c4('0xf'),auth[_0xf2c4('0x7')](),controller[_0xf2c4('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xf2c4('0x11')]('/:id/tags',auth[_0xf2c4('0x7')](),controller[_0xf2c4('0x12')]);router[_0xf2c4('0x13')](_0xf2c4('0x9'),auth[_0xf2c4('0x7')](),controller[_0xf2c4('0x14')]);router[_0xf2c4('0x15')](_0xf2c4('0x9'),auth[_0xf2c4('0x7')](),controller[_0xf2c4('0x16')]);module[_0xf2c4('0x17')]=router; \ No newline at end of file +var _0xeb72=['post','create','/:id/tags','setTags','put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','/:id/descriptions'];(function(_0x2e401f,_0x817487){var _0x148551=function(_0x160fcf){while(--_0x160fcf){_0x2e401f['push'](_0x2e401f['shift']());}};_0x148551(++_0x817487);}(_0xeb72,0x11c));var _0x2eb7=function(_0x329d9,_0x23ffbc){_0x329d9=_0x329d9-0x0;var _0x5afb93=_0xeb72[_0x329d9];return _0x5afb93;};'use strict';var multer=require(_0x2eb7('0x0'));var util=require(_0x2eb7('0x1'));var path=require(_0x2eb7('0x2'));var timeout=require(_0x2eb7('0x3'));var express=require('express');var router=express[_0x2eb7('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x2eb7('0x5'));var config=require('../../config/environment');var controller=require(_0x2eb7('0x6'));router[_0x2eb7('0x7')]('/',auth[_0x2eb7('0x8')](),controller[_0x2eb7('0x9')]);router[_0x2eb7('0x7')](_0x2eb7('0xa'),auth[_0x2eb7('0x8')](),controller[_0x2eb7('0xb')]);router['get']('/:id/fields',auth[_0x2eb7('0x8')](),controller[_0x2eb7('0xc')]);router[_0x2eb7('0x7')](_0x2eb7('0xd'),auth[_0x2eb7('0x8')](),controller['getSubjects']);router[_0x2eb7('0x7')](_0x2eb7('0xe'),auth['isAuthenticated'](),controller['getDescriptions']);router['get']('/:id/tags',auth[_0x2eb7('0x8')](),controller['getTags']);router[_0x2eb7('0xf')]('/',auth[_0x2eb7('0x8')](),controller[_0x2eb7('0x10')]);router[_0x2eb7('0xf')](_0x2eb7('0x11'),auth[_0x2eb7('0x8')](),controller[_0x2eb7('0x12')]);router[_0x2eb7('0x13')](_0x2eb7('0xa'),auth[_0x2eb7('0x8')](),controller[_0x2eb7('0x14')]);router['delete'](_0x2eb7('0xa'),auth[_0x2eb7('0x8')](),controller[_0x2eb7('0x15')]);module[_0x2eb7('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 65f512b..82541c4 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 _0x27d6=['exports','STRING','sequelize'];(function(_0x3a304a,_0x93bbf9){var _0x1757a3=function(_0x3b0b6d){while(--_0x3b0b6d){_0x3a304a['push'](_0x3a304a['shift']());}};_0x1757a3(++_0x93bbf9);}(_0x27d6,0x179));var _0x627d=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x27d6[_0x3b0731];return _0x4204d7;};'use strict';var Sequelize=require(_0x627d('0x0'));module[_0x627d('0x1')]={'name':{'type':Sequelize[_0x627d('0x2')]},'description':{'type':Sequelize[_0x627d('0x2')]}}; \ No newline at end of file +var _0x31dd=['STRING','sequelize'];(function(_0xc6d32b,_0x608367){var _0x5d773a=function(_0x2285cc){while(--_0x2285cc){_0xc6d32b['push'](_0xc6d32b['shift']());}};_0x5d773a(++_0x608367);}(_0x31dd,0xc9));var _0xd31d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x31dd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd31d('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd31d('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index e07989d..60b088b 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(_0x3c674d,_0x36acb2){var _0xd57904=function(_0x4b78c4){while(--_0x4b78c4){_0x3c674d['push'](_0x3c674d['shift']());}};_0xd57904(++_0x36acb2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var 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 _0x70e0=['includeAll','findAll','rows','show','params','options','find','create','body','update','getFields','findOne','hasOwnProperty','getSubjects','getDescriptions','ZendeskField','getTags','setTags','ids','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','request','then','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskConfiguration,\x20%s,\x20%s','info','result','message','catch','status','json','count','offset','set','Content-Range','apply','save','destroy','stack','send','index','ZendeskConfiguration','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','nolimit','limit','order','sort','where','pick','map','type','key','filter','merge'];(function(_0x66ff65,_0x5b2cf0){var _0x3efd54=function(_0x132a03){while(--_0x132a03){_0x66ff65['push'](_0x66ff65['shift']());}};_0x3efd54(++_0x5b2cf0);}(_0x70e0,0x17b));var _0x070e=function(_0x3884bb,_0x1e66ce){_0x3884bb=_0x3884bb-0x0;var _0xb192e6=_0x70e0[_0x3884bb];return _0xb192e6;};'use strict';var pdf=require(_0x070e('0x0'));var emlformat=require(_0x070e('0x1'));var rimraf=require(_0x070e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x070e('0x3'));var moment=require(_0x070e('0x4'));var BPromise=require(_0x070e('0x5'));var Mustache=require(_0x070e('0x6'));var util=require('util');var path=require(_0x070e('0x7'));var sox=require('sox');var csv=require(_0x070e('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x070e('0x9'));var jsforce=require(_0x070e('0xa'));var deskjs=require(_0x070e('0xb'));var toCsv=require(_0x070e('0x8'));var querystring=require(_0x070e('0xc'));var Papa=require(_0x070e('0xd'));var Redis=require(_0x070e('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x070e('0xf'));var logger=require(_0x070e('0x10'))(_0x070e('0x11'));var utils=require(_0x070e('0x12'));var config=require(_0x070e('0x13'));var db=require(_0x070e('0x14'))['db'];var jayson=require(_0x070e('0x15'));var client=jayson[_0x070e('0x16')][_0x070e('0x17')]({'port':0x232a});function checkPasswordPattern(_0x5bf079,_0x2930b8,_0x52da3b){if(_0x52da3b){var _0x5dca0f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5dca0f[_0x070e('0x18')](_0x2930b8)){return _0x5bf079;}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 _0x5bf079;}}function respondWithRpcPromise(_0x4a33d2,_0x5bae0f,_0x11d2ce,_0x14c3fd){return new BPromise(function(_0x51d14d,_0x5d3a38){var _0x373d86=_0x14c3fd||client;return _0x373d86[_0x070e('0x19')](_0x4a33d2,_0x11d2ce)[_0x070e('0x1a')](function(_0x19d9da){logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x5bae0f,_0x070e('0x1b'));logger[_0x070e('0x1c')](_0x070e('0x1d'),_0x5bae0f,_0x070e('0x1b'),JSON[_0x070e('0x1e')](_0x19d9da));if(_0x19d9da['error']){if(_0x19d9da[_0x070e('0x1f')][_0x070e('0x20')]===0x1f4){logger[_0x070e('0x1f')](_0x070e('0x21'),_0x5bae0f,_0x19d9da[_0x070e('0x1f')]['message']);return _0x5d3a38(_0x19d9da['error']['message']);}logger[_0x070e('0x1f')](_0x070e('0x21'),_0x5bae0f,_0x19d9da[_0x070e('0x1f')]['message']);return _0x51d14d(_0x19d9da[_0x070e('0x1f')]['message']);}else{logger[_0x070e('0x22')](_0x070e('0x21'),_0x5bae0f,_0x070e('0x1b'));_0x51d14d(_0x19d9da[_0x070e('0x23')][_0x070e('0x24')]);}})[_0x070e('0x25')](function(_0xe405e){logger[_0x070e('0x1f')]('ZendeskConfiguration,\x20%s,\x20%s',_0x5bae0f,_0xe405e);_0x5d3a38(_0xe405e);});});}function respondWithStatusCode(_0x2f8055,_0x270061){_0x270061=_0x270061||0xcc;return function(_0x4790eb){if(_0x4790eb){return _0x2f8055['sendStatus'](_0x270061);}return _0x2f8055[_0x070e('0x26')](_0x270061)['end']();};}function respondWithResult(_0x4a2dbd,_0x2ccbd7){_0x2ccbd7=_0x2ccbd7||0xc8;return function(_0x25f6e){if(_0x25f6e){return _0x4a2dbd[_0x070e('0x26')](_0x2ccbd7)[_0x070e('0x27')](_0x25f6e);}};}function respondWithFilteredResult(_0x4763c6,_0x497f58){return function(_0x374c54){if(_0x374c54){var _0x219e48=_0x374c54[_0x070e('0x28')],_0x1d72d6=_0x497f58[_0x070e('0x29')],_0x1d2a34=_0x497f58[_0x070e('0x29')]+_0x497f58['limit'],_0x43dd96;if(_0x1d2a34>=_0x219e48){_0x1d2a34=_0x219e48;_0x43dd96=0xc8;}else{_0x43dd96=0xce;}_0x4763c6[_0x070e('0x26')](_0x43dd96);return _0x4763c6[_0x070e('0x2a')](_0x070e('0x2b'),_0x1d72d6+'-'+_0x1d2a34+'/'+_0x219e48)['json'](_0x374c54);}return null;};}function patchUpdates(_0x5c5f0d){return function(_0x13097f){try{jsonpatch[_0x070e('0x2c')](_0x13097f,_0x5c5f0d,!![]);}catch(_0xa6c0ab){return BPromise['reject'](_0xa6c0ab);}return _0x13097f[_0x070e('0x2d')]();};}function saveUpdates(_0x1741a1,_0x3a9425){return function(_0x5f2bee){if(_0x5f2bee){return _0x5f2bee['update'](_0x1741a1)['then'](function(_0x523b75){return _0x523b75;});}return null;};}function removeEntity(_0x59c5b4,_0xdf8945){return function(_0x4e0a7d){if(_0x4e0a7d){return _0x4e0a7d[_0x070e('0x2e')]()[_0x070e('0x1a')](function(){_0x59c5b4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x699739,_0x3454c7){return function(_0x55288a){if(!_0x55288a){_0x699739['sendStatus'](0x194);}return _0x55288a;};}function handleError(_0x41ade4,_0x27dd1f){_0x27dd1f=_0x27dd1f||0x1f4;return function(_0x444d02){logger[_0x070e('0x1f')](_0x444d02[_0x070e('0x2f')]);if(_0x444d02['name']){delete _0x444d02['name'];}_0x41ade4[_0x070e('0x26')](_0x27dd1f)[_0x070e('0x30')](_0x444d02);};}exports[_0x070e('0x31')]=function(_0xf57ed,_0xf11439){var _0x4deaf8={},_0x22f3a9={},_0x1927f4={'count':0x0,'rows':[]};var _0x534150=db[_0x070e('0x32')][_0x070e('0x33')];_0x22f3a9['model']=_['keys'](_0x534150);_0x22f3a9['query']=_[_0x070e('0x34')](_0xf57ed[_0x070e('0x35')]);_0x22f3a9[_0x070e('0x36')]=_[_0x070e('0x37')](_0x22f3a9[_0x070e('0x38')],_0x22f3a9['query']);_0x4deaf8[_0x070e('0x39')]=_[_0x070e('0x37')](_0x22f3a9[_0x070e('0x38')],qs['fields'](_0xf57ed[_0x070e('0x35')][_0x070e('0x3a')]));_0x4deaf8[_0x070e('0x39')]=_0x4deaf8['attributes'][_0x070e('0x3b')]?_0x4deaf8[_0x070e('0x39')]:_0x22f3a9['model'];if(!_0xf57ed[_0x070e('0x35')]['hasOwnProperty'](_0x070e('0x3c'))){_0x4deaf8[_0x070e('0x3d')]=qs[_0x070e('0x3d')](_0xf57ed[_0x070e('0x35')][_0x070e('0x3d')]);_0x4deaf8['offset']=qs[_0x070e('0x29')](_0xf57ed['query']['offset']);}_0x4deaf8[_0x070e('0x3e')]=qs[_0x070e('0x3f')](_0xf57ed[_0x070e('0x35')]['sort']);_0x4deaf8[_0x070e('0x40')]=qs[_0x070e('0x36')](_[_0x070e('0x41')](_0xf57ed[_0x070e('0x35')],_0x22f3a9['filters']));if(_0xf57ed[_0x070e('0x35')]['filter']){_0x4deaf8['where']=_['merge'](_0x4deaf8[_0x070e('0x40')],{'$or':_[_0x070e('0x42')](_0x534150,function(_0x26b3e2){if(_0x26b3e2[_0x070e('0x43')][_0x070e('0x44')]!=='VIRTUAL'){var _0x18607f={};_0x18607f[_0x26b3e2['field']]={'$like':'%'+_0xf57ed[_0x070e('0x35')][_0x070e('0x45')]+'%'};return _0x18607f;}})});}_0x4deaf8=_[_0x070e('0x46')]({},_0x4deaf8,_0xf57ed['options']);var _0x54285a={'where':_0x4deaf8[_0x070e('0x40')]};return db['ZendeskConfiguration'][_0x070e('0x28')](_0x54285a)[_0x070e('0x1a')](function(_0x139820){_0x1927f4['count']=_0x139820;if(_0xf57ed[_0x070e('0x35')][_0x070e('0x47')]){_0x4deaf8['include']=[{'all':!![]}];}return db['ZendeskConfiguration'][_0x070e('0x48')](_0x4deaf8);})[_0x070e('0x1a')](function(_0x2d43ce){_0x1927f4[_0x070e('0x49')]=_0x2d43ce;return _0x1927f4;})[_0x070e('0x1a')](respondWithFilteredResult(_0xf11439,_0x4deaf8))['catch'](handleError(_0xf11439,null));};exports[_0x070e('0x4a')]=function(_0x3f6c64,_0x427fa7){var _0x391dee={'raw':![],'where':{'id':_0x3f6c64[_0x070e('0x4b')]['id']}},_0x79eaa0={};_0x79eaa0[_0x070e('0x38')]=_[_0x070e('0x34')](db[_0x070e('0x32')][_0x070e('0x33')]);_0x79eaa0[_0x070e('0x35')]=_[_0x070e('0x34')](_0x3f6c64[_0x070e('0x35')]);_0x79eaa0[_0x070e('0x36')]=_[_0x070e('0x37')](_0x79eaa0['model'],_0x79eaa0[_0x070e('0x35')]);_0x391dee[_0x070e('0x39')]=_[_0x070e('0x37')](_0x79eaa0[_0x070e('0x38')],qs[_0x070e('0x3a')](_0x3f6c64[_0x070e('0x35')][_0x070e('0x3a')]));_0x391dee[_0x070e('0x39')]=_0x391dee[_0x070e('0x39')]['length']?_0x391dee[_0x070e('0x39')]:_0x79eaa0['model'];if(_0x3f6c64[_0x070e('0x35')][_0x070e('0x47')]){_0x391dee['include']=[{'all':!![]}];}_0x391dee=_[_0x070e('0x46')]({},_0x391dee,_0x3f6c64[_0x070e('0x4c')]);return db[_0x070e('0x32')][_0x070e('0x4d')](_0x391dee)[_0x070e('0x1a')](handleEntityNotFound(_0x427fa7,null))[_0x070e('0x1a')](respondWithResult(_0x427fa7,null))[_0x070e('0x25')](handleError(_0x427fa7,null));};exports['create']=function(_0x296978,_0x5bacbd){return db['ZendeskConfiguration'][_0x070e('0x4e')](_0x296978[_0x070e('0x4f')],{})[_0x070e('0x1a')](respondWithResult(_0x5bacbd,0xc9))[_0x070e('0x25')](handleError(_0x5bacbd,null));};exports[_0x070e('0x50')]=function(_0x7948ed,_0x440fa1){if(_0x7948ed[_0x070e('0x4f')]['id']){delete _0x7948ed['body']['id'];}return db[_0x070e('0x32')]['find']({'where':{'id':_0x7948ed['params']['id']}})[_0x070e('0x1a')](handleEntityNotFound(_0x440fa1,null))[_0x070e('0x1a')](saveUpdates(_0x7948ed['body'],null))[_0x070e('0x1a')](respondWithResult(_0x440fa1,null))[_0x070e('0x25')](handleError(_0x440fa1,null));};exports[_0x070e('0x2e')]=function(_0x2f8104,_0x1aacfc){return db[_0x070e('0x32')][_0x070e('0x4d')]({'where':{'id':_0x2f8104['params']['id']}})['then'](handleEntityNotFound(_0x1aacfc,null))['then'](removeEntity(_0x1aacfc,null))[_0x070e('0x25')](handleError(_0x1aacfc,null));};exports[_0x070e('0x51')]=function(_0x29f497,_0x2f8fcb,_0x5ac0b5){var _0x25f34c={};var _0x5d3c3a={};var _0x212710;var _0x1cbb7e;return db[_0x070e('0x32')][_0x070e('0x52')]({'where':{'id':_0x29f497[_0x070e('0x4b')]['id']}})[_0x070e('0x1a')](handleEntityNotFound(_0x2f8fcb,null))['then'](function(_0x20ff87){if(_0x20ff87){_0x212710=_0x20ff87;_0x5d3c3a[_0x070e('0x38')]=_[_0x070e('0x34')](db['ZendeskField'][_0x070e('0x33')]);_0x5d3c3a[_0x070e('0x35')]=_['keys'](_0x29f497[_0x070e('0x35')]);_0x5d3c3a['filters']=_[_0x070e('0x37')](_0x5d3c3a['model'],_0x5d3c3a['query']);_0x25f34c['attributes']=_[_0x070e('0x37')](_0x5d3c3a[_0x070e('0x38')],qs[_0x070e('0x3a')](_0x29f497[_0x070e('0x35')][_0x070e('0x3a')]));_0x25f34c[_0x070e('0x39')]=_0x25f34c['attributes'][_0x070e('0x3b')]?_0x25f34c['attributes']:_0x5d3c3a[_0x070e('0x38')];_0x25f34c['order']=qs[_0x070e('0x3f')](_0x29f497[_0x070e('0x35')]['sort']);_0x25f34c[_0x070e('0x40')]=qs['filters'](_[_0x070e('0x41')](_0x29f497[_0x070e('0x35')],_0x5d3c3a[_0x070e('0x36')]));if(_0x29f497[_0x070e('0x35')][_0x070e('0x45')]){_0x25f34c[_0x070e('0x40')]=_[_0x070e('0x46')](_0x25f34c[_0x070e('0x40')],{'$or':_[_0x070e('0x42')](_0x25f34c[_0x070e('0x39')],function(_0x40c560){var _0x16887c={};_0x16887c[_0x40c560]={'$like':'%'+_0x29f497[_0x070e('0x35')][_0x070e('0x45')]+'%'};return _0x16887c;})});}_0x25f34c=_['merge']({},_0x25f34c,_0x29f497[_0x070e('0x4c')]);return _0x212710[_0x070e('0x51')](_0x25f34c);}})[_0x070e('0x1a')](function(_0x93301a){if(_0x93301a){_0x1cbb7e=_0x93301a['length'];if(!_0x29f497[_0x070e('0x35')][_0x070e('0x53')](_0x070e('0x3c'))){_0x25f34c[_0x070e('0x3d')]=qs[_0x070e('0x3d')](_0x29f497[_0x070e('0x35')]['limit']);_0x25f34c[_0x070e('0x29')]=qs[_0x070e('0x29')](_0x29f497[_0x070e('0x35')][_0x070e('0x29')]);}return _0x212710['getFields'](_0x25f34c);}})[_0x070e('0x1a')](function(_0x52804d){if(_0x52804d){return _0x52804d?{'count':_0x1cbb7e,'rows':_0x52804d}:null;}})[_0x070e('0x1a')](respondWithResult(_0x2f8fcb,null))[_0x070e('0x25')](handleError(_0x2f8fcb,null));};exports[_0x070e('0x54')]=function(_0x150bf6,_0x2a20d4,_0x50ef9f){var _0x2e48f9={};var _0x2e38c6={};var _0x8cc913;var _0x114bcf;return db['ZendeskConfiguration'][_0x070e('0x52')]({'where':{'id':_0x150bf6['params']['id']}})[_0x070e('0x1a')](handleEntityNotFound(_0x2a20d4,null))[_0x070e('0x1a')](function(_0x1214d2){if(_0x1214d2){_0x8cc913=_0x1214d2;_0x2e38c6['model']=_[_0x070e('0x34')](db['ZendeskField'][_0x070e('0x33')]);_0x2e38c6['query']=_[_0x070e('0x34')](_0x150bf6[_0x070e('0x35')]);_0x2e38c6['filters']=_[_0x070e('0x37')](_0x2e38c6['model'],_0x2e38c6[_0x070e('0x35')]);_0x2e48f9[_0x070e('0x39')]=_['intersection'](_0x2e38c6['model'],qs[_0x070e('0x3a')](_0x150bf6[_0x070e('0x35')][_0x070e('0x3a')]));_0x2e48f9[_0x070e('0x39')]=_0x2e48f9[_0x070e('0x39')][_0x070e('0x3b')]?_0x2e48f9[_0x070e('0x39')]:_0x2e38c6[_0x070e('0x38')];_0x2e48f9[_0x070e('0x3e')]=qs[_0x070e('0x3f')](_0x150bf6[_0x070e('0x35')][_0x070e('0x3f')]);_0x2e48f9[_0x070e('0x40')]=qs['filters'](_[_0x070e('0x41')](_0x150bf6[_0x070e('0x35')],_0x2e38c6['filters']));if(_0x150bf6['query'][_0x070e('0x45')]){_0x2e48f9[_0x070e('0x40')]=_[_0x070e('0x46')](_0x2e48f9[_0x070e('0x40')],{'$or':_[_0x070e('0x42')](_0x2e48f9[_0x070e('0x39')],function(_0x3223a4){var _0x110813={};_0x110813[_0x3223a4]={'$like':'%'+_0x150bf6[_0x070e('0x35')][_0x070e('0x45')]+'%'};return _0x110813;})});}_0x2e48f9=_[_0x070e('0x46')]({},_0x2e48f9,_0x150bf6[_0x070e('0x4c')]);return _0x8cc913[_0x070e('0x54')](_0x2e48f9);}})['then'](function(_0x4f720f){if(_0x4f720f){_0x114bcf=_0x4f720f['length'];if(!_0x150bf6[_0x070e('0x35')][_0x070e('0x53')](_0x070e('0x3c'))){_0x2e48f9[_0x070e('0x3d')]=qs['limit'](_0x150bf6[_0x070e('0x35')][_0x070e('0x3d')]);_0x2e48f9[_0x070e('0x29')]=qs[_0x070e('0x29')](_0x150bf6[_0x070e('0x35')][_0x070e('0x29')]);}return _0x8cc913['getSubjects'](_0x2e48f9);}})[_0x070e('0x1a')](function(_0x5c56bd){if(_0x5c56bd){return _0x5c56bd?{'count':_0x114bcf,'rows':_0x5c56bd}:null;}})[_0x070e('0x1a')](respondWithResult(_0x2a20d4,null))[_0x070e('0x25')](handleError(_0x2a20d4,null));};exports[_0x070e('0x55')]=function(_0x3aa620,_0x117fe4,_0x4a5694){var _0x63e78b={};var _0x15450f={};var _0x5d3bd8;var _0x421392;return db[_0x070e('0x32')]['findOne']({'where':{'id':_0x3aa620[_0x070e('0x4b')]['id']}})[_0x070e('0x1a')](handleEntityNotFound(_0x117fe4,null))[_0x070e('0x1a')](function(_0x4da906){if(_0x4da906){_0x5d3bd8=_0x4da906;_0x15450f[_0x070e('0x38')]=_[_0x070e('0x34')](db[_0x070e('0x56')][_0x070e('0x33')]);_0x15450f[_0x070e('0x35')]=_[_0x070e('0x34')](_0x3aa620[_0x070e('0x35')]);_0x15450f[_0x070e('0x36')]=_[_0x070e('0x37')](_0x15450f[_0x070e('0x38')],_0x15450f[_0x070e('0x35')]);_0x63e78b[_0x070e('0x39')]=_[_0x070e('0x37')](_0x15450f['model'],qs[_0x070e('0x3a')](_0x3aa620[_0x070e('0x35')][_0x070e('0x3a')]));_0x63e78b[_0x070e('0x39')]=_0x63e78b[_0x070e('0x39')][_0x070e('0x3b')]?_0x63e78b['attributes']:_0x15450f['model'];_0x63e78b['order']=qs[_0x070e('0x3f')](_0x3aa620[_0x070e('0x35')][_0x070e('0x3f')]);_0x63e78b[_0x070e('0x40')]=qs['filters'](_[_0x070e('0x41')](_0x3aa620[_0x070e('0x35')],_0x15450f[_0x070e('0x36')]));if(_0x3aa620['query'][_0x070e('0x45')]){_0x63e78b['where']=_[_0x070e('0x46')](_0x63e78b[_0x070e('0x40')],{'$or':_['map'](_0x63e78b['attributes'],function(_0x2048e9){var _0x1fa499={};_0x1fa499[_0x2048e9]={'$like':'%'+_0x3aa620['query'][_0x070e('0x45')]+'%'};return _0x1fa499;})});}_0x63e78b=_['merge']({},_0x63e78b,_0x3aa620['options']);return _0x5d3bd8['getDescriptions'](_0x63e78b);}})[_0x070e('0x1a')](function(_0x283cc4){if(_0x283cc4){_0x421392=_0x283cc4[_0x070e('0x3b')];if(!_0x3aa620[_0x070e('0x35')][_0x070e('0x53')](_0x070e('0x3c'))){_0x63e78b[_0x070e('0x3d')]=qs[_0x070e('0x3d')](_0x3aa620[_0x070e('0x35')][_0x070e('0x3d')]);_0x63e78b[_0x070e('0x29')]=qs[_0x070e('0x29')](_0x3aa620[_0x070e('0x35')][_0x070e('0x29')]);}return _0x5d3bd8[_0x070e('0x55')](_0x63e78b);}})[_0x070e('0x1a')](function(_0x1c6cf3){if(_0x1c6cf3){return _0x1c6cf3?{'count':_0x421392,'rows':_0x1c6cf3}:null;}})[_0x070e('0x1a')](respondWithResult(_0x117fe4,null))[_0x070e('0x25')](handleError(_0x117fe4,null));};exports[_0x070e('0x57')]=function(_0x153a37,_0x3863f2,_0x58f2e8){var _0x4124cc={};var _0x276e6e={};var _0x449337;var _0xe50b1b;return db['ZendeskConfiguration'][_0x070e('0x52')]({'where':{'id':_0x153a37[_0x070e('0x4b')]['id']}})[_0x070e('0x1a')](handleEntityNotFound(_0x3863f2,null))[_0x070e('0x1a')](function(_0x9a5439){if(_0x9a5439){_0x449337=_0x9a5439;_0x276e6e[_0x070e('0x38')]=_['keys'](db['Tag']['rawAttributes']);_0x276e6e[_0x070e('0x35')]=_['keys'](_0x153a37[_0x070e('0x35')]);_0x276e6e[_0x070e('0x36')]=_['intersection'](_0x276e6e[_0x070e('0x38')],_0x276e6e[_0x070e('0x35')]);_0x4124cc['attributes']=_['intersection'](_0x276e6e[_0x070e('0x38')],qs[_0x070e('0x3a')](_0x153a37[_0x070e('0x35')][_0x070e('0x3a')]));_0x4124cc[_0x070e('0x39')]=_0x4124cc['attributes'][_0x070e('0x3b')]?_0x4124cc['attributes']:_0x276e6e[_0x070e('0x38')];_0x4124cc[_0x070e('0x3e')]=qs['sort'](_0x153a37[_0x070e('0x35')][_0x070e('0x3f')]);_0x4124cc[_0x070e('0x40')]=qs[_0x070e('0x36')](_[_0x070e('0x41')](_0x153a37[_0x070e('0x35')],_0x276e6e['filters']));if(_0x153a37[_0x070e('0x35')][_0x070e('0x45')]){_0x4124cc[_0x070e('0x40')]=_[_0x070e('0x46')](_0x4124cc[_0x070e('0x40')],{'$or':_['map'](_0x4124cc[_0x070e('0x39')],function(_0x3f03aa){var _0x35491d={};_0x35491d[_0x3f03aa]={'$like':'%'+_0x153a37[_0x070e('0x35')][_0x070e('0x45')]+'%'};return _0x35491d;})});}_0x4124cc=_[_0x070e('0x46')]({},_0x4124cc,_0x153a37[_0x070e('0x4c')]);return _0x449337[_0x070e('0x57')](_0x4124cc);}})[_0x070e('0x1a')](function(_0xfe61be){if(_0xfe61be){_0xe50b1b=_0xfe61be[_0x070e('0x3b')];if(!_0x153a37[_0x070e('0x35')][_0x070e('0x53')](_0x070e('0x3c'))){_0x4124cc[_0x070e('0x3d')]=qs[_0x070e('0x3d')](_0x153a37['query']['limit']);_0x4124cc[_0x070e('0x29')]=qs[_0x070e('0x29')](_0x153a37['query']['offset']);}return _0x449337['getTags'](_0x4124cc);}})['then'](function(_0x1a430d){if(_0x1a430d){return _0x1a430d?{'count':_0xe50b1b,'rows':_0x1a430d}:null;}})[_0x070e('0x1a')](respondWithResult(_0x3863f2,null))[_0x070e('0x25')](handleError(_0x3863f2,null));};exports[_0x070e('0x58')]=function(_0x409811,_0x3973e8,_0x32cfe3){if(_0x409811[_0x070e('0x4f')]['id']){delete _0x409811[_0x070e('0x4f')]['id'];}return db[_0x070e('0x32')]['findOne']({'where':{'id':_0x409811[_0x070e('0x4b')]['id']}})[_0x070e('0x1a')](handleEntityNotFound(_0x3973e8,null))['then'](function(_0x30db4a){if(_0x30db4a){return _0x30db4a[_0x070e('0x58')](_0x409811[_0x070e('0x4f')][_0x070e('0x59')]||[]);}return null;})['then'](respondWithResult(_0x3973e8,null))[_0x070e('0x25')](handleError(_0x3973e8,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 69c3f55..9993c29 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 _0x65e2=['./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x9f628b,_0x3ed6cc){var _0x5cc98d=function(_0x5e5c33){while(--_0x5e5c33){_0x9f628b['push'](_0x9f628b['shift']());}};_0x5cc98d(++_0x3ed6cc);}(_0x65e2,0x1b7));var _0x265e=function(_0x3d854c,_0x4db344){_0x3d854c=_0x3d854c-0x0;var _0xf5f91f=_0x65e2[_0x3d854c];return _0xf5f91f;};'use strict';var _=require(_0x265e('0x0'));var util=require(_0x265e('0x1'));var logger=require(_0x265e('0x2'))(_0x265e('0x3'));var moment=require(_0x265e('0x4'));var BPromise=require('bluebird');var rp=require(_0x265e('0x5'));var fs=require('fs');var path=require(_0x265e('0x6'));var rimraf=require(_0x265e('0x7'));var config=require(_0x265e('0x8'));var attributes=require(_0x265e('0x9'));module[_0x265e('0xa')]=function(_0x55d7e7,_0x1c3e08){return _0x55d7e7[_0x265e('0xb')](_0x265e('0xc'),attributes,{'tableName':_0x265e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2015=['api','moment','bluebird','request-promise','path','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x2015,0x193));var _0x5201=function(_0x52b82a,_0x17c0eb){_0x52b82a=_0x52b82a-0x0;var _0x294fa0=_0x2015[_0x52b82a];return _0x294fa0;};'use strict';var _=require(_0x5201('0x0'));var util=require(_0x5201('0x1'));var logger=require(_0x5201('0x2'))(_0x5201('0x3'));var moment=require(_0x5201('0x4'));var BPromise=require(_0x5201('0x5'));var rp=require(_0x5201('0x6'));var fs=require('fs');var path=require(_0x5201('0x7'));var rimraf=require('rimraf');var config=require(_0x5201('0x8'));var attributes=require(_0x5201('0x9'));module[_0x5201('0xa')]=function(_0x10e33b,_0xf013a){return _0x10e33b[_0x5201('0xb')](_0x5201('0xc'),attributes,{'tableName':_0x5201('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 324971b..f4c7b5c 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 _0x0b93=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x0b93,0x163));var _0x30b9=function(_0x13137d,_0x5bf826){_0x13137d=_0x13137d-0x0;var _0x189591=_0x0b93[_0x13137d];return _0x189591;};'use strict';var _=require(_0x30b9('0x0'));var util=require(_0x30b9('0x1'));var moment=require(_0x30b9('0x2'));var BPromise=require(_0x30b9('0x3'));var rs=require(_0x30b9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x30b9('0x5'))['db'];var utils=require(_0x30b9('0x6'));var logger=require(_0x30b9('0x7'))(_0x30b9('0x8'));var config=require(_0x30b9('0x9'));var jayson=require(_0x30b9('0xa'));var client=jayson[_0x30b9('0xb')][_0x30b9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x20d18b,_0x926e79,_0x465bbd){return new BPromise(function(_0x52fdb0,_0x31d9f1){return client[_0x30b9('0xd')](_0x20d18b,_0x465bbd)[_0x30b9('0xe')](function(_0x17fe45){logger[_0x30b9('0xf')]('ZendeskConfiguration,\x20%s,\x20%s',_0x926e79,_0x30b9('0x10'));logger[_0x30b9('0x11')](_0x30b9('0x12'),_0x926e79,_0x30b9('0x10'),JSON[_0x30b9('0x13')](_0x17fe45));if(_0x17fe45[_0x30b9('0x14')]){if(_0x17fe45['error'][_0x30b9('0x15')]===0x1f4){logger[_0x30b9('0x14')](_0x30b9('0x16'),_0x926e79,_0x17fe45[_0x30b9('0x14')][_0x30b9('0x17')]);return _0x31d9f1(_0x17fe45[_0x30b9('0x14')]['message']);}logger[_0x30b9('0x14')](_0x30b9('0x16'),_0x926e79,_0x17fe45['error'][_0x30b9('0x17')]);return _0x52fdb0(_0x17fe45['error']['message']);}else{logger[_0x30b9('0xf')](_0x30b9('0x16'),_0x926e79,_0x30b9('0x10'));_0x52fdb0(_0x17fe45[_0x30b9('0x18')][_0x30b9('0x17')]);}})[_0x30b9('0x19')](function(_0x52248e){logger['error'](_0x30b9('0x16'),_0x926e79,_0x52248e);_0x31d9f1(_0x52248e);});});} \ No newline at end of file +var _0x0dd6=['code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x3d3ac0,_0x18567f){var _0xcb2230=function(_0x147331){while(--_0x147331){_0x3d3ac0['push'](_0x3d3ac0['shift']());}};_0xcb2230(++_0x18567f);}(_0x0dd6,0xae));var _0x60dd=function(_0x256d64,_0x102962){_0x256d64=_0x256d64-0x0;var _0x31d8a3=_0x0dd6[_0x256d64];return _0x31d8a3;};'use strict';var _=require(_0x60dd('0x0'));var util=require(_0x60dd('0x1'));var moment=require(_0x60dd('0x2'));var BPromise=require(_0x60dd('0x3'));var rs=require(_0x60dd('0x4'));var fs=require('fs');var Redis=require(_0x60dd('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x60dd('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x60dd('0x7'));var jayson=require(_0x60dd('0x8'));var client=jayson[_0x60dd('0x9')][_0x60dd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x42e1e8,_0x24d1d0,_0x29dfd0){return new BPromise(function(_0x668cc8,_0x451717){return client['request'](_0x42e1e8,_0x29dfd0)['then'](function(_0x3c6b11){logger[_0x60dd('0xb')](_0x60dd('0xc'),_0x24d1d0,_0x60dd('0xd'));logger[_0x60dd('0xe')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x24d1d0,_0x60dd('0xd'),JSON['stringify'](_0x3c6b11));if(_0x3c6b11[_0x60dd('0xf')]){if(_0x3c6b11[_0x60dd('0xf')][_0x60dd('0x10')]===0x1f4){logger['error'](_0x60dd('0xc'),_0x24d1d0,_0x3c6b11[_0x60dd('0xf')][_0x60dd('0x11')]);return _0x451717(_0x3c6b11['error'][_0x60dd('0x11')]);}logger[_0x60dd('0xf')](_0x60dd('0xc'),_0x24d1d0,_0x3c6b11[_0x60dd('0xf')]['message']);return _0x668cc8(_0x3c6b11[_0x60dd('0xf')]['message']);}else{logger[_0x60dd('0xb')](_0x60dd('0xc'),_0x24d1d0,_0x60dd('0xd'));_0x668cc8(_0x3c6b11[_0x60dd('0x12')][_0x60dd('0x11')]);}})['catch'](function(_0x3768e0){logger['error'](_0x60dd('0xc'),_0x24d1d0,_0x3768e0);_0x451717(_0x3768e0);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index efb0795..9303260 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 _0xa9e0=['/:id','update','delete','multer','util','path','Router','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated'];(function(_0x4247e2,_0x48b9e8){var _0x2f6f20=function(_0x1a62a7){while(--_0x1a62a7){_0x4247e2['push'](_0x4247e2['shift']());}};_0x2f6f20(++_0x48b9e8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['show']);router['post']('/',auth[_0x0a9e('0x8')](),controller['create']);router['put'](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xa')]);router[_0x0a9e('0xb')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xa9e0=['/:id','update','delete','multer','util','path','Router','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated'];(function(_0x139349,_0x2fe9dc){var _0x3d8333=function(_0x53a991){while(--_0x53a991){_0x139349['push'](_0x139349['shift']());}};_0x3d8333(++_0x2fe9dc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['show']);router['post']('/',auth[_0x0a9e('0x8')](),controller['create']);router['put'](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xa')]);router[_0x0a9e('0xb')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index af67206..cabf3a4 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 _0x6c76=['customVariable','STRING','string','BOOLEAN','sequelize','exports','ENUM','variable'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x6c76,0x184));var _0x66c7=function(_0x47cfb2,_0x550212){_0x47cfb2=_0x47cfb2-0x0;var _0x1d5212=_0x6c76[_0x47cfb2];return _0x1d5212;};'use strict';var Sequelize=require(_0x66c7('0x0'));module[_0x66c7('0x1')]={'type':{'type':Sequelize[_0x66c7('0x2')]('string',_0x66c7('0x3'),_0x66c7('0x4'),'keyValue'),'defaultValue':'string'},'content':{'type':Sequelize[_0x66c7('0x5')]},'key':{'type':Sequelize[_0x66c7('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x66c7('0x6'),_0x66c7('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x66c7('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x66c7('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x66c7('0x5')]}}; \ No newline at end of file +var _0x878f=['exports','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x4f5e47,_0x2a742e){var _0x14a9fb=function(_0x3f2bc0){while(--_0x3f2bc0){_0x4f5e47['push'](_0x4f5e47['shift']());}};_0x14a9fb(++_0x2a742e);}(_0x878f,0x173));var _0xf878=function(_0x4982d8,_0x52ee75){_0x4982d8=_0x4982d8-0x0;var _0x344022=_0x878f[_0x4982d8];return _0x344022;};'use strict';var Sequelize=require('sequelize');module[_0xf878('0x0')]={'type':{'type':Sequelize[_0xf878('0x1')](_0xf878('0x2'),_0xf878('0x3'),_0xf878('0x4'),_0xf878('0x5')),'defaultValue':_0xf878('0x2')},'content':{'type':Sequelize[_0xf878('0x6')]},'key':{'type':Sequelize[_0xf878('0x6')]},'keyType':{'type':Sequelize[_0xf878('0x1')](_0xf878('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0xf878('0x6')]},'idField':{'type':Sequelize[_0xf878('0x6')]},'nameField':{'type':Sequelize['STRING']},'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 49c7bd2..9fb86a4 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 _0x5301=['create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','apply','reject','update','then','destroy','end','error','stack','name','send','index','ZendeskField','rawAttributes','keys','query','intersection','model','attributes','fields','hasOwnProperty','limit','order','sort','filters','filter','where','merge','key','VIRTUAL','field','options','includeAll','catch','show','params','length','include'];(function(_0x9bdf80,_0xcdf775){var _0x47240b=function(_0x307595){while(--_0x307595){_0x9bdf80['push'](_0x9bdf80['shift']());}};_0x47240b(++_0xcdf775);}(_0x5301,0x157));var _0x1530=function(_0x598b97,_0x316ea0){_0x598b97=_0x598b97-0x0;var _0x4fe5fe=_0x5301[_0x598b97];return _0x4fe5fe;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1530('0x0'));var rimraf=require(_0x1530('0x1'));var zipdir=require(_0x1530('0x2'));var jsonpatch=require(_0x1530('0x3'));var rp=require(_0x1530('0x4'));var moment=require('moment');var BPromise=require(_0x1530('0x5'));var Mustache=require(_0x1530('0x6'));var util=require(_0x1530('0x7'));var path=require(_0x1530('0x8'));var sox=require('sox');var csv=require(_0x1530('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1530('0xa'));var squel=require('squel');var crypto=require(_0x1530('0xb'));var jsforce=require(_0x1530('0xc'));var deskjs=require(_0x1530('0xd'));var toCsv=require(_0x1530('0x9'));var querystring=require(_0x1530('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1530('0xf'));var qs=require(_0x1530('0x10'));var hardwareService=require(_0x1530('0x11'));var logger=require(_0x1530('0x12'))('api');var utils=require(_0x1530('0x13'));var config=require(_0x1530('0x14'));var db=require(_0x1530('0x15'))['db'];function respondWithStatusCode(_0xb798f6,_0x49cadd){_0x49cadd=_0x49cadd||0xcc;return function(_0x59c366){if(_0x59c366){return _0xb798f6[_0x1530('0x16')](_0x49cadd);}return _0xb798f6[_0x1530('0x17')](_0x49cadd)['end']();};}function respondWithResult(_0x34f280,_0xbdc8b5){_0xbdc8b5=_0xbdc8b5||0xc8;return function(_0x4996fb){if(_0x4996fb){return _0x34f280[_0x1530('0x17')](_0xbdc8b5)[_0x1530('0x18')](_0x4996fb);}};}function respondWithFilteredResult(_0x40ec08,_0x190f8c){return function(_0x243bae){if(_0x243bae){var _0x35fa38=_0x243bae[_0x1530('0x19')],_0x72bdc0=_0x190f8c[_0x1530('0x1a')],_0x17d96d=_0x190f8c[_0x1530('0x1a')]+_0x190f8c['limit'],_0xa790ea;if(_0x17d96d>=_0x35fa38){_0x17d96d=_0x35fa38;_0xa790ea=0xc8;}else{_0xa790ea=0xce;}_0x40ec08[_0x1530('0x17')](_0xa790ea);return _0x40ec08[_0x1530('0x1b')]('Content-Range',_0x72bdc0+'-'+_0x17d96d+'/'+_0x35fa38)['json'](_0x243bae);}return null;};}function patchUpdates(_0x502144){return function(_0x51714b){try{jsonpatch[_0x1530('0x1c')](_0x51714b,_0x502144,!![]);}catch(_0x82afb4){return BPromise[_0x1530('0x1d')](_0x82afb4);}return _0x51714b['save']();};}function saveUpdates(_0xc6efa8,_0xa5f085){return function(_0x5c9002){if(_0x5c9002){return _0x5c9002[_0x1530('0x1e')](_0xc6efa8)[_0x1530('0x1f')](function(_0x23871a){return _0x23871a;});}return null;};}function removeEntity(_0x34abec,_0x3c8454){return function(_0x5e5bc4){if(_0x5e5bc4){return _0x5e5bc4[_0x1530('0x20')]()[_0x1530('0x1f')](function(){_0x34abec['status'](0xcc)[_0x1530('0x21')]();});}};}function handleEntityNotFound(_0x3bb27a,_0x369470){return function(_0x352cc9){if(!_0x352cc9){_0x3bb27a[_0x1530('0x16')](0x194);}return _0x352cc9;};}function handleError(_0x395694,_0x3a1c5d){_0x3a1c5d=_0x3a1c5d||0x1f4;return function(_0x1af6a1){logger[_0x1530('0x22')](_0x1af6a1[_0x1530('0x23')]);if(_0x1af6a1['name']){delete _0x1af6a1[_0x1530('0x24')];}_0x395694[_0x1530('0x17')](_0x3a1c5d)[_0x1530('0x25')](_0x1af6a1);};}exports[_0x1530('0x26')]=function(_0x5a8f03,_0x3d4844){var _0x33f342={},_0x3e1cd6={},_0x2f180a={'count':0x0,'rows':[]};var _0x1e3e81=db[_0x1530('0x27')][_0x1530('0x28')];_0x3e1cd6['model']=_[_0x1530('0x29')](_0x1e3e81);_0x3e1cd6['query']=_[_0x1530('0x29')](_0x5a8f03[_0x1530('0x2a')]);_0x3e1cd6['filters']=_[_0x1530('0x2b')](_0x3e1cd6[_0x1530('0x2c')],_0x3e1cd6[_0x1530('0x2a')]);_0x33f342[_0x1530('0x2d')]=_[_0x1530('0x2b')](_0x3e1cd6['model'],qs[_0x1530('0x2e')](_0x5a8f03[_0x1530('0x2a')][_0x1530('0x2e')]));_0x33f342[_0x1530('0x2d')]=_0x33f342[_0x1530('0x2d')]['length']?_0x33f342['attributes']:_0x3e1cd6['model'];if(!_0x5a8f03['query'][_0x1530('0x2f')]('nolimit')){_0x33f342['limit']=qs[_0x1530('0x30')](_0x5a8f03[_0x1530('0x2a')]['limit']);_0x33f342[_0x1530('0x1a')]=qs['offset'](_0x5a8f03[_0x1530('0x2a')][_0x1530('0x1a')]);}_0x33f342[_0x1530('0x31')]=qs['sort'](_0x5a8f03[_0x1530('0x2a')][_0x1530('0x32')]);_0x33f342['where']=qs[_0x1530('0x33')](_['pick'](_0x5a8f03[_0x1530('0x2a')],_0x3e1cd6[_0x1530('0x33')]));if(_0x5a8f03['query'][_0x1530('0x34')]){_0x33f342[_0x1530('0x35')]=_[_0x1530('0x36')](_0x33f342['where'],{'$or':_['map'](_0x1e3e81,function(_0xa352be){if(_0xa352be['type'][_0x1530('0x37')]!==_0x1530('0x38')){var _0x42dff9={};_0x42dff9[_0xa352be[_0x1530('0x39')]]={'$like':'%'+_0x5a8f03[_0x1530('0x2a')][_0x1530('0x34')]+'%'};return _0x42dff9;}})});}_0x33f342=_[_0x1530('0x36')]({},_0x33f342,_0x5a8f03[_0x1530('0x3a')]);var _0x5f5c28={'where':_0x33f342[_0x1530('0x35')]};return db['ZendeskField']['count'](_0x5f5c28)[_0x1530('0x1f')](function(_0x52a019){_0x2f180a[_0x1530('0x19')]=_0x52a019;if(_0x5a8f03['query'][_0x1530('0x3b')]){_0x33f342['include']=[{'all':!![]}];}return db[_0x1530('0x27')]['findAll'](_0x33f342);})['then'](function(_0x302e66){_0x2f180a['rows']=_0x302e66;return _0x2f180a;})['then'](respondWithFilteredResult(_0x3d4844,_0x33f342))[_0x1530('0x3c')](handleError(_0x3d4844,null));};exports[_0x1530('0x3d')]=function(_0x41bf9e,_0x4cf657){var _0xacf0ce={'raw':!![],'where':{'id':_0x41bf9e[_0x1530('0x3e')]['id']}},_0x4e58a5={};_0x4e58a5[_0x1530('0x2c')]=_['keys'](db['ZendeskField'][_0x1530('0x28')]);_0x4e58a5[_0x1530('0x2a')]=_[_0x1530('0x29')](_0x41bf9e[_0x1530('0x2a')]);_0x4e58a5[_0x1530('0x33')]=_[_0x1530('0x2b')](_0x4e58a5[_0x1530('0x2c')],_0x4e58a5['query']);_0xacf0ce['attributes']=_['intersection'](_0x4e58a5['model'],qs[_0x1530('0x2e')](_0x41bf9e[_0x1530('0x2a')][_0x1530('0x2e')]));_0xacf0ce[_0x1530('0x2d')]=_0xacf0ce[_0x1530('0x2d')][_0x1530('0x3f')]?_0xacf0ce[_0x1530('0x2d')]:_0x4e58a5[_0x1530('0x2c')];if(_0x41bf9e[_0x1530('0x2a')][_0x1530('0x3b')]){_0xacf0ce[_0x1530('0x40')]=[{'all':!![]}];}_0xacf0ce=_[_0x1530('0x36')]({},_0xacf0ce,_0x41bf9e[_0x1530('0x3a')]);return db[_0x1530('0x27')]['find'](_0xacf0ce)['then'](handleEntityNotFound(_0x4cf657,null))[_0x1530('0x1f')](respondWithResult(_0x4cf657,null))['catch'](handleError(_0x4cf657,null));};exports['create']=function(_0x1c8fe3,_0x33967a){return db[_0x1530('0x27')][_0x1530('0x41')](_0x1c8fe3['body'],{})[_0x1530('0x1f')](respondWithResult(_0x33967a,0xc9))[_0x1530('0x3c')](handleError(_0x33967a,null));};exports[_0x1530('0x1e')]=function(_0x85436,_0x2c2c12){if(_0x85436[_0x1530('0x42')]['id']){delete _0x85436[_0x1530('0x42')]['id'];}return db[_0x1530('0x27')][_0x1530('0x43')]({'where':{'id':_0x85436[_0x1530('0x3e')]['id']}})[_0x1530('0x1f')](handleEntityNotFound(_0x2c2c12,null))[_0x1530('0x1f')](saveUpdates(_0x85436[_0x1530('0x42')],null))[_0x1530('0x1f')](respondWithResult(_0x2c2c12,null))[_0x1530('0x3c')](handleError(_0x2c2c12,null));};exports[_0x1530('0x20')]=function(_0x597a76,_0x53b169){return db[_0x1530('0x27')][_0x1530('0x43')]({'where':{'id':_0x597a76[_0x1530('0x3e')]['id']}})[_0x1530('0x1f')](handleEntityNotFound(_0x53b169,null))[_0x1530('0x1f')](removeEntity(_0x53b169,null))[_0x1530('0x3c')](handleError(_0x53b169,null));}; \ No newline at end of file +var _0x1159=['key','VIRTUAL','options','ZendeskField','count','includeAll','findAll','rows','catch','show','params','include','find','create','body','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','filters','pick','filter','where','merge','map','type'];(function(_0x4e12b1,_0x3108ad){var _0x3de05d=function(_0x10c730){while(--_0x10c730){_0x4e12b1['push'](_0x4e12b1['shift']());}};_0x3de05d(++_0x3108ad);}(_0x1159,0xf3));var _0x9115=function(_0x2b9f52,_0x32c0e4){_0x2b9f52=_0x2b9f52-0x0;var _0x39b0a7=_0x1159[_0x2b9f52];return _0x39b0a7;};'use strict';var pdf=require(_0x9115('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9115('0x1'));var jsonpatch=require(_0x9115('0x2'));var rp=require(_0x9115('0x3'));var moment=require(_0x9115('0x4'));var BPromise=require(_0x9115('0x5'));var Mustache=require(_0x9115('0x6'));var util=require(_0x9115('0x7'));var path=require(_0x9115('0x8'));var sox=require('sox');var csv=require(_0x9115('0x9'));var ejs=require(_0x9115('0xa'));var fs=require('fs');var _=require(_0x9115('0xb'));var squel=require(_0x9115('0xc'));var crypto=require(_0x9115('0xd'));var jsforce=require(_0x9115('0xe'));var deskjs=require(_0x9115('0xf'));var toCsv=require('to-csv');var querystring=require(_0x9115('0x10'));var Papa=require(_0x9115('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9115('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9115('0x13'))(_0x9115('0x14'));var utils=require(_0x9115('0x15'));var config=require(_0x9115('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17d8e8,_0x248de5){_0x248de5=_0x248de5||0xcc;return function(_0x31255a){if(_0x31255a){return _0x17d8e8[_0x9115('0x17')](_0x248de5);}return _0x17d8e8[_0x9115('0x18')](_0x248de5)[_0x9115('0x19')]();};}function respondWithResult(_0x1b201a,_0x29de02){_0x29de02=_0x29de02||0xc8;return function(_0x46df2d){if(_0x46df2d){return _0x1b201a['status'](_0x29de02)[_0x9115('0x1a')](_0x46df2d);}};}function respondWithFilteredResult(_0x4a938d,_0x1bfd8c){return function(_0x537972){if(_0x537972){var _0x238b83=_0x537972['count'],_0x2f9cbf=_0x1bfd8c['offset'],_0x3fe082=_0x1bfd8c['offset']+_0x1bfd8c[_0x9115('0x1b')],_0x5768db;if(_0x3fe082>=_0x238b83){_0x3fe082=_0x238b83;_0x5768db=0xc8;}else{_0x5768db=0xce;}_0x4a938d[_0x9115('0x18')](_0x5768db);return _0x4a938d[_0x9115('0x1c')](_0x9115('0x1d'),_0x2f9cbf+'-'+_0x3fe082+'/'+_0x238b83)['json'](_0x537972);}return null;};}function patchUpdates(_0x31ebb3){return function(_0xd38892){try{jsonpatch[_0x9115('0x1e')](_0xd38892,_0x31ebb3,!![]);}catch(_0x182c70){return BPromise[_0x9115('0x1f')](_0x182c70);}return _0xd38892[_0x9115('0x20')]();};}function saveUpdates(_0x1a7040,_0x2af6d6){return function(_0x41b4fe){if(_0x41b4fe){return _0x41b4fe[_0x9115('0x21')](_0x1a7040)[_0x9115('0x22')](function(_0x5ab822){return _0x5ab822;});}return null;};}function removeEntity(_0x19ff30,_0x21bfa7){return function(_0x3605aa){if(_0x3605aa){return _0x3605aa[_0x9115('0x23')]()[_0x9115('0x22')](function(){_0x19ff30[_0x9115('0x18')](0xcc)[_0x9115('0x19')]();});}};}function handleEntityNotFound(_0x10c142,_0x2dbd7a){return function(_0x2d93c9){if(!_0x2d93c9){_0x10c142[_0x9115('0x17')](0x194);}return _0x2d93c9;};}function handleError(_0x284411,_0x3c4c08){_0x3c4c08=_0x3c4c08||0x1f4;return function(_0xc64bc6){logger[_0x9115('0x24')](_0xc64bc6[_0x9115('0x25')]);if(_0xc64bc6[_0x9115('0x26')]){delete _0xc64bc6[_0x9115('0x26')];}_0x284411[_0x9115('0x18')](_0x3c4c08)[_0x9115('0x27')](_0xc64bc6);};}exports[_0x9115('0x28')]=function(_0x4a23f4,_0x2a37f5){var _0x576248={},_0x2eae39={},_0x1940a1={'count':0x0,'rows':[]};var _0x27644c=db['ZendeskField'][_0x9115('0x29')];_0x2eae39[_0x9115('0x2a')]=_[_0x9115('0x2b')](_0x27644c);_0x2eae39['query']=_[_0x9115('0x2b')](_0x4a23f4[_0x9115('0x2c')]);_0x2eae39['filters']=_[_0x9115('0x2d')](_0x2eae39['model'],_0x2eae39[_0x9115('0x2c')]);_0x576248[_0x9115('0x2e')]=_[_0x9115('0x2d')](_0x2eae39[_0x9115('0x2a')],qs[_0x9115('0x2f')](_0x4a23f4[_0x9115('0x2c')][_0x9115('0x2f')]));_0x576248[_0x9115('0x2e')]=_0x576248[_0x9115('0x2e')][_0x9115('0x30')]?_0x576248['attributes']:_0x2eae39[_0x9115('0x2a')];if(!_0x4a23f4[_0x9115('0x2c')][_0x9115('0x31')](_0x9115('0x32'))){_0x576248[_0x9115('0x1b')]=qs[_0x9115('0x1b')](_0x4a23f4['query'][_0x9115('0x1b')]);_0x576248['offset']=qs[_0x9115('0x33')](_0x4a23f4[_0x9115('0x2c')][_0x9115('0x33')]);}_0x576248[_0x9115('0x34')]=qs[_0x9115('0x35')](_0x4a23f4[_0x9115('0x2c')]['sort']);_0x576248['where']=qs[_0x9115('0x36')](_[_0x9115('0x37')](_0x4a23f4[_0x9115('0x2c')],_0x2eae39[_0x9115('0x36')]));if(_0x4a23f4[_0x9115('0x2c')][_0x9115('0x38')]){_0x576248[_0x9115('0x39')]=_[_0x9115('0x3a')](_0x576248[_0x9115('0x39')],{'$or':_[_0x9115('0x3b')](_0x27644c,function(_0x1eef60){if(_0x1eef60[_0x9115('0x3c')][_0x9115('0x3d')]!==_0x9115('0x3e')){var _0x3fcf5b={};_0x3fcf5b[_0x1eef60['field']]={'$like':'%'+_0x4a23f4[_0x9115('0x2c')][_0x9115('0x38')]+'%'};return _0x3fcf5b;}})});}_0x576248=_[_0x9115('0x3a')]({},_0x576248,_0x4a23f4[_0x9115('0x3f')]);var _0x525303={'where':_0x576248['where']};return db[_0x9115('0x40')]['count'](_0x525303)['then'](function(_0x12a5d9){_0x1940a1[_0x9115('0x41')]=_0x12a5d9;if(_0x4a23f4[_0x9115('0x2c')][_0x9115('0x42')]){_0x576248['include']=[{'all':!![]}];}return db[_0x9115('0x40')][_0x9115('0x43')](_0x576248);})['then'](function(_0x24e85f){_0x1940a1[_0x9115('0x44')]=_0x24e85f;return _0x1940a1;})[_0x9115('0x22')](respondWithFilteredResult(_0x2a37f5,_0x576248))[_0x9115('0x45')](handleError(_0x2a37f5,null));};exports[_0x9115('0x46')]=function(_0x5185ef,_0x52ae35){var _0x4f314b={'raw':!![],'where':{'id':_0x5185ef[_0x9115('0x47')]['id']}},_0x31c7d3={};_0x31c7d3[_0x9115('0x2a')]=_[_0x9115('0x2b')](db[_0x9115('0x40')]['rawAttributes']);_0x31c7d3['query']=_[_0x9115('0x2b')](_0x5185ef[_0x9115('0x2c')]);_0x31c7d3[_0x9115('0x36')]=_[_0x9115('0x2d')](_0x31c7d3[_0x9115('0x2a')],_0x31c7d3['query']);_0x4f314b['attributes']=_[_0x9115('0x2d')](_0x31c7d3[_0x9115('0x2a')],qs['fields'](_0x5185ef[_0x9115('0x2c')][_0x9115('0x2f')]));_0x4f314b[_0x9115('0x2e')]=_0x4f314b[_0x9115('0x2e')][_0x9115('0x30')]?_0x4f314b[_0x9115('0x2e')]:_0x31c7d3['model'];if(_0x5185ef[_0x9115('0x2c')][_0x9115('0x42')]){_0x4f314b[_0x9115('0x48')]=[{'all':!![]}];}_0x4f314b=_[_0x9115('0x3a')]({},_0x4f314b,_0x5185ef['options']);return db[_0x9115('0x40')][_0x9115('0x49')](_0x4f314b)[_0x9115('0x22')](handleEntityNotFound(_0x52ae35,null))[_0x9115('0x22')](respondWithResult(_0x52ae35,null))['catch'](handleError(_0x52ae35,null));};exports['create']=function(_0x4ae59a,_0x4282ec){return db[_0x9115('0x40')][_0x9115('0x4a')](_0x4ae59a[_0x9115('0x4b')],{})['then'](respondWithResult(_0x4282ec,0xc9))[_0x9115('0x45')](handleError(_0x4282ec,null));};exports[_0x9115('0x21')]=function(_0x470fd1,_0x4e091d){if(_0x470fd1[_0x9115('0x4b')]['id']){delete _0x470fd1['body']['id'];}return db[_0x9115('0x40')][_0x9115('0x49')]({'where':{'id':_0x470fd1[_0x9115('0x47')]['id']}})[_0x9115('0x22')](handleEntityNotFound(_0x4e091d,null))[_0x9115('0x22')](saveUpdates(_0x470fd1[_0x9115('0x4b')],null))[_0x9115('0x22')](respondWithResult(_0x4e091d,null))[_0x9115('0x45')](handleError(_0x4e091d,null));};exports['destroy']=function(_0x3d816d,_0x25c5d6){return db[_0x9115('0x40')][_0x9115('0x49')]({'where':{'id':_0x3d816d[_0x9115('0x47')]['id']}})['then'](handleEntityNotFound(_0x25c5d6,null))[_0x9115('0x22')](removeEntity(_0x25c5d6,null))[_0x9115('0x45')](handleError(_0x25c5d6,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 01f5aab..9037fcb 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 _0xda02=['define','idField','FieldId','lodash','util','api','moment','request-promise','path','./intZendeskField.attributes','exports'];(function(_0x301ad4,_0x3ccbaa){var _0x1dfbd7=function(_0x18047b){while(--_0x18047b){_0x301ad4['push'](_0x301ad4['shift']());}};_0x1dfbd7(++_0x3ccbaa);}(_0xda02,0xdf));var _0x2da0=function(_0x29df9a,_0x42aff3){_0x29df9a=_0x29df9a-0x0;var _0x3a8e96=_0xda02[_0x29df9a];return _0x3a8e96;};'use strict';var _=require(_0x2da0('0x0'));var util=require(_0x2da0('0x1'));var logger=require('../../config/logger')(_0x2da0('0x2'));var moment=require(_0x2da0('0x3'));var BPromise=require('bluebird');var rp=require(_0x2da0('0x4'));var fs=require('fs');var path=require(_0x2da0('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2da0('0x6'));module[_0x2da0('0x7')]=function(_0x50573e,_0xcf0e97){return _0x50573e[_0x2da0('0x8')]('ZendeskField',attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0x2da0('0x9'),_0x2da0('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb369=['FieldId','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','define','ZendeskField','zendesk_unique_index'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0xb369,0x146));var _0x9b36=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xb369[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x9b36('0x0'));var util=require(_0x9b36('0x1'));var logger=require(_0x9b36('0x2'))('api');var moment=require(_0x9b36('0x3'));var BPromise=require('bluebird');var rp=require(_0x9b36('0x4'));var fs=require('fs');var path=require(_0x9b36('0x5'));var rimraf=require(_0x9b36('0x6'));var config=require(_0x9b36('0x7'));var attributes=require(_0x9b36('0x8'));module['exports']=function(_0x3d3eb9,_0x1102d7){return _0x3d3eb9[_0x9b36('0x9')](_0x9b36('0xa'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x9b36('0xb'),'fields':['idField',_0x9b36('0xc')],'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 bb11e88..aea29ee 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 _0x7894=['request','info','ZendeskField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x422d3e,_0x3eed3f){var _0x2f3e8d=function(_0x2bdc9b){while(--_0x2bdc9b){_0x422d3e['push'](_0x422d3e['shift']());}};_0x2f3e8d(++_0x3eed3f);}(_0x7894,0x170));var _0x4789=function(_0x47d0f7,_0x39b319){_0x47d0f7=_0x47d0f7-0x0;var _0x476702=_0x7894[_0x47d0f7];return _0x476702;};'use strict';var _=require(_0x4789('0x0'));var util=require(_0x4789('0x1'));var moment=require(_0x4789('0x2'));var BPromise=require(_0x4789('0x3'));var rs=require(_0x4789('0x4'));var fs=require('fs');var Redis=require(_0x4789('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4789('0x6'));var logger=require(_0x4789('0x7'))('rpc');var config=require(_0x4789('0x8'));var jayson=require(_0x4789('0x9'));var client=jayson[_0x4789('0xa')][_0x4789('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x114a90,_0x298902,_0x13b7f6){return new BPromise(function(_0x5a45ae,_0x49d256){return client[_0x4789('0xc')](_0x114a90,_0x13b7f6)['then'](function(_0x2e8038){logger[_0x4789('0xd')](_0x4789('0xe'),_0x298902,'request\x20sent');logger[_0x4789('0xf')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x298902,_0x4789('0x10'),JSON[_0x4789('0x11')](_0x2e8038));if(_0x2e8038[_0x4789('0x12')]){if(_0x2e8038['error']['code']===0x1f4){logger[_0x4789('0x12')]('ZendeskField,\x20%s,\x20%s',_0x298902,_0x2e8038[_0x4789('0x12')]['message']);return _0x49d256(_0x2e8038[_0x4789('0x12')][_0x4789('0x13')]);}logger['error'](_0x4789('0xe'),_0x298902,_0x2e8038['error'][_0x4789('0x13')]);return _0x5a45ae(_0x2e8038[_0x4789('0x12')][_0x4789('0x13')]);}else{logger['info'](_0x4789('0xe'),_0x298902,_0x4789('0x10'));_0x5a45ae(_0x2e8038['result'][_0x4789('0x13')]);}})['catch'](function(_0x118f97){logger[_0x4789('0x12')]('ZendeskField,\x20%s,\x20%s',_0x298902,_0x118f97);_0x49d256(_0x118f97);});});} \ No newline at end of file +var _0xe605=['rpc','../../config/environment','jayson/promise','client','http','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1b69a4,_0x3e9f5f){var _0x4ab6a6=function(_0x33697){while(--_0x33697){_0x1b69a4['push'](_0x1b69a4['shift']());}};_0x4ab6a6(++_0x3e9f5f);}(_0xe605,0x92));var _0x5e60=function(_0x16d615,_0x4d2fc8){_0x16d615=_0x16d615-0x0;var _0x260bb7=_0xe605[_0x16d615];return _0x260bb7;};'use strict';var _=require(_0x5e60('0x0'));var util=require(_0x5e60('0x1'));var moment=require('moment');var BPromise=require(_0x5e60('0x2'));var rs=require(_0x5e60('0x3'));var fs=require('fs');var Redis=require(_0x5e60('0x4'));var db=require(_0x5e60('0x5'))['db'];var utils=require(_0x5e60('0x6'));var logger=require(_0x5e60('0x7'))(_0x5e60('0x8'));var config=require(_0x5e60('0x9'));var jayson=require(_0x5e60('0xa'));var client=jayson[_0x5e60('0xb')][_0x5e60('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x168a14,_0x4e3501,_0x1c5a6f){return new BPromise(function(_0x55ff5c,_0x593118){return client['request'](_0x168a14,_0x1c5a6f)[_0x5e60('0xd')](function(_0xe93f9c){logger[_0x5e60('0xe')](_0x5e60('0xf'),_0x4e3501,_0x5e60('0x10'));logger[_0x5e60('0x11')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x4e3501,_0x5e60('0x10'),JSON['stringify'](_0xe93f9c));if(_0xe93f9c[_0x5e60('0x12')]){if(_0xe93f9c[_0x5e60('0x12')][_0x5e60('0x13')]===0x1f4){logger['error'](_0x5e60('0xf'),_0x4e3501,_0xe93f9c[_0x5e60('0x12')][_0x5e60('0x14')]);return _0x593118(_0xe93f9c[_0x5e60('0x12')][_0x5e60('0x14')]);}logger[_0x5e60('0x12')]('ZendeskField,\x20%s,\x20%s',_0x4e3501,_0xe93f9c[_0x5e60('0x12')][_0x5e60('0x14')]);return _0x55ff5c(_0xe93f9c[_0x5e60('0x12')][_0x5e60('0x14')]);}else{logger['info'](_0x5e60('0xf'),_0x4e3501,'request\x20sent');_0x55ff5c(_0xe93f9c[_0x5e60('0x15')][_0x5e60('0x14')]);}})['catch'](function(_0x39be57){logger[_0x5e60('0x12')](_0x5e60('0xf'),_0x4e3501,_0x39be57);_0x593118(_0x39be57);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 348d2ad..1b26fd4 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 _0x36ee=['isAuthenticated','index','/:id','getConfigurations','post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get'];(function(_0x20dd63,_0x309e32){var _0x5de03e=function(_0x483f36){while(--_0x483f36){_0x20dd63['push'](_0x20dd63['shift']());}};_0x5de03e(++_0x309e32);}(_0x36ee,0xe8));var _0xe36e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x36ee[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe36e('0x0'));var timeout=require('connect-timeout');var express=require(_0xe36e('0x1'));var router=express[_0xe36e('0x2')]();var auth=require(_0xe36e('0x3'));var interaction=require(_0xe36e('0x4'));var config=require(_0xe36e('0x5'));var controller=require(_0xe36e('0x6'));router[_0xe36e('0x7')]('/',auth[_0xe36e('0x8')](),controller[_0xe36e('0x9')]);router[_0xe36e('0x7')](_0xe36e('0xa'),auth[_0xe36e('0x8')](),controller['show']);router[_0xe36e('0x7')]('/:id/configurations',auth[_0xe36e('0x8')](),controller[_0xe36e('0xb')]);router[_0xe36e('0x7')]('/:id/fields',auth[_0xe36e('0x8')](),controller['getFields']);router[_0xe36e('0xc')]('/',auth[_0xe36e('0x8')](),controller[_0xe36e('0xd')]);router[_0xe36e('0xc')](_0xe36e('0xe'),auth[_0xe36e('0x8')](),controller[_0xe36e('0xf')]);router[_0xe36e('0x10')]('/:id',auth[_0xe36e('0x8')](),controller[_0xe36e('0x11')]);router[_0xe36e('0x12')](_0xe36e('0xa'),auth['isAuthenticated'](),controller[_0xe36e('0x13')]);module['exports']=router; \ No newline at end of file +var _0x9c00=['destroy','exports','multer','util','express','Router','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete'];(function(_0x4a5f6c,_0x4f532e){var _0x281ffd=function(_0x4c68e3){while(--_0x4c68e3){_0x4a5f6c['push'](_0x4a5f6c['shift']());}};_0x281ffd(++_0x4f532e);}(_0x9c00,0x1a0));var _0x09c0=function(_0x2c341e,_0x414d11){_0x2c341e=_0x2c341e-0x0;var _0x43c1e8=_0x9c00[_0x2c341e];return _0x43c1e8;};'use strict';var multer=require(_0x09c0('0x0'));var util=require(_0x09c0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x09c0('0x2'));var router=express[_0x09c0('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x09c0('0x4'));var config=require(_0x09c0('0x5'));var controller=require(_0x09c0('0x6'));router[_0x09c0('0x7')]('/',auth[_0x09c0('0x8')](),controller['index']);router['get'](_0x09c0('0x9'),auth[_0x09c0('0x8')](),controller[_0x09c0('0xa')]);router[_0x09c0('0x7')](_0x09c0('0xb'),auth['isAuthenticated'](),controller[_0x09c0('0xc')]);router[_0x09c0('0x7')](_0x09c0('0xd'),auth[_0x09c0('0x8')](),controller[_0x09c0('0xe')]);router[_0x09c0('0xf')]('/',auth[_0x09c0('0x8')](),controller[_0x09c0('0x10')]);router[_0x09c0('0xf')](_0x09c0('0xb'),auth[_0x09c0('0x8')](),controller[_0x09c0('0x11')]);router[_0x09c0('0x12')](_0x09c0('0x9'),auth[_0x09c0('0x8')](),controller[_0x09c0('0x13')]);router[_0x09c0('0x14')](_0x09c0('0x9'),auth[_0x09c0('0x8')](),controller[_0x09c0('0x15')]);module[_0x09c0('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index bd6da57..85e9a85 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 _0x2959=['sequelize','STRING'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x2959,0xf6));var _0x9295=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x2959[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x9295('0x0'));module['exports']={'name':{'type':Sequelize[_0x9295('0x1')]},'description':{'type':Sequelize[_0x9295('0x1')]},'authToken':{'type':Sequelize[_0x9295('0x1')]},'host':{'type':Sequelize[_0x9295('0x1')]},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2cca=['STRING','sequelize','exports'];(function(_0x1147ab,_0x10e72b){var _0x55cb5a=function(_0x364bd6){while(--_0x364bd6){_0x1147ab['push'](_0x1147ab['shift']());}};_0x55cb5a(++_0x10e72b);}(_0x2cca,0x8e));var _0xa2cc=function(_0x5c3dd9,_0x59615b){_0x5c3dd9=_0x5c3dd9-0x0;var _0xa419ab=_0x2cca[_0x5c3dd9];return _0xa419ab;};'use strict';var Sequelize=require(_0xa2cc('0x0'));module[_0xa2cc('0x1')]={'name':{'type':Sequelize[_0xa2cc('0x2')]},'description':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xa2cc('0x2')]},'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 36d5496..4e28a8e 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 _0xa680=['hasOwnProperty','nolimit','limit','order','sort','pick','where','map','type','key','VIRTUAL','field','merge','includeAll','findAll','catch','show','params','include','options','create','body','find','findOne','ZohoConfiguration','rawAttributes','filter','getConfigurations','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','ZohoField','getFields','host','substring','lastIndexOf','GET','https://crm.%s/crm/private/json/Calls/getFields','authToken','response','Calls','Call\x20Purpose','section','includes','push','label','customfield','true','val','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','status','end','json','count','offset','set','Content-Range','apply','save','update','destroy','name','send','ZohoAccount','model','keys','query','filters','intersection','attributes','fields','length'];(function(_0x376438,_0x3619cc){var _0x407b53=function(_0x230840){while(--_0x230840){_0x376438['push'](_0x376438['shift']());}};_0x407b53(++_0x3619cc);}(_0xa680,0x124));var _0x0a68=function(_0x5c8fff,_0x28ba92){_0x5c8fff=_0x5c8fff-0x0;var _0x1101e8=_0xa680[_0x5c8fff];return _0x1101e8;};'use strict';var pdf=require(_0x0a68('0x0'));var emlformat=require(_0x0a68('0x1'));var rimraf=require(_0x0a68('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0a68('0x3'));var rp=require(_0x0a68('0x4'));var moment=require(_0x0a68('0x5'));var BPromise=require(_0x0a68('0x6'));var Mustache=require(_0x0a68('0x7'));var util=require(_0x0a68('0x8'));var path=require(_0x0a68('0x9'));var sox=require(_0x0a68('0xa'));var csv=require(_0x0a68('0xb'));var ejs=require(_0x0a68('0xc'));var fs=require('fs');var _=require(_0x0a68('0xd'));var squel=require('squel');var crypto=require(_0x0a68('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0a68('0xf'));var toCsv=require(_0x0a68('0xb'));var querystring=require(_0x0a68('0x10'));var Papa=require(_0x0a68('0x11'));var Redis=require(_0x0a68('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x0a68('0x13'));var hardwareService=require(_0x0a68('0x14'));var logger=require(_0x0a68('0x15'))(_0x0a68('0x16'));var utils=require(_0x0a68('0x17'));var config=require(_0x0a68('0x18'));var db=require(_0x0a68('0x19'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x0a68('0x1a'));var client=jayson[_0x0a68('0x1b')][_0x0a68('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x18533b,_0x197596,_0x260e8a){if(_0x260e8a){var _0x3179f5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3179f5[_0x0a68('0x1d')](_0x197596)){return _0x18533b;}else{throw new Error(_0x0a68('0x1e'));}}else{return _0x18533b;}}function respondWithRpcPromise(_0x5ed12a,_0x3caa05,_0x4126fe,_0x58183d){return new BPromise(function(_0x29a4e6,_0x595e29){var _0x6884f0=_0x58183d||client;return _0x6884f0[_0x0a68('0x1f')](_0x5ed12a,_0x4126fe)[_0x0a68('0x20')](function(_0x36724a){logger['info'](_0x0a68('0x21'),_0x3caa05,_0x0a68('0x22'));logger[_0x0a68('0x23')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x3caa05,_0x0a68('0x22'),JSON['stringify'](_0x36724a));if(_0x36724a[_0x0a68('0x24')]){if(_0x36724a[_0x0a68('0x24')]['code']===0x1f4){logger[_0x0a68('0x24')](_0x0a68('0x21'),_0x3caa05,_0x36724a[_0x0a68('0x24')][_0x0a68('0x25')]);return _0x595e29(_0x36724a['error'][_0x0a68('0x25')]);}logger[_0x0a68('0x24')](_0x0a68('0x21'),_0x3caa05,_0x36724a[_0x0a68('0x24')]['message']);return _0x29a4e6(_0x36724a[_0x0a68('0x24')]['message']);}else{logger[_0x0a68('0x26')](_0x0a68('0x21'),_0x3caa05,'request\x20sent');_0x29a4e6(_0x36724a[_0x0a68('0x27')]['message']);}})['catch'](function(_0x2ebd9b){logger[_0x0a68('0x24')](_0x0a68('0x21'),_0x3caa05,_0x2ebd9b);_0x595e29(_0x2ebd9b);});});}function respondWithStatusCode(_0x339058,_0x44a309){_0x44a309=_0x44a309||0xcc;return function(_0x58920f){if(_0x58920f){return _0x339058['sendStatus'](_0x44a309);}return _0x339058[_0x0a68('0x28')](_0x44a309)[_0x0a68('0x29')]();};}function respondWithResult(_0x4bcc38,_0x47b576){_0x47b576=_0x47b576||0xc8;return function(_0x5a0f9f){if(_0x5a0f9f){return _0x4bcc38[_0x0a68('0x28')](_0x47b576)[_0x0a68('0x2a')](_0x5a0f9f);}};}function respondWithFilteredResult(_0x399a39,_0x66f517){return function(_0x3c044c){if(_0x3c044c){var _0x345577=_0x3c044c[_0x0a68('0x2b')],_0x1afb85=_0x66f517[_0x0a68('0x2c')],_0x3fc1ce=_0x66f517[_0x0a68('0x2c')]+_0x66f517['limit'],_0x3320dd;if(_0x3fc1ce>=_0x345577){_0x3fc1ce=_0x345577;_0x3320dd=0xc8;}else{_0x3320dd=0xce;}_0x399a39[_0x0a68('0x28')](_0x3320dd);return _0x399a39[_0x0a68('0x2d')](_0x0a68('0x2e'),_0x1afb85+'-'+_0x3fc1ce+'/'+_0x345577)[_0x0a68('0x2a')](_0x3c044c);}return null;};}function patchUpdates(_0x1f3cb6){return function(_0x405555){try{jsonpatch[_0x0a68('0x2f')](_0x405555,_0x1f3cb6,!![]);}catch(_0x1ae6a4){return BPromise['reject'](_0x1ae6a4);}return _0x405555[_0x0a68('0x30')]();};}function saveUpdates(_0x8677c6,_0x21f058){return function(_0x21bb89){if(_0x21bb89){return _0x21bb89[_0x0a68('0x31')](_0x8677c6)[_0x0a68('0x20')](function(_0xad479){return _0xad479;});}return null;};}function removeEntity(_0x51b525,_0x3dced5){return function(_0x470ffd){if(_0x470ffd){return _0x470ffd[_0x0a68('0x32')]()['then'](function(){_0x51b525[_0x0a68('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39982d,_0x385bb2){return function(_0x5aa875){if(!_0x5aa875){_0x39982d['sendStatus'](0x194);}return _0x5aa875;};}function handleError(_0x2229c3,_0x3e8ccf){_0x3e8ccf=_0x3e8ccf||0x1f4;return function(_0x5f3cd6){logger[_0x0a68('0x24')](_0x5f3cd6['stack']);if(_0x5f3cd6['name']){delete _0x5f3cd6[_0x0a68('0x33')];}_0x2229c3['status'](_0x3e8ccf)[_0x0a68('0x34')](_0x5f3cd6);};}exports['index']=function(_0x4bd86d,_0x593042){var _0x1f3594={},_0x1a3605={},_0x9eda1={'count':0x0,'rows':[]};var _0x2744eb=db[_0x0a68('0x35')]['rawAttributes'];_0x1a3605[_0x0a68('0x36')]=_[_0x0a68('0x37')](_0x2744eb);_0x1a3605[_0x0a68('0x38')]=_['keys'](_0x4bd86d[_0x0a68('0x38')]);_0x1a3605[_0x0a68('0x39')]=_[_0x0a68('0x3a')](_0x1a3605[_0x0a68('0x36')],_0x1a3605[_0x0a68('0x38')]);_0x1f3594[_0x0a68('0x3b')]=_['intersection'](_0x1a3605['model'],qs[_0x0a68('0x3c')](_0x4bd86d[_0x0a68('0x38')]['fields']));_0x1f3594['attributes']=_0x1f3594[_0x0a68('0x3b')][_0x0a68('0x3d')]?_0x1f3594[_0x0a68('0x3b')]:_0x1a3605[_0x0a68('0x36')];if(!_0x4bd86d[_0x0a68('0x38')][_0x0a68('0x3e')](_0x0a68('0x3f'))){_0x1f3594[_0x0a68('0x40')]=qs[_0x0a68('0x40')](_0x4bd86d[_0x0a68('0x38')][_0x0a68('0x40')]);_0x1f3594[_0x0a68('0x2c')]=qs['offset'](_0x4bd86d[_0x0a68('0x38')][_0x0a68('0x2c')]);}_0x1f3594[_0x0a68('0x41')]=qs[_0x0a68('0x42')](_0x4bd86d[_0x0a68('0x38')][_0x0a68('0x42')]);_0x1f3594['where']=qs[_0x0a68('0x39')](_[_0x0a68('0x43')](_0x4bd86d['query'],_0x1a3605[_0x0a68('0x39')]));if(_0x4bd86d[_0x0a68('0x38')]['filter']){_0x1f3594[_0x0a68('0x44')]=_['merge'](_0x1f3594[_0x0a68('0x44')],{'$or':_[_0x0a68('0x45')](_0x2744eb,function(_0x493b52){if(_0x493b52[_0x0a68('0x46')][_0x0a68('0x47')]!==_0x0a68('0x48')){var _0x265733={};_0x265733[_0x493b52[_0x0a68('0x49')]]={'$like':'%'+_0x4bd86d[_0x0a68('0x38')]['filter']+'%'};return _0x265733;}})});}_0x1f3594=_[_0x0a68('0x4a')]({},_0x1f3594,_0x4bd86d['options']);var _0x2df171={'where':_0x1f3594[_0x0a68('0x44')]};return db[_0x0a68('0x35')][_0x0a68('0x2b')](_0x2df171)['then'](function(_0x438a3a){_0x9eda1[_0x0a68('0x2b')]=_0x438a3a;if(_0x4bd86d[_0x0a68('0x38')][_0x0a68('0x4b')]){_0x1f3594['include']=[{'all':!![]}];}return db[_0x0a68('0x35')][_0x0a68('0x4c')](_0x1f3594);})[_0x0a68('0x20')](function(_0x165d0f){_0x9eda1['rows']=_0x165d0f;return _0x9eda1;})[_0x0a68('0x20')](respondWithFilteredResult(_0x593042,_0x1f3594))[_0x0a68('0x4d')](handleError(_0x593042,null));};exports[_0x0a68('0x4e')]=function(_0x277986,_0x5bda6c){var _0x3cbb55={'raw':![],'where':{'id':_0x277986[_0x0a68('0x4f')]['id']}},_0x794852={};_0x794852['model']=_[_0x0a68('0x37')](db[_0x0a68('0x35')]['rawAttributes']);_0x794852[_0x0a68('0x38')]=_[_0x0a68('0x37')](_0x277986[_0x0a68('0x38')]);_0x794852[_0x0a68('0x39')]=_[_0x0a68('0x3a')](_0x794852['model'],_0x794852[_0x0a68('0x38')]);_0x3cbb55['attributes']=_[_0x0a68('0x3a')](_0x794852[_0x0a68('0x36')],qs['fields'](_0x277986[_0x0a68('0x38')][_0x0a68('0x3c')]));_0x3cbb55[_0x0a68('0x3b')]=_0x3cbb55['attributes']['length']?_0x3cbb55[_0x0a68('0x3b')]:_0x794852[_0x0a68('0x36')];if(_0x277986[_0x0a68('0x38')][_0x0a68('0x4b')]){_0x3cbb55[_0x0a68('0x50')]=[{'all':!![]}];}_0x3cbb55=_[_0x0a68('0x4a')]({},_0x3cbb55,_0x277986[_0x0a68('0x51')]);return db['ZohoAccount']['find'](_0x3cbb55)['then'](handleEntityNotFound(_0x5bda6c,null))[_0x0a68('0x20')](respondWithResult(_0x5bda6c,null))[_0x0a68('0x4d')](handleError(_0x5bda6c,null));};exports[_0x0a68('0x52')]=function(_0x328b35,_0x59b4fc){return db[_0x0a68('0x35')][_0x0a68('0x52')](_0x328b35[_0x0a68('0x53')],{})[_0x0a68('0x20')](respondWithResult(_0x59b4fc,0xc9))[_0x0a68('0x4d')](handleError(_0x59b4fc,null));};exports[_0x0a68('0x31')]=function(_0x755bc3,_0x4726a1){if(_0x755bc3['body']['id']){delete _0x755bc3[_0x0a68('0x53')]['id'];}return db['ZohoAccount'][_0x0a68('0x54')]({'where':{'id':_0x755bc3[_0x0a68('0x4f')]['id']}})[_0x0a68('0x20')](handleEntityNotFound(_0x4726a1,null))['then'](saveUpdates(_0x755bc3[_0x0a68('0x53')],null))[_0x0a68('0x20')](respondWithResult(_0x4726a1,null))[_0x0a68('0x4d')](handleError(_0x4726a1,null));};exports[_0x0a68('0x32')]=function(_0x13c9cc,_0x23ea6d){return db['ZohoAccount'][_0x0a68('0x54')]({'where':{'id':_0x13c9cc[_0x0a68('0x4f')]['id']}})[_0x0a68('0x20')](handleEntityNotFound(_0x23ea6d,null))[_0x0a68('0x20')](removeEntity(_0x23ea6d,null))['catch'](handleError(_0x23ea6d,null));};exports['getConfigurations']=function(_0x5aa68d,_0x5eecc2,_0x4b308a){var _0x12619d={};var _0x13fd88={};var _0x5d612d;var _0x26fdf6;return db[_0x0a68('0x35')][_0x0a68('0x55')]({'where':{'id':_0x5aa68d[_0x0a68('0x4f')]['id']}})[_0x0a68('0x20')](handleEntityNotFound(_0x5eecc2,null))[_0x0a68('0x20')](function(_0x27e18d){if(_0x27e18d){_0x5d612d=_0x27e18d;_0x13fd88[_0x0a68('0x36')]=_['keys'](db[_0x0a68('0x56')][_0x0a68('0x57')]);_0x13fd88[_0x0a68('0x38')]=_[_0x0a68('0x37')](_0x5aa68d[_0x0a68('0x38')]);_0x13fd88[_0x0a68('0x39')]=_[_0x0a68('0x3a')](_0x13fd88[_0x0a68('0x36')],_0x13fd88['query']);_0x12619d[_0x0a68('0x3b')]=_[_0x0a68('0x3a')](_0x13fd88[_0x0a68('0x36')],qs['fields'](_0x5aa68d[_0x0a68('0x38')]['fields']));_0x12619d[_0x0a68('0x3b')]=_0x12619d['attributes']['length']?_0x12619d[_0x0a68('0x3b')]:_0x13fd88[_0x0a68('0x36')];_0x12619d[_0x0a68('0x41')]=qs['sort'](_0x5aa68d['query'][_0x0a68('0x42')]);_0x12619d[_0x0a68('0x44')]=qs[_0x0a68('0x39')](_[_0x0a68('0x43')](_0x5aa68d[_0x0a68('0x38')],_0x13fd88[_0x0a68('0x39')]));if(_0x5aa68d['query'][_0x0a68('0x58')]){_0x12619d[_0x0a68('0x44')]=_[_0x0a68('0x4a')](_0x12619d[_0x0a68('0x44')],{'$or':_[_0x0a68('0x45')](_0x12619d['attributes'],function(_0xe55867){var _0xe45920={};_0xe45920[_0xe55867]={'$like':'%'+_0x5aa68d[_0x0a68('0x38')][_0x0a68('0x58')]+'%'};return _0xe45920;})});}_0x12619d=_[_0x0a68('0x4a')]({},_0x12619d,_0x5aa68d[_0x0a68('0x51')]);return _0x5d612d[_0x0a68('0x59')](_0x12619d);}})[_0x0a68('0x20')](function(_0x1d7c66){if(_0x1d7c66){_0x26fdf6=_0x1d7c66[_0x0a68('0x3d')];if(!_0x5aa68d[_0x0a68('0x38')][_0x0a68('0x3e')]('nolimit')){_0x12619d[_0x0a68('0x40')]=qs[_0x0a68('0x40')](_0x5aa68d[_0x0a68('0x38')]['limit']);_0x12619d[_0x0a68('0x2c')]=qs['offset'](_0x5aa68d[_0x0a68('0x38')]['offset']);}return _0x5d612d[_0x0a68('0x59')](_0x12619d);}})[_0x0a68('0x20')](function(_0x15ebfa){if(_0x15ebfa){return _0x15ebfa?{'count':_0x26fdf6,'rows':_0x15ebfa}:null;}})[_0x0a68('0x20')](respondWithResult(_0x5eecc2,null))[_0x0a68('0x4d')](handleError(_0x5eecc2,null));};exports[_0x0a68('0x5a')]=function(_0x15c85a,_0x56c7bb,_0xa7c1d7){if(_0x15c85a[_0x0a68('0x53')]['id']){delete _0x15c85a[_0x0a68('0x53')]['id'];}return db[_0x0a68('0x35')][_0x0a68('0x55')]({'where':{'id':_0x15c85a[_0x0a68('0x4f')]['id']}})[_0x0a68('0x20')](handleEntityNotFound(_0x56c7bb,null))[_0x0a68('0x20')](function(_0x90f5ad){if(_0x90f5ad){_0x15c85a[_0x0a68('0x53')][_0x0a68('0x5b')]=_0x90f5ad['id'];_0x15c85a[_0x0a68('0x53')]['Subjects']=integrations[_0x0a68('0x5c')](_0x15c85a[_0x0a68('0x53')][_0x0a68('0x5d')],_0x15c85a[_0x0a68('0x53')]['type']);_0x15c85a[_0x0a68('0x53')][_0x0a68('0x5e')]=integrations[_0x0a68('0x5f')](_0x15c85a['body'][_0x0a68('0x5d')],_0x15c85a[_0x0a68('0x53')][_0x0a68('0x46')]);return db['ZohoConfiguration']['create'](_0x15c85a[_0x0a68('0x53')],{'include':[{'model':db[_0x0a68('0x60')],'as':'Subjects'},{'model':db['ZohoField'],'as':'Descriptions'}]});}return null;})[_0x0a68('0x20')](respondWithResult(_0x56c7bb,null))[_0x0a68('0x4d')](handleError(_0x56c7bb,null));};exports[_0x0a68('0x61')]=function(_0x24374c,_0x47846f,_0x33140a){var _0x5bdc33='';return db[_0x0a68('0x35')][_0x0a68('0x55')]({'where':{'id':_0x24374c[_0x0a68('0x4f')]['id']},'attributes':['id',_0x0a68('0x62'),'authToken']})['then'](handleEntityNotFound(_0x47846f,null))[_0x0a68('0x20')](function(_0x2238ed){if(_0x2238ed){_0x5bdc33=_0x2238ed[_0x0a68('0x62')];var _0x43b171=_0x5bdc33['slice'](-0x1);if(_0x43b171==='/'){_0x5bdc33=_0x5bdc33[_0x0a68('0x63')](0x0,_0x5bdc33[_0x0a68('0x64')](_0x43b171));}return rp({'method':_0x0a68('0x65'),'uri':util['format'](_0x0a68('0x66'),_0x5bdc33),'qs':{'authtoken':_0x2238ed[_0x0a68('0x67')],'scope':'crmapi'},'json':!![]});}})['then'](function(_0x1d98ef){if(_0x1d98ef){if(_0x1d98ef[_0x0a68('0x68')]&&_0x1d98ef[_0x0a68('0x68')]['error']){throw new Error(_0x1d98ef[_0x0a68('0x68')][_0x0a68('0x24')][_0x0a68('0x25')]);}var _0x4f08dc=[];if(_0x1d98ef[_0x0a68('0x69')]&&_0x1d98ef[_0x0a68('0x69')]['section']){if(_0x1d98ef['Calls']['section']['FL']){var _0xe36ab1=[_0x0a68('0x6a')];for(var _0x26e3fa=0x0,_0x112b8b=_0x1d98ef[_0x0a68('0x69')][_0x0a68('0x6b')]['FL'][_0x0a68('0x3d')];_0x26e3fa<_0x112b8b;_0x26e3fa++){if(_[_0x0a68('0x6c')](_0xe36ab1,_0x1d98ef[_0x0a68('0x69')][_0x0a68('0x6b')]['FL'][_0x26e3fa]['dv'])){_0x4f08dc[_0x0a68('0x6d')]({'id':_0x1d98ef['Calls'][_0x0a68('0x6b')]['FL'][_0x26e3fa]['dv'],'name':_0x1d98ef['Calls']['section']['FL'][_0x26e3fa][_0x0a68('0x6e')],'custom':_0x1d98ef[_0x0a68('0x69')][_0x0a68('0x6b')]['FL'][_0x26e3fa][_0x0a68('0x6f')]===_0x0a68('0x70')?!![]:![],'options':_0x1d98ef[_0x0a68('0x69')][_0x0a68('0x6b')]['FL'][_0x26e3fa][_0x0a68('0x46')]==='Pick\x20List'&&_0x1d98ef[_0x0a68('0x69')][_0x0a68('0x6b')]['FL'][_0x26e3fa][_0x0a68('0x71')]?_['map'](_0x1d98ef[_0x0a68('0x69')][_0x0a68('0x6b')]['FL'][_0x26e3fa][_0x0a68('0x71')],function(_0x32ac53){return{'name':_0x32ac53,'value':_0x32ac53};}):[]});}}}}return{'count':_0x4f08dc['length'],'rows':_0x4f08dc};}})[_0x0a68('0x20')](respondWithResult(_0x47846f,null))['catch'](function(_0x36989b){var _0x2a5f92=_0x24374c['query']['test']?0x1f4:_0x36989b[_0x0a68('0x72')]||0x1f4;logger[_0x0a68('0x24')](_0x0a68('0x73'),_0x0a68('0x61'),_0x2a5f92,JSON[_0x0a68('0x74')](_0x36989b));delete _0x36989b[_0x0a68('0x33')];if(_0x2a5f92===0x191){_0x2a5f92=0x190;}_0x47846f[_0x0a68('0x28')](_0x2a5f92)[_0x0a68('0x34')](_0x24374c[_0x0a68('0x38')][_0x0a68('0x1d')]?{'message':_0x0a68('0x75'),'statusCode':_0x36989b[_0x0a68('0x72')]}:_0x36989b);});}; \ No newline at end of file +var _0xec16=['sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','key','VIRTUAL','field','options','ZohoAccount','count','include','findAll','rows','catch','params','rawAttributes','includeAll','find','create','body','getConfigurations','ZohoConfiguration','pick','addConfiguration','AccountId','Subjects','channel','type','getDescriptions','getFields','findOne','host','authToken','slice','substring','GET','format','https://crm.%s/crm/private/json/Calls/getFields','crmapi','response','section','Call\x20Purpose','Calls','push','label','customfield','true','Pick\x20List','val','Wrong\x20credentials','statusCode','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../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','ZohoAccount,\x20%s,\x20%s','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x2c3ec3,_0x5b4937){var _0xe08cba=function(_0x5005b0){while(--_0x5005b0){_0x2c3ec3['push'](_0x2c3ec3['shift']());}};_0xe08cba(++_0x5b4937);}(_0xec16,0xc5));var _0x6ec1=function(_0x2fbb45,_0x1b2c7f){_0x2fbb45=_0x2fbb45-0x0;var _0x526325=_0xec16[_0x2fbb45];return _0x526325;};'use strict';var pdf=require(_0x6ec1('0x0'));var emlformat=require(_0x6ec1('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x6ec1('0x2'));var jsonpatch=require(_0x6ec1('0x3'));var rp=require(_0x6ec1('0x4'));var moment=require(_0x6ec1('0x5'));var BPromise=require(_0x6ec1('0x6'));var Mustache=require('mustache');var util=require(_0x6ec1('0x7'));var path=require(_0x6ec1('0x8'));var sox=require(_0x6ec1('0x9'));var csv=require(_0x6ec1('0xa'));var ejs=require(_0x6ec1('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6ec1('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6ec1('0xd'));var toCsv=require(_0x6ec1('0xa'));var querystring=require(_0x6ec1('0xe'));var Papa=require(_0x6ec1('0xf'));var Redis=require(_0x6ec1('0x10'));var authService=require(_0x6ec1('0x11'));var qs=require(_0x6ec1('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6ec1('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x6ec1('0x14'));var client=jayson[_0x6ec1('0x15')][_0x6ec1('0x16')]({'port':0x232a});function checkPasswordPattern(_0x38702c,_0x5e4f50,_0x51e09a){if(_0x51e09a){var _0x1b99d0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1b99d0[_0x6ec1('0x17')](_0x5e4f50)){return _0x38702c;}else{throw new Error(_0x6ec1('0x18'));}}else{return _0x38702c;}}function respondWithRpcPromise(_0x339cc3,_0x4aecf8,_0x4592f5,_0x2735de){return new BPromise(function(_0x355dc1,_0x315afd){var _0x4cd21b=_0x2735de||client;return _0x4cd21b[_0x6ec1('0x19')](_0x339cc3,_0x4592f5)['then'](function(_0x1aa3bb){logger[_0x6ec1('0x1a')](_0x6ec1('0x1b'),_0x4aecf8,'request\x20sent');logger['debug'](_0x6ec1('0x1c'),_0x4aecf8,_0x6ec1('0x1d'),JSON[_0x6ec1('0x1e')](_0x1aa3bb));if(_0x1aa3bb[_0x6ec1('0x1f')]){if(_0x1aa3bb[_0x6ec1('0x1f')][_0x6ec1('0x20')]===0x1f4){logger['error'](_0x6ec1('0x1b'),_0x4aecf8,_0x1aa3bb['error']['message']);return _0x315afd(_0x1aa3bb[_0x6ec1('0x1f')][_0x6ec1('0x21')]);}logger[_0x6ec1('0x1f')](_0x6ec1('0x1b'),_0x4aecf8,_0x1aa3bb[_0x6ec1('0x1f')]['message']);return _0x355dc1(_0x1aa3bb[_0x6ec1('0x1f')][_0x6ec1('0x21')]);}else{logger[_0x6ec1('0x1a')](_0x6ec1('0x1b'),_0x4aecf8,'request\x20sent');_0x355dc1(_0x1aa3bb[_0x6ec1('0x22')][_0x6ec1('0x21')]);}})['catch'](function(_0x45fa3d){logger[_0x6ec1('0x1f')](_0x6ec1('0x1b'),_0x4aecf8,_0x45fa3d);_0x315afd(_0x45fa3d);});});}function respondWithStatusCode(_0x5cd5dc,_0x4a0483){_0x4a0483=_0x4a0483||0xcc;return function(_0x1aa6a6){if(_0x1aa6a6){return _0x5cd5dc[_0x6ec1('0x23')](_0x4a0483);}return _0x5cd5dc[_0x6ec1('0x24')](_0x4a0483)[_0x6ec1('0x25')]();};}function respondWithResult(_0x22b698,_0x4cb2d3){_0x4cb2d3=_0x4cb2d3||0xc8;return function(_0x4e53bf){if(_0x4e53bf){return _0x22b698[_0x6ec1('0x24')](_0x4cb2d3)[_0x6ec1('0x26')](_0x4e53bf);}};}function respondWithFilteredResult(_0x53ac89,_0x41e5ee){return function(_0x8c6d30){if(_0x8c6d30){var _0x41b2e7=_0x8c6d30['count'],_0x590170=_0x41e5ee[_0x6ec1('0x27')],_0x2e9d16=_0x41e5ee[_0x6ec1('0x27')]+_0x41e5ee[_0x6ec1('0x28')],_0x23a108;if(_0x2e9d16>=_0x41b2e7){_0x2e9d16=_0x41b2e7;_0x23a108=0xc8;}else{_0x23a108=0xce;}_0x53ac89[_0x6ec1('0x24')](_0x23a108);return _0x53ac89[_0x6ec1('0x29')](_0x6ec1('0x2a'),_0x590170+'-'+_0x2e9d16+'/'+_0x41b2e7)['json'](_0x8c6d30);}return null;};}function patchUpdates(_0x2b3647){return function(_0xf773c3){try{jsonpatch[_0x6ec1('0x2b')](_0xf773c3,_0x2b3647,!![]);}catch(_0x3d5483){return BPromise[_0x6ec1('0x2c')](_0x3d5483);}return _0xf773c3[_0x6ec1('0x2d')]();};}function saveUpdates(_0x39d750,_0x19e193){return function(_0x37fff1){if(_0x37fff1){return _0x37fff1[_0x6ec1('0x2e')](_0x39d750)[_0x6ec1('0x2f')](function(_0x2693a6){return _0x2693a6;});}return null;};}function removeEntity(_0x501ad8,_0x4b59c6){return function(_0x17a2c0){if(_0x17a2c0){return _0x17a2c0[_0x6ec1('0x30')]()[_0x6ec1('0x2f')](function(){_0x501ad8[_0x6ec1('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24c2ee,_0x14f1ff){return function(_0x42c7d){if(!_0x42c7d){_0x24c2ee[_0x6ec1('0x23')](0x194);}return _0x42c7d;};}function handleError(_0x59f980,_0x243177){_0x243177=_0x243177||0x1f4;return function(_0x292fdc){logger['error'](_0x292fdc[_0x6ec1('0x31')]);if(_0x292fdc[_0x6ec1('0x32')]){delete _0x292fdc[_0x6ec1('0x32')];}_0x59f980['status'](_0x243177)[_0x6ec1('0x33')](_0x292fdc);};}exports[_0x6ec1('0x34')]=function(_0xb8ea7,_0x5d0704){var _0x561f6f={},_0x65bc34={},_0x14f695={'count':0x0,'rows':[]};var _0x3d5daf=db['ZohoAccount']['rawAttributes'];_0x65bc34[_0x6ec1('0x35')]=_['keys'](_0x3d5daf);_0x65bc34[_0x6ec1('0x36')]=_[_0x6ec1('0x37')](_0xb8ea7['query']);_0x65bc34[_0x6ec1('0x38')]=_['intersection'](_0x65bc34[_0x6ec1('0x35')],_0x65bc34[_0x6ec1('0x36')]);_0x561f6f[_0x6ec1('0x39')]=_[_0x6ec1('0x3a')](_0x65bc34[_0x6ec1('0x35')],qs['fields'](_0xb8ea7[_0x6ec1('0x36')][_0x6ec1('0x3b')]));_0x561f6f['attributes']=_0x561f6f[_0x6ec1('0x39')][_0x6ec1('0x3c')]?_0x561f6f[_0x6ec1('0x39')]:_0x65bc34[_0x6ec1('0x35')];if(!_0xb8ea7[_0x6ec1('0x36')][_0x6ec1('0x3d')](_0x6ec1('0x3e'))){_0x561f6f[_0x6ec1('0x28')]=qs[_0x6ec1('0x28')](_0xb8ea7[_0x6ec1('0x36')][_0x6ec1('0x28')]);_0x561f6f['offset']=qs['offset'](_0xb8ea7[_0x6ec1('0x36')]['offset']);}_0x561f6f[_0x6ec1('0x3f')]=qs['sort'](_0xb8ea7[_0x6ec1('0x36')][_0x6ec1('0x40')]);_0x561f6f[_0x6ec1('0x41')]=qs[_0x6ec1('0x38')](_['pick'](_0xb8ea7[_0x6ec1('0x36')],_0x65bc34[_0x6ec1('0x38')]));if(_0xb8ea7[_0x6ec1('0x36')][_0x6ec1('0x42')]){_0x561f6f[_0x6ec1('0x41')]=_[_0x6ec1('0x43')](_0x561f6f[_0x6ec1('0x41')],{'$or':_[_0x6ec1('0x44')](_0x3d5daf,function(_0x3f4561){if(_0x3f4561['type'][_0x6ec1('0x45')]!==_0x6ec1('0x46')){var _0x394aad={};_0x394aad[_0x3f4561[_0x6ec1('0x47')]]={'$like':'%'+_0xb8ea7['query'][_0x6ec1('0x42')]+'%'};return _0x394aad;}})});}_0x561f6f=_['merge']({},_0x561f6f,_0xb8ea7[_0x6ec1('0x48')]);var _0x4f3340={'where':_0x561f6f[_0x6ec1('0x41')]};return db[_0x6ec1('0x49')][_0x6ec1('0x4a')](_0x4f3340)[_0x6ec1('0x2f')](function(_0x5855a1){_0x14f695[_0x6ec1('0x4a')]=_0x5855a1;if(_0xb8ea7[_0x6ec1('0x36')]['includeAll']){_0x561f6f[_0x6ec1('0x4b')]=[{'all':!![]}];}return db[_0x6ec1('0x49')][_0x6ec1('0x4c')](_0x561f6f);})[_0x6ec1('0x2f')](function(_0x3133c6){_0x14f695[_0x6ec1('0x4d')]=_0x3133c6;return _0x14f695;})['then'](respondWithFilteredResult(_0x5d0704,_0x561f6f))[_0x6ec1('0x4e')](handleError(_0x5d0704,null));};exports['show']=function(_0x4a60d2,_0x59756a){var _0x35451e={'raw':![],'where':{'id':_0x4a60d2[_0x6ec1('0x4f')]['id']}},_0x5a77c9={};_0x5a77c9[_0x6ec1('0x35')]=_[_0x6ec1('0x37')](db['ZohoAccount'][_0x6ec1('0x50')]);_0x5a77c9[_0x6ec1('0x36')]=_[_0x6ec1('0x37')](_0x4a60d2[_0x6ec1('0x36')]);_0x5a77c9[_0x6ec1('0x38')]=_[_0x6ec1('0x3a')](_0x5a77c9[_0x6ec1('0x35')],_0x5a77c9[_0x6ec1('0x36')]);_0x35451e[_0x6ec1('0x39')]=_[_0x6ec1('0x3a')](_0x5a77c9['model'],qs[_0x6ec1('0x3b')](_0x4a60d2[_0x6ec1('0x36')][_0x6ec1('0x3b')]));_0x35451e[_0x6ec1('0x39')]=_0x35451e['attributes'][_0x6ec1('0x3c')]?_0x35451e[_0x6ec1('0x39')]:_0x5a77c9[_0x6ec1('0x35')];if(_0x4a60d2[_0x6ec1('0x36')][_0x6ec1('0x51')]){_0x35451e[_0x6ec1('0x4b')]=[{'all':!![]}];}_0x35451e=_['merge']({},_0x35451e,_0x4a60d2['options']);return db['ZohoAccount'][_0x6ec1('0x52')](_0x35451e)['then'](handleEntityNotFound(_0x59756a,null))['then'](respondWithResult(_0x59756a,null))[_0x6ec1('0x4e')](handleError(_0x59756a,null));};exports[_0x6ec1('0x53')]=function(_0x32904b,_0x5bb97f){return db[_0x6ec1('0x49')]['create'](_0x32904b['body'],{})[_0x6ec1('0x2f')](respondWithResult(_0x5bb97f,0xc9))[_0x6ec1('0x4e')](handleError(_0x5bb97f,null));};exports['update']=function(_0x233c07,_0x11c989){if(_0x233c07[_0x6ec1('0x54')]['id']){delete _0x233c07[_0x6ec1('0x54')]['id'];}return db['ZohoAccount'][_0x6ec1('0x52')]({'where':{'id':_0x233c07[_0x6ec1('0x4f')]['id']}})[_0x6ec1('0x2f')](handleEntityNotFound(_0x11c989,null))[_0x6ec1('0x2f')](saveUpdates(_0x233c07[_0x6ec1('0x54')],null))[_0x6ec1('0x2f')](respondWithResult(_0x11c989,null))['catch'](handleError(_0x11c989,null));};exports['destroy']=function(_0x54bcc3,_0x38e220){return db[_0x6ec1('0x49')][_0x6ec1('0x52')]({'where':{'id':_0x54bcc3[_0x6ec1('0x4f')]['id']}})[_0x6ec1('0x2f')](handleEntityNotFound(_0x38e220,null))['then'](removeEntity(_0x38e220,null))['catch'](handleError(_0x38e220,null));};exports[_0x6ec1('0x55')]=function(_0x1ac8a3,_0x3ec6d8,_0x25220e){var _0x1ad2f0={};var _0x414d86={};var _0x2b2f97;var _0x402de9;return db[_0x6ec1('0x49')]['findOne']({'where':{'id':_0x1ac8a3[_0x6ec1('0x4f')]['id']}})[_0x6ec1('0x2f')](handleEntityNotFound(_0x3ec6d8,null))[_0x6ec1('0x2f')](function(_0x105246){if(_0x105246){_0x2b2f97=_0x105246;_0x414d86[_0x6ec1('0x35')]=_[_0x6ec1('0x37')](db[_0x6ec1('0x56')][_0x6ec1('0x50')]);_0x414d86['query']=_[_0x6ec1('0x37')](_0x1ac8a3[_0x6ec1('0x36')]);_0x414d86['filters']=_['intersection'](_0x414d86[_0x6ec1('0x35')],_0x414d86[_0x6ec1('0x36')]);_0x1ad2f0[_0x6ec1('0x39')]=_[_0x6ec1('0x3a')](_0x414d86[_0x6ec1('0x35')],qs[_0x6ec1('0x3b')](_0x1ac8a3[_0x6ec1('0x36')][_0x6ec1('0x3b')]));_0x1ad2f0[_0x6ec1('0x39')]=_0x1ad2f0['attributes'][_0x6ec1('0x3c')]?_0x1ad2f0[_0x6ec1('0x39')]:_0x414d86[_0x6ec1('0x35')];_0x1ad2f0[_0x6ec1('0x3f')]=qs[_0x6ec1('0x40')](_0x1ac8a3[_0x6ec1('0x36')][_0x6ec1('0x40')]);_0x1ad2f0[_0x6ec1('0x41')]=qs[_0x6ec1('0x38')](_[_0x6ec1('0x57')](_0x1ac8a3[_0x6ec1('0x36')],_0x414d86['filters']));if(_0x1ac8a3[_0x6ec1('0x36')]['filter']){_0x1ad2f0[_0x6ec1('0x41')]=_[_0x6ec1('0x43')](_0x1ad2f0[_0x6ec1('0x41')],{'$or':_[_0x6ec1('0x44')](_0x1ad2f0[_0x6ec1('0x39')],function(_0x40dabf){var _0x5a4865={};_0x5a4865[_0x40dabf]={'$like':'%'+_0x1ac8a3[_0x6ec1('0x36')]['filter']+'%'};return _0x5a4865;})});}_0x1ad2f0=_[_0x6ec1('0x43')]({},_0x1ad2f0,_0x1ac8a3['options']);return _0x2b2f97['getConfigurations'](_0x1ad2f0);}})[_0x6ec1('0x2f')](function(_0x1cba6b){if(_0x1cba6b){_0x402de9=_0x1cba6b['length'];if(!_0x1ac8a3[_0x6ec1('0x36')][_0x6ec1('0x3d')](_0x6ec1('0x3e'))){_0x1ad2f0[_0x6ec1('0x28')]=qs[_0x6ec1('0x28')](_0x1ac8a3[_0x6ec1('0x36')][_0x6ec1('0x28')]);_0x1ad2f0[_0x6ec1('0x27')]=qs[_0x6ec1('0x27')](_0x1ac8a3['query'][_0x6ec1('0x27')]);}return _0x2b2f97[_0x6ec1('0x55')](_0x1ad2f0);}})[_0x6ec1('0x2f')](function(_0x35ff4c){if(_0x35ff4c){return _0x35ff4c?{'count':_0x402de9,'rows':_0x35ff4c}:null;}})[_0x6ec1('0x2f')](respondWithResult(_0x3ec6d8,null))['catch'](handleError(_0x3ec6d8,null));};exports[_0x6ec1('0x58')]=function(_0x590b75,_0x58f06c,_0x4247f1){if(_0x590b75[_0x6ec1('0x54')]['id']){delete _0x590b75[_0x6ec1('0x54')]['id'];}return db[_0x6ec1('0x49')]['findOne']({'where':{'id':_0x590b75[_0x6ec1('0x4f')]['id']}})[_0x6ec1('0x2f')](handleEntityNotFound(_0x58f06c,null))[_0x6ec1('0x2f')](function(_0x488a6d){if(_0x488a6d){_0x590b75[_0x6ec1('0x54')][_0x6ec1('0x59')]=_0x488a6d['id'];_0x590b75[_0x6ec1('0x54')][_0x6ec1('0x5a')]=integrations['getSubjects'](_0x590b75[_0x6ec1('0x54')][_0x6ec1('0x5b')],_0x590b75['body'][_0x6ec1('0x5c')]);_0x590b75[_0x6ec1('0x54')]['Descriptions']=integrations[_0x6ec1('0x5d')](_0x590b75['body'][_0x6ec1('0x5b')],_0x590b75['body']['type']);return db[_0x6ec1('0x56')][_0x6ec1('0x53')](_0x590b75[_0x6ec1('0x54')],{'include':[{'model':db['ZohoField'],'as':'Subjects'},{'model':db['ZohoField'],'as':'Descriptions'}]});}return null;})[_0x6ec1('0x2f')](respondWithResult(_0x58f06c,null))[_0x6ec1('0x4e')](handleError(_0x58f06c,null));};exports[_0x6ec1('0x5e')]=function(_0x4bcf2a,_0x11aa6a,_0x510f5f){var _0x488810='';return db[_0x6ec1('0x49')][_0x6ec1('0x5f')]({'where':{'id':_0x4bcf2a['params']['id']},'attributes':['id',_0x6ec1('0x60'),_0x6ec1('0x61')]})['then'](handleEntityNotFound(_0x11aa6a,null))[_0x6ec1('0x2f')](function(_0x3b14b1){if(_0x3b14b1){_0x488810=_0x3b14b1[_0x6ec1('0x60')];var _0x4701f4=_0x488810[_0x6ec1('0x62')](-0x1);if(_0x4701f4==='/'){_0x488810=_0x488810[_0x6ec1('0x63')](0x0,_0x488810['lastIndexOf'](_0x4701f4));}return rp({'method':_0x6ec1('0x64'),'uri':util[_0x6ec1('0x65')](_0x6ec1('0x66'),_0x488810),'qs':{'authtoken':_0x3b14b1['authToken'],'scope':_0x6ec1('0x67')},'json':!![]});}})[_0x6ec1('0x2f')](function(_0x25cc14){if(_0x25cc14){if(_0x25cc14[_0x6ec1('0x68')]&&_0x25cc14['response'][_0x6ec1('0x1f')]){throw new Error(_0x25cc14['response'][_0x6ec1('0x1f')][_0x6ec1('0x21')]);}var _0x33b577=[];if(_0x25cc14['Calls']&&_0x25cc14['Calls'][_0x6ec1('0x69')]){if(_0x25cc14['Calls'][_0x6ec1('0x69')]['FL']){var _0x5a762e=[_0x6ec1('0x6a')];for(var _0x3b6337=0x0,_0x367344=_0x25cc14[_0x6ec1('0x6b')][_0x6ec1('0x69')]['FL'][_0x6ec1('0x3c')];_0x3b6337<_0x367344;_0x3b6337++){if(_['includes'](_0x5a762e,_0x25cc14[_0x6ec1('0x6b')][_0x6ec1('0x69')]['FL'][_0x3b6337]['dv'])){_0x33b577[_0x6ec1('0x6c')]({'id':_0x25cc14['Calls'][_0x6ec1('0x69')]['FL'][_0x3b6337]['dv'],'name':_0x25cc14[_0x6ec1('0x6b')][_0x6ec1('0x69')]['FL'][_0x3b6337][_0x6ec1('0x6d')],'custom':_0x25cc14[_0x6ec1('0x6b')][_0x6ec1('0x69')]['FL'][_0x3b6337][_0x6ec1('0x6e')]===_0x6ec1('0x6f')?!![]:![],'options':_0x25cc14[_0x6ec1('0x6b')][_0x6ec1('0x69')]['FL'][_0x3b6337][_0x6ec1('0x5c')]===_0x6ec1('0x70')&&_0x25cc14[_0x6ec1('0x6b')][_0x6ec1('0x69')]['FL'][_0x3b6337][_0x6ec1('0x71')]?_[_0x6ec1('0x44')](_0x25cc14[_0x6ec1('0x6b')][_0x6ec1('0x69')]['FL'][_0x3b6337][_0x6ec1('0x71')],function(_0x3e5f1f){return{'name':_0x3e5f1f,'value':_0x3e5f1f};}):[]});}}}}return{'count':_0x33b577[_0x6ec1('0x3c')],'rows':_0x33b577};}})[_0x6ec1('0x2f')](respondWithResult(_0x11aa6a,null))[_0x6ec1('0x4e')](function(_0x86a5d9){var _0x3c07e4=_0x4bcf2a[_0x6ec1('0x36')][_0x6ec1('0x17')]?0x1f4:_0x86a5d9['statusCode']||0x1f4;logger[_0x6ec1('0x1f')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x3c07e4,JSON[_0x6ec1('0x1e')](_0x86a5d9));delete _0x86a5d9[_0x6ec1('0x32')];if(_0x3c07e4===0x191){_0x3c07e4=0x190;}_0x11aa6a[_0x6ec1('0x24')](_0x3c07e4)['send'](_0x4bcf2a[_0x6ec1('0x36')][_0x6ec1('0x17')]?{'message':_0x6ec1('0x72'),'statusCode':_0x86a5d9[_0x6ec1('0x73')]}:_0x86a5d9);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 4ce2245..d84d602 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 _0x1b47=['../../components/integrations/configuration','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intZohoAccount.attributes'];(function(_0x18e076,_0x31ceb9){var _0x299a40=function(_0xfddf3){while(--_0xfddf3){_0x18e076['push'](_0x18e076['shift']());}};_0x299a40(++_0x31ceb9);}(_0x1b47,0xfa));var _0x71b4=function(_0x3c37f5,_0x464875){_0x3c37f5=_0x3c37f5-0x0;var _0x5c25d7=_0x1b47[_0x3c37f5];return _0x5c25d7;};'use strict';var _=require(_0x71b4('0x0'));var util=require(_0x71b4('0x1'));var logger=require(_0x71b4('0x2'))(_0x71b4('0x3'));var moment=require(_0x71b4('0x4'));var BPromise=require(_0x71b4('0x5'));var rp=require(_0x71b4('0x6'));var fs=require('fs');var path=require(_0x71b4('0x7'));var rimraf=require('rimraf');var config=require(_0x71b4('0x8'));var attributes=require(_0x71b4('0x9'));var integrations=require(_0x71b4('0xa'));module[_0x71b4('0xb')]=function(_0x12ed3a,_0x18bc64){return _0x12ed3a[_0x71b4('0xc')]('ZohoAccount',attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x15a5=['request-promise','rimraf','../../config/environment','./intZohoAccount.attributes','exports','define','int_zoho_accounts','lodash','util','api'];(function(_0x1e441f,_0x51dcad){var _0x5dc8d4=function(_0x2a9696){while(--_0x2a9696){_0x1e441f['push'](_0x1e441f['shift']());}};_0x5dc8d4(++_0x51dcad);}(_0x15a5,0x75));var _0x515a=function(_0x44b478,_0x269d03){_0x44b478=_0x44b478-0x0;var _0x4570b0=_0x15a5[_0x44b478];return _0x4570b0;};'use strict';var _=require(_0x515a('0x0'));var util=require(_0x515a('0x1'));var logger=require('../../config/logger')(_0x515a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x515a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x515a('0x4'));var config=require(_0x515a('0x5'));var attributes=require(_0x515a('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x515a('0x7')]=function(_0x3bcc26,_0x5cb32d){return _0x3bcc26[_0x515a('0x8')]('ZohoAccount',attributes,{'tableName':_0x515a('0x9'),'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 21fc137..c3a6870 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 _0xfb9f=['error','code','message','ZohoAccount,\x20%s,\x20%s','ZohoAccount','findAll','options','raw','where','limit','include','attributes','model','map','GetZohoAccount','ShowZohoAccount','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x13045b,_0x4adcb5){var _0x116c02=function(_0xee5840){while(--_0xee5840){_0x13045b['push'](_0x13045b['shift']());}};_0x116c02(++_0x4adcb5);}(_0xfb9f,0x187));var _0xffb9=function(_0x188dc0,_0xc97417){_0x188dc0=_0x188dc0-0x0;var _0x4d5cac=_0xfb9f[_0x188dc0];return _0x4d5cac;};'use strict';var _=require('lodash');var util=require(_0xffb9('0x0'));var moment=require(_0xffb9('0x1'));var BPromise=require(_0xffb9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xffb9('0x3'))['db'];var utils=require(_0xffb9('0x4'));var logger=require(_0xffb9('0x5'))('rpc');var config=require(_0xffb9('0x6'));var jayson=require(_0xffb9('0x7'));var client=jayson[_0xffb9('0x8')][_0xffb9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d6de6,_0x4f1743,_0x277636){return new BPromise(function(_0x2092a2,_0xd032f){return client[_0xffb9('0xa')](_0x5d6de6,_0x277636)[_0xffb9('0xb')](function(_0x21e952){logger[_0xffb9('0xc')]('ZohoAccount,\x20%s,\x20%s',_0x4f1743,_0xffb9('0xd'));logger[_0xffb9('0xe')](_0xffb9('0xf'),_0x4f1743,_0xffb9('0xd'),JSON[_0xffb9('0x10')](_0x21e952));if(_0x21e952[_0xffb9('0x11')]){if(_0x21e952[_0xffb9('0x11')][_0xffb9('0x12')]===0x1f4){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x4f1743,_0x21e952[_0xffb9('0x11')][_0xffb9('0x13')]);return _0xd032f(_0x21e952[_0xffb9('0x11')][_0xffb9('0x13')]);}logger['error'](_0xffb9('0x14'),_0x4f1743,_0x21e952[_0xffb9('0x11')][_0xffb9('0x13')]);return _0x2092a2(_0x21e952[_0xffb9('0x11')][_0xffb9('0x13')]);}else{logger['info']('ZohoAccount,\x20%s,\x20%s',_0x4f1743,_0xffb9('0xd'));_0x2092a2(_0x21e952['result'][_0xffb9('0x13')]);}})['catch'](function(_0x364331){logger[_0xffb9('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x4f1743,_0x364331);_0xd032f(_0x364331);});});}exports['GetZohoAccount']=function(_0x243a7b){var _0xeec9e4=this;return new Promise(function(_0x9b64d0,_0x4a259d){return db[_0xffb9('0x15')][_0xffb9('0x16')]({'raw':_0x243a7b[_0xffb9('0x17')]?_0x243a7b['options'][_0xffb9('0x18')]===undefined?!![]:![]:!![],'where':_0x243a7b[_0xffb9('0x17')]?_0x243a7b[_0xffb9('0x17')][_0xffb9('0x19')]||null:null,'attributes':_0x243a7b[_0xffb9('0x17')]?_0x243a7b[_0xffb9('0x17')]['attributes']||null:null,'limit':_0x243a7b[_0xffb9('0x17')]?_0x243a7b[_0xffb9('0x17')][_0xffb9('0x1a')]||null:null,'include':_0x243a7b['options']?_0x243a7b[_0xffb9('0x17')][_0xffb9('0x1b')]?_['map'](_0x243a7b['options'][_0xffb9('0x1b')],function(_0x78714d){return{'model':db[_0x78714d['model']],'as':_0x78714d['as'],'attributes':_0x78714d[_0xffb9('0x1c')],'include':_0x78714d[_0xffb9('0x1b')]?_['map'](_0x78714d[_0xffb9('0x1b')],function(_0x56557d){return{'model':db[_0x56557d[_0xffb9('0x1d')]],'as':_0x56557d['as'],'attributes':_0x56557d[_0xffb9('0x1c')],'include':_0x56557d[_0xffb9('0x1b')]?_[_0xffb9('0x1e')](_0x56557d[_0xffb9('0x1b')],function(_0x5e9f44){return{'model':db[_0x5e9f44[_0xffb9('0x1d')]],'as':_0x5e9f44['as'],'attributes':_0x5e9f44[_0xffb9('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x55b844){logger[_0xffb9('0xc')]('GetZohoAccount',_0x243a7b);logger['debug']('GetZohoAccount',_0x243a7b,JSON[_0xffb9('0x10')](_0x55b844));_0x9b64d0(_0x55b844);})['catch'](function(_0x57d955){logger[_0xffb9('0x11')](_0xffb9('0x1f'),_0x57d955[_0xffb9('0x13')],_0x243a7b);_0x4a259d(_0xeec9e4['error'](0x1f4,_0x57d955[_0xffb9('0x13')]));});});};exports[_0xffb9('0x20')]=function(_0x18bb77){var _0x5c5f0c=this;return new Promise(function(_0x542d78,_0x2df3fa){return db[_0xffb9('0x15')]['find']({'raw':_0x18bb77[_0xffb9('0x17')]?_0x18bb77['options'][_0xffb9('0x18')]===undefined?!![]:![]:!![],'where':_0x18bb77[_0xffb9('0x17')]?_0x18bb77[_0xffb9('0x17')][_0xffb9('0x19')]||null:null,'attributes':_0x18bb77[_0xffb9('0x17')]?_0x18bb77[_0xffb9('0x17')][_0xffb9('0x1c')]||null:null,'include':_0x18bb77['options']?_0x18bb77[_0xffb9('0x17')][_0xffb9('0x1b')]?_[_0xffb9('0x1e')](_0x18bb77[_0xffb9('0x17')][_0xffb9('0x1b')],function(_0x1a9a22){return{'model':db[_0x1a9a22[_0xffb9('0x1d')]],'as':_0x1a9a22['as'],'attributes':_0x1a9a22[_0xffb9('0x1c')],'include':_0x1a9a22[_0xffb9('0x1b')]?_[_0xffb9('0x1e')](_0x1a9a22['include'],function(_0x38aa9e){return{'model':db[_0x38aa9e[_0xffb9('0x1d')]],'as':_0x38aa9e['as'],'attributes':_0x38aa9e[_0xffb9('0x1c')],'include':_0x38aa9e['include']?_[_0xffb9('0x1e')](_0x38aa9e[_0xffb9('0x1b')],function(_0x362342){return{'model':db[_0x362342[_0xffb9('0x1d')]],'as':_0x362342['as'],'attributes':_0x362342[_0xffb9('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x385fb6){logger['info'](_0xffb9('0x20'),_0x18bb77);logger[_0xffb9('0xe')](_0xffb9('0x20'),_0x18bb77,JSON[_0xffb9('0x10')](_0x385fb6));_0x542d78(_0x385fb6);})[_0xffb9('0x21')](function(_0x3e2604){logger[_0xffb9('0x11')](_0xffb9('0x20'),_0x3e2604['message'],_0x18bb77);_0x2df3fa(_0x5c5f0c[_0xffb9('0x11')](0x1f4,_0x3e2604[_0xffb9('0x13')]));});});}; \ No newline at end of file +var _0x0381=['catch','ZohoAccount','findAll','options','where','attributes','limit','include','map','GetZohoAccount','ShowZohoAccount','model','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0xb5e7c7,_0x49ca9a){var _0x3e6e00=function(_0x5292e3){while(--_0x5292e3){_0xb5e7c7['push'](_0xb5e7c7['shift']());}};_0x3e6e00(++_0x49ca9a);}(_0x0381,0x13e));var _0x1038=function(_0x57a84c,_0x36d73d){_0x57a84c=_0x57a84c-0x0;var _0x2e0d2d=_0x0381[_0x57a84c];return _0x2e0d2d;};'use strict';var _=require(_0x1038('0x0'));var util=require('util');var moment=require(_0x1038('0x1'));var BPromise=require(_0x1038('0x2'));var rs=require(_0x1038('0x3'));var fs=require('fs');var Redis=require(_0x1038('0x4'));var db=require(_0x1038('0x5'))['db'];var utils=require(_0x1038('0x6'));var logger=require('../../config/logger')(_0x1038('0x7'));var config=require(_0x1038('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1038('0x9')][_0x1038('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b1803,_0x164e3f,_0x41334e){return new BPromise(function(_0x6e7e40,_0x2d2c3d){return client['request'](_0x3b1803,_0x41334e)[_0x1038('0xb')](function(_0x344ac4){logger[_0x1038('0xc')](_0x1038('0xd'),_0x164e3f,_0x1038('0xe'));logger[_0x1038('0xf')](_0x1038('0x10'),_0x164e3f,_0x1038('0xe'),JSON[_0x1038('0x11')](_0x344ac4));if(_0x344ac4[_0x1038('0x12')]){if(_0x344ac4[_0x1038('0x12')][_0x1038('0x13')]===0x1f4){logger[_0x1038('0x12')](_0x1038('0xd'),_0x164e3f,_0x344ac4[_0x1038('0x12')][_0x1038('0x14')]);return _0x2d2c3d(_0x344ac4[_0x1038('0x12')][_0x1038('0x14')]);}logger['error']('ZohoAccount,\x20%s,\x20%s',_0x164e3f,_0x344ac4[_0x1038('0x12')][_0x1038('0x14')]);return _0x6e7e40(_0x344ac4['error'][_0x1038('0x14')]);}else{logger[_0x1038('0xc')](_0x1038('0xd'),_0x164e3f,_0x1038('0xe'));_0x6e7e40(_0x344ac4[_0x1038('0x15')][_0x1038('0x14')]);}})[_0x1038('0x16')](function(_0x582993){logger[_0x1038('0x12')](_0x1038('0xd'),_0x164e3f,_0x582993);_0x2d2c3d(_0x582993);});});}exports['GetZohoAccount']=function(_0x60e851){var _0x4e2cdd=this;return new Promise(function(_0x3f3297,_0x488b3e){return db[_0x1038('0x17')][_0x1038('0x18')]({'raw':_0x60e851['options']?_0x60e851[_0x1038('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x60e851[_0x1038('0x19')]?_0x60e851['options'][_0x1038('0x1a')]||null:null,'attributes':_0x60e851[_0x1038('0x19')]?_0x60e851[_0x1038('0x19')][_0x1038('0x1b')]||null:null,'limit':_0x60e851[_0x1038('0x19')]?_0x60e851[_0x1038('0x19')][_0x1038('0x1c')]||null:null,'include':_0x60e851[_0x1038('0x19')]?_0x60e851['options'][_0x1038('0x1d')]?_[_0x1038('0x1e')](_0x60e851[_0x1038('0x19')][_0x1038('0x1d')],function(_0xd8ec65){return{'model':db[_0xd8ec65['model']],'as':_0xd8ec65['as'],'attributes':_0xd8ec65[_0x1038('0x1b')],'include':_0xd8ec65['include']?_['map'](_0xd8ec65[_0x1038('0x1d')],function(_0x292681){return{'model':db[_0x292681['model']],'as':_0x292681['as'],'attributes':_0x292681['attributes'],'include':_0x292681[_0x1038('0x1d')]?_['map'](_0x292681[_0x1038('0x1d')],function(_0x22abf7){return{'model':db[_0x22abf7['model']],'as':_0x22abf7['as'],'attributes':_0x22abf7[_0x1038('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1038('0xb')](function(_0x21a48d){logger['info']('GetZohoAccount',_0x60e851);logger[_0x1038('0xf')](_0x1038('0x1f'),_0x60e851,JSON[_0x1038('0x11')](_0x21a48d));_0x3f3297(_0x21a48d);})[_0x1038('0x16')](function(_0xf964a5){logger['error'](_0x1038('0x1f'),_0xf964a5[_0x1038('0x14')],_0x60e851);_0x488b3e(_0x4e2cdd['error'](0x1f4,_0xf964a5[_0x1038('0x14')]));});});};exports[_0x1038('0x20')]=function(_0x317935){var _0x286b80=this;return new Promise(function(_0x20448a,_0x1c05e2){return db[_0x1038('0x17')]['find']({'raw':_0x317935[_0x1038('0x19')]?_0x317935[_0x1038('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x317935[_0x1038('0x19')]?_0x317935[_0x1038('0x19')]['where']||null:null,'attributes':_0x317935[_0x1038('0x19')]?_0x317935['options'][_0x1038('0x1b')]||null:null,'include':_0x317935[_0x1038('0x19')]?_0x317935['options']['include']?_[_0x1038('0x1e')](_0x317935['options'][_0x1038('0x1d')],function(_0x333a9e){return{'model':db[_0x333a9e[_0x1038('0x21')]],'as':_0x333a9e['as'],'attributes':_0x333a9e[_0x1038('0x1b')],'include':_0x333a9e['include']?_[_0x1038('0x1e')](_0x333a9e[_0x1038('0x1d')],function(_0x5c3d6a){return{'model':db[_0x5c3d6a[_0x1038('0x21')]],'as':_0x5c3d6a['as'],'attributes':_0x5c3d6a[_0x1038('0x1b')],'include':_0x5c3d6a[_0x1038('0x1d')]?_[_0x1038('0x1e')](_0x5c3d6a['include'],function(_0x1b134d){return{'model':db[_0x1b134d[_0x1038('0x21')]],'as':_0x1b134d['as'],'attributes':_0x1b134d[_0x1038('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1038('0xb')](function(_0x4aa707){logger[_0x1038('0xc')](_0x1038('0x20'),_0x317935);logger[_0x1038('0xf')](_0x1038('0x20'),_0x317935,JSON['stringify'](_0x4aa707));_0x20448a(_0x4aa707);})[_0x1038('0x16')](function(_0x3f8796){logger[_0x1038('0x12')](_0x1038('0x20'),_0x3f8796[_0x1038('0x14')],_0x317935);_0x1c05e2(_0x286b80['error'](0x1f4,_0x3f8796['message']));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index d7d854a..77e1ea8 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 _0x975f=['exports','multer','util','express','Router','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','index','/:id','isAuthenticated','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete','destroy'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0x975f,0x109));var _0xf975=function(_0x1385dc,_0x2c7fd7){_0x1385dc=_0x1385dc-0x0;var _0x2f6469=_0x975f[_0x1385dc];return _0x2f6469;};'use strict';var multer=require(_0xf975('0x0'));var util=require(_0xf975('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf975('0x2'));var router=express[_0xf975('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xf975('0x4'));var config=require(_0xf975('0x5'));var controller=require(_0xf975('0x6'));router[_0xf975('0x7')]('/',auth['isAuthenticated'](),controller[_0xf975('0x8')]);router[_0xf975('0x7')](_0xf975('0x9'),auth[_0xf975('0xa')](),controller['show']);router[_0xf975('0x7')](_0xf975('0xb'),auth[_0xf975('0xa')](),controller['getFields']);router[_0xf975('0x7')](_0xf975('0xc'),auth['isAuthenticated'](),controller[_0xf975('0xd')]);router[_0xf975('0x7')](_0xf975('0xe'),auth[_0xf975('0xa')](),controller[_0xf975('0xf')]);router[_0xf975('0x10')]('/',auth[_0xf975('0xa')](),controller['create']);router[_0xf975('0x11')](_0xf975('0x9'),auth['isAuthenticated'](),controller[_0xf975('0x12')]);router[_0xf975('0x13')](_0xf975('0x9'),auth[_0xf975('0xa')](),controller[_0xf975('0x14')]);module[_0xf975('0x15')]=router; \ No newline at end of file +var _0x5cb5=['exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','put','update','delete','destroy'];(function(_0x22ee77,_0x43235){var _0xe5cc29=function(_0x5a4afe){while(--_0x5a4afe){_0x22ee77['push'](_0x22ee77['shift']());}};_0xe5cc29(++_0x43235);}(_0x5cb5,0xd9));var _0x55cb=function(_0x4f5556,_0x485819){_0x4f5556=_0x4f5556-0x0;var _0x57271a=_0x5cb5[_0x4f5556];return _0x57271a;};'use strict';var multer=require(_0x55cb('0x0'));var util=require('util');var path=require(_0x55cb('0x1'));var timeout=require(_0x55cb('0x2'));var express=require(_0x55cb('0x3'));var router=express[_0x55cb('0x4')]();var auth=require(_0x55cb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x55cb('0x6'));var controller=require(_0x55cb('0x7'));router[_0x55cb('0x8')]('/',auth[_0x55cb('0x9')](),controller[_0x55cb('0xa')]);router[_0x55cb('0x8')](_0x55cb('0xb'),auth[_0x55cb('0x9')](),controller[_0x55cb('0xc')]);router[_0x55cb('0x8')](_0x55cb('0xd'),auth[_0x55cb('0x9')](),controller[_0x55cb('0xe')]);router[_0x55cb('0x8')](_0x55cb('0xf'),auth[_0x55cb('0x9')](),controller[_0x55cb('0x10')]);router[_0x55cb('0x8')]('/:id/descriptions',auth[_0x55cb('0x9')](),controller[_0x55cb('0x11')]);router['post']('/',auth[_0x55cb('0x9')](),controller[_0x55cb('0x12')]);router[_0x55cb('0x13')](_0x55cb('0xb'),auth[_0x55cb('0x9')](),controller[_0x55cb('0x14')]);router[_0x55cb('0x15')](_0x55cb('0xb'),auth[_0x55cb('0x9')](),controller[_0x55cb('0x16')]);module[_0x55cb('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 066fc5d..2a696f1 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 _0x7712=['exports','STRING','sequelize'];(function(_0x58b250,_0x210a75){var _0x2ad6d6=function(_0xfbc855){while(--_0xfbc855){_0x58b250['push'](_0x58b250['shift']());}};_0x2ad6d6(++_0x210a75);}(_0x7712,0x125));var _0x2771=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x7712[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0x2771('0x0'));module[_0x2771('0x1')]={'name':{'type':Sequelize[_0x2771('0x2')]},'description':{'type':Sequelize[_0x2771('0x2')]}}; \ No newline at end of file +var _0x61f7=['STRING','sequelize','exports'];(function(_0x547456,_0x1de17e){var _0xc1fd7b=function(_0x12be35){while(--_0x12be35){_0x547456['push'](_0x547456['shift']());}};_0xc1fd7b(++_0x1de17e);}(_0x61f7,0x163));var _0x761f=function(_0x2ce9ef,_0x100941){_0x2ce9ef=_0x2ce9ef-0x0;var _0x19ad79=_0x61f7[_0x2ce9ef];return _0x19ad79;};'use strict';var Sequelize=require(_0x761f('0x0'));module[_0x761f('0x1')]={'name':{'type':Sequelize[_0x761f('0x2')]},'description':{'type':Sequelize[_0x761f('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 9c654dc..a0d5e8f 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 _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(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xedd9,0xfc));var _0x9edd=function(_0x59db62,_0x463799){_0x59db62=_0x59db62-0x0;var _0x3584fe=_0xedd9[_0x59db62];return _0x3584fe;};'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 +var _0x54ef=['body','update','findOne','ZohoField','getFields','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','client','test','request','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','apply','reject','save','destroy','then','send','ZohoConfiguration','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','includeAll','include','rows','show','params','rawAttributes','options','find','create'];(function(_0x14cb6c,_0x3f8f4e){var _0x2fc395=function(_0x414098){while(--_0x414098){_0x14cb6c['push'](_0x14cb6c['shift']());}};_0x2fc395(++_0x3f8f4e);}(_0x54ef,0x112));var _0xf54e=function(_0x48ae7c,_0x4074b9){_0x48ae7c=_0x48ae7c-0x0;var _0x332f5e=_0x54ef[_0x48ae7c];return _0x332f5e;};'use strict';var pdf=require(_0xf54e('0x0'));var emlformat=require(_0xf54e('0x1'));var rimraf=require(_0xf54e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf54e('0x3'));var rp=require(_0xf54e('0x4'));var moment=require(_0xf54e('0x5'));var BPromise=require(_0xf54e('0x6'));var Mustache=require(_0xf54e('0x7'));var util=require(_0xf54e('0x8'));var path=require(_0xf54e('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf54e('0xa'));var fs=require('fs');var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var hardwareService=require(_0xf54e('0x13'));var logger=require('../../config/logger')(_0xf54e('0x14'));var utils=require(_0xf54e('0x15'));var config=require(_0xf54e('0x16'));var db=require(_0xf54e('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xf54e('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x4bd828,_0x15a9d4,_0x2033e9){if(_0x2033e9){var _0x28f776=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x28f776[_0xf54e('0x19')](_0x15a9d4)){return _0x4bd828;}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 _0x4bd828;}}function respondWithRpcPromise(_0x331732,_0x1bbeaa,_0x1855fe,_0x15f639){return new BPromise(function(_0x56828e,_0x2366ee){var _0x389abc=_0x15f639||client;return _0x389abc[_0xf54e('0x1a')](_0x331732,_0x1855fe)['then'](function(_0x4af633){logger[_0xf54e('0x1b')](_0xf54e('0x1c'),_0x1bbeaa,_0xf54e('0x1d'));logger[_0xf54e('0x1e')](_0xf54e('0x1f'),_0x1bbeaa,_0xf54e('0x1d'),JSON[_0xf54e('0x20')](_0x4af633));if(_0x4af633[_0xf54e('0x21')]){if(_0x4af633[_0xf54e('0x21')][_0xf54e('0x22')]===0x1f4){logger[_0xf54e('0x21')]('ZohoConfiguration,\x20%s,\x20%s',_0x1bbeaa,_0x4af633['error'][_0xf54e('0x23')]);return _0x2366ee(_0x4af633['error'][_0xf54e('0x23')]);}logger[_0xf54e('0x21')](_0xf54e('0x1c'),_0x1bbeaa,_0x4af633[_0xf54e('0x21')][_0xf54e('0x23')]);return _0x56828e(_0x4af633[_0xf54e('0x21')][_0xf54e('0x23')]);}else{logger[_0xf54e('0x1b')](_0xf54e('0x1c'),_0x1bbeaa,_0xf54e('0x1d'));_0x56828e(_0x4af633[_0xf54e('0x24')]['message']);}})[_0xf54e('0x25')](function(_0x54f914){logger[_0xf54e('0x21')](_0xf54e('0x1c'),_0x1bbeaa,_0x54f914);_0x2366ee(_0x54f914);});});}function respondWithStatusCode(_0x335492,_0x474b61){_0x474b61=_0x474b61||0xcc;return function(_0x3805a7){if(_0x3805a7){return _0x335492[_0xf54e('0x26')](_0x474b61);}return _0x335492[_0xf54e('0x27')](_0x474b61)[_0xf54e('0x28')]();};}function respondWithResult(_0x2342a9,_0x33457f){_0x33457f=_0x33457f||0xc8;return function(_0xf6cdd7){if(_0xf6cdd7){return _0x2342a9[_0xf54e('0x27')](_0x33457f)[_0xf54e('0x29')](_0xf6cdd7);}};}function respondWithFilteredResult(_0x5390b8,_0xb3706e){return function(_0x4cbf7c){if(_0x4cbf7c){var _0x282c63=_0x4cbf7c[_0xf54e('0x2a')],_0x5e63f4=_0xb3706e[_0xf54e('0x2b')],_0x15b888=_0xb3706e[_0xf54e('0x2b')]+_0xb3706e[_0xf54e('0x2c')],_0x269f47;if(_0x15b888>=_0x282c63){_0x15b888=_0x282c63;_0x269f47=0xc8;}else{_0x269f47=0xce;}_0x5390b8[_0xf54e('0x27')](_0x269f47);return _0x5390b8['set']('Content-Range',_0x5e63f4+'-'+_0x15b888+'/'+_0x282c63)[_0xf54e('0x29')](_0x4cbf7c);}return null;};}function patchUpdates(_0x258d29){return function(_0x2ec92e){try{jsonpatch[_0xf54e('0x2d')](_0x2ec92e,_0x258d29,!![]);}catch(_0xb2d4c4){return BPromise[_0xf54e('0x2e')](_0xb2d4c4);}return _0x2ec92e[_0xf54e('0x2f')]();};}function saveUpdates(_0x850eb9,_0x3ae704){return function(_0x12edc3){if(_0x12edc3){return _0x12edc3['update'](_0x850eb9)['then'](function(_0x324976){return _0x324976;});}return null;};}function removeEntity(_0x3169dd,_0x4d8fdd){return function(_0x3e319c){if(_0x3e319c){return _0x3e319c[_0xf54e('0x30')]()[_0xf54e('0x31')](function(){_0x3169dd[_0xf54e('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54bea4,_0x4bb173){return function(_0x3c0cca){if(!_0x3c0cca){_0x54bea4[_0xf54e('0x26')](0x194);}return _0x3c0cca;};}function handleError(_0x210d6d,_0x399e68){_0x399e68=_0x399e68||0x1f4;return function(_0x29dc39){logger[_0xf54e('0x21')](_0x29dc39['stack']);if(_0x29dc39['name']){delete _0x29dc39['name'];}_0x210d6d[_0xf54e('0x27')](_0x399e68)[_0xf54e('0x32')](_0x29dc39);};}exports['index']=function(_0x4d9b06,_0xda1d10){var _0x2c0d30={},_0x173e6c={},_0x4a347a={'count':0x0,'rows':[]};var _0x14ecc8=db[_0xf54e('0x33')]['rawAttributes'];_0x173e6c[_0xf54e('0x34')]=_[_0xf54e('0x35')](_0x14ecc8);_0x173e6c[_0xf54e('0x36')]=_[_0xf54e('0x35')](_0x4d9b06[_0xf54e('0x36')]);_0x173e6c[_0xf54e('0x37')]=_['intersection'](_0x173e6c['model'],_0x173e6c[_0xf54e('0x36')]);_0x2c0d30[_0xf54e('0x38')]=_[_0xf54e('0x39')](_0x173e6c['model'],qs[_0xf54e('0x3a')](_0x4d9b06[_0xf54e('0x36')][_0xf54e('0x3a')]));_0x2c0d30[_0xf54e('0x38')]=_0x2c0d30[_0xf54e('0x38')][_0xf54e('0x3b')]?_0x2c0d30[_0xf54e('0x38')]:_0x173e6c[_0xf54e('0x34')];if(!_0x4d9b06[_0xf54e('0x36')][_0xf54e('0x3c')](_0xf54e('0x3d'))){_0x2c0d30[_0xf54e('0x2c')]=qs[_0xf54e('0x2c')](_0x4d9b06[_0xf54e('0x36')][_0xf54e('0x2c')]);_0x2c0d30['offset']=qs['offset'](_0x4d9b06['query'][_0xf54e('0x2b')]);}_0x2c0d30[_0xf54e('0x3e')]=qs['sort'](_0x4d9b06[_0xf54e('0x36')][_0xf54e('0x3f')]);_0x2c0d30[_0xf54e('0x40')]=qs['filters'](_[_0xf54e('0x41')](_0x4d9b06[_0xf54e('0x36')],_0x173e6c[_0xf54e('0x37')]));if(_0x4d9b06[_0xf54e('0x36')][_0xf54e('0x42')]){_0x2c0d30[_0xf54e('0x40')]=_[_0xf54e('0x43')](_0x2c0d30[_0xf54e('0x40')],{'$or':_[_0xf54e('0x44')](_0x14ecc8,function(_0x47bedd){if(_0x47bedd[_0xf54e('0x45')][_0xf54e('0x46')]!==_0xf54e('0x47')){var _0x32884a={};_0x32884a[_0x47bedd[_0xf54e('0x48')]]={'$like':'%'+_0x4d9b06[_0xf54e('0x36')]['filter']+'%'};return _0x32884a;}})});}_0x2c0d30=_[_0xf54e('0x43')]({},_0x2c0d30,_0x4d9b06['options']);var _0x1d16e0={'where':_0x2c0d30['where']};return db[_0xf54e('0x33')][_0xf54e('0x2a')](_0x1d16e0)[_0xf54e('0x31')](function(_0x57371d){_0x4a347a[_0xf54e('0x2a')]=_0x57371d;if(_0x4d9b06[_0xf54e('0x36')][_0xf54e('0x49')]){_0x2c0d30[_0xf54e('0x4a')]=[{'all':!![]}];}return db[_0xf54e('0x33')]['findAll'](_0x2c0d30);})[_0xf54e('0x31')](function(_0x297737){_0x4a347a[_0xf54e('0x4b')]=_0x297737;return _0x4a347a;})[_0xf54e('0x31')](respondWithFilteredResult(_0xda1d10,_0x2c0d30))['catch'](handleError(_0xda1d10,null));};exports[_0xf54e('0x4c')]=function(_0xb28420,_0x554c1f){var _0x22c842={'raw':![],'where':{'id':_0xb28420[_0xf54e('0x4d')]['id']}},_0xd4d956={};_0xd4d956[_0xf54e('0x34')]=_['keys'](db[_0xf54e('0x33')][_0xf54e('0x4e')]);_0xd4d956[_0xf54e('0x36')]=_[_0xf54e('0x35')](_0xb28420[_0xf54e('0x36')]);_0xd4d956[_0xf54e('0x37')]=_[_0xf54e('0x39')](_0xd4d956[_0xf54e('0x34')],_0xd4d956[_0xf54e('0x36')]);_0x22c842[_0xf54e('0x38')]=_[_0xf54e('0x39')](_0xd4d956[_0xf54e('0x34')],qs[_0xf54e('0x3a')](_0xb28420[_0xf54e('0x36')][_0xf54e('0x3a')]));_0x22c842[_0xf54e('0x38')]=_0x22c842[_0xf54e('0x38')][_0xf54e('0x3b')]?_0x22c842[_0xf54e('0x38')]:_0xd4d956[_0xf54e('0x34')];if(_0xb28420['query']['includeAll']){_0x22c842[_0xf54e('0x4a')]=[{'all':!![]}];}_0x22c842=_[_0xf54e('0x43')]({},_0x22c842,_0xb28420[_0xf54e('0x4f')]);return db[_0xf54e('0x33')][_0xf54e('0x50')](_0x22c842)[_0xf54e('0x31')](handleEntityNotFound(_0x554c1f,null))[_0xf54e('0x31')](respondWithResult(_0x554c1f,null))[_0xf54e('0x25')](handleError(_0x554c1f,null));};exports[_0xf54e('0x51')]=function(_0xdf63c4,_0x1df308){return db['ZohoConfiguration'][_0xf54e('0x51')](_0xdf63c4[_0xf54e('0x52')],{})[_0xf54e('0x31')](respondWithResult(_0x1df308,0xc9))[_0xf54e('0x25')](handleError(_0x1df308,null));};exports[_0xf54e('0x53')]=function(_0x30f53b,_0x18a25f){if(_0x30f53b['body']['id']){delete _0x30f53b[_0xf54e('0x52')]['id'];}return db[_0xf54e('0x33')][_0xf54e('0x50')]({'where':{'id':_0x30f53b['params']['id']}})[_0xf54e('0x31')](handleEntityNotFound(_0x18a25f,null))['then'](saveUpdates(_0x30f53b[_0xf54e('0x52')],null))[_0xf54e('0x31')](respondWithResult(_0x18a25f,null))[_0xf54e('0x25')](handleError(_0x18a25f,null));};exports['destroy']=function(_0x1d8ccf,_0x30d10d){return db[_0xf54e('0x33')][_0xf54e('0x50')]({'where':{'id':_0x1d8ccf[_0xf54e('0x4d')]['id']}})[_0xf54e('0x31')](handleEntityNotFound(_0x30d10d,null))[_0xf54e('0x31')](removeEntity(_0x30d10d,null))['catch'](handleError(_0x30d10d,null));};exports['getFields']=function(_0x4270e1,_0x9ab4c4,_0x4f17dd){var _0x29743e={};var _0x49fd97={};var _0xf39552;var _0x528a64;return db[_0xf54e('0x33')][_0xf54e('0x54')]({'where':{'id':_0x4270e1[_0xf54e('0x4d')]['id']}})[_0xf54e('0x31')](handleEntityNotFound(_0x9ab4c4,null))[_0xf54e('0x31')](function(_0x1530c9){if(_0x1530c9){_0xf39552=_0x1530c9;_0x49fd97['model']=_['keys'](db[_0xf54e('0x55')][_0xf54e('0x4e')]);_0x49fd97['query']=_['keys'](_0x4270e1[_0xf54e('0x36')]);_0x49fd97['filters']=_[_0xf54e('0x39')](_0x49fd97[_0xf54e('0x34')],_0x49fd97[_0xf54e('0x36')]);_0x29743e[_0xf54e('0x38')]=_[_0xf54e('0x39')](_0x49fd97[_0xf54e('0x34')],qs[_0xf54e('0x3a')](_0x4270e1[_0xf54e('0x36')][_0xf54e('0x3a')]));_0x29743e[_0xf54e('0x38')]=_0x29743e[_0xf54e('0x38')][_0xf54e('0x3b')]?_0x29743e[_0xf54e('0x38')]:_0x49fd97[_0xf54e('0x34')];_0x29743e['order']=qs[_0xf54e('0x3f')](_0x4270e1[_0xf54e('0x36')][_0xf54e('0x3f')]);_0x29743e[_0xf54e('0x40')]=qs[_0xf54e('0x37')](_['pick'](_0x4270e1[_0xf54e('0x36')],_0x49fd97[_0xf54e('0x37')]));if(_0x4270e1['query']['filter']){_0x29743e[_0xf54e('0x40')]=_['merge'](_0x29743e[_0xf54e('0x40')],{'$or':_[_0xf54e('0x44')](_0x29743e[_0xf54e('0x38')],function(_0x9789b9){var _0x47a84f={};_0x47a84f[_0x9789b9]={'$like':'%'+_0x4270e1[_0xf54e('0x36')]['filter']+'%'};return _0x47a84f;})});}_0x29743e=_[_0xf54e('0x43')]({},_0x29743e,_0x4270e1[_0xf54e('0x4f')]);return _0xf39552[_0xf54e('0x56')](_0x29743e);}})['then'](function(_0x2d04db){if(_0x2d04db){_0x528a64=_0x2d04db['length'];if(!_0x4270e1[_0xf54e('0x36')][_0xf54e('0x3c')]('nolimit')){_0x29743e[_0xf54e('0x2c')]=qs['limit'](_0x4270e1[_0xf54e('0x36')][_0xf54e('0x2c')]);_0x29743e[_0xf54e('0x2b')]=qs[_0xf54e('0x2b')](_0x4270e1[_0xf54e('0x36')]['offset']);}return _0xf39552[_0xf54e('0x56')](_0x29743e);}})[_0xf54e('0x31')](function(_0x57db6f){if(_0x57db6f){return _0x57db6f?{'count':_0x528a64,'rows':_0x57db6f}:null;}})[_0xf54e('0x31')](respondWithResult(_0x9ab4c4,null))[_0xf54e('0x25')](handleError(_0x9ab4c4,null));};exports['getSubjects']=function(_0x8e7a38,_0x14aaf7,_0x309895){var _0x4c72ef={};var _0xf4e4d={};var _0x4ae3d0;var _0x8ed40a;return db[_0xf54e('0x33')]['findOne']({'where':{'id':_0x8e7a38[_0xf54e('0x4d')]['id']}})[_0xf54e('0x31')](handleEntityNotFound(_0x14aaf7,null))[_0xf54e('0x31')](function(_0x3bdf23){if(_0x3bdf23){_0x4ae3d0=_0x3bdf23;_0xf4e4d[_0xf54e('0x34')]=_[_0xf54e('0x35')](db[_0xf54e('0x55')][_0xf54e('0x4e')]);_0xf4e4d[_0xf54e('0x36')]=_[_0xf54e('0x35')](_0x8e7a38[_0xf54e('0x36')]);_0xf4e4d['filters']=_[_0xf54e('0x39')](_0xf4e4d[_0xf54e('0x34')],_0xf4e4d[_0xf54e('0x36')]);_0x4c72ef['attributes']=_[_0xf54e('0x39')](_0xf4e4d[_0xf54e('0x34')],qs[_0xf54e('0x3a')](_0x8e7a38[_0xf54e('0x36')][_0xf54e('0x3a')]));_0x4c72ef[_0xf54e('0x38')]=_0x4c72ef[_0xf54e('0x38')]['length']?_0x4c72ef[_0xf54e('0x38')]:_0xf4e4d[_0xf54e('0x34')];_0x4c72ef[_0xf54e('0x3e')]=qs['sort'](_0x8e7a38[_0xf54e('0x36')][_0xf54e('0x3f')]);_0x4c72ef[_0xf54e('0x40')]=qs[_0xf54e('0x37')](_['pick'](_0x8e7a38['query'],_0xf4e4d[_0xf54e('0x37')]));if(_0x8e7a38[_0xf54e('0x36')][_0xf54e('0x42')]){_0x4c72ef[_0xf54e('0x40')]=_[_0xf54e('0x43')](_0x4c72ef[_0xf54e('0x40')],{'$or':_[_0xf54e('0x44')](_0x4c72ef[_0xf54e('0x38')],function(_0xf5108b){var _0x205b47={};_0x205b47[_0xf5108b]={'$like':'%'+_0x8e7a38['query'][_0xf54e('0x42')]+'%'};return _0x205b47;})});}_0x4c72ef=_[_0xf54e('0x43')]({},_0x4c72ef,_0x8e7a38[_0xf54e('0x4f')]);return _0x4ae3d0[_0xf54e('0x57')](_0x4c72ef);}})['then'](function(_0x2c3120){if(_0x2c3120){_0x8ed40a=_0x2c3120[_0xf54e('0x3b')];if(!_0x8e7a38[_0xf54e('0x36')][_0xf54e('0x3c')]('nolimit')){_0x4c72ef[_0xf54e('0x2c')]=qs[_0xf54e('0x2c')](_0x8e7a38[_0xf54e('0x36')]['limit']);_0x4c72ef['offset']=qs[_0xf54e('0x2b')](_0x8e7a38[_0xf54e('0x36')][_0xf54e('0x2b')]);}return _0x4ae3d0[_0xf54e('0x57')](_0x4c72ef);}})[_0xf54e('0x31')](function(_0x14b7fc){if(_0x14b7fc){return _0x14b7fc?{'count':_0x8ed40a,'rows':_0x14b7fc}:null;}})[_0xf54e('0x31')](respondWithResult(_0x14aaf7,null))[_0xf54e('0x25')](handleError(_0x14aaf7,null));};exports[_0xf54e('0x58')]=function(_0x4adf60,_0xa5de47,_0x3edfa0){var _0x4ce10={};var _0x37a61b={};var _0x395513;var _0x310ca9;return db[_0xf54e('0x33')][_0xf54e('0x54')]({'where':{'id':_0x4adf60[_0xf54e('0x4d')]['id']}})[_0xf54e('0x31')](handleEntityNotFound(_0xa5de47,null))[_0xf54e('0x31')](function(_0x418ecc){if(_0x418ecc){_0x395513=_0x418ecc;_0x37a61b['model']=_[_0xf54e('0x35')](db[_0xf54e('0x55')]['rawAttributes']);_0x37a61b['query']=_[_0xf54e('0x35')](_0x4adf60[_0xf54e('0x36')]);_0x37a61b[_0xf54e('0x37')]=_[_0xf54e('0x39')](_0x37a61b[_0xf54e('0x34')],_0x37a61b[_0xf54e('0x36')]);_0x4ce10[_0xf54e('0x38')]=_[_0xf54e('0x39')](_0x37a61b[_0xf54e('0x34')],qs['fields'](_0x4adf60[_0xf54e('0x36')][_0xf54e('0x3a')]));_0x4ce10[_0xf54e('0x38')]=_0x4ce10['attributes'][_0xf54e('0x3b')]?_0x4ce10['attributes']:_0x37a61b[_0xf54e('0x34')];_0x4ce10['order']=qs[_0xf54e('0x3f')](_0x4adf60[_0xf54e('0x36')]['sort']);_0x4ce10['where']=qs[_0xf54e('0x37')](_[_0xf54e('0x41')](_0x4adf60[_0xf54e('0x36')],_0x37a61b[_0xf54e('0x37')]));if(_0x4adf60[_0xf54e('0x36')]['filter']){_0x4ce10['where']=_[_0xf54e('0x43')](_0x4ce10[_0xf54e('0x40')],{'$or':_[_0xf54e('0x44')](_0x4ce10[_0xf54e('0x38')],function(_0x9afe5){var _0xe1205={};_0xe1205[_0x9afe5]={'$like':'%'+_0x4adf60[_0xf54e('0x36')][_0xf54e('0x42')]+'%'};return _0xe1205;})});}_0x4ce10=_[_0xf54e('0x43')]({},_0x4ce10,_0x4adf60[_0xf54e('0x4f')]);return _0x395513['getDescriptions'](_0x4ce10);}})[_0xf54e('0x31')](function(_0x1dec8a){if(_0x1dec8a){_0x310ca9=_0x1dec8a['length'];if(!_0x4adf60['query'][_0xf54e('0x3c')](_0xf54e('0x3d'))){_0x4ce10[_0xf54e('0x2c')]=qs[_0xf54e('0x2c')](_0x4adf60[_0xf54e('0x36')]['limit']);_0x4ce10[_0xf54e('0x2b')]=qs[_0xf54e('0x2b')](_0x4adf60[_0xf54e('0x36')][_0xf54e('0x2b')]);}return _0x395513['getDescriptions'](_0x4ce10);}})[_0xf54e('0x31')](function(_0x276402){if(_0x276402){return _0x276402?{'count':_0x310ca9,'rows':_0x276402}:null;}})[_0xf54e('0x31')](respondWithResult(_0xa5de47,null))[_0xf54e('0x25')](handleError(_0xa5de47,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 66d876a..3ebc40b 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 _0x04b8=['../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','util','api','moment','request-promise','path'];(function(_0x1608db,_0x25e1f7){var _0x44a70b=function(_0x5610d7){while(--_0x5610d7){_0x1608db['push'](_0x1608db['shift']());}};_0x44a70b(++_0x25e1f7);}(_0x04b8,0x159));var _0x804b=function(_0x59673a,_0x2ad6b2){_0x59673a=_0x59673a-0x0;var _0x139cca=_0x04b8[_0x59673a];return _0x139cca;};'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':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x23a3=['../../config/environment','./intZohoConfiguration.attributes','exports','ZohoConfiguration','int_zoho_configurations','api','bluebird','request-promise','path','rimraf'];(function(_0x4ba1e0,_0x460925){var _0x5d333b=function(_0x39ca4a){while(--_0x39ca4a){_0x4ba1e0['push'](_0x4ba1e0['shift']());}};_0x5d333b(++_0x460925);}(_0x23a3,0x131));var _0x323a=function(_0x440b4c,_0x5d2fa6){_0x440b4c=_0x440b4c-0x0;var _0x2391fd=_0x23a3[_0x440b4c];return _0x2391fd;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x323a('0x0'));var moment=require('moment');var BPromise=require(_0x323a('0x1'));var rp=require(_0x323a('0x2'));var fs=require('fs');var path=require(_0x323a('0x3'));var rimraf=require(_0x323a('0x4'));var config=require(_0x323a('0x5'));var attributes=require(_0x323a('0x6'));module[_0x323a('0x7')]=function(_0x3c1648,_0x14a418){return _0x3c1648['define'](_0x323a('0x8'),attributes,{'tableName':_0x323a('0x9'),'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 fdbc946..7afd470 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 _0xe805=['catch','lodash','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','result'];(function(_0x19fbb5,_0x38e68e){var _0x4ad2de=function(_0x5c9264){while(--_0x5c9264){_0x19fbb5['push'](_0x19fbb5['shift']());}};_0x4ad2de(++_0x38e68e);}(_0xe805,0x79));var _0x5e80=function(_0x123592,_0x22b59d){_0x123592=_0x123592-0x0;var _0x3156b9=_0xe805[_0x123592];return _0x3156b9;};'use strict';var _=require(_0x5e80('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5e80('0x1'));var rs=require(_0x5e80('0x2'));var fs=require('fs');var Redis=require(_0x5e80('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5e80('0x4'));var logger=require('../../config/logger')(_0x5e80('0x5'));var config=require(_0x5e80('0x6'));var jayson=require(_0x5e80('0x7'));var client=jayson[_0x5e80('0x8')][_0x5e80('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1cbf33,_0x42cc44,_0xac47de){return new BPromise(function(_0x21d466,_0x314f9b){return client[_0x5e80('0xa')](_0x1cbf33,_0xac47de)[_0x5e80('0xb')](function(_0xfdff79){logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x42cc44,'request\x20sent');logger['debug']('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x42cc44,_0x5e80('0xc'),JSON[_0x5e80('0xd')](_0xfdff79));if(_0xfdff79[_0x5e80('0xe')]){if(_0xfdff79[_0x5e80('0xe')][_0x5e80('0xf')]===0x1f4){logger[_0x5e80('0xe')](_0x5e80('0x10'),_0x42cc44,_0xfdff79['error']['message']);return _0x314f9b(_0xfdff79[_0x5e80('0xe')]['message']);}logger[_0x5e80('0xe')](_0x5e80('0x10'),_0x42cc44,_0xfdff79[_0x5e80('0xe')][_0x5e80('0x11')]);return _0x21d466(_0xfdff79[_0x5e80('0xe')]['message']);}else{logger['info'](_0x5e80('0x10'),_0x42cc44,_0x5e80('0xc'));_0x21d466(_0xfdff79[_0x5e80('0x12')][_0x5e80('0x11')]);}})[_0x5e80('0x13')](function(_0x51a354){logger[_0x5e80('0xe')](_0x5e80('0x10'),_0x42cc44,_0x51a354);_0x314f9b(_0x51a354);});});} \ No newline at end of file +var _0x8d77=['../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','ZohoConfiguration,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8d77,0x150));var _0x78d7=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0x8d77[_0x32d457];return _0x338386;};'use strict';var _=require(_0x78d7('0x0'));var util=require(_0x78d7('0x1'));var moment=require(_0x78d7('0x2'));var BPromise=require(_0x78d7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x78d7('0x4'));var db=require(_0x78d7('0x5'))['db'];var utils=require(_0x78d7('0x6'));var logger=require(_0x78d7('0x7'))(_0x78d7('0x8'));var config=require(_0x78d7('0x9'));var jayson=require(_0x78d7('0xa'));var client=jayson[_0x78d7('0xb')][_0x78d7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x385215,_0x32f2b1,_0x2537bf){return new BPromise(function(_0x39a739,_0x51201b){return client[_0x78d7('0xd')](_0x385215,_0x2537bf)['then'](function(_0x16e961){logger[_0x78d7('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0x32f2b1,_0x78d7('0xf'));logger[_0x78d7('0x10')](_0x78d7('0x11'),_0x32f2b1,_0x78d7('0xf'),JSON[_0x78d7('0x12')](_0x16e961));if(_0x16e961[_0x78d7('0x13')]){if(_0x16e961[_0x78d7('0x13')]['code']===0x1f4){logger[_0x78d7('0x13')](_0x78d7('0x14'),_0x32f2b1,_0x16e961[_0x78d7('0x13')][_0x78d7('0x15')]);return _0x51201b(_0x16e961[_0x78d7('0x13')][_0x78d7('0x15')]);}logger['error'](_0x78d7('0x14'),_0x32f2b1,_0x16e961['error'][_0x78d7('0x15')]);return _0x39a739(_0x16e961[_0x78d7('0x13')][_0x78d7('0x15')]);}else{logger['info'](_0x78d7('0x14'),_0x32f2b1,'request\x20sent');_0x39a739(_0x16e961[_0x78d7('0x16')][_0x78d7('0x15')]);}})['catch'](function(_0x50f847){logger[_0x78d7('0x13')](_0x78d7('0x14'),_0x32f2b1,_0x50f847);_0x51201b(_0x50f847);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 3060e71..c9f12f0 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 _0xa39b=['create','put','/:id','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','post'];(function(_0x44fdb3,_0x2a15b8){var _0x593395=function(_0x1b8949){while(--_0x1b8949){_0x44fdb3['push'](_0x44fdb3['shift']());}};_0x593395(++_0x2a15b8);}(_0xa39b,0x84));var _0xba39=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xa39b[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0xba39('0x0'));var util=require(_0xba39('0x1'));var path=require(_0xba39('0x2'));var timeout=require('connect-timeout');var express=require(_0xba39('0x3'));var router=express[_0xba39('0x4')]();var auth=require(_0xba39('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xba39('0x6'));var controller=require('./intZohoField.controller');router[_0xba39('0x7')]('/',auth[_0xba39('0x8')](),controller[_0xba39('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xba39('0xa')]);router[_0xba39('0xb')]('/',auth[_0xba39('0x8')](),controller[_0xba39('0xc')]);router[_0xba39('0xd')](_0xba39('0xe'),auth[_0xba39('0x8')](),controller[_0xba39('0xf')]);router[_0xba39('0x10')](_0xba39('0xe'),auth[_0xba39('0x8')](),controller[_0xba39('0x11')]);module['exports']=router; \ No newline at end of file +var _0x5b32=['util','path','connect-timeout','express','Router','../../components/auth/service','./intZohoField.controller','/:id','show','post','isAuthenticated','put','update','delete','destroy','exports','multer'];(function(_0x5d0606,_0x4bfe2e){var _0x513ee1=function(_0x39ec94){while(--_0x39ec94){_0x5d0606['push'](_0x5d0606['shift']());}};_0x513ee1(++_0x4bfe2e);}(_0x5b32,0xed));var _0x25b3=function(_0x427c09,_0xecedb4){_0x427c09=_0x427c09-0x0;var _0x5cb3b2=_0x5b32[_0x427c09];return _0x5cb3b2;};'use strict';var multer=require(_0x25b3('0x0'));var util=require(_0x25b3('0x1'));var path=require(_0x25b3('0x2'));var timeout=require(_0x25b3('0x3'));var express=require(_0x25b3('0x4'));var router=express[_0x25b3('0x5')]();var auth=require(_0x25b3('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x25b3('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x25b3('0x8'),auth['isAuthenticated'](),controller[_0x25b3('0x9')]);router[_0x25b3('0xa')]('/',auth[_0x25b3('0xb')](),controller['create']);router[_0x25b3('0xc')](_0x25b3('0x8'),auth['isAuthenticated'](),controller[_0x25b3('0xd')]);router[_0x25b3('0xe')](_0x25b3('0x8'),auth['isAuthenticated'](),controller[_0x25b3('0xf')]);module[_0x25b3('0x10')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 7dc2bbf..be9a1bf 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 _0xe605=['STRING','ENUM','sequelize','exports','string','variable','customVariable','keyValue'];(function(_0x3d0ef3,_0x12d6ca){var _0x5d0f15=function(_0xb7face){while(--_0xb7face){_0x3d0ef3['push'](_0x3d0ef3['shift']());}};_0x5d0f15(++_0x12d6ca);}(_0xe605,0x92));var _0x5e60=function(_0x169048,_0x454498){_0x169048=_0x169048-0x0;var _0x5af910=_0xe605[_0x169048];return _0x5af910;};'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 +var _0xac4a=['exports','ENUM','string','variable','customVariable','STRING','BOOLEAN','sequelize'];(function(_0x4d3b39,_0x4ec5ad){var _0x3f92ca=function(_0x155efa){while(--_0x155efa){_0x4d3b39['push'](_0x4d3b39['shift']());}};_0x3f92ca(++_0x4ec5ad);}(_0xac4a,0x13f));var _0xaac4=function(_0x2c7c87,_0x6c9b64){_0x2c7c87=_0x2c7c87-0x0;var _0xb31417=_0xac4a[_0x2c7c87];return _0xb31417;};'use strict';var Sequelize=require(_0xaac4('0x0'));module[_0xaac4('0x1')]={'type':{'type':Sequelize[_0xaac4('0x2')](_0xaac4('0x3'),_0xaac4('0x4'),_0xaac4('0x5'),'keyValue'),'defaultValue':'string'},'content':{'type':Sequelize[_0xaac4('0x6')]},'key':{'type':Sequelize[_0xaac4('0x6')]},'keyType':{'type':Sequelize[_0xaac4('0x2')]('string',_0xaac4('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xaac4('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xaac4('0x6')]},'customField':{'type':Sequelize[_0xaac4('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 035f962..9c3199b 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 _0x5f2f=['status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','ZohoField','rawAttributes','query','keys','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','key','options','includeAll','include','findAll','catch','params','length','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus'];(function(_0x30ba61,_0x48b905){var _0x7300ad=function(_0x3b4f73){while(--_0x3b4f73){_0x30ba61['push'](_0x30ba61['shift']());}};_0x7300ad(++_0x48b905);}(_0x5f2f,0x73));var _0xf5f2=function(_0x22df9c,_0x3924c7){_0x22df9c=_0x22df9c-0x0;var _0x40e0f1=_0x5f2f[_0x22df9c];return _0x40e0f1;};'use strict';var pdf=require(_0xf5f2('0x0'));var emlformat=require(_0xf5f2('0x1'));var rimraf=require(_0xf5f2('0x2'));var zipdir=require(_0xf5f2('0x3'));var jsonpatch=require(_0xf5f2('0x4'));var rp=require(_0xf5f2('0x5'));var moment=require(_0xf5f2('0x6'));var BPromise=require(_0xf5f2('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf5f2('0x8'));var sox=require(_0xf5f2('0x9'));var csv=require(_0xf5f2('0xa'));var ejs=require(_0xf5f2('0xb'));var fs=require('fs');var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0xa'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xf5f2('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xf5f2('0x14'));var config=require(_0xf5f2('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x336f6b,_0x14b51f){_0x14b51f=_0x14b51f||0xcc;return function(_0x331482){if(_0x331482){return _0x336f6b[_0xf5f2('0x16')](_0x14b51f);}return _0x336f6b[_0xf5f2('0x17')](_0x14b51f)[_0xf5f2('0x18')]();};}function respondWithResult(_0x5c01b8,_0x5850f4){_0x5850f4=_0x5850f4||0xc8;return function(_0xea612c){if(_0xea612c){return _0x5c01b8[_0xf5f2('0x17')](_0x5850f4)[_0xf5f2('0x19')](_0xea612c);}};}function respondWithFilteredResult(_0x422b55,_0x4d97fc){return function(_0xafe430){if(_0xafe430){var _0x286197=_0xafe430[_0xf5f2('0x1a')],_0x17d656=_0x4d97fc[_0xf5f2('0x1b')],_0x1b6dd2=_0x4d97fc[_0xf5f2('0x1b')]+_0x4d97fc[_0xf5f2('0x1c')],_0x23e23a;if(_0x1b6dd2>=_0x286197){_0x1b6dd2=_0x286197;_0x23e23a=0xc8;}else{_0x23e23a=0xce;}_0x422b55[_0xf5f2('0x17')](_0x23e23a);return _0x422b55[_0xf5f2('0x1d')](_0xf5f2('0x1e'),_0x17d656+'-'+_0x1b6dd2+'/'+_0x286197)[_0xf5f2('0x19')](_0xafe430);}return null;};}function patchUpdates(_0x3ee69){return function(_0x3cf5ea){try{jsonpatch[_0xf5f2('0x1f')](_0x3cf5ea,_0x3ee69,!![]);}catch(_0x1bf655){return BPromise['reject'](_0x1bf655);}return _0x3cf5ea[_0xf5f2('0x20')]();};}function saveUpdates(_0x47101e,_0x49dac2){return function(_0x47acfc){if(_0x47acfc){return _0x47acfc[_0xf5f2('0x21')](_0x47101e)[_0xf5f2('0x22')](function(_0x4ae323){return _0x4ae323;});}return null;};}function removeEntity(_0x45b74f,_0x170042){return function(_0x39e44a){if(_0x39e44a){return _0x39e44a[_0xf5f2('0x23')]()[_0xf5f2('0x22')](function(){_0x45b74f['status'](0xcc)[_0xf5f2('0x18')]();});}};}function handleEntityNotFound(_0x4669a6,_0x4e8bda){return function(_0x2833fe){if(!_0x2833fe){_0x4669a6[_0xf5f2('0x16')](0x194);}return _0x2833fe;};}function handleError(_0x5bdf4a,_0x529f07){_0x529f07=_0x529f07||0x1f4;return function(_0x5f1124){logger[_0xf5f2('0x24')](_0x5f1124[_0xf5f2('0x25')]);if(_0x5f1124[_0xf5f2('0x26')]){delete _0x5f1124[_0xf5f2('0x26')];}_0x5bdf4a[_0xf5f2('0x17')](_0x529f07)[_0xf5f2('0x27')](_0x5f1124);};}exports[_0xf5f2('0x28')]=function(_0x294414,_0x4ab014){var _0xaa2602={},_0x102449={},_0x375ca8={'count':0x0,'rows':[]};var _0x31bfcb=db[_0xf5f2('0x29')][_0xf5f2('0x2a')];_0x102449['model']=_['keys'](_0x31bfcb);_0x102449[_0xf5f2('0x2b')]=_[_0xf5f2('0x2c')](_0x294414[_0xf5f2('0x2b')]);_0x102449['filters']=_['intersection'](_0x102449[_0xf5f2('0x2d')],_0x102449[_0xf5f2('0x2b')]);_0xaa2602[_0xf5f2('0x2e')]=_[_0xf5f2('0x2f')](_0x102449[_0xf5f2('0x2d')],qs['fields'](_0x294414['query'][_0xf5f2('0x30')]));_0xaa2602['attributes']=_0xaa2602[_0xf5f2('0x2e')]['length']?_0xaa2602[_0xf5f2('0x2e')]:_0x102449[_0xf5f2('0x2d')];if(!_0x294414[_0xf5f2('0x2b')][_0xf5f2('0x31')](_0xf5f2('0x32'))){_0xaa2602[_0xf5f2('0x1c')]=qs[_0xf5f2('0x1c')](_0x294414[_0xf5f2('0x2b')]['limit']);_0xaa2602[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x294414[_0xf5f2('0x2b')][_0xf5f2('0x1b')]);}_0xaa2602[_0xf5f2('0x33')]=qs[_0xf5f2('0x34')](_0x294414[_0xf5f2('0x2b')]['sort']);_0xaa2602[_0xf5f2('0x35')]=qs[_0xf5f2('0x36')](_['pick'](_0x294414[_0xf5f2('0x2b')],_0x102449['filters']));if(_0x294414[_0xf5f2('0x2b')][_0xf5f2('0x37')]){_0xaa2602[_0xf5f2('0x35')]=_[_0xf5f2('0x38')](_0xaa2602['where'],{'$or':_['map'](_0x31bfcb,function(_0x41088b){if(_0x41088b[_0xf5f2('0x39')][_0xf5f2('0x3a')]!=='VIRTUAL'){var _0x41447f={};_0x41447f[_0x41088b['field']]={'$like':'%'+_0x294414[_0xf5f2('0x2b')]['filter']+'%'};return _0x41447f;}})});}_0xaa2602=_[_0xf5f2('0x38')]({},_0xaa2602,_0x294414[_0xf5f2('0x3b')]);var _0x5337a6={'where':_0xaa2602[_0xf5f2('0x35')]};return db[_0xf5f2('0x29')][_0xf5f2('0x1a')](_0x5337a6)[_0xf5f2('0x22')](function(_0x542cd6){_0x375ca8['count']=_0x542cd6;if(_0x294414[_0xf5f2('0x2b')][_0xf5f2('0x3c')]){_0xaa2602[_0xf5f2('0x3d')]=[{'all':!![]}];}return db[_0xf5f2('0x29')][_0xf5f2('0x3e')](_0xaa2602);})[_0xf5f2('0x22')](function(_0x2bc20e){_0x375ca8['rows']=_0x2bc20e;return _0x375ca8;})[_0xf5f2('0x22')](respondWithFilteredResult(_0x4ab014,_0xaa2602))[_0xf5f2('0x3f')](handleError(_0x4ab014,null));};exports['show']=function(_0xc6a1ae,_0x3f3895){var _0x71b0e7={'raw':!![],'where':{'id':_0xc6a1ae[_0xf5f2('0x40')]['id']}},_0x85b6d0={};_0x85b6d0[_0xf5f2('0x2d')]=_[_0xf5f2('0x2c')](db[_0xf5f2('0x29')]['rawAttributes']);_0x85b6d0[_0xf5f2('0x2b')]=_[_0xf5f2('0x2c')](_0xc6a1ae[_0xf5f2('0x2b')]);_0x85b6d0['filters']=_['intersection'](_0x85b6d0['model'],_0x85b6d0[_0xf5f2('0x2b')]);_0x71b0e7[_0xf5f2('0x2e')]=_['intersection'](_0x85b6d0[_0xf5f2('0x2d')],qs[_0xf5f2('0x30')](_0xc6a1ae[_0xf5f2('0x2b')][_0xf5f2('0x30')]));_0x71b0e7[_0xf5f2('0x2e')]=_0x71b0e7[_0xf5f2('0x2e')][_0xf5f2('0x41')]?_0x71b0e7[_0xf5f2('0x2e')]:_0x85b6d0[_0xf5f2('0x2d')];if(_0xc6a1ae[_0xf5f2('0x2b')][_0xf5f2('0x3c')]){_0x71b0e7[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x71b0e7=_[_0xf5f2('0x38')]({},_0x71b0e7,_0xc6a1ae[_0xf5f2('0x3b')]);return db['ZohoField'][_0xf5f2('0x42')](_0x71b0e7)['then'](handleEntityNotFound(_0x3f3895,null))[_0xf5f2('0x22')](respondWithResult(_0x3f3895,null))[_0xf5f2('0x3f')](handleError(_0x3f3895,null));};exports[_0xf5f2('0x43')]=function(_0x36a4b0,_0x31bf0e){return db[_0xf5f2('0x29')]['create'](_0x36a4b0[_0xf5f2('0x44')],{})[_0xf5f2('0x22')](respondWithResult(_0x31bf0e,0xc9))[_0xf5f2('0x3f')](handleError(_0x31bf0e,null));};exports[_0xf5f2('0x21')]=function(_0x12124d,_0x10753a){if(_0x12124d[_0xf5f2('0x44')]['id']){delete _0x12124d[_0xf5f2('0x44')]['id'];}return db['ZohoField'][_0xf5f2('0x42')]({'where':{'id':_0x12124d[_0xf5f2('0x40')]['id']}})[_0xf5f2('0x22')](handleEntityNotFound(_0x10753a,null))['then'](saveUpdates(_0x12124d[_0xf5f2('0x44')],null))[_0xf5f2('0x22')](respondWithResult(_0x10753a,null))[_0xf5f2('0x3f')](handleError(_0x10753a,null));};exports['destroy']=function(_0x57a7cb,_0x7bb942){return db[_0xf5f2('0x29')]['find']({'where':{'id':_0x57a7cb[_0xf5f2('0x40')]['id']}})['then'](handleEntityNotFound(_0x7bb942,null))[_0xf5f2('0x22')](removeEntity(_0x7bb942,null))['catch'](handleError(_0x7bb942,null));}; \ No newline at end of file +var _0xda2d=['stack','name','index','ZohoField','rawAttributes','model','query','keys','filters','intersection','attributes','hasOwnProperty','limit','order','sort','pick','filter','where','map','type','field','merge','then','count','includeAll','findAll','catch','show','params','fields','length','include','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','set','Content-Range','json','apply','reject','save','update','destroy','error'];(function(_0x6726ac,_0x222e70){var _0x203bad=function(_0x262ab3){while(--_0x262ab3){_0x6726ac['push'](_0x6726ac['shift']());}};_0x203bad(++_0x222e70);}(_0xda2d,0x102));var _0xdda2=function(_0x28fdd4,_0xb69d62){_0x28fdd4=_0x28fdd4-0x0;var _0x519bc6=_0xda2d[_0x28fdd4];return _0x519bc6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xdda2('0x0'));var rimraf=require(_0xdda2('0x1'));var zipdir=require(_0xdda2('0x2'));var jsonpatch=require(_0xdda2('0x3'));var rp=require(_0xdda2('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdda2('0x5'));var path=require(_0xdda2('0x6'));var sox=require(_0xdda2('0x7'));var csv=require(_0xdda2('0x8'));var ejs=require(_0xdda2('0x9'));var fs=require('fs');var _=require(_0xdda2('0xa'));var squel=require(_0xdda2('0xb'));var crypto=require(_0xdda2('0xc'));var jsforce=require(_0xdda2('0xd'));var deskjs=require(_0xdda2('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdda2('0xf'));var Papa=require(_0xdda2('0x10'));var Redis=require('ioredis');var authService=require(_0xdda2('0x11'));var qs=require(_0xdda2('0x12'));var hardwareService=require(_0xdda2('0x13'));var logger=require(_0xdda2('0x14'))(_0xdda2('0x15'));var utils=require(_0xdda2('0x16'));var config=require(_0xdda2('0x17'));var db=require(_0xdda2('0x18'))['db'];function respondWithStatusCode(_0x57aba3,_0x4f8d71){_0x4f8d71=_0x4f8d71||0xcc;return function(_0x56d25d){if(_0x56d25d){return _0x57aba3[_0xdda2('0x19')](_0x4f8d71);}return _0x57aba3[_0xdda2('0x1a')](_0x4f8d71)[_0xdda2('0x1b')]();};}function respondWithResult(_0x1503a7,_0x2e4132){_0x2e4132=_0x2e4132||0xc8;return function(_0x475222){if(_0x475222){return _0x1503a7[_0xdda2('0x1a')](_0x2e4132)['json'](_0x475222);}};}function respondWithFilteredResult(_0x79c6d4,_0x4b0220){return function(_0xbef148){if(_0xbef148){var _0xb6b01e=_0xbef148['count'],_0x3553d5=_0x4b0220['offset'],_0x457764=_0x4b0220[_0xdda2('0x1c')]+_0x4b0220['limit'],_0x1922b1;if(_0x457764>=_0xb6b01e){_0x457764=_0xb6b01e;_0x1922b1=0xc8;}else{_0x1922b1=0xce;}_0x79c6d4[_0xdda2('0x1a')](_0x1922b1);return _0x79c6d4[_0xdda2('0x1d')](_0xdda2('0x1e'),_0x3553d5+'-'+_0x457764+'/'+_0xb6b01e)[_0xdda2('0x1f')](_0xbef148);}return null;};}function patchUpdates(_0x8d44b7){return function(_0x17015f){try{jsonpatch[_0xdda2('0x20')](_0x17015f,_0x8d44b7,!![]);}catch(_0x351151){return BPromise[_0xdda2('0x21')](_0x351151);}return _0x17015f[_0xdda2('0x22')]();};}function saveUpdates(_0x312ef1,_0x6fdede){return function(_0x4eed30){if(_0x4eed30){return _0x4eed30[_0xdda2('0x23')](_0x312ef1)['then'](function(_0xc4567c){return _0xc4567c;});}return null;};}function removeEntity(_0x1a4db4,_0xf994dc){return function(_0x4c5226){if(_0x4c5226){return _0x4c5226[_0xdda2('0x24')]()['then'](function(){_0x1a4db4[_0xdda2('0x1a')](0xcc)[_0xdda2('0x1b')]();});}};}function handleEntityNotFound(_0x4ac3eb,_0x144f1e){return function(_0xfda248){if(!_0xfda248){_0x4ac3eb[_0xdda2('0x19')](0x194);}return _0xfda248;};}function handleError(_0x13b0f3,_0x45ee9d){_0x45ee9d=_0x45ee9d||0x1f4;return function(_0x5739ad){logger[_0xdda2('0x25')](_0x5739ad[_0xdda2('0x26')]);if(_0x5739ad[_0xdda2('0x27')]){delete _0x5739ad[_0xdda2('0x27')];}_0x13b0f3['status'](_0x45ee9d)['send'](_0x5739ad);};}exports[_0xdda2('0x28')]=function(_0x4567e7,_0x2e8591){var _0x5e9e74={},_0x90d919={},_0x5d26ae={'count':0x0,'rows':[]};var _0x2e755b=db[_0xdda2('0x29')][_0xdda2('0x2a')];_0x90d919[_0xdda2('0x2b')]=_['keys'](_0x2e755b);_0x90d919[_0xdda2('0x2c')]=_[_0xdda2('0x2d')](_0x4567e7['query']);_0x90d919[_0xdda2('0x2e')]=_[_0xdda2('0x2f')](_0x90d919[_0xdda2('0x2b')],_0x90d919[_0xdda2('0x2c')]);_0x5e9e74['attributes']=_[_0xdda2('0x2f')](_0x90d919[_0xdda2('0x2b')],qs['fields'](_0x4567e7[_0xdda2('0x2c')]['fields']));_0x5e9e74[_0xdda2('0x30')]=_0x5e9e74['attributes']['length']?_0x5e9e74['attributes']:_0x90d919[_0xdda2('0x2b')];if(!_0x4567e7['query'][_0xdda2('0x31')]('nolimit')){_0x5e9e74['limit']=qs['limit'](_0x4567e7[_0xdda2('0x2c')][_0xdda2('0x32')]);_0x5e9e74[_0xdda2('0x1c')]=qs[_0xdda2('0x1c')](_0x4567e7[_0xdda2('0x2c')][_0xdda2('0x1c')]);}_0x5e9e74[_0xdda2('0x33')]=qs[_0xdda2('0x34')](_0x4567e7[_0xdda2('0x2c')][_0xdda2('0x34')]);_0x5e9e74['where']=qs[_0xdda2('0x2e')](_[_0xdda2('0x35')](_0x4567e7[_0xdda2('0x2c')],_0x90d919[_0xdda2('0x2e')]));if(_0x4567e7[_0xdda2('0x2c')][_0xdda2('0x36')]){_0x5e9e74[_0xdda2('0x37')]=_['merge'](_0x5e9e74['where'],{'$or':_[_0xdda2('0x38')](_0x2e755b,function(_0x1cf553){if(_0x1cf553[_0xdda2('0x39')]['key']!=='VIRTUAL'){var _0x871054={};_0x871054[_0x1cf553[_0xdda2('0x3a')]]={'$like':'%'+_0x4567e7[_0xdda2('0x2c')][_0xdda2('0x36')]+'%'};return _0x871054;}})});}_0x5e9e74=_[_0xdda2('0x3b')]({},_0x5e9e74,_0x4567e7['options']);var _0x1e7b94={'where':_0x5e9e74[_0xdda2('0x37')]};return db['ZohoField']['count'](_0x1e7b94)[_0xdda2('0x3c')](function(_0x1cae53){_0x5d26ae[_0xdda2('0x3d')]=_0x1cae53;if(_0x4567e7[_0xdda2('0x2c')][_0xdda2('0x3e')]){_0x5e9e74['include']=[{'all':!![]}];}return db[_0xdda2('0x29')][_0xdda2('0x3f')](_0x5e9e74);})[_0xdda2('0x3c')](function(_0x1a7262){_0x5d26ae['rows']=_0x1a7262;return _0x5d26ae;})['then'](respondWithFilteredResult(_0x2e8591,_0x5e9e74))[_0xdda2('0x40')](handleError(_0x2e8591,null));};exports[_0xdda2('0x41')]=function(_0x7a25fe,_0x5a92e9){var _0x1bb2a7={'raw':!![],'where':{'id':_0x7a25fe[_0xdda2('0x42')]['id']}},_0x542ceb={};_0x542ceb['model']=_[_0xdda2('0x2d')](db[_0xdda2('0x29')][_0xdda2('0x2a')]);_0x542ceb[_0xdda2('0x2c')]=_['keys'](_0x7a25fe[_0xdda2('0x2c')]);_0x542ceb['filters']=_[_0xdda2('0x2f')](_0x542ceb['model'],_0x542ceb[_0xdda2('0x2c')]);_0x1bb2a7[_0xdda2('0x30')]=_[_0xdda2('0x2f')](_0x542ceb[_0xdda2('0x2b')],qs[_0xdda2('0x43')](_0x7a25fe['query'][_0xdda2('0x43')]));_0x1bb2a7[_0xdda2('0x30')]=_0x1bb2a7['attributes'][_0xdda2('0x44')]?_0x1bb2a7['attributes']:_0x542ceb[_0xdda2('0x2b')];if(_0x7a25fe[_0xdda2('0x2c')][_0xdda2('0x3e')]){_0x1bb2a7[_0xdda2('0x45')]=[{'all':!![]}];}_0x1bb2a7=_[_0xdda2('0x3b')]({},_0x1bb2a7,_0x7a25fe[_0xdda2('0x46')]);return db[_0xdda2('0x29')][_0xdda2('0x47')](_0x1bb2a7)[_0xdda2('0x3c')](handleEntityNotFound(_0x5a92e9,null))[_0xdda2('0x3c')](respondWithResult(_0x5a92e9,null))[_0xdda2('0x40')](handleError(_0x5a92e9,null));};exports[_0xdda2('0x48')]=function(_0x7a2dbc,_0x4d22b3){return db['ZohoField']['create'](_0x7a2dbc[_0xdda2('0x49')],{})[_0xdda2('0x3c')](respondWithResult(_0x4d22b3,0xc9))['catch'](handleError(_0x4d22b3,null));};exports[_0xdda2('0x23')]=function(_0x18f229,_0x22a99e){if(_0x18f229['body']['id']){delete _0x18f229[_0xdda2('0x49')]['id'];}return db[_0xdda2('0x29')]['find']({'where':{'id':_0x18f229['params']['id']}})[_0xdda2('0x3c')](handleEntityNotFound(_0x22a99e,null))['then'](saveUpdates(_0x18f229[_0xdda2('0x49')],null))['then'](respondWithResult(_0x22a99e,null))[_0xdda2('0x40')](handleError(_0x22a99e,null));};exports[_0xdda2('0x24')]=function(_0x50bd88,_0x585665){return db[_0xdda2('0x29')][_0xdda2('0x47')]({'where':{'id':_0x50bd88[_0xdda2('0x42')]['id']}})[_0xdda2('0x3c')](handleEntityNotFound(_0x585665,null))['then'](removeEntity(_0x585665,null))[_0xdda2('0x40')](handleError(_0x585665,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index b6a07d3..e7cfe38 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 _0xe244=['FieldId','../../config/logger','api','moment','bluebird','path','../../config/environment','./intZohoField.attributes','exports','define','int_zoho_fields','zoho_unique_index','idField'];(function(_0x216d45,_0x4989fe){var _0xbaac0b=function(_0x308a41){while(--_0x308a41){_0x216d45['push'](_0x216d45['shift']());}};_0xbaac0b(++_0x4989fe);}(_0xe244,0x1c8));var _0x4e24=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xe244[_0x1035c1];return _0x308d67;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4e24('0x0'))(_0x4e24('0x1'));var moment=require(_0x4e24('0x2'));var BPromise=require(_0x4e24('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4e24('0x4'));var rimraf=require('rimraf');var config=require(_0x4e24('0x5'));var attributes=require(_0x4e24('0x6'));module[_0x4e24('0x7')]=function(_0x305e29,_0x4ff73b){return _0x305e29[_0x4e24('0x8')]('ZohoField',attributes,{'tableName':_0x4e24('0x9'),'paranoid':![],'indexes':[{'name':_0x4e24('0xa'),'fields':[_0x4e24('0xb'),_0x4e24('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb6e7=['FieldId','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','define','ZohoField','zoho_unique_index'];(function(_0x3bc455,_0x5a797d){var _0x5000e5=function(_0x2fce67){while(--_0x2fce67){_0x3bc455['push'](_0x3bc455['shift']());}};_0x5000e5(++_0x5a797d);}(_0xb6e7,0x1b1));var _0x7b6e=function(_0x8c84d2,_0x39bb62){_0x8c84d2=_0x8c84d2-0x0;var _0x12afe2=_0xb6e7[_0x8c84d2];return _0x12afe2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7b6e('0x0'))(_0x7b6e('0x1'));var moment=require('moment');var BPromise=require(_0x7b6e('0x2'));var rp=require(_0x7b6e('0x3'));var fs=require('fs');var path=require(_0x7b6e('0x4'));var rimraf=require(_0x7b6e('0x5'));var config=require(_0x7b6e('0x6'));var attributes=require(_0x7b6e('0x7'));module['exports']=function(_0x380637,_0x41a2c8){return _0x380637[_0x7b6e('0x8')](_0x7b6e('0x9'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x7b6e('0xa'),'fields':['idField',_0x7b6e('0xb')],'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 f17ac28..44da7c1 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 _0xfe64=['../../config/logger','rpc','jayson/promise','client','http','request','then','ZohoField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x3e41e5,_0x5a4a7f){var _0x4cdd6d=function(_0x3588c5){while(--_0x3588c5){_0x3e41e5['push'](_0x3e41e5['shift']());}};_0x4cdd6d(++_0x5a4a7f);}(_0xfe64,0x1d9));var _0x4fe6=function(_0xc39f18,_0x2172f2){_0xc39f18=_0xc39f18-0x0;var _0x93ddd9=_0xfe64[_0xc39f18];return _0x93ddd9;};'use strict';var _=require(_0x4fe6('0x0'));var util=require(_0x4fe6('0x1'));var moment=require(_0x4fe6('0x2'));var BPromise=require(_0x4fe6('0x3'));var rs=require(_0x4fe6('0x4'));var fs=require('fs');var Redis=require(_0x4fe6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4fe6('0x6'));var logger=require(_0x4fe6('0x7'))(_0x4fe6('0x8'));var config=require('../../config/environment');var jayson=require(_0x4fe6('0x9'));var client=jayson[_0x4fe6('0xa')][_0x4fe6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xd6625,_0x4a198f,_0x5f5761){return new BPromise(function(_0x315530,_0x1fa502){return client[_0x4fe6('0xc')](_0xd6625,_0x5f5761)[_0x4fe6('0xd')](function(_0x1e219f){logger['info'](_0x4fe6('0xe'),_0x4a198f,_0x4fe6('0xf'));logger[_0x4fe6('0x10')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x4a198f,_0x4fe6('0xf'),JSON[_0x4fe6('0x11')](_0x1e219f));if(_0x1e219f[_0x4fe6('0x12')]){if(_0x1e219f[_0x4fe6('0x12')][_0x4fe6('0x13')]===0x1f4){logger[_0x4fe6('0x12')](_0x4fe6('0xe'),_0x4a198f,_0x1e219f[_0x4fe6('0x12')]['message']);return _0x1fa502(_0x1e219f[_0x4fe6('0x12')][_0x4fe6('0x14')]);}logger[_0x4fe6('0x12')](_0x4fe6('0xe'),_0x4a198f,_0x1e219f['error']['message']);return _0x315530(_0x1e219f['error'][_0x4fe6('0x14')]);}else{logger[_0x4fe6('0x15')]('ZohoField,\x20%s,\x20%s',_0x4a198f,_0x4fe6('0xf'));_0x315530(_0x1e219f[_0x4fe6('0x16')][_0x4fe6('0x14')]);}})[_0x4fe6('0x17')](function(_0x2c61d8){logger[_0x4fe6('0x12')](_0x4fe6('0xe'),_0x4a198f,_0x2c61d8);_0x1fa502(_0x2c61d8);});});} \ No newline at end of file +var _0x1a4b=['jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0xaa79d1,_0x556908){var _0x3e8263=function(_0x1da9a3){while(--_0x1da9a3){_0xaa79d1['push'](_0xaa79d1['shift']());}};_0x3e8263(++_0x556908);}(_0x1a4b,0x19f));var _0xb1a4=function(_0x66f5b7,_0x98600f){_0x66f5b7=_0x66f5b7-0x0;var _0x18788f=_0x1a4b[_0x66f5b7];return _0x18788f;};'use strict';var _=require(_0xb1a4('0x0'));var util=require(_0xb1a4('0x1'));var moment=require('moment');var BPromise=require(_0xb1a4('0x2'));var rs=require(_0xb1a4('0x3'));var fs=require('fs');var Redis=require(_0xb1a4('0x4'));var db=require(_0xb1a4('0x5'))['db'];var utils=require(_0xb1a4('0x6'));var logger=require(_0xb1a4('0x7'))(_0xb1a4('0x8'));var config=require(_0xb1a4('0x9'));var jayson=require(_0xb1a4('0xa'));var client=jayson[_0xb1a4('0xb')][_0xb1a4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x17945e,_0x137e00,_0xbe5936){return new BPromise(function(_0x4e0f5d,_0x4140ff){return client[_0xb1a4('0xd')](_0x17945e,_0xbe5936)[_0xb1a4('0xe')](function(_0x4a9769){logger[_0xb1a4('0xf')](_0xb1a4('0x10'),_0x137e00,_0xb1a4('0x11'));logger[_0xb1a4('0x12')](_0xb1a4('0x13'),_0x137e00,_0xb1a4('0x11'),JSON[_0xb1a4('0x14')](_0x4a9769));if(_0x4a9769[_0xb1a4('0x15')]){if(_0x4a9769[_0xb1a4('0x15')][_0xb1a4('0x16')]===0x1f4){logger['error'](_0xb1a4('0x10'),_0x137e00,_0x4a9769['error'][_0xb1a4('0x17')]);return _0x4140ff(_0x4a9769[_0xb1a4('0x15')][_0xb1a4('0x17')]);}logger[_0xb1a4('0x15')](_0xb1a4('0x10'),_0x137e00,_0x4a9769[_0xb1a4('0x15')][_0xb1a4('0x17')]);return _0x4e0f5d(_0x4a9769[_0xb1a4('0x15')]['message']);}else{logger[_0xb1a4('0xf')](_0xb1a4('0x10'),_0x137e00,_0xb1a4('0x11'));_0x4e0f5d(_0x4a9769['result']['message']);}})[_0xb1a4('0x18')](function(_0x1593a6){logger[_0xb1a4('0x15')](_0xb1a4('0x10'),_0x137e00,_0x1593a6);_0x4140ff(_0x1593a6);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 75d8c51..b6a41ab 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 _0x9264=['connect-timeout','../../components/auth/service','exports','multer','util','path'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x9264,0xb1));var _0x4926=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9264[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x4926('0x0'));var util=require(_0x4926('0x1'));var path=require(_0x4926('0x2'));var timeout=require(_0x4926('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x4926('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x4926('0x5')]=router; \ No newline at end of file +var _0x1b9b=['express','Router','../../components/interaction/service','../../config/environment','multer','path','connect-timeout'];(function(_0x4af728,_0x31fb35){var _0x5b8d7b=function(_0x63e94e){while(--_0x63e94e){_0x4af728['push'](_0x4af728['shift']());}};_0x5b8d7b(++_0x31fb35);}(_0x1b9b,0x89));var _0xb1b9=function(_0x2603f8,_0x4d9af5){_0x2603f8=_0x2603f8-0x0;var _0x356f35=_0x1b9b[_0x2603f8];return _0x356f35;};'use strict';var multer=require(_0xb1b9('0x0'));var util=require('util');var path=require(_0xb1b9('0x1'));var timeout=require(_0xb1b9('0x2'));var express=require(_0xb1b9('0x3'));var router=express[_0xb1b9('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xb1b9('0x5'));var config=require(_0xb1b9('0x6'));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 85bd821..07034ae 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 _0xcdac=['exports','STRING','unique_name_and_version','BOOLEAN','state','sequelize'];(function(_0x349955,_0x65742){var _0x342a1f=function(_0x43ac1a){while(--_0x43ac1a){_0x349955['push'](_0x349955['shift']());}};_0x342a1f(++_0x65742);}(_0xcdac,0x167));var _0xccda=function(_0x22e370,_0x44ee9d){_0x22e370=_0x22e370-0x0;var _0x28188c=_0xcdac[_0x22e370];return _0x28188c;};'use strict';var Sequelize=require(_0xccda('0x0'));module[_0xccda('0x1')]={'name':{'type':Sequelize[_0xccda('0x2')],'allowNull':![],'unique':_0xccda('0x3')},'version':{'type':Sequelize[_0xccda('0x2')],'allowNull':![],'unique':_0xccda('0x3')},'main':{'type':Sequelize[_0xccda('0x2')],'defaultValue':'app.js'},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0xccda('0x2')]},'type':{'type':Sequelize[_0xccda('0x2')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0xccda('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0xccda('0x2')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize['STRING'],'unique':_0xccda('0x5')},'description':{'type':Sequelize[_0xccda('0x2')]},'title':{'type':Sequelize[_0xccda('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0xccda('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0xb235=['INTEGER','BOOLEAN','state','sequelize','STRING','unique_name_and_version'];(function(_0x436e67,_0x3f1698){var _0x72fc37=function(_0x233aa9){while(--_0x233aa9){_0x436e67['push'](_0x436e67['shift']());}};_0x72fc37(++_0x3f1698);}(_0xb235,0x147));var _0x5b23=function(_0x47ea2a,_0x44acee){_0x47ea2a=_0x47ea2a-0x0;var _0x1e3f06=_0xb235[_0x47ea2a];return _0x1e3f06;};'use strict';var Sequelize=require(_0x5b23('0x0'));module['exports']={'name':{'type':Sequelize[_0x5b23('0x1')],'allowNull':![],'unique':_0x5b23('0x2')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize['STRING'],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0x5b23('0x1')]},'path':{'type':Sequelize[_0x5b23('0x1')]},'type':{'type':Sequelize[_0x5b23('0x1')]},'size':{'type':Sequelize[_0x5b23('0x3')]},'active':{'type':Sequelize[_0x5b23('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0x5b23('0x1')]},'logo':{'type':Sequelize[_0x5b23('0x1')]},'state':{'type':Sequelize['STRING'],'unique':_0x5b23('0x5')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0x5b23('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0x5b23('0x1')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index df8bc3c..0d07014 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(_0x40ff13,_0x26f9c0){var _0x113101=function(_0x4593e9){while(--_0x4593e9){_0x40ff13['push'](_0x40ff13['shift']());}};_0x113101(++_0x26f9c0);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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(_0x1f76ed,_0xc45047){var _0x38ea62=function(_0x4d39fb){while(--_0x4d39fb){_0x1f76ed['push'](_0x1f76ed['shift']());}};_0x38ea62(++_0xc45047);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var 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 5cc31f8..b82b2b1 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 _0xf940=['api','moment','bluebird','path','rimraf','../../config/environment','./integration.attributes','exports','define','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf940,0xe5));var _0x0f94=function(_0x454338,_0x21e351){_0x454338=_0x454338-0x0;var _0x6687e6=_0xf940[_0x454338];return _0x6687e6;};'use strict';var _=require('lodash');var util=require(_0x0f94('0x0'));var logger=require(_0x0f94('0x1'))(_0x0f94('0x2'));var moment=require(_0x0f94('0x3'));var BPromise=require(_0x0f94('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0f94('0x5'));var rimraf=require(_0x0f94('0x6'));var config=require(_0x0f94('0x7'));var attributes=require(_0x0f94('0x8'));module[_0x0f94('0x9')]=function(_0x182de8,_0x4f1db2){return _0x182de8[_0x0f94('0xa')]('Integration',attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x20e1=['integrations','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./integration.attributes','exports','define'];(function(_0x58661b,_0x5953fd){var _0x472220=function(_0x4c1bdd){while(--_0x4c1bdd){_0x58661b['push'](_0x58661b['shift']());}};_0x472220(++_0x5953fd);}(_0x20e1,0x83));var _0x120e=function(_0x35344a,_0x1790b6){_0x35344a=_0x35344a-0x0;var _0x285085=_0x20e1[_0x35344a];return _0x285085;};'use strict';var _=require('lodash');var util=require(_0x120e('0x0'));var logger=require(_0x120e('0x1'))('api');var moment=require(_0x120e('0x2'));var BPromise=require('bluebird');var rp=require(_0x120e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x120e('0x4'));var config=require(_0x120e('0x5'));var attributes=require(_0x120e('0x6'));module[_0x120e('0x7')]=function(_0x53b075,_0x37120b){return _0x53b075[_0x120e('0x8')]('Integration',attributes,{'tableName':_0x120e('0x9'),'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 a8ecb46..ea76f07 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 _0x5889=['info','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3227dd,_0x32f497){var _0x4ffdd4=function(_0x3b8dd2){while(--_0x3b8dd2){_0x3227dd['push'](_0x3227dd['shift']());}};_0x4ffdd4(++_0x32f497);}(_0x5889,0x18f));var _0x9588=function(_0x1753c4,_0x423ca4){_0x1753c4=_0x1753c4-0x0;var _0x23f622=_0x5889[_0x1753c4];return _0x23f622;};'use strict';var _=require(_0x9588('0x0'));var util=require('util');var moment=require(_0x9588('0x1'));var BPromise=require(_0x9588('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9588('0x3'));var db=require(_0x9588('0x4'))['db'];var utils=require(_0x9588('0x5'));var logger=require('../../config/logger')(_0x9588('0x6'));var config=require(_0x9588('0x7'));var jayson=require(_0x9588('0x8'));var client=jayson['client'][_0x9588('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20b9ce,_0x3ea580,_0x1803db){return new BPromise(function(_0x241357,_0x354b36){return client[_0x9588('0xa')](_0x20b9ce,_0x1803db)['then'](function(_0x467c31){logger['info'](_0x9588('0xb'),_0x3ea580,_0x9588('0xc'));logger[_0x9588('0xd')](_0x9588('0xe'),_0x3ea580,'request\x20sent',JSON[_0x9588('0xf')](_0x467c31));if(_0x467c31[_0x9588('0x10')]){if(_0x467c31[_0x9588('0x10')][_0x9588('0x11')]===0x1f4){logger[_0x9588('0x10')](_0x9588('0xb'),_0x3ea580,_0x467c31['error'][_0x9588('0x12')]);return _0x354b36(_0x467c31[_0x9588('0x10')]['message']);}logger[_0x9588('0x10')](_0x9588('0xb'),_0x3ea580,_0x467c31['error']['message']);return _0x241357(_0x467c31[_0x9588('0x10')][_0x9588('0x12')]);}else{logger[_0x9588('0x13')]('Integration,\x20%s,\x20%s',_0x3ea580,_0x9588('0xc'));_0x241357(_0x467c31[_0x9588('0x14')][_0x9588('0x12')]);}})[_0x9588('0x15')](function(_0x5ebf7a){logger['error']('Integration,\x20%s,\x20%s',_0x3ea580,_0x5ebf7a);_0x354b36(_0x5ebf7a);});});} \ No newline at end of file +var _0xa3c7=['http','then','info','request\x20sent','debug','stringify','error','code','message','Integration,\x20%s,\x20%s','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x5b5cde,_0x1f7c5f){var _0x364ad2=function(_0x4a1172){while(--_0x4a1172){_0x5b5cde['push'](_0x5b5cde['shift']());}};_0x364ad2(++_0x1f7c5f);}(_0xa3c7,0xe7));var _0x7a3c=function(_0x3f239d,_0x1e4675){_0x3f239d=_0x3f239d-0x0;var _0x46f035=_0xa3c7[_0x3f239d];return _0x46f035;};'use strict';var _=require('lodash');var util=require(_0x7a3c('0x0'));var moment=require(_0x7a3c('0x1'));var BPromise=require(_0x7a3c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7a3c('0x3'));var db=require(_0x7a3c('0x4'))['db'];var utils=require(_0x7a3c('0x5'));var logger=require(_0x7a3c('0x6'))(_0x7a3c('0x7'));var config=require(_0x7a3c('0x8'));var jayson=require(_0x7a3c('0x9'));var client=jayson[_0x7a3c('0xa')][_0x7a3c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4281b6,_0xe045c2,_0xb535bd){return new BPromise(function(_0x20cf3f,_0x336466){return client['request'](_0x4281b6,_0xb535bd)[_0x7a3c('0xc')](function(_0x55de5c){logger[_0x7a3c('0xd')]('Integration,\x20%s,\x20%s',_0xe045c2,_0x7a3c('0xe'));logger[_0x7a3c('0xf')]('Integration,\x20%s,\x20%s,\x20%s',_0xe045c2,_0x7a3c('0xe'),JSON[_0x7a3c('0x10')](_0x55de5c));if(_0x55de5c[_0x7a3c('0x11')]){if(_0x55de5c[_0x7a3c('0x11')][_0x7a3c('0x12')]===0x1f4){logger[_0x7a3c('0x11')]('Integration,\x20%s,\x20%s',_0xe045c2,_0x55de5c[_0x7a3c('0x11')][_0x7a3c('0x13')]);return _0x336466(_0x55de5c[_0x7a3c('0x11')][_0x7a3c('0x13')]);}logger['error']('Integration,\x20%s,\x20%s',_0xe045c2,_0x55de5c[_0x7a3c('0x11')][_0x7a3c('0x13')]);return _0x20cf3f(_0x55de5c['error'][_0x7a3c('0x13')]);}else{logger[_0x7a3c('0xd')](_0x7a3c('0x14'),_0xe045c2,_0x7a3c('0xe'));_0x20cf3f(_0x55de5c['result'][_0x7a3c('0x13')]);}})[_0x7a3c('0x15')](function(_0x18fb0b){logger['error'](_0x7a3c('0x14'),_0xe045c2,_0x18fb0b);_0x336466(_0x18fb0b);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index d1cc486..3d983ed 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 _0x547b=['../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','isAuthenticated','/:id','show','post','create','update','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x547b,0x150));var _0xb547=function(_0x3c0a94,_0x436a3b){_0x3c0a94=_0x3c0a94-0x0;var _0x2f02c1=_0x547b[_0x3c0a94];return _0x2f02c1;};'use strict';var multer=require(_0xb547('0x0'));var util=require(_0xb547('0x1'));var path=require(_0xb547('0x2'));var timeout=require(_0xb547('0x3'));var express=require(_0xb547('0x4'));var router=express[_0xb547('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xb547('0x6'));var config=require(_0xb547('0x7'));var controller=require(_0xb547('0x8'));router[_0xb547('0x9')]('/',auth['isAuthenticated'](),controller[_0xb547('0xa')]);router[_0xb547('0x9')]('/describe',auth[_0xb547('0xb')](),controller['describe']);router['get'](_0xb547('0xc'),auth[_0xb547('0xb')](),controller[_0xb547('0xd')]);router[_0xb547('0xe')]('/',auth['isAuthenticated'](),controller[_0xb547('0xf')]);router['put']('/:id',auth[_0xb547('0xb')](),controller[_0xb547('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xb547('0x11')]);module[_0xb547('0x12')]=router; \ No newline at end of file +var _0x34e9=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','show','post','create','put','/:id','update','delete','exports','multer','connect-timeout'];(function(_0x2fb561,_0x579dbf){var _0x2b7be3=function(_0x578df4){while(--_0x578df4){_0x2fb561['push'](_0x2fb561['shift']());}};_0x2b7be3(++_0x579dbf);}(_0x34e9,0x102));var _0x934e=function(_0x3db91a,_0x42dca1){_0x3db91a=_0x3db91a-0x0;var _0x43afda=_0x34e9[_0x3db91a];return _0x43afda;};'use strict';var multer=require(_0x934e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x934e('0x1'));var express=require(_0x934e('0x2'));var router=express[_0x934e('0x3')]();var auth=require(_0x934e('0x4'));var interaction=require(_0x934e('0x5'));var config=require(_0x934e('0x6'));var controller=require('./integrationReport.controller');router[_0x934e('0x7')]('/',auth['isAuthenticated'](),controller[_0x934e('0x8')]);router['get'](_0x934e('0x9'),auth[_0x934e('0xa')](),controller[_0x934e('0xb')]);router[_0x934e('0x7')]('/:id',auth[_0x934e('0xa')](),controller[_0x934e('0xc')]);router[_0x934e('0xd')]('/',auth['isAuthenticated'](),controller[_0x934e('0xe')]);router[_0x934e('0xf')](_0x934e('0x10'),auth[_0x934e('0xa')](),controller[_0x934e('0x11')]);router[_0x934e('0x12')](_0x934e('0x10'),auth[_0x934e('0xa')](),controller['destroy']);module[_0x934e('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 ab43d03..05860e9 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 _0x6c69=['SENT','RECEIVED','FAILED','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM'];(function(_0x61d5c9,_0x369774){var _0x279a98=function(_0x4dc134){while(--_0x4dc134){_0x61d5c9['push'](_0x61d5c9['shift']());}};_0x279a98(++_0x369774);}(_0x6c69,0x1b1));var _0x96c6=function(_0x2b8f84,_0x349ee2){_0x2b8f84=_0x2b8f84-0x0;var _0x2927ca=_0x6c69[_0x2b8f84];return _0x2927ca;};'use strict';var Sequelize=require('sequelize');module[_0x96c6('0x0')]={'integration':{'type':Sequelize[_0x96c6('0x1')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x96c6('0x1')]},'integrationId':{'type':Sequelize[_0x96c6('0x2')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x96c6('0x1')]},'calleridname':{'type':Sequelize[_0x96c6('0x1')]},'queue':{'type':Sequelize[_0x96c6('0x1')]},'interface':{'type':Sequelize[_0x96c6('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x96c6('0x3')]},'holdtime':{'type':Sequelize[_0x96c6('0x2')]},'agentcomplete':{'type':Sequelize[_0x96c6('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x96c6('0x3')]},'talktime':{'type':Sequelize[_0x96c6('0x2')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x96c6('0x2')]},'reason':{'type':Sequelize[_0x96c6('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x96c6('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x96c6('0x3')]},'agentdump':{'type':Sequelize[_0x96c6('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x96c6('0x2')]},'channelstatedesc':{'type':Sequelize[_0x96c6('0x1')]},'connectedlinenum':{'type':Sequelize[_0x96c6('0x1')]},'connectedlinename':{'type':Sequelize[_0x96c6('0x1')]},'language':{'type':Sequelize[_0x96c6('0x1')]},'accountcode':{'type':Sequelize[_0x96c6('0x1')]},'context':{'type':Sequelize[_0x96c6('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x96c6('0x1')]},'destchannel':{'type':Sequelize[_0x96c6('0x1')]},'destchannelstate':{'type':Sequelize[_0x96c6('0x2')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x96c6('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x96c6('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x96c6('0x1')]},'destaccountcode':{'type':Sequelize[_0x96c6('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x96c6('0x1')]},'destpriority':{'type':Sequelize[_0x96c6('0x1')]},'destuniqueid':{'type':Sequelize[_0x96c6('0x1')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x96c6('0x1')]},'subject':{'type':Sequelize[_0x96c6('0x1')]},'from':{'type':Sequelize[_0x96c6('0x1')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x96c6('0x1')]},'attachment':{'type':Sequelize[_0x96c6('0x5')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x96c6('0x5')]},'status':{'type':Sequelize[_0x96c6('0x6')](_0x96c6('0x7'),'SENDING',_0x96c6('0x8'),_0x96c6('0x9'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x96c6('0x1')]},'projectId':{'type':Sequelize[_0x96c6('0x2')]}}; \ No newline at end of file +var _0x1867=['TEXT','SENT','SENDING','RECEIVED','FAILED','sequelize','exports','STRING','DATE','BOOLEAN','INTEGER'];(function(_0x448f9a,_0xc4f46){var _0x1ff030=function(_0x1b80da){while(--_0x1b80da){_0x448f9a['push'](_0x448f9a['shift']());}};_0x1ff030(++_0xc4f46);}(_0x1867,0x170));var _0x7186=function(_0x3925a5,_0x47327e){_0x3925a5=_0x3925a5-0x0;var _0x8ec6a2=_0x1867[_0x3925a5];return _0x8ec6a2;};'use strict';var Sequelize=require(_0x7186('0x0'));module[_0x7186('0x1')]={'integration':{'type':Sequelize[_0x7186('0x2')]},'eventChannel':{'type':Sequelize[_0x7186('0x2')]},'exitStatus':{'type':Sequelize[_0x7186('0x2')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x7186('0x2')]},'calleridnum':{'type':Sequelize[_0x7186('0x2')]},'calleridname':{'type':Sequelize[_0x7186('0x2')]},'queue':{'type':Sequelize[_0x7186('0x2')]},'interface':{'type':Sequelize[_0x7186('0x2')]},'membername':{'type':Sequelize[_0x7186('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x7186('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x7186('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x7186('0x3')]},'talktime':{'type':Sequelize[_0x7186('0x5')]},'agentacw':{'type':Sequelize[_0x7186('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x7186('0x5')]},'reason':{'type':Sequelize[_0x7186('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x7186('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x7186('0x3')]},'agentdump':{'type':Sequelize[_0x7186('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x7186('0x3')]},'lastevent':{'type':Sequelize[_0x7186('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x7186('0x5')]},'channelstatedesc':{'type':Sequelize[_0x7186('0x2')]},'connectedlinenum':{'type':Sequelize[_0x7186('0x2')]},'connectedlinename':{'type':Sequelize[_0x7186('0x2')]},'language':{'type':Sequelize[_0x7186('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x7186('0x2')]},'priority':{'type':Sequelize[_0x7186('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x7186('0x5')]},'destchannelstatedesc':{'type':Sequelize[_0x7186('0x2')]},'destcalleridnum':{'type':Sequelize[_0x7186('0x2')]},'destcalleridname':{'type':Sequelize[_0x7186('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x7186('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x7186('0x2')]},'destlanguage':{'type':Sequelize[_0x7186('0x2')]},'destaccountcode':{'type':Sequelize[_0x7186('0x2')]},'destcontext':{'type':Sequelize[_0x7186('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x7186('0x2')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x7186('0x2')]},'subject':{'type':Sequelize[_0x7186('0x2')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x7186('0x2')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x7186('0x6')]},'status':{'type':Sequelize['ENUM'](_0x7186('0x7'),_0x7186('0x8'),_0x7186('0x9'),_0x7186('0xa'))},'url':{'type':Sequelize[_0x7186('0x2')]},'app':{'type':Sequelize[_0x7186('0x2')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x7186('0x5')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index fddad30..cfe40f2 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 _0x0ae6=['sort','where','merge','map','type','key','VIRTUAL','field','filter','options','includeAll','include','rows','catch','show','params','fields','create','body','find','describe','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','json','apply','reject','then','destroy','error','name','index','IntegrationReport','rawAttributes','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','limit','order'];(function(_0x39a919,_0x47ea42){var _0x3f4e51=function(_0x1c5a95){while(--_0x1c5a95){_0x39a919['push'](_0x39a919['shift']());}};_0x3f4e51(++_0x47ea42);}(_0x0ae6,0xe4));var _0x60ae=function(_0xcac2ac,_0xbf94f){_0xcac2ac=_0xcac2ac-0x0;var _0x2f4af0=_0x0ae6[_0xcac2ac];return _0x2f4af0;};'use strict';var pdf=require(_0x60ae('0x0'));var emlformat=require(_0x60ae('0x1'));var rimraf=require(_0x60ae('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x60ae('0x3'));var moment=require(_0x60ae('0x4'));var BPromise=require(_0x60ae('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x60ae('0x6'));var csv=require(_0x60ae('0x7'));var ejs=require(_0x60ae('0x8'));var fs=require('fs');var _=require(_0x60ae('0x9'));var squel=require('squel');var crypto=require(_0x60ae('0xa'));var jsforce=require(_0x60ae('0xb'));var deskjs=require(_0x60ae('0xc'));var toCsv=require(_0x60ae('0x7'));var querystring=require(_0x60ae('0xd'));var Papa=require(_0x60ae('0xe'));var Redis=require(_0x60ae('0xf'));var authService=require(_0x60ae('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x60ae('0x11'));var logger=require(_0x60ae('0x12'))(_0x60ae('0x13'));var utils=require(_0x60ae('0x14'));var config=require(_0x60ae('0x15'));var db=require(_0x60ae('0x16'))['db'];function respondWithStatusCode(_0x590a80,_0x1d0a68){_0x1d0a68=_0x1d0a68||0xcc;return function(_0x674231){if(_0x674231){return _0x590a80[_0x60ae('0x17')](_0x1d0a68);}return _0x590a80[_0x60ae('0x18')](_0x1d0a68)[_0x60ae('0x19')]();};}function respondWithResult(_0x234f52,_0x4166db){_0x4166db=_0x4166db||0xc8;return function(_0x376eb4){if(_0x376eb4){return _0x234f52[_0x60ae('0x18')](_0x4166db)['json'](_0x376eb4);}};}function respondWithFilteredResult(_0x1d8ac0,_0xc7f23a){return function(_0x284404){if(_0x284404){var _0x21c3a6=_0x284404[_0x60ae('0x1a')],_0x2a025e=_0xc7f23a['offset'],_0x3ff183=_0xc7f23a[_0x60ae('0x1b')]+_0xc7f23a['limit'],_0x15c133;if(_0x3ff183>=_0x21c3a6){_0x3ff183=_0x21c3a6;_0x15c133=0xc8;}else{_0x15c133=0xce;}_0x1d8ac0[_0x60ae('0x18')](_0x15c133);return _0x1d8ac0['set']('Content-Range',_0x2a025e+'-'+_0x3ff183+'/'+_0x21c3a6)[_0x60ae('0x1c')](_0x284404);}return null;};}function patchUpdates(_0x52b3d0){return function(_0x155da2){try{jsonpatch[_0x60ae('0x1d')](_0x155da2,_0x52b3d0,!![]);}catch(_0x247c9e){return BPromise[_0x60ae('0x1e')](_0x247c9e);}return _0x155da2['save']();};}function saveUpdates(_0x38e88f,_0x5b5a2d){return function(_0x460f21){if(_0x460f21){return _0x460f21['update'](_0x38e88f)[_0x60ae('0x1f')](function(_0x553a88){return _0x553a88;});}return null;};}function removeEntity(_0x5a2ac0,_0x4b4f1f){return function(_0x58e3a4){if(_0x58e3a4){return _0x58e3a4[_0x60ae('0x20')]()[_0x60ae('0x1f')](function(){_0x5a2ac0[_0x60ae('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5118f0,_0xd72d03){return function(_0x391d99){if(!_0x391d99){_0x5118f0['sendStatus'](0x194);}return _0x391d99;};}function handleError(_0x1f610d,_0x28ab7e){_0x28ab7e=_0x28ab7e||0x1f4;return function(_0x1e8a6c){logger[_0x60ae('0x21')](_0x1e8a6c['stack']);if(_0x1e8a6c['name']){delete _0x1e8a6c[_0x60ae('0x22')];}_0x1f610d[_0x60ae('0x18')](_0x28ab7e)['send'](_0x1e8a6c);};}exports[_0x60ae('0x23')]=function(_0x3578d9,_0x117618){var _0x24c118={},_0x33c830={},_0x5c4d28={'count':0x0,'rows':[]};var _0x3dff40=db[_0x60ae('0x24')][_0x60ae('0x25')];_0x33c830['model']=_['keys'](_0x3dff40);_0x33c830[_0x60ae('0x26')]=_[_0x60ae('0x27')](_0x3578d9[_0x60ae('0x26')]);_0x33c830[_0x60ae('0x28')]=_[_0x60ae('0x29')](_0x33c830[_0x60ae('0x2a')],_0x33c830[_0x60ae('0x26')]);_0x24c118['attributes']=_['intersection'](_0x33c830[_0x60ae('0x2a')],qs['fields'](_0x3578d9[_0x60ae('0x26')]['fields']));_0x24c118[_0x60ae('0x2b')]=_0x24c118['attributes'][_0x60ae('0x2c')]?_0x24c118[_0x60ae('0x2b')]:_0x33c830[_0x60ae('0x2a')];if(!_0x3578d9[_0x60ae('0x26')][_0x60ae('0x2d')]('nolimit')){_0x24c118['limit']=qs['limit'](_0x3578d9[_0x60ae('0x26')][_0x60ae('0x2e')]);_0x24c118[_0x60ae('0x1b')]=qs[_0x60ae('0x1b')](_0x3578d9['query'][_0x60ae('0x1b')]);}_0x24c118[_0x60ae('0x2f')]=qs[_0x60ae('0x30')](_0x3578d9[_0x60ae('0x26')][_0x60ae('0x30')]);_0x24c118[_0x60ae('0x31')]=qs[_0x60ae('0x28')](_['pick'](_0x3578d9[_0x60ae('0x26')],_0x33c830[_0x60ae('0x28')]));if(_0x3578d9[_0x60ae('0x26')]['filter']){_0x24c118[_0x60ae('0x31')]=_[_0x60ae('0x32')](_0x24c118[_0x60ae('0x31')],{'$or':_[_0x60ae('0x33')](_0x3dff40,function(_0x4a75d9){if(_0x4a75d9[_0x60ae('0x34')][_0x60ae('0x35')]!==_0x60ae('0x36')){var _0x268a28={};_0x268a28[_0x4a75d9[_0x60ae('0x37')]]={'$like':'%'+_0x3578d9['query'][_0x60ae('0x38')]+'%'};return _0x268a28;}})});}_0x24c118=_[_0x60ae('0x32')]({},_0x24c118,_0x3578d9[_0x60ae('0x39')]);var _0x49f1e9={'where':_0x24c118[_0x60ae('0x31')]};return db[_0x60ae('0x24')]['count'](_0x49f1e9)[_0x60ae('0x1f')](function(_0x4bee2d){_0x5c4d28[_0x60ae('0x1a')]=_0x4bee2d;if(_0x3578d9[_0x60ae('0x26')][_0x60ae('0x3a')]){_0x24c118[_0x60ae('0x3b')]=[{'all':!![]}];}return db['IntegrationReport']['findAll'](_0x24c118);})['then'](function(_0x1c2cd1){_0x5c4d28[_0x60ae('0x3c')]=_0x1c2cd1;return _0x5c4d28;})['then'](respondWithFilteredResult(_0x117618,_0x24c118))[_0x60ae('0x3d')](handleError(_0x117618,null));};exports[_0x60ae('0x3e')]=function(_0x450159,_0x3515d1){var _0x569243={'raw':![],'where':{'id':_0x450159[_0x60ae('0x3f')]['id']}},_0x35d654={};_0x35d654['model']=_[_0x60ae('0x27')](db[_0x60ae('0x24')][_0x60ae('0x25')]);_0x35d654[_0x60ae('0x26')]=_[_0x60ae('0x27')](_0x450159[_0x60ae('0x26')]);_0x35d654['filters']=_[_0x60ae('0x29')](_0x35d654[_0x60ae('0x2a')],_0x35d654[_0x60ae('0x26')]);_0x569243[_0x60ae('0x2b')]=_[_0x60ae('0x29')](_0x35d654[_0x60ae('0x2a')],qs[_0x60ae('0x40')](_0x450159[_0x60ae('0x26')]['fields']));_0x569243[_0x60ae('0x2b')]=_0x569243['attributes'][_0x60ae('0x2c')]?_0x569243[_0x60ae('0x2b')]:_0x35d654['model'];if(_0x450159[_0x60ae('0x26')][_0x60ae('0x3a')]){_0x569243[_0x60ae('0x3b')]=[{'all':!![]}];}_0x569243=_['merge']({},_0x569243,_0x450159[_0x60ae('0x39')]);return db[_0x60ae('0x24')]['find'](_0x569243)[_0x60ae('0x1f')](handleEntityNotFound(_0x3515d1,null))['then'](respondWithResult(_0x3515d1,null))['catch'](handleError(_0x3515d1,null));};exports[_0x60ae('0x41')]=function(_0x3a193f,_0x435ec9){return db[_0x60ae('0x24')][_0x60ae('0x41')](_0x3a193f[_0x60ae('0x42')],{})[_0x60ae('0x1f')](respondWithResult(_0x435ec9,0xc9))['catch'](handleError(_0x435ec9,null));};exports['update']=function(_0x5694c7,_0x3d9da6){if(_0x5694c7[_0x60ae('0x42')]['id']){delete _0x5694c7[_0x60ae('0x42')]['id'];}return db[_0x60ae('0x24')][_0x60ae('0x43')]({'where':{'id':_0x5694c7[_0x60ae('0x3f')]['id']}})[_0x60ae('0x1f')](handleEntityNotFound(_0x3d9da6,null))[_0x60ae('0x1f')](saveUpdates(_0x5694c7[_0x60ae('0x42')],null))['then'](respondWithResult(_0x3d9da6,null))[_0x60ae('0x3d')](handleError(_0x3d9da6,null));};exports['destroy']=function(_0x27500c,_0x29611a){return db[_0x60ae('0x24')][_0x60ae('0x43')]({'where':{'id':_0x27500c['params']['id']}})[_0x60ae('0x1f')](handleEntityNotFound(_0x29611a,null))[_0x60ae('0x1f')](removeEntity(_0x29611a,null))[_0x60ae('0x3d')](handleError(_0x29611a,null));};exports[_0x60ae('0x44')]=function(_0x5565ce,_0x34a98a){return db[_0x60ae('0x24')][_0x60ae('0x44')]()[_0x60ae('0x1f')](respondWithResult(_0x34a98a,null))[_0x60ae('0x3d')](handleError(_0x34a98a,null));}; \ No newline at end of file +var _0xb1e4=['body','describe','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','IntegrationReport','model','keys','query','intersection','attributes','fields','nolimit','order','sort','where','pick','filters','filter','map','key','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','length','include','merge','find','create','update'];(function(_0x34d9b2,_0x44c2f3){var _0xa7f3a9=function(_0x1bc73a){while(--_0x1bc73a){_0x34d9b2['push'](_0x34d9b2['shift']());}};_0xa7f3a9(++_0x44c2f3);}(_0xb1e4,0x122));var _0x4b1e=function(_0x1b3369,_0x2fb3e8){_0x1b3369=_0x1b3369-0x0;var _0xf42f03=_0xb1e4[_0x1b3369];return _0xf42f03;};'use strict';var pdf=require(_0x4b1e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4b1e('0x1'));var zipdir=require(_0x4b1e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4b1e('0x3'));var moment=require(_0x4b1e('0x4'));var BPromise=require(_0x4b1e('0x5'));var Mustache=require('mustache');var util=require(_0x4b1e('0x6'));var path=require(_0x4b1e('0x7'));var sox=require(_0x4b1e('0x8'));var csv=require(_0x4b1e('0x9'));var ejs=require(_0x4b1e('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4b1e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4b1e('0xc'));var toCsv=require(_0x4b1e('0x9'));var querystring=require(_0x4b1e('0xd'));var Papa=require(_0x4b1e('0xe'));var Redis=require('ioredis');var authService=require(_0x4b1e('0xf'));var qs=require(_0x4b1e('0x10'));var hardwareService=require(_0x4b1e('0x11'));var logger=require(_0x4b1e('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x4b1e('0x13'));var db=require(_0x4b1e('0x14'))['db'];function respondWithStatusCode(_0x3deadc,_0x1ec9da){_0x1ec9da=_0x1ec9da||0xcc;return function(_0x1225ef){if(_0x1225ef){return _0x3deadc[_0x4b1e('0x15')](_0x1ec9da);}return _0x3deadc[_0x4b1e('0x16')](_0x1ec9da)['end']();};}function respondWithResult(_0x4cf84d,_0x48747d){_0x48747d=_0x48747d||0xc8;return function(_0x54c954){if(_0x54c954){return _0x4cf84d[_0x4b1e('0x16')](_0x48747d)[_0x4b1e('0x17')](_0x54c954);}};}function respondWithFilteredResult(_0x461338,_0x4c47c9){return function(_0x30f53b){if(_0x30f53b){var _0x2e7124=_0x30f53b[_0x4b1e('0x18')],_0x26ab7c=_0x4c47c9[_0x4b1e('0x19')],_0x357b77=_0x4c47c9[_0x4b1e('0x19')]+_0x4c47c9[_0x4b1e('0x1a')],_0x3765a9;if(_0x357b77>=_0x2e7124){_0x357b77=_0x2e7124;_0x3765a9=0xc8;}else{_0x3765a9=0xce;}_0x461338[_0x4b1e('0x16')](_0x3765a9);return _0x461338[_0x4b1e('0x1b')](_0x4b1e('0x1c'),_0x26ab7c+'-'+_0x357b77+'/'+_0x2e7124)[_0x4b1e('0x17')](_0x30f53b);}return null;};}function patchUpdates(_0x730291){return function(_0x4e5d4c){try{jsonpatch[_0x4b1e('0x1d')](_0x4e5d4c,_0x730291,!![]);}catch(_0x2462e3){return BPromise[_0x4b1e('0x1e')](_0x2462e3);}return _0x4e5d4c[_0x4b1e('0x1f')]();};}function saveUpdates(_0x375434,_0x3630bd){return function(_0x581ea1){if(_0x581ea1){return _0x581ea1['update'](_0x375434)[_0x4b1e('0x20')](function(_0x3b8e24){return _0x3b8e24;});}return null;};}function removeEntity(_0x29106f,_0x1c4767){return function(_0x2bf91d){if(_0x2bf91d){return _0x2bf91d[_0x4b1e('0x21')]()[_0x4b1e('0x20')](function(){_0x29106f[_0x4b1e('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x123bdf,_0xb9a84f){return function(_0x3f73fa){if(!_0x3f73fa){_0x123bdf[_0x4b1e('0x15')](0x194);}return _0x3f73fa;};}function handleError(_0x183ba3,_0x516322){_0x516322=_0x516322||0x1f4;return function(_0x497df4){logger[_0x4b1e('0x22')](_0x497df4[_0x4b1e('0x23')]);if(_0x497df4[_0x4b1e('0x24')]){delete _0x497df4[_0x4b1e('0x24')];}_0x183ba3[_0x4b1e('0x16')](_0x516322)[_0x4b1e('0x25')](_0x497df4);};}exports[_0x4b1e('0x26')]=function(_0x565747,_0x3eabe6){var _0x3342e8={},_0x365052={},_0x555238={'count':0x0,'rows':[]};var _0x1c980f=db[_0x4b1e('0x27')]['rawAttributes'];_0x365052[_0x4b1e('0x28')]=_[_0x4b1e('0x29')](_0x1c980f);_0x365052[_0x4b1e('0x2a')]=_[_0x4b1e('0x29')](_0x565747[_0x4b1e('0x2a')]);_0x365052['filters']=_[_0x4b1e('0x2b')](_0x365052[_0x4b1e('0x28')],_0x365052['query']);_0x3342e8[_0x4b1e('0x2c')]=_[_0x4b1e('0x2b')](_0x365052[_0x4b1e('0x28')],qs[_0x4b1e('0x2d')](_0x565747[_0x4b1e('0x2a')][_0x4b1e('0x2d')]));_0x3342e8[_0x4b1e('0x2c')]=_0x3342e8[_0x4b1e('0x2c')]['length']?_0x3342e8['attributes']:_0x365052['model'];if(!_0x565747[_0x4b1e('0x2a')]['hasOwnProperty'](_0x4b1e('0x2e'))){_0x3342e8[_0x4b1e('0x1a')]=qs[_0x4b1e('0x1a')](_0x565747['query'][_0x4b1e('0x1a')]);_0x3342e8['offset']=qs['offset'](_0x565747['query'][_0x4b1e('0x19')]);}_0x3342e8[_0x4b1e('0x2f')]=qs[_0x4b1e('0x30')](_0x565747[_0x4b1e('0x2a')][_0x4b1e('0x30')]);_0x3342e8[_0x4b1e('0x31')]=qs['filters'](_[_0x4b1e('0x32')](_0x565747[_0x4b1e('0x2a')],_0x365052[_0x4b1e('0x33')]));if(_0x565747['query'][_0x4b1e('0x34')]){_0x3342e8['where']=_['merge'](_0x3342e8[_0x4b1e('0x31')],{'$or':_[_0x4b1e('0x35')](_0x1c980f,function(_0xd076f7){if(_0xd076f7['type'][_0x4b1e('0x36')]!==_0x4b1e('0x37')){var _0x4a9a43={};_0x4a9a43[_0xd076f7['field']]={'$like':'%'+_0x565747[_0x4b1e('0x2a')][_0x4b1e('0x34')]+'%'};return _0x4a9a43;}})});}_0x3342e8=_['merge']({},_0x3342e8,_0x565747[_0x4b1e('0x38')]);var _0x1213c2={'where':_0x3342e8[_0x4b1e('0x31')]};return db['IntegrationReport'][_0x4b1e('0x18')](_0x1213c2)['then'](function(_0xd5703){_0x555238[_0x4b1e('0x18')]=_0xd5703;if(_0x565747[_0x4b1e('0x2a')][_0x4b1e('0x39')]){_0x3342e8['include']=[{'all':!![]}];}return db[_0x4b1e('0x27')][_0x4b1e('0x3a')](_0x3342e8);})[_0x4b1e('0x20')](function(_0x2857e6){_0x555238[_0x4b1e('0x3b')]=_0x2857e6;return _0x555238;})[_0x4b1e('0x20')](respondWithFilteredResult(_0x3eabe6,_0x3342e8))[_0x4b1e('0x3c')](handleError(_0x3eabe6,null));};exports[_0x4b1e('0x3d')]=function(_0x53148b,_0x468367){var _0x45dbd8={'raw':![],'where':{'id':_0x53148b[_0x4b1e('0x3e')]['id']}},_0x4ab324={};_0x4ab324['model']=_['keys'](db['IntegrationReport'][_0x4b1e('0x3f')]);_0x4ab324[_0x4b1e('0x2a')]=_['keys'](_0x53148b[_0x4b1e('0x2a')]);_0x4ab324[_0x4b1e('0x33')]=_['intersection'](_0x4ab324[_0x4b1e('0x28')],_0x4ab324[_0x4b1e('0x2a')]);_0x45dbd8['attributes']=_[_0x4b1e('0x2b')](_0x4ab324['model'],qs[_0x4b1e('0x2d')](_0x53148b[_0x4b1e('0x2a')][_0x4b1e('0x2d')]));_0x45dbd8[_0x4b1e('0x2c')]=_0x45dbd8[_0x4b1e('0x2c')][_0x4b1e('0x40')]?_0x45dbd8[_0x4b1e('0x2c')]:_0x4ab324['model'];if(_0x53148b[_0x4b1e('0x2a')][_0x4b1e('0x39')]){_0x45dbd8[_0x4b1e('0x41')]=[{'all':!![]}];}_0x45dbd8=_[_0x4b1e('0x42')]({},_0x45dbd8,_0x53148b['options']);return db['IntegrationReport'][_0x4b1e('0x43')](_0x45dbd8)[_0x4b1e('0x20')](handleEntityNotFound(_0x468367,null))['then'](respondWithResult(_0x468367,null))[_0x4b1e('0x3c')](handleError(_0x468367,null));};exports[_0x4b1e('0x44')]=function(_0x1bf947,_0x48fe16){return db[_0x4b1e('0x27')][_0x4b1e('0x44')](_0x1bf947['body'],{})[_0x4b1e('0x20')](respondWithResult(_0x48fe16,0xc9))[_0x4b1e('0x3c')](handleError(_0x48fe16,null));};exports[_0x4b1e('0x45')]=function(_0x425c0a,_0x141b69){if(_0x425c0a[_0x4b1e('0x46')]['id']){delete _0x425c0a[_0x4b1e('0x46')]['id'];}return db['IntegrationReport'][_0x4b1e('0x43')]({'where':{'id':_0x425c0a[_0x4b1e('0x3e')]['id']}})[_0x4b1e('0x20')](handleEntityNotFound(_0x141b69,null))['then'](saveUpdates(_0x425c0a[_0x4b1e('0x46')],null))[_0x4b1e('0x20')](respondWithResult(_0x141b69,null))[_0x4b1e('0x3c')](handleError(_0x141b69,null));};exports[_0x4b1e('0x21')]=function(_0x44cf03,_0x4954dc){return db['IntegrationReport'][_0x4b1e('0x43')]({'where':{'id':_0x44cf03[_0x4b1e('0x3e')]['id']}})[_0x4b1e('0x20')](handleEntityNotFound(_0x4954dc,null))[_0x4b1e('0x20')](removeEntity(_0x4954dc,null))[_0x4b1e('0x3c')](handleError(_0x4954dc,null));};exports['describe']=function(_0x4833af,_0x7a2584){return db[_0x4b1e('0x27')][_0x4b1e('0x47')]()['then'](respondWithResult(_0x7a2584,null))[_0x4b1e('0x3c')](handleError(_0x7a2584,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index c3e1b79..e0c120f 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 _0xa7e6=['exports','define','IntegrationReport','report_integration','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./integrationReport.attributes'];(function(_0x390e02,_0x2fe1ec){var _0x55b0a9=function(_0x7656eb){while(--_0x7656eb){_0x390e02['push'](_0x390e02['shift']());}};_0x55b0a9(++_0x2fe1ec);}(_0xa7e6,0x74));var _0x6a7e=function(_0x56a28a,_0x12b812){_0x56a28a=_0x56a28a-0x0;var _0x2f0161=_0xa7e6[_0x56a28a];return _0x2f0161;};'use strict';var _=require(_0x6a7e('0x0'));var util=require(_0x6a7e('0x1'));var logger=require(_0x6a7e('0x2'))(_0x6a7e('0x3'));var moment=require(_0x6a7e('0x4'));var BPromise=require(_0x6a7e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6a7e('0x6'));var rimraf=require(_0x6a7e('0x7'));var config=require(_0x6a7e('0x8'));var attributes=require(_0x6a7e('0x9'));module[_0x6a7e('0xa')]=function(_0x599006,_0x79df6f){return _0x599006[_0x6a7e('0xb')](_0x6a7e('0xc'),attributes,{'tableName':_0x6a7e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7da7=['util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','exports','define','report_integration','lodash'];(function(_0x54cab5,_0x523873){var _0x2d398c=function(_0x10b193){while(--_0x10b193){_0x54cab5['push'](_0x54cab5['shift']());}};_0x2d398c(++_0x523873);}(_0x7da7,0x10d));var _0x77da=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x7da7[_0x2ec461];return _0x28603d;};'use strict';var _=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var logger=require(_0x77da('0x2'))('api');var moment=require('moment');var BPromise=require(_0x77da('0x3'));var rp=require(_0x77da('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x77da('0x5'));var config=require(_0x77da('0x6'));var attributes=require('./integrationReport.attributes');module[_0x77da('0x7')]=function(_0xc54a12,_0x47da81){return _0xc54a12[_0x77da('0x8')]('IntegrationReport',attributes,{'tableName':_0x77da('0x9'),'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 e15b7b6..1bea691 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 _0x3485=['message','info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','IntegrationReport,\x20%s,\x20%s'];(function(_0x1d5d3f,_0x3a9d08){var _0x6f9221=function(_0x1e9b5d){while(--_0x1e9b5d){_0x1d5d3f['push'](_0x1d5d3f['shift']());}};_0x6f9221(++_0x3a9d08);}(_0x3485,0x17f));var _0x5348=function(_0x263695,_0x307e90){_0x263695=_0x263695-0x0;var _0xdb50c4=_0x3485[_0x263695];return _0xdb50c4;};'use strict';var _=require(_0x5348('0x0'));var util=require(_0x5348('0x1'));var moment=require(_0x5348('0x2'));var BPromise=require(_0x5348('0x3'));var rs=require(_0x5348('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5348('0x5'))['db'];var utils=require(_0x5348('0x6'));var logger=require(_0x5348('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5348('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5442c0,_0x1e0b22,_0x377e31){return new BPromise(function(_0x47822d,_0x417832){return client['request'](_0x5442c0,_0x377e31)['then'](function(_0x20dca2){logger['info']('IntegrationReport,\x20%s,\x20%s',_0x1e0b22,_0x5348('0x9'));logger[_0x5348('0xa')](_0x5348('0xb'),_0x1e0b22,_0x5348('0x9'),JSON[_0x5348('0xc')](_0x20dca2));if(_0x20dca2[_0x5348('0xd')]){if(_0x20dca2['error'][_0x5348('0xe')]===0x1f4){logger['error'](_0x5348('0xf'),_0x1e0b22,_0x20dca2[_0x5348('0xd')]['message']);return _0x417832(_0x20dca2[_0x5348('0xd')]['message']);}logger[_0x5348('0xd')]('IntegrationReport,\x20%s,\x20%s',_0x1e0b22,_0x20dca2[_0x5348('0xd')][_0x5348('0x10')]);return _0x47822d(_0x20dca2[_0x5348('0xd')]['message']);}else{logger[_0x5348('0x11')](_0x5348('0xf'),_0x1e0b22,_0x5348('0x9'));_0x47822d(_0x20dca2['result'][_0x5348('0x10')]);}})[_0x5348('0x12')](function(_0x4788e7){logger['error'](_0x5348('0xf'),_0x1e0b22,_0x4788e7);_0x417832(_0x4788e7);});});} \ No newline at end of file +var _0xf904=['http','request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','client'];(function(_0x4f16ca,_0x56f938){var _0x4b6d21=function(_0x4b7b67){while(--_0x4b7b67){_0x4f16ca['push'](_0x4f16ca['shift']());}};_0x4b6d21(++_0x56f938);}(_0xf904,0xc9));var _0x4f90=function(_0x148785,_0x195ee5){_0x148785=_0x148785-0x0;var _0x17a172=_0xf904[_0x148785];return _0x17a172;};'use strict';var _=require(_0x4f90('0x0'));var util=require(_0x4f90('0x1'));var moment=require(_0x4f90('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4f90('0x3'));var db=require(_0x4f90('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4f90('0x5'))(_0x4f90('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4f90('0x7')][_0x4f90('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x32660b,_0x5296ce,_0x1623f9){return new BPromise(function(_0x28915f,_0x21c0b2){return client[_0x4f90('0x9')](_0x32660b,_0x1623f9)[_0x4f90('0xa')](function(_0x59e5ef){logger['info'](_0x4f90('0xb'),_0x5296ce,_0x4f90('0xc'));logger[_0x4f90('0xd')](_0x4f90('0xe'),_0x5296ce,_0x4f90('0xc'),JSON[_0x4f90('0xf')](_0x59e5ef));if(_0x59e5ef[_0x4f90('0x10')]){if(_0x59e5ef[_0x4f90('0x10')][_0x4f90('0x11')]===0x1f4){logger[_0x4f90('0x10')]('IntegrationReport,\x20%s,\x20%s',_0x5296ce,_0x59e5ef[_0x4f90('0x10')][_0x4f90('0x12')]);return _0x21c0b2(_0x59e5ef['error'][_0x4f90('0x12')]);}logger['error'](_0x4f90('0xb'),_0x5296ce,_0x59e5ef[_0x4f90('0x10')][_0x4f90('0x12')]);return _0x28915f(_0x59e5ef['error'][_0x4f90('0x12')]);}else{logger['info'](_0x4f90('0xb'),_0x5296ce,_0x4f90('0xc'));_0x28915f(_0x59e5ef['result']['message']);}})['catch'](function(_0x2cac7c){logger[_0x4f90('0x10')](_0x4f90('0xb'),_0x5296ce,_0x2cac7c);_0x21c0b2(_0x2cac7c);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index aef6328..7e05538 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 _0xb0ee=['addIntervals','put','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','index','/:id','isAuthenticated','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many'];(function(_0x256ec5,_0x36be4e){var _0x33638b=function(_0x45f76a){while(--_0x45f76a){_0x256ec5['push'](_0x256ec5['shift']());}};_0x33638b(++_0x36be4e);}(_0xb0ee,0x18f));var _0xeb0e=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xb0ee[_0x46698a];return _0x356db0;};'use strict';var multer=require('multer');var util=require(_0xeb0e('0x0'));var path=require(_0xeb0e('0x1'));var timeout=require(_0xeb0e('0x2'));var express=require(_0xeb0e('0x3'));var router=express[_0xeb0e('0x4')]();var auth=require(_0xeb0e('0x5'));var interaction=require(_0xeb0e('0x6'));var config=require(_0xeb0e('0x7'));var controller=require(_0xeb0e('0x8'));router[_0xeb0e('0x9')]('/',auth['isAuthenticated'](),controller[_0xeb0e('0xa')]);router[_0xeb0e('0x9')](_0xeb0e('0xb'),auth[_0xeb0e('0xc')](),controller['show']);router[_0xeb0e('0x9')](_0xeb0e('0xd'),auth[_0xeb0e('0xc')](),controller[_0xeb0e('0xe')]);router[_0xeb0e('0xf')]('/',auth[_0xeb0e('0xc')](),controller[_0xeb0e('0x10')]);router[_0xeb0e('0xf')](_0xeb0e('0xd'),auth[_0xeb0e('0xc')](),controller[_0xeb0e('0x11')]);router[_0xeb0e('0xf')](_0xeb0e('0x12'),auth[_0xeb0e('0xc')](),controller[_0xeb0e('0x13')]);router[_0xeb0e('0x14')](_0xeb0e('0xb'),auth[_0xeb0e('0xc')](),controller['update']);router['delete'](_0xeb0e('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xeb0e('0x15')]=router; \ No newline at end of file +var _0x1a12=['express','Router','../../components/interaction/service','./interval.controller','get','isAuthenticated','index','/:id','/:id/sub_intervals','getIntervals','post','create','addInterval','addIntervals','put','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x1be7fd,_0x51ff5a){var _0x2f7949=function(_0x1eb3ed){while(--_0x1eb3ed){_0x1be7fd['push'](_0x1be7fd['shift']());}};_0x2f7949(++_0x51ff5a);}(_0x1a12,0x80));var _0x21a1=function(_0x3763df,_0x5705aa){_0x3763df=_0x3763df-0x0;var _0x1b49ce=_0x1a12[_0x3763df];return _0x1b49ce;};'use strict';var multer=require(_0x21a1('0x0'));var util=require(_0x21a1('0x1'));var path=require(_0x21a1('0x2'));var timeout=require(_0x21a1('0x3'));var express=require(_0x21a1('0x4'));var router=express[_0x21a1('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x21a1('0x6'));var config=require('../../config/environment');var controller=require(_0x21a1('0x7'));router[_0x21a1('0x8')]('/',auth[_0x21a1('0x9')](),controller[_0x21a1('0xa')]);router['get'](_0x21a1('0xb'),auth[_0x21a1('0x9')](),controller['show']);router['get'](_0x21a1('0xc'),auth[_0x21a1('0x9')](),controller[_0x21a1('0xd')]);router[_0x21a1('0xe')]('/',auth[_0x21a1('0x9')](),controller[_0x21a1('0xf')]);router['post']('/:id/sub_intervals',auth[_0x21a1('0x9')](),controller[_0x21a1('0x10')]);router['post']('/:id/sub_intervals/create_many',auth[_0x21a1('0x9')](),controller[_0x21a1('0x11')]);router[_0x21a1('0x12')](_0x21a1('0xb'),auth[_0x21a1('0x9')](),controller[_0x21a1('0x13')]);router[_0x21a1('0x14')](_0x21a1('0xb'),auth[_0x21a1('0x9')](),controller['destroy']);module[_0x21a1('0x15')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 635f37f..51aa407 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 _0x8c81=['exports','STRING','sequelize'];(function(_0x32495d,_0x5ee6ec){var _0x1c0acf=function(_0x258f3b){while(--_0x258f3b){_0x32495d['push'](_0x32495d['shift']());}};_0x1c0acf(++_0x5ee6ec);}(_0x8c81,0x16d));var _0x18c8=function(_0x3f1755,_0x2d0d62){_0x3f1755=_0x3f1755-0x0;var _0x293d90=_0x8c81[_0x3f1755];return _0x293d90;};'use strict';var Sequelize=require(_0x18c8('0x0'));module[_0x18c8('0x1')]={'name':{'type':Sequelize[_0x18c8('0x2')]},'description':{'type':Sequelize[_0x18c8('0x2')]},'interval':{'type':Sequelize[_0x18c8('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x07b5=['STRING','sequelize'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x07b5,0x1ed));var _0x507b=function(_0x221b8c,_0x2c7afc){_0x221b8c=_0x221b8c-0x0;var _0x3fab9f=_0x07b5[_0x221b8c];return _0x3fab9f;};'use strict';var Sequelize=require(_0x507b('0x0'));module['exports']={'name':{'type':Sequelize[_0x507b('0x1')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x507b('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 36a348e..e6e8d25 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 _0x43e4=['catch','show','params','rawAttributes','filters','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','addIntervals','findOne','sequelize','transaction','bulkCreate','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','limit','apply','reject','save','update','then','destroy','get','Intervals','UserProfileResource','error','stack','name','send','index','Interval','model','keys','query','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','count','include','findAll','rows'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x43e4,0x1de));var _0x443e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x43e4[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x443e('0x0'));var emlformat=require(_0x443e('0x1'));var rimraf=require(_0x443e('0x2'));var zipdir=require(_0x443e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x443e('0x4'));var moment=require(_0x443e('0x5'));var BPromise=require(_0x443e('0x6'));var Mustache=require('mustache');var util=require(_0x443e('0x7'));var path=require('path');var sox=require(_0x443e('0x8'));var csv=require(_0x443e('0x9'));var ejs=require(_0x443e('0xa'));var fs=require('fs');var _=require(_0x443e('0xb'));var squel=require(_0x443e('0xc'));var crypto=require(_0x443e('0xd'));var jsforce=require(_0x443e('0xe'));var deskjs=require(_0x443e('0xf'));var toCsv=require('to-csv');var querystring=require(_0x443e('0x10'));var Papa=require('papaparse');var Redis=require(_0x443e('0x11'));var authService=require(_0x443e('0x12'));var qs=require(_0x443e('0x13'));var hardwareService=require(_0x443e('0x14'));var logger=require('../../config/logger')(_0x443e('0x15'));var utils=require(_0x443e('0x16'));var config=require('../../config/environment');var db=require(_0x443e('0x17'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x58999,_0x2e067d){_0x2e067d=_0x2e067d||0xcc;return function(_0x84674){if(_0x84674){return _0x58999[_0x443e('0x18')](_0x2e067d);}return _0x58999[_0x443e('0x19')](_0x2e067d)['end']();};}function respondWithResult(_0x5245ce,_0x37d7fb){_0x37d7fb=_0x37d7fb||0xc8;return function(_0xa01a20){if(_0xa01a20){return _0x5245ce[_0x443e('0x19')](_0x37d7fb)[_0x443e('0x1a')](_0xa01a20);}};}function respondWithFilteredResult(_0x49bd98,_0x30efcf){return function(_0x38f855){if(_0x38f855){var _0x366280=_0x38f855['count'],_0x3504d2=_0x30efcf[_0x443e('0x1b')],_0xbb72ba=_0x30efcf[_0x443e('0x1b')]+_0x30efcf[_0x443e('0x1c')],_0x111521;if(_0xbb72ba>=_0x366280){_0xbb72ba=_0x366280;_0x111521=0xc8;}else{_0x111521=0xce;}_0x49bd98['status'](_0x111521);return _0x49bd98['set']('Content-Range',_0x3504d2+'-'+_0xbb72ba+'/'+_0x366280)[_0x443e('0x1a')](_0x38f855);}return null;};}function patchUpdates(_0x9f66f7){return function(_0x9a4b0b){try{jsonpatch[_0x443e('0x1d')](_0x9a4b0b,_0x9f66f7,!![]);}catch(_0xc23578){return BPromise[_0x443e('0x1e')](_0xc23578);}return _0x9a4b0b[_0x443e('0x1f')]();};}function saveUpdates(_0x1b50e7,_0x569009){return function(_0x1c1f99){if(_0x1c1f99){return _0x1c1f99[_0x443e('0x20')](_0x1b50e7)[_0x443e('0x21')](function(_0x33547e){return _0x33547e;});}return null;};}function removeEntity(_0x1290e2,_0x34f6c9){return function(_0x5cf7a1){if(_0x5cf7a1){return _0x5cf7a1[_0x443e('0x22')]()[_0x443e('0x21')](function(){var _0x4386ae=_0x5cf7a1[_0x443e('0x23')]({'plain':!![]});var _0x3927b5=_0x443e('0x24');return db[_0x443e('0x25')][_0x443e('0x22')]({'where':{'type':_0x3927b5,'resourceId':_0x4386ae['id']}})[_0x443e('0x21')](function(){return _0x5cf7a1;});})[_0x443e('0x21')](function(){_0x1290e2[_0x443e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b3398,_0xb6bb43){return function(_0x367e73){if(!_0x367e73){_0x2b3398[_0x443e('0x18')](0x194);}return _0x367e73;};}function handleError(_0x2a238d,_0x469e77){_0x469e77=_0x469e77||0x1f4;return function(_0x1bc434){logger[_0x443e('0x26')](_0x1bc434[_0x443e('0x27')]);if(_0x1bc434[_0x443e('0x28')]){delete _0x1bc434['name'];}_0x2a238d['status'](_0x469e77)[_0x443e('0x29')](_0x1bc434);};}exports[_0x443e('0x2a')]=function(_0x21f3cb,_0x37aef9){var _0x2d4a1b={},_0x359947={},_0x2e9c85={'count':0x0,'rows':[]};var _0x5089d2=db[_0x443e('0x2b')]['rawAttributes'];_0x359947[_0x443e('0x2c')]=_[_0x443e('0x2d')](_0x5089d2);_0x359947[_0x443e('0x2e')]=_[_0x443e('0x2d')](_0x21f3cb[_0x443e('0x2e')]);_0x359947['filters']=_[_0x443e('0x2f')](_0x359947['model'],_0x359947[_0x443e('0x2e')]);_0x2d4a1b['attributes']=_[_0x443e('0x2f')](_0x359947[_0x443e('0x2c')],qs[_0x443e('0x30')](_0x21f3cb[_0x443e('0x2e')][_0x443e('0x30')]));_0x2d4a1b[_0x443e('0x31')]=_0x2d4a1b[_0x443e('0x31')][_0x443e('0x32')]?_0x2d4a1b[_0x443e('0x31')]:_0x359947['model'];if(!_0x21f3cb[_0x443e('0x2e')]['hasOwnProperty'](_0x443e('0x33'))){_0x2d4a1b['limit']=qs[_0x443e('0x1c')](_0x21f3cb[_0x443e('0x2e')][_0x443e('0x1c')]);_0x2d4a1b['offset']=qs[_0x443e('0x1b')](_0x21f3cb[_0x443e('0x2e')][_0x443e('0x1b')]);}_0x2d4a1b[_0x443e('0x34')]=qs[_0x443e('0x35')](_0x21f3cb[_0x443e('0x2e')][_0x443e('0x35')]);_0x2d4a1b[_0x443e('0x36')]=qs['filters'](_[_0x443e('0x37')](_0x21f3cb['query'],_0x359947['filters']));if(_0x21f3cb[_0x443e('0x2e')][_0x443e('0x38')]){_0x2d4a1b[_0x443e('0x36')]=_[_0x443e('0x39')](_0x2d4a1b['where'],{'$or':_[_0x443e('0x3a')](_0x5089d2,function(_0x41eb1a){if(_0x41eb1a[_0x443e('0x3b')][_0x443e('0x3c')]!==_0x443e('0x3d')){var _0xcecb2c={};_0xcecb2c[_0x41eb1a[_0x443e('0x3e')]]={'$like':'%'+_0x21f3cb[_0x443e('0x2e')][_0x443e('0x38')]+'%'};return _0xcecb2c;}})});}_0x2d4a1b=_[_0x443e('0x39')]({},_0x2d4a1b,_0x21f3cb[_0x443e('0x3f')]);var _0x440e5f={'where':_0x2d4a1b[_0x443e('0x36')]};return db[_0x443e('0x2b')][_0x443e('0x40')](_0x440e5f)[_0x443e('0x21')](function(_0x3dfd4f){_0x2e9c85[_0x443e('0x40')]=_0x3dfd4f;if(_0x21f3cb[_0x443e('0x2e')]['includeAll']){_0x2d4a1b[_0x443e('0x41')]=[{'all':!![]}];}return db['Interval'][_0x443e('0x42')](_0x2d4a1b);})['then'](function(_0x427de2){_0x2e9c85[_0x443e('0x43')]=_0x427de2;return _0x2e9c85;})[_0x443e('0x21')](respondWithFilteredResult(_0x37aef9,_0x2d4a1b))[_0x443e('0x44')](handleError(_0x37aef9,null));};exports[_0x443e('0x45')]=function(_0x35b904,_0x3f3193){var _0x4dd9e8={'raw':!![],'where':{'id':_0x35b904[_0x443e('0x46')]['id']}},_0x48b0cf={};_0x48b0cf[_0x443e('0x2c')]=_[_0x443e('0x2d')](db[_0x443e('0x2b')][_0x443e('0x47')]);_0x48b0cf[_0x443e('0x2e')]=_[_0x443e('0x2d')](_0x35b904[_0x443e('0x2e')]);_0x48b0cf[_0x443e('0x48')]=_[_0x443e('0x2f')](_0x48b0cf[_0x443e('0x2c')],_0x48b0cf[_0x443e('0x2e')]);_0x4dd9e8[_0x443e('0x31')]=_[_0x443e('0x2f')](_0x48b0cf[_0x443e('0x2c')],qs[_0x443e('0x30')](_0x35b904[_0x443e('0x2e')]['fields']));_0x4dd9e8[_0x443e('0x31')]=_0x4dd9e8[_0x443e('0x31')][_0x443e('0x32')]?_0x4dd9e8['attributes']:_0x48b0cf[_0x443e('0x2c')];if(_0x35b904[_0x443e('0x2e')][_0x443e('0x49')]){_0x4dd9e8[_0x443e('0x41')]=[{'all':!![]}];}_0x4dd9e8=_[_0x443e('0x39')]({},_0x4dd9e8,_0x35b904['options']);return db[_0x443e('0x2b')][_0x443e('0x4a')](_0x4dd9e8)['then'](handleEntityNotFound(_0x3f3193,null))[_0x443e('0x21')](respondWithResult(_0x3f3193,null))[_0x443e('0x44')](handleError(_0x3f3193,null));};exports[_0x443e('0x4b')]=function(_0x3ce1b9,_0x415581){return db[_0x443e('0x2b')][_0x443e('0x4b')](_0x3ce1b9[_0x443e('0x4c')],{})[_0x443e('0x21')](function(_0x107e72){var _0x41c6f8=_0x3ce1b9['user'][_0x443e('0x23')]({'plain':!![]});if(!_0x41c6f8)throw new Error(_0x443e('0x4d'));if(_0x41c6f8[_0x443e('0x4e')]===_0x443e('0x4f')){var _0x212a4d=_0x107e72[_0x443e('0x23')]({'plain':!![]});var _0x2609cd=_0x443e('0x24');return db[_0x443e('0x50')][_0x443e('0x4a')]({'where':{'name':_0x2609cd,'userProfileId':_0x41c6f8[_0x443e('0x51')]},'raw':!![]})[_0x443e('0x21')](function(_0x588861){if(_0x588861&&_0x588861['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x212a4d[_0x443e('0x28')],'resourceId':_0x212a4d['id'],'type':_0x588861[_0x443e('0x28')],'sectionId':_0x588861['id']},{})[_0x443e('0x21')](function(){return _0x107e72;});}else{return _0x107e72;}})[_0x443e('0x44')](function(_0x4196c6){logger['error'](_0x443e('0x52'),_0x4196c6);throw _0x4196c6;});}return _0x107e72;})['then'](respondWithResult(_0x415581,0xc9))[_0x443e('0x44')](handleError(_0x415581,null));};exports[_0x443e('0x20')]=function(_0x58a3cc,_0x2c3421){if(_0x58a3cc['body']['id']){delete _0x58a3cc['body']['id'];}return db[_0x443e('0x2b')][_0x443e('0x4a')]({'where':{'id':_0x58a3cc[_0x443e('0x46')]['id']}})[_0x443e('0x21')](handleEntityNotFound(_0x2c3421,null))[_0x443e('0x21')](saveUpdates(_0x58a3cc[_0x443e('0x4c')],null))['then'](respondWithResult(_0x2c3421,null))[_0x443e('0x44')](handleError(_0x2c3421,null));};exports['destroy']=function(_0x10b71f,_0xa75723){return db[_0x443e('0x2b')]['find']({'where':{'id':_0x10b71f[_0x443e('0x46')]['id']}})['then'](handleEntityNotFound(_0xa75723,null))[_0x443e('0x21')](removeEntity(_0xa75723,null))['catch'](handleError(_0xa75723,null));};exports[_0x443e('0x53')]=function(_0x5a47ee,_0x57e471,_0x21a3bf){if(_0x5a47ee['body']['id']){delete _0x5a47ee[_0x443e('0x4c')]['id'];}return db[_0x443e('0x2b')][_0x443e('0x4a')]({'where':{'id':_0x5a47ee['params']['id']}})[_0x443e('0x21')](handleEntityNotFound(_0x57e471,null))[_0x443e('0x21')](function(_0xd80cc3){if(_0xd80cc3){_0x5a47ee[_0x443e('0x4c')][_0x443e('0x54')]=_0xd80cc3['id'];return db[_0x443e('0x2b')][_0x443e('0x4b')](_0x5a47ee[_0x443e('0x4c')]);}})[_0x443e('0x21')](respondWithResult(_0x57e471,null))[_0x443e('0x44')](handleError(_0x57e471,null));};exports[_0x443e('0x55')]=function(_0x3d7b52,_0x31bfc4,_0x304d44){var _0x9b2f0b={};var _0x2ccf26={};var _0x5ad1e1;var _0x2af2bf;return db[_0x443e('0x2b')]['findOne']({'where':{'id':_0x3d7b52[_0x443e('0x46')]['id']}})[_0x443e('0x21')](handleEntityNotFound(_0x31bfc4,null))[_0x443e('0x21')](function(_0x6e2179){if(_0x6e2179){_0x5ad1e1=_0x6e2179;_0x2ccf26[_0x443e('0x2c')]=_['keys'](db['Interval'][_0x443e('0x47')]);_0x2ccf26['query']=_[_0x443e('0x2d')](_0x3d7b52[_0x443e('0x2e')]);_0x2ccf26['filters']=_[_0x443e('0x2f')](_0x2ccf26[_0x443e('0x2c')],_0x2ccf26[_0x443e('0x2e')]);_0x9b2f0b[_0x443e('0x31')]=_[_0x443e('0x2f')](_0x2ccf26[_0x443e('0x2c')],qs[_0x443e('0x30')](_0x3d7b52['query']['fields']));_0x9b2f0b[_0x443e('0x31')]=_0x9b2f0b[_0x443e('0x31')][_0x443e('0x32')]?_0x9b2f0b[_0x443e('0x31')]:_0x2ccf26['model'];_0x9b2f0b[_0x443e('0x34')]=qs['sort'](_0x3d7b52['query'][_0x443e('0x35')]);_0x9b2f0b[_0x443e('0x36')]=qs[_0x443e('0x48')](_[_0x443e('0x37')](_0x3d7b52[_0x443e('0x2e')],_0x2ccf26[_0x443e('0x48')]));if(_0x3d7b52[_0x443e('0x2e')][_0x443e('0x38')]){_0x9b2f0b[_0x443e('0x36')]=_[_0x443e('0x39')](_0x9b2f0b['where'],{'$or':_['map'](_0x9b2f0b[_0x443e('0x31')],function(_0x2c10d0){var _0x345f7a={};_0x345f7a[_0x2c10d0]={'$like':'%'+_0x3d7b52[_0x443e('0x2e')]['filter']+'%'};return _0x345f7a;})});}_0x9b2f0b=_['merge']({},_0x9b2f0b,_0x3d7b52[_0x443e('0x3f')]);return _0x5ad1e1[_0x443e('0x55')](_0x9b2f0b);}})['then'](function(_0x1c998e){if(_0x1c998e){_0x2af2bf=_0x1c998e[_0x443e('0x32')];if(!_0x3d7b52['query']['hasOwnProperty']('nolimit')){_0x9b2f0b[_0x443e('0x1c')]=qs['limit'](_0x3d7b52[_0x443e('0x2e')][_0x443e('0x1c')]);_0x9b2f0b[_0x443e('0x1b')]=qs[_0x443e('0x1b')](_0x3d7b52[_0x443e('0x2e')][_0x443e('0x1b')]);}return _0x5ad1e1[_0x443e('0x55')](_0x9b2f0b);}})[_0x443e('0x21')](function(_0x534055){if(_0x534055){return _0x534055?{'count':_0x2af2bf,'rows':_0x534055}:null;}})[_0x443e('0x21')](respondWithResult(_0x31bfc4,null))['catch'](handleError(_0x31bfc4,null));};exports[_0x443e('0x56')]=function(_0x3c3845,_0x35d27b,_0x3bdd5f){return db['Interval'][_0x443e('0x57')]({'where':{'id':_0x3c3845[_0x443e('0x46')]['id']}})['then'](handleEntityNotFound(_0x35d27b,null))[_0x443e('0x21')](function(_0x2b49fa){if(_0x2b49fa){return db[_0x443e('0x58')][_0x443e('0x59')](function(_0x564c55){return db['Interval'][_0x443e('0x22')]({'where':{'IntervalId':_0x3c3845[_0x443e('0x46')]['id']},'transaction':_0x564c55})[_0x443e('0x21')](function(_0x19329a){var _0x1b3f84=_[_0x443e('0x3a')](_0x3c3845[_0x443e('0x4c')],function(_0x2d04f1){delete _0x2d04f1['id'];_0x2d04f1['IntervalId']=_0x3c3845[_0x443e('0x46')]['id'];return _0x2d04f1;});return db[_0x443e('0x2b')][_0x443e('0x5a')](_0x1b3f84,{'transaction':_0x564c55});});})['then'](function(){return db[_0x443e('0x2b')][_0x443e('0x42')]({'where':{'IntervalId':_0x3c3845[_0x443e('0x46')]['id']}});});}})['then'](respondWithResult(_0x35d27b,null))[_0x443e('0x44')](handleError(_0x35d27b,null));}; \ No newline at end of file +var _0x95a5=['squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/extensions/rewrite','end','json','count','offset','limit','status','set','Content-Range','apply','reject','update','then','get','Intervals','UserProfileResource','destroy','stack','name','index','Interval','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','key','field','includeAll','findAll','rows','catch','show','params','rawAttributes','length','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','getIntervals','findOne','order','sequelize','IntervalId','bulkCreate','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash'];(function(_0x30b0d8,_0x57470c){var _0x459c09=function(_0x5e51b6){while(--_0x5e51b6){_0x30b0d8['push'](_0x30b0d8['shift']());}};_0x459c09(++_0x57470c);}(_0x95a5,0x105));var _0x595a=function(_0x5d7bcd,_0x81aa9f){_0x5d7bcd=_0x5d7bcd-0x0;var _0xf909db=_0x95a5[_0x5d7bcd];return _0xf909db;};'use strict';var pdf=require(_0x595a('0x0'));var emlformat=require(_0x595a('0x1'));var rimraf=require(_0x595a('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x595a('0x3'));var rp=require(_0x595a('0x4'));var moment=require(_0x595a('0x5'));var BPromise=require(_0x595a('0x6'));var Mustache=require(_0x595a('0x7'));var util=require(_0x595a('0x8'));var path=require(_0x595a('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x595a('0xa'));var fs=require('fs');var _=require(_0x595a('0xb'));var squel=require(_0x595a('0xc'));var crypto=require(_0x595a('0xd'));var jsforce=require(_0x595a('0xe'));var deskjs=require(_0x595a('0xf'));var toCsv=require(_0x595a('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x595a('0x11'));var authService=require(_0x595a('0x12'));var qs=require(_0x595a('0x13'));var hardwareService=require(_0x595a('0x14'));var logger=require(_0x595a('0x15'))(_0x595a('0x16'));var utils=require(_0x595a('0x17'));var config=require('../../config/environment');var db=require(_0x595a('0x18'))['db'];var extensions=require(_0x595a('0x19'));function respondWithStatusCode(_0x580568,_0x55f26b){_0x55f26b=_0x55f26b||0xcc;return function(_0x4c3956){if(_0x4c3956){return _0x580568['sendStatus'](_0x55f26b);}return _0x580568['status'](_0x55f26b)[_0x595a('0x1a')]();};}function respondWithResult(_0x1f36ac,_0x1b6e8c){_0x1b6e8c=_0x1b6e8c||0xc8;return function(_0x345139){if(_0x345139){return _0x1f36ac['status'](_0x1b6e8c)[_0x595a('0x1b')](_0x345139);}};}function respondWithFilteredResult(_0x44116c,_0x35ee28){return function(_0x5b1d11){if(_0x5b1d11){var _0x240edf=_0x5b1d11[_0x595a('0x1c')],_0x4451f4=_0x35ee28[_0x595a('0x1d')],_0x49cc4c=_0x35ee28[_0x595a('0x1d')]+_0x35ee28[_0x595a('0x1e')],_0x2d4dae;if(_0x49cc4c>=_0x240edf){_0x49cc4c=_0x240edf;_0x2d4dae=0xc8;}else{_0x2d4dae=0xce;}_0x44116c[_0x595a('0x1f')](_0x2d4dae);return _0x44116c[_0x595a('0x20')](_0x595a('0x21'),_0x4451f4+'-'+_0x49cc4c+'/'+_0x240edf)[_0x595a('0x1b')](_0x5b1d11);}return null;};}function patchUpdates(_0x26f1b8){return function(_0x4a8ae6){try{jsonpatch[_0x595a('0x22')](_0x4a8ae6,_0x26f1b8,!![]);}catch(_0x38e45a){return BPromise[_0x595a('0x23')](_0x38e45a);}return _0x4a8ae6['save']();};}function saveUpdates(_0x4c63c4,_0x37aaf5){return function(_0xdda8e6){if(_0xdda8e6){return _0xdda8e6[_0x595a('0x24')](_0x4c63c4)[_0x595a('0x25')](function(_0x239be0){return _0x239be0;});}return null;};}function removeEntity(_0x23b30f,_0x51d2e9){return function(_0x383d64){if(_0x383d64){return _0x383d64['destroy']()[_0x595a('0x25')](function(){var _0x37396d=_0x383d64[_0x595a('0x26')]({'plain':!![]});var _0x996a13=_0x595a('0x27');return db[_0x595a('0x28')][_0x595a('0x29')]({'where':{'type':_0x996a13,'resourceId':_0x37396d['id']}})['then'](function(){return _0x383d64;});})['then'](function(){_0x23b30f['status'](0xcc)[_0x595a('0x1a')]();});}};}function handleEntityNotFound(_0x421b4f,_0x51f280){return function(_0xc653f9){if(!_0xc653f9){_0x421b4f['sendStatus'](0x194);}return _0xc653f9;};}function handleError(_0x3b2612,_0x22ac9c){_0x22ac9c=_0x22ac9c||0x1f4;return function(_0x2753b4){logger['error'](_0x2753b4[_0x595a('0x2a')]);if(_0x2753b4['name']){delete _0x2753b4[_0x595a('0x2b')];}_0x3b2612['status'](_0x22ac9c)['send'](_0x2753b4);};}exports[_0x595a('0x2c')]=function(_0x1e5b2d,_0x2e3aae){var _0x13bc3c={},_0x4073c4={},_0x41da74={'count':0x0,'rows':[]};var _0xbe52af=db[_0x595a('0x2d')]['rawAttributes'];_0x4073c4[_0x595a('0x2e')]=_[_0x595a('0x2f')](_0xbe52af);_0x4073c4[_0x595a('0x30')]=_[_0x595a('0x2f')](_0x1e5b2d['query']);_0x4073c4[_0x595a('0x31')]=_[_0x595a('0x32')](_0x4073c4['model'],_0x4073c4[_0x595a('0x30')]);_0x13bc3c[_0x595a('0x33')]=_[_0x595a('0x32')](_0x4073c4[_0x595a('0x2e')],qs[_0x595a('0x34')](_0x1e5b2d[_0x595a('0x30')]['fields']));_0x13bc3c[_0x595a('0x33')]=_0x13bc3c[_0x595a('0x33')]['length']?_0x13bc3c[_0x595a('0x33')]:_0x4073c4[_0x595a('0x2e')];if(!_0x1e5b2d['query'][_0x595a('0x35')](_0x595a('0x36'))){_0x13bc3c[_0x595a('0x1e')]=qs['limit'](_0x1e5b2d[_0x595a('0x30')][_0x595a('0x1e')]);_0x13bc3c[_0x595a('0x1d')]=qs['offset'](_0x1e5b2d['query'][_0x595a('0x1d')]);}_0x13bc3c['order']=qs['sort'](_0x1e5b2d[_0x595a('0x30')][_0x595a('0x37')]);_0x13bc3c[_0x595a('0x38')]=qs[_0x595a('0x31')](_[_0x595a('0x39')](_0x1e5b2d[_0x595a('0x30')],_0x4073c4[_0x595a('0x31')]));if(_0x1e5b2d[_0x595a('0x30')][_0x595a('0x3a')]){_0x13bc3c[_0x595a('0x38')]=_[_0x595a('0x3b')](_0x13bc3c['where'],{'$or':_[_0x595a('0x3c')](_0xbe52af,function(_0x208366){if(_0x208366[_0x595a('0x3d')][_0x595a('0x3e')]!=='VIRTUAL'){var _0x263f52={};_0x263f52[_0x208366[_0x595a('0x3f')]]={'$like':'%'+_0x1e5b2d[_0x595a('0x30')][_0x595a('0x3a')]+'%'};return _0x263f52;}})});}_0x13bc3c=_[_0x595a('0x3b')]({},_0x13bc3c,_0x1e5b2d['options']);var _0x5b11df={'where':_0x13bc3c[_0x595a('0x38')]};return db[_0x595a('0x2d')][_0x595a('0x1c')](_0x5b11df)[_0x595a('0x25')](function(_0x339b05){_0x41da74[_0x595a('0x1c')]=_0x339b05;if(_0x1e5b2d[_0x595a('0x30')][_0x595a('0x40')]){_0x13bc3c['include']=[{'all':!![]}];}return db[_0x595a('0x2d')][_0x595a('0x41')](_0x13bc3c);})[_0x595a('0x25')](function(_0x21bbbc){_0x41da74[_0x595a('0x42')]=_0x21bbbc;return _0x41da74;})['then'](respondWithFilteredResult(_0x2e3aae,_0x13bc3c))[_0x595a('0x43')](handleError(_0x2e3aae,null));};exports[_0x595a('0x44')]=function(_0x6b634,_0x452248){var _0x1ab277={'raw':!![],'where':{'id':_0x6b634[_0x595a('0x45')]['id']}},_0x351619={};_0x351619['model']=_[_0x595a('0x2f')](db[_0x595a('0x2d')][_0x595a('0x46')]);_0x351619['query']=_['keys'](_0x6b634['query']);_0x351619[_0x595a('0x31')]=_[_0x595a('0x32')](_0x351619['model'],_0x351619['query']);_0x1ab277[_0x595a('0x33')]=_[_0x595a('0x32')](_0x351619[_0x595a('0x2e')],qs[_0x595a('0x34')](_0x6b634['query'][_0x595a('0x34')]));_0x1ab277[_0x595a('0x33')]=_0x1ab277[_0x595a('0x33')][_0x595a('0x47')]?_0x1ab277[_0x595a('0x33')]:_0x351619[_0x595a('0x2e')];if(_0x6b634[_0x595a('0x30')][_0x595a('0x40')]){_0x1ab277[_0x595a('0x48')]=[{'all':!![]}];}_0x1ab277=_['merge']({},_0x1ab277,_0x6b634[_0x595a('0x49')]);return db['Interval'][_0x595a('0x4a')](_0x1ab277)[_0x595a('0x25')](handleEntityNotFound(_0x452248,null))['then'](respondWithResult(_0x452248,null))[_0x595a('0x43')](handleError(_0x452248,null));};exports[_0x595a('0x4b')]=function(_0x2ddbfa,_0x314d9b){return db['Interval'][_0x595a('0x4b')](_0x2ddbfa[_0x595a('0x4c')],{})['then'](function(_0x49587b){var _0x44cabe=_0x2ddbfa[_0x595a('0x4d')][_0x595a('0x26')]({'plain':!![]});if(!_0x44cabe)throw new Error(_0x595a('0x4e'));if(_0x44cabe[_0x595a('0x4f')]===_0x595a('0x4d')){var _0x1492a0=_0x49587b['get']({'plain':!![]});var _0x40259d=_0x595a('0x27');return db['UserProfileSection']['find']({'where':{'name':_0x40259d,'userProfileId':_0x44cabe[_0x595a('0x50')]},'raw':!![]})['then'](function(_0x284a50){if(_0x284a50&&_0x284a50[_0x595a('0x51')]===0x0){return db[_0x595a('0x28')][_0x595a('0x4b')]({'name':_0x1492a0[_0x595a('0x2b')],'resourceId':_0x1492a0['id'],'type':_0x284a50['name'],'sectionId':_0x284a50['id']},{})[_0x595a('0x25')](function(){return _0x49587b;});}else{return _0x49587b;}})[_0x595a('0x43')](function(_0x1d52f4){logger[_0x595a('0x52')](_0x595a('0x53'),_0x1d52f4);throw _0x1d52f4;});}return _0x49587b;})[_0x595a('0x25')](respondWithResult(_0x314d9b,0xc9))[_0x595a('0x43')](handleError(_0x314d9b,null));};exports['update']=function(_0x45c47c,_0x5e4c88){if(_0x45c47c[_0x595a('0x4c')]['id']){delete _0x45c47c[_0x595a('0x4c')]['id'];}return db[_0x595a('0x2d')][_0x595a('0x4a')]({'where':{'id':_0x45c47c[_0x595a('0x45')]['id']}})[_0x595a('0x25')](handleEntityNotFound(_0x5e4c88,null))[_0x595a('0x25')](saveUpdates(_0x45c47c[_0x595a('0x4c')],null))[_0x595a('0x25')](respondWithResult(_0x5e4c88,null))[_0x595a('0x43')](handleError(_0x5e4c88,null));};exports['destroy']=function(_0x4c059c,_0x4acdbc){return db[_0x595a('0x2d')][_0x595a('0x4a')]({'where':{'id':_0x4c059c[_0x595a('0x45')]['id']}})[_0x595a('0x25')](handleEntityNotFound(_0x4acdbc,null))['then'](removeEntity(_0x4acdbc,null))[_0x595a('0x43')](handleError(_0x4acdbc,null));};exports[_0x595a('0x54')]=function(_0x2081a1,_0x9ba8a5,_0x1c89bd){if(_0x2081a1[_0x595a('0x4c')]['id']){delete _0x2081a1[_0x595a('0x4c')]['id'];}return db['Interval'][_0x595a('0x4a')]({'where':{'id':_0x2081a1[_0x595a('0x45')]['id']}})[_0x595a('0x25')](handleEntityNotFound(_0x9ba8a5,null))[_0x595a('0x25')](function(_0x294286){if(_0x294286){_0x2081a1['body']['IntervalId']=_0x294286['id'];return db[_0x595a('0x2d')][_0x595a('0x4b')](_0x2081a1[_0x595a('0x4c')]);}})[_0x595a('0x25')](respondWithResult(_0x9ba8a5,null))[_0x595a('0x43')](handleError(_0x9ba8a5,null));};exports[_0x595a('0x55')]=function(_0x2666ed,_0x2a273f,_0x477dbe){var _0x55d221={};var _0x30a6b2={};var _0x5817e8;var _0x3fe53d;return db[_0x595a('0x2d')][_0x595a('0x56')]({'where':{'id':_0x2666ed['params']['id']}})[_0x595a('0x25')](handleEntityNotFound(_0x2a273f,null))[_0x595a('0x25')](function(_0xc36708){if(_0xc36708){_0x5817e8=_0xc36708;_0x30a6b2[_0x595a('0x2e')]=_['keys'](db[_0x595a('0x2d')][_0x595a('0x46')]);_0x30a6b2[_0x595a('0x30')]=_[_0x595a('0x2f')](_0x2666ed[_0x595a('0x30')]);_0x30a6b2['filters']=_[_0x595a('0x32')](_0x30a6b2[_0x595a('0x2e')],_0x30a6b2[_0x595a('0x30')]);_0x55d221[_0x595a('0x33')]=_['intersection'](_0x30a6b2[_0x595a('0x2e')],qs['fields'](_0x2666ed[_0x595a('0x30')][_0x595a('0x34')]));_0x55d221[_0x595a('0x33')]=_0x55d221[_0x595a('0x33')][_0x595a('0x47')]?_0x55d221[_0x595a('0x33')]:_0x30a6b2[_0x595a('0x2e')];_0x55d221[_0x595a('0x57')]=qs[_0x595a('0x37')](_0x2666ed[_0x595a('0x30')][_0x595a('0x37')]);_0x55d221[_0x595a('0x38')]=qs[_0x595a('0x31')](_[_0x595a('0x39')](_0x2666ed[_0x595a('0x30')],_0x30a6b2[_0x595a('0x31')]));if(_0x2666ed[_0x595a('0x30')][_0x595a('0x3a')]){_0x55d221[_0x595a('0x38')]=_[_0x595a('0x3b')](_0x55d221[_0x595a('0x38')],{'$or':_[_0x595a('0x3c')](_0x55d221[_0x595a('0x33')],function(_0x8410e9){var _0x106711={};_0x106711[_0x8410e9]={'$like':'%'+_0x2666ed[_0x595a('0x30')][_0x595a('0x3a')]+'%'};return _0x106711;})});}_0x55d221=_[_0x595a('0x3b')]({},_0x55d221,_0x2666ed['options']);return _0x5817e8[_0x595a('0x55')](_0x55d221);}})[_0x595a('0x25')](function(_0x4037ad){if(_0x4037ad){_0x3fe53d=_0x4037ad[_0x595a('0x47')];if(!_0x2666ed[_0x595a('0x30')][_0x595a('0x35')](_0x595a('0x36'))){_0x55d221[_0x595a('0x1e')]=qs[_0x595a('0x1e')](_0x2666ed[_0x595a('0x30')][_0x595a('0x1e')]);_0x55d221[_0x595a('0x1d')]=qs[_0x595a('0x1d')](_0x2666ed[_0x595a('0x30')][_0x595a('0x1d')]);}return _0x5817e8[_0x595a('0x55')](_0x55d221);}})[_0x595a('0x25')](function(_0x4b2de){if(_0x4b2de){return _0x4b2de?{'count':_0x3fe53d,'rows':_0x4b2de}:null;}})[_0x595a('0x25')](respondWithResult(_0x2a273f,null))[_0x595a('0x43')](handleError(_0x2a273f,null));};exports['addIntervals']=function(_0x2ceab9,_0x3069be,_0x1b902a){return db[_0x595a('0x2d')][_0x595a('0x56')]({'where':{'id':_0x2ceab9[_0x595a('0x45')]['id']}})['then'](handleEntityNotFound(_0x3069be,null))[_0x595a('0x25')](function(_0x46b62d){if(_0x46b62d){return db[_0x595a('0x58')]['transaction'](function(_0x2e689c){return db[_0x595a('0x2d')][_0x595a('0x29')]({'where':{'IntervalId':_0x2ceab9[_0x595a('0x45')]['id']},'transaction':_0x2e689c})[_0x595a('0x25')](function(_0x149dd9){var _0x3ef961=_[_0x595a('0x3c')](_0x2ceab9[_0x595a('0x4c')],function(_0xe6b8c3){delete _0xe6b8c3['id'];_0xe6b8c3[_0x595a('0x59')]=_0x2ceab9['params']['id'];return _0xe6b8c3;});return db[_0x595a('0x2d')][_0x595a('0x5a')](_0x3ef961,{'transaction':_0x2e689c});});})[_0x595a('0x25')](function(){return db[_0x595a('0x2d')][_0x595a('0x41')]({'where':{'IntervalId':_0x2ceab9['params']['id']}});});}})[_0x595a('0x25')](respondWithResult(_0x3069be,null))[_0x595a('0x43')](handleError(_0x3069be,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index ea94bac..6bca92d 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 _0xf634=['exports','define','tools_intervals','rewrite','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite'];(function(_0x56cf67,_0xdafd2){var _0x3d5824=function(_0x340d7b){while(--_0x340d7b){_0x56cf67['push'](_0x56cf67['shift']());}};_0x3d5824(++_0xdafd2);}(_0xf634,0x1be));var _0x4f63=function(_0x517985,_0x5527ee){_0x517985=_0x517985-0x0;var _0x2d1f90=_0xf634[_0x517985];return _0x2d1f90;};'use strict';var _=require(_0x4f63('0x0'));var util=require('util');var logger=require(_0x4f63('0x1'))('api');var moment=require(_0x4f63('0x2'));var BPromise=require(_0x4f63('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f63('0x4'));var rimraf=require(_0x4f63('0x5'));var config=require(_0x4f63('0x6'));var attributes=require(_0x4f63('0x7'));var extensions=require(_0x4f63('0x8'));module[_0x4f63('0x9')]=function(_0x462b66,_0x5b1108){return _0x462b66[_0x4f63('0xa')]('Interval',attributes,{'tableName':_0x4f63('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x254342,_0x56f21f){extensions[_0x4f63('0xc')](_0x462b66,_0x254342);},'afterBulkCreate':function(_0x90b7a1,_0x3f684c,_0x1ae9d7){_0x1ae9d7();extensions[_0x4f63('0xc')](_0x462b66,_0x90b7a1[0x0]);},'afterUpdate':function(_0x14b098,_0x2d2ec2){extensions['rewrite'](_0x462b66,_0x14b098);},'afterDestroy':function(_0x38cf0f,_0x2618bb){extensions[_0x4f63('0xc')](_0x462b66,_0x38cf0f);}}});}; \ No newline at end of file +var _0x6021=['bluebird','request-promise','path','rimraf','./interval.attributes','../../components/extensions/rewrite','define','Interval','tools_intervals','rewrite','lodash','util','../../config/logger','api','moment'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x6021,0x1ea));var _0x1602=function(_0x575907,_0x7d13a3){_0x575907=_0x575907-0x0;var _0x48f102=_0x6021[_0x575907];return _0x48f102;};'use strict';var _=require(_0x1602('0x0'));var util=require(_0x1602('0x1'));var logger=require(_0x1602('0x2'))(_0x1602('0x3'));var moment=require(_0x1602('0x4'));var BPromise=require(_0x1602('0x5'));var rp=require(_0x1602('0x6'));var fs=require('fs');var path=require(_0x1602('0x7'));var rimraf=require(_0x1602('0x8'));var config=require('../../config/environment');var attributes=require(_0x1602('0x9'));var extensions=require(_0x1602('0xa'));module['exports']=function(_0x39bdff,_0x551ec0){return _0x39bdff[_0x1602('0xb')](_0x1602('0xc'),attributes,{'tableName':_0x1602('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3adf12,_0x277997){extensions[_0x1602('0xe')](_0x39bdff,_0x3adf12);},'afterBulkCreate':function(_0xe4a72f,_0x47ebdc,_0x2f27a4){_0x2f27a4();extensions[_0x1602('0xe')](_0x39bdff,_0xe4a72f[0x0]);},'afterUpdate':function(_0x551f51,_0x1100ea){extensions[_0x1602('0xe')](_0x39bdff,_0x551f51);},'afterDestroy':function(_0x57ffe1,_0x578f7e){extensions[_0x1602('0xe')](_0x39bdff,_0x57ffe1);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 1285da4..3a58861 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 _0xa41a=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetInterval','options','raw','where','attributes','limit','include','model','stringify','Interval','find','map','ShowInterval','lodash'];(function(_0x1f756b,_0x54dfbc){var _0x27883a=function(_0x2a4d63){while(--_0x2a4d63){_0x1f756b['push'](_0x1f756b['shift']());}};_0x27883a(++_0x54dfbc);}(_0xa41a,0x6b));var _0xaa41=function(_0x15e130,_0x23c206){_0x15e130=_0x15e130-0x0;var _0x386e77=_0xa41a[_0x15e130];return _0x386e77;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});}exports[_0xaa41('0x17')]=function(_0xd20ddf){var _0x29efe5=this;return new Promise(function(_0x46e6d3,_0x150ddf){return db['Interval']['findAll']({'raw':_0xd20ddf[_0xaa41('0x18')]?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x19')]===undefined?!![]:![]:!![],'where':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1a')]||null:null,'attributes':_0xd20ddf['options']?_0xd20ddf['options'][_0xaa41('0x1b')]||null:null,'limit':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')]||null:null,'include':_0xd20ddf[_0xaa41('0x18')]?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1d')]?_['map'](_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1d')],function(_0x448a21){return{'model':db[_0x448a21[_0xaa41('0x1e')]],'as':_0x448a21['as'],'attributes':_0x448a21[_0xaa41('0x1b')],'include':_0x448a21[_0xaa41('0x1d')]?_['map'](_0x448a21['include'],function(_0x16aec5){return{'model':db[_0x16aec5['model']],'as':_0x16aec5['as'],'attributes':_0x16aec5['attributes'],'include':_0x16aec5[_0xaa41('0x1d')]?_['map'](_0x16aec5['include'],function(_0x2d0ac0){return{'model':db[_0x2d0ac0[_0xaa41('0x1e')]],'as':_0x2d0ac0['as'],'attributes':_0x2d0ac0[_0xaa41('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xaa41('0xd')](function(_0x3f5272){logger[_0xaa41('0xe')]('GetInterval',_0xd20ddf);logger[_0xaa41('0x11')](_0xaa41('0x17'),_0xd20ddf,JSON[_0xaa41('0x1f')](_0x3f5272));_0x46e6d3(_0x3f5272);})[_0xaa41('0x16')](function(_0x1d8c2b){logger[_0xaa41('0x13')](_0xaa41('0x17'),_0x1d8c2b[_0xaa41('0x14')],_0xd20ddf);_0x150ddf(_0x29efe5['error'](0x1f4,_0x1d8c2b[_0xaa41('0x14')]));});});};exports['ShowInterval']=function(_0x5dad80){var _0x714537=this;return new Promise(function(_0x1176bd,_0x534a85){return db[_0xaa41('0x20')][_0xaa41('0x21')]({'raw':_0x5dad80['options']?_0x5dad80['options']['raw']===undefined?!![]:![]:!![],'where':_0x5dad80[_0xaa41('0x18')]?_0x5dad80[_0xaa41('0x18')][_0xaa41('0x1a')]||null:null,'attributes':_0x5dad80[_0xaa41('0x18')]?_0x5dad80['options'][_0xaa41('0x1b')]||null:null,'include':_0x5dad80[_0xaa41('0x18')]?_0x5dad80[_0xaa41('0x18')]['include']?_[_0xaa41('0x22')](_0x5dad80[_0xaa41('0x18')][_0xaa41('0x1d')],function(_0x57ab80){return{'model':db[_0x57ab80[_0xaa41('0x1e')]],'as':_0x57ab80['as'],'attributes':_0x57ab80[_0xaa41('0x1b')],'include':_0x57ab80['include']?_[_0xaa41('0x22')](_0x57ab80[_0xaa41('0x1d')],function(_0x2298ed){return{'model':db[_0x2298ed['model']],'as':_0x2298ed['as'],'attributes':_0x2298ed[_0xaa41('0x1b')],'include':_0x2298ed['include']?_[_0xaa41('0x22')](_0x2298ed[_0xaa41('0x1d')],function(_0xf13742){return{'model':db[_0xf13742['model']],'as':_0xf13742['as'],'attributes':_0xf13742['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2dc05a){logger[_0xaa41('0xe')](_0xaa41('0x23'),_0x5dad80);logger[_0xaa41('0x11')]('ShowInterval',_0x5dad80,JSON['stringify'](_0x2dc05a));_0x1176bd(_0x2dc05a);})[_0xaa41('0x16')](function(_0x5673c){logger[_0xaa41('0x13')](_0xaa41('0x23'),_0x5673c[_0xaa41('0x14')],_0x5dad80);_0x534a85(_0x714537[_0xaa41('0x13')](0x1f4,_0x5673c[_0xaa41('0x14')]));});});}; \ No newline at end of file +var _0x2123=['map','model','ShowInterval','Interval','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','Interval,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Interval,\x20%s,\x20%s','message','catch','GetInterval','findAll','options','raw','where','attributes','include'];(function(_0x1dbccd,_0x3077eb){var _0x4c9cc1=function(_0x5eb7e9){while(--_0x5eb7e9){_0x1dbccd['push'](_0x1dbccd['shift']());}};_0x4c9cc1(++_0x3077eb);}(_0x2123,0x190));var _0x3212=function(_0x3821aa,_0xbede61){_0x3821aa=_0x3821aa-0x0;var _0x460770=_0x2123[_0x3821aa];return _0x460770;};'use strict';var _=require(_0x3212('0x0'));var util=require(_0x3212('0x1'));var moment=require(_0x3212('0x2'));var BPromise=require(_0x3212('0x3'));var rs=require(_0x3212('0x4'));var fs=require('fs');var Redis=require(_0x3212('0x5'));var db=require(_0x3212('0x6'))['db'];var utils=require(_0x3212('0x7'));var logger=require(_0x3212('0x8'))(_0x3212('0x9'));var config=require(_0x3212('0xa'));var jayson=require(_0x3212('0xb'));var client=jayson['client'][_0x3212('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2b1302,_0x1fec5d,_0x4b35e9){return new BPromise(function(_0x3e17a3,_0x56c38f){return client[_0x3212('0xd')](_0x2b1302,_0x4b35e9)[_0x3212('0xe')](function(_0x8ca483){logger[_0x3212('0xf')]('Interval,\x20%s,\x20%s',_0x1fec5d,'request\x20sent');logger[_0x3212('0x10')](_0x3212('0x11'),_0x1fec5d,_0x3212('0x12'),JSON[_0x3212('0x13')](_0x8ca483));if(_0x8ca483[_0x3212('0x14')]){if(_0x8ca483[_0x3212('0x14')][_0x3212('0x15')]===0x1f4){logger[_0x3212('0x14')](_0x3212('0x16'),_0x1fec5d,_0x8ca483[_0x3212('0x14')][_0x3212('0x17')]);return _0x56c38f(_0x8ca483[_0x3212('0x14')][_0x3212('0x17')]);}logger[_0x3212('0x14')](_0x3212('0x16'),_0x1fec5d,_0x8ca483[_0x3212('0x14')][_0x3212('0x17')]);return _0x3e17a3(_0x8ca483[_0x3212('0x14')][_0x3212('0x17')]);}else{logger[_0x3212('0xf')](_0x3212('0x16'),_0x1fec5d,_0x3212('0x12'));_0x3e17a3(_0x8ca483['result'][_0x3212('0x17')]);}})[_0x3212('0x18')](function(_0x2720c6){logger[_0x3212('0x14')](_0x3212('0x16'),_0x1fec5d,_0x2720c6);_0x56c38f(_0x2720c6);});});}exports[_0x3212('0x19')]=function(_0x21954a){var _0x5b952f=this;return new Promise(function(_0x4c1158,_0x1cad7b){return db['Interval'][_0x3212('0x1a')]({'raw':_0x21954a[_0x3212('0x1b')]?_0x21954a[_0x3212('0x1b')][_0x3212('0x1c')]===undefined?!![]:![]:!![],'where':_0x21954a[_0x3212('0x1b')]?_0x21954a['options'][_0x3212('0x1d')]||null:null,'attributes':_0x21954a[_0x3212('0x1b')]?_0x21954a['options'][_0x3212('0x1e')]||null:null,'limit':_0x21954a[_0x3212('0x1b')]?_0x21954a[_0x3212('0x1b')]['limit']||null:null,'include':_0x21954a['options']?_0x21954a[_0x3212('0x1b')][_0x3212('0x1f')]?_[_0x3212('0x20')](_0x21954a[_0x3212('0x1b')][_0x3212('0x1f')],function(_0x436ecd){return{'model':db[_0x436ecd['model']],'as':_0x436ecd['as'],'attributes':_0x436ecd['attributes'],'include':_0x436ecd[_0x3212('0x1f')]?_['map'](_0x436ecd[_0x3212('0x1f')],function(_0x3108a6){return{'model':db[_0x3108a6[_0x3212('0x21')]],'as':_0x3108a6['as'],'attributes':_0x3108a6['attributes'],'include':_0x3108a6[_0x3212('0x1f')]?_[_0x3212('0x20')](_0x3108a6[_0x3212('0x1f')],function(_0x4de92e){return{'model':db[_0x4de92e[_0x3212('0x21')]],'as':_0x4de92e['as'],'attributes':_0x4de92e[_0x3212('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3212('0xe')](function(_0x443a5){logger[_0x3212('0xf')](_0x3212('0x19'),_0x21954a);logger[_0x3212('0x10')](_0x3212('0x19'),_0x21954a,JSON[_0x3212('0x13')](_0x443a5));_0x4c1158(_0x443a5);})[_0x3212('0x18')](function(_0x31c672){logger[_0x3212('0x14')]('GetInterval',_0x31c672[_0x3212('0x17')],_0x21954a);_0x1cad7b(_0x5b952f[_0x3212('0x14')](0x1f4,_0x31c672[_0x3212('0x17')]));});});};exports[_0x3212('0x22')]=function(_0x402a01){var _0x309420=this;return new Promise(function(_0x3a7883,_0x5059bd){return db[_0x3212('0x23')]['find']({'raw':_0x402a01[_0x3212('0x1b')]?_0x402a01['options'][_0x3212('0x1c')]===undefined?!![]:![]:!![],'where':_0x402a01['options']?_0x402a01['options'][_0x3212('0x1d')]||null:null,'attributes':_0x402a01['options']?_0x402a01[_0x3212('0x1b')][_0x3212('0x1e')]||null:null,'include':_0x402a01[_0x3212('0x1b')]?_0x402a01['options'][_0x3212('0x1f')]?_[_0x3212('0x20')](_0x402a01[_0x3212('0x1b')]['include'],function(_0x4ccbd1){return{'model':db[_0x4ccbd1[_0x3212('0x21')]],'as':_0x4ccbd1['as'],'attributes':_0x4ccbd1[_0x3212('0x1e')],'include':_0x4ccbd1[_0x3212('0x1f')]?_[_0x3212('0x20')](_0x4ccbd1['include'],function(_0x2b0437){return{'model':db[_0x2b0437[_0x3212('0x21')]],'as':_0x2b0437['as'],'attributes':_0x2b0437[_0x3212('0x1e')],'include':_0x2b0437['include']?_[_0x3212('0x20')](_0x2b0437[_0x3212('0x1f')],function(_0x40a602){return{'model':db[_0x40a602[_0x3212('0x21')]],'as':_0x40a602['as'],'attributes':_0x40a602['attributes']};}):[]};}):[]};}):[]:[]})[_0x3212('0xe')](function(_0x3f157c){logger[_0x3212('0xf')](_0x3212('0x22'),_0x402a01);logger['debug']('ShowInterval',_0x402a01,JSON['stringify'](_0x3f157c));_0x3a7883(_0x3f157c);})['catch'](function(_0xb2908a){logger[_0x3212('0x14')](_0x3212('0x22'),_0xb2908a[_0x3212('0x17')],_0x402a01);_0x5059bd(_0x309420['error'](0x1f4,_0xb2908a[_0x3212('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 2c103b2..2a886f7 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 _0x2032=['isAuthenticated','send','Router','../../components/auth/service','./jira.controller'];(function(_0x116996,_0x39943a){var _0x4e3b02=function(_0x5365e9){while(--_0x5365e9){_0x116996['push'](_0x116996['shift']());}};_0x4e3b02(++_0x39943a);}(_0x2032,0xd9));var _0x2203=function(_0xa595b0,_0x144af8){_0xa595b0=_0xa595b0-0x0;var _0x1e7514=_0x2032[_0xa595b0];return _0x1e7514;};'use strict';var express=require('express');var router=express[_0x2203('0x0')]();var auth=require(_0x2203('0x1'));var controller=require(_0x2203('0x2'));router['post']('/',auth[_0x2203('0x3')](),controller[_0x2203('0x4')]);module['exports']=router; \ No newline at end of file +var _0x0b0e=['exports','express','../../components/auth/service','post','isAuthenticated','send'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0x0b0e,0x187));var _0xe0b0=function(_0x459335,_0x2e95dd){_0x459335=_0x459335-0x0;var _0x50f00b=_0x0b0e[_0x459335];return _0x50f00b;};'use strict';var express=require(_0xe0b0('0x0'));var router=express['Router']();var auth=require(_0xe0b0('0x1'));var controller=require('./jira.controller');router[_0xe0b0('0x2')]('/',auth[_0xe0b0('0x3')](),controller[_0xe0b0('0x4')]);module[_0xe0b0('0x5')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index f57c070..5361e89 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 _0xa9e0=['Basic\x20','toString','base64','utf8','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','end','send','body','connection','remoteAddress','socket','bluebird','https','../../config/logger','3eAmWpBVP0','key','MOTGUI','summary','\x20from\x20','description','stringify','fields','customfield_11501','oldToken','customfield_11502','newToken','customfield_11504','reason','customfield_10102','track.xcallymotion.com','POST','application/json'];(function(_0x164367,_0x2f212e){var _0x3e3e7e=function(_0x42d233){while(--_0x42d233){_0x164367['push'](_0x164367['shift']());}};_0x3e3e7e(++_0x2f212e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'use strict';var BPromise=require(_0x0a9e('0x0'));var https=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var USERNAME='support';var PASSWORD=_0x0a9e('0x3');function openIssue(_0x4ce2f1,_0x333808){var _0x432180={'fields':{'project':{'key':_0x4ce2f1[_0x0a9e('0x4')]||_0x0a9e('0x5')},'summary':(_0x4ce2f1[_0x0a9e('0x6')]||'Report')+_0x0a9e('0x7')+_0x4ce2f1['ip'],'description':_0x4ce2f1[_0x0a9e('0x8')]||JSON[_0x0a9e('0x9')](_0x4ce2f1),'issuetype':{'name':_0x4ce2f1['issuetype']||'Bug'}}};_0x432180[_0x0a9e('0xa')]['customfield_11500']=_0x4ce2f1['email'];_0x432180[_0x0a9e('0xa')][_0x0a9e('0xb')]=_0x4ce2f1[_0x0a9e('0xc')];_0x432180[_0x0a9e('0xa')][_0x0a9e('0xd')]=_0x4ce2f1[_0x0a9e('0xe')];_0x432180['fields']['customfield_11503']=_0x4ce2f1['name'];_0x432180['fields'][_0x0a9e('0xf')]=_0x4ce2f1[_0x0a9e('0x10')];_0x432180[_0x0a9e('0xa')][_0x0a9e('0x11')]=_0x4ce2f1['ip'];var _0x32d742={'host':_0x0a9e('0x12'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x0a9e('0x13'),'timeout':0x4e20,'headers':{'Content-Type':_0x0a9e('0x14'),'Authorization':_0x0a9e('0x15')+new Buffer(USERNAME+':'+PASSWORD)[_0x0a9e('0x16')](_0x0a9e('0x17'))}};var _0x4d5611=JSON['stringify'](_0x432180);var _0x22dccb=https['request'](_0x32d742,function(_0x1985b6){_0x1985b6['setEncoding'](_0x0a9e('0x18'));var _0x12066b='';_0x1985b6['on']('data',function(_0x225616){_0x12066b+=_0x225616;});_0x1985b6['on']('end',function(){if(_0x333808){return _0x333808[_0x0a9e('0x19')](_0x1985b6[_0x0a9e('0x1a')])[_0x0a9e('0x1b')](JSON[_0x0a9e('0x1c')](_0x12066b));}});});_0x22dccb['on'](_0x0a9e('0x1d'),function(_0x2eb11f){if(_0x333808){return _0x333808[_0x0a9e('0x19')](0x1f4)[_0x0a9e('0x1b')]({'errors':[{'message':_0x0a9e('0x1e'),'type':_0x0a9e('0x1f')}]});}});_0x22dccb[_0x0a9e('0x20')](_0x4d5611);_0x22dccb[_0x0a9e('0x21')]();}exports['openIssue']=openIssue;exports[_0x0a9e('0x22')]=function(_0x155cce,_0x53682f){_0x155cce[_0x0a9e('0x23')]['ip']=_0x155cce['headers']['x-forwarded-for']||_0x155cce[_0x0a9e('0x24')][_0x0a9e('0x25')]||_0x155cce[_0x0a9e('0x26')][_0x0a9e('0x25')]||_0x155cce['connection'][_0x0a9e('0x26')][_0x0a9e('0x25')];return openIssue(_0x155cce[_0x0a9e('0x23')],_0x53682f);}; \ No newline at end of file +var _0xb7e7=['reason','track.xcallymotion.com','POST','toString','base64','setEncoding','utf8','data','end','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','../../config/logger','support','key','MOTGUI','\x20from\x20','description','stringify','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb7e7,0x121));var _0x7b7e=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xb7e7[_0x4c12ec];return _0x3ae42c;};'use strict';var BPromise=require(_0x7b7e('0x0'));var https=require('https');var logger=require(_0x7b7e('0x1'))('api');var USERNAME=_0x7b7e('0x2');var PASSWORD='3eAmWpBVP0';function openIssue(_0x3f5804,_0x556d68){var _0x31d0ed={'fields':{'project':{'key':_0x3f5804[_0x7b7e('0x3')]||_0x7b7e('0x4')},'summary':(_0x3f5804['summary']||'Report')+_0x7b7e('0x5')+_0x3f5804['ip'],'description':_0x3f5804[_0x7b7e('0x6')]||JSON[_0x7b7e('0x7')](_0x3f5804),'issuetype':{'name':_0x3f5804['issuetype']||_0x7b7e('0x8')}}};_0x31d0ed[_0x7b7e('0x9')][_0x7b7e('0xa')]=_0x3f5804[_0x7b7e('0xb')];_0x31d0ed[_0x7b7e('0x9')][_0x7b7e('0xc')]=_0x3f5804[_0x7b7e('0xd')];_0x31d0ed['fields'][_0x7b7e('0xe')]=_0x3f5804[_0x7b7e('0xf')];_0x31d0ed[_0x7b7e('0x9')][_0x7b7e('0x10')]=_0x3f5804[_0x7b7e('0x11')];_0x31d0ed[_0x7b7e('0x9')][_0x7b7e('0x12')]=_0x3f5804[_0x7b7e('0x13')];_0x31d0ed[_0x7b7e('0x9')]['customfield_10102']=_0x3f5804['ip'];var _0x267446={'host':_0x7b7e('0x14'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x7b7e('0x15'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x7b7e('0x16')](_0x7b7e('0x17'))}};var _0xf067da=JSON[_0x7b7e('0x7')](_0x31d0ed);var _0x3d2fb2=https['request'](_0x267446,function(_0x51baf6){_0x51baf6[_0x7b7e('0x18')](_0x7b7e('0x19'));var _0x27f999='';_0x51baf6['on'](_0x7b7e('0x1a'),function(_0x2cc400){_0x27f999+=_0x2cc400;});_0x51baf6['on'](_0x7b7e('0x1b'),function(){if(_0x556d68){return _0x556d68[_0x7b7e('0x1c')](_0x51baf6[_0x7b7e('0x1d')])[_0x7b7e('0x1e')](JSON[_0x7b7e('0x1f')](_0x27f999));}});});_0x3d2fb2['on'](_0x7b7e('0x20'),function(_0x14f4fe){if(_0x556d68){return _0x556d68[_0x7b7e('0x1c')](0x1f4)[_0x7b7e('0x1e')]({'errors':[{'message':_0x7b7e('0x21'),'type':_0x7b7e('0x22')}]});}});_0x3d2fb2[_0x7b7e('0x23')](_0xf067da);_0x3d2fb2['end']();}exports[_0x7b7e('0x24')]=openIssue;exports[_0x7b7e('0x25')]=function(_0x24718c,_0x4c0647){_0x24718c[_0x7b7e('0x26')]['ip']=_0x24718c[_0x7b7e('0x27')][_0x7b7e('0x28')]||_0x24718c[_0x7b7e('0x29')][_0x7b7e('0x2a')]||_0x24718c[_0x7b7e('0x2b')][_0x7b7e('0x2a')]||_0x24718c[_0x7b7e('0x29')]['socket']['remoteAddress'];return openIssue(_0x24718c['body'],_0x4c0647);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 9665280..62119ad 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 _0x5a4e=['post','create','update','delete','destroy','multer','util','path','express','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show'];(function(_0x4c4037,_0x15054b){var _0x357862=function(_0x480015){while(--_0x480015){_0x4c4037['push'](_0x4c4037['shift']());}};_0x357862(++_0x15054b);}(_0x5a4e,0xc3));var _0xe5a4=function(_0x53b55f,_0x7980d0){_0x53b55f=_0x53b55f-0x0;var _0x71d9fa=_0x5a4e[_0x53b55f];return _0x71d9fa;};'use strict';var multer=require(_0xe5a4('0x0'));var util=require(_0xe5a4('0x1'));var path=require(_0xe5a4('0x2'));var timeout=require('connect-timeout');var express=require(_0xe5a4('0x3'));var router=express['Router']();var auth=require(_0xe5a4('0x4'));var interaction=require(_0xe5a4('0x5'));var config=require('../../config/environment');var controller=require(_0xe5a4('0x6'));router['get']('/',auth[_0xe5a4('0x7')](),controller[_0xe5a4('0x8')]);router[_0xe5a4('0x9')](_0xe5a4('0xa'),auth['isAuthenticated'](),controller[_0xe5a4('0xb')]);router['get'](_0xe5a4('0xc'),auth['isAuthenticated'](),controller[_0xe5a4('0xd')]);router[_0xe5a4('0xe')]('/',auth[_0xe5a4('0x7')](),controller[_0xe5a4('0xf')]);router['put'](_0xe5a4('0xc'),auth['isAuthenticated'](),controller[_0xe5a4('0x10')]);router[_0xe5a4('0x11')]('/:id',auth[_0xe5a4('0x7')](),controller[_0xe5a4('0x12')]);module['exports']=router; \ No newline at end of file +var _0xa80d=['../../config/environment','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','update','delete','multer','path','../../components/auth/service'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0xa80d,0x12d));var _0xda80=function(_0x26711e,_0x1f440a){_0x26711e=_0x26711e-0x0;var _0x1bc952=_0xa80d[_0x26711e];return _0x1bc952;};'use strict';var multer=require(_0xda80('0x0'));var util=require('util');var path=require(_0xda80('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xda80('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xda80('0x3'));var controller=require(_0xda80('0x4'));router[_0xda80('0x5')]('/',auth['isAuthenticated'](),controller[_0xda80('0x6')]);router[_0xda80('0x5')](_0xda80('0x7'),auth[_0xda80('0x8')](),controller[_0xda80('0x9')]);router['get'](_0xda80('0xa'),auth[_0xda80('0x8')](),controller[_0xda80('0xb')]);router[_0xda80('0xc')]('/',auth[_0xda80('0x8')](),controller[_0xda80('0xd')]);router['put'](_0xda80('0xa'),auth[_0xda80('0x8')](),controller[_0xda80('0xe')]);router[_0xda80('0xf')](_0xda80('0xa'),auth[_0xda80('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 52713e2..1c7a0b9 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 _0xf2fa=['sequelize','TEXT','long','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf2fa,0xd0));var _0xaf2f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf2fa[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xaf2f('0x0'));module['exports']={'question':{'type':Sequelize['STRING']},'answer':{'type':Sequelize[_0xaf2f('0x1')](_0xaf2f('0x2'))},'membername':{'type':Sequelize[_0xaf2f('0x3')]},'projectname':{'type':Sequelize[_0xaf2f('0x3')]},'queue':{'type':Sequelize[_0xaf2f('0x3')]},'uniqueid':{'type':Sequelize[_0xaf2f('0x3')]},'calleridname':{'type':Sequelize[_0xaf2f('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x85b5=['exports','TEXT','STRING','sequelize'];(function(_0xd39959,_0x302d09){var _0x1ff69c=function(_0x17c97f){while(--_0x17c97f){_0xd39959['push'](_0xd39959['shift']());}};_0x1ff69c(++_0x302d09);}(_0x85b5,0x7f));var _0x585b=function(_0x21ad48,_0x13f020){_0x21ad48=_0x21ad48-0x0;var _0x18a376=_0x85b5[_0x21ad48];return _0x18a376;};'use strict';var Sequelize=require(_0x585b('0x0'));module[_0x585b('0x1')]={'question':{'type':Sequelize['STRING']},'answer':{'type':Sequelize[_0x585b('0x2')]('long')},'membername':{'type':Sequelize[_0x585b('0x3')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x585b('0x3')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x585b('0x3')]},'questionId':{'type':Sequelize[_0x585b('0x3')]}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index 20df951..58a3e5d 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 _0x8ccb=['then','destroy','error','stack','name','send','index','JscriptyAnswerReport','model','query','keys','filters','attributes','hasOwnProperty','nolimit','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','count','includeAll','show','intersection','fields','length','options','find','catch','create','body','params','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','set','Content-Range','json','reject','save'];(function(_0x36b756,_0x6e84eb){var _0x5233e0=function(_0x3a4f0b){while(--_0x3a4f0b){_0x36b756['push'](_0x36b756['shift']());}};_0x5233e0(++_0x6e84eb);}(_0x8ccb,0x1c4));var _0xb8cc=function(_0x65c50e,_0x1aa926){_0x65c50e=_0x65c50e-0x0;var _0x4573e7=_0x8ccb[_0x65c50e];return _0x4573e7;};'use strict';var pdf=require(_0xb8cc('0x0'));var emlformat=require(_0xb8cc('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb8cc('0x2'));var jsonpatch=require(_0xb8cc('0x3'));var rp=require(_0xb8cc('0x4'));var moment=require(_0xb8cc('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb8cc('0x6'));var path=require(_0xb8cc('0x7'));var sox=require(_0xb8cc('0x8'));var csv=require('to-csv');var ejs=require(_0xb8cc('0x9'));var fs=require('fs');var _=require(_0xb8cc('0xa'));var squel=require(_0xb8cc('0xb'));var crypto=require('crypto');var jsforce=require(_0xb8cc('0xc'));var deskjs=require(_0xb8cc('0xd'));var toCsv=require(_0xb8cc('0xe'));var querystring=require('querystring');var Papa=require(_0xb8cc('0xf'));var Redis=require(_0xb8cc('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xb8cc('0x11'));var logger=require(_0xb8cc('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xb8cc('0x13'));var db=require(_0xb8cc('0x14'))['db'];function respondWithStatusCode(_0x5b8198,_0x2586aa){_0x2586aa=_0x2586aa||0xcc;return function(_0x2c1cbc){if(_0x2c1cbc){return _0x5b8198[_0xb8cc('0x15')](_0x2586aa);}return _0x5b8198[_0xb8cc('0x16')](_0x2586aa)[_0xb8cc('0x17')]();};}function respondWithResult(_0x1db3b8,_0x44b49f){_0x44b49f=_0x44b49f||0xc8;return function(_0x4983ae){if(_0x4983ae){return _0x1db3b8[_0xb8cc('0x16')](_0x44b49f)['json'](_0x4983ae);}};}function respondWithFilteredResult(_0x2f876e,_0x426de4){return function(_0x183056){if(_0x183056){var _0x5f3b91=_0x183056['count'],_0x1f8b8d=_0x426de4[_0xb8cc('0x18')],_0x274cab=_0x426de4['offset']+_0x426de4[_0xb8cc('0x19')],_0x4663d4;if(_0x274cab>=_0x5f3b91){_0x274cab=_0x5f3b91;_0x4663d4=0xc8;}else{_0x4663d4=0xce;}_0x2f876e['status'](_0x4663d4);return _0x2f876e[_0xb8cc('0x1a')](_0xb8cc('0x1b'),_0x1f8b8d+'-'+_0x274cab+'/'+_0x5f3b91)[_0xb8cc('0x1c')](_0x183056);}return null;};}function patchUpdates(_0x3e1ba7){return function(_0xf59627){try{jsonpatch['apply'](_0xf59627,_0x3e1ba7,!![]);}catch(_0x1c1022){return BPromise[_0xb8cc('0x1d')](_0x1c1022);}return _0xf59627[_0xb8cc('0x1e')]();};}function saveUpdates(_0x500120,_0x8102db){return function(_0x1a81b4){if(_0x1a81b4){return _0x1a81b4['update'](_0x500120)[_0xb8cc('0x1f')](function(_0xe5ad50){return _0xe5ad50;});}return null;};}function removeEntity(_0x4c34b8,_0x75eb78){return function(_0xdcb33d){if(_0xdcb33d){return _0xdcb33d[_0xb8cc('0x20')]()[_0xb8cc('0x1f')](function(){_0x4c34b8[_0xb8cc('0x16')](0xcc)[_0xb8cc('0x17')]();});}};}function handleEntityNotFound(_0x1a0467,_0x59608c){return function(_0x50aa38){if(!_0x50aa38){_0x1a0467[_0xb8cc('0x15')](0x194);}return _0x50aa38;};}function handleError(_0x5a8fbf,_0x9a6b98){_0x9a6b98=_0x9a6b98||0x1f4;return function(_0x5175f1){logger[_0xb8cc('0x21')](_0x5175f1[_0xb8cc('0x22')]);if(_0x5175f1[_0xb8cc('0x23')]){delete _0x5175f1[_0xb8cc('0x23')];}_0x5a8fbf['status'](_0x9a6b98)[_0xb8cc('0x24')](_0x5175f1);};}exports[_0xb8cc('0x25')]=function(_0x400de6,_0x13acba){var _0x22b99a={},_0x491a03={},_0x50ed6f={'count':0x0,'rows':[]};var _0x377bfb=db[_0xb8cc('0x26')]['rawAttributes'];_0x491a03[_0xb8cc('0x27')]=_['keys'](_0x377bfb);_0x491a03[_0xb8cc('0x28')]=_[_0xb8cc('0x29')](_0x400de6[_0xb8cc('0x28')]);_0x491a03[_0xb8cc('0x2a')]=_['intersection'](_0x491a03[_0xb8cc('0x27')],_0x491a03[_0xb8cc('0x28')]);_0x22b99a[_0xb8cc('0x2b')]=_['intersection'](_0x491a03[_0xb8cc('0x27')],qs['fields'](_0x400de6[_0xb8cc('0x28')]['fields']));_0x22b99a[_0xb8cc('0x2b')]=_0x22b99a[_0xb8cc('0x2b')]['length']?_0x22b99a[_0xb8cc('0x2b')]:_0x491a03[_0xb8cc('0x27')];if(!_0x400de6[_0xb8cc('0x28')][_0xb8cc('0x2c')](_0xb8cc('0x2d'))){_0x22b99a[_0xb8cc('0x19')]=qs[_0xb8cc('0x19')](_0x400de6['query']['limit']);_0x22b99a[_0xb8cc('0x18')]=qs['offset'](_0x400de6[_0xb8cc('0x28')]['offset']);}_0x22b99a['order']=qs[_0xb8cc('0x2e')](_0x400de6[_0xb8cc('0x28')][_0xb8cc('0x2e')]);_0x22b99a['where']=qs[_0xb8cc('0x2a')](_[_0xb8cc('0x2f')](_0x400de6[_0xb8cc('0x28')],_0x491a03[_0xb8cc('0x2a')]));if(_0x400de6[_0xb8cc('0x28')][_0xb8cc('0x30')]){_0x22b99a[_0xb8cc('0x31')]=_[_0xb8cc('0x32')](_0x22b99a[_0xb8cc('0x31')],{'$or':_[_0xb8cc('0x33')](_0x377bfb,function(_0x265ef8){if(_0x265ef8[_0xb8cc('0x34')][_0xb8cc('0x35')]!==_0xb8cc('0x36')){var _0x31640c={};_0x31640c[_0x265ef8[_0xb8cc('0x37')]]={'$like':'%'+_0x400de6[_0xb8cc('0x28')][_0xb8cc('0x30')]+'%'};return _0x31640c;}})});}_0x22b99a=_['merge']({},_0x22b99a,_0x400de6['options']);var _0xab812b={'where':_0x22b99a[_0xb8cc('0x31')]};return db[_0xb8cc('0x26')][_0xb8cc('0x38')](_0xab812b)[_0xb8cc('0x1f')](function(_0x46e0d2){_0x50ed6f[_0xb8cc('0x38')]=_0x46e0d2;if(_0x400de6[_0xb8cc('0x28')][_0xb8cc('0x39')]){_0x22b99a['include']=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0x22b99a);})['then'](function(_0xf7a2c){_0x50ed6f['rows']=_0xf7a2c;return _0x50ed6f;})[_0xb8cc('0x1f')](respondWithFilteredResult(_0x13acba,_0x22b99a))['catch'](handleError(_0x13acba,null));};exports[_0xb8cc('0x3a')]=function(_0x23ece3,_0x88ca47){var _0x22ee50={'raw':!![],'where':{'id':_0x23ece3['params']['id']}},_0x1d4a83={};_0x1d4a83[_0xb8cc('0x27')]=_[_0xb8cc('0x29')](db[_0xb8cc('0x26')]['rawAttributes']);_0x1d4a83[_0xb8cc('0x28')]=_['keys'](_0x23ece3['query']);_0x1d4a83['filters']=_[_0xb8cc('0x3b')](_0x1d4a83[_0xb8cc('0x27')],_0x1d4a83[_0xb8cc('0x28')]);_0x22ee50[_0xb8cc('0x2b')]=_['intersection'](_0x1d4a83['model'],qs[_0xb8cc('0x3c')](_0x23ece3['query']['fields']));_0x22ee50[_0xb8cc('0x2b')]=_0x22ee50[_0xb8cc('0x2b')][_0xb8cc('0x3d')]?_0x22ee50[_0xb8cc('0x2b')]:_0x1d4a83['model'];if(_0x23ece3[_0xb8cc('0x28')][_0xb8cc('0x39')]){_0x22ee50['include']=[{'all':!![]}];}_0x22ee50=_[_0xb8cc('0x32')]({},_0x22ee50,_0x23ece3[_0xb8cc('0x3e')]);return db[_0xb8cc('0x26')][_0xb8cc('0x3f')](_0x22ee50)[_0xb8cc('0x1f')](handleEntityNotFound(_0x88ca47,null))[_0xb8cc('0x1f')](respondWithResult(_0x88ca47,null))[_0xb8cc('0x40')](handleError(_0x88ca47,null));};exports['create']=function(_0x469aa3,_0x375573){return db[_0xb8cc('0x26')][_0xb8cc('0x41')](_0x469aa3[_0xb8cc('0x42')],{})[_0xb8cc('0x1f')](respondWithResult(_0x375573,0xc9))[_0xb8cc('0x40')](handleError(_0x375573,null));};exports['update']=function(_0x18d460,_0x4d0441){if(_0x18d460['body']['id']){delete _0x18d460['body']['id'];}return db[_0xb8cc('0x26')][_0xb8cc('0x3f')]({'where':{'id':_0x18d460[_0xb8cc('0x43')]['id']}})[_0xb8cc('0x1f')](handleEntityNotFound(_0x4d0441,null))['then'](saveUpdates(_0x18d460['body'],null))[_0xb8cc('0x1f')](respondWithResult(_0x4d0441,null))[_0xb8cc('0x40')](handleError(_0x4d0441,null));};exports[_0xb8cc('0x20')]=function(_0x3e5e32,_0x3216a4){return db[_0xb8cc('0x26')][_0xb8cc('0x3f')]({'where':{'id':_0x3e5e32[_0xb8cc('0x43')]['id']}})[_0xb8cc('0x1f')](handleEntityNotFound(_0x3216a4,null))[_0xb8cc('0x1f')](removeEntity(_0x3216a4,null))['catch'](handleError(_0x3216a4,null));};exports[_0xb8cc('0x44')]=function(_0x38a6ea,_0x3b1e24){return db[_0xb8cc('0x26')]['describe']()[_0xb8cc('0x1f')](respondWithResult(_0x3b1e24,null))[_0xb8cc('0x40')](handleError(_0x3b1e24,null));}; \ No newline at end of file +var _0xbb6e=['describe','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','apply','reject','update','destroy','error','stack','name','index','JscriptyAnswerReport','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','type','key','VIRTUAL','field','merge','options','count','then','rows','catch','show','params','rawAttributes','includeAll','find','create','body'];(function(_0x144114,_0x26622e){var _0x2b6edf=function(_0x414eae){while(--_0x414eae){_0x144114['push'](_0x144114['shift']());}};_0x2b6edf(++_0x26622e);}(_0xbb6e,0x115));var _0xebb6=function(_0x17b578,_0x4a83a3){_0x17b578=_0x17b578-0x0;var _0x8f2573=_0xbb6e[_0x17b578];return _0x8f2573;};'use strict';var pdf=require(_0xebb6('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xebb6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xebb6('0x2'));var rp=require(_0xebb6('0x3'));var moment=require(_0xebb6('0x4'));var BPromise=require(_0xebb6('0x5'));var Mustache=require(_0xebb6('0x6'));var util=require(_0xebb6('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xebb6('0x8'));var fs=require('fs');var _=require(_0xebb6('0x9'));var squel=require(_0xebb6('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xebb6('0xb'));var toCsv=require('to-csv');var querystring=require(_0xebb6('0xc'));var Papa=require(_0xebb6('0xd'));var Redis=require(_0xebb6('0xe'));var authService=require(_0xebb6('0xf'));var qs=require(_0xebb6('0x10'));var hardwareService=require(_0xebb6('0x11'));var logger=require(_0xebb6('0x12'))(_0xebb6('0x13'));var utils=require(_0xebb6('0x14'));var config=require(_0xebb6('0x15'));var db=require(_0xebb6('0x16'))['db'];function respondWithStatusCode(_0x265d14,_0x55da44){_0x55da44=_0x55da44||0xcc;return function(_0x4237cb){if(_0x4237cb){return _0x265d14[_0xebb6('0x17')](_0x55da44);}return _0x265d14[_0xebb6('0x18')](_0x55da44)[_0xebb6('0x19')]();};}function respondWithResult(_0x5d7ec3,_0x1b5fa1){_0x1b5fa1=_0x1b5fa1||0xc8;return function(_0x14077d){if(_0x14077d){return _0x5d7ec3[_0xebb6('0x18')](_0x1b5fa1)[_0xebb6('0x1a')](_0x14077d);}};}function respondWithFilteredResult(_0x560863,_0x2d9cae){return function(_0x104aa8){if(_0x104aa8){var _0x556a02=_0x104aa8['count'],_0x11c62b=_0x2d9cae['offset'],_0x4e7452=_0x2d9cae[_0xebb6('0x1b')]+_0x2d9cae[_0xebb6('0x1c')],_0x35ec3a;if(_0x4e7452>=_0x556a02){_0x4e7452=_0x556a02;_0x35ec3a=0xc8;}else{_0x35ec3a=0xce;}_0x560863['status'](_0x35ec3a);return _0x560863[_0xebb6('0x1d')]('Content-Range',_0x11c62b+'-'+_0x4e7452+'/'+_0x556a02)[_0xebb6('0x1a')](_0x104aa8);}return null;};}function patchUpdates(_0x2b57b4){return function(_0x4cffe0){try{jsonpatch[_0xebb6('0x1e')](_0x4cffe0,_0x2b57b4,!![]);}catch(_0x2faaa8){return BPromise[_0xebb6('0x1f')](_0x2faaa8);}return _0x4cffe0['save']();};}function saveUpdates(_0xc0863b,_0x4a95f7){return function(_0x1ee2be){if(_0x1ee2be){return _0x1ee2be[_0xebb6('0x20')](_0xc0863b)['then'](function(_0x3f7eec){return _0x3f7eec;});}return null;};}function removeEntity(_0x39caf4,_0x261f93){return function(_0x3085dd){if(_0x3085dd){return _0x3085dd[_0xebb6('0x21')]()['then'](function(){_0x39caf4[_0xebb6('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e2eae,_0x32d192){return function(_0x427c5d){if(!_0x427c5d){_0x1e2eae[_0xebb6('0x17')](0x194);}return _0x427c5d;};}function handleError(_0x23de4e,_0x249644){_0x249644=_0x249644||0x1f4;return function(_0x33e97f){logger[_0xebb6('0x22')](_0x33e97f[_0xebb6('0x23')]);if(_0x33e97f[_0xebb6('0x24')]){delete _0x33e97f[_0xebb6('0x24')];}_0x23de4e['status'](_0x249644)['send'](_0x33e97f);};}exports[_0xebb6('0x25')]=function(_0x1c7a0e,_0x9128cf){var _0x4fc099={},_0xa8d55={},_0x4d40d1={'count':0x0,'rows':[]};var _0x1ed86f=db[_0xebb6('0x26')]['rawAttributes'];_0xa8d55[_0xebb6('0x27')]=_[_0xebb6('0x28')](_0x1ed86f);_0xa8d55[_0xebb6('0x29')]=_[_0xebb6('0x28')](_0x1c7a0e[_0xebb6('0x29')]);_0xa8d55[_0xebb6('0x2a')]=_[_0xebb6('0x2b')](_0xa8d55[_0xebb6('0x27')],_0xa8d55[_0xebb6('0x29')]);_0x4fc099[_0xebb6('0x2c')]=_[_0xebb6('0x2b')](_0xa8d55[_0xebb6('0x27')],qs['fields'](_0x1c7a0e[_0xebb6('0x29')][_0xebb6('0x2d')]));_0x4fc099['attributes']=_0x4fc099['attributes'][_0xebb6('0x2e')]?_0x4fc099[_0xebb6('0x2c')]:_0xa8d55[_0xebb6('0x27')];if(!_0x1c7a0e[_0xebb6('0x29')][_0xebb6('0x2f')]('nolimit')){_0x4fc099['limit']=qs[_0xebb6('0x1c')](_0x1c7a0e[_0xebb6('0x29')][_0xebb6('0x1c')]);_0x4fc099[_0xebb6('0x1b')]=qs[_0xebb6('0x1b')](_0x1c7a0e[_0xebb6('0x29')][_0xebb6('0x1b')]);}_0x4fc099['order']=qs[_0xebb6('0x30')](_0x1c7a0e['query'][_0xebb6('0x30')]);_0x4fc099[_0xebb6('0x31')]=qs['filters'](_['pick'](_0x1c7a0e[_0xebb6('0x29')],_0xa8d55[_0xebb6('0x2a')]));if(_0x1c7a0e[_0xebb6('0x29')][_0xebb6('0x32')]){_0x4fc099[_0xebb6('0x31')]=_['merge'](_0x4fc099[_0xebb6('0x31')],{'$or':_['map'](_0x1ed86f,function(_0x5d4230){if(_0x5d4230[_0xebb6('0x33')][_0xebb6('0x34')]!==_0xebb6('0x35')){var _0x37d402={};_0x37d402[_0x5d4230[_0xebb6('0x36')]]={'$like':'%'+_0x1c7a0e[_0xebb6('0x29')][_0xebb6('0x32')]+'%'};return _0x37d402;}})});}_0x4fc099=_[_0xebb6('0x37')]({},_0x4fc099,_0x1c7a0e[_0xebb6('0x38')]);var _0x58085e={'where':_0x4fc099['where']};return db['JscriptyAnswerReport'][_0xebb6('0x39')](_0x58085e)[_0xebb6('0x3a')](function(_0xfba0e8){_0x4d40d1[_0xebb6('0x39')]=_0xfba0e8;if(_0x1c7a0e[_0xebb6('0x29')]['includeAll']){_0x4fc099['include']=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0x4fc099);})[_0xebb6('0x3a')](function(_0xc4e894){_0x4d40d1[_0xebb6('0x3b')]=_0xc4e894;return _0x4d40d1;})['then'](respondWithFilteredResult(_0x9128cf,_0x4fc099))[_0xebb6('0x3c')](handleError(_0x9128cf,null));};exports[_0xebb6('0x3d')]=function(_0xb46f45,_0x1f1115){var _0x838d11={'raw':!![],'where':{'id':_0xb46f45[_0xebb6('0x3e')]['id']}},_0x985b93={};_0x985b93[_0xebb6('0x27')]=_['keys'](db[_0xebb6('0x26')][_0xebb6('0x3f')]);_0x985b93[_0xebb6('0x29')]=_['keys'](_0xb46f45[_0xebb6('0x29')]);_0x985b93[_0xebb6('0x2a')]=_[_0xebb6('0x2b')](_0x985b93[_0xebb6('0x27')],_0x985b93[_0xebb6('0x29')]);_0x838d11['attributes']=_[_0xebb6('0x2b')](_0x985b93[_0xebb6('0x27')],qs['fields'](_0xb46f45[_0xebb6('0x29')][_0xebb6('0x2d')]));_0x838d11[_0xebb6('0x2c')]=_0x838d11['attributes'][_0xebb6('0x2e')]?_0x838d11[_0xebb6('0x2c')]:_0x985b93['model'];if(_0xb46f45[_0xebb6('0x29')][_0xebb6('0x40')]){_0x838d11['include']=[{'all':!![]}];}_0x838d11=_['merge']({},_0x838d11,_0xb46f45[_0xebb6('0x38')]);return db[_0xebb6('0x26')][_0xebb6('0x41')](_0x838d11)['then'](handleEntityNotFound(_0x1f1115,null))[_0xebb6('0x3a')](respondWithResult(_0x1f1115,null))[_0xebb6('0x3c')](handleError(_0x1f1115,null));};exports[_0xebb6('0x42')]=function(_0x2e4c58,_0x58c6a4){return db[_0xebb6('0x26')][_0xebb6('0x42')](_0x2e4c58[_0xebb6('0x43')],{})[_0xebb6('0x3a')](respondWithResult(_0x58c6a4,0xc9))['catch'](handleError(_0x58c6a4,null));};exports['update']=function(_0x8fd9dc,_0x23528f){if(_0x8fd9dc[_0xebb6('0x43')]['id']){delete _0x8fd9dc[_0xebb6('0x43')]['id'];}return db['JscriptyAnswerReport'][_0xebb6('0x41')]({'where':{'id':_0x8fd9dc['params']['id']}})[_0xebb6('0x3a')](handleEntityNotFound(_0x23528f,null))[_0xebb6('0x3a')](saveUpdates(_0x8fd9dc[_0xebb6('0x43')],null))[_0xebb6('0x3a')](respondWithResult(_0x23528f,null))[_0xebb6('0x3c')](handleError(_0x23528f,null));};exports['destroy']=function(_0x118ae8,_0x2b3f5f){return db['JscriptyAnswerReport'][_0xebb6('0x41')]({'where':{'id':_0x118ae8[_0xebb6('0x3e')]['id']}})[_0xebb6('0x3a')](handleEntityNotFound(_0x2b3f5f,null))[_0xebb6('0x3a')](removeEntity(_0x2b3f5f,null))[_0xebb6('0x3c')](handleError(_0x2b3f5f,null));};exports['describe']=function(_0x1b88b7,_0x127ef3){return db[_0xebb6('0x26')][_0xebb6('0x44')]()[_0xebb6('0x3a')](respondWithResult(_0x127ef3,null))[_0xebb6('0x3c')](handleError(_0x127ef3,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 5d05d75..98d5c9b 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 _0x3c76=['JscriptyAnswerReport','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x4ab9ef,_0x35fed2){var _0xc71a1c=function(_0x1bc941){while(--_0x1bc941){_0x4ab9ef['push'](_0x4ab9ef['shift']());}};_0xc71a1c(++_0x35fed2);}(_0x3c76,0xa1));var _0x63c7=function(_0x3d9d3c,_0x2e908b){_0x3d9d3c=_0x3d9d3c-0x0;var _0x48ebe0=_0x3c76[_0x3d9d3c];return _0x48ebe0;};'use strict';var _=require('lodash');var util=require(_0x63c7('0x0'));var logger=require(_0x63c7('0x1'))(_0x63c7('0x2'));var moment=require('moment');var BPromise=require(_0x63c7('0x3'));var rp=require(_0x63c7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x63c7('0x5'));var config=require(_0x63c7('0x6'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0x63c7('0x7')]=function(_0x25d47b,_0x1e4b78){return _0x25d47b[_0x63c7('0x8')](_0x63c7('0x9'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7742=['exports','define','JscriptyAnswerReport','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./jscriptyAnswerReport.attributes'];(function(_0xfbdf1a,_0x35c108){var _0x2bad24=function(_0x404e93){while(--_0x404e93){_0xfbdf1a['push'](_0xfbdf1a['shift']());}};_0x2bad24(++_0x35c108);}(_0x7742,0x1d7));var _0x2774=function(_0x50346e,_0x2b747c){_0x50346e=_0x50346e-0x0;var _0xdf84a2=_0x7742[_0x50346e];return _0xdf84a2;};'use strict';var _=require(_0x2774('0x0'));var util=require(_0x2774('0x1'));var logger=require('../../config/logger')(_0x2774('0x2'));var moment=require(_0x2774('0x3'));var BPromise=require(_0x2774('0x4'));var rp=require(_0x2774('0x5'));var fs=require('fs');var path=require(_0x2774('0x6'));var rimraf=require('rimraf');var config=require(_0x2774('0x7'));var attributes=require(_0x2774('0x8'));module[_0x2774('0x9')]=function(_0x371742,_0x5e756f){return _0x371742[_0x2774('0xa')](_0x2774('0xb'),attributes,{'tableName':'report_jscripty_answers','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 27abfd1..ea7c078 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 _0x6038=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x20eb01,_0x2d874a){var _0x4f240c=function(_0x3cf14e){while(--_0x3cf14e){_0x20eb01['push'](_0x20eb01['shift']());}};_0x4f240c(++_0x2d874a);}(_0x6038,0x1f4));var _0x8603=function(_0x43d0b8,_0x2fe5bf){_0x43d0b8=_0x43d0b8-0x0;var _0x5aa185=_0x6038[_0x43d0b8];return _0x5aa185;};'use strict';var _=require(_0x8603('0x0'));var util=require(_0x8603('0x1'));var moment=require(_0x8603('0x2'));var BPromise=require(_0x8603('0x3'));var rs=require(_0x8603('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8603('0x5'))['db'];var utils=require(_0x8603('0x6'));var logger=require(_0x8603('0x7'))(_0x8603('0x8'));var config=require(_0x8603('0x9'));var jayson=require(_0x8603('0xa'));var client=jayson[_0x8603('0xb')][_0x8603('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3d58cc,_0x1c1907,_0x2fe54b){return new BPromise(function(_0x2a882c,_0x2d55ee){return client[_0x8603('0xd')](_0x3d58cc,_0x2fe54b)[_0x8603('0xe')](function(_0x468ede){logger[_0x8603('0xf')](_0x8603('0x10'),_0x1c1907,_0x8603('0x11'));logger[_0x8603('0x12')](_0x8603('0x13'),_0x1c1907,_0x8603('0x11'),JSON[_0x8603('0x14')](_0x468ede));if(_0x468ede[_0x8603('0x15')]){if(_0x468ede[_0x8603('0x15')][_0x8603('0x16')]===0x1f4){logger['error'](_0x8603('0x10'),_0x1c1907,_0x468ede[_0x8603('0x15')]['message']);return _0x2d55ee(_0x468ede['error'][_0x8603('0x17')]);}logger[_0x8603('0x15')](_0x8603('0x10'),_0x1c1907,_0x468ede['error'][_0x8603('0x17')]);return _0x2a882c(_0x468ede[_0x8603('0x15')][_0x8603('0x17')]);}else{logger[_0x8603('0xf')](_0x8603('0x10'),_0x1c1907,_0x8603('0x11'));_0x2a882c(_0x468ede[_0x8603('0x18')][_0x8603('0x17')]);}})['catch'](function(_0x2f4609){logger[_0x8603('0x15')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x1c1907,_0x2f4609);_0x2d55ee(_0x2f4609);});});} \ No newline at end of file +var _0xa3bd=['JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','debug'];(function(_0x1a2cbc,_0x13e2ca){var _0x1ed741=function(_0x2cc1f4){while(--_0x2cc1f4){_0x1a2cbc['push'](_0x1a2cbc['shift']());}};_0x1ed741(++_0x13e2ca);}(_0xa3bd,0x1d3));var _0xda3b=function(_0xfc297a,_0x531833){_0xfc297a=_0xfc297a-0x0;var _0x16458b=_0xa3bd[_0xfc297a];return _0x16458b;};'use strict';var _=require('lodash');var util=require(_0xda3b('0x0'));var moment=require(_0xda3b('0x1'));var BPromise=require(_0xda3b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xda3b('0x3'));var db=require(_0xda3b('0x4'))['db'];var utils=require(_0xda3b('0x5'));var logger=require(_0xda3b('0x6'))(_0xda3b('0x7'));var config=require('../../config/environment');var jayson=require(_0xda3b('0x8'));var client=jayson[_0xda3b('0x9')][_0xda3b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x434c7e,_0x24a887,_0x3e12dc){return new BPromise(function(_0x46fbad,_0x21b514){return client[_0xda3b('0xb')](_0x434c7e,_0x3e12dc)[_0xda3b('0xc')](function(_0x2ed893){logger[_0xda3b('0xd')](_0xda3b('0xe'),_0x24a887,'request\x20sent');logger[_0xda3b('0xf')](_0xda3b('0x10'),_0x24a887,_0xda3b('0x11'),JSON['stringify'](_0x2ed893));if(_0x2ed893[_0xda3b('0x12')]){if(_0x2ed893[_0xda3b('0x12')][_0xda3b('0x13')]===0x1f4){logger[_0xda3b('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x24a887,_0x2ed893[_0xda3b('0x12')][_0xda3b('0x14')]);return _0x21b514(_0x2ed893[_0xda3b('0x12')][_0xda3b('0x14')]);}logger[_0xda3b('0x12')](_0xda3b('0xe'),_0x24a887,_0x2ed893[_0xda3b('0x12')][_0xda3b('0x14')]);return _0x46fbad(_0x2ed893[_0xda3b('0x12')][_0xda3b('0x14')]);}else{logger['info'](_0xda3b('0xe'),_0x24a887,_0xda3b('0x11'));_0x46fbad(_0x2ed893[_0xda3b('0x15')][_0xda3b('0x14')]);}})[_0xda3b('0x16')](function(_0x5e2f97){logger[_0xda3b('0x12')](_0xda3b('0xe'),_0x24a887,_0x5e2f97);_0x21b514(_0x5e2f97);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 7170bc4..7315fc8 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 _0x4c79=['express','Router','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','getSummary','create','post','/:id/clone','clone','put','update','delete','util','path','connect-timeout'];(function(_0x2b9c0c,_0x4678a3){var _0xd8577b=function(_0x2dd9eb){while(--_0x2dd9eb){_0x2b9c0c['push'](_0x2b9c0c['shift']());}};_0xd8577b(++_0x4678a3);}(_0x4c79,0xac));var _0x94c7=function(_0x1b3e97,_0x43e6f2){_0x1b3e97=_0x1b3e97-0x0;var _0x144402=_0x4c79[_0x1b3e97];return _0x144402;};'use strict';var multer=require('multer');var util=require(_0x94c7('0x0'));var path=require(_0x94c7('0x1'));var timeout=require(_0x94c7('0x2'));var express=require(_0x94c7('0x3'));var router=express[_0x94c7('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x94c7('0x5'));var config=require(_0x94c7('0x6'));var controller=require(_0x94c7('0x7'));router[_0x94c7('0x8')]('/',auth[_0x94c7('0x9')](),controller[_0x94c7('0xa')]);router['get'](_0x94c7('0xb'),auth[_0x94c7('0x9')](),controller['show']);router[_0x94c7('0x8')](_0x94c7('0xc'),auth[_0x94c7('0x9')](),controller[_0x94c7('0xd')]);router[_0x94c7('0x8')](_0x94c7('0xe'),auth[_0x94c7('0x9')](),controller[_0x94c7('0xf')]);router[_0x94c7('0x8')](_0x94c7('0x10'),auth[_0x94c7('0x9')](),timeout('30s'),controller[_0x94c7('0x11')]);router['post']('/',auth[_0x94c7('0x9')](),controller[_0x94c7('0x12')]);router[_0x94c7('0x13')](_0x94c7('0x14'),auth['isAuthenticated'](),controller[_0x94c7('0x15')]);router[_0x94c7('0x16')](_0x94c7('0xb'),auth[_0x94c7('0x9')](),controller[_0x94c7('0x17')]);router[_0x94c7('0x18')](_0x94c7('0xb'),auth[_0x94c7('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x90f8=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./jscriptyProject.controller','get','isAuthenticated','index','/:id','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','create','clone','put','delete','destroy','exports','multer'];(function(_0x1a9e03,_0x1989f7){var _0x5a13cd=function(_0x1ec3c2){while(--_0x1ec3c2){_0x1a9e03['push'](_0x1a9e03['shift']());}};_0x5a13cd(++_0x1989f7);}(_0x90f8,0x151));var _0x890f=function(_0x562658,_0x1c9dbc){_0x562658=_0x562658-0x0;var _0x254148=_0x90f8[_0x562658];return _0x254148;};'use strict';var multer=require(_0x890f('0x0'));var util=require(_0x890f('0x1'));var path=require(_0x890f('0x2'));var timeout=require(_0x890f('0x3'));var express=require(_0x890f('0x4'));var router=express[_0x890f('0x5')]();var auth=require(_0x890f('0x6'));var interaction=require(_0x890f('0x7'));var config=require('../../config/environment');var controller=require(_0x890f('0x8'));router[_0x890f('0x9')]('/',auth[_0x890f('0xa')](),controller[_0x890f('0xb')]);router[_0x890f('0x9')](_0x890f('0xc'),auth[_0x890f('0xa')](),controller['show']);router['get']('/:id/sessions',auth[_0x890f('0xa')](),controller[_0x890f('0xd')]);router['get'](_0x890f('0xe'),auth['isAuthenticated'](),controller[_0x890f('0xf')]);router[_0x890f('0x9')](_0x890f('0x10'),auth['isAuthenticated'](),timeout(_0x890f('0x11')),controller[_0x890f('0x12')]);router[_0x890f('0x13')]('/',auth[_0x890f('0xa')](),controller[_0x890f('0x14')]);router[_0x890f('0x13')]('/:id/clone',auth['isAuthenticated'](),controller[_0x890f('0x15')]);router[_0x890f('0x16')](_0x890f('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x890f('0x17')](_0x890f('0xc'),auth[_0x890f('0xa')](),controller[_0x890f('0x18')]);module[_0x890f('0x19')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 92391ce..d1bd626 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 _0x0c10=['{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util','STRING','name','TEXT','long','setDataValue','formData','isString','format'];(function(_0x258c0d,_0x1eebe1){var _0x3f5b95=function(_0x2093af){while(--_0x2093af){_0x258c0d['push'](_0x258c0d['shift']());}};_0x3f5b95(++_0x1eebe1);}(_0x0c10,0x112));var _0x00c1=function(_0x481f0b,_0x2539d0){_0x481f0b=_0x481f0b-0x0;var _0x3d9ba0=_0x0c10[_0x481f0b];return _0x3d9ba0;};'use strict';var Sequelize=require(_0x00c1('0x0'));var _=require(_0x00c1('0x1'));var util=require(_0x00c1('0x2'));module['exports']={'name':{'type':Sequelize[_0x00c1('0x3')],'unique':_0x00c1('0x4')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x00c1('0x5')](_0x00c1('0x6')),'set':function(_0x49bd41){if(_['isObjectLike'](_0x49bd41)){this[_0x00c1('0x7')](_0x00c1('0x8'),JSON['stringify'](_0x49bd41));}else if(_[_0x00c1('0x9')](_0x49bd41)){this[_0x00c1('0x7')]('formData',_0x49bd41);}else{this[_0x00c1('0x7')](_0x00c1('0x8'),util[_0x00c1('0xa')](_0x00c1('0xb'),this[_0x00c1('0xc')](_0x00c1('0x4'))||'',this[_0x00c1('0xc')](_0x00c1('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x00c1('0xe')],'defaultValue':!![]}}; \ No newline at end of file +var _0x0cbd=['sequelize','lodash','util','exports','STRING','name','TEXT','isObjectLike','stringify','isString','setDataValue','formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description'];(function(_0x2a3876,_0x3736ec){var _0x4f769f=function(_0x3d4101){while(--_0x3d4101){_0x2a3876['push'](_0x2a3876['shift']());}};_0x4f769f(++_0x3736ec);}(_0x0cbd,0xf0));var _0xd0cb=function(_0x3fd281,_0x57ade2){_0x3fd281=_0x3fd281-0x0;var _0x23b6b4=_0x0cbd[_0x3fd281];return _0x23b6b4;};'use strict';var Sequelize=require(_0xd0cb('0x0'));var _=require(_0xd0cb('0x1'));var util=require(_0xd0cb('0x2'));module[_0xd0cb('0x3')]={'name':{'type':Sequelize[_0xd0cb('0x4')],'unique':_0xd0cb('0x5')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xd0cb('0x6')]('long'),'set':function(_0xe1a984){if(_[_0xd0cb('0x7')](_0xe1a984)){this['setDataValue']('formData',JSON[_0xd0cb('0x8')](_0xe1a984));}else if(_[_0xd0cb('0x9')](_0xe1a984)){this[_0xd0cb('0xa')](_0xd0cb('0xb'),_0xe1a984);}else{this[_0xd0cb('0xa')](_0xd0cb('0xb'),util[_0xd0cb('0xc')](_0xd0cb('0xd'),this[_0xd0cb('0xe')](_0xd0cb('0x5'))||'',this['getDataValue'](_0xd0cb('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index ee3bbcc..5252022 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 _0x0323=['JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','questionId','push','isEmpty','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','text/csv','download','sendStatus','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','get','Projects','error','send','index','rawAttributes','keys','query','filters','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','map','type','key','VIRTUAL','field','filter','merge','options','JscriptyProject','includeAll','include','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','getSessions','findOne','JscriptySessionReport','ProjectId','rows'];(function(_0x51e647,_0x397f42){var _0x40fed1=function(_0x173439){while(--_0x173439){_0x51e647['push'](_0x51e647['shift']());}};_0x40fed1(++_0x397f42);}(_0x0323,0x102));var _0x3032=function(_0x3e49fe,_0x552dba){_0x3e49fe=_0x3e49fe-0x0;var _0x150873=_0x0323[_0x3e49fe];return _0x150873;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x3032('0x0'));var zipdir=require(_0x3032('0x1'));var jsonpatch=require(_0x3032('0x2'));var rp=require(_0x3032('0x3'));var moment=require(_0x3032('0x4'));var BPromise=require(_0x3032('0x5'));var Mustache=require(_0x3032('0x6'));var util=require('util');var path=require(_0x3032('0x7'));var sox=require(_0x3032('0x8'));var csv=require(_0x3032('0x9'));var ejs=require(_0x3032('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3032('0xb'));var crypto=require(_0x3032('0xc'));var jsforce=require(_0x3032('0xd'));var deskjs=require(_0x3032('0xe'));var toCsv=require(_0x3032('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3032('0xf'));var authService=require(_0x3032('0x10'));var qs=require(_0x3032('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3032('0x12'))(_0x3032('0x13'));var utils=require('../../config/utils');var config=require(_0x3032('0x14'));var db=require(_0x3032('0x15'))['db'];function respondWithStatusCode(_0x134c20,_0x256c26){_0x256c26=_0x256c26||0xcc;return function(_0x3dbf66){if(_0x3dbf66){return _0x134c20['sendStatus'](_0x256c26);}return _0x134c20[_0x3032('0x16')](_0x256c26)[_0x3032('0x17')]();};}function respondWithResult(_0x3c0214,_0x26a1ca){_0x26a1ca=_0x26a1ca||0xc8;return function(_0x3d316e){if(_0x3d316e){return _0x3c0214[_0x3032('0x16')](_0x26a1ca)[_0x3032('0x18')](_0x3d316e);}};}function respondWithFilteredResult(_0x362495,_0x362b1a){return function(_0x364379){if(_0x364379){var _0x6339c0=_0x364379[_0x3032('0x19')],_0x2c7c00=_0x362b1a[_0x3032('0x1a')],_0x4d866d=_0x362b1a[_0x3032('0x1a')]+_0x362b1a[_0x3032('0x1b')],_0x14b7d2;if(_0x4d866d>=_0x6339c0){_0x4d866d=_0x6339c0;_0x14b7d2=0xc8;}else{_0x14b7d2=0xce;}_0x362495[_0x3032('0x16')](_0x14b7d2);return _0x362495[_0x3032('0x1c')]('Content-Range',_0x2c7c00+'-'+_0x4d866d+'/'+_0x6339c0)['json'](_0x364379);}return null;};}function patchUpdates(_0x401419){return function(_0x616177){try{jsonpatch[_0x3032('0x1d')](_0x616177,_0x401419,!![]);}catch(_0x31bec2){return BPromise[_0x3032('0x1e')](_0x31bec2);}return _0x616177[_0x3032('0x1f')]();};}function saveUpdates(_0x1f59c1,_0x2cb6ce){return function(_0x3e00ef){if(_0x3e00ef){return _0x3e00ef[_0x3032('0x20')](_0x1f59c1)[_0x3032('0x21')](function(_0x46e392){return _0x46e392;});}return null;};}function removeEntity(_0x4167f9,_0x252892){return function(_0x190c3c){if(_0x190c3c){return _0x190c3c[_0x3032('0x22')]()['then'](function(){var _0x32d241=_0x190c3c[_0x3032('0x23')]({'plain':!![]});var _0x1fa2f8=_0x3032('0x24');return db['UserProfileResource'][_0x3032('0x22')]({'where':{'type':_0x1fa2f8,'resourceId':_0x32d241['id']}})['then'](function(){return _0x190c3c;});})[_0x3032('0x21')](function(){_0x4167f9[_0x3032('0x16')](0xcc)[_0x3032('0x17')]();});}};}function handleEntityNotFound(_0x3129fe,_0x5bbc89){return function(_0x16bbe9){if(!_0x16bbe9){_0x3129fe['sendStatus'](0x194);}return _0x16bbe9;};}function handleError(_0x12270e,_0x2e3813){_0x2e3813=_0x2e3813||0x1f4;return function(_0x39650b){logger[_0x3032('0x25')](_0x39650b['stack']);if(_0x39650b['name']){delete _0x39650b['name'];}_0x12270e['status'](_0x2e3813)[_0x3032('0x26')](_0x39650b);};}exports[_0x3032('0x27')]=function(_0x4e556f,_0x59ed03){var _0x2ad967={},_0x533801={},_0x1369c1={'count':0x0,'rows':[]};var _0x737da0=db['JscriptyProject'][_0x3032('0x28')];_0x533801['model']=_[_0x3032('0x29')](_0x737da0);_0x533801[_0x3032('0x2a')]=_[_0x3032('0x29')](_0x4e556f[_0x3032('0x2a')]);_0x533801[_0x3032('0x2b')]=_[_0x3032('0x2c')](_0x533801[_0x3032('0x2d')],_0x533801[_0x3032('0x2a')]);_0x2ad967['attributes']=_[_0x3032('0x2c')](_0x533801[_0x3032('0x2d')],qs['fields'](_0x4e556f['query'][_0x3032('0x2e')]));_0x2ad967['attributes']=_0x2ad967['attributes'][_0x3032('0x2f')]?_0x2ad967[_0x3032('0x30')]:_0x533801['model'];if(!_0x4e556f[_0x3032('0x2a')][_0x3032('0x31')](_0x3032('0x32'))){_0x2ad967[_0x3032('0x1b')]=qs['limit'](_0x4e556f[_0x3032('0x2a')]['limit']);_0x2ad967['offset']=qs[_0x3032('0x1a')](_0x4e556f[_0x3032('0x2a')][_0x3032('0x1a')]);}_0x2ad967[_0x3032('0x33')]=qs[_0x3032('0x34')](_0x4e556f[_0x3032('0x2a')][_0x3032('0x34')]);_0x2ad967[_0x3032('0x35')]=qs[_0x3032('0x2b')](_[_0x3032('0x36')](_0x4e556f[_0x3032('0x2a')],_0x533801[_0x3032('0x2b')]));if(_0x4e556f[_0x3032('0x2a')]['filter']){_0x2ad967['where']=_['merge'](_0x2ad967[_0x3032('0x35')],{'$or':_[_0x3032('0x37')](_0x737da0,function(_0x1c0dd1){if(_0x1c0dd1[_0x3032('0x38')][_0x3032('0x39')]!==_0x3032('0x3a')){var _0x48b696={};_0x48b696[_0x1c0dd1[_0x3032('0x3b')]]={'$like':'%'+_0x4e556f[_0x3032('0x2a')][_0x3032('0x3c')]+'%'};return _0x48b696;}})});}_0x2ad967=_[_0x3032('0x3d')]({},_0x2ad967,_0x4e556f[_0x3032('0x3e')]);var _0x252e5a={'where':_0x2ad967[_0x3032('0x35')]};return db[_0x3032('0x3f')]['count'](_0x252e5a)[_0x3032('0x21')](function(_0x721379){_0x1369c1['count']=_0x721379;if(_0x4e556f[_0x3032('0x2a')][_0x3032('0x40')]){_0x2ad967[_0x3032('0x41')]=[{'all':!![]}];}return db[_0x3032('0x3f')][_0x3032('0x42')](_0x2ad967);})[_0x3032('0x21')](function(_0x2f7c57){_0x1369c1['rows']=_0x2f7c57;return _0x1369c1;})[_0x3032('0x21')](respondWithFilteredResult(_0x59ed03,_0x2ad967))[_0x3032('0x43')](handleError(_0x59ed03,null));};exports[_0x3032('0x44')]=function(_0x23c22f,_0x1650ee){var _0x196afc={'raw':![],'where':{'id':_0x23c22f[_0x3032('0x45')]['id']}},_0x5b385f={};_0x5b385f[_0x3032('0x2d')]=_[_0x3032('0x29')](db[_0x3032('0x3f')][_0x3032('0x28')]);_0x5b385f[_0x3032('0x2a')]=_['keys'](_0x23c22f['query']);_0x5b385f['filters']=_[_0x3032('0x2c')](_0x5b385f[_0x3032('0x2d')],_0x5b385f[_0x3032('0x2a')]);_0x196afc[_0x3032('0x30')]=_[_0x3032('0x2c')](_0x5b385f[_0x3032('0x2d')],qs[_0x3032('0x2e')](_0x23c22f['query'][_0x3032('0x2e')]));_0x196afc['attributes']=_0x196afc[_0x3032('0x30')][_0x3032('0x2f')]?_0x196afc[_0x3032('0x30')]:_0x5b385f['model'];if(_0x23c22f[_0x3032('0x2a')][_0x3032('0x40')]){_0x196afc[_0x3032('0x41')]=[{'all':!![]}];}_0x196afc=_[_0x3032('0x3d')]({},_0x196afc,_0x23c22f['options']);return db['JscriptyProject'][_0x3032('0x46')](_0x196afc)[_0x3032('0x21')](handleEntityNotFound(_0x1650ee,null))[_0x3032('0x21')](respondWithResult(_0x1650ee,null))[_0x3032('0x43')](handleError(_0x1650ee,null));};exports[_0x3032('0x47')]=function(_0x379f6b,_0x486417){return db[_0x3032('0x3f')][_0x3032('0x47')](_0x379f6b[_0x3032('0x48')],{})[_0x3032('0x21')](function(_0x1d7904){var _0x41d1b5=_0x379f6b[_0x3032('0x49')][_0x3032('0x23')]({'plain':!![]});if(!_0x41d1b5)throw new Error(_0x3032('0x4a'));if(_0x41d1b5[_0x3032('0x4b')]===_0x3032('0x49')){var _0x72d6a8=_0x1d7904['get']({'plain':!![]});var _0x5516d1=_0x3032('0x24');return db[_0x3032('0x4c')][_0x3032('0x46')]({'where':{'name':_0x5516d1,'userProfileId':_0x41d1b5[_0x3032('0x4d')]},'raw':!![]})[_0x3032('0x21')](function(_0x3d28e0){if(_0x3d28e0&&_0x3d28e0['autoAssociation']===0x0){return db[_0x3032('0x4e')][_0x3032('0x47')]({'name':_0x72d6a8[_0x3032('0x4f')],'resourceId':_0x72d6a8['id'],'type':_0x3d28e0[_0x3032('0x4f')],'sectionId':_0x3d28e0['id']},{})[_0x3032('0x21')](function(){return _0x1d7904;});}else{return _0x1d7904;}})[_0x3032('0x43')](function(_0x1f6591){logger['error'](_0x3032('0x50'),_0x1f6591);throw _0x1f6591;});}return _0x1d7904;})[_0x3032('0x21')](respondWithResult(_0x486417,0xc9))[_0x3032('0x43')](handleError(_0x486417,null));};exports[_0x3032('0x51')]=function(_0x46e17d,_0x15e77c){var _0x8b0a02={'raw':![],'where':{'id':_0x46e17d['params']['id']}},_0xe01b81={};_0xe01b81['model']=_['keys'](db[_0x3032('0x3f')][_0x3032('0x28')]);_0x8b0a02[_0x3032('0x30')]=_['intersection'](_0xe01b81[_0x3032('0x2d')],qs[_0x3032('0x2e')](_0x46e17d[_0x3032('0x2a')][_0x3032('0x2e')]));_0x8b0a02[_0x3032('0x30')]=_0x8b0a02[_0x3032('0x30')][_0x3032('0x2f')]?_0x8b0a02[_0x3032('0x30')]:_0xe01b81[_0x3032('0x2d')];if(_0x46e17d[_0x3032('0x2a')][_0x3032('0x40')]){_0x8b0a02[_0x3032('0x41')]=[{'all':!![]}];}_0x8b0a02=_[_0x3032('0x3d')]({},_0x8b0a02,_0x46e17d[_0x3032('0x3e')]);return db[_0x3032('0x3f')]['find'](_0x8b0a02)['then'](handleEntityNotFound(_0x15e77c,null))['then'](function(_0x32ad05){if(_0x32ad05){var _0x3de47c=_0x32ad05[_0x3032('0x23')]({'plain':!![]});_0x3de47c=qs[_0x3032('0x52')](_0x3de47c,['id','createdAt','updatedAt']);_0x46e17d[_0x3032('0x48')]=_['omit'](_0x46e17d[_0x3032('0x48')],['id',_0x3032('0x53'),_0x3032('0x54')]);return db[_0x3032('0x3f')][_0x3032('0x47')](_[_0x3032('0x3d')](_0x3de47c,_0x46e17d[_0x3032('0x48')]),{'include':_0x46e17d[_0x3032('0x2a')]['includeAll']?[{'all':!![]}]:undefined})[_0x3032('0x21')](function(_0x2ae552){var _0x541147=_0x46e17d['user'][_0x3032('0x23')]({'plain':!![]});if(!_0x541147)throw new Error(_0x3032('0x4a'));if(_0x541147[_0x3032('0x4b')]===_0x3032('0x49')){var _0x24da82=_0x2ae552[_0x3032('0x23')]({'plain':!![]});var _0x14c667=_0x3032('0x24');return db['UserProfileSection']['find']({'where':{'name':_0x14c667,'userProfileId':_0x541147['userProfileId']},'raw':!![]})['then'](function(_0x2edc6c){if(_0x2edc6c&&_0x2edc6c['autoAssociation']===0x0){return db[_0x3032('0x4e')]['create']({'name':_0x24da82[_0x3032('0x4f')],'resourceId':_0x24da82['id'],'type':_0x2edc6c[_0x3032('0x4f')],'sectionId':_0x2edc6c['id']},{})[_0x3032('0x21')](function(){return _0x2ae552;});}else{return _0x2ae552;}})[_0x3032('0x43')](function(_0x4db0ff){logger[_0x3032('0x25')](_0x3032('0x50'),_0x4db0ff);throw _0x4db0ff;});}return _0x2ae552;});}})[_0x3032('0x21')](respondWithResult(_0x15e77c,0xc9))[_0x3032('0x43')](handleError(_0x15e77c,null));};exports[_0x3032('0x20')]=function(_0x9a5456,_0x306974){if(_0x9a5456['body']['id']){delete _0x9a5456['body']['id'];}return db[_0x3032('0x3f')][_0x3032('0x46')]({'where':{'id':_0x9a5456[_0x3032('0x45')]['id']}})['then'](handleEntityNotFound(_0x306974,null))[_0x3032('0x21')](saveUpdates(_0x9a5456[_0x3032('0x48')],null))['then'](respondWithResult(_0x306974,null))['catch'](handleError(_0x306974,null));};exports[_0x3032('0x22')]=function(_0x59c1a1,_0x40598c){return db[_0x3032('0x3f')][_0x3032('0x46')]({'where':{'id':_0x59c1a1[_0x3032('0x45')]['id']}})['then'](handleEntityNotFound(_0x40598c,null))[_0x3032('0x21')](removeEntity(_0x40598c,null))[_0x3032('0x43')](handleError(_0x40598c,null));};exports[_0x3032('0x55')]=function(_0x3cf904,_0x57967c,_0x46f1f6){var _0x3aa216={'raw':!![],'where':{}};var _0x5f1a35={};var _0x1f9fa2={'count':0x0,'rows':[]};return db[_0x3032('0x3f')][_0x3032('0x56')]({'where':{'id':_0x3cf904[_0x3032('0x45')]['id']}})[_0x3032('0x21')](handleEntityNotFound(_0x57967c,null))['then'](function(_0x1634e8){if(_0x1634e8){_0x5f1a35['model']=_['keys'](db[_0x3032('0x57')][_0x3032('0x28')]);_0x5f1a35[_0x3032('0x2a')]=_['keys'](_0x3cf904[_0x3032('0x2a')]);_0x5f1a35[_0x3032('0x2b')]=_[_0x3032('0x2c')](_0x5f1a35[_0x3032('0x2d')],_0x5f1a35[_0x3032('0x2a')]);_0x3aa216['attributes']=_[_0x3032('0x2c')](_0x5f1a35[_0x3032('0x2d')],qs['fields'](_0x3cf904['query'][_0x3032('0x2e')]));_0x3aa216['attributes']=_0x3aa216[_0x3032('0x30')][_0x3032('0x2f')]?_0x3aa216['attributes']:_0x5f1a35[_0x3032('0x2d')];if(!_0x3cf904['query'][_0x3032('0x31')](_0x3032('0x32'))){_0x3aa216['limit']=qs[_0x3032('0x1b')](_0x3cf904['query'][_0x3032('0x1b')]);_0x3aa216['offset']=qs[_0x3032('0x1a')](_0x3cf904[_0x3032('0x2a')][_0x3032('0x1a')]);}_0x3aa216[_0x3032('0x33')]=qs[_0x3032('0x34')](_0x3cf904['query']['sort']);_0x3aa216[_0x3032('0x35')]=qs[_0x3032('0x2b')](_[_0x3032('0x36')](_0x3cf904['query'],_0x5f1a35[_0x3032('0x2b')]));_0x3aa216[_0x3032('0x35')][_0x3032('0x58')]=_0x1634e8['id'];if(_0x3cf904['query'][_0x3032('0x3c')]){_0x3aa216[_0x3032('0x35')]=_['merge'](_0x3aa216['where'],{'$or':_[_0x3032('0x37')](_0x3aa216[_0x3032('0x30')],function(_0x696cca){var _0x2df51e={};_0x2df51e[_0x696cca]={'$like':'%'+_0x3cf904[_0x3032('0x2a')][_0x3032('0x3c')]+'%'};return _0x2df51e;})});}_0x3aa216=_[_0x3032('0x3d')]({},_0x3aa216,_0x3cf904[_0x3032('0x3e')]);return db[_0x3032('0x57')]['count']({'where':_0x3aa216[_0x3032('0x35')]})[_0x3032('0x21')](function(_0x10117a){_0x1f9fa2['count']=_0x10117a;if(_0x3cf904[_0x3032('0x2a')][_0x3032('0x40')]){_0x3aa216[_0x3032('0x41')]=[{'all':!![]}];}return db[_0x3032('0x57')][_0x3032('0x42')](_0x3aa216);})[_0x3032('0x21')](function(_0xfe34a1){_0x1f9fa2[_0x3032('0x59')]=_0xfe34a1;return _0x1f9fa2;});}})['then'](respondWithFilteredResult(_0x57967c,_0x3aa216))[_0x3032('0x43')](handleError(_0x57967c,null));};exports['getAnswers']=function(_0x340c08,_0x28b321,_0x5736ef){var _0x306ae0={'raw':!![],'where':{}};var _0x3048d2={};var _0x52f475={'count':0x0,'rows':[]};return db[_0x3032('0x3f')][_0x3032('0x56')]({'where':{'id':_0x340c08[_0x3032('0x45')]['id']}})[_0x3032('0x21')](handleEntityNotFound(_0x28b321,null))['then'](function(_0x98bb56){if(_0x98bb56){_0x3048d2['model']=_[_0x3032('0x29')](db['JscriptyAnswerReport'][_0x3032('0x28')]);_0x3048d2[_0x3032('0x2a')]=_['keys'](_0x340c08[_0x3032('0x2a')]);_0x3048d2[_0x3032('0x2b')]=_[_0x3032('0x2c')](_0x3048d2['model'],_0x3048d2[_0x3032('0x2a')]);_0x306ae0[_0x3032('0x30')]=_[_0x3032('0x2c')](_0x3048d2[_0x3032('0x2d')],qs[_0x3032('0x2e')](_0x340c08[_0x3032('0x2a')][_0x3032('0x2e')]));_0x306ae0[_0x3032('0x30')]=_0x306ae0[_0x3032('0x30')][_0x3032('0x2f')]?_0x306ae0['attributes']:_0x3048d2[_0x3032('0x2d')];if(!_0x340c08[_0x3032('0x2a')]['hasOwnProperty']('nolimit')){_0x306ae0[_0x3032('0x1b')]=qs[_0x3032('0x1b')](_0x340c08[_0x3032('0x2a')][_0x3032('0x1b')]);_0x306ae0[_0x3032('0x1a')]=qs[_0x3032('0x1a')](_0x340c08['query'][_0x3032('0x1a')]);}_0x306ae0[_0x3032('0x33')]=qs[_0x3032('0x34')](_0x340c08['query'][_0x3032('0x34')]);_0x306ae0[_0x3032('0x35')]=qs[_0x3032('0x2b')](_['pick'](_0x340c08[_0x3032('0x2a')],_0x3048d2[_0x3032('0x2b')]));_0x306ae0[_0x3032('0x35')][_0x3032('0x58')]=_0x98bb56['id'];if(_0x340c08[_0x3032('0x2a')][_0x3032('0x3c')]){_0x306ae0[_0x3032('0x35')]=_[_0x3032('0x3d')](_0x306ae0[_0x3032('0x35')],{'$or':_[_0x3032('0x37')](_0x306ae0[_0x3032('0x30')],function(_0x59fdfc){var _0x403ff1={};_0x403ff1[_0x59fdfc]={'$like':'%'+_0x340c08['query'][_0x3032('0x3c')]+'%'};return _0x403ff1;})});}_0x306ae0=_[_0x3032('0x3d')]({},_0x306ae0,_0x340c08[_0x3032('0x3e')]);return db[_0x3032('0x5a')][_0x3032('0x19')]({'where':_0x306ae0[_0x3032('0x35')]})[_0x3032('0x21')](function(_0x1c25b9){_0x52f475[_0x3032('0x19')]=_0x1c25b9;if(_0x340c08['query'][_0x3032('0x40')]){_0x306ae0['include']=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x3032('0x42')](_0x306ae0);})[_0x3032('0x21')](function(_0x3da802){_0x52f475['rows']=_0x3da802;return _0x52f475;});}})[_0x3032('0x21')](respondWithFilteredResult(_0x28b321,_0x306ae0))['catch'](handleError(_0x28b321,null));};function char(_0x3c8ca7){return _0x3032('0x5b')===typeof _0x3c8ca7?String[_0x3032('0x5c')][_0x3032('0x1d')](null,arguments):_0x3c8ca7;}function needsEncapsulation(_0x35ec18){return!!_0x35ec18&&(_0x35ec18[_0x3032('0x5d')]()['indexOf'](char(0xd))>=0x0||_0x35ec18[_0x3032('0x5d')]()['indexOf'](char(0xa))>=0x0||_0x35ec18[_0x3032('0x5d')]()[_0x3032('0x5e')](char(0x2c))>=0x0||_0x35ec18[_0x3032('0x5d')]()[_0x3032('0x5e')](char(0x22))>=0x0);}function encapsulate(_0x54611f){var _0x734d3d=char(0x22),_0x42772e='\x5c'+char(0x22),_0x51bf96=_0x54611f[_0x3032('0x5d')]()[_0x3032('0x5f')](new RegExp(_0x734d3d,'g'),_0x42772e);return _0x734d3d+_0x51bf96+_0x734d3d;}exports['getSummary']=function(_0x5a034c,_0x57e1a2,_0x294b55){var _0xd24c27,_0xc3b9f0;var _0x52eb65={'where':{'ProjectId':_0x5a034c[_0x3032('0x45')]['id']}};if(_0x5a034c['query'][_0x3032('0x60')]){_0x52eb65['where'][_0x3032('0x61')]=JSON[_0x3032('0x62')](_0x5a034c[_0x3032('0x2a')][_0x3032('0x60')]);}return db[_0x3032('0x57')][_0x3032('0x42')](_0x52eb65)[_0x3032('0x21')](handleEntityNotFound(_0x57e1a2,null))['then'](function(_0x213666){if(_0x213666){_0xd24c27=_0x213666;return db[_0x3032('0x63')][_0x3032('0x42')]({'where':{'SessionId':{'$in':_[_0x3032('0x37')](_0xd24c27,'id')},'ProjectId':_0x5a034c['params']['id']},'order':_0x3032('0x64')});}})[_0x3032('0x21')](handleEntityNotFound(_0x57e1a2,null))[_0x3032('0x21')](function(_0x2bbda7){if(_0x2bbda7){_0xc3b9f0=_0x2bbda7;var _0x593a36={};for(var _0x5bc59f=0x0,_0x4dcc2b=_0xc3b9f0[_0x3032('0x2f')];_0x5bc59f<_0x4dcc2b;_0x5bc59f++){if(!_0x593a36[_0x3032('0x31')](_0xc3b9f0[_0x5bc59f]['questionId'])){_0x593a36[_0xc3b9f0[_0x5bc59f]['questionId']]=needsEncapsulation(_0xc3b9f0[_0x5bc59f]['question'])?encapsulate(_0xc3b9f0[_0x5bc59f][_0x3032('0x65')]):_0xc3b9f0[_0x5bc59f]['question'];}}var _0x13111d=[],_0x336069={};for(var _0x9c32d6=0x0,_0x1fb184=_0xd24c27[_0x3032('0x2f')];_0x9c32d6<_0x1fb184;_0x9c32d6++){_0x336069={'ProjectId':_0x5a034c[_0x3032('0x45')]['id'],'SessionId':_0xd24c27[_0x9c32d6]['id'],'StartTime':moment(_0xd24c27[_0x9c32d6][_0x3032('0x61')])[_0x3032('0x66')](_0x3032('0x67'))};for(var _0x145874=0x0,_0x13f491=_0xc3b9f0['length'];_0x145874<_0x13f491;_0x145874++){if(_0xc3b9f0[_0x145874][_0x3032('0x68')]==_0xd24c27[_0x9c32d6]['id']&&_0x593a36[_0x3032('0x31')](_0xc3b9f0[_0x145874][_0x3032('0x69')])){_0x336069[_0x593a36[_0xc3b9f0[_0x145874][_0x3032('0x69')]]]=_0xc3b9f0[_0x145874]['answer'];}}for(var _0xda5c86 in _0x593a36){if(!_0x336069[_0x3032('0x31')](_0x593a36[_0xda5c86])){_0x336069[_0x593a36[_0xda5c86]]=null;}}_0x13111d[_0x3032('0x6a')](_0x336069);}return _0x13111d;}})[_0x3032('0x21')](function(_0x1ab5d8){if(!_[_0x3032('0x6b')](_0x1ab5d8)){var _0x253b27=toCsv(_0x1ab5d8);var _0x4d774b=Date['now']();fs[_0x3032('0x6c')](util[_0x3032('0x66')](_0x3032('0x6d'),_0x5a034c['params']['id'],_0x4d774b),_0x253b27);_0x57e1a2['setHeader'](_0x3032('0x6e'),_0x3032('0x6f')+util['format'](_0x3032('0x70'),_0x5a034c['params']['id'],_0x4d774b));_0x57e1a2['setHeader']('Content-type',_0x3032('0x71'));return _0x57e1a2[_0x3032('0x72')](util['format'](_0x3032('0x6d'),_0x5a034c['params']['id'],_0x4d774b));}else{return _0x57e1a2[_0x3032('0x73')](0xcc);}})[_0x3032('0x43')](handleError(_0x57e1a2,null));}; \ No newline at end of file +var _0xbff5=['fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','status','end','offset','limit','set','Content-Range','json','apply','reject','update','then','get','Projects','UserProfileResource','destroy','sendStatus','error','stack','send','JscriptyProject','rawAttributes','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','map','type','VIRTUAL','options','count','includeAll','include','rows','catch','show','params','keys','create','body','user','role','find','userProfileId','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','updatedAt','omit','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','getSessions','findOne','JscriptySessionReport','hasOwnProperty','ProjectId','findAll','JscriptyAnswerReport','number','indexOf','toString','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','answer','push','isEmpty','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','Content-type','text/csv','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x4ddea0,_0x25e174){var _0x14e09f=function(_0x31e9a9){while(--_0x31e9a9){_0x4ddea0['push'](_0x4ddea0['shift']());}};_0x14e09f(++_0x25e174);}(_0xbff5,0x1bc));var _0x5bff=function(_0x380ac2,_0x2d5792){_0x380ac2=_0x380ac2-0x0;var _0xf9e845=_0xbff5[_0x380ac2];return _0xf9e845;};'use strict';var pdf=require(_0x5bff('0x0'));var emlformat=require(_0x5bff('0x1'));var rimraf=require(_0x5bff('0x2'));var zipdir=require(_0x5bff('0x3'));var jsonpatch=require(_0x5bff('0x4'));var rp=require(_0x5bff('0x5'));var moment=require(_0x5bff('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x5bff('0x7'));var util=require('util');var path=require('path');var sox=require(_0x5bff('0x8'));var csv=require(_0x5bff('0x9'));var ejs=require(_0x5bff('0xa'));var fs=require('fs');var _=require(_0x5bff('0xb'));var squel=require(_0x5bff('0xc'));var crypto=require(_0x5bff('0xd'));var jsforce=require(_0x5bff('0xe'));var deskjs=require(_0x5bff('0xf'));var toCsv=require(_0x5bff('0x9'));var querystring=require('querystring');var Papa=require(_0x5bff('0x10'));var Redis=require('ioredis');var authService=require(_0x5bff('0x11'));var qs=require(_0x5bff('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5bff('0x13'))('api');var utils=require(_0x5bff('0x14'));var config=require('../../config/environment');var db=require(_0x5bff('0x15'))['db'];function respondWithStatusCode(_0x135003,_0x4a6903){_0x4a6903=_0x4a6903||0xcc;return function(_0x132dc9){if(_0x132dc9){return _0x135003['sendStatus'](_0x4a6903);}return _0x135003[_0x5bff('0x16')](_0x4a6903)[_0x5bff('0x17')]();};}function respondWithResult(_0x548128,_0xa0dced){_0xa0dced=_0xa0dced||0xc8;return function(_0xa16a3f){if(_0xa16a3f){return _0x548128['status'](_0xa0dced)['json'](_0xa16a3f);}};}function respondWithFilteredResult(_0x378eca,_0x1d300e){return function(_0x3a507c){if(_0x3a507c){var _0x4d883e=_0x3a507c['count'],_0x2d22ab=_0x1d300e[_0x5bff('0x18')],_0x4612ec=_0x1d300e[_0x5bff('0x18')]+_0x1d300e[_0x5bff('0x19')],_0xcb8995;if(_0x4612ec>=_0x4d883e){_0x4612ec=_0x4d883e;_0xcb8995=0xc8;}else{_0xcb8995=0xce;}_0x378eca['status'](_0xcb8995);return _0x378eca[_0x5bff('0x1a')](_0x5bff('0x1b'),_0x2d22ab+'-'+_0x4612ec+'/'+_0x4d883e)[_0x5bff('0x1c')](_0x3a507c);}return null;};}function patchUpdates(_0x32cf60){return function(_0x5216dc){try{jsonpatch[_0x5bff('0x1d')](_0x5216dc,_0x32cf60,!![]);}catch(_0x5357d4){return BPromise[_0x5bff('0x1e')](_0x5357d4);}return _0x5216dc['save']();};}function saveUpdates(_0x1fc4cf,_0x13d5d0){return function(_0x2a83ce){if(_0x2a83ce){return _0x2a83ce[_0x5bff('0x1f')](_0x1fc4cf)[_0x5bff('0x20')](function(_0x2012e4){return _0x2012e4;});}return null;};}function removeEntity(_0x3d72ee,_0x13ee8f){return function(_0x155e16){if(_0x155e16){return _0x155e16['destroy']()[_0x5bff('0x20')](function(){var _0x263cf5=_0x155e16[_0x5bff('0x21')]({'plain':!![]});var _0x1e7f8a=_0x5bff('0x22');return db[_0x5bff('0x23')][_0x5bff('0x24')]({'where':{'type':_0x1e7f8a,'resourceId':_0x263cf5['id']}})[_0x5bff('0x20')](function(){return _0x155e16;});})['then'](function(){_0x3d72ee['status'](0xcc)[_0x5bff('0x17')]();});}};}function handleEntityNotFound(_0x53bd97,_0x220c8f){return function(_0xcc091d){if(!_0xcc091d){_0x53bd97[_0x5bff('0x25')](0x194);}return _0xcc091d;};}function handleError(_0x6f18f1,_0xfa361d){_0xfa361d=_0xfa361d||0x1f4;return function(_0x1140eb){logger[_0x5bff('0x26')](_0x1140eb[_0x5bff('0x27')]);if(_0x1140eb['name']){delete _0x1140eb['name'];}_0x6f18f1[_0x5bff('0x16')](_0xfa361d)[_0x5bff('0x28')](_0x1140eb);};}exports['index']=function(_0x36a7d2,_0x588078){var _0x5470cb={},_0x3eda3a={},_0x5cf207={'count':0x0,'rows':[]};var _0x3ed23b=db[_0x5bff('0x29')][_0x5bff('0x2a')];_0x3eda3a[_0x5bff('0x2b')]=_['keys'](_0x3ed23b);_0x3eda3a[_0x5bff('0x2c')]=_['keys'](_0x36a7d2[_0x5bff('0x2c')]);_0x3eda3a['filters']=_[_0x5bff('0x2d')](_0x3eda3a[_0x5bff('0x2b')],_0x3eda3a[_0x5bff('0x2c')]);_0x5470cb[_0x5bff('0x2e')]=_[_0x5bff('0x2d')](_0x3eda3a[_0x5bff('0x2b')],qs['fields'](_0x36a7d2[_0x5bff('0x2c')][_0x5bff('0x2f')]));_0x5470cb[_0x5bff('0x2e')]=_0x5470cb[_0x5bff('0x2e')][_0x5bff('0x30')]?_0x5470cb[_0x5bff('0x2e')]:_0x3eda3a[_0x5bff('0x2b')];if(!_0x36a7d2[_0x5bff('0x2c')]['hasOwnProperty'](_0x5bff('0x31'))){_0x5470cb[_0x5bff('0x19')]=qs[_0x5bff('0x19')](_0x36a7d2[_0x5bff('0x2c')]['limit']);_0x5470cb[_0x5bff('0x18')]=qs[_0x5bff('0x18')](_0x36a7d2['query'][_0x5bff('0x18')]);}_0x5470cb[_0x5bff('0x32')]=qs[_0x5bff('0x33')](_0x36a7d2[_0x5bff('0x2c')]['sort']);_0x5470cb[_0x5bff('0x34')]=qs[_0x5bff('0x35')](_[_0x5bff('0x36')](_0x36a7d2['query'],_0x3eda3a[_0x5bff('0x35')]));if(_0x36a7d2['query'][_0x5bff('0x37')]){_0x5470cb[_0x5bff('0x34')]=_[_0x5bff('0x38')](_0x5470cb['where'],{'$or':_[_0x5bff('0x39')](_0x3ed23b,function(_0x1ec079){if(_0x1ec079[_0x5bff('0x3a')]['key']!==_0x5bff('0x3b')){var _0x4b2dcc={};_0x4b2dcc[_0x1ec079['field']]={'$like':'%'+_0x36a7d2[_0x5bff('0x2c')][_0x5bff('0x37')]+'%'};return _0x4b2dcc;}})});}_0x5470cb=_[_0x5bff('0x38')]({},_0x5470cb,_0x36a7d2[_0x5bff('0x3c')]);var _0x3b0f99={'where':_0x5470cb['where']};return db[_0x5bff('0x29')]['count'](_0x3b0f99)[_0x5bff('0x20')](function(_0x2fecb9){_0x5cf207[_0x5bff('0x3d')]=_0x2fecb9;if(_0x36a7d2[_0x5bff('0x2c')][_0x5bff('0x3e')]){_0x5470cb[_0x5bff('0x3f')]=[{'all':!![]}];}return db[_0x5bff('0x29')]['findAll'](_0x5470cb);})['then'](function(_0x12f0db){_0x5cf207[_0x5bff('0x40')]=_0x12f0db;return _0x5cf207;})[_0x5bff('0x20')](respondWithFilteredResult(_0x588078,_0x5470cb))[_0x5bff('0x41')](handleError(_0x588078,null));};exports[_0x5bff('0x42')]=function(_0xb7b82a,_0x13de8a){var _0x30949a={'raw':![],'where':{'id':_0xb7b82a[_0x5bff('0x43')]['id']}},_0x4cabe8={};_0x4cabe8['model']=_[_0x5bff('0x44')](db[_0x5bff('0x29')]['rawAttributes']);_0x4cabe8[_0x5bff('0x2c')]=_[_0x5bff('0x44')](_0xb7b82a['query']);_0x4cabe8[_0x5bff('0x35')]=_[_0x5bff('0x2d')](_0x4cabe8[_0x5bff('0x2b')],_0x4cabe8['query']);_0x30949a[_0x5bff('0x2e')]=_[_0x5bff('0x2d')](_0x4cabe8[_0x5bff('0x2b')],qs['fields'](_0xb7b82a[_0x5bff('0x2c')][_0x5bff('0x2f')]));_0x30949a[_0x5bff('0x2e')]=_0x30949a[_0x5bff('0x2e')]['length']?_0x30949a[_0x5bff('0x2e')]:_0x4cabe8['model'];if(_0xb7b82a['query'][_0x5bff('0x3e')]){_0x30949a[_0x5bff('0x3f')]=[{'all':!![]}];}_0x30949a=_['merge']({},_0x30949a,_0xb7b82a[_0x5bff('0x3c')]);return db[_0x5bff('0x29')]['find'](_0x30949a)[_0x5bff('0x20')](handleEntityNotFound(_0x13de8a,null))[_0x5bff('0x20')](respondWithResult(_0x13de8a,null))[_0x5bff('0x41')](handleError(_0x13de8a,null));};exports[_0x5bff('0x45')]=function(_0x4ccf4d,_0x579a8d){return db[_0x5bff('0x29')][_0x5bff('0x45')](_0x4ccf4d[_0x5bff('0x46')],{})[_0x5bff('0x20')](function(_0x2588b8){var _0x599163=_0x4ccf4d[_0x5bff('0x47')][_0x5bff('0x21')]({'plain':!![]});if(!_0x599163)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x599163[_0x5bff('0x48')]==='user'){var _0x47fc14=_0x2588b8['get']({'plain':!![]});var _0x3ac8ad=_0x5bff('0x22');return db['UserProfileSection'][_0x5bff('0x49')]({'where':{'name':_0x3ac8ad,'userProfileId':_0x599163[_0x5bff('0x4a')]},'raw':!![]})[_0x5bff('0x20')](function(_0x470dff){if(_0x470dff&&_0x470dff[_0x5bff('0x4b')]===0x0){return db['UserProfileResource'][_0x5bff('0x45')]({'name':_0x47fc14[_0x5bff('0x4c')],'resourceId':_0x47fc14['id'],'type':_0x470dff['name'],'sectionId':_0x470dff['id']},{})[_0x5bff('0x20')](function(){return _0x2588b8;});}else{return _0x2588b8;}})['catch'](function(_0x1b0b69){logger[_0x5bff('0x26')](_0x5bff('0x4d'),_0x1b0b69);throw _0x1b0b69;});}return _0x2588b8;})[_0x5bff('0x20')](respondWithResult(_0x579a8d,0xc9))[_0x5bff('0x41')](handleError(_0x579a8d,null));};exports['clone']=function(_0x36089e,_0x18018e){var _0x5b4838={'raw':![],'where':{'id':_0x36089e[_0x5bff('0x43')]['id']}},_0x3a7a54={};_0x3a7a54['model']=_[_0x5bff('0x44')](db[_0x5bff('0x29')][_0x5bff('0x2a')]);_0x5b4838[_0x5bff('0x2e')]=_[_0x5bff('0x2d')](_0x3a7a54[_0x5bff('0x2b')],qs['fields'](_0x36089e['query'][_0x5bff('0x2f')]));_0x5b4838['attributes']=_0x5b4838[_0x5bff('0x2e')][_0x5bff('0x30')]?_0x5b4838[_0x5bff('0x2e')]:_0x3a7a54[_0x5bff('0x2b')];if(_0x36089e[_0x5bff('0x2c')][_0x5bff('0x3e')]){_0x5b4838[_0x5bff('0x3f')]=[{'all':!![]}];}_0x5b4838=_[_0x5bff('0x38')]({},_0x5b4838,_0x36089e[_0x5bff('0x3c')]);return db[_0x5bff('0x29')][_0x5bff('0x49')](_0x5b4838)['then'](handleEntityNotFound(_0x18018e,null))['then'](function(_0x18ee60){if(_0x18ee60){var _0x55e6cd=_0x18ee60[_0x5bff('0x21')]({'plain':!![]});_0x55e6cd=qs['omit'](_0x55e6cd,['id',_0x5bff('0x4e'),_0x5bff('0x4f')]);_0x36089e[_0x5bff('0x46')]=_[_0x5bff('0x50')](_0x36089e[_0x5bff('0x46')],['id',_0x5bff('0x4e'),_0x5bff('0x4f')]);return db[_0x5bff('0x29')][_0x5bff('0x45')](_[_0x5bff('0x38')](_0x55e6cd,_0x36089e[_0x5bff('0x46')]),{'include':_0x36089e['query'][_0x5bff('0x3e')]?[{'all':!![]}]:undefined})['then'](function(_0x54faf2){var _0x50e641=_0x36089e[_0x5bff('0x47')]['get']({'plain':!![]});if(!_0x50e641)throw new Error(_0x5bff('0x51'));if(_0x50e641[_0x5bff('0x48')]===_0x5bff('0x47')){var _0x3192cb=_0x54faf2['get']({'plain':!![]});var _0x4b29bc='Projects';return db[_0x5bff('0x52')][_0x5bff('0x49')]({'where':{'name':_0x4b29bc,'userProfileId':_0x50e641['userProfileId']},'raw':!![]})[_0x5bff('0x20')](function(_0x3bb787){if(_0x3bb787&&_0x3bb787[_0x5bff('0x4b')]===0x0){return db[_0x5bff('0x23')][_0x5bff('0x45')]({'name':_0x3192cb[_0x5bff('0x4c')],'resourceId':_0x3192cb['id'],'type':_0x3bb787[_0x5bff('0x4c')],'sectionId':_0x3bb787['id']},{})[_0x5bff('0x20')](function(){return _0x54faf2;});}else{return _0x54faf2;}})[_0x5bff('0x41')](function(_0x129b2b){logger[_0x5bff('0x26')](_0x5bff('0x4d'),_0x129b2b);throw _0x129b2b;});}return _0x54faf2;});}})[_0x5bff('0x20')](respondWithResult(_0x18018e,0xc9))[_0x5bff('0x41')](handleError(_0x18018e,null));};exports['update']=function(_0x3134de,_0x295ae9){if(_0x3134de[_0x5bff('0x46')]['id']){delete _0x3134de[_0x5bff('0x46')]['id'];}return db[_0x5bff('0x29')][_0x5bff('0x49')]({'where':{'id':_0x3134de[_0x5bff('0x43')]['id']}})[_0x5bff('0x20')](handleEntityNotFound(_0x295ae9,null))[_0x5bff('0x20')](saveUpdates(_0x3134de[_0x5bff('0x46')],null))[_0x5bff('0x20')](respondWithResult(_0x295ae9,null))[_0x5bff('0x41')](handleError(_0x295ae9,null));};exports[_0x5bff('0x24')]=function(_0x4d3e37,_0x9ef636){return db[_0x5bff('0x29')][_0x5bff('0x49')]({'where':{'id':_0x4d3e37[_0x5bff('0x43')]['id']}})[_0x5bff('0x20')](handleEntityNotFound(_0x9ef636,null))['then'](removeEntity(_0x9ef636,null))[_0x5bff('0x41')](handleError(_0x9ef636,null));};exports[_0x5bff('0x53')]=function(_0x5b8f25,_0x1b35ae,_0x1e3eab){var _0x230fab={'raw':!![],'where':{}};var _0x561b6e={};var _0x35198d={'count':0x0,'rows':[]};return db[_0x5bff('0x29')][_0x5bff('0x54')]({'where':{'id':_0x5b8f25[_0x5bff('0x43')]['id']}})[_0x5bff('0x20')](handleEntityNotFound(_0x1b35ae,null))[_0x5bff('0x20')](function(_0x287bec){if(_0x287bec){_0x561b6e[_0x5bff('0x2b')]=_[_0x5bff('0x44')](db[_0x5bff('0x55')][_0x5bff('0x2a')]);_0x561b6e[_0x5bff('0x2c')]=_['keys'](_0x5b8f25['query']);_0x561b6e[_0x5bff('0x35')]=_[_0x5bff('0x2d')](_0x561b6e[_0x5bff('0x2b')],_0x561b6e['query']);_0x230fab[_0x5bff('0x2e')]=_['intersection'](_0x561b6e['model'],qs[_0x5bff('0x2f')](_0x5b8f25['query']['fields']));_0x230fab[_0x5bff('0x2e')]=_0x230fab[_0x5bff('0x2e')]['length']?_0x230fab[_0x5bff('0x2e')]:_0x561b6e[_0x5bff('0x2b')];if(!_0x5b8f25[_0x5bff('0x2c')][_0x5bff('0x56')](_0x5bff('0x31'))){_0x230fab[_0x5bff('0x19')]=qs[_0x5bff('0x19')](_0x5b8f25[_0x5bff('0x2c')][_0x5bff('0x19')]);_0x230fab[_0x5bff('0x18')]=qs[_0x5bff('0x18')](_0x5b8f25[_0x5bff('0x2c')][_0x5bff('0x18')]);}_0x230fab[_0x5bff('0x32')]=qs[_0x5bff('0x33')](_0x5b8f25[_0x5bff('0x2c')][_0x5bff('0x33')]);_0x230fab[_0x5bff('0x34')]=qs[_0x5bff('0x35')](_[_0x5bff('0x36')](_0x5b8f25[_0x5bff('0x2c')],_0x561b6e['filters']));_0x230fab[_0x5bff('0x34')][_0x5bff('0x57')]=_0x287bec['id'];if(_0x5b8f25['query'][_0x5bff('0x37')]){_0x230fab['where']=_[_0x5bff('0x38')](_0x230fab[_0x5bff('0x34')],{'$or':_['map'](_0x230fab[_0x5bff('0x2e')],function(_0x4b6000){var _0x417e57={};_0x417e57[_0x4b6000]={'$like':'%'+_0x5b8f25[_0x5bff('0x2c')][_0x5bff('0x37')]+'%'};return _0x417e57;})});}_0x230fab=_[_0x5bff('0x38')]({},_0x230fab,_0x5b8f25[_0x5bff('0x3c')]);return db[_0x5bff('0x55')][_0x5bff('0x3d')]({'where':_0x230fab[_0x5bff('0x34')]})[_0x5bff('0x20')](function(_0x498849){_0x35198d[_0x5bff('0x3d')]=_0x498849;if(_0x5b8f25[_0x5bff('0x2c')]['includeAll']){_0x230fab[_0x5bff('0x3f')]=[{'all':!![]}];}return db[_0x5bff('0x55')][_0x5bff('0x58')](_0x230fab);})[_0x5bff('0x20')](function(_0x3c7965){_0x35198d[_0x5bff('0x40')]=_0x3c7965;return _0x35198d;});}})[_0x5bff('0x20')](respondWithFilteredResult(_0x1b35ae,_0x230fab))[_0x5bff('0x41')](handleError(_0x1b35ae,null));};exports['getAnswers']=function(_0x4d42bc,_0x114d4b,_0x59e996){var _0xd9f5e5={'raw':!![],'where':{}};var _0x40bd5d={};var _0x3834c8={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x5bff('0x54')]({'where':{'id':_0x4d42bc[_0x5bff('0x43')]['id']}})[_0x5bff('0x20')](handleEntityNotFound(_0x114d4b,null))[_0x5bff('0x20')](function(_0x294f05){if(_0x294f05){_0x40bd5d[_0x5bff('0x2b')]=_['keys'](db[_0x5bff('0x59')][_0x5bff('0x2a')]);_0x40bd5d[_0x5bff('0x2c')]=_[_0x5bff('0x44')](_0x4d42bc['query']);_0x40bd5d[_0x5bff('0x35')]=_['intersection'](_0x40bd5d[_0x5bff('0x2b')],_0x40bd5d[_0x5bff('0x2c')]);_0xd9f5e5[_0x5bff('0x2e')]=_[_0x5bff('0x2d')](_0x40bd5d[_0x5bff('0x2b')],qs[_0x5bff('0x2f')](_0x4d42bc[_0x5bff('0x2c')]['fields']));_0xd9f5e5[_0x5bff('0x2e')]=_0xd9f5e5['attributes']['length']?_0xd9f5e5[_0x5bff('0x2e')]:_0x40bd5d[_0x5bff('0x2b')];if(!_0x4d42bc['query']['hasOwnProperty'](_0x5bff('0x31'))){_0xd9f5e5[_0x5bff('0x19')]=qs[_0x5bff('0x19')](_0x4d42bc[_0x5bff('0x2c')]['limit']);_0xd9f5e5[_0x5bff('0x18')]=qs['offset'](_0x4d42bc[_0x5bff('0x2c')][_0x5bff('0x18')]);}_0xd9f5e5[_0x5bff('0x32')]=qs['sort'](_0x4d42bc[_0x5bff('0x2c')]['sort']);_0xd9f5e5[_0x5bff('0x34')]=qs[_0x5bff('0x35')](_[_0x5bff('0x36')](_0x4d42bc['query'],_0x40bd5d['filters']));_0xd9f5e5[_0x5bff('0x34')][_0x5bff('0x57')]=_0x294f05['id'];if(_0x4d42bc[_0x5bff('0x2c')][_0x5bff('0x37')]){_0xd9f5e5[_0x5bff('0x34')]=_[_0x5bff('0x38')](_0xd9f5e5[_0x5bff('0x34')],{'$or':_[_0x5bff('0x39')](_0xd9f5e5[_0x5bff('0x2e')],function(_0x59efd7){var _0x435076={};_0x435076[_0x59efd7]={'$like':'%'+_0x4d42bc[_0x5bff('0x2c')][_0x5bff('0x37')]+'%'};return _0x435076;})});}_0xd9f5e5=_['merge']({},_0xd9f5e5,_0x4d42bc['options']);return db[_0x5bff('0x59')][_0x5bff('0x3d')]({'where':_0xd9f5e5['where']})['then'](function(_0x1860b1){_0x3834c8['count']=_0x1860b1;if(_0x4d42bc[_0x5bff('0x2c')][_0x5bff('0x3e')]){_0xd9f5e5[_0x5bff('0x3f')]=[{'all':!![]}];}return db[_0x5bff('0x59')]['findAll'](_0xd9f5e5);})[_0x5bff('0x20')](function(_0x574d38){_0x3834c8[_0x5bff('0x40')]=_0x574d38;return _0x3834c8;});}})[_0x5bff('0x20')](respondWithFilteredResult(_0x114d4b,_0xd9f5e5))[_0x5bff('0x41')](handleError(_0x114d4b,null));};function char(_0x272926){return _0x5bff('0x5a')===typeof _0x272926?String['fromCharCode'][_0x5bff('0x1d')](null,arguments):_0x272926;}function needsEncapsulation(_0x320109){return!!_0x320109&&(_0x320109['toString']()[_0x5bff('0x5b')](char(0xd))>=0x0||_0x320109[_0x5bff('0x5c')]()[_0x5bff('0x5b')](char(0xa))>=0x0||_0x320109[_0x5bff('0x5c')]()[_0x5bff('0x5b')](char(0x2c))>=0x0||_0x320109['toString']()[_0x5bff('0x5b')](char(0x22))>=0x0);}function encapsulate(_0x3033de){var _0x3977d3=char(0x22),_0x223c6f='\x5c'+char(0x22),_0x701e08=_0x3033de[_0x5bff('0x5c')]()['replace'](new RegExp(_0x3977d3,'g'),_0x223c6f);return _0x3977d3+_0x701e08+_0x3977d3;}exports[_0x5bff('0x5d')]=function(_0x4be1a0,_0x1f0a8a,_0x3ac0b7){var _0x1ed775,_0x3b240f;var _0x2efeb0={'where':{'ProjectId':_0x4be1a0[_0x5bff('0x43')]['id']}};if(_0x4be1a0[_0x5bff('0x2c')][_0x5bff('0x5e')]){_0x2efeb0[_0x5bff('0x34')][_0x5bff('0x5f')]=JSON[_0x5bff('0x60')](_0x4be1a0[_0x5bff('0x2c')][_0x5bff('0x5e')]);}return db['JscriptySessionReport']['findAll'](_0x2efeb0)[_0x5bff('0x20')](handleEntityNotFound(_0x1f0a8a,null))[_0x5bff('0x20')](function(_0x76387){if(_0x76387){_0x1ed775=_0x76387;return db[_0x5bff('0x61')][_0x5bff('0x58')]({'where':{'SessionId':{'$in':_['map'](_0x1ed775,'id')},'ProjectId':_0x4be1a0[_0x5bff('0x43')]['id']},'order':_0x5bff('0x62')});}})[_0x5bff('0x20')](handleEntityNotFound(_0x1f0a8a,null))['then'](function(_0x2f1f80){if(_0x2f1f80){_0x3b240f=_0x2f1f80;var _0x49e348={};for(var _0x3e9ee=0x0,_0x51c0a1=_0x3b240f[_0x5bff('0x30')];_0x3e9ee<_0x51c0a1;_0x3e9ee++){if(!_0x49e348['hasOwnProperty'](_0x3b240f[_0x3e9ee][_0x5bff('0x63')])){_0x49e348[_0x3b240f[_0x3e9ee][_0x5bff('0x63')]]=needsEncapsulation(_0x3b240f[_0x3e9ee][_0x5bff('0x64')])?encapsulate(_0x3b240f[_0x3e9ee]['question']):_0x3b240f[_0x3e9ee][_0x5bff('0x64')];}}var _0x2e5ac0=[],_0x1b895d={};for(var _0x3dbb53=0x0,_0x1db44c=_0x1ed775[_0x5bff('0x30')];_0x3dbb53<_0x1db44c;_0x3dbb53++){_0x1b895d={'ProjectId':_0x4be1a0[_0x5bff('0x43')]['id'],'SessionId':_0x1ed775[_0x3dbb53]['id'],'StartTime':moment(_0x1ed775[_0x3dbb53][_0x5bff('0x5f')])[_0x5bff('0x65')](_0x5bff('0x66'))};for(var _0x4d5581=0x0,_0x35c3c0=_0x3b240f[_0x5bff('0x30')];_0x4d5581<_0x35c3c0;_0x4d5581++){if(_0x3b240f[_0x4d5581]['SessionId']==_0x1ed775[_0x3dbb53]['id']&&_0x49e348[_0x5bff('0x56')](_0x3b240f[_0x4d5581]['questionId'])){_0x1b895d[_0x49e348[_0x3b240f[_0x4d5581]['questionId']]]=_0x3b240f[_0x4d5581][_0x5bff('0x67')];}}for(var _0x40a636 in _0x49e348){if(!_0x1b895d[_0x5bff('0x56')](_0x49e348[_0x40a636])){_0x1b895d[_0x49e348[_0x40a636]]=null;}}_0x2e5ac0[_0x5bff('0x68')](_0x1b895d);}return _0x2e5ac0;}})['then'](function(_0x5e83b8){if(!_[_0x5bff('0x69')](_0x5e83b8)){var _0x15d606=toCsv(_0x5e83b8);var _0xafa91a=Date['now']();fs[_0x5bff('0x6a')](util[_0x5bff('0x65')](_0x5bff('0x6b'),_0x4be1a0[_0x5bff('0x43')]['id'],_0xafa91a),_0x15d606);_0x1f0a8a[_0x5bff('0x6c')]('Content-disposition',_0x5bff('0x6d')+util[_0x5bff('0x65')]('Jscripty_Project_%d_Summary_%s.csv',_0x4be1a0[_0x5bff('0x43')]['id'],_0xafa91a));_0x1f0a8a[_0x5bff('0x6c')](_0x5bff('0x6e'),_0x5bff('0x6f'));return _0x1f0a8a['download'](util['format'](_0x5bff('0x6b'),_0x4be1a0[_0x5bff('0x43')]['id'],_0xafa91a));}else{return _0x1f0a8a[_0x5bff('0x25')](0xcc);}})[_0x5bff('0x41')](handleError(_0x1f0a8a,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 14d1bba..2319213 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 _0x82f8=['./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x169e64,_0x3edfba){var _0x30b6a2=function(_0x4514b4){while(--_0x4514b4){_0x169e64['push'](_0x169e64['shift']());}};_0x30b6a2(++_0x3edfba);}(_0x82f8,0x157));var _0x882f=function(_0x4c16b2,_0x542871){_0x4c16b2=_0x4c16b2-0x0;var _0x1937b3=_0x82f8[_0x4c16b2];return _0x1937b3;};'use strict';var _=require('lodash');var util=require(_0x882f('0x0'));var logger=require(_0x882f('0x1'))('api');var moment=require(_0x882f('0x2'));var BPromise=require(_0x882f('0x3'));var rp=require(_0x882f('0x4'));var fs=require('fs');var path=require(_0x882f('0x5'));var rimraf=require(_0x882f('0x6'));var config=require(_0x882f('0x7'));var attributes=require(_0x882f('0x8'));module[_0x882f('0x9')]=function(_0x4efdc9,_0x57fc29){return _0x4efdc9[_0x882f('0xa')](_0x882f('0xb'),attributes,{'tableName':_0x882f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x22ed=['../../config/environment','./jscriptyProject.attributes','exports','define','jscripty_projects','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4660b2,_0x17c4d4){var _0xa5e3aa=function(_0x4eda5f){while(--_0x4eda5f){_0x4660b2['push'](_0x4660b2['shift']());}};_0xa5e3aa(++_0x17c4d4);}(_0x22ed,0x1a9));var _0xd22e=function(_0x76f733,_0x28fffa){_0x76f733=_0x76f733-0x0;var _0x36778d=_0x22ed[_0x76f733];return _0x36778d;};'use strict';var _=require(_0xd22e('0x0'));var util=require(_0xd22e('0x1'));var logger=require(_0xd22e('0x2'))(_0xd22e('0x3'));var moment=require(_0xd22e('0x4'));var BPromise=require(_0xd22e('0x5'));var rp=require(_0xd22e('0x6'));var fs=require('fs');var path=require(_0xd22e('0x7'));var rimraf=require(_0xd22e('0x8'));var config=require(_0xd22e('0x9'));var attributes=require(_0xd22e('0xa'));module[_0xd22e('0xb')]=function(_0x4cd924,_0x131034){return _0x4cd924[_0xd22e('0xc')]('JscriptyProject',attributes,{'tableName':_0xd22e('0xd'),'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 e7e49c5..582370f 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 _0x627e=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','JscriptyProject,\x20%s,\x20%s','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x627e,0x152));var _0xe627=function(_0x15944c,_0x40c8be){_0x15944c=_0x15944c-0x0;var _0x2aa056=_0x627e[_0x15944c];return _0x2aa056;};'use strict';var _=require(_0xe627('0x0'));var util=require(_0xe627('0x1'));var moment=require(_0xe627('0x2'));var BPromise=require(_0xe627('0x3'));var rs=require(_0xe627('0x4'));var fs=require('fs');var Redis=require(_0xe627('0x5'));var db=require(_0xe627('0x6'))['db'];var utils=require(_0xe627('0x7'));var logger=require(_0xe627('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe627('0x9'));var client=jayson[_0xe627('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2cdd33,_0x21ad9e,_0x5d93b9){return new BPromise(function(_0x54212b,_0x6c6d48){return client[_0xe627('0xb')](_0x2cdd33,_0x5d93b9)[_0xe627('0xc')](function(_0x206588){logger[_0xe627('0xd')](_0xe627('0xe'),_0x21ad9e,'request\x20sent');logger[_0xe627('0xf')](_0xe627('0x10'),_0x21ad9e,_0xe627('0x11'),JSON[_0xe627('0x12')](_0x206588));if(_0x206588[_0xe627('0x13')]){if(_0x206588[_0xe627('0x13')][_0xe627('0x14')]===0x1f4){logger[_0xe627('0x13')](_0xe627('0xe'),_0x21ad9e,_0x206588['error'][_0xe627('0x15')]);return _0x6c6d48(_0x206588[_0xe627('0x13')][_0xe627('0x15')]);}logger[_0xe627('0x13')](_0xe627('0xe'),_0x21ad9e,_0x206588[_0xe627('0x13')][_0xe627('0x15')]);return _0x54212b(_0x206588[_0xe627('0x13')]['message']);}else{logger['info'](_0xe627('0xe'),_0x21ad9e,_0xe627('0x11'));_0x54212b(_0x206588[_0xe627('0x16')]['message']);}})[_0xe627('0x17')](function(_0x54718d){logger[_0xe627('0x13')](_0xe627('0xe'),_0x21ad9e,_0x54718d);_0x6c6d48(_0x54718d);});});} \ No newline at end of file +var _0x030c=['then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','error','JscriptyProject,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request'];(function(_0x4bca27,_0x3a7bce){var _0x4d6f1b=function(_0x37878e){while(--_0x37878e){_0x4bca27['push'](_0x4bca27['shift']());}};_0x4d6f1b(++_0x3a7bce);}(_0x030c,0x139));var _0xc030=function(_0x5877a7,_0x438c23){_0x5877a7=_0x5877a7-0x0;var _0x18e2f3=_0x030c[_0x5877a7];return _0x18e2f3;};'use strict';var _=require(_0xc030('0x0'));var util=require('util');var moment=require(_0xc030('0x1'));var BPromise=require(_0xc030('0x2'));var rs=require(_0xc030('0x3'));var fs=require('fs');var Redis=require(_0xc030('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc030('0x5'));var logger=require('../../config/logger')(_0xc030('0x6'));var config=require(_0xc030('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc030('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb9966e,_0x3ac30c,_0x208389){return new BPromise(function(_0x527343,_0x23caf1){return client[_0xc030('0x9')](_0xb9966e,_0x208389)[_0xc030('0xa')](function(_0x33e076){logger[_0xc030('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x3ac30c,'request\x20sent');logger[_0xc030('0xc')](_0xc030('0xd'),_0x3ac30c,_0xc030('0xe'),JSON['stringify'](_0x33e076));if(_0x33e076[_0xc030('0xf')]){if(_0x33e076[_0xc030('0xf')]['code']===0x1f4){logger[_0xc030('0xf')](_0xc030('0x10'),_0x3ac30c,_0x33e076[_0xc030('0xf')][_0xc030('0x11')]);return _0x23caf1(_0x33e076[_0xc030('0xf')][_0xc030('0x11')]);}logger[_0xc030('0xf')](_0xc030('0x10'),_0x3ac30c,_0x33e076['error'][_0xc030('0x11')]);return _0x527343(_0x33e076['error'][_0xc030('0x11')]);}else{logger[_0xc030('0xb')](_0xc030('0x10'),_0x3ac30c,'request\x20sent');_0x527343(_0x33e076['result'][_0xc030('0x11')]);}})[_0xc030('0x12')](function(_0x2f4cf2){logger['error']('JscriptyProject,\x20%s,\x20%s',_0x3ac30c,_0x2f4cf2);_0x23caf1(_0x2f4cf2);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 6ced32b..209e88d 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 _0x3d70=['./jscriptyQuestionReport.controller','isAuthenticated','get','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x543b43,_0x38e9be){var _0x31a539=function(_0x596038){while(--_0x596038){_0x543b43['push'](_0x543b43['shift']());}};_0x31a539(++_0x38e9be);}(_0x3d70,0x13d));var _0x03d7=function(_0x44268d,_0xad8443){_0x44268d=_0x44268d-0x0;var _0x4be92d=_0x3d70[_0x44268d];return _0x4be92d;};'use strict';var multer=require(_0x03d7('0x0'));var util=require(_0x03d7('0x1'));var path=require(_0x03d7('0x2'));var timeout=require(_0x03d7('0x3'));var express=require(_0x03d7('0x4'));var router=express[_0x03d7('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x03d7('0x6'));router['get']('/',auth[_0x03d7('0x7')](),controller['index']);router[_0x03d7('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x03d7('0x8')](_0x03d7('0x9'),auth[_0x03d7('0x7')](),controller[_0x03d7('0xa')]);router[_0x03d7('0xb')]('/',auth[_0x03d7('0x7')](),controller[_0x03d7('0xc')]);router[_0x03d7('0xd')](_0x03d7('0x9'),auth[_0x03d7('0x7')](),controller[_0x03d7('0xe')]);router[_0x03d7('0xf')](_0x03d7('0x9'),auth[_0x03d7('0x7')](),controller[_0x03d7('0x10')]);module['exports']=router; \ No newline at end of file +var _0xc763=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update'];(function(_0x150217,_0x3178dc){var _0x75d2ba=function(_0x4ac8dd){while(--_0x4ac8dd){_0x150217['push'](_0x150217['shift']());}};_0x75d2ba(++_0x3178dc);}(_0xc763,0x9d));var _0x3c76=function(_0x1c3eb3,_0x26bac0){_0x1c3eb3=_0x1c3eb3-0x0;var _0x19c20b=_0xc763[_0x1c3eb3];return _0x19c20b;};'use strict';var multer=require(_0x3c76('0x0'));var util=require(_0x3c76('0x1'));var path=require(_0x3c76('0x2'));var timeout=require(_0x3c76('0x3'));var express=require(_0x3c76('0x4'));var router=express[_0x3c76('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3c76('0x6'));var controller=require(_0x3c76('0x7'));router[_0x3c76('0x8')]('/',auth[_0x3c76('0x9')](),controller[_0x3c76('0xa')]);router[_0x3c76('0x8')](_0x3c76('0xb'),auth[_0x3c76('0x9')](),controller[_0x3c76('0xc')]);router['get']('/:id',auth[_0x3c76('0x9')](),controller[_0x3c76('0xd')]);router[_0x3c76('0xe')]('/',auth[_0x3c76('0x9')](),controller[_0x3c76('0xf')]);router[_0x3c76('0x10')](_0x3c76('0x11'),auth[_0x3c76('0x9')](),controller[_0x3c76('0x12')]);router[_0x3c76('0x13')](_0x3c76('0x11'),auth[_0x3c76('0x9')](),controller[_0x3c76('0x14')]);module[_0x3c76('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 548fa9e..39e7d8d 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 _0x6599=['exports','STRING','TEXT','long'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6599,0xb0));var _0x9659=function(_0x158da6,_0x3cb06d){_0x158da6=_0x158da6-0x0;var _0x429c30=_0x6599[_0x158da6];return _0x429c30;};'use strict';var Sequelize=require('sequelize');module[_0x9659('0x0')]={'question':{'type':Sequelize[_0x9659('0x1')]},'answer':{'type':Sequelize[_0x9659('0x2')](_0x9659('0x3'))},'membername':{'type':Sequelize[_0x9659('0x1')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x9659('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x9659('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize[_0x9659('0x1')]}}; \ No newline at end of file +var _0xf874=['STRING','TEXT','long','sequelize'];(function(_0x38a17a,_0x209e1f){var _0x5e41f4=function(_0x26b594){while(--_0x26b594){_0x38a17a['push'](_0x38a17a['shift']());}};_0x5e41f4(++_0x209e1f);}(_0xf874,0x177));var _0x4f87=function(_0x27c1b7,_0x5a8dff){_0x27c1b7=_0x27c1b7-0x0;var _0x1402b4=_0xf874[_0x27c1b7];return _0x1402b4;};'use strict';var Sequelize=require(_0x4f87('0x0'));module['exports']={'question':{'type':Sequelize[_0x4f87('0x1')]},'answer':{'type':Sequelize[_0x4f87('0x2')](_0x4f87('0x3'))},'membername':{'type':Sequelize[_0x4f87('0x1')]},'projectname':{'type':Sequelize[_0x4f87('0x1')]},'queue':{'type':Sequelize[_0x4f87('0x1')]},'uniqueid':{'type':Sequelize[_0x4f87('0x1')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x4f87('0x1')]},'questionId':{'type':Sequelize[_0x4f87('0x1')]}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index 2d9ca50..2d58548 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 _0xa21a=['show','params','filters','include','find','catch','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','mustache','path','to-csv','ejs','lodash','squel','jsforce','querystring','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','set','apply','reject','save','update','destroy','then','end','stack','send','index','JscriptyQuestionReport','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','key','VIRTUAL','field','options','includeAll'];(function(_0x2de705,_0x1461f1){var _0x39cdd9=function(_0x4ce895){while(--_0x4ce895){_0x2de705['push'](_0x2de705['shift']());}};_0x39cdd9(++_0x1461f1);}(_0xa21a,0x111));var _0xaa21=function(_0x40ef6d,_0xb68b81){_0x40ef6d=_0x40ef6d-0x0;var _0x1085f5=_0xa21a[_0x40ef6d];return _0x1085f5;};'use strict';var pdf=require(_0xaa21('0x0'));var emlformat=require(_0xaa21('0x1'));var rimraf=require(_0xaa21('0x2'));var zipdir=require(_0xaa21('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaa21('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xaa21('0x5'));var util=require('util');var path=require(_0xaa21('0x6'));var sox=require('sox');var csv=require(_0xaa21('0x7'));var ejs=require(_0xaa21('0x8'));var fs=require('fs');var _=require(_0xaa21('0x9'));var squel=require(_0xaa21('0xa'));var crypto=require('crypto');var jsforce=require(_0xaa21('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xaa21('0x7'));var querystring=require(_0xaa21('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xaa21('0xd'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xaa21('0xe'));var logger=require('../../config/logger')(_0xaa21('0xf'));var utils=require(_0xaa21('0x10'));var config=require(_0xaa21('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x448f6d,_0x579800){_0x579800=_0x579800||0xcc;return function(_0x8b504){if(_0x8b504){return _0x448f6d[_0xaa21('0x12')](_0x579800);}return _0x448f6d[_0xaa21('0x13')](_0x579800)['end']();};}function respondWithResult(_0x209880,_0x42ef96){_0x42ef96=_0x42ef96||0xc8;return function(_0x981ed2){if(_0x981ed2){return _0x209880[_0xaa21('0x13')](_0x42ef96)[_0xaa21('0x14')](_0x981ed2);}};}function respondWithFilteredResult(_0xfa5c1e,_0x3cd6f9){return function(_0x56e5e4){if(_0x56e5e4){var _0x7463de=_0x56e5e4[_0xaa21('0x15')],_0x2a5910=_0x3cd6f9[_0xaa21('0x16')],_0x28aba5=_0x3cd6f9[_0xaa21('0x16')]+_0x3cd6f9[_0xaa21('0x17')],_0x28d2dc;if(_0x28aba5>=_0x7463de){_0x28aba5=_0x7463de;_0x28d2dc=0xc8;}else{_0x28d2dc=0xce;}_0xfa5c1e[_0xaa21('0x13')](_0x28d2dc);return _0xfa5c1e[_0xaa21('0x18')]('Content-Range',_0x2a5910+'-'+_0x28aba5+'/'+_0x7463de)['json'](_0x56e5e4);}return null;};}function patchUpdates(_0x1549ff){return function(_0x5c0a5a){try{jsonpatch[_0xaa21('0x19')](_0x5c0a5a,_0x1549ff,!![]);}catch(_0x138c71){return BPromise[_0xaa21('0x1a')](_0x138c71);}return _0x5c0a5a[_0xaa21('0x1b')]();};}function saveUpdates(_0x32a107,_0x1181e5){return function(_0x1e031f){if(_0x1e031f){return _0x1e031f[_0xaa21('0x1c')](_0x32a107)['then'](function(_0x38fe8d){return _0x38fe8d;});}return null;};}function removeEntity(_0x462e8a,_0x2cfcc2){return function(_0x320ebd){if(_0x320ebd){return _0x320ebd[_0xaa21('0x1d')]()[_0xaa21('0x1e')](function(){_0x462e8a[_0xaa21('0x13')](0xcc)[_0xaa21('0x1f')]();});}};}function handleEntityNotFound(_0x41654c,_0x133009){return function(_0xd04e1c){if(!_0xd04e1c){_0x41654c[_0xaa21('0x12')](0x194);}return _0xd04e1c;};}function handleError(_0x34ba58,_0x57b8e6){_0x57b8e6=_0x57b8e6||0x1f4;return function(_0x1012dc){logger['error'](_0x1012dc[_0xaa21('0x20')]);if(_0x1012dc['name']){delete _0x1012dc['name'];}_0x34ba58[_0xaa21('0x13')](_0x57b8e6)[_0xaa21('0x21')](_0x1012dc);};}exports[_0xaa21('0x22')]=function(_0x57a6fb,_0x3f661d){var _0x50395a={},_0x28124c={},_0x4ef8c8={'count':0x0,'rows':[]};var _0x2a1d88=db[_0xaa21('0x23')][_0xaa21('0x24')];_0x28124c[_0xaa21('0x25')]=_[_0xaa21('0x26')](_0x2a1d88);_0x28124c[_0xaa21('0x27')]=_[_0xaa21('0x26')](_0x57a6fb[_0xaa21('0x27')]);_0x28124c['filters']=_[_0xaa21('0x28')](_0x28124c[_0xaa21('0x25')],_0x28124c['query']);_0x50395a[_0xaa21('0x29')]=_[_0xaa21('0x28')](_0x28124c['model'],qs[_0xaa21('0x2a')](_0x57a6fb[_0xaa21('0x27')][_0xaa21('0x2a')]));_0x50395a['attributes']=_0x50395a[_0xaa21('0x29')][_0xaa21('0x2b')]?_0x50395a[_0xaa21('0x29')]:_0x28124c['model'];if(!_0x57a6fb[_0xaa21('0x27')][_0xaa21('0x2c')](_0xaa21('0x2d'))){_0x50395a[_0xaa21('0x17')]=qs[_0xaa21('0x17')](_0x57a6fb[_0xaa21('0x27')][_0xaa21('0x17')]);_0x50395a['offset']=qs['offset'](_0x57a6fb[_0xaa21('0x27')][_0xaa21('0x16')]);}_0x50395a[_0xaa21('0x2e')]=qs[_0xaa21('0x2f')](_0x57a6fb[_0xaa21('0x27')][_0xaa21('0x2f')]);_0x50395a['where']=qs['filters'](_[_0xaa21('0x30')](_0x57a6fb[_0xaa21('0x27')],_0x28124c['filters']));if(_0x57a6fb[_0xaa21('0x27')][_0xaa21('0x31')]){_0x50395a['where']=_[_0xaa21('0x32')](_0x50395a[_0xaa21('0x33')],{'$or':_['map'](_0x2a1d88,function(_0x3404df){if(_0x3404df['type'][_0xaa21('0x34')]!==_0xaa21('0x35')){var _0x2d18d1={};_0x2d18d1[_0x3404df[_0xaa21('0x36')]]={'$like':'%'+_0x57a6fb[_0xaa21('0x27')][_0xaa21('0x31')]+'%'};return _0x2d18d1;}})});}_0x50395a=_['merge']({},_0x50395a,_0x57a6fb[_0xaa21('0x37')]);var _0x2885e0={'where':_0x50395a[_0xaa21('0x33')]};return db[_0xaa21('0x23')]['count'](_0x2885e0)['then'](function(_0x1da3d4){_0x4ef8c8['count']=_0x1da3d4;if(_0x57a6fb[_0xaa21('0x27')][_0xaa21('0x38')]){_0x50395a['include']=[{'all':!![]}];}return db[_0xaa21('0x23')]['findAll'](_0x50395a);})['then'](function(_0x5eede5){_0x4ef8c8['rows']=_0x5eede5;return _0x4ef8c8;})[_0xaa21('0x1e')](respondWithFilteredResult(_0x3f661d,_0x50395a))['catch'](handleError(_0x3f661d,null));};exports[_0xaa21('0x39')]=function(_0x1e91cc,_0x549a61){var _0x32e3b1={'raw':!![],'where':{'id':_0x1e91cc[_0xaa21('0x3a')]['id']}},_0x310d6f={};_0x310d6f[_0xaa21('0x25')]=_[_0xaa21('0x26')](db['JscriptyQuestionReport'][_0xaa21('0x24')]);_0x310d6f[_0xaa21('0x27')]=_[_0xaa21('0x26')](_0x1e91cc['query']);_0x310d6f[_0xaa21('0x3b')]=_[_0xaa21('0x28')](_0x310d6f[_0xaa21('0x25')],_0x310d6f[_0xaa21('0x27')]);_0x32e3b1[_0xaa21('0x29')]=_[_0xaa21('0x28')](_0x310d6f[_0xaa21('0x25')],qs['fields'](_0x1e91cc['query']['fields']));_0x32e3b1['attributes']=_0x32e3b1[_0xaa21('0x29')][_0xaa21('0x2b')]?_0x32e3b1[_0xaa21('0x29')]:_0x310d6f[_0xaa21('0x25')];if(_0x1e91cc[_0xaa21('0x27')][_0xaa21('0x38')]){_0x32e3b1[_0xaa21('0x3c')]=[{'all':!![]}];}_0x32e3b1=_[_0xaa21('0x32')]({},_0x32e3b1,_0x1e91cc[_0xaa21('0x37')]);return db[_0xaa21('0x23')][_0xaa21('0x3d')](_0x32e3b1)['then'](handleEntityNotFound(_0x549a61,null))[_0xaa21('0x1e')](respondWithResult(_0x549a61,null))[_0xaa21('0x3e')](handleError(_0x549a61,null));};exports[_0xaa21('0x3f')]=function(_0x23b8ee,_0x27a30a){return db[_0xaa21('0x23')][_0xaa21('0x3f')](_0x23b8ee[_0xaa21('0x40')],{})[_0xaa21('0x1e')](respondWithResult(_0x27a30a,0xc9))['catch'](handleError(_0x27a30a,null));};exports[_0xaa21('0x1c')]=function(_0x3bb487,_0x3d9785){if(_0x3bb487[_0xaa21('0x40')]['id']){delete _0x3bb487[_0xaa21('0x40')]['id'];}return db[_0xaa21('0x23')][_0xaa21('0x3d')]({'where':{'id':_0x3bb487[_0xaa21('0x3a')]['id']}})[_0xaa21('0x1e')](handleEntityNotFound(_0x3d9785,null))[_0xaa21('0x1e')](saveUpdates(_0x3bb487[_0xaa21('0x40')],null))[_0xaa21('0x1e')](respondWithResult(_0x3d9785,null))[_0xaa21('0x3e')](handleError(_0x3d9785,null));};exports[_0xaa21('0x1d')]=function(_0x34b1f5,_0x5f2a27){return db[_0xaa21('0x23')][_0xaa21('0x3d')]({'where':{'id':_0x34b1f5[_0xaa21('0x3a')]['id']}})[_0xaa21('0x1e')](handleEntityNotFound(_0x5f2a27,null))[_0xaa21('0x1e')](removeEntity(_0x5f2a27,null))[_0xaa21('0x3e')](handleError(_0x5f2a27,null));};exports[_0xaa21('0x41')]=function(_0x156f98,_0x1a361a){return db[_0xaa21('0x23')][_0xaa21('0x41')]()[_0xaa21('0x1e')](respondWithResult(_0x1a361a,null))[_0xaa21('0x3e')](handleError(_0x1a361a,null));}; \ No newline at end of file +var _0x7766=['length','includeAll','find','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','name','send','index','rawAttributes','model','keys','query','intersection','attributes','fields','nolimit','order','sort','filters','pick','filter','where','merge','map','key','VIRTUAL','field','options','include','JscriptyQuestionReport','findAll','rows','catch','params'];(function(_0x1deb5a,_0x2194f5){var _0x4fd163=function(_0x133f77){while(--_0x133f77){_0x1deb5a['push'](_0x1deb5a['shift']());}};_0x4fd163(++_0x2194f5);}(_0x7766,0x178));var _0x6776=function(_0x487476,_0x1f226c){_0x487476=_0x487476-0x0;var _0x4a41d1=_0x7766[_0x487476];return _0x4a41d1;};'use strict';var pdf=require(_0x6776('0x0'));var emlformat=require(_0x6776('0x1'));var rimraf=require(_0x6776('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6776('0x3'));var rp=require(_0x6776('0x4'));var moment=require(_0x6776('0x5'));var BPromise=require(_0x6776('0x6'));var Mustache=require(_0x6776('0x7'));var util=require(_0x6776('0x8'));var path=require(_0x6776('0x9'));var sox=require('sox');var csv=require(_0x6776('0xa'));var ejs=require(_0x6776('0xb'));var fs=require('fs');var _=require(_0x6776('0xc'));var squel=require(_0x6776('0xd'));var crypto=require(_0x6776('0xe'));var jsforce=require(_0x6776('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x6776('0xa'));var querystring=require('querystring');var Papa=require(_0x6776('0x10'));var Redis=require('ioredis');var authService=require(_0x6776('0x11'));var qs=require(_0x6776('0x12'));var hardwareService=require(_0x6776('0x13'));var logger=require(_0x6776('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x6776('0x15'));var db=require(_0x6776('0x16'))['db'];function respondWithStatusCode(_0x1f0eb7,_0x2b440a){_0x2b440a=_0x2b440a||0xcc;return function(_0x34ab4e){if(_0x34ab4e){return _0x1f0eb7[_0x6776('0x17')](_0x2b440a);}return _0x1f0eb7[_0x6776('0x18')](_0x2b440a)[_0x6776('0x19')]();};}function respondWithResult(_0xf8d8d6,_0x1a8045){_0x1a8045=_0x1a8045||0xc8;return function(_0x360564){if(_0x360564){return _0xf8d8d6['status'](_0x1a8045)[_0x6776('0x1a')](_0x360564);}};}function respondWithFilteredResult(_0xe74f60,_0x4342d8){return function(_0x150406){if(_0x150406){var _0x313b5d=_0x150406[_0x6776('0x1b')],_0xe10d65=_0x4342d8[_0x6776('0x1c')],_0x2a325f=_0x4342d8['offset']+_0x4342d8[_0x6776('0x1d')],_0xcb9cf4;if(_0x2a325f>=_0x313b5d){_0x2a325f=_0x313b5d;_0xcb9cf4=0xc8;}else{_0xcb9cf4=0xce;}_0xe74f60[_0x6776('0x18')](_0xcb9cf4);return _0xe74f60[_0x6776('0x1e')](_0x6776('0x1f'),_0xe10d65+'-'+_0x2a325f+'/'+_0x313b5d)['json'](_0x150406);}return null;};}function patchUpdates(_0x3d53f6){return function(_0x523607){try{jsonpatch[_0x6776('0x20')](_0x523607,_0x3d53f6,!![]);}catch(_0x4e167c){return BPromise[_0x6776('0x21')](_0x4e167c);}return _0x523607[_0x6776('0x22')]();};}function saveUpdates(_0xad509c,_0x2c5b9f){return function(_0x6d8743){if(_0x6d8743){return _0x6d8743[_0x6776('0x23')](_0xad509c)['then'](function(_0x30dfc1){return _0x30dfc1;});}return null;};}function removeEntity(_0xd5387b,_0x2e4527){return function(_0x4e1e99){if(_0x4e1e99){return _0x4e1e99[_0x6776('0x24')]()[_0x6776('0x25')](function(){_0xd5387b['status'](0xcc)[_0x6776('0x19')]();});}};}function handleEntityNotFound(_0x47420e,_0x503ef0){return function(_0x7ac223){if(!_0x7ac223){_0x47420e['sendStatus'](0x194);}return _0x7ac223;};}function handleError(_0x142b6b,_0x40a9d3){_0x40a9d3=_0x40a9d3||0x1f4;return function(_0x8dab18){logger[_0x6776('0x26')](_0x8dab18['stack']);if(_0x8dab18[_0x6776('0x27')]){delete _0x8dab18[_0x6776('0x27')];}_0x142b6b[_0x6776('0x18')](_0x40a9d3)[_0x6776('0x28')](_0x8dab18);};}exports[_0x6776('0x29')]=function(_0x25f047,_0x25814d){var _0x39fe96={},_0x517e2a={},_0x346f56={'count':0x0,'rows':[]};var _0x19b326=db['JscriptyQuestionReport'][_0x6776('0x2a')];_0x517e2a[_0x6776('0x2b')]=_[_0x6776('0x2c')](_0x19b326);_0x517e2a['query']=_[_0x6776('0x2c')](_0x25f047[_0x6776('0x2d')]);_0x517e2a['filters']=_[_0x6776('0x2e')](_0x517e2a[_0x6776('0x2b')],_0x517e2a['query']);_0x39fe96[_0x6776('0x2f')]=_[_0x6776('0x2e')](_0x517e2a['model'],qs[_0x6776('0x30')](_0x25f047[_0x6776('0x2d')][_0x6776('0x30')]));_0x39fe96[_0x6776('0x2f')]=_0x39fe96[_0x6776('0x2f')]['length']?_0x39fe96[_0x6776('0x2f')]:_0x517e2a['model'];if(!_0x25f047[_0x6776('0x2d')]['hasOwnProperty'](_0x6776('0x31'))){_0x39fe96[_0x6776('0x1d')]=qs[_0x6776('0x1d')](_0x25f047[_0x6776('0x2d')]['limit']);_0x39fe96[_0x6776('0x1c')]=qs[_0x6776('0x1c')](_0x25f047['query'][_0x6776('0x1c')]);}_0x39fe96[_0x6776('0x32')]=qs[_0x6776('0x33')](_0x25f047[_0x6776('0x2d')][_0x6776('0x33')]);_0x39fe96['where']=qs[_0x6776('0x34')](_[_0x6776('0x35')](_0x25f047[_0x6776('0x2d')],_0x517e2a[_0x6776('0x34')]));if(_0x25f047[_0x6776('0x2d')][_0x6776('0x36')]){_0x39fe96[_0x6776('0x37')]=_[_0x6776('0x38')](_0x39fe96['where'],{'$or':_[_0x6776('0x39')](_0x19b326,function(_0x1bd04e){if(_0x1bd04e['type'][_0x6776('0x3a')]!==_0x6776('0x3b')){var _0x5c40a7={};_0x5c40a7[_0x1bd04e[_0x6776('0x3c')]]={'$like':'%'+_0x25f047[_0x6776('0x2d')][_0x6776('0x36')]+'%'};return _0x5c40a7;}})});}_0x39fe96=_[_0x6776('0x38')]({},_0x39fe96,_0x25f047[_0x6776('0x3d')]);var _0x2784ac={'where':_0x39fe96[_0x6776('0x37')]};return db['JscriptyQuestionReport'][_0x6776('0x1b')](_0x2784ac)[_0x6776('0x25')](function(_0x579516){_0x346f56[_0x6776('0x1b')]=_0x579516;if(_0x25f047[_0x6776('0x2d')]['includeAll']){_0x39fe96[_0x6776('0x3e')]=[{'all':!![]}];}return db[_0x6776('0x3f')][_0x6776('0x40')](_0x39fe96);})[_0x6776('0x25')](function(_0x4bf70e){_0x346f56[_0x6776('0x41')]=_0x4bf70e;return _0x346f56;})[_0x6776('0x25')](respondWithFilteredResult(_0x25814d,_0x39fe96))[_0x6776('0x42')](handleError(_0x25814d,null));};exports['show']=function(_0x11f4ed,_0xd3a6b9){var _0x2fd44d={'raw':!![],'where':{'id':_0x11f4ed[_0x6776('0x43')]['id']}},_0x5b6aa3={};_0x5b6aa3[_0x6776('0x2b')]=_['keys'](db[_0x6776('0x3f')][_0x6776('0x2a')]);_0x5b6aa3['query']=_[_0x6776('0x2c')](_0x11f4ed['query']);_0x5b6aa3['filters']=_[_0x6776('0x2e')](_0x5b6aa3[_0x6776('0x2b')],_0x5b6aa3[_0x6776('0x2d')]);_0x2fd44d[_0x6776('0x2f')]=_['intersection'](_0x5b6aa3[_0x6776('0x2b')],qs[_0x6776('0x30')](_0x11f4ed[_0x6776('0x2d')]['fields']));_0x2fd44d[_0x6776('0x2f')]=_0x2fd44d['attributes'][_0x6776('0x44')]?_0x2fd44d[_0x6776('0x2f')]:_0x5b6aa3[_0x6776('0x2b')];if(_0x11f4ed[_0x6776('0x2d')][_0x6776('0x45')]){_0x2fd44d['include']=[{'all':!![]}];}_0x2fd44d=_[_0x6776('0x38')]({},_0x2fd44d,_0x11f4ed['options']);return db[_0x6776('0x3f')][_0x6776('0x46')](_0x2fd44d)[_0x6776('0x25')](handleEntityNotFound(_0xd3a6b9,null))[_0x6776('0x25')](respondWithResult(_0xd3a6b9,null))[_0x6776('0x42')](handleError(_0xd3a6b9,null));};exports[_0x6776('0x47')]=function(_0x184657,_0x48980f){return db[_0x6776('0x3f')][_0x6776('0x47')](_0x184657['body'],{})[_0x6776('0x25')](respondWithResult(_0x48980f,0xc9))[_0x6776('0x42')](handleError(_0x48980f,null));};exports[_0x6776('0x23')]=function(_0x2269b7,_0x1b9889){if(_0x2269b7[_0x6776('0x48')]['id']){delete _0x2269b7['body']['id'];}return db[_0x6776('0x3f')][_0x6776('0x46')]({'where':{'id':_0x2269b7[_0x6776('0x43')]['id']}})[_0x6776('0x25')](handleEntityNotFound(_0x1b9889,null))[_0x6776('0x25')](saveUpdates(_0x2269b7[_0x6776('0x48')],null))[_0x6776('0x25')](respondWithResult(_0x1b9889,null))[_0x6776('0x42')](handleError(_0x1b9889,null));};exports['destroy']=function(_0x367890,_0x1d8ce1){return db['JscriptyQuestionReport'][_0x6776('0x46')]({'where':{'id':_0x367890['params']['id']}})[_0x6776('0x25')](handleEntityNotFound(_0x1d8ce1,null))[_0x6776('0x25')](removeEntity(_0x1d8ce1,null))[_0x6776('0x42')](handleError(_0x1d8ce1,null));};exports[_0x6776('0x49')]=function(_0x155d87,_0x20d73c){return db[_0x6776('0x3f')][_0x6776('0x49')]()[_0x6776('0x25')](respondWithResult(_0x20d73c,null))[_0x6776('0x42')](handleError(_0x20d73c,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 860c1d9..fef6dba 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 _0x89df=['path','rimraf','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1d3a4d,_0x7a4edb){var _0x122e3d=function(_0x80daaa){while(--_0x80daaa){_0x1d3a4d['push'](_0x1d3a4d['shift']());}};_0x122e3d(++_0x7a4edb);}(_0x89df,0x13b));var _0xf89d=function(_0x1912b4,_0x6b0f63){_0x1912b4=_0x1912b4-0x0;var _0x47492a=_0x89df[_0x1912b4];return _0x47492a;};'use strict';var _=require(_0xf89d('0x0'));var util=require(_0xf89d('0x1'));var logger=require(_0xf89d('0x2'))(_0xf89d('0x3'));var moment=require(_0xf89d('0x4'));var BPromise=require(_0xf89d('0x5'));var rp=require(_0xf89d('0x6'));var fs=require('fs');var path=require(_0xf89d('0x7'));var rimraf=require(_0xf89d('0x8'));var config=require('../../config/environment');var attributes=require(_0xf89d('0x9'));module[_0xf89d('0xa')]=function(_0x376dd8,_0x38f4fb){return _0x376dd8[_0xf89d('0xb')](_0xf89d('0xc'),attributes,{'tableName':_0xf89d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4999=['util','../../config/logger','api','moment','bluebird','request-promise','path','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','lodash'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x4999,0xb3));var _0x9499=function(_0xbe48c2,_0x3db103){_0xbe48c2=_0xbe48c2-0x0;var _0x39a679=_0x4999[_0xbe48c2];return _0x39a679;};'use strict';var _=require(_0x9499('0x0'));var util=require(_0x9499('0x1'));var logger=require(_0x9499('0x2'))(_0x9499('0x3'));var moment=require(_0x9499('0x4'));var BPromise=require(_0x9499('0x5'));var rp=require(_0x9499('0x6'));var fs=require('fs');var path=require(_0x9499('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9499('0x8'));module[_0x9499('0x9')]=function(_0x5ca617,_0x2d4fb0){return _0x5ca617[_0x9499('0xa')](_0x9499('0xb'),attributes,{'tableName':'report_jscripty_questions','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 125453c..45e747e 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 _0x95ea=['util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','JscriptyQuestionReport,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x8a52c8,_0x2df399){var _0x3ab22d=function(_0x245c87){while(--_0x245c87){_0x8a52c8['push'](_0x8a52c8['shift']());}};_0x3ab22d(++_0x2df399);}(_0x95ea,0x1b8));var _0xa95e=function(_0x18a436,_0x1dbe06){_0x18a436=_0x18a436-0x0;var _0x5c2cf8=_0x95ea[_0x18a436];return _0x5c2cf8;};'use strict';var _=require(_0xa95e('0x0'));var util=require(_0xa95e('0x1'));var moment=require(_0xa95e('0x2'));var BPromise=require(_0xa95e('0x3'));var rs=require(_0xa95e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa95e('0x5'))(_0xa95e('0x6'));var config=require(_0xa95e('0x7'));var jayson=require(_0xa95e('0x8'));var client=jayson['client'][_0xa95e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ab0b1,_0x1cdecd,_0x298eba){return new BPromise(function(_0x7daa1b,_0x5cd0d0){return client[_0xa95e('0xa')](_0x1ab0b1,_0x298eba)['then'](function(_0x1c61ca){logger[_0xa95e('0xb')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x1cdecd,_0xa95e('0xc'));logger[_0xa95e('0xd')](_0xa95e('0xe'),_0x1cdecd,'request\x20sent',JSON[_0xa95e('0xf')](_0x1c61ca));if(_0x1c61ca[_0xa95e('0x10')]){if(_0x1c61ca['error']['code']===0x1f4){logger[_0xa95e('0x10')](_0xa95e('0x11'),_0x1cdecd,_0x1c61ca[_0xa95e('0x10')][_0xa95e('0x12')]);return _0x5cd0d0(_0x1c61ca[_0xa95e('0x10')]['message']);}logger['error'](_0xa95e('0x11'),_0x1cdecd,_0x1c61ca['error'][_0xa95e('0x12')]);return _0x7daa1b(_0x1c61ca[_0xa95e('0x10')][_0xa95e('0x12')]);}else{logger[_0xa95e('0xb')](_0xa95e('0x11'),_0x1cdecd,_0xa95e('0xc'));_0x7daa1b(_0x1c61ca[_0xa95e('0x13')]['message']);}})[_0xa95e('0x14')](function(_0x3bafbe){logger[_0xa95e('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x1cdecd,_0x3bafbe);_0x5cd0d0(_0x3bafbe);});});} \ No newline at end of file +var _0x9374=['JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0x9374,0x197));var _0x4937=function(_0x4a9433,_0x5337cb){_0x4a9433=_0x4a9433-0x0;var _0x434947=_0x9374[_0x4a9433];return _0x434947;};'use strict';var _=require(_0x4937('0x0'));var util=require(_0x4937('0x1'));var moment=require(_0x4937('0x2'));var BPromise=require(_0x4937('0x3'));var rs=require(_0x4937('0x4'));var fs=require('fs');var Redis=require(_0x4937('0x5'));var db=require(_0x4937('0x6'))['db'];var utils=require(_0x4937('0x7'));var logger=require(_0x4937('0x8'))(_0x4937('0x9'));var config=require(_0x4937('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4937('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3e93f3,_0x3acd48,_0x5d6a48){return new BPromise(function(_0x2256e0,_0x4a7803){return client[_0x4937('0xc')](_0x3e93f3,_0x5d6a48)[_0x4937('0xd')](function(_0x37b582){logger[_0x4937('0xe')](_0x4937('0xf'),_0x3acd48,_0x4937('0x10'));logger[_0x4937('0x11')](_0x4937('0x12'),_0x3acd48,_0x4937('0x10'),JSON[_0x4937('0x13')](_0x37b582));if(_0x37b582['error']){if(_0x37b582['error'][_0x4937('0x14')]===0x1f4){logger[_0x4937('0x15')](_0x4937('0xf'),_0x3acd48,_0x37b582[_0x4937('0x15')]['message']);return _0x4a7803(_0x37b582[_0x4937('0x15')][_0x4937('0x16')]);}logger['error'](_0x4937('0xf'),_0x3acd48,_0x37b582[_0x4937('0x15')][_0x4937('0x16')]);return _0x2256e0(_0x37b582[_0x4937('0x15')][_0x4937('0x16')]);}else{logger[_0x4937('0xe')](_0x4937('0xf'),_0x3acd48,_0x4937('0x10'));_0x2256e0(_0x37b582[_0x4937('0x17')][_0x4937('0x16')]);}})[_0x4937('0x18')](function(_0x4dd023){logger[_0x4937('0x15')](_0x4937('0xf'),_0x3acd48,_0x4dd023);_0x4a7803(_0x4dd023);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 6aa8361..40d9001 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 _0x0093=['create','put','destroy','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','isAuthenticated','index','get','/:id','show','/:id/questions','getQuestions','post'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x0093,0x76));var _0x3009=function(_0x7057a1,_0x217467){_0x7057a1=_0x7057a1-0x0;var _0x258eea=_0x0093[_0x7057a1];return _0x258eea;};'use strict';var multer=require(_0x3009('0x0'));var util=require(_0x3009('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3009('0x2')]();var auth=require(_0x3009('0x3'));var interaction=require(_0x3009('0x4'));var config=require(_0x3009('0x5'));var controller=require(_0x3009('0x6'));router['get']('/',auth[_0x3009('0x7')](),controller[_0x3009('0x8')]);router[_0x3009('0x9')]('/describe',auth[_0x3009('0x7')](),controller['describe']);router[_0x3009('0x9')](_0x3009('0xa'),auth[_0x3009('0x7')](),controller[_0x3009('0xb')]);router[_0x3009('0x9')](_0x3009('0xc'),auth[_0x3009('0x7')](),controller[_0x3009('0xd')]);router[_0x3009('0xe')]('/',auth[_0x3009('0x7')](),controller[_0x3009('0xf')]);router[_0x3009('0x10')](_0x3009('0xa'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x3009('0x7')](),controller[_0x3009('0x11')]);module[_0x3009('0x12')]=router; \ No newline at end of file +var _0x9e45=['get','describe','show','create','put','update','/:id','exports','util','connect-timeout','express','Router','../../components/interaction/service','./jscriptySessionReport.controller','isAuthenticated','index'];(function(_0x45806b,_0x53eeae){var _0x3e228e=function(_0x3ee031){while(--_0x3ee031){_0x45806b['push'](_0x45806b['shift']());}};_0x3e228e(++_0x53eeae);}(_0x9e45,0x188));var _0x59e4=function(_0x46c865,_0x154b2f){_0x46c865=_0x46c865-0x0;var _0x200973=_0x9e45[_0x46c865];return _0x200973;};'use strict';var multer=require('multer');var util=require(_0x59e4('0x0'));var path=require('path');var timeout=require(_0x59e4('0x1'));var express=require(_0x59e4('0x2'));var router=express[_0x59e4('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x59e4('0x4'));var config=require('../../config/environment');var controller=require(_0x59e4('0x5'));router['get']('/',auth[_0x59e4('0x6')](),controller[_0x59e4('0x7')]);router[_0x59e4('0x8')]('/describe',auth[_0x59e4('0x6')](),controller[_0x59e4('0x9')]);router[_0x59e4('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x59e4('0xa')]);router[_0x59e4('0x8')]('/:id/questions',auth[_0x59e4('0x6')](),controller['getQuestions']);router['post']('/',auth[_0x59e4('0x6')](),controller[_0x59e4('0xb')]);router[_0x59e4('0xc')]('/:id',auth[_0x59e4('0x6')](),controller[_0x59e4('0xd')]);router['delete'](_0x59e4('0xe'),auth[_0x59e4('0x6')](),controller['destroy']);module[_0x59e4('0xf')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 7bd81bb..b4c845b 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 _0x745d=['endtime','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','sequelize','exports','DATE','setDataValue'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0x745d,0xa4));var _0xd745=function(_0x4e8345,_0x2d83f5){_0x4e8345=_0x4e8345-0x0;var _0x32b5c3=_0x745d[_0x4e8345];return _0x32b5c3;};'use strict';var moment=require('moment');var Sequelize=require(_0xd745('0x0'));module[_0xd745('0x1')]={'starttime':{'type':Sequelize[_0xd745('0x2')],'set':function(_0x5af042){this[_0xd745('0x3')]('starttime',_0x5af042);this[_0xd745('0x3')](_0xd745('0x4'),moment()['format'](_0xd745('0x5')));}},'endtime':{'type':Sequelize[_0xd745('0x2')]},'membername':{'type':Sequelize[_0xd745('0x6')]},'projectname':{'type':Sequelize[_0xd745('0x6')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xd745('0x6')]},'calleridname':{'type':Sequelize[_0xd745('0x6')]},'calleridnum':{'type':Sequelize[_0xd745('0x6')]},'completed':{'type':Sequelize[_0xd745('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0xb248=['DATE','setDataValue','endtime','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','exports'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0xb248,0xc6));var _0x8b24=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0xb248[_0x550d12];return _0x12103d;};'use strict';var moment=require(_0x8b24('0x0'));var Sequelize=require('sequelize');module[_0x8b24('0x1')]={'starttime':{'type':Sequelize[_0x8b24('0x2')],'set':function(_0x3c4dbd){this[_0x8b24('0x3')]('starttime',_0x3c4dbd);this[_0x8b24('0x3')](_0x8b24('0x4'),moment()['format'](_0x8b24('0x5')));}},'endtime':{'type':Sequelize[_0x8b24('0x2')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x8b24('0x6')]},'queue':{'type':Sequelize[_0x8b24('0x6')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x8b24('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x8b24('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 8f06fc3..d11124b 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 _0x8bc6=['desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','update','destroy','error','stack','name','send','index','JscriptySessionReport','rawAttributes','keys','query','intersection','attributes','model','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','map','type','key','VIRTUAL','field','options','then','includeAll','include','findAll','rows','show','params','fields','find','catch','create','body','describe','findOne','JscriptyQuestionReport','order','SessionId','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce'];(function(_0x495636,_0x21f7c2){var _0x1b1ba3=function(_0x2b4516){while(--_0x2b4516){_0x495636['push'](_0x495636['shift']());}};_0x1b1ba3(++_0x21f7c2);}(_0x8bc6,0x137));var _0x68bc=function(_0x5a5a88,_0x5d0b5b){_0x5a5a88=_0x5a5a88-0x0;var _0x2c7efb=_0x8bc6[_0x5a5a88];return _0x2c7efb;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x68bc('0x0'));var jsonpatch=require(_0x68bc('0x1'));var rp=require(_0x68bc('0x2'));var moment=require(_0x68bc('0x3'));var BPromise=require(_0x68bc('0x4'));var Mustache=require(_0x68bc('0x5'));var util=require(_0x68bc('0x6'));var path=require(_0x68bc('0x7'));var sox=require(_0x68bc('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x68bc('0x9'));var squel=require(_0x68bc('0xa'));var crypto=require(_0x68bc('0xb'));var jsforce=require(_0x68bc('0xc'));var deskjs=require(_0x68bc('0xd'));var toCsv=require(_0x68bc('0xe'));var querystring=require('querystring');var Papa=require(_0x68bc('0xf'));var Redis=require(_0x68bc('0x10'));var authService=require(_0x68bc('0x11'));var qs=require(_0x68bc('0x12'));var hardwareService=require(_0x68bc('0x13'));var logger=require(_0x68bc('0x14'))(_0x68bc('0x15'));var utils=require(_0x68bc('0x16'));var config=require(_0x68bc('0x17'));var db=require(_0x68bc('0x18'))['db'];function respondWithStatusCode(_0x452b06,_0x2c5b64){_0x2c5b64=_0x2c5b64||0xcc;return function(_0xf66af0){if(_0xf66af0){return _0x452b06[_0x68bc('0x19')](_0x2c5b64);}return _0x452b06[_0x68bc('0x1a')](_0x2c5b64)[_0x68bc('0x1b')]();};}function respondWithResult(_0x486f2f,_0xf7d9cb){_0xf7d9cb=_0xf7d9cb||0xc8;return function(_0xb2f8cc){if(_0xb2f8cc){return _0x486f2f['status'](_0xf7d9cb)[_0x68bc('0x1c')](_0xb2f8cc);}};}function respondWithFilteredResult(_0x20c52e,_0x19c73d){return function(_0x877cfb){if(_0x877cfb){var _0x2c8fe4=_0x877cfb[_0x68bc('0x1d')],_0x1cdb15=_0x19c73d[_0x68bc('0x1e')],_0x55abbe=_0x19c73d[_0x68bc('0x1e')]+_0x19c73d[_0x68bc('0x1f')],_0x59921d;if(_0x55abbe>=_0x2c8fe4){_0x55abbe=_0x2c8fe4;_0x59921d=0xc8;}else{_0x59921d=0xce;}_0x20c52e[_0x68bc('0x1a')](_0x59921d);return _0x20c52e[_0x68bc('0x20')](_0x68bc('0x21'),_0x1cdb15+'-'+_0x55abbe+'/'+_0x2c8fe4)[_0x68bc('0x1c')](_0x877cfb);}return null;};}function patchUpdates(_0x571cae){return function(_0x2246c6){try{jsonpatch['apply'](_0x2246c6,_0x571cae,!![]);}catch(_0x1dc0ef){return BPromise['reject'](_0x1dc0ef);}return _0x2246c6[_0x68bc('0x22')]();};}function saveUpdates(_0x3d808c,_0x394bac){return function(_0x5ed8f4){if(_0x5ed8f4){return _0x5ed8f4[_0x68bc('0x23')](_0x3d808c)['then'](function(_0x1b8026){return _0x1b8026;});}return null;};}function removeEntity(_0x29b333,_0x327f3e){return function(_0x1811ef){if(_0x1811ef){return _0x1811ef[_0x68bc('0x24')]()['then'](function(){_0x29b333[_0x68bc('0x1a')](0xcc)[_0x68bc('0x1b')]();});}};}function handleEntityNotFound(_0x3d38b1,_0x5d568a){return function(_0x39670f){if(!_0x39670f){_0x3d38b1[_0x68bc('0x19')](0x194);}return _0x39670f;};}function handleError(_0x98bb6,_0x58f1fd){_0x58f1fd=_0x58f1fd||0x1f4;return function(_0x177d28){logger[_0x68bc('0x25')](_0x177d28[_0x68bc('0x26')]);if(_0x177d28[_0x68bc('0x27')]){delete _0x177d28['name'];}_0x98bb6[_0x68bc('0x1a')](_0x58f1fd)[_0x68bc('0x28')](_0x177d28);};}exports[_0x68bc('0x29')]=function(_0xd36cd0,_0x2447c4){var _0x13d8a4={},_0x36cddb={},_0x2fef09={'count':0x0,'rows':[]};var _0x44edc7=db[_0x68bc('0x2a')][_0x68bc('0x2b')];_0x36cddb['model']=_[_0x68bc('0x2c')](_0x44edc7);_0x36cddb[_0x68bc('0x2d')]=_[_0x68bc('0x2c')](_0xd36cd0['query']);_0x36cddb['filters']=_[_0x68bc('0x2e')](_0x36cddb['model'],_0x36cddb[_0x68bc('0x2d')]);_0x13d8a4[_0x68bc('0x2f')]=_[_0x68bc('0x2e')](_0x36cddb[_0x68bc('0x30')],qs['fields'](_0xd36cd0['query']['fields']));_0x13d8a4[_0x68bc('0x2f')]=_0x13d8a4['attributes'][_0x68bc('0x31')]?_0x13d8a4[_0x68bc('0x2f')]:_0x36cddb['model'];if(!_0xd36cd0['query'][_0x68bc('0x32')](_0x68bc('0x33'))){_0x13d8a4[_0x68bc('0x1f')]=qs['limit'](_0xd36cd0[_0x68bc('0x2d')][_0x68bc('0x1f')]);_0x13d8a4['offset']=qs['offset'](_0xd36cd0[_0x68bc('0x2d')][_0x68bc('0x1e')]);}_0x13d8a4['order']=qs[_0x68bc('0x34')](_0xd36cd0[_0x68bc('0x2d')][_0x68bc('0x34')]);_0x13d8a4[_0x68bc('0x35')]=qs['filters'](_[_0x68bc('0x36')](_0xd36cd0['query'],_0x36cddb[_0x68bc('0x37')]));if(_0xd36cd0[_0x68bc('0x2d')][_0x68bc('0x38')]){_0x13d8a4['where']=_[_0x68bc('0x39')](_0x13d8a4[_0x68bc('0x35')],{'$or':_[_0x68bc('0x3a')](_0x44edc7,function(_0x4d4392){if(_0x4d4392[_0x68bc('0x3b')][_0x68bc('0x3c')]!==_0x68bc('0x3d')){var _0x2302b1={};_0x2302b1[_0x4d4392[_0x68bc('0x3e')]]={'$like':'%'+_0xd36cd0[_0x68bc('0x2d')]['filter']+'%'};return _0x2302b1;}})});}_0x13d8a4=_[_0x68bc('0x39')]({},_0x13d8a4,_0xd36cd0[_0x68bc('0x3f')]);var _0x5d15c4={'where':_0x13d8a4[_0x68bc('0x35')]};return db[_0x68bc('0x2a')]['count'](_0x5d15c4)[_0x68bc('0x40')](function(_0x1367b8){_0x2fef09[_0x68bc('0x1d')]=_0x1367b8;if(_0xd36cd0[_0x68bc('0x2d')][_0x68bc('0x41')]){_0x13d8a4[_0x68bc('0x42')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x68bc('0x43')](_0x13d8a4);})['then'](function(_0x19ece2){_0x2fef09[_0x68bc('0x44')]=_0x19ece2;return _0x2fef09;})[_0x68bc('0x40')](respondWithFilteredResult(_0x2447c4,_0x13d8a4))['catch'](handleError(_0x2447c4,null));};exports[_0x68bc('0x45')]=function(_0x26d2a,_0x5ddc01){var _0x16f111={'raw':!![],'where':{'id':_0x26d2a[_0x68bc('0x46')]['id']}},_0x4f0795={};_0x4f0795[_0x68bc('0x30')]=_['keys'](db[_0x68bc('0x2a')][_0x68bc('0x2b')]);_0x4f0795[_0x68bc('0x2d')]=_[_0x68bc('0x2c')](_0x26d2a[_0x68bc('0x2d')]);_0x4f0795[_0x68bc('0x37')]=_[_0x68bc('0x2e')](_0x4f0795[_0x68bc('0x30')],_0x4f0795[_0x68bc('0x2d')]);_0x16f111[_0x68bc('0x2f')]=_[_0x68bc('0x2e')](_0x4f0795[_0x68bc('0x30')],qs[_0x68bc('0x47')](_0x26d2a[_0x68bc('0x2d')]['fields']));_0x16f111['attributes']=_0x16f111[_0x68bc('0x2f')][_0x68bc('0x31')]?_0x16f111[_0x68bc('0x2f')]:_0x4f0795[_0x68bc('0x30')];if(_0x26d2a[_0x68bc('0x2d')][_0x68bc('0x41')]){_0x16f111['include']=[{'all':!![]}];}_0x16f111=_[_0x68bc('0x39')]({},_0x16f111,_0x26d2a[_0x68bc('0x3f')]);return db[_0x68bc('0x2a')][_0x68bc('0x48')](_0x16f111)[_0x68bc('0x40')](handleEntityNotFound(_0x5ddc01,null))['then'](respondWithResult(_0x5ddc01,null))[_0x68bc('0x49')](handleError(_0x5ddc01,null));};exports[_0x68bc('0x4a')]=function(_0x219b73,_0x38ca4c){return db[_0x68bc('0x2a')][_0x68bc('0x4a')](_0x219b73['body'],{})['then'](respondWithResult(_0x38ca4c,0xc9))[_0x68bc('0x49')](handleError(_0x38ca4c,null));};exports[_0x68bc('0x23')]=function(_0x48849b,_0x5605ed){if(_0x48849b['body']['id']){delete _0x48849b[_0x68bc('0x4b')]['id'];}return db[_0x68bc('0x2a')]['find']({'where':{'id':_0x48849b[_0x68bc('0x46')]['id']}})['then'](handleEntityNotFound(_0x5605ed,null))[_0x68bc('0x40')](saveUpdates(_0x48849b['body'],null))['then'](respondWithResult(_0x5605ed,null))['catch'](handleError(_0x5605ed,null));};exports[_0x68bc('0x24')]=function(_0x235db4,_0xb3ca8f){return db[_0x68bc('0x2a')][_0x68bc('0x48')]({'where':{'id':_0x235db4['params']['id']}})['then'](handleEntityNotFound(_0xb3ca8f,null))[_0x68bc('0x40')](removeEntity(_0xb3ca8f,null))['catch'](handleError(_0xb3ca8f,null));};exports['describe']=function(_0x42674e,_0x5925d7){return db[_0x68bc('0x2a')][_0x68bc('0x4c')]()['then'](respondWithResult(_0x5925d7,null))['catch'](handleError(_0x5925d7,null));};exports['getQuestions']=function(_0x1583ae,_0x23acc1,_0x563a01){var _0x4855bf={'raw':!![],'where':{}};var _0x3ffb76={};var _0x50487b={'count':0x0,'rows':[]};return db[_0x68bc('0x2a')][_0x68bc('0x4d')]({'where':{'id':_0x1583ae[_0x68bc('0x46')]['id']}})[_0x68bc('0x40')](handleEntityNotFound(_0x23acc1,null))[_0x68bc('0x40')](function(_0x7e8600){if(_0x7e8600){_0x3ffb76['model']=_[_0x68bc('0x2c')](db[_0x68bc('0x4e')][_0x68bc('0x2b')]);_0x3ffb76[_0x68bc('0x2d')]=_[_0x68bc('0x2c')](_0x1583ae[_0x68bc('0x2d')]);_0x3ffb76['filters']=_[_0x68bc('0x2e')](_0x3ffb76[_0x68bc('0x30')],_0x3ffb76[_0x68bc('0x2d')]);_0x4855bf[_0x68bc('0x2f')]=_['intersection'](_0x3ffb76['model'],qs['fields'](_0x1583ae[_0x68bc('0x2d')]['fields']));_0x4855bf[_0x68bc('0x2f')]=_0x4855bf[_0x68bc('0x2f')][_0x68bc('0x31')]?_0x4855bf[_0x68bc('0x2f')]:_0x3ffb76['model'];if(!_0x1583ae[_0x68bc('0x2d')][_0x68bc('0x32')](_0x68bc('0x33'))){_0x4855bf[_0x68bc('0x1f')]=qs['limit'](_0x1583ae['query']['limit']);_0x4855bf[_0x68bc('0x1e')]=qs[_0x68bc('0x1e')](_0x1583ae[_0x68bc('0x2d')]['offset']);}_0x4855bf[_0x68bc('0x4f')]=qs[_0x68bc('0x34')](_0x1583ae['query']['sort']);_0x4855bf[_0x68bc('0x35')]=qs['filters'](_['pick'](_0x1583ae[_0x68bc('0x2d')],_0x3ffb76[_0x68bc('0x37')]));_0x4855bf['where'][_0x68bc('0x50')]=_0x7e8600['id'];if(_0x1583ae['query']['filter']){_0x4855bf[_0x68bc('0x35')]=_['merge'](_0x4855bf[_0x68bc('0x35')],{'$or':_[_0x68bc('0x3a')](_0x4855bf[_0x68bc('0x2f')],function(_0x2a1557){var _0x497ae1={};_0x497ae1[_0x2a1557]={'$like':'%'+_0x1583ae['query']['filter']+'%'};return _0x497ae1;})});}_0x4855bf=_[_0x68bc('0x39')]({},_0x4855bf,_0x1583ae[_0x68bc('0x3f')]);return db[_0x68bc('0x4e')][_0x68bc('0x1d')]({'where':_0x4855bf['where']})[_0x68bc('0x40')](function(_0x255f00){_0x50487b[_0x68bc('0x1d')]=_0x255f00;if(_0x1583ae['query'][_0x68bc('0x41')]){_0x4855bf[_0x68bc('0x42')]=[{'all':!![]}];}return db[_0x68bc('0x4e')]['findAll'](_0x4855bf);})[_0x68bc('0x40')](function(_0x577ee6){_0x50487b['rows']=_0x577ee6;return _0x50487b;});}})[_0x68bc('0x40')](respondWithFilteredResult(_0x23acc1,_0x4855bf))[_0x68bc('0x49')](handleError(_0x23acc1,null));}; \ No newline at end of file +var _0x03b4=['map','JscriptyQuestionReport','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../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','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','type','key','VIRTUAL','filter','merge','options','JscriptySessionReport','includeAll','include','findAll','rows','catch','params','create','body','find','getQuestions','findOne','SessionId'];(function(_0x420746,_0x26dd66){var _0x1c6de2=function(_0x1162d7){while(--_0x1162d7){_0x420746['push'](_0x420746['shift']());}};_0x1c6de2(++_0x26dd66);}(_0x03b4,0x192));var _0x403b=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x03b4[_0x3ab51d];return _0x29a04e;};'use strict';var pdf=require(_0x403b('0x0'));var emlformat=require(_0x403b('0x1'));var rimraf=require(_0x403b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x403b('0x3'));var moment=require('moment');var BPromise=require(_0x403b('0x4'));var Mustache=require(_0x403b('0x5'));var util=require(_0x403b('0x6'));var path=require(_0x403b('0x7'));var sox=require(_0x403b('0x8'));var csv=require(_0x403b('0x9'));var ejs=require(_0x403b('0xa'));var fs=require('fs');var _=require(_0x403b('0xb'));var squel=require(_0x403b('0xc'));var crypto=require(_0x403b('0xd'));var jsforce=require(_0x403b('0xe'));var deskjs=require(_0x403b('0xf'));var toCsv=require(_0x403b('0x9'));var querystring=require('querystring');var Papa=require(_0x403b('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x403b('0x11'));var hardwareService=require(_0x403b('0x12'));var logger=require(_0x403b('0x13'))(_0x403b('0x14'));var utils=require(_0x403b('0x15'));var config=require(_0x403b('0x16'));var db=require(_0x403b('0x17'))['db'];function respondWithStatusCode(_0x4de452,_0x4eca92){_0x4eca92=_0x4eca92||0xcc;return function(_0x30e112){if(_0x30e112){return _0x4de452['sendStatus'](_0x4eca92);}return _0x4de452[_0x403b('0x18')](_0x4eca92)[_0x403b('0x19')]();};}function respondWithResult(_0x5445b1,_0x531b40){_0x531b40=_0x531b40||0xc8;return function(_0x1688c3){if(_0x1688c3){return _0x5445b1['status'](_0x531b40)[_0x403b('0x1a')](_0x1688c3);}};}function respondWithFilteredResult(_0x40a268,_0x260c47){return function(_0x2daef2){if(_0x2daef2){var _0x18565e=_0x2daef2[_0x403b('0x1b')],_0x57490a=_0x260c47[_0x403b('0x1c')],_0x4b41f8=_0x260c47['offset']+_0x260c47['limit'],_0x3f6618;if(_0x4b41f8>=_0x18565e){_0x4b41f8=_0x18565e;_0x3f6618=0xc8;}else{_0x3f6618=0xce;}_0x40a268[_0x403b('0x18')](_0x3f6618);return _0x40a268[_0x403b('0x1d')](_0x403b('0x1e'),_0x57490a+'-'+_0x4b41f8+'/'+_0x18565e)[_0x403b('0x1a')](_0x2daef2);}return null;};}function patchUpdates(_0x479e13){return function(_0x57daf3){try{jsonpatch[_0x403b('0x1f')](_0x57daf3,_0x479e13,!![]);}catch(_0x4a0c5a){return BPromise[_0x403b('0x20')](_0x4a0c5a);}return _0x57daf3[_0x403b('0x21')]();};}function saveUpdates(_0x470318,_0x4a1ede){return function(_0x4737f){if(_0x4737f){return _0x4737f[_0x403b('0x22')](_0x470318)[_0x403b('0x23')](function(_0x15a251){return _0x15a251;});}return null;};}function removeEntity(_0x2e7429,_0x1687dd){return function(_0x387195){if(_0x387195){return _0x387195[_0x403b('0x24')]()['then'](function(){_0x2e7429[_0x403b('0x18')](0xcc)[_0x403b('0x19')]();});}};}function handleEntityNotFound(_0x198d8d,_0x20e6d8){return function(_0x2183d2){if(!_0x2183d2){_0x198d8d[_0x403b('0x25')](0x194);}return _0x2183d2;};}function handleError(_0x3ec397,_0x33332f){_0x33332f=_0x33332f||0x1f4;return function(_0x147ddd){logger[_0x403b('0x26')](_0x147ddd[_0x403b('0x27')]);if(_0x147ddd['name']){delete _0x147ddd[_0x403b('0x28')];}_0x3ec397[_0x403b('0x18')](_0x33332f)[_0x403b('0x29')](_0x147ddd);};}exports[_0x403b('0x2a')]=function(_0x12a076,_0x2a3eac){var _0x2eeac9={},_0x555b1e={},_0x75e579={'count':0x0,'rows':[]};var _0x213eb2=db['JscriptySessionReport'][_0x403b('0x2b')];_0x555b1e[_0x403b('0x2c')]=_[_0x403b('0x2d')](_0x213eb2);_0x555b1e[_0x403b('0x2e')]=_['keys'](_0x12a076['query']);_0x555b1e[_0x403b('0x2f')]=_[_0x403b('0x30')](_0x555b1e[_0x403b('0x2c')],_0x555b1e[_0x403b('0x2e')]);_0x2eeac9[_0x403b('0x31')]=_[_0x403b('0x30')](_0x555b1e[_0x403b('0x2c')],qs[_0x403b('0x32')](_0x12a076[_0x403b('0x2e')][_0x403b('0x32')]));_0x2eeac9['attributes']=_0x2eeac9[_0x403b('0x31')][_0x403b('0x33')]?_0x2eeac9['attributes']:_0x555b1e[_0x403b('0x2c')];if(!_0x12a076[_0x403b('0x2e')][_0x403b('0x34')](_0x403b('0x35'))){_0x2eeac9[_0x403b('0x36')]=qs[_0x403b('0x36')](_0x12a076[_0x403b('0x2e')][_0x403b('0x36')]);_0x2eeac9['offset']=qs[_0x403b('0x1c')](_0x12a076['query'][_0x403b('0x1c')]);}_0x2eeac9[_0x403b('0x37')]=qs['sort'](_0x12a076[_0x403b('0x2e')][_0x403b('0x38')]);_0x2eeac9[_0x403b('0x39')]=qs[_0x403b('0x2f')](_[_0x403b('0x3a')](_0x12a076[_0x403b('0x2e')],_0x555b1e[_0x403b('0x2f')]));if(_0x12a076[_0x403b('0x2e')]['filter']){_0x2eeac9[_0x403b('0x39')]=_['merge'](_0x2eeac9[_0x403b('0x39')],{'$or':_['map'](_0x213eb2,function(_0x36f58a){if(_0x36f58a[_0x403b('0x3b')][_0x403b('0x3c')]!==_0x403b('0x3d')){var _0x4a715d={};_0x4a715d[_0x36f58a['field']]={'$like':'%'+_0x12a076[_0x403b('0x2e')][_0x403b('0x3e')]+'%'};return _0x4a715d;}})});}_0x2eeac9=_[_0x403b('0x3f')]({},_0x2eeac9,_0x12a076[_0x403b('0x40')]);var _0x8ea33a={'where':_0x2eeac9[_0x403b('0x39')]};return db[_0x403b('0x41')][_0x403b('0x1b')](_0x8ea33a)[_0x403b('0x23')](function(_0x38e9dc){_0x75e579[_0x403b('0x1b')]=_0x38e9dc;if(_0x12a076[_0x403b('0x2e')][_0x403b('0x42')]){_0x2eeac9[_0x403b('0x43')]=[{'all':!![]}];}return db[_0x403b('0x41')][_0x403b('0x44')](_0x2eeac9);})[_0x403b('0x23')](function(_0xfa7450){_0x75e579[_0x403b('0x45')]=_0xfa7450;return _0x75e579;})['then'](respondWithFilteredResult(_0x2a3eac,_0x2eeac9))[_0x403b('0x46')](handleError(_0x2a3eac,null));};exports['show']=function(_0x469c29,_0x34b2af){var _0x37a9ba={'raw':!![],'where':{'id':_0x469c29[_0x403b('0x47')]['id']}},_0x1615e4={};_0x1615e4['model']=_['keys'](db[_0x403b('0x41')][_0x403b('0x2b')]);_0x1615e4['query']=_[_0x403b('0x2d')](_0x469c29[_0x403b('0x2e')]);_0x1615e4[_0x403b('0x2f')]=_[_0x403b('0x30')](_0x1615e4[_0x403b('0x2c')],_0x1615e4['query']);_0x37a9ba[_0x403b('0x31')]=_[_0x403b('0x30')](_0x1615e4[_0x403b('0x2c')],qs[_0x403b('0x32')](_0x469c29[_0x403b('0x2e')][_0x403b('0x32')]));_0x37a9ba[_0x403b('0x31')]=_0x37a9ba['attributes']['length']?_0x37a9ba[_0x403b('0x31')]:_0x1615e4[_0x403b('0x2c')];if(_0x469c29[_0x403b('0x2e')]['includeAll']){_0x37a9ba[_0x403b('0x43')]=[{'all':!![]}];}_0x37a9ba=_[_0x403b('0x3f')]({},_0x37a9ba,_0x469c29['options']);return db['JscriptySessionReport']['find'](_0x37a9ba)[_0x403b('0x23')](handleEntityNotFound(_0x34b2af,null))[_0x403b('0x23')](respondWithResult(_0x34b2af,null))[_0x403b('0x46')](handleError(_0x34b2af,null));};exports['create']=function(_0x56b58e,_0x470ff3){return db[_0x403b('0x41')][_0x403b('0x48')](_0x56b58e['body'],{})['then'](respondWithResult(_0x470ff3,0xc9))['catch'](handleError(_0x470ff3,null));};exports['update']=function(_0x10f429,_0x124f0c){if(_0x10f429[_0x403b('0x49')]['id']){delete _0x10f429['body']['id'];}return db[_0x403b('0x41')][_0x403b('0x4a')]({'where':{'id':_0x10f429[_0x403b('0x47')]['id']}})[_0x403b('0x23')](handleEntityNotFound(_0x124f0c,null))[_0x403b('0x23')](saveUpdates(_0x10f429[_0x403b('0x49')],null))[_0x403b('0x23')](respondWithResult(_0x124f0c,null))[_0x403b('0x46')](handleError(_0x124f0c,null));};exports[_0x403b('0x24')]=function(_0x5c604c,_0x2faa18){return db[_0x403b('0x41')][_0x403b('0x4a')]({'where':{'id':_0x5c604c[_0x403b('0x47')]['id']}})[_0x403b('0x23')](handleEntityNotFound(_0x2faa18,null))['then'](removeEntity(_0x2faa18,null))[_0x403b('0x46')](handleError(_0x2faa18,null));};exports['describe']=function(_0x133646,_0x48247a){return db[_0x403b('0x41')]['describe']()[_0x403b('0x23')](respondWithResult(_0x48247a,null))[_0x403b('0x46')](handleError(_0x48247a,null));};exports[_0x403b('0x4b')]=function(_0x2e5569,_0x225b64,_0x1eb2a7){var _0x9bc72={'raw':!![],'where':{}};var _0x85e6ee={};var _0x158def={'count':0x0,'rows':[]};return db[_0x403b('0x41')][_0x403b('0x4c')]({'where':{'id':_0x2e5569[_0x403b('0x47')]['id']}})[_0x403b('0x23')](handleEntityNotFound(_0x225b64,null))[_0x403b('0x23')](function(_0xcfa80){if(_0xcfa80){_0x85e6ee['model']=_[_0x403b('0x2d')](db['JscriptyQuestionReport']['rawAttributes']);_0x85e6ee['query']=_['keys'](_0x2e5569[_0x403b('0x2e')]);_0x85e6ee[_0x403b('0x2f')]=_[_0x403b('0x30')](_0x85e6ee[_0x403b('0x2c')],_0x85e6ee[_0x403b('0x2e')]);_0x9bc72[_0x403b('0x31')]=_[_0x403b('0x30')](_0x85e6ee[_0x403b('0x2c')],qs[_0x403b('0x32')](_0x2e5569[_0x403b('0x2e')]['fields']));_0x9bc72['attributes']=_0x9bc72[_0x403b('0x31')][_0x403b('0x33')]?_0x9bc72[_0x403b('0x31')]:_0x85e6ee[_0x403b('0x2c')];if(!_0x2e5569['query'][_0x403b('0x34')](_0x403b('0x35'))){_0x9bc72[_0x403b('0x36')]=qs[_0x403b('0x36')](_0x2e5569[_0x403b('0x2e')][_0x403b('0x36')]);_0x9bc72[_0x403b('0x1c')]=qs[_0x403b('0x1c')](_0x2e5569['query'][_0x403b('0x1c')]);}_0x9bc72[_0x403b('0x37')]=qs[_0x403b('0x38')](_0x2e5569[_0x403b('0x2e')]['sort']);_0x9bc72[_0x403b('0x39')]=qs[_0x403b('0x2f')](_[_0x403b('0x3a')](_0x2e5569[_0x403b('0x2e')],_0x85e6ee[_0x403b('0x2f')]));_0x9bc72[_0x403b('0x39')][_0x403b('0x4d')]=_0xcfa80['id'];if(_0x2e5569[_0x403b('0x2e')][_0x403b('0x3e')]){_0x9bc72[_0x403b('0x39')]=_[_0x403b('0x3f')](_0x9bc72[_0x403b('0x39')],{'$or':_[_0x403b('0x4e')](_0x9bc72['attributes'],function(_0x3faeb4){var _0x2f6578={};_0x2f6578[_0x3faeb4]={'$like':'%'+_0x2e5569[_0x403b('0x2e')][_0x403b('0x3e')]+'%'};return _0x2f6578;})});}_0x9bc72=_[_0x403b('0x3f')]({},_0x9bc72,_0x2e5569[_0x403b('0x40')]);return db[_0x403b('0x4f')][_0x403b('0x1b')]({'where':_0x9bc72[_0x403b('0x39')]})['then'](function(_0x4337d1){_0x158def[_0x403b('0x1b')]=_0x4337d1;if(_0x2e5569[_0x403b('0x2e')]['includeAll']){_0x9bc72[_0x403b('0x43')]=[{'all':!![]}];}return db[_0x403b('0x4f')][_0x403b('0x44')](_0x9bc72);})['then'](function(_0x58e9eb){_0x158def[_0x403b('0x45')]=_0x58e9eb;return _0x158def;});}})[_0x403b('0x23')](respondWithFilteredResult(_0x225b64,_0x9bc72))[_0x403b('0x46')](handleError(_0x225b64,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index a807767..c1dacf0 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 _0x8760=['define','JscriptySessionReport','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./jscriptySessionReport.attributes'];(function(_0x11771e,_0x2e4f5b){var _0x52c0d6=function(_0x2cf693){while(--_0x2cf693){_0x11771e['push'](_0x11771e['shift']());}};_0x52c0d6(++_0x2e4f5b);}(_0x8760,0x17e));var _0x0876=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x8760[_0x3635ce];return _0x97ecd0;};'use strict';var _=require('lodash');var util=require(_0x0876('0x0'));var logger=require(_0x0876('0x1'))('api');var moment=require(_0x0876('0x2'));var BPromise=require(_0x0876('0x3'));var rp=require(_0x0876('0x4'));var fs=require('fs');var path=require(_0x0876('0x5'));var rimraf=require(_0x0876('0x6'));var config=require('../../config/environment');var attributes=require(_0x0876('0x7'));module['exports']=function(_0x14edc3,_0x3af04c){return _0x14edc3[_0x0876('0x8')](_0x0876('0x9'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0d71=['./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5ca66b,_0xae3ad2){var _0x1af478=function(_0x34fd9a){while(--_0x34fd9a){_0x5ca66b['push'](_0x5ca66b['shift']());}};_0x1af478(++_0xae3ad2);}(_0x0d71,0x1b7));var _0x10d7=function(_0x1a13fc,_0x2ae35c){_0x1a13fc=_0x1a13fc-0x0;var _0x285b99=_0x0d71[_0x1a13fc];return _0x285b99;};'use strict';var _=require(_0x10d7('0x0'));var util=require(_0x10d7('0x1'));var logger=require(_0x10d7('0x2'))('api');var moment=require(_0x10d7('0x3'));var BPromise=require(_0x10d7('0x4'));var rp=require(_0x10d7('0x5'));var fs=require('fs');var path=require(_0x10d7('0x6'));var rimraf=require(_0x10d7('0x7'));var config=require(_0x10d7('0x8'));var attributes=require(_0x10d7('0x9'));module[_0x10d7('0xa')]=function(_0x48c10a,_0x2625bd){return _0x48c10a[_0x10d7('0xb')](_0x10d7('0xc'),attributes,{'tableName':_0x10d7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index fc76c00..7cf4d1c 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 _0xc9c3=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','JscriptySessionReport,\x20%s,\x20%s','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','moment','randomstring'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc9c3,0x96));var _0x3c9c=function(_0x13295e,_0xb726f6){_0x13295e=_0x13295e-0x0;var _0x31bec8=_0xc9c3[_0x13295e];return _0x31bec8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3c9c('0x0'));var BPromise=require('bluebird');var rs=require(_0x3c9c('0x1'));var fs=require('fs');var Redis=require(_0x3c9c('0x2'));var db=require(_0x3c9c('0x3'))['db'];var utils=require(_0x3c9c('0x4'));var logger=require(_0x3c9c('0x5'))(_0x3c9c('0x6'));var config=require(_0x3c9c('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5a2836,_0x3ca0ce,_0xc35e75){return new BPromise(function(_0x2eb946,_0x3e5ccb){return client[_0x3c9c('0x8')](_0x5a2836,_0xc35e75)[_0x3c9c('0x9')](function(_0x302ab7){logger[_0x3c9c('0xa')](_0x3c9c('0xb'),_0x3ca0ce,'request\x20sent');logger[_0x3c9c('0xc')](_0x3c9c('0xd'),_0x3ca0ce,'request\x20sent',JSON[_0x3c9c('0xe')](_0x302ab7));if(_0x302ab7['error']){if(_0x302ab7[_0x3c9c('0xf')][_0x3c9c('0x10')]===0x1f4){logger[_0x3c9c('0xf')](_0x3c9c('0xb'),_0x3ca0ce,_0x302ab7['error']['message']);return _0x3e5ccb(_0x302ab7['error'][_0x3c9c('0x11')]);}logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x3ca0ce,_0x302ab7['error'][_0x3c9c('0x11')]);return _0x2eb946(_0x302ab7['error'][_0x3c9c('0x11')]);}else{logger[_0x3c9c('0xa')](_0x3c9c('0xb'),_0x3ca0ce,_0x3c9c('0x12'));_0x2eb946(_0x302ab7['result'][_0x3c9c('0x11')]);}})['catch'](function(_0x558101){logger['error'](_0x3c9c('0xb'),_0x3ca0ce,_0x558101);_0x3e5ccb(_0x558101);});});} \ No newline at end of file +var _0xbccd=['lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','JscriptySessionReport,\x20%s,\x20%s','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch'];(function(_0x1767d2,_0x3f7131){var _0x41646d=function(_0x26bd06){while(--_0x26bd06){_0x1767d2['push'](_0x1767d2['shift']());}};_0x41646d(++_0x3f7131);}(_0xbccd,0x1b0));var _0xdbcc=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xbccd[_0x1e7b16];return _0x37fadc;};'use strict';var _=require(_0xdbcc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xdbcc('0x1'));var rs=require(_0xdbcc('0x2'));var fs=require('fs');var Redis=require(_0xdbcc('0x3'));var db=require(_0xdbcc('0x4'))['db'];var utils=require(_0xdbcc('0x5'));var logger=require(_0xdbcc('0x6'))('rpc');var config=require(_0xdbcc('0x7'));var jayson=require(_0xdbcc('0x8'));var client=jayson[_0xdbcc('0x9')][_0xdbcc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7fe600,_0xf05e4a,_0x216289){return new BPromise(function(_0x22d783,_0x3124c7){return client[_0xdbcc('0xb')](_0x7fe600,_0x216289)[_0xdbcc('0xc')](function(_0x54f5ee){logger['info'](_0xdbcc('0xd'),_0xf05e4a,'request\x20sent');logger[_0xdbcc('0xe')](_0xdbcc('0xf'),_0xf05e4a,_0xdbcc('0x10'),JSON[_0xdbcc('0x11')](_0x54f5ee));if(_0x54f5ee[_0xdbcc('0x12')]){if(_0x54f5ee[_0xdbcc('0x12')][_0xdbcc('0x13')]===0x1f4){logger['error'](_0xdbcc('0xd'),_0xf05e4a,_0x54f5ee['error']['message']);return _0x3124c7(_0x54f5ee['error'][_0xdbcc('0x14')]);}logger[_0xdbcc('0x12')](_0xdbcc('0xd'),_0xf05e4a,_0x54f5ee[_0xdbcc('0x12')][_0xdbcc('0x14')]);return _0x22d783(_0x54f5ee[_0xdbcc('0x12')][_0xdbcc('0x14')]);}else{logger[_0xdbcc('0x15')]('JscriptySessionReport,\x20%s,\x20%s',_0xf05e4a,'request\x20sent');_0x22d783(_0x54f5ee[_0xdbcc('0x16')][_0xdbcc('0x14')]);}})[_0xdbcc('0x17')](function(_0x255aa2){logger[_0xdbcc('0x12')](_0xdbcc('0xd'),_0xf05e4a,_0x255aa2);_0x3124c7(_0x255aa2);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 54f696f..183e3be 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 _0x9f0b=['isAuthenticated','update','connect-timeout','express','Router','../../components/auth/service','./license.controller','get','index','put','/:id'];(function(_0x5d31f3,_0x4239b0){var _0x1cc88c=function(_0x1be8fc){while(--_0x1be8fc){_0x5d31f3['push'](_0x5d31f3['shift']());}};_0x1cc88c(++_0x4239b0);}(_0x9f0b,0x65));var _0xb9f0=function(_0x55ff79,_0x3d45e7){_0x55ff79=_0x55ff79-0x0;var _0x579067=_0x9f0b[_0x55ff79];return _0x579067;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb9f0('0x0'));var express=require(_0xb9f0('0x1'));var router=express[_0xb9f0('0x2')]();var auth=require(_0xb9f0('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb9f0('0x4'));router[_0xb9f0('0x5')]('/',controller[_0xb9f0('0x6')]);router[_0xb9f0('0x7')](_0xb9f0('0x8'),auth[_0xb9f0('0x9')](),controller[_0xb9f0('0xa')]);module['exports']=router; \ No newline at end of file +var _0xece7=['index','put','update','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xece7,0xad));var _0x7ece=function(_0x13bea0,_0x210a0c){_0x13bea0=_0x13bea0-0x0;var _0x3f12df=_0xece7[_0x13bea0];return _0x3f12df;};'use strict';var multer=require('multer');var util=require(_0x7ece('0x0'));var path=require(_0x7ece('0x1'));var timeout=require(_0x7ece('0x2'));var express=require(_0x7ece('0x3'));var router=express[_0x7ece('0x4')]();var auth=require(_0x7ece('0x5'));var interaction=require(_0x7ece('0x6'));var config=require(_0x7ece('0x7'));var controller=require(_0x7ece('0x8'));router['get']('/',controller[_0x7ece('0x9')]);router[_0x7ece('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x7ece('0xb')]);module[_0x7ece('0xc')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 4c0871d..f86e1b3 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 _0x978f=['exports','TEXT','STRING','INTEGER','sequelize'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x978f,0x1d5));var _0xf978=function(_0x1cfd93,_0x2e5014){_0x1cfd93=_0x1cfd93-0x0;var _0x361d75=_0x978f[_0x1cfd93];return _0x361d75;};'use strict';var Sequelize=require(_0xf978('0x0'));module[_0xf978('0x1')]={'license':{'type':Sequelize[_0xf978('0x2')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xf978('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0xf978('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc443=['exports','TEXT','STRING','INTEGER','sequelize'];(function(_0x288904,_0x355bcc){var _0x3b33cb=function(_0x1729ce){while(--_0x1729ce){_0x288904['push'](_0x288904['shift']());}};_0x3b33cb(++_0x355bcc);}(_0xc443,0x9a));var _0x3c44=function(_0x4f80b8,_0x8e0e20){_0x4f80b8=_0x4f80b8-0x0;var _0xa52e55=_0xc443[_0x4f80b8];return _0xa52e55;};'use strict';var Sequelize=require(_0x3c44('0x0'));module[_0x3c44('0x1')]={'license':{'type':Sequelize[_0x3c44('0x2')]},'data1':{'type':Sequelize[_0x3c44('0x3')]},'data2':{'type':Sequelize[_0x3c44('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x3c44('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 95122ba..179b150 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 _0x0183=['demo','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','offset','set','Content-Range','json','apply','reject','update','then','end','error','stack','name','send','../../config/license/util','index','model','keys','License','query','filters','intersection','attributes','fields','length','merge','options','getLicense','catch','body','find','params','checkLicense','key'];(function(_0xc526d9,_0x1a944c){var _0x101274=function(_0x348dca){while(--_0x348dca){_0xc526d9['push'](_0xc526d9['shift']());}};_0x101274(++_0x1a944c);}(_0x0183,0x1e1));var _0x3018=function(_0x54b637,_0x53af68){_0x54b637=_0x54b637-0x0;var _0x522f8f=_0x0183[_0x54b637];return _0x522f8f;};'use strict';var pdf=require(_0x3018('0x0'));var emlformat=require(_0x3018('0x1'));var rimraf=require(_0x3018('0x2'));var zipdir=require(_0x3018('0x3'));var jsonpatch=require(_0x3018('0x4'));var rp=require(_0x3018('0x5'));var moment=require(_0x3018('0x6'));var BPromise=require(_0x3018('0x7'));var Mustache=require(_0x3018('0x8'));var util=require(_0x3018('0x9'));var path=require(_0x3018('0xa'));var sox=require('sox');var csv=require(_0x3018('0xb'));var ejs=require(_0x3018('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3018('0xd'));var crypto=require(_0x3018('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x3018('0xf'));var toCsv=require(_0x3018('0xb'));var querystring=require('querystring');var Papa=require(_0x3018('0x10'));var Redis=require(_0x3018('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x3018('0x12'));var hardwareService=require(_0x3018('0x13'));var logger=require(_0x3018('0x14'))(_0x3018('0x15'));var utils=require('../../config/utils');var config=require(_0x3018('0x16'));var db=require(_0x3018('0x17'))['db'];function respondWithStatusCode(_0x103735,_0x3ca159){_0x3ca159=_0x3ca159||0xcc;return function(_0xb2bd0e){if(_0xb2bd0e){return _0x103735[_0x3018('0x18')](_0x3ca159);}return _0x103735[_0x3018('0x19')](_0x3ca159)['end']();};}function respondWithResult(_0x18ca68,_0x16b1ed){_0x16b1ed=_0x16b1ed||0xc8;return function(_0x289127){if(_0x289127){return _0x18ca68[_0x3018('0x19')](_0x16b1ed)['json'](_0x289127);}};}function respondWithFilteredResult(_0x47b333,_0xd45f2d){return function(_0x3d17b1){if(_0x3d17b1){var _0x4d3fcf=_0x3d17b1['count'],_0x472545=_0xd45f2d[_0x3018('0x1a')],_0x29bbff=_0xd45f2d[_0x3018('0x1a')]+_0xd45f2d['limit'],_0x26bb82;if(_0x29bbff>=_0x4d3fcf){_0x29bbff=_0x4d3fcf;_0x26bb82=0xc8;}else{_0x26bb82=0xce;}_0x47b333[_0x3018('0x19')](_0x26bb82);return _0x47b333[_0x3018('0x1b')](_0x3018('0x1c'),_0x472545+'-'+_0x29bbff+'/'+_0x4d3fcf)[_0x3018('0x1d')](_0x3d17b1);}return null;};}function patchUpdates(_0x7e17b){return function(_0x1843a7){try{jsonpatch[_0x3018('0x1e')](_0x1843a7,_0x7e17b,!![]);}catch(_0x2c73ac){return BPromise[_0x3018('0x1f')](_0x2c73ac);}return _0x1843a7['save']();};}function saveUpdates(_0x297266,_0x30f794){return function(_0x390214){if(_0x390214){return _0x390214[_0x3018('0x20')](_0x297266)[_0x3018('0x21')](function(_0x51099e){return _0x51099e;});}return null;};}function removeEntity(_0x5b016d,_0x53ee7d){return function(_0x5f48aa){if(_0x5f48aa){return _0x5f48aa['destroy']()[_0x3018('0x21')](function(){_0x5b016d[_0x3018('0x19')](0xcc)[_0x3018('0x22')]();});}};}function handleEntityNotFound(_0x30534e,_0x5f2f3c){return function(_0x448da9){if(!_0x448da9){_0x30534e[_0x3018('0x18')](0x194);}return _0x448da9;};}function handleError(_0x1549b5,_0x51b133){_0x51b133=_0x51b133||0x1f4;return function(_0x3ab4de){logger[_0x3018('0x23')](_0x3ab4de[_0x3018('0x24')]);if(_0x3ab4de[_0x3018('0x25')]){delete _0x3ab4de[_0x3018('0x25')];}_0x1549b5[_0x3018('0x19')](_0x51b133)[_0x3018('0x26')](_0x3ab4de);};}var utilLicense=require(_0x3018('0x27'));exports[_0x3018('0x28')]=function(_0x4812a6,_0x58f96f){var _0x1de896={'raw':!![],'where':{'id':0x1}},_0x260fdb={};_0x260fdb[_0x3018('0x29')]=_[_0x3018('0x2a')](db[_0x3018('0x2b')]['rawAttributes']);_0x260fdb[_0x3018('0x2c')]=_[_0x3018('0x2a')](_0x4812a6[_0x3018('0x2c')]);_0x260fdb[_0x3018('0x2d')]=_[_0x3018('0x2e')](_0x260fdb[_0x3018('0x29')],_0x260fdb[_0x3018('0x2c')]);_0x1de896[_0x3018('0x2f')]=_[_0x3018('0x2e')](_0x260fdb[_0x3018('0x29')],qs[_0x3018('0x30')](_0x4812a6[_0x3018('0x2c')][_0x3018('0x30')]));_0x1de896['attributes']=_0x1de896[_0x3018('0x2f')][_0x3018('0x31')]?_0x1de896[_0x3018('0x2f')]:_0x260fdb['model'];_0x1de896=_[_0x3018('0x32')]({},_0x1de896,_0x4812a6[_0x3018('0x33')]);return utilLicense[_0x3018('0x34')](_0x1de896)[_0x3018('0x21')](respondWithResult(_0x58f96f,null))[_0x3018('0x35')](handleError(_0x58f96f,null));};exports[_0x3018('0x20')]=function(_0x1e9d73,_0x18d8d3){if(_0x1e9d73[_0x3018('0x36')]['id']){delete _0x1e9d73['body']['id'];}return db[_0x3018('0x2b')][_0x3018('0x37')]({'where':{'id':_0x1e9d73[_0x3018('0x38')]['id']}})[_0x3018('0x21')](handleEntityNotFound(_0x18d8d3,null))[_0x3018('0x21')](function(_0x41efed){var _0x1c7a94=_0x41efed['get']({'plain':!![]});return utilLicense[_0x3018('0x39')](_0x1c7a94,_0x1e9d73[_0x3018('0x36')][_0x3018('0x3a')]);})[_0x3018('0x21')](function(_0x4ab8aa){if(!_0x4ab8aa[_0x3018('0x3b')]){return saveUpdates(_0x1e9d73[_0x3018('0x36')],null);}return _0x4ab8aa;})['then'](respondWithResult(_0x18d8d3,null))[_0x3018('0x35')](handleError(_0x18d8d3,null));}; \ No newline at end of file +var _0x48e3=['find','params','get','checkLicense','key','html-pdf','eml-format','zip-dir','moment','bluebird','mustache','util','sox','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','reject','save','update','then','destroy','error','stack','name','send','../../config/license/util','index','model','keys','License','rawAttributes','query','intersection','attributes','fields','length','getLicense','catch','body'];(function(_0x42609a,_0x3a5d03){var _0x26c358=function(_0x10d67e){while(--_0x10d67e){_0x42609a['push'](_0x42609a['shift']());}};_0x26c358(++_0x3a5d03);}(_0x48e3,0xe9));var _0x348e=function(_0xa9f096,_0x25d872){_0xa9f096=_0xa9f096-0x0;var _0x3b030e=_0x48e3[_0xa9f096];return _0x3b030e;};'use strict';var pdf=require(_0x348e('0x0'));var emlformat=require(_0x348e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x348e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x348e('0x3'));var BPromise=require(_0x348e('0x4'));var Mustache=require(_0x348e('0x5'));var util=require(_0x348e('0x6'));var path=require('path');var sox=require(_0x348e('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x348e('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x348e('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x348e('0xa'));var querystring=require(_0x348e('0xb'));var Papa=require(_0x348e('0xc'));var Redis=require(_0x348e('0xd'));var authService=require(_0x348e('0xe'));var qs=require(_0x348e('0xf'));var hardwareService=require(_0x348e('0x10'));var logger=require(_0x348e('0x11'))(_0x348e('0x12'));var utils=require(_0x348e('0x13'));var config=require(_0x348e('0x14'));var db=require(_0x348e('0x15'))['db'];function respondWithStatusCode(_0x44baba,_0x2a0c13){_0x2a0c13=_0x2a0c13||0xcc;return function(_0x57c341){if(_0x57c341){return _0x44baba[_0x348e('0x16')](_0x2a0c13);}return _0x44baba[_0x348e('0x17')](_0x2a0c13)[_0x348e('0x18')]();};}function respondWithResult(_0x52266d,_0x297861){_0x297861=_0x297861||0xc8;return function(_0x3031ee){if(_0x3031ee){return _0x52266d[_0x348e('0x17')](_0x297861)[_0x348e('0x19')](_0x3031ee);}};}function respondWithFilteredResult(_0x4763fb,_0x4b1d53){return function(_0x5169aa){if(_0x5169aa){var _0x718b84=_0x5169aa['count'],_0x9cf0b8=_0x4b1d53[_0x348e('0x1a')],_0x1f9e74=_0x4b1d53['offset']+_0x4b1d53[_0x348e('0x1b')],_0x24bb95;if(_0x1f9e74>=_0x718b84){_0x1f9e74=_0x718b84;_0x24bb95=0xc8;}else{_0x24bb95=0xce;}_0x4763fb[_0x348e('0x17')](_0x24bb95);return _0x4763fb[_0x348e('0x1c')]('Content-Range',_0x9cf0b8+'-'+_0x1f9e74+'/'+_0x718b84)[_0x348e('0x19')](_0x5169aa);}return null;};}function patchUpdates(_0x548e17){return function(_0x579857){try{jsonpatch['apply'](_0x579857,_0x548e17,!![]);}catch(_0x5eca68){return BPromise[_0x348e('0x1d')](_0x5eca68);}return _0x579857[_0x348e('0x1e')]();};}function saveUpdates(_0x33c5c0,_0x366bee){return function(_0x3a5907){if(_0x3a5907){return _0x3a5907[_0x348e('0x1f')](_0x33c5c0)[_0x348e('0x20')](function(_0x5c631d){return _0x5c631d;});}return null;};}function removeEntity(_0x59e9dd,_0x1d85f1){return function(_0x33600d){if(_0x33600d){return _0x33600d[_0x348e('0x21')]()[_0x348e('0x20')](function(){_0x59e9dd['status'](0xcc)[_0x348e('0x18')]();});}};}function handleEntityNotFound(_0x45c4a9,_0x1c0caa){return function(_0x4a5a84){if(!_0x4a5a84){_0x45c4a9[_0x348e('0x16')](0x194);}return _0x4a5a84;};}function handleError(_0x1bc43b,_0x41bb67){_0x41bb67=_0x41bb67||0x1f4;return function(_0x4b06d0){logger[_0x348e('0x22')](_0x4b06d0[_0x348e('0x23')]);if(_0x4b06d0[_0x348e('0x24')]){delete _0x4b06d0['name'];}_0x1bc43b[_0x348e('0x17')](_0x41bb67)[_0x348e('0x25')](_0x4b06d0);};}var utilLicense=require(_0x348e('0x26'));exports[_0x348e('0x27')]=function(_0x5cc4bb,_0x1de341){var _0x16f0ee={'raw':!![],'where':{'id':0x1}},_0x13eabb={};_0x13eabb[_0x348e('0x28')]=_[_0x348e('0x29')](db[_0x348e('0x2a')][_0x348e('0x2b')]);_0x13eabb['query']=_[_0x348e('0x29')](_0x5cc4bb[_0x348e('0x2c')]);_0x13eabb['filters']=_[_0x348e('0x2d')](_0x13eabb[_0x348e('0x28')],_0x13eabb['query']);_0x16f0ee[_0x348e('0x2e')]=_[_0x348e('0x2d')](_0x13eabb['model'],qs[_0x348e('0x2f')](_0x5cc4bb[_0x348e('0x2c')][_0x348e('0x2f')]));_0x16f0ee[_0x348e('0x2e')]=_0x16f0ee[_0x348e('0x2e')][_0x348e('0x30')]?_0x16f0ee[_0x348e('0x2e')]:_0x13eabb['model'];_0x16f0ee=_['merge']({},_0x16f0ee,_0x5cc4bb['options']);return utilLicense[_0x348e('0x31')](_0x16f0ee)[_0x348e('0x20')](respondWithResult(_0x1de341,null))[_0x348e('0x32')](handleError(_0x1de341,null));};exports['update']=function(_0x4043b6,_0x519aa8){if(_0x4043b6['body']['id']){delete _0x4043b6[_0x348e('0x33')]['id'];}return db[_0x348e('0x2a')][_0x348e('0x34')]({'where':{'id':_0x4043b6[_0x348e('0x35')]['id']}})['then'](handleEntityNotFound(_0x519aa8,null))[_0x348e('0x20')](function(_0x32c9b6){var _0x1742f9=_0x32c9b6[_0x348e('0x36')]({'plain':!![]});return utilLicense[_0x348e('0x37')](_0x1742f9,_0x4043b6[_0x348e('0x33')][_0x348e('0x38')]);})[_0x348e('0x20')](function(_0x4a9a2b){if(!_0x4a9a2b['demo']){return saveUpdates(_0x4043b6[_0x348e('0x33')],null);}return _0x4a9a2b;})[_0x348e('0x20')](respondWithResult(_0x519aa8,null))[_0x348e('0x32')](handleError(_0x519aa8,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 33bd156..d323da8 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 _0x58a7=['bluebird','request-promise','path','../../config/environment','./license.attributes','exports','License','lodash','util','../../config/logger','api','moment'];(function(_0x25a0b9,_0x86e28f){var _0x30b9ab=function(_0x883a4){while(--_0x883a4){_0x25a0b9['push'](_0x25a0b9['shift']());}};_0x30b9ab(++_0x86e28f);}(_0x58a7,0xf7));var _0x758a=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x58a7[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x758a('0x0'));var util=require(_0x758a('0x1'));var logger=require(_0x758a('0x2'))(_0x758a('0x3'));var moment=require(_0x758a('0x4'));var BPromise=require(_0x758a('0x5'));var rp=require(_0x758a('0x6'));var fs=require('fs');var path=require(_0x758a('0x7'));var rimraf=require('rimraf');var config=require(_0x758a('0x8'));var attributes=require(_0x758a('0x9'));module[_0x758a('0xa')]=function(_0x294cf3,_0x5a34af){return _0x294cf3['define'](_0x758a('0xb'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbee3=['define','License','license','util','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0xbee3,0xd5));var _0x3bee=function(_0x5a4913,_0xb31c08){_0x5a4913=_0x5a4913-0x0;var _0x175969=_0xbee3[_0x5a4913];return _0x175969;};'use strict';var _=require('lodash');var util=require(_0x3bee('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x3bee('0x1'));var BPromise=require(_0x3bee('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3bee('0x3'));var rimraf=require(_0x3bee('0x4'));var config=require(_0x3bee('0x5'));var attributes=require('./license.attributes');module[_0x3bee('0x6')]=function(_0x3baf77,_0x4c5ef5){return _0x3baf77[_0x3bee('0x7')](_0x3bee('0x8'),attributes,{'tableName':_0x3bee('0x9'),'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 5b212a8..bfff0ab 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 _0x3c64=['error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x594119,_0x3e4153){var _0x2986ec=function(_0x4c91a9){while(--_0x4c91a9){_0x594119['push'](_0x594119['shift']());}};_0x2986ec(++_0x3e4153);}(_0x3c64,0x1e7));var _0x43c6=function(_0x2f1e33,_0x3b6dac){_0x2f1e33=_0x2f1e33-0x0;var _0x36732d=_0x3c64[_0x2f1e33];return _0x36732d;};'use strict';var _=require(_0x43c6('0x0'));var util=require(_0x43c6('0x1'));var moment=require('moment');var BPromise=require(_0x43c6('0x2'));var rs=require(_0x43c6('0x3'));var fs=require('fs');var Redis=require(_0x43c6('0x4'));var db=require(_0x43c6('0x5'))['db'];var utils=require(_0x43c6('0x6'));var logger=require(_0x43c6('0x7'))('rpc');var config=require(_0x43c6('0x8'));var jayson=require(_0x43c6('0x9'));var client=jayson[_0x43c6('0xa')][_0x43c6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x46e775,_0x41095e,_0x4223a6){return new BPromise(function(_0x1ad53c,_0x33a9b7){return client['request'](_0x46e775,_0x4223a6)[_0x43c6('0xc')](function(_0x34d971){logger[_0x43c6('0xd')](_0x43c6('0xe'),_0x41095e,'request\x20sent');logger[_0x43c6('0xf')](_0x43c6('0x10'),_0x41095e,_0x43c6('0x11'),JSON[_0x43c6('0x12')](_0x34d971));if(_0x34d971[_0x43c6('0x13')]){if(_0x34d971[_0x43c6('0x13')][_0x43c6('0x14')]===0x1f4){logger[_0x43c6('0x13')]('License,\x20%s,\x20%s',_0x41095e,_0x34d971[_0x43c6('0x13')][_0x43c6('0x15')]);return _0x33a9b7(_0x34d971[_0x43c6('0x13')][_0x43c6('0x15')]);}logger[_0x43c6('0x13')](_0x43c6('0xe'),_0x41095e,_0x34d971[_0x43c6('0x13')][_0x43c6('0x15')]);return _0x1ad53c(_0x34d971[_0x43c6('0x13')][_0x43c6('0x15')]);}else{logger[_0x43c6('0xd')](_0x43c6('0xe'),_0x41095e,'request\x20sent');_0x1ad53c(_0x34d971['result'][_0x43c6('0x15')]);}})[_0x43c6('0x16')](function(_0x17cc50){logger[_0x43c6('0x13')](_0x43c6('0xe'),_0x41095e,_0x17cc50);_0x33a9b7(_0x17cc50);});});} \ No newline at end of file +var _0xe52e=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x301bb2,_0xc4169c){var _0x51b5ec=function(_0x3e36e7){while(--_0x3e36e7){_0x301bb2['push'](_0x301bb2['shift']());}};_0x51b5ec(++_0xc4169c);}(_0xe52e,0x1c4));var _0xee52=function(_0x409deb,_0x2b731){_0x409deb=_0x409deb-0x0;var _0x15a4f7=_0xe52e[_0x409deb];return _0x15a4f7;};'use strict';var _=require(_0xee52('0x0'));var util=require(_0xee52('0x1'));var moment=require(_0xee52('0x2'));var BPromise=require(_0xee52('0x3'));var rs=require(_0xee52('0x4'));var fs=require('fs');var Redis=require(_0xee52('0x5'));var db=require(_0xee52('0x6'))['db'];var utils=require(_0xee52('0x7'));var logger=require(_0xee52('0x8'))(_0xee52('0x9'));var config=require(_0xee52('0xa'));var jayson=require(_0xee52('0xb'));var client=jayson[_0xee52('0xc')][_0xee52('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3097a6,_0x16eeb7,_0x4dcb9e){return new BPromise(function(_0x10ccea,_0xb59e6e){return client[_0xee52('0xe')](_0x3097a6,_0x4dcb9e)[_0xee52('0xf')](function(_0x35d7b2){logger[_0xee52('0x10')](_0xee52('0x11'),_0x16eeb7,_0xee52('0x12'));logger['debug'](_0xee52('0x13'),_0x16eeb7,_0xee52('0x12'),JSON[_0xee52('0x14')](_0x35d7b2));if(_0x35d7b2[_0xee52('0x15')]){if(_0x35d7b2[_0xee52('0x15')][_0xee52('0x16')]===0x1f4){logger[_0xee52('0x15')](_0xee52('0x11'),_0x16eeb7,_0x35d7b2['error'][_0xee52('0x17')]);return _0xb59e6e(_0x35d7b2[_0xee52('0x15')][_0xee52('0x17')]);}logger[_0xee52('0x15')](_0xee52('0x11'),_0x16eeb7,_0x35d7b2[_0xee52('0x15')][_0xee52('0x17')]);return _0x10ccea(_0x35d7b2['error']['message']);}else{logger[_0xee52('0x10')](_0xee52('0x11'),_0x16eeb7,_0xee52('0x12'));_0x10ccea(_0x35d7b2['result']['message']);}})[_0xee52('0x18')](function(_0x2247a2){logger[_0xee52('0x15')](_0xee52('0x11'),_0x16eeb7,_0x2247a2);_0xb59e6e(_0x2247a2);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 2101eb8..1351fa4 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 _0x2ac2=['removeSmtp','destroy','removeAgents','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/in_servers','/:id/out_servers','getSmtp','/:id/interactions','/:id/applications','getMessages','verifySmtp','/:id/users','post','addDisposition','addAnswer','create','addImap','addSmtp','addApplications','send','addAgents','put','update','removeDispositions','delete','removeImap'];(function(_0x4f5bd6,_0x51e6aa){var _0x11299b=function(_0x2d8c25){while(--_0x2d8c25){_0x4f5bd6['push'](_0x4f5bd6['shift']());}};_0x11299b(++_0x51e6aa);}(_0x2ac2,0x88));var _0x22ac=function(_0x25a174,_0x5b9c69){_0x25a174=_0x25a174-0x0;var _0x517e12=_0x2ac2[_0x25a174];return _0x517e12;};'use strict';var multer=require(_0x22ac('0x0'));var util=require('util');var path=require(_0x22ac('0x1'));var timeout=require(_0x22ac('0x2'));var express=require('express');var router=express[_0x22ac('0x3')]();var auth=require(_0x22ac('0x4'));var interaction=require(_0x22ac('0x5'));var config=require(_0x22ac('0x6'));var controller=require(_0x22ac('0x7'));router[_0x22ac('0x8')]('/',auth[_0x22ac('0x9')](),controller[_0x22ac('0xa')]);router['get'](_0x22ac('0xb'),auth[_0x22ac('0x9')](),controller[_0x22ac('0xc')]);router[_0x22ac('0x8')](_0x22ac('0xd'),auth[_0x22ac('0x9')](),controller[_0x22ac('0xe')]);router['get'](_0x22ac('0xf'),auth['isAuthenticated'](),controller[_0x22ac('0x10')]);router[_0x22ac('0x8')](_0x22ac('0x11'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x22ac('0x8')](_0x22ac('0x12'),auth[_0x22ac('0x9')](),controller['getImap']);router[_0x22ac('0x8')](_0x22ac('0x13'),auth[_0x22ac('0x9')](),controller[_0x22ac('0x14')]);router['get'](_0x22ac('0x15'),auth[_0x22ac('0x9')](),controller['getInteractions']);router[_0x22ac('0x8')](_0x22ac('0x16'),auth[_0x22ac('0x9')](),controller['getApplications']);router[_0x22ac('0x8')]('/:id/messages',auth[_0x22ac('0x9')](),controller[_0x22ac('0x17')]);router['get']('/:id/verify',auth[_0x22ac('0x9')](),controller[_0x22ac('0x18')]);router[_0x22ac('0x8')](_0x22ac('0x19'),auth['isAuthenticated'](),controller['getAgents']);router[_0x22ac('0x1a')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x22ac('0x1b')]);router[_0x22ac('0x1a')]('/:id/canned_answers',auth[_0x22ac('0x9')](),controller[_0x22ac('0x1c')]);router['post']('/',auth[_0x22ac('0x9')](),controller[_0x22ac('0x1d')]);router[_0x22ac('0x1a')](_0x22ac('0x12'),auth['isAuthenticated'](),controller[_0x22ac('0x1e')]);router[_0x22ac('0x1a')]('/:id/out_servers',auth[_0x22ac('0x9')](),controller[_0x22ac('0x1f')]);router[_0x22ac('0x1a')](_0x22ac('0x15'),auth[_0x22ac('0x9')](),controller['addInteraction']);router[_0x22ac('0x1a')](_0x22ac('0x16'),auth['isAuthenticated'](),controller[_0x22ac('0x20')]);router[_0x22ac('0x1a')]('/:id/send',auth[_0x22ac('0x9')](),controller[_0x22ac('0x21')]);router['post'](_0x22ac('0x19'),auth[_0x22ac('0x9')](),controller[_0x22ac('0x22')]);router[_0x22ac('0x23')](_0x22ac('0xd'),auth[_0x22ac('0x9')](),controller[_0x22ac('0x24')]);router['delete'](_0x22ac('0xf'),auth[_0x22ac('0x9')](),controller[_0x22ac('0x25')]);router[_0x22ac('0x26')](_0x22ac('0x11'),auth[_0x22ac('0x9')](),controller['removeAnswers']);router[_0x22ac('0x26')](_0x22ac('0x12'),auth[_0x22ac('0x9')](),controller[_0x22ac('0x27')]);router[_0x22ac('0x26')]('/:id/out_servers',auth[_0x22ac('0x9')](),controller[_0x22ac('0x28')]);router['delete'](_0x22ac('0xd'),auth[_0x22ac('0x9')](),controller[_0x22ac('0x29')]);router[_0x22ac('0x26')]('/:id/users',auth['isAuthenticated'](),controller[_0x22ac('0x2a')]);module[_0x22ac('0x2b')]=router; \ No newline at end of file +var _0x28e5=['/:id/verify','verifySmtp','/:id/users','post','addDisposition','/:id/canned_answers','addAnswer','create','addImap','addSmtp','addInteraction','addApplications','/:id/send','send','addAgents','put','/:id','update','delete','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','describe','show','/:id/dispositions','getAnswers','getImap','/:id/out_servers','getSmtp','/:id/interactions','/:id/applications','getApplications'];(function(_0x44f974,_0x4db616){var _0x805dbd=function(_0x1a56b7){while(--_0x1a56b7){_0x44f974['push'](_0x44f974['shift']());}};_0x805dbd(++_0x4db616);}(_0x28e5,0x15b));var _0x528e=function(_0x15cbdd,_0xe43238){_0x15cbdd=_0x15cbdd-0x0;var _0x49e6cb=_0x28e5[_0x15cbdd];return _0x49e6cb;};'use strict';var multer=require(_0x528e('0x0'));var util=require('util');var path=require(_0x528e('0x1'));var timeout=require(_0x528e('0x2'));var express=require(_0x528e('0x3'));var router=express[_0x528e('0x4')]();var auth=require(_0x528e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x528e('0x6'));var controller=require(_0x528e('0x7'));router[_0x528e('0x8')]('/',auth[_0x528e('0x9')](),controller[_0x528e('0xa')]);router[_0x528e('0x8')]('/describe',auth[_0x528e('0x9')](),controller[_0x528e('0xb')]);router[_0x528e('0x8')]('/:id',auth[_0x528e('0x9')](),controller[_0x528e('0xc')]);router['get'](_0x528e('0xd'),auth[_0x528e('0x9')](),controller['getDispositions']);router['get']('/:id/canned_answers',auth[_0x528e('0x9')](),controller[_0x528e('0xe')]);router[_0x528e('0x8')]('/:id/in_servers',auth[_0x528e('0x9')](),controller[_0x528e('0xf')]);router[_0x528e('0x8')](_0x528e('0x10'),auth[_0x528e('0x9')](),controller[_0x528e('0x11')]);router[_0x528e('0x8')](_0x528e('0x12'),auth['isAuthenticated'](),controller['getInteractions']);router[_0x528e('0x8')](_0x528e('0x13'),auth['isAuthenticated'](),controller[_0x528e('0x14')]);router['get']('/:id/messages',auth[_0x528e('0x9')](),controller['getMessages']);router[_0x528e('0x8')](_0x528e('0x15'),auth[_0x528e('0x9')](),controller[_0x528e('0x16')]);router[_0x528e('0x8')](_0x528e('0x17'),auth[_0x528e('0x9')](),controller['getAgents']);router[_0x528e('0x18')](_0x528e('0xd'),auth['isAuthenticated'](),controller[_0x528e('0x19')]);router[_0x528e('0x18')](_0x528e('0x1a'),auth['isAuthenticated'](),controller[_0x528e('0x1b')]);router[_0x528e('0x18')]('/',auth[_0x528e('0x9')](),controller[_0x528e('0x1c')]);router['post']('/:id/in_servers',auth['isAuthenticated'](),controller[_0x528e('0x1d')]);router['post'](_0x528e('0x10'),auth[_0x528e('0x9')](),controller[_0x528e('0x1e')]);router[_0x528e('0x18')](_0x528e('0x12'),auth['isAuthenticated'](),controller[_0x528e('0x1f')]);router[_0x528e('0x18')](_0x528e('0x13'),auth['isAuthenticated'](),controller[_0x528e('0x20')]);router[_0x528e('0x18')](_0x528e('0x21'),auth[_0x528e('0x9')](),controller[_0x528e('0x22')]);router[_0x528e('0x18')](_0x528e('0x17'),auth['isAuthenticated'](),controller[_0x528e('0x23')]);router[_0x528e('0x24')](_0x528e('0x25'),auth['isAuthenticated'](),controller[_0x528e('0x26')]);router[_0x528e('0x27')](_0x528e('0xd'),auth[_0x528e('0x9')](),controller['removeDispositions']);router['delete'](_0x528e('0x1a'),auth[_0x528e('0x9')](),controller[_0x528e('0x28')]);router[_0x528e('0x27')]('/:id/in_servers',auth[_0x528e('0x9')](),controller[_0x528e('0x29')]);router[_0x528e('0x27')](_0x528e('0x10'),auth['isAuthenticated'](),controller[_0x528e('0x2a')]);router['delete']('/:id',auth[_0x528e('0x9')](),controller[_0x528e('0x2b')]);router[_0x528e('0x27')](_0x528e('0x17'),auth['isAuthenticated'](),controller[_0x528e('0x2c')]);module[_0x528e('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 f3c8fb4..6ed5a12 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 _0xf674=['INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','setDataValue','BOOLEAN','STRING','TEXT','Arial,Helvetica,sans-serif'];(function(_0x394d4a,_0x4ec14f){var _0x136d34=function(_0x9b6f9c){while(--_0x9b6f9c){_0x394d4a['push'](_0x394d4a['shift']());}};_0x136d34(++_0x4ec14f);}(_0xf674,0x15a));var _0x4f67=function(_0x28f1de,_0x355054){_0x28f1de=_0x28f1de-0x0;var _0x5b5dad=_0xf674[_0x28f1de];return _0x5b5dad;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x4f67('0x0')],'defaultValue':!![]},'key':{'type':Sequelize[_0x4f67('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x4f67('0x2')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x4f67('0x1')],'allowNull':![],'defaultValue':_0x4f67('0x3')},'fontSize':{'type':Sequelize[_0x4f67('0x4')](0x2)[_0x4f67('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x4f67('0x6');}},'notificationSound':{'type':Sequelize[_0x4f67('0x0')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4f67('0x0')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4f67('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4f67('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4f67('0x4')],'allowNull':!![],'defaultValue':null,'comment':_0x4f67('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4f2fee){if(!_0x4f2fee)this['setDataValue'](_0x4f67('0x8'),null);this[_0x4f67('0x9')]('mandatoryDisposition',_0x4f2fee);}}}; \ No newline at end of file +var _0x7e66=['mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x85bf5a,_0x4d64d9){var _0x3c0e95=function(_0x190537){while(--_0x190537){_0x85bf5a['push'](_0x85bf5a['shift']());}};_0x3c0e95(++_0x4d64d9);}(_0x7e66,0x199));var _0x67e6=function(_0x5454e0,_0x5a6c5d){_0x5454e0=_0x5454e0-0x0;var _0x14be2f=_0x7e66[_0x5454e0];return _0x14be2f;};'use strict';var Sequelize=require(_0x67e6('0x0'));module[_0x67e6('0x1')]={'description':{'type':Sequelize[_0x67e6('0x2')]},'name':{'type':Sequelize[_0x67e6('0x2')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x67e6('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x67e6('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x67e6('0x4')]},'markAsUnread':{'type':Sequelize[_0x67e6('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x67e6('0x2')],'allowNull':![],'defaultValue':_0x67e6('0x5')},'fontSize':{'type':Sequelize[_0x67e6('0x6')](0x2)[_0x67e6('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x67e6('0x4')],'defaultValue':function(){return _0x67e6('0x8');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x67e6('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x67e6('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x67e6('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x67e6('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x67e6('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x67e6('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x67e6('0x3')],'defaultValue':![],'comment':_0x67e6('0xa'),'set':function(_0xf5b7af){if(!_0xf5b7af)this['setDataValue'](_0x67e6('0xb'),null);this[_0x67e6('0xc')](_0x67e6('0xd'),_0xf5b7af);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 0046f35..4b12c76 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 _0x976f=['subject','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','destroy','Sequelize','ValidationError','addAgents','omit','spread','removeAgents','emit','getAgents','User','html-pdf','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./mailAccount.socket','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','MailAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','save','update','get','MailAccounts','name','send','index','MailServerIn','MailServerOut','Smtp','Pause','MailAccount','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','Imap','find','body','mandatoryDispositionPause','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','order','removeDispositions','addAnswer','CannedAnswer','getAnswers','rawAttributes','removeAnswers','ids','email','ListId','isNil','description','cservice','user','cuser','password','pass','cpassword','authentication','host','port','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','CmContact','Contact','Owner','fullname','internal','Tags','color','tag','addApplications','MailApplication','findAndCountAll','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','Contacts','DESC','from','attachments','join','server/files/attachments','basename','auth','secure','service','List\x20not\x20found','List','defaults','messageId'];(function(_0x1f0f53,_0x4c6fd4){var _0xbc158b=function(_0x27d323){while(--_0x27d323){_0x1f0f53['push'](_0x1f0f53['shift']());}};_0xbc158b(++_0x4c6fd4);}(_0x976f,0x185));var _0xf976=function(_0x3a968e,_0x105c4d){_0x3a968e=_0x3a968e-0x0;var _0x9c978e=_0x976f[_0x3a968e];return _0x9c978e;};'use strict';var pdf=require(_0xf976('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf976('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf976('0x2'));var moment=require(_0xf976('0x3'));var BPromise=require(_0xf976('0x4'));var Mustache=require('mustache');var util=require(_0xf976('0x5'));var path=require(_0xf976('0x6'));var sox=require(_0xf976('0x7'));var csv=require(_0xf976('0x8'));var ejs=require(_0xf976('0x9'));var fs=require('fs');var _=require(_0xf976('0xa'));var squel=require(_0xf976('0xb'));var crypto=require('crypto');var jsforce=require(_0xf976('0xc'));var deskjs=require(_0xf976('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf976('0xe'));var Papa=require('papaparse');var Redis=require(_0xf976('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf976('0x10'));var hardwareService=require(_0xf976('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xf976('0x12'));var config=require(_0xf976('0x13'));var db=require('../../mysqldb')['db'];config[_0xf976('0x14')]=_['defaults'](config[_0xf976('0x14')],{'host':_0xf976('0x15'),'port':0x18eb});var socket=require(_0xf976('0x16'))(new Redis(config[_0xf976('0x14')]));require(_0xf976('0x17'))['register'](socket);var jayson=require(_0xf976('0x18'));var client=jayson[_0xf976('0x19')][_0xf976('0x1a')]({'port':0x232b});function checkPasswordPattern(_0x124de4,_0xb88981,_0xfbe7e2){if(_0xfbe7e2){var _0x3ae336=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3ae336[_0xf976('0x1b')](_0xb88981)){return _0x124de4;}else{throw new Error(_0xf976('0x1c'));}}else{return _0x124de4;}}function respondWithRpcPromise(_0x21a25b,_0x45475f,_0x473248,_0x135d0d){return new BPromise(function(_0x389261,_0x330d3b){var _0x2992bf=_0x135d0d||client;return _0x2992bf[_0xf976('0x1d')](_0x21a25b,_0x473248)[_0xf976('0x1e')](function(_0x33747c){logger['info']('MailAccount,\x20%s,\x20%s',_0x45475f,_0xf976('0x1f'));logger[_0xf976('0x20')](_0xf976('0x21'),_0x45475f,_0xf976('0x1f'),JSON['stringify'](_0x33747c));if(_0x33747c[_0xf976('0x22')]){if(_0x33747c[_0xf976('0x22')][_0xf976('0x23')]===0x1f4){logger[_0xf976('0x22')](_0xf976('0x24'),_0x45475f,_0x33747c['error'][_0xf976('0x25')]);return _0x330d3b(_0x33747c[_0xf976('0x22')][_0xf976('0x25')]);}logger['error'](_0xf976('0x24'),_0x45475f,_0x33747c[_0xf976('0x22')][_0xf976('0x25')]);return _0x389261(_0x33747c['error'][_0xf976('0x25')]);}else{logger['info'](_0xf976('0x24'),_0x45475f,'request\x20sent');_0x389261(_0x33747c[_0xf976('0x26')][_0xf976('0x25')]);}})[_0xf976('0x27')](function(_0x3c6063){logger['error'](_0xf976('0x24'),_0x45475f,_0x3c6063);_0x330d3b(_0x3c6063);});});}function respondWithStatusCode(_0x5c3e7f,_0x3c9289){_0x3c9289=_0x3c9289||0xcc;return function(_0x3d0e5e){if(_0x3d0e5e){return _0x5c3e7f[_0xf976('0x28')](_0x3c9289);}return _0x5c3e7f[_0xf976('0x29')](_0x3c9289)[_0xf976('0x2a')]();};}function respondWithResult(_0x479138,_0x534cfe){_0x534cfe=_0x534cfe||0xc8;return function(_0x41f3c1){if(_0x41f3c1){return _0x479138[_0xf976('0x29')](_0x534cfe)['json'](_0x41f3c1);}};}function respondWithFilteredResult(_0x3b7529,_0x407fd3){return function(_0x3b1ff9){if(_0x3b1ff9){var _0x14d3fb=_0x3b1ff9[_0xf976('0x2b')],_0x1e236d=_0x407fd3[_0xf976('0x2c')],_0x306c85=_0x407fd3['offset']+_0x407fd3[_0xf976('0x2d')],_0x3844da;if(_0x306c85>=_0x14d3fb){_0x306c85=_0x14d3fb;_0x3844da=0xc8;}else{_0x3844da=0xce;}_0x3b7529[_0xf976('0x29')](_0x3844da);return _0x3b7529[_0xf976('0x2e')](_0xf976('0x2f'),_0x1e236d+'-'+_0x306c85+'/'+_0x14d3fb)[_0xf976('0x30')](_0x3b1ff9);}return null;};}function patchUpdates(_0xc268f9){return function(_0x99acca){try{jsonpatch[_0xf976('0x31')](_0x99acca,_0xc268f9,!![]);}catch(_0x41a739){return BPromise['reject'](_0x41a739);}return _0x99acca[_0xf976('0x32')]();};}function saveUpdates(_0x582bfc,_0x307307){return function(_0x4beef6){if(_0x4beef6){return _0x4beef6[_0xf976('0x33')](_0x582bfc)[_0xf976('0x1e')](function(_0x55963d){return _0x55963d;});}return null;};}function removeEntity(_0x35c1fb,_0x49529c){return function(_0x304d0b){if(_0x304d0b){return _0x304d0b['destroy']()[_0xf976('0x1e')](function(){var _0x1b2498=_0x304d0b[_0xf976('0x34')]({'plain':!![]});var _0x6c9670=_0xf976('0x35');return db['UserProfileResource']['destroy']({'where':{'type':_0x6c9670,'resourceId':_0x1b2498['id']}})['then'](function(){return _0x304d0b;});})[_0xf976('0x1e')](function(){_0x35c1fb[_0xf976('0x29')](0xcc)[_0xf976('0x2a')]();});}};}function handleEntityNotFound(_0x17b006,_0x2ff076){return function(_0x5786b7){if(!_0x5786b7){_0x17b006[_0xf976('0x28')](0x194);}return _0x5786b7;};}function handleError(_0x5dfe72,_0x10e1db){_0x10e1db=_0x10e1db||0x1f4;return function(_0x3b3c2e){logger[_0xf976('0x22')](_0x3b3c2e['stack']);if(_0x3b3c2e[_0xf976('0x36')]){delete _0x3b3c2e[_0xf976('0x36')];}_0x5dfe72[_0xf976('0x29')](_0x10e1db)[_0xf976('0x37')](_0x3b3c2e);};}exports[_0xf976('0x38')]=function(_0xd680c2,_0x462738){var _0x4f5d36={'include':[{'model':db[_0xf976('0x39')],'as':'Imap'},{'model':db[_0xf976('0x3a')],'as':_0xf976('0x3b')},{'model':db[_0xf976('0x3c')],'as':'mandatoryDispositionPause'}]},_0x32e7be={},_0xabaa4b={'count':0x0,'rows':[]};var _0x4693db=db[_0xf976('0x3d')]['rawAttributes'];_0x32e7be['model']=_[_0xf976('0x3e')](_0x4693db);_0x32e7be[_0xf976('0x3f')]=_[_0xf976('0x3e')](_0xd680c2[_0xf976('0x3f')]);_0x32e7be[_0xf976('0x40')]=_[_0xf976('0x41')](_0x32e7be[_0xf976('0x42')],_0x32e7be[_0xf976('0x3f')]);_0x4f5d36[_0xf976('0x43')]=_[_0xf976('0x41')](_0x32e7be[_0xf976('0x42')],qs[_0xf976('0x44')](_0xd680c2[_0xf976('0x3f')][_0xf976('0x44')]));_0x4f5d36['attributes']=_0x4f5d36[_0xf976('0x43')][_0xf976('0x45')]?_0x4f5d36[_0xf976('0x43')]:_0x32e7be['model'];if(!_0xd680c2[_0xf976('0x3f')][_0xf976('0x46')](_0xf976('0x47'))){_0x4f5d36['limit']=qs['limit'](_0xd680c2[_0xf976('0x3f')][_0xf976('0x2d')]);_0x4f5d36[_0xf976('0x2c')]=qs[_0xf976('0x2c')](_0xd680c2[_0xf976('0x3f')]['offset']);}_0x4f5d36['order']=qs['sort'](_0xd680c2[_0xf976('0x3f')][_0xf976('0x48')]);_0x4f5d36[_0xf976('0x49')]=qs[_0xf976('0x40')](_[_0xf976('0x4a')](_0xd680c2[_0xf976('0x3f')],_0x32e7be[_0xf976('0x40')]));if(_0xd680c2[_0xf976('0x3f')][_0xf976('0x4b')]){_0x4f5d36[_0xf976('0x49')]=_[_0xf976('0x4c')](_0x4f5d36[_0xf976('0x49')],{'$or':_[_0xf976('0x4d')](_0x4693db,function(_0x21de7b){if(_0x21de7b['type'][_0xf976('0x4e')]!==_0xf976('0x4f')){var _0x581c01={};_0x581c01[_0x21de7b[_0xf976('0x50')]]={'$like':'%'+_0xd680c2[_0xf976('0x3f')]['filter']+'%'};return _0x581c01;}})});}_0x4f5d36=_[_0xf976('0x4c')]({},_0x4f5d36,_0xd680c2[_0xf976('0x51')]);var _0xb5a10d={'where':_0x4f5d36[_0xf976('0x49')]};return db['MailAccount'][_0xf976('0x2b')](_0xb5a10d)[_0xf976('0x1e')](function(_0x522b42){_0xabaa4b['count']=_0x522b42;if(_0xd680c2[_0xf976('0x3f')][_0xf976('0x52')]){_0x4f5d36[_0xf976('0x53')]=[{'all':!![]}];}return db[_0xf976('0x3d')][_0xf976('0x54')](_0x4f5d36);})[_0xf976('0x1e')](function(_0x317cf9){_0xabaa4b[_0xf976('0x55')]=_0x317cf9;return _0xabaa4b;})['then'](respondWithFilteredResult(_0x462738,_0x4f5d36))[_0xf976('0x27')](handleError(_0x462738,null));};exports[_0xf976('0x56')]=function(_0x4a5fd1,_0x9053f7){var _0x28516a={'raw':![],'where':{'id':_0x4a5fd1[_0xf976('0x57')]['id']},'include':[{'model':db[_0xf976('0x39')],'as':_0xf976('0x58')},{'model':db['MailServerOut'],'as':_0xf976('0x3b')},{'model':db[_0xf976('0x3c')],'as':'mandatoryDispositionPause'}]},_0x477ecf={};_0x477ecf[_0xf976('0x42')]=_[_0xf976('0x3e')](db[_0xf976('0x3d')]['rawAttributes']);_0x477ecf[_0xf976('0x3f')]=_[_0xf976('0x3e')](_0x4a5fd1['query']);_0x477ecf[_0xf976('0x40')]=_[_0xf976('0x41')](_0x477ecf[_0xf976('0x42')],_0x477ecf[_0xf976('0x3f')]);_0x28516a[_0xf976('0x43')]=_[_0xf976('0x41')](_0x477ecf[_0xf976('0x42')],qs[_0xf976('0x44')](_0x4a5fd1[_0xf976('0x3f')]['fields']));_0x28516a[_0xf976('0x43')]=_0x28516a[_0xf976('0x43')][_0xf976('0x45')]?_0x28516a[_0xf976('0x43')]:_0x477ecf[_0xf976('0x42')];if(_0x4a5fd1[_0xf976('0x3f')][_0xf976('0x52')]){_0x28516a[_0xf976('0x53')]=[{'all':!![]}];}_0x28516a=_[_0xf976('0x4c')]({},_0x28516a,_0x4a5fd1[_0xf976('0x51')]);return db['MailAccount'][_0xf976('0x59')](_0x28516a)[_0xf976('0x1e')](handleEntityNotFound(_0x9053f7,null))[_0xf976('0x1e')](respondWithResult(_0x9053f7,null))[_0xf976('0x27')](handleError(_0x9053f7,null));};exports[_0xf976('0x33')]=function(_0x53f9ac,_0x8a06a0){if(_0x53f9ac[_0xf976('0x5a')]['id']){delete _0x53f9ac[_0xf976('0x5a')]['id'];}return db[_0xf976('0x3d')][_0xf976('0x59')]({'where':{'id':_0x53f9ac[_0xf976('0x57')]['id']},'include':[{'model':db[_0xf976('0x39')],'as':'Imap'},{'model':db[_0xf976('0x3a')],'as':_0xf976('0x3b')},{'model':db[_0xf976('0x3c')],'as':_0xf976('0x5b')}]})[_0xf976('0x1e')](handleEntityNotFound(_0x8a06a0,null))[_0xf976('0x1e')](saveUpdates(_0x53f9ac[_0xf976('0x5a')],null))[_0xf976('0x1e')](function(_0x1d602f){if(_0x1d602f&&_0x53f9ac[_0xf976('0x5a')]['Imap']){return db[_0xf976('0x39')][_0xf976('0x33')](_0x53f9ac['body']['Imap'],{'where':{'MailAccountId':_0x1d602f['id']}})[_0xf976('0x1e')](function(){return _0x1d602f;});}return _0x1d602f;})[_0xf976('0x1e')](function(_0x38ab76){if(_0x38ab76&&_0x53f9ac[_0xf976('0x5a')][_0xf976('0x3b')]){return db['MailServerOut'][_0xf976('0x33')](_0x53f9ac[_0xf976('0x5a')][_0xf976('0x3b')],{'where':{'MailAccountId':_0x38ab76['id']}})[_0xf976('0x1e')](function(){return _0x38ab76;});}return _0x38ab76;})[_0xf976('0x1e')](respondWithResult(_0x8a06a0,null))['catch'](handleError(_0x8a06a0,null));};exports['describe']=function(_0x200604,_0x32ab58){return db['MailAccount'][_0xf976('0x5c')]()[_0xf976('0x1e')](respondWithResult(_0x32ab58,null))[_0xf976('0x27')](handleError(_0x32ab58,null));};exports[_0xf976('0x5d')]=function(_0x24da94,_0x889802,_0x30f32e){if(_0x24da94[_0xf976('0x5a')]['id']){delete _0x24da94[_0xf976('0x5a')]['id'];}return db[_0xf976('0x3d')]['find']({'where':{'id':_0x24da94[_0xf976('0x57')]['id']}})[_0xf976('0x1e')](handleEntityNotFound(_0x889802,null))['then'](function(_0xdfab42){if(_0xdfab42){_0x24da94[_0xf976('0x5a')][_0xf976('0x5e')]=_0xdfab42['id'];return db[_0xf976('0x5f')][_0xf976('0x60')](_0x24da94[_0xf976('0x5a')]);}})[_0xf976('0x1e')](respondWithResult(_0x889802,null))[_0xf976('0x27')](handleError(_0x889802,null));};exports[_0xf976('0x61')]=function(_0x508e02,_0x3bda1d,_0x48165e){var _0x3c044b={'raw':![],'where':{}};var _0x202358={};var _0x45d8ab={'count':0x0,'rows':[]};return db[_0xf976('0x3d')][_0xf976('0x62')]({'where':{'id':_0x508e02[_0xf976('0x57')]['id']}})[_0xf976('0x1e')](handleEntityNotFound(_0x3bda1d,null))[_0xf976('0x1e')](function(_0x2d1d6d){if(_0x2d1d6d){_0x202358[_0xf976('0x42')]=_[_0xf976('0x3e')](db['Disposition']['rawAttributes']);_0x202358['query']=_['keys'](_0x508e02[_0xf976('0x3f')]);_0x202358[_0xf976('0x40')]=_['intersection'](_0x202358[_0xf976('0x42')],_0x202358['query']);_0x3c044b[_0xf976('0x43')]=_[_0xf976('0x41')](_0x202358['model'],qs['fields'](_0x508e02[_0xf976('0x3f')]['fields']));_0x3c044b[_0xf976('0x43')]=_0x3c044b['attributes']['length']?_0x3c044b[_0xf976('0x43')]:_0x202358['model'];if(!_0x508e02[_0xf976('0x3f')]['hasOwnProperty'](_0xf976('0x47'))){_0x3c044b[_0xf976('0x2d')]=qs[_0xf976('0x2d')](_0x508e02[_0xf976('0x3f')][_0xf976('0x2d')]);_0x3c044b[_0xf976('0x2c')]=qs[_0xf976('0x2c')](_0x508e02[_0xf976('0x3f')][_0xf976('0x2c')]);}_0x3c044b[_0xf976('0x63')]=qs[_0xf976('0x48')](_0x508e02[_0xf976('0x3f')][_0xf976('0x48')]);_0x3c044b[_0xf976('0x49')]=qs[_0xf976('0x40')](_[_0xf976('0x4a')](_0x508e02['query'],_0x202358[_0xf976('0x40')]));_0x3c044b[_0xf976('0x49')][_0xf976('0x5e')]=_0x2d1d6d['id'];if(_0x508e02[_0xf976('0x3f')][_0xf976('0x4b')]){_0x3c044b['where']=_['merge'](_0x3c044b['where'],{'$or':_['map'](_0x3c044b['attributes'],function(_0x503db3){var _0x5636df={};_0x5636df[_0x503db3]={'$like':'%'+_0x508e02[_0xf976('0x3f')][_0xf976('0x4b')]+'%'};return _0x5636df;})});}_0x3c044b=_['merge']({},_0x3c044b,_0x508e02[_0xf976('0x51')]);return db[_0xf976('0x5f')][_0xf976('0x2b')]({'where':_0x3c044b['where']})[_0xf976('0x1e')](function(_0x1203b3){_0x45d8ab['count']=_0x1203b3;if(_0x508e02[_0xf976('0x3f')][_0xf976('0x52')]){_0x3c044b[_0xf976('0x53')]=[{'all':!![]}];}return db[_0xf976('0x5f')][_0xf976('0x54')](_0x3c044b);})[_0xf976('0x1e')](function(_0x5cde7b){_0x45d8ab[_0xf976('0x55')]=_0x5cde7b;return _0x45d8ab;});}})[_0xf976('0x1e')](respondWithFilteredResult(_0x3bda1d,_0x3c044b))[_0xf976('0x27')](handleError(_0x3bda1d,null));};exports[_0xf976('0x64')]=function(_0x505cbf,_0x121598,_0x431772){return db[_0xf976('0x3d')][_0xf976('0x59')]({'where':{'id':_0x505cbf['params']['id']}})['then'](handleEntityNotFound(_0x121598,null))[_0xf976('0x1e')](function(_0x199d92){if(_0x199d92){return _0x199d92[_0xf976('0x64')](_0x505cbf['query']['ids']);}})[_0xf976('0x1e')](respondWithStatusCode(_0x121598,null))[_0xf976('0x27')](handleError(_0x121598,null));};exports[_0xf976('0x65')]=function(_0x3b25e2,_0x7be5b9,_0x3a413c){if(_0x3b25e2['body']['id']){delete _0x3b25e2['body']['id'];}return db[_0xf976('0x3d')][_0xf976('0x59')]({'where':{'id':_0x3b25e2[_0xf976('0x57')]['id']}})[_0xf976('0x1e')](handleEntityNotFound(_0x7be5b9,null))[_0xf976('0x1e')](function(_0x46ff3d){if(_0x46ff3d){_0x3b25e2[_0xf976('0x5a')][_0xf976('0x5e')]=_0x46ff3d['id'];return db[_0xf976('0x66')]['create'](_0x3b25e2[_0xf976('0x5a')]);}})[_0xf976('0x1e')](respondWithResult(_0x7be5b9,null))['catch'](handleError(_0x7be5b9,null));};exports[_0xf976('0x67')]=function(_0x3bd26e,_0x3041ef,_0x521887){var _0x26f03a={'raw':![],'where':{}};var _0x15b0b4={};var _0x22bc47={'count':0x0,'rows':[]};return db['MailAccount'][_0xf976('0x62')]({'where':{'id':_0x3bd26e[_0xf976('0x57')]['id']}})['then'](handleEntityNotFound(_0x3041ef,null))[_0xf976('0x1e')](function(_0x5af7d6){if(_0x5af7d6){_0x15b0b4[_0xf976('0x42')]=_[_0xf976('0x3e')](db[_0xf976('0x66')][_0xf976('0x68')]);_0x15b0b4['query']=_[_0xf976('0x3e')](_0x3bd26e[_0xf976('0x3f')]);_0x15b0b4[_0xf976('0x40')]=_[_0xf976('0x41')](_0x15b0b4[_0xf976('0x42')],_0x15b0b4['query']);_0x26f03a[_0xf976('0x43')]=_['intersection'](_0x15b0b4[_0xf976('0x42')],qs['fields'](_0x3bd26e[_0xf976('0x3f')]['fields']));_0x26f03a['attributes']=_0x26f03a['attributes'][_0xf976('0x45')]?_0x26f03a[_0xf976('0x43')]:_0x15b0b4[_0xf976('0x42')];if(!_0x3bd26e[_0xf976('0x3f')][_0xf976('0x46')]('nolimit')){_0x26f03a[_0xf976('0x2d')]=qs['limit'](_0x3bd26e[_0xf976('0x3f')][_0xf976('0x2d')]);_0x26f03a[_0xf976('0x2c')]=qs[_0xf976('0x2c')](_0x3bd26e[_0xf976('0x3f')]['offset']);}_0x26f03a[_0xf976('0x63')]=qs[_0xf976('0x48')](_0x3bd26e['query'][_0xf976('0x48')]);_0x26f03a[_0xf976('0x49')]=qs['filters'](_[_0xf976('0x4a')](_0x3bd26e['query'],_0x15b0b4[_0xf976('0x40')]));_0x26f03a[_0xf976('0x49')][_0xf976('0x5e')]=_0x5af7d6['id'];if(_0x3bd26e[_0xf976('0x3f')]['filter']){_0x26f03a[_0xf976('0x49')]=_[_0xf976('0x4c')](_0x26f03a[_0xf976('0x49')],{'$or':_['map'](_0x26f03a[_0xf976('0x43')],function(_0x4ca242){var _0x2736c7={};_0x2736c7[_0x4ca242]={'$like':'%'+_0x3bd26e[_0xf976('0x3f')]['filter']+'%'};return _0x2736c7;})});}_0x26f03a=_[_0xf976('0x4c')]({},_0x26f03a,_0x3bd26e[_0xf976('0x51')]);return db[_0xf976('0x66')][_0xf976('0x2b')]({'where':_0x26f03a[_0xf976('0x49')]})[_0xf976('0x1e')](function(_0x24e75d){_0x22bc47['count']=_0x24e75d;if(_0x3bd26e[_0xf976('0x3f')][_0xf976('0x52')]){_0x26f03a[_0xf976('0x53')]=[{'all':!![]}];}return db['CannedAnswer'][_0xf976('0x54')](_0x26f03a);})[_0xf976('0x1e')](function(_0x4ade50){_0x22bc47[_0xf976('0x55')]=_0x4ade50;return _0x22bc47;});}})[_0xf976('0x1e')](respondWithFilteredResult(_0x3041ef,_0x26f03a))[_0xf976('0x27')](handleError(_0x3041ef,null));};exports[_0xf976('0x69')]=function(_0x58c613,_0x38029c,_0x2834be){return db['MailAccount'][_0xf976('0x59')]({'where':{'id':_0x58c613[_0xf976('0x57')]['id']}})['then'](handleEntityNotFound(_0x38029c,null))[_0xf976('0x1e')](function(_0x5336d0){if(_0x5336d0){return _0x5336d0[_0xf976('0x69')](_0x58c613[_0xf976('0x3f')][_0xf976('0x6a')]);}})['then'](respondWithStatusCode(_0x38029c,null))[_0xf976('0x27')](handleError(_0x38029c,null));};exports['create']=function(_0x5ecb6a,_0x35403e){var _0x108b14={'name':_0x5ecb6a[_0xf976('0x5a')][_0xf976('0x36')],'key':_0x5ecb6a[_0xf976('0x5a')]['key'],'email':_0x5ecb6a[_0xf976('0x5a')][_0xf976('0x6b')],'ListId':_0x5ecb6a[_0xf976('0x5a')][_0xf976('0x6c')],'active':!_[_0xf976('0x6d')](_0x5ecb6a[_0xf976('0x5a')]['active'])?_0x5ecb6a[_0xf976('0x5a')]['active']:!![],'description':_0x5ecb6a[_0xf976('0x5a')][_0xf976('0x6e')]||null,'Imap':{},'Smtp':{}};if(_[_0xf976('0x6d')](_0x5ecb6a[_0xf976('0x5a')][_0xf976('0x6f')])){if(_0x5ecb6a[_0xf976('0x5a')]['cauthentication']){_0x108b14[_0xf976('0x58')][_0xf976('0x70')]=_0x108b14[_0xf976('0x3b')][_0xf976('0x70')]=_0x5ecb6a[_0xf976('0x5a')][_0xf976('0x71')];_0x108b14[_0xf976('0x58')][_0xf976('0x72')]=_0x108b14[_0xf976('0x3b')][_0xf976('0x73')]=_0x5ecb6a[_0xf976('0x5a')][_0xf976('0x74')];}else{_0x108b14[_0xf976('0x58')][_0xf976('0x75')]=_0x108b14[_0xf976('0x3b')][_0xf976('0x75')]=![];}_0x108b14[_0xf976('0x58')][_0xf976('0x76')]=_0x5ecb6a['body']['Imap'][_0xf976('0x76')];_0x108b14['Imap'][_0xf976('0x77')]=_0x5ecb6a['body']['Imap']['port'];_0x108b14[_0xf976('0x3b')][_0xf976('0x76')]=_0x5ecb6a['body']['Smtp'][_0xf976('0x76')];_0x108b14['Smtp']['port']=_0x5ecb6a['body'][_0xf976('0x3b')][_0xf976('0x77')];}else{_0x108b14['Imap']['service']=_0x108b14[_0xf976('0x3b')]['service']=_0x5ecb6a[_0xf976('0x5a')][_0xf976('0x6f')];_0x108b14[_0xf976('0x58')][_0xf976('0x70')]=_0x108b14[_0xf976('0x3b')][_0xf976('0x70')]=_0x5ecb6a[_0xf976('0x5a')][_0xf976('0x71')];_0x108b14['Imap'][_0xf976('0x72')]=_0x108b14[_0xf976('0x3b')][_0xf976('0x73')]=_0x5ecb6a['body'][_0xf976('0x74')];}return db[_0xf976('0x3d')][_0xf976('0x60')](_0x108b14,{'include':[{'model':db[_0xf976('0x3a')],'as':_0xf976('0x3b')},{'model':db[_0xf976('0x39')],'as':_0xf976('0x58')}]})[_0xf976('0x1e')](function(_0x17ed4d){var _0x4186a2=_0x5ecb6a[_0xf976('0x70')][_0xf976('0x34')]({'plain':!![]});if(!_0x4186a2)throw new Error(_0xf976('0x78'));if(_0x4186a2[_0xf976('0x79')]===_0xf976('0x70')){var _0x9a8409=_0x17ed4d['get']({'plain':!![]});return db[_0xf976('0x7a')]['find']({'where':{'name':_0xf976('0x35'),'userProfileId':_0x4186a2[_0xf976('0x7b')]},'raw':!![]})['then'](function(_0x558a13){if(_0x558a13&&_0x558a13[_0xf976('0x7c')]===0x0){return db[_0xf976('0x7d')][_0xf976('0x60')]({'name':_0x9a8409[_0xf976('0x36')],'resourceId':_0x9a8409['id'],'type':_0x558a13[_0xf976('0x36')],'sectionId':_0x558a13['id']},{})[_0xf976('0x1e')](function(){return _0x17ed4d;});}else{return _0x17ed4d;}})[_0xf976('0x27')](function(_0xe217ac){logger[_0xf976('0x22')](_0xf976('0x7e'),_0xe217ac);throw _0xe217ac;});}return _0x17ed4d;})[_0xf976('0x1e')](respondWithResult(_0x35403e,0xc9))['catch'](handleError(_0x35403e,null));};exports[_0xf976('0x7f')]=function(_0x5e7d7d,_0x493147,_0x82aaf7){return db[_0xf976('0x3d')][_0xf976('0x62')]({'where':{'id':_0x5e7d7d[_0xf976('0x57')]['id']}})['then'](handleEntityNotFound(_0x493147,null))['then'](function(_0x56a311){if(_0x56a311){return _0x56a311[_0xf976('0x7f')]();}return null;})[_0xf976('0x1e')](respondWithResult(_0x493147,null))[_0xf976('0x27')](handleError(_0x493147,null));};exports[_0xf976('0x80')]=function(_0x16073b,_0x4231d3,_0x174bb1){if(_0x16073b[_0xf976('0x5a')]['id']){delete _0x16073b['body']['id'];}return db[_0xf976('0x3d')][_0xf976('0x59')]({'where':{'id':_0x16073b[_0xf976('0x57')]['id']}})['then'](handleEntityNotFound(_0x4231d3,null))[_0xf976('0x1e')](function(_0x51f017){if(_0x51f017){_0x16073b[_0xf976('0x5a')][_0xf976('0x5e')]=_0x51f017['id'];return db[_0xf976('0x39')][_0xf976('0x60')](_0x16073b[_0xf976('0x5a')]);}})[_0xf976('0x1e')](respondWithResult(_0x4231d3,null))[_0xf976('0x27')](handleError(_0x4231d3,null));};exports[_0xf976('0x81')]=function(_0x1f8774,_0x30fec9,_0x5452bd){return db['MailAccount'][_0xf976('0x62')]({'where':{'id':_0x1f8774[_0xf976('0x57')]['id']}})['then'](handleEntityNotFound(_0x30fec9,null))[_0xf976('0x1e')](function(_0x312022){if(_0x312022){return _0x312022['setImap'](null);}return null;})['then'](respondWithStatusCode(_0x30fec9,null))['catch'](handleError(_0x30fec9,null));};exports[_0xf976('0x82')]=function(_0x1b6b1d,_0x387b00,_0xd742bd){return db[_0xf976('0x3d')][_0xf976('0x62')]({'where':{'id':_0x1b6b1d['params']['id']}})[_0xf976('0x1e')](handleEntityNotFound(_0x387b00,null))[_0xf976('0x1e')](function(_0x48a58d){if(_0x48a58d){return _0x48a58d['getSmtp']();}return null;})[_0xf976('0x1e')](respondWithResult(_0x387b00,null))[_0xf976('0x27')](handleError(_0x387b00,null));};exports[_0xf976('0x83')]=function(_0x548a42,_0x4ffccd,_0x1a16fb){if(_0x548a42['body']['id']){delete _0x548a42[_0xf976('0x5a')]['id'];}return db['MailAccount'][_0xf976('0x59')]({'where':{'id':_0x548a42[_0xf976('0x57')]['id']}})[_0xf976('0x1e')](handleEntityNotFound(_0x4ffccd,null))[_0xf976('0x1e')](function(_0x1d4c55){if(_0x1d4c55){_0x548a42['body'][_0xf976('0x5e')]=_0x1d4c55['id'];return db[_0xf976('0x3a')]['create'](_0x548a42[_0xf976('0x5a')]);}})[_0xf976('0x1e')](respondWithResult(_0x4ffccd,null))[_0xf976('0x27')](handleError(_0x4ffccd,null));};exports[_0xf976('0x84')]=function(_0x30deeb,_0x577fb9,_0x245dff){return db[_0xf976('0x3d')][_0xf976('0x62')]({'where':{'id':_0x30deeb[_0xf976('0x57')]['id']}})['then'](handleEntityNotFound(_0x577fb9,null))[_0xf976('0x1e')](function(_0x47e446){if(_0x47e446){return _0x47e446[_0xf976('0x85')](null);}return null;})[_0xf976('0x1e')](respondWithStatusCode(_0x577fb9,null))['catch'](handleError(_0x577fb9,null));};exports[_0xf976('0x86')]=function(_0x35fe18,_0xa77aba,_0x296e8e){return db['MailInteraction'][_0xf976('0x59')]({'where':{'id':_0x35fe18[_0xf976('0x57')]['id']}})['then'](handleEntityNotFound(_0xa77aba,null))['then'](function(_0x2bb277){if(_0x2bb277){return _0x2bb277['addInteraction'](_0x35fe18['body'][_0xf976('0x6a')],_['omit'](_0x35fe18[_0xf976('0x5a')],[_0xf976('0x6a'),'id'])||{});}})['then'](respondWithResult(_0xa77aba,null))[_0xf976('0x27')](handleError(_0xa77aba,null));};exports['getInteractions']=function(_0x33a5ee,_0x599b71,_0x23c559){var _0x538347={'raw':![],'where':{}};var _0x4c9d7c={};var _0x5768c5={'count':0x0,'rows':[]};return db[_0xf976('0x3d')][_0xf976('0x62')]({'where':{'id':_0x33a5ee[_0xf976('0x57')]['id']}})[_0xf976('0x1e')](handleEntityNotFound(_0x599b71,null))['then'](function(_0x5e8a77){if(_0x5e8a77){_0x4c9d7c['model']=_['keys'](db[_0xf976('0x87')]['rawAttributes']);_0x4c9d7c[_0xf976('0x3f')]=_['keys'](_0x33a5ee[_0xf976('0x3f')]);_0x4c9d7c[_0xf976('0x40')]=_[_0xf976('0x41')](_0x4c9d7c['model'],_0x4c9d7c[_0xf976('0x3f')]);_0x538347[_0xf976('0x43')]=_['intersection'](_0x4c9d7c[_0xf976('0x42')],qs[_0xf976('0x44')](_0x33a5ee[_0xf976('0x3f')][_0xf976('0x44')]));_0x538347[_0xf976('0x43')]=_0x538347[_0xf976('0x43')][_0xf976('0x45')]?_0x538347[_0xf976('0x43')]:_0x4c9d7c[_0xf976('0x42')];if(!_0x33a5ee[_0xf976('0x3f')][_0xf976('0x46')](_0xf976('0x47'))){_0x538347['limit']=qs[_0xf976('0x2d')](_0x33a5ee[_0xf976('0x3f')][_0xf976('0x2d')]);_0x538347['offset']=qs[_0xf976('0x2c')](_0x33a5ee['query'][_0xf976('0x2c')]);}_0x538347['order']=qs[_0xf976('0x48')](_0x33a5ee['query']['sort']);_0x538347[_0xf976('0x49')]=qs[_0xf976('0x40')](_[_0xf976('0x4a')](_0x33a5ee[_0xf976('0x3f')],_0x4c9d7c['filters']));_0x538347[_0xf976('0x49')][_0xf976('0x5e')]=_0x5e8a77['id'];if(_0x33a5ee['query'][_0xf976('0x4b')]){_0x538347[_0xf976('0x49')]=_['merge'](_0x538347[_0xf976('0x49')],{'$or':_[_0xf976('0x4d')](_0x538347['attributes'],function(_0x17c68e){var _0x1a8631={};_0x1a8631[_0x17c68e]={'$like':'%'+_0x33a5ee[_0xf976('0x3f')][_0xf976('0x4b')]+'%'};return _0x1a8631;})});}_0x538347=_[_0xf976('0x4c')]({},_0x538347,_0x33a5ee['options']);return db['MailInteraction'][_0xf976('0x2b')]({'where':_0x538347[_0xf976('0x49')]})[_0xf976('0x1e')](function(_0x156998){_0x5768c5[_0xf976('0x2b')]=_0x156998;if(_0x33a5ee[_0xf976('0x3f')]['includeAll']){_0x538347[_0xf976('0x53')]=[{'model':db[_0xf976('0x88')],'as':_0xf976('0x89'),'required':![]},{'model':db['User'],'as':_0xf976('0x8a'),'attributes':[_0xf976('0x36'),_0xf976('0x8b'),_0xf976('0x8c')],'required':![]},{'model':db['Tag'],'as':_0xf976('0x8d'),'attributes':['id',_0xf976('0x36'),_0xf976('0x8e')],'where':_0x33a5ee[_0xf976('0x3f')][_0xf976('0x8f')]?{'id':_0x33a5ee['query'][_0xf976('0x8f')]}:undefined,'required':_0x33a5ee[_0xf976('0x3f')][_0xf976('0x8f')]?!![]:![]}];}return db[_0xf976('0x87')][_0xf976('0x54')](_0x538347);})['then'](function(_0x5e94bd){_0x5768c5[_0xf976('0x55')]=_0x5e94bd;return _0x5768c5;});}})[_0xf976('0x1e')](respondWithFilteredResult(_0x599b71,_0x538347))[_0xf976('0x27')](handleError(_0x599b71,null));};exports[_0xf976('0x90')]=function(_0x31fd58,_0x42fd03,_0x9c2299){return db['MailAccount'][_0xf976('0x62')]({'where':{'id':_0x31fd58['params']['id']}})[_0xf976('0x1e')](handleEntityNotFound(_0x42fd03,null))['then'](function(_0x4b9357){if(_0x4b9357){return db['sequelize']['transaction'](function(_0x516ff7){return db[_0xf976('0x91')]['destroy']({'where':{'MailAccountId':_0x31fd58[_0xf976('0x57')]['id']},'transaction':_0x516ff7})['then'](function(_0x14bdbd){var _0x20be87=_[_0xf976('0x4d')](_0x31fd58[_0xf976('0x5a')],function(_0x5b4f1b){_0x5b4f1b[_0xf976('0x5e')]=_0x31fd58[_0xf976('0x57')]['id'];return _0x5b4f1b;});return db[_0xf976('0x91')]['bulkCreate'](_0x20be87,{'transaction':_0x516ff7});});})['then'](function(){return db[_0xf976('0x91')][_0xf976('0x92')]({'where':{'MailAccountId':_0x31fd58['params']['id']},'order':'priority'});});}})[_0xf976('0x1e')](respondWithResult(_0x42fd03,null))['catch'](handleError(_0x42fd03,null));};exports['getApplications']=function(_0x3ef438,_0x451a7b,_0x16db4b){var _0x43a601={};var _0x3d83ef={};var _0x9b245;var _0x3ca0ae;return db[_0xf976('0x3d')][_0xf976('0x62')]({'where':{'id':_0x3ef438['params']['id']}})[_0xf976('0x1e')](handleEntityNotFound(_0x451a7b,null))[_0xf976('0x1e')](function(_0x727eda){if(_0x727eda){_0x9b245=_0x727eda;_0x3d83ef['model']=_['keys'](db[_0xf976('0x91')][_0xf976('0x68')]);_0x3d83ef[_0xf976('0x3f')]=_[_0xf976('0x3e')](_0x3ef438[_0xf976('0x3f')]);_0x3d83ef[_0xf976('0x40')]=_[_0xf976('0x41')](_0x3d83ef[_0xf976('0x42')],_0x3d83ef[_0xf976('0x3f')]);_0x43a601['attributes']=_[_0xf976('0x41')](_0x3d83ef[_0xf976('0x42')],qs[_0xf976('0x44')](_0x3ef438[_0xf976('0x3f')][_0xf976('0x44')]));_0x43a601['attributes']=_0x43a601[_0xf976('0x43')][_0xf976('0x45')]?_0x43a601['attributes']:_0x3d83ef[_0xf976('0x42')];_0x43a601[_0xf976('0x63')]=qs[_0xf976('0x48')](_0x3ef438[_0xf976('0x3f')]['sort']);_0x43a601[_0xf976('0x49')]=qs[_0xf976('0x40')](_[_0xf976('0x4a')](_0x3ef438[_0xf976('0x3f')],_0x3d83ef[_0xf976('0x40')]));if(_0x3ef438['query']['filter']){_0x43a601[_0xf976('0x49')]=_[_0xf976('0x4c')](_0x43a601['where'],{'$or':_['map'](_0x43a601[_0xf976('0x43')],function(_0x147987){var _0x24d8c1={};_0x24d8c1[_0x147987]={'$like':'%'+_0x3ef438[_0xf976('0x3f')][_0xf976('0x4b')]+'%'};return _0x24d8c1;})});}_0x43a601=_[_0xf976('0x4c')]({},_0x43a601,_0x3ef438['options']);return _0x9b245[_0xf976('0x93')](_0x43a601);}})[_0xf976('0x1e')](function(_0x29ea71){if(_0x29ea71){_0x3ca0ae=_0x29ea71[_0xf976('0x45')];if(!_0x3ef438[_0xf976('0x3f')][_0xf976('0x46')](_0xf976('0x47'))){_0x43a601[_0xf976('0x2d')]=qs[_0xf976('0x2d')](_0x3ef438[_0xf976('0x3f')][_0xf976('0x2d')]);_0x43a601['offset']=qs[_0xf976('0x2c')](_0x3ef438[_0xf976('0x3f')][_0xf976('0x2c')]);}return _0x9b245['getApplications'](_0x43a601);}})[_0xf976('0x1e')](function(_0xdafdfe){if(_0xdafdfe){return _0xdafdfe?{'count':_0x3ca0ae,'rows':_0xdafdfe}:null;}})[_0xf976('0x1e')](respondWithResult(_0x451a7b,null))[_0xf976('0x27')](handleError(_0x451a7b,null));};exports[_0xf976('0x94')]=function(_0x16e615,_0x87b78a,_0x37ece9){var _0x22cd1a={'raw':!![],'where':{}};var _0x29af1c={};var _0xe2878c={'count':0x0,'rows':[]};return db[_0xf976('0x3d')]['findOne']({'where':{'id':_0x16e615[_0xf976('0x57')]['id']}})[_0xf976('0x1e')](handleEntityNotFound(_0x87b78a,null))[_0xf976('0x1e')](function(_0x5f2443){if(_0x5f2443){_0x29af1c['model']=_[_0xf976('0x3e')](db[_0xf976('0x95')][_0xf976('0x68')]);_0x29af1c[_0xf976('0x3f')]=_[_0xf976('0x3e')](_0x16e615['query']);_0x29af1c['filters']=_[_0xf976('0x41')](_0x29af1c[_0xf976('0x42')],_0x29af1c['query']);_0x22cd1a['attributes']=_['intersection'](_0x29af1c['model'],qs[_0xf976('0x44')](_0x16e615[_0xf976('0x3f')]['fields']));_0x22cd1a[_0xf976('0x43')]=_0x22cd1a[_0xf976('0x43')][_0xf976('0x45')]?_0x22cd1a[_0xf976('0x43')]:_0x29af1c['model'];if(!_0x16e615[_0xf976('0x3f')][_0xf976('0x46')](_0xf976('0x47'))){_0x22cd1a[_0xf976('0x2d')]=qs[_0xf976('0x2d')](_0x16e615[_0xf976('0x3f')][_0xf976('0x2d')]);_0x22cd1a['offset']=qs[_0xf976('0x2c')](_0x16e615[_0xf976('0x3f')][_0xf976('0x2c')]);}_0x22cd1a[_0xf976('0x63')]=qs[_0xf976('0x48')](_0x16e615[_0xf976('0x3f')][_0xf976('0x48')]);_0x22cd1a['where']=qs[_0xf976('0x40')](_['pick'](_0x16e615['query'],_0x29af1c[_0xf976('0x40')]));_0x22cd1a[_0xf976('0x49')][_0xf976('0x5e')]=_0x5f2443['id'];if(_0x16e615[_0xf976('0x3f')][_0xf976('0x4b')]){_0x22cd1a[_0xf976('0x49')]=_[_0xf976('0x4c')](_0x22cd1a[_0xf976('0x49')],{'$or':_['map'](_0x22cd1a[_0xf976('0x43')],function(_0x5b6a60){var _0x2e06f3={};_0x2e06f3[_0x5b6a60]={'$like':'%'+_0x16e615[_0xf976('0x3f')][_0xf976('0x4b')]+'%'};return _0x2e06f3;})});}if(_0x16e615[_0xf976('0x3f')]['$gte']){var _0x11da46=_0x16e615[_0xf976('0x3f')][_0xf976('0x96')][_0xf976('0x97')](',');var _0x325c49={};_0x325c49[_0x11da46[0x0]]={'$gte':moment(_0x11da46[0x1])[_0xf976('0x98')](_0xf976('0x99'))};_0x22cd1a[_0xf976('0x49')]=_[_0xf976('0x4c')](_0x22cd1a[_0xf976('0x49')],_0x325c49);}_0x22cd1a=_[_0xf976('0x4c')]({},_0x22cd1a,_0x16e615[_0xf976('0x51')]);return db['MailMessage']['count']({'where':_0x22cd1a[_0xf976('0x49')]})[_0xf976('0x1e')](function(_0x4159ca){_0xe2878c[_0xf976('0x2b')]=_0x4159ca;if(_0x16e615['query'][_0xf976('0x52')]){_0x22cd1a[_0xf976('0x53')]=[{'all':!![]}];}return db[_0xf976('0x95')][_0xf976('0x54')](_0x22cd1a);})[_0xf976('0x1e')](function(_0x18e022){_0xe2878c[_0xf976('0x55')]=_0x18e022;return _0xe2878c;});}})[_0xf976('0x1e')](respondWithFilteredResult(_0x87b78a,_0x22cd1a))[_0xf976('0x27')](handleError(_0x87b78a,null));};exports[_0xf976('0x37')]=function(_0x211471,_0x515e38,_0x53615b){var _0x115fc7,_0x47f3c1={},_0xae2b41;if(_0x211471[_0xf976('0x5a')]['to']){_0xae2b41=_0x211471[_0xf976('0x5a')]['to'][_0xf976('0x97')](',')[0x0];}return db['MailAccount'][_0xf976('0x59')]({'where':{'id':_0x211471[_0xf976('0x57')]['id']},'include':[{'model':db[_0xf976('0x9a')],'as':'List','include':[{'model':db[_0xf976('0x88')],'as':_0xf976('0x9b'),'where':{'email':_0xae2b41},'limit':0x1,'order':[['updatedAt',_0xf976('0x9c')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]})['then'](handleEntityNotFound(_0x515e38,null))[_0xf976('0x1e')](function(_0x12cb9a){if(_0x12cb9a){_0x115fc7=_0x12cb9a;if(_0x12cb9a[_0xf976('0x3b')]){if(_[_0xf976('0x6d')](_0x211471[_0xf976('0x5a')][_0xf976('0x9d')])){_0x211471[_0xf976('0x5a')][_0xf976('0x9d')]=util[_0xf976('0x98')]('%s\x20<%s>',_0x12cb9a[_0xf976('0x36')],_0x12cb9a[_0xf976('0x6b')]||_0x12cb9a[_0xf976('0x3b')]['user']);}if(_0x211471['body']['attachments']&&_0x211471[_0xf976('0x5a')][_0xf976('0x9e')]['length']){for(var _0x3503ef=0x0;_0x3503ef<_0x211471[_0xf976('0x5a')][_0xf976('0x9e')][_0xf976('0x45')];_0x3503ef+=0x1){_0x211471[_0xf976('0x5a')][_0xf976('0x9e')][_0x3503ef]={'filename':_0x211471['body'][_0xf976('0x9e')][_0x3503ef][_0xf976('0x36')],'path':path[_0xf976('0x9f')](config['root'],_0xf976('0xa0'),_0x211471[_0xf976('0x5a')][_0xf976('0x9e')][_0x3503ef][_0xf976('0xa1')])};}}var _0x33c00d={'tls':{'rejectUnauthorized':![]}};if(_[_0xf976('0x6d')](_0x12cb9a['Smtp']['service'])){if(_0x12cb9a[_0xf976('0x3b')][_0xf976('0x75')]){_0x33c00d[_0xf976('0xa2')]={'user':_0x12cb9a[_0xf976('0x3b')][_0xf976('0x70')],'pass':_0x12cb9a[_0xf976('0x3b')][_0xf976('0x73')]};}_0x33c00d['host']=_0x12cb9a[_0xf976('0x3b')][_0xf976('0x76')];_0x33c00d[_0xf976('0x77')]=_0x12cb9a[_0xf976('0x3b')][_0xf976('0x77')];_0x33c00d[_0xf976('0xa3')]=_0x12cb9a[_0xf976('0x3b')][_0xf976('0xa3')];}else{_0x33c00d[_0xf976('0xa4')]=_0x12cb9a[_0xf976('0x3b')][_0xf976('0xa4')];_0x33c00d[_0xf976('0xa2')]={'user':_0x12cb9a[_0xf976('0x3b')][_0xf976('0x70')],'pass':_0x12cb9a[_0xf976('0x3b')][_0xf976('0x73')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x33c00d,'message':_0x211471[_0xf976('0x5a')]});}else{throw new Error(_0xf976('0xa5'));}}})[_0xf976('0x1e')](function(_0x1e11fa){if(_0x1e11fa){_0x47f3c1=_0x1e11fa;if(_0x115fc7[_0xf976('0xa6')]){if(_0x115fc7['List'][_0xf976('0x9b')]['length']){return _0x115fc7[_0xf976('0xa6')][_0xf976('0x9b')][0x0];}else{return db[_0xf976('0x88')][_0xf976('0x60')](_[_0xf976('0xa7')](_0x211471[_0xf976('0x5a')],{'firstName':_0x211471[_0xf976('0x5a')]['to'],'email':_0x211471['body']['to'],'phone':_0x211471['body']['to'],'ListId':_0x115fc7[_0xf976('0x6c')]}));}}else{throw new Error(_0xf976('0xa5'));}}})['then'](function(_0x5869fc){if(_0x5869fc){var _0x1424e6={'UserId':_0x211471[_0xf976('0x70')]['id'],'ContactId':_0x5869fc['id'],'MailAccountId':_0x115fc7['id'],'inReplyTo':_0x47f3c1[_0xf976('0xa8')],'to':_0x211471[_0xf976('0x5a')]['from'],'cc':_0x211471['body']['cc'],'subject':_0x211471['body'][_0xf976('0xa9')],'attach':_0x211471[_0xf976('0x5a')][_0xf976('0xaa')],'firstMsgDirection':_0xf976('0xab'),'lastMsgAt':moment()[_0xf976('0x98')](_0xf976('0x99')),'lastMsgDirection':'out','lastMsgBody':_0x211471[_0xf976('0x5a')][_0xf976('0x5a')],'Messages':[_[_0xf976('0x4c')](_0x211471['body'],{'messageId':_0x47f3c1['messageId'],'sentAt':moment()[_0xf976('0x98')](_0xf976('0x99')),'read':!![],'MailAccountId':_0x115fc7['id'],'UserId':_0x211471['user']['id'],'ContactId':_0x5869fc['id']})]};if(_0x211471['body'][_0xf976('0xac')]){_0x1424e6=_[_0xf976('0x4c')](_0x1424e6,_0x211471[_0xf976('0x5a')][_0xf976('0xac')]);}return db[_0xf976('0x87')][_0xf976('0x60')](_0x1424e6,{'include':[{'model':db[_0xf976('0x95')],'as':_0xf976('0xad')}]});}})[_0xf976('0x1e')](respondWithResult(_0x515e38,null))['catch'](handleError(_0x515e38,null));};exports[_0xf976('0xae')]=function(_0x3d8188,_0x72a5d1,_0x5bc5d1){return db[_0xf976('0x3d')]['find']({'where':{'id':_0x3d8188[_0xf976('0x57')]['id']},'include':[{'model':db[_0xf976('0x3a')],'as':_0xf976('0x3b'),'raw':!![]}]})[_0xf976('0x1e')](handleEntityNotFound(_0x72a5d1,null))[_0xf976('0x1e')](function(_0x2d1bef){if(_0x2d1bef&&_0x2d1bef[_0xf976('0x3b')]){var _0x55f12a={'id':_0x2d1bef['id'],'tls':{'rejectUnauthorized':![]}};if(_0x2d1bef[_0xf976('0x3b')]['service']){_0x55f12a[_0xf976('0xa4')]=_0x2d1bef[_0xf976('0x3b')]['service'];}else{_0x55f12a[_0xf976('0x76')]=_0x2d1bef[_0xf976('0x3b')][_0xf976('0x76')];_0x55f12a[_0xf976('0x77')]=_0x2d1bef[_0xf976('0x3b')]['port'];_0x55f12a[_0xf976('0xa3')]=_0x2d1bef[_0xf976('0x3b')][_0xf976('0xa3')];}if(_0x2d1bef[_0xf976('0x3b')][_0xf976('0x75')]){_0x55f12a[_0xf976('0xa2')]={'user':_0x2d1bef[_0xf976('0x3b')]['user'],'pass':_0x2d1bef[_0xf976('0x3b')][_0xf976('0x73')]};}return respondWithRpcPromise(_0xf976('0xaf'),_0xf976('0xae'),{'account':_0x55f12a});}})[_0xf976('0x1e')](respondWithResult(_0x72a5d1,null))[_0xf976('0x27')](handleError(_0x72a5d1,null));};exports[_0xf976('0xb0')]=function(_0x156d1d,_0x1ab717){return db['MailAccount'][_0xf976('0x59')]({'where':{'id':_0x156d1d[_0xf976('0x57')]['id']}})[_0xf976('0x1e')](handleEntityNotFound(_0x1ab717,null))[_0xf976('0x1e')](function(_0x54d9c2){if(_0x54d9c2&&_0x54d9c2[_0xf976('0xa4')]){throw new db[(_0xf976('0xb1'))][(_0xf976('0xb2'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x54d9c2;})[_0xf976('0x1e')](removeEntity(_0x1ab717,null))[_0xf976('0x27')](handleError(_0x1ab717,null));};exports[_0xf976('0xb3')]=function(_0x374362,_0x1d00fb,_0x5861d1){return db[_0xf976('0x3d')][_0xf976('0x59')]({'where':{'id':_0x374362[_0xf976('0x57')]['id']}})[_0xf976('0x1e')](handleEntityNotFound(_0x1d00fb,null))[_0xf976('0x1e')](function(_0xd43b01){if(_0xd43b01){return _0xd43b01[_0xf976('0xb3')](_0x374362['body']['ids'],_[_0xf976('0xb4')](_0x374362['body'],['ids','id'])||{})[_0xf976('0xb5')](function(_0x3cd0d6){for(var _0x118ad9=0x0;_0x118ad9<_0x374362[_0xf976('0x5a')][_0xf976('0x6a')][_0xf976('0x45')];_0x118ad9+=0x1){socket['emit']('userMailAccount:save',{'UserId':_0x374362[_0xf976('0x5a')][_0xf976('0x6a')][_0x118ad9],'MailAccountId':_0x374362['params']['id']});}return _0x3cd0d6;});}})[_0xf976('0x1e')](respondWithResult(_0x1d00fb,null))[_0xf976('0x27')](handleError(_0x1d00fb,null));};exports[_0xf976('0xb6')]=function(_0xfe53f7,_0x3b5583,_0x57f061){return db[_0xf976('0x3d')][_0xf976('0x59')]({'where':{'id':_0xfe53f7[_0xf976('0x57')]['id']}})['then'](handleEntityNotFound(_0x3b5583,null))[_0xf976('0x1e')](function(_0x34e565){if(_0x34e565){return _0x34e565[_0xf976('0xb6')](_0xfe53f7[_0xf976('0x3f')][_0xf976('0x6a')])[_0xf976('0x1e')](function(){if(_['isArray'](_0xfe53f7[_0xf976('0x3f')]['ids'])){for(var _0x41ef4a=0x0;_0x41ef4a<_0xfe53f7['query'][_0xf976('0x6a')][_0xf976('0x45')];_0x41ef4a+=0x1){socket[_0xf976('0xb7')]('userMailAccount:remove',{'UserId':Number(_0xfe53f7[_0xf976('0x3f')]['ids'][_0x41ef4a]),'MailAccountId':Number(_0xfe53f7[_0xf976('0x57')]['id'])});}}else{socket['emit']('userMailAccount:remove',{'UserId':Number(_0xfe53f7[_0xf976('0x3f')]['ids']),'MailAccountId':Number(_0xfe53f7['params']['id'])});}});}})[_0xf976('0x1e')](respondWithStatusCode(_0x3b5583,null))[_0xf976('0x27')](handleError(_0x3b5583,null));};exports[_0xf976('0xb8')]=function(_0x288f64,_0x21a050,_0x54e229){var _0x4c3a58={};var _0x4bd3c0={};var _0xc4695b;var _0x3dbf82;return db['MailAccount'][_0xf976('0x62')]({'where':{'id':_0x288f64[_0xf976('0x57')]['id']}})[_0xf976('0x1e')](handleEntityNotFound(_0x21a050,null))[_0xf976('0x1e')](function(_0x56c689){if(_0x56c689){_0xc4695b=_0x56c689;_0x4bd3c0[_0xf976('0x42')]=_['keys'](db[_0xf976('0xb9')][_0xf976('0x68')]);_0x4bd3c0[_0xf976('0x3f')]=_[_0xf976('0x3e')](_0x288f64[_0xf976('0x3f')]);_0x4bd3c0[_0xf976('0x40')]=_[_0xf976('0x41')](_0x4bd3c0[_0xf976('0x42')],_0x4bd3c0[_0xf976('0x3f')]);_0x4c3a58[_0xf976('0x43')]=_[_0xf976('0x41')](_0x4bd3c0[_0xf976('0x42')],qs[_0xf976('0x44')](_0x288f64[_0xf976('0x3f')][_0xf976('0x44')]));_0x4c3a58[_0xf976('0x43')]=_0x4c3a58[_0xf976('0x43')][_0xf976('0x45')]?_0x4c3a58['attributes']:_0x4bd3c0[_0xf976('0x42')];_0x4c3a58['order']=qs[_0xf976('0x48')](_0x288f64[_0xf976('0x3f')][_0xf976('0x48')]);_0x4c3a58[_0xf976('0x49')]=qs['filters'](_[_0xf976('0x4a')](_0x288f64[_0xf976('0x3f')],_0x4bd3c0[_0xf976('0x40')]));if(_0x288f64[_0xf976('0x3f')]['filter']){_0x4c3a58['where']=_[_0xf976('0x4c')](_0x4c3a58['where'],{'$or':_[_0xf976('0x4d')](_0x4c3a58['attributes'],function(_0x13ea2d){var _0x5a4196={};_0x5a4196[_0x13ea2d]={'$like':'%'+_0x288f64['query'][_0xf976('0x4b')]+'%'};return _0x5a4196;})});}_0x4c3a58=_[_0xf976('0x4c')]({},_0x4c3a58,_0x288f64[_0xf976('0x51')]);return _0xc4695b['getAgents'](_0x4c3a58);}})['then'](function(_0x5e49e0){if(_0x5e49e0){_0x3dbf82=_0x5e49e0[_0xf976('0x45')];if(!_0x288f64[_0xf976('0x3f')]['hasOwnProperty']('nolimit')){_0x4c3a58[_0xf976('0x2d')]=qs[_0xf976('0x2d')](_0x288f64[_0xf976('0x3f')][_0xf976('0x2d')]);_0x4c3a58[_0xf976('0x2c')]=qs[_0xf976('0x2c')](_0x288f64[_0xf976('0x3f')]['offset']);}return _0xc4695b['getAgents'](_0x4c3a58);}})['then'](function(_0x2c42ba){if(_0x2c42ba){return _0x2c42ba?{'count':_0x3dbf82,'rows':_0x2c42ba}:null;}})['then'](respondWithResult(_0x21a050,null))[_0xf976('0x27')](handleError(_0x21a050,null));}; \ No newline at end of file +var _0x1a4a=['map','type','key','field','includeAll','findAll','rows','show','params','Imap','include','options','find','update','body','Smtp','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','hasOwnProperty','removeDispositions','addAnswer','CannedAnswer','removeAnswers','ids','ListId','isNil','active','cservice','cauthentication','user','cuser','password','pass','cpassword','authentication','host','port','service','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MailAccounts','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','getSmtp','removeSmtp','setSmtp','addInteraction','omit','getInteractions','MailInteraction','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','order','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','updatedAt','DESC','from','%s\x20<%s>','email','attachments','join','root','auth','secure','SendMail','sendMail','List\x20not\x20found','messageId','subject','attach','out','Interaction','Messages','verifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','sendStatus','end','json','count','offset','limit','set','apply','reject','destroy','get','UserProfileResource','stack','name','status','send','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','MailAccount','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge'];(function(_0x5c1038,_0x251662){var _0xced345=function(_0xfd145b){while(--_0xfd145b){_0x5c1038['push'](_0x5c1038['shift']());}};_0xced345(++_0x251662);}(_0x1a4a,0x74));var _0xa1a4=function(_0x42eb2d,_0x265545){_0x42eb2d=_0x42eb2d-0x0;var _0x41b84b=_0x1a4a[_0x42eb2d];return _0x41b84b;};'use strict';var pdf=require(_0xa1a4('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa1a4('0x1'));var zipdir=require(_0xa1a4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa1a4('0x3'));var moment=require(_0xa1a4('0x4'));var BPromise=require(_0xa1a4('0x5'));var Mustache=require('mustache');var util=require(_0xa1a4('0x6'));var path=require(_0xa1a4('0x7'));var sox=require(_0xa1a4('0x8'));var csv=require('to-csv');var ejs=require(_0xa1a4('0x9'));var fs=require('fs');var _=require(_0xa1a4('0xa'));var squel=require(_0xa1a4('0xb'));var crypto=require(_0xa1a4('0xc'));var jsforce=require(_0xa1a4('0xd'));var deskjs=require(_0xa1a4('0xe'));var toCsv=require(_0xa1a4('0xf'));var querystring=require(_0xa1a4('0x10'));var Papa=require(_0xa1a4('0x11'));var Redis=require(_0xa1a4('0x12'));var authService=require(_0xa1a4('0x13'));var qs=require(_0xa1a4('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa1a4('0x15'))('api');var utils=require(_0xa1a4('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xa1a4('0x17')]=_[_0xa1a4('0x18')](config[_0xa1a4('0x17')],{'host':_0xa1a4('0x19'),'port':0x18eb});var socket=require(_0xa1a4('0x1a'))(new Redis(config[_0xa1a4('0x17')]));require(_0xa1a4('0x1b'))[_0xa1a4('0x1c')](socket);var jayson=require(_0xa1a4('0x1d'));var client=jayson[_0xa1a4('0x1e')][_0xa1a4('0x1f')]({'port':0x232b});function checkPasswordPattern(_0x4679d6,_0x10f8ea,_0x4c4679){if(_0x4c4679){var _0x131020=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x131020[_0xa1a4('0x20')](_0x10f8ea)){return _0x4679d6;}else{throw new Error(_0xa1a4('0x21'));}}else{return _0x4679d6;}}function respondWithRpcPromise(_0x29f917,_0x5531af,_0x3ae2d6,_0x198f7c){return new BPromise(function(_0x132c4b,_0x3641b7){var _0x2fd4dc=_0x198f7c||client;return _0x2fd4dc[_0xa1a4('0x22')](_0x29f917,_0x3ae2d6)[_0xa1a4('0x23')](function(_0x34e4e2){logger[_0xa1a4('0x24')](_0xa1a4('0x25'),_0x5531af,'request\x20sent');logger[_0xa1a4('0x26')](_0xa1a4('0x27'),_0x5531af,'request\x20sent',JSON[_0xa1a4('0x28')](_0x34e4e2));if(_0x34e4e2[_0xa1a4('0x29')]){if(_0x34e4e2['error'][_0xa1a4('0x2a')]===0x1f4){logger[_0xa1a4('0x29')]('MailAccount,\x20%s,\x20%s',_0x5531af,_0x34e4e2[_0xa1a4('0x29')][_0xa1a4('0x2b')]);return _0x3641b7(_0x34e4e2[_0xa1a4('0x29')][_0xa1a4('0x2b')]);}logger['error']('MailAccount,\x20%s,\x20%s',_0x5531af,_0x34e4e2['error'][_0xa1a4('0x2b')]);return _0x132c4b(_0x34e4e2[_0xa1a4('0x29')][_0xa1a4('0x2b')]);}else{logger[_0xa1a4('0x24')]('MailAccount,\x20%s,\x20%s',_0x5531af,_0xa1a4('0x2c'));_0x132c4b(_0x34e4e2['result'][_0xa1a4('0x2b')]);}})[_0xa1a4('0x2d')](function(_0x1c9027){logger[_0xa1a4('0x29')](_0xa1a4('0x25'),_0x5531af,_0x1c9027);_0x3641b7(_0x1c9027);});});}function respondWithStatusCode(_0x49fd5c,_0xd97758){_0xd97758=_0xd97758||0xcc;return function(_0x42f5b0){if(_0x42f5b0){return _0x49fd5c[_0xa1a4('0x2e')](_0xd97758);}return _0x49fd5c['status'](_0xd97758)[_0xa1a4('0x2f')]();};}function respondWithResult(_0x17325b,_0x479228){_0x479228=_0x479228||0xc8;return function(_0x4a0803){if(_0x4a0803){return _0x17325b['status'](_0x479228)[_0xa1a4('0x30')](_0x4a0803);}};}function respondWithFilteredResult(_0x55bcd8,_0x399a38){return function(_0x3deaf2){if(_0x3deaf2){var _0x100a97=_0x3deaf2[_0xa1a4('0x31')],_0x52e8e7=_0x399a38['offset'],_0x1ac051=_0x399a38[_0xa1a4('0x32')]+_0x399a38[_0xa1a4('0x33')],_0x2de4f7;if(_0x1ac051>=_0x100a97){_0x1ac051=_0x100a97;_0x2de4f7=0xc8;}else{_0x2de4f7=0xce;}_0x55bcd8['status'](_0x2de4f7);return _0x55bcd8[_0xa1a4('0x34')]('Content-Range',_0x52e8e7+'-'+_0x1ac051+'/'+_0x100a97)[_0xa1a4('0x30')](_0x3deaf2);}return null;};}function patchUpdates(_0x15e82e){return function(_0x58de0a){try{jsonpatch[_0xa1a4('0x35')](_0x58de0a,_0x15e82e,!![]);}catch(_0x51f6f3){return BPromise[_0xa1a4('0x36')](_0x51f6f3);}return _0x58de0a['save']();};}function saveUpdates(_0x5d0f02,_0x4b9ed3){return function(_0x35f45){if(_0x35f45){return _0x35f45['update'](_0x5d0f02)['then'](function(_0xc7507e){return _0xc7507e;});}return null;};}function removeEntity(_0x2a0883,_0x104add){return function(_0x33a9c0){if(_0x33a9c0){return _0x33a9c0[_0xa1a4('0x37')]()['then'](function(){var _0x45b3e0=_0x33a9c0[_0xa1a4('0x38')]({'plain':!![]});var _0x3f1d1d='MailAccounts';return db[_0xa1a4('0x39')][_0xa1a4('0x37')]({'where':{'type':_0x3f1d1d,'resourceId':_0x45b3e0['id']}})['then'](function(){return _0x33a9c0;});})[_0xa1a4('0x23')](function(){_0x2a0883['status'](0xcc)[_0xa1a4('0x2f')]();});}};}function handleEntityNotFound(_0x420c2d,_0x1a97fe){return function(_0x5620f5){if(!_0x5620f5){_0x420c2d[_0xa1a4('0x2e')](0x194);}return _0x5620f5;};}function handleError(_0xa73d54,_0x2f5e8c){_0x2f5e8c=_0x2f5e8c||0x1f4;return function(_0x26a717){logger[_0xa1a4('0x29')](_0x26a717[_0xa1a4('0x3a')]);if(_0x26a717[_0xa1a4('0x3b')]){delete _0x26a717[_0xa1a4('0x3b')];}_0xa73d54[_0xa1a4('0x3c')](_0x2f5e8c)[_0xa1a4('0x3d')](_0x26a717);};}exports['index']=function(_0x48fbf7,_0x29d238){var _0x48f7a6={'include':[{'model':db[_0xa1a4('0x3e')],'as':'Imap'},{'model':db[_0xa1a4('0x3f')],'as':'Smtp'},{'model':db[_0xa1a4('0x40')],'as':_0xa1a4('0x41')}]},_0x986649={},_0x5bfa46={'count':0x0,'rows':[]};var _0x4f5ea0=db[_0xa1a4('0x42')][_0xa1a4('0x43')];_0x986649[_0xa1a4('0x44')]=_['keys'](_0x4f5ea0);_0x986649[_0xa1a4('0x45')]=_[_0xa1a4('0x46')](_0x48fbf7['query']);_0x986649[_0xa1a4('0x47')]=_[_0xa1a4('0x48')](_0x986649[_0xa1a4('0x44')],_0x986649[_0xa1a4('0x45')]);_0x48f7a6[_0xa1a4('0x49')]=_['intersection'](_0x986649[_0xa1a4('0x44')],qs[_0xa1a4('0x4a')](_0x48fbf7[_0xa1a4('0x45')][_0xa1a4('0x4a')]));_0x48f7a6[_0xa1a4('0x49')]=_0x48f7a6[_0xa1a4('0x49')][_0xa1a4('0x4b')]?_0x48f7a6[_0xa1a4('0x49')]:_0x986649['model'];if(!_0x48fbf7[_0xa1a4('0x45')]['hasOwnProperty'](_0xa1a4('0x4c'))){_0x48f7a6[_0xa1a4('0x33')]=qs[_0xa1a4('0x33')](_0x48fbf7[_0xa1a4('0x45')][_0xa1a4('0x33')]);_0x48f7a6[_0xa1a4('0x32')]=qs['offset'](_0x48fbf7[_0xa1a4('0x45')]['offset']);}_0x48f7a6['order']=qs['sort'](_0x48fbf7[_0xa1a4('0x45')][_0xa1a4('0x4d')]);_0x48f7a6[_0xa1a4('0x4e')]=qs[_0xa1a4('0x47')](_[_0xa1a4('0x4f')](_0x48fbf7[_0xa1a4('0x45')],_0x986649['filters']));if(_0x48fbf7[_0xa1a4('0x45')][_0xa1a4('0x50')]){_0x48f7a6[_0xa1a4('0x4e')]=_[_0xa1a4('0x51')](_0x48f7a6['where'],{'$or':_[_0xa1a4('0x52')](_0x4f5ea0,function(_0x55a5e5){if(_0x55a5e5[_0xa1a4('0x53')][_0xa1a4('0x54')]!=='VIRTUAL'){var _0x404b0b={};_0x404b0b[_0x55a5e5[_0xa1a4('0x55')]]={'$like':'%'+_0x48fbf7[_0xa1a4('0x45')][_0xa1a4('0x50')]+'%'};return _0x404b0b;}})});}_0x48f7a6=_[_0xa1a4('0x51')]({},_0x48f7a6,_0x48fbf7['options']);var _0x5d6e9a={'where':_0x48f7a6[_0xa1a4('0x4e')]};return db[_0xa1a4('0x42')][_0xa1a4('0x31')](_0x5d6e9a)[_0xa1a4('0x23')](function(_0x3c83ed){_0x5bfa46[_0xa1a4('0x31')]=_0x3c83ed;if(_0x48fbf7['query'][_0xa1a4('0x56')]){_0x48f7a6['include']=[{'all':!![]}];}return db[_0xa1a4('0x42')][_0xa1a4('0x57')](_0x48f7a6);})[_0xa1a4('0x23')](function(_0x588d33){_0x5bfa46[_0xa1a4('0x58')]=_0x588d33;return _0x5bfa46;})[_0xa1a4('0x23')](respondWithFilteredResult(_0x29d238,_0x48f7a6))[_0xa1a4('0x2d')](handleError(_0x29d238,null));};exports[_0xa1a4('0x59')]=function(_0x24d485,_0x10bcd5){var _0x27b5ff={'raw':![],'where':{'id':_0x24d485[_0xa1a4('0x5a')]['id']},'include':[{'model':db[_0xa1a4('0x3e')],'as':_0xa1a4('0x5b')},{'model':db[_0xa1a4('0x3f')],'as':'Smtp'},{'model':db['Pause'],'as':_0xa1a4('0x41')}]},_0x1430e5={};_0x1430e5[_0xa1a4('0x44')]=_[_0xa1a4('0x46')](db[_0xa1a4('0x42')][_0xa1a4('0x43')]);_0x1430e5[_0xa1a4('0x45')]=_['keys'](_0x24d485[_0xa1a4('0x45')]);_0x1430e5['filters']=_[_0xa1a4('0x48')](_0x1430e5[_0xa1a4('0x44')],_0x1430e5['query']);_0x27b5ff[_0xa1a4('0x49')]=_[_0xa1a4('0x48')](_0x1430e5[_0xa1a4('0x44')],qs[_0xa1a4('0x4a')](_0x24d485[_0xa1a4('0x45')][_0xa1a4('0x4a')]));_0x27b5ff[_0xa1a4('0x49')]=_0x27b5ff['attributes'][_0xa1a4('0x4b')]?_0x27b5ff[_0xa1a4('0x49')]:_0x1430e5[_0xa1a4('0x44')];if(_0x24d485[_0xa1a4('0x45')][_0xa1a4('0x56')]){_0x27b5ff[_0xa1a4('0x5c')]=[{'all':!![]}];}_0x27b5ff=_[_0xa1a4('0x51')]({},_0x27b5ff,_0x24d485[_0xa1a4('0x5d')]);return db['MailAccount'][_0xa1a4('0x5e')](_0x27b5ff)['then'](handleEntityNotFound(_0x10bcd5,null))[_0xa1a4('0x23')](respondWithResult(_0x10bcd5,null))[_0xa1a4('0x2d')](handleError(_0x10bcd5,null));};exports[_0xa1a4('0x5f')]=function(_0x46bdc7,_0x3d0526){if(_0x46bdc7[_0xa1a4('0x60')]['id']){delete _0x46bdc7[_0xa1a4('0x60')]['id'];}return db[_0xa1a4('0x42')][_0xa1a4('0x5e')]({'where':{'id':_0x46bdc7[_0xa1a4('0x5a')]['id']},'include':[{'model':db[_0xa1a4('0x3e')],'as':_0xa1a4('0x5b')},{'model':db['MailServerOut'],'as':_0xa1a4('0x61')},{'model':db[_0xa1a4('0x40')],'as':_0xa1a4('0x41')}]})[_0xa1a4('0x23')](handleEntityNotFound(_0x3d0526,null))['then'](saveUpdates(_0x46bdc7[_0xa1a4('0x60')],null))['then'](function(_0x47c28c){if(_0x47c28c&&_0x46bdc7['body'][_0xa1a4('0x5b')]){return db[_0xa1a4('0x3e')][_0xa1a4('0x5f')](_0x46bdc7[_0xa1a4('0x60')][_0xa1a4('0x5b')],{'where':{'MailAccountId':_0x47c28c['id']}})[_0xa1a4('0x23')](function(){return _0x47c28c;});}return _0x47c28c;})[_0xa1a4('0x23')](function(_0x43ef5){if(_0x43ef5&&_0x46bdc7[_0xa1a4('0x60')][_0xa1a4('0x61')]){return db[_0xa1a4('0x3f')][_0xa1a4('0x5f')](_0x46bdc7[_0xa1a4('0x60')][_0xa1a4('0x61')],{'where':{'MailAccountId':_0x43ef5['id']}})[_0xa1a4('0x23')](function(){return _0x43ef5;});}return _0x43ef5;})[_0xa1a4('0x23')](respondWithResult(_0x3d0526,null))[_0xa1a4('0x2d')](handleError(_0x3d0526,null));};exports[_0xa1a4('0x62')]=function(_0x2dd829,_0x2a17a2){return db[_0xa1a4('0x42')][_0xa1a4('0x62')]()[_0xa1a4('0x23')](respondWithResult(_0x2a17a2,null))['catch'](handleError(_0x2a17a2,null));};exports[_0xa1a4('0x63')]=function(_0x269be4,_0x3b9ab1,_0x26eff6){if(_0x269be4['body']['id']){delete _0x269be4[_0xa1a4('0x60')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x269be4[_0xa1a4('0x5a')]['id']}})[_0xa1a4('0x23')](handleEntityNotFound(_0x3b9ab1,null))[_0xa1a4('0x23')](function(_0x22c02a){if(_0x22c02a){_0x269be4['body'][_0xa1a4('0x64')]=_0x22c02a['id'];return db[_0xa1a4('0x65')][_0xa1a4('0x66')](_0x269be4['body']);}})[_0xa1a4('0x23')](respondWithResult(_0x3b9ab1,null))[_0xa1a4('0x2d')](handleError(_0x3b9ab1,null));};exports[_0xa1a4('0x67')]=function(_0x326ba7,_0x464ef7,_0x26e2a6){var _0x485e67={'raw':![],'where':{}};var _0x509d33={};var _0xae5552={'count':0x0,'rows':[]};return db[_0xa1a4('0x42')][_0xa1a4('0x68')]({'where':{'id':_0x326ba7[_0xa1a4('0x5a')]['id']}})[_0xa1a4('0x23')](handleEntityNotFound(_0x464ef7,null))[_0xa1a4('0x23')](function(_0x1d244f){if(_0x1d244f){_0x509d33[_0xa1a4('0x44')]=_[_0xa1a4('0x46')](db[_0xa1a4('0x65')][_0xa1a4('0x43')]);_0x509d33['query']=_[_0xa1a4('0x46')](_0x326ba7[_0xa1a4('0x45')]);_0x509d33[_0xa1a4('0x47')]=_[_0xa1a4('0x48')](_0x509d33['model'],_0x509d33['query']);_0x485e67[_0xa1a4('0x49')]=_[_0xa1a4('0x48')](_0x509d33[_0xa1a4('0x44')],qs[_0xa1a4('0x4a')](_0x326ba7[_0xa1a4('0x45')][_0xa1a4('0x4a')]));_0x485e67[_0xa1a4('0x49')]=_0x485e67[_0xa1a4('0x49')]['length']?_0x485e67[_0xa1a4('0x49')]:_0x509d33[_0xa1a4('0x44')];if(!_0x326ba7['query'][_0xa1a4('0x69')]('nolimit')){_0x485e67['limit']=qs[_0xa1a4('0x33')](_0x326ba7[_0xa1a4('0x45')][_0xa1a4('0x33')]);_0x485e67[_0xa1a4('0x32')]=qs[_0xa1a4('0x32')](_0x326ba7[_0xa1a4('0x45')][_0xa1a4('0x32')]);}_0x485e67['order']=qs[_0xa1a4('0x4d')](_0x326ba7['query']['sort']);_0x485e67[_0xa1a4('0x4e')]=qs[_0xa1a4('0x47')](_[_0xa1a4('0x4f')](_0x326ba7[_0xa1a4('0x45')],_0x509d33['filters']));_0x485e67[_0xa1a4('0x4e')]['MailAccountId']=_0x1d244f['id'];if(_0x326ba7[_0xa1a4('0x45')][_0xa1a4('0x50')]){_0x485e67['where']=_[_0xa1a4('0x51')](_0x485e67[_0xa1a4('0x4e')],{'$or':_[_0xa1a4('0x52')](_0x485e67[_0xa1a4('0x49')],function(_0x4a1b11){var _0x5ef122={};_0x5ef122[_0x4a1b11]={'$like':'%'+_0x326ba7['query']['filter']+'%'};return _0x5ef122;})});}_0x485e67=_[_0xa1a4('0x51')]({},_0x485e67,_0x326ba7[_0xa1a4('0x5d')]);return db['Disposition']['count']({'where':_0x485e67[_0xa1a4('0x4e')]})[_0xa1a4('0x23')](function(_0x2f2b00){_0xae5552[_0xa1a4('0x31')]=_0x2f2b00;if(_0x326ba7[_0xa1a4('0x45')]['includeAll']){_0x485e67['include']=[{'all':!![]}];}return db[_0xa1a4('0x65')][_0xa1a4('0x57')](_0x485e67);})[_0xa1a4('0x23')](function(_0x2f6779){_0xae5552['rows']=_0x2f6779;return _0xae5552;});}})[_0xa1a4('0x23')](respondWithFilteredResult(_0x464ef7,_0x485e67))[_0xa1a4('0x2d')](handleError(_0x464ef7,null));};exports[_0xa1a4('0x6a')]=function(_0x5997b5,_0x133017,_0x1affbc){return db[_0xa1a4('0x42')]['find']({'where':{'id':_0x5997b5[_0xa1a4('0x5a')]['id']}})[_0xa1a4('0x23')](handleEntityNotFound(_0x133017,null))[_0xa1a4('0x23')](function(_0x591c58){if(_0x591c58){return _0x591c58[_0xa1a4('0x6a')](_0x5997b5[_0xa1a4('0x45')]['ids']);}})['then'](respondWithStatusCode(_0x133017,null))[_0xa1a4('0x2d')](handleError(_0x133017,null));};exports[_0xa1a4('0x6b')]=function(_0x1f3c27,_0x873be2,_0x5eb644){if(_0x1f3c27[_0xa1a4('0x60')]['id']){delete _0x1f3c27[_0xa1a4('0x60')]['id'];}return db[_0xa1a4('0x42')]['find']({'where':{'id':_0x1f3c27[_0xa1a4('0x5a')]['id']}})[_0xa1a4('0x23')](handleEntityNotFound(_0x873be2,null))[_0xa1a4('0x23')](function(_0x52ef01){if(_0x52ef01){_0x1f3c27[_0xa1a4('0x60')][_0xa1a4('0x64')]=_0x52ef01['id'];return db[_0xa1a4('0x6c')][_0xa1a4('0x66')](_0x1f3c27[_0xa1a4('0x60')]);}})[_0xa1a4('0x23')](respondWithResult(_0x873be2,null))[_0xa1a4('0x2d')](handleError(_0x873be2,null));};exports['getAnswers']=function(_0x1c5381,_0x407804,_0x5a2b90){var _0x362637={'raw':![],'where':{}};var _0x2cc427={};var _0x313fb6={'count':0x0,'rows':[]};return db['MailAccount'][_0xa1a4('0x68')]({'where':{'id':_0x1c5381[_0xa1a4('0x5a')]['id']}})[_0xa1a4('0x23')](handleEntityNotFound(_0x407804,null))[_0xa1a4('0x23')](function(_0x3fcb08){if(_0x3fcb08){_0x2cc427[_0xa1a4('0x44')]=_['keys'](db['CannedAnswer'][_0xa1a4('0x43')]);_0x2cc427['query']=_[_0xa1a4('0x46')](_0x1c5381[_0xa1a4('0x45')]);_0x2cc427[_0xa1a4('0x47')]=_[_0xa1a4('0x48')](_0x2cc427[_0xa1a4('0x44')],_0x2cc427[_0xa1a4('0x45')]);_0x362637[_0xa1a4('0x49')]=_[_0xa1a4('0x48')](_0x2cc427[_0xa1a4('0x44')],qs[_0xa1a4('0x4a')](_0x1c5381[_0xa1a4('0x45')][_0xa1a4('0x4a')]));_0x362637[_0xa1a4('0x49')]=_0x362637[_0xa1a4('0x49')][_0xa1a4('0x4b')]?_0x362637['attributes']:_0x2cc427[_0xa1a4('0x44')];if(!_0x1c5381[_0xa1a4('0x45')][_0xa1a4('0x69')]('nolimit')){_0x362637[_0xa1a4('0x33')]=qs[_0xa1a4('0x33')](_0x1c5381[_0xa1a4('0x45')][_0xa1a4('0x33')]);_0x362637[_0xa1a4('0x32')]=qs[_0xa1a4('0x32')](_0x1c5381[_0xa1a4('0x45')][_0xa1a4('0x32')]);}_0x362637['order']=qs[_0xa1a4('0x4d')](_0x1c5381[_0xa1a4('0x45')][_0xa1a4('0x4d')]);_0x362637['where']=qs[_0xa1a4('0x47')](_[_0xa1a4('0x4f')](_0x1c5381[_0xa1a4('0x45')],_0x2cc427[_0xa1a4('0x47')]));_0x362637[_0xa1a4('0x4e')][_0xa1a4('0x64')]=_0x3fcb08['id'];if(_0x1c5381[_0xa1a4('0x45')][_0xa1a4('0x50')]){_0x362637['where']=_[_0xa1a4('0x51')](_0x362637['where'],{'$or':_[_0xa1a4('0x52')](_0x362637['attributes'],function(_0x571390){var _0x2ef741={};_0x2ef741[_0x571390]={'$like':'%'+_0x1c5381[_0xa1a4('0x45')][_0xa1a4('0x50')]+'%'};return _0x2ef741;})});}_0x362637=_['merge']({},_0x362637,_0x1c5381[_0xa1a4('0x5d')]);return db[_0xa1a4('0x6c')][_0xa1a4('0x31')]({'where':_0x362637['where']})[_0xa1a4('0x23')](function(_0xb9d1aa){_0x313fb6[_0xa1a4('0x31')]=_0xb9d1aa;if(_0x1c5381['query'][_0xa1a4('0x56')]){_0x362637[_0xa1a4('0x5c')]=[{'all':!![]}];}return db[_0xa1a4('0x6c')][_0xa1a4('0x57')](_0x362637);})[_0xa1a4('0x23')](function(_0x1351a2){_0x313fb6['rows']=_0x1351a2;return _0x313fb6;});}})[_0xa1a4('0x23')](respondWithFilteredResult(_0x407804,_0x362637))[_0xa1a4('0x2d')](handleError(_0x407804,null));};exports[_0xa1a4('0x6d')]=function(_0x1c3e6c,_0x35a43a,_0x49d9a3){return db[_0xa1a4('0x42')][_0xa1a4('0x5e')]({'where':{'id':_0x1c3e6c['params']['id']}})[_0xa1a4('0x23')](handleEntityNotFound(_0x35a43a,null))[_0xa1a4('0x23')](function(_0x365523){if(_0x365523){return _0x365523[_0xa1a4('0x6d')](_0x1c3e6c[_0xa1a4('0x45')][_0xa1a4('0x6e')]);}})[_0xa1a4('0x23')](respondWithStatusCode(_0x35a43a,null))[_0xa1a4('0x2d')](handleError(_0x35a43a,null));};exports[_0xa1a4('0x66')]=function(_0x2623b5,_0xee83cd){var _0x18f7e0={'name':_0x2623b5[_0xa1a4('0x60')][_0xa1a4('0x3b')],'key':_0x2623b5[_0xa1a4('0x60')][_0xa1a4('0x54')],'email':_0x2623b5[_0xa1a4('0x60')]['email'],'ListId':_0x2623b5['body'][_0xa1a4('0x6f')],'active':!_[_0xa1a4('0x70')](_0x2623b5[_0xa1a4('0x60')][_0xa1a4('0x71')])?_0x2623b5[_0xa1a4('0x60')][_0xa1a4('0x71')]:!![],'description':_0x2623b5['body']['description']||null,'Imap':{},'Smtp':{}};if(_[_0xa1a4('0x70')](_0x2623b5[_0xa1a4('0x60')][_0xa1a4('0x72')])){if(_0x2623b5['body'][_0xa1a4('0x73')]){_0x18f7e0[_0xa1a4('0x5b')]['user']=_0x18f7e0[_0xa1a4('0x61')][_0xa1a4('0x74')]=_0x2623b5['body'][_0xa1a4('0x75')];_0x18f7e0[_0xa1a4('0x5b')][_0xa1a4('0x76')]=_0x18f7e0['Smtp'][_0xa1a4('0x77')]=_0x2623b5['body'][_0xa1a4('0x78')];}else{_0x18f7e0[_0xa1a4('0x5b')]['authentication']=_0x18f7e0[_0xa1a4('0x61')][_0xa1a4('0x79')]=![];}_0x18f7e0[_0xa1a4('0x5b')][_0xa1a4('0x7a')]=_0x2623b5[_0xa1a4('0x60')][_0xa1a4('0x5b')][_0xa1a4('0x7a')];_0x18f7e0[_0xa1a4('0x5b')]['port']=_0x2623b5[_0xa1a4('0x60')][_0xa1a4('0x5b')][_0xa1a4('0x7b')];_0x18f7e0[_0xa1a4('0x61')][_0xa1a4('0x7a')]=_0x2623b5[_0xa1a4('0x60')][_0xa1a4('0x61')][_0xa1a4('0x7a')];_0x18f7e0[_0xa1a4('0x61')][_0xa1a4('0x7b')]=_0x2623b5[_0xa1a4('0x60')][_0xa1a4('0x61')][_0xa1a4('0x7b')];}else{_0x18f7e0[_0xa1a4('0x5b')][_0xa1a4('0x7c')]=_0x18f7e0[_0xa1a4('0x61')]['service']=_0x2623b5[_0xa1a4('0x60')]['cservice'];_0x18f7e0[_0xa1a4('0x5b')][_0xa1a4('0x74')]=_0x18f7e0[_0xa1a4('0x61')][_0xa1a4('0x74')]=_0x2623b5[_0xa1a4('0x60')][_0xa1a4('0x75')];_0x18f7e0['Imap'][_0xa1a4('0x76')]=_0x18f7e0[_0xa1a4('0x61')]['pass']=_0x2623b5[_0xa1a4('0x60')][_0xa1a4('0x78')];}return db['MailAccount'][_0xa1a4('0x66')](_0x18f7e0,{'include':[{'model':db[_0xa1a4('0x3f')],'as':_0xa1a4('0x61')},{'model':db[_0xa1a4('0x3e')],'as':_0xa1a4('0x5b')}]})['then'](function(_0x4decd1){var _0x527980=_0x2623b5[_0xa1a4('0x74')]['get']({'plain':!![]});if(!_0x527980)throw new Error(_0xa1a4('0x7d'));if(_0x527980[_0xa1a4('0x7e')]===_0xa1a4('0x74')){var _0x1182cf=_0x4decd1['get']({'plain':!![]});return db['UserProfileSection'][_0xa1a4('0x5e')]({'where':{'name':_0xa1a4('0x7f'),'userProfileId':_0x527980['userProfileId']},'raw':!![]})[_0xa1a4('0x23')](function(_0x4d0074){if(_0x4d0074&&_0x4d0074[_0xa1a4('0x80')]===0x0){return db[_0xa1a4('0x39')][_0xa1a4('0x66')]({'name':_0x1182cf[_0xa1a4('0x3b')],'resourceId':_0x1182cf['id'],'type':_0x4d0074[_0xa1a4('0x3b')],'sectionId':_0x4d0074['id']},{})[_0xa1a4('0x23')](function(){return _0x4decd1;});}else{return _0x4decd1;}})[_0xa1a4('0x2d')](function(_0x564b32){logger[_0xa1a4('0x29')](_0xa1a4('0x81'),_0x564b32);throw _0x564b32;});}return _0x4decd1;})[_0xa1a4('0x23')](respondWithResult(_0xee83cd,0xc9))[_0xa1a4('0x2d')](handleError(_0xee83cd,null));};exports[_0xa1a4('0x82')]=function(_0x12aae1,_0xe943b7,_0x4fd8f7){return db[_0xa1a4('0x42')][_0xa1a4('0x68')]({'where':{'id':_0x12aae1[_0xa1a4('0x5a')]['id']}})[_0xa1a4('0x23')](handleEntityNotFound(_0xe943b7,null))[_0xa1a4('0x23')](function(_0x43f617){if(_0x43f617){return _0x43f617['getImap']();}return null;})[_0xa1a4('0x23')](respondWithResult(_0xe943b7,null))[_0xa1a4('0x2d')](handleError(_0xe943b7,null));};exports[_0xa1a4('0x83')]=function(_0x2595c1,_0x2928d5,_0x25fa46){if(_0x2595c1['body']['id']){delete _0x2595c1[_0xa1a4('0x60')]['id'];}return db[_0xa1a4('0x42')][_0xa1a4('0x5e')]({'where':{'id':_0x2595c1[_0xa1a4('0x5a')]['id']}})[_0xa1a4('0x23')](handleEntityNotFound(_0x2928d5,null))['then'](function(_0x522f80){if(_0x522f80){_0x2595c1['body'][_0xa1a4('0x64')]=_0x522f80['id'];return db[_0xa1a4('0x3e')]['create'](_0x2595c1[_0xa1a4('0x60')]);}})[_0xa1a4('0x23')](respondWithResult(_0x2928d5,null))[_0xa1a4('0x2d')](handleError(_0x2928d5,null));};exports[_0xa1a4('0x84')]=function(_0x8692ba,_0x5be86d,_0x3a5cc4){return db[_0xa1a4('0x42')][_0xa1a4('0x68')]({'where':{'id':_0x8692ba[_0xa1a4('0x5a')]['id']}})[_0xa1a4('0x23')](handleEntityNotFound(_0x5be86d,null))[_0xa1a4('0x23')](function(_0x46df74){if(_0x46df74){return _0x46df74['setImap'](null);}return null;})[_0xa1a4('0x23')](respondWithStatusCode(_0x5be86d,null))[_0xa1a4('0x2d')](handleError(_0x5be86d,null));};exports[_0xa1a4('0x85')]=function(_0x674eb9,_0x1cf9a6,_0xe67364){return db[_0xa1a4('0x42')][_0xa1a4('0x68')]({'where':{'id':_0x674eb9[_0xa1a4('0x5a')]['id']}})[_0xa1a4('0x23')](handleEntityNotFound(_0x1cf9a6,null))[_0xa1a4('0x23')](function(_0x328543){if(_0x328543){return _0x328543[_0xa1a4('0x85')]();}return null;})[_0xa1a4('0x23')](respondWithResult(_0x1cf9a6,null))[_0xa1a4('0x2d')](handleError(_0x1cf9a6,null));};exports['addSmtp']=function(_0x1a2d29,_0x51c09f,_0x317a90){if(_0x1a2d29[_0xa1a4('0x60')]['id']){delete _0x1a2d29['body']['id'];}return db[_0xa1a4('0x42')][_0xa1a4('0x5e')]({'where':{'id':_0x1a2d29[_0xa1a4('0x5a')]['id']}})[_0xa1a4('0x23')](handleEntityNotFound(_0x51c09f,null))[_0xa1a4('0x23')](function(_0x1ad67a){if(_0x1ad67a){_0x1a2d29['body']['MailAccountId']=_0x1ad67a['id'];return db[_0xa1a4('0x3f')][_0xa1a4('0x66')](_0x1a2d29[_0xa1a4('0x60')]);}})[_0xa1a4('0x23')](respondWithResult(_0x51c09f,null))[_0xa1a4('0x2d')](handleError(_0x51c09f,null));};exports[_0xa1a4('0x86')]=function(_0x486275,_0x2ef875,_0x5311f6){return db[_0xa1a4('0x42')][_0xa1a4('0x68')]({'where':{'id':_0x486275[_0xa1a4('0x5a')]['id']}})[_0xa1a4('0x23')](handleEntityNotFound(_0x2ef875,null))[_0xa1a4('0x23')](function(_0x1a3fc0){if(_0x1a3fc0){return _0x1a3fc0[_0xa1a4('0x87')](null);}return null;})['then'](respondWithStatusCode(_0x2ef875,null))['catch'](handleError(_0x2ef875,null));};exports[_0xa1a4('0x88')]=function(_0x4c6431,_0x47faee,_0x1db350){return db['MailInteraction'][_0xa1a4('0x5e')]({'where':{'id':_0x4c6431[_0xa1a4('0x5a')]['id']}})[_0xa1a4('0x23')](handleEntityNotFound(_0x47faee,null))[_0xa1a4('0x23')](function(_0x214757){if(_0x214757){return _0x214757[_0xa1a4('0x88')](_0x4c6431[_0xa1a4('0x60')][_0xa1a4('0x6e')],_[_0xa1a4('0x89')](_0x4c6431['body'],['ids','id'])||{});}})[_0xa1a4('0x23')](respondWithResult(_0x47faee,null))[_0xa1a4('0x2d')](handleError(_0x47faee,null));};exports[_0xa1a4('0x8a')]=function(_0x5b5f71,_0x4346bc,_0x57bd69){var _0x468189={'raw':![],'where':{}};var _0x597f00={};var _0x150612={'count':0x0,'rows':[]};return db['MailAccount'][_0xa1a4('0x68')]({'where':{'id':_0x5b5f71[_0xa1a4('0x5a')]['id']}})[_0xa1a4('0x23')](handleEntityNotFound(_0x4346bc,null))[_0xa1a4('0x23')](function(_0x542444){if(_0x542444){_0x597f00[_0xa1a4('0x44')]=_['keys'](db[_0xa1a4('0x8b')][_0xa1a4('0x43')]);_0x597f00['query']=_[_0xa1a4('0x46')](_0x5b5f71['query']);_0x597f00[_0xa1a4('0x47')]=_['intersection'](_0x597f00[_0xa1a4('0x44')],_0x597f00[_0xa1a4('0x45')]);_0x468189[_0xa1a4('0x49')]=_[_0xa1a4('0x48')](_0x597f00[_0xa1a4('0x44')],qs[_0xa1a4('0x4a')](_0x5b5f71[_0xa1a4('0x45')]['fields']));_0x468189[_0xa1a4('0x49')]=_0x468189['attributes'][_0xa1a4('0x4b')]?_0x468189['attributes']:_0x597f00[_0xa1a4('0x44')];if(!_0x5b5f71[_0xa1a4('0x45')][_0xa1a4('0x69')](_0xa1a4('0x4c'))){_0x468189[_0xa1a4('0x33')]=qs[_0xa1a4('0x33')](_0x5b5f71[_0xa1a4('0x45')][_0xa1a4('0x33')]);_0x468189['offset']=qs[_0xa1a4('0x32')](_0x5b5f71[_0xa1a4('0x45')][_0xa1a4('0x32')]);}_0x468189['order']=qs[_0xa1a4('0x4d')](_0x5b5f71['query'][_0xa1a4('0x4d')]);_0x468189['where']=qs[_0xa1a4('0x47')](_[_0xa1a4('0x4f')](_0x5b5f71[_0xa1a4('0x45')],_0x597f00[_0xa1a4('0x47')]));_0x468189[_0xa1a4('0x4e')][_0xa1a4('0x64')]=_0x542444['id'];if(_0x5b5f71['query']['filter']){_0x468189['where']=_[_0xa1a4('0x51')](_0x468189[_0xa1a4('0x4e')],{'$or':_[_0xa1a4('0x52')](_0x468189[_0xa1a4('0x49')],function(_0x4dd823){var _0x260a9a={};_0x260a9a[_0x4dd823]={'$like':'%'+_0x5b5f71[_0xa1a4('0x45')][_0xa1a4('0x50')]+'%'};return _0x260a9a;})});}_0x468189=_[_0xa1a4('0x51')]({},_0x468189,_0x5b5f71[_0xa1a4('0x5d')]);return db['MailInteraction'][_0xa1a4('0x31')]({'where':_0x468189['where']})['then'](function(_0x1db984){_0x150612['count']=_0x1db984;if(_0x5b5f71[_0xa1a4('0x45')]['includeAll']){_0x468189['include']=[{'model':db[_0xa1a4('0x8c')],'as':_0xa1a4('0x8d'),'required':![]},{'model':db[_0xa1a4('0x8e')],'as':_0xa1a4('0x8f'),'attributes':[_0xa1a4('0x3b'),_0xa1a4('0x90'),_0xa1a4('0x91')],'required':![]},{'model':db[_0xa1a4('0x92')],'as':_0xa1a4('0x93'),'attributes':['id',_0xa1a4('0x3b'),_0xa1a4('0x94')],'where':_0x5b5f71[_0xa1a4('0x45')][_0xa1a4('0x95')]?{'id':_0x5b5f71['query'][_0xa1a4('0x95')]}:undefined,'required':_0x5b5f71['query'][_0xa1a4('0x95')]?!![]:![]}];}return db[_0xa1a4('0x8b')][_0xa1a4('0x57')](_0x468189);})[_0xa1a4('0x23')](function(_0x2d408a){_0x150612[_0xa1a4('0x58')]=_0x2d408a;return _0x150612;});}})['then'](respondWithFilteredResult(_0x4346bc,_0x468189))['catch'](handleError(_0x4346bc,null));};exports[_0xa1a4('0x96')]=function(_0x4ac63b,_0x68e62f,_0x1c8149){return db[_0xa1a4('0x42')][_0xa1a4('0x68')]({'where':{'id':_0x4ac63b[_0xa1a4('0x5a')]['id']}})[_0xa1a4('0x23')](handleEntityNotFound(_0x68e62f,null))[_0xa1a4('0x23')](function(_0x1546fa){if(_0x1546fa){return db[_0xa1a4('0x97')][_0xa1a4('0x98')](function(_0xbb9b78){return db[_0xa1a4('0x99')][_0xa1a4('0x37')]({'where':{'MailAccountId':_0x4ac63b[_0xa1a4('0x5a')]['id']},'transaction':_0xbb9b78})[_0xa1a4('0x23')](function(_0x372c6f){var _0x3bb9f4=_['map'](_0x4ac63b[_0xa1a4('0x60')],function(_0x592f69){_0x592f69[_0xa1a4('0x64')]=_0x4ac63b[_0xa1a4('0x5a')]['id'];return _0x592f69;});return db['MailApplication'][_0xa1a4('0x9a')](_0x3bb9f4,{'transaction':_0xbb9b78});});})['then'](function(){return db['MailApplication'][_0xa1a4('0x9b')]({'where':{'MailAccountId':_0x4ac63b[_0xa1a4('0x5a')]['id']},'order':_0xa1a4('0x9c')});});}})[_0xa1a4('0x23')](respondWithResult(_0x68e62f,null))[_0xa1a4('0x2d')](handleError(_0x68e62f,null));};exports[_0xa1a4('0x9d')]=function(_0x11d34c,_0x147fb0,_0x3b1043){var _0x59edb3={};var _0x24ac0f={};var _0x513b7d;var _0x68ef5c;return db[_0xa1a4('0x42')][_0xa1a4('0x68')]({'where':{'id':_0x11d34c[_0xa1a4('0x5a')]['id']}})['then'](handleEntityNotFound(_0x147fb0,null))['then'](function(_0x382c0a){if(_0x382c0a){_0x513b7d=_0x382c0a;_0x24ac0f['model']=_[_0xa1a4('0x46')](db[_0xa1a4('0x99')]['rawAttributes']);_0x24ac0f['query']=_[_0xa1a4('0x46')](_0x11d34c['query']);_0x24ac0f[_0xa1a4('0x47')]=_[_0xa1a4('0x48')](_0x24ac0f[_0xa1a4('0x44')],_0x24ac0f[_0xa1a4('0x45')]);_0x59edb3[_0xa1a4('0x49')]=_[_0xa1a4('0x48')](_0x24ac0f[_0xa1a4('0x44')],qs[_0xa1a4('0x4a')](_0x11d34c[_0xa1a4('0x45')][_0xa1a4('0x4a')]));_0x59edb3['attributes']=_0x59edb3[_0xa1a4('0x49')][_0xa1a4('0x4b')]?_0x59edb3[_0xa1a4('0x49')]:_0x24ac0f[_0xa1a4('0x44')];_0x59edb3[_0xa1a4('0x9e')]=qs[_0xa1a4('0x4d')](_0x11d34c[_0xa1a4('0x45')]['sort']);_0x59edb3[_0xa1a4('0x4e')]=qs[_0xa1a4('0x47')](_[_0xa1a4('0x4f')](_0x11d34c[_0xa1a4('0x45')],_0x24ac0f[_0xa1a4('0x47')]));if(_0x11d34c[_0xa1a4('0x45')][_0xa1a4('0x50')]){_0x59edb3[_0xa1a4('0x4e')]=_['merge'](_0x59edb3[_0xa1a4('0x4e')],{'$or':_[_0xa1a4('0x52')](_0x59edb3[_0xa1a4('0x49')],function(_0x3f876a){var _0x558673={};_0x558673[_0x3f876a]={'$like':'%'+_0x11d34c[_0xa1a4('0x45')][_0xa1a4('0x50')]+'%'};return _0x558673;})});}_0x59edb3=_[_0xa1a4('0x51')]({},_0x59edb3,_0x11d34c['options']);return _0x513b7d[_0xa1a4('0x9d')](_0x59edb3);}})[_0xa1a4('0x23')](function(_0x357f8e){if(_0x357f8e){_0x68ef5c=_0x357f8e[_0xa1a4('0x4b')];if(!_0x11d34c[_0xa1a4('0x45')][_0xa1a4('0x69')](_0xa1a4('0x4c'))){_0x59edb3[_0xa1a4('0x33')]=qs[_0xa1a4('0x33')](_0x11d34c[_0xa1a4('0x45')]['limit']);_0x59edb3['offset']=qs[_0xa1a4('0x32')](_0x11d34c['query'][_0xa1a4('0x32')]);}return _0x513b7d[_0xa1a4('0x9d')](_0x59edb3);}})['then'](function(_0x467558){if(_0x467558){return _0x467558?{'count':_0x68ef5c,'rows':_0x467558}:null;}})['then'](respondWithResult(_0x147fb0,null))[_0xa1a4('0x2d')](handleError(_0x147fb0,null));};exports[_0xa1a4('0x9f')]=function(_0xf3f9cd,_0x4e67ab,_0x25be87){var _0x364a38={'raw':!![],'where':{}};var _0x10e1e5={};var _0x9529e5={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0xf3f9cd[_0xa1a4('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4e67ab,null))['then'](function(_0x1f7241){if(_0x1f7241){_0x10e1e5[_0xa1a4('0x44')]=_[_0xa1a4('0x46')](db[_0xa1a4('0xa0')][_0xa1a4('0x43')]);_0x10e1e5[_0xa1a4('0x45')]=_[_0xa1a4('0x46')](_0xf3f9cd['query']);_0x10e1e5[_0xa1a4('0x47')]=_[_0xa1a4('0x48')](_0x10e1e5[_0xa1a4('0x44')],_0x10e1e5[_0xa1a4('0x45')]);_0x364a38[_0xa1a4('0x49')]=_[_0xa1a4('0x48')](_0x10e1e5[_0xa1a4('0x44')],qs[_0xa1a4('0x4a')](_0xf3f9cd['query']['fields']));_0x364a38[_0xa1a4('0x49')]=_0x364a38[_0xa1a4('0x49')][_0xa1a4('0x4b')]?_0x364a38[_0xa1a4('0x49')]:_0x10e1e5[_0xa1a4('0x44')];if(!_0xf3f9cd['query'][_0xa1a4('0x69')](_0xa1a4('0x4c'))){_0x364a38[_0xa1a4('0x33')]=qs['limit'](_0xf3f9cd[_0xa1a4('0x45')]['limit']);_0x364a38[_0xa1a4('0x32')]=qs[_0xa1a4('0x32')](_0xf3f9cd['query'][_0xa1a4('0x32')]);}_0x364a38[_0xa1a4('0x9e')]=qs[_0xa1a4('0x4d')](_0xf3f9cd[_0xa1a4('0x45')][_0xa1a4('0x4d')]);_0x364a38[_0xa1a4('0x4e')]=qs[_0xa1a4('0x47')](_[_0xa1a4('0x4f')](_0xf3f9cd[_0xa1a4('0x45')],_0x10e1e5[_0xa1a4('0x47')]));_0x364a38['where'][_0xa1a4('0x64')]=_0x1f7241['id'];if(_0xf3f9cd[_0xa1a4('0x45')]['filter']){_0x364a38[_0xa1a4('0x4e')]=_[_0xa1a4('0x51')](_0x364a38[_0xa1a4('0x4e')],{'$or':_['map'](_0x364a38[_0xa1a4('0x49')],function(_0x591fbb){var _0x670781={};_0x670781[_0x591fbb]={'$like':'%'+_0xf3f9cd[_0xa1a4('0x45')][_0xa1a4('0x50')]+'%'};return _0x670781;})});}if(_0xf3f9cd[_0xa1a4('0x45')]['$gte']){var _0x46011c=_0xf3f9cd[_0xa1a4('0x45')][_0xa1a4('0xa1')][_0xa1a4('0xa2')](',');var _0x19ddb5={};_0x19ddb5[_0x46011c[0x0]]={'$gte':moment(_0x46011c[0x1])[_0xa1a4('0xa3')](_0xa1a4('0xa4'))};_0x364a38['where']=_[_0xa1a4('0x51')](_0x364a38[_0xa1a4('0x4e')],_0x19ddb5);}_0x364a38=_[_0xa1a4('0x51')]({},_0x364a38,_0xf3f9cd['options']);return db['MailMessage'][_0xa1a4('0x31')]({'where':_0x364a38['where']})[_0xa1a4('0x23')](function(_0x5924f5){_0x9529e5[_0xa1a4('0x31')]=_0x5924f5;if(_0xf3f9cd[_0xa1a4('0x45')][_0xa1a4('0x56')]){_0x364a38[_0xa1a4('0x5c')]=[{'all':!![]}];}return db[_0xa1a4('0xa0')]['findAll'](_0x364a38);})[_0xa1a4('0x23')](function(_0x29af35){_0x9529e5[_0xa1a4('0x58')]=_0x29af35;return _0x9529e5;});}})[_0xa1a4('0x23')](respondWithFilteredResult(_0x4e67ab,_0x364a38))[_0xa1a4('0x2d')](handleError(_0x4e67ab,null));};exports[_0xa1a4('0x3d')]=function(_0x166cc1,_0x39078d,_0x2cb388){var _0x2963d0,_0x24e665={},_0x278ff8;if(_0x166cc1['body']['to']){_0x278ff8=_0x166cc1['body']['to']['split'](',')[0x0];}return db[_0xa1a4('0x42')][_0xa1a4('0x5e')]({'where':{'id':_0x166cc1[_0xa1a4('0x5a')]['id']},'include':[{'model':db[_0xa1a4('0xa5')],'as':_0xa1a4('0xa6'),'include':[{'model':db[_0xa1a4('0x8c')],'as':_0xa1a4('0xa7'),'where':{'email':_0x278ff8},'limit':0x1,'order':[[_0xa1a4('0xa8'),_0xa1a4('0xa9')]]}]},{'model':db['MailServerOut'],'as':_0xa1a4('0x61'),'raw':!![]}]})[_0xa1a4('0x23')](handleEntityNotFound(_0x39078d,null))['then'](function(_0xb8c209){if(_0xb8c209){_0x2963d0=_0xb8c209;if(_0xb8c209[_0xa1a4('0x61')]){if(_[_0xa1a4('0x70')](_0x166cc1[_0xa1a4('0x60')][_0xa1a4('0xaa')])){_0x166cc1[_0xa1a4('0x60')]['from']=util[_0xa1a4('0xa3')](_0xa1a4('0xab'),_0xb8c209[_0xa1a4('0x3b')],_0xb8c209[_0xa1a4('0xac')]||_0xb8c209[_0xa1a4('0x61')]['user']);}if(_0x166cc1[_0xa1a4('0x60')][_0xa1a4('0xad')]&&_0x166cc1['body'][_0xa1a4('0xad')][_0xa1a4('0x4b')]){for(var _0x47b512=0x0;_0x47b512<_0x166cc1[_0xa1a4('0x60')][_0xa1a4('0xad')]['length'];_0x47b512+=0x1){_0x166cc1[_0xa1a4('0x60')]['attachments'][_0x47b512]={'filename':_0x166cc1[_0xa1a4('0x60')]['attachments'][_0x47b512][_0xa1a4('0x3b')],'path':path[_0xa1a4('0xae')](config[_0xa1a4('0xaf')],'server/files/attachments',_0x166cc1['body'][_0xa1a4('0xad')][_0x47b512]['basename'])};}}var _0x2262d4={'tls':{'rejectUnauthorized':![]}};if(_[_0xa1a4('0x70')](_0xb8c209[_0xa1a4('0x61')][_0xa1a4('0x7c')])){if(_0xb8c209[_0xa1a4('0x61')]['authentication']){_0x2262d4[_0xa1a4('0xb0')]={'user':_0xb8c209[_0xa1a4('0x61')]['user'],'pass':_0xb8c209[_0xa1a4('0x61')]['pass']};}_0x2262d4[_0xa1a4('0x7a')]=_0xb8c209[_0xa1a4('0x61')][_0xa1a4('0x7a')];_0x2262d4[_0xa1a4('0x7b')]=_0xb8c209[_0xa1a4('0x61')][_0xa1a4('0x7b')];_0x2262d4[_0xa1a4('0xb1')]=_0xb8c209[_0xa1a4('0x61')][_0xa1a4('0xb1')];}else{_0x2262d4[_0xa1a4('0x7c')]=_0xb8c209[_0xa1a4('0x61')][_0xa1a4('0x7c')];_0x2262d4['auth']={'user':_0xb8c209[_0xa1a4('0x61')]['user'],'pass':_0xb8c209[_0xa1a4('0x61')][_0xa1a4('0x77')]};}return respondWithRpcPromise(_0xa1a4('0xb2'),_0xa1a4('0xb3'),{'account':_0x2262d4,'message':_0x166cc1[_0xa1a4('0x60')]});}else{throw new Error(_0xa1a4('0xb4'));}}})[_0xa1a4('0x23')](function(_0xf7e585){if(_0xf7e585){_0x24e665=_0xf7e585;if(_0x2963d0[_0xa1a4('0xa6')]){if(_0x2963d0['List'][_0xa1a4('0xa7')][_0xa1a4('0x4b')]){return _0x2963d0['List'][_0xa1a4('0xa7')][0x0];}else{return db['CmContact'][_0xa1a4('0x66')](_[_0xa1a4('0x18')](_0x166cc1[_0xa1a4('0x60')],{'firstName':_0x166cc1[_0xa1a4('0x60')]['to'],'email':_0x166cc1[_0xa1a4('0x60')]['to'],'phone':_0x166cc1[_0xa1a4('0x60')]['to'],'ListId':_0x2963d0[_0xa1a4('0x6f')]}));}}else{throw new Error('List\x20not\x20found');}}})['then'](function(_0x1035af){if(_0x1035af){var _0x49175b={'UserId':_0x166cc1['user']['id'],'ContactId':_0x1035af['id'],'MailAccountId':_0x2963d0['id'],'inReplyTo':_0x24e665[_0xa1a4('0xb5')],'to':_0x166cc1[_0xa1a4('0x60')][_0xa1a4('0xaa')],'cc':_0x166cc1[_0xa1a4('0x60')]['cc'],'subject':_0x166cc1[_0xa1a4('0x60')][_0xa1a4('0xb6')],'attach':_0x166cc1[_0xa1a4('0x60')][_0xa1a4('0xb7')],'firstMsgDirection':'out','lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0xa1a4('0xb8'),'lastMsgBody':_0x166cc1[_0xa1a4('0x60')]['body'],'Messages':[_[_0xa1a4('0x51')](_0x166cc1[_0xa1a4('0x60')],{'messageId':_0x24e665[_0xa1a4('0xb5')],'sentAt':moment()[_0xa1a4('0xa3')](_0xa1a4('0xa4')),'read':!![],'MailAccountId':_0x2963d0['id'],'UserId':_0x166cc1['user']['id'],'ContactId':_0x1035af['id']})]};if(_0x166cc1[_0xa1a4('0x60')]['Interaction']){_0x49175b=_['merge'](_0x49175b,_0x166cc1[_0xa1a4('0x60')][_0xa1a4('0xb9')]);}return db['MailInteraction']['create'](_0x49175b,{'include':[{'model':db[_0xa1a4('0xa0')],'as':_0xa1a4('0xba')}]});}})[_0xa1a4('0x23')](respondWithResult(_0x39078d,null))[_0xa1a4('0x2d')](handleError(_0x39078d,null));};exports[_0xa1a4('0xbb')]=function(_0x3da677,_0x2103c5,_0x4f09cd){return db[_0xa1a4('0x42')][_0xa1a4('0x5e')]({'where':{'id':_0x3da677[_0xa1a4('0x5a')]['id']},'include':[{'model':db['MailServerOut'],'as':_0xa1a4('0x61'),'raw':!![]}]})[_0xa1a4('0x23')](handleEntityNotFound(_0x2103c5,null))['then'](function(_0x43e5bb){if(_0x43e5bb&&_0x43e5bb[_0xa1a4('0x61')]){var _0x434d3b={'id':_0x43e5bb['id'],'tls':{'rejectUnauthorized':![]}};if(_0x43e5bb[_0xa1a4('0x61')]['service']){_0x434d3b[_0xa1a4('0x7c')]=_0x43e5bb[_0xa1a4('0x61')][_0xa1a4('0x7c')];}else{_0x434d3b[_0xa1a4('0x7a')]=_0x43e5bb['Smtp'][_0xa1a4('0x7a')];_0x434d3b['port']=_0x43e5bb[_0xa1a4('0x61')][_0xa1a4('0x7b')];_0x434d3b['secure']=_0x43e5bb[_0xa1a4('0x61')]['secure'];}if(_0x43e5bb[_0xa1a4('0x61')][_0xa1a4('0x79')]){_0x434d3b[_0xa1a4('0xb0')]={'user':_0x43e5bb[_0xa1a4('0x61')]['user'],'pass':_0x43e5bb[_0xa1a4('0x61')]['pass']};}return respondWithRpcPromise('VerifySmtp','verifySmtp',{'account':_0x434d3b});}})[_0xa1a4('0x23')](respondWithResult(_0x2103c5,null))[_0xa1a4('0x2d')](handleError(_0x2103c5,null));};exports[_0xa1a4('0x37')]=function(_0x446676,_0x5b4882){return db['MailAccount']['find']({'where':{'id':_0x446676[_0xa1a4('0x5a')]['id']}})['then'](handleEntityNotFound(_0x5b4882,null))[_0xa1a4('0x23')](function(_0x3e3a48){if(_0x3e3a48&&_0x3e3a48[_0xa1a4('0x7c')]){throw new db['Sequelize'][(_0xa1a4('0xbc'))](_0xa1a4('0xbd'));}return _0x3e3a48;})[_0xa1a4('0x23')](removeEntity(_0x5b4882,null))[_0xa1a4('0x2d')](handleError(_0x5b4882,null));};exports[_0xa1a4('0xbe')]=function(_0x3aa590,_0x42956b,_0x2b0724){return db[_0xa1a4('0x42')][_0xa1a4('0x5e')]({'where':{'id':_0x3aa590[_0xa1a4('0x5a')]['id']}})[_0xa1a4('0x23')](handleEntityNotFound(_0x42956b,null))[_0xa1a4('0x23')](function(_0x312913){if(_0x312913){return _0x312913[_0xa1a4('0xbe')](_0x3aa590[_0xa1a4('0x60')][_0xa1a4('0x6e')],_[_0xa1a4('0x89')](_0x3aa590[_0xa1a4('0x60')],[_0xa1a4('0x6e'),'id'])||{})[_0xa1a4('0xbf')](function(_0x36d86e){for(var _0xeaf7a4=0x0;_0xeaf7a4<_0x3aa590[_0xa1a4('0x60')][_0xa1a4('0x6e')][_0xa1a4('0x4b')];_0xeaf7a4+=0x1){socket[_0xa1a4('0xc0')](_0xa1a4('0xc1'),{'UserId':_0x3aa590[_0xa1a4('0x60')][_0xa1a4('0x6e')][_0xeaf7a4],'MailAccountId':_0x3aa590[_0xa1a4('0x5a')]['id']});}return _0x36d86e;});}})['then'](respondWithResult(_0x42956b,null))[_0xa1a4('0x2d')](handleError(_0x42956b,null));};exports[_0xa1a4('0xc2')]=function(_0x19aaa6,_0x1c9ebf,_0x3b5ecd){return db[_0xa1a4('0x42')]['find']({'where':{'id':_0x19aaa6['params']['id']}})[_0xa1a4('0x23')](handleEntityNotFound(_0x1c9ebf,null))[_0xa1a4('0x23')](function(_0x83c6bc){if(_0x83c6bc){return _0x83c6bc[_0xa1a4('0xc2')](_0x19aaa6[_0xa1a4('0x45')][_0xa1a4('0x6e')])[_0xa1a4('0x23')](function(){if(_[_0xa1a4('0xc3')](_0x19aaa6[_0xa1a4('0x45')]['ids'])){for(var _0x5bc654=0x0;_0x5bc654<_0x19aaa6[_0xa1a4('0x45')][_0xa1a4('0x6e')][_0xa1a4('0x4b')];_0x5bc654+=0x1){socket[_0xa1a4('0xc0')](_0xa1a4('0xc4'),{'UserId':Number(_0x19aaa6[_0xa1a4('0x45')]['ids'][_0x5bc654]),'MailAccountId':Number(_0x19aaa6[_0xa1a4('0x5a')]['id'])});}}else{socket[_0xa1a4('0xc0')](_0xa1a4('0xc4'),{'UserId':Number(_0x19aaa6[_0xa1a4('0x45')]['ids']),'MailAccountId':Number(_0x19aaa6[_0xa1a4('0x5a')]['id'])});}});}})[_0xa1a4('0x23')](respondWithStatusCode(_0x1c9ebf,null))['catch'](handleError(_0x1c9ebf,null));};exports[_0xa1a4('0xc5')]=function(_0x459386,_0x279865,_0x5a6215){var _0x4ddec9={};var _0x327e3e={};var _0x4029d9;var _0x5730ed;return db[_0xa1a4('0x42')][_0xa1a4('0x68')]({'where':{'id':_0x459386[_0xa1a4('0x5a')]['id']}})[_0xa1a4('0x23')](handleEntityNotFound(_0x279865,null))[_0xa1a4('0x23')](function(_0x47b434){if(_0x47b434){_0x4029d9=_0x47b434;_0x327e3e[_0xa1a4('0x44')]=_[_0xa1a4('0x46')](db['User'][_0xa1a4('0x43')]);_0x327e3e['query']=_[_0xa1a4('0x46')](_0x459386['query']);_0x327e3e[_0xa1a4('0x47')]=_['intersection'](_0x327e3e['model'],_0x327e3e[_0xa1a4('0x45')]);_0x4ddec9[_0xa1a4('0x49')]=_[_0xa1a4('0x48')](_0x327e3e[_0xa1a4('0x44')],qs[_0xa1a4('0x4a')](_0x459386['query'][_0xa1a4('0x4a')]));_0x4ddec9[_0xa1a4('0x49')]=_0x4ddec9[_0xa1a4('0x49')]['length']?_0x4ddec9[_0xa1a4('0x49')]:_0x327e3e[_0xa1a4('0x44')];_0x4ddec9[_0xa1a4('0x9e')]=qs[_0xa1a4('0x4d')](_0x459386['query'][_0xa1a4('0x4d')]);_0x4ddec9[_0xa1a4('0x4e')]=qs[_0xa1a4('0x47')](_['pick'](_0x459386['query'],_0x327e3e[_0xa1a4('0x47')]));if(_0x459386[_0xa1a4('0x45')][_0xa1a4('0x50')]){_0x4ddec9[_0xa1a4('0x4e')]=_[_0xa1a4('0x51')](_0x4ddec9[_0xa1a4('0x4e')],{'$or':_[_0xa1a4('0x52')](_0x4ddec9[_0xa1a4('0x49')],function(_0x4051d6){var _0x3df012={};_0x3df012[_0x4051d6]={'$like':'%'+_0x459386[_0xa1a4('0x45')]['filter']+'%'};return _0x3df012;})});}_0x4ddec9=_[_0xa1a4('0x51')]({},_0x4ddec9,_0x459386[_0xa1a4('0x5d')]);return _0x4029d9[_0xa1a4('0xc5')](_0x4ddec9);}})[_0xa1a4('0x23')](function(_0x2e5178){if(_0x2e5178){_0x5730ed=_0x2e5178[_0xa1a4('0x4b')];if(!_0x459386[_0xa1a4('0x45')][_0xa1a4('0x69')]('nolimit')){_0x4ddec9[_0xa1a4('0x33')]=qs[_0xa1a4('0x33')](_0x459386[_0xa1a4('0x45')][_0xa1a4('0x33')]);_0x4ddec9[_0xa1a4('0x32')]=qs[_0xa1a4('0x32')](_0x459386['query'][_0xa1a4('0x32')]);}return _0x4029d9['getAgents'](_0x4ddec9);}})['then'](function(_0x260db6){if(_0x260db6){return _0x260db6?{'count':_0x5730ed,'rows':_0x260db6}:null;}})['then'](respondWithResult(_0x279865,null))[_0xa1a4('0x2d')](handleError(_0x279865,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index ed8f7eb..4e497a0 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(_0x16de68,_0x33d7ff){var _0x1c277e=function(_0x1d8549){while(--_0x1d8549){_0x16de68['push'](_0x16de68['shift']());}};_0x1c277e(++_0x33d7ff);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'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(_0x545b71,_0x4f44eb){var _0x26e587=function(_0x293b81){while(--_0x293b81){_0x545b71['push'](_0x545b71['shift']());}};_0x26e587(++_0x4f44eb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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 6a7278c..4066b9c 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 _0x73a1=['mail_accounts','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MailAccount'];(function(_0x156f36,_0xb0b41f){var _0x58fefd=function(_0x7b31d6){while(--_0x7b31d6){_0x156f36['push'](_0x156f36['shift']());}};_0x58fefd(++_0xb0b41f);}(_0x73a1,0x161));var _0x173a=function(_0x2fee96,_0x2f735d){_0x2fee96=_0x2fee96-0x0;var _0x2e6ad1=_0x73a1[_0x2fee96];return _0x2e6ad1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x173a('0x0'))(_0x173a('0x1'));var moment=require('moment');var BPromise=require(_0x173a('0x2'));var rp=require(_0x173a('0x3'));var fs=require('fs');var path=require(_0x173a('0x4'));var rimraf=require(_0x173a('0x5'));var config=require(_0x173a('0x6'));var attributes=require('./mailAccount.attributes');module[_0x173a('0x7')]=function(_0x1a8b94,_0xac84a){return _0x1a8b94[_0x173a('0x8')](_0x173a('0x9'),attributes,{'tableName':_0x173a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ae9=['request-promise','path','../../config/environment','exports','define','MailAccount','lodash','api','moment'];(function(_0x2a0047,_0x389dfb){var _0x74614e=function(_0x2e3d77){while(--_0x2e3d77){_0x2a0047['push'](_0x2a0047['shift']());}};_0x74614e(++_0x389dfb);}(_0x5ae9,0x19b));var _0x95ae=function(_0x1c4409,_0x3b2e8f){_0x1c4409=_0x1c4409-0x0;var _0x356d8f=_0x5ae9[_0x1c4409];return _0x356d8f;};'use strict';var _=require(_0x95ae('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x95ae('0x1'));var moment=require(_0x95ae('0x2'));var BPromise=require('bluebird');var rp=require(_0x95ae('0x3'));var fs=require('fs');var path=require(_0x95ae('0x4'));var rimraf=require('rimraf');var config=require(_0x95ae('0x5'));var attributes=require('./mailAccount.attributes');module[_0x95ae('0x6')]=function(_0x3c4464,_0xa51307){return _0x3c4464[_0x95ae('0x7')](_0x95ae('0x8'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 115d711..f062830 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 _0xfcc6=['isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','DESC','MailApplication','Applications','MailServerOut','get','omit','applications','list','orderBy','asc','autoclose','length','close','Contacts','create','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','update','interaction','created','attachments','originTo','originCc','Attachment','UserId','User','unshift','agent','name','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','lodash','util','../../mysqldb','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','request','then','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','MailAccount','findAll','options','raw','where','attributes','limit','map','model','include','GetMailAccount','ShowMailAccount','body','mail','difference','keys','CmContact','createdAt','updatedAt','CompanyId','ListId','from'];(function(_0x4c243d,_0x3248c8){var _0x59bd2f=function(_0x28778f){while(--_0x28778f){_0x4c243d['push'](_0x4c243d['shift']());}};_0x59bd2f(++_0x3248c8);}(_0xfcc6,0x162));var _0x6fcc=function(_0x25df80,_0xa2aec5){_0x25df80=_0x25df80-0x0;var _0x17b6d0=_0xfcc6[_0x25df80];return _0x17b6d0;};'use strict';var _=require(_0x6fcc('0x0'));var util=require(_0x6fcc('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6fcc('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x6fcc('0x3'))(_0x6fcc('0x4'));var config=require('../../config/environment');var jayson=require(_0x6fcc('0x5'));var client=jayson['client'][_0x6fcc('0x6')]({'port':0x232c});config[_0x6fcc('0x7')]=_[_0x6fcc('0x8')](config[_0x6fcc('0x7')],{'host':_0x6fcc('0x9'),'port':0x18eb});var socket=require(_0x6fcc('0xa'))(new Redis(config[_0x6fcc('0x7')]));require('./mailAccount.socket')['register'](socket);function respondWithRpcPromise(_0x52c990,_0x318b39,_0x19d750){return new BPromise(function(_0x2413fa,_0x423a53){return client[_0x6fcc('0xb')](_0x52c990,_0x19d750)[_0x6fcc('0xc')](function(_0x4be933){logger[_0x6fcc('0xd')](_0x6fcc('0xe'),_0x318b39,'request\x20sent');logger[_0x6fcc('0xf')](_0x6fcc('0x10'),_0x318b39,_0x6fcc('0x11'),JSON[_0x6fcc('0x12')](_0x4be933));if(_0x4be933['error']){if(_0x4be933[_0x6fcc('0x13')][_0x6fcc('0x14')]===0x1f4){logger['error']('MailAccount,\x20%s,\x20%s',_0x318b39,_0x4be933[_0x6fcc('0x13')][_0x6fcc('0x15')]);return _0x423a53(_0x4be933[_0x6fcc('0x13')]['message']);}logger[_0x6fcc('0x13')](_0x6fcc('0xe'),_0x318b39,_0x4be933['error'][_0x6fcc('0x15')]);return _0x2413fa(_0x4be933[_0x6fcc('0x13')]['message']);}else{logger['info'](_0x6fcc('0xe'),_0x318b39,'request\x20sent');_0x2413fa(_0x4be933[_0x6fcc('0x16')][_0x6fcc('0x15')]);}})[_0x6fcc('0x17')](function(_0x3d0f3d){logger[_0x6fcc('0x13')]('MailAccount,\x20%s,\x20%s',_0x318b39,_0x3d0f3d);_0x423a53(_0x3d0f3d);});});}exports['GetMailAccount']=function(_0x2c26fb){var _0x3bcac0=this;return new Promise(function(_0x4d4460,_0x5d41eb){return db[_0x6fcc('0x18')][_0x6fcc('0x19')]({'raw':_0x2c26fb[_0x6fcc('0x1a')]?_0x2c26fb[_0x6fcc('0x1a')][_0x6fcc('0x1b')]===undefined?!![]:![]:!![],'where':_0x2c26fb[_0x6fcc('0x1a')]?_0x2c26fb[_0x6fcc('0x1a')][_0x6fcc('0x1c')]||null:null,'attributes':_0x2c26fb['options']?_0x2c26fb['options'][_0x6fcc('0x1d')]||null:null,'limit':_0x2c26fb[_0x6fcc('0x1a')]?_0x2c26fb[_0x6fcc('0x1a')][_0x6fcc('0x1e')]||null:null,'include':_0x2c26fb[_0x6fcc('0x1a')]?_0x2c26fb[_0x6fcc('0x1a')]['include']?_[_0x6fcc('0x1f')](_0x2c26fb[_0x6fcc('0x1a')]['include'],function(_0x3a7e98){return{'model':db[_0x3a7e98[_0x6fcc('0x20')]],'as':_0x3a7e98['as'],'attributes':_0x3a7e98['attributes'],'include':_0x3a7e98[_0x6fcc('0x21')]?_[_0x6fcc('0x1f')](_0x3a7e98[_0x6fcc('0x21')],function(_0xa75a5b){return{'model':db[_0xa75a5b[_0x6fcc('0x20')]],'as':_0xa75a5b['as'],'attributes':_0xa75a5b[_0x6fcc('0x1d')],'include':_0xa75a5b[_0x6fcc('0x21')]?_[_0x6fcc('0x1f')](_0xa75a5b['include'],function(_0x54c134){return{'model':db[_0x54c134[_0x6fcc('0x20')]],'as':_0x54c134['as'],'attributes':_0x54c134['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x25fa13){logger['info'](_0x6fcc('0x22'),_0x2c26fb);logger['debug']('GetMailAccount',_0x2c26fb,JSON[_0x6fcc('0x12')](_0x25fa13));_0x4d4460(_0x25fa13);})[_0x6fcc('0x17')](function(_0x56212a){logger[_0x6fcc('0x13')](_0x6fcc('0x22'),_0x56212a['message'],_0x2c26fb);_0x5d41eb(_0x3bcac0[_0x6fcc('0x13')](0x1f4,_0x56212a[_0x6fcc('0x15')]));});});};exports[_0x6fcc('0x23')]=function(_0x1d467e){var _0x365a12=this;return new Promise(function(_0x48b520,_0x22d048){return db['MailAccount']['find']({'raw':_0x1d467e[_0x6fcc('0x1a')]?_0x1d467e[_0x6fcc('0x1a')][_0x6fcc('0x1b')]===undefined?!![]:![]:!![],'where':_0x1d467e[_0x6fcc('0x1a')]?_0x1d467e[_0x6fcc('0x1a')][_0x6fcc('0x1c')]||null:null,'attributes':_0x1d467e['options']?_0x1d467e[_0x6fcc('0x1a')]['attributes']||null:null,'include':_0x1d467e[_0x6fcc('0x1a')]?_0x1d467e[_0x6fcc('0x1a')][_0x6fcc('0x21')]?_[_0x6fcc('0x1f')](_0x1d467e['options'][_0x6fcc('0x21')],function(_0x12cc01){return{'model':db[_0x12cc01[_0x6fcc('0x20')]],'as':_0x12cc01['as'],'attributes':_0x12cc01[_0x6fcc('0x1d')],'include':_0x12cc01['include']?_['map'](_0x12cc01[_0x6fcc('0x21')],function(_0x4e0df4){return{'model':db[_0x4e0df4[_0x6fcc('0x20')]],'as':_0x4e0df4['as'],'attributes':_0x4e0df4[_0x6fcc('0x1d')],'include':_0x4e0df4[_0x6fcc('0x21')]?_[_0x6fcc('0x1f')](_0x4e0df4[_0x6fcc('0x21')],function(_0x137212){return{'model':db[_0x137212[_0x6fcc('0x20')]],'as':_0x137212['as'],'attributes':_0x137212[_0x6fcc('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x27626f){logger[_0x6fcc('0xd')](_0x6fcc('0x23'),_0x1d467e);logger[_0x6fcc('0xf')](_0x6fcc('0x23'),_0x1d467e,JSON[_0x6fcc('0x12')](_0x27626f));_0x48b520(_0x27626f);})[_0x6fcc('0x17')](function(_0x2e09e3){logger[_0x6fcc('0x13')](_0x6fcc('0x23'),_0x2e09e3[_0x6fcc('0x15')],_0x1d467e);_0x22d048(_0x365a12['error'](0x1f4,_0x2e09e3[_0x6fcc('0x15')]));});});};exports['NotifyMailAccount']=function(_0x37fdc9){var _0x656bfd=this;return new Promise(function(_0x4136e5,_0x31eba6){var _0x4ad7f6={'body':_0x37fdc9[_0x6fcc('0x24')],'channel':_0x6fcc('0x25')};var _0x22fb96=_[_0x6fcc('0x26')](_[_0x6fcc('0x27')](db[_0x6fcc('0x28')]['rawAttributes']),[_0x6fcc('0x29'),_0x6fcc('0x2a'),_0x6fcc('0x2b'),_0x6fcc('0x2c')]);var _0x51bc67=![];if(_0x37fdc9[_0x6fcc('0x24')]['id']){delete _0x37fdc9[_0x6fcc('0x24')]['id'];}if(_['isNil'](_0x37fdc9[_0x6fcc('0x24')][_0x6fcc('0x2d')])){return _0x31eba6(_0x656bfd['error'](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x6fcc('0x2e')](_0x37fdc9[_0x6fcc('0x24')][_0x6fcc('0x24')])||_0x37fdc9['body'][_0x6fcc('0x24')]===''){return _0x31eba6(_0x656bfd[_0x6fcc('0x13')](0x1f4,_0x6fcc('0x2f')));}if(_[_0x6fcc('0x2e')](_0x37fdc9[_0x6fcc('0x24')][_0x6fcc('0x30')])){return _0x31eba6(_0x656bfd[_0x6fcc('0x13')](0x1f4,_0x6fcc('0x31')+_0x22fb96));}if(!_[_0x6fcc('0x32')](_0x22fb96,_0x37fdc9[_0x6fcc('0x24')][_0x6fcc('0x30')])){return _0x31eba6(_0x656bfd[_0x6fcc('0x13')](0x1f4,_0x6fcc('0x33')+_0x22fb96));}var _0x2c940b={};_0x2c940b[_0x37fdc9[_0x6fcc('0x24')][_0x6fcc('0x30')]]=_0x37fdc9[_0x6fcc('0x24')][_0x6fcc('0x2d')];return db[_0x6fcc('0x18')][_0x6fcc('0x34')]({'where':{'id':_0x37fdc9[_0x6fcc('0x35')]['id']},'include':[{'model':db[_0x6fcc('0x36')],'as':_0x6fcc('0x37'),'include':[{'model':db[_0x6fcc('0x28')],'as':'Contacts','where':_0x2c940b,'limit':0x1,'order':[[_0x6fcc('0x2a'),_0x6fcc('0x38')]]}]},{'model':db[_0x6fcc('0x39')],'as':_0x6fcc('0x3a')},{'model':db[_0x6fcc('0x3b')],'as':'Smtp'}]})[_0x6fcc('0xc')](function(_0x5e86d8){if(_0x5e86d8&&_0x5e86d8['List']){var _0x3fb4db=_0x5e86d8[_0x6fcc('0x3c')]({'plain':!![]});_0x4ad7f6[_0x6fcc('0x35')]=_[_0x6fcc('0x3d')](_0x3fb4db,[_0x6fcc('0x3a'),_0x6fcc('0x37')]);_0x4ad7f6[_0x6fcc('0x3e')]=_0x3fb4db[_0x6fcc('0x3a')];_0x4ad7f6[_0x6fcc('0x3f')]=_0x3fb4db[_0x6fcc('0x37')];_0x4ad7f6[_0x6fcc('0x3e')]=_[_0x6fcc('0x40')](_0x4ad7f6[_0x6fcc('0x3e')],['priority'],[_0x6fcc('0x41')]);if(_0x4ad7f6[_0x6fcc('0x35')]&&_0x4ad7f6['account'][_0x6fcc('0x42')]){_0x4ad7f6['applications']['push']({'id':0x0,'priority':_0x4ad7f6[_0x6fcc('0x3e')][_0x6fcc('0x43')]+0x1,'app':_0x6fcc('0x44'),'appdata':'autoclose','interval':'*,*,*,*'});}if(_0x4ad7f6[_0x6fcc('0x35')][_0x6fcc('0x3a')]){delete _0x4ad7f6[_0x6fcc('0x35')][_0x6fcc('0x3a')];}if(_0x4ad7f6[_0x6fcc('0x35')][_0x6fcc('0x37')]){delete _0x4ad7f6[_0x6fcc('0x35')][_0x6fcc('0x37')];}if(_0x3fb4db[_0x6fcc('0x37')][_0x6fcc('0x45')][_0x6fcc('0x43')]){return _0x3fb4db[_0x6fcc('0x37')][_0x6fcc('0x45')][0x0];}var _0x51ca4c=_[_0x6fcc('0x8')](_0x37fdc9[_0x6fcc('0x24')],{'firstName':_0x37fdc9[_0x6fcc('0x24')][_0x6fcc('0x2d')],'ListId':_0x3fb4db[_0x6fcc('0x2c')]});_0x51ca4c[_0x37fdc9[_0x6fcc('0x24')][_0x6fcc('0x30')]]=_0x37fdc9['body'][_0x6fcc('0x2d')];return db[_0x6fcc('0x28')][_0x6fcc('0x46')](_0x51ca4c);}else{throw new Error('List\x20not\x20found');}})['then'](function(_0x17f91c){_0x4ad7f6[_0x6fcc('0x47')]=_0x17f91c;if(_0x17f91c){if(!_0x37fdc9[_0x6fcc('0x24')]['message'][_0x6fcc('0x48')]){_0x37fdc9[_0x6fcc('0x24')][_0x6fcc('0x15')]['messageId']=rs[_0x6fcc('0x49')]()+'\x20'+_0x37fdc9[_0x6fcc('0x24')][_0x6fcc('0x15')][_0x6fcc('0x2d')];}var _0x4ab1cf={'ContactId':_0x17f91c['id'],'MailAccountId':_0x37fdc9[_0x6fcc('0x35')]['id'],'inReplyTo':_0x37fdc9[_0x6fcc('0x24')][_0x6fcc('0x15')][_0x6fcc('0x48')],'to':_0x37fdc9[_0x6fcc('0x24')]['message']['from'],'cc':_0x37fdc9['body'][_0x6fcc('0x15')]['cc'],'subject':_0x37fdc9['body'][_0x6fcc('0x15')][_0x6fcc('0x4a')],'attach':_0x37fdc9[_0x6fcc('0x24')][_0x6fcc('0x15')][_0x6fcc('0x4b')],'lastMsgAt':moment()[_0x6fcc('0x4c')](_0x6fcc('0x4d')),'lastMsgDirection':'in','lastMsgBody':_0x37fdc9[_0x6fcc('0x24')][_0x6fcc('0x24')]};return db[_0x6fcc('0x4e')][_0x6fcc('0x34')]({'where':{'closed':![],'MailAccountId':_0x37fdc9[_0x6fcc('0x35')]['id']},'include':[{'model':db[_0x6fcc('0x4f')],'as':_0x6fcc('0x50'),'attributes':['messageId'],'where':{'messageId':_0x37fdc9['body']['message'][_0x6fcc('0x51')]}}]})['then'](function(_0x3e79d4){if(_0x3e79d4){return[_0x3e79d4,![]];}return db[_0x6fcc('0x4e')][_0x6fcc('0x46')](_0x4ab1cf)[_0x6fcc('0xc')](function(_0x377c4b){return[_0x377c4b,!![]];});});}else{throw new Error(_0x6fcc('0x52'));}})[_0x6fcc('0x53')](function(_0x1f8fb0,_0x428dd9){if(_0x1f8fb0){_0x51bc67=_0x428dd9;if(!_0x428dd9){return _0x1f8fb0[_0x6fcc('0x54')]({'inReplyTo':_0x37fdc9[_0x6fcc('0x24')][_0x6fcc('0x15')]['messageId'],'to':_0x37fdc9[_0x6fcc('0x24')][_0x6fcc('0x15')][_0x6fcc('0x2d')],'cc':_0x37fdc9[_0x6fcc('0x24')][_0x6fcc('0x15')]['cc'],'subject':_0x37fdc9[_0x6fcc('0x24')]['message'][_0x6fcc('0x4a')],'attach':_0x1f8fb0['attach']?_0x1f8fb0[_0x6fcc('0x4b')]:_0x37fdc9[_0x6fcc('0x24')]['message'][_0x6fcc('0x4b')],'substatus':null,'substatusAt':moment()[_0x6fcc('0x4c')](_0x6fcc('0x4d')),'lastMsgAt':moment()[_0x6fcc('0x4c')](_0x6fcc('0x4d')),'lastMsgDirection':'in','lastMsgBody':_0x37fdc9['body'][_0x6fcc('0x24')]});}else{return _0x1f8fb0;}}})['then'](function(_0x6237b7){_0x4ad7f6[_0x6fcc('0x55')]=_0x6237b7[_0x6fcc('0x3c')]({'plain':!![]});_0x4ad7f6[_0x6fcc('0x55')][_0x6fcc('0x56')]=_0x51bc67;return db[_0x6fcc('0x4f')][_0x6fcc('0x46')]({'body':_0x37fdc9[_0x6fcc('0x24')][_0x6fcc('0x24')],'MailAccountId':_0x37fdc9[_0x6fcc('0x35')]['id'],'MailInteractionId':_0x6237b7['id'],'direction':'in','ContactId':_0x4ad7f6[_0x6fcc('0x47')]['id'],'messageId':_0x37fdc9['body'][_0x6fcc('0x15')][_0x6fcc('0x48')],'from':_0x37fdc9[_0x6fcc('0x24')]['message'][_0x6fcc('0x2d')],'to':_0x37fdc9['body']['message']['to'],'cc':_0x37fdc9[_0x6fcc('0x24')][_0x6fcc('0x15')]['cc'],'subject':_0x37fdc9[_0x6fcc('0x24')][_0x6fcc('0x15')][_0x6fcc('0x4a')],'attach':_0x37fdc9['body'][_0x6fcc('0x15')]['attach'],'Attachments':_0x37fdc9[_0x6fcc('0x24')][_0x6fcc('0x15')][_0x6fcc('0x57')],'originTo':_0x37fdc9[_0x6fcc('0x24')][_0x6fcc('0x15')][_0x6fcc('0x58')],'originCc':_0x37fdc9[_0x6fcc('0x24')][_0x6fcc('0x15')][_0x6fcc('0x59')],'bcc':_0x37fdc9['body'][_0x6fcc('0x15')]['bcc']},{'include':[{'model':db[_0x6fcc('0x5a')],'as':'Attachments'}]});})[_0x6fcc('0xc')](function(_0x1d5b5c){_0x4ad7f6[_0x6fcc('0x15')]=_0x1d5b5c;if(_0x4ad7f6[_0x6fcc('0x55')][_0x6fcc('0x5b')]){return db[_0x6fcc('0x5c')][_0x6fcc('0x34')]({'attributes':['id','name'],'where':{'id':_0x4ad7f6[_0x6fcc('0x55')][_0x6fcc('0x5b')]}})[_0x6fcc('0xc')](function(_0x422baa){if(_0x422baa){_0x4ad7f6[_0x6fcc('0x3e')][_0x6fcc('0x5d')]({'id':0x0,'priority':0x0,'app':_0x6fcc('0x5e'),'appdata':_0x422baa[_0x6fcc('0x5f')]+','+(_0x4ad7f6[_0x6fcc('0x35')][_0x6fcc('0x60')]||0xa),'interval':_0x6fcc('0x61')});}return respondWithRpcPromise(_0x6fcc('0x62'),_0x6fcc('0x63'),_0x4ad7f6);});}return respondWithRpcPromise(_0x6fcc('0x62'),'startRouting',_0x4ad7f6);})[_0x6fcc('0xc')](function(_0x180af5){_0x4136e5(_0x180af5);})['catch'](function(_0x1d8dfa){_0x31eba6(_0x656bfd[_0x6fcc('0x13')](0x1f4,_0x1d8dfa[_0x6fcc('0x15')]));});});}; \ No newline at end of file +var _0xf680=['include','map','model','info','find','where','ShowMailAccount','NotifyMailAccount','body','mail','difference','keys','createdAt','updatedAt','CompanyId','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','CmContact','Contacts','MailApplication','Applications','MailServerOut','Smtp','List','get','account','omit','applications','orderBy','autoclose','push','length','close','*,*,*,*','ListId','create','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','inReplyTo','spread','update','interaction','created','attachments','originTo','originCc','Attachment','Attachments','name','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','defaults','redis','socket.io-emitter','./mailAccount.socket','register','request','then','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','request\x20sent','result','catch','GetMailAccount','MailAccount','findAll','options','raw','attributes','limit'];(function(_0xbebce0,_0x3bb745){var _0x3ac9b6=function(_0x355518){while(--_0x355518){_0xbebce0['push'](_0xbebce0['shift']());}};_0x3ac9b6(++_0x3bb745);}(_0xf680,0xa5));var _0x0f68=function(_0x12bddf,_0x5bfbc3){_0x12bddf=_0x12bddf-0x0;var _0x436775=_0xf680[_0x12bddf];return _0x436775;};'use strict';var _=require(_0x0f68('0x0'));var util=require('util');var moment=require(_0x0f68('0x1'));var BPromise=require('bluebird');var rs=require(_0x0f68('0x2'));var fs=require('fs');var Redis=require(_0x0f68('0x3'));var db=require(_0x0f68('0x4'))['db'];var utils=require(_0x0f68('0x5'));var logger=require(_0x0f68('0x6'))(_0x0f68('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0f68('0x8')]['http']({'port':0x232c});config['redis']=_[_0x0f68('0x9')](config[_0x0f68('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x0f68('0xb'))(new Redis(config[_0x0f68('0xa')]));require(_0x0f68('0xc'))[_0x0f68('0xd')](socket);function respondWithRpcPromise(_0x1dc324,_0x2c1b94,_0x40b034){return new BPromise(function(_0x47fed6,_0x37313b){return client[_0x0f68('0xe')](_0x1dc324,_0x40b034)[_0x0f68('0xf')](function(_0x32a8c8){logger['info']('MailAccount,\x20%s,\x20%s',_0x2c1b94,'request\x20sent');logger[_0x0f68('0x10')](_0x0f68('0x11'),_0x2c1b94,'request\x20sent',JSON[_0x0f68('0x12')](_0x32a8c8));if(_0x32a8c8[_0x0f68('0x13')]){if(_0x32a8c8[_0x0f68('0x13')][_0x0f68('0x14')]===0x1f4){logger[_0x0f68('0x13')](_0x0f68('0x15'),_0x2c1b94,_0x32a8c8['error'][_0x0f68('0x16')]);return _0x37313b(_0x32a8c8[_0x0f68('0x13')]['message']);}logger[_0x0f68('0x13')](_0x0f68('0x15'),_0x2c1b94,_0x32a8c8[_0x0f68('0x13')][_0x0f68('0x16')]);return _0x47fed6(_0x32a8c8[_0x0f68('0x13')]['message']);}else{logger['info'](_0x0f68('0x15'),_0x2c1b94,_0x0f68('0x17'));_0x47fed6(_0x32a8c8[_0x0f68('0x18')][_0x0f68('0x16')]);}})[_0x0f68('0x19')](function(_0x2e3ce8){logger[_0x0f68('0x13')](_0x0f68('0x15'),_0x2c1b94,_0x2e3ce8);_0x37313b(_0x2e3ce8);});});}exports[_0x0f68('0x1a')]=function(_0x4c7a46){var _0x2c9195=this;return new Promise(function(_0x125845,_0x51fc2){return db[_0x0f68('0x1b')][_0x0f68('0x1c')]({'raw':_0x4c7a46[_0x0f68('0x1d')]?_0x4c7a46[_0x0f68('0x1d')][_0x0f68('0x1e')]===undefined?!![]:![]:!![],'where':_0x4c7a46['options']?_0x4c7a46[_0x0f68('0x1d')]['where']||null:null,'attributes':_0x4c7a46[_0x0f68('0x1d')]?_0x4c7a46[_0x0f68('0x1d')][_0x0f68('0x1f')]||null:null,'limit':_0x4c7a46[_0x0f68('0x1d')]?_0x4c7a46['options'][_0x0f68('0x20')]||null:null,'include':_0x4c7a46[_0x0f68('0x1d')]?_0x4c7a46['options'][_0x0f68('0x21')]?_[_0x0f68('0x22')](_0x4c7a46[_0x0f68('0x1d')][_0x0f68('0x21')],function(_0x59172b){return{'model':db[_0x59172b[_0x0f68('0x23')]],'as':_0x59172b['as'],'attributes':_0x59172b['attributes'],'include':_0x59172b[_0x0f68('0x21')]?_['map'](_0x59172b[_0x0f68('0x21')],function(_0x13d0cf){return{'model':db[_0x13d0cf[_0x0f68('0x23')]],'as':_0x13d0cf['as'],'attributes':_0x13d0cf[_0x0f68('0x1f')],'include':_0x13d0cf[_0x0f68('0x21')]?_[_0x0f68('0x22')](_0x13d0cf[_0x0f68('0x21')],function(_0x320b61){return{'model':db[_0x320b61[_0x0f68('0x23')]],'as':_0x320b61['as'],'attributes':_0x320b61[_0x0f68('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x0f68('0xf')](function(_0x3113b6){logger[_0x0f68('0x24')](_0x0f68('0x1a'),_0x4c7a46);logger['debug'](_0x0f68('0x1a'),_0x4c7a46,JSON['stringify'](_0x3113b6));_0x125845(_0x3113b6);})['catch'](function(_0x2a968c){logger[_0x0f68('0x13')](_0x0f68('0x1a'),_0x2a968c[_0x0f68('0x16')],_0x4c7a46);_0x51fc2(_0x2c9195[_0x0f68('0x13')](0x1f4,_0x2a968c[_0x0f68('0x16')]));});});};exports['ShowMailAccount']=function(_0x466929){var _0x38a672=this;return new Promise(function(_0xda4261,_0x584a51){return db[_0x0f68('0x1b')][_0x0f68('0x25')]({'raw':_0x466929[_0x0f68('0x1d')]?_0x466929[_0x0f68('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x466929[_0x0f68('0x1d')]?_0x466929[_0x0f68('0x1d')][_0x0f68('0x26')]||null:null,'attributes':_0x466929[_0x0f68('0x1d')]?_0x466929[_0x0f68('0x1d')][_0x0f68('0x1f')]||null:null,'include':_0x466929[_0x0f68('0x1d')]?_0x466929['options'][_0x0f68('0x21')]?_[_0x0f68('0x22')](_0x466929[_0x0f68('0x1d')][_0x0f68('0x21')],function(_0x3f7b6e){return{'model':db[_0x3f7b6e[_0x0f68('0x23')]],'as':_0x3f7b6e['as'],'attributes':_0x3f7b6e[_0x0f68('0x1f')],'include':_0x3f7b6e['include']?_[_0x0f68('0x22')](_0x3f7b6e[_0x0f68('0x21')],function(_0x2603ff){return{'model':db[_0x2603ff[_0x0f68('0x23')]],'as':_0x2603ff['as'],'attributes':_0x2603ff['attributes'],'include':_0x2603ff[_0x0f68('0x21')]?_[_0x0f68('0x22')](_0x2603ff[_0x0f68('0x21')],function(_0x3e23a2){return{'model':db[_0x3e23a2[_0x0f68('0x23')]],'as':_0x3e23a2['as'],'attributes':_0x3e23a2[_0x0f68('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4a42e1){logger[_0x0f68('0x24')](_0x0f68('0x27'),_0x466929);logger[_0x0f68('0x10')](_0x0f68('0x27'),_0x466929,JSON[_0x0f68('0x12')](_0x4a42e1));_0xda4261(_0x4a42e1);})[_0x0f68('0x19')](function(_0x191d5b){logger['error'](_0x0f68('0x27'),_0x191d5b['message'],_0x466929);_0x584a51(_0x38a672['error'](0x1f4,_0x191d5b[_0x0f68('0x16')]));});});};exports[_0x0f68('0x28')]=function(_0x224833){var _0x4534df=this;return new Promise(function(_0x247f36,_0x27117a){var _0x6270b2={'body':_0x224833[_0x0f68('0x29')],'channel':_0x0f68('0x2a')};var _0x2cef65=_[_0x0f68('0x2b')](_[_0x0f68('0x2c')](db['CmContact']['rawAttributes']),[_0x0f68('0x2d'),_0x0f68('0x2e'),_0x0f68('0x2f'),'ListId']);var _0x16678a=![];if(_0x224833[_0x0f68('0x29')]['id']){delete _0x224833[_0x0f68('0x29')]['id'];}if(_['isNil'](_0x224833['body']['from'])){return _0x27117a(_0x4534df[_0x0f68('0x13')](0x1f4,_0x0f68('0x30')));}if(_[_0x0f68('0x31')](_0x224833[_0x0f68('0x29')][_0x0f68('0x29')])||_0x224833[_0x0f68('0x29')]['body']===''){return _0x27117a(_0x4534df[_0x0f68('0x13')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0x224833[_0x0f68('0x29')]['mapKey'])){return _0x27117a(_0x4534df[_0x0f68('0x13')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2cef65));}if(!_['includes'](_0x2cef65,_0x224833[_0x0f68('0x29')][_0x0f68('0x32')])){return _0x27117a(_0x4534df[_0x0f68('0x13')](0x1f4,_0x0f68('0x33')+_0x2cef65));}var _0x55c315={};_0x55c315[_0x224833[_0x0f68('0x29')][_0x0f68('0x32')]]=_0x224833[_0x0f68('0x29')][_0x0f68('0x34')];return db[_0x0f68('0x1b')][_0x0f68('0x25')]({'where':{'id':_0x224833['account']['id']},'include':[{'model':db[_0x0f68('0x35')],'as':'List','include':[{'model':db[_0x0f68('0x36')],'as':_0x0f68('0x37'),'where':_0x55c315,'limit':0x1,'order':[[_0x0f68('0x2e'),'DESC']]}]},{'model':db[_0x0f68('0x38')],'as':_0x0f68('0x39')},{'model':db[_0x0f68('0x3a')],'as':_0x0f68('0x3b')}]})[_0x0f68('0xf')](function(_0x294af8){if(_0x294af8&&_0x294af8[_0x0f68('0x3c')]){var _0x43cdce=_0x294af8[_0x0f68('0x3d')]({'plain':!![]});_0x6270b2[_0x0f68('0x3e')]=_[_0x0f68('0x3f')](_0x43cdce,[_0x0f68('0x39'),_0x0f68('0x3c')]);_0x6270b2['applications']=_0x43cdce['Applications'];_0x6270b2['list']=_0x43cdce[_0x0f68('0x3c')];_0x6270b2[_0x0f68('0x40')]=_[_0x0f68('0x41')](_0x6270b2[_0x0f68('0x40')],['priority'],['asc']);if(_0x6270b2['account']&&_0x6270b2['account'][_0x0f68('0x42')]){_0x6270b2[_0x0f68('0x40')][_0x0f68('0x43')]({'id':0x0,'priority':_0x6270b2[_0x0f68('0x40')][_0x0f68('0x44')]+0x1,'app':_0x0f68('0x45'),'appdata':_0x0f68('0x42'),'interval':_0x0f68('0x46')});}if(_0x6270b2[_0x0f68('0x3e')][_0x0f68('0x39')]){delete _0x6270b2[_0x0f68('0x3e')][_0x0f68('0x39')];}if(_0x6270b2['account'][_0x0f68('0x3c')]){delete _0x6270b2[_0x0f68('0x3e')][_0x0f68('0x3c')];}if(_0x43cdce[_0x0f68('0x3c')][_0x0f68('0x37')][_0x0f68('0x44')]){return _0x43cdce[_0x0f68('0x3c')][_0x0f68('0x37')][0x0];}var _0x22f531=_[_0x0f68('0x9')](_0x224833[_0x0f68('0x29')],{'firstName':_0x224833[_0x0f68('0x29')][_0x0f68('0x34')],'ListId':_0x43cdce[_0x0f68('0x47')]});_0x22f531[_0x224833[_0x0f68('0x29')][_0x0f68('0x32')]]=_0x224833['body'][_0x0f68('0x34')];return db[_0x0f68('0x36')][_0x0f68('0x48')](_0x22f531);}else{throw new Error('List\x20not\x20found');}})[_0x0f68('0xf')](function(_0x57f767){_0x6270b2[_0x0f68('0x49')]=_0x57f767;if(_0x57f767){if(!_0x224833[_0x0f68('0x29')][_0x0f68('0x16')][_0x0f68('0x4a')]){_0x224833['body']['message'][_0x0f68('0x4a')]=rs[_0x0f68('0x4b')]()+'\x20'+_0x224833[_0x0f68('0x29')][_0x0f68('0x16')][_0x0f68('0x34')];}var _0x1ccf75={'ContactId':_0x57f767['id'],'MailAccountId':_0x224833[_0x0f68('0x3e')]['id'],'inReplyTo':_0x224833[_0x0f68('0x29')][_0x0f68('0x16')][_0x0f68('0x4a')],'to':_0x224833['body'][_0x0f68('0x16')]['from'],'cc':_0x224833['body'][_0x0f68('0x16')]['cc'],'subject':_0x224833[_0x0f68('0x29')][_0x0f68('0x16')][_0x0f68('0x4c')],'attach':_0x224833[_0x0f68('0x29')][_0x0f68('0x16')][_0x0f68('0x4d')],'lastMsgAt':moment()[_0x0f68('0x4e')](_0x0f68('0x4f')),'lastMsgDirection':'in','lastMsgBody':_0x224833['body']['body']};return db[_0x0f68('0x50')][_0x0f68('0x25')]({'where':{'closed':![],'MailAccountId':_0x224833[_0x0f68('0x3e')]['id']},'include':[{'model':db[_0x0f68('0x51')],'as':'Messages','attributes':[_0x0f68('0x4a')],'where':{'messageId':_0x224833[_0x0f68('0x29')][_0x0f68('0x16')][_0x0f68('0x52')]}}]})[_0x0f68('0xf')](function(_0x5ca1cd){if(_0x5ca1cd){return[_0x5ca1cd,![]];}return db[_0x0f68('0x50')][_0x0f68('0x48')](_0x1ccf75)[_0x0f68('0xf')](function(_0x1fc804){return[_0x1fc804,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x0f68('0x53')](function(_0x40533b,_0x19439e){if(_0x40533b){_0x16678a=_0x19439e;if(!_0x19439e){return _0x40533b[_0x0f68('0x54')]({'inReplyTo':_0x224833[_0x0f68('0x29')][_0x0f68('0x16')][_0x0f68('0x4a')],'to':_0x224833[_0x0f68('0x29')][_0x0f68('0x16')][_0x0f68('0x34')],'cc':_0x224833[_0x0f68('0x29')]['message']['cc'],'subject':_0x224833[_0x0f68('0x29')][_0x0f68('0x16')][_0x0f68('0x4c')],'attach':_0x40533b[_0x0f68('0x4d')]?_0x40533b[_0x0f68('0x4d')]:_0x224833[_0x0f68('0x29')][_0x0f68('0x16')]['attach'],'substatus':null,'substatusAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x0f68('0x4e')](_0x0f68('0x4f')),'lastMsgDirection':'in','lastMsgBody':_0x224833[_0x0f68('0x29')][_0x0f68('0x29')]});}else{return _0x40533b;}}})[_0x0f68('0xf')](function(_0x2c666d){_0x6270b2[_0x0f68('0x55')]=_0x2c666d[_0x0f68('0x3d')]({'plain':!![]});_0x6270b2[_0x0f68('0x55')][_0x0f68('0x56')]=_0x16678a;return db['MailMessage'][_0x0f68('0x48')]({'body':_0x224833['body']['body'],'MailAccountId':_0x224833[_0x0f68('0x3e')]['id'],'MailInteractionId':_0x2c666d['id'],'direction':'in','ContactId':_0x6270b2[_0x0f68('0x49')]['id'],'messageId':_0x224833[_0x0f68('0x29')][_0x0f68('0x16')][_0x0f68('0x4a')],'from':_0x224833['body']['message'][_0x0f68('0x34')],'to':_0x224833[_0x0f68('0x29')][_0x0f68('0x16')]['to'],'cc':_0x224833[_0x0f68('0x29')][_0x0f68('0x16')]['cc'],'subject':_0x224833[_0x0f68('0x29')]['message'][_0x0f68('0x4c')],'attach':_0x224833[_0x0f68('0x29')]['message'][_0x0f68('0x4d')],'Attachments':_0x224833[_0x0f68('0x29')][_0x0f68('0x16')][_0x0f68('0x57')],'originTo':_0x224833[_0x0f68('0x29')][_0x0f68('0x16')][_0x0f68('0x58')],'originCc':_0x224833[_0x0f68('0x29')][_0x0f68('0x16')][_0x0f68('0x59')],'bcc':_0x224833[_0x0f68('0x29')][_0x0f68('0x16')]['bcc']},{'include':[{'model':db[_0x0f68('0x5a')],'as':_0x0f68('0x5b')}]});})['then'](function(_0xf384b8){_0x6270b2[_0x0f68('0x16')]=_0xf384b8;if(_0x6270b2[_0x0f68('0x55')]['UserId']){return db['User'][_0x0f68('0x25')]({'attributes':['id',_0x0f68('0x5c')],'where':{'id':_0x6270b2[_0x0f68('0x55')][_0x0f68('0x5d')]}})['then'](function(_0x217db7){if(_0x217db7){_0x6270b2[_0x0f68('0x40')][_0x0f68('0x5e')]({'id':0x0,'priority':0x0,'app':_0x0f68('0x5f'),'appdata':_0x217db7['name']+','+(_0x6270b2['account'][_0x0f68('0x60')]||0xa),'interval':_0x0f68('0x46')});}return respondWithRpcPromise(_0x0f68('0x61'),_0x0f68('0x62'),_0x6270b2);});}return respondWithRpcPromise(_0x0f68('0x61'),'startRouting',_0x6270b2);})[_0x0f68('0xf')](function(_0x58d88f){_0x247f36(_0x58d88f);})['catch'](function(_0x520bd1){_0x27117a(_0x4534df[_0x0f68('0x13')](0x1f4,_0x520bd1[_0x0f68('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 599256e..6e2b514 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 _0x0a68=['removeListener','register','length','mailAccount:','save','update','emit'];(function(_0x48a96f,_0x530059){var _0x3ff3ef=function(_0x286059){while(--_0x286059){_0x48a96f['push'](_0x48a96f['shift']());}};_0x3ff3ef(++_0x530059);}(_0x0a68,0x169));var _0x80a6=function(_0xe5f78b,_0x407d5c){_0xe5f78b=_0xe5f78b-0x0;var _0x48d2cd=_0x0a68[_0xe5f78b];return _0x48d2cd;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0x80a6('0x0'),'remove',_0x80a6('0x1')];function createListener(_0x49a250,_0x261fd4){return function(_0x2ac7af){_0x261fd4[_0x80a6('0x2')](_0x49a250,_0x2ac7af);};}function removeListener(_0x17c26a,_0x3ba863){return function(){MailAccountEvents[_0x80a6('0x3')](_0x17c26a,_0x3ba863);};}exports[_0x80a6('0x4')]=function(_0x1719e5){for(var _0x166fbb=0x0,_0x2c2048=events[_0x80a6('0x5')];_0x166fbb<_0x2c2048;_0x166fbb++){var _0x2d682e=events[_0x166fbb];var _0x3c26dc=createListener(_0x80a6('0x6')+_0x2d682e,_0x1719e5);MailAccountEvents['on'](_0x2d682e,_0x3c26dc);}}; \ No newline at end of file +var _0x977f=['register','mailAccount:','./mailAccount.events','save','remove','emit','removeListener'];(function(_0xb422b9,_0x245bfa){var _0x300c84=function(_0x2b5beb){while(--_0x2b5beb){_0xb422b9['push'](_0xb422b9['shift']());}};_0x300c84(++_0x245bfa);}(_0x977f,0x16e));var _0xf977=function(_0x29795a,_0x513fab){_0x29795a=_0x29795a-0x0;var _0x55192c=_0x977f[_0x29795a];return _0x55192c;};'use strict';var MailAccountEvents=require(_0xf977('0x0'));var events=[_0xf977('0x1'),_0xf977('0x2'),'update'];function createListener(_0x41814c,_0x11a8e4){return function(_0x363eee){_0x11a8e4[_0xf977('0x3')](_0x41814c,_0x363eee);};}function removeListener(_0x16cab0,_0xb42c0c){return function(){MailAccountEvents[_0xf977('0x4')](_0x16cab0,_0xb42c0c);};}exports[_0xf977('0x5')]=function(_0x5523e3){for(var _0x223e94=0x0,_0x4e26c5=events['length'];_0x223e94<_0x4e26c5;_0x223e94++){var _0x131630=events[_0x223e94];var _0x8b7347=createListener(_0xf977('0x6')+_0x131630,_0x5523e3);MailAccountEvents['on'](_0x131630,_0x8b7347);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 6b77c32..1679824 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 _0x9567=['util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','put','/:id','update','exports','multer'];(function(_0x218994,_0x2cf487){var _0x3f350b=function(_0x2e2065){while(--_0x2e2065){_0x218994['push'](_0x218994['shift']());}};_0x3f350b(++_0x2cf487);}(_0x9567,0xdc));var _0x7956=function(_0x3f711c,_0x5165dd){_0x3f711c=_0x3f711c-0x0;var _0x194520=_0x9567[_0x3f711c];return _0x194520;};'use strict';var multer=require(_0x7956('0x0'));var util=require(_0x7956('0x1'));var path=require(_0x7956('0x2'));var timeout=require(_0x7956('0x3'));var express=require(_0x7956('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x7956('0x5'));var config=require(_0x7956('0x6'));var controller=require('./mailApplication.controller');router[_0x7956('0x7')]('/:id',auth[_0x7956('0x8')](),controller['show']);router[_0x7956('0x9')](_0x7956('0xa'),auth['isAuthenticated'](),controller[_0x7956('0xb')]);router['delete'](_0x7956('0xa'),auth[_0x7956('0x8')](),controller['destroy']);module[_0x7956('0xc')]=router; \ No newline at end of file +var _0xb43b=['destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','show','/:id','isAuthenticated','update','delete'];(function(_0x23d09c,_0x2bdf77){var _0x1d9754=function(_0x1eafa6){while(--_0x1eafa6){_0x23d09c['push'](_0x23d09c['shift']());}};_0x1d9754(++_0x2bdf77);}(_0xb43b,0x1b2));var _0xbb43=function(_0x286aa0,_0x2e58e8){_0x286aa0=_0x286aa0-0x0;var _0x4ec5c8=_0xb43b[_0x286aa0];return _0x4ec5c8;};'use strict';var multer=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var path=require('path');var timeout=require(_0xbb43('0x2'));var express=require(_0xbb43('0x3'));var router=express[_0xbb43('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xbb43('0x5'));var config=require(_0xbb43('0x6'));var controller=require(_0xbb43('0x7'));router[_0xbb43('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xbb43('0x9')]);router['put'](_0xbb43('0xa'),auth[_0xbb43('0xb')](),controller[_0xbb43('0xc')]);router[_0xbb43('0xd')](_0xbb43('0xa'),auth['isAuthenticated'](),controller[_0xbb43('0xe')]);module[_0xbb43('0xf')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index ed9f977..0f54516 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 _0xa24a=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0xa24a,0x1a2));var _0xaa24=function(_0xaec861,_0x542c35){_0xaec861=_0xaec861-0x0;var _0x540296=_0xa24a[_0xaec861];return _0x540296;};'use strict';var Sequelize=require(_0xaa24('0x0'));module[_0xaa24('0x1')]={'priority':{'type':Sequelize[_0xaa24('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xaa24('0x3')],'allowNull':![],'defaultValue':_0xaa24('0x4')},'appdata':{'type':Sequelize[_0xaa24('0x5')]()},'description':{'type':Sequelize[_0xaa24('0x3')]},'interval':{'type':Sequelize[_0xaa24('0x3')],'defaultValue':_0xaa24('0x6')}}; \ No newline at end of file +var _0x5abf=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x46ec32,_0x1e842f){var _0x338f60=function(_0x10e02c){while(--_0x10e02c){_0x46ec32['push'](_0x46ec32['shift']());}};_0x338f60(++_0x1e842f);}(_0x5abf,0x72));var _0xf5ab=function(_0x566168,_0x4c39af){_0x566168=_0x566168-0x0;var _0x4e1f7a=_0x5abf[_0x566168];return _0x4e1f7a;};'use strict';var Sequelize=require(_0xf5ab('0x0'));module[_0xf5ab('0x1')]={'priority':{'type':Sequelize[_0xf5ab('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xf5ab('0x3')],'allowNull':![],'defaultValue':_0xf5ab('0x4')},'appdata':{'type':Sequelize[_0xf5ab('0x5')]()},'description':{'type':Sequelize[_0xf5ab('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xf5ab('0x6')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 0e42add..8416a0e 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 _0xa5ea=['json','reject','then','error','stack','name','send','show','params','keys','MailApplication','rawAttributes','query','filters','intersection','model','attributes','fields','includeAll','include','find','update','body','destroy','catch','html-pdf','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','offset','limit','status','set','Content-Range'];(function(_0x533248,_0x383d2a){var _0x4b0637=function(_0x45ce46){while(--_0x45ce46){_0x533248['push'](_0x533248['shift']());}};_0x4b0637(++_0x383d2a);}(_0xa5ea,0x87));var _0xaa5e=function(_0x3b2b08,_0x4b4370){_0x3b2b08=_0x3b2b08-0x0;var _0x3b9d39=_0xa5ea[_0x3b2b08];return _0x3b9d39;};'use strict';var pdf=require(_0xaa5e('0x0'));var emlformat=require(_0xaa5e('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xaa5e('0x2'));var rp=require(_0xaa5e('0x3'));var moment=require(_0xaa5e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xaa5e('0x5'));var util=require(_0xaa5e('0x6'));var path=require(_0xaa5e('0x7'));var sox=require(_0xaa5e('0x8'));var csv=require('to-csv');var ejs=require(_0xaa5e('0x9'));var fs=require('fs');var _=require(_0xaa5e('0xa'));var squel=require('squel');var crypto=require(_0xaa5e('0xb'));var jsforce=require(_0xaa5e('0xc'));var deskjs=require(_0xaa5e('0xd'));var toCsv=require(_0xaa5e('0xe'));var querystring=require('querystring');var Papa=require(_0xaa5e('0xf'));var Redis=require(_0xaa5e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xaa5e('0x11'));var hardwareService=require(_0xaa5e('0x12'));var logger=require(_0xaa5e('0x13'))(_0xaa5e('0x14'));var utils=require(_0xaa5e('0x15'));var config=require(_0xaa5e('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48fd23,_0xfaa76c){_0xfaa76c=_0xfaa76c||0xcc;return function(_0x3648f0){if(_0x3648f0){return _0x48fd23[_0xaa5e('0x17')](_0xfaa76c);}return _0x48fd23['status'](_0xfaa76c)[_0xaa5e('0x18')]();};}function respondWithResult(_0xed827b,_0x2062fe){_0x2062fe=_0x2062fe||0xc8;return function(_0x1e4676){if(_0x1e4676){return _0xed827b['status'](_0x2062fe)['json'](_0x1e4676);}};}function respondWithFilteredResult(_0x3363b1,_0x2d2e0e){return function(_0x65cd5){if(_0x65cd5){var _0x55db57=_0x65cd5['count'],_0x551033=_0x2d2e0e['offset'],_0x577e00=_0x2d2e0e[_0xaa5e('0x19')]+_0x2d2e0e[_0xaa5e('0x1a')],_0x2392e0;if(_0x577e00>=_0x55db57){_0x577e00=_0x55db57;_0x2392e0=0xc8;}else{_0x2392e0=0xce;}_0x3363b1[_0xaa5e('0x1b')](_0x2392e0);return _0x3363b1[_0xaa5e('0x1c')](_0xaa5e('0x1d'),_0x551033+'-'+_0x577e00+'/'+_0x55db57)[_0xaa5e('0x1e')](_0x65cd5);}return null;};}function patchUpdates(_0x1c87b8){return function(_0x58ad01){try{jsonpatch['apply'](_0x58ad01,_0x1c87b8,!![]);}catch(_0x28b28c){return BPromise[_0xaa5e('0x1f')](_0x28b28c);}return _0x58ad01['save']();};}function saveUpdates(_0x32faf1,_0x1bb3b7){return function(_0x55123f){if(_0x55123f){return _0x55123f['update'](_0x32faf1)[_0xaa5e('0x20')](function(_0x10d9c4){return _0x10d9c4;});}return null;};}function removeEntity(_0x546532,_0x52d941){return function(_0x1b223b){if(_0x1b223b){return _0x1b223b['destroy']()[_0xaa5e('0x20')](function(){_0x546532['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x595c90,_0xede72b){return function(_0x4b0393){if(!_0x4b0393){_0x595c90[_0xaa5e('0x17')](0x194);}return _0x4b0393;};}function handleError(_0x57fdf8,_0x433e79){_0x433e79=_0x433e79||0x1f4;return function(_0x52d140){logger[_0xaa5e('0x21')](_0x52d140[_0xaa5e('0x22')]);if(_0x52d140[_0xaa5e('0x23')]){delete _0x52d140[_0xaa5e('0x23')];}_0x57fdf8['status'](_0x433e79)[_0xaa5e('0x24')](_0x52d140);};}exports[_0xaa5e('0x25')]=function(_0x2011db,_0x2009fe){var _0x418970={'raw':!![],'where':{'id':_0x2011db[_0xaa5e('0x26')]['id']}},_0x50ee6f={};_0x50ee6f['model']=_[_0xaa5e('0x27')](db[_0xaa5e('0x28')][_0xaa5e('0x29')]);_0x50ee6f[_0xaa5e('0x2a')]=_[_0xaa5e('0x27')](_0x2011db[_0xaa5e('0x2a')]);_0x50ee6f[_0xaa5e('0x2b')]=_[_0xaa5e('0x2c')](_0x50ee6f[_0xaa5e('0x2d')],_0x50ee6f[_0xaa5e('0x2a')]);_0x418970[_0xaa5e('0x2e')]=_[_0xaa5e('0x2c')](_0x50ee6f[_0xaa5e('0x2d')],qs[_0xaa5e('0x2f')](_0x2011db[_0xaa5e('0x2a')][_0xaa5e('0x2f')]));_0x418970[_0xaa5e('0x2e')]=_0x418970[_0xaa5e('0x2e')]['length']?_0x418970[_0xaa5e('0x2e')]:_0x50ee6f['model'];if(_0x2011db['query'][_0xaa5e('0x30')]){_0x418970[_0xaa5e('0x31')]=[{'all':!![]}];}_0x418970=_['merge']({},_0x418970,_0x2011db['options']);return db[_0xaa5e('0x28')][_0xaa5e('0x32')](_0x418970)[_0xaa5e('0x20')](handleEntityNotFound(_0x2009fe,null))[_0xaa5e('0x20')](respondWithResult(_0x2009fe,null))['catch'](handleError(_0x2009fe,null));};exports[_0xaa5e('0x33')]=function(_0x5e0659,_0x2bf9e2){if(_0x5e0659[_0xaa5e('0x34')]['id']){delete _0x5e0659[_0xaa5e('0x34')]['id'];}return db[_0xaa5e('0x28')][_0xaa5e('0x32')]({'where':{'id':_0x5e0659[_0xaa5e('0x26')]['id']}})[_0xaa5e('0x20')](handleEntityNotFound(_0x2bf9e2,null))['then'](saveUpdates(_0x5e0659[_0xaa5e('0x34')],null))[_0xaa5e('0x20')](respondWithResult(_0x2bf9e2,null))['catch'](handleError(_0x2bf9e2,null));};exports[_0xaa5e('0x35')]=function(_0x1d9cc0,_0x4cfc79){return db[_0xaa5e('0x28')][_0xaa5e('0x32')]({'where':{'id':_0x1d9cc0[_0xaa5e('0x26')]['id']}})[_0xaa5e('0x20')](handleEntityNotFound(_0x4cfc79,null))['then'](removeEntity(_0x4cfc79,null))[_0xaa5e('0x36')](handleError(_0x4cfc79,null));}; \ No newline at end of file +var _0x18d4=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','show','params','model','keys','MailApplication','rawAttributes','query','intersection','attributes','fields','length','includeAll','include','merge','options','catch','find','body','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x4bce7b,_0x245cea){var _0x4a2b63=function(_0x3bd3d8){while(--_0x3bd3d8){_0x4bce7b['push'](_0x4bce7b['shift']());}};_0x4a2b63(++_0x245cea);}(_0x18d4,0x19e));var _0x418d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x18d4[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x418d('0x0'));var emlformat=require(_0x418d('0x1'));var rimraf=require(_0x418d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x418d('0x3'));var moment=require(_0x418d('0x4'));var BPromise=require(_0x418d('0x5'));var Mustache=require(_0x418d('0x6'));var util=require(_0x418d('0x7'));var path=require(_0x418d('0x8'));var sox=require(_0x418d('0x9'));var csv=require(_0x418d('0xa'));var ejs=require(_0x418d('0xb'));var fs=require('fs');var _=require(_0x418d('0xc'));var squel=require(_0x418d('0xd'));var crypto=require(_0x418d('0xe'));var jsforce=require(_0x418d('0xf'));var deskjs=require(_0x418d('0x10'));var toCsv=require(_0x418d('0xa'));var querystring=require(_0x418d('0x11'));var Papa=require(_0x418d('0x12'));var Redis=require(_0x418d('0x13'));var authService=require(_0x418d('0x14'));var qs=require(_0x418d('0x15'));var hardwareService=require(_0x418d('0x16'));var logger=require('../../config/logger')(_0x418d('0x17'));var utils=require(_0x418d('0x18'));var config=require(_0x418d('0x19'));var db=require(_0x418d('0x1a'))['db'];function respondWithStatusCode(_0x492a31,_0x1b9f1c){_0x1b9f1c=_0x1b9f1c||0xcc;return function(_0x4ad8bd){if(_0x4ad8bd){return _0x492a31[_0x418d('0x1b')](_0x1b9f1c);}return _0x492a31[_0x418d('0x1c')](_0x1b9f1c)[_0x418d('0x1d')]();};}function respondWithResult(_0xa37057,_0x3ad05e){_0x3ad05e=_0x3ad05e||0xc8;return function(_0x5ac709){if(_0x5ac709){return _0xa37057['status'](_0x3ad05e)[_0x418d('0x1e')](_0x5ac709);}};}function respondWithFilteredResult(_0x596370,_0x2554e6){return function(_0x428714){if(_0x428714){var _0x3f910a=_0x428714['count'],_0x23281c=_0x2554e6[_0x418d('0x1f')],_0x223a2e=_0x2554e6[_0x418d('0x1f')]+_0x2554e6[_0x418d('0x20')],_0x89f330;if(_0x223a2e>=_0x3f910a){_0x223a2e=_0x3f910a;_0x89f330=0xc8;}else{_0x89f330=0xce;}_0x596370[_0x418d('0x1c')](_0x89f330);return _0x596370[_0x418d('0x21')](_0x418d('0x22'),_0x23281c+'-'+_0x223a2e+'/'+_0x3f910a)[_0x418d('0x1e')](_0x428714);}return null;};}function patchUpdates(_0x130f82){return function(_0x9aab23){try{jsonpatch[_0x418d('0x23')](_0x9aab23,_0x130f82,!![]);}catch(_0x19be63){return BPromise['reject'](_0x19be63);}return _0x9aab23[_0x418d('0x24')]();};}function saveUpdates(_0x55f2a4,_0x1a3aec){return function(_0x2e6991){if(_0x2e6991){return _0x2e6991[_0x418d('0x25')](_0x55f2a4)['then'](function(_0x4ae933){return _0x4ae933;});}return null;};}function removeEntity(_0x19db00,_0x5d57f8){return function(_0x3ef79e){if(_0x3ef79e){return _0x3ef79e[_0x418d('0x26')]()[_0x418d('0x27')](function(){_0x19db00[_0x418d('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5837b1,_0x49812a){return function(_0x4c97a3){if(!_0x4c97a3){_0x5837b1[_0x418d('0x1b')](0x194);}return _0x4c97a3;};}function handleError(_0x2c437d,_0x5c81c0){_0x5c81c0=_0x5c81c0||0x1f4;return function(_0x2faed4){logger[_0x418d('0x28')](_0x2faed4[_0x418d('0x29')]);if(_0x2faed4['name']){delete _0x2faed4[_0x418d('0x2a')];}_0x2c437d['status'](_0x5c81c0)[_0x418d('0x2b')](_0x2faed4);};}exports[_0x418d('0x2c')]=function(_0x1b6687,_0x31f83d){var _0x1b84e3={'raw':!![],'where':{'id':_0x1b6687[_0x418d('0x2d')]['id']}},_0x39021a={};_0x39021a[_0x418d('0x2e')]=_[_0x418d('0x2f')](db[_0x418d('0x30')][_0x418d('0x31')]);_0x39021a[_0x418d('0x32')]=_[_0x418d('0x2f')](_0x1b6687['query']);_0x39021a['filters']=_[_0x418d('0x33')](_0x39021a[_0x418d('0x2e')],_0x39021a['query']);_0x1b84e3[_0x418d('0x34')]=_[_0x418d('0x33')](_0x39021a['model'],qs[_0x418d('0x35')](_0x1b6687['query'][_0x418d('0x35')]));_0x1b84e3['attributes']=_0x1b84e3[_0x418d('0x34')][_0x418d('0x36')]?_0x1b84e3[_0x418d('0x34')]:_0x39021a[_0x418d('0x2e')];if(_0x1b6687[_0x418d('0x32')][_0x418d('0x37')]){_0x1b84e3[_0x418d('0x38')]=[{'all':!![]}];}_0x1b84e3=_[_0x418d('0x39')]({},_0x1b84e3,_0x1b6687[_0x418d('0x3a')]);return db[_0x418d('0x30')]['find'](_0x1b84e3)[_0x418d('0x27')](handleEntityNotFound(_0x31f83d,null))[_0x418d('0x27')](respondWithResult(_0x31f83d,null))[_0x418d('0x3b')](handleError(_0x31f83d,null));};exports['update']=function(_0x5c7be4,_0x3e1593){if(_0x5c7be4['body']['id']){delete _0x5c7be4['body']['id'];}return db[_0x418d('0x30')][_0x418d('0x3c')]({'where':{'id':_0x5c7be4['params']['id']}})['then'](handleEntityNotFound(_0x3e1593,null))[_0x418d('0x27')](saveUpdates(_0x5c7be4[_0x418d('0x3d')],null))['then'](respondWithResult(_0x3e1593,null))[_0x418d('0x3b')](handleError(_0x3e1593,null));};exports[_0x418d('0x26')]=function(_0x2bd12b,_0x3fd4f6){return db[_0x418d('0x30')]['find']({'where':{'id':_0x2bd12b['params']['id']}})[_0x418d('0x27')](handleEntityNotFound(_0x3fd4f6,null))[_0x418d('0x27')](removeEntity(_0x3fd4f6,null))[_0x418d('0x3b')](handleError(_0x3fd4f6,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 4f41df4..a620930 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 _0x842e=['utf8mb4','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports','MailApplication','mail_applications'];(function(_0x97a80f,_0x3d70d7){var _0x534071=function(_0xd8966e){while(--_0xd8966e){_0x97a80f['push'](_0x97a80f['shift']());}};_0x534071(++_0x3d70d7);}(_0x842e,0x1c1));var _0xe842=function(_0x3b4d1b,_0x12517b){_0x3b4d1b=_0x3b4d1b-0x0;var _0x5a2ffd=_0x842e[_0x3b4d1b];return _0x5a2ffd;};'use strict';var _=require(_0xe842('0x0'));var util=require(_0xe842('0x1'));var logger=require('../../config/logger')(_0xe842('0x2'));var moment=require(_0xe842('0x3'));var BPromise=require(_0xe842('0x4'));var rp=require(_0xe842('0x5'));var fs=require('fs');var path=require(_0xe842('0x6'));var rimraf=require(_0xe842('0x7'));var config=require(_0xe842('0x8'));var attributes=require(_0xe842('0x9'));module[_0xe842('0xa')]=function(_0x31976d,_0x39a57e){return _0x31976d['define'](_0xe842('0xb'),attributes,{'tableName':_0xe842('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe842('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x1792=['../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','rimraf'];(function(_0x4b7b69,_0x3ab075){var _0x173b4c=function(_0x234d5f){while(--_0x234d5f){_0x4b7b69['push'](_0x4b7b69['shift']());}};_0x173b4c(++_0x3ab075);}(_0x1792,0x111));var _0x2179=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0x1792[_0x2d34d6];return _0x1d3d12;};'use strict';var _=require(_0x2179('0x0'));var util=require(_0x2179('0x1'));var logger=require('../../config/logger')(_0x2179('0x2'));var moment=require(_0x2179('0x3'));var BPromise=require(_0x2179('0x4'));var rp=require(_0x2179('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2179('0x6'));var config=require(_0x2179('0x7'));var attributes=require(_0x2179('0x8'));module[_0x2179('0x9')]=function(_0x18ada4,_0x2e5361){return _0x18ada4[_0x2179('0xa')](_0x2179('0xb'),attributes,{'tableName':_0x2179('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x2179('0xd')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 0018df4..f56411d 100644 --- a/server/api/mailApplication/mailApplication.rpc.js +++ b/server/api/mailApplication/mailApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['message','request\x20sent','result','catch','MailApplication','update','body','options','raw','where','attributes','limit','then','UpdateMailApplication','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailApplication,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x15930a,_0x526964){var _0x3c6a93=function(_0x249d88){while(--_0x249d88){_0x15930a['push'](_0x15930a['shift']());}};_0x3c6a93(++_0x526964);}(_0x7a54,0x106));var _0x47a5=function(_0x23d32a,_0x415f46){_0x23d32a=_0x23d32a-0x0;var _0x4488e6=_0x7a54[_0x23d32a];return _0x4488e6;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['UpdateMailApplication']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5247fd['options']?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x1a')]||null:null,'attributes':_0x5247fd['options']?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x1b')]||null:null,'limit':_0x5247fd[_0x47a5('0x18')]?_0x5247fd['options'][_0x47a5('0x1c')]||null:null})[_0x47a5('0x1d')](function(_0x23db32){logger[_0x47a5('0xb')]('UpdateMailApplication',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON['stringify'](_0x23db32));_0xaf70a6(_0x23db32);})[_0x47a5('0x14')](function(_0xc4cd63){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0xc4cd63[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xc4cd63['message']));});});}; \ No newline at end of file +var _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(_0x43a12f,_0x3d0108){var _0x36994d=function(_0x4723f5){while(--_0x4723f5){_0x43a12f['push'](_0x43a12f['shift']());}};_0x36994d(++_0x3d0108);}(_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']('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 diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 7ca1f0f..8aaff28 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(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0x54ef,0x112));var _0xf54e=function(_0x3c9157,_0x3d0d66){_0x3c9157=_0x3c9157-0x0;var _0x409c1a=_0x54ef[_0x3c9157];return _0x409c1a;};'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 _0x9c44=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','show','getMessages','download','create','post','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','update','delete','destroy','removeTags','path'];(function(_0x2bf466,_0x4929a5){var _0x856885=function(_0x102ef1){while(--_0x102ef1){_0x2bf466['push'](_0x2bf466['shift']());}};_0x856885(++_0x4929a5);}(_0x9c44,0x178));var _0x49c4=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x9c44[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var auth=require(_0x49c4('0x4'));var interaction=require(_0x49c4('0x5'));var config=require('../../config/environment');var controller=require('./mailInteraction.controller');router[_0x49c4('0x6')]('/',auth['isAuthenticated'](),controller[_0x49c4('0x7')]);router[_0x49c4('0x6')](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xa')]);router['get'](_0x49c4('0xb'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xc')]);router[_0x49c4('0x6')]('/:id/messages',auth['isAuthenticated'](),controller[_0x49c4('0xd')]);router[_0x49c4('0x6')]('/:id/download',auth[_0x49c4('0x9')](),controller[_0x49c4('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id/messages',auth[_0x49c4('0x9')](),controller[_0x49c4('0x11')]);router['post'](_0x49c4('0x12'),auth[_0x49c4('0x9')](),interaction[_0x49c4('0x13')](_0x49c4('0x14'),_0x49c4('0x15')),controller[_0x49c4('0x16')]);router[_0x49c4('0x17')](_0x49c4('0xb'),auth['isAuthenticated'](),interaction[_0x49c4('0x13')](_0x49c4('0x14'),_0x49c4('0x18')),controller[_0x49c4('0x19')]);router[_0x49c4('0x1a')]('/:id',auth[_0x49c4('0x9')](),interaction[_0x49c4('0x13')]('mail','mailinteraction:destroy'),controller[_0x49c4('0x1b')]);router[_0x49c4('0x1a')](_0x49c4('0x12'),auth['isAuthenticated'](),controller[_0x49c4('0x1c')]);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 de62dcf..9b7c222 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 _0x07d3=['DATE','STRING','TEXT','long','ENUM','out','sequelize','iconv','exports','BOOLEAN'];(function(_0x481af3,_0x483fac){var _0x3354ea=function(_0x2e3de5){while(--_0x2e3de5){_0x481af3['push'](_0x481af3['shift']());}};_0x3354ea(++_0x483fac);}(_0x07d3,0x128));var _0x307d=function(_0x153a41,_0x577875){_0x153a41=_0x153a41-0x0;var _0x12a3f4=_0x07d3[_0x153a41];return _0x12a3f4;};'use strict';var Sequelize=require(_0x307d('0x0'));var iconv=require(_0x307d('0x1'));module[_0x307d('0x2')]={'closed':{'type':Sequelize[_0x307d('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x307d('0x4')]},'disposition':{'type':Sequelize[_0x307d('0x5')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x307d('0x5')]},'cc':{'type':Sequelize[_0x307d('0x6')](_0x307d('0x7'))},'subject':{'type':Sequelize[_0x307d('0x6')]()},'attach':{'type':Sequelize[_0x307d('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x307d('0x4')]},'substatus':{'type':Sequelize[_0x307d('0x5')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x307d('0x8')]('in',_0x307d('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x307d('0x8')]('in',_0x307d('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize['TEXT'](_0x307d('0x7'))},'lastMsgText':{'type':Sequelize[_0x307d('0x6')]('long')}}; \ No newline at end of file +var _0xb38a=['DATE','STRING','TEXT','long','BOOLEAN','out','ENUM','sequelize','iconv','exports'];(function(_0x5a39a7,_0x392fb0){var _0x59de9f=function(_0x12fc2b){while(--_0x12fc2b){_0x5a39a7['push'](_0x5a39a7['shift']());}};_0x59de9f(++_0x392fb0);}(_0xb38a,0x9d));var _0xab38=function(_0x489d63,_0x21fba5){_0x489d63=_0x489d63-0x0;var _0x380988=_0xb38a[_0x489d63];return _0x380988;};'use strict';var Sequelize=require(_0xab38('0x0'));var iconv=require(_0xab38('0x1'));module[_0xab38('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xab38('0x3')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xab38('0x4')]},'inReplyTo':{'type':Sequelize[_0xab38('0x4')](0x1fe)},'to':{'type':Sequelize[_0xab38('0x4')]},'cc':{'type':Sequelize[_0xab38('0x5')](_0xab38('0x6'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0xab38('0x7')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xab38('0x3')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0xab38('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xab38('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xab38('0x9')]('in',_0xab38('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0xab38('0x5')](_0xab38('0x6'))},'lastMsgText':{'type':Sequelize[_0xab38('0x5')](_0xab38('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 245611c..18560eb 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 _0xeea1=['merge','a.key','Account.key','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgDirection','i.subject','i.disposition','i.substatus','i.to','i.ContactId','i.MailAccountId','Contact.firstName','Contact.lastName','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','MailInteractionId','Setting','enableEmailPreview','all','show','params','options','create','body','find','destroy','describe','addMessage','MailMessage','ids','getMessages','YYYY-MM-DD\x20HH:mm:ss','includeAll','include','findAll','rows','setTags','spread','emit','mailInteractionTags:save','removeTags','unix','root','server','files','attachments','tmp','interaction-%s.zip','bcc','subject','mkdirSync','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','basename','type','readFileSync','build','writeFileSync','message%d.eml','download','log','err','unlinkSync','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','./mailInteraction.socket','register','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','update','then','error','stack','name','send','Users','map','Tags','TagIds','split','forEach','push','MailInteraction','findOne','lastMsgBody','lastMsgText','trimStart','fromString','catch','index','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','select','field','color','COUNT(*)','from','mail_messages','me.MailInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','u.id','user_has_mail_interactions','users','u.id\x20=\x20ui.UserId','mail_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','me.MailInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false','expr','advancedFilter','createdAt','value','startOf','utc','format','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','condition','unreadMessages','isArray','tableAlias','\x20IN\x20?','\x20=\x20?','LIKE','c.firstName','c.email','\x20LIKE\x20?','\x20>\x20?','TagId','ContactId','c.lastName','\x20<\x20?','filter','isNil','isEmpty','MailAccountId','concat','parse','$gte','null','\x20IS\x20NULL','replace','\x27\x27\x27\x27','isNumeric','c.email\x20LIKE\x20?','toString','join','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','order','DESC','group','i.id','SELECT','clone','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','sequelize'];(function(_0x28aea5,_0x3bb12e){var _0x6a55f9=function(_0xf6ece8){while(--_0xf6ece8){_0x28aea5['push'](_0x28aea5['shift']());}};_0x6a55f9(++_0x3bb12e);}(_0xeea1,0x12d));var _0x1eea=function(_0x51ff30,_0x5aff7a){_0x51ff30=_0x51ff30-0x0;var _0x47fd97=_0xeea1[_0x51ff30];return _0x47fd97;};'use strict';var pdf=require(_0x1eea('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1eea('0x1'));var zipdir=require(_0x1eea('0x2'));var jsonpatch=require(_0x1eea('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1eea('0x4'));var Mustache=require(_0x1eea('0x5'));var util=require(_0x1eea('0x6'));var path=require(_0x1eea('0x7'));var sox=require(_0x1eea('0x8'));var csv=require(_0x1eea('0x9'));var ejs=require(_0x1eea('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x1eea('0xb'));var jsforce=require(_0x1eea('0xc'));var deskjs=require(_0x1eea('0xd'));var toCsv=require(_0x1eea('0x9'));var querystring=require(_0x1eea('0xe'));var Papa=require(_0x1eea('0xf'));var htmlToText=require(_0x1eea('0x10'));var Redis=require(_0x1eea('0x11'));var authService=require(_0x1eea('0x12'));var qs=require(_0x1eea('0x13'));var hardwareService=require(_0x1eea('0x14'));var logger=require('../../config/logger')(_0x1eea('0x15'));var utils=require(_0x1eea('0x16'));var config=require(_0x1eea('0x17'));var db=require(_0x1eea('0x18'))['db'];config[_0x1eea('0x19')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1eea('0x1a'))[_0x1eea('0x1b')](socket);function respondWithStatusCode(_0x1e938e,_0x1e3adc){_0x1e3adc=_0x1e3adc||0xcc;return function(_0x43b2c5){if(_0x43b2c5){return _0x1e938e[_0x1eea('0x1c')](_0x1e3adc);}return _0x1e938e[_0x1eea('0x1d')](_0x1e3adc)[_0x1eea('0x1e')]();};}function respondWithResult(_0x317b86,_0x393902){_0x393902=_0x393902||0xc8;return function(_0x2420be){if(_0x2420be){return _0x317b86['status'](_0x393902)[_0x1eea('0x1f')](_0x2420be);}};}function respondWithFilteredResult(_0x28550e,_0x33ec25){return function(_0x45e1ed){if(_0x45e1ed){var _0x3c01ed=_0x45e1ed[_0x1eea('0x20')],_0x15f698=_0x33ec25[_0x1eea('0x21')],_0x561985=_0x33ec25[_0x1eea('0x21')]+_0x33ec25['limit'],_0x31ce28;if(_0x561985>=_0x3c01ed){_0x561985=_0x3c01ed;_0x31ce28=0xc8;}else{_0x31ce28=0xce;}_0x28550e[_0x1eea('0x1d')](_0x31ce28);return _0x28550e[_0x1eea('0x22')](_0x1eea('0x23'),_0x15f698+'-'+_0x561985+'/'+_0x3c01ed)['json'](_0x45e1ed);}return null;};}function patchUpdates(_0x4b4016){return function(_0x25bf04){try{jsonpatch[_0x1eea('0x24')](_0x25bf04,_0x4b4016,!![]);}catch(_0x31afb4){return BPromise[_0x1eea('0x25')](_0x31afb4);}return _0x25bf04['save']();};}function saveUpdates(_0x1fcf70,_0x55a532){return function(_0x1c4599){if(_0x1c4599){return _0x1c4599[_0x1eea('0x26')](_0x1fcf70)[_0x1eea('0x27')](function(_0x399970){return _0x399970;});}return null;};}function removeEntity(_0x51b4cc,_0x41a15d){return function(_0x195968){if(_0x195968){return _0x195968['destroy']()['then'](function(){_0x51b4cc[_0x1eea('0x1d')](0xcc)[_0x1eea('0x1e')]();});}};}function handleEntityNotFound(_0x1459b4,_0x4e4765){return function(_0x65a615){if(!_0x65a615){_0x1459b4[_0x1eea('0x1c')](0x194);}return _0x65a615;};}function handleError(_0x232d0b,_0x1b396e){_0x1b396e=_0x1b396e||0x1f4;return function(_0x5593a8){logger[_0x1eea('0x28')](_0x5593a8[_0x1eea('0x29')]);if(_0x5593a8[_0x1eea('0x2a')]){delete _0x5593a8[_0x1eea('0x2a')];}_0x232d0b['status'](_0x1b396e)[_0x1eea('0x2b')](_0x5593a8);};}function getInteractionUsers(_0x286136,_0xe478e1){return new BPromise(function(_0x1fa3bc,_0x275d23){try{if(_0xe478e1[_0x286136['id']]){_0x286136[_0x1eea('0x2c')]=_[_0x1eea('0x2d')](_0xe478e1[_0x286136['id']],function(_0x5d7631){return{'id':_0x5d7631['id']};});}}catch(_0x2b8ee7){_0x275d23(_0x2b8ee7);}_0x1fa3bc(_0x286136);});}function getInteractionTags(_0x2e8577,_0x5a2612){return new BPromise(function(_0x2c02da,_0x45d96d){try{if(_0x2e8577['TagIds']){_0x2e8577[_0x1eea('0x2e')]=[];_0x2e8577[_0x1eea('0x2f')][_0x1eea('0x30')](',')[_0x1eea('0x31')](function(_0x5f180f){_0x2e8577[_0x1eea('0x2e')][_0x1eea('0x32')](_0x5a2612[_0x5f180f]);});}delete _0x2e8577['TagIds'];}catch(_0x4f541d){_0x45d96d(_0x4f541d);}_0x2c02da(_0x2e8577);});}function getLastMessageText(_0x51ddc4){return new BPromise(function(_0x5c0cf4,_0x328021){return db[_0x1eea('0x33')][_0x1eea('0x34')]({'where':{'id':_0x51ddc4['id']},'attributes':[_0x1eea('0x35'),_0x1eea('0x36')],'raw':!![]})[_0x1eea('0x27')](function(_0x42a16b){if(!_0x42a16b[_0x1eea('0x36')]){_0x51ddc4[_0x1eea('0x36')]=_[_0x1eea('0x37')](htmlToText[_0x1eea('0x38')](_0x42a16b['lastMsgBody'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x51ddc4[_0x1eea('0x36')]=_0x42a16b['lastMsgText'];}_0x5c0cf4(_0x51ddc4);})[_0x1eea('0x39')](function(_0x5a5bd0){_0x328021(_0x5a5bd0);});});}function updateMailInteraction(_0x13e360,_0x559292,_0x18eb82,_0x1d1223){return new BPromise(function(_0x124db9,_0x218180){return getInteractionUsers(_0x13e360,_0x18eb82)[_0x1eea('0x27')](function(_0x40e502){return getInteractionTags(_0x40e502,_0x559292);})[_0x1eea('0x27')](function(_0x1750a9){if(_0x1d1223){_0x124db9(getLastMessageText(_0x1750a9));}else{_0x124db9(_0x1750a9);}})['catch'](function(_0x1734de){_0x218180(_0x1734de);});});}exports[_0x1eea('0x3a')]=function(_0x478fa5,_0x1acd8b){var _0x26636b={},_0x1a893a={},_0xec8a0d={'count':0x0,'rows':[]};var _0x3e276d=db['MailInteraction'][_0x1eea('0x3b')];_0x1a893a[_0x1eea('0x3c')]=_[_0x1eea('0x3d')](_0x3e276d);_0x1a893a[_0x1eea('0x3e')]=_[_0x1eea('0x3d')](_0x478fa5[_0x1eea('0x3e')]);_0x1a893a['filters']=_['intersection'](_0x1a893a['model'],_0x1a893a['query']);_0x26636b['attributes']=_[_0x1eea('0x3f')](_0x1a893a['model'],qs[_0x1eea('0x40')](_0x478fa5[_0x1eea('0x3e')]['fields']));_0x26636b[_0x1eea('0x41')]=_0x26636b[_0x1eea('0x41')][_0x1eea('0x42')]?_0x26636b[_0x1eea('0x41')]:_0x1a893a[_0x1eea('0x3c')];if(!_0x478fa5[_0x1eea('0x3e')][_0x1eea('0x43')](_0x1eea('0x44'))){_0x26636b[_0x1eea('0x45')]=qs[_0x1eea('0x45')](_0x478fa5[_0x1eea('0x3e')][_0x1eea('0x45')]);_0x26636b[_0x1eea('0x21')]=qs[_0x1eea('0x21')](_0x478fa5[_0x1eea('0x3e')][_0x1eea('0x21')]);}_0x26636b['order']=qs[_0x1eea('0x46')](_0x478fa5[_0x1eea('0x3e')][_0x1eea('0x46')]);_0x26636b[_0x1eea('0x47')]=qs[_0x1eea('0x48')](_[_0x1eea('0x49')](_0x478fa5[_0x1eea('0x3e')],_0x1a893a[_0x1eea('0x48')]));var _0x116291=[];var _0x2efea9=squel[_0x1eea('0x4a')]()['field']('id')[_0x1eea('0x4b')](_0x1eea('0x2a'))[_0x1eea('0x4b')](_0x1eea('0x4c'))['from']('tools_tags');var _0x57b797=squel[_0x1eea('0x4a')]()[_0x1eea('0x4b')](_0x1eea('0x4d'))[_0x1eea('0x4e')](_0x1eea('0x4f'),'me')[_0x1eea('0x47')](_0x1eea('0x50'))[_0x1eea('0x47')](_0x1eea('0x51'))[_0x1eea('0x47')]('me.read\x20=\x20false');var _0x290bda=squel[_0x1eea('0x4a')]()['field'](_0x1eea('0x52'))[_0x1eea('0x4b')]('ui.MailInteractionId')[_0x1eea('0x4e')](_0x1eea('0x53'),'ui')['left_join'](_0x1eea('0x54'),'u',_0x1eea('0x55'));var _0x24723b=squel[_0x1eea('0x4a')]()[_0x1eea('0x4e')](_0x1eea('0x56'),'i')[_0x1eea('0x57')](_0x1eea('0x58'),'c',_0x1eea('0x59'))[_0x1eea('0x57')]('users','o',_0x1eea('0x5a'))['left_join'](_0x1eea('0x5b'),'a',_0x1eea('0x5c'))[_0x1eea('0x57')](_0x1eea('0x4f'),'me',_0x1eea('0x5d'));var _0x5b3444=squel[_0x1eea('0x5e')]();if(_0x478fa5[_0x1eea('0x3e')][_0x1eea('0x5f')]){var _0x98e31c=JSON['parse'](_0x478fa5[_0x1eea('0x3e')][_0x1eea('0x5f')]);_[_0x1eea('0x3d')](_0x98e31c)[_0x1eea('0x31')](function(_0x194f1c){var _0x4cc191=_0x98e31c[_0x194f1c];if(_0x194f1c===_0x1eea('0x60')){var _0x42975c=moment(_0x4cc191[_0x1eea('0x61')]['dateStart'])[_0x1eea('0x62')]('day')[_0x1eea('0x63')]()[_0x1eea('0x64')]();var _0x151586=moment(_0x151586)[_0x1eea('0x63')]()['endOf']('day')['format']();_0x5b3444[_0x1eea('0x65')](_0x1eea('0x66'),_0x42975c,_0x151586);}else{if(_['isArray'](_0x4cc191[_0x1eea('0x67')])){_0x4cc191['condition'][_0x1eea('0x31')](function(_0x4f8ba0){switch(_0x4cc191[_0x1eea('0x67')][_0x1eea('0x61')]){case'IS':if(_0x194f1c!=='TagId'&&_0x194f1c!==_0x1eea('0x68')){if(_[_0x1eea('0x69')](_0x4cc191[_0x1eea('0x61')])&&_0x4cc191[_0x1eea('0x61')]['length']>0x1){_0x5b3444[_0x1eea('0x65')](_0x4cc191[_0x1eea('0x6a')]+'.'+_0x194f1c+_0x1eea('0x6b'),_0x4cc191[_0x1eea('0x61')]);}else{_0x5b3444['and'](_0x4cc191[_0x1eea('0x6a')]+'.'+_0x194f1c+_0x1eea('0x6c'),_0x4cc191[_0x1eea('0x61')][0x0]);}}break;case'=':_0x5b3444[_0x1eea('0x65')](_0x4cc191['tableAlias']+'.'+_0x194f1c+_0x1eea('0x6c'),_0x4cc191['value']);break;case _0x1eea('0x6d'):if(_0x194f1c==='ContactId'){_0x5b3444['and'](_0x1eea('0x6e')+'\x20LIKE\x20?','%'+_0x4cc191[_0x1eea('0x61')]+'%');_0x5b3444['or']('c.lastName'+'\x20LIKE\x20?','%'+_0x4cc191[_0x1eea('0x61')]+'%');_0x5b3444['or'](_0x1eea('0x6f')+_0x1eea('0x70'),'%'+_0x4cc191[_0x1eea('0x61')]+'%');}else{_0x5b3444[_0x1eea('0x65')](_0x4cc191[_0x1eea('0x6a')]+'.'+_0x194f1c+_0x1eea('0x70'),'%'+_0x4cc191[_0x1eea('0x61')]+'%');}break;case'>':_0x5b3444[_0x1eea('0x65')](_0x4cc191[_0x1eea('0x6a')]+'.'+_0x194f1c+_0x1eea('0x71'),_0x4cc191[_0x1eea('0x61')]);break;case'<':_0x5b3444[_0x1eea('0x65')](_0x4cc191[_0x1eea('0x6a')]+'.'+_0x194f1c+'\x20<\x20?',_0x4cc191[_0x1eea('0x61')]);break;}});}else{switch(_0x4cc191[_0x1eea('0x67')][_0x1eea('0x61')]){case'IS':if(_0x194f1c!==_0x1eea('0x72')&&_0x194f1c!=='unreadMessages'){if(_['isArray'](_0x4cc191[_0x1eea('0x61')])&&_0x4cc191[_0x1eea('0x61')][_0x1eea('0x42')]>0x1){_0x5b3444[_0x1eea('0x65')](_0x4cc191[_0x1eea('0x6a')]+'.'+_0x194f1c+_0x1eea('0x6b'),_0x4cc191[_0x1eea('0x61')]);}else{_0x5b3444['and'](_0x4cc191[_0x1eea('0x6a')]+'.'+_0x194f1c+_0x1eea('0x6c'),_0x4cc191[_0x1eea('0x61')][0x0]);}}break;case'=':_0x5b3444['and'](_0x4cc191[_0x1eea('0x6a')]+'.'+_0x194f1c+'\x20=\x20?',_0x4cc191[_0x1eea('0x61')]);break;case'LIKE':if(_0x194f1c===_0x1eea('0x73')){_0x5b3444['and'](_0x1eea('0x6e')+_0x1eea('0x70'),'%'+_0x4cc191[_0x1eea('0x61')]+'%');_0x5b3444['or'](_0x1eea('0x74')+'\x20LIKE\x20?','%'+_0x4cc191[_0x1eea('0x61')]+'%');_0x5b3444['or'](_0x1eea('0x6f')+'\x20LIKE\x20?','%'+_0x4cc191[_0x1eea('0x61')]+'%');}else{_0x5b3444[_0x1eea('0x65')](_0x4cc191['tableAlias']+'.'+_0x194f1c+_0x1eea('0x70'),'%'+_0x4cc191[_0x1eea('0x61')]+'%');}break;case'>':_0x5b3444['and'](_0x4cc191[_0x1eea('0x6a')]+'.'+_0x194f1c+_0x1eea('0x71'),_0x4cc191[_0x1eea('0x61')]);break;case'<':_0x5b3444[_0x1eea('0x65')](_0x4cc191[_0x1eea('0x6a')]+'.'+_0x194f1c+_0x1eea('0x75'),_0x4cc191[_0x1eea('0x61')]);break;}}}});}else{var _0x3b10bf=_(Object[_0x1eea('0x3d')](_0x478fa5[_0x1eea('0x3e')]))[_0x1eea('0x2d')](function(_0xe9bcf0){return _0x3e276d[_0x1eea('0x43')](_0xe9bcf0)?_0xe9bcf0:undefined;})[_0x1eea('0x76')](function(_0x5cf302){return!_[_0x1eea('0x77')](_0x5cf302);})[_0x1eea('0x61')]();if(!_[_0x1eea('0x78')](_0x3b10bf)){_0x3b10bf[_0x1eea('0x31')](function(_0x4d20a1){if(_0x4d20a1===_0x1eea('0x79')){_0x24723b[_0x1eea('0x47')]('i.MailAccountId\x20IN\x20?',[][_0x1eea('0x7a')](_0x478fa5[_0x1eea('0x3e')][_0x4d20a1]));}else if(_0x4d20a1===_0x1eea('0x60')){var _0x19c3f3=JSON[_0x1eea('0x7b')](_0x478fa5[_0x1eea('0x3e')][_0x4d20a1])[_0x1eea('0x7c')];var _0x3233b3=JSON['parse'](_0x478fa5['query'][_0x4d20a1])['$lte'];_0x24723b[_0x1eea('0x47')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x19c3f3,_0x3233b3);}else{if(_0x478fa5[_0x1eea('0x3e')][_0x4d20a1]===_0x1eea('0x7d')){_0x24723b[_0x1eea('0x47')]('i.'+_0x4d20a1+_0x1eea('0x7e'));}else{_0x24723b[_0x1eea('0x47')]('i.'+_0x4d20a1+_0x1eea('0x6c'),_0x478fa5[_0x1eea('0x3e')][_0x4d20a1]);}}});}if(_0x478fa5['query'][_0x1eea('0x76')]){var _0xda06d6=_0x478fa5[_0x1eea('0x3e')]['filter'][_0x1eea('0x7f')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x1eea('0x80'));if(qs[_0x1eea('0x81')](_0xda06d6)){_0x5b3444['or']('i.id\x20LIKE\x20?',_0xda06d6+'%');}else if(qs['isEmail'](_0xda06d6)){_0x5b3444['or'](_0x1eea('0x82'),_0xda06d6+'%');}else{var _0x2cc74b=[];_0xda06d6[_0x1eea('0x30')]('\x20')[_0x1eea('0x31')](function(_0x87daa3){_0x2cc74b[_0x1eea('0x32')]('+'+_0x87daa3[_0x1eea('0x83')]());});var _0x2437cf=_0x2cc74b[_0x1eea('0x84')]('\x20');_0x5b3444['or'](_0x1eea('0x85'),_0x2437cf)['or'](_0x1eea('0x86'),_0x2437cf);}}}_0x24723b[_0x1eea('0x47')](_0x5b3444);if(_0x26636b[_0x1eea('0x87')]){_0x26636b[_0x1eea('0x87')][_0x1eea('0x31')](function(_0x37a1e1){_0x24723b[_0x1eea('0x87')]('i.'+_0x37a1e1[0x0],_0x37a1e1[0x1]===_0x1eea('0x88')?![]:!![]);});}_0x24723b[_0x1eea('0x89')](_0x1eea('0x8a'));var _0x3e412d={'type':db['Sequelize']['QueryTypes'][_0x1eea('0x8b')],'raw':!![]};var _0x17c9c6=_0x24723b[_0x1eea('0x8c')]()[_0x1eea('0x4b')](_0x1eea('0x4d'))[_0x1eea('0x4b')]('COUNT(me.id)','unreadMessages');if(!_0x478fa5[_0x1eea('0x3e')]['advancedFilter']){if(_0x478fa5[_0x1eea('0x3e')][_0x1eea('0x8d')]){if(_0x478fa5[_0x1eea('0x3e')][_0x1eea('0x8d')]==0x1){_0x17c9c6[_0x1eea('0x8e')]('`unreadMessages`\x20=\x200');_0x24723b[_0x1eea('0x8e')](_0x1eea('0x8f'));}else{_0x17c9c6[_0x1eea('0x8e')](_0x1eea('0x90'));_0x24723b[_0x1eea('0x8e')](_0x1eea('0x90'));}}if(_0x478fa5[_0x1eea('0x3e')]['tag']){var _0x518f4a=_['isArray'](_0x478fa5[_0x1eea('0x3e')][_0x1eea('0x91')])?_0x478fa5[_0x1eea('0x3e')][_0x1eea('0x91')]:new Array(_0x478fa5[_0x1eea('0x3e')][_0x1eea('0x91')]);var _0x51d324=squel['expr']();_0x518f4a[_0x1eea('0x31')](function(_0x30b848){_0x51d324['or'](_0x1eea('0x92'),'%,'+_0x30b848+',%');});_0x24723b[_0x1eea('0x8e')](_0x51d324);_0x17c9c6[_0x1eea('0x57')](_0x1eea('0x93'),'it',_0x1eea('0x94'));_0x17c9c6[_0x1eea('0x57')](_0x1eea('0x95'),'t',_0x1eea('0x96'));_0x17c9c6[_0x1eea('0x47')](_0x1eea('0x97'),_0x518f4a);}}else{var _0x98e31c=JSON[_0x1eea('0x7b')](_0x478fa5[_0x1eea('0x3e')][_0x1eea('0x5f')]);_[_0x1eea('0x3d')](_0x98e31c)[_0x1eea('0x31')](function(_0x5e0bd9){var _0x3c85b4=_0x98e31c[_0x5e0bd9];if(_0x5e0bd9==='TagId'){var _0x3427a8=_0x3c85b4['value'];var _0x260110=squel[_0x1eea('0x5e')]();_0x3427a8[_0x1eea('0x31')](function(_0x11195b){_0x260110['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x11195b+',%');});_0x24723b[_0x1eea('0x8e')](_0x260110);_0x17c9c6[_0x1eea('0x57')](_0x1eea('0x93'),'it','it.MailInteractionId\x20=\x20i.id');_0x17c9c6[_0x1eea('0x57')]('tools_tags','t',_0x1eea('0x96'));_0x17c9c6[_0x1eea('0x47')](_0x1eea('0x97'),_0x3427a8);}else if(_0x5e0bd9===_0x1eea('0x68')){if(_0x3c85b4[_0x1eea('0x61')]['length']===0x1){if(_0x3c85b4[_0x1eea('0x61')][0x0]===0x1){_0x17c9c6[_0x1eea('0x8e')](_0x1eea('0x8f'));_0x24723b[_0x1eea('0x8e')](_0x1eea('0x8f'));}else{_0x17c9c6[_0x1eea('0x8e')](_0x1eea('0x90'));_0x24723b[_0x1eea('0x8e')]('`unreadMessages`\x20>\x200');}}}});}db[_0x1eea('0x98')][_0x1eea('0x3e')](_0x17c9c6['toString'](),_0x3e412d)[_0x1eea('0x27')](function(_0x4eabbd){_0xec8a0d['count']=_0x4eabbd[_0x1eea('0x42')];if(_0xec8a0d['count']===0x0)return[];return db[_0x1eea('0x98')][_0x1eea('0x3e')](_0x2efea9[_0x1eea('0x83')](),_0x3e412d)[_0x1eea('0x27')](function(_0x18bbfc){_0x116291=_['keyBy'](_0x18bbfc,'id');_0x3e412d=_[_0x1eea('0x99')](_0x3e412d,{'model':db[_0x1eea('0x33')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x24723b[_0x1eea('0x4b')]('COUNT(me.id)','unreadMessages');_0x24723b['field'](_0x1eea('0x9a'),_0x1eea('0x9b'));_0x24723b['field']('i.id');_0x24723b['field'](_0x1eea('0x9c'));_0x24723b[_0x1eea('0x4b')](_0x1eea('0x9d'));_0x24723b[_0x1eea('0x4b')](_0x1eea('0x9e'));_0x24723b['field'](_0x1eea('0x9f'));_0x24723b[_0x1eea('0x4b')](_0x1eea('0xa0'));_0x24723b[_0x1eea('0x4b')]('i.lastMsgAt');_0x24723b[_0x1eea('0x4b')](_0x1eea('0xa1'));_0x24723b['field'](_0x1eea('0xa2'));_0x24723b[_0x1eea('0x4b')](_0x1eea('0xa3'));_0x24723b['field'](_0x1eea('0xa4'));_0x24723b[_0x1eea('0x4b')](_0x1eea('0xa5'));_0x24723b['field'](_0x1eea('0xa6'));_0x24723b[_0x1eea('0x4b')](_0x1eea('0xa7'));_0x24723b[_0x1eea('0x4b')]('i.UserId');_0x24723b[_0x1eea('0x4b')](_0x1eea('0x6e'),_0x1eea('0xa8'));_0x24723b[_0x1eea('0x4b')](_0x1eea('0x74'),_0x1eea('0xa9'));_0x24723b[_0x1eea('0x4b')](_0x1eea('0x6f'),_0x1eea('0xaa'));_0x24723b['field'](_0x1eea('0xab'),'Contact.phone');_0x24723b[_0x1eea('0x4b')](_0x1eea('0xac'),_0x1eea('0xad'));_0x24723b[_0x1eea('0x4b')](_0x1eea('0xae'),_0x1eea('0xaf'));_0x24723b[_0x1eea('0x4b')](_0x1eea('0xb0'),_0x1eea('0x2f'));_0x24723b[_0x1eea('0x57')]('mail_interaction_has_tags','it',_0x1eea('0x94'));_0x24723b['left_join'](_0x1eea('0x95'),'t','t.id\x20=\x20it.TagId');_0x24723b['limit'](_0x26636b[_0x1eea('0x45')]);_0x24723b[_0x1eea('0x21')](_0x26636b['offset']);return db['sequelize']['query'](_0x24723b[_0x1eea('0x83')](),_0x3e412d);})[_0x1eea('0x27')](function(_0x47d6c3){_0x290bda[_0x1eea('0x47')]('ui.MailInteractionId\x20IN\x20?',_[_0x1eea('0x2d')](_0x47d6c3,'id'));return db['sequelize'][_0x1eea('0x3e')](_0x290bda[_0x1eea('0x83')](),_0x3e412d)['then'](function(_0x3a409a){var _0x3dfcfa=_['groupBy'](_0x3a409a,_0x1eea('0xb1'));var _0x139b25=[];return db[_0x1eea('0xb2')][_0x1eea('0x34')]({'attributes':[_0x1eea('0xb3')],'raw':!![]})[_0x1eea('0x27')](function(_0x45ce3e){var _0x43c4d8=_0x45ce3e[_0x1eea('0xb3')];_0x47d6c3[_0x1eea('0x31')](function(_0x11bed4){_0x139b25['push'](updateMailInteraction(_0x11bed4,_0x116291,_0x3dfcfa,_0x43c4d8));});return BPromise[_0x1eea('0xb4')](_0x139b25);});});});})[_0x1eea('0x27')](function(_0x20ae51){_0xec8a0d['rows']=_0x20ae51;return _0xec8a0d;})[_0x1eea('0x27')](respondWithFilteredResult(_0x1acd8b,_0x26636b))[_0x1eea('0x39')](handleError(_0x1acd8b,null));};exports[_0x1eea('0xb5')]=function(_0x249b13,_0x418eef){var _0x36e7d1={'raw':![],'where':{'id':_0x249b13[_0x1eea('0xb6')]['id']}},_0x250299={};_0x250299[_0x1eea('0x3c')]=_[_0x1eea('0x3d')](db['MailInteraction']['rawAttributes']);_0x250299[_0x1eea('0x3e')]=_[_0x1eea('0x3d')](_0x249b13[_0x1eea('0x3e')]);_0x250299[_0x1eea('0x48')]=_[_0x1eea('0x3f')](_0x250299[_0x1eea('0x3c')],_0x250299['query']);_0x36e7d1['attributes']=_[_0x1eea('0x3f')](_0x250299[_0x1eea('0x3c')],qs[_0x1eea('0x40')](_0x249b13['query'][_0x1eea('0x40')]));_0x36e7d1[_0x1eea('0x41')]=_0x36e7d1['attributes'][_0x1eea('0x42')]?_0x36e7d1['attributes']:_0x250299[_0x1eea('0x3c')];if(_0x249b13[_0x1eea('0x3e')]['includeAll']){_0x36e7d1['include']=[{'all':!![]}];}_0x36e7d1=_['merge']({},_0x36e7d1,_0x249b13[_0x1eea('0xb7')]);return db['MailInteraction']['find'](_0x36e7d1)[_0x1eea('0x27')](handleEntityNotFound(_0x418eef,null))[_0x1eea('0x27')](respondWithResult(_0x418eef,null))[_0x1eea('0x39')](handleError(_0x418eef,null));};exports[_0x1eea('0xb8')]=function(_0x3684e6,_0x54c218){return db[_0x1eea('0x33')]['create'](_0x3684e6[_0x1eea('0xb9')],{})[_0x1eea('0x27')](respondWithResult(_0x54c218,0xc9))['catch'](handleError(_0x54c218,null));};exports[_0x1eea('0x26')]=function(_0x2bd634,_0x29f756){if(_0x2bd634[_0x1eea('0xb9')]['id']){delete _0x2bd634[_0x1eea('0xb9')]['id'];}return db[_0x1eea('0x33')][_0x1eea('0xba')]({'where':{'id':_0x2bd634[_0x1eea('0xb6')]['id']}})['then'](handleEntityNotFound(_0x29f756,null))[_0x1eea('0x27')](saveUpdates(_0x2bd634[_0x1eea('0xb9')],null))[_0x1eea('0x27')](respondWithResult(_0x29f756,null))[_0x1eea('0x39')](handleError(_0x29f756,null));};exports[_0x1eea('0xbb')]=function(_0xd84404,_0x223c29){return db['MailInteraction'][_0x1eea('0xba')]({'where':{'id':_0xd84404[_0x1eea('0xb6')]['id']}})[_0x1eea('0x27')](handleEntityNotFound(_0x223c29,null))[_0x1eea('0x27')](removeEntity(_0x223c29,null))[_0x1eea('0x39')](handleError(_0x223c29,null));};exports[_0x1eea('0xbc')]=function(_0x2ded41,_0x81a05e){return db[_0x1eea('0x33')]['describe']()['then'](respondWithResult(_0x81a05e,null))[_0x1eea('0x39')](handleError(_0x81a05e,null));};exports[_0x1eea('0xbd')]=function(_0x248452,_0x6477f3,_0x2395a0){return db[_0x1eea('0xbe')][_0x1eea('0xba')]({'where':{'id':_0x248452['params']['id']}})[_0x1eea('0x27')](handleEntityNotFound(_0x6477f3,null))[_0x1eea('0x27')](function(_0x29e190){if(_0x29e190){return _0x29e190[_0x1eea('0xbd')](_0x248452[_0x1eea('0xb9')][_0x1eea('0xbf')],_['omit'](_0x248452[_0x1eea('0xb9')],[_0x1eea('0xbf'),'id'])||{});}})[_0x1eea('0x27')](respondWithResult(_0x6477f3,null))[_0x1eea('0x39')](handleError(_0x6477f3,null));};exports[_0x1eea('0xc0')]=function(_0x1f8058,_0x46ac3f,_0x324177){var _0x14ff6e={'raw':![],'where':{}};var _0x975719={};var _0x35d603={'count':0x0,'rows':[]};return db[_0x1eea('0x33')][_0x1eea('0x34')]({'where':{'id':_0x1f8058['params']['id']}})[_0x1eea('0x27')](handleEntityNotFound(_0x46ac3f,null))[_0x1eea('0x27')](function(_0x2f987a){if(_0x2f987a){_0x975719[_0x1eea('0x3c')]=_[_0x1eea('0x3d')](db[_0x1eea('0xbe')][_0x1eea('0x3b')]);_0x975719[_0x1eea('0x3e')]=_[_0x1eea('0x3d')](_0x1f8058['query']);_0x975719[_0x1eea('0x48')]=_['intersection'](_0x975719[_0x1eea('0x3c')],_0x975719[_0x1eea('0x3e')]);_0x14ff6e[_0x1eea('0x41')]=_[_0x1eea('0x3f')](_0x975719[_0x1eea('0x3c')],qs[_0x1eea('0x40')](_0x1f8058[_0x1eea('0x3e')]['fields']));_0x14ff6e[_0x1eea('0x41')]=_0x14ff6e[_0x1eea('0x41')][_0x1eea('0x42')]?_0x14ff6e[_0x1eea('0x41')]:_0x975719['model'];if(!_0x1f8058[_0x1eea('0x3e')][_0x1eea('0x43')](_0x1eea('0x44'))){_0x14ff6e[_0x1eea('0x45')]=qs[_0x1eea('0x45')](_0x1f8058[_0x1eea('0x3e')][_0x1eea('0x45')]);_0x14ff6e[_0x1eea('0x21')]=qs[_0x1eea('0x21')](_0x1f8058[_0x1eea('0x3e')][_0x1eea('0x21')]);}_0x14ff6e['order']=qs[_0x1eea('0x46')](_0x1f8058[_0x1eea('0x3e')][_0x1eea('0x46')]);_0x14ff6e['where']=qs[_0x1eea('0x48')](_[_0x1eea('0x49')](_0x1f8058['query'],_0x975719[_0x1eea('0x48')]));_0x14ff6e['where'][_0x1eea('0xb1')]=_0x2f987a['id'];if(_0x1f8058[_0x1eea('0x3e')][_0x1eea('0x76')]){_0x14ff6e['where']=_[_0x1eea('0x99')](_0x14ff6e[_0x1eea('0x47')],{'$or':_[_0x1eea('0x2d')](_0x14ff6e[_0x1eea('0x41')],function(_0x4d019d){var _0x3a8fa6={};_0x3a8fa6[_0x4d019d]={'$like':'%'+_0x1f8058[_0x1eea('0x3e')]['filter']+'%'};return _0x3a8fa6;})});}if(_0x1f8058[_0x1eea('0x3e')]['$gte']){var _0x5b155f=_0x1f8058[_0x1eea('0x3e')][_0x1eea('0x7c')]['split'](',');var _0x1024b9={};_0x1024b9[_0x5b155f[0x0]]={'$gte':moment(_0x5b155f[0x1])[_0x1eea('0x64')](_0x1eea('0xc1'))};_0x14ff6e[_0x1eea('0x47')]=_['merge'](_0x14ff6e[_0x1eea('0x47')],_0x1024b9);}_0x14ff6e=_[_0x1eea('0x99')]({},_0x14ff6e,_0x1f8058['options']);return db[_0x1eea('0xbe')]['count']({'where':_0x14ff6e['where']})['then'](function(_0x15c70b){_0x35d603['count']=_0x15c70b;if(_0x1f8058[_0x1eea('0x3e')][_0x1eea('0xc2')]){_0x14ff6e[_0x1eea('0xc3')]=[{'all':!![]}];}return db[_0x1eea('0xbe')][_0x1eea('0xc4')](_0x14ff6e);})['then'](function(_0x861295){_0x35d603[_0x1eea('0xc5')]=_0x861295;return _0x35d603;});}})[_0x1eea('0x27')](respondWithFilteredResult(_0x46ac3f,_0x14ff6e))[_0x1eea('0x39')](handleError(_0x46ac3f,null));};exports['addTags']=function(_0x5e2731,_0x1e2267,_0x5d10eb){return db[_0x1eea('0x33')][_0x1eea('0xba')]({'where':{'id':_0x5e2731[_0x1eea('0xb6')]['id']}})['then'](handleEntityNotFound(_0x1e2267,null))['then'](function(_0x370772){if(_0x370772){return _0x370772[_0x1eea('0xc6')](_0x5e2731[_0x1eea('0xb9')][_0x1eea('0xbf')],_['omit'](_0x5e2731[_0x1eea('0xb9')],[_0x1eea('0xbf'),'id'])||{})[_0x1eea('0xc7')](function(){return db['Tag'][_0x1eea('0xc4')]({'attributes':['id',_0x1eea('0x2a'),_0x1eea('0x4c')],'where':{'id':_0x5e2731[_0x1eea('0xb9')][_0x1eea('0xbf')]}});})['then'](function(_0x1fc84f){socket[_0x1eea('0xc8')](_0x1eea('0xc9'),{'id':Number(_0x5e2731['params']['id']),'tags':_0x1fc84f||[]});return{'id':Number(_0x5e2731[_0x1eea('0xb6')]['id']),'tags':_0x1fc84f||[]};});}})[_0x1eea('0x27')](respondWithResult(_0x1e2267,null))[_0x1eea('0x39')](handleError(_0x1e2267,null));};exports[_0x1eea('0xca')]=function(_0x4c60cd,_0x10cecb,_0x4009e5){return db[_0x1eea('0x33')][_0x1eea('0xba')]({'where':{'id':_0x4c60cd[_0x1eea('0xb6')]['id']}})[_0x1eea('0x27')](handleEntityNotFound(_0x10cecb,null))[_0x1eea('0x27')](function(_0x2ff04a){if(_0x2ff04a){return _0x2ff04a[_0x1eea('0xca')](_0x4c60cd[_0x1eea('0x3e')][_0x1eea('0xbf')]);}})[_0x1eea('0x27')](respondWithStatusCode(_0x10cecb,null))[_0x1eea('0x39')](handleError(_0x10cecb,null));};exports['download']=function(_0x4e4762,_0x2773af){var _0x2f1327=moment()[_0x1eea('0xcb')]()['toString']();var _0x357281=path[_0x1eea('0x84')](config[_0x1eea('0xcc')],_0x1eea('0xcd'),_0x1eea('0xce'),_0x1eea('0xcf'));var _0x56b57e=path['join'](config[_0x1eea('0xcc')],_0x1eea('0xcd'),_0x1eea('0xce'),_0x1eea('0xd0'));var _0x204cf9=path['join'](_0x56b57e,_0x2f1327);var _0x1b9a4d=util[_0x1eea('0x64')](_0x1eea('0xd1'),_0x2f1327);var _0x54aafe=path[_0x1eea('0x84')](_0x56b57e,_0x1b9a4d);var _0x271fd6=![];return db[_0x1eea('0x33')][_0x1eea('0xba')]({'where':{'id':_0x4e4762['params']['id']}})[_0x1eea('0x27')](handleEntityNotFound(_0x2773af,null))['then'](function(_0x5f4d8a){if(_0x5f4d8a){return _0x5f4d8a['getMessages']({'attributes':['id',_0x1eea('0xb9'),_0x1eea('0x4e'),'to','cc',_0x1eea('0xd2'),_0x1eea('0xd3'),_0x1eea('0x60')],'where':{'secret':![]},'include':_0x4e4762[_0x1eea('0x3e')]['attachments']?[{'model':db['Attachment'],'as':'Attachments'}]:undefined,'order':qs[_0x1eea('0x46')]('id')});}return[];})[_0x1eea('0x27')](function(_0x50f80c){_0x271fd6=_0x50f80c[_0x1eea('0x42')];if(_0x50f80c['length']){fs[_0x1eea('0xd4')](_0x204cf9);return BPromise['each'](_0x50f80c,function(_0x58372c,_0x3d5b24){var _0xe46996=_0x58372c;var _0x36b6dc={'from':_0xe46996[_0x1eea('0x4e')],'to':_0xe46996['to'],'subject':_0xe46996[_0x1eea('0xd3')],'html':_0xe46996[_0x1eea('0xb9')],'headers':{'Date':moment(_0xe46996[_0x1eea('0x60')])['format'](_0x1eea('0xd5'))},'attachments':[]};if(_0x58372c['cc']){_0x36b6dc['headers']['Cc']=_0x58372c['cc'];}if(_0x58372c['bcc']){_0x36b6dc[_0x1eea('0xd6')][_0x1eea('0xd7')]=_0x58372c['bcc'];}return new BPromise(function(_0x36faa9,_0x4f8e1e){if(_0x58372c[_0x1eea('0xd8')]){for(var _0x1b68f3=0x0;_0x1b68f3<_0x58372c['Attachments'][_0x1eea('0x42')];_0x1b68f3++){var _0x1b7e87=_0x58372c[_0x1eea('0xd8')][_0x1b68f3];var _0x5e55dc=path[_0x1eea('0x84')](_0x357281,_0x1b7e87[_0x1eea('0xd9')]);if(fs['existsSync'](_0x5e55dc)){_0x36b6dc['attachments'][_0x1eea('0x32')]({'name':_0x1b7e87[_0x1eea('0x2a')],'contentType':_0x1b7e87[_0x1eea('0xda')],'data':fs[_0x1eea('0xdb')](_0x5e55dc)});}}}emlformat[_0x1eea('0xdc')](_0x36b6dc,function(_0x45729c,_0x31950d){if(_0x45729c)return _0x4f8e1e(_0x45729c);fs[_0x1eea('0xdd')](path[_0x1eea('0x84')](_0x204cf9,util[_0x1eea('0x64')](_0x1eea('0xde'),_0x3d5b24)),_0x31950d);return _0x36faa9(_0x31950d);});});});}})['then'](function(){if(_0x271fd6){return new BPromise(function(_0x2d759d,_0x12f5a9){zipdir(_0x204cf9,{'saveTo':_0x54aafe},function(_0xd69da3,_0x5b2707){if(_0xd69da3)return _0x12f5a9(_0xd69da3);return _0x2d759d(_0x5b2707);});});}})['then'](function(){if(_0x271fd6){return new BPromise(function(_0x1dcee8,_0x5659d8){rimraf(_0x204cf9,function(_0x4e81a8){if(_0x4e81a8)_0x5659d8(_0x4e81a8);return _0x1dcee8();});});}})[_0x1eea('0x27')](function(){if(_0x271fd6){return _0x2773af[_0x1eea('0xdf')](_0x54aafe,_0x1b9a4d,function(_0x2f598c){if(_0x2f598c){console[_0x1eea('0xe0')](_0x1eea('0xe1'),_0x2f598c);}else{fs[_0x1eea('0xe2')](_0x54aafe);}});}else{return _0x2773af[_0x1eea('0x1c')](0xc8);}})['catch'](handleError(_0x2773af,null));}; \ No newline at end of file +var _0x498d=['i.to','i.ContactId','i.MailAccountId','i.UserId','Contact.lastName','Contact.phone','Contact.mobile','c.fax','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','MailInteractionId','Setting','enableEmailPreview','catch','show','params','rawAttributes','includeAll','include','options','create','body','find','describe','addMessage','ids','omit','getMessages','MailMessage','split','findAll','rows','addTags','setTags','emit','mailInteractionTags:save','download','root','server','files','attachments','subject','Attachment','Attachments','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','basename','readFileSync','writeFileSync','message%d.eml','log','unlinkSync','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','html-to-text','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','save','destroy','error','stack','name','map','TagIds','Tags','forEach','push','MailInteraction','findOne','lastMsgBody','lastMsgText','then','trimStart','fromString','index','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','COUNT(*)','mail_messages','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','ui.MailInteractionId','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','me.MailInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false','advancedFilter','parse','createdAt','value','dateStart','startOf','day','utc','format','endOf','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','TagId','unreadMessages','\x20IN\x20?','tableAlias','\x20=\x20?','ContactId','c.firstName','\x20LIKE\x20?','c.lastName','c.email','\x20>\x20?','LIKE','\x20<\x20?','filter','isNil','isEmpty','i.MailAccountId\x20IN\x20?','concat','$gte','replace','isNumeric','isEmail','join','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','DESC','group','i.id','QueryTypes','clone','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','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','it.MailInteractionId\x20=\x20i.id','toString','sequelize','keyBy','merge','a.key','Account.key','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.substatus'];(function(_0x2db9fc,_0x12ed7f){var _0x2b5a00=function(_0x57f392){while(--_0x57f392){_0x2db9fc['push'](_0x2db9fc['shift']());}};_0x2b5a00(++_0x12ed7f);}(_0x498d,0x10f));var _0xd498=function(_0x513545,_0x158f2e){_0x513545=_0x513545-0x0;var _0x18b7c5=_0x498d[_0x513545];return _0x18b7c5;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd498('0x0'));var rimraf=require(_0xd498('0x1'));var zipdir=require(_0xd498('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd498('0x3'));var moment=require('moment');var BPromise=require(_0xd498('0x4'));var Mustache=require(_0xd498('0x5'));var util=require(_0xd498('0x6'));var path=require(_0xd498('0x7'));var sox=require(_0xd498('0x8'));var csv=require(_0xd498('0x9'));var ejs=require(_0xd498('0xa'));var fs=require('fs');var _=require(_0xd498('0xb'));var squel=require(_0xd498('0xc'));var crypto=require('crypto');var jsforce=require(_0xd498('0xd'));var deskjs=require(_0xd498('0xe'));var toCsv=require(_0xd498('0x9'));var querystring=require(_0xd498('0xf'));var Papa=require(_0xd498('0x10'));var htmlToText=require(_0xd498('0x11'));var Redis=require(_0xd498('0x12'));var authService=require(_0xd498('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd498('0x14'))(_0xd498('0x15'));var utils=require('../../config/utils');var config=require(_0xd498('0x16'));var db=require(_0xd498('0x17'))['db'];config[_0xd498('0x18')]=_['defaults'](config[_0xd498('0x18')],{'host':_0xd498('0x19'),'port':0x18eb});var socket=require(_0xd498('0x1a'))(new Redis(config[_0xd498('0x18')]));require(_0xd498('0x1b'))[_0xd498('0x1c')](socket);function respondWithStatusCode(_0x4e11af,_0x5a4757){_0x5a4757=_0x5a4757||0xcc;return function(_0x3f238a){if(_0x3f238a){return _0x4e11af[_0xd498('0x1d')](_0x5a4757);}return _0x4e11af['status'](_0x5a4757)[_0xd498('0x1e')]();};}function respondWithResult(_0x49f2d7,_0x5d686a){_0x5d686a=_0x5d686a||0xc8;return function(_0x5702db){if(_0x5702db){return _0x49f2d7[_0xd498('0x1f')](_0x5d686a)[_0xd498('0x20')](_0x5702db);}};}function respondWithFilteredResult(_0x5f0628,_0x36cb37){return function(_0xe2127e){if(_0xe2127e){var _0x3e8705=_0xe2127e[_0xd498('0x21')],_0x363bcb=_0x36cb37[_0xd498('0x22')],_0x396ace=_0x36cb37['offset']+_0x36cb37[_0xd498('0x23')],_0x19e626;if(_0x396ace>=_0x3e8705){_0x396ace=_0x3e8705;_0x19e626=0xc8;}else{_0x19e626=0xce;}_0x5f0628[_0xd498('0x1f')](_0x19e626);return _0x5f0628[_0xd498('0x24')](_0xd498('0x25'),_0x363bcb+'-'+_0x396ace+'/'+_0x3e8705)[_0xd498('0x20')](_0xe2127e);}return null;};}function patchUpdates(_0x2cd14c){return function(_0x34a40c){try{jsonpatch[_0xd498('0x26')](_0x34a40c,_0x2cd14c,!![]);}catch(_0x1d222b){return BPromise['reject'](_0x1d222b);}return _0x34a40c[_0xd498('0x27')]();};}function saveUpdates(_0x61d9ae,_0x5177fe){return function(_0x43270f){if(_0x43270f){return _0x43270f['update'](_0x61d9ae)['then'](function(_0x19a135){return _0x19a135;});}return null;};}function removeEntity(_0x235169,_0x10a347){return function(_0x17cce1){if(_0x17cce1){return _0x17cce1[_0xd498('0x28')]()['then'](function(){_0x235169[_0xd498('0x1f')](0xcc)[_0xd498('0x1e')]();});}};}function handleEntityNotFound(_0x15fdbc,_0x109008){return function(_0x52f792){if(!_0x52f792){_0x15fdbc[_0xd498('0x1d')](0x194);}return _0x52f792;};}function handleError(_0x40934f,_0x44082a){_0x44082a=_0x44082a||0x1f4;return function(_0x1c824b){logger[_0xd498('0x29')](_0x1c824b[_0xd498('0x2a')]);if(_0x1c824b[_0xd498('0x2b')]){delete _0x1c824b['name'];}_0x40934f['status'](_0x44082a)['send'](_0x1c824b);};}function getInteractionUsers(_0x15a03d,_0x3dde6f){return new BPromise(function(_0x48931a,_0xc27003){try{if(_0x3dde6f[_0x15a03d['id']]){_0x15a03d['Users']=_[_0xd498('0x2c')](_0x3dde6f[_0x15a03d['id']],function(_0xbe813c){return{'id':_0xbe813c['id']};});}}catch(_0x100968){_0xc27003(_0x100968);}_0x48931a(_0x15a03d);});}function getInteractionTags(_0x324b79,_0x320859){return new BPromise(function(_0x19bf36,_0x2f3f29){try{if(_0x324b79[_0xd498('0x2d')]){_0x324b79[_0xd498('0x2e')]=[];_0x324b79['TagIds']['split'](',')[_0xd498('0x2f')](function(_0x2c561c){_0x324b79[_0xd498('0x2e')][_0xd498('0x30')](_0x320859[_0x2c561c]);});}delete _0x324b79[_0xd498('0x2d')];}catch(_0x38c6a5){_0x2f3f29(_0x38c6a5);}_0x19bf36(_0x324b79);});}function getLastMessageText(_0x4f24be){return new BPromise(function(_0x5d21e4,_0xb19c67){return db[_0xd498('0x31')][_0xd498('0x32')]({'where':{'id':_0x4f24be['id']},'attributes':[_0xd498('0x33'),_0xd498('0x34')],'raw':!![]})[_0xd498('0x35')](function(_0x4e3653){if(!_0x4e3653[_0xd498('0x34')]){_0x4f24be['lastMsgText']=_[_0xd498('0x36')](htmlToText[_0xd498('0x37')](_0x4e3653[_0xd498('0x33')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x4f24be[_0xd498('0x34')]=_0x4e3653[_0xd498('0x34')];}_0x5d21e4(_0x4f24be);})['catch'](function(_0x3a8cdb){_0xb19c67(_0x3a8cdb);});});}function updateMailInteraction(_0x1eecb0,_0xa39605,_0x539375,_0x18ac55){return new BPromise(function(_0x486891,_0x4a8bc7){return getInteractionUsers(_0x1eecb0,_0x539375)['then'](function(_0x51752f){return getInteractionTags(_0x51752f,_0xa39605);})[_0xd498('0x35')](function(_0x42fae0){if(_0x18ac55){_0x486891(getLastMessageText(_0x42fae0));}else{_0x486891(_0x42fae0);}})['catch'](function(_0x48dc00){_0x4a8bc7(_0x48dc00);});});}exports[_0xd498('0x38')]=function(_0x5bf4b0,_0x5f3b5e){var _0x433a2f={},_0x363673={},_0x4aa184={'count':0x0,'rows':[]};var _0x5369d5=db['MailInteraction']['rawAttributes'];_0x363673[_0xd498('0x39')]=_[_0xd498('0x3a')](_0x5369d5);_0x363673[_0xd498('0x3b')]=_[_0xd498('0x3a')](_0x5bf4b0[_0xd498('0x3b')]);_0x363673[_0xd498('0x3c')]=_[_0xd498('0x3d')](_0x363673[_0xd498('0x39')],_0x363673[_0xd498('0x3b')]);_0x433a2f[_0xd498('0x3e')]=_[_0xd498('0x3d')](_0x363673[_0xd498('0x39')],qs[_0xd498('0x3f')](_0x5bf4b0[_0xd498('0x3b')][_0xd498('0x3f')]));_0x433a2f[_0xd498('0x3e')]=_0x433a2f['attributes'][_0xd498('0x40')]?_0x433a2f[_0xd498('0x3e')]:_0x363673[_0xd498('0x39')];if(!_0x5bf4b0[_0xd498('0x3b')][_0xd498('0x41')](_0xd498('0x42'))){_0x433a2f[_0xd498('0x23')]=qs[_0xd498('0x23')](_0x5bf4b0[_0xd498('0x3b')][_0xd498('0x23')]);_0x433a2f[_0xd498('0x22')]=qs[_0xd498('0x22')](_0x5bf4b0[_0xd498('0x3b')]['offset']);}_0x433a2f[_0xd498('0x43')]=qs[_0xd498('0x44')](_0x5bf4b0[_0xd498('0x3b')][_0xd498('0x44')]);_0x433a2f[_0xd498('0x45')]=qs[_0xd498('0x3c')](_[_0xd498('0x46')](_0x5bf4b0[_0xd498('0x3b')],_0x363673[_0xd498('0x3c')]));var _0x3a4a7b=[];var _0x4825d3=squel[_0xd498('0x47')]()[_0xd498('0x48')]('id')[_0xd498('0x48')]('name')['field'](_0xd498('0x49'))[_0xd498('0x4a')](_0xd498('0x4b'));var _0x507b4c=squel[_0xd498('0x47')]()[_0xd498('0x48')](_0xd498('0x4c'))['from'](_0xd498('0x4d'),'me')[_0xd498('0x45')]('me.MailInteractionId\x20=\x20i.id')[_0xd498('0x45')](_0xd498('0x4e'))['where'](_0xd498('0x4f'));var _0x13daf0=squel[_0xd498('0x47')]()[_0xd498('0x48')](_0xd498('0x50'))[_0xd498('0x48')](_0xd498('0x51'))['from']('user_has_mail_interactions','ui')[_0xd498('0x52')](_0xd498('0x53'),'u',_0xd498('0x54'));var _0x423cfd=squel['select']()[_0xd498('0x4a')]('mail_interactions','i')['left_join'](_0xd498('0x55'),'c',_0xd498('0x56'))[_0xd498('0x52')](_0xd498('0x53'),'o',_0xd498('0x57'))['left_join'](_0xd498('0x58'),'a','a.id\x20=\x20i.MailAccountId')[_0xd498('0x52')](_0xd498('0x4d'),'me',_0xd498('0x59'));var _0x3a9303=squel['expr']();if(_0x5bf4b0[_0xd498('0x3b')][_0xd498('0x5a')]){var _0x2889a5=JSON[_0xd498('0x5b')](_0x5bf4b0['query']['advancedFilter']);_[_0xd498('0x3a')](_0x2889a5)[_0xd498('0x2f')](function(_0x7fa56){var _0xb29e87=_0x2889a5[_0x7fa56];if(_0x7fa56===_0xd498('0x5c')){var _0x401aef=moment(_0xb29e87[_0xd498('0x5d')][_0xd498('0x5e')])[_0xd498('0x5f')](_0xd498('0x60'))[_0xd498('0x61')]()[_0xd498('0x62')]();var _0x4ba834=moment(_0x4ba834)[_0xd498('0x61')]()[_0xd498('0x63')]('day')[_0xd498('0x62')]();_0x3a9303[_0xd498('0x64')](_0xd498('0x65'),_0x401aef,_0x4ba834);}else{if(_[_0xd498('0x66')](_0xb29e87[_0xd498('0x67')])){_0xb29e87['condition']['forEach'](function(_0x4cb398){switch(_0xb29e87[_0xd498('0x67')][_0xd498('0x5d')]){case'IS':if(_0x7fa56!==_0xd498('0x68')&&_0x7fa56!==_0xd498('0x69')){if(_[_0xd498('0x66')](_0xb29e87[_0xd498('0x5d')])&&_0xb29e87[_0xd498('0x5d')][_0xd498('0x40')]>0x1){_0x3a9303[_0xd498('0x64')](_0xb29e87['tableAlias']+'.'+_0x7fa56+_0xd498('0x6a'),_0xb29e87[_0xd498('0x5d')]);}else{_0x3a9303[_0xd498('0x64')](_0xb29e87[_0xd498('0x6b')]+'.'+_0x7fa56+_0xd498('0x6c'),_0xb29e87['value'][0x0]);}}break;case'=':_0x3a9303[_0xd498('0x64')](_0xb29e87[_0xd498('0x6b')]+'.'+_0x7fa56+_0xd498('0x6c'),_0xb29e87[_0xd498('0x5d')]);break;case'LIKE':if(_0x7fa56===_0xd498('0x6d')){_0x3a9303[_0xd498('0x64')](_0xd498('0x6e')+_0xd498('0x6f'),'%'+_0xb29e87[_0xd498('0x5d')]+'%');_0x3a9303['or'](_0xd498('0x70')+_0xd498('0x6f'),'%'+_0xb29e87['value']+'%');_0x3a9303['or'](_0xd498('0x71')+_0xd498('0x6f'),'%'+_0xb29e87[_0xd498('0x5d')]+'%');}else{_0x3a9303[_0xd498('0x64')](_0xb29e87[_0xd498('0x6b')]+'.'+_0x7fa56+_0xd498('0x6f'),'%'+_0xb29e87[_0xd498('0x5d')]+'%');}break;case'>':_0x3a9303[_0xd498('0x64')](_0xb29e87['tableAlias']+'.'+_0x7fa56+_0xd498('0x72'),_0xb29e87[_0xd498('0x5d')]);break;case'<':_0x3a9303[_0xd498('0x64')](_0xb29e87[_0xd498('0x6b')]+'.'+_0x7fa56+'\x20<\x20?',_0xb29e87[_0xd498('0x5d')]);break;}});}else{switch(_0xb29e87[_0xd498('0x67')][_0xd498('0x5d')]){case'IS':if(_0x7fa56!==_0xd498('0x68')&&_0x7fa56!==_0xd498('0x69')){if(_[_0xd498('0x66')](_0xb29e87[_0xd498('0x5d')])&&_0xb29e87[_0xd498('0x5d')][_0xd498('0x40')]>0x1){_0x3a9303[_0xd498('0x64')](_0xb29e87[_0xd498('0x6b')]+'.'+_0x7fa56+_0xd498('0x6a'),_0xb29e87[_0xd498('0x5d')]);}else{_0x3a9303[_0xd498('0x64')](_0xb29e87[_0xd498('0x6b')]+'.'+_0x7fa56+_0xd498('0x6c'),_0xb29e87[_0xd498('0x5d')][0x0]);}}break;case'=':_0x3a9303[_0xd498('0x64')](_0xb29e87[_0xd498('0x6b')]+'.'+_0x7fa56+_0xd498('0x6c'),_0xb29e87[_0xd498('0x5d')]);break;case _0xd498('0x73'):if(_0x7fa56===_0xd498('0x6d')){_0x3a9303[_0xd498('0x64')](_0xd498('0x6e')+_0xd498('0x6f'),'%'+_0xb29e87['value']+'%');_0x3a9303['or'](_0xd498('0x70')+_0xd498('0x6f'),'%'+_0xb29e87[_0xd498('0x5d')]+'%');_0x3a9303['or'](_0xd498('0x71')+'\x20LIKE\x20?','%'+_0xb29e87[_0xd498('0x5d')]+'%');}else{_0x3a9303[_0xd498('0x64')](_0xb29e87[_0xd498('0x6b')]+'.'+_0x7fa56+_0xd498('0x6f'),'%'+_0xb29e87[_0xd498('0x5d')]+'%');}break;case'>':_0x3a9303[_0xd498('0x64')](_0xb29e87[_0xd498('0x6b')]+'.'+_0x7fa56+_0xd498('0x72'),_0xb29e87[_0xd498('0x5d')]);break;case'<':_0x3a9303[_0xd498('0x64')](_0xb29e87[_0xd498('0x6b')]+'.'+_0x7fa56+_0xd498('0x74'),_0xb29e87['value']);break;}}}});}else{var _0x3c6713=_(Object[_0xd498('0x3a')](_0x5bf4b0['query']))[_0xd498('0x2c')](function(_0x5142d5){return _0x5369d5[_0xd498('0x41')](_0x5142d5)?_0x5142d5:undefined;})[_0xd498('0x75')](function(_0x24c399){return!_[_0xd498('0x76')](_0x24c399);})[_0xd498('0x5d')]();if(!_[_0xd498('0x77')](_0x3c6713)){_0x3c6713[_0xd498('0x2f')](function(_0x129900){if(_0x129900==='MailAccountId'){_0x423cfd[_0xd498('0x45')](_0xd498('0x78'),[][_0xd498('0x79')](_0x5bf4b0['query'][_0x129900]));}else if(_0x129900===_0xd498('0x5c')){var _0x453a39=JSON[_0xd498('0x5b')](_0x5bf4b0[_0xd498('0x3b')][_0x129900])[_0xd498('0x7a')];var _0x4283a=JSON[_0xd498('0x5b')](_0x5bf4b0['query'][_0x129900])['$lte'];_0x423cfd['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x453a39,_0x4283a);}else{if(_0x5bf4b0[_0xd498('0x3b')][_0x129900]==='null'){_0x423cfd[_0xd498('0x45')]('i.'+_0x129900+'\x20IS\x20NULL');}else{_0x423cfd[_0xd498('0x45')]('i.'+_0x129900+_0xd498('0x6c'),_0x5bf4b0[_0xd498('0x3b')][_0x129900]);}}});}if(_0x5bf4b0[_0xd498('0x3b')]['filter']){var _0x527fdd=_0x5bf4b0[_0xd498('0x3b')][_0xd498('0x75')]['replace']('\x5c','\x5c\x5c')[_0xd498('0x7b')]('\x27\x27','\x27\x27\x27\x27');if(qs[_0xd498('0x7c')](_0x527fdd)){_0x3a9303['or']('i.id\x20LIKE\x20?',_0x527fdd+'%');}else if(qs[_0xd498('0x7d')](_0x527fdd)){_0x3a9303['or']('c.email\x20LIKE\x20?',_0x527fdd+'%');}else{var _0x1d0818=[];_0x527fdd['split']('\x20')[_0xd498('0x2f')](function(_0x535a11){_0x1d0818['push']('+'+_0x535a11['toString']());});var _0x3d3927=_0x1d0818[_0xd498('0x7e')]('\x20');_0x3a9303['or'](_0xd498('0x7f'),_0x3d3927)['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',_0x3d3927);}}}_0x423cfd[_0xd498('0x45')](_0x3a9303);if(_0x433a2f['order']){_0x433a2f[_0xd498('0x43')]['forEach'](function(_0x3ca189){_0x423cfd[_0xd498('0x43')]('i.'+_0x3ca189[0x0],_0x3ca189[0x1]===_0xd498('0x80')?![]:!![]);});}_0x423cfd[_0xd498('0x81')](_0xd498('0x82'));var _0x273d3a={'type':db['Sequelize'][_0xd498('0x83')]['SELECT'],'raw':!![]};var _0x4220f2=_0x423cfd[_0xd498('0x84')]()['field'](_0xd498('0x4c'))['field'](_0xd498('0x85'),_0xd498('0x69'));if(!_0x5bf4b0[_0xd498('0x3b')][_0xd498('0x5a')]){if(_0x5bf4b0[_0xd498('0x3b')]['read']){if(_0x5bf4b0['query'][_0xd498('0x86')]==0x1){_0x4220f2[_0xd498('0x87')](_0xd498('0x88'));_0x423cfd[_0xd498('0x87')](_0xd498('0x88'));}else{_0x4220f2[_0xd498('0x87')](_0xd498('0x89'));_0x423cfd[_0xd498('0x87')](_0xd498('0x89'));}}if(_0x5bf4b0[_0xd498('0x3b')]['tag']){var _0x33732b=_[_0xd498('0x66')](_0x5bf4b0[_0xd498('0x3b')][_0xd498('0x8a')])?_0x5bf4b0[_0xd498('0x3b')][_0xd498('0x8a')]:new Array(_0x5bf4b0[_0xd498('0x3b')]['tag']);var _0x12ddc6=squel[_0xd498('0x8b')]();_0x33732b[_0xd498('0x2f')](function(_0x506484){_0x12ddc6['or'](_0xd498('0x8c'),'%,'+_0x506484+',%');});_0x423cfd[_0xd498('0x87')](_0x12ddc6);_0x4220f2['left_join'](_0xd498('0x8d'),'it','it.MailInteractionId\x20=\x20i.id');_0x4220f2[_0xd498('0x52')](_0xd498('0x4b'),'t',_0xd498('0x8e'));_0x4220f2[_0xd498('0x45')](_0xd498('0x8f'),_0x33732b);}}else{var _0x2889a5=JSON[_0xd498('0x5b')](_0x5bf4b0[_0xd498('0x3b')][_0xd498('0x5a')]);_[_0xd498('0x3a')](_0x2889a5)[_0xd498('0x2f')](function(_0x1c0bca){var _0x2a38f7=_0x2889a5[_0x1c0bca];if(_0x1c0bca===_0xd498('0x68')){var _0x2ea31f=_0x2a38f7[_0xd498('0x5d')];var _0x443663=squel[_0xd498('0x8b')]();_0x2ea31f[_0xd498('0x2f')](function(_0x47dd9b){_0x443663['or'](_0xd498('0x8c'),'%,'+_0x47dd9b+',%');});_0x423cfd[_0xd498('0x87')](_0x443663);_0x4220f2[_0xd498('0x52')]('mail_interaction_has_tags','it',_0xd498('0x90'));_0x4220f2['left_join'](_0xd498('0x4b'),'t','t.id\x20=\x20it.TagId');_0x4220f2[_0xd498('0x45')]('t.id\x20IN\x20?',_0x2ea31f);}else if(_0x1c0bca===_0xd498('0x69')){if(_0x2a38f7['value'][_0xd498('0x40')]===0x1){if(_0x2a38f7[_0xd498('0x5d')][0x0]===0x1){_0x4220f2[_0xd498('0x87')](_0xd498('0x88'));_0x423cfd[_0xd498('0x87')](_0xd498('0x88'));}else{_0x4220f2['having'](_0xd498('0x89'));_0x423cfd[_0xd498('0x87')](_0xd498('0x89'));}}}});}db['sequelize'][_0xd498('0x3b')](_0x4220f2[_0xd498('0x91')](),_0x273d3a)[_0xd498('0x35')](function(_0x2d8988){_0x4aa184[_0xd498('0x21')]=_0x2d8988[_0xd498('0x40')];if(_0x4aa184[_0xd498('0x21')]===0x0)return[];return db[_0xd498('0x92')][_0xd498('0x3b')](_0x4825d3['toString'](),_0x273d3a)['then'](function(_0x204144){_0x3a4a7b=_[_0xd498('0x93')](_0x204144,'id');_0x273d3a=_[_0xd498('0x94')](_0x273d3a,{'model':db[_0xd498('0x31')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x423cfd[_0xd498('0x48')](_0xd498('0x85'),_0xd498('0x69'));_0x423cfd[_0xd498('0x48')](_0xd498('0x95'),_0xd498('0x96'));_0x423cfd[_0xd498('0x48')](_0xd498('0x82'));_0x423cfd['field'](_0xd498('0x97'));_0x423cfd['field'](_0xd498('0x98'));_0x423cfd[_0xd498('0x48')](_0xd498('0x99'));_0x423cfd[_0xd498('0x48')](_0xd498('0x9a'));_0x423cfd[_0xd498('0x48')](_0xd498('0x9b'));_0x423cfd[_0xd498('0x48')](_0xd498('0x9c'));_0x423cfd['field'](_0xd498('0x9d'));_0x423cfd[_0xd498('0x48')](_0xd498('0x9e'));_0x423cfd['field'](_0xd498('0x9f'));_0x423cfd[_0xd498('0x48')](_0xd498('0xa0'));_0x423cfd[_0xd498('0x48')](_0xd498('0xa1'));_0x423cfd[_0xd498('0x48')](_0xd498('0xa2'));_0x423cfd[_0xd498('0x48')](_0xd498('0xa3'));_0x423cfd[_0xd498('0x48')](_0xd498('0xa4'));_0x423cfd[_0xd498('0x48')](_0xd498('0x6e'),'Contact.firstName');_0x423cfd['field']('c.lastName',_0xd498('0xa5'));_0x423cfd[_0xd498('0x48')](_0xd498('0x71'),'Contact.email');_0x423cfd[_0xd498('0x48')]('c.phone',_0xd498('0xa6'));_0x423cfd[_0xd498('0x48')]('c.mobile',_0xd498('0xa7'));_0x423cfd[_0xd498('0x48')](_0xd498('0xa8'),'Contact.fax');_0x423cfd[_0xd498('0x48')](_0xd498('0xa9'),_0xd498('0x2d'));_0x423cfd[_0xd498('0x52')](_0xd498('0x8d'),'it',_0xd498('0x90'));_0x423cfd['left_join']('tools_tags','t',_0xd498('0x8e'));_0x423cfd[_0xd498('0x23')](_0x433a2f[_0xd498('0x23')]);_0x423cfd[_0xd498('0x22')](_0x433a2f['offset']);return db['sequelize'][_0xd498('0x3b')](_0x423cfd[_0xd498('0x91')](),_0x273d3a);})['then'](function(_0x12a7a7){_0x13daf0[_0xd498('0x45')]('ui.MailInteractionId\x20IN\x20?',_['map'](_0x12a7a7,'id'));return db['sequelize']['query'](_0x13daf0[_0xd498('0x91')](),_0x273d3a)['then'](function(_0x535c39){var _0x39afad=_[_0xd498('0xaa')](_0x535c39,_0xd498('0xab'));var _0x32f15b=[];return db[_0xd498('0xac')][_0xd498('0x32')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0xd498('0x35')](function(_0x29bd86){var _0x3cb46a=_0x29bd86[_0xd498('0xad')];_0x12a7a7[_0xd498('0x2f')](function(_0x1b7b07){_0x32f15b[_0xd498('0x30')](updateMailInteraction(_0x1b7b07,_0x3a4a7b,_0x39afad,_0x3cb46a));});return BPromise['all'](_0x32f15b);});});});})[_0xd498('0x35')](function(_0xbc9185){_0x4aa184['rows']=_0xbc9185;return _0x4aa184;})[_0xd498('0x35')](respondWithFilteredResult(_0x5f3b5e,_0x433a2f))[_0xd498('0xae')](handleError(_0x5f3b5e,null));};exports[_0xd498('0xaf')]=function(_0xe5a2ee,_0x55353d){var _0x21cb2a={'raw':![],'where':{'id':_0xe5a2ee[_0xd498('0xb0')]['id']}},_0x3e9bca={};_0x3e9bca[_0xd498('0x39')]=_[_0xd498('0x3a')](db[_0xd498('0x31')][_0xd498('0xb1')]);_0x3e9bca[_0xd498('0x3b')]=_[_0xd498('0x3a')](_0xe5a2ee[_0xd498('0x3b')]);_0x3e9bca[_0xd498('0x3c')]=_[_0xd498('0x3d')](_0x3e9bca['model'],_0x3e9bca[_0xd498('0x3b')]);_0x21cb2a['attributes']=_['intersection'](_0x3e9bca['model'],qs[_0xd498('0x3f')](_0xe5a2ee[_0xd498('0x3b')][_0xd498('0x3f')]));_0x21cb2a[_0xd498('0x3e')]=_0x21cb2a[_0xd498('0x3e')]['length']?_0x21cb2a[_0xd498('0x3e')]:_0x3e9bca['model'];if(_0xe5a2ee[_0xd498('0x3b')][_0xd498('0xb2')]){_0x21cb2a[_0xd498('0xb3')]=[{'all':!![]}];}_0x21cb2a=_[_0xd498('0x94')]({},_0x21cb2a,_0xe5a2ee[_0xd498('0xb4')]);return db['MailInteraction']['find'](_0x21cb2a)[_0xd498('0x35')](handleEntityNotFound(_0x55353d,null))[_0xd498('0x35')](respondWithResult(_0x55353d,null))[_0xd498('0xae')](handleError(_0x55353d,null));};exports[_0xd498('0xb5')]=function(_0x485ba0,_0x55e9f9){return db[_0xd498('0x31')][_0xd498('0xb5')](_0x485ba0[_0xd498('0xb6')],{})['then'](respondWithResult(_0x55e9f9,0xc9))[_0xd498('0xae')](handleError(_0x55e9f9,null));};exports['update']=function(_0x152aaf,_0x157e3b){if(_0x152aaf[_0xd498('0xb6')]['id']){delete _0x152aaf[_0xd498('0xb6')]['id'];}return db['MailInteraction'][_0xd498('0xb7')]({'where':{'id':_0x152aaf['params']['id']}})['then'](handleEntityNotFound(_0x157e3b,null))[_0xd498('0x35')](saveUpdates(_0x152aaf['body'],null))[_0xd498('0x35')](respondWithResult(_0x157e3b,null))['catch'](handleError(_0x157e3b,null));};exports[_0xd498('0x28')]=function(_0x48d997,_0x335329){return db[_0xd498('0x31')]['find']({'where':{'id':_0x48d997[_0xd498('0xb0')]['id']}})[_0xd498('0x35')](handleEntityNotFound(_0x335329,null))['then'](removeEntity(_0x335329,null))[_0xd498('0xae')](handleError(_0x335329,null));};exports[_0xd498('0xb8')]=function(_0x2da5f3,_0x26e626){return db[_0xd498('0x31')]['describe']()[_0xd498('0x35')](respondWithResult(_0x26e626,null))['catch'](handleError(_0x26e626,null));};exports[_0xd498('0xb9')]=function(_0x20fe61,_0x1c5618,_0x203134){return db['MailMessage'][_0xd498('0xb7')]({'where':{'id':_0x20fe61['params']['id']}})[_0xd498('0x35')](handleEntityNotFound(_0x1c5618,null))[_0xd498('0x35')](function(_0x500d4e){if(_0x500d4e){return _0x500d4e['addMessage'](_0x20fe61['body'][_0xd498('0xba')],_[_0xd498('0xbb')](_0x20fe61[_0xd498('0xb6')],[_0xd498('0xba'),'id'])||{});}})[_0xd498('0x35')](respondWithResult(_0x1c5618,null))[_0xd498('0xae')](handleError(_0x1c5618,null));};exports[_0xd498('0xbc')]=function(_0x3a2cfe,_0x15affe,_0x59c915){var _0x4a9363={'raw':![],'where':{}};var _0x2cb02c={};var _0xd04733={'count':0x0,'rows':[]};return db[_0xd498('0x31')][_0xd498('0x32')]({'where':{'id':_0x3a2cfe[_0xd498('0xb0')]['id']}})[_0xd498('0x35')](handleEntityNotFound(_0x15affe,null))[_0xd498('0x35')](function(_0x4e6f7f){if(_0x4e6f7f){_0x2cb02c[_0xd498('0x39')]=_[_0xd498('0x3a')](db[_0xd498('0xbd')]['rawAttributes']);_0x2cb02c[_0xd498('0x3b')]=_[_0xd498('0x3a')](_0x3a2cfe['query']);_0x2cb02c['filters']=_[_0xd498('0x3d')](_0x2cb02c[_0xd498('0x39')],_0x2cb02c[_0xd498('0x3b')]);_0x4a9363['attributes']=_[_0xd498('0x3d')](_0x2cb02c[_0xd498('0x39')],qs['fields'](_0x3a2cfe[_0xd498('0x3b')][_0xd498('0x3f')]));_0x4a9363[_0xd498('0x3e')]=_0x4a9363[_0xd498('0x3e')][_0xd498('0x40')]?_0x4a9363[_0xd498('0x3e')]:_0x2cb02c[_0xd498('0x39')];if(!_0x3a2cfe[_0xd498('0x3b')][_0xd498('0x41')]('nolimit')){_0x4a9363[_0xd498('0x23')]=qs[_0xd498('0x23')](_0x3a2cfe['query'][_0xd498('0x23')]);_0x4a9363['offset']=qs[_0xd498('0x22')](_0x3a2cfe[_0xd498('0x3b')][_0xd498('0x22')]);}_0x4a9363[_0xd498('0x43')]=qs[_0xd498('0x44')](_0x3a2cfe['query']['sort']);_0x4a9363[_0xd498('0x45')]=qs['filters'](_[_0xd498('0x46')](_0x3a2cfe[_0xd498('0x3b')],_0x2cb02c[_0xd498('0x3c')]));_0x4a9363['where']['MailInteractionId']=_0x4e6f7f['id'];if(_0x3a2cfe[_0xd498('0x3b')][_0xd498('0x75')]){_0x4a9363[_0xd498('0x45')]=_[_0xd498('0x94')](_0x4a9363[_0xd498('0x45')],{'$or':_['map'](_0x4a9363[_0xd498('0x3e')],function(_0x256bf8){var _0x49d676={};_0x49d676[_0x256bf8]={'$like':'%'+_0x3a2cfe['query'][_0xd498('0x75')]+'%'};return _0x49d676;})});}if(_0x3a2cfe[_0xd498('0x3b')][_0xd498('0x7a')]){var _0x3a6fe0=_0x3a2cfe['query'][_0xd498('0x7a')][_0xd498('0xbe')](',');var _0x5a1b94={};_0x5a1b94[_0x3a6fe0[0x0]]={'$gte':moment(_0x3a6fe0[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x4a9363[_0xd498('0x45')]=_[_0xd498('0x94')](_0x4a9363['where'],_0x5a1b94);}_0x4a9363=_[_0xd498('0x94')]({},_0x4a9363,_0x3a2cfe['options']);return db[_0xd498('0xbd')][_0xd498('0x21')]({'where':_0x4a9363['where']})['then'](function(_0x13fd4c){_0xd04733[_0xd498('0x21')]=_0x13fd4c;if(_0x3a2cfe['query'][_0xd498('0xb2')]){_0x4a9363[_0xd498('0xb3')]=[{'all':!![]}];}return db[_0xd498('0xbd')][_0xd498('0xbf')](_0x4a9363);})[_0xd498('0x35')](function(_0x330c4a){_0xd04733[_0xd498('0xc0')]=_0x330c4a;return _0xd04733;});}})[_0xd498('0x35')](respondWithFilteredResult(_0x15affe,_0x4a9363))[_0xd498('0xae')](handleError(_0x15affe,null));};exports[_0xd498('0xc1')]=function(_0x1479df,_0x48c439,_0x5c1531){return db[_0xd498('0x31')]['find']({'where':{'id':_0x1479df[_0xd498('0xb0')]['id']}})[_0xd498('0x35')](handleEntityNotFound(_0x48c439,null))[_0xd498('0x35')](function(_0x35661c){if(_0x35661c){return _0x35661c[_0xd498('0xc2')](_0x1479df[_0xd498('0xb6')]['ids'],_[_0xd498('0xbb')](_0x1479df[_0xd498('0xb6')],[_0xd498('0xba'),'id'])||{})['spread'](function(){return db['Tag'][_0xd498('0xbf')]({'attributes':['id',_0xd498('0x2b'),_0xd498('0x49')],'where':{'id':_0x1479df[_0xd498('0xb6')][_0xd498('0xba')]}});})[_0xd498('0x35')](function(_0x5f1618){socket[_0xd498('0xc3')](_0xd498('0xc4'),{'id':Number(_0x1479df[_0xd498('0xb0')]['id']),'tags':_0x5f1618||[]});return{'id':Number(_0x1479df[_0xd498('0xb0')]['id']),'tags':_0x5f1618||[]};});}})[_0xd498('0x35')](respondWithResult(_0x48c439,null))['catch'](handleError(_0x48c439,null));};exports['removeTags']=function(_0x4f1cff,_0x3c943c,_0x497f31){return db[_0xd498('0x31')][_0xd498('0xb7')]({'where':{'id':_0x4f1cff['params']['id']}})[_0xd498('0x35')](handleEntityNotFound(_0x3c943c,null))['then'](function(_0x88d6d2){if(_0x88d6d2){return _0x88d6d2['removeTags'](_0x4f1cff['query']['ids']);}})[_0xd498('0x35')](respondWithStatusCode(_0x3c943c,null))['catch'](handleError(_0x3c943c,null));};exports[_0xd498('0xc5')]=function(_0x3d21cf,_0x587f14){var _0x287cef=moment()['unix']()[_0xd498('0x91')]();var _0x32d3e8=path[_0xd498('0x7e')](config[_0xd498('0xc6')],_0xd498('0xc7'),_0xd498('0xc8'),_0xd498('0xc9'));var _0x1bac8a=path['join'](config['root'],_0xd498('0xc7'),_0xd498('0xc8'),'tmp');var _0x57383f=path['join'](_0x1bac8a,_0x287cef);var _0x41bb2a=util[_0xd498('0x62')]('interaction-%s.zip',_0x287cef);var _0x10c204=path['join'](_0x1bac8a,_0x41bb2a);var _0x4842bd=![];return db['MailInteraction'][_0xd498('0xb7')]({'where':{'id':_0x3d21cf[_0xd498('0xb0')]['id']}})['then'](handleEntityNotFound(_0x587f14,null))['then'](function(_0x527a95){if(_0x527a95){return _0x527a95['getMessages']({'attributes':['id','body',_0xd498('0x4a'),'to','cc','bcc',_0xd498('0xca'),'createdAt'],'where':{'secret':![]},'include':_0x3d21cf['query'][_0xd498('0xc9')]?[{'model':db[_0xd498('0xcb')],'as':_0xd498('0xcc')}]:undefined,'order':qs['sort']('id')});}return[];})[_0xd498('0x35')](function(_0x54ce6c){_0x4842bd=_0x54ce6c[_0xd498('0x40')];if(_0x54ce6c[_0xd498('0x40')]){fs[_0xd498('0xcd')](_0x57383f);return BPromise[_0xd498('0xce')](_0x54ce6c,function(_0x47e354,_0x335e8a){var _0x4a7924=_0x47e354;var _0x399f38={'from':_0x4a7924['from'],'to':_0x4a7924['to'],'subject':_0x4a7924[_0xd498('0xca')],'html':_0x4a7924[_0xd498('0xb6')],'headers':{'Date':moment(_0x4a7924[_0xd498('0x5c')])[_0xd498('0x62')](_0xd498('0xcf'))},'attachments':[]};if(_0x47e354['cc']){_0x399f38[_0xd498('0xd0')]['Cc']=_0x47e354['cc'];}if(_0x47e354[_0xd498('0xd1')]){_0x399f38['headers']['Bcc']=_0x47e354[_0xd498('0xd1')];}return new BPromise(function(_0x251f84,_0x4a9e7c){if(_0x47e354[_0xd498('0xcc')]){for(var _0x93dcba=0x0;_0x93dcba<_0x47e354[_0xd498('0xcc')][_0xd498('0x40')];_0x93dcba++){var _0x32872d=_0x47e354[_0xd498('0xcc')][_0x93dcba];var _0x8e9e01=path[_0xd498('0x7e')](_0x32d3e8,_0x32872d[_0xd498('0xd2')]);if(fs['existsSync'](_0x8e9e01)){_0x399f38['attachments'][_0xd498('0x30')]({'name':_0x32872d[_0xd498('0x2b')],'contentType':_0x32872d['type'],'data':fs[_0xd498('0xd3')](_0x8e9e01)});}}}emlformat['build'](_0x399f38,function(_0x255b02,_0x5d39c2){if(_0x255b02)return _0x4a9e7c(_0x255b02);fs[_0xd498('0xd4')](path[_0xd498('0x7e')](_0x57383f,util[_0xd498('0x62')](_0xd498('0xd5'),_0x335e8a)),_0x5d39c2);return _0x251f84(_0x5d39c2);});});});}})[_0xd498('0x35')](function(){if(_0x4842bd){return new BPromise(function(_0x257c6f,_0x59d56b){zipdir(_0x57383f,{'saveTo':_0x10c204},function(_0x3203b7,_0x320a71){if(_0x3203b7)return _0x59d56b(_0x3203b7);return _0x257c6f(_0x320a71);});});}})['then'](function(){if(_0x4842bd){return new BPromise(function(_0x2d7210,_0x22ac95){rimraf(_0x57383f,function(_0x24fc4a){if(_0x24fc4a)_0x22ac95(_0x24fc4a);return _0x2d7210();});});}})[_0xd498('0x35')](function(){if(_0x4842bd){return _0x587f14[_0xd498('0xc5')](_0x10c204,_0x41bb2a,function(_0xbc48f5){if(_0xbc48f5){console[_0xd498('0xd6')]('err',_0xbc48f5);}else{fs[_0xd498('0xd7')](_0x10c204);}});}else{return _0x587f14['sendStatus'](0xc8);}})[_0xd498('0xae')](handleError(_0x587f14,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 14cc132..917e5a2 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 _0xf54f=['emit','catch','hook','events','../../mysqldb','MailInteraction','MailMessage','save','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length'];(function(_0x2eb3b4,_0x3fd4d0){var _0x167fcd=function(_0x5eb39d){while(--_0x5eb39d){_0x2eb3b4['push'](_0x2eb3b4['shift']());}};_0x167fcd(++_0x3fd4d0);}(_0xf54f,0x135));var _0xff54=function(_0x73e94a,_0x513b03){_0x73e94a=_0x73e94a-0x0;var _0x13bfe1=_0xf54f[_0x73e94a];return _0x13bfe1;};'use strict';var EventEmitter=require(_0xff54('0x0'));var MailInteraction=require(_0xff54('0x1'))['db'][_0xff54('0x2')];var MailMessage=require(_0xff54('0x1'))['db'][_0xff54('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xff54('0x4'),'afterUpdate':'update','afterDestroy':_0xff54('0x5')};function emitEvent(_0x458232){return function(_0x377f95,_0x16bc67,_0x1a1441){_0x377f95[_0xff54('0x6')]({'attributes':['id'],'raw':!![]})[_0xff54('0x7')](function(_0x5b6e3e){_0x377f95[_0xff54('0x8')](_0xff54('0x9'),_0x5b6e3e[_0xff54('0xa')](function(_0x4a983e){return{'id':_0x4a983e['id']};}));return MailMessage[_0xff54('0xb')]({'where':{'MailInteractionId':_0x377f95['id'],'direction':'in','read':![]},'raw':!![]});})[_0xff54('0x7')](function(_0x33e092){_0x377f95[_0xff54('0x8')](_0xff54('0xc'),_0x33e092[_0xff54('0xd')]);MailInteractionEvents[_0xff54('0xe')](_0x458232+':'+_0x377f95['id'],_0x377f95);MailInteractionEvents[_0xff54('0xe')](_0x458232,_0x377f95);_0x1a1441(null);})[_0xff54('0xf')](_0x1a1441(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0xff54('0x10')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file +var _0x63ec=['then','Users','map','findAll','unreadMessages','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage','save','update'];(function(_0x1d7c0a,_0x207c5e){var _0x5e2753=function(_0x55b3fb){while(--_0x55b3fb){_0x1d7c0a['push'](_0x1d7c0a['shift']());}};_0x5e2753(++_0x207c5e);}(_0x63ec,0xe9));var _0xc63e=function(_0x2e3dd1,_0x29b549){_0x2e3dd1=_0x2e3dd1-0x0;var _0x39de59=_0x63ec[_0x2e3dd1];return _0x39de59;};'use strict';var EventEmitter=require(_0xc63e('0x0'));var MailInteraction=require(_0xc63e('0x1'))['db']['MailInteraction'];var MailMessage=require(_0xc63e('0x1'))['db'][_0xc63e('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc63e('0x3'),'afterUpdate':_0xc63e('0x4'),'afterDestroy':'remove'};function emitEvent(_0xca6a8d){return function(_0x10844e,_0x45ce52,_0x1ade60){_0x10844e['getUsers']({'attributes':['id'],'raw':!![]})[_0xc63e('0x5')](function(_0x1a0270){_0x10844e['setDataValue'](_0xc63e('0x6'),_0x1a0270[_0xc63e('0x7')](function(_0x1f65ee){return{'id':_0x1f65ee['id']};}));return MailMessage[_0xc63e('0x8')]({'where':{'MailInteractionId':_0x10844e['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc63e('0x5')](function(_0x40a94d){_0x10844e['setDataValue'](_0xc63e('0x9'),_0x40a94d['length']);MailInteractionEvents[_0xc63e('0xa')](_0xca6a8d+':'+_0x10844e['id'],_0x10844e);MailInteractionEvents[_0xc63e('0xa')](_0xca6a8d,_0x10844e);_0x1ade60(null);})['catch'](_0x1ade60(null));};}for(var e in events){if(events[_0xc63e('0xb')](e)){var event=events[e];MailInteraction[_0xc63e('0xc')](e,emitEvent(event));}}module[_0xc63e('0xd')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 6fc1aca..470ffc1 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 _0xf457=['closedAt','format','changed','substatusAt','closed','models','get','then','catch','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','fti_mail_interactions','FULLTEXT','substatus','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x249315,_0x16a14d){var _0x27a2f2=function(_0x338a5f){while(--_0x338a5f){_0x249315['push'](_0x249315['shift']());}};_0x27a2f2(++_0x16a14d);}(_0xf457,0x1ea));var _0x7f45=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf457[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x7f45('0x0'));var util=require(_0x7f45('0x1'));var logger=require(_0x7f45('0x2'))(_0x7f45('0x3'));var moment=require(_0x7f45('0x4'));var BPromise=require('bluebird');var rp=require(_0x7f45('0x5'));var fs=require('fs');var path=require(_0x7f45('0x6'));var rimraf=require(_0x7f45('0x7'));var config=require(_0x7f45('0x8'));var attributes=require('./mailInteraction.attributes');module[_0x7f45('0x9')]=function(_0x32cc34,_0x2655dd){return _0x32cc34['define']('MailInteraction',attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0x7f45('0xa'),'fields':['subject','to'],'type':_0x7f45('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5e7686,_0x13b728,_0x3c452d){if(_0x5e7686[_0x7f45('0xc')]){_0x5e7686['substatusAt']=moment()['format'](_0x7f45('0xd'));}if(_0x5e7686['closed']){_0x5e7686[_0x7f45('0xe')]=moment()[_0x7f45('0xf')](_0x7f45('0xd'));}_0x3c452d(null,_0x13b728);},'beforeUpdate':function(_0xe0df59,_0x567d5b,_0x5822da){if(_0xe0df59[_0x7f45('0x10')]('substatus')){_0xe0df59[_0x7f45('0x11')]=moment()[_0x7f45('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0xe0df59[_0x7f45('0x10')](_0x7f45('0x12'))){_0xe0df59['closedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x5822da(null,_0xe0df59);},'afterUpdate':function(_0x135829,_0x308746,_0x1063e7){var _0x2e3a1b=_0x32cc34[_0x7f45('0x13')];var _0x3fa96e=_0x135829[_0x7f45('0x14')]({'plain':!![]});if(_0x3fa96e['closed']){return _0x2e3a1b['MailMessage']['update']({'read':!![]},{'where':{'MailInteractionId':_0x3fa96e['id']}})[_0x7f45('0x15')](function(){_0x1063e7();})[_0x7f45('0x16')](function(_0x1dd01b){_0x1063e7(_0x1dd01b);});}else{_0x1063e7();}}},'charset':'utf8mb4','collate':_0x7f45('0x17')});}; \ No newline at end of file +var _0x1fe6=['models','get','MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./mailInteraction.attributes','define','MailInteraction','mail_interactions','fti_mail_interactions','substatus','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','substatusAt'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x1fe6,0xe8));var _0x61fe=function(_0xf1b93c,_0x1416ec){_0xf1b93c=_0xf1b93c-0x0;var _0x1bc760=_0x1fe6[_0xf1b93c];return _0x1bc760;};'use strict';var _=require(_0x61fe('0x0'));var util=require(_0x61fe('0x1'));var logger=require(_0x61fe('0x2'))('api');var moment=require(_0x61fe('0x3'));var BPromise=require(_0x61fe('0x4'));var rp=require(_0x61fe('0x5'));var fs=require('fs');var path=require(_0x61fe('0x6'));var rimraf=require(_0x61fe('0x7'));var config=require('../../config/environment');var attributes=require(_0x61fe('0x8'));module['exports']=function(_0x15eca6,_0x2a657b){return _0x15eca6[_0x61fe('0x9')](_0x61fe('0xa'),attributes,{'tableName':_0x61fe('0xb'),'paranoid':![],'indexes':[{'name':_0x61fe('0xc'),'fields':['subject','to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4d8347,_0x38bea4,_0x26e05b){if(_0x4d8347[_0x61fe('0xd')]){_0x4d8347['substatusAt']=moment()[_0x61fe('0xe')](_0x61fe('0xf'));}if(_0x4d8347[_0x61fe('0x10')]){_0x4d8347[_0x61fe('0x11')]=moment()[_0x61fe('0xe')](_0x61fe('0xf'));}_0x26e05b(null,_0x38bea4);},'beforeUpdate':function(_0x57cd01,_0x1f5608,_0x36c89d){if(_0x57cd01[_0x61fe('0x12')](_0x61fe('0xd'))){_0x57cd01[_0x61fe('0x13')]=moment()[_0x61fe('0xe')](_0x61fe('0xf'));}if(_0x57cd01['changed']('closed')){_0x57cd01[_0x61fe('0x11')]=moment()[_0x61fe('0xe')](_0x61fe('0xf'));}_0x36c89d(null,_0x57cd01);},'afterUpdate':function(_0x202133,_0x57b5a6,_0x50c3fa){var _0x2fbb69=_0x15eca6[_0x61fe('0x14')];var _0x289edc=_0x202133[_0x61fe('0x15')]({'plain':!![]});if(_0x289edc['closed']){return _0x2fbb69[_0x61fe('0x16')][_0x61fe('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x289edc['id']}})[_0x61fe('0x18')](function(){_0x50c3fa();})[_0x61fe('0x19')](function(_0x405965){_0x50c3fa(_0x405965);});}else{_0x50c3fa();}}},'charset':_0x61fe('0x1a'),'collate':_0x61fe('0x1b')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 5cf9135..1ddcd5b 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 _0x444e=['register','request','info','request\x20sent','debug','error','code','MailInteraction,\x20%s,\x20%s','message','result','catch','MailInteraction','body','options','raw','where','attributes','limit','then','UpdateMailInteraction','stringify','AddTagsToMailInteraction','find','addTags','ids','omit','AddTags','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','redis','./mailInteraction.socket'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x444e,0xe8));var _0xe444=function(_0xa8e657,_0x1487e7){_0xa8e657=_0xa8e657-0x0;var _0x102b07=_0x444e[_0xa8e657];return _0x102b07;};'use strict';var _=require(_0xe444('0x0'));var util=require('util');var moment=require(_0xe444('0x1'));var BPromise=require('bluebird');var rs=require(_0xe444('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe444('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xe444('0x4'))(_0xe444('0x5'));var config=require(_0xe444('0x6'));var jayson=require(_0xe444('0x7'));var client=jayson[_0xe444('0x8')][_0xe444('0x9')]({'port':0x232a});config['redis']=_[_0xe444('0xa')](config['redis'],{'host':_0xe444('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe444('0xc')]));require(_0xe444('0xd'))[_0xe444('0xe')](socket);function respondWithRpcPromise(_0x48907b,_0x55697b,_0x36c8a5){return new BPromise(function(_0x1f41ff,_0x5e53cb){return client[_0xe444('0xf')](_0x48907b,_0x36c8a5)['then'](function(_0x5f0f7f){logger[_0xe444('0x10')]('MailInteraction,\x20%s,\x20%s',_0x55697b,_0xe444('0x11'));logger[_0xe444('0x12')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x55697b,_0xe444('0x11'),JSON['stringify'](_0x5f0f7f));if(_0x5f0f7f['error']){if(_0x5f0f7f[_0xe444('0x13')][_0xe444('0x14')]===0x1f4){logger['error'](_0xe444('0x15'),_0x55697b,_0x5f0f7f['error'][_0xe444('0x16')]);return _0x5e53cb(_0x5f0f7f[_0xe444('0x13')][_0xe444('0x16')]);}logger[_0xe444('0x13')](_0xe444('0x15'),_0x55697b,_0x5f0f7f[_0xe444('0x13')][_0xe444('0x16')]);return _0x1f41ff(_0x5f0f7f[_0xe444('0x13')][_0xe444('0x16')]);}else{logger[_0xe444('0x10')](_0xe444('0x15'),_0x55697b,_0xe444('0x11'));_0x1f41ff(_0x5f0f7f[_0xe444('0x17')]['message']);}})[_0xe444('0x18')](function(_0x1f904f){logger[_0xe444('0x13')](_0xe444('0x15'),_0x55697b,_0x1f904f);_0x5e53cb(_0x1f904f);});});}exports['UpdateMailInteraction']=function(_0x306e05){var _0x285dbc=this;return new Promise(function(_0x2e95bc,_0xf213c0){return db[_0xe444('0x19')]['update'](_0x306e05[_0xe444('0x1a')],{'raw':_0x306e05[_0xe444('0x1b')]?_0x306e05['options'][_0xe444('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x306e05['options']?_0x306e05[_0xe444('0x1b')][_0xe444('0x1d')]||null:null,'attributes':_0x306e05[_0xe444('0x1b')]?_0x306e05[_0xe444('0x1b')][_0xe444('0x1e')]||null:null,'limit':_0x306e05['options']?_0x306e05['options'][_0xe444('0x1f')]||null:null})[_0xe444('0x20')](function(_0x1ac266){logger[_0xe444('0x10')](_0xe444('0x21'),_0x306e05);logger['debug'](_0xe444('0x21'),_0x306e05,JSON[_0xe444('0x22')](_0x1ac266));_0x2e95bc(_0x1ac266);})['catch'](function(_0x32055b){logger[_0xe444('0x13')](_0xe444('0x21'),_0x32055b[_0xe444('0x16')],_0x306e05);_0xf213c0(_0x285dbc[_0xe444('0x13')](0x1f4,_0x32055b[_0xe444('0x16')]));});});};exports[_0xe444('0x23')]=function(_0x5d29ba){return new Promise(function(_0x3015c7,_0xe8814b){return db[_0xe444('0x19')][_0xe444('0x24')]({'where':_0x5d29ba['options']?_0x5d29ba['options'][_0xe444('0x1d')]||null:null})[_0xe444('0x20')](function(_0x33de83){if(_0x33de83){return _0x33de83[_0xe444('0x25')](_0x5d29ba['body'][_0xe444('0x26')],_[_0xe444('0x27')](_0x5d29ba[_0xe444('0x1a')],[_0xe444('0x26'),'id'])||{});}})['spread'](function(_0x5a1269){logger['info'](_0xe444('0x28'),_0x5d29ba);logger[_0xe444('0x12')](_0xe444('0x28'),_0x5d29ba,JSON[_0xe444('0x22')](_0x5a1269));_0x3015c7(_0x5a1269);})[_0xe444('0x18')](function(_0x5ade84){logger[_0xe444('0x13')](_0xe444('0x28'),_0x5ade84[_0xe444('0x16')],_0x5d29ba);_0xe8814b(_this['error'](0x1f4,_0x5ade84[_0xe444('0x16')]));});});}; \ No newline at end of file +var _0x6b8f=['util','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','register','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','UpdateMailInteraction','MailInteraction','update','options','raw','where','attributes','limit','then','catch','find','addTags','ids','omit','body','spread','AddTags'];(function(_0x50eaec,_0x1a3c41){var _0x1f500e=function(_0x2e825d){while(--_0x2e825d){_0x50eaec['push'](_0x50eaec['shift']());}};_0x1f500e(++_0x1a3c41);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x2b5d12,_0x17239e){_0x2b5d12=_0x2b5d12-0x0;var _0x12cbee=_0x6b8f[_0x2b5d12];return _0x12cbee;};'use strict';var _=require('lodash');var util=require(_0xf6b8('0x0'));var moment=require('moment');var BPromise=require(_0xf6b8('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf6b8('0x2'))['db'];var utils=require(_0xf6b8('0x3'));var logger=require('../../config/logger')(_0xf6b8('0x4'));var config=require(_0xf6b8('0x5'));var jayson=require(_0xf6b8('0x6'));var client=jayson['client'][_0xf6b8('0x7')]({'port':0x232a});config[_0xf6b8('0x8')]=_[_0xf6b8('0x9')](config[_0xf6b8('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf6b8('0x8')]));require('./mailInteraction.socket')[_0xf6b8('0xa')](socket);function respondWithRpcPromise(_0x7ac5fd,_0x16a799,_0x3e6712){return new BPromise(function(_0x21734d,_0x162938){return client['request'](_0x7ac5fd,_0x3e6712)['then'](function(_0x5ae09d){logger[_0xf6b8('0xb')](_0xf6b8('0xc'),_0x16a799,_0xf6b8('0xd'));logger[_0xf6b8('0xe')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x16a799,'request\x20sent',JSON[_0xf6b8('0xf')](_0x5ae09d));if(_0x5ae09d[_0xf6b8('0x10')]){if(_0x5ae09d['error'][_0xf6b8('0x11')]===0x1f4){logger[_0xf6b8('0x10')](_0xf6b8('0xc'),_0x16a799,_0x5ae09d['error'][_0xf6b8('0x12')]);return _0x162938(_0x5ae09d['error'][_0xf6b8('0x12')]);}logger[_0xf6b8('0x10')](_0xf6b8('0xc'),_0x16a799,_0x5ae09d[_0xf6b8('0x10')][_0xf6b8('0x12')]);return _0x21734d(_0x5ae09d['error']['message']);}else{logger[_0xf6b8('0xb')]('MailInteraction,\x20%s,\x20%s',_0x16a799,_0xf6b8('0xd'));_0x21734d(_0x5ae09d[_0xf6b8('0x13')]['message']);}})['catch'](function(_0x1d0ee9){logger[_0xf6b8('0x10')](_0xf6b8('0xc'),_0x16a799,_0x1d0ee9);_0x162938(_0x1d0ee9);});});}exports[_0xf6b8('0x14')]=function(_0x4df5f4){var _0x59f9df=this;return new Promise(function(_0x5a9553,_0x3298a4){return db[_0xf6b8('0x15')][_0xf6b8('0x16')](_0x4df5f4['body'],{'raw':_0x4df5f4[_0xf6b8('0x17')]?_0x4df5f4[_0xf6b8('0x17')][_0xf6b8('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4df5f4[_0xf6b8('0x17')]?_0x4df5f4['options'][_0xf6b8('0x19')]||null:null,'attributes':_0x4df5f4['options']?_0x4df5f4[_0xf6b8('0x17')][_0xf6b8('0x1a')]||null:null,'limit':_0x4df5f4[_0xf6b8('0x17')]?_0x4df5f4[_0xf6b8('0x17')][_0xf6b8('0x1b')]||null:null})[_0xf6b8('0x1c')](function(_0x4edd29){logger[_0xf6b8('0xb')](_0xf6b8('0x14'),_0x4df5f4);logger['debug'](_0xf6b8('0x14'),_0x4df5f4,JSON[_0xf6b8('0xf')](_0x4edd29));_0x5a9553(_0x4edd29);})[_0xf6b8('0x1d')](function(_0xd5ebb5){logger[_0xf6b8('0x10')]('UpdateMailInteraction',_0xd5ebb5['message'],_0x4df5f4);_0x3298a4(_0x59f9df[_0xf6b8('0x10')](0x1f4,_0xd5ebb5[_0xf6b8('0x12')]));});});};exports['AddTagsToMailInteraction']=function(_0x459ed0){return new Promise(function(_0x27e46d,_0x888319){return db['MailInteraction'][_0xf6b8('0x1e')]({'where':_0x459ed0[_0xf6b8('0x17')]?_0x459ed0['options'][_0xf6b8('0x19')]||null:null})[_0xf6b8('0x1c')](function(_0x324eeb){if(_0x324eeb){return _0x324eeb[_0xf6b8('0x1f')](_0x459ed0['body'][_0xf6b8('0x20')],_[_0xf6b8('0x21')](_0x459ed0[_0xf6b8('0x22')],['ids','id'])||{});}})[_0xf6b8('0x23')](function(_0x981e47){logger[_0xf6b8('0xb')]('AddTags',_0x459ed0);logger[_0xf6b8('0xe')](_0xf6b8('0x24'),_0x459ed0,JSON[_0xf6b8('0xf')](_0x981e47));_0x27e46d(_0x981e47);})[_0xf6b8('0x1d')](function(_0x4be3cb){logger[_0xf6b8('0x10')](_0xf6b8('0x24'),_0x4be3cb[_0xf6b8('0x12')],_0x459ed0);_0x888319(_this['error'](0x1f4,_0x4be3cb['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 8824503..8881d6a 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 _0xb4e4=['update','emit','register','length','mailInteraction:','./mailInteraction.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb4e4,0x89));var _0x4b4e=function(_0x149153,_0x2780fe){_0x149153=_0x149153-0x0;var _0x1c3f8b=_0xb4e4[_0x149153];return _0x1c3f8b;};'use strict';var MailInteractionEvents=require(_0x4b4e('0x0'));var events=['save','remove',_0x4b4e('0x1')];function createListener(_0x171670,_0x5f1d8e){return function(_0x10345d){_0x5f1d8e[_0x4b4e('0x2')](_0x171670,_0x10345d);};}function removeListener(_0x253698,_0x98d4d3){return function(){MailInteractionEvents['removeListener'](_0x253698,_0x98d4d3);};}exports[_0x4b4e('0x3')]=function(_0x390788){for(var _0x31893a=0x0,_0x14cbb1=events[_0x4b4e('0x4')];_0x31893a<_0x14cbb1;_0x31893a++){var _0x2fcc92=events[_0x31893a];var _0x2b082d=createListener(_0x4b4e('0x5')+_0x2fcc92,_0x390788);MailInteractionEvents['on'](_0x2fcc92,_0x2b082d);}}; \ No newline at end of file +var _0xed02=['remove','update','removeListener','register','length','mailInteraction:','save'];(function(_0x2d59e3,_0x29a667){var _0x24cfd3=function(_0x5615f3){while(--_0x5615f3){_0x2d59e3['push'](_0x2d59e3['shift']());}};_0x24cfd3(++_0x29a667);}(_0xed02,0xe6));var _0x2ed0=function(_0x4100c0,_0x5289f2){_0x4100c0=_0x4100c0-0x0;var _0x4df2bc=_0xed02[_0x4100c0];return _0x4df2bc;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x2ed0('0x0'),_0x2ed0('0x1'),_0x2ed0('0x2')];function createListener(_0x1edf55,_0x5138e3){return function(_0x14c43d){_0x5138e3['emit'](_0x1edf55,_0x14c43d);};}function removeListener(_0xd36b07,_0x25dfa4){return function(){MailInteractionEvents[_0x2ed0('0x3')](_0xd36b07,_0x25dfa4);};}exports[_0x2ed0('0x4')]=function(_0x763564){for(var _0x5ff895=0x0,_0x2610b8=events[_0x2ed0('0x5')];_0x5ff895<_0x2610b8;_0x5ff895++){var _0x5e7c43=events[_0x5ff895];var _0x4b4a23=createListener(_0x2ed0('0x6')+_0x5e7c43,_0x763564);MailInteractionEvents['on'](_0x5e7c43,_0x4b4a23);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index f2ad911..b0faa94 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 _0xe14b=['create','put','/:id','update','/:id/accept','accept','/:id/reject','destroy','exports','multer','util','express','Router','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','show','/:id/download','tracked','mailmessage:create'];(function(_0x2cd589,_0x340306){var _0x1265be=function(_0x1ede4a){while(--_0x1ede4a){_0x2cd589['push'](_0x2cd589['shift']());}};_0x1265be(++_0x340306);}(_0xe14b,0x93));var _0xbe14=function(_0x4c36a8,_0x1fb420){_0x4c36a8=_0x4c36a8-0x0;var _0x3c0859=_0xe14b[_0x4c36a8];return _0x3c0859;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xbe14('0x4'));var config=require('../../config/environment');var controller=require('./mailMessage.controller');router[_0xbe14('0x5')]('/',auth[_0xbe14('0x6')](),controller[_0xbe14('0x7')]);router[_0xbe14('0x5')](_0xbe14('0x8'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xbe14('0xa')]);router[_0xbe14('0x5')](_0xbe14('0xb'),auth[_0xbe14('0x6')](),controller['download']);router['post']('/',auth[_0xbe14('0x6')](),interaction[_0xbe14('0xc')]('mail',_0xbe14('0xd')),controller[_0xbe14('0xe')]);router[_0xbe14('0xf')](_0xbe14('0x10'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x11')]);router[_0xbe14('0xf')](_0xbe14('0x12'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x13')]);router[_0xbe14('0xf')](_0xbe14('0x14'),auth[_0xbe14('0x6')](),controller['reject']);router['delete'](_0xbe14('0x10'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x15')]);module[_0xbe14('0x16')]=router; \ No newline at end of file +var _0xdbf5=['/:id','show','/:id/download','post','mail','put','update','/:id/accept','/:id/reject','delete','destroy','exports','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x1c2c24,_0x5b8135){_0x1c2c24=_0x1c2c24-0x0;var _0x1e112a=_0xdbf5[_0x1c2c24];return _0x1e112a;};'use strict';var multer=require('multer');var util=require(_0x5dbf('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5dbf('0x1'));var router=express[_0x5dbf('0x2')]();var auth=require(_0x5dbf('0x3'));var interaction=require(_0x5dbf('0x4'));var config=require(_0x5dbf('0x5'));var controller=require(_0x5dbf('0x6'));router[_0x5dbf('0x7')]('/',auth[_0x5dbf('0x8')](),controller[_0x5dbf('0x9')]);router[_0x5dbf('0x7')](_0x5dbf('0xa'),auth[_0x5dbf('0x8')](),controller[_0x5dbf('0xb')]);router['get'](_0x5dbf('0xc'),auth['isAuthenticated'](),controller[_0x5dbf('0xd')]);router[_0x5dbf('0x7')](_0x5dbf('0xe'),auth[_0x5dbf('0x8')](),controller['download']);router[_0x5dbf('0xf')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x5dbf('0x10'),'mailmessage:create'),controller['create']);router[_0x5dbf('0x11')]('/:id',auth[_0x5dbf('0x8')](),controller[_0x5dbf('0x12')]);router[_0x5dbf('0x11')](_0x5dbf('0x13'),auth[_0x5dbf('0x8')](),controller['accept']);router['put'](_0x5dbf('0x14'),auth[_0x5dbf('0x8')](),controller['reject']);router[_0x5dbf('0x15')](_0x5dbf('0xc'),auth[_0x5dbf('0x8')](),controller[_0x5dbf('0x16')]);module[_0x5dbf('0x17')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index bded0ef..8ae06f3 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 _0x2bc9=['long','DATE','INTEGER','lodash','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x2bc9,0x1a7));var _0x92bc=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x2bc9[_0x24237f];return _0x48298e;};'use strict';var Sequelize=require('sequelize');var _=require(_0x92bc('0x0'));module['exports']={'body':{'type':Sequelize[_0x92bc('0x1')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x92bc('0x1')](_0x92bc('0x2'))},'read':{'type':Sequelize[_0x92bc('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x92bc('0x4')]('in',_0x92bc('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x92bc('0x6')](0x1fe)},'from':{'type':Sequelize[_0x92bc('0x6')]},'to':{'type':Sequelize[_0x92bc('0x1')](_0x92bc('0x7'))},'cc':{'type':Sequelize['TEXT'](_0x92bc('0x7'))},'bcc':{'type':Sequelize[_0x92bc('0x1')](_0x92bc('0x7'))},'subject':{'type':Sequelize[_0x92bc('0x1')]},'sentAt':{'type':Sequelize[_0x92bc('0x8')]},'attach':{'type':Sequelize[_0x92bc('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x92bc('0x3')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x92bc('0x1')](_0x92bc('0x7'))},'originCc':{'type':Sequelize['TEXT'](_0x92bc('0x7'))}}; \ No newline at end of file +var _0x7c35=['exports','TEXT','long','medium','BOOLEAN','out','STRING','DATE','INTEGER','lodash'];(function(_0x505a7d,_0x25e11f){var _0x17d880=function(_0x213c2){while(--_0x213c2){_0x505a7d['push'](_0x505a7d['shift']());}};_0x17d880(++_0x25e11f);}(_0x7c35,0x135));var _0x57c3=function(_0x3612fd,_0x499802){_0x3612fd=_0x3612fd-0x0;var _0x2fb8fc=_0x7c35[_0x3612fd];return _0x2fb8fc;};'use strict';var Sequelize=require('sequelize');var _=require(_0x57c3('0x0'));module[_0x57c3('0x1')]={'body':{'type':Sequelize[_0x57c3('0x2')](_0x57c3('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x57c3('0x2')](_0x57c3('0x4'))},'read':{'type':Sequelize[_0x57c3('0x5')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x57c3('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x57c3('0x7')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['TEXT'](_0x57c3('0x3'))},'cc':{'type':Sequelize[_0x57c3('0x2')](_0x57c3('0x3'))},'bcc':{'type':Sequelize[_0x57c3('0x2')]('long')},'subject':{'type':Sequelize[_0x57c3('0x2')]},'sentAt':{'type':Sequelize[_0x57c3('0x8')]},'attach':{'type':Sequelize[_0x57c3('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x57c3('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x57c3('0x8')]},'originTo':{'type':Sequelize[_0x57c3('0x2')]('long')},'originCc':{'type':Sequelize['TEXT'](_0x57c3('0x3'))}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 9a50038..d8a5945 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 _0xd656=['send','index','model','keys','query','filters','attributes','intersection','fields','length','nolimit','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','MailMessage','rows','show','params','rawAttributes','includeAll','include','find','body','describe','create','direction','secret','MailAccount','findOne','MailServerOut','Smtp','port','secure','authentication','auth','user','pass','service','attachments','join','SendMail','messageId','format','accept','mail','read','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','manual','SIP/%s','channel','event','EventManager','../../config/logger','mail-interactions','agent','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','interface','download','unix','toString','root','server','files','tmp','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','build','writeFileSync','log','err','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','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~!@#$%^&-_=+[{]}.','then','info','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name'];(function(_0x6287b6,_0x5682e7){var _0x5d6be4=function(_0x3e3975){while(--_0x3e3975){_0x6287b6['push'](_0x6287b6['shift']());}};_0x5d6be4(++_0x5682e7);}(_0xd656,0x107));var _0x6d65=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd656[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6d65('0x0'));var rimraf=require(_0x6d65('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6d65('0x2'));var rp=require(_0x6d65('0x3'));var moment=require('moment');var BPromise=require(_0x6d65('0x4'));var Mustache=require(_0x6d65('0x5'));var util=require(_0x6d65('0x6'));var path=require(_0x6d65('0x7'));var sox=require('sox');var csv=require(_0x6d65('0x8'));var ejs=require(_0x6d65('0x9'));var fs=require('fs');var _=require(_0x6d65('0xa'));var squel=require(_0x6d65('0xb'));var crypto=require(_0x6d65('0xc'));var jsforce=require(_0x6d65('0xd'));var deskjs=require(_0x6d65('0xe'));var toCsv=require(_0x6d65('0x8'));var querystring=require('querystring');var Papa=require(_0x6d65('0xf'));var Redis=require(_0x6d65('0x10'));var authService=require(_0x6d65('0x11'));var qs=require(_0x6d65('0x12'));var hardwareService=require(_0x6d65('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x6d65('0x14'));var config=require(_0x6d65('0x15'));var db=require(_0x6d65('0x16'))['db'];config['redis']=_['defaults'](config[_0x6d65('0x17')],{'host':_0x6d65('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6d65('0x17')]));require('./mailMessage.socket')[_0x6d65('0x19')](socket);var jayson=require(_0x6d65('0x1a'));var client=jayson[_0x6d65('0x1b')]['http']({'port':0x232c});var client9003=jayson[_0x6d65('0x1b')][_0x6d65('0x1c')]({'port':0x232b});var client9002=jayson[_0x6d65('0x1b')][_0x6d65('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x526c51,_0xd7afa7,_0x34f2d5){if(_0x34f2d5){var _0x42a4de=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x42a4de[_0x6d65('0x1d')](_0xd7afa7)){return _0x526c51;}else{throw new Error(_0x6d65('0x1e'));}}else{return _0x526c51;}}function respondWithRpcPromise(_0x53ce83,_0x535975,_0x326270,_0x4fb6d5){return new BPromise(function(_0x5e42e5,_0x2fd24e){var _0x1b6835=_0x4fb6d5||client;return _0x1b6835['request'](_0x53ce83,_0x326270)[_0x6d65('0x1f')](function(_0x5e69a5){logger[_0x6d65('0x20')]('MailMessage,\x20%s,\x20%s',_0x535975,'request\x20sent');logger[_0x6d65('0x21')](_0x6d65('0x22'),_0x535975,_0x6d65('0x23'),JSON[_0x6d65('0x24')](_0x5e69a5));if(_0x5e69a5[_0x6d65('0x25')]){if(_0x5e69a5[_0x6d65('0x25')][_0x6d65('0x26')]===0x1f4){logger[_0x6d65('0x25')](_0x6d65('0x27'),_0x535975,_0x5e69a5[_0x6d65('0x25')][_0x6d65('0x28')]);return _0x2fd24e(_0x5e69a5[_0x6d65('0x25')]['message']);}logger[_0x6d65('0x25')](_0x6d65('0x27'),_0x535975,_0x5e69a5[_0x6d65('0x25')][_0x6d65('0x28')]);return _0x5e42e5(_0x5e69a5[_0x6d65('0x25')][_0x6d65('0x28')]);}else{logger[_0x6d65('0x20')](_0x6d65('0x27'),_0x535975,_0x6d65('0x23'));_0x5e42e5(_0x5e69a5[_0x6d65('0x29')][_0x6d65('0x28')]);}})[_0x6d65('0x2a')](function(_0x3b0d67){logger[_0x6d65('0x25')](_0x6d65('0x27'),_0x535975,_0x3b0d67);_0x2fd24e(_0x3b0d67);});});}function respondWithStatusCode(_0x4e526d,_0x12decf){_0x12decf=_0x12decf||0xcc;return function(_0x33652f){if(_0x33652f){return _0x4e526d[_0x6d65('0x2b')](_0x12decf);}return _0x4e526d[_0x6d65('0x2c')](_0x12decf)[_0x6d65('0x2d')]();};}function respondWithResult(_0x5ef2d2,_0x497514){_0x497514=_0x497514||0xc8;return function(_0x312708){if(_0x312708){return _0x5ef2d2['status'](_0x497514)[_0x6d65('0x2e')](_0x312708);}};}function respondWithFilteredResult(_0x23bbbb,_0x2ddacf){return function(_0x3eb6d8){if(_0x3eb6d8){var _0x53b2c0=_0x3eb6d8[_0x6d65('0x2f')],_0x1cfee8=_0x2ddacf['offset'],_0x2a859c=_0x2ddacf[_0x6d65('0x30')]+_0x2ddacf[_0x6d65('0x31')],_0xa3d1d4;if(_0x2a859c>=_0x53b2c0){_0x2a859c=_0x53b2c0;_0xa3d1d4=0xc8;}else{_0xa3d1d4=0xce;}_0x23bbbb[_0x6d65('0x2c')](_0xa3d1d4);return _0x23bbbb[_0x6d65('0x32')](_0x6d65('0x33'),_0x1cfee8+'-'+_0x2a859c+'/'+_0x53b2c0)[_0x6d65('0x2e')](_0x3eb6d8);}return null;};}function patchUpdates(_0x5ecbec){return function(_0x5b3753){try{jsonpatch[_0x6d65('0x34')](_0x5b3753,_0x5ecbec,!![]);}catch(_0x36ee8c){return BPromise[_0x6d65('0x35')](_0x36ee8c);}return _0x5b3753[_0x6d65('0x36')]();};}function saveUpdates(_0x347a36,_0xdf9b84){return function(_0xaa5ce9){if(_0xaa5ce9){return _0xaa5ce9[_0x6d65('0x37')](_0x347a36)['then'](function(_0x4b7214){return _0x4b7214;});}return null;};}function removeEntity(_0x36e685,_0x388a4a){return function(_0x438a58){if(_0x438a58){return _0x438a58[_0x6d65('0x38')]()[_0x6d65('0x1f')](function(){_0x36e685[_0x6d65('0x2c')](0xcc)[_0x6d65('0x2d')]();});}};}function handleEntityNotFound(_0x3ae510,_0x1d54f8){return function(_0x390ad3){if(!_0x390ad3){_0x3ae510[_0x6d65('0x2b')](0x194);}return _0x390ad3;};}function handleError(_0x1180eb,_0x50e74f){_0x50e74f=_0x50e74f||0x1f4;return function(_0xf33507){logger['error'](_0xf33507[_0x6d65('0x39')]);if(_0xf33507[_0x6d65('0x3a')]){delete _0xf33507[_0x6d65('0x3a')];}_0x1180eb['status'](_0x50e74f)[_0x6d65('0x3b')](_0xf33507);};}exports[_0x6d65('0x3c')]=function(_0x21b514,_0x36b2e8){var _0x5d7468={},_0x30a99d={},_0x17bd1c={'count':0x0,'rows':[]};var _0x104440=db['MailMessage']['rawAttributes'];_0x30a99d[_0x6d65('0x3d')]=_[_0x6d65('0x3e')](_0x104440);_0x30a99d[_0x6d65('0x3f')]=_[_0x6d65('0x3e')](_0x21b514[_0x6d65('0x3f')]);_0x30a99d[_0x6d65('0x40')]=_['intersection'](_0x30a99d[_0x6d65('0x3d')],_0x30a99d[_0x6d65('0x3f')]);_0x5d7468[_0x6d65('0x41')]=_[_0x6d65('0x42')](_0x30a99d[_0x6d65('0x3d')],qs[_0x6d65('0x43')](_0x21b514[_0x6d65('0x3f')][_0x6d65('0x43')]));_0x5d7468[_0x6d65('0x41')]=_0x5d7468['attributes'][_0x6d65('0x44')]?_0x5d7468[_0x6d65('0x41')]:_0x30a99d[_0x6d65('0x3d')];if(!_0x21b514[_0x6d65('0x3f')]['hasOwnProperty'](_0x6d65('0x45'))){_0x5d7468[_0x6d65('0x31')]=qs[_0x6d65('0x31')](_0x21b514[_0x6d65('0x3f')]['limit']);_0x5d7468['offset']=qs['offset'](_0x21b514['query'][_0x6d65('0x30')]);}_0x5d7468['order']=qs['sort'](_0x21b514[_0x6d65('0x3f')]['sort']);_0x5d7468[_0x6d65('0x46')]=qs[_0x6d65('0x40')](_[_0x6d65('0x47')](_0x21b514[_0x6d65('0x3f')],_0x30a99d[_0x6d65('0x40')]));if(_0x21b514[_0x6d65('0x3f')][_0x6d65('0x48')]){_0x5d7468[_0x6d65('0x46')]=_[_0x6d65('0x49')](_0x5d7468[_0x6d65('0x46')],{'$or':_[_0x6d65('0x4a')](_0x104440,function(_0x16ce51){if(_0x16ce51[_0x6d65('0x4b')][_0x6d65('0x4c')]!==_0x6d65('0x4d')){var _0xb9249f={};_0xb9249f[_0x16ce51[_0x6d65('0x4e')]]={'$like':'%'+_0x21b514['query']['filter']+'%'};return _0xb9249f;}})});}_0x5d7468=_[_0x6d65('0x49')]({},_0x5d7468,_0x21b514[_0x6d65('0x4f')]);var _0x57153d={'where':_0x5d7468['where']};return db[_0x6d65('0x50')][_0x6d65('0x2f')](_0x57153d)[_0x6d65('0x1f')](function(_0x1e52ad){_0x17bd1c['count']=_0x1e52ad;if(_0x21b514[_0x6d65('0x3f')]['includeAll']){_0x5d7468['include']=[{'all':!![]}];}return db[_0x6d65('0x50')]['findAll'](_0x5d7468);})['then'](function(_0x3f07e4){_0x17bd1c[_0x6d65('0x51')]=_0x3f07e4;return _0x17bd1c;})['then'](respondWithFilteredResult(_0x36b2e8,_0x5d7468))[_0x6d65('0x2a')](handleError(_0x36b2e8,null));};exports[_0x6d65('0x52')]=function(_0x435fe7,_0x342fc1){var _0x33dbc8={'raw':!![],'where':{'id':_0x435fe7[_0x6d65('0x53')]['id']}},_0x42492e={};_0x42492e[_0x6d65('0x3d')]=_[_0x6d65('0x3e')](db[_0x6d65('0x50')][_0x6d65('0x54')]);_0x42492e[_0x6d65('0x3f')]=_[_0x6d65('0x3e')](_0x435fe7['query']);_0x42492e['filters']=_['intersection'](_0x42492e['model'],_0x42492e[_0x6d65('0x3f')]);_0x33dbc8[_0x6d65('0x41')]=_[_0x6d65('0x42')](_0x42492e['model'],qs[_0x6d65('0x43')](_0x435fe7[_0x6d65('0x3f')]['fields']));_0x33dbc8['attributes']=_0x33dbc8[_0x6d65('0x41')][_0x6d65('0x44')]?_0x33dbc8[_0x6d65('0x41')]:_0x42492e[_0x6d65('0x3d')];if(_0x435fe7[_0x6d65('0x3f')][_0x6d65('0x55')]){_0x33dbc8[_0x6d65('0x56')]=[{'all':!![]}];}_0x33dbc8=_[_0x6d65('0x49')]({},_0x33dbc8,_0x435fe7['options']);return db[_0x6d65('0x50')][_0x6d65('0x57')](_0x33dbc8)['then'](handleEntityNotFound(_0x342fc1,null))[_0x6d65('0x1f')](respondWithResult(_0x342fc1,null))['catch'](handleError(_0x342fc1,null));};exports[_0x6d65('0x37')]=function(_0x341233,_0x193e46){if(_0x341233[_0x6d65('0x58')]['id']){delete _0x341233[_0x6d65('0x58')]['id'];}return db[_0x6d65('0x50')]['find']({'where':{'id':_0x341233['params']['id']}})[_0x6d65('0x1f')](handleEntityNotFound(_0x193e46,null))[_0x6d65('0x1f')](saveUpdates(_0x341233[_0x6d65('0x58')],null))[_0x6d65('0x1f')](respondWithResult(_0x193e46,null))['catch'](handleError(_0x193e46,null));};exports[_0x6d65('0x38')]=function(_0x5ce942,_0x41ae3b){return db[_0x6d65('0x50')][_0x6d65('0x57')]({'where':{'id':_0x5ce942[_0x6d65('0x53')]['id']}})[_0x6d65('0x1f')](handleEntityNotFound(_0x41ae3b,null))[_0x6d65('0x1f')](removeEntity(_0x41ae3b,null))['catch'](handleError(_0x41ae3b,null));};exports[_0x6d65('0x59')]=function(_0x3b2650,_0x53d1e1){return db['MailMessage'][_0x6d65('0x59')]()[_0x6d65('0x1f')](respondWithResult(_0x53d1e1,null))['catch'](handleError(_0x53d1e1,null));};exports[_0x6d65('0x5a')]=function(_0x49b68b,_0x160517){return db[_0x6d65('0x50')]['create'](_0x49b68b[_0x6d65('0x58')])[_0x6d65('0x1f')](function(_0x3800d4){if(_0x3800d4){if(_0x3800d4[_0x6d65('0x5b')]==='out'&&!_0x3800d4[_0x6d65('0x5c')]){return db[_0x6d65('0x5d')][_0x6d65('0x5e')]({'where':{'id':_0x3800d4['MailAccountId']},'include':[{'model':db[_0x6d65('0x5f')],'as':_0x6d65('0x60'),'raw':!![]}]})[_0x6d65('0x1f')](function(_0xc7020a){if(_0xc7020a&&_0xc7020a[_0x6d65('0x60')]){var _0x4f37f4={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0xc7020a[_0x6d65('0x60')]['service'])){_0x4f37f4['host']=_0xc7020a[_0x6d65('0x60')]['host'];_0x4f37f4[_0x6d65('0x61')]=_0xc7020a[_0x6d65('0x60')][_0x6d65('0x61')];_0x4f37f4['secure']=_0xc7020a['Smtp'][_0x6d65('0x62')];if(_0xc7020a[_0x6d65('0x60')][_0x6d65('0x63')]){_0x4f37f4[_0x6d65('0x64')]={'user':_0xc7020a[_0x6d65('0x60')][_0x6d65('0x65')],'pass':_0xc7020a[_0x6d65('0x60')][_0x6d65('0x66')]};}}else{_0x4f37f4[_0x6d65('0x67')]=_0xc7020a[_0x6d65('0x60')][_0x6d65('0x67')];_0x4f37f4['auth']={'user':_0xc7020a[_0x6d65('0x60')]['user'],'pass':_0xc7020a['Smtp'][_0x6d65('0x66')]};_0x4f37f4[_0x6d65('0x62')]=_0xc7020a[_0x6d65('0x60')][_0x6d65('0x62')];}if(_0x49b68b[_0x6d65('0x58')][_0x6d65('0x68')]&&_0x49b68b['body'][_0x6d65('0x68')][_0x6d65('0x44')]){for(var _0x1bac29=0x0;_0x1bac29<_0x49b68b[_0x6d65('0x58')]['attachments'][_0x6d65('0x44')];_0x1bac29+=0x1){_0x49b68b['body'][_0x6d65('0x68')][_0x1bac29]={'filename':_0x49b68b[_0x6d65('0x58')][_0x6d65('0x68')][_0x1bac29]['name'],'path':path[_0x6d65('0x69')](config['root'],'server/files/attachments',_0x49b68b[_0x6d65('0x58')][_0x6d65('0x68')][_0x1bac29]['basename'])};}}return{'account':_0x4f37f4,'message':_0x49b68b[_0x6d65('0x58')]};}})[_0x6d65('0x1f')](function(_0x2d69cf){if(_0x2d69cf){return respondWithRpcPromise(_0x6d65('0x6a'),'sendMail',_0x2d69cf,client9003)[_0x6d65('0x1f')](function(_0x2e4a85){return _0x3800d4['update']({'read':!![],'messageId':_0x2e4a85[_0x6d65('0x6b')],'sentAt':moment()[_0x6d65('0x6c')]('YYYY-MM-DD\x20HH:mm:ss')});})['catch'](function(_0x18578e){logger[_0x6d65('0x25')]('%s',JSON['stringify'](_0x18578e));return _0x3800d4;});}return _0x3800d4;});}return _0x3800d4;}})[_0x6d65('0x1f')](respondWithResult(_0x160517,0xc9))[_0x6d65('0x2a')](handleError(_0x160517,null));};var interaction_log=require('../../config/logger')('mail-interactions');exports[_0x6d65('0x6d')]=function(_0x2ee2dd,_0x9c0a05,_0x3291fe){var _0x441f51={'channel':_0x6d65('0x6e')};if(_0x2ee2dd[_0x6d65('0x58')]['id']){delete _0x2ee2dd[_0x6d65('0x58')]['id'];}_0x2ee2dd['body'][_0x6d65('0x6f')]=!![];_0x2ee2dd[_0x6d65('0x58')]['readAt']=moment()[_0x6d65('0x6c')](_0x6d65('0x70'));_0x2ee2dd[_0x6d65('0x58')]['UserId']=_0x2ee2dd['body'][_0x6d65('0x71')]||_0x2ee2dd[_0x6d65('0x65')]['id'];return db['MailMessage'][_0x6d65('0x57')]({'where':{'id':_0x2ee2dd[_0x6d65('0x53')]['id'],'UserId':null},'include':[{'model':db[_0x6d65('0x72')],'as':'Contact'}]})[_0x6d65('0x1f')](handleEntityNotFound(_0x9c0a05,null))[_0x6d65('0x1f')](saveUpdates(_0x2ee2dd['body'],null))[_0x6d65('0x1f')](function(_0x306651){if(_0x306651){_0x441f51[_0x6d65('0x28')]=_0x306651['get']({'plain':!![]});return db[_0x6d65('0x73')][_0x6d65('0x57')]({'where':{'id':_0x306651[_0x6d65('0x74')]}});}return null;})['then'](handleEntityNotFound(_0x9c0a05,null))[_0x6d65('0x1f')](function(_0x138432){if(_0x138432){return _0x138432[_0x6d65('0x37')]({'UserId':_0x2ee2dd[_0x6d65('0x58')]['UserId'],'read1stAt':_[_0x6d65('0x75')](_0x138432[_0x6d65('0x76')])?moment()[_0x6d65('0x6c')](_0x6d65('0x70')):undefined});}return null;})[_0x6d65('0x1f')](function(_0x561662){if(_0x561662){_0x441f51[_0x6d65('0x77')]=_0x561662[_0x6d65('0x78')]({'plain':!![]});interaction_log[_0x6d65('0x20')](_0x6d65('0x79'),_0x2ee2dd['user']['id'],_0x2ee2dd[_0x6d65('0x65')][_0x6d65('0x3a')],_0x2ee2dd[_0x6d65('0x65')][_0x6d65('0x7a')],_0x441f51[_0x6d65('0x77')]['id'],_0x2ee2dd[_0x6d65('0x58')]?JSON[_0x6d65('0x24')](_0x2ee2dd[_0x6d65('0x58')]):_0x6d65('0x7b'));return respondWithRpcPromise(_0x6d65('0x7c'),_0x6d65('0x7d'),_0x441f51);}return null;})['then'](function(_0x34dbbd){if(_0x34dbbd){if(_0x2ee2dd['body'][_0x6d65('0x7e')]){_0x441f51[_0x6d65('0x28')]['interface']=util[_0x6d65('0x6c')](_0x6d65('0x7f'),_0x2ee2dd[_0x6d65('0x65')][_0x6d65('0x3a')]);_0x441f51[_0x6d65('0x28')][_0x6d65('0x80')]=_0x441f51['channel'];_0x441f51['message'][_0x6d65('0x81')]=_0x6d65('0x6d');return respondWithRpcPromise(_0x6d65('0x82'),'EventManager',{'event':'acceptmessage','message':_0x441f51['message']},client9002)[_0x6d65('0x1f')](function(){return _0x441f51;});}return _0x441f51;}return null;})[_0x6d65('0x1f')](respondWithResult(_0x9c0a05,null))[_0x6d65('0x2a')](handleError(_0x9c0a05,null));};var interaction_log=require(_0x6d65('0x83'))(_0x6d65('0x84'));exports['reject']=function(_0x3fb199,_0x1b3209,_0x57cbcf){var _0x4afea2={'agent':{},'channel':_0x6d65('0x6e')};if(_0x3fb199[_0x6d65('0x58')]['id']){delete _0x3fb199[_0x6d65('0x58')]['id'];}_0x3fb199[_0x6d65('0x58')][_0x6d65('0x71')]=_0x3fb199['body'][_0x6d65('0x71')]||_0x3fb199[_0x6d65('0x65')]['id'];_0x4afea2[_0x6d65('0x85')]['id']=_0x3fb199['body'][_0x6d65('0x71')];return db[_0x6d65('0x50')][_0x6d65('0x57')]({'where':{'id':_0x3fb199[_0x6d65('0x53')]['id'],'UserId':null}})[_0x6d65('0x1f')](handleEntityNotFound(_0x1b3209,null))[_0x6d65('0x1f')](function(_0x33b92f){if(_0x33b92f){_0x4afea2['message']=_0x33b92f[_0x6d65('0x78')]({'plain':!![]});return db[_0x6d65('0x73')]['find']({'where':{'id':_0x33b92f['MailInteractionId']}});}return null;})[_0x6d65('0x1f')](handleEntityNotFound(_0x1b3209,null))['then'](function(_0x430c03){if(_0x430c03){_0x4afea2[_0x6d65('0x77')]=_0x430c03[_0x6d65('0x78')]({'plain':!![]});interaction_log['info'](_0x6d65('0x86'),_0x3fb199[_0x6d65('0x65')]['id'],_0x3fb199[_0x6d65('0x65')]['name'],_0x3fb199[_0x6d65('0x65')]['role'],_0x4afea2['interaction']['id'],_0x3fb199['body']?JSON[_0x6d65('0x24')](_0x3fb199['body']):_0x6d65('0x7b'));return respondWithRpcPromise('RejectMessage',_0x6d65('0x87'),_0x4afea2);}return null;})['then'](function(_0x3110fd){if(_0x3110fd){_0x3110fd[_0x6d65('0x28')][_0x6d65('0x88')]=util['format']('SIP/%s',_0x3fb199[_0x6d65('0x65')][_0x6d65('0x3a')]);_0x3110fd['message'][_0x6d65('0x80')]=_0x4afea2[_0x6d65('0x80')];_0x3110fd['message'][_0x6d65('0x81')]='reject';respondWithRpcPromise(_0x6d65('0x82'),_0x6d65('0x82'),{'event':'rejectmessage','message':_0x3110fd['message']},client9002);return _0x4afea2;}return null;})[_0x6d65('0x1f')](respondWithResult(_0x1b3209,null))[_0x6d65('0x2a')](handleError(_0x1b3209,null));};exports[_0x6d65('0x89')]=function(_0x1fe369,_0x42f289){var _0x3f4cf7=moment()[_0x6d65('0x8a')]()[_0x6d65('0x8b')]();var _0x4ae81b=path[_0x6d65('0x69')](config[_0x6d65('0x8c')],_0x6d65('0x8d'),_0x6d65('0x8e'),_0x6d65('0x8f'));var _0x5b67bc=path[_0x6d65('0x69')](config[_0x6d65('0x8c')],_0x6d65('0x8d'),_0x6d65('0x8e'),_0x6d65('0x68'));var _0x2bb47e=util['format'](_0x6d65('0x90'),_0x3f4cf7);return db[_0x6d65('0x50')][_0x6d65('0x57')]({'where':{'id':_0x1fe369['params']['id']},'attributes':['id','body',_0x6d65('0x91'),'to','cc',_0x6d65('0x92'),_0x6d65('0x93'),_0x6d65('0x94')],'include':_0x1fe369['query']['attachments']?[{'model':db[_0x6d65('0x95')],'as':_0x6d65('0x96')}]:undefined})['then'](handleEntityNotFound(_0x42f289,null))[_0x6d65('0x1f')](function(_0x178616){if(_0x178616){var _0x1fbf81=_0x178616;var _0x560138={'from':_0x1fbf81[_0x6d65('0x91')],'to':_0x1fbf81['to'],'subject':_0x1fbf81[_0x6d65('0x93')],'html':_0x1fbf81[_0x6d65('0x58')],'headers':{'Date':moment(_0x1fbf81['createdAt'])[_0x6d65('0x6c')](_0x6d65('0x97'))},'attachments':[]};if(_0x178616['cc']){_0x560138[_0x6d65('0x98')]['Cc']=_0x178616['cc'];}if(_0x178616['bcc']){_0x560138[_0x6d65('0x98')][_0x6d65('0x99')]=_0x178616['bcc'];}return new BPromise(function(_0x197cce,_0x58d122){if(_0x178616[_0x6d65('0x96')]){for(var _0x248073=0x0;_0x248073<_0x178616[_0x6d65('0x96')][_0x6d65('0x44')];_0x248073++){var _0x260a4f=_0x178616[_0x6d65('0x96')][_0x248073];var _0x52abc9=path[_0x6d65('0x69')](_0x5b67bc,_0x260a4f[_0x6d65('0x9a')]);if(fs[_0x6d65('0x9b')](_0x52abc9)){_0x560138[_0x6d65('0x68')]['push']({'name':_0x260a4f[_0x6d65('0x3a')],'contentType':_0x260a4f[_0x6d65('0x4b')],'data':fs['readFileSync'](_0x52abc9)});}}}emlformat[_0x6d65('0x9c')](_0x560138,function(_0xcac8f0,_0x454894){if(_0xcac8f0)return _0x58d122(_0xcac8f0);fs[_0x6d65('0x9d')](path[_0x6d65('0x69')](_0x4ae81b,_0x2bb47e),_0x454894);return _0x197cce(_0x454894);});});}})[_0x6d65('0x1f')](function(_0x346444){if(_0x346444){return _0x42f289[_0x6d65('0x89')](path[_0x6d65('0x69')](_0x4ae81b,_0x2bb47e),_0x2bb47e,function(_0x3ed9bb){if(_0x3ed9bb){console[_0x6d65('0x9e')](_0x6d65('0x9f'),_0x3ed9bb);}else{fs[_0x6d65('0xa0')](path[_0x6d65('0x69')](_0x4ae81b,_0x2bb47e));}});}})[_0x6d65('0x2a')](handleError(_0x42f289,null));}; \ No newline at end of file +var _0x175a=['mail-interactions','accept','read','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','Contact','get','MailInteraction','MailInteractionId','read1stAt','interaction','role','null','acceptMessage','manual','channel','EventManager','acceptmessage','mail','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SIP/%s','event','rejectmessage','download','unix','toString','server','files','message-%s.eml','bcc','subject','createdAt','Attachment','Attachments','from','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','existsSync','build','writeFileSync','unlinkSync','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','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','offset','limit','set','reject','save','update','destroy','stack','name','send','index','MailMessage','keys','query','filters','intersection','model','fields','attributes','order','sort','where','filter','type','field','merge','options','count','include','findAll','rows','show','params','rawAttributes','length','find','body','describe','create','direction','out','MailAccount','MailServerOut','Smtp','isNil','service','host','port','secure','user','pass','auth','attachments','join','root','server/files/attachments','SendMail','sendMail','messageId','format'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x175a,0xc1));var _0xa175=function(_0xc6d7db,_0x10a5e9){_0xc6d7db=_0xc6d7db-0x0;var _0x13bf96=_0x175a[_0xc6d7db];return _0x13bf96;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xa175('0x0'));var zipdir=require(_0xa175('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa175('0x2'));var BPromise=require(_0xa175('0x3'));var Mustache=require(_0xa175('0x4'));var util=require(_0xa175('0x5'));var path=require(_0xa175('0x6'));var sox=require('sox');var csv=require(_0xa175('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa175('0x8'));var squel=require('squel');var crypto=require(_0xa175('0x9'));var jsforce=require(_0xa175('0xa'));var deskjs=require(_0xa175('0xb'));var toCsv=require(_0xa175('0x7'));var querystring=require(_0xa175('0xc'));var Papa=require(_0xa175('0xd'));var Redis=require(_0xa175('0xe'));var authService=require(_0xa175('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xa175('0x10'));var logger=require(_0xa175('0x11'))(_0xa175('0x12'));var utils=require(_0xa175('0x13'));var config=require(_0xa175('0x14'));var db=require('../../mysqldb')['db'];config[_0xa175('0x15')]=_[_0xa175('0x16')](config[_0xa175('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xa175('0x17'))(new Redis(config['redis']));require('./mailMessage.socket')['register'](socket);var jayson=require(_0xa175('0x18'));var client=jayson[_0xa175('0x19')][_0xa175('0x1a')]({'port':0x232c});var client9003=jayson[_0xa175('0x19')]['http']({'port':0x232b});var client9002=jayson[_0xa175('0x19')][_0xa175('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x506848,_0x277459,_0x4623f5){if(_0x4623f5){var _0x2a584a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2a584a['test'](_0x277459)){return _0x506848;}else{throw new Error(_0xa175('0x1b'));}}else{return _0x506848;}}function respondWithRpcPromise(_0x2ca14c,_0x4a707b,_0x496353,_0x3c2450){return new BPromise(function(_0x38d374,_0x466b62){var _0x662245=_0x3c2450||client;return _0x662245[_0xa175('0x1c')](_0x2ca14c,_0x496353)[_0xa175('0x1d')](function(_0x4ee6c0){logger[_0xa175('0x1e')](_0xa175('0x1f'),_0x4a707b,_0xa175('0x20'));logger[_0xa175('0x21')](_0xa175('0x22'),_0x4a707b,_0xa175('0x20'),JSON[_0xa175('0x23')](_0x4ee6c0));if(_0x4ee6c0[_0xa175('0x24')]){if(_0x4ee6c0[_0xa175('0x24')][_0xa175('0x25')]===0x1f4){logger[_0xa175('0x24')](_0xa175('0x1f'),_0x4a707b,_0x4ee6c0[_0xa175('0x24')][_0xa175('0x26')]);return _0x466b62(_0x4ee6c0['error'][_0xa175('0x26')]);}logger[_0xa175('0x24')](_0xa175('0x1f'),_0x4a707b,_0x4ee6c0[_0xa175('0x24')][_0xa175('0x26')]);return _0x38d374(_0x4ee6c0[_0xa175('0x24')][_0xa175('0x26')]);}else{logger['info'](_0xa175('0x1f'),_0x4a707b,_0xa175('0x20'));_0x38d374(_0x4ee6c0[_0xa175('0x27')][_0xa175('0x26')]);}})[_0xa175('0x28')](function(_0x326cb9){logger[_0xa175('0x24')](_0xa175('0x1f'),_0x4a707b,_0x326cb9);_0x466b62(_0x326cb9);});});}function respondWithStatusCode(_0x1ed029,_0x1a8ae6){_0x1a8ae6=_0x1a8ae6||0xcc;return function(_0x11712a){if(_0x11712a){return _0x1ed029[_0xa175('0x29')](_0x1a8ae6);}return _0x1ed029[_0xa175('0x2a')](_0x1a8ae6)[_0xa175('0x2b')]();};}function respondWithResult(_0x2f33b3,_0x201cb8){_0x201cb8=_0x201cb8||0xc8;return function(_0x42b8f6){if(_0x42b8f6){return _0x2f33b3[_0xa175('0x2a')](_0x201cb8)[_0xa175('0x2c')](_0x42b8f6);}};}function respondWithFilteredResult(_0x13ad4f,_0x5098c8){return function(_0x3662cc){if(_0x3662cc){var _0x5a849c=_0x3662cc['count'],_0x261746=_0x5098c8[_0xa175('0x2d')],_0x32eabc=_0x5098c8['offset']+_0x5098c8[_0xa175('0x2e')],_0x47251d;if(_0x32eabc>=_0x5a849c){_0x32eabc=_0x5a849c;_0x47251d=0xc8;}else{_0x47251d=0xce;}_0x13ad4f[_0xa175('0x2a')](_0x47251d);return _0x13ad4f[_0xa175('0x2f')]('Content-Range',_0x261746+'-'+_0x32eabc+'/'+_0x5a849c)[_0xa175('0x2c')](_0x3662cc);}return null;};}function patchUpdates(_0x45983b){return function(_0x35cfd8){try{jsonpatch['apply'](_0x35cfd8,_0x45983b,!![]);}catch(_0x316ae6){return BPromise[_0xa175('0x30')](_0x316ae6);}return _0x35cfd8[_0xa175('0x31')]();};}function saveUpdates(_0x1929f0,_0x4e5a2a){return function(_0x5799a7){if(_0x5799a7){return _0x5799a7[_0xa175('0x32')](_0x1929f0)[_0xa175('0x1d')](function(_0x1b9881){return _0x1b9881;});}return null;};}function removeEntity(_0x4069f6,_0x14cb03){return function(_0x2ea0f8){if(_0x2ea0f8){return _0x2ea0f8[_0xa175('0x33')]()[_0xa175('0x1d')](function(){_0x4069f6['status'](0xcc)[_0xa175('0x2b')]();});}};}function handleEntityNotFound(_0x1124f9,_0x4e2ff5){return function(_0xbd4137){if(!_0xbd4137){_0x1124f9[_0xa175('0x29')](0x194);}return _0xbd4137;};}function handleError(_0x363b17,_0x1db5eb){_0x1db5eb=_0x1db5eb||0x1f4;return function(_0x1eb28d){logger[_0xa175('0x24')](_0x1eb28d[_0xa175('0x34')]);if(_0x1eb28d[_0xa175('0x35')]){delete _0x1eb28d[_0xa175('0x35')];}_0x363b17[_0xa175('0x2a')](_0x1db5eb)[_0xa175('0x36')](_0x1eb28d);};}exports[_0xa175('0x37')]=function(_0x47a21b,_0x48f772){var _0x7593={},_0x17acb6={},_0x2cc06a={'count':0x0,'rows':[]};var _0x4e47b0=db[_0xa175('0x38')]['rawAttributes'];_0x17acb6['model']=_[_0xa175('0x39')](_0x4e47b0);_0x17acb6[_0xa175('0x3a')]=_[_0xa175('0x39')](_0x47a21b[_0xa175('0x3a')]);_0x17acb6[_0xa175('0x3b')]=_[_0xa175('0x3c')](_0x17acb6[_0xa175('0x3d')],_0x17acb6[_0xa175('0x3a')]);_0x7593['attributes']=_[_0xa175('0x3c')](_0x17acb6[_0xa175('0x3d')],qs[_0xa175('0x3e')](_0x47a21b['query']['fields']));_0x7593[_0xa175('0x3f')]=_0x7593[_0xa175('0x3f')]['length']?_0x7593[_0xa175('0x3f')]:_0x17acb6[_0xa175('0x3d')];if(!_0x47a21b[_0xa175('0x3a')]['hasOwnProperty']('nolimit')){_0x7593[_0xa175('0x2e')]=qs[_0xa175('0x2e')](_0x47a21b[_0xa175('0x3a')][_0xa175('0x2e')]);_0x7593[_0xa175('0x2d')]=qs['offset'](_0x47a21b[_0xa175('0x3a')]['offset']);}_0x7593[_0xa175('0x40')]=qs[_0xa175('0x41')](_0x47a21b['query'][_0xa175('0x41')]);_0x7593[_0xa175('0x42')]=qs[_0xa175('0x3b')](_['pick'](_0x47a21b[_0xa175('0x3a')],_0x17acb6['filters']));if(_0x47a21b[_0xa175('0x3a')][_0xa175('0x43')]){_0x7593['where']=_['merge'](_0x7593[_0xa175('0x42')],{'$or':_['map'](_0x4e47b0,function(_0x1faebb){if(_0x1faebb[_0xa175('0x44')]['key']!=='VIRTUAL'){var _0x3af786={};_0x3af786[_0x1faebb[_0xa175('0x45')]]={'$like':'%'+_0x47a21b[_0xa175('0x3a')][_0xa175('0x43')]+'%'};return _0x3af786;}})});}_0x7593=_[_0xa175('0x46')]({},_0x7593,_0x47a21b[_0xa175('0x47')]);var _0x24ef69={'where':_0x7593['where']};return db['MailMessage'][_0xa175('0x48')](_0x24ef69)[_0xa175('0x1d')](function(_0x1861b8){_0x2cc06a[_0xa175('0x48')]=_0x1861b8;if(_0x47a21b[_0xa175('0x3a')]['includeAll']){_0x7593[_0xa175('0x49')]=[{'all':!![]}];}return db['MailMessage'][_0xa175('0x4a')](_0x7593);})[_0xa175('0x1d')](function(_0x88a2a4){_0x2cc06a[_0xa175('0x4b')]=_0x88a2a4;return _0x2cc06a;})[_0xa175('0x1d')](respondWithFilteredResult(_0x48f772,_0x7593))[_0xa175('0x28')](handleError(_0x48f772,null));};exports[_0xa175('0x4c')]=function(_0x202f05,_0x326987){var _0x23f080={'raw':!![],'where':{'id':_0x202f05[_0xa175('0x4d')]['id']}},_0x3c27e1={};_0x3c27e1['model']=_['keys'](db[_0xa175('0x38')][_0xa175('0x4e')]);_0x3c27e1[_0xa175('0x3a')]=_[_0xa175('0x39')](_0x202f05[_0xa175('0x3a')]);_0x3c27e1[_0xa175('0x3b')]=_[_0xa175('0x3c')](_0x3c27e1[_0xa175('0x3d')],_0x3c27e1['query']);_0x23f080[_0xa175('0x3f')]=_['intersection'](_0x3c27e1[_0xa175('0x3d')],qs[_0xa175('0x3e')](_0x202f05[_0xa175('0x3a')]['fields']));_0x23f080[_0xa175('0x3f')]=_0x23f080['attributes'][_0xa175('0x4f')]?_0x23f080[_0xa175('0x3f')]:_0x3c27e1['model'];if(_0x202f05[_0xa175('0x3a')]['includeAll']){_0x23f080['include']=[{'all':!![]}];}_0x23f080=_[_0xa175('0x46')]({},_0x23f080,_0x202f05[_0xa175('0x47')]);return db['MailMessage'][_0xa175('0x50')](_0x23f080)[_0xa175('0x1d')](handleEntityNotFound(_0x326987,null))['then'](respondWithResult(_0x326987,null))[_0xa175('0x28')](handleError(_0x326987,null));};exports[_0xa175('0x32')]=function(_0x3040f2,_0x50e93c){if(_0x3040f2['body']['id']){delete _0x3040f2[_0xa175('0x51')]['id'];}return db[_0xa175('0x38')][_0xa175('0x50')]({'where':{'id':_0x3040f2[_0xa175('0x4d')]['id']}})['then'](handleEntityNotFound(_0x50e93c,null))['then'](saveUpdates(_0x3040f2[_0xa175('0x51')],null))[_0xa175('0x1d')](respondWithResult(_0x50e93c,null))[_0xa175('0x28')](handleError(_0x50e93c,null));};exports[_0xa175('0x33')]=function(_0x458f99,_0xbb0697){return db[_0xa175('0x38')][_0xa175('0x50')]({'where':{'id':_0x458f99[_0xa175('0x4d')]['id']}})[_0xa175('0x1d')](handleEntityNotFound(_0xbb0697,null))[_0xa175('0x1d')](removeEntity(_0xbb0697,null))[_0xa175('0x28')](handleError(_0xbb0697,null));};exports[_0xa175('0x52')]=function(_0x2be698,_0x2f8f78){return db[_0xa175('0x38')]['describe']()[_0xa175('0x1d')](respondWithResult(_0x2f8f78,null))[_0xa175('0x28')](handleError(_0x2f8f78,null));};exports[_0xa175('0x53')]=function(_0x4e1250,_0x32158f){return db[_0xa175('0x38')][_0xa175('0x53')](_0x4e1250[_0xa175('0x51')])[_0xa175('0x1d')](function(_0x59b758){if(_0x59b758){if(_0x59b758[_0xa175('0x54')]===_0xa175('0x55')&&!_0x59b758['secret']){return db[_0xa175('0x56')]['findOne']({'where':{'id':_0x59b758['MailAccountId']},'include':[{'model':db[_0xa175('0x57')],'as':'Smtp','raw':!![]}]})[_0xa175('0x1d')](function(_0x205344){if(_0x205344&&_0x205344[_0xa175('0x58')]){var _0x372b8d={'tls':{'rejectUnauthorized':![]}};if(_[_0xa175('0x59')](_0x205344['Smtp'][_0xa175('0x5a')])){_0x372b8d[_0xa175('0x5b')]=_0x205344[_0xa175('0x58')][_0xa175('0x5b')];_0x372b8d[_0xa175('0x5c')]=_0x205344[_0xa175('0x58')][_0xa175('0x5c')];_0x372b8d[_0xa175('0x5d')]=_0x205344['Smtp'][_0xa175('0x5d')];if(_0x205344[_0xa175('0x58')]['authentication']){_0x372b8d['auth']={'user':_0x205344[_0xa175('0x58')][_0xa175('0x5e')],'pass':_0x205344[_0xa175('0x58')][_0xa175('0x5f')]};}}else{_0x372b8d[_0xa175('0x5a')]=_0x205344[_0xa175('0x58')][_0xa175('0x5a')];_0x372b8d[_0xa175('0x60')]={'user':_0x205344['Smtp']['user'],'pass':_0x205344[_0xa175('0x58')]['pass']};_0x372b8d['secure']=_0x205344[_0xa175('0x58')][_0xa175('0x5d')];}if(_0x4e1250[_0xa175('0x51')][_0xa175('0x61')]&&_0x4e1250[_0xa175('0x51')]['attachments'][_0xa175('0x4f')]){for(var _0x19c630=0x0;_0x19c630<_0x4e1250[_0xa175('0x51')][_0xa175('0x61')][_0xa175('0x4f')];_0x19c630+=0x1){_0x4e1250[_0xa175('0x51')]['attachments'][_0x19c630]={'filename':_0x4e1250[_0xa175('0x51')][_0xa175('0x61')][_0x19c630][_0xa175('0x35')],'path':path[_0xa175('0x62')](config[_0xa175('0x63')],_0xa175('0x64'),_0x4e1250[_0xa175('0x51')]['attachments'][_0x19c630]['basename'])};}}return{'account':_0x372b8d,'message':_0x4e1250[_0xa175('0x51')]};}})[_0xa175('0x1d')](function(_0x4f868a){if(_0x4f868a){return respondWithRpcPromise(_0xa175('0x65'),_0xa175('0x66'),_0x4f868a,client9003)[_0xa175('0x1d')](function(_0xedd0a4){return _0x59b758[_0xa175('0x32')]({'read':!![],'messageId':_0xedd0a4[_0xa175('0x67')],'sentAt':moment()[_0xa175('0x68')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xa175('0x28')](function(_0x2caaf8){logger[_0xa175('0x24')]('%s',JSON[_0xa175('0x23')](_0x2caaf8));return _0x59b758;});}return _0x59b758;});}return _0x59b758;}})[_0xa175('0x1d')](respondWithResult(_0x32158f,0xc9))[_0xa175('0x28')](handleError(_0x32158f,null));};var interaction_log=require(_0xa175('0x11'))(_0xa175('0x69'));exports[_0xa175('0x6a')]=function(_0x16b7e8,_0x2031d0,_0x1b163a){var _0x50b965={'channel':'mail'};if(_0x16b7e8[_0xa175('0x51')]['id']){delete _0x16b7e8['body']['id'];}_0x16b7e8[_0xa175('0x51')][_0xa175('0x6b')]=!![];_0x16b7e8[_0xa175('0x51')]['readAt']=moment()['format'](_0xa175('0x6c'));_0x16b7e8[_0xa175('0x51')]['UserId']=_0x16b7e8[_0xa175('0x51')][_0xa175('0x6d')]||_0x16b7e8[_0xa175('0x5e')]['id'];return db['MailMessage'][_0xa175('0x50')]({'where':{'id':_0x16b7e8['params']['id'],'UserId':null},'include':[{'model':db[_0xa175('0x6e')],'as':_0xa175('0x6f')}]})[_0xa175('0x1d')](handleEntityNotFound(_0x2031d0,null))[_0xa175('0x1d')](saveUpdates(_0x16b7e8[_0xa175('0x51')],null))[_0xa175('0x1d')](function(_0x48e49d){if(_0x48e49d){_0x50b965[_0xa175('0x26')]=_0x48e49d[_0xa175('0x70')]({'plain':!![]});return db[_0xa175('0x71')]['find']({'where':{'id':_0x48e49d[_0xa175('0x72')]}});}return null;})[_0xa175('0x1d')](handleEntityNotFound(_0x2031d0,null))[_0xa175('0x1d')](function(_0x4dc6d5){if(_0x4dc6d5){return _0x4dc6d5[_0xa175('0x32')]({'UserId':_0x16b7e8[_0xa175('0x51')][_0xa175('0x6d')],'read1stAt':_[_0xa175('0x59')](_0x4dc6d5[_0xa175('0x73')])?moment()[_0xa175('0x68')](_0xa175('0x6c')):undefined});}return null;})['then'](function(_0xced656){if(_0xced656){_0x50b965[_0xa175('0x74')]=_0xced656['get']({'plain':!![]});interaction_log[_0xa175('0x1e')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x16b7e8[_0xa175('0x5e')]['id'],_0x16b7e8[_0xa175('0x5e')][_0xa175('0x35')],_0x16b7e8[_0xa175('0x5e')][_0xa175('0x75')],_0x50b965[_0xa175('0x74')]['id'],_0x16b7e8['body']?JSON[_0xa175('0x23')](_0x16b7e8[_0xa175('0x51')]):_0xa175('0x76'));return respondWithRpcPromise('AcceptMessage',_0xa175('0x77'),_0x50b965);}return null;})['then'](function(_0x2014cf){if(_0x2014cf){if(_0x16b7e8[_0xa175('0x51')][_0xa175('0x78')]){_0x50b965[_0xa175('0x26')]['interface']=util[_0xa175('0x68')]('SIP/%s',_0x16b7e8['user'][_0xa175('0x35')]);_0x50b965[_0xa175('0x26')][_0xa175('0x79')]=_0x50b965[_0xa175('0x79')];_0x50b965[_0xa175('0x26')]['event']=_0xa175('0x6a');return respondWithRpcPromise('EventManager',_0xa175('0x7a'),{'event':_0xa175('0x7b'),'message':_0x50b965[_0xa175('0x26')]},client9002)[_0xa175('0x1d')](function(){return _0x50b965;});}return _0x50b965;}return null;})[_0xa175('0x1d')](respondWithResult(_0x2031d0,null))[_0xa175('0x28')](handleError(_0x2031d0,null));};var interaction_log=require(_0xa175('0x11'))(_0xa175('0x69'));exports[_0xa175('0x30')]=function(_0x2146d1,_0x25214b,_0x1b6881){var _0x3b83f1={'agent':{},'channel':_0xa175('0x7c')};if(_0x2146d1[_0xa175('0x51')]['id']){delete _0x2146d1[_0xa175('0x51')]['id'];}_0x2146d1[_0xa175('0x51')]['UserId']=_0x2146d1['body'][_0xa175('0x6d')]||_0x2146d1[_0xa175('0x5e')]['id'];_0x3b83f1['agent']['id']=_0x2146d1[_0xa175('0x51')][_0xa175('0x6d')];return db[_0xa175('0x38')]['find']({'where':{'id':_0x2146d1[_0xa175('0x4d')]['id'],'UserId':null}})[_0xa175('0x1d')](handleEntityNotFound(_0x25214b,null))['then'](function(_0x2991fc){if(_0x2991fc){_0x3b83f1[_0xa175('0x26')]=_0x2991fc[_0xa175('0x70')]({'plain':!![]});return db[_0xa175('0x71')][_0xa175('0x50')]({'where':{'id':_0x2991fc[_0xa175('0x72')]}});}return null;})['then'](handleEntityNotFound(_0x25214b,null))[_0xa175('0x1d')](function(_0x366dd9){if(_0x366dd9){_0x3b83f1['interaction']=_0x366dd9['get']({'plain':!![]});interaction_log[_0xa175('0x1e')](_0xa175('0x7d'),_0x2146d1[_0xa175('0x5e')]['id'],_0x2146d1['user']['name'],_0x2146d1[_0xa175('0x5e')][_0xa175('0x75')],_0x3b83f1[_0xa175('0x74')]['id'],_0x2146d1['body']?JSON[_0xa175('0x23')](_0x2146d1[_0xa175('0x51')]):_0xa175('0x76'));return respondWithRpcPromise(_0xa175('0x7e'),_0xa175('0x7f'),_0x3b83f1);}return null;})[_0xa175('0x1d')](function(_0xaed428){if(_0xaed428){_0xaed428[_0xa175('0x26')]['interface']=util[_0xa175('0x68')](_0xa175('0x80'),_0x2146d1['user'][_0xa175('0x35')]);_0xaed428[_0xa175('0x26')][_0xa175('0x79')]=_0x3b83f1['channel'];_0xaed428[_0xa175('0x26')][_0xa175('0x81')]=_0xa175('0x30');respondWithRpcPromise('EventManager',_0xa175('0x7a'),{'event':_0xa175('0x82'),'message':_0xaed428['message']},client9002);return _0x3b83f1;}return null;})['then'](respondWithResult(_0x25214b,null))[_0xa175('0x28')](handleError(_0x25214b,null));};exports[_0xa175('0x83')]=function(_0x6c5470,_0x4c9aab){var _0x509bee=moment()[_0xa175('0x84')]()[_0xa175('0x85')]();var _0x28a177=path[_0xa175('0x62')](config[_0xa175('0x63')],_0xa175('0x86'),_0xa175('0x87'),'tmp');var _0x2d4289=path[_0xa175('0x62')](config[_0xa175('0x63')],_0xa175('0x86'),_0xa175('0x87'),_0xa175('0x61'));var _0xa4e177=util[_0xa175('0x68')](_0xa175('0x88'),_0x509bee);return db[_0xa175('0x38')][_0xa175('0x50')]({'where':{'id':_0x6c5470['params']['id']},'attributes':['id','body','from','to','cc',_0xa175('0x89'),_0xa175('0x8a'),_0xa175('0x8b')],'include':_0x6c5470[_0xa175('0x3a')][_0xa175('0x61')]?[{'model':db[_0xa175('0x8c')],'as':_0xa175('0x8d')}]:undefined})[_0xa175('0x1d')](handleEntityNotFound(_0x4c9aab,null))[_0xa175('0x1d')](function(_0x3f40a4){if(_0x3f40a4){var _0x2659b1=_0x3f40a4;var _0x5b57d2={'from':_0x2659b1[_0xa175('0x8e')],'to':_0x2659b1['to'],'subject':_0x2659b1[_0xa175('0x8a')],'html':_0x2659b1[_0xa175('0x51')],'headers':{'Date':moment(_0x2659b1[_0xa175('0x8b')])['format'](_0xa175('0x8f'))},'attachments':[]};if(_0x3f40a4['cc']){_0x5b57d2[_0xa175('0x90')]['Cc']=_0x3f40a4['cc'];}if(_0x3f40a4[_0xa175('0x89')]){_0x5b57d2[_0xa175('0x90')]['Bcc']=_0x3f40a4[_0xa175('0x89')];}return new BPromise(function(_0x48bf7a,_0x4a6d3f){if(_0x3f40a4[_0xa175('0x8d')]){for(var _0x1d1283=0x0;_0x1d1283<_0x3f40a4[_0xa175('0x8d')][_0xa175('0x4f')];_0x1d1283++){var _0x5684ed=_0x3f40a4[_0xa175('0x8d')][_0x1d1283];var _0x41028d=path[_0xa175('0x62')](_0x2d4289,_0x5684ed['basename']);if(fs[_0xa175('0x91')](_0x41028d)){_0x5b57d2[_0xa175('0x61')]['push']({'name':_0x5684ed[_0xa175('0x35')],'contentType':_0x5684ed[_0xa175('0x44')],'data':fs['readFileSync'](_0x41028d)});}}}emlformat[_0xa175('0x92')](_0x5b57d2,function(_0x3c1b25,_0xace5d8){if(_0x3c1b25)return _0x4a6d3f(_0x3c1b25);fs[_0xa175('0x93')](path[_0xa175('0x62')](_0x28a177,_0xa4e177),_0xace5d8);return _0x48bf7a(_0xace5d8);});});}})['then'](function(_0x829fea){if(_0x829fea){return _0x4c9aab[_0xa175('0x83')](path[_0xa175('0x62')](_0x28a177,_0xa4e177),_0xa4e177,function(_0x5d745b){if(_0x5d745b){console['log']('err',_0x5d745b);}else{fs[_0xa175('0x94')](path[_0xa175('0x62')](_0x28a177,_0xa4e177));}});}})['catch'](handleError(_0x4c9aab,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index f2156a9..b961d14 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 _0x0886=['events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x52e0ee,_0x52f7c1){var _0x32534c=function(_0x535d65){while(--_0x535d65){_0x52e0ee['push'](_0x52e0ee['shift']());}};_0x32534c(++_0x52f7c1);}(_0x0886,0xd8));var _0x6088=function(_0x37350b,_0x3ded74){_0x37350b=_0x37350b-0x0;var _0x2d0dfd=_0x0886[_0x37350b];return _0x2d0dfd;};'use strict';var EventEmitter=require(_0x6088('0x0'));var MailMessage=require(_0x6088('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x6088('0x2')](0x0);var events={'afterCreate':_0x6088('0x3'),'afterUpdate':'update','afterDestroy':_0x6088('0x4')};function emitEvent(_0x1dbf89){return function(_0x52823f,_0x277879,_0x27541c){MailMessageEvents[_0x6088('0x5')](_0x1dbf89+':'+_0x52823f['id'],_0x52823f);MailMessageEvents[_0x6088('0x5')](_0x1dbf89,_0x52823f);_0x27541c(null);};}for(var e in events){if(events[_0x6088('0x6')](e)){var event=events[e];MailMessage[_0x6088('0x7')](e,emitEvent(event));}}module[_0x6088('0x8')]=MailMessageEvents; \ No newline at end of file +var _0x2ac3=['emit','events','../../mysqldb','MailMessage','update','remove'];(function(_0x1f3bba,_0x30341c){var _0xefe300=function(_0x18d577){while(--_0x18d577){_0x1f3bba['push'](_0x1f3bba['shift']());}};_0xefe300(++_0x30341c);}(_0x2ac3,0x1e7));var _0x32ac=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x2ac3[_0x21a9d9];return _0x46adce;};'use strict';var EventEmitter=require(_0x32ac('0x0'));var MailMessage=require(_0x32ac('0x1'))['db'][_0x32ac('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x32ac('0x3'),'afterDestroy':_0x32ac('0x4')};function emitEvent(_0x4deb04){return function(_0x1797a1,_0x58301c,_0x53a566){MailMessageEvents['emit'](_0x4deb04+':'+_0x1797a1['id'],_0x1797a1);MailMessageEvents[_0x32ac('0x5')](_0x4deb04,_0x1797a1);_0x53a566(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index ff6ba42..005118a 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 _0x73e6=['findOne','MailInteractionId','then','update','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','exports','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','fromString','body','models','get','toLowerCase','direction','out','secret','isNil','UserId','MailInteraction'];(function(_0x1793de,_0x4d7233){var _0x4f0309=function(_0x229ee7){while(--_0x229ee7){_0x1793de['push'](_0x1793de['shift']());}};_0x4f0309(++_0x4d7233);}(_0x73e6,0x8a));var _0x673e=function(_0x59bad4,_0x504318){_0x59bad4=_0x59bad4-0x0;var _0x2b4fde=_0x73e6[_0x59bad4];return _0x2b4fde;};'use strict';var _=require('lodash');var util=require(_0x673e('0x0'));var logger=require(_0x673e('0x1'))('api');var moment=require('moment');var BPromise=require(_0x673e('0x2'));var rp=require(_0x673e('0x3'));var htmlToText=require(_0x673e('0x4'));var fs=require('fs');var path=require(_0x673e('0x5'));var rimraf=require(_0x673e('0x6'));var config=require(_0x673e('0x7'));var attributes=require('./mailMessage.attributes');module[_0x673e('0x8')]=function(_0x443c97,_0x8cc3c5){return _0x443c97['define'](_0x673e('0x9'),attributes,{'tableName':_0x673e('0xa'),'paranoid':![],'indexes':[{'name':_0x673e('0xb'),'fields':[_0x673e('0xb')]},{'name':_0x673e('0xc'),'fields':[_0x673e('0xd'),_0x673e('0xe')],'type':_0x673e('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5a6737,_0x3a0304,_0x3a49fa){if(_0x5a6737['body']){_0x5a6737[_0x673e('0xd')]=htmlToText[_0x673e('0x10')](_0x5a6737[_0x673e('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x3a49fa(null,_0x3a0304);},'afterCreate':function(_0x17cf3c,_0x494ff5,_0x1da4cf){var _0x364741=_0x443c97[_0x673e('0x12')];var _0x297486=_0x17cf3c[_0x673e('0x13')]({'plain':!![]});if(_0x297486['direction'][_0x673e('0x14')]()==='in'||_0x297486[_0x673e('0x15')]['toLowerCase']()===_0x673e('0x16')&&!_0x297486[_0x673e('0x17')]&&!_[_0x673e('0x18')](_0x297486[_0x673e('0x19')])){_0x364741[_0x673e('0x1a')][_0x673e('0x1b')]({'where':{'id':_0x297486[_0x673e('0x1c')]}})[_0x673e('0x1d')](function(_0x4a44ac){if(_0x4a44ac){_0x4a44ac[_0x673e('0x1e')]({'lastMsgAt':_0x297486['createdAt'],'lastMsgDirection':_0x297486['direction']['toLowerCase'](),'lastMsgBody':_0x297486['body']});}})['catch'](function(_0x16620b){console['error'](_0x16620b);});}_0x1da4cf();}},'charset':_0x673e('0x1f'),'collate':_0x673e('0x20')});}; \ No newline at end of file +var _0x4f00=['plainBody','subject','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','exports','MailMessage','mail_messages','messageId','fti_mail_messages'];(function(_0x2d80a9,_0x13412a){var _0x3bc88d=function(_0x4a2289){while(--_0x4a2289){_0x2d80a9['push'](_0x2d80a9['shift']());}};_0x3bc88d(++_0x13412a);}(_0x4f00,0x13c));var _0x04f0=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x4f00[_0x543084];return _0x306a57;};'use strict';var _=require('lodash');var util=require(_0x04f0('0x0'));var logger=require(_0x04f0('0x1'))(_0x04f0('0x2'));var moment=require('moment');var BPromise=require(_0x04f0('0x3'));var rp=require(_0x04f0('0x4'));var htmlToText=require(_0x04f0('0x5'));var fs=require('fs');var path=require(_0x04f0('0x6'));var rimraf=require(_0x04f0('0x7'));var config=require(_0x04f0('0x8'));var attributes=require('./mailMessage.attributes');module[_0x04f0('0x9')]=function(_0x4f2ca0,_0x4b866c){return _0x4f2ca0['define'](_0x04f0('0xa'),attributes,{'tableName':_0x04f0('0xb'),'paranoid':![],'indexes':[{'name':_0x04f0('0xc'),'fields':['messageId']},{'name':_0x04f0('0xd'),'fields':[_0x04f0('0xe'),_0x04f0('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x263843,_0x420707,_0x115d5d){if(_0x263843[_0x04f0('0x10')]){_0x263843[_0x04f0('0xe')]=htmlToText['fromString'](_0x263843[_0x04f0('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x115d5d(null,_0x420707);},'afterCreate':function(_0x3cc0ee,_0x154168,_0x2fdaeb){var _0x24ad50=_0x4f2ca0[_0x04f0('0x11')];var _0x48bfd1=_0x3cc0ee[_0x04f0('0x12')]({'plain':!![]});if(_0x48bfd1[_0x04f0('0x13')][_0x04f0('0x14')]()==='in'||_0x48bfd1[_0x04f0('0x13')][_0x04f0('0x14')]()===_0x04f0('0x15')&&!_0x48bfd1[_0x04f0('0x16')]&&!_[_0x04f0('0x17')](_0x48bfd1[_0x04f0('0x18')])){_0x24ad50[_0x04f0('0x19')][_0x04f0('0x1a')]({'where':{'id':_0x48bfd1[_0x04f0('0x1b')]}})['then'](function(_0x272558){if(_0x272558){_0x272558[_0x04f0('0x1c')]({'lastMsgAt':_0x48bfd1[_0x04f0('0x1d')],'lastMsgDirection':_0x48bfd1[_0x04f0('0x13')][_0x04f0('0x14')](),'lastMsgBody':_0x48bfd1[_0x04f0('0x10')]});}})[_0x04f0('0x1e')](function(_0x4b9e5e){console['error'](_0x4b9e5e);});}_0x2fdaeb();}},'charset':_0x04f0('0x1f'),'collate':_0x04f0('0x20')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index ec2ee5a..91d78c8 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 _0x2e65=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateMailMessage','create','body','options','raw','debug','stringify','lodash','util','moment','bluebird'];(function(_0x454cd6,_0x17cce0){var _0x5d6858=function(_0x1f3fc3){while(--_0x1f3fc3){_0x454cd6['push'](_0x454cd6['shift']());}};_0x5d6858(++_0x17cce0);}(_0x2e65,0x193));var _0x52e6=function(_0x1a89a1,_0x56d889){_0x1a89a1=_0x1a89a1-0x0;var _0x3d5b46=_0x2e65[_0x1a89a1];return _0x3d5b46;};'use strict';var _=require(_0x52e6('0x0'));var util=require(_0x52e6('0x1'));var moment=require(_0x52e6('0x2'));var BPromise=require(_0x52e6('0x3'));var rs=require(_0x52e6('0x4'));var fs=require('fs');var Redis=require(_0x52e6('0x5'));var db=require(_0x52e6('0x6'))['db'];var utils=require(_0x52e6('0x7'));var logger=require('../../config/logger')(_0x52e6('0x8'));var config=require(_0x52e6('0x9'));var jayson=require(_0x52e6('0xa'));var client=jayson[_0x52e6('0xb')][_0x52e6('0xc')]({'port':0x232a});config[_0x52e6('0xd')]=_[_0x52e6('0xe')](config[_0x52e6('0xd')],{'host':_0x52e6('0xf'),'port':0x18eb});var socket=require(_0x52e6('0x10'))(new Redis(config['redis']));require(_0x52e6('0x11'))[_0x52e6('0x12')](socket);function respondWithRpcPromise(_0x556442,_0x330040,_0x543f78){return new BPromise(function(_0x52b3ee,_0x471d57){return client[_0x52e6('0x13')](_0x556442,_0x543f78)[_0x52e6('0x14')](function(_0x465542){logger[_0x52e6('0x15')](_0x52e6('0x16'),_0x330040,'request\x20sent');logger['debug'](_0x52e6('0x17'),_0x330040,_0x52e6('0x18'),JSON['stringify'](_0x465542));if(_0x465542[_0x52e6('0x19')]){if(_0x465542[_0x52e6('0x19')][_0x52e6('0x1a')]===0x1f4){logger[_0x52e6('0x19')](_0x52e6('0x16'),_0x330040,_0x465542[_0x52e6('0x19')][_0x52e6('0x1b')]);return _0x471d57(_0x465542[_0x52e6('0x19')][_0x52e6('0x1b')]);}logger[_0x52e6('0x19')](_0x52e6('0x16'),_0x330040,_0x465542[_0x52e6('0x19')][_0x52e6('0x1b')]);return _0x52b3ee(_0x465542[_0x52e6('0x19')]['message']);}else{logger[_0x52e6('0x15')]('MailMessage,\x20%s,\x20%s',_0x330040,'request\x20sent');_0x52b3ee(_0x465542[_0x52e6('0x1c')][_0x52e6('0x1b')]);}})[_0x52e6('0x1d')](function(_0x538568){logger[_0x52e6('0x19')]('MailMessage,\x20%s,\x20%s',_0x330040,_0x538568);_0x471d57(_0x538568);});});}exports[_0x52e6('0x1e')]=function(_0x2a07ea){var _0x3cf7f0=this;return new Promise(function(_0x59aaa2,_0xf2df3){return db['MailMessage'][_0x52e6('0x1f')](_0x2a07ea[_0x52e6('0x20')],{'raw':_0x2a07ea[_0x52e6('0x21')]?_0x2a07ea['options'][_0x52e6('0x22')]===undefined?!![]:![]:!![]})[_0x52e6('0x14')](function(_0x5f004e){logger['info']('CreateMailMessage',_0x2a07ea);logger[_0x52e6('0x23')]('CreateMailMessage',_0x2a07ea,JSON[_0x52e6('0x24')](_0x5f004e));_0x59aaa2(_0x5f004e);})[_0x52e6('0x1d')](function(_0x12fdb7){logger[_0x52e6('0x19')](_0x52e6('0x1e'),_0x12fdb7['message'],_0x2a07ea);_0xf2df3(_0x3cf7f0[_0x52e6('0x19')](0x1f4,_0x12fdb7['message']));});});}; \ No newline at end of file +var _0xeedf=['lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','socket.io-emitter','request','then','info','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','MailMessage,\x20%s,\x20%s','message','result','catch','CreateMailMessage','MailMessage','create','body','options','raw'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeedf,0x12c));var _0xfeed=function(_0x4a8a29,_0x5e6fce){_0x4a8a29=_0x4a8a29-0x0;var _0x1223dc=_0xeedf[_0x4a8a29];return _0x1223dc;};'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('./mailMessage.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')]('MailMessage,\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')](_0x2e6f00[_0xfeed('0x1b')],{'raw':_0x2e6f00['options']?_0x2e6f00[_0xfeed('0x1c')][_0xfeed('0x1d')]===undefined?!![]:![]:!![]})[_0xfeed('0xd')](function(_0x295f86){logger[_0xfeed('0xe')](_0xfeed('0x18'),_0x2e6f00);logger[_0xfeed('0xf')](_0xfeed('0x18'),_0x2e6f00,JSON[_0xfeed('0x12')](_0x295f86));_0x39bb8d(_0x295f86);})[_0xfeed('0x17')](function(_0x7de39a){logger[_0xfeed('0x13')](_0xfeed('0x18'),_0x7de39a[_0xfeed('0x15')],_0x2e6f00);_0x4f8e36(_0x44c182['error'](0x1f4,_0x7de39a['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 84dfc61..ea1ae5c 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 _0x3ad8=['removeListener','register','length','mailMessage:','./mailMessage.events','save','emit'];(function(_0x4c1704,_0xd18810){var _0x405e0e=function(_0x63416f){while(--_0x63416f){_0x4c1704['push'](_0x4c1704['shift']());}};_0x405e0e(++_0xd18810);}(_0x3ad8,0x1cb));var _0x83ad=function(_0x1e53f7,_0x2bce9c){_0x1e53f7=_0x1e53f7-0x0;var _0x1cdbce=_0x3ad8[_0x1e53f7];return _0x1cdbce;};'use strict';var MailMessageEvents=require(_0x83ad('0x0'));var events=[_0x83ad('0x1'),'remove','update'];function createListener(_0x3b423e,_0x471980){return function(_0x167a49){_0x471980[_0x83ad('0x2')](_0x3b423e,_0x167a49);};}function removeListener(_0x32a14f,_0x75ac20){return function(){MailMessageEvents[_0x83ad('0x3')](_0x32a14f,_0x75ac20);};}exports[_0x83ad('0x4')]=function(_0x5af077){for(var _0x39d198=0x0,_0x3b5eed=events[_0x83ad('0x5')];_0x39d198<_0x3b5eed;_0x39d198++){var _0x3cbd86=events[_0x39d198];var _0x540f35=createListener(_0x83ad('0x6')+_0x3cbd86,_0x5af077);MailMessageEvents['on'](_0x3cbd86,_0x540f35);}}; \ No newline at end of file +var _0x5d59=['register','length','mailMessage:','save','remove','update'];(function(_0x2b16c3,_0xc4515e){var _0x24b95d=function(_0x24e470){while(--_0x24e470){_0x2b16c3['push'](_0x2b16c3['shift']());}};_0x24b95d(++_0xc4515e);}(_0x5d59,0x15f));var _0x95d5=function(_0x3ed0ec,_0x44ece7){_0x3ed0ec=_0x3ed0ec-0x0;var _0x4b32f4=_0x5d59[_0x3ed0ec];return _0x4b32f4;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0x95d5('0x0'),_0x95d5('0x1'),_0x95d5('0x2')];function createListener(_0x3155df,_0x3c0e16){return function(_0x1ce27f){_0x3c0e16['emit'](_0x3155df,_0x1ce27f);};}function removeListener(_0x133b43,_0x502a01){return function(){MailMessageEvents['removeListener'](_0x133b43,_0x502a01);};}exports[_0x95d5('0x3')]=function(_0x4a733e){for(var _0x4b4e5f=0x0,_0xfe94c=events[_0x95d5('0x4')];_0x4b4e5f<_0xfe94c;_0x4b4e5f++){var _0x121537=events[_0x4b4e5f];var _0x489fab=createListener(_0x95d5('0x5')+_0x121537,_0x4a733e);MailMessageEvents['on'](_0x121537,_0x489fab);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index b606d8b..e86f5c7 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 _0x03f9=['removeAgents','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','addTeams','post','addAgents','put','delete','removeTeams'];(function(_0x274bc1,_0x47543d){var _0x4d69fc=function(_0x3c4c36){while(--_0x3c4c36){_0x274bc1['push'](_0x274bc1['shift']());}};_0x4d69fc(++_0x47543d);}(_0x03f9,0x17b));var _0x903f=function(_0x5e72dc,_0xa12f95){_0x5e72dc=_0x5e72dc-0x0;var _0x197a74=_0x03f9[_0x5e72dc];return _0x197a74;};'use strict';var multer=require(_0x903f('0x0'));var util=require(_0x903f('0x1'));var path=require(_0x903f('0x2'));var timeout=require('connect-timeout');var express=require(_0x903f('0x3'));var router=express['Router']();var auth=require(_0x903f('0x4'));var interaction=require(_0x903f('0x5'));var config=require(_0x903f('0x6'));var controller=require(_0x903f('0x7'));router[_0x903f('0x8')]('/',auth[_0x903f('0x9')](),controller[_0x903f('0xa')]);router['get'](_0x903f('0xb'),auth[_0x903f('0x9')](),controller[_0x903f('0xc')]);router[_0x903f('0x8')](_0x903f('0xd'),auth[_0x903f('0x9')](),controller[_0x903f('0xe')]);router[_0x903f('0x8')](_0x903f('0xf'),auth[_0x903f('0x9')](),controller[_0x903f('0x10')]);router[_0x903f('0x8')](_0x903f('0x11'),auth[_0x903f('0x9')](),controller[_0x903f('0x12')]);router[_0x903f('0x8')](_0x903f('0x13'),auth[_0x903f('0x9')](),controller[_0x903f('0x14')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x903f('0x11'),auth[_0x903f('0x9')](),controller[_0x903f('0x15')]);router[_0x903f('0x16')](_0x903f('0x13'),auth[_0x903f('0x9')](),controller[_0x903f('0x17')]);router[_0x903f('0x18')](_0x903f('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x903f('0x19')]('/:id',auth[_0x903f('0x9')](),controller['destroy']);router['delete']('/:id/teams',auth[_0x903f('0x9')](),controller[_0x903f('0x1a')]);router[_0x903f('0x19')]('/:id/users',auth[_0x903f('0x9')](),controller[_0x903f('0x1b')]);module[_0x903f('0x1c')]=router; \ No newline at end of file +var _0x3231=['getAgents','create','post','addTeams','put','/:id','update','delete','/:id/teams','removeAgents','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','show','getTeams','/:id/users'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x3231,0x107));var _0x1323=function(_0x24b7c5,_0x575489){_0x24b7c5=_0x24b7c5-0x0;var _0x2acc69=_0x3231[_0x24b7c5];return _0x2acc69;};'use strict';var multer=require(_0x1323('0x0'));var util=require(_0x1323('0x1'));var path=require('path');var timeout=require(_0x1323('0x2'));var express=require(_0x1323('0x3'));var router=express[_0x1323('0x4')]();var auth=require(_0x1323('0x5'));var interaction=require(_0x1323('0x6'));var config=require(_0x1323('0x7'));var controller=require('./mailQueue.controller');router['get']('/',auth[_0x1323('0x8')](),controller['index']);router[_0x1323('0x9')]('/describe',auth[_0x1323('0x8')](),controller['describe']);router[_0x1323('0x9')]('/:id',auth[_0x1323('0x8')](),controller[_0x1323('0xa')]);router[_0x1323('0x9')]('/:id/members',auth[_0x1323('0x8')](),controller['getMembers']);router[_0x1323('0x9')]('/:id/teams',auth['isAuthenticated'](),controller[_0x1323('0xb')]);router['get'](_0x1323('0xc'),auth[_0x1323('0x8')](),controller[_0x1323('0xd')]);router['post']('/',auth[_0x1323('0x8')](),controller[_0x1323('0xe')]);router[_0x1323('0xf')]('/:id/teams',auth[_0x1323('0x8')](),controller[_0x1323('0x10')]);router['post'](_0x1323('0xc'),auth[_0x1323('0x8')](),controller['addAgents']);router[_0x1323('0x11')](_0x1323('0x12'),auth[_0x1323('0x8')](),controller[_0x1323('0x13')]);router[_0x1323('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x1323('0x14')](_0x1323('0x15'),auth[_0x1323('0x8')](),controller['removeTeams']);router[_0x1323('0x14')](_0x1323('0xc'),auth[_0x1323('0x8')](),controller[_0x1323('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 94b45fc..30c7684 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 _0xbaef=['rrmemory','beepall','roundrobin','STRING','name','INTEGER','ENUM'];(function(_0x90b65b,_0xff9dca){var _0x5b919f=function(_0x139e54){while(--_0x139e54){_0x90b65b['push'](_0x90b65b['shift']());}};_0x5b919f(++_0xff9dca);}(_0xbaef,0x1ca));var _0xfbae=function(_0x840106,_0x59c538){_0x840106=_0x840106-0x0;var _0x41edcd=_0xbaef[_0x840106];return _0x41edcd;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xfbae('0x0')],'unique':_0xfbae('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xfbae('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfbae('0x3')](_0xfbae('0x4'),_0xfbae('0x5'),_0xfbae('0x6'))}}; \ No newline at end of file +var _0xb746=['INTEGER','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0xb746,0x159));var _0x6b74=function(_0x3cafdf,_0x19e228){_0x3cafdf=_0x3cafdf-0x0;var _0x5d4d7a=_0xb746[_0x3cafdf];return _0x5d4d7a;};'use strict';var Sequelize=require(_0x6b74('0x0'));module[_0x6b74('0x1')]={'name':{'type':Sequelize[_0x6b74('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6b74('0x2')]},'timeout':{'type':Sequelize[_0x6b74('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x6b74('0x4'),_0x6b74('0x5'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 8fe5e49..57643e9 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 _0x08f1=['teams','Agents','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','removeTeams','select','tq.TeamId','from','team_has_mail_queues','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','every','TeamId','includes','all','compact','value','ids','isEmpty','removeAgents','userMailQueue:remove','addAgents','emit','userMailQueue:save','isArray','getAgents','findOne','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','Content-Range','reject','save','update','then','destroy','get','MailQueues','UserProfileResource','error','name','send','MailQueue','rawAttributes','model','keys','query','intersection','fields','attributes','length','nolimit','limit','order','sort','filters','filter','where','map','type','key','VIRTUAL','field','merge','count','includeAll','include','findAll','rows','catch','show','params','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','describe','getMembers','UserMailQueue','MailQueueId','User','UserId','agent','mailPause','updatedAt','createdAt','Team','pick','hasOwnProperty','getTeams'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x08f1,0x136));var _0x108f=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x08f1[_0x432682];return _0x463d05;};'use strict';var pdf=require(_0x108f('0x0'));var emlformat=require(_0x108f('0x1'));var rimraf=require(_0x108f('0x2'));var zipdir=require(_0x108f('0x3'));var jsonpatch=require(_0x108f('0x4'));var rp=require('request-promise');var moment=require(_0x108f('0x5'));var BPromise=require(_0x108f('0x6'));var Mustache=require('mustache');var util=require(_0x108f('0x7'));var path=require('path');var sox=require(_0x108f('0x8'));var csv=require(_0x108f('0x9'));var ejs=require(_0x108f('0xa'));var fs=require('fs');var _=require(_0x108f('0xb'));var squel=require(_0x108f('0xc'));var crypto=require(_0x108f('0xd'));var jsforce=require(_0x108f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x108f('0x9'));var querystring=require('querystring');var Papa=require(_0x108f('0xf'));var Redis=require(_0x108f('0x10'));var authService=require(_0x108f('0x11'));var qs=require(_0x108f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x108f('0x13'))('api');var utils=require(_0x108f('0x14'));var config=require(_0x108f('0x15'));var db=require(_0x108f('0x16'))['db'];config[_0x108f('0x17')]=_[_0x108f('0x18')](config['redis'],{'host':_0x108f('0x19'),'port':0x18eb});var socket=require(_0x108f('0x1a'))(new Redis(config[_0x108f('0x17')]));require('./mailQueue.socket')[_0x108f('0x1b')](socket);function respondWithStatusCode(_0x563d6f,_0x56b37){_0x56b37=_0x56b37||0xcc;return function(_0x53d6a6){if(_0x53d6a6){return _0x563d6f[_0x108f('0x1c')](_0x56b37);}return _0x563d6f[_0x108f('0x1d')](_0x56b37)[_0x108f('0x1e')]();};}function respondWithResult(_0x2a7647,_0x5431f1){_0x5431f1=_0x5431f1||0xc8;return function(_0x35641b){if(_0x35641b){return _0x2a7647[_0x108f('0x1d')](_0x5431f1)[_0x108f('0x1f')](_0x35641b);}};}function respondWithFilteredResult(_0x55eff7,_0x53d189){return function(_0x414462){if(_0x414462){var _0x5c98df=_0x414462['count'],_0x3d9b9c=_0x53d189[_0x108f('0x20')],_0x38672c=_0x53d189[_0x108f('0x20')]+_0x53d189['limit'],_0x3939a8;if(_0x38672c>=_0x5c98df){_0x38672c=_0x5c98df;_0x3939a8=0xc8;}else{_0x3939a8=0xce;}_0x55eff7[_0x108f('0x1d')](_0x3939a8);return _0x55eff7['set'](_0x108f('0x21'),_0x3d9b9c+'-'+_0x38672c+'/'+_0x5c98df)[_0x108f('0x1f')](_0x414462);}return null;};}function patchUpdates(_0x563417){return function(_0x2ecef7){try{jsonpatch['apply'](_0x2ecef7,_0x563417,!![]);}catch(_0x20d0ae){return BPromise[_0x108f('0x22')](_0x20d0ae);}return _0x2ecef7[_0x108f('0x23')]();};}function saveUpdates(_0x3a86f2,_0x388439){return function(_0xc99ba3){if(_0xc99ba3){return _0xc99ba3[_0x108f('0x24')](_0x3a86f2)[_0x108f('0x25')](function(_0x864f81){return _0x864f81;});}return null;};}function removeEntity(_0x577a70,_0x2a5ecb){return function(_0x30d34e){if(_0x30d34e){return _0x30d34e[_0x108f('0x26')]()['then'](function(){var _0x4aa129=_0x30d34e[_0x108f('0x27')]({'plain':!![]});var _0x589a25=_0x108f('0x28');return db[_0x108f('0x29')][_0x108f('0x26')]({'where':{'type':_0x589a25,'resourceId':_0x4aa129['id']}})[_0x108f('0x25')](function(){return _0x30d34e;});})[_0x108f('0x25')](function(){_0x577a70[_0x108f('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f2acb,_0x31c32a){return function(_0x253455){if(!_0x253455){_0x4f2acb[_0x108f('0x1c')](0x194);}return _0x253455;};}function handleError(_0x70976,_0xb8510){_0xb8510=_0xb8510||0x1f4;return function(_0x495e8d){logger[_0x108f('0x2a')](_0x495e8d['stack']);if(_0x495e8d[_0x108f('0x2b')]){delete _0x495e8d[_0x108f('0x2b')];}_0x70976['status'](_0xb8510)[_0x108f('0x2c')](_0x495e8d);};}exports['index']=function(_0x30daec,_0x55dba5){var _0x5e7396={},_0x509aeb={},_0x23961e={'count':0x0,'rows':[]};var _0x5dc455=db[_0x108f('0x2d')][_0x108f('0x2e')];_0x509aeb[_0x108f('0x2f')]=_[_0x108f('0x30')](_0x5dc455);_0x509aeb['query']=_[_0x108f('0x30')](_0x30daec[_0x108f('0x31')]);_0x509aeb['filters']=_[_0x108f('0x32')](_0x509aeb[_0x108f('0x2f')],_0x509aeb[_0x108f('0x31')]);_0x5e7396['attributes']=_[_0x108f('0x32')](_0x509aeb['model'],qs[_0x108f('0x33')](_0x30daec[_0x108f('0x31')][_0x108f('0x33')]));_0x5e7396[_0x108f('0x34')]=_0x5e7396[_0x108f('0x34')][_0x108f('0x35')]?_0x5e7396[_0x108f('0x34')]:_0x509aeb[_0x108f('0x2f')];if(!_0x30daec[_0x108f('0x31')]['hasOwnProperty'](_0x108f('0x36'))){_0x5e7396[_0x108f('0x37')]=qs[_0x108f('0x37')](_0x30daec[_0x108f('0x31')][_0x108f('0x37')]);_0x5e7396[_0x108f('0x20')]=qs[_0x108f('0x20')](_0x30daec['query'][_0x108f('0x20')]);}_0x5e7396[_0x108f('0x38')]=qs[_0x108f('0x39')](_0x30daec[_0x108f('0x31')]['sort']);_0x5e7396['where']=qs[_0x108f('0x3a')](_['pick'](_0x30daec[_0x108f('0x31')],_0x509aeb[_0x108f('0x3a')]));if(_0x30daec[_0x108f('0x31')][_0x108f('0x3b')]){_0x5e7396['where']=_['merge'](_0x5e7396[_0x108f('0x3c')],{'$or':_[_0x108f('0x3d')](_0x5dc455,function(_0x2fd2ce){if(_0x2fd2ce[_0x108f('0x3e')][_0x108f('0x3f')]!==_0x108f('0x40')){var _0x4f772e={};_0x4f772e[_0x2fd2ce[_0x108f('0x41')]]={'$like':'%'+_0x30daec[_0x108f('0x31')]['filter']+'%'};return _0x4f772e;}})});}_0x5e7396=_[_0x108f('0x42')]({},_0x5e7396,_0x30daec['options']);var _0x2fb61b={'where':_0x5e7396['where']};return db['MailQueue'][_0x108f('0x43')](_0x2fb61b)['then'](function(_0x579210){_0x23961e[_0x108f('0x43')]=_0x579210;if(_0x30daec[_0x108f('0x31')][_0x108f('0x44')]){_0x5e7396[_0x108f('0x45')]=[{'all':!![]}];}return db[_0x108f('0x2d')][_0x108f('0x46')](_0x5e7396);})[_0x108f('0x25')](function(_0x2f7d93){_0x23961e[_0x108f('0x47')]=_0x2f7d93;return _0x23961e;})[_0x108f('0x25')](respondWithFilteredResult(_0x55dba5,_0x5e7396))[_0x108f('0x48')](handleError(_0x55dba5,null));};exports[_0x108f('0x49')]=function(_0x136691,_0x249305){var _0x3b10ef={'raw':!![],'where':{'id':_0x136691[_0x108f('0x4a')]['id']}},_0x3ecd5b={};_0x3ecd5b[_0x108f('0x2f')]=_[_0x108f('0x30')](db['MailQueue'][_0x108f('0x2e')]);_0x3ecd5b[_0x108f('0x31')]=_[_0x108f('0x30')](_0x136691[_0x108f('0x31')]);_0x3ecd5b[_0x108f('0x3a')]=_[_0x108f('0x32')](_0x3ecd5b['model'],_0x3ecd5b[_0x108f('0x31')]);_0x3b10ef[_0x108f('0x34')]=_[_0x108f('0x32')](_0x3ecd5b[_0x108f('0x2f')],qs[_0x108f('0x33')](_0x136691[_0x108f('0x31')][_0x108f('0x33')]));_0x3b10ef[_0x108f('0x34')]=_0x3b10ef[_0x108f('0x34')][_0x108f('0x35')]?_0x3b10ef['attributes']:_0x3ecd5b[_0x108f('0x2f')];if(_0x136691[_0x108f('0x31')][_0x108f('0x44')]){_0x3b10ef[_0x108f('0x45')]=[{'all':!![]}];}_0x3b10ef=_[_0x108f('0x42')]({},_0x3b10ef,_0x136691[_0x108f('0x4b')]);return db[_0x108f('0x2d')]['find'](_0x3b10ef)[_0x108f('0x25')](handleEntityNotFound(_0x249305,null))[_0x108f('0x25')](respondWithResult(_0x249305,null))['catch'](handleError(_0x249305,null));};exports['create']=function(_0x53668b,_0x228205){return db['MailQueue'][_0x108f('0x4c')](_0x53668b[_0x108f('0x4d')],{})[_0x108f('0x25')](function(_0x35e85a){var _0x4596a9=_0x53668b[_0x108f('0x4e')]['get']({'plain':!![]});if(!_0x4596a9)throw new Error(_0x108f('0x4f'));if(_0x4596a9[_0x108f('0x50')]===_0x108f('0x4e')){var _0xf34279=_0x35e85a['get']({'plain':!![]});var _0xc82135=_0x108f('0x28');return db[_0x108f('0x51')][_0x108f('0x52')]({'where':{'name':_0xc82135,'userProfileId':_0x4596a9[_0x108f('0x53')]},'raw':!![]})[_0x108f('0x25')](function(_0x325d00){if(_0x325d00&&_0x325d00['autoAssociation']===0x0){return db[_0x108f('0x29')]['create']({'name':_0xf34279['name'],'resourceId':_0xf34279['id'],'type':_0x325d00[_0x108f('0x2b')],'sectionId':_0x325d00['id']},{})[_0x108f('0x25')](function(){return _0x35e85a;});}else{return _0x35e85a;}})[_0x108f('0x48')](function(_0x4a5ca8){logger[_0x108f('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a5ca8);throw _0x4a5ca8;});}return _0x35e85a;})['then'](respondWithResult(_0x228205,0xc9))['catch'](handleError(_0x228205,null));};exports[_0x108f('0x24')]=function(_0x9c9112,_0x12ebaa){if(_0x9c9112['body']['id']){delete _0x9c9112['body']['id'];}return db['MailQueue'][_0x108f('0x52')]({'where':{'id':_0x9c9112[_0x108f('0x4a')]['id']}})[_0x108f('0x25')](handleEntityNotFound(_0x12ebaa,null))[_0x108f('0x25')](saveUpdates(_0x9c9112[_0x108f('0x4d')],null))[_0x108f('0x25')](respondWithResult(_0x12ebaa,null))[_0x108f('0x48')](handleError(_0x12ebaa,null));};exports[_0x108f('0x26')]=function(_0x2d6634,_0x5b9700){return db['MailQueue'][_0x108f('0x52')]({'where':{'id':_0x2d6634[_0x108f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5b9700,null))[_0x108f('0x25')](removeEntity(_0x5b9700,null))[_0x108f('0x48')](handleError(_0x5b9700,null));};exports[_0x108f('0x54')]=function(_0x2eaca0,_0x4496d0){return db[_0x108f('0x2d')][_0x108f('0x54')]()['then'](respondWithResult(_0x4496d0,null))[_0x108f('0x48')](handleError(_0x4496d0,null));};exports[_0x108f('0x55')]=function(_0x4727a8,_0x5864ab,_0x5dced5){var _0x55568e={'raw':!![],'where':{}},_0x289050={},_0x472c1c;return db[_0x108f('0x2d')]['findOne']({'where':{'id':_0x4727a8[_0x108f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5864ab,null))['then'](function(_0xfcffae){if(_0xfcffae){_0x472c1c=_0xfcffae[_0x108f('0x27')]({'plain':!![]});_0x289050[_0x108f('0x2f')]=_[_0x108f('0x30')](db[_0x108f('0x56')][_0x108f('0x2e')]);_0x289050[_0x108f('0x31')]=_[_0x108f('0x30')](_0x4727a8[_0x108f('0x31')]);_0x289050[_0x108f('0x3a')]=_[_0x108f('0x32')](_0x289050['model'],_0x289050['query']);_0x55568e['attributes']=_['intersection'](_0x289050['model'],qs[_0x108f('0x33')](_0x4727a8[_0x108f('0x31')][_0x108f('0x33')]));_0x55568e[_0x108f('0x34')]=_0x55568e[_0x108f('0x34')][_0x108f('0x35')]?_0x55568e[_0x108f('0x34')]:_0x289050[_0x108f('0x2f')];if(!_0x4727a8[_0x108f('0x31')]['hasOwnProperty'](_0x108f('0x36'))){_0x55568e['limit']=qs[_0x108f('0x37')](_0x4727a8[_0x108f('0x31')][_0x108f('0x37')]);_0x55568e['offset']=qs[_0x108f('0x20')](_0x4727a8[_0x108f('0x31')][_0x108f('0x20')]);}_0x55568e[_0x108f('0x38')]=qs[_0x108f('0x39')](_0x4727a8[_0x108f('0x31')][_0x108f('0x39')]);_0x55568e[_0x108f('0x3c')]=qs['filters'](_['pick'](_0x4727a8[_0x108f('0x31')],_0x289050[_0x108f('0x3a')]));_0x55568e[_0x108f('0x3c')][_0x108f('0x57')]=_0xfcffae['id'];if(_0x4727a8[_0x108f('0x31')][_0x108f('0x3b')]){_0x55568e[_0x108f('0x3c')]=_[_0x108f('0x42')](_0x55568e[_0x108f('0x3c')],{'$or':_[_0x108f('0x3d')](_0x55568e[_0x108f('0x34')],function(_0x35d820){var _0x593542={};_0x593542[_0x35d820]={'$like':'%'+_0x4727a8[_0x108f('0x31')]['filter']+'%'};return _0x593542;})});}_0x55568e=_[_0x108f('0x42')]({},_0x55568e,_0x4727a8[_0x108f('0x4b')]);return db[_0x108f('0x56')][_0x108f('0x46')](_0x55568e);}})[_0x108f('0x25')](function(_0x519b0d){if(_0x519b0d){return db[_0x108f('0x58')]['findAndCountAll']({'where':{'id':_[_0x108f('0x3d')](_0x519b0d,_0x108f('0x59')),'role':_0x108f('0x5a')},'attributes':['id',_0x108f('0x2b'),_0x108f('0x5b'),_0x108f('0x5c'),_0x108f('0x5d')]});}})[_0x108f('0x25')](function(_0x142524){if(_0x142524){return{'count':_0x142524[_0x108f('0x43')],'rows':_['map'](_0x142524[_0x108f('0x47')],function(_0x320917){return{'membername':_0x320917[_0x108f('0x2b')],'UserId':_0x320917['id'],'queue_name':_0x472c1c['name'],'MailQueueId':_0x472c1c['id'],'interface':util['format']('%s/%s','SIP',_0x320917[_0x108f('0x2b')]),'penalty':0x0,'paused':_0x320917['mailPause'],'createdAt':_0x320917[_0x108f('0x5d')],'updatedAt':_0x320917[_0x108f('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x5864ab,_0x55568e))[_0x108f('0x48')](handleError(_0x5864ab,null));};exports['getTeams']=function(_0x14a6ed,_0x56fe43,_0x1f1b21){var _0x411899={};var _0x872ed5={};var _0x1b0de5;var _0x564e13;return db['MailQueue']['findOne']({'where':{'id':_0x14a6ed[_0x108f('0x4a')]['id']}})[_0x108f('0x25')](handleEntityNotFound(_0x56fe43,null))[_0x108f('0x25')](function(_0x4c7133){if(_0x4c7133){_0x1b0de5=_0x4c7133;_0x872ed5[_0x108f('0x2f')]=_['keys'](db[_0x108f('0x5e')][_0x108f('0x2e')]);_0x872ed5['query']=_[_0x108f('0x30')](_0x14a6ed[_0x108f('0x31')]);_0x872ed5['filters']=_['intersection'](_0x872ed5[_0x108f('0x2f')],_0x872ed5['query']);_0x411899['attributes']=_[_0x108f('0x32')](_0x872ed5[_0x108f('0x2f')],qs[_0x108f('0x33')](_0x14a6ed[_0x108f('0x31')][_0x108f('0x33')]));_0x411899[_0x108f('0x34')]=_0x411899['attributes'][_0x108f('0x35')]?_0x411899[_0x108f('0x34')]:_0x872ed5[_0x108f('0x2f')];_0x411899[_0x108f('0x38')]=qs[_0x108f('0x39')](_0x14a6ed[_0x108f('0x31')][_0x108f('0x39')]);_0x411899[_0x108f('0x3c')]=qs[_0x108f('0x3a')](_[_0x108f('0x5f')](_0x14a6ed[_0x108f('0x31')],_0x872ed5[_0x108f('0x3a')]));if(_0x14a6ed['query'][_0x108f('0x3b')]){_0x411899[_0x108f('0x3c')]=_[_0x108f('0x42')](_0x411899[_0x108f('0x3c')],{'$or':_['map'](_0x411899[_0x108f('0x34')],function(_0x5b5014){var _0x34a3c9={};_0x34a3c9[_0x5b5014]={'$like':'%'+_0x14a6ed['query']['filter']+'%'};return _0x34a3c9;})});}_0x411899=_['merge']({},_0x411899,_0x14a6ed[_0x108f('0x4b')]);return _0x1b0de5['getTeams'](_0x411899);}})['then'](function(_0xb872d4){if(_0xb872d4){_0x564e13=_0xb872d4[_0x108f('0x35')];if(!_0x14a6ed['query'][_0x108f('0x60')](_0x108f('0x36'))){_0x411899['limit']=qs['limit'](_0x14a6ed[_0x108f('0x31')]['limit']);_0x411899['offset']=qs[_0x108f('0x20')](_0x14a6ed[_0x108f('0x31')][_0x108f('0x20')]);}return _0x1b0de5[_0x108f('0x61')](_0x411899);}})[_0x108f('0x25')](function(_0xafd113){if(_0xafd113){return _0xafd113?{'count':_0x564e13,'rows':_0xafd113}:null;}})[_0x108f('0x25')](respondWithResult(_0x56fe43,null))['catch'](handleError(_0x56fe43,null));};exports['addTeams']=function(_0x3e4977,_0x4159b7,_0x3d683c){var _0x40c9c7=_0x3e4977['body'][_0x108f('0x62')];return db['Team'][_0x108f('0x46')]({'where':{'id':_[_0x108f('0x3d')](_0x40c9c7,'id')},'attributes':['id'],'include':[{'model':db[_0x108f('0x58')],'as':_0x108f('0x63'),'attributes':['id',_0x108f('0x2b'),'online',_0x108f('0x64'),_0x108f('0x65')],'raw':!![]}]})[_0x108f('0x25')](function(_0x2eff93){if(_0x2eff93){var _0x155c95=_[_0x108f('0x66')](_0x2eff93,function(_0x39cfc2){var _0x30fe5c=_0x39cfc2[_0x108f('0x27')]({'plain':!![]});return _0x30fe5c[_0x108f('0x63')];});return db['MailQueue'][_0x108f('0x52')]({'where':{'id':_0x3e4977[_0x108f('0x4a')]['id']}})[_0x108f('0x25')](function(_0x532920){return db[_0x108f('0x67')][_0x108f('0x68')](function(_0x3f5bbb){return _0x532920[_0x108f('0x69')](_[_0x108f('0x3d')](_0x40c9c7,'id'),{'transaction':_0x3f5bbb})['then'](function(){return BPromise[_0x108f('0x6a')](_0x155c95,function(_0x3f8106){return db[_0x108f('0x56')][_0x108f('0x6b')]({'where':{'UserId':_0x3f8106['id'],'MailQueueId':_0x3e4977['params']['id']},'transaction':_0x3f5bbb});});})[_0x108f('0x25')](function(){_0x155c95[_0x108f('0x6c')](function(_0x43ac95){socket['emit']('userMailQueue:save',{'UserId':_0x43ac95['id'],'MailQueueId':_0x532920['id']});});});});});}})['then'](respondWithStatusCode(_0x4159b7,null))[_0x108f('0x48')](handleError(_0x4159b7,null));};exports[_0x108f('0x6d')]=function(_0x1772aa,_0xfb3ea8,_0x2cfdcd){return db[_0x108f('0x5e')][_0x108f('0x46')]({'where':{'id':_0x1772aa[_0x108f('0x31')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xfb3ea8,null))[_0x108f('0x25')](function(_0x5ea3f6){var _0x1ddc08=_[_0x108f('0x3d')](_0x5ea3f6,'id');var _0x3ec671=[];var _0x450392=[];var _0x136516=squel[_0x108f('0x6e')]();_0x136516[_0x108f('0x41')](_0x108f('0x6f'))[_0x108f('0x70')](_0x108f('0x71'),'tq')[_0x108f('0x72')]('user_has_teams','ut',_0x108f('0x73'))[_0x108f('0x3c')](_0x108f('0x74'),_0x1772aa[_0x108f('0x4a')]['id']);for(var _0x59dace=0x0;_0x59dace<_0x5ea3f6[_0x108f('0x35')];_0x59dace+=0x1){let _0x4489d4=_0x5ea3f6[_0x59dace];for(var _0x2244b9=0x0;_0x2244b9<_0x4489d4[_0x108f('0x63')][_0x108f('0x35')];_0x2244b9+=0x1){let _0x4db4b0=_0x4489d4[_0x108f('0x63')][_0x2244b9];var _0x1f231f=_0x136516[_0x108f('0x75')]();_0x1f231f[_0x108f('0x3c')](_0x108f('0x76'),_0x4db4b0['id']);_0x450392[_0x108f('0x77')](db[_0x108f('0x67')]['query'](_0x1f231f['toString'](),{'type':db[_0x108f('0x67')]['QueryTypes']['SELECT']})[_0x108f('0x25')](function(_0x13cab3){if(_0x13cab3[_0x108f('0x35')]===0x1){return _0x4db4b0['id'];}else{var _0x12821a=_[_0x108f('0x78')](_[_0x108f('0x3d')](_0x13cab3,_0x108f('0x79')),function(_0x10a1bc){return _[_0x108f('0x7a')](_0x1ddc08,_0x10a1bc);});if(_0x12821a){return _0x4db4b0['id'];}}}));}}return BPromise[_0x108f('0x7b')](_0x450392)[_0x108f('0x25')](function(_0x24caf6){_0x3ec671=_(_0x3ec671)['union'](_0x24caf6)[_0x108f('0x7c')]()[_0x108f('0x7d')]();return db[_0x108f('0x2d')][_0x108f('0x52')]({'where':{'id':_0x1772aa[_0x108f('0x4a')]['id']}})[_0x108f('0x25')](function(_0x269935){return db[_0x108f('0x67')][_0x108f('0x68')](function(_0x36deeb){return _0x269935[_0x108f('0x6d')](_0x1772aa[_0x108f('0x31')][_0x108f('0x7e')],{'transaction':_0x36deeb})[_0x108f('0x25')](function(){if(!_[_0x108f('0x7f')](_0x3ec671)){return _0x269935[_0x108f('0x80')](_0x3ec671,{'transaction':_0x36deeb});}})['then'](function(){_0x3ec671[_0x108f('0x6c')](function(_0x3a6e0e){socket['emit'](_0x108f('0x81'),{'UserId':_0x3a6e0e,'MailQueueId':_0x269935['id']});});});});});});})[_0x108f('0x25')](respondWithStatusCode(_0xfb3ea8,null))[_0x108f('0x48')](handleError(_0xfb3ea8,null));};exports[_0x108f('0x82')]=function(_0x2566ed,_0x12e936,_0x2e2ffa){return db['MailQueue'][_0x108f('0x52')]({'where':{'id':_0x2566ed['params']['id']}})['then'](handleEntityNotFound(_0x12e936,null))[_0x108f('0x25')](function(_0x1e6627){if(_0x1e6627){return _0x1e6627[_0x108f('0x82')](_0x2566ed[_0x108f('0x4d')]['ids'],_['omit'](_0x2566ed['body'],['ids','id'])||{})['spread'](function(_0x393888){for(var _0x3d3870=0x0;_0x3d3870<_0x2566ed[_0x108f('0x4d')][_0x108f('0x7e')][_0x108f('0x35')];_0x3d3870+=0x1){socket[_0x108f('0x83')](_0x108f('0x84'),{'UserId':_0x2566ed[_0x108f('0x4d')][_0x108f('0x7e')][_0x3d3870],'MailQueueId':_0x2566ed['params']['id']});}return _0x393888;});}})[_0x108f('0x25')](respondWithResult(_0x12e936,null))[_0x108f('0x48')](handleError(_0x12e936,null));};exports['removeAgents']=function(_0x4aba8d,_0x2dd785,_0x32fd85){return db[_0x108f('0x2d')][_0x108f('0x52')]({'where':{'id':_0x4aba8d['params']['id']}})[_0x108f('0x25')](handleEntityNotFound(_0x2dd785,null))[_0x108f('0x25')](function(_0x15226a){if(_0x15226a){return _0x15226a['removeAgents'](_0x4aba8d[_0x108f('0x31')][_0x108f('0x7e')])['then'](function(){if(_[_0x108f('0x85')](_0x4aba8d['query'][_0x108f('0x7e')])){for(var _0x9b1809=0x0;_0x9b1809<_0x4aba8d['query'][_0x108f('0x7e')]['length'];_0x9b1809+=0x1){socket['emit']('userMailQueue:remove',{'UserId':Number(_0x4aba8d['query']['ids'][_0x9b1809]),'MailQueueId':Number(_0x4aba8d[_0x108f('0x4a')]['id'])});}}else{socket[_0x108f('0x83')](_0x108f('0x81'),{'UserId':Number(_0x4aba8d[_0x108f('0x31')]['ids']),'MailQueueId':Number(_0x4aba8d[_0x108f('0x4a')]['id'])});}});}})[_0x108f('0x25')](respondWithStatusCode(_0x2dd785,null))[_0x108f('0x48')](handleError(_0x2dd785,null));};exports[_0x108f('0x86')]=function(_0x50ca2f,_0x3e830e,_0x4977d1){var _0x1cdb47={};var _0x498824={};var _0x3afee7;var _0x4e48e6;return db[_0x108f('0x2d')][_0x108f('0x87')]({'where':{'id':_0x50ca2f[_0x108f('0x4a')]['id']}})[_0x108f('0x25')](handleEntityNotFound(_0x3e830e,null))[_0x108f('0x25')](function(_0x203d83){if(_0x203d83){_0x3afee7=_0x203d83;_0x498824[_0x108f('0x2f')]=_[_0x108f('0x30')](db[_0x108f('0x58')][_0x108f('0x2e')]);_0x498824[_0x108f('0x31')]=_['keys'](_0x50ca2f[_0x108f('0x31')]);_0x498824['filters']=_[_0x108f('0x32')](_0x498824['model'],_0x498824[_0x108f('0x31')]);_0x1cdb47[_0x108f('0x34')]=_[_0x108f('0x32')](_0x498824[_0x108f('0x2f')],qs[_0x108f('0x33')](_0x50ca2f[_0x108f('0x31')]['fields']));_0x1cdb47[_0x108f('0x34')]=_0x1cdb47[_0x108f('0x34')]['length']?_0x1cdb47[_0x108f('0x34')]:_0x498824[_0x108f('0x2f')];_0x1cdb47['order']=qs['sort'](_0x50ca2f[_0x108f('0x31')][_0x108f('0x39')]);_0x1cdb47[_0x108f('0x3c')]=qs[_0x108f('0x3a')](_['pick'](_0x50ca2f[_0x108f('0x31')],_0x498824[_0x108f('0x3a')]));if(_0x50ca2f[_0x108f('0x31')][_0x108f('0x3b')]){_0x1cdb47[_0x108f('0x3c')]=_[_0x108f('0x42')](_0x1cdb47[_0x108f('0x3c')],{'$or':_[_0x108f('0x3d')](_0x1cdb47[_0x108f('0x34')],function(_0x526a60){var _0x57a2b4={};_0x57a2b4[_0x526a60]={'$like':'%'+_0x50ca2f[_0x108f('0x31')][_0x108f('0x3b')]+'%'};return _0x57a2b4;})});}_0x1cdb47=_[_0x108f('0x42')]({},_0x1cdb47,_0x50ca2f['options']);return _0x3afee7[_0x108f('0x86')](_0x1cdb47);}})[_0x108f('0x25')](function(_0x345276){if(_0x345276){_0x4e48e6=_0x345276[_0x108f('0x35')];if(!_0x50ca2f[_0x108f('0x31')]['hasOwnProperty'](_0x108f('0x36'))){_0x1cdb47[_0x108f('0x37')]=qs['limit'](_0x50ca2f[_0x108f('0x31')]['limit']);_0x1cdb47['offset']=qs[_0x108f('0x20')](_0x50ca2f[_0x108f('0x31')][_0x108f('0x20')]);}return _0x3afee7[_0x108f('0x86')](_0x1cdb47);}})[_0x108f('0x25')](function(_0x149d1d){if(_0x149d1d){return _0x149d1d?{'count':_0x4e48e6,'rows':_0x149d1d}:null;}})['then'](respondWithResult(_0x3e830e,null))[_0x108f('0x48')](handleError(_0x3e830e,null));}; \ No newline at end of file +var _0x1046=['localhost','socket.io-emitter','./mailQueue.socket','sendStatus','status','end','count','offset','limit','set','json','apply','reject','save','destroy','then','get','MailQueues','UserProfileResource','error','stack','name','MailQueue','query','keys','intersection','attributes','model','fields','length','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','filters','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','update','body','getMembers','findOne','UserMailQueue','hasOwnProperty','nolimit','order','MailQueueId','User','findAndCountAll','UserId','updatedAt','createdAt','format','%s/%s','mailPause','getTeams','addTeams','Team','Agents','online','sequelize','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','ids','tq.TeamId','join','push','toString','QueryTypes','SELECT','every','includes','all','union','compact','transaction','isEmpty','removeAgents','userMailQueue:remove','addAgents','getAgents','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','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','api','../../config/utils','../../config/environment','../../mysqldb','redis'];(function(_0x1ca6c5,_0x4d8bfe){var _0x334bbf=function(_0x1219fd){while(--_0x1219fd){_0x1ca6c5['push'](_0x1ca6c5['shift']());}};_0x334bbf(++_0x4d8bfe);}(_0x1046,0x168));var _0x6104=function(_0x95f1b2,_0x110e5c){_0x95f1b2=_0x95f1b2-0x0;var _0x8c02e3=_0x1046[_0x95f1b2];return _0x8c02e3;};'use strict';var pdf=require(_0x6104('0x0'));var emlformat=require(_0x6104('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x6104('0x2'));var jsonpatch=require(_0x6104('0x3'));var rp=require(_0x6104('0x4'));var moment=require('moment');var BPromise=require(_0x6104('0x5'));var Mustache=require(_0x6104('0x6'));var util=require(_0x6104('0x7'));var path=require(_0x6104('0x8'));var sox=require(_0x6104('0x9'));var csv=require('to-csv');var ejs=require(_0x6104('0xa'));var fs=require('fs');var _=require(_0x6104('0xb'));var squel=require(_0x6104('0xc'));var crypto=require(_0x6104('0xd'));var jsforce=require(_0x6104('0xe'));var deskjs=require(_0x6104('0xf'));var toCsv=require(_0x6104('0x10'));var querystring=require('querystring');var Papa=require(_0x6104('0x11'));var Redis=require(_0x6104('0x12'));var authService=require(_0x6104('0x13'));var qs=require(_0x6104('0x14'));var hardwareService=require(_0x6104('0x15'));var logger=require('../../config/logger')(_0x6104('0x16'));var utils=require(_0x6104('0x17'));var config=require(_0x6104('0x18'));var db=require(_0x6104('0x19'))['db'];config[_0x6104('0x1a')]=_['defaults'](config[_0x6104('0x1a')],{'host':_0x6104('0x1b'),'port':0x18eb});var socket=require(_0x6104('0x1c'))(new Redis(config['redis']));require(_0x6104('0x1d'))['register'](socket);function respondWithStatusCode(_0x5935cc,_0xa03bd6){_0xa03bd6=_0xa03bd6||0xcc;return function(_0x46b240){if(_0x46b240){return _0x5935cc[_0x6104('0x1e')](_0xa03bd6);}return _0x5935cc[_0x6104('0x1f')](_0xa03bd6)[_0x6104('0x20')]();};}function respondWithResult(_0x5b6cb8,_0x2c5d06){_0x2c5d06=_0x2c5d06||0xc8;return function(_0x2114cf){if(_0x2114cf){return _0x5b6cb8['status'](_0x2c5d06)['json'](_0x2114cf);}};}function respondWithFilteredResult(_0x473bb4,_0x4acabb){return function(_0x414460){if(_0x414460){var _0x4a86a9=_0x414460[_0x6104('0x21')],_0x4dc6bf=_0x4acabb[_0x6104('0x22')],_0x5e6392=_0x4acabb[_0x6104('0x22')]+_0x4acabb[_0x6104('0x23')],_0x57b685;if(_0x5e6392>=_0x4a86a9){_0x5e6392=_0x4a86a9;_0x57b685=0xc8;}else{_0x57b685=0xce;}_0x473bb4[_0x6104('0x1f')](_0x57b685);return _0x473bb4[_0x6104('0x24')]('Content-Range',_0x4dc6bf+'-'+_0x5e6392+'/'+_0x4a86a9)[_0x6104('0x25')](_0x414460);}return null;};}function patchUpdates(_0x5c79ee){return function(_0x2d9b17){try{jsonpatch[_0x6104('0x26')](_0x2d9b17,_0x5c79ee,!![]);}catch(_0x194001){return BPromise[_0x6104('0x27')](_0x194001);}return _0x2d9b17[_0x6104('0x28')]();};}function saveUpdates(_0x122c9d,_0x100b35){return function(_0x3ebdfd){if(_0x3ebdfd){return _0x3ebdfd['update'](_0x122c9d)['then'](function(_0x20cf6f){return _0x20cf6f;});}return null;};}function removeEntity(_0x5cc671,_0x18e561){return function(_0x55f69a){if(_0x55f69a){return _0x55f69a[_0x6104('0x29')]()[_0x6104('0x2a')](function(){var _0x20c088=_0x55f69a[_0x6104('0x2b')]({'plain':!![]});var _0x2373eb=_0x6104('0x2c');return db[_0x6104('0x2d')][_0x6104('0x29')]({'where':{'type':_0x2373eb,'resourceId':_0x20c088['id']}})['then'](function(){return _0x55f69a;});})['then'](function(){_0x5cc671[_0x6104('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x121daa,_0x45e8a3){return function(_0x317900){if(!_0x317900){_0x121daa['sendStatus'](0x194);}return _0x317900;};}function handleError(_0x2bd8e0,_0xa67e28){_0xa67e28=_0xa67e28||0x1f4;return function(_0x413d5f){logger[_0x6104('0x2e')](_0x413d5f[_0x6104('0x2f')]);if(_0x413d5f['name']){delete _0x413d5f[_0x6104('0x30')];}_0x2bd8e0[_0x6104('0x1f')](_0xa67e28)['send'](_0x413d5f);};}exports['index']=function(_0x2b36eb,_0x29283d){var _0x773a90={},_0x5898af={},_0xb1b577={'count':0x0,'rows':[]};var _0x42d04d=db[_0x6104('0x31')]['rawAttributes'];_0x5898af['model']=_['keys'](_0x42d04d);_0x5898af[_0x6104('0x32')]=_[_0x6104('0x33')](_0x2b36eb['query']);_0x5898af['filters']=_[_0x6104('0x34')](_0x5898af['model'],_0x5898af[_0x6104('0x32')]);_0x773a90[_0x6104('0x35')]=_['intersection'](_0x5898af[_0x6104('0x36')],qs[_0x6104('0x37')](_0x2b36eb['query']['fields']));_0x773a90[_0x6104('0x35')]=_0x773a90['attributes'][_0x6104('0x38')]?_0x773a90['attributes']:_0x5898af[_0x6104('0x36')];if(!_0x2b36eb['query']['hasOwnProperty']('nolimit')){_0x773a90[_0x6104('0x23')]=qs[_0x6104('0x23')](_0x2b36eb['query'][_0x6104('0x23')]);_0x773a90[_0x6104('0x22')]=qs[_0x6104('0x22')](_0x2b36eb['query'][_0x6104('0x22')]);}_0x773a90['order']=qs[_0x6104('0x39')](_0x2b36eb[_0x6104('0x32')]['sort']);_0x773a90[_0x6104('0x3a')]=qs['filters'](_[_0x6104('0x3b')](_0x2b36eb[_0x6104('0x32')],_0x5898af['filters']));if(_0x2b36eb[_0x6104('0x32')][_0x6104('0x3c')]){_0x773a90[_0x6104('0x3a')]=_[_0x6104('0x3d')](_0x773a90[_0x6104('0x3a')],{'$or':_[_0x6104('0x3e')](_0x42d04d,function(_0x5c1f27){if(_0x5c1f27[_0x6104('0x3f')]['key']!==_0x6104('0x40')){var _0x437292={};_0x437292[_0x5c1f27[_0x6104('0x41')]]={'$like':'%'+_0x2b36eb[_0x6104('0x32')][_0x6104('0x3c')]+'%'};return _0x437292;}})});}_0x773a90=_[_0x6104('0x3d')]({},_0x773a90,_0x2b36eb[_0x6104('0x42')]);var _0x46cb3a={'where':_0x773a90[_0x6104('0x3a')]};return db['MailQueue'][_0x6104('0x21')](_0x46cb3a)[_0x6104('0x2a')](function(_0x2efd8f){_0xb1b577[_0x6104('0x21')]=_0x2efd8f;if(_0x2b36eb[_0x6104('0x32')][_0x6104('0x43')]){_0x773a90[_0x6104('0x44')]=[{'all':!![]}];}return db[_0x6104('0x31')][_0x6104('0x45')](_0x773a90);})[_0x6104('0x2a')](function(_0x56feac){_0xb1b577[_0x6104('0x46')]=_0x56feac;return _0xb1b577;})[_0x6104('0x2a')](respondWithFilteredResult(_0x29283d,_0x773a90))[_0x6104('0x47')](handleError(_0x29283d,null));};exports[_0x6104('0x48')]=function(_0x4f9f1c,_0x3616c1){var _0x4df209={'raw':!![],'where':{'id':_0x4f9f1c[_0x6104('0x49')]['id']}},_0xc166cb={};_0xc166cb[_0x6104('0x36')]=_[_0x6104('0x33')](db[_0x6104('0x31')][_0x6104('0x4a')]);_0xc166cb[_0x6104('0x32')]=_['keys'](_0x4f9f1c['query']);_0xc166cb[_0x6104('0x4b')]=_['intersection'](_0xc166cb[_0x6104('0x36')],_0xc166cb[_0x6104('0x32')]);_0x4df209[_0x6104('0x35')]=_['intersection'](_0xc166cb[_0x6104('0x36')],qs[_0x6104('0x37')](_0x4f9f1c[_0x6104('0x32')][_0x6104('0x37')]));_0x4df209['attributes']=_0x4df209[_0x6104('0x35')]['length']?_0x4df209[_0x6104('0x35')]:_0xc166cb[_0x6104('0x36')];if(_0x4f9f1c[_0x6104('0x32')][_0x6104('0x43')]){_0x4df209[_0x6104('0x44')]=[{'all':!![]}];}_0x4df209=_[_0x6104('0x3d')]({},_0x4df209,_0x4f9f1c[_0x6104('0x42')]);return db[_0x6104('0x31')][_0x6104('0x4c')](_0x4df209)[_0x6104('0x2a')](handleEntityNotFound(_0x3616c1,null))[_0x6104('0x2a')](respondWithResult(_0x3616c1,null))[_0x6104('0x47')](handleError(_0x3616c1,null));};exports[_0x6104('0x4d')]=function(_0x255d9c,_0x836d73){return db[_0x6104('0x31')][_0x6104('0x4d')](_0x255d9c['body'],{})[_0x6104('0x2a')](function(_0x401c70){var _0x11069f=_0x255d9c['user'][_0x6104('0x2b')]({'plain':!![]});if(!_0x11069f)throw new Error(_0x6104('0x4e'));if(_0x11069f[_0x6104('0x4f')]===_0x6104('0x50')){var _0x5ae04e=_0x401c70['get']({'plain':!![]});var _0x137992=_0x6104('0x2c');return db[_0x6104('0x51')][_0x6104('0x4c')]({'where':{'name':_0x137992,'userProfileId':_0x11069f[_0x6104('0x52')]},'raw':!![]})[_0x6104('0x2a')](function(_0x1fd4eb){if(_0x1fd4eb&&_0x1fd4eb['autoAssociation']===0x0){return db['UserProfileResource'][_0x6104('0x4d')]({'name':_0x5ae04e['name'],'resourceId':_0x5ae04e['id'],'type':_0x1fd4eb[_0x6104('0x30')],'sectionId':_0x1fd4eb['id']},{})['then'](function(){return _0x401c70;});}else{return _0x401c70;}})[_0x6104('0x47')](function(_0x3547f2){logger[_0x6104('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3547f2);throw _0x3547f2;});}return _0x401c70;})['then'](respondWithResult(_0x836d73,0xc9))['catch'](handleError(_0x836d73,null));};exports[_0x6104('0x53')]=function(_0x1904f4,_0xe5a5ae){if(_0x1904f4[_0x6104('0x54')]['id']){delete _0x1904f4[_0x6104('0x54')]['id'];}return db['MailQueue'][_0x6104('0x4c')]({'where':{'id':_0x1904f4[_0x6104('0x49')]['id']}})[_0x6104('0x2a')](handleEntityNotFound(_0xe5a5ae,null))[_0x6104('0x2a')](saveUpdates(_0x1904f4[_0x6104('0x54')],null))['then'](respondWithResult(_0xe5a5ae,null))[_0x6104('0x47')](handleError(_0xe5a5ae,null));};exports[_0x6104('0x29')]=function(_0x1b93a6,_0x3c9759){return db[_0x6104('0x31')]['find']({'where':{'id':_0x1b93a6[_0x6104('0x49')]['id']}})['then'](handleEntityNotFound(_0x3c9759,null))[_0x6104('0x2a')](removeEntity(_0x3c9759,null))[_0x6104('0x47')](handleError(_0x3c9759,null));};exports['describe']=function(_0x5396fa,_0x2445dc){return db[_0x6104('0x31')]['describe']()[_0x6104('0x2a')](respondWithResult(_0x2445dc,null))[_0x6104('0x47')](handleError(_0x2445dc,null));};exports[_0x6104('0x55')]=function(_0x1df5a1,_0xc0372a,_0x243a01){var _0x44fce9={'raw':!![],'where':{}},_0x1ece6c={},_0x546669;return db[_0x6104('0x31')][_0x6104('0x56')]({'where':{'id':_0x1df5a1[_0x6104('0x49')]['id']}})[_0x6104('0x2a')](handleEntityNotFound(_0xc0372a,null))[_0x6104('0x2a')](function(_0x5c9ed7){if(_0x5c9ed7){_0x546669=_0x5c9ed7['get']({'plain':!![]});_0x1ece6c[_0x6104('0x36')]=_['keys'](db[_0x6104('0x57')][_0x6104('0x4a')]);_0x1ece6c[_0x6104('0x32')]=_[_0x6104('0x33')](_0x1df5a1['query']);_0x1ece6c[_0x6104('0x4b')]=_[_0x6104('0x34')](_0x1ece6c[_0x6104('0x36')],_0x1ece6c['query']);_0x44fce9[_0x6104('0x35')]=_[_0x6104('0x34')](_0x1ece6c[_0x6104('0x36')],qs[_0x6104('0x37')](_0x1df5a1[_0x6104('0x32')][_0x6104('0x37')]));_0x44fce9['attributes']=_0x44fce9['attributes'][_0x6104('0x38')]?_0x44fce9[_0x6104('0x35')]:_0x1ece6c[_0x6104('0x36')];if(!_0x1df5a1[_0x6104('0x32')][_0x6104('0x58')](_0x6104('0x59'))){_0x44fce9[_0x6104('0x23')]=qs[_0x6104('0x23')](_0x1df5a1['query'][_0x6104('0x23')]);_0x44fce9[_0x6104('0x22')]=qs[_0x6104('0x22')](_0x1df5a1[_0x6104('0x32')][_0x6104('0x22')]);}_0x44fce9[_0x6104('0x5a')]=qs[_0x6104('0x39')](_0x1df5a1[_0x6104('0x32')][_0x6104('0x39')]);_0x44fce9[_0x6104('0x3a')]=qs[_0x6104('0x4b')](_['pick'](_0x1df5a1[_0x6104('0x32')],_0x1ece6c['filters']));_0x44fce9[_0x6104('0x3a')][_0x6104('0x5b')]=_0x5c9ed7['id'];if(_0x1df5a1[_0x6104('0x32')][_0x6104('0x3c')]){_0x44fce9[_0x6104('0x3a')]=_[_0x6104('0x3d')](_0x44fce9[_0x6104('0x3a')],{'$or':_[_0x6104('0x3e')](_0x44fce9['attributes'],function(_0x2af22b){var _0x19dd14={};_0x19dd14[_0x2af22b]={'$like':'%'+_0x1df5a1[_0x6104('0x32')][_0x6104('0x3c')]+'%'};return _0x19dd14;})});}_0x44fce9=_[_0x6104('0x3d')]({},_0x44fce9,_0x1df5a1[_0x6104('0x42')]);return db[_0x6104('0x57')][_0x6104('0x45')](_0x44fce9);}})[_0x6104('0x2a')](function(_0x1ce3f6){if(_0x1ce3f6){return db[_0x6104('0x5c')][_0x6104('0x5d')]({'where':{'id':_['map'](_0x1ce3f6,_0x6104('0x5e')),'role':'agent'},'attributes':['id','name','mailPause',_0x6104('0x5f'),_0x6104('0x60')]});}})['then'](function(_0x34f3c8){if(_0x34f3c8){return{'count':_0x34f3c8[_0x6104('0x21')],'rows':_[_0x6104('0x3e')](_0x34f3c8[_0x6104('0x46')],function(_0x17b796){return{'membername':_0x17b796[_0x6104('0x30')],'UserId':_0x17b796['id'],'queue_name':_0x546669['name'],'MailQueueId':_0x546669['id'],'interface':util[_0x6104('0x61')](_0x6104('0x62'),'SIP',_0x17b796[_0x6104('0x30')]),'penalty':0x0,'paused':_0x17b796[_0x6104('0x63')],'createdAt':_0x17b796['createdAt'],'updatedAt':_0x17b796[_0x6104('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6104('0x2a')](respondWithFilteredResult(_0xc0372a,_0x44fce9))[_0x6104('0x47')](handleError(_0xc0372a,null));};exports['getTeams']=function(_0x31291a,_0x3f909a,_0x17a49c){var _0x41afd1={};var _0x3be4d4={};var _0x1847d2;var _0x23e335;return db[_0x6104('0x31')][_0x6104('0x56')]({'where':{'id':_0x31291a['params']['id']}})[_0x6104('0x2a')](handleEntityNotFound(_0x3f909a,null))[_0x6104('0x2a')](function(_0x4cb82a){if(_0x4cb82a){_0x1847d2=_0x4cb82a;_0x3be4d4[_0x6104('0x36')]=_['keys'](db['Team']['rawAttributes']);_0x3be4d4[_0x6104('0x32')]=_[_0x6104('0x33')](_0x31291a[_0x6104('0x32')]);_0x3be4d4[_0x6104('0x4b')]=_[_0x6104('0x34')](_0x3be4d4[_0x6104('0x36')],_0x3be4d4[_0x6104('0x32')]);_0x41afd1[_0x6104('0x35')]=_['intersection'](_0x3be4d4[_0x6104('0x36')],qs['fields'](_0x31291a[_0x6104('0x32')][_0x6104('0x37')]));_0x41afd1['attributes']=_0x41afd1['attributes']['length']?_0x41afd1[_0x6104('0x35')]:_0x3be4d4['model'];_0x41afd1['order']=qs[_0x6104('0x39')](_0x31291a['query']['sort']);_0x41afd1['where']=qs[_0x6104('0x4b')](_['pick'](_0x31291a[_0x6104('0x32')],_0x3be4d4[_0x6104('0x4b')]));if(_0x31291a[_0x6104('0x32')]['filter']){_0x41afd1[_0x6104('0x3a')]=_[_0x6104('0x3d')](_0x41afd1['where'],{'$or':_['map'](_0x41afd1[_0x6104('0x35')],function(_0x369850){var _0x236fbf={};_0x236fbf[_0x369850]={'$like':'%'+_0x31291a[_0x6104('0x32')][_0x6104('0x3c')]+'%'};return _0x236fbf;})});}_0x41afd1=_[_0x6104('0x3d')]({},_0x41afd1,_0x31291a[_0x6104('0x42')]);return _0x1847d2[_0x6104('0x64')](_0x41afd1);}})[_0x6104('0x2a')](function(_0x1a6b0a){if(_0x1a6b0a){_0x23e335=_0x1a6b0a[_0x6104('0x38')];if(!_0x31291a[_0x6104('0x32')][_0x6104('0x58')](_0x6104('0x59'))){_0x41afd1[_0x6104('0x23')]=qs['limit'](_0x31291a[_0x6104('0x32')][_0x6104('0x23')]);_0x41afd1[_0x6104('0x22')]=qs[_0x6104('0x22')](_0x31291a[_0x6104('0x32')]['offset']);}return _0x1847d2[_0x6104('0x64')](_0x41afd1);}})['then'](function(_0x2eab6f){if(_0x2eab6f){return _0x2eab6f?{'count':_0x23e335,'rows':_0x2eab6f}:null;}})[_0x6104('0x2a')](respondWithResult(_0x3f909a,null))['catch'](handleError(_0x3f909a,null));};exports[_0x6104('0x65')]=function(_0x4c122c,_0x5bc77c,_0x4a4087){var _0x35f330=_0x4c122c[_0x6104('0x54')]['teams'];return db[_0x6104('0x66')]['findAll']({'where':{'id':_[_0x6104('0x3e')](_0x35f330,'id')},'attributes':['id'],'include':[{'model':db['User'],'as':_0x6104('0x67'),'attributes':['id','name',_0x6104('0x68'),'voicePause','interface'],'raw':!![]}]})[_0x6104('0x2a')](function(_0x152baa){if(_0x152baa){var _0xb4396e=_['flatMap'](_0x152baa,function(_0x2db619){var _0x27cc2c=_0x2db619['get']({'plain':!![]});return _0x27cc2c[_0x6104('0x67')];});return db[_0x6104('0x31')]['find']({'where':{'id':_0x4c122c[_0x6104('0x49')]['id']}})['then'](function(_0x208567){return db[_0x6104('0x69')]['transaction'](function(_0x263673){return _0x208567['addTeams'](_[_0x6104('0x3e')](_0x35f330,'id'),{'transaction':_0x263673})[_0x6104('0x2a')](function(){return BPromise['each'](_0xb4396e,function(_0x53da49){return db['UserMailQueue'][_0x6104('0x6a')]({'where':{'UserId':_0x53da49['id'],'MailQueueId':_0x4c122c['params']['id']},'transaction':_0x263673});});})['then'](function(){_0xb4396e[_0x6104('0x6b')](function(_0x37ab79){socket[_0x6104('0x6c')](_0x6104('0x6d'),{'UserId':_0x37ab79['id'],'MailQueueId':_0x208567['id']});});});});});}})[_0x6104('0x2a')](respondWithStatusCode(_0x5bc77c,null))[_0x6104('0x47')](handleError(_0x5bc77c,null));};exports[_0x6104('0x6e')]=function(_0x11d527,_0x5b882d,_0xa3c821){return db[_0x6104('0x66')][_0x6104('0x45')]({'where':{'id':_0x11d527[_0x6104('0x32')][_0x6104('0x6f')]},'attributes':['id'],'include':[{'model':db[_0x6104('0x5c')],'as':_0x6104('0x67'),'attributes':['id'],'raw':!![]}]})[_0x6104('0x2a')](handleEntityNotFound(_0x5b882d,null))[_0x6104('0x2a')](function(_0x256bbb){var _0x128695=_[_0x6104('0x3e')](_0x256bbb,'id');var _0x516d36=[];var _0x1b98af=[];var _0xa8f0fa=squel['select']();_0xa8f0fa['field'](_0x6104('0x70'))['from']('team_has_mail_queues','tq')[_0x6104('0x71')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x6104('0x3a')]('MailQueueId\x20=\x20?',_0x11d527[_0x6104('0x49')]['id']);for(var _0x1b8aa7=0x0;_0x1b8aa7<_0x256bbb['length'];_0x1b8aa7+=0x1){let _0x11aa5d=_0x256bbb[_0x1b8aa7];for(var _0x449c83=0x0;_0x449c83<_0x11aa5d[_0x6104('0x67')][_0x6104('0x38')];_0x449c83+=0x1){let _0x16da60=_0x11aa5d[_0x6104('0x67')][_0x449c83];var _0x4bf9e6=_0xa8f0fa['clone']();_0x4bf9e6[_0x6104('0x3a')]('ut.UserId\x20=\x20?',_0x16da60['id']);_0x1b98af[_0x6104('0x72')](db[_0x6104('0x69')]['query'](_0x4bf9e6[_0x6104('0x73')](),{'type':db[_0x6104('0x69')][_0x6104('0x74')][_0x6104('0x75')]})[_0x6104('0x2a')](function(_0x3e64c9){if(_0x3e64c9[_0x6104('0x38')]===0x1){return _0x16da60['id'];}else{var _0x1bbc7a=_[_0x6104('0x76')](_['map'](_0x3e64c9,'TeamId'),function(_0x3413be){return _[_0x6104('0x77')](_0x128695,_0x3413be);});if(_0x1bbc7a){return _0x16da60['id'];}}}));}}return BPromise[_0x6104('0x78')](_0x1b98af)['then'](function(_0x39cb98){_0x516d36=_(_0x516d36)[_0x6104('0x79')](_0x39cb98)[_0x6104('0x7a')]()['value']();return db[_0x6104('0x31')][_0x6104('0x4c')]({'where':{'id':_0x11d527[_0x6104('0x49')]['id']}})['then'](function(_0x3f662e){return db['sequelize'][_0x6104('0x7b')](function(_0x84bf28){return _0x3f662e[_0x6104('0x6e')](_0x11d527[_0x6104('0x32')][_0x6104('0x6f')],{'transaction':_0x84bf28})[_0x6104('0x2a')](function(){if(!_[_0x6104('0x7c')](_0x516d36)){return _0x3f662e[_0x6104('0x7d')](_0x516d36,{'transaction':_0x84bf28});}})[_0x6104('0x2a')](function(){_0x516d36[_0x6104('0x6b')](function(_0x89de00){socket[_0x6104('0x6c')](_0x6104('0x7e'),{'UserId':_0x89de00,'MailQueueId':_0x3f662e['id']});});});});});});})[_0x6104('0x2a')](respondWithStatusCode(_0x5b882d,null))[_0x6104('0x47')](handleError(_0x5b882d,null));};exports[_0x6104('0x7f')]=function(_0x56f61a,_0x4943d9,_0x532061){return db[_0x6104('0x31')][_0x6104('0x4c')]({'where':{'id':_0x56f61a['params']['id']}})[_0x6104('0x2a')](handleEntityNotFound(_0x4943d9,null))[_0x6104('0x2a')](function(_0x31b83b){if(_0x31b83b){return _0x31b83b[_0x6104('0x7f')](_0x56f61a[_0x6104('0x54')][_0x6104('0x6f')],_['omit'](_0x56f61a[_0x6104('0x54')],[_0x6104('0x6f'),'id'])||{})['spread'](function(_0x451383){for(var _0x36e242=0x0;_0x36e242<_0x56f61a[_0x6104('0x54')][_0x6104('0x6f')][_0x6104('0x38')];_0x36e242+=0x1){socket[_0x6104('0x6c')](_0x6104('0x6d'),{'UserId':_0x56f61a[_0x6104('0x54')][_0x6104('0x6f')][_0x36e242],'MailQueueId':_0x56f61a['params']['id']});}return _0x451383;});}})[_0x6104('0x2a')](respondWithResult(_0x4943d9,null))[_0x6104('0x47')](handleError(_0x4943d9,null));};exports[_0x6104('0x7d')]=function(_0x2684fa,_0x5b1367,_0x4af2e0){return db[_0x6104('0x31')][_0x6104('0x4c')]({'where':{'id':_0x2684fa[_0x6104('0x49')]['id']}})['then'](handleEntityNotFound(_0x5b1367,null))[_0x6104('0x2a')](function(_0x1f9ee0){if(_0x1f9ee0){return _0x1f9ee0[_0x6104('0x7d')](_0x2684fa[_0x6104('0x32')][_0x6104('0x6f')])[_0x6104('0x2a')](function(){if(_['isArray'](_0x2684fa[_0x6104('0x32')][_0x6104('0x6f')])){for(var _0x301c2c=0x0;_0x301c2c<_0x2684fa[_0x6104('0x32')]['ids']['length'];_0x301c2c+=0x1){socket[_0x6104('0x6c')](_0x6104('0x7e'),{'UserId':Number(_0x2684fa[_0x6104('0x32')][_0x6104('0x6f')][_0x301c2c]),'MailQueueId':Number(_0x2684fa[_0x6104('0x49')]['id'])});}}else{socket['emit'](_0x6104('0x7e'),{'UserId':Number(_0x2684fa[_0x6104('0x32')][_0x6104('0x6f')]),'MailQueueId':Number(_0x2684fa[_0x6104('0x49')]['id'])});}});}})[_0x6104('0x2a')](respondWithStatusCode(_0x5b1367,null))[_0x6104('0x47')](handleError(_0x5b1367,null));};exports[_0x6104('0x80')]=function(_0x2e5095,_0x57b939,_0x4aa36c){var _0x5623c8={};var _0x2e4f8f={};var _0x3c5f50;var _0x214d7d;return db[_0x6104('0x31')][_0x6104('0x56')]({'where':{'id':_0x2e5095['params']['id']}})[_0x6104('0x2a')](handleEntityNotFound(_0x57b939,null))['then'](function(_0x47ae4b){if(_0x47ae4b){_0x3c5f50=_0x47ae4b;_0x2e4f8f[_0x6104('0x36')]=_['keys'](db[_0x6104('0x5c')]['rawAttributes']);_0x2e4f8f['query']=_[_0x6104('0x33')](_0x2e5095[_0x6104('0x32')]);_0x2e4f8f[_0x6104('0x4b')]=_[_0x6104('0x34')](_0x2e4f8f[_0x6104('0x36')],_0x2e4f8f[_0x6104('0x32')]);_0x5623c8[_0x6104('0x35')]=_[_0x6104('0x34')](_0x2e4f8f[_0x6104('0x36')],qs[_0x6104('0x37')](_0x2e5095[_0x6104('0x32')][_0x6104('0x37')]));_0x5623c8[_0x6104('0x35')]=_0x5623c8['attributes']['length']?_0x5623c8[_0x6104('0x35')]:_0x2e4f8f['model'];_0x5623c8[_0x6104('0x5a')]=qs[_0x6104('0x39')](_0x2e5095[_0x6104('0x32')][_0x6104('0x39')]);_0x5623c8['where']=qs['filters'](_[_0x6104('0x3b')](_0x2e5095['query'],_0x2e4f8f[_0x6104('0x4b')]));if(_0x2e5095[_0x6104('0x32')]['filter']){_0x5623c8[_0x6104('0x3a')]=_['merge'](_0x5623c8['where'],{'$or':_['map'](_0x5623c8[_0x6104('0x35')],function(_0x1309b2){var _0x6e4a38={};_0x6e4a38[_0x1309b2]={'$like':'%'+_0x2e5095['query'][_0x6104('0x3c')]+'%'};return _0x6e4a38;})});}_0x5623c8=_[_0x6104('0x3d')]({},_0x5623c8,_0x2e5095[_0x6104('0x42')]);return _0x3c5f50[_0x6104('0x80')](_0x5623c8);}})[_0x6104('0x2a')](function(_0x595de5){if(_0x595de5){_0x214d7d=_0x595de5['length'];if(!_0x2e5095['query'][_0x6104('0x58')](_0x6104('0x59'))){_0x5623c8[_0x6104('0x23')]=qs[_0x6104('0x23')](_0x2e5095['query'][_0x6104('0x23')]);_0x5623c8[_0x6104('0x22')]=qs['offset'](_0x2e5095[_0x6104('0x32')]['offset']);}return _0x3c5f50[_0x6104('0x80')](_0x5623c8);}})[_0x6104('0x2a')](function(_0x254bd3){if(_0x254bd3){return _0x254bd3?{'count':_0x214d7d,'rows':_0x254bd3}:null;}})[_0x6104('0x2a')](respondWithResult(_0x57b939,null))['catch'](handleError(_0x57b939,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 3d61ec0..f2609d5 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 _0xf70b=['hasOwnProperty','exports','events','../../mysqldb','MailQueue','setMaxListeners','save','update','emit'];(function(_0x2708a7,_0x338165){var _0x21f5b4=function(_0x4706eb){while(--_0x4706eb){_0x2708a7['push'](_0x2708a7['shift']());}};_0x21f5b4(++_0x338165);}(_0xf70b,0x173));var _0xbf70=function(_0x5957aa,_0x32cd2c){_0x5957aa=_0x5957aa-0x0;var _0x3b0a35=_0xf70b[_0x5957aa];return _0x3b0a35;};'use strict';var EventEmitter=require(_0xbf70('0x0'));var MailQueue=require(_0xbf70('0x1'))['db'][_0xbf70('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xbf70('0x3')](0x0);var events={'afterCreate':_0xbf70('0x4'),'afterUpdate':_0xbf70('0x5'),'afterDestroy':'remove'};function emitEvent(_0x24aab6){return function(_0x5d1028,_0x2e56b4,_0x4a6b82){MailQueueEvents[_0xbf70('0x6')](_0x24aab6+':'+_0x5d1028['id'],_0x5d1028);MailQueueEvents[_0xbf70('0x6')](_0x24aab6,_0x5d1028);_0x4a6b82(null);};}for(var e in events){if(events[_0xbf70('0x7')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0xbf70('0x8')]=MailQueueEvents; \ No newline at end of file +var _0x2d00=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x2c955e,_0x3f0f3d){var _0x2de7b9=function(_0x1c2ee1){while(--_0x1c2ee1){_0x2c955e['push'](_0x2c955e['shift']());}};_0x2de7b9(++_0x3f0f3d);}(_0x2d00,0xbb));var _0x02d0=function(_0x112929,_0x7da466){_0x112929=_0x112929-0x0;var _0x333c16=_0x2d00[_0x112929];return _0x333c16;};'use strict';var EventEmitter=require(_0x02d0('0x0'));var MailQueue=require(_0x02d0('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x02d0('0x2'),'afterUpdate':_0x02d0('0x3'),'afterDestroy':_0x02d0('0x4')};function emitEvent(_0x3ad92a){return function(_0x302138,_0x1b9fdd,_0x26f86d){MailQueueEvents['emit'](_0x3ad92a+':'+_0x302138['id'],_0x302138);MailQueueEvents[_0x02d0('0x5')](_0x3ad92a,_0x302138);_0x26f86d(null);};}for(var e in events){if(events[_0x02d0('0x6')](e)){var event=events[e];MailQueue[_0x02d0('0x7')](e,emitEvent(event));}}module[_0x02d0('0x8')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 4988f11..1ed977a 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 _0xf4eb=['./mailQueue.attributes','exports','define','mail_queues','lodash','bluebird','rimraf','../../config/environment'];(function(_0x354a71,_0x344388){var _0x20ace4=function(_0xe979d2){while(--_0xe979d2){_0x354a71['push'](_0x354a71['shift']());}};_0x20ace4(++_0x344388);}(_0xf4eb,0xec));var _0xbf4e=function(_0xb8964e,_0x3905bf){_0xb8964e=_0xb8964e-0x0;var _0x136cac=_0xf4eb[_0xb8964e];return _0x136cac;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xbf4e('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var attributes=require(_0xbf4e('0x4'));module[_0xbf4e('0x5')]=function(_0xa4dcf5,_0x2fcfed){return _0xa4dcf5[_0xbf4e('0x6')]('MailQueue',attributes,{'tableName':_0xbf4e('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb43b=['rimraf','../../config/environment','./mailQueue.attributes','MailQueue','mail_queues','lodash','util','api','moment','bluebird','path'];(function(_0x1dc465,_0x28439b){var _0x27fda4=function(_0x480e3e){while(--_0x480e3e){_0x1dc465['push'](_0x1dc465['shift']());}};_0x27fda4(++_0x28439b);}(_0xb43b,0x1b2));var _0xbb43=function(_0x40774d,_0x2438bd){_0x40774d=_0x40774d-0x0;var _0x2e5010=_0xb43b[_0x40774d];return _0x2e5010;};'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/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index 790e45a..f05d829 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 _0x8b92=['limit','map','include','model','ShowMailQueue','find','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./mailQueue.socket','then','request\x20sent','debug','stringify','error','code','MailQueue,\x20%s,\x20%s','message','info','result','catch','GetMailQueue','MailQueue','findAll','options','raw','where','attributes'];(function(_0x5022fc,_0x44f2ef){var _0x2ce3cc=function(_0x5b319d){while(--_0x5b319d){_0x5022fc['push'](_0x5022fc['shift']());}};_0x2ce3cc(++_0x44f2ef);}(_0x8b92,0x12e));var _0x28b9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8b92[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x28b9('0x0'));var util=require('util');var moment=require(_0x28b9('0x1'));var BPromise=require(_0x28b9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x28b9('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x28b9('0x4'))(_0x28b9('0x5'));var config=require(_0x28b9('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x28b9('0x7')][_0x28b9('0x8')]({'port':0x232a});config[_0x28b9('0x9')]=_[_0x28b9('0xa')](config[_0x28b9('0x9')],{'host':_0x28b9('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x28b9('0x9')]));require(_0x28b9('0xc'))['register'](socket);function respondWithRpcPromise(_0x48fe07,_0x53f593,_0xdfaeb5){return new BPromise(function(_0x45a130,_0x50e672){return client['request'](_0x48fe07,_0xdfaeb5)[_0x28b9('0xd')](function(_0x5a9e5f){logger['info']('MailQueue,\x20%s,\x20%s',_0x53f593,_0x28b9('0xe'));logger[_0x28b9('0xf')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x53f593,_0x28b9('0xe'),JSON[_0x28b9('0x10')](_0x5a9e5f));if(_0x5a9e5f[_0x28b9('0x11')]){if(_0x5a9e5f[_0x28b9('0x11')][_0x28b9('0x12')]===0x1f4){logger[_0x28b9('0x11')](_0x28b9('0x13'),_0x53f593,_0x5a9e5f[_0x28b9('0x11')][_0x28b9('0x14')]);return _0x50e672(_0x5a9e5f[_0x28b9('0x11')][_0x28b9('0x14')]);}logger['error'](_0x28b9('0x13'),_0x53f593,_0x5a9e5f['error']['message']);return _0x45a130(_0x5a9e5f[_0x28b9('0x11')][_0x28b9('0x14')]);}else{logger[_0x28b9('0x15')]('MailQueue,\x20%s,\x20%s',_0x53f593,_0x28b9('0xe'));_0x45a130(_0x5a9e5f[_0x28b9('0x16')]['message']);}})[_0x28b9('0x17')](function(_0x5e7267){logger[_0x28b9('0x11')](_0x28b9('0x13'),_0x53f593,_0x5e7267);_0x50e672(_0x5e7267);});});}exports[_0x28b9('0x18')]=function(_0x3eb50f){var _0x2a22d1=this;return new Promise(function(_0x2c66f9,_0x20e807){return db[_0x28b9('0x19')][_0x28b9('0x1a')]({'raw':_0x3eb50f[_0x28b9('0x1b')]?_0x3eb50f[_0x28b9('0x1b')][_0x28b9('0x1c')]===undefined?!![]:![]:!![],'where':_0x3eb50f['options']?_0x3eb50f[_0x28b9('0x1b')][_0x28b9('0x1d')]||null:null,'attributes':_0x3eb50f[_0x28b9('0x1b')]?_0x3eb50f[_0x28b9('0x1b')][_0x28b9('0x1e')]||null:null,'limit':_0x3eb50f[_0x28b9('0x1b')]?_0x3eb50f[_0x28b9('0x1b')][_0x28b9('0x1f')]||null:null,'include':_0x3eb50f[_0x28b9('0x1b')]?_0x3eb50f['options']['include']?_[_0x28b9('0x20')](_0x3eb50f[_0x28b9('0x1b')][_0x28b9('0x21')],function(_0x1ba253){return{'model':db[_0x1ba253[_0x28b9('0x22')]],'as':_0x1ba253['as'],'attributes':_0x1ba253[_0x28b9('0x1e')],'include':_0x1ba253[_0x28b9('0x21')]?_[_0x28b9('0x20')](_0x1ba253['include'],function(_0x4b7952){return{'model':db[_0x4b7952[_0x28b9('0x22')]],'as':_0x4b7952['as'],'attributes':_0x4b7952['attributes'],'include':_0x4b7952[_0x28b9('0x21')]?_[_0x28b9('0x20')](_0x4b7952['include'],function(_0x17c2bc){return{'model':db[_0x17c2bc['model']],'as':_0x17c2bc['as'],'attributes':_0x17c2bc['attributes']};}):[]};}):[]};}):[]:[]})[_0x28b9('0xd')](function(_0x3bb2a1){logger[_0x28b9('0x15')](_0x28b9('0x18'),_0x3eb50f);logger[_0x28b9('0xf')]('GetMailQueue',_0x3eb50f,JSON[_0x28b9('0x10')](_0x3bb2a1));_0x2c66f9(_0x3bb2a1);})[_0x28b9('0x17')](function(_0x5ee282){logger[_0x28b9('0x11')](_0x28b9('0x18'),_0x5ee282[_0x28b9('0x14')],_0x3eb50f);_0x20e807(_0x2a22d1[_0x28b9('0x11')](0x1f4,_0x5ee282[_0x28b9('0x14')]));});});};exports[_0x28b9('0x23')]=function(_0x43d114){var _0x54c796=this;return new Promise(function(_0x1d758b,_0xcda7db){return db[_0x28b9('0x19')][_0x28b9('0x24')]({'raw':_0x43d114[_0x28b9('0x1b')]?_0x43d114[_0x28b9('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x43d114[_0x28b9('0x1b')]?_0x43d114['options'][_0x28b9('0x1d')]||null:null,'attributes':_0x43d114[_0x28b9('0x1b')]?_0x43d114['options'][_0x28b9('0x1e')]||null:null,'include':_0x43d114[_0x28b9('0x1b')]?_0x43d114[_0x28b9('0x1b')][_0x28b9('0x21')]?_[_0x28b9('0x20')](_0x43d114[_0x28b9('0x1b')][_0x28b9('0x21')],function(_0x4ff7b4){return{'model':db[_0x4ff7b4['model']],'as':_0x4ff7b4['as'],'attributes':_0x4ff7b4[_0x28b9('0x1e')],'include':_0x4ff7b4[_0x28b9('0x21')]?_[_0x28b9('0x20')](_0x4ff7b4['include'],function(_0x329e07){return{'model':db[_0x329e07[_0x28b9('0x22')]],'as':_0x329e07['as'],'attributes':_0x329e07[_0x28b9('0x1e')],'include':_0x329e07['include']?_['map'](_0x329e07['include'],function(_0x2c2f13){return{'model':db[_0x2c2f13['model']],'as':_0x2c2f13['as'],'attributes':_0x2c2f13[_0x28b9('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x44bcd2){logger[_0x28b9('0x15')]('ShowMailQueue',_0x43d114);logger['debug'](_0x28b9('0x23'),_0x43d114,JSON[_0x28b9('0x10')](_0x44bcd2));_0x1d758b(_0x44bcd2);})[_0x28b9('0x17')](function(_0x4cafae){logger[_0x28b9('0x11')](_0x28b9('0x23'),_0x4cafae[_0x28b9('0x14')],_0x43d114);_0xcda7db(_0x54c796[_0x28b9('0x11')](0x1f4,_0x4cafae['message']));});});}; \ No newline at end of file +var _0x3869=['findAll','options','attributes','limit','include','map','model','info','catch','ShowMailQueue','MailQueue','find','raw','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','MailQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','GetMailQueue'];(function(_0x3ccc34,_0x41014f){var _0x45e6d8=function(_0x33f349){while(--_0x33f349){_0x3ccc34['push'](_0x3ccc34['shift']());}};_0x45e6d8(++_0x41014f);}(_0x3869,0xb2));var _0x9386=function(_0x355c2d,_0x567f0f){_0x355c2d=_0x355c2d-0x0;var _0x4c4405=_0x3869[_0x355c2d];return _0x4c4405;};'use strict';var _=require(_0x9386('0x0'));var util=require(_0x9386('0x1'));var moment=require(_0x9386('0x2'));var BPromise=require(_0x9386('0x3'));var rs=require(_0x9386('0x4'));var fs=require('fs');var Redis=require(_0x9386('0x5'));var db=require(_0x9386('0x6'))['db'];var utils=require(_0x9386('0x7'));var logger=require(_0x9386('0x8'))(_0x9386('0x9'));var config=require(_0x9386('0xa'));var jayson=require(_0x9386('0xb'));var client=jayson[_0x9386('0xc')][_0x9386('0xd')]({'port':0x232a});config[_0x9386('0xe')]=_['defaults'](config[_0x9386('0xe')],{'host':_0x9386('0xf'),'port':0x18eb});var socket=require(_0x9386('0x10'))(new Redis(config[_0x9386('0xe')]));require('./mailQueue.socket')[_0x9386('0x11')](socket);function respondWithRpcPromise(_0x61e1c8,_0x44e8d0,_0x4cb37a){return new BPromise(function(_0x54b2f9,_0x5e9e75){return client[_0x9386('0x12')](_0x61e1c8,_0x4cb37a)[_0x9386('0x13')](function(_0x29ee60){logger['info'](_0x9386('0x14'),_0x44e8d0,_0x9386('0x15'));logger[_0x9386('0x16')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x44e8d0,_0x9386('0x15'),JSON[_0x9386('0x17')](_0x29ee60));if(_0x29ee60[_0x9386('0x18')]){if(_0x29ee60['error']['code']===0x1f4){logger[_0x9386('0x18')]('MailQueue,\x20%s,\x20%s',_0x44e8d0,_0x29ee60[_0x9386('0x18')][_0x9386('0x19')]);return _0x5e9e75(_0x29ee60[_0x9386('0x18')][_0x9386('0x19')]);}logger[_0x9386('0x18')](_0x9386('0x14'),_0x44e8d0,_0x29ee60[_0x9386('0x18')][_0x9386('0x19')]);return _0x54b2f9(_0x29ee60[_0x9386('0x18')][_0x9386('0x19')]);}else{logger['info']('MailQueue,\x20%s,\x20%s',_0x44e8d0,_0x9386('0x15'));_0x54b2f9(_0x29ee60['result'][_0x9386('0x19')]);}})['catch'](function(_0x53c1c5){logger[_0x9386('0x18')](_0x9386('0x14'),_0x44e8d0,_0x53c1c5);_0x5e9e75(_0x53c1c5);});});}exports[_0x9386('0x1a')]=function(_0x201083){var _0x180017=this;return new Promise(function(_0xc53cec,_0xd7dacc){return db['MailQueue'][_0x9386('0x1b')]({'raw':_0x201083['options']?_0x201083[_0x9386('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x201083[_0x9386('0x1c')]?_0x201083[_0x9386('0x1c')]['where']||null:null,'attributes':_0x201083[_0x9386('0x1c')]?_0x201083[_0x9386('0x1c')][_0x9386('0x1d')]||null:null,'limit':_0x201083['options']?_0x201083[_0x9386('0x1c')][_0x9386('0x1e')]||null:null,'include':_0x201083[_0x9386('0x1c')]?_0x201083[_0x9386('0x1c')][_0x9386('0x1f')]?_[_0x9386('0x20')](_0x201083[_0x9386('0x1c')]['include'],function(_0x26bb36){return{'model':db[_0x26bb36[_0x9386('0x21')]],'as':_0x26bb36['as'],'attributes':_0x26bb36['attributes'],'include':_0x26bb36[_0x9386('0x1f')]?_['map'](_0x26bb36[_0x9386('0x1f')],function(_0x572641){return{'model':db[_0x572641[_0x9386('0x21')]],'as':_0x572641['as'],'attributes':_0x572641[_0x9386('0x1d')],'include':_0x572641[_0x9386('0x1f')]?_[_0x9386('0x20')](_0x572641[_0x9386('0x1f')],function(_0x3026b8){return{'model':db[_0x3026b8[_0x9386('0x21')]],'as':_0x3026b8['as'],'attributes':_0x3026b8[_0x9386('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9386('0x13')](function(_0x7a05ef){logger[_0x9386('0x22')](_0x9386('0x1a'),_0x201083);logger['debug'](_0x9386('0x1a'),_0x201083,JSON[_0x9386('0x17')](_0x7a05ef));_0xc53cec(_0x7a05ef);})[_0x9386('0x23')](function(_0x5827f9){logger[_0x9386('0x18')](_0x9386('0x1a'),_0x5827f9['message'],_0x201083);_0xd7dacc(_0x180017[_0x9386('0x18')](0x1f4,_0x5827f9['message']));});});};exports[_0x9386('0x24')]=function(_0x10d03b){var _0x8263e5=this;return new Promise(function(_0x35e31f,_0x1d9303){return db[_0x9386('0x25')][_0x9386('0x26')]({'raw':_0x10d03b[_0x9386('0x1c')]?_0x10d03b[_0x9386('0x1c')][_0x9386('0x27')]===undefined?!![]:![]:!![],'where':_0x10d03b[_0x9386('0x1c')]?_0x10d03b[_0x9386('0x1c')][_0x9386('0x28')]||null:null,'attributes':_0x10d03b[_0x9386('0x1c')]?_0x10d03b[_0x9386('0x1c')]['attributes']||null:null,'include':_0x10d03b['options']?_0x10d03b[_0x9386('0x1c')]['include']?_[_0x9386('0x20')](_0x10d03b[_0x9386('0x1c')]['include'],function(_0xbc23f7){return{'model':db[_0xbc23f7[_0x9386('0x21')]],'as':_0xbc23f7['as'],'attributes':_0xbc23f7[_0x9386('0x1d')],'include':_0xbc23f7[_0x9386('0x1f')]?_[_0x9386('0x20')](_0xbc23f7[_0x9386('0x1f')],function(_0xe396ed){return{'model':db[_0xe396ed[_0x9386('0x21')]],'as':_0xe396ed['as'],'attributes':_0xe396ed[_0x9386('0x1d')],'include':_0xe396ed[_0x9386('0x1f')]?_['map'](_0xe396ed[_0x9386('0x1f')],function(_0x3ef03a){return{'model':db[_0x3ef03a[_0x9386('0x21')]],'as':_0x3ef03a['as'],'attributes':_0x3ef03a[_0x9386('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1b399a){logger['info'](_0x9386('0x24'),_0x10d03b);logger['debug'](_0x9386('0x24'),_0x10d03b,JSON[_0x9386('0x17')](_0x1b399a));_0x35e31f(_0x1b399a);})['catch'](function(_0x4e85cc){logger[_0x9386('0x18')]('ShowMailQueue',_0x4e85cc[_0x9386('0x19')],_0x10d03b);_0x1d9303(_0x8263e5[_0x9386('0x18')](0x1f4,_0x4e85cc['message']));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 04ba2c6..f10b470 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 _0x4d56=['length','./mailQueue.events','save','remove','removeListener','register'];(function(_0x2a1c2b,_0x2d1bfa){var _0x3c62f5=function(_0x1238eb){while(--_0x1238eb){_0x2a1c2b['push'](_0x2a1c2b['shift']());}};_0x3c62f5(++_0x2d1bfa);}(_0x4d56,0x115));var _0x64d5=function(_0x3921b9,_0x27aeef){_0x3921b9=_0x3921b9-0x0;var _0x17683e=_0x4d56[_0x3921b9];return _0x17683e;};'use strict';var MailQueueEvents=require(_0x64d5('0x0'));var events=[_0x64d5('0x1'),_0x64d5('0x2'),'update'];function createListener(_0xe7ee0f,_0x1171eb){return function(_0x210877){_0x1171eb['emit'](_0xe7ee0f,_0x210877);};}function removeListener(_0x1c1298,_0x32811b){return function(){MailQueueEvents[_0x64d5('0x3')](_0x1c1298,_0x32811b);};}exports[_0x64d5('0x4')]=function(_0x36ab68){for(var _0x1a4deb=0x0,_0x46497f=events[_0x64d5('0x5')];_0x1a4deb<_0x46497f;_0x1a4deb++){var _0x577c8e=events[_0x1a4deb];var _0x1fa622=createListener('mailQueue:'+_0x577c8e,_0x36ab68);MailQueueEvents['on'](_0x577c8e,_0x1fa622);}}; \ No newline at end of file +var _0xfb06=['length','mailQueue:','./mailQueue.events','save','remove','update','removeListener'];(function(_0x34ef2d,_0x27b730){var _0x52a39e=function(_0x3160d1){while(--_0x3160d1){_0x34ef2d['push'](_0x34ef2d['shift']());}};_0x52a39e(++_0x27b730);}(_0xfb06,0x16e));var _0x6fb0=function(_0xf9a6cf,_0x11870e){_0xf9a6cf=_0xf9a6cf-0x0;var _0x59e2bc=_0xfb06[_0xf9a6cf];return _0x59e2bc;};'use strict';var MailQueueEvents=require(_0x6fb0('0x0'));var events=[_0x6fb0('0x1'),_0x6fb0('0x2'),_0x6fb0('0x3')];function createListener(_0xf16dca,_0x4f75d3){return function(_0x4da0e9){_0x4f75d3['emit'](_0xf16dca,_0x4da0e9);};}function removeListener(_0x4df4c7,_0x469e1e){return function(){MailQueueEvents[_0x6fb0('0x4')](_0x4df4c7,_0x469e1e);};}exports['register']=function(_0x44dc63){for(var _0x50d07c=0x0,_0x393a1=events[_0x6fb0('0x5')];_0x50d07c<_0x393a1;_0x50d07c++){var _0x31b6d0=events[_0x50d07c];var _0x33d642=createListener(_0x6fb0('0x6')+_0x31b6d0,_0x44dc63);MailQueueEvents['on'](_0x31b6d0,_0x33d642);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 0824756..136d934 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 _0x5ae2=['isAuthenticated','index','show','post','create','put','/:id','update','destroy','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0x5ae2,0x183));var _0x25ae=function(_0x3e10c0,_0x385bdc){_0x3e10c0=_0x3e10c0-0x0;var _0x2fb415=_0x5ae2[_0x3e10c0];return _0x2fb415;};'use strict';var multer=require(_0x25ae('0x0'));var util=require(_0x25ae('0x1'));var path=require(_0x25ae('0x2'));var timeout=require('connect-timeout');var express=require(_0x25ae('0x3'));var router=express['Router']();var auth=require(_0x25ae('0x4'));var interaction=require(_0x25ae('0x5'));var config=require(_0x25ae('0x6'));var controller=require(_0x25ae('0x7'));router[_0x25ae('0x8')]('/',auth[_0x25ae('0x9')](),controller[_0x25ae('0xa')]);router[_0x25ae('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x25ae('0x9')](),controller[_0x25ae('0xb')]);router[_0x25ae('0xc')]('/',auth[_0x25ae('0x9')](),controller[_0x25ae('0xd')]);router[_0x25ae('0xe')](_0x25ae('0xf'),auth[_0x25ae('0x9')](),controller[_0x25ae('0x10')]);router['delete'](_0x25ae('0xf'),auth[_0x25ae('0x9')](),controller[_0x25ae('0x11')]);module['exports']=router; \ No newline at end of file +var _0xc197=['path','connect-timeout','express','Router','get','index','/describe','isAuthenticated','/:id','show','post','create','put','delete','exports','multer','util'];(function(_0x220677,_0x1213ff){var _0x4c5f46=function(_0xc3be60){while(--_0xc3be60){_0x220677['push'](_0x220677['shift']());}};_0x4c5f46(++_0x1213ff);}(_0xc197,0x86));var _0x7c19=function(_0x485f23,_0x4b55de){_0x485f23=_0x485f23-0x0;var _0x4f45db=_0xc197[_0x485f23];return _0x4f45db;};'use strict';var multer=require(_0x7c19('0x0'));var util=require(_0x7c19('0x1'));var path=require(_0x7c19('0x2'));var timeout=require(_0x7c19('0x3'));var express=require(_0x7c19('0x4'));var router=express[_0x7c19('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./mailQueueReport.controller');router[_0x7c19('0x6')]('/',auth['isAuthenticated'](),controller[_0x7c19('0x7')]);router[_0x7c19('0x6')](_0x7c19('0x8'),auth[_0x7c19('0x9')](),controller['describe']);router[_0x7c19('0x6')](_0x7c19('0xa'),auth[_0x7c19('0x9')](),controller[_0x7c19('0xb')]);router[_0x7c19('0xc')]('/',auth['isAuthenticated'](),controller[_0x7c19('0xd')]);router[_0x7c19('0xe')](_0x7c19('0xa'),auth[_0x7c19('0x9')](),controller['update']);router[_0x7c19('0xf')](_0x7c19('0xa'),auth[_0x7c19('0x9')](),controller['destroy']);module[_0x7c19('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 7cc5420..89226e9 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 _0xf957=['sequelize','exports','STRING','DATE','moment'];(function(_0x1f46e6,_0x119a89){var _0x63b222=function(_0x287407){while(--_0x287407){_0x1f46e6['push'](_0x1f46e6['shift']());}};_0x63b222(++_0x119a89);}(_0xf957,0x81));var _0x7f95=function(_0x3edfd6,_0x458e5e){_0x3edfd6=_0x3edfd6-0x0;var _0x533db7=_0xf957[_0x3edfd6];return _0x533db7;};'use strict';var moment=require(_0x7f95('0x0'));var Sequelize=require(_0x7f95('0x1'));module[_0x7f95('0x2')]={'uniqueid':{'type':Sequelize[_0x7f95('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x7f95('0x3')]},'joinAt':{'type':Sequelize[_0x7f95('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x7f95('0x4')]},'exitAt':{'type':Sequelize[_0x7f95('0x4')]},'reason':{'type':Sequelize[_0x7f95('0x3')]}}; \ No newline at end of file +var _0x179b=['STRING','DATE','moment'];(function(_0x57af00,_0x45b14e){var _0x5f5bdc=function(_0x1d8b15){while(--_0x1d8b15){_0x57af00['push'](_0x57af00['shift']());}};_0x5f5bdc(++_0x45b14e);}(_0x179b,0xc5));var _0xb179=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x179b[_0x20a584];return _0x4b41a8;};'use strict';var moment=require(_0xb179('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xb179('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xb179('0x1')]},'joinAt':{'type':Sequelize[_0xb179('0x2')]},'leaveAt':{'type':Sequelize[_0xb179('0x2')]},'acceptAt':{'type':Sequelize[_0xb179('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xb179('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 307e177..84ab67b 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 _0x988c=['rawAttributes','model','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','type','key','options','includeAll','findAll','rows','catch','show','params','keys','include','create','body','find','describe','eml-format','fast-json-patch','moment','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','json','reject','save','update','then','destroy','error','stack','name','send','index','MailQueueReport'];(function(_0x4d7dcd,_0x31e6c7){var _0x20d52b=function(_0x323453){while(--_0x323453){_0x4d7dcd['push'](_0x4d7dcd['shift']());}};_0x20d52b(++_0x31e6c7);}(_0x988c,0x136));var _0xc988=function(_0x2b6f11,_0x4f7724){_0x2b6f11=_0x2b6f11-0x0;var _0x87c34b=_0x988c[_0x2b6f11];return _0x87c34b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc988('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc988('0x1'));var rp=require('request-promise');var moment=require(_0xc988('0x2'));var BPromise=require(_0xc988('0x3'));var Mustache=require(_0xc988('0x4'));var util=require('util');var path=require(_0xc988('0x5'));var sox=require(_0xc988('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xc988('0x7'));var squel=require(_0xc988('0x8'));var crypto=require(_0xc988('0x9'));var jsforce=require(_0xc988('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc988('0xb'));var Papa=require(_0xc988('0xc'));var Redis=require(_0xc988('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xc988('0xe'));var hardwareService=require(_0xc988('0xf'));var logger=require(_0xc988('0x10'))(_0xc988('0x11'));var utils=require(_0xc988('0x12'));var config=require(_0xc988('0x13'));var db=require(_0xc988('0x14'))['db'];function respondWithStatusCode(_0x911765,_0x51238d){_0x51238d=_0x51238d||0xcc;return function(_0x64bf7){if(_0x64bf7){return _0x911765[_0xc988('0x15')](_0x51238d);}return _0x911765[_0xc988('0x16')](_0x51238d)[_0xc988('0x17')]();};}function respondWithResult(_0x36f803,_0x425774){_0x425774=_0x425774||0xc8;return function(_0x3fe53a){if(_0x3fe53a){return _0x36f803['status'](_0x425774)['json'](_0x3fe53a);}};}function respondWithFilteredResult(_0x101028,_0x2b3f6f){return function(_0x3a9208){if(_0x3a9208){var _0x3adaee=_0x3a9208[_0xc988('0x18')],_0x16172e=_0x2b3f6f[_0xc988('0x19')],_0x222260=_0x2b3f6f['offset']+_0x2b3f6f[_0xc988('0x1a')],_0x373c6e;if(_0x222260>=_0x3adaee){_0x222260=_0x3adaee;_0x373c6e=0xc8;}else{_0x373c6e=0xce;}_0x101028[_0xc988('0x16')](_0x373c6e);return _0x101028[_0xc988('0x1b')]('Content-Range',_0x16172e+'-'+_0x222260+'/'+_0x3adaee)[_0xc988('0x1c')](_0x3a9208);}return null;};}function patchUpdates(_0x3974cd){return function(_0x3db0d9){try{jsonpatch['apply'](_0x3db0d9,_0x3974cd,!![]);}catch(_0x288600){return BPromise[_0xc988('0x1d')](_0x288600);}return _0x3db0d9[_0xc988('0x1e')]();};}function saveUpdates(_0x57fa26,_0x5c85e0){return function(_0xe2a28a){if(_0xe2a28a){return _0xe2a28a[_0xc988('0x1f')](_0x57fa26)[_0xc988('0x20')](function(_0x482eba){return _0x482eba;});}return null;};}function removeEntity(_0x27c2d5,_0x339dd8){return function(_0x1b3497){if(_0x1b3497){return _0x1b3497[_0xc988('0x21')]()[_0xc988('0x20')](function(){_0x27c2d5[_0xc988('0x16')](0xcc)[_0xc988('0x17')]();});}};}function handleEntityNotFound(_0x176052,_0x50caca){return function(_0x369cd5){if(!_0x369cd5){_0x176052['sendStatus'](0x194);}return _0x369cd5;};}function handleError(_0x303b2c,_0x528e6d){_0x528e6d=_0x528e6d||0x1f4;return function(_0x55b337){logger[_0xc988('0x22')](_0x55b337[_0xc988('0x23')]);if(_0x55b337[_0xc988('0x24')]){delete _0x55b337['name'];}_0x303b2c['status'](_0x528e6d)[_0xc988('0x25')](_0x55b337);};}exports[_0xc988('0x26')]=function(_0x421e3b,_0x222e51){var _0x298fba={},_0x4d98bf={},_0x45ce34={'count':0x0,'rows':[]};var _0xd6b719=db[_0xc988('0x27')][_0xc988('0x28')];_0x4d98bf[_0xc988('0x29')]=_['keys'](_0xd6b719);_0x4d98bf[_0xc988('0x2a')]=_['keys'](_0x421e3b[_0xc988('0x2a')]);_0x4d98bf['filters']=_['intersection'](_0x4d98bf[_0xc988('0x29')],_0x4d98bf[_0xc988('0x2a')]);_0x298fba[_0xc988('0x2b')]=_[_0xc988('0x2c')](_0x4d98bf[_0xc988('0x29')],qs[_0xc988('0x2d')](_0x421e3b[_0xc988('0x2a')][_0xc988('0x2d')]));_0x298fba[_0xc988('0x2b')]=_0x298fba[_0xc988('0x2b')][_0xc988('0x2e')]?_0x298fba[_0xc988('0x2b')]:_0x4d98bf[_0xc988('0x29')];if(!_0x421e3b[_0xc988('0x2a')][_0xc988('0x2f')]('nolimit')){_0x298fba[_0xc988('0x1a')]=qs['limit'](_0x421e3b[_0xc988('0x2a')][_0xc988('0x1a')]);_0x298fba['offset']=qs[_0xc988('0x19')](_0x421e3b['query'][_0xc988('0x19')]);}_0x298fba[_0xc988('0x30')]=qs[_0xc988('0x31')](_0x421e3b['query'][_0xc988('0x31')]);_0x298fba['where']=qs[_0xc988('0x32')](_[_0xc988('0x33')](_0x421e3b['query'],_0x4d98bf['filters']));if(_0x421e3b[_0xc988('0x2a')][_0xc988('0x34')]){_0x298fba[_0xc988('0x35')]=_[_0xc988('0x36')](_0x298fba[_0xc988('0x35')],{'$or':_['map'](_0xd6b719,function(_0x1781cd){if(_0x1781cd[_0xc988('0x37')][_0xc988('0x38')]!=='VIRTUAL'){var _0x4cfcf5={};_0x4cfcf5[_0x1781cd['field']]={'$like':'%'+_0x421e3b[_0xc988('0x2a')][_0xc988('0x34')]+'%'};return _0x4cfcf5;}})});}_0x298fba=_['merge']({},_0x298fba,_0x421e3b[_0xc988('0x39')]);var _0x339cb4={'where':_0x298fba['where']};return db[_0xc988('0x27')][_0xc988('0x18')](_0x339cb4)[_0xc988('0x20')](function(_0x150570){_0x45ce34[_0xc988('0x18')]=_0x150570;if(_0x421e3b[_0xc988('0x2a')][_0xc988('0x3a')]){_0x298fba['include']=[{'all':!![]}];}return db[_0xc988('0x27')][_0xc988('0x3b')](_0x298fba);})[_0xc988('0x20')](function(_0x1e48b1){_0x45ce34[_0xc988('0x3c')]=_0x1e48b1;return _0x45ce34;})[_0xc988('0x20')](respondWithFilteredResult(_0x222e51,_0x298fba))[_0xc988('0x3d')](handleError(_0x222e51,null));};exports[_0xc988('0x3e')]=function(_0x1688d1,_0x37d498){var _0x128d7b={'raw':!![],'where':{'id':_0x1688d1[_0xc988('0x3f')]['id']}},_0x4a748e={};_0x4a748e[_0xc988('0x29')]=_[_0xc988('0x40')](db[_0xc988('0x27')]['rawAttributes']);_0x4a748e['query']=_[_0xc988('0x40')](_0x1688d1[_0xc988('0x2a')]);_0x4a748e[_0xc988('0x32')]=_[_0xc988('0x2c')](_0x4a748e['model'],_0x4a748e[_0xc988('0x2a')]);_0x128d7b['attributes']=_[_0xc988('0x2c')](_0x4a748e[_0xc988('0x29')],qs[_0xc988('0x2d')](_0x1688d1['query'][_0xc988('0x2d')]));_0x128d7b[_0xc988('0x2b')]=_0x128d7b[_0xc988('0x2b')][_0xc988('0x2e')]?_0x128d7b[_0xc988('0x2b')]:_0x4a748e[_0xc988('0x29')];if(_0x1688d1[_0xc988('0x2a')][_0xc988('0x3a')]){_0x128d7b[_0xc988('0x41')]=[{'all':!![]}];}_0x128d7b=_[_0xc988('0x36')]({},_0x128d7b,_0x1688d1[_0xc988('0x39')]);return db['MailQueueReport']['find'](_0x128d7b)[_0xc988('0x20')](handleEntityNotFound(_0x37d498,null))[_0xc988('0x20')](respondWithResult(_0x37d498,null))[_0xc988('0x3d')](handleError(_0x37d498,null));};exports[_0xc988('0x42')]=function(_0xe07780,_0xbc36ae){return db[_0xc988('0x27')][_0xc988('0x42')](_0xe07780['body'],{})[_0xc988('0x20')](respondWithResult(_0xbc36ae,0xc9))['catch'](handleError(_0xbc36ae,null));};exports[_0xc988('0x1f')]=function(_0x29e7b8,_0x31fc4f){if(_0x29e7b8[_0xc988('0x43')]['id']){delete _0x29e7b8[_0xc988('0x43')]['id'];}return db['MailQueueReport'][_0xc988('0x44')]({'where':{'id':_0x29e7b8[_0xc988('0x3f')]['id']}})[_0xc988('0x20')](handleEntityNotFound(_0x31fc4f,null))['then'](saveUpdates(_0x29e7b8['body'],null))[_0xc988('0x20')](respondWithResult(_0x31fc4f,null))['catch'](handleError(_0x31fc4f,null));};exports['destroy']=function(_0x7dd79d,_0x8e45fd){return db[_0xc988('0x27')][_0xc988('0x44')]({'where':{'id':_0x7dd79d[_0xc988('0x3f')]['id']}})[_0xc988('0x20')](handleEntityNotFound(_0x8e45fd,null))[_0xc988('0x20')](removeEntity(_0x8e45fd,null))[_0xc988('0x3d')](handleError(_0x8e45fd,null));};exports[_0xc988('0x45')]=function(_0x59f799,_0x4bc1ea){return db['MailQueueReport'][_0xc988('0x45')]()[_0xc988('0x20')](respondWithResult(_0x4bc1ea,null))[_0xc988('0x3d')](handleError(_0x4bc1ea,null));}; \ No newline at end of file +var _0x7af9=['rows','catch','show','params','include','find','create','body','describe','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','set','Content-Range','apply','update','destroy','error','stack','name','send','MailQueueReport','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','map','field','then','includeAll','findAll'];(function(_0x39bc8c,_0x54a3d3){var _0x3fb0e8=function(_0x4acd5b){while(--_0x4acd5b){_0x39bc8c['push'](_0x39bc8c['shift']());}};_0x3fb0e8(++_0x54a3d3);}(_0x7af9,0x95));var _0x97af=function(_0x5dfcf5,_0x2ef0e6){_0x5dfcf5=_0x5dfcf5-0x0;var _0x42660c=_0x7af9[_0x5dfcf5];return _0x42660c;};'use strict';var pdf=require(_0x97af('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x97af('0x1'));var zipdir=require(_0x97af('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x97af('0x3'));var moment=require(_0x97af('0x4'));var BPromise=require(_0x97af('0x5'));var Mustache=require(_0x97af('0x6'));var util=require(_0x97af('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x97af('0x8'));var fs=require('fs');var _=require(_0x97af('0x9'));var squel=require(_0x97af('0xa'));var crypto=require(_0x97af('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x97af('0xc'));var toCsv=require(_0x97af('0xd'));var querystring=require(_0x97af('0xe'));var Papa=require('papaparse');var Redis=require(_0x97af('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x97af('0x10'));var hardwareService=require(_0x97af('0x11'));var logger=require(_0x97af('0x12'))(_0x97af('0x13'));var utils=require(_0x97af('0x14'));var config=require(_0x97af('0x15'));var db=require(_0x97af('0x16'))['db'];function respondWithStatusCode(_0x144362,_0x25ce6a){_0x25ce6a=_0x25ce6a||0xcc;return function(_0xe25888){if(_0xe25888){return _0x144362[_0x97af('0x17')](_0x25ce6a);}return _0x144362['status'](_0x25ce6a)[_0x97af('0x18')]();};}function respondWithResult(_0x47e563,_0x5c2553){_0x5c2553=_0x5c2553||0xc8;return function(_0x86027d){if(_0x86027d){return _0x47e563[_0x97af('0x19')](_0x5c2553)[_0x97af('0x1a')](_0x86027d);}};}function respondWithFilteredResult(_0xbf7de1,_0x43eb12){return function(_0x256fac){if(_0x256fac){var _0x3053af=_0x256fac[_0x97af('0x1b')],_0x4bd6dd=_0x43eb12['offset'],_0x281f8a=_0x43eb12[_0x97af('0x1c')]+_0x43eb12['limit'],_0x4e679e;if(_0x281f8a>=_0x3053af){_0x281f8a=_0x3053af;_0x4e679e=0xc8;}else{_0x4e679e=0xce;}_0xbf7de1[_0x97af('0x19')](_0x4e679e);return _0xbf7de1[_0x97af('0x1d')](_0x97af('0x1e'),_0x4bd6dd+'-'+_0x281f8a+'/'+_0x3053af)[_0x97af('0x1a')](_0x256fac);}return null;};}function patchUpdates(_0xc5c15f){return function(_0x5ad2bc){try{jsonpatch[_0x97af('0x1f')](_0x5ad2bc,_0xc5c15f,!![]);}catch(_0x4a6bca){return BPromise['reject'](_0x4a6bca);}return _0x5ad2bc['save']();};}function saveUpdates(_0x454140,_0x3447ce){return function(_0x5dcd87){if(_0x5dcd87){return _0x5dcd87[_0x97af('0x20')](_0x454140)['then'](function(_0x2a77f0){return _0x2a77f0;});}return null;};}function removeEntity(_0x5af909,_0x3b638f){return function(_0x3c2e52){if(_0x3c2e52){return _0x3c2e52[_0x97af('0x21')]()['then'](function(){_0x5af909[_0x97af('0x19')](0xcc)[_0x97af('0x18')]();});}};}function handleEntityNotFound(_0xe1679b,_0x4c916c){return function(_0x1a08b0){if(!_0x1a08b0){_0xe1679b[_0x97af('0x17')](0x194);}return _0x1a08b0;};}function handleError(_0x275e8c,_0x41122c){_0x41122c=_0x41122c||0x1f4;return function(_0x5ad95e){logger[_0x97af('0x22')](_0x5ad95e[_0x97af('0x23')]);if(_0x5ad95e[_0x97af('0x24')]){delete _0x5ad95e[_0x97af('0x24')];}_0x275e8c[_0x97af('0x19')](_0x41122c)[_0x97af('0x25')](_0x5ad95e);};}exports['index']=function(_0x36400d,_0x301452){var _0x394bf9={},_0x444926={},_0x465708={'count':0x0,'rows':[]};var _0x4ced71=db[_0x97af('0x26')][_0x97af('0x27')];_0x444926['model']=_[_0x97af('0x28')](_0x4ced71);_0x444926[_0x97af('0x29')]=_[_0x97af('0x28')](_0x36400d[_0x97af('0x29')]);_0x444926[_0x97af('0x2a')]=_[_0x97af('0x2b')](_0x444926[_0x97af('0x2c')],_0x444926[_0x97af('0x29')]);_0x394bf9[_0x97af('0x2d')]=_[_0x97af('0x2b')](_0x444926['model'],qs[_0x97af('0x2e')](_0x36400d['query'][_0x97af('0x2e')]));_0x394bf9[_0x97af('0x2d')]=_0x394bf9[_0x97af('0x2d')][_0x97af('0x2f')]?_0x394bf9[_0x97af('0x2d')]:_0x444926[_0x97af('0x2c')];if(!_0x36400d[_0x97af('0x29')][_0x97af('0x30')](_0x97af('0x31'))){_0x394bf9[_0x97af('0x32')]=qs['limit'](_0x36400d[_0x97af('0x29')][_0x97af('0x32')]);_0x394bf9['offset']=qs[_0x97af('0x1c')](_0x36400d['query'][_0x97af('0x1c')]);}_0x394bf9['order']=qs['sort'](_0x36400d[_0x97af('0x29')][_0x97af('0x33')]);_0x394bf9[_0x97af('0x34')]=qs['filters'](_[_0x97af('0x35')](_0x36400d[_0x97af('0x29')],_0x444926[_0x97af('0x2a')]));if(_0x36400d[_0x97af('0x29')][_0x97af('0x36')]){_0x394bf9['where']=_[_0x97af('0x37')](_0x394bf9[_0x97af('0x34')],{'$or':_[_0x97af('0x38')](_0x4ced71,function(_0x22eac0){if(_0x22eac0['type']['key']!=='VIRTUAL'){var _0x33ccdb={};_0x33ccdb[_0x22eac0[_0x97af('0x39')]]={'$like':'%'+_0x36400d[_0x97af('0x29')][_0x97af('0x36')]+'%'};return _0x33ccdb;}})});}_0x394bf9=_['merge']({},_0x394bf9,_0x36400d['options']);var _0x55f1d4={'where':_0x394bf9[_0x97af('0x34')]};return db[_0x97af('0x26')][_0x97af('0x1b')](_0x55f1d4)[_0x97af('0x3a')](function(_0x13a4ad){_0x465708[_0x97af('0x1b')]=_0x13a4ad;if(_0x36400d['query'][_0x97af('0x3b')]){_0x394bf9['include']=[{'all':!![]}];}return db['MailQueueReport'][_0x97af('0x3c')](_0x394bf9);})[_0x97af('0x3a')](function(_0x31796d){_0x465708[_0x97af('0x3d')]=_0x31796d;return _0x465708;})['then'](respondWithFilteredResult(_0x301452,_0x394bf9))[_0x97af('0x3e')](handleError(_0x301452,null));};exports[_0x97af('0x3f')]=function(_0x179c5f,_0x466e59){var _0x1fe083={'raw':!![],'where':{'id':_0x179c5f[_0x97af('0x40')]['id']}},_0x3252a5={};_0x3252a5[_0x97af('0x2c')]=_['keys'](db[_0x97af('0x26')][_0x97af('0x27')]);_0x3252a5['query']=_['keys'](_0x179c5f[_0x97af('0x29')]);_0x3252a5[_0x97af('0x2a')]=_[_0x97af('0x2b')](_0x3252a5[_0x97af('0x2c')],_0x3252a5[_0x97af('0x29')]);_0x1fe083[_0x97af('0x2d')]=_[_0x97af('0x2b')](_0x3252a5[_0x97af('0x2c')],qs[_0x97af('0x2e')](_0x179c5f[_0x97af('0x29')][_0x97af('0x2e')]));_0x1fe083[_0x97af('0x2d')]=_0x1fe083[_0x97af('0x2d')][_0x97af('0x2f')]?_0x1fe083[_0x97af('0x2d')]:_0x3252a5[_0x97af('0x2c')];if(_0x179c5f[_0x97af('0x29')][_0x97af('0x3b')]){_0x1fe083[_0x97af('0x41')]=[{'all':!![]}];}_0x1fe083=_[_0x97af('0x37')]({},_0x1fe083,_0x179c5f['options']);return db[_0x97af('0x26')][_0x97af('0x42')](_0x1fe083)[_0x97af('0x3a')](handleEntityNotFound(_0x466e59,null))[_0x97af('0x3a')](respondWithResult(_0x466e59,null))[_0x97af('0x3e')](handleError(_0x466e59,null));};exports[_0x97af('0x43')]=function(_0x41e77c,_0x10cfeb){return db[_0x97af('0x26')][_0x97af('0x43')](_0x41e77c[_0x97af('0x44')],{})[_0x97af('0x3a')](respondWithResult(_0x10cfeb,0xc9))[_0x97af('0x3e')](handleError(_0x10cfeb,null));};exports[_0x97af('0x20')]=function(_0x3299f9,_0x17b3aa){if(_0x3299f9[_0x97af('0x44')]['id']){delete _0x3299f9[_0x97af('0x44')]['id'];}return db[_0x97af('0x26')]['find']({'where':{'id':_0x3299f9[_0x97af('0x40')]['id']}})[_0x97af('0x3a')](handleEntityNotFound(_0x17b3aa,null))['then'](saveUpdates(_0x3299f9[_0x97af('0x44')],null))[_0x97af('0x3a')](respondWithResult(_0x17b3aa,null))['catch'](handleError(_0x17b3aa,null));};exports[_0x97af('0x21')]=function(_0x8ab790,_0x5bbbe3){return db[_0x97af('0x26')][_0x97af('0x42')]({'where':{'id':_0x8ab790['params']['id']}})['then'](handleEntityNotFound(_0x5bbbe3,null))[_0x97af('0x3a')](removeEntity(_0x5bbbe3,null))['catch'](handleError(_0x5bbbe3,null));};exports[_0x97af('0x45')]=function(_0x52f29c,_0x5700ba){return db['MailQueueReport'][_0x97af('0x45')]()[_0x97af('0x3a')](respondWithResult(_0x5700ba,null))[_0x97af('0x3e')](handleError(_0x5700ba,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index c5c5ab0..51cfbcc 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 _0x3306=['api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger'];(function(_0x30b8e3,_0x34374f){var _0x373b91=function(_0x5d597f){while(--_0x5d597f){_0x30b8e3['push'](_0x30b8e3['shift']());}};_0x373b91(++_0x34374f);}(_0x3306,0x107));var _0x6330=function(_0xa315ea,_0x2c09df){_0xa315ea=_0xa315ea-0x0;var _0x56600a=_0x3306[_0xa315ea];return _0x56600a;};'use strict';var _=require(_0x6330('0x0'));var util=require(_0x6330('0x1'));var logger=require(_0x6330('0x2'))(_0x6330('0x3'));var moment=require('moment');var BPromise=require(_0x6330('0x4'));var rp=require(_0x6330('0x5'));var fs=require('fs');var path=require(_0x6330('0x6'));var rimraf=require(_0x6330('0x7'));var config=require(_0x6330('0x8'));var attributes=require('./mailQueueReport.attributes');module[_0x6330('0x9')]=function(_0x457797,_0x2942ec){return _0x457797[_0x6330('0xa')](_0x6330('0xb'),attributes,{'tableName':_0x6330('0xc'),'paranoid':![],'indexes':[{'name':_0x6330('0xd'),'fields':[_0x6330('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf2a6=['request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','uniqueid','lodash','moment'];(function(_0x2bbc07,_0x1e2168){var _0x6879e4=function(_0x290fa1){while(--_0x290fa1){_0x2bbc07['push'](_0x2bbc07['shift']());}};_0x6879e4(++_0x1e2168);}(_0xf2a6,0x13d));var _0x6f2a=function(_0x2488dd,_0x179b25){_0x2488dd=_0x2488dd-0x0;var _0x22f435=_0xf2a6[_0x2488dd];return _0x22f435;};'use strict';var _=require(_0x6f2a('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x6f2a('0x1'));var BPromise=require('bluebird');var rp=require(_0x6f2a('0x2'));var fs=require('fs');var path=require(_0x6f2a('0x3'));var rimraf=require(_0x6f2a('0x4'));var config=require(_0x6f2a('0x5'));var attributes=require(_0x6f2a('0x6'));module[_0x6f2a('0x7')]=function(_0x4684f4,_0x19ebe9){return _0x4684f4[_0x6f2a('0x8')](_0x6f2a('0x9'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x6f2a('0xa'),'fields':[_0x6f2a('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 97ca3cd..4ae5e27 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 _0x0b51=['then','info','MailQueueReport,\x20%s,\x20%s','debug','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateMailQueueReport','create','options','raw','stringify','UpdateMailQueueReport','MailQueueReport','body','where','attributes','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0xf493a5,_0x2c5f9b){var _0x1e6e5e=function(_0x12872b){while(--_0x12872b){_0xf493a5['push'](_0xf493a5['shift']());}};_0x1e6e5e(++_0x2c5f9b);}(_0x0b51,0x99));var _0x10b5=function(_0x5122cf,_0x5e24e6){_0x5122cf=_0x5122cf-0x0;var _0x1088f4=_0x0b51[_0x5122cf];return _0x1088f4;};'use strict';var _=require(_0x10b5('0x0'));var util=require(_0x10b5('0x1'));var moment=require(_0x10b5('0x2'));var BPromise=require(_0x10b5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x10b5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x10b5('0x5'));var logger=require(_0x10b5('0x6'))('rpc');var config=require(_0x10b5('0x7'));var jayson=require(_0x10b5('0x8'));var client=jayson[_0x10b5('0x9')][_0x10b5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c1a66,_0x21480a,_0x318b6c){return new BPromise(function(_0x2bbf3d,_0x44aa93){return client[_0x10b5('0xb')](_0x5c1a66,_0x318b6c)[_0x10b5('0xc')](function(_0x29ebdf){logger[_0x10b5('0xd')](_0x10b5('0xe'),_0x21480a,'request\x20sent');logger[_0x10b5('0xf')](_0x10b5('0x10'),_0x21480a,_0x10b5('0x11'),JSON['stringify'](_0x29ebdf));if(_0x29ebdf[_0x10b5('0x12')]){if(_0x29ebdf['error'][_0x10b5('0x13')]===0x1f4){logger[_0x10b5('0x12')](_0x10b5('0xe'),_0x21480a,_0x29ebdf[_0x10b5('0x12')][_0x10b5('0x14')]);return _0x44aa93(_0x29ebdf[_0x10b5('0x12')][_0x10b5('0x14')]);}logger[_0x10b5('0x12')]('MailQueueReport,\x20%s,\x20%s',_0x21480a,_0x29ebdf[_0x10b5('0x12')][_0x10b5('0x14')]);return _0x2bbf3d(_0x29ebdf[_0x10b5('0x12')][_0x10b5('0x14')]);}else{logger['info'](_0x10b5('0xe'),_0x21480a,_0x10b5('0x11'));_0x2bbf3d(_0x29ebdf[_0x10b5('0x15')][_0x10b5('0x14')]);}})[_0x10b5('0x16')](function(_0x132b58){logger[_0x10b5('0x12')]('MailQueueReport,\x20%s,\x20%s',_0x21480a,_0x132b58);_0x44aa93(_0x132b58);});});}exports[_0x10b5('0x17')]=function(_0x24dc34){var _0x1439a9=this;return new Promise(function(_0x50d872,_0x24cbc0){return db['MailQueueReport'][_0x10b5('0x18')](_0x24dc34['body'],{'raw':_0x24dc34['options']?_0x24dc34[_0x10b5('0x19')][_0x10b5('0x1a')]===undefined?!![]:![]:!![]})[_0x10b5('0xc')](function(_0x1ad789){logger[_0x10b5('0xd')](_0x10b5('0x17'),_0x24dc34);logger['debug']('CreateMailQueueReport',_0x24dc34,JSON[_0x10b5('0x1b')](_0x1ad789));_0x50d872(_0x1ad789);})[_0x10b5('0x16')](function(_0x1fcc23){logger[_0x10b5('0x12')]('CreateMailQueueReport',_0x1fcc23[_0x10b5('0x14')],_0x24dc34);_0x24cbc0(_0x1439a9['error'](0x1f4,_0x1fcc23[_0x10b5('0x14')]));});});};exports[_0x10b5('0x1c')]=function(_0xcc9fa3){var _0x2fd449=this;return new Promise(function(_0x4f8e2a,_0x1a81a4){return db[_0x10b5('0x1d')]['update'](_0xcc9fa3[_0x10b5('0x1e')],{'raw':_0xcc9fa3[_0x10b5('0x19')]?_0xcc9fa3['options'][_0x10b5('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xcc9fa3['options']?_0xcc9fa3['options'][_0x10b5('0x1f')]||null:null,'attributes':_0xcc9fa3['options']?_0xcc9fa3[_0x10b5('0x19')][_0x10b5('0x20')]||null:null,'limit':_0xcc9fa3[_0x10b5('0x19')]?_0xcc9fa3[_0x10b5('0x19')]['limit']||null:null})[_0x10b5('0xc')](function(_0x2d3efb){logger['info'](_0x10b5('0x1c'),_0xcc9fa3);logger['debug'](_0x10b5('0x1c'),_0xcc9fa3,JSON[_0x10b5('0x1b')](_0x2d3efb));_0x4f8e2a(_0x2d3efb);})[_0x10b5('0x16')](function(_0x182652){logger[_0x10b5('0x12')]('UpdateMailQueueReport',_0x182652[_0x10b5('0x14')],_0xcc9fa3);_0x1a81a4(_0x2fd449[_0x10b5('0x12')](0x1f4,_0x182652[_0x10b5('0x14')]));});});}; \ No newline at end of file +var _0x94af=['jayson/promise','client','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','MailQueueReport','body','options','info','CreateMailQueueReport','debug','UpdateMailQueueReport','raw','lodash','util','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x206da4,_0x39823f){var _0x1a09ae=function(_0x3e03ac){while(--_0x3e03ac){_0x206da4['push'](_0x206da4['shift']());}};_0x1a09ae(++_0x39823f);}(_0x94af,0xdb));var _0xf94a=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0x94af[_0x18a79d];return _0x4f8848;};'use strict';var _=require(_0xf94a('0x0'));var util=require(_0xf94a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf94a('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xf94a('0x3'));var logger=require(_0xf94a('0x4'))(_0xf94a('0x5'));var config=require('../../config/environment');var jayson=require(_0xf94a('0x6'));var client=jayson[_0xf94a('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x177153,_0x5aec9,_0x48e40f){return new BPromise(function(_0x1513dc,_0x2acb68){return client[_0xf94a('0x8')](_0x177153,_0x48e40f)[_0xf94a('0x9')](function(_0x2256e9){logger['info'](_0xf94a('0xa'),_0x5aec9,'request\x20sent');logger['debug']('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x5aec9,_0xf94a('0xb'),JSON[_0xf94a('0xc')](_0x2256e9));if(_0x2256e9[_0xf94a('0xd')]){if(_0x2256e9['error'][_0xf94a('0xe')]===0x1f4){logger[_0xf94a('0xd')]('MailQueueReport,\x20%s,\x20%s',_0x5aec9,_0x2256e9['error'][_0xf94a('0xf')]);return _0x2acb68(_0x2256e9[_0xf94a('0xd')][_0xf94a('0xf')]);}logger['error']('MailQueueReport,\x20%s,\x20%s',_0x5aec9,_0x2256e9[_0xf94a('0xd')][_0xf94a('0xf')]);return _0x1513dc(_0x2256e9[_0xf94a('0xd')][_0xf94a('0xf')]);}else{logger['info'](_0xf94a('0xa'),_0x5aec9,_0xf94a('0xb'));_0x1513dc(_0x2256e9['result'][_0xf94a('0xf')]);}})[_0xf94a('0x10')](function(_0x26e085){logger[_0xf94a('0xd')](_0xf94a('0xa'),_0x5aec9,_0x26e085);_0x2acb68(_0x26e085);});});}exports['CreateMailQueueReport']=function(_0x2658bf){var _0x160d30=this;return new Promise(function(_0x39e0d9,_0x2d53f7){return db[_0xf94a('0x11')]['create'](_0x2658bf[_0xf94a('0x12')],{'raw':_0x2658bf['options']?_0x2658bf[_0xf94a('0x13')]['raw']===undefined?!![]:![]:!![]})[_0xf94a('0x9')](function(_0x1d170b){logger[_0xf94a('0x14')](_0xf94a('0x15'),_0x2658bf);logger[_0xf94a('0x16')](_0xf94a('0x15'),_0x2658bf,JSON[_0xf94a('0xc')](_0x1d170b));_0x39e0d9(_0x1d170b);})[_0xf94a('0x10')](function(_0x3c631e){logger['error']('CreateMailQueueReport',_0x3c631e['message'],_0x2658bf);_0x2d53f7(_0x160d30[_0xf94a('0xd')](0x1f4,_0x3c631e[_0xf94a('0xf')]));});});};exports[_0xf94a('0x17')]=function(_0x32a854){var _0x4593e0=this;return new Promise(function(_0x475c35,_0x2bcb30){return db[_0xf94a('0x11')]['update'](_0x32a854[_0xf94a('0x12')],{'raw':_0x32a854[_0xf94a('0x13')]?_0x32a854[_0xf94a('0x13')][_0xf94a('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32a854[_0xf94a('0x13')]?_0x32a854[_0xf94a('0x13')]['where']||null:null,'attributes':_0x32a854[_0xf94a('0x13')]?_0x32a854[_0xf94a('0x13')]['attributes']||null:null,'limit':_0x32a854[_0xf94a('0x13')]?_0x32a854[_0xf94a('0x13')]['limit']||null:null})[_0xf94a('0x9')](function(_0x19eb81){logger[_0xf94a('0x14')](_0xf94a('0x17'),_0x32a854);logger[_0xf94a('0x16')]('UpdateMailQueueReport',_0x32a854,JSON[_0xf94a('0xc')](_0x19eb81));_0x475c35(_0x19eb81);})['catch'](function(_0x540adc){logger[_0xf94a('0xd')]('UpdateMailQueueReport',_0x540adc[_0xf94a('0xf')],_0x32a854);_0x2bcb30(_0x4593e0[_0xf94a('0xd')](0x1f4,_0x540adc[_0xf94a('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 475d6ad..a5bf323 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 _0xb934=['../../components/interaction/service','../../config/environment','multer','util','path','express','Router','../../components/auth/service'];(function(_0x17d464,_0x26516f){var _0x35649e=function(_0x4f8150){while(--_0x4f8150){_0x17d464['push'](_0x17d464['shift']());}};_0x35649e(++_0x26516f);}(_0xb934,0x92));var _0x4b93=function(_0xbc1860,_0x442fb6){_0xbc1860=_0xbc1860-0x0;var _0x35bd45=_0xb934[_0xbc1860];return _0x35bd45;};'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'));module['exports']=router; \ No newline at end of file +var _0xd916=['../../components/auth/service','../../components/interaction/service','multer','util','path','connect-timeout','express'];(function(_0xf9aabc,_0x8ca5dc){var _0x826cb8=function(_0x55461b){while(--_0x55461b){_0xf9aabc['push'](_0xf9aabc['shift']());}};_0x826cb8(++_0x8ca5dc);}(_0xd916,0x18a));var _0x6d91=function(_0x43d5d5,_0x40fae7){_0x43d5d5=_0x43d5d5-0x0;var _0x42871f=_0xd916[_0x43d5d5];return _0x42871f;};'use strict';var multer=require(_0x6d91('0x0'));var util=require(_0x6d91('0x1'));var path=require(_0x6d91('0x2'));var timeout=require(_0x6d91('0x3'));var express=require(_0x6d91('0x4'));var router=express['Router']();var auth=require(_0x6d91('0x5'));var interaction=require(_0x6d91('0x6'));var config=require('../../config/environment');module['exports']=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 037f445..e061cb3 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 _0xee5b=['sequelize','STRING','username','INTEGER','INBOX'];(function(_0x3a8e53,_0xdb0462){var _0x2cc09b=function(_0x586476){while(--_0x586476){_0x3a8e53['push'](_0x3a8e53['shift']());}};_0x2cc09b(++_0xdb0462);}(_0xee5b,0x1f4));var _0xbee5=function(_0x399b7c,_0x195726){_0x399b7c=_0x399b7c-0x0;var _0x271c1f=_0xee5b[_0x399b7c];return _0x271c1f;};'use strict';var Sequelize=require(_0xbee5('0x0'));module['exports']={'description':{'type':Sequelize[_0xbee5('0x1')]},'host':{'type':Sequelize[_0xbee5('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0xbee5('0x1')],'unique':_0xbee5('0x2')},'password':{'type':Sequelize[_0xbee5('0x1')]},'port':{'type':Sequelize[_0xbee5('0x3')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0xbee5('0x4')},'connTimeout':{'type':Sequelize[_0xbee5('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xbee5('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0xbee5('0x1')]}}; \ No newline at end of file +var _0x8130=['username','INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x5522a2,_0x4c688e){var _0x41a141=function(_0x4d573d){while(--_0x4d573d){_0x5522a2['push'](_0x5522a2['shift']());}};_0x41a141(++_0x4c688e);}(_0x8130,0x146));var _0x0813=function(_0x39938f,_0x27d36f){_0x39938f=_0x39938f-0x0;var _0x1bd74b=_0x8130[_0x39938f];return _0x1bd74b;};'use strict';var Sequelize=require(_0x0813('0x0'));module[_0x0813('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x0813('0x2')]},'authentication':{'type':Sequelize[_0x0813('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x0813('0x2')],'unique':_0x0813('0x4')},'password':{'type':Sequelize[_0x0813('0x2')]},'port':{'type':Sequelize[_0x0813('0x5')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x0813('0x2')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x0813('0x5')],'defaultValue':0x5},'service':{'type':Sequelize[_0x0813('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index a481d49..bd00707 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 _0x225b=['mail_servers_in','lodash','util','api','moment','request-promise','rimraf','./mailServerIn.attributes','exports','define','MailServerIn'];(function(_0x25bc76,_0x23fb00){var _0x4f9945=function(_0x5b48d3){while(--_0x5b48d3){_0x25bc76['push'](_0x25bc76['shift']());}};_0x4f9945(++_0x23fb00);}(_0x225b,0xb1));var _0xb225=function(_0x28d416,_0x33ebc6){_0x28d416=_0x28d416-0x0;var _0x2bb257=_0x225b[_0x28d416];return _0x2bb257;};'use strict';var _=require(_0xb225('0x0'));var util=require(_0xb225('0x1'));var logger=require('../../config/logger')(_0xb225('0x2'));var moment=require(_0xb225('0x3'));var BPromise=require('bluebird');var rp=require(_0xb225('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb225('0x5'));var config=require('../../config/environment');var attributes=require(_0xb225('0x6'));module[_0xb225('0x7')]=function(_0x3f2419,_0x4751e2){return _0x3f2419[_0xb225('0x8')](_0xb225('0x9'),attributes,{'tableName':_0xb225('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbcff=['bluebird','rimraf','../../config/environment','exports','define','MailServerIn','mail_servers_in','lodash','../../config/logger','moment'];(function(_0x46d134,_0x209701){var _0x430d2c=function(_0x13f3c6){while(--_0x13f3c6){_0x46d134['push'](_0x46d134['shift']());}};_0x430d2c(++_0x209701);}(_0xbcff,0xbb));var _0xfbcf=function(_0x2783a4,_0x2f04df){_0x2783a4=_0x2783a4-0x0;var _0x101483=_0xbcff[_0x2783a4];return _0x101483;};'use strict';var _=require(_0xfbcf('0x0'));var util=require('util');var logger=require(_0xfbcf('0x1'))('api');var moment=require(_0xfbcf('0x2'));var BPromise=require(_0xfbcf('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xfbcf('0x4'));var config=require(_0xfbcf('0x5'));var attributes=require('./mailServerIn.attributes');module[_0xfbcf('0x6')]=function(_0x454884,_0x33bde0){return _0x454884[_0xfbcf('0x7')](_0xfbcf('0x8'),attributes,{'tableName':_0xfbcf('0x9'),'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 fbc1676..3182216 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 _0x4a11=['attributes','map','include','model','then','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetMailServerIn','findAll','options','raw'];(function(_0x30d3c1,_0xa3da89){var _0x571ee9=function(_0xcbe38d){while(--_0xcbe38d){_0x30d3c1['push'](_0x30d3c1['shift']());}};_0x571ee9(++_0xa3da89);}(_0x4a11,0xfd));var _0x14a1=function(_0x57d6c3,_0x5ac8b8){_0x57d6c3=_0x57d6c3-0x0;var _0x4c101c=_0x4a11[_0x57d6c3];return _0x4c101c;};'use strict';var _=require(_0x14a1('0x0'));var util=require('util');var moment=require(_0x14a1('0x1'));var BPromise=require('bluebird');var rs=require(_0x14a1('0x2'));var fs=require('fs');var Redis=require(_0x14a1('0x3'));var db=require(_0x14a1('0x4'))['db'];var utils=require(_0x14a1('0x5'));var logger=require(_0x14a1('0x6'))(_0x14a1('0x7'));var config=require(_0x14a1('0x8'));var jayson=require(_0x14a1('0x9'));var client=jayson[_0x14a1('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x37dc15,_0x245369,_0x340d14){return new BPromise(function(_0x407f7b,_0x43a63c){return client[_0x14a1('0xb')](_0x37dc15,_0x340d14)['then'](function(_0x24c954){logger[_0x14a1('0xc')](_0x14a1('0xd'),_0x245369,_0x14a1('0xe'));logger[_0x14a1('0xf')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x245369,_0x14a1('0xe'),JSON[_0x14a1('0x10')](_0x24c954));if(_0x24c954[_0x14a1('0x11')]){if(_0x24c954[_0x14a1('0x11')][_0x14a1('0x12')]===0x1f4){logger[_0x14a1('0x11')](_0x14a1('0xd'),_0x245369,_0x24c954[_0x14a1('0x11')]['message']);return _0x43a63c(_0x24c954[_0x14a1('0x11')][_0x14a1('0x13')]);}logger[_0x14a1('0x11')](_0x14a1('0xd'),_0x245369,_0x24c954['error'][_0x14a1('0x13')]);return _0x407f7b(_0x24c954['error'][_0x14a1('0x13')]);}else{logger[_0x14a1('0xc')]('MailServerIn,\x20%s,\x20%s',_0x245369,_0x14a1('0xe'));_0x407f7b(_0x24c954[_0x14a1('0x14')][_0x14a1('0x13')]);}})[_0x14a1('0x15')](function(_0x256a4c){logger[_0x14a1('0x11')](_0x14a1('0xd'),_0x245369,_0x256a4c);_0x43a63c(_0x256a4c);});});}exports[_0x14a1('0x16')]=function(_0x4e4e6f){var _0x499e4f=this;return new Promise(function(_0x1b3a35,_0x37289b){return db['MailServerIn'][_0x14a1('0x17')]({'raw':_0x4e4e6f['options']?_0x4e4e6f[_0x14a1('0x18')][_0x14a1('0x19')]===undefined?!![]:![]:!![],'where':_0x4e4e6f[_0x14a1('0x18')]?_0x4e4e6f[_0x14a1('0x18')]['where']||null:null,'attributes':_0x4e4e6f[_0x14a1('0x18')]?_0x4e4e6f[_0x14a1('0x18')][_0x14a1('0x1a')]||null:null,'limit':_0x4e4e6f[_0x14a1('0x18')]?_0x4e4e6f[_0x14a1('0x18')]['limit']||null:null,'include':_0x4e4e6f['options']?_0x4e4e6f['options']['include']?_[_0x14a1('0x1b')](_0x4e4e6f[_0x14a1('0x18')][_0x14a1('0x1c')],function(_0x2cac31){return{'model':db[_0x2cac31[_0x14a1('0x1d')]],'as':_0x2cac31['as'],'attributes':_0x2cac31['attributes'],'include':_0x2cac31['include']?_[_0x14a1('0x1b')](_0x2cac31[_0x14a1('0x1c')],function(_0x3ca3bd){return{'model':db[_0x3ca3bd[_0x14a1('0x1d')]],'as':_0x3ca3bd['as'],'attributes':_0x3ca3bd[_0x14a1('0x1a')],'include':_0x3ca3bd[_0x14a1('0x1c')]?_[_0x14a1('0x1b')](_0x3ca3bd[_0x14a1('0x1c')],function(_0x1d297a){return{'model':db[_0x1d297a[_0x14a1('0x1d')]],'as':_0x1d297a['as'],'attributes':_0x1d297a[_0x14a1('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x14a1('0x1e')](function(_0x1b9db8){logger[_0x14a1('0xc')]('GetMailServerIn',_0x4e4e6f);logger[_0x14a1('0xf')](_0x14a1('0x16'),_0x4e4e6f,JSON[_0x14a1('0x10')](_0x1b9db8));_0x1b3a35(_0x1b9db8);})[_0x14a1('0x15')](function(_0x5b151d){logger['error']('GetMailServerIn',_0x5b151d[_0x14a1('0x13')],_0x4e4e6f);_0x37289b(_0x499e4f[_0x14a1('0x11')](0x1f4,_0x5b151d[_0x14a1('0x13')]));});});}; \ No newline at end of file +var _0x711c=['info','MailServerIn,\x20%s,\x20%s','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','where','attributes','include','map','model','debug','stringify','lodash','util','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x711c,0x74));var _0xc711=function(_0x160426,_0x13c7ff){_0x160426=_0x160426-0x0;var _0x649ad0=_0x711c[_0x160426];return _0x649ad0;};'use strict';var _=require(_0xc711('0x0'));var util=require(_0xc711('0x1'));var moment=require('moment');var BPromise=require(_0xc711('0x2'));var rs=require(_0xc711('0x3'));var fs=require('fs');var Redis=require(_0xc711('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc711('0x5'));var config=require(_0xc711('0x6'));var jayson=require(_0xc711('0x7'));var client=jayson[_0xc711('0x8')][_0xc711('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2181f5,_0x5b1833,_0x33181a){return new BPromise(function(_0xdcca20,_0xf860b7){return client[_0xc711('0xa')](_0x2181f5,_0x33181a)[_0xc711('0xb')](function(_0x4cc6c4){logger[_0xc711('0xc')](_0xc711('0xd'),_0x5b1833,_0xc711('0xe'));logger['debug'](_0xc711('0xf'),_0x5b1833,_0xc711('0xe'),JSON['stringify'](_0x4cc6c4));if(_0x4cc6c4[_0xc711('0x10')]){if(_0x4cc6c4['error'][_0xc711('0x11')]===0x1f4){logger[_0xc711('0x10')](_0xc711('0xd'),_0x5b1833,_0x4cc6c4[_0xc711('0x10')]['message']);return _0xf860b7(_0x4cc6c4['error']['message']);}logger[_0xc711('0x10')](_0xc711('0xd'),_0x5b1833,_0x4cc6c4[_0xc711('0x10')][_0xc711('0x12')]);return _0xdcca20(_0x4cc6c4[_0xc711('0x10')][_0xc711('0x12')]);}else{logger[_0xc711('0xc')](_0xc711('0xd'),_0x5b1833,_0xc711('0xe'));_0xdcca20(_0x4cc6c4[_0xc711('0x13')]['message']);}})[_0xc711('0x14')](function(_0x3bcd5a){logger[_0xc711('0x10')](_0xc711('0xd'),_0x5b1833,_0x3bcd5a);_0xf860b7(_0x3bcd5a);});});}exports[_0xc711('0x15')]=function(_0x1b354d){var _0x74f4d6=this;return new Promise(function(_0x733232,_0x1e234a){return db[_0xc711('0x16')][_0xc711('0x17')]({'raw':_0x1b354d['options']?_0x1b354d[_0xc711('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1b354d['options']?_0x1b354d[_0xc711('0x18')][_0xc711('0x19')]||null:null,'attributes':_0x1b354d[_0xc711('0x18')]?_0x1b354d['options'][_0xc711('0x1a')]||null:null,'limit':_0x1b354d[_0xc711('0x18')]?_0x1b354d['options']['limit']||null:null,'include':_0x1b354d['options']?_0x1b354d[_0xc711('0x18')][_0xc711('0x1b')]?_[_0xc711('0x1c')](_0x1b354d[_0xc711('0x18')][_0xc711('0x1b')],function(_0x3389e2){return{'model':db[_0x3389e2[_0xc711('0x1d')]],'as':_0x3389e2['as'],'attributes':_0x3389e2[_0xc711('0x1a')],'include':_0x3389e2[_0xc711('0x1b')]?_[_0xc711('0x1c')](_0x3389e2[_0xc711('0x1b')],function(_0x4b9239){return{'model':db[_0x4b9239[_0xc711('0x1d')]],'as':_0x4b9239['as'],'attributes':_0x4b9239[_0xc711('0x1a')],'include':_0x4b9239[_0xc711('0x1b')]?_['map'](_0x4b9239['include'],function(_0x4a4ff1){return{'model':db[_0x4a4ff1[_0xc711('0x1d')]],'as':_0x4a4ff1['as'],'attributes':_0x4a4ff1[_0xc711('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x51ad14){logger[_0xc711('0xc')](_0xc711('0x15'),_0x1b354d);logger[_0xc711('0x1e')]('GetMailServerIn',_0x1b354d,JSON[_0xc711('0x1f')](_0x51ad14));_0x733232(_0x51ad14);})[_0xc711('0x14')](function(_0x42f7d8){logger[_0xc711('0x10')](_0xc711('0x15'),_0x42f7d8[_0xc711('0x12')],_0x1b354d);_0x1e234a(_0x74f4d6['error'](0x1f4,_0x42f7d8['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 0027fc3..415c337 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 _0x5e91=['multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get','isAuthenticated','index','/:id','post','create','update','delete','destroy','exports'];(function(_0x593875,_0x2fb66d){var _0x57da08=function(_0x12ace6){while(--_0x12ace6){_0x593875['push'](_0x593875['shift']());}};_0x57da08(++_0x2fb66d);}(_0x5e91,0x7e));var _0x15e9=function(_0x2ecfca,_0x4f5d2c){_0x2ecfca=_0x2ecfca-0x0;var _0x3cbd36=_0x5e91[_0x2ecfca];return _0x3cbd36;};'use strict';var multer=require(_0x15e9('0x0'));var util=require('util');var path=require(_0x15e9('0x1'));var timeout=require(_0x15e9('0x2'));var express=require(_0x15e9('0x3'));var router=express['Router']();var auth=require(_0x15e9('0x4'));var interaction=require(_0x15e9('0x5'));var config=require(_0x15e9('0x6'));var controller=require(_0x15e9('0x7'));router[_0x15e9('0x8')]('/',auth[_0x15e9('0x9')](),controller[_0x15e9('0xa')]);router[_0x15e9('0x8')](_0x15e9('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x15e9('0xc')]('/',auth[_0x15e9('0x9')](),controller[_0x15e9('0xd')]);router['put'](_0x15e9('0xb'),auth[_0x15e9('0x9')](),controller[_0x15e9('0xe')]);router[_0x15e9('0xf')](_0x15e9('0xb'),auth[_0x15e9('0x9')](),controller[_0x15e9('0x10')]);module[_0x15e9('0x11')]=router; \ No newline at end of file +var _0x8138=['exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get','isAuthenticated','/:id','post','delete','destroy'];(function(_0x57560d,_0x215718){var _0x50b44a=function(_0x47d56b){while(--_0x47d56b){_0x57560d['push'](_0x57560d['shift']());}};_0x50b44a(++_0x215718);}(_0x8138,0x189));var _0x8813=function(_0x5c78d9,_0x2736c7){_0x5c78d9=_0x5c78d9-0x0;var _0x69ae1f=_0x8138[_0x5c78d9];return _0x69ae1f;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x8813('0x0'));var express=require(_0x8813('0x1'));var router=express[_0x8813('0x2')]();var auth=require(_0x8813('0x3'));var interaction=require(_0x8813('0x4'));var config=require(_0x8813('0x5'));var controller=require(_0x8813('0x6'));router[_0x8813('0x7')]('/',auth[_0x8813('0x8')](),controller['index']);router['get'](_0x8813('0x9'),auth[_0x8813('0x8')](),controller['show']);router[_0x8813('0xa')]('/',auth[_0x8813('0x8')](),controller['create']);router['put'](_0x8813('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x8813('0xb')]('/:id',auth[_0x8813('0x8')](),controller[_0x8813('0xc')]);module[_0x8813('0xd')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index d63ceb0..55c61b6 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 _0xd3f6=['STRING','BOOLEAN','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd3f6,0xe6));var _0x6d3f=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0xd3f6[_0x2faddb];return _0x273c05;};'use strict';var Sequelize=require(_0x6d3f('0x0'));module[_0x6d3f('0x1')]={'description':{'type':Sequelize[_0x6d3f('0x2')]},'host':{'type':Sequelize[_0x6d3f('0x2')]},'user':{'type':Sequelize[_0x6d3f('0x2')]},'pass':{'type':Sequelize[_0x6d3f('0x2')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x6d3f('0x2')]},'authentication':{'type':Sequelize[_0x6d3f('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xb4ac=['exports','STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x5214d7,_0x1fb2f3){var _0x3f83bf=function(_0x489dea){while(--_0x489dea){_0x5214d7['push'](_0x5214d7['shift']());}};_0x3f83bf(++_0x1fb2f3);}(_0xb4ac,0x81));var _0xcb4a=function(_0x2f53d6,_0x1314b7){_0x2f53d6=_0x2f53d6-0x0;var _0x371064=_0xb4ac[_0x2f53d6];return _0x371064;};'use strict';var Sequelize=require(_0xcb4a('0x0'));module[_0xcb4a('0x1')]={'description':{'type':Sequelize[_0xcb4a('0x2')]},'host':{'type':Sequelize[_0xcb4a('0x2')]},'user':{'type':Sequelize[_0xcb4a('0x2')]},'pass':{'type':Sequelize[_0xcb4a('0x2')]},'port':{'type':Sequelize[_0xcb4a('0x3')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xcb4a('0x4')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 9e1997f..e5f3f15 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 _0x14a0=['params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','squel','crypto','jsforce','querystring','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','MailServerOut','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','options','include','rows','catch','show'];(function(_0x86b219,_0x43038f){var _0x1f320c=function(_0x8cd63f){while(--_0x8cd63f){_0x86b219['push'](_0x86b219['shift']());}};_0x1f320c(++_0x43038f);}(_0x14a0,0x8e));var _0x014a=function(_0x179098,_0x3f3bb5){_0x179098=_0x179098-0x0;var _0x17a097=_0x14a0[_0x179098];return _0x17a097;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x014a('0x0'));var rimraf=require(_0x014a('0x1'));var zipdir=require(_0x014a('0x2'));var jsonpatch=require(_0x014a('0x3'));var rp=require(_0x014a('0x4'));var moment=require(_0x014a('0x5'));var BPromise=require(_0x014a('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x014a('0x7'));var sox=require(_0x014a('0x8'));var csv=require(_0x014a('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x014a('0xa'));var crypto=require(_0x014a('0xb'));var jsforce=require(_0x014a('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x014a('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x014a('0xe'));var logger=require('../../config/logger')(_0x014a('0xf'));var utils=require(_0x014a('0x10'));var config=require('../../config/environment');var db=require(_0x014a('0x11'))['db'];function respondWithStatusCode(_0x166677,_0x2c84ad){_0x2c84ad=_0x2c84ad||0xcc;return function(_0x43bfeb){if(_0x43bfeb){return _0x166677[_0x014a('0x12')](_0x2c84ad);}return _0x166677[_0x014a('0x13')](_0x2c84ad)[_0x014a('0x14')]();};}function respondWithResult(_0x23c917,_0x1e5366){_0x1e5366=_0x1e5366||0xc8;return function(_0x71535d){if(_0x71535d){return _0x23c917[_0x014a('0x13')](_0x1e5366)[_0x014a('0x15')](_0x71535d);}};}function respondWithFilteredResult(_0x4fe87c,_0x130d13){return function(_0x3cf92f){if(_0x3cf92f){var _0x59f207=_0x3cf92f[_0x014a('0x16')],_0x3a836f=_0x130d13[_0x014a('0x17')],_0x128c46=_0x130d13[_0x014a('0x17')]+_0x130d13[_0x014a('0x18')],_0x59a4ea;if(_0x128c46>=_0x59f207){_0x128c46=_0x59f207;_0x59a4ea=0xc8;}else{_0x59a4ea=0xce;}_0x4fe87c[_0x014a('0x13')](_0x59a4ea);return _0x4fe87c[_0x014a('0x19')](_0x014a('0x1a'),_0x3a836f+'-'+_0x128c46+'/'+_0x59f207)[_0x014a('0x15')](_0x3cf92f);}return null;};}function patchUpdates(_0x16490a){return function(_0x3b9341){try{jsonpatch[_0x014a('0x1b')](_0x3b9341,_0x16490a,!![]);}catch(_0x89e132){return BPromise[_0x014a('0x1c')](_0x89e132);}return _0x3b9341[_0x014a('0x1d')]();};}function saveUpdates(_0x5c69c5,_0x359903){return function(_0x109a9c){if(_0x109a9c){return _0x109a9c[_0x014a('0x1e')](_0x5c69c5)[_0x014a('0x1f')](function(_0xc9a563){return _0xc9a563;});}return null;};}function removeEntity(_0x2d7ccd,_0x37c3d1){return function(_0x3dd2d0){if(_0x3dd2d0){return _0x3dd2d0[_0x014a('0x20')]()['then'](function(){_0x2d7ccd[_0x014a('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a1318,_0x26718b){return function(_0x44d921){if(!_0x44d921){_0x1a1318[_0x014a('0x12')](0x194);}return _0x44d921;};}function handleError(_0x2b3c10,_0x113b12){_0x113b12=_0x113b12||0x1f4;return function(_0x3fec9f){logger[_0x014a('0x21')](_0x3fec9f[_0x014a('0x22')]);if(_0x3fec9f['name']){delete _0x3fec9f[_0x014a('0x23')];}_0x2b3c10['status'](_0x113b12)[_0x014a('0x24')](_0x3fec9f);};}exports[_0x014a('0x25')]=function(_0x4f1c44,_0x4ee195){var _0x9a901f={},_0x3f9719={},_0x143346={'count':0x0,'rows':[]};var _0x5ed71b=db[_0x014a('0x26')][_0x014a('0x27')];_0x3f9719['model']=_[_0x014a('0x28')](_0x5ed71b);_0x3f9719[_0x014a('0x29')]=_['keys'](_0x4f1c44['query']);_0x3f9719[_0x014a('0x2a')]=_[_0x014a('0x2b')](_0x3f9719[_0x014a('0x2c')],_0x3f9719[_0x014a('0x29')]);_0x9a901f['attributes']=_[_0x014a('0x2b')](_0x3f9719[_0x014a('0x2c')],qs[_0x014a('0x2d')](_0x4f1c44[_0x014a('0x29')][_0x014a('0x2d')]));_0x9a901f[_0x014a('0x2e')]=_0x9a901f[_0x014a('0x2e')][_0x014a('0x2f')]?_0x9a901f[_0x014a('0x2e')]:_0x3f9719[_0x014a('0x2c')];if(!_0x4f1c44[_0x014a('0x29')]['hasOwnProperty'](_0x014a('0x30'))){_0x9a901f[_0x014a('0x18')]=qs[_0x014a('0x18')](_0x4f1c44[_0x014a('0x29')][_0x014a('0x18')]);_0x9a901f[_0x014a('0x17')]=qs[_0x014a('0x17')](_0x4f1c44['query'][_0x014a('0x17')]);}_0x9a901f[_0x014a('0x31')]=qs['sort'](_0x4f1c44[_0x014a('0x29')][_0x014a('0x32')]);_0x9a901f[_0x014a('0x33')]=qs[_0x014a('0x2a')](_[_0x014a('0x34')](_0x4f1c44[_0x014a('0x29')],_0x3f9719[_0x014a('0x2a')]));if(_0x4f1c44[_0x014a('0x29')]['filter']){_0x9a901f[_0x014a('0x33')]=_[_0x014a('0x35')](_0x9a901f[_0x014a('0x33')],{'$or':_[_0x014a('0x36')](_0x5ed71b,function(_0x5127f3){if(_0x5127f3[_0x014a('0x37')][_0x014a('0x38')]!==_0x014a('0x39')){var _0x157bd0={};_0x157bd0[_0x5127f3[_0x014a('0x3a')]]={'$like':'%'+_0x4f1c44[_0x014a('0x29')][_0x014a('0x3b')]+'%'};return _0x157bd0;}})});}_0x9a901f=_[_0x014a('0x35')]({},_0x9a901f,_0x4f1c44[_0x014a('0x3c')]);var _0x5f2f66={'where':_0x9a901f[_0x014a('0x33')]};return db['MailServerOut'][_0x014a('0x16')](_0x5f2f66)[_0x014a('0x1f')](function(_0x44958f){_0x143346[_0x014a('0x16')]=_0x44958f;if(_0x4f1c44[_0x014a('0x29')]['includeAll']){_0x9a901f[_0x014a('0x3d')]=[{'all':!![]}];}return db[_0x014a('0x26')]['findAll'](_0x9a901f);})[_0x014a('0x1f')](function(_0x2990df){_0x143346[_0x014a('0x3e')]=_0x2990df;return _0x143346;})[_0x014a('0x1f')](respondWithFilteredResult(_0x4ee195,_0x9a901f))[_0x014a('0x3f')](handleError(_0x4ee195,null));};exports[_0x014a('0x40')]=function(_0x17b1b6,_0x764fbe){var _0x2beddc={'raw':!![],'where':{'id':_0x17b1b6[_0x014a('0x41')]['id']}},_0x537bde={};_0x537bde[_0x014a('0x2c')]=_[_0x014a('0x28')](db[_0x014a('0x26')]['rawAttributes']);_0x537bde[_0x014a('0x29')]=_[_0x014a('0x28')](_0x17b1b6[_0x014a('0x29')]);_0x537bde[_0x014a('0x2a')]=_[_0x014a('0x2b')](_0x537bde[_0x014a('0x2c')],_0x537bde['query']);_0x2beddc[_0x014a('0x2e')]=_[_0x014a('0x2b')](_0x537bde['model'],qs[_0x014a('0x2d')](_0x17b1b6[_0x014a('0x29')][_0x014a('0x2d')]));_0x2beddc['attributes']=_0x2beddc[_0x014a('0x2e')]['length']?_0x2beddc['attributes']:_0x537bde[_0x014a('0x2c')];if(_0x17b1b6[_0x014a('0x29')]['includeAll']){_0x2beddc[_0x014a('0x3d')]=[{'all':!![]}];}_0x2beddc=_[_0x014a('0x35')]({},_0x2beddc,_0x17b1b6[_0x014a('0x3c')]);return db[_0x014a('0x26')][_0x014a('0x42')](_0x2beddc)[_0x014a('0x1f')](handleEntityNotFound(_0x764fbe,null))['then'](respondWithResult(_0x764fbe,null))[_0x014a('0x3f')](handleError(_0x764fbe,null));};exports[_0x014a('0x43')]=function(_0xb29df2,_0x52677e){return db['MailServerOut'][_0x014a('0x43')](_0xb29df2['body'],{})['then'](respondWithResult(_0x52677e,0xc9))[_0x014a('0x3f')](handleError(_0x52677e,null));};exports['update']=function(_0x2a4679,_0x45caee){if(_0x2a4679[_0x014a('0x44')]['id']){delete _0x2a4679['body']['id'];}return db[_0x014a('0x26')][_0x014a('0x42')]({'where':{'id':_0x2a4679[_0x014a('0x41')]['id']}})[_0x014a('0x1f')](handleEntityNotFound(_0x45caee,null))[_0x014a('0x1f')](saveUpdates(_0x2a4679[_0x014a('0x44')],null))['then'](respondWithResult(_0x45caee,null))[_0x014a('0x3f')](handleError(_0x45caee,null));};exports[_0x014a('0x20')]=function(_0x5a861c,_0x1a4df9){return db[_0x014a('0x26')][_0x014a('0x42')]({'where':{'id':_0x5a861c[_0x014a('0x41')]['id']}})[_0x014a('0x1f')](handleEntityNotFound(_0x1a4df9,null))[_0x014a('0x1f')](removeEntity(_0x1a4df9,null))[_0x014a('0x3f')](handleError(_0x1a4df9,null));}; \ No newline at end of file +var _0x4f81=['rawAttributes','includeAll','options','find','create','body','destroy','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','reject','save','update','error','name','index','MailServerOut','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','type','key','VIRTUAL','field','then','include','findAll','rows','catch','show','params'];(function(_0x48cb90,_0x36e722){var _0xca0bcb=function(_0xa18e59){while(--_0xa18e59){_0x48cb90['push'](_0x48cb90['shift']());}};_0xca0bcb(++_0x36e722);}(_0x4f81,0x1e3));var _0x14f8=function(_0x3300ba,_0x133566){_0x3300ba=_0x3300ba-0x0;var _0x4dba1b=_0x4f81[_0x3300ba];return _0x4dba1b;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x14f8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x14f8('0x1'));var rp=require(_0x14f8('0x2'));var moment=require(_0x14f8('0x3'));var BPromise=require(_0x14f8('0x4'));var Mustache=require(_0x14f8('0x5'));var util=require(_0x14f8('0x6'));var path=require(_0x14f8('0x7'));var sox=require('sox');var csv=require(_0x14f8('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x14f8('0x9'));var squel=require(_0x14f8('0xa'));var crypto=require('crypto');var jsforce=require(_0x14f8('0xb'));var deskjs=require(_0x14f8('0xc'));var toCsv=require('to-csv');var querystring=require(_0x14f8('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x14f8('0xe'));var qs=require(_0x14f8('0xf'));var hardwareService=require(_0x14f8('0x10'));var logger=require(_0x14f8('0x11'))(_0x14f8('0x12'));var utils=require(_0x14f8('0x13'));var config=require(_0x14f8('0x14'));var db=require(_0x14f8('0x15'))['db'];function respondWithStatusCode(_0x3828e8,_0x1e849a){_0x1e849a=_0x1e849a||0xcc;return function(_0x228505){if(_0x228505){return _0x3828e8[_0x14f8('0x16')](_0x1e849a);}return _0x3828e8['status'](_0x1e849a)[_0x14f8('0x17')]();};}function respondWithResult(_0x3b6ecb,_0x235f92){_0x235f92=_0x235f92||0xc8;return function(_0x422cb7){if(_0x422cb7){return _0x3b6ecb[_0x14f8('0x18')](_0x235f92)[_0x14f8('0x19')](_0x422cb7);}};}function respondWithFilteredResult(_0x12f39e,_0x37e020){return function(_0x4022a3){if(_0x4022a3){var _0x1216e8=_0x4022a3[_0x14f8('0x1a')],_0x57e917=_0x37e020[_0x14f8('0x1b')],_0x3481a1=_0x37e020[_0x14f8('0x1b')]+_0x37e020[_0x14f8('0x1c')],_0xb396ab;if(_0x3481a1>=_0x1216e8){_0x3481a1=_0x1216e8;_0xb396ab=0xc8;}else{_0xb396ab=0xce;}_0x12f39e[_0x14f8('0x18')](_0xb396ab);return _0x12f39e['set'](_0x14f8('0x1d'),_0x57e917+'-'+_0x3481a1+'/'+_0x1216e8)[_0x14f8('0x19')](_0x4022a3);}return null;};}function patchUpdates(_0x4c9dc9){return function(_0x4f5720){try{jsonpatch['apply'](_0x4f5720,_0x4c9dc9,!![]);}catch(_0x3e62a1){return BPromise[_0x14f8('0x1e')](_0x3e62a1);}return _0x4f5720[_0x14f8('0x1f')]();};}function saveUpdates(_0x5225c0,_0x476c1c){return function(_0x30c2cd){if(_0x30c2cd){return _0x30c2cd[_0x14f8('0x20')](_0x5225c0)['then'](function(_0x3526e5){return _0x3526e5;});}return null;};}function removeEntity(_0x567f2e,_0x313775){return function(_0x14fa31){if(_0x14fa31){return _0x14fa31['destroy']()['then'](function(){_0x567f2e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x32ebe5,_0x12f47f){return function(_0x15995a){if(!_0x15995a){_0x32ebe5[_0x14f8('0x16')](0x194);}return _0x15995a;};}function handleError(_0x12122d,_0x18350e){_0x18350e=_0x18350e||0x1f4;return function(_0x527632){logger[_0x14f8('0x21')](_0x527632['stack']);if(_0x527632[_0x14f8('0x22')]){delete _0x527632[_0x14f8('0x22')];}_0x12122d[_0x14f8('0x18')](_0x18350e)['send'](_0x527632);};}exports[_0x14f8('0x23')]=function(_0x5540ac,_0x19ed7b){var _0x1bc0d8={},_0x5618d3={},_0x1ccbb5={'count':0x0,'rows':[]};var _0xbe6007=db[_0x14f8('0x24')]['rawAttributes'];_0x5618d3[_0x14f8('0x25')]=_[_0x14f8('0x26')](_0xbe6007);_0x5618d3[_0x14f8('0x27')]=_['keys'](_0x5540ac[_0x14f8('0x27')]);_0x5618d3[_0x14f8('0x28')]=_[_0x14f8('0x29')](_0x5618d3[_0x14f8('0x25')],_0x5618d3[_0x14f8('0x27')]);_0x1bc0d8[_0x14f8('0x2a')]=_[_0x14f8('0x29')](_0x5618d3['model'],qs[_0x14f8('0x2b')](_0x5540ac['query']['fields']));_0x1bc0d8[_0x14f8('0x2a')]=_0x1bc0d8['attributes'][_0x14f8('0x2c')]?_0x1bc0d8[_0x14f8('0x2a')]:_0x5618d3[_0x14f8('0x25')];if(!_0x5540ac[_0x14f8('0x27')][_0x14f8('0x2d')]('nolimit')){_0x1bc0d8[_0x14f8('0x1c')]=qs[_0x14f8('0x1c')](_0x5540ac['query']['limit']);_0x1bc0d8[_0x14f8('0x1b')]=qs[_0x14f8('0x1b')](_0x5540ac['query'][_0x14f8('0x1b')]);}_0x1bc0d8['order']=qs['sort'](_0x5540ac['query'][_0x14f8('0x2e')]);_0x1bc0d8[_0x14f8('0x2f')]=qs[_0x14f8('0x28')](_['pick'](_0x5540ac[_0x14f8('0x27')],_0x5618d3['filters']));if(_0x5540ac[_0x14f8('0x27')][_0x14f8('0x30')]){_0x1bc0d8['where']=_[_0x14f8('0x31')](_0x1bc0d8[_0x14f8('0x2f')],{'$or':_['map'](_0xbe6007,function(_0x1668c1){if(_0x1668c1[_0x14f8('0x32')][_0x14f8('0x33')]!==_0x14f8('0x34')){var _0x24ebac={};_0x24ebac[_0x1668c1[_0x14f8('0x35')]]={'$like':'%'+_0x5540ac['query'][_0x14f8('0x30')]+'%'};return _0x24ebac;}})});}_0x1bc0d8=_['merge']({},_0x1bc0d8,_0x5540ac['options']);var _0xde4767={'where':_0x1bc0d8['where']};return db['MailServerOut'][_0x14f8('0x1a')](_0xde4767)[_0x14f8('0x36')](function(_0x12fc5c){_0x1ccbb5['count']=_0x12fc5c;if(_0x5540ac['query']['includeAll']){_0x1bc0d8[_0x14f8('0x37')]=[{'all':!![]}];}return db[_0x14f8('0x24')][_0x14f8('0x38')](_0x1bc0d8);})[_0x14f8('0x36')](function(_0xc941a9){_0x1ccbb5[_0x14f8('0x39')]=_0xc941a9;return _0x1ccbb5;})[_0x14f8('0x36')](respondWithFilteredResult(_0x19ed7b,_0x1bc0d8))[_0x14f8('0x3a')](handleError(_0x19ed7b,null));};exports[_0x14f8('0x3b')]=function(_0x5121d3,_0x49fe0f){var _0x181451={'raw':!![],'where':{'id':_0x5121d3[_0x14f8('0x3c')]['id']}},_0x1e5e75={};_0x1e5e75[_0x14f8('0x25')]=_[_0x14f8('0x26')](db['MailServerOut'][_0x14f8('0x3d')]);_0x1e5e75[_0x14f8('0x27')]=_[_0x14f8('0x26')](_0x5121d3[_0x14f8('0x27')]);_0x1e5e75[_0x14f8('0x28')]=_['intersection'](_0x1e5e75[_0x14f8('0x25')],_0x1e5e75[_0x14f8('0x27')]);_0x181451['attributes']=_[_0x14f8('0x29')](_0x1e5e75[_0x14f8('0x25')],qs['fields'](_0x5121d3[_0x14f8('0x27')][_0x14f8('0x2b')]));_0x181451[_0x14f8('0x2a')]=_0x181451[_0x14f8('0x2a')]['length']?_0x181451[_0x14f8('0x2a')]:_0x1e5e75['model'];if(_0x5121d3[_0x14f8('0x27')][_0x14f8('0x3e')]){_0x181451[_0x14f8('0x37')]=[{'all':!![]}];}_0x181451=_[_0x14f8('0x31')]({},_0x181451,_0x5121d3[_0x14f8('0x3f')]);return db['MailServerOut'][_0x14f8('0x40')](_0x181451)[_0x14f8('0x36')](handleEntityNotFound(_0x49fe0f,null))[_0x14f8('0x36')](respondWithResult(_0x49fe0f,null))[_0x14f8('0x3a')](handleError(_0x49fe0f,null));};exports[_0x14f8('0x41')]=function(_0x3374af,_0x20b957){return db[_0x14f8('0x24')][_0x14f8('0x41')](_0x3374af[_0x14f8('0x42')],{})[_0x14f8('0x36')](respondWithResult(_0x20b957,0xc9))[_0x14f8('0x3a')](handleError(_0x20b957,null));};exports['update']=function(_0x387c2b,_0x55a598){if(_0x387c2b[_0x14f8('0x42')]['id']){delete _0x387c2b[_0x14f8('0x42')]['id'];}return db['MailServerOut'][_0x14f8('0x40')]({'where':{'id':_0x387c2b[_0x14f8('0x3c')]['id']}})[_0x14f8('0x36')](handleEntityNotFound(_0x55a598,null))[_0x14f8('0x36')](saveUpdates(_0x387c2b['body'],null))[_0x14f8('0x36')](respondWithResult(_0x55a598,null))['catch'](handleError(_0x55a598,null));};exports[_0x14f8('0x43')]=function(_0x163ffd,_0x572da7){return db['MailServerOut'][_0x14f8('0x40')]({'where':{'id':_0x163ffd[_0x14f8('0x3c')]['id']}})[_0x14f8('0x36')](handleEntityNotFound(_0x572da7,null))[_0x14f8('0x36')](removeEntity(_0x572da7,null))[_0x14f8('0x3a')](handleError(_0x572da7,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index d824a31..9232e23 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 _0x2547=['rimraf','./mailServerOut.attributes','exports','MailServerOut','mail_servers_out','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1babf4,_0x415dc1){var _0x569406=function(_0x396161){while(--_0x396161){_0x1babf4['push'](_0x1babf4['shift']());}};_0x569406(++_0x415dc1);}(_0x2547,0x1cd));var _0x7254=function(_0x104993,_0x43f4b1){_0x104993=_0x104993-0x0;var _0x37fd8d=_0x2547[_0x104993];return _0x37fd8d;};'use strict';var _=require('lodash');var util=require(_0x7254('0x0'));var logger=require(_0x7254('0x1'))(_0x7254('0x2'));var moment=require(_0x7254('0x3'));var BPromise=require(_0x7254('0x4'));var rp=require(_0x7254('0x5'));var fs=require('fs');var path=require(_0x7254('0x6'));var rimraf=require(_0x7254('0x7'));var config=require('../../config/environment');var attributes=require(_0x7254('0x8'));module[_0x7254('0x9')]=function(_0x67f427,_0x119f66){return _0x67f427['define'](_0x7254('0xa'),attributes,{'tableName':_0x7254('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xea28=['../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4906b4,_0x193ebf){var _0xccdd0b=function(_0x2db167){while(--_0x2db167){_0x4906b4['push'](_0x4906b4['shift']());}};_0xccdd0b(++_0x193ebf);}(_0xea28,0x13a));var _0x8ea2=function(_0x1c1921,_0xfac4a4){_0x1c1921=_0x1c1921-0x0;var _0x2795fd=_0xea28[_0x1c1921];return _0x2795fd;};'use strict';var _=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var logger=require(_0x8ea2('0x2'))(_0x8ea2('0x3'));var moment=require(_0x8ea2('0x4'));var BPromise=require(_0x8ea2('0x5'));var rp=require(_0x8ea2('0x6'));var fs=require('fs');var path=require(_0x8ea2('0x7'));var rimraf=require('rimraf');var config=require(_0x8ea2('0x8'));var attributes=require(_0x8ea2('0x9'));module[_0x8ea2('0xa')]=function(_0x513a0d,_0x29b82b){return _0x513a0d[_0x8ea2('0xb')](_0x8ea2('0xc'),attributes,{'tableName':_0x8ea2('0xd'),'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 613cdcb..12698d8 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 _0x88f1=['info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../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'];(function(_0x5b59cf,_0x4db405){var _0x865fb3=function(_0x42f759){while(--_0x42f759){_0x5b59cf['push'](_0x5b59cf['shift']());}};_0x865fb3(++_0x4db405);}(_0x88f1,0x99));var _0x188f=function(_0x41a6da,_0x534023){_0x41a6da=_0x41a6da-0x0;var _0x4393c6=_0x88f1[_0x41a6da];return _0x4393c6;};'use strict';var _=require(_0x188f('0x0'));var util=require('util');var moment=require(_0x188f('0x1'));var BPromise=require(_0x188f('0x2'));var rs=require(_0x188f('0x3'));var fs=require('fs');var Redis=require(_0x188f('0x4'));var db=require(_0x188f('0x5'))['db'];var utils=require(_0x188f('0x6'));var logger=require(_0x188f('0x7'))(_0x188f('0x8'));var config=require(_0x188f('0x9'));var jayson=require(_0x188f('0xa'));var client=jayson[_0x188f('0xb')][_0x188f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2d59eb,_0x4e8d34,_0x46723d){return new BPromise(function(_0x1f8a2f,_0x3947b5){return client[_0x188f('0xd')](_0x2d59eb,_0x46723d)[_0x188f('0xe')](function(_0x528ceb){logger['info'](_0x188f('0xf'),_0x4e8d34,_0x188f('0x10'));logger[_0x188f('0x11')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x4e8d34,_0x188f('0x10'),JSON[_0x188f('0x12')](_0x528ceb));if(_0x528ceb[_0x188f('0x13')]){if(_0x528ceb[_0x188f('0x13')][_0x188f('0x14')]===0x1f4){logger['error'](_0x188f('0xf'),_0x4e8d34,_0x528ceb[_0x188f('0x13')][_0x188f('0x15')]);return _0x3947b5(_0x528ceb['error'][_0x188f('0x15')]);}logger['error'](_0x188f('0xf'),_0x4e8d34,_0x528ceb[_0x188f('0x13')][_0x188f('0x15')]);return _0x1f8a2f(_0x528ceb['error'][_0x188f('0x15')]);}else{logger[_0x188f('0x16')](_0x188f('0xf'),_0x4e8d34,_0x188f('0x10'));_0x1f8a2f(_0x528ceb[_0x188f('0x17')][_0x188f('0x15')]);}})[_0x188f('0x18')](function(_0x1e401e){logger['error']('MailServerOut,\x20%s,\x20%s',_0x4e8d34,_0x1e401e);_0x3947b5(_0x1e401e);});});} \ No newline at end of file +var _0xae3e=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x58840c,_0x476570){var _0x22df3e=function(_0x5f50bf){while(--_0x5f50bf){_0x58840c['push'](_0x58840c['shift']());}};_0x22df3e(++_0x476570);}(_0xae3e,0x13f));var _0xeae3=function(_0x480b14,_0x397259){_0x480b14=_0x480b14-0x0;var _0x271f62=_0xae3e[_0x480b14];return _0x271f62;};'use strict';var _=require(_0xeae3('0x0'));var util=require('util');var moment=require(_0xeae3('0x1'));var BPromise=require(_0xeae3('0x2'));var rs=require(_0xeae3('0x3'));var fs=require('fs');var Redis=require(_0xeae3('0x4'));var db=require(_0xeae3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xeae3('0x6'))('rpc');var config=require(_0xeae3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xeae3('0x8')][_0xeae3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x35f92b,_0x2581c0,_0x5683c7){return new BPromise(function(_0x44b204,_0x1db6d6){return client[_0xeae3('0xa')](_0x35f92b,_0x5683c7)[_0xeae3('0xb')](function(_0x2a00e6){logger['info'](_0xeae3('0xc'),_0x2581c0,_0xeae3('0xd'));logger[_0xeae3('0xe')](_0xeae3('0xf'),_0x2581c0,_0xeae3('0xd'),JSON[_0xeae3('0x10')](_0x2a00e6));if(_0x2a00e6[_0xeae3('0x11')]){if(_0x2a00e6[_0xeae3('0x11')]['code']===0x1f4){logger[_0xeae3('0x11')](_0xeae3('0xc'),_0x2581c0,_0x2a00e6[_0xeae3('0x11')]['message']);return _0x1db6d6(_0x2a00e6[_0xeae3('0x11')][_0xeae3('0x12')]);}logger[_0xeae3('0x11')](_0xeae3('0xc'),_0x2581c0,_0x2a00e6[_0xeae3('0x11')][_0xeae3('0x12')]);return _0x44b204(_0x2a00e6[_0xeae3('0x11')][_0xeae3('0x12')]);}else{logger['info'](_0xeae3('0xc'),_0x2581c0,_0xeae3('0xd'));_0x44b204(_0x2a00e6[_0xeae3('0x13')]['message']);}})[_0xeae3('0x14')](function(_0x1b4be6){logger['error'](_0xeae3('0xc'),_0x2581c0,_0x1b4be6);_0x1db6d6(_0x1b4be6);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 9862612..7075476 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 _0x542d=['create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/interaction/service','./mailSubstatus.controller','get','isAuthenticated','describe','/:id'];(function(_0x1f0679,_0x53d43c){var _0x3dc3a4=function(_0x49ba8f){while(--_0x49ba8f){_0x1f0679['push'](_0x1f0679['shift']());}};_0x3dc3a4(++_0x53d43c);}(_0x542d,0x1b5));var _0xd542=function(_0x538c83,_0x44370d){_0x538c83=_0x538c83-0x0;var _0x320a53=_0x542d[_0x538c83];return _0x320a53;};'use strict';var multer=require(_0xd542('0x0'));var util=require(_0xd542('0x1'));var path=require('path');var timeout=require(_0xd542('0x2'));var express=require(_0xd542('0x3'));var router=express[_0xd542('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xd542('0x5'));var config=require('../../config/environment');var controller=require(_0xd542('0x6'));router[_0xd542('0x7')]('/',auth[_0xd542('0x8')](),controller['index']);router[_0xd542('0x7')]('/describe',auth[_0xd542('0x8')](),controller[_0xd542('0x9')]);router[_0xd542('0x7')](_0xd542('0xa'),auth[_0xd542('0x8')](),controller['show']);router['post']('/',auth[_0xd542('0x8')](),controller[_0xd542('0xb')]);router[_0xd542('0xc')](_0xd542('0xa'),auth[_0xd542('0x8')](),controller[_0xd542('0xd')]);router[_0xd542('0xe')](_0xd542('0xa'),auth[_0xd542('0x8')](),controller[_0xd542('0xf')]);module['exports']=router; \ No newline at end of file +var _0xa32e=['/describe','describe','/:id','show','create','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated'];(function(_0x395dba,_0x5e5bba){var _0xd62725=function(_0x3123fd){while(--_0x3123fd){_0x395dba['push'](_0x395dba['shift']());}};_0xd62725(++_0x5e5bba);}(_0xa32e,0x185));var _0xea32=function(_0x1f09f7,_0x3d6206){_0x1f09f7=_0x1f09f7-0x0;var _0x20fec0=_0xa32e[_0x1f09f7];return _0x20fec0;};'use strict';var multer=require(_0xea32('0x0'));var util=require('util');var path=require(_0xea32('0x1'));var timeout=require('connect-timeout');var express=require(_0xea32('0x2'));var router=express[_0xea32('0x3')]();var auth=require(_0xea32('0x4'));var interaction=require(_0xea32('0x5'));var config=require(_0xea32('0x6'));var controller=require(_0xea32('0x7'));router[_0xea32('0x8')]('/',auth[_0xea32('0x9')](),controller['index']);router['get'](_0xea32('0xa'),auth[_0xea32('0x9')](),controller[_0xea32('0xb')]);router[_0xea32('0x8')](_0xea32('0xc'),auth[_0xea32('0x9')](),controller[_0xea32('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xea32('0xe')]);router['put'](_0xea32('0xc'),auth[_0xea32('0x9')](),controller[_0xea32('0xf')]);router[_0xea32('0x10')](_0xea32('0xc'),auth[_0xea32('0x9')](),controller[_0xea32('0x11')]);module[_0xea32('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index fe28421..41b3bfa 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 _0x6f3e=['exports','STRING','name','sequelize'];(function(_0x2b435,_0x360579){var _0x50d401=function(_0x43be4c){while(--_0x43be4c){_0x2b435['push'](_0x2b435['shift']());}};_0x50d401(++_0x360579);}(_0x6f3e,0x9f));var _0xe6f3=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6f3e[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xe6f3('0x0'));module[_0xe6f3('0x1')]={'name':{'type':Sequelize[_0xe6f3('0x2')],'unique':_0xe6f3('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe6f3('0x2')]}}; \ No newline at end of file +var _0x1ba2=['sequelize','STRING'];(function(_0x43fb76,_0x2f1c61){var _0x402323=function(_0x375285){while(--_0x375285){_0x43fb76['push'](_0x43fb76['shift']());}};_0x402323(++_0x2f1c61);}(_0x1ba2,0xb4));var _0x21ba=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1ba2[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x21ba('0x0'));module['exports']={'name':{'type':Sequelize[_0x21ba('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x21ba('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 5095a3d..5685912 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 _0x86dd=['filters','intersection','attributes','fields','length','nolimit','sort','filter','where','key','VIRTUAL','field','merge','MailSubstatus','includeAll','include','rows','catch','params','keys','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','end','error','name','send','index','model','query'];(function(_0x372abf,_0x34a618){var _0x43b5dd=function(_0x42ca3f){while(--_0x42ca3f){_0x372abf['push'](_0x372abf['shift']());}};_0x43b5dd(++_0x34a618);}(_0x86dd,0x1ee));var _0xd86d=function(_0x8542f5,_0x49d8e5){_0x8542f5=_0x8542f5-0x0;var _0x215169=_0x86dd[_0x8542f5];return _0x215169;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd86d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd86d('0x1'));var jsonpatch=require(_0xd86d('0x2'));var rp=require(_0xd86d('0x3'));var moment=require(_0xd86d('0x4'));var BPromise=require(_0xd86d('0x5'));var Mustache=require(_0xd86d('0x6'));var util=require(_0xd86d('0x7'));var path=require(_0xd86d('0x8'));var sox=require(_0xd86d('0x9'));var csv=require(_0xd86d('0xa'));var ejs=require(_0xd86d('0xb'));var fs=require('fs');var _=require(_0xd86d('0xc'));var squel=require('squel');var crypto=require(_0xd86d('0xd'));var jsforce=require(_0xd86d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd86d('0xa'));var querystring=require(_0xd86d('0xf'));var Papa=require(_0xd86d('0x10'));var Redis=require(_0xd86d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd86d('0x12'));var hardwareService=require(_0xd86d('0x13'));var logger=require(_0xd86d('0x14'))(_0xd86d('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xd86d('0x16'))['db'];function respondWithStatusCode(_0x2019c1,_0x199e83){_0x199e83=_0x199e83||0xcc;return function(_0x77012b){if(_0x77012b){return _0x2019c1[_0xd86d('0x17')](_0x199e83);}return _0x2019c1['status'](_0x199e83)['end']();};}function respondWithResult(_0x5e033f,_0x27a09c){_0x27a09c=_0x27a09c||0xc8;return function(_0x2b8ef4){if(_0x2b8ef4){return _0x5e033f[_0xd86d('0x18')](_0x27a09c)[_0xd86d('0x19')](_0x2b8ef4);}};}function respondWithFilteredResult(_0x4457b0,_0x397931){return function(_0x3aa815){if(_0x3aa815){var _0x570ed1=_0x3aa815[_0xd86d('0x1a')],_0x1d2b33=_0x397931[_0xd86d('0x1b')],_0x2cc4d9=_0x397931[_0xd86d('0x1b')]+_0x397931[_0xd86d('0x1c')],_0x38dc37;if(_0x2cc4d9>=_0x570ed1){_0x2cc4d9=_0x570ed1;_0x38dc37=0xc8;}else{_0x38dc37=0xce;}_0x4457b0[_0xd86d('0x18')](_0x38dc37);return _0x4457b0[_0xd86d('0x1d')](_0xd86d('0x1e'),_0x1d2b33+'-'+_0x2cc4d9+'/'+_0x570ed1)['json'](_0x3aa815);}return null;};}function patchUpdates(_0x4808f4){return function(_0x19569a){try{jsonpatch[_0xd86d('0x1f')](_0x19569a,_0x4808f4,!![]);}catch(_0xb74a5f){return BPromise['reject'](_0xb74a5f);}return _0x19569a[_0xd86d('0x20')]();};}function saveUpdates(_0x19e4de,_0x146f7b){return function(_0x5a632c){if(_0x5a632c){return _0x5a632c[_0xd86d('0x21')](_0x19e4de)[_0xd86d('0x22')](function(_0x5a3b58){return _0x5a3b58;});}return null;};}function removeEntity(_0x384bb3,_0x391730){return function(_0x74f57e){if(_0x74f57e){return _0x74f57e['destroy']()[_0xd86d('0x22')](function(){_0x384bb3[_0xd86d('0x18')](0xcc)[_0xd86d('0x23')]();});}};}function handleEntityNotFound(_0xb71958,_0x49845b){return function(_0x2c33f0){if(!_0x2c33f0){_0xb71958[_0xd86d('0x17')](0x194);}return _0x2c33f0;};}function handleError(_0x5e1ea3,_0x59f60e){_0x59f60e=_0x59f60e||0x1f4;return function(_0x5497e5){logger[_0xd86d('0x24')](_0x5497e5['stack']);if(_0x5497e5[_0xd86d('0x25')]){delete _0x5497e5['name'];}_0x5e1ea3['status'](_0x59f60e)[_0xd86d('0x26')](_0x5497e5);};}exports[_0xd86d('0x27')]=function(_0x48dd45,_0x1da491){var _0x4ce504={},_0x38e4b3={},_0x4b99f7={'count':0x0,'rows':[]};var _0x593007=db['MailSubstatus']['rawAttributes'];_0x38e4b3[_0xd86d('0x28')]=_['keys'](_0x593007);_0x38e4b3[_0xd86d('0x29')]=_['keys'](_0x48dd45[_0xd86d('0x29')]);_0x38e4b3[_0xd86d('0x2a')]=_[_0xd86d('0x2b')](_0x38e4b3[_0xd86d('0x28')],_0x38e4b3['query']);_0x4ce504[_0xd86d('0x2c')]=_[_0xd86d('0x2b')](_0x38e4b3[_0xd86d('0x28')],qs[_0xd86d('0x2d')](_0x48dd45[_0xd86d('0x29')][_0xd86d('0x2d')]));_0x4ce504['attributes']=_0x4ce504[_0xd86d('0x2c')][_0xd86d('0x2e')]?_0x4ce504[_0xd86d('0x2c')]:_0x38e4b3[_0xd86d('0x28')];if(!_0x48dd45['query']['hasOwnProperty'](_0xd86d('0x2f'))){_0x4ce504['limit']=qs[_0xd86d('0x1c')](_0x48dd45[_0xd86d('0x29')][_0xd86d('0x1c')]);_0x4ce504[_0xd86d('0x1b')]=qs['offset'](_0x48dd45[_0xd86d('0x29')][_0xd86d('0x1b')]);}_0x4ce504['order']=qs[_0xd86d('0x30')](_0x48dd45[_0xd86d('0x29')][_0xd86d('0x30')]);_0x4ce504['where']=qs[_0xd86d('0x2a')](_['pick'](_0x48dd45[_0xd86d('0x29')],_0x38e4b3[_0xd86d('0x2a')]));if(_0x48dd45[_0xd86d('0x29')][_0xd86d('0x31')]){_0x4ce504[_0xd86d('0x32')]=_['merge'](_0x4ce504[_0xd86d('0x32')],{'$or':_['map'](_0x593007,function(_0x4000b8){if(_0x4000b8['type'][_0xd86d('0x33')]!==_0xd86d('0x34')){var _0x3cda02={};_0x3cda02[_0x4000b8[_0xd86d('0x35')]]={'$like':'%'+_0x48dd45[_0xd86d('0x29')]['filter']+'%'};return _0x3cda02;}})});}_0x4ce504=_[_0xd86d('0x36')]({},_0x4ce504,_0x48dd45['options']);var _0x22aadf={'where':_0x4ce504['where']};return db[_0xd86d('0x37')]['count'](_0x22aadf)[_0xd86d('0x22')](function(_0x5a28ae){_0x4b99f7['count']=_0x5a28ae;if(_0x48dd45[_0xd86d('0x29')][_0xd86d('0x38')]){_0x4ce504[_0xd86d('0x39')]=[{'all':!![]}];}return db[_0xd86d('0x37')]['findAll'](_0x4ce504);})['then'](function(_0x35c2b6){_0x4b99f7[_0xd86d('0x3a')]=_0x35c2b6;return _0x4b99f7;})[_0xd86d('0x22')](respondWithFilteredResult(_0x1da491,_0x4ce504))[_0xd86d('0x3b')](handleError(_0x1da491,null));};exports['show']=function(_0x136d9f,_0x30d8d7){var _0x1eda8={'raw':!![],'where':{'id':_0x136d9f[_0xd86d('0x3c')]['id']}},_0x244696={};_0x244696[_0xd86d('0x28')]=_[_0xd86d('0x3d')](db[_0xd86d('0x37')]['rawAttributes']);_0x244696[_0xd86d('0x29')]=_['keys'](_0x136d9f[_0xd86d('0x29')]);_0x244696[_0xd86d('0x2a')]=_[_0xd86d('0x2b')](_0x244696[_0xd86d('0x28')],_0x244696['query']);_0x1eda8[_0xd86d('0x2c')]=_[_0xd86d('0x2b')](_0x244696[_0xd86d('0x28')],qs[_0xd86d('0x2d')](_0x136d9f[_0xd86d('0x29')][_0xd86d('0x2d')]));_0x1eda8[_0xd86d('0x2c')]=_0x1eda8['attributes'][_0xd86d('0x2e')]?_0x1eda8[_0xd86d('0x2c')]:_0x244696[_0xd86d('0x28')];if(_0x136d9f[_0xd86d('0x29')][_0xd86d('0x38')]){_0x1eda8[_0xd86d('0x39')]=[{'all':!![]}];}_0x1eda8=_[_0xd86d('0x36')]({},_0x1eda8,_0x136d9f['options']);return db[_0xd86d('0x37')][_0xd86d('0x3e')](_0x1eda8)['then'](handleEntityNotFound(_0x30d8d7,null))['then'](respondWithResult(_0x30d8d7,null))['catch'](handleError(_0x30d8d7,null));};exports[_0xd86d('0x3f')]=function(_0x394237,_0x59c389){return db[_0xd86d('0x37')][_0xd86d('0x3f')](_0x394237[_0xd86d('0x40')],{})[_0xd86d('0x22')](respondWithResult(_0x59c389,0xc9))[_0xd86d('0x3b')](handleError(_0x59c389,null));};exports[_0xd86d('0x21')]=function(_0x263cf4,_0x551174){if(_0x263cf4['body']['id']){delete _0x263cf4[_0xd86d('0x40')]['id'];}return db[_0xd86d('0x37')]['find']({'where':{'id':_0x263cf4[_0xd86d('0x3c')]['id']}})[_0xd86d('0x22')](handleEntityNotFound(_0x551174,null))[_0xd86d('0x22')](saveUpdates(_0x263cf4[_0xd86d('0x40')],null))['then'](respondWithResult(_0x551174,null))[_0xd86d('0x3b')](handleError(_0x551174,null));};exports[_0xd86d('0x41')]=function(_0x184e0b,_0x551b49){return db[_0xd86d('0x37')][_0xd86d('0x3e')]({'where':{'id':_0x184e0b[_0xd86d('0x3c')]['id']}})['then'](handleEntityNotFound(_0x551b49,null))[_0xd86d('0x22')](removeEntity(_0x551b49,null))[_0xd86d('0x3b')](handleError(_0x551b49,null));};exports[_0xd86d('0x42')]=function(_0x53ca96,_0x11b77e){return db[_0xd86d('0x37')]['describe']()[_0xd86d('0x22')](respondWithResult(_0x11b77e,null))[_0xd86d('0x3b')](handleError(_0x11b77e,null));}; \ No newline at end of file +var _0x383d=['sox','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','offset','limit','set','Content-Range','json','apply','reject','save','update','then','error','send','index','MailSubstatus','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','map','type','VIRTUAL','field','options','count','includeAll','include','findAll','catch','show','params','create','body','find','destroy','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path'];(function(_0x5135b9,_0x34f4af){var _0x2b13a0=function(_0x21a57b){while(--_0x21a57b){_0x5135b9['push'](_0x5135b9['shift']());}};_0x2b13a0(++_0x34f4af);}(_0x383d,0x86));var _0xd383=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x383d[_0x14add3];return _0x4a174f;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xd383('0x0'));var zipdir=require(_0xd383('0x1'));var jsonpatch=require(_0xd383('0x2'));var rp=require('request-promise');var moment=require(_0xd383('0x3'));var BPromise=require(_0xd383('0x4'));var Mustache=require(_0xd383('0x5'));var util=require(_0xd383('0x6'));var path=require(_0xd383('0x7'));var sox=require(_0xd383('0x8'));var csv=require('to-csv');var ejs=require(_0xd383('0x9'));var fs=require('fs');var _=require(_0xd383('0xa'));var squel=require(_0xd383('0xb'));var crypto=require(_0xd383('0xc'));var jsforce=require(_0xd383('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd383('0xe'));var Papa=require(_0xd383('0xf'));var Redis=require('ioredis');var authService=require(_0xd383('0x10'));var qs=require(_0xd383('0x11'));var hardwareService=require(_0xd383('0x12'));var logger=require(_0xd383('0x13'))(_0xd383('0x14'));var utils=require(_0xd383('0x15'));var config=require('../../config/environment');var db=require(_0xd383('0x16'))['db'];function respondWithStatusCode(_0x2cf41e,_0x2c3800){_0x2c3800=_0x2c3800||0xcc;return function(_0x456180){if(_0x456180){return _0x2cf41e['sendStatus'](_0x2c3800);}return _0x2cf41e[_0xd383('0x17')](_0x2c3800)[_0xd383('0x18')]();};}function respondWithResult(_0x208d82,_0x3fe48f){_0x3fe48f=_0x3fe48f||0xc8;return function(_0x4ce386){if(_0x4ce386){return _0x208d82[_0xd383('0x17')](_0x3fe48f)['json'](_0x4ce386);}};}function respondWithFilteredResult(_0x2ab5e8,_0x1e35fe){return function(_0xf2dcb6){if(_0xf2dcb6){var _0x373876=_0xf2dcb6['count'],_0x387f5f=_0x1e35fe[_0xd383('0x19')],_0x18690a=_0x1e35fe[_0xd383('0x19')]+_0x1e35fe[_0xd383('0x1a')],_0x5359c6;if(_0x18690a>=_0x373876){_0x18690a=_0x373876;_0x5359c6=0xc8;}else{_0x5359c6=0xce;}_0x2ab5e8[_0xd383('0x17')](_0x5359c6);return _0x2ab5e8[_0xd383('0x1b')](_0xd383('0x1c'),_0x387f5f+'-'+_0x18690a+'/'+_0x373876)[_0xd383('0x1d')](_0xf2dcb6);}return null;};}function patchUpdates(_0x808fe7){return function(_0x59e8d1){try{jsonpatch[_0xd383('0x1e')](_0x59e8d1,_0x808fe7,!![]);}catch(_0x3714c8){return BPromise[_0xd383('0x1f')](_0x3714c8);}return _0x59e8d1[_0xd383('0x20')]();};}function saveUpdates(_0x213f72,_0x3618d9){return function(_0x49799e){if(_0x49799e){return _0x49799e[_0xd383('0x21')](_0x213f72)['then'](function(_0x1a8e78){return _0x1a8e78;});}return null;};}function removeEntity(_0x5ceb76,_0x10c1b2){return function(_0x39569f){if(_0x39569f){return _0x39569f['destroy']()[_0xd383('0x22')](function(){_0x5ceb76[_0xd383('0x17')](0xcc)[_0xd383('0x18')]();});}};}function handleEntityNotFound(_0x58e47e,_0x48d34b){return function(_0x10e296){if(!_0x10e296){_0x58e47e['sendStatus'](0x194);}return _0x10e296;};}function handleError(_0x58bf08,_0x2a95a8){_0x2a95a8=_0x2a95a8||0x1f4;return function(_0x503df5){logger[_0xd383('0x23')](_0x503df5['stack']);if(_0x503df5['name']){delete _0x503df5['name'];}_0x58bf08[_0xd383('0x17')](_0x2a95a8)[_0xd383('0x24')](_0x503df5);};}exports[_0xd383('0x25')]=function(_0x554758,_0x343d4d){var _0x2b3ab6={},_0x252f79={},_0x2d0016={'count':0x0,'rows':[]};var _0x27750a=db[_0xd383('0x26')][_0xd383('0x27')];_0x252f79[_0xd383('0x28')]=_[_0xd383('0x29')](_0x27750a);_0x252f79['query']=_[_0xd383('0x29')](_0x554758[_0xd383('0x2a')]);_0x252f79[_0xd383('0x2b')]=_[_0xd383('0x2c')](_0x252f79[_0xd383('0x28')],_0x252f79[_0xd383('0x2a')]);_0x2b3ab6[_0xd383('0x2d')]=_[_0xd383('0x2c')](_0x252f79[_0xd383('0x28')],qs[_0xd383('0x2e')](_0x554758[_0xd383('0x2a')][_0xd383('0x2e')]));_0x2b3ab6[_0xd383('0x2d')]=_0x2b3ab6[_0xd383('0x2d')][_0xd383('0x2f')]?_0x2b3ab6['attributes']:_0x252f79[_0xd383('0x28')];if(!_0x554758[_0xd383('0x2a')][_0xd383('0x30')](_0xd383('0x31'))){_0x2b3ab6[_0xd383('0x1a')]=qs[_0xd383('0x1a')](_0x554758[_0xd383('0x2a')][_0xd383('0x1a')]);_0x2b3ab6[_0xd383('0x19')]=qs['offset'](_0x554758[_0xd383('0x2a')]['offset']);}_0x2b3ab6[_0xd383('0x32')]=qs['sort'](_0x554758[_0xd383('0x2a')]['sort']);_0x2b3ab6[_0xd383('0x33')]=qs[_0xd383('0x2b')](_['pick'](_0x554758[_0xd383('0x2a')],_0x252f79[_0xd383('0x2b')]));if(_0x554758[_0xd383('0x2a')][_0xd383('0x34')]){_0x2b3ab6[_0xd383('0x33')]=_[_0xd383('0x35')](_0x2b3ab6[_0xd383('0x33')],{'$or':_[_0xd383('0x36')](_0x27750a,function(_0x9af1be){if(_0x9af1be[_0xd383('0x37')]['key']!==_0xd383('0x38')){var _0x39c006={};_0x39c006[_0x9af1be[_0xd383('0x39')]]={'$like':'%'+_0x554758[_0xd383('0x2a')][_0xd383('0x34')]+'%'};return _0x39c006;}})});}_0x2b3ab6=_[_0xd383('0x35')]({},_0x2b3ab6,_0x554758[_0xd383('0x3a')]);var _0x322e8d={'where':_0x2b3ab6[_0xd383('0x33')]};return db[_0xd383('0x26')][_0xd383('0x3b')](_0x322e8d)['then'](function(_0xa4a839){_0x2d0016[_0xd383('0x3b')]=_0xa4a839;if(_0x554758[_0xd383('0x2a')][_0xd383('0x3c')]){_0x2b3ab6[_0xd383('0x3d')]=[{'all':!![]}];}return db['MailSubstatus'][_0xd383('0x3e')](_0x2b3ab6);})[_0xd383('0x22')](function(_0x482965){_0x2d0016['rows']=_0x482965;return _0x2d0016;})[_0xd383('0x22')](respondWithFilteredResult(_0x343d4d,_0x2b3ab6))[_0xd383('0x3f')](handleError(_0x343d4d,null));};exports[_0xd383('0x40')]=function(_0x43a5a1,_0x100557){var _0x268d83={'raw':!![],'where':{'id':_0x43a5a1[_0xd383('0x41')]['id']}},_0x57228c={};_0x57228c[_0xd383('0x28')]=_[_0xd383('0x29')](db[_0xd383('0x26')][_0xd383('0x27')]);_0x57228c[_0xd383('0x2a')]=_[_0xd383('0x29')](_0x43a5a1[_0xd383('0x2a')]);_0x57228c[_0xd383('0x2b')]=_[_0xd383('0x2c')](_0x57228c[_0xd383('0x28')],_0x57228c[_0xd383('0x2a')]);_0x268d83['attributes']=_['intersection'](_0x57228c['model'],qs[_0xd383('0x2e')](_0x43a5a1[_0xd383('0x2a')][_0xd383('0x2e')]));_0x268d83['attributes']=_0x268d83[_0xd383('0x2d')][_0xd383('0x2f')]?_0x268d83[_0xd383('0x2d')]:_0x57228c[_0xd383('0x28')];if(_0x43a5a1['query'][_0xd383('0x3c')]){_0x268d83[_0xd383('0x3d')]=[{'all':!![]}];}_0x268d83=_[_0xd383('0x35')]({},_0x268d83,_0x43a5a1[_0xd383('0x3a')]);return db[_0xd383('0x26')]['find'](_0x268d83)[_0xd383('0x22')](handleEntityNotFound(_0x100557,null))[_0xd383('0x22')](respondWithResult(_0x100557,null))['catch'](handleError(_0x100557,null));};exports[_0xd383('0x42')]=function(_0xc84904,_0x45822a){return db['MailSubstatus'][_0xd383('0x42')](_0xc84904['body'],{})[_0xd383('0x22')](respondWithResult(_0x45822a,0xc9))[_0xd383('0x3f')](handleError(_0x45822a,null));};exports[_0xd383('0x21')]=function(_0x59687d,_0x54ec93){if(_0x59687d[_0xd383('0x43')]['id']){delete _0x59687d[_0xd383('0x43')]['id'];}return db['MailSubstatus'][_0xd383('0x44')]({'where':{'id':_0x59687d[_0xd383('0x41')]['id']}})[_0xd383('0x22')](handleEntityNotFound(_0x54ec93,null))[_0xd383('0x22')](saveUpdates(_0x59687d[_0xd383('0x43')],null))['then'](respondWithResult(_0x54ec93,null))[_0xd383('0x3f')](handleError(_0x54ec93,null));};exports[_0xd383('0x45')]=function(_0x36f2c2,_0x41bbc6){return db[_0xd383('0x26')][_0xd383('0x44')]({'where':{'id':_0x36f2c2[_0xd383('0x41')]['id']}})[_0xd383('0x22')](handleEntityNotFound(_0x41bbc6,null))[_0xd383('0x22')](removeEntity(_0x41bbc6,null))[_0xd383('0x3f')](handleError(_0x41bbc6,null));};exports[_0xd383('0x46')]=function(_0x37d388,_0xb0716a){return db['MailSubstatus'][_0xd383('0x46')]()[_0xd383('0x22')](respondWithResult(_0xb0716a,null))['catch'](handleError(_0xb0716a,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 21afe68..9b38660 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 _0x7296=['mail_substatuses','lodash','util','api','bluebird','request-promise','rimraf','../../config/environment','exports','MailSubstatus'];(function(_0x2e689d,_0x4c3b29){var _0x540160=function(_0xac5c81){while(--_0xac5c81){_0x2e689d['push'](_0x2e689d['shift']());}};_0x540160(++_0x4c3b29);}(_0x7296,0xc9));var _0x6729=function(_0xbc346f,_0x3db5c0){_0xbc346f=_0xbc346f-0x0;var _0x9f9260=_0x7296[_0xbc346f];return _0x9f9260;};'use strict';var _=require(_0x6729('0x0'));var util=require(_0x6729('0x1'));var logger=require('../../config/logger')(_0x6729('0x2'));var moment=require('moment');var BPromise=require(_0x6729('0x3'));var rp=require(_0x6729('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6729('0x5'));var config=require(_0x6729('0x6'));var attributes=require('./mailSubstatus.attributes');module[_0x6729('0x7')]=function(_0x57d83d,_0x5c25fa){return _0x57d83d['define'](_0x6729('0x8'),attributes,{'tableName':_0x6729('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf53d=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','./mailSubstatus.attributes','exports','define'];(function(_0x5bd25b,_0x10b5bf){var _0x4682b4=function(_0x12a8e9){while(--_0x12a8e9){_0x5bd25b['push'](_0x5bd25b['shift']());}};_0x4682b4(++_0x10b5bf);}(_0xf53d,0x1d6));var _0xdf53=function(_0x38d54c,_0x30822a){_0x38d54c=_0x38d54c-0x0;var _0x174b6a=_0xf53d[_0x38d54c];return _0x174b6a;};'use strict';var _=require(_0xdf53('0x0'));var util=require('util');var logger=require(_0xdf53('0x1'))(_0xdf53('0x2'));var moment=require(_0xdf53('0x3'));var BPromise=require(_0xdf53('0x4'));var rp=require(_0xdf53('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdf53('0x6'));var config=require('../../config/environment');var attributes=require(_0xdf53('0x7'));module[_0xdf53('0x8')]=function(_0x53d9ee,_0x45a787){return _0x53d9ee[_0xdf53('0x9')]('MailSubstatus',attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 8d7235a..3a39911 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 _0xb553=['error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4abea3,_0x1e257f){var _0x277e02=function(_0x4b1d95){while(--_0x4b1d95){_0x4abea3['push'](_0x4abea3['shift']());}};_0x277e02(++_0x1e257f);}(_0xb553,0x184));var _0x3b55=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xb553[_0x49b207];return _0x2dc8fa;};'use strict';var _=require('lodash');var util=require(_0x3b55('0x0'));var moment=require(_0x3b55('0x1'));var BPromise=require(_0x3b55('0x2'));var rs=require(_0x3b55('0x3'));var fs=require('fs');var Redis=require(_0x3b55('0x4'));var db=require(_0x3b55('0x5'))['db'];var utils=require(_0x3b55('0x6'));var logger=require(_0x3b55('0x7'))(_0x3b55('0x8'));var config=require(_0x3b55('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3b55('0xa')][_0x3b55('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x550424,_0x4f2a30,_0x389a5b){return new BPromise(function(_0x1319cf,_0xdaa1e1){return client[_0x3b55('0xc')](_0x550424,_0x389a5b)[_0x3b55('0xd')](function(_0x17c074){logger[_0x3b55('0xe')](_0x3b55('0xf'),_0x4f2a30,_0x3b55('0x10'));logger[_0x3b55('0x11')](_0x3b55('0x12'),_0x4f2a30,_0x3b55('0x10'),JSON[_0x3b55('0x13')](_0x17c074));if(_0x17c074[_0x3b55('0x14')]){if(_0x17c074[_0x3b55('0x14')]['code']===0x1f4){logger[_0x3b55('0x14')](_0x3b55('0xf'),_0x4f2a30,_0x17c074[_0x3b55('0x14')]['message']);return _0xdaa1e1(_0x17c074['error'][_0x3b55('0x15')]);}logger[_0x3b55('0x14')](_0x3b55('0xf'),_0x4f2a30,_0x17c074[_0x3b55('0x14')]['message']);return _0x1319cf(_0x17c074[_0x3b55('0x14')][_0x3b55('0x15')]);}else{logger[_0x3b55('0xe')]('MailSubstatus,\x20%s,\x20%s',_0x4f2a30,_0x3b55('0x10'));_0x1319cf(_0x17c074[_0x3b55('0x16')][_0x3b55('0x15')]);}})[_0x3b55('0x17')](function(_0x137cc3){logger[_0x3b55('0x14')](_0x3b55('0xf'),_0x4f2a30,_0x137cc3);_0xdaa1e1(_0x137cc3);});});} \ No newline at end of file +var _0x6ec0=['catch','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','debug','stringify','error','code','MailSubstatus,\x20%s,\x20%s','message','request\x20sent','result'];(function(_0xc82877,_0x2607e5){var _0x185c14=function(_0x507e8f){while(--_0x507e8f){_0xc82877['push'](_0xc82877['shift']());}};_0x185c14(++_0x2607e5);}(_0x6ec0,0x1b6));var _0x06ec=function(_0x4eddde,_0x151c59){_0x4eddde=_0x4eddde-0x0;var _0x161301=_0x6ec0[_0x4eddde];return _0x161301;};'use strict';var _=require(_0x06ec('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x06ec('0x1'));var rs=require(_0x06ec('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x06ec('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x06ec('0x4'))(_0x06ec('0x5'));var config=require('../../config/environment');var jayson=require(_0x06ec('0x6'));var client=jayson[_0x06ec('0x7')][_0x06ec('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4178f6,_0x3bf96f,_0x557eb6){return new BPromise(function(_0x52156d,_0xfc1f5b){return client[_0x06ec('0x9')](_0x4178f6,_0x557eb6)['then'](function(_0x1a57a6){logger['info']('MailSubstatus,\x20%s,\x20%s',_0x3bf96f,'request\x20sent');logger[_0x06ec('0xa')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x3bf96f,'request\x20sent',JSON[_0x06ec('0xb')](_0x1a57a6));if(_0x1a57a6[_0x06ec('0xc')]){if(_0x1a57a6[_0x06ec('0xc')][_0x06ec('0xd')]===0x1f4){logger[_0x06ec('0xc')](_0x06ec('0xe'),_0x3bf96f,_0x1a57a6[_0x06ec('0xc')]['message']);return _0xfc1f5b(_0x1a57a6['error']['message']);}logger['error'](_0x06ec('0xe'),_0x3bf96f,_0x1a57a6[_0x06ec('0xc')][_0x06ec('0xf')]);return _0x52156d(_0x1a57a6[_0x06ec('0xc')]['message']);}else{logger['info']('MailSubstatus,\x20%s,\x20%s',_0x3bf96f,_0x06ec('0x10'));_0x52156d(_0x1a57a6[_0x06ec('0x11')][_0x06ec('0xf')]);}})[_0x06ec('0x12')](function(_0x3fe058){logger[_0x06ec('0xc')]('MailSubstatus,\x20%s,\x20%s',_0x3bf96f,_0x3fe058);_0xfc1f5b(_0x3fe058);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 769a522..e5f6092 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 _0xdf55=['post','put','update','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show'];(function(_0x2bb9b3,_0x1d2c25){var _0x601b6=function(_0x4f8d09){while(--_0x4f8d09){_0x2bb9b3['push'](_0x2bb9b3['shift']());}};_0x601b6(++_0x1d2c25);}(_0xdf55,0x83));var _0x5df5=function(_0x29ef06,_0x3e54b7){_0x29ef06=_0x29ef06-0x0;var _0x57bd49=_0xdf55[_0x29ef06];return _0x57bd49;};'use strict';var multer=require(_0x5df5('0x0'));var util=require(_0x5df5('0x1'));var path=require('path');var timeout=require(_0x5df5('0x2'));var express=require(_0x5df5('0x3'));var router=express['Router']();var auth=require(_0x5df5('0x4'));var interaction=require(_0x5df5('0x5'));var config=require(_0x5df5('0x6'));var controller=require('./mailTransferReport.controller');router[_0x5df5('0x7')]('/',auth[_0x5df5('0x8')](),controller[_0x5df5('0x9')]);router[_0x5df5('0x7')](_0x5df5('0xa'),auth[_0x5df5('0x8')](),controller[_0x5df5('0xb')]);router[_0x5df5('0x7')]('/:id',auth[_0x5df5('0x8')](),controller[_0x5df5('0xc')]);router[_0x5df5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5df5('0xe')]('/:id',auth[_0x5df5('0x8')](),controller[_0x5df5('0xf')]);router['delete']('/:id',auth[_0x5df5('0x8')](),controller[_0x5df5('0x10')]);module[_0x5df5('0x11')]=router; \ No newline at end of file +var _0x27a0=['path','connect-timeout','express','Router','get','isAuthenticated','index','/describe','/:id','post','create','update','delete','destroy','exports','util'];(function(_0x4ba48c,_0x56b83c){var _0x6d98c7=function(_0x1ad7d2){while(--_0x1ad7d2){_0x4ba48c['push'](_0x4ba48c['shift']());}};_0x6d98c7(++_0x56b83c);}(_0x27a0,0xbf));var _0x027a=function(_0x19baa3,_0xc22b47){_0x19baa3=_0x19baa3-0x0;var _0x470583=_0x27a0[_0x19baa3];return _0x470583;};'use strict';var multer=require('multer');var util=require(_0x027a('0x0'));var path=require(_0x027a('0x1'));var timeout=require(_0x027a('0x2'));var express=require(_0x027a('0x3'));var router=express[_0x027a('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./mailTransferReport.controller');router[_0x027a('0x5')]('/',auth[_0x027a('0x6')](),controller[_0x027a('0x7')]);router[_0x027a('0x5')](_0x027a('0x8'),auth[_0x027a('0x6')](),controller['describe']);router[_0x027a('0x5')](_0x027a('0x9'),auth[_0x027a('0x6')](),controller['show']);router[_0x027a('0xa')]('/',auth[_0x027a('0x6')](),controller[_0x027a('0xb')]);router['put'](_0x027a('0x9'),auth[_0x027a('0x6')](),controller[_0x027a('0xc')]);router[_0x027a('0xd')](_0x027a('0x9'),auth[_0x027a('0x6')](),controller[_0x027a('0xe')]);module[_0x027a('0xf')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index d6a4d91..ec7ce5f 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 _0x7845=['DATE','NOW','exports','STRING','ENUM','account','agent'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x7845,0x136));var _0x5784=function(_0x23fd7b,_0x394165){_0x23fd7b=_0x23fd7b-0x0;var _0x4a4402=_0x7845[_0x23fd7b];return _0x4a4402;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x5784('0x0')]={'uniqueid':{'type':Sequelize[_0x5784('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x5784('0x2')](_0x5784('0x3'),_0x5784('0x4'),'queue'),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x5784('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x5784('0x6')]}}; \ No newline at end of file +var _0xa55f=['sequelize','exports','STRING','ENUM','account','agent','queue','moment'];(function(_0x29af1d,_0xb27184){var _0x21118d=function(_0x21c75a){while(--_0x21c75a){_0x29af1d['push'](_0x29af1d['shift']());}};_0x21118d(++_0xb27184);}(_0xa55f,0x197));var _0xfa55=function(_0x1d66d4,_0x4a4a3c){_0x1d66d4=_0x1d66d4-0x0;var _0x1fde89=_0xa55f[_0x1d66d4];return _0x1fde89;};'use strict';var moment=require(_0xfa55('0x0'));var Sequelize=require(_0xfa55('0x1'));module[_0xfa55('0x2')]={'uniqueid':{'type':Sequelize[_0xfa55('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xfa55('0x4')](_0xfa55('0x5'),_0xfa55('0x6'),_0xfa55('0x7')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 0ba903c..d5d11b3 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 _0x4897=['update','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','field','options','MailTransferReport','includeAll','findAll','rows','catch','show','params','length','find','create','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','count','offset','limit','set','Content-Range','apply','save'];(function(_0x45346d,_0xffd56b){var _0x5ce7ca=function(_0x27ce87){while(--_0x27ce87){_0x45346d['push'](_0x45346d['shift']());}};_0x5ce7ca(++_0xffd56b);}(_0x4897,0x14b));var _0x7489=function(_0x5a2e2d,_0x34ac4b){_0x5a2e2d=_0x5a2e2d-0x0;var _0x37b95b=_0x4897[_0x5a2e2d];return _0x37b95b;};'use strict';var pdf=require(_0x7489('0x0'));var emlformat=require(_0x7489('0x1'));var rimraf=require(_0x7489('0x2'));var zipdir=require(_0x7489('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7489('0x4'));var moment=require('moment');var BPromise=require(_0x7489('0x5'));var Mustache=require(_0x7489('0x6'));var util=require(_0x7489('0x7'));var path=require(_0x7489('0x8'));var sox=require('sox');var csv=require(_0x7489('0x9'));var ejs=require(_0x7489('0xa'));var fs=require('fs');var _=require(_0x7489('0xb'));var squel=require(_0x7489('0xc'));var crypto=require(_0x7489('0xd'));var jsforce=require(_0x7489('0xe'));var deskjs=require(_0x7489('0xf'));var toCsv=require(_0x7489('0x9'));var querystring=require(_0x7489('0x10'));var Papa=require(_0x7489('0x11'));var Redis=require('ioredis');var authService=require(_0x7489('0x12'));var qs=require(_0x7489('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7489('0x14'))(_0x7489('0x15'));var utils=require(_0x7489('0x16'));var config=require(_0x7489('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3545df,_0x336b38){_0x336b38=_0x336b38||0xcc;return function(_0xf0825c){if(_0xf0825c){return _0x3545df['sendStatus'](_0x336b38);}return _0x3545df[_0x7489('0x18')](_0x336b38)[_0x7489('0x19')]();};}function respondWithResult(_0x25a04c,_0x1b89a0){_0x1b89a0=_0x1b89a0||0xc8;return function(_0x56eb3b){if(_0x56eb3b){return _0x25a04c[_0x7489('0x18')](_0x1b89a0)[_0x7489('0x1a')](_0x56eb3b);}};}function respondWithFilteredResult(_0x2baf83,_0x2ec353){return function(_0x5e0c62){if(_0x5e0c62){var _0x314bdd=_0x5e0c62[_0x7489('0x1b')],_0x1170a4=_0x2ec353[_0x7489('0x1c')],_0x3d2ba7=_0x2ec353['offset']+_0x2ec353[_0x7489('0x1d')],_0xdeecb5;if(_0x3d2ba7>=_0x314bdd){_0x3d2ba7=_0x314bdd;_0xdeecb5=0xc8;}else{_0xdeecb5=0xce;}_0x2baf83['status'](_0xdeecb5);return _0x2baf83[_0x7489('0x1e')](_0x7489('0x1f'),_0x1170a4+'-'+_0x3d2ba7+'/'+_0x314bdd)[_0x7489('0x1a')](_0x5e0c62);}return null;};}function patchUpdates(_0x37d623){return function(_0x4cfaee){try{jsonpatch[_0x7489('0x20')](_0x4cfaee,_0x37d623,!![]);}catch(_0x145a88){return BPromise['reject'](_0x145a88);}return _0x4cfaee[_0x7489('0x21')]();};}function saveUpdates(_0x17bcdf,_0x4adb7c){return function(_0x478a09){if(_0x478a09){return _0x478a09[_0x7489('0x22')](_0x17bcdf)[_0x7489('0x23')](function(_0xbc836b){return _0xbc836b;});}return null;};}function removeEntity(_0x1cb163,_0x51e987){return function(_0x1936b3){if(_0x1936b3){return _0x1936b3[_0x7489('0x24')]()[_0x7489('0x23')](function(){_0x1cb163[_0x7489('0x18')](0xcc)[_0x7489('0x19')]();});}};}function handleEntityNotFound(_0x159bcf,_0x1844ef){return function(_0x2566bb){if(!_0x2566bb){_0x159bcf[_0x7489('0x25')](0x194);}return _0x2566bb;};}function handleError(_0xcd5f7a,_0x3d2001){_0x3d2001=_0x3d2001||0x1f4;return function(_0x470b54){logger[_0x7489('0x26')](_0x470b54[_0x7489('0x27')]);if(_0x470b54['name']){delete _0x470b54[_0x7489('0x28')];}_0xcd5f7a[_0x7489('0x18')](_0x3d2001)[_0x7489('0x29')](_0x470b54);};}exports[_0x7489('0x2a')]=function(_0xec618f,_0x2402fa){var _0x54844f={},_0x116f07={},_0x248cbd={'count':0x0,'rows':[]};var _0x512fe0=db['MailTransferReport'][_0x7489('0x2b')];_0x116f07['model']=_[_0x7489('0x2c')](_0x512fe0);_0x116f07[_0x7489('0x2d')]=_[_0x7489('0x2c')](_0xec618f[_0x7489('0x2d')]);_0x116f07[_0x7489('0x2e')]=_[_0x7489('0x2f')](_0x116f07[_0x7489('0x30')],_0x116f07[_0x7489('0x2d')]);_0x54844f[_0x7489('0x31')]=_[_0x7489('0x2f')](_0x116f07[_0x7489('0x30')],qs[_0x7489('0x32')](_0xec618f[_0x7489('0x2d')]['fields']));_0x54844f[_0x7489('0x31')]=_0x54844f['attributes']['length']?_0x54844f[_0x7489('0x31')]:_0x116f07['model'];if(!_0xec618f[_0x7489('0x2d')][_0x7489('0x33')](_0x7489('0x34'))){_0x54844f[_0x7489('0x1d')]=qs[_0x7489('0x1d')](_0xec618f[_0x7489('0x2d')][_0x7489('0x1d')]);_0x54844f[_0x7489('0x1c')]=qs['offset'](_0xec618f[_0x7489('0x2d')]['offset']);}_0x54844f[_0x7489('0x35')]=qs['sort'](_0xec618f[_0x7489('0x2d')][_0x7489('0x36')]);_0x54844f[_0x7489('0x37')]=qs[_0x7489('0x2e')](_[_0x7489('0x38')](_0xec618f[_0x7489('0x2d')],_0x116f07['filters']));if(_0xec618f['query'][_0x7489('0x39')]){_0x54844f[_0x7489('0x37')]=_[_0x7489('0x3a')](_0x54844f[_0x7489('0x37')],{'$or':_[_0x7489('0x3b')](_0x512fe0,function(_0x48dd47){if(_0x48dd47['type']['key']!=='VIRTUAL'){var _0x59297b={};_0x59297b[_0x48dd47[_0x7489('0x3c')]]={'$like':'%'+_0xec618f[_0x7489('0x2d')][_0x7489('0x39')]+'%'};return _0x59297b;}})});}_0x54844f=_[_0x7489('0x3a')]({},_0x54844f,_0xec618f[_0x7489('0x3d')]);var _0x5e70d7={'where':_0x54844f[_0x7489('0x37')]};return db[_0x7489('0x3e')]['count'](_0x5e70d7)['then'](function(_0x236ea4){_0x248cbd[_0x7489('0x1b')]=_0x236ea4;if(_0xec618f['query'][_0x7489('0x3f')]){_0x54844f['include']=[{'all':!![]}];}return db[_0x7489('0x3e')][_0x7489('0x40')](_0x54844f);})[_0x7489('0x23')](function(_0x381666){_0x248cbd[_0x7489('0x41')]=_0x381666;return _0x248cbd;})[_0x7489('0x23')](respondWithFilteredResult(_0x2402fa,_0x54844f))[_0x7489('0x42')](handleError(_0x2402fa,null));};exports[_0x7489('0x43')]=function(_0x4c89e3,_0x550f55){var _0x21e130={'raw':!![],'where':{'id':_0x4c89e3[_0x7489('0x44')]['id']}},_0x5d73aa={};_0x5d73aa[_0x7489('0x30')]=_[_0x7489('0x2c')](db['MailTransferReport'][_0x7489('0x2b')]);_0x5d73aa[_0x7489('0x2d')]=_['keys'](_0x4c89e3[_0x7489('0x2d')]);_0x5d73aa['filters']=_[_0x7489('0x2f')](_0x5d73aa[_0x7489('0x30')],_0x5d73aa['query']);_0x21e130['attributes']=_[_0x7489('0x2f')](_0x5d73aa[_0x7489('0x30')],qs[_0x7489('0x32')](_0x4c89e3[_0x7489('0x2d')][_0x7489('0x32')]));_0x21e130[_0x7489('0x31')]=_0x21e130['attributes'][_0x7489('0x45')]?_0x21e130['attributes']:_0x5d73aa[_0x7489('0x30')];if(_0x4c89e3['query']['includeAll']){_0x21e130['include']=[{'all':!![]}];}_0x21e130=_[_0x7489('0x3a')]({},_0x21e130,_0x4c89e3[_0x7489('0x3d')]);return db[_0x7489('0x3e')][_0x7489('0x46')](_0x21e130)[_0x7489('0x23')](handleEntityNotFound(_0x550f55,null))[_0x7489('0x23')](respondWithResult(_0x550f55,null))[_0x7489('0x42')](handleError(_0x550f55,null));};exports[_0x7489('0x47')]=function(_0x591a6d,_0x289b11){return db['MailTransferReport']['create'](_0x591a6d[_0x7489('0x48')],{})['then'](respondWithResult(_0x289b11,0xc9))['catch'](handleError(_0x289b11,null));};exports[_0x7489('0x22')]=function(_0x26f2c5,_0x281dd4){if(_0x26f2c5['body']['id']){delete _0x26f2c5[_0x7489('0x48')]['id'];}return db[_0x7489('0x3e')]['find']({'where':{'id':_0x26f2c5[_0x7489('0x44')]['id']}})[_0x7489('0x23')](handleEntityNotFound(_0x281dd4,null))['then'](saveUpdates(_0x26f2c5[_0x7489('0x48')],null))[_0x7489('0x23')](respondWithResult(_0x281dd4,null))['catch'](handleError(_0x281dd4,null));};exports['destroy']=function(_0x520583,_0xe08155){return db[_0x7489('0x3e')]['find']({'where':{'id':_0x520583[_0x7489('0x44')]['id']}})['then'](handleEntityNotFound(_0xe08155,null))[_0x7489('0x23')](removeEntity(_0xe08155,null))['catch'](handleError(_0xe08155,null));};exports['describe']=function(_0x385a33,_0x1d47b4){return db['MailTransferReport']['describe']()['then'](respondWithResult(_0x1d47b4,null))['catch'](handleError(_0x1d47b4,null));}; \ No newline at end of file +var _0x8502=['name','send','index','MailTransferReport','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','field','merge','options','include','rows','catch','show','params','rawAttributes','includeAll','find','create','body','update','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','count','offset','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error'];(function(_0x134448,_0x591d7b){var _0x2d52a1=function(_0x56b840){while(--_0x56b840){_0x134448['push'](_0x134448['shift']());}};_0x2d52a1(++_0x591d7b);}(_0x8502,0x68));var _0x2850=function(_0xa388a2,_0x40bde6){_0xa388a2=_0xa388a2-0x0;var _0x7ce7f6=_0x8502[_0xa388a2];return _0x7ce7f6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2850('0x0'));var rimraf=require(_0x2850('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2850('0x2'));var rp=require(_0x2850('0x3'));var moment=require('moment');var BPromise=require(_0x2850('0x4'));var Mustache=require(_0x2850('0x5'));var util=require(_0x2850('0x6'));var path=require(_0x2850('0x7'));var sox=require(_0x2850('0x8'));var csv=require('to-csv');var ejs=require(_0x2850('0x9'));var fs=require('fs');var _=require(_0x2850('0xa'));var squel=require('squel');var crypto=require(_0x2850('0xb'));var jsforce=require(_0x2850('0xc'));var deskjs=require(_0x2850('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2850('0xe'));var Papa=require(_0x2850('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2850('0x10'));var hardwareService=require(_0x2850('0x11'));var logger=require('../../config/logger')(_0x2850('0x12'));var utils=require(_0x2850('0x13'));var config=require(_0x2850('0x14'));var db=require(_0x2850('0x15'))['db'];function respondWithStatusCode(_0x304b24,_0xde90f3){_0xde90f3=_0xde90f3||0xcc;return function(_0x4afa6b){if(_0x4afa6b){return _0x304b24['sendStatus'](_0xde90f3);}return _0x304b24[_0x2850('0x16')](_0xde90f3)['end']();};}function respondWithResult(_0x2989f6,_0x31de1e){_0x31de1e=_0x31de1e||0xc8;return function(_0x1ad44a){if(_0x1ad44a){return _0x2989f6[_0x2850('0x16')](_0x31de1e)['json'](_0x1ad44a);}};}function respondWithFilteredResult(_0x1d11c2,_0xf4650f){return function(_0x7fb99d){if(_0x7fb99d){var _0x2d99bf=_0x7fb99d[_0x2850('0x17')],_0x4f397d=_0xf4650f[_0x2850('0x18')],_0xaecba2=_0xf4650f['offset']+_0xf4650f['limit'],_0x3920ab;if(_0xaecba2>=_0x2d99bf){_0xaecba2=_0x2d99bf;_0x3920ab=0xc8;}else{_0x3920ab=0xce;}_0x1d11c2[_0x2850('0x16')](_0x3920ab);return _0x1d11c2[_0x2850('0x19')](_0x2850('0x1a'),_0x4f397d+'-'+_0xaecba2+'/'+_0x2d99bf)['json'](_0x7fb99d);}return null;};}function patchUpdates(_0x2e152f){return function(_0x4dbc00){try{jsonpatch[_0x2850('0x1b')](_0x4dbc00,_0x2e152f,!![]);}catch(_0x11a41a){return BPromise[_0x2850('0x1c')](_0x11a41a);}return _0x4dbc00[_0x2850('0x1d')]();};}function saveUpdates(_0x221826,_0x404c01){return function(_0x5cb373){if(_0x5cb373){return _0x5cb373['update'](_0x221826)[_0x2850('0x1e')](function(_0x487d88){return _0x487d88;});}return null;};}function removeEntity(_0x2906c2,_0x239e5b){return function(_0x20aec0){if(_0x20aec0){return _0x20aec0[_0x2850('0x1f')]()['then'](function(){_0x2906c2[_0x2850('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3457f0,_0x44204e){return function(_0x2fd17a){if(!_0x2fd17a){_0x3457f0[_0x2850('0x20')](0x194);}return _0x2fd17a;};}function handleError(_0x200a91,_0x5600a8){_0x5600a8=_0x5600a8||0x1f4;return function(_0x100394){logger[_0x2850('0x21')](_0x100394['stack']);if(_0x100394[_0x2850('0x22')]){delete _0x100394[_0x2850('0x22')];}_0x200a91[_0x2850('0x16')](_0x5600a8)[_0x2850('0x23')](_0x100394);};}exports[_0x2850('0x24')]=function(_0x50886e,_0x3d2742){var _0x2cf665={},_0x1a59d1={},_0x2af290={'count':0x0,'rows':[]};var _0x55c0e3=db[_0x2850('0x25')]['rawAttributes'];_0x1a59d1['model']=_[_0x2850('0x26')](_0x55c0e3);_0x1a59d1[_0x2850('0x27')]=_[_0x2850('0x26')](_0x50886e[_0x2850('0x27')]);_0x1a59d1[_0x2850('0x28')]=_[_0x2850('0x29')](_0x1a59d1[_0x2850('0x2a')],_0x1a59d1[_0x2850('0x27')]);_0x2cf665[_0x2850('0x2b')]=_[_0x2850('0x29')](_0x1a59d1[_0x2850('0x2a')],qs[_0x2850('0x2c')](_0x50886e[_0x2850('0x27')]['fields']));_0x2cf665['attributes']=_0x2cf665[_0x2850('0x2b')]['length']?_0x2cf665[_0x2850('0x2b')]:_0x1a59d1[_0x2850('0x2a')];if(!_0x50886e['query'][_0x2850('0x2d')](_0x2850('0x2e'))){_0x2cf665[_0x2850('0x2f')]=qs[_0x2850('0x2f')](_0x50886e[_0x2850('0x27')][_0x2850('0x2f')]);_0x2cf665[_0x2850('0x18')]=qs[_0x2850('0x18')](_0x50886e[_0x2850('0x27')]['offset']);}_0x2cf665[_0x2850('0x30')]=qs[_0x2850('0x31')](_0x50886e[_0x2850('0x27')][_0x2850('0x31')]);_0x2cf665[_0x2850('0x32')]=qs[_0x2850('0x28')](_[_0x2850('0x33')](_0x50886e[_0x2850('0x27')],_0x1a59d1[_0x2850('0x28')]));if(_0x50886e[_0x2850('0x27')][_0x2850('0x34')]){_0x2cf665[_0x2850('0x32')]=_['merge'](_0x2cf665[_0x2850('0x32')],{'$or':_['map'](_0x55c0e3,function(_0x2d861f){if(_0x2d861f['type']['key']!==_0x2850('0x35')){var _0x1deca9={};_0x1deca9[_0x2d861f[_0x2850('0x36')]]={'$like':'%'+_0x50886e['query']['filter']+'%'};return _0x1deca9;}})});}_0x2cf665=_[_0x2850('0x37')]({},_0x2cf665,_0x50886e[_0x2850('0x38')]);var _0x33fc39={'where':_0x2cf665['where']};return db[_0x2850('0x25')][_0x2850('0x17')](_0x33fc39)[_0x2850('0x1e')](function(_0x175d54){_0x2af290['count']=_0x175d54;if(_0x50886e[_0x2850('0x27')]['includeAll']){_0x2cf665[_0x2850('0x39')]=[{'all':!![]}];}return db[_0x2850('0x25')]['findAll'](_0x2cf665);})[_0x2850('0x1e')](function(_0x2c6111){_0x2af290[_0x2850('0x3a')]=_0x2c6111;return _0x2af290;})[_0x2850('0x1e')](respondWithFilteredResult(_0x3d2742,_0x2cf665))[_0x2850('0x3b')](handleError(_0x3d2742,null));};exports[_0x2850('0x3c')]=function(_0x460cce,_0x31316c){var _0xcc65b4={'raw':!![],'where':{'id':_0x460cce[_0x2850('0x3d')]['id']}},_0x15aabd={};_0x15aabd[_0x2850('0x2a')]=_[_0x2850('0x26')](db[_0x2850('0x25')][_0x2850('0x3e')]);_0x15aabd[_0x2850('0x27')]=_[_0x2850('0x26')](_0x460cce[_0x2850('0x27')]);_0x15aabd['filters']=_[_0x2850('0x29')](_0x15aabd[_0x2850('0x2a')],_0x15aabd[_0x2850('0x27')]);_0xcc65b4[_0x2850('0x2b')]=_['intersection'](_0x15aabd['model'],qs['fields'](_0x460cce[_0x2850('0x27')][_0x2850('0x2c')]));_0xcc65b4[_0x2850('0x2b')]=_0xcc65b4[_0x2850('0x2b')]['length']?_0xcc65b4['attributes']:_0x15aabd[_0x2850('0x2a')];if(_0x460cce[_0x2850('0x27')][_0x2850('0x3f')]){_0xcc65b4[_0x2850('0x39')]=[{'all':!![]}];}_0xcc65b4=_[_0x2850('0x37')]({},_0xcc65b4,_0x460cce[_0x2850('0x38')]);return db[_0x2850('0x25')][_0x2850('0x40')](_0xcc65b4)['then'](handleEntityNotFound(_0x31316c,null))['then'](respondWithResult(_0x31316c,null))[_0x2850('0x3b')](handleError(_0x31316c,null));};exports[_0x2850('0x41')]=function(_0x24e371,_0x3a85f7){return db['MailTransferReport'][_0x2850('0x41')](_0x24e371[_0x2850('0x42')],{})[_0x2850('0x1e')](respondWithResult(_0x3a85f7,0xc9))[_0x2850('0x3b')](handleError(_0x3a85f7,null));};exports[_0x2850('0x43')]=function(_0x372e69,_0x376950){if(_0x372e69[_0x2850('0x42')]['id']){delete _0x372e69[_0x2850('0x42')]['id'];}return db[_0x2850('0x25')][_0x2850('0x40')]({'where':{'id':_0x372e69[_0x2850('0x3d')]['id']}})[_0x2850('0x1e')](handleEntityNotFound(_0x376950,null))[_0x2850('0x1e')](saveUpdates(_0x372e69[_0x2850('0x42')],null))[_0x2850('0x1e')](respondWithResult(_0x376950,null))['catch'](handleError(_0x376950,null));};exports[_0x2850('0x1f')]=function(_0xf0084b,_0xee1077){return db[_0x2850('0x25')][_0x2850('0x40')]({'where':{'id':_0xf0084b[_0x2850('0x3d')]['id']}})[_0x2850('0x1e')](handleEntityNotFound(_0xee1077,null))['then'](removeEntity(_0xee1077,null))[_0x2850('0x3b')](handleError(_0xee1077,null));};exports[_0x2850('0x44')]=function(_0x27b271,_0x456669){return db[_0x2850('0x25')]['describe']()[_0x2850('0x1e')](respondWithResult(_0x456669,null))[_0x2850('0x3b')](handleError(_0x456669,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index b551528..c55a4ce 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 _0x687b=['./mailTransferReport.attributes','exports','define','MailTransferReport','uniqueid','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x2b9c7d,_0x43d27e){var _0x124b48=function(_0x1dcff9){while(--_0x1dcff9){_0x2b9c7d['push'](_0x2b9c7d['shift']());}};_0x124b48(++_0x43d27e);}(_0x687b,0x14a));var _0xb687=function(_0x500785,_0x15e5ff){_0x500785=_0x500785-0x0;var _0x1f8bcc=_0x687b[_0x500785];return _0x1f8bcc;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var logger=require(_0xb687('0x2'))(_0xb687('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb687('0x4'));var fs=require('fs');var path=require(_0xb687('0x5'));var rimraf=require(_0xb687('0x6'));var config=require(_0xb687('0x7'));var attributes=require(_0xb687('0x8'));module[_0xb687('0x9')]=function(_0x16ccf3,_0xf43a1f){return _0x16ccf3[_0xb687('0xa')](_0xb687('0xb'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0xb687('0xc'),'fields':[_0xb687('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xeec6=['request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird'];(function(_0x54945e,_0x42f71a){var _0x36eabd=function(_0x178ecf){while(--_0x178ecf){_0x54945e['push'](_0x54945e['shift']());}};_0x36eabd(++_0x42f71a);}(_0xeec6,0x1c2));var _0x6eec=function(_0x53b594,_0x559767){_0x53b594=_0x53b594-0x0;var _0x1e616f=_0xeec6[_0x53b594];return _0x1e616f;};'use strict';var _=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var logger=require(_0x6eec('0x2'))(_0x6eec('0x3'));var moment=require('moment');var BPromise=require(_0x6eec('0x4'));var rp=require(_0x6eec('0x5'));var fs=require('fs');var path=require(_0x6eec('0x6'));var rimraf=require(_0x6eec('0x7'));var config=require(_0x6eec('0x8'));var attributes=require(_0x6eec('0x9'));module['exports']=function(_0x185f31,_0x3c6eda){return _0x185f31['define'](_0x6eec('0xa'),attributes,{'tableName':_0x6eec('0xb'),'paranoid':![],'indexes':[{'name':_0x6eec('0xc'),'fields':[_0x6eec('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 7b498b6..37b6649 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 _0x1ed2=['debug','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x1ed2,0x1e7));var _0x21ed=function(_0xc4c142,_0x392430){_0xc4c142=_0xc4c142-0x0;var _0x2c825e=_0x1ed2[_0xc4c142];return _0x2c825e;};'use strict';var _=require(_0x21ed('0x0'));var util=require(_0x21ed('0x1'));var moment=require('moment');var BPromise=require(_0x21ed('0x2'));var rs=require(_0x21ed('0x3'));var fs=require('fs');var Redis=require(_0x21ed('0x4'));var db=require(_0x21ed('0x5'))['db'];var utils=require(_0x21ed('0x6'));var logger=require(_0x21ed('0x7'))(_0x21ed('0x8'));var config=require('../../config/environment');var jayson=require(_0x21ed('0x9'));var client=jayson[_0x21ed('0xa')][_0x21ed('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b6e6a,_0x4de958,_0x56ad93){return new BPromise(function(_0x1548b2,_0x18b901){return client[_0x21ed('0xc')](_0x3b6e6a,_0x56ad93)[_0x21ed('0xd')](function(_0x3a1db0){logger[_0x21ed('0xe')](_0x21ed('0xf'),_0x4de958,_0x21ed('0x10'));logger[_0x21ed('0x11')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x4de958,_0x21ed('0x10'),JSON[_0x21ed('0x12')](_0x3a1db0));if(_0x3a1db0[_0x21ed('0x13')]){if(_0x3a1db0[_0x21ed('0x13')][_0x21ed('0x14')]===0x1f4){logger[_0x21ed('0x13')](_0x21ed('0xf'),_0x4de958,_0x3a1db0[_0x21ed('0x13')][_0x21ed('0x15')]);return _0x18b901(_0x3a1db0[_0x21ed('0x13')][_0x21ed('0x15')]);}logger[_0x21ed('0x13')](_0x21ed('0xf'),_0x4de958,_0x3a1db0[_0x21ed('0x13')][_0x21ed('0x15')]);return _0x1548b2(_0x3a1db0[_0x21ed('0x13')][_0x21ed('0x15')]);}else{logger[_0x21ed('0xe')](_0x21ed('0xf'),_0x4de958,'request\x20sent');_0x1548b2(_0x3a1db0[_0x21ed('0x16')][_0x21ed('0x15')]);}})[_0x21ed('0x17')](function(_0x44e351){logger[_0x21ed('0x13')]('MailTransferReport,\x20%s,\x20%s',_0x4de958,_0x44e351);_0x18b901(_0x44e351);});});} \ No newline at end of file +var _0x838b=['request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x838b,0x16d));var _0xb838=function(_0x4eedfc,_0x5af118){_0x4eedfc=_0x4eedfc-0x0;var _0x2290b8=_0x838b[_0x4eedfc];return _0x2290b8;};'use strict';var _=require(_0xb838('0x0'));var util=require(_0xb838('0x1'));var moment=require('moment');var BPromise=require(_0xb838('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb838('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb838('0x4'))(_0xb838('0x5'));var config=require(_0xb838('0x6'));var jayson=require(_0xb838('0x7'));var client=jayson['client'][_0xb838('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5600bb,_0x3ff8c8,_0x3bd148){return new BPromise(function(_0x1c80d1,_0x3182fe){return client[_0xb838('0x9')](_0x5600bb,_0x3bd148)[_0xb838('0xa')](function(_0x73f59c){logger[_0xb838('0xb')](_0xb838('0xc'),_0x3ff8c8,_0xb838('0xd'));logger[_0xb838('0xe')](_0xb838('0xf'),_0x3ff8c8,'request\x20sent',JSON[_0xb838('0x10')](_0x73f59c));if(_0x73f59c['error']){if(_0x73f59c[_0xb838('0x11')][_0xb838('0x12')]===0x1f4){logger['error'](_0xb838('0xc'),_0x3ff8c8,_0x73f59c['error']['message']);return _0x3182fe(_0x73f59c['error'][_0xb838('0x13')]);}logger[_0xb838('0x11')](_0xb838('0xc'),_0x3ff8c8,_0x73f59c[_0xb838('0x11')][_0xb838('0x13')]);return _0x1c80d1(_0x73f59c[_0xb838('0x11')][_0xb838('0x13')]);}else{logger[_0xb838('0xb')](_0xb838('0xc'),_0x3ff8c8,_0xb838('0xd'));_0x1c80d1(_0x73f59c[_0xb838('0x14')][_0xb838('0x13')]);}})[_0xb838('0x15')](function(_0x36055a){logger[_0xb838('0x11')](_0xb838('0xc'),_0x3ff8c8,_0x36055a);_0x3182fe(_0x36055a);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index d1dee36..e97f29f 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 _0x3c38=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','describe','/:id','show','create','delete','destroy','exports'];(function(_0x52f1e6,_0xf70489){var _0x21f104=function(_0xb89f9e){while(--_0xb89f9e){_0x52f1e6['push'](_0x52f1e6['shift']());}};_0x21f104(++_0xf70489);}(_0x3c38,0x1e0));var _0x83c3=function(_0x400a4f,_0x302b31){_0x400a4f=_0x400a4f-0x0;var _0x2d0335=_0x3c38[_0x400a4f];return _0x2d0335;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x83c3('0x0'));var express=require(_0x83c3('0x1'));var router=express[_0x83c3('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x83c3('0x3'));var config=require(_0x83c3('0x4'));var controller=require(_0x83c3('0x5'));router[_0x83c3('0x6')]('/',auth[_0x83c3('0x7')](),controller[_0x83c3('0x8')]);router[_0x83c3('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x83c3('0x9')]);router[_0x83c3('0x6')](_0x83c3('0xa'),auth[_0x83c3('0x7')](),controller[_0x83c3('0xb')]);router['post']('/',auth[_0x83c3('0x7')](),controller[_0x83c3('0xc')]);router['put'](_0x83c3('0xa'),auth[_0x83c3('0x7')](),controller['update']);router[_0x83c3('0xd')](_0x83c3('0xa'),auth['isAuthenticated'](),controller[_0x83c3('0xe')]);module[_0x83c3('0xf')]=router; \ No newline at end of file +var _0xf57c=['../../config/environment','get','isAuthenticated','index','describe','show','post','update','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x102654,_0x71d14){var _0xeb449=function(_0x3144da){while(--_0x3144da){_0x102654['push'](_0x102654['shift']());}};_0xeb449(++_0x71d14);}(_0xf57c,0xe7));var _0xcf57=function(_0x794785,_0x4fce91){_0x794785=_0x794785-0x0;var _0x7891a9=_0xf57c[_0x794785];return _0x7891a9;};'use strict';var multer=require('multer');var util=require(_0xcf57('0x0'));var path=require(_0xcf57('0x1'));var timeout=require(_0xcf57('0x2'));var express=require(_0xcf57('0x3'));var router=express[_0xcf57('0x4')]();var auth=require(_0xcf57('0x5'));var interaction=require(_0xcf57('0x6'));var config=require(_0xcf57('0x7'));var controller=require('./memberReport.controller');router[_0xcf57('0x8')]('/',auth[_0xcf57('0x9')](),controller[_0xcf57('0xa')]);router[_0xcf57('0x8')]('/describe',auth[_0xcf57('0x9')](),controller[_0xcf57('0xb')]);router[_0xcf57('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xcf57('0xc')]);router[_0xcf57('0xd')]('/',auth[_0xcf57('0x9')](),controller['create']);router['put']('/:id',auth[_0xcf57('0x9')](),controller[_0xcf57('0xe')]);router['delete']('/:id',auth[_0xcf57('0x9')](),controller[_0xcf57('0xf')]);module[_0xcf57('0x10')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index f0fb71b..338460e 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 _0xb692=['setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','diff','seconds'];(function(_0x211c75,_0x4f7259){var _0x53991e=function(_0x200d28){while(--_0x200d28){_0x211c75['push'](_0x211c75['shift']());}};_0x53991e(++_0x4f7259);}(_0xb692,0x77));var _0x2b69=function(_0x1ca9e9,_0x1c4391){_0x1ca9e9=_0x1ca9e9-0x0;var _0x309f3c=_0xb692[_0x1ca9e9];return _0x309f3c;};'use strict';var Sequelize=require(_0x2b69('0x0'));var moment=require('moment');module[_0x2b69('0x1')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x2b69('0x2')]},'interface':{'type':Sequelize[_0x2b69('0x2')]},'type':{'type':Sequelize[_0x2b69('0x2')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x2b69('0x3')},'duration':{'type':Sequelize[_0x2b69('0x4')]},'enterAt':{'type':Sequelize[_0x2b69('0x5')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x16ce65){var _0x180047=moment(_0x16ce65);var _0x3133fe=moment(this[_0x2b69('0x6')]('enterAt'));var _0x228f29=_0x180047[_0x2b69('0x7')](_0x3133fe,_0x2b69('0x8'));this[_0x2b69('0x9')]('exitAt',_0x16ce65);this[_0x2b69('0x9')](_0x2b69('0xa'),_0x228f29||null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x2b69('0xb')},'data2':{'type':Sequelize['STRING'],'comment':_0x2b69('0xc')},'data3':{'type':Sequelize['STRING'],'comment':_0x2b69('0xd')},'data4':{'type':Sequelize['STRING'],'comment':_0x2b69('0xe')},'data5':{'type':Sequelize[_0x2b69('0x2')],'comment':_0x2b69('0xf')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7970=['setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue','enterAt','seconds'];(function(_0xe96544,_0x2941e2){var _0x3c2a00=function(_0x1f04ce){while(--_0x1f04ce){_0xe96544['push'](_0xe96544['shift']());}};_0x3c2a00(++_0x2941e2);}(_0x7970,0x166));var _0x0797=function(_0x4b4adf,_0x577212){_0x4b4adf=_0x4b4adf-0x0;var _0x42d3e8=_0x7970[_0x4b4adf];return _0x42d3e8;};'use strict';var Sequelize=require(_0x0797('0x0'));var moment=require(_0x0797('0x1'));module[_0x0797('0x2')]={'channel':{'type':Sequelize[_0x0797('0x3')]},'membername':{'type':Sequelize[_0x0797('0x3')]},'interface':{'type':Sequelize[_0x0797('0x3')]},'type':{'type':Sequelize[_0x0797('0x3')],'defaultValue':_0x0797('0x4'),'comment':_0x0797('0x5')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x0797('0x6')],'set':function(_0x5133d0){var _0x5ee990=moment(_0x5133d0);var _0x10e0d6=moment(this[_0x0797('0x7')](_0x0797('0x8')));var _0x405786=_0x5ee990['diff'](_0x10e0d6,_0x0797('0x9'));this[_0x0797('0xa')](_0x0797('0xb'),_0x5133d0);this[_0x0797('0xa')](_0x0797('0xc'),_0x405786||null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x0797('0xd')},'data2':{'type':Sequelize[_0x0797('0x3')],'comment':_0x0797('0xe')},'data3':{'type':Sequelize[_0x0797('0x3')],'comment':_0x0797('0xf')},'data4':{'type':Sequelize[_0x0797('0x3')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x0797('0x3')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0x0797('0x3')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x0797('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 4acb599..5f0dab6 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 _0x7a2f=['filters','pick','filter','merge','type','key','field','includeAll','findAll','params','length','find','create','body','catch','destroy','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','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','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','offset','limit','apply','reject','update','then','sendStatus','error','name','index','MemberReport','rawAttributes','model','keys','query','attributes','intersection','fields','nolimit','order','sort','where'];(function(_0x263ba7,_0x8c5361){var _0x50028b=function(_0x5bd803){while(--_0x5bd803){_0x263ba7['push'](_0x263ba7['shift']());}};_0x50028b(++_0x8c5361);}(_0x7a2f,0x99));var _0xf7a2=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7a2f[_0xa464c9];return _0x3d73c4;};'use strict';var pdf=require(_0xf7a2('0x0'));var emlformat=require(_0xf7a2('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xf7a2('0x2'));var jsonpatch=require(_0xf7a2('0x3'));var rp=require(_0xf7a2('0x4'));var moment=require('moment');var BPromise=require(_0xf7a2('0x5'));var Mustache=require(_0xf7a2('0x6'));var util=require(_0xf7a2('0x7'));var path=require(_0xf7a2('0x8'));var sox=require(_0xf7a2('0x9'));var csv=require(_0xf7a2('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf7a2('0xb'));var squel=require(_0xf7a2('0xc'));var crypto=require(_0xf7a2('0xd'));var jsforce=require(_0xf7a2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf7a2('0xa'));var querystring=require(_0xf7a2('0xf'));var Papa=require(_0xf7a2('0x10'));var Redis=require(_0xf7a2('0x11'));var authService=require(_0xf7a2('0x12'));var qs=require(_0xf7a2('0x13'));var hardwareService=require(_0xf7a2('0x14'));var logger=require(_0xf7a2('0x15'))('api');var utils=require(_0xf7a2('0x16'));var config=require(_0xf7a2('0x17'));var db=require(_0xf7a2('0x18'))['db'];function respondWithStatusCode(_0x2effd6,_0x18c35c){_0x18c35c=_0x18c35c||0xcc;return function(_0x4f960f){if(_0x4f960f){return _0x2effd6['sendStatus'](_0x18c35c);}return _0x2effd6['status'](_0x18c35c)[_0xf7a2('0x19')]();};}function respondWithResult(_0x3e0923,_0x4227b1){_0x4227b1=_0x4227b1||0xc8;return function(_0x35a006){if(_0x35a006){return _0x3e0923[_0xf7a2('0x1a')](_0x4227b1)[_0xf7a2('0x1b')](_0x35a006);}};}function respondWithFilteredResult(_0x198b2b,_0x4e66ea){return function(_0x4eedb3){if(_0x4eedb3){var _0x53c32e=_0x4eedb3[_0xf7a2('0x1c')],_0x16b0dc=_0x4e66ea[_0xf7a2('0x1d')],_0x5ef0aa=_0x4e66ea[_0xf7a2('0x1d')]+_0x4e66ea[_0xf7a2('0x1e')],_0x51999f;if(_0x5ef0aa>=_0x53c32e){_0x5ef0aa=_0x53c32e;_0x51999f=0xc8;}else{_0x51999f=0xce;}_0x198b2b[_0xf7a2('0x1a')](_0x51999f);return _0x198b2b['set']('Content-Range',_0x16b0dc+'-'+_0x5ef0aa+'/'+_0x53c32e)['json'](_0x4eedb3);}return null;};}function patchUpdates(_0x1430f6){return function(_0xfbd717){try{jsonpatch[_0xf7a2('0x1f')](_0xfbd717,_0x1430f6,!![]);}catch(_0x2a3fef){return BPromise[_0xf7a2('0x20')](_0x2a3fef);}return _0xfbd717['save']();};}function saveUpdates(_0x458a24,_0x52a43e){return function(_0x1f2b26){if(_0x1f2b26){return _0x1f2b26[_0xf7a2('0x21')](_0x458a24)[_0xf7a2('0x22')](function(_0x1ade67){return _0x1ade67;});}return null;};}function removeEntity(_0x23fa4f,_0x163210){return function(_0x39c941){if(_0x39c941){return _0x39c941['destroy']()['then'](function(){_0x23fa4f[_0xf7a2('0x1a')](0xcc)[_0xf7a2('0x19')]();});}};}function handleEntityNotFound(_0x59217f,_0x31349c){return function(_0x2bbffd){if(!_0x2bbffd){_0x59217f[_0xf7a2('0x23')](0x194);}return _0x2bbffd;};}function handleError(_0x19d95e,_0x478111){_0x478111=_0x478111||0x1f4;return function(_0x510add){logger[_0xf7a2('0x24')](_0x510add['stack']);if(_0x510add[_0xf7a2('0x25')]){delete _0x510add[_0xf7a2('0x25')];}_0x19d95e[_0xf7a2('0x1a')](_0x478111)['send'](_0x510add);};}exports[_0xf7a2('0x26')]=function(_0x5c53fb,_0x8846a3){var _0x496f46={},_0x1f1a79={},_0x20b702={'count':0x0,'rows':[]};var _0x2a9c48=db[_0xf7a2('0x27')][_0xf7a2('0x28')];_0x1f1a79[_0xf7a2('0x29')]=_[_0xf7a2('0x2a')](_0x2a9c48);_0x1f1a79['query']=_[_0xf7a2('0x2a')](_0x5c53fb[_0xf7a2('0x2b')]);_0x1f1a79['filters']=_['intersection'](_0x1f1a79['model'],_0x1f1a79[_0xf7a2('0x2b')]);_0x496f46[_0xf7a2('0x2c')]=_[_0xf7a2('0x2d')](_0x1f1a79[_0xf7a2('0x29')],qs[_0xf7a2('0x2e')](_0x5c53fb['query'][_0xf7a2('0x2e')]));_0x496f46[_0xf7a2('0x2c')]=_0x496f46['attributes']['length']?_0x496f46[_0xf7a2('0x2c')]:_0x1f1a79[_0xf7a2('0x29')];if(!_0x5c53fb[_0xf7a2('0x2b')]['hasOwnProperty'](_0xf7a2('0x2f'))){_0x496f46[_0xf7a2('0x1e')]=qs[_0xf7a2('0x1e')](_0x5c53fb[_0xf7a2('0x2b')][_0xf7a2('0x1e')]);_0x496f46[_0xf7a2('0x1d')]=qs[_0xf7a2('0x1d')](_0x5c53fb[_0xf7a2('0x2b')][_0xf7a2('0x1d')]);}_0x496f46[_0xf7a2('0x30')]=qs[_0xf7a2('0x31')](_0x5c53fb[_0xf7a2('0x2b')][_0xf7a2('0x31')]);_0x496f46[_0xf7a2('0x32')]=qs[_0xf7a2('0x33')](_[_0xf7a2('0x34')](_0x5c53fb[_0xf7a2('0x2b')],_0x1f1a79['filters']));if(_0x5c53fb['query'][_0xf7a2('0x35')]){_0x496f46[_0xf7a2('0x32')]=_[_0xf7a2('0x36')](_0x496f46[_0xf7a2('0x32')],{'$or':_['map'](_0x2a9c48,function(_0xd9707c){if(_0xd9707c[_0xf7a2('0x37')][_0xf7a2('0x38')]!=='VIRTUAL'){var _0x168285={};_0x168285[_0xd9707c[_0xf7a2('0x39')]]={'$like':'%'+_0x5c53fb['query']['filter']+'%'};return _0x168285;}})});}_0x496f46=_[_0xf7a2('0x36')]({},_0x496f46,_0x5c53fb['options']);var _0x14013f={'where':_0x496f46[_0xf7a2('0x32')]};return db['MemberReport']['count'](_0x14013f)[_0xf7a2('0x22')](function(_0x582115){_0x20b702[_0xf7a2('0x1c')]=_0x582115;if(_0x5c53fb[_0xf7a2('0x2b')][_0xf7a2('0x3a')]){_0x496f46['include']=[{'all':!![]}];}return db['MemberReport'][_0xf7a2('0x3b')](_0x496f46);})[_0xf7a2('0x22')](function(_0x46b06c){_0x20b702['rows']=_0x46b06c;return _0x20b702;})[_0xf7a2('0x22')](respondWithFilteredResult(_0x8846a3,_0x496f46))['catch'](handleError(_0x8846a3,null));};exports['show']=function(_0x4a42d3,_0x2c86f8){var _0x5d4cb0={'raw':!![],'where':{'id':_0x4a42d3[_0xf7a2('0x3c')]['id']}},_0x2491e2={};_0x2491e2[_0xf7a2('0x29')]=_[_0xf7a2('0x2a')](db[_0xf7a2('0x27')][_0xf7a2('0x28')]);_0x2491e2[_0xf7a2('0x2b')]=_[_0xf7a2('0x2a')](_0x4a42d3[_0xf7a2('0x2b')]);_0x2491e2['filters']=_['intersection'](_0x2491e2[_0xf7a2('0x29')],_0x2491e2[_0xf7a2('0x2b')]);_0x5d4cb0[_0xf7a2('0x2c')]=_[_0xf7a2('0x2d')](_0x2491e2['model'],qs['fields'](_0x4a42d3['query']['fields']));_0x5d4cb0['attributes']=_0x5d4cb0['attributes'][_0xf7a2('0x3d')]?_0x5d4cb0[_0xf7a2('0x2c')]:_0x2491e2[_0xf7a2('0x29')];if(_0x4a42d3[_0xf7a2('0x2b')][_0xf7a2('0x3a')]){_0x5d4cb0['include']=[{'all':!![]}];}_0x5d4cb0=_[_0xf7a2('0x36')]({},_0x5d4cb0,_0x4a42d3['options']);return db[_0xf7a2('0x27')][_0xf7a2('0x3e')](_0x5d4cb0)[_0xf7a2('0x22')](handleEntityNotFound(_0x2c86f8,null))[_0xf7a2('0x22')](respondWithResult(_0x2c86f8,null))['catch'](handleError(_0x2c86f8,null));};exports[_0xf7a2('0x3f')]=function(_0xf9817,_0x443606){return db[_0xf7a2('0x27')][_0xf7a2('0x3f')](_0xf9817[_0xf7a2('0x40')],{})[_0xf7a2('0x22')](respondWithResult(_0x443606,0xc9))[_0xf7a2('0x41')](handleError(_0x443606,null));};exports[_0xf7a2('0x21')]=function(_0x505d27,_0x5c813f){if(_0x505d27['body']['id']){delete _0x505d27[_0xf7a2('0x40')]['id'];}return db[_0xf7a2('0x27')][_0xf7a2('0x3e')]({'where':{'id':_0x505d27[_0xf7a2('0x3c')]['id']}})[_0xf7a2('0x22')](handleEntityNotFound(_0x5c813f,null))['then'](saveUpdates(_0x505d27[_0xf7a2('0x40')],null))['then'](respondWithResult(_0x5c813f,null))[_0xf7a2('0x41')](handleError(_0x5c813f,null));};exports[_0xf7a2('0x42')]=function(_0x401948,_0x4d40ba){return db['MemberReport'][_0xf7a2('0x3e')]({'where':{'id':_0x401948[_0xf7a2('0x3c')]['id']}})[_0xf7a2('0x22')](handleEntityNotFound(_0x4d40ba,null))[_0xf7a2('0x22')](removeEntity(_0x4d40ba,null))[_0xf7a2('0x41')](handleError(_0x4d40ba,null));};exports[_0xf7a2('0x43')]=function(_0x2c30d6,_0x34cf74){return db[_0xf7a2('0x27')][_0xf7a2('0x43')]()['then'](respondWithResult(_0x34cf74,null))[_0xf7a2('0x41')](handleError(_0x34cf74,null));}; \ No newline at end of file +var _0x4e83=['../../components/auth/service','../../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','update','then','destroy','sendStatus','error','stack','name','send','MemberReport','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','includeAll','include','findAll','rows','catch','show','params','options','find','body','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','sox','to-csv','lodash','squel','crypto','desk.js','querystring','ioredis'];(function(_0x439ac5,_0x2f9dd1){var _0x5a71df=function(_0x393fd){while(--_0x393fd){_0x439ac5['push'](_0x439ac5['shift']());}};_0x5a71df(++_0x2f9dd1);}(_0x4e83,0x1ae));var _0x34e8=function(_0x134c9b,_0x2b4738){_0x134c9b=_0x134c9b-0x0;var _0x33f38e=_0x4e83[_0x134c9b];return _0x33f38e;};'use strict';var pdf=require(_0x34e8('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x34e8('0x1'));var zipdir=require(_0x34e8('0x2'));var jsonpatch=require(_0x34e8('0x3'));var rp=require(_0x34e8('0x4'));var moment=require(_0x34e8('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x34e8('0x6'));var csv=require(_0x34e8('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x34e8('0x8'));var squel=require(_0x34e8('0x9'));var crypto=require(_0x34e8('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x34e8('0xb'));var toCsv=require(_0x34e8('0x7'));var querystring=require(_0x34e8('0xc'));var Papa=require('papaparse');var Redis=require(_0x34e8('0xd'));var authService=require(_0x34e8('0xe'));var qs=require(_0x34e8('0xf'));var hardwareService=require(_0x34e8('0x10'));var logger=require(_0x34e8('0x11'))(_0x34e8('0x12'));var utils=require(_0x34e8('0x13'));var config=require(_0x34e8('0x14'));var db=require(_0x34e8('0x15'))['db'];function respondWithStatusCode(_0x57ea9e,_0xb37699){_0xb37699=_0xb37699||0xcc;return function(_0x60b6b6){if(_0x60b6b6){return _0x57ea9e['sendStatus'](_0xb37699);}return _0x57ea9e[_0x34e8('0x16')](_0xb37699)[_0x34e8('0x17')]();};}function respondWithResult(_0x368d5f,_0x26301a){_0x26301a=_0x26301a||0xc8;return function(_0xc4ac78){if(_0xc4ac78){return _0x368d5f[_0x34e8('0x16')](_0x26301a)[_0x34e8('0x18')](_0xc4ac78);}};}function respondWithFilteredResult(_0x621c31,_0x4498d0){return function(_0x4c516a){if(_0x4c516a){var _0xeb505=_0x4c516a[_0x34e8('0x19')],_0x4447d3=_0x4498d0['offset'],_0x36adfb=_0x4498d0[_0x34e8('0x1a')]+_0x4498d0[_0x34e8('0x1b')],_0x332735;if(_0x36adfb>=_0xeb505){_0x36adfb=_0xeb505;_0x332735=0xc8;}else{_0x332735=0xce;}_0x621c31[_0x34e8('0x16')](_0x332735);return _0x621c31[_0x34e8('0x1c')](_0x34e8('0x1d'),_0x4447d3+'-'+_0x36adfb+'/'+_0xeb505)[_0x34e8('0x18')](_0x4c516a);}return null;};}function patchUpdates(_0x1f3d4d){return function(_0x3eb461){try{jsonpatch[_0x34e8('0x1e')](_0x3eb461,_0x1f3d4d,!![]);}catch(_0x19b9a4){return BPromise[_0x34e8('0x1f')](_0x19b9a4);}return _0x3eb461['save']();};}function saveUpdates(_0x37fc9e,_0x368706){return function(_0xe42e15){if(_0xe42e15){return _0xe42e15[_0x34e8('0x20')](_0x37fc9e)[_0x34e8('0x21')](function(_0x188055){return _0x188055;});}return null;};}function removeEntity(_0x39a0e8,_0x24df2b){return function(_0x4967f4){if(_0x4967f4){return _0x4967f4[_0x34e8('0x22')]()[_0x34e8('0x21')](function(){_0x39a0e8['status'](0xcc)[_0x34e8('0x17')]();});}};}function handleEntityNotFound(_0x592c0e,_0x300b94){return function(_0x381d0e){if(!_0x381d0e){_0x592c0e[_0x34e8('0x23')](0x194);}return _0x381d0e;};}function handleError(_0x51f28e,_0x58cb2f){_0x58cb2f=_0x58cb2f||0x1f4;return function(_0x29a213){logger[_0x34e8('0x24')](_0x29a213[_0x34e8('0x25')]);if(_0x29a213[_0x34e8('0x26')]){delete _0x29a213[_0x34e8('0x26')];}_0x51f28e[_0x34e8('0x16')](_0x58cb2f)[_0x34e8('0x27')](_0x29a213);};}exports['index']=function(_0x29be75,_0x44ca6d){var _0x46c2a0={},_0x277457={},_0xe77c9e={'count':0x0,'rows':[]};var _0x23934c=db[_0x34e8('0x28')][_0x34e8('0x29')];_0x277457[_0x34e8('0x2a')]=_[_0x34e8('0x2b')](_0x23934c);_0x277457[_0x34e8('0x2c')]=_[_0x34e8('0x2b')](_0x29be75[_0x34e8('0x2c')]);_0x277457[_0x34e8('0x2d')]=_[_0x34e8('0x2e')](_0x277457[_0x34e8('0x2a')],_0x277457[_0x34e8('0x2c')]);_0x46c2a0['attributes']=_[_0x34e8('0x2e')](_0x277457[_0x34e8('0x2a')],qs['fields'](_0x29be75[_0x34e8('0x2c')][_0x34e8('0x2f')]));_0x46c2a0[_0x34e8('0x30')]=_0x46c2a0[_0x34e8('0x30')][_0x34e8('0x31')]?_0x46c2a0[_0x34e8('0x30')]:_0x277457[_0x34e8('0x2a')];if(!_0x29be75[_0x34e8('0x2c')][_0x34e8('0x32')](_0x34e8('0x33'))){_0x46c2a0[_0x34e8('0x1b')]=qs[_0x34e8('0x1b')](_0x29be75[_0x34e8('0x2c')][_0x34e8('0x1b')]);_0x46c2a0[_0x34e8('0x1a')]=qs[_0x34e8('0x1a')](_0x29be75[_0x34e8('0x2c')]['offset']);}_0x46c2a0[_0x34e8('0x34')]=qs[_0x34e8('0x35')](_0x29be75['query'][_0x34e8('0x35')]);_0x46c2a0[_0x34e8('0x36')]=qs[_0x34e8('0x2d')](_[_0x34e8('0x37')](_0x29be75[_0x34e8('0x2c')],_0x277457[_0x34e8('0x2d')]));if(_0x29be75[_0x34e8('0x2c')]['filter']){_0x46c2a0['where']=_[_0x34e8('0x38')](_0x46c2a0[_0x34e8('0x36')],{'$or':_[_0x34e8('0x39')](_0x23934c,function(_0x5988b4){if(_0x5988b4[_0x34e8('0x3a')][_0x34e8('0x3b')]!==_0x34e8('0x3c')){var _0x96742={};_0x96742[_0x5988b4[_0x34e8('0x3d')]]={'$like':'%'+_0x29be75[_0x34e8('0x2c')][_0x34e8('0x3e')]+'%'};return _0x96742;}})});}_0x46c2a0=_[_0x34e8('0x38')]({},_0x46c2a0,_0x29be75['options']);var _0x3994c0={'where':_0x46c2a0[_0x34e8('0x36')]};return db[_0x34e8('0x28')]['count'](_0x3994c0)[_0x34e8('0x21')](function(_0x233bf6){_0xe77c9e['count']=_0x233bf6;if(_0x29be75['query'][_0x34e8('0x3f')]){_0x46c2a0[_0x34e8('0x40')]=[{'all':!![]}];}return db['MemberReport'][_0x34e8('0x41')](_0x46c2a0);})[_0x34e8('0x21')](function(_0x29fb22){_0xe77c9e[_0x34e8('0x42')]=_0x29fb22;return _0xe77c9e;})[_0x34e8('0x21')](respondWithFilteredResult(_0x44ca6d,_0x46c2a0))[_0x34e8('0x43')](handleError(_0x44ca6d,null));};exports[_0x34e8('0x44')]=function(_0x1221e2,_0x330f9f){var _0x5b8011={'raw':!![],'where':{'id':_0x1221e2[_0x34e8('0x45')]['id']}},_0x56035b={};_0x56035b['model']=_[_0x34e8('0x2b')](db[_0x34e8('0x28')][_0x34e8('0x29')]);_0x56035b[_0x34e8('0x2c')]=_['keys'](_0x1221e2[_0x34e8('0x2c')]);_0x56035b[_0x34e8('0x2d')]=_[_0x34e8('0x2e')](_0x56035b[_0x34e8('0x2a')],_0x56035b[_0x34e8('0x2c')]);_0x5b8011['attributes']=_[_0x34e8('0x2e')](_0x56035b['model'],qs[_0x34e8('0x2f')](_0x1221e2[_0x34e8('0x2c')]['fields']));_0x5b8011[_0x34e8('0x30')]=_0x5b8011[_0x34e8('0x30')][_0x34e8('0x31')]?_0x5b8011[_0x34e8('0x30')]:_0x56035b['model'];if(_0x1221e2[_0x34e8('0x2c')][_0x34e8('0x3f')]){_0x5b8011['include']=[{'all':!![]}];}_0x5b8011=_['merge']({},_0x5b8011,_0x1221e2[_0x34e8('0x46')]);return db['MemberReport'][_0x34e8('0x47')](_0x5b8011)['then'](handleEntityNotFound(_0x330f9f,null))[_0x34e8('0x21')](respondWithResult(_0x330f9f,null))[_0x34e8('0x43')](handleError(_0x330f9f,null));};exports['create']=function(_0x2ec76e,_0x5bdad1){return db[_0x34e8('0x28')]['create'](_0x2ec76e[_0x34e8('0x48')],{})[_0x34e8('0x21')](respondWithResult(_0x5bdad1,0xc9))[_0x34e8('0x43')](handleError(_0x5bdad1,null));};exports[_0x34e8('0x20')]=function(_0x2c7ee7,_0x505e40){if(_0x2c7ee7['body']['id']){delete _0x2c7ee7[_0x34e8('0x48')]['id'];}return db[_0x34e8('0x28')]['find']({'where':{'id':_0x2c7ee7[_0x34e8('0x45')]['id']}})[_0x34e8('0x21')](handleEntityNotFound(_0x505e40,null))[_0x34e8('0x21')](saveUpdates(_0x2c7ee7['body'],null))[_0x34e8('0x21')](respondWithResult(_0x505e40,null))[_0x34e8('0x43')](handleError(_0x505e40,null));};exports['destroy']=function(_0x51a814,_0x2de2e9){return db['MemberReport'][_0x34e8('0x47')]({'where':{'id':_0x51a814[_0x34e8('0x45')]['id']}})[_0x34e8('0x21')](handleEntityNotFound(_0x2de2e9,null))[_0x34e8('0x21')](removeEntity(_0x2de2e9,null))[_0x34e8('0x43')](handleError(_0x2de2e9,null));};exports[_0x34e8('0x49')]=function(_0x3ad3a3,_0x373d7b){return db[_0x34e8('0x28')]['describe']()['then'](respondWithResult(_0x373d7b,null))[_0x34e8('0x43')](handleError(_0x373d7b,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 216b74b..4174f0e 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 _0x2a3b=['MemberReport','report_member','membername_interface','membername','interface','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x2a3b,0x73));var _0xb2a3=function(_0x69d04f,_0x35a841){_0x69d04f=_0x69d04f-0x0;var _0x4d90b1=_0x2a3b[_0x69d04f];return _0x4d90b1;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xb2a3('0x0'));var rp=require(_0xb2a3('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb2a3('0x2'));var config=require(_0xb2a3('0x3'));var attributes=require('./memberReport.attributes');module[_0xb2a3('0x4')]=function(_0xad6aeb,_0x215195){return _0xad6aeb[_0xb2a3('0x5')](_0xb2a3('0x6'),attributes,{'tableName':_0xb2a3('0x7'),'paranoid':![],'indexes':[{'name':_0xb2a3('0x8'),'fields':[_0xb2a3('0x9'),_0xb2a3('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc769=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MemberReport','report_member','membername_interface','lodash','util'];(function(_0x34145e,_0x689e31){var _0x27ed04=function(_0x297fc7){while(--_0x297fc7){_0x34145e['push'](_0x34145e['shift']());}};_0x27ed04(++_0x689e31);}(_0xc769,0x1b1));var _0x9c76=function(_0x7b193a,_0x16befc){_0x7b193a=_0x7b193a-0x0;var _0x9226a5=_0xc769[_0x7b193a];return _0x9226a5;};'use strict';var _=require(_0x9c76('0x0'));var util=require(_0x9c76('0x1'));var logger=require(_0x9c76('0x2'))(_0x9c76('0x3'));var moment=require(_0x9c76('0x4'));var BPromise=require(_0x9c76('0x5'));var rp=require(_0x9c76('0x6'));var fs=require('fs');var path=require(_0x9c76('0x7'));var rimraf=require(_0x9c76('0x8'));var config=require(_0x9c76('0x9'));var attributes=require('./memberReport.attributes');module[_0x9c76('0xa')]=function(_0x343bd6,_0x1363ae){return _0x343bd6[_0x9c76('0xb')](_0x9c76('0xc'),attributes,{'tableName':_0x9c76('0xd'),'paranoid':![],'indexes':[{'name':_0x9c76('0xe'),'fields':['membername','interface']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 5cf8df0..468ff52 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 _0x4eb5=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','GetMemberReport','raw','options','where','attributes','limit','include','model','stringify','catch','CreateMemberReport','create','body','update','moment'];(function(_0x53b55f,_0x7980d0){var _0x71d9fa=function(_0x1c30c2){while(--_0x1c30c2){_0x53b55f['push'](_0x53b55f['shift']());}};_0x71d9fa(++_0x7980d0);}(_0x4eb5,0xd7));var _0x54eb=function(_0x56d540,_0x249c33){_0x56d540=_0x56d540-0x0;var _0x31ff61=_0x4eb5[_0x56d540];return _0x31ff61;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x54eb('0x0'));var BPromise=require(_0x54eb('0x1'));var rs=require(_0x54eb('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x54eb('0x3'))['db'];var utils=require(_0x54eb('0x4'));var logger=require(_0x54eb('0x5'))(_0x54eb('0x6'));var config=require(_0x54eb('0x7'));var jayson=require(_0x54eb('0x8'));var client=jayson[_0x54eb('0x9')][_0x54eb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50872f,_0x4e6c85,_0x1020e9){return new BPromise(function(_0x2de543,_0xbf68c){return client[_0x54eb('0xb')](_0x50872f,_0x1020e9)[_0x54eb('0xc')](function(_0x3c70b7){logger['info'](_0x54eb('0xd'),_0x4e6c85,_0x54eb('0xe'));logger[_0x54eb('0xf')](_0x54eb('0x10'),_0x4e6c85,_0x54eb('0xe'),JSON['stringify'](_0x3c70b7));if(_0x3c70b7[_0x54eb('0x11')]){if(_0x3c70b7[_0x54eb('0x11')][_0x54eb('0x12')]===0x1f4){logger['error'](_0x54eb('0xd'),_0x4e6c85,_0x3c70b7['error'][_0x54eb('0x13')]);return _0xbf68c(_0x3c70b7[_0x54eb('0x11')][_0x54eb('0x13')]);}logger['error'](_0x54eb('0xd'),_0x4e6c85,_0x3c70b7[_0x54eb('0x11')]['message']);return _0x2de543(_0x3c70b7[_0x54eb('0x11')][_0x54eb('0x13')]);}else{logger[_0x54eb('0x14')](_0x54eb('0xd'),_0x4e6c85,_0x54eb('0xe'));_0x2de543(_0x3c70b7[_0x54eb('0x15')][_0x54eb('0x13')]);}})['catch'](function(_0x2c36a6){logger[_0x54eb('0x11')](_0x54eb('0xd'),_0x4e6c85,_0x2c36a6);_0xbf68c(_0x2c36a6);});});}exports[_0x54eb('0x16')]=function(_0x9aa08f){var _0x162695=this;return new Promise(function(_0x3a86a4,_0x128a4b){return db['MemberReport']['findAll']({'raw':_0x9aa08f['options']?_0x9aa08f['options'][_0x54eb('0x17')]===undefined?!![]:![]:!![],'where':_0x9aa08f[_0x54eb('0x18')]?_0x9aa08f[_0x54eb('0x18')][_0x54eb('0x19')]||null:null,'attributes':_0x9aa08f['options']?_0x9aa08f['options'][_0x54eb('0x1a')]||null:null,'limit':_0x9aa08f['options']?_0x9aa08f[_0x54eb('0x18')][_0x54eb('0x1b')]||null:null,'include':_0x9aa08f[_0x54eb('0x18')]?_0x9aa08f[_0x54eb('0x18')][_0x54eb('0x1c')]?_['map'](_0x9aa08f[_0x54eb('0x18')]['include'],function(_0x5d4959){return{'model':db[_0x5d4959[_0x54eb('0x1d')]],'as':_0x5d4959['as'],'attributes':_0x5d4959[_0x54eb('0x1a')],'include':_0x5d4959[_0x54eb('0x1c')]?_['map'](_0x5d4959[_0x54eb('0x1c')],function(_0x1b4768){return{'model':db[_0x1b4768['model']],'as':_0x1b4768['as'],'attributes':_0x1b4768['attributes'],'include':_0x1b4768['include']?_['map'](_0x1b4768[_0x54eb('0x1c')],function(_0x35d01d){return{'model':db[_0x35d01d[_0x54eb('0x1d')]],'as':_0x35d01d['as'],'attributes':_0x35d01d[_0x54eb('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3972da){logger[_0x54eb('0x14')](_0x54eb('0x16'),_0x9aa08f);logger[_0x54eb('0xf')]('GetMemberReport',_0x9aa08f,JSON[_0x54eb('0x1e')](_0x3972da));_0x3a86a4(_0x3972da);})[_0x54eb('0x1f')](function(_0x37b800){logger[_0x54eb('0x11')](_0x54eb('0x16'),_0x37b800['message'],_0x9aa08f);_0x128a4b(_0x162695[_0x54eb('0x11')](0x1f4,_0x37b800[_0x54eb('0x13')]));});});};exports[_0x54eb('0x20')]=function(_0x5d2c0d){var _0x517cb6=this;return new Promise(function(_0x4409c0,_0x163e58){return db['MemberReport'][_0x54eb('0x21')](_0x5d2c0d[_0x54eb('0x22')],{'raw':_0x5d2c0d[_0x54eb('0x18')]?_0x5d2c0d['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2306e9){logger[_0x54eb('0x14')](_0x54eb('0x20'),_0x5d2c0d);logger[_0x54eb('0xf')](_0x54eb('0x20'),_0x5d2c0d,JSON[_0x54eb('0x1e')](_0x2306e9));_0x4409c0(_0x2306e9);})[_0x54eb('0x1f')](function(_0x3b3733){logger['error'](_0x54eb('0x20'),_0x3b3733[_0x54eb('0x13')],_0x5d2c0d);_0x163e58(_0x517cb6['error'](0x1f4,_0x3b3733[_0x54eb('0x13')]));});});};exports['UpdateMemberReport']=function(_0x37775c){var _0x16fa8a=this;return new Promise(function(_0x2b75db,_0x4bbc44){return db['MemberReport'][_0x54eb('0x23')](_0x37775c[_0x54eb('0x22')],{'raw':_0x37775c[_0x54eb('0x18')]?_0x37775c[_0x54eb('0x18')][_0x54eb('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37775c[_0x54eb('0x18')]?_0x37775c['options']['where']||null:null,'attributes':_0x37775c['options']?_0x37775c['options'][_0x54eb('0x1a')]||null:null,'limit':_0x37775c[_0x54eb('0x18')]?_0x37775c[_0x54eb('0x18')][_0x54eb('0x1b')]||null:null})[_0x54eb('0xc')](function(_0x3753d4){logger[_0x54eb('0x14')]('UpdateMemberReport',_0x37775c);logger[_0x54eb('0xf')]('UpdateMemberReport',_0x37775c,JSON[_0x54eb('0x1e')](_0x3753d4));_0x2b75db(_0x3753d4);})[_0x54eb('0x1f')](function(_0x2468ba){logger[_0x54eb('0x11')]('UpdateMemberReport',_0x2468ba[_0x54eb('0x13')],_0x37775c);_0x4bbc44(_0x16fa8a[_0x54eb('0x11')](0x1f4,_0x2468ba[_0x54eb('0x13')]));});});}; \ No newline at end of file +var _0x3250=['MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','include','map','model','debug','CreateMemberReport','create','body','UpdateMemberReport','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent'];(function(_0x4a67e1,_0x528dd9){var _0x2f6902=function(_0x3634b2){while(--_0x3634b2){_0x4a67e1['push'](_0x4a67e1['shift']());}};_0x2f6902(++_0x528dd9);}(_0x3250,0x128));var _0x0325=function(_0x14a552,_0x20d7a6){_0x14a552=_0x14a552-0x0;var _0x5da87d=_0x3250[_0x14a552];return _0x5da87d;};'use strict';var _=require(_0x0325('0x0'));var util=require(_0x0325('0x1'));var moment=require('moment');var BPromise=require(_0x0325('0x2'));var rs=require(_0x0325('0x3'));var fs=require('fs');var Redis=require(_0x0325('0x4'));var db=require(_0x0325('0x5'))['db'];var utils=require(_0x0325('0x6'));var logger=require(_0x0325('0x7'))(_0x0325('0x8'));var config=require('../../config/environment');var jayson=require(_0x0325('0x9'));var client=jayson[_0x0325('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x497a49,_0x260856,_0x2c1ea8){return new BPromise(function(_0x51b38a,_0x5f0634){return client[_0x0325('0xb')](_0x497a49,_0x2c1ea8)[_0x0325('0xc')](function(_0x375297){logger[_0x0325('0xd')](_0x0325('0xe'),_0x260856,_0x0325('0xf'));logger['debug'](_0x0325('0x10'),_0x260856,_0x0325('0xf'),JSON[_0x0325('0x11')](_0x375297));if(_0x375297[_0x0325('0x12')]){if(_0x375297[_0x0325('0x12')][_0x0325('0x13')]===0x1f4){logger[_0x0325('0x12')]('MemberReport,\x20%s,\x20%s',_0x260856,_0x375297['error'][_0x0325('0x14')]);return _0x5f0634(_0x375297[_0x0325('0x12')][_0x0325('0x14')]);}logger[_0x0325('0x12')](_0x0325('0xe'),_0x260856,_0x375297[_0x0325('0x12')][_0x0325('0x14')]);return _0x51b38a(_0x375297[_0x0325('0x12')][_0x0325('0x14')]);}else{logger[_0x0325('0xd')](_0x0325('0xe'),_0x260856,_0x0325('0xf'));_0x51b38a(_0x375297[_0x0325('0x15')]['message']);}})[_0x0325('0x16')](function(_0x2ad413){logger['error'](_0x0325('0xe'),_0x260856,_0x2ad413);_0x5f0634(_0x2ad413);});});}exports[_0x0325('0x17')]=function(_0x2a2ec7){var _0x3455ec=this;return new Promise(function(_0x3ee896,_0x46687b){return db[_0x0325('0x18')][_0x0325('0x19')]({'raw':_0x2a2ec7[_0x0325('0x1a')]?_0x2a2ec7['options'][_0x0325('0x1b')]===undefined?!![]:![]:!![],'where':_0x2a2ec7[_0x0325('0x1a')]?_0x2a2ec7[_0x0325('0x1a')][_0x0325('0x1c')]||null:null,'attributes':_0x2a2ec7[_0x0325('0x1a')]?_0x2a2ec7[_0x0325('0x1a')][_0x0325('0x1d')]||null:null,'limit':_0x2a2ec7[_0x0325('0x1a')]?_0x2a2ec7[_0x0325('0x1a')]['limit']||null:null,'include':_0x2a2ec7[_0x0325('0x1a')]?_0x2a2ec7['options'][_0x0325('0x1e')]?_[_0x0325('0x1f')](_0x2a2ec7['options'][_0x0325('0x1e')],function(_0x44ef80){return{'model':db[_0x44ef80[_0x0325('0x20')]],'as':_0x44ef80['as'],'attributes':_0x44ef80['attributes'],'include':_0x44ef80[_0x0325('0x1e')]?_['map'](_0x44ef80[_0x0325('0x1e')],function(_0x153d1a){return{'model':db[_0x153d1a[_0x0325('0x20')]],'as':_0x153d1a['as'],'attributes':_0x153d1a[_0x0325('0x1d')],'include':_0x153d1a[_0x0325('0x1e')]?_[_0x0325('0x1f')](_0x153d1a[_0x0325('0x1e')],function(_0x83b1b7){return{'model':db[_0x83b1b7['model']],'as':_0x83b1b7['as'],'attributes':_0x83b1b7[_0x0325('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0325('0xc')](function(_0xfd11bb){logger[_0x0325('0xd')]('GetMemberReport',_0x2a2ec7);logger[_0x0325('0x21')](_0x0325('0x17'),_0x2a2ec7,JSON[_0x0325('0x11')](_0xfd11bb));_0x3ee896(_0xfd11bb);})[_0x0325('0x16')](function(_0x169215){logger[_0x0325('0x12')](_0x0325('0x17'),_0x169215[_0x0325('0x14')],_0x2a2ec7);_0x46687b(_0x3455ec[_0x0325('0x12')](0x1f4,_0x169215[_0x0325('0x14')]));});});};exports[_0x0325('0x22')]=function(_0x5f14a7){var _0x1fa7f2=this;return new Promise(function(_0x327014,_0x1188ca){return db[_0x0325('0x18')][_0x0325('0x23')](_0x5f14a7[_0x0325('0x24')],{'raw':_0x5f14a7[_0x0325('0x1a')]?_0x5f14a7[_0x0325('0x1a')][_0x0325('0x1b')]===undefined?!![]:![]:!![]})[_0x0325('0xc')](function(_0x2cf962){logger['info'](_0x0325('0x22'),_0x5f14a7);logger[_0x0325('0x21')](_0x0325('0x22'),_0x5f14a7,JSON[_0x0325('0x11')](_0x2cf962));_0x327014(_0x2cf962);})[_0x0325('0x16')](function(_0x157493){logger['error'](_0x0325('0x22'),_0x157493[_0x0325('0x14')],_0x5f14a7);_0x1188ca(_0x1fa7f2[_0x0325('0x12')](0x1f4,_0x157493[_0x0325('0x14')]));});});};exports[_0x0325('0x25')]=function(_0x25056b){var _0x5b5e47=this;return new Promise(function(_0x262bb6,_0x3572b8){return db[_0x0325('0x18')]['update'](_0x25056b[_0x0325('0x24')],{'raw':_0x25056b[_0x0325('0x1a')]?_0x25056b[_0x0325('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25056b[_0x0325('0x1a')]?_0x25056b['options']['where']||null:null,'attributes':_0x25056b[_0x0325('0x1a')]?_0x25056b[_0x0325('0x1a')][_0x0325('0x1d')]||null:null,'limit':_0x25056b['options']?_0x25056b[_0x0325('0x1a')][_0x0325('0x26')]||null:null})[_0x0325('0xc')](function(_0x486f4){logger[_0x0325('0xd')](_0x0325('0x25'),_0x25056b);logger[_0x0325('0x21')]('UpdateMemberReport',_0x25056b,JSON['stringify'](_0x486f4));_0x262bb6(_0x486f4);})[_0x0325('0x16')](function(_0x2ac0e7){logger[_0x0325('0x12')](_0x0325('0x25'),_0x2ac0e7[_0x0325('0x14')],_0x25056b);_0x3572b8(_0x5b5e47[_0x0325('0x12')](0x1f4,_0x2ac0e7[_0x0325('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 63385d7..8899e23 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 _0x05a4=['./migration.controller','get','index','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x27bf2d,_0x2a89be){var _0x11e0f3=function(_0x41f7d0){while(--_0x41f7d0){_0x27bf2d['push'](_0x27bf2d['shift']());}};_0x11e0f3(++_0x2a89be);}(_0x05a4,0xad));var _0x405a=function(_0x3b7c4d,_0x510d87){_0x3b7c4d=_0x3b7c4d-0x0;var _0x38f566=_0x05a4[_0x3b7c4d];return _0x38f566;};'use strict';var multer=require(_0x405a('0x0'));var util=require(_0x405a('0x1'));var path=require(_0x405a('0x2'));var timeout=require(_0x405a('0x3'));var express=require('express');var router=express[_0x405a('0x4')]();var auth=require(_0x405a('0x5'));var interaction=require(_0x405a('0x6'));var config=require('../../config/environment');var controller=require(_0x405a('0x7'));router[_0x405a('0x8')]('/',controller[_0x405a('0x9')]);module['exports']=router; \ No newline at end of file +var _0xf89f=['index','exports','multer','path','express','../../components/interaction/service','../../config/environment','./migration.controller','get'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf89f,0x122));var _0xff89=function(_0x14d001,_0x2159ab){_0x14d001=_0x14d001-0x0;var _0x5b6d06=_0xf89f[_0x14d001];return _0x5b6d06;};'use strict';var multer=require(_0xff89('0x0'));var util=require('util');var path=require(_0xff89('0x1'));var timeout=require('connect-timeout');var express=require(_0xff89('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xff89('0x3'));var config=require(_0xff89('0x4'));var controller=require(_0xff89('0x5'));router[_0xff89('0x6')]('/',controller[_0xff89('0x7')]);module[_0xff89('0x8')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 4d45d69..413a6ce 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 _0x8d77=['STRING','version','sequelize','exports'];(function(_0x106c25,_0x59913a){var _0x404d78=function(_0x2bd295){while(--_0x2bd295){_0x106c25['push'](_0x106c25['shift']());}};_0x404d78(++_0x59913a);}(_0x8d77,0x14a));var _0x78d7=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x8d77[_0xa1e3e3];return _0xc980e9;};'use strict';var Sequelize=require(_0x78d7('0x0'));module[_0x78d7('0x1')]={'version':{'type':Sequelize[_0x78d7('0x2')],'unique':_0x78d7('0x3')}}; \ No newline at end of file +var _0x2fe2=['exports','STRING','sequelize'];(function(_0x3ad047,_0x879307){var _0x4f06ba=function(_0x5318a2){while(--_0x5318a2){_0x3ad047['push'](_0x3ad047['shift']());}};_0x4f06ba(++_0x879307);}(_0x2fe2,0xef));var _0x22fe=function(_0x31bd6e,_0x3ffcd4){_0x31bd6e=_0x31bd6e-0x0;var _0x26eecb=_0x2fe2[_0x31bd6e];return _0x26eecb;};'use strict';var Sequelize=require(_0x22fe('0x0'));module[_0x22fe('0x1')]={'version':{'type':Sequelize[_0x22fe('0x2')],'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 61d9077..83a72db 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 _0xccb1=['save','then','destroy','end','stack','name','send','index','Migration','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','merge','map','type','key','field','count','include','findAll','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject'];(function(_0x562cff,_0x4c6d19){var _0x576af8=function(_0x4a3ecf){while(--_0x4a3ecf){_0x562cff['push'](_0x562cff['shift']());}};_0x576af8(++_0x4c6d19);}(_0xccb1,0x18b));var _0x1ccb=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xccb1[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x1ccb('0x0'));var emlformat=require(_0x1ccb('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1ccb('0x2'));var rp=require(_0x1ccb('0x3'));var moment=require(_0x1ccb('0x4'));var BPromise=require(_0x1ccb('0x5'));var Mustache=require(_0x1ccb('0x6'));var util=require(_0x1ccb('0x7'));var path=require(_0x1ccb('0x8'));var sox=require(_0x1ccb('0x9'));var csv=require(_0x1ccb('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1ccb('0xb'));var squel=require(_0x1ccb('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1ccb('0xd'));var toCsv=require(_0x1ccb('0xa'));var querystring=require(_0x1ccb('0xe'));var Papa=require('papaparse');var Redis=require(_0x1ccb('0xf'));var authService=require(_0x1ccb('0x10'));var qs=require(_0x1ccb('0x11'));var hardwareService=require(_0x1ccb('0x12'));var logger=require(_0x1ccb('0x13'))(_0x1ccb('0x14'));var utils=require('../../config/utils');var config=require(_0x1ccb('0x15'));var db=require(_0x1ccb('0x16'))['db'];function respondWithStatusCode(_0x1e4353,_0x133fb3){_0x133fb3=_0x133fb3||0xcc;return function(_0x866f23){if(_0x866f23){return _0x1e4353[_0x1ccb('0x17')](_0x133fb3);}return _0x1e4353[_0x1ccb('0x18')](_0x133fb3)['end']();};}function respondWithResult(_0xf433ec,_0x44af10){_0x44af10=_0x44af10||0xc8;return function(_0x2cb7b6){if(_0x2cb7b6){return _0xf433ec[_0x1ccb('0x18')](_0x44af10)[_0x1ccb('0x19')](_0x2cb7b6);}};}function respondWithFilteredResult(_0x2bd2e1,_0x54b61a){return function(_0x178982){if(_0x178982){var _0x12a08b=_0x178982['count'],_0x2ffbee=_0x54b61a[_0x1ccb('0x1a')],_0x5a15b9=_0x54b61a['offset']+_0x54b61a[_0x1ccb('0x1b')],_0x224261;if(_0x5a15b9>=_0x12a08b){_0x5a15b9=_0x12a08b;_0x224261=0xc8;}else{_0x224261=0xce;}_0x2bd2e1[_0x1ccb('0x18')](_0x224261);return _0x2bd2e1[_0x1ccb('0x1c')](_0x1ccb('0x1d'),_0x2ffbee+'-'+_0x5a15b9+'/'+_0x12a08b)['json'](_0x178982);}return null;};}function patchUpdates(_0x4bb9c2){return function(_0x573ba5){try{jsonpatch[_0x1ccb('0x1e')](_0x573ba5,_0x4bb9c2,!![]);}catch(_0xf2b7c0){return BPromise[_0x1ccb('0x1f')](_0xf2b7c0);}return _0x573ba5[_0x1ccb('0x20')]();};}function saveUpdates(_0x5e6437,_0x117976){return function(_0x1ca9e9){if(_0x1ca9e9){return _0x1ca9e9['update'](_0x5e6437)[_0x1ccb('0x21')](function(_0x5337ed){return _0x5337ed;});}return null;};}function removeEntity(_0x480080,_0x2de117){return function(_0x1d3761){if(_0x1d3761){return _0x1d3761[_0x1ccb('0x22')]()[_0x1ccb('0x21')](function(){_0x480080[_0x1ccb('0x18')](0xcc)[_0x1ccb('0x23')]();});}};}function handleEntityNotFound(_0x3876b7,_0x3741bd){return function(_0x5e6282){if(!_0x5e6282){_0x3876b7[_0x1ccb('0x17')](0x194);}return _0x5e6282;};}function handleError(_0x5f34b9,_0x4be1b3){_0x4be1b3=_0x4be1b3||0x1f4;return function(_0x179965){logger['error'](_0x179965[_0x1ccb('0x24')]);if(_0x179965[_0x1ccb('0x25')]){delete _0x179965[_0x1ccb('0x25')];}_0x5f34b9[_0x1ccb('0x18')](_0x4be1b3)[_0x1ccb('0x26')](_0x179965);};}exports[_0x1ccb('0x27')]=function(_0x1b234b,_0x298619){var _0x27dfed={},_0x242db8={},_0x35838d={'count':0x0,'rows':[]};var _0x5ed6d0=db[_0x1ccb('0x28')][_0x1ccb('0x29')];_0x242db8[_0x1ccb('0x2a')]=_[_0x1ccb('0x2b')](_0x5ed6d0);_0x242db8[_0x1ccb('0x2c')]=_[_0x1ccb('0x2b')](_0x1b234b[_0x1ccb('0x2c')]);_0x242db8[_0x1ccb('0x2d')]=_[_0x1ccb('0x2e')](_0x242db8['model'],_0x242db8[_0x1ccb('0x2c')]);_0x27dfed[_0x1ccb('0x2f')]=_[_0x1ccb('0x2e')](_0x242db8[_0x1ccb('0x2a')],qs[_0x1ccb('0x30')](_0x1b234b[_0x1ccb('0x2c')][_0x1ccb('0x30')]));_0x27dfed['attributes']=_0x27dfed[_0x1ccb('0x2f')][_0x1ccb('0x31')]?_0x27dfed['attributes']:_0x242db8[_0x1ccb('0x2a')];if(!_0x1b234b[_0x1ccb('0x2c')]['hasOwnProperty']('nolimit')){_0x27dfed[_0x1ccb('0x1b')]=qs['limit'](_0x1b234b[_0x1ccb('0x2c')][_0x1ccb('0x1b')]);_0x27dfed[_0x1ccb('0x1a')]=qs['offset'](_0x1b234b[_0x1ccb('0x2c')][_0x1ccb('0x1a')]);}_0x27dfed[_0x1ccb('0x32')]=qs[_0x1ccb('0x33')](_0x1b234b[_0x1ccb('0x2c')]['sort']);_0x27dfed['where']=qs[_0x1ccb('0x2d')](_['pick'](_0x1b234b[_0x1ccb('0x2c')],_0x242db8[_0x1ccb('0x2d')]));if(_0x1b234b['query']['filter']){_0x27dfed[_0x1ccb('0x34')]=_[_0x1ccb('0x35')](_0x27dfed[_0x1ccb('0x34')],{'$or':_[_0x1ccb('0x36')](_0x5ed6d0,function(_0x3afdca){if(_0x3afdca[_0x1ccb('0x37')][_0x1ccb('0x38')]!=='VIRTUAL'){var _0x12551c={};_0x12551c[_0x3afdca[_0x1ccb('0x39')]]={'$like':'%'+_0x1b234b[_0x1ccb('0x2c')]['filter']+'%'};return _0x12551c;}})});}_0x27dfed=_[_0x1ccb('0x35')]({},_0x27dfed,_0x1b234b['options']);var _0x4edd06={'where':_0x27dfed[_0x1ccb('0x34')]};return db[_0x1ccb('0x28')]['count'](_0x4edd06)['then'](function(_0x518134){_0x35838d[_0x1ccb('0x3a')]=_0x518134;if(_0x1b234b['query']['includeAll']){_0x27dfed[_0x1ccb('0x3b')]=[{'all':!![]}];}return db[_0x1ccb('0x28')][_0x1ccb('0x3c')](_0x27dfed);})['then'](function(_0x3b3e31){_0x35838d['rows']=_0x3b3e31;return _0x35838d;})[_0x1ccb('0x21')](respondWithFilteredResult(_0x298619,_0x27dfed))['catch'](handleError(_0x298619,null));}; \ No newline at end of file +var _0x55e5=['papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','limit','set','Content-Range','apply','save','update','then','destroy','end','error','name','index','Migration','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','offset','order','sort','where','pick','merge','map','type','key','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','catch','html-pdf','eml-format','zip-dir','request-promise','bluebird','util','path','sox','to-csv','lodash','squel','jsforce','desk.js'];(function(_0x7a3247,_0x15cb12){var _0x1bfde5=function(_0x62bbef){while(--_0x62bbef){_0x7a3247['push'](_0x7a3247['shift']());}};_0x1bfde5(++_0x15cb12);}(_0x55e5,0x1b3));var _0x555e=function(_0x346a2f,_0x5b7c6d){_0x346a2f=_0x346a2f-0x0;var _0x46ed5f=_0x55e5[_0x346a2f];return _0x46ed5f;};'use strict';var pdf=require(_0x555e('0x0'));var emlformat=require(_0x555e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x555e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x555e('0x3'));var moment=require('moment');var BPromise=require(_0x555e('0x4'));var Mustache=require('mustache');var util=require(_0x555e('0x5'));var path=require(_0x555e('0x6'));var sox=require(_0x555e('0x7'));var csv=require(_0x555e('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x555e('0x9'));var squel=require(_0x555e('0xa'));var crypto=require('crypto');var jsforce=require(_0x555e('0xb'));var deskjs=require(_0x555e('0xc'));var toCsv=require(_0x555e('0x8'));var querystring=require('querystring');var Papa=require(_0x555e('0xd'));var Redis=require('ioredis');var authService=require(_0x555e('0xe'));var qs=require(_0x555e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x555e('0x10'))(_0x555e('0x11'));var utils=require(_0x555e('0x12'));var config=require(_0x555e('0x13'));var db=require(_0x555e('0x14'))['db'];function respondWithStatusCode(_0x6690cc,_0x22f24e){_0x22f24e=_0x22f24e||0xcc;return function(_0x41024e){if(_0x41024e){return _0x6690cc[_0x555e('0x15')](_0x22f24e);}return _0x6690cc[_0x555e('0x16')](_0x22f24e)['end']();};}function respondWithResult(_0x1d5cf2,_0x4de3ef){_0x4de3ef=_0x4de3ef||0xc8;return function(_0x316f56){if(_0x316f56){return _0x1d5cf2['status'](_0x4de3ef)[_0x555e('0x17')](_0x316f56);}};}function respondWithFilteredResult(_0x8aa0c2,_0xe5bbe1){return function(_0x5031d2){if(_0x5031d2){var _0x1e1ad6=_0x5031d2['count'],_0x905717=_0xe5bbe1['offset'],_0x341a61=_0xe5bbe1['offset']+_0xe5bbe1[_0x555e('0x18')],_0x262d5a;if(_0x341a61>=_0x1e1ad6){_0x341a61=_0x1e1ad6;_0x262d5a=0xc8;}else{_0x262d5a=0xce;}_0x8aa0c2[_0x555e('0x16')](_0x262d5a);return _0x8aa0c2[_0x555e('0x19')](_0x555e('0x1a'),_0x905717+'-'+_0x341a61+'/'+_0x1e1ad6)[_0x555e('0x17')](_0x5031d2);}return null;};}function patchUpdates(_0x24b6b0){return function(_0x179b70){try{jsonpatch[_0x555e('0x1b')](_0x179b70,_0x24b6b0,!![]);}catch(_0x297c88){return BPromise['reject'](_0x297c88);}return _0x179b70[_0x555e('0x1c')]();};}function saveUpdates(_0x537429,_0x8d0e0d){return function(_0x507bb5){if(_0x507bb5){return _0x507bb5[_0x555e('0x1d')](_0x537429)[_0x555e('0x1e')](function(_0x54495c){return _0x54495c;});}return null;};}function removeEntity(_0x7abb0f,_0x44a70c){return function(_0x444d92){if(_0x444d92){return _0x444d92[_0x555e('0x1f')]()['then'](function(){_0x7abb0f[_0x555e('0x16')](0xcc)[_0x555e('0x20')]();});}};}function handleEntityNotFound(_0x112982,_0x5c8bd4){return function(_0x15cee4){if(!_0x15cee4){_0x112982[_0x555e('0x15')](0x194);}return _0x15cee4;};}function handleError(_0x59bc47,_0x158677){_0x158677=_0x158677||0x1f4;return function(_0x2e7f34){logger[_0x555e('0x21')](_0x2e7f34['stack']);if(_0x2e7f34['name']){delete _0x2e7f34[_0x555e('0x22')];}_0x59bc47['status'](_0x158677)['send'](_0x2e7f34);};}exports[_0x555e('0x23')]=function(_0x335097,_0x5b451b){var _0x144faf={},_0x5228ea={},_0x460083={'count':0x0,'rows':[]};var _0x5b1c1b=db[_0x555e('0x24')]['rawAttributes'];_0x5228ea[_0x555e('0x25')]=_[_0x555e('0x26')](_0x5b1c1b);_0x5228ea[_0x555e('0x27')]=_[_0x555e('0x26')](_0x335097[_0x555e('0x27')]);_0x5228ea[_0x555e('0x28')]=_[_0x555e('0x29')](_0x5228ea[_0x555e('0x25')],_0x5228ea[_0x555e('0x27')]);_0x144faf['attributes']=_[_0x555e('0x29')](_0x5228ea[_0x555e('0x25')],qs[_0x555e('0x2a')](_0x335097[_0x555e('0x27')][_0x555e('0x2a')]));_0x144faf[_0x555e('0x2b')]=_0x144faf['attributes']['length']?_0x144faf[_0x555e('0x2b')]:_0x5228ea['model'];if(!_0x335097[_0x555e('0x27')][_0x555e('0x2c')](_0x555e('0x2d'))){_0x144faf[_0x555e('0x18')]=qs[_0x555e('0x18')](_0x335097[_0x555e('0x27')]['limit']);_0x144faf[_0x555e('0x2e')]=qs[_0x555e('0x2e')](_0x335097[_0x555e('0x27')]['offset']);}_0x144faf[_0x555e('0x2f')]=qs[_0x555e('0x30')](_0x335097[_0x555e('0x27')]['sort']);_0x144faf[_0x555e('0x31')]=qs[_0x555e('0x28')](_[_0x555e('0x32')](_0x335097['query'],_0x5228ea[_0x555e('0x28')]));if(_0x335097[_0x555e('0x27')]['filter']){_0x144faf[_0x555e('0x31')]=_[_0x555e('0x33')](_0x144faf[_0x555e('0x31')],{'$or':_[_0x555e('0x34')](_0x5b1c1b,function(_0x36f57a){if(_0x36f57a[_0x555e('0x35')][_0x555e('0x36')]!==_0x555e('0x37')){var _0x354d5e={};_0x354d5e[_0x36f57a['field']]={'$like':'%'+_0x335097[_0x555e('0x27')][_0x555e('0x38')]+'%'};return _0x354d5e;}})});}_0x144faf=_[_0x555e('0x33')]({},_0x144faf,_0x335097[_0x555e('0x39')]);var _0x48f0f2={'where':_0x144faf[_0x555e('0x31')]};return db[_0x555e('0x24')][_0x555e('0x3a')](_0x48f0f2)[_0x555e('0x1e')](function(_0xcfc6c){_0x460083['count']=_0xcfc6c;if(_0x335097[_0x555e('0x27')][_0x555e('0x3b')]){_0x144faf[_0x555e('0x3c')]=[{'all':!![]}];}return db[_0x555e('0x24')][_0x555e('0x3d')](_0x144faf);})['then'](function(_0x332861){_0x460083[_0x555e('0x3e')]=_0x332861;return _0x460083;})['then'](respondWithFilteredResult(_0x5b451b,_0x144faf))[_0x555e('0x3f')](handleError(_0x5b451b,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index ff5765b..a2e9cff 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 _0x1a0d=['./migration.attributes','exports','define','Migration','migrations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x220cf6,_0x25b2be){var _0xbc473f=function(_0x1f6253){while(--_0x1f6253){_0x220cf6['push'](_0x220cf6['shift']());}};_0xbc473f(++_0x25b2be);}(_0x1a0d,0x171));var _0xd1a0=function(_0x685edf,_0x38a8de){_0x685edf=_0x685edf-0x0;var _0x4fc69f=_0x1a0d[_0x685edf];return _0x4fc69f;};'use strict';var _=require(_0xd1a0('0x0'));var util=require(_0xd1a0('0x1'));var logger=require(_0xd1a0('0x2'))(_0xd1a0('0x3'));var moment=require(_0xd1a0('0x4'));var BPromise=require(_0xd1a0('0x5'));var rp=require(_0xd1a0('0x6'));var fs=require('fs');var path=require(_0xd1a0('0x7'));var rimraf=require(_0xd1a0('0x8'));var config=require('../../config/environment');var attributes=require(_0xd1a0('0x9'));module[_0xd1a0('0xa')]=function(_0xd49896,_0x5d775e){return _0xd49896[_0xd1a0('0xb')](_0xd1a0('0xc'),attributes,{'tableName':_0xd1a0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x54b5=['util','../../config/logger','moment','path','rimraf','../../config/environment','exports','define','Migration','migrations','lodash'];(function(_0x8c41db,_0x409c16){var _0x1459c2=function(_0x21a74d){while(--_0x21a74d){_0x8c41db['push'](_0x8c41db['shift']());}};_0x1459c2(++_0x409c16);}(_0x54b5,0x1cd));var _0x554b=function(_0x105256,_0x4fa318){_0x105256=_0x105256-0x0;var _0x4b5a91=_0x54b5[_0x105256];return _0x4b5a91;};'use strict';var _=require(_0x554b('0x0'));var util=require(_0x554b('0x1'));var logger=require(_0x554b('0x2'))('api');var moment=require(_0x554b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x554b('0x4'));var rimraf=require(_0x554b('0x5'));var config=require(_0x554b('0x6'));var attributes=require('./migration.attributes');module[_0x554b('0x7')]=function(_0x59ed5a,_0x44c702){return _0x59ed5a[_0x554b('0x8')](_0x554b('0x9'),attributes,{'tableName':_0x554b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 1c02ebf..5f0b915 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 _0x2123=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Migration,\x20%s,\x20%s','message','catch'];(function(_0x65c0bb,_0x82e7b8){var _0x320bd5=function(_0x6e1675){while(--_0x6e1675){_0x65c0bb['push'](_0x65c0bb['shift']());}};_0x320bd5(++_0x82e7b8);}(_0x2123,0x190));var _0x3212=function(_0x131540,_0xcb334a){_0x131540=_0x131540-0x0;var _0x27eb89=_0x2123[_0x131540];return _0x27eb89;};'use strict';var _=require(_0x3212('0x0'));var util=require(_0x3212('0x1'));var moment=require(_0x3212('0x2'));var BPromise=require(_0x3212('0x3'));var rs=require(_0x3212('0x4'));var fs=require('fs');var Redis=require(_0x3212('0x5'));var db=require(_0x3212('0x6'))['db'];var utils=require(_0x3212('0x7'));var logger=require(_0x3212('0x8'))(_0x3212('0x9'));var config=require(_0x3212('0xa'));var jayson=require(_0x3212('0xb'));var client=jayson['client'][_0x3212('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2b1302,_0x1fec5d,_0x4b35e9){return new BPromise(function(_0x3e17a3,_0x56c38f){return client[_0x3212('0xd')](_0x2b1302,_0x4b35e9)[_0x3212('0xe')](function(_0x8ca483){logger[_0x3212('0xf')]('Migration,\x20%s,\x20%s',_0x1fec5d,'request\x20sent');logger[_0x3212('0x10')](_0x3212('0x11'),_0x1fec5d,_0x3212('0x12'),JSON[_0x3212('0x13')](_0x8ca483));if(_0x8ca483[_0x3212('0x14')]){if(_0x8ca483[_0x3212('0x14')][_0x3212('0x15')]===0x1f4){logger[_0x3212('0x14')](_0x3212('0x16'),_0x1fec5d,_0x8ca483[_0x3212('0x14')][_0x3212('0x17')]);return _0x56c38f(_0x8ca483[_0x3212('0x14')][_0x3212('0x17')]);}logger[_0x3212('0x14')](_0x3212('0x16'),_0x1fec5d,_0x8ca483[_0x3212('0x14')][_0x3212('0x17')]);return _0x3e17a3(_0x8ca483[_0x3212('0x14')][_0x3212('0x17')]);}else{logger[_0x3212('0xf')](_0x3212('0x16'),_0x1fec5d,_0x3212('0x12'));_0x3e17a3(_0x8ca483['result'][_0x3212('0x17')]);}})[_0x3212('0x18')](function(_0x2720c6){logger[_0x3212('0x14')](_0x3212('0x16'),_0x1fec5d,_0x2720c6);_0x56c38f(_0x2720c6);});});} \ No newline at end of file +var _0x72b1=['stringify','error','Migration,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s'];(function(_0x589793,_0x3d9012){var _0x14db27=function(_0x490937){while(--_0x490937){_0x589793['push'](_0x589793['shift']());}};_0x14db27(++_0x3d9012);}(_0x72b1,0x16e));var _0x172b=function(_0x45f8e4,_0x756a7e){_0x45f8e4=_0x45f8e4-0x0;var _0x1de603=_0x72b1[_0x45f8e4];return _0x1de603;};'use strict';var _=require(_0x172b('0x0'));var util=require('util');var moment=require(_0x172b('0x1'));var BPromise=require(_0x172b('0x2'));var rs=require(_0x172b('0x3'));var fs=require('fs');var Redis=require(_0x172b('0x4'));var db=require(_0x172b('0x5'))['db'];var utils=require(_0x172b('0x6'));var logger=require(_0x172b('0x7'))('rpc');var config=require(_0x172b('0x8'));var jayson=require(_0x172b('0x9'));var client=jayson[_0x172b('0xa')][_0x172b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x571994,_0x345e5e,_0x517363){return new BPromise(function(_0x1f98e9,_0x531b10){return client[_0x172b('0xc')](_0x571994,_0x517363)[_0x172b('0xd')](function(_0x977f18){logger[_0x172b('0xe')]('Migration,\x20%s,\x20%s',_0x345e5e,_0x172b('0xf'));logger[_0x172b('0x10')](_0x172b('0x11'),_0x345e5e,_0x172b('0xf'),JSON[_0x172b('0x12')](_0x977f18));if(_0x977f18[_0x172b('0x13')]){if(_0x977f18[_0x172b('0x13')]['code']===0x1f4){logger[_0x172b('0x13')](_0x172b('0x14'),_0x345e5e,_0x977f18[_0x172b('0x13')]['message']);return _0x531b10(_0x977f18[_0x172b('0x13')]['message']);}logger[_0x172b('0x13')](_0x172b('0x14'),_0x345e5e,_0x977f18['error'][_0x172b('0x15')]);return _0x1f98e9(_0x977f18[_0x172b('0x13')][_0x172b('0x15')]);}else{logger[_0x172b('0xe')]('Migration,\x20%s,\x20%s',_0x345e5e,'request\x20sent');_0x1f98e9(_0x977f18[_0x172b('0x16')][_0x172b('0x15')]);}})[_0x172b('0x17')](function(_0x3c7fff){logger['error']('Migration,\x20%s,\x20%s',_0x345e5e,_0x3c7fff);_0x531b10(_0x3c7fff);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index bfbfa15..6c52153 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 _0x251b=['isAuthenticated','show','post','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get'];(function(_0x4b1fb4,_0x36f2e0){var _0x1617cc=function(_0x49a5ad){while(--_0x49a5ad){_0x4b1fb4['push'](_0x4b1fb4['shift']());}};_0x1617cc(++_0x36f2e0);}(_0x251b,0x185));var _0xb251=function(_0x6f1a87,_0x5d5bcf){_0x6f1a87=_0x6f1a87-0x0;var _0x2495c7=_0x251b[_0x6f1a87];return _0x2495c7;};'use strict';var multer=require(_0xb251('0x0'));var util=require(_0xb251('0x1'));var path=require(_0xb251('0x2'));var timeout=require(_0xb251('0x3'));var express=require(_0xb251('0x4'));var router=express[_0xb251('0x5')]();var auth=require(_0xb251('0x6'));var interaction=require(_0xb251('0x7'));var config=require(_0xb251('0x8'));var controller=require(_0xb251('0x9'));router[_0xb251('0xa')]('/',auth[_0xb251('0xb')](),controller['index']);router[_0xb251('0xa')]('/:id',auth[_0xb251('0xb')](),controller[_0xb251('0xc')]);router[_0xb251('0xd')]('/',auth['isAuthenticated'](),controller[_0xb251('0xe')]);router[_0xb251('0xf')](_0xb251('0x10'),auth['isAuthenticated'](),controller[_0xb251('0x11')]);router[_0xb251('0x12')](_0xb251('0x10'),auth[_0xb251('0xb')](),controller['destroy']);module[_0xb251('0x13')]=router; \ No newline at end of file +var _0x27c9=['update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x5e761b,_0x355e38){var _0x98502c=function(_0x4e52d5){while(--_0x4e52d5){_0x5e761b['push'](_0x5e761b['shift']());}};_0x98502c(++_0x355e38);}(_0x27c9,0x1e7));var _0x927c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x27c9[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x927c('0x0'));var util=require(_0x927c('0x1'));var path=require(_0x927c('0x2'));var timeout=require('connect-timeout');var express=require(_0x927c('0x3'));var router=express[_0x927c('0x4')]();var auth=require(_0x927c('0x5'));var interaction=require(_0x927c('0x6'));var config=require(_0x927c('0x7'));var controller=require(_0x927c('0x8'));router[_0x927c('0x9')]('/',auth[_0x927c('0xa')](),controller[_0x927c('0xb')]);router['get'](_0x927c('0xc'),auth[_0x927c('0xa')](),controller[_0x927c('0xd')]);router[_0x927c('0xe')]('/',auth[_0x927c('0xa')](),controller[_0x927c('0xf')]);router[_0x927c('0x10')]('/:id',auth[_0x927c('0xa')](),controller[_0x927c('0x11')]);router[_0x927c('0x12')](_0x927c('0xc'),auth[_0x927c('0xa')](),controller[_0x927c('0x13')]);module[_0x927c('0x14')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 8d29949..a1434a5 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 _0xbd41=['sequelize','exports','ENUM','localnet','externip','STRING'];(function(_0x25ae6e,_0x135d45){var _0x4fd286=function(_0x2cf526){while(--_0x2cf526){_0x25ae6e['push'](_0x25ae6e['shift']());}};_0x4fd286(++_0x135d45);}(_0xbd41,0x14a));var _0x1bd4=function(_0x17045c,_0x470ebe){_0x17045c=_0x17045c-0x0;var _0x844ac5=_0xbd41[_0x17045c];return _0x844ac5;};'use strict';var Sequelize=require(_0x1bd4('0x0'));module[_0x1bd4('0x1')]={'type':{'type':Sequelize[_0x1bd4('0x2')](_0x1bd4('0x3'),_0x1bd4('0x4'))},'value':{'type':Sequelize[_0x1bd4('0x5')]}}; \ No newline at end of file +var _0x0192=['exports','localnet','externip','sequelize'];(function(_0x4b69c0,_0x1e9050){var _0xd9f4d9=function(_0x57e346){while(--_0x57e346){_0x4b69c0['push'](_0x4b69c0['shift']());}};_0xd9f4d9(++_0x1e9050);}(_0x0192,0x137));var _0x2019=function(_0x57c79f,_0x2cc90c){_0x57c79f=_0x57c79f-0x0;var _0x5dc380=_0x0192[_0x57c79f];return _0x5dc380;};'use strict';var Sequelize=require(_0x2019('0x0'));module[_0x2019('0x1')]={'type':{'type':Sequelize['ENUM'](_0x2019('0x2'),_0x2019('0x3'))},'value':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 16303bc..bd86456 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 _0xcc43=['name','send','keys','filters','intersection','model','query','attributes','fields','hasOwnProperty','limit','sort','where','pick','filter','merge','map','type','key','field','options','Network','count','includeAll','show','params','rawAttributes','length','include','create','transaction','body','readFileSync','join','root','server/files/templates/network.ejs','utf8','render','writeFileSync','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','chan_sip.so','update','find','findAll','eml-format','rimraf','zip-dir','mustache','util','sox','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','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','Network,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','sendStatus','status','end','json','offset','set','Content-Range','reject','save','destroy','stack'];(function(_0x48aedd,_0x385688){var _0x2cd400=function(_0x39d868){while(--_0x39d868){_0x48aedd['push'](_0x48aedd['shift']());}};_0x2cd400(++_0x385688);}(_0xcc43,0x8f));var _0x3cc4=function(_0x43a8e6,_0x1fd76b){_0x43a8e6=_0x43a8e6-0x0;var _0x41efdf=_0xcc43[_0x43a8e6];return _0x41efdf;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3cc4('0x0'));var rimraf=require(_0x3cc4('0x1'));var zipdir=require(_0x3cc4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3cc4('0x3'));var util=require(_0x3cc4('0x4'));var path=require('path');var sox=require(_0x3cc4('0x5'));var csv=require('to-csv');var ejs=require(_0x3cc4('0x6'));var fs=require('fs');var _=require(_0x3cc4('0x7'));var squel=require(_0x3cc4('0x8'));var crypto=require(_0x3cc4('0x9'));var jsforce=require(_0x3cc4('0xa'));var deskjs=require(_0x3cc4('0xb'));var toCsv=require('to-csv');var querystring=require(_0x3cc4('0xc'));var Papa=require(_0x3cc4('0xd'));var Redis=require(_0x3cc4('0xe'));var authService=require(_0x3cc4('0xf'));var qs=require(_0x3cc4('0x10'));var hardwareService=require(_0x3cc4('0x11'));var logger=require(_0x3cc4('0x12'))('api');var utils=require(_0x3cc4('0x13'));var config=require(_0x3cc4('0x14'));var db=require(_0x3cc4('0x15'))['db'];var jayson=require(_0x3cc4('0x16'));var client=jayson[_0x3cc4('0x17')][_0x3cc4('0x18')]({'port':0x232a});function checkPasswordPattern(_0x49f1b1,_0x25ae61,_0x4f0dd2){if(_0x4f0dd2){var _0x159f93=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x159f93['test'](_0x25ae61)){return _0x49f1b1;}else{throw new Error(_0x3cc4('0x19'));}}else{return _0x49f1b1;}}function respondWithRpcPromise(_0x32eb75,_0x1b0051,_0x2292e2,_0x28e231){return new BPromise(function(_0x5f3b4b,_0x19ca24){var _0x463921=_0x28e231||client;return _0x463921[_0x3cc4('0x1a')](_0x32eb75,_0x2292e2)[_0x3cc4('0x1b')](function(_0x5223fc){logger[_0x3cc4('0x1c')](_0x3cc4('0x1d'),_0x1b0051,'request\x20sent');logger[_0x3cc4('0x1e')]('Network,\x20%s,\x20%s,\x20%s',_0x1b0051,_0x3cc4('0x1f'),JSON[_0x3cc4('0x20')](_0x5223fc));if(_0x5223fc['error']){if(_0x5223fc['error'][_0x3cc4('0x21')]===0x1f4){logger[_0x3cc4('0x22')]('Network,\x20%s,\x20%s',_0x1b0051,_0x5223fc[_0x3cc4('0x22')][_0x3cc4('0x23')]);return _0x19ca24(_0x5223fc[_0x3cc4('0x22')]['message']);}logger[_0x3cc4('0x22')]('Network,\x20%s,\x20%s',_0x1b0051,_0x5223fc[_0x3cc4('0x22')][_0x3cc4('0x23')]);return _0x5f3b4b(_0x5223fc['error']['message']);}else{logger[_0x3cc4('0x1c')](_0x3cc4('0x1d'),_0x1b0051,_0x3cc4('0x1f'));_0x5f3b4b(_0x5223fc[_0x3cc4('0x24')][_0x3cc4('0x23')]);}})[_0x3cc4('0x25')](function(_0x554e6d){logger['error']('Network,\x20%s,\x20%s',_0x1b0051,_0x554e6d);_0x19ca24(_0x554e6d);});});}function respondWithStatusCode(_0x5db2d7,_0x10023a){_0x10023a=_0x10023a||0xcc;return function(_0x3f243d){if(_0x3f243d){return _0x5db2d7[_0x3cc4('0x26')](_0x10023a);}return _0x5db2d7[_0x3cc4('0x27')](_0x10023a)[_0x3cc4('0x28')]();};}function respondWithResult(_0x508416,_0x498380){_0x498380=_0x498380||0xc8;return function(_0x2af993){if(_0x2af993){return _0x508416[_0x3cc4('0x27')](_0x498380)[_0x3cc4('0x29')](_0x2af993);}};}function respondWithFilteredResult(_0x254bda,_0x155726){return function(_0x2c5d8d){if(_0x2c5d8d){var _0x595ff3=_0x2c5d8d['count'],_0x4318ad=_0x155726[_0x3cc4('0x2a')],_0x1c24a8=_0x155726[_0x3cc4('0x2a')]+_0x155726['limit'],_0x4d4729;if(_0x1c24a8>=_0x595ff3){_0x1c24a8=_0x595ff3;_0x4d4729=0xc8;}else{_0x4d4729=0xce;}_0x254bda[_0x3cc4('0x27')](_0x4d4729);return _0x254bda[_0x3cc4('0x2b')](_0x3cc4('0x2c'),_0x4318ad+'-'+_0x1c24a8+'/'+_0x595ff3)[_0x3cc4('0x29')](_0x2c5d8d);}return null;};}function patchUpdates(_0x549d1d){return function(_0x4f77c8){try{jsonpatch['apply'](_0x4f77c8,_0x549d1d,!![]);}catch(_0x213c7c){return BPromise[_0x3cc4('0x2d')](_0x213c7c);}return _0x4f77c8[_0x3cc4('0x2e')]();};}function saveUpdates(_0x6a558c,_0x1ce88c){return function(_0x5f1214){if(_0x5f1214){return _0x5f1214['update'](_0x6a558c)['then'](function(_0x694d21){return _0x694d21;});}return null;};}function removeEntity(_0x473fdc,_0xc1c276){return function(_0x5809c6){if(_0x5809c6){return _0x5809c6[_0x3cc4('0x2f')]()['then'](function(){_0x473fdc[_0x3cc4('0x27')](0xcc)[_0x3cc4('0x28')]();});}};}function handleEntityNotFound(_0x3dd523,_0x3520a7){return function(_0x49632c){if(!_0x49632c){_0x3dd523[_0x3cc4('0x26')](0x194);}return _0x49632c;};}function handleError(_0x223186,_0x4f282e){_0x4f282e=_0x4f282e||0x1f4;return function(_0x1ba624){logger[_0x3cc4('0x22')](_0x1ba624[_0x3cc4('0x30')]);if(_0x1ba624[_0x3cc4('0x31')]){delete _0x1ba624[_0x3cc4('0x31')];}_0x223186[_0x3cc4('0x27')](_0x4f282e)[_0x3cc4('0x32')](_0x1ba624);};}exports['index']=function(_0x15f4f3,_0x3df8ac){var _0x4c8b0a={},_0x5f18a4={},_0x1bdd96={'count':0x0,'rows':[]};var _0x438a22=db['Network']['rawAttributes'];_0x5f18a4['model']=_['keys'](_0x438a22);_0x5f18a4['query']=_[_0x3cc4('0x33')](_0x15f4f3['query']);_0x5f18a4[_0x3cc4('0x34')]=_[_0x3cc4('0x35')](_0x5f18a4[_0x3cc4('0x36')],_0x5f18a4[_0x3cc4('0x37')]);_0x4c8b0a[_0x3cc4('0x38')]=_[_0x3cc4('0x35')](_0x5f18a4[_0x3cc4('0x36')],qs[_0x3cc4('0x39')](_0x15f4f3['query'][_0x3cc4('0x39')]));_0x4c8b0a[_0x3cc4('0x38')]=_0x4c8b0a[_0x3cc4('0x38')]['length']?_0x4c8b0a[_0x3cc4('0x38')]:_0x5f18a4['model'];if(!_0x15f4f3[_0x3cc4('0x37')][_0x3cc4('0x3a')]('nolimit')){_0x4c8b0a['limit']=qs[_0x3cc4('0x3b')](_0x15f4f3['query']['limit']);_0x4c8b0a[_0x3cc4('0x2a')]=qs['offset'](_0x15f4f3[_0x3cc4('0x37')][_0x3cc4('0x2a')]);}_0x4c8b0a['order']=qs[_0x3cc4('0x3c')](_0x15f4f3[_0x3cc4('0x37')][_0x3cc4('0x3c')]);_0x4c8b0a[_0x3cc4('0x3d')]=qs[_0x3cc4('0x34')](_[_0x3cc4('0x3e')](_0x15f4f3[_0x3cc4('0x37')],_0x5f18a4['filters']));if(_0x15f4f3[_0x3cc4('0x37')][_0x3cc4('0x3f')]){_0x4c8b0a['where']=_[_0x3cc4('0x40')](_0x4c8b0a[_0x3cc4('0x3d')],{'$or':_[_0x3cc4('0x41')](_0x438a22,function(_0x11addb){if(_0x11addb[_0x3cc4('0x42')][_0x3cc4('0x43')]!=='VIRTUAL'){var _0x100dfd={};_0x100dfd[_0x11addb[_0x3cc4('0x44')]]={'$like':'%'+_0x15f4f3['query']['filter']+'%'};return _0x100dfd;}})});}_0x4c8b0a=_['merge']({},_0x4c8b0a,_0x15f4f3[_0x3cc4('0x45')]);var _0x1c1af9={'where':_0x4c8b0a[_0x3cc4('0x3d')]};return db[_0x3cc4('0x46')][_0x3cc4('0x47')](_0x1c1af9)[_0x3cc4('0x1b')](function(_0xb8b3e7){_0x1bdd96['count']=_0xb8b3e7;if(_0x15f4f3[_0x3cc4('0x37')][_0x3cc4('0x48')]){_0x4c8b0a['include']=[{'all':!![]}];}return db[_0x3cc4('0x46')]['findAll'](_0x4c8b0a);})['then'](function(_0x8317f7){_0x1bdd96['rows']=_0x8317f7;return _0x1bdd96;})[_0x3cc4('0x1b')](respondWithFilteredResult(_0x3df8ac,_0x4c8b0a))[_0x3cc4('0x25')](handleError(_0x3df8ac,null));};exports[_0x3cc4('0x49')]=function(_0x503ac4,_0x2641d5){var _0x20ebe5={'raw':!![],'where':{'id':_0x503ac4[_0x3cc4('0x4a')]['id']}},_0x1dccbc={};_0x1dccbc[_0x3cc4('0x36')]=_[_0x3cc4('0x33')](db['Network'][_0x3cc4('0x4b')]);_0x1dccbc[_0x3cc4('0x37')]=_[_0x3cc4('0x33')](_0x503ac4[_0x3cc4('0x37')]);_0x1dccbc[_0x3cc4('0x34')]=_[_0x3cc4('0x35')](_0x1dccbc['model'],_0x1dccbc[_0x3cc4('0x37')]);_0x20ebe5[_0x3cc4('0x38')]=_['intersection'](_0x1dccbc[_0x3cc4('0x36')],qs[_0x3cc4('0x39')](_0x503ac4[_0x3cc4('0x37')][_0x3cc4('0x39')]));_0x20ebe5[_0x3cc4('0x38')]=_0x20ebe5[_0x3cc4('0x38')][_0x3cc4('0x4c')]?_0x20ebe5['attributes']:_0x1dccbc[_0x3cc4('0x36')];if(_0x503ac4[_0x3cc4('0x37')][_0x3cc4('0x48')]){_0x20ebe5[_0x3cc4('0x4d')]=[{'all':!![]}];}_0x20ebe5=_[_0x3cc4('0x40')]({},_0x20ebe5,_0x503ac4[_0x3cc4('0x45')]);return db[_0x3cc4('0x46')]['find'](_0x20ebe5)['then'](handleEntityNotFound(_0x2641d5,null))[_0x3cc4('0x1b')](respondWithResult(_0x2641d5,null))[_0x3cc4('0x25')](handleError(_0x2641d5,null));};exports[_0x3cc4('0x4e')]=function(_0x34bcc4,_0xf5861e,_0x2515c5){var _0x44ceae;return db['sequelize'][_0x3cc4('0x4f')](function(_0x4400e1){return db[_0x3cc4('0x46')][_0x3cc4('0x4e')](_0x34bcc4[_0x3cc4('0x50')],{'raw':!![]})[_0x3cc4('0x1b')](function(_0x3cc1e2){_0x44ceae=_0x3cc1e2;return db['Network']['findAll']({'where':{'type':_0x34bcc4['body'][_0x3cc4('0x42')]},'raw':!![]});})[_0x3cc4('0x1b')](function(_0x58bbd3){var _0xd9806e=fs[_0x3cc4('0x51')](path[_0x3cc4('0x52')](config[_0x3cc4('0x53')],_0x3cc4('0x54')),_0x3cc4('0x55'));var _0x5427c2=ejs[_0x3cc4('0x56')](_0xd9806e,{'networks':_0x58bbd3||[]});fs[_0x3cc4('0x57')](util[_0x3cc4('0x58')](_0x3cc4('0x59'),_0x34bcc4[_0x3cc4('0x50')][_0x3cc4('0x42')][_0x3cc4('0x5a')]()),_0x5427c2);})[_0x3cc4('0x1b')](function(){return respondWithRpcPromise(_0x3cc4('0x5b'),_0x3cc4('0x4e'),{'module':_0x3cc4('0x5c')});})[_0x3cc4('0x1b')](function(){return _0x44ceae;});})[_0x3cc4('0x1b')](respondWithResult(_0xf5861e,0xc9))[_0x3cc4('0x25')](handleError(_0xf5861e,null));};exports[_0x3cc4('0x5d')]=function(_0x78a3e6,_0x22726a,_0x4be04f){var _0x35e691;return db['sequelize'][_0x3cc4('0x4f')](function(_0x4849d7){return db[_0x3cc4('0x46')][_0x3cc4('0x5e')]({'where':{'id':_0x78a3e6[_0x3cc4('0x4a')]['id']}})[_0x3cc4('0x1b')](handleEntityNotFound(_0x22726a,null))[_0x3cc4('0x1b')](saveUpdates(_0x78a3e6['body'],null))[_0x3cc4('0x1b')](function(_0x21eea6){if(_0x21eea6){_0x35e691=_0x21eea6;return db['Network'][_0x3cc4('0x5f')]({'where':{'type':_0x35e691[_0x3cc4('0x42')]},'raw':!![]});}return null;})['then'](function(_0x5b0e5c){if(_0x5b0e5c){var _0x13d032=fs[_0x3cc4('0x51')](path[_0x3cc4('0x52')](config['root'],_0x3cc4('0x54')),_0x3cc4('0x55'));var _0x13c78d=ejs[_0x3cc4('0x56')](_0x13d032,{'networks':_0x5b0e5c||[]});fs['writeFileSync'](util[_0x3cc4('0x58')]('/etc/asterisk/sip_xcally_%s.conf',_0x35e691[_0x3cc4('0x42')][_0x3cc4('0x5a')]()),_0x13c78d);return respondWithRpcPromise('Reload','update',{'module':'chan_sip.so'});}return null;})[_0x3cc4('0x1b')](function(_0x3daa82){if(_0x3daa82){return _0x35e691;}return null;});})[_0x3cc4('0x1b')](respondWithResult(_0x22726a,null))[_0x3cc4('0x25')](handleError(_0x22726a,null));};exports[_0x3cc4('0x2f')]=function(_0x5752ca,_0x4024a9,_0x8438d7){var _0x3ebe3b;return db[_0x3cc4('0x46')][_0x3cc4('0x5e')]({'where':{'id':_0x5752ca[_0x3cc4('0x4a')]['id']}})['then'](function(_0x435317){_0x3ebe3b=_0x435317;return _0x435317;})['then'](handleEntityNotFound(_0x4024a9,null))[_0x3cc4('0x1b')](removeEntity(_0x4024a9,null))[_0x3cc4('0x1b')](function(){if(_0x3ebe3b){return db['Network'][_0x3cc4('0x5f')]({'where':{'type':_0x3ebe3b['type']},'raw':!![]});}})[_0x3cc4('0x1b')](function(_0x5e55b8){if(_0x5e55b8){var _0x1669cc=fs[_0x3cc4('0x51')](path['join'](config[_0x3cc4('0x53')],_0x3cc4('0x54')),_0x3cc4('0x55'));var _0x595418=ejs['render'](_0x1669cc,{'networks':_0x5e55b8||[]});fs[_0x3cc4('0x57')](util[_0x3cc4('0x58')](_0x3cc4('0x59'),_0x3ebe3b[_0x3cc4('0x42')][_0x3cc4('0x5a')]()),_0x595418);return respondWithRpcPromise(_0x3cc4('0x5b'),_0x3cc4('0x2f'),{'module':_0x3cc4('0x5c')});}})[_0x3cc4('0x25')](handleError(_0x4024a9,null));}; \ No newline at end of file +var _0x1731=['../../config/logger','api','../../config/environment','../../mysqldb','http','request','then','info','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','error','code','message','Network,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','Network','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','map','key','field','options','includeAll','include','findAll','rows','show','find','create','sequelize','transaction','body','readFileSync','join','root','server/files/templates/network.ejs','utf8','writeFileSync','format','/etc/asterisk/sip_xcally_%s.conf','type','chan_sip.so','params','render','toLowerCase','Reload','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1731,0x1d2));var _0x1173=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1731[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x1173('0x0'));var emlformat=require(_0x1173('0x1'));var rimraf=require(_0x1173('0x2'));var zipdir=require(_0x1173('0x3'));var jsonpatch=require(_0x1173('0x4'));var rp=require('request-promise');var moment=require(_0x1173('0x5'));var BPromise=require(_0x1173('0x6'));var Mustache=require(_0x1173('0x7'));var util=require('util');var path=require(_0x1173('0x8'));var sox=require('sox');var csv=require(_0x1173('0x9'));var ejs=require(_0x1173('0xa'));var fs=require('fs');var _=require(_0x1173('0xb'));var squel=require(_0x1173('0xc'));var crypto=require(_0x1173('0xd'));var jsforce=require(_0x1173('0xe'));var deskjs=require(_0x1173('0xf'));var toCsv=require(_0x1173('0x9'));var querystring=require('querystring');var Papa=require(_0x1173('0x10'));var Redis=require('ioredis');var authService=require(_0x1173('0x11'));var qs=require(_0x1173('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1173('0x13'))(_0x1173('0x14'));var utils=require('../../config/utils');var config=require(_0x1173('0x15'));var db=require(_0x1173('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x1173('0x17')]({'port':0x232a});function checkPasswordPattern(_0x319c26,_0x4f0491,_0x47126c){if(_0x47126c){var _0x112ce3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x112ce3['test'](_0x4f0491)){return _0x319c26;}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 _0x319c26;}}function respondWithRpcPromise(_0x5bef3a,_0x4ebdb1,_0x63c3e,_0x2db926){return new BPromise(function(_0x1d3ab5,_0x45bfea){var _0x55c7c6=_0x2db926||client;return _0x55c7c6[_0x1173('0x18')](_0x5bef3a,_0x63c3e)[_0x1173('0x19')](function(_0x3bf966){logger[_0x1173('0x1a')]('Network,\x20%s,\x20%s',_0x4ebdb1,_0x1173('0x1b'));logger[_0x1173('0x1c')](_0x1173('0x1d'),_0x4ebdb1,_0x1173('0x1b'),JSON['stringify'](_0x3bf966));if(_0x3bf966[_0x1173('0x1e')]){if(_0x3bf966[_0x1173('0x1e')][_0x1173('0x1f')]===0x1f4){logger[_0x1173('0x1e')]('Network,\x20%s,\x20%s',_0x4ebdb1,_0x3bf966[_0x1173('0x1e')][_0x1173('0x20')]);return _0x45bfea(_0x3bf966[_0x1173('0x1e')][_0x1173('0x20')]);}logger['error'](_0x1173('0x21'),_0x4ebdb1,_0x3bf966[_0x1173('0x1e')][_0x1173('0x20')]);return _0x1d3ab5(_0x3bf966[_0x1173('0x1e')][_0x1173('0x20')]);}else{logger[_0x1173('0x1a')](_0x1173('0x21'),_0x4ebdb1,_0x1173('0x1b'));_0x1d3ab5(_0x3bf966[_0x1173('0x22')][_0x1173('0x20')]);}})[_0x1173('0x23')](function(_0x2a0ff7){logger[_0x1173('0x1e')](_0x1173('0x21'),_0x4ebdb1,_0x2a0ff7);_0x45bfea(_0x2a0ff7);});});}function respondWithStatusCode(_0x397e4b,_0x538ac2){_0x538ac2=_0x538ac2||0xcc;return function(_0x1f92ac){if(_0x1f92ac){return _0x397e4b[_0x1173('0x24')](_0x538ac2);}return _0x397e4b[_0x1173('0x25')](_0x538ac2)[_0x1173('0x26')]();};}function respondWithResult(_0x545b57,_0x1ad755){_0x1ad755=_0x1ad755||0xc8;return function(_0x2bfba6){if(_0x2bfba6){return _0x545b57['status'](_0x1ad755)[_0x1173('0x27')](_0x2bfba6);}};}function respondWithFilteredResult(_0x3555e7,_0x38c129){return function(_0x465314){if(_0x465314){var _0x358c3f=_0x465314[_0x1173('0x28')],_0x7a59d4=_0x38c129[_0x1173('0x29')],_0x30236b=_0x38c129[_0x1173('0x29')]+_0x38c129[_0x1173('0x2a')],_0x41086b;if(_0x30236b>=_0x358c3f){_0x30236b=_0x358c3f;_0x41086b=0xc8;}else{_0x41086b=0xce;}_0x3555e7[_0x1173('0x25')](_0x41086b);return _0x3555e7['set'](_0x1173('0x2b'),_0x7a59d4+'-'+_0x30236b+'/'+_0x358c3f)[_0x1173('0x27')](_0x465314);}return null;};}function patchUpdates(_0xd69414){return function(_0x47c26b){try{jsonpatch[_0x1173('0x2c')](_0x47c26b,_0xd69414,!![]);}catch(_0x507f84){return BPromise[_0x1173('0x2d')](_0x507f84);}return _0x47c26b[_0x1173('0x2e')]();};}function saveUpdates(_0x3dc0e1,_0x209498){return function(_0x3f5141){if(_0x3f5141){return _0x3f5141[_0x1173('0x2f')](_0x3dc0e1)[_0x1173('0x19')](function(_0x284f83){return _0x284f83;});}return null;};}function removeEntity(_0x5801d8,_0x329082){return function(_0x4eeb98){if(_0x4eeb98){return _0x4eeb98[_0x1173('0x30')]()[_0x1173('0x19')](function(){_0x5801d8[_0x1173('0x25')](0xcc)[_0x1173('0x26')]();});}};}function handleEntityNotFound(_0x1790ad,_0x1c4393){return function(_0x2eb263){if(!_0x2eb263){_0x1790ad[_0x1173('0x24')](0x194);}return _0x2eb263;};}function handleError(_0x44b9cb,_0x351b6f){_0x351b6f=_0x351b6f||0x1f4;return function(_0x4c032e){logger['error'](_0x4c032e[_0x1173('0x31')]);if(_0x4c032e[_0x1173('0x32')]){delete _0x4c032e[_0x1173('0x32')];}_0x44b9cb[_0x1173('0x25')](_0x351b6f)[_0x1173('0x33')](_0x4c032e);};}exports[_0x1173('0x34')]=function(_0x122f29,_0x3fc27f){var _0x312513={},_0x437d9d={},_0x2d17e0={'count':0x0,'rows':[]};var _0x52d09b=db[_0x1173('0x35')][_0x1173('0x36')];_0x437d9d[_0x1173('0x37')]=_['keys'](_0x52d09b);_0x437d9d[_0x1173('0x38')]=_[_0x1173('0x39')](_0x122f29['query']);_0x437d9d[_0x1173('0x3a')]=_[_0x1173('0x3b')](_0x437d9d[_0x1173('0x37')],_0x437d9d[_0x1173('0x38')]);_0x312513[_0x1173('0x3c')]=_[_0x1173('0x3b')](_0x437d9d[_0x1173('0x37')],qs['fields'](_0x122f29[_0x1173('0x38')][_0x1173('0x3d')]));_0x312513[_0x1173('0x3c')]=_0x312513[_0x1173('0x3c')][_0x1173('0x3e')]?_0x312513[_0x1173('0x3c')]:_0x437d9d[_0x1173('0x37')];if(!_0x122f29['query'][_0x1173('0x3f')]('nolimit')){_0x312513[_0x1173('0x2a')]=qs[_0x1173('0x2a')](_0x122f29['query'][_0x1173('0x2a')]);_0x312513[_0x1173('0x29')]=qs['offset'](_0x122f29[_0x1173('0x38')]['offset']);}_0x312513['order']=qs[_0x1173('0x40')](_0x122f29[_0x1173('0x38')]['sort']);_0x312513[_0x1173('0x41')]=qs['filters'](_[_0x1173('0x42')](_0x122f29[_0x1173('0x38')],_0x437d9d['filters']));if(_0x122f29[_0x1173('0x38')][_0x1173('0x43')]){_0x312513[_0x1173('0x41')]=_[_0x1173('0x44')](_0x312513[_0x1173('0x41')],{'$or':_[_0x1173('0x45')](_0x52d09b,function(_0x459467){if(_0x459467['type'][_0x1173('0x46')]!=='VIRTUAL'){var _0x3a67f9={};_0x3a67f9[_0x459467[_0x1173('0x47')]]={'$like':'%'+_0x122f29[_0x1173('0x38')][_0x1173('0x43')]+'%'};return _0x3a67f9;}})});}_0x312513=_[_0x1173('0x44')]({},_0x312513,_0x122f29[_0x1173('0x48')]);var _0x3deffa={'where':_0x312513[_0x1173('0x41')]};return db[_0x1173('0x35')]['count'](_0x3deffa)[_0x1173('0x19')](function(_0x3a5eaf){_0x2d17e0[_0x1173('0x28')]=_0x3a5eaf;if(_0x122f29[_0x1173('0x38')][_0x1173('0x49')]){_0x312513[_0x1173('0x4a')]=[{'all':!![]}];}return db[_0x1173('0x35')][_0x1173('0x4b')](_0x312513);})['then'](function(_0x2809aa){_0x2d17e0[_0x1173('0x4c')]=_0x2809aa;return _0x2d17e0;})[_0x1173('0x19')](respondWithFilteredResult(_0x3fc27f,_0x312513))[_0x1173('0x23')](handleError(_0x3fc27f,null));};exports[_0x1173('0x4d')]=function(_0x5487e2,_0x287e56){var _0x4dcab4={'raw':!![],'where':{'id':_0x5487e2['params']['id']}},_0x38029f={};_0x38029f[_0x1173('0x37')]=_[_0x1173('0x39')](db[_0x1173('0x35')]['rawAttributes']);_0x38029f[_0x1173('0x38')]=_[_0x1173('0x39')](_0x5487e2[_0x1173('0x38')]);_0x38029f[_0x1173('0x3a')]=_[_0x1173('0x3b')](_0x38029f['model'],_0x38029f['query']);_0x4dcab4[_0x1173('0x3c')]=_[_0x1173('0x3b')](_0x38029f[_0x1173('0x37')],qs[_0x1173('0x3d')](_0x5487e2[_0x1173('0x38')][_0x1173('0x3d')]));_0x4dcab4['attributes']=_0x4dcab4[_0x1173('0x3c')][_0x1173('0x3e')]?_0x4dcab4['attributes']:_0x38029f[_0x1173('0x37')];if(_0x5487e2['query'][_0x1173('0x49')]){_0x4dcab4['include']=[{'all':!![]}];}_0x4dcab4=_[_0x1173('0x44')]({},_0x4dcab4,_0x5487e2['options']);return db[_0x1173('0x35')][_0x1173('0x4e')](_0x4dcab4)[_0x1173('0x19')](handleEntityNotFound(_0x287e56,null))[_0x1173('0x19')](respondWithResult(_0x287e56,null))[_0x1173('0x23')](handleError(_0x287e56,null));};exports[_0x1173('0x4f')]=function(_0x435dc8,_0x2e3741,_0x224bd1){var _0x2253d2;return db[_0x1173('0x50')][_0x1173('0x51')](function(_0x1b33e3){return db[_0x1173('0x35')][_0x1173('0x4f')](_0x435dc8['body'],{'raw':!![]})[_0x1173('0x19')](function(_0x3aed61){_0x2253d2=_0x3aed61;return db[_0x1173('0x35')][_0x1173('0x4b')]({'where':{'type':_0x435dc8[_0x1173('0x52')]['type']},'raw':!![]});})[_0x1173('0x19')](function(_0xbeb279){var _0x581c5c=fs[_0x1173('0x53')](path[_0x1173('0x54')](config[_0x1173('0x55')],_0x1173('0x56')),_0x1173('0x57'));var _0x2aba88=ejs['render'](_0x581c5c,{'networks':_0xbeb279||[]});fs[_0x1173('0x58')](util[_0x1173('0x59')](_0x1173('0x5a'),_0x435dc8[_0x1173('0x52')][_0x1173('0x5b')]['toLowerCase']()),_0x2aba88);})[_0x1173('0x19')](function(){return respondWithRpcPromise('Reload',_0x1173('0x4f'),{'module':_0x1173('0x5c')});})[_0x1173('0x19')](function(){return _0x2253d2;});})[_0x1173('0x19')](respondWithResult(_0x2e3741,0xc9))['catch'](handleError(_0x2e3741,null));};exports[_0x1173('0x2f')]=function(_0x1a7524,_0xb0f0c9,_0x31afc7){var _0xd51306;return db[_0x1173('0x50')][_0x1173('0x51')](function(_0x715545){return db[_0x1173('0x35')][_0x1173('0x4e')]({'where':{'id':_0x1a7524[_0x1173('0x5d')]['id']}})['then'](handleEntityNotFound(_0xb0f0c9,null))[_0x1173('0x19')](saveUpdates(_0x1a7524['body'],null))[_0x1173('0x19')](function(_0x55b183){if(_0x55b183){_0xd51306=_0x55b183;return db[_0x1173('0x35')][_0x1173('0x4b')]({'where':{'type':_0xd51306[_0x1173('0x5b')]},'raw':!![]});}return null;})[_0x1173('0x19')](function(_0x43ae2e){if(_0x43ae2e){var _0x330d83=fs['readFileSync'](path[_0x1173('0x54')](config[_0x1173('0x55')],_0x1173('0x56')),_0x1173('0x57'));var _0x1d012d=ejs[_0x1173('0x5e')](_0x330d83,{'networks':_0x43ae2e||[]});fs[_0x1173('0x58')](util[_0x1173('0x59')](_0x1173('0x5a'),_0xd51306[_0x1173('0x5b')]['toLowerCase']()),_0x1d012d);return respondWithRpcPromise('Reload',_0x1173('0x2f'),{'module':'chan_sip.so'});}return null;})[_0x1173('0x19')](function(_0x3be05d){if(_0x3be05d){return _0xd51306;}return null;});})[_0x1173('0x19')](respondWithResult(_0xb0f0c9,null))[_0x1173('0x23')](handleError(_0xb0f0c9,null));};exports[_0x1173('0x30')]=function(_0x4b820,_0x4cf410,_0x483d1c){var _0x5eece3;return db['Network'][_0x1173('0x4e')]({'where':{'id':_0x4b820['params']['id']}})[_0x1173('0x19')](function(_0x2050f1){_0x5eece3=_0x2050f1;return _0x2050f1;})['then'](handleEntityNotFound(_0x4cf410,null))[_0x1173('0x19')](removeEntity(_0x4cf410,null))[_0x1173('0x19')](function(){if(_0x5eece3){return db[_0x1173('0x35')][_0x1173('0x4b')]({'where':{'type':_0x5eece3[_0x1173('0x5b')]},'raw':!![]});}})[_0x1173('0x19')](function(_0x51e8cb){if(_0x51e8cb){var _0x317832=fs['readFileSync'](path[_0x1173('0x54')](config[_0x1173('0x55')],_0x1173('0x56')),_0x1173('0x57'));var _0x37fb8d=ejs[_0x1173('0x5e')](_0x317832,{'networks':_0x51e8cb||[]});fs[_0x1173('0x58')](util[_0x1173('0x59')](_0x1173('0x5a'),_0x5eece3[_0x1173('0x5b')][_0x1173('0x5f')]()),_0x37fb8d);return respondWithRpcPromise(_0x1173('0x60'),_0x1173('0x30'),{'module':_0x1173('0x5c')});}})[_0x1173('0x23')](handleError(_0x4cf410,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index cf1c0cf..6896da0 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 _0x965c=['define','Network','network','lodash','util','api','moment','bluebird','request-promise','../../config/environment','./network.attributes','exports'];(function(_0x1d08f8,_0x1cff11){var _0xa21918=function(_0x2732c9){while(--_0x2732c9){_0x1d08f8['push'](_0x1d08f8['shift']());}};_0xa21918(++_0x1cff11);}(_0x965c,0x18f));var _0xc965=function(_0x4e6090,_0x50fa28){_0x4e6090=_0x4e6090-0x0;var _0x108ca1=_0x965c[_0x4e6090];return _0x108ca1;};'use strict';var _=require(_0xc965('0x0'));var util=require(_0xc965('0x1'));var logger=require('../../config/logger')(_0xc965('0x2'));var moment=require(_0xc965('0x3'));var BPromise=require(_0xc965('0x4'));var rp=require(_0xc965('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc965('0x6'));var attributes=require(_0xc965('0x7'));module[_0xc965('0x8')]=function(_0xcddb53,_0x15c524){return _0xcddb53[_0xc965('0x9')](_0xc965('0xa'),attributes,{'tableName':_0xc965('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x02d8=['bluebird','request-promise','rimraf','./network.attributes','exports','Network','network','lodash','util','../../config/logger','api','moment'];(function(_0x4e9a98,_0xbb99ec){var _0x44dbdc=function(_0x457421){while(--_0x457421){_0x4e9a98['push'](_0x4e9a98['shift']());}};_0x44dbdc(++_0xbb99ec);}(_0x02d8,0x1db));var _0x802d=function(_0x49e8c7,_0x4f7130){_0x49e8c7=_0x49e8c7-0x0;var _0xf4da97=_0x02d8[_0x49e8c7];return _0xf4da97;};'use strict';var _=require(_0x802d('0x0'));var util=require(_0x802d('0x1'));var logger=require(_0x802d('0x2'))(_0x802d('0x3'));var moment=require(_0x802d('0x4'));var BPromise=require(_0x802d('0x5'));var rp=require(_0x802d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x802d('0x7'));var config=require('../../config/environment');var attributes=require(_0x802d('0x8'));module[_0x802d('0x9')]=function(_0x44e6e0,_0x5194eb){return _0x44e6e0['define'](_0x802d('0xa'),attributes,{'tableName':_0x802d('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 6fc7780..8825080 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 _0x9a5a=['request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Network,\x20%s,\x20%s'];(function(_0x3238ed,_0x43928c){var _0x521ce5=function(_0x2fdea7){while(--_0x2fdea7){_0x3238ed['push'](_0x3238ed['shift']());}};_0x521ce5(++_0x43928c);}(_0x9a5a,0x194));var _0xa9a5=function(_0x2c77f5,_0x69298b){_0x2c77f5=_0x2c77f5-0x0;var _0x1a912b=_0x9a5a[_0x2c77f5];return _0x1a912b;};'use strict';var _=require(_0xa9a5('0x0'));var util=require(_0xa9a5('0x1'));var moment=require(_0xa9a5('0x2'));var BPromise=require(_0xa9a5('0x3'));var rs=require(_0xa9a5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa9a5('0x5'))['db'];var utils=require(_0xa9a5('0x6'));var logger=require(_0xa9a5('0x7'))(_0xa9a5('0x8'));var config=require(_0xa9a5('0x9'));var jayson=require(_0xa9a5('0xa'));var client=jayson['client'][_0xa9a5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x37e93b,_0x20bbe8,_0x1eafa6){return new BPromise(function(_0x24e1bd,_0x5f2e83){return client['request'](_0x37e93b,_0x1eafa6)['then'](function(_0xc95120){logger[_0xa9a5('0xc')](_0xa9a5('0xd'),_0x20bbe8,_0xa9a5('0xe'));logger[_0xa9a5('0xf')](_0xa9a5('0x10'),_0x20bbe8,_0xa9a5('0xe'),JSON['stringify'](_0xc95120));if(_0xc95120['error']){if(_0xc95120['error'][_0xa9a5('0x11')]===0x1f4){logger[_0xa9a5('0x12')](_0xa9a5('0xd'),_0x20bbe8,_0xc95120[_0xa9a5('0x12')][_0xa9a5('0x13')]);return _0x5f2e83(_0xc95120['error'][_0xa9a5('0x13')]);}logger[_0xa9a5('0x12')](_0xa9a5('0xd'),_0x20bbe8,_0xc95120[_0xa9a5('0x12')][_0xa9a5('0x13')]);return _0x24e1bd(_0xc95120[_0xa9a5('0x12')]['message']);}else{logger[_0xa9a5('0xc')](_0xa9a5('0xd'),_0x20bbe8,_0xa9a5('0xe'));_0x24e1bd(_0xc95120[_0xa9a5('0x14')]['message']);}})[_0xa9a5('0x15')](function(_0x106cbf){logger[_0xa9a5('0x12')]('Network,\x20%s,\x20%s',_0x20bbe8,_0x106cbf);_0x5f2e83(_0x106cbf);});});} \ No newline at end of file +var _0xae24=['request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','error','code','Network,\x20%s,\x20%s','message','catch','lodash','moment','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','info'];(function(_0xc097cc,_0x2f0d7e){var _0xab6ffc=function(_0x124625){while(--_0x124625){_0xc097cc['push'](_0xc097cc['shift']());}};_0xab6ffc(++_0x2f0d7e);}(_0xae24,0x182));var _0x4ae2=function(_0x2ccee9,_0x159bf5){_0x2ccee9=_0x2ccee9-0x0;var _0x3d7018=_0xae24[_0x2ccee9];return _0x3d7018;};'use strict';var _=require(_0x4ae2('0x0'));var util=require('util');var moment=require(_0x4ae2('0x1'));var BPromise=require('bluebird');var rs=require(_0x4ae2('0x2'));var fs=require('fs');var Redis=require(_0x4ae2('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4ae2('0x4'))('rpc');var config=require(_0x4ae2('0x5'));var jayson=require(_0x4ae2('0x6'));var client=jayson[_0x4ae2('0x7')][_0x4ae2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x428054,_0x307247,_0x4f2e84){return new BPromise(function(_0x5f589a,_0x41cdf1){return client['request'](_0x428054,_0x4f2e84)['then'](function(_0xb5587a){logger[_0x4ae2('0x9')]('Network,\x20%s,\x20%s',_0x307247,_0x4ae2('0xa'));logger[_0x4ae2('0xb')](_0x4ae2('0xc'),_0x307247,_0x4ae2('0xa'),JSON['stringify'](_0xb5587a));if(_0xb5587a[_0x4ae2('0xd')]){if(_0xb5587a[_0x4ae2('0xd')][_0x4ae2('0xe')]===0x1f4){logger['error'](_0x4ae2('0xf'),_0x307247,_0xb5587a[_0x4ae2('0xd')][_0x4ae2('0x10')]);return _0x41cdf1(_0xb5587a[_0x4ae2('0xd')][_0x4ae2('0x10')]);}logger[_0x4ae2('0xd')](_0x4ae2('0xf'),_0x307247,_0xb5587a[_0x4ae2('0xd')][_0x4ae2('0x10')]);return _0x5f589a(_0xb5587a['error']['message']);}else{logger['info'](_0x4ae2('0xf'),_0x307247,_0x4ae2('0xa'));_0x5f589a(_0xb5587a['result'][_0x4ae2('0x10')]);}})[_0x4ae2('0x11')](function(_0x1fde63){logger[_0x4ae2('0xd')](_0x4ae2('0xf'),_0x307247,_0x1fde63);_0x41cdf1(_0x1fde63);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index cfd1d93..5337ec7 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 _0x3205=['/:id/interactions','getInteractions','/:id/users','getAgents','post','create','addDisposition','addAnswer','notify','addApplications','addAgents','/:id/send','send','put','update','delete','removeDispositions','removeAgents','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./openchannelAccount.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','/:id/applications','getApplications'];(function(_0x480e1b,_0x42217b){var _0x4921d4=function(_0x3d4898){while(--_0x3d4898){_0x480e1b['push'](_0x480e1b['shift']());}};_0x4921d4(++_0x42217b);}(_0x3205,0x14d));var _0x5320=function(_0x3b3099,_0x199381){_0x3b3099=_0x3b3099-0x0;var _0x462dc7=_0x3205[_0x3b3099];return _0x462dc7;};'use strict';var multer=require('multer');var util=require(_0x5320('0x0'));var path=require(_0x5320('0x1'));var timeout=require(_0x5320('0x2'));var express=require(_0x5320('0x3'));var router=express['Router']();var auth=require(_0x5320('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5320('0x5'));var controller=require(_0x5320('0x6'));router['get']('/',auth[_0x5320('0x7')](),controller['index']);router[_0x5320('0x8')](_0x5320('0x9'),auth[_0x5320('0x7')](),controller[_0x5320('0xa')]);router[_0x5320('0x8')](_0x5320('0xb'),auth[_0x5320('0x7')](),controller[_0x5320('0xc')]);router[_0x5320('0x8')](_0x5320('0xd'),auth[_0x5320('0x7')](),controller['getDispositions']);router[_0x5320('0x8')](_0x5320('0xe'),auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x5320('0xf'),auth[_0x5320('0x7')](),controller[_0x5320('0x10')]);router[_0x5320('0x8')](_0x5320('0x11'),auth['isAuthenticated'](),controller[_0x5320('0x12')]);router[_0x5320('0x8')](_0x5320('0x13'),auth['isAuthenticated'](),controller[_0x5320('0x14')]);router[_0x5320('0x15')]('/',auth[_0x5320('0x7')](),controller[_0x5320('0x16')]);router['post']('/:id/dispositions',auth[_0x5320('0x7')](),controller[_0x5320('0x17')]);router[_0x5320('0x15')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x5320('0x18')]);router[_0x5320('0x15')]('/:id/notify',controller[_0x5320('0x19')]);router[_0x5320('0x15')](_0x5320('0xf'),auth['isAuthenticated'](),controller[_0x5320('0x1a')]);router['post'](_0x5320('0x13'),auth[_0x5320('0x7')](),controller[_0x5320('0x1b')]);router[_0x5320('0x15')](_0x5320('0x1c'),auth[_0x5320('0x7')](),controller[_0x5320('0x1d')]);router[_0x5320('0x1e')](_0x5320('0xb'),auth[_0x5320('0x7')](),controller[_0x5320('0x1f')]);router[_0x5320('0x20')](_0x5320('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0x5320('0x20')](_0x5320('0xd'),auth[_0x5320('0x7')](),controller[_0x5320('0x21')]);router[_0x5320('0x20')]('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router['delete']('/:id/users',auth[_0x5320('0x7')](),controller[_0x5320('0x22')]);module['exports']=router; \ No newline at end of file +var _0x1141=['isAuthenticated','describe','get','/:id','/:id/dispositions','getDispositions','/:id/applications','getApplications','getInteractions','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','/:id/notify','notify','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/auth/service','/describe'];(function(_0x26f137,_0x400dc0){var _0x242864=function(_0x26386d){while(--_0x26386d){_0x26f137['push'](_0x26f137['shift']());}};_0x242864(++_0x400dc0);}(_0x1141,0x1e9));var _0x1114=function(_0x262f44,_0x3847ba){_0x262f44=_0x262f44-0x0;var _0x33b27c=_0x1141[_0x262f44];return _0x33b27c;};'use strict';var multer=require(_0x1114('0x0'));var util=require(_0x1114('0x1'));var path=require(_0x1114('0x2'));var timeout=require(_0x1114('0x3'));var express=require(_0x1114('0x4'));var router=express['Router']();var auth=require(_0x1114('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./openchannelAccount.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x1114('0x6'),auth[_0x1114('0x7')](),controller[_0x1114('0x8')]);router[_0x1114('0x9')](_0x1114('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x1114('0x9')](_0x1114('0xb'),auth[_0x1114('0x7')](),controller[_0x1114('0xc')]);router['get']('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router[_0x1114('0x9')](_0x1114('0xd'),auth[_0x1114('0x7')](),controller[_0x1114('0xe')]);router[_0x1114('0x9')]('/:id/interactions',auth[_0x1114('0x7')](),controller[_0x1114('0xf')]);router[_0x1114('0x9')](_0x1114('0x10'),auth[_0x1114('0x7')](),controller[_0x1114('0x11')]);router[_0x1114('0x12')]('/',auth[_0x1114('0x7')](),controller['create']);router['post'](_0x1114('0xb'),auth[_0x1114('0x7')](),controller[_0x1114('0x13')]);router[_0x1114('0x12')](_0x1114('0x14'),auth[_0x1114('0x7')](),controller[_0x1114('0x15')]);router[_0x1114('0x12')](_0x1114('0x16'),controller[_0x1114('0x17')]);router['post'](_0x1114('0xd'),auth['isAuthenticated'](),controller['addApplications']);router['post'](_0x1114('0x10'),auth[_0x1114('0x7')](),controller['addAgents']);router[_0x1114('0x12')]('/:id/send',auth[_0x1114('0x7')](),controller['send']);router[_0x1114('0x18')](_0x1114('0xa'),auth[_0x1114('0x7')](),controller[_0x1114('0x19')]);router[_0x1114('0x1a')]('/:id',auth[_0x1114('0x7')](),controller['destroy']);router[_0x1114('0x1a')](_0x1114('0xb'),auth[_0x1114('0x7')](),controller[_0x1114('0x1b')]);router[_0x1114('0x1a')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x1114('0x1c')]);router[_0x1114('0x1a')]('/:id/users',auth[_0x1114('0x7')](),controller[_0x1114('0x1d')]);module[_0x1114('0x1e')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 84b2fec..a010b65 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 _0x7712=['sequelize','randomstring','exports','STRING','name','generate','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDisposition'];(function(_0x5c23bc,_0x4ae595){var _0x2c2b18=function(_0x27498c){while(--_0x27498c){_0x5c23bc['push'](_0x5c23bc['shift']());}};_0x2c2b18(++_0x4ae595);}(_0x7712,0x168));var _0x2771=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x7712[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0x2771('0x0'));var rs=require(_0x2771('0x1'));module[_0x2771('0x2')]={'name':{'type':Sequelize[_0x2771('0x3')],'unique':_0x2771('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x2771('0x3')]},'token':{'type':Sequelize[_0x2771('0x3')],'defaultValue':function(){return rs[_0x2771('0x5')]();}},'replyUri':{'type':Sequelize[_0x2771('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x2771('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x2771('0x6');}},'notificationSound':{'type':Sequelize[_0x2771('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2771('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2771('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0x2771('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2771('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2771('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0x2771('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x2771('0x7')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x48271c){if(!_0x48271c)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x2771('0xa')](_0x2771('0xb'),_0x48271c);}}}; \ No newline at end of file +var _0x0bb2=['exports','STRING','name','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','randomstring'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x0bb2,0x179));var _0x20bb=function(_0x54ebb8,_0x50fe54){_0x54ebb8=_0x54ebb8-0x0;var _0x2a19ab=_0x0bb2[_0x54ebb8];return _0x2a19ab;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x20bb('0x0'));module[_0x20bb('0x1')]={'name':{'type':Sequelize[_0x20bb('0x2')],'unique':_0x20bb('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x20bb('0x2')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x20bb('0x4')]();}},'replyUri':{'type':Sequelize[_0x20bb('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x20bb('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x20bb('0x5')],'defaultValue':function(){return _0x20bb('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x20bb('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x20bb('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x20bb('0x2')]},'queueTransfer':{'type':Sequelize[_0x20bb('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x20bb('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x20bb('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x20bb('0x7')],'defaultValue':![],'comment':_0x20bb('0xa'),'set':function(_0x370b09){if(!_0x370b09)this['setDataValue'](_0x20bb('0xb'),null);this[_0x20bb('0xc')](_0x20bb('0xd'),_0x370b09);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index b04a503..4c0a35a 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 _0x7733=['userOpenchannelAccount:save','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','send','CmList','out','Messages','dataValues','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','register','jayson/promise','client','http','test','request','then','info','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','catch','sendStatus','end','status','json','offset','set','Content-Range','apply','reject','save','destroy','get','OpenchannelAccounts','UserProfileResource','name','OpenchannelAccount','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','limit','order','sort','filters','filter','map','type','field','merge','options','where','count','include','rows','show','Pause','mandatoryDispositionPause','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','addDisposition','OpnechannelAccountId','Disposition','nolimit','pick','findAll','removeDispositions','addAnswer','OpenchannelAccountId','CannedAnswer','getAnswers','removeAnswers','ids','notify','openchannel','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','OpenchannelApplication','Applications','List','account','applications','list','orderBy','priority','asc','ListId','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','firstName','contact','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','findOne','sequelize','transaction','getApplications','getInteractions','fullname','internal','Tag','color','tag','addAgents'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0x7733,0xcb));var _0x3773=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x7733[_0x2112d4];return _0x434972;};'use strict';var pdf=require(_0x3773('0x0'));var emlformat=require(_0x3773('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3773('0x2'));var jsonpatch=require(_0x3773('0x3'));var rp=require(_0x3773('0x4'));var moment=require(_0x3773('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3773('0x6'));var util=require(_0x3773('0x7'));var path=require(_0x3773('0x8'));var sox=require('sox');var csv=require(_0x3773('0x9'));var ejs=require(_0x3773('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3773('0xb'));var crypto=require(_0x3773('0xc'));var jsforce=require(_0x3773('0xd'));var deskjs=require(_0x3773('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3773('0xf'));var Redis=require(_0x3773('0x10'));var authService=require(_0x3773('0x11'));var qs=require(_0x3773('0x12'));var hardwareService=require(_0x3773('0x13'));var logger=require(_0x3773('0x14'))(_0x3773('0x15'));var utils=require(_0x3773('0x16'));var config=require(_0x3773('0x17'));var db=require(_0x3773('0x18'))['db'];config[_0x3773('0x19')]=_[_0x3773('0x1a')](config['redis'],{'host':_0x3773('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3773('0x19')]));require('./openchannelAccount.socket')[_0x3773('0x1c')](socket);var jayson=require(_0x3773('0x1d'));var client=jayson[_0x3773('0x1e')][_0x3773('0x1f')]({'port':0x232c});var client9002=jayson[_0x3773('0x1e')][_0x3773('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x500937,_0x1e7420,_0x31c0f5){if(_0x31c0f5){var _0x3bf24f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3bf24f[_0x3773('0x20')](_0x1e7420)){return _0x500937;}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 _0x500937;}}function respondWithRpcPromise(_0x436734,_0x59347d,_0x43dd78,_0x358011){return new BPromise(function(_0x52333a,_0x2ca63a){var _0x21b545=_0x358011||client;return _0x21b545[_0x3773('0x21')](_0x436734,_0x43dd78)[_0x3773('0x22')](function(_0xa87a64){logger[_0x3773('0x23')]('OpenchannelAccount,\x20%s,\x20%s',_0x59347d,'request\x20sent');logger[_0x3773('0x24')](_0x3773('0x25'),_0x59347d,_0x3773('0x26'),JSON[_0x3773('0x27')](_0xa87a64));if(_0xa87a64['error']){if(_0xa87a64[_0x3773('0x28')][_0x3773('0x29')]===0x1f4){logger[_0x3773('0x28')](_0x3773('0x2a'),_0x59347d,_0xa87a64[_0x3773('0x28')][_0x3773('0x2b')]);return _0x2ca63a(_0xa87a64[_0x3773('0x28')][_0x3773('0x2b')]);}logger[_0x3773('0x28')]('OpenchannelAccount,\x20%s,\x20%s',_0x59347d,_0xa87a64[_0x3773('0x28')][_0x3773('0x2b')]);return _0x52333a(_0xa87a64['error']['message']);}else{logger[_0x3773('0x23')](_0x3773('0x2a'),_0x59347d,'request\x20sent');_0x52333a(_0xa87a64['result'][_0x3773('0x2b')]);}})[_0x3773('0x2c')](function(_0x5b2d74){logger['error'](_0x3773('0x2a'),_0x59347d,_0x5b2d74);_0x2ca63a(_0x5b2d74);});});}function respondWithStatusCode(_0x1bbae1,_0x44f169){_0x44f169=_0x44f169||0xcc;return function(_0x447ab6){if(_0x447ab6){return _0x1bbae1[_0x3773('0x2d')](_0x44f169);}return _0x1bbae1['status'](_0x44f169)[_0x3773('0x2e')]();};}function respondWithResult(_0x35e16d,_0x115590){_0x115590=_0x115590||0xc8;return function(_0x25e92a){if(_0x25e92a){return _0x35e16d[_0x3773('0x2f')](_0x115590)[_0x3773('0x30')](_0x25e92a);}};}function respondWithFilteredResult(_0x396431,_0x19406c){return function(_0x219585){if(_0x219585){var _0x1faba2=_0x219585['count'],_0x200010=_0x19406c[_0x3773('0x31')],_0x38776f=_0x19406c[_0x3773('0x31')]+_0x19406c['limit'],_0x38206e;if(_0x38776f>=_0x1faba2){_0x38776f=_0x1faba2;_0x38206e=0xc8;}else{_0x38206e=0xce;}_0x396431[_0x3773('0x2f')](_0x38206e);return _0x396431[_0x3773('0x32')](_0x3773('0x33'),_0x200010+'-'+_0x38776f+'/'+_0x1faba2)[_0x3773('0x30')](_0x219585);}return null;};}function patchUpdates(_0x324acc){return function(_0x4b96bd){try{jsonpatch[_0x3773('0x34')](_0x4b96bd,_0x324acc,!![]);}catch(_0x5388b1){return BPromise[_0x3773('0x35')](_0x5388b1);}return _0x4b96bd[_0x3773('0x36')]();};}function saveUpdates(_0x3c59a6,_0x3d9482){return function(_0x1bd6ec){if(_0x1bd6ec){return _0x1bd6ec['update'](_0x3c59a6)[_0x3773('0x22')](function(_0x43b034){return _0x43b034;});}return null;};}function removeEntity(_0xc3e6bf,_0x3e4e3d){return function(_0x4aac1c){if(_0x4aac1c){return _0x4aac1c[_0x3773('0x37')]()[_0x3773('0x22')](function(){var _0x587690=_0x4aac1c[_0x3773('0x38')]({'plain':!![]});var _0x32d67a=_0x3773('0x39');return db[_0x3773('0x3a')]['destroy']({'where':{'type':_0x32d67a,'resourceId':_0x587690['id']}})[_0x3773('0x22')](function(){return _0x4aac1c;});})[_0x3773('0x22')](function(){_0xc3e6bf[_0x3773('0x2f')](0xcc)[_0x3773('0x2e')]();});}};}function handleEntityNotFound(_0x344cc9,_0x36d99e){return function(_0x15d7b0){if(!_0x15d7b0){_0x344cc9[_0x3773('0x2d')](0x194);}return _0x15d7b0;};}function handleError(_0x489007,_0x46d332){_0x46d332=_0x46d332||0x1f4;return function(_0x1e4a11){logger[_0x3773('0x28')](_0x1e4a11['stack']);if(_0x1e4a11[_0x3773('0x3b')]){delete _0x1e4a11[_0x3773('0x3b')];}_0x489007[_0x3773('0x2f')](_0x46d332)['send'](_0x1e4a11);};}exports['index']=function(_0xfa6c80,_0x3b247f){var _0x2694b0={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x696f7={},_0x447a2a={'count':0x0,'rows':[]};var _0x26ac72=db[_0x3773('0x3c')][_0x3773('0x3d')];_0x696f7[_0x3773('0x3e')]=_[_0x3773('0x3f')](_0x26ac72);_0x696f7[_0x3773('0x40')]=_[_0x3773('0x3f')](_0xfa6c80['query']);_0x696f7['filters']=_[_0x3773('0x41')](_0x696f7['model'],_0x696f7[_0x3773('0x40')]);_0x2694b0[_0x3773('0x42')]=_[_0x3773('0x41')](_0x696f7[_0x3773('0x3e')],qs[_0x3773('0x43')](_0xfa6c80[_0x3773('0x40')][_0x3773('0x43')]));_0x2694b0[_0x3773('0x42')]=_0x2694b0['attributes']['length']?_0x2694b0['attributes']:_0x696f7['model'];if(!_0xfa6c80[_0x3773('0x40')][_0x3773('0x44')]('nolimit')){_0x2694b0[_0x3773('0x45')]=qs['limit'](_0xfa6c80[_0x3773('0x40')][_0x3773('0x45')]);_0x2694b0[_0x3773('0x31')]=qs[_0x3773('0x31')](_0xfa6c80['query'][_0x3773('0x31')]);}_0x2694b0[_0x3773('0x46')]=qs[_0x3773('0x47')](_0xfa6c80[_0x3773('0x40')][_0x3773('0x47')]);_0x2694b0['where']=qs[_0x3773('0x48')](_['pick'](_0xfa6c80[_0x3773('0x40')],_0x696f7[_0x3773('0x48')]));if(_0xfa6c80[_0x3773('0x40')][_0x3773('0x49')]){_0x2694b0['where']=_['merge'](_0x2694b0['where'],{'$or':_[_0x3773('0x4a')](_0x26ac72,function(_0x2dd793){if(_0x2dd793[_0x3773('0x4b')]['key']!=='VIRTUAL'){var _0x5e9b41={};_0x5e9b41[_0x2dd793[_0x3773('0x4c')]]={'$like':'%'+_0xfa6c80[_0x3773('0x40')][_0x3773('0x49')]+'%'};return _0x5e9b41;}})});}_0x2694b0=_[_0x3773('0x4d')]({},_0x2694b0,_0xfa6c80[_0x3773('0x4e')]);var _0x25a565={'where':_0x2694b0[_0x3773('0x4f')]};return db['OpenchannelAccount']['count'](_0x25a565)[_0x3773('0x22')](function(_0x1721a5){_0x447a2a[_0x3773('0x50')]=_0x1721a5;if(_0xfa6c80['query']['includeAll']){_0x2694b0[_0x3773('0x51')]=[{'all':!![]}];}return db[_0x3773('0x3c')]['findAll'](_0x2694b0);})[_0x3773('0x22')](function(_0x3650b2){_0x447a2a[_0x3773('0x52')]=_0x3650b2;return _0x447a2a;})['then'](respondWithFilteredResult(_0x3b247f,_0x2694b0))['catch'](handleError(_0x3b247f,null));};exports[_0x3773('0x53')]=function(_0x41be3b,_0x222991){var _0x4d7be9={'raw':![],'where':{'id':_0x41be3b['params']['id']},'include':[{'model':db[_0x3773('0x54')],'as':_0x3773('0x55')}]},_0x13efeb={};_0x13efeb['model']=_['keys'](db['OpenchannelAccount'][_0x3773('0x3d')]);_0x13efeb['query']=_[_0x3773('0x3f')](_0x41be3b['query']);_0x13efeb[_0x3773('0x48')]=_[_0x3773('0x41')](_0x13efeb[_0x3773('0x3e')],_0x13efeb[_0x3773('0x40')]);_0x4d7be9[_0x3773('0x42')]=_[_0x3773('0x41')](_0x13efeb[_0x3773('0x3e')],qs['fields'](_0x41be3b[_0x3773('0x40')][_0x3773('0x43')]));_0x4d7be9['attributes']=_0x4d7be9[_0x3773('0x42')][_0x3773('0x56')]?_0x4d7be9[_0x3773('0x42')]:_0x13efeb['model'];if(_0x41be3b[_0x3773('0x40')][_0x3773('0x57')]){_0x4d7be9[_0x3773('0x51')]=[{'all':!![]}];}_0x4d7be9=_[_0x3773('0x4d')]({},_0x4d7be9,_0x41be3b[_0x3773('0x4e')]);return db['OpenchannelAccount'][_0x3773('0x58')](_0x4d7be9)[_0x3773('0x22')](handleEntityNotFound(_0x222991,null))[_0x3773('0x22')](respondWithResult(_0x222991,null))['catch'](handleError(_0x222991,null));};exports[_0x3773('0x59')]=function(_0x6e312a,_0x5d3576){return db['OpenchannelAccount'][_0x3773('0x59')](_0x6e312a[_0x3773('0x5a')],{})['then'](function(_0x4b19be){var _0x539b36=_0x6e312a[_0x3773('0x5b')][_0x3773('0x38')]({'plain':!![]});if(!_0x539b36)throw new Error(_0x3773('0x5c'));if(_0x539b36[_0x3773('0x5d')]===_0x3773('0x5b')){var _0x3cea38=_0x4b19be[_0x3773('0x38')]({'plain':!![]});var _0x1dd601=_0x3773('0x39');return db['UserProfileSection'][_0x3773('0x58')]({'where':{'name':_0x1dd601,'userProfileId':_0x539b36['userProfileId']},'raw':!![]})[_0x3773('0x22')](function(_0xbdf4f){if(_0xbdf4f&&_0xbdf4f[_0x3773('0x5e')]===0x0){return db[_0x3773('0x3a')]['create']({'name':_0x3cea38[_0x3773('0x3b')],'resourceId':_0x3cea38['id'],'type':_0xbdf4f[_0x3773('0x3b')],'sectionId':_0xbdf4f['id']},{})[_0x3773('0x22')](function(){return _0x4b19be;});}else{return _0x4b19be;}})[_0x3773('0x2c')](function(_0x125d2f){logger[_0x3773('0x28')](_0x3773('0x5f'),_0x125d2f);throw _0x125d2f;});}return _0x4b19be;})[_0x3773('0x22')](respondWithResult(_0x5d3576,0xc9))[_0x3773('0x2c')](handleError(_0x5d3576,null));};exports[_0x3773('0x60')]=function(_0x42e660,_0x2c8130){if(_0x42e660[_0x3773('0x5a')]['id']){delete _0x42e660[_0x3773('0x5a')]['id'];}return db[_0x3773('0x3c')][_0x3773('0x58')]({'where':{'id':_0x42e660['params']['id']},'include':[{'model':db[_0x3773('0x54')],'as':'mandatoryDispositionPause'}]})[_0x3773('0x22')](handleEntityNotFound(_0x2c8130,null))['then'](saveUpdates(_0x42e660[_0x3773('0x5a')],null))['then'](respondWithResult(_0x2c8130,null))[_0x3773('0x2c')](handleError(_0x2c8130,null));};exports['destroy']=function(_0x303418,_0x3ede2b){return db[_0x3773('0x3c')]['find']({'where':{'id':_0x303418[_0x3773('0x61')]['id']}})[_0x3773('0x22')](handleEntityNotFound(_0x3ede2b,null))[_0x3773('0x22')](removeEntity(_0x3ede2b,null))['catch'](handleError(_0x3ede2b,null));};exports[_0x3773('0x62')]=function(_0x41bc9c,_0x102f62){return db[_0x3773('0x3c')][_0x3773('0x62')]()[_0x3773('0x22')](respondWithResult(_0x102f62,null))['catch'](handleError(_0x102f62,null));};exports[_0x3773('0x63')]=function(_0x301b43,_0x1f46ff,_0x496b04){if(_0x301b43[_0x3773('0x5a')]['id']){delete _0x301b43[_0x3773('0x5a')]['id'];}return db[_0x3773('0x3c')]['find']({'where':{'id':_0x301b43[_0x3773('0x61')]['id']}})[_0x3773('0x22')](handleEntityNotFound(_0x1f46ff,null))[_0x3773('0x22')](function(_0x136161){if(_0x136161){_0x301b43[_0x3773('0x5a')][_0x3773('0x64')]=_0x136161['id'];return db[_0x3773('0x65')][_0x3773('0x59')](_0x301b43[_0x3773('0x5a')]);}})[_0x3773('0x22')](respondWithResult(_0x1f46ff,null))[_0x3773('0x2c')](handleError(_0x1f46ff,null));};exports['getDispositions']=function(_0x9eb692,_0x21f04c,_0xd3d069){var _0x11da73={'raw':![],'where':{}};var _0x39e69e={};var _0x4217e2={'count':0x0,'rows':[]};return db[_0x3773('0x3c')]['findOne']({'where':{'id':_0x9eb692[_0x3773('0x61')]['id']}})[_0x3773('0x22')](handleEntityNotFound(_0x21f04c,null))[_0x3773('0x22')](function(_0x2908ef){if(_0x2908ef){_0x39e69e[_0x3773('0x3e')]=_['keys'](db[_0x3773('0x65')][_0x3773('0x3d')]);_0x39e69e[_0x3773('0x40')]=_[_0x3773('0x3f')](_0x9eb692[_0x3773('0x40')]);_0x39e69e['filters']=_['intersection'](_0x39e69e[_0x3773('0x3e')],_0x39e69e[_0x3773('0x40')]);_0x11da73['attributes']=_[_0x3773('0x41')](_0x39e69e[_0x3773('0x3e')],qs[_0x3773('0x43')](_0x9eb692[_0x3773('0x40')][_0x3773('0x43')]));_0x11da73[_0x3773('0x42')]=_0x11da73['attributes'][_0x3773('0x56')]?_0x11da73['attributes']:_0x39e69e[_0x3773('0x3e')];if(!_0x9eb692[_0x3773('0x40')][_0x3773('0x44')](_0x3773('0x66'))){_0x11da73[_0x3773('0x45')]=qs[_0x3773('0x45')](_0x9eb692[_0x3773('0x40')][_0x3773('0x45')]);_0x11da73[_0x3773('0x31')]=qs[_0x3773('0x31')](_0x9eb692[_0x3773('0x40')][_0x3773('0x31')]);}_0x11da73['order']=qs[_0x3773('0x47')](_0x9eb692[_0x3773('0x40')][_0x3773('0x47')]);_0x11da73[_0x3773('0x4f')]=qs[_0x3773('0x48')](_[_0x3773('0x67')](_0x9eb692['query'],_0x39e69e[_0x3773('0x48')]));_0x11da73[_0x3773('0x4f')]['OpenchannelAccountId']=_0x2908ef['id'];if(_0x9eb692[_0x3773('0x40')]['filter']){_0x11da73[_0x3773('0x4f')]=_[_0x3773('0x4d')](_0x11da73[_0x3773('0x4f')],{'$or':_[_0x3773('0x4a')](_0x11da73[_0x3773('0x42')],function(_0x116815){var _0x4d23da={};_0x4d23da[_0x116815]={'$like':'%'+_0x9eb692[_0x3773('0x40')][_0x3773('0x49')]+'%'};return _0x4d23da;})});}_0x11da73=_[_0x3773('0x4d')]({},_0x11da73,_0x9eb692[_0x3773('0x4e')]);return db[_0x3773('0x65')][_0x3773('0x50')]({'where':_0x11da73[_0x3773('0x4f')]})[_0x3773('0x22')](function(_0x499912){_0x4217e2['count']=_0x499912;if(_0x9eb692['query'][_0x3773('0x57')]){_0x11da73['include']=[{'all':!![]}];}return db[_0x3773('0x65')][_0x3773('0x68')](_0x11da73);})['then'](function(_0xa2d969){_0x4217e2[_0x3773('0x52')]=_0xa2d969;return _0x4217e2;});}})['then'](respondWithFilteredResult(_0x21f04c,_0x11da73))['catch'](handleError(_0x21f04c,null));};exports['removeDispositions']=function(_0x1d0f0b,_0x510bdf,_0x5560ff){return db[_0x3773('0x3c')][_0x3773('0x58')]({'where':{'id':_0x1d0f0b[_0x3773('0x61')]['id']}})[_0x3773('0x22')](handleEntityNotFound(_0x510bdf,null))[_0x3773('0x22')](function(_0x557e57){if(_0x557e57){return _0x557e57[_0x3773('0x69')](_0x1d0f0b[_0x3773('0x40')]['ids']);}})[_0x3773('0x22')](respondWithStatusCode(_0x510bdf,null))[_0x3773('0x2c')](handleError(_0x510bdf,null));};exports[_0x3773('0x6a')]=function(_0xc0f50e,_0x330767,_0x47ee93){if(_0xc0f50e[_0x3773('0x5a')]['id']){delete _0xc0f50e[_0x3773('0x5a')]['id'];}return db[_0x3773('0x3c')][_0x3773('0x58')]({'where':{'id':_0xc0f50e['params']['id']}})[_0x3773('0x22')](handleEntityNotFound(_0x330767,null))[_0x3773('0x22')](function(_0x1373e3){if(_0x1373e3){_0xc0f50e['body'][_0x3773('0x6b')]=_0x1373e3['id'];return db[_0x3773('0x6c')]['create'](_0xc0f50e['body']);}})[_0x3773('0x22')](respondWithResult(_0x330767,null))['catch'](handleError(_0x330767,null));};exports[_0x3773('0x6d')]=function(_0x116f72,_0x39f87e,_0x3cd434){var _0x250b08={'raw':![],'where':{}};var _0x395eb2={};var _0x4834c4={'count':0x0,'rows':[]};return db[_0x3773('0x3c')]['findOne']({'where':{'id':_0x116f72[_0x3773('0x61')]['id']}})[_0x3773('0x22')](handleEntityNotFound(_0x39f87e,null))[_0x3773('0x22')](function(_0x277830){if(_0x277830){_0x395eb2[_0x3773('0x3e')]=_[_0x3773('0x3f')](db['CannedAnswer'][_0x3773('0x3d')]);_0x395eb2[_0x3773('0x40')]=_[_0x3773('0x3f')](_0x116f72['query']);_0x395eb2['filters']=_['intersection'](_0x395eb2[_0x3773('0x3e')],_0x395eb2[_0x3773('0x40')]);_0x250b08[_0x3773('0x42')]=_[_0x3773('0x41')](_0x395eb2[_0x3773('0x3e')],qs[_0x3773('0x43')](_0x116f72[_0x3773('0x40')][_0x3773('0x43')]));_0x250b08[_0x3773('0x42')]=_0x250b08['attributes']['length']?_0x250b08[_0x3773('0x42')]:_0x395eb2[_0x3773('0x3e')];if(!_0x116f72['query'][_0x3773('0x44')](_0x3773('0x66'))){_0x250b08['limit']=qs['limit'](_0x116f72[_0x3773('0x40')][_0x3773('0x45')]);_0x250b08[_0x3773('0x31')]=qs[_0x3773('0x31')](_0x116f72[_0x3773('0x40')]['offset']);}_0x250b08[_0x3773('0x46')]=qs[_0x3773('0x47')](_0x116f72[_0x3773('0x40')][_0x3773('0x47')]);_0x250b08[_0x3773('0x4f')]=qs[_0x3773('0x48')](_[_0x3773('0x67')](_0x116f72[_0x3773('0x40')],_0x395eb2['filters']));_0x250b08[_0x3773('0x4f')][_0x3773('0x6b')]=_0x277830['id'];if(_0x116f72[_0x3773('0x40')]['filter']){_0x250b08[_0x3773('0x4f')]=_[_0x3773('0x4d')](_0x250b08[_0x3773('0x4f')],{'$or':_[_0x3773('0x4a')](_0x250b08[_0x3773('0x42')],function(_0x2b9cb2){var _0x3115fe={};_0x3115fe[_0x2b9cb2]={'$like':'%'+_0x116f72[_0x3773('0x40')][_0x3773('0x49')]+'%'};return _0x3115fe;})});}_0x250b08=_[_0x3773('0x4d')]({},_0x250b08,_0x116f72[_0x3773('0x4e')]);return db[_0x3773('0x6c')]['count']({'where':_0x250b08[_0x3773('0x4f')]})[_0x3773('0x22')](function(_0x236d1d){_0x4834c4['count']=_0x236d1d;if(_0x116f72['query'][_0x3773('0x57')]){_0x250b08['include']=[{'all':!![]}];}return db[_0x3773('0x6c')][_0x3773('0x68')](_0x250b08);})[_0x3773('0x22')](function(_0x297575){_0x4834c4['rows']=_0x297575;return _0x4834c4;});}})[_0x3773('0x22')](respondWithFilteredResult(_0x39f87e,_0x250b08))[_0x3773('0x2c')](handleError(_0x39f87e,null));};exports[_0x3773('0x6e')]=function(_0x4b9877,_0x61e991,_0x314f40){return db[_0x3773('0x3c')][_0x3773('0x58')]({'where':{'id':_0x4b9877[_0x3773('0x61')]['id']}})[_0x3773('0x22')](handleEntityNotFound(_0x61e991,null))[_0x3773('0x22')](function(_0x33b96a){if(_0x33b96a){return _0x33b96a[_0x3773('0x6e')](_0x4b9877[_0x3773('0x40')][_0x3773('0x6f')]);}})[_0x3773('0x22')](respondWithStatusCode(_0x61e991,null))['catch'](handleError(_0x61e991,null));};exports[_0x3773('0x70')]=function(_0x1fb21b,_0x1994fa,_0xaf75fa){var _0x2fd19f={'body':_0x1fb21b[_0x3773('0x5a')],'channel':_0x3773('0x71')};var _0x494363=[];var _0x3ce737=[];var _0x259cb1={};var _0x2198d1=![];return db[_0x3773('0x72')][_0x3773('0x62')]()[_0x3773('0x22')](function(_0x2e6ab5){if(!_0x2e6ab5){throw new db[(_0x3773('0x73'))]['ValidationError'](_0x3773('0x74'));}_0x494363=_[_0x3773('0x75')](_[_0x3773('0x3f')](_0x2e6ab5),[_0x3773('0x76'),_0x3773('0x77')]);_0x3ce737=_[_0x3773('0x75')](_[_0x3773('0x3f')](_0x2e6ab5),[_0x3773('0x76'),_0x3773('0x77'),_0x3773('0x78'),'ListId']);if(_0x1fb21b['body']['id']){delete _0x1fb21b[_0x3773('0x5a')]['id'];}if(_['isNil'](_0x1fb21b[_0x3773('0x5a')][_0x3773('0x79')])){throw new db[(_0x3773('0x73'))][(_0x3773('0x7a'))](_0x3773('0x7b'));}if(_['isNil'](_0x1fb21b[_0x3773('0x5a')][_0x3773('0x5a')])||_0x1fb21b[_0x3773('0x5a')]['body']===''){throw new db['Sequelize']['ValidationError'](_0x3773('0x7c'));}if(_[_0x3773('0x7d')](_0x1fb21b[_0x3773('0x5a')][_0x3773('0x7e')])){throw new db['Sequelize'][(_0x3773('0x7a'))](_0x3773('0x7f')+_0x3ce737);}if(!_[_0x3773('0x80')](_0x3ce737,_0x1fb21b[_0x3773('0x5a')][_0x3773('0x7e')])){throw new db[(_0x3773('0x73'))][(_0x3773('0x7a'))](_0x3773('0x81')+_0x3ce737);}_0x259cb1[_0x1fb21b[_0x3773('0x5a')]['mapKey']]=_0x1fb21b[_0x3773('0x5a')][_0x3773('0x79')];})['then'](function(){return db['OpenchannelAccount'][_0x3773('0x58')]({'where':{'id':_0x1fb21b[_0x3773('0x61')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x3773('0x72')],'as':_0x3773('0x82'),'where':_0x259cb1,'limit':0x1,'order':[[_0x3773('0x77'),_0x3773('0x83')]]}]},{'model':db[_0x3773('0x84')],'as':_0x3773('0x85')}]});})[_0x3773('0x22')](handleEntityNotFound(_0x1994fa,null))['then'](function(_0x211693){if(_0x211693&&_0x211693[_0x3773('0x86')]){_0x2fd19f[_0x3773('0x87')]=_0x211693;_0x2fd19f[_0x3773('0x88')]=_0x211693[_0x3773('0x85')];_0x2fd19f[_0x3773('0x89')]=_0x211693[_0x3773('0x86')];_0x2fd19f[_0x3773('0x88')]=_[_0x3773('0x8a')](_0x2fd19f['applications'],[_0x3773('0x8b')],[_0x3773('0x8c')]);if(_0x2fd19f[_0x3773('0x87')][_0x3773('0x85')]){delete _0x2fd19f[_0x3773('0x87')][_0x3773('0x85')];}if(_0x2fd19f[_0x3773('0x87')][_0x3773('0x86')]&&_0x2fd19f[_0x3773('0x87')][_0x3773('0x86')][_0x3773('0x82')][_0x3773('0x56')]){return _0x2fd19f[_0x3773('0x87')][_0x3773('0x86')][_0x3773('0x82')][0x0];}var _0x458470=_[_0x3773('0x1a')](_0x1fb21b[_0x3773('0x5a')],{'firstName':_0x1fb21b[_0x3773('0x5a')][_0x3773('0x79')],'ListId':_0x211693[_0x3773('0x8d')]});_0x458470[_0x1fb21b[_0x3773('0x5a')][_0x3773('0x7e')]]=_0x1fb21b[_0x3773('0x5a')][_0x3773('0x79')];return db['CmContact'][_0x3773('0x59')](_0x458470,{'fields':_0x494363,'raw':!![]});}})[_0x3773('0x22')](handleEntityNotFound(_0x1994fa,null))[_0x3773('0x22')](function(_0x151ac8){_0x2fd19f['contact']=_0x151ac8;if(_0x151ac8){var _0x1bf813={'ContactId':_0x151ac8['id'],'OpenchannelAccountId':_0x1fb21b[_0x3773('0x61')]['id'],'from':(_0x151ac8['firstName']||'')+'\x20'+(_0x151ac8[_0x3773('0x8e')]||'')};var _0x41584e={'OpenchannelAccountId':_0x1fb21b[_0x3773('0x61')]['id'],'closed':![]};if(_0x1fb21b[_0x3773('0x5a')][_0x3773('0x8f')]){_0x41584e[_0x3773('0x8f')]=_0x1fb21b['body'][_0x3773('0x8f')];return db[_0x3773('0x90')][_0x3773('0x58')]({'where':_0x41584e})[_0x3773('0x22')](function(_0x45b832){if(_0x45b832){return[_0x45b832,![]];}_0x1bf813[_0x3773('0x8f')]=_0x1fb21b[_0x3773('0x5a')]['threadId'];_0x1bf813[_0x3773('0x91')]=_0x1fb21b[_0x3773('0x5a')][_0x3773('0x91')];return db[_0x3773('0x90')][_0x3773('0x59')](_0x1bf813)[_0x3773('0x22')](function(_0xde130){return[_0xde130,!![]];});});}else{_0x41584e['threadId']=null;}_0x41584e[_0x3773('0x92')]=_0x151ac8['id'];return db[_0x3773('0x90')][_0x3773('0x58')]({'where':_0x41584e})[_0x3773('0x22')](function(_0x4fe95c){if(_0x4fe95c){return[_0x4fe95c,![]];}return db[_0x3773('0x90')][_0x3773('0x59')](_0x1bf813)[_0x3773('0x22')](function(_0x56862d){return[_0x56862d,!![]];});});}})[_0x3773('0x93')](function(_0x34ac77,_0x2c8695){if(_0x34ac77){_0x2198d1=_0x2c8695;if(!_0x2c8695){var _0x521a8b={'from':(_0x2fd19f['contact'][_0x3773('0x94')]||'')+'\x20'+(_0x2fd19f[_0x3773('0x95')]['lastName']||'')};if(_0x1fb21b['body'][_0x3773('0x8f')]&&_0x1fb21b['body'][_0x3773('0x96')]&&_0x1fb21b[_0x3773('0x5a')][_0x3773('0x8f')]!=_0x1fb21b['body'][_0x3773('0x96')]){_0x521a8b['threadId']=_0x1fb21b[_0x3773('0x5a')]['messageId'];}return _0x34ac77[_0x3773('0x60')](_0x521a8b);}else{return _0x34ac77;}}})['then'](function(_0x1f59b2){_0x2fd19f['interaction']=_0x1f59b2['get']({'plain':!![]});_0x2fd19f[_0x3773('0x97')][_0x3773('0x98')]=_0x2198d1;if(_0x2fd19f[_0x3773('0x97')]['created']){if(_0x2fd19f['account'][_0x3773('0x99')]){_0x2fd19f[_0x3773('0x88')][_0x3773('0x9a')]({'id':0x0,'priority':_0x2fd19f[_0x3773('0x88')][_0x3773('0x56')]+0x1,'app':_0x3773('0x9b'),'appdata':_0x3773('0x9c'),'interval':_0x3773('0x9d')});}}return db[_0x3773('0x9e')]['create']({'body':_0x1fb21b[_0x3773('0x5a')]['body'],'OpenchannelAccountId':_0x1fb21b['params']['id'],'OpenchannelInteractionId':_0x1f59b2['id'],'direction':'in','ContactId':_0x2fd19f['contact']['id'],'AttachmentId':_0x1fb21b[_0x3773('0x5a')][_0x3773('0x9f')]});})[_0x3773('0x22')](function(_0x16c33e){_0x2fd19f[_0x3773('0x2b')]=_0x16c33e;if(_0x2fd19f[_0x3773('0x97')][_0x3773('0xa0')]){return db[_0x3773('0xa1')][_0x3773('0x58')]({'attributes':['id',_0x3773('0x3b')],'where':{'id':_0x2fd19f[_0x3773('0x97')][_0x3773('0xa0')]}})[_0x3773('0x22')](function(_0x5cae6f){if(_0x5cae6f){_0x2fd19f[_0x3773('0x88')][_0x3773('0xa2')]({'id':0x0,'priority':0x0,'app':_0x3773('0xa3'),'appdata':_0x5cae6f['name']+','+(_0x2fd19f[_0x3773('0x87')][_0x3773('0xa4')]||0xa),'interval':_0x3773('0x9d')});_0x2fd19f[_0x3773('0xa5')]=![];}return respondWithRpcPromise(_0x3773('0xa6'),_0x3773('0xa7'),_0x2fd19f);});}return respondWithRpcPromise(_0x3773('0xa6'),_0x3773('0xa7'),_0x2fd19f);})[_0x3773('0x22')](function(_0x2141ff){respondWithRpcPromise(_0x3773('0xa8'),_0x3773('0xa8'),{'event':_0x3773('0x70'),'message':_0x2141ff},client9002);return _0x2141ff;})[_0x3773('0x22')](respondWithResult(_0x1994fa,null))[_0x3773('0x2c')](handleError(_0x1994fa,null));};exports[_0x3773('0xa9')]=function(_0x2e5bc9,_0x288afc,_0x567da2){return db[_0x3773('0x3c')][_0x3773('0xaa')]({'where':{'id':_0x2e5bc9['params']['id']}})[_0x3773('0x22')](handleEntityNotFound(_0x288afc,null))[_0x3773('0x22')](function(_0x5caf0b){if(_0x5caf0b){return db[_0x3773('0xab')][_0x3773('0xac')](function(_0xc0c089){return db[_0x3773('0x84')][_0x3773('0x37')]({'where':{'OpenchannelAccountId':_0x2e5bc9[_0x3773('0x61')]['id']},'transaction':_0xc0c089})['then'](function(_0x2b89a2){var _0x2ea060=_['map'](_0x2e5bc9['body'],function(_0x79001a){_0x79001a[_0x3773('0x6b')]=_0x2e5bc9['params']['id'];return _0x79001a;});return db[_0x3773('0x84')]['bulkCreate'](_0x2ea060,{'transaction':_0xc0c089});});})['then'](function(){return db['OpenchannelApplication']['findAndCountAll']({'where':{'OpenchannelAccountId':_0x2e5bc9[_0x3773('0x61')]['id']},'order':'priority'});});}})[_0x3773('0x22')](respondWithResult(_0x288afc,null))[_0x3773('0x2c')](handleError(_0x288afc,null));};exports[_0x3773('0xad')]=function(_0x957993,_0x3c93c7,_0x27a7f4){var _0x3092cb={};var _0x14b27d={};var _0x16a505;var _0x398dd3;return db[_0x3773('0x3c')][_0x3773('0xaa')]({'where':{'id':_0x957993[_0x3773('0x61')]['id']}})[_0x3773('0x22')](handleEntityNotFound(_0x3c93c7,null))[_0x3773('0x22')](function(_0x36da09){if(_0x36da09){_0x16a505=_0x36da09;_0x14b27d[_0x3773('0x3e')]=_[_0x3773('0x3f')](db[_0x3773('0x84')][_0x3773('0x3d')]);_0x14b27d[_0x3773('0x40')]=_['keys'](_0x957993[_0x3773('0x40')]);_0x14b27d[_0x3773('0x48')]=_[_0x3773('0x41')](_0x14b27d[_0x3773('0x3e')],_0x14b27d[_0x3773('0x40')]);_0x3092cb[_0x3773('0x42')]=_[_0x3773('0x41')](_0x14b27d[_0x3773('0x3e')],qs['fields'](_0x957993[_0x3773('0x40')][_0x3773('0x43')]));_0x3092cb[_0x3773('0x42')]=_0x3092cb[_0x3773('0x42')][_0x3773('0x56')]?_0x3092cb[_0x3773('0x42')]:_0x14b27d[_0x3773('0x3e')];_0x3092cb[_0x3773('0x46')]=qs['sort'](_0x957993['query'][_0x3773('0x47')]);_0x3092cb[_0x3773('0x4f')]=qs[_0x3773('0x48')](_[_0x3773('0x67')](_0x957993[_0x3773('0x40')],_0x14b27d[_0x3773('0x48')]));if(_0x957993[_0x3773('0x40')][_0x3773('0x49')]){_0x3092cb['where']=_[_0x3773('0x4d')](_0x3092cb['where'],{'$or':_['map'](_0x3092cb[_0x3773('0x42')],function(_0x44d960){var _0x207f15={};_0x207f15[_0x44d960]={'$like':'%'+_0x957993[_0x3773('0x40')][_0x3773('0x49')]+'%'};return _0x207f15;})});}_0x3092cb=_[_0x3773('0x4d')]({},_0x3092cb,_0x957993['options']);return _0x16a505[_0x3773('0xad')](_0x3092cb);}})[_0x3773('0x22')](function(_0x5825e7){if(_0x5825e7){_0x398dd3=_0x5825e7[_0x3773('0x56')];if(!_0x957993['query'][_0x3773('0x44')](_0x3773('0x66'))){_0x3092cb[_0x3773('0x45')]=qs[_0x3773('0x45')](_0x957993[_0x3773('0x40')]['limit']);_0x3092cb[_0x3773('0x31')]=qs[_0x3773('0x31')](_0x957993['query'][_0x3773('0x31')]);}return _0x16a505[_0x3773('0xad')](_0x3092cb);}})[_0x3773('0x22')](function(_0x39c93c){if(_0x39c93c){return _0x39c93c?{'count':_0x398dd3,'rows':_0x39c93c}:null;}})[_0x3773('0x22')](respondWithResult(_0x3c93c7,null))['catch'](handleError(_0x3c93c7,null));};exports[_0x3773('0xae')]=function(_0x506676,_0x131cb4,_0x329dc3){var _0x1de465={'raw':![],'where':{}};var _0x2fa535={};var _0x5bcfaa={'count':0x0,'rows':[]};return db[_0x3773('0x3c')][_0x3773('0xaa')]({'where':{'id':_0x506676[_0x3773('0x61')]['id']}})['then'](handleEntityNotFound(_0x131cb4,null))[_0x3773('0x22')](function(_0x2424f6){if(_0x2424f6){_0x2fa535[_0x3773('0x3e')]=_[_0x3773('0x3f')](db['OpenchannelInteraction'][_0x3773('0x3d')]);_0x2fa535[_0x3773('0x40')]=_[_0x3773('0x3f')](_0x506676[_0x3773('0x40')]);_0x2fa535['filters']=_[_0x3773('0x41')](_0x2fa535[_0x3773('0x3e')],_0x2fa535[_0x3773('0x40')]);_0x1de465[_0x3773('0x42')]=_[_0x3773('0x41')](_0x2fa535[_0x3773('0x3e')],qs[_0x3773('0x43')](_0x506676[_0x3773('0x40')][_0x3773('0x43')]));_0x1de465[_0x3773('0x42')]=_0x1de465[_0x3773('0x42')][_0x3773('0x56')]?_0x1de465[_0x3773('0x42')]:_0x2fa535[_0x3773('0x3e')];if(!_0x506676['query'][_0x3773('0x44')](_0x3773('0x66'))){_0x1de465[_0x3773('0x45')]=qs[_0x3773('0x45')](_0x506676[_0x3773('0x40')][_0x3773('0x45')]);_0x1de465['offset']=qs[_0x3773('0x31')](_0x506676[_0x3773('0x40')][_0x3773('0x31')]);}_0x1de465[_0x3773('0x46')]=qs[_0x3773('0x47')](_0x506676[_0x3773('0x40')][_0x3773('0x47')]);_0x1de465['where']=qs[_0x3773('0x48')](_['pick'](_0x506676[_0x3773('0x40')],_0x2fa535[_0x3773('0x48')]));_0x1de465[_0x3773('0x4f')]['OpenchannelAccountId']=_0x2424f6['id'];if(_0x506676[_0x3773('0x40')][_0x3773('0x49')]){_0x1de465['where']=_[_0x3773('0x4d')](_0x1de465['where'],{'$or':_[_0x3773('0x4a')](_0x1de465[_0x3773('0x42')],function(_0x430f87){var _0x44552f={};_0x44552f[_0x430f87]={'$like':'%'+_0x506676[_0x3773('0x40')]['filter']+'%'};return _0x44552f;})});}_0x1de465=_['merge']({},_0x1de465,_0x506676['options']);return db[_0x3773('0x90')][_0x3773('0x50')]({'where':_0x1de465[_0x3773('0x4f')]})[_0x3773('0x22')](function(_0x367bb3){_0x5bcfaa[_0x3773('0x50')]=_0x367bb3;if(_0x506676[_0x3773('0x40')]['includeAll']){_0x1de465[_0x3773('0x51')]=[{'model':db[_0x3773('0x72')],'as':'Contact','required':![]},{'model':db[_0x3773('0xa1')],'as':'Owner','attributes':['name',_0x3773('0xaf'),_0x3773('0xb0')],'required':![]},{'model':db[_0x3773('0xb1')],'as':'Tags','attributes':['id',_0x3773('0x3b'),_0x3773('0xb2')],'where':_0x506676[_0x3773('0x40')][_0x3773('0xb3')]?{'id':_0x506676[_0x3773('0x40')][_0x3773('0xb3')]}:undefined,'required':_0x506676[_0x3773('0x40')][_0x3773('0xb3')]?!![]:![]}];}return db[_0x3773('0x90')][_0x3773('0x68')](_0x1de465);})[_0x3773('0x22')](function(_0x25c5fd){_0x5bcfaa[_0x3773('0x52')]=_0x25c5fd;return _0x5bcfaa;});}})[_0x3773('0x22')](respondWithFilteredResult(_0x131cb4,_0x1de465))['catch'](handleError(_0x131cb4,null));};exports[_0x3773('0xb4')]=function(_0x25a92b,_0x31fb9f,_0x909e12){return db[_0x3773('0x3c')][_0x3773('0x58')]({'where':{'id':_0x25a92b[_0x3773('0x61')]['id']}})[_0x3773('0x22')](handleEntityNotFound(_0x31fb9f,null))[_0x3773('0x22')](function(_0x208504){if(_0x208504){return _0x208504['addAgents'](_0x25a92b[_0x3773('0x5a')]['ids'],_['omit'](_0x25a92b[_0x3773('0x5a')],['ids','id'])||{})['spread'](function(_0x392c77){for(var _0x4b13c0=0x0;_0x4b13c0<_0x25a92b[_0x3773('0x5a')][_0x3773('0x6f')][_0x3773('0x56')];_0x4b13c0+=0x1){socket['emit'](_0x3773('0xb5'),{'UserId':_0x25a92b['body']['ids'][_0x4b13c0],'OpenchannelAccountId':_0x25a92b[_0x3773('0x61')]['id']});}return _0x392c77;});}})[_0x3773('0x22')](respondWithResult(_0x31fb9f,null))['catch'](handleError(_0x31fb9f,null));};exports[_0x3773('0xb6')]=function(_0x5a07b4,_0x4730c6,_0x59bfd6){return db[_0x3773('0x3c')][_0x3773('0x58')]({'where':{'id':_0x5a07b4[_0x3773('0x61')]['id']}})[_0x3773('0x22')](handleEntityNotFound(_0x4730c6,null))[_0x3773('0x22')](function(_0x345c3c){if(_0x345c3c){return _0x345c3c['removeAgents'](_0x5a07b4[_0x3773('0x40')][_0x3773('0x6f')])[_0x3773('0x22')](function(){if(_[_0x3773('0xb7')](_0x5a07b4[_0x3773('0x40')]['ids'])){for(var _0x3957ff=0x0;_0x3957ff<_0x5a07b4[_0x3773('0x40')][_0x3773('0x6f')]['length'];_0x3957ff+=0x1){socket[_0x3773('0xb8')](_0x3773('0xb9'),{'UserId':Number(_0x5a07b4[_0x3773('0x40')][_0x3773('0x6f')][_0x3957ff]),'OpenchannelAccountId':Number(_0x5a07b4['params']['id'])});}}else{socket['emit'](_0x3773('0xb9'),{'UserId':Number(_0x5a07b4[_0x3773('0x40')][_0x3773('0x6f')]),'OpenchannelAccountId':Number(_0x5a07b4[_0x3773('0x61')]['id'])});}});}})['then'](respondWithStatusCode(_0x4730c6,null))[_0x3773('0x2c')](handleError(_0x4730c6,null));};exports[_0x3773('0xba')]=function(_0x154eb8,_0x3f2d27,_0x4b7336){var _0x187986={};var _0x5a80e7={};var _0x28f9f0;var _0x1a26bf;return db['OpenchannelAccount'][_0x3773('0xaa')]({'where':{'id':_0x154eb8['params']['id']}})[_0x3773('0x22')](handleEntityNotFound(_0x3f2d27,null))[_0x3773('0x22')](function(_0x2038ba){if(_0x2038ba){_0x28f9f0=_0x2038ba;_0x5a80e7[_0x3773('0x3e')]=_[_0x3773('0x3f')](db[_0x3773('0xa1')][_0x3773('0x3d')]);_0x5a80e7[_0x3773('0x40')]=_[_0x3773('0x3f')](_0x154eb8[_0x3773('0x40')]);_0x5a80e7[_0x3773('0x48')]=_['intersection'](_0x5a80e7[_0x3773('0x3e')],_0x5a80e7[_0x3773('0x40')]);_0x187986[_0x3773('0x42')]=_[_0x3773('0x41')](_0x5a80e7[_0x3773('0x3e')],qs['fields'](_0x154eb8[_0x3773('0x40')][_0x3773('0x43')]));_0x187986[_0x3773('0x42')]=_0x187986[_0x3773('0x42')][_0x3773('0x56')]?_0x187986[_0x3773('0x42')]:_0x5a80e7[_0x3773('0x3e')];_0x187986['order']=qs[_0x3773('0x47')](_0x154eb8[_0x3773('0x40')][_0x3773('0x47')]);_0x187986[_0x3773('0x4f')]=qs['filters'](_[_0x3773('0x67')](_0x154eb8[_0x3773('0x40')],_0x5a80e7[_0x3773('0x48')]));if(_0x154eb8[_0x3773('0x40')][_0x3773('0x49')]){_0x187986[_0x3773('0x4f')]=_[_0x3773('0x4d')](_0x187986[_0x3773('0x4f')],{'$or':_[_0x3773('0x4a')](_0x187986[_0x3773('0x42')],function(_0x387a2e){var _0x15668e={};_0x15668e[_0x387a2e]={'$like':'%'+_0x154eb8[_0x3773('0x40')][_0x3773('0x49')]+'%'};return _0x15668e;})});}_0x187986=_['merge']({},_0x187986,_0x154eb8['options']);return _0x28f9f0[_0x3773('0xba')](_0x187986);}})['then'](function(_0x4f4788){if(_0x4f4788){_0x1a26bf=_0x4f4788[_0x3773('0x56')];if(!_0x154eb8[_0x3773('0x40')][_0x3773('0x44')](_0x3773('0x66'))){_0x187986[_0x3773('0x45')]=qs[_0x3773('0x45')](_0x154eb8[_0x3773('0x40')]['limit']);_0x187986[_0x3773('0x31')]=qs[_0x3773('0x31')](_0x154eb8[_0x3773('0x40')]['offset']);}return _0x28f9f0[_0x3773('0xba')](_0x187986);}})[_0x3773('0x22')](function(_0x256b9e){if(_0x256b9e){return _0x256b9e?{'count':_0x1a26bf,'rows':_0x256b9e}:null;}})[_0x3773('0x22')](respondWithResult(_0x3f2d27,null))[_0x3773('0x2c')](handleError(_0x3f2d27,null));};exports[_0x3773('0xbb')]=function(_0x45d7d2,_0x5116f0,_0xfa5de6){var _0x707c4,_0x2d0603,_0x1fc7c4;if(_['isNil'](_0x45d7d2['body'][_0x3773('0x5a')])||_0x45d7d2[_0x3773('0x5a')]['body']===''){throw new db['Sequelize'][(_0x3773('0x7a'))](_0x3773('0x7c'));}if(_[_0x3773('0x7d')](_0x45d7d2[_0x3773('0x5a')]['to'])){}_0x707c4=_0x45d7d2[_0x3773('0x5a')]['to'];return db[_0x3773('0x3c')][_0x3773('0xaa')]({'where':{'id':_0x45d7d2[_0x3773('0x61')]['id']}})['then'](handleEntityNotFound(_0x5116f0,null))[_0x3773('0x22')](function(_0x4ddd5d){if(_0x4ddd5d){return db[_0x3773('0x3c')][_0x3773('0x58')]({'where':{'id':_0x4ddd5d['id']},'include':[{'model':db[_0x3773('0xbc')],'as':_0x3773('0x86'),'include':[{'model':db[_0x3773('0x72')],'as':_0x3773('0x82'),'where':{[_0x4ddd5d['mapKey']]:_0x707c4},'limit':0x1,'order':[[_0x3773('0x77'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x5116f0,null))[_0x3773('0x22')](function(_0x22d722){if(_0x22d722&&_0x22d722[_0x3773('0x86')]){_0x2d0603=_0x22d722[_0x3773('0x38')]({'plain':!![]});if(_0x2d0603[_0x3773('0x86')]&&_0x2d0603['List']['Contacts'][_0x3773('0x56')]){return _0x2d0603[_0x3773('0x86')][_0x3773('0x82')][0x0];}return db[_0x3773('0x72')][_0x3773('0x59')](_['defaults'](_0x45d7d2['body'],{'firstName':_0x707c4,[_0x22d722[_0x3773('0x7e')]]:_0x707c4,'phone':_0x707c4,'ListId':_0x2d0603['ListId']}));}})['then'](handleEntityNotFound(_0x5116f0,null))['then'](function(_0x588b41){if(_0x588b41){_0x1fc7c4=_0x588b41;return db[_0x3773('0x90')]['find']({'where':{'ContactId':_0x1fc7c4['id'],'closed':![],'OpenchannelAccountId':_0x2d0603['id']}})[_0x3773('0x22')](function(_0x56682b){if(_0x56682b){return[_0x56682b,![]];}return db['OpenchannelInteraction'][_0x3773('0x59')]({'UserId':_0x45d7d2[_0x3773('0x5b')]['id'],'ContactId':_0x1fc7c4['id'],'OpenchannelAccountId':_0x2d0603['id'],'lastMsgDirection':_0x3773('0xbd'),'Messages':[_[_0x3773('0x4d')](_0x45d7d2[_0x3773('0x5a')],{'read':![],'body':_0x45d7d2[_0x3773('0x5a')]['body'],'OpenchannelAccountId':_0x2d0603['id'],'UserId':_0x45d7d2['user']['id'],'ContactId':_0x1fc7c4['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x3773('0xbe')}]})['then'](function(_0x3b2eaa){return[_0x3b2eaa,!![]];});});}})['spread'](function(_0x51de25,_0x5bb70d){if(_0x5bb70d){return _0x51de25;}return db[_0x3773('0x9e')][_0x3773('0x59')](_[_0x3773('0x4d')](_0x45d7d2['body'],{'read':![],'body':_0x45d7d2[_0x3773('0x5a')][_0x3773('0x5a')],'OpenchannelAccountId':_0x2d0603['id'],'OpenchannelInteractionId':_0x51de25['id'],'UserId':_0x45d7d2[_0x3773('0x5b')]['id'],'ContactId':_0x1fc7c4['id']}))[_0x3773('0x22')](function(_0x1b5e0c){_0x51de25[_0x3773('0xbf')][_0x3773('0xbe')]=[];_0x51de25[_0x3773('0xbf')][_0x3773('0xbe')][_0x3773('0x9a')](_0x1b5e0c[_0x3773('0xbf')]);return _0x51de25;});});}})[_0x3773('0x22')](respondWithResult(_0x5116f0,null))[_0x3773('0x2c')](handleError(_0x5116f0,null));}; \ No newline at end of file +var _0xa73b=['filter','where','merge','type','key','VIRTUAL','options','includeAll','include','findAll','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','mandatoryDispositionPause','describe','findOne','Disposition','map','rows','removeDispositions','ids','addAnswer','OpenchannelAccountId','getAnswers','CannedAnswer','removeAnswers','openchannel','CmContact','Sequelize','ValidationError','difference','updatedAt','createdAt','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','asc','ListId','contact','firstName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','lastName','messageId','interaction','created','autoclose','*,*,*,*','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','EventManager','notify','addApplications','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','pick','DESC','OpenchannelMessage','Messages','dataValues','push','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.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','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','end','status','json','count','offset','limit','set','apply','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','sendStatus','stack','name','send','index','Pause','OpenchannelAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x3cc94c,_0x2c5287){var _0x51b075=function(_0x2a9f8b){while(--_0x2a9f8b){_0x3cc94c['push'](_0x3cc94c['shift']());}};_0x51b075(++_0x2c5287);}(_0xa73b,0x1e0));var _0xba73=function(_0x12d513,_0x309609){_0x12d513=_0x12d513-0x0;var _0x3ebf3e=_0xa73b[_0x12d513];return _0x3ebf3e;};'use strict';var pdf=require(_0xba73('0x0'));var emlformat=require(_0xba73('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xba73('0x2'));var rp=require(_0xba73('0x3'));var moment=require(_0xba73('0x4'));var BPromise=require(_0xba73('0x5'));var Mustache=require('mustache');var util=require(_0xba73('0x6'));var path=require(_0xba73('0x7'));var sox=require('sox');var csv=require(_0xba73('0x8'));var ejs=require(_0xba73('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xba73('0xa'));var crypto=require(_0xba73('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xba73('0xc'));var toCsv=require(_0xba73('0x8'));var querystring=require('querystring');var Papa=require(_0xba73('0xd'));var Redis=require(_0xba73('0xe'));var authService=require(_0xba73('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xba73('0x10'));var logger=require(_0xba73('0x11'))('api');var utils=require(_0xba73('0x12'));var config=require(_0xba73('0x13'));var db=require('../../mysqldb')['db'];config[_0xba73('0x14')]=_[_0xba73('0x15')](config[_0xba73('0x14')],{'host':_0xba73('0x16'),'port':0x18eb});var socket=require(_0xba73('0x17'))(new Redis(config['redis']));require(_0xba73('0x18'))[_0xba73('0x19')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xba73('0x1a')]({'port':0x232c});var client9002=jayson[_0xba73('0x1b')][_0xba73('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x1cfeed,_0x21d4b6,_0x5b9e77){if(_0x5b9e77){var _0x360db8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x360db8['test'](_0x21d4b6)){return _0x1cfeed;}else{throw new Error(_0xba73('0x1c'));}}else{return _0x1cfeed;}}function respondWithRpcPromise(_0x5053f9,_0x2f6750,_0x1d65b1,_0x4d8a18){return new BPromise(function(_0x532a60,_0xbff67b){var _0x381b55=_0x4d8a18||client;return _0x381b55[_0xba73('0x1d')](_0x5053f9,_0x1d65b1)[_0xba73('0x1e')](function(_0x2f75fb){logger[_0xba73('0x1f')](_0xba73('0x20'),_0x2f6750,_0xba73('0x21'));logger['debug'](_0xba73('0x22'),_0x2f6750,_0xba73('0x21'),JSON[_0xba73('0x23')](_0x2f75fb));if(_0x2f75fb[_0xba73('0x24')]){if(_0x2f75fb['error'][_0xba73('0x25')]===0x1f4){logger[_0xba73('0x24')](_0xba73('0x20'),_0x2f6750,_0x2f75fb[_0xba73('0x24')][_0xba73('0x26')]);return _0xbff67b(_0x2f75fb[_0xba73('0x24')][_0xba73('0x26')]);}logger[_0xba73('0x24')](_0xba73('0x20'),_0x2f6750,_0x2f75fb[_0xba73('0x24')][_0xba73('0x26')]);return _0x532a60(_0x2f75fb[_0xba73('0x24')]['message']);}else{logger[_0xba73('0x1f')](_0xba73('0x20'),_0x2f6750,_0xba73('0x21'));_0x532a60(_0x2f75fb[_0xba73('0x27')]['message']);}})[_0xba73('0x28')](function(_0x562871){logger[_0xba73('0x24')](_0xba73('0x20'),_0x2f6750,_0x562871);_0xbff67b(_0x562871);});});}function respondWithStatusCode(_0x10e16e,_0x16113c){_0x16113c=_0x16113c||0xcc;return function(_0xe23814){if(_0xe23814){return _0x10e16e['sendStatus'](_0x16113c);}return _0x10e16e['status'](_0x16113c)[_0xba73('0x29')]();};}function respondWithResult(_0x1139b2,_0x472238){_0x472238=_0x472238||0xc8;return function(_0x120f4e){if(_0x120f4e){return _0x1139b2[_0xba73('0x2a')](_0x472238)[_0xba73('0x2b')](_0x120f4e);}};}function respondWithFilteredResult(_0x44c788,_0x267f6b){return function(_0x3cff7c){if(_0x3cff7c){var _0xb02814=_0x3cff7c[_0xba73('0x2c')],_0x323a70=_0x267f6b['offset'],_0x22efde=_0x267f6b[_0xba73('0x2d')]+_0x267f6b[_0xba73('0x2e')],_0x2955a1;if(_0x22efde>=_0xb02814){_0x22efde=_0xb02814;_0x2955a1=0xc8;}else{_0x2955a1=0xce;}_0x44c788[_0xba73('0x2a')](_0x2955a1);return _0x44c788[_0xba73('0x2f')]('Content-Range',_0x323a70+'-'+_0x22efde+'/'+_0xb02814)[_0xba73('0x2b')](_0x3cff7c);}return null;};}function patchUpdates(_0x348e26){return function(_0x52ac4a){try{jsonpatch[_0xba73('0x30')](_0x52ac4a,_0x348e26,!![]);}catch(_0x2d3536){return BPromise['reject'](_0x2d3536);}return _0x52ac4a[_0xba73('0x31')]();};}function saveUpdates(_0x1035ae,_0x186d48){return function(_0x1eca7c){if(_0x1eca7c){return _0x1eca7c[_0xba73('0x32')](_0x1035ae)[_0xba73('0x1e')](function(_0x568b11){return _0x568b11;});}return null;};}function removeEntity(_0x40e238,_0x4555ad){return function(_0x47dcd9){if(_0x47dcd9){return _0x47dcd9[_0xba73('0x33')]()['then'](function(){var _0x5ed946=_0x47dcd9[_0xba73('0x34')]({'plain':!![]});var _0x29b0cc=_0xba73('0x35');return db[_0xba73('0x36')][_0xba73('0x33')]({'where':{'type':_0x29b0cc,'resourceId':_0x5ed946['id']}})['then'](function(){return _0x47dcd9;});})['then'](function(){_0x40e238['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a93b6,_0x56c120){return function(_0x59c39b){if(!_0x59c39b){_0x5a93b6[_0xba73('0x37')](0x194);}return _0x59c39b;};}function handleError(_0x47ce6c,_0x3d705d){_0x3d705d=_0x3d705d||0x1f4;return function(_0x37c68b){logger[_0xba73('0x24')](_0x37c68b[_0xba73('0x38')]);if(_0x37c68b[_0xba73('0x39')]){delete _0x37c68b[_0xba73('0x39')];}_0x47ce6c[_0xba73('0x2a')](_0x3d705d)[_0xba73('0x3a')](_0x37c68b);};}exports[_0xba73('0x3b')]=function(_0x6fdf79,_0x3c0e74){var _0x3f0674={'include':[{'model':db[_0xba73('0x3c')],'as':'mandatoryDispositionPause'}]},_0x4d020e={},_0x228bce={'count':0x0,'rows':[]};var _0x2fe603=db[_0xba73('0x3d')][_0xba73('0x3e')];_0x4d020e[_0xba73('0x3f')]=_[_0xba73('0x40')](_0x2fe603);_0x4d020e['query']=_[_0xba73('0x40')](_0x6fdf79[_0xba73('0x41')]);_0x4d020e[_0xba73('0x42')]=_[_0xba73('0x43')](_0x4d020e[_0xba73('0x3f')],_0x4d020e[_0xba73('0x41')]);_0x3f0674[_0xba73('0x44')]=_[_0xba73('0x43')](_0x4d020e['model'],qs[_0xba73('0x45')](_0x6fdf79[_0xba73('0x41')][_0xba73('0x45')]));_0x3f0674['attributes']=_0x3f0674[_0xba73('0x44')][_0xba73('0x46')]?_0x3f0674['attributes']:_0x4d020e[_0xba73('0x3f')];if(!_0x6fdf79[_0xba73('0x41')][_0xba73('0x47')](_0xba73('0x48'))){_0x3f0674[_0xba73('0x2e')]=qs[_0xba73('0x2e')](_0x6fdf79[_0xba73('0x41')][_0xba73('0x2e')]);_0x3f0674[_0xba73('0x2d')]=qs[_0xba73('0x2d')](_0x6fdf79[_0xba73('0x41')][_0xba73('0x2d')]);}_0x3f0674[_0xba73('0x49')]=qs[_0xba73('0x4a')](_0x6fdf79[_0xba73('0x41')][_0xba73('0x4a')]);_0x3f0674['where']=qs[_0xba73('0x42')](_['pick'](_0x6fdf79['query'],_0x4d020e[_0xba73('0x42')]));if(_0x6fdf79[_0xba73('0x41')][_0xba73('0x4b')]){_0x3f0674[_0xba73('0x4c')]=_[_0xba73('0x4d')](_0x3f0674['where'],{'$or':_['map'](_0x2fe603,function(_0x5378cc){if(_0x5378cc[_0xba73('0x4e')][_0xba73('0x4f')]!==_0xba73('0x50')){var _0x2a9c55={};_0x2a9c55[_0x5378cc['field']]={'$like':'%'+_0x6fdf79[_0xba73('0x41')][_0xba73('0x4b')]+'%'};return _0x2a9c55;}})});}_0x3f0674=_[_0xba73('0x4d')]({},_0x3f0674,_0x6fdf79[_0xba73('0x51')]);var _0x3cac41={'where':_0x3f0674[_0xba73('0x4c')]};return db[_0xba73('0x3d')]['count'](_0x3cac41)[_0xba73('0x1e')](function(_0x9dbb11){_0x228bce[_0xba73('0x2c')]=_0x9dbb11;if(_0x6fdf79[_0xba73('0x41')][_0xba73('0x52')]){_0x3f0674[_0xba73('0x53')]=[{'all':!![]}];}return db[_0xba73('0x3d')][_0xba73('0x54')](_0x3f0674);})['then'](function(_0x447e24){_0x228bce['rows']=_0x447e24;return _0x228bce;})[_0xba73('0x1e')](respondWithFilteredResult(_0x3c0e74,_0x3f0674))[_0xba73('0x28')](handleError(_0x3c0e74,null));};exports[_0xba73('0x55')]=function(_0x51a5f2,_0x12cc96){var _0x2578c4={'raw':![],'where':{'id':_0x51a5f2['params']['id']},'include':[{'model':db[_0xba73('0x3c')],'as':'mandatoryDispositionPause'}]},_0x4c7aeb={};_0x4c7aeb[_0xba73('0x3f')]=_[_0xba73('0x40')](db['OpenchannelAccount'][_0xba73('0x3e')]);_0x4c7aeb['query']=_[_0xba73('0x40')](_0x51a5f2[_0xba73('0x41')]);_0x4c7aeb[_0xba73('0x42')]=_[_0xba73('0x43')](_0x4c7aeb[_0xba73('0x3f')],_0x4c7aeb['query']);_0x2578c4[_0xba73('0x44')]=_['intersection'](_0x4c7aeb['model'],qs[_0xba73('0x45')](_0x51a5f2[_0xba73('0x41')][_0xba73('0x45')]));_0x2578c4[_0xba73('0x44')]=_0x2578c4[_0xba73('0x44')]['length']?_0x2578c4['attributes']:_0x4c7aeb[_0xba73('0x3f')];if(_0x51a5f2[_0xba73('0x41')][_0xba73('0x52')]){_0x2578c4[_0xba73('0x53')]=[{'all':!![]}];}_0x2578c4=_[_0xba73('0x4d')]({},_0x2578c4,_0x51a5f2[_0xba73('0x51')]);return db[_0xba73('0x3d')][_0xba73('0x56')](_0x2578c4)[_0xba73('0x1e')](handleEntityNotFound(_0x12cc96,null))[_0xba73('0x1e')](respondWithResult(_0x12cc96,null))[_0xba73('0x28')](handleError(_0x12cc96,null));};exports[_0xba73('0x57')]=function(_0x5e1425,_0x340fe9){return db['OpenchannelAccount'][_0xba73('0x57')](_0x5e1425[_0xba73('0x58')],{})['then'](function(_0x36dd58){var _0x1a3c73=_0x5e1425[_0xba73('0x59')][_0xba73('0x34')]({'plain':!![]});if(!_0x1a3c73)throw new Error(_0xba73('0x5a'));if(_0x1a3c73[_0xba73('0x5b')]===_0xba73('0x59')){var _0x399f0c=_0x36dd58[_0xba73('0x34')]({'plain':!![]});var _0x4b242a='OpenchannelAccounts';return db['UserProfileSection']['find']({'where':{'name':_0x4b242a,'userProfileId':_0x1a3c73[_0xba73('0x5c')]},'raw':!![]})[_0xba73('0x1e')](function(_0x43176f){if(_0x43176f&&_0x43176f[_0xba73('0x5d')]===0x0){return db[_0xba73('0x36')]['create']({'name':_0x399f0c['name'],'resourceId':_0x399f0c['id'],'type':_0x43176f[_0xba73('0x39')],'sectionId':_0x43176f['id']},{})[_0xba73('0x1e')](function(){return _0x36dd58;});}else{return _0x36dd58;}})[_0xba73('0x28')](function(_0x2a8e4b){logger[_0xba73('0x24')](_0xba73('0x5e'),_0x2a8e4b);throw _0x2a8e4b;});}return _0x36dd58;})[_0xba73('0x1e')](respondWithResult(_0x340fe9,0xc9))['catch'](handleError(_0x340fe9,null));};exports[_0xba73('0x32')]=function(_0xd6f001,_0x3c5fab){if(_0xd6f001['body']['id']){delete _0xd6f001[_0xba73('0x58')]['id'];}return db[_0xba73('0x3d')][_0xba73('0x56')]({'where':{'id':_0xd6f001[_0xba73('0x5f')]['id']},'include':[{'model':db[_0xba73('0x3c')],'as':_0xba73('0x60')}]})[_0xba73('0x1e')](handleEntityNotFound(_0x3c5fab,null))[_0xba73('0x1e')](saveUpdates(_0xd6f001['body'],null))[_0xba73('0x1e')](respondWithResult(_0x3c5fab,null))[_0xba73('0x28')](handleError(_0x3c5fab,null));};exports[_0xba73('0x33')]=function(_0x34a51c,_0x917f33){return db[_0xba73('0x3d')]['find']({'where':{'id':_0x34a51c[_0xba73('0x5f')]['id']}})['then'](handleEntityNotFound(_0x917f33,null))[_0xba73('0x1e')](removeEntity(_0x917f33,null))[_0xba73('0x28')](handleError(_0x917f33,null));};exports[_0xba73('0x61')]=function(_0x4f47db,_0x5bd589){return db['OpenchannelAccount'][_0xba73('0x61')]()[_0xba73('0x1e')](respondWithResult(_0x5bd589,null))[_0xba73('0x28')](handleError(_0x5bd589,null));};exports['addDisposition']=function(_0x2bcc14,_0xd9fda5,_0x8afd1){if(_0x2bcc14['body']['id']){delete _0x2bcc14[_0xba73('0x58')]['id'];}return db[_0xba73('0x3d')][_0xba73('0x56')]({'where':{'id':_0x2bcc14[_0xba73('0x5f')]['id']}})[_0xba73('0x1e')](handleEntityNotFound(_0xd9fda5,null))[_0xba73('0x1e')](function(_0x300223){if(_0x300223){_0x2bcc14[_0xba73('0x58')]['OpnechannelAccountId']=_0x300223['id'];return db['Disposition'][_0xba73('0x57')](_0x2bcc14[_0xba73('0x58')]);}})[_0xba73('0x1e')](respondWithResult(_0xd9fda5,null))[_0xba73('0x28')](handleError(_0xd9fda5,null));};exports['getDispositions']=function(_0x37c59a,_0x10feae,_0x108cd8){var _0x4b5723={'raw':![],'where':{}};var _0x4ddb31={};var _0x1580f6={'count':0x0,'rows':[]};return db[_0xba73('0x3d')][_0xba73('0x62')]({'where':{'id':_0x37c59a[_0xba73('0x5f')]['id']}})['then'](handleEntityNotFound(_0x10feae,null))[_0xba73('0x1e')](function(_0x455da0){if(_0x455da0){_0x4ddb31['model']=_[_0xba73('0x40')](db[_0xba73('0x63')][_0xba73('0x3e')]);_0x4ddb31[_0xba73('0x41')]=_['keys'](_0x37c59a['query']);_0x4ddb31[_0xba73('0x42')]=_[_0xba73('0x43')](_0x4ddb31[_0xba73('0x3f')],_0x4ddb31[_0xba73('0x41')]);_0x4b5723['attributes']=_[_0xba73('0x43')](_0x4ddb31[_0xba73('0x3f')],qs[_0xba73('0x45')](_0x37c59a[_0xba73('0x41')][_0xba73('0x45')]));_0x4b5723['attributes']=_0x4b5723[_0xba73('0x44')]['length']?_0x4b5723[_0xba73('0x44')]:_0x4ddb31[_0xba73('0x3f')];if(!_0x37c59a[_0xba73('0x41')][_0xba73('0x47')](_0xba73('0x48'))){_0x4b5723[_0xba73('0x2e')]=qs[_0xba73('0x2e')](_0x37c59a[_0xba73('0x41')][_0xba73('0x2e')]);_0x4b5723[_0xba73('0x2d')]=qs['offset'](_0x37c59a[_0xba73('0x41')][_0xba73('0x2d')]);}_0x4b5723[_0xba73('0x49')]=qs[_0xba73('0x4a')](_0x37c59a[_0xba73('0x41')][_0xba73('0x4a')]);_0x4b5723['where']=qs[_0xba73('0x42')](_['pick'](_0x37c59a[_0xba73('0x41')],_0x4ddb31[_0xba73('0x42')]));_0x4b5723[_0xba73('0x4c')]['OpenchannelAccountId']=_0x455da0['id'];if(_0x37c59a[_0xba73('0x41')][_0xba73('0x4b')]){_0x4b5723[_0xba73('0x4c')]=_[_0xba73('0x4d')](_0x4b5723['where'],{'$or':_[_0xba73('0x64')](_0x4b5723[_0xba73('0x44')],function(_0x1e8532){var _0x45478c={};_0x45478c[_0x1e8532]={'$like':'%'+_0x37c59a['query'][_0xba73('0x4b')]+'%'};return _0x45478c;})});}_0x4b5723=_[_0xba73('0x4d')]({},_0x4b5723,_0x37c59a[_0xba73('0x51')]);return db[_0xba73('0x63')][_0xba73('0x2c')]({'where':_0x4b5723[_0xba73('0x4c')]})[_0xba73('0x1e')](function(_0x4ec016){_0x1580f6[_0xba73('0x2c')]=_0x4ec016;if(_0x37c59a[_0xba73('0x41')][_0xba73('0x52')]){_0x4b5723[_0xba73('0x53')]=[{'all':!![]}];}return db[_0xba73('0x63')][_0xba73('0x54')](_0x4b5723);})[_0xba73('0x1e')](function(_0x14432a){_0x1580f6[_0xba73('0x65')]=_0x14432a;return _0x1580f6;});}})[_0xba73('0x1e')](respondWithFilteredResult(_0x10feae,_0x4b5723))[_0xba73('0x28')](handleError(_0x10feae,null));};exports[_0xba73('0x66')]=function(_0x1ae495,_0x14359a,_0x5c3729){return db[_0xba73('0x3d')][_0xba73('0x56')]({'where':{'id':_0x1ae495[_0xba73('0x5f')]['id']}})[_0xba73('0x1e')](handleEntityNotFound(_0x14359a,null))[_0xba73('0x1e')](function(_0x172362){if(_0x172362){return _0x172362[_0xba73('0x66')](_0x1ae495[_0xba73('0x41')][_0xba73('0x67')]);}})[_0xba73('0x1e')](respondWithStatusCode(_0x14359a,null))['catch'](handleError(_0x14359a,null));};exports[_0xba73('0x68')]=function(_0x4ec075,_0x329e77,_0x57156b){if(_0x4ec075[_0xba73('0x58')]['id']){delete _0x4ec075[_0xba73('0x58')]['id'];}return db[_0xba73('0x3d')][_0xba73('0x56')]({'where':{'id':_0x4ec075[_0xba73('0x5f')]['id']}})['then'](handleEntityNotFound(_0x329e77,null))[_0xba73('0x1e')](function(_0x343b81){if(_0x343b81){_0x4ec075[_0xba73('0x58')][_0xba73('0x69')]=_0x343b81['id'];return db['CannedAnswer'][_0xba73('0x57')](_0x4ec075['body']);}})[_0xba73('0x1e')](respondWithResult(_0x329e77,null))[_0xba73('0x28')](handleError(_0x329e77,null));};exports[_0xba73('0x6a')]=function(_0x33db87,_0x523967,_0x3c9f5e){var _0x276523={'raw':![],'where':{}};var _0x127bd4={};var _0x9923ee={'count':0x0,'rows':[]};return db[_0xba73('0x3d')][_0xba73('0x62')]({'where':{'id':_0x33db87[_0xba73('0x5f')]['id']}})[_0xba73('0x1e')](handleEntityNotFound(_0x523967,null))[_0xba73('0x1e')](function(_0x10d3d6){if(_0x10d3d6){_0x127bd4['model']=_['keys'](db['CannedAnswer'][_0xba73('0x3e')]);_0x127bd4[_0xba73('0x41')]=_[_0xba73('0x40')](_0x33db87[_0xba73('0x41')]);_0x127bd4[_0xba73('0x42')]=_[_0xba73('0x43')](_0x127bd4[_0xba73('0x3f')],_0x127bd4[_0xba73('0x41')]);_0x276523[_0xba73('0x44')]=_[_0xba73('0x43')](_0x127bd4[_0xba73('0x3f')],qs['fields'](_0x33db87['query']['fields']));_0x276523[_0xba73('0x44')]=_0x276523['attributes'][_0xba73('0x46')]?_0x276523[_0xba73('0x44')]:_0x127bd4[_0xba73('0x3f')];if(!_0x33db87[_0xba73('0x41')][_0xba73('0x47')](_0xba73('0x48'))){_0x276523[_0xba73('0x2e')]=qs['limit'](_0x33db87['query'][_0xba73('0x2e')]);_0x276523[_0xba73('0x2d')]=qs['offset'](_0x33db87[_0xba73('0x41')][_0xba73('0x2d')]);}_0x276523[_0xba73('0x49')]=qs[_0xba73('0x4a')](_0x33db87[_0xba73('0x41')]['sort']);_0x276523['where']=qs[_0xba73('0x42')](_['pick'](_0x33db87['query'],_0x127bd4[_0xba73('0x42')]));_0x276523[_0xba73('0x4c')][_0xba73('0x69')]=_0x10d3d6['id'];if(_0x33db87[_0xba73('0x41')][_0xba73('0x4b')]){_0x276523[_0xba73('0x4c')]=_[_0xba73('0x4d')](_0x276523[_0xba73('0x4c')],{'$or':_['map'](_0x276523[_0xba73('0x44')],function(_0xa5bc52){var _0x2170ff={};_0x2170ff[_0xa5bc52]={'$like':'%'+_0x33db87[_0xba73('0x41')][_0xba73('0x4b')]+'%'};return _0x2170ff;})});}_0x276523=_[_0xba73('0x4d')]({},_0x276523,_0x33db87[_0xba73('0x51')]);return db[_0xba73('0x6b')]['count']({'where':_0x276523['where']})[_0xba73('0x1e')](function(_0x5ea866){_0x9923ee[_0xba73('0x2c')]=_0x5ea866;if(_0x33db87['query']['includeAll']){_0x276523[_0xba73('0x53')]=[{'all':!![]}];}return db[_0xba73('0x6b')][_0xba73('0x54')](_0x276523);})['then'](function(_0x4842a8){_0x9923ee[_0xba73('0x65')]=_0x4842a8;return _0x9923ee;});}})['then'](respondWithFilteredResult(_0x523967,_0x276523))[_0xba73('0x28')](handleError(_0x523967,null));};exports[_0xba73('0x6c')]=function(_0xed4664,_0x179129,_0x21cc91){return db[_0xba73('0x3d')]['find']({'where':{'id':_0xed4664[_0xba73('0x5f')]['id']}})[_0xba73('0x1e')](handleEntityNotFound(_0x179129,null))['then'](function(_0x26521e){if(_0x26521e){return _0x26521e['removeAnswers'](_0xed4664['query'][_0xba73('0x67')]);}})['then'](respondWithStatusCode(_0x179129,null))['catch'](handleError(_0x179129,null));};exports['notify']=function(_0x4cc2c6,_0x22df73,_0x1eafd2){var _0x54145f={'body':_0x4cc2c6[_0xba73('0x58')],'channel':_0xba73('0x6d')};var _0x3bd1f6=[];var _0x5daa43=[];var _0x446477={};var _0x1f8fef=![];return db[_0xba73('0x6e')][_0xba73('0x61')]()[_0xba73('0x1e')](function(_0x340e41){if(!_0x340e41){throw new db[(_0xba73('0x6f'))][(_0xba73('0x70'))]('no\x20available\x20attributes');}_0x3bd1f6=_[_0xba73('0x71')](_['keys'](_0x340e41),['createdAt',_0xba73('0x72')]);_0x5daa43=_['difference'](_[_0xba73('0x40')](_0x340e41),[_0xba73('0x73'),'updatedAt','CompanyId','ListId']);if(_0x4cc2c6[_0xba73('0x58')]['id']){delete _0x4cc2c6['body']['id'];}if(_[_0xba73('0x74')](_0x4cc2c6[_0xba73('0x58')][_0xba73('0x75')])){throw new db[(_0xba73('0x6f'))][(_0xba73('0x70'))](_0xba73('0x76'));}if(_[_0xba73('0x74')](_0x4cc2c6[_0xba73('0x58')][_0xba73('0x58')])||_0x4cc2c6['body'][_0xba73('0x58')]===''){throw new db[(_0xba73('0x6f'))][(_0xba73('0x70'))](_0xba73('0x77'));}if(_[_0xba73('0x74')](_0x4cc2c6[_0xba73('0x58')][_0xba73('0x78')])){throw new db['Sequelize'][(_0xba73('0x70'))](_0xba73('0x79')+_0x5daa43);}if(!_['includes'](_0x5daa43,_0x4cc2c6[_0xba73('0x58')][_0xba73('0x78')])){throw new db['Sequelize'][(_0xba73('0x70'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5daa43);}_0x446477[_0x4cc2c6[_0xba73('0x58')]['mapKey']]=_0x4cc2c6[_0xba73('0x58')][_0xba73('0x75')];})[_0xba73('0x1e')](function(){return db[_0xba73('0x3d')][_0xba73('0x56')]({'where':{'id':_0x4cc2c6[_0xba73('0x5f')]['id']},'include':[{'model':db[_0xba73('0x7a')],'as':_0xba73('0x7b'),'include':[{'model':db[_0xba73('0x6e')],'as':_0xba73('0x7c'),'where':_0x446477,'limit':0x1,'order':[[_0xba73('0x72'),'DESC']]}]},{'model':db[_0xba73('0x7d')],'as':_0xba73('0x7e')}]});})['then'](handleEntityNotFound(_0x22df73,null))[_0xba73('0x1e')](function(_0x5d9a30){if(_0x5d9a30&&_0x5d9a30[_0xba73('0x7b')]){_0x54145f[_0xba73('0x7f')]=_0x5d9a30;_0x54145f[_0xba73('0x80')]=_0x5d9a30[_0xba73('0x7e')];_0x54145f[_0xba73('0x81')]=_0x5d9a30['List'];_0x54145f[_0xba73('0x80')]=_[_0xba73('0x82')](_0x54145f['applications'],[_0xba73('0x83')],[_0xba73('0x84')]);if(_0x54145f[_0xba73('0x7f')][_0xba73('0x7e')]){delete _0x54145f['account'][_0xba73('0x7e')];}if(_0x54145f[_0xba73('0x7f')][_0xba73('0x7b')]&&_0x54145f['account'][_0xba73('0x7b')][_0xba73('0x7c')][_0xba73('0x46')]){return _0x54145f[_0xba73('0x7f')]['List']['Contacts'][0x0];}var _0x46f71f=_[_0xba73('0x15')](_0x4cc2c6['body'],{'firstName':_0x4cc2c6[_0xba73('0x58')]['from'],'ListId':_0x5d9a30[_0xba73('0x85')]});_0x46f71f[_0x4cc2c6[_0xba73('0x58')][_0xba73('0x78')]]=_0x4cc2c6[_0xba73('0x58')]['from'];return db[_0xba73('0x6e')]['create'](_0x46f71f,{'fields':_0x3bd1f6,'raw':!![]});}})[_0xba73('0x1e')](handleEntityNotFound(_0x22df73,null))['then'](function(_0x323843){_0x54145f[_0xba73('0x86')]=_0x323843;if(_0x323843){var _0x47943d={'ContactId':_0x323843['id'],'OpenchannelAccountId':_0x4cc2c6[_0xba73('0x5f')]['id'],'from':(_0x323843[_0xba73('0x87')]||'')+'\x20'+(_0x323843['lastName']||'')};var _0xd3b888={'OpenchannelAccountId':_0x4cc2c6['params']['id'],'closed':![]};if(_0x4cc2c6[_0xba73('0x58')][_0xba73('0x88')]){_0xd3b888[_0xba73('0x88')]=_0x4cc2c6[_0xba73('0x58')]['threadId'];return db[_0xba73('0x89')][_0xba73('0x56')]({'where':_0xd3b888})[_0xba73('0x1e')](function(_0x40b55a){if(_0x40b55a){return[_0x40b55a,![]];}_0x47943d[_0xba73('0x88')]=_0x4cc2c6[_0xba73('0x58')][_0xba73('0x88')];_0x47943d[_0xba73('0x8a')]=_0x4cc2c6[_0xba73('0x58')][_0xba73('0x8a')];return db[_0xba73('0x89')][_0xba73('0x57')](_0x47943d)[_0xba73('0x1e')](function(_0x128afb){return[_0x128afb,!![]];});});}else{_0xd3b888['threadId']=null;}_0xd3b888[_0xba73('0x8b')]=_0x323843['id'];return db['OpenchannelInteraction'][_0xba73('0x56')]({'where':_0xd3b888})['then'](function(_0x372af4){if(_0x372af4){return[_0x372af4,![]];}return db[_0xba73('0x89')][_0xba73('0x57')](_0x47943d)[_0xba73('0x1e')](function(_0x379635){return[_0x379635,!![]];});});}})[_0xba73('0x8c')](function(_0xf66bfb,_0x56be07){if(_0xf66bfb){_0x1f8fef=_0x56be07;if(!_0x56be07){var _0x262452={'from':(_0x54145f[_0xba73('0x86')][_0xba73('0x87')]||'')+'\x20'+(_0x54145f[_0xba73('0x86')][_0xba73('0x8d')]||'')};if(_0x4cc2c6[_0xba73('0x58')][_0xba73('0x88')]&&_0x4cc2c6[_0xba73('0x58')][_0xba73('0x8e')]&&_0x4cc2c6[_0xba73('0x58')][_0xba73('0x88')]!=_0x4cc2c6[_0xba73('0x58')][_0xba73('0x8e')]){_0x262452[_0xba73('0x88')]=_0x4cc2c6[_0xba73('0x58')][_0xba73('0x8e')];}return _0xf66bfb[_0xba73('0x32')](_0x262452);}else{return _0xf66bfb;}}})[_0xba73('0x1e')](function(_0x48e911){_0x54145f[_0xba73('0x8f')]=_0x48e911[_0xba73('0x34')]({'plain':!![]});_0x54145f[_0xba73('0x8f')][_0xba73('0x90')]=_0x1f8fef;if(_0x54145f[_0xba73('0x8f')][_0xba73('0x90')]){if(_0x54145f[_0xba73('0x7f')][_0xba73('0x91')]){_0x54145f['applications']['push']({'id':0x0,'priority':_0x54145f[_0xba73('0x80')]['length']+0x1,'app':'close','appdata':'unmanaged','interval':_0xba73('0x92')});}}return db['OpenchannelMessage'][_0xba73('0x57')]({'body':_0x4cc2c6['body'][_0xba73('0x58')],'OpenchannelAccountId':_0x4cc2c6['params']['id'],'OpenchannelInteractionId':_0x48e911['id'],'direction':'in','ContactId':_0x54145f[_0xba73('0x86')]['id'],'AttachmentId':_0x4cc2c6['body'][_0xba73('0x93')]});})['then'](function(_0x309ab5){_0x54145f['message']=_0x309ab5;if(_0x54145f['interaction']['UserId']){return db[_0xba73('0x94')][_0xba73('0x56')]({'attributes':['id',_0xba73('0x39')],'where':{'id':_0x54145f[_0xba73('0x8f')][_0xba73('0x95')]}})[_0xba73('0x1e')](function(_0x74c9bf){if(_0x74c9bf){_0x54145f['applications'][_0xba73('0x96')]({'id':0x0,'priority':0x0,'app':_0xba73('0x97'),'appdata':_0x74c9bf[_0xba73('0x39')]+','+(_0x54145f['account'][_0xba73('0x98')]||0xa),'interval':_0xba73('0x92')});_0x54145f[_0xba73('0x99')]=![];}return respondWithRpcPromise('Start',_0xba73('0x9a'),_0x54145f);});}return respondWithRpcPromise('Start',_0xba73('0x9a'),_0x54145f);})[_0xba73('0x1e')](function(_0x2aafec){respondWithRpcPromise(_0xba73('0x9b'),'EventManager',{'event':_0xba73('0x9c'),'message':_0x2aafec},client9002);return _0x2aafec;})[_0xba73('0x1e')](respondWithResult(_0x22df73,null))[_0xba73('0x28')](handleError(_0x22df73,null));};exports[_0xba73('0x9d')]=function(_0x459fcc,_0x3e4039,_0x41a479){return db[_0xba73('0x3d')]['findOne']({'where':{'id':_0x459fcc[_0xba73('0x5f')]['id']}})[_0xba73('0x1e')](handleEntityNotFound(_0x3e4039,null))[_0xba73('0x1e')](function(_0x3f7bcd){if(_0x3f7bcd){return db['sequelize'][_0xba73('0x9e')](function(_0x4d1eae){return db['OpenchannelApplication']['destroy']({'where':{'OpenchannelAccountId':_0x459fcc[_0xba73('0x5f')]['id']},'transaction':_0x4d1eae})['then'](function(_0x2d6e83){var _0x11651a=_[_0xba73('0x64')](_0x459fcc[_0xba73('0x58')],function(_0x2b8e0e){_0x2b8e0e['OpenchannelAccountId']=_0x459fcc['params']['id'];return _0x2b8e0e;});return db[_0xba73('0x7d')][_0xba73('0x9f')](_0x11651a,{'transaction':_0x4d1eae});});})[_0xba73('0x1e')](function(){return db[_0xba73('0x7d')][_0xba73('0xa0')]({'where':{'OpenchannelAccountId':_0x459fcc[_0xba73('0x5f')]['id']},'order':_0xba73('0x83')});});}})[_0xba73('0x1e')](respondWithResult(_0x3e4039,null))[_0xba73('0x28')](handleError(_0x3e4039,null));};exports['getApplications']=function(_0x291fa8,_0x18800b,_0x1eff15){var _0x5449c3={};var _0xedc2a9={};var _0x17db02;var _0x409b99;return db[_0xba73('0x3d')][_0xba73('0x62')]({'where':{'id':_0x291fa8[_0xba73('0x5f')]['id']}})['then'](handleEntityNotFound(_0x18800b,null))[_0xba73('0x1e')](function(_0x7c685c){if(_0x7c685c){_0x17db02=_0x7c685c;_0xedc2a9[_0xba73('0x3f')]=_[_0xba73('0x40')](db[_0xba73('0x7d')][_0xba73('0x3e')]);_0xedc2a9[_0xba73('0x41')]=_[_0xba73('0x40')](_0x291fa8[_0xba73('0x41')]);_0xedc2a9['filters']=_['intersection'](_0xedc2a9[_0xba73('0x3f')],_0xedc2a9['query']);_0x5449c3[_0xba73('0x44')]=_['intersection'](_0xedc2a9['model'],qs[_0xba73('0x45')](_0x291fa8['query']['fields']));_0x5449c3[_0xba73('0x44')]=_0x5449c3[_0xba73('0x44')][_0xba73('0x46')]?_0x5449c3['attributes']:_0xedc2a9[_0xba73('0x3f')];_0x5449c3[_0xba73('0x49')]=qs[_0xba73('0x4a')](_0x291fa8[_0xba73('0x41')][_0xba73('0x4a')]);_0x5449c3[_0xba73('0x4c')]=qs[_0xba73('0x42')](_['pick'](_0x291fa8[_0xba73('0x41')],_0xedc2a9[_0xba73('0x42')]));if(_0x291fa8['query'][_0xba73('0x4b')]){_0x5449c3[_0xba73('0x4c')]=_[_0xba73('0x4d')](_0x5449c3[_0xba73('0x4c')],{'$or':_[_0xba73('0x64')](_0x5449c3[_0xba73('0x44')],function(_0x34ab50){var _0x1a4a52={};_0x1a4a52[_0x34ab50]={'$like':'%'+_0x291fa8[_0xba73('0x41')][_0xba73('0x4b')]+'%'};return _0x1a4a52;})});}_0x5449c3=_[_0xba73('0x4d')]({},_0x5449c3,_0x291fa8['options']);return _0x17db02[_0xba73('0xa1')](_0x5449c3);}})[_0xba73('0x1e')](function(_0x3bf9f6){if(_0x3bf9f6){_0x409b99=_0x3bf9f6['length'];if(!_0x291fa8['query'][_0xba73('0x47')](_0xba73('0x48'))){_0x5449c3[_0xba73('0x2e')]=qs[_0xba73('0x2e')](_0x291fa8[_0xba73('0x41')][_0xba73('0x2e')]);_0x5449c3[_0xba73('0x2d')]=qs[_0xba73('0x2d')](_0x291fa8[_0xba73('0x41')]['offset']);}return _0x17db02[_0xba73('0xa1')](_0x5449c3);}})[_0xba73('0x1e')](function(_0xf02509){if(_0xf02509){return _0xf02509?{'count':_0x409b99,'rows':_0xf02509}:null;}})['then'](respondWithResult(_0x18800b,null))[_0xba73('0x28')](handleError(_0x18800b,null));};exports[_0xba73('0xa2')]=function(_0x1d0143,_0x125ae1,_0x50c083){var _0x13777f={'raw':![],'where':{}};var _0x2f1304={};var _0x2dc9fe={'count':0x0,'rows':[]};return db[_0xba73('0x3d')][_0xba73('0x62')]({'where':{'id':_0x1d0143[_0xba73('0x5f')]['id']}})[_0xba73('0x1e')](handleEntityNotFound(_0x125ae1,null))['then'](function(_0x14ecf8){if(_0x14ecf8){_0x2f1304[_0xba73('0x3f')]=_[_0xba73('0x40')](db[_0xba73('0x89')][_0xba73('0x3e')]);_0x2f1304[_0xba73('0x41')]=_['keys'](_0x1d0143[_0xba73('0x41')]);_0x2f1304[_0xba73('0x42')]=_[_0xba73('0x43')](_0x2f1304[_0xba73('0x3f')],_0x2f1304[_0xba73('0x41')]);_0x13777f[_0xba73('0x44')]=_[_0xba73('0x43')](_0x2f1304[_0xba73('0x3f')],qs[_0xba73('0x45')](_0x1d0143[_0xba73('0x41')][_0xba73('0x45')]));_0x13777f['attributes']=_0x13777f[_0xba73('0x44')][_0xba73('0x46')]?_0x13777f['attributes']:_0x2f1304[_0xba73('0x3f')];if(!_0x1d0143['query'][_0xba73('0x47')](_0xba73('0x48'))){_0x13777f[_0xba73('0x2e')]=qs[_0xba73('0x2e')](_0x1d0143[_0xba73('0x41')][_0xba73('0x2e')]);_0x13777f[_0xba73('0x2d')]=qs[_0xba73('0x2d')](_0x1d0143[_0xba73('0x41')][_0xba73('0x2d')]);}_0x13777f['order']=qs['sort'](_0x1d0143[_0xba73('0x41')][_0xba73('0x4a')]);_0x13777f[_0xba73('0x4c')]=qs['filters'](_['pick'](_0x1d0143[_0xba73('0x41')],_0x2f1304[_0xba73('0x42')]));_0x13777f[_0xba73('0x4c')]['OpenchannelAccountId']=_0x14ecf8['id'];if(_0x1d0143['query']['filter']){_0x13777f[_0xba73('0x4c')]=_[_0xba73('0x4d')](_0x13777f[_0xba73('0x4c')],{'$or':_[_0xba73('0x64')](_0x13777f[_0xba73('0x44')],function(_0x324c83){var _0x2625c2={};_0x2625c2[_0x324c83]={'$like':'%'+_0x1d0143[_0xba73('0x41')]['filter']+'%'};return _0x2625c2;})});}_0x13777f=_[_0xba73('0x4d')]({},_0x13777f,_0x1d0143[_0xba73('0x51')]);return db[_0xba73('0x89')][_0xba73('0x2c')]({'where':_0x13777f[_0xba73('0x4c')]})[_0xba73('0x1e')](function(_0x437937){_0x2dc9fe[_0xba73('0x2c')]=_0x437937;if(_0x1d0143['query'][_0xba73('0x52')]){_0x13777f[_0xba73('0x53')]=[{'model':db[_0xba73('0x6e')],'as':_0xba73('0xa3'),'required':![]},{'model':db['User'],'as':_0xba73('0xa4'),'attributes':[_0xba73('0x39'),_0xba73('0xa5'),_0xba73('0xa6')],'required':![]},{'model':db[_0xba73('0xa7')],'as':_0xba73('0xa8'),'attributes':['id',_0xba73('0x39'),_0xba73('0xa9')],'where':_0x1d0143['query']['tag']?{'id':_0x1d0143[_0xba73('0x41')][_0xba73('0xaa')]}:undefined,'required':_0x1d0143['query'][_0xba73('0xaa')]?!![]:![]}];}return db[_0xba73('0x89')]['findAll'](_0x13777f);})['then'](function(_0x5553b2){_0x2dc9fe[_0xba73('0x65')]=_0x5553b2;return _0x2dc9fe;});}})[_0xba73('0x1e')](respondWithFilteredResult(_0x125ae1,_0x13777f))[_0xba73('0x28')](handleError(_0x125ae1,null));};exports['addAgents']=function(_0x2a1f0e,_0x25fddc,_0x678f67){return db[_0xba73('0x3d')]['find']({'where':{'id':_0x2a1f0e['params']['id']}})[_0xba73('0x1e')](handleEntityNotFound(_0x25fddc,null))[_0xba73('0x1e')](function(_0x4078ea){if(_0x4078ea){return _0x4078ea[_0xba73('0xab')](_0x2a1f0e[_0xba73('0x58')][_0xba73('0x67')],_[_0xba73('0xac')](_0x2a1f0e[_0xba73('0x58')],['ids','id'])||{})[_0xba73('0x8c')](function(_0x19bbe6){for(var _0x258775=0x0;_0x258775<_0x2a1f0e[_0xba73('0x58')][_0xba73('0x67')][_0xba73('0x46')];_0x258775+=0x1){socket[_0xba73('0xad')](_0xba73('0xae'),{'UserId':_0x2a1f0e['body'][_0xba73('0x67')][_0x258775],'OpenchannelAccountId':_0x2a1f0e['params']['id']});}return _0x19bbe6;});}})[_0xba73('0x1e')](respondWithResult(_0x25fddc,null))['catch'](handleError(_0x25fddc,null));};exports[_0xba73('0xaf')]=function(_0x5b93f8,_0x396274,_0x3b8774){return db[_0xba73('0x3d')]['find']({'where':{'id':_0x5b93f8['params']['id']}})[_0xba73('0x1e')](handleEntityNotFound(_0x396274,null))['then'](function(_0x564503){if(_0x564503){return _0x564503['removeAgents'](_0x5b93f8[_0xba73('0x41')][_0xba73('0x67')])[_0xba73('0x1e')](function(){if(_[_0xba73('0xb0')](_0x5b93f8[_0xba73('0x41')][_0xba73('0x67')])){for(var _0x1bd5a8=0x0;_0x1bd5a8<_0x5b93f8[_0xba73('0x41')][_0xba73('0x67')]['length'];_0x1bd5a8+=0x1){socket[_0xba73('0xad')](_0xba73('0xb1'),{'UserId':Number(_0x5b93f8[_0xba73('0x41')][_0xba73('0x67')][_0x1bd5a8]),'OpenchannelAccountId':Number(_0x5b93f8[_0xba73('0x5f')]['id'])});}}else{socket[_0xba73('0xad')]('userOpenchannelAccount:remove',{'UserId':Number(_0x5b93f8['query'][_0xba73('0x67')]),'OpenchannelAccountId':Number(_0x5b93f8[_0xba73('0x5f')]['id'])});}});}})['then'](respondWithStatusCode(_0x396274,null))[_0xba73('0x28')](handleError(_0x396274,null));};exports[_0xba73('0xb2')]=function(_0x197932,_0x1271e9,_0x5b5d22){var _0x2b199a={};var _0x3fa20b={};var _0x5eae93;var _0x25e7a4;return db[_0xba73('0x3d')][_0xba73('0x62')]({'where':{'id':_0x197932[_0xba73('0x5f')]['id']}})['then'](handleEntityNotFound(_0x1271e9,null))[_0xba73('0x1e')](function(_0x224e32){if(_0x224e32){_0x5eae93=_0x224e32;_0x3fa20b[_0xba73('0x3f')]=_[_0xba73('0x40')](db[_0xba73('0x94')][_0xba73('0x3e')]);_0x3fa20b[_0xba73('0x41')]=_[_0xba73('0x40')](_0x197932[_0xba73('0x41')]);_0x3fa20b[_0xba73('0x42')]=_[_0xba73('0x43')](_0x3fa20b[_0xba73('0x3f')],_0x3fa20b[_0xba73('0x41')]);_0x2b199a[_0xba73('0x44')]=_['intersection'](_0x3fa20b[_0xba73('0x3f')],qs[_0xba73('0x45')](_0x197932[_0xba73('0x41')][_0xba73('0x45')]));_0x2b199a['attributes']=_0x2b199a[_0xba73('0x44')][_0xba73('0x46')]?_0x2b199a[_0xba73('0x44')]:_0x3fa20b[_0xba73('0x3f')];_0x2b199a[_0xba73('0x49')]=qs[_0xba73('0x4a')](_0x197932[_0xba73('0x41')][_0xba73('0x4a')]);_0x2b199a[_0xba73('0x4c')]=qs[_0xba73('0x42')](_[_0xba73('0xb3')](_0x197932['query'],_0x3fa20b[_0xba73('0x42')]));if(_0x197932[_0xba73('0x41')][_0xba73('0x4b')]){_0x2b199a['where']=_['merge'](_0x2b199a[_0xba73('0x4c')],{'$or':_[_0xba73('0x64')](_0x2b199a[_0xba73('0x44')],function(_0x141d88){var _0x45506d={};_0x45506d[_0x141d88]={'$like':'%'+_0x197932[_0xba73('0x41')][_0xba73('0x4b')]+'%'};return _0x45506d;})});}_0x2b199a=_[_0xba73('0x4d')]({},_0x2b199a,_0x197932[_0xba73('0x51')]);return _0x5eae93[_0xba73('0xb2')](_0x2b199a);}})[_0xba73('0x1e')](function(_0x3933ae){if(_0x3933ae){_0x25e7a4=_0x3933ae[_0xba73('0x46')];if(!_0x197932['query'][_0xba73('0x47')](_0xba73('0x48'))){_0x2b199a[_0xba73('0x2e')]=qs[_0xba73('0x2e')](_0x197932['query'][_0xba73('0x2e')]);_0x2b199a[_0xba73('0x2d')]=qs[_0xba73('0x2d')](_0x197932[_0xba73('0x41')][_0xba73('0x2d')]);}return _0x5eae93[_0xba73('0xb2')](_0x2b199a);}})[_0xba73('0x1e')](function(_0x7696e3){if(_0x7696e3){return _0x7696e3?{'count':_0x25e7a4,'rows':_0x7696e3}:null;}})[_0xba73('0x1e')](respondWithResult(_0x1271e9,null))[_0xba73('0x28')](handleError(_0x1271e9,null));};exports[_0xba73('0x3a')]=function(_0x452467,_0x56ab6a,_0x1005a5){var _0x2ef337,_0x35d5ba,_0x56e7a1;if(_[_0xba73('0x74')](_0x452467[_0xba73('0x58')][_0xba73('0x58')])||_0x452467[_0xba73('0x58')]['body']===''){throw new db[(_0xba73('0x6f'))][(_0xba73('0x70'))](_0xba73('0x77'));}if(_[_0xba73('0x74')](_0x452467['body']['to'])){}_0x2ef337=_0x452467[_0xba73('0x58')]['to'];return db[_0xba73('0x3d')][_0xba73('0x62')]({'where':{'id':_0x452467['params']['id']}})['then'](handleEntityNotFound(_0x56ab6a,null))['then'](function(_0x4c390b){if(_0x4c390b){return db[_0xba73('0x3d')]['find']({'where':{'id':_0x4c390b['id']},'include':[{'model':db[_0xba73('0x7a')],'as':_0xba73('0x7b'),'include':[{'model':db[_0xba73('0x6e')],'as':_0xba73('0x7c'),'where':{[_0x4c390b[_0xba73('0x78')]]:_0x2ef337},'limit':0x1,'order':[['updatedAt',_0xba73('0xb4')]]}]}]})[_0xba73('0x1e')](handleEntityNotFound(_0x56ab6a,null))['then'](function(_0x9899a7){if(_0x9899a7&&_0x9899a7[_0xba73('0x7b')]){_0x35d5ba=_0x9899a7[_0xba73('0x34')]({'plain':!![]});if(_0x35d5ba[_0xba73('0x7b')]&&_0x35d5ba[_0xba73('0x7b')][_0xba73('0x7c')]['length']){return _0x35d5ba[_0xba73('0x7b')][_0xba73('0x7c')][0x0];}return db[_0xba73('0x6e')][_0xba73('0x57')](_[_0xba73('0x15')](_0x452467[_0xba73('0x58')],{'firstName':_0x2ef337,[_0x9899a7[_0xba73('0x78')]]:_0x2ef337,'phone':_0x2ef337,'ListId':_0x35d5ba[_0xba73('0x85')]}));}})[_0xba73('0x1e')](handleEntityNotFound(_0x56ab6a,null))[_0xba73('0x1e')](function(_0x38213d){if(_0x38213d){_0x56e7a1=_0x38213d;return db[_0xba73('0x89')][_0xba73('0x56')]({'where':{'ContactId':_0x56e7a1['id'],'closed':![],'OpenchannelAccountId':_0x35d5ba['id']}})['then'](function(_0x462962){if(_0x462962){return[_0x462962,![]];}return db[_0xba73('0x89')][_0xba73('0x57')]({'UserId':_0x452467[_0xba73('0x59')]['id'],'ContactId':_0x56e7a1['id'],'OpenchannelAccountId':_0x35d5ba['id'],'lastMsgDirection':'out','Messages':[_[_0xba73('0x4d')](_0x452467['body'],{'read':![],'body':_0x452467[_0xba73('0x58')][_0xba73('0x58')],'OpenchannelAccountId':_0x35d5ba['id'],'UserId':_0x452467[_0xba73('0x59')]['id'],'ContactId':_0x56e7a1['id']})]},{'include':[{'model':db[_0xba73('0xb5')],'as':_0xba73('0xb6')}]})['then'](function(_0xb0f4ec){return[_0xb0f4ec,!![]];});});}})[_0xba73('0x8c')](function(_0x27b317,_0x5eb59a){if(_0x5eb59a){return _0x27b317;}return db[_0xba73('0xb5')][_0xba73('0x57')](_[_0xba73('0x4d')](_0x452467[_0xba73('0x58')],{'read':![],'body':_0x452467['body']['body'],'OpenchannelAccountId':_0x35d5ba['id'],'OpenchannelInteractionId':_0x27b317['id'],'UserId':_0x452467['user']['id'],'ContactId':_0x56e7a1['id']}))[_0xba73('0x1e')](function(_0x4612df){_0x27b317[_0xba73('0xb7')][_0xba73('0xb6')]=[];_0x27b317[_0xba73('0xb7')][_0xba73('0xb6')][_0xba73('0xb8')](_0x4612df[_0xba73('0xb7')]);return _0x27b317;});});}})[_0xba73('0x1e')](respondWithResult(_0x56ab6a,null))['catch'](handleError(_0x56ab6a,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index c1333ca..721315f 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 _0x93e9=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelAccount','setMaxListeners','save'];(function(_0x5d8954,_0x34c869){var _0x2040ea=function(_0x1aa670){while(--_0x1aa670){_0x5d8954['push'](_0x5d8954['shift']());}};_0x2040ea(++_0x34c869);}(_0x93e9,0xcc));var _0x993e=function(_0x5a2da5,_0x12e6c3){_0x5a2da5=_0x5a2da5-0x0;var _0x477530=_0x93e9[_0x5a2da5];return _0x477530;};'use strict';var EventEmitter=require(_0x993e('0x0'));var OpenchannelAccount=require(_0x993e('0x1'))['db'][_0x993e('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x993e('0x3')](0x0);var events={'afterCreate':_0x993e('0x4'),'afterUpdate':_0x993e('0x5'),'afterDestroy':_0x993e('0x6')};function emitEvent(_0x47e31b){return function(_0x55f739,_0x1b762e,_0x255045){OpenchannelAccountEvents[_0x993e('0x7')](_0x47e31b+':'+_0x55f739['id'],_0x55f739);OpenchannelAccountEvents[_0x993e('0x7')](_0x47e31b,_0x55f739);_0x255045(null);};}for(var e in events){if(events[_0x993e('0x8')](e)){var event=events[e];OpenchannelAccount[_0x993e('0x9')](e,emitEvent(event));}}module[_0x993e('0xa')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xbde2=['emit','hasOwnProperty','hook','events','../../mysqldb','OpenchannelAccount','setMaxListeners','save','update'];(function(_0x1d890b,_0x74a65b){var _0x351246=function(_0x68756e){while(--_0x68756e){_0x1d890b['push'](_0x1d890b['shift']());}};_0x351246(++_0x74a65b);}(_0xbde2,0x111));var _0x2bde=function(_0x48cd8b,_0x436a40){_0x48cd8b=_0x48cd8b-0x0;var _0x1f0eba=_0xbde2[_0x48cd8b];return _0x1f0eba;};'use strict';var EventEmitter=require(_0x2bde('0x0'));var OpenchannelAccount=require(_0x2bde('0x1'))['db'][_0x2bde('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x2bde('0x3')](0x0);var events={'afterCreate':_0x2bde('0x4'),'afterUpdate':_0x2bde('0x5'),'afterDestroy':'remove'};function emitEvent(_0xb82ff){return function(_0x12729e,_0x24d16c,_0x85ba82){OpenchannelAccountEvents[_0x2bde('0x6')](_0xb82ff+':'+_0x12729e['id'],_0x12729e);OpenchannelAccountEvents[_0x2bde('0x6')](_0xb82ff,_0x12729e);_0x85ba82(null);};}for(var e in events){if(events[_0x2bde('0x7')](e)){var event=events[e];OpenchannelAccount[_0x2bde('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index c10993d..1655612 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 _0x1707=['api','moment','bluebird','request-promise','path','../../config/environment','./openchannelAccount.attributes','exports','define','openchannel_accounts','lodash','../../config/logger'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x1707,0x11e));var _0x7170=function(_0x169e35,_0x2cacf1){_0x169e35=_0x169e35-0x0;var _0x25f3b3=_0x1707[_0x169e35];return _0x25f3b3;};'use strict';var _=require(_0x7170('0x0'));var util=require('util');var logger=require(_0x7170('0x1'))(_0x7170('0x2'));var moment=require(_0x7170('0x3'));var BPromise=require(_0x7170('0x4'));var rp=require(_0x7170('0x5'));var fs=require('fs');var path=require(_0x7170('0x6'));var rimraf=require('rimraf');var config=require(_0x7170('0x7'));var attributes=require(_0x7170('0x8'));module[_0x7170('0x9')]=function(_0x31eee9,_0x985397){return _0x31eee9[_0x7170('0xa')]('OpenchannelAccount',attributes,{'tableName':_0x7170('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7c22=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','util'];(function(_0x56a061,_0x53fb1b){var _0x105fa0=function(_0x164d08){while(--_0x164d08){_0x56a061['push'](_0x56a061['shift']());}};_0x105fa0(++_0x53fb1b);}(_0x7c22,0x1bf));var _0x27c2=function(_0x1b4ca1,_0x6ccc40){_0x1b4ca1=_0x1b4ca1-0x0;var _0xe52a00=_0x7c22[_0x1b4ca1];return _0xe52a00;};'use strict';var _=require('lodash');var util=require(_0x27c2('0x0'));var logger=require(_0x27c2('0x1'))(_0x27c2('0x2'));var moment=require(_0x27c2('0x3'));var BPromise=require(_0x27c2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x27c2('0x5'));var rimraf=require(_0x27c2('0x6'));var config=require(_0x27c2('0x7'));var attributes=require('./openchannelAccount.attributes');module['exports']=function(_0x138b4a,_0x19e473){return _0x138b4a['define']('OpenchannelAccount',attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.rpc.js b/server/api/openchannelAccount/openchannelAccount.rpc.js index 1750b93..600779e 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 _0x1261=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./openchannelAccount.socket','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','util'];(function(_0x1446e7,_0x48d058){var _0x141842=function(_0x1d2c6f){while(--_0x1d2c6f){_0x1446e7['push'](_0x1446e7['shift']());}};_0x141842(++_0x48d058);}(_0x1261,0x144));var _0x1126=function(_0x1e393b,_0x355f6b){_0x1e393b=_0x1e393b-0x0;var _0x3d0bfe=_0x1261[_0x1e393b];return _0x3d0bfe;};'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']('OpenchannelAccount,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x34571c(_0x15c071[_0x1126('0x14')]['message']);}logger[_0x1126('0x14')]('OpenchannelAccount,\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);});});} \ 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(_0x4d9d88,_0x7088fd){var _0x4dba70=function(_0x9316e5){while(--_0x9316e5){_0x4d9d88['push'](_0x4d9d88['shift']());}};_0x4dba70(++_0x7088fd);}(_0xe14b,0x93));var _0xbe14=function(_0x27843c,_0x39a824){_0x27843c=_0x27843c-0x0;var _0x253f27=_0xe14b[_0x27843c];return _0x253f27;};'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 ddcfd1a..a3e22c7 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 _0x781e=['register','length','openchannelAccount:','./openchannelAccount.events','remove','update','removeListener'];(function(_0x3f89ae,_0x2e6732){var _0x315126=function(_0x5369a7){while(--_0x5369a7){_0x3f89ae['push'](_0x3f89ae['shift']());}};_0x315126(++_0x2e6732);}(_0x781e,0x16f));var _0xe781=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x781e[_0x17d9e3];return _0x14192d;};'use strict';var OpenchannelAccountEvents=require(_0xe781('0x0'));var events=['save',_0xe781('0x1'),_0xe781('0x2')];function createListener(_0x43708c,_0x5214f4){return function(_0x51f346){_0x5214f4['emit'](_0x43708c,_0x51f346);};}function removeListener(_0x54a9b8,_0x41d78c){return function(){OpenchannelAccountEvents[_0xe781('0x3')](_0x54a9b8,_0x41d78c);};}exports[_0xe781('0x4')]=function(_0x46cd7c){for(var _0x5c417d=0x0,_0x29d072=events[_0xe781('0x5')];_0x5c417d<_0x29d072;_0x5c417d++){var _0x491874=events[_0x5c417d];var _0xeda76b=createListener(_0xe781('0x6')+_0x491874,_0x46cd7c);OpenchannelAccountEvents['on'](_0x491874,_0xeda76b);}}; \ No newline at end of file +var _0xb73a=['./openchannelAccount.events','save','remove','update','emit','removeListener','register','openchannelAccount:'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xb73a,0x90));var _0xab73=function(_0x41a71f,_0x4ba927){_0x41a71f=_0x41a71f-0x0;var _0xf5f37e=_0xb73a[_0x41a71f];return _0xf5f37e;};'use strict';var OpenchannelAccountEvents=require(_0xab73('0x0'));var events=[_0xab73('0x1'),_0xab73('0x2'),_0xab73('0x3')];function createListener(_0x4b9572,_0x4a4d57){return function(_0x2ce2ea){_0x4a4d57[_0xab73('0x4')](_0x4b9572,_0x2ce2ea);};}function removeListener(_0x42b129,_0x91e8ed){return function(){OpenchannelAccountEvents[_0xab73('0x5')](_0x42b129,_0x91e8ed);};}exports[_0xab73('0x6')]=function(_0x5b5afe){for(var _0xfc86f2=0x0,_0x3cbce3=events['length'];_0xfc86f2<_0x3cbce3;_0xfc86f2++){var _0x298d26=events[_0xfc86f2];var _0x4661d6=createListener(_0xab73('0x7')+_0x298d26,_0x5b5afe);OpenchannelAccountEvents['on'](_0x298d26,_0x4661d6);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index cda9647..5fdc0a7 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 _0x2749=['exports','express','Router','../../components/auth/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','show','post','/:id','delete'];(function(_0x206154,_0x2aaba7){var _0x1994be=function(_0x96a783){while(--_0x96a783){_0x206154['push'](_0x206154['shift']());}};_0x1994be(++_0x2aaba7);}(_0x2749,0xf8));var _0x9274=function(_0x10c4a2,_0x4c93ea){_0x10c4a2=_0x10c4a2-0x0;var _0x36fed1=_0x2749[_0x10c4a2];return _0x36fed1;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9274('0x0'));var router=express[_0x9274('0x1')]();var auth=require(_0x9274('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x9274('0x3'));var controller=require(_0x9274('0x4'));router[_0x9274('0x5')]('/',auth[_0x9274('0x6')](),controller[_0x9274('0x7')]);router[_0x9274('0x5')]('/:id',auth[_0x9274('0x6')](),controller[_0x9274('0x8')]);router[_0x9274('0x9')]('/',auth[_0x9274('0x6')](),controller['create']);router['put'](_0x9274('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x9274('0xb')](_0x9274('0xa'),auth[_0x9274('0x6')](),controller['destroy']);module[_0x9274('0xc')]=router; \ No newline at end of file +var _0x93da=['path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','create','update','delete','exports','util'];(function(_0x49f374,_0x2b504d){var _0x23ff88=function(_0x277925){while(--_0x277925){_0x49f374['push'](_0x49f374['shift']());}};_0x23ff88(++_0x2b504d);}(_0x93da,0x12f));var _0xa93d=function(_0x2bf501,_0x90d4d4){_0x2bf501=_0x2bf501-0x0;var _0x20fd36=_0x93da[_0x2bf501];return _0x20fd36;};'use strict';var multer=require('multer');var util=require(_0xa93d('0x0'));var path=require(_0xa93d('0x1'));var timeout=require(_0xa93d('0x2'));var express=require('express');var router=express[_0xa93d('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xa93d('0x4'));var config=require(_0xa93d('0x5'));var controller=require(_0xa93d('0x6'));router[_0xa93d('0x7')]('/',auth[_0xa93d('0x8')](),controller[_0xa93d('0x9')]);router['get'](_0xa93d('0xa'),auth[_0xa93d('0x8')](),controller[_0xa93d('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa93d('0xc')]);router['put']('/:id',auth[_0xa93d('0x8')](),controller[_0xa93d('0xd')]);router[_0xa93d('0xe')](_0xa93d('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xa93d('0xf')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 82f35e8..ffc4031 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 _0x414f=['INTEGER','STRING','TEXT','*,*,*,*','sequelize'];(function(_0x196a9c,_0x3424c3){var _0xaacf2f=function(_0x5c976b){while(--_0x5c976b){_0x196a9c['push'](_0x196a9c['shift']());}};_0xaacf2f(++_0x3424c3);}(_0x414f,0x13f));var _0xf414=function(_0x7cacf9,_0x6dac99){_0x7cacf9=_0x7cacf9-0x0;var _0xde6456=_0x414f[_0x7cacf9];return _0xde6456;};'use strict';var Sequelize=require(_0xf414('0x0'));module['exports']={'priority':{'type':Sequelize[_0xf414('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xf414('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xf414('0x3')]()},'description':{'type':Sequelize[_0xf414('0x2')]},'interval':{'type':Sequelize[_0xf414('0x2')],'defaultValue':_0xf414('0x4')}}; \ No newline at end of file +var _0x930b=['STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x179e11,_0xf65436){var _0x549f04=function(_0x610545){while(--_0x610545){_0x179e11['push'](_0x179e11['shift']());}};_0x549f04(++_0xf65436);}(_0x930b,0x106));var _0xb930=function(_0x18ed89,_0x366a81){_0x18ed89=_0x18ed89-0x0;var _0x21cd8a=_0x930b[_0x18ed89];return _0x21cd8a;};'use strict';var Sequelize=require(_0xb930('0x0'));module[_0xb930('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xb930('0x2')],'allowNull':![],'defaultValue':_0xb930('0x3')},'appdata':{'type':Sequelize[_0xb930('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xb930('0x5')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 402b034..477f916 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 _0x3a03=['type','VIRTUAL','field','options','OpenchannelApplication','include','rows','show','params','includeAll','catch','create','body','find','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','apply','reject','update','then','destroy','end','sendStatus','stack','name','send','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filter','merge','map'];(function(_0x7bc4a8,_0x19022a){var _0x4a13e9=function(_0x43ac34){while(--_0x43ac34){_0x7bc4a8['push'](_0x7bc4a8['shift']());}};_0x4a13e9(++_0x19022a);}(_0x3a03,0x94));var _0x33a0=function(_0x473171,_0x32d3aa){_0x473171=_0x473171-0x0;var _0xd9f010=_0x3a03[_0x473171];return _0xd9f010;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x33a0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x33a0('0x1'));var rp=require(_0x33a0('0x2'));var moment=require(_0x33a0('0x3'));var BPromise=require(_0x33a0('0x4'));var Mustache=require(_0x33a0('0x5'));var util=require(_0x33a0('0x6'));var path=require(_0x33a0('0x7'));var sox=require(_0x33a0('0x8'));var csv=require(_0x33a0('0x9'));var ejs=require(_0x33a0('0xa'));var fs=require('fs');var _=require(_0x33a0('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x33a0('0xc'));var deskjs=require(_0x33a0('0xd'));var toCsv=require(_0x33a0('0x9'));var querystring=require(_0x33a0('0xe'));var Papa=require(_0x33a0('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x33a0('0x10'));var logger=require(_0x33a0('0x11'))(_0x33a0('0x12'));var utils=require(_0x33a0('0x13'));var config=require(_0x33a0('0x14'));var db=require(_0x33a0('0x15'))['db'];function respondWithStatusCode(_0x420f83,_0x4d2069){_0x4d2069=_0x4d2069||0xcc;return function(_0x2cb551){if(_0x2cb551){return _0x420f83['sendStatus'](_0x4d2069);}return _0x420f83[_0x33a0('0x16')](_0x4d2069)['end']();};}function respondWithResult(_0x26cb99,_0x532d8c){_0x532d8c=_0x532d8c||0xc8;return function(_0x37e902){if(_0x37e902){return _0x26cb99[_0x33a0('0x16')](_0x532d8c)[_0x33a0('0x17')](_0x37e902);}};}function respondWithFilteredResult(_0x4932c2,_0xbd6149){return function(_0x5a0624){if(_0x5a0624){var _0x59fdc0=_0x5a0624[_0x33a0('0x18')],_0x452bce=_0xbd6149[_0x33a0('0x19')],_0x20143e=_0xbd6149[_0x33a0('0x19')]+_0xbd6149['limit'],_0x5074cc;if(_0x20143e>=_0x59fdc0){_0x20143e=_0x59fdc0;_0x5074cc=0xc8;}else{_0x5074cc=0xce;}_0x4932c2[_0x33a0('0x16')](_0x5074cc);return _0x4932c2['set']('Content-Range',_0x452bce+'-'+_0x20143e+'/'+_0x59fdc0)[_0x33a0('0x17')](_0x5a0624);}return null;};}function patchUpdates(_0x2ff1ee){return function(_0x5963a9){try{jsonpatch[_0x33a0('0x1a')](_0x5963a9,_0x2ff1ee,!![]);}catch(_0x20723e){return BPromise[_0x33a0('0x1b')](_0x20723e);}return _0x5963a9['save']();};}function saveUpdates(_0x5b8df3,_0x138469){return function(_0x59a24d){if(_0x59a24d){return _0x59a24d[_0x33a0('0x1c')](_0x5b8df3)[_0x33a0('0x1d')](function(_0x35f550){return _0x35f550;});}return null;};}function removeEntity(_0x2409ef,_0x40e909){return function(_0x22fb33){if(_0x22fb33){return _0x22fb33[_0x33a0('0x1e')]()[_0x33a0('0x1d')](function(){_0x2409ef[_0x33a0('0x16')](0xcc)[_0x33a0('0x1f')]();});}};}function handleEntityNotFound(_0x11329e,_0x107548){return function(_0x49b969){if(!_0x49b969){_0x11329e[_0x33a0('0x20')](0x194);}return _0x49b969;};}function handleError(_0x2c758f,_0x19fc4b){_0x19fc4b=_0x19fc4b||0x1f4;return function(_0x543b07){logger['error'](_0x543b07[_0x33a0('0x21')]);if(_0x543b07[_0x33a0('0x22')]){delete _0x543b07[_0x33a0('0x22')];}_0x2c758f['status'](_0x19fc4b)[_0x33a0('0x23')](_0x543b07);};}exports['index']=function(_0x564fbe,_0x2a4c02){var _0x3ace86={},_0x4d5c39={},_0x437b34={'count':0x0,'rows':[]};var _0x4fe015=db['OpenchannelApplication'][_0x33a0('0x24')];_0x4d5c39[_0x33a0('0x25')]=_[_0x33a0('0x26')](_0x4fe015);_0x4d5c39[_0x33a0('0x27')]=_[_0x33a0('0x26')](_0x564fbe[_0x33a0('0x27')]);_0x4d5c39[_0x33a0('0x28')]=_[_0x33a0('0x29')](_0x4d5c39['model'],_0x4d5c39[_0x33a0('0x27')]);_0x3ace86[_0x33a0('0x2a')]=_[_0x33a0('0x29')](_0x4d5c39[_0x33a0('0x25')],qs[_0x33a0('0x2b')](_0x564fbe[_0x33a0('0x27')][_0x33a0('0x2b')]));_0x3ace86[_0x33a0('0x2a')]=_0x3ace86['attributes'][_0x33a0('0x2c')]?_0x3ace86[_0x33a0('0x2a')]:_0x4d5c39['model'];if(!_0x564fbe[_0x33a0('0x27')][_0x33a0('0x2d')]('nolimit')){_0x3ace86[_0x33a0('0x2e')]=qs[_0x33a0('0x2e')](_0x564fbe[_0x33a0('0x27')]['limit']);_0x3ace86[_0x33a0('0x19')]=qs[_0x33a0('0x19')](_0x564fbe[_0x33a0('0x27')][_0x33a0('0x19')]);}_0x3ace86[_0x33a0('0x2f')]=qs[_0x33a0('0x30')](_0x564fbe['query'][_0x33a0('0x30')]);_0x3ace86[_0x33a0('0x31')]=qs[_0x33a0('0x28')](_['pick'](_0x564fbe[_0x33a0('0x27')],_0x4d5c39[_0x33a0('0x28')]));if(_0x564fbe[_0x33a0('0x27')][_0x33a0('0x32')]){_0x3ace86[_0x33a0('0x31')]=_[_0x33a0('0x33')](_0x3ace86[_0x33a0('0x31')],{'$or':_[_0x33a0('0x34')](_0x4fe015,function(_0x5de5b9){if(_0x5de5b9[_0x33a0('0x35')]['key']!==_0x33a0('0x36')){var _0x4ea77d={};_0x4ea77d[_0x5de5b9[_0x33a0('0x37')]]={'$like':'%'+_0x564fbe['query'][_0x33a0('0x32')]+'%'};return _0x4ea77d;}})});}_0x3ace86=_['merge']({},_0x3ace86,_0x564fbe[_0x33a0('0x38')]);var _0x245ee0={'where':_0x3ace86[_0x33a0('0x31')]};return db[_0x33a0('0x39')][_0x33a0('0x18')](_0x245ee0)[_0x33a0('0x1d')](function(_0x2f2a79){_0x437b34[_0x33a0('0x18')]=_0x2f2a79;if(_0x564fbe[_0x33a0('0x27')]['includeAll']){_0x3ace86[_0x33a0('0x3a')]=[{'all':!![]}];}return db['OpenchannelApplication']['findAll'](_0x3ace86);})[_0x33a0('0x1d')](function(_0x1c5556){_0x437b34[_0x33a0('0x3b')]=_0x1c5556;return _0x437b34;})['then'](respondWithFilteredResult(_0x2a4c02,_0x3ace86))['catch'](handleError(_0x2a4c02,null));};exports[_0x33a0('0x3c')]=function(_0x2d813f,_0x7d01ea){var _0x30362d={'raw':!![],'where':{'id':_0x2d813f[_0x33a0('0x3d')]['id']}},_0x2e1e71={};_0x2e1e71[_0x33a0('0x25')]=_[_0x33a0('0x26')](db['OpenchannelApplication']['rawAttributes']);_0x2e1e71[_0x33a0('0x27')]=_['keys'](_0x2d813f[_0x33a0('0x27')]);_0x2e1e71[_0x33a0('0x28')]=_[_0x33a0('0x29')](_0x2e1e71['model'],_0x2e1e71[_0x33a0('0x27')]);_0x30362d[_0x33a0('0x2a')]=_[_0x33a0('0x29')](_0x2e1e71[_0x33a0('0x25')],qs['fields'](_0x2d813f['query'][_0x33a0('0x2b')]));_0x30362d['attributes']=_0x30362d[_0x33a0('0x2a')][_0x33a0('0x2c')]?_0x30362d[_0x33a0('0x2a')]:_0x2e1e71[_0x33a0('0x25')];if(_0x2d813f['query'][_0x33a0('0x3e')]){_0x30362d[_0x33a0('0x3a')]=[{'all':!![]}];}_0x30362d=_[_0x33a0('0x33')]({},_0x30362d,_0x2d813f[_0x33a0('0x38')]);return db[_0x33a0('0x39')]['find'](_0x30362d)[_0x33a0('0x1d')](handleEntityNotFound(_0x7d01ea,null))[_0x33a0('0x1d')](respondWithResult(_0x7d01ea,null))[_0x33a0('0x3f')](handleError(_0x7d01ea,null));};exports[_0x33a0('0x40')]=function(_0x581582,_0xb72562){return db['OpenchannelApplication'][_0x33a0('0x40')](_0x581582[_0x33a0('0x41')],{})['then'](respondWithResult(_0xb72562,0xc9))[_0x33a0('0x3f')](handleError(_0xb72562,null));};exports[_0x33a0('0x1c')]=function(_0xdfb4b6,_0x3bd4c3){if(_0xdfb4b6[_0x33a0('0x41')]['id']){delete _0xdfb4b6['body']['id'];}return db['OpenchannelApplication']['find']({'where':{'id':_0xdfb4b6[_0x33a0('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3bd4c3,null))[_0x33a0('0x1d')](saveUpdates(_0xdfb4b6[_0x33a0('0x41')],null))['then'](respondWithResult(_0x3bd4c3,null))[_0x33a0('0x3f')](handleError(_0x3bd4c3,null));};exports[_0x33a0('0x1e')]=function(_0x9f5801,_0x3325b9){return db[_0x33a0('0x39')][_0x33a0('0x42')]({'where':{'id':_0x9f5801[_0x33a0('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3325b9,null))['then'](removeEntity(_0x3325b9,null))[_0x33a0('0x3f')](handleError(_0x3325b9,null));}; \ No newline at end of file +var _0x4995=['../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','rawAttributes','keys','filters','intersection','query','attributes','fields','length','model','nolimit','order','sort','where','merge','type','key','VIRTUAL','field','filter','options','count','includeAll','include','OpenchannelApplication','findAll','rows','catch','params','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis'];(function(_0x4c7488,_0x106877){var _0x5cbe58=function(_0x453baf){while(--_0x453baf){_0x4c7488['push'](_0x4c7488['shift']());}};_0x5cbe58(++_0x106877);}(_0x4995,0x1a9));var _0x5499=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4995[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0x5499('0x0'));var emlformat=require(_0x5499('0x1'));var rimraf=require(_0x5499('0x2'));var zipdir=require(_0x5499('0x3'));var jsonpatch=require(_0x5499('0x4'));var rp=require(_0x5499('0x5'));var moment=require('moment');var BPromise=require(_0x5499('0x6'));var Mustache=require(_0x5499('0x7'));var util=require(_0x5499('0x8'));var path=require(_0x5499('0x9'));var sox=require(_0x5499('0xa'));var csv=require(_0x5499('0xb'));var ejs=require(_0x5499('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5499('0xd'));var crypto=require(_0x5499('0xe'));var jsforce=require(_0x5499('0xf'));var deskjs=require(_0x5499('0x10'));var toCsv=require(_0x5499('0xb'));var querystring=require('querystring');var Papa=require(_0x5499('0x11'));var Redis=require(_0x5499('0x12'));var authService=require(_0x5499('0x13'));var qs=require(_0x5499('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5499('0x15'));var utils=require(_0x5499('0x16'));var config=require('../../config/environment');var db=require(_0x5499('0x17'))['db'];function respondWithStatusCode(_0x542431,_0x4a5100){_0x4a5100=_0x4a5100||0xcc;return function(_0x1efdb6){if(_0x1efdb6){return _0x542431[_0x5499('0x18')](_0x4a5100);}return _0x542431['status'](_0x4a5100)['end']();};}function respondWithResult(_0x57a18f,_0x54acd0){_0x54acd0=_0x54acd0||0xc8;return function(_0x10638e){if(_0x10638e){return _0x57a18f[_0x5499('0x19')](_0x54acd0)[_0x5499('0x1a')](_0x10638e);}};}function respondWithFilteredResult(_0x2ef3bf,_0x3add36){return function(_0x3f4d4c){if(_0x3f4d4c){var _0xf816c9=_0x3f4d4c['count'],_0x5665e8=_0x3add36[_0x5499('0x1b')],_0x3f959e=_0x3add36[_0x5499('0x1b')]+_0x3add36[_0x5499('0x1c')],_0x501b2c;if(_0x3f959e>=_0xf816c9){_0x3f959e=_0xf816c9;_0x501b2c=0xc8;}else{_0x501b2c=0xce;}_0x2ef3bf[_0x5499('0x19')](_0x501b2c);return _0x2ef3bf[_0x5499('0x1d')](_0x5499('0x1e'),_0x5665e8+'-'+_0x3f959e+'/'+_0xf816c9)[_0x5499('0x1a')](_0x3f4d4c);}return null;};}function patchUpdates(_0x7e6dea){return function(_0x2840de){try{jsonpatch[_0x5499('0x1f')](_0x2840de,_0x7e6dea,!![]);}catch(_0x320279){return BPromise[_0x5499('0x20')](_0x320279);}return _0x2840de[_0x5499('0x21')]();};}function saveUpdates(_0x1cc7ef,_0x5048e5){return function(_0x47ccd6){if(_0x47ccd6){return _0x47ccd6[_0x5499('0x22')](_0x1cc7ef)[_0x5499('0x23')](function(_0x498b4f){return _0x498b4f;});}return null;};}function removeEntity(_0x2a8af2,_0x3f32ce){return function(_0x2b7b7b){if(_0x2b7b7b){return _0x2b7b7b[_0x5499('0x24')]()[_0x5499('0x23')](function(){_0x2a8af2[_0x5499('0x19')](0xcc)[_0x5499('0x25')]();});}};}function handleEntityNotFound(_0x37e717,_0x20cbe3){return function(_0x2d2f4b){if(!_0x2d2f4b){_0x37e717[_0x5499('0x18')](0x194);}return _0x2d2f4b;};}function handleError(_0x3178e2,_0x40508f){_0x40508f=_0x40508f||0x1f4;return function(_0x17fc75){logger[_0x5499('0x26')](_0x17fc75[_0x5499('0x27')]);if(_0x17fc75['name']){delete _0x17fc75[_0x5499('0x28')];}_0x3178e2[_0x5499('0x19')](_0x40508f)[_0x5499('0x29')](_0x17fc75);};}exports[_0x5499('0x2a')]=function(_0x5580fb,_0x1d34a7){var _0x3ccecf={},_0x2ec2b2={},_0x51bc8c={'count':0x0,'rows':[]};var _0x141618=db['OpenchannelApplication'][_0x5499('0x2b')];_0x2ec2b2['model']=_[_0x5499('0x2c')](_0x141618);_0x2ec2b2['query']=_[_0x5499('0x2c')](_0x5580fb['query']);_0x2ec2b2[_0x5499('0x2d')]=_[_0x5499('0x2e')](_0x2ec2b2['model'],_0x2ec2b2[_0x5499('0x2f')]);_0x3ccecf[_0x5499('0x30')]=_[_0x5499('0x2e')](_0x2ec2b2['model'],qs[_0x5499('0x31')](_0x5580fb['query']['fields']));_0x3ccecf['attributes']=_0x3ccecf[_0x5499('0x30')][_0x5499('0x32')]?_0x3ccecf[_0x5499('0x30')]:_0x2ec2b2[_0x5499('0x33')];if(!_0x5580fb[_0x5499('0x2f')]['hasOwnProperty'](_0x5499('0x34'))){_0x3ccecf[_0x5499('0x1c')]=qs[_0x5499('0x1c')](_0x5580fb[_0x5499('0x2f')][_0x5499('0x1c')]);_0x3ccecf['offset']=qs[_0x5499('0x1b')](_0x5580fb[_0x5499('0x2f')][_0x5499('0x1b')]);}_0x3ccecf[_0x5499('0x35')]=qs['sort'](_0x5580fb[_0x5499('0x2f')][_0x5499('0x36')]);_0x3ccecf[_0x5499('0x37')]=qs[_0x5499('0x2d')](_['pick'](_0x5580fb[_0x5499('0x2f')],_0x2ec2b2[_0x5499('0x2d')]));if(_0x5580fb['query']['filter']){_0x3ccecf[_0x5499('0x37')]=_[_0x5499('0x38')](_0x3ccecf[_0x5499('0x37')],{'$or':_['map'](_0x141618,function(_0x4940a2){if(_0x4940a2[_0x5499('0x39')][_0x5499('0x3a')]!==_0x5499('0x3b')){var _0x5a64b9={};_0x5a64b9[_0x4940a2[_0x5499('0x3c')]]={'$like':'%'+_0x5580fb['query'][_0x5499('0x3d')]+'%'};return _0x5a64b9;}})});}_0x3ccecf=_[_0x5499('0x38')]({},_0x3ccecf,_0x5580fb[_0x5499('0x3e')]);var _0x4061d6={'where':_0x3ccecf[_0x5499('0x37')]};return db['OpenchannelApplication']['count'](_0x4061d6)['then'](function(_0x41d1a3){_0x51bc8c[_0x5499('0x3f')]=_0x41d1a3;if(_0x5580fb[_0x5499('0x2f')][_0x5499('0x40')]){_0x3ccecf[_0x5499('0x41')]=[{'all':!![]}];}return db[_0x5499('0x42')][_0x5499('0x43')](_0x3ccecf);})[_0x5499('0x23')](function(_0x590796){_0x51bc8c[_0x5499('0x44')]=_0x590796;return _0x51bc8c;})[_0x5499('0x23')](respondWithFilteredResult(_0x1d34a7,_0x3ccecf))[_0x5499('0x45')](handleError(_0x1d34a7,null));};exports['show']=function(_0xd03a8a,_0x2a56a2){var _0x67d57b={'raw':!![],'where':{'id':_0xd03a8a[_0x5499('0x46')]['id']}},_0x3ecfd5={};_0x3ecfd5['model']=_[_0x5499('0x2c')](db[_0x5499('0x42')][_0x5499('0x2b')]);_0x3ecfd5['query']=_[_0x5499('0x2c')](_0xd03a8a[_0x5499('0x2f')]);_0x3ecfd5[_0x5499('0x2d')]=_['intersection'](_0x3ecfd5['model'],_0x3ecfd5[_0x5499('0x2f')]);_0x67d57b[_0x5499('0x30')]=_[_0x5499('0x2e')](_0x3ecfd5[_0x5499('0x33')],qs[_0x5499('0x31')](_0xd03a8a['query']['fields']));_0x67d57b[_0x5499('0x30')]=_0x67d57b['attributes'][_0x5499('0x32')]?_0x67d57b[_0x5499('0x30')]:_0x3ecfd5[_0x5499('0x33')];if(_0xd03a8a[_0x5499('0x2f')][_0x5499('0x40')]){_0x67d57b[_0x5499('0x41')]=[{'all':!![]}];}_0x67d57b=_[_0x5499('0x38')]({},_0x67d57b,_0xd03a8a[_0x5499('0x3e')]);return db['OpenchannelApplication'][_0x5499('0x47')](_0x67d57b)[_0x5499('0x23')](handleEntityNotFound(_0x2a56a2,null))['then'](respondWithResult(_0x2a56a2,null))[_0x5499('0x45')](handleError(_0x2a56a2,null));};exports['create']=function(_0x345098,_0x409c84){return db[_0x5499('0x42')][_0x5499('0x48')](_0x345098[_0x5499('0x49')],{})['then'](respondWithResult(_0x409c84,0xc9))['catch'](handleError(_0x409c84,null));};exports[_0x5499('0x22')]=function(_0x5b5321,_0x111187){if(_0x5b5321[_0x5499('0x49')]['id']){delete _0x5b5321[_0x5499('0x49')]['id'];}return db[_0x5499('0x42')][_0x5499('0x47')]({'where':{'id':_0x5b5321[_0x5499('0x46')]['id']}})[_0x5499('0x23')](handleEntityNotFound(_0x111187,null))[_0x5499('0x23')](saveUpdates(_0x5b5321[_0x5499('0x49')],null))[_0x5499('0x23')](respondWithResult(_0x111187,null))[_0x5499('0x45')](handleError(_0x111187,null));};exports[_0x5499('0x24')]=function(_0x5bb2fc,_0x37aa7d){return db[_0x5499('0x42')]['find']({'where':{'id':_0x5bb2fc['params']['id']}})['then'](handleEntityNotFound(_0x37aa7d,null))[_0x5499('0x23')](removeEntity(_0x37aa7d,null))[_0x5499('0x45')](handleError(_0x37aa7d,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 5a101f2..e7750c1 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 _0x1b32=['rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','utf8mb4','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x93b92e,_0x2d2457){var _0x29185e=function(_0x814cc4){while(--_0x814cc4){_0x93b92e['push'](_0x93b92e['shift']());}};_0x29185e(++_0x2d2457);}(_0x1b32,0x85));var _0x21b3=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0x1b32[_0xfa634c];return _0x73e478;};'use strict';var _=require('lodash');var util=require(_0x21b3('0x0'));var logger=require(_0x21b3('0x1'))(_0x21b3('0x2'));var moment=require(_0x21b3('0x3'));var BPromise=require(_0x21b3('0x4'));var rp=require(_0x21b3('0x5'));var fs=require('fs');var path=require(_0x21b3('0x6'));var rimraf=require(_0x21b3('0x7'));var config=require(_0x21b3('0x8'));var attributes=require(_0x21b3('0x9'));module[_0x21b3('0xa')]=function(_0x403803,_0x37859f){return _0x403803[_0x21b3('0xb')](_0x21b3('0xc'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x21b3('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x6e5f=['exports','define','OpenchannelApplication','utf8mb4_unicode_ci','lodash','util','api','bluebird','path','../../config/environment'];(function(_0x162ab4,_0x578437){var _0x410f69=function(_0x350bfc){while(--_0x350bfc){_0x162ab4['push'](_0x162ab4['shift']());}};_0x410f69(++_0x578437);}(_0x6e5f,0x1bc));var _0xf6e5=function(_0xa15e67,_0x2f5714){_0xa15e67=_0xa15e67-0x0;var _0x218e06=_0x6e5f[_0xa15e67];return _0x218e06;};'use strict';var _=require(_0xf6e5('0x0'));var util=require(_0xf6e5('0x1'));var logger=require('../../config/logger')(_0xf6e5('0x2'));var moment=require('moment');var BPromise=require(_0xf6e5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf6e5('0x4'));var rimraf=require('rimraf');var config=require(_0xf6e5('0x5'));var attributes=require('./openchannelApplication.attributes');module[_0xf6e5('0x6')]=function(_0x4ef585,_0x4088a4){return _0x4ef585[_0xf6e5('0x7')](_0xf6e5('0x8'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf6e5('0x9')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 2e19856..5c5e8d1 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 _0x23fc=['OpenchannelApplication','update','options','raw','where','attributes','limit','UpdateOpenchannelApplication','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x55e1d1,_0x3c9376){var _0x1165db=function(_0x5b0120){while(--_0x5b0120){_0x55e1d1['push'](_0x55e1d1['shift']());}};_0x1165db(++_0x3c9376);}(_0x23fc,0x10d));var _0xc23f=function(_0x337748,_0x402b05){_0x337748=_0x337748-0x0;var _0x3bb03f=_0x23fc[_0x337748];return _0x3bb03f;};'use strict';var _=require('lodash');var util=require(_0xc23f('0x0'));var moment=require('moment');var BPromise=require(_0xc23f('0x1'));var rs=require(_0xc23f('0x2'));var fs=require('fs');var Redis=require(_0xc23f('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc23f('0x4'))(_0xc23f('0x5'));var config=require(_0xc23f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xc23f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1dc3f3,_0x578f0d,_0x4b0daa){return new BPromise(function(_0x517b73,_0x5ec239){return client[_0xc23f('0x8')](_0x1dc3f3,_0x4b0daa)[_0xc23f('0x9')](function(_0x3986e5){logger[_0xc23f('0xa')](_0xc23f('0xb'),_0x578f0d,_0xc23f('0xc'));logger[_0xc23f('0xd')](_0xc23f('0xe'),_0x578f0d,_0xc23f('0xc'),JSON[_0xc23f('0xf')](_0x3986e5));if(_0x3986e5[_0xc23f('0x10')]){if(_0x3986e5['error'][_0xc23f('0x11')]===0x1f4){logger[_0xc23f('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x578f0d,_0x3986e5['error']['message']);return _0x5ec239(_0x3986e5['error']['message']);}logger[_0xc23f('0x10')](_0xc23f('0xb'),_0x578f0d,_0x3986e5['error'][_0xc23f('0x12')]);return _0x517b73(_0x3986e5[_0xc23f('0x10')][_0xc23f('0x12')]);}else{logger['info'](_0xc23f('0xb'),_0x578f0d,_0xc23f('0xc'));_0x517b73(_0x3986e5[_0xc23f('0x13')][_0xc23f('0x12')]);}})[_0xc23f('0x14')](function(_0x1ca79d){logger[_0xc23f('0x10')](_0xc23f('0xb'),_0x578f0d,_0x1ca79d);_0x5ec239(_0x1ca79d);});});}exports['UpdateOpenchannelApplication']=function(_0x249b0a){var _0x55cd24=this;return new Promise(function(_0x4e07b5,_0x111aa7){return db[_0xc23f('0x15')][_0xc23f('0x16')](_0x249b0a['body'],{'raw':_0x249b0a[_0xc23f('0x17')]?_0x249b0a[_0xc23f('0x17')][_0xc23f('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x249b0a[_0xc23f('0x17')]?_0x249b0a['options'][_0xc23f('0x19')]||null:null,'attributes':_0x249b0a[_0xc23f('0x17')]?_0x249b0a['options'][_0xc23f('0x1a')]||null:null,'limit':_0x249b0a['options']?_0x249b0a[_0xc23f('0x17')][_0xc23f('0x1b')]||null:null})['then'](function(_0xc8de0a){logger['info'](_0xc23f('0x1c'),_0x249b0a);logger[_0xc23f('0xd')](_0xc23f('0x1c'),_0x249b0a,JSON[_0xc23f('0xf')](_0xc8de0a));_0x4e07b5(_0xc8de0a);})['catch'](function(_0x4cf623){logger[_0xc23f('0x10')](_0xc23f('0x1c'),_0x4cf623['message'],_0x249b0a);_0x111aa7(_0x55cd24['error'](0x1f4,_0x4cf623['message']));});});}; \ No newline at end of file +var _0x722b=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateOpenchannelApplication','update','body','options','raw','where','limit','then','debug'];(function(_0x5eb3c1,_0x2d0bab){var _0xfafed=function(_0x5ec542){while(--_0x5ec542){_0x5eb3c1['push'](_0x5eb3c1['shift']());}};_0xfafed(++_0x2d0bab);}(_0x722b,0x1dc));var _0xb722=function(_0x45c03f,_0x3d13d2){_0x45c03f=_0x45c03f-0x0;var _0x1c4430=_0x722b[_0x45c03f];return _0x1c4430;};'use strict';var _=require('lodash');var util=require(_0xb722('0x0'));var moment=require(_0xb722('0x1'));var BPromise=require(_0xb722('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb722('0x3'));var db=require(_0xb722('0x4'))['db'];var utils=require(_0xb722('0x5'));var logger=require('../../config/logger')(_0xb722('0x6'));var config=require('../../config/environment');var jayson=require(_0xb722('0x7'));var client=jayson['client'][_0xb722('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xaba74f,_0xcb4d2c,_0x3b2ad7){return new BPromise(function(_0x4580c9,_0x2e7682){return client[_0xb722('0x9')](_0xaba74f,_0x3b2ad7)['then'](function(_0x1bdf6d){logger[_0xb722('0xa')](_0xb722('0xb'),_0xcb4d2c,_0xb722('0xc'));logger['debug'](_0xb722('0xd'),_0xcb4d2c,_0xb722('0xc'),JSON[_0xb722('0xe')](_0x1bdf6d));if(_0x1bdf6d[_0xb722('0xf')]){if(_0x1bdf6d[_0xb722('0xf')][_0xb722('0x10')]===0x1f4){logger['error'](_0xb722('0xb'),_0xcb4d2c,_0x1bdf6d[_0xb722('0xf')][_0xb722('0x11')]);return _0x2e7682(_0x1bdf6d[_0xb722('0xf')][_0xb722('0x11')]);}logger[_0xb722('0xf')](_0xb722('0xb'),_0xcb4d2c,_0x1bdf6d['error'][_0xb722('0x11')]);return _0x4580c9(_0x1bdf6d[_0xb722('0xf')][_0xb722('0x11')]);}else{logger[_0xb722('0xa')](_0xb722('0xb'),_0xcb4d2c,'request\x20sent');_0x4580c9(_0x1bdf6d['result'][_0xb722('0x11')]);}})[_0xb722('0x12')](function(_0x30bc2b){logger[_0xb722('0xf')](_0xb722('0xb'),_0xcb4d2c,_0x30bc2b);_0x2e7682(_0x30bc2b);});});}exports[_0xb722('0x13')]=function(_0xe6722f){var _0x59e07a=this;return new Promise(function(_0x5dac13,_0xeea816){return db['OpenchannelApplication'][_0xb722('0x14')](_0xe6722f[_0xb722('0x15')],{'raw':_0xe6722f[_0xb722('0x16')]?_0xe6722f[_0xb722('0x16')][_0xb722('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe6722f[_0xb722('0x16')]?_0xe6722f[_0xb722('0x16')][_0xb722('0x18')]||null:null,'attributes':_0xe6722f[_0xb722('0x16')]?_0xe6722f['options']['attributes']||null:null,'limit':_0xe6722f[_0xb722('0x16')]?_0xe6722f['options'][_0xb722('0x19')]||null:null})[_0xb722('0x1a')](function(_0x121a8e){logger[_0xb722('0xa')](_0xb722('0x13'),_0xe6722f);logger[_0xb722('0x1b')](_0xb722('0x13'),_0xe6722f,JSON['stringify'](_0x121a8e));_0x5dac13(_0x121a8e);})['catch'](function(_0x3f3125){logger[_0xb722('0xf')](_0xb722('0x13'),_0x3f3125['message'],_0xe6722f);_0xeea816(_0x59e07a[_0xb722('0xf')](0x1f4,_0x3f3125[_0xb722('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index a0e82d3..23383d0 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 _0x4f88=['addTags','put','tracked','openchannel','openchannelinteraction:update','update','openchannelinteraction:destroy','destroy','delete','removeTags','exports','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','isAuthenticated','index','/describe','describe','/:id','show','get','/:id/messages','getMessages','download','post','create','addMessage','/:id/tags','openchannelinteraction:addtags'];(function(_0x1c6a0c,_0x5705ab){var _0x58c88c=function(_0x1c41dd){while(--_0x1c41dd){_0x1c6a0c['push'](_0x1c6a0c['shift']());}};_0x58c88c(++_0x5705ab);}(_0x4f88,0x6e));var _0x84f8=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x4f88[_0x16b9ed];return _0x66b1f8;};'use strict';var multer=require('multer');var util=require(_0x84f8('0x0'));var path=require('path');var timeout=require(_0x84f8('0x1'));var express=require(_0x84f8('0x2'));var router=express['Router']();var auth=require(_0x84f8('0x3'));var interaction=require(_0x84f8('0x4'));var config=require(_0x84f8('0x5'));var controller=require(_0x84f8('0x6'));router['get']('/',auth[_0x84f8('0x7')](),controller[_0x84f8('0x8')]);router['get'](_0x84f8('0x9'),auth[_0x84f8('0x7')](),controller[_0x84f8('0xa')]);router['get'](_0x84f8('0xb'),auth[_0x84f8('0x7')](),controller[_0x84f8('0xc')]);router[_0x84f8('0xd')](_0x84f8('0xe'),auth[_0x84f8('0x7')](),controller[_0x84f8('0xf')]);router[_0x84f8('0xd')]('/:id/download',auth[_0x84f8('0x7')](),controller[_0x84f8('0x10')]);router[_0x84f8('0x11')]('/',auth[_0x84f8('0x7')](),controller[_0x84f8('0x12')]);router[_0x84f8('0x11')](_0x84f8('0xe'),auth[_0x84f8('0x7')](),controller[_0x84f8('0x13')]);router[_0x84f8('0x11')](_0x84f8('0x14'),auth[_0x84f8('0x7')](),interaction['tracked']('openchannel',_0x84f8('0x15')),controller[_0x84f8('0x16')]);router[_0x84f8('0x17')](_0x84f8('0xb'),auth['isAuthenticated'](),interaction[_0x84f8('0x18')](_0x84f8('0x19'),_0x84f8('0x1a')),controller[_0x84f8('0x1b')]);router['delete'](_0x84f8('0xb'),auth[_0x84f8('0x7')](),interaction['tracked']('openchannel',_0x84f8('0x1c')),controller[_0x84f8('0x1d')]);router[_0x84f8('0x1e')](_0x84f8('0x14'),auth[_0x84f8('0x7')](),controller[_0x84f8('0x1f')]);module[_0x84f8('0x20')]=router; \ No newline at end of file +var _0xb58f=['removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','openchannelinteraction:addtags','addTags','openchannel','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy'];(function(_0x118afa,_0x4bf0c1){var _0x167d76=function(_0x2c529b){while(--_0x2c529b){_0x118afa['push'](_0x118afa['shift']());}};_0x167d76(++_0x4bf0c1);}(_0xb58f,0x182));var _0xfb58=function(_0x4faa4f,_0x2a3f44){_0x4faa4f=_0x4faa4f-0x0;var _0xe649f8=_0xb58f[_0x4faa4f];return _0xe649f8;};'use strict';var multer=require(_0xfb58('0x0'));var util=require(_0xfb58('0x1'));var path=require(_0xfb58('0x2'));var timeout=require(_0xfb58('0x3'));var express=require(_0xfb58('0x4'));var router=express[_0xfb58('0x5')]();var auth=require(_0xfb58('0x6'));var interaction=require(_0xfb58('0x7'));var config=require('../../config/environment');var controller=require('./openchannelInteraction.controller');router[_0xfb58('0x8')]('/',auth[_0xfb58('0x9')](),controller[_0xfb58('0xa')]);router[_0xfb58('0x8')](_0xfb58('0xb'),auth[_0xfb58('0x9')](),controller['describe']);router[_0xfb58('0x8')](_0xfb58('0xc'),auth[_0xfb58('0x9')](),controller[_0xfb58('0xd')]);router[_0xfb58('0x8')](_0xfb58('0xe'),auth[_0xfb58('0x9')](),controller[_0xfb58('0xf')]);router[_0xfb58('0x8')](_0xfb58('0x10'),auth[_0xfb58('0x9')](),controller[_0xfb58('0x11')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xfb58('0x12')](_0xfb58('0xe'),auth[_0xfb58('0x9')](),controller[_0xfb58('0x13')]);router[_0xfb58('0x12')](_0xfb58('0x14'),auth[_0xfb58('0x9')](),interaction[_0xfb58('0x15')]('openchannel',_0xfb58('0x16')),controller[_0xfb58('0x17')]);router['put'](_0xfb58('0xc'),auth[_0xfb58('0x9')](),interaction[_0xfb58('0x15')](_0xfb58('0x18'),_0xfb58('0x19')),controller[_0xfb58('0x1a')]);router[_0xfb58('0x1b')]('/:id',auth[_0xfb58('0x9')](),interaction[_0xfb58('0x15')](_0xfb58('0x18'),_0xfb58('0x1c')),controller[_0xfb58('0x1d')]);router[_0xfb58('0x1b')](_0xfb58('0x14'),auth[_0xfb58('0x9')](),controller[_0xfb58('0x1e')]);module[_0xfb58('0x1f')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index fd350de..7824e6a 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 _0xf555=['ENUM','sequelize','exports','DATE','STRING'];(function(_0x152121,_0x120c53){var _0x592a85=function(_0x241cab){while(--_0x241cab){_0x152121['push'](_0x152121['shift']());}};_0x592a85(++_0x120c53);}(_0xf555,0x97));var _0x5f55=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf555[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x5f55('0x0'));module[_0x5f55('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5f55('0x2')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x5f55('0x3')]},'read1stAt':{'type':Sequelize[_0x5f55('0x2')]},'threadId':{'type':Sequelize[_0x5f55('0x3')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x5f55('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x5f55('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x5f55('0x3')]}}; \ No newline at end of file +var _0x9c5b=['DATE','ENUM','out','sequelize','BOOLEAN','STRING'];(function(_0x2a3715,_0xbb1812){var _0x1f4c80=function(_0x55d399){while(--_0x55d399){_0x2a3715['push'](_0x2a3715['shift']());}};_0x1f4c80(++_0xbb1812);}(_0x9c5b,0x1cb));var _0xb9c5=function(_0x5bc85a,_0x802e13){_0x5bc85a=_0x5bc85a-0x0;var _0x5875a8=_0x9c5b[_0x5bc85a];return _0x5875a8;};'use strict';var Sequelize=require(_0xb9c5('0x0'));module['exports']={'closed':{'type':Sequelize[_0xb9c5('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xb9c5('0x2')]},'note':{'type':Sequelize[_0xb9c5('0x2')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0xb9c5('0x2')]},'externalUrl':{'type':Sequelize[_0xb9c5('0x2')]},'lastMsgAt':{'type':Sequelize[_0xb9c5('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xb9c5('0x4')]('in',_0xb9c5('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 579e12e..7891f60 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 _0xd7b5=['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','Openchannel','YYYY-MM-DD','Account','Owner','YYYY-MM-DD\x20HH:mm:ss','disposition','threadId','Public','Private','existsSync','createReadStream','basename','direction','out','lastName','secret','renderFile','views','downloadInteraction.html','toFile','.pdf','download','log','err','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','./openchannelInteraction.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','TagIds','Tags','split','forEach','push','OpenchannelInteraction','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','tools_tags','COUNT(*)','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','user_has_openchannel_interactions','left_join','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','openchannel_accounts','me.OpenchannelInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false','expr','advancedFilter','parse','createdAt','dateStart','startOf','format','utc','endOf','day','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','TagId','unreadMessages','value','tableAlias','\x20IN\x20?','\x20=\x20?','LIKE','ContactId','c.firstName','\x20LIKE\x20?','c.lastName','c.email','\x20>\x20?','\x20<\x20?','filter','isEmpty','OpenchannelAccountId','concat','$gte','$lte','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','toString','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','order','i.id','Sequelize','QueryTypes','SELECT','clone','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','mail_interaction_has_tags','sequelize','keyBy','merge','COUNT(me.id)','a.key','i.*','Contact.firstName','Contact.lastName','Contact.email','Contact.phone','c.mobile','Contact.mobile','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','rows','params','includeAll','find','create','body','catch','describe','addMessage','OpenchannelMessage','ids','include','findAll','addTags','omit','Tag','emit','openchannelInteractionTags:save','removeTags','unix','join','root','server','files','tmp','transcript-%d-%s.zip','Messages','User','fullname','Contact','firstName','Attachment','OpenchannelAccount'];(function(_0x439d59,_0x11ccdf){var _0x3670c7=function(_0x11cfcb){while(--_0x11cfcb){_0x439d59['push'](_0x439d59['shift']());}};_0x3670c7(++_0x11ccdf);}(_0xd7b5,0xfd));var _0x5d7b=function(_0xfa1895,_0x2e6b95){_0xfa1895=_0xfa1895-0x0;var _0x2e1c77=_0xd7b5[_0xfa1895];return _0x2e1c77;};'use strict';var pdf=require(_0x5d7b('0x0'));var emlformat=require(_0x5d7b('0x1'));var rimraf=require(_0x5d7b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5d7b('0x3'));var rp=require('request-promise');var moment=require(_0x5d7b('0x4'));var BPromise=require(_0x5d7b('0x5'));var Mustache=require(_0x5d7b('0x6'));var util=require('util');var path=require(_0x5d7b('0x7'));var sox=require(_0x5d7b('0x8'));var csv=require(_0x5d7b('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5d7b('0xa'));var squel=require(_0x5d7b('0xb'));var crypto=require(_0x5d7b('0xc'));var jsforce=require(_0x5d7b('0xd'));var deskjs=require(_0x5d7b('0xe'));var toCsv=require(_0x5d7b('0x9'));var querystring=require(_0x5d7b('0xf'));var Papa=require(_0x5d7b('0x10'));var Redis=require(_0x5d7b('0x11'));var authService=require(_0x5d7b('0x12'));var qs=require(_0x5d7b('0x13'));var hardwareService=require(_0x5d7b('0x14'));var logger=require(_0x5d7b('0x15'))(_0x5d7b('0x16'));var utils=require(_0x5d7b('0x17'));var config=require(_0x5d7b('0x18'));var db=require('../../mysqldb')['db'];config[_0x5d7b('0x19')]=_[_0x5d7b('0x1a')](config[_0x5d7b('0x19')],{'host':_0x5d7b('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5d7b('0x19')]));require(_0x5d7b('0x1c'))[_0x5d7b('0x1d')](socket);function respondWithStatusCode(_0x5b20f0,_0x395ebf){_0x395ebf=_0x395ebf||0xcc;return function(_0x33ad48){if(_0x33ad48){return _0x5b20f0[_0x5d7b('0x1e')](_0x395ebf);}return _0x5b20f0[_0x5d7b('0x1f')](_0x395ebf)[_0x5d7b('0x20')]();};}function respondWithResult(_0x380b12,_0x28d4c7){_0x28d4c7=_0x28d4c7||0xc8;return function(_0x4868fd){if(_0x4868fd){return _0x380b12[_0x5d7b('0x1f')](_0x28d4c7)[_0x5d7b('0x21')](_0x4868fd);}};}function respondWithFilteredResult(_0x11b746,_0x38d027){return function(_0x1245b6){if(_0x1245b6){var _0x19c681=_0x1245b6[_0x5d7b('0x22')],_0x399f3e=_0x38d027[_0x5d7b('0x23')],_0x373df8=_0x38d027['offset']+_0x38d027[_0x5d7b('0x24')],_0x106724;if(_0x373df8>=_0x19c681){_0x373df8=_0x19c681;_0x106724=0xc8;}else{_0x106724=0xce;}_0x11b746[_0x5d7b('0x1f')](_0x106724);return _0x11b746[_0x5d7b('0x25')](_0x5d7b('0x26'),_0x399f3e+'-'+_0x373df8+'/'+_0x19c681)['json'](_0x1245b6);}return null;};}function patchUpdates(_0x3c24e3){return function(_0xe68af5){try{jsonpatch[_0x5d7b('0x27')](_0xe68af5,_0x3c24e3,!![]);}catch(_0x3205ce){return BPromise[_0x5d7b('0x28')](_0x3205ce);}return _0xe68af5[_0x5d7b('0x29')]();};}function saveUpdates(_0x37045a,_0x814f78){return function(_0x406586){if(_0x406586){return _0x406586[_0x5d7b('0x2a')](_0x37045a)[_0x5d7b('0x2b')](function(_0x55dbd2){return _0x55dbd2;});}return null;};}function removeEntity(_0x3f8105,_0x3efdff){return function(_0xd4e0ca){if(_0xd4e0ca){return _0xd4e0ca[_0x5d7b('0x2c')]()[_0x5d7b('0x2b')](function(){_0x3f8105[_0x5d7b('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47bf11,_0x22f517){return function(_0xb48668){if(!_0xb48668){_0x47bf11[_0x5d7b('0x1e')](0x194);}return _0xb48668;};}function handleError(_0x3f28ed,_0x3ebea6){_0x3ebea6=_0x3ebea6||0x1f4;return function(_0x4eedc7){logger['error'](_0x4eedc7[_0x5d7b('0x2d')]);if(_0x4eedc7[_0x5d7b('0x2e')]){delete _0x4eedc7[_0x5d7b('0x2e')];}_0x3f28ed['status'](_0x3ebea6)[_0x5d7b('0x2f')](_0x4eedc7);};}function getInteractionUsers(_0x50d9f6,_0x595334){return new BPromise(function(_0x2e1778,_0x2c6ce1){try{if(_0x595334[_0x50d9f6['id']]){_0x50d9f6['Users']=_[_0x5d7b('0x30')](_0x595334[_0x50d9f6['id']],function(_0xe5923a){return{'id':_0xe5923a['id']};});}}catch(_0x889e8b){_0x2c6ce1(_0x889e8b);}_0x2e1778(_0x50d9f6);});}function getInteractionTags(_0x42cb01,_0x155aeb){return new BPromise(function(_0x292972,_0x21e56e){try{if(_0x42cb01[_0x5d7b('0x31')]){_0x42cb01[_0x5d7b('0x32')]=[];_0x42cb01['TagIds'][_0x5d7b('0x33')](',')[_0x5d7b('0x34')](function(_0xc49bad){_0x42cb01[_0x5d7b('0x32')][_0x5d7b('0x35')](_0x155aeb[_0xc49bad]);});}delete _0x42cb01['TagIds'];}catch(_0x1aaaaa){_0x21e56e(_0x1aaaaa);}_0x292972(_0x42cb01);});}function updateOpenchannelInteraction(_0x90b842,_0xee7f66,_0x17aad4){return new BPromise(function(_0x2646c7,_0x14a188){return getInteractionUsers(_0x90b842,_0x17aad4)['then'](function(_0x49ebcd){return getInteractionTags(_0x49ebcd,_0xee7f66);})['then'](function(_0x1c890c){_0x2646c7(_0x1c890c);})['catch'](function(_0x5465b8){_0x14a188(_0x5465b8);});});}exports['index']=function(_0x38dad7,_0x350ed6){var _0x56b157={},_0x345ca0={},_0x3383a3={'count':0x0,'rows':[]};var _0x170e19=db[_0x5d7b('0x36')][_0x5d7b('0x37')];_0x345ca0[_0x5d7b('0x38')]=_[_0x5d7b('0x39')](_0x170e19);_0x345ca0[_0x5d7b('0x3a')]=_[_0x5d7b('0x39')](_0x38dad7[_0x5d7b('0x3a')]);_0x345ca0[_0x5d7b('0x3b')]=_[_0x5d7b('0x3c')](_0x345ca0['model'],_0x345ca0[_0x5d7b('0x3a')]);_0x56b157[_0x5d7b('0x3d')]=_[_0x5d7b('0x3c')](_0x345ca0[_0x5d7b('0x38')],qs[_0x5d7b('0x3e')](_0x38dad7[_0x5d7b('0x3a')]['fields']));_0x56b157[_0x5d7b('0x3d')]=_0x56b157[_0x5d7b('0x3d')][_0x5d7b('0x3f')]?_0x56b157['attributes']:_0x345ca0['model'];if(!_0x38dad7[_0x5d7b('0x3a')][_0x5d7b('0x40')](_0x5d7b('0x41'))){_0x56b157['limit']=qs[_0x5d7b('0x24')](_0x38dad7[_0x5d7b('0x3a')][_0x5d7b('0x24')]);_0x56b157[_0x5d7b('0x23')]=qs[_0x5d7b('0x23')](_0x38dad7[_0x5d7b('0x3a')][_0x5d7b('0x23')]);}_0x56b157['order']=qs[_0x5d7b('0x42')](_0x38dad7['query'][_0x5d7b('0x42')]);_0x56b157[_0x5d7b('0x43')]=qs[_0x5d7b('0x3b')](_[_0x5d7b('0x44')](_0x38dad7[_0x5d7b('0x3a')],_0x345ca0[_0x5d7b('0x3b')]));var _0x468552=[];var _0x222107=squel[_0x5d7b('0x45')]()[_0x5d7b('0x46')]('id')['field']('name')[_0x5d7b('0x46')](_0x5d7b('0x47'))[_0x5d7b('0x48')](_0x5d7b('0x49'));var _0x4dca8a=squel[_0x5d7b('0x45')]()['field'](_0x5d7b('0x4a'))[_0x5d7b('0x48')](_0x5d7b('0x4b'),'me')[_0x5d7b('0x43')](_0x5d7b('0x4c'))['where'](_0x5d7b('0x4d'))[_0x5d7b('0x43')](_0x5d7b('0x4e'));var _0x3bad3e=squel[_0x5d7b('0x45')]()['field']('u.id')[_0x5d7b('0x46')]('ui.OpenchannelInteractionId')[_0x5d7b('0x48')](_0x5d7b('0x4f'),'ui')[_0x5d7b('0x50')]('users','u',_0x5d7b('0x51'));var _0x556166=squel[_0x5d7b('0x45')]()[_0x5d7b('0x48')]('openchannel_interactions','i')[_0x5d7b('0x50')](_0x5d7b('0x52'),'c',_0x5d7b('0x53'))[_0x5d7b('0x50')](_0x5d7b('0x54'),'o','o.id\x20=\x20i.UserId')[_0x5d7b('0x50')](_0x5d7b('0x55'),'a','a.id\x20=\x20i.OpenchannelAccountId')[_0x5d7b('0x50')](_0x5d7b('0x4b'),'me',_0x5d7b('0x56'));var _0x607a21=squel[_0x5d7b('0x57')]();if(_0x38dad7[_0x5d7b('0x3a')][_0x5d7b('0x58')]){var _0x568757=JSON[_0x5d7b('0x59')](_0x38dad7[_0x5d7b('0x3a')][_0x5d7b('0x58')]);_[_0x5d7b('0x39')](_0x568757)['forEach'](function(_0x4fdc4b){var _0x3ca056=_0x568757[_0x4fdc4b];if(_0x4fdc4b===_0x5d7b('0x5a')){var _0x7692be=moment(_0x3ca056['value'][_0x5d7b('0x5b')])[_0x5d7b('0x5c')]('day')['utc']()[_0x5d7b('0x5d')]();var _0x4245d4=moment(_0x4245d4)[_0x5d7b('0x5e')]()[_0x5d7b('0x5f')](_0x5d7b('0x60'))[_0x5d7b('0x5d')]();_0x607a21[_0x5d7b('0x61')](_0x5d7b('0x62'),_0x7692be,_0x4245d4);}else{if(_[_0x5d7b('0x63')](_0x3ca056[_0x5d7b('0x64')])){_0x3ca056[_0x5d7b('0x64')][_0x5d7b('0x34')](function(_0x3faa44){switch(_0x3ca056['condition']['value']){case'IS':if(_0x4fdc4b!==_0x5d7b('0x65')&&_0x4fdc4b!==_0x5d7b('0x66')){if(_[_0x5d7b('0x63')](_0x3ca056[_0x5d7b('0x67')])&&_0x3ca056[_0x5d7b('0x67')]['length']>0x1){_0x607a21[_0x5d7b('0x61')](_0x3ca056[_0x5d7b('0x68')]+'.'+_0x4fdc4b+_0x5d7b('0x69'),_0x3ca056[_0x5d7b('0x67')]);}else{_0x607a21['and'](_0x3ca056[_0x5d7b('0x68')]+'.'+_0x4fdc4b+_0x5d7b('0x6a'),_0x3ca056[_0x5d7b('0x67')][0x0]);}}break;case'=':_0x607a21[_0x5d7b('0x61')](_0x3ca056[_0x5d7b('0x68')]+'.'+_0x4fdc4b+_0x5d7b('0x6a'),_0x3ca056[_0x5d7b('0x67')]);break;case _0x5d7b('0x6b'):if(_0x4fdc4b===_0x5d7b('0x6c')){_0x607a21[_0x5d7b('0x61')](_0x5d7b('0x6d')+_0x5d7b('0x6e'),'%'+_0x3ca056[_0x5d7b('0x67')]+'%');_0x607a21['or'](_0x5d7b('0x6f')+'\x20LIKE\x20?','%'+_0x3ca056[_0x5d7b('0x67')]+'%');_0x607a21['or'](_0x5d7b('0x70')+_0x5d7b('0x6e'),'%'+_0x3ca056[_0x5d7b('0x67')]+'%');}else{_0x607a21[_0x5d7b('0x61')](_0x3ca056['tableAlias']+'.'+_0x4fdc4b+_0x5d7b('0x6e'),'%'+_0x3ca056[_0x5d7b('0x67')]+'%');}break;case'>':_0x607a21[_0x5d7b('0x61')](_0x3ca056[_0x5d7b('0x68')]+'.'+_0x4fdc4b+_0x5d7b('0x71'),_0x3ca056[_0x5d7b('0x67')]);break;case'<':_0x607a21['and'](_0x3ca056[_0x5d7b('0x68')]+'.'+_0x4fdc4b+_0x5d7b('0x72'),_0x3ca056['value']);break;}});}else{switch(_0x3ca056[_0x5d7b('0x64')][_0x5d7b('0x67')]){case'IS':if(_0x4fdc4b!==_0x5d7b('0x65')&&_0x4fdc4b!==_0x5d7b('0x66')){if(_[_0x5d7b('0x63')](_0x3ca056[_0x5d7b('0x67')])&&_0x3ca056['value']['length']>0x1){_0x607a21[_0x5d7b('0x61')](_0x3ca056[_0x5d7b('0x68')]+'.'+_0x4fdc4b+_0x5d7b('0x69'),_0x3ca056[_0x5d7b('0x67')]);}else{_0x607a21[_0x5d7b('0x61')](_0x3ca056[_0x5d7b('0x68')]+'.'+_0x4fdc4b+_0x5d7b('0x6a'),_0x3ca056[_0x5d7b('0x67')][0x0]);}}break;case'=':_0x607a21[_0x5d7b('0x61')](_0x3ca056[_0x5d7b('0x68')]+'.'+_0x4fdc4b+_0x5d7b('0x6a'),_0x3ca056[_0x5d7b('0x67')]);break;case'LIKE':if(_0x4fdc4b===_0x5d7b('0x6c')){_0x607a21[_0x5d7b('0x61')](_0x5d7b('0x6d')+_0x5d7b('0x6e'),'%'+_0x3ca056[_0x5d7b('0x67')]+'%');_0x607a21['or'](_0x5d7b('0x6f')+_0x5d7b('0x6e'),'%'+_0x3ca056[_0x5d7b('0x67')]+'%');_0x607a21['or'](_0x5d7b('0x70')+_0x5d7b('0x6e'),'%'+_0x3ca056[_0x5d7b('0x67')]+'%');}else{_0x607a21[_0x5d7b('0x61')](_0x3ca056['tableAlias']+'.'+_0x4fdc4b+_0x5d7b('0x6e'),'%'+_0x3ca056[_0x5d7b('0x67')]+'%');}break;case'>':_0x607a21['and'](_0x3ca056[_0x5d7b('0x68')]+'.'+_0x4fdc4b+_0x5d7b('0x71'),_0x3ca056[_0x5d7b('0x67')]);break;case'<':_0x607a21[_0x5d7b('0x61')](_0x3ca056[_0x5d7b('0x68')]+'.'+_0x4fdc4b+'\x20<\x20?',_0x3ca056[_0x5d7b('0x67')]);break;}}}});}else{var _0x231810=_(Object[_0x5d7b('0x39')](_0x38dad7['query']))['map'](function(_0x4aa446){return _0x170e19[_0x5d7b('0x40')](_0x4aa446)?_0x4aa446:undefined;})[_0x5d7b('0x73')](function(_0x1a9c80){return!_['isNil'](_0x1a9c80);})[_0x5d7b('0x67')]();if(!_[_0x5d7b('0x74')](_0x231810)){_0x231810['forEach'](function(_0x4723dc){if(_0x4723dc===_0x5d7b('0x75')){_0x556166[_0x5d7b('0x43')]('i.OpenchannelAccountId\x20IN\x20?',[][_0x5d7b('0x76')](_0x38dad7[_0x5d7b('0x3a')][_0x4723dc]));}else if(_0x4723dc===_0x5d7b('0x5a')){var _0x14d696=JSON['parse'](_0x38dad7[_0x5d7b('0x3a')][_0x4723dc])[_0x5d7b('0x77')];var _0x5c380a=JSON[_0x5d7b('0x59')](_0x38dad7[_0x5d7b('0x3a')][_0x4723dc])[_0x5d7b('0x78')];_0x556166[_0x5d7b('0x43')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x14d696,_0x5c380a);}else{if(_0x38dad7[_0x5d7b('0x3a')][_0x4723dc]==='null'){_0x556166['where']('i.'+_0x4723dc+'\x20IS\x20NULL');}else{_0x556166[_0x5d7b('0x43')]('i.'+_0x4723dc+'\x20=\x20?',_0x38dad7[_0x5d7b('0x3a')][_0x4723dc]);}}});}if(_0x38dad7['query']['filter']){var _0x552acb=_0x38dad7[_0x5d7b('0x3a')][_0x5d7b('0x73')][_0x5d7b('0x79')]('\x5c','\x5c\x5c')[_0x5d7b('0x79')]('\x27\x27',_0x5d7b('0x7a'));if(qs[_0x5d7b('0x7b')](_0x552acb)){_0x607a21['or'](_0x5d7b('0x7c'),_0x552acb+'%');}else{var _0xea910b=[];_0x552acb['split']('\x20')[_0x5d7b('0x34')](function(_0x379489){_0xea910b[_0x5d7b('0x35')]('+'+_0x379489[_0x5d7b('0x7d')]());});var _0x49d63e=_0xea910b['join']('\x20');_0x607a21['or'](_0x5d7b('0x7e'),_0x49d63e)['or'](_0x5d7b('0x7f'),_0x552acb+'%')['or'](_0x5d7b('0x80'),_0x552acb+'%');}}}_0x556166[_0x5d7b('0x43')](_0x607a21);if(_0x56b157['order']){_0x56b157[_0x5d7b('0x81')][_0x5d7b('0x34')](function(_0x4dc33e){_0x556166[_0x5d7b('0x81')]('i.'+_0x4dc33e[0x0],_0x4dc33e[0x1]==='DESC'?![]:!![]);});}_0x556166['group'](_0x5d7b('0x82'));var _0x5d2024={'type':db[_0x5d7b('0x83')][_0x5d7b('0x84')][_0x5d7b('0x85')],'raw':!![]};var _0x43fa0b=_0x556166[_0x5d7b('0x86')]()[_0x5d7b('0x46')](_0x5d7b('0x4a'))['field']('COUNT(me.id)','unreadMessages');if(!_0x38dad7[_0x5d7b('0x3a')][_0x5d7b('0x58')]){if(_0x38dad7['query'][_0x5d7b('0x87')]){if(_0x38dad7['query']['read']==0x1){_0x43fa0b[_0x5d7b('0x88')](_0x5d7b('0x89'));_0x556166[_0x5d7b('0x88')](_0x5d7b('0x89'));}else{_0x43fa0b['having'](_0x5d7b('0x8a'));_0x556166['having']('`unreadMessages`\x20>\x200');}}if(_0x38dad7[_0x5d7b('0x3a')][_0x5d7b('0x8b')]){var _0x222116=_[_0x5d7b('0x63')](_0x38dad7[_0x5d7b('0x3a')]['tag'])?_0x38dad7[_0x5d7b('0x3a')]['tag']:new Array(_0x38dad7[_0x5d7b('0x3a')][_0x5d7b('0x8b')]);var _0x213474=squel[_0x5d7b('0x57')]();_0x222116[_0x5d7b('0x34')](function(_0x120755){_0x213474['or'](_0x5d7b('0x8c'),'%,'+_0x120755+',%');});_0x556166[_0x5d7b('0x88')](_0x213474);_0x43fa0b[_0x5d7b('0x50')](_0x5d7b('0x8d'),'it',_0x5d7b('0x8e'));_0x43fa0b[_0x5d7b('0x50')](_0x5d7b('0x49'),'t',_0x5d7b('0x8f'));_0x43fa0b['where'](_0x5d7b('0x90'),_0x222116);}}else{var _0x568757=JSON[_0x5d7b('0x59')](_0x38dad7[_0x5d7b('0x3a')][_0x5d7b('0x58')]);_[_0x5d7b('0x39')](_0x568757)['forEach'](function(_0x1824e7){var _0x536ee1=_0x568757[_0x1824e7];if(_0x1824e7===_0x5d7b('0x65')){var _0x16efd6=_0x536ee1[_0x5d7b('0x67')];var _0x1ad060=squel['expr']();_0x16efd6[_0x5d7b('0x34')](function(_0x1b87cb){_0x1ad060['or'](_0x5d7b('0x8c'),'%,'+_0x1b87cb+',%');});_0x556166['having'](_0x1ad060);_0x43fa0b[_0x5d7b('0x50')](_0x5d7b('0x91'),'it','it.MailInteractionId\x20=\x20i.id');_0x43fa0b[_0x5d7b('0x50')](_0x5d7b('0x49'),'t',_0x5d7b('0x8f'));_0x43fa0b[_0x5d7b('0x43')](_0x5d7b('0x90'),_0x16efd6);}else if(_0x1824e7===_0x5d7b('0x66')){if(_0x536ee1[_0x5d7b('0x67')][_0x5d7b('0x3f')]===0x1){if(_0x536ee1['value'][0x0]===0x1){_0x43fa0b['having']('`unreadMessages`\x20=\x200');_0x556166[_0x5d7b('0x88')](_0x5d7b('0x89'));}else{_0x43fa0b[_0x5d7b('0x88')](_0x5d7b('0x8a'));_0x556166['having']('`unreadMessages`\x20>\x200');}}}});}db['sequelize'][_0x5d7b('0x3a')](_0x43fa0b[_0x5d7b('0x7d')](),_0x5d2024)['then'](function(_0x30bc3d){_0x3383a3[_0x5d7b('0x22')]=_0x30bc3d[_0x5d7b('0x3f')];if(_0x3383a3[_0x5d7b('0x22')]===0x0)return[];return db[_0x5d7b('0x92')]['query'](_0x222107[_0x5d7b('0x7d')](),_0x5d2024)['then'](function(_0x51ce34){_0x468552=_[_0x5d7b('0x93')](_0x51ce34,'id');_0x5d2024=_[_0x5d7b('0x94')](_0x5d2024,{'model':db[_0x5d7b('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x556166[_0x5d7b('0x46')](_0x5d7b('0x95'),_0x5d7b('0x66'));_0x556166[_0x5d7b('0x46')](_0x5d7b('0x96'),'Account.key');_0x556166[_0x5d7b('0x46')](_0x5d7b('0x97'));_0x556166[_0x5d7b('0x46')](_0x5d7b('0x6d'),_0x5d7b('0x98'));_0x556166[_0x5d7b('0x46')](_0x5d7b('0x6f'),_0x5d7b('0x99'));_0x556166['field'](_0x5d7b('0x70'),_0x5d7b('0x9a'));_0x556166['field']('c.phone',_0x5d7b('0x9b'));_0x556166[_0x5d7b('0x46')](_0x5d7b('0x9c'),_0x5d7b('0x9d'));_0x556166[_0x5d7b('0x46')]('c.fax',_0x5d7b('0x9e'));_0x556166[_0x5d7b('0x46')](_0x5d7b('0x9f'),_0x5d7b('0x31'));_0x556166[_0x5d7b('0x50')]('openchannel_interaction_has_tags','it',_0x5d7b('0x8e'));_0x556166[_0x5d7b('0x50')]('tools_tags','t','t.id\x20=\x20it.TagId');_0x556166[_0x5d7b('0x24')](_0x56b157[_0x5d7b('0x24')]);_0x556166[_0x5d7b('0x23')](_0x56b157[_0x5d7b('0x23')]);return db['sequelize'][_0x5d7b('0x3a')](_0x556166[_0x5d7b('0x7d')](),_0x5d2024);})[_0x5d7b('0x2b')](function(_0x32bbcf){_0x3bad3e[_0x5d7b('0x43')](_0x5d7b('0xa0'),_[_0x5d7b('0x30')](_0x32bbcf,'id'));return db[_0x5d7b('0x92')]['query'](_0x3bad3e['toString'](),_0x5d2024)[_0x5d7b('0x2b')](function(_0x2ae45d){var _0x3f6c2f=_[_0x5d7b('0xa1')](_0x2ae45d,_0x5d7b('0xa2'));var _0x3a5d2b=[];_0x32bbcf['forEach'](function(_0x31275e){_0x3a5d2b[_0x5d7b('0x35')](updateOpenchannelInteraction(_0x31275e,_0x468552,_0x3f6c2f));});return BPromise[_0x5d7b('0xa3')](_0x3a5d2b);});});})[_0x5d7b('0x2b')](function(_0x3de17b){_0x3383a3[_0x5d7b('0xa4')]=_0x3de17b;return _0x3383a3;})[_0x5d7b('0x2b')](respondWithFilteredResult(_0x350ed6,_0x56b157))['catch'](handleError(_0x350ed6,null));};exports['show']=function(_0x125a25,_0x3fd88d){var _0x31986a={'raw':![],'where':{'id':_0x125a25[_0x5d7b('0xa5')]['id']}},_0x1a2bee={};_0x1a2bee['model']=_['keys'](db['OpenchannelInteraction']['rawAttributes']);_0x1a2bee[_0x5d7b('0x3a')]=_[_0x5d7b('0x39')](_0x125a25[_0x5d7b('0x3a')]);_0x1a2bee['filters']=_[_0x5d7b('0x3c')](_0x1a2bee[_0x5d7b('0x38')],_0x1a2bee[_0x5d7b('0x3a')]);_0x31986a[_0x5d7b('0x3d')]=_[_0x5d7b('0x3c')](_0x1a2bee[_0x5d7b('0x38')],qs['fields'](_0x125a25[_0x5d7b('0x3a')][_0x5d7b('0x3e')]));_0x31986a[_0x5d7b('0x3d')]=_0x31986a[_0x5d7b('0x3d')][_0x5d7b('0x3f')]?_0x31986a[_0x5d7b('0x3d')]:_0x1a2bee[_0x5d7b('0x38')];if(_0x125a25[_0x5d7b('0x3a')][_0x5d7b('0xa6')]){_0x31986a['include']=[{'all':!![]}];}_0x31986a=_[_0x5d7b('0x94')]({},_0x31986a,_0x125a25['options']);return db['OpenchannelInteraction'][_0x5d7b('0xa7')](_0x31986a)[_0x5d7b('0x2b')](handleEntityNotFound(_0x3fd88d,null))[_0x5d7b('0x2b')](respondWithResult(_0x3fd88d,null))['catch'](handleError(_0x3fd88d,null));};exports[_0x5d7b('0xa8')]=function(_0x5c0f74,_0x683da1){return db[_0x5d7b('0x36')][_0x5d7b('0xa8')](_0x5c0f74[_0x5d7b('0xa9')],{})[_0x5d7b('0x2b')](respondWithResult(_0x683da1,0xc9))[_0x5d7b('0xaa')](handleError(_0x683da1,null));};exports['update']=function(_0x1be15b,_0x428ec4){if(_0x1be15b[_0x5d7b('0xa9')]['id']){delete _0x1be15b[_0x5d7b('0xa9')]['id'];}return db[_0x5d7b('0x36')][_0x5d7b('0xa7')]({'where':{'id':_0x1be15b[_0x5d7b('0xa5')]['id']}})['then'](handleEntityNotFound(_0x428ec4,null))[_0x5d7b('0x2b')](saveUpdates(_0x1be15b[_0x5d7b('0xa9')],null))[_0x5d7b('0x2b')](respondWithResult(_0x428ec4,null))['catch'](handleError(_0x428ec4,null));};exports['destroy']=function(_0x21a5e3,_0x3dbd75){return db[_0x5d7b('0x36')][_0x5d7b('0xa7')]({'where':{'id':_0x21a5e3['params']['id']}})[_0x5d7b('0x2b')](handleEntityNotFound(_0x3dbd75,null))[_0x5d7b('0x2b')](removeEntity(_0x3dbd75,null))[_0x5d7b('0xaa')](handleError(_0x3dbd75,null));};exports[_0x5d7b('0xab')]=function(_0xdb8f74,_0x1d57d3){return db[_0x5d7b('0x36')][_0x5d7b('0xab')]()[_0x5d7b('0x2b')](respondWithResult(_0x1d57d3,null))[_0x5d7b('0xaa')](handleError(_0x1d57d3,null));};exports[_0x5d7b('0xac')]=function(_0x41d0ff,_0x588705,_0xc7a5de){return db[_0x5d7b('0xad')][_0x5d7b('0xa7')]({'where':{'id':_0x41d0ff['params']['id']}})[_0x5d7b('0x2b')](handleEntityNotFound(_0x588705,null))[_0x5d7b('0x2b')](function(_0x446980){if(_0x446980){return _0x446980[_0x5d7b('0xac')](_0x41d0ff[_0x5d7b('0xa9')][_0x5d7b('0xae')],_['omit'](_0x41d0ff[_0x5d7b('0xa9')],[_0x5d7b('0xae'),'id'])||{});}})['then'](respondWithResult(_0x588705,null))['catch'](handleError(_0x588705,null));};exports['getMessages']=function(_0x307614,_0x2eecf8,_0x425a2c){var _0x4236aa={'raw':![],'where':{}};var _0x40d110={};var _0x1b234f={'count':0x0,'rows':[]};return db[_0x5d7b('0x36')]['findOne']({'where':{'id':_0x307614['params']['id']}})['then'](handleEntityNotFound(_0x2eecf8,null))['then'](function(_0x397046){if(_0x397046){_0x40d110[_0x5d7b('0x38')]=_[_0x5d7b('0x39')](db['OpenchannelMessage'][_0x5d7b('0x37')]);_0x40d110[_0x5d7b('0x3a')]=_[_0x5d7b('0x39')](_0x307614[_0x5d7b('0x3a')]);_0x40d110[_0x5d7b('0x3b')]=_[_0x5d7b('0x3c')](_0x40d110['model'],_0x40d110[_0x5d7b('0x3a')]);_0x4236aa['attributes']=_[_0x5d7b('0x3c')](_0x40d110[_0x5d7b('0x38')],qs['fields'](_0x307614['query'][_0x5d7b('0x3e')]));_0x4236aa[_0x5d7b('0x3d')]=_0x4236aa[_0x5d7b('0x3d')][_0x5d7b('0x3f')]?_0x4236aa[_0x5d7b('0x3d')]:_0x40d110[_0x5d7b('0x38')];if(!_0x307614[_0x5d7b('0x3a')][_0x5d7b('0x40')]('nolimit')){_0x4236aa[_0x5d7b('0x24')]=qs[_0x5d7b('0x24')](_0x307614['query'][_0x5d7b('0x24')]);_0x4236aa[_0x5d7b('0x23')]=qs[_0x5d7b('0x23')](_0x307614[_0x5d7b('0x3a')][_0x5d7b('0x23')]);}_0x4236aa[_0x5d7b('0x81')]=qs['sort'](_0x307614['query'][_0x5d7b('0x42')]);_0x4236aa[_0x5d7b('0x43')]=qs[_0x5d7b('0x3b')](_[_0x5d7b('0x44')](_0x307614[_0x5d7b('0x3a')],_0x40d110[_0x5d7b('0x3b')]));_0x4236aa['where'][_0x5d7b('0xa2')]=_0x397046['id'];if(_0x307614[_0x5d7b('0x3a')][_0x5d7b('0x73')]){_0x4236aa[_0x5d7b('0x43')]=_['merge'](_0x4236aa['where'],{'$or':_['map'](_0x4236aa[_0x5d7b('0x3d')],function(_0x38c508){var _0x2ef3b0={};_0x2ef3b0[_0x38c508]={'$like':'%'+_0x307614[_0x5d7b('0x3a')]['filter']+'%'};return _0x2ef3b0;})});}if(_0x307614[_0x5d7b('0x3a')][_0x5d7b('0x77')]){var _0x4da6f8=_0x307614['query'][_0x5d7b('0x77')][_0x5d7b('0x33')](',');var _0x159237={};_0x159237[_0x4da6f8[0x0]]={'$gte':moment(_0x4da6f8[0x1])[_0x5d7b('0x5d')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4236aa['where']=_[_0x5d7b('0x94')](_0x4236aa['where'],_0x159237);}_0x4236aa=_['merge']({},_0x4236aa,_0x307614['options']);return db[_0x5d7b('0xad')][_0x5d7b('0x22')]({'where':_0x4236aa[_0x5d7b('0x43')]})['then'](function(_0x29fe77){_0x1b234f[_0x5d7b('0x22')]=_0x29fe77;if(_0x307614[_0x5d7b('0x3a')][_0x5d7b('0xa6')]){_0x4236aa[_0x5d7b('0xaf')]=[{'all':!![]}];}return db[_0x5d7b('0xad')][_0x5d7b('0xb0')](_0x4236aa);})[_0x5d7b('0x2b')](function(_0x6068a8){_0x1b234f[_0x5d7b('0xa4')]=_0x6068a8;return _0x1b234f;});}})['then'](respondWithFilteredResult(_0x2eecf8,_0x4236aa))[_0x5d7b('0xaa')](handleError(_0x2eecf8,null));};exports[_0x5d7b('0xb1')]=function(_0x26bd69,_0x110321,_0x3cde01){return db[_0x5d7b('0x36')][_0x5d7b('0xa7')]({'where':{'id':_0x26bd69[_0x5d7b('0xa5')]['id']}})[_0x5d7b('0x2b')](handleEntityNotFound(_0x110321,null))[_0x5d7b('0x2b')](function(_0x759f95){if(_0x759f95){return _0x759f95['setTags'](_0x26bd69['body'][_0x5d7b('0xae')],_[_0x5d7b('0xb2')](_0x26bd69[_0x5d7b('0xa9')],['ids','id'])||{})['spread'](function(){return db[_0x5d7b('0xb3')][_0x5d7b('0xb0')]({'attributes':['id',_0x5d7b('0x2e'),_0x5d7b('0x47')],'where':{'id':_0x26bd69[_0x5d7b('0xa9')][_0x5d7b('0xae')]}});})[_0x5d7b('0x2b')](function(_0x44d093){socket[_0x5d7b('0xb4')](_0x5d7b('0xb5'),{'id':Number(_0x26bd69[_0x5d7b('0xa5')]['id']),'tags':_0x44d093||[]});return{'id':Number(_0x26bd69[_0x5d7b('0xa5')]['id']),'tags':_0x44d093||[]};});}})[_0x5d7b('0x2b')](respondWithResult(_0x110321,null))[_0x5d7b('0xaa')](handleError(_0x110321,null));};exports['removeTags']=function(_0x83170,_0x847cb,_0x28f2b8){return db[_0x5d7b('0x36')][_0x5d7b('0xa7')]({'where':{'id':_0x83170[_0x5d7b('0xa5')]['id']}})[_0x5d7b('0x2b')](handleEntityNotFound(_0x847cb,null))[_0x5d7b('0x2b')](function(_0x3bd3d5){if(_0x3bd3d5){return _0x3bd3d5[_0x5d7b('0xb6')](_0x83170['query'][_0x5d7b('0xae')]);}})[_0x5d7b('0x2b')](respondWithStatusCode(_0x847cb,null))[_0x5d7b('0xaa')](handleError(_0x847cb,null));};exports['download']=function(_0x54803c,_0xc719cd){var _0x46ab84=moment()[_0x5d7b('0xb7')]()[_0x5d7b('0x7d')]();var _0x191526=path[_0x5d7b('0xb8')](config[_0x5d7b('0xb9')],_0x5d7b('0xba'),_0x5d7b('0xbb'),_0x5d7b('0xbc'));var _0x58295d=path[_0x5d7b('0xb8')](config[_0x5d7b('0xb9')],_0x5d7b('0xba'),'files','attachments');var _0xd41278=path['join'](_0x191526,_0x46ab84);var _0x1ebea5=util[_0x5d7b('0x5d')](_0x5d7b('0xbd'),_0x54803c[_0x5d7b('0xa5')]['id'],_0x46ab84);var _0x584116=path['join'](_0x191526,_0x1ebea5);var _0x4832ef=![];return db[_0x5d7b('0x36')][_0x5d7b('0xa7')]({'where':{'id':_0x54803c[_0x5d7b('0xa5')]['id']},'include':[{'model':db[_0x5d7b('0xad')],'as':_0x5d7b('0xbe'),'attributes':['id',_0x5d7b('0xa9'),_0x5d7b('0x5a'),'direction','secret'],'include':[{'model':db[_0x5d7b('0xbf')],'as':_0x5d7b('0xbf'),'attributes':['id',_0x5d7b('0xc0')],'raw':!![]},{'model':db['CmContact'],'as':_0x5d7b('0xc1'),'attributes':['id',_0x5d7b('0xc2'),'lastName'],'raw':!![]},{'model':db['Attachment'],'as':_0x5d7b('0xc3'),'raw':!![]}]},{'model':db[_0x5d7b('0xc4')],'as':'Account','attributes':['id','name']},{'model':db[_0x5d7b('0xbf')],'as':'Owner','attributes':['id','fullname']}]})[_0x5d7b('0x2b')](handleEntityNotFound(_0xc719cd,null))[_0x5d7b('0x2b')](function(_0x267cb0){if(_0x267cb0){var _0x39edee=_0x267cb0[_0x5d7b('0xc5')]({'plain':!![]});_0x4832ef=!![];var _0xd69f04={'format':'A4','border':_0x5d7b('0xc6'),'header':{'height':'40px','contents':{'first':_0x5d7b('0xc7')}},'footer':{'height':'30px','contents':{'default':util['format'](_0x5d7b('0xc8'),util['format']('%s\x20#%d',_0x5d7b('0xc9'),_0x39edee['id']),moment()[_0x5d7b('0x5d')](_0x5d7b('0xca'))[_0x5d7b('0x7d')]())}}};fs['mkdirSync'](_0xd41278);var _0x218ca8={'channel':_0x5d7b('0xc9'),'account':_0x39edee[_0x5d7b('0xcb')]['name'],'agent':_0x39edee[_0x5d7b('0xcc')]?_0x39edee[_0x5d7b('0xcc')]['fullname']:'N.A.','createdAt':moment(_0x39edee[_0x5d7b('0x5a')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x5d7b('0x7d')](),'closedAt':_0x39edee['closed']?moment(_0x39edee['closedAt'])[_0x5d7b('0x5d')](_0x5d7b('0xcd'))[_0x5d7b('0x7d')]():'','disposition':_0x39edee[_0x5d7b('0xce')],'visibility':_0x39edee[_0x5d7b('0xcf')]?_0x5d7b('0xd0'):_0x5d7b('0xd1'),'messages':_(_0x39edee[_0x5d7b('0xbe')])[_0x5d7b('0x73')]({'secret':![]})[_0x5d7b('0x30')](function(_0x2a8a5d){if(_0x2a8a5d[_0x5d7b('0xc3')]){var _0x327a91=path[_0x5d7b('0xb8')](_0x58295d,_0x2a8a5d[_0x5d7b('0xc3')]['basename']);if(fs[_0x5d7b('0xd2')](_0x327a91)){fs[_0x5d7b('0xd3')](_0x327a91)['pipe'](fs['createWriteStream'](path[_0x5d7b('0xb8')](_0xd41278,_0x2a8a5d[_0x5d7b('0xc3')][_0x5d7b('0xd4')])));}}return{'date':moment(_0x2a8a5d[_0x5d7b('0x5a')])[_0x5d7b('0x5d')](_0x5d7b('0xcd'))[_0x5d7b('0x7d')](),'sender':_0x2a8a5d[_0x5d7b('0xd5')]===_0x5d7b('0xd6')?_0x2a8a5d[_0x5d7b('0xbf')]?_0x2a8a5d['User']['fullname']:'System':_0x2a8a5d[_0x5d7b('0xc1')][_0x5d7b('0xc2')]+(_0x2a8a5d[_0x5d7b('0xc1')][_0x5d7b('0xd7')]?'\x20'+_0x2a8a5d[_0x5d7b('0xc1')][_0x5d7b('0xd7')]:''),'body':_0x2a8a5d[_0x5d7b('0xc3')]?_0x2a8a5d[_0x5d7b('0xc3')]['basename']:_0x2a8a5d[_0x5d7b('0xa9')],'direction':_0x2a8a5d[_0x5d7b('0xd5')]===_0x5d7b('0xd6')?'A':'C','secret':_0x2a8a5d[_0x5d7b('0xd8')],'attachment':_0x2a8a5d['Attachment']};})['value']()};return ejs[_0x5d7b('0xd9')](path[_0x5d7b('0xb8')](config[_0x5d7b('0xb9')],'server',_0x5d7b('0xda'),_0x5d7b('0xdb')),{'interaction':_0x218ca8})['then'](function(_0x5bdccb){return new BPromise(function(_0x8b33fd,_0x3c20d6){pdf[_0x5d7b('0xa8')](_0x5bdccb,_0xd69f04)[_0x5d7b('0xdc')](path[_0x5d7b('0xb8')](_0xd41278,'transcript-'+_0x39edee['id']+'-'+_0x46ab84+_0x5d7b('0xdd')),function(_0x4f8ddb,_0x271b68){if(_0x4f8ddb)return _0x3c20d6(_0x4f8ddb);_0x8b33fd(_0x271b68);});});});}})[_0x5d7b('0x2b')](function(){if(_0x4832ef){return new BPromise(function(_0x800217,_0x41253c){zipdir(_0xd41278,{'saveTo':_0x584116},function(_0x212fa2,_0x349bda){if(_0x212fa2)return _0x41253c(_0x212fa2);return _0x800217(_0x349bda);});})['then'](function(){return new BPromise(function(_0x5ae857,_0x3192e9){rimraf(_0xd41278,function(_0x435697){if(_0x435697)_0x3192e9(_0x435697);return _0x5ae857();});});})[_0x5d7b('0x2b')](function(){return _0xc719cd[_0x5d7b('0xde')](_0x584116,_0x1ebea5,function(_0x2627a3){if(_0x2627a3){console[_0x5d7b('0xdf')](_0x5d7b('0xe0'),_0x2627a3);}else{fs['unlinkSync'](_0x584116);}});});}else{return _0xc719cd['sendStatus'](0xc8);}})[_0x5d7b('0xaa')](handleError(_0xc719cd,null));}; \ No newline at end of file +var _0xc98f=['catch','OpenchannelInteraction','rawAttributes','keys','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','select','field','color','from','tools_tags','COUNT(*)','me.OpenchannelInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','ui.OpenchannelInteractionId','user_has_openchannel_interactions','users','u.id\x20=\x20ui.UserId','cm_contacts','left_join','o.id\x20=\x20i.UserId','openchannel_accounts','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false','expr','advancedFilter','parse','createdAt','value','startOf','day','utc','format','endOf','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','forEach','TagId','unreadMessages','length','\x20IN\x20?','tableAlias','\x20=\x20?','ContactId','c.firstName','\x20LIKE\x20?','c.lastName','\x20>\x20?','LIKE','c.email','\x20<\x20?','isNil','concat','$gte','null','\x20IS\x20NULL','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','split','push','toString','join','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','order','group','Sequelize','QueryTypes','SELECT','clone','COUNT(me.id)','read','having','`unreadMessages`\x20>\x200','tag','it.OpenchannelInteractionId\x20=\x20i.id','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','`unreadMessages`\x20=\x200','sequelize','keyBy','merge','a.key','i.*','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','openchannel_interaction_has_tags','map','groupBy','OpenchannelInteractionId','all','rows','show','params','options','find','create','body','update','describe','addMessage','OpenchannelMessage','ids','omit','findOne','pick','includeAll','include','findAll','addTags','setTags','Tag','emit','openchannelInteractionTags:save','removeTags','unix','root','server','files','attachments','transcript-%d-%s.zip','Messages','direction','secret','User','fullname','CmContact','Attachment','OpenchannelAccount','Account','10px','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Openchannel','YYYY-MM-DD','mkdirSync','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','threadId','basename','pipe','createWriteStream','Contact','firstName','lastName','renderFile','downloadInteraction.html','toFile','transcript-','log','err','html-pdf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','then','destroy','error','name','send','Users','TagIds','Tags'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xc98f,0x191));var _0xfc98=function(_0x3239af,_0x5b3219){_0x3239af=_0x3239af-0x0;var _0x207653=_0xc98f[_0x3239af];return _0x207653;};'use strict';var pdf=require(_0xfc98('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfc98('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfc98('0x2'));var moment=require(_0xfc98('0x3'));var BPromise=require(_0xfc98('0x4'));var Mustache=require(_0xfc98('0x5'));var util=require(_0xfc98('0x6'));var path=require(_0xfc98('0x7'));var sox=require(_0xfc98('0x8'));var csv=require(_0xfc98('0x9'));var ejs=require(_0xfc98('0xa'));var fs=require('fs');var _=require(_0xfc98('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xfc98('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xfc98('0x9'));var querystring=require('querystring');var Papa=require(_0xfc98('0xd'));var Redis=require('ioredis');var authService=require(_0xfc98('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xfc98('0xf'));var logger=require(_0xfc98('0x10'))('api');var utils=require(_0xfc98('0x11'));var config=require(_0xfc98('0x12'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xfc98('0x13')](config[_0xfc98('0x14')],{'host':_0xfc98('0x15'),'port':0x18eb});var socket=require(_0xfc98('0x16'))(new Redis(config['redis']));require(_0xfc98('0x17'))[_0xfc98('0x18')](socket);function respondWithStatusCode(_0x2d57a2,_0x308a64){_0x308a64=_0x308a64||0xcc;return function(_0x38ca82){if(_0x38ca82){return _0x2d57a2[_0xfc98('0x19')](_0x308a64);}return _0x2d57a2[_0xfc98('0x1a')](_0x308a64)[_0xfc98('0x1b')]();};}function respondWithResult(_0x2d7a8c,_0x583a6a){_0x583a6a=_0x583a6a||0xc8;return function(_0x2f8841){if(_0x2f8841){return _0x2d7a8c[_0xfc98('0x1a')](_0x583a6a)[_0xfc98('0x1c')](_0x2f8841);}};}function respondWithFilteredResult(_0x38269c,_0x5d0899){return function(_0x35a5c1){if(_0x35a5c1){var _0x3945f3=_0x35a5c1[_0xfc98('0x1d')],_0x9d2a84=_0x5d0899[_0xfc98('0x1e')],_0x13508d=_0x5d0899[_0xfc98('0x1e')]+_0x5d0899[_0xfc98('0x1f')],_0x4919be;if(_0x13508d>=_0x3945f3){_0x13508d=_0x3945f3;_0x4919be=0xc8;}else{_0x4919be=0xce;}_0x38269c[_0xfc98('0x1a')](_0x4919be);return _0x38269c['set'](_0xfc98('0x20'),_0x9d2a84+'-'+_0x13508d+'/'+_0x3945f3)[_0xfc98('0x1c')](_0x35a5c1);}return null;};}function patchUpdates(_0x1550c9){return function(_0x5d47e3){try{jsonpatch[_0xfc98('0x21')](_0x5d47e3,_0x1550c9,!![]);}catch(_0x4b2aad){return BPromise[_0xfc98('0x22')](_0x4b2aad);}return _0x5d47e3['save']();};}function saveUpdates(_0x2fa8f6,_0x3ac413){return function(_0x267943){if(_0x267943){return _0x267943['update'](_0x2fa8f6)[_0xfc98('0x23')](function(_0x465d13){return _0x465d13;});}return null;};}function removeEntity(_0x158f16,_0x2157cc){return function(_0x31afc0){if(_0x31afc0){return _0x31afc0[_0xfc98('0x24')]()[_0xfc98('0x23')](function(){_0x158f16['status'](0xcc)[_0xfc98('0x1b')]();});}};}function handleEntityNotFound(_0x380a01,_0x4189f0){return function(_0xc2fc91){if(!_0xc2fc91){_0x380a01[_0xfc98('0x19')](0x194);}return _0xc2fc91;};}function handleError(_0x2e8486,_0xe2b6a8){_0xe2b6a8=_0xe2b6a8||0x1f4;return function(_0x45954e){logger[_0xfc98('0x25')](_0x45954e['stack']);if(_0x45954e[_0xfc98('0x26')]){delete _0x45954e[_0xfc98('0x26')];}_0x2e8486[_0xfc98('0x1a')](_0xe2b6a8)[_0xfc98('0x27')](_0x45954e);};}function getInteractionUsers(_0x304549,_0x55fecb){return new BPromise(function(_0x4e0d4f,_0x184b91){try{if(_0x55fecb[_0x304549['id']]){_0x304549[_0xfc98('0x28')]=_['map'](_0x55fecb[_0x304549['id']],function(_0x23317e){return{'id':_0x23317e['id']};});}}catch(_0x2ecded){_0x184b91(_0x2ecded);}_0x4e0d4f(_0x304549);});}function getInteractionTags(_0x115a5d,_0x48baaf){return new BPromise(function(_0x504af8,_0x374ed3){try{if(_0x115a5d[_0xfc98('0x29')]){_0x115a5d[_0xfc98('0x2a')]=[];_0x115a5d[_0xfc98('0x29')]['split'](',')['forEach'](function(_0x494897){_0x115a5d[_0xfc98('0x2a')]['push'](_0x48baaf[_0x494897]);});}delete _0x115a5d[_0xfc98('0x29')];}catch(_0x2e524a){_0x374ed3(_0x2e524a);}_0x504af8(_0x115a5d);});}function updateOpenchannelInteraction(_0x430137,_0x2d2b70,_0x7e09cd){return new BPromise(function(_0x5ca962,_0x3e239b){return getInteractionUsers(_0x430137,_0x7e09cd)[_0xfc98('0x23')](function(_0x47966e){return getInteractionTags(_0x47966e,_0x2d2b70);})[_0xfc98('0x23')](function(_0x32644c){_0x5ca962(_0x32644c);})[_0xfc98('0x2b')](function(_0x6b18e1){_0x3e239b(_0x6b18e1);});});}exports['index']=function(_0x388a42,_0x4d0f5c){var _0x530b9b={},_0x1fb299={},_0x706fd9={'count':0x0,'rows':[]};var _0x50e140=db[_0xfc98('0x2c')][_0xfc98('0x2d')];_0x1fb299['model']=_[_0xfc98('0x2e')](_0x50e140);_0x1fb299[_0xfc98('0x2f')]=_[_0xfc98('0x2e')](_0x388a42[_0xfc98('0x2f')]);_0x1fb299[_0xfc98('0x30')]=_['intersection'](_0x1fb299[_0xfc98('0x31')],_0x1fb299[_0xfc98('0x2f')]);_0x530b9b[_0xfc98('0x32')]=_[_0xfc98('0x33')](_0x1fb299[_0xfc98('0x31')],qs[_0xfc98('0x34')](_0x388a42[_0xfc98('0x2f')]['fields']));_0x530b9b[_0xfc98('0x32')]=_0x530b9b[_0xfc98('0x32')]['length']?_0x530b9b[_0xfc98('0x32')]:_0x1fb299[_0xfc98('0x31')];if(!_0x388a42['query'][_0xfc98('0x35')](_0xfc98('0x36'))){_0x530b9b['limit']=qs['limit'](_0x388a42[_0xfc98('0x2f')]['limit']);_0x530b9b[_0xfc98('0x1e')]=qs[_0xfc98('0x1e')](_0x388a42[_0xfc98('0x2f')][_0xfc98('0x1e')]);}_0x530b9b['order']=qs[_0xfc98('0x37')](_0x388a42['query'][_0xfc98('0x37')]);_0x530b9b[_0xfc98('0x38')]=qs[_0xfc98('0x30')](_['pick'](_0x388a42[_0xfc98('0x2f')],_0x1fb299['filters']));var _0x481602=[];var _0x20d928=squel[_0xfc98('0x39')]()[_0xfc98('0x3a')]('id')[_0xfc98('0x3a')](_0xfc98('0x26'))[_0xfc98('0x3a')](_0xfc98('0x3b'))[_0xfc98('0x3c')](_0xfc98('0x3d'));var _0x53759e=squel[_0xfc98('0x39')]()[_0xfc98('0x3a')](_0xfc98('0x3e'))[_0xfc98('0x3c')]('openchannel_messages','me')[_0xfc98('0x38')](_0xfc98('0x3f'))[_0xfc98('0x38')](_0xfc98('0x40'))[_0xfc98('0x38')](_0xfc98('0x41'));var _0x49a51a=squel[_0xfc98('0x39')]()[_0xfc98('0x3a')](_0xfc98('0x42'))[_0xfc98('0x3a')](_0xfc98('0x43'))['from'](_0xfc98('0x44'),'ui')['left_join'](_0xfc98('0x45'),'u',_0xfc98('0x46'));var _0x4063b6=squel[_0xfc98('0x39')]()[_0xfc98('0x3c')]('openchannel_interactions','i')['left_join'](_0xfc98('0x47'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xfc98('0x48')]('users','o',_0xfc98('0x49'))[_0xfc98('0x48')](_0xfc98('0x4a'),'a','a.id\x20=\x20i.OpenchannelAccountId')[_0xfc98('0x48')](_0xfc98('0x4b'),'me',_0xfc98('0x4c'));var _0x3d98cb=squel[_0xfc98('0x4d')]();if(_0x388a42[_0xfc98('0x2f')][_0xfc98('0x4e')]){var _0x557ccd=JSON[_0xfc98('0x4f')](_0x388a42[_0xfc98('0x2f')][_0xfc98('0x4e')]);_['keys'](_0x557ccd)['forEach'](function(_0x2b85e6){var _0x39d0c5=_0x557ccd[_0x2b85e6];if(_0x2b85e6===_0xfc98('0x50')){var _0x204775=moment(_0x39d0c5[_0xfc98('0x51')]['dateStart'])[_0xfc98('0x52')](_0xfc98('0x53'))[_0xfc98('0x54')]()[_0xfc98('0x55')]();var _0x17c463=moment(_0x17c463)['utc']()[_0xfc98('0x56')]('day')[_0xfc98('0x55')]();_0x3d98cb[_0xfc98('0x57')](_0xfc98('0x58'),_0x204775,_0x17c463);}else{if(_[_0xfc98('0x59')](_0x39d0c5['condition'])){_0x39d0c5[_0xfc98('0x5a')][_0xfc98('0x5b')](function(_0x117c07){switch(_0x39d0c5['condition'][_0xfc98('0x51')]){case'IS':if(_0x2b85e6!==_0xfc98('0x5c')&&_0x2b85e6!==_0xfc98('0x5d')){if(_['isArray'](_0x39d0c5['value'])&&_0x39d0c5[_0xfc98('0x51')][_0xfc98('0x5e')]>0x1){_0x3d98cb[_0xfc98('0x57')](_0x39d0c5['tableAlias']+'.'+_0x2b85e6+_0xfc98('0x5f'),_0x39d0c5['value']);}else{_0x3d98cb[_0xfc98('0x57')](_0x39d0c5[_0xfc98('0x60')]+'.'+_0x2b85e6+_0xfc98('0x61'),_0x39d0c5[_0xfc98('0x51')][0x0]);}}break;case'=':_0x3d98cb[_0xfc98('0x57')](_0x39d0c5['tableAlias']+'.'+_0x2b85e6+_0xfc98('0x61'),_0x39d0c5['value']);break;case'LIKE':if(_0x2b85e6===_0xfc98('0x62')){_0x3d98cb[_0xfc98('0x57')](_0xfc98('0x63')+_0xfc98('0x64'),'%'+_0x39d0c5['value']+'%');_0x3d98cb['or'](_0xfc98('0x65')+_0xfc98('0x64'),'%'+_0x39d0c5[_0xfc98('0x51')]+'%');_0x3d98cb['or']('c.email'+'\x20LIKE\x20?','%'+_0x39d0c5['value']+'%');}else{_0x3d98cb['and'](_0x39d0c5[_0xfc98('0x60')]+'.'+_0x2b85e6+_0xfc98('0x64'),'%'+_0x39d0c5[_0xfc98('0x51')]+'%');}break;case'>':_0x3d98cb[_0xfc98('0x57')](_0x39d0c5[_0xfc98('0x60')]+'.'+_0x2b85e6+_0xfc98('0x66'),_0x39d0c5[_0xfc98('0x51')]);break;case'<':_0x3d98cb[_0xfc98('0x57')](_0x39d0c5['tableAlias']+'.'+_0x2b85e6+'\x20<\x20?',_0x39d0c5[_0xfc98('0x51')]);break;}});}else{switch(_0x39d0c5['condition'][_0xfc98('0x51')]){case'IS':if(_0x2b85e6!==_0xfc98('0x5c')&&_0x2b85e6!==_0xfc98('0x5d')){if(_[_0xfc98('0x59')](_0x39d0c5[_0xfc98('0x51')])&&_0x39d0c5[_0xfc98('0x51')][_0xfc98('0x5e')]>0x1){_0x3d98cb['and'](_0x39d0c5['tableAlias']+'.'+_0x2b85e6+_0xfc98('0x5f'),_0x39d0c5[_0xfc98('0x51')]);}else{_0x3d98cb[_0xfc98('0x57')](_0x39d0c5['tableAlias']+'.'+_0x2b85e6+_0xfc98('0x61'),_0x39d0c5[_0xfc98('0x51')][0x0]);}}break;case'=':_0x3d98cb[_0xfc98('0x57')](_0x39d0c5['tableAlias']+'.'+_0x2b85e6+_0xfc98('0x61'),_0x39d0c5['value']);break;case _0xfc98('0x67'):if(_0x2b85e6===_0xfc98('0x62')){_0x3d98cb['and'](_0xfc98('0x63')+'\x20LIKE\x20?','%'+_0x39d0c5[_0xfc98('0x51')]+'%');_0x3d98cb['or'](_0xfc98('0x65')+_0xfc98('0x64'),'%'+_0x39d0c5[_0xfc98('0x51')]+'%');_0x3d98cb['or'](_0xfc98('0x68')+_0xfc98('0x64'),'%'+_0x39d0c5[_0xfc98('0x51')]+'%');}else{_0x3d98cb[_0xfc98('0x57')](_0x39d0c5[_0xfc98('0x60')]+'.'+_0x2b85e6+_0xfc98('0x64'),'%'+_0x39d0c5[_0xfc98('0x51')]+'%');}break;case'>':_0x3d98cb['and'](_0x39d0c5[_0xfc98('0x60')]+'.'+_0x2b85e6+'\x20>\x20?',_0x39d0c5[_0xfc98('0x51')]);break;case'<':_0x3d98cb[_0xfc98('0x57')](_0x39d0c5[_0xfc98('0x60')]+'.'+_0x2b85e6+_0xfc98('0x69'),_0x39d0c5[_0xfc98('0x51')]);break;}}}});}else{var _0x5926f1=_(Object['keys'](_0x388a42[_0xfc98('0x2f')]))['map'](function(_0x485bee){return _0x50e140[_0xfc98('0x35')](_0x485bee)?_0x485bee:undefined;})['filter'](function(_0x3d3ec7){return!_[_0xfc98('0x6a')](_0x3d3ec7);})['value']();if(!_['isEmpty'](_0x5926f1)){_0x5926f1[_0xfc98('0x5b')](function(_0x11816e){if(_0x11816e==='OpenchannelAccountId'){_0x4063b6['where']('i.OpenchannelAccountId\x20IN\x20?',[][_0xfc98('0x6b')](_0x388a42['query'][_0x11816e]));}else if(_0x11816e===_0xfc98('0x50')){var _0x4c4867=JSON[_0xfc98('0x4f')](_0x388a42[_0xfc98('0x2f')][_0x11816e])[_0xfc98('0x6c')];var _0x2f81c5=JSON[_0xfc98('0x4f')](_0x388a42[_0xfc98('0x2f')][_0x11816e])['$lte'];_0x4063b6[_0xfc98('0x38')](_0xfc98('0x58'),_0x4c4867,_0x2f81c5);}else{if(_0x388a42['query'][_0x11816e]===_0xfc98('0x6d')){_0x4063b6[_0xfc98('0x38')]('i.'+_0x11816e+_0xfc98('0x6e'));}else{_0x4063b6['where']('i.'+_0x11816e+_0xfc98('0x61'),_0x388a42[_0xfc98('0x2f')][_0x11816e]);}}});}if(_0x388a42[_0xfc98('0x2f')]['filter']){var _0xf87fda=_0x388a42['query'][_0xfc98('0x6f')][_0xfc98('0x70')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0xfc98('0x71'));if(qs[_0xfc98('0x72')](_0xf87fda)){_0x3d98cb['or'](_0xfc98('0x73'),_0xf87fda+'%');}else{var _0xcf358e=[];_0xf87fda[_0xfc98('0x74')]('\x20')['forEach'](function(_0x189622){_0xcf358e[_0xfc98('0x75')]('+'+_0x189622[_0xfc98('0x76')]());});var _0x295245=_0xcf358e[_0xfc98('0x77')]('\x20');_0x3d98cb['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',_0x295245)['or']('i.from\x20LIKE\x20?',_0xf87fda+'%')['or'](_0xfc98('0x78'),_0xf87fda+'%');}}}_0x4063b6[_0xfc98('0x38')](_0x3d98cb);if(_0x530b9b[_0xfc98('0x79')]){_0x530b9b[_0xfc98('0x79')][_0xfc98('0x5b')](function(_0x422c01){_0x4063b6[_0xfc98('0x79')]('i.'+_0x422c01[0x0],_0x422c01[0x1]==='DESC'?![]:!![]);});}_0x4063b6[_0xfc98('0x7a')]('i.id');var _0x2a87d9={'type':db[_0xfc98('0x7b')][_0xfc98('0x7c')][_0xfc98('0x7d')],'raw':!![]};var _0x2284be=_0x4063b6[_0xfc98('0x7e')]()[_0xfc98('0x3a')](_0xfc98('0x3e'))['field'](_0xfc98('0x7f'),_0xfc98('0x5d'));if(!_0x388a42[_0xfc98('0x2f')][_0xfc98('0x4e')]){if(_0x388a42[_0xfc98('0x2f')][_0xfc98('0x80')]){if(_0x388a42[_0xfc98('0x2f')][_0xfc98('0x80')]==0x1){_0x2284be[_0xfc98('0x81')]('`unreadMessages`\x20=\x200');_0x4063b6['having']('`unreadMessages`\x20=\x200');}else{_0x2284be[_0xfc98('0x81')](_0xfc98('0x82'));_0x4063b6[_0xfc98('0x81')](_0xfc98('0x82'));}}if(_0x388a42[_0xfc98('0x2f')][_0xfc98('0x83')]){var _0x341357=_[_0xfc98('0x59')](_0x388a42['query'][_0xfc98('0x83')])?_0x388a42[_0xfc98('0x2f')]['tag']:new Array(_0x388a42[_0xfc98('0x2f')][_0xfc98('0x83')]);var _0xaa03c5=squel[_0xfc98('0x4d')]();_0x341357[_0xfc98('0x5b')](function(_0x783f29){_0xaa03c5['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x783f29+',%');});_0x4063b6[_0xfc98('0x81')](_0xaa03c5);_0x2284be[_0xfc98('0x48')]('openchannel_interaction_has_tags','it',_0xfc98('0x84'));_0x2284be[_0xfc98('0x48')](_0xfc98('0x3d'),'t','t.id\x20=\x20it.TagId');_0x2284be['where']('t.id\x20IN\x20?',_0x341357);}}else{var _0x557ccd=JSON[_0xfc98('0x4f')](_0x388a42['query'][_0xfc98('0x4e')]);_['keys'](_0x557ccd)[_0xfc98('0x5b')](function(_0x595162){var _0x3496d9=_0x557ccd[_0x595162];if(_0x595162===_0xfc98('0x5c')){var _0xdf3dcd=_0x3496d9[_0xfc98('0x51')];var _0x143e18=squel[_0xfc98('0x4d')]();_0xdf3dcd[_0xfc98('0x5b')](function(_0x153eff){_0x143e18['or'](_0xfc98('0x85'),'%,'+_0x153eff+',%');});_0x4063b6['having'](_0x143e18);_0x2284be[_0xfc98('0x48')](_0xfc98('0x86'),'it',_0xfc98('0x87'));_0x2284be[_0xfc98('0x48')]('tools_tags','t',_0xfc98('0x88'));_0x2284be['where']('t.id\x20IN\x20?',_0xdf3dcd);}else if(_0x595162===_0xfc98('0x5d')){if(_0x3496d9[_0xfc98('0x51')][_0xfc98('0x5e')]===0x1){if(_0x3496d9[_0xfc98('0x51')][0x0]===0x1){_0x2284be[_0xfc98('0x81')](_0xfc98('0x89'));_0x4063b6[_0xfc98('0x81')](_0xfc98('0x89'));}else{_0x2284be[_0xfc98('0x81')]('`unreadMessages`\x20>\x200');_0x4063b6[_0xfc98('0x81')](_0xfc98('0x82'));}}}});}db[_0xfc98('0x8a')]['query'](_0x2284be[_0xfc98('0x76')](),_0x2a87d9)[_0xfc98('0x23')](function(_0x8fe27e){_0x706fd9[_0xfc98('0x1d')]=_0x8fe27e[_0xfc98('0x5e')];if(_0x706fd9[_0xfc98('0x1d')]===0x0)return[];return db['sequelize'][_0xfc98('0x2f')](_0x20d928[_0xfc98('0x76')](),_0x2a87d9)['then'](function(_0x49340f){_0x481602=_[_0xfc98('0x8b')](_0x49340f,'id');_0x2a87d9=_[_0xfc98('0x8c')](_0x2a87d9,{'model':db[_0xfc98('0x2c')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x4063b6[_0xfc98('0x3a')](_0xfc98('0x7f'),_0xfc98('0x5d'));_0x4063b6['field'](_0xfc98('0x8d'),'Account.key');_0x4063b6[_0xfc98('0x3a')](_0xfc98('0x8e'));_0x4063b6[_0xfc98('0x3a')](_0xfc98('0x63'),'Contact.firstName');_0x4063b6[_0xfc98('0x3a')](_0xfc98('0x65'),_0xfc98('0x8f'));_0x4063b6[_0xfc98('0x3a')](_0xfc98('0x68'),_0xfc98('0x90'));_0x4063b6[_0xfc98('0x3a')](_0xfc98('0x91'),_0xfc98('0x92'));_0x4063b6[_0xfc98('0x3a')](_0xfc98('0x93'),_0xfc98('0x94'));_0x4063b6[_0xfc98('0x3a')]('c.fax',_0xfc98('0x95'));_0x4063b6[_0xfc98('0x3a')](_0xfc98('0x96'),'TagIds');_0x4063b6[_0xfc98('0x48')](_0xfc98('0x97'),'it',_0xfc98('0x84'));_0x4063b6['left_join'](_0xfc98('0x3d'),'t',_0xfc98('0x88'));_0x4063b6[_0xfc98('0x1f')](_0x530b9b[_0xfc98('0x1f')]);_0x4063b6['offset'](_0x530b9b[_0xfc98('0x1e')]);return db['sequelize'][_0xfc98('0x2f')](_0x4063b6[_0xfc98('0x76')](),_0x2a87d9);})['then'](function(_0x44bb7f){_0x49a51a['where']('ui.OpenchannelInteractionId\x20IN\x20?',_[_0xfc98('0x98')](_0x44bb7f,'id'));return db[_0xfc98('0x8a')][_0xfc98('0x2f')](_0x49a51a['toString'](),_0x2a87d9)['then'](function(_0x43af94){var _0x5108d9=_[_0xfc98('0x99')](_0x43af94,_0xfc98('0x9a'));var _0x493e3c=[];_0x44bb7f[_0xfc98('0x5b')](function(_0x3136bd){_0x493e3c['push'](updateOpenchannelInteraction(_0x3136bd,_0x481602,_0x5108d9));});return BPromise[_0xfc98('0x9b')](_0x493e3c);});});})[_0xfc98('0x23')](function(_0x526dd9){_0x706fd9[_0xfc98('0x9c')]=_0x526dd9;return _0x706fd9;})[_0xfc98('0x23')](respondWithFilteredResult(_0x4d0f5c,_0x530b9b))['catch'](handleError(_0x4d0f5c,null));};exports[_0xfc98('0x9d')]=function(_0x4cb9c1,_0x3c957b){var _0x51258c={'raw':![],'where':{'id':_0x4cb9c1[_0xfc98('0x9e')]['id']}},_0x11982a={};_0x11982a['model']=_[_0xfc98('0x2e')](db['OpenchannelInteraction']['rawAttributes']);_0x11982a['query']=_[_0xfc98('0x2e')](_0x4cb9c1[_0xfc98('0x2f')]);_0x11982a[_0xfc98('0x30')]=_[_0xfc98('0x33')](_0x11982a[_0xfc98('0x31')],_0x11982a[_0xfc98('0x2f')]);_0x51258c[_0xfc98('0x32')]=_[_0xfc98('0x33')](_0x11982a[_0xfc98('0x31')],qs[_0xfc98('0x34')](_0x4cb9c1[_0xfc98('0x2f')][_0xfc98('0x34')]));_0x51258c['attributes']=_0x51258c['attributes'][_0xfc98('0x5e')]?_0x51258c['attributes']:_0x11982a[_0xfc98('0x31')];if(_0x4cb9c1[_0xfc98('0x2f')]['includeAll']){_0x51258c['include']=[{'all':!![]}];}_0x51258c=_[_0xfc98('0x8c')]({},_0x51258c,_0x4cb9c1[_0xfc98('0x9f')]);return db[_0xfc98('0x2c')][_0xfc98('0xa0')](_0x51258c)[_0xfc98('0x23')](handleEntityNotFound(_0x3c957b,null))[_0xfc98('0x23')](respondWithResult(_0x3c957b,null))[_0xfc98('0x2b')](handleError(_0x3c957b,null));};exports[_0xfc98('0xa1')]=function(_0x49cd6a,_0x4ad71c){return db['OpenchannelInteraction'][_0xfc98('0xa1')](_0x49cd6a[_0xfc98('0xa2')],{})[_0xfc98('0x23')](respondWithResult(_0x4ad71c,0xc9))['catch'](handleError(_0x4ad71c,null));};exports[_0xfc98('0xa3')]=function(_0x4d3b0e,_0x680a13){if(_0x4d3b0e[_0xfc98('0xa2')]['id']){delete _0x4d3b0e[_0xfc98('0xa2')]['id'];}return db['OpenchannelInteraction'][_0xfc98('0xa0')]({'where':{'id':_0x4d3b0e[_0xfc98('0x9e')]['id']}})[_0xfc98('0x23')](handleEntityNotFound(_0x680a13,null))[_0xfc98('0x23')](saveUpdates(_0x4d3b0e[_0xfc98('0xa2')],null))[_0xfc98('0x23')](respondWithResult(_0x680a13,null))[_0xfc98('0x2b')](handleError(_0x680a13,null));};exports['destroy']=function(_0x130e71,_0x41a981){return db['OpenchannelInteraction'][_0xfc98('0xa0')]({'where':{'id':_0x130e71['params']['id']}})[_0xfc98('0x23')](handleEntityNotFound(_0x41a981,null))[_0xfc98('0x23')](removeEntity(_0x41a981,null))[_0xfc98('0x2b')](handleError(_0x41a981,null));};exports['describe']=function(_0x441ffe,_0x27dddf){return db[_0xfc98('0x2c')][_0xfc98('0xa4')]()[_0xfc98('0x23')](respondWithResult(_0x27dddf,null))['catch'](handleError(_0x27dddf,null));};exports[_0xfc98('0xa5')]=function(_0x16d889,_0x51714b,_0x153962){return db[_0xfc98('0xa6')][_0xfc98('0xa0')]({'where':{'id':_0x16d889['params']['id']}})['then'](handleEntityNotFound(_0x51714b,null))[_0xfc98('0x23')](function(_0x48f17f){if(_0x48f17f){return _0x48f17f['addMessage'](_0x16d889['body'][_0xfc98('0xa7')],_[_0xfc98('0xa8')](_0x16d889[_0xfc98('0xa2')],[_0xfc98('0xa7'),'id'])||{});}})[_0xfc98('0x23')](respondWithResult(_0x51714b,null))[_0xfc98('0x2b')](handleError(_0x51714b,null));};exports['getMessages']=function(_0x196e2a,_0x349939,_0x2ef693){var _0x1a20f6={'raw':![],'where':{}};var _0x3e7c98={};var _0xafddb1={'count':0x0,'rows':[]};return db[_0xfc98('0x2c')][_0xfc98('0xa9')]({'where':{'id':_0x196e2a['params']['id']}})[_0xfc98('0x23')](handleEntityNotFound(_0x349939,null))[_0xfc98('0x23')](function(_0x277fcc){if(_0x277fcc){_0x3e7c98[_0xfc98('0x31')]=_[_0xfc98('0x2e')](db[_0xfc98('0xa6')][_0xfc98('0x2d')]);_0x3e7c98[_0xfc98('0x2f')]=_[_0xfc98('0x2e')](_0x196e2a[_0xfc98('0x2f')]);_0x3e7c98[_0xfc98('0x30')]=_[_0xfc98('0x33')](_0x3e7c98[_0xfc98('0x31')],_0x3e7c98['query']);_0x1a20f6[_0xfc98('0x32')]=_[_0xfc98('0x33')](_0x3e7c98[_0xfc98('0x31')],qs[_0xfc98('0x34')](_0x196e2a[_0xfc98('0x2f')][_0xfc98('0x34')]));_0x1a20f6['attributes']=_0x1a20f6['attributes'][_0xfc98('0x5e')]?_0x1a20f6[_0xfc98('0x32')]:_0x3e7c98[_0xfc98('0x31')];if(!_0x196e2a[_0xfc98('0x2f')][_0xfc98('0x35')](_0xfc98('0x36'))){_0x1a20f6[_0xfc98('0x1f')]=qs[_0xfc98('0x1f')](_0x196e2a[_0xfc98('0x2f')][_0xfc98('0x1f')]);_0x1a20f6[_0xfc98('0x1e')]=qs['offset'](_0x196e2a[_0xfc98('0x2f')]['offset']);}_0x1a20f6[_0xfc98('0x79')]=qs['sort'](_0x196e2a[_0xfc98('0x2f')]['sort']);_0x1a20f6[_0xfc98('0x38')]=qs['filters'](_[_0xfc98('0xaa')](_0x196e2a[_0xfc98('0x2f')],_0x3e7c98[_0xfc98('0x30')]));_0x1a20f6[_0xfc98('0x38')][_0xfc98('0x9a')]=_0x277fcc['id'];if(_0x196e2a[_0xfc98('0x2f')][_0xfc98('0x6f')]){_0x1a20f6[_0xfc98('0x38')]=_[_0xfc98('0x8c')](_0x1a20f6[_0xfc98('0x38')],{'$or':_[_0xfc98('0x98')](_0x1a20f6[_0xfc98('0x32')],function(_0x59418d){var _0x223cb8={};_0x223cb8[_0x59418d]={'$like':'%'+_0x196e2a[_0xfc98('0x2f')]['filter']+'%'};return _0x223cb8;})});}if(_0x196e2a['query']['$gte']){var _0x3889a9=_0x196e2a[_0xfc98('0x2f')][_0xfc98('0x6c')][_0xfc98('0x74')](',');var _0x4a0862={};_0x4a0862[_0x3889a9[0x0]]={'$gte':moment(_0x3889a9[0x1])[_0xfc98('0x55')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1a20f6[_0xfc98('0x38')]=_['merge'](_0x1a20f6[_0xfc98('0x38')],_0x4a0862);}_0x1a20f6=_[_0xfc98('0x8c')]({},_0x1a20f6,_0x196e2a['options']);return db['OpenchannelMessage'][_0xfc98('0x1d')]({'where':_0x1a20f6['where']})[_0xfc98('0x23')](function(_0x4f52b){_0xafddb1[_0xfc98('0x1d')]=_0x4f52b;if(_0x196e2a[_0xfc98('0x2f')][_0xfc98('0xab')]){_0x1a20f6[_0xfc98('0xac')]=[{'all':!![]}];}return db[_0xfc98('0xa6')][_0xfc98('0xad')](_0x1a20f6);})['then'](function(_0x5d5af0){_0xafddb1[_0xfc98('0x9c')]=_0x5d5af0;return _0xafddb1;});}})[_0xfc98('0x23')](respondWithFilteredResult(_0x349939,_0x1a20f6))[_0xfc98('0x2b')](handleError(_0x349939,null));};exports[_0xfc98('0xae')]=function(_0x39be0f,_0x132b6f,_0x5b9925){return db[_0xfc98('0x2c')]['find']({'where':{'id':_0x39be0f[_0xfc98('0x9e')]['id']}})['then'](handleEntityNotFound(_0x132b6f,null))[_0xfc98('0x23')](function(_0x1d5574){if(_0x1d5574){return _0x1d5574[_0xfc98('0xaf')](_0x39be0f[_0xfc98('0xa2')][_0xfc98('0xa7')],_[_0xfc98('0xa8')](_0x39be0f[_0xfc98('0xa2')],['ids','id'])||{})['spread'](function(){return db[_0xfc98('0xb0')][_0xfc98('0xad')]({'attributes':['id',_0xfc98('0x26'),_0xfc98('0x3b')],'where':{'id':_0x39be0f[_0xfc98('0xa2')][_0xfc98('0xa7')]}});})[_0xfc98('0x23')](function(_0x3c0e25){socket[_0xfc98('0xb1')](_0xfc98('0xb2'),{'id':Number(_0x39be0f[_0xfc98('0x9e')]['id']),'tags':_0x3c0e25||[]});return{'id':Number(_0x39be0f[_0xfc98('0x9e')]['id']),'tags':_0x3c0e25||[]};});}})[_0xfc98('0x23')](respondWithResult(_0x132b6f,null))[_0xfc98('0x2b')](handleError(_0x132b6f,null));};exports[_0xfc98('0xb3')]=function(_0x155472,_0x261ac0,_0x1c3c9b){return db['OpenchannelInteraction']['find']({'where':{'id':_0x155472[_0xfc98('0x9e')]['id']}})['then'](handleEntityNotFound(_0x261ac0,null))[_0xfc98('0x23')](function(_0x6ebc16){if(_0x6ebc16){return _0x6ebc16[_0xfc98('0xb3')](_0x155472['query'][_0xfc98('0xa7')]);}})['then'](respondWithStatusCode(_0x261ac0,null))['catch'](handleError(_0x261ac0,null));};exports['download']=function(_0x443d28,_0x2f0a68){var _0x1c403b=moment()[_0xfc98('0xb4')]()['toString']();var _0x2c343b=path[_0xfc98('0x77')](config[_0xfc98('0xb5')],_0xfc98('0xb6'),_0xfc98('0xb7'),'tmp');var _0x5cdc09=path['join'](config[_0xfc98('0xb5')],'server',_0xfc98('0xb7'),_0xfc98('0xb8'));var _0x382d8a=path['join'](_0x2c343b,_0x1c403b);var _0x300d04=util['format'](_0xfc98('0xb9'),_0x443d28[_0xfc98('0x9e')]['id'],_0x1c403b);var _0x28d224=path[_0xfc98('0x77')](_0x2c343b,_0x300d04);var _0x3cfdfd=![];return db[_0xfc98('0x2c')]['find']({'where':{'id':_0x443d28[_0xfc98('0x9e')]['id']},'include':[{'model':db[_0xfc98('0xa6')],'as':_0xfc98('0xba'),'attributes':['id',_0xfc98('0xa2'),_0xfc98('0x50'),_0xfc98('0xbb'),_0xfc98('0xbc')],'include':[{'model':db[_0xfc98('0xbd')],'as':'User','attributes':['id',_0xfc98('0xbe')],'raw':!![]},{'model':db[_0xfc98('0xbf')],'as':'Contact','attributes':['id','firstName','lastName'],'raw':!![]},{'model':db[_0xfc98('0xc0')],'as':_0xfc98('0xc0'),'raw':!![]}]},{'model':db[_0xfc98('0xc1')],'as':_0xfc98('0xc2'),'attributes':['id',_0xfc98('0x26')]},{'model':db[_0xfc98('0xbd')],'as':'Owner','attributes':['id',_0xfc98('0xbe')]}]})[_0xfc98('0x23')](handleEntityNotFound(_0x2f0a68,null))['then'](function(_0x747784){if(_0x747784){var _0x1eb585=_0x747784['get']({'plain':!![]});_0x3cfdfd=!![];var _0x2e6d66={'format':'A4','border':_0xfc98('0xc3'),'header':{'height':_0xfc98('0xc4'),'contents':{'first':_0xfc98('0xc5')}},'footer':{'height':_0xfc98('0xc6'),'contents':{'default':util['format'](_0xfc98('0xc7'),util[_0xfc98('0x55')](_0xfc98('0xc8'),_0xfc98('0xc9'),_0x1eb585['id']),moment()['format'](_0xfc98('0xca'))['toString']())}}};fs[_0xfc98('0xcb')](_0x382d8a);var _0x490489={'channel':_0xfc98('0xc9'),'account':_0x1eb585['Account'][_0xfc98('0x26')],'agent':_0x1eb585[_0xfc98('0xcc')]?_0x1eb585[_0xfc98('0xcc')][_0xfc98('0xbe')]:_0xfc98('0xcd'),'createdAt':moment(_0x1eb585['createdAt'])[_0xfc98('0x55')](_0xfc98('0xce'))[_0xfc98('0x76')](),'closedAt':_0x1eb585[_0xfc98('0xcf')]?moment(_0x1eb585[_0xfc98('0xd0')])[_0xfc98('0x55')](_0xfc98('0xce'))['toString']():'','disposition':_0x1eb585['disposition'],'visibility':_0x1eb585[_0xfc98('0xd1')]?'Public':'Private','messages':_(_0x1eb585[_0xfc98('0xba')])[_0xfc98('0x6f')]({'secret':![]})[_0xfc98('0x98')](function(_0xcbf1f1){if(_0xcbf1f1[_0xfc98('0xc0')]){var _0x1eb50a=path[_0xfc98('0x77')](_0x5cdc09,_0xcbf1f1[_0xfc98('0xc0')][_0xfc98('0xd2')]);if(fs['existsSync'](_0x1eb50a)){fs['createReadStream'](_0x1eb50a)[_0xfc98('0xd3')](fs[_0xfc98('0xd4')](path['join'](_0x382d8a,_0xcbf1f1[_0xfc98('0xc0')]['basename'])));}}return{'date':moment(_0xcbf1f1[_0xfc98('0x50')])[_0xfc98('0x55')](_0xfc98('0xce'))[_0xfc98('0x76')](),'sender':_0xcbf1f1['direction']==='out'?_0xcbf1f1[_0xfc98('0xbd')]?_0xcbf1f1['User'][_0xfc98('0xbe')]:'System':_0xcbf1f1[_0xfc98('0xd5')][_0xfc98('0xd6')]+(_0xcbf1f1[_0xfc98('0xd5')]['lastName']?'\x20'+_0xcbf1f1[_0xfc98('0xd5')][_0xfc98('0xd7')]:''),'body':_0xcbf1f1[_0xfc98('0xc0')]?_0xcbf1f1['Attachment'][_0xfc98('0xd2')]:_0xcbf1f1[_0xfc98('0xa2')],'direction':_0xcbf1f1['direction']==='out'?'A':'C','secret':_0xcbf1f1[_0xfc98('0xbc')],'attachment':_0xcbf1f1['Attachment']};})[_0xfc98('0x51')]()};return ejs[_0xfc98('0xd8')](path[_0xfc98('0x77')](config[_0xfc98('0xb5')],_0xfc98('0xb6'),'views',_0xfc98('0xd9')),{'interaction':_0x490489})[_0xfc98('0x23')](function(_0x1bf01b){return new BPromise(function(_0x4f57df,_0x44c9d9){pdf[_0xfc98('0xa1')](_0x1bf01b,_0x2e6d66)[_0xfc98('0xda')](path[_0xfc98('0x77')](_0x382d8a,_0xfc98('0xdb')+_0x1eb585['id']+'-'+_0x1c403b+'.pdf'),function(_0x3035e4,_0x517432){if(_0x3035e4)return _0x44c9d9(_0x3035e4);_0x4f57df(_0x517432);});});});}})['then'](function(){if(_0x3cfdfd){return new BPromise(function(_0x5cdfdb,_0x3eccd7){zipdir(_0x382d8a,{'saveTo':_0x28d224},function(_0x81a217,_0x3514fc){if(_0x81a217)return _0x3eccd7(_0x81a217);return _0x5cdfdb(_0x3514fc);});})['then'](function(){return new BPromise(function(_0x2e4a44,_0x239098){rimraf(_0x382d8a,function(_0x2889fc){if(_0x2889fc)_0x239098(_0x2889fc);return _0x2e4a44();});});})[_0xfc98('0x23')](function(){return _0x2f0a68['download'](_0x28d224,_0x300d04,function(_0x4f8202){if(_0x4f8202){console[_0xfc98('0xdc')](_0xfc98('0xdd'),_0x4f8202);}else{fs['unlinkSync'](_0x28d224);}});});}else{return _0x2f0a68[_0xfc98('0x19')](0xc8);}})[_0xfc98('0x2b')](handleError(_0x2f0a68,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index badab50..7106944 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 _0x4ad7=['events','../../mysqldb','OpenchannelMessage','setMaxListeners','update','remove','getUsers','Users','map','findAll','then','unreadMessages','emit','catch','hasOwnProperty','hook'];(function(_0x6ba7ce,_0x44df62){var _0x336e1b=function(_0x58afd5){while(--_0x58afd5){_0x6ba7ce['push'](_0x6ba7ce['shift']());}};_0x336e1b(++_0x44df62);}(_0x4ad7,0x110));var _0x74ad=function(_0x2554bd,_0x3da13f){_0x2554bd=_0x2554bd-0x0;var _0x5a91be=_0x4ad7[_0x2554bd];return _0x5a91be;};'use strict';var EventEmitter=require(_0x74ad('0x0'));var OpenchannelInteraction=require(_0x74ad('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x74ad('0x1'))['db'][_0x74ad('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x74ad('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x74ad('0x4'),'afterDestroy':_0x74ad('0x5')};function emitEvent(_0x534ed0){return function(_0x3e1568,_0x422490,_0x3d94ad){_0x3e1568[_0x74ad('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x25648d){_0x3e1568['setDataValue'](_0x74ad('0x7'),_0x25648d[_0x74ad('0x8')](function(_0x53e872){return{'id':_0x53e872['id']};}));return OpenchannelMessage[_0x74ad('0x9')]({'where':{'OpenchannelInteractionId':_0x3e1568['id'],'direction':'in','read':![]},'raw':!![]});})[_0x74ad('0xa')](function(_0x2f11f7){_0x3e1568['setDataValue'](_0x74ad('0xb'),_0x2f11f7['length']);OpenchannelInteractionEvents[_0x74ad('0xc')](_0x534ed0+':'+_0x3e1568['id'],_0x3e1568);OpenchannelInteractionEvents[_0x74ad('0xc')](_0x534ed0,_0x3e1568);_0x3d94ad(null);})[_0x74ad('0xd')](_0x3d94ad(null));};}for(var e in events){if(events[_0x74ad('0xe')](e)){var event=events[e];OpenchannelInteraction[_0x74ad('0xf')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file +var _0xbd99=['events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','setDataValue','Users','map','findAll','then','length','catch','hasOwnProperty','hook','exports'];(function(_0x2cbd16,_0x25f6d7){var _0x729824=function(_0x3cff47){while(--_0x3cff47){_0x2cbd16['push'](_0x2cbd16['shift']());}};_0x729824(++_0x25f6d7);}(_0xbd99,0xbe));var _0x9bd9=function(_0xda1c77,_0x268439){_0xda1c77=_0xda1c77-0x0;var _0x5cb7cd=_0xbd99[_0xda1c77];return _0x5cb7cd;};'use strict';var EventEmitter=require(_0x9bd9('0x0'));var OpenchannelInteraction=require(_0x9bd9('0x1'))['db'][_0x9bd9('0x2')];var OpenchannelMessage=require(_0x9bd9('0x1'))['db'][_0x9bd9('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x9bd9('0x4')](0x0);var events={'afterCreate':_0x9bd9('0x5'),'afterUpdate':_0x9bd9('0x6'),'afterDestroy':_0x9bd9('0x7')};function emitEvent(_0x3e83f8){return function(_0x7b234b,_0x47cd07,_0x1d6f33){_0x7b234b[_0x9bd9('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x19ee3d){_0x7b234b[_0x9bd9('0x9')](_0x9bd9('0xa'),_0x19ee3d[_0x9bd9('0xb')](function(_0x1d6c5c){return{'id':_0x1d6c5c['id']};}));return OpenchannelMessage[_0x9bd9('0xc')]({'where':{'OpenchannelInteractionId':_0x7b234b['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9bd9('0xd')](function(_0x4b0804){_0x7b234b[_0x9bd9('0x9')]('unreadMessages',_0x4b0804[_0x9bd9('0xe')]);OpenchannelInteractionEvents['emit'](_0x3e83f8+':'+_0x7b234b['id'],_0x7b234b);OpenchannelInteractionEvents['emit'](_0x3e83f8,_0x7b234b);_0x1d6f33(null);})[_0x9bd9('0xf')](_0x1d6f33(null));};}for(var e in events){if(events[_0x9bd9('0x10')](e)){var event=events[e];OpenchannelInteraction[_0x9bd9('0x11')](e,emitEvent(event));}}module[_0x9bd9('0x12')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 4d727e0..f3926bc 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 _0xdab2=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','changed','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x367035,_0x5bb05b){var _0x41cb72=function(_0x4b2b12){while(--_0x4b2b12){_0x367035['push'](_0x367035['shift']());}};_0x41cb72(++_0x5bb05b);}(_0xdab2,0x130));var _0x2dab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdab2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2dab('0x0'));var util=require(_0x2dab('0x1'));var logger=require('../../config/logger')(_0x2dab('0x2'));var moment=require(_0x2dab('0x3'));var BPromise=require(_0x2dab('0x4'));var rp=require(_0x2dab('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2dab('0x6'));var config=require(_0x2dab('0x7'));var attributes=require(_0x2dab('0x8'));module[_0x2dab('0x9')]=function(_0x4562bb,_0x1421d5){return _0x4562bb[_0x2dab('0xa')](_0x2dab('0xb'),attributes,{'tableName':_0x2dab('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x188cef,_0x215faa,_0x298f86){if(_0x188cef[_0x2dab('0xd')]('closed')){_0x188cef['closedAt']=moment()[_0x2dab('0xe')](_0x2dab('0xf'));}_0x298f86(null,_0x188cef);}}});}; \ No newline at end of file +var _0x24cd=['OpenchannelInteraction','openchannel_interactions','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','bluebird','request-promise','path','../../config/environment','./openchannelInteraction.attributes','define'];(function(_0x1840e2,_0x499f2c){var _0x33b870=function(_0x501dc2){while(--_0x501dc2){_0x1840e2['push'](_0x1840e2['shift']());}};_0x33b870(++_0x499f2c);}(_0x24cd,0x83));var _0xd24c=function(_0x17756a,_0x2dddd6){_0x17756a=_0x17756a-0x0;var _0x1ba147=_0x24cd[_0x17756a];return _0x1ba147;};'use strict';var _=require(_0xd24c('0x0'));var util=require(_0xd24c('0x1'));var logger=require('../../config/logger')(_0xd24c('0x2'));var moment=require('moment');var BPromise=require(_0xd24c('0x3'));var rp=require(_0xd24c('0x4'));var fs=require('fs');var path=require(_0xd24c('0x5'));var rimraf=require('rimraf');var config=require(_0xd24c('0x6'));var attributes=require(_0xd24c('0x7'));module['exports']=function(_0x1c30fc,_0x2721be){return _0x1c30fc[_0xd24c('0x8')](_0xd24c('0x9'),attributes,{'tableName':_0xd24c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x411706,_0x3df525,_0x316755){if(_0x411706['changed']('closed')){_0x411706[_0xd24c('0xb')]=moment()[_0xd24c('0xc')](_0xd24c('0xd'));}_0x316755(null,_0x411706);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 355881a..1760593 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 _0x0309=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','socket.io-emitter','./openchannelInteraction.socket','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelInteraction','body','options','raw','where','limit','debug','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','addTags','ids','omit','spread','AddTags','lodash','moment','randomstring'];(function(_0x46d87a,_0x5183db){var _0x115296=function(_0x880a1c){while(--_0x880a1c){_0x46d87a['push'](_0x46d87a['shift']());}};_0x115296(++_0x5183db);}(_0x0309,0x165));var _0x9030=function(_0x150aec,_0x3f1ae8){_0x150aec=_0x150aec-0x0;var _0x16a46f=_0x0309[_0x150aec];return _0x16a46f;};'use strict';var _=require(_0x9030('0x0'));var util=require('util');var moment=require(_0x9030('0x1'));var BPromise=require('bluebird');var rs=require(_0x9030('0x2'));var fs=require('fs');var Redis=require(_0x9030('0x3'));var db=require(_0x9030('0x4'))['db'];var utils=require(_0x9030('0x5'));var logger=require(_0x9030('0x6'))(_0x9030('0x7'));var config=require(_0x9030('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9030('0x9')]({'port':0x232a});config[_0x9030('0xa')]=_['defaults'](config[_0x9030('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x9030('0xb'))(new Redis(config[_0x9030('0xa')]));require(_0x9030('0xc'))['register'](socket);function respondWithRpcPromise(_0xe2c28b,_0x1da9ec,_0x337b86){return new BPromise(function(_0x53ef39,_0x37d6e0){return client[_0x9030('0xd')](_0xe2c28b,_0x337b86)[_0x9030('0xe')](function(_0x11a539){logger[_0x9030('0xf')](_0x9030('0x10'),_0x1da9ec,_0x9030('0x11'));logger['debug'](_0x9030('0x12'),_0x1da9ec,_0x9030('0x11'),JSON[_0x9030('0x13')](_0x11a539));if(_0x11a539[_0x9030('0x14')]){if(_0x11a539['error'][_0x9030('0x15')]===0x1f4){logger[_0x9030('0x14')](_0x9030('0x10'),_0x1da9ec,_0x11a539[_0x9030('0x14')][_0x9030('0x16')]);return _0x37d6e0(_0x11a539[_0x9030('0x14')][_0x9030('0x16')]);}logger[_0x9030('0x14')](_0x9030('0x10'),_0x1da9ec,_0x11a539['error'][_0x9030('0x16')]);return _0x53ef39(_0x11a539[_0x9030('0x14')][_0x9030('0x16')]);}else{logger[_0x9030('0xf')](_0x9030('0x10'),_0x1da9ec,_0x9030('0x11'));_0x53ef39(_0x11a539[_0x9030('0x17')][_0x9030('0x16')]);}})[_0x9030('0x18')](function(_0x31e196){logger[_0x9030('0x14')](_0x9030('0x10'),_0x1da9ec,_0x31e196);_0x37d6e0(_0x31e196);});});}exports[_0x9030('0x19')]=function(_0x243e7d){var _0x1e5988=this;return new Promise(function(_0x285d93,_0x4105ec){return db['OpenchannelInteraction']['update'](_0x243e7d[_0x9030('0x1a')],{'raw':_0x243e7d[_0x9030('0x1b')]?_0x243e7d['options'][_0x9030('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x243e7d[_0x9030('0x1b')]?_0x243e7d[_0x9030('0x1b')][_0x9030('0x1d')]||null:null,'attributes':_0x243e7d['options']?_0x243e7d[_0x9030('0x1b')]['attributes']||null:null,'limit':_0x243e7d['options']?_0x243e7d[_0x9030('0x1b')][_0x9030('0x1e')]||null:null})[_0x9030('0xe')](function(_0x539bb7){logger[_0x9030('0xf')](_0x9030('0x19'),_0x243e7d);logger[_0x9030('0x1f')](_0x9030('0x19'),_0x243e7d,JSON[_0x9030('0x13')](_0x539bb7));_0x285d93(_0x539bb7);})['catch'](function(_0x5ca691){logger[_0x9030('0x14')](_0x9030('0x19'),_0x5ca691[_0x9030('0x16')],_0x243e7d);_0x4105ec(_0x1e5988[_0x9030('0x14')](0x1f4,_0x5ca691[_0x9030('0x16')]));});});};exports[_0x9030('0x20')]=function(_0x2112cf){return new Promise(function(_0x26a803,_0x11c47d){return db[_0x9030('0x21')][_0x9030('0x22')]({'where':_0x2112cf[_0x9030('0x1b')]?_0x2112cf[_0x9030('0x1b')]['where']||null:null})[_0x9030('0xe')](function(_0x4b042c){if(_0x4b042c){return _0x4b042c[_0x9030('0x23')](_0x2112cf['body'][_0x9030('0x24')],_[_0x9030('0x25')](_0x2112cf[_0x9030('0x1a')],['ids','id'])||{});}})[_0x9030('0x26')](function(_0x1b1fb7){logger[_0x9030('0xf')](_0x9030('0x27'),_0x2112cf);logger[_0x9030('0x1f')](_0x9030('0x27'),_0x2112cf,JSON[_0x9030('0x13')](_0x1b1fb7));_0x26a803(_0x1b1fb7);})[_0x9030('0x18')](function(_0x134260){logger[_0x9030('0x14')](_0x9030('0x27'),_0x134260[_0x9030('0x16')],_0x2112cf);_0x11c47d(_this[_0x9030('0x14')](0x1f4,_0x134260[_0x9030('0x16')]));});});}; \ No newline at end of file +var _0xbff5=['../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','OpenchannelInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','attributes','limit','AddTagsToOpenchannelInteraction','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x36c6eb,_0x4fb127){var _0x30675b=function(_0x3a788b){while(--_0x3a788b){_0x36c6eb['push'](_0x36c6eb['shift']());}};_0x30675b(++_0x4fb127);}(_0xbff5,0x1bc));var _0x5bff=function(_0x6ecbc7,_0x595c83){_0x6ecbc7=_0x6ecbc7-0x0;var _0x4e9ac7=_0xbff5[_0x6ecbc7];return _0x4e9ac7;};'use strict';var _=require(_0x5bff('0x0'));var util=require(_0x5bff('0x1'));var moment=require(_0x5bff('0x2'));var BPromise=require(_0x5bff('0x3'));var rs=require(_0x5bff('0x4'));var fs=require('fs');var Redis=require(_0x5bff('0x5'));var db=require(_0x5bff('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5bff('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5bff('0x8'));var client=jayson[_0x5bff('0x9')][_0x5bff('0xa')]({'port':0x232a});config[_0x5bff('0xb')]=_[_0x5bff('0xc')](config[_0x5bff('0xb')],{'host':_0x5bff('0xd'),'port':0x18eb});var socket=require(_0x5bff('0xe'))(new Redis(config[_0x5bff('0xb')]));require('./openchannelInteraction.socket')[_0x5bff('0xf')](socket);function respondWithRpcPromise(_0x5e7d10,_0x1d8197,_0x40b806){return new BPromise(function(_0x4fc146,_0x3e72e9){return client['request'](_0x5e7d10,_0x40b806)[_0x5bff('0x10')](function(_0x4ff164){logger[_0x5bff('0x11')](_0x5bff('0x12'),_0x1d8197,'request\x20sent');logger[_0x5bff('0x13')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x1d8197,_0x5bff('0x14'),JSON[_0x5bff('0x15')](_0x4ff164));if(_0x4ff164['error']){if(_0x4ff164[_0x5bff('0x16')][_0x5bff('0x17')]===0x1f4){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x1d8197,_0x4ff164[_0x5bff('0x16')][_0x5bff('0x18')]);return _0x3e72e9(_0x4ff164[_0x5bff('0x16')]['message']);}logger[_0x5bff('0x16')](_0x5bff('0x12'),_0x1d8197,_0x4ff164[_0x5bff('0x16')]['message']);return _0x4fc146(_0x4ff164[_0x5bff('0x16')][_0x5bff('0x18')]);}else{logger[_0x5bff('0x11')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1d8197,_0x5bff('0x14'));_0x4fc146(_0x4ff164[_0x5bff('0x19')][_0x5bff('0x18')]);}})[_0x5bff('0x1a')](function(_0x5216dc){logger[_0x5bff('0x16')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1d8197,_0x5216dc);_0x3e72e9(_0x5216dc);});});}exports[_0x5bff('0x1b')]=function(_0x4d0111){var _0x1fc4cf=this;return new Promise(function(_0x13d5d0,_0x2a83ce){return db[_0x5bff('0x1c')][_0x5bff('0x1d')](_0x4d0111[_0x5bff('0x1e')],{'raw':_0x4d0111[_0x5bff('0x1f')]?_0x4d0111[_0x5bff('0x1f')][_0x5bff('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d0111['options']?_0x4d0111[_0x5bff('0x1f')][_0x5bff('0x21')]||null:null,'attributes':_0x4d0111[_0x5bff('0x1f')]?_0x4d0111[_0x5bff('0x1f')][_0x5bff('0x22')]||null:null,'limit':_0x4d0111[_0x5bff('0x1f')]?_0x4d0111[_0x5bff('0x1f')][_0x5bff('0x23')]||null:null})['then'](function(_0x5741d9){logger[_0x5bff('0x11')]('UpdateOpenchannelInteraction',_0x4d0111);logger[_0x5bff('0x13')](_0x5bff('0x1b'),_0x4d0111,JSON[_0x5bff('0x15')](_0x5741d9));_0x13d5d0(_0x5741d9);})[_0x5bff('0x1a')](function(_0xfa361d){logger[_0x5bff('0x16')](_0x5bff('0x1b'),_0xfa361d[_0x5bff('0x18')],_0x4d0111);_0x2a83ce(_0x1fc4cf['error'](0x1f4,_0xfa361d['message']));});});};exports[_0x5bff('0x24')]=function(_0x2dd52f){return new Promise(function(_0x4d7640,_0x36a7d2){return db['OpenchannelInteraction']['find']({'where':_0x2dd52f[_0x5bff('0x1f')]?_0x2dd52f['options'][_0x5bff('0x21')]||null:null})[_0x5bff('0x10')](function(_0x2d692a){if(_0x2d692a){return _0x2d692a[_0x5bff('0x25')](_0x2dd52f['body'][_0x5bff('0x26')],_['omit'](_0x2dd52f[_0x5bff('0x1e')],['ids','id'])||{});}})[_0x5bff('0x27')](function(_0x100d0c){logger[_0x5bff('0x11')](_0x5bff('0x28'),_0x2dd52f);logger[_0x5bff('0x13')](_0x5bff('0x28'),_0x2dd52f,JSON['stringify'](_0x100d0c));_0x4d7640(_0x100d0c);})[_0x5bff('0x1a')](function(_0x31c33f){logger[_0x5bff('0x16')](_0x5bff('0x28'),_0x31c33f[_0x5bff('0x18')],_0x2dd52f);_0x36a7d2(_this[_0x5bff('0x16')](0x1f4,_0x31c33f[_0x5bff('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index b943aee..9078a2b 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 _0x2007=['update','register','openchannelInteraction:','save'];(function(_0x1243e9,_0x5d75d0){var _0x26676f=function(_0x234505){while(--_0x234505){_0x1243e9['push'](_0x1243e9['shift']());}};_0x26676f(++_0x5d75d0);}(_0x2007,0xf3));var _0x7200=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2007[_0xa464c9];return _0x3d73c4;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x7200('0x0'),'remove',_0x7200('0x1')];function createListener(_0x309e37,_0x253d81){return function(_0x209872){_0x253d81['emit'](_0x309e37,_0x209872);};}function removeListener(_0x253207,_0x3a846c){return function(){OpenchannelInteractionEvents['removeListener'](_0x253207,_0x3a846c);};}exports[_0x7200('0x2')]=function(_0x8a42c7){for(var _0x5343db=0x0,_0x3627eb=events['length'];_0x5343db<_0x3627eb;_0x5343db++){var _0xf12b51=events[_0x5343db];var _0x4a248a=createListener(_0x7200('0x3')+_0xf12b51,_0x8a42c7);OpenchannelInteractionEvents['on'](_0xf12b51,_0x4a248a);}}; \ No newline at end of file +var _0x82b3=['update','emit','removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events','save','remove'];(function(_0x1a896e,_0x16c502){var _0x469228=function(_0x3f7eeb){while(--_0x3f7eeb){_0x1a896e['push'](_0x1a896e['shift']());}};_0x469228(++_0x16c502);}(_0x82b3,0x96));var _0x382b=function(_0x487a1d,_0x136676){_0x487a1d=_0x487a1d-0x0;var _0x48f8db=_0x82b3[_0x487a1d];return _0x48f8db;};'use strict';var OpenchannelInteractionEvents=require(_0x382b('0x0'));var events=[_0x382b('0x1'),_0x382b('0x2'),_0x382b('0x3')];function createListener(_0x2f3396,_0xeb4624){return function(_0x3ba060){_0xeb4624[_0x382b('0x4')](_0x2f3396,_0x3ba060);};}function removeListener(_0x4fb543,_0x239dcf){return function(){OpenchannelInteractionEvents[_0x382b('0x5')](_0x4fb543,_0x239dcf);};}exports[_0x382b('0x6')]=function(_0x4ba276){for(var _0x476eba=0x0,_0x490d03=events[_0x382b('0x7')];_0x476eba<_0x490d03;_0x476eba++){var _0x48c48c=events[_0x476eba];var _0x4c4fe6=createListener(_0x382b('0x8')+_0x48c48c,_0x4ba276);OpenchannelInteractionEvents['on'](_0x48c48c,_0x4c4fe6);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 5e98343..a684425 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 _0xe356=['multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','isAuthenticated','index','/describe','describe','get','post','tracked','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','/:id','destroy','exports'];(function(_0xe45118,_0x5dffbc){var _0x15e15d=function(_0x17eaec){while(--_0x17eaec){_0xe45118['push'](_0xe45118['shift']());}};_0x15e15d(++_0x5dffbc);}(_0xe356,0x1ee));var _0x6e35=function(_0x444975,_0x21ed05){_0x444975=_0x444975-0x0;var _0x4b491d=_0xe356[_0x444975];return _0x4b491d;};'use strict';var multer=require(_0x6e35('0x0'));var util=require(_0x6e35('0x1'));var path=require(_0x6e35('0x2'));var timeout=require(_0x6e35('0x3'));var express=require('express');var router=express[_0x6e35('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x6e35('0x5'));var config=require(_0x6e35('0x6'));var controller=require(_0x6e35('0x7'));router['get']('/',auth[_0x6e35('0x8')](),controller[_0x6e35('0x9')]);router['get'](_0x6e35('0xa'),auth[_0x6e35('0x8')](),controller[_0x6e35('0xb')]);router[_0x6e35('0xc')]('/:id',auth[_0x6e35('0x8')](),controller['show']);router[_0x6e35('0xd')]('/',auth['isAuthenticated'](),interaction[_0x6e35('0xe')]('openchannel','openchannelmessage:create'),controller[_0x6e35('0xf')]);router[_0x6e35('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x6e35('0x11')]);router[_0x6e35('0x10')](_0x6e35('0x12'),auth['isAuthenticated'](),controller[_0x6e35('0x13')]);router[_0x6e35('0x10')](_0x6e35('0x14'),auth['isAuthenticated'](),controller[_0x6e35('0x15')]);router[_0x6e35('0x16')](_0x6e35('0x17'),auth['isAuthenticated'](),controller[_0x6e35('0x18')]);module[_0x6e35('0x19')]=router; \ No newline at end of file +var _0xe233=['describe','/:id','show','post','tracked','openchannel','put','update','/:id/reject','reject','delete','multer','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','index','/describe','isAuthenticated'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xe233,0x15b));var _0x3e23=function(_0x1a4afd,_0x1a5792){_0x1a4afd=_0x1a4afd-0x0;var _0x543f75=_0xe233[_0x1a4afd];return _0x543f75;};'use strict';var multer=require(_0x3e23('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3e23('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0x3e23('0x2'));var interaction=require(_0x3e23('0x3'));var config=require(_0x3e23('0x4'));var controller=require(_0x3e23('0x5'));router[_0x3e23('0x6')]('/',auth['isAuthenticated'](),controller[_0x3e23('0x7')]);router[_0x3e23('0x6')](_0x3e23('0x8'),auth[_0x3e23('0x9')](),controller[_0x3e23('0xa')]);router[_0x3e23('0x6')](_0x3e23('0xb'),auth[_0x3e23('0x9')](),controller[_0x3e23('0xc')]);router[_0x3e23('0xd')]('/',auth[_0x3e23('0x9')](),interaction[_0x3e23('0xe')](_0x3e23('0xf'),'openchannelmessage:create'),controller['create']);router[_0x3e23('0x10')](_0x3e23('0xb'),auth[_0x3e23('0x9')](),controller[_0x3e23('0x11')]);router[_0x3e23('0x10')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0x3e23('0x10')](_0x3e23('0x12'),auth[_0x3e23('0x9')](),controller[_0x3e23('0x13')]);router[_0x3e23('0x14')](_0x3e23('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index bc0d2a6..2e69c43 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 _0xb822=['sequelize','exports','medium','BOOLEAN','out','DATE'];(function(_0x32ff8f,_0x47bf9d){var _0x2dc68f=function(_0x75f1fe){while(--_0x75f1fe){_0x32ff8f['push'](_0x32ff8f['shift']());}};_0x2dc68f(++_0x47bf9d);}(_0xb822,0x126));var _0x2b82=function(_0x3b10f4,_0x59f4a7){_0x3b10f4=_0x3b10f4-0x0;var _0x9fa36f=_0xb822[_0x3b10f4];return _0x9fa36f;};'use strict';var Sequelize=require(_0x2b82('0x0'));module[_0x2b82('0x1')]={'body':{'type':Sequelize['TEXT'](_0x2b82('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x2b82('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x2b82('0x4')),'defaultValue':_0x2b82('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x2b82('0x5')]}}; \ No newline at end of file +var _0x89e1=['sequelize','exports','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x164a40,_0xb704f7){var _0x2a551a=function(_0x8c0588){while(--_0x8c0588){_0x164a40['push'](_0x164a40['shift']());}};_0x2a551a(++_0xb704f7);}(_0x89e1,0x1b9));var _0x189e=function(_0x14dc9d,_0x39b56e){_0x14dc9d=_0x14dc9d-0x0;var _0x179e2e=_0x89e1[_0x14dc9d];return _0x179e2e;};'use strict';var Sequelize=require(_0x189e('0x0'));module[_0x189e('0x1')]={'body':{'type':Sequelize['TEXT'](_0x189e('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x189e('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x189e('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x189e('0x4')]('in',_0x189e('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x189e('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 3c624f4..c74d44d 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 _0x2542=['rejectmessage','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','http','client','test','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','OpenchannelMessage','include','findAll','rows','catch','show','fields','find','create','body','params','describe','openchannel-interactions','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','Contact','OpenchannelInteraction','read1stAt','interaction','role','null','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','openchannel','get','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage'];(function(_0x54e143,_0x4a0a3f){var _0xe3d1c3=function(_0x456728){while(--_0x456728){_0x54e143['push'](_0x54e143['shift']());}};_0xe3d1c3(++_0x4a0a3f);}(_0x2542,0x169));var _0x2254=function(_0x338c10,_0x13ebe3){_0x338c10=_0x338c10-0x0;var _0xadde5a=_0x2542[_0x338c10];return _0xadde5a;};'use strict';var pdf=require(_0x2254('0x0'));var emlformat=require(_0x2254('0x1'));var rimraf=require(_0x2254('0x2'));var zipdir=require(_0x2254('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2254('0x4'));var moment=require('moment');var BPromise=require(_0x2254('0x5'));var Mustache=require(_0x2254('0x6'));var util=require(_0x2254('0x7'));var path=require(_0x2254('0x8'));var sox=require(_0x2254('0x9'));var csv=require('to-csv');var ejs=require(_0x2254('0xa'));var fs=require('fs');var _=require(_0x2254('0xb'));var squel=require(_0x2254('0xc'));var crypto=require(_0x2254('0xd'));var jsforce=require(_0x2254('0xe'));var deskjs=require(_0x2254('0xf'));var toCsv=require(_0x2254('0x10'));var querystring=require(_0x2254('0x11'));var Papa=require(_0x2254('0x12'));var Redis=require(_0x2254('0x13'));var authService=require(_0x2254('0x14'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x2254('0x15'));var logger=require(_0x2254('0x16'))(_0x2254('0x17'));var utils=require(_0x2254('0x18'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x2254('0x19')]=_[_0x2254('0x1a')](config[_0x2254('0x19')],{'host':_0x2254('0x1b'),'port':0x18eb});var socket=require(_0x2254('0x1c'))(new Redis(config[_0x2254('0x19')]));require('./openchannelMessage.socket')[_0x2254('0x1d')](socket);var jayson=require(_0x2254('0x1e'));var client=jayson['client'][_0x2254('0x1f')]({'port':0x232c});var client9002=jayson[_0x2254('0x20')][_0x2254('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x145272,_0x26285a,_0xbc5548){if(_0xbc5548){var _0x50f137=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x50f137[_0x2254('0x21')](_0x26285a)){return _0x145272;}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 _0x145272;}}function respondWithRpcPromise(_0x327d6d,_0x2a2470,_0x170ffa,_0x25f8b2){return new BPromise(function(_0x1ae11e,_0x34f90e){var _0x497724=_0x25f8b2||client;return _0x497724['request'](_0x327d6d,_0x170ffa)['then'](function(_0xb05559){logger[_0x2254('0x22')](_0x2254('0x23'),_0x2a2470,_0x2254('0x24'));logger[_0x2254('0x25')](_0x2254('0x26'),_0x2a2470,'request\x20sent',JSON[_0x2254('0x27')](_0xb05559));if(_0xb05559[_0x2254('0x28')]){if(_0xb05559[_0x2254('0x28')]['code']===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x2a2470,_0xb05559[_0x2254('0x28')][_0x2254('0x29')]);return _0x34f90e(_0xb05559[_0x2254('0x28')]['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x2a2470,_0xb05559['error']['message']);return _0x1ae11e(_0xb05559['error'][_0x2254('0x29')]);}else{logger[_0x2254('0x22')](_0x2254('0x23'),_0x2a2470,_0x2254('0x24'));_0x1ae11e(_0xb05559[_0x2254('0x2a')][_0x2254('0x29')]);}})['catch'](function(_0x4a8274){logger[_0x2254('0x28')]('OpenchannelMessage,\x20%s,\x20%s',_0x2a2470,_0x4a8274);_0x34f90e(_0x4a8274);});});}function respondWithStatusCode(_0x35608a,_0x141dc5){_0x141dc5=_0x141dc5||0xcc;return function(_0x31a543){if(_0x31a543){return _0x35608a[_0x2254('0x2b')](_0x141dc5);}return _0x35608a[_0x2254('0x2c')](_0x141dc5)['end']();};}function respondWithResult(_0x1a8a0d,_0x2a789b){_0x2a789b=_0x2a789b||0xc8;return function(_0x21285d){if(_0x21285d){return _0x1a8a0d[_0x2254('0x2c')](_0x2a789b)[_0x2254('0x2d')](_0x21285d);}};}function respondWithFilteredResult(_0x377c41,_0x3214a7){return function(_0x22e791){if(_0x22e791){var _0x29975f=_0x22e791[_0x2254('0x2e')],_0x221db9=_0x3214a7[_0x2254('0x2f')],_0x21c641=_0x3214a7[_0x2254('0x2f')]+_0x3214a7[_0x2254('0x30')],_0xad7774;if(_0x21c641>=_0x29975f){_0x21c641=_0x29975f;_0xad7774=0xc8;}else{_0xad7774=0xce;}_0x377c41[_0x2254('0x2c')](_0xad7774);return _0x377c41[_0x2254('0x31')](_0x2254('0x32'),_0x221db9+'-'+_0x21c641+'/'+_0x29975f)['json'](_0x22e791);}return null;};}function patchUpdates(_0xe29526){return function(_0xa39b89){try{jsonpatch[_0x2254('0x33')](_0xa39b89,_0xe29526,!![]);}catch(_0x157f4d){return BPromise[_0x2254('0x34')](_0x157f4d);}return _0xa39b89[_0x2254('0x35')]();};}function saveUpdates(_0x2cfc9c,_0x3ed00e){return function(_0x5b84ce){if(_0x5b84ce){return _0x5b84ce['update'](_0x2cfc9c)[_0x2254('0x36')](function(_0x3aa0bb){return _0x3aa0bb;});}return null;};}function removeEntity(_0x503540,_0x240d4e){return function(_0x135e7c){if(_0x135e7c){return _0x135e7c[_0x2254('0x37')]()[_0x2254('0x36')](function(){_0x503540['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x20409d,_0x4e2035){return function(_0x3d620a){if(!_0x3d620a){_0x20409d[_0x2254('0x2b')](0x194);}return _0x3d620a;};}function handleError(_0x2ba6a1,_0x141ddc){_0x141ddc=_0x141ddc||0x1f4;return function(_0x12428a){logger[_0x2254('0x28')](_0x12428a[_0x2254('0x38')]);if(_0x12428a['name']){delete _0x12428a[_0x2254('0x39')];}_0x2ba6a1[_0x2254('0x2c')](_0x141ddc)[_0x2254('0x3a')](_0x12428a);};}exports[_0x2254('0x3b')]=function(_0x17dc49,_0x3f6007){var _0x3e7ccb={},_0x24744a={},_0x122314={'count':0x0,'rows':[]};var _0x34543d=db['OpenchannelMessage'][_0x2254('0x3c')];_0x24744a[_0x2254('0x3d')]=_[_0x2254('0x3e')](_0x34543d);_0x24744a[_0x2254('0x3f')]=_['keys'](_0x17dc49[_0x2254('0x3f')]);_0x24744a[_0x2254('0x40')]=_[_0x2254('0x41')](_0x24744a[_0x2254('0x3d')],_0x24744a[_0x2254('0x3f')]);_0x3e7ccb[_0x2254('0x42')]=_[_0x2254('0x41')](_0x24744a[_0x2254('0x3d')],qs['fields'](_0x17dc49[_0x2254('0x3f')]['fields']));_0x3e7ccb[_0x2254('0x42')]=_0x3e7ccb[_0x2254('0x42')][_0x2254('0x43')]?_0x3e7ccb[_0x2254('0x42')]:_0x24744a[_0x2254('0x3d')];if(!_0x17dc49[_0x2254('0x3f')][_0x2254('0x44')]('nolimit')){_0x3e7ccb[_0x2254('0x30')]=qs[_0x2254('0x30')](_0x17dc49[_0x2254('0x3f')][_0x2254('0x30')]);_0x3e7ccb[_0x2254('0x2f')]=qs['offset'](_0x17dc49[_0x2254('0x3f')][_0x2254('0x2f')]);}_0x3e7ccb[_0x2254('0x45')]=qs[_0x2254('0x46')](_0x17dc49[_0x2254('0x3f')]['sort']);_0x3e7ccb[_0x2254('0x47')]=qs['filters'](_[_0x2254('0x48')](_0x17dc49[_0x2254('0x3f')],_0x24744a[_0x2254('0x40')]));if(_0x17dc49[_0x2254('0x3f')][_0x2254('0x49')]){_0x3e7ccb[_0x2254('0x47')]=_[_0x2254('0x4a')](_0x3e7ccb[_0x2254('0x47')],{'$or':_[_0x2254('0x4b')](_0x34543d,function(_0x1a0157){if(_0x1a0157[_0x2254('0x4c')][_0x2254('0x4d')]!==_0x2254('0x4e')){var _0x4a2e6d={};_0x4a2e6d[_0x1a0157[_0x2254('0x4f')]]={'$like':'%'+_0x17dc49[_0x2254('0x3f')][_0x2254('0x49')]+'%'};return _0x4a2e6d;}})});}_0x3e7ccb=_['merge']({},_0x3e7ccb,_0x17dc49[_0x2254('0x50')]);var _0x1c087b={'where':_0x3e7ccb[_0x2254('0x47')]};return db[_0x2254('0x51')][_0x2254('0x2e')](_0x1c087b)[_0x2254('0x36')](function(_0x1f69bb){_0x122314[_0x2254('0x2e')]=_0x1f69bb;if(_0x17dc49[_0x2254('0x3f')]['includeAll']){_0x3e7ccb[_0x2254('0x52')]=[{'all':!![]}];}return db[_0x2254('0x51')][_0x2254('0x53')](_0x3e7ccb);})[_0x2254('0x36')](function(_0xbbc059){_0x122314[_0x2254('0x54')]=_0xbbc059;return _0x122314;})[_0x2254('0x36')](respondWithFilteredResult(_0x3f6007,_0x3e7ccb))[_0x2254('0x55')](handleError(_0x3f6007,null));};exports[_0x2254('0x56')]=function(_0xa103ea,_0x5b14c5){var _0x36b977={'raw':!![],'where':{'id':_0xa103ea['params']['id']}},_0x35fa64={};_0x35fa64[_0x2254('0x3d')]=_[_0x2254('0x3e')](db[_0x2254('0x51')][_0x2254('0x3c')]);_0x35fa64['query']=_[_0x2254('0x3e')](_0xa103ea[_0x2254('0x3f')]);_0x35fa64['filters']=_[_0x2254('0x41')](_0x35fa64[_0x2254('0x3d')],_0x35fa64[_0x2254('0x3f')]);_0x36b977[_0x2254('0x42')]=_['intersection'](_0x35fa64[_0x2254('0x3d')],qs[_0x2254('0x57')](_0xa103ea[_0x2254('0x3f')]['fields']));_0x36b977['attributes']=_0x36b977[_0x2254('0x42')][_0x2254('0x43')]?_0x36b977['attributes']:_0x35fa64[_0x2254('0x3d')];if(_0xa103ea['query']['includeAll']){_0x36b977[_0x2254('0x52')]=[{'all':!![]}];}_0x36b977=_[_0x2254('0x4a')]({},_0x36b977,_0xa103ea[_0x2254('0x50')]);return db[_0x2254('0x51')][_0x2254('0x58')](_0x36b977)['then'](handleEntityNotFound(_0x5b14c5,null))['then'](respondWithResult(_0x5b14c5,null))[_0x2254('0x55')](handleError(_0x5b14c5,null));};exports['create']=function(_0x10a8db,_0x28a7c6){return db[_0x2254('0x51')][_0x2254('0x59')](_0x10a8db['body'],{})[_0x2254('0x36')](respondWithResult(_0x28a7c6,0xc9))[_0x2254('0x55')](handleError(_0x28a7c6,null));};exports['update']=function(_0x4ec44b,_0x1a2973){if(_0x4ec44b['body']['id']){delete _0x4ec44b[_0x2254('0x5a')]['id'];}return db[_0x2254('0x51')][_0x2254('0x58')]({'where':{'id':_0x4ec44b[_0x2254('0x5b')]['id']}})[_0x2254('0x36')](handleEntityNotFound(_0x1a2973,null))['then'](saveUpdates(_0x4ec44b['body'],null))[_0x2254('0x36')](respondWithResult(_0x1a2973,null))['catch'](handleError(_0x1a2973,null));};exports[_0x2254('0x37')]=function(_0x510fe0,_0x4da493){return db['OpenchannelMessage'][_0x2254('0x58')]({'where':{'id':_0x510fe0[_0x2254('0x5b')]['id']}})[_0x2254('0x36')](handleEntityNotFound(_0x4da493,null))[_0x2254('0x36')](removeEntity(_0x4da493,null))[_0x2254('0x55')](handleError(_0x4da493,null));};exports[_0x2254('0x5c')]=function(_0x14b1ba,_0x25137c){return db[_0x2254('0x51')][_0x2254('0x5c')]()[_0x2254('0x36')](respondWithResult(_0x25137c,null))[_0x2254('0x55')](handleError(_0x25137c,null));};var interaction_log=require(_0x2254('0x16'))(_0x2254('0x5d'));exports[_0x2254('0x5e')]=function(_0x3b81bb,_0x4659fc,_0x399ba2){var _0x179cf1={'channel':'openchannel'};if(_0x3b81bb[_0x2254('0x5a')]['id']){delete _0x3b81bb[_0x2254('0x5a')]['id'];}_0x3b81bb[_0x2254('0x5a')][_0x2254('0x5f')]=!![];_0x3b81bb['body']['readAt']=moment()[_0x2254('0x60')](_0x2254('0x61'));_0x3b81bb[_0x2254('0x5a')][_0x2254('0x62')]=_0x3b81bb[_0x2254('0x5a')]['UserId']||_0x3b81bb[_0x2254('0x63')]['id'];return db[_0x2254('0x51')][_0x2254('0x58')]({'where':{'id':_0x3b81bb['params']['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x2254('0x64')}]})['then'](handleEntityNotFound(_0x4659fc,null))[_0x2254('0x36')](saveUpdates(_0x3b81bb[_0x2254('0x5a')],null))['then'](function(_0x3c091e){if(_0x3c091e){_0x179cf1[_0x2254('0x29')]=_0x3c091e['get']({'plain':!![]});return db[_0x2254('0x65')][_0x2254('0x58')]({'where':{'id':_0x3c091e['OpenchannelInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x4659fc,null))[_0x2254('0x36')](function(_0xa159a4){if(_0xa159a4){return _0xa159a4['update']({'UserId':_0x3b81bb['body'][_0x2254('0x62')],'read1stAt':_['isNil'](_0xa159a4[_0x2254('0x66')])?moment()['format'](_0x2254('0x61')):undefined});}return null;})[_0x2254('0x36')](function(_0xaa9767){if(_0xaa9767){_0x179cf1[_0x2254('0x67')]=_0xaa9767['get']({'plain':!![]});interaction_log[_0x2254('0x22')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3b81bb[_0x2254('0x63')]['id'],_0x3b81bb[_0x2254('0x63')]['name'],_0x3b81bb[_0x2254('0x63')][_0x2254('0x68')],_0x179cf1['interaction']['id'],_0x3b81bb[_0x2254('0x5a')]?JSON[_0x2254('0x27')](_0x3b81bb[_0x2254('0x5a')]):_0x2254('0x69'));return respondWithRpcPromise('AcceptMessage',_0x2254('0x6a'),_0x179cf1);}return null;})[_0x2254('0x36')](function(_0x544102){if(_0x544102){if(_0x3b81bb[_0x2254('0x5a')][_0x2254('0x6b')]){_0x179cf1['message'][_0x2254('0x6c')]=util['format'](_0x2254('0x6d'),_0x3b81bb['user'][_0x2254('0x39')]);_0x179cf1[_0x2254('0x29')]['channel']=_0x179cf1[_0x2254('0x6e')];_0x179cf1['message'][_0x2254('0x6f')]=_0x2254('0x5e');return respondWithRpcPromise(_0x2254('0x70'),'EventManager',{'event':_0x2254('0x71'),'message':_0x179cf1['message']},client9002)[_0x2254('0x36')](function(){return _0x179cf1;});}return _0x179cf1;}return null;})[_0x2254('0x36')](respondWithResult(_0x4659fc,null))['catch'](handleError(_0x4659fc,null));};var interaction_log=require('../../config/logger')(_0x2254('0x5d'));exports[_0x2254('0x34')]=function(_0x451520,_0x2861d0,_0x4969b1){var _0x2a4a5b={'agent':{},'channel':_0x2254('0x72')};if(_0x451520[_0x2254('0x5a')]['id']){delete _0x451520[_0x2254('0x5a')]['id'];}_0x451520['body'][_0x2254('0x62')]=_0x451520[_0x2254('0x5a')]['UserId']||_0x451520[_0x2254('0x63')]['id'];_0x2a4a5b['agent']['id']=_0x451520[_0x2254('0x5a')]['UserId'];return db['OpenchannelMessage']['find']({'where':{'id':_0x451520[_0x2254('0x5b')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2861d0,null))[_0x2254('0x36')](function(_0x13dba2){if(_0x13dba2){_0x2a4a5b['message']=_0x13dba2[_0x2254('0x73')]({'plain':!![]});return db[_0x2254('0x65')][_0x2254('0x58')]({'where':{'id':_0x13dba2[_0x2254('0x74')]}});}return null;})[_0x2254('0x36')](handleEntityNotFound(_0x2861d0,null))[_0x2254('0x36')](function(_0x523b10){if(_0x523b10){_0x2a4a5b['interaction']=_0x523b10[_0x2254('0x73')]({'plain':!![]});interaction_log[_0x2254('0x22')](_0x2254('0x75'),_0x451520[_0x2254('0x63')]['id'],_0x451520[_0x2254('0x63')][_0x2254('0x39')],_0x451520[_0x2254('0x63')][_0x2254('0x68')],_0x2a4a5b[_0x2254('0x67')]['id'],_0x451520[_0x2254('0x5a')]?JSON['stringify'](_0x451520[_0x2254('0x5a')]):_0x2254('0x69'));return respondWithRpcPromise('RejectMessage',_0x2254('0x76'),_0x2a4a5b);}return null;})['then'](function(_0x3b9514){if(_0x3b9514){_0x3b9514[_0x2254('0x29')]['interface']=util[_0x2254('0x60')]('SIP/%s',_0x451520[_0x2254('0x63')][_0x2254('0x39')]);_0x3b9514[_0x2254('0x29')][_0x2254('0x6e')]=_0x2a4a5b['channel'];_0x3b9514[_0x2254('0x29')][_0x2254('0x6f')]=_0x2254('0x34');respondWithRpcPromise(_0x2254('0x70'),'EventManager',{'event':_0x2254('0x77'),'message':_0x3b9514[_0x2254('0x29')]},client9002);return _0x2a4a5b;}return null;})['then'](respondWithResult(_0x2861d0,null))[_0x2254('0x55')](handleError(_0x2861d0,null));}; \ No newline at end of file +var _0x2ef3=['stack','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','key','VIRTUAL','options','OpenchannelMessage','includeAll','include','findAll','rows','show','params','find','create','body','describe','openchannel-interactions','accept','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','format','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','AcceptMessage','acceptMessage','manual','SIP/%s','channel','event','EventManager','acceptmessage','agent','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','RejectMessage','rejectMessage','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','redis','socket.io-emitter','jayson/promise','http','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','destroy'];(function(_0x20d786,_0x270bdb){var _0x3925ac=function(_0xb0a77a){while(--_0xb0a77a){_0x20d786['push'](_0x20d786['shift']());}};_0x3925ac(++_0x270bdb);}(_0x2ef3,0xba));var _0x32ef=function(_0x660a6d,_0x583397){_0x660a6d=_0x660a6d-0x0;var _0x1d9231=_0x2ef3[_0x660a6d];return _0x1d9231;};'use strict';var pdf=require(_0x32ef('0x0'));var emlformat=require(_0x32ef('0x1'));var rimraf=require(_0x32ef('0x2'));var zipdir=require(_0x32ef('0x3'));var jsonpatch=require(_0x32ef('0x4'));var rp=require(_0x32ef('0x5'));var moment=require('moment');var BPromise=require(_0x32ef('0x6'));var Mustache=require(_0x32ef('0x7'));var util=require('util');var path=require(_0x32ef('0x8'));var sox=require(_0x32ef('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0xf'));var querystring=require(_0x32ef('0x10'));var Papa=require(_0x32ef('0x11'));var Redis=require(_0x32ef('0x12'));var authService=require(_0x32ef('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];config[_0x32ef('0x18')]=_['defaults'](config[_0x32ef('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x32ef('0x19'))(new Redis(config[_0x32ef('0x18')]));require('./openchannelMessage.socket')['register'](socket);var jayson=require(_0x32ef('0x1a'));var client=jayson['client'][_0x32ef('0x1b')]({'port':0x232c});var client9002=jayson[_0x32ef('0x1c')][_0x32ef('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x54c7f5,_0x57aff1,_0x55bf0b){if(_0x55bf0b){var _0x531e30=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x531e30[_0x32ef('0x1d')](_0x57aff1)){return _0x54c7f5;}else{throw new Error(_0x32ef('0x1e'));}}else{return _0x54c7f5;}}function respondWithRpcPromise(_0xb5aed2,_0x53a5ca,_0x5d559b,_0x1eb468){return new BPromise(function(_0x1a9476,_0x286bfb){var _0x57863c=_0x1eb468||client;return _0x57863c[_0x32ef('0x1f')](_0xb5aed2,_0x5d559b)[_0x32ef('0x20')](function(_0x4f4c98){logger[_0x32ef('0x21')](_0x32ef('0x22'),_0x53a5ca,_0x32ef('0x23'));logger[_0x32ef('0x24')](_0x32ef('0x25'),_0x53a5ca,_0x32ef('0x23'),JSON['stringify'](_0x4f4c98));if(_0x4f4c98[_0x32ef('0x26')]){if(_0x4f4c98['error'][_0x32ef('0x27')]===0x1f4){logger[_0x32ef('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0x53a5ca,_0x4f4c98[_0x32ef('0x26')][_0x32ef('0x28')]);return _0x286bfb(_0x4f4c98[_0x32ef('0x26')]['message']);}logger['error'](_0x32ef('0x22'),_0x53a5ca,_0x4f4c98[_0x32ef('0x26')][_0x32ef('0x28')]);return _0x1a9476(_0x4f4c98['error']['message']);}else{logger[_0x32ef('0x21')]('OpenchannelMessage,\x20%s,\x20%s',_0x53a5ca,'request\x20sent');_0x1a9476(_0x4f4c98[_0x32ef('0x29')][_0x32ef('0x28')]);}})[_0x32ef('0x2a')](function(_0x1dbe98){logger[_0x32ef('0x26')](_0x32ef('0x22'),_0x53a5ca,_0x1dbe98);_0x286bfb(_0x1dbe98);});});}function respondWithStatusCode(_0x1874ea,_0x38aed5){_0x38aed5=_0x38aed5||0xcc;return function(_0x338f19){if(_0x338f19){return _0x1874ea[_0x32ef('0x2b')](_0x38aed5);}return _0x1874ea[_0x32ef('0x2c')](_0x38aed5)[_0x32ef('0x2d')]();};}function respondWithResult(_0x5a88a5,_0xd65fde){_0xd65fde=_0xd65fde||0xc8;return function(_0x2f5d06){if(_0x2f5d06){return _0x5a88a5['status'](_0xd65fde)[_0x32ef('0x2e')](_0x2f5d06);}};}function respondWithFilteredResult(_0x3c569d,_0x30b250){return function(_0x26e207){if(_0x26e207){var _0x50a95b=_0x26e207[_0x32ef('0x2f')],_0x10e38c=_0x30b250[_0x32ef('0x30')],_0x22bf86=_0x30b250[_0x32ef('0x30')]+_0x30b250[_0x32ef('0x31')],_0x31dbc3;if(_0x22bf86>=_0x50a95b){_0x22bf86=_0x50a95b;_0x31dbc3=0xc8;}else{_0x31dbc3=0xce;}_0x3c569d['status'](_0x31dbc3);return _0x3c569d[_0x32ef('0x32')]('Content-Range',_0x10e38c+'-'+_0x22bf86+'/'+_0x50a95b)[_0x32ef('0x2e')](_0x26e207);}return null;};}function patchUpdates(_0x2b6c6a){return function(_0x5a9565){try{jsonpatch[_0x32ef('0x33')](_0x5a9565,_0x2b6c6a,!![]);}catch(_0x17e4d1){return BPromise[_0x32ef('0x34')](_0x17e4d1);}return _0x5a9565[_0x32ef('0x35')]();};}function saveUpdates(_0x120f30,_0x59a4a3){return function(_0x50ecd6){if(_0x50ecd6){return _0x50ecd6[_0x32ef('0x36')](_0x120f30)['then'](function(_0x643dc4){return _0x643dc4;});}return null;};}function removeEntity(_0x15b873,_0x2f1349){return function(_0x390670){if(_0x390670){return _0x390670[_0x32ef('0x37')]()[_0x32ef('0x20')](function(){_0x15b873['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x484ad7,_0x2261a6){return function(_0x3c4651){if(!_0x3c4651){_0x484ad7[_0x32ef('0x2b')](0x194);}return _0x3c4651;};}function handleError(_0x5f2443,_0x4fb402){_0x4fb402=_0x4fb402||0x1f4;return function(_0x1c3633){logger[_0x32ef('0x26')](_0x1c3633[_0x32ef('0x38')]);if(_0x1c3633['name']){delete _0x1c3633['name'];}_0x5f2443[_0x32ef('0x2c')](_0x4fb402)[_0x32ef('0x39')](_0x1c3633);};}exports[_0x32ef('0x3a')]=function(_0x1415ef,_0x3a7c49){var _0x211c79={},_0x3223d5={},_0x21da90={'count':0x0,'rows':[]};var _0x7f2319=db['OpenchannelMessage'][_0x32ef('0x3b')];_0x3223d5[_0x32ef('0x3c')]=_[_0x32ef('0x3d')](_0x7f2319);_0x3223d5['query']=_[_0x32ef('0x3d')](_0x1415ef[_0x32ef('0x3e')]);_0x3223d5[_0x32ef('0x3f')]=_[_0x32ef('0x40')](_0x3223d5[_0x32ef('0x3c')],_0x3223d5[_0x32ef('0x3e')]);_0x211c79[_0x32ef('0x41')]=_[_0x32ef('0x40')](_0x3223d5[_0x32ef('0x3c')],qs[_0x32ef('0x42')](_0x1415ef[_0x32ef('0x3e')][_0x32ef('0x42')]));_0x211c79['attributes']=_0x211c79[_0x32ef('0x41')][_0x32ef('0x43')]?_0x211c79[_0x32ef('0x41')]:_0x3223d5[_0x32ef('0x3c')];if(!_0x1415ef[_0x32ef('0x3e')][_0x32ef('0x44')](_0x32ef('0x45'))){_0x211c79['limit']=qs['limit'](_0x1415ef[_0x32ef('0x3e')][_0x32ef('0x31')]);_0x211c79[_0x32ef('0x30')]=qs[_0x32ef('0x30')](_0x1415ef['query'][_0x32ef('0x30')]);}_0x211c79[_0x32ef('0x46')]=qs['sort'](_0x1415ef[_0x32ef('0x3e')]['sort']);_0x211c79[_0x32ef('0x47')]=qs[_0x32ef('0x3f')](_[_0x32ef('0x48')](_0x1415ef[_0x32ef('0x3e')],_0x3223d5[_0x32ef('0x3f')]));if(_0x1415ef[_0x32ef('0x3e')][_0x32ef('0x49')]){_0x211c79[_0x32ef('0x47')]=_[_0x32ef('0x4a')](_0x211c79[_0x32ef('0x47')],{'$or':_['map'](_0x7f2319,function(_0x18b943){if(_0x18b943['type'][_0x32ef('0x4b')]!==_0x32ef('0x4c')){var _0x2dd94f={};_0x2dd94f[_0x18b943['field']]={'$like':'%'+_0x1415ef[_0x32ef('0x3e')][_0x32ef('0x49')]+'%'};return _0x2dd94f;}})});}_0x211c79=_[_0x32ef('0x4a')]({},_0x211c79,_0x1415ef[_0x32ef('0x4d')]);var _0x35b4e0={'where':_0x211c79[_0x32ef('0x47')]};return db[_0x32ef('0x4e')]['count'](_0x35b4e0)['then'](function(_0x36252c){_0x21da90[_0x32ef('0x2f')]=_0x36252c;if(_0x1415ef[_0x32ef('0x3e')][_0x32ef('0x4f')]){_0x211c79[_0x32ef('0x50')]=[{'all':!![]}];}return db[_0x32ef('0x4e')][_0x32ef('0x51')](_0x211c79);})[_0x32ef('0x20')](function(_0xc10e7){_0x21da90[_0x32ef('0x52')]=_0xc10e7;return _0x21da90;})[_0x32ef('0x20')](respondWithFilteredResult(_0x3a7c49,_0x211c79))[_0x32ef('0x2a')](handleError(_0x3a7c49,null));};exports[_0x32ef('0x53')]=function(_0x4c2534,_0x420f00){var _0x12fbd7={'raw':!![],'where':{'id':_0x4c2534[_0x32ef('0x54')]['id']}},_0x2837ee={};_0x2837ee[_0x32ef('0x3c')]=_[_0x32ef('0x3d')](db[_0x32ef('0x4e')][_0x32ef('0x3b')]);_0x2837ee[_0x32ef('0x3e')]=_[_0x32ef('0x3d')](_0x4c2534[_0x32ef('0x3e')]);_0x2837ee[_0x32ef('0x3f')]=_[_0x32ef('0x40')](_0x2837ee[_0x32ef('0x3c')],_0x2837ee[_0x32ef('0x3e')]);_0x12fbd7[_0x32ef('0x41')]=_[_0x32ef('0x40')](_0x2837ee[_0x32ef('0x3c')],qs['fields'](_0x4c2534['query'][_0x32ef('0x42')]));_0x12fbd7[_0x32ef('0x41')]=_0x12fbd7[_0x32ef('0x41')][_0x32ef('0x43')]?_0x12fbd7[_0x32ef('0x41')]:_0x2837ee[_0x32ef('0x3c')];if(_0x4c2534[_0x32ef('0x3e')][_0x32ef('0x4f')]){_0x12fbd7[_0x32ef('0x50')]=[{'all':!![]}];}_0x12fbd7=_[_0x32ef('0x4a')]({},_0x12fbd7,_0x4c2534[_0x32ef('0x4d')]);return db['OpenchannelMessage'][_0x32ef('0x55')](_0x12fbd7)[_0x32ef('0x20')](handleEntityNotFound(_0x420f00,null))[_0x32ef('0x20')](respondWithResult(_0x420f00,null))[_0x32ef('0x2a')](handleError(_0x420f00,null));};exports[_0x32ef('0x56')]=function(_0x387cf0,_0x52c588){return db[_0x32ef('0x4e')][_0x32ef('0x56')](_0x387cf0[_0x32ef('0x57')],{})['then'](respondWithResult(_0x52c588,0xc9))[_0x32ef('0x2a')](handleError(_0x52c588,null));};exports['update']=function(_0x2ee3dd,_0xbe35b){if(_0x2ee3dd['body']['id']){delete _0x2ee3dd[_0x32ef('0x57')]['id'];}return db['OpenchannelMessage'][_0x32ef('0x55')]({'where':{'id':_0x2ee3dd[_0x32ef('0x54')]['id']}})[_0x32ef('0x20')](handleEntityNotFound(_0xbe35b,null))[_0x32ef('0x20')](saveUpdates(_0x2ee3dd[_0x32ef('0x57')],null))[_0x32ef('0x20')](respondWithResult(_0xbe35b,null))[_0x32ef('0x2a')](handleError(_0xbe35b,null));};exports['destroy']=function(_0x56cc75,_0xdfa103){return db['OpenchannelMessage']['find']({'where':{'id':_0x56cc75[_0x32ef('0x54')]['id']}})[_0x32ef('0x20')](handleEntityNotFound(_0xdfa103,null))[_0x32ef('0x20')](removeEntity(_0xdfa103,null))[_0x32ef('0x2a')](handleError(_0xdfa103,null));};exports[_0x32ef('0x58')]=function(_0x356704,_0x316547){return db[_0x32ef('0x4e')][_0x32ef('0x58')]()[_0x32ef('0x20')](respondWithResult(_0x316547,null))['catch'](handleError(_0x316547,null));};var interaction_log=require('../../config/logger')(_0x32ef('0x59'));exports[_0x32ef('0x5a')]=function(_0x5549b4,_0xda1d1,_0x12e1ef){var _0x2b5703={'channel':'openchannel'};if(_0x5549b4[_0x32ef('0x57')]['id']){delete _0x5549b4[_0x32ef('0x57')]['id'];}_0x5549b4[_0x32ef('0x57')]['read']=!![];_0x5549b4['body'][_0x32ef('0x5b')]=moment()['format'](_0x32ef('0x5c'));_0x5549b4['body']['UserId']=_0x5549b4[_0x32ef('0x57')][_0x32ef('0x5d')]||_0x5549b4[_0x32ef('0x5e')]['id'];return db['OpenchannelMessage'][_0x32ef('0x55')]({'where':{'id':_0x5549b4[_0x32ef('0x54')]['id'],'UserId':null},'include':[{'model':db[_0x32ef('0x5f')],'as':'Contact'}]})[_0x32ef('0x20')](handleEntityNotFound(_0xda1d1,null))[_0x32ef('0x20')](saveUpdates(_0x5549b4['body'],null))['then'](function(_0x2e20dc){if(_0x2e20dc){_0x2b5703[_0x32ef('0x28')]=_0x2e20dc[_0x32ef('0x60')]({'plain':!![]});return db[_0x32ef('0x61')][_0x32ef('0x55')]({'where':{'id':_0x2e20dc[_0x32ef('0x62')]}});}return null;})['then'](handleEntityNotFound(_0xda1d1,null))[_0x32ef('0x20')](function(_0x63b65){if(_0x63b65){return _0x63b65[_0x32ef('0x36')]({'UserId':_0x5549b4[_0x32ef('0x57')][_0x32ef('0x5d')],'read1stAt':_[_0x32ef('0x63')](_0x63b65[_0x32ef('0x64')])?moment()[_0x32ef('0x65')](_0x32ef('0x5c')):undefined});}return null;})['then'](function(_0x1d7898){if(_0x1d7898){_0x2b5703[_0x32ef('0x66')]=_0x1d7898[_0x32ef('0x60')]({'plain':!![]});interaction_log[_0x32ef('0x21')](_0x32ef('0x67'),_0x5549b4['user']['id'],_0x5549b4['user'][_0x32ef('0x68')],_0x5549b4[_0x32ef('0x5e')][_0x32ef('0x69')],_0x2b5703[_0x32ef('0x66')]['id'],_0x5549b4[_0x32ef('0x57')]?JSON['stringify'](_0x5549b4[_0x32ef('0x57')]):'null');return respondWithRpcPromise(_0x32ef('0x6a'),_0x32ef('0x6b'),_0x2b5703);}return null;})['then'](function(_0x5402b4){if(_0x5402b4){if(_0x5549b4[_0x32ef('0x57')][_0x32ef('0x6c')]){_0x2b5703[_0x32ef('0x28')]['interface']=util['format'](_0x32ef('0x6d'),_0x5549b4[_0x32ef('0x5e')][_0x32ef('0x68')]);_0x2b5703[_0x32ef('0x28')]['channel']=_0x2b5703[_0x32ef('0x6e')];_0x2b5703[_0x32ef('0x28')][_0x32ef('0x6f')]=_0x32ef('0x5a');return respondWithRpcPromise(_0x32ef('0x70'),_0x32ef('0x70'),{'event':_0x32ef('0x71'),'message':_0x2b5703[_0x32ef('0x28')]},client9002)[_0x32ef('0x20')](function(){return _0x2b5703;});}return _0x2b5703;}return null;})[_0x32ef('0x20')](respondWithResult(_0xda1d1,null))[_0x32ef('0x2a')](handleError(_0xda1d1,null));};var interaction_log=require(_0x32ef('0x14'))('openchannel-interactions');exports['reject']=function(_0x3a9c97,_0x3c0b29,_0x57a40e){var _0x3a4be1={'agent':{},'channel':'openchannel'};if(_0x3a9c97[_0x32ef('0x57')]['id']){delete _0x3a9c97[_0x32ef('0x57')]['id'];}_0x3a9c97[_0x32ef('0x57')]['UserId']=_0x3a9c97[_0x32ef('0x57')]['UserId']||_0x3a9c97[_0x32ef('0x5e')]['id'];_0x3a4be1[_0x32ef('0x72')]['id']=_0x3a9c97['body']['UserId'];return db[_0x32ef('0x4e')]['find']({'where':{'id':_0x3a9c97[_0x32ef('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3c0b29,null))[_0x32ef('0x20')](function(_0x199df6){if(_0x199df6){_0x3a4be1[_0x32ef('0x28')]=_0x199df6['get']({'plain':!![]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x199df6[_0x32ef('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x3c0b29,null))[_0x32ef('0x20')](function(_0x13a374){if(_0x13a374){_0x3a4be1[_0x32ef('0x66')]=_0x13a374[_0x32ef('0x60')]({'plain':!![]});interaction_log[_0x32ef('0x21')](_0x32ef('0x73'),_0x3a9c97['user']['id'],_0x3a9c97[_0x32ef('0x5e')]['name'],_0x3a9c97['user'][_0x32ef('0x69')],_0x3a4be1['interaction']['id'],_0x3a9c97[_0x32ef('0x57')]?JSON[_0x32ef('0x74')](_0x3a9c97['body']):_0x32ef('0x75'));return respondWithRpcPromise(_0x32ef('0x76'),_0x32ef('0x77'),_0x3a4be1);}return null;})[_0x32ef('0x20')](function(_0x1fa36d){if(_0x1fa36d){_0x1fa36d[_0x32ef('0x28')]['interface']=util['format'](_0x32ef('0x6d'),_0x3a9c97['user'][_0x32ef('0x68')]);_0x1fa36d[_0x32ef('0x28')][_0x32ef('0x6e')]=_0x3a4be1[_0x32ef('0x6e')];_0x1fa36d[_0x32ef('0x28')][_0x32ef('0x6f')]='reject';respondWithRpcPromise(_0x32ef('0x70'),_0x32ef('0x70'),{'event':_0x32ef('0x78'),'message':_0x1fa36d[_0x32ef('0x28')]},client9002);return _0x3a4be1;}return null;})[_0x32ef('0x20')](respondWithResult(_0x3c0b29,null))['catch'](handleError(_0x3c0b29,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 7ae93fb..5788d14 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 _0xb3a2=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelMessage'];(function(_0x11a7e6,_0x5dc9f2){var _0xccfdf=function(_0x1b1621){while(--_0x1b1621){_0x11a7e6['push'](_0x11a7e6['shift']());}};_0xccfdf(++_0x5dc9f2);}(_0xb3a2,0xed));var _0x2b3a=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0xb3a2[_0x21549c];return _0x426cbd;};'use strict';var EventEmitter=require(_0x2b3a('0x0'));var OpenchannelMessage=require(_0x2b3a('0x1'))['db'][_0x2b3a('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x2b3a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2b3a('0x4'),'afterDestroy':_0x2b3a('0x5')};function emitEvent(_0xdaeb0e){return function(_0x1401ac,_0x303a37,_0x51b535){OpenchannelMessageEvents['emit'](_0xdaeb0e+':'+_0x1401ac['id'],_0x1401ac);OpenchannelMessageEvents[_0x2b3a('0x6')](_0xdaeb0e,_0x1401ac);_0x51b535(null);};}for(var e in events){if(events[_0x2b3a('0x7')](e)){var event=events[e];OpenchannelMessage[_0x2b3a('0x8')](e,emitEvent(event));}}module[_0x2b3a('0x9')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x7c5c=['hasOwnProperty','hook','exports','OpenchannelMessage','setMaxListeners','save','update','remove','emit'];(function(_0x5ed32c,_0x956025){var _0x271ea3=function(_0x206a21){while(--_0x206a21){_0x5ed32c['push'](_0x5ed32c['shift']());}};_0x271ea3(++_0x956025);}(_0x7c5c,0xc9));var _0xc7c5=function(_0x54eaaf,_0x17cb38){_0x54eaaf=_0x54eaaf-0x0;var _0x4918a0=_0x7c5c[_0x54eaaf];return _0x4918a0;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require('../../mysqldb')['db'][_0xc7c5('0x0')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xc7c5('0x1')](0x0);var events={'afterCreate':_0xc7c5('0x2'),'afterUpdate':_0xc7c5('0x3'),'afterDestroy':_0xc7c5('0x4')};function emitEvent(_0x5d0402){return function(_0x20bddc,_0x2e38a2,_0x285f32){OpenchannelMessageEvents[_0xc7c5('0x5')](_0x5d0402+':'+_0x20bddc['id'],_0x20bddc);OpenchannelMessageEvents[_0xc7c5('0x5')](_0x5d0402,_0x20bddc);_0x285f32(null);};}for(var e in events){if(events[_0xc7c5('0x6')](e)){var event=events[e];OpenchannelMessage[_0xc7c5('0x7')](e,emitEvent(event));}}module[_0xc7c5('0x8')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 75caa65..c7a1bc0 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 _0x15fc=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./openchannelMessage.attributes','define','OpenchannelMessage','fti_openchannel_messages','body','FULLTEXT','get','toLowerCase','out','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','update','createdAt','catch','error','secret','describe','then','OpenchannelAccount','find','Interactions','CmContact','Contact','keys','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','length','Interaction','omit','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect'];(function(_0x120639,_0x5034e0){var _0x3cd822=function(_0x4e9cbd){while(--_0x4e9cbd){_0x120639['push'](_0x120639['shift']());}};_0x3cd822(++_0x5034e0);}(_0x15fc,0x68));var _0xc15f=function(_0x458e66,_0x169416){_0x458e66=_0x458e66-0x0;var _0x1913e5=_0x15fc[_0x458e66];return _0x1913e5;};'use strict';var _=require(_0xc15f('0x0'));var util=require(_0xc15f('0x1'));var logger=require(_0xc15f('0x2'))(_0xc15f('0x3'));var moment=require('moment');var BPromise=require(_0xc15f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc15f('0x5'));var rimraf=require(_0xc15f('0x6'));var config=require(_0xc15f('0x7'));var attributes=require(_0xc15f('0x8'));module['exports']=function(_0x2f0ca3,_0x4e4dd6){return _0x2f0ca3[_0xc15f('0x9')](_0xc15f('0xa'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xc15f('0xb'),'fields':[_0xc15f('0xc')],'type':_0xc15f('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x378938,_0x593a53,_0x135846){var _0x2bdd69=_0x2f0ca3['models'];var _0xe62b6c=_0x378938[_0xc15f('0xe')]({'plain':!![]});if(_0xe62b6c['direction'][_0xc15f('0xf')]()==='in'||_0xe62b6c['direction']['toLowerCase']()===_0xc15f('0x10')&&!_0xe62b6c['secret']&&!_[_0xc15f('0x11')](_0xe62b6c[_0xc15f('0x12')])){_0x2bdd69[_0xc15f('0x13')][_0xc15f('0x14')]({'where':{'id':_0xe62b6c[_0xc15f('0x15')]}})['then'](function(_0x193ec4){if(_0x193ec4){_0x193ec4[_0xc15f('0x16')]({'lastMsgAt':_0xe62b6c[_0xc15f('0x17')],'lastMsgDirection':_0xe62b6c['direction'][_0xc15f('0xf')]()});}})[_0xc15f('0x18')](function(_0x1c6fb1){console[_0xc15f('0x19')](_0x1c6fb1);});}if(_0xe62b6c['direction']===_0xc15f('0x10')&&!_0xe62b6c[_0xc15f('0x1a')]){var _0x1bd0bb;_0x2bdd69['CmContact'][_0xc15f('0x1b')]()[_0xc15f('0x1c')](function(_0x4509e9){return _0x2bdd69[_0xc15f('0x1d')][_0xc15f('0x1e')]({'where':{'id':_0xe62b6c['OpenchannelAccountId']},'include':[{'model':_0x2bdd69['OpenchannelInteraction'],'as':_0xc15f('0x1f'),'where':{'id':_0xe62b6c[_0xc15f('0x15')]},'limit':0x1,'include':[{'model':_0x2bdd69[_0xc15f('0x20')],'as':_0xc15f('0x21'),'attributes':_[_0xc15f('0x22')](_0x4509e9)}]}]});})[_0xc15f('0x1c')](function(_0x312f34){_0x1bd0bb=_0x312f34[_0xc15f('0xe')]({'plain':!![]});if(_0x1bd0bb&&_0x1bd0bb['replyUri']){logger[_0xc15f('0x23')](_0xc15f('0x24'),_0xc15f('0x25'),util[_0xc15f('0x26')](_0xc15f('0x27'),_0xe62b6c['id'],_0x1bd0bb[_0xc15f('0x28')]));if(_0x1bd0bb[_0xc15f('0x1f')]&&_0x1bd0bb[_0xc15f('0x1f')][_0xc15f('0x29')]){_0xe62b6c[_0xc15f('0x2a')]=_[_0xc15f('0x2b')](_0x1bd0bb[_0xc15f('0x1f')][0x0],_0xc15f('0x21'));_0xe62b6c['Contact']=_0x1bd0bb[_0xc15f('0x1f')][0x0][_0xc15f('0x21')];}var _0x593a53={'method':'POST','uri':encodeURI(_0x1bd0bb[_0xc15f('0x28')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x593a53[_0xc15f('0x2c')]){case _0xc15f('0x2d'):_0x593a53['qs']=_0xe62b6c;break;case'POST':_0x593a53[_0xc15f('0xc')]=_0xe62b6c;break;}return rp(_0x593a53)[_0xc15f('0x1c')](function(_0x5e49be){logger['info'](_0xc15f('0x24'),_0xc15f('0x25'),util[_0xc15f('0x26')](_0xc15f('0x2e'),_0xe62b6c['id'],_0x1bd0bb['replyUri']));if(_0x5e49be[_0xc15f('0xc')]['threadId']&&_0x5e49be[_0xc15f('0xc')][_0xc15f('0x2f')]!=_0xe62b6c[_0xc15f('0x2a')][_0xc15f('0x2f')]){return _0x2bdd69[_0xc15f('0x13')][_0xc15f('0x16')]({'threadId':_0x5e49be[_0xc15f('0xc')]['threadId']},{'logging':!![],'where':{'id':_0xe62b6c[_0xc15f('0x2a')]['id']}});}else{return;}})[_0xc15f('0x1c')](function(){return _0x378938[_0xc15f('0x16')]({'read':!![]});})[_0xc15f('0x18')](function(_0x3f475b){logger[_0xc15f('0x19')](_0xc15f('0x24'),_0xc15f('0x25'),util[_0xc15f('0x30')](_0x3f475b,{'showHidden':![],'depth':null}));_0x135846();});}else{_0x135846();}})['finally'](function(){_0x135846();});}else{_0x135846();}}},'charset':_0xc15f('0x31'),'collate':_0xc15f('0x32')});}; \ No newline at end of file +var _0xe0b6=['rimraf','../../config/environment','./openchannelMessage.attributes','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','FULLTEXT','get','direction','toLowerCase','out','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','createdAt','catch','CmContact','OpenchannelAccount','find','Interactions','keys','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','length','omit','Contact','POST','method','GET','body','info','threadId','update','Interaction','error','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xe0b6,0x136));var _0x6e0b=function(_0x3a1ea5,_0x349f01){_0x3a1ea5=_0x3a1ea5-0x0;var _0xfac9b2=_0xe0b6[_0x3a1ea5];return _0xfac9b2;};'use strict';var _=require(_0x6e0b('0x0'));var util=require(_0x6e0b('0x1'));var logger=require(_0x6e0b('0x2'))(_0x6e0b('0x3'));var moment=require(_0x6e0b('0x4'));var BPromise=require(_0x6e0b('0x5'));var rp=require(_0x6e0b('0x6'));var fs=require('fs');var path=require(_0x6e0b('0x7'));var rimraf=require(_0x6e0b('0x8'));var config=require(_0x6e0b('0x9'));var attributes=require(_0x6e0b('0xa'));module['exports']=function(_0x4fccd6,_0x16589a){return _0x4fccd6['define'](_0x6e0b('0xb'),attributes,{'tableName':_0x6e0b('0xc'),'paranoid':![],'indexes':[{'name':_0x6e0b('0xd'),'fields':['body'],'type':_0x6e0b('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x6ad3ed,_0x1d30e1,_0xbe4e52){var _0x562332=_0x4fccd6['models'];var _0x5692b1=_0x6ad3ed[_0x6e0b('0xf')]({'plain':!![]});if(_0x5692b1['direction']['toLowerCase']()==='in'||_0x5692b1[_0x6e0b('0x10')][_0x6e0b('0x11')]()===_0x6e0b('0x12')&&!_0x5692b1['secret']&&!_[_0x6e0b('0x13')](_0x5692b1[_0x6e0b('0x14')])){_0x562332[_0x6e0b('0x15')][_0x6e0b('0x16')]({'where':{'id':_0x5692b1[_0x6e0b('0x17')]}})[_0x6e0b('0x18')](function(_0x4934b2){if(_0x4934b2){_0x4934b2['update']({'lastMsgAt':_0x5692b1[_0x6e0b('0x19')],'lastMsgDirection':_0x5692b1[_0x6e0b('0x10')]['toLowerCase']()});}})[_0x6e0b('0x1a')](function(_0x42c307){console['error'](_0x42c307);});}if(_0x5692b1[_0x6e0b('0x10')]===_0x6e0b('0x12')&&!_0x5692b1['secret']){var _0x6a4e65;_0x562332[_0x6e0b('0x1b')]['describe']()[_0x6e0b('0x18')](function(_0x52c795){return _0x562332[_0x6e0b('0x1c')][_0x6e0b('0x1d')]({'where':{'id':_0x5692b1['OpenchannelAccountId']},'include':[{'model':_0x562332[_0x6e0b('0x15')],'as':_0x6e0b('0x1e'),'where':{'id':_0x5692b1['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x562332[_0x6e0b('0x1b')],'as':'Contact','attributes':_[_0x6e0b('0x1f')](_0x52c795)}]}]});})[_0x6e0b('0x18')](function(_0x227b96){_0x6a4e65=_0x227b96[_0x6e0b('0xf')]({'plain':!![]});if(_0x6a4e65&&_0x6a4e65['replyUri']){logger['info'](_0x6e0b('0x20'),_0x6e0b('0x21'),util[_0x6e0b('0x22')](_0x6e0b('0x23'),_0x5692b1['id'],_0x6a4e65[_0x6e0b('0x24')]));if(_0x6a4e65[_0x6e0b('0x1e')]&&_0x6a4e65[_0x6e0b('0x1e')][_0x6e0b('0x25')]){_0x5692b1['Interaction']=_[_0x6e0b('0x26')](_0x6a4e65[_0x6e0b('0x1e')][0x0],_0x6e0b('0x27'));_0x5692b1['Contact']=_0x6a4e65['Interactions'][0x0][_0x6e0b('0x27')];}var _0x1d30e1={'method':_0x6e0b('0x28'),'uri':encodeURI(_0x6a4e65[_0x6e0b('0x24')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x1d30e1[_0x6e0b('0x29')]){case _0x6e0b('0x2a'):_0x1d30e1['qs']=_0x5692b1;break;case _0x6e0b('0x28'):_0x1d30e1[_0x6e0b('0x2b')]=_0x5692b1;break;}return rp(_0x1d30e1)['then'](function(_0x535de0){logger[_0x6e0b('0x2c')](_0x6e0b('0x20'),_0x6e0b('0x21'),util[_0x6e0b('0x22')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x5692b1['id'],_0x6a4e65[_0x6e0b('0x24')]));if(_0x535de0[_0x6e0b('0x2b')][_0x6e0b('0x2d')]&&_0x535de0['body'][_0x6e0b('0x2d')]!=_0x5692b1['Interaction'][_0x6e0b('0x2d')]){return _0x562332['OpenchannelInteraction'][_0x6e0b('0x2e')]({'threadId':_0x535de0[_0x6e0b('0x2b')][_0x6e0b('0x2d')]},{'logging':!![],'where':{'id':_0x5692b1[_0x6e0b('0x2f')]['id']}});}else{return;}})[_0x6e0b('0x18')](function(){return _0x6ad3ed[_0x6e0b('0x2e')]({'read':!![]});})[_0x6e0b('0x1a')](function(_0x57c0a5){logger[_0x6e0b('0x30')](_0x6e0b('0x20'),'afterCreate',util[_0x6e0b('0x31')](_0x57c0a5,{'showHidden':![],'depth':null}));_0xbe4e52();});}else{_0xbe4e52();}})[_0x6e0b('0x32')](function(){_0xbe4e52();});}else{_0xbe4e52();}}},'charset':_0x6e0b('0x33'),'collate':_0x6e0b('0x34')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 0eac6fc..5ac26eb 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 _0xbdb5=['register','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create','body','options','raw','CreateOpenchannelMessage','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket'];(function(_0x6e1afb,_0x1dd049){var _0x483554=function(_0xcfb32d){while(--_0xcfb32d){_0x6e1afb['push'](_0x6e1afb['shift']());}};_0x483554(++_0x1dd049);}(_0xbdb5,0x122));var _0x5bdb=function(_0x2fe191,_0x1d3829){_0x2fe191=_0x2fe191-0x0;var _0x46d673=_0xbdb5[_0x2fe191];return _0x46d673;};'use strict';var _=require(_0x5bdb('0x0'));var util=require(_0x5bdb('0x1'));var moment=require(_0x5bdb('0x2'));var BPromise=require(_0x5bdb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5bdb('0x4'));var db=require(_0x5bdb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5bdb('0x6'))(_0x5bdb('0x7'));var config=require('../../config/environment');var jayson=require(_0x5bdb('0x8'));var client=jayson[_0x5bdb('0x9')][_0x5bdb('0xa')]({'port':0x232a});config[_0x5bdb('0xb')]=_[_0x5bdb('0xc')](config[_0x5bdb('0xb')],{'host':_0x5bdb('0xd'),'port':0x18eb});var socket=require(_0x5bdb('0xe'))(new Redis(config['redis']));require(_0x5bdb('0xf'))[_0x5bdb('0x10')](socket);function respondWithRpcPromise(_0x122f8c,_0x57445f,_0x2af6a8){return new BPromise(function(_0x4cbf78,_0x15d8e6){return client['request'](_0x122f8c,_0x2af6a8)[_0x5bdb('0x11')](function(_0x5b91a6){logger[_0x5bdb('0x12')](_0x5bdb('0x13'),_0x57445f,_0x5bdb('0x14'));logger['debug'](_0x5bdb('0x15'),_0x57445f,_0x5bdb('0x14'),JSON[_0x5bdb('0x16')](_0x5b91a6));if(_0x5b91a6[_0x5bdb('0x17')]){if(_0x5b91a6[_0x5bdb('0x17')][_0x5bdb('0x18')]===0x1f4){logger['error'](_0x5bdb('0x13'),_0x57445f,_0x5b91a6[_0x5bdb('0x17')][_0x5bdb('0x19')]);return _0x15d8e6(_0x5b91a6[_0x5bdb('0x17')][_0x5bdb('0x19')]);}logger[_0x5bdb('0x17')]('OpenchannelMessage,\x20%s,\x20%s',_0x57445f,_0x5b91a6[_0x5bdb('0x17')]['message']);return _0x4cbf78(_0x5b91a6['error'][_0x5bdb('0x19')]);}else{logger[_0x5bdb('0x12')](_0x5bdb('0x13'),_0x57445f,_0x5bdb('0x14'));_0x4cbf78(_0x5b91a6[_0x5bdb('0x1a')][_0x5bdb('0x19')]);}})[_0x5bdb('0x1b')](function(_0x35275f){logger[_0x5bdb('0x17')](_0x5bdb('0x13'),_0x57445f,_0x35275f);_0x15d8e6(_0x35275f);});});}exports['CreateOpenchannelMessage']=function(_0x511b75){var _0x43f80d=this;return new Promise(function(_0x587dfc,_0x884112){return db['OpenchannelMessage'][_0x5bdb('0x1c')](_0x511b75[_0x5bdb('0x1d')],{'raw':_0x511b75[_0x5bdb('0x1e')]?_0x511b75[_0x5bdb('0x1e')][_0x5bdb('0x1f')]===undefined?!![]:![]:!![]})[_0x5bdb('0x11')](function(_0xbe4f13){logger[_0x5bdb('0x12')](_0x5bdb('0x20'),_0x511b75);logger[_0x5bdb('0x21')]('CreateOpenchannelMessage',_0x511b75,JSON[_0x5bdb('0x16')](_0xbe4f13));_0x587dfc(_0xbe4f13);})['catch'](function(_0xd4b276){logger['error']('CreateOpenchannelMessage',_0xd4b276[_0x5bdb('0x19')],_0x511b75);_0x884112(_0x43f80d['error'](0x1f4,_0xd4b276[_0x5bdb('0x19')]));});});}; \ No newline at end of file +var _0x2fa8=['./openchannelMessage.socket','register','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x2fa8,0x13e));var _0x82fa=function(_0x5d6e0c,_0x393360){_0x5d6e0c=_0x5d6e0c-0x0;var _0x29462d=_0x2fa8[_0x5d6e0c];return _0x29462d;};'use strict';var _=require(_0x82fa('0x0'));var util=require('util');var moment=require(_0x82fa('0x1'));var BPromise=require(_0x82fa('0x2'));var rs=require(_0x82fa('0x3'));var fs=require('fs');var Redis=require(_0x82fa('0x4'));var db=require(_0x82fa('0x5'))['db'];var utils=require(_0x82fa('0x6'));var logger=require(_0x82fa('0x7'))(_0x82fa('0x8'));var config=require(_0x82fa('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x82fa('0xa')]({'port':0x232a});config[_0x82fa('0xb')]=_['defaults'](config[_0x82fa('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x82fa('0xb')]));require(_0x82fa('0xc'))[_0x82fa('0xd')](socket);function respondWithRpcPromise(_0x291806,_0x26d948,_0x2d6f50){return new BPromise(function(_0x348406,_0xc86dfb){return client[_0x82fa('0xe')](_0x291806,_0x2d6f50)[_0x82fa('0xf')](function(_0x16ef5b){logger[_0x82fa('0x10')](_0x82fa('0x11'),_0x26d948,_0x82fa('0x12'));logger[_0x82fa('0x13')](_0x82fa('0x14'),_0x26d948,_0x82fa('0x12'),JSON[_0x82fa('0x15')](_0x16ef5b));if(_0x16ef5b[_0x82fa('0x16')]){if(_0x16ef5b[_0x82fa('0x16')][_0x82fa('0x17')]===0x1f4){logger[_0x82fa('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x26d948,_0x16ef5b[_0x82fa('0x16')]['message']);return _0xc86dfb(_0x16ef5b[_0x82fa('0x16')]['message']);}logger[_0x82fa('0x16')](_0x82fa('0x11'),_0x26d948,_0x16ef5b[_0x82fa('0x16')][_0x82fa('0x18')]);return _0x348406(_0x16ef5b['error'][_0x82fa('0x18')]);}else{logger[_0x82fa('0x10')](_0x82fa('0x11'),_0x26d948,'request\x20sent');_0x348406(_0x16ef5b[_0x82fa('0x19')][_0x82fa('0x18')]);}})[_0x82fa('0x1a')](function(_0x10d844){logger[_0x82fa('0x16')](_0x82fa('0x11'),_0x26d948,_0x10d844);_0xc86dfb(_0x10d844);});});}exports[_0x82fa('0x1b')]=function(_0xcf4ff2){var _0x875b86=this;return new Promise(function(_0x52b8d1,_0x1e10d7){return db[_0x82fa('0x1c')][_0x82fa('0x1d')](_0xcf4ff2[_0x82fa('0x1e')],{'raw':_0xcf4ff2[_0x82fa('0x1f')]?_0xcf4ff2[_0x82fa('0x1f')][_0x82fa('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x245d97){logger[_0x82fa('0x10')](_0x82fa('0x1b'),_0xcf4ff2);logger[_0x82fa('0x13')](_0x82fa('0x1b'),_0xcf4ff2,JSON[_0x82fa('0x15')](_0x245d97));_0x52b8d1(_0x245d97);})[_0x82fa('0x1a')](function(_0x3dd325){logger['error'](_0x82fa('0x1b'),_0x3dd325['message'],_0xcf4ff2);_0x1e10d7(_0x875b86['error'](0x1f4,_0x3dd325[_0x82fa('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 23efe87..d7b6582 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 _0xb66c=['openchannelMessage:','./openchannelMessage.events','remove','removeListener','register','length'];(function(_0x4ee9cd,_0xd375b0){var _0x328a5b=function(_0x3ad1f4){while(--_0x3ad1f4){_0x4ee9cd['push'](_0x4ee9cd['shift']());}};_0x328a5b(++_0xd375b0);}(_0xb66c,0x175));var _0xcb66=function(_0x1028a6,_0x4dfcb9){_0x1028a6=_0x1028a6-0x0;var _0x438a45=_0xb66c[_0x1028a6];return _0x438a45;};'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 +var _0x04de=['save','remove','update','emit','removeListener','length','openchannelMessage:','./openchannelMessage.events'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x04de,0x107));var _0xe04d=function(_0x4cfd8b,_0x644cf1){_0x4cfd8b=_0x4cfd8b-0x0;var _0x309aa9=_0x04de[_0x4cfd8b];return _0x309aa9;};'use strict';var OpenchannelMessageEvents=require(_0xe04d('0x0'));var events=[_0xe04d('0x1'),_0xe04d('0x2'),_0xe04d('0x3')];function createListener(_0x1e650d,_0x28f63f){return function(_0x1113af){_0x28f63f[_0xe04d('0x4')](_0x1e650d,_0x1113af);};}function removeListener(_0x2593a4,_0x70ead0){return function(){OpenchannelMessageEvents[_0xe04d('0x5')](_0x2593a4,_0x70ead0);};}exports['register']=function(_0x4bb925){for(var _0x4f7637=0x0,_0x531688=events[_0xe04d('0x6')];_0x4f7637<_0x531688;_0x4f7637++){var _0x210e93=events[_0x4f7637];var _0x72b1ce=createListener(_0xe04d('0x7')+_0x210e93,_0x4bb925);OpenchannelMessageEvents['on'](_0x210e93,_0x72b1ce);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index ad0e039..7304901 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 _0xcfea=['connect-timeout','express','../../config/environment','./openchannelQueue.controller','index','/describe','isAuthenticated','describe','get','/:id','show','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','util'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0xcfea,0x85));var _0xacfe=function(_0x1c2a13,_0x57ebba){_0x1c2a13=_0x1c2a13-0x0;var _0x423976=_0xcfea[_0x1c2a13];return _0x423976;};'use strict';var multer=require(_0xacfe('0x0'));var util=require(_0xacfe('0x1'));var path=require('path');var timeout=require(_0xacfe('0x2'));var express=require(_0xacfe('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xacfe('0x4'));var controller=require(_0xacfe('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xacfe('0x6')]);router['get'](_0xacfe('0x7'),auth[_0xacfe('0x8')](),controller[_0xacfe('0x9')]);router[_0xacfe('0xa')](_0xacfe('0xb'),auth['isAuthenticated'](),controller[_0xacfe('0xc')]);router[_0xacfe('0xa')]('/:id/members',auth[_0xacfe('0x8')](),controller['getMembers']);router[_0xacfe('0xa')](_0xacfe('0xd'),auth['isAuthenticated'](),controller[_0xacfe('0xe')]);router[_0xacfe('0xa')](_0xacfe('0xf'),auth['isAuthenticated'](),controller[_0xacfe('0x10')]);router[_0xacfe('0x11')]('/',auth[_0xacfe('0x8')](),controller[_0xacfe('0x12')]);router['post'](_0xacfe('0xd'),auth[_0xacfe('0x8')](),controller[_0xacfe('0x13')]);router['post'](_0xacfe('0xf'),auth[_0xacfe('0x8')](),controller[_0xacfe('0x14')]);router[_0xacfe('0x15')]('/:id',auth[_0xacfe('0x8')](),controller[_0xacfe('0x16')]);router[_0xacfe('0x17')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xacfe('0x17')](_0xacfe('0xd'),auth[_0xacfe('0x8')](),controller[_0xacfe('0x18')]);router['delete'](_0xacfe('0xf'),auth[_0xacfe('0x8')](),controller[_0xacfe('0x19')]);module[_0xacfe('0x1a')]=router; \ No newline at end of file +var _0x0aa5=['getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','update','delete','destroy','removeTeams','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams'];(function(_0x5a2adf,_0x39dc46){var _0x37b651=function(_0x24f4a7){while(--_0x24f4a7){_0x5a2adf['push'](_0x5a2adf['shift']());}};_0x37b651(++_0x39dc46);}(_0x0aa5,0x1b4));var _0x50aa=function(_0x2bb048,_0x250eb3){_0x2bb048=_0x2bb048-0x0;var _0x55a494=_0x0aa5[_0x2bb048];return _0x55a494;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x50aa('0x0'));var express=require('express');var router=express[_0x50aa('0x1')]();var auth=require(_0x50aa('0x2'));var interaction=require(_0x50aa('0x3'));var config=require('../../config/environment');var controller=require('./openchannelQueue.controller');router[_0x50aa('0x4')]('/',auth[_0x50aa('0x5')](),controller[_0x50aa('0x6')]);router[_0x50aa('0x4')](_0x50aa('0x7'),auth[_0x50aa('0x5')](),controller[_0x50aa('0x8')]);router[_0x50aa('0x4')](_0x50aa('0x9'),auth[_0x50aa('0x5')](),controller[_0x50aa('0xa')]);router['get'](_0x50aa('0xb'),auth['isAuthenticated'](),controller[_0x50aa('0xc')]);router[_0x50aa('0x4')](_0x50aa('0xd'),auth[_0x50aa('0x5')](),controller[_0x50aa('0xe')]);router['get'](_0x50aa('0xf'),auth['isAuthenticated'](),controller[_0x50aa('0x10')]);router[_0x50aa('0x11')]('/',auth[_0x50aa('0x5')](),controller[_0x50aa('0x12')]);router[_0x50aa('0x11')](_0x50aa('0xd'),auth[_0x50aa('0x5')](),controller[_0x50aa('0x13')]);router[_0x50aa('0x11')](_0x50aa('0xf'),auth['isAuthenticated'](),controller[_0x50aa('0x14')]);router['put'](_0x50aa('0x9'),auth[_0x50aa('0x5')](),controller[_0x50aa('0x15')]);router[_0x50aa('0x16')](_0x50aa('0x9'),auth[_0x50aa('0x5')](),controller[_0x50aa('0x17')]);router['delete'](_0x50aa('0xd'),auth[_0x50aa('0x5')](),controller[_0x50aa('0x18')]);router['delete']('/:id/users',auth[_0x50aa('0x5')](),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 d56da94..d2d97d1 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 _0xa15c=['name','INTEGER','ENUM','rrmemory','roundrobin','sequelize','exports','STRING'];(function(_0x2a510b,_0x5db1ec){var _0xae024d=function(_0x2d4ee7){while(--_0x2d4ee7){_0x2a510b['push'](_0x2a510b['shift']());}};_0xae024d(++_0x5db1ec);}(_0xa15c,0x15d));var _0xca15=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa15c[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0xca15('0x0'));module[_0xca15('0x1')]={'name':{'type':Sequelize[_0xca15('0x2')],'unique':_0xca15('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xca15('0x2')]},'timeout':{'type':Sequelize[_0xca15('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xca15('0x5')](_0xca15('0x6'),'beepall',_0xca15('0x7'))}}; \ No newline at end of file +var _0xf3bc=['STRING','ENUM','rrmemory','beepall','sequelize','exports'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0xf3bc,0x82));var _0xcf3b=function(_0x214e86,_0x2a6d43){_0x214e86=_0x214e86-0x0;var _0xfbedc=_0xf3bc[_0x214e86];return _0xfbedc;};'use strict';var Sequelize=require(_0xcf3b('0x0'));module[_0xcf3b('0x1')]={'name':{'type':Sequelize[_0xcf3b('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xcf3b('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xcf3b('0x3')](_0xcf3b('0x4'),_0xcf3b('0x5'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index d29b456..5076276 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 _0x1564=['query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','OpenchannelQueue','count','include','findAll','rows','catch','show','params','includeAll','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','describe','getMembers','findOne','nolimit','OpenchannelQueueId','UserOpenchannelQueue','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','SIP','openchannelPause','getTeams','addTeams','teams','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','Team','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','TeamId','all','compact','ids','userOpenchannelQueue:remove','addAgents','spread','userOpenchannelQueue:save','removeAgents','isArray','getAgents','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','set','apply','reject','save','update','destroy','then','get','OpenchannelQueues','UserProfileResource','error','name','send','rawAttributes','model','keys'];(function(_0x374358,_0x2767f9){var _0x56cd8a=function(_0x23e7fa){while(--_0x23e7fa){_0x374358['push'](_0x374358['shift']());}};_0x56cd8a(++_0x2767f9);}(_0x1564,0xdd));var _0x4156=function(_0x51168f,_0x27f5ae){_0x51168f=_0x51168f-0x0;var _0x276ee6=_0x1564[_0x51168f];return _0x276ee6;};'use strict';var pdf=require(_0x4156('0x0'));var emlformat=require(_0x4156('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4156('0x2'));var jsonpatch=require(_0x4156('0x3'));var rp=require(_0x4156('0x4'));var moment=require(_0x4156('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4156('0x6'));var util=require(_0x4156('0x7'));var path=require('path');var sox=require(_0x4156('0x8'));var csv=require(_0x4156('0x9'));var ejs=require(_0x4156('0xa'));var fs=require('fs');var _=require(_0x4156('0xb'));var squel=require(_0x4156('0xc'));var crypto=require('crypto');var jsforce=require(_0x4156('0xd'));var deskjs=require(_0x4156('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4156('0xf'));var Redis=require('ioredis');var authService=require(_0x4156('0x10'));var qs=require(_0x4156('0x11'));var hardwareService=require(_0x4156('0x12'));var logger=require(_0x4156('0x13'))('api');var utils=require(_0x4156('0x14'));var config=require('../../config/environment');var db=require(_0x4156('0x15'))['db'];config[_0x4156('0x16')]=_[_0x4156('0x17')](config[_0x4156('0x16')],{'host':_0x4156('0x18'),'port':0x18eb});var socket=require(_0x4156('0x19'))(new Redis(config[_0x4156('0x16')]));require('./openchannelQueue.socket')[_0x4156('0x1a')](socket);function respondWithStatusCode(_0x73006c,_0x29662e){_0x29662e=_0x29662e||0xcc;return function(_0x40e45c){if(_0x40e45c){return _0x73006c[_0x4156('0x1b')](_0x29662e);}return _0x73006c[_0x4156('0x1c')](_0x29662e)[_0x4156('0x1d')]();};}function respondWithResult(_0x4e8327,_0x222c61){_0x222c61=_0x222c61||0xc8;return function(_0x474b3c){if(_0x474b3c){return _0x4e8327[_0x4156('0x1c')](_0x222c61)[_0x4156('0x1e')](_0x474b3c);}};}function respondWithFilteredResult(_0x47877e,_0xb0fdf4){return function(_0x9936f){if(_0x9936f){var _0x1dbd53=_0x9936f['count'],_0x3b5ab2=_0xb0fdf4[_0x4156('0x1f')],_0x21ca3f=_0xb0fdf4[_0x4156('0x1f')]+_0xb0fdf4[_0x4156('0x20')],_0x553364;if(_0x21ca3f>=_0x1dbd53){_0x21ca3f=_0x1dbd53;_0x553364=0xc8;}else{_0x553364=0xce;}_0x47877e['status'](_0x553364);return _0x47877e[_0x4156('0x21')]('Content-Range',_0x3b5ab2+'-'+_0x21ca3f+'/'+_0x1dbd53)['json'](_0x9936f);}return null;};}function patchUpdates(_0x3ab46c){return function(_0x4c56f8){try{jsonpatch[_0x4156('0x22')](_0x4c56f8,_0x3ab46c,!![]);}catch(_0x1d3204){return BPromise[_0x4156('0x23')](_0x1d3204);}return _0x4c56f8[_0x4156('0x24')]();};}function saveUpdates(_0x434e5f,_0x3d361d){return function(_0x31892d){if(_0x31892d){return _0x31892d[_0x4156('0x25')](_0x434e5f)['then'](function(_0x3c83a0){return _0x3c83a0;});}return null;};}function removeEntity(_0x4188b5,_0x21d7bd){return function(_0x34234e){if(_0x34234e){return _0x34234e[_0x4156('0x26')]()[_0x4156('0x27')](function(){var _0x38ac17=_0x34234e[_0x4156('0x28')]({'plain':!![]});var _0x6c147=_0x4156('0x29');return db[_0x4156('0x2a')][_0x4156('0x26')]({'where':{'type':_0x6c147,'resourceId':_0x38ac17['id']}})['then'](function(){return _0x34234e;});})['then'](function(){_0x4188b5[_0x4156('0x1c')](0xcc)[_0x4156('0x1d')]();});}};}function handleEntityNotFound(_0x1a7a93,_0x144973){return function(_0x358755){if(!_0x358755){_0x1a7a93[_0x4156('0x1b')](0x194);}return _0x358755;};}function handleError(_0x544df3,_0x5023ef){_0x5023ef=_0x5023ef||0x1f4;return function(_0x42bf1f){logger[_0x4156('0x2b')](_0x42bf1f['stack']);if(_0x42bf1f[_0x4156('0x2c')]){delete _0x42bf1f[_0x4156('0x2c')];}_0x544df3['status'](_0x5023ef)[_0x4156('0x2d')](_0x42bf1f);};}exports['index']=function(_0x2e787e,_0x58723d){var _0x22abf2={},_0x220246={},_0x45f802={'count':0x0,'rows':[]};var _0x5dbc2c=db['OpenchannelQueue'][_0x4156('0x2e')];_0x220246[_0x4156('0x2f')]=_[_0x4156('0x30')](_0x5dbc2c);_0x220246['query']=_['keys'](_0x2e787e[_0x4156('0x31')]);_0x220246[_0x4156('0x32')]=_[_0x4156('0x33')](_0x220246[_0x4156('0x2f')],_0x220246['query']);_0x22abf2[_0x4156('0x34')]=_[_0x4156('0x33')](_0x220246['model'],qs[_0x4156('0x35')](_0x2e787e[_0x4156('0x31')][_0x4156('0x35')]));_0x22abf2[_0x4156('0x34')]=_0x22abf2['attributes'][_0x4156('0x36')]?_0x22abf2['attributes']:_0x220246[_0x4156('0x2f')];if(!_0x2e787e[_0x4156('0x31')][_0x4156('0x37')]('nolimit')){_0x22abf2[_0x4156('0x20')]=qs[_0x4156('0x20')](_0x2e787e['query'][_0x4156('0x20')]);_0x22abf2['offset']=qs[_0x4156('0x1f')](_0x2e787e['query'][_0x4156('0x1f')]);}_0x22abf2[_0x4156('0x38')]=qs[_0x4156('0x39')](_0x2e787e[_0x4156('0x31')]['sort']);_0x22abf2[_0x4156('0x3a')]=qs[_0x4156('0x32')](_[_0x4156('0x3b')](_0x2e787e['query'],_0x220246['filters']));if(_0x2e787e[_0x4156('0x31')][_0x4156('0x3c')]){_0x22abf2[_0x4156('0x3a')]=_[_0x4156('0x3d')](_0x22abf2[_0x4156('0x3a')],{'$or':_[_0x4156('0x3e')](_0x5dbc2c,function(_0x4a989f){if(_0x4a989f[_0x4156('0x3f')]['key']!==_0x4156('0x40')){var _0x10b719={};_0x10b719[_0x4a989f[_0x4156('0x41')]]={'$like':'%'+_0x2e787e[_0x4156('0x31')][_0x4156('0x3c')]+'%'};return _0x10b719;}})});}_0x22abf2=_['merge']({},_0x22abf2,_0x2e787e[_0x4156('0x42')]);var _0x1a1858={'where':_0x22abf2[_0x4156('0x3a')]};return db[_0x4156('0x43')]['count'](_0x1a1858)[_0x4156('0x27')](function(_0x4285bb){_0x45f802[_0x4156('0x44')]=_0x4285bb;if(_0x2e787e['query']['includeAll']){_0x22abf2[_0x4156('0x45')]=[{'all':!![]}];}return db[_0x4156('0x43')][_0x4156('0x46')](_0x22abf2);})[_0x4156('0x27')](function(_0x749a62){_0x45f802[_0x4156('0x47')]=_0x749a62;return _0x45f802;})[_0x4156('0x27')](respondWithFilteredResult(_0x58723d,_0x22abf2))[_0x4156('0x48')](handleError(_0x58723d,null));};exports[_0x4156('0x49')]=function(_0x1ba3f7,_0x3f617f){var _0x52961a={'raw':!![],'where':{'id':_0x1ba3f7[_0x4156('0x4a')]['id']}},_0xb21406={};_0xb21406[_0x4156('0x2f')]=_['keys'](db[_0x4156('0x43')][_0x4156('0x2e')]);_0xb21406[_0x4156('0x31')]=_[_0x4156('0x30')](_0x1ba3f7[_0x4156('0x31')]);_0xb21406[_0x4156('0x32')]=_[_0x4156('0x33')](_0xb21406[_0x4156('0x2f')],_0xb21406[_0x4156('0x31')]);_0x52961a['attributes']=_[_0x4156('0x33')](_0xb21406[_0x4156('0x2f')],qs[_0x4156('0x35')](_0x1ba3f7[_0x4156('0x31')]['fields']));_0x52961a[_0x4156('0x34')]=_0x52961a[_0x4156('0x34')][_0x4156('0x36')]?_0x52961a[_0x4156('0x34')]:_0xb21406[_0x4156('0x2f')];if(_0x1ba3f7[_0x4156('0x31')][_0x4156('0x4b')]){_0x52961a[_0x4156('0x45')]=[{'all':!![]}];}_0x52961a=_['merge']({},_0x52961a,_0x1ba3f7['options']);return db[_0x4156('0x43')][_0x4156('0x4c')](_0x52961a)[_0x4156('0x27')](handleEntityNotFound(_0x3f617f,null))[_0x4156('0x27')](respondWithResult(_0x3f617f,null))[_0x4156('0x48')](handleError(_0x3f617f,null));};exports['create']=function(_0x1f4edc,_0x1e51c7){return db[_0x4156('0x43')]['create'](_0x1f4edc[_0x4156('0x4d')],{})[_0x4156('0x27')](function(_0x159bf7){var _0x49b672=_0x1f4edc[_0x4156('0x4e')]['get']({'plain':!![]});if(!_0x49b672)throw new Error(_0x4156('0x4f'));if(_0x49b672['role']===_0x4156('0x4e')){var _0x4ec0e6=_0x159bf7[_0x4156('0x28')]({'plain':!![]});var _0xd1c506=_0x4156('0x29');return db[_0x4156('0x50')][_0x4156('0x4c')]({'where':{'name':_0xd1c506,'userProfileId':_0x49b672[_0x4156('0x51')]},'raw':!![]})[_0x4156('0x27')](function(_0x2c91a6){if(_0x2c91a6&&_0x2c91a6[_0x4156('0x52')]===0x0){return db['UserProfileResource']['create']({'name':_0x4ec0e6[_0x4156('0x2c')],'resourceId':_0x4ec0e6['id'],'type':_0x2c91a6[_0x4156('0x2c')],'sectionId':_0x2c91a6['id']},{})['then'](function(){return _0x159bf7;});}else{return _0x159bf7;}})['catch'](function(_0x514383){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x514383);throw _0x514383;});}return _0x159bf7;})[_0x4156('0x27')](respondWithResult(_0x1e51c7,0xc9))[_0x4156('0x48')](handleError(_0x1e51c7,null));};exports[_0x4156('0x25')]=function(_0x4abd3c,_0x52a84d){if(_0x4abd3c[_0x4156('0x4d')]['id']){delete _0x4abd3c[_0x4156('0x4d')]['id'];}return db['OpenchannelQueue'][_0x4156('0x4c')]({'where':{'id':_0x4abd3c[_0x4156('0x4a')]['id']}})['then'](handleEntityNotFound(_0x52a84d,null))[_0x4156('0x27')](saveUpdates(_0x4abd3c[_0x4156('0x4d')],null))[_0x4156('0x27')](respondWithResult(_0x52a84d,null))[_0x4156('0x48')](handleError(_0x52a84d,null));};exports[_0x4156('0x26')]=function(_0x1e8a08,_0x34c7ad){return db[_0x4156('0x43')][_0x4156('0x4c')]({'where':{'id':_0x1e8a08['params']['id']}})[_0x4156('0x27')](handleEntityNotFound(_0x34c7ad,null))[_0x4156('0x27')](removeEntity(_0x34c7ad,null))[_0x4156('0x48')](handleError(_0x34c7ad,null));};exports[_0x4156('0x53')]=function(_0x119f78,_0xfc6f4f){return db[_0x4156('0x43')][_0x4156('0x53')]()[_0x4156('0x27')](respondWithResult(_0xfc6f4f,null))[_0x4156('0x48')](handleError(_0xfc6f4f,null));};exports[_0x4156('0x54')]=function(_0x2ef86e,_0x557b70,_0x1a1db1){var _0x109742={'raw':!![],'where':{}},_0x5f33ce={},_0x5468e7;return db['OpenchannelQueue'][_0x4156('0x55')]({'where':{'id':_0x2ef86e[_0x4156('0x4a')]['id']}})[_0x4156('0x27')](handleEntityNotFound(_0x557b70,null))[_0x4156('0x27')](function(_0x38e837){if(_0x38e837){_0x5468e7=_0x38e837[_0x4156('0x28')]({'plain':!![]});_0x5f33ce[_0x4156('0x2f')]=_[_0x4156('0x30')](db['UserOpenchannelQueue'][_0x4156('0x2e')]);_0x5f33ce['query']=_[_0x4156('0x30')](_0x2ef86e[_0x4156('0x31')]);_0x5f33ce[_0x4156('0x32')]=_['intersection'](_0x5f33ce[_0x4156('0x2f')],_0x5f33ce[_0x4156('0x31')]);_0x109742[_0x4156('0x34')]=_['intersection'](_0x5f33ce['model'],qs[_0x4156('0x35')](_0x2ef86e[_0x4156('0x31')]['fields']));_0x109742[_0x4156('0x34')]=_0x109742['attributes'][_0x4156('0x36')]?_0x109742[_0x4156('0x34')]:_0x5f33ce[_0x4156('0x2f')];if(!_0x2ef86e['query']['hasOwnProperty'](_0x4156('0x56'))){_0x109742['limit']=qs[_0x4156('0x20')](_0x2ef86e[_0x4156('0x31')][_0x4156('0x20')]);_0x109742[_0x4156('0x1f')]=qs[_0x4156('0x1f')](_0x2ef86e[_0x4156('0x31')]['offset']);}_0x109742[_0x4156('0x38')]=qs[_0x4156('0x39')](_0x2ef86e[_0x4156('0x31')][_0x4156('0x39')]);_0x109742[_0x4156('0x3a')]=qs['filters'](_['pick'](_0x2ef86e[_0x4156('0x31')],_0x5f33ce[_0x4156('0x32')]));_0x109742[_0x4156('0x3a')][_0x4156('0x57')]=_0x38e837['id'];if(_0x2ef86e[_0x4156('0x31')][_0x4156('0x3c')]){_0x109742[_0x4156('0x3a')]=_[_0x4156('0x3d')](_0x109742[_0x4156('0x3a')],{'$or':_[_0x4156('0x3e')](_0x109742['attributes'],function(_0x53e0c6){var _0x21c5af={};_0x21c5af[_0x53e0c6]={'$like':'%'+_0x2ef86e[_0x4156('0x31')]['filter']+'%'};return _0x21c5af;})});}_0x109742=_['merge']({},_0x109742,_0x2ef86e['options']);return db[_0x4156('0x58')][_0x4156('0x46')](_0x109742);}})['then'](function(_0x36a80a){if(_0x36a80a){return db[_0x4156('0x59')][_0x4156('0x5a')]({'where':{'id':_['map'](_0x36a80a,_0x4156('0x5b')),'role':_0x4156('0x5c')},'attributes':['id',_0x4156('0x2c'),'openchannelPause',_0x4156('0x5d'),_0x4156('0x5e')]});}})['then'](function(_0x133995){if(_0x133995){return{'count':_0x133995[_0x4156('0x44')],'rows':_['map'](_0x133995['rows'],function(_0x10d1ae){return{'membername':_0x10d1ae[_0x4156('0x2c')],'UserId':_0x10d1ae['id'],'queue_name':_0x5468e7['name'],'OpenchannelQueueId':_0x5468e7['id'],'interface':util[_0x4156('0x5f')]('%s/%s',_0x4156('0x60'),_0x10d1ae[_0x4156('0x2c')]),'penalty':0x0,'paused':_0x10d1ae[_0x4156('0x61')],'createdAt':_0x10d1ae[_0x4156('0x5e')],'updatedAt':_0x10d1ae[_0x4156('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4156('0x27')](respondWithFilteredResult(_0x557b70,_0x109742))['catch'](handleError(_0x557b70,null));};exports['getTeams']=function(_0x4698d9,_0x9713ef,_0x3b7587){var _0x5c34f0={};var _0x2f3ac8={};var _0x5e7d41;var _0x4dcdb1;return db[_0x4156('0x43')][_0x4156('0x55')]({'where':{'id':_0x4698d9[_0x4156('0x4a')]['id']}})[_0x4156('0x27')](handleEntityNotFound(_0x9713ef,null))[_0x4156('0x27')](function(_0x6ba30e){if(_0x6ba30e){_0x5e7d41=_0x6ba30e;_0x2f3ac8['model']=_[_0x4156('0x30')](db['Team'][_0x4156('0x2e')]);_0x2f3ac8[_0x4156('0x31')]=_[_0x4156('0x30')](_0x4698d9['query']);_0x2f3ac8[_0x4156('0x32')]=_[_0x4156('0x33')](_0x2f3ac8['model'],_0x2f3ac8['query']);_0x5c34f0[_0x4156('0x34')]=_[_0x4156('0x33')](_0x2f3ac8['model'],qs[_0x4156('0x35')](_0x4698d9[_0x4156('0x31')][_0x4156('0x35')]));_0x5c34f0['attributes']=_0x5c34f0[_0x4156('0x34')][_0x4156('0x36')]?_0x5c34f0[_0x4156('0x34')]:_0x2f3ac8[_0x4156('0x2f')];_0x5c34f0[_0x4156('0x38')]=qs[_0x4156('0x39')](_0x4698d9[_0x4156('0x31')][_0x4156('0x39')]);_0x5c34f0[_0x4156('0x3a')]=qs[_0x4156('0x32')](_[_0x4156('0x3b')](_0x4698d9[_0x4156('0x31')],_0x2f3ac8[_0x4156('0x32')]));if(_0x4698d9[_0x4156('0x31')][_0x4156('0x3c')]){_0x5c34f0[_0x4156('0x3a')]=_[_0x4156('0x3d')](_0x5c34f0[_0x4156('0x3a')],{'$or':_[_0x4156('0x3e')](_0x5c34f0[_0x4156('0x34')],function(_0x532466){var _0x26da81={};_0x26da81[_0x532466]={'$like':'%'+_0x4698d9[_0x4156('0x31')][_0x4156('0x3c')]+'%'};return _0x26da81;})});}_0x5c34f0=_[_0x4156('0x3d')]({},_0x5c34f0,_0x4698d9['options']);return _0x5e7d41[_0x4156('0x62')](_0x5c34f0);}})['then'](function(_0x468efa){if(_0x468efa){_0x4dcdb1=_0x468efa[_0x4156('0x36')];if(!_0x4698d9['query'][_0x4156('0x37')](_0x4156('0x56'))){_0x5c34f0['limit']=qs['limit'](_0x4698d9[_0x4156('0x31')][_0x4156('0x20')]);_0x5c34f0[_0x4156('0x1f')]=qs[_0x4156('0x1f')](_0x4698d9[_0x4156('0x31')][_0x4156('0x1f')]);}return _0x5e7d41[_0x4156('0x62')](_0x5c34f0);}})[_0x4156('0x27')](function(_0xf2a878){if(_0xf2a878){return _0xf2a878?{'count':_0x4dcdb1,'rows':_0xf2a878}:null;}})[_0x4156('0x27')](respondWithResult(_0x9713ef,null))[_0x4156('0x48')](handleError(_0x9713ef,null));};exports[_0x4156('0x63')]=function(_0x11e332,_0x5c884e,_0x5535cd){var _0x3d05cb=_0x11e332['body'][_0x4156('0x64')];return db['Team']['findAll']({'where':{'id':_[_0x4156('0x3e')](_0x3d05cb,'id')},'attributes':['id'],'include':[{'model':db[_0x4156('0x59')],'as':_0x4156('0x65'),'attributes':['id',_0x4156('0x2c'),_0x4156('0x66'),_0x4156('0x67'),_0x4156('0x68')],'raw':!![]}]})[_0x4156('0x27')](function(_0x53bff5){if(_0x53bff5){var _0x2146a9=_['flatMap'](_0x53bff5,function(_0x444df7){var _0xdf40ab=_0x444df7[_0x4156('0x28')]({'plain':!![]});return _0xdf40ab['Agents'];});return db[_0x4156('0x43')][_0x4156('0x4c')]({'where':{'id':_0x11e332[_0x4156('0x4a')]['id']}})[_0x4156('0x27')](function(_0x470eb0){return db[_0x4156('0x69')][_0x4156('0x6a')](function(_0x422355){return _0x470eb0['addTeams'](_[_0x4156('0x3e')](_0x3d05cb,'id'),{'transaction':_0x422355})[_0x4156('0x27')](function(){return BPromise[_0x4156('0x6b')](_0x2146a9,function(_0x49a02b){return db['UserOpenchannelQueue'][_0x4156('0x6c')]({'where':{'UserId':_0x49a02b['id'],'OpenchannelQueueId':_0x11e332[_0x4156('0x4a')]['id']},'transaction':_0x422355});});})[_0x4156('0x27')](function(){_0x2146a9[_0x4156('0x6d')](function(_0x44d36e){socket[_0x4156('0x6e')]('userOpenchannelQueue:save',{'UserId':_0x44d36e['id'],'OpenchannelQueueId':_0x470eb0['id']});});});});});}})[_0x4156('0x27')](respondWithStatusCode(_0x5c884e,null))[_0x4156('0x48')](handleError(_0x5c884e,null));};exports[_0x4156('0x6f')]=function(_0x2f9a55,_0x282621,_0x4bbe90){return db[_0x4156('0x70')][_0x4156('0x46')]({'where':{'id':_0x2f9a55[_0x4156('0x31')]['ids']},'attributes':['id'],'include':[{'model':db[_0x4156('0x59')],'as':_0x4156('0x65'),'attributes':['id'],'raw':!![]}]})[_0x4156('0x27')](handleEntityNotFound(_0x282621,null))[_0x4156('0x27')](function(_0x27d33d){var _0x48617a=_[_0x4156('0x3e')](_0x27d33d,'id');var _0x3570f0=[];var _0x5e4a88=[];var _0x38d571=squel['select']();_0x38d571[_0x4156('0x41')](_0x4156('0x71'))[_0x4156('0x72')]('team_has_openchannel_queues','tq')['join'](_0x4156('0x73'),'ut',_0x4156('0x74'))[_0x4156('0x3a')](_0x4156('0x75'),_0x2f9a55[_0x4156('0x4a')]['id']);for(var _0x28969e=0x0;_0x28969e<_0x27d33d['length'];_0x28969e+=0x1){let _0x302bc4=_0x27d33d[_0x28969e];for(var _0x8b88d2=0x0;_0x8b88d2<_0x302bc4[_0x4156('0x65')]['length'];_0x8b88d2+=0x1){let _0x2debef=_0x302bc4[_0x4156('0x65')][_0x8b88d2];var _0x23bda1=_0x38d571[_0x4156('0x76')]();_0x23bda1[_0x4156('0x3a')]('ut.UserId\x20=\x20?',_0x2debef['id']);_0x5e4a88[_0x4156('0x77')](db[_0x4156('0x69')][_0x4156('0x31')](_0x23bda1[_0x4156('0x78')](),{'type':db[_0x4156('0x69')][_0x4156('0x79')][_0x4156('0x7a')]})[_0x4156('0x27')](function(_0x2c206d){if(_0x2c206d[_0x4156('0x36')]===0x1){return _0x2debef['id'];}else{var _0x40c185=_[_0x4156('0x7b')](_[_0x4156('0x3e')](_0x2c206d,_0x4156('0x7c')),function(_0x23c45d){return _['includes'](_0x48617a,_0x23c45d);});if(_0x40c185){return _0x2debef['id'];}}}));}}return BPromise[_0x4156('0x7d')](_0x5e4a88)[_0x4156('0x27')](function(_0x3dd2f4){_0x3570f0=_(_0x3570f0)['union'](_0x3dd2f4)[_0x4156('0x7e')]()['value']();return db[_0x4156('0x43')]['find']({'where':{'id':_0x2f9a55[_0x4156('0x4a')]['id']}})[_0x4156('0x27')](function(_0x4bc57d){return db[_0x4156('0x69')][_0x4156('0x6a')](function(_0x2941ac){return _0x4bc57d[_0x4156('0x6f')](_0x2f9a55[_0x4156('0x31')][_0x4156('0x7f')],{'transaction':_0x2941ac})[_0x4156('0x27')](function(){if(!_['isEmpty'](_0x3570f0)){return _0x4bc57d['removeAgents'](_0x3570f0,{'transaction':_0x2941ac});}})[_0x4156('0x27')](function(){_0x3570f0['forEach'](function(_0x4aee57){socket[_0x4156('0x6e')](_0x4156('0x80'),{'UserId':_0x4aee57,'OpenchannelQueueId':_0x4bc57d['id']});});});});});});})[_0x4156('0x27')](respondWithStatusCode(_0x282621,null))[_0x4156('0x48')](handleError(_0x282621,null));};exports[_0x4156('0x81')]=function(_0xcc0fb,_0x9a83be,_0x521bf8){return db[_0x4156('0x43')][_0x4156('0x4c')]({'where':{'id':_0xcc0fb['params']['id']}})[_0x4156('0x27')](handleEntityNotFound(_0x9a83be,null))[_0x4156('0x27')](function(_0x3cd09e){if(_0x3cd09e){return _0x3cd09e[_0x4156('0x81')](_0xcc0fb['body'][_0x4156('0x7f')],_['omit'](_0xcc0fb[_0x4156('0x4d')],[_0x4156('0x7f'),'id'])||{})[_0x4156('0x82')](function(_0x3a7bf7){for(var _0x2ef0e3=0x0;_0x2ef0e3<_0xcc0fb['body'][_0x4156('0x7f')]['length'];_0x2ef0e3+=0x1){socket[_0x4156('0x6e')](_0x4156('0x83'),{'UserId':_0xcc0fb[_0x4156('0x4d')][_0x4156('0x7f')][_0x2ef0e3],'OpenchannelQueueId':_0xcc0fb[_0x4156('0x4a')]['id']});}return _0x3a7bf7;});}})[_0x4156('0x27')](respondWithResult(_0x9a83be,null))[_0x4156('0x48')](handleError(_0x9a83be,null));};exports[_0x4156('0x84')]=function(_0x55faf7,_0x53192e,_0x538fff){return db[_0x4156('0x43')]['find']({'where':{'id':_0x55faf7[_0x4156('0x4a')]['id']}})[_0x4156('0x27')](handleEntityNotFound(_0x53192e,null))[_0x4156('0x27')](function(_0x193f1d){if(_0x193f1d){return _0x193f1d['removeAgents'](_0x55faf7['query'][_0x4156('0x7f')])[_0x4156('0x27')](function(){if(_[_0x4156('0x85')](_0x55faf7[_0x4156('0x31')]['ids'])){for(var _0x385407=0x0;_0x385407<_0x55faf7[_0x4156('0x31')]['ids'][_0x4156('0x36')];_0x385407+=0x1){socket[_0x4156('0x6e')](_0x4156('0x80'),{'UserId':Number(_0x55faf7[_0x4156('0x31')]['ids'][_0x385407]),'OpenchannelQueueId':Number(_0x55faf7[_0x4156('0x4a')]['id'])});}}else{socket[_0x4156('0x6e')](_0x4156('0x80'),{'UserId':Number(_0x55faf7[_0x4156('0x31')][_0x4156('0x7f')]),'OpenchannelQueueId':Number(_0x55faf7[_0x4156('0x4a')]['id'])});}});}})[_0x4156('0x27')](respondWithStatusCode(_0x53192e,null))[_0x4156('0x48')](handleError(_0x53192e,null));};exports[_0x4156('0x86')]=function(_0x3dfdd0,_0x4c0691,_0x144995){var _0x5bf850={};var _0x339270={};var _0x217d60;var _0x344601;return db[_0x4156('0x43')][_0x4156('0x55')]({'where':{'id':_0x3dfdd0[_0x4156('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4c0691,null))[_0x4156('0x27')](function(_0x4592c7){if(_0x4592c7){_0x217d60=_0x4592c7;_0x339270['model']=_[_0x4156('0x30')](db[_0x4156('0x59')][_0x4156('0x2e')]);_0x339270['query']=_[_0x4156('0x30')](_0x3dfdd0[_0x4156('0x31')]);_0x339270[_0x4156('0x32')]=_['intersection'](_0x339270[_0x4156('0x2f')],_0x339270[_0x4156('0x31')]);_0x5bf850['attributes']=_[_0x4156('0x33')](_0x339270[_0x4156('0x2f')],qs[_0x4156('0x35')](_0x3dfdd0[_0x4156('0x31')]['fields']));_0x5bf850[_0x4156('0x34')]=_0x5bf850[_0x4156('0x34')][_0x4156('0x36')]?_0x5bf850[_0x4156('0x34')]:_0x339270[_0x4156('0x2f')];_0x5bf850[_0x4156('0x38')]=qs[_0x4156('0x39')](_0x3dfdd0[_0x4156('0x31')][_0x4156('0x39')]);_0x5bf850[_0x4156('0x3a')]=qs[_0x4156('0x32')](_[_0x4156('0x3b')](_0x3dfdd0[_0x4156('0x31')],_0x339270['filters']));if(_0x3dfdd0[_0x4156('0x31')][_0x4156('0x3c')]){_0x5bf850['where']=_[_0x4156('0x3d')](_0x5bf850[_0x4156('0x3a')],{'$or':_[_0x4156('0x3e')](_0x5bf850[_0x4156('0x34')],function(_0x13ef16){var _0x5b8c7a={};_0x5b8c7a[_0x13ef16]={'$like':'%'+_0x3dfdd0[_0x4156('0x31')][_0x4156('0x3c')]+'%'};return _0x5b8c7a;})});}_0x5bf850=_['merge']({},_0x5bf850,_0x3dfdd0[_0x4156('0x42')]);return _0x217d60[_0x4156('0x86')](_0x5bf850);}})[_0x4156('0x27')](function(_0x41a4b9){if(_0x41a4b9){_0x344601=_0x41a4b9[_0x4156('0x36')];if(!_0x3dfdd0['query'][_0x4156('0x37')]('nolimit')){_0x5bf850['limit']=qs[_0x4156('0x20')](_0x3dfdd0['query'][_0x4156('0x20')]);_0x5bf850[_0x4156('0x1f')]=qs[_0x4156('0x1f')](_0x3dfdd0[_0x4156('0x31')][_0x4156('0x1f')]);}return _0x217d60[_0x4156('0x86')](_0x5bf850);}})['then'](function(_0x44103a){if(_0x44103a){return _0x44103a?{'count':_0x344601,'rows':_0x44103a}:null;}})[_0x4156('0x27')](respondWithResult(_0x4c0691,null))['catch'](handleError(_0x4c0691,null));}; \ No newline at end of file +var _0x0413=['join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','every','TeamId','includes','all','union','compact','removeAgents','forEach','emit','addAgents','omit','userOpenchannelQueue:remove','getAgents','html-pdf','eml-format','fast-json-patch','request-promise','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','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./openchannelQueue.socket','sendStatus','status','count','offset','set','Content-Range','json','apply','reject','save','then','OpenchannelQueues','UserProfileResource','error','stack','name','send','index','OpenchannelQueue','rawAttributes','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','fields','find','create','body','user','get','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','getMembers','UserOpenchannelQueue','OpenchannelQueueId','User','findAndCountAll','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','addTeams','teams','Team','online','voicePause','interface','Agents','sequelize','transaction','each','findOrCreate','userOpenchannelQueue:save','removeTeams','ids','select','from','team_has_openchannel_queues'];(function(_0x587b1a,_0x264fe1){var _0x3d8a1f=function(_0x3e6f01){while(--_0x3e6f01){_0x587b1a['push'](_0x587b1a['shift']());}};_0x3d8a1f(++_0x264fe1);}(_0x0413,0x1b8));var _0x3041=function(_0x315239,_0x1bd801){_0x315239=_0x315239-0x0;var _0xa1e160=_0x0413[_0x315239];return _0xa1e160;};'use strict';var pdf=require(_0x3041('0x0'));var emlformat=require(_0x3041('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3041('0x2'));var rp=require(_0x3041('0x3'));var moment=require('moment');var BPromise=require(_0x3041('0x4'));var Mustache=require(_0x3041('0x5'));var util=require(_0x3041('0x6'));var path=require(_0x3041('0x7'));var sox=require(_0x3041('0x8'));var csv=require(_0x3041('0x9'));var ejs=require(_0x3041('0xa'));var fs=require('fs');var _=require(_0x3041('0xb'));var squel=require(_0x3041('0xc'));var crypto=require(_0x3041('0xd'));var jsforce=require(_0x3041('0xe'));var deskjs=require(_0x3041('0xf'));var toCsv=require('to-csv');var querystring=require(_0x3041('0x10'));var Papa=require(_0x3041('0x11'));var Redis=require(_0x3041('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3041('0x13'));var hardwareService=require(_0x3041('0x14'));var logger=require(_0x3041('0x15'))(_0x3041('0x16'));var utils=require(_0x3041('0x17'));var config=require(_0x3041('0x18'));var db=require('../../mysqldb')['db'];config[_0x3041('0x19')]=_['defaults'](config['redis'],{'host':_0x3041('0x1a'),'port':0x18eb});var socket=require(_0x3041('0x1b'))(new Redis(config[_0x3041('0x19')]));require(_0x3041('0x1c'))['register'](socket);function respondWithStatusCode(_0x24d568,_0x1fb06f){_0x1fb06f=_0x1fb06f||0xcc;return function(_0x2097d0){if(_0x2097d0){return _0x24d568[_0x3041('0x1d')](_0x1fb06f);}return _0x24d568[_0x3041('0x1e')](_0x1fb06f)['end']();};}function respondWithResult(_0x19907d,_0xd5bb7b){_0xd5bb7b=_0xd5bb7b||0xc8;return function(_0x2c430c){if(_0x2c430c){return _0x19907d[_0x3041('0x1e')](_0xd5bb7b)['json'](_0x2c430c);}};}function respondWithFilteredResult(_0x4d500a,_0x20c8ba){return function(_0x4853e3){if(_0x4853e3){var _0xe118cc=_0x4853e3[_0x3041('0x1f')],_0x100523=_0x20c8ba[_0x3041('0x20')],_0x393a41=_0x20c8ba[_0x3041('0x20')]+_0x20c8ba['limit'],_0x328e7e;if(_0x393a41>=_0xe118cc){_0x393a41=_0xe118cc;_0x328e7e=0xc8;}else{_0x328e7e=0xce;}_0x4d500a['status'](_0x328e7e);return _0x4d500a[_0x3041('0x21')](_0x3041('0x22'),_0x100523+'-'+_0x393a41+'/'+_0xe118cc)[_0x3041('0x23')](_0x4853e3);}return null;};}function patchUpdates(_0x21c725){return function(_0x543840){try{jsonpatch[_0x3041('0x24')](_0x543840,_0x21c725,!![]);}catch(_0x1a3bf6){return BPromise[_0x3041('0x25')](_0x1a3bf6);}return _0x543840[_0x3041('0x26')]();};}function saveUpdates(_0x4e30db,_0x5c49be){return function(_0x38f8eb){if(_0x38f8eb){return _0x38f8eb['update'](_0x4e30db)[_0x3041('0x27')](function(_0x2ff83d){return _0x2ff83d;});}return null;};}function removeEntity(_0x2d23f6,_0x21c041){return function(_0x5ab9f7){if(_0x5ab9f7){return _0x5ab9f7['destroy']()[_0x3041('0x27')](function(){var _0xdbf0eb=_0x5ab9f7['get']({'plain':!![]});var _0x233e67=_0x3041('0x28');return db[_0x3041('0x29')]['destroy']({'where':{'type':_0x233e67,'resourceId':_0xdbf0eb['id']}})['then'](function(){return _0x5ab9f7;});})[_0x3041('0x27')](function(){_0x2d23f6[_0x3041('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d933a,_0x5452f6){return function(_0x2728bc){if(!_0x2728bc){_0x1d933a[_0x3041('0x1d')](0x194);}return _0x2728bc;};}function handleError(_0x4ab550,_0x42110e){_0x42110e=_0x42110e||0x1f4;return function(_0x414a64){logger[_0x3041('0x2a')](_0x414a64[_0x3041('0x2b')]);if(_0x414a64[_0x3041('0x2c')]){delete _0x414a64[_0x3041('0x2c')];}_0x4ab550[_0x3041('0x1e')](_0x42110e)[_0x3041('0x2d')](_0x414a64);};}exports[_0x3041('0x2e')]=function(_0x482dfa,_0x1c66e0){var _0x322f5a={},_0x512549={},_0x935375={'count':0x0,'rows':[]};var _0x284314=db[_0x3041('0x2f')][_0x3041('0x30')];_0x512549[_0x3041('0x31')]=_[_0x3041('0x32')](_0x284314);_0x512549[_0x3041('0x33')]=_[_0x3041('0x32')](_0x482dfa[_0x3041('0x33')]);_0x512549[_0x3041('0x34')]=_[_0x3041('0x35')](_0x512549[_0x3041('0x31')],_0x512549[_0x3041('0x33')]);_0x322f5a['attributes']=_[_0x3041('0x35')](_0x512549['model'],qs['fields'](_0x482dfa[_0x3041('0x33')]['fields']));_0x322f5a['attributes']=_0x322f5a[_0x3041('0x36')][_0x3041('0x37')]?_0x322f5a[_0x3041('0x36')]:_0x512549[_0x3041('0x31')];if(!_0x482dfa[_0x3041('0x33')][_0x3041('0x38')](_0x3041('0x39'))){_0x322f5a[_0x3041('0x3a')]=qs[_0x3041('0x3a')](_0x482dfa[_0x3041('0x33')][_0x3041('0x3a')]);_0x322f5a[_0x3041('0x20')]=qs[_0x3041('0x20')](_0x482dfa[_0x3041('0x33')][_0x3041('0x20')]);}_0x322f5a[_0x3041('0x3b')]=qs[_0x3041('0x3c')](_0x482dfa[_0x3041('0x33')][_0x3041('0x3c')]);_0x322f5a[_0x3041('0x3d')]=qs[_0x3041('0x34')](_[_0x3041('0x3e')](_0x482dfa[_0x3041('0x33')],_0x512549[_0x3041('0x34')]));if(_0x482dfa['query'][_0x3041('0x3f')]){_0x322f5a['where']=_[_0x3041('0x40')](_0x322f5a[_0x3041('0x3d')],{'$or':_[_0x3041('0x41')](_0x284314,function(_0x5efb56){if(_0x5efb56[_0x3041('0x42')]['key']!==_0x3041('0x43')){var _0x5da306={};_0x5da306[_0x5efb56[_0x3041('0x44')]]={'$like':'%'+_0x482dfa['query']['filter']+'%'};return _0x5da306;}})});}_0x322f5a=_[_0x3041('0x40')]({},_0x322f5a,_0x482dfa[_0x3041('0x45')]);var _0x7c8254={'where':_0x322f5a[_0x3041('0x3d')]};return db[_0x3041('0x2f')]['count'](_0x7c8254)[_0x3041('0x27')](function(_0x402d4e){_0x935375[_0x3041('0x1f')]=_0x402d4e;if(_0x482dfa[_0x3041('0x33')][_0x3041('0x46')]){_0x322f5a[_0x3041('0x47')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0x3041('0x48')](_0x322f5a);})[_0x3041('0x27')](function(_0x34290b){_0x935375[_0x3041('0x49')]=_0x34290b;return _0x935375;})[_0x3041('0x27')](respondWithFilteredResult(_0x1c66e0,_0x322f5a))[_0x3041('0x4a')](handleError(_0x1c66e0,null));};exports[_0x3041('0x4b')]=function(_0x2f3b04,_0x3e5d40){var _0x1bf66f={'raw':!![],'where':{'id':_0x2f3b04['params']['id']}},_0xca0559={};_0xca0559[_0x3041('0x31')]=_[_0x3041('0x32')](db[_0x3041('0x2f')][_0x3041('0x30')]);_0xca0559[_0x3041('0x33')]=_[_0x3041('0x32')](_0x2f3b04[_0x3041('0x33')]);_0xca0559[_0x3041('0x34')]=_[_0x3041('0x35')](_0xca0559[_0x3041('0x31')],_0xca0559[_0x3041('0x33')]);_0x1bf66f[_0x3041('0x36')]=_[_0x3041('0x35')](_0xca0559[_0x3041('0x31')],qs[_0x3041('0x4c')](_0x2f3b04[_0x3041('0x33')]['fields']));_0x1bf66f[_0x3041('0x36')]=_0x1bf66f[_0x3041('0x36')][_0x3041('0x37')]?_0x1bf66f['attributes']:_0xca0559[_0x3041('0x31')];if(_0x2f3b04[_0x3041('0x33')][_0x3041('0x46')]){_0x1bf66f[_0x3041('0x47')]=[{'all':!![]}];}_0x1bf66f=_[_0x3041('0x40')]({},_0x1bf66f,_0x2f3b04[_0x3041('0x45')]);return db[_0x3041('0x2f')][_0x3041('0x4d')](_0x1bf66f)[_0x3041('0x27')](handleEntityNotFound(_0x3e5d40,null))['then'](respondWithResult(_0x3e5d40,null))['catch'](handleError(_0x3e5d40,null));};exports[_0x3041('0x4e')]=function(_0x30f0f3,_0x22d03a){return db[_0x3041('0x2f')][_0x3041('0x4e')](_0x30f0f3[_0x3041('0x4f')],{})[_0x3041('0x27')](function(_0x1f2b28){var _0x3369e1=_0x30f0f3[_0x3041('0x50')][_0x3041('0x51')]({'plain':!![]});if(!_0x3369e1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3369e1[_0x3041('0x52')]===_0x3041('0x50')){var _0x516b50=_0x1f2b28['get']({'plain':!![]});var _0x4ccac2=_0x3041('0x28');return db['UserProfileSection'][_0x3041('0x4d')]({'where':{'name':_0x4ccac2,'userProfileId':_0x3369e1[_0x3041('0x53')]},'raw':!![]})[_0x3041('0x27')](function(_0x5ed162){if(_0x5ed162&&_0x5ed162[_0x3041('0x54')]===0x0){return db[_0x3041('0x29')]['create']({'name':_0x516b50[_0x3041('0x2c')],'resourceId':_0x516b50['id'],'type':_0x5ed162[_0x3041('0x2c')],'sectionId':_0x5ed162['id']},{})[_0x3041('0x27')](function(){return _0x1f2b28;});}else{return _0x1f2b28;}})[_0x3041('0x4a')](function(_0x423a41){logger['error'](_0x3041('0x55'),_0x423a41);throw _0x423a41;});}return _0x1f2b28;})[_0x3041('0x27')](respondWithResult(_0x22d03a,0xc9))['catch'](handleError(_0x22d03a,null));};exports[_0x3041('0x56')]=function(_0x5c98ca,_0x154587){if(_0x5c98ca[_0x3041('0x4f')]['id']){delete _0x5c98ca[_0x3041('0x4f')]['id'];}return db[_0x3041('0x2f')][_0x3041('0x4d')]({'where':{'id':_0x5c98ca[_0x3041('0x57')]['id']}})['then'](handleEntityNotFound(_0x154587,null))[_0x3041('0x27')](saveUpdates(_0x5c98ca[_0x3041('0x4f')],null))['then'](respondWithResult(_0x154587,null))[_0x3041('0x4a')](handleError(_0x154587,null));};exports['destroy']=function(_0x3083a1,_0x5115da){return db['OpenchannelQueue'][_0x3041('0x4d')]({'where':{'id':_0x3083a1['params']['id']}})[_0x3041('0x27')](handleEntityNotFound(_0x5115da,null))[_0x3041('0x27')](removeEntity(_0x5115da,null))[_0x3041('0x4a')](handleError(_0x5115da,null));};exports[_0x3041('0x58')]=function(_0x317119,_0x3abab5){return db[_0x3041('0x2f')][_0x3041('0x58')]()[_0x3041('0x27')](respondWithResult(_0x3abab5,null))[_0x3041('0x4a')](handleError(_0x3abab5,null));};exports[_0x3041('0x59')]=function(_0x62d6df,_0x2485c4,_0x15e3d1){var _0x27ad18={'raw':!![],'where':{}},_0x3c7db6={},_0x17fb64;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x62d6df[_0x3041('0x57')]['id']}})[_0x3041('0x27')](handleEntityNotFound(_0x2485c4,null))[_0x3041('0x27')](function(_0x8143f4){if(_0x8143f4){_0x17fb64=_0x8143f4[_0x3041('0x51')]({'plain':!![]});_0x3c7db6['model']=_['keys'](db[_0x3041('0x5a')][_0x3041('0x30')]);_0x3c7db6['query']=_['keys'](_0x62d6df[_0x3041('0x33')]);_0x3c7db6['filters']=_[_0x3041('0x35')](_0x3c7db6[_0x3041('0x31')],_0x3c7db6[_0x3041('0x33')]);_0x27ad18[_0x3041('0x36')]=_[_0x3041('0x35')](_0x3c7db6['model'],qs['fields'](_0x62d6df[_0x3041('0x33')][_0x3041('0x4c')]));_0x27ad18[_0x3041('0x36')]=_0x27ad18[_0x3041('0x36')][_0x3041('0x37')]?_0x27ad18[_0x3041('0x36')]:_0x3c7db6[_0x3041('0x31')];if(!_0x62d6df['query'][_0x3041('0x38')](_0x3041('0x39'))){_0x27ad18[_0x3041('0x3a')]=qs[_0x3041('0x3a')](_0x62d6df[_0x3041('0x33')][_0x3041('0x3a')]);_0x27ad18[_0x3041('0x20')]=qs[_0x3041('0x20')](_0x62d6df[_0x3041('0x33')][_0x3041('0x20')]);}_0x27ad18['order']=qs[_0x3041('0x3c')](_0x62d6df[_0x3041('0x33')][_0x3041('0x3c')]);_0x27ad18[_0x3041('0x3d')]=qs['filters'](_[_0x3041('0x3e')](_0x62d6df[_0x3041('0x33')],_0x3c7db6[_0x3041('0x34')]));_0x27ad18[_0x3041('0x3d')][_0x3041('0x5b')]=_0x8143f4['id'];if(_0x62d6df['query'][_0x3041('0x3f')]){_0x27ad18[_0x3041('0x3d')]=_[_0x3041('0x40')](_0x27ad18['where'],{'$or':_[_0x3041('0x41')](_0x27ad18[_0x3041('0x36')],function(_0x511001){var _0x17644e={};_0x17644e[_0x511001]={'$like':'%'+_0x62d6df[_0x3041('0x33')]['filter']+'%'};return _0x17644e;})});}_0x27ad18=_[_0x3041('0x40')]({},_0x27ad18,_0x62d6df[_0x3041('0x45')]);return db[_0x3041('0x5a')][_0x3041('0x48')](_0x27ad18);}})[_0x3041('0x27')](function(_0x5c6976){if(_0x5c6976){return db[_0x3041('0x5c')][_0x3041('0x5d')]({'where':{'id':_[_0x3041('0x41')](_0x5c6976,'UserId'),'role':_0x3041('0x5e')},'attributes':['id',_0x3041('0x2c'),_0x3041('0x5f'),_0x3041('0x60'),_0x3041('0x61')]});}})[_0x3041('0x27')](function(_0x3b92d0){if(_0x3b92d0){return{'count':_0x3b92d0[_0x3041('0x1f')],'rows':_[_0x3041('0x41')](_0x3b92d0[_0x3041('0x49')],function(_0x53453a){return{'membername':_0x53453a[_0x3041('0x2c')],'UserId':_0x53453a['id'],'queue_name':_0x17fb64['name'],'OpenchannelQueueId':_0x17fb64['id'],'interface':util[_0x3041('0x62')](_0x3041('0x63'),_0x3041('0x64'),_0x53453a[_0x3041('0x2c')]),'penalty':0x0,'paused':_0x53453a[_0x3041('0x5f')],'createdAt':_0x53453a['createdAt'],'updatedAt':_0x53453a[_0x3041('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3041('0x27')](respondWithFilteredResult(_0x2485c4,_0x27ad18))[_0x3041('0x4a')](handleError(_0x2485c4,null));};exports[_0x3041('0x65')]=function(_0x3e9b61,_0x4a5ba3,_0x6a813f){var _0x3a209a={};var _0x46dda5={};var _0x58c77f;var _0x2a0c1c;return db['OpenchannelQueue'][_0x3041('0x66')]({'where':{'id':_0x3e9b61['params']['id']}})[_0x3041('0x27')](handleEntityNotFound(_0x4a5ba3,null))['then'](function(_0x3902dd){if(_0x3902dd){_0x58c77f=_0x3902dd;_0x46dda5[_0x3041('0x31')]=_[_0x3041('0x32')](db['Team'][_0x3041('0x30')]);_0x46dda5['query']=_[_0x3041('0x32')](_0x3e9b61[_0x3041('0x33')]);_0x46dda5[_0x3041('0x34')]=_[_0x3041('0x35')](_0x46dda5[_0x3041('0x31')],_0x46dda5[_0x3041('0x33')]);_0x3a209a['attributes']=_[_0x3041('0x35')](_0x46dda5['model'],qs['fields'](_0x3e9b61[_0x3041('0x33')]['fields']));_0x3a209a[_0x3041('0x36')]=_0x3a209a[_0x3041('0x36')][_0x3041('0x37')]?_0x3a209a[_0x3041('0x36')]:_0x46dda5['model'];_0x3a209a[_0x3041('0x3b')]=qs[_0x3041('0x3c')](_0x3e9b61[_0x3041('0x33')]['sort']);_0x3a209a['where']=qs[_0x3041('0x34')](_[_0x3041('0x3e')](_0x3e9b61[_0x3041('0x33')],_0x46dda5[_0x3041('0x34')]));if(_0x3e9b61['query'][_0x3041('0x3f')]){_0x3a209a[_0x3041('0x3d')]=_[_0x3041('0x40')](_0x3a209a[_0x3041('0x3d')],{'$or':_['map'](_0x3a209a['attributes'],function(_0x1dc571){var _0x48f49a={};_0x48f49a[_0x1dc571]={'$like':'%'+_0x3e9b61[_0x3041('0x33')][_0x3041('0x3f')]+'%'};return _0x48f49a;})});}_0x3a209a=_[_0x3041('0x40')]({},_0x3a209a,_0x3e9b61[_0x3041('0x45')]);return _0x58c77f[_0x3041('0x65')](_0x3a209a);}})[_0x3041('0x27')](function(_0x1013a3){if(_0x1013a3){_0x2a0c1c=_0x1013a3[_0x3041('0x37')];if(!_0x3e9b61[_0x3041('0x33')][_0x3041('0x38')](_0x3041('0x39'))){_0x3a209a['limit']=qs['limit'](_0x3e9b61[_0x3041('0x33')][_0x3041('0x3a')]);_0x3a209a[_0x3041('0x20')]=qs[_0x3041('0x20')](_0x3e9b61[_0x3041('0x33')][_0x3041('0x20')]);}return _0x58c77f[_0x3041('0x65')](_0x3a209a);}})[_0x3041('0x27')](function(_0x254a78){if(_0x254a78){return _0x254a78?{'count':_0x2a0c1c,'rows':_0x254a78}:null;}})['then'](respondWithResult(_0x4a5ba3,null))[_0x3041('0x4a')](handleError(_0x4a5ba3,null));};exports[_0x3041('0x67')]=function(_0xc281be,_0x2225d6,_0x486005){var _0x3b2075=_0xc281be[_0x3041('0x4f')][_0x3041('0x68')];return db[_0x3041('0x69')][_0x3041('0x48')]({'where':{'id':_[_0x3041('0x41')](_0x3b2075,'id')},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x3041('0x2c'),_0x3041('0x6a'),_0x3041('0x6b'),_0x3041('0x6c')],'raw':!![]}]})['then'](function(_0x1ca963){if(_0x1ca963){var _0x64a39e=_['flatMap'](_0x1ca963,function(_0x257b37){var _0x73a727=_0x257b37[_0x3041('0x51')]({'plain':!![]});return _0x73a727[_0x3041('0x6d')];});return db[_0x3041('0x2f')]['find']({'where':{'id':_0xc281be[_0x3041('0x57')]['id']}})[_0x3041('0x27')](function(_0x1eece0){return db[_0x3041('0x6e')][_0x3041('0x6f')](function(_0x1f4df0){return _0x1eece0['addTeams'](_['map'](_0x3b2075,'id'),{'transaction':_0x1f4df0})[_0x3041('0x27')](function(){return BPromise[_0x3041('0x70')](_0x64a39e,function(_0x4b8f1b){return db[_0x3041('0x5a')][_0x3041('0x71')]({'where':{'UserId':_0x4b8f1b['id'],'OpenchannelQueueId':_0xc281be[_0x3041('0x57')]['id']},'transaction':_0x1f4df0});});})['then'](function(){_0x64a39e['forEach'](function(_0x1b71a9){socket['emit'](_0x3041('0x72'),{'UserId':_0x1b71a9['id'],'OpenchannelQueueId':_0x1eece0['id']});});});});});}})[_0x3041('0x27')](respondWithStatusCode(_0x2225d6,null))[_0x3041('0x4a')](handleError(_0x2225d6,null));};exports[_0x3041('0x73')]=function(_0x4cbe83,_0x1aa546,_0x3cadb4){return db[_0x3041('0x69')][_0x3041('0x48')]({'where':{'id':_0x4cbe83[_0x3041('0x33')][_0x3041('0x74')]},'attributes':['id'],'include':[{'model':db[_0x3041('0x5c')],'as':_0x3041('0x6d'),'attributes':['id'],'raw':!![]}]})[_0x3041('0x27')](handleEntityNotFound(_0x1aa546,null))[_0x3041('0x27')](function(_0x1254a6){var _0x6266ff=_[_0x3041('0x41')](_0x1254a6,'id');var _0x346ba2=[];var _0x178248=[];var _0x3e03da=squel[_0x3041('0x75')]();_0x3e03da[_0x3041('0x44')]('tq.TeamId')[_0x3041('0x76')](_0x3041('0x77'),'tq')[_0x3041('0x78')](_0x3041('0x79'),'ut',_0x3041('0x7a'))[_0x3041('0x3d')](_0x3041('0x7b'),_0x4cbe83[_0x3041('0x57')]['id']);for(var _0x2c4999=0x0;_0x2c4999<_0x1254a6['length'];_0x2c4999+=0x1){let _0x396075=_0x1254a6[_0x2c4999];for(var _0x291cf5=0x0;_0x291cf5<_0x396075['Agents'][_0x3041('0x37')];_0x291cf5+=0x1){let _0x426628=_0x396075[_0x3041('0x6d')][_0x291cf5];var _0x2395ed=_0x3e03da['clone']();_0x2395ed[_0x3041('0x3d')](_0x3041('0x7c'),_0x426628['id']);_0x178248[_0x3041('0x7d')](db[_0x3041('0x6e')][_0x3041('0x33')](_0x2395ed[_0x3041('0x7e')](),{'type':db[_0x3041('0x6e')]['QueryTypes']['SELECT']})['then'](function(_0x69d988){if(_0x69d988[_0x3041('0x37')]===0x1){return _0x426628['id'];}else{var _0x5b5d02=_[_0x3041('0x7f')](_['map'](_0x69d988,_0x3041('0x80')),function(_0x114b6d){return _[_0x3041('0x81')](_0x6266ff,_0x114b6d);});if(_0x5b5d02){return _0x426628['id'];}}}));}}return BPromise[_0x3041('0x82')](_0x178248)[_0x3041('0x27')](function(_0x47820e){_0x346ba2=_(_0x346ba2)[_0x3041('0x83')](_0x47820e)[_0x3041('0x84')]()['value']();return db['OpenchannelQueue'][_0x3041('0x4d')]({'where':{'id':_0x4cbe83[_0x3041('0x57')]['id']}})[_0x3041('0x27')](function(_0x1cca61){return db[_0x3041('0x6e')][_0x3041('0x6f')](function(_0x33f87f){return _0x1cca61['removeTeams'](_0x4cbe83[_0x3041('0x33')][_0x3041('0x74')],{'transaction':_0x33f87f})['then'](function(){if(!_['isEmpty'](_0x346ba2)){return _0x1cca61[_0x3041('0x85')](_0x346ba2,{'transaction':_0x33f87f});}})[_0x3041('0x27')](function(){_0x346ba2[_0x3041('0x86')](function(_0x1f1914){socket[_0x3041('0x87')]('userOpenchannelQueue:remove',{'UserId':_0x1f1914,'OpenchannelQueueId':_0x1cca61['id']});});});});});});})['then'](respondWithStatusCode(_0x1aa546,null))[_0x3041('0x4a')](handleError(_0x1aa546,null));};exports[_0x3041('0x88')]=function(_0x52b057,_0x5bce3b,_0x5bbca5){return db['OpenchannelQueue'][_0x3041('0x4d')]({'where':{'id':_0x52b057[_0x3041('0x57')]['id']}})[_0x3041('0x27')](handleEntityNotFound(_0x5bce3b,null))[_0x3041('0x27')](function(_0x374eca){if(_0x374eca){return _0x374eca[_0x3041('0x88')](_0x52b057[_0x3041('0x4f')]['ids'],_[_0x3041('0x89')](_0x52b057['body'],['ids','id'])||{})['spread'](function(_0x3c06af){for(var _0x234eda=0x0;_0x234eda<_0x52b057['body'][_0x3041('0x74')][_0x3041('0x37')];_0x234eda+=0x1){socket['emit'](_0x3041('0x72'),{'UserId':_0x52b057['body'][_0x3041('0x74')][_0x234eda],'OpenchannelQueueId':_0x52b057[_0x3041('0x57')]['id']});}return _0x3c06af;});}})[_0x3041('0x27')](respondWithResult(_0x5bce3b,null))[_0x3041('0x4a')](handleError(_0x5bce3b,null));};exports[_0x3041('0x85')]=function(_0x66bb67,_0xd5cb7e,_0x198d80){return db[_0x3041('0x2f')][_0x3041('0x4d')]({'where':{'id':_0x66bb67[_0x3041('0x57')]['id']}})['then'](handleEntityNotFound(_0xd5cb7e,null))[_0x3041('0x27')](function(_0x30d3fa){if(_0x30d3fa){return _0x30d3fa['removeAgents'](_0x66bb67[_0x3041('0x33')][_0x3041('0x74')])[_0x3041('0x27')](function(){if(_['isArray'](_0x66bb67[_0x3041('0x33')][_0x3041('0x74')])){for(var _0x18b3df=0x0;_0x18b3df<_0x66bb67[_0x3041('0x33')][_0x3041('0x74')][_0x3041('0x37')];_0x18b3df+=0x1){socket['emit'](_0x3041('0x8a'),{'UserId':Number(_0x66bb67[_0x3041('0x33')][_0x3041('0x74')][_0x18b3df]),'OpenchannelQueueId':Number(_0x66bb67['params']['id'])});}}else{socket['emit'](_0x3041('0x8a'),{'UserId':Number(_0x66bb67['query'][_0x3041('0x74')]),'OpenchannelQueueId':Number(_0x66bb67['params']['id'])});}});}})[_0x3041('0x27')](respondWithStatusCode(_0xd5cb7e,null))['catch'](handleError(_0xd5cb7e,null));};exports[_0x3041('0x8b')]=function(_0x252794,_0x4d79d1,_0x208c18){var _0x163cbd={};var _0x514d54={};var _0x294483;var _0x18e510;return db[_0x3041('0x2f')]['findOne']({'where':{'id':_0x252794['params']['id']}})['then'](handleEntityNotFound(_0x4d79d1,null))[_0x3041('0x27')](function(_0x3e7654){if(_0x3e7654){_0x294483=_0x3e7654;_0x514d54[_0x3041('0x31')]=_[_0x3041('0x32')](db[_0x3041('0x5c')][_0x3041('0x30')]);_0x514d54['query']=_[_0x3041('0x32')](_0x252794[_0x3041('0x33')]);_0x514d54['filters']=_[_0x3041('0x35')](_0x514d54[_0x3041('0x31')],_0x514d54[_0x3041('0x33')]);_0x163cbd[_0x3041('0x36')]=_[_0x3041('0x35')](_0x514d54[_0x3041('0x31')],qs[_0x3041('0x4c')](_0x252794[_0x3041('0x33')][_0x3041('0x4c')]));_0x163cbd[_0x3041('0x36')]=_0x163cbd['attributes'][_0x3041('0x37')]?_0x163cbd[_0x3041('0x36')]:_0x514d54['model'];_0x163cbd['order']=qs['sort'](_0x252794[_0x3041('0x33')]['sort']);_0x163cbd[_0x3041('0x3d')]=qs[_0x3041('0x34')](_[_0x3041('0x3e')](_0x252794['query'],_0x514d54[_0x3041('0x34')]));if(_0x252794[_0x3041('0x33')][_0x3041('0x3f')]){_0x163cbd[_0x3041('0x3d')]=_[_0x3041('0x40')](_0x163cbd['where'],{'$or':_[_0x3041('0x41')](_0x163cbd['attributes'],function(_0x462d2a){var _0x456a56={};_0x456a56[_0x462d2a]={'$like':'%'+_0x252794[_0x3041('0x33')]['filter']+'%'};return _0x456a56;})});}_0x163cbd=_[_0x3041('0x40')]({},_0x163cbd,_0x252794[_0x3041('0x45')]);return _0x294483[_0x3041('0x8b')](_0x163cbd);}})[_0x3041('0x27')](function(_0x13ef7b){if(_0x13ef7b){_0x18e510=_0x13ef7b[_0x3041('0x37')];if(!_0x252794['query'][_0x3041('0x38')](_0x3041('0x39'))){_0x163cbd['limit']=qs['limit'](_0x252794[_0x3041('0x33')]['limit']);_0x163cbd[_0x3041('0x20')]=qs[_0x3041('0x20')](_0x252794[_0x3041('0x33')][_0x3041('0x20')]);}return _0x294483[_0x3041('0x8b')](_0x163cbd);}})[_0x3041('0x27')](function(_0x19c684){if(_0x19c684){return _0x19c684?{'count':_0x18e510,'rows':_0x19c684}:null;}})[_0x3041('0x27')](respondWithResult(_0x4d79d1,null))[_0x3041('0x4a')](handleError(_0x4d79d1,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 73893b1..b1382f8 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 _0x23a9=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x3227c1,_0x4318c5){var _0x31fd48=function(_0x5c5850){while(--_0x5c5850){_0x3227c1['push'](_0x3227c1['shift']());}};_0x31fd48(++_0x4318c5);}(_0x23a9,0xd5));var _0x923a=function(_0x3a3532,_0x3d7da8){_0x3a3532=_0x3a3532-0x0;var _0x56515d=_0x23a9[_0x3a3532];return _0x56515d;};'use strict';var EventEmitter=require(_0x923a('0x0'));var OpenchannelQueue=require(_0x923a('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x923a('0x2')](0x0);var events={'afterCreate':_0x923a('0x3'),'afterUpdate':'update','afterDestroy':_0x923a('0x4')};function emitEvent(_0x451622){return function(_0x19eb25,_0x2c0744,_0x21d087){OpenchannelQueueEvents[_0x923a('0x5')](_0x451622+':'+_0x19eb25['id'],_0x19eb25);OpenchannelQueueEvents[_0x923a('0x5')](_0x451622,_0x19eb25);_0x21d087(null);};}for(var e in events){if(events[_0x923a('0x6')](e)){var event=events[e];OpenchannelQueue[_0x923a('0x7')](e,emitEvent(event));}}module[_0x923a('0x8')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xe537=['save','emit','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x50c275,_0x1d84cf){var _0x2be55d=function(_0x314f04){while(--_0x314f04){_0x50c275['push'](_0x50c275['shift']());}};_0x2be55d(++_0x1d84cf);}(_0xe537,0x19a));var _0x7e53=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xe537[_0x501510];return _0x1e6ee5;};'use strict';var EventEmitter=require(_0x7e53('0x0'));var OpenchannelQueue=require(_0x7e53('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x7e53('0x2')](0x0);var events={'afterCreate':_0x7e53('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x12fe62){return function(_0x2da453,_0x4a6b9c,_0x1d5eb4){OpenchannelQueueEvents[_0x7e53('0x4')](_0x12fe62+':'+_0x2da453['id'],_0x2da453);OpenchannelQueueEvents['emit'](_0x12fe62,_0x2da453);_0x1d5eb4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0x7e53('0x5')](e,emitEvent(event));}}module[_0x7e53('0x6')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 3f91f1a..350f991 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 _0x3ff2=['openchannel_queues','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue'];(function(_0xf3d07c,_0x716648){var _0x3da972=function(_0x2534e5){while(--_0x2534e5){_0xf3d07c['push'](_0xf3d07c['shift']());}};_0x3da972(++_0x716648);}(_0x3ff2,0x85));var _0x23ff=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x3ff2[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require(_0x23ff('0x0'));var logger=require(_0x23ff('0x1'))(_0x23ff('0x2'));var moment=require('moment');var BPromise=require(_0x23ff('0x3'));var rp=require(_0x23ff('0x4'));var fs=require('fs');var path=require(_0x23ff('0x5'));var rimraf=require('rimraf');var config=require(_0x23ff('0x6'));var attributes=require(_0x23ff('0x7'));module[_0x23ff('0x8')]=function(_0x1be95a,_0x5a36d8){return _0x1be95a[_0x23ff('0x9')](_0x23ff('0xa'),attributes,{'tableName':_0x23ff('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x05f7=['../../config/environment','define','openchannel_queues','api','moment','bluebird','path','rimraf'];(function(_0x1d994f,_0x1b45db){var _0x167c46=function(_0x8bb705){while(--_0x8bb705){_0x1d994f['push'](_0x1d994f['shift']());}};_0x167c46(++_0x1b45db);}(_0x05f7,0x14b));var _0x705f=function(_0x460fd7,_0x2012db){_0x460fd7=_0x460fd7-0x0;var _0x44d1c2=_0x05f7[_0x460fd7];return _0x44d1c2;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x705f('0x0'));var moment=require(_0x705f('0x1'));var BPromise=require(_0x705f('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x705f('0x3'));var rimraf=require(_0x705f('0x4'));var config=require(_0x705f('0x5'));var attributes=require('./openchannelQueue.attributes');module['exports']=function(_0x3374b5,_0x3f3c10){return _0x3374b5[_0x705f('0x6')]('OpenchannelQueue',attributes,{'tableName':_0x705f('0x7'),'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 8a7d00f..3e14f79 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 _0x7f42=['raw','where','attributes','limit','include','map','model','find','ShowOpenchannelQueue','lodash','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','OpenchannelQueue,\x20%s,\x20%s','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options'];(function(_0x50d3fb,_0x234167){var _0x179788=function(_0x593845){while(--_0x593845){_0x50d3fb['push'](_0x50d3fb['shift']());}};_0x179788(++_0x234167);}(_0x7f42,0x1dd));var _0x27f4=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x7f42[_0x46698a];return _0x356db0;};'use strict';var _=require(_0x27f4('0x0'));var util=require('util');var moment=require(_0x27f4('0x1'));var BPromise=require(_0x27f4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x27f4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x27f4('0x4'));var logger=require('../../config/logger')(_0x27f4('0x5'));var config=require('../../config/environment');var jayson=require(_0x27f4('0x6'));var client=jayson['client'][_0x27f4('0x7')]({'port':0x232a});config[_0x27f4('0x8')]=_[_0x27f4('0x9')](config[_0x27f4('0x8')],{'host':_0x27f4('0xa'),'port':0x18eb});var socket=require(_0x27f4('0xb'))(new Redis(config[_0x27f4('0x8')]));require(_0x27f4('0xc'))[_0x27f4('0xd')](socket);function respondWithRpcPromise(_0x453565,_0x3bbb54,_0x21eab6){return new BPromise(function(_0x2fc74a,_0x247c47){return client[_0x27f4('0xe')](_0x453565,_0x21eab6)[_0x27f4('0xf')](function(_0x1ddc75){logger[_0x27f4('0x10')]('OpenchannelQueue,\x20%s,\x20%s',_0x3bbb54,'request\x20sent');logger[_0x27f4('0x11')](_0x27f4('0x12'),_0x3bbb54,_0x27f4('0x13'),JSON[_0x27f4('0x14')](_0x1ddc75));if(_0x1ddc75[_0x27f4('0x15')]){if(_0x1ddc75[_0x27f4('0x15')][_0x27f4('0x16')]===0x1f4){logger[_0x27f4('0x15')]('OpenchannelQueue,\x20%s,\x20%s',_0x3bbb54,_0x1ddc75['error'][_0x27f4('0x17')]);return _0x247c47(_0x1ddc75[_0x27f4('0x15')][_0x27f4('0x17')]);}logger[_0x27f4('0x15')]('OpenchannelQueue,\x20%s,\x20%s',_0x3bbb54,_0x1ddc75[_0x27f4('0x15')][_0x27f4('0x17')]);return _0x2fc74a(_0x1ddc75[_0x27f4('0x15')]['message']);}else{logger[_0x27f4('0x10')](_0x27f4('0x18'),_0x3bbb54,_0x27f4('0x13'));_0x2fc74a(_0x1ddc75['result'][_0x27f4('0x17')]);}})[_0x27f4('0x19')](function(_0x5091e0){logger['error'](_0x27f4('0x18'),_0x3bbb54,_0x5091e0);_0x247c47(_0x5091e0);});});}exports[_0x27f4('0x1a')]=function(_0x168993){var _0x2d5ad2=this;return new Promise(function(_0xd335ee,_0x575af4){return db[_0x27f4('0x1b')][_0x27f4('0x1c')]({'raw':_0x168993[_0x27f4('0x1d')]?_0x168993[_0x27f4('0x1d')][_0x27f4('0x1e')]===undefined?!![]:![]:!![],'where':_0x168993[_0x27f4('0x1d')]?_0x168993[_0x27f4('0x1d')][_0x27f4('0x1f')]||null:null,'attributes':_0x168993[_0x27f4('0x1d')]?_0x168993['options'][_0x27f4('0x20')]||null:null,'limit':_0x168993[_0x27f4('0x1d')]?_0x168993[_0x27f4('0x1d')][_0x27f4('0x21')]||null:null,'include':_0x168993[_0x27f4('0x1d')]?_0x168993[_0x27f4('0x1d')][_0x27f4('0x22')]?_[_0x27f4('0x23')](_0x168993[_0x27f4('0x1d')][_0x27f4('0x22')],function(_0x2fe71b){return{'model':db[_0x2fe71b[_0x27f4('0x24')]],'as':_0x2fe71b['as'],'attributes':_0x2fe71b[_0x27f4('0x20')],'include':_0x2fe71b[_0x27f4('0x22')]?_[_0x27f4('0x23')](_0x2fe71b[_0x27f4('0x22')],function(_0x2add99){return{'model':db[_0x2add99['model']],'as':_0x2add99['as'],'attributes':_0x2add99[_0x27f4('0x20')],'include':_0x2add99['include']?_[_0x27f4('0x23')](_0x2add99[_0x27f4('0x22')],function(_0x9c39b9){return{'model':db[_0x9c39b9['model']],'as':_0x9c39b9['as'],'attributes':_0x9c39b9[_0x27f4('0x20')]};}):[]};}):[]};}):[]:[]})[_0x27f4('0xf')](function(_0x4874f2){logger[_0x27f4('0x10')](_0x27f4('0x1a'),_0x168993);logger['debug'](_0x27f4('0x1a'),_0x168993,JSON[_0x27f4('0x14')](_0x4874f2));_0xd335ee(_0x4874f2);})['catch'](function(_0x37f6a3){logger[_0x27f4('0x15')]('GetOpenchannelQueue',_0x37f6a3[_0x27f4('0x17')],_0x168993);_0x575af4(_0x2d5ad2[_0x27f4('0x15')](0x1f4,_0x37f6a3[_0x27f4('0x17')]));});});};exports['ShowOpenchannelQueue']=function(_0x5d3bc6){var _0x50e6be=this;return new Promise(function(_0x522bc8,_0x1e9a84){return db[_0x27f4('0x1b')][_0x27f4('0x25')]({'raw':_0x5d3bc6[_0x27f4('0x1d')]?_0x5d3bc6[_0x27f4('0x1d')][_0x27f4('0x1e')]===undefined?!![]:![]:!![],'where':_0x5d3bc6[_0x27f4('0x1d')]?_0x5d3bc6[_0x27f4('0x1d')][_0x27f4('0x1f')]||null:null,'attributes':_0x5d3bc6[_0x27f4('0x1d')]?_0x5d3bc6[_0x27f4('0x1d')]['attributes']||null:null,'include':_0x5d3bc6[_0x27f4('0x1d')]?_0x5d3bc6[_0x27f4('0x1d')][_0x27f4('0x22')]?_['map'](_0x5d3bc6[_0x27f4('0x1d')][_0x27f4('0x22')],function(_0x192d7a){return{'model':db[_0x192d7a[_0x27f4('0x24')]],'as':_0x192d7a['as'],'attributes':_0x192d7a[_0x27f4('0x20')],'include':_0x192d7a[_0x27f4('0x22')]?_[_0x27f4('0x23')](_0x192d7a[_0x27f4('0x22')],function(_0x3ca479){return{'model':db[_0x3ca479[_0x27f4('0x24')]],'as':_0x3ca479['as'],'attributes':_0x3ca479[_0x27f4('0x20')],'include':_0x3ca479[_0x27f4('0x22')]?_[_0x27f4('0x23')](_0x3ca479[_0x27f4('0x22')],function(_0x2426d5){return{'model':db[_0x2426d5[_0x27f4('0x24')]],'as':_0x2426d5['as'],'attributes':_0x2426d5['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x16dacf){logger[_0x27f4('0x10')](_0x27f4('0x26'),_0x5d3bc6);logger['debug'](_0x27f4('0x26'),_0x5d3bc6,JSON[_0x27f4('0x14')](_0x16dacf));_0x522bc8(_0x16dacf);})[_0x27f4('0x19')](function(_0x4e4946){logger[_0x27f4('0x15')](_0x27f4('0x26'),_0x4e4946['message'],_0x5d3bc6);_0x1e9a84(_0x50e6be[_0x27f4('0x15')](0x1f4,_0x4e4946[_0x27f4('0x17')]));});});}; \ No newline at end of file +var _0xdb4b=['../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelQueue.socket','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetOpenchannelQueue','OpenchannelQueue','options','raw','where','limit','map','include','attributes','model','then','debug','ShowOpenchannelQueue','find','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x3bac3d,_0x338f17){var _0x90fbe9=function(_0x498e04){while(--_0x498e04){_0x3bac3d['push'](_0x3bac3d['shift']());}};_0x90fbe9(++_0x338f17);}(_0xdb4b,0xd7));var _0xbdb4=function(_0x4bd385,_0x3a3e0a){_0x4bd385=_0x4bd385-0x0;var _0x3bbd36=_0xdb4b[_0x4bd385];return _0x3bbd36;};'use strict';var _=require('lodash');var util=require(_0xbdb4('0x0'));var moment=require('moment');var BPromise=require(_0xbdb4('0x1'));var rs=require(_0xbdb4('0x2'));var fs=require('fs');var Redis=require(_0xbdb4('0x3'));var db=require(_0xbdb4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbdb4('0x5'))(_0xbdb4('0x6'));var config=require(_0xbdb4('0x7'));var jayson=require(_0xbdb4('0x8'));var client=jayson[_0xbdb4('0x9')][_0xbdb4('0xa')]({'port':0x232a});config[_0xbdb4('0xb')]=_['defaults'](config['redis'],{'host':_0xbdb4('0xc'),'port':0x18eb});var socket=require(_0xbdb4('0xd'))(new Redis(config[_0xbdb4('0xb')]));require(_0xbdb4('0xe'))['register'](socket);function respondWithRpcPromise(_0x6eed0,_0x5ba9f8,_0x35c6ba){return new BPromise(function(_0x2ea5ce,_0x25d7ca){return client['request'](_0x6eed0,_0x35c6ba)['then'](function(_0xb20047){logger[_0xbdb4('0xf')](_0xbdb4('0x10'),_0x5ba9f8,_0xbdb4('0x11'));logger['debug']('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x5ba9f8,_0xbdb4('0x11'),JSON[_0xbdb4('0x12')](_0xb20047));if(_0xb20047[_0xbdb4('0x13')]){if(_0xb20047[_0xbdb4('0x13')][_0xbdb4('0x14')]===0x1f4){logger[_0xbdb4('0x13')]('OpenchannelQueue,\x20%s,\x20%s',_0x5ba9f8,_0xb20047['error'][_0xbdb4('0x15')]);return _0x25d7ca(_0xb20047[_0xbdb4('0x13')]['message']);}logger[_0xbdb4('0x13')](_0xbdb4('0x10'),_0x5ba9f8,_0xb20047['error']['message']);return _0x2ea5ce(_0xb20047[_0xbdb4('0x13')][_0xbdb4('0x15')]);}else{logger['info'](_0xbdb4('0x10'),_0x5ba9f8,_0xbdb4('0x11'));_0x2ea5ce(_0xb20047['result'][_0xbdb4('0x15')]);}})[_0xbdb4('0x16')](function(_0x373078){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x5ba9f8,_0x373078);_0x25d7ca(_0x373078);});});}exports[_0xbdb4('0x17')]=function(_0x18263a){var _0x484d03=this;return new Promise(function(_0x19248f,_0x2d72d9){return db[_0xbdb4('0x18')]['findAll']({'raw':_0x18263a[_0xbdb4('0x19')]?_0x18263a['options'][_0xbdb4('0x1a')]===undefined?!![]:![]:!![],'where':_0x18263a[_0xbdb4('0x19')]?_0x18263a[_0xbdb4('0x19')][_0xbdb4('0x1b')]||null:null,'attributes':_0x18263a[_0xbdb4('0x19')]?_0x18263a[_0xbdb4('0x19')]['attributes']||null:null,'limit':_0x18263a[_0xbdb4('0x19')]?_0x18263a[_0xbdb4('0x19')][_0xbdb4('0x1c')]||null:null,'include':_0x18263a[_0xbdb4('0x19')]?_0x18263a[_0xbdb4('0x19')]['include']?_[_0xbdb4('0x1d')](_0x18263a[_0xbdb4('0x19')][_0xbdb4('0x1e')],function(_0x5b46a1){return{'model':db[_0x5b46a1['model']],'as':_0x5b46a1['as'],'attributes':_0x5b46a1[_0xbdb4('0x1f')],'include':_0x5b46a1[_0xbdb4('0x1e')]?_[_0xbdb4('0x1d')](_0x5b46a1[_0xbdb4('0x1e')],function(_0x1403e2){return{'model':db[_0x1403e2[_0xbdb4('0x20')]],'as':_0x1403e2['as'],'attributes':_0x1403e2[_0xbdb4('0x1f')],'include':_0x1403e2[_0xbdb4('0x1e')]?_[_0xbdb4('0x1d')](_0x1403e2[_0xbdb4('0x1e')],function(_0x52ebf5){return{'model':db[_0x52ebf5[_0xbdb4('0x20')]],'as':_0x52ebf5['as'],'attributes':_0x52ebf5[_0xbdb4('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xbdb4('0x21')](function(_0x1e7b00){logger[_0xbdb4('0xf')]('GetOpenchannelQueue',_0x18263a);logger[_0xbdb4('0x22')](_0xbdb4('0x17'),_0x18263a,JSON[_0xbdb4('0x12')](_0x1e7b00));_0x19248f(_0x1e7b00);})[_0xbdb4('0x16')](function(_0x1ca755){logger[_0xbdb4('0x13')](_0xbdb4('0x17'),_0x1ca755[_0xbdb4('0x15')],_0x18263a);_0x2d72d9(_0x484d03['error'](0x1f4,_0x1ca755[_0xbdb4('0x15')]));});});};exports[_0xbdb4('0x23')]=function(_0x47d37d){var _0x4fc3f0=this;return new Promise(function(_0x2e0b6f,_0x5eb6fb){return db[_0xbdb4('0x18')][_0xbdb4('0x24')]({'raw':_0x47d37d[_0xbdb4('0x19')]?_0x47d37d[_0xbdb4('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x47d37d[_0xbdb4('0x19')]?_0x47d37d[_0xbdb4('0x19')][_0xbdb4('0x1b')]||null:null,'attributes':_0x47d37d[_0xbdb4('0x19')]?_0x47d37d[_0xbdb4('0x19')][_0xbdb4('0x1f')]||null:null,'include':_0x47d37d[_0xbdb4('0x19')]?_0x47d37d[_0xbdb4('0x19')][_0xbdb4('0x1e')]?_[_0xbdb4('0x1d')](_0x47d37d[_0xbdb4('0x19')][_0xbdb4('0x1e')],function(_0x4e15e1){return{'model':db[_0x4e15e1[_0xbdb4('0x20')]],'as':_0x4e15e1['as'],'attributes':_0x4e15e1[_0xbdb4('0x1f')],'include':_0x4e15e1[_0xbdb4('0x1e')]?_[_0xbdb4('0x1d')](_0x4e15e1['include'],function(_0x35ca64){return{'model':db[_0x35ca64[_0xbdb4('0x20')]],'as':_0x35ca64['as'],'attributes':_0x35ca64[_0xbdb4('0x1f')],'include':_0x35ca64[_0xbdb4('0x1e')]?_[_0xbdb4('0x1d')](_0x35ca64[_0xbdb4('0x1e')],function(_0x9f9982){return{'model':db[_0x9f9982[_0xbdb4('0x20')]],'as':_0x9f9982['as'],'attributes':_0x9f9982[_0xbdb4('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xbdb4('0x21')](function(_0x54f06f){logger[_0xbdb4('0xf')](_0xbdb4('0x23'),_0x47d37d);logger[_0xbdb4('0x22')]('ShowOpenchannelQueue',_0x47d37d,JSON[_0xbdb4('0x12')](_0x54f06f));_0x2e0b6f(_0x54f06f);})[_0xbdb4('0x16')](function(_0x404092){logger[_0xbdb4('0x13')]('ShowOpenchannelQueue',_0x404092[_0xbdb4('0x15')],_0x47d37d);_0x5eb6fb(_0x4fc3f0['error'](0x1f4,_0x404092['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index fb44352..2ced577 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(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'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(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'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 d4d8e4d..aad9050 100644 --- a/server/api/openchannelQueueReport/index.js +++ b/server/api/openchannelQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x34d275,_0x5d84ee){var _0x1379cc=function(_0x320fbe){while(--_0x320fbe){_0x34d275['push'](_0x34d275['shift']());}};_0x1379cc(++_0x5d84ee);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router; \ No newline at end of file +var _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x118653,_0x50ef26){var _0xc11fa6=function(_0x2ec581){while(--_0x2ec581){_0x118653['push'](_0x118653['shift']());}};_0xc11fa6(++_0x50ef26);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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 3ee88dc..9a77d38 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 _0x7603=['DATE','sequelize','exports','STRING'];(function(_0x41e0a4,_0x5f837d){var _0x4ea78e=function(_0x5259e5){while(--_0x5259e5){_0x41e0a4['push'](_0x41e0a4['shift']());}};_0x4ea78e(++_0x5f837d);}(_0x7603,0x181));var _0x3760=function(_0x2b6ae4,_0x4ccb45){_0x2b6ae4=_0x2b6ae4-0x0;var _0x26bb74=_0x7603[_0x2b6ae4];return _0x26bb74;};'use strict';var moment=require('moment');var Sequelize=require(_0x3760('0x0'));module[_0x3760('0x1')]={'uniqueid':{'type':Sequelize[_0x3760('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x3760('0x3')]},'leaveAt':{'type':Sequelize[_0x3760('0x3')]},'acceptAt':{'type':Sequelize[_0x3760('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x3760('0x2')]}}; \ No newline at end of file +var _0x1156=['STRING','DATE','sequelize','exports'];(function(_0x306ddc,_0x9c4d60){var _0x11767f=function(_0x35183e){while(--_0x35183e){_0x306ddc['push'](_0x306ddc['shift']());}};_0x11767f(++_0x9c4d60);}(_0x1156,0x92));var _0x6115=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0x1156[_0xa8883];return _0x479426;};'use strict';var moment=require('moment');var Sequelize=require(_0x6115('0x0'));module[_0x6115('0x1')]={'uniqueid':{'type':Sequelize[_0x6115('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x6115('0x2')]},'joinAt':{'type':Sequelize[_0x6115('0x3')]},'leaveAt':{'type':Sequelize[_0x6115('0x3')]},'acceptAt':{'type':Sequelize[_0x6115('0x3')]},'exitAt':{'type':Sequelize[_0x6115('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 2c63ae9..883ea7c 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 _0x9521=['order','sort','where','pick','filter','map','key','VIRTUAL','options','include','findAll','rows','catch','show','params','merge','find','create','update','body','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','then','error','stack','name','send','index','OpenchannelQueueReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x4488d7,_0x18322f){var _0x399924=function(_0x108904){while(--_0x108904){_0x4488d7['push'](_0x4488d7['shift']());}};_0x399924(++_0x18322f);}(_0x9521,0xa8));var _0x1952=function(_0x238671,_0x34aea0){_0x238671=_0x238671-0x0;var _0x474844=_0x9521[_0x238671];return _0x474844;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1952('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1952('0x1'));var jsonpatch=require(_0x1952('0x2'));var rp=require(_0x1952('0x3'));var moment=require(_0x1952('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1952('0x5'));var util=require(_0x1952('0x6'));var path=require(_0x1952('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1952('0x8'));var fs=require('fs');var _=require(_0x1952('0x9'));var squel=require(_0x1952('0xa'));var crypto=require(_0x1952('0xb'));var jsforce=require(_0x1952('0xc'));var deskjs=require(_0x1952('0xd'));var toCsv=require(_0x1952('0xe'));var querystring=require('querystring');var Papa=require(_0x1952('0xf'));var Redis=require(_0x1952('0x10'));var authService=require(_0x1952('0x11'));var qs=require(_0x1952('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1952('0x13'))(_0x1952('0x14'));var utils=require(_0x1952('0x15'));var config=require('../../config/environment');var db=require(_0x1952('0x16'))['db'];function respondWithStatusCode(_0x9a64d1,_0x28167b){_0x28167b=_0x28167b||0xcc;return function(_0x2a683f){if(_0x2a683f){return _0x9a64d1[_0x1952('0x17')](_0x28167b);}return _0x9a64d1[_0x1952('0x18')](_0x28167b)['end']();};}function respondWithResult(_0x56b8f3,_0x2560ce){_0x2560ce=_0x2560ce||0xc8;return function(_0x3386ac){if(_0x3386ac){return _0x56b8f3[_0x1952('0x18')](_0x2560ce)[_0x1952('0x19')](_0x3386ac);}};}function respondWithFilteredResult(_0x25d3e5,_0x3b6639){return function(_0x4cc21b){if(_0x4cc21b){var _0x3ab130=_0x4cc21b[_0x1952('0x1a')],_0x2ea4e7=_0x3b6639[_0x1952('0x1b')],_0x111677=_0x3b6639['offset']+_0x3b6639[_0x1952('0x1c')],_0x2a3894;if(_0x111677>=_0x3ab130){_0x111677=_0x3ab130;_0x2a3894=0xc8;}else{_0x2a3894=0xce;}_0x25d3e5[_0x1952('0x18')](_0x2a3894);return _0x25d3e5[_0x1952('0x1d')](_0x1952('0x1e'),_0x2ea4e7+'-'+_0x111677+'/'+_0x3ab130)[_0x1952('0x19')](_0x4cc21b);}return null;};}function patchUpdates(_0x119045){return function(_0x46f900){try{jsonpatch[_0x1952('0x1f')](_0x46f900,_0x119045,!![]);}catch(_0x2ee86a){return BPromise[_0x1952('0x20')](_0x2ee86a);}return _0x46f900['save']();};}function saveUpdates(_0x1da62d,_0x3b8b3b){return function(_0x4b316d){if(_0x4b316d){return _0x4b316d['update'](_0x1da62d)[_0x1952('0x21')](function(_0x2c976f){return _0x2c976f;});}return null;};}function removeEntity(_0x1c43c0,_0x107558){return function(_0x2133e8){if(_0x2133e8){return _0x2133e8['destroy']()['then'](function(){_0x1c43c0[_0x1952('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57ba2a,_0x5d4405){return function(_0x5ce95a){if(!_0x5ce95a){_0x57ba2a[_0x1952('0x17')](0x194);}return _0x5ce95a;};}function handleError(_0x4bcc1c,_0xe9a0d1){_0xe9a0d1=_0xe9a0d1||0x1f4;return function(_0x4bef1e){logger[_0x1952('0x22')](_0x4bef1e[_0x1952('0x23')]);if(_0x4bef1e[_0x1952('0x24')]){delete _0x4bef1e[_0x1952('0x24')];}_0x4bcc1c[_0x1952('0x18')](_0xe9a0d1)[_0x1952('0x25')](_0x4bef1e);};}exports[_0x1952('0x26')]=function(_0x4d92a6,_0x370719){var _0x37db97={},_0x23a1a7={},_0x5d3b29={'count':0x0,'rows':[]};var _0x27213d=db[_0x1952('0x27')][_0x1952('0x28')];_0x23a1a7[_0x1952('0x29')]=_['keys'](_0x27213d);_0x23a1a7['query']=_[_0x1952('0x2a')](_0x4d92a6[_0x1952('0x2b')]);_0x23a1a7[_0x1952('0x2c')]=_[_0x1952('0x2d')](_0x23a1a7[_0x1952('0x29')],_0x23a1a7['query']);_0x37db97[_0x1952('0x2e')]=_[_0x1952('0x2d')](_0x23a1a7['model'],qs[_0x1952('0x2f')](_0x4d92a6[_0x1952('0x2b')][_0x1952('0x2f')]));_0x37db97[_0x1952('0x2e')]=_0x37db97[_0x1952('0x2e')][_0x1952('0x30')]?_0x37db97['attributes']:_0x23a1a7[_0x1952('0x29')];if(!_0x4d92a6[_0x1952('0x2b')][_0x1952('0x31')](_0x1952('0x32'))){_0x37db97[_0x1952('0x1c')]=qs[_0x1952('0x1c')](_0x4d92a6[_0x1952('0x2b')][_0x1952('0x1c')]);_0x37db97[_0x1952('0x1b')]=qs[_0x1952('0x1b')](_0x4d92a6[_0x1952('0x2b')][_0x1952('0x1b')]);}_0x37db97[_0x1952('0x33')]=qs['sort'](_0x4d92a6[_0x1952('0x2b')][_0x1952('0x34')]);_0x37db97[_0x1952('0x35')]=qs[_0x1952('0x2c')](_[_0x1952('0x36')](_0x4d92a6[_0x1952('0x2b')],_0x23a1a7[_0x1952('0x2c')]));if(_0x4d92a6[_0x1952('0x2b')][_0x1952('0x37')]){_0x37db97[_0x1952('0x35')]=_['merge'](_0x37db97['where'],{'$or':_[_0x1952('0x38')](_0x27213d,function(_0x345743){if(_0x345743['type'][_0x1952('0x39')]!==_0x1952('0x3a')){var _0x225eb0={};_0x225eb0[_0x345743['field']]={'$like':'%'+_0x4d92a6[_0x1952('0x2b')][_0x1952('0x37')]+'%'};return _0x225eb0;}})});}_0x37db97=_['merge']({},_0x37db97,_0x4d92a6[_0x1952('0x3b')]);var _0x200b95={'where':_0x37db97[_0x1952('0x35')]};return db[_0x1952('0x27')][_0x1952('0x1a')](_0x200b95)['then'](function(_0x5839a8){_0x5d3b29[_0x1952('0x1a')]=_0x5839a8;if(_0x4d92a6[_0x1952('0x2b')]['includeAll']){_0x37db97[_0x1952('0x3c')]=[{'all':!![]}];}return db[_0x1952('0x27')][_0x1952('0x3d')](_0x37db97);})[_0x1952('0x21')](function(_0x4fe643){_0x5d3b29[_0x1952('0x3e')]=_0x4fe643;return _0x5d3b29;})[_0x1952('0x21')](respondWithFilteredResult(_0x370719,_0x37db97))[_0x1952('0x3f')](handleError(_0x370719,null));};exports[_0x1952('0x40')]=function(_0x5488bc,_0x42b77e){var _0x388f8a={'raw':!![],'where':{'id':_0x5488bc[_0x1952('0x41')]['id']}},_0x494dc6={};_0x494dc6[_0x1952('0x29')]=_[_0x1952('0x2a')](db[_0x1952('0x27')][_0x1952('0x28')]);_0x494dc6['query']=_['keys'](_0x5488bc[_0x1952('0x2b')]);_0x494dc6[_0x1952('0x2c')]=_[_0x1952('0x2d')](_0x494dc6[_0x1952('0x29')],_0x494dc6[_0x1952('0x2b')]);_0x388f8a[_0x1952('0x2e')]=_[_0x1952('0x2d')](_0x494dc6[_0x1952('0x29')],qs[_0x1952('0x2f')](_0x5488bc['query'][_0x1952('0x2f')]));_0x388f8a[_0x1952('0x2e')]=_0x388f8a[_0x1952('0x2e')][_0x1952('0x30')]?_0x388f8a['attributes']:_0x494dc6[_0x1952('0x29')];if(_0x5488bc[_0x1952('0x2b')]['includeAll']){_0x388f8a[_0x1952('0x3c')]=[{'all':!![]}];}_0x388f8a=_[_0x1952('0x42')]({},_0x388f8a,_0x5488bc[_0x1952('0x3b')]);return db[_0x1952('0x27')][_0x1952('0x43')](_0x388f8a)[_0x1952('0x21')](handleEntityNotFound(_0x42b77e,null))['then'](respondWithResult(_0x42b77e,null))['catch'](handleError(_0x42b77e,null));};exports[_0x1952('0x44')]=function(_0x28eb9f,_0x4fb56e){return db['OpenchannelQueueReport'][_0x1952('0x44')](_0x28eb9f['body'],{})[_0x1952('0x21')](respondWithResult(_0x4fb56e,0xc9))[_0x1952('0x3f')](handleError(_0x4fb56e,null));};exports[_0x1952('0x45')]=function(_0x53c729,_0x1e9ec7){if(_0x53c729[_0x1952('0x46')]['id']){delete _0x53c729[_0x1952('0x46')]['id'];}return db[_0x1952('0x27')][_0x1952('0x43')]({'where':{'id':_0x53c729[_0x1952('0x41')]['id']}})[_0x1952('0x21')](handleEntityNotFound(_0x1e9ec7,null))[_0x1952('0x21')](saveUpdates(_0x53c729[_0x1952('0x46')],null))[_0x1952('0x21')](respondWithResult(_0x1e9ec7,null))['catch'](handleError(_0x1e9ec7,null));};exports[_0x1952('0x47')]=function(_0x213944,_0x243950){return db[_0x1952('0x27')][_0x1952('0x43')]({'where':{'id':_0x213944[_0x1952('0x41')]['id']}})['then'](handleEntityNotFound(_0x243950,null))[_0x1952('0x21')](removeEntity(_0x243950,null))[_0x1952('0x3f')](handleError(_0x243950,null));};exports[_0x1952('0x48')]=function(_0x53b4f5,_0x14b3f6){return db['OpenchannelQueueReport'][_0x1952('0x48')]()[_0x1952('0x21')](respondWithResult(_0x14b3f6,null))[_0x1952('0x3f')](handleError(_0x14b3f6,null));}; \ No newline at end of file +var _0x1ac9=['util','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../mysqldb','status','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','end','sendStatus','error','stack','name','index','OpenchannelQueueReport','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','map','key','VIRTUAL','field','options','includeAll','include','catch','show','params','keys','create','update','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x2cc569,_0x4e9568){var _0x1bfc2e=function(_0x5b8fcb){while(--_0x5b8fcb){_0x2cc569['push'](_0x2cc569['shift']());}};_0x1bfc2e(++_0x4e9568);}(_0x1ac9,0x119));var _0x91ac=function(_0xa2c6c9,_0x383b47){_0xa2c6c9=_0xa2c6c9-0x0;var _0x10ba06=_0x1ac9[_0xa2c6c9];return _0x10ba06;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x91ac('0x0'));var zipdir=require(_0x91ac('0x1'));var jsonpatch=require(_0x91ac('0x2'));var rp=require(_0x91ac('0x3'));var moment=require(_0x91ac('0x4'));var BPromise=require(_0x91ac('0x5'));var Mustache=require(_0x91ac('0x6'));var util=require(_0x91ac('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x91ac('0x8'));var ejs=require(_0x91ac('0x9'));var fs=require('fs');var _=require(_0x91ac('0xa'));var squel=require(_0x91ac('0xb'));var crypto=require(_0x91ac('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x91ac('0xd'));var toCsv=require(_0x91ac('0x8'));var querystring=require(_0x91ac('0xe'));var Papa=require(_0x91ac('0xf'));var Redis=require(_0x91ac('0x10'));var authService=require(_0x91ac('0x11'));var qs=require(_0x91ac('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x91ac('0x13'))('api');var utils=require(_0x91ac('0x14'));var config=require('../../config/environment');var db=require(_0x91ac('0x15'))['db'];function respondWithStatusCode(_0x345ff8,_0x2c4844){_0x2c4844=_0x2c4844||0xcc;return function(_0x28cf8d){if(_0x28cf8d){return _0x345ff8['sendStatus'](_0x2c4844);}return _0x345ff8[_0x91ac('0x16')](_0x2c4844)['end']();};}function respondWithResult(_0x4ee658,_0x388247){_0x388247=_0x388247||0xc8;return function(_0xc69be1){if(_0xc69be1){return _0x4ee658[_0x91ac('0x16')](_0x388247)[_0x91ac('0x17')](_0xc69be1);}};}function respondWithFilteredResult(_0x17e7cb,_0x489c4d){return function(_0x217daa){if(_0x217daa){var _0x4d86e8=_0x217daa[_0x91ac('0x18')],_0x2134d7=_0x489c4d[_0x91ac('0x19')],_0x456a07=_0x489c4d['offset']+_0x489c4d[_0x91ac('0x1a')],_0x24b1be;if(_0x456a07>=_0x4d86e8){_0x456a07=_0x4d86e8;_0x24b1be=0xc8;}else{_0x24b1be=0xce;}_0x17e7cb[_0x91ac('0x16')](_0x24b1be);return _0x17e7cb[_0x91ac('0x1b')](_0x91ac('0x1c'),_0x2134d7+'-'+_0x456a07+'/'+_0x4d86e8)['json'](_0x217daa);}return null;};}function patchUpdates(_0x7eefc0){return function(_0xc00f44){try{jsonpatch['apply'](_0xc00f44,_0x7eefc0,!![]);}catch(_0xf2799c){return BPromise[_0x91ac('0x1d')](_0xf2799c);}return _0xc00f44[_0x91ac('0x1e')]();};}function saveUpdates(_0x2e4324,_0x33a452){return function(_0x3888c9){if(_0x3888c9){return _0x3888c9['update'](_0x2e4324)[_0x91ac('0x1f')](function(_0x520c52){return _0x520c52;});}return null;};}function removeEntity(_0x3e0ff9,_0x56ca47){return function(_0x476115){if(_0x476115){return _0x476115[_0x91ac('0x20')]()[_0x91ac('0x1f')](function(){_0x3e0ff9['status'](0xcc)[_0x91ac('0x21')]();});}};}function handleEntityNotFound(_0x2a64ee,_0x1fed52){return function(_0x58e100){if(!_0x58e100){_0x2a64ee[_0x91ac('0x22')](0x194);}return _0x58e100;};}function handleError(_0x17cf3a,_0x3efbfa){_0x3efbfa=_0x3efbfa||0x1f4;return function(_0x3cdd1f){logger[_0x91ac('0x23')](_0x3cdd1f[_0x91ac('0x24')]);if(_0x3cdd1f[_0x91ac('0x25')]){delete _0x3cdd1f[_0x91ac('0x25')];}_0x17cf3a[_0x91ac('0x16')](_0x3efbfa)['send'](_0x3cdd1f);};}exports[_0x91ac('0x26')]=function(_0x15326d,_0x7ace9b){var _0x190f64={},_0x393fb1={},_0x1fc11e={'count':0x0,'rows':[]};var _0x1764c3=db[_0x91ac('0x27')][_0x91ac('0x28')];_0x393fb1[_0x91ac('0x29')]=_['keys'](_0x1764c3);_0x393fb1['query']=_['keys'](_0x15326d[_0x91ac('0x2a')]);_0x393fb1[_0x91ac('0x2b')]=_[_0x91ac('0x2c')](_0x393fb1[_0x91ac('0x29')],_0x393fb1[_0x91ac('0x2a')]);_0x190f64[_0x91ac('0x2d')]=_['intersection'](_0x393fb1[_0x91ac('0x29')],qs['fields'](_0x15326d[_0x91ac('0x2a')][_0x91ac('0x2e')]));_0x190f64[_0x91ac('0x2d')]=_0x190f64['attributes'][_0x91ac('0x2f')]?_0x190f64[_0x91ac('0x2d')]:_0x393fb1[_0x91ac('0x29')];if(!_0x15326d[_0x91ac('0x2a')][_0x91ac('0x30')](_0x91ac('0x31'))){_0x190f64['limit']=qs[_0x91ac('0x1a')](_0x15326d[_0x91ac('0x2a')]['limit']);_0x190f64[_0x91ac('0x19')]=qs['offset'](_0x15326d[_0x91ac('0x2a')][_0x91ac('0x19')]);}_0x190f64[_0x91ac('0x32')]=qs[_0x91ac('0x33')](_0x15326d['query']['sort']);_0x190f64['where']=qs[_0x91ac('0x2b')](_[_0x91ac('0x34')](_0x15326d[_0x91ac('0x2a')],_0x393fb1[_0x91ac('0x2b')]));if(_0x15326d['query'][_0x91ac('0x35')]){_0x190f64['where']=_[_0x91ac('0x36')](_0x190f64[_0x91ac('0x37')],{'$or':_[_0x91ac('0x38')](_0x1764c3,function(_0x4d6565){if(_0x4d6565['type'][_0x91ac('0x39')]!==_0x91ac('0x3a')){var _0x14b39c={};_0x14b39c[_0x4d6565[_0x91ac('0x3b')]]={'$like':'%'+_0x15326d['query'][_0x91ac('0x35')]+'%'};return _0x14b39c;}})});}_0x190f64=_[_0x91ac('0x36')]({},_0x190f64,_0x15326d[_0x91ac('0x3c')]);var _0xfcf148={'where':_0x190f64[_0x91ac('0x37')]};return db[_0x91ac('0x27')]['count'](_0xfcf148)['then'](function(_0x494fce){_0x1fc11e[_0x91ac('0x18')]=_0x494fce;if(_0x15326d[_0x91ac('0x2a')][_0x91ac('0x3d')]){_0x190f64[_0x91ac('0x3e')]=[{'all':!![]}];}return db['OpenchannelQueueReport']['findAll'](_0x190f64);})[_0x91ac('0x1f')](function(_0x352a1a){_0x1fc11e['rows']=_0x352a1a;return _0x1fc11e;})['then'](respondWithFilteredResult(_0x7ace9b,_0x190f64))[_0x91ac('0x3f')](handleError(_0x7ace9b,null));};exports[_0x91ac('0x40')]=function(_0x41d936,_0x2907c9){var _0x3558c7={'raw':!![],'where':{'id':_0x41d936[_0x91ac('0x41')]['id']}},_0x3bbfb3={};_0x3bbfb3['model']=_[_0x91ac('0x42')](db[_0x91ac('0x27')][_0x91ac('0x28')]);_0x3bbfb3[_0x91ac('0x2a')]=_[_0x91ac('0x42')](_0x41d936[_0x91ac('0x2a')]);_0x3bbfb3['filters']=_[_0x91ac('0x2c')](_0x3bbfb3[_0x91ac('0x29')],_0x3bbfb3[_0x91ac('0x2a')]);_0x3558c7['attributes']=_['intersection'](_0x3bbfb3[_0x91ac('0x29')],qs[_0x91ac('0x2e')](_0x41d936[_0x91ac('0x2a')][_0x91ac('0x2e')]));_0x3558c7['attributes']=_0x3558c7[_0x91ac('0x2d')]['length']?_0x3558c7[_0x91ac('0x2d')]:_0x3bbfb3[_0x91ac('0x29')];if(_0x41d936[_0x91ac('0x2a')]['includeAll']){_0x3558c7['include']=[{'all':!![]}];}_0x3558c7=_['merge']({},_0x3558c7,_0x41d936['options']);return db[_0x91ac('0x27')]['find'](_0x3558c7)['then'](handleEntityNotFound(_0x2907c9,null))[_0x91ac('0x1f')](respondWithResult(_0x2907c9,null))['catch'](handleError(_0x2907c9,null));};exports[_0x91ac('0x43')]=function(_0x794210,_0x4ac241){return db[_0x91ac('0x27')][_0x91ac('0x43')](_0x794210['body'],{})[_0x91ac('0x1f')](respondWithResult(_0x4ac241,0xc9))[_0x91ac('0x3f')](handleError(_0x4ac241,null));};exports[_0x91ac('0x44')]=function(_0xe6d4e,_0x140370){if(_0xe6d4e[_0x91ac('0x45')]['id']){delete _0xe6d4e['body']['id'];}return db[_0x91ac('0x27')][_0x91ac('0x46')]({'where':{'id':_0xe6d4e[_0x91ac('0x41')]['id']}})[_0x91ac('0x1f')](handleEntityNotFound(_0x140370,null))[_0x91ac('0x1f')](saveUpdates(_0xe6d4e['body'],null))['then'](respondWithResult(_0x140370,null))[_0x91ac('0x3f')](handleError(_0x140370,null));};exports[_0x91ac('0x20')]=function(_0x3447f5,_0x494650){return db[_0x91ac('0x27')]['find']({'where':{'id':_0x3447f5[_0x91ac('0x41')]['id']}})[_0x91ac('0x1f')](handleEntityNotFound(_0x494650,null))['then'](removeEntity(_0x494650,null))[_0x91ac('0x3f')](handleError(_0x494650,null));};exports[_0x91ac('0x47')]=function(_0x136122,_0x5b85a0){return db[_0x91ac('0x27')]['describe']()[_0x91ac('0x1f')](respondWithResult(_0x5b85a0,null))[_0x91ac('0x3f')](handleError(_0x5b85a0,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 152a20e..4fcde5c 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 _0x6b19=['define','uniqueid','lodash','util','api','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes'];(function(_0x5420aa,_0x21a5af){var _0x5a3717=function(_0x2fbedb){while(--_0x2fbedb){_0x5420aa['push'](_0x5420aa['shift']());}};_0x5a3717(++_0x21a5af);}(_0x6b19,0xe8));var _0x96b1=function(_0x54febe,_0xeb01b){_0x54febe=_0x54febe-0x0;var _0x20f7bc=_0x6b19[_0x54febe];return _0x20f7bc;};'use strict';var _=require(_0x96b1('0x0'));var util=require(_0x96b1('0x1'));var logger=require('../../config/logger')(_0x96b1('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x96b1('0x3'));var fs=require('fs');var path=require(_0x96b1('0x4'));var rimraf=require(_0x96b1('0x5'));var config=require(_0x96b1('0x6'));var attributes=require(_0x96b1('0x7'));module['exports']=function(_0x8b5ab8,_0x546193){return _0x8b5ab8[_0x96b1('0x8')]('OpenchannelQueueReport',attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0x96b1('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x17ba=['./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x28e53a,_0x4a10cb){var _0x5bc961=function(_0x1be89e){while(--_0x1be89e){_0x28e53a['push'](_0x28e53a['shift']());}};_0x5bc961(++_0x4a10cb);}(_0x17ba,0xab));var _0xa17b=function(_0x226fff,_0x4194fd){_0x226fff=_0x226fff-0x0;var _0x1a4b2c=_0x17ba[_0x226fff];return _0x1a4b2c;};'use strict';var _=require(_0xa17b('0x0'));var util=require(_0xa17b('0x1'));var logger=require('../../config/logger')(_0xa17b('0x2'));var moment=require(_0xa17b('0x3'));var BPromise=require(_0xa17b('0x4'));var rp=require(_0xa17b('0x5'));var fs=require('fs');var path=require(_0xa17b('0x6'));var rimraf=require(_0xa17b('0x7'));var config=require(_0xa17b('0x8'));var attributes=require(_0xa17b('0x9'));module[_0xa17b('0xa')]=function(_0x3cced2,_0xf72ed4){return _0x3cced2[_0xa17b('0xb')](_0xa17b('0xc'),attributes,{'tableName':_0xa17b('0xd'),'paranoid':![],'indexes':[{'name':_0xa17b('0xe'),'fields':[_0xa17b('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 1449795..b5c0d1b 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 _0xe1d8=['request','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','body','raw','then','debug','UpdateOpenchannelQueueReport','update','options','where','attributes','lodash','util','moment','../../config/utils','rpc','../../config/environment','jayson/promise','http'];(function(_0x1d30a3,_0x5f428c){var _0x32bba1=function(_0x5a60cc){while(--_0x5a60cc){_0x1d30a3['push'](_0x1d30a3['shift']());}};_0x32bba1(++_0x5f428c);}(_0xe1d8,0x171));var _0x8e1d=function(_0xaad835,_0x35ec62){_0xaad835=_0xaad835-0x0;var _0x4543f2=_0xe1d8[_0xaad835];return _0x4543f2;};'use strict';var _=require(_0x8e1d('0x0'));var util=require(_0x8e1d('0x1'));var moment=require(_0x8e1d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8e1d('0x3'));var logger=require('../../config/logger')(_0x8e1d('0x4'));var config=require(_0x8e1d('0x5'));var jayson=require(_0x8e1d('0x6'));var client=jayson['client'][_0x8e1d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x304f53,_0x3d1be5,_0x4ba422){return new BPromise(function(_0x1b18fe,_0x1d2add){return client[_0x8e1d('0x8')](_0x304f53,_0x4ba422)['then'](function(_0x588918){logger['info'](_0x8e1d('0x9'),_0x3d1be5,_0x8e1d('0xa'));logger['debug'](_0x8e1d('0xb'),_0x3d1be5,_0x8e1d('0xa'),JSON[_0x8e1d('0xc')](_0x588918));if(_0x588918[_0x8e1d('0xd')]){if(_0x588918[_0x8e1d('0xd')][_0x8e1d('0xe')]===0x1f4){logger['error'](_0x8e1d('0x9'),_0x3d1be5,_0x588918['error'][_0x8e1d('0xf')]);return _0x1d2add(_0x588918['error'][_0x8e1d('0xf')]);}logger[_0x8e1d('0xd')](_0x8e1d('0x9'),_0x3d1be5,_0x588918[_0x8e1d('0xd')][_0x8e1d('0xf')]);return _0x1b18fe(_0x588918[_0x8e1d('0xd')][_0x8e1d('0xf')]);}else{logger[_0x8e1d('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3d1be5,_0x8e1d('0xa'));_0x1b18fe(_0x588918['result'][_0x8e1d('0xf')]);}})[_0x8e1d('0x11')](function(_0x5519d4){logger[_0x8e1d('0xd')](_0x8e1d('0x9'),_0x3d1be5,_0x5519d4);_0x1d2add(_0x5519d4);});});}exports[_0x8e1d('0x12')]=function(_0x10b00b){var _0x2cee27=this;return new Promise(function(_0x136348,_0x404469){return db[_0x8e1d('0x13')]['create'](_0x10b00b[_0x8e1d('0x14')],{'raw':_0x10b00b['options']?_0x10b00b['options'][_0x8e1d('0x15')]===undefined?!![]:![]:!![]})[_0x8e1d('0x16')](function(_0x1132d2){logger[_0x8e1d('0x10')]('CreateOpenchannelQueueReport',_0x10b00b);logger[_0x8e1d('0x17')](_0x8e1d('0x12'),_0x10b00b,JSON[_0x8e1d('0xc')](_0x1132d2));_0x136348(_0x1132d2);})[_0x8e1d('0x11')](function(_0x5abf57){logger['error'](_0x8e1d('0x12'),_0x5abf57[_0x8e1d('0xf')],_0x10b00b);_0x404469(_0x2cee27[_0x8e1d('0xd')](0x1f4,_0x5abf57[_0x8e1d('0xf')]));});});};exports[_0x8e1d('0x18')]=function(_0x1608f2){var _0x3d0a70=this;return new Promise(function(_0x15a4f1,_0x4449f6){return db[_0x8e1d('0x13')][_0x8e1d('0x19')](_0x1608f2[_0x8e1d('0x14')],{'raw':_0x1608f2[_0x8e1d('0x1a')]?_0x1608f2[_0x8e1d('0x1a')][_0x8e1d('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1608f2[_0x8e1d('0x1a')]?_0x1608f2[_0x8e1d('0x1a')][_0x8e1d('0x1b')]||null:null,'attributes':_0x1608f2[_0x8e1d('0x1a')]?_0x1608f2[_0x8e1d('0x1a')][_0x8e1d('0x1c')]||null:null,'limit':_0x1608f2['options']?_0x1608f2[_0x8e1d('0x1a')]['limit']||null:null})[_0x8e1d('0x16')](function(_0x314daa){logger[_0x8e1d('0x10')](_0x8e1d('0x18'),_0x1608f2);logger[_0x8e1d('0x17')](_0x8e1d('0x18'),_0x1608f2,JSON['stringify'](_0x314daa));_0x15a4f1(_0x314daa);})[_0x8e1d('0x11')](function(_0x231765){logger['error'](_0x8e1d('0x18'),_0x231765[_0x8e1d('0xf')],_0x1608f2);_0x4449f6(_0x3d0a70[_0x8e1d('0xd')](0x1f4,_0x231765[_0x8e1d('0xf')]));});});}; \ No newline at end of file +var _0xec71=['then','debug','CreateOpenchannelQueueReport','body','where','attributes','limit','UpdateOpenchannelQueueReport','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','OpenchannelQueueReport','create','options','raw'];(function(_0x39caaa,_0x1f37bc){var _0x9b9c7d=function(_0x2da02c){while(--_0x2da02c){_0x39caaa['push'](_0x39caaa['shift']());}};_0x9b9c7d(++_0x1f37bc);}(_0xec71,0xda));var _0x1ec7=function(_0x17325e,_0x5863f2){_0x17325e=_0x17325e-0x0;var _0x51062a=_0xec71[_0x17325e];return _0x51062a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1ec7('0x0'));var BPromise=require(_0x1ec7('0x1'));var rs=require(_0x1ec7('0x2'));var fs=require('fs');var Redis=require(_0x1ec7('0x3'));var db=require(_0x1ec7('0x4'))['db'];var utils=require(_0x1ec7('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x1ec7('0x6'));var client=jayson[_0x1ec7('0x7')][_0x1ec7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x597f36,_0x5f109f,_0x49f908){return new BPromise(function(_0x207441,_0x29e413){return client[_0x1ec7('0x9')](_0x597f36,_0x49f908)['then'](function(_0x113f13){logger[_0x1ec7('0xa')](_0x1ec7('0xb'),_0x5f109f,_0x1ec7('0xc'));logger['debug'](_0x1ec7('0xd'),_0x5f109f,'request\x20sent',JSON[_0x1ec7('0xe')](_0x113f13));if(_0x113f13['error']){if(_0x113f13['error']['code']===0x1f4){logger[_0x1ec7('0xf')](_0x1ec7('0xb'),_0x5f109f,_0x113f13[_0x1ec7('0xf')][_0x1ec7('0x10')]);return _0x29e413(_0x113f13['error']['message']);}logger[_0x1ec7('0xf')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x5f109f,_0x113f13[_0x1ec7('0xf')][_0x1ec7('0x10')]);return _0x207441(_0x113f13['error'][_0x1ec7('0x10')]);}else{logger['info'](_0x1ec7('0xb'),_0x5f109f,_0x1ec7('0xc'));_0x207441(_0x113f13['result'][_0x1ec7('0x10')]);}})[_0x1ec7('0x11')](function(_0x4dc283){logger['error'](_0x1ec7('0xb'),_0x5f109f,_0x4dc283);_0x29e413(_0x4dc283);});});}exports['CreateOpenchannelQueueReport']=function(_0x124967){var _0x3047a9=this;return new Promise(function(_0x3fe97f,_0x581797){return db[_0x1ec7('0x12')][_0x1ec7('0x13')](_0x124967['body'],{'raw':_0x124967[_0x1ec7('0x14')]?_0x124967[_0x1ec7('0x14')][_0x1ec7('0x15')]===undefined?!![]:![]:!![]})[_0x1ec7('0x16')](function(_0x2f10de){logger[_0x1ec7('0xa')]('CreateOpenchannelQueueReport',_0x124967);logger[_0x1ec7('0x17')](_0x1ec7('0x18'),_0x124967,JSON[_0x1ec7('0xe')](_0x2f10de));_0x3fe97f(_0x2f10de);})[_0x1ec7('0x11')](function(_0x38b477){logger['error'](_0x1ec7('0x18'),_0x38b477[_0x1ec7('0x10')],_0x124967);_0x581797(_0x3047a9[_0x1ec7('0xf')](0x1f4,_0x38b477['message']));});});};exports['UpdateOpenchannelQueueReport']=function(_0x24dcfa){var _0x39bdf5=this;return new Promise(function(_0x1dba3d,_0x1fedb2){return db[_0x1ec7('0x12')]['update'](_0x24dcfa[_0x1ec7('0x19')],{'raw':_0x24dcfa['options']?_0x24dcfa[_0x1ec7('0x14')][_0x1ec7('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24dcfa['options']?_0x24dcfa[_0x1ec7('0x14')][_0x1ec7('0x1a')]||null:null,'attributes':_0x24dcfa[_0x1ec7('0x14')]?_0x24dcfa[_0x1ec7('0x14')][_0x1ec7('0x1b')]||null:null,'limit':_0x24dcfa['options']?_0x24dcfa[_0x1ec7('0x14')][_0x1ec7('0x1c')]||null:null})[_0x1ec7('0x16')](function(_0x514e0b){logger['info'](_0x1ec7('0x1d'),_0x24dcfa);logger[_0x1ec7('0x17')](_0x1ec7('0x1d'),_0x24dcfa,JSON[_0x1ec7('0xe')](_0x514e0b));_0x1dba3d(_0x514e0b);})['catch'](function(_0x3d0a45){logger['error'](_0x1ec7('0x1d'),_0x3d0a45[_0x1ec7('0x10')],_0x24dcfa);_0x1fedb2(_0x39bdf5[_0x1ec7('0xf')](0x1f4,_0x3d0a45['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 291d024..746c22b 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 _0x0e1c=['put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','isAuthenticated','get','/describe','describe','/:id','post','create'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x0e1c,0x140));var _0xc0e1=function(_0x5614f1,_0x28606d){_0x5614f1=_0x5614f1-0x0;var _0x2d0958=_0x0e1c[_0x5614f1];return _0x2d0958;};'use strict';var multer=require(_0xc0e1('0x0'));var util=require(_0xc0e1('0x1'));var path=require(_0xc0e1('0x2'));var timeout=require('connect-timeout');var express=require(_0xc0e1('0x3'));var router=express[_0xc0e1('0x4')]();var auth=require(_0xc0e1('0x5'));var interaction=require(_0xc0e1('0x6'));var config=require(_0xc0e1('0x7'));var controller=require(_0xc0e1('0x8'));router['get']('/',auth[_0xc0e1('0x9')](),controller['index']);router[_0xc0e1('0xa')](_0xc0e1('0xb'),auth['isAuthenticated'](),controller[_0xc0e1('0xc')]);router[_0xc0e1('0xa')](_0xc0e1('0xd'),auth[_0xc0e1('0x9')](),controller['show']);router[_0xc0e1('0xe')]('/',auth[_0xc0e1('0x9')](),controller[_0xc0e1('0xf')]);router[_0xc0e1('0x10')](_0xc0e1('0xd'),auth[_0xc0e1('0x9')](),controller[_0xc0e1('0x11')]);router[_0xc0e1('0x12')](_0xc0e1('0xd'),auth['isAuthenticated'](),controller[_0xc0e1('0x13')]);module[_0xc0e1('0x14')]=router; \ No newline at end of file +var _0x79ee=['path','connect-timeout','Router','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy','multer'];(function(_0x56c2d5,_0x3908fe){var _0x2e2133=function(_0x5d94e9){while(--_0x5d94e9){_0x56c2d5['push'](_0x56c2d5['shift']());}};_0x2e2133(++_0x3908fe);}(_0x79ee,0x164));var _0xe79e=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x79ee[_0x178e48];return _0x440d7e;};'use strict';var multer=require(_0xe79e('0x0'));var util=require('util');var path=require(_0xe79e('0x1'));var timeout=require(_0xe79e('0x2'));var express=require('express');var router=express[_0xe79e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xe79e('0x4'));var config=require('../../config/environment');var controller=require('./openchannelTransferReport.controller');router[_0xe79e('0x5')]('/',auth[_0xe79e('0x6')](),controller[_0xe79e('0x7')]);router[_0xe79e('0x5')](_0xe79e('0x8'),auth[_0xe79e('0x6')](),controller[_0xe79e('0x9')]);router[_0xe79e('0x5')](_0xe79e('0xa'),auth[_0xe79e('0x6')](),controller[_0xe79e('0xb')]);router[_0xe79e('0xc')]('/',auth[_0xe79e('0x6')](),controller[_0xe79e('0xd')]);router['put'](_0xe79e('0xa'),auth['isAuthenticated'](),controller[_0xe79e('0xe')]);router[_0xe79e('0xf')](_0xe79e('0xa'),auth[_0xe79e('0x6')](),controller[_0xe79e('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index f720702..3b90422 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 _0x86ce=['sequelize','exports','STRING','ENUM','account','queue','DATE','NOW'];(function(_0x3074f3,_0x4f2c03){var _0x53f112=function(_0x4a17af){while(--_0x4a17af){_0x3074f3['push'](_0x3074f3['shift']());}};_0x53f112(++_0x4f2c03);}(_0x86ce,0xe8));var _0xe86c=function(_0x235563,_0x260ece){_0x235563=_0x235563-0x0;var _0x219be0=_0x86ce[_0x235563];return _0x219be0;};'use strict';var moment=require('moment');var Sequelize=require(_0xe86c('0x0'));module[_0xe86c('0x1')]={'uniqueid':{'type':Sequelize[_0xe86c('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xe86c('0x3')](_0xe86c('0x4'),'agent','queue'),'allowNull':![],'defaultValue':_0xe86c('0x5')},'transferredAt':{'type':Sequelize[_0xe86c('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xe86c('0x7')]}}; \ No newline at end of file +var _0xae45=['moment','sequelize','STRING','ENUM','agent','queue','DATE'];(function(_0x14c584,_0x45efd5){var _0x2f59da=function(_0x4736a3){while(--_0x4736a3){_0x14c584['push'](_0x14c584['shift']());}};_0x2f59da(++_0x45efd5);}(_0xae45,0x18f));var _0x5ae4=function(_0xbacee1,_0x3af28b){_0xbacee1=_0xbacee1-0x0;var _0x323a8d=_0xae45[_0xbacee1];return _0x323a8d;};'use strict';var moment=require(_0x5ae4('0x0'));var Sequelize=require(_0x5ae4('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x5ae4('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x5ae4('0x3')]('account',_0x5ae4('0x4'),_0x5ae4('0x5')),'allowNull':![],'defaultValue':_0x5ae4('0x5')},'transferredAt':{'type':Sequelize[_0x5ae4('0x6')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 96f3264..dd92388 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 _0xf1e1=['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','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','update','then','name','index','OpenchannelTransferReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','key','field','options','include','findAll','catch','show','includeAll','find','create','body','params','describe','html-pdf','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0xac8055,_0x5ababb){var _0x2d5608=function(_0x47e316){while(--_0x47e316){_0xac8055['push'](_0xac8055['shift']());}};_0x2d5608(++_0x5ababb);}(_0xf1e1,0x102));var _0x1f1e=function(_0x5e4563,_0x3ff918){_0x5e4563=_0x5e4563-0x0;var _0x8d1bf5=_0xf1e1[_0x5e4563];return _0x8d1bf5;};'use strict';var pdf=require(_0x1f1e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1f1e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1f1e('0x2'));var rp=require('request-promise');var moment=require(_0x1f1e('0x3'));var BPromise=require(_0x1f1e('0x4'));var Mustache=require(_0x1f1e('0x5'));var util=require(_0x1f1e('0x6'));var path=require(_0x1f1e('0x7'));var sox=require(_0x1f1e('0x8'));var csv=require(_0x1f1e('0x9'));var ejs=require(_0x1f1e('0xa'));var fs=require('fs');var _=require(_0x1f1e('0xb'));var squel=require(_0x1f1e('0xc'));var crypto=require(_0x1f1e('0xd'));var jsforce=require(_0x1f1e('0xe'));var deskjs=require(_0x1f1e('0xf'));var toCsv=require(_0x1f1e('0x9'));var querystring=require('querystring');var Papa=require(_0x1f1e('0x10'));var Redis=require(_0x1f1e('0x11'));var authService=require(_0x1f1e('0x12'));var qs=require(_0x1f1e('0x13'));var hardwareService=require(_0x1f1e('0x14'));var logger=require(_0x1f1e('0x15'))(_0x1f1e('0x16'));var utils=require(_0x1f1e('0x17'));var config=require(_0x1f1e('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x191977,_0x15dee8){_0x15dee8=_0x15dee8||0xcc;return function(_0x1cfe77){if(_0x1cfe77){return _0x191977[_0x1f1e('0x19')](_0x15dee8);}return _0x191977[_0x1f1e('0x1a')](_0x15dee8)[_0x1f1e('0x1b')]();};}function respondWithResult(_0x1f40ef,_0x4f16e0){_0x4f16e0=_0x4f16e0||0xc8;return function(_0x3ff746){if(_0x3ff746){return _0x1f40ef[_0x1f1e('0x1a')](_0x4f16e0)['json'](_0x3ff746);}};}function respondWithFilteredResult(_0x28563e,_0x59394b){return function(_0x5b075c){if(_0x5b075c){var _0x1553d=_0x5b075c[_0x1f1e('0x1c')],_0x21da96=_0x59394b[_0x1f1e('0x1d')],_0xe4cef0=_0x59394b[_0x1f1e('0x1d')]+_0x59394b[_0x1f1e('0x1e')],_0x2b0a44;if(_0xe4cef0>=_0x1553d){_0xe4cef0=_0x1553d;_0x2b0a44=0xc8;}else{_0x2b0a44=0xce;}_0x28563e[_0x1f1e('0x1a')](_0x2b0a44);return _0x28563e['set'](_0x1f1e('0x1f'),_0x21da96+'-'+_0xe4cef0+'/'+_0x1553d)[_0x1f1e('0x20')](_0x5b075c);}return null;};}function patchUpdates(_0x5702db){return function(_0x19c8c6){try{jsonpatch[_0x1f1e('0x21')](_0x19c8c6,_0x5702db,!![]);}catch(_0xb1f54f){return BPromise['reject'](_0xb1f54f);}return _0x19c8c6['save']();};}function saveUpdates(_0x49c107,_0x1d18d9){return function(_0x226f45){if(_0x226f45){return _0x226f45[_0x1f1e('0x22')](_0x49c107)[_0x1f1e('0x23')](function(_0x300f60){return _0x300f60;});}return null;};}function removeEntity(_0x46d28,_0x39636c){return function(_0x262f91){if(_0x262f91){return _0x262f91['destroy']()['then'](function(){_0x46d28['status'](0xcc)[_0x1f1e('0x1b')]();});}};}function handleEntityNotFound(_0x4156bf,_0x2830d0){return function(_0x4268ed){if(!_0x4268ed){_0x4156bf['sendStatus'](0x194);}return _0x4268ed;};}function handleError(_0x79c4db,_0x17dc6c){_0x17dc6c=_0x17dc6c||0x1f4;return function(_0x3d7c6a){logger['error'](_0x3d7c6a['stack']);if(_0x3d7c6a[_0x1f1e('0x24')]){delete _0x3d7c6a[_0x1f1e('0x24')];}_0x79c4db[_0x1f1e('0x1a')](_0x17dc6c)['send'](_0x3d7c6a);};}exports[_0x1f1e('0x25')]=function(_0x31f48b,_0x5294bf){var _0x3689fc={},_0x518c2d={},_0x46cc43={'count':0x0,'rows':[]};var _0xe84434=db[_0x1f1e('0x26')][_0x1f1e('0x27')];_0x518c2d[_0x1f1e('0x28')]=_[_0x1f1e('0x29')](_0xe84434);_0x518c2d['query']=_[_0x1f1e('0x29')](_0x31f48b[_0x1f1e('0x2a')]);_0x518c2d[_0x1f1e('0x2b')]=_[_0x1f1e('0x2c')](_0x518c2d[_0x1f1e('0x28')],_0x518c2d[_0x1f1e('0x2a')]);_0x3689fc[_0x1f1e('0x2d')]=_['intersection'](_0x518c2d[_0x1f1e('0x28')],qs[_0x1f1e('0x2e')](_0x31f48b[_0x1f1e('0x2a')][_0x1f1e('0x2e')]));_0x3689fc[_0x1f1e('0x2d')]=_0x3689fc[_0x1f1e('0x2d')][_0x1f1e('0x2f')]?_0x3689fc[_0x1f1e('0x2d')]:_0x518c2d['model'];if(!_0x31f48b['query'][_0x1f1e('0x30')]('nolimit')){_0x3689fc['limit']=qs[_0x1f1e('0x1e')](_0x31f48b[_0x1f1e('0x2a')][_0x1f1e('0x1e')]);_0x3689fc[_0x1f1e('0x1d')]=qs[_0x1f1e('0x1d')](_0x31f48b[_0x1f1e('0x2a')]['offset']);}_0x3689fc[_0x1f1e('0x31')]=qs[_0x1f1e('0x32')](_0x31f48b[_0x1f1e('0x2a')]['sort']);_0x3689fc[_0x1f1e('0x33')]=qs[_0x1f1e('0x2b')](_['pick'](_0x31f48b['query'],_0x518c2d['filters']));if(_0x31f48b['query'][_0x1f1e('0x34')]){_0x3689fc['where']=_[_0x1f1e('0x35')](_0x3689fc[_0x1f1e('0x33')],{'$or':_['map'](_0xe84434,function(_0x2c4d2e){if(_0x2c4d2e['type'][_0x1f1e('0x36')]!=='VIRTUAL'){var _0x1e0378={};_0x1e0378[_0x2c4d2e[_0x1f1e('0x37')]]={'$like':'%'+_0x31f48b[_0x1f1e('0x2a')][_0x1f1e('0x34')]+'%'};return _0x1e0378;}})});}_0x3689fc=_[_0x1f1e('0x35')]({},_0x3689fc,_0x31f48b[_0x1f1e('0x38')]);var _0x2fee75={'where':_0x3689fc['where']};return db[_0x1f1e('0x26')]['count'](_0x2fee75)[_0x1f1e('0x23')](function(_0x5a29a9){_0x46cc43['count']=_0x5a29a9;if(_0x31f48b[_0x1f1e('0x2a')]['includeAll']){_0x3689fc[_0x1f1e('0x39')]=[{'all':!![]}];}return db[_0x1f1e('0x26')][_0x1f1e('0x3a')](_0x3689fc);})[_0x1f1e('0x23')](function(_0x401c79){_0x46cc43['rows']=_0x401c79;return _0x46cc43;})[_0x1f1e('0x23')](respondWithFilteredResult(_0x5294bf,_0x3689fc))[_0x1f1e('0x3b')](handleError(_0x5294bf,null));};exports[_0x1f1e('0x3c')]=function(_0x375a7a,_0x2b2c74){var _0x34003f={'raw':!![],'where':{'id':_0x375a7a['params']['id']}},_0x57c69d={};_0x57c69d[_0x1f1e('0x28')]=_[_0x1f1e('0x29')](db['OpenchannelTransferReport']['rawAttributes']);_0x57c69d[_0x1f1e('0x2a')]=_['keys'](_0x375a7a[_0x1f1e('0x2a')]);_0x57c69d[_0x1f1e('0x2b')]=_[_0x1f1e('0x2c')](_0x57c69d[_0x1f1e('0x28')],_0x57c69d[_0x1f1e('0x2a')]);_0x34003f['attributes']=_[_0x1f1e('0x2c')](_0x57c69d[_0x1f1e('0x28')],qs[_0x1f1e('0x2e')](_0x375a7a[_0x1f1e('0x2a')][_0x1f1e('0x2e')]));_0x34003f[_0x1f1e('0x2d')]=_0x34003f[_0x1f1e('0x2d')][_0x1f1e('0x2f')]?_0x34003f[_0x1f1e('0x2d')]:_0x57c69d[_0x1f1e('0x28')];if(_0x375a7a[_0x1f1e('0x2a')][_0x1f1e('0x3d')]){_0x34003f[_0x1f1e('0x39')]=[{'all':!![]}];}_0x34003f=_[_0x1f1e('0x35')]({},_0x34003f,_0x375a7a[_0x1f1e('0x38')]);return db[_0x1f1e('0x26')][_0x1f1e('0x3e')](_0x34003f)['then'](handleEntityNotFound(_0x2b2c74,null))['then'](respondWithResult(_0x2b2c74,null))['catch'](handleError(_0x2b2c74,null));};exports[_0x1f1e('0x3f')]=function(_0x531d67,_0x2e9574){return db[_0x1f1e('0x26')][_0x1f1e('0x3f')](_0x531d67[_0x1f1e('0x40')],{})[_0x1f1e('0x23')](respondWithResult(_0x2e9574,0xc9))['catch'](handleError(_0x2e9574,null));};exports['update']=function(_0x3e2a8c,_0x317bb3){if(_0x3e2a8c[_0x1f1e('0x40')]['id']){delete _0x3e2a8c['body']['id'];}return db[_0x1f1e('0x26')]['find']({'where':{'id':_0x3e2a8c[_0x1f1e('0x41')]['id']}})[_0x1f1e('0x23')](handleEntityNotFound(_0x317bb3,null))[_0x1f1e('0x23')](saveUpdates(_0x3e2a8c['body'],null))['then'](respondWithResult(_0x317bb3,null))[_0x1f1e('0x3b')](handleError(_0x317bb3,null));};exports['destroy']=function(_0x33c145,_0xc5ca52){return db[_0x1f1e('0x26')][_0x1f1e('0x3e')]({'where':{'id':_0x33c145[_0x1f1e('0x41')]['id']}})['then'](handleEntityNotFound(_0xc5ca52,null))[_0x1f1e('0x23')](removeEntity(_0xc5ca52,null))['catch'](handleError(_0xc5ca52,null));};exports[_0x1f1e('0x42')]=function(_0x554e66,_0x1c49de){return db[_0x1f1e('0x26')]['describe']()[_0x1f1e('0x23')](respondWithResult(_0x1c49de,null))['catch'](handleError(_0x1c49de,null));}; \ No newline at end of file +var _0xb13b=['attributes','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','merge','type','key','VIRTUAL','field','filter','options','includeAll','include','rows','catch','show','params','fields','length','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','apply','reject','save','update','then','destroy','error','stack','name','send','index','OpenchannelTransferReport','rawAttributes','model','keys','query','filters','intersection'];(function(_0x50e40b,_0x338d17){var _0x2608b7=function(_0x4ded5e){while(--_0x4ded5e){_0x50e40b['push'](_0x50e40b['shift']());}};_0x2608b7(++_0x338d17);}(_0xb13b,0x1de));var _0xbb13=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0xb13b[_0x7e2eb0];return _0xd92de4;};'use strict';var pdf=require(_0xbb13('0x0'));var emlformat=require(_0xbb13('0x1'));var rimraf=require(_0xbb13('0x2'));var zipdir=require(_0xbb13('0x3'));var jsonpatch=require(_0xbb13('0x4'));var rp=require('request-promise');var moment=require(_0xbb13('0x5'));var BPromise=require(_0xbb13('0x6'));var Mustache=require('mustache');var util=require(_0xbb13('0x7'));var path=require(_0xbb13('0x8'));var sox=require(_0xbb13('0x9'));var csv=require(_0xbb13('0xa'));var ejs=require(_0xbb13('0xb'));var fs=require('fs');var _=require(_0xbb13('0xc'));var squel=require(_0xbb13('0xd'));var crypto=require(_0xbb13('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbb13('0xa'));var querystring=require(_0xbb13('0xf'));var Papa=require(_0xbb13('0x10'));var Redis=require(_0xbb13('0x11'));var authService=require(_0xbb13('0x12'));var qs=require(_0xbb13('0x13'));var hardwareService=require(_0xbb13('0x14'));var logger=require('../../config/logger')(_0xbb13('0x15'));var utils=require(_0xbb13('0x16'));var config=require(_0xbb13('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x307a6c,_0x555386){_0x555386=_0x555386||0xcc;return function(_0x56ee42){if(_0x56ee42){return _0x307a6c[_0xbb13('0x18')](_0x555386);}return _0x307a6c[_0xbb13('0x19')](_0x555386)[_0xbb13('0x1a')]();};}function respondWithResult(_0x1531af,_0x558bac){_0x558bac=_0x558bac||0xc8;return function(_0x11e664){if(_0x11e664){return _0x1531af[_0xbb13('0x19')](_0x558bac)[_0xbb13('0x1b')](_0x11e664);}};}function respondWithFilteredResult(_0x5f1473,_0x111035){return function(_0x5f3ab1){if(_0x5f3ab1){var _0x1ee7a6=_0x5f3ab1[_0xbb13('0x1c')],_0x4a35c4=_0x111035['offset'],_0xea5007=_0x111035['offset']+_0x111035['limit'],_0x3556ef;if(_0xea5007>=_0x1ee7a6){_0xea5007=_0x1ee7a6;_0x3556ef=0xc8;}else{_0x3556ef=0xce;}_0x5f1473[_0xbb13('0x19')](_0x3556ef);return _0x5f1473['set']('Content-Range',_0x4a35c4+'-'+_0xea5007+'/'+_0x1ee7a6)['json'](_0x5f3ab1);}return null;};}function patchUpdates(_0x6b9aee){return function(_0xda61fe){try{jsonpatch[_0xbb13('0x1d')](_0xda61fe,_0x6b9aee,!![]);}catch(_0x432b9a){return BPromise[_0xbb13('0x1e')](_0x432b9a);}return _0xda61fe[_0xbb13('0x1f')]();};}function saveUpdates(_0x4bd819,_0x143c25){return function(_0x40b7df){if(_0x40b7df){return _0x40b7df[_0xbb13('0x20')](_0x4bd819)[_0xbb13('0x21')](function(_0x553d12){return _0x553d12;});}return null;};}function removeEntity(_0x54915b,_0x205929){return function(_0x18de23){if(_0x18de23){return _0x18de23[_0xbb13('0x22')]()[_0xbb13('0x21')](function(){_0x54915b['status'](0xcc)[_0xbb13('0x1a')]();});}};}function handleEntityNotFound(_0x178c22,_0xc119cc){return function(_0x4d64b7){if(!_0x4d64b7){_0x178c22[_0xbb13('0x18')](0x194);}return _0x4d64b7;};}function handleError(_0x4801c0,_0x4c9ae2){_0x4c9ae2=_0x4c9ae2||0x1f4;return function(_0x37a04c){logger[_0xbb13('0x23')](_0x37a04c[_0xbb13('0x24')]);if(_0x37a04c[_0xbb13('0x25')]){delete _0x37a04c[_0xbb13('0x25')];}_0x4801c0[_0xbb13('0x19')](_0x4c9ae2)[_0xbb13('0x26')](_0x37a04c);};}exports[_0xbb13('0x27')]=function(_0x16e451,_0x1f8e5b){var _0x13ad27={},_0x49fe85={},_0x5157fe={'count':0x0,'rows':[]};var _0x4d3d89=db[_0xbb13('0x28')][_0xbb13('0x29')];_0x49fe85[_0xbb13('0x2a')]=_[_0xbb13('0x2b')](_0x4d3d89);_0x49fe85[_0xbb13('0x2c')]=_[_0xbb13('0x2b')](_0x16e451[_0xbb13('0x2c')]);_0x49fe85[_0xbb13('0x2d')]=_[_0xbb13('0x2e')](_0x49fe85['model'],_0x49fe85[_0xbb13('0x2c')]);_0x13ad27[_0xbb13('0x2f')]=_[_0xbb13('0x2e')](_0x49fe85[_0xbb13('0x2a')],qs['fields'](_0x16e451[_0xbb13('0x2c')]['fields']));_0x13ad27[_0xbb13('0x2f')]=_0x13ad27[_0xbb13('0x2f')]['length']?_0x13ad27[_0xbb13('0x2f')]:_0x49fe85['model'];if(!_0x16e451[_0xbb13('0x2c')][_0xbb13('0x30')](_0xbb13('0x31'))){_0x13ad27[_0xbb13('0x32')]=qs[_0xbb13('0x32')](_0x16e451[_0xbb13('0x2c')]['limit']);_0x13ad27['offset']=qs[_0xbb13('0x33')](_0x16e451[_0xbb13('0x2c')][_0xbb13('0x33')]);}_0x13ad27[_0xbb13('0x34')]=qs['sort'](_0x16e451['query'][_0xbb13('0x35')]);_0x13ad27[_0xbb13('0x36')]=qs['filters'](_[_0xbb13('0x37')](_0x16e451['query'],_0x49fe85[_0xbb13('0x2d')]));if(_0x16e451[_0xbb13('0x2c')]['filter']){_0x13ad27['where']=_[_0xbb13('0x38')](_0x13ad27[_0xbb13('0x36')],{'$or':_['map'](_0x4d3d89,function(_0x29e86d){if(_0x29e86d[_0xbb13('0x39')][_0xbb13('0x3a')]!==_0xbb13('0x3b')){var _0x2116b8={};_0x2116b8[_0x29e86d[_0xbb13('0x3c')]]={'$like':'%'+_0x16e451[_0xbb13('0x2c')][_0xbb13('0x3d')]+'%'};return _0x2116b8;}})});}_0x13ad27=_[_0xbb13('0x38')]({},_0x13ad27,_0x16e451[_0xbb13('0x3e')]);var _0x2f7e4f={'where':_0x13ad27[_0xbb13('0x36')]};return db[_0xbb13('0x28')]['count'](_0x2f7e4f)[_0xbb13('0x21')](function(_0x5e0fd6){_0x5157fe['count']=_0x5e0fd6;if(_0x16e451[_0xbb13('0x2c')][_0xbb13('0x3f')]){_0x13ad27[_0xbb13('0x40')]=[{'all':!![]}];}return db[_0xbb13('0x28')]['findAll'](_0x13ad27);})[_0xbb13('0x21')](function(_0x5dc679){_0x5157fe[_0xbb13('0x41')]=_0x5dc679;return _0x5157fe;})[_0xbb13('0x21')](respondWithFilteredResult(_0x1f8e5b,_0x13ad27))[_0xbb13('0x42')](handleError(_0x1f8e5b,null));};exports[_0xbb13('0x43')]=function(_0x42298f,_0xdf784f){var _0x2a31fe={'raw':!![],'where':{'id':_0x42298f[_0xbb13('0x44')]['id']}},_0x3cfb38={};_0x3cfb38[_0xbb13('0x2a')]=_[_0xbb13('0x2b')](db['OpenchannelTransferReport']['rawAttributes']);_0x3cfb38[_0xbb13('0x2c')]=_[_0xbb13('0x2b')](_0x42298f[_0xbb13('0x2c')]);_0x3cfb38[_0xbb13('0x2d')]=_['intersection'](_0x3cfb38['model'],_0x3cfb38['query']);_0x2a31fe[_0xbb13('0x2f')]=_[_0xbb13('0x2e')](_0x3cfb38[_0xbb13('0x2a')],qs[_0xbb13('0x45')](_0x42298f['query'][_0xbb13('0x45')]));_0x2a31fe['attributes']=_0x2a31fe[_0xbb13('0x2f')][_0xbb13('0x46')]?_0x2a31fe['attributes']:_0x3cfb38[_0xbb13('0x2a')];if(_0x42298f[_0xbb13('0x2c')][_0xbb13('0x3f')]){_0x2a31fe[_0xbb13('0x40')]=[{'all':!![]}];}_0x2a31fe=_['merge']({},_0x2a31fe,_0x42298f[_0xbb13('0x3e')]);return db[_0xbb13('0x28')][_0xbb13('0x47')](_0x2a31fe)['then'](handleEntityNotFound(_0xdf784f,null))[_0xbb13('0x21')](respondWithResult(_0xdf784f,null))[_0xbb13('0x42')](handleError(_0xdf784f,null));};exports[_0xbb13('0x48')]=function(_0xad42d3,_0x4765cb){return db[_0xbb13('0x28')][_0xbb13('0x48')](_0xad42d3[_0xbb13('0x49')],{})[_0xbb13('0x21')](respondWithResult(_0x4765cb,0xc9))[_0xbb13('0x42')](handleError(_0x4765cb,null));};exports[_0xbb13('0x20')]=function(_0x333ee5,_0x1c5c7a){if(_0x333ee5['body']['id']){delete _0x333ee5[_0xbb13('0x49')]['id'];}return db[_0xbb13('0x28')][_0xbb13('0x47')]({'where':{'id':_0x333ee5[_0xbb13('0x44')]['id']}})[_0xbb13('0x21')](handleEntityNotFound(_0x1c5c7a,null))[_0xbb13('0x21')](saveUpdates(_0x333ee5[_0xbb13('0x49')],null))['then'](respondWithResult(_0x1c5c7a,null))[_0xbb13('0x42')](handleError(_0x1c5c7a,null));};exports[_0xbb13('0x22')]=function(_0x11875d,_0x2d7716){return db[_0xbb13('0x28')][_0xbb13('0x47')]({'where':{'id':_0x11875d[_0xbb13('0x44')]['id']}})[_0xbb13('0x21')](handleEntityNotFound(_0x2d7716,null))[_0xbb13('0x21')](removeEntity(_0x2d7716,null))[_0xbb13('0x42')](handleError(_0x2d7716,null));};exports[_0xbb13('0x4a')]=function(_0x1d1f6c,_0x3776d9){return db[_0xbb13('0x28')][_0xbb13('0x4a')]()[_0xbb13('0x21')](respondWithResult(_0x3776d9,null))[_0xbb13('0x42')](handleError(_0x3776d9,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 68b7617..25b13f6 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 _0x3844=['./openchannelTransferReport.attributes','define','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment'];(function(_0x3f2062,_0x5c86ac){var _0x57dd05=function(_0x197478){while(--_0x197478){_0x3f2062['push'](_0x3f2062['shift']());}};_0x57dd05(++_0x5c86ac);}(_0x3844,0xb4));var _0x4384=function(_0x1622ab,_0x439ea5){_0x1622ab=_0x1622ab-0x0;var _0x1db242=_0x3844[_0x1622ab];return _0x1db242;};'use strict';var _=require(_0x4384('0x0'));var util=require(_0x4384('0x1'));var logger=require(_0x4384('0x2'))('api');var moment=require(_0x4384('0x3'));var BPromise=require('bluebird');var rp=require(_0x4384('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4384('0x5'));var config=require(_0x4384('0x6'));var attributes=require(_0x4384('0x7'));module['exports']=function(_0x1e1d50,_0x257cde){return _0x1e1d50[_0x4384('0x8')]('OpenchannelTransferReport',attributes,{'tableName':_0x4384('0x9'),'paranoid':![],'indexes':[{'name':_0x4384('0xa'),'fields':[_0x4384('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7c5c=['OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define'];(function(_0x597270,_0x202101){var _0x588c22=function(_0xa09b06){while(--_0xa09b06){_0x597270['push'](_0x597270['shift']());}};_0x588c22(++_0x202101);}(_0x7c5c,0xd5));var _0xc7c5=function(_0x580ff7,_0x3a2698){_0x580ff7=_0x580ff7-0x0;var _0x50201c=_0x7c5c[_0x580ff7];return _0x50201c;};'use strict';var _=require(_0xc7c5('0x0'));var util=require(_0xc7c5('0x1'));var logger=require(_0xc7c5('0x2'))('api');var moment=require(_0xc7c5('0x3'));var BPromise=require(_0xc7c5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc7c5('0x5'));var rimraf=require(_0xc7c5('0x6'));var config=require(_0xc7c5('0x7'));var attributes=require(_0xc7c5('0x8'));module[_0xc7c5('0x9')]=function(_0x40118a,_0x186348){return _0x40118a[_0xc7c5('0xa')](_0xc7c5('0xb'),attributes,{'tableName':_0xc7c5('0xc'),'paranoid':![],'indexes':[{'name':_0xc7c5('0xd'),'fields':[_0xc7c5('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index b8a4a7e..354fe26 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 _0x004c=['rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x410b0b,_0x4e4d91){var _0x315c91=function(_0x3a4521){while(--_0x3a4521){_0x410b0b['push'](_0x410b0b['shift']());}};_0x315c91(++_0x4e4d91);}(_0x004c,0x1de));var _0xc004=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x004c[_0x5f309e];return _0x487b5e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc004('0x0'));var BPromise=require(_0xc004('0x1'));var rs=require(_0xc004('0x2'));var fs=require('fs');var Redis=require(_0xc004('0x3'));var db=require(_0xc004('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc004('0x5'))(_0xc004('0x6'));var config=require('../../config/environment');var jayson=require(_0xc004('0x7'));var client=jayson[_0xc004('0x8')][_0xc004('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1cabfe,_0x3511a2,_0x3f1f44){return new BPromise(function(_0x2abbfd,_0x1dfeb7){return client[_0xc004('0xa')](_0x1cabfe,_0x3f1f44)[_0xc004('0xb')](function(_0x41b838){logger[_0xc004('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x3511a2,_0xc004('0xd'));logger[_0xc004('0xe')](_0xc004('0xf'),_0x3511a2,_0xc004('0xd'),JSON['stringify'](_0x41b838));if(_0x41b838['error']){if(_0x41b838[_0xc004('0x10')][_0xc004('0x11')]===0x1f4){logger['error'](_0xc004('0x12'),_0x3511a2,_0x41b838[_0xc004('0x10')][_0xc004('0x13')]);return _0x1dfeb7(_0x41b838[_0xc004('0x10')]['message']);}logger[_0xc004('0x10')](_0xc004('0x12'),_0x3511a2,_0x41b838[_0xc004('0x10')][_0xc004('0x13')]);return _0x2abbfd(_0x41b838[_0xc004('0x10')][_0xc004('0x13')]);}else{logger[_0xc004('0xc')](_0xc004('0x12'),_0x3511a2,'request\x20sent');_0x2abbfd(_0x41b838[_0xc004('0x14')][_0xc004('0x13')]);}})[_0xc004('0x15')](function(_0xfa0527){logger[_0xc004('0x10')](_0xc004('0x12'),_0x3511a2,_0xfa0527);_0x1dfeb7(_0xfa0527);});});} \ No newline at end of file +var _0x794c=['http','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client'];(function(_0x108a58,_0x129a26){var _0x455846=function(_0x476bc8){while(--_0x476bc8){_0x108a58['push'](_0x108a58['shift']());}};_0x455846(++_0x129a26);}(_0x794c,0x199));var _0xc794=function(_0x456a4b,_0x51df8){_0x456a4b=_0x456a4b-0x0;var _0x42957c=_0x794c[_0x456a4b];return _0x42957c;};'use strict';var _=require('lodash');var util=require(_0xc794('0x0'));var moment=require(_0xc794('0x1'));var BPromise=require('bluebird');var rs=require(_0xc794('0x2'));var fs=require('fs');var Redis=require(_0xc794('0x3'));var db=require(_0xc794('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc794('0x5'))(_0xc794('0x6'));var config=require('../../config/environment');var jayson=require(_0xc794('0x7'));var client=jayson[_0xc794('0x8')][_0xc794('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5275e5,_0x54cf10,_0x43c575){return new BPromise(function(_0x5759b0,_0x4e0eff){return client['request'](_0x5275e5,_0x43c575)[_0xc794('0xa')](function(_0x4e5137){logger[_0xc794('0xb')](_0xc794('0xc'),_0x54cf10,_0xc794('0xd'));logger[_0xc794('0xe')](_0xc794('0xf'),_0x54cf10,_0xc794('0xd'),JSON[_0xc794('0x10')](_0x4e5137));if(_0x4e5137[_0xc794('0x11')]){if(_0x4e5137['error'][_0xc794('0x12')]===0x1f4){logger[_0xc794('0x11')](_0xc794('0xc'),_0x54cf10,_0x4e5137[_0xc794('0x11')][_0xc794('0x13')]);return _0x4e0eff(_0x4e5137[_0xc794('0x11')]['message']);}logger['error'](_0xc794('0xc'),_0x54cf10,_0x4e5137[_0xc794('0x11')][_0xc794('0x13')]);return _0x5759b0(_0x4e5137[_0xc794('0x11')][_0xc794('0x13')]);}else{logger[_0xc794('0xb')](_0xc794('0xc'),_0x54cf10,_0xc794('0xd'));_0x5759b0(_0x4e5137[_0xc794('0x14')][_0xc794('0x13')]);}})[_0xc794('0x15')](function(_0x50e303){logger[_0xc794('0x11')](_0xc794('0xc'),_0x54cf10,_0x50e303);_0x4e0eff(_0x50e303);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 90ac7c8..543dbe1 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 _0x1339=['util','connect-timeout','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','update','delete','multer'];(function(_0x98661,_0x1459f3){var _0x42a4e3=function(_0x490faf){while(--_0x490faf){_0x98661['push'](_0x98661['shift']());}};_0x42a4e3(++_0x1459f3);}(_0x1339,0x1bf));var _0x9133=function(_0x38b273,_0x4db0ff){_0x38b273=_0x38b273-0x0;var _0x49c8a8=_0x1339[_0x38b273];return _0x49c8a8;};'use strict';var multer=require(_0x9133('0x0'));var util=require(_0x9133('0x1'));var path=require('path');var timeout=require(_0x9133('0x2'));var express=require(_0x9133('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x9133('0x4'));var config=require(_0x9133('0x5'));var controller=require('./pause.controller');router[_0x9133('0x6')]('/',auth[_0x9133('0x7')](),controller[_0x9133('0x8')]);router[_0x9133('0x6')](_0x9133('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x9133('0xa')]('/',auth['isAuthenticated'](),controller[_0x9133('0xb')]);router['put'](_0x9133('0x9'),auth['isAuthenticated'](),controller[_0x9133('0xc')]);router[_0x9133('0xd')](_0x9133('0x9'),auth[_0x9133('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd4bd=['get','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller'];(function(_0x440f1b,_0x7fb14b){var _0x1b2276=function(_0x365808){while(--_0x365808){_0x440f1b['push'](_0x440f1b['shift']());}};_0x1b2276(++_0x7fb14b);}(_0xd4bd,0x15f));var _0xdd4b=function(_0x47db2e,_0x41b2e3){_0x47db2e=_0x47db2e-0x0;var _0x467df3=_0xd4bd[_0x47db2e];return _0x467df3;};'use strict';var multer=require(_0xdd4b('0x0'));var util=require(_0xdd4b('0x1'));var path=require(_0xdd4b('0x2'));var timeout=require(_0xdd4b('0x3'));var express=require(_0xdd4b('0x4'));var router=express['Router']();var auth=require(_0xdd4b('0x5'));var interaction=require(_0xdd4b('0x6'));var config=require(_0xdd4b('0x7'));var controller=require(_0xdd4b('0x8'));router[_0xdd4b('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xdd4b('0x9')]('/:id',auth[_0xdd4b('0xa')](),controller[_0xdd4b('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xdd4b('0xc')]);router[_0xdd4b('0xd')]('/:id',auth[_0xdd4b('0xa')](),controller[_0xdd4b('0xe')]);router[_0xdd4b('0xf')]('/:id',auth[_0xdd4b('0xa')](),controller[_0xdd4b('0x10')]);module[_0xdd4b('0x11')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index bdab802..5195604 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 _0x7f79=['name','sequelize','exports','STRING'];(function(_0x5be0e3,_0x13780b){var _0x192031=function(_0x22623b){while(--_0x22623b){_0x5be0e3['push'](_0x5be0e3['shift']());}};_0x192031(++_0x13780b);}(_0x7f79,0xdd));var _0x97f7=function(_0x4b1896,_0x22699e){_0x4b1896=_0x4b1896-0x0;var _0x1f89f9=_0x7f79[_0x4b1896];return _0x1f89f9;};'use strict';var Sequelize=require(_0x97f7('0x0'));module[_0x97f7('0x1')]={'name':{'type':Sequelize[_0x97f7('0x2')],'unique':_0x97f7('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x89e6=['STRING','name','sequelize','exports'];(function(_0x2811b1,_0x33eb2b){var _0x481c60=function(_0x3ef2d0){while(--_0x3ef2d0){_0x2811b1['push'](_0x2811b1['shift']());}};_0x481c60(++_0x33eb2b);}(_0x89e6,0xb6));var _0x689e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x89e6[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x689e('0x0'));module[_0x689e('0x1')]={'name':{'type':Sequelize[_0x689e('0x2')],'unique':_0x689e('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index fc762a9..b535ba1 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 _0xe593=['sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','update','then','destroy','get','Pauses','UserProfileResource','error','stack','name','index','Pause','rawAttributes','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','map','type','key','VIRTUAL','field','filter','merge','includeAll','include','rows','catch','show','params','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x22013f,_0x962f82){var _0x544531=function(_0x38deb9){while(--_0x38deb9){_0x22013f['push'](_0x22013f['shift']());}};_0x544531(++_0x962f82);}(_0xe593,0x139));var _0x3e59=function(_0x264c88,_0x31d1c7){_0x264c88=_0x264c88-0x0;var _0x4b6a03=_0xe593[_0x264c88];return _0x4b6a03;};'use strict';var pdf=require(_0x3e59('0x0'));var emlformat=require(_0x3e59('0x1'));var rimraf=require(_0x3e59('0x2'));var zipdir=require(_0x3e59('0x3'));var jsonpatch=require(_0x3e59('0x4'));var rp=require(_0x3e59('0x5'));var moment=require(_0x3e59('0x6'));var BPromise=require(_0x3e59('0x7'));var Mustache=require(_0x3e59('0x8'));var util=require(_0x3e59('0x9'));var path=require(_0x3e59('0xa'));var sox=require('sox');var csv=require(_0x3e59('0xb'));var ejs=require(_0x3e59('0xc'));var fs=require('fs');var _=require(_0x3e59('0xd'));var squel=require(_0x3e59('0xe'));var crypto=require(_0x3e59('0xf'));var jsforce=require(_0x3e59('0x10'));var deskjs=require(_0x3e59('0x11'));var toCsv=require(_0x3e59('0xb'));var querystring=require('querystring');var Papa=require(_0x3e59('0x12'));var Redis=require(_0x3e59('0x13'));var authService=require(_0x3e59('0x14'));var qs=require(_0x3e59('0x15'));var hardwareService=require(_0x3e59('0x16'));var logger=require('../../config/logger')(_0x3e59('0x17'));var utils=require(_0x3e59('0x18'));var config=require(_0x3e59('0x19'));var db=require(_0x3e59('0x1a'))['db'];function respondWithStatusCode(_0x5ccb36,_0x3c740f){_0x3c740f=_0x3c740f||0xcc;return function(_0x5c8861){if(_0x5c8861){return _0x5ccb36[_0x3e59('0x1b')](_0x3c740f);}return _0x5ccb36[_0x3e59('0x1c')](_0x3c740f)[_0x3e59('0x1d')]();};}function respondWithResult(_0xe5273b,_0x3017b4){_0x3017b4=_0x3017b4||0xc8;return function(_0x574d72){if(_0x574d72){return _0xe5273b[_0x3e59('0x1c')](_0x3017b4)[_0x3e59('0x1e')](_0x574d72);}};}function respondWithFilteredResult(_0x5228c6,_0x414bb8){return function(_0x4f99ed){if(_0x4f99ed){var _0x76ac58=_0x4f99ed[_0x3e59('0x1f')],_0x5b0d1b=_0x414bb8[_0x3e59('0x20')],_0x360b34=_0x414bb8[_0x3e59('0x20')]+_0x414bb8[_0x3e59('0x21')],_0x5cf00a;if(_0x360b34>=_0x76ac58){_0x360b34=_0x76ac58;_0x5cf00a=0xc8;}else{_0x5cf00a=0xce;}_0x5228c6[_0x3e59('0x1c')](_0x5cf00a);return _0x5228c6['set'](_0x3e59('0x22'),_0x5b0d1b+'-'+_0x360b34+'/'+_0x76ac58)[_0x3e59('0x1e')](_0x4f99ed);}return null;};}function patchUpdates(_0xca60b8){return function(_0x587ea3){try{jsonpatch[_0x3e59('0x23')](_0x587ea3,_0xca60b8,!![]);}catch(_0xb7608){return BPromise['reject'](_0xb7608);}return _0x587ea3[_0x3e59('0x24')]();};}function saveUpdates(_0x22bf4,_0x3a065a){return function(_0x2df00f){if(_0x2df00f){return _0x2df00f[_0x3e59('0x25')](_0x22bf4)[_0x3e59('0x26')](function(_0x1be8de){return _0x1be8de;});}return null;};}function removeEntity(_0x1c30d1,_0x546fea){return function(_0x2f5403){if(_0x2f5403){return _0x2f5403[_0x3e59('0x27')]()['then'](function(){var _0x5d145f=_0x2f5403[_0x3e59('0x28')]({'plain':!![]});var _0x5af688=_0x3e59('0x29');return db[_0x3e59('0x2a')]['destroy']({'where':{'type':_0x5af688,'resourceId':_0x5d145f['id']}})[_0x3e59('0x26')](function(){return _0x2f5403;});})[_0x3e59('0x26')](function(){_0x1c30d1[_0x3e59('0x1c')](0xcc)[_0x3e59('0x1d')]();});}};}function handleEntityNotFound(_0x223bee,_0x3b7919){return function(_0x56344f){if(!_0x56344f){_0x223bee['sendStatus'](0x194);}return _0x56344f;};}function handleError(_0x219ea7,_0x27d483){_0x27d483=_0x27d483||0x1f4;return function(_0x29532c){logger[_0x3e59('0x2b')](_0x29532c[_0x3e59('0x2c')]);if(_0x29532c[_0x3e59('0x2d')]){delete _0x29532c[_0x3e59('0x2d')];}_0x219ea7[_0x3e59('0x1c')](_0x27d483)['send'](_0x29532c);};}exports[_0x3e59('0x2e')]=function(_0x17b7fc,_0x152721){var _0x56d3cc={},_0x592e4a={},_0x417425={'count':0x0,'rows':[]};var _0x279c19=db[_0x3e59('0x2f')][_0x3e59('0x30')];_0x592e4a[_0x3e59('0x31')]=_['keys'](_0x279c19);_0x592e4a[_0x3e59('0x32')]=_['keys'](_0x17b7fc[_0x3e59('0x32')]);_0x592e4a['filters']=_['intersection'](_0x592e4a[_0x3e59('0x31')],_0x592e4a[_0x3e59('0x32')]);_0x56d3cc[_0x3e59('0x33')]=_[_0x3e59('0x34')](_0x592e4a[_0x3e59('0x31')],qs[_0x3e59('0x35')](_0x17b7fc[_0x3e59('0x32')]['fields']));_0x56d3cc[_0x3e59('0x33')]=_0x56d3cc[_0x3e59('0x33')][_0x3e59('0x36')]?_0x56d3cc[_0x3e59('0x33')]:_0x592e4a[_0x3e59('0x31')];if(!_0x17b7fc['query'][_0x3e59('0x37')](_0x3e59('0x38'))){_0x56d3cc[_0x3e59('0x21')]=qs[_0x3e59('0x21')](_0x17b7fc['query'][_0x3e59('0x21')]);_0x56d3cc[_0x3e59('0x20')]=qs[_0x3e59('0x20')](_0x17b7fc[_0x3e59('0x32')][_0x3e59('0x20')]);}_0x56d3cc[_0x3e59('0x39')]=qs[_0x3e59('0x3a')](_0x17b7fc[_0x3e59('0x32')][_0x3e59('0x3a')]);_0x56d3cc[_0x3e59('0x3b')]=qs[_0x3e59('0x3c')](_['pick'](_0x17b7fc['query'],_0x592e4a[_0x3e59('0x3c')]));if(_0x17b7fc[_0x3e59('0x32')]['filter']){_0x56d3cc[_0x3e59('0x3b')]=_['merge'](_0x56d3cc[_0x3e59('0x3b')],{'$or':_[_0x3e59('0x3d')](_0x279c19,function(_0x24e7c3){if(_0x24e7c3[_0x3e59('0x3e')][_0x3e59('0x3f')]!==_0x3e59('0x40')){var _0x1990f8={};_0x1990f8[_0x24e7c3[_0x3e59('0x41')]]={'$like':'%'+_0x17b7fc[_0x3e59('0x32')][_0x3e59('0x42')]+'%'};return _0x1990f8;}})});}_0x56d3cc=_[_0x3e59('0x43')]({},_0x56d3cc,_0x17b7fc['options']);var _0x29ae7f={'where':_0x56d3cc[_0x3e59('0x3b')]};return db['Pause'][_0x3e59('0x1f')](_0x29ae7f)['then'](function(_0x3179a9){_0x417425[_0x3e59('0x1f')]=_0x3179a9;if(_0x17b7fc[_0x3e59('0x32')][_0x3e59('0x44')]){_0x56d3cc[_0x3e59('0x45')]=[{'all':!![]}];}return db[_0x3e59('0x2f')]['findAll'](_0x56d3cc);})[_0x3e59('0x26')](function(_0x253ebf){_0x417425[_0x3e59('0x46')]=_0x253ebf;return _0x417425;})[_0x3e59('0x26')](respondWithFilteredResult(_0x152721,_0x56d3cc))[_0x3e59('0x47')](handleError(_0x152721,null));};exports[_0x3e59('0x48')]=function(_0x4b430f,_0x503993){var _0x1bbe6b={'raw':!![],'where':{'id':_0x4b430f[_0x3e59('0x49')]['id']}},_0xca3b9b={};_0xca3b9b[_0x3e59('0x31')]=_['keys'](db['Pause'][_0x3e59('0x30')]);_0xca3b9b[_0x3e59('0x32')]=_[_0x3e59('0x4a')](_0x4b430f[_0x3e59('0x32')]);_0xca3b9b['filters']=_['intersection'](_0xca3b9b['model'],_0xca3b9b['query']);_0x1bbe6b['attributes']=_[_0x3e59('0x34')](_0xca3b9b[_0x3e59('0x31')],qs[_0x3e59('0x35')](_0x4b430f[_0x3e59('0x32')][_0x3e59('0x35')]));_0x1bbe6b[_0x3e59('0x33')]=_0x1bbe6b['attributes'][_0x3e59('0x36')]?_0x1bbe6b['attributes']:_0xca3b9b['model'];if(_0x4b430f[_0x3e59('0x32')][_0x3e59('0x44')]){_0x1bbe6b[_0x3e59('0x45')]=[{'all':!![]}];}_0x1bbe6b=_[_0x3e59('0x43')]({},_0x1bbe6b,_0x4b430f[_0x3e59('0x4b')]);return db[_0x3e59('0x2f')][_0x3e59('0x4c')](_0x1bbe6b)[_0x3e59('0x26')](handleEntityNotFound(_0x503993,null))[_0x3e59('0x26')](respondWithResult(_0x503993,null))[_0x3e59('0x47')](handleError(_0x503993,null));};exports[_0x3e59('0x4d')]=function(_0x424d78,_0x374cdd){return db[_0x3e59('0x2f')]['create'](_0x424d78[_0x3e59('0x4e')],{})[_0x3e59('0x26')](function(_0x4e87a3){var _0x10305f=_0x424d78[_0x3e59('0x4f')]['get']({'plain':!![]});if(!_0x10305f)throw new Error(_0x3e59('0x50'));if(_0x10305f[_0x3e59('0x51')]===_0x3e59('0x4f')){var _0x162c12=_0x4e87a3[_0x3e59('0x28')]({'plain':!![]});var _0x5bcc02=_0x3e59('0x29');return db[_0x3e59('0x52')][_0x3e59('0x4c')]({'where':{'name':_0x5bcc02,'userProfileId':_0x10305f[_0x3e59('0x53')]},'raw':!![]})[_0x3e59('0x26')](function(_0x5b8be1){if(_0x5b8be1&&_0x5b8be1['autoAssociation']===0x0){return db[_0x3e59('0x2a')][_0x3e59('0x4d')]({'name':_0x162c12['name'],'resourceId':_0x162c12['id'],'type':_0x5b8be1[_0x3e59('0x2d')],'sectionId':_0x5b8be1['id']},{})[_0x3e59('0x26')](function(){return _0x4e87a3;});}else{return _0x4e87a3;}})[_0x3e59('0x47')](function(_0x5a6217){logger[_0x3e59('0x2b')](_0x3e59('0x54'),_0x5a6217);throw _0x5a6217;});}return _0x4e87a3;})[_0x3e59('0x26')](respondWithResult(_0x374cdd,0xc9))[_0x3e59('0x47')](handleError(_0x374cdd,null));};exports[_0x3e59('0x25')]=function(_0x42cf4e,_0x3fa371){if(_0x42cf4e[_0x3e59('0x4e')]['id']){delete _0x42cf4e[_0x3e59('0x4e')]['id'];}return db['Pause']['find']({'where':{'id':_0x42cf4e['params']['id']}})[_0x3e59('0x26')](handleEntityNotFound(_0x3fa371,null))[_0x3e59('0x26')](saveUpdates(_0x42cf4e[_0x3e59('0x4e')],null))['then'](respondWithResult(_0x3fa371,null))[_0x3e59('0x47')](handleError(_0x3fa371,null));};exports['destroy']=function(_0x2d63db,_0x422eed){return db[_0x3e59('0x2f')][_0x3e59('0x4c')]({'where':{'id':_0x2d63db['params']['id']}})[_0x3e59('0x26')](handleEntityNotFound(_0x422eed,null))['then'](removeEntity(_0x422eed,null))[_0x3e59('0x47')](handleError(_0x422eed,null));}; \ No newline at end of file +var _0x2546=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','moment','mustache','path','to-csv','ejs','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','end','status','count','limit','set','Content-Range','json','apply','reject','update','then','destroy','get','Pauses','UserProfileResource','sendStatus','error','stack','name','send','Pause','rawAttributes','keys','query','filters','model','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','pick','where','merge','map','type','key','VIRTUAL','field','filter','options','includeAll','include','rows','catch','intersection','find','create','body'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x2546,0x9d));var _0x6254=function(_0x4bb270,_0x3ff472){_0x4bb270=_0x4bb270-0x0;var _0x28c8cf=_0x2546[_0x4bb270];return _0x28c8cf;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6254('0x0'));var rimraf=require(_0x6254('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6254('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x6254('0x3'));var util=require('util');var path=require(_0x6254('0x4'));var sox=require('sox');var csv=require(_0x6254('0x5'));var ejs=require(_0x6254('0x6'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6254('0x7'));var jsforce=require(_0x6254('0x8'));var deskjs=require(_0x6254('0x9'));var toCsv=require(_0x6254('0x5'));var querystring=require('querystring');var Papa=require(_0x6254('0xa'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6254('0xb'));var hardwareService=require(_0x6254('0xc'));var logger=require(_0x6254('0xd'))(_0x6254('0xe'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x6254('0xf'))['db'];function respondWithStatusCode(_0x241d6c,_0x8aaeb7){_0x8aaeb7=_0x8aaeb7||0xcc;return function(_0x23f11f){if(_0x23f11f){return _0x241d6c['sendStatus'](_0x8aaeb7);}return _0x241d6c['status'](_0x8aaeb7)[_0x6254('0x10')]();};}function respondWithResult(_0x550768,_0x278e1b){_0x278e1b=_0x278e1b||0xc8;return function(_0x142320){if(_0x142320){return _0x550768[_0x6254('0x11')](_0x278e1b)['json'](_0x142320);}};}function respondWithFilteredResult(_0x5ce611,_0x2ff65c){return function(_0x256e12){if(_0x256e12){var _0x3d2913=_0x256e12[_0x6254('0x12')],_0x3a8736=_0x2ff65c['offset'],_0x559d9c=_0x2ff65c['offset']+_0x2ff65c[_0x6254('0x13')],_0x74ffe3;if(_0x559d9c>=_0x3d2913){_0x559d9c=_0x3d2913;_0x74ffe3=0xc8;}else{_0x74ffe3=0xce;}_0x5ce611[_0x6254('0x11')](_0x74ffe3);return _0x5ce611[_0x6254('0x14')](_0x6254('0x15'),_0x3a8736+'-'+_0x559d9c+'/'+_0x3d2913)[_0x6254('0x16')](_0x256e12);}return null;};}function patchUpdates(_0x5588ff){return function(_0x30fed4){try{jsonpatch[_0x6254('0x17')](_0x30fed4,_0x5588ff,!![]);}catch(_0x18418f){return BPromise[_0x6254('0x18')](_0x18418f);}return _0x30fed4['save']();};}function saveUpdates(_0x1e58a6,_0x4a835b){return function(_0x2817c7){if(_0x2817c7){return _0x2817c7[_0x6254('0x19')](_0x1e58a6)[_0x6254('0x1a')](function(_0x499f43){return _0x499f43;});}return null;};}function removeEntity(_0x4467a9,_0x2f5e47){return function(_0xb51375){if(_0xb51375){return _0xb51375[_0x6254('0x1b')]()['then'](function(){var _0x4b7aee=_0xb51375[_0x6254('0x1c')]({'plain':!![]});var _0x1ea6e9=_0x6254('0x1d');return db[_0x6254('0x1e')][_0x6254('0x1b')]({'where':{'type':_0x1ea6e9,'resourceId':_0x4b7aee['id']}})[_0x6254('0x1a')](function(){return _0xb51375;});})[_0x6254('0x1a')](function(){_0x4467a9[_0x6254('0x11')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf07282,_0x39e0c5){return function(_0xcfe10b){if(!_0xcfe10b){_0xf07282[_0x6254('0x1f')](0x194);}return _0xcfe10b;};}function handleError(_0x5ea99f,_0x80a256){_0x80a256=_0x80a256||0x1f4;return function(_0xc602eb){logger[_0x6254('0x20')](_0xc602eb[_0x6254('0x21')]);if(_0xc602eb['name']){delete _0xc602eb[_0x6254('0x22')];}_0x5ea99f['status'](_0x80a256)[_0x6254('0x23')](_0xc602eb);};}exports['index']=function(_0xb9ec58,_0x5abffb){var _0x55a8ef={},_0x417a02={},_0x57e160={'count':0x0,'rows':[]};var _0x57c522=db[_0x6254('0x24')][_0x6254('0x25')];_0x417a02['model']=_['keys'](_0x57c522);_0x417a02['query']=_[_0x6254('0x26')](_0xb9ec58[_0x6254('0x27')]);_0x417a02[_0x6254('0x28')]=_['intersection'](_0x417a02[_0x6254('0x29')],_0x417a02['query']);_0x55a8ef[_0x6254('0x2a')]=_['intersection'](_0x417a02[_0x6254('0x29')],qs[_0x6254('0x2b')](_0xb9ec58[_0x6254('0x27')][_0x6254('0x2b')]));_0x55a8ef[_0x6254('0x2a')]=_0x55a8ef['attributes'][_0x6254('0x2c')]?_0x55a8ef['attributes']:_0x417a02[_0x6254('0x29')];if(!_0xb9ec58[_0x6254('0x27')][_0x6254('0x2d')](_0x6254('0x2e'))){_0x55a8ef[_0x6254('0x13')]=qs[_0x6254('0x13')](_0xb9ec58[_0x6254('0x27')][_0x6254('0x13')]);_0x55a8ef[_0x6254('0x2f')]=qs[_0x6254('0x2f')](_0xb9ec58[_0x6254('0x27')][_0x6254('0x2f')]);}_0x55a8ef[_0x6254('0x30')]=qs[_0x6254('0x31')](_0xb9ec58['query'][_0x6254('0x31')]);_0x55a8ef['where']=qs[_0x6254('0x28')](_[_0x6254('0x32')](_0xb9ec58[_0x6254('0x27')],_0x417a02[_0x6254('0x28')]));if(_0xb9ec58[_0x6254('0x27')]['filter']){_0x55a8ef[_0x6254('0x33')]=_[_0x6254('0x34')](_0x55a8ef['where'],{'$or':_[_0x6254('0x35')](_0x57c522,function(_0x2c4160){if(_0x2c4160[_0x6254('0x36')][_0x6254('0x37')]!==_0x6254('0x38')){var _0x1c8d1e={};_0x1c8d1e[_0x2c4160[_0x6254('0x39')]]={'$like':'%'+_0xb9ec58['query'][_0x6254('0x3a')]+'%'};return _0x1c8d1e;}})});}_0x55a8ef=_[_0x6254('0x34')]({},_0x55a8ef,_0xb9ec58[_0x6254('0x3b')]);var _0x44eaad={'where':_0x55a8ef[_0x6254('0x33')]};return db[_0x6254('0x24')][_0x6254('0x12')](_0x44eaad)[_0x6254('0x1a')](function(_0x28983d){_0x57e160['count']=_0x28983d;if(_0xb9ec58['query'][_0x6254('0x3c')]){_0x55a8ef[_0x6254('0x3d')]=[{'all':!![]}];}return db['Pause']['findAll'](_0x55a8ef);})[_0x6254('0x1a')](function(_0x3ccc88){_0x57e160[_0x6254('0x3e')]=_0x3ccc88;return _0x57e160;})['then'](respondWithFilteredResult(_0x5abffb,_0x55a8ef))[_0x6254('0x3f')](handleError(_0x5abffb,null));};exports['show']=function(_0x32d6c6,_0x58a059){var _0x43755d={'raw':!![],'where':{'id':_0x32d6c6['params']['id']}},_0x17da4c={};_0x17da4c['model']=_['keys'](db['Pause']['rawAttributes']);_0x17da4c[_0x6254('0x27')]=_['keys'](_0x32d6c6[_0x6254('0x27')]);_0x17da4c[_0x6254('0x28')]=_['intersection'](_0x17da4c[_0x6254('0x29')],_0x17da4c[_0x6254('0x27')]);_0x43755d['attributes']=_[_0x6254('0x40')](_0x17da4c[_0x6254('0x29')],qs[_0x6254('0x2b')](_0x32d6c6['query']['fields']));_0x43755d[_0x6254('0x2a')]=_0x43755d[_0x6254('0x2a')][_0x6254('0x2c')]?_0x43755d[_0x6254('0x2a')]:_0x17da4c['model'];if(_0x32d6c6[_0x6254('0x27')][_0x6254('0x3c')]){_0x43755d[_0x6254('0x3d')]=[{'all':!![]}];}_0x43755d=_[_0x6254('0x34')]({},_0x43755d,_0x32d6c6[_0x6254('0x3b')]);return db['Pause'][_0x6254('0x41')](_0x43755d)[_0x6254('0x1a')](handleEntityNotFound(_0x58a059,null))['then'](respondWithResult(_0x58a059,null))[_0x6254('0x3f')](handleError(_0x58a059,null));};exports[_0x6254('0x42')]=function(_0x28f724,_0x27a40c){return db['Pause']['create'](_0x28f724[_0x6254('0x43')],{})[_0x6254('0x1a')](function(_0x5ad9c8){var _0x48cadf=_0x28f724[_0x6254('0x44')][_0x6254('0x1c')]({'plain':!![]});if(!_0x48cadf)throw new Error(_0x6254('0x45'));if(_0x48cadf[_0x6254('0x46')]==='user'){var _0x23f258=_0x5ad9c8[_0x6254('0x1c')]({'plain':!![]});var _0x129401=_0x6254('0x1d');return db[_0x6254('0x47')][_0x6254('0x41')]({'where':{'name':_0x129401,'userProfileId':_0x48cadf[_0x6254('0x48')]},'raw':!![]})[_0x6254('0x1a')](function(_0x1ba33b){if(_0x1ba33b&&_0x1ba33b['autoAssociation']===0x0){return db[_0x6254('0x1e')]['create']({'name':_0x23f258['name'],'resourceId':_0x23f258['id'],'type':_0x1ba33b[_0x6254('0x22')],'sectionId':_0x1ba33b['id']},{})['then'](function(){return _0x5ad9c8;});}else{return _0x5ad9c8;}})[_0x6254('0x3f')](function(_0x321308){logger[_0x6254('0x20')](_0x6254('0x49'),_0x321308);throw _0x321308;});}return _0x5ad9c8;})[_0x6254('0x1a')](respondWithResult(_0x27a40c,0xc9))[_0x6254('0x3f')](handleError(_0x27a40c,null));};exports['update']=function(_0x3c78eb,_0x24767c){if(_0x3c78eb['body']['id']){delete _0x3c78eb['body']['id'];}return db[_0x6254('0x24')][_0x6254('0x41')]({'where':{'id':_0x3c78eb[_0x6254('0x4a')]['id']}})[_0x6254('0x1a')](handleEntityNotFound(_0x24767c,null))[_0x6254('0x1a')](saveUpdates(_0x3c78eb[_0x6254('0x43')],null))[_0x6254('0x1a')](respondWithResult(_0x24767c,null))['catch'](handleError(_0x24767c,null));};exports[_0x6254('0x1b')]=function(_0x3dacef,_0x5b5a20){return db[_0x6254('0x24')][_0x6254('0x41')]({'where':{'id':_0x3dacef['params']['id']}})[_0x6254('0x1a')](handleEntityNotFound(_0x5b5a20,null))[_0x6254('0x1a')](removeEntity(_0x5b5a20,null))['catch'](handleError(_0x5b5a20,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 6e97d87..8255d95 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 _0xa478=['define','Pause','tools_pauses','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./pause.attributes'];(function(_0x395f72,_0xee1c2e){var _0x3821ae=function(_0x57be07){while(--_0x57be07){_0x395f72['push'](_0x395f72['shift']());}};_0x3821ae(++_0xee1c2e);}(_0xa478,0x137));var _0x8a47=function(_0x4f57e4,_0x18914d){_0x4f57e4=_0x4f57e4-0x0;var _0x4a584c=_0xa478[_0x4f57e4];return _0x4a584c;};'use strict';var _=require('lodash');var util=require(_0x8a47('0x0'));var logger=require('../../config/logger')(_0x8a47('0x1'));var moment=require(_0x8a47('0x2'));var BPromise=require(_0x8a47('0x3'));var rp=require(_0x8a47('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8a47('0x5'));var config=require(_0x8a47('0x6'));var attributes=require(_0x8a47('0x7'));module['exports']=function(_0x55cf46,_0x147a66){return _0x55cf46[_0x8a47('0x8')](_0x8a47('0x9'),attributes,{'tableName':_0x8a47('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfbd0=['bluebird','request-promise','path','rimraf','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','../../config/logger','moment'];(function(_0x8395f6,_0x512573){var _0x360395=function(_0x5544eb){while(--_0x5544eb){_0x8395f6['push'](_0x8395f6['shift']());}};_0x360395(++_0x512573);}(_0xfbd0,0x8b));var _0x0fbd=function(_0x1a5cd7,_0x3811e9){_0x1a5cd7=_0x1a5cd7-0x0;var _0x399402=_0xfbd0[_0x1a5cd7];return _0x399402;};'use strict';var _=require(_0x0fbd('0x0'));var util=require(_0x0fbd('0x1'));var logger=require(_0x0fbd('0x2'))('api');var moment=require(_0x0fbd('0x3'));var BPromise=require(_0x0fbd('0x4'));var rp=require(_0x0fbd('0x5'));var fs=require('fs');var path=require(_0x0fbd('0x6'));var rimraf=require(_0x0fbd('0x7'));var config=require('../../config/environment');var attributes=require(_0x0fbd('0x8'));module[_0x0fbd('0x9')]=function(_0x2008c3,_0x1ec50e){return _0x2008c3[_0x0fbd('0xa')](_0x0fbd('0xb'),attributes,{'tableName':_0x0fbd('0xc'),'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 b4a2b59..734aa22 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 _0x239c=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','Pause,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','ShowPause','find','options','where','attributes','include','map','model','then','lodash'];(function(_0x49ab61,_0x265d76){var _0x1dea2f=function(_0x4c0d96){while(--_0x4c0d96){_0x49ab61['push'](_0x49ab61['shift']());}};_0x1dea2f(++_0x265d76);}(_0x239c,0x7b));var _0xc239=function(_0xf65dd3,_0x4a4884){_0xf65dd3=_0xf65dd3-0x0;var _0x1a8f99=_0x239c[_0xf65dd3];return _0x1a8f99;};'use strict';var _=require(_0xc239('0x0'));var util=require(_0xc239('0x1'));var moment=require(_0xc239('0x2'));var BPromise=require(_0xc239('0x3'));var rs=require(_0xc239('0x4'));var fs=require('fs');var Redis=require(_0xc239('0x5'));var db=require(_0xc239('0x6'))['db'];var utils=require(_0xc239('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xc239('0x8'));var jayson=require(_0xc239('0x9'));var client=jayson[_0xc239('0xa')][_0xc239('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52c41f,_0x5e6d22,_0x53f8c4){return new BPromise(function(_0x58c5b7,_0xb4899){return client[_0xc239('0xc')](_0x52c41f,_0x53f8c4)['then'](function(_0x1a05ee){logger['info'](_0xc239('0xd'),_0x5e6d22,_0xc239('0xe'));logger[_0xc239('0xf')]('Pause,\x20%s,\x20%s,\x20%s',_0x5e6d22,_0xc239('0xe'),JSON['stringify'](_0x1a05ee));if(_0x1a05ee[_0xc239('0x10')]){if(_0x1a05ee[_0xc239('0x10')][_0xc239('0x11')]===0x1f4){logger['error'](_0xc239('0xd'),_0x5e6d22,_0x1a05ee[_0xc239('0x10')]['message']);return _0xb4899(_0x1a05ee['error'][_0xc239('0x12')]);}logger['error'](_0xc239('0xd'),_0x5e6d22,_0x1a05ee[_0xc239('0x10')][_0xc239('0x12')]);return _0x58c5b7(_0x1a05ee['error']['message']);}else{logger[_0xc239('0x13')](_0xc239('0xd'),_0x5e6d22,_0xc239('0xe'));_0x58c5b7(_0x1a05ee[_0xc239('0x14')][_0xc239('0x12')]);}})[_0xc239('0x15')](function(_0x18e29c){logger[_0xc239('0x10')](_0xc239('0xd'),_0x5e6d22,_0x18e29c);_0xb4899(_0x18e29c);});});}exports[_0xc239('0x16')]=function(_0x4fa436){var _0x561f4c=this;return new Promise(function(_0x2d17af,_0x26f407){return db['Pause'][_0xc239('0x17')]({'raw':_0x4fa436[_0xc239('0x18')]?_0x4fa436[_0xc239('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4fa436[_0xc239('0x18')]?_0x4fa436[_0xc239('0x18')][_0xc239('0x19')]||null:null,'attributes':_0x4fa436[_0xc239('0x18')]?_0x4fa436[_0xc239('0x18')][_0xc239('0x1a')]||null:null,'include':_0x4fa436[_0xc239('0x18')]?_0x4fa436[_0xc239('0x18')][_0xc239('0x1b')]?_[_0xc239('0x1c')](_0x4fa436['options']['include'],function(_0x5e30a1){return{'model':db[_0x5e30a1[_0xc239('0x1d')]],'as':_0x5e30a1['as'],'attributes':_0x5e30a1[_0xc239('0x1a')],'include':_0x5e30a1[_0xc239('0x1b')]?_[_0xc239('0x1c')](_0x5e30a1[_0xc239('0x1b')],function(_0x16dbb4){return{'model':db[_0x16dbb4[_0xc239('0x1d')]],'as':_0x16dbb4['as'],'attributes':_0x16dbb4[_0xc239('0x1a')],'include':_0x16dbb4[_0xc239('0x1b')]?_[_0xc239('0x1c')](_0x16dbb4['include'],function(_0x24441d){return{'model':db[_0x24441d[_0xc239('0x1d')]],'as':_0x24441d['as'],'attributes':_0x24441d[_0xc239('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xc239('0x1e')](function(_0x3c0cbd){logger[_0xc239('0x13')](_0xc239('0x16'),_0x4fa436);logger['debug'](_0xc239('0x16'),_0x4fa436,JSON['stringify'](_0x3c0cbd));_0x2d17af(_0x3c0cbd);})['catch'](function(_0x4368a9){logger[_0xc239('0x10')](_0xc239('0x16'),_0x4368a9[_0xc239('0x12')],_0x4fa436);_0x26f407(_0x561f4c['error'](0x1f4,_0x4368a9[_0xc239('0x12')]));});});}; \ No newline at end of file +var _0x1417=['request','then','info','Pause,\x20%s,\x20%s','debug','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','ShowPause','Pause','options','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3adb96,_0x1f3dfc){var _0x4bfdb4=function(_0x30580a){while(--_0x30580a){_0x3adb96['push'](_0x3adb96['shift']());}};_0x4bfdb4(++_0x1f3dfc);}(_0x1417,0x17b));var _0x7141=function(_0x43795b,_0x4fe196){_0x43795b=_0x43795b-0x0;var _0x6b7c1f=_0x1417[_0x43795b];return _0x6b7c1f;};'use strict';var _=require(_0x7141('0x0'));var util=require(_0x7141('0x1'));var moment=require(_0x7141('0x2'));var BPromise=require(_0x7141('0x3'));var rs=require(_0x7141('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7141('0x5'))(_0x7141('0x6'));var config=require(_0x7141('0x7'));var jayson=require(_0x7141('0x8'));var client=jayson[_0x7141('0x9')][_0x7141('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ccc60,_0x14484e,_0x146b26){return new BPromise(function(_0x149ae2,_0x466c1f){return client[_0x7141('0xb')](_0x3ccc60,_0x146b26)[_0x7141('0xc')](function(_0x2a2fec){logger[_0x7141('0xd')](_0x7141('0xe'),_0x14484e,'request\x20sent');logger[_0x7141('0xf')](_0x7141('0x10'),_0x14484e,_0x7141('0x11'),JSON[_0x7141('0x12')](_0x2a2fec));if(_0x2a2fec[_0x7141('0x13')]){if(_0x2a2fec[_0x7141('0x13')]['code']===0x1f4){logger['error'](_0x7141('0xe'),_0x14484e,_0x2a2fec[_0x7141('0x13')]['message']);return _0x466c1f(_0x2a2fec['error']['message']);}logger[_0x7141('0x13')](_0x7141('0xe'),_0x14484e,_0x2a2fec[_0x7141('0x13')][_0x7141('0x14')]);return _0x149ae2(_0x2a2fec[_0x7141('0x13')][_0x7141('0x14')]);}else{logger[_0x7141('0xd')](_0x7141('0xe'),_0x14484e,'request\x20sent');_0x149ae2(_0x2a2fec['result']['message']);}})[_0x7141('0x15')](function(_0x49bdf0){logger[_0x7141('0x13')](_0x7141('0xe'),_0x14484e,_0x49bdf0);_0x466c1f(_0x49bdf0);});});}exports[_0x7141('0x16')]=function(_0x3f6a92){var _0x3148f2=this;return new Promise(function(_0x46e139,_0x447e6b){return db[_0x7141('0x17')]['find']({'raw':_0x3f6a92['options']?_0x3f6a92['options']['raw']===undefined?!![]:![]:!![],'where':_0x3f6a92[_0x7141('0x18')]?_0x3f6a92[_0x7141('0x18')][_0x7141('0x19')]||null:null,'attributes':_0x3f6a92[_0x7141('0x18')]?_0x3f6a92[_0x7141('0x18')][_0x7141('0x1a')]||null:null,'include':_0x3f6a92[_0x7141('0x18')]?_0x3f6a92[_0x7141('0x18')][_0x7141('0x1b')]?_[_0x7141('0x1c')](_0x3f6a92[_0x7141('0x18')][_0x7141('0x1b')],function(_0x52c1cb){return{'model':db[_0x52c1cb[_0x7141('0x1d')]],'as':_0x52c1cb['as'],'attributes':_0x52c1cb[_0x7141('0x1a')],'include':_0x52c1cb[_0x7141('0x1b')]?_['map'](_0x52c1cb[_0x7141('0x1b')],function(_0x41959a){return{'model':db[_0x41959a[_0x7141('0x1d')]],'as':_0x41959a['as'],'attributes':_0x41959a['attributes'],'include':_0x41959a[_0x7141('0x1b')]?_['map'](_0x41959a['include'],function(_0x1c7781){return{'model':db[_0x1c7781[_0x7141('0x1d')]],'as':_0x1c7781['as'],'attributes':_0x1c7781[_0x7141('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x7141('0xc')](function(_0x471f53){logger[_0x7141('0xd')]('ShowPause',_0x3f6a92);logger[_0x7141('0xf')](_0x7141('0x16'),_0x3f6a92,JSON['stringify'](_0x471f53));_0x46e139(_0x471f53);})[_0x7141('0x15')](function(_0x5148b1){logger['error']('ShowPause',_0x5148b1[_0x7141('0x14')],_0x3f6a92);_0x447e6b(_0x3148f2[_0x7141('0x13')](0x1f4,_0x5148b1[_0x7141('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index e2bc37a..af902b3 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 _0x5b35=['/webhook','/:id','show','/:id/download','diskStorage','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','post','file','upload','webhookPost','put','delete','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','./plugin.controller','isAuthenticated','index','get'];(function(_0x26222d,_0x1d2de1){var _0x16bf9f=function(_0x43892a){while(--_0x43892a){_0x26222d['push'](_0x26222d['shift']());}};_0x16bf9f(++_0x1d2de1);}(_0x5b35,0x10e));var _0x55b3=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5b35[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x55b3('0x0'));var util=require(_0x55b3('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x55b3('0x2')]();var auth=require(_0x55b3('0x3'));var interaction=require(_0x55b3('0x4'));var config=require('../../config/environment');var controller=require(_0x55b3('0x5'));router['get']('/',auth[_0x55b3('0x6')](),controller[_0x55b3('0x7')]);router[_0x55b3('0x8')](_0x55b3('0x9'),controller['webhookGet']);router[_0x55b3('0x8')](_0x55b3('0xa'),auth[_0x55b3('0x6')](),controller[_0x55b3('0xb')]);router[_0x55b3('0x8')](_0x55b3('0xc'),auth[_0x55b3('0x6')](),controller['download']);var upload=multer({'storage':multer[_0x55b3('0xd')]({'destination':function(_0x58de53,_0xcd4fde,_0x2110da){_0x2110da(null,path[_0x55b3('0xe')](config[_0x55b3('0xf')],_0x55b3('0x10')));},'filename':function(_0x1a4eed,_0x3acc16,_0x4c565b){_0x3acc16['originalname']=_0x3acc16[_0x55b3('0x11')][_0x55b3('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4c565b(null,util[_0x55b3('0x13')](_0x55b3('0x14'),path[_0x55b3('0x15')](_0x3acc16[_0x55b3('0x11')],path[_0x55b3('0x16')](_0x3acc16['originalname'])),Date[_0x55b3('0x17')](),path[_0x55b3('0x16')](_0x3acc16['originalname'])));}})});router[_0x55b3('0x18')]('/',upload['single'](_0x55b3('0x19')),controller[_0x55b3('0x1a')]);router[_0x55b3('0x18')](_0x55b3('0x9'),controller[_0x55b3('0x1b')]);router[_0x55b3('0x1c')](_0x55b3('0xa'),auth[_0x55b3('0x6')](),controller['update']);router[_0x55b3('0x1d')](_0x55b3('0xa'),auth['isAuthenticated'](),controller[_0x55b3('0x1d')]);module[_0x55b3('0x1e')]=router; \ No newline at end of file +var _0x779c=['replace','format','%s-%s%s','basename','extname','now','post','single','file','upload','/webhook','delete','/:id','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','webhookGet','show','/:id/download','diskStorage','join','server/files/plugins','originalname'];(function(_0x544bc3,_0x3fff34){var _0x5939fc=function(_0x51d5c0){while(--_0x51d5c0){_0x544bc3['push'](_0x544bc3['shift']());}};_0x5939fc(++_0x3fff34);}(_0x779c,0x158));var _0xc779=function(_0x3a8740,_0x83b1db){_0x3a8740=_0x3a8740-0x0;var _0xde1e08=_0x779c[_0x3a8740];return _0xde1e08;};'use strict';var multer=require(_0xc779('0x0'));var util=require(_0xc779('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc779('0x2'));var router=express[_0xc779('0x3')]();var auth=require(_0xc779('0x4'));var interaction=require(_0xc779('0x5'));var config=require('../../config/environment');var controller=require('./plugin.controller');router[_0xc779('0x6')]('/',auth[_0xc779('0x7')](),controller[_0xc779('0x8')]);router['get']('/webhook',controller[_0xc779('0x9')]);router[_0xc779('0x6')]('/:id',auth[_0xc779('0x7')](),controller[_0xc779('0xa')]);router[_0xc779('0x6')](_0xc779('0xb'),auth[_0xc779('0x7')](),controller['download']);var upload=multer({'storage':multer[_0xc779('0xc')]({'destination':function(_0xbddcf4,_0x7ed9a0,_0x4e0888){_0x4e0888(null,path[_0xc779('0xd')](config['root'],_0xc779('0xe')));},'filename':function(_0x510733,_0x6c076e,_0x77759f){_0x6c076e[_0xc779('0xf')]=_0x6c076e['originalname'][_0xc779('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x77759f(null,util[_0xc779('0x11')](_0xc779('0x12'),path[_0xc779('0x13')](_0x6c076e['originalname'],path[_0xc779('0x14')](_0x6c076e[_0xc779('0xf')])),Date[_0xc779('0x15')](),path[_0xc779('0x14')](_0x6c076e['originalname'])));}})});router[_0xc779('0x16')]('/',upload[_0xc779('0x17')](_0xc779('0x18')),controller[_0xc779('0x19')]);router[_0xc779('0x16')](_0xc779('0x1a'),controller['webhookPost']);router['put']('/:id',auth[_0xc779('0x7')](),controller['update']);router[_0xc779('0x1b')](_0xc779('0x1c'),auth[_0xc779('0x7')](),controller[_0xc779('0x1b')]);module[_0xc779('0x1d')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 0680968..c16d977 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 _0x05e5=['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.','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize'];(function(_0x18b191,_0x4e0684){var _0x43e146=function(_0x4b464e){while(--_0x4b464e){_0x18b191['push'](_0x18b191['shift']());}};_0x43e146(++_0x4e0684);}(_0x05e5,0x185));var _0x505e=function(_0xe45b6d,_0x443cac){_0xe45b6d=_0xe45b6d-0x0;var _0x4d6f47=_0x05e5[_0xe45b6d];return _0x4d6f47;};'use strict';var Sequelize=require(_0x505e('0x0'));module['exports']={'name':{'type':Sequelize[_0x505e('0x1')]},'type':{'type':Sequelize[_0x505e('0x2')](_0x505e('0x3'),_0x505e('0x4'))},'description':{'type':Sequelize[_0x505e('0x5')]},'version':{'type':Sequelize[_0x505e('0x5')]},'path':{'type':Sequelize[_0x505e('0x1')],'comment':_0x505e('0x6')},'active':{'type':Sequelize[_0x505e('0x7')],'defaultValue':0x0,'comment':_0x505e('0x8')},'sidebar':{'type':Sequelize[_0x505e('0x2')]('adminOnly',_0x505e('0x9'),_0x505e('0xa'),_0x505e('0xb')),'defaultValue':_0x505e('0xa'),'comment':_0x505e('0xc')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x505e('0x1')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x505e('0x1')]}}; \ No newline at end of file +var _0xbff3=['Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','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','never'];(function(_0x39a7a2,_0x3bb9ec){var _0x812c3f=function(_0x3654d6){while(--_0x3654d6){_0x39a7a2['push'](_0x39a7a2['shift']());}};_0x812c3f(++_0x3bb9ec);}(_0xbff3,0x1f0));var _0x3bff=function(_0x531dab,_0x3c16f2){_0x531dab=_0x531dab-0x0;var _0x5746ad=_0xbff3[_0x531dab];return _0x5746ad;};'use strict';var Sequelize=require(_0x3bff('0x0'));module[_0x3bff('0x1')]={'name':{'type':Sequelize[_0x3bff('0x2')]},'type':{'type':Sequelize[_0x3bff('0x3')](_0x3bff('0x4'),_0x3bff('0x5'))},'description':{'type':Sequelize[_0x3bff('0x6')]},'version':{'type':Sequelize[_0x3bff('0x6')]},'path':{'type':Sequelize[_0x3bff('0x2')],'comment':_0x3bff('0x7')},'active':{'type':Sequelize[_0x3bff('0x8')],'defaultValue':0x0,'comment':_0x3bff('0x9')},'sidebar':{'type':Sequelize[_0x3bff('0x3')](_0x3bff('0xa'),_0x3bff('0xb'),_0x3bff('0xc'),_0x3bff('0xd')),'defaultValue':'always','comment':_0x3bff('0xe')},'icon':{'type':Sequelize[_0x3bff('0x2')]},'adminUrl':{'type':Sequelize[_0x3bff('0x2')]},'agentUrl':{'type':Sequelize[_0x3bff('0x2')]},'scriptName':{'type':Sequelize[_0x3bff('0x2')]},'scriptPath':{'type':Sequelize[_0x3bff('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 634a3e4..2c693ea 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 _0x34ec=['manifest.json','parse','undefined','Invalid\x20manifest:\x20name\x20missing','type','Invalid\x20manifest:\x20type\x20missing','version','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','Invalid\x20manifest:\x20views\x20missing','admin','views','Invalid\x20manifest:\x20no\x20view\x20specified','script','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','test','plugins','agent','scriptName','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','unlinkSync','delete','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','headers','content-type','statusCode','webhookPost','resolve','content-length','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','archiver','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Plugins','UserProfileResource','sendStatus','stack','name','send','index','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','key','field','options','Plugin','count','includeAll','include','findAll','rows','catch','find','download','params','join','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','error','Error','pipe','glob','**/*','root','dirname','node_modules/**/*','attachments/**/*','close','existsSync','Plugin\x20not\x20found','Download\x20completed','info','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isDirectory','some','Plugin\x20manifest\x20missing','readFileSync'];(function(_0x403fc7,_0x32931a){var _0x5d0827=function(_0x5ea698){while(--_0x5ea698){_0x403fc7['push'](_0x403fc7['shift']());}};_0x5d0827(++_0x32931a);}(_0x34ec,0xdd));var _0xc34e=function(_0x49dbe9,_0x52d2da){_0x49dbe9=_0x49dbe9-0x0;var _0x13c5bb=_0x34ec[_0x49dbe9];return _0x13c5bb;};'use strict';var pdf=require(_0xc34e('0x0'));var emlformat=require(_0xc34e('0x1'));var rimraf=require(_0xc34e('0x2'));var zipdir=require(_0xc34e('0x3'));var jsonpatch=require(_0xc34e('0x4'));var rp=require(_0xc34e('0x5'));var moment=require(_0xc34e('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xc34e('0x7'));var util=require(_0xc34e('0x8'));var path=require(_0xc34e('0x9'));var sox=require(_0xc34e('0xa'));var csv=require('to-csv');var ejs=require(_0xc34e('0xb'));var fs=require('fs');var _=require(_0xc34e('0xc'));var squel=require(_0xc34e('0xd'));var crypto=require(_0xc34e('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc34e('0xf'));var toCsv=require(_0xc34e('0x10'));var querystring=require(_0xc34e('0x11'));var Papa=require(_0xc34e('0x12'));var extract=require('extract-zip');var rimraf=require('rimraf');var archiver=require(_0xc34e('0x13'));var Redis=require(_0xc34e('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xc34e('0x15'));var hardwareService=require(_0xc34e('0x16'));var logger=require(_0xc34e('0x17'))(_0xc34e('0x18'));var utils=require(_0xc34e('0x19'));var config=require(_0xc34e('0x1a'));var db=require(_0xc34e('0x1b'))['db'];config[_0xc34e('0x1c')]=_[_0xc34e('0x1d')](config['redis'],{'host':_0xc34e('0x1e'),'port':0x18eb});var socket=require(_0xc34e('0x1f'))(new Redis(config['redis']));require(_0xc34e('0x20'))['register'](socket);function respondWithStatusCode(_0x21c209,_0x2d6623){_0x2d6623=_0x2d6623||0xcc;return function(_0x5350b1){if(_0x5350b1){return _0x21c209['sendStatus'](_0x2d6623);}return _0x21c209[_0xc34e('0x21')](_0x2d6623)[_0xc34e('0x22')]();};}function respondWithResult(_0xd1771d,_0x1cafd0){_0x1cafd0=_0x1cafd0||0xc8;return function(_0x43eeed){if(_0x43eeed){return _0xd1771d[_0xc34e('0x21')](_0x1cafd0)[_0xc34e('0x23')](_0x43eeed);}};}function respondWithFilteredResult(_0x4d408e,_0x323bd1){return function(_0xe38a8b){if(_0xe38a8b){var _0x205d40=_0xe38a8b['count'],_0x2f91df=_0x323bd1[_0xc34e('0x24')],_0x63119=_0x323bd1['offset']+_0x323bd1[_0xc34e('0x25')],_0x27ccbe;if(_0x63119>=_0x205d40){_0x63119=_0x205d40;_0x27ccbe=0xc8;}else{_0x27ccbe=0xce;}_0x4d408e[_0xc34e('0x21')](_0x27ccbe);return _0x4d408e[_0xc34e('0x26')](_0xc34e('0x27'),_0x2f91df+'-'+_0x63119+'/'+_0x205d40)[_0xc34e('0x23')](_0xe38a8b);}return null;};}function patchUpdates(_0x981832){return function(_0x3cb168){try{jsonpatch[_0xc34e('0x28')](_0x3cb168,_0x981832,!![]);}catch(_0xff0972){return BPromise[_0xc34e('0x29')](_0xff0972);}return _0x3cb168[_0xc34e('0x2a')]();};}function saveUpdates(_0x3417ab,_0x3907f2){return function(_0x651b8c){if(_0x651b8c){return _0x651b8c[_0xc34e('0x2b')](_0x3417ab)[_0xc34e('0x2c')](function(_0x3c8a19){return _0x3c8a19;});}return null;};}function removeEntity(_0x8698c0,_0x3824d5){return function(_0x17e84d){if(_0x17e84d){return _0x17e84d[_0xc34e('0x2d')]()[_0xc34e('0x2c')](function(){var _0x5bf9a1=_0x17e84d[_0xc34e('0x2e')]({'plain':!![]});var _0x23adc3=_0xc34e('0x2f');return db[_0xc34e('0x30')][_0xc34e('0x2d')]({'where':{'type':_0x23adc3,'resourceId':_0x5bf9a1['id']}})[_0xc34e('0x2c')](function(){return _0x17e84d;});})[_0xc34e('0x2c')](function(){_0x8698c0[_0xc34e('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x202138,_0x19969d){return function(_0x40c937){if(!_0x40c937){_0x202138[_0xc34e('0x31')](0x194);}return _0x40c937;};}function handleError(_0x389aba,_0x198d0b){_0x198d0b=_0x198d0b||0x1f4;return function(_0x437de0){logger['error'](_0x437de0[_0xc34e('0x32')]);if(_0x437de0[_0xc34e('0x33')]){delete _0x437de0[_0xc34e('0x33')];}_0x389aba['status'](_0x198d0b)[_0xc34e('0x34')](_0x437de0);};}exports[_0xc34e('0x35')]=function(_0xfc95be,_0x4dcf65){var _0x56b9ab={},_0x17783c={},_0xe133f0={'count':0x0,'rows':[]};var _0x4b603b=db['Plugin'][_0xc34e('0x36')];_0x17783c[_0xc34e('0x37')]=_['keys'](_0x4b603b);_0x17783c[_0xc34e('0x38')]=_[_0xc34e('0x39')](_0xfc95be[_0xc34e('0x38')]);_0x17783c[_0xc34e('0x3a')]=_[_0xc34e('0x3b')](_0x17783c[_0xc34e('0x37')],_0x17783c[_0xc34e('0x38')]);_0x56b9ab['attributes']=_[_0xc34e('0x3b')](_0x17783c[_0xc34e('0x37')],qs[_0xc34e('0x3c')](_0xfc95be['query'][_0xc34e('0x3c')]));_0x56b9ab[_0xc34e('0x3d')]=_0x56b9ab[_0xc34e('0x3d')][_0xc34e('0x3e')]?_0x56b9ab[_0xc34e('0x3d')]:_0x17783c[_0xc34e('0x37')];if(!_0xfc95be['query'][_0xc34e('0x3f')](_0xc34e('0x40'))){_0x56b9ab[_0xc34e('0x25')]=qs['limit'](_0xfc95be[_0xc34e('0x38')][_0xc34e('0x25')]);_0x56b9ab[_0xc34e('0x24')]=qs[_0xc34e('0x24')](_0xfc95be[_0xc34e('0x38')][_0xc34e('0x24')]);}_0x56b9ab[_0xc34e('0x41')]=qs[_0xc34e('0x42')](_0xfc95be[_0xc34e('0x38')][_0xc34e('0x42')]);_0x56b9ab[_0xc34e('0x43')]=qs[_0xc34e('0x3a')](_[_0xc34e('0x44')](_0xfc95be[_0xc34e('0x38')],_0x17783c['filters']));if(_0xfc95be[_0xc34e('0x38')][_0xc34e('0x45')]){_0x56b9ab[_0xc34e('0x43')]=_[_0xc34e('0x46')](_0x56b9ab[_0xc34e('0x43')],{'$or':_['map'](_0x4b603b,function(_0x26ebb0){if(_0x26ebb0['type'][_0xc34e('0x47')]!=='VIRTUAL'){var _0xa76d76={};_0xa76d76[_0x26ebb0[_0xc34e('0x48')]]={'$like':'%'+_0xfc95be[_0xc34e('0x38')][_0xc34e('0x45')]+'%'};return _0xa76d76;}})});}_0x56b9ab=_[_0xc34e('0x46')]({},_0x56b9ab,_0xfc95be[_0xc34e('0x49')]);var _0xdf2ef7={'where':_0x56b9ab[_0xc34e('0x43')]};return db[_0xc34e('0x4a')]['count'](_0xdf2ef7)['then'](function(_0x4a8ab2){_0xe133f0[_0xc34e('0x4b')]=_0x4a8ab2;if(_0xfc95be['query'][_0xc34e('0x4c')]){_0x56b9ab[_0xc34e('0x4d')]=[{'all':!![]}];}return db[_0xc34e('0x4a')][_0xc34e('0x4e')](_0x56b9ab);})[_0xc34e('0x2c')](function(_0x19969){_0xe133f0[_0xc34e('0x4f')]=_0x19969;return _0xe133f0;})[_0xc34e('0x2c')](respondWithFilteredResult(_0x4dcf65,_0x56b9ab))[_0xc34e('0x50')](handleError(_0x4dcf65,null));};exports['show']=function(_0x190d1a,_0x4f754c){var _0x90e6f={'raw':!![],'where':{'id':_0x190d1a['params']['id']}},_0x247f65={};_0x247f65[_0xc34e('0x37')]=_[_0xc34e('0x39')](db[_0xc34e('0x4a')]['rawAttributes']);_0x247f65['query']=_[_0xc34e('0x39')](_0x190d1a[_0xc34e('0x38')]);_0x247f65[_0xc34e('0x3a')]=_['intersection'](_0x247f65[_0xc34e('0x37')],_0x247f65[_0xc34e('0x38')]);_0x90e6f[_0xc34e('0x3d')]=_[_0xc34e('0x3b')](_0x247f65[_0xc34e('0x37')],qs[_0xc34e('0x3c')](_0x190d1a[_0xc34e('0x38')]['fields']));_0x90e6f['attributes']=_0x90e6f['attributes'][_0xc34e('0x3e')]?_0x90e6f['attributes']:_0x247f65[_0xc34e('0x37')];if(_0x190d1a[_0xc34e('0x38')][_0xc34e('0x4c')]){_0x90e6f[_0xc34e('0x4d')]=[{'all':!![]}];}_0x90e6f=_[_0xc34e('0x46')]({},_0x90e6f,_0x190d1a[_0xc34e('0x49')]);return db['Plugin'][_0xc34e('0x51')](_0x90e6f)['then'](handleEntityNotFound(_0x4f754c,null))[_0xc34e('0x2c')](respondWithResult(_0x4f754c,null))[_0xc34e('0x50')](handleError(_0x4f754c,null));};exports[_0xc34e('0x52')]=function(_0x1887b2,_0x53f47f,_0x144832){return db[_0xc34e('0x4a')][_0xc34e('0x51')]({'where':{'id':_0x1887b2[_0xc34e('0x53')]['id']},'attributes':['name',_0xc34e('0x9')],'raw':!![]})['then'](handleEntityNotFound(_0x53f47f,null))[_0xc34e('0x2c')](function(_0x83b197){if(_0x83b197){var _0xf3cd75=path[_0xc34e('0x54')](config['root'],_0xc34e('0x55'),util[_0xc34e('0x56')](_0xc34e('0x57'),path[_0xc34e('0x58')](_0x83b197[_0xc34e('0x9')])));var _0x1b1946=fs[_0xc34e('0x59')](_0xf3cd75);var _0x30b472=archiver(_0xc34e('0x5a'),{'zlib':{'level':0x9}});_0x30b472['on'](_0xc34e('0x5b'),function(_0x28a269){if(_0x28a269[_0xc34e('0x5c')]===_0xc34e('0x5d')){logger['error'](_0x28a269);}else{throw new db[(_0xc34e('0x5e'))]['Error'](_0xc34e('0x5f'));}});_0x30b472['on'](_0xc34e('0x60'),function(_0x558a21){throw new db['Sequelize'][(_0xc34e('0x61'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x30b472[_0xc34e('0x62')](_0x1b1946);_0x30b472[_0xc34e('0x63')](_0xc34e('0x64'),{'cwd':path[_0xc34e('0x54')](config[_0xc34e('0x65')],_0xc34e('0x55'),path[_0xc34e('0x66')](_0x83b197[_0xc34e('0x9')])),'ignore':[path['join'](path[_0xc34e('0x58')](_0x83b197[_0xc34e('0x9')]),_0xc34e('0x67')),path[_0xc34e('0x54')](path[_0xc34e('0x58')](_0x83b197[_0xc34e('0x9')]),_0xc34e('0x68'))],'nodir':!![]})['finalize']();_0x1b1946['on'](_0xc34e('0x69'),function(){if(!fs[_0xc34e('0x6a')](_0xf3cd75)){throw new db[(_0xc34e('0x5e'))][(_0xc34e('0x61'))](_0xc34e('0x6b'));}return _0x53f47f['download'](_0xf3cd75,util[_0xc34e('0x56')](_0xc34e('0x57'),path[_0xc34e('0x58')](_0x83b197[_0xc34e('0x9')])),function(_0x1ed149){if(_0x1ed149){throw new db['Sequelize']['Error']('Error\x20while\x20downloading\x20the\x20plugin');}fs['unlinkSync'](_0xf3cd75);logger['info'](_0xc34e('0x6c'));logger[_0xc34e('0x6d')](_0xc34e('0x6e'));});});}return null;})['catch'](handleError(_0x53f47f,null));};exports[_0xc34e('0x6f')]=function(_0x4b9db6,_0x15e85e,_0x195a77){var _0x5e2455=path[_0xc34e('0x58')](_0x4b9db6[_0xc34e('0x70')]['filename'],path['extname'](_0x4b9db6[_0xc34e('0x70')][_0xc34e('0x71')]));var _0x13d804=path[_0xc34e('0x54')](config[_0xc34e('0x65')],_0xc34e('0x55'),_0x4b9db6[_0xc34e('0x70')]['filename']);var _0x31921a=path[_0xc34e('0x54')](config['root'],_0xc34e('0x55'),_0x5e2455);logger['info'](_0xc34e('0x72'),_0x13d804);logger[_0xc34e('0x6d')](_0xc34e('0x73'),_0x31921a);try{fs[_0xc34e('0x74')](_0x13d804,parseInt(_0xc34e('0x75'),0x8));extract(_0x13d804,{'dir':_0x31921a},function(_0x2443d6){if(_0x2443d6){logger['error'](_0x2443d6);handleError(_0x2443d6,!![]);};var _0x1c33fa=fs[_0xc34e('0x76')](_0x31921a);if(_0x1c33fa[_0xc34e('0x3e')]>0x1){removeReferences(_0x13d804,_0x31921a);logger[_0xc34e('0x60')](_0xc34e('0x77'));return _0x195a77(new Error(_0xc34e('0x77')));}var _0x5a1f1b=fs[_0xc34e('0x78')](path[_0xc34e('0x54')](_0x31921a,_0x1c33fa[0x0]));if(_0x5a1f1b['isFile']()){removeReferences(_0x13d804,_0x31921a);logger[_0xc34e('0x60')](_0xc34e('0x77'));return _0x195a77(new Error('Invalid\x20plugin\x20structure'));}if(_0x5a1f1b[_0xc34e('0x79')]()){var _0x3b9034=fs[_0xc34e('0x76')](path[_0xc34e('0x54')](_0x31921a,_0x1c33fa[0x0]));if(_0x3b9034['length']===0x0){removeReferences(_0x13d804,_0x31921a);logger['error'](_0xc34e('0x77'));return _0x195a77(new Error(_0xc34e('0x77')));}var _0x49d8e3=_0x3b9034[_0xc34e('0x7a')](function(_0x5e0d53){return _0x5e0d53==='manifest.json';});if(!_0x49d8e3){return _0x195a77(new Error(_0xc34e('0x7b')));}var _0x1ace4e=fs[_0xc34e('0x7c')](path[_0xc34e('0x54')](_0x31921a,_0x1c33fa[0x0],_0xc34e('0x7d')));var _0x4132fd=JSON[_0xc34e('0x7e')](_0x1ace4e);if(_0xc34e('0x7f')==typeof _0x4132fd[_0xc34e('0x33')]){return _0x195a77(new Error(_0xc34e('0x80')));}if(_0xc34e('0x7f')==typeof _0x4132fd[_0xc34e('0x81')]){return _0x195a77(new Error(_0xc34e('0x82')));}if(_0xc34e('0x7f')==typeof _0x4132fd[_0xc34e('0x83')]){return _0x195a77(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0xc34e('0x7f')==typeof _0x4132fd[_0xc34e('0x84')]){return _0x195a77(new Error(_0xc34e('0x85')));}if(_0x4132fd[_0xc34e('0x81')]===_0xc34e('0x86')){if('undefined'==typeof _0x4132fd[_0xc34e('0x84')]['views']){return _0x195a77(new Error(_0xc34e('0x87')));}if('undefined'==typeof _0x4132fd[_0xc34e('0x84')]['views'][_0xc34e('0x88')]&&_0xc34e('0x7f')==typeof _0x4132fd['parameters'][_0xc34e('0x89')]['agent']){return _0x195a77(new Error(_0xc34e('0x8a')));}}else if(_0x4132fd[_0xc34e('0x81')]===_0xc34e('0x8b')){if(_0xc34e('0x7f')==typeof _0x4132fd[_0xc34e('0x84')]['scriptName']){return _0x195a77(new Error(_0xc34e('0x8c')));}if(_0xc34e('0x7f')==typeof _0x4132fd[_0xc34e('0x84')]['scriptPath']){return _0x195a77(new Error(_0xc34e('0x8d')));}}else{return _0x195a77(new Error(_0xc34e('0x8e')));}var _0x37bb4c=_0x4132fd[_0xc34e('0x33')];var _0x5ad92f=_0x4132fd[_0xc34e('0x8f')];var _0x2ee2e4=_0x4132fd[_0xc34e('0x81')];var _0x26670f=_0x4132fd['sidebar']?_0x4132fd[_0xc34e('0x90')]:_0xc34e('0x91');var _0x3be666=_0x4132fd['icon']?_0x4132fd[_0xc34e('0x92')]:'icon-apps';var _0x1711bb='';var _0x20f1fe='';var _0x27504f='';var _0x8aa667='';var _0x7d6179=_0x4132fd['version'];if(_0x2ee2e4===_0xc34e('0x86')){if(_0xc34e('0x7f')!=typeof _0x4132fd[_0xc34e('0x84')][_0xc34e('0x89')][_0xc34e('0x88')]){var _0x2329e8=_0x4132fd[_0xc34e('0x84')][_0xc34e('0x89')][_0xc34e('0x88')];if(!/^(f|ht)tps?:\/\//i[_0xc34e('0x93')](_0x2329e8)){_0x1711bb=path['join'](_0xc34e('0x94'),_0x5e2455,_0x1c33fa[0x0],_0x2329e8);}else{_0x1711bb=_0x2329e8;}}else{logger[_0xc34e('0x6d')]('Warning:\x20admin\x20view\x20not\x20specified');}if(_0xc34e('0x7f')!=typeof _0x4132fd[_0xc34e('0x84')]['views'][_0xc34e('0x95')]){var _0x196eea=_0x4132fd[_0xc34e('0x84')][_0xc34e('0x89')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xc34e('0x93')](_0x196eea)){_0x20f1fe=path[_0xc34e('0x54')]('plugins',_0x5e2455,_0x1c33fa[0x0],_0x196eea);}else{_0x20f1fe=_0x196eea;}}else{logger[_0xc34e('0x6d')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x2ee2e4===_0xc34e('0x8b')){_0x27504f=_0x4132fd[_0xc34e('0x84')][_0xc34e('0x96')];_0x8aa667=_0x4132fd[_0xc34e('0x84')]['scriptPath'];if('undefined'!=typeof _0x4132fd[_0xc34e('0x84')][_0xc34e('0x89')]){if(_0xc34e('0x7f')!=typeof _0x4132fd[_0xc34e('0x84')][_0xc34e('0x89')][_0xc34e('0x88')]){var _0x2329e8=_0x4132fd[_0xc34e('0x84')][_0xc34e('0x89')][_0xc34e('0x88')];if(!/^(f|ht)tps?:\/\//i[_0xc34e('0x93')](_0x2329e8)){_0x1711bb=path[_0xc34e('0x54')](_0xc34e('0x94'),_0x5e2455,_0x1c33fa[0x0],_0x2329e8);}else{_0x1711bb=_0x2329e8;}}if(_0xc34e('0x7f')!=typeof _0x4132fd[_0xc34e('0x84')]['views'][_0xc34e('0x95')]){var _0x196eea=_0x4132fd[_0xc34e('0x84')]['views'][_0xc34e('0x95')];if(!/^(f|ht)tps?:\/\//i[_0xc34e('0x93')](_0x196eea)){_0x20f1fe=path['join'](_0xc34e('0x94'),_0x5e2455,_0x1c33fa[0x0],_0x196eea);}else{_0x20f1fe=_0x196eea;}}}}var _0xfd8f96={'name':_0x37bb4c,'description':_0x5ad92f,'path':path[_0xc34e('0x54')](_0x5e2455,_0x1c33fa[0x0]),'type':_0x2ee2e4,'sidebar':_0x26670f,'icon':_0x3be666,'adminUrl':_0x1711bb,'agentUrl':_0x20f1fe,'scriptName':_0x27504f,'scriptPath':_0x8aa667,'version':_0x7d6179};removeReferences(_0x13d804,null);return db[_0xc34e('0x4a')]['create'](_0xfd8f96)[_0xc34e('0x2c')](function(_0x133580){var _0x2be869={'role':_0x4b9db6[_0xc34e('0x97')]['role'],'userProfileId':_0x4b9db6['body'][_0xc34e('0x98')]};if(!_0x2be869)throw new Error(_0xc34e('0x99'));if(_0x2be869[_0xc34e('0x9a')]===_0xc34e('0x9b')){var _0x2e8783=_0x133580[_0xc34e('0x2e')]({'plain':!![]});return db[_0xc34e('0x9c')]['find']({'where':{'name':_0xc34e('0x2f'),'userProfileId':_0x2be869['userProfileId']},'raw':!![]})[_0xc34e('0x2c')](function(_0x3a3dfc){if(_0x3a3dfc&&_0x3a3dfc[_0xc34e('0x9d')]===0x0){return db[_0xc34e('0x30')]['create']({'name':_0x2e8783['name'],'resourceId':_0x2e8783['id'],'type':_0x3a3dfc[_0xc34e('0x33')],'sectionId':_0x3a3dfc['id']},{})[_0xc34e('0x2c')](function(){return _0x133580;});}else{return _0x133580;}})['catch'](function(_0x16adb5){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x16adb5);throw _0x16adb5;});}return _0x133580;})[_0xc34e('0x2c')](respondWithResult(_0x15e85e,null))[_0xc34e('0x50')](handleError(_0x15e85e,null));}});}catch(_0x345514){_0x15e85e[_0xc34e('0x21')](0x1f4)[_0xc34e('0x34')](_0x345514);}};function removeReferences(_0x1ecbaa,_0x585c99){try{if(_0x1ecbaa){fs[_0xc34e('0x9e')](_0x1ecbaa);logger[_0xc34e('0x6d')]('Zip\x20archive\x20removed');}if(_0x585c99){rimraf(_0x585c99,function(){});logger['info']('Extracted\x20folder\x20removed');}}catch(_0x23da56){logger['error'](_0x23da56);}}exports['update']=function(_0x4ee0b2,_0x5d99fa,_0x136674){return db[_0xc34e('0x4a')][_0xc34e('0x51')]({'where':{'id':_0x4ee0b2[_0xc34e('0x53')]['id']}})[_0xc34e('0x2c')](handleEntityNotFound(_0x5d99fa,null))[_0xc34e('0x2c')](saveUpdates(_0x4ee0b2['body'],null))['then'](respondWithResult(_0x5d99fa,null))[_0xc34e('0x50')](handleError(_0x5d99fa,null));};exports[_0xc34e('0x9f')]=function(_0x1ee93b,_0x500c4d,_0x9182fe){return db['Plugin'][_0xc34e('0x51')]({'where':{'id':_0x1ee93b[_0xc34e('0x53')]['id']}})[_0xc34e('0x2c')](function(_0x2ebcdc){if(_0x2ebcdc){return _0x2ebcdc[_0xc34e('0x2d')]();}})[_0xc34e('0x2c')](function(_0x3be337){rimraf(path[_0xc34e('0x54')](config[_0xc34e('0x65')],_0xc34e('0x55'),path[_0xc34e('0x66')](_0x3be337[_0xc34e('0x9')])),function(){});return _0x3be337;})[_0xc34e('0x2c')](handleEntityNotFound(_0x500c4d,null))[_0xc34e('0x2c')](respondWithStatusCode(_0x500c4d,null))[_0xc34e('0x50')](handleError(_0x500c4d,null));};exports['webhookGet']=function(_0x24fbeb,_0x47a251,_0x1ba795){return BPromise['resolve']()[_0xc34e('0x2c')](function(){if(!_0x24fbeb['query'][_0xc34e('0x9')]){throw new Error(_0xc34e('0xa0'));}if(!_0x24fbeb['query'][_0xc34e('0xa1')]){throw new Error(_0xc34e('0xa2'));}var _0x16dbdd=_0x24fbeb[_0xc34e('0x38')][_0xc34e('0xa3')]?_0x24fbeb[_0xc34e('0x38')][_0xc34e('0xa3')]+':'+_0x24fbeb[_0xc34e('0x38')][_0xc34e('0xa1')]:_0xc34e('0xa4')+_0x24fbeb[_0xc34e('0x38')]['port'];var _0x4bf31c=_0x24fbeb['query'][_0xc34e('0x23')]?_0x24fbeb[_0xc34e('0x38')][_0xc34e('0x23')]:!![];var _0x4a9d6e=_0x24fbeb[_0xc34e('0x38')][_0xc34e('0xa5')]?_0x24fbeb[_0xc34e('0x38')][_0xc34e('0xa5')]:null;var _0x250bc5={'method':_0x24fbeb[_0xc34e('0xa6')],'uri':util[_0xc34e('0x56')]('%s%s',_0x16dbdd,_0x24fbeb[_0xc34e('0x38')][_0xc34e('0x9')]),'json':_0x4bf31c,'resolveWithFullResponse':!![],'encoding':_0x4a9d6e,'qs':_0x24fbeb['query']};if(_0x24fbeb[_0xc34e('0xa7')]){_0x250bc5[_0xc34e('0xa7')]=_0x24fbeb['headers'];if(_0x250bc5[_0xc34e('0xa7')]['content-length']){delete _0x250bc5[_0xc34e('0xa7')]['content-length'];}}if(_0x250bc5[_0xc34e('0xa7')][_0xc34e('0xa8')]){delete _0x250bc5['headers'][_0xc34e('0xa8')];}return rp(_0x250bc5);})[_0xc34e('0x2c')](function(_0x56b84a){if(_0x56b84a){_0x47a251['set'](_0x56b84a[_0xc34e('0xa7')]);logger[_0xc34e('0x6d')](_0x56b84a[_0xc34e('0x97')]);if(_['endsWith'](_0x24fbeb[_0xc34e('0x38')][_0xc34e('0x9')],_0xc34e('0x52'))&&_0x56b84a[_0xc34e('0xa9')]==0x1f4){return _0x47a251[_0xc34e('0x31')](_0x56b84a[_0xc34e('0xa9')]);}else{return _0x47a251['status'](_0x56b84a[_0xc34e('0xa9')])[_0xc34e('0x34')](_0x56b84a['body']);}}else{return _0x47a251[_0xc34e('0x31')](0xc8);}})[_0xc34e('0x50')](handleError(_0x47a251,null));};exports[_0xc34e('0xaa')]=function(_0x4a8338,_0x53fa37,_0x12ed48){return BPromise[_0xc34e('0xab')]()[_0xc34e('0x2c')](function(){if(!_0x4a8338['query']['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x4a8338[_0xc34e('0x38')][_0xc34e('0xa1')]){throw new Error(_0xc34e('0xa2'));}var _0x8661c3=_0x4a8338[_0xc34e('0x38')]['hostname']?_0x4a8338[_0xc34e('0x38')][_0xc34e('0xa3')]+':'+_0x4a8338[_0xc34e('0x38')][_0xc34e('0xa1')]:_0xc34e('0xa4')+_0x4a8338[_0xc34e('0x38')][_0xc34e('0xa1')];var _0x7d95e6=_0x4a8338[_0xc34e('0x38')][_0xc34e('0x23')]?_0x4a8338[_0xc34e('0x38')][_0xc34e('0x23')]:!![];var _0x36fe48=_0x4a8338[_0xc34e('0x38')][_0xc34e('0xa5')]?_0x4a8338[_0xc34e('0x38')][_0xc34e('0xa5')]:null;var _0x1995f2={'method':_0x4a8338['method'],'uri':util[_0xc34e('0x56')]('%s%s',_0x8661c3,_0x4a8338['query']['path']),'json':_0x7d95e6,'resolveWithFullResponse':!![],'encoding':_0x36fe48,'body':_0x4a8338['body']};if(_0x4a8338[_0xc34e('0xa7')]){_0x1995f2[_0xc34e('0xa7')]=_0x4a8338[_0xc34e('0xa7')];if(_0x1995f2[_0xc34e('0xa7')]['content-length']){delete _0x1995f2[_0xc34e('0xa7')][_0xc34e('0xac')];}}if(_0x1995f2[_0xc34e('0xa7')][_0xc34e('0xa8')]){delete _0x1995f2[_0xc34e('0xa7')]['content-type'];}return rp(_0x1995f2);})[_0xc34e('0x2c')](function(_0x544c25){if(_0x544c25){_0x53fa37['set'](_0x544c25[_0xc34e('0xa7')]);logger[_0xc34e('0x6d')](_0x544c25[_0xc34e('0x97')]);return _0x53fa37[_0xc34e('0x21')](_0x544c25[_0xc34e('0xa9')])[_0xc34e('0x34')](_0x544c25[_0xc34e('0x97')]);}else{return _0x53fa37[_0xc34e('0x31')](0xc8);}})[_0xc34e('0x50')](handleError(_0x53fa37,null));}; \ No newline at end of file +var _0xf5cc=['parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','admin','agent','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20agent\x20view\x20not\x20specified','scriptName','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','encoding','method','headers','content-length','content-type','statusCode','%s%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./plugin.socket','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','Plugins','UserProfileResource','error','stack','name','send','index','Plugin','rawAttributes','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','map','key','options','findAll','show','includeAll','include','find','catch','download','params','path','join','root','%s.zip','createWriteStream','zip','warning','code','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','server/files/plugins','dirname','basename','node_modules/**/*','finalize','close','existsSync','Sequelize','format','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Temporary\x20file\x20removed','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','readdirSync','Invalid\x20plugin\x20structure','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','undefined','Invalid\x20manifest:\x20name\x20missing','type','version','Invalid\x20manifest:\x20version\x20not\x20specified'];(function(_0x351511,_0x14043c){var _0x2df741=function(_0x6300bf){while(--_0x6300bf){_0x351511['push'](_0x351511['shift']());}};_0x2df741(++_0x14043c);}(_0xf5cc,0x179));var _0xcf5c=function(_0x1d2bbb,_0x202267){_0x1d2bbb=_0x1d2bbb-0x0;var _0x38082b=_0xf5cc[_0x1d2bbb];return _0x38082b;};'use strict';var pdf=require(_0xcf5c('0x0'));var emlformat=require(_0xcf5c('0x1'));var rimraf=require(_0xcf5c('0x2'));var zipdir=require(_0xcf5c('0x3'));var jsonpatch=require(_0xcf5c('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xcf5c('0x5'));var Mustache=require(_0xcf5c('0x6'));var util=require(_0xcf5c('0x7'));var path=require('path');var sox=require(_0xcf5c('0x8'));var csv=require(_0xcf5c('0x9'));var ejs=require(_0xcf5c('0xa'));var fs=require('fs');var _=require(_0xcf5c('0xb'));var squel=require(_0xcf5c('0xc'));var crypto=require('crypto');var jsforce=require(_0xcf5c('0xd'));var deskjs=require(_0xcf5c('0xe'));var toCsv=require(_0xcf5c('0x9'));var querystring=require(_0xcf5c('0xf'));var Papa=require(_0xcf5c('0x10'));var extract=require(_0xcf5c('0x11'));var rimraf=require(_0xcf5c('0x2'));var archiver=require(_0xcf5c('0x12'));var Redis=require(_0xcf5c('0x13'));var authService=require(_0xcf5c('0x14'));var qs=require(_0xcf5c('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcf5c('0x16'))(_0xcf5c('0x17'));var utils=require(_0xcf5c('0x18'));var config=require(_0xcf5c('0x19'));var db=require(_0xcf5c('0x1a'))['db'];config['redis']=_[_0xcf5c('0x1b')](config['redis'],{'host':_0xcf5c('0x1c'),'port':0x18eb});var socket=require(_0xcf5c('0x1d'))(new Redis(config[_0xcf5c('0x1e')]));require(_0xcf5c('0x1f'))['register'](socket);function respondWithStatusCode(_0x42409a,_0x5dd07f){_0x5dd07f=_0x5dd07f||0xcc;return function(_0x2af593){if(_0x2af593){return _0x42409a[_0xcf5c('0x20')](_0x5dd07f);}return _0x42409a[_0xcf5c('0x21')](_0x5dd07f)[_0xcf5c('0x22')]();};}function respondWithResult(_0x2308fd,_0x4775e8){_0x4775e8=_0x4775e8||0xc8;return function(_0x39be6e){if(_0x39be6e){return _0x2308fd[_0xcf5c('0x21')](_0x4775e8)[_0xcf5c('0x23')](_0x39be6e);}};}function respondWithFilteredResult(_0x594c2d,_0x1ff343){return function(_0x2668f3){if(_0x2668f3){var _0x3e6917=_0x2668f3[_0xcf5c('0x24')],_0x1b31f8=_0x1ff343[_0xcf5c('0x25')],_0x5a40e9=_0x1ff343['offset']+_0x1ff343[_0xcf5c('0x26')],_0x59a30a;if(_0x5a40e9>=_0x3e6917){_0x5a40e9=_0x3e6917;_0x59a30a=0xc8;}else{_0x59a30a=0xce;}_0x594c2d['status'](_0x59a30a);return _0x594c2d[_0xcf5c('0x27')](_0xcf5c('0x28'),_0x1b31f8+'-'+_0x5a40e9+'/'+_0x3e6917)[_0xcf5c('0x23')](_0x2668f3);}return null;};}function patchUpdates(_0x24fc4a){return function(_0x485a16){try{jsonpatch[_0xcf5c('0x29')](_0x485a16,_0x24fc4a,!![]);}catch(_0x4192e7){return BPromise[_0xcf5c('0x2a')](_0x4192e7);}return _0x485a16['save']();};}function saveUpdates(_0xf00bdd,_0x954bbe){return function(_0x10bb05){if(_0x10bb05){return _0x10bb05[_0xcf5c('0x2b')](_0xf00bdd)[_0xcf5c('0x2c')](function(_0x3b4d24){return _0x3b4d24;});}return null;};}function removeEntity(_0x2fa5fa,_0x2dabdb){return function(_0x20d830){if(_0x20d830){return _0x20d830[_0xcf5c('0x2d')]()[_0xcf5c('0x2c')](function(){var _0x4f08b8=_0x20d830[_0xcf5c('0x2e')]({'plain':!![]});var _0x1abe29=_0xcf5c('0x2f');return db[_0xcf5c('0x30')][_0xcf5c('0x2d')]({'where':{'type':_0x1abe29,'resourceId':_0x4f08b8['id']}})[_0xcf5c('0x2c')](function(){return _0x20d830;});})[_0xcf5c('0x2c')](function(){_0x2fa5fa[_0xcf5c('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x549602,_0x293bff){return function(_0x4e1e8b){if(!_0x4e1e8b){_0x549602[_0xcf5c('0x20')](0x194);}return _0x4e1e8b;};}function handleError(_0x5d5cb8,_0x1a3cc1){_0x1a3cc1=_0x1a3cc1||0x1f4;return function(_0x4a62e9){logger[_0xcf5c('0x31')](_0x4a62e9[_0xcf5c('0x32')]);if(_0x4a62e9[_0xcf5c('0x33')]){delete _0x4a62e9[_0xcf5c('0x33')];}_0x5d5cb8[_0xcf5c('0x21')](_0x1a3cc1)[_0xcf5c('0x34')](_0x4a62e9);};}exports[_0xcf5c('0x35')]=function(_0x4d3f32,_0x2d1ab4){var _0x1a797d={},_0x12c4e4={},_0x1dc182={'count':0x0,'rows':[]};var _0x5c1616=db[_0xcf5c('0x36')][_0xcf5c('0x37')];_0x12c4e4['model']=_['keys'](_0x5c1616);_0x12c4e4[_0xcf5c('0x38')]=_[_0xcf5c('0x39')](_0x4d3f32[_0xcf5c('0x38')]);_0x12c4e4['filters']=_[_0xcf5c('0x3a')](_0x12c4e4['model'],_0x12c4e4[_0xcf5c('0x38')]);_0x1a797d[_0xcf5c('0x3b')]=_[_0xcf5c('0x3a')](_0x12c4e4[_0xcf5c('0x3c')],qs[_0xcf5c('0x3d')](_0x4d3f32[_0xcf5c('0x38')][_0xcf5c('0x3d')]));_0x1a797d[_0xcf5c('0x3b')]=_0x1a797d[_0xcf5c('0x3b')][_0xcf5c('0x3e')]?_0x1a797d[_0xcf5c('0x3b')]:_0x12c4e4[_0xcf5c('0x3c')];if(!_0x4d3f32[_0xcf5c('0x38')][_0xcf5c('0x3f')]('nolimit')){_0x1a797d[_0xcf5c('0x26')]=qs[_0xcf5c('0x26')](_0x4d3f32['query']['limit']);_0x1a797d[_0xcf5c('0x25')]=qs[_0xcf5c('0x25')](_0x4d3f32[_0xcf5c('0x38')][_0xcf5c('0x25')]);}_0x1a797d[_0xcf5c('0x40')]=qs[_0xcf5c('0x41')](_0x4d3f32[_0xcf5c('0x38')][_0xcf5c('0x41')]);_0x1a797d[_0xcf5c('0x42')]=qs[_0xcf5c('0x43')](_[_0xcf5c('0x44')](_0x4d3f32[_0xcf5c('0x38')],_0x12c4e4[_0xcf5c('0x43')]));if(_0x4d3f32[_0xcf5c('0x38')][_0xcf5c('0x45')]){_0x1a797d[_0xcf5c('0x42')]=_[_0xcf5c('0x46')](_0x1a797d[_0xcf5c('0x42')],{'$or':_[_0xcf5c('0x47')](_0x5c1616,function(_0xc7df00){if(_0xc7df00['type'][_0xcf5c('0x48')]!=='VIRTUAL'){var _0x1420f8={};_0x1420f8[_0xc7df00['field']]={'$like':'%'+_0x4d3f32[_0xcf5c('0x38')][_0xcf5c('0x45')]+'%'};return _0x1420f8;}})});}_0x1a797d=_['merge']({},_0x1a797d,_0x4d3f32[_0xcf5c('0x49')]);var _0x38e760={'where':_0x1a797d[_0xcf5c('0x42')]};return db[_0xcf5c('0x36')][_0xcf5c('0x24')](_0x38e760)['then'](function(_0x3c24a3){_0x1dc182[_0xcf5c('0x24')]=_0x3c24a3;if(_0x4d3f32[_0xcf5c('0x38')]['includeAll']){_0x1a797d['include']=[{'all':!![]}];}return db[_0xcf5c('0x36')][_0xcf5c('0x4a')](_0x1a797d);})[_0xcf5c('0x2c')](function(_0x3e75c7){_0x1dc182['rows']=_0x3e75c7;return _0x1dc182;})[_0xcf5c('0x2c')](respondWithFilteredResult(_0x2d1ab4,_0x1a797d))['catch'](handleError(_0x2d1ab4,null));};exports[_0xcf5c('0x4b')]=function(_0x2dc995,_0x1904fc){var _0x551ee8={'raw':!![],'where':{'id':_0x2dc995['params']['id']}},_0x3af3d3={};_0x3af3d3[_0xcf5c('0x3c')]=_[_0xcf5c('0x39')](db[_0xcf5c('0x36')][_0xcf5c('0x37')]);_0x3af3d3[_0xcf5c('0x38')]=_[_0xcf5c('0x39')](_0x2dc995['query']);_0x3af3d3[_0xcf5c('0x43')]=_[_0xcf5c('0x3a')](_0x3af3d3[_0xcf5c('0x3c')],_0x3af3d3[_0xcf5c('0x38')]);_0x551ee8[_0xcf5c('0x3b')]=_['intersection'](_0x3af3d3['model'],qs['fields'](_0x2dc995[_0xcf5c('0x38')][_0xcf5c('0x3d')]));_0x551ee8[_0xcf5c('0x3b')]=_0x551ee8[_0xcf5c('0x3b')][_0xcf5c('0x3e')]?_0x551ee8[_0xcf5c('0x3b')]:_0x3af3d3[_0xcf5c('0x3c')];if(_0x2dc995[_0xcf5c('0x38')][_0xcf5c('0x4c')]){_0x551ee8[_0xcf5c('0x4d')]=[{'all':!![]}];}_0x551ee8=_[_0xcf5c('0x46')]({},_0x551ee8,_0x2dc995[_0xcf5c('0x49')]);return db[_0xcf5c('0x36')][_0xcf5c('0x4e')](_0x551ee8)['then'](handleEntityNotFound(_0x1904fc,null))[_0xcf5c('0x2c')](respondWithResult(_0x1904fc,null))[_0xcf5c('0x4f')](handleError(_0x1904fc,null));};exports[_0xcf5c('0x50')]=function(_0x52af87,_0x5424f9,_0x55cada){return db[_0xcf5c('0x36')][_0xcf5c('0x4e')]({'where':{'id':_0x52af87[_0xcf5c('0x51')]['id']},'attributes':[_0xcf5c('0x33'),_0xcf5c('0x52')],'raw':!![]})['then'](handleEntityNotFound(_0x5424f9,null))[_0xcf5c('0x2c')](function(_0x3b9cf3){if(_0x3b9cf3){var _0x549de9=path[_0xcf5c('0x53')](config[_0xcf5c('0x54')],'server/files/plugins',util['format'](_0xcf5c('0x55'),path['basename'](_0x3b9cf3['path'])));var _0x29504c=fs[_0xcf5c('0x56')](_0x549de9);var _0x9706f4=archiver(_0xcf5c('0x57'),{'zlib':{'level':0x9}});_0x9706f4['on'](_0xcf5c('0x58'),function(_0x2e53de){if(_0x2e53de[_0xcf5c('0x59')]==='ENOENT'){logger[_0xcf5c('0x31')](_0x2e53de);}else{throw new db['Sequelize'][(_0xcf5c('0x5a'))](_0xcf5c('0x5b'));}});_0x9706f4['on'](_0xcf5c('0x31'),function(_0x3bb91f){throw new db['Sequelize'][(_0xcf5c('0x5a'))](_0xcf5c('0x5b'));});_0x9706f4[_0xcf5c('0x5c')](_0x29504c);_0x9706f4[_0xcf5c('0x5d')]('**/*',{'cwd':path[_0xcf5c('0x53')](config[_0xcf5c('0x54')],_0xcf5c('0x5e'),path[_0xcf5c('0x5f')](_0x3b9cf3['path'])),'ignore':[path[_0xcf5c('0x53')](path[_0xcf5c('0x60')](_0x3b9cf3[_0xcf5c('0x52')]),_0xcf5c('0x61')),path[_0xcf5c('0x53')](path[_0xcf5c('0x60')](_0x3b9cf3[_0xcf5c('0x52')]),'attachments/**/*')],'nodir':!![]})[_0xcf5c('0x62')]();_0x29504c['on'](_0xcf5c('0x63'),function(){if(!fs[_0xcf5c('0x64')](_0x549de9)){throw new db[(_0xcf5c('0x65'))][(_0xcf5c('0x5a'))]('Plugin\x20not\x20found');}return _0x5424f9[_0xcf5c('0x50')](_0x549de9,util[_0xcf5c('0x66')]('%s.zip',path['basename'](_0x3b9cf3['path'])),function(_0x7090e8){if(_0x7090e8){throw new db[(_0xcf5c('0x65'))]['Error'](_0xcf5c('0x67'));}fs[_0xcf5c('0x68')](_0x549de9);logger[_0xcf5c('0x69')]('Download\x20completed');logger['info'](_0xcf5c('0x6a'));});});}return null;})['catch'](handleError(_0x5424f9,null));};exports['upload']=function(_0x3aec28,_0x4f0672,_0xc89b5f){var _0x3fdd9a=path[_0xcf5c('0x60')](_0x3aec28[_0xcf5c('0x6b')][_0xcf5c('0x6c')],path[_0xcf5c('0x6d')](_0x3aec28[_0xcf5c('0x6b')][_0xcf5c('0x6c')]));var _0x3160c7=path[_0xcf5c('0x53')](config['root'],_0xcf5c('0x5e'),_0x3aec28[_0xcf5c('0x6b')][_0xcf5c('0x6c')]);var _0x26a7f9=path['join'](config[_0xcf5c('0x54')],_0xcf5c('0x5e'),_0x3fdd9a);logger['info'](_0xcf5c('0x6e'),_0x3160c7);logger['info'](_0xcf5c('0x6f'),_0x26a7f9);try{fs[_0xcf5c('0x70')](_0x3160c7,parseInt('0777',0x8));extract(_0x3160c7,{'dir':_0x26a7f9},function(_0x113303){if(_0x113303){logger[_0xcf5c('0x31')](_0x113303);handleError(_0x113303,!![]);};var _0x24fe59=fs[_0xcf5c('0x71')](_0x26a7f9);if(_0x24fe59[_0xcf5c('0x3e')]>0x1){removeReferences(_0x3160c7,_0x26a7f9);logger[_0xcf5c('0x31')](_0xcf5c('0x72'));return _0xc89b5f(new Error(_0xcf5c('0x72')));}var _0x49f116=fs['lstatSync'](path['join'](_0x26a7f9,_0x24fe59[0x0]));if(_0x49f116[_0xcf5c('0x73')]()){removeReferences(_0x3160c7,_0x26a7f9);logger[_0xcf5c('0x31')]('Invalid\x20plugin\x20structure');return _0xc89b5f(new Error('Invalid\x20plugin\x20structure'));}if(_0x49f116[_0xcf5c('0x74')]()){var _0x839293=fs[_0xcf5c('0x71')](path[_0xcf5c('0x53')](_0x26a7f9,_0x24fe59[0x0]));if(_0x839293['length']===0x0){removeReferences(_0x3160c7,_0x26a7f9);logger[_0xcf5c('0x31')](_0xcf5c('0x72'));return _0xc89b5f(new Error(_0xcf5c('0x72')));}var _0x56a489=_0x839293[_0xcf5c('0x75')](function(_0x23ad00){return _0x23ad00===_0xcf5c('0x76');});if(!_0x56a489){return _0xc89b5f(new Error(_0xcf5c('0x77')));}var _0x276890=fs[_0xcf5c('0x78')](path[_0xcf5c('0x53')](_0x26a7f9,_0x24fe59[0x0],'manifest.json'));var _0x4f9c64=JSON[_0xcf5c('0x79')](_0x276890);if(_0xcf5c('0x7a')==typeof _0x4f9c64[_0xcf5c('0x33')]){return _0xc89b5f(new Error(_0xcf5c('0x7b')));}if(_0xcf5c('0x7a')==typeof _0x4f9c64[_0xcf5c('0x7c')]){return _0xc89b5f(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0xcf5c('0x7a')==typeof _0x4f9c64[_0xcf5c('0x7d')]){return _0xc89b5f(new Error(_0xcf5c('0x7e')));}if(_0xcf5c('0x7a')==typeof _0x4f9c64[_0xcf5c('0x7f')]){return _0xc89b5f(new Error(_0xcf5c('0x80')));}if(_0x4f9c64['type']===_0xcf5c('0x81')){if(_0xcf5c('0x7a')==typeof _0x4f9c64[_0xcf5c('0x7f')][_0xcf5c('0x82')]){return _0xc89b5f(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0xcf5c('0x7a')==typeof _0x4f9c64['parameters'][_0xcf5c('0x82')][_0xcf5c('0x83')]&&_0xcf5c('0x7a')==typeof _0x4f9c64[_0xcf5c('0x7f')][_0xcf5c('0x82')][_0xcf5c('0x84')]){return _0xc89b5f(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x4f9c64[_0xcf5c('0x7c')]===_0xcf5c('0x85')){if(_0xcf5c('0x7a')==typeof _0x4f9c64[_0xcf5c('0x7f')]['scriptName']){return _0xc89b5f(new Error(_0xcf5c('0x86')));}if(_0xcf5c('0x7a')==typeof _0x4f9c64[_0xcf5c('0x7f')][_0xcf5c('0x87')]){return _0xc89b5f(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0xc89b5f(new Error(_0xcf5c('0x88')));}var _0x4dc011=_0x4f9c64[_0xcf5c('0x33')];var _0x10d5a7=_0x4f9c64['description'];var _0x3fd460=_0x4f9c64['type'];var _0x399bb0=_0x4f9c64[_0xcf5c('0x89')]?_0x4f9c64['sidebar']:_0xcf5c('0x8a');var _0x3c0a6b=_0x4f9c64[_0xcf5c('0x8b')]?_0x4f9c64['icon']:_0xcf5c('0x8c');var _0x41dfb9='';var _0x4bf044='';var _0x4071a7='';var _0x11656e='';var _0x31b1ff=_0x4f9c64[_0xcf5c('0x7d')];if(_0x3fd460===_0xcf5c('0x81')){if(_0xcf5c('0x7a')!=typeof _0x4f9c64[_0xcf5c('0x7f')][_0xcf5c('0x82')]['admin']){var _0x211d1a=_0x4f9c64[_0xcf5c('0x7f')]['views'][_0xcf5c('0x83')];if(!/^(f|ht)tps?:\/\//i[_0xcf5c('0x8d')](_0x211d1a)){_0x41dfb9=path[_0xcf5c('0x53')](_0xcf5c('0x8e'),_0x3fdd9a,_0x24fe59[0x0],_0x211d1a);}else{_0x41dfb9=_0x211d1a;}}else{logger[_0xcf5c('0x69')]('Warning:\x20admin\x20view\x20not\x20specified');}if(_0xcf5c('0x7a')!=typeof _0x4f9c64[_0xcf5c('0x7f')][_0xcf5c('0x82')][_0xcf5c('0x84')]){var _0x542c9f=_0x4f9c64[_0xcf5c('0x7f')][_0xcf5c('0x82')][_0xcf5c('0x84')];if(!/^(f|ht)tps?:\/\//i[_0xcf5c('0x8d')](_0x542c9f)){_0x4bf044=path[_0xcf5c('0x53')]('plugins',_0x3fdd9a,_0x24fe59[0x0],_0x542c9f);}else{_0x4bf044=_0x542c9f;}}else{logger[_0xcf5c('0x69')](_0xcf5c('0x8f'));}}else if(_0x3fd460==='script'){_0x4071a7=_0x4f9c64['parameters'][_0xcf5c('0x90')];_0x11656e=_0x4f9c64['parameters']['scriptPath'];if(_0xcf5c('0x7a')!=typeof _0x4f9c64[_0xcf5c('0x7f')][_0xcf5c('0x82')]){if(_0xcf5c('0x7a')!=typeof _0x4f9c64[_0xcf5c('0x7f')]['views'][_0xcf5c('0x83')]){var _0x211d1a=_0x4f9c64['parameters'][_0xcf5c('0x82')][_0xcf5c('0x83')];if(!/^(f|ht)tps?:\/\//i['test'](_0x211d1a)){_0x41dfb9=path['join'](_0xcf5c('0x8e'),_0x3fdd9a,_0x24fe59[0x0],_0x211d1a);}else{_0x41dfb9=_0x211d1a;}}if(_0xcf5c('0x7a')!=typeof _0x4f9c64['parameters'][_0xcf5c('0x82')]['agent']){var _0x542c9f=_0x4f9c64[_0xcf5c('0x7f')][_0xcf5c('0x82')]['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x542c9f)){_0x4bf044=path['join'](_0xcf5c('0x8e'),_0x3fdd9a,_0x24fe59[0x0],_0x542c9f);}else{_0x4bf044=_0x542c9f;}}}}var _0x266545={'name':_0x4dc011,'description':_0x10d5a7,'path':path[_0xcf5c('0x53')](_0x3fdd9a,_0x24fe59[0x0]),'type':_0x3fd460,'sidebar':_0x399bb0,'icon':_0x3c0a6b,'adminUrl':_0x41dfb9,'agentUrl':_0x4bf044,'scriptName':_0x4071a7,'scriptPath':_0x11656e,'version':_0x31b1ff};removeReferences(_0x3160c7,null);return db['Plugin'][_0xcf5c('0x91')](_0x266545)[_0xcf5c('0x2c')](function(_0x1fa73a){var _0x482443={'role':_0x3aec28[_0xcf5c('0x92')][_0xcf5c('0x93')],'userProfileId':_0x3aec28[_0xcf5c('0x92')][_0xcf5c('0x94')]};if(!_0x482443)throw new Error(_0xcf5c('0x95'));if(_0x482443[_0xcf5c('0x93')]===_0xcf5c('0x96')){var _0x4f2e34=_0x1fa73a[_0xcf5c('0x2e')]({'plain':!![]});return db[_0xcf5c('0x97')]['find']({'where':{'name':_0xcf5c('0x2f'),'userProfileId':_0x482443[_0xcf5c('0x94')]},'raw':!![]})[_0xcf5c('0x2c')](function(_0x3cf60c){if(_0x3cf60c&&_0x3cf60c['autoAssociation']===0x0){return db[_0xcf5c('0x30')]['create']({'name':_0x4f2e34[_0xcf5c('0x33')],'resourceId':_0x4f2e34['id'],'type':_0x3cf60c[_0xcf5c('0x33')],'sectionId':_0x3cf60c['id']},{})[_0xcf5c('0x2c')](function(){return _0x1fa73a;});}else{return _0x1fa73a;}})[_0xcf5c('0x4f')](function(_0x50f236){logger[_0xcf5c('0x31')](_0xcf5c('0x98'),_0x50f236);throw _0x50f236;});}return _0x1fa73a;})['then'](respondWithResult(_0x4f0672,null))[_0xcf5c('0x4f')](handleError(_0x4f0672,null));}});}catch(_0x45248e){_0x4f0672[_0xcf5c('0x21')](0x1f4)['send'](_0x45248e);}};function removeReferences(_0x34e08b,_0x2cbe89){try{if(_0x34e08b){fs[_0xcf5c('0x68')](_0x34e08b);logger['info'](_0xcf5c('0x99'));}if(_0x2cbe89){rimraf(_0x2cbe89,function(){});logger[_0xcf5c('0x69')](_0xcf5c('0x9a'));}}catch(_0x53da44){logger['error'](_0x53da44);}}exports['update']=function(_0x340926,_0x38a589,_0x20da99){return db[_0xcf5c('0x36')][_0xcf5c('0x4e')]({'where':{'id':_0x340926[_0xcf5c('0x51')]['id']}})[_0xcf5c('0x2c')](handleEntityNotFound(_0x38a589,null))[_0xcf5c('0x2c')](saveUpdates(_0x340926[_0xcf5c('0x92')],null))[_0xcf5c('0x2c')](respondWithResult(_0x38a589,null))['catch'](handleError(_0x38a589,null));};exports['delete']=function(_0x187bf9,_0x174f73,_0x2eaf7b){return db['Plugin'][_0xcf5c('0x4e')]({'where':{'id':_0x187bf9[_0xcf5c('0x51')]['id']}})['then'](function(_0x4cf505){if(_0x4cf505){return _0x4cf505[_0xcf5c('0x2d')]();}})[_0xcf5c('0x2c')](function(_0x559c6f){rimraf(path['join'](config['root'],_0xcf5c('0x5e'),path[_0xcf5c('0x5f')](_0x559c6f[_0xcf5c('0x52')])),function(){});return _0x559c6f;})[_0xcf5c('0x2c')](handleEntityNotFound(_0x174f73,null))[_0xcf5c('0x2c')](respondWithStatusCode(_0x174f73,null))[_0xcf5c('0x4f')](handleError(_0x174f73,null));};exports[_0xcf5c('0x9b')]=function(_0x49fd8a,_0x5a8bae,_0x3920d5){return BPromise[_0xcf5c('0x9c')]()[_0xcf5c('0x2c')](function(){if(!_0x49fd8a['query'][_0xcf5c('0x52')]){throw new Error(_0xcf5c('0x9d'));}if(!_0x49fd8a[_0xcf5c('0x38')]['port']){throw new Error(_0xcf5c('0x9e'));}var _0xcc4f0b=_0x49fd8a[_0xcf5c('0x38')][_0xcf5c('0x9f')]?_0x49fd8a[_0xcf5c('0x38')][_0xcf5c('0x9f')]+':'+_0x49fd8a[_0xcf5c('0x38')]['port']:'http://localhost:'+_0x49fd8a[_0xcf5c('0x38')][_0xcf5c('0xa0')];var _0x3a9770=_0x49fd8a[_0xcf5c('0x38')][_0xcf5c('0x23')]?_0x49fd8a[_0xcf5c('0x38')][_0xcf5c('0x23')]:!![];var _0x2d2437=_0x49fd8a[_0xcf5c('0x38')][_0xcf5c('0xa1')]?_0x49fd8a['query'][_0xcf5c('0xa1')]:null;var _0x5d88fe={'method':_0x49fd8a[_0xcf5c('0xa2')],'uri':util[_0xcf5c('0x66')]('%s%s',_0xcc4f0b,_0x49fd8a['query'][_0xcf5c('0x52')]),'json':_0x3a9770,'resolveWithFullResponse':!![],'encoding':_0x2d2437,'qs':_0x49fd8a['query']};if(_0x49fd8a[_0xcf5c('0xa3')]){_0x5d88fe[_0xcf5c('0xa3')]=_0x49fd8a[_0xcf5c('0xa3')];if(_0x5d88fe[_0xcf5c('0xa3')][_0xcf5c('0xa4')]){delete _0x5d88fe[_0xcf5c('0xa3')]['content-length'];}}if(_0x5d88fe[_0xcf5c('0xa3')]['content-type']){delete _0x5d88fe[_0xcf5c('0xa3')][_0xcf5c('0xa5')];}return rp(_0x5d88fe);})[_0xcf5c('0x2c')](function(_0x503dc1){if(_0x503dc1){_0x5a8bae[_0xcf5c('0x27')](_0x503dc1[_0xcf5c('0xa3')]);logger[_0xcf5c('0x69')](_0x503dc1[_0xcf5c('0x92')]);if(_['endsWith'](_0x49fd8a[_0xcf5c('0x38')][_0xcf5c('0x52')],_0xcf5c('0x50'))&&_0x503dc1[_0xcf5c('0xa6')]==0x1f4){return _0x5a8bae[_0xcf5c('0x20')](_0x503dc1[_0xcf5c('0xa6')]);}else{return _0x5a8bae[_0xcf5c('0x21')](_0x503dc1[_0xcf5c('0xa6')])[_0xcf5c('0x34')](_0x503dc1[_0xcf5c('0x92')]);}}else{return _0x5a8bae['sendStatus'](0xc8);}})['catch'](handleError(_0x5a8bae,null));};exports['webhookPost']=function(_0x2801e9,_0x568da4,_0x231996){return BPromise[_0xcf5c('0x9c')]()[_0xcf5c('0x2c')](function(){if(!_0x2801e9['query'][_0xcf5c('0x52')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x2801e9[_0xcf5c('0x38')][_0xcf5c('0xa0')]){throw new Error(_0xcf5c('0x9e'));}var _0x9d591=_0x2801e9[_0xcf5c('0x38')]['hostname']?_0x2801e9[_0xcf5c('0x38')][_0xcf5c('0x9f')]+':'+_0x2801e9[_0xcf5c('0x38')][_0xcf5c('0xa0')]:'http://localhost:'+_0x2801e9[_0xcf5c('0x38')][_0xcf5c('0xa0')];var _0x11502a=_0x2801e9[_0xcf5c('0x38')][_0xcf5c('0x23')]?_0x2801e9['query']['json']:!![];var _0x347a74=_0x2801e9[_0xcf5c('0x38')][_0xcf5c('0xa1')]?_0x2801e9[_0xcf5c('0x38')][_0xcf5c('0xa1')]:null;var _0x3b350d={'method':_0x2801e9['method'],'uri':util[_0xcf5c('0x66')](_0xcf5c('0xa7'),_0x9d591,_0x2801e9['query'][_0xcf5c('0x52')]),'json':_0x11502a,'resolveWithFullResponse':!![],'encoding':_0x347a74,'body':_0x2801e9['body']};if(_0x2801e9[_0xcf5c('0xa3')]){_0x3b350d[_0xcf5c('0xa3')]=_0x2801e9[_0xcf5c('0xa3')];if(_0x3b350d[_0xcf5c('0xa3')][_0xcf5c('0xa4')]){delete _0x3b350d[_0xcf5c('0xa3')][_0xcf5c('0xa4')];}}if(_0x3b350d[_0xcf5c('0xa3')][_0xcf5c('0xa5')]){delete _0x3b350d[_0xcf5c('0xa3')]['content-type'];}return rp(_0x3b350d);})['then'](function(_0x4c8ca7){if(_0x4c8ca7){_0x568da4['set'](_0x4c8ca7['headers']);logger[_0xcf5c('0x69')](_0x4c8ca7[_0xcf5c('0x92')]);return _0x568da4[_0xcf5c('0x21')](_0x4c8ca7['statusCode'])[_0xcf5c('0x34')](_0x4c8ca7[_0xcf5c('0x92')]);}else{return _0x568da4[_0xcf5c('0x20')](0xc8);}})['catch'](handleError(_0x568da4,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index fcb39e5..7d8d428 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 _0xe2b0=['Plugin','setMaxListeners','save','update','remove','hook','events'];(function(_0x5cc8b9,_0x20e3c3){var _0x58892e=function(_0x87457a){while(--_0x87457a){_0x5cc8b9['push'](_0x5cc8b9['shift']());}};_0x58892e(++_0x20e3c3);}(_0xe2b0,0x148));var _0x0e2b=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xe2b0[_0x1facfa];return _0x9ec701;};'use strict';var EventEmitter=require(_0x0e2b('0x0'));var Plugin=require('../../mysqldb')['db'][_0x0e2b('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x0e2b('0x2')](0x0);var events={'afterCreate':_0x0e2b('0x3'),'afterUpdate':_0x0e2b('0x4'),'afterDestroy':_0x0e2b('0x5')};function emitEvent(_0x66eb14){return function(_0x131e4,_0x15ee42,_0x287a49){PluginEvents['emit'](_0x66eb14+':'+_0x131e4['id'],_0x131e4);PluginEvents['emit'](_0x66eb14,_0x131e4);_0x287a49(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0x0e2b('0x6')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file +var _0x669f=['Plugin','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x43b5a7,_0xf5e3d6){var _0x5461fe=function(_0x5d9d5a){while(--_0x5d9d5a){_0x43b5a7['push'](_0x43b5a7['shift']());}};_0x5461fe(++_0xf5e3d6);}(_0x669f,0x12a));var _0xf669=function(_0x2cc8bb,_0x5f2607){_0x2cc8bb=_0x2cc8bb-0x0;var _0x140e40=_0x669f[_0x2cc8bb];return _0x140e40;};'use strict';var EventEmitter=require(_0xf669('0x0'));var Plugin=require(_0xf669('0x1'))['db'][_0xf669('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xf669('0x3')](0x0);var events={'afterCreate':_0xf669('0x4'),'afterUpdate':'update','afterDestroy':_0xf669('0x5')};function emitEvent(_0x5326f9){return function(_0x5a1672,_0x2f22e2,_0x15859a){PluginEvents[_0xf669('0x6')](_0x5326f9+':'+_0x5a1672['id'],_0x5a1672);PluginEvents[_0xf669('0x6')](_0x5326f9,_0x5a1672);_0x15859a(null);};}for(var e in events){if(events[_0xf669('0x7')](e)){var event=events[e];Plugin[_0xf669('0x8')](e,emitEvent(event));}}module[_0xf669('0x9')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index aa9a4ee..83bdbaa 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 _0x5df5=['rimraf','../../config/environment','./plugin.attributes','exports','define','Plugin','plugins','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x27d570,_0x4e8804){var _0x233138=function(_0x36b224){while(--_0x36b224){_0x27d570['push'](_0x27d570['shift']());}};_0x233138(++_0x4e8804);}(_0x5df5,0x70));var _0x55df=function(_0x504490,_0x13bb02){_0x504490=_0x504490-0x0;var _0x271857=_0x5df5[_0x504490];return _0x271857;};'use strict';var _=require(_0x55df('0x0'));var util=require(_0x55df('0x1'));var logger=require(_0x55df('0x2'))(_0x55df('0x3'));var moment=require(_0x55df('0x4'));var BPromise=require(_0x55df('0x5'));var rp=require(_0x55df('0x6'));var fs=require('fs');var path=require(_0x55df('0x7'));var rimraf=require(_0x55df('0x8'));var config=require(_0x55df('0x9'));var attributes=require(_0x55df('0xa'));module[_0x55df('0xb')]=function(_0x41ea9c,_0x259c4a){return _0x41ea9c[_0x55df('0xc')](_0x55df('0xd'),attributes,{'tableName':_0x55df('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7ed1=['api','moment','bluebird','request-promise','path','../../config/environment','./plugin.attributes','exports','Plugin','plugins','lodash','../../config/logger'];(function(_0x49b85b,_0x26fb33){var _0x3b00f9=function(_0x192244){while(--_0x192244){_0x49b85b['push'](_0x49b85b['shift']());}};_0x3b00f9(++_0x26fb33);}(_0x7ed1,0xca));var _0x17ed=function(_0xef8146,_0x459c34){_0xef8146=_0xef8146-0x0;var _0x5a6cb0=_0x7ed1[_0xef8146];return _0x5a6cb0;};'use strict';var _=require(_0x17ed('0x0'));var util=require('util');var logger=require(_0x17ed('0x1'))(_0x17ed('0x2'));var moment=require(_0x17ed('0x3'));var BPromise=require(_0x17ed('0x4'));var rp=require(_0x17ed('0x5'));var fs=require('fs');var path=require(_0x17ed('0x6'));var rimraf=require('rimraf');var config=require(_0x17ed('0x7'));var attributes=require(_0x17ed('0x8'));module[_0x17ed('0x9')]=function(_0x15583a,_0x569334){return _0x15583a['define'](_0x17ed('0xa'),attributes,{'tableName':_0x17ed('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 bee3a09..d96b949 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 _0xcffa=['localhost','socket.io-emitter','./plugin.socket','register','then','info','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','Plugin,\x20%s,\x20%s','message','result','CreatePlugin','Plugin','create','body','options','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults'];(function(_0x58fc32,_0x4851a6){var _0xbf6b14=function(_0x3596ab){while(--_0x3596ab){_0x58fc32['push'](_0x58fc32['shift']());}};_0xbf6b14(++_0x4851a6);}(_0xcffa,0x175));var _0xacff=function(_0xab88e4,_0x4a4c61){_0xab88e4=_0xab88e4-0x0;var _0x41078a=_0xcffa[_0xab88e4];return _0x41078a;};'use strict';var _=require('lodash');var util=require(_0xacff('0x0'));var moment=require(_0xacff('0x1'));var BPromise=require('bluebird');var rs=require(_0xacff('0x2'));var fs=require('fs');var Redis=require(_0xacff('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xacff('0x4'));var logger=require(_0xacff('0x5'))(_0xacff('0x6'));var config=require('../../config/environment');var jayson=require(_0xacff('0x7'));var client=jayson['client'][_0xacff('0x8')]({'port':0x232a});config[_0xacff('0x9')]=_[_0xacff('0xa')](config[_0xacff('0x9')],{'host':_0xacff('0xb'),'port':0x18eb});var socket=require(_0xacff('0xc'))(new Redis(config['redis']));require(_0xacff('0xd'))[_0xacff('0xe')](socket);function respondWithRpcPromise(_0x48d870,_0x266a3b,_0x2db8ae){return new BPromise(function(_0x741d00,_0x2e1694){return client['request'](_0x48d870,_0x2db8ae)[_0xacff('0xf')](function(_0x595e66){logger[_0xacff('0x10')]('Plugin,\x20%s,\x20%s',_0x266a3b,_0xacff('0x11'));logger[_0xacff('0x12')](_0xacff('0x13'),_0x266a3b,_0xacff('0x11'),JSON[_0xacff('0x14')](_0x595e66));if(_0x595e66[_0xacff('0x15')]){if(_0x595e66[_0xacff('0x15')][_0xacff('0x16')]===0x1f4){logger['error'](_0xacff('0x17'),_0x266a3b,_0x595e66['error'][_0xacff('0x18')]);return _0x2e1694(_0x595e66[_0xacff('0x15')][_0xacff('0x18')]);}logger['error'](_0xacff('0x17'),_0x266a3b,_0x595e66[_0xacff('0x15')][_0xacff('0x18')]);return _0x741d00(_0x595e66[_0xacff('0x15')][_0xacff('0x18')]);}else{logger[_0xacff('0x10')](_0xacff('0x17'),_0x266a3b,'request\x20sent');_0x741d00(_0x595e66[_0xacff('0x19')][_0xacff('0x18')]);}})['catch'](function(_0x4de902){logger[_0xacff('0x15')](_0xacff('0x17'),_0x266a3b,_0x4de902);_0x2e1694(_0x4de902);});});}exports[_0xacff('0x1a')]=function(_0x1513bd){var _0x18a997=this;return new Promise(function(_0x8af19c,_0x2817e9){return db[_0xacff('0x1b')][_0xacff('0x1c')](_0x1513bd[_0xacff('0x1d')],{'raw':_0x1513bd['options']?_0x1513bd[_0xacff('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0xacff('0xf')](function(_0x7dc6e7){logger[_0xacff('0x10')]('CreatePlugin',_0x1513bd);logger[_0xacff('0x12')](_0xacff('0x1a'),_0x1513bd,JSON['stringify'](_0x7dc6e7));_0x8af19c(_0x7dc6e7);})[_0xacff('0x1f')](function(_0x95660b){logger[_0xacff('0x15')](_0xacff('0x1a'),_0x95660b['message'],_0x1513bd);_0x2817e9(_0x18a997['error'](0x1f4,_0x95660b[_0xacff('0x18')]));});});}; \ No newline at end of file +var _0xf991=['defaults','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','Plugin','create','body','options','CreatePlugin','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis'];(function(_0x137692,_0x338587){var _0x43d5a8=function(_0x40c350){while(--_0x40c350){_0x137692['push'](_0x137692['shift']());}};_0x43d5a8(++_0x338587);}(_0xf991,0x155));var _0x1f99=function(_0x43de22,_0x1eced6){_0x43de22=_0x43de22-0x0;var _0x4b15ee=_0xf991[_0x43de22];return _0x4b15ee;};'use strict';var _=require(_0x1f99('0x0'));var util=require('util');var moment=require(_0x1f99('0x1'));var BPromise=require('bluebird');var rs=require(_0x1f99('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1f99('0x3'))['db'];var utils=require(_0x1f99('0x4'));var logger=require(_0x1f99('0x5'))(_0x1f99('0x6'));var config=require(_0x1f99('0x7'));var jayson=require(_0x1f99('0x8'));var client=jayson['client'][_0x1f99('0x9')]({'port':0x232a});config[_0x1f99('0xa')]=_[_0x1f99('0xb')](config['redis'],{'host':_0x1f99('0xc'),'port':0x18eb});var socket=require(_0x1f99('0xd'))(new Redis(config[_0x1f99('0xa')]));require(_0x1f99('0xe'))[_0x1f99('0xf')](socket);function respondWithRpcPromise(_0x19146f,_0x4127da,_0x91c6a7){return new BPromise(function(_0xe1b5e5,_0x39f870){return client[_0x1f99('0x10')](_0x19146f,_0x91c6a7)[_0x1f99('0x11')](function(_0x51fed8){logger[_0x1f99('0x12')](_0x1f99('0x13'),_0x4127da,'request\x20sent');logger[_0x1f99('0x14')](_0x1f99('0x15'),_0x4127da,'request\x20sent',JSON[_0x1f99('0x16')](_0x51fed8));if(_0x51fed8[_0x1f99('0x17')]){if(_0x51fed8[_0x1f99('0x17')][_0x1f99('0x18')]===0x1f4){logger[_0x1f99('0x17')]('Plugin,\x20%s,\x20%s',_0x4127da,_0x51fed8[_0x1f99('0x17')][_0x1f99('0x19')]);return _0x39f870(_0x51fed8[_0x1f99('0x17')][_0x1f99('0x19')]);}logger['error'](_0x1f99('0x13'),_0x4127da,_0x51fed8['error']['message']);return _0xe1b5e5(_0x51fed8[_0x1f99('0x17')]['message']);}else{logger[_0x1f99('0x12')](_0x1f99('0x13'),_0x4127da,'request\x20sent');_0xe1b5e5(_0x51fed8['result'][_0x1f99('0x19')]);}})[_0x1f99('0x1a')](function(_0x7d1ae6){logger['error'](_0x1f99('0x13'),_0x4127da,_0x7d1ae6);_0x39f870(_0x7d1ae6);});});}exports['CreatePlugin']=function(_0x14deb1){var _0x3a5a17=this;return new Promise(function(_0x303263,_0x3e1203){return db[_0x1f99('0x1b')][_0x1f99('0x1c')](_0x14deb1[_0x1f99('0x1d')],{'raw':_0x14deb1[_0x1f99('0x1e')]?_0x14deb1[_0x1f99('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0x1f99('0x11')](function(_0x3e3435){logger[_0x1f99('0x12')](_0x1f99('0x1f'),_0x14deb1);logger[_0x1f99('0x14')](_0x1f99('0x1f'),_0x14deb1,JSON['stringify'](_0x3e3435));_0x303263(_0x3e3435);})[_0x1f99('0x1a')](function(_0x3fbf7a){logger[_0x1f99('0x17')]('CreatePlugin',_0x3fbf7a[_0x1f99('0x19')],_0x14deb1);_0x3e1203(_0x3a5a17[_0x1f99('0x17')](0x1f4,_0x3fbf7a[_0x1f99('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index a9e012e..640f5e1 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 _0x9e76=['length','plugin:','./plugin.events','update','removeListener'];(function(_0x160151,_0x3ad0f0){var _0xadd082=function(_0x54615c){while(--_0x54615c){_0x160151['push'](_0x160151['shift']());}};_0xadd082(++_0x3ad0f0);}(_0x9e76,0x179));var _0x69e7=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0x9e76[_0x22b68a];return _0x1ac67a;};'use strict';var PluginEvents=require(_0x69e7('0x0'));var events=['save','remove',_0x69e7('0x1')];function createListener(_0x4f869b,_0x48710c){return function(_0x437ef4){_0x48710c['emit'](_0x4f869b,_0x437ef4);};}function removeListener(_0x4c102b,_0x231c4a){return function(){PluginEvents[_0x69e7('0x2')](_0x4c102b,_0x231c4a);};}exports['register']=function(_0x76531c){for(var _0x5d3dc4=0x0,_0x2c10df=events[_0x69e7('0x3')];_0x5d3dc4<_0x2c10df;_0x5d3dc4++){var _0x114dcc=events[_0x5d3dc4];var _0xc8d4bf=createListener(_0x69e7('0x4')+_0x114dcc,_0x76531c);PluginEvents['on'](_0x114dcc,_0xc8d4bf);}}; \ No newline at end of file +var _0x2ab3=['register','length','./plugin.events','save','update','emit'];(function(_0x5d3903,_0x3d6c3e){var _0x4b8bc9=function(_0x92b297){while(--_0x92b297){_0x5d3903['push'](_0x5d3903['shift']());}};_0x4b8bc9(++_0x3d6c3e);}(_0x2ab3,0x15e));var _0x32ab=function(_0x13843f,_0x50422d){_0x13843f=_0x13843f-0x0;var _0x1063ae=_0x2ab3[_0x13843f];return _0x1063ae;};'use strict';var PluginEvents=require(_0x32ab('0x0'));var events=[_0x32ab('0x1'),'remove',_0x32ab('0x2')];function createListener(_0x267b29,_0x1713e2){return function(_0x9f14fa){_0x1713e2[_0x32ab('0x3')](_0x267b29,_0x9f14fa);};}function removeListener(_0x336e79,_0x33c2b7){return function(){PluginEvents['removeListener'](_0x336e79,_0x33c2b7);};}exports[_0x32ab('0x4')]=function(_0x32f99d){for(var _0x4d4674=0x0,_0x3ee370=events[_0x32ab('0x5')];_0x4d4674<_0x3ee370;_0x4d4674++){var _0xdedd42=events[_0x4d4674];var _0x533b98=createListener('plugin:'+_0xdedd42,_0x32f99d);PluginEvents['on'](_0xdedd42,_0x533b98);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index b076463..f740fbc 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(_0x4fd315,_0x2eab02){var _0x47e345=function(_0x5b2a21){while(--_0x5b2a21){_0x4fd315['push'](_0x4fd315['shift']());}};_0x47e345(++_0x2eab02);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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(_0x2e401a,_0x570b47){var _0x246db5=function(_0x39a714){while(--_0x39a714){_0x2e401a['push'](_0x2e401a['shift']());}};_0x246db5(++_0x570b47);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'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 0d030ce..3504b9c 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 _0x82a2=['name','express','motion2','length','catch','show','describe','create','body','script','join','chdir','start','dump','restart','hasOwnProperty','params','Unknown\x20status','destroy','delete','lodash','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status','error','stack','send','npm\x20install','info','index','list','then','reject'];(function(_0x4216e4,_0x153ba0){var _0x5cd4d0=function(_0x46d840){while(--_0x46d840){_0x4216e4['push'](_0x4216e4['shift']());}};_0x5cd4d0(++_0x153ba0);}(_0x82a2,0x1e8));var _0x282a=function(_0x40cd65,_0x324dbf){_0x40cd65=_0x40cd65-0x0;var _0x1f91e7=_0x82a2[_0x40cd65];return _0x1f91e7;};'use strict';var _=require(_0x282a('0x0'));var pm2=require(_0x282a('0x1'));var logger=require(_0x282a('0x2'))(_0x282a('0x3'));var path=require(_0x282a('0x4'));var exec=require(_0x282a('0x5'))[_0x282a('0x6')];var BPromise=require(_0x282a('0x7'));function handleEntityNotFound(_0x3f4008,_0x404c96){return function(_0x371005){if(!_0x371005){_0x3f4008[_0x282a('0x8')](0x194);;}return _0x371005;};}function respondWithResult(_0xa10380,_0x3b85dc){_0x3b85dc=_0x3b85dc||0xc8;return function(_0x3236bf){if(_0x3236bf){return _0xa10380[_0x282a('0x9')](_0x3b85dc)['json'](_0x3236bf);}return null;};}function handleError(_0x3abe65,_0x46d8e4){_0x46d8e4=_0x46d8e4||0x1f4;return function(_0x4c33e6){logger[_0x282a('0xa')](_0x4c33e6[_0x282a('0xb')]);if(_0x4c33e6['name']){delete _0x4c33e6['name'];}_0x3abe65[_0x282a('0x9')](_0x46d8e4)[_0x282a('0xc')](_0x4c33e6);};}function execChildProcess(){return new BPromise(function(_0x19e743,_0x16955b){exec(_0x282a('0xd'),function(_0x1e1320,_0x34c693,_0x34c885){logger['info'](_0x34c693);logger[_0x282a('0xe')](_0x34c885);if(_0x1e1320){logger['error'](_0x1e1320);return _0x16955b(_0x1e1320);}return _0x19e743(_0x34c693);});});}exports[_0x282a('0xf')]=function(_0x4e7c5d,_0x416fef){return pm2[_0x282a('0x10')]()[_0x282a('0x11')](function(_0x2b2d5d){if(_0x2b2d5d){var _0x45e168=_[_0x282a('0x12')](_0x2b2d5d,function(_0x48d11d){return _0x48d11d[_0x282a('0x13')]===_0x282a('0x14')||_0x48d11d[_0x282a('0x13')]===_0x282a('0x15');});return{'rows':_0x45e168,'count':_0x45e168[_0x282a('0x16')]};}return null;})[_0x282a('0x11')](respondWithResult(_0x416fef,null))[_0x282a('0x17')](handleError(_0x416fef,null));};exports[_0x282a('0x18')]=function(_0x5ddb0c,_0x14c4d7){return pm2[_0x282a('0x19')](_0x5ddb0c['params']['id'])[_0x282a('0x11')](respondWithResult(_0x14c4d7,null))['then'](handleEntityNotFound(_0x14c4d7,null))[_0x282a('0x17')](handleError(_0x14c4d7,null));};exports[_0x282a('0x1a')]=function(_0x31f3f2,_0x301b94){if(_0x31f3f2[_0x282a('0x1b')][_0x282a('0x13')]&&_0x31f3f2['body'][_0x282a('0x1c')]){var _0x1e96cf=path[_0x282a('0x1d')](__dirname,'../../files/plugins',_0x31f3f2[_0x282a('0x1b')][_0x282a('0x1c')]);var _0xee8ef7=process['cwd']();process[_0x282a('0x1e')](path['dirname'](_0x1e96cf));return execChildProcess()['then'](function(_0x70a3eb){process[_0x282a('0x1e')](_0xee8ef7);return pm2[_0x282a('0x1f')]({'name':_0x31f3f2['body'][_0x282a('0x13')],'script':_0x1e96cf});})[_0x282a('0x11')](function(_0x41edc4){pm2[_0x282a('0x20')]();return _0x41edc4[0x0];})[_0x282a('0x11')](respondWithResult(_0x301b94,0xc9))['catch'](handleError(_0x301b94,null));}else{return _0x301b94[_0x282a('0x9')](0x1f4)[_0x282a('0xc')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports['update']=function(_0x25ea85,_0x45c7f4){if(_0x25ea85[_0x282a('0x1b')]['id']){delete _0x25ea85[_0x282a('0x1b')]['id'];}var _0x2943dc={'online':_0x282a('0x21'),'stopped':'stop'};if(_0x2943dc[_0x282a('0x22')](_0x25ea85[_0x282a('0x1b')][_0x282a('0x9')])){return pm2[_0x2943dc[_0x25ea85[_0x282a('0x1b')][_0x282a('0x9')]]](_0x25ea85[_0x282a('0x23')]['id'])['then'](respondWithResult(_0x45c7f4,0xc8))[_0x282a('0x17')](handleError(_0x45c7f4,null));}else{return _0x45c7f4['status'](0x1f4)['send']({'message':_0x282a('0x24')});}};exports[_0x282a('0x25')]=function(_0x44ca99,_0x5ed154){if(_0x44ca99['body']['id']){delete _0x44ca99[_0x282a('0x1b')]['id'];}if(_0x44ca99[_0x282a('0x23')]['id']){return pm2[_0x282a('0x26')](_0x44ca99['params']['id'])['then'](function(_0x46b6a4){pm2[_0x282a('0x20')]();return _0x46b6a4[0x0];})[_0x282a('0x11')](respondWithResult(_0x5ed154,null))[_0x282a('0x17')](handleError(_0x5ed154,null));}else{return _0x5ed154[_0x282a('0x9')](0x1f4)['send']({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0x1329=['info','list','then','reject','express','show','describe','params','catch','create','body','script','join','../../files/plugins','cwd','chdir','dump','send','update','restart','stop','hasOwnProperty','Unknown\x20status','delete','lodash','../../config/pm2','../../config/logger','child_process','bluebird','sendStatus','status','error','stack','name','npm\x20install'];(function(_0x2b02d0,_0x1b607b){var _0x5a586e=function(_0x15a9ba){while(--_0x15a9ba){_0x2b02d0['push'](_0x2b02d0['shift']());}};_0x5a586e(++_0x1b607b);}(_0x1329,0x199));var _0x9132=function(_0x1f61de,_0x53b837){_0x1f61de=_0x1f61de-0x0;var _0x3deb6d=_0x1329[_0x1f61de];return _0x3deb6d;};'use strict';var _=require(_0x9132('0x0'));var pm2=require(_0x9132('0x1'));var logger=require(_0x9132('0x2'))('api');var path=require('path');var exec=require(_0x9132('0x3'))['exec'];var BPromise=require(_0x9132('0x4'));function handleEntityNotFound(_0x177bdf,_0x540e67){return function(_0x472a95){if(!_0x472a95){_0x177bdf[_0x9132('0x5')](0x194);;}return _0x472a95;};}function respondWithResult(_0x4c4104,_0x2fb35e){_0x2fb35e=_0x2fb35e||0xc8;return function(_0x46e1ac){if(_0x46e1ac){return _0x4c4104[_0x9132('0x6')](_0x2fb35e)['json'](_0x46e1ac);}return null;};}function handleError(_0x4873d2,_0x3ceac0){_0x3ceac0=_0x3ceac0||0x1f4;return function(_0xf4cf1){logger[_0x9132('0x7')](_0xf4cf1[_0x9132('0x8')]);if(_0xf4cf1['name']){delete _0xf4cf1[_0x9132('0x9')];}_0x4873d2['status'](_0x3ceac0)['send'](_0xf4cf1);};}function execChildProcess(){return new BPromise(function(_0x2c6003,_0x362f86){exec(_0x9132('0xa'),function(_0x1d423e,_0x72c009,_0x1df6e1){logger[_0x9132('0xb')](_0x72c009);logger[_0x9132('0xb')](_0x1df6e1);if(_0x1d423e){logger['error'](_0x1d423e);return _0x362f86(_0x1d423e);}return _0x2c6003(_0x72c009);});});}exports['index']=function(_0x331050,_0x2db987){return pm2[_0x9132('0xc')]()[_0x9132('0xd')](function(_0x3bd065){if(_0x3bd065){var _0x507133=_[_0x9132('0xe')](_0x3bd065,function(_0x4d4968){return _0x4d4968[_0x9132('0x9')]===_0x9132('0xf')||_0x4d4968['name']==='motion2';});return{'rows':_0x507133,'count':_0x507133['length']};}return null;})[_0x9132('0xd')](respondWithResult(_0x2db987,null))['catch'](handleError(_0x2db987,null));};exports[_0x9132('0x10')]=function(_0x90d9c0,_0xbc0914){return pm2[_0x9132('0x11')](_0x90d9c0[_0x9132('0x12')]['id'])[_0x9132('0xd')](respondWithResult(_0xbc0914,null))['then'](handleEntityNotFound(_0xbc0914,null))[_0x9132('0x13')](handleError(_0xbc0914,null));};exports[_0x9132('0x14')]=function(_0x3e626a,_0x8fb09f){if(_0x3e626a[_0x9132('0x15')][_0x9132('0x9')]&&_0x3e626a[_0x9132('0x15')][_0x9132('0x16')]){var _0x4a5460=path[_0x9132('0x17')](__dirname,_0x9132('0x18'),_0x3e626a[_0x9132('0x15')][_0x9132('0x16')]);var _0x1b408a=process[_0x9132('0x19')]();process[_0x9132('0x1a')](path['dirname'](_0x4a5460));return execChildProcess()['then'](function(_0x4e4916){process[_0x9132('0x1a')](_0x1b408a);return pm2['start']({'name':_0x3e626a[_0x9132('0x15')][_0x9132('0x9')],'script':_0x4a5460});})[_0x9132('0xd')](function(_0x2d318d){pm2[_0x9132('0x1b')]();return _0x2d318d[0x0];})[_0x9132('0xd')](respondWithResult(_0x8fb09f,0xc9))['catch'](handleError(_0x8fb09f,null));}else{return _0x8fb09f[_0x9132('0x6')](0x1f4)[_0x9132('0x1c')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x9132('0x1d')]=function(_0x28fa66,_0x301d50){if(_0x28fa66[_0x9132('0x15')]['id']){delete _0x28fa66['body']['id'];}var _0x37a06b={'online':_0x9132('0x1e'),'stopped':_0x9132('0x1f')};if(_0x37a06b[_0x9132('0x20')](_0x28fa66['body']['status'])){return pm2[_0x37a06b[_0x28fa66['body'][_0x9132('0x6')]]](_0x28fa66[_0x9132('0x12')]['id'])[_0x9132('0xd')](respondWithResult(_0x301d50,0xc8))[_0x9132('0x13')](handleError(_0x301d50,null));}else{return _0x301d50[_0x9132('0x6')](0x1f4)['send']({'message':_0x9132('0x21')});}};exports['destroy']=function(_0x22e281,_0x2d32a7){if(_0x22e281['body']['id']){delete _0x22e281['body']['id'];}if(_0x22e281['params']['id']){return pm2[_0x9132('0x22')](_0x22e281['params']['id'])[_0x9132('0xd')](function(_0x41b3cc){pm2[_0x9132('0x1b')]();return _0x41b3cc[0x0];})[_0x9132('0xd')](respondWithResult(_0x2d32a7,null))[_0x9132('0x13')](handleError(_0x2d32a7,null));}else{return _0x2d32a7[_0x9132('0x6')](0x1f4)['send']({'message':'Unknown\x20id'});}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 28ff42d..3b41ca4 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 _0xc1db=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xc1db,0x120));var _0xbc1d=function(_0x57a0bd,_0x1a0cf1){_0x57a0bd=_0x57a0bd-0x0;var _0x454b58=_0xc1db[_0x57a0bd];return _0x454b58;};'use strict';var multer=require(_0xbc1d('0x0'));var util=require('util');var path=require(_0xbc1d('0x1'));var timeout=require(_0xbc1d('0x2'));var express=require(_0xbc1d('0x3'));var router=express[_0xbc1d('0x4')]();var auth=require(_0xbc1d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbc1d('0x6'));module[_0xbc1d('0x7')]=router; \ No newline at end of file +var _0x23f4=['../../components/auth/service','../../components/interaction/service','../../config/environment','exports','util','express','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x23f4,0x1ee));var _0x423f=function(_0x361936,_0x3047a4){_0x361936=_0x361936-0x0;var _0x13b4f7=_0x23f4[_0x361936];return _0x13b4f7;};'use strict';var multer=require('multer');var util=require(_0x423f('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x423f('0x1'));var router=express[_0x423f('0x2')]();var auth=require(_0x423f('0x3'));var interaction=require(_0x423f('0x4'));var config=require(_0x423f('0x5'));module[_0x423f('0x6')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 09e5067..b330e2d 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 _0xa1bd=['STRING','DATE','sequelize','exports','INTEGER'];(function(_0x2d2bbb,_0x311dd4){var _0x243fe1=function(_0x226a44){while(--_0x226a44){_0x2d2bbb['push'](_0x2d2bbb['shift']());}};_0x243fe1(++_0x311dd4);}(_0xa1bd,0x160));var _0xda1b=function(_0x496623,_0x39258e){_0x496623=_0x496623-0x0;var _0xb8480=_0xa1bd[_0x496623];return _0xb8480;};'use strict';var Sequelize=require(_0xda1b('0x0'));module[_0xda1b('0x1')]={'state':{'type':Sequelize[_0xda1b('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xda1b('0x3')]},'scheduledat':{'type':Sequelize[_0xda1b('0x4')]},'uniqueid':{'type':Sequelize[_0xda1b('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xda1b('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xda1b('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xda1b('0x3')]}}; \ No newline at end of file +var _0xac32=['DATE','INTEGER','sequelize','exports','STRING'];(function(_0x20c3b9,_0x45e36d){var _0x1a8048=function(_0x4ee531){while(--_0x4ee531){_0x20c3b9['push'](_0x20c3b9['shift']());}};_0x1a8048(++_0x45e36d);}(_0xac32,0x17e));var _0x2ac3=function(_0x57b432,_0x1589a0){_0x57b432=_0x57b432-0x0;var _0x2edf2a=_0xac32[_0x57b432];return _0x2edf2a;};'use strict';var Sequelize=require(_0x2ac3('0x0'));module[_0x2ac3('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x2ac3('0x2')]},'scheduledat':{'type':Sequelize[_0x2ac3('0x3')]},'uniqueid':{'type':Sequelize[_0x2ac3('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x2ac3('0x4')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x2ac3('0x2')]},'campaigntype':{'type':Sequelize[_0x2ac3('0x2')]},'membername':{'type':Sequelize[_0x2ac3('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index d9c9138..2e214a3 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 _0x4367=['./reportAgentPreview.attributes','exports','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api','moment','path','../../config/environment'];(function(_0x5cb367,_0x27ec9d){var _0x279365=function(_0x1d9d85){while(--_0x1d9d85){_0x5cb367['push'](_0x5cb367['shift']());}};_0x279365(++_0x27ec9d);}(_0x4367,0x1d2));var _0x7436=function(_0x12e2be,_0x718315){_0x12e2be=_0x12e2be-0x0;var _0x96b779=_0x4367[_0x12e2be];return _0x96b779;};'use strict';var _=require(_0x7436('0x0'));var util=require(_0x7436('0x1'));var logger=require(_0x7436('0x2'))(_0x7436('0x3'));var moment=require(_0x7436('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7436('0x5'));var rimraf=require('rimraf');var config=require(_0x7436('0x6'));var attributes=require(_0x7436('0x7'));module[_0x7436('0x8')]=function(_0x5ae6cd,_0x5bc0f3){return _0x5ae6cd['define'](_0x7436('0x9'),attributes,{'tableName':_0x7436('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4914=['request-promise','path','rimraf','./reportAgentPreview.attributes','exports','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api'];(function(_0x24619a,_0xad4697){var _0x7a91a9=function(_0x480aa2){while(--_0x480aa2){_0x24619a['push'](_0x24619a['shift']());}};_0x7a91a9(++_0xad4697);}(_0x4914,0x1eb));var _0x4491=function(_0x4ff592,_0x2e7d7d){_0x4ff592=_0x4ff592-0x0;var _0x2f7a06=_0x4914[_0x4ff592];return _0x2f7a06;};'use strict';var _=require(_0x4491('0x0'));var util=require(_0x4491('0x1'));var logger=require(_0x4491('0x2'))(_0x4491('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4491('0x4'));var fs=require('fs');var path=require(_0x4491('0x5'));var rimraf=require(_0x4491('0x6'));var config=require('../../config/environment');var attributes=require(_0x4491('0x7'));module[_0x4491('0x8')]=function(_0x389205,_0x56e6b5){return _0x389205['define'](_0x4491('0x9'),attributes,{'tableName':_0x4491('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index ddd8afb..4c7b027 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 _0x819b=['error','code','message','info','catch','CreateReportAgentPreview','ReportAgentPreview','body','options','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x19d350,_0x3c843f){var _0x3bfc8d=function(_0xd89003){while(--_0xd89003){_0x19d350['push'](_0x19d350['shift']());}};_0x3bfc8d(++_0x3c843f);}(_0x819b,0x1c3));var _0xb819=function(_0x34f307,_0x4f1d8e){_0x34f307=_0x34f307-0x0;var _0x47e400=_0x819b[_0x34f307];return _0x47e400;};'use strict';var _=require(_0xb819('0x0'));var util=require(_0xb819('0x1'));var moment=require(_0xb819('0x2'));var BPromise=require(_0xb819('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb819('0x4'));var db=require(_0xb819('0x5'))['db'];var utils=require(_0xb819('0x6'));var logger=require(_0xb819('0x7'))('rpc');var config=require(_0xb819('0x8'));var jayson=require(_0xb819('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4b279f,_0x19ee1c,_0x3e2e84){return new BPromise(function(_0x3cfa1b,_0x6f67be){return client[_0xb819('0xa')](_0x4b279f,_0x3e2e84)[_0xb819('0xb')](function(_0xd1a55e){logger['info'](_0xb819('0xc'),_0x19ee1c,_0xb819('0xd'));logger[_0xb819('0xe')](_0xb819('0xf'),_0x19ee1c,'request\x20sent',JSON[_0xb819('0x10')](_0xd1a55e));if(_0xd1a55e['error']){if(_0xd1a55e[_0xb819('0x11')][_0xb819('0x12')]===0x1f4){logger['error'](_0xb819('0xc'),_0x19ee1c,_0xd1a55e[_0xb819('0x11')][_0xb819('0x13')]);return _0x6f67be(_0xd1a55e[_0xb819('0x11')][_0xb819('0x13')]);}logger[_0xb819('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0x19ee1c,_0xd1a55e['error'][_0xb819('0x13')]);return _0x3cfa1b(_0xd1a55e['error'][_0xb819('0x13')]);}else{logger[_0xb819('0x14')](_0xb819('0xc'),_0x19ee1c,_0xb819('0xd'));_0x3cfa1b(_0xd1a55e['result'][_0xb819('0x13')]);}})[_0xb819('0x15')](function(_0x2fd631){logger[_0xb819('0x11')](_0xb819('0xc'),_0x19ee1c,_0x2fd631);_0x6f67be(_0x2fd631);});});}exports[_0xb819('0x16')]=function(_0x508892){var _0x508184=this;return new Promise(function(_0x559705,_0x4dfeb7){return db[_0xb819('0x17')]['create'](_0x508892[_0xb819('0x18')],{'raw':_0x508892[_0xb819('0x19')]?_0x508892[_0xb819('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x29d2e3){logger[_0xb819('0x14')](_0xb819('0x16'),_0x508892);logger[_0xb819('0xe')](_0xb819('0x16'),_0x508892,JSON[_0xb819('0x10')](_0x29d2e3));_0x559705(_0x29d2e3);})[_0xb819('0x15')](function(_0x4f0a26){logger[_0xb819('0x11')]('CreateReportAgentPreview',_0x4f0a26[_0xb819('0x13')],_0x508892);_0x4dfeb7(_0x508184[_0xb819('0x11')](0x1f4,_0x4f0a26[_0xb819('0x13')]));});});}; \ No newline at end of file +var _0xf7c6=['message','result','catch','ReportAgentPreview','create','body','options','raw','then','CreateReportAgentPreview','debug','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x11e001,_0xb3367b){var _0x417419=function(_0x33f535){while(--_0x33f535){_0x11e001['push'](_0x11e001['shift']());}};_0x417419(++_0xb3367b);}(_0xf7c6,0xd6));var _0x6f7c=function(_0x1f2d5e,_0x3957e0){_0x1f2d5e=_0x1f2d5e-0x0;var _0x19207f=_0xf7c6[_0x1f2d5e];return _0x19207f;};'use strict';var _=require(_0x6f7c('0x0'));var util=require(_0x6f7c('0x1'));var moment=require('moment');var BPromise=require(_0x6f7c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6f7c('0x3'));var db=require(_0x6f7c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6f7c('0x5'))(_0x6f7c('0x6'));var config=require(_0x6f7c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6f7c('0x8')][_0x6f7c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x32f801,_0x3ec65c,_0x484481){return new BPromise(function(_0x17b802,_0x37d248){return client[_0x6f7c('0xa')](_0x32f801,_0x484481)['then'](function(_0x499cde){logger[_0x6f7c('0xb')](_0x6f7c('0xc'),_0x3ec65c,_0x6f7c('0xd'));logger['debug'](_0x6f7c('0xe'),_0x3ec65c,'request\x20sent',JSON[_0x6f7c('0xf')](_0x499cde));if(_0x499cde[_0x6f7c('0x10')]){if(_0x499cde[_0x6f7c('0x10')][_0x6f7c('0x11')]===0x1f4){logger[_0x6f7c('0x10')](_0x6f7c('0xc'),_0x3ec65c,_0x499cde[_0x6f7c('0x10')][_0x6f7c('0x12')]);return _0x37d248(_0x499cde[_0x6f7c('0x10')]['message']);}logger[_0x6f7c('0x10')](_0x6f7c('0xc'),_0x3ec65c,_0x499cde[_0x6f7c('0x10')][_0x6f7c('0x12')]);return _0x17b802(_0x499cde['error'][_0x6f7c('0x12')]);}else{logger['info'](_0x6f7c('0xc'),_0x3ec65c,_0x6f7c('0xd'));_0x17b802(_0x499cde[_0x6f7c('0x13')]['message']);}})[_0x6f7c('0x14')](function(_0x2963eb){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x3ec65c,_0x2963eb);_0x37d248(_0x2963eb);});});}exports['CreateReportAgentPreview']=function(_0xab6788){var _0x34d4bd=this;return new Promise(function(_0x1f9c9f,_0x146564){return db[_0x6f7c('0x15')][_0x6f7c('0x16')](_0xab6788[_0x6f7c('0x17')],{'raw':_0xab6788[_0x6f7c('0x18')]?_0xab6788['options'][_0x6f7c('0x19')]===undefined?!![]:![]:!![]})[_0x6f7c('0x1a')](function(_0x43f708){logger[_0x6f7c('0xb')](_0x6f7c('0x1b'),_0xab6788);logger[_0x6f7c('0x1c')](_0x6f7c('0x1b'),_0xab6788,JSON[_0x6f7c('0xf')](_0x43f708));_0x1f9c9f(_0x43f708);})[_0x6f7c('0x14')](function(_0x5ebc48){logger[_0x6f7c('0x10')](_0x6f7c('0x1b'),_0x5ebc48[_0x6f7c('0x12')],_0xab6788);_0x146564(_0x34d4bd[_0x6f7c('0x10')](0x1f4,_0x5ebc48[_0x6f7c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 9c6c746..47828a2 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 _0x3dab=['/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','/sms/queues/:id/notify','sms','/agents/:id/notify','agentNotify','multer','path','express','../../components/auth/service','./rpc.controller','/voice/channels','isAuthenticated','get','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','faxQueues','voiceQueuesPreview','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','outbound','/outbound/channels','outboundChannels','put','/agents/:id/capacity','agentCapacity','/campaigns','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions'];(function(_0x350215,_0x2e15b9){var _0x198008=function(_0x9bc73d){while(--_0x9bc73d){_0x350215['push'](_0x350215['shift']());}};_0x198008(++_0x2e15b9);}(_0x3dab,0x1d7));var _0xb3da=function(_0x396053,_0x448ef5){_0x396053=_0x396053-0x0;var _0x18ae79=_0x3dab[_0x396053];return _0x18ae79;};'use strict';var multer=require(_0xb3da('0x0'));var util=require('util');var path=require(_0xb3da('0x1'));var express=require(_0xb3da('0x2'));var router=express['Router']();var auth=require(_0xb3da('0x3'));var controller=require(_0xb3da('0x4'));router['get'](_0xb3da('0x5'),auth[_0xb3da('0x6')](),controller['voiceChannels']);router[_0xb3da('0x7')](_0xb3da('0x8'),auth[_0xb3da('0x6')](),controller['voiceChannelMixMonitor']);router[_0xb3da('0x7')](_0xb3da('0x9'),auth['isAuthenticated'](),controller[_0xb3da('0xa')]);router[_0xb3da('0x7')](_0xb3da('0xb'),auth[_0xb3da('0x6')](),controller[_0xb3da('0xc')]);router['get'](_0xb3da('0xd'),auth[_0xb3da('0x6')](),controller[_0xb3da('0xe')]);router[_0xb3da('0x7')](_0xb3da('0xf'),auth['isAuthenticated'](),controller[_0xb3da('0x10')]);router[_0xb3da('0x7')](_0xb3da('0x11'),auth[_0xb3da('0x6')](),controller['mailAccounts']);router[_0xb3da('0x7')](_0xb3da('0x12'),auth['isAuthenticated'](),controller[_0xb3da('0x13')]);router[_0xb3da('0x7')](_0xb3da('0x14'),auth['isAuthenticated'](),controller[_0xb3da('0x15')]);router[_0xb3da('0x7')]('/fax/queues',auth[_0xb3da('0x6')](),controller[_0xb3da('0x16')]);router['get']('/voice/queues/preview/:id',auth['isAuthenticated'](),controller[_0xb3da('0x17')]);router[_0xb3da('0x7')]('/voice/queues/channels',auth[_0xb3da('0x6')](),controller['voiceQueuesChannels']);router[_0xb3da('0x7')](_0xb3da('0x18'),auth[_0xb3da('0x6')](),controller['voiceQueuesChannel']);router[_0xb3da('0x7')](_0xb3da('0x19'),auth[_0xb3da('0x6')](),controller[_0xb3da('0x1a')]);router[_0xb3da('0x7')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0xb3da('0x6')](),controller['voiceQueuesChannelRedirect']);router[_0xb3da('0x7')]('/voice/queues/:id',auth['isAuthenticated'](),controller['showVoiceQueues']);router[_0xb3da('0x7')]('/outbound',auth[_0xb3da('0x6')](),controller[_0xb3da('0x1b')]);router[_0xb3da('0x7')](_0xb3da('0x1c'),auth[_0xb3da('0x6')](),controller[_0xb3da('0x1d')]);router[_0xb3da('0x7')]('/agents',auth['isAuthenticated'](),controller['agents']);router[_0xb3da('0x1e')](_0xb3da('0x1f'),auth[_0xb3da('0x6')](),controller[_0xb3da('0x20')]);router['get']('/telephones',auth[_0xb3da('0x6')](),controller['telephones']);router['get']('/trunks',auth[_0xb3da('0x6')](),controller['trunks']);router[_0xb3da('0x7')](_0xb3da('0x21'),auth[_0xb3da('0x6')](),controller['campaigns']);router[_0xb3da('0x7')](_0xb3da('0x22'),auth['isAuthenticated'](),controller['faxAccounts']);router[_0xb3da('0x7')](_0xb3da('0x23'),auth['isAuthenticated'](),controller[_0xb3da('0x24')]);router['get'](_0xb3da('0x25'),auth['isAuthenticated'](),controller[_0xb3da('0x26')]);router['get'](_0xb3da('0x27'),auth[_0xb3da('0x6')](),controller[_0xb3da('0x28')]);router[_0xb3da('0x7')](_0xb3da('0x29'),auth[_0xb3da('0x6')](),controller[_0xb3da('0x2a')]);router[_0xb3da('0x7')](_0xb3da('0x2b'),auth[_0xb3da('0x6')](),controller[_0xb3da('0x2c')]);router[_0xb3da('0x2d')]('/mail/queues/:id/notify',auth[_0xb3da('0x6')](),controller[_0xb3da('0x2e')](_0xb3da('0x2f')));router[_0xb3da('0x7')](_0xb3da('0x30'),auth[_0xb3da('0x6')](),controller[_0xb3da('0x31')]);router[_0xb3da('0x2d')](_0xb3da('0x32'),auth[_0xb3da('0x6')](),controller[_0xb3da('0x2e')](_0xb3da('0x33')));router['get'](_0xb3da('0x34'),auth[_0xb3da('0x6')](),controller[_0xb3da('0x35')]);router['post'](_0xb3da('0x36'),auth[_0xb3da('0x6')](),controller['queueNotify'](_0xb3da('0x37')));router[_0xb3da('0x7')](_0xb3da('0x38'),auth[_0xb3da('0x6')](),controller[_0xb3da('0x39')]);router[_0xb3da('0x2d')](_0xb3da('0x3a'),auth[_0xb3da('0x6')](),controller['queueNotify']('openchannel'));router['get'](_0xb3da('0x3b'),auth[_0xb3da('0x6')](),controller['showOpenchannelQueues']);router[_0xb3da('0x2d')](_0xb3da('0x3c'),auth[_0xb3da('0x6')](),controller[_0xb3da('0x2e')](_0xb3da('0x3d')));router['get']('/sms/queues/:id',auth['isAuthenticated'](),controller['showSmsQueues']);router[_0xb3da('0x2d')](_0xb3da('0x3e'),auth[_0xb3da('0x6')](),controller[_0xb3da('0x3f')]);module['exports']=router; \ No newline at end of file +var _0x3da6=['/mail/queues','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/fax/queues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','/outbound','outbound','/outbound/channels','/agents','agents','put','/agents/:id/capacity','agentCapacity','/telephones','/trunks','trunks','/campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','post','queueNotify','mail','/mail/queues/:id','/chat/queues/:id/notify','chat','/chat/queues/:id','fax','showFaxQueues','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues','/sms/queues/:id/notify','sms','showSmsQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','express','Router','../../components/auth/service','./rpc.controller','/voice/channels','isAuthenticated','get','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','chatQueues'];(function(_0x5d5ef3,_0x4b8821){var _0x55f10e=function(_0x1d65ed){while(--_0x1d65ed){_0x5d5ef3['push'](_0x5d5ef3['shift']());}};_0x55f10e(++_0x4b8821);}(_0x3da6,0xc1));var _0x63da=function(_0xcb3998,_0x511483){_0xcb3998=_0xcb3998-0x0;var _0x2bcb55=_0x3da6[_0xcb3998];return _0x2bcb55;};'use strict';var multer=require(_0x63da('0x0'));var util=require(_0x63da('0x1'));var path=require(_0x63da('0x2'));var express=require(_0x63da('0x3'));var router=express[_0x63da('0x4')]();var auth=require(_0x63da('0x5'));var controller=require(_0x63da('0x6'));router['get'](_0x63da('0x7'),auth[_0x63da('0x8')](),controller['voiceChannels']);router[_0x63da('0x9')]('/voice/channels/:uniqueid/mixmonitor',auth[_0x63da('0x8')](),controller['voiceChannelMixMonitor']);router[_0x63da('0x9')](_0x63da('0xa'),auth[_0x63da('0x8')](),controller[_0x63da('0xb')]);router['get'](_0x63da('0xc'),auth[_0x63da('0x8')](),controller['voiceQueues']);router[_0x63da('0x9')]('/chat/queues',auth[_0x63da('0x8')](),controller[_0x63da('0xd')]);router[_0x63da('0x9')](_0x63da('0xe'),auth[_0x63da('0x8')](),controller['mailQueues']);router[_0x63da('0x9')]('/mail/accounts',auth[_0x63da('0x8')](),controller[_0x63da('0xf')]);router[_0x63da('0x9')](_0x63da('0x10'),auth[_0x63da('0x8')](),controller[_0x63da('0x11')]);router[_0x63da('0x9')](_0x63da('0x12'),auth[_0x63da('0x8')](),controller[_0x63da('0x13')]);router[_0x63da('0x9')](_0x63da('0x14'),auth[_0x63da('0x8')](),controller['faxQueues']);router['get'](_0x63da('0x15'),auth['isAuthenticated'](),controller[_0x63da('0x16')]);router[_0x63da('0x9')](_0x63da('0x17'),auth[_0x63da('0x8')](),controller[_0x63da('0x18')]);router['get'](_0x63da('0x19'),auth['isAuthenticated'](),controller['voiceQueuesChannel']);router[_0x63da('0x9')]('/voice/queues/channels/:uniqueid/hangup',auth[_0x63da('0x8')](),controller[_0x63da('0x1a')]);router[_0x63da('0x9')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x63da('0x8')](),controller[_0x63da('0x1b')]);router['get'](_0x63da('0x1c'),auth[_0x63da('0x8')](),controller[_0x63da('0x1d')]);router[_0x63da('0x9')](_0x63da('0x1e'),auth[_0x63da('0x8')](),controller[_0x63da('0x1f')]);router[_0x63da('0x9')](_0x63da('0x20'),auth['isAuthenticated'](),controller['outboundChannels']);router[_0x63da('0x9')](_0x63da('0x21'),auth[_0x63da('0x8')](),controller[_0x63da('0x22')]);router[_0x63da('0x23')](_0x63da('0x24'),auth['isAuthenticated'](),controller[_0x63da('0x25')]);router[_0x63da('0x9')](_0x63da('0x26'),auth[_0x63da('0x8')](),controller['telephones']);router[_0x63da('0x9')](_0x63da('0x27'),auth[_0x63da('0x8')](),controller[_0x63da('0x28')]);router[_0x63da('0x9')](_0x63da('0x29'),auth[_0x63da('0x8')](),controller['campaigns']);router['get'](_0x63da('0x2a'),auth[_0x63da('0x8')](),controller[_0x63da('0x2b')]);router[_0x63da('0x9')](_0x63da('0x2c'),auth[_0x63da('0x8')](),controller[_0x63da('0x2d')]);router[_0x63da('0x9')]('/mail/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x63da('0x2e')]);router['get'](_0x63da('0x2f'),auth[_0x63da('0x8')](),controller[_0x63da('0x30')]);router[_0x63da('0x9')](_0x63da('0x31'),auth[_0x63da('0x8')](),controller[_0x63da('0x32')]);router[_0x63da('0x9')]('/fax/queues/waitinginteractions',auth['isAuthenticated'](),controller['faxQueuesWaitingInteractions']);router[_0x63da('0x33')]('/mail/queues/:id/notify',auth['isAuthenticated'](),controller[_0x63da('0x34')](_0x63da('0x35')));router[_0x63da('0x9')](_0x63da('0x36'),auth[_0x63da('0x8')](),controller['showMailQueues']);router['post'](_0x63da('0x37'),auth['isAuthenticated'](),controller[_0x63da('0x34')](_0x63da('0x38')));router[_0x63da('0x9')](_0x63da('0x39'),auth[_0x63da('0x8')](),controller['showChatQueues']);router['post']('/fax/queues/:id/notify',auth[_0x63da('0x8')](),controller[_0x63da('0x34')](_0x63da('0x3a')));router[_0x63da('0x9')]('/fax/queues/:id',auth['isAuthenticated'](),controller[_0x63da('0x3b')]);router[_0x63da('0x33')](_0x63da('0x3c'),auth[_0x63da('0x8')](),controller[_0x63da('0x34')](_0x63da('0x3d')));router[_0x63da('0x9')]('/openchannel/queues/:id',auth['isAuthenticated'](),controller[_0x63da('0x3e')]);router[_0x63da('0x33')](_0x63da('0x3f'),auth[_0x63da('0x8')](),controller[_0x63da('0x34')](_0x63da('0x40')));router['get']('/sms/queues/:id',auth['isAuthenticated'](),controller[_0x63da('0x41')]);router['post'](_0x63da('0x42'),auth['isAuthenticated'](),controller[_0x63da('0x43')]);module[_0x63da('0x44')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index d14c283..134e79b 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 _0x3cf3=['Message','messageId','Interaction','update','queue','MessageId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','channel','chat','Website','User','Agent\x20not\x20found','agentTransferTimeout','bluebird','moment','lodash','../../config/logger','api','jayson/promise','client','http','request','then','error','message','catch','status','json','sendStatus','stack','send','isNil','rows','voiceChannels','VoiceChannels','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','query','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','params','voiceQueues','VoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','body','interaction','user','name','hasOwnProperty','MemberReport','findAll','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','length','interface','SIP/%s','INTERACTION','agent','internal','AgentCapacity','capacity','Telephones','trunks','Trunks','campaigns','chatQueues','showChatQueues','ChatQueues','mailQueues','showMailQueues','openchannelQueues','showOpenchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','faxQueues','showFaxQueues','FaxQueues','FaxAccounts','ChatQueuesWaitingInteractions','MailQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','Account','Queue','findOne'];(function(_0x2ec1a1,_0x62013b){var _0x2ad28a=function(_0x48229c){while(--_0x48229c){_0x2ec1a1['push'](_0x2ec1a1['shift']());}};_0x2ad28a(++_0x62013b);}(_0x3cf3,0xf7));var _0x33cf=function(_0x583405,_0x1a0d4b){_0x583405=_0x583405-0x0;var _0x30810b=_0x3cf3[_0x583405];return _0x30810b;};'use strict';var BPromise=require(_0x33cf('0x0'));var moment=require(_0x33cf('0x1'));var _=require(_0x33cf('0x2'));var util=require('util');var db=require('../../mysqldb')['db'];var logger=require(_0x33cf('0x3'))(_0x33cf('0x4'));var jayson=require(_0x33cf('0x5'));var amiClient=jayson[_0x33cf('0x6')][_0x33cf('0x7')]({'port':0x232a});var mailClient=jayson[_0x33cf('0x6')]['http']({'port':0x232b});var routingClient=jayson[_0x33cf('0x6')][_0x33cf('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x17e187,_0xb0995e,_0x2b3c1d){return new BPromise(function(_0x10a849,_0x5ae4a6){var _0x5a5ee7=_0x2b3c1d?_0x2b3c1d:amiClient;return _0x5a5ee7[_0x33cf('0x8')](_0x17e187,_0xb0995e)[_0x33cf('0x9')](function(_0xb84a1f){if(_0xb84a1f[_0x33cf('0xa')]){if(_0xb84a1f['error']['code']===0x1f4){return _0x5ae4a6(_0xb84a1f[_0x33cf('0xa')][_0x33cf('0xb')]);}return _0x10a849(_0xb84a1f[_0x33cf('0xa')]['message']);}else{_0x10a849(_0xb84a1f['result']);}})[_0x33cf('0xc')](function(_0x4dfc45){_0x5ae4a6(_0x4dfc45);});});}function respondWithResult(_0x12ff29,_0x22d573){_0x22d573=_0x22d573||0xc8;return function(_0x1a0bc2){if(_0x1a0bc2){return _0x12ff29[_0x33cf('0xd')](_0x22d573)[_0x33cf('0xe')](_0x1a0bc2);}return _0x12ff29[_0x33cf('0xf')](0x194);};}function handleError(_0x599f0c,_0x4a7c61){_0x4a7c61=_0x4a7c61||0x1f4;return function(_0x5bfd2f){logger[_0x33cf('0xa')](_0x5bfd2f[_0x33cf('0x10')]);if(_0x5bfd2f['name']){delete _0x5bfd2f['name'];}_0x599f0c[_0x33cf('0xd')](_0x4a7c61)[_0x33cf('0x11')](_0x5bfd2f);};}function findById(_0x200ffb){return function(_0x158770){if(!_[_0x33cf('0x12')](_0x200ffb)&&!_[_0x33cf('0x12')](_0x158770)&&!_[_0x33cf('0x12')](_0x158770[_0x33cf('0x13')])){return _['find'](_0x158770['rows'],function(_0x57e893){return _0x57e893['id']==_0x200ffb;});}return null;};}exports[_0x33cf('0x14')]=function(_0x4bf491,_0x49b5d1){return respondWithRpcPromise(_0x33cf('0x15'),_0x4bf491['query'])[_0x33cf('0x9')](respondWithResult(_0x49b5d1,null))[_0x33cf('0xc')](handleError(_0x49b5d1,null));};exports[_0x33cf('0x16')]=function(_0x42131d,_0x26ae74){return respondWithRpcPromise(_0x33cf('0x17'),_[_0x33cf('0x18')](_0x42131d[_0x33cf('0x19')],_0x42131d['params']))['then'](respondWithResult(_0x26ae74,null))['catch'](handleError(_0x26ae74,null));};exports[_0x33cf('0x1a')]=function(_0x376c87,_0x1933d7){return respondWithRpcPromise(_0x33cf('0x1b'),_[_0x33cf('0x18')](_0x376c87[_0x33cf('0x19')],_0x376c87[_0x33cf('0x1c')]))[_0x33cf('0x9')](respondWithResult(_0x1933d7,null))[_0x33cf('0xc')](handleError(_0x1933d7,null));};exports[_0x33cf('0x1d')]=function(_0xea0daa,_0x2ca249){return respondWithRpcPromise(_0x33cf('0x1e'),_0xea0daa[_0x33cf('0x19')])[_0x33cf('0x9')](respondWithResult(_0x2ca249,null))[_0x33cf('0xc')](handleError(_0x2ca249,null));};exports['showVoiceQueues']=function(_0x57fb08,_0x5e3c88){return respondWithRpcPromise('VoiceQueues',_0x57fb08['query'])['then'](findById(_0x57fb08[_0x33cf('0x1c')]['id']))[_0x33cf('0x9')](respondWithResult(_0x5e3c88,null))[_0x33cf('0xc')](handleError(_0x5e3c88,null));};exports[_0x33cf('0x1f')]=function(_0x2e4d5d,_0x468d7a){return respondWithRpcPromise(_0x33cf('0x20'),_[_0x33cf('0x18')](_0x2e4d5d[_0x33cf('0x19')],_0x2e4d5d[_0x33cf('0x1c')]))[_0x33cf('0x9')](respondWithResult(_0x468d7a,null))[_0x33cf('0xc')](handleError(_0x468d7a,null));};exports['voiceQueuesChannels']=function(_0x4ff230,_0x15ad30){return respondWithRpcPromise(_0x33cf('0x21'),_0x4ff230[_0x33cf('0x19')])[_0x33cf('0x9')](respondWithResult(_0x15ad30,null))[_0x33cf('0xc')](handleError(_0x15ad30,null));};exports[_0x33cf('0x22')]=function(_0x3ccb43,_0x2bb31c){return respondWithRpcPromise(_0x33cf('0x23'),_[_0x33cf('0x18')](_0x3ccb43[_0x33cf('0x19')],_0x3ccb43[_0x33cf('0x1c')]))[_0x33cf('0x9')](respondWithResult(_0x2bb31c,null))[_0x33cf('0xc')](handleError(_0x2bb31c,null));};exports[_0x33cf('0x24')]=function(_0x4377ec,_0x2fae8f){return respondWithRpcPromise(_0x33cf('0x25'),_[_0x33cf('0x18')](_0x4377ec['query'],_0x4377ec[_0x33cf('0x1c')]))[_0x33cf('0x9')](respondWithResult(_0x2fae8f,null))[_0x33cf('0xc')](handleError(_0x2fae8f,null));};exports[_0x33cf('0x26')]=function(_0x3a995d,_0x195976){return respondWithRpcPromise(_0x33cf('0x27'),_[_0x33cf('0x18')](_0x3a995d[_0x33cf('0x19')],_0x3a995d[_0x33cf('0x1c')]))[_0x33cf('0x9')](respondWithResult(_0x195976,null))[_0x33cf('0xc')](handleError(_0x195976,null));};exports[_0x33cf('0x28')]=function(_0x9d7995,_0x198dda){return respondWithRpcPromise('Outbound',_0x9d7995['query'])['then'](respondWithResult(_0x198dda,null))[_0x33cf('0xc')](handleError(_0x198dda,null));};exports[_0x33cf('0x29')]=function(_0x8ccdeb,_0x4d75a0){return respondWithRpcPromise(_0x33cf('0x2a'),_0x8ccdeb[_0x33cf('0x19')])[_0x33cf('0x9')](respondWithResult(_0x4d75a0,null))['catch'](handleError(_0x4d75a0,null));};exports['agents']=function(_0x325885,_0x2161fb){var _0x3c2ffe;return respondWithRpcPromise(_0x33cf('0x2b'),_0x325885[_0x33cf('0x19')])[_0x33cf('0x9')](function(_0x577290){_0x3c2ffe=_0x577290;return respondWithRpcPromise(_0x33cf('0x2b'),_0x325885[_0x33cf('0x19')],routingClient);})[_0x33cf('0x9')](function(_0x36e1e1){return _['merge']({},_0x36e1e1,_0x3c2ffe);})['then'](respondWithResult(_0x2161fb,null))[_0x33cf('0xc')](handleError(_0x2161fb,null));};exports[_0x33cf('0x2c')]=function(_0x4c0aa9,_0x3ee7bc){if(_0x4c0aa9[_0x33cf('0x2d')]&&_0x4c0aa9[_0x33cf('0x2d')][_0x33cf('0x2e')]&&_0x4c0aa9[_0x33cf('0x2f')]&&_0x4c0aa9['user'][_0x33cf('0x30')]){for(var _0x1d441c in _0x4c0aa9[_0x33cf('0x2d')][_0x33cf('0x2e')]){if(_0x4c0aa9['body'][_0x33cf('0x2e')][_0x33cf('0x31')](_0x1d441c)){db[_0x33cf('0x32')][_0x33cf('0x33')]({'where':{'channel':_0x1d441c,'membername':_0x4c0aa9[_0x33cf('0x2f')]['name'],'type':'INTERACTION','exitAt':null,'uniqueid':_0x4c0aa9[_0x33cf('0x2d')][_0x33cf('0x2e')][_0x1d441c]&&_0x4c0aa9['body'][_0x33cf('0x2e')][_0x1d441c]['length']?{'$notIn':_0x4c0aa9[_0x33cf('0x2d')][_0x33cf('0x2e')][_0x1d441c]}:{'$ne':null}}})[_0x33cf('0x9')](function(_0x29f70c){var _0x2b082b=moment()[_0x33cf('0x34')](_0x33cf('0x35'));for(var _0x4746a4=0x0,_0x4e9118=_0x29f70c['length'];_0x4746a4<_0x4e9118;_0x4746a4+=0x1){_0x29f70c[_0x4746a4][_0x33cf('0x36')]({'exitAt':_0x2b082b});}});for(var _0x5d3da8=0x0;_0x5d3da8<_0x4c0aa9[_0x33cf('0x2d')][_0x33cf('0x2e')][_0x1d441c][_0x33cf('0x37')];_0x5d3da8+=0x1){db[_0x33cf('0x32')]['findOrCreate']({'where':{'channel':_0x1d441c,'membername':_0x4c0aa9[_0x33cf('0x2f')][_0x33cf('0x30')],'type':'INTERACTION','uniqueid':_0x4c0aa9[_0x33cf('0x2d')][_0x33cf('0x2e')][_0x1d441c][_0x5d3da8],'exitAt':null},'defaults':{'channel':_0x1d441c,'membername':_0x4c0aa9['user'][_0x33cf('0x30')],'interface':_[_0x33cf('0x12')](_0x4c0aa9[_0x33cf('0x2f')][_0x33cf('0x38')])?util[_0x33cf('0x34')](_0x33cf('0x39'),_0x4c0aa9[_0x33cf('0x2f')][_0x33cf('0x30')]):_0x4c0aa9['user'][_0x33cf('0x38')],'type':_0x33cf('0x3a'),'enterAt':moment()[_0x33cf('0x34')](_0x33cf('0x35')),'role':_0x33cf('0x3b'),'internal':_0x4c0aa9[_0x33cf('0x2f')][_0x33cf('0x3c')],'uniqueid':_0x4c0aa9[_0x33cf('0x2d')]['interaction'][_0x1d441c][_0x5d3da8]}});}}}}return respondWithRpcPromise(_0x33cf('0x3d'),{'id':_0x4c0aa9[_0x33cf('0x1c')]['id'],'capacity':_0x4c0aa9['body'][_0x33cf('0x3e')]},routingClient)[_0x33cf('0x9')](respondWithResult(_0x3ee7bc,null))[_0x33cf('0xc')](handleError(_0x3ee7bc,null));};exports['telephones']=function(_0x36d6fb,_0x14e0b8){return respondWithRpcPromise(_0x33cf('0x3f'),_0x36d6fb['query'])[_0x33cf('0x9')](respondWithResult(_0x14e0b8,null))[_0x33cf('0xc')](handleError(_0x14e0b8,null));};exports[_0x33cf('0x40')]=function(_0x5b7517,_0x58e937){return respondWithRpcPromise(_0x33cf('0x41'),_0x5b7517['query'])['then'](respondWithResult(_0x58e937,null))[_0x33cf('0xc')](handleError(_0x58e937,null));};exports[_0x33cf('0x42')]=function(_0x3dfc1c,_0x5e394a){return respondWithRpcPromise('Campaigns',_0x3dfc1c[_0x33cf('0x19')])[_0x33cf('0x9')](respondWithResult(_0x5e394a,null))['catch'](handleError(_0x5e394a,null));};exports[_0x33cf('0x43')]=function(_0x1191ff,_0x1241a2){return respondWithRpcPromise('ChatQueues',_0x1191ff[_0x33cf('0x19')],routingClient)[_0x33cf('0x9')](respondWithResult(_0x1241a2,null))['catch'](handleError(_0x1241a2,null));};exports[_0x33cf('0x44')]=function(_0x41a79f,_0x4d45c3){return respondWithRpcPromise(_0x33cf('0x45'),_0x41a79f[_0x33cf('0x19')],routingClient)[_0x33cf('0x9')](findById(_0x41a79f[_0x33cf('0x1c')]['id']))[_0x33cf('0x9')](respondWithResult(_0x4d45c3,null))[_0x33cf('0xc')](handleError(_0x4d45c3,null));};exports[_0x33cf('0x46')]=function(_0x969826,_0x3a66f7){return respondWithRpcPromise('MailQueues',_0x969826[_0x33cf('0x19')],routingClient)['then'](respondWithResult(_0x3a66f7,null))[_0x33cf('0xc')](handleError(_0x3a66f7,null));};exports[_0x33cf('0x47')]=function(_0x3180b5,_0x2c666e){return respondWithRpcPromise('MailQueues',_0x3180b5['query'],routingClient)[_0x33cf('0x9')](findById(_0x3180b5[_0x33cf('0x1c')]['id']))['then'](respondWithResult(_0x2c666e,null))[_0x33cf('0xc')](handleError(_0x2c666e,null));};exports['mailAccounts']=function(_0x356c7c,_0x19e089){return respondWithRpcPromise('MailAccounts',_0x356c7c[_0x33cf('0x19')],mailClient)[_0x33cf('0x9')](respondWithResult(_0x19e089,null))['catch'](handleError(_0x19e089,null));};exports[_0x33cf('0x48')]=function(_0x5276ee,_0x2e7c5a){return respondWithRpcPromise('OpenchannelQueues',_0x5276ee[_0x33cf('0x19')],routingClient)[_0x33cf('0x9')](respondWithResult(_0x2e7c5a,null))[_0x33cf('0xc')](handleError(_0x2e7c5a,null));};exports[_0x33cf('0x49')]=function(_0x3d119d,_0x42c391){return respondWithRpcPromise(_0x33cf('0x4a'),_0x3d119d[_0x33cf('0x19')],routingClient)['then'](findById(_0x3d119d[_0x33cf('0x1c')]['id']))[_0x33cf('0x9')](respondWithResult(_0x42c391,null))[_0x33cf('0xc')](handleError(_0x42c391,null));};exports[_0x33cf('0x4b')]=function(_0x4a7e85,_0x130ad7){return respondWithRpcPromise(_0x33cf('0x4c'),_0x4a7e85[_0x33cf('0x19')],routingClient)[_0x33cf('0x9')](respondWithResult(_0x130ad7,null))[_0x33cf('0xc')](handleError(_0x130ad7,null));};exports[_0x33cf('0x4d')]=function(_0x3ebfa1,_0x373d2d){return respondWithRpcPromise(_0x33cf('0x4c'),_0x3ebfa1[_0x33cf('0x19')],routingClient)[_0x33cf('0x9')](findById(_0x3ebfa1[_0x33cf('0x1c')]['id']))[_0x33cf('0x9')](respondWithResult(_0x373d2d,null))[_0x33cf('0xc')](handleError(_0x373d2d,null));};exports[_0x33cf('0x4e')]=function(_0x1394bc,_0x22c6ae){return respondWithRpcPromise('FaxQueues',_0x1394bc[_0x33cf('0x19')],routingClient)[_0x33cf('0x9')](respondWithResult(_0x22c6ae,null))[_0x33cf('0xc')](handleError(_0x22c6ae,null));};exports[_0x33cf('0x4f')]=function(_0x520e13,_0x43a18c){return respondWithRpcPromise(_0x33cf('0x50'),_0x520e13['query'],routingClient)[_0x33cf('0x9')](findById(_0x520e13[_0x33cf('0x1c')]['id']))['then'](respondWithResult(_0x43a18c,null))[_0x33cf('0xc')](handleError(_0x43a18c,null));};exports['faxAccounts']=function(_0x3eaf3d,_0x2547cf){return respondWithRpcPromise(_0x33cf('0x51'),_0x3eaf3d[_0x33cf('0x19')])[_0x33cf('0x9')](respondWithResult(_0x2547cf,null))[_0x33cf('0xc')](handleError(_0x2547cf,null));};exports['chatQueuesWaitingInteractions']=function(_0x221c49,_0x2ab9b5){return respondWithRpcPromise(_0x33cf('0x52'),_0x221c49[_0x33cf('0x19')],routingClient)[_0x33cf('0x9')](respondWithResult(_0x2ab9b5,null))[_0x33cf('0xc')](handleError(_0x2ab9b5,null));};exports['mailQueuesWaitingInteractions']=function(_0x2e2250,_0x504759){return respondWithRpcPromise(_0x33cf('0x53'),_0x2e2250[_0x33cf('0x19')],routingClient)[_0x33cf('0x9')](respondWithResult(_0x504759,null))[_0x33cf('0xc')](handleError(_0x504759,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x31b050,_0x5b2670){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x31b050[_0x33cf('0x19')],routingClient)[_0x33cf('0x9')](respondWithResult(_0x5b2670,null))[_0x33cf('0xc')](handleError(_0x5b2670,null));};exports[_0x33cf('0x54')]=function(_0x2265f8,_0x188a34){return respondWithRpcPromise(_0x33cf('0x55'),_0x2265f8[_0x33cf('0x19')],routingClient)[_0x33cf('0x9')](respondWithResult(_0x188a34,null))[_0x33cf('0xc')](handleError(_0x188a34,null));};exports[_0x33cf('0x56')]=function(_0x427310,_0xb59b89){return respondWithRpcPromise(_0x33cf('0x57'),_0x427310[_0x33cf('0x19')],routingClient)[_0x33cf('0x9')](respondWithResult(_0xb59b89,null))['catch'](handleError(_0xb59b89,null));};exports['queueNotify']=function(_0x2c4dad){return function(_0xce549e,_0x33eaca){var _0x42241c,_0x5ab16f;var _0x5bfe4f=_[_0x33cf('0x58')](_0x2c4dad);var _0x5cbc71=_0x2c4dad==='chat'?'Website':_0x33cf('0x59');return db[_0x5bfe4f+_0x33cf('0x5a')][_0x33cf('0x5b')]({'raw':!![],'where':{'id':_0xce549e[_0x33cf('0x1c')]['id']}})[_0x33cf('0x9')](function(_0x54081b){if(_['isNil'](_0x54081b)){throw new Error(_0x5bfe4f+'\x20Queue\x20not\x20found');}_0x42241c=_0x54081b;return db[_0x5bfe4f+_0x33cf('0x5c')][_0x33cf('0x5b')]({'where':{'id':_0xce549e['body'][_0x33cf('0x5d')]},'include':[{'model':db[_0x5bfe4f+_0x33cf('0x5e')],'as':'Interaction'},{'model':db[_0x5bfe4f+_0x5cbc71],'as':_0x33cf('0x59')}]});})[_0x33cf('0x9')](function(_0x1e9120){if(_[_0x33cf('0x12')](_0x1e9120)){throw new Error(_0x5bfe4f+'\x20Message\x20not\x20found');}_0x5ab16f=_0x1e9120;return _0x1e9120[_0x33cf('0x5f')]({'read':0x0,'readAt':null,'UserId':null});})[_0x33cf('0x9')](function(){var _0xf52e42={'uniqueid':_0x2c4dad+'.'+_0x5ab16f['id']+'.'+_0x5ab16f[_0x33cf('0x5e')]['id'],'FromUserId':_0xce549e[_0x33cf('0x2f')]['id'],'type':_0x33cf('0x60')};_0xf52e42[_0x5bfe4f+_0x33cf('0x61')]=_0x5ab16f['id'];_0xf52e42[_0x5bfe4f+'InteractionId']=_0x5ab16f[_0x33cf('0x5e')]['id'];_0xf52e42[_0x33cf('0x62')+_0x5bfe4f+_0x5cbc71+'Id']=_0x5ab16f['Account']['id'];_0xf52e42['To'+_0x5bfe4f+_0x33cf('0x63')]=_0x42241c['id'];return db[_0x5bfe4f+_0x33cf('0x64')][_0x33cf('0x65')](_0xf52e42);})['then'](function(){return respondWithRpcPromise(_0x33cf('0x66'),{'channel':_0x2c4dad,'interaction':_0x5ab16f[_0x33cf('0x5e')],'message':_0x5ab16f,'account':_0x5ab16f[_0x33cf('0x59')],'applications':[{'id':0x0,'priority':0x1,'app':_0x33cf('0x60'),'appdata':_0x42241c[_0x33cf('0x30')]+','+(_0x5ab16f[_0x33cf('0x59')][_0x33cf('0x67')]||0x12c),'interval':_0x33cf('0x68')}]},routingClient);})['then'](respondWithResult(_0x33eaca,null))[_0x33cf('0xc')](handleError(_0x33eaca,null));};};exports[_0x33cf('0x69')]=function(_0x102777,_0x92f59e){var _0x48daa5,_0x1b57ba;if(_[_0x33cf('0x12')](_0x102777[_0x33cf('0x2d')]['channel'])){throw new Error(_0x33cf('0x6a'));}var _0x3f42d1=_0x102777['body'][_0x33cf('0x6b')];var _0x21284a=_[_0x33cf('0x58')](_0x3f42d1);var _0x515087=_0x3f42d1===_0x33cf('0x6c')?_0x33cf('0x6d'):_0x33cf('0x59');return db[_0x33cf('0x6e')][_0x33cf('0x5b')]({'raw':!![],'where':{'id':_0x102777['params']['id'],'role':_0x33cf('0x3b')}})[_0x33cf('0x9')](function(_0x266e02){if(_[_0x33cf('0x12')](_0x266e02)){throw new Error(_0x33cf('0x6f'));}_0x48daa5=_0x266e02;return db[_0x21284a+'Message'][_0x33cf('0x5b')]({'where':{'id':_0x102777[_0x33cf('0x2d')][_0x33cf('0x5d')]},'include':[{'model':db[_0x21284a+_0x33cf('0x5e')],'as':'Interaction'},{'model':db[_0x21284a+_0x515087],'as':_0x33cf('0x59')}]});})[_0x33cf('0x9')](function(_0x2d0a22){if(_['isNil'](_0x2d0a22)){throw new Error(_0x21284a+'\x20Message\x20not\x20found');}_0x1b57ba=_0x2d0a22;return _0x2d0a22[_0x33cf('0x5f')]({'read':0x0,'readAt':null,'UserId':null});})[_0x33cf('0x9')](function(){var _0x3c12fb={'uniqueid':_0x3f42d1+'.'+_0x1b57ba['id']+'.'+_0x1b57ba['Interaction']['id'],'FromUserId':_0x102777['user']['id'],'type':_0x33cf('0x60'),'ToUserId':_0x48daa5['id']};_0x3c12fb[_0x21284a+_0x33cf('0x61')]=_0x1b57ba['id'];_0x3c12fb[_0x21284a+'InteractionId']=_0x1b57ba[_0x33cf('0x5e')]['id'];_0x3c12fb['From'+_0x21284a+_0x515087+'Id']=_0x1b57ba['Account']['id'];return db[_0x21284a+_0x33cf('0x64')][_0x33cf('0x65')](_0x3c12fb);})[_0x33cf('0x9')](function(){return respondWithRpcPromise(_0x33cf('0x66'),{'channel':_0x3f42d1,'interaction':_0x1b57ba[_0x33cf('0x5e')],'message':_0x1b57ba,'account':_0x1b57ba[_0x33cf('0x59')],'applications':[{'id':0x0,'priority':0x1,'app':_0x33cf('0x3b'),'appdata':_0x48daa5[_0x33cf('0x30')]+','+(_0x1b57ba[_0x33cf('0x59')][_0x33cf('0x70')]||0x12c),'interval':_0x33cf('0x68')}]},routingClient);})[_0x33cf('0x9')](respondWithResult(_0x92f59e,null))[_0x33cf('0xc')](handleError(_0x92f59e,null));}; \ No newline at end of file +var _0x000a=['showSmsQueues','FaxQueues','faxAccounts','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','chat','Website','Account','Queue','findOne','messageId','Interaction','\x20Message\x20not\x20found','queue','MessageId','InteractionId','From','QueueId','TransferReport','channel','capitalize','User','Agent\x20not\x20found','Message','update','create','Start','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','error','message','result','catch','status','json','sendStatus','name','send','isNil','rows','find','voiceChannels','VoiceChannels','voiceChannelMixMonitor','merge','query','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','showVoiceQueues','VoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','hasOwnProperty','MemberReport','findAll','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','length','findOrCreate','interface','format','INTERACTION','agent','internal','capacity','telephones','trunks','Trunks','campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues'];(function(_0x7e06a8,_0x5ccb8c){var _0x2487a6=function(_0x27372f){while(--_0x27372f){_0x7e06a8['push'](_0x7e06a8['shift']());}};_0x2487a6(++_0x5ccb8c);}(_0x000a,0x1e7));var _0xa000=function(_0x490ce2,_0x338dd9){_0x490ce2=_0x490ce2-0x0;var _0x5aee6d=_0x000a[_0x490ce2];return _0x5aee6d;};'use strict';var BPromise=require(_0xa000('0x0'));var moment=require(_0xa000('0x1'));var _=require(_0xa000('0x2'));var util=require(_0xa000('0x3'));var db=require(_0xa000('0x4'))['db'];var logger=require(_0xa000('0x5'))('api');var jayson=require(_0xa000('0x6'));var amiClient=jayson[_0xa000('0x7')][_0xa000('0x8')]({'port':0x232a});var mailClient=jayson[_0xa000('0x7')][_0xa000('0x8')]({'port':0x232b});var routingClient=jayson[_0xa000('0x7')][_0xa000('0x8')]({'port':0x232c});function respondWithRpcPromise(_0xe95aca,_0x2c74e4,_0x1c3349){return new BPromise(function(_0x5c85cc,_0x24180f){var _0x37380c=_0x1c3349?_0x1c3349:amiClient;return _0x37380c[_0xa000('0x9')](_0xe95aca,_0x2c74e4)[_0xa000('0xa')](function(_0x3b764d){if(_0x3b764d[_0xa000('0xb')]){if(_0x3b764d[_0xa000('0xb')]['code']===0x1f4){return _0x24180f(_0x3b764d[_0xa000('0xb')][_0xa000('0xc')]);}return _0x5c85cc(_0x3b764d[_0xa000('0xb')]['message']);}else{_0x5c85cc(_0x3b764d[_0xa000('0xd')]);}})[_0xa000('0xe')](function(_0x54e250){_0x24180f(_0x54e250);});});}function respondWithResult(_0x21c827,_0x56f7c7){_0x56f7c7=_0x56f7c7||0xc8;return function(_0x2f28e1){if(_0x2f28e1){return _0x21c827[_0xa000('0xf')](_0x56f7c7)[_0xa000('0x10')](_0x2f28e1);}return _0x21c827[_0xa000('0x11')](0x194);};}function handleError(_0x32f452,_0x5432a5){_0x5432a5=_0x5432a5||0x1f4;return function(_0xcf8cce){logger[_0xa000('0xb')](_0xcf8cce['stack']);if(_0xcf8cce[_0xa000('0x12')]){delete _0xcf8cce[_0xa000('0x12')];}_0x32f452[_0xa000('0xf')](_0x5432a5)[_0xa000('0x13')](_0xcf8cce);};}function findById(_0x38577d){return function(_0x1845dd){if(!_[_0xa000('0x14')](_0x38577d)&&!_[_0xa000('0x14')](_0x1845dd)&&!_[_0xa000('0x14')](_0x1845dd[_0xa000('0x15')])){return _[_0xa000('0x16')](_0x1845dd[_0xa000('0x15')],function(_0x4cc2db){return _0x4cc2db['id']==_0x38577d;});}return null;};}exports[_0xa000('0x17')]=function(_0x41c044,_0x446753){return respondWithRpcPromise(_0xa000('0x18'),_0x41c044['query'])[_0xa000('0xa')](respondWithResult(_0x446753,null))['catch'](handleError(_0x446753,null));};exports[_0xa000('0x19')]=function(_0x1f1e10,_0x5e8876){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0xa000('0x1a')](_0x1f1e10[_0xa000('0x1b')],_0x1f1e10[_0xa000('0x1c')]))[_0xa000('0xa')](respondWithResult(_0x5e8876,null))['catch'](handleError(_0x5e8876,null));};exports[_0xa000('0x1d')]=function(_0x4cfdcf,_0x251792){return respondWithRpcPromise(_0xa000('0x1e'),_[_0xa000('0x1a')](_0x4cfdcf[_0xa000('0x1b')],_0x4cfdcf['params']))['then'](respondWithResult(_0x251792,null))[_0xa000('0xe')](handleError(_0x251792,null));};exports['voiceQueues']=function(_0x53b1ea,_0x2ed85a){return respondWithRpcPromise('VoiceQueues',_0x53b1ea[_0xa000('0x1b')])[_0xa000('0xa')](respondWithResult(_0x2ed85a,null))[_0xa000('0xe')](handleError(_0x2ed85a,null));};exports[_0xa000('0x1f')]=function(_0x108230,_0x559096){return respondWithRpcPromise(_0xa000('0x20'),_0x108230[_0xa000('0x1b')])[_0xa000('0xa')](findById(_0x108230[_0xa000('0x1c')]['id']))[_0xa000('0xa')](respondWithResult(_0x559096,null))[_0xa000('0xe')](handleError(_0x559096,null));};exports[_0xa000('0x21')]=function(_0x5738df,_0x3d4422){return respondWithRpcPromise(_0xa000('0x22'),_[_0xa000('0x1a')](_0x5738df[_0xa000('0x1b')],_0x5738df[_0xa000('0x1c')]))['then'](respondWithResult(_0x3d4422,null))[_0xa000('0xe')](handleError(_0x3d4422,null));};exports[_0xa000('0x23')]=function(_0x30d2fb,_0x478266){return respondWithRpcPromise('VoiceQueuesChannels',_0x30d2fb[_0xa000('0x1b')])['then'](respondWithResult(_0x478266,null))[_0xa000('0xe')](handleError(_0x478266,null));};exports['voiceQueuesChannel']=function(_0x274b6c,_0x5c4ff7){return respondWithRpcPromise(_0xa000('0x24'),_[_0xa000('0x1a')](_0x274b6c[_0xa000('0x1b')],_0x274b6c[_0xa000('0x1c')]))[_0xa000('0xa')](respondWithResult(_0x5c4ff7,null))[_0xa000('0xe')](handleError(_0x5c4ff7,null));};exports[_0xa000('0x25')]=function(_0x19410d,_0x147c10){return respondWithRpcPromise('VoiceQueuesChannelHangup',_['merge'](_0x19410d[_0xa000('0x1b')],_0x19410d[_0xa000('0x1c')]))[_0xa000('0xa')](respondWithResult(_0x147c10,null))['catch'](handleError(_0x147c10,null));};exports[_0xa000('0x26')]=function(_0x3fdc5d,_0x4ac032){return respondWithRpcPromise(_0xa000('0x27'),_[_0xa000('0x1a')](_0x3fdc5d[_0xa000('0x1b')],_0x3fdc5d[_0xa000('0x1c')]))[_0xa000('0xa')](respondWithResult(_0x4ac032,null))[_0xa000('0xe')](handleError(_0x4ac032,null));};exports[_0xa000('0x28')]=function(_0x295ed8,_0x5a3f88){return respondWithRpcPromise('Outbound',_0x295ed8[_0xa000('0x1b')])[_0xa000('0xa')](respondWithResult(_0x5a3f88,null))['catch'](handleError(_0x5a3f88,null));};exports[_0xa000('0x29')]=function(_0x3f1367,_0x2b5fe8){return respondWithRpcPromise(_0xa000('0x2a'),_0x3f1367[_0xa000('0x1b')])[_0xa000('0xa')](respondWithResult(_0x2b5fe8,null))[_0xa000('0xe')](handleError(_0x2b5fe8,null));};exports[_0xa000('0x2b')]=function(_0x578d1a,_0xca1f75){var _0x5cb94a;return respondWithRpcPromise(_0xa000('0x2c'),_0x578d1a[_0xa000('0x1b')])[_0xa000('0xa')](function(_0x4d7a64){_0x5cb94a=_0x4d7a64;return respondWithRpcPromise(_0xa000('0x2c'),_0x578d1a['query'],routingClient);})[_0xa000('0xa')](function(_0x1dfe5d){return _[_0xa000('0x1a')]({},_0x1dfe5d,_0x5cb94a);})[_0xa000('0xa')](respondWithResult(_0xca1f75,null))['catch'](handleError(_0xca1f75,null));};exports[_0xa000('0x2d')]=function(_0x10addb,_0x517db0){if(_0x10addb[_0xa000('0x2e')]&&_0x10addb[_0xa000('0x2e')][_0xa000('0x2f')]&&_0x10addb['user']&&_0x10addb[_0xa000('0x30')]['name']){for(var _0x28dfc9 in _0x10addb[_0xa000('0x2e')][_0xa000('0x2f')]){if(_0x10addb[_0xa000('0x2e')]['interaction'][_0xa000('0x31')](_0x28dfc9)){db[_0xa000('0x32')][_0xa000('0x33')]({'where':{'channel':_0x28dfc9,'membername':_0x10addb[_0xa000('0x30')][_0xa000('0x12')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x10addb['body'][_0xa000('0x2f')][_0x28dfc9]&&_0x10addb[_0xa000('0x2e')][_0xa000('0x2f')][_0x28dfc9]['length']?{'$notIn':_0x10addb['body'][_0xa000('0x2f')][_0x28dfc9]}:{'$ne':null}}})[_0xa000('0xa')](function(_0x7ef6e9){var _0x2ac89d=moment()['format'](_0xa000('0x34'));for(var _0x54adf8=0x0,_0x1a4804=_0x7ef6e9['length'];_0x54adf8<_0x1a4804;_0x54adf8+=0x1){_0x7ef6e9[_0x54adf8][_0xa000('0x35')]({'exitAt':_0x2ac89d});}});for(var _0xf170a5=0x0;_0xf170a5<_0x10addb[_0xa000('0x2e')]['interaction'][_0x28dfc9][_0xa000('0x36')];_0xf170a5+=0x1){db['MemberReport'][_0xa000('0x37')]({'where':{'channel':_0x28dfc9,'membername':_0x10addb[_0xa000('0x30')][_0xa000('0x12')],'type':'INTERACTION','uniqueid':_0x10addb[_0xa000('0x2e')]['interaction'][_0x28dfc9][_0xf170a5],'exitAt':null},'defaults':{'channel':_0x28dfc9,'membername':_0x10addb[_0xa000('0x30')][_0xa000('0x12')],'interface':_[_0xa000('0x14')](_0x10addb[_0xa000('0x30')][_0xa000('0x38')])?util[_0xa000('0x39')]('SIP/%s',_0x10addb[_0xa000('0x30')][_0xa000('0x12')]):_0x10addb['user'][_0xa000('0x38')],'type':_0xa000('0x3a'),'enterAt':moment()[_0xa000('0x39')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0xa000('0x3b'),'internal':_0x10addb[_0xa000('0x30')][_0xa000('0x3c')],'uniqueid':_0x10addb[_0xa000('0x2e')]['interaction'][_0x28dfc9][_0xf170a5]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x10addb[_0xa000('0x1c')]['id'],'capacity':_0x10addb[_0xa000('0x2e')][_0xa000('0x3d')]},routingClient)[_0xa000('0xa')](respondWithResult(_0x517db0,null))[_0xa000('0xe')](handleError(_0x517db0,null));};exports[_0xa000('0x3e')]=function(_0x3b6c17,_0x480057){return respondWithRpcPromise('Telephones',_0x3b6c17[_0xa000('0x1b')])[_0xa000('0xa')](respondWithResult(_0x480057,null))[_0xa000('0xe')](handleError(_0x480057,null));};exports[_0xa000('0x3f')]=function(_0x5348bd,_0x31aad4){return respondWithRpcPromise(_0xa000('0x40'),_0x5348bd['query'])[_0xa000('0xa')](respondWithResult(_0x31aad4,null))[_0xa000('0xe')](handleError(_0x31aad4,null));};exports[_0xa000('0x41')]=function(_0x48d909,_0x2815a8){return respondWithRpcPromise('Campaigns',_0x48d909[_0xa000('0x1b')])[_0xa000('0xa')](respondWithResult(_0x2815a8,null))['catch'](handleError(_0x2815a8,null));};exports[_0xa000('0x42')]=function(_0x41d1ca,_0xdf9a50){return respondWithRpcPromise(_0xa000('0x43'),_0x41d1ca[_0xa000('0x1b')],routingClient)['then'](respondWithResult(_0xdf9a50,null))[_0xa000('0xe')](handleError(_0xdf9a50,null));};exports[_0xa000('0x44')]=function(_0x535f6f,_0x3e5291){return respondWithRpcPromise('ChatQueues',_0x535f6f[_0xa000('0x1b')],routingClient)[_0xa000('0xa')](findById(_0x535f6f[_0xa000('0x1c')]['id']))[_0xa000('0xa')](respondWithResult(_0x3e5291,null))[_0xa000('0xe')](handleError(_0x3e5291,null));};exports[_0xa000('0x45')]=function(_0x5104f1,_0x2b3f25){return respondWithRpcPromise(_0xa000('0x46'),_0x5104f1[_0xa000('0x1b')],routingClient)[_0xa000('0xa')](respondWithResult(_0x2b3f25,null))[_0xa000('0xe')](handleError(_0x2b3f25,null));};exports[_0xa000('0x47')]=function(_0x553a6c,_0x365284){return respondWithRpcPromise(_0xa000('0x46'),_0x553a6c[_0xa000('0x1b')],routingClient)[_0xa000('0xa')](findById(_0x553a6c['params']['id']))[_0xa000('0xa')](respondWithResult(_0x365284,null))['catch'](handleError(_0x365284,null));};exports[_0xa000('0x48')]=function(_0x23f3ff,_0x37af78){return respondWithRpcPromise(_0xa000('0x49'),_0x23f3ff[_0xa000('0x1b')],mailClient)[_0xa000('0xa')](respondWithResult(_0x37af78,null))['catch'](handleError(_0x37af78,null));};exports['openchannelQueues']=function(_0x3f8711,_0x62208c){return respondWithRpcPromise(_0xa000('0x4a'),_0x3f8711[_0xa000('0x1b')],routingClient)[_0xa000('0xa')](respondWithResult(_0x62208c,null))[_0xa000('0xe')](handleError(_0x62208c,null));};exports[_0xa000('0x4b')]=function(_0x1009ef,_0x4bd44c){return respondWithRpcPromise(_0xa000('0x4a'),_0x1009ef[_0xa000('0x1b')],routingClient)['then'](findById(_0x1009ef[_0xa000('0x1c')]['id']))['then'](respondWithResult(_0x4bd44c,null))[_0xa000('0xe')](handleError(_0x4bd44c,null));};exports[_0xa000('0x4c')]=function(_0x451340,_0x2a35fd){return respondWithRpcPromise(_0xa000('0x4d'),_0x451340[_0xa000('0x1b')],routingClient)['then'](respondWithResult(_0x2a35fd,null))[_0xa000('0xe')](handleError(_0x2a35fd,null));};exports[_0xa000('0x4e')]=function(_0x455bce,_0x407c83){return respondWithRpcPromise('SmsQueues',_0x455bce[_0xa000('0x1b')],routingClient)['then'](findById(_0x455bce['params']['id']))['then'](respondWithResult(_0x407c83,null))[_0xa000('0xe')](handleError(_0x407c83,null));};exports['faxQueues']=function(_0x51a56c,_0x45354e){return respondWithRpcPromise(_0xa000('0x4f'),_0x51a56c[_0xa000('0x1b')],routingClient)[_0xa000('0xa')](respondWithResult(_0x45354e,null))[_0xa000('0xe')](handleError(_0x45354e,null));};exports['showFaxQueues']=function(_0x2deaa4,_0x4fed0d){return respondWithRpcPromise(_0xa000('0x4f'),_0x2deaa4['query'],routingClient)[_0xa000('0xa')](findById(_0x2deaa4['params']['id']))[_0xa000('0xa')](respondWithResult(_0x4fed0d,null))[_0xa000('0xe')](handleError(_0x4fed0d,null));};exports[_0xa000('0x50')]=function(_0x5beac4,_0x44f689){return respondWithRpcPromise('FaxAccounts',_0x5beac4[_0xa000('0x1b')])[_0xa000('0xa')](respondWithResult(_0x44f689,null))[_0xa000('0xe')](handleError(_0x44f689,null));};exports['chatQueuesWaitingInteractions']=function(_0x122082,_0x5af39f){return respondWithRpcPromise(_0xa000('0x51'),_0x122082[_0xa000('0x1b')],routingClient)[_0xa000('0xa')](respondWithResult(_0x5af39f,null))[_0xa000('0xe')](handleError(_0x5af39f,null));};exports[_0xa000('0x52')]=function(_0x346cf,_0x4eaf50){return respondWithRpcPromise(_0xa000('0x53'),_0x346cf['query'],routingClient)[_0xa000('0xa')](respondWithResult(_0x4eaf50,null))[_0xa000('0xe')](handleError(_0x4eaf50,null));};exports[_0xa000('0x54')]=function(_0x24db34,_0x426ec1){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x24db34[_0xa000('0x1b')],routingClient)[_0xa000('0xa')](respondWithResult(_0x426ec1,null))['catch'](handleError(_0x426ec1,null));};exports[_0xa000('0x55')]=function(_0x3bb7e5,_0x560586){return respondWithRpcPromise(_0xa000('0x56'),_0x3bb7e5[_0xa000('0x1b')],routingClient)[_0xa000('0xa')](respondWithResult(_0x560586,null))[_0xa000('0xe')](handleError(_0x560586,null));};exports[_0xa000('0x57')]=function(_0x2f8b52,_0x336b7b){return respondWithRpcPromise(_0xa000('0x58'),_0x2f8b52['query'],routingClient)['then'](respondWithResult(_0x336b7b,null))[_0xa000('0xe')](handleError(_0x336b7b,null));};exports[_0xa000('0x59')]=function(_0x2db7b2){return function(_0x4834ae,_0xd847a9){var _0x49fb06,_0x4f8c81;var _0x48641d=_['capitalize'](_0x2db7b2);var _0x3baaef=_0x2db7b2===_0xa000('0x5a')?_0xa000('0x5b'):_0xa000('0x5c');return db[_0x48641d+_0xa000('0x5d')][_0xa000('0x5e')]({'raw':!![],'where':{'id':_0x4834ae[_0xa000('0x1c')]['id']}})['then'](function(_0x58aee9){if(_[_0xa000('0x14')](_0x58aee9)){throw new Error(_0x48641d+'\x20Queue\x20not\x20found');}_0x49fb06=_0x58aee9;return db[_0x48641d+'Message'][_0xa000('0x5e')]({'where':{'id':_0x4834ae[_0xa000('0x2e')][_0xa000('0x5f')]},'include':[{'model':db[_0x48641d+_0xa000('0x60')],'as':'Interaction'},{'model':db[_0x48641d+_0x3baaef],'as':_0xa000('0x5c')}]});})['then'](function(_0x5dc31b){if(_[_0xa000('0x14')](_0x5dc31b)){throw new Error(_0x48641d+_0xa000('0x61'));}_0x4f8c81=_0x5dc31b;return _0x5dc31b['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xa000('0xa')](function(){var _0x43ac18={'uniqueid':_0x2db7b2+'.'+_0x4f8c81['id']+'.'+_0x4f8c81[_0xa000('0x60')]['id'],'FromUserId':_0x4834ae['user']['id'],'type':_0xa000('0x62')};_0x43ac18[_0x48641d+_0xa000('0x63')]=_0x4f8c81['id'];_0x43ac18[_0x48641d+_0xa000('0x64')]=_0x4f8c81['Interaction']['id'];_0x43ac18[_0xa000('0x65')+_0x48641d+_0x3baaef+'Id']=_0x4f8c81[_0xa000('0x5c')]['id'];_0x43ac18['To'+_0x48641d+_0xa000('0x66')]=_0x49fb06['id'];return db[_0x48641d+_0xa000('0x67')]['create'](_0x43ac18);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x2db7b2,'interaction':_0x4f8c81['Interaction'],'message':_0x4f8c81,'account':_0x4f8c81[_0xa000('0x5c')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x49fb06[_0xa000('0x12')]+','+(_0x4f8c81[_0xa000('0x5c')]['queueTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xa000('0xa')](respondWithResult(_0xd847a9,null))[_0xa000('0xe')](handleError(_0xd847a9,null));};};exports['agentNotify']=function(_0x3895be,_0x8c0c03){var _0x887a54,_0x439ded;if(_[_0xa000('0x14')](_0x3895be[_0xa000('0x2e')][_0xa000('0x68')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x56fc6a=_0x3895be[_0xa000('0x2e')][_0xa000('0x68')];var _0x4b8fe6=_[_0xa000('0x69')](_0x56fc6a);var _0x3a6227=_0x56fc6a===_0xa000('0x5a')?_0xa000('0x5b'):'Account';return db[_0xa000('0x6a')]['findOne']({'raw':!![],'where':{'id':_0x3895be[_0xa000('0x1c')]['id'],'role':_0xa000('0x3b')}})[_0xa000('0xa')](function(_0x48e389){if(_[_0xa000('0x14')](_0x48e389)){throw new Error(_0xa000('0x6b'));}_0x887a54=_0x48e389;return db[_0x4b8fe6+_0xa000('0x6c')][_0xa000('0x5e')]({'where':{'id':_0x3895be[_0xa000('0x2e')]['messageId']},'include':[{'model':db[_0x4b8fe6+'Interaction'],'as':'Interaction'},{'model':db[_0x4b8fe6+_0x3a6227],'as':'Account'}]});})[_0xa000('0xa')](function(_0x5d5565){if(_[_0xa000('0x14')](_0x5d5565)){throw new Error(_0x4b8fe6+_0xa000('0x61'));}_0x439ded=_0x5d5565;return _0x5d5565[_0xa000('0x6d')]({'read':0x0,'readAt':null,'UserId':null});})[_0xa000('0xa')](function(){var _0x412876={'uniqueid':_0x56fc6a+'.'+_0x439ded['id']+'.'+_0x439ded[_0xa000('0x60')]['id'],'FromUserId':_0x3895be[_0xa000('0x30')]['id'],'type':_0xa000('0x62'),'ToUserId':_0x887a54['id']};_0x412876[_0x4b8fe6+_0xa000('0x63')]=_0x439ded['id'];_0x412876[_0x4b8fe6+'InteractionId']=_0x439ded['Interaction']['id'];_0x412876[_0xa000('0x65')+_0x4b8fe6+_0x3a6227+'Id']=_0x439ded['Account']['id'];return db[_0x4b8fe6+_0xa000('0x67')][_0xa000('0x6e')](_0x412876);})[_0xa000('0xa')](function(){return respondWithRpcPromise(_0xa000('0x6f'),{'channel':_0x56fc6a,'interaction':_0x439ded[_0xa000('0x60')],'message':_0x439ded,'account':_0x439ded['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x887a54[_0xa000('0x12')]+','+(_0x439ded[_0xa000('0x5c')][_0xa000('0x70')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xa000('0xa')](respondWithResult(_0x8c0c03,null))[_0xa000('0xe')](handleError(_0x8c0c03,null));}; \ No newline at end of file diff --git a/server/api/saAsset/index.js b/server/api/saAsset/index.js index 3c2ea24..56c658b 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 _0x885e=['post','create','/:id/automaticSubscriptionInvoiceAlignment','/:id/automaticSubscriptionInvoice','automaticSubscriptionInvoice','put','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/getSubscriptions','getSubscriptions','/:id','show'];(function(_0x5ad2b1,_0x4a5a0e){var _0x57c3d6=function(_0x579ea4){while(--_0x579ea4){_0x5ad2b1['push'](_0x5ad2b1['shift']());}};_0x57c3d6(++_0x4a5a0e);}(_0x885e,0xe4));var _0xe885=function(_0x199d2e,_0x44b199){_0x199d2e=_0x199d2e-0x0;var _0x40b47d=_0x885e[_0x199d2e];return _0x40b47d;};'use strict';var multer=require(_0xe885('0x0'));var util=require(_0xe885('0x1'));var path=require('path');var timeout=require(_0xe885('0x2'));var express=require(_0xe885('0x3'));var router=express[_0xe885('0x4')]();var auth=require(_0xe885('0x5'));var interaction=require(_0xe885('0x6'));var config=require('../../config/environment');var controller=require('./saAsset.controller');router[_0xe885('0x7')]('/',auth[_0xe885('0x8')](),controller[_0xe885('0x9')]);router[_0xe885('0x7')]('/describe',auth[_0xe885('0x8')](),controller['describe']);router[_0xe885('0x7')](_0xe885('0xa'),auth[_0xe885('0x8')](),controller[_0xe885('0xb')]);router[_0xe885('0x7')](_0xe885('0xc'),auth['isAuthenticated'](),controller[_0xe885('0xd')]);router[_0xe885('0xe')]('/',auth[_0xe885('0x8')](),controller[_0xe885('0xf')]);router[_0xe885('0xe')](_0xe885('0x10'),auth[_0xe885('0x8')](),controller['automaticSubscriptionInvoiceAlignment']);router[_0xe885('0xe')](_0xe885('0x11'),auth[_0xe885('0x8')](),controller[_0xe885('0x12')]);router[_0xe885('0x13')](_0xe885('0xc'),auth[_0xe885('0x8')](),controller['update']);router['delete']('/:id',auth[_0xe885('0x8')](),controller[_0xe885('0x14')]);module[_0xe885('0x15')]=router; \ No newline at end of file +var _0x1052=['../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe','/getSubscriptions','/:id','post','create','automaticSubscriptionInvoiceAlignment','/:id/automaticSubscriptionInvoice','automaticSubscriptionInvoice','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x4026ea,_0x33499d){var _0x40bc4f=function(_0x52f3ce){while(--_0x52f3ce){_0x4026ea['push'](_0x4026ea['shift']());}};_0x40bc4f(++_0x33499d);}(_0x1052,0xf4));var _0x2105=function(_0x2e65ee,_0x29dad9){_0x2e65ee=_0x2e65ee-0x0;var _0x4c712a=_0x1052[_0x2e65ee];return _0x4c712a;};'use strict';var multer=require(_0x2105('0x0'));var util=require(_0x2105('0x1'));var path=require(_0x2105('0x2'));var timeout=require(_0x2105('0x3'));var express=require(_0x2105('0x4'));var router=express[_0x2105('0x5')]();var auth=require(_0x2105('0x6'));var interaction=require(_0x2105('0x7'));var config=require(_0x2105('0x8'));var controller=require('./saAsset.controller');router['get']('/',auth[_0x2105('0x9')](),controller['index']);router[_0x2105('0xa')](_0x2105('0xb'),auth['isAuthenticated'](),controller[_0x2105('0xc')]);router[_0x2105('0xa')](_0x2105('0xd'),auth['isAuthenticated'](),controller['getSubscriptions']);router[_0x2105('0xa')](_0x2105('0xe'),auth[_0x2105('0x9')](),controller['show']);router[_0x2105('0xf')]('/',auth[_0x2105('0x9')](),controller[_0x2105('0x10')]);router[_0x2105('0xf')]('/:id/automaticSubscriptionInvoiceAlignment',auth['isAuthenticated'](),controller[_0x2105('0x11')]);router[_0x2105('0xf')](_0x2105('0x12'),auth[_0x2105('0x9')](),controller[_0x2105('0x13')]);router[_0x2105('0x14')](_0x2105('0xe'),auth[_0x2105('0x9')](),controller[_0x2105('0x15')]);router[_0x2105('0x16')]('/:id',auth[_0x2105('0x9')](),controller[_0x2105('0x17')]);module[_0x2105('0x18')]=router; \ No newline at end of file diff --git a/server/api/saAsset/saAsset.attributes.js b/server/api/saAsset/saAsset.attributes.js index d3f6500..c9fe50d 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 _0xd914=['DECIMAL','DATE','BOOLEAN','sequelize','exports','INTEGER','TEXT','STRING','long','\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci'];(function(_0x2345b1,_0x41badb){var _0x3ae78c=function(_0x5e10cb){while(--_0x5e10cb){_0x2345b1['push'](_0x2345b1['shift']());}};_0x3ae78c(++_0x41badb);}(_0xd914,0x17f));var _0x4d91=function(_0x4e4519,_0x392ae){_0x4e4519=_0x4e4519-0x0;var _0x340044=_0xd914[_0x4e4519];return _0x340044;};'use strict';var Sequelize=require(_0x4d91('0x0'));module[_0x4d91('0x1')]={'companyName':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x4d91('0x2')]},'productName':{'type':Sequelize[_0x4d91('0x3')],'allowNull':![]},'productCode':{'type':Sequelize[_0x4d91('0x4')],'allowNull':![]},'productDescription':{'type':Sequelize[_0x4d91('0x3')](_0x4d91('0x5'))+_0x4d91('0x6')},'typeName':{'type':Sequelize['STRING']},'pricelistName':{'type':Sequelize[_0x4d91('0x3')]},'pricelistId':{'type':Sequelize['TEXT']},'netPrice':{'type':Sequelize[_0x4d91('0x7')](0xd,0x4),'allowNull':![]},'discount':{'type':Sequelize[_0x4d91('0x7')](0x6,0x3),'allowNull':![]},'tax':{'type':Sequelize[_0x4d91('0x7')](0xd,0x4),'allowNull':![]},'agentFullname':{'type':Sequelize[_0x4d91('0x4')]},'note':{'type':Sequelize[_0x4d91('0x3')]},'dateLastInvoice':{'type':Sequelize[_0x4d91('0x8')]},'dateNextInvoice':{'type':Sequelize[_0x4d91('0x8')]},'subscriptionId':{'type':Sequelize[_0x4d91('0x2')],'allowNull':![]},'subscriptionName':{'type':Sequelize['STRING'],'allowNull':![]},'subscriptionMonthly':{'type':Sequelize[_0x4d91('0x2')],'allowNull':![]},'deleted':{'type':Sequelize[_0x4d91('0x9')]},'status':{'type':Sequelize[_0x4d91('0x4')]}}; \ No newline at end of file +var _0xe5fb=['STRING','long','\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci','DECIMAL','DATE','BOOLEAN','sequelize','exports','INTEGER','TEXT'];(function(_0x2564ac,_0xce68d5){var _0x26e774=function(_0x763bd5){while(--_0x763bd5){_0x2564ac['push'](_0x2564ac['shift']());}};_0x26e774(++_0xce68d5);}(_0xe5fb,0xce));var _0xbe5f=function(_0x967959,_0x53c5c1){_0x967959=_0x967959-0x0;var _0x5c4489=_0xe5fb[_0x967959];return _0x5c4489;};'use strict';var Sequelize=require(_0xbe5f('0x0'));module[_0xbe5f('0x1')]={'companyName':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0xbe5f('0x2')]},'productName':{'type':Sequelize[_0xbe5f('0x3')],'allowNull':![]},'productCode':{'type':Sequelize[_0xbe5f('0x4')],'allowNull':![]},'productDescription':{'type':Sequelize['TEXT'](_0xbe5f('0x5'))+_0xbe5f('0x6')},'typeName':{'type':Sequelize[_0xbe5f('0x4')]},'pricelistName':{'type':Sequelize[_0xbe5f('0x3')]},'pricelistId':{'type':Sequelize[_0xbe5f('0x3')]},'netPrice':{'type':Sequelize['DECIMAL'](0xd,0x4),'allowNull':![]},'discount':{'type':Sequelize[_0xbe5f('0x7')](0x6,0x3),'allowNull':![]},'tax':{'type':Sequelize[_0xbe5f('0x7')](0xd,0x4),'allowNull':![]},'agentFullname':{'type':Sequelize[_0xbe5f('0x4')]},'note':{'type':Sequelize[_0xbe5f('0x3')]},'dateLastInvoice':{'type':Sequelize[_0xbe5f('0x8')]},'dateNextInvoice':{'type':Sequelize[_0xbe5f('0x8')]},'subscriptionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'subscriptionName':{'type':Sequelize[_0xbe5f('0x4')],'allowNull':![]},'subscriptionMonthly':{'type':Sequelize[_0xbe5f('0x2')],'allowNull':![]},'deleted':{'type':Sequelize[_0xbe5f('0x9')]},'status':{'type':Sequelize[_0xbe5f('0x4')]}}; \ No newline at end of file diff --git a/server/api/saAsset/saAsset.controller.js b/server/api/saAsset/saAsset.controller.js index bcd9be2..689800c 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 _0x814b=['stack','name','send','index','SAAsset','rawAttributes','keys','query','filters','intersection','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','include','findAll','show','params','model','fields','includeAll','find','catch','create','body','update','describe','getSubscriptions','nolimit','map','ppppp\x20\x20options','automaticSubscriptionInvoiceAlignment','sequelize','transaction','CmCompany','companyId','DESC','subscriptionId','forEach','log','automaticSubscriptionInvoice\x20productForCompany->','push','TCL:\x20exports.automaticProformaInvoice\x20->\x20err','SequelizeUniqueConstraintError','Duplicate\x20entry.','??????\x20invoiceType','??????\x20updSubscriptionDetail\x20product.id->','??????\x20updSubscriptionDetail\x20product.dateNextInvoice->','dateNextInvoice','Partial','add','subscriptionMonthly','lastInvoice','nextInvoice','companyName','productCode','productDescription','typeName','pricelistName','netPrice','tax','System','subscriptionName','quantity','SAInvoiceDetail','findOne','Automatic\x20Job','close','saStreet','saPostalCode','saCity','saCountry','saISOCode','saFiscalCode','saSocCap','saPIVA','saSDICode','saFiscalMessage','saExpiryDay','bankAccount','bankName','bankstreet','bankpostalCode','bankcountry','bankBICSWIFT','bankIBAN','phone','fax','bankABI','paypalEmail','SAInvoice','pricelistId','isNull','mapValues','createdAt','value','diff','days','diffDay','dayPrice','automaticSubscriptionInvoice','££££££££\x20products','groupBy','all','No\x20product\x20to\x20assign\x20invoice.\x20Invoice\x20not\x20created!!\x20','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','Content-Range','then','destroy','error'];(function(_0xc940eb,_0x2a3710){var _0x5a2bf4=function(_0x3e29d7){while(--_0x3e29d7){_0xc940eb['push'](_0xc940eb['shift']());}};_0x5a2bf4(++_0x2a3710);}(_0x814b,0x1a2));var _0xb814=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0x814b[_0x4a3898];return _0x25ceb0;};'use strict';var pdf=require(_0xb814('0x0'));var emlformat=require(_0xb814('0x1'));var rimraf=require(_0xb814('0x2'));var zipdir=require(_0xb814('0x3'));var jsonpatch=require(_0xb814('0x4'));var rp=require(_0xb814('0x5'));var moment=require('moment');var BPromise=require(_0xb814('0x6'));var Mustache=require(_0xb814('0x7'));var util=require(_0xb814('0x8'));var path=require(_0xb814('0x9'));var sox=require(_0xb814('0xa'));var csv=require(_0xb814('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb814('0xc'));var squel=require(_0xb814('0xd'));var crypto=require('crypto');var jsforce=require(_0xb814('0xe'));var deskjs=require(_0xb814('0xf'));var toCsv=require(_0xb814('0xb'));var querystring=require(_0xb814('0x10'));var Papa=require(_0xb814('0x11'));var Redis=require(_0xb814('0x12'));var authService=require(_0xb814('0x13'));var qs=require(_0xb814('0x14'));var hardwareService=require(_0xb814('0x15'));var logger=require(_0xb814('0x16'))(_0xb814('0x17'));var utils=require('../../config/utils');var config=require(_0xb814('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26b35f,_0x15d6ef){_0x15d6ef=_0x15d6ef||0xcc;return function(_0x35b10d){if(_0x35b10d){return _0x26b35f[_0xb814('0x19')](_0x15d6ef);}return _0x26b35f[_0xb814('0x1a')](_0x15d6ef)[_0xb814('0x1b')]();};}function respondWithResult(_0x1438e7,_0x41ed7b){_0x41ed7b=_0x41ed7b||0xc8;return function(_0xa0a2e5){if(_0xa0a2e5){return _0x1438e7[_0xb814('0x1a')](_0x41ed7b)[_0xb814('0x1c')](_0xa0a2e5);}};}function respondWithFilteredResult(_0x44fb96,_0x17f5bd){return function(_0x39bfcf){if(_0x39bfcf){var _0x303aca=_0x39bfcf[_0xb814('0x1d')],_0x3a71d6=_0x17f5bd[_0xb814('0x1e')],_0x45e0d0=_0x17f5bd[_0xb814('0x1e')]+_0x17f5bd['limit'],_0x265a83;if(_0x45e0d0>=_0x303aca){_0x45e0d0=_0x303aca;_0x265a83=0xc8;}else{_0x265a83=0xce;}_0x44fb96[_0xb814('0x1a')](_0x265a83);return _0x44fb96['set'](_0xb814('0x1f'),_0x3a71d6+'-'+_0x45e0d0+'/'+_0x303aca)[_0xb814('0x1c')](_0x39bfcf);}return null;};}function patchUpdates(_0x4c3007){return function(_0x4b55a7){try{jsonpatch['apply'](_0x4b55a7,_0x4c3007,!![]);}catch(_0x399b43){return BPromise['reject'](_0x399b43);}return _0x4b55a7['save']();};}function saveUpdates(_0xb684ea,_0x24211d){return function(_0x25b6b6){if(_0x25b6b6){return _0x25b6b6['update'](_0xb684ea)[_0xb814('0x20')](function(_0x531032){return _0x531032;});}return null;};}function removeEntity(_0x1e6393,_0x1808a3){return function(_0x3b267e){if(_0x3b267e){return _0x3b267e[_0xb814('0x21')]()[_0xb814('0x20')](function(){_0x1e6393[_0xb814('0x1a')](0xcc)[_0xb814('0x1b')]();});}};}function handleEntityNotFound(_0x594470,_0x2ead86){return function(_0x52b7a3){if(!_0x52b7a3){_0x594470[_0xb814('0x19')](0x194);}return _0x52b7a3;};}function handleError(_0x457dac,_0x31c7ec){_0x31c7ec=_0x31c7ec||0x1f4;return function(_0x208927){logger[_0xb814('0x22')](_0x208927[_0xb814('0x23')]);if(_0x208927[_0xb814('0x24')]){delete _0x208927['name'];}_0x457dac[_0xb814('0x1a')](_0x31c7ec)[_0xb814('0x25')](_0x208927);};}exports[_0xb814('0x26')]=function(_0x349394,_0x32ed56){var _0x1d5965={},_0x3f0150={},_0x1e4e89={'count':0x0,'rows':[]};var _0x5a6291=db[_0xb814('0x27')][_0xb814('0x28')];_0x3f0150['model']=_[_0xb814('0x29')](_0x5a6291);_0x3f0150[_0xb814('0x2a')]=_[_0xb814('0x29')](_0x349394['query']);_0x3f0150[_0xb814('0x2b')]=_[_0xb814('0x2c')](_0x3f0150['model'],_0x3f0150[_0xb814('0x2a')]);_0x1d5965['attributes']=_[_0xb814('0x2c')](_0x3f0150['model'],qs['fields'](_0x349394[_0xb814('0x2a')]['fields']));_0x1d5965[_0xb814('0x2d')]=_0x1d5965[_0xb814('0x2d')][_0xb814('0x2e')]?_0x1d5965['attributes']:_0x3f0150['model'];if(!_0x349394[_0xb814('0x2a')][_0xb814('0x2f')]('nolimit')){_0x1d5965[_0xb814('0x30')]=qs[_0xb814('0x30')](_0x349394[_0xb814('0x2a')][_0xb814('0x30')]);_0x1d5965[_0xb814('0x1e')]=qs[_0xb814('0x1e')](_0x349394[_0xb814('0x2a')]['offset']);}_0x1d5965[_0xb814('0x31')]=qs[_0xb814('0x32')](_0x349394[_0xb814('0x2a')][_0xb814('0x32')]);_0x1d5965[_0xb814('0x33')]=qs['filters'](_[_0xb814('0x34')](_0x349394['query'],_0x3f0150[_0xb814('0x2b')]));if(_0x349394[_0xb814('0x2a')][_0xb814('0x35')]){_0x1d5965['where']=_[_0xb814('0x36')](_0x1d5965[_0xb814('0x33')],{'$or':_['map'](_0x5a6291,function(_0x2fcd92){if(_0x2fcd92[_0xb814('0x37')][_0xb814('0x38')]!==_0xb814('0x39')){var _0xd77d96={};_0xd77d96[_0x2fcd92[_0xb814('0x3a')]]={'$like':'%'+_0x349394['query'][_0xb814('0x35')]+'%'};return _0xd77d96;}})});}_0x1d5965=_['merge']({},_0x1d5965,_0x349394[_0xb814('0x3b')]);var _0x4b5583={'where':_0x1d5965[_0xb814('0x33')]};return db['SAAsset'][_0xb814('0x1d')](_0x4b5583)[_0xb814('0x20')](function(_0x54a7fb){_0x1e4e89['count']=_0x54a7fb;if(_0x349394['query']['includeAll']){_0x1d5965[_0xb814('0x3c')]=[{'all':!![]}];}return db[_0xb814('0x27')][_0xb814('0x3d')](_0x1d5965);})[_0xb814('0x20')](function(_0x51cdba){_0x1e4e89['rows']=_0x51cdba;return _0x1e4e89;})[_0xb814('0x20')](respondWithFilteredResult(_0x32ed56,_0x1d5965))['catch'](handleError(_0x32ed56,null));};exports[_0xb814('0x3e')]=function(_0x1098eb,_0x178823){var _0x3063bf={'raw':![],'where':{'id':_0x1098eb[_0xb814('0x3f')]['id']}},_0x42653f={};_0x42653f[_0xb814('0x40')]=_[_0xb814('0x29')](db[_0xb814('0x27')]['rawAttributes']);_0x42653f['query']=_['keys'](_0x1098eb[_0xb814('0x2a')]);_0x42653f['filters']=_[_0xb814('0x2c')](_0x42653f['model'],_0x42653f[_0xb814('0x2a')]);_0x3063bf[_0xb814('0x2d')]=_[_0xb814('0x2c')](_0x42653f[_0xb814('0x40')],qs['fields'](_0x1098eb[_0xb814('0x2a')][_0xb814('0x41')]));_0x3063bf[_0xb814('0x2d')]=_0x3063bf[_0xb814('0x2d')][_0xb814('0x2e')]?_0x3063bf[_0xb814('0x2d')]:_0x42653f['model'];if(_0x1098eb[_0xb814('0x2a')][_0xb814('0x42')]){_0x3063bf[_0xb814('0x3c')]=[{'all':!![]}];}_0x3063bf=_[_0xb814('0x36')]({},_0x3063bf,_0x1098eb[_0xb814('0x3b')]);return db[_0xb814('0x27')][_0xb814('0x43')](_0x3063bf)['then'](handleEntityNotFound(_0x178823,null))['then'](respondWithResult(_0x178823,null))[_0xb814('0x44')](handleError(_0x178823,null));};exports[_0xb814('0x45')]=function(_0x4c08d6,_0x2bf906){return db[_0xb814('0x27')][_0xb814('0x45')](_0x4c08d6[_0xb814('0x46')],{})[_0xb814('0x20')](respondWithResult(_0x2bf906,0xc9))[_0xb814('0x44')](handleError(_0x2bf906,null));};exports[_0xb814('0x47')]=function(_0xe73300,_0x5c7a49){if(_0xe73300[_0xb814('0x46')]['id']){delete _0xe73300[_0xb814('0x46')]['id'];}return db['SAAsset'][_0xb814('0x43')]({'where':{'id':_0xe73300['params']['id']}})[_0xb814('0x20')](handleEntityNotFound(_0x5c7a49,null))[_0xb814('0x20')](saveUpdates(_0xe73300[_0xb814('0x46')],null))[_0xb814('0x20')](respondWithResult(_0x5c7a49,null))[_0xb814('0x44')](handleError(_0x5c7a49,null));};exports[_0xb814('0x21')]=function(_0x2cc806,_0x45480e){return db[_0xb814('0x27')][_0xb814('0x43')]({'where':{'id':_0x2cc806['params']['id']}})['then'](handleEntityNotFound(_0x45480e,null))[_0xb814('0x20')](removeEntity(_0x45480e,null))[_0xb814('0x44')](handleError(_0x45480e,null));};exports[_0xb814('0x48')]=function(_0x3f8e29,_0x1b565c){return db[_0xb814('0x27')][_0xb814('0x48')]()['then'](respondWithResult(_0x1b565c,null))[_0xb814('0x44')](handleError(_0x1b565c,null));};exports[_0xb814('0x49')]=function(_0xf27a6e,_0x5a916d){var _0x3a5556={},_0x4e6f3c={},_0x252293={'count':0x0,'rows':[]};var _0x5dc28e=db[_0xb814('0x27')][_0xb814('0x28')];_0x4e6f3c['model']=_[_0xb814('0x29')](_0x5dc28e);_0x4e6f3c[_0xb814('0x2a')]=_[_0xb814('0x29')](_0xf27a6e['query']);_0x4e6f3c[_0xb814('0x2b')]=_['intersection'](_0x4e6f3c[_0xb814('0x40')],_0x4e6f3c[_0xb814('0x2a')]);_0x3a5556['attributes']=_[_0xb814('0x2c')](_0x4e6f3c['model'],qs['fields'](_0xf27a6e[_0xb814('0x2a')][_0xb814('0x41')]));_0x3a5556[_0xb814('0x2d')]=_0x3a5556['attributes'][_0xb814('0x2e')]?_0x3a5556['attributes']:_0x4e6f3c[_0xb814('0x40')];if(!_0xf27a6e[_0xb814('0x2a')]['hasOwnProperty'](_0xb814('0x4a'))){_0x3a5556['limit']=qs[_0xb814('0x30')](_0xf27a6e[_0xb814('0x2a')][_0xb814('0x30')]);_0x3a5556[_0xb814('0x1e')]=qs[_0xb814('0x1e')](_0xf27a6e[_0xb814('0x2a')][_0xb814('0x1e')]);}_0x3a5556[_0xb814('0x31')]=qs['sort'](_0xf27a6e[_0xb814('0x2a')][_0xb814('0x32')]);_0x3a5556['where']=qs[_0xb814('0x2b')](_[_0xb814('0x34')](_0xf27a6e['query'],_0x4e6f3c[_0xb814('0x2b')]));if(_0xf27a6e['query']['filter']){_0x3a5556[_0xb814('0x33')]=_['merge'](_0x3a5556[_0xb814('0x33')],{'$or':_[_0xb814('0x4b')](_0x5dc28e,function(_0x2dec52){if(_0x2dec52['type'][_0xb814('0x38')]!=='VIRTUAL'){var _0x2ef77d={};_0x2ef77d[_0x2dec52[_0xb814('0x3a')]]={'$like':'%'+_0xf27a6e[_0xb814('0x2a')][_0xb814('0x35')]+'%'};return _0x2ef77d;}})});}_0x3a5556=_[_0xb814('0x36')]({},_0x3a5556,_0xf27a6e[_0xb814('0x3b')]);var _0x2e5f99={'where':_0x3a5556[_0xb814('0x33')]};return db[_0xb814('0x27')]['count'](_0x2e5f99)[_0xb814('0x20')](function(_0x111884){_0x252293[_0xb814('0x1d')]=_0x111884;if(_0xf27a6e[_0xb814('0x2a')][_0xb814('0x42')]){_0x3a5556[_0xb814('0x3c')]=[{'all':!![]}];}console['log'](_0xb814('0x4c'),_0x3a5556);return db['SAAsset'][_0xb814('0x3d')](_0x3a5556);})[_0xb814('0x20')](function(_0xac95cf){_0x252293['rows']=_0xac95cf;return _0x252293;})[_0xb814('0x20')](respondWithFilteredResult(_0x5a916d,_0x3a5556))['catch'](handleError(_0x5a916d,null));};exports[_0xb814('0x4d')]=function(_0x4a65d0,_0x2f0c94,_0x417e45){var _0xa03cd2;if(_0x4a65d0[_0xb814('0x46')]['id']){delete _0x4a65d0[_0xb814('0x46')]['id'];}return db[_0xb814('0x4e')][_0xb814('0x4f')](function(_0x4d44e3){return db[_0xb814('0x50')]['findOne']({'where':{'defaultEntry':0x1},'raw':!![],'logging':!![]})[_0xb814('0x20')](function(_0x22c73f){_0xa03cd2=_0x22c73f;return db[_0xb814('0x27')][_0xb814('0x3d')]({'where':{'dateLastInvoice':null,'deleted':null,'status':null},'order':[[_0xb814('0x51'),_0xb814('0x52')],['pricelistId',_0xb814('0x52')],[_0xb814('0x53'),'DESC']],'raw':!![],'logging':!![]});})[_0xb814('0x20')](function(_0x32a37a){if(_0x32a37a[_0xb814('0x2e')]>0x0){var _0x130033=[];var _0x2161eb=_['groupBy'](_0x32a37a,_0xb814('0x51'));Object['keys'](_0x2161eb)[_0xb814('0x54')](function(_0x16f8f2){var _0x2645f6=_0x2161eb[_0x16f8f2];console[_0xb814('0x55')](_0xb814('0x56'),_0x2645f6);_0x130033[_0xb814('0x57')](addSubscriptionInvoice(_0x2645f6,_0xa03cd2,_0x16f8f2,'Partial',_0x4d44e3));});return BPromise['all'](_0x130033);}});})['then'](function(){return _0x2f0c94[_0xb814('0x19')](0xc8);})['catch'](function(_0x45a8b9){console[_0xb814('0x55')](_0xb814('0x58'),_0x45a8b9);if(_0x45a8b9['name']===_0xb814('0x59')){var _0x45a8b9={'errors':[{'message':_0xb814('0x5a')}]};}_0x2f0c94['status'](0x1f4)[_0xb814('0x25')](_0x45a8b9);});};function updSubscriptionDetail(_0x1bf0b7,_0x1f39c0,_0x3564e0){console['log']('??????\x20updSubscriptionDetail\x20product->',_0x1bf0b7);console[_0xb814('0x55')](_0xb814('0x5b'),_0x1f39c0);console[_0xb814('0x55')](_0xb814('0x5c'),_0x1bf0b7['id']);console[_0xb814('0x55')](_0xb814('0x5d'),_0x1bf0b7[_0xb814('0x5e')]);var _0xe47442;var _0x274ed2;if(_0x1f39c0===_0xb814('0x5f')){_0xe47442=moment();_0x274ed2=_0x1bf0b7[_0xb814('0x5e')];}else{_0xe47442=_0x1bf0b7[_0xb814('0x5e')];_0x274ed2=moment(_0x1bf0b7[_0xb814('0x5e')])[_0xb814('0x60')](_0x1bf0b7[_0xb814('0x61')],'months');}console[_0xb814('0x55')](_0xb814('0x62'),_0xe47442);console[_0xb814('0x55')](_0xb814('0x63'),_0x274ed2);return db[_0xb814('0x27')][_0xb814('0x47')]({'dateLastInvoice':_0xe47442,'dateNextInvoice':_0x274ed2,'agentFullname':'System'},{'where':{'id':_0x1bf0b7['id']},'raw':!![],'transaction':_0x3564e0})[_0xb814('0x44')](function(_0x52e1fc){throw _0x52e1fc;});}function addSubscriptionInvoiceDetail(_0x872d43,_0x39aa00,_0x3c5a58){var _0x2292e6={'companyName':_0x872d43[_0xb814('0x64')],'companyId':_0x872d43['companyId'],'productName':_0x872d43['productName'],'productCode':_0x872d43[_0xb814('0x65')],'productDescription':_0x872d43[_0xb814('0x66')],'typeName':_0x872d43[_0xb814('0x67')],'pricelistName':_0x872d43[_0xb814('0x68')],'priceListId':_0x872d43['pricelistId'],'netPrice':_0x872d43[_0xb814('0x69')],'discount':_0x872d43['discount'],'tax':_0x872d43[_0xb814('0x6a')],'agentFullname':_0xb814('0x6b'),'note':_0x872d43['note'],'subscriptionId':_0x872d43['subscriptionId'],'subscriptionName':_0x872d43[_0xb814('0x6c')],'subscriptionMonthly':_0x872d43['subscriptionMonthly'],'quantity':_0x872d43[_0xb814('0x6d')],'InvoiceId':_0x39aa00['id']};return db[_0xb814('0x6e')][_0xb814('0x45')](_0x2292e6,{'raw':!![],'transaction':_0x3c5a58})[_0xb814('0x44')](function(_0x46784f){throw _0x46784f;});}function addSubscriptionInvoice(_0x420bde,_0x40fe4a,_0x4bd56c,_0x1d37ea,_0x54413d){return db[_0xb814('0x50')]['findOne']({'where':{'id':_0x4bd56c},'raw':!![]})[_0xb814('0x20')](function(_0x43ee60){return db['SAPaymentMethod'][_0xb814('0x6f')]({'where':{'id':_0x43ee60['saPaymentMethod']},'raw':!![]})[_0xb814('0x20')](function(_0x356875){var _0x4e15c2={'name':'Invoice\x20'+moment()+'_'+_0x1d37ea,'note':_0xb814('0x70'),'agentFullname':_0xb814('0x6b'),'status':_0xb814('0x71'),'companyName':_0x43ee60[_0xb814('0x24')],'companyId':_0x43ee60['id'],'paid':0x0,'discount':0x0,'receivingStreet':_0x43ee60[_0xb814('0x72')],'receivingPostalCode':_0x43ee60[_0xb814('0x73')],'receivingCity':_0x43ee60[_0xb814('0x74')],'receivingCountry':_0x43ee60[_0xb814('0x75')],'receivingISOCode':_0x43ee60[_0xb814('0x76')],'receivingFiscalCode':_0x43ee60[_0xb814('0x77')],'receivingPIVA':_0x43ee60['saPIVA'],'receivingSDICode':_0x43ee60['saSDICode'],'receivingFiscalMessage':_0x43ee60['saFiscalMessage'],'receivingExpiryDay':_0x43ee60['saExpiryDay'],'receivingEurope':_0x43ee60['saEurope'],'receivingSocCap':_0x43ee60[_0xb814('0x78')],'issuerName':_0x40fe4a[_0xb814('0x24')],'issuerStreet':_0x40fe4a[_0xb814('0x72')],'issuerPostalCode':_0x40fe4a['saPostalCode'],'issuerCity':_0x40fe4a[_0xb814('0x74')],'issuerCountry':_0x40fe4a[_0xb814('0x75')],'issuerISOCode':_0x40fe4a[_0xb814('0x76')],'issuerFiscalCode':_0x40fe4a[_0xb814('0x77')],'issuerPIVA':_0x40fe4a[_0xb814('0x79')],'issuerSDICode':_0x40fe4a[_0xb814('0x7a')],'issuerFiscalMessage':_0x40fe4a[_0xb814('0x7b')],'issuerExpiryDay':_0x40fe4a[_0xb814('0x7c')],'issuerSocCap':_0x40fe4a['saSocCap'],'issuerBankAccount':_0x356875[_0xb814('0x7d')],'issuerBankName':_0x356875[_0xb814('0x7e')],'issuerBankStreet':_0x356875[_0xb814('0x7f')],'issuerBankPostalCode':_0x356875[_0xb814('0x80')],'issuerBankCity':_0x356875['bankcity'],'issuerBankCountry':_0x356875[_0xb814('0x81')],'issuerBankBICSWIFT':_0x356875[_0xb814('0x82')],'issuerBankIBAN':_0x356875[_0xb814('0x83')],'issuerPhone':_0x40fe4a[_0xb814('0x84')],'issuerFax':_0x40fe4a[_0xb814('0x85')],'issuerEmail':_0x40fe4a['email'],'issuerWeb':_0x40fe4a['website'],'issuerABI':_0x356875[_0xb814('0x86')],'issuerCAB':_0x356875['banckCAB'],'issuerPayPal':_0x356875[_0xb814('0x87')]};return db[_0xb814('0x88')]['create'](_0x4e15c2,{'transaction':_0x54413d})[_0xb814('0x20')](function(_0x486495){var _0xe17e86=[];for(var _0x520d0f=0x0;_0x520d0f<_0x420bde[_0xb814('0x2e')];_0x520d0f++){_0xe17e86[_0xb814('0x57')](updSubscriptionDetail(_0x420bde[_0x520d0f],_0x1d37ea,_0x54413d));}var _0x41867b=[_0xb814('0x65'),_0xb814('0x89'),_0xb814('0x53'),_0xb814('0x69')];_(_0x420bde)['groupBy'](function(_0x5a4e2e){return _[_0xb814('0x43')](_['pick'](_0x5a4e2e,_0x41867b),_['negate'](_[_0xb814('0x8a')]));})[_0xb814('0x8b')](function(_0x25d42d){var _0x57bf1b=_0x25d42d[0x0];_0x57bf1b[_0xb814('0x6d')]=_0x25d42d['length'];if(_0x1d37ea===_0xb814('0x5f')){_0x57bf1b[_0xb814('0x69')]=computePrice(_0x57bf1b[_0xb814('0x8c')],_0x57bf1b[_0xb814('0x5e')],_0x57bf1b['netPrice'],_0x57bf1b[_0xb814('0x61')]);}_0xe17e86[_0xb814('0x57')](addSubscriptionInvoiceDetail(_0x57bf1b,_0x486495,_0x54413d));})[_0xb814('0x8d')]();return BPromise['all'](_0xe17e86);});});})[_0xb814('0x44')](function(_0x3fc77d){console[_0xb814('0x55')]('TCL:\x20exports.automaticProformaInvoice\x20->\x20err',_0x3fc77d);throw _0x3fc77d;});}function computePrice(_0x5d8626,_0x2d0651,_0x9dc06b,_0x216d67){var _0x40b3c5=_0x9dc06b;console[_0xb814('0x55')](_0xb814('0x8c'),_0x5d8626);console[_0xb814('0x55')](_0xb814('0x5e'),_0x2d0651);console[_0xb814('0x55')](_0xb814('0x61'),_0x216d67);console[_0xb814('0x55')](_0xb814('0x69'),_0x9dc06b);if(_0x216d67!=0x0){var _0x5b8d2e=moment(_0x5d8626);var _0x5416dc=moment(_0x2d0651);var _0x2308fc=Math['abs'](_0x5b8d2e[_0xb814('0x8e')](_0x5416dc,_0xb814('0x8f')));console[_0xb814('0x55')](_0xb814('0x90'),_0x2308fc);var _0x405db7=_0x9dc06b/(0x1e*_0x216d67);console[_0xb814('0x55')](_0xb814('0x91'),_0x405db7);_0x40b3c5=_0x405db7*_0x2308fc;}console['log']('total',_0x40b3c5);return _0x40b3c5;}exports[_0xb814('0x92')]=function(_0x4f3125,_0x18678f,_0x21827c){var _0x1becf7;if(_0x4f3125['body']['id']){delete _0x4f3125[_0xb814('0x46')]['id'];}return db[_0xb814('0x4e')][_0xb814('0x4f')](function(_0x38c6da){return db[_0xb814('0x50')]['findOne']({'where':{'defaultEntry':0x1},'raw':!![]})[_0xb814('0x20')](function(_0x4fe23d){_0x1becf7=_0x4fe23d;return db['SAAsset'][_0xb814('0x3d')]({'where':{'dateNextInvoice':{'$lt':moment()},'subscriptionMonthly':{'$ne':0x0},'deleted':null},'order':[[_0xb814('0x51'),_0xb814('0x52')],['pricelistId',_0xb814('0x52')],[_0xb814('0x53'),'DESC']],'raw':!![]});})[_0xb814('0x20')](function(_0x171f83){console['log'](_0xb814('0x93'),_0x171f83);if(_0x171f83[_0xb814('0x2e')]>0x0){var _0x3f4cbf=[];var _0x2365f9=_[_0xb814('0x94')](_0x171f83,_0xb814('0x51'));Object[_0xb814('0x29')](_0x2365f9)[_0xb814('0x54')](function(_0xb115ba){var _0x1f8c7a=_0x2365f9[_0xb115ba];console[_0xb814('0x55')](_0xb814('0x56'),_0x1f8c7a);_0x3f4cbf['push'](addSubscriptionInvoice(_0x1f8c7a,_0x1becf7,_0xb115ba,'Total',_0x38c6da));});return BPromise[_0xb814('0x95')](_0x3f4cbf);}else{var _0x5b13c8={'errors':[{'type':'WARNING','message':_0xb814('0x96')}]};throw _0x5b13c8;}});})['then'](function(){return _0x18678f['sendStatus'](0xc8);})['catch'](function(_0x1044fa){console[_0xb814('0x55')](_0xb814('0x58'),_0x1044fa);if(_0x1044fa['name']===_0xb814('0x59')){var _0x1044fa={'errors':[{'message':_0xb814('0x5a')}]};}_0x18678f[_0xb814('0x1a')](0x1f4)['send'](_0x1044fa);});}; \ No newline at end of file +var _0x9957=['path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','destroy','then','stack','name','send','index','SAAsset','rawAttributes','keys','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','type','key','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','create','body','find','params','describe','getSubscriptions','sort','map','field','ppppp\x20\x20options','sequelize','transaction','CmCompany','findOne','companyId','DESC','pricelistId','subscriptionId','log','automaticSubscriptionInvoice\x20productForCompany->','push','Partial','all','TCL:\x20exports.automaticProformaInvoice\x20->\x20err','Duplicate\x20entry.','??????\x20updSubscriptionDetail\x20product->','??????\x20invoiceType','??????\x20updSubscriptionDetail\x20product.dateNextInvoice->','dateNextInvoice','add','subscriptionMonthly','nextInvoice','System','companyName','productName','productCode','productDescription','typeName','pricelistName','netPrice','discount','tax','note','subscriptionName','quantity','SAInvoiceDetail','SAPaymentMethod','saPaymentMethod','Invoice\x20','Automatic\x20Job','close','saStreet','saPostalCode','saCountry','saISOCode','saSDICode','saFiscalMessage','saExpiryDay','saEurope','saSocCap','saPIVA','bankAccount','bankName','bankpostalCode','bankcity','bankcountry','bankIBAN','phone','fax','email','bankABI','banckCAB','paypalEmail','groupBy','negate','isNull','createdAt','value','diff','days','dayPrice','total','££££££££\x20products','forEach','WARNING','No\x20product\x20to\x20assign\x20invoice.\x20Invoice\x20not\x20created!!\x20','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var hardwareService=require(_0x7995('0x15'));var logger=require(_0x7995('0x16'))('api');var utils=require(_0x7995('0x17'));var config=require(_0x7995('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb0c872,_0x2cb37a){_0x2cb37a=_0x2cb37a||0xcc;return function(_0x19a27e){if(_0x19a27e){return _0xb0c872[_0x7995('0x19')](_0x2cb37a);}return _0xb0c872[_0x7995('0x1a')](_0x2cb37a)[_0x7995('0x1b')]();};}function respondWithResult(_0x2bbe7a,_0x4cc004){_0x4cc004=_0x4cc004||0xc8;return function(_0x58f5ad){if(_0x58f5ad){return _0x2bbe7a[_0x7995('0x1a')](_0x4cc004)[_0x7995('0x1c')](_0x58f5ad);}};}function respondWithFilteredResult(_0x24b5bb,_0x321ae8){return function(_0x3f1d3e){if(_0x3f1d3e){var _0x1a5310=_0x3f1d3e[_0x7995('0x1d')],_0x2202ce=_0x321ae8['offset'],_0x41cbf0=_0x321ae8[_0x7995('0x1e')]+_0x321ae8[_0x7995('0x1f')],_0x5377e5;if(_0x41cbf0>=_0x1a5310){_0x41cbf0=_0x1a5310;_0x5377e5=0xc8;}else{_0x5377e5=0xce;}_0x24b5bb[_0x7995('0x1a')](_0x5377e5);return _0x24b5bb[_0x7995('0x20')](_0x7995('0x21'),_0x2202ce+'-'+_0x41cbf0+'/'+_0x1a5310)[_0x7995('0x1c')](_0x3f1d3e);}return null;};}function patchUpdates(_0x4faa60){return function(_0x54c9ae){try{jsonpatch[_0x7995('0x22')](_0x54c9ae,_0x4faa60,!![]);}catch(_0x5e6f90){return BPromise['reject'](_0x5e6f90);}return _0x54c9ae[_0x7995('0x23')]();};}function saveUpdates(_0x3d463e,_0x4cbe10){return function(_0x3a9b54){if(_0x3a9b54){return _0x3a9b54['update'](_0x3d463e)['then'](function(_0x3e4c54){return _0x3e4c54;});}return null;};}function removeEntity(_0x327b1f,_0x350fd9){return function(_0x1a8568){if(_0x1a8568){return _0x1a8568[_0x7995('0x24')]()[_0x7995('0x25')](function(){_0x327b1f['status'](0xcc)[_0x7995('0x1b')]();});}};}function handleEntityNotFound(_0x46ee4b,_0x204507){return function(_0x285437){if(!_0x285437){_0x46ee4b[_0x7995('0x19')](0x194);}return _0x285437;};}function handleError(_0x13bc35,_0x475351){_0x475351=_0x475351||0x1f4;return function(_0x472195){logger['error'](_0x472195[_0x7995('0x26')]);if(_0x472195[_0x7995('0x27')]){delete _0x472195[_0x7995('0x27')];}_0x13bc35[_0x7995('0x1a')](_0x475351)[_0x7995('0x28')](_0x472195);};}exports[_0x7995('0x29')]=function(_0x56691a,_0x47625f){var _0x5911c3={},_0x229742={},_0x49bc7e={'count':0x0,'rows':[]};var _0xf16cc2=db[_0x7995('0x2a')][_0x7995('0x2b')];_0x229742['model']=_[_0x7995('0x2c')](_0xf16cc2);_0x229742['query']=_[_0x7995('0x2c')](_0x56691a[_0x7995('0x2d')]);_0x229742[_0x7995('0x2e')]=_['intersection'](_0x229742['model'],_0x229742['query']);_0x5911c3[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x229742[_0x7995('0x31')],qs[_0x7995('0x32')](_0x56691a[_0x7995('0x2d')][_0x7995('0x32')]));_0x5911c3['attributes']=_0x5911c3['attributes'][_0x7995('0x33')]?_0x5911c3['attributes']:_0x229742[_0x7995('0x31')];if(!_0x56691a[_0x7995('0x2d')][_0x7995('0x34')](_0x7995('0x35'))){_0x5911c3[_0x7995('0x1f')]=qs['limit'](_0x56691a[_0x7995('0x2d')][_0x7995('0x1f')]);_0x5911c3['offset']=qs['offset'](_0x56691a['query'][_0x7995('0x1e')]);}_0x5911c3[_0x7995('0x36')]=qs['sort'](_0x56691a[_0x7995('0x2d')]['sort']);_0x5911c3[_0x7995('0x37')]=qs[_0x7995('0x2e')](_[_0x7995('0x38')](_0x56691a['query'],_0x229742['filters']));if(_0x56691a[_0x7995('0x2d')]['filter']){_0x5911c3['where']=_[_0x7995('0x39')](_0x5911c3[_0x7995('0x37')],{'$or':_['map'](_0xf16cc2,function(_0x1baa15){if(_0x1baa15[_0x7995('0x3a')][_0x7995('0x3b')]!==_0x7995('0x3c')){var _0x1e3dbf={};_0x1e3dbf[_0x1baa15['field']]={'$like':'%'+_0x56691a[_0x7995('0x2d')][_0x7995('0x3d')]+'%'};return _0x1e3dbf;}})});}_0x5911c3=_[_0x7995('0x39')]({},_0x5911c3,_0x56691a[_0x7995('0x3e')]);var _0x4b1541={'where':_0x5911c3[_0x7995('0x37')]};return db[_0x7995('0x2a')][_0x7995('0x1d')](_0x4b1541)[_0x7995('0x25')](function(_0x1f5bee){_0x49bc7e[_0x7995('0x1d')]=_0x1f5bee;if(_0x56691a['query'][_0x7995('0x3f')]){_0x5911c3[_0x7995('0x40')]=[{'all':!![]}];}return db[_0x7995('0x2a')][_0x7995('0x41')](_0x5911c3);})[_0x7995('0x25')](function(_0x298fc2){_0x49bc7e[_0x7995('0x42')]=_0x298fc2;return _0x49bc7e;})[_0x7995('0x25')](respondWithFilteredResult(_0x47625f,_0x5911c3))[_0x7995('0x43')](handleError(_0x47625f,null));};exports[_0x7995('0x44')]=function(_0x6fe77b,_0x270d52){var _0x7b4e67={'raw':![],'where':{'id':_0x6fe77b['params']['id']}},_0x53cda2={};_0x53cda2[_0x7995('0x31')]=_[_0x7995('0x2c')](db['SAAsset']['rawAttributes']);_0x53cda2[_0x7995('0x2d')]=_['keys'](_0x6fe77b['query']);_0x53cda2[_0x7995('0x2e')]=_[_0x7995('0x30')](_0x53cda2[_0x7995('0x31')],_0x53cda2['query']);_0x7b4e67[_0x7995('0x2f')]=_['intersection'](_0x53cda2[_0x7995('0x31')],qs['fields'](_0x6fe77b['query'][_0x7995('0x32')]));_0x7b4e67[_0x7995('0x2f')]=_0x7b4e67[_0x7995('0x2f')][_0x7995('0x33')]?_0x7b4e67['attributes']:_0x53cda2[_0x7995('0x31')];if(_0x6fe77b[_0x7995('0x2d')][_0x7995('0x3f')]){_0x7b4e67[_0x7995('0x40')]=[{'all':!![]}];}_0x7b4e67=_['merge']({},_0x7b4e67,_0x6fe77b['options']);return db[_0x7995('0x2a')]['find'](_0x7b4e67)[_0x7995('0x25')](handleEntityNotFound(_0x270d52,null))['then'](respondWithResult(_0x270d52,null))[_0x7995('0x43')](handleError(_0x270d52,null));};exports['create']=function(_0x1e795e,_0x1b0373){return db['SAAsset'][_0x7995('0x45')](_0x1e795e[_0x7995('0x46')],{})[_0x7995('0x25')](respondWithResult(_0x1b0373,0xc9))[_0x7995('0x43')](handleError(_0x1b0373,null));};exports['update']=function(_0x2458cb,_0x3e787d){if(_0x2458cb[_0x7995('0x46')]['id']){delete _0x2458cb['body']['id'];}return db[_0x7995('0x2a')][_0x7995('0x47')]({'where':{'id':_0x2458cb[_0x7995('0x48')]['id']}})[_0x7995('0x25')](handleEntityNotFound(_0x3e787d,null))[_0x7995('0x25')](saveUpdates(_0x2458cb['body'],null))[_0x7995('0x25')](respondWithResult(_0x3e787d,null))[_0x7995('0x43')](handleError(_0x3e787d,null));};exports['destroy']=function(_0x3d1dbb,_0x5843ba){return db[_0x7995('0x2a')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x48')]['id']}})[_0x7995('0x25')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x25')](removeEntity(_0x5843ba,null))[_0x7995('0x43')](handleError(_0x5843ba,null));};exports[_0x7995('0x49')]=function(_0x4d46bc,_0x427dcf){return db[_0x7995('0x2a')][_0x7995('0x49')]()['then'](respondWithResult(_0x427dcf,null))[_0x7995('0x43')](handleError(_0x427dcf,null));};exports[_0x7995('0x4a')]=function(_0x12d4b8,_0x47d1d8){var _0x4ec548={},_0x5a592e={},_0xb70620={'count':0x0,'rows':[]};var _0x1fd1ca=db['SAAsset'][_0x7995('0x2b')];_0x5a592e[_0x7995('0x31')]=_[_0x7995('0x2c')](_0x1fd1ca);_0x5a592e[_0x7995('0x2d')]=_[_0x7995('0x2c')](_0x12d4b8['query']);_0x5a592e[_0x7995('0x2e')]=_['intersection'](_0x5a592e[_0x7995('0x31')],_0x5a592e[_0x7995('0x2d')]);_0x4ec548[_0x7995('0x2f')]=_['intersection'](_0x5a592e['model'],qs['fields'](_0x12d4b8['query'][_0x7995('0x32')]));_0x4ec548[_0x7995('0x2f')]=_0x4ec548[_0x7995('0x2f')][_0x7995('0x33')]?_0x4ec548[_0x7995('0x2f')]:_0x5a592e[_0x7995('0x31')];if(!_0x12d4b8[_0x7995('0x2d')][_0x7995('0x34')](_0x7995('0x35'))){_0x4ec548[_0x7995('0x1f')]=qs[_0x7995('0x1f')](_0x12d4b8[_0x7995('0x2d')][_0x7995('0x1f')]);_0x4ec548[_0x7995('0x1e')]=qs[_0x7995('0x1e')](_0x12d4b8[_0x7995('0x2d')][_0x7995('0x1e')]);}_0x4ec548[_0x7995('0x36')]=qs[_0x7995('0x4b')](_0x12d4b8['query'][_0x7995('0x4b')]);_0x4ec548[_0x7995('0x37')]=qs[_0x7995('0x2e')](_[_0x7995('0x38')](_0x12d4b8['query'],_0x5a592e['filters']));if(_0x12d4b8[_0x7995('0x2d')][_0x7995('0x3d')]){_0x4ec548[_0x7995('0x37')]=_[_0x7995('0x39')](_0x4ec548['where'],{'$or':_[_0x7995('0x4c')](_0x1fd1ca,function(_0x74ff38){if(_0x74ff38[_0x7995('0x3a')][_0x7995('0x3b')]!=='VIRTUAL'){var _0x5e2d97={};_0x5e2d97[_0x74ff38[_0x7995('0x4d')]]={'$like':'%'+_0x12d4b8[_0x7995('0x2d')][_0x7995('0x3d')]+'%'};return _0x5e2d97;}})});}_0x4ec548=_[_0x7995('0x39')]({},_0x4ec548,_0x12d4b8[_0x7995('0x3e')]);var _0x27c5cd={'where':_0x4ec548[_0x7995('0x37')]};return db[_0x7995('0x2a')][_0x7995('0x1d')](_0x27c5cd)['then'](function(_0x18f230){_0xb70620[_0x7995('0x1d')]=_0x18f230;if(_0x12d4b8[_0x7995('0x2d')][_0x7995('0x3f')]){_0x4ec548['include']=[{'all':!![]}];}console['log'](_0x7995('0x4e'),_0x4ec548);return db[_0x7995('0x2a')]['findAll'](_0x4ec548);})[_0x7995('0x25')](function(_0x375fc9){_0xb70620[_0x7995('0x42')]=_0x375fc9;return _0xb70620;})[_0x7995('0x25')](respondWithFilteredResult(_0x47d1d8,_0x4ec548))[_0x7995('0x43')](handleError(_0x47d1d8,null));};exports['automaticSubscriptionInvoiceAlignment']=function(_0x457d09,_0x564fca,_0x3e0a46){var _0xe31dcb;if(_0x457d09[_0x7995('0x46')]['id']){delete _0x457d09[_0x7995('0x46')]['id'];}return db[_0x7995('0x4f')][_0x7995('0x50')](function(_0x2b3c1d){return db[_0x7995('0x51')][_0x7995('0x52')]({'where':{'defaultEntry':0x1},'raw':!![],'logging':!![]})[_0x7995('0x25')](function(_0x2618c4){_0xe31dcb=_0x2618c4;return db[_0x7995('0x2a')]['findAll']({'where':{'dateLastInvoice':null,'deleted':null,'status':null},'order':[[_0x7995('0x53'),_0x7995('0x54')],[_0x7995('0x55'),_0x7995('0x54')],[_0x7995('0x56'),'DESC']],'raw':!![],'logging':!![]});})['then'](function(_0x268fde){if(_0x268fde[_0x7995('0x33')]>0x0){var _0x221542=[];var _0xae6166=_['groupBy'](_0x268fde,_0x7995('0x53'));Object['keys'](_0xae6166)['forEach'](function(_0xca8238){var _0x36d27d=_0xae6166[_0xca8238];console[_0x7995('0x57')](_0x7995('0x58'),_0x36d27d);_0x221542[_0x7995('0x59')](addSubscriptionInvoice(_0x36d27d,_0xe31dcb,_0xca8238,_0x7995('0x5a'),_0x2b3c1d));});return BPromise[_0x7995('0x5b')](_0x221542);}});})[_0x7995('0x25')](function(){return _0x564fca[_0x7995('0x19')](0xc8);})[_0x7995('0x43')](function(_0x560b0a){console[_0x7995('0x57')](_0x7995('0x5c'),_0x560b0a);if(_0x560b0a[_0x7995('0x27')]==='SequelizeUniqueConstraintError'){var _0x560b0a={'errors':[{'message':_0x7995('0x5d')}]};}_0x564fca[_0x7995('0x1a')](0x1f4)[_0x7995('0x28')](_0x560b0a);});};function updSubscriptionDetail(_0x3b0d30,_0x51ab1e,_0x550a10){console[_0x7995('0x57')](_0x7995('0x5e'),_0x3b0d30);console[_0x7995('0x57')](_0x7995('0x5f'),_0x51ab1e);console['log']('??????\x20updSubscriptionDetail\x20product.id->',_0x3b0d30['id']);console[_0x7995('0x57')](_0x7995('0x60'),_0x3b0d30[_0x7995('0x61')]);var _0x35aaec;var _0x4dbab8;if(_0x51ab1e===_0x7995('0x5a')){_0x35aaec=moment();_0x4dbab8=_0x3b0d30[_0x7995('0x61')];}else{_0x35aaec=_0x3b0d30['dateNextInvoice'];_0x4dbab8=moment(_0x3b0d30['dateNextInvoice'])[_0x7995('0x62')](_0x3b0d30[_0x7995('0x63')],'months');}console[_0x7995('0x57')]('lastInvoice',_0x35aaec);console[_0x7995('0x57')](_0x7995('0x64'),_0x4dbab8);return db['SAAsset']['update']({'dateLastInvoice':_0x35aaec,'dateNextInvoice':_0x4dbab8,'agentFullname':_0x7995('0x65')},{'where':{'id':_0x3b0d30['id']},'raw':!![],'transaction':_0x550a10})['catch'](function(_0x31b9e6){throw _0x31b9e6;});}function addSubscriptionInvoiceDetail(_0xa41fff,_0x3dd197,_0x45bd8a){var _0x1a1873={'companyName':_0xa41fff[_0x7995('0x66')],'companyId':_0xa41fff[_0x7995('0x53')],'productName':_0xa41fff[_0x7995('0x67')],'productCode':_0xa41fff[_0x7995('0x68')],'productDescription':_0xa41fff[_0x7995('0x69')],'typeName':_0xa41fff[_0x7995('0x6a')],'pricelistName':_0xa41fff[_0x7995('0x6b')],'priceListId':_0xa41fff[_0x7995('0x55')],'netPrice':_0xa41fff[_0x7995('0x6c')],'discount':_0xa41fff[_0x7995('0x6d')],'tax':_0xa41fff[_0x7995('0x6e')],'agentFullname':_0x7995('0x65'),'note':_0xa41fff[_0x7995('0x6f')],'subscriptionId':_0xa41fff[_0x7995('0x56')],'subscriptionName':_0xa41fff[_0x7995('0x70')],'subscriptionMonthly':_0xa41fff[_0x7995('0x63')],'quantity':_0xa41fff[_0x7995('0x71')],'InvoiceId':_0x3dd197['id']};return db[_0x7995('0x72')][_0x7995('0x45')](_0x1a1873,{'raw':!![],'transaction':_0x45bd8a})[_0x7995('0x43')](function(_0x33479a){throw _0x33479a;});}function addSubscriptionInvoice(_0x2f7f51,_0x34724d,_0x59efff,_0x3fdb4b,_0x10f4ca){return db['CmCompany']['findOne']({'where':{'id':_0x59efff},'raw':!![]})[_0x7995('0x25')](function(_0x3fe8fc){return db[_0x7995('0x73')][_0x7995('0x52')]({'where':{'id':_0x3fe8fc[_0x7995('0x74')]},'raw':!![]})[_0x7995('0x25')](function(_0x5507a0){var _0x2f8a2d={'name':_0x7995('0x75')+moment()+'_'+_0x3fdb4b,'note':_0x7995('0x76'),'agentFullname':_0x7995('0x65'),'status':_0x7995('0x77'),'companyName':_0x3fe8fc[_0x7995('0x27')],'companyId':_0x3fe8fc['id'],'paid':0x0,'discount':0x0,'receivingStreet':_0x3fe8fc[_0x7995('0x78')],'receivingPostalCode':_0x3fe8fc[_0x7995('0x79')],'receivingCity':_0x3fe8fc['saCity'],'receivingCountry':_0x3fe8fc[_0x7995('0x7a')],'receivingISOCode':_0x3fe8fc[_0x7995('0x7b')],'receivingFiscalCode':_0x3fe8fc['saFiscalCode'],'receivingPIVA':_0x3fe8fc['saPIVA'],'receivingSDICode':_0x3fe8fc[_0x7995('0x7c')],'receivingFiscalMessage':_0x3fe8fc[_0x7995('0x7d')],'receivingExpiryDay':_0x3fe8fc[_0x7995('0x7e')],'receivingEurope':_0x3fe8fc[_0x7995('0x7f')],'receivingSocCap':_0x3fe8fc[_0x7995('0x80')],'issuerName':_0x34724d['name'],'issuerStreet':_0x34724d[_0x7995('0x78')],'issuerPostalCode':_0x34724d[_0x7995('0x79')],'issuerCity':_0x34724d['saCity'],'issuerCountry':_0x34724d[_0x7995('0x7a')],'issuerISOCode':_0x34724d[_0x7995('0x7b')],'issuerFiscalCode':_0x34724d['saFiscalCode'],'issuerPIVA':_0x34724d[_0x7995('0x81')],'issuerSDICode':_0x34724d['saSDICode'],'issuerFiscalMessage':_0x34724d[_0x7995('0x7d')],'issuerExpiryDay':_0x34724d[_0x7995('0x7e')],'issuerSocCap':_0x34724d[_0x7995('0x80')],'issuerBankAccount':_0x5507a0[_0x7995('0x82')],'issuerBankName':_0x5507a0[_0x7995('0x83')],'issuerBankStreet':_0x5507a0['bankstreet'],'issuerBankPostalCode':_0x5507a0[_0x7995('0x84')],'issuerBankCity':_0x5507a0[_0x7995('0x85')],'issuerBankCountry':_0x5507a0[_0x7995('0x86')],'issuerBankBICSWIFT':_0x5507a0['bankBICSWIFT'],'issuerBankIBAN':_0x5507a0[_0x7995('0x87')],'issuerPhone':_0x34724d[_0x7995('0x88')],'issuerFax':_0x34724d[_0x7995('0x89')],'issuerEmail':_0x34724d[_0x7995('0x8a')],'issuerWeb':_0x34724d['website'],'issuerABI':_0x5507a0[_0x7995('0x8b')],'issuerCAB':_0x5507a0[_0x7995('0x8c')],'issuerPayPal':_0x5507a0[_0x7995('0x8d')]};return db['SAInvoice']['create'](_0x2f8a2d,{'transaction':_0x10f4ca})[_0x7995('0x25')](function(_0x333379){var _0x4800a8=[];for(var _0x590373=0x0;_0x590373<_0x2f7f51[_0x7995('0x33')];_0x590373++){_0x4800a8[_0x7995('0x59')](updSubscriptionDetail(_0x2f7f51[_0x590373],_0x3fdb4b,_0x10f4ca));}var _0xcdbd2a=[_0x7995('0x68'),_0x7995('0x55'),'subscriptionId','netPrice'];_(_0x2f7f51)[_0x7995('0x8e')](function(_0x54fad4){return _['find'](_[_0x7995('0x38')](_0x54fad4,_0xcdbd2a),_[_0x7995('0x8f')](_[_0x7995('0x90')]));})['mapValues'](function(_0x3b1309){var _0x3cb1d2=_0x3b1309[0x0];_0x3cb1d2[_0x7995('0x71')]=_0x3b1309[_0x7995('0x33')];if(_0x3fdb4b===_0x7995('0x5a')){_0x3cb1d2['netPrice']=computePrice(_0x3cb1d2[_0x7995('0x91')],_0x3cb1d2[_0x7995('0x61')],_0x3cb1d2[_0x7995('0x6c')],_0x3cb1d2[_0x7995('0x63')]);}_0x4800a8['push'](addSubscriptionInvoiceDetail(_0x3cb1d2,_0x333379,_0x10f4ca));})[_0x7995('0x92')]();return BPromise[_0x7995('0x5b')](_0x4800a8);});});})['catch'](function(_0x310272){console[_0x7995('0x57')]('TCL:\x20exports.automaticProformaInvoice\x20->\x20err',_0x310272);throw _0x310272;});}function computePrice(_0x135f7a,_0x50efab,_0x1b4b34,_0x51e7d7){var _0x21f496=_0x1b4b34;console['log'](_0x7995('0x91'),_0x135f7a);console[_0x7995('0x57')]('dateNextInvoice',_0x50efab);console[_0x7995('0x57')]('subscriptionMonthly',_0x51e7d7);console['log'](_0x7995('0x6c'),_0x1b4b34);if(_0x51e7d7!=0x0){var _0x14812d=moment(_0x135f7a);var _0x784492=moment(_0x50efab);var _0xb7c078=Math['abs'](_0x14812d[_0x7995('0x93')](_0x784492,_0x7995('0x94')));console['log']('diffDay',_0xb7c078);var _0xc2648d=_0x1b4b34/(0x1e*_0x51e7d7);console['log'](_0x7995('0x95'),_0xc2648d);_0x21f496=_0xc2648d*_0xb7c078;}console[_0x7995('0x57')](_0x7995('0x96'),_0x21f496);return _0x21f496;}exports['automaticSubscriptionInvoice']=function(_0x48cfb7,_0x2b7852,_0x553c71){var _0x12e9d9;if(_0x48cfb7[_0x7995('0x46')]['id']){delete _0x48cfb7[_0x7995('0x46')]['id'];}return db[_0x7995('0x4f')]['transaction'](function(_0x52d102){return db['CmCompany'][_0x7995('0x52')]({'where':{'defaultEntry':0x1},'raw':!![]})[_0x7995('0x25')](function(_0x23b4c3){_0x12e9d9=_0x23b4c3;return db[_0x7995('0x2a')][_0x7995('0x41')]({'where':{'dateNextInvoice':{'$lt':moment()},'subscriptionMonthly':{'$ne':0x0},'deleted':null},'order':[[_0x7995('0x53'),'DESC'],['pricelistId',_0x7995('0x54')],['subscriptionId','DESC']],'raw':!![]});})[_0x7995('0x25')](function(_0x5e95c0){console['log'](_0x7995('0x97'),_0x5e95c0);if(_0x5e95c0[_0x7995('0x33')]>0x0){var _0x3873f3=[];var _0x5cef2e=_[_0x7995('0x8e')](_0x5e95c0,_0x7995('0x53'));Object[_0x7995('0x2c')](_0x5cef2e)[_0x7995('0x98')](function(_0x227372){var _0x178746=_0x5cef2e[_0x227372];console[_0x7995('0x57')](_0x7995('0x58'),_0x178746);_0x3873f3[_0x7995('0x59')](addSubscriptionInvoice(_0x178746,_0x12e9d9,_0x227372,'Total',_0x52d102));});return BPromise[_0x7995('0x5b')](_0x3873f3);}else{var _0x87a539={'errors':[{'type':_0x7995('0x99'),'message':_0x7995('0x9a')}]};throw _0x87a539;}});})[_0x7995('0x25')](function(){return _0x2b7852['sendStatus'](0xc8);})[_0x7995('0x43')](function(_0x9c67e5){console[_0x7995('0x57')]('TCL:\x20exports.automaticProformaInvoice\x20->\x20err',_0x9c67e5);if(_0x9c67e5['name']==='SequelizeUniqueConstraintError'){var _0x9c67e5={'errors':[{'message':_0x7995('0x5d')}]};}_0x2b7852[_0x7995('0x1a')](0x1f4)[_0x7995('0x28')](_0x9c67e5);});}; \ No newline at end of file diff --git a/server/api/saAsset/saAsset.model.js b/server/api/saAsset/saAsset.model.js index e25c7a1..1806324 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 _0x2839=['api','moment','bluebird','request-promise','path','../../config/environment','./saAsset.attributes','exports','define','sa_assets','lodash','util','../../config/logger'];(function(_0x3f807d,_0x32a3b1){var _0x45ad62=function(_0x32b5d9){while(--_0x32b5d9){_0x3f807d['push'](_0x3f807d['shift']());}};_0x45ad62(++_0x32a3b1);}(_0x2839,0x8c));var _0x9283=function(_0x467d71,_0x2d792e){_0x467d71=_0x467d71-0x0;var _0x31846c=_0x2839[_0x467d71];return _0x31846c;};'use strict';var _=require(_0x9283('0x0'));var util=require(_0x9283('0x1'));var logger=require(_0x9283('0x2'))(_0x9283('0x3'));var moment=require(_0x9283('0x4'));var BPromise=require(_0x9283('0x5'));var rp=require(_0x9283('0x6'));var fs=require('fs');var path=require(_0x9283('0x7'));var rimraf=require('rimraf');var config=require(_0x9283('0x8'));var attributes=require(_0x9283('0x9'));module[_0x9283('0xa')]=function(_0x475d9a,_0x2736c3){return _0x475d9a[_0x9283('0xb')]('SAAsset',attributes,{'tableName':_0x9283('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1fd9=['request-promise','rimraf','../../config/environment','./saAsset.attributes','exports','define','SAAsset','util','../../config/logger','api','moment','bluebird'];(function(_0xf8ca19,_0x3d707a){var _0x19a928=function(_0x26ee84){while(--_0x26ee84){_0xf8ca19['push'](_0xf8ca19['shift']());}};_0x19a928(++_0x3d707a);}(_0x1fd9,0x1db));var _0x91fd=function(_0x38259f,_0x52e296){_0x38259f=_0x38259f-0x0;var _0x206a0e=_0x1fd9[_0x38259f];return _0x206a0e;};'use strict';var _=require('lodash');var util=require(_0x91fd('0x0'));var logger=require(_0x91fd('0x1'))(_0x91fd('0x2'));var moment=require(_0x91fd('0x3'));var BPromise=require(_0x91fd('0x4'));var rp=require(_0x91fd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x91fd('0x6'));var config=require(_0x91fd('0x7'));var attributes=require(_0x91fd('0x8'));module[_0x91fd('0x9')]=function(_0x1c1823,_0x3d53ed){return _0x1c1823[_0x91fd('0xa')](_0x91fd('0xb'),attributes,{'tableName':'sa_assets','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 a31fd12..ab71962 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 _0x6951=['request','then','info','request\x20sent','debug','SAAsset,\x20%s,\x20%s,\x20%s','stringify','error','SAAsset,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2e2051,_0x26b49e){var _0x199c53=function(_0xdd97cc){while(--_0xdd97cc){_0x2e2051['push'](_0x2e2051['shift']());}};_0x199c53(++_0x26b49e);}(_0x6951,0x67));var _0x1695=function(_0x3c05e9,_0x2a84ee){_0x3c05e9=_0x3c05e9-0x0;var _0x386bcd=_0x6951[_0x3c05e9];return _0x386bcd;};'use strict';var _=require(_0x1695('0x0'));var util=require(_0x1695('0x1'));var moment=require(_0x1695('0x2'));var BPromise=require('bluebird');var rs=require(_0x1695('0x3'));var fs=require('fs');var Redis=require(_0x1695('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1695('0x5'));var logger=require(_0x1695('0x6'))(_0x1695('0x7'));var config=require(_0x1695('0x8'));var jayson=require(_0x1695('0x9'));var client=jayson[_0x1695('0xa')][_0x1695('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x36ac55,_0x26f006,_0x50ec21){return new BPromise(function(_0x380f2f,_0x487f63){return client[_0x1695('0xc')](_0x36ac55,_0x50ec21)[_0x1695('0xd')](function(_0x339ac0){logger[_0x1695('0xe')]('SAAsset,\x20%s,\x20%s',_0x26f006,_0x1695('0xf'));logger[_0x1695('0x10')](_0x1695('0x11'),_0x26f006,_0x1695('0xf'),JSON[_0x1695('0x12')](_0x339ac0));if(_0x339ac0[_0x1695('0x13')]){if(_0x339ac0['error']['code']===0x1f4){logger[_0x1695('0x13')](_0x1695('0x14'),_0x26f006,_0x339ac0[_0x1695('0x13')]['message']);return _0x487f63(_0x339ac0['error'][_0x1695('0x15')]);}logger[_0x1695('0x13')](_0x1695('0x14'),_0x26f006,_0x339ac0[_0x1695('0x13')][_0x1695('0x15')]);return _0x380f2f(_0x339ac0[_0x1695('0x13')][_0x1695('0x15')]);}else{logger[_0x1695('0xe')](_0x1695('0x14'),_0x26f006,_0x1695('0xf'));_0x380f2f(_0x339ac0[_0x1695('0x16')][_0x1695('0x15')]);}})['catch'](function(_0xba6df0){logger['error'](_0x1695('0x14'),_0x26f006,_0xba6df0);_0x487f63(_0xba6df0);});});} \ No newline at end of file +var _0xa0cd=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','SAAsset,\x20%s,\x20%s,\x20%s','stringify','error','code','SAAsset,\x20%s,\x20%s','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x323f5a,_0x31b0b8){var _0xc1d95=function(_0x9c392){while(--_0x9c392){_0x323f5a['push'](_0x323f5a['shift']());}};_0xc1d95(++_0x31b0b8);}(_0xa0cd,0x6c));var _0xda0c=function(_0x3968c8,_0x4f3085){_0x3968c8=_0x3968c8-0x0;var _0x3536d2=_0xa0cd[_0x3968c8];return _0x3536d2;};'use strict';var _=require(_0xda0c('0x0'));var util=require(_0xda0c('0x1'));var moment=require('moment');var BPromise=require(_0xda0c('0x2'));var rs=require(_0xda0c('0x3'));var fs=require('fs');var Redis=require(_0xda0c('0x4'));var db=require(_0xda0c('0x5'))['db'];var utils=require(_0xda0c('0x6'));var logger=require(_0xda0c('0x7'))(_0xda0c('0x8'));var config=require(_0xda0c('0x9'));var jayson=require(_0xda0c('0xa'));var client=jayson[_0xda0c('0xb')][_0xda0c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x116261,_0x2059ba,_0x1a1e05){return new BPromise(function(_0x195d8e,_0x5cba83){return client[_0xda0c('0xd')](_0x116261,_0x1a1e05)[_0xda0c('0xe')](function(_0x138d26){logger[_0xda0c('0xf')]('SAAsset,\x20%s,\x20%s',_0x2059ba,_0xda0c('0x10'));logger['debug'](_0xda0c('0x11'),_0x2059ba,_0xda0c('0x10'),JSON[_0xda0c('0x12')](_0x138d26));if(_0x138d26[_0xda0c('0x13')]){if(_0x138d26['error'][_0xda0c('0x14')]===0x1f4){logger[_0xda0c('0x13')](_0xda0c('0x15'),_0x2059ba,_0x138d26[_0xda0c('0x13')][_0xda0c('0x16')]);return _0x5cba83(_0x138d26[_0xda0c('0x13')][_0xda0c('0x16')]);}logger[_0xda0c('0x13')](_0xda0c('0x15'),_0x2059ba,_0x138d26[_0xda0c('0x13')][_0xda0c('0x16')]);return _0x195d8e(_0x138d26[_0xda0c('0x13')][_0xda0c('0x16')]);}else{logger[_0xda0c('0xf')](_0xda0c('0x15'),_0x2059ba,_0xda0c('0x10'));_0x195d8e(_0x138d26['result']['message']);}})['catch'](function(_0x24840f){logger[_0xda0c('0x13')](_0xda0c('0x15'),_0x2059ba,_0x24840f);_0x5cba83(_0x24840f);});});} \ No newline at end of file diff --git a/server/api/saCompanyRelationship/index.js b/server/api/saCompanyRelationship/index.js index e92bae5..6f9f43a 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 _0xc5bc=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./saCompanyRelationship.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','util'];(function(_0x14b4dc,_0x1d0ca8){var _0x3030e9=function(_0x32998b){while(--_0x32998b){_0x14b4dc['push'](_0x14b4dc['shift']());}};_0x3030e9(++_0x1d0ca8);}(_0xc5bc,0xfa));var _0xcc5b=function(_0x24d3bb,_0x462ffc){_0x24d3bb=_0x24d3bb-0x0;var _0x393e4d=_0xc5bc[_0x24d3bb];return _0x393e4d;};'use strict';var multer=require(_0xcc5b('0x0'));var util=require(_0xcc5b('0x1'));var path=require(_0xcc5b('0x2'));var timeout=require(_0xcc5b('0x3'));var express=require(_0xcc5b('0x4'));var router=express[_0xcc5b('0x5')]();var auth=require(_0xcc5b('0x6'));var interaction=require(_0xcc5b('0x7'));var config=require(_0xcc5b('0x8'));var controller=require(_0xcc5b('0x9'));router[_0xcc5b('0xa')]('/',auth[_0xcc5b('0xb')](),controller[_0xcc5b('0xc')]);router[_0xcc5b('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xcc5b('0xa')](_0xcc5b('0xd'),auth['isAuthenticated'](),controller[_0xcc5b('0xe')]);router['post']('/',auth[_0xcc5b('0xb')](),controller[_0xcc5b('0xf')]);router[_0xcc5b('0x10')](_0xcc5b('0xd'),auth[_0xcc5b('0xb')](),controller[_0xcc5b('0x11')]);router[_0xcc5b('0x12')](_0xcc5b('0xd'),auth[_0xcc5b('0xb')](),controller[_0xcc5b('0x13')]);module[_0xcc5b('0x14')]=router; \ No newline at end of file +var _0xf401=['post','destroy','exports','util','path','Router','../../components/auth/service','../../config/environment','./saCompanyRelationship.controller','get','isAuthenticated','index','/:id','show'];(function(_0x11e60d,_0x153494){var _0x49bc6d=function(_0x169c3c){while(--_0x169c3c){_0x11e60d['push'](_0x11e60d['shift']());}};_0x49bc6d(++_0x153494);}(_0xf401,0xe3));var _0x1f40=function(_0x32456d,_0x203e42){_0x32456d=_0x32456d-0x0;var _0x58cfa0=_0xf401[_0x32456d];return _0x58cfa0;};'use strict';var multer=require('multer');var util=require(_0x1f40('0x0'));var path=require(_0x1f40('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1f40('0x2')]();var auth=require(_0x1f40('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x1f40('0x4'));var controller=require(_0x1f40('0x5'));router[_0x1f40('0x6')]('/',auth[_0x1f40('0x7')](),controller[_0x1f40('0x8')]);router[_0x1f40('0x6')]('/describe',auth[_0x1f40('0x7')](),controller['describe']);router[_0x1f40('0x6')](_0x1f40('0x9'),auth[_0x1f40('0x7')](),controller[_0x1f40('0xa')]);router[_0x1f40('0xb')]('/',auth[_0x1f40('0x7')](),controller['create']);router['put'](_0x1f40('0x9'),auth[_0x1f40('0x7')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x1f40('0xc')]);module[_0x1f40('0xd')]=router; \ No newline at end of file diff --git a/server/api/saCompanyRelationship/saCompanyRelationship.attributes.js b/server/api/saCompanyRelationship/saCompanyRelationship.attributes.js index ce3ac05..e24d193 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 _0xf7c4=['sequelize','STRING','name'];(function(_0x4eabfe,_0x2d79a1){var _0x1a7110=function(_0x34c96f){while(--_0x34c96f){_0x4eabfe['push'](_0x4eabfe['shift']());}};_0x1a7110(++_0x2d79a1);}(_0xf7c4,0xba));var _0x4f7c=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0xf7c4[_0x334841];return _0x5beb4b;};'use strict';var Sequelize=require(_0x4f7c('0x0'));module['exports']={'name':{'type':Sequelize[_0x4f7c('0x1')],'allowNull':![],'unique':_0x4f7c('0x2')}}; \ No newline at end of file +var _0x76eb=['name','sequelize','STRING'];(function(_0x145d01,_0x11e827){var _0x54efe4=function(_0x116183){while(--_0x116183){_0x145d01['push'](_0x145d01['shift']());}};_0x54efe4(++_0x11e827);}(_0x76eb,0x1e1));var _0xb76e=function(_0x3c60ae,_0x4fbf8e){_0x3c60ae=_0x3c60ae-0x0;var _0xdaf38d=_0x76eb[_0x3c60ae];return _0xdaf38d;};'use strict';var Sequelize=require(_0xb76e('0x0'));module['exports']={'name':{'type':Sequelize[_0xb76e('0x1')],'allowNull':![],'unique':_0xb76e('0x2')}}; \ No newline at end of file diff --git a/server/api/saCompanyRelationship/saCompanyRelationship.controller.js b/server/api/saCompanyRelationship/saCompanyRelationship.controller.js index 678d753..6e8d32d 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 _0xc607=['show','params','catch','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','sendStatus','status','end','count','offset','limit','Content-Range','json','reject','save','update','then','destroy','error','name','SACompanyRelationship','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','rows'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xc607,0x1d5));var _0x7c60=function(_0x30905a,_0x2f5a20){_0x30905a=_0x30905a-0x0;var _0x3da86b=_0xc607[_0x30905a];return _0x3da86b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7c60('0x0'));var rimraf=require(_0x7c60('0x1'));var zipdir=require(_0x7c60('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7c60('0x3'));var moment=require(_0x7c60('0x4'));var BPromise=require(_0x7c60('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7c60('0x6'));var sox=require(_0x7c60('0x7'));var csv=require(_0x7c60('0x8'));var ejs=require(_0x7c60('0x9'));var fs=require('fs');var _=require(_0x7c60('0xa'));var squel=require('squel');var crypto=require(_0x7c60('0xb'));var jsforce=require(_0x7c60('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7c60('0x8'));var querystring=require(_0x7c60('0xd'));var Papa=require('papaparse');var Redis=require(_0x7c60('0xe'));var authService=require(_0x7c60('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x7c60('0x10'));var logger=require('../../config/logger')(_0x7c60('0x11'));var utils=require('../../config/utils');var config=require(_0x7c60('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf4a0cf,_0x2428f7){_0x2428f7=_0x2428f7||0xcc;return function(_0x4b06d9){if(_0x4b06d9){return _0xf4a0cf[_0x7c60('0x13')](_0x2428f7);}return _0xf4a0cf[_0x7c60('0x14')](_0x2428f7)[_0x7c60('0x15')]();};}function respondWithResult(_0x2fbe20,_0x2bd808){_0x2bd808=_0x2bd808||0xc8;return function(_0x584035){if(_0x584035){return _0x2fbe20[_0x7c60('0x14')](_0x2bd808)['json'](_0x584035);}};}function respondWithFilteredResult(_0x23e8ac,_0x427ede){return function(_0x49d34f){if(_0x49d34f){var _0x1202a0=_0x49d34f[_0x7c60('0x16')],_0x1eec79=_0x427ede[_0x7c60('0x17')],_0x23fd59=_0x427ede[_0x7c60('0x17')]+_0x427ede[_0x7c60('0x18')],_0x1cad4e;if(_0x23fd59>=_0x1202a0){_0x23fd59=_0x1202a0;_0x1cad4e=0xc8;}else{_0x1cad4e=0xce;}_0x23e8ac[_0x7c60('0x14')](_0x1cad4e);return _0x23e8ac['set'](_0x7c60('0x19'),_0x1eec79+'-'+_0x23fd59+'/'+_0x1202a0)[_0x7c60('0x1a')](_0x49d34f);}return null;};}function patchUpdates(_0x2c3040){return function(_0x445eb3){try{jsonpatch['apply'](_0x445eb3,_0x2c3040,!![]);}catch(_0x325771){return BPromise[_0x7c60('0x1b')](_0x325771);}return _0x445eb3[_0x7c60('0x1c')]();};}function saveUpdates(_0x2e326f,_0x343331){return function(_0x4a1836){if(_0x4a1836){return _0x4a1836[_0x7c60('0x1d')](_0x2e326f)[_0x7c60('0x1e')](function(_0x221eaf){return _0x221eaf;});}return null;};}function removeEntity(_0x69ae2c,_0x2a837d){return function(_0x12c5f1){if(_0x12c5f1){return _0x12c5f1[_0x7c60('0x1f')]()['then'](function(){_0x69ae2c[_0x7c60('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a5658,_0x545af2){return function(_0x48ca70){if(!_0x48ca70){_0x5a5658[_0x7c60('0x13')](0x194);}return _0x48ca70;};}function handleError(_0xbc4906,_0x57d57c){_0x57d57c=_0x57d57c||0x1f4;return function(_0x1e9b5a){logger[_0x7c60('0x20')](_0x1e9b5a['stack']);if(_0x1e9b5a[_0x7c60('0x21')]){delete _0x1e9b5a[_0x7c60('0x21')];}_0xbc4906[_0x7c60('0x14')](_0x57d57c)['send'](_0x1e9b5a);};}exports['index']=function(_0x36bdba,_0x554d48){var _0x40087b={},_0xf78d11={},_0x1a8b54={'count':0x0,'rows':[]};var _0x148218=db[_0x7c60('0x22')]['rawAttributes'];_0xf78d11[_0x7c60('0x23')]=_['keys'](_0x148218);_0xf78d11[_0x7c60('0x24')]=_[_0x7c60('0x25')](_0x36bdba[_0x7c60('0x24')]);_0xf78d11['filters']=_[_0x7c60('0x26')](_0xf78d11[_0x7c60('0x23')],_0xf78d11['query']);_0x40087b['attributes']=_[_0x7c60('0x26')](_0xf78d11['model'],qs[_0x7c60('0x27')](_0x36bdba['query'][_0x7c60('0x27')]));_0x40087b[_0x7c60('0x28')]=_0x40087b['attributes'][_0x7c60('0x29')]?_0x40087b[_0x7c60('0x28')]:_0xf78d11['model'];if(!_0x36bdba[_0x7c60('0x24')][_0x7c60('0x2a')](_0x7c60('0x2b'))){_0x40087b[_0x7c60('0x18')]=qs[_0x7c60('0x18')](_0x36bdba['query'][_0x7c60('0x18')]);_0x40087b[_0x7c60('0x17')]=qs['offset'](_0x36bdba[_0x7c60('0x24')][_0x7c60('0x17')]);}_0x40087b[_0x7c60('0x2c')]=qs[_0x7c60('0x2d')](_0x36bdba[_0x7c60('0x24')][_0x7c60('0x2d')]);_0x40087b[_0x7c60('0x2e')]=qs[_0x7c60('0x2f')](_['pick'](_0x36bdba[_0x7c60('0x24')],_0xf78d11[_0x7c60('0x2f')]));if(_0x36bdba['query'][_0x7c60('0x30')]){_0x40087b['where']=_[_0x7c60('0x31')](_0x40087b[_0x7c60('0x2e')],{'$or':_[_0x7c60('0x32')](_0x148218,function(_0x3e0402){if(_0x3e0402[_0x7c60('0x33')][_0x7c60('0x34')]!==_0x7c60('0x35')){var _0x11235e={};_0x11235e[_0x3e0402[_0x7c60('0x36')]]={'$like':'%'+_0x36bdba[_0x7c60('0x24')][_0x7c60('0x30')]+'%'};return _0x11235e;}})});}_0x40087b=_['merge']({},_0x40087b,_0x36bdba[_0x7c60('0x37')]);var _0x28fb9a={'where':_0x40087b[_0x7c60('0x2e')]};return db[_0x7c60('0x22')][_0x7c60('0x16')](_0x28fb9a)['then'](function(_0x22444e){_0x1a8b54[_0x7c60('0x16')]=_0x22444e;if(_0x36bdba[_0x7c60('0x24')][_0x7c60('0x38')]){_0x40087b[_0x7c60('0x39')]=[{'all':!![]}];}return db[_0x7c60('0x22')]['findAll'](_0x40087b);})[_0x7c60('0x1e')](function(_0x2abf30){_0x1a8b54[_0x7c60('0x3a')]=_0x2abf30;return _0x1a8b54;})[_0x7c60('0x1e')](respondWithFilteredResult(_0x554d48,_0x40087b))['catch'](handleError(_0x554d48,null));};exports[_0x7c60('0x3b')]=function(_0x42bd42,_0x1a0521){var _0x468f00={'raw':![],'where':{'id':_0x42bd42[_0x7c60('0x3c')]['id']}},_0x4c30d8={};_0x4c30d8[_0x7c60('0x23')]=_[_0x7c60('0x25')](db[_0x7c60('0x22')]['rawAttributes']);_0x4c30d8[_0x7c60('0x24')]=_[_0x7c60('0x25')](_0x42bd42['query']);_0x4c30d8[_0x7c60('0x2f')]=_[_0x7c60('0x26')](_0x4c30d8[_0x7c60('0x23')],_0x4c30d8[_0x7c60('0x24')]);_0x468f00[_0x7c60('0x28')]=_[_0x7c60('0x26')](_0x4c30d8['model'],qs['fields'](_0x42bd42[_0x7c60('0x24')]['fields']));_0x468f00[_0x7c60('0x28')]=_0x468f00[_0x7c60('0x28')][_0x7c60('0x29')]?_0x468f00[_0x7c60('0x28')]:_0x4c30d8['model'];if(_0x42bd42[_0x7c60('0x24')][_0x7c60('0x38')]){_0x468f00[_0x7c60('0x39')]=[{'all':!![]}];}_0x468f00=_[_0x7c60('0x31')]({},_0x468f00,_0x42bd42[_0x7c60('0x37')]);return db[_0x7c60('0x22')]['find'](_0x468f00)[_0x7c60('0x1e')](handleEntityNotFound(_0x1a0521,null))[_0x7c60('0x1e')](respondWithResult(_0x1a0521,null))[_0x7c60('0x3d')](handleError(_0x1a0521,null));};exports[_0x7c60('0x3e')]=function(_0x1da01e,_0x1b874f){return db['SACompanyRelationship'][_0x7c60('0x3e')](_0x1da01e[_0x7c60('0x3f')],{})[_0x7c60('0x1e')](respondWithResult(_0x1b874f,0xc9))['catch'](handleError(_0x1b874f,null));};exports[_0x7c60('0x1d')]=function(_0x23310b,_0x85f1d2){if(_0x23310b['body']['id']){delete _0x23310b[_0x7c60('0x3f')]['id'];}return db[_0x7c60('0x22')]['find']({'where':{'id':_0x23310b[_0x7c60('0x3c')]['id']}})['then'](handleEntityNotFound(_0x85f1d2,null))[_0x7c60('0x1e')](saveUpdates(_0x23310b['body'],null))[_0x7c60('0x1e')](respondWithResult(_0x85f1d2,null))[_0x7c60('0x3d')](handleError(_0x85f1d2,null));};exports[_0x7c60('0x1f')]=function(_0xfd2426,_0x233d8e){return db[_0x7c60('0x22')][_0x7c60('0x40')]({'where':{'id':_0xfd2426[_0x7c60('0x3c')]['id']}})[_0x7c60('0x1e')](handleEntityNotFound(_0x233d8e,null))[_0x7c60('0x1e')](removeEntity(_0x233d8e,null))[_0x7c60('0x3d')](handleError(_0x233d8e,null));};exports[_0x7c60('0x41')]=function(_0x25ec05,_0x185bb2){return db[_0x7c60('0x22')][_0x7c60('0x41')]()[_0x7c60('0x1e')](respondWithResult(_0x185bb2,null))[_0x7c60('0x3d')](handleError(_0x185bb2,null));}; \ No newline at end of file +var _0xe996=['stack','name','send','index','SACompanyRelationship','rawAttributes','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','order','where','pick','filter','merge','map','VIRTUAL','field','options','includeAll','findAll','catch','params','length','include','find','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','status','json','count','offset','limit','Content-Range','apply','update','then','destroy','end','sendStatus','error'];(function(_0x351d7f,_0x5e9837){var _0xb65654=function(_0x1b28b9){while(--_0x1b28b9){_0x351d7f['push'](_0x351d7f['shift']());}};_0xb65654(++_0x5e9837);}(_0xe996,0xaf));var _0x6e99=function(_0x512f3f,_0x3104fa){_0x512f3f=_0x512f3f-0x0;var _0x3b56a9=_0xe996[_0x512f3f];return _0x3b56a9;};'use strict';var pdf=require(_0x6e99('0x0'));var emlformat=require(_0x6e99('0x1'));var rimraf=require(_0x6e99('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6e99('0x3'));var rp=require(_0x6e99('0x4'));var moment=require(_0x6e99('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6e99('0x6'));var util=require(_0x6e99('0x7'));var path=require(_0x6e99('0x8'));var sox=require('sox');var csv=require(_0x6e99('0x9'));var ejs=require(_0x6e99('0xa'));var fs=require('fs');var _=require(_0x6e99('0xb'));var squel=require(_0x6e99('0xc'));var crypto=require(_0x6e99('0xd'));var jsforce=require(_0x6e99('0xe'));var deskjs=require(_0x6e99('0xf'));var toCsv=require(_0x6e99('0x9'));var querystring=require(_0x6e99('0x10'));var Papa=require(_0x6e99('0x11'));var Redis=require(_0x6e99('0x12'));var authService=require(_0x6e99('0x13'));var qs=require(_0x6e99('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6e99('0x15'))(_0x6e99('0x16'));var utils=require(_0x6e99('0x17'));var config=require(_0x6e99('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5da1cd,_0x5abbba){_0x5abbba=_0x5abbba||0xcc;return function(_0x51d749){if(_0x51d749){return _0x5da1cd['sendStatus'](_0x5abbba);}return _0x5da1cd[_0x6e99('0x19')](_0x5abbba)['end']();};}function respondWithResult(_0x346761,_0x48edf4){_0x48edf4=_0x48edf4||0xc8;return function(_0x449376){if(_0x449376){return _0x346761['status'](_0x48edf4)[_0x6e99('0x1a')](_0x449376);}};}function respondWithFilteredResult(_0x337985,_0x4668dc){return function(_0x4035c3){if(_0x4035c3){var _0x20866e=_0x4035c3[_0x6e99('0x1b')],_0x1b96b5=_0x4668dc[_0x6e99('0x1c')],_0x535f93=_0x4668dc[_0x6e99('0x1c')]+_0x4668dc[_0x6e99('0x1d')],_0x57c71d;if(_0x535f93>=_0x20866e){_0x535f93=_0x20866e;_0x57c71d=0xc8;}else{_0x57c71d=0xce;}_0x337985[_0x6e99('0x19')](_0x57c71d);return _0x337985['set'](_0x6e99('0x1e'),_0x1b96b5+'-'+_0x535f93+'/'+_0x20866e)[_0x6e99('0x1a')](_0x4035c3);}return null;};}function patchUpdates(_0x19dac2){return function(_0xe27be2){try{jsonpatch[_0x6e99('0x1f')](_0xe27be2,_0x19dac2,!![]);}catch(_0x1f4889){return BPromise['reject'](_0x1f4889);}return _0xe27be2['save']();};}function saveUpdates(_0x58a6c1,_0x4e014d){return function(_0x39ad43){if(_0x39ad43){return _0x39ad43[_0x6e99('0x20')](_0x58a6c1)[_0x6e99('0x21')](function(_0x3d20db){return _0x3d20db;});}return null;};}function removeEntity(_0x28a5c9,_0x237da3){return function(_0x6b68f1){if(_0x6b68f1){return _0x6b68f1[_0x6e99('0x22')]()['then'](function(){_0x28a5c9[_0x6e99('0x19')](0xcc)[_0x6e99('0x23')]();});}};}function handleEntityNotFound(_0x2b0d9c,_0xdb6006){return function(_0x1ca77c){if(!_0x1ca77c){_0x2b0d9c[_0x6e99('0x24')](0x194);}return _0x1ca77c;};}function handleError(_0x547e,_0x390060){_0x390060=_0x390060||0x1f4;return function(_0x5dcf2a){logger[_0x6e99('0x25')](_0x5dcf2a[_0x6e99('0x26')]);if(_0x5dcf2a['name']){delete _0x5dcf2a[_0x6e99('0x27')];}_0x547e[_0x6e99('0x19')](_0x390060)[_0x6e99('0x28')](_0x5dcf2a);};}exports[_0x6e99('0x29')]=function(_0x14ed38,_0x2ab54f){var _0x54e73e={},_0x5600fb={},_0x532469={'count':0x0,'rows':[]};var _0x198187=db[_0x6e99('0x2a')][_0x6e99('0x2b')];_0x5600fb['model']=_['keys'](_0x198187);_0x5600fb[_0x6e99('0x2c')]=_[_0x6e99('0x2d')](_0x14ed38[_0x6e99('0x2c')]);_0x5600fb[_0x6e99('0x2e')]=_[_0x6e99('0x2f')](_0x5600fb[_0x6e99('0x30')],_0x5600fb[_0x6e99('0x2c')]);_0x54e73e['attributes']=_['intersection'](_0x5600fb[_0x6e99('0x30')],qs[_0x6e99('0x31')](_0x14ed38[_0x6e99('0x2c')]['fields']));_0x54e73e[_0x6e99('0x32')]=_0x54e73e[_0x6e99('0x32')]['length']?_0x54e73e[_0x6e99('0x32')]:_0x5600fb[_0x6e99('0x30')];if(!_0x14ed38[_0x6e99('0x2c')][_0x6e99('0x33')]('nolimit')){_0x54e73e['limit']=qs[_0x6e99('0x1d')](_0x14ed38[_0x6e99('0x2c')][_0x6e99('0x1d')]);_0x54e73e['offset']=qs[_0x6e99('0x1c')](_0x14ed38[_0x6e99('0x2c')][_0x6e99('0x1c')]);}_0x54e73e[_0x6e99('0x34')]=qs['sort'](_0x14ed38[_0x6e99('0x2c')]['sort']);_0x54e73e[_0x6e99('0x35')]=qs['filters'](_[_0x6e99('0x36')](_0x14ed38[_0x6e99('0x2c')],_0x5600fb[_0x6e99('0x2e')]));if(_0x14ed38[_0x6e99('0x2c')][_0x6e99('0x37')]){_0x54e73e['where']=_[_0x6e99('0x38')](_0x54e73e['where'],{'$or':_[_0x6e99('0x39')](_0x198187,function(_0x51c255){if(_0x51c255['type']['key']!==_0x6e99('0x3a')){var _0x473624={};_0x473624[_0x51c255[_0x6e99('0x3b')]]={'$like':'%'+_0x14ed38[_0x6e99('0x2c')][_0x6e99('0x37')]+'%'};return _0x473624;}})});}_0x54e73e=_['merge']({},_0x54e73e,_0x14ed38[_0x6e99('0x3c')]);var _0x3de0e4={'where':_0x54e73e[_0x6e99('0x35')]};return db[_0x6e99('0x2a')]['count'](_0x3de0e4)[_0x6e99('0x21')](function(_0xde7c71){_0x532469[_0x6e99('0x1b')]=_0xde7c71;if(_0x14ed38[_0x6e99('0x2c')][_0x6e99('0x3d')]){_0x54e73e['include']=[{'all':!![]}];}return db['SACompanyRelationship'][_0x6e99('0x3e')](_0x54e73e);})[_0x6e99('0x21')](function(_0x3667e6){_0x532469['rows']=_0x3667e6;return _0x532469;})[_0x6e99('0x21')](respondWithFilteredResult(_0x2ab54f,_0x54e73e))[_0x6e99('0x3f')](handleError(_0x2ab54f,null));};exports['show']=function(_0x5ea54b,_0x2ba00e){var _0x5736cf={'raw':![],'where':{'id':_0x5ea54b[_0x6e99('0x40')]['id']}},_0xf59bfb={};_0xf59bfb[_0x6e99('0x30')]=_[_0x6e99('0x2d')](db['SACompanyRelationship']['rawAttributes']);_0xf59bfb[_0x6e99('0x2c')]=_[_0x6e99('0x2d')](_0x5ea54b[_0x6e99('0x2c')]);_0xf59bfb[_0x6e99('0x2e')]=_[_0x6e99('0x2f')](_0xf59bfb['model'],_0xf59bfb[_0x6e99('0x2c')]);_0x5736cf['attributes']=_[_0x6e99('0x2f')](_0xf59bfb[_0x6e99('0x30')],qs['fields'](_0x5ea54b[_0x6e99('0x2c')][_0x6e99('0x31')]));_0x5736cf[_0x6e99('0x32')]=_0x5736cf[_0x6e99('0x32')][_0x6e99('0x41')]?_0x5736cf['attributes']:_0xf59bfb[_0x6e99('0x30')];if(_0x5ea54b['query']['includeAll']){_0x5736cf[_0x6e99('0x42')]=[{'all':!![]}];}_0x5736cf=_[_0x6e99('0x38')]({},_0x5736cf,_0x5ea54b[_0x6e99('0x3c')]);return db[_0x6e99('0x2a')][_0x6e99('0x43')](_0x5736cf)[_0x6e99('0x21')](handleEntityNotFound(_0x2ba00e,null))['then'](respondWithResult(_0x2ba00e,null))[_0x6e99('0x3f')](handleError(_0x2ba00e,null));};exports['create']=function(_0x4e32bc,_0x419f14){return db[_0x6e99('0x2a')][_0x6e99('0x44')](_0x4e32bc[_0x6e99('0x45')],{})[_0x6e99('0x21')](respondWithResult(_0x419f14,0xc9))['catch'](handleError(_0x419f14,null));};exports['update']=function(_0x4e1271,_0x35d9d8){if(_0x4e1271[_0x6e99('0x45')]['id']){delete _0x4e1271[_0x6e99('0x45')]['id'];}return db[_0x6e99('0x2a')][_0x6e99('0x43')]({'where':{'id':_0x4e1271[_0x6e99('0x40')]['id']}})[_0x6e99('0x21')](handleEntityNotFound(_0x35d9d8,null))[_0x6e99('0x21')](saveUpdates(_0x4e1271[_0x6e99('0x45')],null))[_0x6e99('0x21')](respondWithResult(_0x35d9d8,null))[_0x6e99('0x3f')](handleError(_0x35d9d8,null));};exports[_0x6e99('0x22')]=function(_0x40a67a,_0x38a4e7){return db[_0x6e99('0x2a')][_0x6e99('0x43')]({'where':{'id':_0x40a67a[_0x6e99('0x40')]['id']}})['then'](handleEntityNotFound(_0x38a4e7,null))[_0x6e99('0x21')](removeEntity(_0x38a4e7,null))[_0x6e99('0x3f')](handleError(_0x38a4e7,null));};exports[_0x6e99('0x46')]=function(_0x40c594,_0x5402ef){return db[_0x6e99('0x2a')][_0x6e99('0x46')]()[_0x6e99('0x21')](respondWithResult(_0x5402ef,null))[_0x6e99('0x3f')](handleError(_0x5402ef,null));}; \ No newline at end of file diff --git a/server/api/saCompanyRelationship/saCompanyRelationship.model.js b/server/api/saCompanyRelationship/saCompanyRelationship.model.js index 3f44bcf..899366b 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 _0x2d5e=['rimraf','../../config/environment','./saCompanyRelationship.attributes','exports','define','sa_company_relationships','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2022c9,_0x2dab63){var _0x1910ef=function(_0x3e58a4){while(--_0x3e58a4){_0x2022c9['push'](_0x2022c9['shift']());}};_0x1910ef(++_0x2dab63);}(_0x2d5e,0x131));var _0xe2d5=function(_0x214e9e,_0x1949d6){_0x214e9e=_0x214e9e-0x0;var _0x53432c=_0x2d5e[_0x214e9e];return _0x53432c;};'use strict';var _=require('lodash');var util=require(_0xe2d5('0x0'));var logger=require(_0xe2d5('0x1'))(_0xe2d5('0x2'));var moment=require(_0xe2d5('0x3'));var BPromise=require(_0xe2d5('0x4'));var rp=require(_0xe2d5('0x5'));var fs=require('fs');var path=require(_0xe2d5('0x6'));var rimraf=require(_0xe2d5('0x7'));var config=require(_0xe2d5('0x8'));var attributes=require(_0xe2d5('0x9'));module[_0xe2d5('0xa')]=function(_0x293640,_0x45358f){return _0x293640[_0xe2d5('0xb')]('SACompanyRelationship',attributes,{'tableName':_0xe2d5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x477f=['path','rimraf','../../config/environment','./saCompanyRelationship.attributes','exports','SACompanyRelationship','sa_company_relationships','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x477f,0x1f1));var _0xf477=function(_0x1288a3,_0x46f89a){_0x1288a3=_0x1288a3-0x0;var _0x14b413=_0x477f[_0x1288a3];return _0x14b413;};'use strict';var _=require(_0xf477('0x0'));var util=require(_0xf477('0x1'));var logger=require(_0xf477('0x2'))(_0xf477('0x3'));var moment=require(_0xf477('0x4'));var BPromise=require(_0xf477('0x5'));var rp=require(_0xf477('0x6'));var fs=require('fs');var path=require(_0xf477('0x7'));var rimraf=require(_0xf477('0x8'));var config=require(_0xf477('0x9'));var attributes=require(_0xf477('0xa'));module[_0xf477('0xb')]=function(_0x4f4d81,_0x316d27){return _0x4f4d81['define'](_0xf477('0xc'),attributes,{'tableName':_0xf477('0xd'),'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 9ca1b3f..bc0262e 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 _0xfc27=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SACompanyRelationship,\x20%s,\x20%s','request\x20sent','debug','SACompanyRelationship,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','ioredis'];(function(_0x1fb938,_0x1fa88f){var _0x35315f=function(_0x34c526){while(--_0x34c526){_0x1fb938['push'](_0x1fb938['shift']());}};_0x35315f(++_0x1fa88f);}(_0xfc27,0x14e));var _0x7fc2=function(_0x234841,_0x180393){_0x234841=_0x234841-0x0;var _0x34a939=_0xfc27[_0x234841];return _0x34a939;};'use strict';var _=require('lodash');var util=require(_0x7fc2('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7fc2('0x1'));var db=require(_0x7fc2('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x7fc2('0x3'))(_0x7fc2('0x4'));var config=require(_0x7fc2('0x5'));var jayson=require(_0x7fc2('0x6'));var client=jayson[_0x7fc2('0x7')][_0x7fc2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5df1ff,_0x4fa7cb,_0x274694){return new BPromise(function(_0x363b44,_0x2ef69d){return client['request'](_0x5df1ff,_0x274694)[_0x7fc2('0x9')](function(_0xbbbc9a){logger[_0x7fc2('0xa')](_0x7fc2('0xb'),_0x4fa7cb,_0x7fc2('0xc'));logger[_0x7fc2('0xd')](_0x7fc2('0xe'),_0x4fa7cb,_0x7fc2('0xc'),JSON[_0x7fc2('0xf')](_0xbbbc9a));if(_0xbbbc9a[_0x7fc2('0x10')]){if(_0xbbbc9a[_0x7fc2('0x10')][_0x7fc2('0x11')]===0x1f4){logger['error'](_0x7fc2('0xb'),_0x4fa7cb,_0xbbbc9a['error'][_0x7fc2('0x12')]);return _0x2ef69d(_0xbbbc9a[_0x7fc2('0x10')][_0x7fc2('0x12')]);}logger['error']('SACompanyRelationship,\x20%s,\x20%s',_0x4fa7cb,_0xbbbc9a[_0x7fc2('0x10')][_0x7fc2('0x12')]);return _0x363b44(_0xbbbc9a[_0x7fc2('0x10')][_0x7fc2('0x12')]);}else{logger['info'](_0x7fc2('0xb'),_0x4fa7cb,_0x7fc2('0xc'));_0x363b44(_0xbbbc9a[_0x7fc2('0x13')][_0x7fc2('0x12')]);}})[_0x7fc2('0x14')](function(_0xb5de09){logger[_0x7fc2('0x10')](_0x7fc2('0xb'),_0x4fa7cb,_0xb5de09);_0x2ef69d(_0xb5de09);});});} \ No newline at end of file +var _0x3618=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','debug','SACompanyRelationship,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','SACompanyRelationship,\x20%s,\x20%s','message','info','util'];(function(_0x58af7e,_0x1f92c2){var _0x3abf62=function(_0x2bcb46){while(--_0x2bcb46){_0x58af7e['push'](_0x58af7e['shift']());}};_0x3abf62(++_0x1f92c2);}(_0x3618,0x1cd));var _0x8361=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x3618[_0x28947d];return _0x12d2ee;};'use strict';var _=require('lodash');var util=require(_0x8361('0x0'));var moment=require(_0x8361('0x1'));var BPromise=require(_0x8361('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8361('0x3'));var db=require(_0x8361('0x4'))['db'];var utils=require(_0x8361('0x5'));var logger=require(_0x8361('0x6'))(_0x8361('0x7'));var config=require(_0x8361('0x8'));var jayson=require(_0x8361('0x9'));var client=jayson['client'][_0x8361('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13a0c2,_0x2a8292,_0x3e18b5){return new BPromise(function(_0x3b504d,_0x43966e){return client[_0x8361('0xb')](_0x13a0c2,_0x3e18b5)[_0x8361('0xc')](function(_0x29ae23){logger['info']('SACompanyRelationship,\x20%s,\x20%s',_0x2a8292,'request\x20sent');logger[_0x8361('0xd')](_0x8361('0xe'),_0x2a8292,_0x8361('0xf'),JSON[_0x8361('0x10')](_0x29ae23));if(_0x29ae23[_0x8361('0x11')]){if(_0x29ae23['error']['code']===0x1f4){logger['error'](_0x8361('0x12'),_0x2a8292,_0x29ae23[_0x8361('0x11')]['message']);return _0x43966e(_0x29ae23[_0x8361('0x11')][_0x8361('0x13')]);}logger[_0x8361('0x11')](_0x8361('0x12'),_0x2a8292,_0x29ae23[_0x8361('0x11')][_0x8361('0x13')]);return _0x3b504d(_0x29ae23[_0x8361('0x11')]['message']);}else{logger[_0x8361('0x14')](_0x8361('0x12'),_0x2a8292,_0x8361('0xf'));_0x3b504d(_0x29ae23['result'][_0x8361('0x13')]);}})['catch'](function(_0x1ea35e){logger[_0x8361('0x11')](_0x8361('0x12'),_0x2a8292,_0x1ea35e);_0x43966e(_0x1ea35e);});});} \ No newline at end of file diff --git a/server/api/saCompanyType/index.js b/server/api/saCompanyType/index.js index e4fa4e2..f4a0c65 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 _0xe9c6=['get','isAuthenticated','index','/describe','describe','/:id/checkCompanyBillingInfo','checkCompanyBillingInfo','create','put','/:id','update','delete','destroy','multer','path','connect-timeout','Router','../../components/auth/service','./saCompanyType.controller'];(function(_0x4454cc,_0x14f33b){var _0x4baaf5=function(_0x2790d7){while(--_0x2790d7){_0x4454cc['push'](_0x4454cc['shift']());}};_0x4baaf5(++_0x14f33b);}(_0xe9c6,0x1e8));var _0x6e9c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe9c6[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x6e9c('0x0'));var util=require('util');var path=require(_0x6e9c('0x1'));var timeout=require(_0x6e9c('0x2'));var express=require('express');var router=express[_0x6e9c('0x3')]();var auth=require(_0x6e9c('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6e9c('0x5'));router[_0x6e9c('0x6')]('/',auth[_0x6e9c('0x7')](),controller[_0x6e9c('0x8')]);router[_0x6e9c('0x6')](_0x6e9c('0x9'),auth[_0x6e9c('0x7')](),controller[_0x6e9c('0xa')]);router[_0x6e9c('0x6')]('/:id',auth[_0x6e9c('0x7')](),controller['show']);router[_0x6e9c('0x6')](_0x6e9c('0xb'),auth['isAuthenticated'](),controller[_0x6e9c('0xc')]);router['post']('/',auth[_0x6e9c('0x7')](),controller[_0x6e9c('0xd')]);router[_0x6e9c('0xe')](_0x6e9c('0xf'),auth[_0x6e9c('0x7')](),controller[_0x6e9c('0x10')]);router[_0x6e9c('0x11')](_0x6e9c('0xf'),auth[_0x6e9c('0x7')](),controller[_0x6e9c('0x12')]);module['exports']=router; \ No newline at end of file +var _0xb0ad=['describe','isAuthenticated','show','/:id/checkCompanyBillingInfo','checkCompanyBillingInfo','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./saCompanyType.controller','get','index','/describe'];(function(_0xa11ec4,_0x50c637){var _0xd37c5b=function(_0x21d4e9){while(--_0x21d4e9){_0xa11ec4['push'](_0xa11ec4['shift']());}};_0xd37c5b(++_0x50c637);}(_0xb0ad,0x1eb));var _0xdb0a=function(_0x250e7f,_0x8848b1){_0x250e7f=_0x250e7f-0x0;var _0x3b7c48=_0xb0ad[_0x250e7f];return _0x3b7c48;};'use strict';var multer=require(_0xdb0a('0x0'));var util=require(_0xdb0a('0x1'));var path=require(_0xdb0a('0x2'));var timeout=require(_0xdb0a('0x3'));var express=require(_0xdb0a('0x4'));var router=express[_0xdb0a('0x5')]();var auth=require(_0xdb0a('0x6'));var interaction=require(_0xdb0a('0x7'));var config=require(_0xdb0a('0x8'));var controller=require(_0xdb0a('0x9'));router[_0xdb0a('0xa')]('/',auth['isAuthenticated'](),controller[_0xdb0a('0xb')]);router[_0xdb0a('0xa')](_0xdb0a('0xc'),auth['isAuthenticated'](),controller[_0xdb0a('0xd')]);router[_0xdb0a('0xa')]('/:id',auth[_0xdb0a('0xe')](),controller[_0xdb0a('0xf')]);router[_0xdb0a('0xa')](_0xdb0a('0x10'),auth[_0xdb0a('0xe')](),controller[_0xdb0a('0x11')]);router['post']('/',auth[_0xdb0a('0xe')](),controller[_0xdb0a('0x12')]);router[_0xdb0a('0x13')](_0xdb0a('0x14'),auth[_0xdb0a('0xe')](),controller['update']);router[_0xdb0a('0x15')](_0xdb0a('0x14'),auth[_0xdb0a('0xe')](),controller[_0xdb0a('0x16')]);module[_0xdb0a('0x17')]=router; \ No newline at end of file diff --git a/server/api/saCompanyType/saCompanyType.attributes.js b/server/api/saCompanyType/saCompanyType.attributes.js index e393079..c8de31b 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 _0xf8b2=['STRING','name','sequelize','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf8b2,0x15e));var _0x2f8b=function(_0x1c9bd9,_0x4c7621){_0x1c9bd9=_0x1c9bd9-0x0;var _0x5d0bf3=_0xf8b2[_0x1c9bd9];return _0x5d0bf3;};'use strict';var Sequelize=require(_0x2f8b('0x0'));module[_0x2f8b('0x1')]={'name':{'type':Sequelize[_0x2f8b('0x2')],'allowNull':![],'unique':_0x2f8b('0x3')},'fieldsToCheck':{'type':Sequelize[_0x2f8b('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xb18e=['STRING'];(function(_0x1d7300,_0x17f109){var _0x46ee98=function(_0x5ee16a){while(--_0x5ee16a){_0x1d7300['push'](_0x1d7300['shift']());}};_0x46ee98(++_0x17f109);}(_0xb18e,0x181));var _0xeb18=function(_0x446208,_0xb483fb){_0x446208=_0x446208-0x0;var _0xe49563=_0xb18e[_0x446208];return _0xe49563;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xeb18('0x0')],'allowNull':![],'unique':'name'},'fieldsToCheck':{'type':Sequelize[_0xeb18('0x0')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/saCompanyType/saCompanyType.controller.js b/server/api/saCompanyType/saCompanyType.controller.js index c19b3d8..9724ba0 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 _0x3c79=['path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','end','status','json','count','offset','limit','set','Content-Range','reject','save','destroy','then','sendStatus','error','name','index','SACompanyType','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','merge','map','type','VIRTUAL','field','filter','includeAll','include','rows','find','create','body','params','catch','describe','checkCompanyBillingInfo','findOne','saCompanyType','fieldsToCheck','split','isNil','push','log','missingFields','isEmpty','No\x20missing','Missing!','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x1950e1,_0x4c8cbd){var _0xe47e1b=function(_0x59e60c){while(--_0x59e60c){_0x1950e1['push'](_0x1950e1['shift']());}};_0xe47e1b(++_0x4c8cbd);}(_0x3c79,0x99));var _0x93c7=function(_0x47d79a,_0x313b18){_0x47d79a=_0x47d79a-0x0;var _0x474fe1=_0x3c79[_0x47d79a];return _0x474fe1;};'use strict';var pdf=require(_0x93c7('0x0'));var emlformat=require(_0x93c7('0x1'));var rimraf=require(_0x93c7('0x2'));var zipdir=require(_0x93c7('0x3'));var jsonpatch=require(_0x93c7('0x4'));var rp=require(_0x93c7('0x5'));var moment=require(_0x93c7('0x6'));var BPromise=require(_0x93c7('0x7'));var Mustache=require(_0x93c7('0x8'));var util=require('util');var path=require(_0x93c7('0x9'));var sox=require(_0x93c7('0xa'));var csv=require(_0x93c7('0xb'));var ejs=require(_0x93c7('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x93c7('0xd'));var crypto=require(_0x93c7('0xe'));var jsforce=require(_0x93c7('0xf'));var deskjs=require(_0x93c7('0x10'));var toCsv=require('to-csv');var querystring=require(_0x93c7('0x11'));var Papa=require(_0x93c7('0x12'));var Redis=require(_0x93c7('0x13'));var authService=require(_0x93c7('0x14'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x93c7('0x15'));var logger=require(_0x93c7('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26bab0,_0x15a104){_0x15a104=_0x15a104||0xcc;return function(_0x18d8a3){if(_0x18d8a3){return _0x26bab0['sendStatus'](_0x15a104);}return _0x26bab0['status'](_0x15a104)[_0x93c7('0x17')]();};}function respondWithResult(_0x685ee8,_0x586d17){_0x586d17=_0x586d17||0xc8;return function(_0x586922){if(_0x586922){return _0x685ee8[_0x93c7('0x18')](_0x586d17)[_0x93c7('0x19')](_0x586922);}};}function respondWithFilteredResult(_0x2d8702,_0x100824){return function(_0x138fd6){if(_0x138fd6){var _0x11b241=_0x138fd6[_0x93c7('0x1a')],_0x1b232e=_0x100824[_0x93c7('0x1b')],_0x2edaf6=_0x100824[_0x93c7('0x1b')]+_0x100824[_0x93c7('0x1c')],_0x55df23;if(_0x2edaf6>=_0x11b241){_0x2edaf6=_0x11b241;_0x55df23=0xc8;}else{_0x55df23=0xce;}_0x2d8702[_0x93c7('0x18')](_0x55df23);return _0x2d8702[_0x93c7('0x1d')](_0x93c7('0x1e'),_0x1b232e+'-'+_0x2edaf6+'/'+_0x11b241)[_0x93c7('0x19')](_0x138fd6);}return null;};}function patchUpdates(_0x30cc14){return function(_0x427dde){try{jsonpatch['apply'](_0x427dde,_0x30cc14,!![]);}catch(_0x3b5935){return BPromise[_0x93c7('0x1f')](_0x3b5935);}return _0x427dde[_0x93c7('0x20')]();};}function saveUpdates(_0x49088c,_0x23f9d2){return function(_0x36297b){if(_0x36297b){return _0x36297b['update'](_0x49088c)['then'](function(_0x2fa6b7){return _0x2fa6b7;});}return null;};}function removeEntity(_0x10b2d3,_0x1be86f){return function(_0x48fcae){if(_0x48fcae){return _0x48fcae[_0x93c7('0x21')]()[_0x93c7('0x22')](function(){_0x10b2d3[_0x93c7('0x18')](0xcc)[_0x93c7('0x17')]();});}};}function handleEntityNotFound(_0xd58ff0,_0x6d3bc7){return function(_0x567f41){if(!_0x567f41){_0xd58ff0[_0x93c7('0x23')](0x194);}return _0x567f41;};}function handleError(_0x3da162,_0x44663e){_0x44663e=_0x44663e||0x1f4;return function(_0x300491){logger[_0x93c7('0x24')](_0x300491['stack']);if(_0x300491[_0x93c7('0x25')]){delete _0x300491[_0x93c7('0x25')];}_0x3da162['status'](_0x44663e)['send'](_0x300491);};}exports[_0x93c7('0x26')]=function(_0x307b40,_0x3959c3){var _0x1644e3={},_0x51cd9f={},_0x1ca6ae={'count':0x0,'rows':[]};var _0x233f31=db[_0x93c7('0x27')][_0x93c7('0x28')];_0x51cd9f['model']=_['keys'](_0x233f31);_0x51cd9f[_0x93c7('0x29')]=_[_0x93c7('0x2a')](_0x307b40[_0x93c7('0x29')]);_0x51cd9f[_0x93c7('0x2b')]=_[_0x93c7('0x2c')](_0x51cd9f[_0x93c7('0x2d')],_0x51cd9f[_0x93c7('0x29')]);_0x1644e3[_0x93c7('0x2e')]=_[_0x93c7('0x2c')](_0x51cd9f[_0x93c7('0x2d')],qs[_0x93c7('0x2f')](_0x307b40[_0x93c7('0x29')][_0x93c7('0x2f')]));_0x1644e3[_0x93c7('0x2e')]=_0x1644e3[_0x93c7('0x2e')][_0x93c7('0x30')]?_0x1644e3[_0x93c7('0x2e')]:_0x51cd9f[_0x93c7('0x2d')];if(!_0x307b40[_0x93c7('0x29')]['hasOwnProperty'](_0x93c7('0x31'))){_0x1644e3['limit']=qs['limit'](_0x307b40[_0x93c7('0x29')][_0x93c7('0x1c')]);_0x1644e3[_0x93c7('0x1b')]=qs[_0x93c7('0x1b')](_0x307b40['query']['offset']);}_0x1644e3[_0x93c7('0x32')]=qs['sort'](_0x307b40[_0x93c7('0x29')][_0x93c7('0x33')]);_0x1644e3[_0x93c7('0x34')]=qs[_0x93c7('0x2b')](_[_0x93c7('0x35')](_0x307b40[_0x93c7('0x29')],_0x51cd9f[_0x93c7('0x2b')]));if(_0x307b40[_0x93c7('0x29')]['filter']){_0x1644e3[_0x93c7('0x34')]=_[_0x93c7('0x36')](_0x1644e3[_0x93c7('0x34')],{'$or':_[_0x93c7('0x37')](_0x233f31,function(_0x84404a){if(_0x84404a[_0x93c7('0x38')]['key']!==_0x93c7('0x39')){var _0x20f0b4={};_0x20f0b4[_0x84404a[_0x93c7('0x3a')]]={'$like':'%'+_0x307b40[_0x93c7('0x29')][_0x93c7('0x3b')]+'%'};return _0x20f0b4;}})});}_0x1644e3=_[_0x93c7('0x36')]({},_0x1644e3,_0x307b40['options']);var _0x3c8d5d={'where':_0x1644e3[_0x93c7('0x34')]};return db['SACompanyType'][_0x93c7('0x1a')](_0x3c8d5d)['then'](function(_0x3f747c){_0x1ca6ae[_0x93c7('0x1a')]=_0x3f747c;if(_0x307b40['query'][_0x93c7('0x3c')]){_0x1644e3[_0x93c7('0x3d')]=[{'all':!![]}];}return db[_0x93c7('0x27')]['findAll'](_0x1644e3);})[_0x93c7('0x22')](function(_0x39cb3a){_0x1ca6ae[_0x93c7('0x3e')]=_0x39cb3a;return _0x1ca6ae;})['then'](respondWithFilteredResult(_0x3959c3,_0x1644e3))['catch'](handleError(_0x3959c3,null));};exports['show']=function(_0x56795e,_0x6827d0){var _0x1c0e69={'raw':![],'where':{'id':_0x56795e['params']['id']}},_0x1b6ab0={};_0x1b6ab0[_0x93c7('0x2d')]=_[_0x93c7('0x2a')](db['SACompanyType'][_0x93c7('0x28')]);_0x1b6ab0[_0x93c7('0x29')]=_[_0x93c7('0x2a')](_0x56795e['query']);_0x1b6ab0['filters']=_[_0x93c7('0x2c')](_0x1b6ab0[_0x93c7('0x2d')],_0x1b6ab0[_0x93c7('0x29')]);_0x1c0e69['attributes']=_[_0x93c7('0x2c')](_0x1b6ab0[_0x93c7('0x2d')],qs['fields'](_0x56795e[_0x93c7('0x29')]['fields']));_0x1c0e69[_0x93c7('0x2e')]=_0x1c0e69[_0x93c7('0x2e')]['length']?_0x1c0e69[_0x93c7('0x2e')]:_0x1b6ab0[_0x93c7('0x2d')];if(_0x56795e[_0x93c7('0x29')]['includeAll']){_0x1c0e69['include']=[{'all':!![]}];}_0x1c0e69=_[_0x93c7('0x36')]({},_0x1c0e69,_0x56795e['options']);return db['SACompanyType'][_0x93c7('0x3f')](_0x1c0e69)[_0x93c7('0x22')](handleEntityNotFound(_0x6827d0,null))[_0x93c7('0x22')](respondWithResult(_0x6827d0,null))['catch'](handleError(_0x6827d0,null));};exports[_0x93c7('0x40')]=function(_0x2ac93a,_0x2c36ea){return db[_0x93c7('0x27')][_0x93c7('0x40')](_0x2ac93a[_0x93c7('0x41')],{})['then'](respondWithResult(_0x2c36ea,0xc9))['catch'](handleError(_0x2c36ea,null));};exports['update']=function(_0x4a1e9c,_0x55a886){if(_0x4a1e9c[_0x93c7('0x41')]['id']){delete _0x4a1e9c[_0x93c7('0x41')]['id'];}return db[_0x93c7('0x27')]['find']({'where':{'id':_0x4a1e9c[_0x93c7('0x42')]['id']}})[_0x93c7('0x22')](handleEntityNotFound(_0x55a886,null))['then'](saveUpdates(_0x4a1e9c['body'],null))[_0x93c7('0x22')](respondWithResult(_0x55a886,null))[_0x93c7('0x43')](handleError(_0x55a886,null));};exports[_0x93c7('0x21')]=function(_0x543386,_0x4e2efa){return db[_0x93c7('0x27')][_0x93c7('0x3f')]({'where':{'id':_0x543386[_0x93c7('0x42')]['id']}})['then'](handleEntityNotFound(_0x4e2efa,null))[_0x93c7('0x22')](removeEntity(_0x4e2efa,null))['catch'](handleError(_0x4e2efa,null));};exports[_0x93c7('0x44')]=function(_0x3eae78,_0x47da72){return db['SACompanyType']['describe']()[_0x93c7('0x22')](respondWithResult(_0x47da72,null))[_0x93c7('0x43')](handleError(_0x47da72,null));};exports[_0x93c7('0x45')]=function(_0x6a61a7,_0x250fdb){var _0x1d3b3f={};return db['CmCompany'][_0x93c7('0x46')]({'where':{'id':_0x6a61a7['params']['id']},'raw':!![]})['then'](function(_0x36a969){if(_0x36a969){if(!_0x36a969[_0x93c7('0x47')]){_0x1d3b3f['saCompanyType']=!![];return _0x250fdb[_0x93c7('0x18')](0xc8)['json'](_0x1d3b3f);}else{db[_0x93c7('0x27')][_0x93c7('0x46')]({'id':_0x36a969[_0x93c7('0x47')],'raw':!![],'logging':console['log']})['then'](function(_0x371c90){var _0x11da4a=_0x371c90[_0x93c7('0x48')][_0x93c7('0x49')](',');var _0x5ee4bf=[];for(var _0x2c023a=0x0;_0x2c023a<_0x11da4a[_0x93c7('0x30')];_0x2c023a++){if(_[_0x93c7('0x4a')](_0x36a969[_0x11da4a[_0x2c023a]])||_0x36a969[_0x11da4a[_0x2c023a]]==''){_0x5ee4bf[_0x93c7('0x4b')](_0x11da4a[_0x2c023a]);_0x1d3b3f[_0x11da4a[_0x2c023a]]=!![];}}console[_0x93c7('0x4c')](_0x93c7('0x4d'),_0x5ee4bf);if(_[_0x93c7('0x4e')](_0x5ee4bf)){console[_0x93c7('0x4c')](_0x93c7('0x4f'));return _0x250fdb[_0x93c7('0x18')](0xc8)['json']({'ok':!![]});}else{console['log'](_0x93c7('0x50'));return _0x250fdb[_0x93c7('0x18')](0xc8)['json'](_0x1d3b3f);}});}}})[_0x93c7('0x43')](function(_0x79c737){console['log']('TCL:\x20exports.checkCompanyBillingInfo\x20->\x20err',_0x79c737);return _0x250fdb['sendStatus'](0x1f4);});}; \ No newline at end of file +var _0x9927=['error','stack','name','SACompanyType','rawAttributes','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','keys','find','create','catch','update','body','params','destroy','describe','saCompanyType','findOne','fieldsToCheck','split','push','log','No\x20missing','Missing!','TCL:\x20exports.checkCompanyBillingInfo\x20->\x20err','sendStatus','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','apply','reject','save','then'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x9927,0xd1));var _0x7992=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x9927[_0x59ee6f];return _0x4c0979;};'use strict';var pdf=require(_0x7992('0x0'));var emlformat=require(_0x7992('0x1'));var rimraf=require(_0x7992('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7992('0x3'));var rp=require(_0x7992('0x4'));var moment=require('moment');var BPromise=require(_0x7992('0x5'));var Mustache=require('mustache');var util=require(_0x7992('0x6'));var path=require(_0x7992('0x7'));var sox=require(_0x7992('0x8'));var csv=require(_0x7992('0x9'));var ejs=require(_0x7992('0xa'));var fs=require('fs');var _=require(_0x7992('0xb'));var squel=require(_0x7992('0xc'));var crypto=require(_0x7992('0xd'));var jsforce=require(_0x7992('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7992('0x9'));var querystring=require('querystring');var Papa=require(_0x7992('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x7992('0x10'));var logger=require('../../config/logger')(_0x7992('0x11'));var utils=require(_0x7992('0x12'));var config=require(_0x7992('0x13'));var db=require(_0x7992('0x14'))['db'];function respondWithStatusCode(_0x1d9999,_0x190afb){_0x190afb=_0x190afb||0xcc;return function(_0x400a6c){if(_0x400a6c){return _0x1d9999['sendStatus'](_0x190afb);}return _0x1d9999['status'](_0x190afb)['end']();};}function respondWithResult(_0x11d1e1,_0xd9a3b7){_0xd9a3b7=_0xd9a3b7||0xc8;return function(_0x18be4e){if(_0x18be4e){return _0x11d1e1[_0x7992('0x15')](_0xd9a3b7)[_0x7992('0x16')](_0x18be4e);}};}function respondWithFilteredResult(_0x41dd5d,_0x222011){return function(_0x57096e){if(_0x57096e){var _0x55c306=_0x57096e[_0x7992('0x17')],_0x2ad463=_0x222011[_0x7992('0x18')],_0x3a3895=_0x222011[_0x7992('0x18')]+_0x222011[_0x7992('0x19')],_0x48d238;if(_0x3a3895>=_0x55c306){_0x3a3895=_0x55c306;_0x48d238=0xc8;}else{_0x48d238=0xce;}_0x41dd5d['status'](_0x48d238);return _0x41dd5d[_0x7992('0x1a')]('Content-Range',_0x2ad463+'-'+_0x3a3895+'/'+_0x55c306)[_0x7992('0x16')](_0x57096e);}return null;};}function patchUpdates(_0x443b1d){return function(_0x2f68ec){try{jsonpatch[_0x7992('0x1b')](_0x2f68ec,_0x443b1d,!![]);}catch(_0x5486ce){return BPromise[_0x7992('0x1c')](_0x5486ce);}return _0x2f68ec[_0x7992('0x1d')]();};}function saveUpdates(_0x276a0e,_0x172a2e){return function(_0x258e24){if(_0x258e24){return _0x258e24['update'](_0x276a0e)[_0x7992('0x1e')](function(_0x53ff65){return _0x53ff65;});}return null;};}function removeEntity(_0x5d7eb6,_0x418326){return function(_0x4649ce){if(_0x4649ce){return _0x4649ce['destroy']()[_0x7992('0x1e')](function(){_0x5d7eb6[_0x7992('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c387f,_0x5aa587){return function(_0x6a2339){if(!_0x6a2339){_0x5c387f['sendStatus'](0x194);}return _0x6a2339;};}function handleError(_0x5d9679,_0x5254c5){_0x5254c5=_0x5254c5||0x1f4;return function(_0x4ebbfb){logger[_0x7992('0x1f')](_0x4ebbfb[_0x7992('0x20')]);if(_0x4ebbfb['name']){delete _0x4ebbfb[_0x7992('0x21')];}_0x5d9679[_0x7992('0x15')](_0x5254c5)['send'](_0x4ebbfb);};}exports['index']=function(_0x14ac3e,_0xf4782){var _0x4e7efa={},_0x308288={},_0x7feeb7={'count':0x0,'rows':[]};var _0x1ce53d=db[_0x7992('0x22')][_0x7992('0x23')];_0x308288[_0x7992('0x24')]=_['keys'](_0x1ce53d);_0x308288[_0x7992('0x25')]=_['keys'](_0x14ac3e[_0x7992('0x25')]);_0x308288[_0x7992('0x26')]=_[_0x7992('0x27')](_0x308288[_0x7992('0x24')],_0x308288['query']);_0x4e7efa[_0x7992('0x28')]=_[_0x7992('0x27')](_0x308288['model'],qs[_0x7992('0x29')](_0x14ac3e[_0x7992('0x25')][_0x7992('0x29')]));_0x4e7efa[_0x7992('0x28')]=_0x4e7efa[_0x7992('0x28')][_0x7992('0x2a')]?_0x4e7efa[_0x7992('0x28')]:_0x308288[_0x7992('0x24')];if(!_0x14ac3e[_0x7992('0x25')]['hasOwnProperty'](_0x7992('0x2b'))){_0x4e7efa['limit']=qs[_0x7992('0x19')](_0x14ac3e[_0x7992('0x25')][_0x7992('0x19')]);_0x4e7efa[_0x7992('0x18')]=qs[_0x7992('0x18')](_0x14ac3e[_0x7992('0x25')][_0x7992('0x18')]);}_0x4e7efa[_0x7992('0x2c')]=qs[_0x7992('0x2d')](_0x14ac3e['query'][_0x7992('0x2d')]);_0x4e7efa[_0x7992('0x2e')]=qs['filters'](_[_0x7992('0x2f')](_0x14ac3e[_0x7992('0x25')],_0x308288[_0x7992('0x26')]));if(_0x14ac3e[_0x7992('0x25')][_0x7992('0x30')]){_0x4e7efa[_0x7992('0x2e')]=_[_0x7992('0x31')](_0x4e7efa[_0x7992('0x2e')],{'$or':_[_0x7992('0x32')](_0x1ce53d,function(_0x20fd11){if(_0x20fd11[_0x7992('0x33')][_0x7992('0x34')]!==_0x7992('0x35')){var _0x54702c={};_0x54702c[_0x20fd11[_0x7992('0x36')]]={'$like':'%'+_0x14ac3e[_0x7992('0x25')][_0x7992('0x30')]+'%'};return _0x54702c;}})});}_0x4e7efa=_[_0x7992('0x31')]({},_0x4e7efa,_0x14ac3e[_0x7992('0x37')]);var _0x343443={'where':_0x4e7efa[_0x7992('0x2e')]};return db[_0x7992('0x22')]['count'](_0x343443)[_0x7992('0x1e')](function(_0xadccd0){_0x7feeb7[_0x7992('0x17')]=_0xadccd0;if(_0x14ac3e[_0x7992('0x25')][_0x7992('0x38')]){_0x4e7efa[_0x7992('0x39')]=[{'all':!![]}];}return db['SACompanyType'][_0x7992('0x3a')](_0x4e7efa);})['then'](function(_0x442411){_0x7feeb7[_0x7992('0x3b')]=_0x442411;return _0x7feeb7;})[_0x7992('0x1e')](respondWithFilteredResult(_0xf4782,_0x4e7efa))['catch'](handleError(_0xf4782,null));};exports[_0x7992('0x3c')]=function(_0x466435,_0x4e39ae){var _0x229e51={'raw':![],'where':{'id':_0x466435['params']['id']}},_0x275196={};_0x275196[_0x7992('0x24')]=_[_0x7992('0x3d')](db[_0x7992('0x22')][_0x7992('0x23')]);_0x275196[_0x7992('0x25')]=_[_0x7992('0x3d')](_0x466435[_0x7992('0x25')]);_0x275196[_0x7992('0x26')]=_[_0x7992('0x27')](_0x275196[_0x7992('0x24')],_0x275196[_0x7992('0x25')]);_0x229e51[_0x7992('0x28')]=_[_0x7992('0x27')](_0x275196[_0x7992('0x24')],qs['fields'](_0x466435[_0x7992('0x25')][_0x7992('0x29')]));_0x229e51[_0x7992('0x28')]=_0x229e51[_0x7992('0x28')][_0x7992('0x2a')]?_0x229e51[_0x7992('0x28')]:_0x275196[_0x7992('0x24')];if(_0x466435[_0x7992('0x25')][_0x7992('0x38')]){_0x229e51[_0x7992('0x39')]=[{'all':!![]}];}_0x229e51=_['merge']({},_0x229e51,_0x466435[_0x7992('0x37')]);return db[_0x7992('0x22')][_0x7992('0x3e')](_0x229e51)['then'](handleEntityNotFound(_0x4e39ae,null))[_0x7992('0x1e')](respondWithResult(_0x4e39ae,null))['catch'](handleError(_0x4e39ae,null));};exports[_0x7992('0x3f')]=function(_0x16dfe2,_0x25fdee){return db[_0x7992('0x22')][_0x7992('0x3f')](_0x16dfe2['body'],{})[_0x7992('0x1e')](respondWithResult(_0x25fdee,0xc9))[_0x7992('0x40')](handleError(_0x25fdee,null));};exports[_0x7992('0x41')]=function(_0x379858,_0x1ea197){if(_0x379858[_0x7992('0x42')]['id']){delete _0x379858['body']['id'];}return db[_0x7992('0x22')][_0x7992('0x3e')]({'where':{'id':_0x379858[_0x7992('0x43')]['id']}})[_0x7992('0x1e')](handleEntityNotFound(_0x1ea197,null))[_0x7992('0x1e')](saveUpdates(_0x379858[_0x7992('0x42')],null))[_0x7992('0x1e')](respondWithResult(_0x1ea197,null))['catch'](handleError(_0x1ea197,null));};exports[_0x7992('0x44')]=function(_0x201150,_0x204310){return db[_0x7992('0x22')][_0x7992('0x3e')]({'where':{'id':_0x201150[_0x7992('0x43')]['id']}})[_0x7992('0x1e')](handleEntityNotFound(_0x204310,null))[_0x7992('0x1e')](removeEntity(_0x204310,null))['catch'](handleError(_0x204310,null));};exports[_0x7992('0x45')]=function(_0x33e544,_0x556aef){return db[_0x7992('0x22')]['describe']()['then'](respondWithResult(_0x556aef,null))['catch'](handleError(_0x556aef,null));};exports['checkCompanyBillingInfo']=function(_0xedc246,_0x185f23){var _0x49d162={};return db['CmCompany']['findOne']({'where':{'id':_0xedc246[_0x7992('0x43')]['id']},'raw':!![]})[_0x7992('0x1e')](function(_0x1785cf){if(_0x1785cf){if(!_0x1785cf[_0x7992('0x46')]){_0x49d162[_0x7992('0x46')]=!![];return _0x185f23[_0x7992('0x15')](0xc8)[_0x7992('0x16')](_0x49d162);}else{db[_0x7992('0x22')][_0x7992('0x47')]({'id':_0x1785cf[_0x7992('0x46')],'raw':!![],'logging':console['log']})[_0x7992('0x1e')](function(_0x537f26){var _0x5802e5=_0x537f26[_0x7992('0x48')][_0x7992('0x49')](',');var _0x1e2cd9=[];for(var _0x2fbc97=0x0;_0x2fbc97<_0x5802e5[_0x7992('0x2a')];_0x2fbc97++){if(_['isNil'](_0x1785cf[_0x5802e5[_0x2fbc97]])||_0x1785cf[_0x5802e5[_0x2fbc97]]==''){_0x1e2cd9[_0x7992('0x4a')](_0x5802e5[_0x2fbc97]);_0x49d162[_0x5802e5[_0x2fbc97]]=!![];}}console[_0x7992('0x4b')]('missingFields',_0x1e2cd9);if(_['isEmpty'](_0x1e2cd9)){console[_0x7992('0x4b')](_0x7992('0x4c'));return _0x185f23['status'](0xc8)[_0x7992('0x16')]({'ok':!![]});}else{console['log'](_0x7992('0x4d'));return _0x185f23[_0x7992('0x15')](0xc8)[_0x7992('0x16')](_0x49d162);}});}}})['catch'](function(_0x1d031a){console[_0x7992('0x4b')](_0x7992('0x4e'),_0x1d031a);return _0x185f23[_0x7992('0x4f')](0x1f4);});}; \ No newline at end of file diff --git a/server/api/saCompanyType/saCompanyType.model.js b/server/api/saCompanyType/saCompanyType.model.js index 766c8fb..2326cde 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 _0xac1c=['path','rimraf','../../config/environment','exports','SACompanyType','sa_company_types','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4b174a,_0x33a017){var _0x3cd7bf=function(_0x44ccd9){while(--_0x44ccd9){_0x4b174a['push'](_0x4b174a['shift']());}};_0x3cd7bf(++_0x33a017);}(_0xac1c,0x1df));var _0xcac1=function(_0x421cf8,_0x23152c){_0x421cf8=_0x421cf8-0x0;var _0x145c48=_0xac1c[_0x421cf8];return _0x145c48;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcac1('0x0'))(_0xcac1('0x1'));var moment=require(_0xcac1('0x2'));var BPromise=require(_0xcac1('0x3'));var rp=require(_0xcac1('0x4'));var fs=require('fs');var path=require(_0xcac1('0x5'));var rimraf=require(_0xcac1('0x6'));var config=require(_0xcac1('0x7'));var attributes=require('./saCompanyType.attributes');module[_0xcac1('0x8')]=function(_0x513b31,_0x293002){return _0x513b31['define'](_0xcac1('0x9'),attributes,{'tableName':_0xcac1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdf8a=['exports','SACompanyType','sa_company_types','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0xdf8a,0x85));var _0xadf8=function(_0x1177d5,_0x22b649){_0x1177d5=_0x1177d5-0x0;var _0xc3ddc2=_0xdf8a[_0x1177d5];return _0xc3ddc2;};'use strict';var _=require(_0xadf8('0x0'));var util=require(_0xadf8('0x1'));var logger=require(_0xadf8('0x2'))(_0xadf8('0x3'));var moment=require(_0xadf8('0x4'));var BPromise=require(_0xadf8('0x5'));var rp=require(_0xadf8('0x6'));var fs=require('fs');var path=require(_0xadf8('0x7'));var rimraf=require(_0xadf8('0x8'));var config=require(_0xadf8('0x9'));var attributes=require('./saCompanyType.attributes');module[_0xadf8('0xa')]=function(_0x157081,_0x630661){return _0x157081['define'](_0xadf8('0xb'),attributes,{'tableName':_0xadf8('0xc'),'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 58e3276..7dc210d 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 _0xd914=['SACompanyType,\x20%s,\x20%s','request\x20sent','debug','SACompanyType,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info'];(function(_0x262899,_0x5c8917){var _0x4e035c=function(_0x41bac4){while(--_0x41bac4){_0x262899['push'](_0x262899['shift']());}};_0x4e035c(++_0x5c8917);}(_0xd914,0x17f));var _0x4d91=function(_0x45346d,_0xffd56b){_0x45346d=_0x45346d-0x0;var _0x5ce7ca=_0xd914[_0x45346d];return _0x5ce7ca;};'use strict';var _=require(_0x4d91('0x0'));var util=require(_0x4d91('0x1'));var moment=require('moment');var BPromise=require(_0x4d91('0x2'));var rs=require(_0x4d91('0x3'));var fs=require('fs');var Redis=require(_0x4d91('0x4'));var db=require(_0x4d91('0x5'))['db'];var utils=require(_0x4d91('0x6'));var logger=require(_0x4d91('0x7'))('rpc');var config=require(_0x4d91('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4d91('0x9')][_0x4d91('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x175ce3,_0x27c0d5,_0x22f2a4){return new BPromise(function(_0x150767,_0x3016c0){return client[_0x4d91('0xb')](_0x175ce3,_0x22f2a4)['then'](function(_0x37bde4){logger[_0x4d91('0xc')](_0x4d91('0xd'),_0x27c0d5,_0x4d91('0xe'));logger[_0x4d91('0xf')](_0x4d91('0x10'),_0x27c0d5,'request\x20sent',JSON['stringify'](_0x37bde4));if(_0x37bde4[_0x4d91('0x11')]){if(_0x37bde4[_0x4d91('0x11')][_0x4d91('0x12')]===0x1f4){logger[_0x4d91('0x11')](_0x4d91('0xd'),_0x27c0d5,_0x37bde4[_0x4d91('0x11')]['message']);return _0x3016c0(_0x37bde4['error'][_0x4d91('0x13')]);}logger[_0x4d91('0x11')](_0x4d91('0xd'),_0x27c0d5,_0x37bde4[_0x4d91('0x11')][_0x4d91('0x13')]);return _0x150767(_0x37bde4[_0x4d91('0x11')][_0x4d91('0x13')]);}else{logger['info'](_0x4d91('0xd'),_0x27c0d5,_0x4d91('0xe'));_0x150767(_0x37bde4[_0x4d91('0x14')][_0x4d91('0x13')]);}})[_0x4d91('0x15')](function(_0x554ca8){logger[_0x4d91('0x11')](_0x4d91('0xd'),_0x27c0d5,_0x554ca8);_0x3016c0(_0x554ca8);});});} \ No newline at end of file +var _0x6146=['then','info','request\x20sent','debug','SACompanyType,\x20%s,\x20%s,\x20%s','stringify','error','message','SACompanyType,\x20%s,\x20%s','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x28c534,_0x439c72){var _0x4c8d6b=function(_0x572406){while(--_0x572406){_0x28c534['push'](_0x28c534['shift']());}};_0x4c8d6b(++_0x439c72);}(_0x6146,0xba));var _0x6614=function(_0x3a6db9,_0x686947){_0x3a6db9=_0x3a6db9-0x0;var _0x586d3f=_0x6146[_0x3a6db9];return _0x586d3f;};'use strict';var _=require(_0x6614('0x0'));var util=require('util');var moment=require(_0x6614('0x1'));var BPromise=require(_0x6614('0x2'));var rs=require(_0x6614('0x3'));var fs=require('fs');var Redis=require(_0x6614('0x4'));var db=require(_0x6614('0x5'))['db'];var utils=require(_0x6614('0x6'));var logger=require(_0x6614('0x7'))('rpc');var config=require(_0x6614('0x8'));var jayson=require(_0x6614('0x9'));var client=jayson[_0x6614('0xa')][_0x6614('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b158b,_0x2e84fa,_0x4116e4){return new BPromise(function(_0x209bdd,_0x9bf15){return client['request'](_0x3b158b,_0x4116e4)[_0x6614('0xc')](function(_0x267e1b){logger[_0x6614('0xd')]('SACompanyType,\x20%s,\x20%s',_0x2e84fa,_0x6614('0xe'));logger[_0x6614('0xf')](_0x6614('0x10'),_0x2e84fa,_0x6614('0xe'),JSON[_0x6614('0x11')](_0x267e1b));if(_0x267e1b[_0x6614('0x12')]){if(_0x267e1b[_0x6614('0x12')]['code']===0x1f4){logger[_0x6614('0x12')]('SACompanyType,\x20%s,\x20%s',_0x2e84fa,_0x267e1b[_0x6614('0x12')][_0x6614('0x13')]);return _0x9bf15(_0x267e1b[_0x6614('0x12')][_0x6614('0x13')]);}logger[_0x6614('0x12')](_0x6614('0x14'),_0x2e84fa,_0x267e1b[_0x6614('0x12')][_0x6614('0x13')]);return _0x209bdd(_0x267e1b[_0x6614('0x12')]['message']);}else{logger['info'](_0x6614('0x14'),_0x2e84fa,_0x6614('0xe'));_0x209bdd(_0x267e1b['result'][_0x6614('0x13')]);}})[_0x6614('0x15')](function(_0x3a0fee){logger['error'](_0x6614('0x14'),_0x2e84fa,_0x3a0fee);_0x9bf15(_0x3a0fee);});});} \ No newline at end of file diff --git a/server/api/saCreditNote/index.js b/server/api/saCreditNote/index.js index 9a941c4..8a84f46 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 _0xbda9=['getCreditnotePDF','post','put','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/download'];(function(_0x55822d,_0x58b6ea){var _0x39eb7d=function(_0x2c0408){while(--_0x2c0408){_0x55822d['push'](_0x55822d['shift']());}};_0x39eb7d(++_0x58b6ea);}(_0xbda9,0x101));var _0x9bda=function(_0x27e004,_0x4008cc){_0x27e004=_0x27e004-0x0;var _0x493997=_0xbda9[_0x27e004];return _0x493997;};'use strict';var multer=require(_0x9bda('0x0'));var util=require(_0x9bda('0x1'));var path=require(_0x9bda('0x2'));var timeout=require(_0x9bda('0x3'));var express=require(_0x9bda('0x4'));var router=express[_0x9bda('0x5')]();var auth=require(_0x9bda('0x6'));var interaction=require(_0x9bda('0x7'));var config=require(_0x9bda('0x8'));var controller=require('./saCreditNote.controller');router[_0x9bda('0x9')]('/',auth[_0x9bda('0xa')](),controller[_0x9bda('0xb')]);router['get'](_0x9bda('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x9bda('0x9')](_0x9bda('0xd'),auth['isAuthenticated'](),controller[_0x9bda('0xe')]);router[_0x9bda('0x9')](_0x9bda('0xf'),auth[_0x9bda('0xa')](),controller[_0x9bda('0x10')]);router[_0x9bda('0x11')]('/',auth[_0x9bda('0xa')](),controller['create']);router[_0x9bda('0x12')](_0x9bda('0xd'),auth[_0x9bda('0xa')](),controller['update']);router[_0x9bda('0x13')](_0x9bda('0xd'),auth[_0x9bda('0xa')](),controller['destroy']);module[_0x9bda('0x14')]=router; \ No newline at end of file +var _0x8298=['../../config/environment','./saCreditNote.controller','get','isAuthenticated','index','describe','/:id','show','/:id/download','getCreditnotePDF','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8298,0xd1));var _0x8829=function(_0x5576d1,_0x15347a){_0x5576d1=_0x5576d1-0x0;var _0x3a328c=_0x8298[_0x5576d1];return _0x3a328c;};'use strict';var multer=require(_0x8829('0x0'));var util=require(_0x8829('0x1'));var path=require(_0x8829('0x2'));var timeout=require(_0x8829('0x3'));var express=require(_0x8829('0x4'));var router=express[_0x8829('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x8829('0x6'));var config=require(_0x8829('0x7'));var controller=require(_0x8829('0x8'));router[_0x8829('0x9')]('/',auth[_0x8829('0xa')](),controller[_0x8829('0xb')]);router['get']('/describe',auth[_0x8829('0xa')](),controller[_0x8829('0xc')]);router['get'](_0x8829('0xd'),auth[_0x8829('0xa')](),controller[_0x8829('0xe')]);router['get'](_0x8829('0xf'),auth[_0x8829('0xa')](),controller[_0x8829('0x10')]);router[_0x8829('0x11')]('/',auth[_0x8829('0xa')](),controller[_0x8829('0x12')]);router[_0x8829('0x13')](_0x8829('0xd'),auth[_0x8829('0xa')](),controller[_0x8829('0x14')]);router[_0x8829('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x8829('0x16')]);module[_0x8829('0x17')]=router; \ No newline at end of file diff --git a/server/api/saCreditNote/saCreditNote.attributes.js b/server/api/saCreditNote/saCreditNote.attributes.js index 3bb60e8..555303d 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 _0x1a96=['BOOLEAN','DATE','VIRTUAL','getDataValue','startDate','format','YYYY','number','sequelize','moment','exports','TEXT','INTEGER','DECIMAL','STRING'];(function(_0xa3b952,_0x5d22f1){var _0x4e6e4e=function(_0x6b6fe7){while(--_0x6b6fe7){_0xa3b952['push'](_0xa3b952['shift']());}};_0x4e6e4e(++_0x5d22f1);}(_0x1a96,0x170));var _0x61a9=function(_0x197252,_0x13dca7){_0x197252=_0x197252-0x0;var _0xb90c07=_0x1a96[_0x197252];return _0xb90c07;};'use strict';var Sequelize=require(_0x61a9('0x0'));var moment=require(_0x61a9('0x1'));module[_0x61a9('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'InvoiceId':{'type':Sequelize['INTEGER']},'note':{'type':Sequelize['TEXT']},'agentFullname':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x61a9('0x3')]},'companyName':{'type':Sequelize['STRING'],'allowNull':![]},'companyId':{'type':Sequelize[_0x61a9('0x4')],'allowNull':![]},'paid':{'type':Sequelize[_0x61a9('0x4')],'defaultValue':0x0},'discount':{'type':Sequelize[_0x61a9('0x5')](0xd,0x4)},'receivingStreet':{'type':Sequelize[_0x61a9('0x6')]},'receivingPostalCode':{'type':Sequelize[_0x61a9('0x6')]},'receivingCity':{'type':Sequelize[_0x61a9('0x6')]},'receivingCountry':{'type':Sequelize[_0x61a9('0x6')]},'receivingISOCode':{'type':Sequelize[_0x61a9('0x6')](0x3)},'receivingFiscalCode':{'type':Sequelize[_0x61a9('0x6')](0x32)},'receivingPIVA':{'type':Sequelize['STRING'](0x32)},'receivingSDICode':{'type':Sequelize[_0x61a9('0x6')](0x15)},'receivingFiscalMessage':{'type':Sequelize[_0x61a9('0x6')](0x3e8)},'receivingExpiryDay':{'type':Sequelize[_0x61a9('0x4')]},'receivingEurope':{'type':Sequelize[_0x61a9('0x7')]},'receivingSocCap':{'type':Sequelize[_0x61a9('0x6')](0xff)},'issuerName':{'type':Sequelize['STRING']},'issuerStreet':{'type':Sequelize[_0x61a9('0x6')]},'issuerPostalCode':{'type':Sequelize[_0x61a9('0x6')]},'issuerCity':{'type':Sequelize[_0x61a9('0x6')]},'issuerCountry':{'type':Sequelize['STRING']},'issuerISOCode':{'type':Sequelize[_0x61a9('0x6')](0x3)},'issuerFiscalCode':{'type':Sequelize[_0x61a9('0x6')](0x32)},'issuerPIVA':{'type':Sequelize[_0x61a9('0x6')](0x32)},'issuerSDICode':{'type':Sequelize[_0x61a9('0x6')](0x15)},'issuerFiscalMessage':{'type':Sequelize[_0x61a9('0x6')]},'issuerExpiryDay':{'type':Sequelize[_0x61a9('0x4')]},'issuerEurope':{'type':Sequelize[_0x61a9('0x7')]},'issuerSocCap':{'type':Sequelize[_0x61a9('0x6')](0xff)},'issuerBankAccount':{'type':Sequelize['STRING'](0xff)},'issuerBankName':{'type':Sequelize[_0x61a9('0x6')](0xff)},'issuerBankStreet':{'type':Sequelize[_0x61a9('0x6')]},'issuerBankPostalCode':{'type':Sequelize['STRING']},'issuerBankCity':{'type':Sequelize[_0x61a9('0x6')]},'issuerBankCountry':{'type':Sequelize[_0x61a9('0x6')]},'issuerBankBICSWIFT':{'type':Sequelize[_0x61a9('0x6')]},'issuerBankIBAN':{'type':Sequelize[_0x61a9('0x6')]},'issuerPhone':{'type':Sequelize[_0x61a9('0x6')]},'issuerFax':{'type':Sequelize[_0x61a9('0x6')]},'issuerEmail':{'type':Sequelize['STRING']},'issuerWeb':{'type':Sequelize[_0x61a9('0x6')]},'issuerABI':{'type':Sequelize[_0x61a9('0x6')]},'issuerCAB':{'type':Sequelize['STRING']},'issuerPayPal':{'type':Sequelize['STRING']},'startDate':{'type':Sequelize[_0x61a9('0x8')]},'endDate':{'type':Sequelize[_0x61a9('0x8')]},'beginningCompetence':{'type':Sequelize[_0x61a9('0x8')]},'endCompetence':{'type':Sequelize[_0x61a9('0x8')]},'clientCode':{'type':Sequelize[_0x61a9('0x6')]},'number':{'type':Sequelize[_0x61a9('0x4')]},'numberVirtual':{'type':Sequelize[_0x61a9('0x9')],'get':function(_0x5f5d86){var _0xa91e4e=this[_0x61a9('0xa')](_0x61a9('0xb'));var _0x2de4bd=null;if(!_0xa91e4e){_0x2de4bd=moment()[_0x61a9('0xc')](_0x61a9('0xd'));}else{_0x2de4bd=moment(_0xa91e4e)['format'](_0x61a9('0xd'));}return _0x2de4bd+'/'+this[_0x61a9('0xa')](_0x61a9('0xe'));}}}; \ No newline at end of file +var _0x70c5=['getDataValue','number','sequelize','exports','INTEGER','STRING','TEXT','DECIMAL','BOOLEAN','DATE','VIRTUAL','startDate','format','YYYY'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x70c5,0x16e));var _0x570c=function(_0x48703a,_0x286913){_0x48703a=_0x48703a-0x0;var _0x49c2fc=_0x70c5[_0x48703a];return _0x49c2fc;};'use strict';var Sequelize=require(_0x570c('0x0'));var moment=require('moment');module[_0x570c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'InvoiceId':{'type':Sequelize[_0x570c('0x2')]},'note':{'type':Sequelize['TEXT']},'agentFullname':{'type':Sequelize[_0x570c('0x3')]},'status':{'type':Sequelize[_0x570c('0x4')]},'companyName':{'type':Sequelize[_0x570c('0x3')],'allowNull':![]},'companyId':{'type':Sequelize['INTEGER'],'allowNull':![]},'paid':{'type':Sequelize[_0x570c('0x2')],'defaultValue':0x0},'discount':{'type':Sequelize[_0x570c('0x5')](0xd,0x4)},'receivingStreet':{'type':Sequelize[_0x570c('0x3')]},'receivingPostalCode':{'type':Sequelize[_0x570c('0x3')]},'receivingCity':{'type':Sequelize[_0x570c('0x3')]},'receivingCountry':{'type':Sequelize[_0x570c('0x3')]},'receivingISOCode':{'type':Sequelize['STRING'](0x3)},'receivingFiscalCode':{'type':Sequelize[_0x570c('0x3')](0x32)},'receivingPIVA':{'type':Sequelize[_0x570c('0x3')](0x32)},'receivingSDICode':{'type':Sequelize[_0x570c('0x3')](0x15)},'receivingFiscalMessage':{'type':Sequelize[_0x570c('0x3')](0x3e8)},'receivingExpiryDay':{'type':Sequelize[_0x570c('0x2')]},'receivingEurope':{'type':Sequelize[_0x570c('0x6')]},'receivingSocCap':{'type':Sequelize[_0x570c('0x3')](0xff)},'issuerName':{'type':Sequelize[_0x570c('0x3')]},'issuerStreet':{'type':Sequelize[_0x570c('0x3')]},'issuerPostalCode':{'type':Sequelize[_0x570c('0x3')]},'issuerCity':{'type':Sequelize[_0x570c('0x3')]},'issuerCountry':{'type':Sequelize[_0x570c('0x3')]},'issuerISOCode':{'type':Sequelize[_0x570c('0x3')](0x3)},'issuerFiscalCode':{'type':Sequelize[_0x570c('0x3')](0x32)},'issuerPIVA':{'type':Sequelize[_0x570c('0x3')](0x32)},'issuerSDICode':{'type':Sequelize[_0x570c('0x3')](0x15)},'issuerFiscalMessage':{'type':Sequelize[_0x570c('0x3')]},'issuerExpiryDay':{'type':Sequelize['INTEGER']},'issuerEurope':{'type':Sequelize['BOOLEAN']},'issuerSocCap':{'type':Sequelize[_0x570c('0x3')](0xff)},'issuerBankAccount':{'type':Sequelize[_0x570c('0x3')](0xff)},'issuerBankName':{'type':Sequelize[_0x570c('0x3')](0xff)},'issuerBankStreet':{'type':Sequelize[_0x570c('0x3')]},'issuerBankPostalCode':{'type':Sequelize[_0x570c('0x3')]},'issuerBankCity':{'type':Sequelize[_0x570c('0x3')]},'issuerBankCountry':{'type':Sequelize[_0x570c('0x3')]},'issuerBankBICSWIFT':{'type':Sequelize[_0x570c('0x3')]},'issuerBankIBAN':{'type':Sequelize[_0x570c('0x3')]},'issuerPhone':{'type':Sequelize[_0x570c('0x3')]},'issuerFax':{'type':Sequelize[_0x570c('0x3')]},'issuerEmail':{'type':Sequelize[_0x570c('0x3')]},'issuerWeb':{'type':Sequelize[_0x570c('0x3')]},'issuerABI':{'type':Sequelize[_0x570c('0x3')]},'issuerCAB':{'type':Sequelize[_0x570c('0x3')]},'issuerPayPal':{'type':Sequelize['STRING']},'startDate':{'type':Sequelize[_0x570c('0x7')]},'endDate':{'type':Sequelize['DATE']},'beginningCompetence':{'type':Sequelize[_0x570c('0x7')]},'endCompetence':{'type':Sequelize[_0x570c('0x7')]},'clientCode':{'type':Sequelize['STRING']},'number':{'type':Sequelize['INTEGER']},'numberVirtual':{'type':Sequelize[_0x570c('0x8')],'get':function(_0x359367){var _0x22de21=this['getDataValue'](_0x570c('0x9'));var _0xa8938b=null;if(!_0x22de21){_0xa8938b=moment()[_0x570c('0xa')](_0x570c('0xb'));}else{_0xa8938b=moment(_0x22de21)[_0x570c('0xa')](_0x570c('0xb'));}return _0xa8938b+'/'+this[_0x570c('0xc')](_0x570c('0xd'));}}}; \ No newline at end of file diff --git a/server/api/saCreditNote/saCreditNote.controller.js b/server/api/saCreditNote/saCreditNote.controller.js index b77fe3f..838c01e 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 _0xa221=['VAT\x20number','P.IVA','Tax\x20code','Soc.Cap.\x20fp','Invoice','Fattura','Proforma','Credit\x20note','Nota\x20di\x20credito','Due\x20date','Item','Description','Descrizione','Hrs/Qty','Unit\x20Price','Prezzo\x20Unitario','Sub\x20Total','Sconto','Subtotal','Imponibile','Tasse','Total','Please\x20send\x20PAYMENT\x20to','Account\x20Holder','Conto\x20intestato\x20a','Bank\x20name','Nome\x20banca','Bank\x20Address','Indirizzo\x20banca','ABI','CAB','BIC','SWIF','IBAN','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.','Italy','','\x20','','issuerName','issuerPostalCode','\x20%s','-\x20%s\x20
','issuerCountry','phone',':\x20%s
','issuerPhone','fax','email','%s
','piva','issuerSDICode','issuerSocCap','','','','companyName','receivingStreet','%s\x20-\x20','receivingPostalCode','receivingCountry','','receivingFiscalCode','receivingPIVA','','','','\x20N.%d\x20/\x20%d\x20(id:\x20%d)','number','startDate','YYYY','%s,\x20','issuerCity','DD/MM/YYYY','%s\x20','saExpiryDay','days','','duedate',':\x20%s','','','item','','description','hrsqty','subtotal','netPrice','discount','tax','quantity','%s','productName','productDescription','%d','','toFixed','€','','isNil','receivingFiscalMessage','split\x20payment','','\x20','','','nettopay','','\x20','\x20%s\x20','replace','fromCharCode','','sendpayment',':','issuerBankAccount','','accountholder',':\x20','','bankname','\x20','bankaddress','issuerBankStreet','issuerBankPostalCode','\x20-\x20','issuerBankCity','issuerBankCountry','abi','issuerCAB','bic','swif','issuerBankBICSWIFT','paypal','thank1','','','thank2','','','','toFile','TCL:\x20exports.getCreditnotePDF\x20->\x20saveTo,\x20fileName','download','err','foldername','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','end','status','count','offset','set','Content-Range','json','reject','update','then','destroy','sendStatus','error','stack','name','index','SACreditNote','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','length','find','create','body','catch','describe','getCreditnotePDF','join','server','files','tmp','images','logos','logo-invoice.png','root','paid-invoice.png','format','Credinote_%s-%s.pdf','creditnote','SACreditNoteDetail','log','details','portrait','1cm','footer','contents','default','','','mkdirSync','Phone','Telefono','Fax','Email'];(function(_0x43659a,_0x20156b){var _0x19e45e=function(_0x595a18){while(--_0x595a18){_0x43659a['push'](_0x43659a['shift']());}};_0x19e45e(++_0x20156b);}(_0xa221,0x195));var _0x1a22=function(_0x400934,_0x4848b5){_0x400934=_0x400934-0x0;var _0x49fdfc=_0xa221[_0x400934];return _0x49fdfc;};'use strict';var pdf=require(_0x1a22('0x0'));var emlformat=require(_0x1a22('0x1'));var rimraf=require(_0x1a22('0x2'));var zipdir=require(_0x1a22('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1a22('0x4'));var moment=require(_0x1a22('0x5'));var BPromise=require(_0x1a22('0x6'));var Mustache=require(_0x1a22('0x7'));var util=require(_0x1a22('0x8'));var path=require(_0x1a22('0x9'));var sox=require('sox');var csv=require(_0x1a22('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1a22('0xb'));var squel=require(_0x1a22('0xc'));var crypto=require('crypto');var jsforce=require(_0x1a22('0xd'));var deskjs=require(_0x1a22('0xe'));var toCsv=require(_0x1a22('0xa'));var querystring=require(_0x1a22('0xf'));var Papa=require(_0x1a22('0x10'));var Redis=require(_0x1a22('0x11'));var authService=require(_0x1a22('0x12'));var qs=require(_0x1a22('0x13'));var hardwareService=require(_0x1a22('0x14'));var logger=require('../../config/logger')(_0x1a22('0x15'));var utils=require(_0x1a22('0x16'));var config=require(_0x1a22('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd5dbdd,_0xbf3a86){_0xbf3a86=_0xbf3a86||0xcc;return function(_0x3d5b18){if(_0x3d5b18){return _0xd5dbdd['sendStatus'](_0xbf3a86);}return _0xd5dbdd['status'](_0xbf3a86)[_0x1a22('0x18')]();};}function respondWithResult(_0x456b27,_0x360837){_0x360837=_0x360837||0xc8;return function(_0xf56f5e){if(_0xf56f5e){return _0x456b27[_0x1a22('0x19')](_0x360837)['json'](_0xf56f5e);}};}function respondWithFilteredResult(_0x5200b2,_0x4ac50e){return function(_0x554e1f){if(_0x554e1f){var _0x35c912=_0x554e1f[_0x1a22('0x1a')],_0x4f99ec=_0x4ac50e[_0x1a22('0x1b')],_0x58b3ba=_0x4ac50e['offset']+_0x4ac50e['limit'],_0x4fdd58;if(_0x58b3ba>=_0x35c912){_0x58b3ba=_0x35c912;_0x4fdd58=0xc8;}else{_0x4fdd58=0xce;}_0x5200b2[_0x1a22('0x19')](_0x4fdd58);return _0x5200b2[_0x1a22('0x1c')](_0x1a22('0x1d'),_0x4f99ec+'-'+_0x58b3ba+'/'+_0x35c912)[_0x1a22('0x1e')](_0x554e1f);}return null;};}function patchUpdates(_0x7bab32){return function(_0x2fd0c1){try{jsonpatch['apply'](_0x2fd0c1,_0x7bab32,!![]);}catch(_0x4f16a1){return BPromise[_0x1a22('0x1f')](_0x4f16a1);}return _0x2fd0c1['save']();};}function saveUpdates(_0x583503,_0x2f49c6){return function(_0x3a23f7){if(_0x3a23f7){return _0x3a23f7[_0x1a22('0x20')](_0x583503)[_0x1a22('0x21')](function(_0x1e93da){return _0x1e93da;});}return null;};}function removeEntity(_0x53fe9a,_0x4d9fb0){return function(_0x58bdee){if(_0x58bdee){return _0x58bdee[_0x1a22('0x22')]()[_0x1a22('0x21')](function(){_0x53fe9a[_0x1a22('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xcb2e71,_0x3c8632){return function(_0x35e3a0){if(!_0x35e3a0){_0xcb2e71[_0x1a22('0x23')](0x194);}return _0x35e3a0;};}function handleError(_0x2b6804,_0x1821cc){_0x1821cc=_0x1821cc||0x1f4;return function(_0x60a2e6){logger[_0x1a22('0x24')](_0x60a2e6[_0x1a22('0x25')]);if(_0x60a2e6['name']){delete _0x60a2e6[_0x1a22('0x26')];}_0x2b6804['status'](_0x1821cc)['send'](_0x60a2e6);};}exports[_0x1a22('0x27')]=function(_0x5c4e64,_0x448235){var _0x781a20={},_0xd1e766={},_0x2d9039={'count':0x0,'rows':[]};var _0xf0fe5c=db[_0x1a22('0x28')][_0x1a22('0x29')];_0xd1e766[_0x1a22('0x2a')]=_[_0x1a22('0x2b')](_0xf0fe5c);_0xd1e766[_0x1a22('0x2c')]=_[_0x1a22('0x2b')](_0x5c4e64['query']);_0xd1e766[_0x1a22('0x2d')]=_[_0x1a22('0x2e')](_0xd1e766['model'],_0xd1e766['query']);_0x781a20[_0x1a22('0x2f')]=_[_0x1a22('0x2e')](_0xd1e766['model'],qs[_0x1a22('0x30')](_0x5c4e64['query'][_0x1a22('0x30')]));_0x781a20[_0x1a22('0x2f')]=_0x781a20['attributes']['length']?_0x781a20[_0x1a22('0x2f')]:_0xd1e766[_0x1a22('0x2a')];if(!_0x5c4e64[_0x1a22('0x2c')][_0x1a22('0x31')](_0x1a22('0x32'))){_0x781a20[_0x1a22('0x33')]=qs['limit'](_0x5c4e64[_0x1a22('0x2c')]['limit']);_0x781a20[_0x1a22('0x1b')]=qs['offset'](_0x5c4e64[_0x1a22('0x2c')][_0x1a22('0x1b')]);}_0x781a20[_0x1a22('0x34')]=qs[_0x1a22('0x35')](_0x5c4e64[_0x1a22('0x2c')][_0x1a22('0x35')]);_0x781a20[_0x1a22('0x36')]=qs['filters'](_[_0x1a22('0x37')](_0x5c4e64[_0x1a22('0x2c')],_0xd1e766['filters']));if(_0x5c4e64[_0x1a22('0x2c')][_0x1a22('0x38')]){_0x781a20['where']=_[_0x1a22('0x39')](_0x781a20[_0x1a22('0x36')],{'$or':_[_0x1a22('0x3a')](_0xf0fe5c,function(_0x302a31){if(_0x302a31['type'][_0x1a22('0x3b')]!==_0x1a22('0x3c')){var _0x16e0e2={};_0x16e0e2[_0x302a31[_0x1a22('0x3d')]]={'$like':'%'+_0x5c4e64[_0x1a22('0x2c')][_0x1a22('0x38')]+'%'};return _0x16e0e2;}})});}_0x781a20=_['merge']({},_0x781a20,_0x5c4e64[_0x1a22('0x3e')]);var _0x3449ad={'where':_0x781a20[_0x1a22('0x36')]};return db[_0x1a22('0x28')]['count'](_0x3449ad)[_0x1a22('0x21')](function(_0x47d1b3){_0x2d9039[_0x1a22('0x1a')]=_0x47d1b3;if(_0x5c4e64[_0x1a22('0x2c')][_0x1a22('0x3f')]){_0x781a20[_0x1a22('0x40')]=[{'all':!![]}];}return db[_0x1a22('0x28')][_0x1a22('0x41')](_0x781a20);})['then'](function(_0x296627){_0x2d9039[_0x1a22('0x42')]=_0x296627;return _0x2d9039;})[_0x1a22('0x21')](respondWithFilteredResult(_0x448235,_0x781a20))['catch'](handleError(_0x448235,null));};exports[_0x1a22('0x43')]=function(_0x164322,_0x4b9334){var _0x22aeaf={'raw':![],'where':{'id':_0x164322[_0x1a22('0x44')]['id']}},_0x5a83cf={};_0x5a83cf[_0x1a22('0x2a')]=_[_0x1a22('0x2b')](db['SACreditNote'][_0x1a22('0x29')]);_0x5a83cf[_0x1a22('0x2c')]=_[_0x1a22('0x2b')](_0x164322[_0x1a22('0x2c')]);_0x5a83cf[_0x1a22('0x2d')]=_['intersection'](_0x5a83cf[_0x1a22('0x2a')],_0x5a83cf['query']);_0x22aeaf[_0x1a22('0x2f')]=_[_0x1a22('0x2e')](_0x5a83cf[_0x1a22('0x2a')],qs[_0x1a22('0x30')](_0x164322['query'][_0x1a22('0x30')]));_0x22aeaf[_0x1a22('0x2f')]=_0x22aeaf['attributes'][_0x1a22('0x45')]?_0x22aeaf['attributes']:_0x5a83cf['model'];if(_0x164322[_0x1a22('0x2c')][_0x1a22('0x3f')]){_0x22aeaf[_0x1a22('0x40')]=[{'all':!![]}];}_0x22aeaf=_[_0x1a22('0x39')]({},_0x22aeaf,_0x164322[_0x1a22('0x3e')]);return db[_0x1a22('0x28')][_0x1a22('0x46')](_0x22aeaf)['then'](handleEntityNotFound(_0x4b9334,null))['then'](respondWithResult(_0x4b9334,null))['catch'](handleError(_0x4b9334,null));};exports['create']=function(_0x3fce0c,_0x357f85){return db[_0x1a22('0x28')][_0x1a22('0x47')](_0x3fce0c[_0x1a22('0x48')],{})[_0x1a22('0x21')](respondWithResult(_0x357f85,0xc9))[_0x1a22('0x49')](handleError(_0x357f85,null));};exports['update']=function(_0x302c5b,_0x4e3a36){if(_0x302c5b[_0x1a22('0x48')]['id']){delete _0x302c5b[_0x1a22('0x48')]['id'];}return db['SACreditNote'][_0x1a22('0x46')]({'where':{'id':_0x302c5b[_0x1a22('0x44')]['id']}})[_0x1a22('0x21')](handleEntityNotFound(_0x4e3a36,null))[_0x1a22('0x21')](saveUpdates(_0x302c5b[_0x1a22('0x48')],null))[_0x1a22('0x21')](respondWithResult(_0x4e3a36,null))[_0x1a22('0x49')](handleError(_0x4e3a36,null));};exports[_0x1a22('0x22')]=function(_0x4426f1,_0x20deea){return db['SACreditNote']['find']({'where':{'id':_0x4426f1['params']['id']}})['then'](handleEntityNotFound(_0x20deea,null))[_0x1a22('0x21')](removeEntity(_0x20deea,null))[_0x1a22('0x49')](handleError(_0x20deea,null));};exports['describe']=function(_0xf88792,_0x432d71){return db[_0x1a22('0x28')][_0x1a22('0x4a')]()['then'](respondWithResult(_0x432d71,null))[_0x1a22('0x49')](handleError(_0x432d71,null));};exports[_0x1a22('0x4b')]=function(_0x12e6fe,_0x464db9){var _0x2d6e64=moment()['unix']()['toString']();var _0x51318c=path[_0x1a22('0x4c')](config['root'],_0x1a22('0x4d'),_0x1a22('0x4e'),_0x1a22('0x4f'));var _0x412bf2=path[_0x1a22('0x4c')](config['root'],_0x1a22('0x4d'),'files',_0x1a22('0x50'),_0x1a22('0x51'),_0x1a22('0x52'));var _0x28fbf5=path['join'](config[_0x1a22('0x53')],_0x1a22('0x4d'),'files',_0x1a22('0x50'),'logos',_0x1a22('0x54'));var _0x3a0cd0=path[_0x1a22('0x4c')](_0x51318c,_0x2d6e64);var _0x314d1a=util[_0x1a22('0x55')](_0x1a22('0x56'),_0x12e6fe[_0x1a22('0x44')]['id'],_0x2d6e64);var _0xe8ae32=path[_0x1a22('0x4c')](_0x3a0cd0,_0x314d1a);var _0x148916=![];var _0x2c46b={};return db['SACreditNote'][_0x1a22('0x46')]({'where':{'id':_0x12e6fe[_0x1a22('0x44')]['id']},'raw':!![],'debugging':!![]})[_0x1a22('0x21')](handleEntityNotFound(_0x464db9,null))[_0x1a22('0x21')](function(_0x1bfed6){if(_0x1bfed6){_0x2c46b[_0x1a22('0x57')]=_0x1bfed6;return db[_0x1a22('0x58')][_0x1a22('0x41')]({'where':{'CreditNoteId':_0x1bfed6['id']},'raw':!![],'logging':console[_0x1a22('0x59')]})[_0x1a22('0x21')](function(_0x5e0652){_0x2c46b[_0x1a22('0x5a')]=_0x5e0652;_0x148916=!![];var _0x46496a='';var _0x4ab2f7={'format':'A4','orientation':_0x1a22('0x5b'),'border':_0x1a22('0x5c'),'footer':{'height':'10mm','contents':{'default':'{{page}}/{{pages}}'}}};_0x4ab2f7[_0x1a22('0x5d')][_0x1a22('0x5e')][_0x1a22('0x5f')]=_0x4ab2f7[_0x1a22('0x5d')][_0x1a22('0x5e')]['default']+_0x1a22('0x60')+_0x2c46b[_0x1a22('0x57')]['issuerWeb']+_0x1a22('0x61');fs[_0x1a22('0x62')](_0x3a0cd0);_0x46496a='';_0x46496a+='\x0a\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20body\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\x20\x20\x20\x20\x20\x20font-family:\x20Roboto,\x20\x27Segoe\x20UI\x27,\x20Tahoma,\x20sans-serif;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.itemTabTitle\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\x20\x20\x20\x20\x20\x20background-color:\x20lightgray;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20height:\x2040px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.issuerInfo\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\x20\x20\x20\x20\x20\x20color:\x20lightgray;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20padding-top:\x2020px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20padding-bottom:\x2020px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-size:\x2010px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.issuerData\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\x20\x20\x20\x20\x20\x20font-weight:\x20normal\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.issuerFiled\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\x20\x20\x20\x20\x20\x20font-weight:\x20bold;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-size:\x2010px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20padding-left:\x2010px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.issuerFiledWeb\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\x20\x20\x20\x20\x20\x20font-weight:\x20bold;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20text-align:\x20center;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.receiperInfo\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\x20\x20\x20\x20\x20\x20text-align:\x20right;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-size:\x2012px\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.receiperCompanyName\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\x20\x20\x20\x20\x20\x20font-weight:\x20bolder;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20padding-bottom:\x2010px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-size:\x2010px\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.reciperFiscalInfo\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\x20\x20\x20\x20\x20\x20padding-top:\x205px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20padding-bottom:\x205px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x20\x20\x20\x20\x20\x20font-size:\x2010px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20table.center\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\x20\x20\x20\x20\x20\x20margin-left:\x20auto;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20margin-right:\x20auto;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20width:\x2090%;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.total\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\x20\x20\x20\x20\x20\x20background-color:\x20lightgray;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-size:\x2018px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-weight:\x20bold;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.totalText\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\x20\x20\x20\x20\x20\x20background-color:\x20lightgray;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20text-align:\x20right;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-size:\x2016px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20padding-right:\x2010px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.totalEmpty\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\x20\x20\x20\x20\x20\x20background-color:\x20#ffffff;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.invoiceNumber\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\x20\x20\x20\x20\x20\x20font-weight:\x20bolder;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-size:\x2024px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20padding-bottom:\x2020px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.invoiceNumber\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\x20\x20\x20\x20\x20\x20font-weight:\x20bold;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-size:\x2018px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.createdDate\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\x20\x20\x20\x20\x20\x20font-size:\x2014px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20padding-top:\x2020px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20padding-bottom:\x2020px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.duedDate\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\x20\x20\x20\x20\x20\x20font-size:\x2014px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20padding-bottom:\x2010px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.TFtable\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\x20\x20\x20\x20\x20\x20width:\x20100%;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-size:\x208px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20border-collapse:\x20collapse;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.TFtable\x20td\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\x20\x20\x20\x20\x20\x20padding:\x207px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.TFtable\x20tr:nth-child(even)\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\x20\x20\x20\x20\x20\x20background:\x20#ffffff;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.TFtable\x20tr:nth-child(odd)\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\x20\x20\x20\x20\x20\x20background:\x20rgb(237,\x20232,\x20232);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.numberRight\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\x20\x20\x20\x20\x20\x20text-align:\x20right;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.numberCenter\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\x20\x20\x20\x20\x20\x20text-align:\x20center\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.currency\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\x20\x20\x20\x20\x20\x20text-align:\x20left;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20table.roundedCorners\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\x20\x20\x20\x20\x20\x20border:\x202px\x20solid\x20lightgray;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20border-radius:\x205px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20border-spacing:\x200;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20width:\x20100%;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-size:\x208px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20table.roundedCorners\x20td,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20table.roundedCorners\x20th\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\x20\x20\x20\x20\x20\x20border-bottom:\x201px\x20solid\x20lightgray;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20padding:\x2010px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20table.roundedCorners\x20tr:last-child>td\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\x20\x20\x20\x20\x20\x20border-bottom:\x20none;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20table.roundedCorners\x20tr:nth-child(even)\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\x20\x20\x20\x20\x20\x20background:\x20#ffffff;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20table.roundedCorners\x20tr:nth-child(odd)\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\x20\x20\x20\x20\x20\x20background:\x20rgb(237,\x20232,\x20232);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.lex\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\x20\x20\x20\x20\x20\x20padding-left:\x2010px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-size:\x2010px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20padding-bottom:\x2020px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.divTotal\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\x20\x20\x20\x20\x20\x20float:\x20right;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20border-radius:\x205px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20border:\x202px\x20solid\x20lightgray;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20padding:\x2010px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20margin-top:\x2030px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.itemTotal\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\x20\x20\x20\x20\x20\x20width:\x20200px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20line-height:\x2030px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.tabTotal\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\x20\x20\x20\x20\x20\x20border-collapse:\x20collapse;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20';_0x46496a+='';var _0x502725={'phone':{'en':_0x1a22('0x63'),'it':_0x1a22('0x64')},'fax':{'en':_0x1a22('0x65'),'it':_0x1a22('0x65')},'email':{'en':_0x1a22('0x66'),'it':_0x1a22('0x66')},'piva':{'en':_0x1a22('0x67'),'it':_0x1a22('0x68')},'cf':{'en':_0x1a22('0x69'),'it':'C.F.'},'sdi':{'en':'I.S.\x20code','it':'Codice\x20S.D.I.'},'cs':{'en':_0x1a22('0x6a'),'it':'Cap.Soc.\x20iv'},'invoice':{'en':_0x1a22('0x6b'),'it':_0x1a22('0x6c')},'proforma':{'en':'Proforma','it':_0x1a22('0x6d')},'creditnote':{'en':_0x1a22('0x6e'),'it':_0x1a22('0x6f')},'duedate':{'en':_0x1a22('0x70'),'it':'Scadenza'},'item':{'en':_0x1a22('0x71'),'it':'Articolo'},'description':{'en':_0x1a22('0x72'),'it':_0x1a22('0x73')},'hrsqty':{'en':_0x1a22('0x74'),'it':'Ore/Qta'},'unitprice':{'en':_0x1a22('0x75'),'it':_0x1a22('0x76')},'subtotal':{'en':_0x1a22('0x77'),'it':'Sub\x20Totale'},'discount':{'en':'Discount','it':_0x1a22('0x78')},'total':{'en':_0x1a22('0x79'),'it':_0x1a22('0x7a')},'tax':{'en':'Tax','it':_0x1a22('0x7b')},'nettopay':{'en':_0x1a22('0x7c'),'it':'Totale'},'sendpayment':{'en':_0x1a22('0x7d'),'it':'Si\x20prega\x20di\x20inviare\x20il\x20pagamento\x20a'},'accountholder':{'en':_0x1a22('0x7e'),'it':_0x1a22('0x7f')},'bankname':{'en':_0x1a22('0x80'),'it':_0x1a22('0x81')},'bankaddress':{'en':_0x1a22('0x82'),'it':_0x1a22('0x83')},'abi':{'en':_0x1a22('0x84'),'it':_0x1a22('0x84')},'cab':{'en':'CAB','it':_0x1a22('0x85')},'bic':{'en':_0x1a22('0x86'),'it':_0x1a22('0x86')},'swif':{'en':_0x1a22('0x87'),'it':_0x1a22('0x87')},'iban':{'en':_0x1a22('0x88'),'it':_0x1a22('0x88')},'paypal':{'en':'Pay\x20via\x20Paypal','it':_0x1a22('0x89')},'thank1':{'en':_0x1a22('0x8a'),'it':_0x1a22('0x8b')},'thank2':{'en':_0x1a22('0x8c'),'it':_0x1a22('0x8d')}};var _0x523aa5='it';if(_0x2c46b[_0x1a22('0x57')]['receivingCountry']!==_0x1a22('0x8e')){_0x523aa5='en';}_0x46496a+=_0x1a22('0x8f');_0x46496a+=_0x1a22('0x90')+_0x412bf2+_0x1a22('0x91');_0x46496a+=_0x1a22('0x92');_0x46496a+=util[_0x1a22('0x55')]('\x20%s
',_0x2c46b[_0x1a22('0x57')][_0x1a22('0x93')]);_0x46496a+=util[_0x1a22('0x55')]('%s
',_0x2c46b[_0x1a22('0x57')]['issuerStreet']);_0x46496a+=util['format']('%s',_0x2c46b['creditnote'][_0x1a22('0x94')]);_0x46496a+=util['format'](_0x1a22('0x95'),_0x2c46b[_0x1a22('0x57')]['issuerCity']);_0x46496a+=util[_0x1a22('0x55')](_0x1a22('0x96'),_0x2c46b[_0x1a22('0x57')][_0x1a22('0x97')]);_0x46496a+=util[_0x1a22('0x55')](_0x1a22('0x96'),_0x2c46b[_0x1a22('0x57')]['issuerCountry']);_0x46496a+=util[_0x1a22('0x55')](_0x502725[_0x1a22('0x98')][_0x523aa5]+_0x1a22('0x99'),_0x2c46b[_0x1a22('0x57')][_0x1a22('0x9a')]);_0x46496a+=util[_0x1a22('0x55')](_0x502725[_0x1a22('0x9b')][_0x523aa5]+_0x1a22('0x99'),_0x2c46b[_0x1a22('0x57')]['issuerFax']);_0x46496a+=util['format'](_0x502725[_0x1a22('0x9c')][_0x523aa5]+_0x1a22('0x9d'),_0x2c46b[_0x1a22('0x57')]['issuerEmail']);_0x46496a+=util[_0x1a22('0x55')](_0x502725[_0x1a22('0x9e')][_0x523aa5]+':\x20%s
',_0x2c46b['creditnote']['issuerPIVA']);_0x46496a+=util['format'](_0x502725['cf'][_0x523aa5]+_0x1a22('0x99'),_0x2c46b[_0x1a22('0x57')]['issuerFiscalCode']);_0x46496a+=util[_0x1a22('0x55')](_0x502725['sdi'][_0x523aa5]+'%s
',_0x2c46b[_0x1a22('0x57')][_0x1a22('0x9f')]);_0x46496a+=util[_0x1a22('0x55')](_0x502725['cs'][_0x523aa5]+':\x20%s
',_0x2c46b[_0x1a22('0x57')][_0x1a22('0xa0')]);_0x46496a+=_0x1a22('0xa1');_0x46496a+=_0x1a22('0xa2');_0x46496a+=_0x1a22('0xa3');_0x46496a+=util[_0x1a22('0x55')]('%s',_0x2c46b[_0x1a22('0x57')][_0x1a22('0xa4')]);_0x46496a+=util[_0x1a22('0x55')]('%s
',_0x2c46b['creditnote'][_0x1a22('0xa5')]);_0x46496a+=util['format'](_0x1a22('0xa6'),_0x2c46b[_0x1a22('0x57')][_0x1a22('0xa7')]);_0x46496a+=util[_0x1a22('0x55')]('%s
',_0x2c46b[_0x1a22('0x57')]['receivingCity']);_0x46496a+=util['format'](_0x1a22('0x9d'),_0x2c46b['creditnote'][_0x1a22('0xa8')]);_0x46496a+=util[_0x1a22('0x55')](_0x1a22('0xa9')+_0x502725['cf'][_0x523aa5]+_0x1a22('0x99'),_0x2c46b[_0x1a22('0x57')][_0x1a22('0xaa')]);_0x46496a+=util[_0x1a22('0x55')](_0x502725[_0x1a22('0x9e')][_0x523aa5]+_0x1a22('0x99'),_0x2c46b[_0x1a22('0x57')][_0x1a22('0xab')]);_0x46496a+=util[_0x1a22('0x55')](_0x502725['sdi'][_0x523aa5]+_0x1a22('0x99'),_0x2c46b[_0x1a22('0x57')]['receivingSDICode']);_0x46496a+=_0x1a22('0xac');_0x46496a+=_0x1a22('0xad');_0x46496a+='';_0x46496a+=_0x1a22('0xae');_0x46496a+=util[_0x1a22('0x55')](''+_0x502725[_0x1a22('0x57')][_0x523aa5]+_0x1a22('0xaf'),_0x1bfed6[_0x1a22('0xb0')],moment(_0x2c46b['creditnote'][_0x1a22('0xb1')])[_0x1a22('0x55')](_0x1a22('0xb2')),_0x2c46b[_0x1a22('0x57')]['id']);_0x46496a+=util[_0x1a22('0x55')](_0x1a22('0xb3'),_0x2c46b[_0x1a22('0x57')][_0x1a22('0xb4')]);var _0x590127=moment(_0x2c46b[_0x1a22('0x57')][_0x1a22('0xb1')])['format'](_0x1a22('0xb5'));_0x46496a+=util[_0x1a22('0x55')](_0x1a22('0xb6'),_0x590127);var _0x4a69a2=moment(_0x2c46b[_0x1a22('0x57')]['updatedAt'])['add'](_0x2c46b[_0x1a22('0x57')][_0x1a22('0xb7')],_0x1a22('0xb8'))[_0x1a22('0x55')](_0x1a22('0xb5'));_0x46496a+=util['format'](_0x1a22('0xb9')+_0x502725[_0x1a22('0xba')][_0x523aa5]+_0x1a22('0xbb'),_0x4a69a2);_0x46496a+=_0x1a22('0xad');_0x46496a+=_0x1a22('0x92');_0x46496a+=_0x1a22('0xae');_0x46496a+=_0x1a22('0xbc');_0x46496a+=_0x1a22('0x92');_0x46496a+=_0x1a22('0xbd')+_0x502725[_0x1a22('0xbe')][_0x523aa5]+_0x1a22('0xbf');_0x46496a+=_0x1a22('0xbd')+_0x502725[_0x1a22('0xc0')][_0x523aa5]+_0x1a22('0xbf');_0x46496a+=_0x1a22('0xbd')+_0x502725[_0x1a22('0xc1')][_0x523aa5]+_0x1a22('0xbf');_0x46496a+=''+_0x502725['unitprice'][_0x523aa5]+_0x1a22('0xbf');_0x46496a+=_0x1a22('0xbd')+_0x502725[_0x1a22('0xc2')][_0x523aa5]+_0x1a22('0xbf');_0x46496a+='';var _0x5ab00d=0x0;var _0x5f0067=0x0;for(var _0x5735cb=0x0;_0x5735cb<_0x2c46b[_0x1a22('0x5a')]['length'];_0x5735cb++){var _0x48919d=0x0;var _0x360eb0=0x0;var _0x705c8e=0x0;var _0x2e6fe5=0x0;_0x48919d=_0x2c46b[_0x1a22('0x5a')][_0x5735cb][_0x1a22('0xc3')]-_0x2c46b['details'][_0x5735cb]['netPrice']/0x64*_0x2c46b['details'][_0x5735cb][_0x1a22('0xc4')];_0x360eb0=_0x48919d/0x64*_0x2c46b[_0x1a22('0x5a')][_0x5735cb][_0x1a22('0xc5')];_0x705c8e=_0x48919d*_0x2c46b[_0x1a22('0x5a')][_0x5735cb][_0x1a22('0xc6')];_0x2e6fe5=_0x360eb0*_0x2c46b['details'][_0x5735cb][_0x1a22('0xc6')];_0x46496a+=_0x1a22('0x92');_0x46496a+=util['format'](_0x1a22('0xc7'),_0x2c46b[_0x1a22('0x5a')][_0x5735cb][_0x1a22('0xc8')]);_0x46496a+=util[_0x1a22('0x55')](_0x1a22('0xc7'),_0x2c46b[_0x1a22('0x5a')][_0x5735cb][_0x1a22('0xc9')]);_0x46496a+=util[_0x1a22('0x55')](_0x1a22('0xca'),_0x2c46b['details'][_0x5735cb][_0x1a22('0xc6')]);_0x46496a+=_0x1a22('0xcb')+_0x48919d[_0x1a22('0xcc')](0x2)+_0x1a22('0xcd');_0x46496a+=_0x1a22('0xcb')+_0x705c8e[_0x1a22('0xcc')](0x2)+_0x1a22('0xcd');_0x46496a+=_0x1a22('0xad');_0x5ab00d+=_0x705c8e;_0x5f0067+=_0x2e6fe5;}_0x46496a+=_0x1a22('0xce');if(!_[_0x1a22('0xcf')](_0x2c46b[_0x1a22('0x57')][_0x1a22('0xc4')])){var _0x4bafe6=0x0;var _0x110457=0x0;var _0x2e2c44=_0x2c46b[_0x1a22('0x57')]['discount']*0x64/_0x5ab00d;for(var _0x5735cb=0x0;_0x5735cb<_0x2c46b[_0x1a22('0x5a')][_0x1a22('0x45')];_0x5735cb++){var _0xcd1cdd=0x0;var _0x17292d=0x0;var _0x5c9529=0x0;_0x48919d=_0x2c46b['details'][_0x5735cb][_0x1a22('0xc3')]-_0x2c46b[_0x1a22('0x5a')][_0x5735cb][_0x1a22('0xc3')]/0x64*_0x2c46b['details'][_0x5735cb]['discount'];_0xcd1cdd=_0x48919d/0x64*_0x2e2c44;_0x17292d=_0x48919d-_0xcd1cdd;_0x5c9529=_0x17292d*_0x2c46b[_0x1a22('0x5a')][_0x5735cb][_0x1a22('0xc6')];_0x4bafe6+=_0x5c9529;_0x110457+=_0x5c9529/0x64*_0x2c46b[_0x1a22('0x5a')][_0x5735cb][_0x1a22('0xc5')];}}var _0x48a6c8=0x0;var _0x377545=0x0;var _0x4538fe=![];var _0x1a8aa3=_0x2c46b[_0x1a22('0x57')][_0x1a22('0xd0')];console[_0x1a22('0x59')]('');if(_0x1a8aa3['indexOf'](_0x1a22('0xd1'))!=-0x1){_0x4538fe=!![];}if(!_[_0x1a22('0xcf')](_0x2c46b[_0x1a22('0x57')]['discount'])){_0x46496a+='';if(_0x2c46b[_0x1a22('0x57')][_0x1a22('0xc4')]>0x0){_0x46496a+=_0x1a22('0xd2')+_0x502725[_0x1a22('0xc4')][_0x523aa5]+'';_0x46496a+=_0x1a22('0xd3')+_0x2c46b[_0x1a22('0x57')][_0x1a22('0xc4')][_0x1a22('0xcc')](0x2)+_0x1a22('0xcd');}_0x46496a+='';_0x48a6c8=_0x110457;_0x377545=_0x4bafe6;}else{_0x48a6c8=_0x5f0067;_0x377545=_0x5ab00d;}if(_0x48a6c8>0x0||_0x2c46b[_0x1a22('0x57')][_0x1a22('0xc4')]>0x0){_0x46496a+=_0x1a22('0x92');_0x46496a+=_0x1a22('0xd4')+_0x502725['total'][_0x523aa5]+_0x1a22('0xa1');_0x46496a+=_0x1a22('0xcb')+_0x377545['toFixed'](0x2)+_0x1a22('0xcd');_0x46496a+=_0x1a22('0xad');}if(_0x48a6c8>0x0){_0x46496a+='';_0x46496a+=_0x1a22('0xd4')+_0x502725[_0x1a22('0xc5')][_0x523aa5]+_0x1a22('0xa1');_0x46496a+=_0x1a22('0xcb')+_0x48a6c8['toFixed'](0x2)+_0x1a22('0xcd');_0x46496a+=_0x1a22('0xad');}_0x46496a+='';var _0x533c4c;if(_0x4538fe){_0x533c4c=_0x377545;}else{_0x533c4c=_0x377545+_0x48a6c8;}_0x46496a+=_0x1a22('0xd5')+_0x502725[_0x1a22('0xd6')][_0x523aa5]+_0x1a22('0xd7')+_0x533c4c['toFixed'](0x2)+_0x1a22('0xcd');_0x46496a+=_0x1a22('0xd8');_0x46496a+=' ';_0x46496a+='';_0x46496a+='';_0x46496a+=util[_0x1a22('0x55')](_0x1a22('0xd9'),_0x2c46b['creditnote'][_0x1a22('0xd0')][_0x1a22('0xda')](new RegExp(String[_0x1a22('0xdb')](0xd),'g'),_0x1a22('0xdc')));_0x46496a+=_0x1a22('0xad');_0x46496a+=_0x1a22('0x92');_0x46496a+=_0x1a22('0xae');_0x46496a+=''+_0x502725[_0x1a22('0xdd')][_0x523aa5]+_0x1a22('0xde');if(!_[_0x1a22('0xcf')](_0x2c46b[_0x1a22('0x57')][_0x1a22('0xdf')])){_0x46496a+=_0x1a22('0xe0')+_0x502725[_0x1a22('0xe1')][_0x523aa5]+_0x1a22('0xe2')+_0x2c46b[_0x1a22('0x57')][_0x1a22('0xdf')]+_0x1a22('0xe3');_0x46496a+=_0x1a22('0xe0')+_0x502725[_0x1a22('0xe4')][_0x523aa5]+_0x1a22('0xe2')+_0x2c46b[_0x1a22('0x57')]['issuerBankName']+_0x1a22('0xe5');_0x46496a+=_0x1a22('0xe0')+_0x502725[_0x1a22('0xe6')][_0x523aa5]+_0x1a22('0xe2')+_0x2c46b['creditnote'][_0x1a22('0xe7')]+',\x20'+_0x2c46b[_0x1a22('0x57')][_0x1a22('0xe8')]+_0x1a22('0xe9')+_0x2c46b['creditnote'][_0x1a22('0xea')]+'\x20('+_0x2c46b['creditnote'][_0x1a22('0xeb')]+')'+_0x1a22('0xe3');_0x46496a+=_0x1a22('0xe0')+_0x502725[_0x1a22('0xec')][_0x523aa5]+'/'+_0x502725['cab'][_0x523aa5]+':\x20'+_0x2c46b[_0x1a22('0x57')]['issuerABI']+'/'+_0x2c46b['creditnote'][_0x1a22('0xed')]+_0x1a22('0xe3');_0x46496a+=_0x1a22('0xe0')+_0x502725[_0x1a22('0xee')][_0x523aa5]+'/'+_0x502725[_0x1a22('0xef')][_0x523aa5]+_0x1a22('0xe2')+_0x2c46b[_0x1a22('0x57')][_0x1a22('0xf0')]+_0x1a22('0xe3');_0x46496a+=_0x1a22('0xe0')+_0x502725['iban'][_0x523aa5]+':\x20'+_0x2c46b[_0x1a22('0x57')]['issuerBankIBAN']+_0x1a22('0xe3');}if(!_['isNil'](_0x2c46b['creditnote']['issuerPayPal'])){_0x46496a+=_0x1a22('0xe0')+_0x502725[_0x1a22('0xf1')][_0x523aa5]+_0x1a22('0xe2')+_0x2c46b[_0x1a22('0x57')]['issuerPayPal']+_0x1a22('0xe3');}_0x46496a+=_0x1a22('0xe0')+_0x502725[_0x1a22('0xf2')][_0x523aa5]+_0x1a22('0xf3')+_0x4a69a2+_0x1a22('0xf4')+_0x502725[_0x1a22('0xf5')][_0x523aa5]+_0x1a22('0x61');_0x46496a+=_0x1a22('0xa1');_0x46496a+='';_0x46496a+=_0x1a22('0xf6');_0x46496a+=_0x1a22('0xf7');_0x46496a+=_0x1a22('0xf8');return new BPromise(function(_0xe0a8c3,_0x31163a){pdf['create'](_0x46496a,_0x4ab2f7)[_0x1a22('0xf9')](path['join'](_0x3a0cd0,_0x314d1a),function(_0x1b54d4,_0x26efbd){if(_0x1b54d4)return _0x31163a(_0x1b54d4);_0xe0a8c3(_0x26efbd);});});});}})[_0x1a22('0x21')](function(){if(_0x148916){console[_0x1a22('0x59')](_0x1a22('0xfa'),_0xe8ae32,_0x314d1a);return _0x464db9[_0x1a22('0xfb')](_0xe8ae32,_0x314d1a,function(_0x594ca9){if(_0x594ca9){console['log'](_0x1a22('0xfc'),_0x594ca9);}else{console['log'](_0x1a22('0xfd'),_0x3a0cd0);rimraf(_0x3a0cd0,function(){});}});}else{return _0x464db9[_0x1a22('0x23')](0xc8);}})[_0x1a22('0x49')](handleError(_0x464db9,null));}; \ No newline at end of file +var _0x1e46=['accountholder',':\x20','','bankname','issuerBankName','\x20','bankaddress','issuerBankStreet','issuerBankPostalCode','\x20-\x20','issuerBankCountry','abi','cab','issuerCAB','bic','swif','issuerBankBICSWIFT','iban','issuerPayPal','paypal','thank1','','','thank2','
','','toFile','TCL:\x20exports.getCreditnotePDF\x20->\x20saveTo,\x20fileName','download','err','foldername','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','Content-Range','reject','save','update','then','destroy','error','name','send','index','SACreditNote','rawAttributes','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','filters','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','rows','catch','show','params','find','create','body','describe','getCreditnotePDF','unix','toString','join','root','server','files','tmp','images','logos','logo-invoice.png','format','creditnote','findAll','portrait','1cm','10mm','{{page}}/{{pages}}','contents','default','footer','','issuerWeb','','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20body\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\x20\x20\x20\x20\x20\x20font-family:\x20Roboto,\x20\x27Segoe\x20UI\x27,\x20Tahoma,\x20sans-serif;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.itemTabTitle\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\x20\x20\x20\x20\x20\x20background-color:\x20lightgray;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20height:\x2040px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.issuerInfo\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\x20\x20\x20\x20\x20\x20color:\x20lightgray;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20padding-top:\x2020px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20padding-bottom:\x2020px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-size:\x2010px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.issuerData\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\x20\x20\x20\x20\x20\x20font-weight:\x20normal\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.issuerFiled\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\x20\x20\x20\x20\x20\x20font-weight:\x20bold;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-size:\x2010px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20padding-left:\x2010px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.issuerFiledWeb\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\x20\x20\x20\x20\x20\x20font-weight:\x20bold;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20text-align:\x20center;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.receiperInfo\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\x20\x20\x20\x20\x20\x20text-align:\x20right;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-size:\x2012px\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.receiperCompanyName\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\x20\x20\x20\x20\x20\x20font-weight:\x20bolder;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20padding-bottom:\x2010px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-size:\x2010px\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.reciperFiscalInfo\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\x20\x20\x20\x20\x20\x20padding-top:\x205px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20padding-bottom:\x205px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x20\x20\x20\x20\x20\x20font-size:\x2010px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20table.center\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\x20\x20\x20\x20\x20\x20margin-left:\x20auto;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20margin-right:\x20auto;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20width:\x2090%;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.total\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\x20\x20\x20\x20\x20\x20background-color:\x20lightgray;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-size:\x2018px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-weight:\x20bold;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.totalText\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\x20\x20\x20\x20\x20\x20background-color:\x20lightgray;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20text-align:\x20right;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-size:\x2016px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20padding-right:\x2010px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.totalEmpty\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\x20\x20\x20\x20\x20\x20background-color:\x20#ffffff;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.invoiceNumber\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\x20\x20\x20\x20\x20\x20font-weight:\x20bolder;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-size:\x2024px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20padding-bottom:\x2020px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.invoiceNumber\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\x20\x20\x20\x20\x20\x20font-weight:\x20bold;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-size:\x2018px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.createdDate\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\x20\x20\x20\x20\x20\x20font-size:\x2014px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20padding-top:\x2020px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20padding-bottom:\x2020px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.duedDate\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\x20\x20\x20\x20\x20\x20font-size:\x2014px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20padding-bottom:\x2010px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.TFtable\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\x20\x20\x20\x20\x20\x20width:\x20100%;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-size:\x208px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20border-collapse:\x20collapse;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.TFtable\x20td\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\x20\x20\x20\x20\x20\x20padding:\x207px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.TFtable\x20tr:nth-child(even)\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\x20\x20\x20\x20\x20\x20background:\x20#ffffff;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.TFtable\x20tr:nth-child(odd)\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\x20\x20\x20\x20\x20\x20background:\x20rgb(237,\x20232,\x20232);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.numberRight\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\x20\x20\x20\x20\x20\x20text-align:\x20right;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.numberCenter\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\x20\x20\x20\x20\x20\x20text-align:\x20center\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.currency\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\x20\x20\x20\x20\x20\x20text-align:\x20left;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20table.roundedCorners\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\x20\x20\x20\x20\x20\x20border:\x202px\x20solid\x20lightgray;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20border-radius:\x205px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20border-spacing:\x200;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20width:\x20100%;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-size:\x208px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20table.roundedCorners\x20td,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20table.roundedCorners\x20th\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\x20\x20\x20\x20\x20\x20border-bottom:\x201px\x20solid\x20lightgray;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20padding:\x2010px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20table.roundedCorners\x20tr:last-child>td\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\x20\x20\x20\x20\x20\x20border-bottom:\x20none;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20table.roundedCorners\x20tr:nth-child(even)\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\x20\x20\x20\x20\x20\x20background:\x20#ffffff;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20table.roundedCorners\x20tr:nth-child(odd)\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\x20\x20\x20\x20\x20\x20background:\x20rgb(237,\x20232,\x20232);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.lex\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\x20\x20\x20\x20\x20\x20padding-left:\x2010px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-size:\x2010px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20padding-bottom:\x2020px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.divTotal\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\x20\x20\x20\x20\x20\x20float:\x20right;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20border-radius:\x205px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20border:\x202px\x20solid\x20lightgray;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20padding:\x2010px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20margin-top:\x2030px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.itemTotal\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\x20\x20\x20\x20\x20\x20width:\x20200px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20line-height:\x2030px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20.tabTotal\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\x20\x20\x20\x20\x20\x20border-collapse:\x20collapse;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','','Phone','Telefono','Fax','Email','VAT\x20number','P.IVA','C.F.','I.S.\x20code','Codice\x20S.D.I.','Soc.Cap.\x20fp','Cap.Soc.\x20iv','Invoice','Fattura','Credit\x20note','Nota\x20di\x20credito','Due\x20date','Ore/Qta','Unit\x20Price','Prezzo\x20Unitario','Discount','Sconto','Tax','Tasse','Total','Totale','Please\x20send\x20PAYMENT\x20to','Account\x20Holder','Conto\x20intestato\x20a','Bank\x20name','Nome\x20banca','Bank\x20Address','Indirizzo\x20banca','ABI','CAB','BIC','IBAN','Pay\x20via\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','Italy','','\x20','issuerName','%s
','issuerStreet','issuerPostalCode','\x20%s','issuerCountry','phone',':\x20%s
','issuerPhone','fax','issuerFax','email','piva','issuerFiscalCode','sdi','issuerSocCap','','','%s','companyName','%s\x20-\x20','receivingPostalCode','','receivingFiscalCode','receivingPIVA','','','','\x20N.%d\x20/\x20%d\x20(id:\x20%d)','%s,\x20','issuerCity','startDate','%s\x20','saExpiryDay','',':\x20%s','','','item','','description','hrsqty','unitprice','details','netPrice','discount','tax','quantity','%s','productName','%d','','toFixed','€','','receivingFiscalMessage','log','indexOf','split\x20payment','isNil','\x20','','total','','nettopay','','\x20',' ','','replace','fromCharCode','','',':','issuerBankAccount'];(function(_0x431e64,_0x428401){var _0x3d0d7c=function(_0x27f9f8){while(--_0x27f9f8){_0x431e64['push'](_0x431e64['shift']());}};_0x3d0d7c(++_0x428401);}(_0x1e46,0x118));var _0x61e4=function(_0x3b1931,_0x2a88f9){_0x3b1931=_0x3b1931-0x0;var _0x2c28b7=_0x1e46[_0x3b1931];return _0x2c28b7;};'use strict';var pdf=require(_0x61e4('0x0'));var emlformat=require(_0x61e4('0x1'));var rimraf=require(_0x61e4('0x2'));var zipdir=require(_0x61e4('0x3'));var jsonpatch=require(_0x61e4('0x4'));var rp=require('request-promise');var moment=require(_0x61e4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x61e4('0x6'));var util=require(_0x61e4('0x7'));var path=require(_0x61e4('0x8'));var sox=require(_0x61e4('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x61e4('0xa'));var squel=require(_0x61e4('0xb'));var crypto=require(_0x61e4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x61e4('0xd'));var toCsv=require(_0x61e4('0xe'));var querystring=require(_0x61e4('0xf'));var Papa=require(_0x61e4('0x10'));var Redis=require(_0x61e4('0x11'));var authService=require(_0x61e4('0x12'));var qs=require(_0x61e4('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x61e4('0x14'))(_0x61e4('0x15'));var utils=require('../../config/utils');var config=require(_0x61e4('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x35e8d4,_0x4c0ed6){_0x4c0ed6=_0x4c0ed6||0xcc;return function(_0xd40df3){if(_0xd40df3){return _0x35e8d4[_0x61e4('0x17')](_0x4c0ed6);}return _0x35e8d4[_0x61e4('0x18')](_0x4c0ed6)[_0x61e4('0x19')]();};}function respondWithResult(_0x27aeee,_0x425ef9){_0x425ef9=_0x425ef9||0xc8;return function(_0xe47aff){if(_0xe47aff){return _0x27aeee[_0x61e4('0x18')](_0x425ef9)[_0x61e4('0x1a')](_0xe47aff);}};}function respondWithFilteredResult(_0x5000e9,_0x1769fc){return function(_0x1d093c){if(_0x1d093c){var _0x472e0a=_0x1d093c[_0x61e4('0x1b')],_0x23b6b4=_0x1769fc[_0x61e4('0x1c')],_0x2733d9=_0x1769fc['offset']+_0x1769fc['limit'],_0x5ad8b0;if(_0x2733d9>=_0x472e0a){_0x2733d9=_0x472e0a;_0x5ad8b0=0xc8;}else{_0x5ad8b0=0xce;}_0x5000e9['status'](_0x5ad8b0);return _0x5000e9['set'](_0x61e4('0x1d'),_0x23b6b4+'-'+_0x2733d9+'/'+_0x472e0a)[_0x61e4('0x1a')](_0x1d093c);}return null;};}function patchUpdates(_0x43bdff){return function(_0x3c962d){try{jsonpatch['apply'](_0x3c962d,_0x43bdff,!![]);}catch(_0x185315){return BPromise[_0x61e4('0x1e')](_0x185315);}return _0x3c962d[_0x61e4('0x1f')]();};}function saveUpdates(_0x188041,_0x2a3e09){return function(_0x17ab0e){if(_0x17ab0e){return _0x17ab0e[_0x61e4('0x20')](_0x188041)[_0x61e4('0x21')](function(_0x2f9735){return _0x2f9735;});}return null;};}function removeEntity(_0x411019,_0x26ea15){return function(_0x34ea50){if(_0x34ea50){return _0x34ea50[_0x61e4('0x22')]()[_0x61e4('0x21')](function(){_0x411019[_0x61e4('0x18')](0xcc)[_0x61e4('0x19')]();});}};}function handleEntityNotFound(_0x131ce0,_0x33a55a){return function(_0x3c8d39){if(!_0x3c8d39){_0x131ce0[_0x61e4('0x17')](0x194);}return _0x3c8d39;};}function handleError(_0x15b31e,_0xb5ddbc){_0xb5ddbc=_0xb5ddbc||0x1f4;return function(_0xb092db){logger[_0x61e4('0x23')](_0xb092db['stack']);if(_0xb092db[_0x61e4('0x24')]){delete _0xb092db[_0x61e4('0x24')];}_0x15b31e['status'](_0xb5ddbc)[_0x61e4('0x25')](_0xb092db);};}exports[_0x61e4('0x26')]=function(_0x4c4a6c,_0x166630){var _0x57087f={},_0xe1e8f2={},_0x3bddb2={'count':0x0,'rows':[]};var _0x22aca0=db[_0x61e4('0x27')][_0x61e4('0x28')];_0xe1e8f2[_0x61e4('0x29')]=_[_0x61e4('0x2a')](_0x22aca0);_0xe1e8f2[_0x61e4('0x2b')]=_[_0x61e4('0x2a')](_0x4c4a6c[_0x61e4('0x2b')]);_0xe1e8f2['filters']=_['intersection'](_0xe1e8f2[_0x61e4('0x29')],_0xe1e8f2['query']);_0x57087f[_0x61e4('0x2c')]=_[_0x61e4('0x2d')](_0xe1e8f2[_0x61e4('0x29')],qs[_0x61e4('0x2e')](_0x4c4a6c[_0x61e4('0x2b')][_0x61e4('0x2e')]));_0x57087f[_0x61e4('0x2c')]=_0x57087f['attributes'][_0x61e4('0x2f')]?_0x57087f[_0x61e4('0x2c')]:_0xe1e8f2[_0x61e4('0x29')];if(!_0x4c4a6c[_0x61e4('0x2b')][_0x61e4('0x30')]('nolimit')){_0x57087f[_0x61e4('0x31')]=qs[_0x61e4('0x31')](_0x4c4a6c[_0x61e4('0x2b')][_0x61e4('0x31')]);_0x57087f[_0x61e4('0x1c')]=qs[_0x61e4('0x1c')](_0x4c4a6c['query'][_0x61e4('0x1c')]);}_0x57087f[_0x61e4('0x32')]=qs[_0x61e4('0x33')](_0x4c4a6c['query']['sort']);_0x57087f[_0x61e4('0x34')]=qs[_0x61e4('0x35')](_['pick'](_0x4c4a6c[_0x61e4('0x2b')],_0xe1e8f2['filters']));if(_0x4c4a6c[_0x61e4('0x2b')][_0x61e4('0x36')]){_0x57087f[_0x61e4('0x34')]=_[_0x61e4('0x37')](_0x57087f[_0x61e4('0x34')],{'$or':_[_0x61e4('0x38')](_0x22aca0,function(_0x570989){if(_0x570989[_0x61e4('0x39')][_0x61e4('0x3a')]!==_0x61e4('0x3b')){var _0x44ecb2={};_0x44ecb2[_0x570989[_0x61e4('0x3c')]]={'$like':'%'+_0x4c4a6c[_0x61e4('0x2b')][_0x61e4('0x36')]+'%'};return _0x44ecb2;}})});}_0x57087f=_[_0x61e4('0x37')]({},_0x57087f,_0x4c4a6c[_0x61e4('0x3d')]);var _0x5be921={'where':_0x57087f['where']};return db[_0x61e4('0x27')]['count'](_0x5be921)[_0x61e4('0x21')](function(_0x2c122c){_0x3bddb2[_0x61e4('0x1b')]=_0x2c122c;if(_0x4c4a6c[_0x61e4('0x2b')][_0x61e4('0x3e')]){_0x57087f[_0x61e4('0x3f')]=[{'all':!![]}];}return db['SACreditNote']['findAll'](_0x57087f);})[_0x61e4('0x21')](function(_0x45bfdf){_0x3bddb2[_0x61e4('0x40')]=_0x45bfdf;return _0x3bddb2;})[_0x61e4('0x21')](respondWithFilteredResult(_0x166630,_0x57087f))[_0x61e4('0x41')](handleError(_0x166630,null));};exports[_0x61e4('0x42')]=function(_0x34b469,_0x3b9959){var _0x4f6bb0={'raw':![],'where':{'id':_0x34b469[_0x61e4('0x43')]['id']}},_0x28cdc0={};_0x28cdc0[_0x61e4('0x29')]=_[_0x61e4('0x2a')](db[_0x61e4('0x27')][_0x61e4('0x28')]);_0x28cdc0[_0x61e4('0x2b')]=_['keys'](_0x34b469[_0x61e4('0x2b')]);_0x28cdc0[_0x61e4('0x35')]=_['intersection'](_0x28cdc0[_0x61e4('0x29')],_0x28cdc0[_0x61e4('0x2b')]);_0x4f6bb0['attributes']=_[_0x61e4('0x2d')](_0x28cdc0[_0x61e4('0x29')],qs[_0x61e4('0x2e')](_0x34b469['query'][_0x61e4('0x2e')]));_0x4f6bb0[_0x61e4('0x2c')]=_0x4f6bb0[_0x61e4('0x2c')][_0x61e4('0x2f')]?_0x4f6bb0[_0x61e4('0x2c')]:_0x28cdc0[_0x61e4('0x29')];if(_0x34b469[_0x61e4('0x2b')][_0x61e4('0x3e')]){_0x4f6bb0[_0x61e4('0x3f')]=[{'all':!![]}];}_0x4f6bb0=_[_0x61e4('0x37')]({},_0x4f6bb0,_0x34b469[_0x61e4('0x3d')]);return db[_0x61e4('0x27')][_0x61e4('0x44')](_0x4f6bb0)[_0x61e4('0x21')](handleEntityNotFound(_0x3b9959,null))['then'](respondWithResult(_0x3b9959,null))[_0x61e4('0x41')](handleError(_0x3b9959,null));};exports[_0x61e4('0x45')]=function(_0x4dd026,_0x348f1d){return db[_0x61e4('0x27')][_0x61e4('0x45')](_0x4dd026[_0x61e4('0x46')],{})[_0x61e4('0x21')](respondWithResult(_0x348f1d,0xc9))[_0x61e4('0x41')](handleError(_0x348f1d,null));};exports[_0x61e4('0x20')]=function(_0x39c7b7,_0x20306e){if(_0x39c7b7[_0x61e4('0x46')]['id']){delete _0x39c7b7[_0x61e4('0x46')]['id'];}return db[_0x61e4('0x27')]['find']({'where':{'id':_0x39c7b7['params']['id']}})[_0x61e4('0x21')](handleEntityNotFound(_0x20306e,null))[_0x61e4('0x21')](saveUpdates(_0x39c7b7[_0x61e4('0x46')],null))[_0x61e4('0x21')](respondWithResult(_0x20306e,null))[_0x61e4('0x41')](handleError(_0x20306e,null));};exports['destroy']=function(_0x3e2227,_0x1ca55e){return db['SACreditNote'][_0x61e4('0x44')]({'where':{'id':_0x3e2227[_0x61e4('0x43')]['id']}})['then'](handleEntityNotFound(_0x1ca55e,null))[_0x61e4('0x21')](removeEntity(_0x1ca55e,null))[_0x61e4('0x41')](handleError(_0x1ca55e,null));};exports[_0x61e4('0x47')]=function(_0x37f364,_0x192c91){return db['SACreditNote'][_0x61e4('0x47')]()[_0x61e4('0x21')](respondWithResult(_0x192c91,null))['catch'](handleError(_0x192c91,null));};exports[_0x61e4('0x48')]=function(_0x2e7518,_0x512e35){var _0x36cfdf=moment()[_0x61e4('0x49')]()[_0x61e4('0x4a')]();var _0x3c2376=path[_0x61e4('0x4b')](config[_0x61e4('0x4c')],_0x61e4('0x4d'),_0x61e4('0x4e'),_0x61e4('0x4f'));var _0x3de379=path[_0x61e4('0x4b')](config[_0x61e4('0x4c')],_0x61e4('0x4d'),_0x61e4('0x4e'),_0x61e4('0x50'),_0x61e4('0x51'),_0x61e4('0x52'));var _0xe4ce11=path[_0x61e4('0x4b')](config[_0x61e4('0x4c')],'server','files',_0x61e4('0x50'),_0x61e4('0x51'),'paid-invoice.png');var _0x5e2016=path[_0x61e4('0x4b')](_0x3c2376,_0x36cfdf);var _0x415e48=util[_0x61e4('0x53')]('Credinote_%s-%s.pdf',_0x2e7518[_0x61e4('0x43')]['id'],_0x36cfdf);var _0x401e9b=path[_0x61e4('0x4b')](_0x5e2016,_0x415e48);var _0x2e7743=![];var _0x56f6f1={};return db[_0x61e4('0x27')][_0x61e4('0x44')]({'where':{'id':_0x2e7518[_0x61e4('0x43')]['id']},'raw':!![],'debugging':!![]})[_0x61e4('0x21')](handleEntityNotFound(_0x512e35,null))[_0x61e4('0x21')](function(_0x79f547){if(_0x79f547){_0x56f6f1[_0x61e4('0x54')]=_0x79f547;return db['SACreditNoteDetail'][_0x61e4('0x55')]({'where':{'CreditNoteId':_0x79f547['id']},'raw':!![],'logging':console['log']})[_0x61e4('0x21')](function(_0x386c8d){_0x56f6f1['details']=_0x386c8d;_0x2e7743=!![];var _0x2f766b='';var _0xae343a={'format':'A4','orientation':_0x61e4('0x56'),'border':_0x61e4('0x57'),'footer':{'height':_0x61e4('0x58'),'contents':{'default':_0x61e4('0x59')}}};_0xae343a['footer'][_0x61e4('0x5a')][_0x61e4('0x5b')]=_0xae343a[_0x61e4('0x5c')][_0x61e4('0x5a')][_0x61e4('0x5b')]+_0x61e4('0x5d')+_0x56f6f1[_0x61e4('0x54')][_0x61e4('0x5e')]+_0x61e4('0x5f');fs['mkdirSync'](_0x5e2016);_0x2f766b='';_0x2f766b+=_0x61e4('0x60');_0x2f766b+=_0x61e4('0x61');var _0x120b22={'phone':{'en':_0x61e4('0x62'),'it':_0x61e4('0x63')},'fax':{'en':_0x61e4('0x64'),'it':_0x61e4('0x64')},'email':{'en':_0x61e4('0x65'),'it':'Email'},'piva':{'en':_0x61e4('0x66'),'it':_0x61e4('0x67')},'cf':{'en':'Tax\x20code','it':_0x61e4('0x68')},'sdi':{'en':_0x61e4('0x69'),'it':_0x61e4('0x6a')},'cs':{'en':_0x61e4('0x6b'),'it':_0x61e4('0x6c')},'invoice':{'en':_0x61e4('0x6d'),'it':_0x61e4('0x6e')},'proforma':{'en':'Proforma','it':'Proforma'},'creditnote':{'en':_0x61e4('0x6f'),'it':_0x61e4('0x70')},'duedate':{'en':_0x61e4('0x71'),'it':'Scadenza'},'item':{'en':'Item','it':'Articolo'},'description':{'en':'Description','it':'Descrizione'},'hrsqty':{'en':'Hrs/Qty','it':_0x61e4('0x72')},'unitprice':{'en':_0x61e4('0x73'),'it':_0x61e4('0x74')},'subtotal':{'en':'Sub\x20Total','it':'Sub\x20Totale'},'discount':{'en':_0x61e4('0x75'),'it':_0x61e4('0x76')},'total':{'en':'Subtotal','it':'Imponibile'},'tax':{'en':_0x61e4('0x77'),'it':_0x61e4('0x78')},'nettopay':{'en':_0x61e4('0x79'),'it':_0x61e4('0x7a')},'sendpayment':{'en':_0x61e4('0x7b'),'it':'Si\x20prega\x20di\x20inviare\x20il\x20pagamento\x20a'},'accountholder':{'en':_0x61e4('0x7c'),'it':_0x61e4('0x7d')},'bankname':{'en':_0x61e4('0x7e'),'it':_0x61e4('0x7f')},'bankaddress':{'en':_0x61e4('0x80'),'it':_0x61e4('0x81')},'abi':{'en':_0x61e4('0x82'),'it':'ABI'},'cab':{'en':_0x61e4('0x83'),'it':_0x61e4('0x83')},'bic':{'en':'BIC','it':_0x61e4('0x84')},'swif':{'en':'SWIF','it':'SWIF'},'iban':{'en':_0x61e4('0x85'),'it':_0x61e4('0x85')},'paypal':{'en':_0x61e4('0x86'),'it':'Paga\x20con\x20Paypal'},'thank1':{'en':_0x61e4('0x87'),'it':'Grazie.\x20Prevediamo\x20il\x20pagamento\x20entro\x20'},'thank2':{'en':_0x61e4('0x88'),'it':_0x61e4('0x89')}};var _0xe52463='it';if(_0x56f6f1['creditnote'][_0x61e4('0x8a')]!==_0x61e4('0x8b')){_0xe52463='en';}_0x2f766b+=_0x61e4('0x8c');_0x2f766b+=_0x61e4('0x8d')+_0x3de379+'\x22\x20width=\x22180\x22>';_0x2f766b+=_0x61e4('0x8e');_0x2f766b+=util[_0x61e4('0x53')]('\x20%s
',_0x56f6f1[_0x61e4('0x54')][_0x61e4('0x8f')]);_0x2f766b+=util[_0x61e4('0x53')](_0x61e4('0x90'),_0x56f6f1[_0x61e4('0x54')][_0x61e4('0x91')]);_0x2f766b+=util[_0x61e4('0x53')]('%s',_0x56f6f1[_0x61e4('0x54')][_0x61e4('0x92')]);_0x2f766b+=util['format'](_0x61e4('0x93'),_0x56f6f1[_0x61e4('0x54')]['issuerCity']);_0x2f766b+=util[_0x61e4('0x53')]('-\x20%s\x20
',_0x56f6f1[_0x61e4('0x54')][_0x61e4('0x94')]);_0x2f766b+=util[_0x61e4('0x53')]('-\x20%s\x20
',_0x56f6f1[_0x61e4('0x54')][_0x61e4('0x94')]);_0x2f766b+=util[_0x61e4('0x53')](_0x120b22[_0x61e4('0x95')][_0xe52463]+_0x61e4('0x96'),_0x56f6f1['creditnote'][_0x61e4('0x97')]);_0x2f766b+=util['format'](_0x120b22[_0x61e4('0x98')][_0xe52463]+':\x20%s
',_0x56f6f1[_0x61e4('0x54')][_0x61e4('0x99')]);_0x2f766b+=util[_0x61e4('0x53')](_0x120b22[_0x61e4('0x9a')][_0xe52463]+_0x61e4('0x90'),_0x56f6f1[_0x61e4('0x54')]['issuerEmail']);_0x2f766b+=util[_0x61e4('0x53')](_0x120b22[_0x61e4('0x9b')][_0xe52463]+':\x20%s
',_0x56f6f1[_0x61e4('0x54')]['issuerPIVA']);_0x2f766b+=util[_0x61e4('0x53')](_0x120b22['cf'][_0xe52463]+_0x61e4('0x96'),_0x56f6f1[_0x61e4('0x54')][_0x61e4('0x9c')]);_0x2f766b+=util['format'](_0x120b22[_0x61e4('0x9d')][_0xe52463]+'%s
',_0x56f6f1[_0x61e4('0x54')]['issuerSDICode']);_0x2f766b+=util[_0x61e4('0x53')](_0x120b22['cs'][_0xe52463]+_0x61e4('0x96'),_0x56f6f1[_0x61e4('0x54')][_0x61e4('0x9e')]);_0x2f766b+=_0x61e4('0x9f');_0x2f766b+='
';_0x2f766b+=_0x61e4('0xa0');_0x2f766b+=util[_0x61e4('0x53')](_0x61e4('0xa1'),_0x56f6f1[_0x61e4('0x54')][_0x61e4('0xa2')]);_0x2f766b+=util[_0x61e4('0x53')](_0x61e4('0x90'),_0x56f6f1[_0x61e4('0x54')]['receivingStreet']);_0x2f766b+=util[_0x61e4('0x53')](_0x61e4('0xa3'),_0x56f6f1[_0x61e4('0x54')][_0x61e4('0xa4')]);_0x2f766b+=util[_0x61e4('0x53')](_0x61e4('0x90'),_0x56f6f1[_0x61e4('0x54')]['receivingCity']);_0x2f766b+=util['format'](_0x61e4('0x90'),_0x56f6f1['creditnote'][_0x61e4('0x8a')]);_0x2f766b+=util['format'](_0x61e4('0xa5')+_0x120b22['cf'][_0xe52463]+':\x20%s
',_0x56f6f1[_0x61e4('0x54')][_0x61e4('0xa6')]);_0x2f766b+=util[_0x61e4('0x53')](_0x120b22['piva'][_0xe52463]+':\x20%s
',_0x56f6f1['creditnote'][_0x61e4('0xa7')]);_0x2f766b+=util[_0x61e4('0x53')](_0x120b22['sdi'][_0xe52463]+_0x61e4('0x96'),_0x56f6f1['creditnote']['receivingSDICode']);_0x2f766b+=_0x61e4('0xa8');_0x2f766b+=_0x61e4('0xa9');_0x2f766b+='';_0x2f766b+=_0x61e4('0xaa');_0x2f766b+=util[_0x61e4('0x53')](''+_0x120b22[_0x61e4('0x54')][_0xe52463]+_0x61e4('0xab'),_0x79f547['number'],moment(_0x56f6f1['creditnote']['startDate'])['format']('YYYY'),_0x56f6f1[_0x61e4('0x54')]['id']);_0x2f766b+=util['format'](_0x61e4('0xac'),_0x56f6f1['creditnote'][_0x61e4('0xad')]);var _0xe63ba0=moment(_0x56f6f1[_0x61e4('0x54')][_0x61e4('0xae')])[_0x61e4('0x53')]('DD/MM/YYYY');_0x2f766b+=util[_0x61e4('0x53')](_0x61e4('0xaf'),_0xe63ba0);var _0x1c6607=moment(_0x56f6f1['creditnote']['updatedAt'])['add'](_0x56f6f1[_0x61e4('0x54')][_0x61e4('0xb0')],'days')[_0x61e4('0x53')]('DD/MM/YYYY');_0x2f766b+=util[_0x61e4('0x53')](_0x61e4('0xb1')+_0x120b22['duedate'][_0xe52463]+_0x61e4('0xb2'),_0x1c6607);_0x2f766b+=_0x61e4('0xa9');_0x2f766b+=_0x61e4('0x8e');_0x2f766b+=_0x61e4('0xaa');_0x2f766b+=_0x61e4('0xb3');_0x2f766b+=_0x61e4('0x8e');_0x2f766b+=_0x61e4('0xb4')+_0x120b22[_0x61e4('0xb5')][_0xe52463]+_0x61e4('0xb6');_0x2f766b+=_0x61e4('0xb4')+_0x120b22[_0x61e4('0xb7')][_0xe52463]+_0x61e4('0xb6');_0x2f766b+=_0x61e4('0xb4')+_0x120b22[_0x61e4('0xb8')][_0xe52463]+_0x61e4('0xb6');_0x2f766b+=_0x61e4('0xb4')+_0x120b22[_0x61e4('0xb9')][_0xe52463]+_0x61e4('0xb6');_0x2f766b+=''+_0x120b22['subtotal'][_0xe52463]+_0x61e4('0xb6');_0x2f766b+=_0x61e4('0xa9');var _0xd888f0=0x0;var _0x2eea4b=0x0;for(var _0x317cc4=0x0;_0x317cc4<_0x56f6f1[_0x61e4('0xba')][_0x61e4('0x2f')];_0x317cc4++){var _0x2975a7=0x0;var _0x20a2fd=0x0;var _0x5d69b6=0x0;var _0x2283a8=0x0;_0x2975a7=_0x56f6f1[_0x61e4('0xba')][_0x317cc4][_0x61e4('0xbb')]-_0x56f6f1[_0x61e4('0xba')][_0x317cc4][_0x61e4('0xbb')]/0x64*_0x56f6f1['details'][_0x317cc4][_0x61e4('0xbc')];_0x20a2fd=_0x2975a7/0x64*_0x56f6f1[_0x61e4('0xba')][_0x317cc4][_0x61e4('0xbd')];_0x5d69b6=_0x2975a7*_0x56f6f1[_0x61e4('0xba')][_0x317cc4][_0x61e4('0xbe')];_0x2283a8=_0x20a2fd*_0x56f6f1[_0x61e4('0xba')][_0x317cc4][_0x61e4('0xbe')];_0x2f766b+=_0x61e4('0x8e');_0x2f766b+=util[_0x61e4('0x53')](_0x61e4('0xbf'),_0x56f6f1[_0x61e4('0xba')][_0x317cc4][_0x61e4('0xc0')]);_0x2f766b+=util[_0x61e4('0x53')](_0x61e4('0xbf'),_0x56f6f1[_0x61e4('0xba')][_0x317cc4]['productDescription']);_0x2f766b+=util['format'](_0x61e4('0xc1'),_0x56f6f1['details'][_0x317cc4][_0x61e4('0xbe')]);_0x2f766b+=_0x61e4('0xc2')+_0x2975a7[_0x61e4('0xc3')](0x2)+_0x61e4('0xc4');_0x2f766b+=_0x61e4('0xc2')+_0x5d69b6[_0x61e4('0xc3')](0x2)+_0x61e4('0xc4');_0x2f766b+=_0x61e4('0xa9');_0xd888f0+=_0x5d69b6;_0x2eea4b+=_0x2283a8;}_0x2f766b+=_0x61e4('0xc5');if(!_['isNil'](_0x56f6f1[_0x61e4('0x54')][_0x61e4('0xbc')])){var _0x1304fb=0x0;var _0x4cee3f=0x0;var _0x15e6ae=_0x56f6f1[_0x61e4('0x54')][_0x61e4('0xbc')]*0x64/_0xd888f0;for(var _0x317cc4=0x0;_0x317cc4<_0x56f6f1['details']['length'];_0x317cc4++){var _0x596a8d=0x0;var _0xf6baf7=0x0;var _0x3fbda2=0x0;_0x2975a7=_0x56f6f1[_0x61e4('0xba')][_0x317cc4][_0x61e4('0xbb')]-_0x56f6f1['details'][_0x317cc4]['netPrice']/0x64*_0x56f6f1[_0x61e4('0xba')][_0x317cc4][_0x61e4('0xbc')];_0x596a8d=_0x2975a7/0x64*_0x15e6ae;_0xf6baf7=_0x2975a7-_0x596a8d;_0x3fbda2=_0xf6baf7*_0x56f6f1[_0x61e4('0xba')][_0x317cc4][_0x61e4('0xbe')];_0x1304fb+=_0x3fbda2;_0x4cee3f+=_0x3fbda2/0x64*_0x56f6f1['details'][_0x317cc4][_0x61e4('0xbd')];}}var _0x44d7ef=0x0;var _0x301f70=0x0;var _0x436061=![];var _0x56ea20=_0x56f6f1['creditnote'][_0x61e4('0xc6')];console[_0x61e4('0xc7')]('');if(_0x56ea20[_0x61e4('0xc8')](_0x61e4('0xc9'))!=-0x1){_0x436061=!![];}if(!_[_0x61e4('0xca')](_0x56f6f1[_0x61e4('0x54')][_0x61e4('0xbc')])){_0x2f766b+=_0x61e4('0x8e');if(_0x56f6f1[_0x61e4('0x54')][_0x61e4('0xbc')]>0x0){_0x2f766b+=''+_0x120b22[_0x61e4('0xbc')][_0xe52463]+_0x61e4('0x9f');_0x2f766b+=_0x61e4('0xcb')+_0x56f6f1[_0x61e4('0x54')][_0x61e4('0xbc')][_0x61e4('0xc3')](0x2)+_0x61e4('0xc4');}_0x2f766b+='';_0x44d7ef=_0x4cee3f;_0x301f70=_0x1304fb;}else{_0x44d7ef=_0x2eea4b;_0x301f70=_0xd888f0;}if(_0x44d7ef>0x0||_0x56f6f1[_0x61e4('0x54')][_0x61e4('0xbc')]>0x0){_0x2f766b+=_0x61e4('0x8e');_0x2f766b+=_0x61e4('0xcc')+_0x120b22[_0x61e4('0xcd')][_0xe52463]+_0x61e4('0x9f');_0x2f766b+=''+_0x301f70[_0x61e4('0xc3')](0x2)+'€';_0x2f766b+='';}if(_0x44d7ef>0x0){_0x2f766b+='';_0x2f766b+=''+_0x120b22[_0x61e4('0xbd')][_0xe52463]+'';_0x2f766b+=''+_0x44d7ef[_0x61e4('0xc3')](0x2)+_0x61e4('0xc4');_0x2f766b+=_0x61e4('0xa9');}_0x2f766b+=_0x61e4('0x8e');var _0x8526dd;if(_0x436061){_0x8526dd=_0x301f70;}else{_0x8526dd=_0x301f70+_0x44d7ef;}_0x2f766b+=_0x61e4('0xce')+_0x120b22[_0x61e4('0xcf')][_0xe52463]+_0x61e4('0xd0')+_0x8526dd[_0x61e4('0xc3')](0x2)+_0x61e4('0xc4');_0x2f766b+=_0x61e4('0xd1');_0x2f766b+=_0x61e4('0xd2');_0x2f766b+=_0x61e4('0xd3');_0x2f766b+=_0x61e4('0x8e');_0x2f766b+=util[_0x61e4('0x53')]('\x20%s\x20',_0x56f6f1['creditnote']['receivingFiscalMessage'][_0x61e4('0xd4')](new RegExp(String[_0x61e4('0xd5')](0xd),'g'),_0x61e4('0xd6')));_0x2f766b+=_0x61e4('0xa9');_0x2f766b+=_0x61e4('0x8e');_0x2f766b+=_0x61e4('0xaa');_0x2f766b+=_0x61e4('0xd7')+_0x120b22['sendpayment'][_0xe52463]+_0x61e4('0xd8');if(!_[_0x61e4('0xca')](_0x56f6f1[_0x61e4('0x54')][_0x61e4('0xd9')])){_0x2f766b+=_0x61e4('0xd7')+_0x120b22[_0x61e4('0xda')][_0xe52463]+_0x61e4('0xdb')+_0x56f6f1[_0x61e4('0x54')][_0x61e4('0xd9')]+_0x61e4('0xdc');_0x2f766b+=''+_0x120b22[_0x61e4('0xdd')][_0xe52463]+_0x61e4('0xdb')+_0x56f6f1[_0x61e4('0x54')][_0x61e4('0xde')]+_0x61e4('0xdf');_0x2f766b+=_0x61e4('0xd7')+_0x120b22[_0x61e4('0xe0')][_0xe52463]+':\x20'+_0x56f6f1['creditnote'][_0x61e4('0xe1')]+',\x20'+_0x56f6f1[_0x61e4('0x54')][_0x61e4('0xe2')]+_0x61e4('0xe3')+_0x56f6f1[_0x61e4('0x54')]['issuerBankCity']+'\x20('+_0x56f6f1[_0x61e4('0x54')][_0x61e4('0xe4')]+')'+'';_0x2f766b+=_0x61e4('0xd7')+_0x120b22[_0x61e4('0xe5')][_0xe52463]+'/'+_0x120b22[_0x61e4('0xe6')][_0xe52463]+':\x20'+_0x56f6f1[_0x61e4('0x54')]['issuerABI']+'/'+_0x56f6f1['creditnote'][_0x61e4('0xe7')]+_0x61e4('0xdc');_0x2f766b+=_0x61e4('0xd7')+_0x120b22[_0x61e4('0xe8')][_0xe52463]+'/'+_0x120b22[_0x61e4('0xe9')][_0xe52463]+_0x61e4('0xdb')+_0x56f6f1[_0x61e4('0x54')][_0x61e4('0xea')]+'';_0x2f766b+=_0x61e4('0xd7')+_0x120b22[_0x61e4('0xeb')][_0xe52463]+_0x61e4('0xdb')+_0x56f6f1[_0x61e4('0x54')]['issuerBankIBAN']+_0x61e4('0xdc');}if(!_[_0x61e4('0xca')](_0x56f6f1[_0x61e4('0x54')][_0x61e4('0xec')])){_0x2f766b+=''+_0x120b22[_0x61e4('0xed')][_0xe52463]+_0x61e4('0xdb')+_0x56f6f1[_0x61e4('0x54')][_0x61e4('0xec')]+'';}_0x2f766b+=_0x61e4('0xd7')+_0x120b22[_0x61e4('0xee')][_0xe52463]+_0x61e4('0xef')+_0x1c6607+_0x61e4('0xf0')+_0x120b22[_0x61e4('0xf1')][_0xe52463]+_0x61e4('0x5f');_0x2f766b+=_0x61e4('0x9f');_0x2f766b+=_0x61e4('0xa9');_0x2f766b+=_0x61e4('0xf2');_0x2f766b+=_0x61e4('0xf3');_0x2f766b+='';return new BPromise(function(_0xa25dd7,_0x253a47){pdf['create'](_0x2f766b,_0xae343a)[_0x61e4('0xf4')](path[_0x61e4('0x4b')](_0x5e2016,_0x415e48),function(_0x5938bc,_0x284aeb){if(_0x5938bc)return _0x253a47(_0x5938bc);_0xa25dd7(_0x284aeb);});});});}})[_0x61e4('0x21')](function(){if(_0x2e7743){console[_0x61e4('0xc7')](_0x61e4('0xf5'),_0x401e9b,_0x415e48);return _0x512e35[_0x61e4('0xf6')](_0x401e9b,_0x415e48,function(_0x381791){if(_0x381791){console[_0x61e4('0xc7')](_0x61e4('0xf7'),_0x381791);}else{console[_0x61e4('0xc7')](_0x61e4('0xf8'),_0x5e2016);rimraf(_0x5e2016,function(){});}});}else{return _0x512e35[_0x61e4('0x17')](0xc8);}})[_0x61e4('0x41')](handleError(_0x512e35,null));}; \ No newline at end of file diff --git a/server/api/saCreditNote/saCreditNote.model.js b/server/api/saCreditNote/saCreditNote.model.js index b716e24..cc8ddef 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 _0x55e0=['lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./saCreditNote.attributes','exports','define','sa_creditNotes','get','format','SACreditNoteNumber','transaction','then','number','update','create','log','TCL:\x20error'];(function(_0x4a9fda,_0x375c91){var _0x5db607=function(_0x3d2f2c){while(--_0x3d2f2c){_0x4a9fda['push'](_0x4a9fda['shift']());}};_0x5db607(++_0x375c91);}(_0x55e0,0xdc));var _0x055e=function(_0x4f505c,_0x25be3a){_0x4f505c=_0x4f505c-0x0;var _0x5866c4=_0x55e0[_0x4f505c];return _0x5866c4;};'use strict';var _=require(_0x055e('0x0'));var util=require(_0x055e('0x1'));var logger=require(_0x055e('0x2'))(_0x055e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x055e('0x4'));var fs=require('fs');var path=require(_0x055e('0x5'));var rimraf=require(_0x055e('0x6'));var config=require(_0x055e('0x7'));var attributes=require(_0x055e('0x8'));module[_0x055e('0x9')]=function(_0x490ee1,_0x5239f6){return _0x490ee1[_0x055e('0xa')]('SACreditNote',attributes,{'tableName':_0x055e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3c4cf,_0x376618,_0x230c32){var _0x444c82=_0x490ee1['models'];var _0x40779c=_0x3c4cf[_0x055e('0xc')]({'plain':!![]});var _0xb816c=0x1;var _0xa0d384=parseInt(moment()[_0x055e('0xd')]('YYYY'));try{if(_['has'](_0x40779c,'id')){return _0x444c82[_0x055e('0xe')]['findOne']({'where':{'year':_0xa0d384},'raw':!![],'logging':!![],'transaction':_0x376618[_0x055e('0xf')]})[_0x055e('0x10')](function(_0x72d424){if(_0x72d424){_0xb816c=_0x72d424[_0x055e('0x11')]+0x1;return _0x444c82[_0x055e('0xe')][_0x055e('0x12')]({'number':_0xb816c},{'where':{'id':_0x72d424['id']},'transaction':_0x376618[_0x055e('0xf')],'logging':!![]});}return _0x444c82['SACreditNoteNumber'][_0x055e('0x13')]({'year':_0xa0d384,'number':_0xb816c},{'logging':!![],'transaction':_0x376618[_0x055e('0xf')]});})[_0x055e('0x10')](function(){_0x40779c[_0x055e('0x11')]=_0xb816c;})[_0x055e('0x10')](function(){_0x230c32();});}}catch(_0x56af18){console[_0x055e('0x14')](_0x055e('0x15'),_0x56af18);_0x230c32();}}}});}; \ No newline at end of file +var _0xb58b=['SACreditNote','sa_creditNotes','models','get','format','has','SACreditNoteNumber','findOne','transaction','number','update','create','then','TCL:\x20error','util','../../config/logger','api','bluebird','request-promise','rimraf','./saCreditNote.attributes','exports','define'];(function(_0x1d87fc,_0x1e5321){var _0x492b56=function(_0x4c6b16){while(--_0x4c6b16){_0x1d87fc['push'](_0x1d87fc['shift']());}};_0x492b56(++_0x1e5321);}(_0xb58b,0x1f1));var _0xbb58=function(_0x58cd0f,_0x19ec6f){_0x58cd0f=_0x58cd0f-0x0;var _0x5f450d=_0xb58b[_0x58cd0f];return _0x5f450d;};'use strict';var _=require('lodash');var util=require(_0xbb58('0x0'));var logger=require(_0xbb58('0x1'))(_0xbb58('0x2'));var moment=require('moment');var BPromise=require(_0xbb58('0x3'));var rp=require(_0xbb58('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbb58('0x5'));var config=require('../../config/environment');var attributes=require(_0xbb58('0x6'));module[_0xbb58('0x7')]=function(_0x33fe85,_0x5cf8b1){return _0x33fe85[_0xbb58('0x8')](_0xbb58('0x9'),attributes,{'tableName':_0xbb58('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5d7fe8,_0xd94f1,_0x3e3144){var _0xc9e5bc=_0x33fe85[_0xbb58('0xb')];var _0x429e75=_0x5d7fe8[_0xbb58('0xc')]({'plain':!![]});var _0x27f77f=0x1;var _0x4bb8c5=parseInt(moment()[_0xbb58('0xd')]('YYYY'));try{if(_[_0xbb58('0xe')](_0x429e75,'id')){return _0xc9e5bc[_0xbb58('0xf')][_0xbb58('0x10')]({'where':{'year':_0x4bb8c5},'raw':!![],'logging':!![],'transaction':_0xd94f1[_0xbb58('0x11')]})['then'](function(_0xe88799){if(_0xe88799){_0x27f77f=_0xe88799[_0xbb58('0x12')]+0x1;return _0xc9e5bc['SACreditNoteNumber'][_0xbb58('0x13')]({'number':_0x27f77f},{'where':{'id':_0xe88799['id']},'transaction':_0xd94f1[_0xbb58('0x11')],'logging':!![]});}return _0xc9e5bc[_0xbb58('0xf')][_0xbb58('0x14')]({'year':_0x4bb8c5,'number':_0x27f77f},{'logging':!![],'transaction':_0xd94f1[_0xbb58('0x11')]});})['then'](function(){_0x429e75[_0xbb58('0x12')]=_0x27f77f;})[_0xbb58('0x15')](function(){_0x3e3144();});}}catch(_0x5f4751){console['log'](_0xbb58('0x16'),_0x5f4751);_0x3e3144();}}}});}; \ No newline at end of file diff --git a/server/api/saCreditNote/saCreditNote.rpc.js b/server/api/saCreditNote/saCreditNote.rpc.js index 9b93ff7..b84674b 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 _0x649f=['lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SACreditNote,\x20%s,\x20%s','request\x20sent','SACreditNote,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x59c8c8,_0x3b8617){var _0x36c186=function(_0x2a5573){while(--_0x2a5573){_0x59c8c8['push'](_0x59c8c8['shift']());}};_0x36c186(++_0x3b8617);}(_0x649f,0x93));var _0xf649=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x649f[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0xf649('0x0'));var util=require(_0xf649('0x1'));var moment=require(_0xf649('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf649('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf649('0x4'));var logger=require(_0xf649('0x5'))(_0xf649('0x6'));var config=require(_0xf649('0x7'));var jayson=require(_0xf649('0x8'));var client=jayson[_0xf649('0x9')][_0xf649('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x370f51,_0x5ece5c,_0x53e568){return new BPromise(function(_0x144078,_0x14cd22){return client[_0xf649('0xb')](_0x370f51,_0x53e568)['then'](function(_0x19e6ca){logger[_0xf649('0xc')](_0xf649('0xd'),_0x5ece5c,_0xf649('0xe'));logger['debug'](_0xf649('0xf'),_0x5ece5c,_0xf649('0xe'),JSON[_0xf649('0x10')](_0x19e6ca));if(_0x19e6ca[_0xf649('0x11')]){if(_0x19e6ca[_0xf649('0x11')][_0xf649('0x12')]===0x1f4){logger['error'](_0xf649('0xd'),_0x5ece5c,_0x19e6ca['error']['message']);return _0x14cd22(_0x19e6ca[_0xf649('0x11')][_0xf649('0x13')]);}logger[_0xf649('0x11')](_0xf649('0xd'),_0x5ece5c,_0x19e6ca[_0xf649('0x11')][_0xf649('0x13')]);return _0x144078(_0x19e6ca[_0xf649('0x11')][_0xf649('0x13')]);}else{logger['info'](_0xf649('0xd'),_0x5ece5c,_0xf649('0xe'));_0x144078(_0x19e6ca['result'][_0xf649('0x13')]);}})[_0xf649('0x14')](function(_0x3e2a96){logger['error']('SACreditNote,\x20%s,\x20%s',_0x5ece5c,_0x3e2a96);_0x14cd22(_0x3e2a96);});});} \ No newline at end of file +var _0x2eba=['moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','SACreditNote,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','util'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x2eba,0xc7));var _0xa2eb=function(_0x2b0768,_0x5127d0){_0x2b0768=_0x2b0768-0x0;var _0x432479=_0x2eba[_0x2b0768];return _0x432479;};'use strict';var _=require('lodash');var util=require(_0xa2eb('0x0'));var moment=require(_0xa2eb('0x1'));var BPromise=require(_0xa2eb('0x2'));var rs=require(_0xa2eb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa2eb('0x4'));var logger=require('../../config/logger')(_0xa2eb('0x5'));var config=require(_0xa2eb('0x6'));var jayson=require(_0xa2eb('0x7'));var client=jayson[_0xa2eb('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x545db3,_0x56b33a,_0x4ed534){return new BPromise(function(_0x550a3c,_0x56408f){return client[_0xa2eb('0x9')](_0x545db3,_0x4ed534)[_0xa2eb('0xa')](function(_0x5480a1){logger['info'](_0xa2eb('0xb'),_0x56b33a,_0xa2eb('0xc'));logger[_0xa2eb('0xd')]('SACreditNote,\x20%s,\x20%s,\x20%s',_0x56b33a,_0xa2eb('0xc'),JSON[_0xa2eb('0xe')](_0x5480a1));if(_0x5480a1['error']){if(_0x5480a1[_0xa2eb('0xf')]['code']===0x1f4){logger[_0xa2eb('0xf')](_0xa2eb('0xb'),_0x56b33a,_0x5480a1[_0xa2eb('0xf')][_0xa2eb('0x10')]);return _0x56408f(_0x5480a1[_0xa2eb('0xf')][_0xa2eb('0x10')]);}logger['error'](_0xa2eb('0xb'),_0x56b33a,_0x5480a1[_0xa2eb('0xf')][_0xa2eb('0x10')]);return _0x550a3c(_0x5480a1[_0xa2eb('0xf')][_0xa2eb('0x10')]);}else{logger[_0xa2eb('0x11')](_0xa2eb('0xb'),_0x56b33a,_0xa2eb('0xc'));_0x550a3c(_0x5480a1[_0xa2eb('0x12')][_0xa2eb('0x10')]);}})[_0xa2eb('0x13')](function(_0x3a02d5){logger['error']('SACreditNote,\x20%s,\x20%s',_0x56b33a,_0x3a02d5);_0x56408f(_0x3a02d5);});});} \ No newline at end of file diff --git a/server/api/saCreditNoteDetail/index.js b/server/api/saCreditNoteDetail/index.js index b275827..55d2422 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 _0x4191=['path','connect-timeout','express','Router','../../components/auth/service','./saCreditNoteDetail.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer'];(function(_0x187279,_0x26d152){var _0x3da59d=function(_0x41c808){while(--_0x41c808){_0x187279['push'](_0x187279['shift']());}};_0x3da59d(++_0x26d152);}(_0x4191,0x77));var _0x1419=function(_0x3eb4a9,_0x359d73){_0x3eb4a9=_0x3eb4a9-0x0;var _0x48dbad=_0x4191[_0x3eb4a9];return _0x48dbad;};'use strict';var multer=require(_0x1419('0x0'));var util=require('util');var path=require(_0x1419('0x1'));var timeout=require(_0x1419('0x2'));var express=require(_0x1419('0x3'));var router=express[_0x1419('0x4')]();var auth=require(_0x1419('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1419('0x6'));router[_0x1419('0x7')]('/',auth[_0x1419('0x8')](),controller[_0x1419('0x9')]);router[_0x1419('0x7')](_0x1419('0xa'),auth[_0x1419('0x8')](),controller[_0x1419('0xb')]);router[_0x1419('0x7')](_0x1419('0xc'),auth['isAuthenticated'](),controller[_0x1419('0xd')]);router['post']('/',auth[_0x1419('0x8')](),controller[_0x1419('0xe')]);router[_0x1419('0xf')](_0x1419('0xc'),auth[_0x1419('0x8')](),controller[_0x1419('0x10')]);router[_0x1419('0x11')]('/:id',auth[_0x1419('0x8')](),controller[_0x1419('0x12')]);module[_0x1419('0x13')]=router; \ No newline at end of file +var _0x04b4=['../../config/environment','./saCreditNoteDetail.controller','get','isAuthenticated','index','describe','show','post','create','put','/:id','update','delete','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x37c006,_0x1f647a){var _0x3f306e=function(_0x48de6a){while(--_0x48de6a){_0x37c006['push'](_0x37c006['shift']());}};_0x3f306e(++_0x1f647a);}(_0x04b4,0x139));var _0x404b=function(_0x1292c2,_0x30f6da){_0x1292c2=_0x1292c2-0x0;var _0x12da0f=_0x04b4[_0x1292c2];return _0x12da0f;};'use strict';var multer=require(_0x404b('0x0'));var util=require('util');var path=require(_0x404b('0x1'));var timeout=require(_0x404b('0x2'));var express=require(_0x404b('0x3'));var router=express[_0x404b('0x4')]();var auth=require(_0x404b('0x5'));var interaction=require(_0x404b('0x6'));var config=require(_0x404b('0x7'));var controller=require(_0x404b('0x8'));router[_0x404b('0x9')]('/',auth[_0x404b('0xa')](),controller[_0x404b('0xb')]);router[_0x404b('0x9')]('/describe',auth[_0x404b('0xa')](),controller[_0x404b('0xc')]);router[_0x404b('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x404b('0xd')]);router[_0x404b('0xe')]('/',auth[_0x404b('0xa')](),controller[_0x404b('0xf')]);router[_0x404b('0x10')](_0x404b('0x11'),auth[_0x404b('0xa')](),controller[_0x404b('0x12')]);router[_0x404b('0x13')](_0x404b('0x11'),auth[_0x404b('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/saCreditNoteDetail/saCreditNoteDetail.attributes.js b/server/api/saCreditNoteDetail/saCreditNoteDetail.attributes.js index a06bc84..e588383 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 _0xbec5=['INTEGER','TEXT','STRING','long','DECIMAL','sequelize','exports'];(function(_0x1ed90b,_0x1dfdab){var _0x5c41e6=function(_0x58b15d){while(--_0x58b15d){_0x1ed90b['push'](_0x1ed90b['shift']());}};_0x5c41e6(++_0x1dfdab);}(_0xbec5,0xe5));var _0x5bec=function(_0x4dd479,_0x26d87a){_0x4dd479=_0x4dd479-0x0;var _0x1b6807=_0xbec5[_0x4dd479];return _0x1b6807;};'use strict';var Sequelize=require(_0x5bec('0x0'));module[_0x5bec('0x1')]={'companyName':{'type':Sequelize['STRING'],'allowNull':![]},'companyId':{'type':Sequelize[_0x5bec('0x2')],'allowNull':![]},'productName':{'type':Sequelize[_0x5bec('0x3')],'allowNull':![]},'productCode':{'type':Sequelize[_0x5bec('0x4')],'allowNull':![]},'productDescription':{'type':Sequelize[_0x5bec('0x3')](_0x5bec('0x5'))+'\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci'},'typeName':{'type':Sequelize[_0x5bec('0x4')],'allowNull':![]},'unitName':{'type':Sequelize[_0x5bec('0x4')]},'pricelistName':{'type':Sequelize[_0x5bec('0x3')],'allowNull':![]},'priceListId':{'type':Sequelize['INTEGER'],'allowNull':![]},'netPrice':{'type':Sequelize[_0x5bec('0x6')](0xd,0x4),'allowNull':![]},'discount':{'type':Sequelize[_0x5bec('0x6')](0x6,0x3),'allowNull':![]},'tax':{'type':Sequelize[_0x5bec('0x6')](0xd,0x4),'allowNull':![]},'agentFullname':{'type':Sequelize[_0x5bec('0x4')],'allowNull':![]},'note':{'type':Sequelize[_0x5bec('0x3')]},'subscriptionId':{'type':Sequelize[_0x5bec('0x2')],'allowNull':![]},'subscriptionName':{'type':Sequelize[_0x5bec('0x4')],'allowNull':![]},'subscriptionMonthly':{'type':Sequelize[_0x5bec('0x2')],'allowNull':![]},'quantity':{'type':Sequelize['DECIMAL'](0xd,0x4),'allowNull':![]}}; \ No newline at end of file +var _0xe205=['exports','STRING','INTEGER','TEXT','long','\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci','DECIMAL','sequelize'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xe205,0xa7));var _0x5e20=function(_0x5a06b4,_0x124796){_0x5a06b4=_0x5a06b4-0x0;var _0x21fbef=_0xe205[_0x5a06b4];return _0x21fbef;};'use strict';var Sequelize=require(_0x5e20('0x0'));module[_0x5e20('0x1')]={'companyName':{'type':Sequelize[_0x5e20('0x2')],'allowNull':![]},'companyId':{'type':Sequelize[_0x5e20('0x3')],'allowNull':![]},'productName':{'type':Sequelize[_0x5e20('0x4')],'allowNull':![]},'productCode':{'type':Sequelize[_0x5e20('0x2')],'allowNull':![]},'productDescription':{'type':Sequelize[_0x5e20('0x4')](_0x5e20('0x5'))+_0x5e20('0x6')},'typeName':{'type':Sequelize['STRING'],'allowNull':![]},'unitName':{'type':Sequelize[_0x5e20('0x2')]},'pricelistName':{'type':Sequelize[_0x5e20('0x4')],'allowNull':![]},'priceListId':{'type':Sequelize[_0x5e20('0x3')],'allowNull':![]},'netPrice':{'type':Sequelize[_0x5e20('0x7')](0xd,0x4),'allowNull':![]},'discount':{'type':Sequelize['DECIMAL'](0x6,0x3),'allowNull':![]},'tax':{'type':Sequelize['DECIMAL'](0xd,0x4),'allowNull':![]},'agentFullname':{'type':Sequelize[_0x5e20('0x2')],'allowNull':![]},'note':{'type':Sequelize['TEXT']},'subscriptionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'subscriptionName':{'type':Sequelize[_0x5e20('0x2')],'allowNull':![]},'subscriptionMonthly':{'type':Sequelize[_0x5e20('0x3')],'allowNull':![]},'quantity':{'type':Sequelize['DECIMAL'](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 7f1fd29..4d2a139 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 _0xe815=['html-pdf','zip-dir','fast-json-patch','moment','util','sox','to-csv','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','update','then','destroy','end','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','SACreditNoteDetail','includeAll','include','findAll','rows','show','params','length','options','catch','create','body','find','describe'];(function(_0x4aa4e6,_0x278c45){var _0x322588=function(_0x19279d){while(--_0x19279d){_0x4aa4e6['push'](_0x4aa4e6['shift']());}};_0x322588(++_0x278c45);}(_0xe815,0x159));var _0x5e81=function(_0x55dc50,_0x1e2ac9){_0x55dc50=_0x55dc50-0x0;var _0x948fdd=_0xe815[_0x55dc50];return _0x948fdd;};'use strict';var pdf=require(_0x5e81('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5e81('0x1'));var jsonpatch=require(_0x5e81('0x2'));var rp=require('request-promise');var moment=require(_0x5e81('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5e81('0x4'));var path=require('path');var sox=require(_0x5e81('0x5'));var csv=require(_0x5e81('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5e81('0x7'));var squel=require(_0x5e81('0x8'));var crypto=require(_0x5e81('0x9'));var jsforce=require(_0x5e81('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5e81('0xb'));var authService=require(_0x5e81('0xc'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x5e81('0xd'));var logger=require(_0x5e81('0xe'))('api');var utils=require(_0x5e81('0xf'));var config=require(_0x5e81('0x10'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x224997,_0x49f1e4){_0x49f1e4=_0x49f1e4||0xcc;return function(_0x3a2809){if(_0x3a2809){return _0x224997[_0x5e81('0x11')](_0x49f1e4);}return _0x224997[_0x5e81('0x12')](_0x49f1e4)['end']();};}function respondWithResult(_0x3cab81,_0x38d185){_0x38d185=_0x38d185||0xc8;return function(_0x217ea1){if(_0x217ea1){return _0x3cab81[_0x5e81('0x12')](_0x38d185)[_0x5e81('0x13')](_0x217ea1);}};}function respondWithFilteredResult(_0x2f3171,_0x283c48){return function(_0x377b2a){if(_0x377b2a){var _0x24bf87=_0x377b2a[_0x5e81('0x14')],_0x4ed0d5=_0x283c48[_0x5e81('0x15')],_0x4f4b3d=_0x283c48[_0x5e81('0x15')]+_0x283c48['limit'],_0x932917;if(_0x4f4b3d>=_0x24bf87){_0x4f4b3d=_0x24bf87;_0x932917=0xc8;}else{_0x932917=0xce;}_0x2f3171[_0x5e81('0x12')](_0x932917);return _0x2f3171[_0x5e81('0x16')](_0x5e81('0x17'),_0x4ed0d5+'-'+_0x4f4b3d+'/'+_0x24bf87)[_0x5e81('0x13')](_0x377b2a);}return null;};}function patchUpdates(_0x1c22e7){return function(_0x4c4b35){try{jsonpatch[_0x5e81('0x18')](_0x4c4b35,_0x1c22e7,!![]);}catch(_0x58beb4){return BPromise[_0x5e81('0x19')](_0x58beb4);}return _0x4c4b35['save']();};}function saveUpdates(_0x5412ba,_0x32a852){return function(_0x394c68){if(_0x394c68){return _0x394c68[_0x5e81('0x1a')](_0x5412ba)[_0x5e81('0x1b')](function(_0x55d084){return _0x55d084;});}return null;};}function removeEntity(_0xb8d186,_0x4ca240){return function(_0x5ba5e2){if(_0x5ba5e2){return _0x5ba5e2[_0x5e81('0x1c')]()[_0x5e81('0x1b')](function(){_0xb8d186[_0x5e81('0x12')](0xcc)[_0x5e81('0x1d')]();});}};}function handleEntityNotFound(_0x1cc9a3,_0x382f2e){return function(_0x598fb1){if(!_0x598fb1){_0x1cc9a3[_0x5e81('0x11')](0x194);}return _0x598fb1;};}function handleError(_0x42a97c,_0x4eeb44){_0x4eeb44=_0x4eeb44||0x1f4;return function(_0x49fd31){logger['error'](_0x49fd31[_0x5e81('0x1e')]);if(_0x49fd31[_0x5e81('0x1f')]){delete _0x49fd31[_0x5e81('0x1f')];}_0x42a97c['status'](_0x4eeb44)[_0x5e81('0x20')](_0x49fd31);};}exports[_0x5e81('0x21')]=function(_0x2af980,_0x5a6fdf){var _0x4e2bc3={},_0x13b202={},_0x63e295={'count':0x0,'rows':[]};var _0x33ef20=db['SACreditNoteDetail'][_0x5e81('0x22')];_0x13b202[_0x5e81('0x23')]=_[_0x5e81('0x24')](_0x33ef20);_0x13b202[_0x5e81('0x25')]=_[_0x5e81('0x24')](_0x2af980[_0x5e81('0x25')]);_0x13b202[_0x5e81('0x26')]=_[_0x5e81('0x27')](_0x13b202['model'],_0x13b202[_0x5e81('0x25')]);_0x4e2bc3['attributes']=_[_0x5e81('0x27')](_0x13b202['model'],qs[_0x5e81('0x28')](_0x2af980[_0x5e81('0x25')]['fields']));_0x4e2bc3[_0x5e81('0x29')]=_0x4e2bc3[_0x5e81('0x29')]['length']?_0x4e2bc3['attributes']:_0x13b202[_0x5e81('0x23')];if(!_0x2af980['query'][_0x5e81('0x2a')](_0x5e81('0x2b'))){_0x4e2bc3[_0x5e81('0x2c')]=qs['limit'](_0x2af980[_0x5e81('0x25')][_0x5e81('0x2c')]);_0x4e2bc3[_0x5e81('0x15')]=qs['offset'](_0x2af980[_0x5e81('0x25')][_0x5e81('0x15')]);}_0x4e2bc3['order']=qs[_0x5e81('0x2d')](_0x2af980['query'][_0x5e81('0x2d')]);_0x4e2bc3[_0x5e81('0x2e')]=qs[_0x5e81('0x26')](_[_0x5e81('0x2f')](_0x2af980[_0x5e81('0x25')],_0x13b202[_0x5e81('0x26')]));if(_0x2af980[_0x5e81('0x25')][_0x5e81('0x30')]){_0x4e2bc3[_0x5e81('0x2e')]=_[_0x5e81('0x31')](_0x4e2bc3['where'],{'$or':_[_0x5e81('0x32')](_0x33ef20,function(_0x33b6f7){if(_0x33b6f7[_0x5e81('0x33')][_0x5e81('0x34')]!==_0x5e81('0x35')){var _0x3d8fc9={};_0x3d8fc9[_0x33b6f7[_0x5e81('0x36')]]={'$like':'%'+_0x2af980[_0x5e81('0x25')][_0x5e81('0x30')]+'%'};return _0x3d8fc9;}})});}_0x4e2bc3=_[_0x5e81('0x31')]({},_0x4e2bc3,_0x2af980['options']);var _0x42f148={'where':_0x4e2bc3['where']};return db[_0x5e81('0x37')][_0x5e81('0x14')](_0x42f148)[_0x5e81('0x1b')](function(_0x14a73a){_0x63e295['count']=_0x14a73a;if(_0x2af980[_0x5e81('0x25')][_0x5e81('0x38')]){_0x4e2bc3[_0x5e81('0x39')]=[{'all':!![]}];}return db[_0x5e81('0x37')][_0x5e81('0x3a')](_0x4e2bc3);})[_0x5e81('0x1b')](function(_0x9498b6){_0x63e295[_0x5e81('0x3b')]=_0x9498b6;return _0x63e295;})[_0x5e81('0x1b')](respondWithFilteredResult(_0x5a6fdf,_0x4e2bc3))['catch'](handleError(_0x5a6fdf,null));};exports[_0x5e81('0x3c')]=function(_0x49be7f,_0x5a0113){var _0x162b39={'raw':![],'where':{'id':_0x49be7f[_0x5e81('0x3d')]['id']}},_0x3578b7={};_0x3578b7['model']=_[_0x5e81('0x24')](db[_0x5e81('0x37')]['rawAttributes']);_0x3578b7[_0x5e81('0x25')]=_[_0x5e81('0x24')](_0x49be7f[_0x5e81('0x25')]);_0x3578b7[_0x5e81('0x26')]=_[_0x5e81('0x27')](_0x3578b7[_0x5e81('0x23')],_0x3578b7[_0x5e81('0x25')]);_0x162b39['attributes']=_['intersection'](_0x3578b7[_0x5e81('0x23')],qs[_0x5e81('0x28')](_0x49be7f[_0x5e81('0x25')][_0x5e81('0x28')]));_0x162b39['attributes']=_0x162b39[_0x5e81('0x29')][_0x5e81('0x3e')]?_0x162b39['attributes']:_0x3578b7[_0x5e81('0x23')];if(_0x49be7f[_0x5e81('0x25')][_0x5e81('0x38')]){_0x162b39[_0x5e81('0x39')]=[{'all':!![]}];}_0x162b39=_['merge']({},_0x162b39,_0x49be7f[_0x5e81('0x3f')]);return db[_0x5e81('0x37')]['find'](_0x162b39)[_0x5e81('0x1b')](handleEntityNotFound(_0x5a0113,null))[_0x5e81('0x1b')](respondWithResult(_0x5a0113,null))[_0x5e81('0x40')](handleError(_0x5a0113,null));};exports[_0x5e81('0x41')]=function(_0x1afb65,_0x5c23ee){return db[_0x5e81('0x37')][_0x5e81('0x41')](_0x1afb65[_0x5e81('0x42')],{})['then'](respondWithResult(_0x5c23ee,0xc9))[_0x5e81('0x40')](handleError(_0x5c23ee,null));};exports['update']=function(_0x4b3d68,_0x229a29){if(_0x4b3d68[_0x5e81('0x42')]['id']){delete _0x4b3d68[_0x5e81('0x42')]['id'];}return db[_0x5e81('0x37')][_0x5e81('0x43')]({'where':{'id':_0x4b3d68[_0x5e81('0x3d')]['id']}})[_0x5e81('0x1b')](handleEntityNotFound(_0x229a29,null))[_0x5e81('0x1b')](saveUpdates(_0x4b3d68[_0x5e81('0x42')],null))[_0x5e81('0x1b')](respondWithResult(_0x229a29,null))[_0x5e81('0x40')](handleError(_0x229a29,null));};exports[_0x5e81('0x1c')]=function(_0x51246a,_0x10abf8){return db['SACreditNoteDetail'][_0x5e81('0x43')]({'where':{'id':_0x51246a[_0x5e81('0x3d')]['id']}})[_0x5e81('0x1b')](handleEntityNotFound(_0x10abf8,null))['then'](removeEntity(_0x10abf8,null))[_0x5e81('0x40')](handleError(_0x10abf8,null));};exports[_0x5e81('0x44')]=function(_0x57a949,_0x5ef98a){return db[_0x5e81('0x37')][_0x5e81('0x44')]()[_0x5e81('0x1b')](respondWithResult(_0x5ef98a,null))[_0x5e81('0x40')](handleError(_0x5ef98a,null));}; \ No newline at end of file +var _0xa2cf=['../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','set','Content-Range','apply','save','then','error','stack','name','send','index','SACreditNoteDetail','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','type','key','field','options','count','include','findAll','show','params','length','includeAll','find','catch','create','update','body','destroy','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils'];(function(_0x4d2cc7,_0x5f190e){var _0x3fe255=function(_0x1409b3){while(--_0x1409b3){_0x4d2cc7['push'](_0x4d2cc7['shift']());}};_0x3fe255(++_0x5f190e);}(_0xa2cf,0x15c));var _0xfa2c=function(_0x475f7,_0x5e6f27){_0x475f7=_0x475f7-0x0;var _0x172b30=_0xa2cf[_0x475f7];return _0x172b30;};'use strict';var pdf=require(_0xfa2c('0x0'));var emlformat=require(_0xfa2c('0x1'));var rimraf=require(_0xfa2c('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfa2c('0x3'));var rp=require(_0xfa2c('0x4'));var moment=require(_0xfa2c('0x5'));var BPromise=require(_0xfa2c('0x6'));var Mustache=require(_0xfa2c('0x7'));var util=require(_0xfa2c('0x8'));var path=require(_0xfa2c('0x9'));var sox=require(_0xfa2c('0xa'));var csv=require('to-csv');var ejs=require(_0xfa2c('0xb'));var fs=require('fs');var _=require(_0xfa2c('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xfa2c('0xd'));var deskjs=require(_0xfa2c('0xe'));var toCsv=require(_0xfa2c('0xf'));var querystring=require(_0xfa2c('0x10'));var Papa=require(_0xfa2c('0x11'));var Redis=require('ioredis');var authService=require(_0xfa2c('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xfa2c('0x13'));var logger=require('../../config/logger')(_0xfa2c('0x14'));var utils=require(_0xfa2c('0x15'));var config=require(_0xfa2c('0x16'));var db=require(_0xfa2c('0x17'))['db'];function respondWithStatusCode(_0x1868a7,_0x557711){_0x557711=_0x557711||0xcc;return function(_0x50db2b){if(_0x50db2b){return _0x1868a7[_0xfa2c('0x18')](_0x557711);}return _0x1868a7['status'](_0x557711)[_0xfa2c('0x19')]();};}function respondWithResult(_0x3605ff,_0x105582){_0x105582=_0x105582||0xc8;return function(_0x1ef93c){if(_0x1ef93c){return _0x3605ff[_0xfa2c('0x1a')](_0x105582)[_0xfa2c('0x1b')](_0x1ef93c);}};}function respondWithFilteredResult(_0x200858,_0x13f10d){return function(_0x5218de){if(_0x5218de){var _0x443fdd=_0x5218de['count'],_0x3d3cd3=_0x13f10d[_0xfa2c('0x1c')],_0x15e119=_0x13f10d[_0xfa2c('0x1c')]+_0x13f10d['limit'],_0x1259c5;if(_0x15e119>=_0x443fdd){_0x15e119=_0x443fdd;_0x1259c5=0xc8;}else{_0x1259c5=0xce;}_0x200858['status'](_0x1259c5);return _0x200858[_0xfa2c('0x1d')](_0xfa2c('0x1e'),_0x3d3cd3+'-'+_0x15e119+'/'+_0x443fdd)[_0xfa2c('0x1b')](_0x5218de);}return null;};}function patchUpdates(_0x2faeff){return function(_0x31a59a){try{jsonpatch[_0xfa2c('0x1f')](_0x31a59a,_0x2faeff,!![]);}catch(_0x3249e8){return BPromise['reject'](_0x3249e8);}return _0x31a59a[_0xfa2c('0x20')]();};}function saveUpdates(_0x21b940,_0xb6b1d1){return function(_0x66b836){if(_0x66b836){return _0x66b836['update'](_0x21b940)[_0xfa2c('0x21')](function(_0x1ae22b){return _0x1ae22b;});}return null;};}function removeEntity(_0x28ceba,_0x38182b){return function(_0x1a257c){if(_0x1a257c){return _0x1a257c['destroy']()[_0xfa2c('0x21')](function(){_0x28ceba['status'](0xcc)[_0xfa2c('0x19')]();});}};}function handleEntityNotFound(_0x1cc783,_0x5e29aa){return function(_0x1f5a09){if(!_0x1f5a09){_0x1cc783[_0xfa2c('0x18')](0x194);}return _0x1f5a09;};}function handleError(_0x3cdb51,_0x6d725c){_0x6d725c=_0x6d725c||0x1f4;return function(_0x11418e){logger[_0xfa2c('0x22')](_0x11418e[_0xfa2c('0x23')]);if(_0x11418e[_0xfa2c('0x24')]){delete _0x11418e['name'];}_0x3cdb51[_0xfa2c('0x1a')](_0x6d725c)[_0xfa2c('0x25')](_0x11418e);};}exports[_0xfa2c('0x26')]=function(_0x2cfb17,_0x1bb22c){var _0x5749e7={},_0x991e14={},_0x4c8e5b={'count':0x0,'rows':[]};var _0x229f39=db[_0xfa2c('0x27')][_0xfa2c('0x28')];_0x991e14[_0xfa2c('0x29')]=_[_0xfa2c('0x2a')](_0x229f39);_0x991e14[_0xfa2c('0x2b')]=_['keys'](_0x2cfb17[_0xfa2c('0x2b')]);_0x991e14[_0xfa2c('0x2c')]=_[_0xfa2c('0x2d')](_0x991e14['model'],_0x991e14[_0xfa2c('0x2b')]);_0x5749e7['attributes']=_[_0xfa2c('0x2d')](_0x991e14[_0xfa2c('0x29')],qs[_0xfa2c('0x2e')](_0x2cfb17[_0xfa2c('0x2b')]['fields']));_0x5749e7['attributes']=_0x5749e7['attributes']['length']?_0x5749e7[_0xfa2c('0x2f')]:_0x991e14[_0xfa2c('0x29')];if(!_0x2cfb17[_0xfa2c('0x2b')][_0xfa2c('0x30')](_0xfa2c('0x31'))){_0x5749e7[_0xfa2c('0x32')]=qs['limit'](_0x2cfb17['query'][_0xfa2c('0x32')]);_0x5749e7[_0xfa2c('0x1c')]=qs[_0xfa2c('0x1c')](_0x2cfb17['query'][_0xfa2c('0x1c')]);}_0x5749e7[_0xfa2c('0x33')]=qs[_0xfa2c('0x34')](_0x2cfb17[_0xfa2c('0x2b')][_0xfa2c('0x34')]);_0x5749e7[_0xfa2c('0x35')]=qs['filters'](_['pick'](_0x2cfb17[_0xfa2c('0x2b')],_0x991e14[_0xfa2c('0x2c')]));if(_0x2cfb17['query'][_0xfa2c('0x36')]){_0x5749e7['where']=_[_0xfa2c('0x37')](_0x5749e7[_0xfa2c('0x35')],{'$or':_['map'](_0x229f39,function(_0x555616){if(_0x555616[_0xfa2c('0x38')][_0xfa2c('0x39')]!=='VIRTUAL'){var _0xbd40f0={};_0xbd40f0[_0x555616[_0xfa2c('0x3a')]]={'$like':'%'+_0x2cfb17['query']['filter']+'%'};return _0xbd40f0;}})});}_0x5749e7=_[_0xfa2c('0x37')]({},_0x5749e7,_0x2cfb17[_0xfa2c('0x3b')]);var _0x418dd8={'where':_0x5749e7[_0xfa2c('0x35')]};return db[_0xfa2c('0x27')][_0xfa2c('0x3c')](_0x418dd8)[_0xfa2c('0x21')](function(_0x8a83da){_0x4c8e5b[_0xfa2c('0x3c')]=_0x8a83da;if(_0x2cfb17[_0xfa2c('0x2b')]['includeAll']){_0x5749e7[_0xfa2c('0x3d')]=[{'all':!![]}];}return db[_0xfa2c('0x27')][_0xfa2c('0x3e')](_0x5749e7);})[_0xfa2c('0x21')](function(_0x1d06e0){_0x4c8e5b['rows']=_0x1d06e0;return _0x4c8e5b;})['then'](respondWithFilteredResult(_0x1bb22c,_0x5749e7))['catch'](handleError(_0x1bb22c,null));};exports[_0xfa2c('0x3f')]=function(_0x2fce10,_0x404bc9){var _0x3809c8={'raw':![],'where':{'id':_0x2fce10[_0xfa2c('0x40')]['id']}},_0x33dd5d={};_0x33dd5d[_0xfa2c('0x29')]=_[_0xfa2c('0x2a')](db[_0xfa2c('0x27')][_0xfa2c('0x28')]);_0x33dd5d[_0xfa2c('0x2b')]=_[_0xfa2c('0x2a')](_0x2fce10[_0xfa2c('0x2b')]);_0x33dd5d['filters']=_[_0xfa2c('0x2d')](_0x33dd5d[_0xfa2c('0x29')],_0x33dd5d[_0xfa2c('0x2b')]);_0x3809c8['attributes']=_[_0xfa2c('0x2d')](_0x33dd5d['model'],qs['fields'](_0x2fce10[_0xfa2c('0x2b')][_0xfa2c('0x2e')]));_0x3809c8[_0xfa2c('0x2f')]=_0x3809c8[_0xfa2c('0x2f')][_0xfa2c('0x41')]?_0x3809c8[_0xfa2c('0x2f')]:_0x33dd5d['model'];if(_0x2fce10['query'][_0xfa2c('0x42')]){_0x3809c8[_0xfa2c('0x3d')]=[{'all':!![]}];}_0x3809c8=_[_0xfa2c('0x37')]({},_0x3809c8,_0x2fce10['options']);return db[_0xfa2c('0x27')][_0xfa2c('0x43')](_0x3809c8)[_0xfa2c('0x21')](handleEntityNotFound(_0x404bc9,null))[_0xfa2c('0x21')](respondWithResult(_0x404bc9,null))[_0xfa2c('0x44')](handleError(_0x404bc9,null));};exports['create']=function(_0x25f79b,_0x32443){return db[_0xfa2c('0x27')][_0xfa2c('0x45')](_0x25f79b['body'],{})[_0xfa2c('0x21')](respondWithResult(_0x32443,0xc9))[_0xfa2c('0x44')](handleError(_0x32443,null));};exports[_0xfa2c('0x46')]=function(_0x4bacac,_0x3310c4){if(_0x4bacac['body']['id']){delete _0x4bacac['body']['id'];}return db['SACreditNoteDetail'][_0xfa2c('0x43')]({'where':{'id':_0x4bacac[_0xfa2c('0x40')]['id']}})['then'](handleEntityNotFound(_0x3310c4,null))[_0xfa2c('0x21')](saveUpdates(_0x4bacac[_0xfa2c('0x47')],null))[_0xfa2c('0x21')](respondWithResult(_0x3310c4,null))[_0xfa2c('0x44')](handleError(_0x3310c4,null));};exports[_0xfa2c('0x48')]=function(_0x532386,_0x201913){return db[_0xfa2c('0x27')][_0xfa2c('0x43')]({'where':{'id':_0x532386[_0xfa2c('0x40')]['id']}})[_0xfa2c('0x21')](handleEntityNotFound(_0x201913,null))['then'](removeEntity(_0x201913,null))[_0xfa2c('0x44')](handleError(_0x201913,null));};exports[_0xfa2c('0x49')]=function(_0x26547a,_0x4b9f6b){return db[_0xfa2c('0x27')][_0xfa2c('0x49')]()[_0xfa2c('0x21')](respondWithResult(_0x4b9f6b,null))[_0xfa2c('0x44')](handleError(_0x4b9f6b,null));}; \ No newline at end of file diff --git a/server/api/saCreditNoteDetail/saCreditNoteDetail.model.js b/server/api/saCreditNoteDetail/saCreditNoteDetail.model.js index 4dc46ed..2f021f0 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 _0xa660=['sa_creditNote_details','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./saCreditNoteDetail.attributes','SACreditNoteDetail'];(function(_0x13c2df,_0x1f8966){var _0x3a59c9=function(_0xecd8f3){while(--_0xecd8f3){_0x13c2df['push'](_0x13c2df['shift']());}};_0x3a59c9(++_0x1f8966);}(_0xa660,0x1c4));var _0x0a66=function(_0x2af774,_0x40d9f4){_0x2af774=_0x2af774-0x0;var _0x1292e7=_0xa660[_0x2af774];return _0x1292e7;};'use strict';var _=require(_0x0a66('0x0'));var util=require(_0x0a66('0x1'));var logger=require(_0x0a66('0x2'))(_0x0a66('0x3'));var moment=require('moment');var BPromise=require(_0x0a66('0x4'));var rp=require(_0x0a66('0x5'));var fs=require('fs');var path=require(_0x0a66('0x6'));var rimraf=require(_0x0a66('0x7'));var config=require('../../config/environment');var attributes=require(_0x0a66('0x8'));module['exports']=function(_0x5e2464,_0x4f437c){return _0x5e2464['define'](_0x0a66('0x9'),attributes,{'tableName':_0x0a66('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb0c0=['rimraf','./saCreditNoteDetail.attributes','exports','define','sa_creditNote_details','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x78e243,_0x2df8c7){var _0x16d8cb=function(_0x4649d8){while(--_0x4649d8){_0x78e243['push'](_0x78e243['shift']());}};_0x16d8cb(++_0x2df8c7);}(_0xb0c0,0x131));var _0x0b0c=function(_0x32cf40,_0x794a84){_0x32cf40=_0x32cf40-0x0;var _0x1895a4=_0xb0c0[_0x32cf40];return _0x1895a4;};'use strict';var _=require(_0x0b0c('0x0'));var util=require(_0x0b0c('0x1'));var logger=require(_0x0b0c('0x2'))(_0x0b0c('0x3'));var moment=require('moment');var BPromise=require(_0x0b0c('0x4'));var rp=require(_0x0b0c('0x5'));var fs=require('fs');var path=require(_0x0b0c('0x6'));var rimraf=require(_0x0b0c('0x7'));var config=require('../../config/environment');var attributes=require(_0x0b0c('0x8'));module[_0x0b0c('0x9')]=function(_0x57db82,_0x9438b){return _0x57db82[_0x0b0c('0xa')]('SACreditNoteDetail',attributes,{'tableName':_0x0b0c('0xb'),'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 5c95eae..c2b6f9f 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 _0x5bdd=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','client','http','then','debug','SACreditNoteDetail,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SACreditNoteDetail,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x20500c,_0xe09892){var _0x27279b=function(_0x315816){while(--_0x315816){_0x20500c['push'](_0x20500c['shift']());}};_0x27279b(++_0xe09892);}(_0x5bdd,0x7d));var _0xd5bd=function(_0x43dc07,_0x58465d){_0x43dc07=_0x43dc07-0x0;var _0x3b026d=_0x5bdd[_0x43dc07];return _0x3b026d;};'use strict';var _=require(_0xd5bd('0x0'));var util=require(_0xd5bd('0x1'));var moment=require(_0xd5bd('0x2'));var BPromise=require(_0xd5bd('0x3'));var rs=require(_0xd5bd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd5bd('0x5'));var logger=require(_0xd5bd('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd5bd('0x7'));var client=jayson[_0xd5bd('0x8')][_0xd5bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33b063,_0x2da875,_0x4a5ce0){return new BPromise(function(_0x698550,_0x3b6f3f){return client['request'](_0x33b063,_0x4a5ce0)[_0xd5bd('0xa')](function(_0x3aaf9f){logger['info']('SACreditNoteDetail,\x20%s,\x20%s',_0x2da875,'request\x20sent');logger[_0xd5bd('0xb')](_0xd5bd('0xc'),_0x2da875,_0xd5bd('0xd'),JSON[_0xd5bd('0xe')](_0x3aaf9f));if(_0x3aaf9f[_0xd5bd('0xf')]){if(_0x3aaf9f['error'][_0xd5bd('0x10')]===0x1f4){logger['error'](_0xd5bd('0x11'),_0x2da875,_0x3aaf9f[_0xd5bd('0xf')]['message']);return _0x3b6f3f(_0x3aaf9f[_0xd5bd('0xf')][_0xd5bd('0x12')]);}logger[_0xd5bd('0xf')](_0xd5bd('0x11'),_0x2da875,_0x3aaf9f[_0xd5bd('0xf')][_0xd5bd('0x12')]);return _0x698550(_0x3aaf9f['error'][_0xd5bd('0x12')]);}else{logger['info'](_0xd5bd('0x11'),_0x2da875,_0xd5bd('0xd'));_0x698550(_0x3aaf9f[_0xd5bd('0x13')][_0xd5bd('0x12')]);}})[_0xd5bd('0x14')](function(_0x40a589){logger['error'](_0xd5bd('0x11'),_0x2da875,_0x40a589);_0x3b6f3f(_0x40a589);});});} \ No newline at end of file +var _0x829c=['bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SACreditNoteDetail,\x20%s,\x20%s','debug','error','code','message','catch','lodash','util'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x829c,0x96));var _0xc829=function(_0x23d849,_0x43c31d){_0x23d849=_0x23d849-0x0;var _0x56acc2=_0x829c[_0x23d849];return _0x56acc2;};'use strict';var _=require(_0xc829('0x0'));var util=require(_0xc829('0x1'));var moment=require('moment');var BPromise=require(_0xc829('0x2'));var rs=require(_0xc829('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc829('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc829('0x5'))(_0xc829('0x6'));var config=require(_0xc829('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc829('0x8')][_0xc829('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x218a6c,_0x2f61c4,_0x4e322d){return new BPromise(function(_0x5e4ae3,_0x4b0449){return client[_0xc829('0xa')](_0x218a6c,_0x4e322d)[_0xc829('0xb')](function(_0xa784c3){logger[_0xc829('0xc')](_0xc829('0xd'),_0x2f61c4,'request\x20sent');logger[_0xc829('0xe')]('SACreditNoteDetail,\x20%s,\x20%s,\x20%s',_0x2f61c4,'request\x20sent',JSON['stringify'](_0xa784c3));if(_0xa784c3[_0xc829('0xf')]){if(_0xa784c3['error'][_0xc829('0x10')]===0x1f4){logger[_0xc829('0xf')](_0xc829('0xd'),_0x2f61c4,_0xa784c3[_0xc829('0xf')][_0xc829('0x11')]);return _0x4b0449(_0xa784c3[_0xc829('0xf')]['message']);}logger[_0xc829('0xf')]('SACreditNoteDetail,\x20%s,\x20%s',_0x2f61c4,_0xa784c3[_0xc829('0xf')]['message']);return _0x5e4ae3(_0xa784c3[_0xc829('0xf')]['message']);}else{logger[_0xc829('0xc')](_0xc829('0xd'),_0x2f61c4,'request\x20sent');_0x5e4ae3(_0xa784c3['result'][_0xc829('0x11')]);}})[_0xc829('0x12')](function(_0x46472c){logger[_0xc829('0xf')](_0xc829('0xd'),_0x2f61c4,_0x46472c);_0x4b0449(_0x46472c);});});} \ No newline at end of file diff --git a/server/api/saCreditNoteNumber/index.js b/server/api/saCreditNoteNumber/index.js index 6a48474..1babd14 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 _0xacec=['/:id','show','post','create','put','update','destroy','path','connect-timeout','../../components/interaction/service','../../config/environment','./saCreditNoteNumber.controller','get','isAuthenticated','/describe','describe'];(function(_0x9dd098,_0x159c59){var _0x5efe1f=function(_0x3a5c06){while(--_0x3a5c06){_0x9dd098['push'](_0x9dd098['shift']());}};_0x5efe1f(++_0x159c59);}(_0xacec,0x1e7));var _0xcace=function(_0x46e1b0,_0x145a6d){_0x46e1b0=_0x46e1b0-0x0;var _0x31520a=_0xacec[_0x46e1b0];return _0x31520a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcace('0x0'));var timeout=require(_0xcace('0x1'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xcace('0x2'));var config=require(_0xcace('0x3'));var controller=require(_0xcace('0x4'));router[_0xcace('0x5')]('/',auth[_0xcace('0x6')](),controller['index']);router[_0xcace('0x5')](_0xcace('0x7'),auth[_0xcace('0x6')](),controller[_0xcace('0x8')]);router[_0xcace('0x5')](_0xcace('0x9'),auth[_0xcace('0x6')](),controller[_0xcace('0xa')]);router[_0xcace('0xb')]('/',auth[_0xcace('0x6')](),controller[_0xcace('0xc')]);router[_0xcace('0xd')]('/:id',auth[_0xcace('0x6')](),controller[_0xcace('0xe')]);router['delete'](_0xcace('0x9'),auth[_0xcace('0x6')](),controller[_0xcace('0xf')]);module['exports']=router; \ No newline at end of file +var _0xe7d5=['describe','/:id','show','post','put','update','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./saCreditNoteNumber.controller','get','isAuthenticated','index','/describe'];(function(_0x13eca7,_0x29b30d){var _0x1abd34=function(_0x49ec9d){while(--_0x49ec9d){_0x13eca7['push'](_0x13eca7['shift']());}};_0x1abd34(++_0x29b30d);}(_0xe7d5,0x1c1));var _0x5e7d=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xe7d5[_0x49ca18];return _0x145d54;};'use strict';var multer=require(_0x5e7d('0x0'));var util=require(_0x5e7d('0x1'));var path=require(_0x5e7d('0x2'));var timeout=require('connect-timeout');var express=require(_0x5e7d('0x3'));var router=express[_0x5e7d('0x4')]();var auth=require(_0x5e7d('0x5'));var interaction=require(_0x5e7d('0x6'));var config=require(_0x5e7d('0x7'));var controller=require(_0x5e7d('0x8'));router[_0x5e7d('0x9')]('/',auth[_0x5e7d('0xa')](),controller[_0x5e7d('0xb')]);router[_0x5e7d('0x9')](_0x5e7d('0xc'),auth['isAuthenticated'](),controller[_0x5e7d('0xd')]);router[_0x5e7d('0x9')](_0x5e7d('0xe'),auth[_0x5e7d('0xa')](),controller[_0x5e7d('0xf')]);router[_0x5e7d('0x10')]('/',auth[_0x5e7d('0xa')](),controller['create']);router[_0x5e7d('0x11')](_0x5e7d('0xe'),auth['isAuthenticated'](),controller[_0x5e7d('0x12')]);router['delete'](_0x5e7d('0xe'),auth[_0x5e7d('0xa')](),controller[_0x5e7d('0x13')]);module[_0x5e7d('0x14')]=router; \ No newline at end of file diff --git a/server/api/saCreditNoteNumber/saCreditNoteNumber.attributes.js b/server/api/saCreditNoteNumber/saCreditNoteNumber.attributes.js index 5bde730..d6dadca 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 _0xec51=['sequelize'];(function(_0x373aec,_0x3d0a73){var _0x3f0d00=function(_0x12c73e){while(--_0x12c73e){_0x373aec['push'](_0x373aec['shift']());}};_0x3f0d00(++_0x3d0a73);}(_0xec51,0x6b));var _0x1ec5=function(_0x2b9b5f,_0x24c34b){_0x2b9b5f=_0x2b9b5f-0x0;var _0xfab9e=_0xec51[_0x2b9b5f];return _0xfab9e;};'use strict';var Sequelize=require(_0x1ec5('0x0'));module['exports']={'year':{'type':Sequelize['INTEGER']},'number':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xd272=['exports','INTEGER','sequelize'];(function(_0x37e342,_0x160c8f){var _0x1768f9=function(_0x413c98){while(--_0x413c98){_0x37e342['push'](_0x37e342['shift']());}};_0x1768f9(++_0x160c8f);}(_0xd272,0x1c1));var _0x2d27=function(_0x41472f,_0x45d03d){_0x41472f=_0x41472f-0x0;var _0x35043e=_0xd272[_0x41472f];return _0x35043e;};'use strict';var Sequelize=require(_0x2d27('0x0'));module[_0x2d27('0x1')]={'year':{'type':Sequelize[_0x2d27('0x2')]},'number':{'type':Sequelize[_0x2d27('0x2')]}}; \ No newline at end of file diff --git a/server/api/saCreditNoteNumber/saCreditNoteNumber.controller.js b/server/api/saCreditNoteNumber/saCreditNoteNumber.controller.js index 3e975a3..22f7e6c 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 _0x808e=['update','then','destroy','error','stack','name','send','index','SACreditNoteNumber','rawAttributes','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','include','findAll','catch','show','params','filters','includeAll','find','body','describe','html-pdf','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject'];(function(_0x54a502,_0x2ce0b6){var _0x15830b=function(_0x571770){while(--_0x571770){_0x54a502['push'](_0x54a502['shift']());}};_0x15830b(++_0x2ce0b6);}(_0x808e,0x104));var _0xe808=function(_0x2df507,_0x553862){_0x2df507=_0x2df507-0x0;var _0x1f7167=_0x808e[_0x2df507];return _0x1f7167;};'use strict';var pdf=require(_0xe808('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe808('0x1'));var rp=require('request-promise');var moment=require(_0xe808('0x2'));var BPromise=require(_0xe808('0x3'));var Mustache=require(_0xe808('0x4'));var util=require(_0xe808('0x5'));var path=require(_0xe808('0x6'));var sox=require(_0xe808('0x7'));var csv=require('to-csv');var ejs=require(_0xe808('0x8'));var fs=require('fs');var _=require(_0xe808('0x9'));var squel=require(_0xe808('0xa'));var crypto=require(_0xe808('0xb'));var jsforce=require(_0xe808('0xc'));var deskjs=require(_0xe808('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe808('0xe'));var Papa=require('papaparse');var Redis=require(_0xe808('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe808('0x10'));var hardwareService=require(_0xe808('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xe808('0x12'));var config=require(_0xe808('0x13'));var db=require(_0xe808('0x14'))['db'];function respondWithStatusCode(_0x385827,_0x455f31){_0x455f31=_0x455f31||0xcc;return function(_0x5bfe8d){if(_0x5bfe8d){return _0x385827[_0xe808('0x15')](_0x455f31);}return _0x385827[_0xe808('0x16')](_0x455f31)[_0xe808('0x17')]();};}function respondWithResult(_0x4397ea,_0x4a734e){_0x4a734e=_0x4a734e||0xc8;return function(_0x4611e4){if(_0x4611e4){return _0x4397ea['status'](_0x4a734e)[_0xe808('0x18')](_0x4611e4);}};}function respondWithFilteredResult(_0x1fe884,_0x169081){return function(_0x5c6170){if(_0x5c6170){var _0x4296f3=_0x5c6170[_0xe808('0x19')],_0x2d8f39=_0x169081[_0xe808('0x1a')],_0x1de03e=_0x169081[_0xe808('0x1a')]+_0x169081[_0xe808('0x1b')],_0x3c04f7;if(_0x1de03e>=_0x4296f3){_0x1de03e=_0x4296f3;_0x3c04f7=0xc8;}else{_0x3c04f7=0xce;}_0x1fe884[_0xe808('0x16')](_0x3c04f7);return _0x1fe884[_0xe808('0x1c')](_0xe808('0x1d'),_0x2d8f39+'-'+_0x1de03e+'/'+_0x4296f3)[_0xe808('0x18')](_0x5c6170);}return null;};}function patchUpdates(_0x49ae92){return function(_0x8316fc){try{jsonpatch[_0xe808('0x1e')](_0x8316fc,_0x49ae92,!![]);}catch(_0x1e5806){return BPromise[_0xe808('0x1f')](_0x1e5806);}return _0x8316fc['save']();};}function saveUpdates(_0x24037d,_0x1ebd7a){return function(_0x218687){if(_0x218687){return _0x218687[_0xe808('0x20')](_0x24037d)[_0xe808('0x21')](function(_0x14341a){return _0x14341a;});}return null;};}function removeEntity(_0x593f0d,_0x1d6f01){return function(_0x134e46){if(_0x134e46){return _0x134e46[_0xe808('0x22')]()[_0xe808('0x21')](function(){_0x593f0d[_0xe808('0x16')](0xcc)[_0xe808('0x17')]();});}};}function handleEntityNotFound(_0x4ec401,_0x53f371){return function(_0x10e0f3){if(!_0x10e0f3){_0x4ec401['sendStatus'](0x194);}return _0x10e0f3;};}function handleError(_0x1e73b5,_0x114074){_0x114074=_0x114074||0x1f4;return function(_0x598dfa){logger[_0xe808('0x23')](_0x598dfa[_0xe808('0x24')]);if(_0x598dfa[_0xe808('0x25')]){delete _0x598dfa['name'];}_0x1e73b5[_0xe808('0x16')](_0x114074)[_0xe808('0x26')](_0x598dfa);};}exports[_0xe808('0x27')]=function(_0x3f27c5,_0x817a20){var _0x2fada0={},_0x57e2b6={},_0x1ae16f={'count':0x0,'rows':[]};var _0x53d137=db[_0xe808('0x28')][_0xe808('0x29')];_0x57e2b6['model']=_['keys'](_0x53d137);_0x57e2b6[_0xe808('0x2a')]=_[_0xe808('0x2b')](_0x3f27c5[_0xe808('0x2a')]);_0x57e2b6['filters']=_['intersection'](_0x57e2b6[_0xe808('0x2c')],_0x57e2b6[_0xe808('0x2a')]);_0x2fada0[_0xe808('0x2d')]=_[_0xe808('0x2e')](_0x57e2b6[_0xe808('0x2c')],qs[_0xe808('0x2f')](_0x3f27c5[_0xe808('0x2a')][_0xe808('0x2f')]));_0x2fada0[_0xe808('0x2d')]=_0x2fada0[_0xe808('0x2d')][_0xe808('0x30')]?_0x2fada0[_0xe808('0x2d')]:_0x57e2b6[_0xe808('0x2c')];if(!_0x3f27c5[_0xe808('0x2a')][_0xe808('0x31')](_0xe808('0x32'))){_0x2fada0[_0xe808('0x1b')]=qs[_0xe808('0x1b')](_0x3f27c5['query'][_0xe808('0x1b')]);_0x2fada0[_0xe808('0x1a')]=qs[_0xe808('0x1a')](_0x3f27c5[_0xe808('0x2a')][_0xe808('0x1a')]);}_0x2fada0[_0xe808('0x33')]=qs[_0xe808('0x34')](_0x3f27c5[_0xe808('0x2a')]['sort']);_0x2fada0[_0xe808('0x35')]=qs['filters'](_[_0xe808('0x36')](_0x3f27c5[_0xe808('0x2a')],_0x57e2b6['filters']));if(_0x3f27c5[_0xe808('0x2a')][_0xe808('0x37')]){_0x2fada0['where']=_[_0xe808('0x38')](_0x2fada0[_0xe808('0x35')],{'$or':_[_0xe808('0x39')](_0x53d137,function(_0x1f73ce){if(_0x1f73ce[_0xe808('0x3a')][_0xe808('0x3b')]!==_0xe808('0x3c')){var _0x1c1809={};_0x1c1809[_0x1f73ce[_0xe808('0x3d')]]={'$like':'%'+_0x3f27c5[_0xe808('0x2a')]['filter']+'%'};return _0x1c1809;}})});}_0x2fada0=_[_0xe808('0x38')]({},_0x2fada0,_0x3f27c5[_0xe808('0x3e')]);var _0x30e5be={'where':_0x2fada0[_0xe808('0x35')]};return db[_0xe808('0x28')][_0xe808('0x19')](_0x30e5be)[_0xe808('0x21')](function(_0x1bc12c){_0x1ae16f[_0xe808('0x19')]=_0x1bc12c;if(_0x3f27c5[_0xe808('0x2a')]['includeAll']){_0x2fada0[_0xe808('0x3f')]=[{'all':!![]}];}return db[_0xe808('0x28')][_0xe808('0x40')](_0x2fada0);})[_0xe808('0x21')](function(_0x1f08a1){_0x1ae16f['rows']=_0x1f08a1;return _0x1ae16f;})[_0xe808('0x21')](respondWithFilteredResult(_0x817a20,_0x2fada0))[_0xe808('0x41')](handleError(_0x817a20,null));};exports[_0xe808('0x42')]=function(_0x166363,_0xb57782){var _0x178b93={'raw':![],'where':{'id':_0x166363[_0xe808('0x43')]['id']}},_0x3c63cd={};_0x3c63cd[_0xe808('0x2c')]=_[_0xe808('0x2b')](db[_0xe808('0x28')]['rawAttributes']);_0x3c63cd['query']=_['keys'](_0x166363[_0xe808('0x2a')]);_0x3c63cd[_0xe808('0x44')]=_[_0xe808('0x2e')](_0x3c63cd[_0xe808('0x2c')],_0x3c63cd[_0xe808('0x2a')]);_0x178b93[_0xe808('0x2d')]=_['intersection'](_0x3c63cd['model'],qs[_0xe808('0x2f')](_0x166363[_0xe808('0x2a')][_0xe808('0x2f')]));_0x178b93['attributes']=_0x178b93[_0xe808('0x2d')][_0xe808('0x30')]?_0x178b93[_0xe808('0x2d')]:_0x3c63cd[_0xe808('0x2c')];if(_0x166363[_0xe808('0x2a')][_0xe808('0x45')]){_0x178b93[_0xe808('0x3f')]=[{'all':!![]}];}_0x178b93=_[_0xe808('0x38')]({},_0x178b93,_0x166363[_0xe808('0x3e')]);return db[_0xe808('0x28')][_0xe808('0x46')](_0x178b93)[_0xe808('0x21')](handleEntityNotFound(_0xb57782,null))[_0xe808('0x21')](respondWithResult(_0xb57782,null))[_0xe808('0x41')](handleError(_0xb57782,null));};exports['create']=function(_0x3f47d8,_0x10bb5d){return db[_0xe808('0x28')]['create'](_0x3f47d8[_0xe808('0x47')],{})[_0xe808('0x21')](respondWithResult(_0x10bb5d,0xc9))[_0xe808('0x41')](handleError(_0x10bb5d,null));};exports['update']=function(_0x572ccc,_0xd897e6){if(_0x572ccc[_0xe808('0x47')]['id']){delete _0x572ccc['body']['id'];}return db['SACreditNoteNumber']['find']({'where':{'id':_0x572ccc[_0xe808('0x43')]['id']}})[_0xe808('0x21')](handleEntityNotFound(_0xd897e6,null))[_0xe808('0x21')](saveUpdates(_0x572ccc[_0xe808('0x47')],null))['then'](respondWithResult(_0xd897e6,null))['catch'](handleError(_0xd897e6,null));};exports[_0xe808('0x22')]=function(_0x11d14b,_0xcae2e2){return db[_0xe808('0x28')][_0xe808('0x46')]({'where':{'id':_0x11d14b[_0xe808('0x43')]['id']}})[_0xe808('0x21')](handleEntityNotFound(_0xcae2e2,null))[_0xe808('0x21')](removeEntity(_0xcae2e2,null))[_0xe808('0x41')](handleError(_0xcae2e2,null));};exports[_0xe808('0x48')]=function(_0x1cf02c,_0x3c670f){return db['SACreditNoteNumber']['describe']()[_0xe808('0x21')](respondWithResult(_0x3c670f,null))['catch'](handleError(_0x3c670f,null));}; \ No newline at end of file +var _0xf590=['sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','then','destroy','error','name','send','index','SACreditNoteNumber','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','map','key','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x7d4f89,_0x127e1d){var _0x417670=function(_0xc5ffea){while(--_0xc5ffea){_0x7d4f89['push'](_0x7d4f89['shift']());}};_0x417670(++_0x127e1d);}(_0xf590,0x7a));var _0x0f59=function(_0x23b2b4,_0x1af875){_0x23b2b4=_0x23b2b4-0x0;var _0x4918ae=_0xf590[_0x23b2b4];return _0x4918ae;};'use strict';var pdf=require(_0x0f59('0x0'));var emlformat=require(_0x0f59('0x1'));var rimraf=require(_0x0f59('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0f59('0x3'));var rp=require(_0x0f59('0x4'));var moment=require(_0x0f59('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0f59('0x6'));var util=require(_0x0f59('0x7'));var path=require(_0x0f59('0x8'));var sox=require(_0x0f59('0x9'));var csv=require(_0x0f59('0xa'));var ejs=require(_0x0f59('0xb'));var fs=require('fs');var _=require(_0x0f59('0xc'));var squel=require('squel');var crypto=require(_0x0f59('0xd'));var jsforce=require(_0x0f59('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0f59('0xa'));var querystring=require(_0x0f59('0xf'));var Papa=require(_0x0f59('0x10'));var Redis=require(_0x0f59('0x11'));var authService=require(_0x0f59('0x12'));var qs=require(_0x0f59('0x13'));var hardwareService=require(_0x0f59('0x14'));var logger=require(_0x0f59('0x15'))(_0x0f59('0x16'));var utils=require(_0x0f59('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27d13d,_0x187914){_0x187914=_0x187914||0xcc;return function(_0x3f44c9){if(_0x3f44c9){return _0x27d13d[_0x0f59('0x18')](_0x187914);}return _0x27d13d['status'](_0x187914)[_0x0f59('0x19')]();};}function respondWithResult(_0x469bef,_0x259e8b){_0x259e8b=_0x259e8b||0xc8;return function(_0xacb68e){if(_0xacb68e){return _0x469bef[_0x0f59('0x1a')](_0x259e8b)[_0x0f59('0x1b')](_0xacb68e);}};}function respondWithFilteredResult(_0x5ca9a5,_0x17bde3){return function(_0x150892){if(_0x150892){var _0x4becd3=_0x150892[_0x0f59('0x1c')],_0x2c48a2=_0x17bde3[_0x0f59('0x1d')],_0x261136=_0x17bde3[_0x0f59('0x1d')]+_0x17bde3[_0x0f59('0x1e')],_0x1601b2;if(_0x261136>=_0x4becd3){_0x261136=_0x4becd3;_0x1601b2=0xc8;}else{_0x1601b2=0xce;}_0x5ca9a5['status'](_0x1601b2);return _0x5ca9a5[_0x0f59('0x1f')](_0x0f59('0x20'),_0x2c48a2+'-'+_0x261136+'/'+_0x4becd3)[_0x0f59('0x1b')](_0x150892);}return null;};}function patchUpdates(_0x359afd){return function(_0x145a22){try{jsonpatch[_0x0f59('0x21')](_0x145a22,_0x359afd,!![]);}catch(_0x5e2aff){return BPromise[_0x0f59('0x22')](_0x5e2aff);}return _0x145a22['save']();};}function saveUpdates(_0x163984,_0x1b99f1){return function(_0x1a737d){if(_0x1a737d){return _0x1a737d['update'](_0x163984)[_0x0f59('0x23')](function(_0x42f171){return _0x42f171;});}return null;};}function removeEntity(_0xbffdea,_0x3ee3ab){return function(_0x4b372a){if(_0x4b372a){return _0x4b372a[_0x0f59('0x24')]()[_0x0f59('0x23')](function(){_0xbffdea[_0x0f59('0x1a')](0xcc)[_0x0f59('0x19')]();});}};}function handleEntityNotFound(_0x111c9d,_0x11597d){return function(_0x219797){if(!_0x219797){_0x111c9d[_0x0f59('0x18')](0x194);}return _0x219797;};}function handleError(_0x2d1023,_0x1aad7a){_0x1aad7a=_0x1aad7a||0x1f4;return function(_0x8cf481){logger[_0x0f59('0x25')](_0x8cf481['stack']);if(_0x8cf481[_0x0f59('0x26')]){delete _0x8cf481[_0x0f59('0x26')];}_0x2d1023[_0x0f59('0x1a')](_0x1aad7a)[_0x0f59('0x27')](_0x8cf481);};}exports[_0x0f59('0x28')]=function(_0x185530,_0x3400e5){var _0xa5b386={},_0x15fdd0={},_0x9982d5={'count':0x0,'rows':[]};var _0x4b17d5=db[_0x0f59('0x29')][_0x0f59('0x2a')];_0x15fdd0[_0x0f59('0x2b')]=_['keys'](_0x4b17d5);_0x15fdd0[_0x0f59('0x2c')]=_[_0x0f59('0x2d')](_0x185530[_0x0f59('0x2c')]);_0x15fdd0[_0x0f59('0x2e')]=_[_0x0f59('0x2f')](_0x15fdd0[_0x0f59('0x2b')],_0x15fdd0[_0x0f59('0x2c')]);_0xa5b386[_0x0f59('0x30')]=_[_0x0f59('0x2f')](_0x15fdd0[_0x0f59('0x2b')],qs[_0x0f59('0x31')](_0x185530[_0x0f59('0x2c')][_0x0f59('0x31')]));_0xa5b386[_0x0f59('0x30')]=_0xa5b386['attributes'][_0x0f59('0x32')]?_0xa5b386[_0x0f59('0x30')]:_0x15fdd0[_0x0f59('0x2b')];if(!_0x185530[_0x0f59('0x2c')]['hasOwnProperty'](_0x0f59('0x33'))){_0xa5b386[_0x0f59('0x1e')]=qs[_0x0f59('0x1e')](_0x185530[_0x0f59('0x2c')]['limit']);_0xa5b386[_0x0f59('0x1d')]=qs['offset'](_0x185530['query']['offset']);}_0xa5b386[_0x0f59('0x34')]=qs[_0x0f59('0x35')](_0x185530[_0x0f59('0x2c')][_0x0f59('0x35')]);_0xa5b386[_0x0f59('0x36')]=qs['filters'](_[_0x0f59('0x37')](_0x185530[_0x0f59('0x2c')],_0x15fdd0['filters']));if(_0x185530[_0x0f59('0x2c')][_0x0f59('0x38')]){_0xa5b386[_0x0f59('0x36')]=_['merge'](_0xa5b386[_0x0f59('0x36')],{'$or':_[_0x0f59('0x39')](_0x4b17d5,function(_0x49d085){if(_0x49d085['type'][_0x0f59('0x3a')]!==_0x0f59('0x3b')){var _0x33af0f={};_0x33af0f[_0x49d085['field']]={'$like':'%'+_0x185530['query'][_0x0f59('0x38')]+'%'};return _0x33af0f;}})});}_0xa5b386=_[_0x0f59('0x3c')]({},_0xa5b386,_0x185530[_0x0f59('0x3d')]);var _0x3ac355={'where':_0xa5b386[_0x0f59('0x36')]};return db[_0x0f59('0x29')][_0x0f59('0x1c')](_0x3ac355)[_0x0f59('0x23')](function(_0x146ca1){_0x9982d5[_0x0f59('0x1c')]=_0x146ca1;if(_0x185530['query'][_0x0f59('0x3e')]){_0xa5b386[_0x0f59('0x3f')]=[{'all':!![]}];}return db['SACreditNoteNumber'][_0x0f59('0x40')](_0xa5b386);})[_0x0f59('0x23')](function(_0x521e88){_0x9982d5[_0x0f59('0x41')]=_0x521e88;return _0x9982d5;})[_0x0f59('0x23')](respondWithFilteredResult(_0x3400e5,_0xa5b386))[_0x0f59('0x42')](handleError(_0x3400e5,null));};exports[_0x0f59('0x43')]=function(_0x2ca561,_0x1bb4ca){var _0x17d548={'raw':![],'where':{'id':_0x2ca561[_0x0f59('0x44')]['id']}},_0x1d19b9={};_0x1d19b9[_0x0f59('0x2b')]=_[_0x0f59('0x2d')](db['SACreditNoteNumber'][_0x0f59('0x2a')]);_0x1d19b9[_0x0f59('0x2c')]=_[_0x0f59('0x2d')](_0x2ca561[_0x0f59('0x2c')]);_0x1d19b9[_0x0f59('0x2e')]=_['intersection'](_0x1d19b9[_0x0f59('0x2b')],_0x1d19b9[_0x0f59('0x2c')]);_0x17d548[_0x0f59('0x30')]=_[_0x0f59('0x2f')](_0x1d19b9[_0x0f59('0x2b')],qs['fields'](_0x2ca561[_0x0f59('0x2c')][_0x0f59('0x31')]));_0x17d548['attributes']=_0x17d548[_0x0f59('0x30')][_0x0f59('0x32')]?_0x17d548['attributes']:_0x1d19b9[_0x0f59('0x2b')];if(_0x2ca561[_0x0f59('0x2c')][_0x0f59('0x3e')]){_0x17d548[_0x0f59('0x3f')]=[{'all':!![]}];}_0x17d548=_[_0x0f59('0x3c')]({},_0x17d548,_0x2ca561[_0x0f59('0x3d')]);return db[_0x0f59('0x29')][_0x0f59('0x45')](_0x17d548)[_0x0f59('0x23')](handleEntityNotFound(_0x1bb4ca,null))['then'](respondWithResult(_0x1bb4ca,null))[_0x0f59('0x42')](handleError(_0x1bb4ca,null));};exports[_0x0f59('0x46')]=function(_0x5dadef,_0x2aba64){return db[_0x0f59('0x29')]['create'](_0x5dadef[_0x0f59('0x47')],{})[_0x0f59('0x23')](respondWithResult(_0x2aba64,0xc9))[_0x0f59('0x42')](handleError(_0x2aba64,null));};exports['update']=function(_0x5443e6,_0x290fb8){if(_0x5443e6[_0x0f59('0x47')]['id']){delete _0x5443e6[_0x0f59('0x47')]['id'];}return db[_0x0f59('0x29')][_0x0f59('0x45')]({'where':{'id':_0x5443e6['params']['id']}})[_0x0f59('0x23')](handleEntityNotFound(_0x290fb8,null))['then'](saveUpdates(_0x5443e6['body'],null))['then'](respondWithResult(_0x290fb8,null))[_0x0f59('0x42')](handleError(_0x290fb8,null));};exports[_0x0f59('0x24')]=function(_0x30061b,_0x59ebf6){return db[_0x0f59('0x29')][_0x0f59('0x45')]({'where':{'id':_0x30061b['params']['id']}})[_0x0f59('0x23')](handleEntityNotFound(_0x59ebf6,null))[_0x0f59('0x23')](removeEntity(_0x59ebf6,null))[_0x0f59('0x42')](handleError(_0x59ebf6,null));};exports[_0x0f59('0x48')]=function(_0x107cc2,_0x192a6e){return db[_0x0f59('0x29')][_0x0f59('0x48')]()['then'](respondWithResult(_0x192a6e,null))[_0x0f59('0x42')](handleError(_0x192a6e,null));}; \ No newline at end of file diff --git a/server/api/saCreditNoteNumber/saCreditNoteNumber.model.js b/server/api/saCreditNoteNumber/saCreditNoteNumber.model.js index faae835..11b9219 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 _0x0dd9=['./saCreditNoteNumber.attributes','define','SACreditNoteNumber','sa_creditNote_numbers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0x0dd9,0xc7));var _0x90dd=function(_0x3f6cdf,_0x43c5e0){_0x3f6cdf=_0x3f6cdf-0x0;var _0x486ace=_0x0dd9[_0x3f6cdf];return _0x486ace;};'use strict';var _=require(_0x90dd('0x0'));var util=require(_0x90dd('0x1'));var logger=require(_0x90dd('0x2'))(_0x90dd('0x3'));var moment=require(_0x90dd('0x4'));var BPromise=require(_0x90dd('0x5'));var rp=require(_0x90dd('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x90dd('0x7'));var config=require(_0x90dd('0x8'));var attributes=require(_0x90dd('0x9'));module['exports']=function(_0x5456ec,_0x1d0c2a){return _0x5456ec[_0x90dd('0xa')](_0x90dd('0xb'),attributes,{'tableName':_0x90dd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd811=['./saCreditNoteNumber.attributes','exports','define','SACreditNoteNumber','sa_creditNote_numbers','lodash','util','moment','bluebird','request-promise','rimraf'];(function(_0xab8365,_0x3409d1){var _0x1f88f5=function(_0x1ac0de){while(--_0x1ac0de){_0xab8365['push'](_0xab8365['shift']());}};_0x1f88f5(++_0x3409d1);}(_0xd811,0x165));var _0x1d81=function(_0x48fcee,_0x431a8b){_0x48fcee=_0x48fcee-0x0;var _0x28d65a=_0xd811[_0x48fcee];return _0x28d65a;};'use strict';var _=require(_0x1d81('0x0'));var util=require(_0x1d81('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1d81('0x2'));var BPromise=require(_0x1d81('0x3'));var rp=require(_0x1d81('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1d81('0x5'));var config=require('../../config/environment');var attributes=require(_0x1d81('0x6'));module[_0x1d81('0x7')]=function(_0x41d857,_0x3c0e8d){return _0x41d857[_0x1d81('0x8')](_0x1d81('0x9'),attributes,{'tableName':_0x1d81('0xa'),'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 c31875a..fb4a712 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 _0xd80d=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SACreditNoteNumber,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb'];(function(_0x2d8f09,_0x5d3fe8){var _0x31876d=function(_0x2a3fcf){while(--_0x2a3fcf){_0x2d8f09['push'](_0x2d8f09['shift']());}};_0x31876d(++_0x5d3fe8);}(_0xd80d,0x10f));var _0xdd80=function(_0x1a8e9b,_0x295bda){_0x1a8e9b=_0x1a8e9b-0x0;var _0x82b35d=_0xd80d[_0x1a8e9b];return _0x82b35d;};'use strict';var _=require(_0xdd80('0x0'));var util=require(_0xdd80('0x1'));var moment=require('moment');var BPromise=require(_0xdd80('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdd80('0x3'));var db=require(_0xdd80('0x4'))['db'];var utils=require(_0xdd80('0x5'));var logger=require(_0xdd80('0x6'))(_0xdd80('0x7'));var config=require(_0xdd80('0x8'));var jayson=require(_0xdd80('0x9'));var client=jayson[_0xdd80('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1da086,_0x591530,_0x4f8e3a){return new BPromise(function(_0xc82da5,_0x3342f6){return client[_0xdd80('0xb')](_0x1da086,_0x4f8e3a)[_0xdd80('0xc')](function(_0x2b25ac){logger[_0xdd80('0xd')](_0xdd80('0xe'),_0x591530,_0xdd80('0xf'));logger[_0xdd80('0x10')]('SACreditNoteNumber,\x20%s,\x20%s,\x20%s',_0x591530,'request\x20sent',JSON[_0xdd80('0x11')](_0x2b25ac));if(_0x2b25ac[_0xdd80('0x12')]){if(_0x2b25ac[_0xdd80('0x12')][_0xdd80('0x13')]===0x1f4){logger[_0xdd80('0x12')](_0xdd80('0xe'),_0x591530,_0x2b25ac[_0xdd80('0x12')][_0xdd80('0x14')]);return _0x3342f6(_0x2b25ac[_0xdd80('0x12')]['message']);}logger[_0xdd80('0x12')](_0xdd80('0xe'),_0x591530,_0x2b25ac[_0xdd80('0x12')][_0xdd80('0x14')]);return _0xc82da5(_0x2b25ac[_0xdd80('0x12')][_0xdd80('0x14')]);}else{logger[_0xdd80('0xd')](_0xdd80('0xe'),_0x591530,'request\x20sent');_0xc82da5(_0x2b25ac[_0xdd80('0x15')][_0xdd80('0x14')]);}})[_0xdd80('0x16')](function(_0x23ef21){logger['error'](_0xdd80('0xe'),_0x591530,_0x23ef21);_0x3342f6(_0x23ef21);});});} \ No newline at end of file +var _0xf459=['error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','info','SACreditNoteNumber,\x20%s,\x20%s','debug','SACreditNoteNumber,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x16239b,_0x4ab921){var _0x1b422c=function(_0x373865){while(--_0x373865){_0x16239b['push'](_0x16239b['shift']());}};_0x1b422c(++_0x4ab921);}(_0xf459,0x16a));var _0x9f45=function(_0x46a3e8,_0x2e1b35){_0x46a3e8=_0x46a3e8-0x0;var _0xf1442e=_0xf459[_0x46a3e8];return _0xf1442e;};'use strict';var _=require(_0x9f45('0x0'));var util=require(_0x9f45('0x1'));var moment=require(_0x9f45('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9f45('0x3'));var db=require(_0x9f45('0x4'))['db'];var utils=require(_0x9f45('0x5'));var logger=require('../../config/logger')(_0x9f45('0x6'));var config=require(_0x9f45('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9f45('0x8')][_0x9f45('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xef77e0,_0x2a9a61,_0xe51c9b){return new BPromise(function(_0x2ee184,_0x52feda){return client['request'](_0xef77e0,_0xe51c9b)['then'](function(_0x5bcbb8){logger[_0x9f45('0xa')](_0x9f45('0xb'),_0x2a9a61,'request\x20sent');logger[_0x9f45('0xc')](_0x9f45('0xd'),_0x2a9a61,_0x9f45('0xe'),JSON[_0x9f45('0xf')](_0x5bcbb8));if(_0x5bcbb8[_0x9f45('0x10')]){if(_0x5bcbb8[_0x9f45('0x10')][_0x9f45('0x11')]===0x1f4){logger['error'](_0x9f45('0xb'),_0x2a9a61,_0x5bcbb8[_0x9f45('0x10')][_0x9f45('0x12')]);return _0x52feda(_0x5bcbb8['error'][_0x9f45('0x12')]);}logger[_0x9f45('0x10')](_0x9f45('0xb'),_0x2a9a61,_0x5bcbb8['error'][_0x9f45('0x12')]);return _0x2ee184(_0x5bcbb8[_0x9f45('0x10')]['message']);}else{logger[_0x9f45('0xa')](_0x9f45('0xb'),_0x2a9a61,_0x9f45('0xe'));_0x2ee184(_0x5bcbb8[_0x9f45('0x13')][_0x9f45('0x12')]);}})[_0x9f45('0x14')](function(_0x1b3a11){logger[_0x9f45('0x10')](_0x9f45('0xb'),_0x2a9a61,_0x1b3a11);_0x52feda(_0x1b3a11);});});} \ No newline at end of file diff --git a/server/api/saDossier/index.js b/server/api/saDossier/index.js index 0d23922..a3b9ee7 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 _0xae66=['destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./saDossier.controller','isAuthenticated','index','/describe','describe','get','/:id','post','put','update'];(function(_0x559038,_0x1fb0f9){var _0x5c1683=function(_0xb40e16){while(--_0xb40e16){_0x559038['push'](_0x559038['shift']());}};_0x5c1683(++_0x1fb0f9);}(_0xae66,0x16a));var _0x6ae6=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0xae66[_0x29d915];return _0x160f86;};'use strict';var multer=require(_0x6ae6('0x0'));var util=require(_0x6ae6('0x1'));var path=require(_0x6ae6('0x2'));var timeout=require(_0x6ae6('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x6ae6('0x4'));var interaction=require(_0x6ae6('0x5'));var config=require('../../config/environment');var controller=require(_0x6ae6('0x6'));router['get']('/',auth[_0x6ae6('0x7')](),controller[_0x6ae6('0x8')]);router['get'](_0x6ae6('0x9'),auth[_0x6ae6('0x7')](),controller[_0x6ae6('0xa')]);router[_0x6ae6('0xb')](_0x6ae6('0xc'),auth[_0x6ae6('0x7')](),controller['show']);router[_0x6ae6('0xd')]('/',auth[_0x6ae6('0x7')](),controller['create']);router[_0x6ae6('0xe')](_0x6ae6('0xc'),auth['isAuthenticated'](),controller[_0x6ae6('0xf')]);router['delete']('/:id',auth[_0x6ae6('0x7')](),controller[_0x6ae6('0x10')]);module[_0x6ae6('0x11')]=router; \ No newline at end of file +var _0x5621=['../../components/interaction/service','../../config/environment','./saDossier.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','multer','util','path','Router','../../components/auth/service'];(function(_0x1a0600,_0x41feef){var _0x734670=function(_0x2da4e4){while(--_0x2da4e4){_0x1a0600['push'](_0x1a0600['shift']());}};_0x734670(++_0x41feef);}(_0x5621,0xf7));var _0x1562=function(_0x12094b,_0x121bdf){_0x12094b=_0x12094b-0x0;var _0x40b5d0=_0x5621[_0x12094b];return _0x40b5d0;};'use strict';var multer=require(_0x1562('0x0'));var util=require(_0x1562('0x1'));var path=require(_0x1562('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1562('0x3')]();var auth=require(_0x1562('0x4'));var interaction=require(_0x1562('0x5'));var config=require(_0x1562('0x6'));var controller=require(_0x1562('0x7'));router[_0x1562('0x8')]('/',auth[_0x1562('0x9')](),controller[_0x1562('0xa')]);router[_0x1562('0x8')]('/describe',auth[_0x1562('0x9')](),controller['describe']);router[_0x1562('0x8')](_0x1562('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1562('0xc')]('/',auth[_0x1562('0x9')](),controller[_0x1562('0xd')]);router[_0x1562('0xe')](_0x1562('0xb'),auth[_0x1562('0x9')](),controller[_0x1562('0xf')]);router[_0x1562('0x10')](_0x1562('0xb'),auth[_0x1562('0x9')](),controller[_0x1562('0x11')]);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 e9de4bc..e730dc9 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 _0x4a51=['STRING','TEXT','sequelize','exports'];(function(_0x507e60,_0x50c77d){var _0xde7272=function(_0x3a54ae){while(--_0x3a54ae){_0x507e60['push'](_0x507e60['shift']());}};_0xde7272(++_0x50c77d);}(_0x4a51,0x14e));var _0x14a5=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x4a51[_0x1969a7];return _0x3d665f;};'use strict';var Sequelize=require(_0x14a5('0x0'));module[_0x14a5('0x1')]={'name':{'type':Sequelize[_0x14a5('0x2')],'allowNull':![]},'agentFullname':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x14a5('0x3')]}}; \ No newline at end of file +var _0x30e4=['STRING','exports'];(function(_0x385f31,_0x24037d){var _0x3dceb7=function(_0x1fa1d3){while(--_0x1fa1d3){_0x385f31['push'](_0x385f31['shift']());}};_0x3dceb7(++_0x24037d);}(_0x30e4,0xa7));var _0x430e=function(_0x57530a,_0x5d3a7b){_0x57530a=_0x57530a-0x0;var _0x35abf5=_0x30e4[_0x57530a];return _0x35abf5;};'use strict';var Sequelize=require('sequelize');module[_0x430e('0x0')]={'name':{'type':Sequelize[_0x430e('0x1')],'allowNull':![]},'agentFullname':{'type':Sequelize[_0x430e('0x1')]},'note':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/saDossier/saDossier.controller.js b/server/api/saDossier/saDossier.controller.js index 3e99570..4e8ef50 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 _0x9c00=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','update','then','destroy','error','name','send','index','rawAttributes','model','query','intersection','attributes','fields','nolimit','order','sort','filters','pick','where','merge','map','type','key','field','filter','include','SADossier','rows','catch','show','params','keys','length','options','find','create','body','describe','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api'];(function(_0x29ce14,_0x334166){var _0x48f289=function(_0x288d11){while(--_0x288d11){_0x29ce14['push'](_0x29ce14['shift']());}};_0x48f289(++_0x334166);}(_0x9c00,0x1a0));var _0x09c0=function(_0x380b08,_0x1df63a){_0x380b08=_0x380b08-0x0;var _0x22f65d=_0x9c00[_0x380b08];return _0x22f65d;};'use strict';var pdf=require(_0x09c0('0x0'));var emlformat=require(_0x09c0('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x09c0('0x2'));var rp=require(_0x09c0('0x3'));var moment=require('moment');var BPromise=require(_0x09c0('0x4'));var Mustache=require(_0x09c0('0x5'));var util=require(_0x09c0('0x6'));var path=require(_0x09c0('0x7'));var sox=require(_0x09c0('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x09c0('0x9'));var squel=require(_0x09c0('0xa'));var crypto=require(_0x09c0('0xb'));var jsforce=require(_0x09c0('0xc'));var deskjs=require(_0x09c0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x09c0('0xe'));var Papa=require(_0x09c0('0xf'));var Redis=require(_0x09c0('0x10'));var authService=require(_0x09c0('0x11'));var qs=require(_0x09c0('0x12'));var hardwareService=require(_0x09c0('0x13'));var logger=require(_0x09c0('0x14'))(_0x09c0('0x15'));var utils=require(_0x09c0('0x16'));var config=require(_0x09c0('0x17'));var db=require(_0x09c0('0x18'))['db'];function respondWithStatusCode(_0x2a8262,_0x2929f1){_0x2929f1=_0x2929f1||0xcc;return function(_0x144271){if(_0x144271){return _0x2a8262[_0x09c0('0x19')](_0x2929f1);}return _0x2a8262[_0x09c0('0x1a')](_0x2929f1)[_0x09c0('0x1b')]();};}function respondWithResult(_0x2a86da,_0x342ceb){_0x342ceb=_0x342ceb||0xc8;return function(_0x3649d2){if(_0x3649d2){return _0x2a86da[_0x09c0('0x1a')](_0x342ceb)[_0x09c0('0x1c')](_0x3649d2);}};}function respondWithFilteredResult(_0x152140,_0x45a265){return function(_0x33c3d6){if(_0x33c3d6){var _0x2fdf11=_0x33c3d6[_0x09c0('0x1d')],_0x4ff6b7=_0x45a265[_0x09c0('0x1e')],_0x590129=_0x45a265[_0x09c0('0x1e')]+_0x45a265[_0x09c0('0x1f')],_0x558b4f;if(_0x590129>=_0x2fdf11){_0x590129=_0x2fdf11;_0x558b4f=0xc8;}else{_0x558b4f=0xce;}_0x152140['status'](_0x558b4f);return _0x152140[_0x09c0('0x20')]('Content-Range',_0x4ff6b7+'-'+_0x590129+'/'+_0x2fdf11)['json'](_0x33c3d6);}return null;};}function patchUpdates(_0x2c12da){return function(_0x50fccc){try{jsonpatch[_0x09c0('0x21')](_0x50fccc,_0x2c12da,!![]);}catch(_0x319c36){return BPromise[_0x09c0('0x22')](_0x319c36);}return _0x50fccc['save']();};}function saveUpdates(_0x23bc34,_0x44f714){return function(_0x8ad645){if(_0x8ad645){return _0x8ad645[_0x09c0('0x23')](_0x23bc34)[_0x09c0('0x24')](function(_0xa5d16f){return _0xa5d16f;});}return null;};}function removeEntity(_0x8c6b9a,_0x5d5391){return function(_0x1695e8){if(_0x1695e8){return _0x1695e8[_0x09c0('0x25')]()[_0x09c0('0x24')](function(){_0x8c6b9a[_0x09c0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f6824,_0x321bcc){return function(_0x25fdb5){if(!_0x25fdb5){_0x4f6824[_0x09c0('0x19')](0x194);}return _0x25fdb5;};}function handleError(_0x3a5370,_0x491e6f){_0x491e6f=_0x491e6f||0x1f4;return function(_0x42ebfc){logger[_0x09c0('0x26')](_0x42ebfc['stack']);if(_0x42ebfc[_0x09c0('0x27')]){delete _0x42ebfc[_0x09c0('0x27')];}_0x3a5370[_0x09c0('0x1a')](_0x491e6f)[_0x09c0('0x28')](_0x42ebfc);};}exports[_0x09c0('0x29')]=function(_0x1d2d9d,_0x45cc64){var _0x35b61c={},_0x1ea951={},_0x1aa80e={'count':0x0,'rows':[]};var _0x46a36a=db['SADossier'][_0x09c0('0x2a')];_0x1ea951[_0x09c0('0x2b')]=_['keys'](_0x46a36a);_0x1ea951[_0x09c0('0x2c')]=_['keys'](_0x1d2d9d[_0x09c0('0x2c')]);_0x1ea951['filters']=_[_0x09c0('0x2d')](_0x1ea951[_0x09c0('0x2b')],_0x1ea951[_0x09c0('0x2c')]);_0x35b61c[_0x09c0('0x2e')]=_['intersection'](_0x1ea951['model'],qs[_0x09c0('0x2f')](_0x1d2d9d[_0x09c0('0x2c')][_0x09c0('0x2f')]));_0x35b61c['attributes']=_0x35b61c[_0x09c0('0x2e')]['length']?_0x35b61c[_0x09c0('0x2e')]:_0x1ea951[_0x09c0('0x2b')];if(!_0x1d2d9d[_0x09c0('0x2c')]['hasOwnProperty'](_0x09c0('0x30'))){_0x35b61c[_0x09c0('0x1f')]=qs[_0x09c0('0x1f')](_0x1d2d9d[_0x09c0('0x2c')][_0x09c0('0x1f')]);_0x35b61c[_0x09c0('0x1e')]=qs[_0x09c0('0x1e')](_0x1d2d9d['query'][_0x09c0('0x1e')]);}_0x35b61c[_0x09c0('0x31')]=qs[_0x09c0('0x32')](_0x1d2d9d[_0x09c0('0x2c')][_0x09c0('0x32')]);_0x35b61c['where']=qs[_0x09c0('0x33')](_[_0x09c0('0x34')](_0x1d2d9d[_0x09c0('0x2c')],_0x1ea951[_0x09c0('0x33')]));if(_0x1d2d9d[_0x09c0('0x2c')]['filter']){_0x35b61c[_0x09c0('0x35')]=_[_0x09c0('0x36')](_0x35b61c[_0x09c0('0x35')],{'$or':_[_0x09c0('0x37')](_0x46a36a,function(_0x419d1c){if(_0x419d1c[_0x09c0('0x38')][_0x09c0('0x39')]!=='VIRTUAL'){var _0x363b5c={};_0x363b5c[_0x419d1c[_0x09c0('0x3a')]]={'$like':'%'+_0x1d2d9d[_0x09c0('0x2c')][_0x09c0('0x3b')]+'%'};return _0x363b5c;}})});}_0x35b61c=_[_0x09c0('0x36')]({},_0x35b61c,_0x1d2d9d['options']);var _0x5420fd={'where':_0x35b61c['where']};return db['SADossier'][_0x09c0('0x1d')](_0x5420fd)[_0x09c0('0x24')](function(_0xfd295b){_0x1aa80e[_0x09c0('0x1d')]=_0xfd295b;if(_0x1d2d9d[_0x09c0('0x2c')]['includeAll']){_0x35b61c[_0x09c0('0x3c')]=[{'all':!![]}];}return db[_0x09c0('0x3d')]['findAll'](_0x35b61c);})[_0x09c0('0x24')](function(_0x5d50b9){_0x1aa80e[_0x09c0('0x3e')]=_0x5d50b9;return _0x1aa80e;})['then'](respondWithFilteredResult(_0x45cc64,_0x35b61c))[_0x09c0('0x3f')](handleError(_0x45cc64,null));};exports[_0x09c0('0x40')]=function(_0x56a511,_0x26a21c){var _0x17fed6={'raw':![],'where':{'id':_0x56a511[_0x09c0('0x41')]['id']}},_0x5d69fd={};_0x5d69fd[_0x09c0('0x2b')]=_[_0x09c0('0x42')](db[_0x09c0('0x3d')][_0x09c0('0x2a')]);_0x5d69fd[_0x09c0('0x2c')]=_['keys'](_0x56a511[_0x09c0('0x2c')]);_0x5d69fd[_0x09c0('0x33')]=_[_0x09c0('0x2d')](_0x5d69fd['model'],_0x5d69fd[_0x09c0('0x2c')]);_0x17fed6[_0x09c0('0x2e')]=_[_0x09c0('0x2d')](_0x5d69fd['model'],qs[_0x09c0('0x2f')](_0x56a511[_0x09c0('0x2c')]['fields']));_0x17fed6['attributes']=_0x17fed6[_0x09c0('0x2e')][_0x09c0('0x43')]?_0x17fed6['attributes']:_0x5d69fd[_0x09c0('0x2b')];if(_0x56a511[_0x09c0('0x2c')]['includeAll']){_0x17fed6[_0x09c0('0x3c')]=[{'all':!![]}];}_0x17fed6=_[_0x09c0('0x36')]({},_0x17fed6,_0x56a511[_0x09c0('0x44')]);return db[_0x09c0('0x3d')][_0x09c0('0x45')](_0x17fed6)['then'](handleEntityNotFound(_0x26a21c,null))[_0x09c0('0x24')](respondWithResult(_0x26a21c,null))['catch'](handleError(_0x26a21c,null));};exports['create']=function(_0x3f1530,_0x3a6791){return db[_0x09c0('0x3d')][_0x09c0('0x46')](_0x3f1530[_0x09c0('0x47')],{})[_0x09c0('0x24')](respondWithResult(_0x3a6791,0xc9))['catch'](handleError(_0x3a6791,null));};exports['update']=function(_0x502eff,_0xf54a1f){if(_0x502eff[_0x09c0('0x47')]['id']){delete _0x502eff[_0x09c0('0x47')]['id'];}return db['SADossier'][_0x09c0('0x45')]({'where':{'id':_0x502eff[_0x09c0('0x41')]['id']}})[_0x09c0('0x24')](handleEntityNotFound(_0xf54a1f,null))[_0x09c0('0x24')](saveUpdates(_0x502eff[_0x09c0('0x47')],null))[_0x09c0('0x24')](respondWithResult(_0xf54a1f,null))[_0x09c0('0x3f')](handleError(_0xf54a1f,null));};exports[_0x09c0('0x25')]=function(_0x3f6d14,_0x38085c){return db[_0x09c0('0x3d')][_0x09c0('0x45')]({'where':{'id':_0x3f6d14[_0x09c0('0x41')]['id']}})[_0x09c0('0x24')](handleEntityNotFound(_0x38085c,null))[_0x09c0('0x24')](removeEntity(_0x38085c,null))[_0x09c0('0x3f')](handleError(_0x38085c,null));};exports[_0x09c0('0x48')]=function(_0x14c834,_0x3ae68f){return db[_0x09c0('0x3d')]['describe']()[_0x09c0('0x24')](respondWithResult(_0x3ae68f,null))[_0x09c0('0x3f')](handleError(_0x3ae68f,null));}; \ No newline at end of file +var _0xfef3=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','update','then','destroy','stack','name','send','SADossier','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','key','VIRTUAL','merge','options','count','includeAll','include','rows','catch','show','params','rawAttributes','fields','find','create','body','describe','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x1c470d,_0x81d66b){var _0x12141b=function(_0x45bfd3){while(--_0x45bfd3){_0x1c470d['push'](_0x1c470d['shift']());}};_0x12141b(++_0x81d66b);}(_0xfef3,0x118));var _0x3fef=function(_0x3ccbc7,_0x3093c8){_0x3ccbc7=_0x3ccbc7-0x0;var _0x50c97a=_0xfef3[_0x3ccbc7];return _0x50c97a;};'use strict';var pdf=require(_0x3fef('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x3fef('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3fef('0x2'));var rp=require(_0x3fef('0x3'));var moment=require('moment');var BPromise=require(_0x3fef('0x4'));var Mustache=require(_0x3fef('0x5'));var util=require('util');var path=require(_0x3fef('0x6'));var sox=require(_0x3fef('0x7'));var csv=require('to-csv');var ejs=require(_0x3fef('0x8'));var fs=require('fs');var _=require(_0x3fef('0x9'));var squel=require(_0x3fef('0xa'));var crypto=require(_0x3fef('0xb'));var jsforce=require(_0x3fef('0xc'));var deskjs=require(_0x3fef('0xd'));var toCsv=require(_0x3fef('0xe'));var querystring=require(_0x3fef('0xf'));var Papa=require(_0x3fef('0x10'));var Redis=require(_0x3fef('0x11'));var authService=require(_0x3fef('0x12'));var qs=require(_0x3fef('0x13'));var hardwareService=require(_0x3fef('0x14'));var logger=require(_0x3fef('0x15'))('api');var utils=require(_0x3fef('0x16'));var config=require(_0x3fef('0x17'));var db=require(_0x3fef('0x18'))['db'];function respondWithStatusCode(_0x49d216,_0x1c20b3){_0x1c20b3=_0x1c20b3||0xcc;return function(_0x4c4a47){if(_0x4c4a47){return _0x49d216[_0x3fef('0x19')](_0x1c20b3);}return _0x49d216[_0x3fef('0x1a')](_0x1c20b3)[_0x3fef('0x1b')]();};}function respondWithResult(_0x5b164c,_0x42c3d2){_0x42c3d2=_0x42c3d2||0xc8;return function(_0x4be62f){if(_0x4be62f){return _0x5b164c[_0x3fef('0x1a')](_0x42c3d2)[_0x3fef('0x1c')](_0x4be62f);}};}function respondWithFilteredResult(_0x56a65d,_0x2dec1b){return function(_0x177e28){if(_0x177e28){var _0x40b479=_0x177e28['count'],_0x79b617=_0x2dec1b[_0x3fef('0x1d')],_0x395df0=_0x2dec1b[_0x3fef('0x1d')]+_0x2dec1b[_0x3fef('0x1e')],_0x2af1ba;if(_0x395df0>=_0x40b479){_0x395df0=_0x40b479;_0x2af1ba=0xc8;}else{_0x2af1ba=0xce;}_0x56a65d[_0x3fef('0x1a')](_0x2af1ba);return _0x56a65d[_0x3fef('0x1f')](_0x3fef('0x20'),_0x79b617+'-'+_0x395df0+'/'+_0x40b479)['json'](_0x177e28);}return null;};}function patchUpdates(_0x36669d){return function(_0x3eb287){try{jsonpatch['apply'](_0x3eb287,_0x36669d,!![]);}catch(_0x2c7f36){return BPromise[_0x3fef('0x21')](_0x2c7f36);}return _0x3eb287[_0x3fef('0x22')]();};}function saveUpdates(_0x218f91,_0x245332){return function(_0x2b5226){if(_0x2b5226){return _0x2b5226[_0x3fef('0x23')](_0x218f91)[_0x3fef('0x24')](function(_0x124e7c){return _0x124e7c;});}return null;};}function removeEntity(_0xd64bf4,_0x1f5aaf){return function(_0x3bb110){if(_0x3bb110){return _0x3bb110[_0x3fef('0x25')]()[_0x3fef('0x24')](function(){_0xd64bf4[_0x3fef('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b56de,_0x50025f){return function(_0x378b03){if(!_0x378b03){_0x5b56de[_0x3fef('0x19')](0x194);}return _0x378b03;};}function handleError(_0xa16dc,_0x5f047c){_0x5f047c=_0x5f047c||0x1f4;return function(_0x4d462c){logger['error'](_0x4d462c[_0x3fef('0x26')]);if(_0x4d462c[_0x3fef('0x27')]){delete _0x4d462c[_0x3fef('0x27')];}_0xa16dc[_0x3fef('0x1a')](_0x5f047c)[_0x3fef('0x28')](_0x4d462c);};}exports['index']=function(_0x4b4dee,_0x563556){var _0x121ff0={},_0x3baa52={},_0x4ea2ab={'count':0x0,'rows':[]};var _0x462ee7=db[_0x3fef('0x29')]['rawAttributes'];_0x3baa52[_0x3fef('0x2a')]=_[_0x3fef('0x2b')](_0x462ee7);_0x3baa52[_0x3fef('0x2c')]=_[_0x3fef('0x2b')](_0x4b4dee[_0x3fef('0x2c')]);_0x3baa52[_0x3fef('0x2d')]=_[_0x3fef('0x2e')](_0x3baa52['model'],_0x3baa52[_0x3fef('0x2c')]);_0x121ff0[_0x3fef('0x2f')]=_[_0x3fef('0x2e')](_0x3baa52[_0x3fef('0x2a')],qs['fields'](_0x4b4dee[_0x3fef('0x2c')]['fields']));_0x121ff0[_0x3fef('0x2f')]=_0x121ff0[_0x3fef('0x2f')][_0x3fef('0x30')]?_0x121ff0[_0x3fef('0x2f')]:_0x3baa52[_0x3fef('0x2a')];if(!_0x4b4dee[_0x3fef('0x2c')][_0x3fef('0x31')](_0x3fef('0x32'))){_0x121ff0[_0x3fef('0x1e')]=qs[_0x3fef('0x1e')](_0x4b4dee['query']['limit']);_0x121ff0[_0x3fef('0x1d')]=qs['offset'](_0x4b4dee[_0x3fef('0x2c')][_0x3fef('0x1d')]);}_0x121ff0[_0x3fef('0x33')]=qs[_0x3fef('0x34')](_0x4b4dee[_0x3fef('0x2c')][_0x3fef('0x34')]);_0x121ff0[_0x3fef('0x35')]=qs[_0x3fef('0x2d')](_[_0x3fef('0x36')](_0x4b4dee[_0x3fef('0x2c')],_0x3baa52[_0x3fef('0x2d')]));if(_0x4b4dee[_0x3fef('0x2c')][_0x3fef('0x37')]){_0x121ff0[_0x3fef('0x35')]=_['merge'](_0x121ff0[_0x3fef('0x35')],{'$or':_[_0x3fef('0x38')](_0x462ee7,function(_0x31669f){if(_0x31669f[_0x3fef('0x39')][_0x3fef('0x3a')]!==_0x3fef('0x3b')){var _0x57065d={};_0x57065d[_0x31669f['field']]={'$like':'%'+_0x4b4dee[_0x3fef('0x2c')][_0x3fef('0x37')]+'%'};return _0x57065d;}})});}_0x121ff0=_[_0x3fef('0x3c')]({},_0x121ff0,_0x4b4dee[_0x3fef('0x3d')]);var _0x69e494={'where':_0x121ff0[_0x3fef('0x35')]};return db[_0x3fef('0x29')][_0x3fef('0x3e')](_0x69e494)[_0x3fef('0x24')](function(_0x29b099){_0x4ea2ab[_0x3fef('0x3e')]=_0x29b099;if(_0x4b4dee['query'][_0x3fef('0x3f')]){_0x121ff0[_0x3fef('0x40')]=[{'all':!![]}];}return db['SADossier']['findAll'](_0x121ff0);})[_0x3fef('0x24')](function(_0x3dda68){_0x4ea2ab[_0x3fef('0x41')]=_0x3dda68;return _0x4ea2ab;})[_0x3fef('0x24')](respondWithFilteredResult(_0x563556,_0x121ff0))[_0x3fef('0x42')](handleError(_0x563556,null));};exports[_0x3fef('0x43')]=function(_0x17aff8,_0x42e43d){var _0x577ab8={'raw':![],'where':{'id':_0x17aff8[_0x3fef('0x44')]['id']}},_0x107d42={};_0x107d42[_0x3fef('0x2a')]=_[_0x3fef('0x2b')](db[_0x3fef('0x29')][_0x3fef('0x45')]);_0x107d42[_0x3fef('0x2c')]=_[_0x3fef('0x2b')](_0x17aff8[_0x3fef('0x2c')]);_0x107d42[_0x3fef('0x2d')]=_[_0x3fef('0x2e')](_0x107d42[_0x3fef('0x2a')],_0x107d42[_0x3fef('0x2c')]);_0x577ab8[_0x3fef('0x2f')]=_[_0x3fef('0x2e')](_0x107d42['model'],qs[_0x3fef('0x46')](_0x17aff8[_0x3fef('0x2c')][_0x3fef('0x46')]));_0x577ab8[_0x3fef('0x2f')]=_0x577ab8[_0x3fef('0x2f')][_0x3fef('0x30')]?_0x577ab8['attributes']:_0x107d42[_0x3fef('0x2a')];if(_0x17aff8['query'][_0x3fef('0x3f')]){_0x577ab8[_0x3fef('0x40')]=[{'all':!![]}];}_0x577ab8=_['merge']({},_0x577ab8,_0x17aff8[_0x3fef('0x3d')]);return db['SADossier'][_0x3fef('0x47')](_0x577ab8)[_0x3fef('0x24')](handleEntityNotFound(_0x42e43d,null))[_0x3fef('0x24')](respondWithResult(_0x42e43d,null))[_0x3fef('0x42')](handleError(_0x42e43d,null));};exports[_0x3fef('0x48')]=function(_0x3be016,_0x12dae9){return db[_0x3fef('0x29')][_0x3fef('0x48')](_0x3be016[_0x3fef('0x49')],{})[_0x3fef('0x24')](respondWithResult(_0x12dae9,0xc9))[_0x3fef('0x42')](handleError(_0x12dae9,null));};exports[_0x3fef('0x23')]=function(_0x4cf81c,_0xe11b56){if(_0x4cf81c[_0x3fef('0x49')]['id']){delete _0x4cf81c['body']['id'];}return db[_0x3fef('0x29')][_0x3fef('0x47')]({'where':{'id':_0x4cf81c[_0x3fef('0x44')]['id']}})['then'](handleEntityNotFound(_0xe11b56,null))[_0x3fef('0x24')](saveUpdates(_0x4cf81c[_0x3fef('0x49')],null))['then'](respondWithResult(_0xe11b56,null))[_0x3fef('0x42')](handleError(_0xe11b56,null));};exports['destroy']=function(_0x48322c,_0x15fb2c){return db['SADossier'][_0x3fef('0x47')]({'where':{'id':_0x48322c[_0x3fef('0x44')]['id']}})['then'](handleEntityNotFound(_0x15fb2c,null))[_0x3fef('0x24')](removeEntity(_0x15fb2c,null))[_0x3fef('0x42')](handleError(_0x15fb2c,null));};exports[_0x3fef('0x4a')]=function(_0x5902b1,_0x2ef3c8){return db[_0x3fef('0x29')][_0x3fef('0x4a')]()['then'](respondWithResult(_0x2ef3c8,null))[_0x3fef('0x42')](handleError(_0x2ef3c8,null));}; \ No newline at end of file diff --git a/server/api/saDossier/saDossier.model.js b/server/api/saDossier/saDossier.model.js index ed101be..028c7c0 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 _0x9957=['exports','define','SADossier','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./saDossier.attributes'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'sa_dossiers','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(_0x345136,_0xa50958){var _0x5c8e6a=function(_0x4ec459){while(--_0x4ec459){_0x345136['push'](_0x345136['shift']());}};_0x5c8e6a(++_0xa50958);}(_0x34e8,0x12c));var _0x834e=function(_0x384430,_0x703c7e){_0x384430=_0x384430-0x0;var _0x36cf40=_0x34e8[_0x384430];return _0x36cf40;};'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 f4828d2..a74e19f 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 _0xe8ae=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','error','code','message','SADossier,\x20%s,\x20%s','result','catch','lodash','bluebird'];(function(_0x2f2433,_0x16639b){var _0x21fde8=function(_0x1cd692){while(--_0x1cd692){_0x2f2433['push'](_0x2f2433['shift']());}};_0x21fde8(++_0x16639b);}(_0xe8ae,0x10f));var _0xee8a=function(_0x344fb3,_0x9efcce){_0x344fb3=_0x344fb3-0x0;var _0x4188f6=_0xe8ae[_0x344fb3];return _0x4188f6;};'use strict';var _=require(_0xee8a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xee8a('0x1'));var rs=require(_0xee8a('0x2'));var fs=require('fs');var Redis=require(_0xee8a('0x3'));var db=require(_0xee8a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xee8a('0x5'))(_0xee8a('0x6'));var config=require(_0xee8a('0x7'));var jayson=require(_0xee8a('0x8'));var client=jayson[_0xee8a('0x9')][_0xee8a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ab196,_0x14abb6,_0x305513){return new BPromise(function(_0x612f61,_0x565014){return client[_0xee8a('0xb')](_0x5ab196,_0x305513)[_0xee8a('0xc')](function(_0x592649){logger[_0xee8a('0xd')]('SADossier,\x20%s,\x20%s',_0x14abb6,'request\x20sent');logger['debug']('SADossier,\x20%s,\x20%s,\x20%s',_0x14abb6,_0xee8a('0xe'),JSON['stringify'](_0x592649));if(_0x592649[_0xee8a('0xf')]){if(_0x592649[_0xee8a('0xf')][_0xee8a('0x10')]===0x1f4){logger[_0xee8a('0xf')]('SADossier,\x20%s,\x20%s',_0x14abb6,_0x592649[_0xee8a('0xf')][_0xee8a('0x11')]);return _0x565014(_0x592649[_0xee8a('0xf')]['message']);}logger[_0xee8a('0xf')](_0xee8a('0x12'),_0x14abb6,_0x592649[_0xee8a('0xf')][_0xee8a('0x11')]);return _0x612f61(_0x592649['error'][_0xee8a('0x11')]);}else{logger['info']('SADossier,\x20%s,\x20%s',_0x14abb6,_0xee8a('0xe'));_0x612f61(_0x592649[_0xee8a('0x13')]['message']);}})[_0xee8a('0x14')](function(_0x34ae3c){logger[_0xee8a('0xf')](_0xee8a('0x12'),_0x14abb6,_0x34ae3c);_0x565014(_0x34ae3c);});});} \ No newline at end of file +var _0xacc1=['error','code','SADossier,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','info','request\x20sent','SADossier,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xacc1,0x194));var _0x1acc=function(_0x51d0a0,_0x2331d0){_0x51d0a0=_0x51d0a0-0x0;var _0x5ec32f=_0xacc1[_0x51d0a0];return _0x5ec32f;};'use strict';var _=require('lodash');var util=require(_0x1acc('0x0'));var moment=require(_0x1acc('0x1'));var BPromise=require(_0x1acc('0x2'));var rs=require(_0x1acc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1acc('0x4'))['db'];var utils=require(_0x1acc('0x5'));var logger=require('../../config/logger')(_0x1acc('0x6'));var config=require(_0x1acc('0x7'));var jayson=require(_0x1acc('0x8'));var client=jayson[_0x1acc('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b167c,_0x735dfb,_0x18e3b8){return new BPromise(function(_0x3105ab,_0x1dd2c2){return client['request'](_0x3b167c,_0x18e3b8)['then'](function(_0x181138){logger[_0x1acc('0xa')]('SADossier,\x20%s,\x20%s',_0x735dfb,_0x1acc('0xb'));logger['debug'](_0x1acc('0xc'),_0x735dfb,_0x1acc('0xb'),JSON[_0x1acc('0xd')](_0x181138));if(_0x181138[_0x1acc('0xe')]){if(_0x181138[_0x1acc('0xe')][_0x1acc('0xf')]===0x1f4){logger['error'](_0x1acc('0x10'),_0x735dfb,_0x181138[_0x1acc('0xe')]['message']);return _0x1dd2c2(_0x181138[_0x1acc('0xe')][_0x1acc('0x11')]);}logger[_0x1acc('0xe')]('SADossier,\x20%s,\x20%s',_0x735dfb,_0x181138[_0x1acc('0xe')][_0x1acc('0x11')]);return _0x3105ab(_0x181138[_0x1acc('0xe')][_0x1acc('0x11')]);}else{logger['info']('SADossier,\x20%s,\x20%s',_0x735dfb,_0x1acc('0xb'));_0x3105ab(_0x181138[_0x1acc('0x12')]['message']);}})['catch'](function(_0x56d6b6){logger[_0x1acc('0xe')](_0x1acc('0x10'),_0x735dfb,_0x56d6b6);_0x1dd2c2(_0x56d6b6);});});} \ No newline at end of file diff --git a/server/api/saInvoice/index.js b/server/api/saInvoice/index.js index 5f5a287..e91c405 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 _0x78d3=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./saInvoice.controller','get','isAuthenticated','index','describe','/getInvoicesNumberByYear','getInvoicesNumberByYear','/getInvoicesRevenueBy','/getYearToCompare','getTopClients','show','post','create','/:id/automaticInvoiceCreditnote','automaticInvoiceCreditnote','/:id'];(function(_0x169b31,_0x5becb0){var _0x424eee=function(_0x5d4090){while(--_0x5d4090){_0x169b31['push'](_0x169b31['shift']());}};_0x424eee(++_0x5becb0);}(_0x78d3,0x73));var _0x378d=function(_0xc68f6a,_0x53a46a){_0xc68f6a=_0xc68f6a-0x0;var _0x257e1a=_0x78d3[_0xc68f6a];return _0x257e1a;};'use strict';var multer=require(_0x378d('0x0'));var util=require(_0x378d('0x1'));var path=require(_0x378d('0x2'));var timeout=require(_0x378d('0x3'));var express=require(_0x378d('0x4'));var router=express[_0x378d('0x5')]();var auth=require(_0x378d('0x6'));var interaction=require(_0x378d('0x7'));var config=require(_0x378d('0x8'));var controller=require(_0x378d('0x9'));router[_0x378d('0xa')]('/',auth[_0x378d('0xb')](),controller[_0x378d('0xc')]);router[_0x378d('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x378d('0xd')]);router['get'](_0x378d('0xe'),auth[_0x378d('0xb')](),controller[_0x378d('0xf')]);router[_0x378d('0xa')](_0x378d('0x10'),auth[_0x378d('0xb')](),controller['getInvoicesRevenueBy']);router[_0x378d('0xa')](_0x378d('0x11'),auth[_0x378d('0xb')](),controller['getYearToCompare']);router[_0x378d('0xa')]('/getTopClients',auth['isAuthenticated'](),controller[_0x378d('0x12')]);router[_0x378d('0xa')]('/:id',auth[_0x378d('0xb')](),controller[_0x378d('0x13')]);router[_0x378d('0xa')]('/:id/download',auth[_0x378d('0xb')](),controller['getInvoicePDF']);router[_0x378d('0x14')]('/',auth[_0x378d('0xb')](),controller[_0x378d('0x15')]);router[_0x378d('0x14')](_0x378d('0x16'),auth['isAuthenticated'](),controller[_0x378d('0x17')]);router['put'](_0x378d('0x18'),auth[_0x378d('0xb')](),controller[_0x378d('0x19')]);router[_0x378d('0x1a')](_0x378d('0x18'),auth['isAuthenticated'](),controller[_0x378d('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xf066=['/getYearToCompare','getYearToCompare','getTopClients','/:id','show','/:id/download','getInvoicePDF','create','post','/:id/automaticInvoiceCreditnote','automaticInvoiceCreditnote','put','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','getInvoicesNumberByYear','getInvoicesRevenueBy'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xf066,0x1a4));var _0x6f06=function(_0x2ada6a,_0x49cece){_0x2ada6a=_0x2ada6a-0x0;var _0x42b8fa=_0xf066[_0x2ada6a];return _0x42b8fa;};'use strict';var multer=require('multer');var util=require(_0x6f06('0x0'));var path=require(_0x6f06('0x1'));var timeout=require(_0x6f06('0x2'));var express=require(_0x6f06('0x3'));var router=express[_0x6f06('0x4')]();var auth=require(_0x6f06('0x5'));var interaction=require(_0x6f06('0x6'));var config=require(_0x6f06('0x7'));var controller=require('./saInvoice.controller');router[_0x6f06('0x8')]('/',auth[_0x6f06('0x9')](),controller[_0x6f06('0xa')]);router[_0x6f06('0x8')](_0x6f06('0xb'),auth['isAuthenticated'](),controller[_0x6f06('0xc')]);router[_0x6f06('0x8')]('/getInvoicesNumberByYear',auth[_0x6f06('0x9')](),controller[_0x6f06('0xd')]);router[_0x6f06('0x8')]('/getInvoicesRevenueBy',auth[_0x6f06('0x9')](),controller[_0x6f06('0xe')]);router['get'](_0x6f06('0xf'),auth['isAuthenticated'](),controller[_0x6f06('0x10')]);router[_0x6f06('0x8')]('/getTopClients',auth[_0x6f06('0x9')](),controller[_0x6f06('0x11')]);router[_0x6f06('0x8')](_0x6f06('0x12'),auth[_0x6f06('0x9')](),controller[_0x6f06('0x13')]);router['get'](_0x6f06('0x14'),auth[_0x6f06('0x9')](),controller[_0x6f06('0x15')]);router['post']('/',auth[_0x6f06('0x9')](),controller[_0x6f06('0x16')]);router[_0x6f06('0x17')](_0x6f06('0x18'),auth[_0x6f06('0x9')](),controller[_0x6f06('0x19')]);router[_0x6f06('0x1a')](_0x6f06('0x12'),auth[_0x6f06('0x9')](),controller['update']);router[_0x6f06('0x1b')](_0x6f06('0x12'),auth[_0x6f06('0x9')](),controller['destroy']);module[_0x6f06('0x1c')]=router; \ No newline at end of file diff --git a/server/api/saInvoice/saInvoice.attributes.js b/server/api/saInvoice/saInvoice.attributes.js index c8b213c..53fb39c 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 _0xb7c8=['number','moment','exports','STRING','TEXT','INTEGER','DECIMAL','BOOLEAN','DATE','VIRTUAL','getDataValue','startDate','format','YYYY'];(function(_0x37a3f3,_0x663b49){var _0x4da923=function(_0x47713f){while(--_0x47713f){_0x37a3f3['push'](_0x37a3f3['shift']());}};_0x4da923(++_0x663b49);}(_0xb7c8,0x119));var _0x8b7c=function(_0x46b4e4,_0x15eed0){_0x46b4e4=_0x46b4e4-0x0;var _0x3028cc=_0xb7c8[_0x46b4e4];return _0x3028cc;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x8b7c('0x0'));module[_0x8b7c('0x1')]={'name':{'type':Sequelize[_0x8b7c('0x2')]},'note':{'type':Sequelize[_0x8b7c('0x3')]},'agentFullname':{'type':Sequelize[_0x8b7c('0x2')]},'status':{'type':Sequelize[_0x8b7c('0x3')]},'companyName':{'type':Sequelize[_0x8b7c('0x2')],'allowNull':![]},'companyId':{'type':Sequelize['INTEGER'],'allowNull':![]},'paid':{'type':Sequelize[_0x8b7c('0x4')],'defaultValue':0x0},'discount':{'type':Sequelize[_0x8b7c('0x5')](0xd,0x4)},'receivingStreet':{'type':Sequelize[_0x8b7c('0x2')]},'receivingPostalCode':{'type':Sequelize[_0x8b7c('0x2')]},'receivingCity':{'type':Sequelize[_0x8b7c('0x2')]},'receivingCountry':{'type':Sequelize[_0x8b7c('0x2')]},'receivingISOCode':{'type':Sequelize[_0x8b7c('0x2')](0x3)},'receivingFiscalCode':{'type':Sequelize[_0x8b7c('0x2')](0x32)},'receivingPIVA':{'type':Sequelize[_0x8b7c('0x2')](0x32)},'receivingSDICode':{'type':Sequelize[_0x8b7c('0x2')](0x15)},'receivingFiscalMessage':{'type':Sequelize[_0x8b7c('0x2')](0x3e8)},'receivingExpiryDay':{'type':Sequelize[_0x8b7c('0x4')]},'receivingEurope':{'type':Sequelize['BOOLEAN']},'receivingSocCap':{'type':Sequelize[_0x8b7c('0x2')](0xff)},'issuerName':{'type':Sequelize['STRING']},'issuerStreet':{'type':Sequelize[_0x8b7c('0x2')]},'issuerPostalCode':{'type':Sequelize[_0x8b7c('0x2')]},'issuerCity':{'type':Sequelize['STRING']},'issuerCountry':{'type':Sequelize[_0x8b7c('0x2')]},'issuerISOCode':{'type':Sequelize[_0x8b7c('0x2')](0x3)},'issuerFiscalCode':{'type':Sequelize[_0x8b7c('0x2')](0x32)},'issuerPIVA':{'type':Sequelize['STRING'](0x32)},'issuerSDICode':{'type':Sequelize['STRING'](0x15)},'issuerFiscalMessage':{'type':Sequelize[_0x8b7c('0x2')](0x3e8)},'issuerExpiryDay':{'type':Sequelize[_0x8b7c('0x4')]},'issuerEurope':{'type':Sequelize[_0x8b7c('0x6')]},'issuerSocCap':{'type':Sequelize[_0x8b7c('0x2')](0xff)},'issuerBankAccount':{'type':Sequelize[_0x8b7c('0x2')](0xff)},'issuerBankName':{'type':Sequelize[_0x8b7c('0x2')](0xff)},'issuerBankStreet':{'type':Sequelize[_0x8b7c('0x2')]},'issuerBankPostalCode':{'type':Sequelize['STRING']},'issuerBankCity':{'type':Sequelize[_0x8b7c('0x2')]},'issuerBankCountry':{'type':Sequelize[_0x8b7c('0x2')]},'issuerBankBICSWIFT':{'type':Sequelize[_0x8b7c('0x2')]},'issuerBankIBAN':{'type':Sequelize['STRING']},'issuerPhone':{'type':Sequelize[_0x8b7c('0x2')]},'issuerFax':{'type':Sequelize[_0x8b7c('0x2')]},'issuerEmail':{'type':Sequelize['STRING']},'issuerWeb':{'type':Sequelize[_0x8b7c('0x2')]},'issuerABI':{'type':Sequelize[_0x8b7c('0x2')]},'issuerCAB':{'type':Sequelize[_0x8b7c('0x2')]},'issuerPayPal':{'type':Sequelize[_0x8b7c('0x2')]},'startDate':{'type':Sequelize[_0x8b7c('0x7')]},'endDate':{'type':Sequelize['DATE']},'number':{'type':Sequelize[_0x8b7c('0x4')]},'beginningCompetence':{'type':Sequelize[_0x8b7c('0x7')]},'endCompetence':{'type':Sequelize[_0x8b7c('0x7')]},'clientCode':{'type':Sequelize[_0x8b7c('0x2')]},'numberVirtual':{'type':Sequelize[_0x8b7c('0x8')],'get':function(_0x526fdf){var _0x2c574b=this[_0x8b7c('0x9')](_0x8b7c('0xa'));var _0x13fa16=null;if(!_0x2c574b){_0x13fa16=moment()[_0x8b7c('0xb')](_0x8b7c('0xc'));}else{_0x13fa16=moment(_0x2c574b)[_0x8b7c('0xb')](_0x8b7c('0xc'));}return _0x13fa16+'/'+this[_0x8b7c('0x9')](_0x8b7c('0xd'));}}}; \ No newline at end of file +var _0x0c02=['VIRTUAL','startDate','format','YYYY','getDataValue','number','moment','exports','TEXT','STRING','INTEGER','DECIMAL','BOOLEAN','DATE'];(function(_0x230d46,_0x3d452c){var _0x49401c=function(_0x4bc449){while(--_0x4bc449){_0x230d46['push'](_0x230d46['shift']());}};_0x49401c(++_0x3d452c);}(_0x0c02,0x84));var _0x20c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c02[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x20c0('0x0'));module[_0x20c0('0x1')]={'name':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x20c0('0x2')]},'agentFullname':{'type':Sequelize[_0x20c0('0x3')]},'status':{'type':Sequelize[_0x20c0('0x2')]},'companyName':{'type':Sequelize[_0x20c0('0x3')],'allowNull':![]},'companyId':{'type':Sequelize[_0x20c0('0x4')],'allowNull':![]},'paid':{'type':Sequelize[_0x20c0('0x4')],'defaultValue':0x0},'discount':{'type':Sequelize[_0x20c0('0x5')](0xd,0x4)},'receivingStreet':{'type':Sequelize[_0x20c0('0x3')]},'receivingPostalCode':{'type':Sequelize[_0x20c0('0x3')]},'receivingCity':{'type':Sequelize[_0x20c0('0x3')]},'receivingCountry':{'type':Sequelize['STRING']},'receivingISOCode':{'type':Sequelize['STRING'](0x3)},'receivingFiscalCode':{'type':Sequelize['STRING'](0x32)},'receivingPIVA':{'type':Sequelize['STRING'](0x32)},'receivingSDICode':{'type':Sequelize[_0x20c0('0x3')](0x15)},'receivingFiscalMessage':{'type':Sequelize[_0x20c0('0x3')](0x3e8)},'receivingExpiryDay':{'type':Sequelize[_0x20c0('0x4')]},'receivingEurope':{'type':Sequelize[_0x20c0('0x6')]},'receivingSocCap':{'type':Sequelize[_0x20c0('0x3')](0xff)},'issuerName':{'type':Sequelize[_0x20c0('0x3')]},'issuerStreet':{'type':Sequelize['STRING']},'issuerPostalCode':{'type':Sequelize['STRING']},'issuerCity':{'type':Sequelize['STRING']},'issuerCountry':{'type':Sequelize['STRING']},'issuerISOCode':{'type':Sequelize['STRING'](0x3)},'issuerFiscalCode':{'type':Sequelize[_0x20c0('0x3')](0x32)},'issuerPIVA':{'type':Sequelize[_0x20c0('0x3')](0x32)},'issuerSDICode':{'type':Sequelize[_0x20c0('0x3')](0x15)},'issuerFiscalMessage':{'type':Sequelize[_0x20c0('0x3')](0x3e8)},'issuerExpiryDay':{'type':Sequelize['INTEGER']},'issuerEurope':{'type':Sequelize[_0x20c0('0x6')]},'issuerSocCap':{'type':Sequelize['STRING'](0xff)},'issuerBankAccount':{'type':Sequelize['STRING'](0xff)},'issuerBankName':{'type':Sequelize[_0x20c0('0x3')](0xff)},'issuerBankStreet':{'type':Sequelize[_0x20c0('0x3')]},'issuerBankPostalCode':{'type':Sequelize[_0x20c0('0x3')]},'issuerBankCity':{'type':Sequelize[_0x20c0('0x3')]},'issuerBankCountry':{'type':Sequelize[_0x20c0('0x3')]},'issuerBankBICSWIFT':{'type':Sequelize[_0x20c0('0x3')]},'issuerBankIBAN':{'type':Sequelize[_0x20c0('0x3')]},'issuerPhone':{'type':Sequelize[_0x20c0('0x3')]},'issuerFax':{'type':Sequelize[_0x20c0('0x3')]},'issuerEmail':{'type':Sequelize['STRING']},'issuerWeb':{'type':Sequelize[_0x20c0('0x3')]},'issuerABI':{'type':Sequelize[_0x20c0('0x3')]},'issuerCAB':{'type':Sequelize[_0x20c0('0x3')]},'issuerPayPal':{'type':Sequelize[_0x20c0('0x3')]},'startDate':{'type':Sequelize[_0x20c0('0x7')]},'endDate':{'type':Sequelize[_0x20c0('0x7')]},'number':{'type':Sequelize['INTEGER']},'beginningCompetence':{'type':Sequelize['DATE']},'endCompetence':{'type':Sequelize['DATE']},'clientCode':{'type':Sequelize[_0x20c0('0x3')]},'numberVirtual':{'type':Sequelize[_0x20c0('0x8')],'get':function(_0x2abd80){var _0x43a885=this['getDataValue'](_0x20c0('0x9'));var _0x2a0bcd=null;if(!_0x43a885){_0x2a0bcd=moment()[_0x20c0('0xa')]('YYYY');}else{_0x2a0bcd=moment(_0x43a885)['format'](_0x20c0('0xb'));}return _0x2a0bcd+'/'+this[_0x20c0('0xc')](_0x20c0('0xd'));}}}; \ No newline at end of file diff --git a/server/api/saInvoice/saInvoice.controller.js b/server/api/saInvoice/saInvoice.controller.js index b042333..3ec758d 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 _0x147b=['sequelize','QueryTypes','SELECT','getInvoicesRevenueBy','said','(startDate)','month','year','monthTotal','sai','sai.id\x20=\x20said.InvoiceId','getYearToCompare','distinct\x20YEAR(startDate)','YEAR(startDate)\x20!=\x20YEAR(CURDATE())','getTopClients','dateStart','dateEnd','top','area','relationship','relatedCompany','italy','sai.receivingCountry\x20=\x20\x22italy\x22','europe','sai.receivingEurope\x20=\x201','com.saCompanyRelationship\x20=\x20','sa_invoice_details','sai.companyName','sai.receivingCountry','nation','sum(((said.netPrice\x20-\x20(said.netPrice\x20/\x20100\x20*\x20said.discount))\x20*\x20said.quantity))\x20-\x20coalesce(sai.discount,0)','relationshipId','com.CmCompanyId','relatedCompanyId','relationshipName','relCom.name','cm_companies','com','sai.companyName\x20=\x20com.name','left_join','sa_company_relationships','rel','rel.Id\x20=\x20saCompanyRelationship','relCom','relCom.Id\x20=\x20com.CmCompanyId','sai.startDate\x20>=\x20?','com.saCompanyRelationship','rel.name','said.discount','sai.discount','addInvoiceCreditnoteDetail->>','companyName','companyId','productDescription','priceListId','agentFullname','note','subscriptionId','automaticInvoiceCreditnote','SACreditNote','push','all','WARNING','No\x20product\x20to\x20assign\x20credit\x20note.\x20Credit\x20note\x20not\x20created!!\x20','TCL:\x20exports.automaticInvoiceCreditnote\x20->\x20err','Duplicate\x20entry.','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','reject','save','update','then','destroy','error','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','map','VIRTUAL','field','filter','options','includeAll','SAInvoice','findAll','rows','show','params','include','merge','catch','create','transaction','Sequelize','Transaction','SERIALIZABLE','body','find','describe','getInvoicePDF','unix','toString','join','root','server','files','tmp','logos','logo-invoice.png','images','paid-invoice.png','format','Invoice_%s-%s.pdf','invoice','SAInvoiceDetail','details','portrait','1cm','10mm','{{page}}/{{pages}}','footer','contents','default','issuerWeb','','\x20\x20body{font-family:\x20Roboto,\x20\x27Segoe\x20UI\x27,\x20Tahoma,\x20sans-serif;}.itemTabTitle{background-color:\x20lightgray;\x20height:\x2040px;}.issuerInfo{color:\x20lightgray;\x20padding-top:\x2020px;\x20padding-bottom:\x2020px;\x20font-size:\x2010px;}.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:\x20bolder;\x20padding-bottom:\x2010px;\x20font-size:\x2010px}.reciperFiscalInfo{padding-top:\x205px;\x20padding-bottom:\x205px;,\x20font-size:\x2010px;}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:\x208px;\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:\x208px;}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','P.IVA','Tax\x20code','I.S.\x20code','Codice\x20S.D.I.','Soc.Cap.\x20fp','Cap.Soc.\x20iv','Fattura','Proforma','Credit\x20note','Due\x20date','Scadenza','Item','Description','Descrizione','Ore/Qta','Unit\x20Price','Sub\x20Total','Discount','Sconto','Subtotal','Imponibile','Tax','Total','Please\x20send\x20PAYMENT\x20to','Si\x20prega\x20di\x20inviare\x20il\x20pagamento\x20a','Account\x20Holder','Conto\x20intestato\x20a','Nome\x20banca','Bank\x20Address','Indirizzo\x20banca','ABI','CAB','BIC','SWIF','IBAN','Pay\x20via\x20Paypal','Thank\x20you\x20for\x20your\x20business.\x20We\x20do\x20expect\x20payment\x20by\x20','\x20quindi\x20vi\x20preghiamo\x20di\x20provvedere\x20entro\x20tale\x20termine.','receivingCountry','','\x20','\x20%s
','issuerName','issuerStreet','issuerPostalCode','\x20%s','-\x20%s\x20
','issuerCountry','phone',':\x20%s
','issuerPhone','fax','email','issuerEmail','piva','issuerPIVA','sdi','issuerSDICode','issuerSocCap','
','','%s','%s
','receivingStreet','%s\x20-\x20','receivingPostalCode','receivingCity','','receivingFiscalCode','receivingPIVA','receivingSDICode','','
','','startDate','YYYY','%s,\x20','issuerCity','DD/MM/YYYY','%s\x20','add','days','endDate','','duedate','','','','item','description','','subtotal','netPrice','discount','tax','quantity','','productName','','
%s
','isNil','receivingFiscalMessage','indexOf','split\x20payment','','','\x20','toFixed','€','','total','','\x20','\x20%s\x20','replace','','',':','issuerBankAccount',':\x20','','bankname','\x20','bankaddress','issuerBankStreet','issuerBankPostalCode','issuerBankCity','issuerBankCountry','abi','cab','issuerABI','issuerCAB','bic','issuerBankBICSWIFT','issuerBankIBAN','paypal','','thank1','','','paid','\x22\x20width=\x22180\x22>','','','','toFile','log','TCL:\x20exports.getInvoicePDF\x20->\x20saveTo,\x20fileName','download','err','foldername','getInvoicesNumberByYear','select','from','sa_invoices','count(id)','invoiceNumber','YEAR(startDate)','invoiceYear','MONTH(startDate)','invoiceMonth','YEAR(startDate)\x20IN\x20(','group'];(function(_0x35dc88,_0x19c13a){var _0x463ce7=function(_0x5b12e2){while(--_0x5b12e2){_0x35dc88['push'](_0x35dc88['shift']());}};_0x463ce7(++_0x19c13a);}(_0x147b,0x193));var _0xb147=function(_0x360584,_0x4d5cbc){_0x360584=_0x360584-0x0;var _0x3d18c3=_0x147b[_0x360584];return _0x3d18c3;};'use strict';var pdf=require(_0xb147('0x0'));var emlformat=require(_0xb147('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb147('0x2'));var jsonpatch=require(_0xb147('0x3'));var rp=require('request-promise');var moment=require(_0xb147('0x4'));var BPromise=require(_0xb147('0x5'));var Mustache=require(_0xb147('0x6'));var util=require('util');var path=require(_0xb147('0x7'));var sox=require('sox');var csv=require(_0xb147('0x8'));var ejs=require(_0xb147('0x9'));var fs=require('fs');var _=require(_0xb147('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb147('0xb'));var deskjs=require(_0xb147('0xc'));var toCsv=require(_0xb147('0x8'));var querystring=require(_0xb147('0xd'));var Papa=require(_0xb147('0xe'));var Redis=require(_0xb147('0xf'));var authService=require(_0xb147('0x10'));var qs=require(_0xb147('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb147('0x12'));var utils=require(_0xb147('0x13'));var config=require(_0xb147('0x14'));var db=require(_0xb147('0x15'))['db'];function respondWithStatusCode(_0x2d209e,_0xc1269c){_0xc1269c=_0xc1269c||0xcc;return function(_0x1465f6){if(_0x1465f6){return _0x2d209e[_0xb147('0x16')](_0xc1269c);}return _0x2d209e[_0xb147('0x17')](_0xc1269c)[_0xb147('0x18')]();};}function respondWithResult(_0x1eaac2,_0x557ec2){_0x557ec2=_0x557ec2||0xc8;return function(_0xc110cb){if(_0xc110cb){return _0x1eaac2[_0xb147('0x17')](_0x557ec2)[_0xb147('0x19')](_0xc110cb);}};}function respondWithFilteredResult(_0x2c1952,_0x5479b4){return function(_0x2a0eeb){if(_0x2a0eeb){var _0x394614=_0x2a0eeb[_0xb147('0x1a')],_0x4ab867=_0x5479b4[_0xb147('0x1b')],_0x4df7e9=_0x5479b4['offset']+_0x5479b4['limit'],_0x1f424a;if(_0x4df7e9>=_0x394614){_0x4df7e9=_0x394614;_0x1f424a=0xc8;}else{_0x1f424a=0xce;}_0x2c1952[_0xb147('0x17')](_0x1f424a);return _0x2c1952['set'](_0xb147('0x1c'),_0x4ab867+'-'+_0x4df7e9+'/'+_0x394614)[_0xb147('0x19')](_0x2a0eeb);}return null;};}function patchUpdates(_0x11a08a){return function(_0x4a1c81){try{jsonpatch['apply'](_0x4a1c81,_0x11a08a,!![]);}catch(_0x4cd62f){return BPromise[_0xb147('0x1d')](_0x4cd62f);}return _0x4a1c81[_0xb147('0x1e')]();};}function saveUpdates(_0x411a3b,_0x5831f0){return function(_0x39c15c){if(_0x39c15c){return _0x39c15c[_0xb147('0x1f')](_0x411a3b)[_0xb147('0x20')](function(_0x45cbe8){return _0x45cbe8;});}return null;};}function removeEntity(_0x163151,_0x57d261){return function(_0xa85f38){if(_0xa85f38){return _0xa85f38[_0xb147('0x21')]()[_0xb147('0x20')](function(){_0x163151[_0xb147('0x17')](0xcc)[_0xb147('0x18')]();});}};}function handleEntityNotFound(_0x53ac4b,_0x565acd){return function(_0x203161){if(!_0x203161){_0x53ac4b[_0xb147('0x16')](0x194);}return _0x203161;};}function handleError(_0x24efa0,_0x39f833){_0x39f833=_0x39f833||0x1f4;return function(_0x5f2806){logger[_0xb147('0x22')](_0x5f2806['stack']);if(_0x5f2806['name']){delete _0x5f2806[_0xb147('0x23')];}_0x24efa0[_0xb147('0x17')](_0x39f833)[_0xb147('0x24')](_0x5f2806);};}exports[_0xb147('0x25')]=function(_0x12c18f,_0x362ac8){var _0x4cce70={},_0x5691de={},_0x3bf2ae={'count':0x0,'rows':[]};var _0x456718=db['SAInvoice'][_0xb147('0x26')];_0x5691de[_0xb147('0x27')]=_['keys'](_0x456718);_0x5691de['query']=_[_0xb147('0x28')](_0x12c18f[_0xb147('0x29')]);_0x5691de[_0xb147('0x2a')]=_[_0xb147('0x2b')](_0x5691de[_0xb147('0x27')],_0x5691de['query']);_0x4cce70[_0xb147('0x2c')]=_[_0xb147('0x2b')](_0x5691de[_0xb147('0x27')],qs[_0xb147('0x2d')](_0x12c18f[_0xb147('0x29')]['fields']));_0x4cce70[_0xb147('0x2c')]=_0x4cce70[_0xb147('0x2c')][_0xb147('0x2e')]?_0x4cce70[_0xb147('0x2c')]:_0x5691de[_0xb147('0x27')];if(!_0x12c18f[_0xb147('0x29')][_0xb147('0x2f')](_0xb147('0x30'))){_0x4cce70[_0xb147('0x31')]=qs['limit'](_0x12c18f[_0xb147('0x29')][_0xb147('0x31')]);_0x4cce70[_0xb147('0x1b')]=qs[_0xb147('0x1b')](_0x12c18f[_0xb147('0x29')][_0xb147('0x1b')]);}_0x4cce70[_0xb147('0x32')]=qs[_0xb147('0x33')](_0x12c18f['query'][_0xb147('0x33')]);_0x4cce70[_0xb147('0x34')]=qs[_0xb147('0x2a')](_[_0xb147('0x35')](_0x12c18f[_0xb147('0x29')],_0x5691de[_0xb147('0x2a')]));if(_0x12c18f[_0xb147('0x29')]['filter']){_0x4cce70[_0xb147('0x34')]=_['merge'](_0x4cce70[_0xb147('0x34')],{'$or':_[_0xb147('0x36')](_0x456718,function(_0x481a3f){if(_0x481a3f['type']['key']!==_0xb147('0x37')){var _0x38735d={};_0x38735d[_0x481a3f[_0xb147('0x38')]]={'$like':'%'+_0x12c18f[_0xb147('0x29')][_0xb147('0x39')]+'%'};return _0x38735d;}})});}_0x4cce70=_['merge']({},_0x4cce70,_0x12c18f[_0xb147('0x3a')]);var _0x5e76e0={'where':_0x4cce70['where']};return db['SAInvoice'][_0xb147('0x1a')](_0x5e76e0)[_0xb147('0x20')](function(_0x138e56){_0x3bf2ae[_0xb147('0x1a')]=_0x138e56;if(_0x12c18f[_0xb147('0x29')][_0xb147('0x3b')]){_0x4cce70['include']=[{'all':!![]}];}return db[_0xb147('0x3c')][_0xb147('0x3d')](_0x4cce70);})[_0xb147('0x20')](function(_0x449412){_0x3bf2ae[_0xb147('0x3e')]=_0x449412;return _0x3bf2ae;})[_0xb147('0x20')](respondWithFilteredResult(_0x362ac8,_0x4cce70))['catch'](handleError(_0x362ac8,null));};exports[_0xb147('0x3f')]=function(_0x22043c,_0x2fc312){var _0x53a9af={'raw':![],'where':{'id':_0x22043c[_0xb147('0x40')]['id']}},_0x9ccf42={};_0x9ccf42['model']=_['keys'](db['SAInvoice'][_0xb147('0x26')]);_0x9ccf42['query']=_['keys'](_0x22043c[_0xb147('0x29')]);_0x9ccf42[_0xb147('0x2a')]=_[_0xb147('0x2b')](_0x9ccf42[_0xb147('0x27')],_0x9ccf42['query']);_0x53a9af[_0xb147('0x2c')]=_['intersection'](_0x9ccf42[_0xb147('0x27')],qs[_0xb147('0x2d')](_0x22043c[_0xb147('0x29')][_0xb147('0x2d')]));_0x53a9af[_0xb147('0x2c')]=_0x53a9af[_0xb147('0x2c')][_0xb147('0x2e')]?_0x53a9af[_0xb147('0x2c')]:_0x9ccf42['model'];if(_0x22043c[_0xb147('0x29')][_0xb147('0x3b')]){_0x53a9af[_0xb147('0x41')]=[{'all':!![]}];}_0x53a9af=_[_0xb147('0x42')]({},_0x53a9af,_0x22043c[_0xb147('0x3a')]);return db[_0xb147('0x3c')]['find'](_0x53a9af)[_0xb147('0x20')](handleEntityNotFound(_0x2fc312,null))['then'](respondWithResult(_0x2fc312,null))[_0xb147('0x43')](handleError(_0x2fc312,null));};exports[_0xb147('0x44')]=function(_0x3b8449,_0x467266){return db['sequelize'][_0xb147('0x45')]({'isolationLevel':db[_0xb147('0x46')][_0xb147('0x47')]['ISOLATION_LEVELS'][_0xb147('0x48')]},function(_0x5000cd){return db[_0xb147('0x3c')][_0xb147('0x44')](_0x3b8449[_0xb147('0x49')],{'transaction':_0x5000cd});})[_0xb147('0x20')](respondWithResult(_0x467266,0xc9))[_0xb147('0x43')](handleError(_0x467266,null));};exports[_0xb147('0x1f')]=function(_0x3ae243,_0x1f5c65){if(_0x3ae243[_0xb147('0x49')]['id']){delete _0x3ae243[_0xb147('0x49')]['id'];}return db[_0xb147('0x3c')][_0xb147('0x4a')]({'where':{'id':_0x3ae243[_0xb147('0x40')]['id']}})[_0xb147('0x20')](handleEntityNotFound(_0x1f5c65,null))[_0xb147('0x20')](saveUpdates(_0x3ae243['body'],null))[_0xb147('0x20')](respondWithResult(_0x1f5c65,null))[_0xb147('0x43')](handleError(_0x1f5c65,null));};exports[_0xb147('0x21')]=function(_0x1da9dc,_0x1778bf){return db['SAInvoice'][_0xb147('0x4a')]({'where':{'id':_0x1da9dc[_0xb147('0x40')]['id']}})['then'](handleEntityNotFound(_0x1778bf,null))[_0xb147('0x20')](removeEntity(_0x1778bf,null))['catch'](handleError(_0x1778bf,null));};exports['describe']=function(_0x3165de,_0x2133b8){return db['SAInvoice'][_0xb147('0x4b')]()[_0xb147('0x20')](respondWithResult(_0x2133b8,null))[_0xb147('0x43')](handleError(_0x2133b8,null));};exports[_0xb147('0x4c')]=function(_0x359940,_0x4c6ae2){var _0x12309e=moment()[_0xb147('0x4d')]()[_0xb147('0x4e')]();var _0x127ef3=path[_0xb147('0x4f')](config[_0xb147('0x50')],_0xb147('0x51'),_0xb147('0x52'),_0xb147('0x53'));var _0x110920=path[_0xb147('0x4f')](config['root'],_0xb147('0x51'),_0xb147('0x52'),'images',_0xb147('0x54'),_0xb147('0x55'));var _0xf0ade0=path['join'](config[_0xb147('0x50')],'server',_0xb147('0x52'),_0xb147('0x56'),'logos',_0xb147('0x57'));var _0x46b633=path['join'](_0x127ef3,_0x12309e);var _0xb55948=util[_0xb147('0x58')](_0xb147('0x59'),_0x359940[_0xb147('0x40')]['id'],_0x12309e);var _0x1cdfc3=path[_0xb147('0x4f')](_0x46b633,_0xb55948);var _0x3d764b=![];var _0x2c197b={};return db[_0xb147('0x3c')][_0xb147('0x4a')]({'where':{'id':_0x359940['params']['id']},'raw':!![]})[_0xb147('0x20')](handleEntityNotFound(_0x4c6ae2,null))[_0xb147('0x20')](function(_0x58fb47){if(_0x58fb47){_0x2c197b[_0xb147('0x5a')]=_0x58fb47;return db[_0xb147('0x5b')]['findAll']({'where':{'InvoiceId':_0x58fb47['id']},'raw':!![]})[_0xb147('0x20')](function(_0xce767b){_0x2c197b[_0xb147('0x5c')]=_0xce767b;_0x3d764b=!![];var _0x2559d6='';var _0x179047={'format':'A4','orientation':_0xb147('0x5d'),'border':_0xb147('0x5e'),'footer':{'height':_0xb147('0x5f'),'contents':{'default':_0xb147('0x60')}}};_0x179047[_0xb147('0x61')]['contents']['default']=_0x179047[_0xb147('0x61')][_0xb147('0x62')][_0xb147('0x63')]+''+_0x2c197b['invoice'][_0xb147('0x64')]+_0xb147('0x65');fs['mkdirSync'](_0x46b633);_0x2559d6='';_0x2559d6+=_0xb147('0x66');_0x2559d6+=_0xb147('0x67');var _0x326ce3={'phone':{'en':'Phone','it':_0xb147('0x68')},'fax':{'en':_0xb147('0x69'),'it':_0xb147('0x69')},'email':{'en':_0xb147('0x6a'),'it':_0xb147('0x6a')},'piva':{'en':'VAT\x20number','it':_0xb147('0x6b')},'cf':{'en':_0xb147('0x6c'),'it':'C.F.'},'sdi':{'en':_0xb147('0x6d'),'it':_0xb147('0x6e')},'cs':{'en':_0xb147('0x6f'),'it':_0xb147('0x70')},'invoice':{'en':'Invoice','it':_0xb147('0x71')},'proforma':{'en':_0xb147('0x72'),'it':'Proforma'},'creditnote':{'en':_0xb147('0x73'),'it':'Nota\x20di\x20credito'},'duedate':{'en':_0xb147('0x74'),'it':_0xb147('0x75')},'item':{'en':_0xb147('0x76'),'it':'Articolo'},'description':{'en':_0xb147('0x77'),'it':_0xb147('0x78')},'hrsqty':{'en':'Hrs/Qty','it':_0xb147('0x79')},'unitprice':{'en':_0xb147('0x7a'),'it':'Prezzo\x20Unitario'},'subtotal':{'en':_0xb147('0x7b'),'it':'Sub\x20Totale'},'discount':{'en':_0xb147('0x7c'),'it':_0xb147('0x7d')},'total':{'en':_0xb147('0x7e'),'it':_0xb147('0x7f')},'tax':{'en':_0xb147('0x80'),'it':'Tasse'},'nettopay':{'en':_0xb147('0x81'),'it':'Totale'},'sendpayment':{'en':_0xb147('0x82'),'it':_0xb147('0x83')},'accountholder':{'en':_0xb147('0x84'),'it':_0xb147('0x85')},'bankname':{'en':'Bank\x20name','it':_0xb147('0x86')},'bankaddress':{'en':_0xb147('0x87'),'it':_0xb147('0x88')},'abi':{'en':'ABI','it':_0xb147('0x89')},'cab':{'en':_0xb147('0x8a'),'it':'CAB'},'bic':{'en':_0xb147('0x8b'),'it':_0xb147('0x8b')},'swif':{'en':_0xb147('0x8c'),'it':'SWIF'},'iban':{'en':_0xb147('0x8d'),'it':_0xb147('0x8d')},'paypal':{'en':_0xb147('0x8e'),'it':'Paga\x20con\x20Paypal'},'thank1':{'en':_0xb147('0x8f'),'it':'Grazie.\x20Prevediamo\x20il\x20pagamento\x20entro\x20'},'thank2':{'en':',\x20so\x20please\x20do\x20so\x20within\x20this\x20time.','it':_0xb147('0x90')}};var _0x31f9ee='it';if(_0x2c197b[_0xb147('0x5a')][_0xb147('0x91')]!=='Italy'){_0x31f9ee='en';}_0x2559d6+=_0xb147('0x92');_0x2559d6+=_0xb147('0x93')+_0x110920+'\x22\x20width=\x22180\x22>';_0x2559d6+=_0xb147('0x94');_0x2559d6+=util['format'](_0xb147('0x95'),_0x2c197b['invoice'][_0xb147('0x96')]);_0x2559d6+=util['format']('%s
',_0x2c197b['invoice'][_0xb147('0x97')]);_0x2559d6+=util[_0xb147('0x58')]('%s',_0x2c197b[_0xb147('0x5a')][_0xb147('0x98')]);_0x2559d6+=util[_0xb147('0x58')](_0xb147('0x99'),_0x2c197b[_0xb147('0x5a')]['issuerCity']);_0x2559d6+=util[_0xb147('0x58')](_0xb147('0x9a'),_0x2c197b[_0xb147('0x5a')][_0xb147('0x9b')]);_0x2559d6+=util['format'](_0x326ce3[_0xb147('0x9c')][_0x31f9ee]+_0xb147('0x9d'),_0x2c197b[_0xb147('0x5a')][_0xb147('0x9e')]);_0x2559d6+=util[_0xb147('0x58')](_0x326ce3[_0xb147('0x9f')][_0x31f9ee]+':\x20%s
',_0x2c197b[_0xb147('0x5a')]['issuerFax']);_0x2559d6+=util[_0xb147('0x58')](_0x326ce3[_0xb147('0xa0')][_0x31f9ee]+_0xb147('0x9d'),_0x2c197b[_0xb147('0x5a')][_0xb147('0xa1')]);_0x2559d6+=util[_0xb147('0x58')](_0x326ce3[_0xb147('0xa2')][_0x31f9ee]+_0xb147('0x9d'),_0x2c197b[_0xb147('0x5a')][_0xb147('0xa3')]);_0x2559d6+=util[_0xb147('0x58')](_0x326ce3['cf'][_0x31f9ee]+_0xb147('0x9d'),_0x2c197b['invoice']['issuerFiscalCode']);_0x2559d6+=util[_0xb147('0x58')](_0x326ce3[_0xb147('0xa4')][_0x31f9ee]+_0xb147('0x9d'),_0x2c197b[_0xb147('0x5a')][_0xb147('0xa5')]);_0x2559d6+=util['format'](_0x326ce3['cs'][_0x31f9ee]+_0xb147('0x9d'),_0x2c197b[_0xb147('0x5a')][_0xb147('0xa6')]);_0x2559d6+='';_0x2559d6+=_0xb147('0xa7');_0x2559d6+=_0xb147('0xa8');_0x2559d6+=util[_0xb147('0x58')](_0xb147('0xa9'),_0x2c197b[_0xb147('0x5a')]['companyName']);_0x2559d6+=util[_0xb147('0x58')](_0xb147('0xaa'),_0x2c197b['invoice'][_0xb147('0xab')]);_0x2559d6+=util['format'](_0xb147('0xac'),_0x2c197b[_0xb147('0x5a')][_0xb147('0xad')]);_0x2559d6+=util[_0xb147('0x58')]('%s
',_0x2c197b[_0xb147('0x5a')][_0xb147('0xae')]);_0x2559d6+=util[_0xb147('0x58')](_0xb147('0xaa'),_0x2c197b[_0xb147('0x5a')][_0xb147('0x91')]);_0x2559d6+=_0xb147('0xaf');if(_0x2c197b[_0xb147('0x5a')][_0xb147('0xb0')]){_0x2559d6+=util[_0xb147('0x58')](_0x326ce3['cf'][_0x31f9ee]+_0xb147('0x9d'),_0x2c197b[_0xb147('0x5a')][_0xb147('0xb0')]);}_0x2559d6+=util[_0xb147('0x58')](_0x326ce3['piva'][_0x31f9ee]+_0xb147('0x9d'),_0x2c197b['invoice'][_0xb147('0xb1')]);if(_0x2c197b[_0xb147('0x5a')][_0xb147('0xb2')]){_0x2559d6+=util[_0xb147('0x58')](_0x326ce3[_0xb147('0xa4')][_0x31f9ee]+':\x20%s
',_0x2c197b[_0xb147('0x5a')][_0xb147('0xb2')]);}_0x2559d6+=_0xb147('0xb3');_0x2559d6+=_0xb147('0xb4');_0x2559d6+=_0xb147('0x94');_0x2559d6+='';_0x2559d6+=util['format'](_0xb147('0xb5')+_0x326ce3[_0xb147('0x5a')][_0x31f9ee]+'\x20N.%d\x20/\x20%d\x20(id:\x20%d)',_0x58fb47['number'],moment(_0x2c197b[_0xb147('0x5a')][_0xb147('0xb6')])[_0xb147('0x58')](_0xb147('0xb7')),_0x2c197b['invoice']['id']);_0x2559d6+=util[_0xb147('0x58')](_0xb147('0xb8'),_0x2c197b[_0xb147('0x5a')][_0xb147('0xb9')]);var _0x4f5a53=moment(_0x2c197b[_0xb147('0x5a')]['startDate'])['format'](_0xb147('0xba'));_0x2559d6+=util[_0xb147('0x58')](_0xb147('0xbb'),_0x4f5a53);var _0x91b6=moment(_0x2c197b['invoice'][_0xb147('0xb6')])[_0xb147('0xbc')](_0x2c197b[_0xb147('0x5a')]['saExpiryDay'],_0xb147('0xbd'))[_0xb147('0x58')](_0xb147('0xba'));if(_0x2c197b[_0xb147('0x5a')][_0xb147('0xbe')]){_0x91b6=moment(_0x2c197b['invoice'][_0xb147('0xbe')])[_0xb147('0x58')](_0xb147('0xba'));}_0x2559d6+=util['format'](_0xb147('0xbf')+_0x326ce3[_0xb147('0xc0')][_0x31f9ee]+':\x20%s',_0x91b6);_0x2559d6+=_0xb147('0xb4');_0x2559d6+=_0xb147('0x94');_0x2559d6+=_0xb147('0xc1');_0x2559d6+=_0xb147('0xc2');_0x2559d6+=_0xb147('0x94');_0x2559d6+=_0xb147('0xc3')+_0x326ce3[_0xb147('0xc4')][_0x31f9ee]+'';_0x2559d6+=_0xb147('0xc3')+_0x326ce3[_0xb147('0xc5')][_0x31f9ee]+_0xb147('0xc6');_0x2559d6+=_0xb147('0xc3')+_0x326ce3['hrsqty'][_0x31f9ee]+_0xb147('0xc6');_0x2559d6+=_0xb147('0xc3')+_0x326ce3['unitprice'][_0x31f9ee]+_0xb147('0xc6');_0x2559d6+=_0xb147('0xc3')+_0x326ce3[_0xb147('0xc7')][_0x31f9ee]+_0xb147('0xc6');_0x2559d6+='';var _0x15d8fe=0x0;var _0x4a4849=0x0;for(var _0xe06e7=0x0;_0xe06e7<_0x2c197b[_0xb147('0x5c')][_0xb147('0x2e')];_0xe06e7++){var _0x3cf2c0=0x0;var _0xf15e40=0x0;var _0x3f54c6=0x0;var _0x2b344a=0x0;_0x3cf2c0=_0x2c197b[_0xb147('0x5c')][_0xe06e7][_0xb147('0xc8')]-_0x2c197b[_0xb147('0x5c')][_0xe06e7]['netPrice']/0x64*_0x2c197b[_0xb147('0x5c')][_0xe06e7][_0xb147('0xc9')];_0xf15e40=_0x3cf2c0/0x64*_0x2c197b[_0xb147('0x5c')][_0xe06e7][_0xb147('0xca')];_0x3f54c6=_0x3cf2c0*_0x2c197b['details'][_0xe06e7][_0xb147('0xcb')];_0x2b344a=_0xf15e40*_0x2c197b['details'][_0xe06e7][_0xb147('0xcb')];_0x2559d6+=_0xb147('0x94');_0x2559d6+=util['format'](_0xb147('0xcc'),_0x2c197b['details'][_0xe06e7][_0xb147('0xcd')]);_0x2559d6+=util[_0xb147('0x58')](_0xb147('0xcc'),_0x2c197b['details'][_0xe06e7]['productDescription']);_0x2559d6+=util[_0xb147('0x58')]('%d',_0x2c197b[_0xb147('0x5c')][_0xe06e7][_0xb147('0xcb')]);_0x2559d6+=_0xb147('0xce')+_0x3cf2c0['toFixed'](0x2)+'€';_0x2559d6+=_0xb147('0xce')+_0x3f54c6['toFixed'](0x2)+'€';_0x2559d6+=_0xb147('0xb4');_0x15d8fe+=_0x3f54c6;_0x4a4849+=_0x2b344a;}_0x2559d6+=_0xb147('0xcf');if(!_[_0xb147('0xd0')](_0x2c197b[_0xb147('0x5a')][_0xb147('0xc9')])){var _0xe2ed77=0x0;var _0xd453c7=0x0;var _0x4998fa=_0x2c197b['invoice']['discount']*0x64/_0x15d8fe;for(var _0xe06e7=0x0;_0xe06e7<_0x2c197b[_0xb147('0x5c')][_0xb147('0x2e')];_0xe06e7++){var _0xa84818=0x0;var _0x27a82e=0x0;var _0x38fe8c=0x0;_0x3cf2c0=_0x2c197b['details'][_0xe06e7]['netPrice']-_0x2c197b['details'][_0xe06e7]['netPrice']/0x64*_0x2c197b['details'][_0xe06e7][_0xb147('0xc9')];_0xa84818=_0x3cf2c0/0x64*_0x4998fa;_0x27a82e=_0x3cf2c0-_0xa84818;_0x38fe8c=_0x27a82e*_0x2c197b['details'][_0xe06e7][_0xb147('0xcb')];_0xe2ed77+=_0x38fe8c;_0xd453c7+=_0x38fe8c/0x64*_0x2c197b['details'][_0xe06e7]['tax'];}}var _0x55f987=0x0;var _0x561f9d=0x0;var _0x5a4f41=![];var _0x37841a=_0x2c197b['invoice'][_0xb147('0xd1')];if(_0x37841a[_0xb147('0xd2')](_0xb147('0xd3'))!=-0x1){_0x5a4f41=!![];}if(!_[_0xb147('0xd0')](_0x2c197b[_0xb147('0x5a')]['discount'])){_0x2559d6+=_0xb147('0x94');if(_0x2c197b['invoice'][_0xb147('0xc9')]>0x0){_0x2559d6+=_0xb147('0xd4')+_0x326ce3[_0xb147('0xc9')][_0x31f9ee]+_0xb147('0xd5');_0x2559d6+=_0xb147('0xd6')+_0x2c197b[_0xb147('0x5a')][_0xb147('0xc9')][_0xb147('0xd7')](0x2)+_0xb147('0xd8');}_0x2559d6+=_0xb147('0xb4');_0x55f987=_0xd453c7;_0x561f9d=_0xe2ed77;}else{_0x55f987=_0x4a4849;_0x561f9d=_0x15d8fe;}if(_0x55f987>0x0||_0x2c197b[_0xb147('0x5a')][_0xb147('0xc9')]>0x0){_0x2559d6+='';_0x2559d6+=_0xb147('0xd9')+_0x326ce3[_0xb147('0xda')][_0x31f9ee]+_0xb147('0xd5');_0x2559d6+=_0xb147('0xce')+_0x561f9d[_0xb147('0xd7')](0x2)+_0xb147('0xd8');_0x2559d6+=_0xb147('0xb4');}if(_0x55f987>0x0){_0x2559d6+='';_0x2559d6+=_0xb147('0xd9')+_0x326ce3[_0xb147('0xca')][_0x31f9ee]+_0xb147('0xd5');_0x2559d6+=''+_0x55f987[_0xb147('0xd7')](0x2)+_0xb147('0xd8');_0x2559d6+=_0xb147('0xb4');}_0x2559d6+=_0xb147('0x94');var _0x2fce8c;if(_0x5a4f41){_0x2fce8c=_0x561f9d;}else{_0x2fce8c=_0x561f9d+_0x55f987;}_0x2559d6+=_0xb147('0xdb')+_0x326ce3['nettopay'][_0x31f9ee]+''+_0x2fce8c[_0xb147('0xd7')](0x2)+_0xb147('0xd8');_0x2559d6+=_0xb147('0xdc');_0x2559d6+=_0xb147('0xb4');_0x2559d6+=' ';_0x2559d6+='';_0x2559d6+=_0xb147('0x94');_0x2559d6+=util[_0xb147('0x58')](_0xb147('0xdd'),_0x2c197b['invoice'][_0xb147('0xd1')][_0xb147('0xde')](new RegExp(String['fromCharCode'](0xd),'g'),_0xb147('0xdf')));_0x2559d6+=_0xb147('0xb4');_0x2559d6+=_0xb147('0x94');_0x2559d6+=_0xb147('0xc1');_0x2559d6+=_0xb147('0xe0')+_0x326ce3['sendpayment'][_0x31f9ee]+_0xb147('0xe1');if(!_['isNil'](_0x2c197b['invoice'][_0xb147('0xe2')])){_0x2559d6+=''+_0x326ce3['accountholder'][_0x31f9ee]+_0xb147('0xe3')+_0x2c197b['invoice'][_0xb147('0xe2')]+_0xb147('0xe4');_0x2559d6+=_0xb147('0xe0')+_0x326ce3[_0xb147('0xe5')][_0x31f9ee]+_0xb147('0xe3')+_0x2c197b[_0xb147('0x5a')]['issuerBankName']+_0xb147('0xe6');_0x2559d6+=''+_0x326ce3[_0xb147('0xe7')][_0x31f9ee]+_0xb147('0xe3')+_0x2c197b['invoice'][_0xb147('0xe8')]+',\x20'+_0x2c197b[_0xb147('0x5a')][_0xb147('0xe9')]+'\x20-\x20'+_0x2c197b[_0xb147('0x5a')][_0xb147('0xea')]+'\x20('+_0x2c197b[_0xb147('0x5a')][_0xb147('0xeb')]+')'+_0xb147('0xe4');_0x2559d6+=_0xb147('0xe0')+_0x326ce3[_0xb147('0xec')][_0x31f9ee]+'/'+_0x326ce3[_0xb147('0xed')][_0x31f9ee]+_0xb147('0xe3')+_0x2c197b[_0xb147('0x5a')][_0xb147('0xee')]+'/'+_0x2c197b[_0xb147('0x5a')][_0xb147('0xef')]+_0xb147('0xe4');_0x2559d6+=_0xb147('0xe0')+_0x326ce3[_0xb147('0xf0')][_0x31f9ee]+'/'+_0x326ce3['swif'][_0x31f9ee]+_0xb147('0xe3')+_0x2c197b[_0xb147('0x5a')][_0xb147('0xf1')]+_0xb147('0xe4');_0x2559d6+=_0xb147('0xe0')+_0x326ce3['iban'][_0x31f9ee]+_0xb147('0xe3')+_0x2c197b[_0xb147('0x5a')][_0xb147('0xf2')]+'';}if(!_[_0xb147('0xd0')](_0x2c197b[_0xb147('0x5a')]['issuerPayPal'])){_0x2559d6+=_0xb147('0xe0')+_0x326ce3[_0xb147('0xf3')][_0x31f9ee]+_0xb147('0xe3')+_0x2c197b[_0xb147('0x5a')]['issuerPayPal']+_0xb147('0xf4');}_0x2559d6+=''+_0x326ce3[_0xb147('0xf5')][_0x31f9ee]+_0xb147('0xf6')+_0x91b6+_0xb147('0xf7')+_0x326ce3['thank2'][_0x31f9ee]+_0xb147('0x65');_0x2559d6+=_0xb147('0xd5');_0x2559d6+=_0xb147('0xb4');if(_0x2c197b['invoice'][_0xb147('0xf8')]===0x1){_0x2559d6+='\x200x0){var _0x3977c8=[];for(var _0x1dc133=0x0;_0x1dc133<_0x4092b7['length'];_0x1dc133++){_0x3977c8[_0xb147('0x14b')](addInvoiceCreditnoteDetail(_0x4092b7[_0x1dc133],_0x198d36['id'],_0x4db0bc));}return BPromise[_0xb147('0x14c')](_0x3977c8);}else{var _0x4d6deb={'errors':[{'type':_0xb147('0x14d'),'message':_0xb147('0x14e')}]};throw _0x4d6deb;}});})[_0xb147('0x20')](function(){return _0x43d38f['sendStatus'](0xc8);})[_0xb147('0x43')](function(_0x2f1e6c){console[_0xb147('0xfe')](_0xb147('0x14f'),_0x2f1e6c);if(_0x2f1e6c['name']==='SequelizeUniqueConstraintError'){var _0x2f1e6c={'errors':[{'message':_0xb147('0x150')}]};}_0x43d38f[_0xb147('0x17')](0x1f4)[_0xb147('0x24')](_0x2f1e6c);});}; \ No newline at end of file +var _0xf604=['issuerName','issuerStreet','issuerPostalCode','issuerCity','-\x20%s\x20
','issuerCountry',':\x20%s
','fax','issuerFax','issuerEmail','piva','issuerPIVA','sdi','issuerSDICode','issuerSocCap','','','%s','companyName','receivingStreet','receivingPostalCode','%s
','receivingCity','','receivingFiscalCode','receivingPIVA','receivingSDICode','','','\x20N.%d\x20/\x20%d\x20(id:\x20%d)','number','startDate','YYYY','DD/MM/YYYY','add','saExpiryDay','days','endDate','','duedate','
','','','item','','','description','hrsqty','unitprice','subtotal','netPrice','discount','tax','productName','','productDescription','%d','quantity','','toFixed','€','
%s
','isNil','indexOf','split\x20payment','\x20','','total','','nettopay','\x20',' ','\x20%s\x20','receivingFiscalMessage','replace','fromCharCode','','',':','accountholder',':\x20','','bankname','issuerBankName','\x20','issuerBankStreet','issuerBankPostalCode','\x20-\x20','issuerBankCity','issuerBankCountry','abi','cab','issuerABI','issuerCAB','swif','issuerBankBICSWIFT','iban','issuerBankIBAN','paypal','issuerPayPal','','thank1','','','thank2','\x22\x20width=\x22180\x22>','','','','log','toFile','download','select','sa_invoices','invoiceNumber','YEAR(startDate)','invoiceYear','MONTH(startDate)','YEAR(startDate)\x20IN\x20(','order','group','toString','QueryTypes','SELECT','getInvoicesRevenueBy','years','sa_invoice_details','(startDate)','month','year','sum(said.netPrice\x20*\x20said.quantity)','sai','sai.id\x20=\x20said.InvoiceId','getYearToCompare','from','YEAR(startDate)\x20!=\x20YEAR(CURDATE())','getTopClients','dateStart','top','area','relationship','relatedCompany','sai.receivingCountry\x20=\x20\x22italy\x22','europe','sai.receivingEurope\x20=\x201','com.saCompanyRelationship\x20=\x20','com.CmCompanyId\x20=\x20','said','sai.companyName','sai.receivingCountry','nation','com.saCompanyRelationship','relationshipId','relatedCompanyId','rel.name','relationshipName','companyRelatedName','cm_companies','com','sai.companyName\x20=\x20com.name','left_join','sa_company_relationships','rel','rel.Id\x20=\x20saCompanyRelationship','relCom','relCom.Id\x20=\x20com.CmCompanyId','sai.startDate\x20>=\x20?','sai.startDate\x20<=\x20?','sum(((said.netPrice\x20-\x20(said.netPrice\x20/\x20100\x20*\x20said.discount))\x20*\x20said.quantity))\x20-\x20coalesce(sai.discount,0)','com.CmCompanyId','said.discount','sai.discount','query.toString()','addInvoiceCreditnoteDetail->>','companyId','productCode','subscriptionId','subscriptionName','subscriptionMonthly','SACreditNoteDetail','automaticInvoiceCreditnote','SAInvoiceDetail','push','all','No\x20product\x20to\x20assign\x20credit\x20note.\x20Credit\x20note\x20not\x20created!!\x20','TCL:\x20exports.automaticInvoiceCreditnote\x20->\x20err','Duplicate\x20entry.','html-pdf','eml-format','fast-json-patch','request-promise','moment','mustache','path','ejs','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','update','then','destroy','end','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','key','field','options','SAInvoice','count','includeAll','include','findAll','rows','catch','show','params','find','create','sequelize','transaction','Sequelize','Transaction','SERIALIZABLE','body','describe','getInvoicePDF','join','server','tmp','files','images','logos','logo-invoice.png','root','format','details','{{page}}/{{pages}}','contents','default','','issuerWeb','','mkdirSync','','\x20\x20body{font-family:\x20Roboto,\x20\x27Segoe\x20UI\x27,\x20Tahoma,\x20sans-serif;}.itemTabTitle{background-color:\x20lightgray;\x20height:\x2040px;}.issuerInfo{color:\x20lightgray;\x20padding-top:\x2020px;\x20padding-bottom:\x2020px;\x20font-size:\x2010px;}.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:\x20bolder;\x20padding-bottom:\x2010px;\x20font-size:\x2010px}.reciperFiscalInfo{padding-top:\x205px;\x20padding-bottom:\x205px;,\x20font-size:\x2010px;}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:\x208px;\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:\x208px;}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','I.S.\x20code','Cap.Soc.\x20iv','Fattura','Proforma','Credit\x20note','Due\x20date','Scadenza','Item','Articolo','Description','Descrizione','Hrs/Qty','Unit\x20Price','Sub\x20Total','Sub\x20Totale','Subtotal','Imponibile','Tax','Please\x20send\x20PAYMENT\x20to','Si\x20prega\x20di\x20inviare\x20il\x20pagamento\x20a','Conto\x20intestato\x20a','Nome\x20banca','Bank\x20Address','Indirizzo\x20banca','ABI','CAB','BIC','SWIF','IBAN','Pay\x20via\x20Paypal','Paga\x20con\x20Paypal','Grazie.\x20Prevediamo\x20il\x20pagamento\x20entro\x20','\x20quindi\x20vi\x20preghiamo\x20di\x20provvedere\x20entro\x20tale\x20termine.','receivingCountry','','\x20','\x20%s
','invoice'];(function(_0x1a885b,_0x8e4821){var _0x1a9325=function(_0x470f1d){while(--_0x470f1d){_0x1a885b['push'](_0x1a885b['shift']());}};_0x1a9325(++_0x8e4821);}(_0xf604,0xbb));var _0x4f60=function(_0x4cd065,_0x556981){_0x4cd065=_0x4cd065-0x0;var _0x3cd13f=_0xf604[_0x4cd065];return _0x3cd13f;};'use strict';var pdf=require(_0x4f60('0x0'));var emlformat=require(_0x4f60('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4f60('0x2'));var rp=require(_0x4f60('0x3'));var moment=require(_0x4f60('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4f60('0x5'));var util=require('util');var path=require(_0x4f60('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4f60('0x7'));var fs=require('fs');var _=require(_0x4f60('0x8'));var squel=require('squel');var crypto=require(_0x4f60('0x9'));var jsforce=require(_0x4f60('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x4f60('0xb'));var querystring=require(_0x4f60('0xc'));var Papa=require(_0x4f60('0xd'));var Redis=require(_0x4f60('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x4f60('0xf'));var hardwareService=require(_0x4f60('0x10'));var logger=require('../../config/logger')(_0x4f60('0x11'));var utils=require(_0x4f60('0x12'));var config=require(_0x4f60('0x13'));var db=require(_0x4f60('0x14'))['db'];function respondWithStatusCode(_0x1eb5f4,_0x1197fd){_0x1197fd=_0x1197fd||0xcc;return function(_0x387c07){if(_0x387c07){return _0x1eb5f4[_0x4f60('0x15')](_0x1197fd);}return _0x1eb5f4['status'](_0x1197fd)['end']();};}function respondWithResult(_0x3021d2,_0x33d0a6){_0x33d0a6=_0x33d0a6||0xc8;return function(_0x28d661){if(_0x28d661){return _0x3021d2[_0x4f60('0x16')](_0x33d0a6)[_0x4f60('0x17')](_0x28d661);}};}function respondWithFilteredResult(_0x2d687f,_0x50d81e){return function(_0x3170f3){if(_0x3170f3){var _0x97bc4a=_0x3170f3['count'],_0x518505=_0x50d81e[_0x4f60('0x18')],_0x30a206=_0x50d81e[_0x4f60('0x18')]+_0x50d81e[_0x4f60('0x19')],_0x2d0861;if(_0x30a206>=_0x97bc4a){_0x30a206=_0x97bc4a;_0x2d0861=0xc8;}else{_0x2d0861=0xce;}_0x2d687f[_0x4f60('0x16')](_0x2d0861);return _0x2d687f[_0x4f60('0x1a')](_0x4f60('0x1b'),_0x518505+'-'+_0x30a206+'/'+_0x97bc4a)[_0x4f60('0x17')](_0x3170f3);}return null;};}function patchUpdates(_0x460288){return function(_0x239563){try{jsonpatch[_0x4f60('0x1c')](_0x239563,_0x460288,!![]);}catch(_0x28d412){return BPromise[_0x4f60('0x1d')](_0x28d412);}return _0x239563['save']();};}function saveUpdates(_0x2f11a1,_0x403c60){return function(_0x1ffbd1){if(_0x1ffbd1){return _0x1ffbd1[_0x4f60('0x1e')](_0x2f11a1)[_0x4f60('0x1f')](function(_0x51dcc3){return _0x51dcc3;});}return null;};}function removeEntity(_0x1b906b,_0x111fcd){return function(_0x2fa5fc){if(_0x2fa5fc){return _0x2fa5fc[_0x4f60('0x20')]()[_0x4f60('0x1f')](function(){_0x1b906b['status'](0xcc)[_0x4f60('0x21')]();});}};}function handleEntityNotFound(_0x3b30dc,_0x33aee5){return function(_0x25c786){if(!_0x25c786){_0x3b30dc[_0x4f60('0x15')](0x194);}return _0x25c786;};}function handleError(_0x510a65,_0x15dd5a){_0x15dd5a=_0x15dd5a||0x1f4;return function(_0xcf8d3c){logger['error'](_0xcf8d3c['stack']);if(_0xcf8d3c[_0x4f60('0x22')]){delete _0xcf8d3c[_0x4f60('0x22')];}_0x510a65[_0x4f60('0x16')](_0x15dd5a)[_0x4f60('0x23')](_0xcf8d3c);};}exports[_0x4f60('0x24')]=function(_0x1cb1b0,_0x2e9ef1){var _0x203b11={},_0x2db047={},_0x2352c9={'count':0x0,'rows':[]};var _0xd97b96=db['SAInvoice'][_0x4f60('0x25')];_0x2db047[_0x4f60('0x26')]=_[_0x4f60('0x27')](_0xd97b96);_0x2db047[_0x4f60('0x28')]=_[_0x4f60('0x27')](_0x1cb1b0[_0x4f60('0x28')]);_0x2db047[_0x4f60('0x29')]=_[_0x4f60('0x2a')](_0x2db047[_0x4f60('0x26')],_0x2db047[_0x4f60('0x28')]);_0x203b11[_0x4f60('0x2b')]=_['intersection'](_0x2db047[_0x4f60('0x26')],qs[_0x4f60('0x2c')](_0x1cb1b0['query'][_0x4f60('0x2c')]));_0x203b11[_0x4f60('0x2b')]=_0x203b11['attributes'][_0x4f60('0x2d')]?_0x203b11[_0x4f60('0x2b')]:_0x2db047[_0x4f60('0x26')];if(!_0x1cb1b0[_0x4f60('0x28')][_0x4f60('0x2e')](_0x4f60('0x2f'))){_0x203b11['limit']=qs['limit'](_0x1cb1b0[_0x4f60('0x28')][_0x4f60('0x19')]);_0x203b11[_0x4f60('0x18')]=qs['offset'](_0x1cb1b0[_0x4f60('0x28')][_0x4f60('0x18')]);}_0x203b11['order']=qs[_0x4f60('0x30')](_0x1cb1b0[_0x4f60('0x28')][_0x4f60('0x30')]);_0x203b11[_0x4f60('0x31')]=qs['filters'](_['pick'](_0x1cb1b0[_0x4f60('0x28')],_0x2db047[_0x4f60('0x29')]));if(_0x1cb1b0[_0x4f60('0x28')][_0x4f60('0x32')]){_0x203b11[_0x4f60('0x31')]=_[_0x4f60('0x33')](_0x203b11[_0x4f60('0x31')],{'$or':_[_0x4f60('0x34')](_0xd97b96,function(_0x162c57){if(_0x162c57['type'][_0x4f60('0x35')]!=='VIRTUAL'){var _0x5bb906={};_0x5bb906[_0x162c57[_0x4f60('0x36')]]={'$like':'%'+_0x1cb1b0[_0x4f60('0x28')]['filter']+'%'};return _0x5bb906;}})});}_0x203b11=_[_0x4f60('0x33')]({},_0x203b11,_0x1cb1b0[_0x4f60('0x37')]);var _0x21a41a={'where':_0x203b11[_0x4f60('0x31')]};return db[_0x4f60('0x38')][_0x4f60('0x39')](_0x21a41a)['then'](function(_0x49c9c7){_0x2352c9[_0x4f60('0x39')]=_0x49c9c7;if(_0x1cb1b0[_0x4f60('0x28')][_0x4f60('0x3a')]){_0x203b11[_0x4f60('0x3b')]=[{'all':!![]}];}return db[_0x4f60('0x38')][_0x4f60('0x3c')](_0x203b11);})[_0x4f60('0x1f')](function(_0x1ada42){_0x2352c9[_0x4f60('0x3d')]=_0x1ada42;return _0x2352c9;})[_0x4f60('0x1f')](respondWithFilteredResult(_0x2e9ef1,_0x203b11))[_0x4f60('0x3e')](handleError(_0x2e9ef1,null));};exports[_0x4f60('0x3f')]=function(_0x4f534e,_0x1d270a){var _0x9bf45c={'raw':![],'where':{'id':_0x4f534e[_0x4f60('0x40')]['id']}},_0x6aec77={};_0x6aec77[_0x4f60('0x26')]=_['keys'](db['SAInvoice'][_0x4f60('0x25')]);_0x6aec77[_0x4f60('0x28')]=_[_0x4f60('0x27')](_0x4f534e[_0x4f60('0x28')]);_0x6aec77[_0x4f60('0x29')]=_['intersection'](_0x6aec77[_0x4f60('0x26')],_0x6aec77['query']);_0x9bf45c['attributes']=_[_0x4f60('0x2a')](_0x6aec77[_0x4f60('0x26')],qs['fields'](_0x4f534e['query'][_0x4f60('0x2c')]));_0x9bf45c[_0x4f60('0x2b')]=_0x9bf45c[_0x4f60('0x2b')][_0x4f60('0x2d')]?_0x9bf45c['attributes']:_0x6aec77[_0x4f60('0x26')];if(_0x4f534e[_0x4f60('0x28')][_0x4f60('0x3a')]){_0x9bf45c[_0x4f60('0x3b')]=[{'all':!![]}];}_0x9bf45c=_[_0x4f60('0x33')]({},_0x9bf45c,_0x4f534e[_0x4f60('0x37')]);return db[_0x4f60('0x38')][_0x4f60('0x41')](_0x9bf45c)[_0x4f60('0x1f')](handleEntityNotFound(_0x1d270a,null))[_0x4f60('0x1f')](respondWithResult(_0x1d270a,null))[_0x4f60('0x3e')](handleError(_0x1d270a,null));};exports[_0x4f60('0x42')]=function(_0x3eb522,_0x3a36eb){return db[_0x4f60('0x43')][_0x4f60('0x44')]({'isolationLevel':db[_0x4f60('0x45')][_0x4f60('0x46')]['ISOLATION_LEVELS'][_0x4f60('0x47')]},function(_0x1cd1bc){return db[_0x4f60('0x38')]['create'](_0x3eb522[_0x4f60('0x48')],{'transaction':_0x1cd1bc});})[_0x4f60('0x1f')](respondWithResult(_0x3a36eb,0xc9))[_0x4f60('0x3e')](handleError(_0x3a36eb,null));};exports[_0x4f60('0x1e')]=function(_0x37cf4e,_0xb5b110){if(_0x37cf4e[_0x4f60('0x48')]['id']){delete _0x37cf4e[_0x4f60('0x48')]['id'];}return db[_0x4f60('0x38')][_0x4f60('0x41')]({'where':{'id':_0x37cf4e[_0x4f60('0x40')]['id']}})[_0x4f60('0x1f')](handleEntityNotFound(_0xb5b110,null))[_0x4f60('0x1f')](saveUpdates(_0x37cf4e[_0x4f60('0x48')],null))['then'](respondWithResult(_0xb5b110,null))['catch'](handleError(_0xb5b110,null));};exports[_0x4f60('0x20')]=function(_0x4fa6a5,_0x2c15dc){return db[_0x4f60('0x38')][_0x4f60('0x41')]({'where':{'id':_0x4fa6a5[_0x4f60('0x40')]['id']}})[_0x4f60('0x1f')](handleEntityNotFound(_0x2c15dc,null))[_0x4f60('0x1f')](removeEntity(_0x2c15dc,null))[_0x4f60('0x3e')](handleError(_0x2c15dc,null));};exports[_0x4f60('0x49')]=function(_0xeee392,_0xde58d1){return db['SAInvoice'][_0x4f60('0x49')]()[_0x4f60('0x1f')](respondWithResult(_0xde58d1,null))[_0x4f60('0x3e')](handleError(_0xde58d1,null));};exports[_0x4f60('0x4a')]=function(_0x399067,_0xfa40bb){var _0xd5f5a2=moment()['unix']()['toString']();var _0x35ffb2=path[_0x4f60('0x4b')](config['root'],_0x4f60('0x4c'),'files',_0x4f60('0x4d'));var _0x5f43e2=path[_0x4f60('0x4b')](config['root'],_0x4f60('0x4c'),_0x4f60('0x4e'),_0x4f60('0x4f'),_0x4f60('0x50'),_0x4f60('0x51'));var _0x39684e=path[_0x4f60('0x4b')](config[_0x4f60('0x52')],_0x4f60('0x4c'),'files','images','logos','paid-invoice.png');var _0x12c63c=path[_0x4f60('0x4b')](_0x35ffb2,_0xd5f5a2);var _0x323876=util[_0x4f60('0x53')]('Invoice_%s-%s.pdf',_0x399067[_0x4f60('0x40')]['id'],_0xd5f5a2);var _0x342fb6=path[_0x4f60('0x4b')](_0x12c63c,_0x323876);var _0x418e07=![];var _0x3257ad={};return db[_0x4f60('0x38')]['find']({'where':{'id':_0x399067[_0x4f60('0x40')]['id']},'raw':!![]})[_0x4f60('0x1f')](handleEntityNotFound(_0xfa40bb,null))[_0x4f60('0x1f')](function(_0x5aa764){if(_0x5aa764){_0x3257ad['invoice']=_0x5aa764;return db['SAInvoiceDetail'][_0x4f60('0x3c')]({'where':{'InvoiceId':_0x5aa764['id']},'raw':!![]})[_0x4f60('0x1f')](function(_0x464f66){_0x3257ad[_0x4f60('0x54')]=_0x464f66;_0x418e07=!![];var _0x20c678='';var _0x768c9d={'format':'A4','orientation':'portrait','border':'1cm','footer':{'height':'10mm','contents':{'default':_0x4f60('0x55')}}};_0x768c9d['footer'][_0x4f60('0x56')][_0x4f60('0x57')]=_0x768c9d['footer'][_0x4f60('0x56')][_0x4f60('0x57')]+_0x4f60('0x58')+_0x3257ad['invoice'][_0x4f60('0x59')]+_0x4f60('0x5a');fs[_0x4f60('0x5b')](_0x12c63c);_0x20c678=_0x4f60('0x5c');_0x20c678+=_0x4f60('0x5d');_0x20c678+=_0x4f60('0x5e');var _0x101ae6={'phone':{'en':'Phone','it':_0x4f60('0x5f')},'fax':{'en':_0x4f60('0x60'),'it':'Fax'},'email':{'en':_0x4f60('0x61'),'it':'Email'},'piva':{'en':_0x4f60('0x62'),'it':'P.IVA'},'cf':{'en':'Tax\x20code','it':'C.F.'},'sdi':{'en':_0x4f60('0x63'),'it':'Codice\x20S.D.I.'},'cs':{'en':'Soc.Cap.\x20fp','it':_0x4f60('0x64')},'invoice':{'en':'Invoice','it':_0x4f60('0x65')},'proforma':{'en':_0x4f60('0x66'),'it':_0x4f60('0x66')},'creditnote':{'en':_0x4f60('0x67'),'it':'Nota\x20di\x20credito'},'duedate':{'en':_0x4f60('0x68'),'it':_0x4f60('0x69')},'item':{'en':_0x4f60('0x6a'),'it':_0x4f60('0x6b')},'description':{'en':_0x4f60('0x6c'),'it':_0x4f60('0x6d')},'hrsqty':{'en':_0x4f60('0x6e'),'it':'Ore/Qta'},'unitprice':{'en':_0x4f60('0x6f'),'it':'Prezzo\x20Unitario'},'subtotal':{'en':_0x4f60('0x70'),'it':_0x4f60('0x71')},'discount':{'en':'Discount','it':'Sconto'},'total':{'en':_0x4f60('0x72'),'it':_0x4f60('0x73')},'tax':{'en':_0x4f60('0x74'),'it':'Tasse'},'nettopay':{'en':'Total','it':'Totale'},'sendpayment':{'en':_0x4f60('0x75'),'it':_0x4f60('0x76')},'accountholder':{'en':'Account\x20Holder','it':_0x4f60('0x77')},'bankname':{'en':'Bank\x20name','it':_0x4f60('0x78')},'bankaddress':{'en':_0x4f60('0x79'),'it':_0x4f60('0x7a')},'abi':{'en':_0x4f60('0x7b'),'it':'ABI'},'cab':{'en':_0x4f60('0x7c'),'it':_0x4f60('0x7c')},'bic':{'en':_0x4f60('0x7d'),'it':'BIC'},'swif':{'en':'SWIF','it':_0x4f60('0x7e')},'iban':{'en':'IBAN','it':_0x4f60('0x7f')},'paypal':{'en':_0x4f60('0x80'),'it':_0x4f60('0x81')},'thank1':{'en':'Thank\x20you\x20for\x20your\x20business.\x20We\x20do\x20expect\x20payment\x20by\x20','it':_0x4f60('0x82')},'thank2':{'en':',\x20so\x20please\x20do\x20so\x20within\x20this\x20time.','it':_0x4f60('0x83')}};var _0x1f097e='it';if(_0x3257ad['invoice'][_0x4f60('0x84')]!=='Italy'){_0x1f097e='en';}_0x20c678+=_0x4f60('0x85');_0x20c678+=_0x4f60('0x86')+_0x5f43e2+'\x22\x20width=\x22180\x22>';_0x20c678+=_0x4f60('0x87');_0x20c678+=util[_0x4f60('0x53')](_0x4f60('0x88'),_0x3257ad[_0x4f60('0x89')][_0x4f60('0x8a')]);_0x20c678+=util[_0x4f60('0x53')]('%s
',_0x3257ad['invoice'][_0x4f60('0x8b')]);_0x20c678+=util[_0x4f60('0x53')]('%s',_0x3257ad['invoice'][_0x4f60('0x8c')]);_0x20c678+=util[_0x4f60('0x53')]('\x20%s',_0x3257ad[_0x4f60('0x89')][_0x4f60('0x8d')]);_0x20c678+=util[_0x4f60('0x53')](_0x4f60('0x8e'),_0x3257ad[_0x4f60('0x89')][_0x4f60('0x8f')]);_0x20c678+=util[_0x4f60('0x53')](_0x101ae6['phone'][_0x1f097e]+_0x4f60('0x90'),_0x3257ad[_0x4f60('0x89')]['issuerPhone']);_0x20c678+=util[_0x4f60('0x53')](_0x101ae6[_0x4f60('0x91')][_0x1f097e]+':\x20%s
',_0x3257ad[_0x4f60('0x89')][_0x4f60('0x92')]);_0x20c678+=util[_0x4f60('0x53')](_0x101ae6['email'][_0x1f097e]+':\x20%s
',_0x3257ad[_0x4f60('0x89')][_0x4f60('0x93')]);_0x20c678+=util['format'](_0x101ae6[_0x4f60('0x94')][_0x1f097e]+':\x20%s
',_0x3257ad[_0x4f60('0x89')][_0x4f60('0x95')]);_0x20c678+=util[_0x4f60('0x53')](_0x101ae6['cf'][_0x1f097e]+_0x4f60('0x90'),_0x3257ad[_0x4f60('0x89')]['issuerFiscalCode']);_0x20c678+=util['format'](_0x101ae6[_0x4f60('0x96')][_0x1f097e]+_0x4f60('0x90'),_0x3257ad[_0x4f60('0x89')][_0x4f60('0x97')]);_0x20c678+=util[_0x4f60('0x53')](_0x101ae6['cs'][_0x1f097e]+_0x4f60('0x90'),_0x3257ad[_0x4f60('0x89')][_0x4f60('0x98')]);_0x20c678+=_0x4f60('0x99');_0x20c678+='';_0x20c678+=_0x4f60('0x9a');_0x20c678+=util[_0x4f60('0x53')](_0x4f60('0x9b'),_0x3257ad['invoice'][_0x4f60('0x9c')]);_0x20c678+=util['format']('%s
',_0x3257ad[_0x4f60('0x89')][_0x4f60('0x9d')]);_0x20c678+=util['format']('%s\x20-\x20',_0x3257ad[_0x4f60('0x89')][_0x4f60('0x9e')]);_0x20c678+=util[_0x4f60('0x53')](_0x4f60('0x9f'),_0x3257ad['invoice'][_0x4f60('0xa0')]);_0x20c678+=util[_0x4f60('0x53')](_0x4f60('0x9f'),_0x3257ad[_0x4f60('0x89')][_0x4f60('0x84')]);_0x20c678+=_0x4f60('0xa1');if(_0x3257ad[_0x4f60('0x89')][_0x4f60('0xa2')]){_0x20c678+=util['format'](_0x101ae6['cf'][_0x1f097e]+_0x4f60('0x90'),_0x3257ad[_0x4f60('0x89')]['receivingFiscalCode']);}_0x20c678+=util[_0x4f60('0x53')](_0x101ae6[_0x4f60('0x94')][_0x1f097e]+':\x20%s
',_0x3257ad[_0x4f60('0x89')][_0x4f60('0xa3')]);if(_0x3257ad[_0x4f60('0x89')]['receivingSDICode']){_0x20c678+=util[_0x4f60('0x53')](_0x101ae6[_0x4f60('0x96')][_0x1f097e]+':\x20%s
',_0x3257ad['invoice'][_0x4f60('0xa4')]);}_0x20c678+=_0x4f60('0xa5');_0x20c678+='';_0x20c678+=_0x4f60('0x87');_0x20c678+='';_0x20c678+=util[_0x4f60('0x53')](_0x4f60('0xa6')+_0x101ae6[_0x4f60('0x89')][_0x1f097e]+_0x4f60('0xa7'),_0x5aa764[_0x4f60('0xa8')],moment(_0x3257ad[_0x4f60('0x89')][_0x4f60('0xa9')])[_0x4f60('0x53')](_0x4f60('0xaa')),_0x3257ad[_0x4f60('0x89')]['id']);_0x20c678+=util['format']('%s,\x20',_0x3257ad[_0x4f60('0x89')][_0x4f60('0x8d')]);var _0x33add6=moment(_0x3257ad[_0x4f60('0x89')]['startDate'])['format'](_0x4f60('0xab'));_0x20c678+=util['format']('%s\x20',_0x33add6);var _0x4ed3c3=moment(_0x3257ad[_0x4f60('0x89')][_0x4f60('0xa9')])[_0x4f60('0xac')](_0x3257ad[_0x4f60('0x89')][_0x4f60('0xad')],_0x4f60('0xae'))[_0x4f60('0x53')]('DD/MM/YYYY');if(_0x3257ad[_0x4f60('0x89')][_0x4f60('0xaf')]){_0x4ed3c3=moment(_0x3257ad[_0x4f60('0x89')][_0x4f60('0xaf')])[_0x4f60('0x53')](_0x4f60('0xab'));}_0x20c678+=util[_0x4f60('0x53')](_0x4f60('0xb0')+_0x101ae6[_0x4f60('0xb1')][_0x1f097e]+':\x20%s',_0x4ed3c3);_0x20c678+=_0x4f60('0xb2');_0x20c678+=_0x4f60('0x87');_0x20c678+=_0x4f60('0xb3');_0x20c678+=_0x4f60('0xb4');_0x20c678+=_0x4f60('0x87');_0x20c678+=''+_0x101ae6[_0x4f60('0xb5')][_0x1f097e]+_0x4f60('0xb6');_0x20c678+=_0x4f60('0xb7')+_0x101ae6[_0x4f60('0xb8')][_0x1f097e]+'';_0x20c678+=_0x4f60('0xb7')+_0x101ae6[_0x4f60('0xb9')][_0x1f097e]+_0x4f60('0xb6');_0x20c678+=_0x4f60('0xb7')+_0x101ae6[_0x4f60('0xba')][_0x1f097e]+'';_0x20c678+=_0x4f60('0xb7')+_0x101ae6[_0x4f60('0xbb')][_0x1f097e]+_0x4f60('0xb6');_0x20c678+=_0x4f60('0xb2');var _0x1a7698=0x0;var _0x26e8bc=0x0;for(var _0x4f72e2=0x0;_0x4f72e2<_0x3257ad[_0x4f60('0x54')][_0x4f60('0x2d')];_0x4f72e2++){var _0x11be1e=0x0;var _0x2312eb=0x0;var _0x30a412=0x0;var _0x1ac3d2=0x0;_0x11be1e=_0x3257ad[_0x4f60('0x54')][_0x4f72e2][_0x4f60('0xbc')]-_0x3257ad[_0x4f60('0x54')][_0x4f72e2][_0x4f60('0xbc')]/0x64*_0x3257ad[_0x4f60('0x54')][_0x4f72e2][_0x4f60('0xbd')];_0x2312eb=_0x11be1e/0x64*_0x3257ad[_0x4f60('0x54')][_0x4f72e2][_0x4f60('0xbe')];_0x30a412=_0x11be1e*_0x3257ad['details'][_0x4f72e2]['quantity'];_0x1ac3d2=_0x2312eb*_0x3257ad[_0x4f60('0x54')][_0x4f72e2]['quantity'];_0x20c678+=_0x4f60('0x87');_0x20c678+=util[_0x4f60('0x53')]('%s',_0x3257ad['details'][_0x4f72e2][_0x4f60('0xbf')]);_0x20c678+=util[_0x4f60('0x53')](_0x4f60('0xc0'),_0x3257ad[_0x4f60('0x54')][_0x4f72e2][_0x4f60('0xc1')]);_0x20c678+=util[_0x4f60('0x53')](_0x4f60('0xc2'),_0x3257ad['details'][_0x4f72e2][_0x4f60('0xc3')]);_0x20c678+=_0x4f60('0xc4')+_0x11be1e[_0x4f60('0xc5')](0x2)+_0x4f60('0xc6');_0x20c678+=_0x4f60('0xc4')+_0x30a412[_0x4f60('0xc5')](0x2)+'€';_0x20c678+=_0x4f60('0xb2');_0x1a7698+=_0x30a412;_0x26e8bc+=_0x1ac3d2;}_0x20c678+=_0x4f60('0xc7');if(!_[_0x4f60('0xc8')](_0x3257ad['invoice'][_0x4f60('0xbd')])){var _0x3b6485=0x0;var _0x5506e3=0x0;var _0x253f53=_0x3257ad[_0x4f60('0x89')][_0x4f60('0xbd')]*0x64/_0x1a7698;for(var _0x4f72e2=0x0;_0x4f72e2<_0x3257ad[_0x4f60('0x54')][_0x4f60('0x2d')];_0x4f72e2++){var _0x3f73b4=0x0;var _0x24b6ad=0x0;var _0x1bb949=0x0;_0x11be1e=_0x3257ad[_0x4f60('0x54')][_0x4f72e2][_0x4f60('0xbc')]-_0x3257ad[_0x4f60('0x54')][_0x4f72e2][_0x4f60('0xbc')]/0x64*_0x3257ad[_0x4f60('0x54')][_0x4f72e2]['discount'];_0x3f73b4=_0x11be1e/0x64*_0x253f53;_0x24b6ad=_0x11be1e-_0x3f73b4;_0x1bb949=_0x24b6ad*_0x3257ad['details'][_0x4f72e2]['quantity'];_0x3b6485+=_0x1bb949;_0x5506e3+=_0x1bb949/0x64*_0x3257ad['details'][_0x4f72e2][_0x4f60('0xbe')];}}var _0x2bc5d7=0x0;var _0x291819=0x0;var _0x1187ba=![];var _0xd15633=_0x3257ad[_0x4f60('0x89')]['receivingFiscalMessage'];if(_0xd15633[_0x4f60('0xc9')](_0x4f60('0xca'))!=-0x1){_0x1187ba=!![];}if(!_[_0x4f60('0xc8')](_0x3257ad[_0x4f60('0x89')][_0x4f60('0xbd')])){_0x20c678+='';if(_0x3257ad[_0x4f60('0x89')]['discount']>0x0){_0x20c678+=''+_0x101ae6['discount'][_0x1f097e]+'';_0x20c678+=_0x4f60('0xcb')+_0x3257ad[_0x4f60('0x89')]['discount'][_0x4f60('0xc5')](0x2)+_0x4f60('0xc6');}_0x20c678+=_0x4f60('0xb2');_0x2bc5d7=_0x5506e3;_0x291819=_0x3b6485;}else{_0x2bc5d7=_0x26e8bc;_0x291819=_0x1a7698;}if(_0x2bc5d7>0x0||_0x3257ad[_0x4f60('0x89')][_0x4f60('0xbd')]>0x0){_0x20c678+=_0x4f60('0x87');_0x20c678+=_0x4f60('0xcc')+_0x101ae6[_0x4f60('0xcd')][_0x1f097e]+_0x4f60('0x99');_0x20c678+=_0x4f60('0xc4')+_0x291819['toFixed'](0x2)+_0x4f60('0xc6');_0x20c678+=_0x4f60('0xb2');}if(_0x2bc5d7>0x0){_0x20c678+=_0x4f60('0x87');_0x20c678+=_0x4f60('0xcc')+_0x101ae6['tax'][_0x1f097e]+_0x4f60('0x99');_0x20c678+=_0x4f60('0xc4')+_0x2bc5d7[_0x4f60('0xc5')](0x2)+_0x4f60('0xc6');_0x20c678+='';}_0x20c678+=_0x4f60('0x87');var _0x1baf48;if(_0x1187ba){_0x1baf48=_0x291819;}else{_0x1baf48=_0x291819+_0x2bc5d7;}_0x20c678+=_0x4f60('0xce')+_0x101ae6[_0x4f60('0xcf')][_0x1f097e]+''+_0x1baf48[_0x4f60('0xc5')](0x2)+_0x4f60('0xc6');_0x20c678+=_0x4f60('0xd0');_0x20c678+=_0x4f60('0xb2');_0x20c678+=_0x4f60('0xd1');_0x20c678+='';_0x20c678+=_0x4f60('0x87');_0x20c678+=util[_0x4f60('0x53')](_0x4f60('0xd2'),_0x3257ad[_0x4f60('0x89')][_0x4f60('0xd3')][_0x4f60('0xd4')](new RegExp(String[_0x4f60('0xd5')](0xd),'g'),_0x4f60('0xd6')));_0x20c678+='';_0x20c678+=_0x4f60('0x87');_0x20c678+=_0x4f60('0xb3');_0x20c678+=_0x4f60('0xd7')+_0x101ae6['sendpayment'][_0x1f097e]+_0x4f60('0xd8');if(!_['isNil'](_0x3257ad['invoice']['issuerBankAccount'])){_0x20c678+=''+_0x101ae6[_0x4f60('0xd9')][_0x1f097e]+_0x4f60('0xda')+_0x3257ad[_0x4f60('0x89')]['issuerBankAccount']+_0x4f60('0xdb');_0x20c678+=_0x4f60('0xd7')+_0x101ae6[_0x4f60('0xdc')][_0x1f097e]+':\x20'+_0x3257ad['invoice'][_0x4f60('0xdd')]+_0x4f60('0xde');_0x20c678+=_0x4f60('0xd7')+_0x101ae6['bankaddress'][_0x1f097e]+_0x4f60('0xda')+_0x3257ad[_0x4f60('0x89')][_0x4f60('0xdf')]+',\x20'+_0x3257ad[_0x4f60('0x89')][_0x4f60('0xe0')]+_0x4f60('0xe1')+_0x3257ad[_0x4f60('0x89')][_0x4f60('0xe2')]+'\x20('+_0x3257ad[_0x4f60('0x89')][_0x4f60('0xe3')]+')'+_0x4f60('0xdb');_0x20c678+=_0x4f60('0xd7')+_0x101ae6[_0x4f60('0xe4')][_0x1f097e]+'/'+_0x101ae6[_0x4f60('0xe5')][_0x1f097e]+_0x4f60('0xda')+_0x3257ad[_0x4f60('0x89')][_0x4f60('0xe6')]+'/'+_0x3257ad[_0x4f60('0x89')][_0x4f60('0xe7')]+_0x4f60('0xdb');_0x20c678+=_0x4f60('0xd7')+_0x101ae6['bic'][_0x1f097e]+'/'+_0x101ae6[_0x4f60('0xe8')][_0x1f097e]+_0x4f60('0xda')+_0x3257ad['invoice'][_0x4f60('0xe9')]+_0x4f60('0xdb');_0x20c678+=''+_0x101ae6[_0x4f60('0xea')][_0x1f097e]+_0x4f60('0xda')+_0x3257ad['invoice'][_0x4f60('0xeb')]+'';}if(!_[_0x4f60('0xc8')](_0x3257ad[_0x4f60('0x89')]['issuerPayPal'])){_0x20c678+=_0x4f60('0xd7')+_0x101ae6[_0x4f60('0xec')][_0x1f097e]+_0x4f60('0xda')+_0x3257ad['invoice'][_0x4f60('0xed')]+_0x4f60('0xee');}_0x20c678+=_0x4f60('0xd7')+_0x101ae6[_0x4f60('0xef')][_0x1f097e]+_0x4f60('0xf0')+_0x4ed3c3+_0x4f60('0xf1')+_0x101ae6[_0x4f60('0xf2')][_0x1f097e]+'';_0x20c678+=_0x4f60('0x99');_0x20c678+=_0x4f60('0xb2');if(_0x3257ad[_0x4f60('0x89')]['paid']===0x1){_0x20c678+='\x20\x20saveTo,\x20fileName',_0x342fb6,_0x323876);return _0xfa40bb[_0x4f60('0xf9')](_0x342fb6,_0x323876,function(_0x4f181d){if(_0x4f181d){console['log']('err',_0x4f181d);}else{console[_0x4f60('0xf7')]('foldername',_0x12c63c);rimraf(_0x12c63c,function(){});}});}else{return _0xfa40bb[_0x4f60('0x15')](0xc8);}})['catch'](handleError(_0xfa40bb,null));};exports['getInvoicesNumberByYear']=function(_0x7dce9c,_0x551b88){var _0x1326cd=_0x7dce9c[_0x4f60('0x28')]['years'];var _0x499d7c=squel[_0x4f60('0xfa')]()['from'](_0x4f60('0xfb'))['field']('count(id)',_0x4f60('0xfc'))[_0x4f60('0x36')](_0x4f60('0xfd'),_0x4f60('0xfe'))[_0x4f60('0x36')](_0x4f60('0xff'),'invoiceMonth')[_0x4f60('0x31')](_0x4f60('0x100')+_0x1326cd+')')[_0x4f60('0x101')](_0x4f60('0xff'))[_0x4f60('0x101')]('YEAR(startDate)',![])['group'](_0x4f60('0xfd'))[_0x4f60('0x102')](_0x4f60('0xff'));return db[_0x4f60('0x43')]['query'](_0x499d7c[_0x4f60('0x103')](),{'type':db[_0x4f60('0x43')][_0x4f60('0x104')][_0x4f60('0x105')]})[_0x4f60('0x1f')](function(_0xa6ecb3){return{'count':_0xa6ecb3[_0x4f60('0x2d')],'rows':_0xa6ecb3};})[_0x4f60('0x1f')](handleEntityNotFound(_0x551b88,null))['then'](respondWithResult(_0x551b88,null))[_0x4f60('0x3e')](handleError(_0x551b88,null));};exports[_0x4f60('0x106')]=function(_0x573bbd,_0xc77a1c){var _0x426e18=_0x573bbd['query'][_0x4f60('0x107')];var _0x6499c0=squel[_0x4f60('0xfa')]()['from'](_0x4f60('0x108'),'said')[_0x4f60('0x36')](_0x573bbd[_0x4f60('0x28')][_0x4f60('0x102')]+_0x4f60('0x109'),_0x4f60('0x10a'))['field'](_0x4f60('0xfd'),_0x4f60('0x10b'))[_0x4f60('0x36')](_0x4f60('0x10c'),'monthTotal')[_0x4f60('0x4b')]('sa_invoices',_0x4f60('0x10d'),_0x4f60('0x10e'))['where'](_0x4f60('0x100')+_0x426e18+')')['order'](_0x573bbd[_0x4f60('0x28')][_0x4f60('0x102')]+_0x4f60('0x109'))[_0x4f60('0x101')](_0x573bbd['query'][_0x4f60('0x102')]+_0x4f60('0x109'),![])[_0x4f60('0x102')]('YEAR(startDate)')[_0x4f60('0x102')](_0x573bbd[_0x4f60('0x28')][_0x4f60('0x102')]+_0x4f60('0x109'));return db[_0x4f60('0x43')][_0x4f60('0x28')](_0x6499c0[_0x4f60('0x103')](),{'type':db[_0x4f60('0x43')]['QueryTypes'][_0x4f60('0x105')]})[_0x4f60('0x1f')](function(_0x2c815c){return{'count':_0x2c815c[_0x4f60('0x2d')],'rows':_0x2c815c};})['then'](handleEntityNotFound(_0xc77a1c,null))[_0x4f60('0x1f')](respondWithResult(_0xc77a1c,null))[_0x4f60('0x3e')](handleError(_0xc77a1c,null));};exports[_0x4f60('0x10f')]=function(_0x177ac1,_0x509d49){var _0x245306=squel[_0x4f60('0xfa')]()[_0x4f60('0x110')]('sa_invoices')[_0x4f60('0x36')]('distinct\x20YEAR(startDate)',_0x4f60('0x10b'))[_0x4f60('0x31')](_0x4f60('0x111'))[_0x4f60('0x101')]('YEAR(startDate)',![])['group'](_0x4f60('0xfd'));return db[_0x4f60('0x43')]['query'](_0x245306[_0x4f60('0x103')](),{'type':db['sequelize'][_0x4f60('0x104')][_0x4f60('0x105')]})[_0x4f60('0x1f')](function(_0x4a5502){return{'count':_0x4a5502[_0x4f60('0x2d')],'rows':_0x4a5502};})[_0x4f60('0x1f')](handleEntityNotFound(_0x509d49,null))[_0x4f60('0x1f')](respondWithResult(_0x509d49,null))[_0x4f60('0x3e')](handleError(_0x509d49,null));};exports[_0x4f60('0x112')]=function(_0x84e711,_0x230ba8){var _0x72ae0a=_0x84e711['query'][_0x4f60('0x113')];var _0x4a748f=_0x84e711[_0x4f60('0x28')]['dateEnd'];var _0x5336db=_0x84e711['query'][_0x4f60('0x114')];var _0x580a57=_0x84e711[_0x4f60('0x28')][_0x4f60('0x115')];var _0x244c2b=_0x84e711[_0x4f60('0x28')][_0x4f60('0x116')];var _0x5269bf=_0x84e711[_0x4f60('0x28')][_0x4f60('0x117')];var _0x4f5ef9='';var _0x4e4071='';var _0x5e3e0c='';if(_0x580a57){switch(_0x580a57){case'italy':_0x4f5ef9=_0x4f60('0x118');break;case _0x4f60('0x119'):_0x4f5ef9=_0x4f60('0x11a');}}if(_0x244c2b){_0x4e4071=_0x4f60('0x11b')+_0x244c2b;}if(_0x5269bf){_0x5e3e0c=_0x4f60('0x11c')+_0x5269bf;}var _0x27cc3e=squel['select']()['from']('sa_invoice_details',_0x4f60('0x11d'))[_0x4f60('0x36')](_0x4f60('0x11e'),_0x4f60('0x22'))['field'](_0x4f60('0x11f'),_0x4f60('0x120'))[_0x4f60('0x36')]('sum(((said.netPrice\x20-\x20(said.netPrice\x20/\x20100\x20*\x20said.discount))\x20*\x20said.quantity))\x20-\x20coalesce(sai.discount,0)',_0x4f60('0xcd'))[_0x4f60('0x36')](_0x4f60('0x121'),_0x4f60('0x122'))['field']('com.CmCompanyId',_0x4f60('0x123'))[_0x4f60('0x36')](_0x4f60('0x124'),_0x4f60('0x125'))[_0x4f60('0x36')]('relCom.name',_0x4f60('0x126'))[_0x4f60('0x19')](_0x5336db)[_0x4f60('0x18')](0x0)['join'](_0x4f60('0xfb'),'sai','sai.id\x20=\x20said.InvoiceId')[_0x4f60('0x4b')](_0x4f60('0x127'),_0x4f60('0x128'),_0x4f60('0x129'))[_0x4f60('0x12a')](_0x4f60('0x12b'),_0x4f60('0x12c'),_0x4f60('0x12d'))['left_join'](_0x4f60('0x127'),_0x4f60('0x12e'),_0x4f60('0x12f'))[_0x4f60('0x31')](_0x4f60('0x130'),_0x72ae0a)['where'](_0x4f60('0x131'),_0x4a748f)['where'](_0x4f5ef9)[_0x4f60('0x31')](_0x4e4071)[_0x4f60('0x31')](_0x5e3e0c)[_0x4f60('0x101')](_0x4f60('0x132'),![])[_0x4f60('0x102')](_0x4f60('0x11e'))[_0x4f60('0x102')](_0x4f60('0x11f'))[_0x4f60('0x102')]('com.saCompanyRelationship')['group'](_0x4f60('0x133'))[_0x4f60('0x102')]('rel.name')['group']('relCom.name')[_0x4f60('0x102')](_0x4f60('0x134'))['group'](_0x4f60('0x135'));console['log'](_0x4f60('0x136'),_0x27cc3e['toString']());return db['sequelize'][_0x4f60('0x28')](_0x27cc3e[_0x4f60('0x103')](),{'type':db[_0x4f60('0x43')][_0x4f60('0x104')][_0x4f60('0x105')]})['then'](function(_0x20e07c){return{'count':_0x20e07c[_0x4f60('0x2d')],'rows':_0x20e07c};})['then'](handleEntityNotFound(_0x230ba8,null))[_0x4f60('0x1f')](respondWithResult(_0x230ba8,null))[_0x4f60('0x3e')](handleError(_0x230ba8,null));};function addInvoiceCreditnoteDetail(_0xac20e2,_0x24412f,_0x12df76){console['log'](_0x4f60('0x137'),_0xac20e2);var _0x20f707={'companyName':_0xac20e2[_0x4f60('0x9c')],'companyId':_0xac20e2[_0x4f60('0x138')],'productName':_0xac20e2[_0x4f60('0xbf')],'productCode':_0xac20e2[_0x4f60('0x139')],'productDescription':_0xac20e2[_0x4f60('0xc1')],'typeName':_0xac20e2['typeName'],'pricelistName':_0xac20e2['pricelistName'],'priceListId':_0xac20e2['priceListId'],'netPrice':_0xac20e2[_0x4f60('0xbc')],'discount':_0xac20e2[_0x4f60('0xbd')],'tax':_0xac20e2[_0x4f60('0xbe')],'agentFullname':_0xac20e2['agentFullname'],'note':_0xac20e2['note'],'subscriptionId':_0xac20e2[_0x4f60('0x13a')],'subscriptionName':_0xac20e2[_0x4f60('0x13b')],'subscriptionMonthly':_0xac20e2[_0x4f60('0x13c')],'quantity':_0xac20e2[_0x4f60('0xc3')],'CreditNoteId':_0x24412f,'unitName':_0xac20e2['unitName']};return db[_0x4f60('0x13d')][_0x4f60('0x42')](_0x20f707,{'transaction':_0x12df76});}exports[_0x4f60('0x13e')]=function(_0xe38a31,_0x2112a3,_0x1ee239){var _0x35f5b8;if(_0xe38a31[_0x4f60('0x48')]['id']){delete _0xe38a31[_0x4f60('0x48')]['id'];}console['log'](_0xe38a31);return db['sequelize'][_0x4f60('0x44')](function(_0xdb5852){return db['SACreditNote'][_0x4f60('0x42')](_0xe38a31['body'],{'transaction':_0xdb5852})[_0x4f60('0x1f')](function(_0x400479){_0x35f5b8=_0x400479;var _0x598ed3=_0xe38a31['params']['id'];return db[_0x4f60('0x13f')][_0x4f60('0x3c')]({'where':{'InvoiceId':_0x598ed3},'raw':!![],'logging':console['log']});})[_0x4f60('0x1f')](function(_0x40c9dc){if(_0x40c9dc[_0x4f60('0x2d')]>0x0){var _0x1a6c9a=[];for(var _0x25322e=0x0;_0x25322e<_0x40c9dc[_0x4f60('0x2d')];_0x25322e++){_0x1a6c9a[_0x4f60('0x140')](addInvoiceCreditnoteDetail(_0x40c9dc[_0x25322e],_0x35f5b8['id'],_0xdb5852));}return BPromise[_0x4f60('0x141')](_0x1a6c9a);}else{var _0x165dfb={'errors':[{'type':'WARNING','message':_0x4f60('0x142')}]};throw _0x165dfb;}});})[_0x4f60('0x1f')](function(){return _0x2112a3[_0x4f60('0x15')](0xc8);})['catch'](function(_0x2ef40e){console['log'](_0x4f60('0x143'),_0x2ef40e);if(_0x2ef40e[_0x4f60('0x22')]==='SequelizeUniqueConstraintError'){var _0x2ef40e={'errors':[{'message':_0x4f60('0x144')}]};}_0x2112a3[_0x4f60('0x16')](0x1f4)['send'](_0x2ef40e);});}; \ No newline at end of file diff --git a/server/api/saInvoice/saInvoice.model.js b/server/api/saInvoice/saInvoice.model.js index 8144a36..dbd8061 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 _0xd67b=['findOne','transaction','then','number','update','create','log','TCL:\x20error','util','api','moment','bluebird','path','../../config/environment','exports','define','SAInvoice','sa_invoices','models','get','format','has','SAInvoiceNumber'];(function(_0x1a4eef,_0x1a2ed3){var _0x1d7082=function(_0x22d2cf){while(--_0x22d2cf){_0x1a4eef['push'](_0x1a4eef['shift']());}};_0x1d7082(++_0x1a2ed3);}(_0xd67b,0x133));var _0xbd67=function(_0x22510b,_0x1dbc40){_0x22510b=_0x22510b-0x0;var _0x52003c=_0xd67b[_0x22510b];return _0x52003c;};'use strict';var _=require('lodash');var util=require(_0xbd67('0x0'));var logger=require('../../config/logger')(_0xbd67('0x1'));var moment=require(_0xbd67('0x2'));var BPromise=require(_0xbd67('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd67('0x4'));var rimraf=require('rimraf');var config=require(_0xbd67('0x5'));var attributes=require('./saInvoice.attributes');module[_0xbd67('0x6')]=function(_0xa5c384,_0x2ad142){return _0xa5c384[_0xbd67('0x7')](_0xbd67('0x8'),attributes,{'tableName':_0xbd67('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2d4af6,_0xfad775,_0x1da7f1){var _0x461231=_0xa5c384[_0xbd67('0xa')];var _0x3a7f43=_0x2d4af6[_0xbd67('0xb')]({'plain':!![]});var _0x52b981=0x1;var _0x54954b=parseInt(moment()[_0xbd67('0xc')]('YYYY'));try{if(_[_0xbd67('0xd')](_0x3a7f43,'id')){return _0x461231[_0xbd67('0xe')][_0xbd67('0xf')]({'where':{'year':_0x54954b},'raw':!![],'logging':!![],'transaction':_0xfad775[_0xbd67('0x10')]})[_0xbd67('0x11')](function(_0xb05237){if(_0xb05237){_0x52b981=_0xb05237[_0xbd67('0x12')]+0x1;return _0x461231[_0xbd67('0xe')][_0xbd67('0x13')]({'number':_0x52b981},{'where':{'id':_0xb05237['id']},'transaction':_0xfad775[_0xbd67('0x10')],'logging':!![]});}return _0x461231['SAInvoiceNumber'][_0xbd67('0x14')]({'year':_0x54954b,'number':_0x52b981},{'logging':!![],'transaction':_0xfad775[_0xbd67('0x10')]});})[_0xbd67('0x11')](function(){_0x3a7f43[_0xbd67('0x12')]=_0x52b981;})[_0xbd67('0x11')](function(){_0x1da7f1();});}}catch(_0x23b626){console[_0xbd67('0x15')](_0xbd67('0x16'),_0x23b626);_0x1da7f1();}}}});}; \ No newline at end of file +var _0x6c7b=['update','create','TCL:\x20error','lodash','moment','request-promise','path','rimraf','./saInvoice.attributes','exports','define','sa_invoices','models','get','format','YYYY','has','SAInvoiceNumber','findOne','transaction','then','number'];(function(_0x133da4,_0x48bf52){var _0x5dd93c=function(_0x45654b){while(--_0x45654b){_0x133da4['push'](_0x133da4['shift']());}};_0x5dd93c(++_0x48bf52);}(_0x6c7b,0x10b));var _0xb6c7=function(_0x29821c,_0xffe3b9){_0x29821c=_0x29821c-0x0;var _0x228a83=_0x6c7b[_0x29821c];return _0x228a83;};'use strict';var _=require(_0xb6c7('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xb6c7('0x1'));var BPromise=require('bluebird');var rp=require(_0xb6c7('0x2'));var fs=require('fs');var path=require(_0xb6c7('0x3'));var rimraf=require(_0xb6c7('0x4'));var config=require('../../config/environment');var attributes=require(_0xb6c7('0x5'));module[_0xb6c7('0x6')]=function(_0xfe3eb9,_0x219abc){return _0xfe3eb9[_0xb6c7('0x7')]('SAInvoice',attributes,{'tableName':_0xb6c7('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x41a5a5,_0xe2ce08,_0x9c88ae){var _0x577c54=_0xfe3eb9[_0xb6c7('0x9')];var _0x245016=_0x41a5a5[_0xb6c7('0xa')]({'plain':!![]});var _0x594dbb=0x1;var _0x5cff81=parseInt(moment()[_0xb6c7('0xb')](_0xb6c7('0xc')));try{if(_[_0xb6c7('0xd')](_0x245016,'id')){return _0x577c54[_0xb6c7('0xe')][_0xb6c7('0xf')]({'where':{'year':_0x5cff81},'raw':!![],'logging':!![],'transaction':_0xe2ce08[_0xb6c7('0x10')]})[_0xb6c7('0x11')](function(_0x50c2de){if(_0x50c2de){_0x594dbb=_0x50c2de[_0xb6c7('0x12')]+0x1;return _0x577c54[_0xb6c7('0xe')][_0xb6c7('0x13')]({'number':_0x594dbb},{'where':{'id':_0x50c2de['id']},'transaction':_0xe2ce08[_0xb6c7('0x10')],'logging':!![]});}return _0x577c54[_0xb6c7('0xe')][_0xb6c7('0x14')]({'year':_0x5cff81,'number':_0x594dbb},{'logging':!![],'transaction':_0xe2ce08[_0xb6c7('0x10')]});})['then'](function(){_0x245016[_0xb6c7('0x12')]=_0x594dbb;})['then'](function(){_0x9c88ae();});}}catch(_0x480d9a){console['log'](_0xb6c7('0x15'),_0x480d9a);_0x9c88ae();}}}});}; \ No newline at end of file diff --git a/server/api/saInvoice/saInvoice.rpc.js b/server/api/saInvoice/saInvoice.rpc.js index 75d0982..ae6f0c1 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 _0xd106=['code','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SAInvoice,\x20%s,\x20%s','request\x20sent','debug','SAInvoice,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1b3500,_0x5e0435){var _0x52a279=function(_0x4500ae){while(--_0x4500ae){_0x1b3500['push'](_0x1b3500['shift']());}};_0x52a279(++_0x5e0435);}(_0xd106,0x1e6));var _0x6d10=function(_0x105459,_0x427307){_0x105459=_0x105459-0x0;var _0x2b8456=_0xd106[_0x105459];return _0x2b8456;};'use strict';var _=require(_0x6d10('0x0'));var util=require('util');var moment=require(_0x6d10('0x1'));var BPromise=require('bluebird');var rs=require(_0x6d10('0x2'));var fs=require('fs');var Redis=require(_0x6d10('0x3'));var db=require(_0x6d10('0x4'))['db'];var utils=require(_0x6d10('0x5'));var logger=require(_0x6d10('0x6'))(_0x6d10('0x7'));var config=require(_0x6d10('0x8'));var jayson=require(_0x6d10('0x9'));var client=jayson[_0x6d10('0xa')][_0x6d10('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4164f2,_0x359689,_0x59d884){return new BPromise(function(_0x34a0b8,_0x1fb1fe){return client[_0x6d10('0xc')](_0x4164f2,_0x59d884)[_0x6d10('0xd')](function(_0x4d51d8){logger['info'](_0x6d10('0xe'),_0x359689,_0x6d10('0xf'));logger[_0x6d10('0x10')](_0x6d10('0x11'),_0x359689,_0x6d10('0xf'),JSON[_0x6d10('0x12')](_0x4d51d8));if(_0x4d51d8[_0x6d10('0x13')]){if(_0x4d51d8[_0x6d10('0x13')][_0x6d10('0x14')]===0x1f4){logger[_0x6d10('0x13')](_0x6d10('0xe'),_0x359689,_0x4d51d8[_0x6d10('0x13')][_0x6d10('0x15')]);return _0x1fb1fe(_0x4d51d8[_0x6d10('0x13')][_0x6d10('0x15')]);}logger[_0x6d10('0x13')]('SAInvoice,\x20%s,\x20%s',_0x359689,_0x4d51d8['error'][_0x6d10('0x15')]);return _0x34a0b8(_0x4d51d8[_0x6d10('0x13')][_0x6d10('0x15')]);}else{logger['info']('SAInvoice,\x20%s,\x20%s',_0x359689,_0x6d10('0xf'));_0x34a0b8(_0x4d51d8[_0x6d10('0x16')][_0x6d10('0x15')]);}})['catch'](function(_0x45a562){logger[_0x6d10('0x13')](_0x6d10('0xe'),_0x359689,_0x45a562);_0x1fb1fe(_0x45a562);});});} \ No newline at end of file +var _0xbabf=['code','message','SAInvoice,\x20%s,\x20%s','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','request','then','info','debug','stringify','error'];(function(_0x1afda3,_0xf74e14){var _0x454b7c=function(_0xf42f9c){while(--_0xf42f9c){_0x1afda3['push'](_0x1afda3['shift']());}};_0x454b7c(++_0xf74e14);}(_0xbabf,0x1b5));var _0xfbab=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0xbabf[_0x17928f];return _0x500b63;};'use strict';var _=require(_0xfbab('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xfbab('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfbab('0x2'));var db=require(_0xfbab('0x3'))['db'];var utils=require(_0xfbab('0x4'));var logger=require(_0xfbab('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xfbab('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x577006,_0x4d61e1,_0x448723){return new BPromise(function(_0x4d10bc,_0x590af0){return client[_0xfbab('0x7')](_0x577006,_0x448723)[_0xfbab('0x8')](function(_0x38d525){logger[_0xfbab('0x9')]('SAInvoice,\x20%s,\x20%s',_0x4d61e1,'request\x20sent');logger[_0xfbab('0xa')]('SAInvoice,\x20%s,\x20%s,\x20%s',_0x4d61e1,'request\x20sent',JSON[_0xfbab('0xb')](_0x38d525));if(_0x38d525[_0xfbab('0xc')]){if(_0x38d525[_0xfbab('0xc')][_0xfbab('0xd')]===0x1f4){logger[_0xfbab('0xc')]('SAInvoice,\x20%s,\x20%s',_0x4d61e1,_0x38d525[_0xfbab('0xc')]['message']);return _0x590af0(_0x38d525[_0xfbab('0xc')][_0xfbab('0xe')]);}logger['error'](_0xfbab('0xf'),_0x4d61e1,_0x38d525[_0xfbab('0xc')]['message']);return _0x4d10bc(_0x38d525[_0xfbab('0xc')]['message']);}else{logger[_0xfbab('0x9')](_0xfbab('0xf'),_0x4d61e1,'request\x20sent');_0x4d10bc(_0x38d525[_0xfbab('0x10')][_0xfbab('0xe')]);}})[_0xfbab('0x11')](function(_0x58530d){logger[_0xfbab('0xc')](_0xfbab('0xf'),_0x4d61e1,_0x58530d);_0x590af0(_0x58530d);});});} \ No newline at end of file diff --git a/server/api/saInvoiceDetail/index.js b/server/api/saInvoiceDetail/index.js index 4893ab1..0cd9161 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 _0x95c8=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./saInvoiceDetail.controller','get','isAuthenticated','index','show','post','put','/:id','delete','destroy','path'];(function(_0x4e5b23,_0x5b1781){var _0x580b34=function(_0x18b1bf){while(--_0x18b1bf){_0x4e5b23['push'](_0x4e5b23['shift']());}};_0x580b34(++_0x5b1781);}(_0x95c8,0xaf));var _0x895c=function(_0x482868,_0x2904ab){_0x482868=_0x482868-0x0;var _0x1adfae=_0x95c8[_0x482868];return _0x1adfae;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x895c('0x0'));var timeout=require(_0x895c('0x1'));var express=require(_0x895c('0x2'));var router=express['Router']();var auth=require(_0x895c('0x3'));var interaction=require(_0x895c('0x4'));var config=require(_0x895c('0x5'));var controller=require(_0x895c('0x6'));router[_0x895c('0x7')]('/',auth[_0x895c('0x8')](),controller[_0x895c('0x9')]);router[_0x895c('0x7')]('/describe',auth[_0x895c('0x8')](),controller['describe']);router[_0x895c('0x7')]('/:id',auth[_0x895c('0x8')](),controller[_0x895c('0xa')]);router[_0x895c('0xb')]('/',auth[_0x895c('0x8')](),controller['create']);router[_0x895c('0xc')](_0x895c('0xd'),auth[_0x895c('0x8')](),controller['update']);router[_0x895c('0xe')]('/:id',auth[_0x895c('0x8')](),controller[_0x895c('0xf')]);module['exports']=router; \ No newline at end of file +var _0x1740=['util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./saInvoiceDetail.controller','isAuthenticated','index','get','/describe','show','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x146cbe,_0x43a5d9){var _0x5556bc=function(_0x3edecd){while(--_0x3edecd){_0x146cbe['push'](_0x146cbe['shift']());}};_0x5556bc(++_0x43a5d9);}(_0x1740,0x68));var _0x0174=function(_0x4e80a4,_0x2aa992){_0x4e80a4=_0x4e80a4-0x0;var _0x2c1290=_0x1740[_0x4e80a4];return _0x2c1290;};'use strict';var multer=require(_0x0174('0x0'));var util=require(_0x0174('0x1'));var path=require(_0x0174('0x2'));var timeout=require(_0x0174('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x0174('0x4'));var interaction=require(_0x0174('0x5'));var config=require(_0x0174('0x6'));var controller=require(_0x0174('0x7'));router['get']('/',auth[_0x0174('0x8')](),controller[_0x0174('0x9')]);router[_0x0174('0xa')](_0x0174('0xb'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x0174('0x8')](),controller[_0x0174('0xc')]);router[_0x0174('0xd')]('/',auth[_0x0174('0x8')](),controller[_0x0174('0xe')]);router[_0x0174('0xf')](_0x0174('0x10'),auth['isAuthenticated'](),controller[_0x0174('0x11')]);router[_0x0174('0x12')](_0x0174('0x10'),auth[_0x0174('0x8')](),controller[_0x0174('0x13')]);module[_0x0174('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 02eb1e6..f08200a 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 _0xecf4=['STRING','INTEGER','TEXT','long','\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci','DECIMAL','sequelize'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xecf4,0x8b));var _0x4ecf=function(_0x2c3255,_0x4e00ae){_0x2c3255=_0x2c3255-0x0;var _0x282aba=_0xecf4[_0x2c3255];return _0x282aba;};'use strict';var Sequelize=require(_0x4ecf('0x0'));module['exports']={'companyName':{'type':Sequelize[_0x4ecf('0x1')],'allowNull':![]},'companyId':{'type':Sequelize[_0x4ecf('0x2')],'allowNull':![]},'productName':{'type':Sequelize[_0x4ecf('0x3')],'allowNull':![]},'productCode':{'type':Sequelize[_0x4ecf('0x1')],'allowNull':![]},'productDescription':{'type':Sequelize['TEXT'](_0x4ecf('0x4'))+_0x4ecf('0x5')},'typeName':{'type':Sequelize[_0x4ecf('0x1')],'allowNull':![]},'unitName':{'type':Sequelize[_0x4ecf('0x1')]},'pricelistName':{'type':Sequelize['TEXT'],'allowNull':![]},'priceListId':{'type':Sequelize[_0x4ecf('0x2')],'allowNull':![]},'netPrice':{'type':Sequelize[_0x4ecf('0x6')](0xd,0x4),'allowNull':![]},'discount':{'type':Sequelize['DECIMAL'](0x6,0x3),'allowNull':![]},'tax':{'type':Sequelize[_0x4ecf('0x6')](0xd,0x4),'allowNull':![]},'agentFullname':{'type':Sequelize[_0x4ecf('0x1')],'allowNull':![]},'note':{'type':Sequelize['TEXT']},'subscriptionId':{'type':Sequelize[_0x4ecf('0x2')],'allowNull':![]},'subscriptionName':{'type':Sequelize[_0x4ecf('0x1')],'allowNull':![]},'subscriptionMonthly':{'type':Sequelize[_0x4ecf('0x2')],'allowNull':![]},'quantity':{'type':Sequelize['DECIMAL'](0xd,0x4),'allowNull':![]},'ProductQuotationId':{'type':Sequelize[_0x4ecf('0x2')]}}; \ No newline at end of file +var _0xa831=['TEXT','long','\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci','DECIMAL','sequelize','exports','STRING','INTEGER'];(function(_0x2924d3,_0x58be5c){var _0x109f35=function(_0x391569){while(--_0x391569){_0x2924d3['push'](_0x2924d3['shift']());}};_0x109f35(++_0x58be5c);}(_0xa831,0xbc));var _0x1a83=function(_0x5b3b9b,_0x1c71b0){_0x5b3b9b=_0x5b3b9b-0x0;var _0x47c1d7=_0xa831[_0x5b3b9b];return _0x47c1d7;};'use strict';var Sequelize=require(_0x1a83('0x0'));module[_0x1a83('0x1')]={'companyName':{'type':Sequelize[_0x1a83('0x2')],'allowNull':![]},'companyId':{'type':Sequelize[_0x1a83('0x3')],'allowNull':![]},'productName':{'type':Sequelize[_0x1a83('0x4')],'allowNull':![]},'productCode':{'type':Sequelize[_0x1a83('0x2')],'allowNull':![]},'productDescription':{'type':Sequelize[_0x1a83('0x4')](_0x1a83('0x5'))+_0x1a83('0x6')},'typeName':{'type':Sequelize['STRING'],'allowNull':![]},'unitName':{'type':Sequelize['STRING']},'pricelistName':{'type':Sequelize['TEXT'],'allowNull':![]},'priceListId':{'type':Sequelize['INTEGER'],'allowNull':![]},'netPrice':{'type':Sequelize[_0x1a83('0x7')](0xd,0x4),'allowNull':![]},'discount':{'type':Sequelize[_0x1a83('0x7')](0x6,0x3),'allowNull':![]},'tax':{'type':Sequelize[_0x1a83('0x7')](0xd,0x4),'allowNull':![]},'agentFullname':{'type':Sequelize[_0x1a83('0x2')],'allowNull':![]},'note':{'type':Sequelize['TEXT']},'subscriptionId':{'type':Sequelize[_0x1a83('0x3')],'allowNull':![]},'subscriptionName':{'type':Sequelize['STRING'],'allowNull':![]},'subscriptionMonthly':{'type':Sequelize[_0x1a83('0x3')],'allowNull':![]},'quantity':{'type':Sequelize[_0x1a83('0x7')](0xd,0x4),'allowNull':![]},'ProductQuotationId':{'type':Sequelize[_0x1a83('0x3')]}}; \ No newline at end of file diff --git a/server/api/saInvoiceDetail/saInvoiceDetail.controller.js b/server/api/saInvoiceDetail/saInvoiceDetail.controller.js index 3e2b5dc..7520c14 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 _0xd8c4=['SAInvoiceDetail','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','map','type','key','VIRTUAL','field','filter','options','count','includeAll','findAll','rows','catch','show','params','include','find','create','body','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','then','destroy','stack','name','send'];(function(_0x4e1d18,_0x5e2f55){var _0x540ce2=function(_0x307e31){while(--_0x307e31){_0x4e1d18['push'](_0x4e1d18['shift']());}};_0x540ce2(++_0x5e2f55);}(_0xd8c4,0x194));var _0x4d8c=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0xd8c4[_0x2e4aa2];return _0x5e6092;};'use strict';var pdf=require(_0x4d8c('0x0'));var emlformat=require(_0x4d8c('0x1'));var rimraf=require(_0x4d8c('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4d8c('0x3'));var moment=require(_0x4d8c('0x4'));var BPromise=require(_0x4d8c('0x5'));var Mustache=require(_0x4d8c('0x6'));var util=require(_0x4d8c('0x7'));var path=require(_0x4d8c('0x8'));var sox=require('sox');var csv=require(_0x4d8c('0x9'));var ejs=require(_0x4d8c('0xa'));var fs=require('fs');var _=require(_0x4d8c('0xb'));var squel=require('squel');var crypto=require(_0x4d8c('0xc'));var jsforce=require(_0x4d8c('0xd'));var deskjs=require(_0x4d8c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4d8c('0xf'));var Papa=require(_0x4d8c('0x10'));var Redis=require(_0x4d8c('0x11'));var authService=require(_0x4d8c('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x4d8c('0x13'));var logger=require(_0x4d8c('0x14'))('api');var utils=require(_0x4d8c('0x15'));var config=require(_0x4d8c('0x16'));var db=require(_0x4d8c('0x17'))['db'];function respondWithStatusCode(_0x2b8f77,_0x16ccaa){_0x16ccaa=_0x16ccaa||0xcc;return function(_0x207df){if(_0x207df){return _0x2b8f77[_0x4d8c('0x18')](_0x16ccaa);}return _0x2b8f77[_0x4d8c('0x19')](_0x16ccaa)[_0x4d8c('0x1a')]();};}function respondWithResult(_0x597444,_0x295b74){_0x295b74=_0x295b74||0xc8;return function(_0x174c79){if(_0x174c79){return _0x597444[_0x4d8c('0x19')](_0x295b74)[_0x4d8c('0x1b')](_0x174c79);}};}function respondWithFilteredResult(_0x33a6d2,_0x4cecf8){return function(_0x33eb9e){if(_0x33eb9e){var _0xec3e52=_0x33eb9e['count'],_0x379c8a=_0x4cecf8[_0x4d8c('0x1c')],_0x111692=_0x4cecf8[_0x4d8c('0x1c')]+_0x4cecf8[_0x4d8c('0x1d')],_0x901e24;if(_0x111692>=_0xec3e52){_0x111692=_0xec3e52;_0x901e24=0xc8;}else{_0x901e24=0xce;}_0x33a6d2[_0x4d8c('0x19')](_0x901e24);return _0x33a6d2[_0x4d8c('0x1e')](_0x4d8c('0x1f'),_0x379c8a+'-'+_0x111692+'/'+_0xec3e52)[_0x4d8c('0x1b')](_0x33eb9e);}return null;};}function patchUpdates(_0x11457a){return function(_0x1c6fe4){try{jsonpatch[_0x4d8c('0x20')](_0x1c6fe4,_0x11457a,!![]);}catch(_0x168737){return BPromise[_0x4d8c('0x21')](_0x168737);}return _0x1c6fe4[_0x4d8c('0x22')]();};}function saveUpdates(_0x2a261b,_0x45dc2a){return function(_0x16c431){if(_0x16c431){return _0x16c431['update'](_0x2a261b)[_0x4d8c('0x23')](function(_0x4fe055){return _0x4fe055;});}return null;};}function removeEntity(_0x3cc59c,_0x47dedf){return function(_0x288d9b){if(_0x288d9b){return _0x288d9b[_0x4d8c('0x24')]()[_0x4d8c('0x23')](function(){_0x3cc59c['status'](0xcc)[_0x4d8c('0x1a')]();});}};}function handleEntityNotFound(_0x14a5ef,_0x352ebd){return function(_0x50baac){if(!_0x50baac){_0x14a5ef['sendStatus'](0x194);}return _0x50baac;};}function handleError(_0x3d80fc,_0x25ac52){_0x25ac52=_0x25ac52||0x1f4;return function(_0x10bae1){logger['error'](_0x10bae1[_0x4d8c('0x25')]);if(_0x10bae1[_0x4d8c('0x26')]){delete _0x10bae1[_0x4d8c('0x26')];}_0x3d80fc[_0x4d8c('0x19')](_0x25ac52)[_0x4d8c('0x27')](_0x10bae1);};}exports['index']=function(_0x175e17,_0x5cd2b6){var _0x15a058={},_0x5a9a7b={},_0x242a7f={'count':0x0,'rows':[]};var _0x549031=db[_0x4d8c('0x28')][_0x4d8c('0x29')];_0x5a9a7b[_0x4d8c('0x2a')]=_['keys'](_0x549031);_0x5a9a7b['query']=_[_0x4d8c('0x2b')](_0x175e17[_0x4d8c('0x2c')]);_0x5a9a7b['filters']=_[_0x4d8c('0x2d')](_0x5a9a7b[_0x4d8c('0x2a')],_0x5a9a7b['query']);_0x15a058[_0x4d8c('0x2e')]=_['intersection'](_0x5a9a7b[_0x4d8c('0x2a')],qs['fields'](_0x175e17[_0x4d8c('0x2c')][_0x4d8c('0x2f')]));_0x15a058['attributes']=_0x15a058['attributes'][_0x4d8c('0x30')]?_0x15a058[_0x4d8c('0x2e')]:_0x5a9a7b[_0x4d8c('0x2a')];if(!_0x175e17[_0x4d8c('0x2c')][_0x4d8c('0x31')](_0x4d8c('0x32'))){_0x15a058[_0x4d8c('0x1d')]=qs[_0x4d8c('0x1d')](_0x175e17['query'][_0x4d8c('0x1d')]);_0x15a058[_0x4d8c('0x1c')]=qs['offset'](_0x175e17['query']['offset']);}_0x15a058['order']=qs[_0x4d8c('0x33')](_0x175e17[_0x4d8c('0x2c')]['sort']);_0x15a058[_0x4d8c('0x34')]=qs[_0x4d8c('0x35')](_[_0x4d8c('0x36')](_0x175e17[_0x4d8c('0x2c')],_0x5a9a7b[_0x4d8c('0x35')]));if(_0x175e17[_0x4d8c('0x2c')]['filter']){_0x15a058[_0x4d8c('0x34')]=_[_0x4d8c('0x37')](_0x15a058[_0x4d8c('0x34')],{'$or':_[_0x4d8c('0x38')](_0x549031,function(_0x15dae5){if(_0x15dae5[_0x4d8c('0x39')][_0x4d8c('0x3a')]!==_0x4d8c('0x3b')){var _0x13a00f={};_0x13a00f[_0x15dae5[_0x4d8c('0x3c')]]={'$like':'%'+_0x175e17[_0x4d8c('0x2c')][_0x4d8c('0x3d')]+'%'};return _0x13a00f;}})});}_0x15a058=_[_0x4d8c('0x37')]({},_0x15a058,_0x175e17[_0x4d8c('0x3e')]);var _0x5cc27f={'where':_0x15a058[_0x4d8c('0x34')]};return db['SAInvoiceDetail'][_0x4d8c('0x3f')](_0x5cc27f)[_0x4d8c('0x23')](function(_0x5afac8){_0x242a7f[_0x4d8c('0x3f')]=_0x5afac8;if(_0x175e17[_0x4d8c('0x2c')][_0x4d8c('0x40')]){_0x15a058['include']=[{'all':!![]}];}return db[_0x4d8c('0x28')][_0x4d8c('0x41')](_0x15a058);})[_0x4d8c('0x23')](function(_0x293751){_0x242a7f[_0x4d8c('0x42')]=_0x293751;return _0x242a7f;})[_0x4d8c('0x23')](respondWithFilteredResult(_0x5cd2b6,_0x15a058))[_0x4d8c('0x43')](handleError(_0x5cd2b6,null));};exports[_0x4d8c('0x44')]=function(_0x337656,_0x1ef9dd){var _0xaeed31={'raw':![],'where':{'id':_0x337656[_0x4d8c('0x45')]['id']}},_0x4f431e={};_0x4f431e[_0x4d8c('0x2a')]=_[_0x4d8c('0x2b')](db[_0x4d8c('0x28')]['rawAttributes']);_0x4f431e[_0x4d8c('0x2c')]=_[_0x4d8c('0x2b')](_0x337656[_0x4d8c('0x2c')]);_0x4f431e[_0x4d8c('0x35')]=_[_0x4d8c('0x2d')](_0x4f431e[_0x4d8c('0x2a')],_0x4f431e[_0x4d8c('0x2c')]);_0xaeed31['attributes']=_[_0x4d8c('0x2d')](_0x4f431e[_0x4d8c('0x2a')],qs['fields'](_0x337656[_0x4d8c('0x2c')][_0x4d8c('0x2f')]));_0xaeed31[_0x4d8c('0x2e')]=_0xaeed31[_0x4d8c('0x2e')][_0x4d8c('0x30')]?_0xaeed31[_0x4d8c('0x2e')]:_0x4f431e['model'];if(_0x337656[_0x4d8c('0x2c')][_0x4d8c('0x40')]){_0xaeed31[_0x4d8c('0x46')]=[{'all':!![]}];}_0xaeed31=_['merge']({},_0xaeed31,_0x337656[_0x4d8c('0x3e')]);return db['SAInvoiceDetail'][_0x4d8c('0x47')](_0xaeed31)[_0x4d8c('0x23')](handleEntityNotFound(_0x1ef9dd,null))[_0x4d8c('0x23')](respondWithResult(_0x1ef9dd,null))[_0x4d8c('0x43')](handleError(_0x1ef9dd,null));};exports[_0x4d8c('0x48')]=function(_0x15ae5e,_0x83930d){return db[_0x4d8c('0x28')][_0x4d8c('0x48')](_0x15ae5e[_0x4d8c('0x49')],{})[_0x4d8c('0x23')](respondWithResult(_0x83930d,0xc9))['catch'](handleError(_0x83930d,null));};exports['update']=function(_0x35b48c,_0x24c2b9){if(_0x35b48c['body']['id']){delete _0x35b48c[_0x4d8c('0x49')]['id'];}return db['SAInvoiceDetail'][_0x4d8c('0x47')]({'where':{'id':_0x35b48c[_0x4d8c('0x45')]['id']}})['then'](handleEntityNotFound(_0x24c2b9,null))[_0x4d8c('0x23')](saveUpdates(_0x35b48c[_0x4d8c('0x49')],null))[_0x4d8c('0x23')](respondWithResult(_0x24c2b9,null))[_0x4d8c('0x43')](handleError(_0x24c2b9,null));};exports[_0x4d8c('0x24')]=function(_0xf041fd,_0x359626){return db[_0x4d8c('0x28')]['find']({'where':{'id':_0xf041fd['params']['id']}})[_0x4d8c('0x23')](handleEntityNotFound(_0x359626,null))['then'](removeEntity(_0x359626,null))[_0x4d8c('0x43')](handleError(_0x359626,null));};exports['describe']=function(_0x8cc816,_0x145d5f){return db[_0x4d8c('0x28')]['describe']()[_0x4d8c('0x23')](respondWithResult(_0x145d5f,null))[_0x4d8c('0x43')](handleError(_0x145d5f,null));}; \ No newline at end of file +var _0x49bd=['sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','destroy','then','error','name','send','index','SAInvoiceDetail','rawAttributes','model','keys','query','filters','attributes','intersection','length','hasOwnProperty','nolimit','limit','sort','filter','where','merge','map','type','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','params','fields','create','body','find','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','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','../../mysqldb'];(function(_0xbb7eef,_0x5c7b31){var _0x18514a=function(_0x5037ea){while(--_0x5037ea){_0xbb7eef['push'](_0xbb7eef['shift']());}};_0x18514a(++_0x5c7b31);}(_0x49bd,0xc3));var _0xd49b=function(_0x2701be,_0x40b3c3){_0x2701be=_0x2701be-0x0;var _0xb44568=_0x49bd[_0x2701be];return _0xb44568;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xd49b('0x0'));var zipdir=require(_0xd49b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd49b('0x2'));var moment=require(_0xd49b('0x3'));var BPromise=require(_0xd49b('0x4'));var Mustache=require(_0xd49b('0x5'));var util=require(_0xd49b('0x6'));var path=require('path');var sox=require(_0xd49b('0x7'));var csv=require(_0xd49b('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd49b('0x9'));var squel=require(_0xd49b('0xa'));var crypto=require(_0xd49b('0xb'));var jsforce=require(_0xd49b('0xc'));var deskjs=require(_0xd49b('0xd'));var toCsv=require(_0xd49b('0x8'));var querystring=require(_0xd49b('0xe'));var Papa=require(_0xd49b('0xf'));var Redis=require('ioredis');var authService=require(_0xd49b('0x10'));var qs=require(_0xd49b('0x11'));var hardwareService=require(_0xd49b('0x12'));var logger=require(_0xd49b('0x13'))(_0xd49b('0x14'));var utils=require(_0xd49b('0x15'));var config=require(_0xd49b('0x16'));var db=require(_0xd49b('0x17'))['db'];function respondWithStatusCode(_0x190e93,_0x2e5912){_0x2e5912=_0x2e5912||0xcc;return function(_0x7571d5){if(_0x7571d5){return _0x190e93[_0xd49b('0x18')](_0x2e5912);}return _0x190e93[_0xd49b('0x19')](_0x2e5912)[_0xd49b('0x1a')]();};}function respondWithResult(_0x2a061f,_0x252381){_0x252381=_0x252381||0xc8;return function(_0x2a0d0c){if(_0x2a0d0c){return _0x2a061f['status'](_0x252381)[_0xd49b('0x1b')](_0x2a0d0c);}};}function respondWithFilteredResult(_0x36b884,_0x5db5dc){return function(_0x55cc04){if(_0x55cc04){var _0x18b813=_0x55cc04[_0xd49b('0x1c')],_0x932cbf=_0x5db5dc['offset'],_0x339d5e=_0x5db5dc[_0xd49b('0x1d')]+_0x5db5dc['limit'],_0x186a94;if(_0x339d5e>=_0x18b813){_0x339d5e=_0x18b813;_0x186a94=0xc8;}else{_0x186a94=0xce;}_0x36b884['status'](_0x186a94);return _0x36b884[_0xd49b('0x1e')](_0xd49b('0x1f'),_0x932cbf+'-'+_0x339d5e+'/'+_0x18b813)[_0xd49b('0x1b')](_0x55cc04);}return null;};}function patchUpdates(_0x49b685){return function(_0x4322fb){try{jsonpatch[_0xd49b('0x20')](_0x4322fb,_0x49b685,!![]);}catch(_0x174667){return BPromise['reject'](_0x174667);}return _0x4322fb[_0xd49b('0x21')]();};}function saveUpdates(_0x2f03da,_0x528ba2){return function(_0x511a25){if(_0x511a25){return _0x511a25[_0xd49b('0x22')](_0x2f03da)['then'](function(_0x1e9b48){return _0x1e9b48;});}return null;};}function removeEntity(_0x280687,_0x2b0e52){return function(_0x43671c){if(_0x43671c){return _0x43671c[_0xd49b('0x23')]()[_0xd49b('0x24')](function(){_0x280687['status'](0xcc)[_0xd49b('0x1a')]();});}};}function handleEntityNotFound(_0x1c779e,_0x7bcf22){return function(_0x3dc12b){if(!_0x3dc12b){_0x1c779e[_0xd49b('0x18')](0x194);}return _0x3dc12b;};}function handleError(_0x41be2e,_0x5b40e1){_0x5b40e1=_0x5b40e1||0x1f4;return function(_0x3529b4){logger[_0xd49b('0x25')](_0x3529b4['stack']);if(_0x3529b4[_0xd49b('0x26')]){delete _0x3529b4[_0xd49b('0x26')];}_0x41be2e['status'](_0x5b40e1)[_0xd49b('0x27')](_0x3529b4);};}exports[_0xd49b('0x28')]=function(_0x579ff3,_0x51e940){var _0x2d5487={},_0x4fa729={},_0x4935a0={'count':0x0,'rows':[]};var _0x102c20=db[_0xd49b('0x29')][_0xd49b('0x2a')];_0x4fa729[_0xd49b('0x2b')]=_[_0xd49b('0x2c')](_0x102c20);_0x4fa729[_0xd49b('0x2d')]=_[_0xd49b('0x2c')](_0x579ff3[_0xd49b('0x2d')]);_0x4fa729[_0xd49b('0x2e')]=_['intersection'](_0x4fa729[_0xd49b('0x2b')],_0x4fa729[_0xd49b('0x2d')]);_0x2d5487[_0xd49b('0x2f')]=_[_0xd49b('0x30')](_0x4fa729[_0xd49b('0x2b')],qs['fields'](_0x579ff3[_0xd49b('0x2d')]['fields']));_0x2d5487['attributes']=_0x2d5487[_0xd49b('0x2f')][_0xd49b('0x31')]?_0x2d5487[_0xd49b('0x2f')]:_0x4fa729[_0xd49b('0x2b')];if(!_0x579ff3[_0xd49b('0x2d')][_0xd49b('0x32')](_0xd49b('0x33'))){_0x2d5487[_0xd49b('0x34')]=qs[_0xd49b('0x34')](_0x579ff3[_0xd49b('0x2d')][_0xd49b('0x34')]);_0x2d5487[_0xd49b('0x1d')]=qs[_0xd49b('0x1d')](_0x579ff3[_0xd49b('0x2d')][_0xd49b('0x1d')]);}_0x2d5487['order']=qs[_0xd49b('0x35')](_0x579ff3[_0xd49b('0x2d')][_0xd49b('0x35')]);_0x2d5487['where']=qs[_0xd49b('0x2e')](_['pick'](_0x579ff3[_0xd49b('0x2d')],_0x4fa729[_0xd49b('0x2e')]));if(_0x579ff3[_0xd49b('0x2d')][_0xd49b('0x36')]){_0x2d5487[_0xd49b('0x37')]=_[_0xd49b('0x38')](_0x2d5487[_0xd49b('0x37')],{'$or':_[_0xd49b('0x39')](_0x102c20,function(_0xd60466){if(_0xd60466[_0xd49b('0x3a')]['key']!==_0xd49b('0x3b')){var _0x5f3e79={};_0x5f3e79[_0xd60466[_0xd49b('0x3c')]]={'$like':'%'+_0x579ff3[_0xd49b('0x2d')][_0xd49b('0x36')]+'%'};return _0x5f3e79;}})});}_0x2d5487=_[_0xd49b('0x38')]({},_0x2d5487,_0x579ff3[_0xd49b('0x3d')]);var _0x52bbad={'where':_0x2d5487[_0xd49b('0x37')]};return db[_0xd49b('0x29')][_0xd49b('0x1c')](_0x52bbad)[_0xd49b('0x24')](function(_0x458961){_0x4935a0['count']=_0x458961;if(_0x579ff3['query'][_0xd49b('0x3e')]){_0x2d5487[_0xd49b('0x3f')]=[{'all':!![]}];}return db['SAInvoiceDetail'][_0xd49b('0x40')](_0x2d5487);})['then'](function(_0x2a30e4){_0x4935a0[_0xd49b('0x41')]=_0x2a30e4;return _0x4935a0;})['then'](respondWithFilteredResult(_0x51e940,_0x2d5487))[_0xd49b('0x42')](handleError(_0x51e940,null));};exports['show']=function(_0xbbeff1,_0x255657){var _0x38dbf1={'raw':![],'where':{'id':_0xbbeff1[_0xd49b('0x43')]['id']}},_0x28351a={};_0x28351a[_0xd49b('0x2b')]=_[_0xd49b('0x2c')](db[_0xd49b('0x29')][_0xd49b('0x2a')]);_0x28351a[_0xd49b('0x2d')]=_['keys'](_0xbbeff1[_0xd49b('0x2d')]);_0x28351a[_0xd49b('0x2e')]=_['intersection'](_0x28351a[_0xd49b('0x2b')],_0x28351a[_0xd49b('0x2d')]);_0x38dbf1['attributes']=_[_0xd49b('0x30')](_0x28351a['model'],qs[_0xd49b('0x44')](_0xbbeff1[_0xd49b('0x2d')]['fields']));_0x38dbf1[_0xd49b('0x2f')]=_0x38dbf1[_0xd49b('0x2f')][_0xd49b('0x31')]?_0x38dbf1[_0xd49b('0x2f')]:_0x28351a[_0xd49b('0x2b')];if(_0xbbeff1[_0xd49b('0x2d')][_0xd49b('0x3e')]){_0x38dbf1[_0xd49b('0x3f')]=[{'all':!![]}];}_0x38dbf1=_[_0xd49b('0x38')]({},_0x38dbf1,_0xbbeff1['options']);return db[_0xd49b('0x29')]['find'](_0x38dbf1)[_0xd49b('0x24')](handleEntityNotFound(_0x255657,null))[_0xd49b('0x24')](respondWithResult(_0x255657,null))[_0xd49b('0x42')](handleError(_0x255657,null));};exports[_0xd49b('0x45')]=function(_0x5e5aab,_0x3f4f76){return db['SAInvoiceDetail'][_0xd49b('0x45')](_0x5e5aab[_0xd49b('0x46')],{})[_0xd49b('0x24')](respondWithResult(_0x3f4f76,0xc9))[_0xd49b('0x42')](handleError(_0x3f4f76,null));};exports[_0xd49b('0x22')]=function(_0x28a99d,_0x2489d3){if(_0x28a99d[_0xd49b('0x46')]['id']){delete _0x28a99d[_0xd49b('0x46')]['id'];}return db[_0xd49b('0x29')][_0xd49b('0x47')]({'where':{'id':_0x28a99d['params']['id']}})['then'](handleEntityNotFound(_0x2489d3,null))[_0xd49b('0x24')](saveUpdates(_0x28a99d[_0xd49b('0x46')],null))[_0xd49b('0x24')](respondWithResult(_0x2489d3,null))[_0xd49b('0x42')](handleError(_0x2489d3,null));};exports[_0xd49b('0x23')]=function(_0x56c294,_0x17abc2){return db[_0xd49b('0x29')][_0xd49b('0x47')]({'where':{'id':_0x56c294[_0xd49b('0x43')]['id']}})[_0xd49b('0x24')](handleEntityNotFound(_0x17abc2,null))[_0xd49b('0x24')](removeEntity(_0x17abc2,null))[_0xd49b('0x42')](handleError(_0x17abc2,null));};exports['describe']=function(_0x2dba4e,_0x103239){return db[_0xd49b('0x29')][_0xd49b('0x48')]()['then'](respondWithResult(_0x103239,null))['catch'](handleError(_0x103239,null));}; \ No newline at end of file diff --git a/server/api/saInvoiceDetail/saInvoiceDetail.model.js b/server/api/saInvoiceDetail/saInvoiceDetail.model.js index 617e7b7..4708495 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 _0xda1c=['rimraf','../../config/environment','./saInvoiceDetail.attributes','define','SAInvoiceDetail','sa_invoice_details','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x218a35,_0x5aff3f){var _0x441a74=function(_0x2d9fc3){while(--_0x2d9fc3){_0x218a35['push'](_0x218a35['shift']());}};_0x441a74(++_0x5aff3f);}(_0xda1c,0x68));var _0xcda1=function(_0x39be75,_0x962274){_0x39be75=_0x39be75-0x0;var _0x1e44f1=_0xda1c[_0x39be75];return _0x1e44f1;};'use strict';var _=require(_0xcda1('0x0'));var util=require(_0xcda1('0x1'));var logger=require(_0xcda1('0x2'))(_0xcda1('0x3'));var moment=require(_0xcda1('0x4'));var BPromise=require(_0xcda1('0x5'));var rp=require(_0xcda1('0x6'));var fs=require('fs');var path=require(_0xcda1('0x7'));var rimraf=require(_0xcda1('0x8'));var config=require(_0xcda1('0x9'));var attributes=require(_0xcda1('0xa'));module['exports']=function(_0x153e20,_0x38d063){return _0x153e20[_0xcda1('0xb')](_0xcda1('0xc'),attributes,{'tableName':_0xcda1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9829=['SAInvoiceDetail','lodash','api','bluebird','request-promise','path','../../config/environment','./saInvoiceDetail.attributes','exports','define'];(function(_0x50709f,_0x471e8a){var _0x8cfd9=function(_0x2b3557){while(--_0x2b3557){_0x50709f['push'](_0x50709f['shift']());}};_0x8cfd9(++_0x471e8a);}(_0x9829,0xfb));var _0x9982=function(_0x2ae2ad,_0xac5b0c){_0x2ae2ad=_0x2ae2ad-0x0;var _0x26dbd7=_0x9829[_0x2ae2ad];return _0x26dbd7;};'use strict';var _=require(_0x9982('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9982('0x1'));var moment=require('moment');var BPromise=require(_0x9982('0x2'));var rp=require(_0x9982('0x3'));var fs=require('fs');var path=require(_0x9982('0x4'));var rimraf=require('rimraf');var config=require(_0x9982('0x5'));var attributes=require(_0x9982('0x6'));module[_0x9982('0x7')]=function(_0x5761ad,_0x58c2a6){return _0x5761ad[_0x9982('0x8')](_0x9982('0x9'),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 e52135f..9f73d91 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 _0x84ff=['request','then','info','request\x20sent','debug','SAInvoiceDetail,\x20%s,\x20%s,\x20%s','error','code','SAInvoiceDetail,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x25c3c8,_0x6f7983){var _0x390ced=function(_0x28a370){while(--_0x28a370){_0x25c3c8['push'](_0x25c3c8['shift']());}};_0x390ced(++_0x6f7983);}(_0x84ff,0x1aa));var _0xf84f=function(_0x4a7c1d,_0x2254b8){_0x4a7c1d=_0x4a7c1d-0x0;var _0x3f3c54=_0x84ff[_0x4a7c1d];return _0x3f3c54;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf84f('0x0'));var BPromise=require(_0xf84f('0x1'));var rs=require(_0xf84f('0x2'));var fs=require('fs');var Redis=require(_0xf84f('0x3'));var db=require(_0xf84f('0x4'))['db'];var utils=require(_0xf84f('0x5'));var logger=require(_0xf84f('0x6'))(_0xf84f('0x7'));var config=require(_0xf84f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf84f('0x9')][_0xf84f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5320aa,_0x4974d0,_0x275052){return new BPromise(function(_0x4fcb81,_0x3424f6){return client[_0xf84f('0xb')](_0x5320aa,_0x275052)[_0xf84f('0xc')](function(_0x5de456){logger[_0xf84f('0xd')]('SAInvoiceDetail,\x20%s,\x20%s',_0x4974d0,_0xf84f('0xe'));logger[_0xf84f('0xf')](_0xf84f('0x10'),_0x4974d0,'request\x20sent',JSON['stringify'](_0x5de456));if(_0x5de456[_0xf84f('0x11')]){if(_0x5de456[_0xf84f('0x11')][_0xf84f('0x12')]===0x1f4){logger['error'](_0xf84f('0x13'),_0x4974d0,_0x5de456[_0xf84f('0x11')][_0xf84f('0x14')]);return _0x3424f6(_0x5de456['error'][_0xf84f('0x14')]);}logger['error']('SAInvoiceDetail,\x20%s,\x20%s',_0x4974d0,_0x5de456[_0xf84f('0x11')][_0xf84f('0x14')]);return _0x4fcb81(_0x5de456[_0xf84f('0x11')][_0xf84f('0x14')]);}else{logger[_0xf84f('0xd')](_0xf84f('0x13'),_0x4974d0,_0xf84f('0xe'));_0x4fcb81(_0x5de456[_0xf84f('0x15')][_0xf84f('0x14')]);}})[_0xf84f('0x16')](function(_0x237a72){logger['error'](_0xf84f('0x13'),_0x4974d0,_0x237a72);_0x3424f6(_0x237a72);});});} \ No newline at end of file +var _0x0bc0=['code','SAInvoiceDetail,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','request\x20sent','debug','stringify','error'];(function(_0x1269c6,_0x1c8942){var _0x4868c7=function(_0x1661bc){while(--_0x1661bc){_0x1269c6['push'](_0x1269c6['shift']());}};_0x4868c7(++_0x1c8942);}(_0x0bc0,0x17f));var _0x00bc=function(_0xe67e22,_0x547e07){_0xe67e22=_0xe67e22-0x0;var _0x39ff12=_0x0bc0[_0xe67e22];return _0x39ff12;};'use strict';var _=require(_0x00bc('0x0'));var util=require(_0x00bc('0x1'));var moment=require(_0x00bc('0x2'));var BPromise=require(_0x00bc('0x3'));var rs=require(_0x00bc('0x4'));var fs=require('fs');var Redis=require(_0x00bc('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x00bc('0x6'));var logger=require(_0x00bc('0x7'))('rpc');var config=require(_0x00bc('0x8'));var jayson=require(_0x00bc('0x9'));var client=jayson[_0x00bc('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40b931,_0x21a106,_0x246880){return new BPromise(function(_0x16a34e,_0x43fe7a){return client['request'](_0x40b931,_0x246880)[_0x00bc('0xb')](function(_0x39e324){logger['info']('SAInvoiceDetail,\x20%s,\x20%s',_0x21a106,_0x00bc('0xc'));logger[_0x00bc('0xd')]('SAInvoiceDetail,\x20%s,\x20%s,\x20%s',_0x21a106,_0x00bc('0xc'),JSON[_0x00bc('0xe')](_0x39e324));if(_0x39e324[_0x00bc('0xf')]){if(_0x39e324[_0x00bc('0xf')][_0x00bc('0x10')]===0x1f4){logger['error'](_0x00bc('0x11'),_0x21a106,_0x39e324[_0x00bc('0xf')][_0x00bc('0x12')]);return _0x43fe7a(_0x39e324[_0x00bc('0xf')][_0x00bc('0x12')]);}logger[_0x00bc('0xf')](_0x00bc('0x11'),_0x21a106,_0x39e324['error']['message']);return _0x16a34e(_0x39e324['error'][_0x00bc('0x12')]);}else{logger[_0x00bc('0x13')](_0x00bc('0x11'),_0x21a106,'request\x20sent');_0x16a34e(_0x39e324['result'][_0x00bc('0x12')]);}})[_0x00bc('0x14')](function(_0x3c04b0){logger[_0x00bc('0xf')]('SAInvoiceDetail,\x20%s,\x20%s',_0x21a106,_0x3c04b0);_0x43fe7a(_0x3c04b0);});});} \ No newline at end of file diff --git a/server/api/saInvoiceLaw/index.js b/server/api/saInvoiceLaw/index.js index f3f1d58..4228320 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 _0x09cb=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./saInvoiceLaw.controller','get','isAuthenticated','index','describe','/:id','show','post','put','update','delete','destroy','path'];(function(_0x2480e0,_0x291db4){var _0x397756=function(_0x199868){while(--_0x199868){_0x2480e0['push'](_0x2480e0['shift']());}};_0x397756(++_0x291db4);}(_0x09cb,0x18e));var _0xb09c=function(_0x54dbd9,_0x1b187a){_0x54dbd9=_0x54dbd9-0x0;var _0x1f77bd=_0x09cb[_0x54dbd9];return _0x1f77bd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb09c('0x0'));var timeout=require(_0xb09c('0x1'));var express=require(_0xb09c('0x2'));var router=express[_0xb09c('0x3')]();var auth=require(_0xb09c('0x4'));var interaction=require(_0xb09c('0x5'));var config=require(_0xb09c('0x6'));var controller=require(_0xb09c('0x7'));router[_0xb09c('0x8')]('/',auth[_0xb09c('0x9')](),controller[_0xb09c('0xa')]);router['get']('/describe',auth[_0xb09c('0x9')](),controller[_0xb09c('0xb')]);router[_0xb09c('0x8')](_0xb09c('0xc'),auth[_0xb09c('0x9')](),controller[_0xb09c('0xd')]);router[_0xb09c('0xe')]('/',auth[_0xb09c('0x9')](),controller['create']);router[_0xb09c('0xf')](_0xb09c('0xc'),auth['isAuthenticated'](),controller[_0xb09c('0x10')]);router[_0xb09c('0x11')](_0xb09c('0xc'),auth[_0xb09c('0x9')](),controller[_0xb09c('0x12')]);module['exports']=router; \ No newline at end of file +var _0x8225=['connect-timeout','express','../../components/auth/service','../../config/environment','./saInvoiceLaw.controller','get','isAuthenticated','describe','/:id','show','post','create','delete','destroy','exports','multer','util','path'];(function(_0x1b1981,_0x353439){var _0x426c7f=function(_0xc38aeb){while(--_0xc38aeb){_0x1b1981['push'](_0x1b1981['shift']());}};_0x426c7f(++_0x353439);}(_0x8225,0xb1));var _0x5822=function(_0x2a3b44,_0x653ff3){_0x2a3b44=_0x2a3b44-0x0;var _0x4b45d2=_0x8225[_0x2a3b44];return _0x4b45d2;};'use strict';var multer=require(_0x5822('0x0'));var util=require(_0x5822('0x1'));var path=require(_0x5822('0x2'));var timeout=require(_0x5822('0x3'));var express=require(_0x5822('0x4'));var router=express['Router']();var auth=require(_0x5822('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5822('0x6'));var controller=require(_0x5822('0x7'));router[_0x5822('0x8')]('/',auth[_0x5822('0x9')](),controller['index']);router[_0x5822('0x8')]('/describe',auth[_0x5822('0x9')](),controller[_0x5822('0xa')]);router['get'](_0x5822('0xb'),auth[_0x5822('0x9')](),controller[_0x5822('0xc')]);router[_0x5822('0xd')]('/',auth[_0x5822('0x9')](),controller[_0x5822('0xe')]);router['put'](_0x5822('0xb'),auth[_0x5822('0x9')](),controller['update']);router[_0x5822('0xf')](_0x5822('0xb'),auth[_0x5822('0x9')](),controller[_0x5822('0x10')]);module[_0x5822('0x11')]=router; \ No newline at end of file diff --git a/server/api/saInvoiceLaw/saInvoiceLaw.attributes.js b/server/api/saInvoiceLaw/saInvoiceLaw.attributes.js index 84088b2..6f7b313 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 _0x57fd=['exports','STRING','name','sequelize'];(function(_0x555010,_0x5d9b51){var _0x24a0df=function(_0x123f8b){while(--_0x123f8b){_0x555010['push'](_0x555010['shift']());}};_0x24a0df(++_0x5d9b51);}(_0x57fd,0x193));var _0xd57f=function(_0x65c954,_0x1a3d7d){_0x65c954=_0x65c954-0x0;var _0xb97e2b=_0x57fd[_0x65c954];return _0xb97e2b;};'use strict';var Sequelize=require(_0xd57f('0x0'));module[_0xd57f('0x1')]={'name':{'type':Sequelize[_0xd57f('0x2')],'allowNull':![],'unique':_0xd57f('0x3')}}; \ No newline at end of file +var _0xbdb1=['name','sequelize'];(function(_0x22868f,_0x450f48){var _0x97bc75=function(_0x447cb4){while(--_0x447cb4){_0x22868f['push'](_0x22868f['shift']());}};_0x97bc75(++_0x450f48);}(_0xbdb1,0x6f));var _0x1bdb=function(_0x4f6f84,_0x31e197){_0x4f6f84=_0x4f6f84-0x0;var _0x20d989=_0xbdb1[_0x4f6f84];return _0x20d989;};'use strict';var Sequelize=require(_0x1bdb('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1bdb('0x1')}}; \ No newline at end of file diff --git a/server/api/saInvoiceLaw/saInvoiceLaw.controller.js b/server/api/saInvoiceLaw/saInvoiceLaw.controller.js index 02b4da4..4914f77 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 _0x61a0=['filter','merge','map','key','VIRTUAL','field','options','count','includeAll','include','findAll','catch','params','fields','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','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','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','reject','save','update','then','error','send','index','SAInvoiceLaw','rawAttributes','keys','query','filters','intersection','attributes','model','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x2b66ed,_0x3ece7f){var _0x860fe6=function(_0x5a2ff7){while(--_0x5a2ff7){_0x2b66ed['push'](_0x2b66ed['shift']());}};_0x860fe6(++_0x3ece7f);}(_0x61a0,0xf4));var _0x061a=function(_0xe67d1c,_0x1b21d1){_0xe67d1c=_0xe67d1c-0x0;var _0x11673c=_0x61a0[_0xe67d1c];return _0x11673c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x061a('0x0'));var rimraf=require(_0x061a('0x1'));var zipdir=require(_0x061a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x061a('0x3'));var BPromise=require(_0x061a('0x4'));var Mustache=require(_0x061a('0x5'));var util=require(_0x061a('0x6'));var path=require(_0x061a('0x7'));var sox=require(_0x061a('0x8'));var csv=require(_0x061a('0x9'));var ejs=require(_0x061a('0xa'));var fs=require('fs');var _=require(_0x061a('0xb'));var squel=require(_0x061a('0xc'));var crypto=require(_0x061a('0xd'));var jsforce=require(_0x061a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x061a('0x9'));var querystring=require('querystring');var Papa=require(_0x061a('0xf'));var Redis=require(_0x061a('0x10'));var authService=require(_0x061a('0x11'));var qs=require(_0x061a('0x12'));var hardwareService=require(_0x061a('0x13'));var logger=require(_0x061a('0x14'))(_0x061a('0x15'));var utils=require(_0x061a('0x16'));var config=require(_0x061a('0x17'));var db=require(_0x061a('0x18'))['db'];function respondWithStatusCode(_0x23922d,_0x489b88){_0x489b88=_0x489b88||0xcc;return function(_0x383712){if(_0x383712){return _0x23922d[_0x061a('0x19')](_0x489b88);}return _0x23922d[_0x061a('0x1a')](_0x489b88)[_0x061a('0x1b')]();};}function respondWithResult(_0x33f823,_0x526374){_0x526374=_0x526374||0xc8;return function(_0x5eaf0c){if(_0x5eaf0c){return _0x33f823['status'](_0x526374)['json'](_0x5eaf0c);}};}function respondWithFilteredResult(_0x32b0c3,_0x1f7271){return function(_0x48751d){if(_0x48751d){var _0x3019ca=_0x48751d['count'],_0x570018=_0x1f7271['offset'],_0xf58e65=_0x1f7271[_0x061a('0x1c')]+_0x1f7271[_0x061a('0x1d')],_0x1f9599;if(_0xf58e65>=_0x3019ca){_0xf58e65=_0x3019ca;_0x1f9599=0xc8;}else{_0x1f9599=0xce;}_0x32b0c3['status'](_0x1f9599);return _0x32b0c3[_0x061a('0x1e')](_0x061a('0x1f'),_0x570018+'-'+_0xf58e65+'/'+_0x3019ca)[_0x061a('0x20')](_0x48751d);}return null;};}function patchUpdates(_0x8c7d00){return function(_0xcdc1e5){try{jsonpatch[_0x061a('0x21')](_0xcdc1e5,_0x8c7d00,!![]);}catch(_0x280aa5){return BPromise[_0x061a('0x22')](_0x280aa5);}return _0xcdc1e5[_0x061a('0x23')]();};}function saveUpdates(_0xe24c7f,_0x54c76e){return function(_0x398910){if(_0x398910){return _0x398910[_0x061a('0x24')](_0xe24c7f)[_0x061a('0x25')](function(_0x45c5aa){return _0x45c5aa;});}return null;};}function removeEntity(_0x4ba4fe,_0x572bd0){return function(_0x55d711){if(_0x55d711){return _0x55d711['destroy']()['then'](function(){_0x4ba4fe[_0x061a('0x1a')](0xcc)[_0x061a('0x1b')]();});}};}function handleEntityNotFound(_0x3a3ff2,_0x467b43){return function(_0x20a5d6){if(!_0x20a5d6){_0x3a3ff2[_0x061a('0x19')](0x194);}return _0x20a5d6;};}function handleError(_0x1d85e2,_0xbb57df){_0xbb57df=_0xbb57df||0x1f4;return function(_0x582616){logger[_0x061a('0x26')](_0x582616['stack']);if(_0x582616['name']){delete _0x582616['name'];}_0x1d85e2[_0x061a('0x1a')](_0xbb57df)[_0x061a('0x27')](_0x582616);};}exports[_0x061a('0x28')]=function(_0xa283fb,_0x52ee44){var _0x28e4a0={},_0x28b0cb={},_0x198e97={'count':0x0,'rows':[]};var _0x1d2464=db[_0x061a('0x29')][_0x061a('0x2a')];_0x28b0cb['model']=_[_0x061a('0x2b')](_0x1d2464);_0x28b0cb[_0x061a('0x2c')]=_['keys'](_0xa283fb['query']);_0x28b0cb[_0x061a('0x2d')]=_[_0x061a('0x2e')](_0x28b0cb['model'],_0x28b0cb[_0x061a('0x2c')]);_0x28e4a0[_0x061a('0x2f')]=_[_0x061a('0x2e')](_0x28b0cb[_0x061a('0x30')],qs['fields'](_0xa283fb[_0x061a('0x2c')]['fields']));_0x28e4a0[_0x061a('0x2f')]=_0x28e4a0[_0x061a('0x2f')][_0x061a('0x31')]?_0x28e4a0['attributes']:_0x28b0cb[_0x061a('0x30')];if(!_0xa283fb[_0x061a('0x2c')][_0x061a('0x32')](_0x061a('0x33'))){_0x28e4a0[_0x061a('0x1d')]=qs[_0x061a('0x1d')](_0xa283fb[_0x061a('0x2c')]['limit']);_0x28e4a0[_0x061a('0x1c')]=qs[_0x061a('0x1c')](_0xa283fb[_0x061a('0x2c')][_0x061a('0x1c')]);}_0x28e4a0[_0x061a('0x34')]=qs[_0x061a('0x35')](_0xa283fb[_0x061a('0x2c')][_0x061a('0x35')]);_0x28e4a0[_0x061a('0x36')]=qs[_0x061a('0x2d')](_[_0x061a('0x37')](_0xa283fb[_0x061a('0x2c')],_0x28b0cb[_0x061a('0x2d')]));if(_0xa283fb[_0x061a('0x2c')][_0x061a('0x38')]){_0x28e4a0[_0x061a('0x36')]=_[_0x061a('0x39')](_0x28e4a0[_0x061a('0x36')],{'$or':_[_0x061a('0x3a')](_0x1d2464,function(_0x37d36c){if(_0x37d36c['type'][_0x061a('0x3b')]!==_0x061a('0x3c')){var _0x578fcb={};_0x578fcb[_0x37d36c[_0x061a('0x3d')]]={'$like':'%'+_0xa283fb[_0x061a('0x2c')][_0x061a('0x38')]+'%'};return _0x578fcb;}})});}_0x28e4a0=_[_0x061a('0x39')]({},_0x28e4a0,_0xa283fb[_0x061a('0x3e')]);var _0x10f4f1={'where':_0x28e4a0[_0x061a('0x36')]};return db[_0x061a('0x29')][_0x061a('0x3f')](_0x10f4f1)[_0x061a('0x25')](function(_0x1171b4){_0x198e97[_0x061a('0x3f')]=_0x1171b4;if(_0xa283fb[_0x061a('0x2c')][_0x061a('0x40')]){_0x28e4a0[_0x061a('0x41')]=[{'all':!![]}];}return db['SAInvoiceLaw'][_0x061a('0x42')](_0x28e4a0);})[_0x061a('0x25')](function(_0x482852){_0x198e97['rows']=_0x482852;return _0x198e97;})[_0x061a('0x25')](respondWithFilteredResult(_0x52ee44,_0x28e4a0))[_0x061a('0x43')](handleError(_0x52ee44,null));};exports['show']=function(_0x13c8e4,_0x3c4b37){var _0x1f88a2={'raw':![],'where':{'id':_0x13c8e4[_0x061a('0x44')]['id']}},_0x578152={};_0x578152[_0x061a('0x30')]=_['keys'](db[_0x061a('0x29')][_0x061a('0x2a')]);_0x578152[_0x061a('0x2c')]=_[_0x061a('0x2b')](_0x13c8e4[_0x061a('0x2c')]);_0x578152[_0x061a('0x2d')]=_[_0x061a('0x2e')](_0x578152[_0x061a('0x30')],_0x578152[_0x061a('0x2c')]);_0x1f88a2['attributes']=_[_0x061a('0x2e')](_0x578152[_0x061a('0x30')],qs[_0x061a('0x45')](_0x13c8e4[_0x061a('0x2c')][_0x061a('0x45')]));_0x1f88a2[_0x061a('0x2f')]=_0x1f88a2['attributes'][_0x061a('0x31')]?_0x1f88a2[_0x061a('0x2f')]:_0x578152[_0x061a('0x30')];if(_0x13c8e4[_0x061a('0x2c')][_0x061a('0x40')]){_0x1f88a2[_0x061a('0x41')]=[{'all':!![]}];}_0x1f88a2=_['merge']({},_0x1f88a2,_0x13c8e4['options']);return db[_0x061a('0x29')][_0x061a('0x46')](_0x1f88a2)['then'](handleEntityNotFound(_0x3c4b37,null))[_0x061a('0x25')](respondWithResult(_0x3c4b37,null))[_0x061a('0x43')](handleError(_0x3c4b37,null));};exports[_0x061a('0x47')]=function(_0x2738ae,_0x5ea5b5){return db['SAInvoiceLaw'][_0x061a('0x47')](_0x2738ae[_0x061a('0x48')],{})[_0x061a('0x25')](respondWithResult(_0x5ea5b5,0xc9))['catch'](handleError(_0x5ea5b5,null));};exports['update']=function(_0x57af92,_0xb1d909){if(_0x57af92['body']['id']){delete _0x57af92[_0x061a('0x48')]['id'];}return db['SAInvoiceLaw'][_0x061a('0x46')]({'where':{'id':_0x57af92[_0x061a('0x44')]['id']}})[_0x061a('0x25')](handleEntityNotFound(_0xb1d909,null))[_0x061a('0x25')](saveUpdates(_0x57af92[_0x061a('0x48')],null))['then'](respondWithResult(_0xb1d909,null))[_0x061a('0x43')](handleError(_0xb1d909,null));};exports[_0x061a('0x49')]=function(_0x4f541e,_0x11b327){return db[_0x061a('0x29')][_0x061a('0x46')]({'where':{'id':_0x4f541e[_0x061a('0x44')]['id']}})[_0x061a('0x25')](handleEntityNotFound(_0x11b327,null))[_0x061a('0x25')](removeEntity(_0x11b327,null))[_0x061a('0x43')](handleError(_0x11b327,null));};exports[_0x061a('0x4a')]=function(_0x24ca66,_0x399c37){return db[_0x061a('0x29')]['describe']()[_0x061a('0x25')](respondWithResult(_0x399c37,null))[_0x061a('0x43')](handleError(_0x399c37,null));}; \ No newline at end of file +var _0x862b=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','sendStatus','name','send','index','rawAttributes','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','map','key','VIRTUAL','SAInvoiceLaw','include','findAll','catch','params','includeAll','options','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','squel','crypto','jsforce','desk.js'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x862b,0x14a));var _0xb862=function(_0x411401,_0x5d1220){_0x411401=_0x411401-0x0;var _0x3636a9=_0x862b[_0x411401];return _0x3636a9;};'use strict';var pdf=require(_0xb862('0x0'));var emlformat=require(_0xb862('0x1'));var rimraf=require(_0xb862('0x2'));var zipdir=require(_0xb862('0x3'));var jsonpatch=require(_0xb862('0x4'));var rp=require(_0xb862('0x5'));var moment=require(_0xb862('0x6'));var BPromise=require(_0xb862('0x7'));var Mustache=require(_0xb862('0x8'));var util=require('util');var path=require('path');var sox=require(_0xb862('0x9'));var csv=require(_0xb862('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xb862('0xb'));var crypto=require(_0xb862('0xc'));var jsforce=require(_0xb862('0xd'));var deskjs=require(_0xb862('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb862('0xf'));var Redis=require(_0xb862('0x10'));var authService=require(_0xb862('0x11'));var qs=require(_0xb862('0x12'));var hardwareService=require(_0xb862('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xb862('0x14'));var config=require('../../config/environment');var db=require(_0xb862('0x15'))['db'];function respondWithStatusCode(_0x4674e7,_0x2e53d1){_0x2e53d1=_0x2e53d1||0xcc;return function(_0x21b9f3){if(_0x21b9f3){return _0x4674e7['sendStatus'](_0x2e53d1);}return _0x4674e7[_0xb862('0x16')](_0x2e53d1)[_0xb862('0x17')]();};}function respondWithResult(_0x1e13d7,_0x54f64b){_0x54f64b=_0x54f64b||0xc8;return function(_0x5e8525){if(_0x5e8525){return _0x1e13d7['status'](_0x54f64b)[_0xb862('0x18')](_0x5e8525);}};}function respondWithFilteredResult(_0x4545b6,_0x2d1111){return function(_0x4b8446){if(_0x4b8446){var _0x421591=_0x4b8446[_0xb862('0x19')],_0x36681b=_0x2d1111[_0xb862('0x1a')],_0x14e475=_0x2d1111['offset']+_0x2d1111[_0xb862('0x1b')],_0x52a990;if(_0x14e475>=_0x421591){_0x14e475=_0x421591;_0x52a990=0xc8;}else{_0x52a990=0xce;}_0x4545b6[_0xb862('0x16')](_0x52a990);return _0x4545b6['set'](_0xb862('0x1c'),_0x36681b+'-'+_0x14e475+'/'+_0x421591)[_0xb862('0x18')](_0x4b8446);}return null;};}function patchUpdates(_0x17135b){return function(_0x265c99){try{jsonpatch[_0xb862('0x1d')](_0x265c99,_0x17135b,!![]);}catch(_0x116877){return BPromise[_0xb862('0x1e')](_0x116877);}return _0x265c99[_0xb862('0x1f')]();};}function saveUpdates(_0x4fa01c,_0x29f6ea){return function(_0x1e799a){if(_0x1e799a){return _0x1e799a[_0xb862('0x20')](_0x4fa01c)[_0xb862('0x21')](function(_0x3c67ea){return _0x3c67ea;});}return null;};}function removeEntity(_0x11f0f2,_0x30f7df){return function(_0x4b310e){if(_0x4b310e){return _0x4b310e[_0xb862('0x22')]()[_0xb862('0x21')](function(){_0x11f0f2[_0xb862('0x16')](0xcc)[_0xb862('0x17')]();});}};}function handleEntityNotFound(_0x3f4a09,_0x86845e){return function(_0x539928){if(!_0x539928){_0x3f4a09[_0xb862('0x23')](0x194);}return _0x539928;};}function handleError(_0x4ad89f,_0x2f7f79){_0x2f7f79=_0x2f7f79||0x1f4;return function(_0x25d481){logger['error'](_0x25d481['stack']);if(_0x25d481[_0xb862('0x24')]){delete _0x25d481[_0xb862('0x24')];}_0x4ad89f['status'](_0x2f7f79)[_0xb862('0x25')](_0x25d481);};}exports[_0xb862('0x26')]=function(_0xa6c5a7,_0x319588){var _0x757c09={},_0x13aa88={},_0xbb04c7={'count':0x0,'rows':[]};var _0x2dbb03=db['SAInvoiceLaw'][_0xb862('0x27')];_0x13aa88['model']=_['keys'](_0x2dbb03);_0x13aa88[_0xb862('0x28')]=_[_0xb862('0x29')](_0xa6c5a7[_0xb862('0x28')]);_0x13aa88['filters']=_['intersection'](_0x13aa88[_0xb862('0x2a')],_0x13aa88[_0xb862('0x28')]);_0x757c09[_0xb862('0x2b')]=_[_0xb862('0x2c')](_0x13aa88[_0xb862('0x2a')],qs[_0xb862('0x2d')](_0xa6c5a7['query']['fields']));_0x757c09[_0xb862('0x2b')]=_0x757c09[_0xb862('0x2b')][_0xb862('0x2e')]?_0x757c09['attributes']:_0x13aa88[_0xb862('0x2a')];if(!_0xa6c5a7[_0xb862('0x28')][_0xb862('0x2f')]('nolimit')){_0x757c09[_0xb862('0x1b')]=qs[_0xb862('0x1b')](_0xa6c5a7[_0xb862('0x28')][_0xb862('0x1b')]);_0x757c09['offset']=qs[_0xb862('0x1a')](_0xa6c5a7[_0xb862('0x28')][_0xb862('0x1a')]);}_0x757c09[_0xb862('0x30')]=qs[_0xb862('0x31')](_0xa6c5a7['query'][_0xb862('0x31')]);_0x757c09['where']=qs[_0xb862('0x32')](_[_0xb862('0x33')](_0xa6c5a7[_0xb862('0x28')],_0x13aa88[_0xb862('0x32')]));if(_0xa6c5a7[_0xb862('0x28')][_0xb862('0x34')]){_0x757c09[_0xb862('0x35')]=_[_0xb862('0x36')](_0x757c09[_0xb862('0x35')],{'$or':_[_0xb862('0x37')](_0x2dbb03,function(_0x3ff135){if(_0x3ff135['type'][_0xb862('0x38')]!==_0xb862('0x39')){var _0x112166={};_0x112166[_0x3ff135['field']]={'$like':'%'+_0xa6c5a7[_0xb862('0x28')][_0xb862('0x34')]+'%'};return _0x112166;}})});}_0x757c09=_[_0xb862('0x36')]({},_0x757c09,_0xa6c5a7['options']);var _0x45bf00={'where':_0x757c09[_0xb862('0x35')]};return db[_0xb862('0x3a')][_0xb862('0x19')](_0x45bf00)[_0xb862('0x21')](function(_0x472c88){_0xbb04c7[_0xb862('0x19')]=_0x472c88;if(_0xa6c5a7[_0xb862('0x28')]['includeAll']){_0x757c09[_0xb862('0x3b')]=[{'all':!![]}];}return db[_0xb862('0x3a')][_0xb862('0x3c')](_0x757c09);})['then'](function(_0x18c314){_0xbb04c7['rows']=_0x18c314;return _0xbb04c7;})[_0xb862('0x21')](respondWithFilteredResult(_0x319588,_0x757c09))[_0xb862('0x3d')](handleError(_0x319588,null));};exports['show']=function(_0x2395cf,_0x17a0c7){var _0x2bfa48={'raw':![],'where':{'id':_0x2395cf[_0xb862('0x3e')]['id']}},_0x8db823={};_0x8db823['model']=_['keys'](db[_0xb862('0x3a')][_0xb862('0x27')]);_0x8db823[_0xb862('0x28')]=_[_0xb862('0x29')](_0x2395cf['query']);_0x8db823['filters']=_[_0xb862('0x2c')](_0x8db823[_0xb862('0x2a')],_0x8db823[_0xb862('0x28')]);_0x2bfa48[_0xb862('0x2b')]=_['intersection'](_0x8db823['model'],qs[_0xb862('0x2d')](_0x2395cf['query']['fields']));_0x2bfa48['attributes']=_0x2bfa48[_0xb862('0x2b')][_0xb862('0x2e')]?_0x2bfa48['attributes']:_0x8db823[_0xb862('0x2a')];if(_0x2395cf[_0xb862('0x28')][_0xb862('0x3f')]){_0x2bfa48[_0xb862('0x3b')]=[{'all':!![]}];}_0x2bfa48=_['merge']({},_0x2bfa48,_0x2395cf[_0xb862('0x40')]);return db[_0xb862('0x3a')][_0xb862('0x41')](_0x2bfa48)[_0xb862('0x21')](handleEntityNotFound(_0x17a0c7,null))[_0xb862('0x21')](respondWithResult(_0x17a0c7,null))['catch'](handleError(_0x17a0c7,null));};exports[_0xb862('0x42')]=function(_0x25e926,_0x568a75){return db[_0xb862('0x3a')][_0xb862('0x42')](_0x25e926[_0xb862('0x43')],{})[_0xb862('0x21')](respondWithResult(_0x568a75,0xc9))[_0xb862('0x3d')](handleError(_0x568a75,null));};exports[_0xb862('0x20')]=function(_0x2bfacf,_0x245a57){if(_0x2bfacf['body']['id']){delete _0x2bfacf[_0xb862('0x43')]['id'];}return db['SAInvoiceLaw'][_0xb862('0x41')]({'where':{'id':_0x2bfacf[_0xb862('0x3e')]['id']}})[_0xb862('0x21')](handleEntityNotFound(_0x245a57,null))[_0xb862('0x21')](saveUpdates(_0x2bfacf[_0xb862('0x43')],null))[_0xb862('0x21')](respondWithResult(_0x245a57,null))[_0xb862('0x3d')](handleError(_0x245a57,null));};exports[_0xb862('0x22')]=function(_0x5fe51d,_0x4cb5e6){return db['SAInvoiceLaw'][_0xb862('0x41')]({'where':{'id':_0x5fe51d['params']['id']}})[_0xb862('0x21')](handleEntityNotFound(_0x4cb5e6,null))['then'](removeEntity(_0x4cb5e6,null))[_0xb862('0x3d')](handleError(_0x4cb5e6,null));};exports[_0xb862('0x44')]=function(_0x4b8f87,_0x507e8e){return db[_0xb862('0x3a')]['describe']()[_0xb862('0x21')](respondWithResult(_0x507e8e,null))[_0xb862('0x3d')](handleError(_0x507e8e,null));}; \ No newline at end of file diff --git a/server/api/saInvoiceLaw/saInvoiceLaw.model.js b/server/api/saInvoiceLaw/saInvoiceLaw.model.js index c98dfbd..430997d 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 _0xda3f=['../../config/environment','exports','SAInvoiceLaw','sa_invoice_laws','util','../../config/logger','request-promise','rimraf'];(function(_0x5b66e6,_0x42b872){var _0x4a1fd0=function(_0x4211c0){while(--_0x4211c0){_0x5b66e6['push'](_0x5b66e6['shift']());}};_0x4a1fd0(++_0x42b872);}(_0xda3f,0xec));var _0xfda3=function(_0x888fcf,_0x10cf38){_0x888fcf=_0x888fcf-0x0;var _0x3dfc92=_0xda3f[_0x888fcf];return _0x3dfc92;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var logger=require(_0xfda3('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfda3('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var attributes=require('./saInvoiceLaw.attributes');module[_0xfda3('0x5')]=function(_0x43a010,_0x47e7e2){return _0x43a010['define'](_0xfda3('0x6'),attributes,{'tableName':_0xfda3('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8f4c=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','SAInvoiceLaw'];(function(_0x3fc741,_0x575091){var _0x4362a2=function(_0x4b05be){while(--_0x4b05be){_0x3fc741['push'](_0x3fc741['shift']());}};_0x4362a2(++_0x575091);}(_0x8f4c,0x113));var _0xc8f4=function(_0x2b0188,_0x2e6f26){_0x2b0188=_0x2b0188-0x0;var _0x30489c=_0x8f4c[_0x2b0188];return _0x30489c;};'use strict';var _=require(_0xc8f4('0x0'));var util=require(_0xc8f4('0x1'));var logger=require(_0xc8f4('0x2'))(_0xc8f4('0x3'));var moment=require(_0xc8f4('0x4'));var BPromise=require(_0xc8f4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc8f4('0x6'));var rimraf=require(_0xc8f4('0x7'));var config=require(_0xc8f4('0x8'));var attributes=require('./saInvoiceLaw.attributes');module[_0xc8f4('0x9')]=function(_0x5208da,_0x4c86f8){return _0x5208da['define'](_0xc8f4('0xa'),attributes,{'tableName':'sa_invoice_laws','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 f3af740..2a40ebc 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 _0x2b87=['message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SAInvoiceLaw,\x20%s,\x20%s','request\x20sent','debug','SAInvoiceLaw,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x142156,_0x5169f8){var _0x5b1ea3=function(_0x26080b){while(--_0x26080b){_0x142156['push'](_0x142156['shift']());}};_0x5b1ea3(++_0x5169f8);}(_0x2b87,0x1e3));var _0x72b8=function(_0xb8b92,_0x1840b6){_0xb8b92=_0xb8b92-0x0;var _0x1e1c97=_0x2b87[_0xb8b92];return _0x1e1c97;};'use strict';var _=require('lodash');var util=require(_0x72b8('0x0'));var moment=require(_0x72b8('0x1'));var BPromise=require(_0x72b8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x72b8('0x3'));var db=require(_0x72b8('0x4'))['db'];var utils=require(_0x72b8('0x5'));var logger=require(_0x72b8('0x6'))(_0x72b8('0x7'));var config=require(_0x72b8('0x8'));var jayson=require(_0x72b8('0x9'));var client=jayson[_0x72b8('0xa')][_0x72b8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c4508,_0x2bb240,_0x500c6f){return new BPromise(function(_0x3cb675,_0x57287a){return client[_0x72b8('0xc')](_0x1c4508,_0x500c6f)[_0x72b8('0xd')](function(_0x2c7ca8){logger[_0x72b8('0xe')](_0x72b8('0xf'),_0x2bb240,_0x72b8('0x10'));logger[_0x72b8('0x11')](_0x72b8('0x12'),_0x2bb240,_0x72b8('0x10'),JSON[_0x72b8('0x13')](_0x2c7ca8));if(_0x2c7ca8[_0x72b8('0x14')]){if(_0x2c7ca8[_0x72b8('0x14')]['code']===0x1f4){logger[_0x72b8('0x14')](_0x72b8('0xf'),_0x2bb240,_0x2c7ca8[_0x72b8('0x14')][_0x72b8('0x15')]);return _0x57287a(_0x2c7ca8[_0x72b8('0x14')][_0x72b8('0x15')]);}logger[_0x72b8('0x14')](_0x72b8('0xf'),_0x2bb240,_0x2c7ca8['error'][_0x72b8('0x15')]);return _0x3cb675(_0x2c7ca8[_0x72b8('0x14')][_0x72b8('0x15')]);}else{logger[_0x72b8('0xe')](_0x72b8('0xf'),_0x2bb240,_0x72b8('0x10'));_0x3cb675(_0x2c7ca8[_0x72b8('0x16')][_0x72b8('0x15')]);}})[_0x72b8('0x17')](function(_0x55437a){logger[_0x72b8('0x14')]('SAInvoiceLaw,\x20%s,\x20%s',_0x2bb240,_0x55437a);_0x57287a(_0x55437a);});});} \ No newline at end of file +var _0x260e=['info','SAInvoiceLaw,\x20%s,\x20%s','request\x20sent','debug','SAInvoiceLaw,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x260e,0x198));var _0xe260=function(_0x5a0971,_0x4ac921){_0x5a0971=_0x5a0971-0x0;var _0x54acf8=_0x260e[_0x5a0971];return _0x54acf8;};'use strict';var _=require(_0xe260('0x0'));var util=require(_0xe260('0x1'));var moment=require(_0xe260('0x2'));var BPromise=require(_0xe260('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe260('0x4'));var db=require(_0xe260('0x5'))['db'];var utils=require(_0xe260('0x6'));var logger=require(_0xe260('0x7'))(_0xe260('0x8'));var config=require(_0xe260('0x9'));var jayson=require(_0xe260('0xa'));var client=jayson[_0xe260('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x280c09,_0x18d07d,_0x29bebe){return new BPromise(function(_0x3d6954,_0x1abc20){return client['request'](_0x280c09,_0x29bebe)['then'](function(_0x329684){logger[_0xe260('0xc')](_0xe260('0xd'),_0x18d07d,_0xe260('0xe'));logger[_0xe260('0xf')](_0xe260('0x10'),_0x18d07d,'request\x20sent',JSON[_0xe260('0x11')](_0x329684));if(_0x329684[_0xe260('0x12')]){if(_0x329684[_0xe260('0x12')][_0xe260('0x13')]===0x1f4){logger[_0xe260('0x12')](_0xe260('0xd'),_0x18d07d,_0x329684['error']['message']);return _0x1abc20(_0x329684[_0xe260('0x12')][_0xe260('0x14')]);}logger['error'](_0xe260('0xd'),_0x18d07d,_0x329684['error'][_0xe260('0x14')]);return _0x3d6954(_0x329684['error'][_0xe260('0x14')]);}else{logger[_0xe260('0xc')](_0xe260('0xd'),_0x18d07d,'request\x20sent');_0x3d6954(_0x329684['result'][_0xe260('0x14')]);}})['catch'](function(_0x5ec4d3){logger[_0xe260('0x12')]('SAInvoiceLaw,\x20%s,\x20%s',_0x18d07d,_0x5ec4d3);_0x1abc20(_0x5ec4d3);});});} \ No newline at end of file diff --git a/server/api/saInvoiceNumber/index.js b/server/api/saInvoiceNumber/index.js index 97984a8..1489387 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 _0x71e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./saInvoiceNumber.controller','get','isAuthenticated','/describe','describe','/:id','put','delete','destroy','path','connect-timeout','express'];(function(_0x725a4c,_0x102507){var _0x37b2cc=function(_0x505fc9){while(--_0x505fc9){_0x725a4c['push'](_0x725a4c['shift']());}};_0x37b2cc(++_0x102507);}(_0x71e0,0x18d));var _0x071e=function(_0x2088c6,_0x21289e){_0x2088c6=_0x2088c6-0x0;var _0x4b1a76=_0x71e0[_0x2088c6];return _0x4b1a76;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x071e('0x0'));var timeout=require(_0x071e('0x1'));var express=require(_0x071e('0x2'));var router=express[_0x071e('0x3')]();var auth=require(_0x071e('0x4'));var interaction=require(_0x071e('0x5'));var config=require(_0x071e('0x6'));var controller=require(_0x071e('0x7'));router[_0x071e('0x8')]('/',auth[_0x071e('0x9')](),controller['index']);router[_0x071e('0x8')](_0x071e('0xa'),auth[_0x071e('0x9')](),controller[_0x071e('0xb')]);router[_0x071e('0x8')](_0x071e('0xc'),auth[_0x071e('0x9')](),controller['show']);router['post']('/',auth[_0x071e('0x9')](),controller['create']);router[_0x071e('0xd')](_0x071e('0xc'),auth[_0x071e('0x9')](),controller['update']);router[_0x071e('0xe')](_0x071e('0xc'),auth[_0x071e('0x9')](),controller[_0x071e('0xf')]);module['exports']=router; \ No newline at end of file +var _0xcb02=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post','create','delete','destroy','exports','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcb02,0x1da));var _0x2cb0=function(_0xf9a68d,_0x17a25d){_0xf9a68d=_0xf9a68d-0x0;var _0x3cbf58=_0xcb02[_0xf9a68d];return _0x3cbf58;};'use strict';var multer=require(_0x2cb0('0x0'));var util=require(_0x2cb0('0x1'));var path=require(_0x2cb0('0x2'));var timeout=require(_0x2cb0('0x3'));var express=require(_0x2cb0('0x4'));var router=express['Router']();var auth=require(_0x2cb0('0x5'));var interaction=require(_0x2cb0('0x6'));var config=require(_0x2cb0('0x7'));var controller=require('./saInvoiceNumber.controller');router[_0x2cb0('0x8')]('/',auth[_0x2cb0('0x9')](),controller[_0x2cb0('0xa')]);router[_0x2cb0('0x8')](_0x2cb0('0xb'),auth[_0x2cb0('0x9')](),controller['describe']);router[_0x2cb0('0x8')](_0x2cb0('0xc'),auth[_0x2cb0('0x9')](),controller[_0x2cb0('0xd')]);router[_0x2cb0('0xe')]('/',auth[_0x2cb0('0x9')](),controller[_0x2cb0('0xf')]);router['put']('/:id',auth[_0x2cb0('0x9')](),controller['update']);router[_0x2cb0('0x10')](_0x2cb0('0xc'),auth['isAuthenticated'](),controller[_0x2cb0('0x11')]);module[_0x2cb0('0x12')]=router; \ No newline at end of file diff --git a/server/api/saInvoiceNumber/saInvoiceNumber.attributes.js b/server/api/saInvoiceNumber/saInvoiceNumber.attributes.js index 86a7d7d..97cd9e0 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 _0xe357=['exports','INTEGER'];(function(_0x1acc2d,_0x597696){var _0xabfa6d=function(_0x41e83c){while(--_0x41e83c){_0x1acc2d['push'](_0x1acc2d['shift']());}};_0xabfa6d(++_0x597696);}(_0xe357,0x158));var _0x7e35=function(_0x408de5,_0x24fa7b){_0x408de5=_0x408de5-0x0;var _0x2015a1=_0xe357[_0x408de5];return _0x2015a1;};'use strict';var Sequelize=require('sequelize');module[_0x7e35('0x0')]={'year':{'type':Sequelize[_0x7e35('0x1')]},'number':{'type':Sequelize[_0x7e35('0x1')]}}; \ No newline at end of file +var _0x6283=['INTEGER','exports'];(function(_0x2932cf,_0x362fd9){var _0x1711dd=function(_0x2d8de6){while(--_0x2d8de6){_0x2932cf['push'](_0x2932cf['shift']());}};_0x1711dd(++_0x362fd9);}(_0x6283,0xbd));var _0x3628=function(_0x4505cf,_0x139197){_0x4505cf=_0x4505cf-0x0;var _0x1a6459=_0x6283[_0x4505cf];return _0x1a6459;};'use strict';var Sequelize=require('sequelize');module[_0x3628('0x0')]={'year':{'type':Sequelize[_0x3628('0x1')]},'number':{'type':Sequelize[_0x3628('0x1')]}}; \ No newline at end of file diff --git a/server/api/saInvoiceNumber/saInvoiceNumber.controller.js b/server/api/saInvoiceNumber/saInvoiceNumber.controller.js index 6cef5ba..1c6bd24 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 _0xad9e=['include','findAll','catch','params','find','create','body','update','describe','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','SAInvoiceNumber','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','map','key','VIRTUAL','field','options','includeAll'];(function(_0x1baff2,_0x2d3dac){var _0x1ffdfd=function(_0x5961c9){while(--_0x5961c9){_0x1baff2['push'](_0x1baff2['shift']());}};_0x1ffdfd(++_0x2d3dac);}(_0xad9e,0xe1));var _0xead9=function(_0x28ee1d,_0x484f2e){_0x28ee1d=_0x28ee1d-0x0;var _0x55bee4=_0xad9e[_0x28ee1d];return _0x55bee4;};'use strict';var pdf=require(_0xead9('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xead9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xead9('0x2'));var rp=require(_0xead9('0x3'));var moment=require(_0xead9('0x4'));var BPromise=require(_0xead9('0x5'));var Mustache=require(_0xead9('0x6'));var util=require(_0xead9('0x7'));var path=require(_0xead9('0x8'));var sox=require(_0xead9('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xead9('0xa'));var squel=require(_0xead9('0xb'));var crypto=require(_0xead9('0xc'));var jsforce=require(_0xead9('0xd'));var deskjs=require(_0xead9('0xe'));var toCsv=require(_0xead9('0xf'));var querystring=require('querystring');var Papa=require(_0xead9('0x10'));var Redis=require(_0xead9('0x11'));var authService=require(_0xead9('0x12'));var qs=require(_0xead9('0x13'));var hardwareService=require(_0xead9('0x14'));var logger=require(_0xead9('0x15'))(_0xead9('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x470158,_0x3d7344){_0x3d7344=_0x3d7344||0xcc;return function(_0x8b8213){if(_0x8b8213){return _0x470158[_0xead9('0x17')](_0x3d7344);}return _0x470158['status'](_0x3d7344)[_0xead9('0x18')]();};}function respondWithResult(_0x14e158,_0x2b9dad){_0x2b9dad=_0x2b9dad||0xc8;return function(_0x51c3db){if(_0x51c3db){return _0x14e158[_0xead9('0x19')](_0x2b9dad)[_0xead9('0x1a')](_0x51c3db);}};}function respondWithFilteredResult(_0x840e2b,_0xdb0347){return function(_0xf7ed66){if(_0xf7ed66){var _0x413d9b=_0xf7ed66[_0xead9('0x1b')],_0x40c965=_0xdb0347[_0xead9('0x1c')],_0x117786=_0xdb0347[_0xead9('0x1c')]+_0xdb0347[_0xead9('0x1d')],_0x554839;if(_0x117786>=_0x413d9b){_0x117786=_0x413d9b;_0x554839=0xc8;}else{_0x554839=0xce;}_0x840e2b['status'](_0x554839);return _0x840e2b[_0xead9('0x1e')](_0xead9('0x1f'),_0x40c965+'-'+_0x117786+'/'+_0x413d9b)['json'](_0xf7ed66);}return null;};}function patchUpdates(_0x3b24ea){return function(_0x344989){try{jsonpatch[_0xead9('0x20')](_0x344989,_0x3b24ea,!![]);}catch(_0x1b50b6){return BPromise[_0xead9('0x21')](_0x1b50b6);}return _0x344989['save']();};}function saveUpdates(_0x3828dc,_0x2e7fc8){return function(_0x2597e4){if(_0x2597e4){return _0x2597e4['update'](_0x3828dc)[_0xead9('0x22')](function(_0x3284e3){return _0x3284e3;});}return null;};}function removeEntity(_0x47331e,_0x3d167e){return function(_0x1ae386){if(_0x1ae386){return _0x1ae386[_0xead9('0x23')]()[_0xead9('0x22')](function(){_0x47331e[_0xead9('0x19')](0xcc)[_0xead9('0x18')]();});}};}function handleEntityNotFound(_0x1b182a,_0xbe6fa2){return function(_0x586c29){if(!_0x586c29){_0x1b182a[_0xead9('0x17')](0x194);}return _0x586c29;};}function handleError(_0x54ae11,_0x242e10){_0x242e10=_0x242e10||0x1f4;return function(_0x54f833){logger[_0xead9('0x24')](_0x54f833[_0xead9('0x25')]);if(_0x54f833[_0xead9('0x26')]){delete _0x54f833[_0xead9('0x26')];}_0x54ae11[_0xead9('0x19')](_0x242e10)[_0xead9('0x27')](_0x54f833);};}exports[_0xead9('0x28')]=function(_0x4a80e6,_0x3c4310){var _0x2c10f4={},_0x168879={},_0x293ace={'count':0x0,'rows':[]};var _0x25756e=db[_0xead9('0x29')][_0xead9('0x2a')];_0x168879[_0xead9('0x2b')]=_[_0xead9('0x2c')](_0x25756e);_0x168879[_0xead9('0x2d')]=_[_0xead9('0x2c')](_0x4a80e6[_0xead9('0x2d')]);_0x168879['filters']=_[_0xead9('0x2e')](_0x168879['model'],_0x168879[_0xead9('0x2d')]);_0x2c10f4[_0xead9('0x2f')]=_['intersection'](_0x168879[_0xead9('0x2b')],qs['fields'](_0x4a80e6[_0xead9('0x2d')][_0xead9('0x30')]));_0x2c10f4['attributes']=_0x2c10f4['attributes'][_0xead9('0x31')]?_0x2c10f4['attributes']:_0x168879[_0xead9('0x2b')];if(!_0x4a80e6[_0xead9('0x2d')][_0xead9('0x32')]('nolimit')){_0x2c10f4[_0xead9('0x1d')]=qs[_0xead9('0x1d')](_0x4a80e6[_0xead9('0x2d')][_0xead9('0x1d')]);_0x2c10f4[_0xead9('0x1c')]=qs[_0xead9('0x1c')](_0x4a80e6[_0xead9('0x2d')][_0xead9('0x1c')]);}_0x2c10f4[_0xead9('0x33')]=qs[_0xead9('0x34')](_0x4a80e6['query'][_0xead9('0x34')]);_0x2c10f4['where']=qs['filters'](_[_0xead9('0x35')](_0x4a80e6[_0xead9('0x2d')],_0x168879['filters']));if(_0x4a80e6['query'][_0xead9('0x36')]){_0x2c10f4[_0xead9('0x37')]=_[_0xead9('0x38')](_0x2c10f4[_0xead9('0x37')],{'$or':_[_0xead9('0x39')](_0x25756e,function(_0x3d1e1c){if(_0x3d1e1c['type'][_0xead9('0x3a')]!==_0xead9('0x3b')){var _0x2592e0={};_0x2592e0[_0x3d1e1c[_0xead9('0x3c')]]={'$like':'%'+_0x4a80e6[_0xead9('0x2d')][_0xead9('0x36')]+'%'};return _0x2592e0;}})});}_0x2c10f4=_[_0xead9('0x38')]({},_0x2c10f4,_0x4a80e6[_0xead9('0x3d')]);var _0x3f6309={'where':_0x2c10f4[_0xead9('0x37')]};return db[_0xead9('0x29')]['count'](_0x3f6309)[_0xead9('0x22')](function(_0x1a5d19){_0x293ace['count']=_0x1a5d19;if(_0x4a80e6[_0xead9('0x2d')][_0xead9('0x3e')]){_0x2c10f4[_0xead9('0x3f')]=[{'all':!![]}];}return db[_0xead9('0x29')][_0xead9('0x40')](_0x2c10f4);})[_0xead9('0x22')](function(_0x44721f){_0x293ace['rows']=_0x44721f;return _0x293ace;})[_0xead9('0x22')](respondWithFilteredResult(_0x3c4310,_0x2c10f4))[_0xead9('0x41')](handleError(_0x3c4310,null));};exports['show']=function(_0x1d05ae,_0x1518c2){var _0x42c5eb={'raw':![],'where':{'id':_0x1d05ae[_0xead9('0x42')]['id']}},_0x60a8b2={};_0x60a8b2['model']=_['keys'](db[_0xead9('0x29')][_0xead9('0x2a')]);_0x60a8b2[_0xead9('0x2d')]=_[_0xead9('0x2c')](_0x1d05ae[_0xead9('0x2d')]);_0x60a8b2['filters']=_[_0xead9('0x2e')](_0x60a8b2['model'],_0x60a8b2[_0xead9('0x2d')]);_0x42c5eb[_0xead9('0x2f')]=_[_0xead9('0x2e')](_0x60a8b2[_0xead9('0x2b')],qs['fields'](_0x1d05ae['query']['fields']));_0x42c5eb[_0xead9('0x2f')]=_0x42c5eb['attributes'][_0xead9('0x31')]?_0x42c5eb['attributes']:_0x60a8b2[_0xead9('0x2b')];if(_0x1d05ae[_0xead9('0x2d')][_0xead9('0x3e')]){_0x42c5eb[_0xead9('0x3f')]=[{'all':!![]}];}_0x42c5eb=_[_0xead9('0x38')]({},_0x42c5eb,_0x1d05ae[_0xead9('0x3d')]);return db[_0xead9('0x29')][_0xead9('0x43')](_0x42c5eb)[_0xead9('0x22')](handleEntityNotFound(_0x1518c2,null))[_0xead9('0x22')](respondWithResult(_0x1518c2,null))[_0xead9('0x41')](handleError(_0x1518c2,null));};exports[_0xead9('0x44')]=function(_0x51f6fe,_0x1a9d10){return db[_0xead9('0x29')][_0xead9('0x44')](_0x51f6fe[_0xead9('0x45')],{})[_0xead9('0x22')](respondWithResult(_0x1a9d10,0xc9))[_0xead9('0x41')](handleError(_0x1a9d10,null));};exports[_0xead9('0x46')]=function(_0x33e880,_0x39d4da){if(_0x33e880[_0xead9('0x45')]['id']){delete _0x33e880[_0xead9('0x45')]['id'];}return db[_0xead9('0x29')][_0xead9('0x43')]({'where':{'id':_0x33e880[_0xead9('0x42')]['id']}})[_0xead9('0x22')](handleEntityNotFound(_0x39d4da,null))[_0xead9('0x22')](saveUpdates(_0x33e880[_0xead9('0x45')],null))[_0xead9('0x22')](respondWithResult(_0x39d4da,null))[_0xead9('0x41')](handleError(_0x39d4da,null));};exports[_0xead9('0x23')]=function(_0x3597d5,_0x4b083f){return db[_0xead9('0x29')]['find']({'where':{'id':_0x3597d5['params']['id']}})[_0xead9('0x22')](handleEntityNotFound(_0x4b083f,null))[_0xead9('0x22')](removeEntity(_0x4b083f,null))[_0xead9('0x41')](handleError(_0x4b083f,null));};exports[_0xead9('0x47')]=function(_0x2026c0,_0xd043c9){return db[_0xead9('0x29')][_0xead9('0x47')]()[_0xead9('0x22')](respondWithResult(_0xd043c9,null))[_0xead9('0x41')](handleError(_0xd043c9,null));}; \ No newline at end of file +var _0x2410=['lodash','squel','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','reject','then','stack','name','send','index','SAInvoiceNumber','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','filter','map','VIRTUAL','field','merge','options','includeAll','findAll','rows','catch','params','find','create','body','update','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2410,0x77));var _0x0241=function(_0x26e2bf,_0x127a83){_0x26e2bf=_0x26e2bf-0x0;var _0x1ec577=_0x2410[_0x26e2bf];return _0x1ec577;};'use strict';var pdf=require(_0x0241('0x0'));var emlformat=require(_0x0241('0x1'));var rimraf=require(_0x0241('0x2'));var zipdir=require(_0x0241('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0241('0x4'));var moment=require(_0x0241('0x5'));var BPromise=require(_0x0241('0x6'));var Mustache=require(_0x0241('0x7'));var util=require(_0x0241('0x8'));var path=require(_0x0241('0x9'));var sox=require(_0x0241('0xa'));var csv=require(_0x0241('0xb'));var ejs=require(_0x0241('0xc'));var fs=require('fs');var _=require(_0x0241('0xd'));var squel=require(_0x0241('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0241('0xf'));var toCsv=require(_0x0241('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0241('0x10'));var qs=require(_0x0241('0x11'));var hardwareService=require(_0x0241('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0241('0x13'))['db'];function respondWithStatusCode(_0x1a6fc3,_0x2d1c41){_0x2d1c41=_0x2d1c41||0xcc;return function(_0x4df3de){if(_0x4df3de){return _0x1a6fc3[_0x0241('0x14')](_0x2d1c41);}return _0x1a6fc3[_0x0241('0x15')](_0x2d1c41)[_0x0241('0x16')]();};}function respondWithResult(_0x3eecc9,_0x1f2636){_0x1f2636=_0x1f2636||0xc8;return function(_0x26772b){if(_0x26772b){return _0x3eecc9[_0x0241('0x15')](_0x1f2636)[_0x0241('0x17')](_0x26772b);}};}function respondWithFilteredResult(_0x43f821,_0x24a511){return function(_0x5a8d23){if(_0x5a8d23){var _0x3d513e=_0x5a8d23[_0x0241('0x18')],_0x4ddaff=_0x24a511[_0x0241('0x19')],_0x202f1a=_0x24a511[_0x0241('0x19')]+_0x24a511['limit'],_0x8091e;if(_0x202f1a>=_0x3d513e){_0x202f1a=_0x3d513e;_0x8091e=0xc8;}else{_0x8091e=0xce;}_0x43f821[_0x0241('0x15')](_0x8091e);return _0x43f821[_0x0241('0x1a')]('Content-Range',_0x4ddaff+'-'+_0x202f1a+'/'+_0x3d513e)[_0x0241('0x17')](_0x5a8d23);}return null;};}function patchUpdates(_0xba12db){return function(_0x60f2a){try{jsonpatch[_0x0241('0x1b')](_0x60f2a,_0xba12db,!![]);}catch(_0x4197dd){return BPromise[_0x0241('0x1c')](_0x4197dd);}return _0x60f2a['save']();};}function saveUpdates(_0xdabfd9,_0x4fc06a){return function(_0x139423){if(_0x139423){return _0x139423['update'](_0xdabfd9)[_0x0241('0x1d')](function(_0x4b157e){return _0x4b157e;});}return null;};}function removeEntity(_0x4fa485,_0x37ad38){return function(_0x4e34b4){if(_0x4e34b4){return _0x4e34b4['destroy']()[_0x0241('0x1d')](function(){_0x4fa485[_0x0241('0x15')](0xcc)[_0x0241('0x16')]();});}};}function handleEntityNotFound(_0xe525da,_0x4b771f){return function(_0x197f5d){if(!_0x197f5d){_0xe525da[_0x0241('0x14')](0x194);}return _0x197f5d;};}function handleError(_0x5a11a8,_0x144323){_0x144323=_0x144323||0x1f4;return function(_0x4fe27c){logger['error'](_0x4fe27c[_0x0241('0x1e')]);if(_0x4fe27c[_0x0241('0x1f')]){delete _0x4fe27c[_0x0241('0x1f')];}_0x5a11a8[_0x0241('0x15')](_0x144323)[_0x0241('0x20')](_0x4fe27c);};}exports[_0x0241('0x21')]=function(_0x5b7bea,_0xf16869){var _0x30c858={},_0x25687={},_0x3aec73={'count':0x0,'rows':[]};var _0x6d7bca=db[_0x0241('0x22')][_0x0241('0x23')];_0x25687[_0x0241('0x24')]=_[_0x0241('0x25')](_0x6d7bca);_0x25687[_0x0241('0x26')]=_['keys'](_0x5b7bea[_0x0241('0x26')]);_0x25687['filters']=_[_0x0241('0x27')](_0x25687['model'],_0x25687[_0x0241('0x26')]);_0x30c858[_0x0241('0x28')]=_[_0x0241('0x27')](_0x25687[_0x0241('0x24')],qs[_0x0241('0x29')](_0x5b7bea[_0x0241('0x26')][_0x0241('0x29')]));_0x30c858[_0x0241('0x28')]=_0x30c858[_0x0241('0x28')][_0x0241('0x2a')]?_0x30c858['attributes']:_0x25687['model'];if(!_0x5b7bea['query'][_0x0241('0x2b')]('nolimit')){_0x30c858[_0x0241('0x2c')]=qs[_0x0241('0x2c')](_0x5b7bea[_0x0241('0x26')][_0x0241('0x2c')]);_0x30c858[_0x0241('0x19')]=qs[_0x0241('0x19')](_0x5b7bea[_0x0241('0x26')]['offset']);}_0x30c858[_0x0241('0x2d')]=qs[_0x0241('0x2e')](_0x5b7bea['query']['sort']);_0x30c858[_0x0241('0x2f')]=qs[_0x0241('0x30')](_['pick'](_0x5b7bea[_0x0241('0x26')],_0x25687[_0x0241('0x30')]));if(_0x5b7bea['query'][_0x0241('0x31')]){_0x30c858['where']=_['merge'](_0x30c858['where'],{'$or':_[_0x0241('0x32')](_0x6d7bca,function(_0x887fe6){if(_0x887fe6['type']['key']!==_0x0241('0x33')){var _0x111bfb={};_0x111bfb[_0x887fe6[_0x0241('0x34')]]={'$like':'%'+_0x5b7bea[_0x0241('0x26')]['filter']+'%'};return _0x111bfb;}})});}_0x30c858=_[_0x0241('0x35')]({},_0x30c858,_0x5b7bea[_0x0241('0x36')]);var _0x5a9f92={'where':_0x30c858['where']};return db[_0x0241('0x22')][_0x0241('0x18')](_0x5a9f92)[_0x0241('0x1d')](function(_0x3fd81c){_0x3aec73['count']=_0x3fd81c;if(_0x5b7bea['query'][_0x0241('0x37')]){_0x30c858['include']=[{'all':!![]}];}return db['SAInvoiceNumber'][_0x0241('0x38')](_0x30c858);})[_0x0241('0x1d')](function(_0x2a83de){_0x3aec73[_0x0241('0x39')]=_0x2a83de;return _0x3aec73;})[_0x0241('0x1d')](respondWithFilteredResult(_0xf16869,_0x30c858))[_0x0241('0x3a')](handleError(_0xf16869,null));};exports['show']=function(_0xdac113,_0x4b5116){var _0x1d5423={'raw':![],'where':{'id':_0xdac113[_0x0241('0x3b')]['id']}},_0x5467c1={};_0x5467c1['model']=_[_0x0241('0x25')](db[_0x0241('0x22')][_0x0241('0x23')]);_0x5467c1[_0x0241('0x26')]=_[_0x0241('0x25')](_0xdac113[_0x0241('0x26')]);_0x5467c1[_0x0241('0x30')]=_['intersection'](_0x5467c1[_0x0241('0x24')],_0x5467c1[_0x0241('0x26')]);_0x1d5423[_0x0241('0x28')]=_['intersection'](_0x5467c1[_0x0241('0x24')],qs[_0x0241('0x29')](_0xdac113[_0x0241('0x26')][_0x0241('0x29')]));_0x1d5423[_0x0241('0x28')]=_0x1d5423['attributes']['length']?_0x1d5423[_0x0241('0x28')]:_0x5467c1['model'];if(_0xdac113['query']['includeAll']){_0x1d5423['include']=[{'all':!![]}];}_0x1d5423=_['merge']({},_0x1d5423,_0xdac113[_0x0241('0x36')]);return db[_0x0241('0x22')][_0x0241('0x3c')](_0x1d5423)['then'](handleEntityNotFound(_0x4b5116,null))['then'](respondWithResult(_0x4b5116,null))[_0x0241('0x3a')](handleError(_0x4b5116,null));};exports[_0x0241('0x3d')]=function(_0x2593f2,_0x50d278){return db['SAInvoiceNumber']['create'](_0x2593f2[_0x0241('0x3e')],{})['then'](respondWithResult(_0x50d278,0xc9))['catch'](handleError(_0x50d278,null));};exports[_0x0241('0x3f')]=function(_0x5637f7,_0x531bf4){if(_0x5637f7[_0x0241('0x3e')]['id']){delete _0x5637f7['body']['id'];}return db['SAInvoiceNumber'][_0x0241('0x3c')]({'where':{'id':_0x5637f7[_0x0241('0x3b')]['id']}})['then'](handleEntityNotFound(_0x531bf4,null))[_0x0241('0x1d')](saveUpdates(_0x5637f7[_0x0241('0x3e')],null))[_0x0241('0x1d')](respondWithResult(_0x531bf4,null))['catch'](handleError(_0x531bf4,null));};exports[_0x0241('0x40')]=function(_0x459b7f,_0x31b88b){return db[_0x0241('0x22')]['find']({'where':{'id':_0x459b7f['params']['id']}})[_0x0241('0x1d')](handleEntityNotFound(_0x31b88b,null))[_0x0241('0x1d')](removeEntity(_0x31b88b,null))[_0x0241('0x3a')](handleError(_0x31b88b,null));};exports[_0x0241('0x41')]=function(_0xbf97a7,_0xac4300){return db[_0x0241('0x22')][_0x0241('0x41')]()[_0x0241('0x1d')](respondWithResult(_0xac4300,null))['catch'](handleError(_0xac4300,null));}; \ No newline at end of file diff --git a/server/api/saInvoiceNumber/saInvoiceNumber.model.js b/server/api/saInvoiceNumber/saInvoiceNumber.model.js index b5c6d91..7d7ab1b 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 _0xa7bc=['rimraf','../../config/environment','./saInvoiceNumber.attributes','SAInvoiceNumber','sa_invoice_numbers','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x2bcdba,_0x9d94af){var _0x5c45d0=function(_0x4a48ad){while(--_0x4a48ad){_0x2bcdba['push'](_0x2bcdba['shift']());}};_0x5c45d0(++_0x9d94af);}(_0xa7bc,0xd6));var _0xca7b=function(_0x22a079,_0x5210fe){_0x22a079=_0x22a079-0x0;var _0x5e469c=_0xa7bc[_0x22a079];return _0x5e469c;};'use strict';var _=require(_0xca7b('0x0'));var util=require('util');var logger=require(_0xca7b('0x1'))('api');var moment=require(_0xca7b('0x2'));var BPromise=require(_0xca7b('0x3'));var rp=require(_0xca7b('0x4'));var fs=require('fs');var path=require(_0xca7b('0x5'));var rimraf=require(_0xca7b('0x6'));var config=require(_0xca7b('0x7'));var attributes=require(_0xca7b('0x8'));module['exports']=function(_0x4f30d5,_0x1c35a9){return _0x4f30d5['define'](_0xca7b('0x9'),attributes,{'tableName':_0xca7b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6c91=['request-promise','path','rimraf','exports','define','SAInvoiceNumber','sa_invoice_numbers','lodash','../../config/logger','api','moment','bluebird'];(function(_0x592494,_0x9276be){var _0x3fd5a0=function(_0x39816b){while(--_0x39816b){_0x592494['push'](_0x592494['shift']());}};_0x3fd5a0(++_0x9276be);}(_0x6c91,0xd3));var _0x16c9=function(_0xee1921,_0x356113){_0xee1921=_0xee1921-0x0;var _0x239ffe=_0x6c91[_0xee1921];return _0x239ffe;};'use strict';var _=require(_0x16c9('0x0'));var util=require('util');var logger=require(_0x16c9('0x1'))(_0x16c9('0x2'));var moment=require(_0x16c9('0x3'));var BPromise=require(_0x16c9('0x4'));var rp=require(_0x16c9('0x5'));var fs=require('fs');var path=require(_0x16c9('0x6'));var rimraf=require(_0x16c9('0x7'));var config=require('../../config/environment');var attributes=require('./saInvoiceNumber.attributes');module[_0x16c9('0x8')]=function(_0x5e4ce9,_0x143401){return _0x5e4ce9[_0x16c9('0x9')](_0x16c9('0xa'),attributes,{'tableName':_0x16c9('0xb'),'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 33cd319..a3853c7 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 _0x7b4e=['code','message','SAInvoiceNumber,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','info','request\x20sent','debug','SAInvoiceNumber,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5a2d3f,_0x27b04e){var _0x5c65d8=function(_0x2d1965){while(--_0x2d1965){_0x5a2d3f['push'](_0x5a2d3f['shift']());}};_0x5c65d8(++_0x27b04e);}(_0x7b4e,0x100));var _0xe7b4=function(_0x5d2180,_0x24d40a){_0x5d2180=_0x5d2180-0x0;var _0x442606=_0x7b4e[_0x5d2180];return _0x442606;};'use strict';var _=require(_0xe7b4('0x0'));var util=require(_0xe7b4('0x1'));var moment=require('moment');var BPromise=require(_0xe7b4('0x2'));var rs=require(_0xe7b4('0x3'));var fs=require('fs');var Redis=require(_0xe7b4('0x4'));var db=require(_0xe7b4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe7b4('0x6'))(_0xe7b4('0x7'));var config=require(_0xe7b4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe7b4('0x9')][_0xe7b4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56c88e,_0x3e7eaf,_0x5e898e){return new BPromise(function(_0x261c6d,_0x5022ff){return client['request'](_0x56c88e,_0x5e898e)['then'](function(_0x3a057d){logger[_0xe7b4('0xb')]('SAInvoiceNumber,\x20%s,\x20%s',_0x3e7eaf,_0xe7b4('0xc'));logger[_0xe7b4('0xd')](_0xe7b4('0xe'),_0x3e7eaf,_0xe7b4('0xc'),JSON[_0xe7b4('0xf')](_0x3a057d));if(_0x3a057d['error']){if(_0x3a057d[_0xe7b4('0x10')][_0xe7b4('0x11')]===0x1f4){logger[_0xe7b4('0x10')]('SAInvoiceNumber,\x20%s,\x20%s',_0x3e7eaf,_0x3a057d[_0xe7b4('0x10')][_0xe7b4('0x12')]);return _0x5022ff(_0x3a057d[_0xe7b4('0x10')][_0xe7b4('0x12')]);}logger[_0xe7b4('0x10')](_0xe7b4('0x13'),_0x3e7eaf,_0x3a057d[_0xe7b4('0x10')]['message']);return _0x261c6d(_0x3a057d[_0xe7b4('0x10')][_0xe7b4('0x12')]);}else{logger[_0xe7b4('0xb')](_0xe7b4('0x13'),_0x3e7eaf,_0xe7b4('0xc'));_0x261c6d(_0x3a057d['result'][_0xe7b4('0x12')]);}})[_0xe7b4('0x14')](function(_0x961ad7){logger['error']('SAInvoiceNumber,\x20%s,\x20%s',_0x3e7eaf,_0x961ad7);_0x5022ff(_0x961ad7);});});} \ No newline at end of file +var _0xb8fd=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SAInvoiceNumber,\x20%s,\x20%s','request\x20sent','debug','SAInvoiceNumber,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xb8fd,0x1f4));var _0xdb8f=function(_0x21ae23,_0x237b6f){_0x21ae23=_0x21ae23-0x0;var _0x1236f1=_0xb8fd[_0x21ae23];return _0x1236f1;};'use strict';var _=require(_0xdb8f('0x0'));var util=require('util');var moment=require(_0xdb8f('0x1'));var BPromise=require(_0xdb8f('0x2'));var rs=require(_0xdb8f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdb8f('0x4'))['db'];var utils=require(_0xdb8f('0x5'));var logger=require(_0xdb8f('0x6'))(_0xdb8f('0x7'));var config=require(_0xdb8f('0x8'));var jayson=require(_0xdb8f('0x9'));var client=jayson[_0xdb8f('0xa')][_0xdb8f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x41754f,_0x497f66,_0x42c6d8){return new BPromise(function(_0x3aed8,_0x5c83dd){return client['request'](_0x41754f,_0x42c6d8)[_0xdb8f('0xc')](function(_0x452ddf){logger[_0xdb8f('0xd')](_0xdb8f('0xe'),_0x497f66,_0xdb8f('0xf'));logger[_0xdb8f('0x10')](_0xdb8f('0x11'),_0x497f66,_0xdb8f('0xf'),JSON[_0xdb8f('0x12')](_0x452ddf));if(_0x452ddf[_0xdb8f('0x13')]){if(_0x452ddf[_0xdb8f('0x13')]['code']===0x1f4){logger[_0xdb8f('0x13')](_0xdb8f('0xe'),_0x497f66,_0x452ddf[_0xdb8f('0x13')][_0xdb8f('0x14')]);return _0x5c83dd(_0x452ddf[_0xdb8f('0x13')][_0xdb8f('0x14')]);}logger['error'](_0xdb8f('0xe'),_0x497f66,_0x452ddf[_0xdb8f('0x13')][_0xdb8f('0x14')]);return _0x3aed8(_0x452ddf[_0xdb8f('0x13')][_0xdb8f('0x14')]);}else{logger[_0xdb8f('0xd')](_0xdb8f('0xe'),_0x497f66,'request\x20sent');_0x3aed8(_0x452ddf[_0xdb8f('0x15')][_0xdb8f('0x14')]);}})[_0xdb8f('0x16')](function(_0x3e7332){logger['error'](_0xdb8f('0xe'),_0x497f66,_0x3e7332);_0x5c83dd(_0x3e7332);});});} \ No newline at end of file diff --git a/server/api/saOrder/index.js b/server/api/saOrder/index.js index 2e6e116..f2ed474 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 _0x0b0e=['multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./saOrder.controller','get','isAuthenticated','index','/describe','/:id','show','create','delete','exports'];(function(_0x1afce7,_0x404150){var _0x7b277b=function(_0x9d9dfb){while(--_0x9d9dfb){_0x1afce7['push'](_0x1afce7['shift']());}};_0x7b277b(++_0x404150);}(_0x0b0e,0x187));var _0xe0b0=function(_0xae282f,_0x2d9368){_0xae282f=_0xae282f-0x0;var _0x5f46d4=_0x0b0e[_0xae282f];return _0x5f46d4;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var auth=require(_0xe0b0('0x4'));var interaction=require(_0xe0b0('0x5'));var config=require(_0xe0b0('0x6'));var controller=require(_0xe0b0('0x7'));router[_0xe0b0('0x8')]('/',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xa')]);router[_0xe0b0('0x8')](_0xe0b0('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xe0b0('0x8')](_0xe0b0('0xc'),auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xd')]);router['post']('/',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xe')]);router['put'](_0xe0b0('0xc'),auth[_0xe0b0('0x9')](),controller['update']);router[_0xe0b0('0xf')](_0xe0b0('0xc'),auth[_0xe0b0('0x9')](),controller['destroy']);module[_0xe0b0('0x10')]=router; \ No newline at end of file +var _0x3266=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','describe','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0xd03411,_0x4e48f6){var _0x2f77b3=function(_0x122c9b){while(--_0x122c9b){_0xd03411['push'](_0xd03411['shift']());}};_0x2f77b3(++_0x4e48f6);}(_0x3266,0x6a));var _0x6326=function(_0x5235a6,_0x680b76){_0x5235a6=_0x5235a6-0x0;var _0x1cf37e=_0x3266[_0x5235a6];return _0x1cf37e;};'use strict';var multer=require(_0x6326('0x0'));var util=require(_0x6326('0x1'));var path=require(_0x6326('0x2'));var timeout=require(_0x6326('0x3'));var express=require(_0x6326('0x4'));var router=express[_0x6326('0x5')]();var auth=require(_0x6326('0x6'));var interaction=require(_0x6326('0x7'));var config=require(_0x6326('0x8'));var controller=require('./saOrder.controller');router[_0x6326('0x9')]('/',auth['isAuthenticated'](),controller[_0x6326('0xa')]);router[_0x6326('0x9')](_0x6326('0xb'),auth['isAuthenticated'](),controller[_0x6326('0xc')]);router['get'](_0x6326('0xd'),auth[_0x6326('0xe')](),controller[_0x6326('0xf')]);router[_0x6326('0x10')]('/',auth[_0x6326('0xe')](),controller['create']);router[_0x6326('0x11')](_0x6326('0xd'),auth[_0x6326('0xe')](),controller[_0x6326('0x12')]);router[_0x6326('0x13')](_0x6326('0xd'),auth[_0x6326('0xe')](),controller[_0x6326('0x14')]);module[_0x6326('0x15')]=router; \ No newline at end of file diff --git a/server/api/saOrder/saOrder.attributes.js b/server/api/saOrder/saOrder.attributes.js index d473b81..d99a269 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 _0xc4aa=['exports','STRING','TEXT','sequelize'];(function(_0x1d6786,_0x29f49c){var _0x4be361=function(_0x5680ac){while(--_0x5680ac){_0x1d6786['push'](_0x1d6786['shift']());}};_0x4be361(++_0x29f49c);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xc4aa[_0x346737];return _0x1ade2e;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'clientCode':{'type':Sequelize[_0xac4a('0x2')]},'note':{'type':Sequelize[_0xac4a('0x3')]},'agentFullname':{'type':Sequelize[_0xac4a('0x2')]},'status':{'type':Sequelize[_0xac4a('0x2')]}}; \ No newline at end of file +var _0x1261=['exports','STRING','TEXT'];(function(_0x424de7,_0x5cae24){var _0x1e2184=function(_0x1b74a0){while(--_0x1b74a0){_0x424de7['push'](_0x424de7['shift']());}};_0x1e2184(++_0x5cae24);}(_0x1261,0x144));var _0x1126=function(_0x2e891a,_0xb5a3b5){_0x2e891a=_0x2e891a-0x0;var _0x39f989=_0x1261[_0x2e891a];return _0x39f989;};'use strict';var Sequelize=require('sequelize');module[_0x1126('0x0')]={'clientCode':{'type':Sequelize[_0x1126('0x1')]},'note':{'type':Sequelize[_0x1126('0x2')]},'agentFullname':{'type':Sequelize[_0x1126('0x1')]},'status':{'type':Sequelize[_0x1126('0x1')]}}; \ No newline at end of file diff --git a/server/api/saOrder/saOrder.controller.js b/server/api/saOrder/saOrder.controller.js index 426a96b..22c66f6 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 _0x4776=['status','json','offset','limit','set','Content-Range','apply','reject','save','destroy','then','end','error','stack','name','send','index','SAOrder','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','type','field','options','where','count','includeAll','include','rows','catch','show','create','body','update','params','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb'];(function(_0x4d6298,_0x502f6b){var _0x57ccf0=function(_0x3cef94){while(--_0x3cef94){_0x4d6298['push'](_0x4d6298['shift']());}};_0x57ccf0(++_0x502f6b);}(_0x4776,0x195));var _0x6477=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0x4776[_0x47fd36];return _0x21a0fc;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6477('0x0'));var rimraf=require(_0x6477('0x1'));var zipdir=require(_0x6477('0x2'));var jsonpatch=require(_0x6477('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6477('0x4'));var util=require(_0x6477('0x5'));var path=require(_0x6477('0x6'));var sox=require(_0x6477('0x7'));var csv=require('to-csv');var ejs=require(_0x6477('0x8'));var fs=require('fs');var _=require(_0x6477('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6477('0xa'));var deskjs=require(_0x6477('0xb'));var toCsv=require('to-csv');var querystring=require(_0x6477('0xc'));var Papa=require(_0x6477('0xd'));var Redis=require(_0x6477('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x6477('0xf'));var hardwareService=require(_0x6477('0x10'));var logger=require(_0x6477('0x11'))(_0x6477('0x12'));var utils=require(_0x6477('0x13'));var config=require('../../config/environment');var db=require(_0x6477('0x14'))['db'];function respondWithStatusCode(_0x1f5469,_0x5adccf){_0x5adccf=_0x5adccf||0xcc;return function(_0x58c582){if(_0x58c582){return _0x1f5469['sendStatus'](_0x5adccf);}return _0x1f5469[_0x6477('0x15')](_0x5adccf)['end']();};}function respondWithResult(_0x4fe2e2,_0x41090f){_0x41090f=_0x41090f||0xc8;return function(_0x3c31fc){if(_0x3c31fc){return _0x4fe2e2[_0x6477('0x15')](_0x41090f)[_0x6477('0x16')](_0x3c31fc);}};}function respondWithFilteredResult(_0x30430a,_0x168713){return function(_0x51de73){if(_0x51de73){var _0x5008db=_0x51de73['count'],_0x664d5d=_0x168713[_0x6477('0x17')],_0x10a9ad=_0x168713['offset']+_0x168713[_0x6477('0x18')],_0x3f22bd;if(_0x10a9ad>=_0x5008db){_0x10a9ad=_0x5008db;_0x3f22bd=0xc8;}else{_0x3f22bd=0xce;}_0x30430a[_0x6477('0x15')](_0x3f22bd);return _0x30430a[_0x6477('0x19')](_0x6477('0x1a'),_0x664d5d+'-'+_0x10a9ad+'/'+_0x5008db)[_0x6477('0x16')](_0x51de73);}return null;};}function patchUpdates(_0x3b7439){return function(_0x219999){try{jsonpatch[_0x6477('0x1b')](_0x219999,_0x3b7439,!![]);}catch(_0x28a1c7){return BPromise[_0x6477('0x1c')](_0x28a1c7);}return _0x219999[_0x6477('0x1d')]();};}function saveUpdates(_0x5ad83a,_0x39fddd){return function(_0x28bdfa){if(_0x28bdfa){return _0x28bdfa['update'](_0x5ad83a)['then'](function(_0x48fee1){return _0x48fee1;});}return null;};}function removeEntity(_0x30080e,_0xd2da87){return function(_0x5cd832){if(_0x5cd832){return _0x5cd832[_0x6477('0x1e')]()[_0x6477('0x1f')](function(){_0x30080e[_0x6477('0x15')](0xcc)[_0x6477('0x20')]();});}};}function handleEntityNotFound(_0x327e15,_0xcb272a){return function(_0x5d4166){if(!_0x5d4166){_0x327e15['sendStatus'](0x194);}return _0x5d4166;};}function handleError(_0x580868,_0x26729f){_0x26729f=_0x26729f||0x1f4;return function(_0x98fbb6){logger[_0x6477('0x21')](_0x98fbb6[_0x6477('0x22')]);if(_0x98fbb6[_0x6477('0x23')]){delete _0x98fbb6[_0x6477('0x23')];}_0x580868['status'](_0x26729f)[_0x6477('0x24')](_0x98fbb6);};}exports[_0x6477('0x25')]=function(_0x67ad37,_0x592655){var _0x5c88b1={},_0x4d6b2c={},_0x5117d9={'count':0x0,'rows':[]};var _0x114454=db[_0x6477('0x26')][_0x6477('0x27')];_0x4d6b2c[_0x6477('0x28')]=_[_0x6477('0x29')](_0x114454);_0x4d6b2c[_0x6477('0x2a')]=_['keys'](_0x67ad37[_0x6477('0x2a')]);_0x4d6b2c[_0x6477('0x2b')]=_[_0x6477('0x2c')](_0x4d6b2c[_0x6477('0x28')],_0x4d6b2c['query']);_0x5c88b1[_0x6477('0x2d')]=_[_0x6477('0x2c')](_0x4d6b2c['model'],qs[_0x6477('0x2e')](_0x67ad37[_0x6477('0x2a')]['fields']));_0x5c88b1[_0x6477('0x2d')]=_0x5c88b1[_0x6477('0x2d')][_0x6477('0x2f')]?_0x5c88b1[_0x6477('0x2d')]:_0x4d6b2c[_0x6477('0x28')];if(!_0x67ad37[_0x6477('0x2a')][_0x6477('0x30')](_0x6477('0x31'))){_0x5c88b1[_0x6477('0x18')]=qs[_0x6477('0x18')](_0x67ad37['query'][_0x6477('0x18')]);_0x5c88b1[_0x6477('0x17')]=qs[_0x6477('0x17')](_0x67ad37[_0x6477('0x2a')][_0x6477('0x17')]);}_0x5c88b1[_0x6477('0x32')]=qs[_0x6477('0x33')](_0x67ad37['query'][_0x6477('0x33')]);_0x5c88b1['where']=qs[_0x6477('0x2b')](_[_0x6477('0x34')](_0x67ad37[_0x6477('0x2a')],_0x4d6b2c[_0x6477('0x2b')]));if(_0x67ad37[_0x6477('0x2a')][_0x6477('0x35')]){_0x5c88b1['where']=_[_0x6477('0x36')](_0x5c88b1['where'],{'$or':_['map'](_0x114454,function(_0x23854f){if(_0x23854f[_0x6477('0x37')]['key']!=='VIRTUAL'){var _0x1c85a2={};_0x1c85a2[_0x23854f[_0x6477('0x38')]]={'$like':'%'+_0x67ad37[_0x6477('0x2a')][_0x6477('0x35')]+'%'};return _0x1c85a2;}})});}_0x5c88b1=_[_0x6477('0x36')]({},_0x5c88b1,_0x67ad37[_0x6477('0x39')]);var _0x27f137={'where':_0x5c88b1[_0x6477('0x3a')]};return db['SAOrder'][_0x6477('0x3b')](_0x27f137)[_0x6477('0x1f')](function(_0x36593f){_0x5117d9[_0x6477('0x3b')]=_0x36593f;if(_0x67ad37[_0x6477('0x2a')][_0x6477('0x3c')]){_0x5c88b1[_0x6477('0x3d')]=[{'all':!![]}];}return db[_0x6477('0x26')]['findAll'](_0x5c88b1);})[_0x6477('0x1f')](function(_0x19ca9a){_0x5117d9[_0x6477('0x3e')]=_0x19ca9a;return _0x5117d9;})[_0x6477('0x1f')](respondWithFilteredResult(_0x592655,_0x5c88b1))[_0x6477('0x3f')](handleError(_0x592655,null));};exports[_0x6477('0x40')]=function(_0x2947ee,_0x4bb618){var _0x25fa36={'raw':![],'where':{'id':_0x2947ee['params']['id']}},_0x16964b={};_0x16964b[_0x6477('0x28')]=_[_0x6477('0x29')](db[_0x6477('0x26')][_0x6477('0x27')]);_0x16964b[_0x6477('0x2a')]=_[_0x6477('0x29')](_0x2947ee[_0x6477('0x2a')]);_0x16964b[_0x6477('0x2b')]=_[_0x6477('0x2c')](_0x16964b[_0x6477('0x28')],_0x16964b[_0x6477('0x2a')]);_0x25fa36[_0x6477('0x2d')]=_['intersection'](_0x16964b[_0x6477('0x28')],qs[_0x6477('0x2e')](_0x2947ee[_0x6477('0x2a')]['fields']));_0x25fa36[_0x6477('0x2d')]=_0x25fa36[_0x6477('0x2d')][_0x6477('0x2f')]?_0x25fa36[_0x6477('0x2d')]:_0x16964b[_0x6477('0x28')];if(_0x2947ee[_0x6477('0x2a')][_0x6477('0x3c')]){_0x25fa36['include']=[{'all':!![]}];}_0x25fa36=_[_0x6477('0x36')]({},_0x25fa36,_0x2947ee[_0x6477('0x39')]);return db[_0x6477('0x26')]['find'](_0x25fa36)[_0x6477('0x1f')](handleEntityNotFound(_0x4bb618,null))[_0x6477('0x1f')](respondWithResult(_0x4bb618,null))[_0x6477('0x3f')](handleError(_0x4bb618,null));};exports[_0x6477('0x41')]=function(_0x2b8609,_0x7d80e3){return db[_0x6477('0x26')][_0x6477('0x41')](_0x2b8609[_0x6477('0x42')],{})['then'](respondWithResult(_0x7d80e3,0xc9))[_0x6477('0x3f')](handleError(_0x7d80e3,null));};exports[_0x6477('0x43')]=function(_0x4258f7,_0x3d65a9){if(_0x4258f7[_0x6477('0x42')]['id']){delete _0x4258f7[_0x6477('0x42')]['id'];}return db[_0x6477('0x26')]['find']({'where':{'id':_0x4258f7[_0x6477('0x44')]['id']}})[_0x6477('0x1f')](handleEntityNotFound(_0x3d65a9,null))[_0x6477('0x1f')](saveUpdates(_0x4258f7['body'],null))[_0x6477('0x1f')](respondWithResult(_0x3d65a9,null))['catch'](handleError(_0x3d65a9,null));};exports[_0x6477('0x1e')]=function(_0x26f4f8,_0x4f3169){return db['SAOrder'][_0x6477('0x45')]({'where':{'id':_0x26f4f8[_0x6477('0x44')]['id']}})[_0x6477('0x1f')](handleEntityNotFound(_0x4f3169,null))[_0x6477('0x1f')](removeEntity(_0x4f3169,null))[_0x6477('0x3f')](handleError(_0x4f3169,null));};exports[_0x6477('0x46')]=function(_0x5c554f,_0x1338d6){return db['SAOrder'][_0x6477('0x46')]()[_0x6477('0x1f')](respondWithResult(_0x1338d6,null))['catch'](handleError(_0x1338d6,null));}; \ No newline at end of file +var _0xeb99=['lodash','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','reject','update','then','destroy','error','name','send','index','SAOrder','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','key','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xeb99,0x1d6));var _0x9eb9=function(_0x477752,_0x564b7d){_0x477752=_0x477752-0x0;var _0x439c7c=_0xeb99[_0x477752];return _0x439c7c;};'use strict';var pdf=require(_0x9eb9('0x0'));var emlformat=require(_0x9eb9('0x1'));var rimraf=require(_0x9eb9('0x2'));var zipdir=require(_0x9eb9('0x3'));var jsonpatch=require(_0x9eb9('0x4'));var rp=require(_0x9eb9('0x5'));var moment=require(_0x9eb9('0x6'));var BPromise=require(_0x9eb9('0x7'));var Mustache=require(_0x9eb9('0x8'));var util=require(_0x9eb9('0x9'));var path=require('path');var sox=require(_0x9eb9('0xa'));var csv=require(_0x9eb9('0xb'));var ejs=require(_0x9eb9('0xc'));var fs=require('fs');var _=require(_0x9eb9('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9eb9('0xe'));var toCsv=require(_0x9eb9('0xb'));var querystring=require(_0x9eb9('0xf'));var Papa=require(_0x9eb9('0x10'));var Redis=require(_0x9eb9('0x11'));var authService=require(_0x9eb9('0x12'));var qs=require(_0x9eb9('0x13'));var hardwareService=require(_0x9eb9('0x14'));var logger=require(_0x9eb9('0x15'))(_0x9eb9('0x16'));var utils=require('../../config/utils');var config=require(_0x9eb9('0x17'));var db=require(_0x9eb9('0x18'))['db'];function respondWithStatusCode(_0x55e6e3,_0x3140e3){_0x3140e3=_0x3140e3||0xcc;return function(_0x23ba46){if(_0x23ba46){return _0x55e6e3[_0x9eb9('0x19')](_0x3140e3);}return _0x55e6e3[_0x9eb9('0x1a')](_0x3140e3)[_0x9eb9('0x1b')]();};}function respondWithResult(_0x42ab16,_0x71451a){_0x71451a=_0x71451a||0xc8;return function(_0x8c64ca){if(_0x8c64ca){return _0x42ab16[_0x9eb9('0x1a')](_0x71451a)[_0x9eb9('0x1c')](_0x8c64ca);}};}function respondWithFilteredResult(_0x28cf25,_0x36266e){return function(_0x219f8b){if(_0x219f8b){var _0x197110=_0x219f8b[_0x9eb9('0x1d')],_0x518b7a=_0x36266e[_0x9eb9('0x1e')],_0x3caee8=_0x36266e[_0x9eb9('0x1e')]+_0x36266e[_0x9eb9('0x1f')],_0xf5f544;if(_0x3caee8>=_0x197110){_0x3caee8=_0x197110;_0xf5f544=0xc8;}else{_0xf5f544=0xce;}_0x28cf25[_0x9eb9('0x1a')](_0xf5f544);return _0x28cf25[_0x9eb9('0x20')]('Content-Range',_0x518b7a+'-'+_0x3caee8+'/'+_0x197110)[_0x9eb9('0x1c')](_0x219f8b);}return null;};}function patchUpdates(_0x4eb4b){return function(_0x2fee63){try{jsonpatch['apply'](_0x2fee63,_0x4eb4b,!![]);}catch(_0x16d386){return BPromise[_0x9eb9('0x21')](_0x16d386);}return _0x2fee63['save']();};}function saveUpdates(_0x4f5335,_0x33163e){return function(_0x5854f5){if(_0x5854f5){return _0x5854f5[_0x9eb9('0x22')](_0x4f5335)[_0x9eb9('0x23')](function(_0x103acb){return _0x103acb;});}return null;};}function removeEntity(_0x24e83a,_0x32d76f){return function(_0x2665be){if(_0x2665be){return _0x2665be[_0x9eb9('0x24')]()['then'](function(){_0x24e83a[_0x9eb9('0x1a')](0xcc)[_0x9eb9('0x1b')]();});}};}function handleEntityNotFound(_0x33329b,_0x1bf08c){return function(_0x1904a5){if(!_0x1904a5){_0x33329b[_0x9eb9('0x19')](0x194);}return _0x1904a5;};}function handleError(_0x1f1358,_0x20f900){_0x20f900=_0x20f900||0x1f4;return function(_0x4294ff){logger[_0x9eb9('0x25')](_0x4294ff['stack']);if(_0x4294ff[_0x9eb9('0x26')]){delete _0x4294ff[_0x9eb9('0x26')];}_0x1f1358[_0x9eb9('0x1a')](_0x20f900)[_0x9eb9('0x27')](_0x4294ff);};}exports[_0x9eb9('0x28')]=function(_0x18d582,_0x43f7ba){var _0xb58dd5={},_0x4f2348={},_0x490132={'count':0x0,'rows':[]};var _0x2b79d8=db[_0x9eb9('0x29')][_0x9eb9('0x2a')];_0x4f2348[_0x9eb9('0x2b')]=_[_0x9eb9('0x2c')](_0x2b79d8);_0x4f2348[_0x9eb9('0x2d')]=_[_0x9eb9('0x2c')](_0x18d582[_0x9eb9('0x2d')]);_0x4f2348[_0x9eb9('0x2e')]=_[_0x9eb9('0x2f')](_0x4f2348[_0x9eb9('0x2b')],_0x4f2348['query']);_0xb58dd5[_0x9eb9('0x30')]=_[_0x9eb9('0x2f')](_0x4f2348[_0x9eb9('0x2b')],qs['fields'](_0x18d582[_0x9eb9('0x2d')][_0x9eb9('0x31')]));_0xb58dd5[_0x9eb9('0x30')]=_0xb58dd5[_0x9eb9('0x30')][_0x9eb9('0x32')]?_0xb58dd5[_0x9eb9('0x30')]:_0x4f2348[_0x9eb9('0x2b')];if(!_0x18d582[_0x9eb9('0x2d')][_0x9eb9('0x33')]('nolimit')){_0xb58dd5[_0x9eb9('0x1f')]=qs[_0x9eb9('0x1f')](_0x18d582['query'][_0x9eb9('0x1f')]);_0xb58dd5[_0x9eb9('0x1e')]=qs[_0x9eb9('0x1e')](_0x18d582['query']['offset']);}_0xb58dd5['order']=qs[_0x9eb9('0x34')](_0x18d582[_0x9eb9('0x2d')]['sort']);_0xb58dd5[_0x9eb9('0x35')]=qs[_0x9eb9('0x2e')](_[_0x9eb9('0x36')](_0x18d582['query'],_0x4f2348['filters']));if(_0x18d582[_0x9eb9('0x2d')][_0x9eb9('0x37')]){_0xb58dd5[_0x9eb9('0x35')]=_[_0x9eb9('0x38')](_0xb58dd5['where'],{'$or':_['map'](_0x2b79d8,function(_0xfc6840){if(_0xfc6840['type'][_0x9eb9('0x39')]!==_0x9eb9('0x3a')){var _0xd5e8bb={};_0xd5e8bb[_0xfc6840['field']]={'$like':'%'+_0x18d582[_0x9eb9('0x2d')][_0x9eb9('0x37')]+'%'};return _0xd5e8bb;}})});}_0xb58dd5=_[_0x9eb9('0x38')]({},_0xb58dd5,_0x18d582[_0x9eb9('0x3b')]);var _0x4d4825={'where':_0xb58dd5['where']};return db[_0x9eb9('0x29')][_0x9eb9('0x1d')](_0x4d4825)['then'](function(_0x4b51f1){_0x490132[_0x9eb9('0x1d')]=_0x4b51f1;if(_0x18d582[_0x9eb9('0x2d')][_0x9eb9('0x3c')]){_0xb58dd5[_0x9eb9('0x3d')]=[{'all':!![]}];}return db['SAOrder'][_0x9eb9('0x3e')](_0xb58dd5);})[_0x9eb9('0x23')](function(_0xf2b9a6){_0x490132[_0x9eb9('0x3f')]=_0xf2b9a6;return _0x490132;})[_0x9eb9('0x23')](respondWithFilteredResult(_0x43f7ba,_0xb58dd5))[_0x9eb9('0x40')](handleError(_0x43f7ba,null));};exports['show']=function(_0x2143c9,_0x487dea){var _0x586c9c={'raw':![],'where':{'id':_0x2143c9['params']['id']}},_0x4c4367={};_0x4c4367[_0x9eb9('0x2b')]=_['keys'](db[_0x9eb9('0x29')][_0x9eb9('0x2a')]);_0x4c4367[_0x9eb9('0x2d')]=_[_0x9eb9('0x2c')](_0x2143c9[_0x9eb9('0x2d')]);_0x4c4367['filters']=_['intersection'](_0x4c4367['model'],_0x4c4367[_0x9eb9('0x2d')]);_0x586c9c[_0x9eb9('0x30')]=_[_0x9eb9('0x2f')](_0x4c4367[_0x9eb9('0x2b')],qs['fields'](_0x2143c9[_0x9eb9('0x2d')][_0x9eb9('0x31')]));_0x586c9c[_0x9eb9('0x30')]=_0x586c9c[_0x9eb9('0x30')]['length']?_0x586c9c[_0x9eb9('0x30')]:_0x4c4367['model'];if(_0x2143c9['query'][_0x9eb9('0x3c')]){_0x586c9c[_0x9eb9('0x3d')]=[{'all':!![]}];}_0x586c9c=_[_0x9eb9('0x38')]({},_0x586c9c,_0x2143c9[_0x9eb9('0x3b')]);return db[_0x9eb9('0x29')][_0x9eb9('0x41')](_0x586c9c)[_0x9eb9('0x23')](handleEntityNotFound(_0x487dea,null))[_0x9eb9('0x23')](respondWithResult(_0x487dea,null))['catch'](handleError(_0x487dea,null));};exports['create']=function(_0x4edf8c,_0x3d3809){return db['SAOrder']['create'](_0x4edf8c[_0x9eb9('0x42')],{})['then'](respondWithResult(_0x3d3809,0xc9))[_0x9eb9('0x40')](handleError(_0x3d3809,null));};exports[_0x9eb9('0x22')]=function(_0x15d88a,_0x1e4113){if(_0x15d88a[_0x9eb9('0x42')]['id']){delete _0x15d88a[_0x9eb9('0x42')]['id'];}return db[_0x9eb9('0x29')][_0x9eb9('0x41')]({'where':{'id':_0x15d88a[_0x9eb9('0x43')]['id']}})[_0x9eb9('0x23')](handleEntityNotFound(_0x1e4113,null))[_0x9eb9('0x23')](saveUpdates(_0x15d88a[_0x9eb9('0x42')],null))['then'](respondWithResult(_0x1e4113,null))[_0x9eb9('0x40')](handleError(_0x1e4113,null));};exports[_0x9eb9('0x24')]=function(_0x19defd,_0x643859){return db[_0x9eb9('0x29')]['find']({'where':{'id':_0x19defd[_0x9eb9('0x43')]['id']}})[_0x9eb9('0x23')](handleEntityNotFound(_0x643859,null))[_0x9eb9('0x23')](removeEntity(_0x643859,null))[_0x9eb9('0x40')](handleError(_0x643859,null));};exports[_0x9eb9('0x44')]=function(_0x5656f0,_0x55e689){return db['SAOrder'][_0x9eb9('0x44')]()[_0x9eb9('0x23')](respondWithResult(_0x55e689,null))[_0x9eb9('0x40')](handleError(_0x55e689,null));}; \ No newline at end of file diff --git a/server/api/saOrder/saOrder.model.js b/server/api/saOrder/saOrder.model.js index e4640f4..6a4cd73 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 _0x7894=['../../config/logger','bluebird','request-promise','path','rimraf','./saOrder.attributes','define','SAOrder','lodash','util'];(function(_0x14d250,_0x4b2e12){var _0xb991d8=function(_0x4ea76d){while(--_0x4ea76d){_0x14d250['push'](_0x14d250['shift']());}};_0xb991d8(++_0x4b2e12);}(_0x7894,0x8a));var _0x4789=function(_0x41b167,_0x31bf22){_0x41b167=_0x41b167-0x0;var _0x1c02c9=_0x7894[_0x41b167];return _0x1c02c9;};'use strict';var _=require(_0x4789('0x0'));var util=require(_0x4789('0x1'));var logger=require(_0x4789('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4789('0x3'));var rp=require(_0x4789('0x4'));var fs=require('fs');var path=require(_0x4789('0x5'));var rimraf=require(_0x4789('0x6'));var config=require('../../config/environment');var attributes=require(_0x4789('0x7'));module['exports']=function(_0x3eaa25,_0x10a00a){return _0x3eaa25[_0x4789('0x8')](_0x4789('0x9'),attributes,{'tableName':'sa_orders','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe9b5=['define','SAOrder','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./saOrder.attributes','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xe9b5,0xc6));var _0x5e9b=function(_0x20ac19,_0x3a5b29){_0x20ac19=_0x20ac19-0x0;var _0x5be9c6=_0xe9b5[_0x20ac19];return _0x5be9c6;};'use strict';var _=require(_0x5e9b('0x0'));var util=require(_0x5e9b('0x1'));var logger=require(_0x5e9b('0x2'))(_0x5e9b('0x3'));var moment=require(_0x5e9b('0x4'));var BPromise=require(_0x5e9b('0x5'));var rp=require(_0x5e9b('0x6'));var fs=require('fs');var path=require(_0x5e9b('0x7'));var rimraf=require(_0x5e9b('0x8'));var config=require(_0x5e9b('0x9'));var attributes=require(_0x5e9b('0xa'));module[_0x5e9b('0xb')]=function(_0xbae8f7,_0x1a9da5){return _0xbae8f7[_0x5e9b('0xc')](_0x5e9b('0xd'),attributes,{'tableName':'sa_orders','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 69b0bd4..d1a0795 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 _0xf4ae=['message','SAOrder,\x20%s,\x20%s','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','request','then','info','request\x20sent','debug','stringify','error','code'];(function(_0x253510,_0x49ce45){var _0x188b67=function(_0x114b51){while(--_0x114b51){_0x253510['push'](_0x253510['shift']());}};_0x188b67(++_0x49ce45);}(_0xf4ae,0x143));var _0xef4a=function(_0x4ded65,_0xc8d7c1){_0x4ded65=_0x4ded65-0x0;var _0x5864fb=_0xf4ae[_0x4ded65];return _0x5864fb;};'use strict';var _=require(_0xef4a('0x0'));var util=require(_0xef4a('0x1'));var moment=require(_0xef4a('0x2'));var BPromise=require('bluebird');var rs=require(_0xef4a('0x3'));var fs=require('fs');var Redis=require(_0xef4a('0x4'));var db=require(_0xef4a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xef4a('0x6'))(_0xef4a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xef4a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa608e7,_0xc03395,_0x2d0e46){return new BPromise(function(_0x4198fc,_0x37a1f6){return client[_0xef4a('0x9')](_0xa608e7,_0x2d0e46)[_0xef4a('0xa')](function(_0x3d3ed9){logger[_0xef4a('0xb')]('SAOrder,\x20%s,\x20%s',_0xc03395,_0xef4a('0xc'));logger[_0xef4a('0xd')]('SAOrder,\x20%s,\x20%s,\x20%s',_0xc03395,_0xef4a('0xc'),JSON[_0xef4a('0xe')](_0x3d3ed9));if(_0x3d3ed9['error']){if(_0x3d3ed9[_0xef4a('0xf')][_0xef4a('0x10')]===0x1f4){logger[_0xef4a('0xf')]('SAOrder,\x20%s,\x20%s',_0xc03395,_0x3d3ed9['error']['message']);return _0x37a1f6(_0x3d3ed9[_0xef4a('0xf')][_0xef4a('0x11')]);}logger['error'](_0xef4a('0x12'),_0xc03395,_0x3d3ed9['error'][_0xef4a('0x11')]);return _0x4198fc(_0x3d3ed9[_0xef4a('0xf')][_0xef4a('0x11')]);}else{logger['info'](_0xef4a('0x12'),_0xc03395,_0xef4a('0xc'));_0x4198fc(_0x3d3ed9['result']['message']);}})[_0xef4a('0x13')](function(_0x22b3d0){logger[_0xef4a('0xf')]('SAOrder,\x20%s,\x20%s',_0xc03395,_0x22b3d0);_0x37a1f6(_0x22b3d0);});});} \ No newline at end of file +var _0x3f95=['jayson/promise','client','http','request','SAOrder,\x20%s,\x20%s','request\x20sent','debug','SAOrder,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x4dd660,_0x570c91){var _0x1e047c=function(_0x4e48b0){while(--_0x4e48b0){_0x4dd660['push'](_0x4dd660['shift']());}};_0x1e047c(++_0x570c91);}(_0x3f95,0x108));var _0x53f9=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x3f95[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x53f9('0x0'));var util=require(_0x53f9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x53f9('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x53f9('0x3'));var logger=require(_0x53f9('0x4'))(_0x53f9('0x5'));var config=require('../../config/environment');var jayson=require(_0x53f9('0x6'));var client=jayson[_0x53f9('0x7')][_0x53f9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b35e7,_0x5b3fc8,_0x3bdd22){return new BPromise(function(_0x577bb2,_0x3f0821){return client[_0x53f9('0x9')](_0x1b35e7,_0x3bdd22)['then'](function(_0xaa49c3){logger['info'](_0x53f9('0xa'),_0x5b3fc8,_0x53f9('0xb'));logger[_0x53f9('0xc')](_0x53f9('0xd'),_0x5b3fc8,_0x53f9('0xb'),JSON[_0x53f9('0xe')](_0xaa49c3));if(_0xaa49c3[_0x53f9('0xf')]){if(_0xaa49c3['error']['code']===0x1f4){logger[_0x53f9('0xf')]('SAOrder,\x20%s,\x20%s',_0x5b3fc8,_0xaa49c3[_0x53f9('0xf')][_0x53f9('0x10')]);return _0x3f0821(_0xaa49c3[_0x53f9('0xf')][_0x53f9('0x10')]);}logger[_0x53f9('0xf')]('SAOrder,\x20%s,\x20%s',_0x5b3fc8,_0xaa49c3[_0x53f9('0xf')][_0x53f9('0x10')]);return _0x577bb2(_0xaa49c3['error'][_0x53f9('0x10')]);}else{logger['info']('SAOrder,\x20%s,\x20%s',_0x5b3fc8,_0x53f9('0xb'));_0x577bb2(_0xaa49c3[_0x53f9('0x11')][_0x53f9('0x10')]);}})['catch'](function(_0x48fbc4){logger[_0x53f9('0xf')](_0x53f9('0xa'),_0x5b3fc8,_0x48fbc4);_0x3f0821(_0x48fbc4);});});} \ No newline at end of file diff --git a/server/api/saPayment/index.js b/server/api/saPayment/index.js index 5f061c4..bf64d19 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 _0x80c4=['show','post','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./saPayment.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x38c560,_0x1622b3){var _0x1bd405=function(_0x27ea3f){while(--_0x27ea3f){_0x38c560['push'](_0x38c560['shift']());}};_0x1bd405(++_0x1622b3);}(_0x80c4,0xa3));var _0x480c=function(_0x8e55c1,_0x52120c){_0x8e55c1=_0x8e55c1-0x0;var _0xd64c90=_0x80c4[_0x8e55c1];return _0xd64c90;};'use strict';var multer=require(_0x480c('0x0'));var util=require('util');var path=require(_0x480c('0x1'));var timeout=require(_0x480c('0x2'));var express=require(_0x480c('0x3'));var router=express[_0x480c('0x4')]();var auth=require(_0x480c('0x5'));var interaction=require(_0x480c('0x6'));var config=require('../../config/environment');var controller=require(_0x480c('0x7'));router[_0x480c('0x8')]('/',auth[_0x480c('0x9')](),controller[_0x480c('0xa')]);router[_0x480c('0x8')](_0x480c('0xb'),auth[_0x480c('0x9')](),controller[_0x480c('0xc')]);router[_0x480c('0x8')]('/:id',auth[_0x480c('0x9')](),controller[_0x480c('0xd')]);router[_0x480c('0xe')]('/',auth[_0x480c('0x9')](),controller[_0x480c('0xf')]);router[_0x480c('0x10')](_0x480c('0x11'),auth[_0x480c('0x9')](),controller[_0x480c('0x12')]);router[_0x480c('0x13')](_0x480c('0x11'),auth[_0x480c('0x9')](),controller[_0x480c('0x14')]);module[_0x480c('0x15')]=router; \ No newline at end of file +var _0x8212=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./saPayment.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','multer'];(function(_0x6f5598,_0xabeb74){var _0x1e1325=function(_0x1da246){while(--_0x1da246){_0x6f5598['push'](_0x6f5598['shift']());}};_0x1e1325(++_0xabeb74);}(_0x8212,0xb3));var _0x2821=function(_0x281572,_0x5066c0){_0x281572=_0x281572-0x0;var _0x3f98fb=_0x8212[_0x281572];return _0x3f98fb;};'use strict';var multer=require(_0x2821('0x0'));var util=require(_0x2821('0x1'));var path=require('path');var timeout=require(_0x2821('0x2'));var express=require(_0x2821('0x3'));var router=express[_0x2821('0x4')]();var auth=require(_0x2821('0x5'));var interaction=require(_0x2821('0x6'));var config=require(_0x2821('0x7'));var controller=require(_0x2821('0x8'));router[_0x2821('0x9')]('/',auth['isAuthenticated'](),controller[_0x2821('0xa')]);router['get'](_0x2821('0xb'),auth[_0x2821('0xc')](),controller['describe']);router[_0x2821('0x9')](_0x2821('0xd'),auth[_0x2821('0xc')](),controller[_0x2821('0xe')]);router[_0x2821('0xf')]('/',auth[_0x2821('0xc')](),controller[_0x2821('0x10')]);router[_0x2821('0x11')](_0x2821('0xd'),auth['isAuthenticated'](),controller[_0x2821('0x12')]);router[_0x2821('0x13')](_0x2821('0xd'),auth['isAuthenticated'](),controller['destroy']);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 6ed7cd5..70b8c46 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 _0x0369=['exports','DECIMAL','TEXT','INTEGER','sequelize'];(function(_0x49b473,_0x5cb5e6){var _0x479fbc=function(_0x59d157){while(--_0x59d157){_0x49b473['push'](_0x49b473['shift']());}};_0x479fbc(++_0x5cb5e6);}(_0x0369,0x77));var _0x9036=function(_0x4060e2,_0x58a7bd){_0x4060e2=_0x4060e2-0x0;var _0x3bbcb2=_0x0369[_0x4060e2];return _0x3bbcb2;};'use strict';var Sequelize=require(_0x9036('0x0'));module[_0x9036('0x1')]={'payment':{'type':Sequelize[_0x9036('0x2')](0xd,0x4),'allowNull':![]},'note':{'type':Sequelize[_0x9036('0x3')]},'companyId':{'type':Sequelize[_0x9036('0x4')]},'companyName':{'type':Sequelize[_0x9036('0x3')]},'paymentMethod':{'type':Sequelize[_0x9036('0x3')]},'agentFullname':{'type':Sequelize['STRING']},'paymentDate':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x9d02=['DECIMAL','INTEGER','TEXT','STRING','DATE','sequelize'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x9d02,0x77));var _0x29d0=function(_0x1694d6,_0xd2e056){_0x1694d6=_0x1694d6-0x0;var _0x19f811=_0x9d02[_0x1694d6];return _0x19f811;};'use strict';var Sequelize=require(_0x29d0('0x0'));module['exports']={'payment':{'type':Sequelize[_0x29d0('0x1')](0xd,0x4),'allowNull':![]},'note':{'type':Sequelize['TEXT']},'companyId':{'type':Sequelize[_0x29d0('0x2')]},'companyName':{'type':Sequelize[_0x29d0('0x3')]},'paymentMethod':{'type':Sequelize[_0x29d0('0x3')]},'agentFullname':{'type':Sequelize[_0x29d0('0x4')]},'paymentDate':{'type':Sequelize[_0x29d0('0x5')]}}; \ No newline at end of file diff --git a/server/api/saPayment/saPayment.controller.js b/server/api/saPayment/saPayment.controller.js index f1b4a38..288b6c9 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 _0xaad1=['query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','include','findAll','rows','catch','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','reject','update','then','destroy','stack','name','send','index','SAPayment','rawAttributes','keys'];(function(_0x48f6ee,_0x1b1fb){var _0x433ce5=function(_0x3020af){while(--_0x3020af){_0x48f6ee['push'](_0x48f6ee['shift']());}};_0x433ce5(++_0x1b1fb);}(_0xaad1,0xa5));var _0x1aad=function(_0x31bc74,_0x371378){_0x31bc74=_0x31bc74-0x0;var _0x479f2a=_0xaad1[_0x31bc74];return _0x479f2a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1aad('0x0'));var rimraf=require(_0x1aad('0x1'));var zipdir=require(_0x1aad('0x2'));var jsonpatch=require(_0x1aad('0x3'));var rp=require(_0x1aad('0x4'));var moment=require(_0x1aad('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1aad('0x6'));var path=require(_0x1aad('0x7'));var sox=require('sox');var csv=require(_0x1aad('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1aad('0x9'));var squel=require(_0x1aad('0xa'));var crypto=require(_0x1aad('0xb'));var jsforce=require(_0x1aad('0xc'));var deskjs=require(_0x1aad('0xd'));var toCsv=require(_0x1aad('0x8'));var querystring=require('querystring');var Papa=require(_0x1aad('0xe'));var Redis=require(_0x1aad('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1aad('0x10'));var hardwareService=require(_0x1aad('0x11'));var logger=require(_0x1aad('0x12'))(_0x1aad('0x13'));var utils=require(_0x1aad('0x14'));var config=require(_0x1aad('0x15'));var db=require(_0x1aad('0x16'))['db'];function respondWithStatusCode(_0xcca55e,_0x3e071f){_0x3e071f=_0x3e071f||0xcc;return function(_0x34794a){if(_0x34794a){return _0xcca55e[_0x1aad('0x17')](_0x3e071f);}return _0xcca55e['status'](_0x3e071f)[_0x1aad('0x18')]();};}function respondWithResult(_0x463b07,_0x56025a){_0x56025a=_0x56025a||0xc8;return function(_0x2bcaba){if(_0x2bcaba){return _0x463b07[_0x1aad('0x19')](_0x56025a)[_0x1aad('0x1a')](_0x2bcaba);}};}function respondWithFilteredResult(_0x268cf2,_0x2bef95){return function(_0x167a3a){if(_0x167a3a){var _0x4025e4=_0x167a3a[_0x1aad('0x1b')],_0x7ae48a=_0x2bef95['offset'],_0x37ff22=_0x2bef95[_0x1aad('0x1c')]+_0x2bef95[_0x1aad('0x1d')],_0x1718b3;if(_0x37ff22>=_0x4025e4){_0x37ff22=_0x4025e4;_0x1718b3=0xc8;}else{_0x1718b3=0xce;}_0x268cf2['status'](_0x1718b3);return _0x268cf2['set'](_0x1aad('0x1e'),_0x7ae48a+'-'+_0x37ff22+'/'+_0x4025e4)[_0x1aad('0x1a')](_0x167a3a);}return null;};}function patchUpdates(_0x20fcb5){return function(_0x1eecad){try{jsonpatch['apply'](_0x1eecad,_0x20fcb5,!![]);}catch(_0x3296e8){return BPromise[_0x1aad('0x1f')](_0x3296e8);}return _0x1eecad['save']();};}function saveUpdates(_0x2d0534,_0x2bf41a){return function(_0x3db50a){if(_0x3db50a){return _0x3db50a[_0x1aad('0x20')](_0x2d0534)[_0x1aad('0x21')](function(_0x14ef2e){return _0x14ef2e;});}return null;};}function removeEntity(_0x4b6167,_0x61f171){return function(_0x5263a9){if(_0x5263a9){return _0x5263a9[_0x1aad('0x22')]()['then'](function(){_0x4b6167['status'](0xcc)[_0x1aad('0x18')]();});}};}function handleEntityNotFound(_0x3e2c49,_0x59284e){return function(_0x534ea4){if(!_0x534ea4){_0x3e2c49[_0x1aad('0x17')](0x194);}return _0x534ea4;};}function handleError(_0x29ee93,_0x3262af){_0x3262af=_0x3262af||0x1f4;return function(_0x5cd549){logger['error'](_0x5cd549[_0x1aad('0x23')]);if(_0x5cd549[_0x1aad('0x24')]){delete _0x5cd549[_0x1aad('0x24')];}_0x29ee93[_0x1aad('0x19')](_0x3262af)[_0x1aad('0x25')](_0x5cd549);};}exports[_0x1aad('0x26')]=function(_0x17fb6b,_0x221559){var _0x59743a={},_0x36b12d={},_0x167e4d={'count':0x0,'rows':[]};var _0x5e2234=db[_0x1aad('0x27')][_0x1aad('0x28')];_0x36b12d['model']=_[_0x1aad('0x29')](_0x5e2234);_0x36b12d[_0x1aad('0x2a')]=_[_0x1aad('0x29')](_0x17fb6b['query']);_0x36b12d[_0x1aad('0x2b')]=_[_0x1aad('0x2c')](_0x36b12d[_0x1aad('0x2d')],_0x36b12d[_0x1aad('0x2a')]);_0x59743a[_0x1aad('0x2e')]=_[_0x1aad('0x2c')](_0x36b12d[_0x1aad('0x2d')],qs[_0x1aad('0x2f')](_0x17fb6b['query'][_0x1aad('0x2f')]));_0x59743a[_0x1aad('0x2e')]=_0x59743a['attributes'][_0x1aad('0x30')]?_0x59743a[_0x1aad('0x2e')]:_0x36b12d[_0x1aad('0x2d')];if(!_0x17fb6b[_0x1aad('0x2a')][_0x1aad('0x31')](_0x1aad('0x32'))){_0x59743a[_0x1aad('0x1d')]=qs[_0x1aad('0x1d')](_0x17fb6b[_0x1aad('0x2a')]['limit']);_0x59743a[_0x1aad('0x1c')]=qs[_0x1aad('0x1c')](_0x17fb6b['query']['offset']);}_0x59743a['order']=qs['sort'](_0x17fb6b['query']['sort']);_0x59743a[_0x1aad('0x33')]=qs[_0x1aad('0x2b')](_[_0x1aad('0x34')](_0x17fb6b[_0x1aad('0x2a')],_0x36b12d[_0x1aad('0x2b')]));if(_0x17fb6b[_0x1aad('0x2a')][_0x1aad('0x35')]){_0x59743a[_0x1aad('0x33')]=_[_0x1aad('0x36')](_0x59743a[_0x1aad('0x33')],{'$or':_[_0x1aad('0x37')](_0x5e2234,function(_0x32424a){if(_0x32424a[_0x1aad('0x38')][_0x1aad('0x39')]!==_0x1aad('0x3a')){var _0x4c1614={};_0x4c1614[_0x32424a[_0x1aad('0x3b')]]={'$like':'%'+_0x17fb6b[_0x1aad('0x2a')][_0x1aad('0x35')]+'%'};return _0x4c1614;}})});}_0x59743a=_[_0x1aad('0x36')]({},_0x59743a,_0x17fb6b[_0x1aad('0x3c')]);var _0x3d4f18={'where':_0x59743a[_0x1aad('0x33')]};return db['SAPayment'][_0x1aad('0x1b')](_0x3d4f18)[_0x1aad('0x21')](function(_0x44fb32){_0x167e4d['count']=_0x44fb32;if(_0x17fb6b[_0x1aad('0x2a')]['includeAll']){_0x59743a[_0x1aad('0x3d')]=[{'all':!![]}];}return db[_0x1aad('0x27')][_0x1aad('0x3e')](_0x59743a);})[_0x1aad('0x21')](function(_0x5bc032){_0x167e4d[_0x1aad('0x3f')]=_0x5bc032;return _0x167e4d;})[_0x1aad('0x21')](respondWithFilteredResult(_0x221559,_0x59743a))[_0x1aad('0x40')](handleError(_0x221559,null));};exports['show']=function(_0x4fed1f,_0x932022){var _0x57a055={'raw':![],'where':{'id':_0x4fed1f[_0x1aad('0x41')]['id']}},_0x43c4fa={};_0x43c4fa['model']=_['keys'](db[_0x1aad('0x27')]['rawAttributes']);_0x43c4fa['query']=_[_0x1aad('0x29')](_0x4fed1f[_0x1aad('0x2a')]);_0x43c4fa['filters']=_[_0x1aad('0x2c')](_0x43c4fa[_0x1aad('0x2d')],_0x43c4fa[_0x1aad('0x2a')]);_0x57a055[_0x1aad('0x2e')]=_[_0x1aad('0x2c')](_0x43c4fa[_0x1aad('0x2d')],qs[_0x1aad('0x2f')](_0x4fed1f[_0x1aad('0x2a')][_0x1aad('0x2f')]));_0x57a055['attributes']=_0x57a055[_0x1aad('0x2e')][_0x1aad('0x30')]?_0x57a055[_0x1aad('0x2e')]:_0x43c4fa[_0x1aad('0x2d')];if(_0x4fed1f['query']['includeAll']){_0x57a055[_0x1aad('0x3d')]=[{'all':!![]}];}_0x57a055=_[_0x1aad('0x36')]({},_0x57a055,_0x4fed1f['options']);return db[_0x1aad('0x27')][_0x1aad('0x42')](_0x57a055)['then'](handleEntityNotFound(_0x932022,null))[_0x1aad('0x21')](respondWithResult(_0x932022,null))[_0x1aad('0x40')](handleError(_0x932022,null));};exports[_0x1aad('0x43')]=function(_0x3bbe1f,_0x51770c){return db['SAPayment'][_0x1aad('0x43')](_0x3bbe1f[_0x1aad('0x44')],{})[_0x1aad('0x21')](respondWithResult(_0x51770c,0xc9))[_0x1aad('0x40')](handleError(_0x51770c,null));};exports[_0x1aad('0x20')]=function(_0x5ad207,_0x11bacd){if(_0x5ad207[_0x1aad('0x44')]['id']){delete _0x5ad207[_0x1aad('0x44')]['id'];}return db[_0x1aad('0x27')][_0x1aad('0x42')]({'where':{'id':_0x5ad207['params']['id']}})[_0x1aad('0x21')](handleEntityNotFound(_0x11bacd,null))['then'](saveUpdates(_0x5ad207[_0x1aad('0x44')],null))[_0x1aad('0x21')](respondWithResult(_0x11bacd,null))[_0x1aad('0x40')](handleError(_0x11bacd,null));};exports[_0x1aad('0x22')]=function(_0x2705d6,_0x3be664){return db[_0x1aad('0x27')][_0x1aad('0x42')]({'where':{'id':_0x2705d6[_0x1aad('0x41')]['id']}})[_0x1aad('0x21')](handleEntityNotFound(_0x3be664,null))['then'](removeEntity(_0x3be664,null))[_0x1aad('0x40')](handleError(_0x3be664,null));};exports['describe']=function(_0x11a5a6,_0xc98d77){return db[_0x1aad('0x27')]['describe']()['then'](respondWithResult(_0xc98d77,null))[_0x1aad('0x40')](handleError(_0xc98d77,null));}; \ No newline at end of file +var _0xf861=['pick','where','type','key','VIRTUAL','field','merge','options','includeAll','include','SAPayment','catch','show','params','keys','create','body','find','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','update','then','destroy','end','stack','name','send','index','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort'];(function(_0x563442,_0x23397a){var _0x1960bd=function(_0x2fec85){while(--_0x2fec85){_0x563442['push'](_0x563442['shift']());}};_0x1960bd(++_0x23397a);}(_0xf861,0x127));var _0x1f86=function(_0x20f82a,_0x5337a6){_0x20f82a=_0x20f82a-0x0;var _0x1e481b=_0xf861[_0x20f82a];return _0x1e481b;};'use strict';var pdf=require(_0x1f86('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1f86('0x1'));var zipdir=require(_0x1f86('0x2'));var jsonpatch=require(_0x1f86('0x3'));var rp=require(_0x1f86('0x4'));var moment=require(_0x1f86('0x5'));var BPromise=require(_0x1f86('0x6'));var Mustache=require(_0x1f86('0x7'));var util=require(_0x1f86('0x8'));var path=require(_0x1f86('0x9'));var sox=require(_0x1f86('0xa'));var csv=require(_0x1f86('0xb'));var ejs=require(_0x1f86('0xc'));var fs=require('fs');var _=require(_0x1f86('0xd'));var squel=require('squel');var crypto=require(_0x1f86('0xe'));var jsforce=require(_0x1f86('0xf'));var deskjs=require(_0x1f86('0x10'));var toCsv=require(_0x1f86('0xb'));var querystring=require('querystring');var Papa=require(_0x1f86('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1f86('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1f86('0x13'));var utils=require('../../config/utils');var config=require(_0x1f86('0x14'));var db=require(_0x1f86('0x15'))['db'];function respondWithStatusCode(_0x363546,_0x2afa2e){_0x2afa2e=_0x2afa2e||0xcc;return function(_0x1c2424){if(_0x1c2424){return _0x363546[_0x1f86('0x16')](_0x2afa2e);}return _0x363546[_0x1f86('0x17')](_0x2afa2e)['end']();};}function respondWithResult(_0x21a8d4,_0x2cc554){_0x2cc554=_0x2cc554||0xc8;return function(_0x47fa0a){if(_0x47fa0a){return _0x21a8d4[_0x1f86('0x17')](_0x2cc554)[_0x1f86('0x18')](_0x47fa0a);}};}function respondWithFilteredResult(_0x55a1e2,_0x40944f){return function(_0x2365c4){if(_0x2365c4){var _0x4abd8e=_0x2365c4[_0x1f86('0x19')],_0x26cef7=_0x40944f[_0x1f86('0x1a')],_0xdef2aa=_0x40944f['offset']+_0x40944f['limit'],_0x153972;if(_0xdef2aa>=_0x4abd8e){_0xdef2aa=_0x4abd8e;_0x153972=0xc8;}else{_0x153972=0xce;}_0x55a1e2[_0x1f86('0x17')](_0x153972);return _0x55a1e2[_0x1f86('0x1b')](_0x1f86('0x1c'),_0x26cef7+'-'+_0xdef2aa+'/'+_0x4abd8e)['json'](_0x2365c4);}return null;};}function patchUpdates(_0x43769a){return function(_0x1f5ca5){try{jsonpatch[_0x1f86('0x1d')](_0x1f5ca5,_0x43769a,!![]);}catch(_0x240261){return BPromise['reject'](_0x240261);}return _0x1f5ca5['save']();};}function saveUpdates(_0x54645e,_0x404518){return function(_0x26f8ea){if(_0x26f8ea){return _0x26f8ea[_0x1f86('0x1e')](_0x54645e)[_0x1f86('0x1f')](function(_0x178b61){return _0x178b61;});}return null;};}function removeEntity(_0x1f9f96,_0x2e7530){return function(_0x58b36c){if(_0x58b36c){return _0x58b36c[_0x1f86('0x20')]()[_0x1f86('0x1f')](function(){_0x1f9f96[_0x1f86('0x17')](0xcc)[_0x1f86('0x21')]();});}};}function handleEntityNotFound(_0x1a8f2b,_0x51b7b3){return function(_0x551f7a){if(!_0x551f7a){_0x1a8f2b[_0x1f86('0x16')](0x194);}return _0x551f7a;};}function handleError(_0x121263,_0x21c3d0){_0x21c3d0=_0x21c3d0||0x1f4;return function(_0x581313){logger['error'](_0x581313[_0x1f86('0x22')]);if(_0x581313[_0x1f86('0x23')]){delete _0x581313[_0x1f86('0x23')];}_0x121263['status'](_0x21c3d0)[_0x1f86('0x24')](_0x581313);};}exports[_0x1f86('0x25')]=function(_0x4d7900,_0x5afb39){var _0x24eee2={},_0x47ec22={},_0x1b4371={'count':0x0,'rows':[]};var _0x3794cf=db['SAPayment'][_0x1f86('0x26')];_0x47ec22[_0x1f86('0x27')]=_['keys'](_0x3794cf);_0x47ec22[_0x1f86('0x28')]=_['keys'](_0x4d7900['query']);_0x47ec22[_0x1f86('0x29')]=_[_0x1f86('0x2a')](_0x47ec22[_0x1f86('0x27')],_0x47ec22[_0x1f86('0x28')]);_0x24eee2[_0x1f86('0x2b')]=_[_0x1f86('0x2a')](_0x47ec22['model'],qs[_0x1f86('0x2c')](_0x4d7900['query'][_0x1f86('0x2c')]));_0x24eee2[_0x1f86('0x2b')]=_0x24eee2[_0x1f86('0x2b')][_0x1f86('0x2d')]?_0x24eee2['attributes']:_0x47ec22['model'];if(!_0x4d7900['query'][_0x1f86('0x2e')](_0x1f86('0x2f'))){_0x24eee2['limit']=qs[_0x1f86('0x30')](_0x4d7900[_0x1f86('0x28')][_0x1f86('0x30')]);_0x24eee2[_0x1f86('0x1a')]=qs[_0x1f86('0x1a')](_0x4d7900['query']['offset']);}_0x24eee2['order']=qs[_0x1f86('0x31')](_0x4d7900[_0x1f86('0x28')][_0x1f86('0x31')]);_0x24eee2['where']=qs['filters'](_[_0x1f86('0x32')](_0x4d7900[_0x1f86('0x28')],_0x47ec22['filters']));if(_0x4d7900[_0x1f86('0x28')]['filter']){_0x24eee2['where']=_['merge'](_0x24eee2[_0x1f86('0x33')],{'$or':_['map'](_0x3794cf,function(_0x1f8433){if(_0x1f8433[_0x1f86('0x34')][_0x1f86('0x35')]!==_0x1f86('0x36')){var _0x4ef126={};_0x4ef126[_0x1f8433[_0x1f86('0x37')]]={'$like':'%'+_0x4d7900[_0x1f86('0x28')]['filter']+'%'};return _0x4ef126;}})});}_0x24eee2=_[_0x1f86('0x38')]({},_0x24eee2,_0x4d7900[_0x1f86('0x39')]);var _0x4a2045={'where':_0x24eee2[_0x1f86('0x33')]};return db['SAPayment'][_0x1f86('0x19')](_0x4a2045)[_0x1f86('0x1f')](function(_0x2798a9){_0x1b4371[_0x1f86('0x19')]=_0x2798a9;if(_0x4d7900[_0x1f86('0x28')][_0x1f86('0x3a')]){_0x24eee2[_0x1f86('0x3b')]=[{'all':!![]}];}return db[_0x1f86('0x3c')]['findAll'](_0x24eee2);})[_0x1f86('0x1f')](function(_0x4df475){_0x1b4371['rows']=_0x4df475;return _0x1b4371;})[_0x1f86('0x1f')](respondWithFilteredResult(_0x5afb39,_0x24eee2))[_0x1f86('0x3d')](handleError(_0x5afb39,null));};exports[_0x1f86('0x3e')]=function(_0x11af5b,_0x21d801){var _0x28f84f={'raw':![],'where':{'id':_0x11af5b[_0x1f86('0x3f')]['id']}},_0x4edaee={};_0x4edaee[_0x1f86('0x27')]=_[_0x1f86('0x40')](db['SAPayment']['rawAttributes']);_0x4edaee[_0x1f86('0x28')]=_[_0x1f86('0x40')](_0x11af5b[_0x1f86('0x28')]);_0x4edaee[_0x1f86('0x29')]=_[_0x1f86('0x2a')](_0x4edaee[_0x1f86('0x27')],_0x4edaee['query']);_0x28f84f[_0x1f86('0x2b')]=_[_0x1f86('0x2a')](_0x4edaee[_0x1f86('0x27')],qs[_0x1f86('0x2c')](_0x11af5b[_0x1f86('0x28')][_0x1f86('0x2c')]));_0x28f84f[_0x1f86('0x2b')]=_0x28f84f[_0x1f86('0x2b')][_0x1f86('0x2d')]?_0x28f84f[_0x1f86('0x2b')]:_0x4edaee[_0x1f86('0x27')];if(_0x11af5b['query']['includeAll']){_0x28f84f['include']=[{'all':!![]}];}_0x28f84f=_['merge']({},_0x28f84f,_0x11af5b[_0x1f86('0x39')]);return db[_0x1f86('0x3c')]['find'](_0x28f84f)[_0x1f86('0x1f')](handleEntityNotFound(_0x21d801,null))['then'](respondWithResult(_0x21d801,null))[_0x1f86('0x3d')](handleError(_0x21d801,null));};exports[_0x1f86('0x41')]=function(_0x22b0ba,_0x1b73ec){return db[_0x1f86('0x3c')][_0x1f86('0x41')](_0x22b0ba['body'],{})['then'](respondWithResult(_0x1b73ec,0xc9))['catch'](handleError(_0x1b73ec,null));};exports[_0x1f86('0x1e')]=function(_0x93b741,_0x9531d5){if(_0x93b741[_0x1f86('0x42')]['id']){delete _0x93b741[_0x1f86('0x42')]['id'];}return db[_0x1f86('0x3c')][_0x1f86('0x43')]({'where':{'id':_0x93b741[_0x1f86('0x3f')]['id']}})[_0x1f86('0x1f')](handleEntityNotFound(_0x9531d5,null))[_0x1f86('0x1f')](saveUpdates(_0x93b741[_0x1f86('0x42')],null))[_0x1f86('0x1f')](respondWithResult(_0x9531d5,null))[_0x1f86('0x3d')](handleError(_0x9531d5,null));};exports[_0x1f86('0x20')]=function(_0x29d75c,_0x333b7c){return db['SAPayment']['find']({'where':{'id':_0x29d75c[_0x1f86('0x3f')]['id']}})[_0x1f86('0x1f')](handleEntityNotFound(_0x333b7c,null))[_0x1f86('0x1f')](removeEntity(_0x333b7c,null))[_0x1f86('0x3d')](handleError(_0x333b7c,null));};exports[_0x1f86('0x44')]=function(_0x146eef,_0xcb6b7a){return db[_0x1f86('0x3c')][_0x1f86('0x44')]()[_0x1f86('0x1f')](respondWithResult(_0xcb6b7a,null))[_0x1f86('0x3d')](handleError(_0xcb6b7a,null));}; \ No newline at end of file diff --git a/server/api/saPayment/saPayment.model.js b/server/api/saPayment/saPayment.model.js index 34e3067..c847371 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 _0x85e7=['discount','isNil','paid','SAInvoice','log','catch','TCL:\x20err','ProformaId','proforma','split\x20payment','SAProforma','update','Hook\x20afterCreate:\x20err','SAPayment','invoice-->','SAProformaDetail','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./saPayment.attributes','exports','define','sa_payments','get','has','InvoiceId','find','then','invoice','receivingFiscalMessage','indexOf','SAInvoiceDetail','details','findAll','payments','length','payment','netPrice','tax','quantity'];(function(_0x586c13,_0xf074ed){var _0x1c955f=function(_0x3255a6){while(--_0x3255a6){_0x586c13['push'](_0x586c13['shift']());}};_0x1c955f(++_0xf074ed);}(_0x85e7,0xcc));var _0x785e=function(_0x1a7e28,_0x43e0c6){_0x1a7e28=_0x1a7e28-0x0;var _0x4f05bc=_0x85e7[_0x1a7e28];return _0x4f05bc;};'use strict';var _=require(_0x785e('0x0'));var util=require(_0x785e('0x1'));var logger=require(_0x785e('0x2'))(_0x785e('0x3'));var moment=require(_0x785e('0x4'));var BPromise=require(_0x785e('0x5'));var rp=require(_0x785e('0x6'));var fs=require('fs');var path=require(_0x785e('0x7'));var rimraf=require(_0x785e('0x8'));var config=require(_0x785e('0x9'));var attributes=require(_0x785e('0xa'));module[_0x785e('0xb')]=function(_0x131963,_0xef13c4){return _0x131963[_0x785e('0xc')]('SAPayment',attributes,{'tableName':_0x785e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x297eea,_0x195d45,_0xfcc6c8){var _0x76c7c2=_0x131963['models'];var _0x4c5ede={};var _0xafbcf0={};var _0x1830f1=_0x297eea[_0x785e('0xe')]({'plain':!![]});if(_[_0x785e('0xf')](_0x1830f1,_0x785e('0x10'))){_0x76c7c2['SAInvoice'][_0x785e('0x11')]({'where':{'id':_0x1830f1[_0x785e('0x10')]},'raw':!![]})[_0x785e('0x12')](function(_0x226f81){if(_0x226f81){_0x4c5ede[_0x785e('0x13')]=_0x226f81;var _0x4cbdc7=![];if(_0x4c5ede[_0x785e('0x13')][_0x785e('0x14')][_0x785e('0x15')]('split\x20payment')!=-0x1){_0x4cbdc7=!![];}return _0x76c7c2[_0x785e('0x16')]['findAll']({'where':{'InvoiceId':_0x1830f1[_0x785e('0x10')]},'raw':!![]})['then'](function(_0x3b5732){_0x4c5ede[_0x785e('0x17')]=_0x3b5732;return _0x76c7c2['SAPayment'][_0x785e('0x18')]({'where':{'InvoiceId':_0x1830f1[_0x785e('0x10')]},'raw':!![]});})[_0x785e('0x12')](function(_0x4e47a5){_0x4c5ede[_0x785e('0x19')]=_0x4e47a5;var _0xb44f07=0x0;var _0x25d86d=0x0;var _0x33c970=0x0;var _0x72066b=0x0;var _0x4a7204=0x0;for(var _0x171b94=0x0;_0x171b94<_0x4c5ede['payments'][_0x785e('0x1a')];_0x171b94++){_0xb44f07+=_0x4c5ede[_0x785e('0x19')][_0x171b94][_0x785e('0x1b')];}for(var _0x171b94=0x0;_0x171b94<_0x4c5ede[_0x785e('0x17')][_0x785e('0x1a')];_0x171b94++){var _0x386298=0x0;var _0x54f10b=0x0;var _0x565ee6=0x0;var _0x30962d=0x0;_0x386298=_0x4c5ede['details'][_0x171b94]['netPrice']-_0x4c5ede['details'][_0x171b94][_0x785e('0x1c')]/0x64*_0x4c5ede[_0x785e('0x17')][_0x171b94]['discount'];_0x54f10b=_0x386298/0x64*_0x4c5ede[_0x785e('0x17')][_0x171b94][_0x785e('0x1d')];_0x565ee6=_0x386298*_0x4c5ede[_0x785e('0x17')][_0x171b94][_0x785e('0x1e')];_0x30962d=_0x54f10b*_0x4c5ede[_0x785e('0x17')][_0x171b94]['quantity'];_0x72066b+=_0x565ee6;_0x4a7204+=_0x30962d;}if(!_['isNil'](_0x4c5ede[_0x785e('0x13')]['discount'])){var _0x984c02=0x0;var _0x249af1=0x0;var _0x254b54=_0x4c5ede[_0x785e('0x13')][_0x785e('0x1f')]*0x64/_0x72066b;for(var _0x2f9522=0x0;_0x2f9522<_0x4c5ede[_0x785e('0x17')][_0x785e('0x1a')];_0x2f9522++){var _0x2edbff=0x0;var _0x35848a=0x0;var _0x5c1ca1=0x0;_0x386298=_0x4c5ede[_0x785e('0x17')][_0x2f9522]['netPrice']-_0x4c5ede['details'][_0x2f9522][_0x785e('0x1c')]/0x64*_0x4c5ede[_0x785e('0x17')][_0x2f9522][_0x785e('0x1f')];_0x2edbff=_0x386298/0x64*_0x254b54;_0x35848a=_0x386298-_0x2edbff;_0x5c1ca1=_0x35848a*_0x4c5ede['details'][_0x2f9522][_0x785e('0x1e')];_0x984c02+=_0x5c1ca1;_0x249af1+=_0x5c1ca1/0x64*_0x4c5ede[_0x785e('0x17')][_0x2f9522]['tax'];}}if(!_[_0x785e('0x20')](_0x4c5ede['invoice'][_0x785e('0x1f')])){if(_0x4cbdc7){_0x25d86d=_0x984c02;}else{_0x25d86d=_0x249af1+_0x984c02;}}else{if(_0x4cbdc7){_0x25d86d=_0x72066b;}else{_0x25d86d=_0x4a7204+_0x72066b;}}if(_0xb44f07==_0x25d86d){_0x4c5ede[_0x785e('0x13')][_0x785e('0x21')]=0x1;}if(_0xb44f07<_0x25d86d){_0x4c5ede[_0x785e('0x13')]['paid']=0x2;}if(_0xb44f07>_0x25d86d){_0x4c5ede[_0x785e('0x13')]['paid']=0x3;}_0x76c7c2[_0x785e('0x22')]['update'](_0x4c5ede['invoice'],{'where':{'id':_0x1830f1['InvoiceId']}})[_0x785e('0x12')](function(_0x283895){console[_0x785e('0x23')]('invoice-->',_0x283895);})[_0x785e('0x24')](function(_0x366c91){console[_0x785e('0x23')](_0x785e('0x25'),_0x366c91);});});}});}else{_0x76c7c2['SAProforma'][_0x785e('0x11')]({'where':{'id':_0x1830f1[_0x785e('0x26')]},'raw':!![]})[_0x785e('0x12')](function(_0x4c70e6){if(_0x4c70e6){_0xafbcf0[_0x785e('0x27')]=_0x4c70e6;var _0x3c05a4=![];if(_0xafbcf0[_0x785e('0x27')][_0x785e('0x14')]['indexOf'](_0x785e('0x28'))!=-0x1){_0x3c05a4=!![];}return _0x76c7c2['SAProformaDetail'][_0x785e('0x18')]({'where':{'ProformaId':_0x1830f1[_0x785e('0x26')]},'raw':!![]})['then'](function(_0x8418c0){_0xafbcf0[_0x785e('0x17')]=_0x8418c0;return _0x76c7c2['SAPayment'][_0x785e('0x18')]({'where':{'ProformaId':_0x1830f1[_0x785e('0x26')]},'raw':!![]});})[_0x785e('0x12')](function(_0x11acaa){_0xafbcf0[_0x785e('0x19')]=_0x11acaa;var _0xef85bd=0x0;var _0x4cb501=0x0;var _0x47aba2=0x0;var _0x59d68e=0x0;var _0x1d22e2=0x0;for(var _0x197f56=0x0;_0x197f56<_0xafbcf0[_0x785e('0x19')][_0x785e('0x1a')];_0x197f56++){_0xef85bd+=_0xafbcf0[_0x785e('0x19')][_0x197f56][_0x785e('0x1b')];}for(var _0x197f56=0x0;_0x197f56<_0xafbcf0[_0x785e('0x17')][_0x785e('0x1a')];_0x197f56++){var _0x172061=0x0;var _0x4a0c7b=0x0;var _0xe26597=0x0;var _0xfaa8bd=0x0;_0x172061=_0xafbcf0[_0x785e('0x17')][_0x197f56][_0x785e('0x1c')]-_0xafbcf0[_0x785e('0x17')][_0x197f56][_0x785e('0x1c')]/0x64*_0xafbcf0['details'][_0x197f56][_0x785e('0x1f')];_0x4a0c7b=_0x172061/0x64*_0xafbcf0[_0x785e('0x17')][_0x197f56][_0x785e('0x1d')];_0xe26597=_0x172061*_0xafbcf0['details'][_0x197f56][_0x785e('0x1e')];_0xfaa8bd=_0x4a0c7b*_0xafbcf0[_0x785e('0x17')][_0x197f56]['quantity'];_0x59d68e+=_0xe26597;_0x1d22e2+=_0xfaa8bd;}if(!_[_0x785e('0x20')](_0xafbcf0[_0x785e('0x27')]['discount'])){var _0x3d735e=0x0;var _0x392228=0x0;var _0x3a2af6=_0xafbcf0[_0x785e('0x27')][_0x785e('0x1f')]*0x64/_0x59d68e;for(var _0x2e92b8=0x0;_0x2e92b8<_0xafbcf0[_0x785e('0x17')][_0x785e('0x1a')];_0x2e92b8++){var _0x489905=0x0;var _0x25d931=0x0;var _0x237603=0x0;_0x172061=_0xafbcf0[_0x785e('0x17')][_0x2e92b8]['netPrice']-_0xafbcf0[_0x785e('0x17')][_0x2e92b8]['netPrice']/0x64*_0xafbcf0['details'][_0x2e92b8]['discount'];_0x489905=_0x172061/0x64*_0x3a2af6;_0x25d931=_0x172061-_0x489905;_0x237603=_0x25d931*_0xafbcf0[_0x785e('0x17')][_0x2e92b8][_0x785e('0x1e')];_0x3d735e+=_0x237603;_0x392228+=_0x237603/0x64*_0xafbcf0['details'][_0x2e92b8][_0x785e('0x1d')];}}if(!_['isNil'](_0xafbcf0[_0x785e('0x27')]['discount'])){if(_0x3c05a4){_0x4cb501=_0x3d735e;}else{_0x4cb501=_0x392228+_0x3d735e;}}else{if(_0x3c05a4){_0x4cb501=_0x59d68e;}else{_0x4cb501=_0x1d22e2+_0x59d68e;}}if(_0xef85bd==_0x4cb501){_0xafbcf0['proforma'][_0x785e('0x21')]=0x1;}if(_0xef85bd<_0x4cb501){_0xafbcf0[_0x785e('0x27')]['paid']=0x2;}if(_0xef85bd>_0x4cb501){_0xafbcf0[_0x785e('0x27')]['paid']=0x3;}_0x76c7c2[_0x785e('0x29')][_0x785e('0x2a')](_0xafbcf0[_0x785e('0x27')],{'where':{'id':_0x1830f1[_0x785e('0x26')]}})[_0x785e('0x12')](function(_0x5175fa){})['catch'](function(_0x1e417f){console[_0x785e('0x23')](_0x785e('0x2b'),_0x1e417f);});});}});}_0xfcc6c8();},'afterUpdate':function(_0x18749d,_0x4cdde1,_0x2b2a4e){var _0x3a9e3e=_0x131963['models'];var _0x3d5f8c={};var _0x1a66f4={};var _0x1e2ae2=_0x18749d[_0x785e('0xe')]({'plain':!![]});if(_[_0x785e('0xf')](_0x1e2ae2,'InvoiceId')){_0x3a9e3e[_0x785e('0x22')]['find']({'where':{'id':_0x1e2ae2[_0x785e('0x10')]},'raw':!![]})[_0x785e('0x12')](function(_0x1e81a6){if(_0x1e81a6){_0x3d5f8c[_0x785e('0x13')]=_0x1e81a6;var _0x853f01=![];if(_0x3d5f8c['invoice'][_0x785e('0x14')][_0x785e('0x15')](_0x785e('0x28'))!=-0x1){_0x853f01=!![];}return _0x3a9e3e[_0x785e('0x16')]['findAll']({'where':{'InvoiceId':_0x1e2ae2['InvoiceId']},'raw':!![]})[_0x785e('0x12')](function(_0x240cd7){_0x3d5f8c['details']=_0x240cd7;return _0x3a9e3e[_0x785e('0x2c')][_0x785e('0x18')]({'where':{'InvoiceId':_0x1e2ae2[_0x785e('0x10')]},'raw':!![]});})[_0x785e('0x12')](function(_0x3b09ba){_0x3d5f8c[_0x785e('0x19')]=_0x3b09ba;var _0x14dcf6=0x0;var _0x5b3895=0x0;var _0x388b91=0x0;var _0x1fc9e2=0x0;var _0x2d79dc=0x0;for(var _0x22fad9=0x0;_0x22fad9<_0x3d5f8c[_0x785e('0x19')][_0x785e('0x1a')];_0x22fad9++){_0x14dcf6+=_0x3d5f8c['payments'][_0x22fad9][_0x785e('0x1b')];}for(var _0x22fad9=0x0;_0x22fad9<_0x3d5f8c[_0x785e('0x17')][_0x785e('0x1a')];_0x22fad9++){var _0x26db26=0x0;var _0x2e9285=0x0;var _0x2844e2=0x0;var _0x30f038=0x0;_0x26db26=_0x3d5f8c[_0x785e('0x17')][_0x22fad9][_0x785e('0x1c')]-_0x3d5f8c['details'][_0x22fad9][_0x785e('0x1c')]/0x64*_0x3d5f8c[_0x785e('0x17')][_0x22fad9]['discount'];_0x2e9285=_0x26db26/0x64*_0x3d5f8c['details'][_0x22fad9][_0x785e('0x1d')];_0x2844e2=_0x26db26*_0x3d5f8c[_0x785e('0x17')][_0x22fad9]['quantity'];_0x30f038=_0x2e9285*_0x3d5f8c[_0x785e('0x17')][_0x22fad9][_0x785e('0x1e')];_0x1fc9e2+=_0x2844e2;_0x2d79dc+=_0x30f038;}if(!_[_0x785e('0x20')](_0x3d5f8c[_0x785e('0x13')][_0x785e('0x1f')])){var _0x4c7b73=0x0;var _0x3f021d=0x0;var _0x3f7a3b=_0x3d5f8c[_0x785e('0x13')][_0x785e('0x1f')]*0x64/_0x1fc9e2;for(var _0x1091d0=0x0;_0x1091d0<_0x3d5f8c[_0x785e('0x17')][_0x785e('0x1a')];_0x1091d0++){var _0x4fb288=0x0;var _0x1e4278=0x0;var _0x5f29ef=0x0;_0x26db26=_0x3d5f8c[_0x785e('0x17')][_0x1091d0][_0x785e('0x1c')]-_0x3d5f8c[_0x785e('0x17')][_0x1091d0]['netPrice']/0x64*_0x3d5f8c[_0x785e('0x17')][_0x1091d0][_0x785e('0x1f')];_0x4fb288=_0x26db26/0x64*_0x3f7a3b;_0x1e4278=_0x26db26-_0x4fb288;_0x5f29ef=_0x1e4278*_0x3d5f8c[_0x785e('0x17')][_0x1091d0][_0x785e('0x1e')];_0x4c7b73+=_0x5f29ef;_0x3f021d+=_0x5f29ef/0x64*_0x3d5f8c[_0x785e('0x17')][_0x1091d0]['tax'];}}if(!_[_0x785e('0x20')](_0x3d5f8c[_0x785e('0x13')][_0x785e('0x1f')])){if(_0x853f01){_0x5b3895=_0x4c7b73;}else{_0x5b3895=_0x3f021d+_0x4c7b73;}}else{if(_0x853f01){_0x5b3895=_0x1fc9e2;}else{_0x5b3895=_0x2d79dc+_0x1fc9e2;}}if(_0x14dcf6==_0x5b3895){_0x3d5f8c['invoice'][_0x785e('0x21')]=0x1;}if(_0x14dcf6<_0x5b3895){_0x3d5f8c[_0x785e('0x13')][_0x785e('0x21')]=0x2;}if(_0x14dcf6>_0x5b3895){_0x3d5f8c[_0x785e('0x13')][_0x785e('0x21')]=0x3;}_0x3a9e3e[_0x785e('0x22')][_0x785e('0x2a')](_0x3d5f8c[_0x785e('0x13')],{'where':{'id':_0x1e2ae2[_0x785e('0x10')]}})[_0x785e('0x12')](function(_0x10eb0c){console[_0x785e('0x23')](_0x785e('0x2d'),_0x10eb0c);})[_0x785e('0x24')](function(_0xdd7a33){console[_0x785e('0x23')]('TCL:\x20err',_0xdd7a33);});});}});}else{_0x3a9e3e[_0x785e('0x29')][_0x785e('0x11')]({'where':{'id':_0x1e2ae2['ProformaId']},'raw':!![]})[_0x785e('0x12')](function(_0x3b6783){if(_0x3b6783){_0x1a66f4[_0x785e('0x27')]=_0x3b6783;var _0xeccade=![];if(_0x3d5f8c['invoice'][_0x785e('0x14')][_0x785e('0x15')](_0x785e('0x28'))!=-0x1){_0xeccade=!![];}return _0x3a9e3e[_0x785e('0x2e')]['findAll']({'where':{'ProformaId':_0x1e2ae2[_0x785e('0x26')]},'raw':!![]})['then'](function(_0xeff4eb){_0x1a66f4[_0x785e('0x17')]=_0xeff4eb;return _0x3a9e3e[_0x785e('0x2c')][_0x785e('0x18')]({'where':{'ProformaId':_0x1e2ae2[_0x785e('0x26')]},'raw':!![]});})[_0x785e('0x12')](function(_0x2f9436){_0x1a66f4['payments']=_0x2f9436;var _0x28ad3b=0x0;var _0x39ac83=0x0;var _0xd1e75d=0x0;var _0x4b495b=0x0;var _0x338669=0x0;for(var _0x12da28=0x0;_0x12da28<_0x1a66f4['payments']['length'];_0x12da28++){_0x28ad3b+=_0x1a66f4[_0x785e('0x19')][_0x12da28]['payment'];}for(var _0x12da28=0x0;_0x12da28<_0x1a66f4[_0x785e('0x17')][_0x785e('0x1a')];_0x12da28++){var _0x42734a=0x0;var _0x54221d=0x0;var _0x51dc96=0x0;var _0x14529a=0x0;_0x42734a=_0x1a66f4['details'][_0x12da28]['netPrice']-_0x1a66f4[_0x785e('0x17')][_0x12da28][_0x785e('0x1c')]/0x64*_0x1a66f4[_0x785e('0x17')][_0x12da28][_0x785e('0x1f')];_0x54221d=_0x42734a/0x64*_0x1a66f4[_0x785e('0x17')][_0x12da28][_0x785e('0x1d')];_0x51dc96=_0x42734a*_0x1a66f4[_0x785e('0x17')][_0x12da28][_0x785e('0x1e')];_0x14529a=_0x54221d*_0x1a66f4['details'][_0x12da28][_0x785e('0x1e')];_0x4b495b+=_0x51dc96;_0x338669+=_0x14529a;}if(!_['isNil'](_0x1a66f4[_0x785e('0x27')]['discount'])){var _0x54741d=0x0;var _0x127fa1=0x0;var _0x4ca81e=_0x1a66f4['proforma']['discount']*0x64/_0x4b495b;for(var _0x16d192=0x0;_0x16d192<_0x1a66f4[_0x785e('0x17')][_0x785e('0x1a')];_0x16d192++){var _0x1342d8=0x0;var _0x1beb87=0x0;var _0x11f2c3=0x0;_0x42734a=_0x1a66f4['details'][_0x16d192][_0x785e('0x1c')]-_0x1a66f4[_0x785e('0x17')][_0x16d192][_0x785e('0x1c')]/0x64*_0x1a66f4[_0x785e('0x17')][_0x16d192][_0x785e('0x1f')];_0x1342d8=_0x42734a/0x64*_0x4ca81e;_0x1beb87=_0x42734a-_0x1342d8;_0x11f2c3=_0x1beb87*_0x1a66f4[_0x785e('0x17')][_0x16d192]['quantity'];_0x54741d+=_0x11f2c3;_0x127fa1+=_0x11f2c3/0x64*_0x1a66f4[_0x785e('0x17')][_0x16d192][_0x785e('0x1d')];}}if(!_['isNil'](_0x1a66f4[_0x785e('0x27')]['discount'])){if(_0xeccade){_0x39ac83=_0x54741d;}else{_0x39ac83=_0x127fa1+_0x54741d;}}else{if(_0xeccade){_0x39ac83=_0x4b495b;}else{_0x39ac83=_0x338669+_0x4b495b;}}if(_0x28ad3b==_0x39ac83){_0x1a66f4['proforma'][_0x785e('0x21')]=0x1;}if(_0x28ad3b<_0x39ac83){_0x1a66f4[_0x785e('0x27')][_0x785e('0x21')]=0x2;}if(_0x28ad3b>_0x39ac83){_0x1a66f4[_0x785e('0x27')][_0x785e('0x21')]=0x3;}_0x3a9e3e[_0x785e('0x29')][_0x785e('0x2a')](_0x1a66f4[_0x785e('0x27')],{'where':{'id':_0x1e2ae2[_0x785e('0x26')]}})[_0x785e('0x12')](function(_0x1c70a3){})[_0x785e('0x24')](function(_0x730958){console[_0x785e('0x23')](_0x785e('0x2b'),_0x730958);});});}});}_0x2b2a4e();}}});}; \ No newline at end of file +var _0xc1c5=['proforma','catch','SAProformaDetail','Hook\x20afterCreate:\x20err','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./saPayment.attributes','exports','define','SAPayment','sa_payments','models','has','InvoiceId','find','then','invoice','receivingFiscalMessage','indexOf','split\x20payment','SAInvoiceDetail','details','findAll','payments','length','payment','netPrice','quantity','isNil','discount','tax','paid','SAInvoice','update','log','invoice-->','TCL:\x20err','SAProforma','ProformaId'];(function(_0x4066c2,_0xad48e8){var _0x3870a0=function(_0x5d591e){while(--_0x5d591e){_0x4066c2['push'](_0x4066c2['shift']());}};_0x3870a0(++_0xad48e8);}(_0xc1c5,0xbc));var _0x5c1c=function(_0x36e464,_0x219cb4){_0x36e464=_0x36e464-0x0;var _0x2c597f=_0xc1c5[_0x36e464];return _0x2c597f;};'use strict';var _=require(_0x5c1c('0x0'));var util=require(_0x5c1c('0x1'));var logger=require('../../config/logger')(_0x5c1c('0x2'));var moment=require(_0x5c1c('0x3'));var BPromise=require(_0x5c1c('0x4'));var rp=require(_0x5c1c('0x5'));var fs=require('fs');var path=require(_0x5c1c('0x6'));var rimraf=require(_0x5c1c('0x7'));var config=require(_0x5c1c('0x8'));var attributes=require(_0x5c1c('0x9'));module[_0x5c1c('0xa')]=function(_0x56cf6e,_0x67c46a){return _0x56cf6e[_0x5c1c('0xb')](_0x5c1c('0xc'),attributes,{'tableName':_0x5c1c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x30f69a,_0x5215e1,_0x4934d8){var _0x30b670=_0x56cf6e[_0x5c1c('0xe')];var _0x2adb57={};var _0x584309={};var _0x529338=_0x30f69a['get']({'plain':!![]});if(_[_0x5c1c('0xf')](_0x529338,_0x5c1c('0x10'))){_0x30b670['SAInvoice'][_0x5c1c('0x11')]({'where':{'id':_0x529338[_0x5c1c('0x10')]},'raw':!![]})[_0x5c1c('0x12')](function(_0x5df6f1){if(_0x5df6f1){_0x2adb57[_0x5c1c('0x13')]=_0x5df6f1;var _0x3e3ca7=![];if(_0x2adb57[_0x5c1c('0x13')][_0x5c1c('0x14')][_0x5c1c('0x15')](_0x5c1c('0x16'))!=-0x1){_0x3e3ca7=!![];}return _0x30b670[_0x5c1c('0x17')]['findAll']({'where':{'InvoiceId':_0x529338[_0x5c1c('0x10')]},'raw':!![]})[_0x5c1c('0x12')](function(_0x2932d0){_0x2adb57[_0x5c1c('0x18')]=_0x2932d0;return _0x30b670[_0x5c1c('0xc')][_0x5c1c('0x19')]({'where':{'InvoiceId':_0x529338['InvoiceId']},'raw':!![]});})[_0x5c1c('0x12')](function(_0x1a2651){_0x2adb57[_0x5c1c('0x1a')]=_0x1a2651;var _0x4308af=0x0;var _0x3db91e=0x0;var _0x36dc32=0x0;var _0x8e70b1=0x0;var _0x46fac8=0x0;for(var _0x4d327b=0x0;_0x4d327b<_0x2adb57['payments'][_0x5c1c('0x1b')];_0x4d327b++){_0x4308af+=_0x2adb57[_0x5c1c('0x1a')][_0x4d327b][_0x5c1c('0x1c')];}for(var _0x4d327b=0x0;_0x4d327b<_0x2adb57[_0x5c1c('0x18')][_0x5c1c('0x1b')];_0x4d327b++){var _0x6ed477=0x0;var _0x4f886a=0x0;var _0x47c41f=0x0;var _0x2da7e6=0x0;_0x6ed477=_0x2adb57[_0x5c1c('0x18')][_0x4d327b]['netPrice']-_0x2adb57[_0x5c1c('0x18')][_0x4d327b][_0x5c1c('0x1d')]/0x64*_0x2adb57[_0x5c1c('0x18')][_0x4d327b]['discount'];_0x4f886a=_0x6ed477/0x64*_0x2adb57[_0x5c1c('0x18')][_0x4d327b]['tax'];_0x47c41f=_0x6ed477*_0x2adb57[_0x5c1c('0x18')][_0x4d327b][_0x5c1c('0x1e')];_0x2da7e6=_0x4f886a*_0x2adb57['details'][_0x4d327b][_0x5c1c('0x1e')];_0x8e70b1+=_0x47c41f;_0x46fac8+=_0x2da7e6;}if(!_[_0x5c1c('0x1f')](_0x2adb57[_0x5c1c('0x13')][_0x5c1c('0x20')])){var _0x3eb708=0x0;var _0x442501=0x0;var _0x9a2ef2=_0x2adb57[_0x5c1c('0x13')][_0x5c1c('0x20')]*0x64/_0x8e70b1;for(var _0x1c7719=0x0;_0x1c7719<_0x2adb57[_0x5c1c('0x18')][_0x5c1c('0x1b')];_0x1c7719++){var _0x3c1dda=0x0;var _0x4f6081=0x0;var _0x57e728=0x0;_0x6ed477=_0x2adb57[_0x5c1c('0x18')][_0x1c7719][_0x5c1c('0x1d')]-_0x2adb57[_0x5c1c('0x18')][_0x1c7719][_0x5c1c('0x1d')]/0x64*_0x2adb57[_0x5c1c('0x18')][_0x1c7719]['discount'];_0x3c1dda=_0x6ed477/0x64*_0x9a2ef2;_0x4f6081=_0x6ed477-_0x3c1dda;_0x57e728=_0x4f6081*_0x2adb57[_0x5c1c('0x18')][_0x1c7719][_0x5c1c('0x1e')];_0x3eb708+=_0x57e728;_0x442501+=_0x57e728/0x64*_0x2adb57[_0x5c1c('0x18')][_0x1c7719][_0x5c1c('0x21')];}}if(!_[_0x5c1c('0x1f')](_0x2adb57['invoice'][_0x5c1c('0x20')])){if(_0x3e3ca7){_0x3db91e=_0x3eb708;}else{_0x3db91e=_0x442501+_0x3eb708;}}else{if(_0x3e3ca7){_0x3db91e=_0x8e70b1;}else{_0x3db91e=_0x46fac8+_0x8e70b1;}}if(_0x4308af==_0x3db91e){_0x2adb57[_0x5c1c('0x13')]['paid']=0x1;}if(_0x4308af<_0x3db91e){_0x2adb57[_0x5c1c('0x13')][_0x5c1c('0x22')]=0x2;}if(_0x4308af>_0x3db91e){_0x2adb57['invoice'][_0x5c1c('0x22')]=0x3;}_0x30b670[_0x5c1c('0x23')][_0x5c1c('0x24')](_0x2adb57[_0x5c1c('0x13')],{'where':{'id':_0x529338['InvoiceId']}})['then'](function(_0xce6f66){console[_0x5c1c('0x25')](_0x5c1c('0x26'),_0xce6f66);})['catch'](function(_0x490bcd){console[_0x5c1c('0x25')](_0x5c1c('0x27'),_0x490bcd);});});}});}else{_0x30b670[_0x5c1c('0x28')][_0x5c1c('0x11')]({'where':{'id':_0x529338[_0x5c1c('0x29')]},'raw':!![]})[_0x5c1c('0x12')](function(_0x571f5f){if(_0x571f5f){_0x584309[_0x5c1c('0x2a')]=_0x571f5f;var _0x2b51cc=![];if(_0x584309['proforma'][_0x5c1c('0x14')]['indexOf'](_0x5c1c('0x16'))!=-0x1){_0x2b51cc=!![];}return _0x30b670['SAProformaDetail'][_0x5c1c('0x19')]({'where':{'ProformaId':_0x529338[_0x5c1c('0x29')]},'raw':!![]})[_0x5c1c('0x12')](function(_0xc53aff){_0x584309['details']=_0xc53aff;return _0x30b670[_0x5c1c('0xc')][_0x5c1c('0x19')]({'where':{'ProformaId':_0x529338[_0x5c1c('0x29')]},'raw':!![]});})[_0x5c1c('0x12')](function(_0x4a021a){_0x584309[_0x5c1c('0x1a')]=_0x4a021a;var _0x4f5933=0x0;var _0x8923a8=0x0;var _0x53aa14=0x0;var _0x5ec468=0x0;var _0x116605=0x0;for(var _0x34234d=0x0;_0x34234d<_0x584309[_0x5c1c('0x1a')][_0x5c1c('0x1b')];_0x34234d++){_0x4f5933+=_0x584309[_0x5c1c('0x1a')][_0x34234d][_0x5c1c('0x1c')];}for(var _0x34234d=0x0;_0x34234d<_0x584309[_0x5c1c('0x18')][_0x5c1c('0x1b')];_0x34234d++){var _0x106cd1=0x0;var _0x1ddeb8=0x0;var _0x212732=0x0;var _0x445152=0x0;_0x106cd1=_0x584309[_0x5c1c('0x18')][_0x34234d][_0x5c1c('0x1d')]-_0x584309['details'][_0x34234d][_0x5c1c('0x1d')]/0x64*_0x584309['details'][_0x34234d][_0x5c1c('0x20')];_0x1ddeb8=_0x106cd1/0x64*_0x584309[_0x5c1c('0x18')][_0x34234d][_0x5c1c('0x21')];_0x212732=_0x106cd1*_0x584309[_0x5c1c('0x18')][_0x34234d][_0x5c1c('0x1e')];_0x445152=_0x1ddeb8*_0x584309[_0x5c1c('0x18')][_0x34234d]['quantity'];_0x5ec468+=_0x212732;_0x116605+=_0x445152;}if(!_[_0x5c1c('0x1f')](_0x584309[_0x5c1c('0x2a')][_0x5c1c('0x20')])){var _0x1328f1=0x0;var _0x187f86=0x0;var _0xe7b878=_0x584309[_0x5c1c('0x2a')]['discount']*0x64/_0x5ec468;for(var _0x25b4b1=0x0;_0x25b4b1<_0x584309[_0x5c1c('0x18')][_0x5c1c('0x1b')];_0x25b4b1++){var _0x31a2d7=0x0;var _0x5bf09e=0x0;var _0x2f0c9a=0x0;_0x106cd1=_0x584309['details'][_0x25b4b1][_0x5c1c('0x1d')]-_0x584309[_0x5c1c('0x18')][_0x25b4b1][_0x5c1c('0x1d')]/0x64*_0x584309['details'][_0x25b4b1][_0x5c1c('0x20')];_0x31a2d7=_0x106cd1/0x64*_0xe7b878;_0x5bf09e=_0x106cd1-_0x31a2d7;_0x2f0c9a=_0x5bf09e*_0x584309['details'][_0x25b4b1][_0x5c1c('0x1e')];_0x1328f1+=_0x2f0c9a;_0x187f86+=_0x2f0c9a/0x64*_0x584309[_0x5c1c('0x18')][_0x25b4b1]['tax'];}}if(!_[_0x5c1c('0x1f')](_0x584309[_0x5c1c('0x2a')]['discount'])){if(_0x2b51cc){_0x8923a8=_0x1328f1;}else{_0x8923a8=_0x187f86+_0x1328f1;}}else{if(_0x2b51cc){_0x8923a8=_0x5ec468;}else{_0x8923a8=_0x116605+_0x5ec468;}}if(_0x4f5933==_0x8923a8){_0x584309[_0x5c1c('0x2a')][_0x5c1c('0x22')]=0x1;}if(_0x4f5933<_0x8923a8){_0x584309['proforma']['paid']=0x2;}if(_0x4f5933>_0x8923a8){_0x584309[_0x5c1c('0x2a')]['paid']=0x3;}_0x30b670[_0x5c1c('0x28')][_0x5c1c('0x24')](_0x584309[_0x5c1c('0x2a')],{'where':{'id':_0x529338[_0x5c1c('0x29')]}})[_0x5c1c('0x12')](function(_0x33eeb){})[_0x5c1c('0x2b')](function(_0x1b52f7){console[_0x5c1c('0x25')]('Hook\x20afterCreate:\x20err',_0x1b52f7);});});}});}_0x4934d8();},'afterUpdate':function(_0x4622bd,_0x20752d,_0x599c2c){var _0x48ed8b=_0x56cf6e[_0x5c1c('0xe')];var _0x4580ac={};var _0xec58b1={};var _0x3b7846=_0x4622bd['get']({'plain':!![]});if(_[_0x5c1c('0xf')](_0x3b7846,_0x5c1c('0x10'))){_0x48ed8b[_0x5c1c('0x23')][_0x5c1c('0x11')]({'where':{'id':_0x3b7846[_0x5c1c('0x10')]},'raw':!![]})[_0x5c1c('0x12')](function(_0x5bac1f){if(_0x5bac1f){_0x4580ac[_0x5c1c('0x13')]=_0x5bac1f;var _0xd5c0de=![];if(_0x4580ac[_0x5c1c('0x13')]['receivingFiscalMessage'][_0x5c1c('0x15')]('split\x20payment')!=-0x1){_0xd5c0de=!![];}return _0x48ed8b['SAInvoiceDetail'][_0x5c1c('0x19')]({'where':{'InvoiceId':_0x3b7846[_0x5c1c('0x10')]},'raw':!![]})[_0x5c1c('0x12')](function(_0x3c1a52){_0x4580ac[_0x5c1c('0x18')]=_0x3c1a52;return _0x48ed8b[_0x5c1c('0xc')][_0x5c1c('0x19')]({'where':{'InvoiceId':_0x3b7846[_0x5c1c('0x10')]},'raw':!![]});})[_0x5c1c('0x12')](function(_0x4bb5c3){_0x4580ac[_0x5c1c('0x1a')]=_0x4bb5c3;var _0x93f7c8=0x0;var _0x2f35b1=0x0;var _0x1de26f=0x0;var _0x430274=0x0;var _0x3310b0=0x0;for(var _0x51385c=0x0;_0x51385c<_0x4580ac[_0x5c1c('0x1a')][_0x5c1c('0x1b')];_0x51385c++){_0x93f7c8+=_0x4580ac[_0x5c1c('0x1a')][_0x51385c][_0x5c1c('0x1c')];}for(var _0x51385c=0x0;_0x51385c<_0x4580ac['details']['length'];_0x51385c++){var _0x3fcaae=0x0;var _0xd3504=0x0;var _0x1f070c=0x0;var _0x342d4b=0x0;_0x3fcaae=_0x4580ac[_0x5c1c('0x18')][_0x51385c]['netPrice']-_0x4580ac[_0x5c1c('0x18')][_0x51385c]['netPrice']/0x64*_0x4580ac['details'][_0x51385c][_0x5c1c('0x20')];_0xd3504=_0x3fcaae/0x64*_0x4580ac[_0x5c1c('0x18')][_0x51385c][_0x5c1c('0x21')];_0x1f070c=_0x3fcaae*_0x4580ac[_0x5c1c('0x18')][_0x51385c][_0x5c1c('0x1e')];_0x342d4b=_0xd3504*_0x4580ac[_0x5c1c('0x18')][_0x51385c]['quantity'];_0x430274+=_0x1f070c;_0x3310b0+=_0x342d4b;}if(!_['isNil'](_0x4580ac[_0x5c1c('0x13')]['discount'])){var _0x2c686b=0x0;var _0x2006cd=0x0;var _0x4bd9df=_0x4580ac[_0x5c1c('0x13')][_0x5c1c('0x20')]*0x64/_0x430274;for(var _0x35e2eb=0x0;_0x35e2eb<_0x4580ac[_0x5c1c('0x18')][_0x5c1c('0x1b')];_0x35e2eb++){var _0x23723f=0x0;var _0x5d582e=0x0;var _0x126cfc=0x0;_0x3fcaae=_0x4580ac[_0x5c1c('0x18')][_0x35e2eb][_0x5c1c('0x1d')]-_0x4580ac[_0x5c1c('0x18')][_0x35e2eb][_0x5c1c('0x1d')]/0x64*_0x4580ac['details'][_0x35e2eb]['discount'];_0x23723f=_0x3fcaae/0x64*_0x4bd9df;_0x5d582e=_0x3fcaae-_0x23723f;_0x126cfc=_0x5d582e*_0x4580ac['details'][_0x35e2eb][_0x5c1c('0x1e')];_0x2c686b+=_0x126cfc;_0x2006cd+=_0x126cfc/0x64*_0x4580ac['details'][_0x35e2eb][_0x5c1c('0x21')];}}if(!_[_0x5c1c('0x1f')](_0x4580ac[_0x5c1c('0x13')][_0x5c1c('0x20')])){if(_0xd5c0de){_0x2f35b1=_0x2c686b;}else{_0x2f35b1=_0x2006cd+_0x2c686b;}}else{if(_0xd5c0de){_0x2f35b1=_0x430274;}else{_0x2f35b1=_0x3310b0+_0x430274;}}if(_0x93f7c8==_0x2f35b1){_0x4580ac[_0x5c1c('0x13')][_0x5c1c('0x22')]=0x1;}if(_0x93f7c8<_0x2f35b1){_0x4580ac[_0x5c1c('0x13')][_0x5c1c('0x22')]=0x2;}if(_0x93f7c8>_0x2f35b1){_0x4580ac['invoice'][_0x5c1c('0x22')]=0x3;}_0x48ed8b[_0x5c1c('0x23')]['update'](_0x4580ac['invoice'],{'where':{'id':_0x3b7846[_0x5c1c('0x10')]}})[_0x5c1c('0x12')](function(_0xb1b6a){console['log'](_0x5c1c('0x26'),_0xb1b6a);})[_0x5c1c('0x2b')](function(_0xde027e){console[_0x5c1c('0x25')](_0x5c1c('0x27'),_0xde027e);});});}});}else{_0x48ed8b['SAProforma']['find']({'where':{'id':_0x3b7846[_0x5c1c('0x29')]},'raw':!![]})[_0x5c1c('0x12')](function(_0x3af532){if(_0x3af532){_0xec58b1[_0x5c1c('0x2a')]=_0x3af532;var _0x3e49d7=![];if(_0x4580ac['invoice'][_0x5c1c('0x14')][_0x5c1c('0x15')](_0x5c1c('0x16'))!=-0x1){_0x3e49d7=!![];}return _0x48ed8b[_0x5c1c('0x2c')][_0x5c1c('0x19')]({'where':{'ProformaId':_0x3b7846[_0x5c1c('0x29')]},'raw':!![]})[_0x5c1c('0x12')](function(_0x573f6a){_0xec58b1[_0x5c1c('0x18')]=_0x573f6a;return _0x48ed8b[_0x5c1c('0xc')][_0x5c1c('0x19')]({'where':{'ProformaId':_0x3b7846[_0x5c1c('0x29')]},'raw':!![]});})[_0x5c1c('0x12')](function(_0x709b14){_0xec58b1[_0x5c1c('0x1a')]=_0x709b14;var _0x4bfc7c=0x0;var _0xf42d9=0x0;var _0x17febe=0x0;var _0xaa28f=0x0;var _0x2a97fe=0x0;for(var _0x47fee7=0x0;_0x47fee7<_0xec58b1[_0x5c1c('0x1a')][_0x5c1c('0x1b')];_0x47fee7++){_0x4bfc7c+=_0xec58b1[_0x5c1c('0x1a')][_0x47fee7][_0x5c1c('0x1c')];}for(var _0x47fee7=0x0;_0x47fee7<_0xec58b1[_0x5c1c('0x18')]['length'];_0x47fee7++){var _0x4f5b37=0x0;var _0x18de7f=0x0;var _0x16d0c7=0x0;var _0x5dd106=0x0;_0x4f5b37=_0xec58b1[_0x5c1c('0x18')][_0x47fee7][_0x5c1c('0x1d')]-_0xec58b1[_0x5c1c('0x18')][_0x47fee7][_0x5c1c('0x1d')]/0x64*_0xec58b1[_0x5c1c('0x18')][_0x47fee7][_0x5c1c('0x20')];_0x18de7f=_0x4f5b37/0x64*_0xec58b1[_0x5c1c('0x18')][_0x47fee7]['tax'];_0x16d0c7=_0x4f5b37*_0xec58b1['details'][_0x47fee7][_0x5c1c('0x1e')];_0x5dd106=_0x18de7f*_0xec58b1['details'][_0x47fee7][_0x5c1c('0x1e')];_0xaa28f+=_0x16d0c7;_0x2a97fe+=_0x5dd106;}if(!_[_0x5c1c('0x1f')](_0xec58b1[_0x5c1c('0x2a')][_0x5c1c('0x20')])){var _0x23cdf1=0x0;var _0x14e8fc=0x0;var _0x2f77f3=_0xec58b1[_0x5c1c('0x2a')][_0x5c1c('0x20')]*0x64/_0xaa28f;for(var _0x5001e4=0x0;_0x5001e4<_0xec58b1[_0x5c1c('0x18')]['length'];_0x5001e4++){var _0x5b4ff5=0x0;var _0x176f0f=0x0;var _0x42245e=0x0;_0x4f5b37=_0xec58b1['details'][_0x5001e4][_0x5c1c('0x1d')]-_0xec58b1[_0x5c1c('0x18')][_0x5001e4][_0x5c1c('0x1d')]/0x64*_0xec58b1['details'][_0x5001e4][_0x5c1c('0x20')];_0x5b4ff5=_0x4f5b37/0x64*_0x2f77f3;_0x176f0f=_0x4f5b37-_0x5b4ff5;_0x42245e=_0x176f0f*_0xec58b1[_0x5c1c('0x18')][_0x5001e4]['quantity'];_0x23cdf1+=_0x42245e;_0x14e8fc+=_0x42245e/0x64*_0xec58b1['details'][_0x5001e4][_0x5c1c('0x21')];}}if(!_[_0x5c1c('0x1f')](_0xec58b1[_0x5c1c('0x2a')]['discount'])){if(_0x3e49d7){_0xf42d9=_0x23cdf1;}else{_0xf42d9=_0x14e8fc+_0x23cdf1;}}else{if(_0x3e49d7){_0xf42d9=_0xaa28f;}else{_0xf42d9=_0x2a97fe+_0xaa28f;}}if(_0x4bfc7c==_0xf42d9){_0xec58b1[_0x5c1c('0x2a')][_0x5c1c('0x22')]=0x1;}if(_0x4bfc7c<_0xf42d9){_0xec58b1[_0x5c1c('0x2a')][_0x5c1c('0x22')]=0x2;}if(_0x4bfc7c>_0xf42d9){_0xec58b1[_0x5c1c('0x2a')][_0x5c1c('0x22')]=0x3;}_0x48ed8b['SAProforma'][_0x5c1c('0x24')](_0xec58b1['proforma'],{'where':{'id':_0x3b7846[_0x5c1c('0x29')]}})[_0x5c1c('0x12')](function(_0x30eca4){})[_0x5c1c('0x2b')](function(_0x113ecf){console['log'](_0x5c1c('0x2d'),_0x113ecf);});});}});}_0x599c2c();}}});}; \ No newline at end of file diff --git a/server/api/saPayment/saPayment.rpc.js b/server/api/saPayment/saPayment.rpc.js index 33422c2..e7b0221 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 _0x3866=['randomstring','ioredis','../../config/logger','client','http','request','SAPayment,\x20%s,\x20%s','request\x20sent','debug','SAPayment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3866,0xed));var _0x6386=function(_0xab954d,_0x16c598){_0xab954d=_0xab954d-0x0;var _0x40eab9=_0x3866[_0xab954d];return _0x40eab9;};'use strict';var _=require('lodash');var util=require(_0x6386('0x0'));var moment=require(_0x6386('0x1'));var BPromise=require(_0x6386('0x2'));var rs=require(_0x6386('0x3'));var fs=require('fs');var Redis=require(_0x6386('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6386('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6386('0x6')][_0x6386('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x59c4a9,_0x4a13ff,_0x4d2937){return new BPromise(function(_0x1e3eac,_0x345847){return client[_0x6386('0x8')](_0x59c4a9,_0x4d2937)['then'](function(_0x537179){logger['info'](_0x6386('0x9'),_0x4a13ff,_0x6386('0xa'));logger[_0x6386('0xb')](_0x6386('0xc'),_0x4a13ff,_0x6386('0xa'),JSON[_0x6386('0xd')](_0x537179));if(_0x537179[_0x6386('0xe')]){if(_0x537179['error'][_0x6386('0xf')]===0x1f4){logger[_0x6386('0xe')](_0x6386('0x9'),_0x4a13ff,_0x537179[_0x6386('0xe')][_0x6386('0x10')]);return _0x345847(_0x537179[_0x6386('0xe')][_0x6386('0x10')]);}logger[_0x6386('0xe')](_0x6386('0x9'),_0x4a13ff,_0x537179[_0x6386('0xe')]['message']);return _0x1e3eac(_0x537179[_0x6386('0xe')][_0x6386('0x10')]);}else{logger[_0x6386('0x11')]('SAPayment,\x20%s,\x20%s',_0x4a13ff,_0x6386('0xa'));_0x1e3eac(_0x537179[_0x6386('0x12')]['message']);}})[_0x6386('0x13')](function(_0x3776cc){logger[_0x6386('0xe')](_0x6386('0x9'),_0x4a13ff,_0x3776cc);_0x345847(_0x3776cc);});});} \ No newline at end of file +var _0x9fac=['SAPayment,\x20%s,\x20%s,\x20%s','stringify','error','code','SAPayment,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','then','request\x20sent','debug'];(function(_0x43d16c,_0x2b5447){var _0x208cce=function(_0x371720){while(--_0x371720){_0x43d16c['push'](_0x43d16c['shift']());}};_0x208cce(++_0x2b5447);}(_0x9fac,0x1e8));var _0xc9fa=function(_0x3f23a3,_0xe923b0){_0x3f23a3=_0x3f23a3-0x0;var _0x3e6488=_0x9fac[_0x3f23a3];return _0x3e6488;};'use strict';var _=require('lodash');var util=require(_0xc9fa('0x0'));var moment=require(_0xc9fa('0x1'));var BPromise=require('bluebird');var rs=require(_0xc9fa('0x2'));var fs=require('fs');var Redis=require(_0xc9fa('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc9fa('0x4'));var logger=require('../../config/logger')(_0xc9fa('0x5'));var config=require('../../config/environment');var jayson=require(_0xc9fa('0x6'));var client=jayson[_0xc9fa('0x7')][_0xc9fa('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5ecf7c,_0xadef91,_0x456022){return new BPromise(function(_0x368cd5,_0x378ecb){return client['request'](_0x5ecf7c,_0x456022)[_0xc9fa('0x9')](function(_0x4c1f3d){logger['info']('SAPayment,\x20%s,\x20%s',_0xadef91,_0xc9fa('0xa'));logger[_0xc9fa('0xb')](_0xc9fa('0xc'),_0xadef91,_0xc9fa('0xa'),JSON[_0xc9fa('0xd')](_0x4c1f3d));if(_0x4c1f3d[_0xc9fa('0xe')]){if(_0x4c1f3d[_0xc9fa('0xe')][_0xc9fa('0xf')]===0x1f4){logger[_0xc9fa('0xe')](_0xc9fa('0x10'),_0xadef91,_0x4c1f3d[_0xc9fa('0xe')]['message']);return _0x378ecb(_0x4c1f3d['error'][_0xc9fa('0x11')]);}logger[_0xc9fa('0xe')](_0xc9fa('0x10'),_0xadef91,_0x4c1f3d[_0xc9fa('0xe')]['message']);return _0x368cd5(_0x4c1f3d['error'][_0xc9fa('0x11')]);}else{logger['info']('SAPayment,\x20%s,\x20%s',_0xadef91,_0xc9fa('0xa'));_0x368cd5(_0x4c1f3d[_0xc9fa('0x12')][_0xc9fa('0x11')]);}})[_0xc9fa('0x13')](function(_0x514fad){logger[_0xc9fa('0xe')]('SAPayment,\x20%s,\x20%s',_0xadef91,_0x514fad);_0x378ecb(_0x514fad);});});} \ No newline at end of file diff --git a/server/api/saPaymentMethod/index.js b/server/api/saPaymentMethod/index.js index 98e1863..1d729f2 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 _0x1366=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path'];(function(_0x175b8e,_0x2313a1){var _0x439188=function(_0x3edab2){while(--_0x3edab2){_0x175b8e['push'](_0x175b8e['shift']());}};_0x439188(++_0x2313a1);}(_0x1366,0xb1));var _0x6136=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1366[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x6136('0x0'));var util=require(_0x6136('0x1'));var path=require(_0x6136('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6136('0x3')]();var auth=require(_0x6136('0x4'));var interaction=require(_0x6136('0x5'));var config=require(_0x6136('0x6'));var controller=require('./saPaymentMethod.controller');router[_0x6136('0x7')]('/',auth[_0x6136('0x8')](),controller[_0x6136('0x9')]);router[_0x6136('0x7')]('/describe',auth[_0x6136('0x8')](),controller[_0x6136('0xa')]);router[_0x6136('0x7')]('/:id',auth[_0x6136('0x8')](),controller[_0x6136('0xb')]);router[_0x6136('0xc')]('/',auth[_0x6136('0x8')](),controller[_0x6136('0xd')]);router[_0x6136('0xe')](_0x6136('0xf'),auth['isAuthenticated'](),controller[_0x6136('0x10')]);router[_0x6136('0x11')](_0x6136('0xf'),auth['isAuthenticated'](),controller[_0x6136('0x12')]);module[_0x6136('0x13')]=router; \ No newline at end of file +var _0xbe20=['../../components/interaction/service','./saPaymentMethod.controller','get','isAuthenticated','index','describe','/:id','show','post','put','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0xbe20,0x163));var _0x0be2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbe20[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x0be2('0x0'));var util=require(_0x0be2('0x1'));var path=require(_0x0be2('0x2'));var timeout=require(_0x0be2('0x3'));var express=require(_0x0be2('0x4'));var router=express['Router']();var auth=require(_0x0be2('0x5'));var interaction=require(_0x0be2('0x6'));var config=require('../../config/environment');var controller=require(_0x0be2('0x7'));router[_0x0be2('0x8')]('/',auth[_0x0be2('0x9')](),controller[_0x0be2('0xa')]);router[_0x0be2('0x8')]('/describe',auth[_0x0be2('0x9')](),controller[_0x0be2('0xb')]);router[_0x0be2('0x8')](_0x0be2('0xc'),auth[_0x0be2('0x9')](),controller[_0x0be2('0xd')]);router[_0x0be2('0xe')]('/',auth[_0x0be2('0x9')](),controller['create']);router[_0x0be2('0xf')]('/:id',auth[_0x0be2('0x9')](),controller['update']);router[_0x0be2('0x10')](_0x0be2('0xc'),auth['isAuthenticated'](),controller[_0x0be2('0x11')]);module[_0x0be2('0x12')]=router; \ No newline at end of file diff --git a/server/api/saPaymentMethod/saPaymentMethod.attributes.js b/server/api/saPaymentMethod/saPaymentMethod.attributes.js index 5245801..697f3cb 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 _0xcb58=['exports','STRING','name','sequelize'];(function(_0x1de243,_0x14f284){var _0x18ca68=function(_0x449d73){while(--_0x449d73){_0x1de243['push'](_0x1de243['shift']());}};_0x18ca68(++_0x14f284);}(_0xcb58,0x1c7));var _0x8cb5=function(_0x43fe3d,_0x250bf5){_0x43fe3d=_0x43fe3d-0x0;var _0x3ab70c=_0xcb58[_0x43fe3d];return _0x3ab70c;};'use strict';var Sequelize=require(_0x8cb5('0x0'));module[_0x8cb5('0x1')]={'name':{'type':Sequelize[_0x8cb5('0x2')],'allowNull':![],'unique':_0x8cb5('0x3')},'bankAccount':{'type':Sequelize[_0x8cb5('0x2')]},'paymentType':{'type':Sequelize[_0x8cb5('0x2')]},'bankName':{'type':Sequelize[_0x8cb5('0x2')]},'bankstreet':{'type':Sequelize[_0x8cb5('0x2')]},'bankpostalCode':{'type':Sequelize[_0x8cb5('0x2')]},'bankcity':{'type':Sequelize[_0x8cb5('0x2')]},'bankcountry':{'type':Sequelize[_0x8cb5('0x2')]},'bankBICSWIFT':{'type':Sequelize[_0x8cb5('0x2')]},'bankIBAN':{'type':Sequelize['STRING']},'bankABI':{'type':Sequelize[_0x8cb5('0x2')]},'banckCAB':{'type':Sequelize['STRING']},'paypalEmail':{'type':Sequelize[_0x8cb5('0x2')],'validate':{'isEmail':!![]}}}; \ No newline at end of file +var _0xbb7e=['STRING','name','sequelize'];(function(_0x48fefe,_0x341c3f){var _0x5dd63b=function(_0x1c08a9){while(--_0x1c08a9){_0x48fefe['push'](_0x48fefe['shift']());}};_0x5dd63b(++_0x341c3f);}(_0xbb7e,0xe9));var _0xebb7=function(_0x309a9b,_0x50e020){_0x309a9b=_0x309a9b-0x0;var _0x232bff=_0xbb7e[_0x309a9b];return _0x232bff;};'use strict';var Sequelize=require(_0xebb7('0x0'));module['exports']={'name':{'type':Sequelize[_0xebb7('0x1')],'allowNull':![],'unique':_0xebb7('0x2')},'bankAccount':{'type':Sequelize['STRING']},'paymentType':{'type':Sequelize['STRING']},'bankName':{'type':Sequelize[_0xebb7('0x1')]},'bankstreet':{'type':Sequelize[_0xebb7('0x1')]},'bankpostalCode':{'type':Sequelize[_0xebb7('0x1')]},'bankcity':{'type':Sequelize['STRING']},'bankcountry':{'type':Sequelize[_0xebb7('0x1')]},'bankBICSWIFT':{'type':Sequelize[_0xebb7('0x1')]},'bankIBAN':{'type':Sequelize['STRING']},'bankABI':{'type':Sequelize[_0xebb7('0x1')]},'banckCAB':{'type':Sequelize[_0xebb7('0x1')]},'paypalEmail':{'type':Sequelize[_0xebb7('0x1')],'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 78994dd..ee5f6dc 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(_0x4d0f9b,_0x2f6945){var _0x380118=function(_0x3f5a10){while(--_0x3f5a10){_0x4d0f9b['push'](_0x4d0f9b['shift']());}};_0x380118(++_0x2f6945);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'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(_0x3969a3,_0x1c83f1){var _0xffe60=function(_0x1de4f9){while(--_0x1de4f9){_0x3969a3['push'](_0x3969a3['shift']());}};_0xffe60(++_0x1c83f1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_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 0f6524e..c2869f0 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 _0x4375=['SAPaymentMethod','sa_paymentMethods','lodash','util','../../config/logger','api','path','rimraf','../../config/environment','exports','define'];(function(_0x4a33ca,_0x54bf02){var _0x394f13=function(_0x4577b4){while(--_0x4577b4){_0x4a33ca['push'](_0x4a33ca['shift']());}};_0x394f13(++_0x54bf02);}(_0x4375,0xff));var _0x5437=function(_0x4de5dd,_0x48a2f3){_0x4de5dd=_0x4de5dd-0x0;var _0x3cd9e2=_0x4375[_0x4de5dd];return _0x3cd9e2;};'use strict';var _=require(_0x5437('0x0'));var util=require(_0x5437('0x1'));var logger=require(_0x5437('0x2'))(_0x5437('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5437('0x4'));var rimraf=require(_0x5437('0x5'));var config=require(_0x5437('0x6'));var attributes=require('./saPaymentMethod.attributes');module[_0x5437('0x7')]=function(_0x10268e,_0x5b869e){return _0x10268e[_0x5437('0x8')](_0x5437('0x9'),attributes,{'tableName':_0x5437('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5328=['api','bluebird','request-promise','path','../../config/environment','./saPaymentMethod.attributes','define','SAPaymentMethod','sa_paymentMethods','lodash','util'];(function(_0x106cd6,_0x24812b){var _0x4fe4f1=function(_0x34675c){while(--_0x34675c){_0x106cd6['push'](_0x106cd6['shift']());}};_0x4fe4f1(++_0x24812b);}(_0x5328,0x174));var _0x8532=function(_0x316af6,_0x1f307a){_0x316af6=_0x316af6-0x0;var _0x50985f=_0x5328[_0x316af6];return _0x50985f;};'use strict';var _=require(_0x8532('0x0'));var util=require(_0x8532('0x1'));var logger=require('../../config/logger')(_0x8532('0x2'));var moment=require('moment');var BPromise=require(_0x8532('0x3'));var rp=require(_0x8532('0x4'));var fs=require('fs');var path=require(_0x8532('0x5'));var rimraf=require('rimraf');var config=require(_0x8532('0x6'));var attributes=require(_0x8532('0x7'));module['exports']=function(_0x31605d,_0x20f7e1){return _0x31605d[_0x8532('0x8')](_0x8532('0x9'),attributes,{'tableName':_0x8532('0xa'),'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 4a3ef37..126e1e3 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 _0xd941=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','request\x20sent','error','message','SAPaymentMethod,\x20%s,\x20%s'];(function(_0x1cd6b3,_0xe2c1b0){var _0x1c5572=function(_0x51a38b){while(--_0x51a38b){_0x1cd6b3['push'](_0x1cd6b3['shift']());}};_0x1c5572(++_0xe2c1b0);}(_0xd941,0x14c));var _0x1d94=function(_0x152449,_0x49f41d){_0x152449=_0x152449-0x0;var _0x5b58b2=_0xd941[_0x152449];return _0x5b58b2;};'use strict';var _=require(_0x1d94('0x0'));var util=require(_0x1d94('0x1'));var moment=require(_0x1d94('0x2'));var BPromise=require(_0x1d94('0x3'));var rs=require(_0x1d94('0x4'));var fs=require('fs');var Redis=require(_0x1d94('0x5'));var db=require(_0x1d94('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1d94('0x7'))(_0x1d94('0x8'));var config=require(_0x1d94('0x9'));var jayson=require(_0x1d94('0xa'));var client=jayson[_0x1d94('0xb')][_0x1d94('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3c41a9,_0xf67141,_0x44a836){return new BPromise(function(_0x4cd7f9,_0x41edec){return client[_0x1d94('0xd')](_0x3c41a9,_0x44a836)['then'](function(_0x1d6a18){logger[_0x1d94('0xe')]('SAPaymentMethod,\x20%s,\x20%s',_0xf67141,'request\x20sent');logger[_0x1d94('0xf')]('SAPaymentMethod,\x20%s,\x20%s,\x20%s',_0xf67141,_0x1d94('0x10'),JSON['stringify'](_0x1d6a18));if(_0x1d6a18[_0x1d94('0x11')]){if(_0x1d6a18[_0x1d94('0x11')]['code']===0x1f4){logger[_0x1d94('0x11')]('SAPaymentMethod,\x20%s,\x20%s',_0xf67141,_0x1d6a18['error'][_0x1d94('0x12')]);return _0x41edec(_0x1d6a18['error']['message']);}logger[_0x1d94('0x11')]('SAPaymentMethod,\x20%s,\x20%s',_0xf67141,_0x1d6a18[_0x1d94('0x11')][_0x1d94('0x12')]);return _0x4cd7f9(_0x1d6a18[_0x1d94('0x11')][_0x1d94('0x12')]);}else{logger['info'](_0x1d94('0x13'),_0xf67141,_0x1d94('0x10'));_0x4cd7f9(_0x1d6a18[_0x1d94('0x14')][_0x1d94('0x12')]);}})[_0x1d94('0x15')](function(_0x16b730){logger[_0x1d94('0x11')](_0x1d94('0x13'),_0xf67141,_0x16b730);_0x41edec(_0x16b730);});});} \ No newline at end of file +var _0xd6c1=['info','SAPaymentMethod,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x13456f,_0x239b00){var _0x113371=function(_0x1e666d){while(--_0x1e666d){_0x13456f['push'](_0x13456f['shift']());}};_0x113371(++_0x239b00);}(_0xd6c1,0xc6));var _0x1d6c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd6c1[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x1d6c('0x0'));var util=require(_0x1d6c('0x1'));var moment=require(_0x1d6c('0x2'));var BPromise=require(_0x1d6c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1d6c('0x4'));var db=require(_0x1d6c('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1d6c('0x6'));var config=require(_0x1d6c('0x7'));var jayson=require(_0x1d6c('0x8'));var client=jayson['client'][_0x1d6c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x339319,_0x1e14d8,_0x36248a){return new BPromise(function(_0x5dbed9,_0x160024){return client[_0x1d6c('0xa')](_0x339319,_0x36248a)[_0x1d6c('0xb')](function(_0x2639f0){logger[_0x1d6c('0xc')](_0x1d6c('0xd'),_0x1e14d8,'request\x20sent');logger[_0x1d6c('0xe')]('SAPaymentMethod,\x20%s,\x20%s,\x20%s',_0x1e14d8,_0x1d6c('0xf'),JSON[_0x1d6c('0x10')](_0x2639f0));if(_0x2639f0[_0x1d6c('0x11')]){if(_0x2639f0[_0x1d6c('0x11')]['code']===0x1f4){logger[_0x1d6c('0x11')](_0x1d6c('0xd'),_0x1e14d8,_0x2639f0['error']['message']);return _0x160024(_0x2639f0[_0x1d6c('0x11')][_0x1d6c('0x12')]);}logger['error'](_0x1d6c('0xd'),_0x1e14d8,_0x2639f0[_0x1d6c('0x11')][_0x1d6c('0x12')]);return _0x5dbed9(_0x2639f0[_0x1d6c('0x11')][_0x1d6c('0x12')]);}else{logger[_0x1d6c('0xc')](_0x1d6c('0xd'),_0x1e14d8,_0x1d6c('0xf'));_0x5dbed9(_0x2639f0[_0x1d6c('0x13')][_0x1d6c('0x12')]);}})[_0x1d6c('0x14')](function(_0x1365c4){logger['error'](_0x1d6c('0xd'),_0x1e14d8,_0x1365c4);_0x160024(_0x1365c4);});});} \ No newline at end of file diff --git a/server/api/saPriceList/index.js b/server/api/saPriceList/index.js index f403846..a11557c 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 _0xe33c=['../../config/environment','./saPriceList.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getProducts','post','/:id/clone','clone','addProduct','put','update','delete','/:id/products','removeProducts','exports','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x32a070,_0x4cd969){var _0x341045=function(_0x2d93b4){while(--_0x2d93b4){_0x32a070['push'](_0x32a070['shift']());}};_0x341045(++_0x4cd969);}(_0xe33c,0x1a4));var _0xce33=function(_0x1771db,_0x38bcc2){_0x1771db=_0x1771db-0x0;var _0x71ade8=_0xe33c[_0x1771db];return _0x71ade8;};'use strict';var multer=require('multer');var util=require(_0xce33('0x0'));var path=require('path');var timeout=require(_0xce33('0x1'));var express=require(_0xce33('0x2'));var router=express[_0xce33('0x3')]();var auth=require(_0xce33('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xce33('0x5'));var controller=require(_0xce33('0x6'));router[_0xce33('0x7')]('/',auth[_0xce33('0x8')](),controller[_0xce33('0x9')]);router[_0xce33('0x7')](_0xce33('0xa'),auth[_0xce33('0x8')](),controller[_0xce33('0xb')]);router[_0xce33('0x7')](_0xce33('0xc'),auth[_0xce33('0x8')](),controller[_0xce33('0xd')]);router[_0xce33('0x7')]('/:id/products',auth[_0xce33('0x8')](),controller[_0xce33('0xe')]);router[_0xce33('0xf')]('/',auth[_0xce33('0x8')](),controller['create']);router['post'](_0xce33('0x10'),auth[_0xce33('0x8')](),controller[_0xce33('0x11')]);router[_0xce33('0xf')]('/:id/products',auth[_0xce33('0x8')](),controller[_0xce33('0x12')]);router[_0xce33('0x13')](_0xce33('0xc'),auth[_0xce33('0x8')](),controller[_0xce33('0x14')]);router[_0xce33('0x15')](_0xce33('0xc'),auth[_0xce33('0x8')](),controller['destroy']);router[_0xce33('0x15')](_0xce33('0x16'),auth['isAuthenticated'](),controller[_0xce33('0x17')]);module[_0xce33('0x18')]=router; \ No newline at end of file +var _0xafd0=['index','get','/describe','isAuthenticated','describe','/:id','show','/:id/products','getProducts','post','/:id/clone','clone','addProduct','put','update','delete','removeProducts','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./saPriceList.controller'];(function(_0x4f4109,_0x4e3c55){var _0x34267a=function(_0x29c577){while(--_0x29c577){_0x4f4109['push'](_0x4f4109['shift']());}};_0x34267a(++_0x4e3c55);}(_0xafd0,0xb3));var _0x0afd=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0xafd0[_0x4fde08];return _0x12e725;};'use strict';var multer=require(_0x0afd('0x0'));var util=require(_0x0afd('0x1'));var path=require(_0x0afd('0x2'));var timeout=require(_0x0afd('0x3'));var express=require(_0x0afd('0x4'));var router=express[_0x0afd('0x5')]();var auth=require(_0x0afd('0x6'));var interaction=require(_0x0afd('0x7'));var config=require(_0x0afd('0x8'));var controller=require(_0x0afd('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x0afd('0xa')]);router[_0x0afd('0xb')](_0x0afd('0xc'),auth[_0x0afd('0xd')](),controller[_0x0afd('0xe')]);router[_0x0afd('0xb')](_0x0afd('0xf'),auth['isAuthenticated'](),controller[_0x0afd('0x10')]);router['get'](_0x0afd('0x11'),auth[_0x0afd('0xd')](),controller[_0x0afd('0x12')]);router[_0x0afd('0x13')]('/',auth[_0x0afd('0xd')](),controller['create']);router[_0x0afd('0x13')](_0x0afd('0x14'),auth['isAuthenticated'](),controller[_0x0afd('0x15')]);router[_0x0afd('0x13')](_0x0afd('0x11'),auth[_0x0afd('0xd')](),controller[_0x0afd('0x16')]);router[_0x0afd('0x17')]('/:id',auth[_0x0afd('0xd')](),controller[_0x0afd('0x18')]);router[_0x0afd('0x19')](_0x0afd('0xf'),auth['isAuthenticated'](),controller['destroy']);router['delete']('/:id/products',auth['isAuthenticated'](),controller[_0x0afd('0x1a')]);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 4973c49..198299b 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 _0x5a8c=['name','DECIMAL','exports','STRING'];(function(_0x2dfa9a,_0x2af0c5){var _0xa85b2a=function(_0x5dc698){while(--_0x5dc698){_0x2dfa9a['push'](_0x2dfa9a['shift']());}};_0xa85b2a(++_0x2af0c5);}(_0x5a8c,0x1e6));var _0xc5a8=function(_0x5cfe47,_0x3c4fa4){_0x5cfe47=_0x5cfe47-0x0;var _0x4754ad=_0x5a8c[_0x5cfe47];return _0x4754ad;};'use strict';var Sequelize=require('sequelize');module[_0xc5a8('0x0')]={'name':{'type':Sequelize[_0xc5a8('0x1')],'allowNull':![],'unique':_0xc5a8('0x2')},'description':{'type':Sequelize['TEXT'],'allowNull':!![]},'discount':{'type':Sequelize[_0xc5a8('0x3')](0x6,0x3),'allowNull':![]},'startAt':{'type':Sequelize['DATE'],'allowNull':!![]},'endAt':{'type':Sequelize['DATE'],'allowNull':!![]}}; \ No newline at end of file +var _0x3bff=['DATE','sequelize','name','TEXT','DECIMAL'];(function(_0x33ffc0,_0xcbf10){var _0x50fa0a=function(_0x1fa743){while(--_0x1fa743){_0x33ffc0['push'](_0x33ffc0['shift']());}};_0x50fa0a(++_0xcbf10);}(_0x3bff,0x74));var _0xf3bf=function(_0x928a02,_0x2257cd){_0x928a02=_0x928a02-0x0;var _0x30705c=_0x3bff[_0x928a02];return _0x30705c;};'use strict';var Sequelize=require(_0xf3bf('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf3bf('0x1')},'description':{'type':Sequelize[_0xf3bf('0x2')],'allowNull':!![]},'discount':{'type':Sequelize[_0xf3bf('0x3')](0x6,0x3),'allowNull':![]},'startAt':{'type':Sequelize[_0xf3bf('0x4')],'allowNull':!![]},'endAt':{'type':Sequelize[_0xf3bf('0x4')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/saPriceList/saPriceList.controller.js b/server/api/saPriceList/saPriceList.controller.js index d9d7de6..08779ce 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 _0x0651=['count','offset','apply','save','then','destroy','stack','name','send','index','SAPriceList','rawAttributes','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','options','includeAll','CmCompany','company','findAll','rows','catch','params','intersection','include','find','create','get','omit','createdAt','updatedAt','body','update','describe','getProducts','SAProductPricesList','SAProduct','Product','Pricelist','addProduct','PriceListId','removeProducts','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json'];(function(_0x1b2fe3,_0x5cd208){var _0x565167=function(_0x54e899){while(--_0x54e899){_0x1b2fe3['push'](_0x1b2fe3['shift']());}};_0x565167(++_0x5cd208);}(_0x0651,0x1a0));var _0x1065=function(_0x1ea1c3,_0x20c5e0){_0x1ea1c3=_0x1ea1c3-0x0;var _0x472958=_0x0651[_0x1ea1c3];return _0x472958;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1065('0x0'));var rimraf=require(_0x1065('0x1'));var zipdir=require(_0x1065('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1065('0x3'));var moment=require(_0x1065('0x4'));var BPromise=require(_0x1065('0x5'));var Mustache=require(_0x1065('0x6'));var util=require(_0x1065('0x7'));var path=require(_0x1065('0x8'));var sox=require(_0x1065('0x9'));var csv=require(_0x1065('0xa'));var ejs=require(_0x1065('0xb'));var fs=require('fs');var _=require(_0x1065('0xc'));var squel=require(_0x1065('0xd'));var crypto=require(_0x1065('0xe'));var jsforce=require(_0x1065('0xf'));var deskjs=require(_0x1065('0x10'));var toCsv=require(_0x1065('0xa'));var querystring=require('querystring');var Papa=require(_0x1065('0x11'));var Redis=require('ioredis');var authService=require(_0x1065('0x12'));var qs=require(_0x1065('0x13'));var hardwareService=require(_0x1065('0x14'));var logger=require(_0x1065('0x15'))(_0x1065('0x16'));var utils=require('../../config/utils');var config=require(_0x1065('0x17'));var db=require(_0x1065('0x18'))['db'];function respondWithStatusCode(_0x2ee67d,_0x4f83e9){_0x4f83e9=_0x4f83e9||0xcc;return function(_0x48c456){if(_0x48c456){return _0x2ee67d[_0x1065('0x19')](_0x4f83e9);}return _0x2ee67d[_0x1065('0x1a')](_0x4f83e9)[_0x1065('0x1b')]();};}function respondWithResult(_0x114005,_0x384766){_0x384766=_0x384766||0xc8;return function(_0x368e31){if(_0x368e31){return _0x114005[_0x1065('0x1a')](_0x384766)[_0x1065('0x1c')](_0x368e31);}};}function respondWithFilteredResult(_0xa6db85,_0x45d89e){return function(_0x12fd1f){if(_0x12fd1f){var _0x559714=_0x12fd1f[_0x1065('0x1d')],_0x48cf2e=_0x45d89e['offset'],_0x154f86=_0x45d89e[_0x1065('0x1e')]+_0x45d89e['limit'],_0x4e8f43;if(_0x154f86>=_0x559714){_0x154f86=_0x559714;_0x4e8f43=0xc8;}else{_0x4e8f43=0xce;}_0xa6db85[_0x1065('0x1a')](_0x4e8f43);return _0xa6db85['set']('Content-Range',_0x48cf2e+'-'+_0x154f86+'/'+_0x559714)[_0x1065('0x1c')](_0x12fd1f);}return null;};}function patchUpdates(_0x2561af){return function(_0x1a2c2b){try{jsonpatch[_0x1065('0x1f')](_0x1a2c2b,_0x2561af,!![]);}catch(_0x31224a){return BPromise['reject'](_0x31224a);}return _0x1a2c2b[_0x1065('0x20')]();};}function saveUpdates(_0x124218,_0x34306a){return function(_0x36152d){if(_0x36152d){return _0x36152d['update'](_0x124218)[_0x1065('0x21')](function(_0x3b83f1){return _0x3b83f1;});}return null;};}function removeEntity(_0x3fd5a8,_0x12e470){return function(_0x44150b){if(_0x44150b){return _0x44150b[_0x1065('0x22')]()[_0x1065('0x21')](function(){_0x3fd5a8[_0x1065('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52b18a,_0x1cb378){return function(_0x546f82){if(!_0x546f82){_0x52b18a[_0x1065('0x19')](0x194);}return _0x546f82;};}function handleError(_0x349551,_0x30cc30){_0x30cc30=_0x30cc30||0x1f4;return function(_0x257df5){logger['error'](_0x257df5[_0x1065('0x23')]);if(_0x257df5[_0x1065('0x24')]){delete _0x257df5[_0x1065('0x24')];}_0x349551['status'](_0x30cc30)[_0x1065('0x25')](_0x257df5);};}exports[_0x1065('0x26')]=function(_0x12c5f6,_0x1f1854){var _0x299025={},_0x575270={},_0x237882={'count':0x0,'rows':[]};var _0x22b48f=db[_0x1065('0x27')][_0x1065('0x28')];_0x575270[_0x1065('0x29')]=_[_0x1065('0x2a')](_0x22b48f);_0x575270[_0x1065('0x2b')]=_[_0x1065('0x2a')](_0x12c5f6[_0x1065('0x2b')]);_0x575270[_0x1065('0x2c')]=_['intersection'](_0x575270[_0x1065('0x29')],_0x575270[_0x1065('0x2b')]);_0x299025[_0x1065('0x2d')]=_['intersection'](_0x575270['model'],qs[_0x1065('0x2e')](_0x12c5f6['query'][_0x1065('0x2e')]));_0x299025[_0x1065('0x2d')]=_0x299025[_0x1065('0x2d')][_0x1065('0x2f')]?_0x299025[_0x1065('0x2d')]:_0x575270[_0x1065('0x29')];if(!_0x12c5f6[_0x1065('0x2b')][_0x1065('0x30')](_0x1065('0x31'))){_0x299025[_0x1065('0x32')]=qs[_0x1065('0x32')](_0x12c5f6['query']['limit']);_0x299025['offset']=qs[_0x1065('0x1e')](_0x12c5f6[_0x1065('0x2b')]['offset']);}_0x299025[_0x1065('0x33')]=qs[_0x1065('0x34')](_0x12c5f6['query'][_0x1065('0x34')]);_0x299025[_0x1065('0x35')]=qs[_0x1065('0x2c')](_[_0x1065('0x36')](_0x12c5f6[_0x1065('0x2b')],_0x575270[_0x1065('0x2c')]));if(_0x12c5f6[_0x1065('0x2b')]['filter']){_0x299025[_0x1065('0x35')]=_[_0x1065('0x37')](_0x299025['where'],{'$or':_[_0x1065('0x38')](_0x22b48f,function(_0x479698){if(_0x479698[_0x1065('0x39')][_0x1065('0x3a')]!==_0x1065('0x3b')){var _0x4df997={};_0x4df997[_0x479698[_0x1065('0x3c')]]={'$like':'%'+_0x12c5f6['query'][_0x1065('0x3d')]+'%'};return _0x4df997;}})});}_0x299025=_[_0x1065('0x37')]({},_0x299025,_0x12c5f6[_0x1065('0x3e')]);var _0x2f7cc3={'where':_0x299025[_0x1065('0x35')]};return db[_0x1065('0x27')][_0x1065('0x1d')](_0x2f7cc3)['then'](function(_0x37bc8e){_0x237882[_0x1065('0x1d')]=_0x37bc8e;if(_0x12c5f6[_0x1065('0x2b')][_0x1065('0x3f')]){_0x299025['include']=[{'model':db[_0x1065('0x40')],'as':_0x1065('0x41')}];}return db[_0x1065('0x27')][_0x1065('0x42')](_0x299025);})['then'](function(_0x2b5bd5){_0x237882[_0x1065('0x43')]=_0x2b5bd5;return _0x237882;})['then'](respondWithFilteredResult(_0x1f1854,_0x299025))[_0x1065('0x44')](handleError(_0x1f1854,null));};exports['show']=function(_0x59a607,_0x5509de){var _0x64deb6={'raw':![],'where':{'id':_0x59a607[_0x1065('0x45')]['id']}},_0x3d0261={};_0x3d0261[_0x1065('0x29')]=_[_0x1065('0x2a')](db['SAPriceList'][_0x1065('0x28')]);_0x3d0261['query']=_['keys'](_0x59a607[_0x1065('0x2b')]);_0x3d0261['filters']=_[_0x1065('0x46')](_0x3d0261[_0x1065('0x29')],_0x3d0261['query']);_0x64deb6[_0x1065('0x2d')]=_[_0x1065('0x46')](_0x3d0261[_0x1065('0x29')],qs[_0x1065('0x2e')](_0x59a607['query'][_0x1065('0x2e')]));_0x64deb6[_0x1065('0x2d')]=_0x64deb6[_0x1065('0x2d')]['length']?_0x64deb6[_0x1065('0x2d')]:_0x3d0261[_0x1065('0x29')];if(_0x59a607[_0x1065('0x2b')]['includeAll']){_0x64deb6[_0x1065('0x47')]=[{'all':!![]}];}_0x64deb6=_[_0x1065('0x37')]({},_0x64deb6,_0x59a607[_0x1065('0x3e')]);return db[_0x1065('0x27')][_0x1065('0x48')](_0x64deb6)['then'](handleEntityNotFound(_0x5509de,null))[_0x1065('0x21')](respondWithResult(_0x5509de,null))[_0x1065('0x44')](handleError(_0x5509de,null));};exports[_0x1065('0x49')]=function(_0x5ef4c4,_0x35c2a0){return db[_0x1065('0x27')][_0x1065('0x49')](_0x5ef4c4['body'],{})[_0x1065('0x21')](respondWithResult(_0x35c2a0,0xc9))[_0x1065('0x44')](handleError(_0x35c2a0,null));};exports['clone']=function(_0x2ee772,_0x444938){var _0x2847a1={'raw':![],'where':{'id':_0x2ee772[_0x1065('0x45')]['id']}},_0x6d2523={};_0x6d2523[_0x1065('0x29')]=_[_0x1065('0x2a')](db['SAPriceList'][_0x1065('0x28')]);_0x2847a1['attributes']=_['intersection'](_0x6d2523['model'],qs[_0x1065('0x2e')](_0x2ee772[_0x1065('0x2b')]['fields']));_0x2847a1[_0x1065('0x2d')]=_0x2847a1['attributes']['length']?_0x2847a1[_0x1065('0x2d')]:_0x6d2523['model'];if(_0x2ee772['query'][_0x1065('0x3f')]){_0x2847a1['include']=[{'all':!![]}];}_0x2847a1=_[_0x1065('0x37')]({},_0x2847a1,_0x2ee772[_0x1065('0x3e')]);return db[_0x1065('0x27')][_0x1065('0x48')](_0x2847a1)['then'](handleEntityNotFound(_0x444938,null))[_0x1065('0x21')](function(_0x3021d4){if(_0x3021d4){var _0x4236f7=_0x3021d4[_0x1065('0x4a')]({'plain':!![]});_0x4236f7=qs[_0x1065('0x4b')](_0x4236f7,['id',_0x1065('0x4c'),_0x1065('0x4d')]);_0x2ee772[_0x1065('0x4e')]=_[_0x1065('0x4b')](_0x2ee772['body'],['id',_0x1065('0x4c'),'updatedAt']);return db['SAPriceList'][_0x1065('0x49')](_[_0x1065('0x37')](_0x4236f7,_0x2ee772['body']),{'include':_0x2ee772[_0x1065('0x2b')][_0x1065('0x3f')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x444938,0xc9))[_0x1065('0x44')](handleError(_0x444938,null));};exports[_0x1065('0x4f')]=function(_0x26e2a6,_0x322193){if(_0x26e2a6[_0x1065('0x4e')]['id']){delete _0x26e2a6[_0x1065('0x4e')]['id'];}return db[_0x1065('0x27')]['find']({'where':{'id':_0x26e2a6['params']['id']}})[_0x1065('0x21')](handleEntityNotFound(_0x322193,null))['then'](saveUpdates(_0x26e2a6[_0x1065('0x4e')],null))[_0x1065('0x21')](respondWithResult(_0x322193,null))[_0x1065('0x44')](handleError(_0x322193,null));};exports[_0x1065('0x22')]=function(_0x57026f,_0x42119f){return db['SAPriceList'][_0x1065('0x48')]({'where':{'id':_0x57026f['params']['id']}})[_0x1065('0x21')](handleEntityNotFound(_0x42119f,null))[_0x1065('0x21')](removeEntity(_0x42119f,null))[_0x1065('0x44')](handleError(_0x42119f,null));};exports[_0x1065('0x50')]=function(_0x297cbb,_0x5efaf2){return db[_0x1065('0x27')][_0x1065('0x50')]()['then'](respondWithResult(_0x5efaf2,null))['catch'](handleError(_0x5efaf2,null));};exports[_0x1065('0x51')]=function(_0xdc6be3,_0x1dd9f0,_0x92f208){var _0x250c8e={'raw':![],'where':{}};var _0x2be509={};var _0x24cd2b={'count':0x0,'rows':[]};return db['SAPriceList']['findOne']({'where':{'id':_0xdc6be3[_0x1065('0x45')]['id']}})['then'](handleEntityNotFound(_0x1dd9f0,null))['then'](function(_0x3bba4e){if(_0x3bba4e){_0x2be509[_0x1065('0x29')]=_[_0x1065('0x2a')](db['SAProductPricesList'][_0x1065('0x28')]);_0x2be509['query']=_[_0x1065('0x2a')](_0xdc6be3[_0x1065('0x2b')]);_0x2be509[_0x1065('0x2c')]=_['intersection'](_0x2be509[_0x1065('0x29')],_0x2be509['query']);_0x250c8e[_0x1065('0x2d')]=_[_0x1065('0x46')](_0x2be509[_0x1065('0x29')],qs[_0x1065('0x2e')](_0xdc6be3[_0x1065('0x2b')][_0x1065('0x2e')]));_0x250c8e['attributes']=_0x250c8e[_0x1065('0x2d')][_0x1065('0x2f')]?_0x250c8e[_0x1065('0x2d')]:_0x2be509[_0x1065('0x29')];if(!_0xdc6be3[_0x1065('0x2b')]['hasOwnProperty']('nolimit')){_0x250c8e[_0x1065('0x32')]=qs[_0x1065('0x32')](_0xdc6be3[_0x1065('0x2b')]['limit']);_0x250c8e[_0x1065('0x1e')]=qs[_0x1065('0x1e')](_0xdc6be3[_0x1065('0x2b')]['offset']);}_0x250c8e['order']=qs[_0x1065('0x34')](_0xdc6be3[_0x1065('0x2b')][_0x1065('0x34')]);_0x250c8e[_0x1065('0x35')]=qs['filters'](_[_0x1065('0x36')](_0xdc6be3[_0x1065('0x2b')],_0x2be509[_0x1065('0x2c')]));_0x250c8e[_0x1065('0x35')]['PriceListId']=_0x3bba4e['id'];if(_0xdc6be3[_0x1065('0x2b')][_0x1065('0x3d')]){_0x250c8e[_0x1065('0x35')]=_['merge'](_0x250c8e[_0x1065('0x35')],{'$or':_['map'](_0x250c8e[_0x1065('0x2d')],function(_0x3a5bc3){var _0x34818d={};_0x34818d[_0x3a5bc3]={'$like':'%'+_0xdc6be3['query'][_0x1065('0x3d')]+'%'};return _0x34818d;})});}_0x250c8e=_[_0x1065('0x37')]({},_0x250c8e,_0xdc6be3['options']);return db[_0x1065('0x52')]['count']({'where':_0x250c8e['where']})[_0x1065('0x21')](function(_0x5da806){_0x24cd2b['count']=_0x5da806;if(_0xdc6be3['query'][_0x1065('0x3f')]){_0x250c8e[_0x1065('0x47')]=[{'model':db[_0x1065('0x53')],'as':_0x1065('0x54'),'include':[{'all':!![]}]},{'model':db[_0x1065('0x27')],'as':_0x1065('0x55')}];}return db[_0x1065('0x52')][_0x1065('0x42')](_0x250c8e);})[_0x1065('0x21')](function(_0x260854){_0x24cd2b[_0x1065('0x43')]=_0x260854;return _0x24cd2b;});}})[_0x1065('0x21')](respondWithFilteredResult(_0x1dd9f0,_0x250c8e))[_0x1065('0x44')](handleError(_0x1dd9f0,null));};exports[_0x1065('0x56')]=function(_0x1bfe34,_0x2e4a38,_0x901cf3){if(_0x1bfe34[_0x1065('0x4e')]['id']){delete _0x1bfe34[_0x1065('0x4e')]['id'];}return db[_0x1065('0x27')]['find']({'where':{'id':_0x1bfe34[_0x1065('0x45')]['id']}})[_0x1065('0x21')](handleEntityNotFound(_0x2e4a38,null))[_0x1065('0x21')](function(_0xbbfd9b){if(_0xbbfd9b){_0x1bfe34['body'][_0x1065('0x57')]=_0xbbfd9b['id'];return db[_0x1065('0x52')][_0x1065('0x49')](_0x1bfe34[_0x1065('0x4e')]);}})[_0x1065('0x21')](respondWithResult(_0x2e4a38,null))[_0x1065('0x44')](handleError(_0x2e4a38,null));};exports[_0x1065('0x58')]=function(_0x4b422c,_0x5c1253,_0x5ecb86){return db['SAProductPricesList'][_0x1065('0x48')]({'where':{'id':_0x4b422c['params']['id']}})['then'](handleEntityNotFound(_0x5c1253,null))['then'](function(_0x3aeb95){if(_0x3aeb95){return _0x3aeb95[_0x1065('0x58')](_0x4b422c[_0x1065('0x2b')]['ids']);}})['then'](respondWithStatusCode(_0x5c1253,null))[_0x1065('0x44')](handleError(_0x5c1253,null));}; \ No newline at end of file +var _0x0b22=['SAProductPricesList','Product','Pricelist','findAll','addProduct','removeProducts','ids','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','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','SAPriceList','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','field','count','include','rows','params','includeAll','find','create','body','catch','options','get','createdAt','updatedAt','omit','describe','findOne','PriceListId','map'];(function(_0x54d283,_0xdf38c0){var _0x591ab4=function(_0x1edff0){while(--_0x1edff0){_0x54d283['push'](_0x54d283['shift']());}};_0x591ab4(++_0xdf38c0);}(_0x0b22,0x1b0));var _0x20b2=function(_0x25a275,_0x11b6d7){_0x25a275=_0x25a275-0x0;var _0x3fcb5a=_0x0b22[_0x25a275];return _0x3fcb5a;};'use strict';var pdf=require(_0x20b2('0x0'));var emlformat=require(_0x20b2('0x1'));var rimraf=require(_0x20b2('0x2'));var zipdir=require(_0x20b2('0x3'));var jsonpatch=require(_0x20b2('0x4'));var rp=require(_0x20b2('0x5'));var moment=require(_0x20b2('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x20b2('0x7'));var util=require(_0x20b2('0x8'));var path=require(_0x20b2('0x9'));var sox=require(_0x20b2('0xa'));var csv=require(_0x20b2('0xb'));var ejs=require(_0x20b2('0xc'));var fs=require('fs');var _=require(_0x20b2('0xd'));var squel=require(_0x20b2('0xe'));var crypto=require(_0x20b2('0xf'));var jsforce=require(_0x20b2('0x10'));var deskjs=require(_0x20b2('0x11'));var toCsv=require(_0x20b2('0xb'));var querystring=require(_0x20b2('0x12'));var Papa=require(_0x20b2('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x20b2('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x20b2('0x15'));var db=require(_0x20b2('0x16'))['db'];function respondWithStatusCode(_0x2e13b,_0x9ad3e3){_0x9ad3e3=_0x9ad3e3||0xcc;return function(_0x278048){if(_0x278048){return _0x2e13b[_0x20b2('0x17')](_0x9ad3e3);}return _0x2e13b[_0x20b2('0x18')](_0x9ad3e3)[_0x20b2('0x19')]();};}function respondWithResult(_0x3f9bdf,_0x55fa16){_0x55fa16=_0x55fa16||0xc8;return function(_0x19785c){if(_0x19785c){return _0x3f9bdf[_0x20b2('0x18')](_0x55fa16)[_0x20b2('0x1a')](_0x19785c);}};}function respondWithFilteredResult(_0x1f8afc,_0x1779f7){return function(_0x3f700e){if(_0x3f700e){var _0xa60a08=_0x3f700e['count'],_0x1c7d67=_0x1779f7[_0x20b2('0x1b')],_0x1fc94b=_0x1779f7[_0x20b2('0x1b')]+_0x1779f7[_0x20b2('0x1c')],_0x35b657;if(_0x1fc94b>=_0xa60a08){_0x1fc94b=_0xa60a08;_0x35b657=0xc8;}else{_0x35b657=0xce;}_0x1f8afc[_0x20b2('0x18')](_0x35b657);return _0x1f8afc['set'](_0x20b2('0x1d'),_0x1c7d67+'-'+_0x1fc94b+'/'+_0xa60a08)['json'](_0x3f700e);}return null;};}function patchUpdates(_0x2a95b4){return function(_0x44da70){try{jsonpatch['apply'](_0x44da70,_0x2a95b4,!![]);}catch(_0x53cf5c){return BPromise[_0x20b2('0x1e')](_0x53cf5c);}return _0x44da70[_0x20b2('0x1f')]();};}function saveUpdates(_0x443a40,_0x5ce35f){return function(_0x1a3d97){if(_0x1a3d97){return _0x1a3d97[_0x20b2('0x20')](_0x443a40)[_0x20b2('0x21')](function(_0x3d8225){return _0x3d8225;});}return null;};}function removeEntity(_0x57ea05,_0x45609b){return function(_0x18601f){if(_0x18601f){return _0x18601f[_0x20b2('0x22')]()[_0x20b2('0x21')](function(){_0x57ea05[_0x20b2('0x18')](0xcc)[_0x20b2('0x19')]();});}};}function handleEntityNotFound(_0x1cb65c,_0x2440aa){return function(_0x7e89b1){if(!_0x7e89b1){_0x1cb65c['sendStatus'](0x194);}return _0x7e89b1;};}function handleError(_0xd34af0,_0x787441){_0x787441=_0x787441||0x1f4;return function(_0x4782c0){logger[_0x20b2('0x23')](_0x4782c0[_0x20b2('0x24')]);if(_0x4782c0[_0x20b2('0x25')]){delete _0x4782c0[_0x20b2('0x25')];}_0xd34af0['status'](_0x787441)[_0x20b2('0x26')](_0x4782c0);};}exports[_0x20b2('0x27')]=function(_0x404fe0,_0x53f5aa){var _0x4f6629={},_0x26d461={},_0x2f4887={'count':0x0,'rows':[]};var _0x2305a9=db[_0x20b2('0x28')][_0x20b2('0x29')];_0x26d461[_0x20b2('0x2a')]=_[_0x20b2('0x2b')](_0x2305a9);_0x26d461[_0x20b2('0x2c')]=_[_0x20b2('0x2b')](_0x404fe0[_0x20b2('0x2c')]);_0x26d461['filters']=_[_0x20b2('0x2d')](_0x26d461[_0x20b2('0x2a')],_0x26d461['query']);_0x4f6629[_0x20b2('0x2e')]=_['intersection'](_0x26d461[_0x20b2('0x2a')],qs['fields'](_0x404fe0[_0x20b2('0x2c')][_0x20b2('0x2f')]));_0x4f6629[_0x20b2('0x2e')]=_0x4f6629[_0x20b2('0x2e')][_0x20b2('0x30')]?_0x4f6629[_0x20b2('0x2e')]:_0x26d461['model'];if(!_0x404fe0['query'][_0x20b2('0x31')](_0x20b2('0x32'))){_0x4f6629[_0x20b2('0x1c')]=qs[_0x20b2('0x1c')](_0x404fe0[_0x20b2('0x2c')][_0x20b2('0x1c')]);_0x4f6629['offset']=qs['offset'](_0x404fe0[_0x20b2('0x2c')][_0x20b2('0x1b')]);}_0x4f6629[_0x20b2('0x33')]=qs[_0x20b2('0x34')](_0x404fe0['query'][_0x20b2('0x34')]);_0x4f6629[_0x20b2('0x35')]=qs[_0x20b2('0x36')](_[_0x20b2('0x37')](_0x404fe0[_0x20b2('0x2c')],_0x26d461[_0x20b2('0x36')]));if(_0x404fe0[_0x20b2('0x2c')][_0x20b2('0x38')]){_0x4f6629[_0x20b2('0x35')]=_[_0x20b2('0x39')](_0x4f6629[_0x20b2('0x35')],{'$or':_['map'](_0x2305a9,function(_0xbc53f4){if(_0xbc53f4[_0x20b2('0x3a')]['key']!=='VIRTUAL'){var _0x591243={};_0x591243[_0xbc53f4[_0x20b2('0x3b')]]={'$like':'%'+_0x404fe0[_0x20b2('0x2c')][_0x20b2('0x38')]+'%'};return _0x591243;}})});}_0x4f6629=_['merge']({},_0x4f6629,_0x404fe0['options']);var _0x22a54e={'where':_0x4f6629[_0x20b2('0x35')]};return db[_0x20b2('0x28')][_0x20b2('0x3c')](_0x22a54e)[_0x20b2('0x21')](function(_0x30c3a1){_0x2f4887['count']=_0x30c3a1;if(_0x404fe0[_0x20b2('0x2c')]['includeAll']){_0x4f6629[_0x20b2('0x3d')]=[{'model':db['CmCompany'],'as':'company'}];}return db[_0x20b2('0x28')]['findAll'](_0x4f6629);})[_0x20b2('0x21')](function(_0x577ea2){_0x2f4887[_0x20b2('0x3e')]=_0x577ea2;return _0x2f4887;})[_0x20b2('0x21')](respondWithFilteredResult(_0x53f5aa,_0x4f6629))['catch'](handleError(_0x53f5aa,null));};exports['show']=function(_0x4960ee,_0x58c948){var _0x440639={'raw':![],'where':{'id':_0x4960ee[_0x20b2('0x3f')]['id']}},_0x317859={};_0x317859[_0x20b2('0x2a')]=_['keys'](db[_0x20b2('0x28')]['rawAttributes']);_0x317859[_0x20b2('0x2c')]=_[_0x20b2('0x2b')](_0x4960ee['query']);_0x317859[_0x20b2('0x36')]=_[_0x20b2('0x2d')](_0x317859[_0x20b2('0x2a')],_0x317859[_0x20b2('0x2c')]);_0x440639[_0x20b2('0x2e')]=_[_0x20b2('0x2d')](_0x317859[_0x20b2('0x2a')],qs['fields'](_0x4960ee[_0x20b2('0x2c')]['fields']));_0x440639[_0x20b2('0x2e')]=_0x440639[_0x20b2('0x2e')][_0x20b2('0x30')]?_0x440639['attributes']:_0x317859['model'];if(_0x4960ee['query'][_0x20b2('0x40')]){_0x440639[_0x20b2('0x3d')]=[{'all':!![]}];}_0x440639=_['merge']({},_0x440639,_0x4960ee['options']);return db[_0x20b2('0x28')][_0x20b2('0x41')](_0x440639)[_0x20b2('0x21')](handleEntityNotFound(_0x58c948,null))[_0x20b2('0x21')](respondWithResult(_0x58c948,null))['catch'](handleError(_0x58c948,null));};exports[_0x20b2('0x42')]=function(_0x4fb8bb,_0x2e895b){return db['SAPriceList'][_0x20b2('0x42')](_0x4fb8bb[_0x20b2('0x43')],{})[_0x20b2('0x21')](respondWithResult(_0x2e895b,0xc9))[_0x20b2('0x44')](handleError(_0x2e895b,null));};exports['clone']=function(_0xdc687c,_0x3b3ce6){var _0x221d8d={'raw':![],'where':{'id':_0xdc687c[_0x20b2('0x3f')]['id']}},_0x9d46c4={};_0x9d46c4[_0x20b2('0x2a')]=_['keys'](db[_0x20b2('0x28')][_0x20b2('0x29')]);_0x221d8d[_0x20b2('0x2e')]=_['intersection'](_0x9d46c4['model'],qs[_0x20b2('0x2f')](_0xdc687c[_0x20b2('0x2c')][_0x20b2('0x2f')]));_0x221d8d[_0x20b2('0x2e')]=_0x221d8d[_0x20b2('0x2e')][_0x20b2('0x30')]?_0x221d8d['attributes']:_0x9d46c4['model'];if(_0xdc687c[_0x20b2('0x2c')][_0x20b2('0x40')]){_0x221d8d[_0x20b2('0x3d')]=[{'all':!![]}];}_0x221d8d=_[_0x20b2('0x39')]({},_0x221d8d,_0xdc687c[_0x20b2('0x45')]);return db[_0x20b2('0x28')][_0x20b2('0x41')](_0x221d8d)[_0x20b2('0x21')](handleEntityNotFound(_0x3b3ce6,null))[_0x20b2('0x21')](function(_0x44e4d4){if(_0x44e4d4){var _0x1e19f0=_0x44e4d4[_0x20b2('0x46')]({'plain':!![]});_0x1e19f0=qs['omit'](_0x1e19f0,['id',_0x20b2('0x47'),_0x20b2('0x48')]);_0xdc687c[_0x20b2('0x43')]=_[_0x20b2('0x49')](_0xdc687c['body'],['id',_0x20b2('0x47'),'updatedAt']);return db['SAPriceList'][_0x20b2('0x42')](_[_0x20b2('0x39')](_0x1e19f0,_0xdc687c[_0x20b2('0x43')]),{'include':_0xdc687c[_0x20b2('0x2c')][_0x20b2('0x40')]?[{'all':!![]}]:undefined});}})[_0x20b2('0x21')](respondWithResult(_0x3b3ce6,0xc9))[_0x20b2('0x44')](handleError(_0x3b3ce6,null));};exports[_0x20b2('0x20')]=function(_0x145ff9,_0x4f870e){if(_0x145ff9[_0x20b2('0x43')]['id']){delete _0x145ff9[_0x20b2('0x43')]['id'];}return db[_0x20b2('0x28')]['find']({'where':{'id':_0x145ff9[_0x20b2('0x3f')]['id']}})[_0x20b2('0x21')](handleEntityNotFound(_0x4f870e,null))[_0x20b2('0x21')](saveUpdates(_0x145ff9[_0x20b2('0x43')],null))[_0x20b2('0x21')](respondWithResult(_0x4f870e,null))[_0x20b2('0x44')](handleError(_0x4f870e,null));};exports[_0x20b2('0x22')]=function(_0x25c255,_0x5d7e17){return db['SAPriceList'][_0x20b2('0x41')]({'where':{'id':_0x25c255['params']['id']}})[_0x20b2('0x21')](handleEntityNotFound(_0x5d7e17,null))[_0x20b2('0x21')](removeEntity(_0x5d7e17,null))[_0x20b2('0x44')](handleError(_0x5d7e17,null));};exports[_0x20b2('0x4a')]=function(_0x10a756,_0x27e754){return db['SAPriceList'][_0x20b2('0x4a')]()[_0x20b2('0x21')](respondWithResult(_0x27e754,null))[_0x20b2('0x44')](handleError(_0x27e754,null));};exports['getProducts']=function(_0x15447d,_0x443584,_0x45d616){var _0x61500a={'raw':![],'where':{}};var _0x182434={};var _0x7badbb={'count':0x0,'rows':[]};return db['SAPriceList'][_0x20b2('0x4b')]({'where':{'id':_0x15447d['params']['id']}})[_0x20b2('0x21')](handleEntityNotFound(_0x443584,null))['then'](function(_0x365b69){if(_0x365b69){_0x182434[_0x20b2('0x2a')]=_[_0x20b2('0x2b')](db['SAProductPricesList'][_0x20b2('0x29')]);_0x182434[_0x20b2('0x2c')]=_[_0x20b2('0x2b')](_0x15447d[_0x20b2('0x2c')]);_0x182434['filters']=_[_0x20b2('0x2d')](_0x182434[_0x20b2('0x2a')],_0x182434[_0x20b2('0x2c')]);_0x61500a[_0x20b2('0x2e')]=_[_0x20b2('0x2d')](_0x182434[_0x20b2('0x2a')],qs[_0x20b2('0x2f')](_0x15447d[_0x20b2('0x2c')]['fields']));_0x61500a[_0x20b2('0x2e')]=_0x61500a[_0x20b2('0x2e')]['length']?_0x61500a['attributes']:_0x182434[_0x20b2('0x2a')];if(!_0x15447d['query']['hasOwnProperty'](_0x20b2('0x32'))){_0x61500a[_0x20b2('0x1c')]=qs[_0x20b2('0x1c')](_0x15447d[_0x20b2('0x2c')]['limit']);_0x61500a[_0x20b2('0x1b')]=qs[_0x20b2('0x1b')](_0x15447d[_0x20b2('0x2c')][_0x20b2('0x1b')]);}_0x61500a[_0x20b2('0x33')]=qs[_0x20b2('0x34')](_0x15447d[_0x20b2('0x2c')]['sort']);_0x61500a[_0x20b2('0x35')]=qs[_0x20b2('0x36')](_[_0x20b2('0x37')](_0x15447d['query'],_0x182434[_0x20b2('0x36')]));_0x61500a[_0x20b2('0x35')][_0x20b2('0x4c')]=_0x365b69['id'];if(_0x15447d['query'][_0x20b2('0x38')]){_0x61500a[_0x20b2('0x35')]=_[_0x20b2('0x39')](_0x61500a[_0x20b2('0x35')],{'$or':_[_0x20b2('0x4d')](_0x61500a[_0x20b2('0x2e')],function(_0x5eb321){var _0x483477={};_0x483477[_0x5eb321]={'$like':'%'+_0x15447d[_0x20b2('0x2c')]['filter']+'%'};return _0x483477;})});}_0x61500a=_[_0x20b2('0x39')]({},_0x61500a,_0x15447d[_0x20b2('0x45')]);return db[_0x20b2('0x4e')]['count']({'where':_0x61500a[_0x20b2('0x35')]})[_0x20b2('0x21')](function(_0x5805fa){_0x7badbb[_0x20b2('0x3c')]=_0x5805fa;if(_0x15447d['query'][_0x20b2('0x40')]){_0x61500a[_0x20b2('0x3d')]=[{'model':db['SAProduct'],'as':_0x20b2('0x4f'),'include':[{'all':!![]}]},{'model':db[_0x20b2('0x28')],'as':_0x20b2('0x50')}];}return db['SAProductPricesList'][_0x20b2('0x51')](_0x61500a);})['then'](function(_0x8800a6){_0x7badbb[_0x20b2('0x3e')]=_0x8800a6;return _0x7badbb;});}})[_0x20b2('0x21')](respondWithFilteredResult(_0x443584,_0x61500a))[_0x20b2('0x44')](handleError(_0x443584,null));};exports[_0x20b2('0x52')]=function(_0x12cc69,_0x518b22,_0x30508f){if(_0x12cc69[_0x20b2('0x43')]['id']){delete _0x12cc69[_0x20b2('0x43')]['id'];}return db[_0x20b2('0x28')]['find']({'where':{'id':_0x12cc69[_0x20b2('0x3f')]['id']}})[_0x20b2('0x21')](handleEntityNotFound(_0x518b22,null))[_0x20b2('0x21')](function(_0x4cc7d0){if(_0x4cc7d0){_0x12cc69[_0x20b2('0x43')][_0x20b2('0x4c')]=_0x4cc7d0['id'];return db[_0x20b2('0x4e')][_0x20b2('0x42')](_0x12cc69[_0x20b2('0x43')]);}})[_0x20b2('0x21')](respondWithResult(_0x518b22,null))[_0x20b2('0x44')](handleError(_0x518b22,null));};exports[_0x20b2('0x53')]=function(_0x3a245e,_0x165510,_0x30d897){return db[_0x20b2('0x4e')][_0x20b2('0x41')]({'where':{'id':_0x3a245e[_0x20b2('0x3f')]['id']}})[_0x20b2('0x21')](handleEntityNotFound(_0x165510,null))[_0x20b2('0x21')](function(_0x4c7dd2){if(_0x4c7dd2){return _0x4c7dd2[_0x20b2('0x53')](_0x3a245e[_0x20b2('0x2c')][_0x20b2('0x54')]);}})[_0x20b2('0x21')](respondWithStatusCode(_0x165510,null))[_0x20b2('0x44')](handleError(_0x165510,null));}; \ No newline at end of file diff --git a/server/api/saPriceList/saPriceList.model.js b/server/api/saPriceList/saPriceList.model.js index 8b29eef..b280c03 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(_0x15de11,_0x3cd20d){var _0x4f1c07=function(_0xf74624){while(--_0xf74624){_0x15de11['push'](_0x15de11['shift']());}};_0x4f1c07(++_0x3cd20d);}(_0xb10b,0x12a));var _0xbb10=function(_0x495e9f,_0x1b1d80){_0x495e9f=_0x495e9f-0x0;var _0xb249d2=_0xb10b[_0x495e9f];return _0xb249d2;};'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(_0x18abd2,_0x22d4b3){var _0x1dcad6=function(_0xcc08c4){while(--_0xcc08c4){_0x18abd2['push'](_0x18abd2['shift']());}};_0x1dcad6(++_0x22d4b3);}(_0xb10b,0x12a));var _0xbb10=function(_0x34c0bf,_0x3b8460){_0x34c0bf=_0x34c0bf-0x0;var _0x315559=_0xb10b[_0x34c0bf];return _0x315559;};'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 cc44795..621248a 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 _0x2932=['SAPriceList,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SAPriceList,\x20%s,\x20%s','debug'];(function(_0x3c2a1a,_0x49008a){var _0x279dfa=function(_0x4e16f6){while(--_0x4e16f6){_0x3c2a1a['push'](_0x3c2a1a['shift']());}};_0x279dfa(++_0x49008a);}(_0x2932,0x1ca));var _0x2293=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0x2932[_0x9c2427];return _0x51984f;};'use strict';var _=require(_0x2293('0x0'));var util=require(_0x2293('0x1'));var moment=require(_0x2293('0x2'));var BPromise=require('bluebird');var rs=require(_0x2293('0x3'));var fs=require('fs');var Redis=require(_0x2293('0x4'));var db=require(_0x2293('0x5'))['db'];var utils=require(_0x2293('0x6'));var logger=require('../../config/logger')(_0x2293('0x7'));var config=require(_0x2293('0x8'));var jayson=require(_0x2293('0x9'));var client=jayson[_0x2293('0xa')][_0x2293('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc182ad,_0x4b7272,_0x31cae6){return new BPromise(function(_0x425cf9,_0x4603c6){return client[_0x2293('0xc')](_0xc182ad,_0x31cae6)[_0x2293('0xd')](function(_0x3b21e0){logger[_0x2293('0xe')](_0x2293('0xf'),_0x4b7272,'request\x20sent');logger[_0x2293('0x10')](_0x2293('0x11'),_0x4b7272,_0x2293('0x12'),JSON[_0x2293('0x13')](_0x3b21e0));if(_0x3b21e0[_0x2293('0x14')]){if(_0x3b21e0[_0x2293('0x14')][_0x2293('0x15')]===0x1f4){logger['error'](_0x2293('0xf'),_0x4b7272,_0x3b21e0[_0x2293('0x14')][_0x2293('0x16')]);return _0x4603c6(_0x3b21e0[_0x2293('0x14')][_0x2293('0x16')]);}logger['error'](_0x2293('0xf'),_0x4b7272,_0x3b21e0['error'][_0x2293('0x16')]);return _0x425cf9(_0x3b21e0[_0x2293('0x14')][_0x2293('0x16')]);}else{logger[_0x2293('0xe')](_0x2293('0xf'),_0x4b7272,_0x2293('0x12'));_0x425cf9(_0x3b21e0[_0x2293('0x17')][_0x2293('0x16')]);}})[_0x2293('0x18')](function(_0x13cbe8){logger[_0x2293('0x14')](_0x2293('0xf'),_0x4b7272,_0x13cbe8);_0x4603c6(_0x13cbe8);});});} \ No newline at end of file +var _0xa4d1=['SAPriceList,\x20%s,\x20%s','debug','SAPriceList,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info'];(function(_0x16eb11,_0x1a2251){var _0x3ae7ef=function(_0x575a01){while(--_0x575a01){_0x16eb11['push'](_0x16eb11['shift']());}};_0x3ae7ef(++_0x1a2251);}(_0xa4d1,0xb1));var _0x1a4d=function(_0x487c74,_0x110cbb){_0x487c74=_0x487c74-0x0;var _0x4ef088=_0xa4d1[_0x487c74];return _0x4ef088;};'use strict';var _=require(_0x1a4d('0x0'));var util=require(_0x1a4d('0x1'));var moment=require(_0x1a4d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a4d('0x3'));var db=require(_0x1a4d('0x4'))['db'];var utils=require(_0x1a4d('0x5'));var logger=require('../../config/logger')(_0x1a4d('0x6'));var config=require(_0x1a4d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1a4d('0x8')][_0x1a4d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a36e6,_0x2c52dd,_0x357048){return new BPromise(function(_0x562eee,_0x1f9d91){return client[_0x1a4d('0xa')](_0x2a36e6,_0x357048)[_0x1a4d('0xb')](function(_0x271312){logger[_0x1a4d('0xc')](_0x1a4d('0xd'),_0x2c52dd,'request\x20sent');logger[_0x1a4d('0xe')](_0x1a4d('0xf'),_0x2c52dd,'request\x20sent',JSON['stringify'](_0x271312));if(_0x271312[_0x1a4d('0x10')]){if(_0x271312[_0x1a4d('0x10')]['code']===0x1f4){logger[_0x1a4d('0x10')](_0x1a4d('0xd'),_0x2c52dd,_0x271312[_0x1a4d('0x10')][_0x1a4d('0x11')]);return _0x1f9d91(_0x271312[_0x1a4d('0x10')]['message']);}logger[_0x1a4d('0x10')](_0x1a4d('0xd'),_0x2c52dd,_0x271312[_0x1a4d('0x10')]['message']);return _0x562eee(_0x271312[_0x1a4d('0x10')][_0x1a4d('0x11')]);}else{logger[_0x1a4d('0xc')](_0x1a4d('0xd'),_0x2c52dd,'request\x20sent');_0x562eee(_0x271312['result']['message']);}})[_0x1a4d('0x12')](function(_0x47b351){logger['error'](_0x1a4d('0xd'),_0x2c52dd,_0x47b351);_0x1f9d91(_0x47b351);});});} \ No newline at end of file diff --git a/server/api/saProduct/index.js b/server/api/saProduct/index.js index fe02957..deb8cbb 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 _0xc21d=['util','path','express','Router','get','isAuthenticated','index','/describe','describe','/:id','show','post','/:id/clone','clone','put','exports','multer'];(function(_0x25ea00,_0x52e048){var _0x3611d4=function(_0x5d4033){while(--_0x5d4033){_0x25ea00['push'](_0x25ea00['shift']());}};_0x3611d4(++_0x52e048);}(_0xc21d,0x1a8));var _0xdc21=function(_0x556452,_0x30f4f7){_0x556452=_0x556452-0x0;var _0x496c74=_0xc21d[_0x556452];return _0x496c74;};'use strict';var multer=require(_0xdc21('0x0'));var util=require(_0xdc21('0x1'));var path=require(_0xdc21('0x2'));var timeout=require('connect-timeout');var express=require(_0xdc21('0x3'));var router=express[_0xdc21('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./saProduct.controller');router[_0xdc21('0x5')]('/',auth[_0xdc21('0x6')](),controller[_0xdc21('0x7')]);router[_0xdc21('0x5')](_0xdc21('0x8'),auth['isAuthenticated'](),controller[_0xdc21('0x9')]);router[_0xdc21('0x5')](_0xdc21('0xa'),auth['isAuthenticated'](),controller[_0xdc21('0xb')]);router[_0xdc21('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xdc21('0xc')](_0xdc21('0xd'),auth[_0xdc21('0x6')](),controller[_0xdc21('0xe')]);router[_0xdc21('0xf')]('/:id',auth[_0xdc21('0x6')](),controller['update']);module[_0xdc21('0x10')]=router; \ No newline at end of file +var _0x335f=['create','/:id/clone','put','update','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./saProduct.controller','get','isAuthenticated','index','describe','/:id','show','post'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x335f,0xfb));var _0xf335=function(_0x32d1b9,_0x260af2){_0x32d1b9=_0x32d1b9-0x0;var _0x306ec8=_0x335f[_0x32d1b9];return _0x306ec8;};'use strict';var multer=require(_0xf335('0x0'));var util=require(_0xf335('0x1'));var path=require(_0xf335('0x2'));var timeout=require(_0xf335('0x3'));var express=require('express');var router=express[_0xf335('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xf335('0x5'));var config=require(_0xf335('0x6'));var controller=require(_0xf335('0x7'));router[_0xf335('0x8')]('/',auth[_0xf335('0x9')](),controller[_0xf335('0xa')]);router[_0xf335('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xf335('0xb')]);router[_0xf335('0x8')](_0xf335('0xc'),auth[_0xf335('0x9')](),controller[_0xf335('0xd')]);router[_0xf335('0xe')]('/',auth[_0xf335('0x9')](),controller[_0xf335('0xf')]);router['post'](_0xf335('0x10'),auth[_0xf335('0x9')](),controller['clone']);router[_0xf335('0x11')](_0xf335('0xc'),auth[_0xf335('0x9')](),controller[_0xf335('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/saProduct/saProduct.attributes.js b/server/api/saProduct/saProduct.attributes.js index 13ca260..3c76722 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 _0xcaa3=['\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci','DECIMAL','BOOLEAN','sequelize','exports','STRING','name','productcode','TEXT','long'];(function(_0xf766ea,_0x12f2b6){var _0x56059b=function(_0x56ec4f){while(--_0x56ec4f){_0xf766ea['push'](_0xf766ea['shift']());}};_0x56059b(++_0x12f2b6);}(_0xcaa3,0xcb));var _0x3caa=function(_0x595604,_0x2cc998){_0x595604=_0x595604-0x0;var _0x1466f3=_0xcaa3[_0x595604];return _0x1466f3;};'use strict';var Sequelize=require(_0x3caa('0x0'));module[_0x3caa('0x1')]={'name':{'type':Sequelize[_0x3caa('0x2')],'allowNull':![],'unique':_0x3caa('0x3')},'productcode':{'type':Sequelize[_0x3caa('0x2')],'allowNull':![],'unique':_0x3caa('0x4')},'netprice':{'type':Sequelize['DECIMAL'](0xd,0x4),'allowNull':![]},'tax':{'type':Sequelize['INTEGER'],'allowNull':![]},'description':{'type':Sequelize[_0x3caa('0x5')](_0x3caa('0x6'))+_0x3caa('0x7')},'qtymin':{'type':Sequelize[_0x3caa('0x8')](0xd,0x4),'allowNull':!![]},'phaseout':{'type':Sequelize[_0x3caa('0x9')],'defaultValue':0x0,'allowNull':![]}}; \ No newline at end of file +var _0x93e7=['DECIMAL','INTEGER','TEXT','\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci','BOOLEAN','sequelize','STRING','name','productcode'];(function(_0x3cba1a,_0x2c5d10){var _0x510ac7=function(_0x32dd97){while(--_0x32dd97){_0x3cba1a['push'](_0x3cba1a['shift']());}};_0x510ac7(++_0x2c5d10);}(_0x93e7,0x9e));var _0x793e=function(_0x5e7514,_0x30c2e1){_0x5e7514=_0x5e7514-0x0;var _0x12f472=_0x93e7[_0x5e7514];return _0x12f472;};'use strict';var Sequelize=require(_0x793e('0x0'));module['exports']={'name':{'type':Sequelize[_0x793e('0x1')],'allowNull':![],'unique':_0x793e('0x2')},'productcode':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x793e('0x3')},'netprice':{'type':Sequelize[_0x793e('0x4')](0xd,0x4),'allowNull':![]},'tax':{'type':Sequelize[_0x793e('0x5')],'allowNull':![]},'description':{'type':Sequelize[_0x793e('0x6')]('long')+_0x793e('0x7')},'qtymin':{'type':Sequelize['DECIMAL'](0xd,0x4),'allowNull':!![]},'phaseout':{'type':Sequelize[_0x793e('0x8')],'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 3d0bb4b..3bc48c7 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 _0xdd57=['omit','createdAt','updatedAt','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','end','json','count','offset','status','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','pick','filter','where','merge','map','key','VIRTUAL','field','options','SAProduct','include','rows','catch','show','params','rawAttributes','length','includeAll','find','create','body','clone','get'];(function(_0x24d561,_0x5e8d05){var _0x454c8e=function(_0x66e4ca){while(--_0x66e4ca){_0x24d561['push'](_0x24d561['shift']());}};_0x454c8e(++_0x5e8d05);}(_0xdd57,0x1ea));var _0x7dd5=function(_0x25662e,_0x4cec68){_0x25662e=_0x25662e-0x0;var _0x59b7bc=_0xdd57[_0x25662e];return _0x59b7bc;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7dd5('0x0'));var rimraf=require(_0x7dd5('0x1'));var zipdir=require(_0x7dd5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7dd5('0x3'));var BPromise=require(_0x7dd5('0x4'));var Mustache=require(_0x7dd5('0x5'));var util=require(_0x7dd5('0x6'));var path=require(_0x7dd5('0x7'));var sox=require(_0x7dd5('0x8'));var csv=require('to-csv');var ejs=require(_0x7dd5('0x9'));var fs=require('fs');var _=require(_0x7dd5('0xa'));var squel=require(_0x7dd5('0xb'));var crypto=require(_0x7dd5('0xc'));var jsforce=require(_0x7dd5('0xd'));var deskjs=require(_0x7dd5('0xe'));var toCsv=require(_0x7dd5('0xf'));var querystring=require(_0x7dd5('0x10'));var Papa=require(_0x7dd5('0x11'));var Redis=require(_0x7dd5('0x12'));var authService=require(_0x7dd5('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x7dd5('0x14'));var logger=require(_0x7dd5('0x15'))(_0x7dd5('0x16'));var utils=require(_0x7dd5('0x17'));var config=require(_0x7dd5('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2eb873,_0xd044e6){_0xd044e6=_0xd044e6||0xcc;return function(_0x2f863e){if(_0x2f863e){return _0x2eb873['sendStatus'](_0xd044e6);}return _0x2eb873['status'](_0xd044e6)[_0x7dd5('0x19')]();};}function respondWithResult(_0x186fca,_0x1b4ec3){_0x1b4ec3=_0x1b4ec3||0xc8;return function(_0x4ba532){if(_0x4ba532){return _0x186fca['status'](_0x1b4ec3)[_0x7dd5('0x1a')](_0x4ba532);}};}function respondWithFilteredResult(_0x5d6880,_0x44d995){return function(_0x3b807a){if(_0x3b807a){var _0x375349=_0x3b807a[_0x7dd5('0x1b')],_0x26d0c5=_0x44d995[_0x7dd5('0x1c')],_0x32cc66=_0x44d995['offset']+_0x44d995['limit'],_0x3a5663;if(_0x32cc66>=_0x375349){_0x32cc66=_0x375349;_0x3a5663=0xc8;}else{_0x3a5663=0xce;}_0x5d6880[_0x7dd5('0x1d')](_0x3a5663);return _0x5d6880[_0x7dd5('0x1e')](_0x7dd5('0x1f'),_0x26d0c5+'-'+_0x32cc66+'/'+_0x375349)[_0x7dd5('0x1a')](_0x3b807a);}return null;};}function patchUpdates(_0x1e966e){return function(_0x1eed72){try{jsonpatch[_0x7dd5('0x20')](_0x1eed72,_0x1e966e,!![]);}catch(_0x4a781d){return BPromise[_0x7dd5('0x21')](_0x4a781d);}return _0x1eed72[_0x7dd5('0x22')]();};}function saveUpdates(_0x22d3c6,_0x323bfd){return function(_0x30b1f6){if(_0x30b1f6){return _0x30b1f6[_0x7dd5('0x23')](_0x22d3c6)[_0x7dd5('0x24')](function(_0x55bb3f){return _0x55bb3f;});}return null;};}function removeEntity(_0xdd0085,_0x3b4f52){return function(_0x41d739){if(_0x41d739){return _0x41d739[_0x7dd5('0x25')]()['then'](function(){_0xdd0085[_0x7dd5('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d0737,_0x5c13be){return function(_0x58ae13){if(!_0x58ae13){_0x1d0737[_0x7dd5('0x26')](0x194);}return _0x58ae13;};}function handleError(_0x404f3b,_0x35b958){_0x35b958=_0x35b958||0x1f4;return function(_0x4861f7){logger[_0x7dd5('0x27')](_0x4861f7['stack']);if(_0x4861f7[_0x7dd5('0x28')]){delete _0x4861f7[_0x7dd5('0x28')];}_0x404f3b[_0x7dd5('0x1d')](_0x35b958)[_0x7dd5('0x29')](_0x4861f7);};}exports[_0x7dd5('0x2a')]=function(_0x27c004,_0x50a2e2){var _0x361df6={},_0xaddd88={},_0x5c2710={'count':0x0,'rows':[]};var _0x3784d4=db['SAProduct']['rawAttributes'];_0xaddd88[_0x7dd5('0x2b')]=_[_0x7dd5('0x2c')](_0x3784d4);_0xaddd88['query']=_[_0x7dd5('0x2c')](_0x27c004[_0x7dd5('0x2d')]);_0xaddd88[_0x7dd5('0x2e')]=_[_0x7dd5('0x2f')](_0xaddd88[_0x7dd5('0x2b')],_0xaddd88['query']);_0x361df6[_0x7dd5('0x30')]=_[_0x7dd5('0x2f')](_0xaddd88[_0x7dd5('0x2b')],qs['fields'](_0x27c004[_0x7dd5('0x2d')][_0x7dd5('0x31')]));_0x361df6['attributes']=_0x361df6[_0x7dd5('0x30')]['length']?_0x361df6[_0x7dd5('0x30')]:_0xaddd88['model'];if(!_0x27c004[_0x7dd5('0x2d')][_0x7dd5('0x32')]('nolimit')){_0x361df6[_0x7dd5('0x33')]=qs[_0x7dd5('0x33')](_0x27c004[_0x7dd5('0x2d')][_0x7dd5('0x33')]);_0x361df6[_0x7dd5('0x1c')]=qs[_0x7dd5('0x1c')](_0x27c004[_0x7dd5('0x2d')][_0x7dd5('0x1c')]);}_0x361df6[_0x7dd5('0x34')]=qs[_0x7dd5('0x35')](_0x27c004[_0x7dd5('0x2d')][_0x7dd5('0x35')]);_0x361df6['where']=qs[_0x7dd5('0x2e')](_[_0x7dd5('0x36')](_0x27c004[_0x7dd5('0x2d')],_0xaddd88[_0x7dd5('0x2e')]));if(_0x27c004[_0x7dd5('0x2d')][_0x7dd5('0x37')]){_0x361df6[_0x7dd5('0x38')]=_[_0x7dd5('0x39')](_0x361df6[_0x7dd5('0x38')],{'$or':_[_0x7dd5('0x3a')](_0x3784d4,function(_0x2cfedc){if(_0x2cfedc['type'][_0x7dd5('0x3b')]!==_0x7dd5('0x3c')){var _0x2e90b5={};_0x2e90b5[_0x2cfedc[_0x7dd5('0x3d')]]={'$like':'%'+_0x27c004[_0x7dd5('0x2d')][_0x7dd5('0x37')]+'%'};return _0x2e90b5;}})});}_0x361df6=_[_0x7dd5('0x39')]({},_0x361df6,_0x27c004[_0x7dd5('0x3e')]);var _0x52da1c={'where':_0x361df6['where']};return db[_0x7dd5('0x3f')][_0x7dd5('0x1b')](_0x52da1c)[_0x7dd5('0x24')](function(_0x3ffaed){_0x5c2710[_0x7dd5('0x1b')]=_0x3ffaed;if(_0x27c004[_0x7dd5('0x2d')]['includeAll']){_0x361df6[_0x7dd5('0x40')]=[{'all':!![]}];}return db[_0x7dd5('0x3f')]['findAll'](_0x361df6);})[_0x7dd5('0x24')](function(_0x5c2334){_0x5c2710[_0x7dd5('0x41')]=_0x5c2334;return _0x5c2710;})['then'](respondWithFilteredResult(_0x50a2e2,_0x361df6))[_0x7dd5('0x42')](handleError(_0x50a2e2,null));};exports[_0x7dd5('0x43')]=function(_0x4fb62a,_0x2a4456){var _0xf04afe={'raw':![],'where':{'id':_0x4fb62a[_0x7dd5('0x44')]['id']}},_0x3f1902={};_0x3f1902[_0x7dd5('0x2b')]=_['keys'](db['SAProduct'][_0x7dd5('0x45')]);_0x3f1902[_0x7dd5('0x2d')]=_[_0x7dd5('0x2c')](_0x4fb62a[_0x7dd5('0x2d')]);_0x3f1902[_0x7dd5('0x2e')]=_[_0x7dd5('0x2f')](_0x3f1902[_0x7dd5('0x2b')],_0x3f1902[_0x7dd5('0x2d')]);_0xf04afe[_0x7dd5('0x30')]=_[_0x7dd5('0x2f')](_0x3f1902['model'],qs['fields'](_0x4fb62a['query'][_0x7dd5('0x31')]));_0xf04afe[_0x7dd5('0x30')]=_0xf04afe[_0x7dd5('0x30')][_0x7dd5('0x46')]?_0xf04afe['attributes']:_0x3f1902[_0x7dd5('0x2b')];if(_0x4fb62a['query'][_0x7dd5('0x47')]){_0xf04afe['include']=[{'all':!![]}];}_0xf04afe=_[_0x7dd5('0x39')]({},_0xf04afe,_0x4fb62a[_0x7dd5('0x3e')]);return db[_0x7dd5('0x3f')][_0x7dd5('0x48')](_0xf04afe)['then'](handleEntityNotFound(_0x2a4456,null))['then'](respondWithResult(_0x2a4456,null))[_0x7dd5('0x42')](handleError(_0x2a4456,null));};exports[_0x7dd5('0x49')]=function(_0x4c8f2d,_0x1a14bd){return db[_0x7dd5('0x3f')]['create'](_0x4c8f2d[_0x7dd5('0x4a')],{})[_0x7dd5('0x24')](respondWithResult(_0x1a14bd,0xc9))['catch'](handleError(_0x1a14bd,null));};exports[_0x7dd5('0x4b')]=function(_0x502e27,_0x345363){var _0x24015a={'raw':![],'where':{'id':_0x502e27['params']['id']}},_0x268c2a={};_0x268c2a[_0x7dd5('0x2b')]=_[_0x7dd5('0x2c')](db[_0x7dd5('0x3f')][_0x7dd5('0x45')]);_0x24015a[_0x7dd5('0x30')]=_[_0x7dd5('0x2f')](_0x268c2a[_0x7dd5('0x2b')],qs[_0x7dd5('0x31')](_0x502e27[_0x7dd5('0x2d')][_0x7dd5('0x31')]));_0x24015a['attributes']=_0x24015a['attributes'][_0x7dd5('0x46')]?_0x24015a[_0x7dd5('0x30')]:_0x268c2a[_0x7dd5('0x2b')];if(_0x502e27['query']['includeAll']){_0x24015a['include']=[{'all':!![]}];}_0x24015a=_[_0x7dd5('0x39')]({},_0x24015a,_0x502e27[_0x7dd5('0x3e')]);return db[_0x7dd5('0x3f')][_0x7dd5('0x48')](_0x24015a)['then'](handleEntityNotFound(_0x345363,null))['then'](function(_0x2706e1){if(_0x2706e1){var _0x4633f8=_0x2706e1[_0x7dd5('0x4c')]({'plain':!![]});_0x4633f8=qs[_0x7dd5('0x4d')](_0x4633f8,['id','createdAt','updatedAt']);_0x502e27[_0x7dd5('0x4a')]=_[_0x7dd5('0x4d')](_0x502e27[_0x7dd5('0x4a')],['id',_0x7dd5('0x4e'),_0x7dd5('0x4f')]);return db[_0x7dd5('0x3f')][_0x7dd5('0x49')](_[_0x7dd5('0x39')](_0x4633f8,_0x502e27[_0x7dd5('0x4a')]),{'include':_0x502e27[_0x7dd5('0x2d')][_0x7dd5('0x47')]?[{'all':!![]}]:undefined});}})[_0x7dd5('0x24')](respondWithResult(_0x345363,0xc9))['catch'](handleError(_0x345363,null));};exports[_0x7dd5('0x23')]=function(_0xeae471,_0x419758){if(_0xeae471['body']['id']){delete _0xeae471[_0x7dd5('0x4a')]['id'];}return db['SAProduct'][_0x7dd5('0x48')]({'where':{'id':_0xeae471['params']['id']}})[_0x7dd5('0x24')](handleEntityNotFound(_0x419758,null))['then'](saveUpdates(_0xeae471[_0x7dd5('0x4a')],null))[_0x7dd5('0x24')](respondWithResult(_0x419758,null))[_0x7dd5('0x42')](handleError(_0x419758,null));};exports['describe']=function(_0x2c34d9,_0x1944a4){return db[_0x7dd5('0x3f')][_0x7dd5('0x50')]()['then'](respondWithResult(_0x1944a4,null))[_0x7dd5('0x42')](handleError(_0x1944a4,null));}; \ No newline at end of file +var _0x053c=['../../config/environment','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','update','then','destroy','error','stack','name','SAProduct','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','map','key','filter','options','includeAll','include','findAll','rows','catch','params','find','create','body','clone','get','omit','createdAt','updatedAt','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x053c,0xcc));var _0xc053=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x053c[_0x126558];return _0x1f6d14;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc053('0x0'));var rimraf=require(_0xc053('0x1'));var zipdir=require(_0xc053('0x2'));var jsonpatch=require(_0xc053('0x3'));var rp=require(_0xc053('0x4'));var moment=require(_0xc053('0x5'));var BPromise=require(_0xc053('0x6'));var Mustache=require(_0xc053('0x7'));var util=require(_0xc053('0x8'));var path=require('path');var sox=require(_0xc053('0x9'));var csv=require('to-csv');var ejs=require(_0xc053('0xa'));var fs=require('fs');var _=require(_0xc053('0xb'));var squel=require(_0xc053('0xc'));var crypto=require(_0xc053('0xd'));var jsforce=require(_0xc053('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc053('0xf'));var Papa=require(_0xc053('0x10'));var Redis=require(_0xc053('0x11'));var authService=require(_0xc053('0x12'));var qs=require(_0xc053('0x13'));var hardwareService=require(_0xc053('0x14'));var logger=require(_0xc053('0x15'))(_0xc053('0x16'));var utils=require(_0xc053('0x17'));var config=require(_0xc053('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x487541,_0x1f88c0){_0x1f88c0=_0x1f88c0||0xcc;return function(_0x9d6786){if(_0x9d6786){return _0x487541[_0xc053('0x19')](_0x1f88c0);}return _0x487541[_0xc053('0x1a')](_0x1f88c0)[_0xc053('0x1b')]();};}function respondWithResult(_0x3f0bf1,_0xf1437e){_0xf1437e=_0xf1437e||0xc8;return function(_0x4e5f8e){if(_0x4e5f8e){return _0x3f0bf1['status'](_0xf1437e)[_0xc053('0x1c')](_0x4e5f8e);}};}function respondWithFilteredResult(_0xfb77db,_0x4bee8b){return function(_0x467030){if(_0x467030){var _0x1fa974=_0x467030[_0xc053('0x1d')],_0x31119b=_0x4bee8b['offset'],_0x439bc8=_0x4bee8b[_0xc053('0x1e')]+_0x4bee8b[_0xc053('0x1f')],_0x1d5b7b;if(_0x439bc8>=_0x1fa974){_0x439bc8=_0x1fa974;_0x1d5b7b=0xc8;}else{_0x1d5b7b=0xce;}_0xfb77db['status'](_0x1d5b7b);return _0xfb77db['set'](_0xc053('0x20'),_0x31119b+'-'+_0x439bc8+'/'+_0x1fa974)[_0xc053('0x1c')](_0x467030);}return null;};}function patchUpdates(_0x33fb50){return function(_0x496075){try{jsonpatch[_0xc053('0x21')](_0x496075,_0x33fb50,!![]);}catch(_0x922b04){return BPromise[_0xc053('0x22')](_0x922b04);}return _0x496075['save']();};}function saveUpdates(_0x3cbbc1,_0x5992c3){return function(_0x3a0459){if(_0x3a0459){return _0x3a0459[_0xc053('0x23')](_0x3cbbc1)[_0xc053('0x24')](function(_0x21a5fe){return _0x21a5fe;});}return null;};}function removeEntity(_0x21cf5e,_0x16c99b){return function(_0x5590aa){if(_0x5590aa){return _0x5590aa[_0xc053('0x25')]()[_0xc053('0x24')](function(){_0x21cf5e[_0xc053('0x1a')](0xcc)[_0xc053('0x1b')]();});}};}function handleEntityNotFound(_0x47db0b,_0x4042d4){return function(_0x1e3ba2){if(!_0x1e3ba2){_0x47db0b['sendStatus'](0x194);}return _0x1e3ba2;};}function handleError(_0x36510b,_0x2f9ac2){_0x2f9ac2=_0x2f9ac2||0x1f4;return function(_0x4879d5){logger[_0xc053('0x26')](_0x4879d5[_0xc053('0x27')]);if(_0x4879d5['name']){delete _0x4879d5[_0xc053('0x28')];}_0x36510b['status'](_0x2f9ac2)['send'](_0x4879d5);};}exports['index']=function(_0x487eab,_0x1a6e14){var _0x2a85c9={},_0x34e945={},_0x12db63={'count':0x0,'rows':[]};var _0x4a42fd=db[_0xc053('0x29')][_0xc053('0x2a')];_0x34e945['model']=_[_0xc053('0x2b')](_0x4a42fd);_0x34e945[_0xc053('0x2c')]=_[_0xc053('0x2b')](_0x487eab['query']);_0x34e945[_0xc053('0x2d')]=_[_0xc053('0x2e')](_0x34e945[_0xc053('0x2f')],_0x34e945['query']);_0x2a85c9[_0xc053('0x30')]=_['intersection'](_0x34e945['model'],qs[_0xc053('0x31')](_0x487eab[_0xc053('0x2c')][_0xc053('0x31')]));_0x2a85c9[_0xc053('0x30')]=_0x2a85c9[_0xc053('0x30')][_0xc053('0x32')]?_0x2a85c9[_0xc053('0x30')]:_0x34e945['model'];if(!_0x487eab[_0xc053('0x2c')][_0xc053('0x33')]('nolimit')){_0x2a85c9[_0xc053('0x1f')]=qs[_0xc053('0x1f')](_0x487eab[_0xc053('0x2c')][_0xc053('0x1f')]);_0x2a85c9[_0xc053('0x1e')]=qs[_0xc053('0x1e')](_0x487eab[_0xc053('0x2c')][_0xc053('0x1e')]);}_0x2a85c9[_0xc053('0x34')]=qs[_0xc053('0x35')](_0x487eab[_0xc053('0x2c')][_0xc053('0x35')]);_0x2a85c9[_0xc053('0x36')]=qs[_0xc053('0x2d')](_[_0xc053('0x37')](_0x487eab['query'],_0x34e945[_0xc053('0x2d')]));if(_0x487eab[_0xc053('0x2c')]['filter']){_0x2a85c9['where']=_[_0xc053('0x38')](_0x2a85c9[_0xc053('0x36')],{'$or':_[_0xc053('0x39')](_0x4a42fd,function(_0x32b3a0){if(_0x32b3a0['type'][_0xc053('0x3a')]!=='VIRTUAL'){var _0x5326d9={};_0x5326d9[_0x32b3a0['field']]={'$like':'%'+_0x487eab[_0xc053('0x2c')][_0xc053('0x3b')]+'%'};return _0x5326d9;}})});}_0x2a85c9=_[_0xc053('0x38')]({},_0x2a85c9,_0x487eab[_0xc053('0x3c')]);var _0x47dd8a={'where':_0x2a85c9[_0xc053('0x36')]};return db[_0xc053('0x29')][_0xc053('0x1d')](_0x47dd8a)['then'](function(_0x684121){_0x12db63[_0xc053('0x1d')]=_0x684121;if(_0x487eab[_0xc053('0x2c')][_0xc053('0x3d')]){_0x2a85c9[_0xc053('0x3e')]=[{'all':!![]}];}return db[_0xc053('0x29')][_0xc053('0x3f')](_0x2a85c9);})[_0xc053('0x24')](function(_0x4ecfd0){_0x12db63[_0xc053('0x40')]=_0x4ecfd0;return _0x12db63;})[_0xc053('0x24')](respondWithFilteredResult(_0x1a6e14,_0x2a85c9))[_0xc053('0x41')](handleError(_0x1a6e14,null));};exports['show']=function(_0x2c369c,_0x2ae455){var _0x593535={'raw':![],'where':{'id':_0x2c369c[_0xc053('0x42')]['id']}},_0x22bcfe={};_0x22bcfe[_0xc053('0x2f')]=_[_0xc053('0x2b')](db['SAProduct']['rawAttributes']);_0x22bcfe[_0xc053('0x2c')]=_[_0xc053('0x2b')](_0x2c369c['query']);_0x22bcfe[_0xc053('0x2d')]=_[_0xc053('0x2e')](_0x22bcfe[_0xc053('0x2f')],_0x22bcfe[_0xc053('0x2c')]);_0x593535[_0xc053('0x30')]=_['intersection'](_0x22bcfe[_0xc053('0x2f')],qs[_0xc053('0x31')](_0x2c369c[_0xc053('0x2c')][_0xc053('0x31')]));_0x593535[_0xc053('0x30')]=_0x593535[_0xc053('0x30')]['length']?_0x593535[_0xc053('0x30')]:_0x22bcfe[_0xc053('0x2f')];if(_0x2c369c[_0xc053('0x2c')][_0xc053('0x3d')]){_0x593535['include']=[{'all':!![]}];}_0x593535=_[_0xc053('0x38')]({},_0x593535,_0x2c369c['options']);return db[_0xc053('0x29')][_0xc053('0x43')](_0x593535)['then'](handleEntityNotFound(_0x2ae455,null))[_0xc053('0x24')](respondWithResult(_0x2ae455,null))['catch'](handleError(_0x2ae455,null));};exports['create']=function(_0x27fa11,_0x122c12){return db[_0xc053('0x29')][_0xc053('0x44')](_0x27fa11[_0xc053('0x45')],{})[_0xc053('0x24')](respondWithResult(_0x122c12,0xc9))[_0xc053('0x41')](handleError(_0x122c12,null));};exports[_0xc053('0x46')]=function(_0x59406e,_0x32f3ba){var _0x16bd6f={'raw':![],'where':{'id':_0x59406e[_0xc053('0x42')]['id']}},_0x10ed27={};_0x10ed27['model']=_[_0xc053('0x2b')](db['SAProduct'][_0xc053('0x2a')]);_0x16bd6f[_0xc053('0x30')]=_['intersection'](_0x10ed27['model'],qs['fields'](_0x59406e[_0xc053('0x2c')][_0xc053('0x31')]));_0x16bd6f[_0xc053('0x30')]=_0x16bd6f['attributes'][_0xc053('0x32')]?_0x16bd6f[_0xc053('0x30')]:_0x10ed27['model'];if(_0x59406e['query']['includeAll']){_0x16bd6f[_0xc053('0x3e')]=[{'all':!![]}];}_0x16bd6f=_[_0xc053('0x38')]({},_0x16bd6f,_0x59406e['options']);return db[_0xc053('0x29')][_0xc053('0x43')](_0x16bd6f)[_0xc053('0x24')](handleEntityNotFound(_0x32f3ba,null))[_0xc053('0x24')](function(_0x358e30){if(_0x358e30){var _0x2bb761=_0x358e30[_0xc053('0x47')]({'plain':!![]});_0x2bb761=qs[_0xc053('0x48')](_0x2bb761,['id',_0xc053('0x49'),_0xc053('0x4a')]);_0x59406e['body']=_[_0xc053('0x48')](_0x59406e['body'],['id',_0xc053('0x49'),_0xc053('0x4a')]);return db[_0xc053('0x29')][_0xc053('0x44')](_[_0xc053('0x38')](_0x2bb761,_0x59406e['body']),{'include':_0x59406e['query']['includeAll']?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x32f3ba,0xc9))[_0xc053('0x41')](handleError(_0x32f3ba,null));};exports[_0xc053('0x23')]=function(_0xe8b720,_0x5ab8f5){if(_0xe8b720[_0xc053('0x45')]['id']){delete _0xe8b720[_0xc053('0x45')]['id'];}return db[_0xc053('0x29')][_0xc053('0x43')]({'where':{'id':_0xe8b720[_0xc053('0x42')]['id']}})[_0xc053('0x24')](handleEntityNotFound(_0x5ab8f5,null))[_0xc053('0x24')](saveUpdates(_0xe8b720[_0xc053('0x45')],null))[_0xc053('0x24')](respondWithResult(_0x5ab8f5,null))[_0xc053('0x41')](handleError(_0x5ab8f5,null));};exports['describe']=function(_0x4bc80b,_0x38743c){return db[_0xc053('0x29')][_0xc053('0x4b')]()[_0xc053('0x24')](respondWithResult(_0x38743c,null))[_0xc053('0x41')](handleError(_0x38743c,null));}; \ No newline at end of file diff --git a/server/api/saProduct/saProduct.model.js b/server/api/saProduct/saProduct.model.js index b1b76d4..33cba5e 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 _0x3414=['define','SAProduct','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./saProduct.attributes','exports'];(function(_0x592d48,_0x23f1ba){var _0x5d789e=function(_0x156900){while(--_0x156900){_0x592d48['push'](_0x592d48['shift']());}};_0x5d789e(++_0x23f1ba);}(_0x3414,0x1b0));var _0x4341=function(_0x43aef7,_0x3ff371){_0x43aef7=_0x43aef7-0x0;var _0x55fe89=_0x3414[_0x43aef7];return _0x55fe89;};'use strict';var _=require(_0x4341('0x0'));var util=require('util');var logger=require(_0x4341('0x1'))('api');var moment=require(_0x4341('0x2'));var BPromise=require('bluebird');var rp=require(_0x4341('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4341('0x4'));var config=require(_0x4341('0x5'));var attributes=require(_0x4341('0x6'));module[_0x4341('0x7')]=function(_0x259838,_0x859213){return _0x259838[_0x4341('0x8')](_0x4341('0x9'),attributes,{'tableName':'sa_products','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x68b1=['SAProduct','sa_products','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./saProduct.attributes','exports'];(function(_0xee2e7a,_0x58354d){var _0x319dd3=function(_0xa99240){while(--_0xa99240){_0xee2e7a['push'](_0xee2e7a['shift']());}};_0x319dd3(++_0x58354d);}(_0x68b1,0x13a));var _0x168b=function(_0xa7879c,_0x4dc1d9){_0xa7879c=_0xa7879c-0x0;var _0x576d61=_0x68b1[_0xa7879c];return _0x576d61;};'use strict';var _=require(_0x168b('0x0'));var util=require(_0x168b('0x1'));var logger=require(_0x168b('0x2'))(_0x168b('0x3'));var moment=require(_0x168b('0x4'));var BPromise=require(_0x168b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x168b('0x6'));var config=require(_0x168b('0x7'));var attributes=require(_0x168b('0x8'));module[_0x168b('0x9')]=function(_0x3e5253,_0x379652){return _0x3e5253['define'](_0x168b('0xa'),attributes,{'tableName':_0x168b('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 361c3df..6175f60 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 _0x5ad3=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','SAProduct,\x20%s,\x20%s','request\x20sent','SAProduct,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash'];(function(_0x33208a,_0x4a9f0f){var _0x530956=function(_0x263283){while(--_0x263283){_0x33208a['push'](_0x33208a['shift']());}};_0x530956(++_0x4a9f0f);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x4a7843,_0x24f6d1){_0x4a7843=_0x4a7843-0x0;var _0x2c57fe=_0x5ad3[_0x4a7843];return _0x2c57fe;};'use strict';var _=require(_0x35ad('0x0'));var util=require(_0x35ad('0x1'));var moment=require(_0x35ad('0x2'));var BPromise=require(_0x35ad('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x35ad('0x4'));var db=require(_0x35ad('0x5'))['db'];var utils=require(_0x35ad('0x6'));var logger=require(_0x35ad('0x7'))(_0x35ad('0x8'));var config=require(_0x35ad('0x9'));var jayson=require(_0x35ad('0xa'));var client=jayson[_0x35ad('0xb')][_0x35ad('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x31cc6a,_0x4edc59,_0x292521){return new BPromise(function(_0x3cec3e,_0x3f1f55){return client['request'](_0x31cc6a,_0x292521)[_0x35ad('0xd')](function(_0x487107){logger['info'](_0x35ad('0xe'),_0x4edc59,_0x35ad('0xf'));logger['debug'](_0x35ad('0x10'),_0x4edc59,_0x35ad('0xf'),JSON['stringify'](_0x487107));if(_0x487107['error']){if(_0x487107[_0x35ad('0x11')][_0x35ad('0x12')]===0x1f4){logger['error'](_0x35ad('0xe'),_0x4edc59,_0x487107[_0x35ad('0x11')]['message']);return _0x3f1f55(_0x487107['error'][_0x35ad('0x13')]);}logger[_0x35ad('0x11')](_0x35ad('0xe'),_0x4edc59,_0x487107['error'][_0x35ad('0x13')]);return _0x3cec3e(_0x487107[_0x35ad('0x11')]['message']);}else{logger[_0x35ad('0x14')]('SAProduct,\x20%s,\x20%s',_0x4edc59,'request\x20sent');_0x3cec3e(_0x487107[_0x35ad('0x15')][_0x35ad('0x13')]);}})[_0x35ad('0x16')](function(_0x56cb8e){logger[_0x35ad('0x11')](_0x35ad('0xe'),_0x4edc59,_0x56cb8e);_0x3f1f55(_0x56cb8e);});});} \ No newline at end of file +var _0xa37e=['SAProduct,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info'];(function(_0x40adde,_0x28d766){var _0x438e25=function(_0x19f4eb){while(--_0x19f4eb){_0x40adde['push'](_0x40adde['shift']());}};_0x438e25(++_0x28d766);}(_0xa37e,0x97));var _0xea37=function(_0x4d07be,_0x50d4c9){_0x4d07be=_0x4d07be-0x0;var _0x4d7a3d=_0xa37e[_0x4d07be];return _0x4d7a3d;};'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});function respondWithRpcPromise(_0x36c489,_0x4a9e08,_0x4ae081){return new BPromise(function(_0x2c2890,_0x1401e1){return client[_0xea37('0x8')](_0x36c489,_0x4ae081)[_0xea37('0x9')](function(_0x5e4ebe){logger[_0xea37('0xa')](_0xea37('0xb'),_0x4a9e08,_0xea37('0xc'));logger['debug']('SAProduct,\x20%s,\x20%s,\x20%s',_0x4a9e08,_0xea37('0xc'),JSON[_0xea37('0xd')](_0x5e4ebe));if(_0x5e4ebe[_0xea37('0xe')]){if(_0x5e4ebe['error'][_0xea37('0xf')]===0x1f4){logger[_0xea37('0xe')](_0xea37('0xb'),_0x4a9e08,_0x5e4ebe['error'][_0xea37('0x10')]);return _0x1401e1(_0x5e4ebe[_0xea37('0xe')]['message']);}logger[_0xea37('0xe')]('SAProduct,\x20%s,\x20%s',_0x4a9e08,_0x5e4ebe[_0xea37('0xe')]['message']);return _0x2c2890(_0x5e4ebe[_0xea37('0xe')][_0xea37('0x10')]);}else{logger[_0xea37('0xa')](_0xea37('0xb'),_0x4a9e08,'request\x20sent');_0x2c2890(_0x5e4ebe[_0xea37('0x11')]['message']);}})['catch'](function(_0x3ae3cc){logger['error'](_0xea37('0xb'),_0x4a9e08,_0x3ae3cc);_0x1401e1(_0x3ae3cc);});});} \ No newline at end of file diff --git a/server/api/saProductOrder/index.js b/server/api/saProductOrder/index.js index c999ccf..d35e52e 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 _0x02cb=['put','update','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./saProductOrder.controller','get','isAuthenticated','/:id','post','create'];(function(_0x295eef,_0x26b782){var _0xbc16d4=function(_0x364277){while(--_0x364277){_0x295eef['push'](_0x295eef['shift']());}};_0xbc16d4(++_0x26b782);}(_0x02cb,0xb9));var _0xb02c=function(_0x195553,_0x23b775){_0x195553=_0x195553-0x0;var _0x56512a=_0x02cb[_0x195553];return _0x56512a;};'use strict';var multer=require(_0xb02c('0x0'));var util=require(_0xb02c('0x1'));var path=require(_0xb02c('0x2'));var timeout=require('connect-timeout');var express=require(_0xb02c('0x3'));var router=express['Router']();var auth=require(_0xb02c('0x4'));var interaction=require(_0xb02c('0x5'));var config=require(_0xb02c('0x6'));var controller=require(_0xb02c('0x7'));router[_0xb02c('0x8')]('/',auth[_0xb02c('0x9')](),controller['index']);router['get']('/describe',auth[_0xb02c('0x9')](),controller['describe']);router['get'](_0xb02c('0xa'),auth[_0xb02c('0x9')](),controller['show']);router[_0xb02c('0xb')]('/',auth[_0xb02c('0x9')](),controller[_0xb02c('0xc')]);router[_0xb02c('0xd')]('/:id',auth[_0xb02c('0x9')](),controller[_0xb02c('0xe')]);router[_0xb02c('0xf')](_0xb02c('0xa'),auth[_0xb02c('0x9')](),controller[_0xb02c('0x10')]);module[_0xb02c('0x11')]=router; \ No newline at end of file +var _0x311f=['post','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','get','index','/describe','describe','isAuthenticated'];(function(_0x3f03fc,_0xe84529){var _0x16bb25=function(_0x193f90){while(--_0x193f90){_0x3f03fc['push'](_0x3f03fc['shift']());}};_0x16bb25(++_0xe84529);}(_0x311f,0x15d));var _0xf311=function(_0x2ab9ae,_0x79360){_0x2ab9ae=_0x2ab9ae-0x0;var _0x545ad0=_0x311f[_0x2ab9ae];return _0x545ad0;};'use strict';var multer=require(_0xf311('0x0'));var util=require(_0xf311('0x1'));var path=require(_0xf311('0x2'));var timeout=require('connect-timeout');var express=require(_0xf311('0x3'));var router=express[_0xf311('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xf311('0x5'));var config=require(_0xf311('0x6'));var controller=require('./saProductOrder.controller');router[_0xf311('0x7')]('/',auth['isAuthenticated'](),controller[_0xf311('0x8')]);router[_0xf311('0x7')](_0xf311('0x9'),auth['isAuthenticated'](),controller[_0xf311('0xa')]);router[_0xf311('0x7')]('/:id',auth[_0xf311('0xb')](),controller['show']);router[_0xf311('0xc')]('/',auth[_0xf311('0xb')](),controller['create']);router[_0xf311('0xd')](_0xf311('0xe'),auth[_0xf311('0xb')](),controller[_0xf311('0xf')]);router[_0xf311('0x10')]('/:id',auth[_0xf311('0xb')](),controller[_0xf311('0x11')]);module[_0xf311('0x12')]=router; \ No newline at end of file diff --git a/server/api/saProductOrder/saProductOrder.attributes.js b/server/api/saProductOrder/saProductOrder.attributes.js index cb89a35..a1b633b 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 _0x8314=['TEXT','STRING','compositeIndex_prodCode_OrderID','INTEGER','long','\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci','DECIMAL','BOOLEAN','sequelize','exports'];(function(_0x5c893e,_0x400cd1){var _0x37ec79=function(_0x33c1a4){while(--_0x33c1a4){_0x5c893e['push'](_0x5c893e['shift']());}};_0x37ec79(++_0x400cd1);}(_0x8314,0x18e));var _0x4831=function(_0x4f3af4,_0x2d048c){_0x4f3af4=_0x4f3af4-0x0;var _0x557e86=_0x8314[_0x4f3af4];return _0x557e86;};'use strict';var Sequelize=require(_0x4831('0x0'));module[_0x4831('0x1')]={'productName':{'type':Sequelize[_0x4831('0x2')],'allowNull':![]},'productCode':{'type':Sequelize[_0x4831('0x3')],'allowNull':![],'unique':_0x4831('0x4')},'productNetPrice':{'type':Sequelize['DECIMAL'](0xd,0x4)},'productTax':{'type':Sequelize[_0x4831('0x5')]},'productDescription':{'type':Sequelize[_0x4831('0x2')](_0x4831('0x6'))+_0x4831('0x7')},'productQtyMin':{'type':Sequelize[_0x4831('0x5')],'allowNull':!![]},'pricelistName':{'type':Sequelize[_0x4831('0x2')]},'pricelistDiscount':{'type':Sequelize[_0x4831('0x8')](0x6,0x3),'allowNull':![]},'productPricelistDiscount':{'type':Sequelize[_0x4831('0x8')](0xd,0x4),'allowNull':![]},'productPricelistNetPrice':{'type':Sequelize[_0x4831('0x8')](0xd,0x4)},'netPrice':{'type':Sequelize['DECIMAL'](0xd,0x4),'allowNull':![]},'quantity':{'type':Sequelize[_0x4831('0x5')],'allowNull':![]},'discount':{'type':Sequelize[_0x4831('0x8')](0x6,0x3),'allowNull':![]},'totalPrice':{'type':Sequelize[_0x4831('0x8')](0xd,0x4),'allowNull':![]},'tax':{'type':Sequelize['DECIMAL'](0xd,0x4),'allowNull':![]},'totalDiscount':{'type':Sequelize['DECIMAL'](0xd,0x4),'allowNull':![]},'totalTax':{'type':Sequelize[_0x4831('0x8')](0xd,0x4),'allowNull':![]},'agentFullname':{'type':Sequelize['STRING']},'note':{'type':Sequelize['TEXT']},'QuotationId':{'type':Sequelize[_0x4831('0x5')]},'OrderId':{'type':Sequelize[_0x4831('0x5')],'unique':_0x4831('0x4')},'totalPrice':{'type':Sequelize[_0x4831('0x8')](0xd,0x4)},'totalTax':{'type':Sequelize[_0x4831('0x8')](0xd,0x4)},'typeName':{'type':Sequelize[_0x4831('0x3')]},'TypeId':{'type':Sequelize[_0x4831('0x5')]},'unitName':{'type':Sequelize[_0x4831('0x3')]},'UnitId':{'type':Sequelize['INTEGER']},'attendanceName':{'type':Sequelize['STRING']},'attendanceId':{'type':Sequelize[_0x4831('0x5')]},'attendanceMonthly':{'type':Sequelize[_0x4831('0x5')]},'companyName':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x4831('0x5')]},'productAsset':{'type':Sequelize[_0x4831('0x9')]}}; \ No newline at end of file +var _0x5e64=['TEXT','compositeIndex_prodCode_OrderID','DECIMAL','INTEGER','long','\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci','STRING','BOOLEAN','sequelize','exports'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x5e64,0x12a));var _0x45e6=function(_0x562f51,_0x155f4d){_0x562f51=_0x562f51-0x0;var _0x43131c=_0x5e64[_0x562f51];return _0x43131c;};'use strict';var Sequelize=require(_0x45e6('0x0'));module[_0x45e6('0x1')]={'productName':{'type':Sequelize[_0x45e6('0x2')],'allowNull':![]},'productCode':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x45e6('0x3')},'productNetPrice':{'type':Sequelize[_0x45e6('0x4')](0xd,0x4)},'productTax':{'type':Sequelize[_0x45e6('0x5')]},'productDescription':{'type':Sequelize[_0x45e6('0x2')](_0x45e6('0x6'))+_0x45e6('0x7')},'productQtyMin':{'type':Sequelize[_0x45e6('0x5')],'allowNull':!![]},'pricelistName':{'type':Sequelize[_0x45e6('0x2')]},'pricelistDiscount':{'type':Sequelize['DECIMAL'](0x6,0x3),'allowNull':![]},'productPricelistDiscount':{'type':Sequelize[_0x45e6('0x4')](0xd,0x4),'allowNull':![]},'productPricelistNetPrice':{'type':Sequelize[_0x45e6('0x4')](0xd,0x4)},'netPrice':{'type':Sequelize[_0x45e6('0x4')](0xd,0x4),'allowNull':![]},'quantity':{'type':Sequelize[_0x45e6('0x5')],'allowNull':![]},'discount':{'type':Sequelize[_0x45e6('0x4')](0x6,0x3),'allowNull':![]},'totalPrice':{'type':Sequelize[_0x45e6('0x4')](0xd,0x4),'allowNull':![]},'tax':{'type':Sequelize[_0x45e6('0x4')](0xd,0x4),'allowNull':![]},'totalDiscount':{'type':Sequelize[_0x45e6('0x4')](0xd,0x4),'allowNull':![]},'totalTax':{'type':Sequelize[_0x45e6('0x4')](0xd,0x4),'allowNull':![]},'agentFullname':{'type':Sequelize[_0x45e6('0x8')]},'note':{'type':Sequelize['TEXT']},'QuotationId':{'type':Sequelize[_0x45e6('0x5')]},'OrderId':{'type':Sequelize['INTEGER'],'unique':'compositeIndex_prodCode_OrderID'},'totalPrice':{'type':Sequelize['DECIMAL'](0xd,0x4)},'totalTax':{'type':Sequelize[_0x45e6('0x4')](0xd,0x4)},'typeName':{'type':Sequelize[_0x45e6('0x8')]},'TypeId':{'type':Sequelize[_0x45e6('0x5')]},'unitName':{'type':Sequelize['STRING']},'UnitId':{'type':Sequelize[_0x45e6('0x5')]},'attendanceName':{'type':Sequelize[_0x45e6('0x8')]},'attendanceId':{'type':Sequelize['INTEGER']},'attendanceMonthly':{'type':Sequelize['INTEGER']},'companyName':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x45e6('0x5')]},'productAsset':{'type':Sequelize[_0x45e6('0x9')]}}; \ No newline at end of file diff --git a/server/api/saProductOrder/saProductOrder.controller.js b/server/api/saProductOrder/saProductOrder.controller.js index fd65df9..80370f0 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 _0xc1c6=['name','send','index','rawAttributes','keys','dateStart','query','dateEnd','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','sort','add','day','merge','where','filter','map','VIRTUAL','options','count','includeAll','include','SAProductOrder','findAll','rows','catch','params','find','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','sox','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','set','apply','reject','update','then','destroy','error','stack'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x2cada4,_0x5007f8){_0x2cada4=_0x2cada4-0x0;var _0x9b6d2e=_0xc1c6[_0x2cada4];return _0x9b6d2e;};'use strict';var pdf=require(_0x6c1c('0x0'));var emlformat=require(_0x6c1c('0x1'));var rimraf=require(_0x6c1c('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6c1c('0x3'));var rp=require('request-promise');var moment=require(_0x6c1c('0x4'));var BPromise=require(_0x6c1c('0x5'));var Mustache=require(_0x6c1c('0x6'));var util=require('util');var path=require('path');var sox=require(_0x6c1c('0x7'));var csv=require('to-csv');var ejs=require(_0x6c1c('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6c1c('0x9'));var crypto=require(_0x6c1c('0xa'));var jsforce=require(_0x6c1c('0xb'));var deskjs=require(_0x6c1c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6c1c('0xd'));var Papa=require(_0x6c1c('0xe'));var Redis=require('ioredis');var qs=require(_0x6c1c('0xf'));var logger=require(_0x6c1c('0x10'))(_0x6c1c('0x11'));var utils=require(_0x6c1c('0x12'));var config=require('../../config/environment');var db=require(_0x6c1c('0x13'))['db'];function respondWithStatusCode(_0x2a4fd4,_0x40cebf){_0x40cebf=_0x40cebf||0xcc;return function(_0x5af308){if(_0x5af308){return _0x2a4fd4[_0x6c1c('0x14')](_0x40cebf);}return _0x2a4fd4[_0x6c1c('0x15')](_0x40cebf)[_0x6c1c('0x16')]();};}function respondWithResult(_0x49304f,_0x2e82e9){_0x2e82e9=_0x2e82e9||0xc8;return function(_0x5e64b7){if(_0x5e64b7){return _0x49304f[_0x6c1c('0x15')](_0x2e82e9)[_0x6c1c('0x17')](_0x5e64b7);}};}function respondWithFilteredResult(_0x2d279e,_0x154107){return function(_0x350e6f){if(_0x350e6f){var _0x3f532c=_0x350e6f['count'],_0x297c33=_0x154107[_0x6c1c('0x18')],_0x41aa74=_0x154107[_0x6c1c('0x18')]+_0x154107['limit'],_0x448f35;if(_0x41aa74>=_0x3f532c){_0x41aa74=_0x3f532c;_0x448f35=0xc8;}else{_0x448f35=0xce;}_0x2d279e[_0x6c1c('0x15')](_0x448f35);return _0x2d279e[_0x6c1c('0x19')]('Content-Range',_0x297c33+'-'+_0x41aa74+'/'+_0x3f532c)[_0x6c1c('0x17')](_0x350e6f);}return null;};}function patchUpdates(_0x4ede06){return function(_0x338dc2){try{jsonpatch[_0x6c1c('0x1a')](_0x338dc2,_0x4ede06,!![]);}catch(_0x5a3bb7){return BPromise[_0x6c1c('0x1b')](_0x5a3bb7);}return _0x338dc2['save']();};}function saveUpdates(_0x2db60e,_0x3527bf){return function(_0x23470e){if(_0x23470e){return _0x23470e[_0x6c1c('0x1c')](_0x2db60e)[_0x6c1c('0x1d')](function(_0x1efb19){return _0x1efb19;});}return null;};}function removeEntity(_0x1993c5,_0x2ed830){return function(_0x1f24a4){if(_0x1f24a4){return _0x1f24a4[_0x6c1c('0x1e')]()[_0x6c1c('0x1d')](function(){_0x1993c5[_0x6c1c('0x15')](0xcc)[_0x6c1c('0x16')]();});}};}function handleEntityNotFound(_0x9c6c55,_0x31fed2){return function(_0x19c269){if(!_0x19c269){_0x9c6c55[_0x6c1c('0x14')](0x194);}return _0x19c269;};}function handleError(_0x12c638,_0x3a3f13){_0x3a3f13=_0x3a3f13||0x1f4;return function(_0x1dba08){logger[_0x6c1c('0x1f')](_0x1dba08[_0x6c1c('0x20')]);if(_0x1dba08[_0x6c1c('0x21')]){delete _0x1dba08[_0x6c1c('0x21')];}_0x12c638[_0x6c1c('0x15')](_0x3a3f13)[_0x6c1c('0x22')](_0x1dba08);};}exports[_0x6c1c('0x23')]=function(_0x1b9d7d,_0x2feaf4){var _0x5f4568={'raw':!![]},_0x2595c3={},_0x4d73aa={'count':0x0,'rows':[]};var _0x10e9f7=db['SAProductOrder'][_0x6c1c('0x24')];_0x2595c3['model']=_[_0x6c1c('0x25')](_0x10e9f7);var _0xf557ba={'dateStart':_0x1b9d7d['query'][_0x6c1c('0x26')],'dateEnd':_0x1b9d7d[_0x6c1c('0x27')]['dateEnd']};delete _0x1b9d7d[_0x6c1c('0x27')][_0x6c1c('0x26')];delete _0x1b9d7d[_0x6c1c('0x27')][_0x6c1c('0x28')];_0x2595c3['query']=_['keys'](_0x1b9d7d[_0x6c1c('0x27')]);_0x2595c3[_0x6c1c('0x29')]=_[_0x6c1c('0x2a')](_0x2595c3[_0x6c1c('0x2b')],_0x2595c3[_0x6c1c('0x27')]);_0x5f4568[_0x6c1c('0x2c')]=_['intersection'](_0x2595c3[_0x6c1c('0x2b')],qs[_0x6c1c('0x2d')](_0x1b9d7d['query'][_0x6c1c('0x2d')]));_0x5f4568[_0x6c1c('0x2c')]=_0x5f4568[_0x6c1c('0x2c')][_0x6c1c('0x2e')]?_0x5f4568['attributes']:_0x2595c3[_0x6c1c('0x2b')];if(!_0x1b9d7d[_0x6c1c('0x27')][_0x6c1c('0x2f')]('nolimit')){_0x5f4568[_0x6c1c('0x30')]=qs['limit'](_0x1b9d7d[_0x6c1c('0x27')]['limit']);_0x5f4568[_0x6c1c('0x18')]=qs[_0x6c1c('0x18')](_0x1b9d7d[_0x6c1c('0x27')]['offset']);}_0x5f4568['order']=qs[_0x6c1c('0x31')](_0x1b9d7d[_0x6c1c('0x27')][_0x6c1c('0x31')]);_0x5f4568['where']=qs[_0x6c1c('0x29')](_['pick'](_0x1b9d7d['query'],_0x2595c3[_0x6c1c('0x29')]));if(_0xf557ba[_0x6c1c('0x26')]){if(_0xf557ba[_0x6c1c('0x28')]){_0xf557ba[_0x6c1c('0x28')]=moment(_0xf557ba['dateEnd'])[_0x6c1c('0x32')](0x1,_0x6c1c('0x33'));}else{_0xf557ba[_0x6c1c('0x28')]=moment(_0xf557ba[_0x6c1c('0x26')])[_0x6c1c('0x32')](0x1,_0x6c1c('0x33'));}_[_0x6c1c('0x34')](_0x5f4568[_0x6c1c('0x35')],{'createdAt':{'$gte':_0xf557ba[_0x6c1c('0x26')],'$lte':_0xf557ba[_0x6c1c('0x28')]}});}if(_0x1b9d7d['query'][_0x6c1c('0x36')]){_0x5f4568[_0x6c1c('0x35')]=_[_0x6c1c('0x34')](_0x5f4568[_0x6c1c('0x35')],{'$or':_[_0x6c1c('0x37')](_0x10e9f7,function(_0x5c8177){if(_0x5c8177['type']['key']!==_0x6c1c('0x38')){var _0x57ba31={};_0x57ba31[_0x5c8177['field']]={'$like':'%'+_0x1b9d7d[_0x6c1c('0x27')][_0x6c1c('0x36')]+'%'};return _0x57ba31;}})});}_0x5f4568=_['merge']({},_0x5f4568,_0x1b9d7d[_0x6c1c('0x39')]);var _0x40645f={'where':_0x5f4568[_0x6c1c('0x35')]};return db['SAProductOrder'][_0x6c1c('0x3a')](_0x40645f)[_0x6c1c('0x1d')](function(_0x502e75){_0x4d73aa[_0x6c1c('0x3a')]=_0x502e75;if(_0x1b9d7d['query'][_0x6c1c('0x3b')]){_0x5f4568[_0x6c1c('0x3c')]=[{'all':!![]}];}return db[_0x6c1c('0x3d')][_0x6c1c('0x3e')](_0x5f4568);})[_0x6c1c('0x1d')](function(_0x595ba2){_0x4d73aa[_0x6c1c('0x3f')]=_0x595ba2;return _0x4d73aa;})[_0x6c1c('0x1d')](respondWithFilteredResult(_0x2feaf4,_0x5f4568))[_0x6c1c('0x40')](handleError(_0x2feaf4,null));};exports['show']=function(_0x39c013,_0x52866c){var _0x28d141={'raw':!![],'where':{'id':_0x39c013[_0x6c1c('0x41')]['id']}},_0x301f86={};_0x301f86['model']=_[_0x6c1c('0x25')](db['SAProductOrder']['rawAttributes']);_0x301f86['query']=_[_0x6c1c('0x25')](_0x39c013[_0x6c1c('0x27')]);_0x301f86[_0x6c1c('0x29')]=_[_0x6c1c('0x2a')](_0x301f86[_0x6c1c('0x2b')],_0x301f86[_0x6c1c('0x27')]);_0x28d141[_0x6c1c('0x2c')]=_[_0x6c1c('0x2a')](_0x301f86['model'],qs[_0x6c1c('0x2d')](_0x39c013[_0x6c1c('0x27')]['fields']));_0x28d141[_0x6c1c('0x2c')]=_0x28d141['attributes'][_0x6c1c('0x2e')]?_0x28d141[_0x6c1c('0x2c')]:_0x301f86[_0x6c1c('0x2b')];if(_0x39c013[_0x6c1c('0x27')][_0x6c1c('0x3b')]){_0x28d141['include']=[{'all':!![]}];}_0x28d141=_[_0x6c1c('0x34')]({},_0x28d141,_0x39c013['options']);return db[_0x6c1c('0x3d')][_0x6c1c('0x42')](_0x28d141)[_0x6c1c('0x1d')](handleEntityNotFound(_0x52866c,null))[_0x6c1c('0x1d')](respondWithResult(_0x52866c,null))[_0x6c1c('0x40')](handleError(_0x52866c,null));};exports[_0x6c1c('0x43')]=function(_0x52c14d,_0xa9889a){return db[_0x6c1c('0x3d')]['create'](_0x52c14d[_0x6c1c('0x44')],{})[_0x6c1c('0x1d')](respondWithResult(_0xa9889a,0xc9))[_0x6c1c('0x40')](handleError(_0xa9889a,null));};exports[_0x6c1c('0x1c')]=function(_0x5badb4,_0x154f02){if(_0x5badb4[_0x6c1c('0x44')]['id']){delete _0x5badb4[_0x6c1c('0x44')]['id'];}return db['SAProductOrder']['find']({'where':{'id':_0x5badb4['params']['id']}})['then'](handleEntityNotFound(_0x154f02,null))['then'](saveUpdates(_0x5badb4[_0x6c1c('0x44')],null))[_0x6c1c('0x1d')](respondWithResult(_0x154f02,null))['catch'](handleError(_0x154f02,null));};exports[_0x6c1c('0x1e')]=function(_0x229d40,_0x2450ab){return db['SAProductOrder']['find']({'where':{'id':_0x229d40[_0x6c1c('0x41')]['id']}})[_0x6c1c('0x1d')](handleEntityNotFound(_0x2450ab,null))['then'](removeEntity(_0x2450ab,null))[_0x6c1c('0x40')](handleError(_0x2450ab,null));};exports[_0x6c1c('0x45')]=function(_0x3f4303,_0x4783f9){return db[_0x6c1c('0x3d')][_0x6c1c('0x45')]()['then'](respondWithResult(_0x4783f9,null))[_0x6c1c('0x40')](handleError(_0x4783f9,null));}; \ No newline at end of file +var _0xaf61=['day','merge','filter','map','type','key','VIRTUAL','field','options','includeAll','rows','catch','show','params','length','include','find','create','body','update','describe','html-pdf','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','json','count','offset','set','Content-Range','apply','reject','save','then','destroy','status','error','stack','name','send','index','SAProductOrder','rawAttributes','query','dateEnd','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','where','filters','pick','dateStart','add'];(function(_0x191eb7,_0x2a0a35){var _0x201e4c=function(_0x363945){while(--_0x363945){_0x191eb7['push'](_0x191eb7['shift']());}};_0x201e4c(++_0x2a0a35);}(_0xaf61,0xad));var _0x1af6=function(_0x3fb7f5,_0x1d4316){_0x3fb7f5=_0x3fb7f5-0x0;var _0x562fa0=_0xaf61[_0x3fb7f5];return _0x562fa0;};'use strict';var pdf=require(_0x1af6('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1af6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1af6('0x2'));var rp=require('request-promise');var moment=require(_0x1af6('0x3'));var BPromise=require(_0x1af6('0x4'));var Mustache=require(_0x1af6('0x5'));var util=require(_0x1af6('0x6'));var path=require(_0x1af6('0x7'));var sox=require('sox');var csv=require(_0x1af6('0x8'));var ejs=require(_0x1af6('0x9'));var fs=require('fs');var _=require(_0x1af6('0xa'));var squel=require(_0x1af6('0xb'));var crypto=require(_0x1af6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1af6('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var qs=require(_0x1af6('0xe'));var logger=require(_0x1af6('0xf'))(_0x1af6('0x10'));var utils=require(_0x1af6('0x11'));var config=require(_0x1af6('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x98fc3f,_0x460c8b){_0x460c8b=_0x460c8b||0xcc;return function(_0xf149cb){if(_0xf149cb){return _0x98fc3f[_0x1af6('0x13')](_0x460c8b);}return _0x98fc3f['status'](_0x460c8b)[_0x1af6('0x14')]();};}function respondWithResult(_0x7d12f7,_0x4beafb){_0x4beafb=_0x4beafb||0xc8;return function(_0x1ed287){if(_0x1ed287){return _0x7d12f7['status'](_0x4beafb)[_0x1af6('0x15')](_0x1ed287);}};}function respondWithFilteredResult(_0x1f907b,_0x40ab25){return function(_0x2d94a6){if(_0x2d94a6){var _0x13eb89=_0x2d94a6[_0x1af6('0x16')],_0x3ffaa6=_0x40ab25['offset'],_0x4ac516=_0x40ab25[_0x1af6('0x17')]+_0x40ab25['limit'],_0x4b7962;if(_0x4ac516>=_0x13eb89){_0x4ac516=_0x13eb89;_0x4b7962=0xc8;}else{_0x4b7962=0xce;}_0x1f907b['status'](_0x4b7962);return _0x1f907b[_0x1af6('0x18')](_0x1af6('0x19'),_0x3ffaa6+'-'+_0x4ac516+'/'+_0x13eb89)[_0x1af6('0x15')](_0x2d94a6);}return null;};}function patchUpdates(_0x549706){return function(_0x2c03fd){try{jsonpatch[_0x1af6('0x1a')](_0x2c03fd,_0x549706,!![]);}catch(_0xa5fd12){return BPromise[_0x1af6('0x1b')](_0xa5fd12);}return _0x2c03fd[_0x1af6('0x1c')]();};}function saveUpdates(_0x35b729,_0x5fe89e){return function(_0x261f55){if(_0x261f55){return _0x261f55['update'](_0x35b729)[_0x1af6('0x1d')](function(_0x24fd6d){return _0x24fd6d;});}return null;};}function removeEntity(_0x4284cc,_0x4a0443){return function(_0x153915){if(_0x153915){return _0x153915[_0x1af6('0x1e')]()['then'](function(){_0x4284cc[_0x1af6('0x1f')](0xcc)[_0x1af6('0x14')]();});}};}function handleEntityNotFound(_0x1e99b4,_0x4a2d5a){return function(_0x4c222d){if(!_0x4c222d){_0x1e99b4[_0x1af6('0x13')](0x194);}return _0x4c222d;};}function handleError(_0x1e919d,_0x1b314f){_0x1b314f=_0x1b314f||0x1f4;return function(_0x28b364){logger[_0x1af6('0x20')](_0x28b364[_0x1af6('0x21')]);if(_0x28b364[_0x1af6('0x22')]){delete _0x28b364[_0x1af6('0x22')];}_0x1e919d['status'](_0x1b314f)[_0x1af6('0x23')](_0x28b364);};}exports[_0x1af6('0x24')]=function(_0x2ac3a0,_0x48d43c){var _0xec7142={'raw':!![]},_0x1e046d={},_0x18418e={'count':0x0,'rows':[]};var _0x26ba6b=db[_0x1af6('0x25')][_0x1af6('0x26')];_0x1e046d['model']=_['keys'](_0x26ba6b);var _0x5b798c={'dateStart':_0x2ac3a0[_0x1af6('0x27')]['dateStart'],'dateEnd':_0x2ac3a0[_0x1af6('0x27')]['dateEnd']};delete _0x2ac3a0[_0x1af6('0x27')]['dateStart'];delete _0x2ac3a0[_0x1af6('0x27')][_0x1af6('0x28')];_0x1e046d['query']=_[_0x1af6('0x29')](_0x2ac3a0['query']);_0x1e046d['filters']=_[_0x1af6('0x2a')](_0x1e046d[_0x1af6('0x2b')],_0x1e046d[_0x1af6('0x27')]);_0xec7142[_0x1af6('0x2c')]=_[_0x1af6('0x2a')](_0x1e046d[_0x1af6('0x2b')],qs[_0x1af6('0x2d')](_0x2ac3a0[_0x1af6('0x27')][_0x1af6('0x2d')]));_0xec7142[_0x1af6('0x2c')]=_0xec7142['attributes']['length']?_0xec7142[_0x1af6('0x2c')]:_0x1e046d['model'];if(!_0x2ac3a0['query'][_0x1af6('0x2e')](_0x1af6('0x2f'))){_0xec7142[_0x1af6('0x30')]=qs[_0x1af6('0x30')](_0x2ac3a0[_0x1af6('0x27')]['limit']);_0xec7142[_0x1af6('0x17')]=qs['offset'](_0x2ac3a0[_0x1af6('0x27')][_0x1af6('0x17')]);}_0xec7142[_0x1af6('0x31')]=qs['sort'](_0x2ac3a0[_0x1af6('0x27')]['sort']);_0xec7142[_0x1af6('0x32')]=qs[_0x1af6('0x33')](_[_0x1af6('0x34')](_0x2ac3a0['query'],_0x1e046d['filters']));if(_0x5b798c[_0x1af6('0x35')]){if(_0x5b798c[_0x1af6('0x28')]){_0x5b798c[_0x1af6('0x28')]=moment(_0x5b798c[_0x1af6('0x28')])[_0x1af6('0x36')](0x1,_0x1af6('0x37'));}else{_0x5b798c[_0x1af6('0x28')]=moment(_0x5b798c[_0x1af6('0x35')])[_0x1af6('0x36')](0x1,'day');}_[_0x1af6('0x38')](_0xec7142['where'],{'createdAt':{'$gte':_0x5b798c[_0x1af6('0x35')],'$lte':_0x5b798c[_0x1af6('0x28')]}});}if(_0x2ac3a0[_0x1af6('0x27')][_0x1af6('0x39')]){_0xec7142[_0x1af6('0x32')]=_[_0x1af6('0x38')](_0xec7142[_0x1af6('0x32')],{'$or':_[_0x1af6('0x3a')](_0x26ba6b,function(_0x3d8233){if(_0x3d8233[_0x1af6('0x3b')][_0x1af6('0x3c')]!==_0x1af6('0x3d')){var _0xe60829={};_0xe60829[_0x3d8233[_0x1af6('0x3e')]]={'$like':'%'+_0x2ac3a0[_0x1af6('0x27')][_0x1af6('0x39')]+'%'};return _0xe60829;}})});}_0xec7142=_['merge']({},_0xec7142,_0x2ac3a0[_0x1af6('0x3f')]);var _0x4101b6={'where':_0xec7142[_0x1af6('0x32')]};return db[_0x1af6('0x25')]['count'](_0x4101b6)[_0x1af6('0x1d')](function(_0x4621ea){_0x18418e[_0x1af6('0x16')]=_0x4621ea;if(_0x2ac3a0['query'][_0x1af6('0x40')]){_0xec7142['include']=[{'all':!![]}];}return db['SAProductOrder']['findAll'](_0xec7142);})[_0x1af6('0x1d')](function(_0x216553){_0x18418e[_0x1af6('0x41')]=_0x216553;return _0x18418e;})[_0x1af6('0x1d')](respondWithFilteredResult(_0x48d43c,_0xec7142))[_0x1af6('0x42')](handleError(_0x48d43c,null));};exports[_0x1af6('0x43')]=function(_0xd8f664,_0x2b2f06){var _0xed2ac8={'raw':!![],'where':{'id':_0xd8f664[_0x1af6('0x44')]['id']}},_0x22c224={};_0x22c224['model']=_['keys'](db[_0x1af6('0x25')][_0x1af6('0x26')]);_0x22c224[_0x1af6('0x27')]=_[_0x1af6('0x29')](_0xd8f664[_0x1af6('0x27')]);_0x22c224[_0x1af6('0x33')]=_['intersection'](_0x22c224['model'],_0x22c224[_0x1af6('0x27')]);_0xed2ac8['attributes']=_[_0x1af6('0x2a')](_0x22c224[_0x1af6('0x2b')],qs['fields'](_0xd8f664[_0x1af6('0x27')][_0x1af6('0x2d')]));_0xed2ac8['attributes']=_0xed2ac8[_0x1af6('0x2c')][_0x1af6('0x45')]?_0xed2ac8[_0x1af6('0x2c')]:_0x22c224[_0x1af6('0x2b')];if(_0xd8f664[_0x1af6('0x27')][_0x1af6('0x40')]){_0xed2ac8[_0x1af6('0x46')]=[{'all':!![]}];}_0xed2ac8=_[_0x1af6('0x38')]({},_0xed2ac8,_0xd8f664[_0x1af6('0x3f')]);return db[_0x1af6('0x25')][_0x1af6('0x47')](_0xed2ac8)[_0x1af6('0x1d')](handleEntityNotFound(_0x2b2f06,null))[_0x1af6('0x1d')](respondWithResult(_0x2b2f06,null))[_0x1af6('0x42')](handleError(_0x2b2f06,null));};exports[_0x1af6('0x48')]=function(_0x29aa64,_0x465349){return db[_0x1af6('0x25')][_0x1af6('0x48')](_0x29aa64[_0x1af6('0x49')],{})[_0x1af6('0x1d')](respondWithResult(_0x465349,0xc9))['catch'](handleError(_0x465349,null));};exports[_0x1af6('0x4a')]=function(_0x4ba7f7,_0xd6b1fa){if(_0x4ba7f7['body']['id']){delete _0x4ba7f7[_0x1af6('0x49')]['id'];}return db[_0x1af6('0x25')][_0x1af6('0x47')]({'where':{'id':_0x4ba7f7[_0x1af6('0x44')]['id']}})['then'](handleEntityNotFound(_0xd6b1fa,null))['then'](saveUpdates(_0x4ba7f7[_0x1af6('0x49')],null))['then'](respondWithResult(_0xd6b1fa,null))[_0x1af6('0x42')](handleError(_0xd6b1fa,null));};exports[_0x1af6('0x1e')]=function(_0x1cde73,_0x5624be){return db['SAProductOrder'][_0x1af6('0x47')]({'where':{'id':_0x1cde73[_0x1af6('0x44')]['id']}})[_0x1af6('0x1d')](handleEntityNotFound(_0x5624be,null))['then'](removeEntity(_0x5624be,null))[_0x1af6('0x42')](handleError(_0x5624be,null));};exports[_0x1af6('0x4b')]=function(_0x5e7583,_0x34fc30){return db[_0x1af6('0x25')]['describe']()[_0x1af6('0x1d')](respondWithResult(_0x34fc30,null))[_0x1af6('0x42')](handleError(_0x34fc30,null));}; \ No newline at end of file diff --git a/server/api/saProductOrder/saProductOrder.model.js b/server/api/saProductOrder/saProductOrder.model.js index e25e898..20cc60a 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 _0xedf7=['bluebird','request-promise','./saProductOrder.attributes','exports','SAProductOrder','lodash','util','api'];(function(_0x1d586d,_0x3fcc44){var _0x5a0a3e=function(_0xbfcfb0){while(--_0xbfcfb0){_0x1d586d['push'](_0x1d586d['shift']());}};_0x5a0a3e(++_0x3fcc44);}(_0xedf7,0xad));var _0x7edf=function(_0x1ddeaa,_0x590eac){_0x1ddeaa=_0x1ddeaa-0x0;var _0x2e7a7f=_0xedf7[_0x1ddeaa];return _0x2e7a7f;};'use strict';var _=require(_0x7edf('0x0'));var util=require(_0x7edf('0x1'));var logger=require('../../config/logger')(_0x7edf('0x2'));var moment=require('moment');var BPromise=require(_0x7edf('0x3'));var rp=require(_0x7edf('0x4'));var attributes=require(_0x7edf('0x5'));module[_0x7edf('0x6')]=function(_0x9c7ffb,_0x1cd20d){return _0x9c7ffb['define'](_0x7edf('0x7'),attributes,{'tableName':'sa_product_has_order','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9531=['util','../../config/logger','api','moment','request-promise','./saProductOrder.attributes','define','sa_product_has_order','lodash'];(function(_0x5c7bbc,_0x23d0b7){var _0xf4c6e0=function(_0x3673a8){while(--_0x3673a8){_0x5c7bbc['push'](_0x5c7bbc['shift']());}};_0xf4c6e0(++_0x23d0b7);}(_0x9531,0xf2));var _0x1953=function(_0x550cf3,_0x2f810d){_0x550cf3=_0x550cf3-0x0;var _0x57553e=_0x9531[_0x550cf3];return _0x57553e;};'use strict';var _=require(_0x1953('0x0'));var util=require(_0x1953('0x1'));var logger=require(_0x1953('0x2'))(_0x1953('0x3'));var moment=require(_0x1953('0x4'));var BPromise=require('bluebird');var rp=require(_0x1953('0x5'));var attributes=require(_0x1953('0x6'));module['exports']=function(_0x390d1c,_0xf3fee8){return _0x390d1c[_0x1953('0x7')]('SAProductOrder',attributes,{'tableName':_0x1953('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 c1bd2f6..8a4d04f 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 _0xb457=['jayson/promise','client','http','request','then','request\x20sent','debug','SAProductOrder,\x20%s,\x20%s,\x20%s','stringify','error','code','SAProductOrder,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x2326b0,_0x441a72){var _0x3450e2=function(_0x39826b){while(--_0x39826b){_0x2326b0['push'](_0x2326b0['shift']());}};_0x3450e2(++_0x441a72);}(_0xb457,0x123));var _0x7b45=function(_0x51b0dc,_0x5307b7){_0x51b0dc=_0x51b0dc-0x0;var _0x13fa89=_0xb457[_0x51b0dc];return _0x13fa89;};'use strict';var _=require('lodash');var util=require(_0x7b45('0x0'));var moment=require(_0x7b45('0x1'));var BPromise=require(_0x7b45('0x2'));var rs=require(_0x7b45('0x3'));var fs=require('fs');var Redis=require(_0x7b45('0x4'));var db=require(_0x7b45('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b45('0x6'))(_0x7b45('0x7'));var config=require(_0x7b45('0x8'));var jayson=require(_0x7b45('0x9'));var client=jayson[_0x7b45('0xa')][_0x7b45('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x328c6a,_0x2d3efa,_0x5e6cf1){return new BPromise(function(_0x2e8cad,_0x129990){return client[_0x7b45('0xc')](_0x328c6a,_0x5e6cf1)[_0x7b45('0xd')](function(_0x51dd2f){logger['info']('SAProductOrder,\x20%s,\x20%s',_0x2d3efa,_0x7b45('0xe'));logger[_0x7b45('0xf')](_0x7b45('0x10'),_0x2d3efa,_0x7b45('0xe'),JSON[_0x7b45('0x11')](_0x51dd2f));if(_0x51dd2f[_0x7b45('0x12')]){if(_0x51dd2f['error'][_0x7b45('0x13')]===0x1f4){logger['error'](_0x7b45('0x14'),_0x2d3efa,_0x51dd2f[_0x7b45('0x12')][_0x7b45('0x15')]);return _0x129990(_0x51dd2f[_0x7b45('0x12')][_0x7b45('0x15')]);}logger[_0x7b45('0x12')](_0x7b45('0x14'),_0x2d3efa,_0x51dd2f[_0x7b45('0x12')]['message']);return _0x2e8cad(_0x51dd2f['error'][_0x7b45('0x15')]);}else{logger[_0x7b45('0x16')]('SAProductOrder,\x20%s,\x20%s',_0x2d3efa,'request\x20sent');_0x2e8cad(_0x51dd2f[_0x7b45('0x17')]['message']);}})[_0x7b45('0x18')](function(_0x50f959){logger['error'](_0x7b45('0x14'),_0x2d3efa,_0x50f959);_0x129990(_0x50f959);});});} \ No newline at end of file +var _0xe5d0=['jayson/promise','client','request','then','info','SAProductOrder,\x20%s,\x20%s','request\x20sent','debug','SAProductOrder,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x229101,_0x31339d){var _0xc93cb=function(_0x461394){while(--_0x461394){_0x229101['push'](_0x229101['shift']());}};_0xc93cb(++_0x31339d);}(_0xe5d0,0xcf));var _0x0e5d=function(_0x237a43,_0x8573b5){_0x237a43=_0x237a43-0x0;var _0x5903a7=_0xe5d0[_0x237a43];return _0x5903a7;};'use strict';var _=require('lodash');var util=require(_0x0e5d('0x0'));var moment=require(_0x0e5d('0x1'));var BPromise=require(_0x0e5d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0e5d('0x3'));var db=require(_0x0e5d('0x4'))['db'];var utils=require(_0x0e5d('0x5'));var logger=require(_0x0e5d('0x6'))(_0x0e5d('0x7'));var config=require(_0x0e5d('0x8'));var jayson=require(_0x0e5d('0x9'));var client=jayson[_0x0e5d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd1193b,_0x6a5840,_0x2230d2){return new BPromise(function(_0x321f75,_0x46932d){return client[_0x0e5d('0xb')](_0xd1193b,_0x2230d2)[_0x0e5d('0xc')](function(_0x50461d){logger[_0x0e5d('0xd')](_0x0e5d('0xe'),_0x6a5840,_0x0e5d('0xf'));logger[_0x0e5d('0x10')](_0x0e5d('0x11'),_0x6a5840,_0x0e5d('0xf'),JSON[_0x0e5d('0x12')](_0x50461d));if(_0x50461d['error']){if(_0x50461d[_0x0e5d('0x13')][_0x0e5d('0x14')]===0x1f4){logger['error']('SAProductOrder,\x20%s,\x20%s',_0x6a5840,_0x50461d[_0x0e5d('0x13')][_0x0e5d('0x15')]);return _0x46932d(_0x50461d[_0x0e5d('0x13')][_0x0e5d('0x15')]);}logger[_0x0e5d('0x13')](_0x0e5d('0xe'),_0x6a5840,_0x50461d[_0x0e5d('0x13')][_0x0e5d('0x15')]);return _0x321f75(_0x50461d['error']['message']);}else{logger[_0x0e5d('0xd')](_0x0e5d('0xe'),_0x6a5840,_0x0e5d('0xf'));_0x321f75(_0x50461d[_0x0e5d('0x16')][_0x0e5d('0x15')]);}})[_0x0e5d('0x17')](function(_0x5f51fb){logger[_0x0e5d('0x13')]('SAProductOrder,\x20%s,\x20%s',_0x6a5840,_0x5f51fb);_0x46932d(_0x5f51fb);});});} \ No newline at end of file diff --git a/server/api/saProductPricesList/index.js b/server/api/saProductPricesList/index.js index ff81ad6..3326621 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(_0x5f5cce,_0x138cc5){var _0x705ecf=function(_0x28bc5d){while(--_0x28bc5d){_0x5f5cce['push'](_0x5f5cce['shift']());}};_0x705ecf(++_0x138cc5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router; \ No newline at end of file +var _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./saProductPricesList.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router; \ No newline at end of file diff --git a/server/api/saProductPricesList/saProductPricesList.attributes.js b/server/api/saProductPricesList/saProductPricesList.attributes.js index 227cbcc..df088ac 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 _0x54fc=['DECIMAL','INTEGER','compositeIndex_prodID_priceID','sequelize'];(function(_0x5c65ef,_0x52a0d2){var _0x3138cc=function(_0x5814c2){while(--_0x5814c2){_0x5c65ef['push'](_0x5c65ef['shift']());}};_0x3138cc(++_0x52a0d2);}(_0x54fc,0xfb));var _0xc54f=function(_0x583a38,_0x4321ad){_0x583a38=_0x583a38-0x0;var _0x2973f2=_0x54fc[_0x583a38];return _0x2973f2;};'use strict';var Sequelize=require(_0xc54f('0x0'));module['exports']={'discount':{'type':Sequelize['DECIMAL'](0x6,0x3),'allowNull':![]},'netpricesalelist':{'type':Sequelize[_0xc54f('0x1')](0xd,0x4),'allowNull':![]},'ProductId':{'type':Sequelize[_0xc54f('0x2')],'unique':_0xc54f('0x3')},'PriceListId':{'type':Sequelize['INTEGER'],'unique':_0xc54f('0x3')}}; \ No newline at end of file +var _0x64ae=['compositeIndex_prodID_priceID','sequelize','DECIMAL','INTEGER'];(function(_0xa62341,_0x47a659){var _0xdc7e78=function(_0x204701){while(--_0x204701){_0xa62341['push'](_0xa62341['shift']());}};_0xdc7e78(++_0x47a659);}(_0x64ae,0xb1));var _0xe64a=function(_0x4c2c71,_0x1965cf){_0x4c2c71=_0x4c2c71-0x0;var _0x51e108=_0x64ae[_0x4c2c71];return _0x51e108;};'use strict';var Sequelize=require(_0xe64a('0x0'));module['exports']={'discount':{'type':Sequelize['DECIMAL'](0x6,0x3),'allowNull':![]},'netpricesalelist':{'type':Sequelize[_0xe64a('0x1')](0xd,0x4),'allowNull':![]},'ProductId':{'type':Sequelize[_0xe64a('0x2')],'unique':_0xe64a('0x3')},'PriceListId':{'type':Sequelize[_0xe64a('0x2')],'unique':_0xe64a('0x3')}}; \ No newline at end of file diff --git a/server/api/saProductPricesList/saProductPricesList.controller.js b/server/api/saProductPricesList/saProductPricesList.controller.js index 6c80366..c1f379f 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 _0x5739=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','set','Content-Range','apply','save','update','then','stack','name','index','SAProductPricesList','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','pick','filter','merge','type','VIRTUAL','field','options','include','catch','show','rawAttributes','intersection','includeAll','find','create','body','params','destroy','describe','html-pdf','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','papaparse','../../components/auth/service'];(function(_0x8e8ca7,_0x5a5e07){var _0x561381=function(_0x2f4bda){while(--_0x2f4bda){_0x8e8ca7['push'](_0x8e8ca7['shift']());}};_0x561381(++_0x5a5e07);}(_0x5739,0xbc));var _0x9573=function(_0x1bdffd,_0x53a24d){_0x1bdffd=_0x1bdffd-0x0;var _0x491ccf=_0x5739[_0x1bdffd];return _0x491ccf;};'use strict';var pdf=require(_0x9573('0x0'));var emlformat=require(_0x9573('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9573('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9573('0x3'));var moment=require('moment');var BPromise=require(_0x9573('0x4'));var Mustache=require(_0x9573('0x5'));var util=require(_0x9573('0x6'));var path=require(_0x9573('0x7'));var sox=require(_0x9573('0x8'));var csv=require(_0x9573('0x9'));var ejs=require(_0x9573('0xa'));var fs=require('fs');var _=require(_0x9573('0xb'));var squel=require(_0x9573('0xc'));var crypto=require('crypto');var jsforce=require(_0x9573('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9573('0xe'));var Redis=require('ioredis');var authService=require(_0x9573('0xf'));var qs=require(_0x9573('0x10'));var hardwareService=require(_0x9573('0x11'));var logger=require(_0x9573('0x12'))(_0x9573('0x13'));var utils=require('../../config/utils');var config=require(_0x9573('0x14'));var db=require(_0x9573('0x15'))['db'];function respondWithStatusCode(_0x23b77c,_0xdd3bff){_0xdd3bff=_0xdd3bff||0xcc;return function(_0x28b2ae){if(_0x28b2ae){return _0x23b77c[_0x9573('0x16')](_0xdd3bff);}return _0x23b77c['status'](_0xdd3bff)[_0x9573('0x17')]();};}function respondWithResult(_0x4f6106,_0x42844e){_0x42844e=_0x42844e||0xc8;return function(_0x3e8006){if(_0x3e8006){return _0x4f6106[_0x9573('0x18')](_0x42844e)[_0x9573('0x19')](_0x3e8006);}};}function respondWithFilteredResult(_0x5ed7b7,_0x515e98){return function(_0x5adff7){if(_0x5adff7){var _0x416353=_0x5adff7[_0x9573('0x1a')],_0x521dd3=_0x515e98[_0x9573('0x1b')],_0x3b2021=_0x515e98['offset']+_0x515e98['limit'],_0x334ca1;if(_0x3b2021>=_0x416353){_0x3b2021=_0x416353;_0x334ca1=0xc8;}else{_0x334ca1=0xce;}_0x5ed7b7[_0x9573('0x18')](_0x334ca1);return _0x5ed7b7[_0x9573('0x1c')](_0x9573('0x1d'),_0x521dd3+'-'+_0x3b2021+'/'+_0x416353)['json'](_0x5adff7);}return null;};}function patchUpdates(_0x13d08b){return function(_0x5a8d6c){try{jsonpatch[_0x9573('0x1e')](_0x5a8d6c,_0x13d08b,!![]);}catch(_0x31a02a){return BPromise['reject'](_0x31a02a);}return _0x5a8d6c[_0x9573('0x1f')]();};}function saveUpdates(_0x36e883,_0x1b2d13){return function(_0x4bee87){if(_0x4bee87){return _0x4bee87[_0x9573('0x20')](_0x36e883)['then'](function(_0x889427){return _0x889427;});}return null;};}function removeEntity(_0x3a4d3c,_0x2c7ba0){return function(_0x3b079d){if(_0x3b079d){return _0x3b079d['destroy']()[_0x9573('0x21')](function(){_0x3a4d3c[_0x9573('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c573b,_0x323e73){return function(_0x5b715f){if(!_0x5b715f){_0x5c573b[_0x9573('0x16')](0x194);}return _0x5b715f;};}function handleError(_0x4a3839,_0x30f751){_0x30f751=_0x30f751||0x1f4;return function(_0x5d3006){logger['error'](_0x5d3006[_0x9573('0x22')]);if(_0x5d3006[_0x9573('0x23')]){delete _0x5d3006['name'];}_0x4a3839['status'](_0x30f751)['send'](_0x5d3006);};}exports[_0x9573('0x24')]=function(_0x1936e7,_0x3d0974){var _0x1290fb={},_0x45d385={},_0x3e3f89={'count':0x0,'rows':[]};var _0x3aca56=db[_0x9573('0x25')]['rawAttributes'];_0x45d385[_0x9573('0x26')]=_['keys'](_0x3aca56);_0x45d385[_0x9573('0x27')]=_['keys'](_0x1936e7['query']);_0x45d385[_0x9573('0x28')]=_['intersection'](_0x45d385[_0x9573('0x26')],_0x45d385[_0x9573('0x27')]);_0x1290fb[_0x9573('0x29')]=_['intersection'](_0x45d385['model'],qs[_0x9573('0x2a')](_0x1936e7[_0x9573('0x27')][_0x9573('0x2a')]));_0x1290fb[_0x9573('0x29')]=_0x1290fb[_0x9573('0x29')][_0x9573('0x2b')]?_0x1290fb[_0x9573('0x29')]:_0x45d385[_0x9573('0x26')];if(!_0x1936e7['query'][_0x9573('0x2c')](_0x9573('0x2d'))){_0x1290fb[_0x9573('0x2e')]=qs[_0x9573('0x2e')](_0x1936e7[_0x9573('0x27')][_0x9573('0x2e')]);_0x1290fb[_0x9573('0x1b')]=qs[_0x9573('0x1b')](_0x1936e7['query'][_0x9573('0x1b')]);}_0x1290fb[_0x9573('0x2f')]=qs['sort'](_0x1936e7[_0x9573('0x27')]['sort']);_0x1290fb[_0x9573('0x30')]=qs['filters'](_[_0x9573('0x31')](_0x1936e7['query'],_0x45d385[_0x9573('0x28')]));if(_0x1936e7[_0x9573('0x27')][_0x9573('0x32')]){_0x1290fb['where']=_[_0x9573('0x33')](_0x1290fb[_0x9573('0x30')],{'$or':_['map'](_0x3aca56,function(_0x2d9c3a){if(_0x2d9c3a[_0x9573('0x34')]['key']!==_0x9573('0x35')){var _0x40d487={};_0x40d487[_0x2d9c3a[_0x9573('0x36')]]={'$like':'%'+_0x1936e7['query'][_0x9573('0x32')]+'%'};return _0x40d487;}})});}_0x1290fb=_['merge']({},_0x1290fb,_0x1936e7[_0x9573('0x37')]);var _0x11fa8e={'where':_0x1290fb[_0x9573('0x30')]};return db[_0x9573('0x25')][_0x9573('0x1a')](_0x11fa8e)['then'](function(_0x487935){_0x3e3f89['count']=_0x487935;if(_0x1936e7[_0x9573('0x27')]['includeAll']){_0x1290fb[_0x9573('0x38')]=[{'all':!![]}];}return db[_0x9573('0x25')]['findAll'](_0x1290fb);})['then'](function(_0x3a500d){_0x3e3f89['rows']=_0x3a500d;return _0x3e3f89;})[_0x9573('0x21')](respondWithFilteredResult(_0x3d0974,_0x1290fb))[_0x9573('0x39')](handleError(_0x3d0974,null));};exports[_0x9573('0x3a')]=function(_0x25def6,_0x1c76fa){var _0x4fcd98={'raw':![],'where':{'id':_0x25def6['params']['id']}},_0x4943e7={};_0x4943e7[_0x9573('0x26')]=_['keys'](db[_0x9573('0x25')][_0x9573('0x3b')]);_0x4943e7[_0x9573('0x27')]=_['keys'](_0x25def6[_0x9573('0x27')]);_0x4943e7['filters']=_[_0x9573('0x3c')](_0x4943e7[_0x9573('0x26')],_0x4943e7[_0x9573('0x27')]);_0x4fcd98[_0x9573('0x29')]=_[_0x9573('0x3c')](_0x4943e7[_0x9573('0x26')],qs[_0x9573('0x2a')](_0x25def6[_0x9573('0x27')][_0x9573('0x2a')]));_0x4fcd98[_0x9573('0x29')]=_0x4fcd98[_0x9573('0x29')][_0x9573('0x2b')]?_0x4fcd98[_0x9573('0x29')]:_0x4943e7[_0x9573('0x26')];if(_0x25def6[_0x9573('0x27')][_0x9573('0x3d')]){_0x4fcd98[_0x9573('0x38')]=[{'all':!![]}];}_0x4fcd98=_[_0x9573('0x33')]({},_0x4fcd98,_0x25def6[_0x9573('0x37')]);return db[_0x9573('0x25')][_0x9573('0x3e')](_0x4fcd98)[_0x9573('0x21')](handleEntityNotFound(_0x1c76fa,null))['then'](respondWithResult(_0x1c76fa,null))[_0x9573('0x39')](handleError(_0x1c76fa,null));};exports[_0x9573('0x3f')]=function(_0x1e0721,_0x1f20ab){return db[_0x9573('0x25')]['create'](_0x1e0721[_0x9573('0x40')],{})['then'](respondWithResult(_0x1f20ab,0xc9))['catch'](handleError(_0x1f20ab,null));};exports[_0x9573('0x20')]=function(_0x159985,_0x2db03e){if(_0x159985[_0x9573('0x40')]['id']){delete _0x159985[_0x9573('0x40')]['id'];}return db[_0x9573('0x25')]['find']({'where':{'id':_0x159985[_0x9573('0x41')]['id']}})[_0x9573('0x21')](handleEntityNotFound(_0x2db03e,null))['then'](saveUpdates(_0x159985[_0x9573('0x40')],null))[_0x9573('0x21')](respondWithResult(_0x2db03e,null))[_0x9573('0x39')](handleError(_0x2db03e,null));};exports[_0x9573('0x42')]=function(_0x457b58,_0x2c893b){return db[_0x9573('0x25')][_0x9573('0x3e')]({'where':{'id':_0x457b58[_0x9573('0x41')]['id']}})[_0x9573('0x21')](handleEntityNotFound(_0x2c893b,null))[_0x9573('0x21')](removeEntity(_0x2c893b,null))[_0x9573('0x39')](handleError(_0x2c893b,null));};exports[_0x9573('0x43')]=function(_0x5f1504,_0x210f57){return db[_0x9573('0x25')][_0x9573('0x43')]()[_0x9573('0x21')](respondWithResult(_0x210f57,null))[_0x9573('0x39')](handleError(_0x210f57,null));}; \ No newline at end of file +var _0x402b=['../../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','save','update','destroy','then','error','stack','name','send','index','SAProductPricesList','rawAttributes','keys','query','intersection','attributes','fields','model','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','include','findAll','rows','catch','params','length','includeAll','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','lodash','squel','desk.js','to-csv','querystring','ioredis'];(function(_0xb66df,_0x4fb5ce){var _0x42a702=function(_0x252d1d){while(--_0x252d1d){_0xb66df['push'](_0xb66df['shift']());}};_0x42a702(++_0x4fb5ce);}(_0x402b,0x159));var _0xb402=function(_0x4bc732,_0x57d27f){_0x4bc732=_0x4bc732-0x0;var _0x4e2302=_0x402b[_0x4bc732];return _0x4e2302;};'use strict';var pdf=require(_0xb402('0x0'));var emlformat=require(_0xb402('0x1'));var rimraf=require(_0xb402('0x2'));var zipdir=require(_0xb402('0x3'));var jsonpatch=require(_0xb402('0x4'));var rp=require('request-promise');var moment=require(_0xb402('0x5'));var BPromise=require(_0xb402('0x6'));var Mustache=require('mustache');var util=require(_0xb402('0x7'));var path=require('path');var sox=require(_0xb402('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xb402('0x9'));var squel=require(_0xb402('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb402('0xb'));var toCsv=require(_0xb402('0xc'));var querystring=require(_0xb402('0xd'));var Papa=require('papaparse');var Redis=require(_0xb402('0xe'));var authService=require(_0xb402('0xf'));var qs=require(_0xb402('0x10'));var hardwareService=require(_0xb402('0x11'));var logger=require(_0xb402('0x12'))(_0xb402('0x13'));var utils=require('../../config/utils');var config=require(_0xb402('0x14'));var db=require(_0xb402('0x15'))['db'];function respondWithStatusCode(_0xc5bfb2,_0x16645e){_0x16645e=_0x16645e||0xcc;return function(_0x3d7a29){if(_0x3d7a29){return _0xc5bfb2[_0xb402('0x16')](_0x16645e);}return _0xc5bfb2[_0xb402('0x17')](_0x16645e)[_0xb402('0x18')]();};}function respondWithResult(_0x53c7ab,_0x227f2d){_0x227f2d=_0x227f2d||0xc8;return function(_0x4ade73){if(_0x4ade73){return _0x53c7ab[_0xb402('0x17')](_0x227f2d)[_0xb402('0x19')](_0x4ade73);}};}function respondWithFilteredResult(_0x32c923,_0x44b0ba){return function(_0x160fe1){if(_0x160fe1){var _0x2f405f=_0x160fe1[_0xb402('0x1a')],_0x39590b=_0x44b0ba[_0xb402('0x1b')],_0x51b8d6=_0x44b0ba[_0xb402('0x1b')]+_0x44b0ba['limit'],_0x4c2383;if(_0x51b8d6>=_0x2f405f){_0x51b8d6=_0x2f405f;_0x4c2383=0xc8;}else{_0x4c2383=0xce;}_0x32c923[_0xb402('0x17')](_0x4c2383);return _0x32c923[_0xb402('0x1c')](_0xb402('0x1d'),_0x39590b+'-'+_0x51b8d6+'/'+_0x2f405f)[_0xb402('0x19')](_0x160fe1);}return null;};}function patchUpdates(_0xb73890){return function(_0x109ddf){try{jsonpatch[_0xb402('0x1e')](_0x109ddf,_0xb73890,!![]);}catch(_0x52a58c){return BPromise['reject'](_0x52a58c);}return _0x109ddf[_0xb402('0x1f')]();};}function saveUpdates(_0x5a0ac0,_0x5e0212){return function(_0x1dc173){if(_0x1dc173){return _0x1dc173[_0xb402('0x20')](_0x5a0ac0)['then'](function(_0x169efb){return _0x169efb;});}return null;};}function removeEntity(_0x5d9883,_0x27bc55){return function(_0x38d021){if(_0x38d021){return _0x38d021[_0xb402('0x21')]()[_0xb402('0x22')](function(){_0x5d9883[_0xb402('0x17')](0xcc)[_0xb402('0x18')]();});}};}function handleEntityNotFound(_0x4a7273,_0xed7552){return function(_0x301a71){if(!_0x301a71){_0x4a7273[_0xb402('0x16')](0x194);}return _0x301a71;};}function handleError(_0x57d125,_0x164cae){_0x164cae=_0x164cae||0x1f4;return function(_0x179316){logger[_0xb402('0x23')](_0x179316[_0xb402('0x24')]);if(_0x179316[_0xb402('0x25')]){delete _0x179316[_0xb402('0x25')];}_0x57d125[_0xb402('0x17')](_0x164cae)[_0xb402('0x26')](_0x179316);};}exports[_0xb402('0x27')]=function(_0x9ace87,_0x2fa275){var _0x1d9709={},_0x2482e5={},_0x44615b={'count':0x0,'rows':[]};var _0x3deacd=db[_0xb402('0x28')][_0xb402('0x29')];_0x2482e5['model']=_[_0xb402('0x2a')](_0x3deacd);_0x2482e5[_0xb402('0x2b')]=_[_0xb402('0x2a')](_0x9ace87['query']);_0x2482e5['filters']=_[_0xb402('0x2c')](_0x2482e5['model'],_0x2482e5[_0xb402('0x2b')]);_0x1d9709[_0xb402('0x2d')]=_['intersection'](_0x2482e5['model'],qs[_0xb402('0x2e')](_0x9ace87[_0xb402('0x2b')]['fields']));_0x1d9709['attributes']=_0x1d9709[_0xb402('0x2d')]['length']?_0x1d9709[_0xb402('0x2d')]:_0x2482e5[_0xb402('0x2f')];if(!_0x9ace87[_0xb402('0x2b')][_0xb402('0x30')](_0xb402('0x31'))){_0x1d9709['limit']=qs[_0xb402('0x32')](_0x9ace87['query'][_0xb402('0x32')]);_0x1d9709['offset']=qs['offset'](_0x9ace87['query'][_0xb402('0x1b')]);}_0x1d9709[_0xb402('0x33')]=qs[_0xb402('0x34')](_0x9ace87['query'][_0xb402('0x34')]);_0x1d9709['where']=qs[_0xb402('0x35')](_[_0xb402('0x36')](_0x9ace87['query'],_0x2482e5[_0xb402('0x35')]));if(_0x9ace87['query'][_0xb402('0x37')]){_0x1d9709[_0xb402('0x38')]=_[_0xb402('0x39')](_0x1d9709[_0xb402('0x38')],{'$or':_['map'](_0x3deacd,function(_0x3719fe){if(_0x3719fe[_0xb402('0x3a')]['key']!==_0xb402('0x3b')){var _0x1c2c4d={};_0x1c2c4d[_0x3719fe['field']]={'$like':'%'+_0x9ace87['query'][_0xb402('0x37')]+'%'};return _0x1c2c4d;}})});}_0x1d9709=_[_0xb402('0x39')]({},_0x1d9709,_0x9ace87[_0xb402('0x3c')]);var _0x3883f0={'where':_0x1d9709['where']};return db[_0xb402('0x28')][_0xb402('0x1a')](_0x3883f0)[_0xb402('0x22')](function(_0x129ba7){_0x44615b[_0xb402('0x1a')]=_0x129ba7;if(_0x9ace87[_0xb402('0x2b')]['includeAll']){_0x1d9709[_0xb402('0x3d')]=[{'all':!![]}];}return db[_0xb402('0x28')][_0xb402('0x3e')](_0x1d9709);})[_0xb402('0x22')](function(_0x31e101){_0x44615b[_0xb402('0x3f')]=_0x31e101;return _0x44615b;})['then'](respondWithFilteredResult(_0x2fa275,_0x1d9709))[_0xb402('0x40')](handleError(_0x2fa275,null));};exports['show']=function(_0x408430,_0x133581){var _0x4e07f8={'raw':![],'where':{'id':_0x408430[_0xb402('0x41')]['id']}},_0x4e3c4a={};_0x4e3c4a['model']=_[_0xb402('0x2a')](db['SAProductPricesList'][_0xb402('0x29')]);_0x4e3c4a[_0xb402('0x2b')]=_[_0xb402('0x2a')](_0x408430['query']);_0x4e3c4a[_0xb402('0x35')]=_[_0xb402('0x2c')](_0x4e3c4a[_0xb402('0x2f')],_0x4e3c4a[_0xb402('0x2b')]);_0x4e07f8[_0xb402('0x2d')]=_[_0xb402('0x2c')](_0x4e3c4a[_0xb402('0x2f')],qs[_0xb402('0x2e')](_0x408430[_0xb402('0x2b')][_0xb402('0x2e')]));_0x4e07f8[_0xb402('0x2d')]=_0x4e07f8[_0xb402('0x2d')][_0xb402('0x42')]?_0x4e07f8[_0xb402('0x2d')]:_0x4e3c4a[_0xb402('0x2f')];if(_0x408430['query'][_0xb402('0x43')]){_0x4e07f8[_0xb402('0x3d')]=[{'all':!![]}];}_0x4e07f8=_[_0xb402('0x39')]({},_0x4e07f8,_0x408430[_0xb402('0x3c')]);return db[_0xb402('0x28')]['find'](_0x4e07f8)[_0xb402('0x22')](handleEntityNotFound(_0x133581,null))[_0xb402('0x22')](respondWithResult(_0x133581,null))['catch'](handleError(_0x133581,null));};exports[_0xb402('0x44')]=function(_0x43982d,_0x53a7b1){return db[_0xb402('0x28')]['create'](_0x43982d['body'],{})['then'](respondWithResult(_0x53a7b1,0xc9))[_0xb402('0x40')](handleError(_0x53a7b1,null));};exports[_0xb402('0x20')]=function(_0xd41f96,_0x37e60e){if(_0xd41f96[_0xb402('0x45')]['id']){delete _0xd41f96[_0xb402('0x45')]['id'];}return db[_0xb402('0x28')][_0xb402('0x46')]({'where':{'id':_0xd41f96[_0xb402('0x41')]['id']}})[_0xb402('0x22')](handleEntityNotFound(_0x37e60e,null))[_0xb402('0x22')](saveUpdates(_0xd41f96[_0xb402('0x45')],null))[_0xb402('0x22')](respondWithResult(_0x37e60e,null))['catch'](handleError(_0x37e60e,null));};exports[_0xb402('0x21')]=function(_0x516ef3,_0x525f7b){return db['SAProductPricesList'][_0xb402('0x46')]({'where':{'id':_0x516ef3[_0xb402('0x41')]['id']}})['then'](handleEntityNotFound(_0x525f7b,null))['then'](removeEntity(_0x525f7b,null))[_0xb402('0x40')](handleError(_0x525f7b,null));};exports[_0xb402('0x47')]=function(_0x19284f,_0x22af29){return db[_0xb402('0x28')]['describe']()[_0xb402('0x22')](respondWithResult(_0x22af29,null))[_0xb402('0x40')](handleError(_0x22af29,null));}; \ No newline at end of file diff --git a/server/api/saProductPricesList/saProductPricesList.model.js b/server/api/saProductPricesList/saProductPricesList.model.js index deea4eb..bf2cb72 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 _0xe644=['path','rimraf','../../config/environment','./saProductPricesList.attributes','exports','define','SAProductPricesList','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3a49b7,_0xe9d03e){var _0x404e61=function(_0x52c0a7){while(--_0x52c0a7){_0x3a49b7['push'](_0x3a49b7['shift']());}};_0x404e61(++_0xe9d03e);}(_0xe644,0x159));var _0x4e64=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe644[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4e64('0x0'));var util=require(_0x4e64('0x1'));var logger=require(_0x4e64('0x2'))(_0x4e64('0x3'));var moment=require(_0x4e64('0x4'));var BPromise=require(_0x4e64('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4e64('0x6'));var rimraf=require(_0x4e64('0x7'));var config=require(_0x4e64('0x8'));var attributes=require(_0x4e64('0x9'));module[_0x4e64('0xa')]=function(_0x13fa90,_0x55c23b){return _0x13fa90[_0x4e64('0xb')](_0x4e64('0xc'),attributes,{'tableName':'sa_product_has_price_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe79a=['../../config/environment','./saProductPricesList.attributes','exports','define','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x2c53e0,_0x55bf17){var _0x3f8356=function(_0x144742){while(--_0x144742){_0x2c53e0['push'](_0x2c53e0['shift']());}};_0x3f8356(++_0x55bf17);}(_0xe79a,0x70));var _0xae79=function(_0x13d5bc,_0x3fce3c){_0x13d5bc=_0x13d5bc-0x0;var _0x4b8a40=_0xe79a[_0x13d5bc];return _0x4b8a40;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xae79('0x0'))('api');var moment=require(_0xae79('0x1'));var BPromise=require(_0xae79('0x2'));var rp=require(_0xae79('0x3'));var fs=require('fs');var path=require(_0xae79('0x4'));var rimraf=require('rimraf');var config=require(_0xae79('0x5'));var attributes=require(_0xae79('0x6'));module[_0xae79('0x7')]=function(_0x590be7,_0x1a9185){return _0x590be7[_0xae79('0x8')]('SAProductPricesList',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 dd3bab7..4e48e05 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 _0x2c39=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client','http','info','SAProductPricesList,\x20%s,\x20%s','SAProductPricesList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util'];(function(_0x8c00d9,_0x51d865){var _0x5a1b30=function(_0x4aad55){while(--_0x4aad55){_0x8c00d9['push'](_0x8c00d9['shift']());}};_0x5a1b30(++_0x51d865);}(_0x2c39,0x70));var _0x92c3=function(_0x126a10,_0x7bde76){_0x126a10=_0x126a10-0x0;var _0x15a853=_0x2c39[_0x126a10];return _0x15a853;};'use strict';var _=require(_0x92c3('0x0'));var util=require(_0x92c3('0x1'));var moment=require('moment');var BPromise=require(_0x92c3('0x2'));var rs=require(_0x92c3('0x3'));var fs=require('fs');var Redis=require(_0x92c3('0x4'));var db=require(_0x92c3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x92c3('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x92c3('0x7')][_0x92c3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1140de,_0x3acccf,_0x19a2d9){return new BPromise(function(_0x515176,_0x2b2161){return client['request'](_0x1140de,_0x19a2d9)['then'](function(_0x45070a){logger[_0x92c3('0x9')](_0x92c3('0xa'),_0x3acccf,'request\x20sent');logger['debug'](_0x92c3('0xb'),_0x3acccf,'request\x20sent',JSON[_0x92c3('0xc')](_0x45070a));if(_0x45070a[_0x92c3('0xd')]){if(_0x45070a[_0x92c3('0xd')][_0x92c3('0xe')]===0x1f4){logger[_0x92c3('0xd')]('SAProductPricesList,\x20%s,\x20%s',_0x3acccf,_0x45070a[_0x92c3('0xd')][_0x92c3('0xf')]);return _0x2b2161(_0x45070a[_0x92c3('0xd')][_0x92c3('0xf')]);}logger[_0x92c3('0xd')]('SAProductPricesList,\x20%s,\x20%s',_0x3acccf,_0x45070a[_0x92c3('0xd')][_0x92c3('0xf')]);return _0x515176(_0x45070a[_0x92c3('0xd')][_0x92c3('0xf')]);}else{logger['info'](_0x92c3('0xa'),_0x3acccf,_0x92c3('0x10'));_0x515176(_0x45070a[_0x92c3('0x11')][_0x92c3('0xf')]);}})[_0x92c3('0x12')](function(_0x2d91e3){logger['error'](_0x92c3('0xa'),_0x3acccf,_0x2d91e3);_0x2b2161(_0x2d91e3);});});} \ No newline at end of file +var _0xbb51=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','SAProductPricesList,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','result','catch','lodash','util','moment','bluebird'];(function(_0x461462,_0x268228){var _0x5443cf=function(_0x93bfd5){while(--_0x93bfd5){_0x461462['push'](_0x461462['shift']());}};_0x5443cf(++_0x268228);}(_0xbb51,0x1f4));var _0x1bb5=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xbb51[_0xdea41a];return _0x15d0d8;};'use strict';var _=require(_0x1bb5('0x0'));var util=require(_0x1bb5('0x1'));var moment=require(_0x1bb5('0x2'));var BPromise=require(_0x1bb5('0x3'));var rs=require(_0x1bb5('0x4'));var fs=require('fs');var Redis=require(_0x1bb5('0x5'));var db=require(_0x1bb5('0x6'))['db'];var utils=require(_0x1bb5('0x7'));var logger=require(_0x1bb5('0x8'))('rpc');var config=require(_0x1bb5('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1bb5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a45a7,_0x5720da,_0x251129){return new BPromise(function(_0x32bf09,_0x5ea3c3){return client[_0x1bb5('0xb')](_0x1a45a7,_0x251129)['then'](function(_0x86a670){logger['info'](_0x1bb5('0xc'),_0x5720da,'request\x20sent');logger[_0x1bb5('0xd')]('SAProductPricesList,\x20%s,\x20%s,\x20%s',_0x5720da,_0x1bb5('0xe'),JSON[_0x1bb5('0xf')](_0x86a670));if(_0x86a670[_0x1bb5('0x10')]){if(_0x86a670[_0x1bb5('0x10')]['code']===0x1f4){logger[_0x1bb5('0x10')](_0x1bb5('0xc'),_0x5720da,_0x86a670[_0x1bb5('0x10')]['message']);return _0x5ea3c3(_0x86a670[_0x1bb5('0x10')][_0x1bb5('0x11')]);}logger[_0x1bb5('0x10')]('SAProductPricesList,\x20%s,\x20%s',_0x5720da,_0x86a670[_0x1bb5('0x10')]['message']);return _0x32bf09(_0x86a670[_0x1bb5('0x10')][_0x1bb5('0x11')]);}else{logger[_0x1bb5('0x12')](_0x1bb5('0xc'),_0x5720da,_0x1bb5('0xe'));_0x32bf09(_0x86a670[_0x1bb5('0x13')]['message']);}})[_0x1bb5('0x14')](function(_0x983c16){logger['error'](_0x1bb5('0xc'),_0x5720da,_0x983c16);_0x5ea3c3(_0x983c16);});});} \ No newline at end of file diff --git a/server/api/saProductQuotation/index.js b/server/api/saProductQuotation/index.js index dd5145d..8128d58 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 _0x7c09=['../../config/environment','./saProductQuotation.controller','get','/describe','isAuthenticated','describe','/:id','show','create','automaticInvoice','post','/:id/automaticProforma','automaticProforma','put','update','/:id/updateBulk','delete','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xe9fc75,_0x301b64){var _0x482b79=function(_0x842fc6){while(--_0x842fc6){_0xe9fc75['push'](_0xe9fc75['shift']());}};_0x482b79(++_0x301b64);}(_0x7c09,0x102));var _0x97c0=function(_0x59f729,_0x575a81){_0x59f729=_0x59f729-0x0;var _0x345d93=_0x7c09[_0x59f729];return _0x345d93;};'use strict';var multer=require('multer');var util=require(_0x97c0('0x0'));var path=require(_0x97c0('0x1'));var timeout=require('connect-timeout');var express=require(_0x97c0('0x2'));var router=express[_0x97c0('0x3')]();var auth=require(_0x97c0('0x4'));var interaction=require(_0x97c0('0x5'));var config=require(_0x97c0('0x6'));var controller=require(_0x97c0('0x7'));router[_0x97c0('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x97c0('0x9'),auth[_0x97c0('0xa')](),controller[_0x97c0('0xb')]);router[_0x97c0('0x8')](_0x97c0('0xc'),auth['isAuthenticated'](),controller[_0x97c0('0xd')]);router['post']('/',auth[_0x97c0('0xa')](),controller[_0x97c0('0xe')]);router['post']('/:id/automaticInvoice',auth[_0x97c0('0xa')](),controller[_0x97c0('0xf')]);router[_0x97c0('0x10')](_0x97c0('0x11'),auth[_0x97c0('0xa')](),controller[_0x97c0('0x12')]);router[_0x97c0('0x13')](_0x97c0('0xc'),auth[_0x97c0('0xa')](),controller[_0x97c0('0x14')]);router[_0x97c0('0x13')](_0x97c0('0x15'),auth[_0x97c0('0xa')](),controller['updateBulk']);router[_0x97c0('0x16')](_0x97c0('0xc'),auth[_0x97c0('0xa')](),controller['destroy']);module[_0x97c0('0x17')]=router; \ No newline at end of file +var _0x3baf=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./saProductQuotation.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','/:id/automaticInvoice','automaticInvoice','/:id/automaticProforma','automaticProforma','put','update','/:id/updateBulk','updateBulk','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x3baf,0xf7));var _0xf3ba=function(_0x67a5fe,_0x5b1510){_0x67a5fe=_0x67a5fe-0x0;var _0x2703c3=_0x3baf[_0x67a5fe];return _0x2703c3;};'use strict';var multer=require(_0xf3ba('0x0'));var util=require(_0xf3ba('0x1'));var path=require(_0xf3ba('0x2'));var timeout=require(_0xf3ba('0x3'));var express=require(_0xf3ba('0x4'));var router=express[_0xf3ba('0x5')]();var auth=require(_0xf3ba('0x6'));var interaction=require(_0xf3ba('0x7'));var config=require(_0xf3ba('0x8'));var controller=require(_0xf3ba('0x9'));router[_0xf3ba('0xa')]('/',auth[_0xf3ba('0xb')](),controller[_0xf3ba('0xc')]);router[_0xf3ba('0xa')](_0xf3ba('0xd'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xf3ba('0xe'),auth['isAuthenticated'](),controller[_0xf3ba('0xf')]);router[_0xf3ba('0x10')]('/',auth[_0xf3ba('0xb')](),controller[_0xf3ba('0x11')]);router[_0xf3ba('0x10')](_0xf3ba('0x12'),auth[_0xf3ba('0xb')](),controller[_0xf3ba('0x13')]);router[_0xf3ba('0x10')](_0xf3ba('0x14'),auth[_0xf3ba('0xb')](),controller[_0xf3ba('0x15')]);router[_0xf3ba('0x16')](_0xf3ba('0xe'),auth[_0xf3ba('0xb')](),controller[_0xf3ba('0x17')]);router[_0xf3ba('0x16')](_0xf3ba('0x18'),auth['isAuthenticated'](),controller[_0xf3ba('0x19')]);router['delete'](_0xf3ba('0xe'),auth[_0xf3ba('0xb')](),controller[_0xf3ba('0x1a')]);module[_0xf3ba('0x1b')]=router; \ No newline at end of file diff --git a/server/api/saProductQuotation/saProductQuotation.attributes.js b/server/api/saProductQuotation/saProductQuotation.attributes.js index 335bb32..941f405 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 _0x74ee=['exports','TEXT','compositeIndex_prodCode_QuotationID','DECIMAL','long','\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci','INTEGER','STRING','sequelize'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0x74ee,0x98));var _0xe74e=function(_0x5e149c,_0x309768){_0x5e149c=_0x5e149c-0x0;var _0x54bd20=_0x74ee[_0x5e149c];return _0x54bd20;};'use strict';var Sequelize=require(_0xe74e('0x0'));module[_0xe74e('0x1')]={'productName':{'type':Sequelize[_0xe74e('0x2')],'allowNull':![]},'productCode':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xe74e('0x3')},'productNetPrice':{'type':Sequelize[_0xe74e('0x4')](0xd,0x4)},'productTax':{'type':Sequelize['INTEGER']},'productDescription':{'type':Sequelize[_0xe74e('0x2')](_0xe74e('0x5'))+_0xe74e('0x6')},'productQtyMin':{'type':Sequelize[_0xe74e('0x7')],'allowNull':!![]},'pricelistName':{'type':Sequelize[_0xe74e('0x2')]},'pricelistId':{'type':Sequelize[_0xe74e('0x7')]},'pricelistDiscount':{'type':Sequelize[_0xe74e('0x4')](0x6,0x3),'allowNull':![]},'productPricelistDiscount':{'type':Sequelize[_0xe74e('0x4')](0xd,0x4),'allowNull':![]},'productPricelistNetPrice':{'type':Sequelize[_0xe74e('0x4')](0xd,0x4)},'netPrice':{'type':Sequelize[_0xe74e('0x4')](0xd,0x4),'allowNull':![]},'quantity':{'type':Sequelize['DECIMAL'](0xd,0x4),'allowNull':![]},'discount':{'type':Sequelize[_0xe74e('0x4')](0x6,0x3),'allowNull':![]},'totalPrice':{'type':Sequelize[_0xe74e('0x4')](0xd,0x4),'allowNull':![]},'tax':{'type':Sequelize['DECIMAL'](0xd,0x4),'allowNull':![]},'totalDiscount':{'type':Sequelize[_0xe74e('0x4')](0xd,0x4),'allowNull':![]},'totalTax':{'type':Sequelize[_0xe74e('0x4')](0xd,0x4),'allowNull':![]},'agentFullname':{'type':Sequelize[_0xe74e('0x8')]},'note':{'type':Sequelize['TEXT']},'QuotationId':{'type':Sequelize[_0xe74e('0x7')],'unique':_0xe74e('0x3')},'totalPrice':{'type':Sequelize['DECIMAL'](0xd,0x4)},'totalTax':{'type':Sequelize[_0xe74e('0x4')](0xd,0x4)},'typeName':{'type':Sequelize[_0xe74e('0x8')]},'TypeId':{'type':Sequelize[_0xe74e('0x7')]},'unitName':{'type':Sequelize['STRING']},'UnitId':{'type':Sequelize[_0xe74e('0x7')]},'subscriptionName':{'type':Sequelize[_0xe74e('0x8')]},'subscriptionId':{'type':Sequelize[_0xe74e('0x7')]},'subscriptionMonthly':{'type':Sequelize[_0xe74e('0x7')]},'companyName':{'type':Sequelize[_0xe74e('0x8')]},'companyId':{'type':Sequelize[_0xe74e('0x7')]},'productAsset':{'type':Sequelize['BOOLEAN']},'deletedAt':{'type':Sequelize['DATE'],'unique':_0xe74e('0x3')}}; \ No newline at end of file +var _0x5fd4=['sequelize','TEXT','compositeIndex_prodCode_QuotationID','DECIMAL','INTEGER','long','\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci','STRING','DATE'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x5fd4,0x87));var _0x45fd=function(_0x1c2f89,_0x55c000){_0x1c2f89=_0x1c2f89-0x0;var _0x11213b=_0x5fd4[_0x1c2f89];return _0x11213b;};'use strict';var Sequelize=require(_0x45fd('0x0'));module['exports']={'productName':{'type':Sequelize[_0x45fd('0x1')],'allowNull':![]},'productCode':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x45fd('0x2')},'productNetPrice':{'type':Sequelize[_0x45fd('0x3')](0xd,0x4)},'productTax':{'type':Sequelize[_0x45fd('0x4')]},'productDescription':{'type':Sequelize['TEXT'](_0x45fd('0x5'))+_0x45fd('0x6')},'productQtyMin':{'type':Sequelize['INTEGER'],'allowNull':!![]},'pricelistName':{'type':Sequelize['TEXT']},'pricelistId':{'type':Sequelize[_0x45fd('0x4')]},'pricelistDiscount':{'type':Sequelize['DECIMAL'](0x6,0x3),'allowNull':![]},'productPricelistDiscount':{'type':Sequelize[_0x45fd('0x3')](0xd,0x4),'allowNull':![]},'productPricelistNetPrice':{'type':Sequelize[_0x45fd('0x3')](0xd,0x4)},'netPrice':{'type':Sequelize[_0x45fd('0x3')](0xd,0x4),'allowNull':![]},'quantity':{'type':Sequelize['DECIMAL'](0xd,0x4),'allowNull':![]},'discount':{'type':Sequelize[_0x45fd('0x3')](0x6,0x3),'allowNull':![]},'totalPrice':{'type':Sequelize[_0x45fd('0x3')](0xd,0x4),'allowNull':![]},'tax':{'type':Sequelize[_0x45fd('0x3')](0xd,0x4),'allowNull':![]},'totalDiscount':{'type':Sequelize[_0x45fd('0x3')](0xd,0x4),'allowNull':![]},'totalTax':{'type':Sequelize[_0x45fd('0x3')](0xd,0x4),'allowNull':![]},'agentFullname':{'type':Sequelize[_0x45fd('0x7')]},'note':{'type':Sequelize['TEXT']},'QuotationId':{'type':Sequelize['INTEGER'],'unique':_0x45fd('0x2')},'totalPrice':{'type':Sequelize[_0x45fd('0x3')](0xd,0x4)},'totalTax':{'type':Sequelize[_0x45fd('0x3')](0xd,0x4)},'typeName':{'type':Sequelize['STRING']},'TypeId':{'type':Sequelize['INTEGER']},'unitName':{'type':Sequelize[_0x45fd('0x7')]},'UnitId':{'type':Sequelize['INTEGER']},'subscriptionName':{'type':Sequelize[_0x45fd('0x7')]},'subscriptionId':{'type':Sequelize[_0x45fd('0x4')]},'subscriptionMonthly':{'type':Sequelize[_0x45fd('0x4')]},'companyName':{'type':Sequelize[_0x45fd('0x7')]},'companyId':{'type':Sequelize[_0x45fd('0x4')]},'productAsset':{'type':Sequelize['BOOLEAN']},'deletedAt':{'type':Sequelize[_0x45fd('0x8')],'unique':_0x45fd('0x2')}}; \ No newline at end of file diff --git a/server/api/saProductQuotation/saProductQuotation.controller.js b/server/api/saProductQuotation/saProductQuotation.controller.js index a532f1c..b7687c5 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 _0xb7e7=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','field','options','SAProductQuotation','includeAll','findAll','show','params','rawAttributes','include','catch','create','body','find','describe','ProformaId','InvoiceId','updateBulk','transaction','productName','productCode','typeName','pricelistName','ProductPriceListId','discount','tax','note','subscriptionId','subscriptionName','subscriptionMonthly','quantity','unitName','SAInvoiceDetail','automaticInvoice','sequelize','SAInvoice','log','result','push','all','WARNING','sendStatus','name','SequelizeUniqueConstraintError','Duplicate\x20entry.','companyName','productDescription','netPrice','agentFullname','SAProformaDetail','automaticProforma','SAProforma','No\x20product\x20to\x20assign\x20proforma.\x20Proforma\x20not\x20created!!','TCL:\x20exports.automaticProforma\x20->\x20err','html-pdf','rimraf','fast-json-patch','moment','mustache','util','path','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','send','index','model','keys','filters','intersection','attributes','fields','query'];(function(_0x4e680a,_0x3c3a3f){var _0x47dc42=function(_0x396524){while(--_0x396524){_0x4e680a['push'](_0x4e680a['shift']());}};_0x47dc42(++_0x3c3a3f);}(_0xb7e7,0x121));var _0x7b7e=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xb7e7[_0x580576];return _0x3f55a0;};'use strict';var pdf=require(_0x7b7e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7b7e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7b7e('0x2'));var rp=require('request-promise');var moment=require(_0x7b7e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7b7e('0x4'));var util=require(_0x7b7e('0x5'));var path=require(_0x7b7e('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7b7e('0x7'));var fs=require('fs');var _=require(_0x7b7e('0x8'));var squel=require(_0x7b7e('0x9'));var crypto=require('crypto');var jsforce=require(_0x7b7e('0xa'));var deskjs=require(_0x7b7e('0xb'));var toCsv=require(_0x7b7e('0xc'));var querystring=require(_0x7b7e('0xd'));var Papa=require(_0x7b7e('0xe'));var Redis=require(_0x7b7e('0xf'));var authService=require(_0x7b7e('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x7b7e('0x11'));var logger=require(_0x7b7e('0x12'))(_0x7b7e('0x13'));var utils=require(_0x7b7e('0x14'));var config=require(_0x7b7e('0x15'));var db=require(_0x7b7e('0x16'))['db'];function respondWithStatusCode(_0x36d2a3,_0x55620b){_0x55620b=_0x55620b||0xcc;return function(_0xaadda){if(_0xaadda){return _0x36d2a3['sendStatus'](_0x55620b);}return _0x36d2a3[_0x7b7e('0x17')](_0x55620b)[_0x7b7e('0x18')]();};}function respondWithResult(_0x50d7d2,_0x422d3a){_0x422d3a=_0x422d3a||0xc8;return function(_0x5976ac){if(_0x5976ac){return _0x50d7d2['status'](_0x422d3a)[_0x7b7e('0x19')](_0x5976ac);}};}function respondWithFilteredResult(_0xd304f5,_0xf067da){return function(_0x457ec5){if(_0x457ec5){var _0x3d2fb2=_0x457ec5[_0x7b7e('0x1a')],_0x5703fd=_0xf067da[_0x7b7e('0x1b')],_0x51baf6=_0xf067da[_0x7b7e('0x1b')]+_0xf067da[_0x7b7e('0x1c')],_0xc7f087;if(_0x51baf6>=_0x3d2fb2){_0x51baf6=_0x3d2fb2;_0xc7f087=0xc8;}else{_0xc7f087=0xce;}_0xd304f5[_0x7b7e('0x17')](_0xc7f087);return _0xd304f5[_0x7b7e('0x1d')](_0x7b7e('0x1e'),_0x5703fd+'-'+_0x51baf6+'/'+_0x3d2fb2)[_0x7b7e('0x19')](_0x457ec5);}return null;};}function patchUpdates(_0x429a0e){return function(_0x12e8e9){try{jsonpatch[_0x7b7e('0x1f')](_0x12e8e9,_0x429a0e,!![]);}catch(_0x448980){return BPromise[_0x7b7e('0x20')](_0x448980);}return _0x12e8e9[_0x7b7e('0x21')]();};}function saveUpdates(_0x864287,_0x3a7b8b){return function(_0x49eddb){if(_0x49eddb){return _0x49eddb[_0x7b7e('0x22')](_0x864287)[_0x7b7e('0x23')](function(_0x24718c){return _0x24718c;});}return null;};}function removeEntity(_0x4c0647,_0x313122){return function(_0xbf0cb3){if(_0xbf0cb3){return _0xbf0cb3[_0x7b7e('0x24')]()[_0x7b7e('0x23')](function(){_0x4c0647[_0x7b7e('0x17')](0xcc)[_0x7b7e('0x18')]();});}};}function handleEntityNotFound(_0x28bf43,_0x10a66a){return function(_0x53bbb3){if(!_0x53bbb3){_0x28bf43['sendStatus'](0x194);}return _0x53bbb3;};}function handleError(_0x4a836a,_0x26ee14){_0x26ee14=_0x26ee14||0x1f4;return function(_0x22598e){logger[_0x7b7e('0x25')](_0x22598e['stack']);if(_0x22598e['name']){delete _0x22598e['name'];}_0x4a836a[_0x7b7e('0x17')](_0x26ee14)[_0x7b7e('0x26')](_0x22598e);};}exports[_0x7b7e('0x27')]=function(_0x7aa71,_0x3ceaf5){var _0x48fad1={'raw':!![]},_0x6a1e71={},_0x21a15={'count':0x0,'rows':[]};var _0x4c46b8=db['SAProductQuotation']['rawAttributes'];_0x6a1e71[_0x7b7e('0x28')]=_[_0x7b7e('0x29')](_0x4c46b8);_0x6a1e71['query']=_[_0x7b7e('0x29')](_0x7aa71['query']);_0x6a1e71[_0x7b7e('0x2a')]=_[_0x7b7e('0x2b')](_0x6a1e71[_0x7b7e('0x28')],_0x6a1e71['query']);_0x48fad1[_0x7b7e('0x2c')]=_[_0x7b7e('0x2b')](_0x6a1e71[_0x7b7e('0x28')],qs[_0x7b7e('0x2d')](_0x7aa71[_0x7b7e('0x2e')]['fields']));_0x48fad1[_0x7b7e('0x2c')]=_0x48fad1['attributes'][_0x7b7e('0x2f')]?_0x48fad1[_0x7b7e('0x2c')]:_0x6a1e71[_0x7b7e('0x28')];if(!_0x7aa71[_0x7b7e('0x2e')][_0x7b7e('0x30')](_0x7b7e('0x31'))){_0x48fad1[_0x7b7e('0x1c')]=qs['limit'](_0x7aa71['query'][_0x7b7e('0x1c')]);_0x48fad1[_0x7b7e('0x1b')]=qs['offset'](_0x7aa71[_0x7b7e('0x2e')][_0x7b7e('0x1b')]);}_0x48fad1[_0x7b7e('0x32')]=qs['sort'](_0x7aa71[_0x7b7e('0x2e')][_0x7b7e('0x33')]);_0x48fad1[_0x7b7e('0x34')]=qs[_0x7b7e('0x2a')](_[_0x7b7e('0x35')](_0x7aa71[_0x7b7e('0x2e')],_0x6a1e71[_0x7b7e('0x2a')]));if(_0x7aa71[_0x7b7e('0x2e')][_0x7b7e('0x36')]){_0x48fad1[_0x7b7e('0x34')]=_[_0x7b7e('0x37')](_0x48fad1[_0x7b7e('0x34')],{'$or':_[_0x7b7e('0x38')](_0x4c46b8,function(_0xdcb8ef){if(_0xdcb8ef[_0x7b7e('0x39')][_0x7b7e('0x3a')]!=='VIRTUAL'){var _0x8c80d5={};_0x8c80d5[_0xdcb8ef[_0x7b7e('0x3b')]]={'$like':'%'+_0x7aa71[_0x7b7e('0x2e')][_0x7b7e('0x36')]+'%'};return _0x8c80d5;}})});}_0x48fad1=_[_0x7b7e('0x37')]({},_0x48fad1,_0x7aa71[_0x7b7e('0x3c')]);var _0x7f15={'where':_0x48fad1[_0x7b7e('0x34')]};return db[_0x7b7e('0x3d')][_0x7b7e('0x1a')](_0x7f15)['then'](function(_0x3d6571){_0x21a15[_0x7b7e('0x1a')]=_0x3d6571;if(_0x7aa71[_0x7b7e('0x2e')][_0x7b7e('0x3e')]){_0x48fad1['include']=[{'all':!![]}];}return db[_0x7b7e('0x3d')][_0x7b7e('0x3f')](_0x48fad1);})[_0x7b7e('0x23')](function(_0x5c58c0){_0x21a15['rows']=_0x5c58c0;return _0x21a15;})[_0x7b7e('0x23')](respondWithFilteredResult(_0x3ceaf5,_0x48fad1))['catch'](handleError(_0x3ceaf5,null));};exports[_0x7b7e('0x40')]=function(_0x3b16d7,_0x4de331){var _0xa5daaa={'raw':!![],'where':{'id':_0x3b16d7[_0x7b7e('0x41')]['id']}},_0x2074d1={};_0x2074d1[_0x7b7e('0x28')]=_[_0x7b7e('0x29')](db[_0x7b7e('0x3d')][_0x7b7e('0x42')]);_0x2074d1[_0x7b7e('0x2e')]=_[_0x7b7e('0x29')](_0x3b16d7['query']);_0x2074d1['filters']=_[_0x7b7e('0x2b')](_0x2074d1['model'],_0x2074d1[_0x7b7e('0x2e')]);_0xa5daaa['attributes']=_['intersection'](_0x2074d1[_0x7b7e('0x28')],qs['fields'](_0x3b16d7[_0x7b7e('0x2e')]['fields']));_0xa5daaa[_0x7b7e('0x2c')]=_0xa5daaa[_0x7b7e('0x2c')][_0x7b7e('0x2f')]?_0xa5daaa[_0x7b7e('0x2c')]:_0x2074d1['model'];if(_0x3b16d7[_0x7b7e('0x2e')][_0x7b7e('0x3e')]){_0xa5daaa[_0x7b7e('0x43')]=[{'all':!![]}];}_0xa5daaa=_[_0x7b7e('0x37')]({},_0xa5daaa,_0x3b16d7[_0x7b7e('0x3c')]);return db[_0x7b7e('0x3d')]['find'](_0xa5daaa)['then'](handleEntityNotFound(_0x4de331,null))['then'](respondWithResult(_0x4de331,null))[_0x7b7e('0x44')](handleError(_0x4de331,null));};exports[_0x7b7e('0x45')]=function(_0x2f9de2,_0x2cfe70){return db[_0x7b7e('0x3d')][_0x7b7e('0x45')](_0x2f9de2['body'],{})[_0x7b7e('0x23')](respondWithResult(_0x2cfe70,0xc9))[_0x7b7e('0x44')](handleError(_0x2cfe70,null));};exports['update']=function(_0x5efcb8,_0x1dcb88){if(_0x5efcb8[_0x7b7e('0x46')]['id']){delete _0x5efcb8[_0x7b7e('0x46')]['id'];}return db[_0x7b7e('0x3d')][_0x7b7e('0x47')]({'where':{'id':_0x5efcb8[_0x7b7e('0x41')]['id']}})['then'](handleEntityNotFound(_0x1dcb88,null))[_0x7b7e('0x23')](saveUpdates(_0x5efcb8['body'],null))[_0x7b7e('0x23')](respondWithResult(_0x1dcb88,null))[_0x7b7e('0x44')](handleError(_0x1dcb88,null));};exports[_0x7b7e('0x24')]=function(_0x5874e2,_0x58e4e6){return db[_0x7b7e('0x3d')][_0x7b7e('0x47')]({'where':{'id':_0x5874e2[_0x7b7e('0x41')]['id']}})[_0x7b7e('0x23')](handleEntityNotFound(_0x58e4e6,null))[_0x7b7e('0x23')](removeEntity(_0x58e4e6,null))['catch'](handleError(_0x58e4e6,null));};exports[_0x7b7e('0x48')]=function(_0x270c4a,_0x21868a){return db[_0x7b7e('0x3d')][_0x7b7e('0x48')]()['then'](respondWithResult(_0x21868a,null))[_0x7b7e('0x44')](handleError(_0x21868a,null));};function assignProductQuotationToProformaInvoice(_0x29024e,_0x46d4ee){if(_0x29024e[_0x7b7e('0x46')]['id']){delete _0x29024e[_0x7b7e('0x46')]['id'];}return db[_0x7b7e('0x3d')][_0x7b7e('0x22')]({'ProformaId':_0x29024e['body'][_0x7b7e('0x49')],'InvoiceId':_0x29024e['body'][_0x7b7e('0x4a')]},{'where':{'QuotationId':_0x29024e[_0x7b7e('0x41')]['id'],'ProformaId':_0x29024e['query'][_0x7b7e('0x49')]||{'$eq':null},'InvoiceId':_0x29024e[_0x7b7e('0x2e')][_0x7b7e('0x4a')]||{'$eq':null}},'transaction':_0x46d4ee});}exports[_0x7b7e('0x4b')]=function(_0x412d1b,_0x36ffd4,_0x337d06){return db['sequelize'][_0x7b7e('0x4c')](function(_0x3ff731){return assignProductQuotationToProformaInvoice(_0x412d1b,_0x3ff731)[_0x7b7e('0x23')](function(_0x24481a){return _0x36ffd4['sendStatus'](0xc8);})['catch'](handleError(_0x36ffd4,null));});};function addInvoiceDetail(_0x5bdf1d,_0x2471ad,_0x41530f){var _0x26d52f={'companyName':_0x5bdf1d['companyName'],'companyId':_0x5bdf1d['companyId'],'productName':_0x5bdf1d[_0x7b7e('0x4d')],'productCode':_0x5bdf1d[_0x7b7e('0x4e')],'productDescription':_0x5bdf1d['productDescription'],'typeName':_0x5bdf1d[_0x7b7e('0x4f')],'pricelistName':_0x5bdf1d[_0x7b7e('0x50')],'priceListId':_0x5bdf1d[_0x7b7e('0x51')],'netPrice':_0x5bdf1d['netPrice'],'discount':_0x5bdf1d[_0x7b7e('0x52')],'tax':_0x5bdf1d[_0x7b7e('0x53')],'agentFullname':_0x5bdf1d['agentFullname'],'note':_0x5bdf1d[_0x7b7e('0x54')],'subscriptionId':_0x5bdf1d[_0x7b7e('0x55')],'subscriptionName':_0x5bdf1d[_0x7b7e('0x56')],'subscriptionMonthly':_0x5bdf1d[_0x7b7e('0x57')],'quantity':_0x5bdf1d[_0x7b7e('0x58')],'InvoiceId':_0x2471ad,'unitName':_0x5bdf1d[_0x7b7e('0x59')]};return db[_0x7b7e('0x5a')][_0x7b7e('0x45')](_0x26d52f,{'transaction':_0x41530f})[_0x7b7e('0x23')](function(){return db['SAProductQuotation'][_0x7b7e('0x22')]({'InvoiceId':_0x2471ad},{'where':{'id':_0x5bdf1d['id']},'transaction':_0x41530f});});}exports[_0x7b7e('0x5b')]=function(_0x516e75,_0xc2b1b6,_0xa22edc){if(_0x516e75[_0x7b7e('0x46')]['id']){delete _0x516e75['body']['id'];}return db[_0x7b7e('0x5c')]['transaction'](function(_0x50c544){return db[_0x7b7e('0x5d')]['create'](_0x516e75[_0x7b7e('0x46')],{'transaction':_0x50c544})[_0x7b7e('0x23')](function(_0x561158){console[_0x7b7e('0x5e')](_0x7b7e('0x5f'),_0x561158);var _0x1d43af=_0x516e75[_0x7b7e('0x41')]['id'];return db['SAProductQuotation'][_0x7b7e('0x3f')]({'where':{'QuotationId':_0x1d43af,'productAsset':{'$ne':0x1},'ProformaId':{'$eq':null},'InvoiceId':{'$eq':null}},'raw':!![],'logging':console[_0x7b7e('0x5e')]})[_0x7b7e('0x23')](function(_0x7f705c){if(_0x7f705c[_0x7b7e('0x2f')]>0x0){var _0x1b97d6=[];for(var _0x230663=0x0;_0x230663<_0x7f705c[_0x7b7e('0x2f')];_0x230663++){_0x1b97d6[_0x7b7e('0x60')](addInvoiceDetail(_0x7f705c[_0x230663],_0x561158['id'],_0x50c544));}return BPromise[_0x7b7e('0x61')](_0x1b97d6);}else{var _0x5b9010={'errors':[{'type':_0x7b7e('0x62'),'message':'No\x20product\x20to\x20assign\x20invoice.\x20Invoice\x20not\x20created!!'}]};throw _0x5b9010;}});});})['then'](function(){return _0xc2b1b6[_0x7b7e('0x63')](0xc8);})[_0x7b7e('0x44')](function(_0x1eb4b1){console[_0x7b7e('0x5e')]('TCL:\x20exports.automaticInvoice\x20->\x20err',_0x1eb4b1);if(_0x1eb4b1[_0x7b7e('0x64')]===_0x7b7e('0x65')){var _0x1eb4b1={'errors':[{'message':_0x7b7e('0x66')}]};}_0xc2b1b6[_0x7b7e('0x17')](0x1f4)[_0x7b7e('0x26')](_0x1eb4b1);});};function addProformaDetail(_0x4e485c,_0x1ebd58,_0x52b070){var _0x4a3af8={'companyName':_0x4e485c[_0x7b7e('0x67')],'companyId':_0x4e485c['companyId'],'productName':_0x4e485c[_0x7b7e('0x4d')],'productCode':_0x4e485c['productCode'],'productDescription':_0x4e485c[_0x7b7e('0x68')],'typeName':_0x4e485c[_0x7b7e('0x4f')],'pricelistName':_0x4e485c['pricelistName'],'priceListId':_0x4e485c[_0x7b7e('0x51')],'netPrice':_0x4e485c[_0x7b7e('0x69')],'discount':_0x4e485c['discount'],'tax':_0x4e485c[_0x7b7e('0x53')],'agentFullname':_0x4e485c[_0x7b7e('0x6a')],'note':_0x4e485c[_0x7b7e('0x54')],'subscriptionId':_0x4e485c[_0x7b7e('0x55')],'subscriptionName':_0x4e485c[_0x7b7e('0x56')],'subscriptionMonthly':_0x4e485c[_0x7b7e('0x57')],'quantity':_0x4e485c[_0x7b7e('0x58')],'ProformaId':_0x1ebd58};return db[_0x7b7e('0x6b')][_0x7b7e('0x45')](_0x4a3af8,{'transaction':_0x52b070})[_0x7b7e('0x23')](function(){return db['SAProductQuotation']['update']({'ProformaId':_0x1ebd58},{'where':{'id':_0x4e485c['id']},'transaction':_0x52b070});});}exports[_0x7b7e('0x6c')]=function(_0x46ac1f,_0x2c6e3a,_0x348c77){if(_0x46ac1f[_0x7b7e('0x46')]['id']){delete _0x46ac1f[_0x7b7e('0x46')]['id'];}return db[_0x7b7e('0x5c')]['transaction'](function(_0x28e6ac){return db[_0x7b7e('0x6d')]['create'](_0x46ac1f[_0x7b7e('0x46')],{'transaction':_0x28e6ac})[_0x7b7e('0x23')](function(_0x2fea85){console[_0x7b7e('0x5e')](_0x7b7e('0x5f'),_0x2fea85);var _0x40f65e=_0x46ac1f[_0x7b7e('0x41')]['id'];return db[_0x7b7e('0x3d')][_0x7b7e('0x3f')]({'where':{'QuotationId':_0x40f65e,'productAsset':{'$ne':0x1},'ProformaId':{'$eq':null},'InvoiceId':{'$eq':null}},'raw':!![],'logging':console[_0x7b7e('0x5e')]})[_0x7b7e('0x23')](function(_0x4dd6f5){if(_0x4dd6f5[_0x7b7e('0x2f')]>0x0){var _0x131ad5=[];for(var _0x1c040a=0x0;_0x1c040a<_0x4dd6f5[_0x7b7e('0x2f')];_0x1c040a++){_0x131ad5[_0x7b7e('0x60')](addProformaDetail(_0x4dd6f5[_0x1c040a],_0x2fea85['id'],_0x28e6ac));}return BPromise[_0x7b7e('0x61')](_0x131ad5);}else{var _0xfdd68c={'errors':[{'type':'WARNING','message':_0x7b7e('0x6e')}]};throw _0xfdd68c;}});});})[_0x7b7e('0x23')](function(){return _0x2c6e3a[_0x7b7e('0x63')](0xc8);})['catch'](function(_0x1d6aa4){console[_0x7b7e('0x5e')](_0x7b7e('0x6f'),_0x1d6aa4);if(_0x1d6aa4[_0x7b7e('0x64')]===_0x7b7e('0x65')){var _0x1d6aa4={'errors':[{'message':'Duplicate\x20entry.'}]};}_0x2c6e3a['status'](0x1f4)[_0x7b7e('0x26')](_0x1d6aa4);});}; \ No newline at end of file +var _0xe706=['options','includeAll','include','findAll','catch','show','find','create','body','params','describe','ProformaId','InvoiceId','updateBulk','sequelize','transaction','companyId','productName','productCode','productDescription','typeName','pricelistName','ProductPriceListId','netPrice','discount','tax','agentFullname','note','subscriptionId','subscriptionName','subscriptionMonthly','quantity','unitName','SAInvoiceDetail','automaticInvoice','SAInvoice','log','result','WARNING','TCL:\x20exports.automaticInvoice\x20->\x20err','SequelizeUniqueConstraintError','Duplicate\x20entry.','companyName','SAProformaDetail','SAProforma','push','all','TCL:\x20exports.automaticProforma\x20->\x20err','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','SAProductQuotation','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field'];(function(_0xf104db,_0x3bb494){var _0xab56c5=function(_0x53083c){while(--_0x53083c){_0xf104db['push'](_0xf104db['shift']());}};_0xab56c5(++_0x3bb494);}(_0xe706,0xa3));var _0x6e70=function(_0x1fe56b,_0x3860ff){_0x1fe56b=_0x1fe56b-0x0;var _0x366c40=_0xe706[_0x1fe56b];return _0x366c40;};'use strict';var pdf=require(_0x6e70('0x0'));var emlformat=require(_0x6e70('0x1'));var rimraf=require(_0x6e70('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6e70('0x3'));var rp=require(_0x6e70('0x4'));var moment=require(_0x6e70('0x5'));var BPromise=require(_0x6e70('0x6'));var Mustache=require(_0x6e70('0x7'));var util=require(_0x6e70('0x8'));var path=require(_0x6e70('0x9'));var sox=require(_0x6e70('0xa'));var csv=require(_0x6e70('0xb'));var ejs=require(_0x6e70('0xc'));var fs=require('fs');var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xb'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var Redis=require(_0x6e70('0x14'));var authService=require(_0x6e70('0x15'));var qs=require(_0x6e70('0x16'));var hardwareService=require(_0x6e70('0x17'));var logger=require(_0x6e70('0x18'))(_0x6e70('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x6e70('0x1a'))['db'];function respondWithStatusCode(_0x15a1a5,_0x18cf27){_0x18cf27=_0x18cf27||0xcc;return function(_0x27dd9b){if(_0x27dd9b){return _0x15a1a5[_0x6e70('0x1b')](_0x18cf27);}return _0x15a1a5[_0x6e70('0x1c')](_0x18cf27)[_0x6e70('0x1d')]();};}function respondWithResult(_0x181005,_0x5dfbaa){_0x5dfbaa=_0x5dfbaa||0xc8;return function(_0x52737e){if(_0x52737e){return _0x181005['status'](_0x5dfbaa)[_0x6e70('0x1e')](_0x52737e);}};}function respondWithFilteredResult(_0x5a37a6,_0x53aed0){return function(_0x304716){if(_0x304716){var _0x22c50c=_0x304716[_0x6e70('0x1f')],_0x5d9263=_0x53aed0[_0x6e70('0x20')],_0x24f3ac=_0x53aed0['offset']+_0x53aed0['limit'],_0x5c3fe7;if(_0x24f3ac>=_0x22c50c){_0x24f3ac=_0x22c50c;_0x5c3fe7=0xc8;}else{_0x5c3fe7=0xce;}_0x5a37a6[_0x6e70('0x1c')](_0x5c3fe7);return _0x5a37a6['set'](_0x6e70('0x21'),_0x5d9263+'-'+_0x24f3ac+'/'+_0x22c50c)[_0x6e70('0x1e')](_0x304716);}return null;};}function patchUpdates(_0x53acdc){return function(_0x497d61){try{jsonpatch[_0x6e70('0x22')](_0x497d61,_0x53acdc,!![]);}catch(_0x208e21){return BPromise[_0x6e70('0x23')](_0x208e21);}return _0x497d61[_0x6e70('0x24')]();};}function saveUpdates(_0x3af484,_0xcdf9f2){return function(_0x1b2453){if(_0x1b2453){return _0x1b2453[_0x6e70('0x25')](_0x3af484)[_0x6e70('0x26')](function(_0xb29a2a){return _0xb29a2a;});}return null;};}function removeEntity(_0x4a0cfe,_0x228350){return function(_0x344b65){if(_0x344b65){return _0x344b65[_0x6e70('0x27')]()['then'](function(){_0x4a0cfe[_0x6e70('0x1c')](0xcc)[_0x6e70('0x1d')]();});}};}function handleEntityNotFound(_0x3337a6,_0x50da2c){return function(_0x10fc91){if(!_0x10fc91){_0x3337a6['sendStatus'](0x194);}return _0x10fc91;};}function handleError(_0x50aec2,_0x4e97c7){_0x4e97c7=_0x4e97c7||0x1f4;return function(_0x41e352){logger[_0x6e70('0x28')](_0x41e352['stack']);if(_0x41e352[_0x6e70('0x29')]){delete _0x41e352[_0x6e70('0x29')];}_0x50aec2['status'](_0x4e97c7)[_0x6e70('0x2a')](_0x41e352);};}exports[_0x6e70('0x2b')]=function(_0x2bb231,_0x4a67ac){var _0x54a5fe={'raw':!![]},_0x2c4d37={},_0x3af17f={'count':0x0,'rows':[]};var _0x83c836=db[_0x6e70('0x2c')][_0x6e70('0x2d')];_0x2c4d37['model']=_[_0x6e70('0x2e')](_0x83c836);_0x2c4d37[_0x6e70('0x2f')]=_[_0x6e70('0x2e')](_0x2bb231[_0x6e70('0x2f')]);_0x2c4d37[_0x6e70('0x30')]=_[_0x6e70('0x31')](_0x2c4d37[_0x6e70('0x32')],_0x2c4d37[_0x6e70('0x2f')]);_0x54a5fe[_0x6e70('0x33')]=_[_0x6e70('0x31')](_0x2c4d37['model'],qs[_0x6e70('0x34')](_0x2bb231['query'][_0x6e70('0x34')]));_0x54a5fe['attributes']=_0x54a5fe[_0x6e70('0x33')][_0x6e70('0x35')]?_0x54a5fe[_0x6e70('0x33')]:_0x2c4d37['model'];if(!_0x2bb231[_0x6e70('0x2f')][_0x6e70('0x36')]('nolimit')){_0x54a5fe[_0x6e70('0x37')]=qs[_0x6e70('0x37')](_0x2bb231['query'][_0x6e70('0x37')]);_0x54a5fe[_0x6e70('0x20')]=qs[_0x6e70('0x20')](_0x2bb231[_0x6e70('0x2f')][_0x6e70('0x20')]);}_0x54a5fe[_0x6e70('0x38')]=qs[_0x6e70('0x39')](_0x2bb231[_0x6e70('0x2f')][_0x6e70('0x39')]);_0x54a5fe[_0x6e70('0x3a')]=qs['filters'](_[_0x6e70('0x3b')](_0x2bb231['query'],_0x2c4d37[_0x6e70('0x30')]));if(_0x2bb231[_0x6e70('0x2f')][_0x6e70('0x3c')]){_0x54a5fe[_0x6e70('0x3a')]=_[_0x6e70('0x3d')](_0x54a5fe[_0x6e70('0x3a')],{'$or':_[_0x6e70('0x3e')](_0x83c836,function(_0xdd0bee){if(_0xdd0bee[_0x6e70('0x3f')][_0x6e70('0x40')]!==_0x6e70('0x41')){var _0x23d5e2={};_0x23d5e2[_0xdd0bee[_0x6e70('0x42')]]={'$like':'%'+_0x2bb231['query']['filter']+'%'};return _0x23d5e2;}})});}_0x54a5fe=_['merge']({},_0x54a5fe,_0x2bb231[_0x6e70('0x43')]);var _0x3841a0={'where':_0x54a5fe[_0x6e70('0x3a')]};return db[_0x6e70('0x2c')][_0x6e70('0x1f')](_0x3841a0)[_0x6e70('0x26')](function(_0x572a71){_0x3af17f[_0x6e70('0x1f')]=_0x572a71;if(_0x2bb231[_0x6e70('0x2f')][_0x6e70('0x44')]){_0x54a5fe[_0x6e70('0x45')]=[{'all':!![]}];}return db[_0x6e70('0x2c')][_0x6e70('0x46')](_0x54a5fe);})[_0x6e70('0x26')](function(_0x16fc7d){_0x3af17f['rows']=_0x16fc7d;return _0x3af17f;})[_0x6e70('0x26')](respondWithFilteredResult(_0x4a67ac,_0x54a5fe))[_0x6e70('0x47')](handleError(_0x4a67ac,null));};exports[_0x6e70('0x48')]=function(_0x31cad2,_0x201da9){var _0x1de947={'raw':!![],'where':{'id':_0x31cad2['params']['id']}},_0x21b0e7={};_0x21b0e7['model']=_['keys'](db[_0x6e70('0x2c')][_0x6e70('0x2d')]);_0x21b0e7[_0x6e70('0x2f')]=_[_0x6e70('0x2e')](_0x31cad2[_0x6e70('0x2f')]);_0x21b0e7['filters']=_[_0x6e70('0x31')](_0x21b0e7[_0x6e70('0x32')],_0x21b0e7[_0x6e70('0x2f')]);_0x1de947['attributes']=_['intersection'](_0x21b0e7['model'],qs[_0x6e70('0x34')](_0x31cad2['query'][_0x6e70('0x34')]));_0x1de947[_0x6e70('0x33')]=_0x1de947[_0x6e70('0x33')][_0x6e70('0x35')]?_0x1de947['attributes']:_0x21b0e7[_0x6e70('0x32')];if(_0x31cad2['query'][_0x6e70('0x44')]){_0x1de947[_0x6e70('0x45')]=[{'all':!![]}];}_0x1de947=_[_0x6e70('0x3d')]({},_0x1de947,_0x31cad2[_0x6e70('0x43')]);return db['SAProductQuotation'][_0x6e70('0x49')](_0x1de947)[_0x6e70('0x26')](handleEntityNotFound(_0x201da9,null))[_0x6e70('0x26')](respondWithResult(_0x201da9,null))[_0x6e70('0x47')](handleError(_0x201da9,null));};exports[_0x6e70('0x4a')]=function(_0x3fcb2d,_0x3d9c5){return db['SAProductQuotation'][_0x6e70('0x4a')](_0x3fcb2d[_0x6e70('0x4b')],{})[_0x6e70('0x26')](respondWithResult(_0x3d9c5,0xc9))[_0x6e70('0x47')](handleError(_0x3d9c5,null));};exports[_0x6e70('0x25')]=function(_0x172e8a,_0x1e2095){if(_0x172e8a['body']['id']){delete _0x172e8a[_0x6e70('0x4b')]['id'];}return db['SAProductQuotation'][_0x6e70('0x49')]({'where':{'id':_0x172e8a[_0x6e70('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1e2095,null))['then'](saveUpdates(_0x172e8a[_0x6e70('0x4b')],null))[_0x6e70('0x26')](respondWithResult(_0x1e2095,null))[_0x6e70('0x47')](handleError(_0x1e2095,null));};exports['destroy']=function(_0x4af9b1,_0x238ebb){return db[_0x6e70('0x2c')][_0x6e70('0x49')]({'where':{'id':_0x4af9b1[_0x6e70('0x4c')]['id']}})[_0x6e70('0x26')](handleEntityNotFound(_0x238ebb,null))[_0x6e70('0x26')](removeEntity(_0x238ebb,null))['catch'](handleError(_0x238ebb,null));};exports[_0x6e70('0x4d')]=function(_0x3aa1a6,_0x219f4){return db[_0x6e70('0x2c')][_0x6e70('0x4d')]()['then'](respondWithResult(_0x219f4,null))['catch'](handleError(_0x219f4,null));};function assignProductQuotationToProformaInvoice(_0x2c5538,_0x2e3ea6){if(_0x2c5538[_0x6e70('0x4b')]['id']){delete _0x2c5538[_0x6e70('0x4b')]['id'];}return db[_0x6e70('0x2c')]['update']({'ProformaId':_0x2c5538[_0x6e70('0x4b')][_0x6e70('0x4e')],'InvoiceId':_0x2c5538[_0x6e70('0x4b')][_0x6e70('0x4f')]},{'where':{'QuotationId':_0x2c5538[_0x6e70('0x4c')]['id'],'ProformaId':_0x2c5538['query'][_0x6e70('0x4e')]||{'$eq':null},'InvoiceId':_0x2c5538[_0x6e70('0x2f')][_0x6e70('0x4f')]||{'$eq':null}},'transaction':_0x2e3ea6});}exports[_0x6e70('0x50')]=function(_0x8ef4f7,_0x3fd03d,_0x5d2e29){return db[_0x6e70('0x51')][_0x6e70('0x52')](function(_0x5c2396){return assignProductQuotationToProformaInvoice(_0x8ef4f7,_0x5c2396)[_0x6e70('0x26')](function(_0xebe5f7){return _0x3fd03d['sendStatus'](0xc8);})[_0x6e70('0x47')](handleError(_0x3fd03d,null));});};function addInvoiceDetail(_0xb3f06c,_0x2134c4,_0x46d536){var _0xfcadfe={'companyName':_0xb3f06c['companyName'],'companyId':_0xb3f06c[_0x6e70('0x53')],'productName':_0xb3f06c[_0x6e70('0x54')],'productCode':_0xb3f06c[_0x6e70('0x55')],'productDescription':_0xb3f06c[_0x6e70('0x56')],'typeName':_0xb3f06c[_0x6e70('0x57')],'pricelistName':_0xb3f06c[_0x6e70('0x58')],'priceListId':_0xb3f06c[_0x6e70('0x59')],'netPrice':_0xb3f06c[_0x6e70('0x5a')],'discount':_0xb3f06c[_0x6e70('0x5b')],'tax':_0xb3f06c[_0x6e70('0x5c')],'agentFullname':_0xb3f06c[_0x6e70('0x5d')],'note':_0xb3f06c[_0x6e70('0x5e')],'subscriptionId':_0xb3f06c[_0x6e70('0x5f')],'subscriptionName':_0xb3f06c[_0x6e70('0x60')],'subscriptionMonthly':_0xb3f06c[_0x6e70('0x61')],'quantity':_0xb3f06c[_0x6e70('0x62')],'InvoiceId':_0x2134c4,'unitName':_0xb3f06c[_0x6e70('0x63')]};return db[_0x6e70('0x64')][_0x6e70('0x4a')](_0xfcadfe,{'transaction':_0x46d536})[_0x6e70('0x26')](function(){return db['SAProductQuotation'][_0x6e70('0x25')]({'InvoiceId':_0x2134c4},{'where':{'id':_0xb3f06c['id']},'transaction':_0x46d536});});}exports[_0x6e70('0x65')]=function(_0x180a13,_0xeeab6e,_0x36757e){if(_0x180a13[_0x6e70('0x4b')]['id']){delete _0x180a13['body']['id'];}return db[_0x6e70('0x51')][_0x6e70('0x52')](function(_0x4f813a){return db[_0x6e70('0x66')][_0x6e70('0x4a')](_0x180a13[_0x6e70('0x4b')],{'transaction':_0x4f813a})['then'](function(_0x51f268){console[_0x6e70('0x67')](_0x6e70('0x68'),_0x51f268);var _0x2d0203=_0x180a13[_0x6e70('0x4c')]['id'];return db[_0x6e70('0x2c')][_0x6e70('0x46')]({'where':{'QuotationId':_0x2d0203,'productAsset':{'$ne':0x1},'ProformaId':{'$eq':null},'InvoiceId':{'$eq':null}},'raw':!![],'logging':console[_0x6e70('0x67')]})['then'](function(_0x4d47e1){if(_0x4d47e1[_0x6e70('0x35')]>0x0){var _0x1e23c5=[];for(var _0x2bf9ec=0x0;_0x2bf9ec<_0x4d47e1[_0x6e70('0x35')];_0x2bf9ec++){_0x1e23c5['push'](addInvoiceDetail(_0x4d47e1[_0x2bf9ec],_0x51f268['id'],_0x4f813a));}return BPromise['all'](_0x1e23c5);}else{var _0x2e972b={'errors':[{'type':_0x6e70('0x69'),'message':'No\x20product\x20to\x20assign\x20invoice.\x20Invoice\x20not\x20created!!'}]};throw _0x2e972b;}});});})['then'](function(){return _0xeeab6e[_0x6e70('0x1b')](0xc8);})['catch'](function(_0x2a8fb7){console[_0x6e70('0x67')](_0x6e70('0x6a'),_0x2a8fb7);if(_0x2a8fb7[_0x6e70('0x29')]===_0x6e70('0x6b')){var _0x2a8fb7={'errors':[{'message':_0x6e70('0x6c')}]};}_0xeeab6e[_0x6e70('0x1c')](0x1f4)['send'](_0x2a8fb7);});};function addProformaDetail(_0x2ed223,_0x6a560f,_0x22c836){var _0x346c79={'companyName':_0x2ed223[_0x6e70('0x6d')],'companyId':_0x2ed223['companyId'],'productName':_0x2ed223['productName'],'productCode':_0x2ed223['productCode'],'productDescription':_0x2ed223[_0x6e70('0x56')],'typeName':_0x2ed223[_0x6e70('0x57')],'pricelistName':_0x2ed223[_0x6e70('0x58')],'priceListId':_0x2ed223['ProductPriceListId'],'netPrice':_0x2ed223['netPrice'],'discount':_0x2ed223[_0x6e70('0x5b')],'tax':_0x2ed223[_0x6e70('0x5c')],'agentFullname':_0x2ed223[_0x6e70('0x5d')],'note':_0x2ed223[_0x6e70('0x5e')],'subscriptionId':_0x2ed223[_0x6e70('0x5f')],'subscriptionName':_0x2ed223[_0x6e70('0x60')],'subscriptionMonthly':_0x2ed223['subscriptionMonthly'],'quantity':_0x2ed223[_0x6e70('0x62')],'ProformaId':_0x6a560f};return db[_0x6e70('0x6e')][_0x6e70('0x4a')](_0x346c79,{'transaction':_0x22c836})[_0x6e70('0x26')](function(){return db['SAProductQuotation'][_0x6e70('0x25')]({'ProformaId':_0x6a560f},{'where':{'id':_0x2ed223['id']},'transaction':_0x22c836});});}exports['automaticProforma']=function(_0x5b4046,_0x30487b,_0x3249a5){if(_0x5b4046[_0x6e70('0x4b')]['id']){delete _0x5b4046[_0x6e70('0x4b')]['id'];}return db[_0x6e70('0x51')][_0x6e70('0x52')](function(_0x4b5b19){return db[_0x6e70('0x6f')][_0x6e70('0x4a')](_0x5b4046[_0x6e70('0x4b')],{'transaction':_0x4b5b19})[_0x6e70('0x26')](function(_0x20f977){console[_0x6e70('0x67')](_0x6e70('0x68'),_0x20f977);var _0xd9b4a9=_0x5b4046[_0x6e70('0x4c')]['id'];return db[_0x6e70('0x2c')]['findAll']({'where':{'QuotationId':_0xd9b4a9,'productAsset':{'$ne':0x1},'ProformaId':{'$eq':null},'InvoiceId':{'$eq':null}},'raw':!![],'logging':console[_0x6e70('0x67')]})[_0x6e70('0x26')](function(_0x577c3b){if(_0x577c3b['length']>0x0){var _0x515837=[];for(var _0xa8925c=0x0;_0xa8925c<_0x577c3b[_0x6e70('0x35')];_0xa8925c++){_0x515837[_0x6e70('0x70')](addProformaDetail(_0x577c3b[_0xa8925c],_0x20f977['id'],_0x4b5b19));}return BPromise[_0x6e70('0x71')](_0x515837);}else{var _0x5a3dcb={'errors':[{'type':'WARNING','message':'No\x20product\x20to\x20assign\x20proforma.\x20Proforma\x20not\x20created!!'}]};throw _0x5a3dcb;}});});})[_0x6e70('0x26')](function(){return _0x30487b[_0x6e70('0x1b')](0xc8);})['catch'](function(_0x58666a){console[_0x6e70('0x67')](_0x6e70('0x72'),_0x58666a);if(_0x58666a[_0x6e70('0x29')]===_0x6e70('0x6b')){var _0x58666a={'errors':[{'message':_0x6e70('0x6c')}]};}_0x30487b[_0x6e70('0x1c')](0x1f4)[_0x6e70('0x2a')](_0x58666a);});}; \ No newline at end of file diff --git a/server/api/saProductQuotation/saProductQuotation.model.js b/server/api/saProductQuotation/saProductQuotation.model.js index 966a2f8..3a723f3 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 _0x51b4=['sa_product_has_quotation','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./saProductQuotation.attributes','exports','define'];(function(_0x56f3d4,_0xfc65dd){var _0x2c7ef0=function(_0x587024){while(--_0x587024){_0x56f3d4['push'](_0x56f3d4['shift']());}};_0x2c7ef0(++_0xfc65dd);}(_0x51b4,0xe5));var _0x451b=function(_0x1cd6c7,_0x280f4c){_0x1cd6c7=_0x1cd6c7-0x0;var _0x1d23f3=_0x51b4[_0x1cd6c7];return _0x1d23f3;};'use strict';var _=require(_0x451b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x451b('0x1'));var moment=require(_0x451b('0x2'));var BPromise=require(_0x451b('0x3'));var rp=require(_0x451b('0x4'));var fs=require('fs');var path=require(_0x451b('0x5'));var rimraf=require(_0x451b('0x6'));var config=require(_0x451b('0x7'));var attributes=require(_0x451b('0x8'));module[_0x451b('0x9')]=function(_0x4989c4,_0x1fc590){return _0x4989c4[_0x451b('0xa')]('SAProductQuotation',attributes,{'tableName':_0x451b('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xddd8=['define','SAProductQuotation','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./saProductQuotation.attributes','exports'];(function(_0x547456,_0x1de17e){var _0xc1fd7b=function(_0x12be35){while(--_0x12be35){_0x547456['push'](_0x547456['shift']());}};_0xc1fd7b(++_0x1de17e);}(_0xddd8,0x7a));var _0x8ddd=function(_0x36c26f,_0x455cfc){_0x36c26f=_0x36c26f-0x0;var _0x301bb2=_0xddd8[_0x36c26f];return _0x301bb2;};'use strict';var _=require('lodash');var util=require(_0x8ddd('0x0'));var logger=require(_0x8ddd('0x1'))(_0x8ddd('0x2'));var moment=require(_0x8ddd('0x3'));var BPromise=require(_0x8ddd('0x4'));var rp=require(_0x8ddd('0x5'));var fs=require('fs');var path=require(_0x8ddd('0x6'));var rimraf=require(_0x8ddd('0x7'));var config=require('../../config/environment');var attributes=require(_0x8ddd('0x8'));module[_0x8ddd('0x9')]=function(_0x25de4f,_0x2f621f){return _0x25de4f[_0x8ddd('0xa')](_0x8ddd('0xb'),attributes,{'tableName':'sa_product_has_quotation','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 7edb874..7e7b94a 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 _0xe0fa=['http','request','then','info','SAProductQuotation,\x20%s,\x20%s','debug','SAProductQuotation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x529c58,_0x5040d0){var _0x5ad8d8=function(_0x571785){while(--_0x571785){_0x529c58['push'](_0x529c58['shift']());}};_0x5ad8d8(++_0x5040d0);}(_0xe0fa,0x98));var _0xae0f=function(_0x44afa4,_0x5be27b){_0x44afa4=_0x44afa4-0x0;var _0xcad289=_0xe0fa[_0x44afa4];return _0xcad289;};'use strict';var _=require(_0xae0f('0x0'));var util=require('util');var moment=require(_0xae0f('0x1'));var BPromise=require(_0xae0f('0x2'));var rs=require(_0xae0f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xae0f('0x4'));var logger=require(_0xae0f('0x5'))(_0xae0f('0x6'));var config=require('../../config/environment');var jayson=require(_0xae0f('0x7'));var client=jayson[_0xae0f('0x8')][_0xae0f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23cc7a,_0xf9d671,_0x786ce2){return new BPromise(function(_0x301c37,_0x4c0540){return client[_0xae0f('0xa')](_0x23cc7a,_0x786ce2)[_0xae0f('0xb')](function(_0x5b5ba1){logger[_0xae0f('0xc')](_0xae0f('0xd'),_0xf9d671,'request\x20sent');logger[_0xae0f('0xe')](_0xae0f('0xf'),_0xf9d671,_0xae0f('0x10'),JSON[_0xae0f('0x11')](_0x5b5ba1));if(_0x5b5ba1[_0xae0f('0x12')]){if(_0x5b5ba1[_0xae0f('0x12')][_0xae0f('0x13')]===0x1f4){logger[_0xae0f('0x12')](_0xae0f('0xd'),_0xf9d671,_0x5b5ba1[_0xae0f('0x12')][_0xae0f('0x14')]);return _0x4c0540(_0x5b5ba1['error'][_0xae0f('0x14')]);}logger[_0xae0f('0x12')](_0xae0f('0xd'),_0xf9d671,_0x5b5ba1[_0xae0f('0x12')][_0xae0f('0x14')]);return _0x301c37(_0x5b5ba1[_0xae0f('0x12')][_0xae0f('0x14')]);}else{logger[_0xae0f('0xc')](_0xae0f('0xd'),_0xf9d671,_0xae0f('0x10'));_0x301c37(_0x5b5ba1[_0xae0f('0x15')][_0xae0f('0x14')]);}})[_0xae0f('0x16')](function(_0x194a4d){logger[_0xae0f('0x12')](_0xae0f('0xd'),_0xf9d671,_0x194a4d);_0x4c0540(_0x194a4d);});});} \ No newline at end of file +var _0x3095=['SAProductQuotation,\x20%s,\x20%s,\x20%s','stringify','error','code','SAProductQuotation,\x20%s,\x20%s','message','request\x20sent','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','debug'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x3095,0x16d));var _0x5309=function(_0x5ccfe2,_0x5c0cae){_0x5ccfe2=_0x5ccfe2-0x0;var _0x5e1678=_0x3095[_0x5ccfe2];return _0x5e1678;};'use strict';var _=require(_0x5309('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5309('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5309('0x2'));var db=require(_0x5309('0x3'))['db'];var utils=require(_0x5309('0x4'));var logger=require(_0x5309('0x5'))('rpc');var config=require(_0x5309('0x6'));var jayson=require(_0x5309('0x7'));var client=jayson['client'][_0x5309('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x65fd1a,_0x5c988b,_0x313c89){return new BPromise(function(_0x16a81f,_0x265bf9){return client[_0x5309('0x9')](_0x65fd1a,_0x313c89)[_0x5309('0xa')](function(_0x3baa22){logger[_0x5309('0xb')]('SAProductQuotation,\x20%s,\x20%s',_0x5c988b,'request\x20sent');logger[_0x5309('0xc')](_0x5309('0xd'),_0x5c988b,'request\x20sent',JSON[_0x5309('0xe')](_0x3baa22));if(_0x3baa22[_0x5309('0xf')]){if(_0x3baa22['error'][_0x5309('0x10')]===0x1f4){logger[_0x5309('0xf')](_0x5309('0x11'),_0x5c988b,_0x3baa22[_0x5309('0xf')][_0x5309('0x12')]);return _0x265bf9(_0x3baa22[_0x5309('0xf')][_0x5309('0x12')]);}logger[_0x5309('0xf')](_0x5309('0x11'),_0x5c988b,_0x3baa22[_0x5309('0xf')][_0x5309('0x12')]);return _0x16a81f(_0x3baa22[_0x5309('0xf')][_0x5309('0x12')]);}else{logger['info'](_0x5309('0x11'),_0x5c988b,_0x5309('0x13'));_0x16a81f(_0x3baa22['result'][_0x5309('0x12')]);}})[_0x5309('0x14')](function(_0x12610d){logger[_0x5309('0xf')](_0x5309('0x11'),_0x5c988b,_0x12610d);_0x265bf9(_0x12610d);});});} \ No newline at end of file diff --git a/server/api/saProforma/index.js b/server/api/saProforma/index.js index 9bd5190..20f3355 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 _0x2675=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./saProforma.controller','get','isAuthenticated','index','describe','/:id','show','/:id/download','getProformaPDF','post','create','/:id/cloneProforma','cloneProforma','update','exports','multer','util','path','connect-timeout','express'];(function(_0x11aedf,_0xa7a79a){var _0x36f0b8=function(_0x58c376){while(--_0x58c376){_0x11aedf['push'](_0x11aedf['shift']());}};_0x36f0b8(++_0xa7a79a);}(_0x2675,0x1ab));var _0x5267=function(_0x530bb1,_0x4e778f){_0x530bb1=_0x530bb1-0x0;var _0x3199fb=_0x2675[_0x530bb1];return _0x3199fb;};'use strict';var multer=require(_0x5267('0x0'));var util=require(_0x5267('0x1'));var path=require(_0x5267('0x2'));var timeout=require(_0x5267('0x3'));var express=require(_0x5267('0x4'));var router=express[_0x5267('0x5')]();var auth=require(_0x5267('0x6'));var interaction=require(_0x5267('0x7'));var config=require(_0x5267('0x8'));var controller=require(_0x5267('0x9'));router[_0x5267('0xa')]('/',auth[_0x5267('0xb')](),controller[_0x5267('0xc')]);router[_0x5267('0xa')]('/describe',auth[_0x5267('0xb')](),controller[_0x5267('0xd')]);router[_0x5267('0xa')](_0x5267('0xe'),auth[_0x5267('0xb')](),controller[_0x5267('0xf')]);router['get'](_0x5267('0x10'),auth[_0x5267('0xb')](),controller[_0x5267('0x11')]);router[_0x5267('0x12')]('/',auth[_0x5267('0xb')](),controller[_0x5267('0x13')]);router['post'](_0x5267('0x14'),auth[_0x5267('0xb')](),controller[_0x5267('0x15')]);router['put'](_0x5267('0xe'),auth[_0x5267('0xb')](),controller[_0x5267('0x16')]);router['delete'](_0x5267('0xe'),auth[_0x5267('0xb')](),controller['destroy']);module[_0x5267('0x17')]=router; \ No newline at end of file +var _0xfd6c=['get','isAuthenticated','index','/describe','/:id','show','/:id/download','post','cloneProforma','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./saProforma.controller'];(function(_0x3f2d02,_0x2c7deb){var _0x54092b=function(_0x427ff8){while(--_0x427ff8){_0x3f2d02['push'](_0x3f2d02['shift']());}};_0x54092b(++_0x2c7deb);}(_0xfd6c,0x19c));var _0xcfd6=function(_0x119629,_0x246787){_0x119629=_0x119629-0x0;var _0x49a771=_0xfd6c[_0x119629];return _0x49a771;};'use strict';var multer=require(_0xcfd6('0x0'));var util=require(_0xcfd6('0x1'));var path=require(_0xcfd6('0x2'));var timeout=require(_0xcfd6('0x3'));var express=require(_0xcfd6('0x4'));var router=express[_0xcfd6('0x5')]();var auth=require(_0xcfd6('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xcfd6('0x7'));router[_0xcfd6('0x8')]('/',auth[_0xcfd6('0x9')](),controller[_0xcfd6('0xa')]);router[_0xcfd6('0x8')](_0xcfd6('0xb'),auth[_0xcfd6('0x9')](),controller['describe']);router['get'](_0xcfd6('0xc'),auth[_0xcfd6('0x9')](),controller[_0xcfd6('0xd')]);router[_0xcfd6('0x8')](_0xcfd6('0xe'),auth[_0xcfd6('0x9')](),controller['getProformaPDF']);router[_0xcfd6('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xcfd6('0xf')]('/:id/cloneProforma',auth[_0xcfd6('0x9')](),controller[_0xcfd6('0x10')]);router[_0xcfd6('0x11')]('/:id',auth[_0xcfd6('0x9')](),controller[_0xcfd6('0x12')]);router[_0xcfd6('0x13')]('/:id',auth[_0xcfd6('0x9')](),controller['destroy']);module[_0xcfd6('0x14')]=router; \ No newline at end of file diff --git a/server/api/saProforma/saProforma.attributes.js b/server/api/saProforma/saProforma.attributes.js index 6fc6404..fb6ee7e 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 _0x5987=['STRING','INTEGER','BOOLEAN','DATE','sequelize','TEXT'];(function(_0x396022,_0x25b31e){var _0x3c924f=function(_0x35aae5){while(--_0x35aae5){_0x396022['push'](_0x396022['shift']());}};_0x3c924f(++_0x25b31e);}(_0x5987,0x7c));var _0x7598=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x5987[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0x7598('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x7598('0x1')]},'agentFullname':{'type':Sequelize[_0x7598('0x2')]},'status':{'type':Sequelize[_0x7598('0x1')]},'companyName':{'type':Sequelize[_0x7598('0x2')],'allowNull':![]},'companyId':{'type':Sequelize[_0x7598('0x3')],'allowNull':![]},'authorized':{'type':Sequelize[_0x7598('0x4')]},'clientCode':{'type':Sequelize[_0x7598('0x2')]},'discount':{'type':Sequelize['DECIMAL'](0xd,0x4)},'paid':{'type':Sequelize[_0x7598('0x3')],'defaultValue':0x0},'receivingStreet':{'type':Sequelize[_0x7598('0x2')]},'receivingPostalCode':{'type':Sequelize[_0x7598('0x2')]},'receivingCity':{'type':Sequelize[_0x7598('0x2')]},'receivingCountry':{'type':Sequelize[_0x7598('0x2')]},'receivingISOCode':{'type':Sequelize[_0x7598('0x2')](0x3)},'receivingFiscalCode':{'type':Sequelize[_0x7598('0x2')](0x32)},'receivingPIVA':{'type':Sequelize[_0x7598('0x2')](0x32)},'receivingSDICode':{'type':Sequelize[_0x7598('0x2')](0x15)},'receivingFiscalMessage':{'type':Sequelize['STRING']},'receivingExpiryDay':{'type':Sequelize[_0x7598('0x3')]},'receivingEurope':{'type':Sequelize[_0x7598('0x4')]},'receivingSocCap':{'type':Sequelize[_0x7598('0x2')](0xff)},'issuerName':{'type':Sequelize[_0x7598('0x2')]},'issuerStreet':{'type':Sequelize[_0x7598('0x2')]},'issuerPostalCode':{'type':Sequelize['STRING']},'issuerCity':{'type':Sequelize['STRING']},'issuerCountry':{'type':Sequelize[_0x7598('0x2')]},'issuerISOCode':{'type':Sequelize[_0x7598('0x2')](0x3)},'issuerFiscalCode':{'type':Sequelize[_0x7598('0x2')](0x32)},'issuerPIVA':{'type':Sequelize[_0x7598('0x2')](0x32)},'issuerSDICode':{'type':Sequelize[_0x7598('0x2')](0x15)},'issuerFiscalMessage':{'type':Sequelize[_0x7598('0x2')](0x3e8)},'issuerExpiryDay':{'type':Sequelize[_0x7598('0x3')]},'issuerEurope':{'type':Sequelize[_0x7598('0x4')]},'issuerSocCap':{'type':Sequelize[_0x7598('0x2')](0xff)},'issuerBankAccount':{'type':Sequelize[_0x7598('0x2')](0xff)},'issuerBankName':{'type':Sequelize['STRING'](0xff)},'issuerBankStreet':{'type':Sequelize[_0x7598('0x2')]},'issuerBankPostalCode':{'type':Sequelize[_0x7598('0x2')]},'issuerBankCity':{'type':Sequelize['STRING']},'issuerBankCountry':{'type':Sequelize[_0x7598('0x2')]},'issuerBankBICSWIFT':{'type':Sequelize[_0x7598('0x2')]},'issuerBankIBAN':{'type':Sequelize[_0x7598('0x2')]},'issuerPhone':{'type':Sequelize[_0x7598('0x2')]},'issuerFax':{'type':Sequelize['STRING']},'issuerEmail':{'type':Sequelize[_0x7598('0x2')]},'issuerWeb':{'type':Sequelize['STRING']},'issuerABI':{'type':Sequelize[_0x7598('0x2')]},'issuerCAB':{'type':Sequelize[_0x7598('0x2')]},'issuerPayPal':{'type':Sequelize[_0x7598('0x2')]},'clientCode':{'type':Sequelize['STRING']},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x7598('0x5')]},'number':{'type':Sequelize[_0x7598('0x3')]},'beginningCompetence':{'type':Sequelize[_0x7598('0x5')]},'endCompetence':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x482a=['TEXT','INTEGER','BOOLEAN','DECIMAL','DATE','sequelize','exports','STRING'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x482a,0xd5));var _0xa482=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x482a[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0xa482('0x0'));module[_0xa482('0x1')]={'name':{'type':Sequelize[_0xa482('0x2')]},'note':{'type':Sequelize[_0xa482('0x3')]},'agentFullname':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xa482('0x3')]},'companyName':{'type':Sequelize[_0xa482('0x2')],'allowNull':![]},'companyId':{'type':Sequelize[_0xa482('0x4')],'allowNull':![]},'authorized':{'type':Sequelize[_0xa482('0x5')]},'clientCode':{'type':Sequelize[_0xa482('0x2')]},'discount':{'type':Sequelize[_0xa482('0x6')](0xd,0x4)},'paid':{'type':Sequelize[_0xa482('0x4')],'defaultValue':0x0},'receivingStreet':{'type':Sequelize[_0xa482('0x2')]},'receivingPostalCode':{'type':Sequelize['STRING']},'receivingCity':{'type':Sequelize[_0xa482('0x2')]},'receivingCountry':{'type':Sequelize[_0xa482('0x2')]},'receivingISOCode':{'type':Sequelize[_0xa482('0x2')](0x3)},'receivingFiscalCode':{'type':Sequelize[_0xa482('0x2')](0x32)},'receivingPIVA':{'type':Sequelize['STRING'](0x32)},'receivingSDICode':{'type':Sequelize[_0xa482('0x2')](0x15)},'receivingFiscalMessage':{'type':Sequelize[_0xa482('0x2')]},'receivingExpiryDay':{'type':Sequelize['INTEGER']},'receivingEurope':{'type':Sequelize[_0xa482('0x5')]},'receivingSocCap':{'type':Sequelize[_0xa482('0x2')](0xff)},'issuerName':{'type':Sequelize[_0xa482('0x2')]},'issuerStreet':{'type':Sequelize[_0xa482('0x2')]},'issuerPostalCode':{'type':Sequelize['STRING']},'issuerCity':{'type':Sequelize['STRING']},'issuerCountry':{'type':Sequelize[_0xa482('0x2')]},'issuerISOCode':{'type':Sequelize[_0xa482('0x2')](0x3)},'issuerFiscalCode':{'type':Sequelize['STRING'](0x32)},'issuerPIVA':{'type':Sequelize[_0xa482('0x2')](0x32)},'issuerSDICode':{'type':Sequelize[_0xa482('0x2')](0x15)},'issuerFiscalMessage':{'type':Sequelize[_0xa482('0x2')](0x3e8)},'issuerExpiryDay':{'type':Sequelize[_0xa482('0x4')]},'issuerEurope':{'type':Sequelize[_0xa482('0x5')]},'issuerSocCap':{'type':Sequelize[_0xa482('0x2')](0xff)},'issuerBankAccount':{'type':Sequelize[_0xa482('0x2')](0xff)},'issuerBankName':{'type':Sequelize[_0xa482('0x2')](0xff)},'issuerBankStreet':{'type':Sequelize[_0xa482('0x2')]},'issuerBankPostalCode':{'type':Sequelize['STRING']},'issuerBankCity':{'type':Sequelize['STRING']},'issuerBankCountry':{'type':Sequelize[_0xa482('0x2')]},'issuerBankBICSWIFT':{'type':Sequelize[_0xa482('0x2')]},'issuerBankIBAN':{'type':Sequelize[_0xa482('0x2')]},'issuerPhone':{'type':Sequelize['STRING']},'issuerFax':{'type':Sequelize[_0xa482('0x2')]},'issuerEmail':{'type':Sequelize[_0xa482('0x2')]},'issuerWeb':{'type':Sequelize[_0xa482('0x2')]},'issuerABI':{'type':Sequelize[_0xa482('0x2')]},'issuerCAB':{'type':Sequelize[_0xa482('0x2')]},'issuerPayPal':{'type':Sequelize['STRING']},'clientCode':{'type':Sequelize[_0xa482('0x2')]},'startDate':{'type':Sequelize[_0xa482('0x7')]},'endDate':{'type':Sequelize['DATE']},'number':{'type':Sequelize[_0xa482('0x4')]},'beginningCompetence':{'type':Sequelize[_0xa482('0x7')]},'endCompetence':{'type':Sequelize[_0xa482('0x7')]}}; \ No newline at end of file diff --git a/server/api/saProforma/saProforma.controller.js b/server/api/saProforma/saProforma.controller.js index 5bfe5ea..cd7cdb4 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 _0x5eb8=['','proforma','issuerWeb','mkdirSync','','\x20\x20body{font-family:\x20Roboto,\x20\x27Segoe\x20UI\x27,\x20Tahoma,\x20sans-serif;}.itemTabTitle{background-color:\x20lightgray;\x20height:\x2040px;}.issuerInfo{color:\x20lightgray;\x20padding-top:\x2020px;\x20padding-bottom:\x2020px;\x20font-size:\x2010px;}.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:\x20bolder;\x20padding-bottom:\x2010px;\x20font-size:\x2010px}.reciperFiscalInfo{padding-top:\x205px;\x20padding-bottom:\x205px;,\x20font-size:\x2010px;}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:\x208px;\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:\x208px;}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','P.IVA','Tax\x20code','I.S.\x20code','Codice\x20S.D.I.','Soc.Cap.\x20fp','Cap.Soc.\x20iv','Invoice','Fattura','Proforma','Nota\x20di\x20credito','Scadenza','Item','Articolo','Description','Descrizione','Ore/Qta','Unit\x20Price','Prezzo\x20Unitario','Sub\x20Total','Sub\x20Totale','Discount','Imponibile','Tasse','Total','Totale','Please\x20send\x20PAYMENT\x20to','Si\x20prega\x20di\x20inviare\x20il\x20pagamento\x20a','Account\x20Holder','Bank\x20name','Nome\x20banca','Bank\x20Address','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','','\x20','','%s
','issuerStreet','issuerPostalCode','\x20%s','issuerCity','-\x20%s\x20
','issuerCountry','phone','issuerPhone',':\x20%s
','issuerFax','issuerEmail','issuerPIVA','issuerFiscalCode','issuerSDICode','issuerSocCap','','','','companyName','receivingCity','','piva','receivingPIVA','sdi','','','\x20N.%d','updatedAt','%s\x20','add','saExpiryDay','days','DD/MM/YYYY','','duedate',':\x20%s','','','item','','description','hrsqty','unitprice','subtotal','netPrice','discount','tax','quantity','','productName','%d','','toFixed','\x20€','
%s
','receivingFiscalMessage','indexOf','','','','nettopay','','\x20',' ','','\x20%s\x20','replace','fromCharCode','','','','isNil','issuerBankAccount','accountholder',':\x20','','bankname','\x20','bankaddress','issuerBankStreet','issuerBankPostalCode','issuerBankCity','abi','issuerABI','issuerCAB','bic','swif','issuerBankBICSWIFT','iban','issuerPayPal','paypal','thank1','','','thank2','paid','','','toFile','TCL:\x20exports.getProformaPDF\x20->\x20saveTo,\x20fileName','download','log','err','addCloneDetail->>','ProformaId','cloneProforma','cloneProforma\x20req.params.id:','sequelize','result','cloneProforma\x20productsProforma:','WARNING','No\x20product\x20to\x20assign\x20new\x20proforma.\x20Proforma\x20not\x20created!!\x20','TCL:\x20exports.cloneProforma\x20->\x20err','SequelizeUniqueConstraintError','Duplicate\x20entry.','rimraf','zip-dir','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/environment','../../mysqldb','sendStatus','status','json','count','offset','Content-Range','apply','save','destroy','then','error','name','send','index','SAProforma','keys','filters','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','includeAll','include','findAll','rows','catch','params','rawAttributes','length','options','find','create','body','describe','getProformaPDF','unix','join','server','files','root','images','logo-invoice.png','paid-invoice.png','format','Proforma_%s-%s.pdf','SAProformaDetail','details','portrait','10mm','{{page}}/{{pages}}','footer','contents','default'];(function(_0x41ea59,_0x1a0074){var _0x9ad77f=function(_0x13042a){while(--_0x13042a){_0x41ea59['push'](_0x41ea59['shift']());}};_0x9ad77f(++_0x1a0074);}(_0x5eb8,0xb0));var _0x85eb=function(_0xe65ac8,_0x2691be){_0xe65ac8=_0xe65ac8-0x0;var _0x202ba1=_0x5eb8[_0xe65ac8];return _0x202ba1;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x85eb('0x0'));var zipdir=require(_0x85eb('0x1'));var jsonpatch=require(_0x85eb('0x2'));var rp=require(_0x85eb('0x3'));var moment=require(_0x85eb('0x4'));var BPromise=require(_0x85eb('0x5'));var Mustache=require(_0x85eb('0x6'));var util=require(_0x85eb('0x7'));var path=require(_0x85eb('0x8'));var sox=require(_0x85eb('0x9'));var csv=require(_0x85eb('0xa'));var ejs=require(_0x85eb('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x85eb('0xc'));var crypto=require(_0x85eb('0xd'));var jsforce=require(_0x85eb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x85eb('0xa'));var querystring=require('querystring');var Papa=require(_0x85eb('0xf'));var Redis=require(_0x85eb('0x10'));var authService=require(_0x85eb('0x11'));var qs=require(_0x85eb('0x12'));var hardwareService=require(_0x85eb('0x13'));var logger=require(_0x85eb('0x14'))(_0x85eb('0x15'));var utils=require('../../config/utils');var config=require(_0x85eb('0x16'));var db=require(_0x85eb('0x17'))['db'];function respondWithStatusCode(_0x5c52a4,_0x2af376){_0x2af376=_0x2af376||0xcc;return function(_0x784583){if(_0x784583){return _0x5c52a4[_0x85eb('0x18')](_0x2af376);}return _0x5c52a4[_0x85eb('0x19')](_0x2af376)['end']();};}function respondWithResult(_0x548628,_0x394c74){_0x394c74=_0x394c74||0xc8;return function(_0x5c760a){if(_0x5c760a){return _0x548628[_0x85eb('0x19')](_0x394c74)[_0x85eb('0x1a')](_0x5c760a);}};}function respondWithFilteredResult(_0x600a7f,_0x1604ba){return function(_0x183b0c){if(_0x183b0c){var _0x49efdf=_0x183b0c[_0x85eb('0x1b')],_0x2e5c0a=_0x1604ba[_0x85eb('0x1c')],_0x59237b=_0x1604ba[_0x85eb('0x1c')]+_0x1604ba['limit'],_0x17140b;if(_0x59237b>=_0x49efdf){_0x59237b=_0x49efdf;_0x17140b=0xc8;}else{_0x17140b=0xce;}_0x600a7f['status'](_0x17140b);return _0x600a7f['set'](_0x85eb('0x1d'),_0x2e5c0a+'-'+_0x59237b+'/'+_0x49efdf)[_0x85eb('0x1a')](_0x183b0c);}return null;};}function patchUpdates(_0x10cf2f){return function(_0x2e986c){try{jsonpatch[_0x85eb('0x1e')](_0x2e986c,_0x10cf2f,!![]);}catch(_0x34f875){return BPromise['reject'](_0x34f875);}return _0x2e986c[_0x85eb('0x1f')]();};}function saveUpdates(_0x7244fc,_0xd9f06d){return function(_0x4e8041){if(_0x4e8041){return _0x4e8041['update'](_0x7244fc)['then'](function(_0x55b9e4){return _0x55b9e4;});}return null;};}function removeEntity(_0x244667,_0x3fa785){return function(_0x329fc5){if(_0x329fc5){return _0x329fc5[_0x85eb('0x20')]()[_0x85eb('0x21')](function(){_0x244667[_0x85eb('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5491d5,_0x5b48d9){return function(_0x298e84){if(!_0x298e84){_0x5491d5[_0x85eb('0x18')](0x194);}return _0x298e84;};}function handleError(_0x3f7a4d,_0x28b87d){_0x28b87d=_0x28b87d||0x1f4;return function(_0x312b3e){logger[_0x85eb('0x22')](_0x312b3e['stack']);if(_0x312b3e[_0x85eb('0x23')]){delete _0x312b3e[_0x85eb('0x23')];}_0x3f7a4d[_0x85eb('0x19')](_0x28b87d)[_0x85eb('0x24')](_0x312b3e);};}exports[_0x85eb('0x25')]=function(_0x57a03c,_0x2e5aa3){var _0x792d3a={},_0x291557={},_0x3e7eb9={'count':0x0,'rows':[]};var _0x40f13e=db[_0x85eb('0x26')]['rawAttributes'];_0x291557['model']=_[_0x85eb('0x27')](_0x40f13e);_0x291557['query']=_[_0x85eb('0x27')](_0x57a03c['query']);_0x291557[_0x85eb('0x28')]=_[_0x85eb('0x29')](_0x291557[_0x85eb('0x2a')],_0x291557[_0x85eb('0x2b')]);_0x792d3a[_0x85eb('0x2c')]=_[_0x85eb('0x29')](_0x291557[_0x85eb('0x2a')],qs['fields'](_0x57a03c[_0x85eb('0x2b')][_0x85eb('0x2d')]));_0x792d3a['attributes']=_0x792d3a[_0x85eb('0x2c')]['length']?_0x792d3a['attributes']:_0x291557[_0x85eb('0x2a')];if(!_0x57a03c[_0x85eb('0x2b')][_0x85eb('0x2e')](_0x85eb('0x2f'))){_0x792d3a[_0x85eb('0x30')]=qs[_0x85eb('0x30')](_0x57a03c[_0x85eb('0x2b')][_0x85eb('0x30')]);_0x792d3a[_0x85eb('0x1c')]=qs[_0x85eb('0x1c')](_0x57a03c['query'][_0x85eb('0x1c')]);}_0x792d3a[_0x85eb('0x31')]=qs['sort'](_0x57a03c['query'][_0x85eb('0x32')]);_0x792d3a[_0x85eb('0x33')]=qs[_0x85eb('0x28')](_[_0x85eb('0x34')](_0x57a03c[_0x85eb('0x2b')],_0x291557[_0x85eb('0x28')]));if(_0x57a03c[_0x85eb('0x2b')][_0x85eb('0x35')]){_0x792d3a[_0x85eb('0x33')]=_[_0x85eb('0x36')](_0x792d3a[_0x85eb('0x33')],{'$or':_[_0x85eb('0x37')](_0x40f13e,function(_0x317d86){if(_0x317d86[_0x85eb('0x38')]['key']!==_0x85eb('0x39')){var _0x3dfe74={};_0x3dfe74[_0x317d86['field']]={'$like':'%'+_0x57a03c['query'][_0x85eb('0x35')]+'%'};return _0x3dfe74;}})});}_0x792d3a=_[_0x85eb('0x36')]({},_0x792d3a,_0x57a03c['options']);var _0x4317bc={'where':_0x792d3a['where']};return db[_0x85eb('0x26')]['count'](_0x4317bc)[_0x85eb('0x21')](function(_0x5ce7e4){_0x3e7eb9[_0x85eb('0x1b')]=_0x5ce7e4;if(_0x57a03c['query'][_0x85eb('0x3a')]){_0x792d3a[_0x85eb('0x3b')]=[{'all':!![]}];}return db['SAProforma'][_0x85eb('0x3c')](_0x792d3a);})['then'](function(_0x2a6baa){_0x3e7eb9[_0x85eb('0x3d')]=_0x2a6baa;return _0x3e7eb9;})['then'](respondWithFilteredResult(_0x2e5aa3,_0x792d3a))[_0x85eb('0x3e')](handleError(_0x2e5aa3,null));};exports['show']=function(_0x5495cf,_0x1b8a71){var _0x4edb2d={'raw':![],'where':{'id':_0x5495cf[_0x85eb('0x3f')]['id']}},_0x17cc20={};_0x17cc20['model']=_['keys'](db[_0x85eb('0x26')][_0x85eb('0x40')]);_0x17cc20['query']=_['keys'](_0x5495cf[_0x85eb('0x2b')]);_0x17cc20[_0x85eb('0x28')]=_[_0x85eb('0x29')](_0x17cc20[_0x85eb('0x2a')],_0x17cc20[_0x85eb('0x2b')]);_0x4edb2d['attributes']=_[_0x85eb('0x29')](_0x17cc20[_0x85eb('0x2a')],qs[_0x85eb('0x2d')](_0x5495cf[_0x85eb('0x2b')][_0x85eb('0x2d')]));_0x4edb2d[_0x85eb('0x2c')]=_0x4edb2d[_0x85eb('0x2c')][_0x85eb('0x41')]?_0x4edb2d[_0x85eb('0x2c')]:_0x17cc20['model'];if(_0x5495cf[_0x85eb('0x2b')][_0x85eb('0x3a')]){_0x4edb2d['include']=[{'all':!![]}];}_0x4edb2d=_[_0x85eb('0x36')]({},_0x4edb2d,_0x5495cf[_0x85eb('0x42')]);return db[_0x85eb('0x26')][_0x85eb('0x43')](_0x4edb2d)[_0x85eb('0x21')](handleEntityNotFound(_0x1b8a71,null))[_0x85eb('0x21')](respondWithResult(_0x1b8a71,null))['catch'](handleError(_0x1b8a71,null));};exports[_0x85eb('0x44')]=function(_0x1258bc,_0x1ead1d){return db[_0x85eb('0x26')][_0x85eb('0x44')](_0x1258bc[_0x85eb('0x45')],{})[_0x85eb('0x21')](respondWithResult(_0x1ead1d,0xc9))[_0x85eb('0x3e')](handleError(_0x1ead1d,null));};exports['update']=function(_0x1298d4,_0x26b226){if(_0x1298d4[_0x85eb('0x45')]['id']){delete _0x1298d4[_0x85eb('0x45')]['id'];}return db[_0x85eb('0x26')][_0x85eb('0x43')]({'where':{'id':_0x1298d4[_0x85eb('0x3f')]['id']}})[_0x85eb('0x21')](handleEntityNotFound(_0x26b226,null))[_0x85eb('0x21')](saveUpdates(_0x1298d4[_0x85eb('0x45')],null))[_0x85eb('0x21')](respondWithResult(_0x26b226,null))[_0x85eb('0x3e')](handleError(_0x26b226,null));};exports['destroy']=function(_0x11da79,_0x2c951b){return db[_0x85eb('0x26')]['find']({'where':{'id':_0x11da79[_0x85eb('0x3f')]['id']}})[_0x85eb('0x21')](handleEntityNotFound(_0x2c951b,null))[_0x85eb('0x21')](removeEntity(_0x2c951b,null))[_0x85eb('0x3e')](handleError(_0x2c951b,null));};exports[_0x85eb('0x46')]=function(_0x4a7506,_0x2ef4d1){return db[_0x85eb('0x26')][_0x85eb('0x46')]()['then'](respondWithResult(_0x2ef4d1,null))[_0x85eb('0x3e')](handleError(_0x2ef4d1,null));};exports[_0x85eb('0x47')]=function(_0x1efc6f,_0x4c06ef){var _0x56f510=moment()[_0x85eb('0x48')]()['toString']();var _0x5ed98a=path[_0x85eb('0x49')](config['root'],_0x85eb('0x4a'),_0x85eb('0x4b'),'tmp');var _0x4abe5e=path[_0x85eb('0x49')](config[_0x85eb('0x4c')],_0x85eb('0x4a'),_0x85eb('0x4b'),_0x85eb('0x4d'),'logos',_0x85eb('0x4e'));var _0x30062e=path[_0x85eb('0x49')](config[_0x85eb('0x4c')],_0x85eb('0x4a'),'files',_0x85eb('0x4d'),'logos',_0x85eb('0x4f'));var _0x40d846=path['join'](_0x5ed98a,_0x56f510);var _0x341ddb=util[_0x85eb('0x50')](_0x85eb('0x51'),_0x1efc6f[_0x85eb('0x3f')]['id'],_0x56f510);var _0x214ef7=path[_0x85eb('0x49')](_0x40d846,_0x341ddb);var _0x5a45a0=![];var _0x38d68a={};return db['SAProforma'][_0x85eb('0x43')]({'where':{'id':_0x1efc6f[_0x85eb('0x3f')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x4c06ef,null))[_0x85eb('0x21')](function(_0x2a0f8b){if(_0x2a0f8b){_0x38d68a['proforma']=_0x2a0f8b;return db[_0x85eb('0x52')]['findAll']({'where':{'ProformaId':_0x2a0f8b['id']},'raw':!![]})[_0x85eb('0x21')](function(_0x3f6985){_0x38d68a[_0x85eb('0x53')]=_0x3f6985;_0x5a45a0=!![];var _0x13c0b3='';var _0x45a201={'format':'A4','orientation':_0x85eb('0x54'),'border':'1cm','footer':{'height':_0x85eb('0x55'),'contents':{'default':_0x85eb('0x56')}}};_0x45a201[_0x85eb('0x57')][_0x85eb('0x58')][_0x85eb('0x59')]=_0x45a201[_0x85eb('0x57')][_0x85eb('0x58')][_0x85eb('0x59')]+_0x85eb('0x5a')+_0x38d68a[_0x85eb('0x5b')][_0x85eb('0x5c')]+'';fs[_0x85eb('0x5d')](_0x40d846);_0x13c0b3=_0x85eb('0x5e');_0x13c0b3+=_0x85eb('0x5f');_0x13c0b3+=_0x85eb('0x60');var _0x4470b3={'phone':{'en':_0x85eb('0x61'),'it':'Telefono'},'fax':{'en':_0x85eb('0x62'),'it':'Fax'},'email':{'en':_0x85eb('0x63'),'it':_0x85eb('0x63')},'piva':{'en':_0x85eb('0x64'),'it':_0x85eb('0x65')},'cf':{'en':_0x85eb('0x66'),'it':'C.F.'},'sdi':{'en':_0x85eb('0x67'),'it':_0x85eb('0x68')},'cs':{'en':_0x85eb('0x69'),'it':_0x85eb('0x6a')},'invoice':{'en':_0x85eb('0x6b'),'it':_0x85eb('0x6c')},'proforma':{'en':_0x85eb('0x6d'),'it':_0x85eb('0x6d')},'creditnote':{'en':'Credit\x20note','it':_0x85eb('0x6e')},'duedate':{'en':'Due\x20date','it':_0x85eb('0x6f')},'item':{'en':_0x85eb('0x70'),'it':_0x85eb('0x71')},'description':{'en':_0x85eb('0x72'),'it':_0x85eb('0x73')},'hrsqty':{'en':'Hrs/Qty','it':_0x85eb('0x74')},'unitprice':{'en':_0x85eb('0x75'),'it':_0x85eb('0x76')},'subtotal':{'en':_0x85eb('0x77'),'it':_0x85eb('0x78')},'discount':{'en':_0x85eb('0x79'),'it':'Sconto'},'total':{'en':'Subtotal','it':_0x85eb('0x7a')},'tax':{'en':'Tax','it':_0x85eb('0x7b')},'nettopay':{'en':_0x85eb('0x7c'),'it':_0x85eb('0x7d')},'sendpayment':{'en':_0x85eb('0x7e'),'it':_0x85eb('0x7f')},'accountholder':{'en':_0x85eb('0x80'),'it':'Conto\x20intestato\x20a'},'bankname':{'en':_0x85eb('0x81'),'it':_0x85eb('0x82')},'bankaddress':{'en':_0x85eb('0x83'),'it':_0x85eb('0x84')},'abi':{'en':'ABI','it':_0x85eb('0x85')},'cab':{'en':_0x85eb('0x86'),'it':_0x85eb('0x86')},'bic':{'en':_0x85eb('0x87'),'it':'BIC'},'swif':{'en':_0x85eb('0x88'),'it':_0x85eb('0x88')},'iban':{'en':_0x85eb('0x89'),'it':_0x85eb('0x89')},'paypal':{'en':_0x85eb('0x8a'),'it':_0x85eb('0x8b')},'thank1':{'en':_0x85eb('0x8c'),'it':_0x85eb('0x8d')},'thank2':{'en':_0x85eb('0x8e'),'it':_0x85eb('0x8f')}};var _0x170a60='it';if(_0x38d68a[_0x85eb('0x5b')][_0x85eb('0x90')]!==_0x85eb('0x91')){_0x170a60='en';}_0x13c0b3+=_0x85eb('0x92');_0x13c0b3+=_0x85eb('0x93')+_0x4abe5e+_0x85eb('0x94');_0x13c0b3+=_0x85eb('0x95');_0x13c0b3+=util[_0x85eb('0x50')]('\x20%s
',_0x38d68a[_0x85eb('0x5b')]['issuerName']);_0x13c0b3+=util[_0x85eb('0x50')](_0x85eb('0x96'),_0x38d68a[_0x85eb('0x5b')][_0x85eb('0x97')]);_0x13c0b3+=util[_0x85eb('0x50')]('%s',_0x38d68a[_0x85eb('0x5b')][_0x85eb('0x98')]);_0x13c0b3+=util[_0x85eb('0x50')](_0x85eb('0x99'),_0x38d68a['proforma'][_0x85eb('0x9a')]);_0x13c0b3+=util[_0x85eb('0x50')](_0x85eb('0x9b'),_0x38d68a[_0x85eb('0x5b')][_0x85eb('0x9c')]);_0x13c0b3+=util['format'](_0x4470b3[_0x85eb('0x9d')][_0x170a60]+':\x20%s
',_0x38d68a[_0x85eb('0x5b')][_0x85eb('0x9e')]);_0x13c0b3+=util[_0x85eb('0x50')](_0x4470b3['fax'][_0x170a60]+_0x85eb('0x9f'),_0x38d68a[_0x85eb('0x5b')][_0x85eb('0xa0')]);_0x13c0b3+=util['format'](_0x4470b3['email'][_0x170a60]+_0x85eb('0x9f'),_0x38d68a[_0x85eb('0x5b')][_0x85eb('0xa1')]);_0x13c0b3+=util[_0x85eb('0x50')](_0x4470b3['piva'][_0x170a60]+_0x85eb('0x9f'),_0x38d68a['proforma'][_0x85eb('0xa2')]);_0x13c0b3+=util[_0x85eb('0x50')](_0x4470b3['cf'][_0x170a60]+_0x85eb('0x9f'),_0x38d68a[_0x85eb('0x5b')][_0x85eb('0xa3')]);_0x13c0b3+=util[_0x85eb('0x50')](_0x4470b3['sdi'][_0x170a60]+_0x85eb('0x9f'),_0x38d68a['proforma'][_0x85eb('0xa4')]);_0x13c0b3+=util[_0x85eb('0x50')](_0x4470b3['cs'][_0x170a60]+_0x85eb('0x9f'),_0x38d68a[_0x85eb('0x5b')][_0x85eb('0xa5')]);_0x13c0b3+=_0x85eb('0xa6');_0x13c0b3+=_0x85eb('0xa7');_0x13c0b3+=_0x85eb('0xa8');_0x13c0b3+=util[_0x85eb('0x50')]('%s',_0x38d68a[_0x85eb('0x5b')][_0x85eb('0xa9')]);_0x13c0b3+=util['format']('%s
',_0x38d68a[_0x85eb('0x5b')]['receivingStreet']);_0x13c0b3+=util[_0x85eb('0x50')]('%s\x20-\x20',_0x38d68a[_0x85eb('0x5b')]['receivingPostalCode']);_0x13c0b3+=util[_0x85eb('0x50')](_0x85eb('0x96'),_0x38d68a['proforma'][_0x85eb('0xaa')]);_0x13c0b3+=util[_0x85eb('0x50')]('%s
',_0x38d68a[_0x85eb('0x5b')][_0x85eb('0x90')]);_0x13c0b3+=util[_0x85eb('0x50')](_0x85eb('0xab')+_0x4470b3['cf'][_0x170a60]+':\x20%s
',_0x38d68a[_0x85eb('0x5b')]['receivingFiscalCode']);_0x13c0b3+=util[_0x85eb('0x50')](_0x4470b3[_0x85eb('0xac')][_0x170a60]+_0x85eb('0x9f'),_0x38d68a['proforma'][_0x85eb('0xad')]);_0x13c0b3+=util[_0x85eb('0x50')](_0x4470b3[_0x85eb('0xae')][_0x170a60]+':\x20%s
',_0x38d68a[_0x85eb('0x5b')]['receivingSDICode']);_0x13c0b3+=_0x85eb('0xaf');_0x13c0b3+=_0x85eb('0xb0');_0x13c0b3+=_0x85eb('0x95');_0x13c0b3+='';_0x13c0b3+=util['format'](''+_0x4470b3[_0x85eb('0x5b')][_0x170a60]+_0x85eb('0xb1'),_0x2a0f8b['id']);_0x13c0b3+=util[_0x85eb('0x50')]('%s,\x20',_0x38d68a[_0x85eb('0x5b')][_0x85eb('0x9a')]);var _0x45d6af=moment(_0x38d68a[_0x85eb('0x5b')][_0x85eb('0xb2')])['format']('DD/MM/YYYY');_0x13c0b3+=util[_0x85eb('0x50')](_0x85eb('0xb3'),_0x45d6af);var _0x5473ec=moment(_0x38d68a[_0x85eb('0x5b')][_0x85eb('0xb2')])[_0x85eb('0xb4')](_0x38d68a[_0x85eb('0x5b')][_0x85eb('0xb5')],_0x85eb('0xb6'))[_0x85eb('0x50')](_0x85eb('0xb7'));_0x13c0b3+=util[_0x85eb('0x50')](_0x85eb('0xb8')+_0x4470b3[_0x85eb('0xb9')][_0x170a60]+_0x85eb('0xba'),_0x5473ec);_0x13c0b3+=_0x85eb('0xb0');_0x13c0b3+=_0x85eb('0x95');_0x13c0b3+=_0x85eb('0xbb');_0x13c0b3+='';_0x13c0b3+=_0x85eb('0x95');_0x13c0b3+=_0x85eb('0xbc')+_0x4470b3[_0x85eb('0xbd')][_0x170a60]+_0x85eb('0xbe');_0x13c0b3+=_0x85eb('0xbc')+_0x4470b3[_0x85eb('0xbf')][_0x170a60]+_0x85eb('0xbe');_0x13c0b3+=_0x85eb('0xbc')+_0x4470b3[_0x85eb('0xc0')][_0x170a60]+_0x85eb('0xbe');_0x13c0b3+=''+_0x4470b3[_0x85eb('0xc1')][_0x170a60]+_0x85eb('0xbe');_0x13c0b3+=_0x85eb('0xbc')+_0x4470b3[_0x85eb('0xc2')][_0x170a60]+'';_0x13c0b3+=_0x85eb('0xb0');var _0x379b30=0x0;var _0x30ee4e=0x0;for(var _0x819d42=0x0;_0x819d42<_0x38d68a[_0x85eb('0x53')][_0x85eb('0x41')];_0x819d42++){var _0x50a21d=0x0;var _0x2dde05=0x0;var _0x36dbb1=0x0;var _0x12c3be=0x0;_0x50a21d=_0x38d68a['details'][_0x819d42][_0x85eb('0xc3')]-_0x38d68a[_0x85eb('0x53')][_0x819d42][_0x85eb('0xc3')]/0x64*_0x38d68a[_0x85eb('0x53')][_0x819d42][_0x85eb('0xc4')];_0x2dde05=_0x50a21d/0x64*_0x38d68a[_0x85eb('0x53')][_0x819d42][_0x85eb('0xc5')];_0x36dbb1=_0x50a21d*_0x38d68a[_0x85eb('0x53')][_0x819d42]['quantity'];_0x12c3be=_0x2dde05*_0x38d68a[_0x85eb('0x53')][_0x819d42][_0x85eb('0xc6')];_0x13c0b3+='
';_0x13c0b3+=util['format'](_0x85eb('0xc7'),_0x38d68a['details'][_0x819d42][_0x85eb('0xc8')]);_0x13c0b3+=util[_0x85eb('0x50')](_0x85eb('0xc7'),_0x38d68a[_0x85eb('0x53')][_0x819d42]['productDescription']);_0x13c0b3+=util['format'](_0x85eb('0xc9'),_0x38d68a['details'][_0x819d42][_0x85eb('0xc6')]);_0x13c0b3+=_0x85eb('0xca')+_0x50a21d[_0x85eb('0xcb')](0x2)+_0x85eb('0xcc');_0x13c0b3+=''+_0x36dbb1['toFixed'](0x2)+_0x85eb('0xcc');_0x13c0b3+=_0x85eb('0xb0');_0x379b30+=_0x36dbb1;_0x30ee4e+=_0x12c3be;}_0x13c0b3+=_0x85eb('0xcd');if(!_['isNil'](_0x38d68a['proforma'][_0x85eb('0xc4')])){var _0x138316=0x0;var _0x282200=0x0;var _0x20c335=_0x38d68a[_0x85eb('0x5b')][_0x85eb('0xc4')]*0x64/_0x379b30;for(var _0x819d42=0x0;_0x819d42<_0x38d68a[_0x85eb('0x53')][_0x85eb('0x41')];_0x819d42++){var _0x4115ae=0x0;var _0x26c3a7=0x0;var _0x5f0ac1=0x0;_0x50a21d=_0x38d68a[_0x85eb('0x53')][_0x819d42][_0x85eb('0xc3')]-_0x38d68a['details'][_0x819d42][_0x85eb('0xc3')]/0x64*_0x38d68a[_0x85eb('0x53')][_0x819d42][_0x85eb('0xc4')];_0x4115ae=_0x50a21d/0x64*_0x20c335;_0x26c3a7=_0x50a21d-_0x4115ae;_0x5f0ac1=_0x26c3a7*_0x38d68a[_0x85eb('0x53')][_0x819d42][_0x85eb('0xc6')];_0x138316+=_0x5f0ac1;_0x282200+=_0x5f0ac1/0x64*_0x38d68a[_0x85eb('0x53')][_0x819d42]['tax'];}}var _0x4ba2d3=0x0;var _0x504e83=0x0;var _0x55c697=![];var _0x2f1ff1=_0x38d68a['proforma'][_0x85eb('0xce')];if(_0x2f1ff1[_0x85eb('0xcf')]('split\x20payment')!=-0x1){_0x55c697=!![];}if(!_['isNil'](_0x38d68a[_0x85eb('0x5b')][_0x85eb('0xc4')])){_0x13c0b3+='';if(_0x38d68a[_0x85eb('0x5b')][_0x85eb('0xc4')]>0x0){_0x13c0b3+=_0x85eb('0xd0')+_0x4470b3['discount'][_0x170a60]+'';_0x13c0b3+=_0x85eb('0xca')+_0x38d68a[_0x85eb('0x5b')][_0x85eb('0xc4')][_0x85eb('0xcb')](0x2)+_0x85eb('0xcc');}_0x13c0b3+=_0x85eb('0xb0');_0x4ba2d3=_0x282200;_0x504e83=_0x138316;}else{_0x4ba2d3=_0x30ee4e;_0x504e83=_0x379b30;}if(_0x4ba2d3>0x0||_0x38d68a[_0x85eb('0x5b')][_0x85eb('0xc4')]>0x0){_0x13c0b3+=_0x85eb('0x95');_0x13c0b3+=_0x85eb('0xd1')+_0x4470b3['total'][_0x170a60]+_0x85eb('0xa6');_0x13c0b3+=''+_0x504e83[_0x85eb('0xcb')](0x2)+_0x85eb('0xcc');_0x13c0b3+=_0x85eb('0xb0');}if(_0x4ba2d3>0x0){_0x13c0b3+=_0x85eb('0x95');_0x13c0b3+=_0x85eb('0xd1')+_0x4470b3['tax'][_0x170a60]+_0x85eb('0xa6');_0x13c0b3+=_0x85eb('0xca')+_0x4ba2d3[_0x85eb('0xcb')](0x2)+'\x20€';_0x13c0b3+=_0x85eb('0xb0');}_0x13c0b3+=_0x85eb('0x95');var _0x323812;if(_0x55c697){_0x323812=_0x504e83;}else{_0x323812=_0x504e83+_0x4ba2d3;}_0x13c0b3+=_0x85eb('0xd2')+_0x4470b3[_0x85eb('0xd3')][_0x170a60]+_0x85eb('0xd4')+_0x323812[_0x85eb('0xcb')](0x2)+_0x85eb('0xcc');_0x13c0b3+=_0x85eb('0xd5');_0x13c0b3+=_0x85eb('0xb0');_0x13c0b3+=_0x85eb('0xd6');_0x13c0b3+=_0x85eb('0xd7');_0x13c0b3+=_0x85eb('0x95');_0x13c0b3+=util[_0x85eb('0x50')](_0x85eb('0xd8'),_0x38d68a[_0x85eb('0x5b')]['receivingFiscalMessage'][_0x85eb('0xd9')](new RegExp(String[_0x85eb('0xda')](0xd),'g'),_0x85eb('0xdb')));_0x13c0b3+=_0x85eb('0xb0');_0x13c0b3+=_0x85eb('0x95');_0x13c0b3+=_0x85eb('0xbb');_0x13c0b3+=_0x85eb('0xdc')+_0x4470b3['sendpayment'][_0x170a60]+_0x85eb('0xdd');if(!_[_0x85eb('0xde')](_0x38d68a['proforma'][_0x85eb('0xdf')])){_0x13c0b3+=''+_0x4470b3[_0x85eb('0xe0')][_0x170a60]+_0x85eb('0xe1')+_0x38d68a[_0x85eb('0x5b')][_0x85eb('0xdf')]+_0x85eb('0xe2');_0x13c0b3+=_0x85eb('0xdc')+_0x4470b3[_0x85eb('0xe3')][_0x170a60]+_0x85eb('0xe1')+_0x38d68a['proforma']['issuerBankName']+_0x85eb('0xe4');_0x13c0b3+=_0x85eb('0xdc')+_0x4470b3[_0x85eb('0xe5')][_0x170a60]+_0x85eb('0xe1')+_0x38d68a['proforma'][_0x85eb('0xe6')]+',\x20'+_0x38d68a[_0x85eb('0x5b')][_0x85eb('0xe7')]+'\x20-\x20'+_0x38d68a[_0x85eb('0x5b')][_0x85eb('0xe8')]+'\x20('+_0x38d68a[_0x85eb('0x5b')]['issuerBankCountry']+')'+_0x85eb('0xe2');_0x13c0b3+=_0x85eb('0xdc')+_0x4470b3[_0x85eb('0xe9')][_0x170a60]+'/'+_0x4470b3['cab'][_0x170a60]+_0x85eb('0xe1')+_0x38d68a[_0x85eb('0x5b')][_0x85eb('0xea')]+'/'+_0x38d68a[_0x85eb('0x5b')][_0x85eb('0xeb')]+_0x85eb('0xe2');_0x13c0b3+=_0x85eb('0xdc')+_0x4470b3[_0x85eb('0xec')][_0x170a60]+'/'+_0x4470b3[_0x85eb('0xed')][_0x170a60]+':\x20'+_0x38d68a[_0x85eb('0x5b')][_0x85eb('0xee')]+_0x85eb('0xe2');_0x13c0b3+=_0x85eb('0xdc')+_0x4470b3[_0x85eb('0xef')][_0x170a60]+_0x85eb('0xe1')+_0x38d68a['proforma']['issuerBankIBAN']+_0x85eb('0xe2');}if(!_[_0x85eb('0xde')](_0x38d68a[_0x85eb('0x5b')][_0x85eb('0xf0')])){_0x13c0b3+=_0x85eb('0xdc')+_0x4470b3[_0x85eb('0xf1')][_0x170a60]+_0x85eb('0xe1')+_0x38d68a['proforma'][_0x85eb('0xf0')]+_0x85eb('0xe2');}_0x13c0b3+=''+_0x4470b3[_0x85eb('0xf2')][_0x170a60]+_0x85eb('0xf3')+_0x5473ec+_0x85eb('0xf4')+_0x4470b3[_0x85eb('0xf5')][_0x170a60]+_0x85eb('0xdd');_0x13c0b3+=_0x85eb('0xa6');_0x13c0b3+=_0x85eb('0xb0');if(_0x38d68a[_0x85eb('0x5b')][_0x85eb('0xf6')]===0x1){_0x13c0b3+='\x20';}_0x13c0b3+='
';_0x13c0b3+=_0x85eb('0xf7');_0x13c0b3+=_0x85eb('0xf8');return new BPromise(function(_0x27fd58,_0x413509){pdf[_0x85eb('0x44')](_0x13c0b3,_0x45a201)[_0x85eb('0xf9')](path[_0x85eb('0x49')](_0x40d846,_0x341ddb),function(_0x384eb8,_0xb14288){if(_0x384eb8)return _0x413509(_0x384eb8);_0x27fd58(_0xb14288);});});});}})[_0x85eb('0x21')](function(){if(_0x5a45a0){console['log'](_0x85eb('0xfa'),_0x214ef7,_0x341ddb);return _0x4c06ef[_0x85eb('0xfb')](_0x214ef7,_0x341ddb,function(_0x5d29b2){if(_0x5d29b2){console[_0x85eb('0xfc')](_0x85eb('0xfd'),_0x5d29b2);}else{console[_0x85eb('0xfc')]('foldername',_0x40d846);rimraf(_0x40d846,function(){});}});}else{return _0x4c06ef[_0x85eb('0x18')](0xc8);}})['catch'](handleError(_0x4c06ef,null));};function addCloneDetail(_0xdef9b5,_0x5b1bca,_0x242735){console[_0x85eb('0xfc')](_0x85eb('0xfe'),_0xdef9b5);_0xdef9b5[_0x85eb('0xff')]=_0x5b1bca;delete _0xdef9b5['id'];return db[_0x85eb('0x52')][_0x85eb('0x44')](_0xdef9b5,{'transaction':_0x242735});}exports[_0x85eb('0x100')]=function(_0x92225b,_0x5bf029,_0x4f6029){var _0x1c0550;if(_0x92225b[_0x85eb('0x45')]['id']){delete _0x92225b[_0x85eb('0x45')]['id'];}console[_0x85eb('0xfc')](_0x85eb('0x101'),_0x92225b['params']['id']);return db[_0x85eb('0x102')]['transaction'](function(_0x5e9b97){return db[_0x85eb('0x26')][_0x85eb('0x44')](_0x92225b['body'],{'transaction':_0x5e9b97,'logging':console[_0x85eb('0xfc')]})[_0x85eb('0x21')](function(_0x7a6e30){console[_0x85eb('0xfc')](_0x85eb('0x103'),_0x7a6e30);_0x1c0550=_0x7a6e30;var _0x490d17=_0x92225b[_0x85eb('0x3f')]['id'];return db[_0x85eb('0x52')][_0x85eb('0x3c')]({'where':{'ProformaId':_0x490d17},'raw':!![]});})[_0x85eb('0x21')](function(_0x2b6f8d){console[_0x85eb('0xfc')](_0x85eb('0x104'),_0x2b6f8d);if(_0x2b6f8d[_0x85eb('0x41')]>0x0){var _0x4033fc=[];for(var _0x32624a=0x0;_0x32624a<_0x2b6f8d['length'];_0x32624a++){_0x4033fc['push'](addCloneDetail(_0x2b6f8d[_0x32624a],_0x1c0550['id'],_0x5e9b97));}return BPromise['all'](_0x4033fc);}else{var _0x2ef966={'errors':[{'type':_0x85eb('0x105'),'message':_0x85eb('0x106')}]};throw _0x2ef966;}});})['then'](function(){return _0x5bf029[_0x85eb('0x18')](0xc8);})[_0x85eb('0x3e')](function(_0x51de1d){console[_0x85eb('0xfc')](_0x85eb('0x107'),_0x51de1d);if(_0x51de1d[_0x85eb('0x23')]===_0x85eb('0x108')){var _0x51de1d={'errors':[{'message':_0x85eb('0x109')}]};}_0x5bf029[_0x85eb('0x19')](0x1f4)[_0x85eb('0x24')](_0x51de1d);});}; \ No newline at end of file +var _0x4483=['Hrs/Qty','Ore/Qta','Unit\x20Price','Prezzo\x20Unitario','Sub\x20Total','Sub\x20Totale','Discount','Sconto','Subtotal','Imponibile','Tax','Tasse','Total','Please\x20send\x20PAYMENT\x20to','Si\x20prega\x20di\x20inviare\x20il\x20pagamento\x20a','Conto\x20intestato\x20a','Bank\x20name','Bank\x20Address','Indirizzo\x20banca','ABI','CAB','BIC','SWIF','IBAN','Pay\x20via\x20Paypal','Paga\x20con\x20Paypal',',\x20so\x20please\x20do\x20so\x20within\x20this\x20time.','\x20quindi\x20vi\x20preghiamo\x20di\x20provvedere\x20entro\x20tale\x20termine.','receivingCountry','Italy','\x20','issuerName','issuerStreet','issuerPostalCode','\x20%s','issuerCity','-\x20%s\x20
','issuerCountry','phone',':\x20%s
','issuerEmail','piva','issuerPIVA','issuerFiscalCode','','','%s','%s
','receivingStreet','%s\x20-\x20','','receivingPIVA','receivingSDICode','','','','','\x20N.%d','%s,\x20','DD/MM/YYYY','%s\x20','add','saExpiryDay','',':\x20%s','','','','description','hrsqty','unitprice','discount','quantity','%s','productDescription','%d','','\x20€','','isNil','netPrice','tax','receivingFiscalMessage','indexOf','split\x20payment','','toFixed','','','nettopay','\x20',' ','\x20%s\x20','replace','fromCharCode','','','sendpayment','issuerBankAccount','',':\x20','issuerBankName','\x20','bankaddress','issuerBankStreet','issuerBankPostalCode','\x20-\x20','issuerBankCity','issuerBankCountry','abi','cab','issuerABI','issuerCAB','bic','swif','issuerBankBICSWIFT','issuerBankIBAN','issuerPayPal','paypal','thank1','','thank2','paid','\x22\x20width=\x22180\x22>','','','toFile','log','TCL:\x20exports.getProformaPDF\x20->\x20saveTo,\x20fileName','download','err','foldername','addCloneDetail->>','ProformaId','SAProformaDetail','cloneProforma','cloneProforma\x20req.params.id:','sequelize','transaction','result','cloneProforma\x20productsProforma:','push','all','WARNING','No\x20product\x20to\x20assign\x20new\x20proforma.\x20Proforma\x20not\x20created!!\x20','TCL:\x20exports.cloneProforma\x20->\x20err','SequelizeUniqueConstraintError','Duplicate\x20entry.','send','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','reject','save','update','then','error','stack','name','index','SAProforma','rawAttributes','model','keys','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','key','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','destroy','describe','getProformaPDF','unix','toString','root','server','files','tmp','join','logos','logo-invoice.png','images','paid-invoice.png','format','Proforma_%s-%s.pdf','proforma','details','portrait','{{page}}/{{pages}}','footer','contents','default','','issuerWeb','','mkdirSync','','\x20\x20body{font-family:\x20Roboto,\x20\x27Segoe\x20UI\x27,\x20Tahoma,\x20sans-serif;}.itemTabTitle{background-color:\x20lightgray;\x20height:\x2040px;}.issuerInfo{color:\x20lightgray;\x20padding-top:\x2020px;\x20padding-bottom:\x2020px;\x20font-size:\x2010px;}.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:\x20bolder;\x20padding-bottom:\x2010px;\x20font-size:\x2010px}.reciperFiscalInfo{padding-top:\x205px;\x20padding-bottom:\x205px;,\x20font-size:\x2010px;}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:\x208px;\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:\x208px;}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','Telefono','Fax','Email','P.IVA','C.F.','Codice\x20S.D.I.','Soc.Cap.\x20fp','Invoice','Fattura','Credit\x20note','Scadenza','Item','Descrizione'];(function(_0x5c47e8,_0x2ec59d){var _0x2a108d=function(_0x406edc){while(--_0x406edc){_0x5c47e8['push'](_0x5c47e8['shift']());}};_0x2a108d(++_0x2ec59d);}(_0x4483,0x1a3));var _0x3448=function(_0x4182de,_0xe96734){_0x4182de=_0x4182de-0x0;var _0x27f50e=_0x4483[_0x4182de];return _0x27f50e;};'use strict';var pdf=require(_0x3448('0x0'));var emlformat=require(_0x3448('0x1'));var rimraf=require(_0x3448('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3448('0x3'));var rp=require(_0x3448('0x4'));var moment=require(_0x3448('0x5'));var BPromise=require(_0x3448('0x6'));var Mustache=require(_0x3448('0x7'));var util=require('util');var path=require(_0x3448('0x8'));var sox=require(_0x3448('0x9'));var csv=require(_0x3448('0xa'));var ejs=require(_0x3448('0xb'));var fs=require('fs');var _=require(_0x3448('0xc'));var squel=require(_0x3448('0xd'));var crypto=require(_0x3448('0xe'));var jsforce=require(_0x3448('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3448('0x10'));var Papa=require(_0x3448('0x11'));var Redis=require(_0x3448('0x12'));var authService=require(_0x3448('0x13'));var qs=require(_0x3448('0x14'));var hardwareService=require(_0x3448('0x15'));var logger=require(_0x3448('0x16'))(_0x3448('0x17'));var utils=require(_0x3448('0x18'));var config=require(_0x3448('0x19'));var db=require(_0x3448('0x1a'))['db'];function respondWithStatusCode(_0x481a6f,_0x5bf09e){_0x5bf09e=_0x5bf09e||0xcc;return function(_0x298ae6){if(_0x298ae6){return _0x481a6f[_0x3448('0x1b')](_0x5bf09e);}return _0x481a6f['status'](_0x5bf09e)[_0x3448('0x1c')]();};}function respondWithResult(_0xdfb89d,_0x587db9){_0x587db9=_0x587db9||0xc8;return function(_0x549306){if(_0x549306){return _0xdfb89d[_0x3448('0x1d')](_0x587db9)[_0x3448('0x1e')](_0x549306);}};}function respondWithFilteredResult(_0x4daf3e,_0x2387a3){return function(_0x2c2da6){if(_0x2c2da6){var _0x46784f=_0x2c2da6[_0x3448('0x1f')],_0x4fc70f=_0x2387a3[_0x3448('0x20')],_0x472518=_0x2387a3[_0x3448('0x20')]+_0x2387a3[_0x3448('0x21')],_0x28f5b9;if(_0x472518>=_0x46784f){_0x472518=_0x46784f;_0x28f5b9=0xc8;}else{_0x28f5b9=0xce;}_0x4daf3e[_0x3448('0x1d')](_0x28f5b9);return _0x4daf3e[_0x3448('0x22')]('Content-Range',_0x4fc70f+'-'+_0x472518+'/'+_0x46784f)[_0x3448('0x1e')](_0x2c2da6);}return null;};}function patchUpdates(_0x5b410d){return function(_0x48f94a){try{jsonpatch['apply'](_0x48f94a,_0x5b410d,!![]);}catch(_0x1e9774){return BPromise[_0x3448('0x23')](_0x1e9774);}return _0x48f94a[_0x3448('0x24')]();};}function saveUpdates(_0x5b5e26,_0x3df082){return function(_0x392c8d){if(_0x392c8d){return _0x392c8d[_0x3448('0x25')](_0x5b5e26)[_0x3448('0x26')](function(_0x29a15a){return _0x29a15a;});}return null;};}function removeEntity(_0x715c3,_0x5db78f){return function(_0x54c7ee){if(_0x54c7ee){return _0x54c7ee['destroy']()[_0x3448('0x26')](function(){_0x715c3[_0x3448('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b1f7c,_0x2dcd40){return function(_0x4371d6){if(!_0x4371d6){_0x5b1f7c[_0x3448('0x1b')](0x194);}return _0x4371d6;};}function handleError(_0x4368c7,_0xbf2237){_0xbf2237=_0xbf2237||0x1f4;return function(_0x566ff5){logger[_0x3448('0x27')](_0x566ff5[_0x3448('0x28')]);if(_0x566ff5[_0x3448('0x29')]){delete _0x566ff5[_0x3448('0x29')];}_0x4368c7[_0x3448('0x1d')](_0xbf2237)['send'](_0x566ff5);};}exports[_0x3448('0x2a')]=function(_0x393081,_0x52c163){var _0x19a479={},_0x12c22d={},_0x310912={'count':0x0,'rows':[]};var _0x1bd34c=db[_0x3448('0x2b')][_0x3448('0x2c')];_0x12c22d[_0x3448('0x2d')]=_[_0x3448('0x2e')](_0x1bd34c);_0x12c22d['query']=_[_0x3448('0x2e')](_0x393081[_0x3448('0x2f')]);_0x12c22d[_0x3448('0x30')]=_['intersection'](_0x12c22d[_0x3448('0x2d')],_0x12c22d['query']);_0x19a479['attributes']=_['intersection'](_0x12c22d[_0x3448('0x2d')],qs[_0x3448('0x31')](_0x393081['query']['fields']));_0x19a479[_0x3448('0x32')]=_0x19a479[_0x3448('0x32')][_0x3448('0x33')]?_0x19a479[_0x3448('0x32')]:_0x12c22d['model'];if(!_0x393081[_0x3448('0x2f')][_0x3448('0x34')](_0x3448('0x35'))){_0x19a479['limit']=qs[_0x3448('0x21')](_0x393081[_0x3448('0x2f')]['limit']);_0x19a479['offset']=qs[_0x3448('0x20')](_0x393081[_0x3448('0x2f')][_0x3448('0x20')]);}_0x19a479[_0x3448('0x36')]=qs['sort'](_0x393081[_0x3448('0x2f')][_0x3448('0x37')]);_0x19a479[_0x3448('0x38')]=qs[_0x3448('0x30')](_['pick'](_0x393081[_0x3448('0x2f')],_0x12c22d[_0x3448('0x30')]));if(_0x393081['query'][_0x3448('0x39')]){_0x19a479[_0x3448('0x38')]=_[_0x3448('0x3a')](_0x19a479[_0x3448('0x38')],{'$or':_[_0x3448('0x3b')](_0x1bd34c,function(_0x31586a){if(_0x31586a[_0x3448('0x3c')][_0x3448('0x3d')]!==_0x3448('0x3e')){var _0x49c469={};_0x49c469[_0x31586a['field']]={'$like':'%'+_0x393081[_0x3448('0x2f')]['filter']+'%'};return _0x49c469;}})});}_0x19a479=_[_0x3448('0x3a')]({},_0x19a479,_0x393081[_0x3448('0x3f')]);var _0x12f678={'where':_0x19a479[_0x3448('0x38')]};return db['SAProforma'][_0x3448('0x1f')](_0x12f678)[_0x3448('0x26')](function(_0x495d7){_0x310912[_0x3448('0x1f')]=_0x495d7;if(_0x393081[_0x3448('0x2f')][_0x3448('0x40')]){_0x19a479[_0x3448('0x41')]=[{'all':!![]}];}return db[_0x3448('0x2b')][_0x3448('0x42')](_0x19a479);})['then'](function(_0x39b22e){_0x310912[_0x3448('0x43')]=_0x39b22e;return _0x310912;})[_0x3448('0x26')](respondWithFilteredResult(_0x52c163,_0x19a479))[_0x3448('0x44')](handleError(_0x52c163,null));};exports[_0x3448('0x45')]=function(_0x58963d,_0x18b297){var _0x1b7284={'raw':![],'where':{'id':_0x58963d[_0x3448('0x46')]['id']}},_0x4a6e5={};_0x4a6e5[_0x3448('0x2d')]=_[_0x3448('0x2e')](db[_0x3448('0x2b')][_0x3448('0x2c')]);_0x4a6e5['query']=_[_0x3448('0x2e')](_0x58963d[_0x3448('0x2f')]);_0x4a6e5[_0x3448('0x30')]=_['intersection'](_0x4a6e5[_0x3448('0x2d')],_0x4a6e5[_0x3448('0x2f')]);_0x1b7284[_0x3448('0x32')]=_[_0x3448('0x47')](_0x4a6e5[_0x3448('0x2d')],qs[_0x3448('0x31')](_0x58963d[_0x3448('0x2f')]['fields']));_0x1b7284[_0x3448('0x32')]=_0x1b7284[_0x3448('0x32')][_0x3448('0x33')]?_0x1b7284[_0x3448('0x32')]:_0x4a6e5[_0x3448('0x2d')];if(_0x58963d[_0x3448('0x2f')]['includeAll']){_0x1b7284[_0x3448('0x41')]=[{'all':!![]}];}_0x1b7284=_['merge']({},_0x1b7284,_0x58963d['options']);return db[_0x3448('0x2b')][_0x3448('0x48')](_0x1b7284)['then'](handleEntityNotFound(_0x18b297,null))[_0x3448('0x26')](respondWithResult(_0x18b297,null))[_0x3448('0x44')](handleError(_0x18b297,null));};exports['create']=function(_0x4cf807,_0x1372a1){return db['SAProforma'][_0x3448('0x49')](_0x4cf807[_0x3448('0x4a')],{})[_0x3448('0x26')](respondWithResult(_0x1372a1,0xc9))[_0x3448('0x44')](handleError(_0x1372a1,null));};exports[_0x3448('0x25')]=function(_0x3e3208,_0x2cb2af){if(_0x3e3208['body']['id']){delete _0x3e3208['body']['id'];}return db[_0x3448('0x2b')][_0x3448('0x48')]({'where':{'id':_0x3e3208[_0x3448('0x46')]['id']}})[_0x3448('0x26')](handleEntityNotFound(_0x2cb2af,null))['then'](saveUpdates(_0x3e3208[_0x3448('0x4a')],null))[_0x3448('0x26')](respondWithResult(_0x2cb2af,null))[_0x3448('0x44')](handleError(_0x2cb2af,null));};exports[_0x3448('0x4b')]=function(_0x363374,_0x5d942b){return db[_0x3448('0x2b')]['find']({'where':{'id':_0x363374[_0x3448('0x46')]['id']}})[_0x3448('0x26')](handleEntityNotFound(_0x5d942b,null))['then'](removeEntity(_0x5d942b,null))[_0x3448('0x44')](handleError(_0x5d942b,null));};exports[_0x3448('0x4c')]=function(_0x257abb,_0x19c283){return db[_0x3448('0x2b')][_0x3448('0x4c')]()[_0x3448('0x26')](respondWithResult(_0x19c283,null))['catch'](handleError(_0x19c283,null));};exports[_0x3448('0x4d')]=function(_0x9fbee8,_0x5dd19a){var _0x5a81dd=moment()[_0x3448('0x4e')]()[_0x3448('0x4f')]();var _0x4d20ba=path['join'](config[_0x3448('0x50')],_0x3448('0x51'),_0x3448('0x52'),_0x3448('0x53'));var _0x176e60=path[_0x3448('0x54')](config[_0x3448('0x50')],'server','files','images',_0x3448('0x55'),_0x3448('0x56'));var _0x5cf3fe=path[_0x3448('0x54')](config[_0x3448('0x50')],'server',_0x3448('0x52'),_0x3448('0x57'),'logos',_0x3448('0x58'));var _0x456e82=path[_0x3448('0x54')](_0x4d20ba,_0x5a81dd);var _0x363723=util[_0x3448('0x59')](_0x3448('0x5a'),_0x9fbee8[_0x3448('0x46')]['id'],_0x5a81dd);var _0x1b7d87=path[_0x3448('0x54')](_0x456e82,_0x363723);var _0x4926aa=![];var _0x594d83={};return db['SAProforma'][_0x3448('0x48')]({'where':{'id':_0x9fbee8[_0x3448('0x46')]['id']},'raw':!![]})[_0x3448('0x26')](handleEntityNotFound(_0x5dd19a,null))[_0x3448('0x26')](function(_0x1cbeae){if(_0x1cbeae){_0x594d83[_0x3448('0x5b')]=_0x1cbeae;return db['SAProformaDetail'][_0x3448('0x42')]({'where':{'ProformaId':_0x1cbeae['id']},'raw':!![]})['then'](function(_0x15b48b){_0x594d83[_0x3448('0x5c')]=_0x15b48b;_0x4926aa=!![];var _0x3bf4d2='';var _0x5c9320={'format':'A4','orientation':_0x3448('0x5d'),'border':'1cm','footer':{'height':'10mm','contents':{'default':_0x3448('0x5e')}}};_0x5c9320[_0x3448('0x5f')][_0x3448('0x60')]['default']=_0x5c9320[_0x3448('0x5f')][_0x3448('0x60')][_0x3448('0x61')]+_0x3448('0x62')+_0x594d83[_0x3448('0x5b')][_0x3448('0x63')]+_0x3448('0x64');fs[_0x3448('0x65')](_0x456e82);_0x3bf4d2=_0x3448('0x66');_0x3bf4d2+=_0x3448('0x67');_0x3bf4d2+=_0x3448('0x68');var _0x2f0bcc={'phone':{'en':_0x3448('0x69'),'it':_0x3448('0x6a')},'fax':{'en':_0x3448('0x6b'),'it':_0x3448('0x6b')},'email':{'en':_0x3448('0x6c'),'it':_0x3448('0x6c')},'piva':{'en':'VAT\x20number','it':_0x3448('0x6d')},'cf':{'en':'Tax\x20code','it':_0x3448('0x6e')},'sdi':{'en':'I.S.\x20code','it':_0x3448('0x6f')},'cs':{'en':_0x3448('0x70'),'it':'Cap.Soc.\x20iv'},'invoice':{'en':_0x3448('0x71'),'it':_0x3448('0x72')},'proforma':{'en':'Proforma','it':'Proforma'},'creditnote':{'en':_0x3448('0x73'),'it':'Nota\x20di\x20credito'},'duedate':{'en':'Due\x20date','it':_0x3448('0x74')},'item':{'en':_0x3448('0x75'),'it':'Articolo'},'description':{'en':'Description','it':_0x3448('0x76')},'hrsqty':{'en':_0x3448('0x77'),'it':_0x3448('0x78')},'unitprice':{'en':_0x3448('0x79'),'it':_0x3448('0x7a')},'subtotal':{'en':_0x3448('0x7b'),'it':_0x3448('0x7c')},'discount':{'en':_0x3448('0x7d'),'it':_0x3448('0x7e')},'total':{'en':_0x3448('0x7f'),'it':_0x3448('0x80')},'tax':{'en':_0x3448('0x81'),'it':_0x3448('0x82')},'nettopay':{'en':_0x3448('0x83'),'it':'Totale'},'sendpayment':{'en':_0x3448('0x84'),'it':_0x3448('0x85')},'accountholder':{'en':'Account\x20Holder','it':_0x3448('0x86')},'bankname':{'en':_0x3448('0x87'),'it':'Nome\x20banca'},'bankaddress':{'en':_0x3448('0x88'),'it':_0x3448('0x89')},'abi':{'en':_0x3448('0x8a'),'it':'ABI'},'cab':{'en':'CAB','it':_0x3448('0x8b')},'bic':{'en':'BIC','it':_0x3448('0x8c')},'swif':{'en':_0x3448('0x8d'),'it':_0x3448('0x8d')},'iban':{'en':'IBAN','it':_0x3448('0x8e')},'paypal':{'en':_0x3448('0x8f'),'it':_0x3448('0x90')},'thank1':{'en':'Thank\x20you\x20for\x20your\x20business.\x20We\x20do\x20expect\x20payment\x20by\x20','it':'Grazie.\x20Prevediamo\x20il\x20pagamento\x20entro\x20'},'thank2':{'en':_0x3448('0x91'),'it':_0x3448('0x92')}};var _0x1ddd54='it';if(_0x594d83[_0x3448('0x5b')][_0x3448('0x93')]!==_0x3448('0x94')){_0x1ddd54='en';}_0x3bf4d2+='';_0x3bf4d2+=_0x3448('0x95')+_0x176e60+'\x22\x20width=\x22180\x22>';_0x3bf4d2+=_0x3448('0x96');_0x3bf4d2+=util[_0x3448('0x59')]('\x20%s
',_0x594d83[_0x3448('0x5b')][_0x3448('0x97')]);_0x3bf4d2+=util['format']('%s
',_0x594d83[_0x3448('0x5b')][_0x3448('0x98')]);_0x3bf4d2+=util[_0x3448('0x59')]('%s',_0x594d83[_0x3448('0x5b')][_0x3448('0x99')]);_0x3bf4d2+=util[_0x3448('0x59')](_0x3448('0x9a'),_0x594d83[_0x3448('0x5b')][_0x3448('0x9b')]);_0x3bf4d2+=util[_0x3448('0x59')](_0x3448('0x9c'),_0x594d83[_0x3448('0x5b')][_0x3448('0x9d')]);_0x3bf4d2+=util[_0x3448('0x59')](_0x2f0bcc[_0x3448('0x9e')][_0x1ddd54]+_0x3448('0x9f'),_0x594d83['proforma']['issuerPhone']);_0x3bf4d2+=util[_0x3448('0x59')](_0x2f0bcc['fax'][_0x1ddd54]+_0x3448('0x9f'),_0x594d83[_0x3448('0x5b')]['issuerFax']);_0x3bf4d2+=util[_0x3448('0x59')](_0x2f0bcc['email'][_0x1ddd54]+_0x3448('0x9f'),_0x594d83[_0x3448('0x5b')][_0x3448('0xa0')]);_0x3bf4d2+=util[_0x3448('0x59')](_0x2f0bcc[_0x3448('0xa1')][_0x1ddd54]+':\x20%s
',_0x594d83[_0x3448('0x5b')][_0x3448('0xa2')]);_0x3bf4d2+=util[_0x3448('0x59')](_0x2f0bcc['cf'][_0x1ddd54]+':\x20%s
',_0x594d83[_0x3448('0x5b')][_0x3448('0xa3')]);_0x3bf4d2+=util[_0x3448('0x59')](_0x2f0bcc['sdi'][_0x1ddd54]+_0x3448('0x9f'),_0x594d83['proforma']['issuerSDICode']);_0x3bf4d2+=util[_0x3448('0x59')](_0x2f0bcc['cs'][_0x1ddd54]+':\x20%s
',_0x594d83[_0x3448('0x5b')]['issuerSocCap']);_0x3bf4d2+=_0x3448('0xa4');_0x3bf4d2+=_0x3448('0xa5');_0x3bf4d2+='';_0x3bf4d2+=util['format'](_0x3448('0xa6'),_0x594d83[_0x3448('0x5b')]['companyName']);_0x3bf4d2+=util[_0x3448('0x59')](_0x3448('0xa7'),_0x594d83['proforma'][_0x3448('0xa8')]);_0x3bf4d2+=util[_0x3448('0x59')](_0x3448('0xa9'),_0x594d83[_0x3448('0x5b')]['receivingPostalCode']);_0x3bf4d2+=util[_0x3448('0x59')]('%s
',_0x594d83[_0x3448('0x5b')]['receivingCity']);_0x3bf4d2+=util[_0x3448('0x59')](_0x3448('0xa7'),_0x594d83[_0x3448('0x5b')]['receivingCountry']);_0x3bf4d2+=util[_0x3448('0x59')](_0x3448('0xaa')+_0x2f0bcc['cf'][_0x1ddd54]+':\x20%s
',_0x594d83[_0x3448('0x5b')]['receivingFiscalCode']);_0x3bf4d2+=util['format'](_0x2f0bcc[_0x3448('0xa1')][_0x1ddd54]+':\x20%s
',_0x594d83[_0x3448('0x5b')][_0x3448('0xab')]);_0x3bf4d2+=util[_0x3448('0x59')](_0x2f0bcc['sdi'][_0x1ddd54]+_0x3448('0x9f'),_0x594d83[_0x3448('0x5b')][_0x3448('0xac')]);_0x3bf4d2+=_0x3448('0xad');_0x3bf4d2+=_0x3448('0xae');_0x3bf4d2+=_0x3448('0x96');_0x3bf4d2+=_0x3448('0xaf');_0x3bf4d2+=util[_0x3448('0x59')](_0x3448('0xb0')+_0x2f0bcc[_0x3448('0x5b')][_0x1ddd54]+_0x3448('0xb1'),_0x1cbeae['id']);_0x3bf4d2+=util[_0x3448('0x59')](_0x3448('0xb2'),_0x594d83['proforma']['issuerCity']);var _0x5ec832=moment(_0x594d83[_0x3448('0x5b')]['updatedAt'])['format'](_0x3448('0xb3'));_0x3bf4d2+=util[_0x3448('0x59')](_0x3448('0xb4'),_0x5ec832);var _0x94d13f=moment(_0x594d83['proforma']['updatedAt'])[_0x3448('0xb5')](_0x594d83[_0x3448('0x5b')][_0x3448('0xb6')],'days')[_0x3448('0x59')](_0x3448('0xb3'));_0x3bf4d2+=util[_0x3448('0x59')](_0x3448('0xb7')+_0x2f0bcc['duedate'][_0x1ddd54]+_0x3448('0xb8'),_0x94d13f);_0x3bf4d2+=_0x3448('0xae');_0x3bf4d2+='';_0x3bf4d2+='';_0x3bf4d2+=_0x3448('0xb9');_0x3bf4d2+=_0x3448('0x96');_0x3bf4d2+=_0x3448('0xba')+_0x2f0bcc['item'][_0x1ddd54]+_0x3448('0xbb');_0x3bf4d2+=_0x3448('0xba')+_0x2f0bcc[_0x3448('0xbc')][_0x1ddd54]+_0x3448('0xbb');_0x3bf4d2+=''+_0x2f0bcc[_0x3448('0xbd')][_0x1ddd54]+_0x3448('0xbb');_0x3bf4d2+=''+_0x2f0bcc[_0x3448('0xbe')][_0x1ddd54]+_0x3448('0xbb');_0x3bf4d2+=''+_0x2f0bcc['subtotal'][_0x1ddd54]+_0x3448('0xbb');_0x3bf4d2+=_0x3448('0xae');var _0x3ff2ce=0x0;var _0x258f64=0x0;for(var _0x2f5420=0x0;_0x2f5420<_0x594d83[_0x3448('0x5c')][_0x3448('0x33')];_0x2f5420++){var _0x2e4559=0x0;var _0x1336b6=0x0;var _0x392d92=0x0;var _0x4b4cb6=0x0;_0x2e4559=_0x594d83[_0x3448('0x5c')][_0x2f5420]['netPrice']-_0x594d83[_0x3448('0x5c')][_0x2f5420]['netPrice']/0x64*_0x594d83[_0x3448('0x5c')][_0x2f5420][_0x3448('0xbf')];_0x1336b6=_0x2e4559/0x64*_0x594d83['details'][_0x2f5420]['tax'];_0x392d92=_0x2e4559*_0x594d83['details'][_0x2f5420][_0x3448('0xc0')];_0x4b4cb6=_0x1336b6*_0x594d83[_0x3448('0x5c')][_0x2f5420][_0x3448('0xc0')];_0x3bf4d2+='';_0x3bf4d2+=util[_0x3448('0x59')](_0x3448('0xc1'),_0x594d83['details'][_0x2f5420]['productName']);_0x3bf4d2+=util[_0x3448('0x59')](_0x3448('0xc1'),_0x594d83[_0x3448('0x5c')][_0x2f5420][_0x3448('0xc2')]);_0x3bf4d2+=util[_0x3448('0x59')](_0x3448('0xc3'),_0x594d83[_0x3448('0x5c')][_0x2f5420][_0x3448('0xc0')]);_0x3bf4d2+=_0x3448('0xc4')+_0x2e4559['toFixed'](0x2)+'\x20€';_0x3bf4d2+=_0x3448('0xc4')+_0x392d92['toFixed'](0x2)+_0x3448('0xc5');_0x3bf4d2+='';_0x3ff2ce+=_0x392d92;_0x258f64+=_0x4b4cb6;}_0x3bf4d2+=_0x3448('0xc6');if(!_[_0x3448('0xc7')](_0x594d83['proforma'][_0x3448('0xbf')])){var _0xaeef29=0x0;var _0xca3d2=0x0;var _0x1d466f=_0x594d83[_0x3448('0x5b')][_0x3448('0xbf')]*0x64/_0x3ff2ce;for(var _0x2f5420=0x0;_0x2f5420<_0x594d83[_0x3448('0x5c')][_0x3448('0x33')];_0x2f5420++){var _0x29fdd1=0x0;var _0x2b9e07=0x0;var _0x512b64=0x0;_0x2e4559=_0x594d83[_0x3448('0x5c')][_0x2f5420][_0x3448('0xc8')]-_0x594d83[_0x3448('0x5c')][_0x2f5420]['netPrice']/0x64*_0x594d83[_0x3448('0x5c')][_0x2f5420][_0x3448('0xbf')];_0x29fdd1=_0x2e4559/0x64*_0x1d466f;_0x2b9e07=_0x2e4559-_0x29fdd1;_0x512b64=_0x2b9e07*_0x594d83[_0x3448('0x5c')][_0x2f5420][_0x3448('0xc0')];_0xaeef29+=_0x512b64;_0xca3d2+=_0x512b64/0x64*_0x594d83[_0x3448('0x5c')][_0x2f5420][_0x3448('0xc9')];}}var _0x559022=0x0;var _0x504eee=0x0;var _0x1e2f04=![];var _0x1545f3=_0x594d83[_0x3448('0x5b')][_0x3448('0xca')];if(_0x1545f3[_0x3448('0xcb')](_0x3448('0xcc'))!=-0x1){_0x1e2f04=!![];}if(!_[_0x3448('0xc7')](_0x594d83[_0x3448('0x5b')][_0x3448('0xbf')])){_0x3bf4d2+=_0x3448('0x96');if(_0x594d83[_0x3448('0x5b')][_0x3448('0xbf')]>0x0){_0x3bf4d2+=_0x3448('0xcd')+_0x2f0bcc[_0x3448('0xbf')][_0x1ddd54]+'';_0x3bf4d2+=''+_0x594d83['proforma'][_0x3448('0xbf')][_0x3448('0xce')](0x2)+_0x3448('0xc5');}_0x3bf4d2+=_0x3448('0xae');_0x559022=_0xca3d2;_0x504eee=_0xaeef29;}else{_0x559022=_0x258f64;_0x504eee=_0x3ff2ce;}if(_0x559022>0x0||_0x594d83['proforma'][_0x3448('0xbf')]>0x0){_0x3bf4d2+='';_0x3bf4d2+=_0x3448('0xcf')+_0x2f0bcc['total'][_0x1ddd54]+_0x3448('0xa4');_0x3bf4d2+=''+_0x504eee[_0x3448('0xce')](0x2)+_0x3448('0xc5');_0x3bf4d2+=_0x3448('0xae');}if(_0x559022>0x0){_0x3bf4d2+=_0x3448('0x96');_0x3bf4d2+=_0x3448('0xcf')+_0x2f0bcc[_0x3448('0xc9')][_0x1ddd54]+_0x3448('0xa4');_0x3bf4d2+=_0x3448('0xc4')+_0x559022[_0x3448('0xce')](0x2)+'\x20€';_0x3bf4d2+='';}_0x3bf4d2+=_0x3448('0x96');var _0x23ccbc;if(_0x1e2f04){_0x23ccbc=_0x504eee;}else{_0x23ccbc=_0x504eee+_0x559022;}_0x3bf4d2+=_0x3448('0xd0')+_0x2f0bcc[_0x3448('0xd1')][_0x1ddd54]+''+_0x23ccbc[_0x3448('0xce')](0x2)+_0x3448('0xc5');_0x3bf4d2+=_0x3448('0xd2');_0x3bf4d2+='';_0x3bf4d2+=_0x3448('0xd3');_0x3bf4d2+='';_0x3bf4d2+=_0x3448('0x96');_0x3bf4d2+=util[_0x3448('0x59')](_0x3448('0xd4'),_0x594d83['proforma'][_0x3448('0xca')][_0x3448('0xd5')](new RegExp(String[_0x3448('0xd6')](0xd),'g'),_0x3448('0xd7')));_0x3bf4d2+=_0x3448('0xae');_0x3bf4d2+=_0x3448('0x96');_0x3bf4d2+=_0x3448('0xaf');_0x3bf4d2+=_0x3448('0xd8')+_0x2f0bcc[_0x3448('0xd9')][_0x1ddd54]+_0x3448('0x64');if(!_[_0x3448('0xc7')](_0x594d83[_0x3448('0x5b')][_0x3448('0xda')])){_0x3bf4d2+=_0x3448('0xd8')+_0x2f0bcc['accountholder'][_0x1ddd54]+':\x20'+_0x594d83[_0x3448('0x5b')][_0x3448('0xda')]+_0x3448('0xdb');_0x3bf4d2+=''+_0x2f0bcc['bankname'][_0x1ddd54]+_0x3448('0xdc')+_0x594d83[_0x3448('0x5b')][_0x3448('0xdd')]+_0x3448('0xde');_0x3bf4d2+=_0x3448('0xd8')+_0x2f0bcc[_0x3448('0xdf')][_0x1ddd54]+_0x3448('0xdc')+_0x594d83[_0x3448('0x5b')][_0x3448('0xe0')]+',\x20'+_0x594d83[_0x3448('0x5b')][_0x3448('0xe1')]+_0x3448('0xe2')+_0x594d83['proforma'][_0x3448('0xe3')]+'\x20('+_0x594d83[_0x3448('0x5b')][_0x3448('0xe4')]+')'+_0x3448('0xdb');_0x3bf4d2+=_0x3448('0xd8')+_0x2f0bcc[_0x3448('0xe5')][_0x1ddd54]+'/'+_0x2f0bcc[_0x3448('0xe6')][_0x1ddd54]+_0x3448('0xdc')+_0x594d83[_0x3448('0x5b')][_0x3448('0xe7')]+'/'+_0x594d83[_0x3448('0x5b')][_0x3448('0xe8')]+'';_0x3bf4d2+=''+_0x2f0bcc[_0x3448('0xe9')][_0x1ddd54]+'/'+_0x2f0bcc[_0x3448('0xea')][_0x1ddd54]+_0x3448('0xdc')+_0x594d83['proforma'][_0x3448('0xeb')]+_0x3448('0xdb');_0x3bf4d2+=_0x3448('0xd8')+_0x2f0bcc['iban'][_0x1ddd54]+':\x20'+_0x594d83[_0x3448('0x5b')][_0x3448('0xec')]+_0x3448('0xdb');}if(!_[_0x3448('0xc7')](_0x594d83[_0x3448('0x5b')][_0x3448('0xed')])){_0x3bf4d2+=_0x3448('0xd8')+_0x2f0bcc[_0x3448('0xee')][_0x1ddd54]+_0x3448('0xdc')+_0x594d83[_0x3448('0x5b')][_0x3448('0xed')]+_0x3448('0xdb');}_0x3bf4d2+=_0x3448('0xd8')+_0x2f0bcc[_0x3448('0xef')][_0x1ddd54]+''+_0x94d13f+_0x3448('0xf0')+_0x2f0bcc[_0x3448('0xf1')][_0x1ddd54]+'';_0x3bf4d2+=_0x3448('0xa4');_0x3bf4d2+=_0x3448('0xae');if(_0x594d83[_0x3448('0x5b')][_0x3448('0xf2')]===0x1){_0x3bf4d2+=_0x3448('0x95')+_0x5cf3fe+_0x3448('0xf3');}_0x3bf4d2+='
';_0x3bf4d2+=_0x3448('0xf4');_0x3bf4d2+=_0x3448('0xf5');return new BPromise(function(_0x21708d,_0x4d9bd3){pdf['create'](_0x3bf4d2,_0x5c9320)[_0x3448('0xf6')](path[_0x3448('0x54')](_0x456e82,_0x363723),function(_0x23123e,_0x44175f){if(_0x23123e)return _0x4d9bd3(_0x23123e);_0x21708d(_0x44175f);});});});}})[_0x3448('0x26')](function(){if(_0x4926aa){console[_0x3448('0xf7')](_0x3448('0xf8'),_0x1b7d87,_0x363723);return _0x5dd19a[_0x3448('0xf9')](_0x1b7d87,_0x363723,function(_0xec238c){if(_0xec238c){console['log'](_0x3448('0xfa'),_0xec238c);}else{console[_0x3448('0xf7')](_0x3448('0xfb'),_0x456e82);rimraf(_0x456e82,function(){});}});}else{return _0x5dd19a[_0x3448('0x1b')](0xc8);}})[_0x3448('0x44')](handleError(_0x5dd19a,null));};function addCloneDetail(_0x56f576,_0x25efb7,_0x2fc6dc){console[_0x3448('0xf7')](_0x3448('0xfc'),_0x56f576);_0x56f576[_0x3448('0xfd')]=_0x25efb7;delete _0x56f576['id'];return db[_0x3448('0xfe')][_0x3448('0x49')](_0x56f576,{'transaction':_0x2fc6dc});}exports[_0x3448('0xff')]=function(_0x3051d9,_0x63bbf7,_0x3fa68f){var _0x1582f0;if(_0x3051d9[_0x3448('0x4a')]['id']){delete _0x3051d9[_0x3448('0x4a')]['id'];}console[_0x3448('0xf7')](_0x3448('0x100'),_0x3051d9[_0x3448('0x46')]['id']);return db[_0x3448('0x101')][_0x3448('0x102')](function(_0xe8908e){return db[_0x3448('0x2b')]['create'](_0x3051d9[_0x3448('0x4a')],{'transaction':_0xe8908e,'logging':console['log']})[_0x3448('0x26')](function(_0x2a4791){console['log'](_0x3448('0x103'),_0x2a4791);_0x1582f0=_0x2a4791;var _0x4ec163=_0x3051d9[_0x3448('0x46')]['id'];return db[_0x3448('0xfe')]['findAll']({'where':{'ProformaId':_0x4ec163},'raw':!![]});})[_0x3448('0x26')](function(_0x258d67){console['log'](_0x3448('0x104'),_0x258d67);if(_0x258d67[_0x3448('0x33')]>0x0){var _0x5e15e0=[];for(var _0x4a22a8=0x0;_0x4a22a8<_0x258d67['length'];_0x4a22a8++){_0x5e15e0[_0x3448('0x105')](addCloneDetail(_0x258d67[_0x4a22a8],_0x1582f0['id'],_0xe8908e));}return BPromise[_0x3448('0x106')](_0x5e15e0);}else{var _0x2272f5={'errors':[{'type':_0x3448('0x107'),'message':_0x3448('0x108')}]};throw _0x2272f5;}});})[_0x3448('0x26')](function(){return _0x63bbf7[_0x3448('0x1b')](0xc8);})[_0x3448('0x44')](function(_0x5dcc5f){console[_0x3448('0xf7')](_0x3448('0x109'),_0x5dcc5f);if(_0x5dcc5f[_0x3448('0x29')]===_0x3448('0x10a')){var _0x5dcc5f={'errors':[{'message':_0x3448('0x10b')}]};}_0x63bbf7[_0x3448('0x1d')](0x1f4)[_0x3448('0x10c')](_0x5dcc5f);});}; \ No newline at end of file diff --git a/server/api/saProforma/saProforma.model.js b/server/api/saProforma/saProforma.model.js index 243cd71..2acd85d 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 _0x8f1f=['api','moment','bluebird','request-promise','path','../../config/environment','./saProforma.attributes','SAProforma','../../config/logger'];(function(_0x5497bf,_0x406b3e){var _0x4c730c=function(_0x538245){while(--_0x538245){_0x5497bf['push'](_0x5497bf['shift']());}};_0x4c730c(++_0x406b3e);}(_0x8f1f,0x104));var _0xf8f1=function(_0x2abec0,_0x480ff3){_0x2abec0=_0x2abec0-0x0;var _0x4bf548=_0x8f1f[_0x2abec0];return _0x4bf548;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf8f1('0x0'))(_0xf8f1('0x1'));var moment=require(_0xf8f1('0x2'));var BPromise=require(_0xf8f1('0x3'));var rp=require(_0xf8f1('0x4'));var fs=require('fs');var path=require(_0xf8f1('0x5'));var rimraf=require('rimraf');var config=require(_0xf8f1('0x6'));var attributes=require(_0xf8f1('0x7'));module['exports']=function(_0xbea5b9,_0x3c952f){return _0xbea5b9['define'](_0xf8f1('0x8'),attributes,{'tableName':'sa_proformas','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc098=['rimraf','../../config/environment','./saProforma.attributes','exports','sa_proformas','../../config/logger','api','moment','bluebird'];(function(_0x225cac,_0x5ee6d7){var _0x218772=function(_0xb365bb){while(--_0xb365bb){_0x225cac['push'](_0x225cac['shift']());}};_0x218772(++_0x5ee6d7);}(_0xc098,0x71));var _0x8c09=function(_0x578ec3,_0x4c0daa){_0x578ec3=_0x578ec3-0x0;var _0x42eec6=_0xc098[_0x578ec3];return _0x42eec6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8c09('0x0'))(_0x8c09('0x1'));var moment=require(_0x8c09('0x2'));var BPromise=require(_0x8c09('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8c09('0x4'));var config=require(_0x8c09('0x5'));var attributes=require(_0x8c09('0x6'));module[_0x8c09('0x7')]=function(_0x236f5a,_0xcf5493){return _0x236f5a['define']('SAProforma',attributes,{'tableName':_0x8c09('0x8'),'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 2c9c251..9a3283c 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 _0x2c88=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','SAProforma,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','catch','lodash','util','moment','bluebird'];(function(_0x1347eb,_0x20e60d){var _0x1264c6=function(_0x1e936f){while(--_0x1e936f){_0x1347eb['push'](_0x1347eb['shift']());}};_0x1264c6(++_0x20e60d);}(_0x2c88,0x6f));var _0x82c8=function(_0x379df2,_0x2cc6a3){_0x379df2=_0x379df2-0x0;var _0x9336aa=_0x2c88[_0x379df2];return _0x9336aa;};'use strict';var _=require(_0x82c8('0x0'));var util=require(_0x82c8('0x1'));var moment=require(_0x82c8('0x2'));var BPromise=require(_0x82c8('0x3'));var rs=require(_0x82c8('0x4'));var fs=require('fs');var Redis=require(_0x82c8('0x5'));var db=require(_0x82c8('0x6'))['db'];var utils=require(_0x82c8('0x7'));var logger=require(_0x82c8('0x8'))(_0x82c8('0x9'));var config=require('../../config/environment');var jayson=require(_0x82c8('0xa'));var client=jayson[_0x82c8('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d325a,_0x3cb76c,_0x36a659){return new BPromise(function(_0x25c363,_0x572fb9){return client[_0x82c8('0xc')](_0x4d325a,_0x36a659)[_0x82c8('0xd')](function(_0x323b8f){logger[_0x82c8('0xe')](_0x82c8('0xf'),_0x3cb76c,'request\x20sent');logger[_0x82c8('0x10')]('SAProforma,\x20%s,\x20%s,\x20%s',_0x3cb76c,'request\x20sent',JSON[_0x82c8('0x11')](_0x323b8f));if(_0x323b8f[_0x82c8('0x12')]){if(_0x323b8f[_0x82c8('0x12')][_0x82c8('0x13')]===0x1f4){logger[_0x82c8('0x12')]('SAProforma,\x20%s,\x20%s',_0x3cb76c,_0x323b8f[_0x82c8('0x12')][_0x82c8('0x14')]);return _0x572fb9(_0x323b8f[_0x82c8('0x12')]['message']);}logger[_0x82c8('0x12')](_0x82c8('0xf'),_0x3cb76c,_0x323b8f[_0x82c8('0x12')][_0x82c8('0x14')]);return _0x25c363(_0x323b8f[_0x82c8('0x12')][_0x82c8('0x14')]);}else{logger['info'](_0x82c8('0xf'),_0x3cb76c,_0x82c8('0x15'));_0x25c363(_0x323b8f['result'][_0x82c8('0x14')]);}})[_0x82c8('0x16')](function(_0x1e39f9){logger[_0x82c8('0x12')]('SAProforma,\x20%s,\x20%s',_0x3cb76c,_0x1e39f9);_0x572fb9(_0x1e39f9);});});} \ No newline at end of file +var _0xf37a=['request','info','SAProforma,\x20%s,\x20%s','request\x20sent','debug','SAProforma,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x3b7f0b,_0x3a0932){var _0x37f7ff=function(_0x517685){while(--_0x517685){_0x3b7f0b['push'](_0x3b7f0b['shift']());}};_0x37f7ff(++_0x3a0932);}(_0xf37a,0xd3));var _0xaf37=function(_0x323f11,_0x52005c){_0x323f11=_0x323f11-0x0;var _0x2bc6eb=_0xf37a[_0x323f11];return _0x2bc6eb;};'use strict';var _=require(_0xaf37('0x0'));var util=require('util');var moment=require(_0xaf37('0x1'));var BPromise=require(_0xaf37('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaf37('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xaf37('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xaf37('0x5'));var jayson=require(_0xaf37('0x6'));var client=jayson[_0xaf37('0x7')][_0xaf37('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5b1c01,_0x5ca79a,_0x50b352){return new BPromise(function(_0x1aab49,_0x2e28e2){return client[_0xaf37('0x9')](_0x5b1c01,_0x50b352)['then'](function(_0x47a491){logger[_0xaf37('0xa')](_0xaf37('0xb'),_0x5ca79a,_0xaf37('0xc'));logger[_0xaf37('0xd')](_0xaf37('0xe'),_0x5ca79a,_0xaf37('0xc'),JSON[_0xaf37('0xf')](_0x47a491));if(_0x47a491['error']){if(_0x47a491[_0xaf37('0x10')][_0xaf37('0x11')]===0x1f4){logger[_0xaf37('0x10')](_0xaf37('0xb'),_0x5ca79a,_0x47a491[_0xaf37('0x10')][_0xaf37('0x12')]);return _0x2e28e2(_0x47a491['error']['message']);}logger[_0xaf37('0x10')](_0xaf37('0xb'),_0x5ca79a,_0x47a491['error'][_0xaf37('0x12')]);return _0x1aab49(_0x47a491['error'][_0xaf37('0x12')]);}else{logger['info'](_0xaf37('0xb'),_0x5ca79a,_0xaf37('0xc'));_0x1aab49(_0x47a491['result']['message']);}})[_0xaf37('0x13')](function(_0x2f2455){logger[_0xaf37('0x10')](_0xaf37('0xb'),_0x5ca79a,_0x2f2455);_0x2e28e2(_0x2f2455);});});} \ No newline at end of file diff --git a/server/api/saProformaDetail/index.js b/server/api/saProformaDetail/index.js index 8c9e755..8facda8 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 _0xb7e7=['post','create','/:id/automaticProformaInvoice','automaticProformaInvoice','put','update','delete','destroy','exports','multer','path','express','../../components/auth/service','../../config/environment','./saProformaDetail.controller','get','/describe','isAuthenticated','/:id','show'];(function(_0x47d1db,_0x39cbcf){var _0x591605=function(_0x121a91){while(--_0x121a91){_0x47d1db['push'](_0x47d1db['shift']());}};_0x591605(++_0x39cbcf);}(_0xb7e7,0x121));var _0x7b7e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xb7e7[_0x43d11d];return _0x38cd08;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var auth=require(_0x7b7e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7b7e('0x4'));var controller=require(_0x7b7e('0x5'));router[_0x7b7e('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7b7e('0x6')](_0x7b7e('0x7'),auth[_0x7b7e('0x8')](),controller['describe']);router[_0x7b7e('0x6')](_0x7b7e('0x9'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0xb')]('/',auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xc')]);router['post'](_0x7b7e('0xd'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xe')]);router[_0x7b7e('0xf')](_0x7b7e('0x9'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0x10')]);router[_0x7b7e('0x11')](_0x7b7e('0x9'),auth['isAuthenticated'](),controller[_0x7b7e('0x12')]);module[_0x7b7e('0x13')]=router; \ No newline at end of file +var _0xda3f=['delete','exports','util','path','../../components/auth/service','../../config/environment','./saProformaDetail.controller','isAuthenticated','index','describe','get','/:id','show','post','create','/:id/automaticProformaInvoice','put','update'];(function(_0x41c0b4,_0x104bc2){var _0x4dd338=function(_0x3df4e7){while(--_0x3df4e7){_0x41c0b4['push'](_0x41c0b4['shift']());}};_0x4dd338(++_0x104bc2);}(_0xda3f,0xec));var _0xfda3=function(_0x3bfbdc,_0x55a065){_0x3bfbdc=_0x3bfbdc-0x0;var _0x5ba84a=_0xda3f[_0x3bfbdc];return _0x5ba84a;};'use strict';var multer=require('multer');var util=require(_0xfda3('0x0'));var path=require(_0xfda3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xfda3('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xfda3('0x3'));var controller=require(_0xfda3('0x4'));router['get']('/',auth[_0xfda3('0x5')](),controller[_0xfda3('0x6')]);router['get']('/describe',auth[_0xfda3('0x5')](),controller[_0xfda3('0x7')]);router[_0xfda3('0x8')](_0xfda3('0x9'),auth[_0xfda3('0x5')](),controller[_0xfda3('0xa')]);router[_0xfda3('0xb')]('/',auth[_0xfda3('0x5')](),controller[_0xfda3('0xc')]);router[_0xfda3('0xb')](_0xfda3('0xd'),auth[_0xfda3('0x5')](),controller['automaticProformaInvoice']);router[_0xfda3('0xe')](_0xfda3('0x9'),auth[_0xfda3('0x5')](),controller[_0xfda3('0xf')]);router[_0xfda3('0x10')]('/:id',auth[_0xfda3('0x5')](),controller['destroy']);module[_0xfda3('0x11')]=router; \ No newline at end of file diff --git a/server/api/saProformaDetail/saProformaDetail.attributes.js b/server/api/saProformaDetail/saProformaDetail.attributes.js index 821c1c4..c8aec9a 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 _0xa901=['long','\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci','DECIMAL','exports','STRING','INTEGER','TEXT'];(function(_0xdd0fbe,_0x25baf4){var _0x30c5c3=function(_0xb7c771){while(--_0xb7c771){_0xdd0fbe['push'](_0xdd0fbe['shift']());}};_0x30c5c3(++_0x25baf4);}(_0xa901,0x65));var _0x1a90=function(_0x2ce23b,_0x318293){_0x2ce23b=_0x2ce23b-0x0;var _0x560f04=_0xa901[_0x2ce23b];return _0x560f04;};'use strict';var Sequelize=require('sequelize');module[_0x1a90('0x0')]={'companyName':{'type':Sequelize[_0x1a90('0x1')],'allowNull':![]},'companyId':{'type':Sequelize[_0x1a90('0x2')],'allowNull':![]},'productName':{'type':Sequelize[_0x1a90('0x3')],'allowNull':![]},'productCode':{'type':Sequelize['STRING'],'allowNull':![]},'productDescription':{'type':Sequelize[_0x1a90('0x3')](_0x1a90('0x4'))+_0x1a90('0x5')},'typeName':{'type':Sequelize['STRING'],'allowNull':![]},'unitName':{'type':Sequelize[_0x1a90('0x1')]},'pricelistName':{'type':Sequelize['TEXT'],'allowNull':![]},'priceListId':{'type':Sequelize[_0x1a90('0x2')],'allowNull':![]},'netPrice':{'type':Sequelize[_0x1a90('0x6')](0xd,0x4),'allowNull':![]},'discount':{'type':Sequelize[_0x1a90('0x6')](0x6,0x3),'allowNull':![]},'tax':{'type':Sequelize['DECIMAL'](0xd,0x4),'allowNull':![]},'agentFullname':{'type':Sequelize[_0x1a90('0x1')],'allowNull':![]},'note':{'type':Sequelize[_0x1a90('0x3')]},'subscriptionId':{'type':Sequelize[_0x1a90('0x2')],'allowNull':![]},'subscriptionName':{'type':Sequelize['STRING'],'allowNull':![]},'subscriptionMonthly':{'type':Sequelize[_0x1a90('0x2')],'allowNull':![]},'quantity':{'type':Sequelize[_0x1a90('0x6')](0xd,0x4),'allowNull':![]},'ProductQuotationId':{'type':Sequelize[_0x1a90('0x2')]}}; \ No newline at end of file +var _0x6003=['sequelize','exports','STRING','INTEGER','TEXT','long','\x20CHARSET\x20utf8mb4\x20COLLATE\x20utf8mb4_unicode_ci','DECIMAL'];(function(_0xe39862,_0xe7725a){var _0x256e8b=function(_0x9e723e){while(--_0x9e723e){_0xe39862['push'](_0xe39862['shift']());}};_0x256e8b(++_0xe7725a);}(_0x6003,0x1e0));var _0x3600=function(_0x48fbf,_0x1ab06a){_0x48fbf=_0x48fbf-0x0;var _0x217e13=_0x6003[_0x48fbf];return _0x217e13;};'use strict';var Sequelize=require(_0x3600('0x0'));module[_0x3600('0x1')]={'companyName':{'type':Sequelize[_0x3600('0x2')],'allowNull':![]},'companyId':{'type':Sequelize[_0x3600('0x3')],'allowNull':![]},'productName':{'type':Sequelize['TEXT'],'allowNull':![]},'productCode':{'type':Sequelize[_0x3600('0x2')],'allowNull':![]},'productDescription':{'type':Sequelize[_0x3600('0x4')](_0x3600('0x5'))+_0x3600('0x6')},'typeName':{'type':Sequelize['STRING'],'allowNull':![]},'unitName':{'type':Sequelize['STRING']},'pricelistName':{'type':Sequelize[_0x3600('0x4')],'allowNull':![]},'priceListId':{'type':Sequelize[_0x3600('0x3')],'allowNull':![]},'netPrice':{'type':Sequelize[_0x3600('0x7')](0xd,0x4),'allowNull':![]},'discount':{'type':Sequelize[_0x3600('0x7')](0x6,0x3),'allowNull':![]},'tax':{'type':Sequelize[_0x3600('0x7')](0xd,0x4),'allowNull':![]},'agentFullname':{'type':Sequelize[_0x3600('0x2')],'allowNull':![]},'note':{'type':Sequelize[_0x3600('0x4')]},'subscriptionId':{'type':Sequelize[_0x3600('0x3')],'allowNull':![]},'subscriptionName':{'type':Sequelize[_0x3600('0x2')],'allowNull':![]},'subscriptionMonthly':{'type':Sequelize[_0x3600('0x3')],'allowNull':![]},'quantity':{'type':Sequelize[_0x3600('0x7')](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 8a8a6a3..523349c 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 _0x3558=['send','index','SAProformaDetail','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','map','options','count','includeAll','include','findAll','rows','show','params','rawAttributes','merge','find','catch','create','body','log','addProformaInvoiceDetail->>','companyName','companyId','productCode','productDescription','typeName','pricelistName','priceListId','discount','tax','agentFullname','note','subscriptionId','subscriptionName','subscriptionMonthly','quantity','ProformaId','sequelize','transaction','SAInvoice','push','all','WARNING','No\x20product\x20to\x20assign\x20invoice.\x20Invoice\x20not\x20created!!\x20','name','SequelizeUniqueConstraintError','Duplicate\x20entry.','html-pdf','eml-format','request-promise','bluebird','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','limit','json','apply','reject','save','update','then','destroy','error','stack'];(function(_0x5d43c6,_0x1638c8){var _0x305aed=function(_0x4a393f){while(--_0x4a393f){_0x5d43c6['push'](_0x5d43c6['shift']());}};_0x305aed(++_0x1638c8);}(_0x3558,0x157));var _0x8355=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0x3558[_0x36ed3c];return _0x52a2e0;};'use strict';var pdf=require(_0x8355('0x0'));var emlformat=require(_0x8355('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8355('0x2'));var moment=require('moment');var BPromise=require(_0x8355('0x3'));var Mustache=require('mustache');var util=require(_0x8355('0x4'));var path=require(_0x8355('0x5'));var sox=require(_0x8355('0x6'));var csv=require(_0x8355('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8355('0x8'));var squel=require(_0x8355('0x9'));var crypto=require(_0x8355('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x8355('0xb'));var toCsv=require('to-csv');var querystring=require(_0x8355('0xc'));var Papa=require(_0x8355('0xd'));var Redis=require(_0x8355('0xe'));var authService=require(_0x8355('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x8355('0x10'));var logger=require('../../config/logger')(_0x8355('0x11'));var utils=require('../../config/utils');var config=require(_0x8355('0x12'));var db=require(_0x8355('0x13'))['db'];function respondWithStatusCode(_0x2735f3,_0x4a6852){_0x4a6852=_0x4a6852||0xcc;return function(_0x955ab4){if(_0x955ab4){return _0x2735f3[_0x8355('0x14')](_0x4a6852);}return _0x2735f3[_0x8355('0x15')](_0x4a6852)[_0x8355('0x16')]();};}function respondWithResult(_0x22e7e7,_0x3ce557){_0x3ce557=_0x3ce557||0xc8;return function(_0x51d494){if(_0x51d494){return _0x22e7e7[_0x8355('0x15')](_0x3ce557)['json'](_0x51d494);}};}function respondWithFilteredResult(_0x36c663,_0x1e22aa){return function(_0x25cb86){if(_0x25cb86){var _0x3f8e3c=_0x25cb86['count'],_0x23d53b=_0x1e22aa['offset'],_0x24ce55=_0x1e22aa['offset']+_0x1e22aa[_0x8355('0x17')],_0xb2263;if(_0x24ce55>=_0x3f8e3c){_0x24ce55=_0x3f8e3c;_0xb2263=0xc8;}else{_0xb2263=0xce;}_0x36c663[_0x8355('0x15')](_0xb2263);return _0x36c663['set']('Content-Range',_0x23d53b+'-'+_0x24ce55+'/'+_0x3f8e3c)[_0x8355('0x18')](_0x25cb86);}return null;};}function patchUpdates(_0x534b61){return function(_0x112cbc){try{jsonpatch[_0x8355('0x19')](_0x112cbc,_0x534b61,!![]);}catch(_0x3a8784){return BPromise[_0x8355('0x1a')](_0x3a8784);}return _0x112cbc[_0x8355('0x1b')]();};}function saveUpdates(_0xcd779,_0x3de862){return function(_0x252e48){if(_0x252e48){return _0x252e48[_0x8355('0x1c')](_0xcd779)[_0x8355('0x1d')](function(_0x38750f){return _0x38750f;});}return null;};}function removeEntity(_0x18adc8,_0x383dcc){return function(_0x818977){if(_0x818977){return _0x818977[_0x8355('0x1e')]()['then'](function(){_0x18adc8[_0x8355('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x552986,_0x1e622f){return function(_0x1d7922){if(!_0x1d7922){_0x552986[_0x8355('0x14')](0x194);}return _0x1d7922;};}function handleError(_0x1d4ab1,_0x464481){_0x464481=_0x464481||0x1f4;return function(_0x9ed057){logger[_0x8355('0x1f')](_0x9ed057[_0x8355('0x20')]);if(_0x9ed057['name']){delete _0x9ed057['name'];}_0x1d4ab1[_0x8355('0x15')](_0x464481)[_0x8355('0x21')](_0x9ed057);};}exports[_0x8355('0x22')]=function(_0x1f7aa6,_0x434f50){var _0x45965d={},_0x2553d5={},_0x13e20b={'count':0x0,'rows':[]};var _0x26d178=db[_0x8355('0x23')]['rawAttributes'];_0x2553d5['model']=_['keys'](_0x26d178);_0x2553d5[_0x8355('0x24')]=_['keys'](_0x1f7aa6[_0x8355('0x24')]);_0x2553d5[_0x8355('0x25')]=_[_0x8355('0x26')](_0x2553d5[_0x8355('0x27')],_0x2553d5[_0x8355('0x24')]);_0x45965d[_0x8355('0x28')]=_[_0x8355('0x26')](_0x2553d5[_0x8355('0x27')],qs['fields'](_0x1f7aa6[_0x8355('0x24')][_0x8355('0x29')]));_0x45965d[_0x8355('0x28')]=_0x45965d[_0x8355('0x28')][_0x8355('0x2a')]?_0x45965d[_0x8355('0x28')]:_0x2553d5[_0x8355('0x27')];if(!_0x1f7aa6[_0x8355('0x24')][_0x8355('0x2b')](_0x8355('0x2c'))){_0x45965d['limit']=qs[_0x8355('0x17')](_0x1f7aa6[_0x8355('0x24')][_0x8355('0x17')]);_0x45965d[_0x8355('0x2d')]=qs[_0x8355('0x2d')](_0x1f7aa6[_0x8355('0x24')][_0x8355('0x2d')]);}_0x45965d[_0x8355('0x2e')]=qs[_0x8355('0x2f')](_0x1f7aa6[_0x8355('0x24')][_0x8355('0x2f')]);_0x45965d[_0x8355('0x30')]=qs['filters'](_[_0x8355('0x31')](_0x1f7aa6[_0x8355('0x24')],_0x2553d5[_0x8355('0x25')]));if(_0x1f7aa6[_0x8355('0x24')][_0x8355('0x32')]){_0x45965d[_0x8355('0x30')]=_['merge'](_0x45965d['where'],{'$or':_[_0x8355('0x33')](_0x26d178,function(_0x2cce78){if(_0x2cce78['type']['key']!=='VIRTUAL'){var _0x40fd3e={};_0x40fd3e[_0x2cce78['field']]={'$like':'%'+_0x1f7aa6[_0x8355('0x24')][_0x8355('0x32')]+'%'};return _0x40fd3e;}})});}_0x45965d=_['merge']({},_0x45965d,_0x1f7aa6[_0x8355('0x34')]);var _0x58eb65={'where':_0x45965d[_0x8355('0x30')]};return db[_0x8355('0x23')][_0x8355('0x35')](_0x58eb65)[_0x8355('0x1d')](function(_0x41b207){_0x13e20b['count']=_0x41b207;if(_0x1f7aa6[_0x8355('0x24')][_0x8355('0x36')]){_0x45965d[_0x8355('0x37')]=[{'all':!![]}];}return db[_0x8355('0x23')][_0x8355('0x38')](_0x45965d);})[_0x8355('0x1d')](function(_0x565d22){_0x13e20b[_0x8355('0x39')]=_0x565d22;return _0x13e20b;})[_0x8355('0x1d')](respondWithFilteredResult(_0x434f50,_0x45965d))['catch'](handleError(_0x434f50,null));};exports[_0x8355('0x3a')]=function(_0x2fd498,_0x3714c2){var _0x3db5ca={'raw':![],'where':{'id':_0x2fd498[_0x8355('0x3b')]['id']}},_0x8c8ca={};_0x8c8ca[_0x8355('0x27')]=_['keys'](db[_0x8355('0x23')][_0x8355('0x3c')]);_0x8c8ca[_0x8355('0x24')]=_['keys'](_0x2fd498['query']);_0x8c8ca['filters']=_['intersection'](_0x8c8ca[_0x8355('0x27')],_0x8c8ca['query']);_0x3db5ca[_0x8355('0x28')]=_[_0x8355('0x26')](_0x8c8ca['model'],qs[_0x8355('0x29')](_0x2fd498['query'][_0x8355('0x29')]));_0x3db5ca[_0x8355('0x28')]=_0x3db5ca['attributes'][_0x8355('0x2a')]?_0x3db5ca[_0x8355('0x28')]:_0x8c8ca[_0x8355('0x27')];if(_0x2fd498[_0x8355('0x24')]['includeAll']){_0x3db5ca[_0x8355('0x37')]=[{'all':!![]}];}_0x3db5ca=_[_0x8355('0x3d')]({},_0x3db5ca,_0x2fd498[_0x8355('0x34')]);return db[_0x8355('0x23')][_0x8355('0x3e')](_0x3db5ca)[_0x8355('0x1d')](handleEntityNotFound(_0x3714c2,null))['then'](respondWithResult(_0x3714c2,null))[_0x8355('0x3f')](handleError(_0x3714c2,null));};exports[_0x8355('0x40')]=function(_0x49d60b,_0x3a93aa){return db['SAProformaDetail'][_0x8355('0x40')](_0x49d60b[_0x8355('0x41')],{})[_0x8355('0x1d')](respondWithResult(_0x3a93aa,0xc9))[_0x8355('0x3f')](handleError(_0x3a93aa,null));};exports['update']=function(_0x1f8d3b,_0x59cc36){if(_0x1f8d3b[_0x8355('0x41')]['id']){delete _0x1f8d3b[_0x8355('0x41')]['id'];}return db[_0x8355('0x23')]['find']({'where':{'id':_0x1f8d3b[_0x8355('0x3b')]['id']}})['then'](handleEntityNotFound(_0x59cc36,null))[_0x8355('0x1d')](saveUpdates(_0x1f8d3b[_0x8355('0x41')],null))[_0x8355('0x1d')](respondWithResult(_0x59cc36,null))['catch'](handleError(_0x59cc36,null));};exports[_0x8355('0x1e')]=function(_0x1b9944,_0x1fd9e7){return db[_0x8355('0x23')][_0x8355('0x3e')]({'where':{'id':_0x1b9944['params']['id']}})[_0x8355('0x1d')](handleEntityNotFound(_0x1fd9e7,null))[_0x8355('0x1d')](removeEntity(_0x1fd9e7,null))[_0x8355('0x3f')](handleError(_0x1fd9e7,null));};exports['describe']=function(_0x2bbefd,_0x5edf83){return db[_0x8355('0x23')]['describe']()['then'](respondWithResult(_0x5edf83,null))[_0x8355('0x3f')](handleError(_0x5edf83,null));};function addProformaInvoiceDetail(_0xf38ead,_0x3397a4,_0x3cfb39){console[_0x8355('0x42')](_0x8355('0x43'),_0xf38ead);var _0x35266e={'companyName':_0xf38ead[_0x8355('0x44')],'companyId':_0xf38ead[_0x8355('0x45')],'productName':_0xf38ead['productName'],'productCode':_0xf38ead[_0x8355('0x46')],'productDescription':_0xf38ead[_0x8355('0x47')],'typeName':_0xf38ead[_0x8355('0x48')],'pricelistName':_0xf38ead[_0x8355('0x49')],'priceListId':_0xf38ead[_0x8355('0x4a')],'netPrice':_0xf38ead['netPrice'],'discount':_0xf38ead[_0x8355('0x4b')],'tax':_0xf38ead[_0x8355('0x4c')],'agentFullname':_0xf38ead[_0x8355('0x4d')],'note':_0xf38ead[_0x8355('0x4e')],'subscriptionId':_0xf38ead[_0x8355('0x4f')],'subscriptionName':_0xf38ead[_0x8355('0x50')],'subscriptionMonthly':_0xf38ead[_0x8355('0x51')],'quantity':_0xf38ead[_0x8355('0x52')],'InvoiceId':_0x3397a4};return db['SAInvoiceDetail'][_0x8355('0x40')](_0x35266e,{'transaction':_0x3cfb39})[_0x8355('0x1d')](function(){return db['SAProductQuotation']['update']({'InvoiceId':_0x3397a4},{'where':{'ProductPriceListId':_0xf38ead['priceListId'],'productCode':_0xf38ead[_0x8355('0x46')],'ProformaId':_0xf38ead[_0x8355('0x53')]},'transaction':_0x3cfb39});});}exports['automaticProformaInvoice']=function(_0x3ec5c2,_0x428c54,_0x4177e2){var _0x2ecd45;if(_0x3ec5c2[_0x8355('0x41')]['id']){delete _0x3ec5c2[_0x8355('0x41')]['id'];}console[_0x8355('0x42')](_0x3ec5c2);return db[_0x8355('0x54')][_0x8355('0x55')](function(_0x19c6c7){return db[_0x8355('0x56')][_0x8355('0x40')](_0x3ec5c2[_0x8355('0x41')],{'transaction':_0x19c6c7,'logging':console['log']})[_0x8355('0x1d')](function(_0x5028a3){_0x2ecd45=_0x5028a3;var _0x49d1c8=_0x3ec5c2[_0x8355('0x3b')]['id'];return db[_0x8355('0x23')][_0x8355('0x38')]({'where':{'ProformaId':_0x49d1c8},'raw':!![],'logging':console['log']});})['then'](function(_0x216b56){if(_0x216b56[_0x8355('0x2a')]>0x0){var _0x4fcf22=[];for(var _0x5454cb=0x0;_0x5454cb<_0x216b56[_0x8355('0x2a')];_0x5454cb++){_0x4fcf22[_0x8355('0x57')](addProformaInvoiceDetail(_0x216b56[_0x5454cb],_0x2ecd45['id'],_0x19c6c7));}return BPromise[_0x8355('0x58')](_0x4fcf22);}else{var _0x2108aa={'errors':[{'type':_0x8355('0x59'),'message':_0x8355('0x5a')}]};throw _0x2108aa;}});})[_0x8355('0x1d')](function(){return _0x428c54['sendStatus'](0xc8);})['catch'](function(_0x201c9b){console[_0x8355('0x42')]('TCL:\x20exports.automaticProformaInvoice\x20->\x20err',_0x201c9b);if(_0x201c9b[_0x8355('0x5b')]===_0x8355('0x5c')){var _0x201c9b={'errors':[{'message':_0x8355('0x5d')}]};}_0x428c54['status'](0x1f4)[_0x8355('0x21')](_0x201c9b);});}; \ No newline at end of file +var _0xbdfd=['catch','create','body','describe','addProformaInvoiceDetail->>','companyName','companyId','productName','productDescription','typeName','priceListId','netPrice','discount','tax','note','subscriptionId','quantity','SAInvoiceDetail','log','sequelize','transaction','SAInvoice','push','all','No\x20product\x20to\x20assign\x20invoice.\x20Invoice\x20not\x20created!!\x20','TCL:\x20exports.automaticProformaInvoice\x20->\x20err','SequelizeUniqueConstraintError','Duplicate\x20entry.','send','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','count','offset','status','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','index','SAProformaDetail','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','filter','merge','map','type','VIRTUAL','includeAll','include','findAll','rows','params','rawAttributes','options','find'];(function(_0x585777,_0x2b3e12){var _0x3be3a9=function(_0x4f5cb0){while(--_0x4f5cb0){_0x585777['push'](_0x585777['shift']());}};_0x3be3a9(++_0x2b3e12);}(_0xbdfd,0x13d));var _0xdbdf=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xbdfd[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xdbdf('0x0'));var zipdir=require(_0xdbdf('0x1'));var jsonpatch=require(_0xdbdf('0x2'));var rp=require(_0xdbdf('0x3'));var moment=require(_0xdbdf('0x4'));var BPromise=require(_0xdbdf('0x5'));var Mustache=require(_0xdbdf('0x6'));var util=require(_0xdbdf('0x7'));var path=require('path');var sox=require(_0xdbdf('0x8'));var csv=require(_0xdbdf('0x9'));var ejs=require(_0xdbdf('0xa'));var fs=require('fs');var _=require(_0xdbdf('0xb'));var squel=require(_0xdbdf('0xc'));var crypto=require(_0xdbdf('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xdbdf('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdbdf('0xf'));var Papa=require('papaparse');var Redis=require(_0xdbdf('0x10'));var authService=require(_0xdbdf('0x11'));var qs=require(_0xdbdf('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdbdf('0x13'))(_0xdbdf('0x14'));var utils=require(_0xdbdf('0x15'));var config=require(_0xdbdf('0x16'));var db=require(_0xdbdf('0x17'))['db'];function respondWithStatusCode(_0x71bf86,_0x2348b6){_0x2348b6=_0x2348b6||0xcc;return function(_0x29a9b1){if(_0x29a9b1){return _0x71bf86[_0xdbdf('0x18')](_0x2348b6);}return _0x71bf86['status'](_0x2348b6)['end']();};}function respondWithResult(_0x3adee3,_0x114d91){_0x114d91=_0x114d91||0xc8;return function(_0x3e963f){if(_0x3e963f){return _0x3adee3['status'](_0x114d91)['json'](_0x3e963f);}};}function respondWithFilteredResult(_0x3dd3d3,_0x136e4b){return function(_0x4f6283){if(_0x4f6283){var _0x2db5a0=_0x4f6283[_0xdbdf('0x19')],_0x2902ff=_0x136e4b[_0xdbdf('0x1a')],_0x3b82a7=_0x136e4b[_0xdbdf('0x1a')]+_0x136e4b['limit'],_0x414df5;if(_0x3b82a7>=_0x2db5a0){_0x3b82a7=_0x2db5a0;_0x414df5=0xc8;}else{_0x414df5=0xce;}_0x3dd3d3[_0xdbdf('0x1b')](_0x414df5);return _0x3dd3d3[_0xdbdf('0x1c')](_0xdbdf('0x1d'),_0x2902ff+'-'+_0x3b82a7+'/'+_0x2db5a0)['json'](_0x4f6283);}return null;};}function patchUpdates(_0x178ceb){return function(_0x3b6d29){try{jsonpatch[_0xdbdf('0x1e')](_0x3b6d29,_0x178ceb,!![]);}catch(_0x359dec){return BPromise[_0xdbdf('0x1f')](_0x359dec);}return _0x3b6d29[_0xdbdf('0x20')]();};}function saveUpdates(_0x4b0561,_0x265d39){return function(_0x3e0648){if(_0x3e0648){return _0x3e0648[_0xdbdf('0x21')](_0x4b0561)['then'](function(_0x482713){return _0x482713;});}return null;};}function removeEntity(_0x31694b,_0x3601c7){return function(_0x2ea8ba){if(_0x2ea8ba){return _0x2ea8ba['destroy']()[_0xdbdf('0x22')](function(){_0x31694b['status'](0xcc)[_0xdbdf('0x23')]();});}};}function handleEntityNotFound(_0x3a3299,_0x511196){return function(_0x4be3eb){if(!_0x4be3eb){_0x3a3299[_0xdbdf('0x18')](0x194);}return _0x4be3eb;};}function handleError(_0x98ee68,_0x1a2dd1){_0x1a2dd1=_0x1a2dd1||0x1f4;return function(_0x3eb5a3){logger[_0xdbdf('0x24')](_0x3eb5a3[_0xdbdf('0x25')]);if(_0x3eb5a3[_0xdbdf('0x26')]){delete _0x3eb5a3[_0xdbdf('0x26')];}_0x98ee68['status'](_0x1a2dd1)['send'](_0x3eb5a3);};}exports[_0xdbdf('0x27')]=function(_0x57b2db,_0x1ffd74){var _0x4e6386={},_0x15548b={},_0x4d6c0e={'count':0x0,'rows':[]};var _0x31b78f=db[_0xdbdf('0x28')]['rawAttributes'];_0x15548b[_0xdbdf('0x29')]=_[_0xdbdf('0x2a')](_0x31b78f);_0x15548b['query']=_[_0xdbdf('0x2a')](_0x57b2db[_0xdbdf('0x2b')]);_0x15548b[_0xdbdf('0x2c')]=_[_0xdbdf('0x2d')](_0x15548b['model'],_0x15548b['query']);_0x4e6386[_0xdbdf('0x2e')]=_['intersection'](_0x15548b[_0xdbdf('0x29')],qs[_0xdbdf('0x2f')](_0x57b2db['query'][_0xdbdf('0x2f')]));_0x4e6386[_0xdbdf('0x2e')]=_0x4e6386[_0xdbdf('0x2e')][_0xdbdf('0x30')]?_0x4e6386[_0xdbdf('0x2e')]:_0x15548b[_0xdbdf('0x29')];if(!_0x57b2db[_0xdbdf('0x2b')]['hasOwnProperty'](_0xdbdf('0x31'))){_0x4e6386['limit']=qs['limit'](_0x57b2db[_0xdbdf('0x2b')][_0xdbdf('0x32')]);_0x4e6386['offset']=qs[_0xdbdf('0x1a')](_0x57b2db[_0xdbdf('0x2b')][_0xdbdf('0x1a')]);}_0x4e6386[_0xdbdf('0x33')]=qs[_0xdbdf('0x34')](_0x57b2db[_0xdbdf('0x2b')][_0xdbdf('0x34')]);_0x4e6386[_0xdbdf('0x35')]=qs[_0xdbdf('0x2c')](_['pick'](_0x57b2db[_0xdbdf('0x2b')],_0x15548b[_0xdbdf('0x2c')]));if(_0x57b2db[_0xdbdf('0x2b')][_0xdbdf('0x36')]){_0x4e6386[_0xdbdf('0x35')]=_[_0xdbdf('0x37')](_0x4e6386[_0xdbdf('0x35')],{'$or':_[_0xdbdf('0x38')](_0x31b78f,function(_0x32e467){if(_0x32e467[_0xdbdf('0x39')]['key']!==_0xdbdf('0x3a')){var _0x850486={};_0x850486[_0x32e467['field']]={'$like':'%'+_0x57b2db[_0xdbdf('0x2b')][_0xdbdf('0x36')]+'%'};return _0x850486;}})});}_0x4e6386=_['merge']({},_0x4e6386,_0x57b2db['options']);var _0x1d4f9c={'where':_0x4e6386['where']};return db[_0xdbdf('0x28')][_0xdbdf('0x19')](_0x1d4f9c)[_0xdbdf('0x22')](function(_0x417aee){_0x4d6c0e[_0xdbdf('0x19')]=_0x417aee;if(_0x57b2db[_0xdbdf('0x2b')][_0xdbdf('0x3b')]){_0x4e6386[_0xdbdf('0x3c')]=[{'all':!![]}];}return db['SAProformaDetail'][_0xdbdf('0x3d')](_0x4e6386);})['then'](function(_0x541586){_0x4d6c0e[_0xdbdf('0x3e')]=_0x541586;return _0x4d6c0e;})[_0xdbdf('0x22')](respondWithFilteredResult(_0x1ffd74,_0x4e6386))['catch'](handleError(_0x1ffd74,null));};exports['show']=function(_0x578d10,_0x4eda03){var _0x2c8d3a={'raw':![],'where':{'id':_0x578d10[_0xdbdf('0x3f')]['id']}},_0x46ec6e={};_0x46ec6e['model']=_['keys'](db[_0xdbdf('0x28')][_0xdbdf('0x40')]);_0x46ec6e[_0xdbdf('0x2b')]=_[_0xdbdf('0x2a')](_0x578d10['query']);_0x46ec6e[_0xdbdf('0x2c')]=_['intersection'](_0x46ec6e[_0xdbdf('0x29')],_0x46ec6e['query']);_0x2c8d3a[_0xdbdf('0x2e')]=_[_0xdbdf('0x2d')](_0x46ec6e['model'],qs[_0xdbdf('0x2f')](_0x578d10[_0xdbdf('0x2b')]['fields']));_0x2c8d3a[_0xdbdf('0x2e')]=_0x2c8d3a[_0xdbdf('0x2e')]['length']?_0x2c8d3a[_0xdbdf('0x2e')]:_0x46ec6e[_0xdbdf('0x29')];if(_0x578d10[_0xdbdf('0x2b')][_0xdbdf('0x3b')]){_0x2c8d3a[_0xdbdf('0x3c')]=[{'all':!![]}];}_0x2c8d3a=_[_0xdbdf('0x37')]({},_0x2c8d3a,_0x578d10[_0xdbdf('0x41')]);return db[_0xdbdf('0x28')][_0xdbdf('0x42')](_0x2c8d3a)[_0xdbdf('0x22')](handleEntityNotFound(_0x4eda03,null))[_0xdbdf('0x22')](respondWithResult(_0x4eda03,null))[_0xdbdf('0x43')](handleError(_0x4eda03,null));};exports[_0xdbdf('0x44')]=function(_0x521193,_0x33603f){return db[_0xdbdf('0x28')]['create'](_0x521193[_0xdbdf('0x45')],{})['then'](respondWithResult(_0x33603f,0xc9))[_0xdbdf('0x43')](handleError(_0x33603f,null));};exports[_0xdbdf('0x21')]=function(_0x568c04,_0x5ccd4a){if(_0x568c04[_0xdbdf('0x45')]['id']){delete _0x568c04[_0xdbdf('0x45')]['id'];}return db['SAProformaDetail'][_0xdbdf('0x42')]({'where':{'id':_0x568c04[_0xdbdf('0x3f')]['id']}})[_0xdbdf('0x22')](handleEntityNotFound(_0x5ccd4a,null))[_0xdbdf('0x22')](saveUpdates(_0x568c04[_0xdbdf('0x45')],null))[_0xdbdf('0x22')](respondWithResult(_0x5ccd4a,null))[_0xdbdf('0x43')](handleError(_0x5ccd4a,null));};exports['destroy']=function(_0x568eb0,_0xe7ca96){return db['SAProformaDetail'][_0xdbdf('0x42')]({'where':{'id':_0x568eb0[_0xdbdf('0x3f')]['id']}})[_0xdbdf('0x22')](handleEntityNotFound(_0xe7ca96,null))[_0xdbdf('0x22')](removeEntity(_0xe7ca96,null))[_0xdbdf('0x43')](handleError(_0xe7ca96,null));};exports['describe']=function(_0x599e4b,_0x442511){return db[_0xdbdf('0x28')][_0xdbdf('0x46')]()['then'](respondWithResult(_0x442511,null))['catch'](handleError(_0x442511,null));};function addProformaInvoiceDetail(_0xd4895d,_0x45b5b6,_0xe70bf3){console['log'](_0xdbdf('0x47'),_0xd4895d);var _0x361de3={'companyName':_0xd4895d[_0xdbdf('0x48')],'companyId':_0xd4895d[_0xdbdf('0x49')],'productName':_0xd4895d[_0xdbdf('0x4a')],'productCode':_0xd4895d['productCode'],'productDescription':_0xd4895d[_0xdbdf('0x4b')],'typeName':_0xd4895d[_0xdbdf('0x4c')],'pricelistName':_0xd4895d['pricelistName'],'priceListId':_0xd4895d[_0xdbdf('0x4d')],'netPrice':_0xd4895d[_0xdbdf('0x4e')],'discount':_0xd4895d[_0xdbdf('0x4f')],'tax':_0xd4895d[_0xdbdf('0x50')],'agentFullname':_0xd4895d['agentFullname'],'note':_0xd4895d[_0xdbdf('0x51')],'subscriptionId':_0xd4895d[_0xdbdf('0x52')],'subscriptionName':_0xd4895d['subscriptionName'],'subscriptionMonthly':_0xd4895d['subscriptionMonthly'],'quantity':_0xd4895d[_0xdbdf('0x53')],'InvoiceId':_0x45b5b6};return db[_0xdbdf('0x54')]['create'](_0x361de3,{'transaction':_0xe70bf3})[_0xdbdf('0x22')](function(){return db['SAProductQuotation'][_0xdbdf('0x21')]({'InvoiceId':_0x45b5b6},{'where':{'ProductPriceListId':_0xd4895d[_0xdbdf('0x4d')],'productCode':_0xd4895d['productCode'],'ProformaId':_0xd4895d['ProformaId']},'transaction':_0xe70bf3});});}exports['automaticProformaInvoice']=function(_0x246f51,_0x238666,_0x2f292a){var _0x3609fd;if(_0x246f51[_0xdbdf('0x45')]['id']){delete _0x246f51[_0xdbdf('0x45')]['id'];}console[_0xdbdf('0x55')](_0x246f51);return db[_0xdbdf('0x56')][_0xdbdf('0x57')](function(_0x579bea){return db[_0xdbdf('0x58')]['create'](_0x246f51[_0xdbdf('0x45')],{'transaction':_0x579bea,'logging':console[_0xdbdf('0x55')]})[_0xdbdf('0x22')](function(_0x36b63c){_0x3609fd=_0x36b63c;var _0x36f380=_0x246f51[_0xdbdf('0x3f')]['id'];return db['SAProformaDetail'][_0xdbdf('0x3d')]({'where':{'ProformaId':_0x36f380},'raw':!![],'logging':console['log']});})[_0xdbdf('0x22')](function(_0x54f651){if(_0x54f651[_0xdbdf('0x30')]>0x0){var _0x36b9c7=[];for(var _0x387ab6=0x0;_0x387ab6<_0x54f651[_0xdbdf('0x30')];_0x387ab6++){_0x36b9c7[_0xdbdf('0x59')](addProformaInvoiceDetail(_0x54f651[_0x387ab6],_0x3609fd['id'],_0x579bea));}return BPromise[_0xdbdf('0x5a')](_0x36b9c7);}else{var _0x6b8e0e={'errors':[{'type':'WARNING','message':_0xdbdf('0x5b')}]};throw _0x6b8e0e;}});})[_0xdbdf('0x22')](function(){return _0x238666[_0xdbdf('0x18')](0xc8);})['catch'](function(_0x4862e8){console['log'](_0xdbdf('0x5c'),_0x4862e8);if(_0x4862e8[_0xdbdf('0x26')]===_0xdbdf('0x5d')){var _0x4862e8={'errors':[{'message':_0xdbdf('0x5e')}]};}_0x238666[_0xdbdf('0x1b')](0x1f4)[_0xdbdf('0x5f')](_0x4862e8);});}; \ No newline at end of file diff --git a/server/api/saProformaDetail/saProformaDetail.model.js b/server/api/saProformaDetail/saProformaDetail.model.js index 263e659..6c84765 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 _0x1e85=['moment','bluebird','path','rimraf','./saProformaDetail.attributes','exports','define','sa_proforma_details','lodash','../../config/logger','api'];(function(_0x1b33dd,_0x12827e){var _0x1dcd1a=function(_0x504f8e){while(--_0x504f8e){_0x1b33dd['push'](_0x1b33dd['shift']());}};_0x1dcd1a(++_0x12827e);}(_0x1e85,0x1aa));var _0x51e8=function(_0xffa8a,_0x27e454){_0xffa8a=_0xffa8a-0x0;var _0x3c7626=_0x1e85[_0xffa8a];return _0x3c7626;};'use strict';var _=require(_0x51e8('0x0'));var util=require('util');var logger=require(_0x51e8('0x1'))(_0x51e8('0x2'));var moment=require(_0x51e8('0x3'));var BPromise=require(_0x51e8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x51e8('0x5'));var rimraf=require(_0x51e8('0x6'));var config=require('../../config/environment');var attributes=require(_0x51e8('0x7'));module[_0x51e8('0x8')]=function(_0x2d7535,_0x4d7967){return _0x2d7535[_0x51e8('0x9')]('SAProformaDetail',attributes,{'tableName':_0x51e8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xccaf=['../../config/environment','./saProformaDetail.attributes','define','SAProformaDetail','sa_proforma_details','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4c4a43,_0x1a0c4b){var _0x39e886=function(_0x323ac4){while(--_0x323ac4){_0x4c4a43['push'](_0x4c4a43['shift']());}};_0x39e886(++_0x1a0c4b);}(_0xccaf,0x139));var _0xfcca=function(_0x1bb47b,_0x54e02e){_0x1bb47b=_0x1bb47b-0x0;var _0x566418=_0xccaf[_0x1bb47b];return _0x566418;};'use strict';var _=require(_0xfcca('0x0'));var util=require(_0xfcca('0x1'));var logger=require(_0xfcca('0x2'))(_0xfcca('0x3'));var moment=require(_0xfcca('0x4'));var BPromise=require(_0xfcca('0x5'));var rp=require(_0xfcca('0x6'));var fs=require('fs');var path=require(_0xfcca('0x7'));var rimraf=require(_0xfcca('0x8'));var config=require(_0xfcca('0x9'));var attributes=require(_0xfcca('0xa'));module['exports']=function(_0x4cc124,_0x8d99a9){return _0x4cc124[_0xfcca('0xb')](_0xfcca('0xc'),attributes,{'tableName':_0xfcca('0xd'),'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 c6a1a91..d04cbd4 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(_0x29c431,_0x65f0df){var _0x2d9aa4=function(_0x79b4fd){while(--_0x79b4fd){_0x29c431['push'](_0x29c431['shift']());}};_0x2d9aa4(++_0x65f0df);}(_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 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 _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(_0x407a51,_0x482d51){var _0x5244b5=function(_0x47a24c){while(--_0x47a24c){_0x407a51['push'](_0x407a51['shift']());}};_0x5244b5(++_0x482d51);}(_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});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 diff --git a/server/api/saQuotation/index.js b/server/api/saQuotation/index.js index 07fd02a..689163b 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 _0x2cc4=['Router','../../components/auth/service','get','isAuthenticated','index','/describe','describe','/:id','post','create','/:id/movequotationassets','moveQuotationAsset','put','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x248ca8,_0x41a211){var _0x111516=function(_0x56af3c){while(--_0x56af3c){_0x248ca8['push'](_0x248ca8['shift']());}};_0x111516(++_0x41a211);}(_0x2cc4,0x1f0));var _0x42cc=function(_0x529f1c,_0x437ed1){_0x529f1c=_0x529f1c-0x0;var _0x4d57ab=_0x2cc4[_0x529f1c];return _0x4d57ab;};'use strict';var multer=require(_0x42cc('0x0'));var util=require(_0x42cc('0x1'));var path=require(_0x42cc('0x2'));var timeout=require(_0x42cc('0x3'));var express=require('express');var router=express[_0x42cc('0x4')]();var auth=require(_0x42cc('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./saQuotation.controller');router[_0x42cc('0x6')]('/',auth[_0x42cc('0x7')](),controller[_0x42cc('0x8')]);router[_0x42cc('0x6')](_0x42cc('0x9'),auth['isAuthenticated'](),controller[_0x42cc('0xa')]);router[_0x42cc('0x6')](_0x42cc('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x42cc('0xc')]('/',auth[_0x42cc('0x7')](),controller[_0x42cc('0xd')]);router[_0x42cc('0xc')](_0x42cc('0xe'),auth[_0x42cc('0x7')](),controller[_0x42cc('0xf')]);router[_0x42cc('0x10')](_0x42cc('0xb'),auth[_0x42cc('0x7')](),controller[_0x42cc('0x11')]);router[_0x42cc('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x42cc('0x13')]=router; \ No newline at end of file +var _0x3a10=['isAuthenticated','describe','/:id','show','create','/:id/movequotationassets','put','update','delete','util','path','express','Router','../../components/interaction/service','../../config/environment','get','/describe'];(function(_0x27f773,_0x5dd760){var _0x498cdc=function(_0xb3a31c){while(--_0xb3a31c){_0x27f773['push'](_0x27f773['shift']());}};_0x498cdc(++_0x5dd760);}(_0x3a10,0x6f));var _0x03a1=function(_0x9e0fbc,_0x2b3e62){_0x9e0fbc=_0x9e0fbc-0x0;var _0x4c70b7=_0x3a10[_0x9e0fbc];return _0x4c70b7;};'use strict';var multer=require('multer');var util=require(_0x03a1('0x0'));var path=require(_0x03a1('0x1'));var timeout=require('connect-timeout');var express=require(_0x03a1('0x2'));var router=express[_0x03a1('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x03a1('0x4'));var config=require(_0x03a1('0x5'));var controller=require('./saQuotation.controller');router[_0x03a1('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x03a1('0x6')](_0x03a1('0x7'),auth[_0x03a1('0x8')](),controller[_0x03a1('0x9')]);router['get'](_0x03a1('0xa'),auth['isAuthenticated'](),controller[_0x03a1('0xb')]);router['post']('/',auth[_0x03a1('0x8')](),controller[_0x03a1('0xc')]);router['post'](_0x03a1('0xd'),auth[_0x03a1('0x8')](),controller['moveQuotationAsset']);router[_0x03a1('0xe')](_0x03a1('0xa'),auth[_0x03a1('0x8')](),controller[_0x03a1('0xf')]);router[_0x03a1('0x10')]('/:id',auth[_0x03a1('0x8')](),controller['destroy']);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 2b5456a..76fef80 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 _0x0625=['sequelize','exports','STRING','name','TEXT','INTEGER'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x0625,0xea));var _0x5062=function(_0x29f8c3,_0x36dca6){_0x29f8c3=_0x29f8c3-0x0;var _0x1f391f=_0x0625[_0x29f8c3];return _0x1f391f;};'use strict';var Sequelize=require(_0x5062('0x0'));module[_0x5062('0x1')]={'name':{'type':Sequelize[_0x5062('0x2')],'unique':_0x5062('0x3')},'note':{'type':Sequelize[_0x5062('0x4')]},'agentFullname':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x5062('0x4')]},'companyName':{'type':Sequelize[_0x5062('0x2')]},'companyId':{'type':Sequelize[_0x5062('0x5')]}}; \ No newline at end of file +var _0xb2b6=['TEXT','INTEGER','sequelize','exports','STRING'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0xb2b6,0xcf));var _0x6b2b=function(_0xf77ebb,_0x917f19){_0xf77ebb=_0xf77ebb-0x0;var _0x429a5f=_0xb2b6[_0xf77ebb];return _0x429a5f;};'use strict';var Sequelize=require(_0x6b2b('0x0'));module[_0x6b2b('0x1')]={'name':{'type':Sequelize[_0x6b2b('0x2')],'unique':'name'},'note':{'type':Sequelize[_0x6b2b('0x3')]},'agentFullname':{'type':Sequelize[_0x6b2b('0x2')]},'status':{'type':Sequelize[_0x6b2b('0x3')]},'companyName':{'type':Sequelize[_0x6b2b('0x2')]},'companyId':{'type':Sequelize[_0x6b2b('0x4')]}}; \ No newline at end of file diff --git a/server/api/saQuotation/saQuotation.controller.js b/server/api/saQuotation/saQuotation.controller.js index 7969720..35da64b 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 _0x75ae=['SAAsset','abs','There\x20are\x20not\x20enough\x20products\x20to\x20cancel.','companyName','companyId','productTax','productDescription','typeName','pricelistName','netPrice','discount','note','tax','subscriptionName','subscriptionMonthly','SAProductQuotation','sequelize','transaction','push','moveQuotationAsset','all','No\x20product\x20to\x20move.','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','json','reject','save','update','then','name','send','index','SAQuotation','rawAttributes','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','limit','order','sort','filters','pick','filter','merge','map','type','VIRTUAL','field','options','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','TCL:\x20manageProductQuotationIntoAsset\x20->\x20productQuotation','subscriptionId','pricelistId','log','TCL:\x20manageProductQuotationIntoAsset\x20->\x20productsAsset','TCL:\x20manageProductQuotationIntoAsset\x20->\x20listproduct','dateNextInvoice','quantity','slice','value'];(function(_0x2acd07,_0xd0f6e7){var _0x25c279=function(_0x32d1c2){while(--_0x32d1c2){_0x2acd07['push'](_0x2acd07['shift']());}};_0x25c279(++_0xd0f6e7);}(_0x75ae,0x1c2));var _0xe75a=function(_0x542735,_0x723cb8){_0x542735=_0x542735-0x0;var _0x54570e=_0x75ae[_0x542735];return _0x54570e;};'use strict';var pdf=require(_0xe75a('0x0'));var emlformat=require(_0xe75a('0x1'));var rimraf=require(_0xe75a('0x2'));var zipdir=require(_0xe75a('0x3'));var jsonpatch=require(_0xe75a('0x4'));var rp=require(_0xe75a('0x5'));var moment=require(_0xe75a('0x6'));var BPromise=require(_0xe75a('0x7'));var Mustache=require(_0xe75a('0x8'));var util=require(_0xe75a('0x9'));var path=require(_0xe75a('0xa'));var sox=require(_0xe75a('0xb'));var csv=require(_0xe75a('0xc'));var ejs=require(_0xe75a('0xd'));var fs=require('fs');var _=require(_0xe75a('0xe'));var squel=require(_0xe75a('0xf'));var crypto=require(_0xe75a('0x10'));var jsforce=require(_0xe75a('0x11'));var deskjs=require(_0xe75a('0x12'));var toCsv=require(_0xe75a('0xc'));var querystring=require(_0xe75a('0x13'));var Papa=require(_0xe75a('0x14'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe75a('0x15'));var hardwareService=require(_0xe75a('0x16'));var logger=require(_0xe75a('0x17'))(_0xe75a('0x18'));var utils=require('../../config/utils');var config=require(_0xe75a('0x19'));var db=require(_0xe75a('0x1a'))['db'];function respondWithStatusCode(_0x30e4dc,_0x2a86b4){_0x2a86b4=_0x2a86b4||0xcc;return function(_0x5dfad0){if(_0x5dfad0){return _0x30e4dc[_0xe75a('0x1b')](_0x2a86b4);}return _0x30e4dc[_0xe75a('0x1c')](_0x2a86b4)[_0xe75a('0x1d')]();};}function respondWithResult(_0x142b6e,_0x57f692){_0x57f692=_0x57f692||0xc8;return function(_0x6e353c){if(_0x6e353c){return _0x142b6e[_0xe75a('0x1c')](_0x57f692)['json'](_0x6e353c);}};}function respondWithFilteredResult(_0x37a93e,_0x39925d){return function(_0x4970c9){if(_0x4970c9){var _0x6f9172=_0x4970c9[_0xe75a('0x1e')],_0x250d1b=_0x39925d['offset'],_0x988496=_0x39925d[_0xe75a('0x1f')]+_0x39925d['limit'],_0x41c1c4;if(_0x988496>=_0x6f9172){_0x988496=_0x6f9172;_0x41c1c4=0xc8;}else{_0x41c1c4=0xce;}_0x37a93e[_0xe75a('0x1c')](_0x41c1c4);return _0x37a93e[_0xe75a('0x20')](_0xe75a('0x21'),_0x250d1b+'-'+_0x988496+'/'+_0x6f9172)[_0xe75a('0x22')](_0x4970c9);}return null;};}function patchUpdates(_0x10cdfd){return function(_0x563cc6){try{jsonpatch['apply'](_0x563cc6,_0x10cdfd,!![]);}catch(_0xb1524f){return BPromise[_0xe75a('0x23')](_0xb1524f);}return _0x563cc6[_0xe75a('0x24')]();};}function saveUpdates(_0x14d87f,_0x40e012){return function(_0xecd872){if(_0xecd872){return _0xecd872[_0xe75a('0x25')](_0x14d87f)[_0xe75a('0x26')](function(_0x13e5e2){return _0x13e5e2;});}return null;};}function removeEntity(_0x32f038,_0x5e4bf6){return function(_0x599915){if(_0x599915){return _0x599915['destroy']()['then'](function(){_0x32f038[_0xe75a('0x1c')](0xcc)[_0xe75a('0x1d')]();});}};}function handleEntityNotFound(_0x11e4bd,_0x4a9133){return function(_0x28d96f){if(!_0x28d96f){_0x11e4bd[_0xe75a('0x1b')](0x194);}return _0x28d96f;};}function handleError(_0x3fe0c8,_0x29a253){_0x29a253=_0x29a253||0x1f4;return function(_0x3b179b){logger['error'](_0x3b179b['stack']);if(_0x3b179b[_0xe75a('0x27')]){delete _0x3b179b[_0xe75a('0x27')];}_0x3fe0c8[_0xe75a('0x1c')](_0x29a253)[_0xe75a('0x28')](_0x3b179b);};}exports[_0xe75a('0x29')]=function(_0x18e837,_0x144784){var _0x4ec85c={},_0x230dd2={},_0x492632={'count':0x0,'rows':[]};var _0x591933=db[_0xe75a('0x2a')][_0xe75a('0x2b')];_0x230dd2['model']=_[_0xe75a('0x2c')](_0x591933);_0x230dd2[_0xe75a('0x2d')]=_['keys'](_0x18e837[_0xe75a('0x2d')]);_0x230dd2['filters']=_[_0xe75a('0x2e')](_0x230dd2[_0xe75a('0x2f')],_0x230dd2[_0xe75a('0x2d')]);_0x4ec85c['attributes']=_[_0xe75a('0x2e')](_0x230dd2[_0xe75a('0x2f')],qs[_0xe75a('0x30')](_0x18e837[_0xe75a('0x2d')][_0xe75a('0x30')]));_0x4ec85c[_0xe75a('0x31')]=_0x4ec85c[_0xe75a('0x31')][_0xe75a('0x32')]?_0x4ec85c[_0xe75a('0x31')]:_0x230dd2[_0xe75a('0x2f')];if(!_0x18e837[_0xe75a('0x2d')][_0xe75a('0x33')]('nolimit')){_0x4ec85c[_0xe75a('0x34')]=qs[_0xe75a('0x34')](_0x18e837[_0xe75a('0x2d')][_0xe75a('0x34')]);_0x4ec85c[_0xe75a('0x1f')]=qs[_0xe75a('0x1f')](_0x18e837['query'][_0xe75a('0x1f')]);}_0x4ec85c[_0xe75a('0x35')]=qs[_0xe75a('0x36')](_0x18e837['query'][_0xe75a('0x36')]);_0x4ec85c['where']=qs[_0xe75a('0x37')](_[_0xe75a('0x38')](_0x18e837['query'],_0x230dd2['filters']));if(_0x18e837[_0xe75a('0x2d')][_0xe75a('0x39')]){_0x4ec85c['where']=_[_0xe75a('0x3a')](_0x4ec85c['where'],{'$or':_[_0xe75a('0x3b')](_0x591933,function(_0x4478d8){if(_0x4478d8[_0xe75a('0x3c')]['key']!==_0xe75a('0x3d')){var _0x22bd87={};_0x22bd87[_0x4478d8[_0xe75a('0x3e')]]={'$like':'%'+_0x18e837[_0xe75a('0x2d')][_0xe75a('0x39')]+'%'};return _0x22bd87;}})});}_0x4ec85c=_[_0xe75a('0x3a')]({},_0x4ec85c,_0x18e837[_0xe75a('0x3f')]);var _0x5517ce={'where':_0x4ec85c['where']};return db[_0xe75a('0x2a')]['count'](_0x5517ce)['then'](function(_0x379f6d){_0x492632['count']=_0x379f6d;if(_0x18e837[_0xe75a('0x2d')]['includeAll']){_0x4ec85c[_0xe75a('0x40')]=[{'all':!![]}];}return db[_0xe75a('0x2a')][_0xe75a('0x41')](_0x4ec85c);})[_0xe75a('0x26')](function(_0x58c6dd){_0x492632[_0xe75a('0x42')]=_0x58c6dd;return _0x492632;})[_0xe75a('0x26')](respondWithFilteredResult(_0x144784,_0x4ec85c))[_0xe75a('0x43')](handleError(_0x144784,null));};exports[_0xe75a('0x44')]=function(_0x84e543,_0x79ffef){var _0x19834e={'raw':![],'where':{'id':_0x84e543[_0xe75a('0x45')]['id']}},_0x3a6327={};_0x3a6327[_0xe75a('0x2f')]=_[_0xe75a('0x2c')](db[_0xe75a('0x2a')][_0xe75a('0x2b')]);_0x3a6327[_0xe75a('0x2d')]=_[_0xe75a('0x2c')](_0x84e543[_0xe75a('0x2d')]);_0x3a6327[_0xe75a('0x37')]=_[_0xe75a('0x2e')](_0x3a6327[_0xe75a('0x2f')],_0x3a6327['query']);_0x19834e[_0xe75a('0x31')]=_[_0xe75a('0x2e')](_0x3a6327[_0xe75a('0x2f')],qs['fields'](_0x84e543[_0xe75a('0x2d')][_0xe75a('0x30')]));_0x19834e['attributes']=_0x19834e['attributes']['length']?_0x19834e[_0xe75a('0x31')]:_0x3a6327[_0xe75a('0x2f')];if(_0x84e543[_0xe75a('0x2d')]['includeAll']){_0x19834e[_0xe75a('0x40')]=[{'all':!![]}];}_0x19834e=_[_0xe75a('0x3a')]({},_0x19834e,_0x84e543[_0xe75a('0x3f')]);return db[_0xe75a('0x2a')][_0xe75a('0x46')](_0x19834e)['then'](handleEntityNotFound(_0x79ffef,null))[_0xe75a('0x26')](respondWithResult(_0x79ffef,null))[_0xe75a('0x43')](handleError(_0x79ffef,null));};exports[_0xe75a('0x47')]=function(_0x49f053,_0x57dbf3){return db['SAQuotation'][_0xe75a('0x47')](_0x49f053['body'],{})[_0xe75a('0x26')](respondWithResult(_0x57dbf3,0xc9))[_0xe75a('0x43')](handleError(_0x57dbf3,null));};exports[_0xe75a('0x25')]=function(_0x4335d4,_0x669a5d){if(_0x4335d4[_0xe75a('0x48')]['id']){delete _0x4335d4['body']['id'];}return db['SAQuotation'][_0xe75a('0x46')]({'where':{'id':_0x4335d4[_0xe75a('0x45')]['id']}})[_0xe75a('0x26')](handleEntityNotFound(_0x669a5d,null))['then'](saveUpdates(_0x4335d4[_0xe75a('0x48')],null))[_0xe75a('0x26')](respondWithResult(_0x669a5d,null))[_0xe75a('0x43')](handleError(_0x669a5d,null));};exports[_0xe75a('0x49')]=function(_0x5b0e16,_0x1104a9){return db['SAQuotation']['find']({'where':{'id':_0x5b0e16[_0xe75a('0x45')]['id']}})[_0xe75a('0x26')](handleEntityNotFound(_0x1104a9,null))[_0xe75a('0x26')](removeEntity(_0x1104a9,null))[_0xe75a('0x43')](handleError(_0x1104a9,null));};exports['describe']=function(_0x36b3d3,_0x43b5d1){return db[_0xe75a('0x2a')][_0xe75a('0x4a')]()[_0xe75a('0x26')](respondWithResult(_0x43b5d1,null))[_0xe75a('0x43')](handleError(_0x43b5d1,null));};function manageProductQuotationIntoAsset(_0x1f01c4,_0x4f1026){console['log'](_0xe75a('0x4b'),_0x1f01c4);var _0x42ee66=_0x1f01c4['companyId'];var _0x2192e1=[];return db['SAAsset'][_0xe75a('0x41')]({'where':{'companyId':_0x42ee66,'SubscriptionId':_0x1f01c4[_0xe75a('0x4c')],'pricelistId':_0x1f01c4[_0xe75a('0x4d')],'productCode':_0x1f01c4['productCode'],'deleted':{'$or':[0x0,null]}},'raw':!![]})['then'](function(_0x286bc8){console[_0xe75a('0x4e')](_0xe75a('0x4f'),_0x286bc8);_0x2192e1=_0x286bc8;console[_0xe75a('0x4e')](_0xe75a('0x50'),_0x2192e1);if(_0x2192e1&&_0x2192e1['length']>0x0){var _0x301017=_0x2192e1[0x0][_0xe75a('0x51')];var _0x286165=_0x2192e1[_0xe75a('0x32')];return[_0x301017,_0x286165];}else{return db['SAAsset']['findOne']({'where':{'companyId':_0x42ee66,'SubscriptionId':_0x1f01c4['subscriptionId'],'pricelistId':_0x1f01c4[_0xe75a('0x4d')]},'raw':!![]})['then'](function(_0x4e01e9){var _0x246e9b=new Date();if(_0x4e01e9){_0x246e9b=_0x4e01e9[_0xe75a('0x51')];}return[_0x246e9b,0x0];});}})['spread'](function(_0x5ed41a,_0x13fb0e){var _0x1731a1=Math['abs'](_0x1f01c4[_0xe75a('0x52')]);if(_0x1f01c4[_0xe75a('0x52')]<0x0&&_0x1731a1<=_0x13fb0e){var _0x1b5118=_(_0x2192e1)[_0xe75a('0x53')](0x0,_0x1731a1)[_0xe75a('0x3b')]('id')[_0xe75a('0x54')]();return db[_0xe75a('0x55')][_0xe75a('0x25')]({'deleted':0x1},{'where':{'id':_0x1b5118}});}if(_0x1f01c4[_0xe75a('0x52')]<0x0&&Math[_0xe75a('0x56')](_0x1f01c4[_0xe75a('0x52')])>_0x13fb0e){var _0x3a6727={'errors':[{'type':'WARNING','message':_0xe75a('0x57')}]};throw _0x3a6727;}if(_0x1f01c4[_0xe75a('0x52')]>0x0){var _0x2e017d=new Array();for(var _0x2b6d4e=0x0;_0x2b6d4e<_0x1f01c4['quantity'];_0x2b6d4e++){var _0x407083={'companyName':_0x1f01c4[_0xe75a('0x58')],'companyId':_0x1f01c4[_0xe75a('0x59')],'productName':_0x1f01c4['productName'],'productCode':_0x1f01c4['productCode'],'productTax':_0x1f01c4[_0xe75a('0x5a')],'productDescription':_0x1f01c4[_0xe75a('0x5b')],'typeName':_0x1f01c4[_0xe75a('0x5c')],'pricelistName':_0x1f01c4[_0xe75a('0x5d')],'pricelistId':_0x1f01c4[_0xe75a('0x4d')],'netPrice':_0x1f01c4[_0xe75a('0x5e')],'discount':_0x1f01c4[_0xe75a('0x5f')],'agentFullname':_0x1f01c4['agentFullname'],'note':_0x1f01c4[_0xe75a('0x60')],'tax':_0x1f01c4[_0xe75a('0x61')],'subscriptionId':_0x1f01c4[_0xe75a('0x4c')],'subscriptionName':_0x1f01c4[_0xe75a('0x62')],'subscriptionMonthly':_0x1f01c4[_0xe75a('0x63')]};_0x407083['dateNextInvoice']=_0x5ed41a;_0x407083[_0xe75a('0x59')]=_0x42ee66;_0x2e017d['push'](_0x407083);}return db[_0xe75a('0x55')]['bulkCreate'](_0x2e017d,{'transaction':_0x4f1026})[_0xe75a('0x26')](function(){return db[_0xe75a('0x64')][_0xe75a('0x25')]({'productAsset':0x1},{'where':{'id':_0x1f01c4['id']},'transaction':_0x4f1026});});}});}exports['moveQuotationAsset']=function(_0x1d67ec,_0x1c9904,_0x5a708f){var _0x42fc67=_0x1d67ec[_0xe75a('0x45')]['id'];return db[_0xe75a('0x64')][_0xe75a('0x41')]({'where':{'QuotationId':_0x42fc67,'productAsset':{'$ne':0x1}},'raw':!![],'logging':console[_0xe75a('0x4e')]})[_0xe75a('0x26')](function(_0x3d4446){if(_0x3d4446[_0xe75a('0x32')]>0x0){return db[_0xe75a('0x65')][_0xe75a('0x66')](function(_0x83ff5){var _0x20975a=new Array();for(var _0xcca25=0x0;_0xcca25<_0x3d4446['length'];_0xcca25++){var _0x144149=_['clone'](_0x3d4446[_0xcca25]);_0x20975a[_0xe75a('0x67')](manageProductQuotationIntoAsset(_0x144149,_0x83ff5));console[_0xe75a('0x4e')](_0xe75a('0x68'),_0x144149);}return BPromise[_0xe75a('0x69')](_0x20975a);});}else{var _0x5c3ba9={'errors':[{'type':'WARNING','message':_0xe75a('0x6a')}]};throw _0x5c3ba9;}})[_0xe75a('0x26')](handleEntityNotFound(_0x1c9904,null))[_0xe75a('0x26')](respondWithStatusCode(_0x1c9904,0xc8))[_0xe75a('0x43')](handleError(_0x1c9904,null));}; \ No newline at end of file +var _0x2d8d=['update','destroy','error','stack','name','send','index','SAQuotation','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','key','VIRTUAL','merge','options','then','includeAll','include','show','find','catch','body','params','describe','log','TCL:\x20manageProductQuotationIntoAsset\x20->\x20productQuotation','companyId','findAll','subscriptionId','pricelistId','productCode','TCL:\x20manageProductQuotationIntoAsset\x20->\x20productsAsset','TCL:\x20manageProductQuotationIntoAsset\x20->\x20listproduct','dateNextInvoice','SAAsset','findOne','quantity','WARNING','There\x20are\x20not\x20enough\x20products\x20to\x20cancel.','companyName','productName','productTax','productDescription','typeName','discount','agentFullname','note','tax','subscriptionName','subscriptionMonthly','push','bulkCreate','moveQuotationAsset','SAProductQuotation','sequelize','all','No\x20product\x20to\x20move.','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','reject','save'];(function(_0x4f3017,_0x5d5269){var _0x4324e3=function(_0x11b7b8){while(--_0x11b7b8){_0x4f3017['push'](_0x4f3017['shift']());}};_0x4324e3(++_0x5d5269);}(_0x2d8d,0x115));var _0xd2d8=function(_0x2f3794,_0x3c3bec){_0x2f3794=_0x2f3794-0x0;var _0x1c9fbe=_0x2d8d[_0x2f3794];return _0x1c9fbe;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd2d8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd2d8('0x1'));var jsonpatch=require(_0xd2d8('0x2'));var rp=require(_0xd2d8('0x3'));var moment=require(_0xd2d8('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd2d8('0x5'));var path=require(_0xd2d8('0x6'));var sox=require('sox');var csv=require(_0xd2d8('0x7'));var ejs=require(_0xd2d8('0x8'));var fs=require('fs');var _=require(_0xd2d8('0x9'));var squel=require(_0xd2d8('0xa'));var crypto=require(_0xd2d8('0xb'));var jsforce=require(_0xd2d8('0xc'));var deskjs=require(_0xd2d8('0xd'));var toCsv=require(_0xd2d8('0x7'));var querystring=require(_0xd2d8('0xe'));var Papa=require(_0xd2d8('0xf'));var Redis=require(_0xd2d8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd2d8('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd2d8('0x12'))(_0xd2d8('0x13'));var utils=require(_0xd2d8('0x14'));var config=require('../../config/environment');var db=require(_0xd2d8('0x15'))['db'];function respondWithStatusCode(_0x572d2b,_0x321b1c){_0x321b1c=_0x321b1c||0xcc;return function(_0x16639b){if(_0x16639b){return _0x572d2b['sendStatus'](_0x321b1c);}return _0x572d2b[_0xd2d8('0x16')](_0x321b1c)[_0xd2d8('0x17')]();};}function respondWithResult(_0x505e05,_0x4bf0c2){_0x4bf0c2=_0x4bf0c2||0xc8;return function(_0x135b3c){if(_0x135b3c){return _0x505e05['status'](_0x4bf0c2)[_0xd2d8('0x18')](_0x135b3c);}};}function respondWithFilteredResult(_0xa1624b,_0x4becc8){return function(_0xb320f1){if(_0xb320f1){var _0x121faa=_0xb320f1[_0xd2d8('0x19')],_0x9bd72e=_0x4becc8[_0xd2d8('0x1a')],_0x2c2a10=_0x4becc8[_0xd2d8('0x1a')]+_0x4becc8[_0xd2d8('0x1b')],_0x31389d;if(_0x2c2a10>=_0x121faa){_0x2c2a10=_0x121faa;_0x31389d=0xc8;}else{_0x31389d=0xce;}_0xa1624b[_0xd2d8('0x16')](_0x31389d);return _0xa1624b[_0xd2d8('0x1c')](_0xd2d8('0x1d'),_0x9bd72e+'-'+_0x2c2a10+'/'+_0x121faa)[_0xd2d8('0x18')](_0xb320f1);}return null;};}function patchUpdates(_0x3fa978){return function(_0x6cfd3c){try{jsonpatch['apply'](_0x6cfd3c,_0x3fa978,!![]);}catch(_0x3044f3){return BPromise[_0xd2d8('0x1e')](_0x3044f3);}return _0x6cfd3c[_0xd2d8('0x1f')]();};}function saveUpdates(_0x2bdc61,_0x38cb06){return function(_0x151488){if(_0x151488){return _0x151488[_0xd2d8('0x20')](_0x2bdc61)['then'](function(_0x588bb2){return _0x588bb2;});}return null;};}function removeEntity(_0x3337df,_0x2956a8){return function(_0x240962){if(_0x240962){return _0x240962[_0xd2d8('0x21')]()['then'](function(){_0x3337df[_0xd2d8('0x16')](0xcc)[_0xd2d8('0x17')]();});}};}function handleEntityNotFound(_0x812e56,_0x2ddbc1){return function(_0x19a830){if(!_0x19a830){_0x812e56['sendStatus'](0x194);}return _0x19a830;};}function handleError(_0x2b86e9,_0x55ae99){_0x55ae99=_0x55ae99||0x1f4;return function(_0xf091e1){logger[_0xd2d8('0x22')](_0xf091e1[_0xd2d8('0x23')]);if(_0xf091e1[_0xd2d8('0x24')]){delete _0xf091e1[_0xd2d8('0x24')];}_0x2b86e9[_0xd2d8('0x16')](_0x55ae99)[_0xd2d8('0x25')](_0xf091e1);};}exports[_0xd2d8('0x26')]=function(_0x2928b4,_0xd74515){var _0x3b8559={},_0x4d7dab={},_0x3889dc={'count':0x0,'rows':[]};var _0x3c41e1=db[_0xd2d8('0x27')][_0xd2d8('0x28')];_0x4d7dab[_0xd2d8('0x29')]=_[_0xd2d8('0x2a')](_0x3c41e1);_0x4d7dab['query']=_[_0xd2d8('0x2a')](_0x2928b4[_0xd2d8('0x2b')]);_0x4d7dab[_0xd2d8('0x2c')]=_[_0xd2d8('0x2d')](_0x4d7dab[_0xd2d8('0x29')],_0x4d7dab[_0xd2d8('0x2b')]);_0x3b8559[_0xd2d8('0x2e')]=_['intersection'](_0x4d7dab[_0xd2d8('0x29')],qs[_0xd2d8('0x2f')](_0x2928b4[_0xd2d8('0x2b')][_0xd2d8('0x2f')]));_0x3b8559[_0xd2d8('0x2e')]=_0x3b8559[_0xd2d8('0x2e')][_0xd2d8('0x30')]?_0x3b8559[_0xd2d8('0x2e')]:_0x4d7dab[_0xd2d8('0x29')];if(!_0x2928b4[_0xd2d8('0x2b')][_0xd2d8('0x31')](_0xd2d8('0x32'))){_0x3b8559[_0xd2d8('0x1b')]=qs['limit'](_0x2928b4[_0xd2d8('0x2b')][_0xd2d8('0x1b')]);_0x3b8559['offset']=qs[_0xd2d8('0x1a')](_0x2928b4[_0xd2d8('0x2b')]['offset']);}_0x3b8559[_0xd2d8('0x33')]=qs[_0xd2d8('0x34')](_0x2928b4['query']['sort']);_0x3b8559[_0xd2d8('0x35')]=qs['filters'](_[_0xd2d8('0x36')](_0x2928b4['query'],_0x4d7dab['filters']));if(_0x2928b4['query'][_0xd2d8('0x37')]){_0x3b8559[_0xd2d8('0x35')]=_['merge'](_0x3b8559[_0xd2d8('0x35')],{'$or':_[_0xd2d8('0x38')](_0x3c41e1,function(_0x41e59f){if(_0x41e59f['type'][_0xd2d8('0x39')]!==_0xd2d8('0x3a')){var _0x18d88a={};_0x18d88a[_0x41e59f['field']]={'$like':'%'+_0x2928b4[_0xd2d8('0x2b')][_0xd2d8('0x37')]+'%'};return _0x18d88a;}})});}_0x3b8559=_[_0xd2d8('0x3b')]({},_0x3b8559,_0x2928b4[_0xd2d8('0x3c')]);var _0x27356a={'where':_0x3b8559[_0xd2d8('0x35')]};return db[_0xd2d8('0x27')][_0xd2d8('0x19')](_0x27356a)[_0xd2d8('0x3d')](function(_0x15d8d8){_0x3889dc['count']=_0x15d8d8;if(_0x2928b4['query'][_0xd2d8('0x3e')]){_0x3b8559[_0xd2d8('0x3f')]=[{'all':!![]}];}return db[_0xd2d8('0x27')]['findAll'](_0x3b8559);})[_0xd2d8('0x3d')](function(_0x454c36){_0x3889dc['rows']=_0x454c36;return _0x3889dc;})[_0xd2d8('0x3d')](respondWithFilteredResult(_0xd74515,_0x3b8559))['catch'](handleError(_0xd74515,null));};exports[_0xd2d8('0x40')]=function(_0x14fb88,_0x58f4fe){var _0xf34f73={'raw':![],'where':{'id':_0x14fb88['params']['id']}},_0x2d7d8b={};_0x2d7d8b[_0xd2d8('0x29')]=_[_0xd2d8('0x2a')](db[_0xd2d8('0x27')][_0xd2d8('0x28')]);_0x2d7d8b[_0xd2d8('0x2b')]=_[_0xd2d8('0x2a')](_0x14fb88[_0xd2d8('0x2b')]);_0x2d7d8b[_0xd2d8('0x2c')]=_[_0xd2d8('0x2d')](_0x2d7d8b[_0xd2d8('0x29')],_0x2d7d8b[_0xd2d8('0x2b')]);_0xf34f73['attributes']=_[_0xd2d8('0x2d')](_0x2d7d8b['model'],qs[_0xd2d8('0x2f')](_0x14fb88[_0xd2d8('0x2b')][_0xd2d8('0x2f')]));_0xf34f73['attributes']=_0xf34f73[_0xd2d8('0x2e')][_0xd2d8('0x30')]?_0xf34f73['attributes']:_0x2d7d8b[_0xd2d8('0x29')];if(_0x14fb88[_0xd2d8('0x2b')][_0xd2d8('0x3e')]){_0xf34f73['include']=[{'all':!![]}];}_0xf34f73=_['merge']({},_0xf34f73,_0x14fb88[_0xd2d8('0x3c')]);return db[_0xd2d8('0x27')][_0xd2d8('0x41')](_0xf34f73)['then'](handleEntityNotFound(_0x58f4fe,null))[_0xd2d8('0x3d')](respondWithResult(_0x58f4fe,null))[_0xd2d8('0x42')](handleError(_0x58f4fe,null));};exports['create']=function(_0x58ac22,_0x3f5dbb){return db[_0xd2d8('0x27')]['create'](_0x58ac22['body'],{})[_0xd2d8('0x3d')](respondWithResult(_0x3f5dbb,0xc9))[_0xd2d8('0x42')](handleError(_0x3f5dbb,null));};exports[_0xd2d8('0x20')]=function(_0x487386,_0x5b3df7){if(_0x487386[_0xd2d8('0x43')]['id']){delete _0x487386[_0xd2d8('0x43')]['id'];}return db[_0xd2d8('0x27')][_0xd2d8('0x41')]({'where':{'id':_0x487386[_0xd2d8('0x44')]['id']}})['then'](handleEntityNotFound(_0x5b3df7,null))['then'](saveUpdates(_0x487386[_0xd2d8('0x43')],null))[_0xd2d8('0x3d')](respondWithResult(_0x5b3df7,null))['catch'](handleError(_0x5b3df7,null));};exports[_0xd2d8('0x21')]=function(_0x8adb6,_0x35c5c9){return db[_0xd2d8('0x27')][_0xd2d8('0x41')]({'where':{'id':_0x8adb6['params']['id']}})[_0xd2d8('0x3d')](handleEntityNotFound(_0x35c5c9,null))[_0xd2d8('0x3d')](removeEntity(_0x35c5c9,null))[_0xd2d8('0x42')](handleError(_0x35c5c9,null));};exports[_0xd2d8('0x45')]=function(_0x5df3ca,_0x2549f6){return db[_0xd2d8('0x27')][_0xd2d8('0x45')]()[_0xd2d8('0x3d')](respondWithResult(_0x2549f6,null))[_0xd2d8('0x42')](handleError(_0x2549f6,null));};function manageProductQuotationIntoAsset(_0x1b2592,_0x492742){console[_0xd2d8('0x46')](_0xd2d8('0x47'),_0x1b2592);var _0x533f1d=_0x1b2592[_0xd2d8('0x48')];var _0x1533cb=[];return db['SAAsset'][_0xd2d8('0x49')]({'where':{'companyId':_0x533f1d,'SubscriptionId':_0x1b2592[_0xd2d8('0x4a')],'pricelistId':_0x1b2592[_0xd2d8('0x4b')],'productCode':_0x1b2592[_0xd2d8('0x4c')],'deleted':{'$or':[0x0,null]}},'raw':!![]})['then'](function(_0x349e92){console[_0xd2d8('0x46')](_0xd2d8('0x4d'),_0x349e92);_0x1533cb=_0x349e92;console[_0xd2d8('0x46')](_0xd2d8('0x4e'),_0x1533cb);if(_0x1533cb&&_0x1533cb[_0xd2d8('0x30')]>0x0){var _0x48b7e7=_0x1533cb[0x0][_0xd2d8('0x4f')];var _0x153d6a=_0x1533cb[_0xd2d8('0x30')];return[_0x48b7e7,_0x153d6a];}else{return db[_0xd2d8('0x50')][_0xd2d8('0x51')]({'where':{'companyId':_0x533f1d,'SubscriptionId':_0x1b2592[_0xd2d8('0x4a')],'pricelistId':_0x1b2592[_0xd2d8('0x4b')]},'raw':!![]})['then'](function(_0x271bdb){var _0x55df31=new Date();if(_0x271bdb){_0x55df31=_0x271bdb[_0xd2d8('0x4f')];}return[_0x55df31,0x0];});}})['spread'](function(_0x1fee4e,_0x2cc927){var _0x25e443=Math['abs'](_0x1b2592[_0xd2d8('0x52')]);if(_0x1b2592[_0xd2d8('0x52')]<0x0&&_0x25e443<=_0x2cc927){var _0x1f5acd=_(_0x1533cb)['slice'](0x0,_0x25e443)['map']('id')['value']();return db[_0xd2d8('0x50')][_0xd2d8('0x20')]({'deleted':0x1},{'where':{'id':_0x1f5acd}});}if(_0x1b2592[_0xd2d8('0x52')]<0x0&&Math['abs'](_0x1b2592[_0xd2d8('0x52')])>_0x2cc927){var _0xd6b027={'errors':[{'type':_0xd2d8('0x53'),'message':_0xd2d8('0x54')}]};throw _0xd6b027;}if(_0x1b2592[_0xd2d8('0x52')]>0x0){var _0x4c8afc=new Array();for(var _0x5c4783=0x0;_0x5c4783<_0x1b2592[_0xd2d8('0x52')];_0x5c4783++){var _0x45fa50={'companyName':_0x1b2592[_0xd2d8('0x55')],'companyId':_0x1b2592[_0xd2d8('0x48')],'productName':_0x1b2592[_0xd2d8('0x56')],'productCode':_0x1b2592[_0xd2d8('0x4c')],'productTax':_0x1b2592[_0xd2d8('0x57')],'productDescription':_0x1b2592[_0xd2d8('0x58')],'typeName':_0x1b2592[_0xd2d8('0x59')],'pricelistName':_0x1b2592['pricelistName'],'pricelistId':_0x1b2592[_0xd2d8('0x4b')],'netPrice':_0x1b2592['netPrice'],'discount':_0x1b2592[_0xd2d8('0x5a')],'agentFullname':_0x1b2592[_0xd2d8('0x5b')],'note':_0x1b2592[_0xd2d8('0x5c')],'tax':_0x1b2592[_0xd2d8('0x5d')],'subscriptionId':_0x1b2592[_0xd2d8('0x4a')],'subscriptionName':_0x1b2592[_0xd2d8('0x5e')],'subscriptionMonthly':_0x1b2592[_0xd2d8('0x5f')]};_0x45fa50[_0xd2d8('0x4f')]=_0x1fee4e;_0x45fa50[_0xd2d8('0x48')]=_0x533f1d;_0x4c8afc[_0xd2d8('0x60')](_0x45fa50);}return db[_0xd2d8('0x50')][_0xd2d8('0x61')](_0x4c8afc,{'transaction':_0x492742})[_0xd2d8('0x3d')](function(){return db['SAProductQuotation'][_0xd2d8('0x20')]({'productAsset':0x1},{'where':{'id':_0x1b2592['id']},'transaction':_0x492742});});}});}exports[_0xd2d8('0x62')]=function(_0x4458ab,_0x40eda3,_0x986a25){var _0x395f17=_0x4458ab[_0xd2d8('0x44')]['id'];return db[_0xd2d8('0x63')]['findAll']({'where':{'QuotationId':_0x395f17,'productAsset':{'$ne':0x1}},'raw':!![],'logging':console['log']})[_0xd2d8('0x3d')](function(_0x5a7db2){if(_0x5a7db2[_0xd2d8('0x30')]>0x0){return db[_0xd2d8('0x64')]['transaction'](function(_0x48ed03){var _0x5b31f9=new Array();for(var _0x4e3231=0x0;_0x4e3231<_0x5a7db2[_0xd2d8('0x30')];_0x4e3231++){var _0x414c4c=_['clone'](_0x5a7db2[_0x4e3231]);_0x5b31f9[_0xd2d8('0x60')](manageProductQuotationIntoAsset(_0x414c4c,_0x48ed03));console[_0xd2d8('0x46')](_0xd2d8('0x62'),_0x414c4c);}return BPromise[_0xd2d8('0x65')](_0x5b31f9);});}else{var _0x27e74c={'errors':[{'type':_0xd2d8('0x53'),'message':_0xd2d8('0x66')}]};throw _0x27e74c;}})[_0xd2d8('0x3d')](handleEntityNotFound(_0x40eda3,null))[_0xd2d8('0x3d')](respondWithStatusCode(_0x40eda3,0xc8))[_0xd2d8('0x42')](handleError(_0x40eda3,null));}; \ No newline at end of file diff --git a/server/api/saQuotation/saQuotation.model.js b/server/api/saQuotation/saQuotation.model.js index 5e53818..cab3931 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 _0xf290=['SAQuotation','sa_quotations','util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x14ec07,_0x529dad){var _0x44b5e6=function(_0x485f2a){while(--_0x485f2a){_0x14ec07['push'](_0x14ec07['shift']());}};_0x44b5e6(++_0x529dad);}(_0xf290,0xde));var _0x0f29=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xf290[_0x565c49];return _0x20ca34;};'use strict';var _=require('lodash');var util=require(_0x0f29('0x0'));var logger=require('../../config/logger')(_0x0f29('0x1'));var moment=require('moment');var BPromise=require(_0x0f29('0x2'));var rp=require(_0x0f29('0x3'));var fs=require('fs');var path=require(_0x0f29('0x4'));var rimraf=require(_0x0f29('0x5'));var config=require(_0x0f29('0x6'));var attributes=require('./saQuotation.attributes');module[_0x0f29('0x7')]=function(_0x4911fb,_0x2d5350){return _0x4911fb[_0x0f29('0x8')](_0x0f29('0x9'),attributes,{'tableName':_0x0f29('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9ffd=['SAQuotation','sa_quotations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./saQuotation.attributes','define'];(function(_0x34664d,_0x5a9943){var _0x2865cf=function(_0x292b04){while(--_0x292b04){_0x34664d['push'](_0x34664d['shift']());}};_0x2865cf(++_0x5a9943);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x14e969,_0x2d3ce4){_0x14e969=_0x14e969-0x0;var _0x1d6236=_0x9ffd[_0x14e969];return _0x1d6236;};'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/saQuotation/saQuotation.rpc.js b/server/api/saQuotation/saQuotation.rpc.js index 9433a1a..687e611 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 _0x9082=['info','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','SAQuotation,\x20%s,\x20%s','request\x20sent','SAQuotation,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x4fda96,_0x3456c6){var _0x427652=function(_0x379579){while(--_0x379579){_0x4fda96['push'](_0x4fda96['shift']());}};_0x427652(++_0x3456c6);}(_0x9082,0x110));var _0x2908=function(_0x567bcb,_0x4978c1){_0x567bcb=_0x567bcb-0x0;var _0x4eebc2=_0x9082[_0x567bcb];return _0x4eebc2;};'use strict';var _=require(_0x2908('0x0'));var util=require('util');var moment=require(_0x2908('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2908('0x2'));var db=require(_0x2908('0x3'))['db'];var utils=require(_0x2908('0x4'));var logger=require(_0x2908('0x5'))('rpc');var config=require(_0x2908('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2908('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5024fd,_0x251edc,_0x57a51a){return new BPromise(function(_0x290317,_0x163ad1){return client[_0x2908('0x8')](_0x5024fd,_0x57a51a)[_0x2908('0x9')](function(_0x352d27){logger['info'](_0x2908('0xa'),_0x251edc,_0x2908('0xb'));logger['debug'](_0x2908('0xc'),_0x251edc,'request\x20sent',JSON[_0x2908('0xd')](_0x352d27));if(_0x352d27[_0x2908('0xe')]){if(_0x352d27['error']['code']===0x1f4){logger[_0x2908('0xe')](_0x2908('0xa'),_0x251edc,_0x352d27[_0x2908('0xe')][_0x2908('0xf')]);return _0x163ad1(_0x352d27[_0x2908('0xe')]['message']);}logger[_0x2908('0xe')]('SAQuotation,\x20%s,\x20%s',_0x251edc,_0x352d27[_0x2908('0xe')][_0x2908('0xf')]);return _0x290317(_0x352d27[_0x2908('0xe')][_0x2908('0xf')]);}else{logger[_0x2908('0x10')](_0x2908('0xa'),_0x251edc,_0x2908('0xb'));_0x290317(_0x352d27['result']['message']);}})[_0x2908('0x11')](function(_0x5cd4ed){logger[_0x2908('0xe')](_0x2908('0xa'),_0x251edc,_0x5cd4ed);_0x163ad1(_0x5cd4ed);});});} \ No newline at end of file +var _0x1a6c=['SAQuotation,\x20%s,\x20%s','message','result','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','SAQuotation,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x1a6c,0x67));var _0xc1a6=function(_0x31fe0f,_0x53ef4f){_0x31fe0f=_0x31fe0f-0x0;var _0x4c59c6=_0x1a6c[_0x31fe0f];return _0x4c59c6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc1a6('0x0'));var BPromise=require(_0xc1a6('0x1'));var rs=require(_0xc1a6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc1a6('0x3'));var logger=require(_0xc1a6('0x4'))(_0xc1a6('0x5'));var config=require('../../config/environment');var jayson=require(_0xc1a6('0x6'));var client=jayson[_0xc1a6('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x42d47e,_0x1cdebd,_0x4d5d78){return new BPromise(function(_0x1d791f,_0x24fcdf){return client[_0xc1a6('0x8')](_0x42d47e,_0x4d5d78)[_0xc1a6('0x9')](function(_0x4cc0e1){logger[_0xc1a6('0xa')]('SAQuotation,\x20%s,\x20%s',_0x1cdebd,_0xc1a6('0xb'));logger[_0xc1a6('0xc')](_0xc1a6('0xd'),_0x1cdebd,_0xc1a6('0xb'),JSON[_0xc1a6('0xe')](_0x4cc0e1));if(_0x4cc0e1[_0xc1a6('0xf')]){if(_0x4cc0e1[_0xc1a6('0xf')][_0xc1a6('0x10')]===0x1f4){logger[_0xc1a6('0xf')](_0xc1a6('0x11'),_0x1cdebd,_0x4cc0e1[_0xc1a6('0xf')]['message']);return _0x24fcdf(_0x4cc0e1[_0xc1a6('0xf')][_0xc1a6('0x12')]);}logger[_0xc1a6('0xf')](_0xc1a6('0x11'),_0x1cdebd,_0x4cc0e1[_0xc1a6('0xf')][_0xc1a6('0x12')]);return _0x1d791f(_0x4cc0e1[_0xc1a6('0xf')][_0xc1a6('0x12')]);}else{logger['info']('SAQuotation,\x20%s,\x20%s',_0x1cdebd,_0xc1a6('0xb'));_0x1d791f(_0x4cc0e1[_0xc1a6('0x13')][_0xc1a6('0x12')]);}})['catch'](function(_0x5907ae){logger[_0xc1a6('0xf')](_0xc1a6('0x11'),_0x1cdebd,_0x5907ae);_0x24fcdf(_0x5907ae);});});} \ No newline at end of file diff --git a/server/api/saRequest/index.js b/server/api/saRequest/index.js index d6212bc..4fe797f 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 _0xd37d=['/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./saRequest.controller','isAuthenticated','index','get','/describe','describe','show','post','create'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xd37d,0x1a6));var _0xdd37=function(_0x598152,_0x4230ac){_0x598152=_0x598152-0x0;var _0x71af95=_0xd37d[_0x598152];return _0x71af95;};'use strict';var multer=require(_0xdd37('0x0'));var util=require(_0xdd37('0x1'));var path=require(_0xdd37('0x2'));var timeout=require(_0xdd37('0x3'));var express=require(_0xdd37('0x4'));var router=express[_0xdd37('0x5')]();var auth=require(_0xdd37('0x6'));var interaction=require(_0xdd37('0x7'));var config=require(_0xdd37('0x8'));var controller=require(_0xdd37('0x9'));router['get']('/',auth[_0xdd37('0xa')](),controller[_0xdd37('0xb')]);router[_0xdd37('0xc')](_0xdd37('0xd'),auth[_0xdd37('0xa')](),controller[_0xdd37('0xe')]);router['get']('/:id',auth[_0xdd37('0xa')](),controller[_0xdd37('0xf')]);router[_0xdd37('0x10')]('/',auth[_0xdd37('0xa')](),controller[_0xdd37('0x11')]);router['put'](_0xdd37('0x12'),auth[_0xdd37('0xa')](),controller[_0xdd37('0x13')]);router[_0xdd37('0x14')](_0xdd37('0x12'),auth[_0xdd37('0xa')](),controller[_0xdd37('0x15')]);module['exports']=router; \ No newline at end of file +var _0xd408=['../../components/interaction/service','../../config/environment','./saRequest.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','exports','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xd408,0x112));var _0x8d40=function(_0xfc7ff9,_0x152025){_0xfc7ff9=_0xfc7ff9-0x0;var _0x522ebe=_0xd408[_0xfc7ff9];return _0x522ebe;};'use strict';var multer=require(_0x8d40('0x0'));var util=require(_0x8d40('0x1'));var path=require('path');var timeout=require(_0x8d40('0x2'));var express=require(_0x8d40('0x3'));var router=express[_0x8d40('0x4')]();var auth=require(_0x8d40('0x5'));var interaction=require(_0x8d40('0x6'));var config=require(_0x8d40('0x7'));var controller=require(_0x8d40('0x8'));router[_0x8d40('0x9')]('/',auth[_0x8d40('0xa')](),controller[_0x8d40('0xb')]);router['get'](_0x8d40('0xc'),auth[_0x8d40('0xa')](),controller[_0x8d40('0xd')]);router[_0x8d40('0x9')](_0x8d40('0xe'),auth[_0x8d40('0xa')](),controller[_0x8d40('0xf')]);router['post']('/',auth[_0x8d40('0xa')](),controller[_0x8d40('0x10')]);router[_0x8d40('0x11')](_0x8d40('0xe'),auth[_0x8d40('0xa')](),controller[_0x8d40('0x12')]);router['delete'](_0x8d40('0xe'),auth[_0x8d40('0xa')](),controller['destroy']);module[_0x8d40('0x13')]=router; \ No newline at end of file diff --git a/server/api/saRequest/saRequest.attributes.js b/server/api/saRequest/saRequest.attributes.js index 5d2e1a6..40fab6d 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 _0xf8f8=['STRING','name','TEXT','sequelize','exports','DATE'];(function(_0x322744,_0x1d5e01){var _0x2f1c2d=function(_0x5f4904){while(--_0x5f4904){_0x322744['push'](_0x322744['shift']());}};_0x2f1c2d(++_0x1d5e01);}(_0xf8f8,0x1a1));var _0x8f8f=function(_0x48f3ab,_0x44149f){_0x48f3ab=_0x48f3ab-0x0;var _0x4d23d2=_0xf8f8[_0x48f3ab];return _0x4d23d2;};'use strict';var Sequelize=require(_0x8f8f('0x0'));module[_0x8f8f('0x1')]={'endAt':{'type':Sequelize[_0x8f8f('0x2')]},'name':{'type':Sequelize[_0x8f8f('0x3')],'unique':_0x8f8f('0x4')},'agentFullname':{'type':Sequelize[_0x8f8f('0x3')]},'note':{'type':Sequelize[_0x8f8f('0x5')]}}; \ No newline at end of file +var _0x573e=['sequelize','exports','DATE','STRING','TEXT'];(function(_0x95a619,_0x1f9ad6){var _0x3f9473=function(_0x52f3eb){while(--_0x52f3eb){_0x95a619['push'](_0x95a619['shift']());}};_0x3f9473(++_0x1f9ad6);}(_0x573e,0x19f));var _0xe573=function(_0x1c6bd0,_0x922ac9){_0x1c6bd0=_0x1c6bd0-0x0;var _0x3759d2=_0x573e[_0x1c6bd0];return _0x3759d2;};'use strict';var Sequelize=require(_0xe573('0x0'));module[_0xe573('0x1')]={'endAt':{'type':Sequelize[_0xe573('0x2')]},'name':{'type':Sequelize['STRING'],'unique':'name'},'agentFullname':{'type':Sequelize[_0xe573('0x3')]},'note':{'type':Sequelize[_0xe573('0x4')]}}; \ No newline at end of file diff --git a/server/api/saRequest/saRequest.controller.js b/server/api/saRequest/saRequest.controller.js index a284fc1..2881273 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 _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','SARequest','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort'];(function(_0xc624c0,_0xb64dfe){var _0x215609=function(_0x521179){while(--_0x521179){_0xc624c0['push'](_0xc624c0['shift']());}};_0x215609(++_0xb64dfe);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];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['SARequest'][_0x0a9e('0x17')](_0x381c37)[_0x0a9e('0x1f')](function(_0x3cae){_0x45a1e7['count']=_0x3cae;if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x384319[_0x0a9e('0x3a')]=[{'all':!![]}];}return db['SARequest']['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['SARequest'][_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 _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(_0x3955ec,_0x3337ea){var _0x36dc80=function(_0x3b2264){while(--_0x3b2264){_0x3955ec['push'](_0x3955ec['shift']());}};_0x36dc80(++_0x3337ea);}(_0xb10b,0x12a));var _0xbb10=function(_0x54cef6,_0x146b0e){_0x54cef6=_0x54cef6-0x0;var _0x39aacf=_0xb10b[_0x54cef6];return _0x39aacf;};'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 42908b7..ff5a3c1 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(_0x15fd56,_0x156e45){var _0x29d58a=function(_0x50a977){while(--_0x50a977){_0x15fd56['push'](_0x15fd56['shift']());}};_0x29d58a(++_0x156e45);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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(_0x1cf7c2,_0x35b5e1){var _0x5230c5=function(_0x2cb53a){while(--_0x2cb53a){_0x1cf7c2['push'](_0x1cf7c2['shift']());}};_0x5230c5(++_0x35b5e1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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 fc24066..243f39b 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 _0xe9cb=['../../config/logger','rpc','jayson/promise','info','SARequest,\x20%s,\x20%s','request\x20sent','debug','SARequest,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe9cb,0xcb));var _0xbe9c=function(_0x3988a1,_0x2eaac1){_0x3988a1=_0x3988a1-0x0;var _0x37be64=_0xe9cb[_0x3988a1];return _0x37be64;};'use strict';var _=require(_0xbe9c('0x0'));var util=require(_0xbe9c('0x1'));var moment=require(_0xbe9c('0x2'));var BPromise=require(_0xbe9c('0x3'));var rs=require(_0xbe9c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbe9c('0x5'))(_0xbe9c('0x6'));var config=require('../../config/environment');var jayson=require(_0xbe9c('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x7c4a48,_0x564129,_0x58180e){return new BPromise(function(_0xb94a00,_0x3cef0d){return client['request'](_0x7c4a48,_0x58180e)['then'](function(_0x3f7b97){logger[_0xbe9c('0x8')](_0xbe9c('0x9'),_0x564129,_0xbe9c('0xa'));logger[_0xbe9c('0xb')](_0xbe9c('0xc'),_0x564129,_0xbe9c('0xa'),JSON['stringify'](_0x3f7b97));if(_0x3f7b97[_0xbe9c('0xd')]){if(_0x3f7b97[_0xbe9c('0xd')]['code']===0x1f4){logger[_0xbe9c('0xd')](_0xbe9c('0x9'),_0x564129,_0x3f7b97[_0xbe9c('0xd')][_0xbe9c('0xe')]);return _0x3cef0d(_0x3f7b97[_0xbe9c('0xd')][_0xbe9c('0xe')]);}logger[_0xbe9c('0xd')](_0xbe9c('0x9'),_0x564129,_0x3f7b97[_0xbe9c('0xd')][_0xbe9c('0xe')]);return _0xb94a00(_0x3f7b97[_0xbe9c('0xd')][_0xbe9c('0xe')]);}else{logger[_0xbe9c('0x8')]('SARequest,\x20%s,\x20%s',_0x564129,_0xbe9c('0xa'));_0xb94a00(_0x3f7b97['result'][_0xbe9c('0xe')]);}})[_0xbe9c('0xf')](function(_0x2725f7){logger[_0xbe9c('0xd')]('SARequest,\x20%s,\x20%s',_0x564129,_0x2725f7);_0x3cef0d(_0x2725f7);});});} \ No newline at end of file +var _0xdb53=['error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','SARequest,\x20%s,\x20%s','request\x20sent','debug','SARequest,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3e9dde,_0x4eaa08){var _0x53021b=function(_0x4b247a){while(--_0x4b247a){_0x3e9dde['push'](_0x3e9dde['shift']());}};_0x53021b(++_0x4eaa08);}(_0xdb53,0xf6));var _0x3db5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdb53[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3db5('0x0'));var util=require(_0x3db5('0x1'));var moment=require(_0x3db5('0x2'));var BPromise=require(_0x3db5('0x3'));var rs=require(_0x3db5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3db5('0x5'))['db'];var utils=require(_0x3db5('0x6'));var logger=require('../../config/logger')(_0x3db5('0x7'));var config=require('../../config/environment');var jayson=require(_0x3db5('0x8'));var client=jayson[_0x3db5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d1c47,_0x499e93,_0x20d55f){return new BPromise(function(_0x5cff91,_0x25e5d1){return client[_0x3db5('0xa')](_0x2d1c47,_0x20d55f)[_0x3db5('0xb')](function(_0x470656){logger[_0x3db5('0xc')](_0x3db5('0xd'),_0x499e93,_0x3db5('0xe'));logger[_0x3db5('0xf')](_0x3db5('0x10'),_0x499e93,_0x3db5('0xe'),JSON[_0x3db5('0x11')](_0x470656));if(_0x470656[_0x3db5('0x12')]){if(_0x470656[_0x3db5('0x12')][_0x3db5('0x13')]===0x1f4){logger[_0x3db5('0x12')](_0x3db5('0xd'),_0x499e93,_0x470656[_0x3db5('0x12')][_0x3db5('0x14')]);return _0x25e5d1(_0x470656[_0x3db5('0x12')]['message']);}logger[_0x3db5('0x12')](_0x3db5('0xd'),_0x499e93,_0x470656[_0x3db5('0x12')][_0x3db5('0x14')]);return _0x5cff91(_0x470656[_0x3db5('0x12')][_0x3db5('0x14')]);}else{logger[_0x3db5('0xc')](_0x3db5('0xd'),_0x499e93,_0x3db5('0xe'));_0x5cff91(_0x470656['result']['message']);}})[_0x3db5('0x15')](function(_0x27a584){logger[_0x3db5('0x12')](_0x3db5('0xd'),_0x499e93,_0x27a584);_0x25e5d1(_0x27a584);});});} \ No newline at end of file diff --git a/server/api/saSalesCondition/index.js b/server/api/saSalesCondition/index.js index 7112591..3e3e1f0 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 _0x9303=['./saSalesCondition.controller','get','index','isAuthenticated','show','post','create','exports','util','path','Router','../../components/auth/service','../../config/environment'];(function(_0x85b464,_0xb32a20){var _0x75dc19=function(_0x1706e5){while(--_0x1706e5){_0x85b464['push'](_0x85b464['shift']());}};_0x75dc19(++_0xb32a20);}(_0x9303,0x1dc));var _0x3930=function(_0x23c262,_0x74765a){_0x23c262=_0x23c262-0x0;var _0x9b913f=_0x9303[_0x23c262];return _0x9b913f;};'use strict';var multer=require('multer');var util=require(_0x3930('0x0'));var path=require(_0x3930('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3930('0x2')]();var auth=require(_0x3930('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x3930('0x4'));var controller=require(_0x3930('0x5'));router[_0x3930('0x6')]('/',auth['isAuthenticated'](),controller[_0x3930('0x7')]);router['get']('/:id',auth[_0x3930('0x8')](),controller[_0x3930('0x9')]);router[_0x3930('0xa')]('/',auth['isAuthenticated'](),controller[_0x3930('0xb')]);module[_0x3930('0xc')]=router; \ No newline at end of file +var _0x9e3e=['../../config/environment','get','index','/:id','show','post','multer','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x507b3b,_0x30c190){var _0xe1e48e=function(_0x1865ed){while(--_0x1865ed){_0x507b3b['push'](_0x507b3b['shift']());}};_0xe1e48e(++_0x30c190);}(_0x9e3e,0x166));var _0xe9e3=function(_0x30063a,_0x4a55c8){_0x30063a=_0x30063a-0x0;var _0x2024d2=_0x9e3e[_0x30063a];return _0x2024d2;};'use strict';var multer=require(_0xe9e3('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe9e3('0x1'));var router=express[_0xe9e3('0x2')]();var auth=require(_0xe9e3('0x3'));var interaction=require(_0xe9e3('0x4'));var config=require(_0xe9e3('0x5'));var controller=require('./saSalesCondition.controller');router[_0xe9e3('0x6')]('/',auth['isAuthenticated'](),controller[_0xe9e3('0x7')]);router[_0xe9e3('0x6')](_0xe9e3('0x8'),auth['isAuthenticated'](),controller[_0xe9e3('0x9')]);router[_0xe9e3('0xa')]('/',auth['isAuthenticated'](),controller['create']);module['exports']=router; \ No newline at end of file diff --git a/server/api/saSalesCondition/saSalesCondition.attributes.js b/server/api/saSalesCondition/saSalesCondition.attributes.js index 5c4d832..a62d265 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 _0xed1f=['INTEGER','sequelize','exports','STRING','name'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0xed1f,0x6a));var _0xfed1=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0xed1f[_0x819464];return _0x49dcc0;};'use strict';var Sequelize=require(_0xfed1('0x0'));module[_0xfed1('0x1')]={'name':{'type':Sequelize[_0xfed1('0x2')],'allowNull':![],'unique':_0xfed1('0x3')},'momthlysubscription':{'type':Sequelize[_0xfed1('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0x99e9=['exports','STRING','name','INTEGER'];(function(_0x4a82de,_0x19c2bb){var _0x3b39c1=function(_0x5d8d6f){while(--_0x5d8d6f){_0x4a82de['push'](_0x4a82de['shift']());}};_0x3b39c1(++_0x19c2bb);}(_0x99e9,0xb4));var _0x999e=function(_0x45d80c,_0x35c0ff){_0x45d80c=_0x45d80c-0x0;var _0x449a98=_0x99e9[_0x45d80c];return _0x449a98;};'use strict';var Sequelize=require('sequelize');module[_0x999e('0x0')]={'name':{'type':Sequelize[_0x999e('0x1')],'allowNull':![],'unique':_0x999e('0x2')},'momthlysubscription':{'type':Sequelize[_0x999e('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/saSalesCondition/saSalesCondition.controller.js b/server/api/saSalesCondition/saSalesCondition.controller.js index 00d971e..36e292a 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 _0x52fd=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','Content-Range','reject','update','then','error','name','send','index','SASalesCondition','query','keys','filters','intersection','model','fields','attributes','nolimit','sort','pick','filter','merge','where','type','key','VIRTUAL','includeAll','include','findAll','rows','show','params','rawAttributes','options','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0xa3463d,_0x32f8da){var _0x50fd67=function(_0xb984fd){while(--_0xb984fd){_0xa3463d['push'](_0xa3463d['shift']());}};_0x50fd67(++_0x32f8da);}(_0x52fd,0x1df));var _0xd52f=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0x52fd[_0x4ae829];return _0x256b31;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd52f('0x0'));var rimraf=require(_0xd52f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd52f('0x2'));var rp=require(_0xd52f('0x3'));var moment=require(_0xd52f('0x4'));var BPromise=require(_0xd52f('0x5'));var Mustache=require('mustache');var util=require(_0xd52f('0x6'));var path=require(_0xd52f('0x7'));var sox=require('sox');var csv=require(_0xd52f('0x8'));var ejs=require(_0xd52f('0x9'));var fs=require('fs');var _=require(_0xd52f('0xa'));var squel=require(_0xd52f('0xb'));var crypto=require(_0xd52f('0xc'));var jsforce=require(_0xd52f('0xd'));var deskjs=require(_0xd52f('0xe'));var toCsv=require(_0xd52f('0x8'));var querystring=require(_0xd52f('0xf'));var Papa=require(_0xd52f('0x10'));var Redis=require(_0xd52f('0x11'));var authService=require(_0xd52f('0x12'));var qs=require(_0xd52f('0x13'));var hardwareService=require(_0xd52f('0x14'));var logger=require(_0xd52f('0x15'))(_0xd52f('0x16'));var utils=require(_0xd52f('0x17'));var config=require(_0xd52f('0x18'));var db=require(_0xd52f('0x19'))['db'];function respondWithStatusCode(_0xfcef2d,_0x5a2d7a){_0x5a2d7a=_0x5a2d7a||0xcc;return function(_0x55d6e9){if(_0x55d6e9){return _0xfcef2d[_0xd52f('0x1a')](_0x5a2d7a);}return _0xfcef2d['status'](_0x5a2d7a)[_0xd52f('0x1b')]();};}function respondWithResult(_0x4b094e,_0x27ad82){_0x27ad82=_0x27ad82||0xc8;return function(_0x18b8e5){if(_0x18b8e5){return _0x4b094e['status'](_0x27ad82)[_0xd52f('0x1c')](_0x18b8e5);}};}function respondWithFilteredResult(_0x1a71c2,_0x3927f2){return function(_0x417542){if(_0x417542){var _0x11e463=_0x417542[_0xd52f('0x1d')],_0x23ae22=_0x3927f2[_0xd52f('0x1e')],_0x106873=_0x3927f2[_0xd52f('0x1e')]+_0x3927f2[_0xd52f('0x1f')],_0x3a27b8;if(_0x106873>=_0x11e463){_0x106873=_0x11e463;_0x3a27b8=0xc8;}else{_0x3a27b8=0xce;}_0x1a71c2[_0xd52f('0x20')](_0x3a27b8);return _0x1a71c2[_0xd52f('0x21')](_0xd52f('0x22'),_0x23ae22+'-'+_0x106873+'/'+_0x11e463)['json'](_0x417542);}return null;};}function patchUpdates(_0x1cbf1d){return function(_0x19925a){try{jsonpatch['apply'](_0x19925a,_0x1cbf1d,!![]);}catch(_0x416e39){return BPromise[_0xd52f('0x23')](_0x416e39);}return _0x19925a['save']();};}function saveUpdates(_0x16b2de,_0x1ce694){return function(_0x5b11d1){if(_0x5b11d1){return _0x5b11d1[_0xd52f('0x24')](_0x16b2de)[_0xd52f('0x25')](function(_0x326f3d){return _0x326f3d;});}return null;};}function removeEntity(_0x46d868,_0x43d13f){return function(_0x1daaa1){if(_0x1daaa1){return _0x1daaa1['destroy']()[_0xd52f('0x25')](function(){_0x46d868[_0xd52f('0x20')](0xcc)[_0xd52f('0x1b')]();});}};}function handleEntityNotFound(_0x52c401,_0x1db722){return function(_0x56dd34){if(!_0x56dd34){_0x52c401[_0xd52f('0x1a')](0x194);}return _0x56dd34;};}function handleError(_0x439fd1,_0x3c5fd2){_0x3c5fd2=_0x3c5fd2||0x1f4;return function(_0x488647){logger[_0xd52f('0x26')](_0x488647['stack']);if(_0x488647[_0xd52f('0x27')]){delete _0x488647[_0xd52f('0x27')];}_0x439fd1[_0xd52f('0x20')](_0x3c5fd2)[_0xd52f('0x28')](_0x488647);};}exports[_0xd52f('0x29')]=function(_0x28e24d,_0x245466){var _0x4c08e4={'raw':!![]},_0x2fd567={},_0x62ec32={'count':0x0,'rows':[]};var _0x399fe8=db[_0xd52f('0x2a')]['rawAttributes'];_0x2fd567['model']=_['keys'](_0x399fe8);_0x2fd567[_0xd52f('0x2b')]=_[_0xd52f('0x2c')](_0x28e24d[_0xd52f('0x2b')]);_0x2fd567[_0xd52f('0x2d')]=_[_0xd52f('0x2e')](_0x2fd567['model'],_0x2fd567[_0xd52f('0x2b')]);_0x4c08e4['attributes']=_[_0xd52f('0x2e')](_0x2fd567[_0xd52f('0x2f')],qs[_0xd52f('0x30')](_0x28e24d[_0xd52f('0x2b')][_0xd52f('0x30')]));_0x4c08e4[_0xd52f('0x31')]=_0x4c08e4['attributes']['length']?_0x4c08e4[_0xd52f('0x31')]:_0x2fd567[_0xd52f('0x2f')];if(!_0x28e24d[_0xd52f('0x2b')]['hasOwnProperty'](_0xd52f('0x32'))){_0x4c08e4[_0xd52f('0x1f')]=qs['limit'](_0x28e24d['query'][_0xd52f('0x1f')]);_0x4c08e4[_0xd52f('0x1e')]=qs[_0xd52f('0x1e')](_0x28e24d[_0xd52f('0x2b')][_0xd52f('0x1e')]);}_0x4c08e4['order']=qs['sort'](_0x28e24d[_0xd52f('0x2b')][_0xd52f('0x33')]);_0x4c08e4['where']=qs[_0xd52f('0x2d')](_[_0xd52f('0x34')](_0x28e24d[_0xd52f('0x2b')],_0x2fd567['filters']));if(_0x28e24d[_0xd52f('0x2b')][_0xd52f('0x35')]){_0x4c08e4['where']=_[_0xd52f('0x36')](_0x4c08e4[_0xd52f('0x37')],{'$or':_['map'](_0x399fe8,function(_0x24c689){if(_0x24c689[_0xd52f('0x38')][_0xd52f('0x39')]!==_0xd52f('0x3a')){var _0x257eb3={};_0x257eb3[_0x24c689['field']]={'$like':'%'+_0x28e24d[_0xd52f('0x2b')]['filter']+'%'};return _0x257eb3;}})});}_0x4c08e4=_[_0xd52f('0x36')]({},_0x4c08e4,_0x28e24d['options']);var _0x27c8bc={'where':_0x4c08e4[_0xd52f('0x37')]};return db[_0xd52f('0x2a')][_0xd52f('0x1d')](_0x27c8bc)[_0xd52f('0x25')](function(_0xeb47be){_0x62ec32[_0xd52f('0x1d')]=_0xeb47be;if(_0x28e24d[_0xd52f('0x2b')][_0xd52f('0x3b')]){_0x4c08e4[_0xd52f('0x3c')]=[{'all':!![]}];}return db[_0xd52f('0x2a')][_0xd52f('0x3d')](_0x4c08e4);})[_0xd52f('0x25')](function(_0x3f069f){_0x62ec32[_0xd52f('0x3e')]=_0x3f069f;return _0x62ec32;})[_0xd52f('0x25')](respondWithFilteredResult(_0x245466,_0x4c08e4))['catch'](handleError(_0x245466,null));};exports[_0xd52f('0x3f')]=function(_0x80e5cf,_0x48758c){var _0x3e25b1={'raw':!![],'where':{'id':_0x80e5cf[_0xd52f('0x40')]['id']}},_0xc026f={};_0xc026f[_0xd52f('0x2f')]=_[_0xd52f('0x2c')](db['SASalesCondition'][_0xd52f('0x41')]);_0xc026f[_0xd52f('0x2b')]=_[_0xd52f('0x2c')](_0x80e5cf[_0xd52f('0x2b')]);_0xc026f['filters']=_[_0xd52f('0x2e')](_0xc026f[_0xd52f('0x2f')],_0xc026f[_0xd52f('0x2b')]);_0x3e25b1['attributes']=_[_0xd52f('0x2e')](_0xc026f['model'],qs[_0xd52f('0x30')](_0x80e5cf[_0xd52f('0x2b')][_0xd52f('0x30')]));_0x3e25b1['attributes']=_0x3e25b1[_0xd52f('0x31')]['length']?_0x3e25b1[_0xd52f('0x31')]:_0xc026f['model'];if(_0x80e5cf[_0xd52f('0x2b')][_0xd52f('0x3b')]){_0x3e25b1[_0xd52f('0x3c')]=[{'all':!![]}];}_0x3e25b1=_['merge']({},_0x3e25b1,_0x80e5cf[_0xd52f('0x42')]);return db[_0xd52f('0x2a')][_0xd52f('0x43')](_0x3e25b1)[_0xd52f('0x25')](handleEntityNotFound(_0x48758c,null))[_0xd52f('0x25')](respondWithResult(_0x48758c,null))[_0xd52f('0x44')](handleError(_0x48758c,null));};exports['create']=function(_0x1cb4d2,_0x4f6171){return db[_0xd52f('0x2a')][_0xd52f('0x45')](_0x1cb4d2[_0xd52f('0x46')],{})[_0xd52f('0x25')](respondWithResult(_0x4f6171,0xc9))[_0xd52f('0x44')](handleError(_0x4f6171,null));}; \ No newline at end of file +var _0x3c5a=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','SASalesCondition','rawAttributes','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','findAll','rows','catch','show','params','length','include','find','create','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger'];(function(_0x2091f7,_0x59caca){var _0x3ce444=function(_0x5ea1c2){while(--_0x5ea1c2){_0x2091f7['push'](_0x2091f7['shift']());}};_0x3ce444(++_0x59caca);}(_0x3c5a,0x1e5));var _0xa3c5=function(_0x2678d6,_0x4e2001){_0x2678d6=_0x2678d6-0x0;var _0x475503=_0x3c5a[_0x2678d6];return _0x475503;};'use strict';var pdf=require(_0xa3c5('0x0'));var emlformat=require(_0xa3c5('0x1'));var rimraf=require(_0xa3c5('0x2'));var zipdir=require(_0xa3c5('0x3'));var jsonpatch=require(_0xa3c5('0x4'));var rp=require(_0xa3c5('0x5'));var moment=require(_0xa3c5('0x6'));var BPromise=require(_0xa3c5('0x7'));var Mustache=require(_0xa3c5('0x8'));var util=require('util');var path=require(_0xa3c5('0x9'));var sox=require(_0xa3c5('0xa'));var csv=require(_0xa3c5('0xb'));var ejs=require(_0xa3c5('0xc'));var fs=require('fs');var _=require(_0xa3c5('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa3c5('0xb'));var querystring=require(_0xa3c5('0xe'));var Papa=require(_0xa3c5('0xf'));var Redis=require('ioredis');var authService=require(_0xa3c5('0x10'));var qs=require(_0xa3c5('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa3c5('0x12'))('api');var utils=require(_0xa3c5('0x13'));var config=require(_0xa3c5('0x14'));var db=require(_0xa3c5('0x15'))['db'];function respondWithStatusCode(_0x561c83,_0x224e7f){_0x224e7f=_0x224e7f||0xcc;return function(_0x25c1b6){if(_0x25c1b6){return _0x561c83[_0xa3c5('0x16')](_0x224e7f);}return _0x561c83[_0xa3c5('0x17')](_0x224e7f)['end']();};}function respondWithResult(_0x14b1cd,_0x40417e){_0x40417e=_0x40417e||0xc8;return function(_0x443755){if(_0x443755){return _0x14b1cd[_0xa3c5('0x17')](_0x40417e)[_0xa3c5('0x18')](_0x443755);}};}function respondWithFilteredResult(_0x164441,_0x56b966){return function(_0x2d8b4a){if(_0x2d8b4a){var _0x4fb74f=_0x2d8b4a[_0xa3c5('0x19')],_0x412f0f=_0x56b966[_0xa3c5('0x1a')],_0x15e9f5=_0x56b966['offset']+_0x56b966[_0xa3c5('0x1b')],_0x3bca5a;if(_0x15e9f5>=_0x4fb74f){_0x15e9f5=_0x4fb74f;_0x3bca5a=0xc8;}else{_0x3bca5a=0xce;}_0x164441[_0xa3c5('0x17')](_0x3bca5a);return _0x164441['set'](_0xa3c5('0x1c'),_0x412f0f+'-'+_0x15e9f5+'/'+_0x4fb74f)['json'](_0x2d8b4a);}return null;};}function patchUpdates(_0x317532){return function(_0x10a917){try{jsonpatch[_0xa3c5('0x1d')](_0x10a917,_0x317532,!![]);}catch(_0x2f0e39){return BPromise[_0xa3c5('0x1e')](_0x2f0e39);}return _0x10a917[_0xa3c5('0x1f')]();};}function saveUpdates(_0x4a2dc4,_0x4bd3aa){return function(_0x1ef9d3){if(_0x1ef9d3){return _0x1ef9d3[_0xa3c5('0x20')](_0x4a2dc4)[_0xa3c5('0x21')](function(_0x2cbe79){return _0x2cbe79;});}return null;};}function removeEntity(_0x1e6664,_0x43193b){return function(_0x7778e7){if(_0x7778e7){return _0x7778e7[_0xa3c5('0x22')]()[_0xa3c5('0x21')](function(){_0x1e6664[_0xa3c5('0x17')](0xcc)[_0xa3c5('0x23')]();});}};}function handleEntityNotFound(_0x246e34,_0x4a01f3){return function(_0x238e0d){if(!_0x238e0d){_0x246e34['sendStatus'](0x194);}return _0x238e0d;};}function handleError(_0x370d08,_0x3f80d6){_0x3f80d6=_0x3f80d6||0x1f4;return function(_0x206ac8){logger[_0xa3c5('0x24')](_0x206ac8[_0xa3c5('0x25')]);if(_0x206ac8[_0xa3c5('0x26')]){delete _0x206ac8[_0xa3c5('0x26')];}_0x370d08['status'](_0x3f80d6)[_0xa3c5('0x27')](_0x206ac8);};}exports[_0xa3c5('0x28')]=function(_0x1c5331,_0x33db11){var _0x595a2a={'raw':!![]},_0x20b273={},_0x22e2ce={'count':0x0,'rows':[]};var _0x3169bd=db[_0xa3c5('0x29')][_0xa3c5('0x2a')];_0x20b273[_0xa3c5('0x2b')]=_['keys'](_0x3169bd);_0x20b273[_0xa3c5('0x2c')]=_[_0xa3c5('0x2d')](_0x1c5331['query']);_0x20b273[_0xa3c5('0x2e')]=_['intersection'](_0x20b273[_0xa3c5('0x2b')],_0x20b273['query']);_0x595a2a['attributes']=_[_0xa3c5('0x2f')](_0x20b273[_0xa3c5('0x2b')],qs[_0xa3c5('0x30')](_0x1c5331[_0xa3c5('0x2c')][_0xa3c5('0x30')]));_0x595a2a[_0xa3c5('0x31')]=_0x595a2a[_0xa3c5('0x31')]['length']?_0x595a2a['attributes']:_0x20b273[_0xa3c5('0x2b')];if(!_0x1c5331[_0xa3c5('0x2c')][_0xa3c5('0x32')](_0xa3c5('0x33'))){_0x595a2a[_0xa3c5('0x1b')]=qs[_0xa3c5('0x1b')](_0x1c5331[_0xa3c5('0x2c')][_0xa3c5('0x1b')]);_0x595a2a[_0xa3c5('0x1a')]=qs[_0xa3c5('0x1a')](_0x1c5331['query'][_0xa3c5('0x1a')]);}_0x595a2a[_0xa3c5('0x34')]=qs['sort'](_0x1c5331[_0xa3c5('0x2c')]['sort']);_0x595a2a['where']=qs[_0xa3c5('0x2e')](_[_0xa3c5('0x35')](_0x1c5331[_0xa3c5('0x2c')],_0x20b273[_0xa3c5('0x2e')]));if(_0x1c5331[_0xa3c5('0x2c')][_0xa3c5('0x36')]){_0x595a2a[_0xa3c5('0x37')]=_[_0xa3c5('0x38')](_0x595a2a[_0xa3c5('0x37')],{'$or':_[_0xa3c5('0x39')](_0x3169bd,function(_0x19e555){if(_0x19e555[_0xa3c5('0x3a')][_0xa3c5('0x3b')]!==_0xa3c5('0x3c')){var _0x280298={};_0x280298[_0x19e555[_0xa3c5('0x3d')]]={'$like':'%'+_0x1c5331[_0xa3c5('0x2c')][_0xa3c5('0x36')]+'%'};return _0x280298;}})});}_0x595a2a=_[_0xa3c5('0x38')]({},_0x595a2a,_0x1c5331[_0xa3c5('0x3e')]);var _0x1784b8={'where':_0x595a2a[_0xa3c5('0x37')]};return db[_0xa3c5('0x29')][_0xa3c5('0x19')](_0x1784b8)[_0xa3c5('0x21')](function(_0x594d87){_0x22e2ce['count']=_0x594d87;if(_0x1c5331[_0xa3c5('0x2c')]['includeAll']){_0x595a2a['include']=[{'all':!![]}];}return db[_0xa3c5('0x29')][_0xa3c5('0x3f')](_0x595a2a);})[_0xa3c5('0x21')](function(_0x5b4227){_0x22e2ce[_0xa3c5('0x40')]=_0x5b4227;return _0x22e2ce;})[_0xa3c5('0x21')](respondWithFilteredResult(_0x33db11,_0x595a2a))[_0xa3c5('0x41')](handleError(_0x33db11,null));};exports[_0xa3c5('0x42')]=function(_0x18e1c4,_0x25297c){var _0x454e70={'raw':!![],'where':{'id':_0x18e1c4[_0xa3c5('0x43')]['id']}},_0x5bba5d={};_0x5bba5d[_0xa3c5('0x2b')]=_['keys'](db[_0xa3c5('0x29')][_0xa3c5('0x2a')]);_0x5bba5d[_0xa3c5('0x2c')]=_[_0xa3c5('0x2d')](_0x18e1c4[_0xa3c5('0x2c')]);_0x5bba5d['filters']=_[_0xa3c5('0x2f')](_0x5bba5d[_0xa3c5('0x2b')],_0x5bba5d['query']);_0x454e70['attributes']=_[_0xa3c5('0x2f')](_0x5bba5d[_0xa3c5('0x2b')],qs[_0xa3c5('0x30')](_0x18e1c4[_0xa3c5('0x2c')]['fields']));_0x454e70[_0xa3c5('0x31')]=_0x454e70['attributes'][_0xa3c5('0x44')]?_0x454e70['attributes']:_0x5bba5d[_0xa3c5('0x2b')];if(_0x18e1c4['query']['includeAll']){_0x454e70[_0xa3c5('0x45')]=[{'all':!![]}];}_0x454e70=_[_0xa3c5('0x38')]({},_0x454e70,_0x18e1c4[_0xa3c5('0x3e')]);return db['SASalesCondition'][_0xa3c5('0x46')](_0x454e70)['then'](handleEntityNotFound(_0x25297c,null))[_0xa3c5('0x21')](respondWithResult(_0x25297c,null))[_0xa3c5('0x41')](handleError(_0x25297c,null));};exports[_0xa3c5('0x47')]=function(_0x3df108,_0x485bd0){return db['SASalesCondition'][_0xa3c5('0x47')](_0x3df108['body'],{})[_0xa3c5('0x21')](respondWithResult(_0x485bd0,0xc9))[_0xa3c5('0x41')](handleError(_0x485bd0,null));}; \ No newline at end of file diff --git a/server/api/saSalesCondition/saSalesCondition.model.js b/server/api/saSalesCondition/saSalesCondition.model.js index 780e42b..9278481 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 _0xc1a6=['./saSalesCondition.attributes','exports','define','SASalesCondition','sa_sales_conditions','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x333767,_0x3e6f9c){var _0x51661b=function(_0x46e5d6){while(--_0x46e5d6){_0x333767['push'](_0x333767['shift']());}};_0x51661b(++_0x3e6f9c);}(_0xc1a6,0x109));var _0x6c1a=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xc1a6[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require(_0x6c1a('0x0'));var logger=require(_0x6c1a('0x1'))(_0x6c1a('0x2'));var moment=require(_0x6c1a('0x3'));var BPromise=require('bluebird');var rp=require(_0x6c1a('0x4'));var fs=require('fs');var path=require(_0x6c1a('0x5'));var rimraf=require(_0x6c1a('0x6'));var config=require(_0x6c1a('0x7'));var attributes=require(_0x6c1a('0x8'));module[_0x6c1a('0x9')]=function(_0x44334d,_0x2a3185){return _0x44334d[_0x6c1a('0xa')](_0x6c1a('0xb'),attributes,{'tableName':_0x6c1a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbab7=['rimraf','../../config/environment','exports','define','sa_sales_conditions','lodash','util','api','moment','bluebird'];(function(_0x7185f7,_0x37065){var _0x182e45=function(_0x519e0d){while(--_0x519e0d){_0x7185f7['push'](_0x7185f7['shift']());}};_0x182e45(++_0x37065);}(_0xbab7,0x1db));var _0x7bab=function(_0x2475a6,_0x27e01b){_0x2475a6=_0x2475a6-0x0;var _0x29e949=_0xbab7[_0x2475a6];return _0x29e949;};'use strict';var _=require(_0x7bab('0x0'));var util=require(_0x7bab('0x1'));var logger=require('../../config/logger')(_0x7bab('0x2'));var moment=require(_0x7bab('0x3'));var BPromise=require(_0x7bab('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7bab('0x5'));var config=require(_0x7bab('0x6'));var attributes=require('./saSalesCondition.attributes');module[_0x7bab('0x7')]=function(_0x3b9a16,_0xe5eec2){return _0x3b9a16[_0x7bab('0x8')]('SASalesCondition',attributes,{'tableName':_0x7bab('0x9'),'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 41557dd..a38eb52 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 _0xa8fc=['then','request\x20sent','debug','stringify','error','message','SASalesCondition,\x20%s,\x20%s','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x232d5b,_0x238ca1){var _0x696d56=function(_0x34a006){while(--_0x34a006){_0x232d5b['push'](_0x232d5b['shift']());}};_0x696d56(++_0x238ca1);}(_0xa8fc,0x78));var _0xca8f=function(_0xfa8c4,_0x129d61){_0xfa8c4=_0xfa8c4-0x0;var _0xbff44b=_0xa8fc[_0xfa8c4];return _0xbff44b;};'use strict';var _=require('lodash');var util=require(_0xca8f('0x0'));var moment=require(_0xca8f('0x1'));var BPromise=require(_0xca8f('0x2'));var rs=require(_0xca8f('0x3'));var fs=require('fs');var Redis=require(_0xca8f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xca8f('0x5'));var logger=require('../../config/logger')(_0xca8f('0x6'));var config=require(_0xca8f('0x7'));var jayson=require(_0xca8f('0x8'));var client=jayson[_0xca8f('0x9')][_0xca8f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x149893,_0x2ff6d3,_0x15f858){return new BPromise(function(_0x1362a1,_0x331c0f){return client[_0xca8f('0xb')](_0x149893,_0x15f858)[_0xca8f('0xc')](function(_0x5fd745){logger['info']('SASalesCondition,\x20%s,\x20%s',_0x2ff6d3,_0xca8f('0xd'));logger[_0xca8f('0xe')]('SASalesCondition,\x20%s,\x20%s,\x20%s',_0x2ff6d3,_0xca8f('0xd'),JSON[_0xca8f('0xf')](_0x5fd745));if(_0x5fd745[_0xca8f('0x10')]){if(_0x5fd745['error']['code']===0x1f4){logger[_0xca8f('0x10')]('SASalesCondition,\x20%s,\x20%s',_0x2ff6d3,_0x5fd745[_0xca8f('0x10')][_0xca8f('0x11')]);return _0x331c0f(_0x5fd745[_0xca8f('0x10')][_0xca8f('0x11')]);}logger['error'](_0xca8f('0x12'),_0x2ff6d3,_0x5fd745[_0xca8f('0x10')][_0xca8f('0x11')]);return _0x1362a1(_0x5fd745[_0xca8f('0x10')][_0xca8f('0x11')]);}else{logger[_0xca8f('0x13')]('SASalesCondition,\x20%s,\x20%s',_0x2ff6d3,_0xca8f('0xd'));_0x1362a1(_0x5fd745[_0xca8f('0x14')][_0xca8f('0x11')]);}})[_0xca8f('0x15')](function(_0x449de7){logger[_0xca8f('0x10')](_0xca8f('0x12'),_0x2ff6d3,_0x449de7);_0x331c0f(_0x449de7);});});} \ No newline at end of file +var _0x1622=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SASalesCondition,\x20%s,\x20%s','request\x20sent','debug','SASalesCondition,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment'];(function(_0x2ea686,_0x878c54){var _0x323d3a=function(_0x432789){while(--_0x432789){_0x2ea686['push'](_0x2ea686['shift']());}};_0x323d3a(++_0x878c54);}(_0x1622,0x1b3));var _0x2162=function(_0x47d56f,_0x4115dc){_0x47d56f=_0x47d56f-0x0;var _0x4c66a1=_0x1622[_0x47d56f];return _0x4c66a1;};'use strict';var _=require(_0x2162('0x0'));var util=require('util');var moment=require(_0x2162('0x1'));var BPromise=require(_0x2162('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2162('0x3'));var db=require(_0x2162('0x4'))['db'];var utils=require(_0x2162('0x5'));var logger=require(_0x2162('0x6'))(_0x2162('0x7'));var config=require(_0x2162('0x8'));var jayson=require(_0x2162('0x9'));var client=jayson[_0x2162('0xa')][_0x2162('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f203c,_0x4ec96c,_0x2fab66){return new BPromise(function(_0x2e0ed8,_0x3dda46){return client[_0x2162('0xc')](_0x2f203c,_0x2fab66)[_0x2162('0xd')](function(_0x103ebc){logger['info'](_0x2162('0xe'),_0x4ec96c,_0x2162('0xf'));logger[_0x2162('0x10')](_0x2162('0x11'),_0x4ec96c,_0x2162('0xf'),JSON[_0x2162('0x12')](_0x103ebc));if(_0x103ebc['error']){if(_0x103ebc[_0x2162('0x13')]['code']===0x1f4){logger[_0x2162('0x13')]('SASalesCondition,\x20%s,\x20%s',_0x4ec96c,_0x103ebc[_0x2162('0x13')][_0x2162('0x14')]);return _0x3dda46(_0x103ebc['error'][_0x2162('0x14')]);}logger[_0x2162('0x13')](_0x2162('0xe'),_0x4ec96c,_0x103ebc[_0x2162('0x13')][_0x2162('0x14')]);return _0x2e0ed8(_0x103ebc[_0x2162('0x13')]['message']);}else{logger['info']('SASalesCondition,\x20%s,\x20%s',_0x4ec96c,'request\x20sent');_0x2e0ed8(_0x103ebc[_0x2162('0x15')][_0x2162('0x14')]);}})[_0x2162('0x16')](function(_0x43d0b0){logger[_0x2162('0x13')](_0x2162('0xe'),_0x4ec96c,_0x43d0b0);_0x3dda46(_0x43d0b0);});});} \ No newline at end of file diff --git a/server/api/saTypeProduct/index.js b/server/api/saTypeProduct/index.js index a9c8f97..2f8a0c1 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 _0xf38b=['destroy','exports','multer','util','connect-timeout','express','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','/:id','show','create','put','update','delete'];(function(_0x5a1919,_0x1f1ad9){var _0x203067=function(_0x5b9fc1){while(--_0x5b9fc1){_0x5a1919['push'](_0x5a1919['shift']());}};_0x203067(++_0x1f1ad9);}(_0xf38b,0xb6));var _0xbf38=function(_0x3e0b30,_0x508aa3){_0x3e0b30=_0x3e0b30-0x0;var _0x27dfd8=_0xf38b[_0x3e0b30];return _0x27dfd8;};'use strict';var multer=require(_0xbf38('0x0'));var util=require(_0xbf38('0x1'));var path=require('path');var timeout=require(_0xbf38('0x2'));var express=require(_0xbf38('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xbf38('0x4'));var config=require('../../config/environment');var controller=require('./saTypeProduct.controller');router['get']('/',auth[_0xbf38('0x5')](),controller[_0xbf38('0x6')]);router[_0xbf38('0x7')](_0xbf38('0x8'),auth[_0xbf38('0x5')](),controller[_0xbf38('0x9')]);router[_0xbf38('0x7')](_0xbf38('0xa'),auth[_0xbf38('0x5')](),controller[_0xbf38('0xb')]);router['post']('/',auth[_0xbf38('0x5')](),controller[_0xbf38('0xc')]);router[_0xbf38('0xd')](_0xbf38('0xa'),auth['isAuthenticated'](),controller[_0xbf38('0xe')]);router[_0xbf38('0xf')](_0xbf38('0xa'),auth['isAuthenticated'](),controller[_0xbf38('0x10')]);module[_0xbf38('0x11')]=router; \ No newline at end of file +var _0x1c50=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/describe','describe','/:id','show','isAuthenticated','delete','destroy','exports','multer','util'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x1c50,0x1e4));var _0x01c5=function(_0x1f4616,_0x92a423){_0x1f4616=_0x1f4616-0x0;var _0x31c4d8=_0x1c50[_0x1f4616];return _0x31c4d8;};'use strict';var multer=require(_0x01c5('0x0'));var util=require(_0x01c5('0x1'));var path=require(_0x01c5('0x2'));var timeout=require(_0x01c5('0x3'));var express=require(_0x01c5('0x4'));var router=express[_0x01c5('0x5')]();var auth=require(_0x01c5('0x6'));var interaction=require(_0x01c5('0x7'));var config=require('../../config/environment');var controller=require('./saTypeProduct.controller');router[_0x01c5('0x8')]('/',auth['isAuthenticated'](),controller[_0x01c5('0x9')]);router[_0x01c5('0x8')](_0x01c5('0xa'),auth['isAuthenticated'](),controller[_0x01c5('0xb')]);router['get'](_0x01c5('0xc'),auth['isAuthenticated'](),controller[_0x01c5('0xd')]);router['post']('/',auth[_0x01c5('0xe')](),controller['create']);router['put'](_0x01c5('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x01c5('0xf')](_0x01c5('0xc'),auth[_0x01c5('0xe')](),controller[_0x01c5('0x10')]);module[_0x01c5('0x11')]=router; \ No newline at end of file diff --git a/server/api/saTypeProduct/saTypeProduct.attributes.js b/server/api/saTypeProduct/saTypeProduct.attributes.js index 6030732..3b869cb 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 _0x3821=['name','sequelize'];(function(_0x1e642e,_0x3e1498){var _0x3bbf07=function(_0x7df028){while(--_0x7df028){_0x1e642e['push'](_0x1e642e['shift']());}};_0x3bbf07(++_0x3e1498);}(_0x3821,0xf7));var _0x1382=function(_0x2c4193,_0x24d07b){_0x2c4193=_0x2c4193-0x0;var _0xd3773c=_0x3821[_0x2c4193];return _0xd3773c;};'use strict';var Sequelize=require(_0x1382('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1382('0x1')}}; \ No newline at end of file +var _0x439f=['sequelize','exports'];(function(_0x1094e1,_0x44c92a){var _0x3de213=function(_0x345850){while(--_0x345850){_0x1094e1['push'](_0x1094e1['shift']());}};_0x3de213(++_0x44c92a);}(_0x439f,0x196));var _0xf439=function(_0x23c651,_0x143982){_0x23c651=_0x23c651-0x0;var _0xbe7bdb=_0x439f[_0x23c651];return _0xbe7bdb;};'use strict';var Sequelize=require(_0xf439('0x0'));module[_0xf439('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'}}; \ No newline at end of file diff --git a/server/api/saTypeProduct/saTypeProduct.controller.js b/server/api/saTypeProduct/saTypeProduct.controller.js index 974c2d1..7129bf5 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 _0x2f04=['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','apply','reject','save','update','then','error','stack','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','where','merge','map','type','key','filter','options','SATypeProduct','include','findAll','rows','catch','show','includeAll','find','create','body','params','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','squel','desk.js'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x2f04,0x15b));var _0x42f0=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x2f04[_0x122ef9];return _0x42fba0;};'use strict';var pdf=require(_0x42f0('0x0'));var emlformat=require(_0x42f0('0x1'));var rimraf=require(_0x42f0('0x2'));var zipdir=require(_0x42f0('0x3'));var jsonpatch=require(_0x42f0('0x4'));var rp=require(_0x42f0('0x5'));var moment=require(_0x42f0('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x42f0('0x7'));var path=require('path');var sox=require(_0x42f0('0x8'));var csv=require(_0x42f0('0x9'));var ejs=require(_0x42f0('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x42f0('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x42f0('0xc'));var toCsv=require(_0x42f0('0x9'));var querystring=require(_0x42f0('0xd'));var Papa=require('papaparse');var Redis=require(_0x42f0('0xe'));var authService=require(_0x42f0('0xf'));var qs=require(_0x42f0('0x10'));var hardwareService=require(_0x42f0('0x11'));var logger=require(_0x42f0('0x12'))(_0x42f0('0x13'));var utils=require(_0x42f0('0x14'));var config=require('../../config/environment');var db=require(_0x42f0('0x15'))['db'];function respondWithStatusCode(_0x30726a,_0x414637){_0x414637=_0x414637||0xcc;return function(_0x3ba8f7){if(_0x3ba8f7){return _0x30726a[_0x42f0('0x16')](_0x414637);}return _0x30726a[_0x42f0('0x17')](_0x414637)[_0x42f0('0x18')]();};}function respondWithResult(_0x5a2122,_0x14b237){_0x14b237=_0x14b237||0xc8;return function(_0x6171a5){if(_0x6171a5){return _0x5a2122[_0x42f0('0x17')](_0x14b237)[_0x42f0('0x19')](_0x6171a5);}};}function respondWithFilteredResult(_0x4d6923,_0x147d30){return function(_0x3d5cb7){if(_0x3d5cb7){var _0x4f5b9d=_0x3d5cb7[_0x42f0('0x1a')],_0x2ed20a=_0x147d30['offset'],_0x302bfa=_0x147d30[_0x42f0('0x1b')]+_0x147d30[_0x42f0('0x1c')],_0x3e00b6;if(_0x302bfa>=_0x4f5b9d){_0x302bfa=_0x4f5b9d;_0x3e00b6=0xc8;}else{_0x3e00b6=0xce;}_0x4d6923['status'](_0x3e00b6);return _0x4d6923[_0x42f0('0x1d')](_0x42f0('0x1e'),_0x2ed20a+'-'+_0x302bfa+'/'+_0x4f5b9d)[_0x42f0('0x19')](_0x3d5cb7);}return null;};}function patchUpdates(_0x4dafc5){return function(_0x344b06){try{jsonpatch[_0x42f0('0x1f')](_0x344b06,_0x4dafc5,!![]);}catch(_0x334632){return BPromise[_0x42f0('0x20')](_0x334632);}return _0x344b06[_0x42f0('0x21')]();};}function saveUpdates(_0x20e5f0,_0x115c52){return function(_0x5d104f){if(_0x5d104f){return _0x5d104f[_0x42f0('0x22')](_0x20e5f0)[_0x42f0('0x23')](function(_0x529f14){return _0x529f14;});}return null;};}function removeEntity(_0x591ae7,_0x245b9e){return function(_0x15c16e){if(_0x15c16e){return _0x15c16e['destroy']()['then'](function(){_0x591ae7[_0x42f0('0x17')](0xcc)[_0x42f0('0x18')]();});}};}function handleEntityNotFound(_0x30c635,_0x50bece){return function(_0x568e98){if(!_0x568e98){_0x30c635[_0x42f0('0x16')](0x194);}return _0x568e98;};}function handleError(_0x23b4e5,_0x2bc717){_0x2bc717=_0x2bc717||0x1f4;return function(_0x29b9fb){logger[_0x42f0('0x24')](_0x29b9fb[_0x42f0('0x25')]);if(_0x29b9fb['name']){delete _0x29b9fb['name'];}_0x23b4e5[_0x42f0('0x17')](_0x2bc717)['send'](_0x29b9fb);};}exports[_0x42f0('0x26')]=function(_0x26d525,_0x4aa0c8){var _0x19ad7c={},_0x400be3={},_0x118e39={'count':0x0,'rows':[]};var _0x5e9a20=db['SATypeProduct'][_0x42f0('0x27')];_0x400be3[_0x42f0('0x28')]=_[_0x42f0('0x29')](_0x5e9a20);_0x400be3[_0x42f0('0x2a')]=_['keys'](_0x26d525['query']);_0x400be3[_0x42f0('0x2b')]=_[_0x42f0('0x2c')](_0x400be3['model'],_0x400be3[_0x42f0('0x2a')]);_0x19ad7c[_0x42f0('0x2d')]=_[_0x42f0('0x2c')](_0x400be3[_0x42f0('0x28')],qs[_0x42f0('0x2e')](_0x26d525[_0x42f0('0x2a')][_0x42f0('0x2e')]));_0x19ad7c[_0x42f0('0x2d')]=_0x19ad7c[_0x42f0('0x2d')][_0x42f0('0x2f')]?_0x19ad7c[_0x42f0('0x2d')]:_0x400be3['model'];if(!_0x26d525['query']['hasOwnProperty'](_0x42f0('0x30'))){_0x19ad7c[_0x42f0('0x1c')]=qs[_0x42f0('0x1c')](_0x26d525[_0x42f0('0x2a')][_0x42f0('0x1c')]);_0x19ad7c[_0x42f0('0x1b')]=qs['offset'](_0x26d525['query'][_0x42f0('0x1b')]);}_0x19ad7c[_0x42f0('0x31')]=qs[_0x42f0('0x32')](_0x26d525[_0x42f0('0x2a')][_0x42f0('0x32')]);_0x19ad7c['where']=qs[_0x42f0('0x2b')](_[_0x42f0('0x33')](_0x26d525['query'],_0x400be3[_0x42f0('0x2b')]));if(_0x26d525['query']['filter']){_0x19ad7c[_0x42f0('0x34')]=_[_0x42f0('0x35')](_0x19ad7c[_0x42f0('0x34')],{'$or':_[_0x42f0('0x36')](_0x5e9a20,function(_0x16eb77){if(_0x16eb77[_0x42f0('0x37')][_0x42f0('0x38')]!=='VIRTUAL'){var _0x294be4={};_0x294be4[_0x16eb77['field']]={'$like':'%'+_0x26d525[_0x42f0('0x2a')][_0x42f0('0x39')]+'%'};return _0x294be4;}})});}_0x19ad7c=_[_0x42f0('0x35')]({},_0x19ad7c,_0x26d525[_0x42f0('0x3a')]);var _0x4b3bfb={'where':_0x19ad7c['where']};return db[_0x42f0('0x3b')][_0x42f0('0x1a')](_0x4b3bfb)[_0x42f0('0x23')](function(_0x11e6d1){_0x118e39[_0x42f0('0x1a')]=_0x11e6d1;if(_0x26d525[_0x42f0('0x2a')]['includeAll']){_0x19ad7c[_0x42f0('0x3c')]=[{'all':!![]}];}return db['SATypeProduct'][_0x42f0('0x3d')](_0x19ad7c);})[_0x42f0('0x23')](function(_0x5c6f09){_0x118e39[_0x42f0('0x3e')]=_0x5c6f09;return _0x118e39;})['then'](respondWithFilteredResult(_0x4aa0c8,_0x19ad7c))[_0x42f0('0x3f')](handleError(_0x4aa0c8,null));};exports[_0x42f0('0x40')]=function(_0x401152,_0x2ec628){var _0x410b3c={'raw':![],'where':{'id':_0x401152['params']['id']}},_0x1adfbe={};_0x1adfbe[_0x42f0('0x28')]=_[_0x42f0('0x29')](db[_0x42f0('0x3b')][_0x42f0('0x27')]);_0x1adfbe[_0x42f0('0x2a')]=_[_0x42f0('0x29')](_0x401152[_0x42f0('0x2a')]);_0x1adfbe[_0x42f0('0x2b')]=_[_0x42f0('0x2c')](_0x1adfbe[_0x42f0('0x28')],_0x1adfbe[_0x42f0('0x2a')]);_0x410b3c[_0x42f0('0x2d')]=_[_0x42f0('0x2c')](_0x1adfbe[_0x42f0('0x28')],qs[_0x42f0('0x2e')](_0x401152[_0x42f0('0x2a')][_0x42f0('0x2e')]));_0x410b3c[_0x42f0('0x2d')]=_0x410b3c[_0x42f0('0x2d')][_0x42f0('0x2f')]?_0x410b3c[_0x42f0('0x2d')]:_0x1adfbe[_0x42f0('0x28')];if(_0x401152[_0x42f0('0x2a')][_0x42f0('0x41')]){_0x410b3c[_0x42f0('0x3c')]=[{'all':!![]}];}_0x410b3c=_['merge']({},_0x410b3c,_0x401152[_0x42f0('0x3a')]);return db[_0x42f0('0x3b')][_0x42f0('0x42')](_0x410b3c)[_0x42f0('0x23')](handleEntityNotFound(_0x2ec628,null))[_0x42f0('0x23')](respondWithResult(_0x2ec628,null))['catch'](handleError(_0x2ec628,null));};exports[_0x42f0('0x43')]=function(_0x5b45d2,_0x20069d){return db[_0x42f0('0x3b')][_0x42f0('0x43')](_0x5b45d2[_0x42f0('0x44')],{})[_0x42f0('0x23')](respondWithResult(_0x20069d,0xc9))[_0x42f0('0x3f')](handleError(_0x20069d,null));};exports[_0x42f0('0x22')]=function(_0x4652f3,_0x4de36d){if(_0x4652f3['body']['id']){delete _0x4652f3[_0x42f0('0x44')]['id'];}return db[_0x42f0('0x3b')][_0x42f0('0x42')]({'where':{'id':_0x4652f3[_0x42f0('0x45')]['id']}})[_0x42f0('0x23')](handleEntityNotFound(_0x4de36d,null))['then'](saveUpdates(_0x4652f3[_0x42f0('0x44')],null))[_0x42f0('0x23')](respondWithResult(_0x4de36d,null))[_0x42f0('0x3f')](handleError(_0x4de36d,null));};exports[_0x42f0('0x46')]=function(_0x5a4a66,_0x2f3255){return db[_0x42f0('0x3b')]['find']({'where':{'id':_0x5a4a66[_0x42f0('0x45')]['id']}})['then'](handleEntityNotFound(_0x2f3255,null))[_0x42f0('0x23')](removeEntity(_0x2f3255,null))[_0x42f0('0x3f')](handleError(_0x2f3255,null));};exports[_0x42f0('0x47')]=function(_0x48eee6,_0x210059){return db[_0x42f0('0x3b')][_0x42f0('0x47')]()[_0x42f0('0x23')](respondWithResult(_0x210059,null))[_0x42f0('0x3f')](handleError(_0x210059,null));}; \ No newline at end of file +var _0xf2d5=['VIRTUAL','field','options','includeAll','include','findAll','rows','show','rawAttributes','find','catch','create','body','params','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','sendStatus','status','count','offset','set','Content-Range','json','reject','save','update','then','end','stack','name','SATypeProduct','keys','query','filters','model','attributes','intersection','fields','length','nolimit','limit','order','sort','where','merge','type','key'];(function(_0x52efe9,_0x5dacd3){var _0x3d55f2=function(_0x663c6f){while(--_0x663c6f){_0x52efe9['push'](_0x52efe9['shift']());}};_0x3d55f2(++_0x5dacd3);}(_0xf2d5,0x178));var _0x5f2d=function(_0x328d4a,_0x490b94){_0x328d4a=_0x328d4a-0x0;var _0x5670dd=_0xf2d5[_0x328d4a];return _0x5670dd;};'use strict';var pdf=require(_0x5f2d('0x0'));var emlformat=require(_0x5f2d('0x1'));var rimraf=require(_0x5f2d('0x2'));var zipdir=require(_0x5f2d('0x3'));var jsonpatch=require(_0x5f2d('0x4'));var rp=require(_0x5f2d('0x5'));var moment=require(_0x5f2d('0x6'));var BPromise=require(_0x5f2d('0x7'));var Mustache=require(_0x5f2d('0x8'));var util=require(_0x5f2d('0x9'));var path=require(_0x5f2d('0xa'));var sox=require(_0x5f2d('0xb'));var csv=require(_0x5f2d('0xc'));var ejs=require(_0x5f2d('0xd'));var fs=require('fs');var _=require(_0x5f2d('0xe'));var squel=require(_0x5f2d('0xf'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5f2d('0x10'));var toCsv=require(_0x5f2d('0xc'));var querystring=require(_0x5f2d('0x11'));var Papa=require(_0x5f2d('0x12'));var Redis=require(_0x5f2d('0x13'));var authService=require(_0x5f2d('0x14'));var qs=require(_0x5f2d('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5f2d('0x16'));var utils=require('../../config/utils');var config=require(_0x5f2d('0x17'));var db=require(_0x5f2d('0x18'))['db'];function respondWithStatusCode(_0x4f7f11,_0xe77105){_0xe77105=_0xe77105||0xcc;return function(_0x195221){if(_0x195221){return _0x4f7f11[_0x5f2d('0x19')](_0xe77105);}return _0x4f7f11[_0x5f2d('0x1a')](_0xe77105)['end']();};}function respondWithResult(_0x2ae356,_0xcc0fd7){_0xcc0fd7=_0xcc0fd7||0xc8;return function(_0x43cd03){if(_0x43cd03){return _0x2ae356[_0x5f2d('0x1a')](_0xcc0fd7)['json'](_0x43cd03);}};}function respondWithFilteredResult(_0xc60fcc,_0x584c7c){return function(_0x363f55){if(_0x363f55){var _0x1338cd=_0x363f55[_0x5f2d('0x1b')],_0x3867b1=_0x584c7c[_0x5f2d('0x1c')],_0x543bab=_0x584c7c[_0x5f2d('0x1c')]+_0x584c7c['limit'],_0x3d2e96;if(_0x543bab>=_0x1338cd){_0x543bab=_0x1338cd;_0x3d2e96=0xc8;}else{_0x3d2e96=0xce;}_0xc60fcc['status'](_0x3d2e96);return _0xc60fcc[_0x5f2d('0x1d')](_0x5f2d('0x1e'),_0x3867b1+'-'+_0x543bab+'/'+_0x1338cd)[_0x5f2d('0x1f')](_0x363f55);}return null;};}function patchUpdates(_0x3f89ab){return function(_0x325eb){try{jsonpatch['apply'](_0x325eb,_0x3f89ab,!![]);}catch(_0x6f4612){return BPromise[_0x5f2d('0x20')](_0x6f4612);}return _0x325eb[_0x5f2d('0x21')]();};}function saveUpdates(_0x11bc1c,_0x583771){return function(_0x14ed7d){if(_0x14ed7d){return _0x14ed7d[_0x5f2d('0x22')](_0x11bc1c)[_0x5f2d('0x23')](function(_0x3ae90f){return _0x3ae90f;});}return null;};}function removeEntity(_0x5df4dc,_0x2f9bc6){return function(_0x1acba5){if(_0x1acba5){return _0x1acba5['destroy']()['then'](function(){_0x5df4dc[_0x5f2d('0x1a')](0xcc)[_0x5f2d('0x24')]();});}};}function handleEntityNotFound(_0xc3649a,_0x42835e){return function(_0x1e7289){if(!_0x1e7289){_0xc3649a[_0x5f2d('0x19')](0x194);}return _0x1e7289;};}function handleError(_0x280365,_0x187290){_0x187290=_0x187290||0x1f4;return function(_0x4525e2){logger['error'](_0x4525e2[_0x5f2d('0x25')]);if(_0x4525e2[_0x5f2d('0x26')]){delete _0x4525e2['name'];}_0x280365[_0x5f2d('0x1a')](_0x187290)['send'](_0x4525e2);};}exports['index']=function(_0x3c6541,_0xcee332){var _0x199f48={},_0x1c681c={},_0x5e9477={'count':0x0,'rows':[]};var _0xf27d27=db[_0x5f2d('0x27')]['rawAttributes'];_0x1c681c['model']=_[_0x5f2d('0x28')](_0xf27d27);_0x1c681c[_0x5f2d('0x29')]=_[_0x5f2d('0x28')](_0x3c6541[_0x5f2d('0x29')]);_0x1c681c[_0x5f2d('0x2a')]=_['intersection'](_0x1c681c[_0x5f2d('0x2b')],_0x1c681c['query']);_0x199f48[_0x5f2d('0x2c')]=_[_0x5f2d('0x2d')](_0x1c681c[_0x5f2d('0x2b')],qs[_0x5f2d('0x2e')](_0x3c6541['query'][_0x5f2d('0x2e')]));_0x199f48[_0x5f2d('0x2c')]=_0x199f48[_0x5f2d('0x2c')][_0x5f2d('0x2f')]?_0x199f48[_0x5f2d('0x2c')]:_0x1c681c[_0x5f2d('0x2b')];if(!_0x3c6541[_0x5f2d('0x29')]['hasOwnProperty'](_0x5f2d('0x30'))){_0x199f48[_0x5f2d('0x31')]=qs[_0x5f2d('0x31')](_0x3c6541[_0x5f2d('0x29')][_0x5f2d('0x31')]);_0x199f48['offset']=qs[_0x5f2d('0x1c')](_0x3c6541['query'][_0x5f2d('0x1c')]);}_0x199f48[_0x5f2d('0x32')]=qs[_0x5f2d('0x33')](_0x3c6541[_0x5f2d('0x29')][_0x5f2d('0x33')]);_0x199f48[_0x5f2d('0x34')]=qs['filters'](_['pick'](_0x3c6541[_0x5f2d('0x29')],_0x1c681c[_0x5f2d('0x2a')]));if(_0x3c6541[_0x5f2d('0x29')]['filter']){_0x199f48['where']=_[_0x5f2d('0x35')](_0x199f48['where'],{'$or':_['map'](_0xf27d27,function(_0x4ab407){if(_0x4ab407[_0x5f2d('0x36')][_0x5f2d('0x37')]!==_0x5f2d('0x38')){var _0x1ff8da={};_0x1ff8da[_0x4ab407[_0x5f2d('0x39')]]={'$like':'%'+_0x3c6541[_0x5f2d('0x29')]['filter']+'%'};return _0x1ff8da;}})});}_0x199f48=_[_0x5f2d('0x35')]({},_0x199f48,_0x3c6541[_0x5f2d('0x3a')]);var _0x1d9fbe={'where':_0x199f48['where']};return db[_0x5f2d('0x27')][_0x5f2d('0x1b')](_0x1d9fbe)[_0x5f2d('0x23')](function(_0x45299b){_0x5e9477[_0x5f2d('0x1b')]=_0x45299b;if(_0x3c6541[_0x5f2d('0x29')][_0x5f2d('0x3b')]){_0x199f48[_0x5f2d('0x3c')]=[{'all':!![]}];}return db['SATypeProduct'][_0x5f2d('0x3d')](_0x199f48);})[_0x5f2d('0x23')](function(_0x59a4ec){_0x5e9477[_0x5f2d('0x3e')]=_0x59a4ec;return _0x5e9477;})[_0x5f2d('0x23')](respondWithFilteredResult(_0xcee332,_0x199f48))['catch'](handleError(_0xcee332,null));};exports[_0x5f2d('0x3f')]=function(_0x4c3091,_0x317457){var _0x317c9e={'raw':![],'where':{'id':_0x4c3091['params']['id']}},_0x3a52b2={};_0x3a52b2[_0x5f2d('0x2b')]=_[_0x5f2d('0x28')](db[_0x5f2d('0x27')][_0x5f2d('0x40')]);_0x3a52b2[_0x5f2d('0x29')]=_['keys'](_0x4c3091[_0x5f2d('0x29')]);_0x3a52b2[_0x5f2d('0x2a')]=_[_0x5f2d('0x2d')](_0x3a52b2[_0x5f2d('0x2b')],_0x3a52b2[_0x5f2d('0x29')]);_0x317c9e[_0x5f2d('0x2c')]=_[_0x5f2d('0x2d')](_0x3a52b2['model'],qs[_0x5f2d('0x2e')](_0x4c3091[_0x5f2d('0x29')][_0x5f2d('0x2e')]));_0x317c9e[_0x5f2d('0x2c')]=_0x317c9e[_0x5f2d('0x2c')][_0x5f2d('0x2f')]?_0x317c9e[_0x5f2d('0x2c')]:_0x3a52b2[_0x5f2d('0x2b')];if(_0x4c3091['query'][_0x5f2d('0x3b')]){_0x317c9e[_0x5f2d('0x3c')]=[{'all':!![]}];}_0x317c9e=_[_0x5f2d('0x35')]({},_0x317c9e,_0x4c3091[_0x5f2d('0x3a')]);return db['SATypeProduct'][_0x5f2d('0x41')](_0x317c9e)[_0x5f2d('0x23')](handleEntityNotFound(_0x317457,null))[_0x5f2d('0x23')](respondWithResult(_0x317457,null))[_0x5f2d('0x42')](handleError(_0x317457,null));};exports[_0x5f2d('0x43')]=function(_0x2cf39c,_0x17a1ed){return db[_0x5f2d('0x27')][_0x5f2d('0x43')](_0x2cf39c[_0x5f2d('0x44')],{})['then'](respondWithResult(_0x17a1ed,0xc9))[_0x5f2d('0x42')](handleError(_0x17a1ed,null));};exports[_0x5f2d('0x22')]=function(_0x2945c3,_0xcca648){if(_0x2945c3[_0x5f2d('0x44')]['id']){delete _0x2945c3[_0x5f2d('0x44')]['id'];}return db[_0x5f2d('0x27')][_0x5f2d('0x41')]({'where':{'id':_0x2945c3[_0x5f2d('0x45')]['id']}})['then'](handleEntityNotFound(_0xcca648,null))[_0x5f2d('0x23')](saveUpdates(_0x2945c3[_0x5f2d('0x44')],null))[_0x5f2d('0x23')](respondWithResult(_0xcca648,null))[_0x5f2d('0x42')](handleError(_0xcca648,null));};exports[_0x5f2d('0x46')]=function(_0x4a7807,_0x31ec0b){return db[_0x5f2d('0x27')][_0x5f2d('0x41')]({'where':{'id':_0x4a7807['params']['id']}})[_0x5f2d('0x23')](handleEntityNotFound(_0x31ec0b,null))['then'](removeEntity(_0x31ec0b,null))[_0x5f2d('0x42')](handleError(_0x31ec0b,null));};exports['describe']=function(_0x5b4a8c,_0xe2b485){return db[_0x5f2d('0x27')][_0x5f2d('0x47')]()[_0x5f2d('0x23')](respondWithResult(_0xe2b485,null))['catch'](handleError(_0xe2b485,null));}; \ No newline at end of file diff --git a/server/api/saTypeProduct/saTypeProduct.model.js b/server/api/saTypeProduct/saTypeProduct.model.js index e0591b9..de9167d 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 _0x2173=['../../config/environment','./saTypeProduct.attributes','exports','define','util','api','moment','bluebird','request-promise'];(function(_0x25a116,_0x233677){var _0x26551d=function(_0x40a81d){while(--_0x40a81d){_0x25a116['push'](_0x25a116['shift']());}};_0x26551d(++_0x233677);}(_0x2173,0xb8));var _0x3217=function(_0x5643ca,_0x594c75){_0x5643ca=_0x5643ca-0x0;var _0x45ba07=_0x2173[_0x5643ca];return _0x45ba07;};'use strict';var _=require('lodash');var util=require(_0x3217('0x0'));var logger=require('../../config/logger')(_0x3217('0x1'));var moment=require(_0x3217('0x2'));var BPromise=require(_0x3217('0x3'));var rp=require(_0x3217('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3217('0x5'));var attributes=require(_0x3217('0x6'));module[_0x3217('0x7')]=function(_0x5531c8,_0x493578){return _0x5531c8[_0x3217('0x8')]('SATypeProduct',attributes,{'tableName':'sa_type_products','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xce40=['rimraf','../../config/environment','./saTypeProduct.attributes','exports','define','sa_type_products','util','../../config/logger','moment','request-promise','path'];(function(_0x205039,_0x69af6f){var _0x246f57=function(_0xcf837f){while(--_0xcf837f){_0x205039['push'](_0x205039['shift']());}};_0x246f57(++_0x69af6f);}(_0xce40,0x1c9));var _0x0ce4=function(_0x3f1710,_0x3877a2){_0x3f1710=_0x3f1710-0x0;var _0x528458=_0xce40[_0x3f1710];return _0x528458;};'use strict';var _=require('lodash');var util=require(_0x0ce4('0x0'));var logger=require(_0x0ce4('0x1'))('api');var moment=require(_0x0ce4('0x2'));var BPromise=require('bluebird');var rp=require(_0x0ce4('0x3'));var fs=require('fs');var path=require(_0x0ce4('0x4'));var rimraf=require(_0x0ce4('0x5'));var config=require(_0x0ce4('0x6'));var attributes=require(_0x0ce4('0x7'));module[_0x0ce4('0x8')]=function(_0x480d6f,_0x158e6b){return _0x480d6f[_0x0ce4('0x9')]('SATypeProduct',attributes,{'tableName':_0x0ce4('0xa'),'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 98a5808..749a868 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 _0xd0b3=['bluebird','randomstring','ioredis','../../config/utils','rpc','client','request','then','info','SATypeProduct,\x20%s,\x20%s','request\x20sent','debug','SATypeProduct,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd0b3,0xcf));var _0x3d0b=function(_0x244fb8,_0x6c6c1b){_0x244fb8=_0x244fb8-0x0;var _0x259d77=_0xd0b3[_0x244fb8];return _0x259d77;};'use strict';var _=require(_0x3d0b('0x0'));var util=require(_0x3d0b('0x1'));var moment=require(_0x3d0b('0x2'));var BPromise=require(_0x3d0b('0x3'));var rs=require(_0x3d0b('0x4'));var fs=require('fs');var Redis=require(_0x3d0b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3d0b('0x6'));var logger=require('../../config/logger')(_0x3d0b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3d0b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a62b8,_0x3b85e0,_0x5f4504){return new BPromise(function(_0x5e1856,_0xbfedda){return client[_0x3d0b('0x9')](_0x3a62b8,_0x5f4504)[_0x3d0b('0xa')](function(_0x16896a){logger[_0x3d0b('0xb')](_0x3d0b('0xc'),_0x3b85e0,_0x3d0b('0xd'));logger[_0x3d0b('0xe')](_0x3d0b('0xf'),_0x3b85e0,'request\x20sent',JSON[_0x3d0b('0x10')](_0x16896a));if(_0x16896a['error']){if(_0x16896a[_0x3d0b('0x11')]['code']===0x1f4){logger[_0x3d0b('0x11')]('SATypeProduct,\x20%s,\x20%s',_0x3b85e0,_0x16896a[_0x3d0b('0x11')][_0x3d0b('0x12')]);return _0xbfedda(_0x16896a[_0x3d0b('0x11')][_0x3d0b('0x12')]);}logger[_0x3d0b('0x11')](_0x3d0b('0xc'),_0x3b85e0,_0x16896a[_0x3d0b('0x11')][_0x3d0b('0x12')]);return _0x5e1856(_0x16896a[_0x3d0b('0x11')][_0x3d0b('0x12')]);}else{logger[_0x3d0b('0xb')](_0x3d0b('0xc'),_0x3b85e0,_0x3d0b('0xd'));_0x5e1856(_0x16896a[_0x3d0b('0x13')][_0x3d0b('0x12')]);}})[_0x3d0b('0x14')](function(_0x3a7099){logger[_0x3d0b('0x11')](_0x3d0b('0xc'),_0x3b85e0,_0x3a7099);_0xbfedda(_0x3a7099);});});} \ No newline at end of file +var _0x3323=['client','http','request','then','SATypeProduct,\x20%s,\x20%s','request\x20sent','debug','SATypeProduct,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise'];(function(_0x4ce0b0,_0x572278){var _0x58115a=function(_0x5a6b24){while(--_0x5a6b24){_0x4ce0b0['push'](_0x4ce0b0['shift']());}};_0x58115a(++_0x572278);}(_0x3323,0x187));var _0x3332=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x3323[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x3332('0x0'));var util=require('util');var moment=require(_0x3332('0x1'));var BPromise=require(_0x3332('0x2'));var rs=require(_0x3332('0x3'));var fs=require('fs');var Redis=require(_0x3332('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3332('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x3332('0x6'));var jayson=require(_0x3332('0x7'));var client=jayson[_0x3332('0x8')][_0x3332('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2336c4,_0x4924de,_0x1ca051){return new BPromise(function(_0x25e5a8,_0x3a3346){return client[_0x3332('0xa')](_0x2336c4,_0x1ca051)[_0x3332('0xb')](function(_0x246849){logger['info'](_0x3332('0xc'),_0x4924de,_0x3332('0xd'));logger[_0x3332('0xe')](_0x3332('0xf'),_0x4924de,_0x3332('0xd'),JSON[_0x3332('0x10')](_0x246849));if(_0x246849[_0x3332('0x11')]){if(_0x246849['error'][_0x3332('0x12')]===0x1f4){logger[_0x3332('0x11')](_0x3332('0xc'),_0x4924de,_0x246849[_0x3332('0x11')][_0x3332('0x13')]);return _0x3a3346(_0x246849[_0x3332('0x11')][_0x3332('0x13')]);}logger['error'](_0x3332('0xc'),_0x4924de,_0x246849[_0x3332('0x11')][_0x3332('0x13')]);return _0x25e5a8(_0x246849[_0x3332('0x11')][_0x3332('0x13')]);}else{logger['info'](_0x3332('0xc'),_0x4924de,_0x3332('0xd'));_0x25e5a8(_0x246849['result'][_0x3332('0x13')]);}})[_0x3332('0x14')](function(_0x9451b5){logger['error'](_0x3332('0xc'),_0x4924de,_0x9451b5);_0x3a3346(_0x9451b5);});});} \ No newline at end of file diff --git a/server/api/saUnitMeasure/index.js b/server/api/saUnitMeasure/index.js index e675bea..e1507aa 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 _0x9b87=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./saUnitMeasure.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','multer'];(function(_0x52782b,_0x14688c){var _0x4cb980=function(_0x1e7c0e){while(--_0x1e7c0e){_0x52782b['push'](_0x52782b['shift']());}};_0x4cb980(++_0x14688c);}(_0x9b87,0x77));var _0x79b8=function(_0xaca811,_0x5c3752){_0xaca811=_0xaca811-0x0;var _0x15a7a7=_0x9b87[_0xaca811];return _0x15a7a7;};'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('express');var router=express[_0x79b8('0x4')]();var auth=require(_0x79b8('0x5'));var interaction=require(_0x79b8('0x6'));var config=require('../../config/environment');var controller=require(_0x79b8('0x7'));router[_0x79b8('0x8')]('/',auth['isAuthenticated'](),controller[_0x79b8('0x9')]);router['get'](_0x79b8('0xa'),auth[_0x79b8('0xb')](),controller[_0x79b8('0xc')]);router[_0x79b8('0x8')](_0x79b8('0xd'),auth[_0x79b8('0xb')](),controller[_0x79b8('0xe')]);router[_0x79b8('0xf')]('/',auth[_0x79b8('0xb')](),controller[_0x79b8('0x10')]);router[_0x79b8('0x11')](_0x79b8('0xd'),auth[_0x79b8('0xb')](),controller[_0x79b8('0x12')]);router['delete'](_0x79b8('0xd'),auth[_0x79b8('0xb')](),controller[_0x79b8('0x13')]);module['exports']=router; \ No newline at end of file +var _0xfbd0=['Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','show','create','put','update','delete','/:id','destroy','exports','multer','connect-timeout','express'];(function(_0x46efd7,_0x43f84d){var _0x5637e4=function(_0x54e078){while(--_0x54e078){_0x46efd7['push'](_0x46efd7['shift']());}};_0x5637e4(++_0x43f84d);}(_0xfbd0,0x151));var _0x0fbd=function(_0x3de6c1,_0x4cb097){_0x3de6c1=_0x3de6c1-0x0;var _0x4453c8=_0xfbd0[_0x3de6c1];return _0x4453c8;};'use strict';var multer=require(_0x0fbd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0fbd('0x1'));var express=require(_0x0fbd('0x2'));var router=express[_0x0fbd('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0fbd('0x4'));var config=require(_0x0fbd('0x5'));var controller=require('./saUnitMeasure.controller');router[_0x0fbd('0x6')]('/',auth[_0x0fbd('0x7')](),controller['index']);router['get']('/describe',auth[_0x0fbd('0x7')](),controller[_0x0fbd('0x8')]);router[_0x0fbd('0x6')]('/:id',auth[_0x0fbd('0x7')](),controller[_0x0fbd('0x9')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0fbd('0xa')]);router[_0x0fbd('0xb')]('/:id',auth[_0x0fbd('0x7')](),controller[_0x0fbd('0xc')]);router[_0x0fbd('0xd')](_0x0fbd('0xe'),auth[_0x0fbd('0x7')](),controller[_0x0fbd('0xf')]);module[_0x0fbd('0x10')]=router; \ No newline at end of file diff --git a/server/api/saUnitMeasure/saUnitMeasure.attributes.js b/server/api/saUnitMeasure/saUnitMeasure.attributes.js index cf52807..c1b0063 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 _0x9b25=['exports','name','CHAR','abbreviation','sequelize'];(function(_0x359e07,_0x21896f){var _0x4d30f5=function(_0x528175){while(--_0x528175){_0x359e07['push'](_0x359e07['shift']());}};_0x4d30f5(++_0x21896f);}(_0x9b25,0xb3));var _0x59b2=function(_0x343547,_0x3ec421){_0x343547=_0x343547-0x0;var _0x277349=_0x9b25[_0x343547];return _0x277349;};'use strict';var Sequelize=require(_0x59b2('0x0'));module[_0x59b2('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x59b2('0x2')},'abbreviation':{'type':Sequelize[_0x59b2('0x3')](0x3),'allowNull':![],'unique':_0x59b2('0x4')}}; \ No newline at end of file +var _0xd027=['sequelize','exports','STRING','name','CHAR','abbreviation'];(function(_0x1c0395,_0x2ada00){var _0x507292=function(_0x39e416){while(--_0x39e416){_0x1c0395['push'](_0x1c0395['shift']());}};_0x507292(++_0x2ada00);}(_0xd027,0x174));var _0x7d02=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd027[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x7d02('0x0'));module[_0x7d02('0x1')]={'name':{'type':Sequelize[_0x7d02('0x2')],'allowNull':![],'unique':_0x7d02('0x3')},'abbreviation':{'type':Sequelize[_0x7d02('0x4')](0x3),'allowNull':![],'unique':_0x7d02('0x5')}}; \ No newline at end of file diff --git a/server/api/saUnitMeasure/saUnitMeasure.controller.js b/server/api/saUnitMeasure/saUnitMeasure.controller.js index ff0bf09..7a4a1f1 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 _0x52f6=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','create','body','find','destroy','describe','html-pdf','eml-format','rimraf','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','SAUnitMeasure','keys','query','filters','intersection','model','fields','attributes','length'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x52f6,0x134));var _0x652f=function(_0x93369e,_0x2bbbb4){_0x93369e=_0x93369e-0x0;var _0x545d2b=_0x52f6[_0x93369e];return _0x545d2b;};'use strict';var pdf=require(_0x652f('0x0'));var emlformat=require(_0x652f('0x1'));var rimraf=require(_0x652f('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x652f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x652f('0x4'));var util=require(_0x652f('0x5'));var path=require(_0x652f('0x6'));var sox=require(_0x652f('0x7'));var csv=require(_0x652f('0x8'));var ejs=require(_0x652f('0x9'));var fs=require('fs');var _=require(_0x652f('0xa'));var squel=require('squel');var crypto=require(_0x652f('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x652f('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x652f('0xd'));var Redis=require(_0x652f('0xe'));var authService=require(_0x652f('0xf'));var qs=require(_0x652f('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x652f('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x652f('0x12'));var db=require(_0x652f('0x13'))['db'];function respondWithStatusCode(_0x538251,_0x31d85c){_0x31d85c=_0x31d85c||0xcc;return function(_0x27cfbb){if(_0x27cfbb){return _0x538251[_0x652f('0x14')](_0x31d85c);}return _0x538251[_0x652f('0x15')](_0x31d85c)[_0x652f('0x16')]();};}function respondWithResult(_0x5f8e69,_0x2626ec){_0x2626ec=_0x2626ec||0xc8;return function(_0x3f4c61){if(_0x3f4c61){return _0x5f8e69['status'](_0x2626ec)[_0x652f('0x17')](_0x3f4c61);}};}function respondWithFilteredResult(_0xc1dbb9,_0xe7a46c){return function(_0x5ad9a5){if(_0x5ad9a5){var _0x264656=_0x5ad9a5[_0x652f('0x18')],_0x10dc09=_0xe7a46c[_0x652f('0x19')],_0x52738b=_0xe7a46c[_0x652f('0x19')]+_0xe7a46c[_0x652f('0x1a')],_0x482566;if(_0x52738b>=_0x264656){_0x52738b=_0x264656;_0x482566=0xc8;}else{_0x482566=0xce;}_0xc1dbb9[_0x652f('0x15')](_0x482566);return _0xc1dbb9[_0x652f('0x1b')](_0x652f('0x1c'),_0x10dc09+'-'+_0x52738b+'/'+_0x264656)[_0x652f('0x17')](_0x5ad9a5);}return null;};}function patchUpdates(_0x279acc){return function(_0x7832a8){try{jsonpatch[_0x652f('0x1d')](_0x7832a8,_0x279acc,!![]);}catch(_0x252b46){return BPromise[_0x652f('0x1e')](_0x252b46);}return _0x7832a8[_0x652f('0x1f')]();};}function saveUpdates(_0x804e5e,_0x170507){return function(_0x238b8a){if(_0x238b8a){return _0x238b8a['update'](_0x804e5e)[_0x652f('0x20')](function(_0x10cfe6){return _0x10cfe6;});}return null;};}function removeEntity(_0xc9d596,_0x177dc3){return function(_0x1c06fd){if(_0x1c06fd){return _0x1c06fd['destroy']()[_0x652f('0x20')](function(){_0xc9d596['status'](0xcc)[_0x652f('0x16')]();});}};}function handleEntityNotFound(_0x4fab7a,_0x57e6dc){return function(_0x302d79){if(!_0x302d79){_0x4fab7a[_0x652f('0x14')](0x194);}return _0x302d79;};}function handleError(_0x53e972,_0x439ef1){_0x439ef1=_0x439ef1||0x1f4;return function(_0x320b18){logger[_0x652f('0x21')](_0x320b18[_0x652f('0x22')]);if(_0x320b18['name']){delete _0x320b18[_0x652f('0x23')];}_0x53e972[_0x652f('0x15')](_0x439ef1)[_0x652f('0x24')](_0x320b18);};}exports[_0x652f('0x25')]=function(_0x708967,_0x96d16b){var _0x464465={},_0x8207da={},_0x44f430={'count':0x0,'rows':[]};var _0x16af18=db[_0x652f('0x26')]['rawAttributes'];_0x8207da['model']=_[_0x652f('0x27')](_0x16af18);_0x8207da['query']=_['keys'](_0x708967[_0x652f('0x28')]);_0x8207da[_0x652f('0x29')]=_[_0x652f('0x2a')](_0x8207da[_0x652f('0x2b')],_0x8207da[_0x652f('0x28')]);_0x464465['attributes']=_[_0x652f('0x2a')](_0x8207da[_0x652f('0x2b')],qs[_0x652f('0x2c')](_0x708967['query'][_0x652f('0x2c')]));_0x464465[_0x652f('0x2d')]=_0x464465[_0x652f('0x2d')][_0x652f('0x2e')]?_0x464465[_0x652f('0x2d')]:_0x8207da[_0x652f('0x2b')];if(!_0x708967[_0x652f('0x28')][_0x652f('0x2f')](_0x652f('0x30'))){_0x464465[_0x652f('0x1a')]=qs[_0x652f('0x1a')](_0x708967[_0x652f('0x28')][_0x652f('0x1a')]);_0x464465[_0x652f('0x19')]=qs[_0x652f('0x19')](_0x708967[_0x652f('0x28')][_0x652f('0x19')]);}_0x464465[_0x652f('0x31')]=qs[_0x652f('0x32')](_0x708967['query']['sort']);_0x464465[_0x652f('0x33')]=qs[_0x652f('0x29')](_[_0x652f('0x34')](_0x708967[_0x652f('0x28')],_0x8207da[_0x652f('0x29')]));if(_0x708967['query'][_0x652f('0x35')]){_0x464465['where']=_[_0x652f('0x36')](_0x464465[_0x652f('0x33')],{'$or':_[_0x652f('0x37')](_0x16af18,function(_0x1e7884){if(_0x1e7884['type']['key']!==_0x652f('0x38')){var _0x36d995={};_0x36d995[_0x1e7884['field']]={'$like':'%'+_0x708967['query'][_0x652f('0x35')]+'%'};return _0x36d995;}})});}_0x464465=_['merge']({},_0x464465,_0x708967['options']);var _0x1d79b1={'where':_0x464465[_0x652f('0x33')]};return db[_0x652f('0x26')][_0x652f('0x18')](_0x1d79b1)[_0x652f('0x20')](function(_0x1077b1){_0x44f430['count']=_0x1077b1;if(_0x708967[_0x652f('0x28')][_0x652f('0x39')]){_0x464465[_0x652f('0x3a')]=[{'all':!![]}];}return db[_0x652f('0x26')][_0x652f('0x3b')](_0x464465);})[_0x652f('0x20')](function(_0x46a347){_0x44f430[_0x652f('0x3c')]=_0x46a347;return _0x44f430;})[_0x652f('0x20')](respondWithFilteredResult(_0x96d16b,_0x464465))[_0x652f('0x3d')](handleError(_0x96d16b,null));};exports[_0x652f('0x3e')]=function(_0x1598a4,_0x2e5269){var _0x256692={'raw':![],'where':{'id':_0x1598a4[_0x652f('0x3f')]['id']}},_0x35bbdf={};_0x35bbdf['model']=_[_0x652f('0x27')](db[_0x652f('0x26')][_0x652f('0x40')]);_0x35bbdf[_0x652f('0x28')]=_[_0x652f('0x27')](_0x1598a4[_0x652f('0x28')]);_0x35bbdf['filters']=_[_0x652f('0x2a')](_0x35bbdf[_0x652f('0x2b')],_0x35bbdf[_0x652f('0x28')]);_0x256692[_0x652f('0x2d')]=_[_0x652f('0x2a')](_0x35bbdf[_0x652f('0x2b')],qs['fields'](_0x1598a4[_0x652f('0x28')][_0x652f('0x2c')]));_0x256692['attributes']=_0x256692[_0x652f('0x2d')][_0x652f('0x2e')]?_0x256692[_0x652f('0x2d')]:_0x35bbdf[_0x652f('0x2b')];if(_0x1598a4[_0x652f('0x28')]['includeAll']){_0x256692[_0x652f('0x3a')]=[{'all':!![]}];}_0x256692=_[_0x652f('0x36')]({},_0x256692,_0x1598a4[_0x652f('0x41')]);return db[_0x652f('0x26')]['find'](_0x256692)[_0x652f('0x20')](handleEntityNotFound(_0x2e5269,null))['then'](respondWithResult(_0x2e5269,null))[_0x652f('0x3d')](handleError(_0x2e5269,null));};exports[_0x652f('0x42')]=function(_0x4eb5eb,_0x5b9bed){return db[_0x652f('0x26')][_0x652f('0x42')](_0x4eb5eb[_0x652f('0x43')],{})[_0x652f('0x20')](respondWithResult(_0x5b9bed,0xc9))[_0x652f('0x3d')](handleError(_0x5b9bed,null));};exports['update']=function(_0x5da204,_0x90ea58){if(_0x5da204['body']['id']){delete _0x5da204[_0x652f('0x43')]['id'];}return db[_0x652f('0x26')][_0x652f('0x44')]({'where':{'id':_0x5da204['params']['id']}})['then'](handleEntityNotFound(_0x90ea58,null))['then'](saveUpdates(_0x5da204['body'],null))[_0x652f('0x20')](respondWithResult(_0x90ea58,null))[_0x652f('0x3d')](handleError(_0x90ea58,null));};exports[_0x652f('0x45')]=function(_0x242bf7,_0x1691ec){return db[_0x652f('0x26')][_0x652f('0x44')]({'where':{'id':_0x242bf7[_0x652f('0x3f')]['id']}})[_0x652f('0x20')](handleEntityNotFound(_0x1691ec,null))[_0x652f('0x20')](removeEntity(_0x1691ec,null))[_0x652f('0x3d')](handleError(_0x1691ec,null));};exports[_0x652f('0x46')]=function(_0x299517,_0x106828){return db[_0x652f('0x26')]['describe']()[_0x652f('0x20')](respondWithResult(_0x106828,null))[_0x652f('0x3d')](handleError(_0x106828,null));}; \ No newline at end of file +var _0xe922=['rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','SAUnitMeasure','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','reject','save','destroy','then','error','stack','name','send','index'];(function(_0x328505,_0x514f91){var _0x301c48=function(_0x5d3473){while(--_0x5d3473){_0x328505['push'](_0x328505['shift']());}};_0x301c48(++_0x514f91);}(_0xe922,0x10a));var _0x2e92=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xe922[_0x8c43de];return _0xa6591b;};'use strict';var pdf=require(_0x2e92('0x0'));var emlformat=require(_0x2e92('0x1'));var rimraf=require(_0x2e92('0x2'));var zipdir=require(_0x2e92('0x3'));var jsonpatch=require(_0x2e92('0x4'));var rp=require(_0x2e92('0x5'));var moment=require(_0x2e92('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x2e92('0x7'));var util=require(_0x2e92('0x8'));var path=require(_0x2e92('0x9'));var sox=require(_0x2e92('0xa'));var csv=require(_0x2e92('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x2e92('0xc'));var jsforce=require(_0x2e92('0xd'));var deskjs=require(_0x2e92('0xe'));var toCsv=require(_0x2e92('0xb'));var querystring=require(_0x2e92('0xf'));var Papa=require(_0x2e92('0x10'));var Redis=require(_0x2e92('0x11'));var authService=require(_0x2e92('0x12'));var qs=require(_0x2e92('0x13'));var hardwareService=require(_0x2e92('0x14'));var logger=require('../../config/logger')(_0x2e92('0x15'));var utils=require(_0x2e92('0x16'));var config=require(_0x2e92('0x17'));var db=require(_0x2e92('0x18'))['db'];function respondWithStatusCode(_0x2ed761,_0x4ce939){_0x4ce939=_0x4ce939||0xcc;return function(_0x17d43c){if(_0x17d43c){return _0x2ed761[_0x2e92('0x19')](_0x4ce939);}return _0x2ed761[_0x2e92('0x1a')](_0x4ce939)[_0x2e92('0x1b')]();};}function respondWithResult(_0x24ea4b,_0x8761a9){_0x8761a9=_0x8761a9||0xc8;return function(_0x56b03f){if(_0x56b03f){return _0x24ea4b[_0x2e92('0x1a')](_0x8761a9)[_0x2e92('0x1c')](_0x56b03f);}};}function respondWithFilteredResult(_0x4b2f25,_0x85c71){return function(_0x4568c2){if(_0x4568c2){var _0xbe2b40=_0x4568c2[_0x2e92('0x1d')],_0x580033=_0x85c71[_0x2e92('0x1e')],_0x5fe78b=_0x85c71['offset']+_0x85c71['limit'],_0x2c7f98;if(_0x5fe78b>=_0xbe2b40){_0x5fe78b=_0xbe2b40;_0x2c7f98=0xc8;}else{_0x2c7f98=0xce;}_0x4b2f25[_0x2e92('0x1a')](_0x2c7f98);return _0x4b2f25[_0x2e92('0x1f')](_0x2e92('0x20'),_0x580033+'-'+_0x5fe78b+'/'+_0xbe2b40)[_0x2e92('0x1c')](_0x4568c2);}return null;};}function patchUpdates(_0x1b434e){return function(_0x1b76da){try{jsonpatch['apply'](_0x1b76da,_0x1b434e,!![]);}catch(_0x43cdd7){return BPromise[_0x2e92('0x21')](_0x43cdd7);}return _0x1b76da[_0x2e92('0x22')]();};}function saveUpdates(_0x21d82a,_0x405732){return function(_0x46fc3c){if(_0x46fc3c){return _0x46fc3c['update'](_0x21d82a)['then'](function(_0x111036){return _0x111036;});}return null;};}function removeEntity(_0x369207,_0x32d66b){return function(_0x32a4cd){if(_0x32a4cd){return _0x32a4cd[_0x2e92('0x23')]()[_0x2e92('0x24')](function(){_0x369207[_0x2e92('0x1a')](0xcc)[_0x2e92('0x1b')]();});}};}function handleEntityNotFound(_0x4bc408,_0x5a10f2){return function(_0x4359f4){if(!_0x4359f4){_0x4bc408[_0x2e92('0x19')](0x194);}return _0x4359f4;};}function handleError(_0x559f31,_0x8eda1f){_0x8eda1f=_0x8eda1f||0x1f4;return function(_0x15c864){logger[_0x2e92('0x25')](_0x15c864[_0x2e92('0x26')]);if(_0x15c864[_0x2e92('0x27')]){delete _0x15c864[_0x2e92('0x27')];}_0x559f31[_0x2e92('0x1a')](_0x8eda1f)[_0x2e92('0x28')](_0x15c864);};}exports[_0x2e92('0x29')]=function(_0x4d6574,_0xc2338){var _0x24f17a={},_0x386e33={},_0x380be7={'count':0x0,'rows':[]};var _0x5798b5=db['SAUnitMeasure'][_0x2e92('0x2a')];_0x386e33[_0x2e92('0x2b')]=_[_0x2e92('0x2c')](_0x5798b5);_0x386e33[_0x2e92('0x2d')]=_[_0x2e92('0x2c')](_0x4d6574[_0x2e92('0x2d')]);_0x386e33[_0x2e92('0x2e')]=_[_0x2e92('0x2f')](_0x386e33[_0x2e92('0x2b')],_0x386e33[_0x2e92('0x2d')]);_0x24f17a[_0x2e92('0x30')]=_[_0x2e92('0x2f')](_0x386e33[_0x2e92('0x2b')],qs[_0x2e92('0x31')](_0x4d6574[_0x2e92('0x2d')][_0x2e92('0x31')]));_0x24f17a['attributes']=_0x24f17a[_0x2e92('0x30')][_0x2e92('0x32')]?_0x24f17a[_0x2e92('0x30')]:_0x386e33[_0x2e92('0x2b')];if(!_0x4d6574[_0x2e92('0x2d')][_0x2e92('0x33')]('nolimit')){_0x24f17a[_0x2e92('0x34')]=qs[_0x2e92('0x34')](_0x4d6574[_0x2e92('0x2d')]['limit']);_0x24f17a[_0x2e92('0x1e')]=qs[_0x2e92('0x1e')](_0x4d6574[_0x2e92('0x2d')][_0x2e92('0x1e')]);}_0x24f17a[_0x2e92('0x35')]=qs[_0x2e92('0x36')](_0x4d6574[_0x2e92('0x2d')][_0x2e92('0x36')]);_0x24f17a[_0x2e92('0x37')]=qs[_0x2e92('0x2e')](_[_0x2e92('0x38')](_0x4d6574[_0x2e92('0x2d')],_0x386e33[_0x2e92('0x2e')]));if(_0x4d6574[_0x2e92('0x2d')][_0x2e92('0x39')]){_0x24f17a[_0x2e92('0x37')]=_[_0x2e92('0x3a')](_0x24f17a[_0x2e92('0x37')],{'$or':_[_0x2e92('0x3b')](_0x5798b5,function(_0x462e57){if(_0x462e57[_0x2e92('0x3c')]['key']!==_0x2e92('0x3d')){var _0x4cc0b6={};_0x4cc0b6[_0x462e57[_0x2e92('0x3e')]]={'$like':'%'+_0x4d6574[_0x2e92('0x2d')][_0x2e92('0x39')]+'%'};return _0x4cc0b6;}})});}_0x24f17a=_[_0x2e92('0x3a')]({},_0x24f17a,_0x4d6574[_0x2e92('0x3f')]);var _0x521d39={'where':_0x24f17a[_0x2e92('0x37')]};return db[_0x2e92('0x40')]['count'](_0x521d39)[_0x2e92('0x24')](function(_0x1a556e){_0x380be7[_0x2e92('0x1d')]=_0x1a556e;if(_0x4d6574['query'][_0x2e92('0x41')]){_0x24f17a[_0x2e92('0x42')]=[{'all':!![]}];}return db[_0x2e92('0x40')][_0x2e92('0x43')](_0x24f17a);})[_0x2e92('0x24')](function(_0x1651bb){_0x380be7[_0x2e92('0x44')]=_0x1651bb;return _0x380be7;})[_0x2e92('0x24')](respondWithFilteredResult(_0xc2338,_0x24f17a))[_0x2e92('0x45')](handleError(_0xc2338,null));};exports[_0x2e92('0x46')]=function(_0x58cfc3,_0x323199){var _0x5578e7={'raw':![],'where':{'id':_0x58cfc3[_0x2e92('0x47')]['id']}},_0x1c4816={};_0x1c4816[_0x2e92('0x2b')]=_[_0x2e92('0x2c')](db['SAUnitMeasure'][_0x2e92('0x2a')]);_0x1c4816['query']=_['keys'](_0x58cfc3[_0x2e92('0x2d')]);_0x1c4816[_0x2e92('0x2e')]=_[_0x2e92('0x2f')](_0x1c4816['model'],_0x1c4816['query']);_0x5578e7['attributes']=_[_0x2e92('0x2f')](_0x1c4816[_0x2e92('0x2b')],qs['fields'](_0x58cfc3[_0x2e92('0x2d')][_0x2e92('0x31')]));_0x5578e7[_0x2e92('0x30')]=_0x5578e7[_0x2e92('0x30')][_0x2e92('0x32')]?_0x5578e7['attributes']:_0x1c4816[_0x2e92('0x2b')];if(_0x58cfc3['query'][_0x2e92('0x41')]){_0x5578e7[_0x2e92('0x42')]=[{'all':!![]}];}_0x5578e7=_['merge']({},_0x5578e7,_0x58cfc3[_0x2e92('0x3f')]);return db['SAUnitMeasure'][_0x2e92('0x48')](_0x5578e7)['then'](handleEntityNotFound(_0x323199,null))[_0x2e92('0x24')](respondWithResult(_0x323199,null))[_0x2e92('0x45')](handleError(_0x323199,null));};exports[_0x2e92('0x49')]=function(_0x235bb7,_0xbd55fd){return db[_0x2e92('0x40')][_0x2e92('0x49')](_0x235bb7[_0x2e92('0x4a')],{})[_0x2e92('0x24')](respondWithResult(_0xbd55fd,0xc9))[_0x2e92('0x45')](handleError(_0xbd55fd,null));};exports[_0x2e92('0x4b')]=function(_0xff8fe3,_0x1e4617){if(_0xff8fe3[_0x2e92('0x4a')]['id']){delete _0xff8fe3[_0x2e92('0x4a')]['id'];}return db[_0x2e92('0x40')][_0x2e92('0x48')]({'where':{'id':_0xff8fe3[_0x2e92('0x47')]['id']}})['then'](handleEntityNotFound(_0x1e4617,null))[_0x2e92('0x24')](saveUpdates(_0xff8fe3[_0x2e92('0x4a')],null))[_0x2e92('0x24')](respondWithResult(_0x1e4617,null))[_0x2e92('0x45')](handleError(_0x1e4617,null));};exports[_0x2e92('0x23')]=function(_0x1cd80b,_0x3db967){return db[_0x2e92('0x40')][_0x2e92('0x48')]({'where':{'id':_0x1cd80b[_0x2e92('0x47')]['id']}})[_0x2e92('0x24')](handleEntityNotFound(_0x3db967,null))[_0x2e92('0x24')](removeEntity(_0x3db967,null))['catch'](handleError(_0x3db967,null));};exports['describe']=function(_0x3f04c3,_0x1bdc3d){return db['SAUnitMeasure'][_0x2e92('0x4c')]()[_0x2e92('0x24')](respondWithResult(_0x1bdc3d,null))[_0x2e92('0x45')](handleError(_0x1bdc3d,null));}; \ No newline at end of file diff --git a/server/api/saUnitMeasure/saUnitMeasure.model.js b/server/api/saUnitMeasure/saUnitMeasure.model.js index 5c10500..2c29219 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 _0x523f=['path','../../config/environment','exports','define','lodash','api'];(function(_0x221abd,_0x621d76){var _0x47e399=function(_0x3c966f){while(--_0x3c966f){_0x221abd['push'](_0x221abd['shift']());}};_0x47e399(++_0x621d76);}(_0x523f,0x112));var _0xf523=function(_0x1ca186,_0x4427cf){_0x1ca186=_0x1ca186-0x0;var _0x208fe6=_0x523f[_0x1ca186];return _0x208fe6;};'use strict';var _=require(_0xf523('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf523('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf523('0x2'));var rimraf=require('rimraf');var config=require(_0xf523('0x3'));var attributes=require('./saUnitMeasure.attributes');module[_0xf523('0x4')]=function(_0x5807f2,_0x485ba3){return _0x5807f2[_0xf523('0x5')]('SAUnitMeasure',attributes,{'tableName':'sa_unit_measures','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0bd0=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','lodash','util'];(function(_0x4a5019,_0x531dc2){var _0x7eb475=function(_0x3f5bd1){while(--_0x3f5bd1){_0x4a5019['push'](_0x4a5019['shift']());}};_0x7eb475(++_0x531dc2);}(_0x0bd0,0x17e));var _0x00bd=function(_0x585d81,_0xf6d74f){_0x585d81=_0x585d81-0x0;var _0x1aca0d=_0x0bd0[_0x585d81];return _0x1aca0d;};'use strict';var _=require(_0x00bd('0x0'));var util=require(_0x00bd('0x1'));var logger=require(_0x00bd('0x2'))(_0x00bd('0x3'));var moment=require(_0x00bd('0x4'));var BPromise=require(_0x00bd('0x5'));var rp=require(_0x00bd('0x6'));var fs=require('fs');var path=require(_0x00bd('0x7'));var rimraf=require(_0x00bd('0x8'));var config=require(_0x00bd('0x9'));var attributes=require('./saUnitMeasure.attributes');module[_0x00bd('0xa')]=function(_0x5ea62c,_0x13dfbe){return _0x5ea62c[_0x00bd('0xb')]('SAUnitMeasure',attributes,{'tableName':'sa_unit_measures','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 2bdfb97..0ce9254 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 _0x280d=['message','info','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','request\x20sent','debug','SAUnitMeasure,\x20%s,\x20%s,\x20%s','code','error','SAUnitMeasure,\x20%s,\x20%s'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x280d,0x1d2));var _0xd280=function(_0x211c92,_0x25b5dc){_0x211c92=_0x211c92-0x0;var _0x88750a=_0x280d[_0x211c92];return _0x88750a;};'use strict';var _=require(_0xd280('0x0'));var util=require('util');var moment=require(_0xd280('0x1'));var BPromise=require('bluebird');var rs=require(_0xd280('0x2'));var fs=require('fs');var Redis=require(_0xd280('0x3'));var db=require(_0xd280('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd280('0x5'))(_0xd280('0x6'));var config=require(_0xd280('0x7'));var jayson=require(_0xd280('0x8'));var client=jayson['client'][_0xd280('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e6d3a,_0x4b1b00,_0x581f97){return new BPromise(function(_0x484255,_0xc337d3){return client['request'](_0x3e6d3a,_0x581f97)[_0xd280('0xa')](function(_0x299c78){logger['info']('SAUnitMeasure,\x20%s,\x20%s',_0x4b1b00,_0xd280('0xb'));logger[_0xd280('0xc')](_0xd280('0xd'),_0x4b1b00,_0xd280('0xb'),JSON['stringify'](_0x299c78));if(_0x299c78['error']){if(_0x299c78['error'][_0xd280('0xe')]===0x1f4){logger[_0xd280('0xf')](_0xd280('0x10'),_0x4b1b00,_0x299c78['error'][_0xd280('0x11')]);return _0xc337d3(_0x299c78[_0xd280('0xf')][_0xd280('0x11')]);}logger[_0xd280('0xf')](_0xd280('0x10'),_0x4b1b00,_0x299c78[_0xd280('0xf')][_0xd280('0x11')]);return _0x484255(_0x299c78[_0xd280('0xf')][_0xd280('0x11')]);}else{logger[_0xd280('0x12')]('SAUnitMeasure,\x20%s,\x20%s',_0x4b1b00,_0xd280('0xb'));_0x484255(_0x299c78[_0xd280('0x13')][_0xd280('0x11')]);}})[_0xd280('0x14')](function(_0x4d966d){logger[_0xd280('0xf')](_0xd280('0x10'),_0x4b1b00,_0x4d966d);_0xc337d3(_0x4d966d);});});} \ No newline at end of file +var _0xcead=['info','result','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','SAUnitMeasure,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xcead,0xc8));var _0xdcea=function(_0x36383d,_0x27c600){_0x36383d=_0x36383d-0x0;var _0x438fab=_0xcead[_0x36383d];return _0x438fab;};'use strict';var _=require(_0xdcea('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xdcea('0x1'));var rs=require(_0xdcea('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdcea('0x3'))['db'];var utils=require(_0xdcea('0x4'));var logger=require('../../config/logger')(_0xdcea('0x5'));var config=require(_0xdcea('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xdcea('0x7')][_0xdcea('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x83ed7c,_0x10e041,_0x49ef3d){return new BPromise(function(_0x80b948,_0x70d09a){return client[_0xdcea('0x9')](_0x83ed7c,_0x49ef3d)['then'](function(_0x166949){logger['info'](_0xdcea('0xa'),_0x10e041,_0xdcea('0xb'));logger['debug']('SAUnitMeasure,\x20%s,\x20%s,\x20%s',_0x10e041,_0xdcea('0xb'),JSON[_0xdcea('0xc')](_0x166949));if(_0x166949[_0xdcea('0xd')]){if(_0x166949[_0xdcea('0xd')][_0xdcea('0xe')]===0x1f4){logger[_0xdcea('0xd')](_0xdcea('0xa'),_0x10e041,_0x166949[_0xdcea('0xd')][_0xdcea('0xf')]);return _0x70d09a(_0x166949[_0xdcea('0xd')][_0xdcea('0xf')]);}logger[_0xdcea('0xd')](_0xdcea('0xa'),_0x10e041,_0x166949[_0xdcea('0xd')][_0xdcea('0xf')]);return _0x80b948(_0x166949[_0xdcea('0xd')][_0xdcea('0xf')]);}else{logger[_0xdcea('0x10')](_0xdcea('0xa'),_0x10e041,_0xdcea('0xb'));_0x80b948(_0x166949[_0xdcea('0x11')][_0xdcea('0xf')]);}})['catch'](function(_0x258062){logger[_0xdcea('0xd')](_0xdcea('0xa'),_0x10e041,_0x258062);_0x70d09a(_0x258062);});});} \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 3e7e705..05e9fd9 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 _0x1f82=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','show','/:id/run','run','post','create','put','/:id','delete','destroy','path'];(function(_0x2a005f,_0x1b0f12){var _0x4281b0=function(_0x5423e5){while(--_0x5423e5){_0x2a005f['push'](_0x2a005f['shift']());}};_0x4281b0(++_0x1b0f12);}(_0x1f82,0x6b));var _0x21f8=function(_0x591df1,_0xd2030b){_0x591df1=_0x591df1-0x0;var _0x28f068=_0x1f82[_0x591df1];return _0x28f068;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x21f8('0x0'));var timeout=require(_0x21f8('0x1'));var express=require(_0x21f8('0x2'));var router=express['Router']();var auth=require(_0x21f8('0x3'));var interaction=require(_0x21f8('0x4'));var config=require(_0x21f8('0x5'));var controller=require(_0x21f8('0x6'));router[_0x21f8('0x7')]('/',auth[_0x21f8('0x8')](),controller['index']);router['get']('/:id',auth[_0x21f8('0x8')](),controller[_0x21f8('0x9')]);router[_0x21f8('0x7')](_0x21f8('0xa'),auth[_0x21f8('0x8')](),controller[_0x21f8('0xb')]);router[_0x21f8('0xc')]('/',auth[_0x21f8('0x8')](),controller[_0x21f8('0xd')]);router[_0x21f8('0xe')](_0x21f8('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x21f8('0x10')]('/:id',auth[_0x21f8('0x8')](),controller[_0x21f8('0x11')]);module['exports']=router; \ No newline at end of file +var _0xa059=['/:id','show','run','create','put','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./schedule.controller','get','isAuthenticated','index'];(function(_0xbc314a,_0x4218d3){var _0x3333cf=function(_0x12c3a7){while(--_0x12c3a7){_0xbc314a['push'](_0xbc314a['shift']());}};_0x3333cf(++_0x4218d3);}(_0xa059,0x15e));var _0x9a05=function(_0x10689b,_0x3cef3f){_0x10689b=_0x10689b-0x0;var _0x227c77=_0xa059[_0x10689b];return _0x227c77;};'use strict';var multer=require(_0x9a05('0x0'));var util=require(_0x9a05('0x1'));var path=require('path');var timeout=require(_0x9a05('0x2'));var express=require(_0x9a05('0x3'));var router=express[_0x9a05('0x4')]();var auth=require(_0x9a05('0x5'));var interaction=require(_0x9a05('0x6'));var config=require('../../config/environment');var controller=require(_0x9a05('0x7'));router[_0x9a05('0x8')]('/',auth[_0x9a05('0x9')](),controller[_0x9a05('0xa')]);router[_0x9a05('0x8')](_0x9a05('0xb'),auth[_0x9a05('0x9')](),controller[_0x9a05('0xc')]);router[_0x9a05('0x8')]('/:id/run',auth[_0x9a05('0x9')](),controller[_0x9a05('0xd')]);router['post']('/',auth[_0x9a05('0x9')](),controller[_0x9a05('0xe')]);router[_0x9a05('0xf')]('/:id',auth[_0x9a05('0x9')](),controller[_0x9a05('0x10')]);router[_0x9a05('0x11')](_0x9a05('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x9a05('0x12')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 7191da8..e6af689 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 _0x019f=['custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','months','weeks','hours','pdf','xlsx','csv'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x019f,0x159));var _0xf019=function(_0x5df7e6,_0x12d771){_0x5df7e6=_0x5df7e6-0x0;var _0xfaba1b=_0x019f[_0x5df7e6];return _0xfaba1b;};'use strict';var Sequelize=require(_0xf019('0x0'));module[_0xf019('0x1')]={'name':{'type':Sequelize[_0xf019('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xf019('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xf019('0x2')],'allowNull':![],'defaultValue':_0xf019('0x4')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0xf019('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xf019('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xf019('0x7')](_0xf019('0x8'),_0xf019('0x9'),_0xf019('0xa'),_0xf019('0xb'),'days',_0xf019('0xc'),'minutes'),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0xf019('0x7')]('csv',_0xf019('0xd'),_0xf019('0xe')),'allowNull':![],'defaultValue':_0xf019('0xf')},'type':{'type':Sequelize[_0xf019('0x7')](_0xf019('0x10'),_0xf019('0x11')),'allowNull':![],'defaultValue':_0xf019('0x10')},'sendMail':{'type':Sequelize[_0xf019('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xf019('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0xf019('0x12')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xea5f=['quarters','weeks','days','hours','minutes','ENUM','csv','custom','TEXT','sequelize','exports','STRING','BOOLEAN','DATE','INTEGER','years'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xea5f,0xb9));var _0xfea5=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0xea5f[_0x257642];return _0x3d813b;};'use strict';var Sequelize=require(_0xfea5('0x0'));module[_0xfea5('0x1')]={'name':{'type':Sequelize[_0xfea5('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xfea5('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xfea5('0x2')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0xfea5('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0xfea5('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xfea5('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0xfea5('0x6'),_0xfea5('0x7'),'months',_0xfea5('0x8'),_0xfea5('0x9'),_0xfea5('0xa'),_0xfea5('0xb')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0xfea5('0xc')](_0xfea5('0xd'),'pdf','xlsx'),'allowNull':![],'defaultValue':_0xfea5('0xd')},'type':{'type':Sequelize[_0xfea5('0xc')](_0xfea5('0xe'),'default'),'allowNull':![],'defaultValue':_0xfea5('0xe')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xfea5('0x2')]},'cc':{'type':Sequelize[_0xfea5('0xf')]},'bcc':{'type':Sequelize[_0xfea5('0xf')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 85c66ed..4f8b7c3 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 _0x5594=['count','offset','limit','set','apply','reject','destroy','get','error','stack','name','send','index','Schedule','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','map','type','field','options','then','include','findAll','rows','show','params','includeAll','catch','create','body','user','Scheduler','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','run','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json'];(function(_0x54c59b,_0x388935){var _0x5674eb=function(_0x1b6ae0){while(--_0x1b6ae0){_0x54c59b['push'](_0x54c59b['shift']());}};_0x5674eb(++_0x388935);}(_0x5594,0x173));var _0x4559=function(_0x38da4d,_0x2e0982){_0x38da4d=_0x38da4d-0x0;var _0xbed138=_0x5594[_0x38da4d];return _0xbed138;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x4559('0x0'));var zipdir=require(_0x4559('0x1'));var jsonpatch=require(_0x4559('0x2'));var rp=require('request-promise');var moment=require(_0x4559('0x3'));var BPromise=require(_0x4559('0x4'));var Mustache=require(_0x4559('0x5'));var util=require(_0x4559('0x6'));var path=require(_0x4559('0x7'));var sox=require(_0x4559('0x8'));var csv=require(_0x4559('0x9'));var ejs=require(_0x4559('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4559('0xb'));var crypto=require(_0x4559('0xc'));var jsforce=require(_0x4559('0xd'));var deskjs=require(_0x4559('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4559('0xf'));var Papa=require(_0x4559('0x10'));var Redis=require(_0x4559('0x11'));var authService=require(_0x4559('0x12'));var qs=require(_0x4559('0x13'));var hardwareService=require(_0x4559('0x14'));var logger=require(_0x4559('0x15'))(_0x4559('0x16'));var utils=require(_0x4559('0x17'));var config=require(_0x4559('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x291827,_0x1a3c38){_0x1a3c38=_0x1a3c38||0xcc;return function(_0x6a39aa){if(_0x6a39aa){return _0x291827[_0x4559('0x19')](_0x1a3c38);}return _0x291827[_0x4559('0x1a')](_0x1a3c38)[_0x4559('0x1b')]();};}function respondWithResult(_0x3b38fe,_0xa5dc09){_0xa5dc09=_0xa5dc09||0xc8;return function(_0x4b418e){if(_0x4b418e){return _0x3b38fe['status'](_0xa5dc09)[_0x4559('0x1c')](_0x4b418e);}};}function respondWithFilteredResult(_0x78c6d0,_0x98cd41){return function(_0xb63354){if(_0xb63354){var _0x2b04b4=_0xb63354[_0x4559('0x1d')],_0x5d7ef9=_0x98cd41[_0x4559('0x1e')],_0x45a1b1=_0x98cd41[_0x4559('0x1e')]+_0x98cd41[_0x4559('0x1f')],_0x222cf8;if(_0x45a1b1>=_0x2b04b4){_0x45a1b1=_0x2b04b4;_0x222cf8=0xc8;}else{_0x222cf8=0xce;}_0x78c6d0[_0x4559('0x1a')](_0x222cf8);return _0x78c6d0[_0x4559('0x20')]('Content-Range',_0x5d7ef9+'-'+_0x45a1b1+'/'+_0x2b04b4)['json'](_0xb63354);}return null;};}function patchUpdates(_0xee0869){return function(_0x349fee){try{jsonpatch[_0x4559('0x21')](_0x349fee,_0xee0869,!![]);}catch(_0xaef369){return BPromise[_0x4559('0x22')](_0xaef369);}return _0x349fee['save']();};}function saveUpdates(_0x333dfd,_0x80c345){return function(_0x40a6c9){if(_0x40a6c9){return _0x40a6c9['update'](_0x333dfd)['then'](function(_0x3eefe1){return _0x3eefe1;});}return null;};}function removeEntity(_0x43ceab,_0x32da19){return function(_0x57dfa1){if(_0x57dfa1){return _0x57dfa1[_0x4559('0x23')]()['then'](function(){var _0xad0c05=_0x57dfa1[_0x4559('0x24')]({'plain':!![]});var _0x2de671='Scheduler';return db['UserProfileResource'][_0x4559('0x23')]({'where':{'type':_0x2de671,'resourceId':_0xad0c05['id']}})['then'](function(){return _0x57dfa1;});})['then'](function(){_0x43ceab[_0x4559('0x1a')](0xcc)[_0x4559('0x1b')]();});}};}function handleEntityNotFound(_0xa3bd27,_0x30c3ca){return function(_0x5eeef1){if(!_0x5eeef1){_0xa3bd27[_0x4559('0x19')](0x194);}return _0x5eeef1;};}function handleError(_0x119435,_0x31de9d){_0x31de9d=_0x31de9d||0x1f4;return function(_0x144796){logger[_0x4559('0x25')](_0x144796[_0x4559('0x26')]);if(_0x144796[_0x4559('0x27')]){delete _0x144796[_0x4559('0x27')];}_0x119435[_0x4559('0x1a')](_0x31de9d)[_0x4559('0x28')](_0x144796);};}exports[_0x4559('0x29')]=function(_0x2d2925,_0x366161){var _0x37aef8={},_0x4e28c8={},_0x485a84={'count':0x0,'rows':[]};var _0x17fd57=db[_0x4559('0x2a')][_0x4559('0x2b')];_0x4e28c8[_0x4559('0x2c')]=_[_0x4559('0x2d')](_0x17fd57);_0x4e28c8['query']=_[_0x4559('0x2d')](_0x2d2925[_0x4559('0x2e')]);_0x4e28c8[_0x4559('0x2f')]=_[_0x4559('0x30')](_0x4e28c8[_0x4559('0x2c')],_0x4e28c8[_0x4559('0x2e')]);_0x37aef8[_0x4559('0x31')]=_[_0x4559('0x30')](_0x4e28c8[_0x4559('0x2c')],qs[_0x4559('0x32')](_0x2d2925[_0x4559('0x2e')][_0x4559('0x32')]));_0x37aef8['attributes']=_0x37aef8[_0x4559('0x31')][_0x4559('0x33')]?_0x37aef8['attributes']:_0x4e28c8[_0x4559('0x2c')];if(!_0x2d2925[_0x4559('0x2e')]['hasOwnProperty']('nolimit')){_0x37aef8[_0x4559('0x1f')]=qs[_0x4559('0x1f')](_0x2d2925['query'][_0x4559('0x1f')]);_0x37aef8[_0x4559('0x1e')]=qs[_0x4559('0x1e')](_0x2d2925[_0x4559('0x2e')][_0x4559('0x1e')]);}_0x37aef8[_0x4559('0x34')]=qs['sort'](_0x2d2925[_0x4559('0x2e')][_0x4559('0x35')]);_0x37aef8[_0x4559('0x36')]=qs[_0x4559('0x2f')](_[_0x4559('0x37')](_0x2d2925[_0x4559('0x2e')],_0x4e28c8[_0x4559('0x2f')]));if(_0x2d2925[_0x4559('0x2e')][_0x4559('0x38')]){_0x37aef8[_0x4559('0x36')]=_[_0x4559('0x39')](_0x37aef8['where'],{'$or':_[_0x4559('0x3a')](_0x17fd57,function(_0x5b6eaa){if(_0x5b6eaa[_0x4559('0x3b')]['key']!=='VIRTUAL'){var _0x2776bd={};_0x2776bd[_0x5b6eaa[_0x4559('0x3c')]]={'$like':'%'+_0x2d2925[_0x4559('0x2e')][_0x4559('0x38')]+'%'};return _0x2776bd;}})});}_0x37aef8=_[_0x4559('0x39')]({},_0x37aef8,_0x2d2925[_0x4559('0x3d')]);var _0x2ff901={'where':_0x37aef8['where']};return db['Schedule'][_0x4559('0x1d')](_0x2ff901)[_0x4559('0x3e')](function(_0x48ca3d){_0x485a84[_0x4559('0x1d')]=_0x48ca3d;if(_0x2d2925[_0x4559('0x2e')]['includeAll']){_0x37aef8[_0x4559('0x3f')]=[{'all':!![]}];}return db[_0x4559('0x2a')][_0x4559('0x40')](_0x37aef8);})['then'](function(_0x86fa06){_0x485a84[_0x4559('0x41')]=_0x86fa06;return _0x485a84;})[_0x4559('0x3e')](respondWithFilteredResult(_0x366161,_0x37aef8))['catch'](handleError(_0x366161,null));};exports[_0x4559('0x42')]=function(_0x5cf45b,_0x2f09ab){var _0x219ffa={'raw':![],'where':{'id':_0x5cf45b[_0x4559('0x43')]['id']}},_0x1b928f={};_0x1b928f[_0x4559('0x2c')]=_['keys'](db[_0x4559('0x2a')][_0x4559('0x2b')]);_0x1b928f[_0x4559('0x2e')]=_['keys'](_0x5cf45b[_0x4559('0x2e')]);_0x1b928f[_0x4559('0x2f')]=_[_0x4559('0x30')](_0x1b928f[_0x4559('0x2c')],_0x1b928f[_0x4559('0x2e')]);_0x219ffa[_0x4559('0x31')]=_[_0x4559('0x30')](_0x1b928f[_0x4559('0x2c')],qs[_0x4559('0x32')](_0x5cf45b[_0x4559('0x2e')][_0x4559('0x32')]));_0x219ffa[_0x4559('0x31')]=_0x219ffa[_0x4559('0x31')][_0x4559('0x33')]?_0x219ffa[_0x4559('0x31')]:_0x1b928f[_0x4559('0x2c')];if(_0x5cf45b['query'][_0x4559('0x44')]){_0x219ffa[_0x4559('0x3f')]=[{'all':!![]}];}_0x219ffa=_['merge']({},_0x219ffa,_0x5cf45b[_0x4559('0x3d')]);return db[_0x4559('0x2a')]['find'](_0x219ffa)['then'](handleEntityNotFound(_0x2f09ab,null))['then'](respondWithResult(_0x2f09ab,null))[_0x4559('0x45')](handleError(_0x2f09ab,null));};exports[_0x4559('0x46')]=function(_0x5e232b,_0x18e368){return db[_0x4559('0x2a')][_0x4559('0x46')](_0x5e232b[_0x4559('0x47')],{})[_0x4559('0x3e')](function(_0x3859b7){var _0x2d3285=_0x5e232b[_0x4559('0x48')][_0x4559('0x24')]({'plain':!![]});if(!_0x2d3285)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2d3285['role']==='user'){var _0x283741=_0x3859b7[_0x4559('0x24')]({'plain':!![]});var _0x5f59c8=_0x4559('0x49');return db[_0x4559('0x4a')][_0x4559('0x4b')]({'where':{'name':_0x5f59c8,'userProfileId':_0x2d3285['userProfileId']},'raw':!![]})['then'](function(_0x2e3fc3){if(_0x2e3fc3&&_0x2e3fc3[_0x4559('0x4c')]===0x0){return db['UserProfileResource'][_0x4559('0x46')]({'name':_0x283741['name'],'resourceId':_0x283741['id'],'type':_0x2e3fc3[_0x4559('0x27')],'sectionId':_0x2e3fc3['id']},{})[_0x4559('0x3e')](function(){return _0x3859b7;});}else{return _0x3859b7;}})[_0x4559('0x45')](function(_0x2976ce){logger[_0x4559('0x25')](_0x4559('0x4d'),_0x2976ce);throw _0x2976ce;});}return _0x3859b7;})[_0x4559('0x3e')](respondWithResult(_0x18e368,0xc9))['catch'](handleError(_0x18e368,null));};exports[_0x4559('0x4e')]=function(_0x20325a,_0x124936){if(_0x20325a['body']['id']){delete _0x20325a['body']['id'];}return db['Schedule']['find']({'where':{'id':_0x20325a[_0x4559('0x43')]['id']}})[_0x4559('0x3e')](handleEntityNotFound(_0x124936,null))['then'](saveUpdates(_0x20325a[_0x4559('0x47')],null))[_0x4559('0x3e')](respondWithResult(_0x124936,null))[_0x4559('0x45')](handleError(_0x124936,null));};exports[_0x4559('0x23')]=function(_0x3d3532,_0xae46d0){return db['Schedule']['find']({'where':{'id':_0x3d3532[_0x4559('0x43')]['id']}})[_0x4559('0x3e')](handleEntityNotFound(_0xae46d0,null))[_0x4559('0x3e')](removeEntity(_0xae46d0,null))[_0x4559('0x45')](handleError(_0xae46d0,null));};exports[_0x4559('0x4f')]=function(_0x1ea3c8,_0x1b2d7b,_0x10ca65){var _0xffc637=require('../../config/schedule');return db[_0x4559('0x2a')][_0x4559('0x4b')]({'where':{'id':_0x1ea3c8[_0x4559('0x43')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x1b2d7b,null))[_0x4559('0x3e')](function(){_0xffc637[_0x4559('0x4f')](_0x1ea3c8[_0x4559('0x43')]['id']);})[_0x4559('0x3e')](respondWithStatusCode(_0x1b2d7b,null))[_0x4559('0x45')](handleError(_0x1b2d7b,null));}; \ No newline at end of file +var _0xc32d=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','then','get','destroy','error','name','index','Schedule','rawAttributes','keys','filters','intersection','model','query','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','field','options','includeAll','include','findAll','params','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','run','../../config/schedule','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','papaparse'];(function(_0x4c4304,_0x2eb2e9){var _0x271be1=function(_0x18c6d6){while(--_0x18c6d6){_0x4c4304['push'](_0x4c4304['shift']());}};_0x271be1(++_0x2eb2e9);}(_0xc32d,0xd5));var _0xdc32=function(_0x40f181,_0x404129){_0x40f181=_0x40f181-0x0;var _0x157293=_0xc32d[_0x40f181];return _0x157293;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xdc32('0x0'));var jsonpatch=require(_0xdc32('0x1'));var rp=require(_0xdc32('0x2'));var moment=require(_0xdc32('0x3'));var BPromise=require(_0xdc32('0x4'));var Mustache=require(_0xdc32('0x5'));var util=require(_0xdc32('0x6'));var path=require(_0xdc32('0x7'));var sox=require(_0xdc32('0x8'));var csv=require(_0xdc32('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xdc32('0xa'));var squel=require(_0xdc32('0xb'));var crypto=require('crypto');var jsforce=require(_0xdc32('0xc'));var deskjs=require(_0xdc32('0xd'));var toCsv=require(_0xdc32('0x9'));var querystring=require('querystring');var Papa=require(_0xdc32('0xe'));var Redis=require('ioredis');var authService=require(_0xdc32('0xf'));var qs=require(_0xdc32('0x10'));var hardwareService=require(_0xdc32('0x11'));var logger=require(_0xdc32('0x12'))(_0xdc32('0x13'));var utils=require('../../config/utils');var config=require(_0xdc32('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x989777,_0xbadbc){_0xbadbc=_0xbadbc||0xcc;return function(_0x33f011){if(_0x33f011){return _0x989777[_0xdc32('0x15')](_0xbadbc);}return _0x989777[_0xdc32('0x16')](_0xbadbc)[_0xdc32('0x17')]();};}function respondWithResult(_0x483ba9,_0x3b59bb){_0x3b59bb=_0x3b59bb||0xc8;return function(_0x5a9099){if(_0x5a9099){return _0x483ba9[_0xdc32('0x16')](_0x3b59bb)[_0xdc32('0x18')](_0x5a9099);}};}function respondWithFilteredResult(_0x2f20e8,_0x497c59){return function(_0x13615a){if(_0x13615a){var _0x3d9e55=_0x13615a[_0xdc32('0x19')],_0x55128f=_0x497c59[_0xdc32('0x1a')],_0x1ffe7c=_0x497c59['offset']+_0x497c59[_0xdc32('0x1b')],_0x16dcd3;if(_0x1ffe7c>=_0x3d9e55){_0x1ffe7c=_0x3d9e55;_0x16dcd3=0xc8;}else{_0x16dcd3=0xce;}_0x2f20e8[_0xdc32('0x16')](_0x16dcd3);return _0x2f20e8[_0xdc32('0x1c')](_0xdc32('0x1d'),_0x55128f+'-'+_0x1ffe7c+'/'+_0x3d9e55)['json'](_0x13615a);}return null;};}function patchUpdates(_0x14aa61){return function(_0x477bc1){try{jsonpatch[_0xdc32('0x1e')](_0x477bc1,_0x14aa61,!![]);}catch(_0x347eea){return BPromise[_0xdc32('0x1f')](_0x347eea);}return _0x477bc1['save']();};}function saveUpdates(_0x1bf443,_0xb7afe){return function(_0x34f07f){if(_0x34f07f){return _0x34f07f['update'](_0x1bf443)[_0xdc32('0x20')](function(_0x587148){return _0x587148;});}return null;};}function removeEntity(_0x306f09,_0x4a3f56){return function(_0x5af3ce){if(_0x5af3ce){return _0x5af3ce['destroy']()[_0xdc32('0x20')](function(){var _0x1e33c9=_0x5af3ce[_0xdc32('0x21')]({'plain':!![]});var _0x384d45='Scheduler';return db['UserProfileResource'][_0xdc32('0x22')]({'where':{'type':_0x384d45,'resourceId':_0x1e33c9['id']}})['then'](function(){return _0x5af3ce;});})[_0xdc32('0x20')](function(){_0x306f09[_0xdc32('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3898b2,_0x53afbd){return function(_0x40eb82){if(!_0x40eb82){_0x3898b2[_0xdc32('0x15')](0x194);}return _0x40eb82;};}function handleError(_0x2105f8,_0x57bf1c){_0x57bf1c=_0x57bf1c||0x1f4;return function(_0x3e874e){logger[_0xdc32('0x23')](_0x3e874e['stack']);if(_0x3e874e[_0xdc32('0x24')]){delete _0x3e874e['name'];}_0x2105f8[_0xdc32('0x16')](_0x57bf1c)['send'](_0x3e874e);};}exports[_0xdc32('0x25')]=function(_0x592940,_0x28492b){var _0x28d33e={},_0x5872ba={},_0x10b891={'count':0x0,'rows':[]};var _0x38ae4b=db[_0xdc32('0x26')][_0xdc32('0x27')];_0x5872ba['model']=_[_0xdc32('0x28')](_0x38ae4b);_0x5872ba['query']=_[_0xdc32('0x28')](_0x592940['query']);_0x5872ba[_0xdc32('0x29')]=_[_0xdc32('0x2a')](_0x5872ba[_0xdc32('0x2b')],_0x5872ba[_0xdc32('0x2c')]);_0x28d33e[_0xdc32('0x2d')]=_[_0xdc32('0x2a')](_0x5872ba[_0xdc32('0x2b')],qs[_0xdc32('0x2e')](_0x592940['query'][_0xdc32('0x2e')]));_0x28d33e[_0xdc32('0x2d')]=_0x28d33e[_0xdc32('0x2d')]['length']?_0x28d33e[_0xdc32('0x2d')]:_0x5872ba[_0xdc32('0x2b')];if(!_0x592940[_0xdc32('0x2c')][_0xdc32('0x2f')]('nolimit')){_0x28d33e['limit']=qs[_0xdc32('0x1b')](_0x592940[_0xdc32('0x2c')][_0xdc32('0x1b')]);_0x28d33e['offset']=qs[_0xdc32('0x1a')](_0x592940[_0xdc32('0x2c')]['offset']);}_0x28d33e[_0xdc32('0x30')]=qs['sort'](_0x592940[_0xdc32('0x2c')][_0xdc32('0x31')]);_0x28d33e['where']=qs[_0xdc32('0x29')](_[_0xdc32('0x32')](_0x592940[_0xdc32('0x2c')],_0x5872ba[_0xdc32('0x29')]));if(_0x592940[_0xdc32('0x2c')][_0xdc32('0x33')]){_0x28d33e[_0xdc32('0x34')]=_[_0xdc32('0x35')](_0x28d33e[_0xdc32('0x34')],{'$or':_['map'](_0x38ae4b,function(_0x41d099){if(_0x41d099['type']['key']!==_0xdc32('0x36')){var _0x33d230={};_0x33d230[_0x41d099[_0xdc32('0x37')]]={'$like':'%'+_0x592940[_0xdc32('0x2c')][_0xdc32('0x33')]+'%'};return _0x33d230;}})});}_0x28d33e=_['merge']({},_0x28d33e,_0x592940[_0xdc32('0x38')]);var _0x3c0e29={'where':_0x28d33e[_0xdc32('0x34')]};return db[_0xdc32('0x26')][_0xdc32('0x19')](_0x3c0e29)[_0xdc32('0x20')](function(_0x132702){_0x10b891[_0xdc32('0x19')]=_0x132702;if(_0x592940[_0xdc32('0x2c')][_0xdc32('0x39')]){_0x28d33e[_0xdc32('0x3a')]=[{'all':!![]}];}return db[_0xdc32('0x26')][_0xdc32('0x3b')](_0x28d33e);})[_0xdc32('0x20')](function(_0x447fc3){_0x10b891['rows']=_0x447fc3;return _0x10b891;})['then'](respondWithFilteredResult(_0x28492b,_0x28d33e))['catch'](handleError(_0x28492b,null));};exports['show']=function(_0x417890,_0x300d87){var _0x8ad2bb={'raw':![],'where':{'id':_0x417890[_0xdc32('0x3c')]['id']}},_0x9a2ee2={};_0x9a2ee2[_0xdc32('0x2b')]=_[_0xdc32('0x28')](db[_0xdc32('0x26')][_0xdc32('0x27')]);_0x9a2ee2[_0xdc32('0x2c')]=_[_0xdc32('0x28')](_0x417890[_0xdc32('0x2c')]);_0x9a2ee2['filters']=_[_0xdc32('0x2a')](_0x9a2ee2[_0xdc32('0x2b')],_0x9a2ee2['query']);_0x8ad2bb['attributes']=_['intersection'](_0x9a2ee2['model'],qs[_0xdc32('0x2e')](_0x417890[_0xdc32('0x2c')][_0xdc32('0x2e')]));_0x8ad2bb['attributes']=_0x8ad2bb[_0xdc32('0x2d')][_0xdc32('0x3d')]?_0x8ad2bb[_0xdc32('0x2d')]:_0x9a2ee2[_0xdc32('0x2b')];if(_0x417890[_0xdc32('0x2c')][_0xdc32('0x39')]){_0x8ad2bb[_0xdc32('0x3a')]=[{'all':!![]}];}_0x8ad2bb=_[_0xdc32('0x35')]({},_0x8ad2bb,_0x417890['options']);return db['Schedule'][_0xdc32('0x3e')](_0x8ad2bb)['then'](handleEntityNotFound(_0x300d87,null))[_0xdc32('0x20')](respondWithResult(_0x300d87,null))['catch'](handleError(_0x300d87,null));};exports[_0xdc32('0x3f')]=function(_0x47361c,_0x4ad5b1){return db[_0xdc32('0x26')]['create'](_0x47361c['body'],{})['then'](function(_0x37fe79){var _0x1626fb=_0x47361c[_0xdc32('0x40')][_0xdc32('0x21')]({'plain':!![]});if(!_0x1626fb)throw new Error(_0xdc32('0x41'));if(_0x1626fb[_0xdc32('0x42')]==='user'){var _0xc78bba=_0x37fe79[_0xdc32('0x21')]({'plain':!![]});var _0x492ba1='Scheduler';return db[_0xdc32('0x43')][_0xdc32('0x3e')]({'where':{'name':_0x492ba1,'userProfileId':_0x1626fb[_0xdc32('0x44')]},'raw':!![]})['then'](function(_0x138b94){if(_0x138b94&&_0x138b94[_0xdc32('0x45')]===0x0){return db['UserProfileResource'][_0xdc32('0x3f')]({'name':_0xc78bba[_0xdc32('0x24')],'resourceId':_0xc78bba['id'],'type':_0x138b94['name'],'sectionId':_0x138b94['id']},{})[_0xdc32('0x20')](function(){return _0x37fe79;});}else{return _0x37fe79;}})[_0xdc32('0x46')](function(_0x48c4b7){logger['error'](_0xdc32('0x47'),_0x48c4b7);throw _0x48c4b7;});}return _0x37fe79;})[_0xdc32('0x20')](respondWithResult(_0x4ad5b1,0xc9))[_0xdc32('0x46')](handleError(_0x4ad5b1,null));};exports[_0xdc32('0x48')]=function(_0x37a5c0,_0x5615c8){if(_0x37a5c0['body']['id']){delete _0x37a5c0[_0xdc32('0x49')]['id'];}return db[_0xdc32('0x26')][_0xdc32('0x3e')]({'where':{'id':_0x37a5c0[_0xdc32('0x3c')]['id']}})[_0xdc32('0x20')](handleEntityNotFound(_0x5615c8,null))[_0xdc32('0x20')](saveUpdates(_0x37a5c0['body'],null))[_0xdc32('0x20')](respondWithResult(_0x5615c8,null))['catch'](handleError(_0x5615c8,null));};exports['destroy']=function(_0x29eeb2,_0x4b1730){return db['Schedule'][_0xdc32('0x3e')]({'where':{'id':_0x29eeb2[_0xdc32('0x3c')]['id']}})[_0xdc32('0x20')](handleEntityNotFound(_0x4b1730,null))[_0xdc32('0x20')](removeEntity(_0x4b1730,null))[_0xdc32('0x46')](handleError(_0x4b1730,null));};exports[_0xdc32('0x4a')]=function(_0x4e7ddc,_0x3d882f,_0x5708d1){var _0x8f694b=require(_0xdc32('0x4b'));return db[_0xdc32('0x26')]['find']({'where':{'id':_0x4e7ddc[_0xdc32('0x3c')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x3d882f,null))[_0xdc32('0x20')](function(){_0x8f694b[_0xdc32('0x4a')](_0x4e7ddc[_0xdc32('0x3c')]['id']);})[_0xdc32('0x20')](respondWithStatusCode(_0x3d882f,null))[_0xdc32('0x46')](handleError(_0x3d882f,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 9b3b002..0f52452 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 _0x62d1=['./schedule.attributes','exports','define','Schedule','tools_schedules','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2b29e7,_0x3a1cfa){var _0x52a9c3=function(_0x4e077a){while(--_0x4e077a){_0x2b29e7['push'](_0x2b29e7['shift']());}};_0x52a9c3(++_0x3a1cfa);}(_0x62d1,0x163));var _0x162d=function(_0x1e4535,_0x37cf32){_0x1e4535=_0x1e4535-0x0;var _0x4d8658=_0x62d1[_0x1e4535];return _0x4d8658;};'use strict';var _=require(_0x162d('0x0'));var util=require(_0x162d('0x1'));var logger=require(_0x162d('0x2'))(_0x162d('0x3'));var moment=require('moment');var BPromise=require(_0x162d('0x4'));var rp=require(_0x162d('0x5'));var fs=require('fs');var path=require(_0x162d('0x6'));var rimraf=require(_0x162d('0x7'));var config=require(_0x162d('0x8'));var attributes=require(_0x162d('0x9'));module[_0x162d('0xa')]=function(_0x80c1a6,_0x58d265){return _0x80c1a6[_0x162d('0xb')](_0x162d('0xc'),attributes,{'tableName':_0x162d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7ec1=['./schedule.attributes','exports','define','Schedule','tools_schedules','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x35ce73,_0x915343){var _0x41bfb9=function(_0x44618b){while(--_0x44618b){_0x35ce73['push'](_0x35ce73['shift']());}};_0x41bfb9(++_0x915343);}(_0x7ec1,0x1a5));var _0x17ec=function(_0x53a5c7,_0x126557){_0x53a5c7=_0x53a5c7-0x0;var _0x418ded=_0x7ec1[_0x53a5c7];return _0x418ded;};'use strict';var _=require(_0x17ec('0x0'));var util=require(_0x17ec('0x1'));var logger=require(_0x17ec('0x2'))(_0x17ec('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x17ec('0x4'));var fs=require('fs');var path=require(_0x17ec('0x5'));var rimraf=require(_0x17ec('0x6'));var config=require(_0x17ec('0x7'));var attributes=require(_0x17ec('0x8'));module[_0x17ec('0x9')]=function(_0x1ff1f5,_0x10d6ce){return _0x1ff1f5[_0x17ec('0xa')](_0x17ec('0xb'),attributes,{'tableName':_0x17ec('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 8cdbaa2..699adf4 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 _0x82f3=['Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x234037,_0x83bd38){var _0x4d0e30=function(_0x341563){while(--_0x341563){_0x234037['push'](_0x234037['shift']());}};_0x4d0e30(++_0x83bd38);}(_0x82f3,0x10e));var _0x382f=function(_0x51a1e4,_0x246558){_0x51a1e4=_0x51a1e4-0x0;var _0x442fbf=_0x82f3[_0x51a1e4];return _0x442fbf;};'use strict';var _=require(_0x382f('0x0'));var util=require(_0x382f('0x1'));var moment=require(_0x382f('0x2'));var BPromise=require(_0x382f('0x3'));var rs=require(_0x382f('0x4'));var fs=require('fs');var Redis=require(_0x382f('0x5'));var db=require(_0x382f('0x6'))['db'];var utils=require(_0x382f('0x7'));var logger=require('../../config/logger')(_0x382f('0x8'));var config=require(_0x382f('0x9'));var jayson=require(_0x382f('0xa'));var client=jayson[_0x382f('0xb')][_0x382f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4ce0da,_0x1fe4b6,_0x3941da){return new BPromise(function(_0x398272,_0x430ca1){return client[_0x382f('0xd')](_0x4ce0da,_0x3941da)[_0x382f('0xe')](function(_0x1b35be){logger[_0x382f('0xf')](_0x382f('0x10'),_0x1fe4b6,_0x382f('0x11'));logger[_0x382f('0x12')](_0x382f('0x13'),_0x1fe4b6,_0x382f('0x11'),JSON[_0x382f('0x14')](_0x1b35be));if(_0x1b35be[_0x382f('0x15')]){if(_0x1b35be[_0x382f('0x15')][_0x382f('0x16')]===0x1f4){logger[_0x382f('0x15')]('Schedule,\x20%s,\x20%s',_0x1fe4b6,_0x1b35be['error'][_0x382f('0x17')]);return _0x430ca1(_0x1b35be[_0x382f('0x15')]['message']);}logger[_0x382f('0x15')](_0x382f('0x10'),_0x1fe4b6,_0x1b35be[_0x382f('0x15')][_0x382f('0x17')]);return _0x398272(_0x1b35be[_0x382f('0x15')][_0x382f('0x17')]);}else{logger['info'](_0x382f('0x10'),_0x1fe4b6,_0x382f('0x11'));_0x398272(_0x1b35be[_0x382f('0x18')][_0x382f('0x17')]);}})[_0x382f('0x19')](function(_0x3c6790){logger['error'](_0x382f('0x10'),_0x1fe4b6,_0x3c6790);_0x430ca1(_0x3c6790);});});} \ No newline at end of file +var _0x2555=['message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','jayson/promise','http','request','then','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2b9767,_0x18717b){var _0x536c46=function(_0x13e36a){while(--_0x13e36a){_0x2b9767['push'](_0x2b9767['shift']());}};_0x536c46(++_0x18717b);}(_0x2555,0x114));var _0x5255=function(_0x5d0f0b,_0x4838fc){_0x5d0f0b=_0x5d0f0b-0x0;var _0x3baa95=_0x2555[_0x5d0f0b];return _0x3baa95;};'use strict';var _=require(_0x5255('0x0'));var util=require(_0x5255('0x1'));var moment=require(_0x5255('0x2'));var BPromise=require(_0x5255('0x3'));var rs=require(_0x5255('0x4'));var fs=require('fs');var Redis=require(_0x5255('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5255('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5255('0x7'));var client=jayson['client'][_0x5255('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5f1dae,_0x55ae1f,_0x9c1651){return new BPromise(function(_0x543790,_0x44e054){return client[_0x5255('0x9')](_0x5f1dae,_0x9c1651)[_0x5255('0xa')](function(_0x3a052d){logger['info'](_0x5255('0xb'),_0x55ae1f,_0x5255('0xc'));logger[_0x5255('0xd')](_0x5255('0xe'),_0x55ae1f,_0x5255('0xc'),JSON[_0x5255('0xf')](_0x3a052d));if(_0x3a052d['error']){if(_0x3a052d[_0x5255('0x10')][_0x5255('0x11')]===0x1f4){logger['error'](_0x5255('0xb'),_0x55ae1f,_0x3a052d[_0x5255('0x10')][_0x5255('0x12')]);return _0x44e054(_0x3a052d[_0x5255('0x10')]['message']);}logger[_0x5255('0x10')](_0x5255('0xb'),_0x55ae1f,_0x3a052d[_0x5255('0x10')][_0x5255('0x12')]);return _0x543790(_0x3a052d[_0x5255('0x10')]['message']);}else{logger[_0x5255('0x13')](_0x5255('0xb'),_0x55ae1f,_0x5255('0xc'));_0x543790(_0x3a052d['result'][_0x5255('0x12')]);}})[_0x5255('0x14')](function(_0x42052f){logger[_0x5255('0x10')](_0x5255('0xb'),_0x55ae1f,_0x42052f);_0x44e054(_0x42052f);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 5c91d0b..957c51a 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 _0x9152=['delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/download','download','create','put','update'];(function(_0x3ad77d,_0x12190b){var _0x8d2c06=function(_0x18d831){while(--_0x18d831){_0x3ad77d['push'](_0x3ad77d['shift']());}};_0x8d2c06(++_0x12190b);}(_0x9152,0xbf));var _0x2915=function(_0x1a5091,_0x3b681d){_0x1a5091=_0x1a5091-0x0;var _0x3bdc47=_0x9152[_0x1a5091];return _0x3bdc47;};'use strict';var multer=require(_0x2915('0x0'));var util=require(_0x2915('0x1'));var path=require(_0x2915('0x2'));var timeout=require(_0x2915('0x3'));var express=require('express');var router=express[_0x2915('0x4')]();var auth=require(_0x2915('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2915('0x6'));var controller=require(_0x2915('0x7'));router[_0x2915('0x8')]('/',auth[_0x2915('0x9')](),controller[_0x2915('0xa')]);router[_0x2915('0x8')](_0x2915('0xb'),auth[_0x2915('0x9')](),controller['describe']);router[_0x2915('0x8')](_0x2915('0xc'),auth['isAuthenticated'](),controller[_0x2915('0xd')]);router[_0x2915('0x8')](_0x2915('0xe'),auth[_0x2915('0x9')](),controller[_0x2915('0xf')]);router['post']('/',auth[_0x2915('0x9')](),controller[_0x2915('0x10')]);router[_0x2915('0x11')](_0x2915('0xc'),auth[_0x2915('0x9')](),controller[_0x2915('0x12')]);router[_0x2915('0x13')](_0x2915('0xc'),auth[_0x2915('0x9')](),controller[_0x2915('0x14')]);module['exports']=router; \ No newline at end of file +var _0xc7c6=['exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./screenRecording.controller','isAuthenticated','index','get','/:id','/:id/download','download','post','create','put','update','delete'];(function(_0x18dedd,_0x4cb9e5){var _0x35b7e1=function(_0x429eb0){while(--_0x429eb0){_0x18dedd['push'](_0x18dedd['shift']());}};_0x35b7e1(++_0x4cb9e5);}(_0xc7c6,0xc9));var _0x6c7c=function(_0x25f718,_0x367712){_0x25f718=_0x25f718-0x0;var _0x5c1c56=_0xc7c6[_0x25f718];return _0x5c1c56;};'use strict';var multer=require(_0x6c7c('0x0'));var util=require(_0x6c7c('0x1'));var path=require(_0x6c7c('0x2'));var timeout=require(_0x6c7c('0x3'));var express=require(_0x6c7c('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x6c7c('0x5'));var config=require(_0x6c7c('0x6'));var controller=require(_0x6c7c('0x7'));router['get']('/',auth[_0x6c7c('0x8')](),controller[_0x6c7c('0x9')]);router[_0x6c7c('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x6c7c('0xa')](_0x6c7c('0xb'),auth[_0x6c7c('0x8')](),controller['show']);router[_0x6c7c('0xa')](_0x6c7c('0xc'),auth[_0x6c7c('0x8')](),controller[_0x6c7c('0xd')]);router[_0x6c7c('0xe')]('/',auth[_0x6c7c('0x8')](),controller[_0x6c7c('0xf')]);router[_0x6c7c('0x10')](_0x6c7c('0xb'),auth['isAuthenticated'](),controller[_0x6c7c('0x11')]);router[_0x6c7c('0x12')]('/:id',auth[_0x6c7c('0x8')](),controller['destroy']);module[_0x6c7c('0x13')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index edc5f6e..684b395 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 _0xa28c=['STRING','replace','setDataValue','INTEGER','subtract','closedAt','duration','DATE','startedAt','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','moment','path','../../config/environment','VIRTUAL','extname','getDataValue','value'];(function(_0x550a8c,_0x3fd3ac){var _0x4352c5=function(_0x5a1fd3){while(--_0x5a1fd3){_0x550a8c['push'](_0x550a8c['shift']());}};_0x4352c5(++_0x3fd3ac);}(_0xa28c,0x1dc));var _0xca28=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xa28c[_0x16b9ed];return _0x66b1f8;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xca28('0x0'));var path=require(_0xca28('0x1'));var config=require(_0xca28('0x2'));module['exports']={'format':{'type':Sequelize[_0xca28('0x3')],'get':function(){return this['getDataValue']('value')?path[_0xca28('0x4')](this[_0xca28('0x5')](_0xca28('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0xca28('0x7')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0xca28('0x7')],'set':function(_0x2c843d){var _0x2b173=_0x2c843d[_0xca28('0x8')](/\\/g,'/');this[_0xca28('0x9')](_0xca28('0x6'),_0x2b173);}},'rating':{'type':Sequelize[_0xca28('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xca28('0xa')],'set':function(_0x580a55){this[_0xca28('0x9')]('startedAt',moment()[_0xca28('0xb')](_0x580a55,'ms'));this[_0xca28('0x9')](_0xca28('0xc'),moment());this[_0xca28('0x9')](_0xca28('0xd'),_0x580a55);}},'startedAt':{'type':Sequelize[_0xca28('0xe')],'get':function(){return moment(this[_0xca28('0x5')](_0xca28('0xf')))[_0xca28('0x10')](_0xca28('0x11'))[_0xca28('0x12')]();}},'closedAt':{'type':Sequelize[_0xca28('0xe')],'get':function(){return moment(this['getDataValue'](_0xca28('0xc')))['format']('MM-DD-YYYY\x20HH:mm')[_0xca28('0x12')]();}},'createdAt':{'type':Sequelize[_0xca28('0xe')],'get':function(){return moment(this['getDataValue'](_0xca28('0x13')))[_0xca28('0x10')]('MM-DD-YYYY\x20HH:mm')[_0xca28('0x12')]();}},'updatedAt':{'type':Sequelize[_0xca28('0xe')],'get':function(){return moment(this[_0xca28('0x5')](_0xca28('0x14')))['format'](_0xca28('0x11'))['toString']();}}}; \ No newline at end of file +var _0x467f=['INTEGER','startedAt','subtract','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','updatedAt','moment','path','../../config/environment','getDataValue','value','setDataValue'];(function(_0x3a2123,_0x4c26b8){var _0x4304b8=function(_0x553bd1){while(--_0x553bd1){_0x3a2123['push'](_0x3a2123['shift']());}};_0x4304b8(++_0x4c26b8);}(_0x467f,0x7a));var _0xf467=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0x467f[_0x36ed3c];return _0x52a2e0;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xf467('0x0'));var path=require(_0xf467('0x1'));var config=require(_0xf467('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xf467('0x3')](_0xf467('0x4'))?path['extname'](this[_0xf467('0x3')](_0xf467('0x4'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize['STRING'],'set':function(_0xdd0e34){var _0x44eb7f=_0xdd0e34['replace'](/\\/g,'/');this[_0xf467('0x5')](_0xf467('0x4'),_0x44eb7f);}},'rating':{'type':Sequelize[_0xf467('0x6')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x567e56){this[_0xf467('0x5')](_0xf467('0x7'),moment()[_0xf467('0x8')](_0x567e56,'ms'));this[_0xf467('0x5')](_0xf467('0x9'),moment());this[_0xf467('0x5')](_0xf467('0xa'),_0x567e56);}},'startedAt':{'type':Sequelize[_0xf467('0xb')],'get':function(){return moment(this[_0xf467('0x3')](_0xf467('0x7')))[_0xf467('0xc')](_0xf467('0xd'))[_0xf467('0xe')]();}},'closedAt':{'type':Sequelize[_0xf467('0xb')],'get':function(){return moment(this[_0xf467('0x3')](_0xf467('0x9')))[_0xf467('0xc')](_0xf467('0xd'))[_0xf467('0xe')]();}},'createdAt':{'type':Sequelize[_0xf467('0xb')],'get':function(){return moment(this[_0xf467('0x3')]('createdAt'))[_0xf467('0xc')](_0xf467('0xd'))['toString']();}},'updatedAt':{'type':Sequelize[_0xf467('0xb')],'get':function(){return moment(this['getDataValue'](_0xf467('0xf')))[_0xf467('0xc')](_0xf467('0xd'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index ab13b36..54030ac 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 _0x28ee=['then','destroy','end','error','stack','name','send','index','rawAttributes','differenceBy','keys','format','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','ScreenRecording','includeAll','include','findAll','rows','catch','params','options','find','create','body','createdAt','value','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','secrets','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','message','Not\x20found','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update'];(function(_0x43d79c,_0x531a55){var _0x4866b0=function(_0x847a){while(--_0x847a){_0x43d79c['push'](_0x43d79c['shift']());}};_0x4866b0(++_0x531a55);}(_0x28ee,0x9a));var _0xe28e=function(_0x4b9dc9,_0x14b3a2){_0x4b9dc9=_0x4b9dc9-0x0;var _0x57b302=_0x28ee[_0x4b9dc9];return _0x57b302;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe28e('0x0'));var rimraf=require(_0xe28e('0x1'));var zipdir=require(_0xe28e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe28e('0x3'));var moment=require('moment');var BPromise=require(_0xe28e('0x4'));var Mustache=require('mustache');var util=require(_0xe28e('0x5'));var path=require(_0xe28e('0x6'));var sox=require(_0xe28e('0x7'));var csv=require(_0xe28e('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe28e('0x9'));var squel=require(_0xe28e('0xa'));var crypto=require(_0xe28e('0xb'));var jsforce=require(_0xe28e('0xc'));var deskjs=require(_0xe28e('0xd'));var toCsv=require(_0xe28e('0x8'));var querystring=require(_0xe28e('0xe'));var Papa=require(_0xe28e('0xf'));var Redis=require(_0xe28e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe28e('0x11'));var hardwareService=require(_0xe28e('0x12'));var logger=require(_0xe28e('0x13'))('api');var utils=require(_0xe28e('0x14'));var config=require(_0xe28e('0x15'));var db=require(_0xe28e('0x16'))['db'];function respondWithStatusCode(_0x2a4e7b,_0x395bbc){_0x395bbc=_0x395bbc||0xcc;return function(_0x3cbc76){if(_0x3cbc76){return _0x2a4e7b[_0xe28e('0x17')](_0x395bbc);}return _0x2a4e7b[_0xe28e('0x18')](_0x395bbc)['end']();};}function respondWithResult(_0x2a9d9f,_0xed8283){_0xed8283=_0xed8283||0xc8;return function(_0x8ec02b){if(_0x8ec02b){return _0x2a9d9f[_0xe28e('0x18')](_0xed8283)[_0xe28e('0x19')](_0x8ec02b);}};}function respondWithFilteredResult(_0x4453f8,_0x3fadfe){return function(_0xa1230b){if(_0xa1230b){var _0x407723=_0xa1230b[_0xe28e('0x1a')],_0x3e33ad=_0x3fadfe[_0xe28e('0x1b')],_0xdbe4a2=_0x3fadfe[_0xe28e('0x1b')]+_0x3fadfe[_0xe28e('0x1c')],_0x356769;if(_0xdbe4a2>=_0x407723){_0xdbe4a2=_0x407723;_0x356769=0xc8;}else{_0x356769=0xce;}_0x4453f8['status'](_0x356769);return _0x4453f8[_0xe28e('0x1d')](_0xe28e('0x1e'),_0x3e33ad+'-'+_0xdbe4a2+'/'+_0x407723)['json'](_0xa1230b);}return null;};}function patchUpdates(_0x482356){return function(_0xe64a52){try{jsonpatch['apply'](_0xe64a52,_0x482356,!![]);}catch(_0x3611c4){return BPromise[_0xe28e('0x1f')](_0x3611c4);}return _0xe64a52[_0xe28e('0x20')]();};}function saveUpdates(_0x15247a,_0x577cc0){return function(_0x40fc08){if(_0x40fc08){return _0x40fc08[_0xe28e('0x21')](_0x15247a)[_0xe28e('0x22')](function(_0x2114d8){return _0x2114d8;});}return null;};}function removeEntity(_0xa044d,_0x27eceb){return function(_0x5f71f5){if(_0x5f71f5){return _0x5f71f5[_0xe28e('0x23')]()[_0xe28e('0x22')](function(){_0xa044d[_0xe28e('0x18')](0xcc)[_0xe28e('0x24')]();});}};}function handleEntityNotFound(_0x5827db,_0x1dd20e){return function(_0x527328){if(!_0x527328){_0x5827db[_0xe28e('0x17')](0x194);}return _0x527328;};}function handleError(_0x2d7cf6,_0x2e9e2e){_0x2e9e2e=_0x2e9e2e||0x1f4;return function(_0x43e0e8){logger[_0xe28e('0x25')](_0x43e0e8[_0xe28e('0x26')]);if(_0x43e0e8['name']){delete _0x43e0e8[_0xe28e('0x27')];}_0x2d7cf6[_0xe28e('0x18')](_0x2e9e2e)[_0xe28e('0x28')](_0x43e0e8);};}exports[_0xe28e('0x29')]=function(_0x1858c4,_0x5683f5){var _0x1cd1fb={},_0x352c0b={},_0x40a025={'count':0x0,'rows':[]};var _0x5b5864=db['ScreenRecording'][_0xe28e('0x2a')];_0x352c0b['model']=_[_0xe28e('0x2b')](_[_0xe28e('0x2c')](_0x5b5864),[_0xe28e('0x2d')]);_0x352c0b[_0xe28e('0x2e')]=_[_0xe28e('0x2c')](_0x1858c4[_0xe28e('0x2e')]);_0x352c0b[_0xe28e('0x2f')]=_['intersection'](_0x352c0b[_0xe28e('0x30')],_0x352c0b[_0xe28e('0x2e')]);_0x1cd1fb['attributes']=_[_0xe28e('0x31')](_0x352c0b[_0xe28e('0x30')],qs[_0xe28e('0x32')](_0x1858c4[_0xe28e('0x2e')][_0xe28e('0x32')]));_0x1cd1fb[_0xe28e('0x33')]=_0x1cd1fb[_0xe28e('0x33')][_0xe28e('0x34')]?_0x1cd1fb[_0xe28e('0x33')]:_0x352c0b[_0xe28e('0x30')];if(!_0x1858c4['query'][_0xe28e('0x35')]('nolimit')){_0x1cd1fb[_0xe28e('0x1c')]=qs['limit'](_0x1858c4[_0xe28e('0x2e')][_0xe28e('0x1c')]);_0x1cd1fb['offset']=qs[_0xe28e('0x1b')](_0x1858c4[_0xe28e('0x2e')]['offset']);}_0x1cd1fb['order']=qs[_0xe28e('0x36')](_0x1858c4[_0xe28e('0x2e')][_0xe28e('0x36')]);_0x1cd1fb[_0xe28e('0x37')]=qs[_0xe28e('0x2f')](_[_0xe28e('0x38')](_0x1858c4['query'],_0x352c0b['filters']));if(_0x1858c4[_0xe28e('0x2e')][_0xe28e('0x39')]){_0x1cd1fb[_0xe28e('0x37')]=_[_0xe28e('0x3a')](_0x1cd1fb[_0xe28e('0x37')],{'$or':_[_0xe28e('0x3b')](_0x5b5864,function(_0x368e2e){if(_0x368e2e[_0xe28e('0x3c')][_0xe28e('0x3d')]!==_0xe28e('0x3e')){var _0x34cb8d={};_0x34cb8d[_0x368e2e[_0xe28e('0x3f')]]={'$like':'%'+_0x1858c4[_0xe28e('0x2e')]['filter']+'%'};return _0x34cb8d;}})});}_0x1cd1fb=_['merge']({},_0x1cd1fb,_0x1858c4['options']);var _0x2887e6={'where':_0x1cd1fb[_0xe28e('0x37')]};return db[_0xe28e('0x40')]['count'](_0x2887e6)['then'](function(_0x35cf7b){_0x40a025['count']=_0x35cf7b;if(_0x1858c4[_0xe28e('0x2e')][_0xe28e('0x41')]){_0x1cd1fb[_0xe28e('0x42')]=[{'all':!![]}];}return db[_0xe28e('0x40')][_0xe28e('0x43')](_0x1cd1fb);})['then'](function(_0x3c983d){_0x40a025[_0xe28e('0x44')]=_0x3c983d;return _0x40a025;})[_0xe28e('0x22')](respondWithFilteredResult(_0x5683f5,_0x1cd1fb))[_0xe28e('0x45')](handleError(_0x5683f5,null));};exports['show']=function(_0x2f3dc0,_0x187341){var _0x5d7125={'raw':![],'where':{'id':_0x2f3dc0[_0xe28e('0x46')]['id']}},_0x4aeb82={};_0x4aeb82[_0xe28e('0x30')]=_[_0xe28e('0x2c')](db[_0xe28e('0x40')][_0xe28e('0x2a')]);_0x4aeb82[_0xe28e('0x2e')]=_[_0xe28e('0x2c')](_0x2f3dc0[_0xe28e('0x2e')]);_0x4aeb82['filters']=_[_0xe28e('0x31')](_0x4aeb82['model'],_0x4aeb82[_0xe28e('0x2e')]);_0x5d7125[_0xe28e('0x33')]=_[_0xe28e('0x31')](_0x4aeb82[_0xe28e('0x30')],qs[_0xe28e('0x32')](_0x2f3dc0[_0xe28e('0x2e')]['fields']));_0x5d7125['attributes']=_0x5d7125[_0xe28e('0x33')]['length']?_0x5d7125['attributes']:_0x4aeb82[_0xe28e('0x30')];if(_0x2f3dc0['query'][_0xe28e('0x41')]){_0x5d7125[_0xe28e('0x42')]=[{'all':!![]}];}_0x5d7125=_['merge']({},_0x5d7125,_0x2f3dc0[_0xe28e('0x47')]);return db[_0xe28e('0x40')][_0xe28e('0x48')](_0x5d7125)[_0xe28e('0x22')](handleEntityNotFound(_0x187341,null))['then'](respondWithResult(_0x187341,null))[_0xe28e('0x45')](handleError(_0x187341,null));};exports[_0xe28e('0x49')]=function(_0x570087,_0x3adced){return db[_0xe28e('0x40')][_0xe28e('0x49')](_0x570087[_0xe28e('0x4a')],{})[_0xe28e('0x22')](respondWithResult(_0x3adced,0xc9))['catch'](handleError(_0x3adced,null));};exports[_0xe28e('0x21')]=function(_0x17620c,_0x2d6448){if(_0x17620c['body']['id']){delete _0x17620c[_0xe28e('0x4a')]['id'];}delete _0x17620c[_0xe28e('0x4a')]['duration'];delete _0x17620c[_0xe28e('0x4a')][_0xe28e('0x4b')];delete _0x17620c[_0xe28e('0x4a')]['closedAt'];delete _0x17620c[_0xe28e('0x4a')][_0xe28e('0x4c')];return db[_0xe28e('0x40')][_0xe28e('0x48')]({'where':{'id':_0x17620c[_0xe28e('0x46')]['id']}})['then'](handleEntityNotFound(_0x2d6448,null))[_0xe28e('0x22')](saveUpdates(_0x17620c['body'],null))[_0xe28e('0x22')](respondWithResult(_0x2d6448,null))['catch'](handleError(_0x2d6448,null));};exports['destroy']=function(_0x1eb8b3,_0x5ec646){return db['ScreenRecording'][_0xe28e('0x48')]({'where':{'id':_0x1eb8b3[_0xe28e('0x46')]['id']}})['then'](handleEntityNotFound(_0x5ec646,null))[_0xe28e('0x22')](removeEntity(_0x5ec646,null))[_0xe28e('0x45')](handleError(_0x5ec646,null));};exports['describe']=function(_0xc306eb,_0x530e59){return db['ScreenRecording']['describe']()[_0xe28e('0x22')](respondWithResult(_0x530e59,null))[_0xe28e('0x45')](handleError(_0x530e59,null));};exports[_0xe28e('0x4d')]=function(_0x240220,_0x441930,_0x41eab9){var _0x170da7=require(_0xe28e('0x4e'));var _0x2137c2=![];var _0xac72b1={};if(_0x240220[_0xe28e('0x2e')][_0xe28e('0x3c')]&&_0x240220['query']['type']===_0xe28e('0x4f')){_0xac72b1[_0xe28e('0x4f')]=_0x240220[_0xe28e('0x46')]['id'];}else{_0xac72b1['id']=_0x240220[_0xe28e('0x46')]['id'];}return db[_0xe28e('0x40')]['find']({'where':_0xac72b1,'attributes':['id',_0xe28e('0x4c')],'raw':!![]})[_0xe28e('0x22')](handleEntityNotFound(_0x441930,null))[_0xe28e('0x22')](function(_0x54f136){if(_0x54f136){var _0x1d3e9c=path[_0xe28e('0x50')](config[_0xe28e('0x51')],_0xe28e('0x52'),_0x54f136['value']);var _0x16bfd8=util[_0xe28e('0x2d')](_0xe28e('0x53'),_0x1d3e9c);if(fs[_0xe28e('0x54')](_0x16bfd8)){_0x2137c2=!![];return _0x170da7['decryptFile'](_0x16bfd8,_0x1d3e9c,config[_0xe28e('0x55')][_0xe28e('0x56')])[_0xe28e('0x22')](function(){return _0x54f136;});}return _0x54f136;}})[_0xe28e('0x22')](function(_0x23de7e){if(_0x23de7e){var _0x341bd7=path[_0xe28e('0x50')](config[_0xe28e('0x51')],_0xe28e('0x52'),_0x23de7e['value']);if(!fs[_0xe28e('0x54')](_0x341bd7)){throw new db[(_0xe28e('0x57'))][(_0xe28e('0x58'))](_0xe28e('0x59'));}if(_0x23de7e['filename']){return _0x441930[_0xe28e('0x4d')](_0x341bd7,_0x23de7e[_0xe28e('0x5a')]+path[_0xe28e('0x5b')](_0x341bd7),function(){if(_0x2137c2){fs['unlink'](_0x341bd7);}});}else{return _0x441930['download'](_0x341bd7,function(_0x5d11f4){if(_0x2137c2){fs['unlink'](_0x341bd7);}});}}})[_0xe28e('0x45')](function(_0x356718){if(_0x356718[_0xe28e('0x5c')]===_0xe28e('0x59')){_0x441930[_0xe28e('0x18')](0x194)[_0xe28e('0x28')](_0xe28e('0x5d'));}else{return handleError(_0x441930,null);}});}; \ No newline at end of file +var _0xe571=['../../components/encryptor','uniqueid','value','join','root','server/files/screen_recordings','%s.cypher','secrets','recording','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','squel','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','differenceBy','format','keys','filters','intersection','model','attributes','fields','query','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','key','field','options','ScreenRecording','includeAll','findAll','rows','catch','show','params','include','create','body','duration','createdAt','find','describe','download'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe571,0xcd));var _0x1e57=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe571[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1e57('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1e57('0x1'));var rp=require(_0x1e57('0x2'));var moment=require('moment');var BPromise=require(_0x1e57('0x3'));var Mustache=require(_0x1e57('0x4'));var util=require(_0x1e57('0x5'));var path=require(_0x1e57('0x6'));var sox=require('sox');var csv=require(_0x1e57('0x7'));var ejs=require(_0x1e57('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1e57('0x9'));var crypto=require('crypto');var jsforce=require(_0x1e57('0xa'));var deskjs=require(_0x1e57('0xb'));var toCsv=require(_0x1e57('0x7'));var querystring=require('querystring');var Papa=require(_0x1e57('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1e57('0xd'));var hardwareService=require(_0x1e57('0xe'));var logger=require(_0x1e57('0xf'))('api');var utils=require(_0x1e57('0x10'));var config=require(_0x1e57('0x11'));var db=require(_0x1e57('0x12'))['db'];function respondWithStatusCode(_0x201b4a,_0x30b616){_0x30b616=_0x30b616||0xcc;return function(_0x122a8a){if(_0x122a8a){return _0x201b4a[_0x1e57('0x13')](_0x30b616);}return _0x201b4a['status'](_0x30b616)[_0x1e57('0x14')]();};}function respondWithResult(_0x29a557,_0x13442b){_0x13442b=_0x13442b||0xc8;return function(_0x179685){if(_0x179685){return _0x29a557[_0x1e57('0x15')](_0x13442b)[_0x1e57('0x16')](_0x179685);}};}function respondWithFilteredResult(_0x5e4a77,_0x3a9b8e){return function(_0x245bda){if(_0x245bda){var _0x18da8e=_0x245bda[_0x1e57('0x17')],_0x1870c6=_0x3a9b8e[_0x1e57('0x18')],_0x11bb1c=_0x3a9b8e[_0x1e57('0x18')]+_0x3a9b8e[_0x1e57('0x19')],_0x3a1d99;if(_0x11bb1c>=_0x18da8e){_0x11bb1c=_0x18da8e;_0x3a1d99=0xc8;}else{_0x3a1d99=0xce;}_0x5e4a77[_0x1e57('0x15')](_0x3a1d99);return _0x5e4a77[_0x1e57('0x1a')](_0x1e57('0x1b'),_0x1870c6+'-'+_0x11bb1c+'/'+_0x18da8e)[_0x1e57('0x16')](_0x245bda);}return null;};}function patchUpdates(_0x138c4a){return function(_0x12115c){try{jsonpatch[_0x1e57('0x1c')](_0x12115c,_0x138c4a,!![]);}catch(_0xdd9b31){return BPromise[_0x1e57('0x1d')](_0xdd9b31);}return _0x12115c[_0x1e57('0x1e')]();};}function saveUpdates(_0x7fb13d,_0x3b359f){return function(_0x204b1d){if(_0x204b1d){return _0x204b1d[_0x1e57('0x1f')](_0x7fb13d)[_0x1e57('0x20')](function(_0x247bea){return _0x247bea;});}return null;};}function removeEntity(_0x1d6406,_0x582255){return function(_0x39cfe6){if(_0x39cfe6){return _0x39cfe6[_0x1e57('0x21')]()[_0x1e57('0x20')](function(){_0x1d6406[_0x1e57('0x15')](0xcc)[_0x1e57('0x14')]();});}};}function handleEntityNotFound(_0x1b04a3,_0x18e2a2){return function(_0x51ce56){if(!_0x51ce56){_0x1b04a3[_0x1e57('0x13')](0x194);}return _0x51ce56;};}function handleError(_0x879300,_0x562b80){_0x562b80=_0x562b80||0x1f4;return function(_0x17a0d1){logger[_0x1e57('0x22')](_0x17a0d1[_0x1e57('0x23')]);if(_0x17a0d1[_0x1e57('0x24')]){delete _0x17a0d1[_0x1e57('0x24')];}_0x879300[_0x1e57('0x15')](_0x562b80)[_0x1e57('0x25')](_0x17a0d1);};}exports[_0x1e57('0x26')]=function(_0x21e666,_0xb9836a){var _0x541168={},_0x1f3d83={},_0x4f3f7b={'count':0x0,'rows':[]};var _0x27460c=db['ScreenRecording'][_0x1e57('0x27')];_0x1f3d83['model']=_[_0x1e57('0x28')](_['keys'](_0x27460c),[_0x1e57('0x29')]);_0x1f3d83['query']=_[_0x1e57('0x2a')](_0x21e666['query']);_0x1f3d83[_0x1e57('0x2b')]=_[_0x1e57('0x2c')](_0x1f3d83[_0x1e57('0x2d')],_0x1f3d83['query']);_0x541168[_0x1e57('0x2e')]=_[_0x1e57('0x2c')](_0x1f3d83[_0x1e57('0x2d')],qs[_0x1e57('0x2f')](_0x21e666[_0x1e57('0x30')][_0x1e57('0x2f')]));_0x541168['attributes']=_0x541168['attributes'][_0x1e57('0x31')]?_0x541168[_0x1e57('0x2e')]:_0x1f3d83[_0x1e57('0x2d')];if(!_0x21e666[_0x1e57('0x30')][_0x1e57('0x32')](_0x1e57('0x33'))){_0x541168[_0x1e57('0x19')]=qs[_0x1e57('0x19')](_0x21e666[_0x1e57('0x30')]['limit']);_0x541168[_0x1e57('0x18')]=qs[_0x1e57('0x18')](_0x21e666['query']['offset']);}_0x541168['order']=qs['sort'](_0x21e666[_0x1e57('0x30')][_0x1e57('0x34')]);_0x541168[_0x1e57('0x35')]=qs[_0x1e57('0x2b')](_[_0x1e57('0x36')](_0x21e666['query'],_0x1f3d83[_0x1e57('0x2b')]));if(_0x21e666[_0x1e57('0x30')][_0x1e57('0x37')]){_0x541168['where']=_[_0x1e57('0x38')](_0x541168[_0x1e57('0x35')],{'$or':_[_0x1e57('0x39')](_0x27460c,function(_0x5915e7){if(_0x5915e7[_0x1e57('0x3a')][_0x1e57('0x3b')]!=='VIRTUAL'){var _0x247dbe={};_0x247dbe[_0x5915e7[_0x1e57('0x3c')]]={'$like':'%'+_0x21e666[_0x1e57('0x30')][_0x1e57('0x37')]+'%'};return _0x247dbe;}})});}_0x541168=_['merge']({},_0x541168,_0x21e666[_0x1e57('0x3d')]);var _0x63e4c9={'where':_0x541168[_0x1e57('0x35')]};return db[_0x1e57('0x3e')][_0x1e57('0x17')](_0x63e4c9)[_0x1e57('0x20')](function(_0x124928){_0x4f3f7b[_0x1e57('0x17')]=_0x124928;if(_0x21e666[_0x1e57('0x30')][_0x1e57('0x3f')]){_0x541168['include']=[{'all':!![]}];}return db[_0x1e57('0x3e')][_0x1e57('0x40')](_0x541168);})['then'](function(_0x520912){_0x4f3f7b[_0x1e57('0x41')]=_0x520912;return _0x4f3f7b;})[_0x1e57('0x20')](respondWithFilteredResult(_0xb9836a,_0x541168))[_0x1e57('0x42')](handleError(_0xb9836a,null));};exports[_0x1e57('0x43')]=function(_0x12ead9,_0x5939a3){var _0x139ccb={'raw':![],'where':{'id':_0x12ead9[_0x1e57('0x44')]['id']}},_0x410ee1={};_0x410ee1['model']=_[_0x1e57('0x2a')](db[_0x1e57('0x3e')]['rawAttributes']);_0x410ee1['query']=_[_0x1e57('0x2a')](_0x12ead9['query']);_0x410ee1[_0x1e57('0x2b')]=_['intersection'](_0x410ee1['model'],_0x410ee1[_0x1e57('0x30')]);_0x139ccb[_0x1e57('0x2e')]=_['intersection'](_0x410ee1[_0x1e57('0x2d')],qs[_0x1e57('0x2f')](_0x12ead9[_0x1e57('0x30')][_0x1e57('0x2f')]));_0x139ccb[_0x1e57('0x2e')]=_0x139ccb[_0x1e57('0x2e')][_0x1e57('0x31')]?_0x139ccb[_0x1e57('0x2e')]:_0x410ee1[_0x1e57('0x2d')];if(_0x12ead9['query']['includeAll']){_0x139ccb[_0x1e57('0x45')]=[{'all':!![]}];}_0x139ccb=_[_0x1e57('0x38')]({},_0x139ccb,_0x12ead9['options']);return db[_0x1e57('0x3e')]['find'](_0x139ccb)[_0x1e57('0x20')](handleEntityNotFound(_0x5939a3,null))['then'](respondWithResult(_0x5939a3,null))[_0x1e57('0x42')](handleError(_0x5939a3,null));};exports[_0x1e57('0x46')]=function(_0x179b9a,_0x2cce9b){return db[_0x1e57('0x3e')][_0x1e57('0x46')](_0x179b9a['body'],{})[_0x1e57('0x20')](respondWithResult(_0x2cce9b,0xc9))[_0x1e57('0x42')](handleError(_0x2cce9b,null));};exports[_0x1e57('0x1f')]=function(_0x5eb42d,_0x53861f){if(_0x5eb42d[_0x1e57('0x47')]['id']){delete _0x5eb42d[_0x1e57('0x47')]['id'];}delete _0x5eb42d[_0x1e57('0x47')][_0x1e57('0x48')];delete _0x5eb42d[_0x1e57('0x47')][_0x1e57('0x49')];delete _0x5eb42d[_0x1e57('0x47')]['closedAt'];delete _0x5eb42d[_0x1e57('0x47')]['value'];return db[_0x1e57('0x3e')][_0x1e57('0x4a')]({'where':{'id':_0x5eb42d[_0x1e57('0x44')]['id']}})[_0x1e57('0x20')](handleEntityNotFound(_0x53861f,null))[_0x1e57('0x20')](saveUpdates(_0x5eb42d['body'],null))[_0x1e57('0x20')](respondWithResult(_0x53861f,null))[_0x1e57('0x42')](handleError(_0x53861f,null));};exports['destroy']=function(_0x17b0e9,_0x5e8e37){return db[_0x1e57('0x3e')][_0x1e57('0x4a')]({'where':{'id':_0x17b0e9[_0x1e57('0x44')]['id']}})['then'](handleEntityNotFound(_0x5e8e37,null))[_0x1e57('0x20')](removeEntity(_0x5e8e37,null))[_0x1e57('0x42')](handleError(_0x5e8e37,null));};exports['describe']=function(_0x2d7171,_0x127898){return db[_0x1e57('0x3e')][_0x1e57('0x4b')]()[_0x1e57('0x20')](respondWithResult(_0x127898,null))['catch'](handleError(_0x127898,null));};exports[_0x1e57('0x4c')]=function(_0x574980,_0x58b16c,_0x3760c5){var _0x9197cd=require(_0x1e57('0x4d'));var _0x46985a=![];var _0x29826d={};if(_0x574980[_0x1e57('0x30')][_0x1e57('0x3a')]&&_0x574980[_0x1e57('0x30')][_0x1e57('0x3a')]===_0x1e57('0x4e')){_0x29826d[_0x1e57('0x4e')]=_0x574980[_0x1e57('0x44')]['id'];}else{_0x29826d['id']=_0x574980['params']['id'];}return db[_0x1e57('0x3e')][_0x1e57('0x4a')]({'where':_0x29826d,'attributes':['id',_0x1e57('0x4f')],'raw':!![]})[_0x1e57('0x20')](handleEntityNotFound(_0x58b16c,null))[_0x1e57('0x20')](function(_0x271079){if(_0x271079){var _0x1cfbb6=path[_0x1e57('0x50')](config[_0x1e57('0x51')],_0x1e57('0x52'),_0x271079[_0x1e57('0x4f')]);var _0x34e86a=util[_0x1e57('0x29')](_0x1e57('0x53'),_0x1cfbb6);if(fs['existsSync'](_0x34e86a)){_0x46985a=!![];return _0x9197cd['decryptFile'](_0x34e86a,_0x1cfbb6,config[_0x1e57('0x54')][_0x1e57('0x55')])['then'](function(){return _0x271079;});}return _0x271079;}})[_0x1e57('0x20')](function(_0x526217){if(_0x526217){var _0x2cfd73=path['join'](config['root'],_0x1e57('0x52'),_0x526217[_0x1e57('0x4f')]);if(!fs[_0x1e57('0x56')](_0x2cfd73)){throw new db[(_0x1e57('0x57'))][(_0x1e57('0x58'))](_0x1e57('0x59'));}if(_0x526217[_0x1e57('0x5a')]){return _0x58b16c['download'](_0x2cfd73,_0x526217[_0x1e57('0x5a')]+path[_0x1e57('0x5b')](_0x2cfd73),function(){if(_0x46985a){fs[_0x1e57('0x5c')](_0x2cfd73);}});}else{return _0x58b16c[_0x1e57('0x4c')](_0x2cfd73,function(_0x31c47a){if(_0x46985a){fs[_0x1e57('0x5c')](_0x2cfd73);}});}}})[_0x1e57('0x42')](function(_0xcd77e6){if(_0xcd77e6[_0x1e57('0x5d')]==='ScreenRecording\x20not\x20found'){_0x58b16c[_0x1e57('0x15')](0x194)[_0x1e57('0x25')]('Not\x20found');}else{return handleError(_0x58b16c,null);}});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 3b61704..1aae748 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 _0x3cdd=['screen_recordings','interactionid','isNil','value','join','root','server','files','existsSync','catch','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','ScreenRecording'];(function(_0x56de9d,_0x413b89){var _0x5b63fd=function(_0x2a5d13){while(--_0x2a5d13){_0x56de9d['push'](_0x56de9d['shift']());}};_0x5b63fd(++_0x413b89);}(_0x3cdd,0xb5));var _0xd3cd=function(_0x2bcded,_0x5cfb42){_0x2bcded=_0x2bcded-0x0;var _0x2bedd4=_0x3cdd[_0x2bcded];return _0x2bedd4;};'use strict';var _=require(_0xd3cd('0x0'));var util=require(_0xd3cd('0x1'));var logger=require(_0xd3cd('0x2'))(_0xd3cd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd3cd('0x4'));var fs=require('fs');var path=require(_0xd3cd('0x5'));var rimraf=require(_0xd3cd('0x6'));var config=require(_0xd3cd('0x7'));var attributes=require('./screenRecording.attributes');module['exports']=function(_0x13478f,_0x237e4b){return _0x13478f['define'](_0xd3cd('0x8'),attributes,{'tableName':_0xd3cd('0x9'),'paranoid':![],'indexes':[{'name':_0xd3cd('0xa'),'fields':[_0xd3cd('0xa')]}],'timestamps':!![],'hooks':{'afterDestroy':function(_0x2a9791,_0x301d0e,_0x14546c){return new BPromise(function(_0x40f06c,_0x66bd9d){if(!_[_0xd3cd('0xb')](_0x2a9791[_0xd3cd('0xc')])){var _0x1713cb=path[_0xd3cd('0xd')](config[_0xd3cd('0xe')],_0xd3cd('0xf'),_0xd3cd('0x10'),_0xd3cd('0x9'),_0x2a9791[_0xd3cd('0xc')]);if(fs[_0xd3cd('0x11')](_0x1713cb)){rimraf(_0x1713cb,function(_0x1580b9){if(_0x1580b9){console['log'](_0x1580b9);}});}}_0x40f06c();})[_0xd3cd('0x12')](function(_0x336b2f){BPromise['resolve']();})['finally'](function(){_0x14546c();});}}});}; \ No newline at end of file +var _0xd2d8=['finally','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','./screenRecording.attributes','exports','define','screen_recordings','interactionid','isNil','root','server','files','value','catch'];(function(_0x2fef62,_0x3a513d){var _0xd37f65=function(_0x345b16){while(--_0x345b16){_0x2fef62['push'](_0x2fef62['shift']());}};_0xd37f65(++_0x3a513d);}(_0xd2d8,0x1b6));var _0x8d2d=function(_0x12aba8,_0x40a036){_0x12aba8=_0x12aba8-0x0;var _0x2aac66=_0xd2d8[_0x12aba8];return _0x2aac66;};'use strict';var _=require(_0x8d2d('0x0'));var util=require(_0x8d2d('0x1'));var logger=require(_0x8d2d('0x2'))(_0x8d2d('0x3'));var moment=require('moment');var BPromise=require(_0x8d2d('0x4'));var rp=require(_0x8d2d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8d2d('0x6'));var config=require('../../config/environment');var attributes=require(_0x8d2d('0x7'));module[_0x8d2d('0x8')]=function(_0x489305,_0x42ab82){return _0x489305[_0x8d2d('0x9')]('ScreenRecording',attributes,{'tableName':_0x8d2d('0xa'),'paranoid':![],'indexes':[{'name':_0x8d2d('0xb'),'fields':[_0x8d2d('0xb')]}],'timestamps':!![],'hooks':{'afterDestroy':function(_0x41c4b3,_0x2a7854,_0xbe2ef6){return new BPromise(function(_0x41b7ff,_0x48edda){if(!_[_0x8d2d('0xc')](_0x41c4b3['value'])){var _0x5c12ec=path['join'](config[_0x8d2d('0xd')],_0x8d2d('0xe'),_0x8d2d('0xf'),_0x8d2d('0xa'),_0x41c4b3[_0x8d2d('0x10')]);if(fs['existsSync'](_0x5c12ec)){rimraf(_0x5c12ec,function(_0x4fdd16){if(_0x4fdd16){console['log'](_0x4fdd16);}});}}_0x41b7ff();})[_0x8d2d('0x11')](function(_0x41c9fa){BPromise['resolve']();})[_0x8d2d('0x12')](function(){_0xbe2ef6();});}}});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 135445c..38ab7e8 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 _0x303a=['ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','ScreenRecording,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0x303a,0x1a0));var _0xa303=function(_0x4de003,_0x1677e9){_0x4de003=_0x4de003-0x0;var _0x2875b9=_0x303a[_0x4de003];return _0x2875b9;};'use strict';var _=require(_0xa303('0x0'));var util=require('util');var moment=require(_0xa303('0x1'));var BPromise=require(_0xa303('0x2'));var rs=require(_0xa303('0x3'));var fs=require('fs');var Redis=require(_0xa303('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa303('0x5'));var logger=require(_0xa303('0x6'))(_0xa303('0x7'));var config=require(_0xa303('0x8'));var jayson=require(_0xa303('0x9'));var client=jayson[_0xa303('0xa')][_0xa303('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f61f1,_0x69b173,_0x5d95fd){return new BPromise(function(_0x51e1ee,_0x488c85){return client[_0xa303('0xc')](_0x3f61f1,_0x5d95fd)[_0xa303('0xd')](function(_0x5e2e48){logger[_0xa303('0xe')]('ScreenRecording,\x20%s,\x20%s',_0x69b173,_0xa303('0xf'));logger['debug'](_0xa303('0x10'),_0x69b173,_0xa303('0xf'),JSON[_0xa303('0x11')](_0x5e2e48));if(_0x5e2e48[_0xa303('0x12')]){if(_0x5e2e48['error'][_0xa303('0x13')]===0x1f4){logger['error'](_0xa303('0x14'),_0x69b173,_0x5e2e48[_0xa303('0x12')][_0xa303('0x15')]);return _0x488c85(_0x5e2e48['error'][_0xa303('0x15')]);}logger[_0xa303('0x12')](_0xa303('0x14'),_0x69b173,_0x5e2e48[_0xa303('0x12')][_0xa303('0x15')]);return _0x51e1ee(_0x5e2e48[_0xa303('0x12')][_0xa303('0x15')]);}else{logger[_0xa303('0xe')]('ScreenRecording,\x20%s,\x20%s',_0x69b173,_0xa303('0xf'));_0x51e1ee(_0x5e2e48[_0xa303('0x16')][_0xa303('0x15')]);}})[_0xa303('0x17')](function(_0x3e2813){logger[_0xa303('0x12')]('ScreenRecording,\x20%s,\x20%s',_0x69b173,_0x3e2813);_0x488c85(_0x3e2813);});});} \ No newline at end of file +var _0x5292=['lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','request','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x226ef2,_0x47ee35){var _0x52c473=function(_0x211c7d){while(--_0x211c7d){_0x226ef2['push'](_0x226ef2['shift']());}};_0x52c473(++_0x47ee35);}(_0x5292,0xf7));var _0x2529=function(_0xb8acf0,_0x10998d){_0xb8acf0=_0xb8acf0-0x0;var _0xf96b2f=_0x5292[_0xb8acf0];return _0xf96b2f;};'use strict';var _=require(_0x2529('0x0'));var util=require(_0x2529('0x1'));var moment=require('moment');var BPromise=require(_0x2529('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2529('0x3'));var db=require(_0x2529('0x4'))['db'];var utils=require(_0x2529('0x5'));var logger=require(_0x2529('0x6'))('rpc');var config=require(_0x2529('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x407277,_0x43cbef,_0x5bb8a1){return new BPromise(function(_0x5c3355,_0x395ba9){return client[_0x2529('0x8')](_0x407277,_0x5bb8a1)['then'](function(_0xa234ac){logger[_0x2529('0x9')](_0x2529('0xa'),_0x43cbef,_0x2529('0xb'));logger[_0x2529('0xc')](_0x2529('0xd'),_0x43cbef,_0x2529('0xb'),JSON[_0x2529('0xe')](_0xa234ac));if(_0xa234ac['error']){if(_0xa234ac[_0x2529('0xf')][_0x2529('0x10')]===0x1f4){logger['error'](_0x2529('0xa'),_0x43cbef,_0xa234ac[_0x2529('0xf')][_0x2529('0x11')]);return _0x395ba9(_0xa234ac[_0x2529('0xf')][_0x2529('0x11')]);}logger[_0x2529('0xf')](_0x2529('0xa'),_0x43cbef,_0xa234ac['error'][_0x2529('0x11')]);return _0x5c3355(_0xa234ac[_0x2529('0xf')][_0x2529('0x11')]);}else{logger[_0x2529('0x9')](_0x2529('0xa'),_0x43cbef,_0x2529('0xb'));_0x5c3355(_0xa234ac[_0x2529('0x12')][_0x2529('0x11')]);}})['catch'](function(_0x163bf4){logger['error'](_0x2529('0xa'),_0x43cbef,_0x163bf4);_0x395ba9(_0x163bf4);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 97d32dd..f546167 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 _0x6952=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','gdpr','/:id/preferred','diskStorage','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','post','single','addLogo','join','logologin','addLogoLogin','preferred','file','addPreferred','put','/:id','exports','multer','util','path','connect-timeout','express'];(function(_0x235c71,_0x3a8b28){var _0xc51cb=function(_0x416188){while(--_0x416188){_0x235c71['push'](_0x235c71['shift']());}};_0xc51cb(++_0x3a8b28);}(_0x6952,0xbe));var _0x2695=function(_0x392f32,_0x3afe35){_0x392f32=_0x392f32-0x0;var _0x47226b=_0x6952[_0x392f32];return _0x47226b;};'use strict';var multer=require(_0x2695('0x0'));var util=require(_0x2695('0x1'));var path=require(_0x2695('0x2'));var timeout=require(_0x2695('0x3'));var express=require(_0x2695('0x4'));var router=express[_0x2695('0x5')]();var auth=require(_0x2695('0x6'));var interaction=require(_0x2695('0x7'));var config=require(_0x2695('0x8'));var controller=require(_0x2695('0x9'));router[_0x2695('0xa')]('/',auth[_0x2695('0xb')](),controller['index']);router[_0x2695('0xa')]('/:id',controller[_0x2695('0xc')]);router[_0x2695('0xa')](_0x2695('0xd'),controller[_0x2695('0xe')]);router[_0x2695('0xa')](_0x2695('0xf'),controller[_0x2695('0x10')]);router[_0x2695('0xa')]('/:id/gdpr',controller[_0x2695('0x11')]);router[_0x2695('0xa')](_0x2695('0x12'),controller['getPreferred']);var upload=multer({'storage':multer[_0x2695('0x13')]({'destination':function(_0x3f5d3b,_0x2215aa,_0x3c4919){_0x3c4919(null,path['join'](config[_0x2695('0x14')],_0x2695('0x15')));},'filename':function(_0x14f9e5,_0x59fc7d,_0x3409a2){_0x3409a2(null,util[_0x2695('0x16')](_0x2695('0x17'),_0x2695('0x18'),path[_0x2695('0x19')](_0x59fc7d[_0x2695('0x1a')])));}})});router[_0x2695('0x1b')](_0x2695('0xd'),upload[_0x2695('0x1c')]('file'),controller[_0x2695('0x1d')]);var upload=multer({'storage':multer[_0x2695('0x13')]({'destination':function(_0x21c10d,_0x3b048f,_0x35362d){_0x35362d(null,path[_0x2695('0x1e')](config[_0x2695('0x14')],_0x2695('0x15')));},'filename':function(_0x371c7e,_0x5a82b5,_0x4d9496){_0x4d9496(null,util[_0x2695('0x16')]('%s%s',_0x2695('0x1f'),path['extname'](_0x5a82b5['originalname'])));}})});router[_0x2695('0x1b')]('/:id/logo_login',upload[_0x2695('0x1c')]('file'),controller[_0x2695('0x20')]);var upload=multer({'storage':multer[_0x2695('0x13')]({'destination':function(_0x2fcae7,_0x36f00d,_0x2a0428){_0x2a0428(null,path['join'](config[_0x2695('0x14')],_0x2695('0x15')));},'filename':function(_0x2e93b8,_0x1b288a,_0x3335c9){_0x3335c9(null,util[_0x2695('0x16')]('%s%s',_0x2695('0x21'),path[_0x2695('0x19')](_0x1b288a[_0x2695('0x1a')])));}})});router[_0x2695('0x1b')](_0x2695('0x12'),upload['single'](_0x2695('0x22')),controller[_0x2695('0x23')]);router[_0x2695('0x24')](_0x2695('0x25'),auth[_0x2695('0xb')](),controller['update']);module[_0x2695('0x26')]=router; \ No newline at end of file +var _0x8025=['originalname','addLogoLogin','preferred','addPreferred','put','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','/:id/logo','getLogo','/:id/logo_login','/:id/gdpr','/:id/preferred','getPreferred','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','extname','post','single','file','logologin'];(function(_0x1a131e,_0x522eae){var _0x408971=function(_0x4fdcad){while(--_0x4fdcad){_0x1a131e['push'](_0x1a131e['shift']());}};_0x408971(++_0x522eae);}(_0x8025,0x6b));var _0x5802=function(_0xcbcd4c,_0x5c31f2){_0xcbcd4c=_0xcbcd4c-0x0;var _0x43b9b7=_0x8025[_0xcbcd4c];return _0x43b9b7;};'use strict';var multer=require(_0x5802('0x0'));var util=require(_0x5802('0x1'));var path=require(_0x5802('0x2'));var timeout=require('connect-timeout');var express=require(_0x5802('0x3'));var router=express[_0x5802('0x4')]();var auth=require(_0x5802('0x5'));var interaction=require(_0x5802('0x6'));var config=require(_0x5802('0x7'));var controller=require(_0x5802('0x8'));router[_0x5802('0x9')]('/',auth[_0x5802('0xa')](),controller['index']);router[_0x5802('0x9')]('/:id',controller['show']);router[_0x5802('0x9')](_0x5802('0xb'),controller[_0x5802('0xc')]);router['get'](_0x5802('0xd'),controller['getLogoLogin']);router[_0x5802('0x9')](_0x5802('0xe'),controller['gdpr']);router[_0x5802('0x9')](_0x5802('0xf'),controller[_0x5802('0x10')]);var upload=multer({'storage':multer[_0x5802('0x11')]({'destination':function(_0x346230,_0x27e8be,_0x2378be){_0x2378be(null,path[_0x5802('0x12')](config[_0x5802('0x13')],_0x5802('0x14')));},'filename':function(_0x315835,_0x282a48,_0x4281d0){_0x4281d0(null,util[_0x5802('0x15')](_0x5802('0x16'),_0x5802('0x17'),path[_0x5802('0x18')](_0x282a48['originalname'])));}})});router[_0x5802('0x19')](_0x5802('0xb'),upload[_0x5802('0x1a')](_0x5802('0x1b')),controller['addLogo']);var upload=multer({'storage':multer[_0x5802('0x11')]({'destination':function(_0x520a2a,_0x55948a,_0x4fa350){_0x4fa350(null,path[_0x5802('0x12')](config[_0x5802('0x13')],_0x5802('0x14')));},'filename':function(_0x1cccbe,_0x74c3b1,_0x1310b8){_0x1310b8(null,util[_0x5802('0x15')](_0x5802('0x16'),_0x5802('0x1c'),path[_0x5802('0x18')](_0x74c3b1[_0x5802('0x1d')])));}})});router['post'](_0x5802('0xd'),upload[_0x5802('0x1a')](_0x5802('0x1b')),controller[_0x5802('0x1e')]);var upload=multer({'storage':multer[_0x5802('0x11')]({'destination':function(_0x9f69f9,_0xf48f36,_0x4174e0){_0x4174e0(null,path[_0x5802('0x12')](config['root'],_0x5802('0x14')));},'filename':function(_0x2daadd,_0x5560ef,_0x26e62a){_0x26e62a(null,util[_0x5802('0x15')](_0x5802('0x16'),_0x5802('0x1f'),path['extname'](_0x5560ef['originalname'])));}})});router[_0x5802('0x19')]('/:id/preferred',upload[_0x5802('0x1a')]('file'),controller[_0x5802('0x20')]);router[_0x5802('0x21')]('/:id',auth[_0x5802('0xa')](),controller['update']);module['exports']=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 0e3b096..832c3ab 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 _0xe87e=['BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','sequelize','exports','INTEGER','min_internal','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x4366c2,_0x182e42){var _0x2c9ead=function(_0x5ca55c){while(--_0x5ca55c){_0x4366c2['push'](_0x4366c2['shift']());}};_0x2c9ead(++_0x182e42);}(_0xe87e,0x17d));var _0xee87=function(_0x265aa2,_0x220072){_0x265aa2=_0x265aa2-0x0;var _0x447a3a=_0xe87e[_0x265aa2];return _0x447a3a;};'use strict';var Sequelize=require(_0xee87('0x0'));module[_0xee87('0x1')]={'min_internal':{'type':Sequelize[_0xee87('0x2')](0xb),'unique':_0xee87('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xee87('0x2')](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xee87('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xee87('0x4')],'defaultValue':_0xee87('0x5')},'logo':{'type':Sequelize[_0xee87('0x4')]},'defaultLogo':{'type':Sequelize[_0xee87('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xee87('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0xee87('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xee87('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xee87('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xee87('0x4')]},'turnaddr':{'type':Sequelize[_0xee87('0x4')]},'turnusername':{'type':Sequelize[_0xee87('0x4')]},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0xee87('0x4')]},'defaultPageTitle':{'type':Sequelize[_0xee87('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xee87('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0xee87('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xee87('0x4')],'defaultValue':_0xee87('0x7')},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize[_0xee87('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xee87('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xee87('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xee87('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xee87('0x4')],'defaultValue':_0xee87('0x8')},'chatTimeout':{'type':Sequelize[_0xee87('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xee87('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0xee87('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xee87('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xee87('0x2')],'defaultValue':0xa}}; \ No newline at end of file +var _0x13f6=['/var/opt/motion2/server/files/sounds/converted','STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','sequelize','exports','INTEGER','min_mailbox'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x13f6,0x124));var _0x613f=function(_0x3c081d,_0x594987){_0x3c081d=_0x3c081d-0x0;var _0x503162=_0x13f6[_0x3c081d];return _0x503162;};'use strict';var Sequelize=require(_0x613f('0x0'));module[_0x613f('0x1')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x613f('0x2')](0xb),'unique':_0x613f('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x613f('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':_0x613f('0x4')},'logo':{'type':Sequelize[_0x613f('0x5')]},'defaultLogo':{'type':Sequelize[_0x613f('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize[_0x613f('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x613f('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x613f('0x5')]},'turnusername':{'type':Sequelize[_0x613f('0x5')]},'turnpassword':{'type':Sequelize[_0x613f('0x5')]},'pageTitle':{'type':Sequelize[_0x613f('0x5')]},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x613f('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x613f('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x613f('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0x613f('0x7')},'enableEmailPreview':{'type':Sequelize[_0x613f('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x613f('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x613f('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x613f('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x613f('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x613f('0x5')]},'defaultPreferred':{'type':Sequelize[_0x613f('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x613f('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x613f('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0x613f('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x613f('0x2')],'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 3b0c666..216aed3 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 _0xfd3d=['utf8','render','root','server/files/templates/turn.ejs','/etc/asterisk/stun_xcally.conf','writeFileSync','/etc/asterisk/turn_xcally.conf','Reload','res_stun_monitor.so','res_rtp_asterisk.so','addLogo','file','addLogoLogin','loginLogo','filename','../../config/license/util','server/files/images/logos','getLicense','logo','preferred','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','toLower','default','custom','default_logo.png','ValidationError','Logo\x20not\x20found','download','getLogoLogin','default_loginLogo.png','Sequelize','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','upperFirst','eml-format','rimraf','zip-dir','request-promise','moment','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/environment','../../mysqldb','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','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','end','stack','name','index','Setting','rawAttributes','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','limit','sort','pick','filters','filter','merge','where','map','VIRTUAL','options','includeAll','findAll','rows','params','length','include','find','body','get','readFileSync','join','server/files/templates/stun.ejs'];(function(_0x4ce80d,_0x175948){var _0x48c116=function(_0x564dbe){while(--_0x564dbe){_0x4ce80d['push'](_0x4ce80d['shift']());}};_0x48c116(++_0x175948);}(_0xfd3d,0xa6));var _0xdfd3=function(_0x356739,_0x20b73e){_0x356739=_0x356739-0x0;var _0x4b61b4=_0xfd3d[_0x356739];return _0x4b61b4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xdfd3('0x0'));var rimraf=require(_0xdfd3('0x1'));var zipdir=require(_0xdfd3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdfd3('0x3'));var moment=require(_0xdfd3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdfd3('0x5'));var util=require(_0xdfd3('0x6'));var path=require(_0xdfd3('0x7'));var sox=require(_0xdfd3('0x8'));var csv=require(_0xdfd3('0x9'));var ejs=require(_0xdfd3('0xa'));var fs=require('fs');var _=require(_0xdfd3('0xb'));var squel=require(_0xdfd3('0xc'));var crypto=require(_0xdfd3('0xd'));var jsforce=require(_0xdfd3('0xe'));var deskjs=require(_0xdfd3('0xf'));var toCsv=require(_0xdfd3('0x9'));var querystring=require('querystring');var Papa=require(_0xdfd3('0x10'));var Redis=require(_0xdfd3('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdfd3('0x12'));var hardwareService=require(_0xdfd3('0x13'));var logger=require(_0xdfd3('0x14'))(_0xdfd3('0x15'));var utils=require('../../config/utils');var config=require(_0xdfd3('0x16'));var db=require(_0xdfd3('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xdfd3('0x18')]({'port':0x232a});function checkPasswordPattern(_0x1b4b3b,_0xa549ea,_0x1b690f){if(_0x1b690f){var _0x48c855=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x48c855[_0xdfd3('0x19')](_0xa549ea)){return _0x1b4b3b;}else{throw new Error(_0xdfd3('0x1a'));}}else{return _0x1b4b3b;}}function respondWithRpcPromise(_0x280b5c,_0x4eae2c,_0x2f0463,_0x122424){return new BPromise(function(_0x33b129,_0x3b526f){var _0x2781d0=_0x122424||client;return _0x2781d0['request'](_0x280b5c,_0x2f0463)['then'](function(_0x3a54ae){logger[_0xdfd3('0x1b')]('Setting,\x20%s,\x20%s',_0x4eae2c,_0xdfd3('0x1c'));logger['debug'](_0xdfd3('0x1d'),_0x4eae2c,_0xdfd3('0x1c'),JSON[_0xdfd3('0x1e')](_0x3a54ae));if(_0x3a54ae[_0xdfd3('0x1f')]){if(_0x3a54ae['error'][_0xdfd3('0x20')]===0x1f4){logger[_0xdfd3('0x1f')](_0xdfd3('0x21'),_0x4eae2c,_0x3a54ae[_0xdfd3('0x1f')][_0xdfd3('0x22')]);return _0x3b526f(_0x3a54ae['error'][_0xdfd3('0x22')]);}logger[_0xdfd3('0x1f')](_0xdfd3('0x21'),_0x4eae2c,_0x3a54ae[_0xdfd3('0x1f')][_0xdfd3('0x22')]);return _0x33b129(_0x3a54ae[_0xdfd3('0x1f')]['message']);}else{logger[_0xdfd3('0x1b')](_0xdfd3('0x21'),_0x4eae2c,_0xdfd3('0x1c'));_0x33b129(_0x3a54ae[_0xdfd3('0x23')][_0xdfd3('0x22')]);}})[_0xdfd3('0x24')](function(_0xc8b758){logger[_0xdfd3('0x1f')](_0xdfd3('0x21'),_0x4eae2c,_0xc8b758);_0x3b526f(_0xc8b758);});});}function respondWithStatusCode(_0x406232,_0x62a1d2){_0x62a1d2=_0x62a1d2||0xcc;return function(_0x17fe54){if(_0x17fe54){return _0x406232[_0xdfd3('0x25')](_0x62a1d2);}return _0x406232[_0xdfd3('0x26')](_0x62a1d2)['end']();};}function respondWithResult(_0x451296,_0x2a8b58){_0x2a8b58=_0x2a8b58||0xc8;return function(_0x35266c){if(_0x35266c){return _0x451296[_0xdfd3('0x26')](_0x2a8b58)[_0xdfd3('0x27')](_0x35266c);}};}function respondWithFilteredResult(_0x195462,_0xb777cd){return function(_0x433317){if(_0x433317){var _0x241980=_0x433317[_0xdfd3('0x28')],_0x29a734=_0xb777cd[_0xdfd3('0x29')],_0x936b82=_0xb777cd[_0xdfd3('0x29')]+_0xb777cd['limit'],_0x169189;if(_0x936b82>=_0x241980){_0x936b82=_0x241980;_0x169189=0xc8;}else{_0x169189=0xce;}_0x195462['status'](_0x169189);return _0x195462[_0xdfd3('0x2a')](_0xdfd3('0x2b'),_0x29a734+'-'+_0x936b82+'/'+_0x241980)[_0xdfd3('0x27')](_0x433317);}return null;};}function patchUpdates(_0x1da920){return function(_0x73e871){try{jsonpatch[_0xdfd3('0x2c')](_0x73e871,_0x1da920,!![]);}catch(_0x3c5d17){return BPromise[_0xdfd3('0x2d')](_0x3c5d17);}return _0x73e871[_0xdfd3('0x2e')]();};}function saveUpdates(_0x2bd373,_0x316517){return function(_0x39649c){if(_0x39649c){return _0x39649c[_0xdfd3('0x2f')](_0x2bd373)['then'](function(_0x249224){return _0x249224;});}return null;};}function removeEntity(_0x58965c,_0x42daf4){return function(_0x2bc781){if(_0x2bc781){return _0x2bc781[_0xdfd3('0x30')]()[_0xdfd3('0x31')](function(){_0x58965c[_0xdfd3('0x26')](0xcc)[_0xdfd3('0x32')]();});}};}function handleEntityNotFound(_0x39a803,_0x464532){return function(_0x26011f){if(!_0x26011f){_0x39a803[_0xdfd3('0x25')](0x194);}return _0x26011f;};}function handleError(_0x11d7e6,_0x2b79e7){_0x2b79e7=_0x2b79e7||0x1f4;return function(_0x5b75de){logger[_0xdfd3('0x1f')](_0x5b75de[_0xdfd3('0x33')]);if(_0x5b75de[_0xdfd3('0x34')]){delete _0x5b75de[_0xdfd3('0x34')];}_0x11d7e6[_0xdfd3('0x26')](_0x2b79e7)['send'](_0x5b75de);};}exports[_0xdfd3('0x35')]=function(_0x1e18e9,_0x274b5b){var _0x2a3ea0={},_0x518ae5={},_0xd902f8={'count':0x0,'rows':[]};var _0x4220f7=db[_0xdfd3('0x36')][_0xdfd3('0x37')];_0x518ae5['model']=_['keys'](_0x4220f7);_0x518ae5[_0xdfd3('0x38')]=_[_0xdfd3('0x39')](_0x1e18e9[_0xdfd3('0x38')]);_0x518ae5['filters']=_[_0xdfd3('0x3a')](_0x518ae5[_0xdfd3('0x3b')],_0x518ae5[_0xdfd3('0x38')]);_0x2a3ea0['attributes']=_[_0xdfd3('0x3a')](_0x518ae5['model'],qs[_0xdfd3('0x3c')](_0x1e18e9['query'][_0xdfd3('0x3c')]));_0x2a3ea0[_0xdfd3('0x3d')]=_0x2a3ea0[_0xdfd3('0x3d')]['length']?_0x2a3ea0[_0xdfd3('0x3d')]:_0x518ae5[_0xdfd3('0x3b')];if(!_0x1e18e9[_0xdfd3('0x38')][_0xdfd3('0x3e')](_0xdfd3('0x3f'))){_0x2a3ea0[_0xdfd3('0x40')]=qs['limit'](_0x1e18e9[_0xdfd3('0x38')]['limit']);_0x2a3ea0['offset']=qs[_0xdfd3('0x29')](_0x1e18e9[_0xdfd3('0x38')]['offset']);}_0x2a3ea0['order']=qs[_0xdfd3('0x41')](_0x1e18e9['query'][_0xdfd3('0x41')]);_0x2a3ea0['where']=qs['filters'](_[_0xdfd3('0x42')](_0x1e18e9[_0xdfd3('0x38')],_0x518ae5[_0xdfd3('0x43')]));if(_0x1e18e9['query'][_0xdfd3('0x44')]){_0x2a3ea0['where']=_[_0xdfd3('0x45')](_0x2a3ea0[_0xdfd3('0x46')],{'$or':_[_0xdfd3('0x47')](_0x4220f7,function(_0x5e6ec5){if(_0x5e6ec5['type']['key']!==_0xdfd3('0x48')){var _0xd5a3d0={};_0xd5a3d0[_0x5e6ec5['field']]={'$like':'%'+_0x1e18e9[_0xdfd3('0x38')][_0xdfd3('0x44')]+'%'};return _0xd5a3d0;}})});}_0x2a3ea0=_['merge']({},_0x2a3ea0,_0x1e18e9[_0xdfd3('0x49')]);var _0x4d2be0={'where':_0x2a3ea0['where']};return db['Setting'][_0xdfd3('0x28')](_0x4d2be0)[_0xdfd3('0x31')](function(_0x42fa2d){_0xd902f8['count']=_0x42fa2d;if(_0x1e18e9['query'][_0xdfd3('0x4a')]){_0x2a3ea0['include']=[{'all':!![]}];}return db[_0xdfd3('0x36')][_0xdfd3('0x4b')](_0x2a3ea0);})['then'](function(_0x85d0f5){_0xd902f8[_0xdfd3('0x4c')]=_0x85d0f5;return _0xd902f8;})[_0xdfd3('0x31')](respondWithFilteredResult(_0x274b5b,_0x2a3ea0))[_0xdfd3('0x24')](handleError(_0x274b5b,null));};exports['show']=function(_0x52b87a,_0x43f142){var _0x3c64f3={'raw':![],'where':{'id':_0x52b87a[_0xdfd3('0x4d')]['id']}},_0x217091={};_0x217091['model']=_[_0xdfd3('0x39')](db[_0xdfd3('0x36')]['rawAttributes']);_0x217091['query']=_[_0xdfd3('0x39')](_0x52b87a[_0xdfd3('0x38')]);_0x217091[_0xdfd3('0x43')]=_[_0xdfd3('0x3a')](_0x217091[_0xdfd3('0x3b')],_0x217091[_0xdfd3('0x38')]);_0x3c64f3['attributes']=_[_0xdfd3('0x3a')](_0x217091[_0xdfd3('0x3b')],qs['fields'](_0x52b87a[_0xdfd3('0x38')][_0xdfd3('0x3c')]));_0x3c64f3['attributes']=_0x3c64f3['attributes'][_0xdfd3('0x4e')]?_0x3c64f3[_0xdfd3('0x3d')]:_0x217091[_0xdfd3('0x3b')];if(_0x52b87a['query'][_0xdfd3('0x4a')]){_0x3c64f3[_0xdfd3('0x4f')]=[{'all':!![]}];}_0x3c64f3=_[_0xdfd3('0x45')]({},_0x3c64f3,_0x52b87a[_0xdfd3('0x49')]);return db[_0xdfd3('0x36')][_0xdfd3('0x50')](_0x3c64f3)[_0xdfd3('0x31')](handleEntityNotFound(_0x43f142,null))[_0xdfd3('0x31')](respondWithResult(_0x43f142,null))['catch'](handleError(_0x43f142,null));};exports[_0xdfd3('0x2f')]=function(_0x3c2084,_0x236930,_0x132952){var _0x3c8a45;return db[_0xdfd3('0x36')]['find']({'where':{'id':_0x3c2084['params']['id']}})[_0xdfd3('0x31')](handleEntityNotFound(_0x236930,null))[_0xdfd3('0x31')](saveUpdates(_0x3c2084[_0xdfd3('0x51')],null))[_0xdfd3('0x31')](function(_0x2c864e){if(_0x2c864e){_0x3c8a45=_0x2c864e[_0xdfd3('0x52')]({'plain':!![]});var _0x55ce90=fs[_0xdfd3('0x53')](path[_0xdfd3('0x54')](config['root'],_0xdfd3('0x55')),_0xdfd3('0x56'));var _0x209748=ejs[_0xdfd3('0x57')](_0x55ce90,_0x3c8a45);var _0x9a5101=fs['readFileSync'](path[_0xdfd3('0x54')](config[_0xdfd3('0x58')],_0xdfd3('0x59')),'utf8');var _0x1e8f14=ejs[_0xdfd3('0x57')](_0x9a5101,_0x3c8a45);fs['writeFileSync'](_0xdfd3('0x5a'),_0x209748);fs[_0xdfd3('0x5b')](_0xdfd3('0x5c'),_0x1e8f14);return respondWithRpcPromise(_0xdfd3('0x5d'),_0xdfd3('0x2f'),{'module':_0xdfd3('0x5e')});}})['then'](function(){return respondWithRpcPromise('Reload',_0xdfd3('0x2f'),{'module':_0xdfd3('0x5f')});})['then'](function(){return _0x3c8a45||null;})[_0xdfd3('0x31')](respondWithResult(_0x236930,null))[_0xdfd3('0x24')](handleError(_0x236930,null));};exports[_0xdfd3('0x60')]=function(_0x53141b,_0x4dc0fa,_0x404dbb){if(_0x53141b[_0xdfd3('0x61')]&&_0x53141b[_0xdfd3('0x61')]['filename']){_0x53141b[_0xdfd3('0x51')]['logo']=_0x53141b[_0xdfd3('0x61')]['filename'];}return db[_0xdfd3('0x36')]['find']({'where':{'id':_0x53141b[_0xdfd3('0x4d')]['id']}})[_0xdfd3('0x31')](handleEntityNotFound(_0x4dc0fa,null))[_0xdfd3('0x31')](saveUpdates(_0x53141b[_0xdfd3('0x51')],null))[_0xdfd3('0x31')](respondWithResult(_0x4dc0fa,null))[_0xdfd3('0x24')](handleError(_0x4dc0fa,null));};exports[_0xdfd3('0x62')]=function(_0x13f08,_0x25ed95,_0x402d7f){if(_0x13f08[_0xdfd3('0x61')]&&_0x13f08[_0xdfd3('0x61')]['filename']){_0x13f08['body'][_0xdfd3('0x63')]=_0x13f08[_0xdfd3('0x61')][_0xdfd3('0x64')];}return db['Setting']['find']({'where':{'id':_0x13f08['params']['id']}})[_0xdfd3('0x31')](handleEntityNotFound(_0x25ed95,null))[_0xdfd3('0x31')](saveUpdates(_0x13f08[_0xdfd3('0x51')],null))['then'](respondWithResult(_0x25ed95,null))[_0xdfd3('0x24')](handleError(_0x25ed95,null));};var utilLicense=require(_0xdfd3('0x65'));exports['getLogo']=function(_0x133b73,_0x9fa677,_0x1fd4f2){var _0x26cc81=_0xdfd3('0x66');var _0x99757e={'custom':![]};return utilLicense[_0xdfd3('0x67')]()[_0xdfd3('0x31')](function(_0x13ebf2){if(_0x13ebf2){_0x99757e=_0x13ebf2;}return db[_0xdfd3('0x36')][_0xdfd3('0x50')]({'where':{'id':_0x133b73[_0xdfd3('0x4d')]['id']},'attributes':[_0xdfd3('0x68'),_0xdfd3('0x63'),_0xdfd3('0x69'),_0xdfd3('0x6a'),_0xdfd3('0x6b'),_0xdfd3('0x6c')],'raw':!![]});})[_0xdfd3('0x31')](handleEntityNotFound(_0x9fa677,null))[_0xdfd3('0x31')](function(_0x3353f7){if(_0x3353f7){var _0x2f8a86=_0x3353f7['logo']&&fs[_0xdfd3('0x6d')](path[_0xdfd3('0x54')](config[_0xdfd3('0x58')],_0x26cc81,_['toLower'](_0x3353f7[_0xdfd3('0x68')])))?path[_0xdfd3('0x54')](config[_0xdfd3('0x58')],_0x26cc81,_[_0xdfd3('0x6e')](_0x3353f7[_0xdfd3('0x68')])):path[_0xdfd3('0x54')](config['root'],_0x26cc81,_[_0xdfd3('0x6e')]('default_logo.png'));var _0x150d48=_0xdfd3('0x6f')+_['upperFirst'](_0xdfd3('0x68'));if(_0x3353f7[_0x150d48]||!_0x99757e[_0xdfd3('0x70')]){_0x2f8a86=path[_0xdfd3('0x54')](config[_0xdfd3('0x58')],_0x26cc81,_[_0xdfd3('0x6e')](_0xdfd3('0x71')));}if(!fs['existsSync'](_0x2f8a86)){throw new db['Sequelize'][(_0xdfd3('0x72'))](_0xdfd3('0x73'));}return _0x9fa677[_0xdfd3('0x74')](_0x2f8a86);}})['catch'](handleError(_0x9fa677,null));};var utilLicense=require(_0xdfd3('0x65'));exports[_0xdfd3('0x75')]=function(_0x33708,_0x1f1e27,_0x37617f){var _0x364327=_0xdfd3('0x66');var _0x3a73ad={'custom':![]};return utilLicense['getLicense']()[_0xdfd3('0x31')](function(_0x1a1f97){if(_0x1a1f97){_0x3a73ad=_0x1a1f97;}return db[_0xdfd3('0x36')][_0xdfd3('0x50')]({'where':{'id':_0x33708[_0xdfd3('0x4d')]['id']},'attributes':[_0xdfd3('0x68'),_0xdfd3('0x63'),'preferred','defaultLogo',_0xdfd3('0x6b'),_0xdfd3('0x6c')],'raw':!![]});})[_0xdfd3('0x31')](handleEntityNotFound(_0x1f1e27,null))['then'](function(_0x5f3385){if(_0x5f3385){var _0x5ac257=_0x5f3385[_0xdfd3('0x63')]&&fs['existsSync'](path[_0xdfd3('0x54')](config['root'],_0x364327,_[_0xdfd3('0x6e')](_0x5f3385['loginLogo'])))?path[_0xdfd3('0x54')](config[_0xdfd3('0x58')],_0x364327,_['toLower'](_0x5f3385[_0xdfd3('0x63')])):path[_0xdfd3('0x54')](config[_0xdfd3('0x58')],_0x364327,_['toLower'](_0xdfd3('0x76')));var _0x26c9ec='default'+_['upperFirst'](_0xdfd3('0x63'));if(_0x5f3385[_0x26c9ec]||!_0x3a73ad[_0xdfd3('0x70')]){_0x5ac257=path[_0xdfd3('0x54')](config[_0xdfd3('0x58')],_0x364327,_[_0xdfd3('0x6e')](_0xdfd3('0x76')));}if(!fs[_0xdfd3('0x6d')](_0x5ac257)){throw new db[(_0xdfd3('0x77'))][(_0xdfd3('0x72'))](_0xdfd3('0x73'));}return _0x1f1e27[_0xdfd3('0x74')](_0x5ac257);}})[_0xdfd3('0x24')](handleError(_0x1f1e27,null));};exports[_0xdfd3('0x78')]=function(_0x29f11b,_0x1bb0f9){return db[_0xdfd3('0x36')][_0xdfd3('0x50')]({'where':{'id':_0x29f11b['params']['id']},'attributes':[_0xdfd3('0x79')]})[_0xdfd3('0x31')](respondWithResult(_0x1bb0f9,null))[_0xdfd3('0x24')](handleError(_0x1bb0f9,null));};exports[_0xdfd3('0x7a')]=function(_0xcc6e65,_0x5beb0a,_0x281bf8){if(_0xcc6e65[_0xdfd3('0x61')]&&_0xcc6e65[_0xdfd3('0x61')]['filename']){_0xcc6e65[_0xdfd3('0x51')][_0xdfd3('0x69')]=_0xcc6e65[_0xdfd3('0x61')][_0xdfd3('0x64')];}return db['Setting'][_0xdfd3('0x50')]({'where':{'id':_0xcc6e65[_0xdfd3('0x4d')]['id']}})[_0xdfd3('0x31')](handleEntityNotFound(_0x5beb0a,null))[_0xdfd3('0x31')](saveUpdates(_0xcc6e65[_0xdfd3('0x51')],null))['then'](respondWithResult(_0x5beb0a,null))['catch'](handleError(_0x5beb0a,null));};var utilLicense=require(_0xdfd3('0x65'));exports[_0xdfd3('0x7b')]=function(_0x2e7a02,_0x5e158b,_0x22b61f){var _0x2c8ee5='server/files/images/logos';var _0x3f8706={'custom':![]};return utilLicense['getLicense']()[_0xdfd3('0x31')](function(_0x4baa55){if(_0x4baa55){_0x3f8706=_0x4baa55;}return db[_0xdfd3('0x36')][_0xdfd3('0x50')]({'where':{'id':_0x2e7a02[_0xdfd3('0x4d')]['id']},'attributes':[_0xdfd3('0x68'),_0xdfd3('0x63'),_0xdfd3('0x69'),_0xdfd3('0x6a'),'defaultLoginLogo',_0xdfd3('0x6c')],'raw':!![]});})[_0xdfd3('0x31')](handleEntityNotFound(_0x5e158b,null))['then'](function(_0x45dc56){if(_0x45dc56){var _0x1e6794=_0x45dc56[_0xdfd3('0x69')]&&fs[_0xdfd3('0x6d')](path[_0xdfd3('0x54')](config[_0xdfd3('0x58')],_0x2c8ee5,_[_0xdfd3('0x6e')](_0x45dc56[_0xdfd3('0x69')])))?path[_0xdfd3('0x54')](config['root'],_0x2c8ee5,_[_0xdfd3('0x6e')](_0x45dc56[_0xdfd3('0x69')])):path[_0xdfd3('0x54')](config[_0xdfd3('0x58')],_0x2c8ee5,_[_0xdfd3('0x6e')](_0xdfd3('0x7c')));var _0x105219=_0xdfd3('0x6f')+_[_0xdfd3('0x7d')]('preferred');if(_0x45dc56[_0x105219]||!_0x3f8706[_0xdfd3('0x70')]||!_0x3f8706['preferred']){_0x1e6794=path[_0xdfd3('0x54')](config[_0xdfd3('0x58')],_0x2c8ee5,_['toLower'](_0xdfd3('0x7c')));}if(!fs[_0xdfd3('0x6d')](_0x1e6794)){throw new db[(_0xdfd3('0x77'))][(_0xdfd3('0x72'))](_0xdfd3('0x73'));}return _0x5e158b[_0xdfd3('0x74')](_0x1e6794);}})[_0xdfd3('0x24')](handleError(_0x5e158b,null));}; \ No newline at end of file +var _0x14a6=['crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','sendStatus','status','end','json','offset','limit','set','apply','reject','save','update','destroy','stack','name','send','Setting','rawAttributes','keys','filters','intersection','model','query','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','field','options','count','includeAll','findAll','rows','show','params','include','find','readFileSync','root','utf8','render','join','server/files/templates/turn.ejs','/etc/asterisk/stun_xcally.conf','/etc/asterisk/turn_xcally.conf','Reload','res_stun_monitor.so','file','filename','body','logo','loginLogo','../../config/license/util','getLogo','server/files/images/logos','getLicense','preferred','defaultLogo','defaultLoginLogo','existsSync','toLower','default_logo.png','default','upperFirst','Sequelize','ValidationError','Logo\x20not\x20found','download','getLogoLogin','default_loginLogo.png','gdpr','securePassword','getPreferred','default_preferred.png','custom','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv'];(function(_0x10f875,_0x51f8cf){var _0x3accfa=function(_0x1918ea){while(--_0x1918ea){_0x10f875['push'](_0x10f875['shift']());}};_0x3accfa(++_0x51f8cf);}(_0x14a6,0x1ca));var _0x614a=function(_0x14f89e,_0x139fce){_0x14f89e=_0x14f89e-0x0;var _0x26092d=_0x14a6[_0x14f89e];return _0x26092d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x614a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x614a('0x1'));var jsonpatch=require(_0x614a('0x2'));var rp=require(_0x614a('0x3'));var moment=require(_0x614a('0x4'));var BPromise=require(_0x614a('0x5'));var Mustache=require(_0x614a('0x6'));var util=require(_0x614a('0x7'));var path=require('path');var sox=require(_0x614a('0x8'));var csv=require(_0x614a('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x614a('0xa'));var jsforce=require(_0x614a('0xb'));var deskjs=require(_0x614a('0xc'));var toCsv=require(_0x614a('0x9'));var querystring=require('querystring');var Papa=require(_0x614a('0xd'));var Redis=require('ioredis');var authService=require(_0x614a('0xe'));var qs=require(_0x614a('0xf'));var hardwareService=require(_0x614a('0x10'));var logger=require('../../config/logger')(_0x614a('0x11'));var utils=require('../../config/utils');var config=require(_0x614a('0x12'));var db=require(_0x614a('0x13'))['db'];var jayson=require(_0x614a('0x14'));var client=jayson['client'][_0x614a('0x15')]({'port':0x232a});function checkPasswordPattern(_0x5b7760,_0x27aa02,_0x2a320d){if(_0x2a320d){var _0x337f22=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x337f22[_0x614a('0x16')](_0x27aa02)){return _0x5b7760;}else{throw new Error(_0x614a('0x17'));}}else{return _0x5b7760;}}function respondWithRpcPromise(_0xdec3da,_0x226f06,_0x3f760c,_0x5aa5a9){return new BPromise(function(_0x2cf761,_0x38cebc){var _0x3962ab=_0x5aa5a9||client;return _0x3962ab[_0x614a('0x18')](_0xdec3da,_0x3f760c)[_0x614a('0x19')](function(_0x31b261){logger[_0x614a('0x1a')](_0x614a('0x1b'),_0x226f06,_0x614a('0x1c'));logger[_0x614a('0x1d')]('Setting,\x20%s,\x20%s,\x20%s',_0x226f06,'request\x20sent',JSON['stringify'](_0x31b261));if(_0x31b261['error']){if(_0x31b261[_0x614a('0x1e')][_0x614a('0x1f')]===0x1f4){logger[_0x614a('0x1e')](_0x614a('0x1b'),_0x226f06,_0x31b261['error']['message']);return _0x38cebc(_0x31b261[_0x614a('0x1e')][_0x614a('0x20')]);}logger['error'](_0x614a('0x1b'),_0x226f06,_0x31b261[_0x614a('0x1e')]['message']);return _0x2cf761(_0x31b261[_0x614a('0x1e')][_0x614a('0x20')]);}else{logger[_0x614a('0x1a')](_0x614a('0x1b'),_0x226f06,_0x614a('0x1c'));_0x2cf761(_0x31b261['result'][_0x614a('0x20')]);}})[_0x614a('0x21')](function(_0x4f7353){logger[_0x614a('0x1e')]('Setting,\x20%s,\x20%s',_0x226f06,_0x4f7353);_0x38cebc(_0x4f7353);});});}function respondWithStatusCode(_0x55aab7,_0x1676b7){_0x1676b7=_0x1676b7||0xcc;return function(_0x4c6ec5){if(_0x4c6ec5){return _0x55aab7[_0x614a('0x22')](_0x1676b7);}return _0x55aab7[_0x614a('0x23')](_0x1676b7)[_0x614a('0x24')]();};}function respondWithResult(_0x143fba,_0x5a30a9){_0x5a30a9=_0x5a30a9||0xc8;return function(_0x24ad89){if(_0x24ad89){return _0x143fba[_0x614a('0x23')](_0x5a30a9)[_0x614a('0x25')](_0x24ad89);}};}function respondWithFilteredResult(_0x14fa34,_0x1bebe6){return function(_0x2058a1){if(_0x2058a1){var _0x3b8102=_0x2058a1['count'],_0x3ff126=_0x1bebe6[_0x614a('0x26')],_0x570f1b=_0x1bebe6[_0x614a('0x26')]+_0x1bebe6[_0x614a('0x27')],_0xfd2464;if(_0x570f1b>=_0x3b8102){_0x570f1b=_0x3b8102;_0xfd2464=0xc8;}else{_0xfd2464=0xce;}_0x14fa34[_0x614a('0x23')](_0xfd2464);return _0x14fa34[_0x614a('0x28')]('Content-Range',_0x3ff126+'-'+_0x570f1b+'/'+_0x3b8102)[_0x614a('0x25')](_0x2058a1);}return null;};}function patchUpdates(_0x7955c2){return function(_0x1a4f96){try{jsonpatch[_0x614a('0x29')](_0x1a4f96,_0x7955c2,!![]);}catch(_0x3b7990){return BPromise[_0x614a('0x2a')](_0x3b7990);}return _0x1a4f96[_0x614a('0x2b')]();};}function saveUpdates(_0x51ff0c,_0x569ab0){return function(_0x35e9bd){if(_0x35e9bd){return _0x35e9bd[_0x614a('0x2c')](_0x51ff0c)[_0x614a('0x19')](function(_0x5bc545){return _0x5bc545;});}return null;};}function removeEntity(_0x97b1f9,_0x5a2502){return function(_0x276ee2){if(_0x276ee2){return _0x276ee2[_0x614a('0x2d')]()['then'](function(){_0x97b1f9[_0x614a('0x23')](0xcc)[_0x614a('0x24')]();});}};}function handleEntityNotFound(_0x4282b4,_0x17fbb2){return function(_0x2d8449){if(!_0x2d8449){_0x4282b4[_0x614a('0x22')](0x194);}return _0x2d8449;};}function handleError(_0x649795,_0x2304b5){_0x2304b5=_0x2304b5||0x1f4;return function(_0x2a68f8){logger[_0x614a('0x1e')](_0x2a68f8[_0x614a('0x2e')]);if(_0x2a68f8[_0x614a('0x2f')]){delete _0x2a68f8[_0x614a('0x2f')];}_0x649795[_0x614a('0x23')](_0x2304b5)[_0x614a('0x30')](_0x2a68f8);};}exports['index']=function(_0x27e0bc,_0x31f6ed){var _0x4afe4f={},_0x2d8e4d={},_0x158487={'count':0x0,'rows':[]};var _0x44b2ca=db[_0x614a('0x31')][_0x614a('0x32')];_0x2d8e4d['model']=_['keys'](_0x44b2ca);_0x2d8e4d['query']=_[_0x614a('0x33')](_0x27e0bc['query']);_0x2d8e4d[_0x614a('0x34')]=_[_0x614a('0x35')](_0x2d8e4d[_0x614a('0x36')],_0x2d8e4d[_0x614a('0x37')]);_0x4afe4f[_0x614a('0x38')]=_[_0x614a('0x35')](_0x2d8e4d[_0x614a('0x36')],qs[_0x614a('0x39')](_0x27e0bc[_0x614a('0x37')][_0x614a('0x39')]));_0x4afe4f[_0x614a('0x38')]=_0x4afe4f['attributes'][_0x614a('0x3a')]?_0x4afe4f[_0x614a('0x38')]:_0x2d8e4d[_0x614a('0x36')];if(!_0x27e0bc[_0x614a('0x37')]['hasOwnProperty'](_0x614a('0x3b'))){_0x4afe4f[_0x614a('0x27')]=qs[_0x614a('0x27')](_0x27e0bc[_0x614a('0x37')][_0x614a('0x27')]);_0x4afe4f[_0x614a('0x26')]=qs[_0x614a('0x26')](_0x27e0bc['query'][_0x614a('0x26')]);}_0x4afe4f[_0x614a('0x3c')]=qs['sort'](_0x27e0bc['query'][_0x614a('0x3d')]);_0x4afe4f[_0x614a('0x3e')]=qs[_0x614a('0x34')](_[_0x614a('0x3f')](_0x27e0bc['query'],_0x2d8e4d[_0x614a('0x34')]));if(_0x27e0bc['query'][_0x614a('0x40')]){_0x4afe4f[_0x614a('0x3e')]=_[_0x614a('0x41')](_0x4afe4f['where'],{'$or':_[_0x614a('0x42')](_0x44b2ca,function(_0x6e955b){if(_0x6e955b['type'][_0x614a('0x43')]!==_0x614a('0x44')){var _0x5000b5={};_0x5000b5[_0x6e955b[_0x614a('0x45')]]={'$like':'%'+_0x27e0bc[_0x614a('0x37')][_0x614a('0x40')]+'%'};return _0x5000b5;}})});}_0x4afe4f=_[_0x614a('0x41')]({},_0x4afe4f,_0x27e0bc[_0x614a('0x46')]);var _0x5dbd03={'where':_0x4afe4f[_0x614a('0x3e')]};return db['Setting'][_0x614a('0x47')](_0x5dbd03)[_0x614a('0x19')](function(_0x34b931){_0x158487[_0x614a('0x47')]=_0x34b931;if(_0x27e0bc['query'][_0x614a('0x48')]){_0x4afe4f['include']=[{'all':!![]}];}return db['Setting'][_0x614a('0x49')](_0x4afe4f);})[_0x614a('0x19')](function(_0x1216cd){_0x158487[_0x614a('0x4a')]=_0x1216cd;return _0x158487;})[_0x614a('0x19')](respondWithFilteredResult(_0x31f6ed,_0x4afe4f))[_0x614a('0x21')](handleError(_0x31f6ed,null));};exports[_0x614a('0x4b')]=function(_0x29d7b3,_0x48fa86){var _0x226e98={'raw':![],'where':{'id':_0x29d7b3[_0x614a('0x4c')]['id']}},_0x9dcdf4={};_0x9dcdf4[_0x614a('0x36')]=_[_0x614a('0x33')](db[_0x614a('0x31')][_0x614a('0x32')]);_0x9dcdf4[_0x614a('0x37')]=_[_0x614a('0x33')](_0x29d7b3[_0x614a('0x37')]);_0x9dcdf4['filters']=_[_0x614a('0x35')](_0x9dcdf4[_0x614a('0x36')],_0x9dcdf4[_0x614a('0x37')]);_0x226e98[_0x614a('0x38')]=_[_0x614a('0x35')](_0x9dcdf4[_0x614a('0x36')],qs[_0x614a('0x39')](_0x29d7b3[_0x614a('0x37')]['fields']));_0x226e98['attributes']=_0x226e98[_0x614a('0x38')][_0x614a('0x3a')]?_0x226e98['attributes']:_0x9dcdf4[_0x614a('0x36')];if(_0x29d7b3[_0x614a('0x37')][_0x614a('0x48')]){_0x226e98[_0x614a('0x4d')]=[{'all':!![]}];}_0x226e98=_['merge']({},_0x226e98,_0x29d7b3[_0x614a('0x46')]);return db[_0x614a('0x31')][_0x614a('0x4e')](_0x226e98)[_0x614a('0x19')](handleEntityNotFound(_0x48fa86,null))['then'](respondWithResult(_0x48fa86,null))[_0x614a('0x21')](handleError(_0x48fa86,null));};exports['update']=function(_0x40cb64,_0x5932c2,_0x4b3447){var _0x4f6d53;return db['Setting'][_0x614a('0x4e')]({'where':{'id':_0x40cb64['params']['id']}})[_0x614a('0x19')](handleEntityNotFound(_0x5932c2,null))[_0x614a('0x19')](saveUpdates(_0x40cb64['body'],null))[_0x614a('0x19')](function(_0x4ec6b1){if(_0x4ec6b1){_0x4f6d53=_0x4ec6b1['get']({'plain':!![]});var _0x7d0b6d=fs[_0x614a('0x4f')](path['join'](config[_0x614a('0x50')],'server/files/templates/stun.ejs'),_0x614a('0x51'));var _0x2cb5ac=ejs[_0x614a('0x52')](_0x7d0b6d,_0x4f6d53);var _0x3545e2=fs[_0x614a('0x4f')](path[_0x614a('0x53')](config[_0x614a('0x50')],_0x614a('0x54')),_0x614a('0x51'));var _0x5dc967=ejs[_0x614a('0x52')](_0x3545e2,_0x4f6d53);fs['writeFileSync'](_0x614a('0x55'),_0x2cb5ac);fs['writeFileSync'](_0x614a('0x56'),_0x5dc967);return respondWithRpcPromise(_0x614a('0x57'),_0x614a('0x2c'),{'module':_0x614a('0x58')});}})[_0x614a('0x19')](function(){return respondWithRpcPromise(_0x614a('0x57'),'update',{'module':'res_rtp_asterisk.so'});})[_0x614a('0x19')](function(){return _0x4f6d53||null;})[_0x614a('0x19')](respondWithResult(_0x5932c2,null))[_0x614a('0x21')](handleError(_0x5932c2,null));};exports['addLogo']=function(_0x5d7b00,_0x4f2339,_0x49b048){if(_0x5d7b00[_0x614a('0x59')]&&_0x5d7b00[_0x614a('0x59')][_0x614a('0x5a')]){_0x5d7b00[_0x614a('0x5b')][_0x614a('0x5c')]=_0x5d7b00[_0x614a('0x59')][_0x614a('0x5a')];}return db[_0x614a('0x31')]['find']({'where':{'id':_0x5d7b00[_0x614a('0x4c')]['id']}})[_0x614a('0x19')](handleEntityNotFound(_0x4f2339,null))[_0x614a('0x19')](saveUpdates(_0x5d7b00[_0x614a('0x5b')],null))[_0x614a('0x19')](respondWithResult(_0x4f2339,null))['catch'](handleError(_0x4f2339,null));};exports['addLogoLogin']=function(_0x4e6002,_0x66cffa,_0x511ac4){if(_0x4e6002[_0x614a('0x59')]&&_0x4e6002[_0x614a('0x59')][_0x614a('0x5a')]){_0x4e6002[_0x614a('0x5b')][_0x614a('0x5d')]=_0x4e6002[_0x614a('0x59')][_0x614a('0x5a')];}return db[_0x614a('0x31')][_0x614a('0x4e')]({'where':{'id':_0x4e6002[_0x614a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x66cffa,null))['then'](saveUpdates(_0x4e6002['body'],null))['then'](respondWithResult(_0x66cffa,null))[_0x614a('0x21')](handleError(_0x66cffa,null));};var utilLicense=require(_0x614a('0x5e'));exports[_0x614a('0x5f')]=function(_0xd0dba2,_0x567a56,_0x103a84){var _0x5d3308=_0x614a('0x60');var _0x42cf2f={'custom':![]};return utilLicense[_0x614a('0x61')]()[_0x614a('0x19')](function(_0x59f31d){if(_0x59f31d){_0x42cf2f=_0x59f31d;}return db[_0x614a('0x31')]['find']({'where':{'id':_0xd0dba2[_0x614a('0x4c')]['id']},'attributes':[_0x614a('0x5c'),'loginLogo',_0x614a('0x62'),_0x614a('0x63'),_0x614a('0x64'),'defaultPreferred'],'raw':!![]});})['then'](handleEntityNotFound(_0x567a56,null))[_0x614a('0x19')](function(_0x33c2b3){if(_0x33c2b3){var _0xe75eb5=_0x33c2b3[_0x614a('0x5c')]&&fs[_0x614a('0x65')](path[_0x614a('0x53')](config[_0x614a('0x50')],_0x5d3308,_[_0x614a('0x66')](_0x33c2b3['logo'])))?path[_0x614a('0x53')](config[_0x614a('0x50')],_0x5d3308,_[_0x614a('0x66')](_0x33c2b3[_0x614a('0x5c')])):path[_0x614a('0x53')](config['root'],_0x5d3308,_[_0x614a('0x66')](_0x614a('0x67')));var _0xd08aaf=_0x614a('0x68')+_[_0x614a('0x69')]('logo');if(_0x33c2b3[_0xd08aaf]||!_0x42cf2f['custom']){_0xe75eb5=path[_0x614a('0x53')](config[_0x614a('0x50')],_0x5d3308,_[_0x614a('0x66')]('default_logo.png'));}if(!fs[_0x614a('0x65')](_0xe75eb5)){throw new db[(_0x614a('0x6a'))][(_0x614a('0x6b'))](_0x614a('0x6c'));}return _0x567a56[_0x614a('0x6d')](_0xe75eb5);}})['catch'](handleError(_0x567a56,null));};var utilLicense=require(_0x614a('0x5e'));exports[_0x614a('0x6e')]=function(_0x4aa4db,_0xf4a1ba,_0x53dabc){var _0x2a0dca=_0x614a('0x60');var _0x32c00a={'custom':![]};return utilLicense[_0x614a('0x61')]()[_0x614a('0x19')](function(_0x54e5ef){if(_0x54e5ef){_0x32c00a=_0x54e5ef;}return db[_0x614a('0x31')][_0x614a('0x4e')]({'where':{'id':_0x4aa4db[_0x614a('0x4c')]['id']},'attributes':[_0x614a('0x5c'),_0x614a('0x5d'),_0x614a('0x62'),_0x614a('0x63'),'defaultLoginLogo','defaultPreferred'],'raw':!![]});})[_0x614a('0x19')](handleEntityNotFound(_0xf4a1ba,null))[_0x614a('0x19')](function(_0x485a88){if(_0x485a88){var _0x88255b=_0x485a88[_0x614a('0x5d')]&&fs['existsSync'](path[_0x614a('0x53')](config['root'],_0x2a0dca,_[_0x614a('0x66')](_0x485a88[_0x614a('0x5d')])))?path[_0x614a('0x53')](config[_0x614a('0x50')],_0x2a0dca,_[_0x614a('0x66')](_0x485a88['loginLogo'])):path['join'](config[_0x614a('0x50')],_0x2a0dca,_[_0x614a('0x66')](_0x614a('0x6f')));var _0x343f19='default'+_[_0x614a('0x69')](_0x614a('0x5d'));if(_0x485a88[_0x343f19]||!_0x32c00a['custom']){_0x88255b=path[_0x614a('0x53')](config[_0x614a('0x50')],_0x2a0dca,_['toLower'](_0x614a('0x6f')));}if(!fs[_0x614a('0x65')](_0x88255b)){throw new db[(_0x614a('0x6a'))]['ValidationError'](_0x614a('0x6c'));}return _0xf4a1ba[_0x614a('0x6d')](_0x88255b);}})[_0x614a('0x21')](handleError(_0xf4a1ba,null));};exports[_0x614a('0x70')]=function(_0x2bf467,_0x46d401){return db['Setting'][_0x614a('0x4e')]({'where':{'id':_0x2bf467[_0x614a('0x4c')]['id']},'attributes':[_0x614a('0x71')]})['then'](respondWithResult(_0x46d401,null))[_0x614a('0x21')](handleError(_0x46d401,null));};exports['addPreferred']=function(_0x31d90c,_0x2402b6,_0x3fde1){if(_0x31d90c[_0x614a('0x59')]&&_0x31d90c[_0x614a('0x59')][_0x614a('0x5a')]){_0x31d90c[_0x614a('0x5b')]['preferred']=_0x31d90c[_0x614a('0x59')]['filename'];}return db[_0x614a('0x31')][_0x614a('0x4e')]({'where':{'id':_0x31d90c[_0x614a('0x4c')]['id']}})[_0x614a('0x19')](handleEntityNotFound(_0x2402b6,null))[_0x614a('0x19')](saveUpdates(_0x31d90c[_0x614a('0x5b')],null))[_0x614a('0x19')](respondWithResult(_0x2402b6,null))['catch'](handleError(_0x2402b6,null));};var utilLicense=require(_0x614a('0x5e'));exports[_0x614a('0x72')]=function(_0x3b024b,_0x1aa544,_0x283080){var _0x2b0803=_0x614a('0x60');var _0x9c0dd5={'custom':![]};return utilLicense[_0x614a('0x61')]()[_0x614a('0x19')](function(_0x5eb57a){if(_0x5eb57a){_0x9c0dd5=_0x5eb57a;}return db[_0x614a('0x31')][_0x614a('0x4e')]({'where':{'id':_0x3b024b[_0x614a('0x4c')]['id']},'attributes':[_0x614a('0x5c'),_0x614a('0x5d'),_0x614a('0x62'),_0x614a('0x63'),_0x614a('0x64'),'defaultPreferred'],'raw':!![]});})['then'](handleEntityNotFound(_0x1aa544,null))[_0x614a('0x19')](function(_0x144010){if(_0x144010){var _0x4dd763=_0x144010[_0x614a('0x62')]&&fs[_0x614a('0x65')](path[_0x614a('0x53')](config[_0x614a('0x50')],_0x2b0803,_[_0x614a('0x66')](_0x144010[_0x614a('0x62')])))?path[_0x614a('0x53')](config[_0x614a('0x50')],_0x2b0803,_[_0x614a('0x66')](_0x144010[_0x614a('0x62')])):path[_0x614a('0x53')](config[_0x614a('0x50')],_0x2b0803,_[_0x614a('0x66')](_0x614a('0x73')));var _0x461d5e=_0x614a('0x68')+_[_0x614a('0x69')](_0x614a('0x62'));if(_0x144010[_0x461d5e]||!_0x9c0dd5[_0x614a('0x74')]||!_0x9c0dd5[_0x614a('0x62')]){_0x4dd763=path[_0x614a('0x53')](config['root'],_0x2b0803,_[_0x614a('0x66')](_0x614a('0x73')));}if(!fs[_0x614a('0x65')](_0x4dd763)){throw new db[(_0x614a('0x6a'))][(_0x614a('0x6b'))](_0x614a('0x6c'));}return _0x1aa544['download'](_0x4dd763);}})[_0x614a('0x21')](handleError(_0x1aa544,null));}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 23beaba..0e990c7 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 _0xc901=['./setting.attributes','exports','define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment'];(function(_0x17b05e,_0x2d38ec){var _0x4bef32=function(_0x192b6f){while(--_0x192b6f){_0x17b05e['push'](_0x17b05e['shift']());}};_0x4bef32(++_0x2d38ec);}(_0xc901,0x13c));var _0x1c90=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc901[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x1c90('0x0'));var util=require(_0x1c90('0x1'));var logger=require(_0x1c90('0x2'))(_0x1c90('0x3'));var moment=require(_0x1c90('0x4'));var BPromise=require('bluebird');var rp=require(_0x1c90('0x5'));var fs=require('fs');var path=require(_0x1c90('0x6'));var rimraf=require('rimraf');var config=require(_0x1c90('0x7'));var attributes=require(_0x1c90('0x8'));module[_0x1c90('0x9')]=function(_0x686d3f,_0x5191e5){return _0x686d3f[_0x1c90('0xa')]('Setting',attributes,{'tableName':_0x1c90('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x86b4=['util','../../config/logger','moment','bluebird','path','rimraf','./setting.attributes','exports','Setting','settings','lodash'];(function(_0x5b57fe,_0x478235){var _0x135824=function(_0x333cff){while(--_0x333cff){_0x5b57fe['push'](_0x5b57fe['shift']());}};_0x135824(++_0x478235);}(_0x86b4,0xfc));var _0x486b=function(_0x4457fe,_0x3f4963){_0x4457fe=_0x4457fe-0x0;var _0xc577ef=_0x86b4[_0x4457fe];return _0xc577ef;};'use strict';var _=require(_0x486b('0x0'));var util=require(_0x486b('0x1'));var logger=require(_0x486b('0x2'))('api');var moment=require(_0x486b('0x3'));var BPromise=require(_0x486b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x486b('0x5'));var rimraf=require(_0x486b('0x6'));var config=require('../../config/environment');var attributes=require(_0x486b('0x7'));module[_0x486b('0x8')]=function(_0x98a0f4,_0x127a73){return _0x98a0f4['define'](_0x486b('0x9'),attributes,{'tableName':_0x486b('0xa'),'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 5079dd6..d92b0c8 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 _0x4ee6=['../../config/environment','jayson/promise','client','http','request','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','info','lodash','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x2b3f30,_0xaea4a1){var _0x49fe08=function(_0x4fbffe){while(--_0x4fbffe){_0x2b3f30['push'](_0x2b3f30['shift']());}};_0x49fe08(++_0xaea4a1);}(_0x4ee6,0xf1));var _0x64ee=function(_0x13c318,_0x25083c){_0x13c318=_0x13c318-0x0;var _0xf7cbcc=_0x4ee6[_0x13c318];return _0xf7cbcc;};'use strict';var _=require(_0x64ee('0x0'));var util=require(_0x64ee('0x1'));var moment=require(_0x64ee('0x2'));var BPromise=require(_0x64ee('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x64ee('0x4'))['db'];var utils=require(_0x64ee('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x64ee('0x6'));var jayson=require(_0x64ee('0x7'));var client=jayson[_0x64ee('0x8')][_0x64ee('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x37107d,_0x1a3a5b,_0x5d5aa1){return new BPromise(function(_0x4342cc,_0x26f621){return client[_0x64ee('0xa')](_0x37107d,_0x5d5aa1)['then'](function(_0x81783e){logger['info'](_0x64ee('0xb'),_0x1a3a5b,_0x64ee('0xc'));logger[_0x64ee('0xd')](_0x64ee('0xe'),_0x1a3a5b,_0x64ee('0xc'),JSON['stringify'](_0x81783e));if(_0x81783e['error']){if(_0x81783e[_0x64ee('0xf')][_0x64ee('0x10')]===0x1f4){logger[_0x64ee('0xf')]('Setting,\x20%s,\x20%s',_0x1a3a5b,_0x81783e[_0x64ee('0xf')][_0x64ee('0x11')]);return _0x26f621(_0x81783e[_0x64ee('0xf')][_0x64ee('0x11')]);}logger[_0x64ee('0xf')](_0x64ee('0xb'),_0x1a3a5b,_0x81783e['error'][_0x64ee('0x11')]);return _0x4342cc(_0x81783e[_0x64ee('0xf')][_0x64ee('0x11')]);}else{logger[_0x64ee('0x12')](_0x64ee('0xb'),_0x1a3a5b,_0x64ee('0xc'));_0x4342cc(_0x81783e['result']['message']);}})['catch'](function(_0x3db294){logger[_0x64ee('0xf')](_0x64ee('0xb'),_0x1a3a5b,_0x3db294);_0x26f621(_0x3db294);});});} \ No newline at end of file +var _0x2531=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x9b6ef4,_0x4ba689){var _0x5a0763=function(_0x360cc3){while(--_0x360cc3){_0x9b6ef4['push'](_0x9b6ef4['shift']());}};_0x5a0763(++_0x4ba689);}(_0x2531,0x79));var _0x1253=function(_0x3205b9,_0x1604ff){_0x3205b9=_0x3205b9-0x0;var _0x34ca1a=_0x2531[_0x3205b9];return _0x34ca1a;};'use strict';var _=require(_0x1253('0x0'));var util=require('util');var moment=require(_0x1253('0x1'));var BPromise=require(_0x1253('0x2'));var rs=require(_0x1253('0x3'));var fs=require('fs');var Redis=require(_0x1253('0x4'));var db=require(_0x1253('0x5'))['db'];var utils=require(_0x1253('0x6'));var logger=require(_0x1253('0x7'))(_0x1253('0x8'));var config=require(_0x1253('0x9'));var jayson=require(_0x1253('0xa'));var client=jayson['client'][_0x1253('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1556f3,_0x59e87a,_0x5c045b){return new BPromise(function(_0x6af5a6,_0x7c3699){return client[_0x1253('0xc')](_0x1556f3,_0x5c045b)[_0x1253('0xd')](function(_0x45f260){logger[_0x1253('0xe')](_0x1253('0xf'),_0x59e87a,_0x1253('0x10'));logger[_0x1253('0x11')](_0x1253('0x12'),_0x59e87a,_0x1253('0x10'),JSON[_0x1253('0x13')](_0x45f260));if(_0x45f260[_0x1253('0x14')]){if(_0x45f260[_0x1253('0x14')]['code']===0x1f4){logger[_0x1253('0x14')](_0x1253('0xf'),_0x59e87a,_0x45f260[_0x1253('0x14')][_0x1253('0x15')]);return _0x7c3699(_0x45f260[_0x1253('0x14')][_0x1253('0x15')]);}logger[_0x1253('0x14')]('Setting,\x20%s,\x20%s',_0x59e87a,_0x45f260['error']['message']);return _0x6af5a6(_0x45f260[_0x1253('0x14')][_0x1253('0x15')]);}else{logger['info'](_0x1253('0xf'),_0x59e87a,_0x1253('0x10'));_0x6af5a6(_0x45f260[_0x1253('0x16')][_0x1253('0x15')]);}})[_0x1253('0x17')](function(_0x3f3e20){logger[_0x1253('0x14')](_0x1253('0xf'),_0x59e87a,_0x3f3e20);_0x7c3699(_0x3f3e20);});});} \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index b679eae..ec9266e 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 _0x36f3=['removeDispositions','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','isAuthenticated','index','get','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','post','create','addDisposition','addAnswer','notify','/:id/applications','addApplications','send','addAgents','put','update','delete','destroy'];(function(_0x157636,_0x218d7d){var _0x4cb4a8=function(_0x2e984b){while(--_0x2e984b){_0x157636['push'](_0x157636['shift']());}};_0x4cb4a8(++_0x218d7d);}(_0x36f3,0xe6));var _0x336f=function(_0x2c39f3,_0x30b582){_0x2c39f3=_0x2c39f3-0x0;var _0x33bb02=_0x36f3[_0x2c39f3];return _0x33bb02;};'use strict';var multer=require('multer');var util=require(_0x336f('0x0'));var path=require(_0x336f('0x1'));var timeout=require(_0x336f('0x2'));var express=require(_0x336f('0x3'));var router=express[_0x336f('0x4')]();var auth=require(_0x336f('0x5'));var interaction=require(_0x336f('0x6'));var config=require(_0x336f('0x7'));var controller=require(_0x336f('0x8'));router['get']('/',auth[_0x336f('0x9')](),controller[_0x336f('0xa')]);router[_0x336f('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x336f('0xc')]);router[_0x336f('0xb')](_0x336f('0xd'),auth[_0x336f('0x9')](),controller[_0x336f('0xe')]);router[_0x336f('0xb')](_0x336f('0xf'),auth[_0x336f('0x9')](),controller['getDispositions']);router[_0x336f('0xb')](_0x336f('0x10'),auth[_0x336f('0x9')](),controller[_0x336f('0x11')]);router['get']('/:id/applications',auth[_0x336f('0x9')](),controller['getApplications']);router[_0x336f('0xb')](_0x336f('0x12'),auth['isAuthenticated'](),controller[_0x336f('0x13')]);router[_0x336f('0xb')](_0x336f('0x14'),controller[_0x336f('0x15')]);router[_0x336f('0xb')](_0x336f('0x16'),auth[_0x336f('0x9')](),controller['getAgents']);router[_0x336f('0x17')]('/',auth[_0x336f('0x9')](),controller[_0x336f('0x18')]);router[_0x336f('0x17')]('/:id/dispositions',auth[_0x336f('0x9')](),controller[_0x336f('0x19')]);router[_0x336f('0x17')](_0x336f('0x10'),auth['isAuthenticated'](),controller[_0x336f('0x1a')]);router[_0x336f('0x17')]('/:id/notify',controller[_0x336f('0x1b')]);router[_0x336f('0x17')](_0x336f('0x1c'),auth['isAuthenticated'](),controller[_0x336f('0x1d')]);router[_0x336f('0x17')]('/:id/send',auth[_0x336f('0x9')](),controller[_0x336f('0x1e')]);router[_0x336f('0x17')](_0x336f('0x14'),controller['status']);router[_0x336f('0x17')](_0x336f('0x16'),auth[_0x336f('0x9')](),controller[_0x336f('0x1f')]);router[_0x336f('0x20')](_0x336f('0xd'),auth[_0x336f('0x9')](),controller[_0x336f('0x21')]);router[_0x336f('0x22')](_0x336f('0xd'),auth[_0x336f('0x9')](),controller[_0x336f('0x23')]);router[_0x336f('0x22')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x336f('0x24')]);router[_0x336f('0x22')](_0x336f('0x10'),auth[_0x336f('0x9')](),controller['removeAnswers']);router[_0x336f('0x22')](_0x336f('0x16'),auth[_0x336f('0x9')](),controller['removeAgents']);module[_0x336f('0x25')]=router; \ No newline at end of file +var _0xb8b2=['create','post','/:id/canned_answers','addAnswer','notify','addApplications','send','status','put','update','destroy','removeDispositions','delete','removeAgents','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','describe','/:id','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions','/:id/status','statusGet','/:id/users','getAgents'];(function(_0x44926c,_0xb988f1){var _0x418daa=function(_0x3b4b0a){while(--_0x3b4b0a){_0x44926c['push'](_0x44926c['shift']());}};_0x418daa(++_0xb988f1);}(_0xb8b2,0x9f));var _0x2b8b=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xb8b2[_0x297fd3];return _0x2af381;};'use strict';var multer=require('multer');var util=require(_0x2b8b('0x0'));var path=require('path');var timeout=require(_0x2b8b('0x1'));var express=require('express');var router=express[_0x2b8b('0x2')]();var auth=require(_0x2b8b('0x3'));var interaction=require(_0x2b8b('0x4'));var config=require(_0x2b8b('0x5'));var controller=require(_0x2b8b('0x6'));router[_0x2b8b('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0x2b8b('0x8')](),controller[_0x2b8b('0x9')]);router[_0x2b8b('0x7')](_0x2b8b('0xa'),auth[_0x2b8b('0x8')](),controller['show']);router['get'](_0x2b8b('0xb'),auth[_0x2b8b('0x8')](),controller[_0x2b8b('0xc')]);router['get']('/:id/canned_answers',auth[_0x2b8b('0x8')](),controller[_0x2b8b('0xd')]);router['get'](_0x2b8b('0xe'),auth[_0x2b8b('0x8')](),controller[_0x2b8b('0xf')]);router[_0x2b8b('0x7')](_0x2b8b('0x10'),auth[_0x2b8b('0x8')](),controller['getInteractions']);router[_0x2b8b('0x7')](_0x2b8b('0x11'),controller[_0x2b8b('0x12')]);router[_0x2b8b('0x7')](_0x2b8b('0x13'),auth['isAuthenticated'](),controller[_0x2b8b('0x14')]);router['post']('/',auth[_0x2b8b('0x8')](),controller[_0x2b8b('0x15')]);router[_0x2b8b('0x16')](_0x2b8b('0xb'),auth[_0x2b8b('0x8')](),controller['addDisposition']);router['post'](_0x2b8b('0x17'),auth[_0x2b8b('0x8')](),controller[_0x2b8b('0x18')]);router['post']('/:id/notify',controller[_0x2b8b('0x19')]);router[_0x2b8b('0x16')](_0x2b8b('0xe'),auth[_0x2b8b('0x8')](),controller[_0x2b8b('0x1a')]);router[_0x2b8b('0x16')]('/:id/send',auth[_0x2b8b('0x8')](),controller[_0x2b8b('0x1b')]);router[_0x2b8b('0x16')]('/:id/status',controller[_0x2b8b('0x1c')]);router['post'](_0x2b8b('0x13'),auth[_0x2b8b('0x8')](),controller['addAgents']);router[_0x2b8b('0x1d')](_0x2b8b('0xa'),auth[_0x2b8b('0x8')](),controller[_0x2b8b('0x1e')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x2b8b('0x1f')]);router['delete'](_0x2b8b('0xb'),auth[_0x2b8b('0x8')](),controller[_0x2b8b('0x20')]);router[_0x2b8b('0x21')](_0x2b8b('0x17'),auth[_0x2b8b('0x8')](),controller['removeAnswers']);router[_0x2b8b('0x21')](_0x2b8b('0x13'),auth[_0x2b8b('0x8')](),controller[_0x2b8b('0x22')]);module[_0x2b8b('0x23')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 1de649c..a35d59e 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 _0xf6ae=['clicksend','clickatell','csc','infobip','intelepeer','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','ENUM'];(function(_0x5cd253,_0x4162da){var _0x36e179=function(_0x597977){while(--_0x597977){_0x5cd253['push'](_0x5cd253['shift']());}};_0x36e179(++_0x4162da);}(_0xf6ae,0x107));var _0xef6a=function(_0x25e402,_0x5bfa8e){_0x25e402=_0x25e402-0x0;var _0x3d265d=_0xf6ae[_0x25e402];return _0x3d265d;};'use strict';var Sequelize=require(_0xef6a('0x0'));var rs=require(_0xef6a('0x1'));module[_0xef6a('0x2')]={'name':{'type':Sequelize[_0xef6a('0x3')],'unique':_0xef6a('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xef6a('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xef6a('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xef6a('0x3')],'defaultValue':function(){return rs[_0xef6a('0x5')]();}},'phone':{'type':Sequelize[_0xef6a('0x3')]},'type':{'type':Sequelize[_0xef6a('0x6')]('twilio','skebby','connectel',_0xef6a('0x7'),'plivo',_0xef6a('0x8'),_0xef6a('0x9'),_0xef6a('0xa'),_0xef6a('0xb'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0xef6a('0x3')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0xef6a('0x3')]},'senderString':{'type':Sequelize[_0xef6a('0x3')]},'deliveryReport':{'type':Sequelize[_0xef6a('0xc')],'defaultValue':![]},'description':{'type':Sequelize[_0xef6a('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xef6a('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xef6a('0xc')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xef6a('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xef6a('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xef6a('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xef6a('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xef6a('0xd')],'comment':_0xef6a('0xe')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xef6a('0xf'),'set':function(_0x2cfcce){if(!_0x2cfcce)this[_0xef6a('0x10')]('mandatoryDispositionPauseId',null);this[_0xef6a('0x10')](_0xef6a('0x11'),_0x2cfcce);}}}; \ No newline at end of file +var _0x2094=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','STRING','ENUM','twilio','skebby','connectel','clicksend','plivo','csc','infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER'];(function(_0x15ccc4,_0x1e00fc){var _0x5e376e=function(_0xcbc3bd){while(--_0xcbc3bd){_0x15ccc4['push'](_0x15ccc4['shift']());}};_0x5e376e(++_0x1e00fc);}(_0x2094,0x1c6));var _0x4209=function(_0x61063,_0x143a07){_0x61063=_0x61063-0x0;var _0x53a91f=_0x2094[_0x61063];return _0x53a91f;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x4209('0x0')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x4209('0x0')],'allowNull':![]},'remote':{'type':Sequelize[_0x4209('0x0')],'allowNull':![]},'token':{'type':Sequelize[_0x4209('0x0')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x4209('0x0')]},'type':{'type':Sequelize[_0x4209('0x1')](_0x4209('0x2'),_0x4209('0x3'),_0x4209('0x4'),_0x4209('0x5'),_0x4209('0x6'),'clickatell',_0x4209('0x7'),_0x4209('0x8'),_0x4209('0x9'))},'accountSid':{'type':Sequelize[_0x4209('0x0')]},'authId':{'type':Sequelize[_0x4209('0x0')]},'authToken':{'type':Sequelize[_0x4209('0x0')]},'smsMethod':{'type':Sequelize[_0x4209('0x1')]('SI','TI','GP')},'username':{'type':Sequelize[_0x4209('0x0')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0x4209('0x0')]},'deliveryReport':{'type':Sequelize[_0x4209('0xa')],'defaultValue':![]},'description':{'type':Sequelize[_0x4209('0x0')]},'notificationTemplate':{'type':Sequelize[_0x4209('0xb')],'defaultValue':function(){return _0x4209('0xc');}},'notificationSound':{'type':Sequelize[_0x4209('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4209('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4209('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x4209('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4209('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4209('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4209('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x4209('0x0')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4209('0xd')],'comment':_0x4209('0xe')},'mandatoryDisposition':{'type':Sequelize[_0x4209('0xa')],'defaultValue':![],'comment':_0x4209('0xf'),'set':function(_0x26fe66){if(!_0x26fe66)this[_0x4209('0x10')](_0x4209('0x11'),null);this[_0x4209('0x10')]('mandatoryDisposition',_0x26fe66);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 64e6a03..e9a86b4 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 _0x9443=['redif','DELIVERED','error_code','infobip','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','ACCEPTD','statusGet','csc','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','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','redis','localhost','./smsAccount.socket','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','offset','set','Content-Range','apply','reject','save','update','get','SmsAccounts','UserProfileResource','destroy','end','stack','name','send','index','mandatoryDispositionPause','SmsAccount','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','merge','map','type','key','filter','options','count','findAll','rows','show','params','Pause','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','SmsAccountId','Disposition','hasOwnProperty','includeAll','include','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','sms','SmsApplication','account','applications','orderBy','priority','Applications','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','twilio','From','messageId','MessageSid','skebby','from','text','connectel','clicksend','message_id','plivo','Text','results','originatingAddress','segmentedMessage','replyMessageId','refid','isNil','ValidationError','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','omit','defaults','contact','SmsInteraction','spread','interaction','created','autoclose','push','close','*,*,*,*','ContactId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','Content-Type','text/xml','json','addApplications','sequelize','bulkCreate','findAndCountAll','getApplications','findOne','getInteractions','Contact','Owner','fullname','internal','color','tag','to\x20is\x20mandatory','CmList','List','DESC','out','SmsMessage','dataValues','Messages','log','endpoint\x20/status\x20POST\x20/','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','groupName','clickatell','intelepeer'];(function(_0x455060,_0x515bdc){var _0x5ca1df=function(_0x399155){while(--_0x399155){_0x455060['push'](_0x455060['shift']());}};_0x5ca1df(++_0x515bdc);}(_0x9443,0xee));var _0x3944=function(_0x1ca890,_0x21d0d3){_0x1ca890=_0x1ca890-0x0;var _0x3f8e01=_0x9443[_0x1ca890];return _0x3f8e01;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x3944('0x0'));var zipdir=require(_0x3944('0x1'));var jsonpatch=require(_0x3944('0x2'));var rp=require('request-promise');var moment=require(_0x3944('0x3'));var BPromise=require(_0x3944('0x4'));var Mustache=require('mustache');var util=require(_0x3944('0x5'));var path=require(_0x3944('0x6'));var sox=require(_0x3944('0x7'));var csv=require(_0x3944('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3944('0x9'));var squel=require(_0x3944('0xa'));var crypto=require(_0x3944('0xb'));var jsforce=require(_0x3944('0xc'));var deskjs=require(_0x3944('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3944('0xe'));var Papa=require(_0x3944('0xf'));var Redis=require('ioredis');var authService=require(_0x3944('0x10'));var qs=require(_0x3944('0x11'));var hardwareService=require(_0x3944('0x12'));var logger=require(_0x3944('0x13'))(_0x3944('0x14'));var utils=require(_0x3944('0x15'));var config=require(_0x3944('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x3944('0x17')],{'host':_0x3944('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3944('0x17')]));require(_0x3944('0x19'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});function checkPasswordPattern(_0x3313fc,_0x11fc1f,_0x29ac32){if(_0x29ac32){var _0x2ea368=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2ea368[_0x3944('0x1a')](_0x11fc1f)){return _0x3313fc;}else{throw new Error(_0x3944('0x1b'));}}else{return _0x3313fc;}}function respondWithRpcPromise(_0x1b5364,_0x4a836d,_0x453b52,_0x95a3a1){return new BPromise(function(_0x3a235d,_0x4a54f3){var _0x2203fd=_0x95a3a1||client;return _0x2203fd[_0x3944('0x1c')](_0x1b5364,_0x453b52)[_0x3944('0x1d')](function(_0xaee6cf){logger[_0x3944('0x1e')](_0x3944('0x1f'),_0x4a836d,_0x3944('0x20'));logger[_0x3944('0x21')](_0x3944('0x22'),_0x4a836d,_0x3944('0x20'),JSON[_0x3944('0x23')](_0xaee6cf));if(_0xaee6cf[_0x3944('0x24')]){if(_0xaee6cf[_0x3944('0x24')]['code']===0x1f4){logger[_0x3944('0x24')](_0x3944('0x1f'),_0x4a836d,_0xaee6cf[_0x3944('0x24')][_0x3944('0x25')]);return _0x4a54f3(_0xaee6cf[_0x3944('0x24')][_0x3944('0x25')]);}logger[_0x3944('0x24')](_0x3944('0x1f'),_0x4a836d,_0xaee6cf[_0x3944('0x24')]['message']);return _0x3a235d(_0xaee6cf[_0x3944('0x24')][_0x3944('0x25')]);}else{logger[_0x3944('0x1e')](_0x3944('0x1f'),_0x4a836d,'request\x20sent');_0x3a235d(_0xaee6cf[_0x3944('0x26')][_0x3944('0x25')]);}})[_0x3944('0x27')](function(_0x1f0c4e){logger[_0x3944('0x24')]('SmsAccount,\x20%s,\x20%s',_0x4a836d,_0x1f0c4e);_0x4a54f3(_0x1f0c4e);});});}function respondWithStatusCode(_0x130a67,_0x3c0504){_0x3c0504=_0x3c0504||0xcc;return function(_0x341565){if(_0x341565){return _0x130a67[_0x3944('0x28')](_0x3c0504);}return _0x130a67[_0x3944('0x29')](_0x3c0504)['end']();};}function respondWithResult(_0x5b80c2,_0xaaaa9b){_0xaaaa9b=_0xaaaa9b||0xc8;return function(_0x514a70){if(_0x514a70){return _0x5b80c2[_0x3944('0x29')](_0xaaaa9b)['json'](_0x514a70);}};}function respondWithFilteredResult(_0x1c2d19,_0x1fe1b9){return function(_0x5eb31d){if(_0x5eb31d){var _0x34efdb=_0x5eb31d['count'],_0x28e8ef=_0x1fe1b9[_0x3944('0x2a')],_0x2aa884=_0x1fe1b9[_0x3944('0x2a')]+_0x1fe1b9['limit'],_0x8c40ad;if(_0x2aa884>=_0x34efdb){_0x2aa884=_0x34efdb;_0x8c40ad=0xc8;}else{_0x8c40ad=0xce;}_0x1c2d19[_0x3944('0x29')](_0x8c40ad);return _0x1c2d19[_0x3944('0x2b')](_0x3944('0x2c'),_0x28e8ef+'-'+_0x2aa884+'/'+_0x34efdb)['json'](_0x5eb31d);}return null;};}function patchUpdates(_0x2fdafe){return function(_0x12f1b6){try{jsonpatch[_0x3944('0x2d')](_0x12f1b6,_0x2fdafe,!![]);}catch(_0x4642c3){return BPromise[_0x3944('0x2e')](_0x4642c3);}return _0x12f1b6[_0x3944('0x2f')]();};}function saveUpdates(_0xd85344,_0xab2467){return function(_0x3e476f){if(_0x3e476f){return _0x3e476f[_0x3944('0x30')](_0xd85344)[_0x3944('0x1d')](function(_0x77f0a7){return _0x77f0a7;});}return null;};}function removeEntity(_0xcbab2e,_0x427890){return function(_0x49b6a1){if(_0x49b6a1){return _0x49b6a1['destroy']()[_0x3944('0x1d')](function(){var _0x469cda=_0x49b6a1[_0x3944('0x31')]({'plain':!![]});var _0x27a57c=_0x3944('0x32');return db[_0x3944('0x33')][_0x3944('0x34')]({'where':{'type':_0x27a57c,'resourceId':_0x469cda['id']}})['then'](function(){return _0x49b6a1;});})[_0x3944('0x1d')](function(){_0xcbab2e[_0x3944('0x29')](0xcc)[_0x3944('0x35')]();});}};}function handleEntityNotFound(_0x3f40e8,_0x582034){return function(_0x1218f3){if(!_0x1218f3){_0x3f40e8[_0x3944('0x28')](0x194);}return _0x1218f3;};}function handleError(_0x53f82a,_0x51087c){_0x51087c=_0x51087c||0x1f4;return function(_0x5ae651){logger[_0x3944('0x24')](_0x5ae651[_0x3944('0x36')]);if(_0x5ae651[_0x3944('0x37')]){delete _0x5ae651['name'];}_0x53f82a[_0x3944('0x29')](_0x51087c)[_0x3944('0x38')](_0x5ae651);};}exports[_0x3944('0x39')]=function(_0x5bbbcf,_0x262526){var _0x15bc4d={'include':[{'model':db['Pause'],'as':_0x3944('0x3a')}]},_0x496cc0={},_0x14a996={'count':0x0,'rows':[]};var _0x58c2c3=db[_0x3944('0x3b')]['rawAttributes'];_0x496cc0[_0x3944('0x3c')]=_[_0x3944('0x3d')](_0x58c2c3);_0x496cc0[_0x3944('0x3e')]=_[_0x3944('0x3d')](_0x5bbbcf['query']);_0x496cc0[_0x3944('0x3f')]=_[_0x3944('0x40')](_0x496cc0[_0x3944('0x3c')],_0x496cc0[_0x3944('0x3e')]);_0x15bc4d[_0x3944('0x41')]=_[_0x3944('0x40')](_0x496cc0['model'],qs[_0x3944('0x42')](_0x5bbbcf['query'][_0x3944('0x42')]));_0x15bc4d[_0x3944('0x41')]=_0x15bc4d[_0x3944('0x41')][_0x3944('0x43')]?_0x15bc4d[_0x3944('0x41')]:_0x496cc0[_0x3944('0x3c')];if(!_0x5bbbcf['query']['hasOwnProperty'](_0x3944('0x44'))){_0x15bc4d[_0x3944('0x45')]=qs[_0x3944('0x45')](_0x5bbbcf[_0x3944('0x3e')][_0x3944('0x45')]);_0x15bc4d[_0x3944('0x2a')]=qs[_0x3944('0x2a')](_0x5bbbcf['query'][_0x3944('0x2a')]);}_0x15bc4d[_0x3944('0x46')]=qs[_0x3944('0x47')](_0x5bbbcf['query'][_0x3944('0x47')]);_0x15bc4d[_0x3944('0x48')]=qs[_0x3944('0x3f')](_[_0x3944('0x49')](_0x5bbbcf['query'],_0x496cc0['filters']));if(_0x5bbbcf[_0x3944('0x3e')]['filter']){_0x15bc4d[_0x3944('0x48')]=_[_0x3944('0x4a')](_0x15bc4d[_0x3944('0x48')],{'$or':_[_0x3944('0x4b')](_0x58c2c3,function(_0x125263){if(_0x125263[_0x3944('0x4c')][_0x3944('0x4d')]!=='VIRTUAL'){var _0x1249b8={};_0x1249b8[_0x125263['field']]={'$like':'%'+_0x5bbbcf[_0x3944('0x3e')][_0x3944('0x4e')]+'%'};return _0x1249b8;}})});}_0x15bc4d=_[_0x3944('0x4a')]({},_0x15bc4d,_0x5bbbcf[_0x3944('0x4f')]);var _0x3f3584={'where':_0x15bc4d[_0x3944('0x48')]};return db['SmsAccount'][_0x3944('0x50')](_0x3f3584)[_0x3944('0x1d')](function(_0x1584ff){_0x14a996[_0x3944('0x50')]=_0x1584ff;if(_0x5bbbcf[_0x3944('0x3e')]['includeAll']){_0x15bc4d['include']=[{'all':!![]}];}return db['SmsAccount'][_0x3944('0x51')](_0x15bc4d);})[_0x3944('0x1d')](function(_0x13f720){_0x14a996[_0x3944('0x52')]=_0x13f720;return _0x14a996;})['then'](respondWithFilteredResult(_0x262526,_0x15bc4d))[_0x3944('0x27')](handleError(_0x262526,null));};exports[_0x3944('0x53')]=function(_0x521e67,_0x5a7345){var _0x258ca4={'raw':![],'where':{'id':_0x521e67[_0x3944('0x54')]['id']},'include':[{'model':db[_0x3944('0x55')],'as':_0x3944('0x3a')}]},_0x2e5775={};_0x2e5775[_0x3944('0x3c')]=_[_0x3944('0x3d')](db[_0x3944('0x3b')][_0x3944('0x56')]);_0x2e5775[_0x3944('0x3e')]=_['keys'](_0x521e67[_0x3944('0x3e')]);_0x2e5775[_0x3944('0x3f')]=_['intersection'](_0x2e5775[_0x3944('0x3c')],_0x2e5775[_0x3944('0x3e')]);_0x258ca4[_0x3944('0x41')]=_['intersection'](_0x2e5775[_0x3944('0x3c')],qs[_0x3944('0x42')](_0x521e67[_0x3944('0x3e')]['fields']));_0x258ca4[_0x3944('0x41')]=_0x258ca4['attributes'][_0x3944('0x43')]?_0x258ca4[_0x3944('0x41')]:_0x2e5775[_0x3944('0x3c')];if(_0x521e67[_0x3944('0x3e')]['includeAll']){_0x258ca4['include']=[{'all':!![]}];}_0x258ca4=_[_0x3944('0x4a')]({},_0x258ca4,_0x521e67[_0x3944('0x4f')]);return db[_0x3944('0x3b')]['find'](_0x258ca4)[_0x3944('0x1d')](handleEntityNotFound(_0x5a7345,null))['then'](respondWithResult(_0x5a7345,null))[_0x3944('0x27')](handleError(_0x5a7345,null));};exports[_0x3944('0x57')]=function(_0x211ec4,_0x25ff2a){return db[_0x3944('0x3b')][_0x3944('0x57')](_0x211ec4[_0x3944('0x58')],{})['then'](function(_0x2d5892){var _0x6c4cf0=_0x211ec4[_0x3944('0x59')][_0x3944('0x31')]({'plain':!![]});if(!_0x6c4cf0)throw new Error(_0x3944('0x5a'));if(_0x6c4cf0['role']==='user'){var _0x51c7eb=_0x2d5892[_0x3944('0x31')]({'plain':!![]});var _0x313f46=_0x3944('0x32');return db['UserProfileSection'][_0x3944('0x5b')]({'where':{'name':_0x313f46,'userProfileId':_0x6c4cf0['userProfileId']},'raw':!![]})['then'](function(_0x13bda2){if(_0x13bda2&&_0x13bda2['autoAssociation']===0x0){return db[_0x3944('0x33')][_0x3944('0x57')]({'name':_0x51c7eb[_0x3944('0x37')],'resourceId':_0x51c7eb['id'],'type':_0x13bda2[_0x3944('0x37')],'sectionId':_0x13bda2['id']},{})[_0x3944('0x1d')](function(){return _0x2d5892;});}else{return _0x2d5892;}})[_0x3944('0x27')](function(_0x31cc45){logger[_0x3944('0x24')](_0x3944('0x5c'),_0x31cc45);throw _0x31cc45;});}return _0x2d5892;})[_0x3944('0x1d')](respondWithResult(_0x25ff2a,0xc9))['catch'](handleError(_0x25ff2a,null));};exports[_0x3944('0x30')]=function(_0x3272c2,_0x36c361){if(_0x3272c2[_0x3944('0x58')]['id']){delete _0x3272c2[_0x3944('0x58')]['id'];}return db[_0x3944('0x3b')]['find']({'where':{'id':_0x3272c2[_0x3944('0x54')]['id']},'include':[{'model':db[_0x3944('0x55')],'as':_0x3944('0x3a')}]})['then'](handleEntityNotFound(_0x36c361,null))[_0x3944('0x1d')](saveUpdates(_0x3272c2[_0x3944('0x58')],null))[_0x3944('0x1d')](respondWithResult(_0x36c361,null))[_0x3944('0x27')](handleError(_0x36c361,null));};exports['destroy']=function(_0x508b8d,_0x22380a){return db[_0x3944('0x3b')][_0x3944('0x5b')]({'where':{'id':_0x508b8d[_0x3944('0x54')]['id']}})[_0x3944('0x1d')](handleEntityNotFound(_0x22380a,null))[_0x3944('0x1d')](removeEntity(_0x22380a,null))[_0x3944('0x27')](handleError(_0x22380a,null));};exports[_0x3944('0x5d')]=function(_0x490043,_0x40766e){return db[_0x3944('0x3b')][_0x3944('0x5d')]()[_0x3944('0x1d')](respondWithResult(_0x40766e,null))[_0x3944('0x27')](handleError(_0x40766e,null));};exports[_0x3944('0x5e')]=function(_0x4dcf01,_0x240d15,_0x3a3ea3){if(_0x4dcf01['body']['id']){delete _0x4dcf01[_0x3944('0x58')]['id'];}return db['SmsAccount'][_0x3944('0x5b')]({'where':{'id':_0x4dcf01[_0x3944('0x54')]['id']}})['then'](handleEntityNotFound(_0x240d15,null))[_0x3944('0x1d')](function(_0x4c4c7e){if(_0x4c4c7e){_0x4dcf01[_0x3944('0x58')][_0x3944('0x5f')]=_0x4c4c7e['id'];return db[_0x3944('0x60')][_0x3944('0x57')](_0x4dcf01['body']);}})[_0x3944('0x1d')](respondWithResult(_0x240d15,null))[_0x3944('0x27')](handleError(_0x240d15,null));};exports['getDispositions']=function(_0x294d0a,_0x2de6ac,_0x211c11){var _0x2662ac={'raw':![],'where':{}};var _0x223e21={};var _0x22163f={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x294d0a[_0x3944('0x54')]['id']}})[_0x3944('0x1d')](handleEntityNotFound(_0x2de6ac,null))['then'](function(_0x570532){if(_0x570532){_0x223e21['model']=_[_0x3944('0x3d')](db[_0x3944('0x60')]['rawAttributes']);_0x223e21[_0x3944('0x3e')]=_[_0x3944('0x3d')](_0x294d0a[_0x3944('0x3e')]);_0x223e21[_0x3944('0x3f')]=_[_0x3944('0x40')](_0x223e21[_0x3944('0x3c')],_0x223e21[_0x3944('0x3e')]);_0x2662ac[_0x3944('0x41')]=_[_0x3944('0x40')](_0x223e21[_0x3944('0x3c')],qs[_0x3944('0x42')](_0x294d0a[_0x3944('0x3e')][_0x3944('0x42')]));_0x2662ac[_0x3944('0x41')]=_0x2662ac['attributes'][_0x3944('0x43')]?_0x2662ac['attributes']:_0x223e21[_0x3944('0x3c')];if(!_0x294d0a[_0x3944('0x3e')][_0x3944('0x61')](_0x3944('0x44'))){_0x2662ac[_0x3944('0x45')]=qs[_0x3944('0x45')](_0x294d0a[_0x3944('0x3e')]['limit']);_0x2662ac['offset']=qs[_0x3944('0x2a')](_0x294d0a[_0x3944('0x3e')]['offset']);}_0x2662ac[_0x3944('0x46')]=qs[_0x3944('0x47')](_0x294d0a[_0x3944('0x3e')][_0x3944('0x47')]);_0x2662ac[_0x3944('0x48')]=qs['filters'](_[_0x3944('0x49')](_0x294d0a['query'],_0x223e21[_0x3944('0x3f')]));_0x2662ac[_0x3944('0x48')][_0x3944('0x5f')]=_0x570532['id'];if(_0x294d0a[_0x3944('0x3e')][_0x3944('0x4e')]){_0x2662ac[_0x3944('0x48')]=_[_0x3944('0x4a')](_0x2662ac['where'],{'$or':_[_0x3944('0x4b')](_0x2662ac['attributes'],function(_0x4d28e9){var _0x2f84db={};_0x2f84db[_0x4d28e9]={'$like':'%'+_0x294d0a['query'][_0x3944('0x4e')]+'%'};return _0x2f84db;})});}_0x2662ac=_[_0x3944('0x4a')]({},_0x2662ac,_0x294d0a[_0x3944('0x4f')]);return db[_0x3944('0x60')][_0x3944('0x50')]({'where':_0x2662ac[_0x3944('0x48')]})[_0x3944('0x1d')](function(_0x5ddba9){_0x22163f[_0x3944('0x50')]=_0x5ddba9;if(_0x294d0a[_0x3944('0x3e')][_0x3944('0x62')]){_0x2662ac[_0x3944('0x63')]=[{'all':!![]}];}return db['Disposition'][_0x3944('0x51')](_0x2662ac);})['then'](function(_0x2f6daa){_0x22163f[_0x3944('0x52')]=_0x2f6daa;return _0x22163f;});}})['then'](respondWithFilteredResult(_0x2de6ac,_0x2662ac))[_0x3944('0x27')](handleError(_0x2de6ac,null));};exports[_0x3944('0x64')]=function(_0x16c041,_0x2fbdc5,_0xfd78e4){return db[_0x3944('0x3b')]['find']({'where':{'id':_0x16c041[_0x3944('0x54')]['id']}})[_0x3944('0x1d')](handleEntityNotFound(_0x2fbdc5,null))[_0x3944('0x1d')](function(_0x39322a){if(_0x39322a){return _0x39322a[_0x3944('0x64')](_0x16c041[_0x3944('0x3e')]['ids']);}})['then'](respondWithStatusCode(_0x2fbdc5,null))[_0x3944('0x27')](handleError(_0x2fbdc5,null));};exports[_0x3944('0x65')]=function(_0x5c627c,_0x21d850,_0x69a9da){if(_0x5c627c['body']['id']){delete _0x5c627c[_0x3944('0x58')]['id'];}return db['SmsAccount'][_0x3944('0x5b')]({'where':{'id':_0x5c627c[_0x3944('0x54')]['id']}})[_0x3944('0x1d')](handleEntityNotFound(_0x21d850,null))[_0x3944('0x1d')](function(_0x41de8c){if(_0x41de8c){_0x5c627c[_0x3944('0x58')]['SmsAccountId']=_0x41de8c['id'];return db[_0x3944('0x66')][_0x3944('0x57')](_0x5c627c[_0x3944('0x58')]);}})[_0x3944('0x1d')](respondWithResult(_0x21d850,null))[_0x3944('0x27')](handleError(_0x21d850,null));};exports[_0x3944('0x67')]=function(_0x610cc2,_0x429c6c,_0x1ee827){var _0x40918e={'raw':![],'where':{}};var _0x5c7751={};var _0x243e77={'count':0x0,'rows':[]};return db[_0x3944('0x3b')]['findOne']({'where':{'id':_0x610cc2[_0x3944('0x54')]['id']}})['then'](handleEntityNotFound(_0x429c6c,null))[_0x3944('0x1d')](function(_0x10cc61){if(_0x10cc61){_0x5c7751[_0x3944('0x3c')]=_['keys'](db[_0x3944('0x66')][_0x3944('0x56')]);_0x5c7751[_0x3944('0x3e')]=_[_0x3944('0x3d')](_0x610cc2[_0x3944('0x3e')]);_0x5c7751[_0x3944('0x3f')]=_[_0x3944('0x40')](_0x5c7751[_0x3944('0x3c')],_0x5c7751[_0x3944('0x3e')]);_0x40918e[_0x3944('0x41')]=_['intersection'](_0x5c7751[_0x3944('0x3c')],qs[_0x3944('0x42')](_0x610cc2['query'][_0x3944('0x42')]));_0x40918e[_0x3944('0x41')]=_0x40918e['attributes'][_0x3944('0x43')]?_0x40918e[_0x3944('0x41')]:_0x5c7751['model'];if(!_0x610cc2[_0x3944('0x3e')][_0x3944('0x61')](_0x3944('0x44'))){_0x40918e[_0x3944('0x45')]=qs[_0x3944('0x45')](_0x610cc2[_0x3944('0x3e')][_0x3944('0x45')]);_0x40918e[_0x3944('0x2a')]=qs[_0x3944('0x2a')](_0x610cc2[_0x3944('0x3e')][_0x3944('0x2a')]);}_0x40918e[_0x3944('0x46')]=qs[_0x3944('0x47')](_0x610cc2[_0x3944('0x3e')]['sort']);_0x40918e['where']=qs['filters'](_[_0x3944('0x49')](_0x610cc2[_0x3944('0x3e')],_0x5c7751['filters']));_0x40918e['where'][_0x3944('0x5f')]=_0x10cc61['id'];if(_0x610cc2[_0x3944('0x3e')]['filter']){_0x40918e['where']=_['merge'](_0x40918e[_0x3944('0x48')],{'$or':_[_0x3944('0x4b')](_0x40918e['attributes'],function(_0x2d88a5){var _0x507d1c={};_0x507d1c[_0x2d88a5]={'$like':'%'+_0x610cc2[_0x3944('0x3e')][_0x3944('0x4e')]+'%'};return _0x507d1c;})});}_0x40918e=_[_0x3944('0x4a')]({},_0x40918e,_0x610cc2['options']);return db[_0x3944('0x66')][_0x3944('0x50')]({'where':_0x40918e[_0x3944('0x48')]})[_0x3944('0x1d')](function(_0x13e4e5){_0x243e77[_0x3944('0x50')]=_0x13e4e5;if(_0x610cc2['query'][_0x3944('0x62')]){_0x40918e[_0x3944('0x63')]=[{'all':!![]}];}return db[_0x3944('0x66')][_0x3944('0x51')](_0x40918e);})[_0x3944('0x1d')](function(_0x5d061e){_0x243e77[_0x3944('0x52')]=_0x5d061e;return _0x243e77;});}})[_0x3944('0x1d')](respondWithFilteredResult(_0x429c6c,_0x40918e))[_0x3944('0x27')](handleError(_0x429c6c,null));};exports[_0x3944('0x68')]=function(_0x9fad0,_0xc74483,_0x546e92){return db[_0x3944('0x3b')][_0x3944('0x5b')]({'where':{'id':_0x9fad0[_0x3944('0x54')]['id']}})[_0x3944('0x1d')](handleEntityNotFound(_0xc74483,null))[_0x3944('0x1d')](function(_0x47a7a6){if(_0x47a7a6){return _0x47a7a6['removeAnswers'](_0x9fad0[_0x3944('0x3e')][_0x3944('0x69')]);}})['then'](respondWithStatusCode(_0xc74483,null))['catch'](handleError(_0xc74483,null));};exports['notify']=function(_0xd7f786,_0x213561,_0x232175){var _0x4c855d={'channel':_0x3944('0x6a')};var _0x2ea1b4=[];var _0x14c6ff=[];var _0xea32a0={};return db[_0x3944('0x3b')]['find']({'where':{'id':_0xd7f786[_0x3944('0x54')]['id']},'include':[{'model':db[_0x3944('0x6b')],'as':'Applications'}]})['then'](handleEntityNotFound(_0x213561,null))[_0x3944('0x1d')](function(_0xcda194){_0x4c855d[_0x3944('0x6c')]=_0xcda194;_0x4c855d[_0x3944('0x6d')]=_[_0x3944('0x6e')](_0xcda194['Applications'],[_0x3944('0x6f')],['asc']);if(_0x4c855d[_0x3944('0x6c')]['Applications']){delete _0x4c855d[_0x3944('0x6c')][_0x3944('0x70')];}return db[_0x3944('0x71')][_0x3944('0x5d')]();})[_0x3944('0x1d')](function(_0xf1ed55){if(!_0xf1ed55){throw new db[(_0x3944('0x72'))]['ValidationError'](_0x3944('0x73'));}_0x2ea1b4=_[_0x3944('0x74')](_['keys'](_0xf1ed55),[_0x3944('0x75'),_0x3944('0x76')]);_0x14c6ff=_[_0x3944('0x74')](_['keys'](_0xf1ed55),[_0x3944('0x75'),_0x3944('0x76'),_0x3944('0x77'),'ListId']);_0x4c855d['body']={'mapKey':_0x3944('0x78')};if(_0x4c855d[_0x3944('0x6c')]['type']){switch(_0x4c855d[_0x3944('0x6c')][_0x3944('0x4c')]){case _0x3944('0x79'):_0x4c855d['body']['from']=_0xd7f786[_0x3944('0x58')][_0x3944('0x7a')];_0x4c855d[_0x3944('0x58')][_0x3944('0x58')]=_0xd7f786['body']['Body'];_0x4c855d[_0x3944('0x58')][_0x3944('0x7b')]=_0xd7f786[_0x3944('0x58')][_0x3944('0x7c')];break;case _0x3944('0x7d'):_0x4c855d[_0x3944('0x58')][_0x3944('0x7e')]='+'+_0xd7f786['body']['sender'];_0x4c855d[_0x3944('0x58')]['body']=_0xd7f786[_0x3944('0x58')][_0x3944('0x7f')];break;case _0x3944('0x80'):_0x4c855d['body'][_0x3944('0x7e')]=_0xd7f786[_0x3944('0x58')][_0x3944('0x7e')];_0x4c855d[_0x3944('0x58')][_0x3944('0x58')]=_0xd7f786[_0x3944('0x58')][_0x3944('0x25')];break;case _0x3944('0x81'):_0x4c855d[_0x3944('0x58')][_0x3944('0x7e')]=_0xd7f786['body'][_0x3944('0x7e')];_0x4c855d[_0x3944('0x58')][_0x3944('0x58')]=_0xd7f786[_0x3944('0x58')]['body'];_0x4c855d[_0x3944('0x58')][_0x3944('0x7b')]=_0xd7f786[_0x3944('0x58')][_0x3944('0x82')];break;case _0x3944('0x83'):_0x4c855d[_0x3944('0x58')][_0x3944('0x7e')]=_0xd7f786['body'][_0x3944('0x7a')];_0x4c855d['body'][_0x3944('0x58')]=_0xd7f786[_0x3944('0x58')][_0x3944('0x84')];_0x4c855d[_0x3944('0x58')][_0x3944('0x7b')]=_0xd7f786[_0x3944('0x58')]['MessageUUID'];break;case'infobip':_0x4c855d[_0x3944('0x58')][_0x3944('0x7e')]='+'+_0xd7f786['body']['results'][0x0][_0x3944('0x7e')];_0x4c855d[_0x3944('0x58')]['body']=_0xd7f786[_0x3944('0x58')][_0x3944('0x85')][0x0][_0x3944('0x7f')];_0x4c855d[_0x3944('0x58')][_0x3944('0x7b')]=_0xd7f786['body']['results'][0x0]['messageId'];break;case'csc':_0x4c855d[_0x3944('0x58')][_0x3944('0x7e')]=_0xd7f786[_0x3944('0x58')][_0x3944('0x86')];_0x4c855d[_0x3944('0x58')][_0x3944('0x58')]=_0xd7f786[_0x3944('0x58')][_0x3944('0x87')][_0x3944('0x25')];break;case'clickatell':_0x4c855d[_0x3944('0x58')][_0x3944('0x7e')]=_0xd7f786[_0x3944('0x58')]['fromNumber'];_0x4c855d['body'][_0x3944('0x58')]=_0xd7f786[_0x3944('0x58')][_0x3944('0x7f')];_0x4c855d[_0x3944('0x58')][_0x3944('0x7b')]=_0xd7f786['body'][_0x3944('0x88')];break;case'intelepeer':_0x4c855d[_0x3944('0x58')]['from']=_0xd7f786[_0x3944('0x58')][_0x3944('0x7e')];_0x4c855d[_0x3944('0x58')][_0x3944('0x58')]=_0xd7f786[_0x3944('0x58')][_0x3944('0x25')];_0x4c855d[_0x3944('0x58')][_0x3944('0x7b')]=_0xd7f786[_0x3944('0x58')][_0x3944('0x89')];break;}}if(_0x4c855d[_0x3944('0x58')]['id']){delete _0x4c855d[_0x3944('0x58')]['id'];}if(_[_0x3944('0x8a')](_0x4c855d[_0x3944('0x58')][_0x3944('0x7e')])){throw new db['Sequelize'][(_0x3944('0x8b'))](_0x3944('0x8c'));}if(_['isNil'](_0x4c855d[_0x3944('0x58')][_0x3944('0x58')])||_0x4c855d[_0x3944('0x58')][_0x3944('0x58')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x3944('0x8a')](_0x4c855d[_0x3944('0x58')][_0x3944('0x8d')])){throw new db[(_0x3944('0x72'))][(_0x3944('0x8b'))](_0x3944('0x8e')+_0x14c6ff);}if(!_[_0x3944('0x8f')](_0x14c6ff,_0x4c855d[_0x3944('0x58')][_0x3944('0x8d')])){throw new db[(_0x3944('0x72'))][(_0x3944('0x8b'))](_0x3944('0x90')+_0x14c6ff);}_0xea32a0[_0x4c855d[_0x3944('0x58')][_0x3944('0x8d')]]=_0x4c855d['body'][_0x3944('0x7e')];return db['CmList'][_0x3944('0x5b')]({'where':{'id':_0x4c855d[_0x3944('0x6c')]['ListId']},'include':[{'model':db[_0x3944('0x71')],'as':_0x3944('0x91'),'where':_0xea32a0,'limit':0x1,'order':[['updatedAt','DESC']]}]});})[_0x3944('0x1d')](handleEntityNotFound(_0x213561,null))['then'](function(_0x30c9a7){if(_0x30c9a7){_0x4c855d['list']=_[_0x3944('0x92')](_0x30c9a7,['Contacts']);if(_0x30c9a7[_0x3944('0x91')][_0x3944('0x43')]){return _0x30c9a7[_0x3944('0x91')][0x0];}var _0x55d918=_[_0x3944('0x93')](_0x4c855d[_0x3944('0x58')],{'firstName':_0x4c855d[_0x3944('0x58')][_0x3944('0x7e')],'ListId':_0x30c9a7['id']});_0x55d918[_0x4c855d['body'][_0x3944('0x8d')]]=_0x4c855d['body']['from'];return db[_0x3944('0x71')]['create'](_0x55d918,{'fields':_0x2ea1b4,'raw':!![]});}})[_0x3944('0x1d')](handleEntityNotFound(_0x213561,null))[_0x3944('0x1d')](function(_0x36ff64){if(_0x36ff64){_0x4c855d[_0x3944('0x94')]=_0x36ff64;var _0x15b176={'ContactId':_0x36ff64['id'],'phone':_0x4c855d[_0x3944('0x58')][_0x3944('0x7e')],'SmsAccountId':_0xd7f786[_0x3944('0x54')]['id']};var _0x1cab6e={'ContactId':_0x36ff64['id'],'SmsAccountId':_0xd7f786[_0x3944('0x54')]['id'],'closed':![]};return db['SmsInteraction']['find']({'where':_0x1cab6e})['then'](function(_0xcfc0dc){if(_0xcfc0dc){return[_0xcfc0dc,![]];}return db[_0x3944('0x95')]['create'](_0x15b176)[_0x3944('0x1d')](function(_0x3e15ef){return[_0x3e15ef,!![]];});});}})[_0x3944('0x96')](function(_0x5cadd4,_0x23be8d){_0x4c855d[_0x3944('0x97')]=_0x5cadd4[_0x3944('0x31')]({'plain':!![]});_0x4c855d[_0x3944('0x97')][_0x3944('0x98')]=![];if(_0x23be8d){if(_0x4c855d[_0x3944('0x6c')][_0x3944('0x99')]){_0x4c855d[_0x3944('0x6d')][_0x3944('0x9a')]({'id':0x0,'priority':_0x4c855d['applications']['length']+0x1,'app':_0x3944('0x9b'),'appdata':'unmanaged','interval':_0x3944('0x9c')});}_0x4c855d[_0x3944('0x97')][_0x3944('0x98')]=!![];}return db['SmsMessage'][_0x3944('0x57')]({'phone':_0x4c855d[_0x3944('0x58')][_0x3944('0x7e')],'messageId':_0x4c855d[_0x3944('0x58')][_0x3944('0x7b')],'body':_0x4c855d[_0x3944('0x58')][_0x3944('0x58')],'SmsAccountId':_0xd7f786[_0x3944('0x54')]['id'],'SmsInteractionId':_0x5cadd4['id'],'direction':'in','ContactId':_0x5cadd4[_0x3944('0x9d')],'AttachmentId':_0x4c855d[_0x3944('0x58')]['AttachmentId']});})['then'](function(_0x1fb09e){_0x4c855d['message']=_0x1fb09e;if(_0x4c855d[_0x3944('0x97')][_0x3944('0x9e')]){return db[_0x3944('0x9f')][_0x3944('0x5b')]({'attributes':['id',_0x3944('0x37')],'where':{'id':_0x4c855d[_0x3944('0x97')][_0x3944('0x9e')]}})[_0x3944('0x1d')](function(_0x48a3bd){if(_0x48a3bd){_0x4c855d[_0x3944('0x6d')][_0x3944('0xa0')]({'id':0x0,'priority':0x0,'app':_0x3944('0xa1'),'appdata':_0x48a3bd[_0x3944('0x37')]+','+(_0x4c855d['account'][_0x3944('0xa2')]||0xa),'interval':_0x3944('0x9c')});}return respondWithRpcPromise(_0x3944('0xa3'),'startRouting',_0x4c855d);});}return respondWithRpcPromise(_0x3944('0xa3'),_0x3944('0xa4'),_0x4c855d);})[_0x3944('0x1d')](function(_0x5bf617){if(_0x5bf617){var _0x5e16ac=0xc8;var _0x66e82a=_0x3944('0xa5');logger[_0x3944('0x1e')](_0x3944('0x22'),_0x66e82a,_0x5e16ac,_0x3944('0xa6'));logger[_0x3944('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x66e82a,_0x5e16ac,_0x3944('0xa6'),JSON[_0x3944('0x23')](_0x5bf617));if(_0x4c855d['account'][_0x3944('0x4c')]==='twilio'){return _0x213561[_0x3944('0x29')](_0x5e16ac)[_0x3944('0x2b')](_0x3944('0xa7'),_0x3944('0xa8'))[_0x3944('0x38')]('\x0a');}else{return _0x213561[_0x3944('0x29')](_0x5e16ac)[_0x3944('0xa9')](_0x5bf617);}}})['catch'](handleError(_0x213561,null));};exports[_0x3944('0xaa')]=function(_0xf6cc01,_0x48eeca,_0x1855c4){return db['SmsAccount']['findOne']({'where':{'id':_0xf6cc01[_0x3944('0x54')]['id']}})['then'](handleEntityNotFound(_0x48eeca,null))[_0x3944('0x1d')](function(_0xc6c811){if(_0xc6c811){return db[_0x3944('0xab')]['transaction'](function(_0x57df82){return db[_0x3944('0x6b')][_0x3944('0x34')]({'where':{'SmsAccountId':_0xf6cc01['params']['id']},'transaction':_0x57df82})[_0x3944('0x1d')](function(_0x1370b9){var _0x2972f2=_[_0x3944('0x4b')](_0xf6cc01[_0x3944('0x58')],function(_0x28f95f){_0x28f95f[_0x3944('0x5f')]=_0xf6cc01[_0x3944('0x54')]['id'];return _0x28f95f;});return db[_0x3944('0x6b')][_0x3944('0xac')](_0x2972f2,{'transaction':_0x57df82});});})[_0x3944('0x1d')](function(){return db['SmsApplication'][_0x3944('0xad')]({'where':{'SmsAccountId':_0xf6cc01[_0x3944('0x54')]['id']},'order':_0x3944('0x6f')});});}})['then'](respondWithResult(_0x48eeca,null))[_0x3944('0x27')](handleError(_0x48eeca,null));};exports[_0x3944('0xae')]=function(_0x3b8365,_0x15803b,_0xa7a186){var _0x485fbe={};var _0x10c7e3={};var _0x135fcd;var _0x46d71c;return db[_0x3944('0x3b')][_0x3944('0xaf')]({'where':{'id':_0x3b8365[_0x3944('0x54')]['id']}})[_0x3944('0x1d')](handleEntityNotFound(_0x15803b,null))[_0x3944('0x1d')](function(_0x4a747d){if(_0x4a747d){_0x135fcd=_0x4a747d;_0x10c7e3['model']=_[_0x3944('0x3d')](db[_0x3944('0x6b')]['rawAttributes']);_0x10c7e3[_0x3944('0x3e')]=_[_0x3944('0x3d')](_0x3b8365[_0x3944('0x3e')]);_0x10c7e3[_0x3944('0x3f')]=_[_0x3944('0x40')](_0x10c7e3['model'],_0x10c7e3[_0x3944('0x3e')]);_0x485fbe[_0x3944('0x41')]=_['intersection'](_0x10c7e3[_0x3944('0x3c')],qs['fields'](_0x3b8365['query'][_0x3944('0x42')]));_0x485fbe['attributes']=_0x485fbe['attributes']['length']?_0x485fbe['attributes']:_0x10c7e3[_0x3944('0x3c')];_0x485fbe[_0x3944('0x46')]=qs['sort'](_0x3b8365[_0x3944('0x3e')][_0x3944('0x47')]);_0x485fbe[_0x3944('0x48')]=qs[_0x3944('0x3f')](_[_0x3944('0x49')](_0x3b8365[_0x3944('0x3e')],_0x10c7e3['filters']));if(_0x3b8365[_0x3944('0x3e')][_0x3944('0x4e')]){_0x485fbe[_0x3944('0x48')]=_['merge'](_0x485fbe['where'],{'$or':_[_0x3944('0x4b')](_0x485fbe[_0x3944('0x41')],function(_0x12e7c1){var _0x287905={};_0x287905[_0x12e7c1]={'$like':'%'+_0x3b8365[_0x3944('0x3e')]['filter']+'%'};return _0x287905;})});}_0x485fbe=_[_0x3944('0x4a')]({},_0x485fbe,_0x3b8365[_0x3944('0x4f')]);return _0x135fcd[_0x3944('0xae')](_0x485fbe);}})['then'](function(_0x6d10b9){if(_0x6d10b9){_0x46d71c=_0x6d10b9[_0x3944('0x43')];if(!_0x3b8365['query'][_0x3944('0x61')](_0x3944('0x44'))){_0x485fbe['limit']=qs[_0x3944('0x45')](_0x3b8365[_0x3944('0x3e')]['limit']);_0x485fbe[_0x3944('0x2a')]=qs[_0x3944('0x2a')](_0x3b8365[_0x3944('0x3e')]['offset']);}return _0x135fcd[_0x3944('0xae')](_0x485fbe);}})[_0x3944('0x1d')](function(_0x4a9b93){if(_0x4a9b93){return _0x4a9b93?{'count':_0x46d71c,'rows':_0x4a9b93}:null;}})[_0x3944('0x1d')](respondWithResult(_0x15803b,null))[_0x3944('0x27')](handleError(_0x15803b,null));};exports[_0x3944('0xb0')]=function(_0x26ead5,_0xfc15c5,_0x70cc0c){var _0x407e19={'raw':![],'where':{}};var _0x58f825={};var _0x173378={'count':0x0,'rows':[]};return db[_0x3944('0x3b')][_0x3944('0xaf')]({'where':{'id':_0x26ead5[_0x3944('0x54')]['id']}})[_0x3944('0x1d')](handleEntityNotFound(_0xfc15c5,null))[_0x3944('0x1d')](function(_0xa79141){if(_0xa79141){_0x58f825['model']=_[_0x3944('0x3d')](db[_0x3944('0x95')]['rawAttributes']);_0x58f825[_0x3944('0x3e')]=_[_0x3944('0x3d')](_0x26ead5[_0x3944('0x3e')]);_0x58f825[_0x3944('0x3f')]=_[_0x3944('0x40')](_0x58f825[_0x3944('0x3c')],_0x58f825[_0x3944('0x3e')]);_0x407e19[_0x3944('0x41')]=_['intersection'](_0x58f825[_0x3944('0x3c')],qs[_0x3944('0x42')](_0x26ead5[_0x3944('0x3e')]['fields']));_0x407e19['attributes']=_0x407e19[_0x3944('0x41')][_0x3944('0x43')]?_0x407e19[_0x3944('0x41')]:_0x58f825[_0x3944('0x3c')];if(!_0x26ead5[_0x3944('0x3e')]['hasOwnProperty'](_0x3944('0x44'))){_0x407e19['limit']=qs[_0x3944('0x45')](_0x26ead5[_0x3944('0x3e')][_0x3944('0x45')]);_0x407e19['offset']=qs[_0x3944('0x2a')](_0x26ead5[_0x3944('0x3e')]['offset']);}_0x407e19['order']=qs[_0x3944('0x47')](_0x26ead5['query']['sort']);_0x407e19['where']=qs[_0x3944('0x3f')](_['pick'](_0x26ead5[_0x3944('0x3e')],_0x58f825['filters']));_0x407e19[_0x3944('0x48')]['SmsAccountId']=_0xa79141['id'];if(_0x26ead5['query'][_0x3944('0x4e')]){_0x407e19[_0x3944('0x48')]=_['merge'](_0x407e19['where'],{'$or':_[_0x3944('0x4b')](_0x407e19[_0x3944('0x41')],function(_0x567d7c){var _0x3d6340={};_0x3d6340[_0x567d7c]={'$like':'%'+_0x26ead5[_0x3944('0x3e')][_0x3944('0x4e')]+'%'};return _0x3d6340;})});}_0x407e19=_[_0x3944('0x4a')]({},_0x407e19,_0x26ead5[_0x3944('0x4f')]);return db[_0x3944('0x95')][_0x3944('0x50')]({'where':_0x407e19[_0x3944('0x48')]})[_0x3944('0x1d')](function(_0x10c0db){_0x173378[_0x3944('0x50')]=_0x10c0db;if(_0x26ead5[_0x3944('0x3e')][_0x3944('0x62')]){_0x407e19[_0x3944('0x63')]=[{'model':db['CmContact'],'as':_0x3944('0xb1'),'required':![]},{'model':db['User'],'as':_0x3944('0xb2'),'attributes':[_0x3944('0x37'),_0x3944('0xb3'),_0x3944('0xb4')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x3944('0x37'),_0x3944('0xb5')],'where':_0x26ead5['query'][_0x3944('0xb6')]?{'id':_0x26ead5[_0x3944('0x3e')][_0x3944('0xb6')]}:undefined,'required':_0x26ead5['query'][_0x3944('0xb6')]?!![]:![]}];}return db['SmsInteraction'][_0x3944('0x51')](_0x407e19);})[_0x3944('0x1d')](function(_0x5ee5c1){_0x173378[_0x3944('0x52')]=_0x5ee5c1;return _0x173378;});}})[_0x3944('0x1d')](respondWithFilteredResult(_0xfc15c5,_0x407e19))[_0x3944('0x27')](handleError(_0xfc15c5,null));};exports[_0x3944('0x38')]=function(_0x4af046,_0x1d757e,_0x11179a){var _0x11bc94,_0x4773a5,_0x35c612;if(_[_0x3944('0x8a')](_0x4af046[_0x3944('0x58')]['body'])||_0x4af046['body']['body']===''){throw new db[(_0x3944('0x72'))][(_0x3944('0x8b'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x3944('0x8a')](_0x4af046[_0x3944('0x58')]['to'])){throw new db[(_0x3944('0x72'))][(_0x3944('0x8b'))](_0x3944('0xb7'));}_0x11bc94=_0x4af046['body']['to'];return db[_0x3944('0x3b')][_0x3944('0x5b')]({'where':{'id':_0x4af046[_0x3944('0x54')]['id']},'include':[{'model':db[_0x3944('0xb8')],'as':_0x3944('0xb9'),'include':[{'model':db[_0x3944('0x71')],'as':_0x3944('0x91'),'where':{'mobile':_0x11bc94},'limit':0x1,'order':[[_0x3944('0x76'),_0x3944('0xba')]]}]}]})['then'](handleEntityNotFound(_0x1d757e,null))['then'](function(_0x3c4c91){if(_0x3c4c91&&_0x3c4c91[_0x3944('0xb9')]){_0x4773a5=_0x3c4c91[_0x3944('0x31')]({'plain':!![]});if(_0x4773a5['List']&&_0x4773a5['List'][_0x3944('0x91')]['length']){return _0x4773a5[_0x3944('0xb9')]['Contacts'][0x0];}return db[_0x3944('0x71')][_0x3944('0x57')](_[_0x3944('0x93')](_0x4af046[_0x3944('0x58')],{'firstName':_0x11bc94,'mobile':_0x11bc94,'phone':_0x11bc94,'ListId':_0x4773a5['ListId']}));}})[_0x3944('0x1d')](handleEntityNotFound(_0x1d757e,null))['then'](function(_0x158e46){if(_0x158e46){_0x35c612=_0x158e46;return db[_0x3944('0x95')]['find']({'where':{'ContactId':_0x35c612['id'],'closed':![],'SmsAccountId':_0x4773a5['id']}})['then'](function(_0x48482c){if(_0x48482c){return[_0x48482c,![]];}return db[_0x3944('0x95')][_0x3944('0x57')]({'UserId':_0x4af046[_0x3944('0x59')]['id'],'ContactId':_0x35c612['id'],'SmsAccountId':_0x4773a5['id'],'phone':_0x11bc94,'firstMsgDirection':_0x3944('0xbb'),'Messages':[_[_0x3944('0x4a')](_0x4af046[_0x3944('0x58')],{'read':![],'body':_0x4af046[_0x3944('0x58')][_0x3944('0x58')],'phone':_0x11bc94,'SmsAccountId':_0x4773a5['id'],'UserId':_0x4af046['user']['id'],'ContactId':_0x35c612['id']})]},{'include':[{'model':db[_0x3944('0xbc')],'as':'Messages'}]})['then'](function(_0x25debd){return[_0x25debd,!![]];});});}})[_0x3944('0x96')](function(_0x284c5a,_0x5da974){if(_0x5da974){return _0x284c5a;}return db[_0x3944('0xbc')][_0x3944('0x57')](_[_0x3944('0x4a')](_0x4af046['body'],{'read':![],'body':_0x4af046['body'][_0x3944('0x58')],'phone':_0x11bc94,'SmsAccountId':_0x4773a5['id'],'SmsInteractionId':_0x284c5a['id'],'UserId':_0x4af046[_0x3944('0x59')]['id'],'ContactId':_0x35c612['id']}))[_0x3944('0x1d')](function(_0x36ebb3){_0x284c5a[_0x3944('0xbd')]['Messages']=[];_0x284c5a['dataValues'][_0x3944('0xbe')][_0x3944('0x9a')](_0x36ebb3[_0x3944('0xbd')]);return _0x284c5a;});})[_0x3944('0x1d')](respondWithResult(_0x1d757e,null))[_0x3944('0x27')](handleError(_0x1d757e,null));};exports[_0x3944('0x29')]=function(_0x1f6675,_0x3daebd,_0x7c1e33){if(_0x1f6675['body']['id']){delete _0x1f6675[_0x3944('0x58')]['id'];}console[_0x3944('0xbf')](_0x3944('0xc0'),_0x1f6675[_0x3944('0x58')]);var _0x40de5a,_0x1cb2a3,_0x1db4ce;return db[_0x3944('0x3b')]['find']({'where':{'id':_0x1f6675[_0x3944('0x54')]['id']}})[_0x3944('0x1d')](handleEntityNotFound(_0x3daebd,null))['then'](function(_0x8d7941){if(_0x8d7941){_0x1db4ce=_0x8d7941;logger[_0x3944('0x21')](_0x3944('0x22'),_0x3944('0x29'),_0x3944('0xc1'),_0x8d7941['type'],util[_0x3944('0xc2')](_0x1f6675[_0x3944('0x58')],{'showHidden':![],'depth':null}));switch(_0x8d7941[_0x3944('0x4c')]){case'skebby':if(_0x1f6675[_0x3944('0x58')][_0x3944('0xc3')]&&_0x1f6675[_0x3944('0x58')][_0x3944('0x29')]){_0x1cb2a3=_0x1f6675[_0x3944('0x58')]['status'];return db['SmsMessage'][_0x3944('0x5b')]({'where':{'messageId':_0x1f6675[_0x3944('0x58')]['skebby_dispatch_id']}});}break;case _0x3944('0x80'):if(_0x1f6675[_0x3944('0x58')][_0x3944('0xc4')]&&_0x1f6675[_0x3944('0x58')]['statusInt']){_0x1cb2a3=_0x1f6675[_0x3944('0x58')][_0x3944('0xc5')];return db[_0x3944('0xbc')][_0x3944('0x5b')]({'where':{'messageId':_0x1f6675['body'][_0x3944('0xc4')]}});}break;case _0x3944('0x81'):if(_0x1f6675[_0x3944('0x58')][_0x3944('0x82')]&&_0x1f6675[_0x3944('0x58')][_0x3944('0xc6')]){_0x1cb2a3=_0x1f6675[_0x3944('0x58')][_0x3944('0xc6')];return db[_0x3944('0xbc')]['find']({'where':{'messageId':_0x1f6675[_0x3944('0x58')][_0x3944('0x82')]}});}break;case'infobip':var _0x2b60a0=_0x1f6675[_0x3944('0x58')]['results'][0x0];if(_0x2b60a0[_0x3944('0x7b')]&&_0x2b60a0[_0x3944('0x29')][_0x3944('0xc7')]==='DELIVERED'){_0x1cb2a3=_0x2b60a0[_0x3944('0x29')]['groupName'];return db[_0x3944('0xbc')][_0x3944('0x5b')]({'where':{'messageId':_0x2b60a0[_0x3944('0x7b')]}});}break;case _0x3944('0xc8'):if(_0x1f6675[_0x3944('0x58')][_0x3944('0x7b')]&&_0x1f6675['body'][_0x3944('0x29')]){_0x1cb2a3=_0x1f6675[_0x3944('0x58')]['status'];return db[_0x3944('0xbc')]['find']({'where':{'messageId':_0x1f6675[_0x3944('0x58')][_0x3944('0x7b')]}});}break;case _0x3944('0xc9'):if(_0x1f6675[_0x3944('0x58')][_0x3944('0xca')]&&_0x1f6675[_0x3944('0x58')][_0x3944('0x29')]){_0x1cb2a3=_0x1f6675[_0x3944('0x58')][_0x3944('0x29')];return db[_0x3944('0xbc')]['find']({'where':{'messageId':_0x1f6675[_0x3944('0x58')]['redif']}});}break;}}})[_0x3944('0x1d')](handleEntityNotFound(_0x3daebd,null))['then'](function(_0x4aad3e){if(_0x4aad3e){_0x40de5a=_0x4aad3e;switch(_0x1db4ce[_0x3944('0x4c')]){case _0x3944('0x7d'):if(_0x1cb2a3===_0x3944('0xcb')){return _0x40de5a[_0x3944('0x30')]({'read':!![]});}else{logger['error'](_0x3944('0x22'),_0x3944('0x29'),'skebby',util[_0x3944('0xc2')](_0x1f6675[_0x3944('0x58')],{'showHidden':![],'depth':null}));}break;case _0x3944('0x80'):if(_0x1cb2a3==='1'){return _0x40de5a[_0x3944('0x30')]({'read':!![]});}else{logger[_0x3944('0x24')](_0x3944('0x22'),_0x3944('0x29'),_0x3944('0x7d'),util['inspect'](_0x1f6675['body'],{'showHidden':![],'depth':null}));}break;case _0x3944('0x81'):if(!_0x1f6675[_0x3944('0x58')][_0x3944('0xcc')]&&_0x1cb2a3>=0xc8&&_0x1cb2a3<=0xce){return _0x40de5a['update']({'read':!![]});}else{logger[_0x3944('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3944('0x29'),_0x3944('0x81'),util['inspect'](_0x1f6675[_0x3944('0x58')],{'showHidden':![],'depth':null}));}break;case _0x3944('0xcd'):var _0x4d147b=_0x1f6675['body']['results'][0x0];if(_0x4d147b['status'][_0x3944('0xc7')]==='DELIVERED'){return _0x40de5a[_0x3944('0x30')]({'read':!![]});}else{logger[_0x3944('0x24')](_0x3944('0x22'),'status','infobip',util[_0x3944('0xc2')](_0x1f6675[_0x3944('0x58')],{'showHidden':![],'depth':null}));}break;case _0x3944('0xc8'):if(_0x1cb2a3==_0x3944('0xce')||_0x1cb2a3==_0x3944('0xcf')){return _0x40de5a[_0x3944('0x30')]({'read':!![]});}else{logger[_0x3944('0x24')](_0x3944('0x22'),_0x3944('0x29'),'clickatell',util[_0x3944('0xc2')](_0x1f6675[_0x3944('0x58')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x1cb2a3==='DELIVRD'||_0x1cb2a3===_0x3944('0xd0')){return _0x40de5a[_0x3944('0x30')]({'read':!![]});}else{logger[_0x3944('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3944('0x29'),_0x3944('0xc9'),util[_0x3944('0xc2')](_0x1f6675[_0x3944('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x40de5a;}})[_0x3944('0x1d')](respondWithResult(_0x3daebd,null))[_0x3944('0x27')](handleError(_0x3daebd,null));};exports[_0x3944('0xd1')]=function(_0x3057da,_0x3b2c2a,_0x51ce32){var _0x4c9fce,_0x291508,_0x4a1072;return db[_0x3944('0x3b')][_0x3944('0x5b')]({'where':{'id':_0x3057da[_0x3944('0x54')]['id']}})[_0x3944('0x1d')](handleEntityNotFound(_0x3b2c2a,null))[_0x3944('0x1d')](function(_0x3af101){if(_0x3af101){_0x4a1072=_0x3af101;logger[_0x3944('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3944('0x29'),_0x3944('0xc1'),_0x3af101[_0x3944('0x4c')],util[_0x3944('0xc2')](_0x3057da['query'],{'showHidden':![],'depth':null}));switch(_0x3af101[_0x3944('0x4c')]){case _0x3944('0xd2'):if(_0x3057da[_0x3944('0x3e')][_0x3944('0xd3')]&&_0x3057da[_0x3944('0x3e')]['state']){_0x291508=_0x3057da[_0x3944('0x3e')][_0x3944('0xd4')];return db[_0x3944('0xbc')][_0x3944('0x5b')]({'where':{'messageId':_0x3057da['query']['message-id']}});}break;}}})['then'](handleEntityNotFound(_0x3b2c2a,null))[_0x3944('0x1d')](function(_0x4e92e5){if(_0x4e92e5){_0x4c9fce=_0x4e92e5;switch(_0x4a1072[_0x3944('0x4c')]){case _0x3944('0xd2'):if(_0x291508==='2'||_0x291508==='6'){return _0x4c9fce[_0x3944('0x30')]({'read':!![]});}else{logger[_0x3944('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x3944('0xd2'),util[_0x3944('0xc2')](_0x3057da[_0x3944('0x3e')],{'showHidden':![],'depth':null}));};break;}return _0x4c9fce;}})['then'](respondWithResult(_0x3b2c2a,null))['catch'](handleError(_0x3b2c2a,null));};exports[_0x3944('0xd5')]=function(_0x3fef78,_0x362d96,_0x1d70d4){return db[_0x3944('0x3b')]['find']({'where':{'id':_0x3fef78[_0x3944('0x54')]['id']}})['then'](handleEntityNotFound(_0x362d96,null))[_0x3944('0x1d')](function(_0x54b805){if(_0x54b805){return _0x54b805[_0x3944('0xd5')](_0x3fef78[_0x3944('0x58')][_0x3944('0x69')],_[_0x3944('0x92')](_0x3fef78[_0x3944('0x58')],['ids','id'])||{})[_0x3944('0x96')](function(_0x49f05e){for(var _0x2ffd69=0x0;_0x2ffd69<_0x3fef78[_0x3944('0x58')][_0x3944('0x69')][_0x3944('0x43')];_0x2ffd69+=0x1){socket[_0x3944('0xd6')](_0x3944('0xd7'),{'UserId':_0x3fef78[_0x3944('0x58')]['ids'][_0x2ffd69],'SmsAccountId':_0x3fef78[_0x3944('0x54')]['id']});}return _0x49f05e;});}})['then'](respondWithResult(_0x362d96,null))['catch'](handleError(_0x362d96,null));};exports['removeAgents']=function(_0x3ca31a,_0x49ef4e,_0x2b133f){return db[_0x3944('0x3b')][_0x3944('0x5b')]({'where':{'id':_0x3ca31a[_0x3944('0x54')]['id']}})['then'](handleEntityNotFound(_0x49ef4e,null))[_0x3944('0x1d')](function(_0x1d5446){if(_0x1d5446){return _0x1d5446[_0x3944('0xd8')](_0x3ca31a[_0x3944('0x3e')][_0x3944('0x69')])[_0x3944('0x1d')](function(){if(_[_0x3944('0xd9')](_0x3ca31a[_0x3944('0x3e')]['ids'])){for(var _0x4ed103=0x0;_0x4ed103<_0x3ca31a[_0x3944('0x3e')][_0x3944('0x69')][_0x3944('0x43')];_0x4ed103+=0x1){socket[_0x3944('0xd6')]('userSmsAccount:remove',{'UserId':Number(_0x3ca31a[_0x3944('0x3e')]['ids'][_0x4ed103]),'SmsAccountId':Number(_0x3ca31a[_0x3944('0x54')]['id'])});}}else{socket[_0x3944('0xd6')](_0x3944('0xda'),{'UserId':Number(_0x3ca31a['query'][_0x3944('0x69')]),'SmsAccountId':Number(_0x3ca31a[_0x3944('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x49ef4e,null))[_0x3944('0x27')](handleError(_0x49ef4e,null));};exports['getAgents']=function(_0x14f139,_0x1b8870,_0x5de5f6){var _0x511a3e={};var _0x25cbae={};var _0x1d5b30;var _0xef4398;return db[_0x3944('0x3b')][_0x3944('0xaf')]({'where':{'id':_0x14f139[_0x3944('0x54')]['id']}})['then'](handleEntityNotFound(_0x1b8870,null))[_0x3944('0x1d')](function(_0x1c44d2){if(_0x1c44d2){_0x1d5b30=_0x1c44d2;_0x25cbae[_0x3944('0x3c')]=_['keys'](db['User'][_0x3944('0x56')]);_0x25cbae['query']=_[_0x3944('0x3d')](_0x14f139[_0x3944('0x3e')]);_0x25cbae[_0x3944('0x3f')]=_['intersection'](_0x25cbae[_0x3944('0x3c')],_0x25cbae[_0x3944('0x3e')]);_0x511a3e['attributes']=_['intersection'](_0x25cbae[_0x3944('0x3c')],qs['fields'](_0x14f139[_0x3944('0x3e')][_0x3944('0x42')]));_0x511a3e[_0x3944('0x41')]=_0x511a3e['attributes'][_0x3944('0x43')]?_0x511a3e[_0x3944('0x41')]:_0x25cbae['model'];_0x511a3e[_0x3944('0x46')]=qs[_0x3944('0x47')](_0x14f139[_0x3944('0x3e')][_0x3944('0x47')]);_0x511a3e[_0x3944('0x48')]=qs[_0x3944('0x3f')](_[_0x3944('0x49')](_0x14f139[_0x3944('0x3e')],_0x25cbae[_0x3944('0x3f')]));if(_0x14f139[_0x3944('0x3e')]['filter']){_0x511a3e[_0x3944('0x48')]=_[_0x3944('0x4a')](_0x511a3e[_0x3944('0x48')],{'$or':_[_0x3944('0x4b')](_0x511a3e['attributes'],function(_0x44655d){var _0x2b4fbf={};_0x2b4fbf[_0x44655d]={'$like':'%'+_0x14f139['query'][_0x3944('0x4e')]+'%'};return _0x2b4fbf;})});}_0x511a3e=_[_0x3944('0x4a')]({},_0x511a3e,_0x14f139['options']);return _0x1d5b30['getAgents'](_0x511a3e);}})['then'](function(_0x4ad9ed){if(_0x4ad9ed){_0xef4398=_0x4ad9ed[_0x3944('0x43')];if(!_0x14f139['query'][_0x3944('0x61')](_0x3944('0x44'))){_0x511a3e[_0x3944('0x45')]=qs[_0x3944('0x45')](_0x14f139[_0x3944('0x3e')][_0x3944('0x45')]);_0x511a3e[_0x3944('0x2a')]=qs[_0x3944('0x2a')](_0x14f139['query']['offset']);}return _0x1d5b30[_0x3944('0xdb')](_0x511a3e);}})[_0x3944('0x1d')](function(_0x57b231){if(_0x57b231){return _0x57b231?{'count':_0xef4398,'rows':_0x57b231}:null;}})[_0x3944('0x1d')](respondWithResult(_0x1b8870,null))[_0x3944('0x27')](handleError(_0x1b8870,null));}; \ No newline at end of file +var _0x7008=['requestid','clicksend','status_code','groupName','DELIVERED','redif','error_code','DELIVERED_TO_GATEWAY','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','html-pdf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsAccount.socket','register','jayson/promise','client','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','status','end','json','count','offset','limit','Content-Range','reject','save','update','then','get','SmsAccounts','UserProfileResource','destroy','sendStatus','stack','name','index','Pause','SmsAccount','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','key','field','filter','options','includeAll','include','findAll','rows','show','params','mandatoryDispositionPause','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','SmsAccountId','getDispositions','findOne','Disposition','map','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','sms','SmsApplication','Applications','account','priority','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','CompanyId','ListId','mobile','type','twilio','from','From','Body','messageId','skebby','text','connectel','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','replyMessageId','intelepeer','refid','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','CmContact','Contacts','DESC','list','omit','contact','SmsInteraction','interaction','created','autoclose','applications','push','close','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','startRouting','Start','receiveMessage','entity\x20found','stringify','set','Content-Type','text/xml','send','\x0a','addApplications','sequelize','transaction','findAndCountAll','getApplications','getInteractions','Contact','User','Owner','fullname','Tag','color','tag','to\x20is\x20mandatory','List','SmsMessage','Messages','spread','dataValues','endpoint\x20/status\x20POST\x20/','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','statusInt'];(function(_0x49c057,_0xc808ed){var _0xd8f0e6=function(_0x5b9042){while(--_0x5b9042){_0x49c057['push'](_0x49c057['shift']());}};_0xd8f0e6(++_0xc808ed);}(_0x7008,0xf4));var _0x8700=function(_0x2cbf5c,_0x4a5257){_0x2cbf5c=_0x2cbf5c-0x0;var _0xe6bf19=_0x7008[_0x2cbf5c];return _0xe6bf19;};'use strict';var pdf=require(_0x8700('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8700('0x1'));var jsonpatch=require(_0x8700('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8700('0x3'));var Mustache=require(_0x8700('0x4'));var util=require('util');var path=require(_0x8700('0x5'));var sox=require(_0x8700('0x6'));var csv=require(_0x8700('0x7'));var ejs=require(_0x8700('0x8'));var fs=require('fs');var _=require(_0x8700('0x9'));var squel=require(_0x8700('0xa'));var crypto=require(_0x8700('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8700('0xc'));var toCsv=require(_0x8700('0x7'));var querystring=require(_0x8700('0xd'));var Papa=require(_0x8700('0xe'));var Redis=require(_0x8700('0xf'));var authService=require(_0x8700('0x10'));var qs=require(_0x8700('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8700('0x12'))(_0x8700('0x13'));var utils=require(_0x8700('0x14'));var config=require(_0x8700('0x15'));var db=require(_0x8700('0x16'))['db'];config[_0x8700('0x17')]=_[_0x8700('0x18')](config[_0x8700('0x17')],{'host':_0x8700('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8700('0x17')]));require(_0x8700('0x1a'))[_0x8700('0x1b')](socket);var jayson=require(_0x8700('0x1c'));var client=jayson[_0x8700('0x1d')]['http']({'port':0x232c});function checkPasswordPattern(_0x4c0074,_0x248e37,_0x20492d){if(_0x20492d){var _0x1cb38b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1cb38b['test'](_0x248e37)){return _0x4c0074;}else{throw new Error(_0x8700('0x1e'));}}else{return _0x4c0074;}}function respondWithRpcPromise(_0x4bbf49,_0x1e9ae5,_0x2ac0e9,_0x358375){return new BPromise(function(_0x333262,_0xd59c11){var _0x28f886=_0x358375||client;return _0x28f886[_0x8700('0x1f')](_0x4bbf49,_0x2ac0e9)['then'](function(_0x26b6ac){logger['info'](_0x8700('0x20'),_0x1e9ae5,_0x8700('0x21'));logger[_0x8700('0x22')](_0x8700('0x23'),_0x1e9ae5,'request\x20sent',JSON['stringify'](_0x26b6ac));if(_0x26b6ac[_0x8700('0x24')]){if(_0x26b6ac[_0x8700('0x24')][_0x8700('0x25')]===0x1f4){logger[_0x8700('0x24')](_0x8700('0x20'),_0x1e9ae5,_0x26b6ac[_0x8700('0x24')][_0x8700('0x26')]);return _0xd59c11(_0x26b6ac[_0x8700('0x24')][_0x8700('0x26')]);}logger[_0x8700('0x24')](_0x8700('0x20'),_0x1e9ae5,_0x26b6ac[_0x8700('0x24')]['message']);return _0x333262(_0x26b6ac[_0x8700('0x24')][_0x8700('0x26')]);}else{logger[_0x8700('0x27')](_0x8700('0x20'),_0x1e9ae5,_0x8700('0x21'));_0x333262(_0x26b6ac[_0x8700('0x28')][_0x8700('0x26')]);}})[_0x8700('0x29')](function(_0x5da04b){logger['error'](_0x8700('0x20'),_0x1e9ae5,_0x5da04b);_0xd59c11(_0x5da04b);});});}function respondWithStatusCode(_0x16c978,_0x1297ef){_0x1297ef=_0x1297ef||0xcc;return function(_0xa2eb82){if(_0xa2eb82){return _0x16c978['sendStatus'](_0x1297ef);}return _0x16c978[_0x8700('0x2a')](_0x1297ef)[_0x8700('0x2b')]();};}function respondWithResult(_0x410be9,_0x524661){_0x524661=_0x524661||0xc8;return function(_0x39609c){if(_0x39609c){return _0x410be9['status'](_0x524661)[_0x8700('0x2c')](_0x39609c);}};}function respondWithFilteredResult(_0x266726,_0x455dc7){return function(_0x348aad){if(_0x348aad){var _0x29ee99=_0x348aad[_0x8700('0x2d')],_0x142a71=_0x455dc7[_0x8700('0x2e')],_0x29fab1=_0x455dc7[_0x8700('0x2e')]+_0x455dc7[_0x8700('0x2f')],_0x329d6e;if(_0x29fab1>=_0x29ee99){_0x29fab1=_0x29ee99;_0x329d6e=0xc8;}else{_0x329d6e=0xce;}_0x266726[_0x8700('0x2a')](_0x329d6e);return _0x266726['set'](_0x8700('0x30'),_0x142a71+'-'+_0x29fab1+'/'+_0x29ee99)[_0x8700('0x2c')](_0x348aad);}return null;};}function patchUpdates(_0x5dfabc){return function(_0x5d8673){try{jsonpatch['apply'](_0x5d8673,_0x5dfabc,!![]);}catch(_0x3908fd){return BPromise[_0x8700('0x31')](_0x3908fd);}return _0x5d8673[_0x8700('0x32')]();};}function saveUpdates(_0x233e05,_0x14dd15){return function(_0x451c17){if(_0x451c17){return _0x451c17[_0x8700('0x33')](_0x233e05)['then'](function(_0x2c42b5){return _0x2c42b5;});}return null;};}function removeEntity(_0x4a566c,_0x38bdd6){return function(_0x5a7e8e){if(_0x5a7e8e){return _0x5a7e8e['destroy']()[_0x8700('0x34')](function(){var _0xfd3587=_0x5a7e8e[_0x8700('0x35')]({'plain':!![]});var _0x3f2ae4=_0x8700('0x36');return db[_0x8700('0x37')][_0x8700('0x38')]({'where':{'type':_0x3f2ae4,'resourceId':_0xfd3587['id']}})[_0x8700('0x34')](function(){return _0x5a7e8e;});})[_0x8700('0x34')](function(){_0x4a566c[_0x8700('0x2a')](0xcc)[_0x8700('0x2b')]();});}};}function handleEntityNotFound(_0x1b9cb2,_0x2d0f8c){return function(_0x18a7be){if(!_0x18a7be){_0x1b9cb2[_0x8700('0x39')](0x194);}return _0x18a7be;};}function handleError(_0x4753d0,_0x38a9d7){_0x38a9d7=_0x38a9d7||0x1f4;return function(_0x11e0d4){logger[_0x8700('0x24')](_0x11e0d4[_0x8700('0x3a')]);if(_0x11e0d4[_0x8700('0x3b')]){delete _0x11e0d4[_0x8700('0x3b')];}_0x4753d0['status'](_0x38a9d7)['send'](_0x11e0d4);};}exports[_0x8700('0x3c')]=function(_0x51a815,_0x2d207a){var _0x3f6014={'include':[{'model':db[_0x8700('0x3d')],'as':'mandatoryDispositionPause'}]},_0x383331={},_0x3bd857={'count':0x0,'rows':[]};var _0x11fd35=db[_0x8700('0x3e')][_0x8700('0x3f')];_0x383331[_0x8700('0x40')]=_[_0x8700('0x41')](_0x11fd35);_0x383331[_0x8700('0x42')]=_[_0x8700('0x41')](_0x51a815[_0x8700('0x42')]);_0x383331[_0x8700('0x43')]=_['intersection'](_0x383331[_0x8700('0x40')],_0x383331[_0x8700('0x42')]);_0x3f6014[_0x8700('0x44')]=_[_0x8700('0x45')](_0x383331[_0x8700('0x40')],qs[_0x8700('0x46')](_0x51a815[_0x8700('0x42')][_0x8700('0x46')]));_0x3f6014[_0x8700('0x44')]=_0x3f6014[_0x8700('0x44')][_0x8700('0x47')]?_0x3f6014['attributes']:_0x383331[_0x8700('0x40')];if(!_0x51a815['query'][_0x8700('0x48')](_0x8700('0x49'))){_0x3f6014['limit']=qs['limit'](_0x51a815[_0x8700('0x42')][_0x8700('0x2f')]);_0x3f6014[_0x8700('0x2e')]=qs[_0x8700('0x2e')](_0x51a815[_0x8700('0x42')][_0x8700('0x2e')]);}_0x3f6014[_0x8700('0x4a')]=qs[_0x8700('0x4b')](_0x51a815['query'][_0x8700('0x4b')]);_0x3f6014[_0x8700('0x4c')]=qs[_0x8700('0x43')](_[_0x8700('0x4d')](_0x51a815[_0x8700('0x42')],_0x383331['filters']));if(_0x51a815[_0x8700('0x42')]['filter']){_0x3f6014[_0x8700('0x4c')]=_[_0x8700('0x4e')](_0x3f6014[_0x8700('0x4c')],{'$or':_['map'](_0x11fd35,function(_0x4c13be){if(_0x4c13be['type'][_0x8700('0x4f')]!=='VIRTUAL'){var _0xe0110e={};_0xe0110e[_0x4c13be[_0x8700('0x50')]]={'$like':'%'+_0x51a815['query'][_0x8700('0x51')]+'%'};return _0xe0110e;}})});}_0x3f6014=_[_0x8700('0x4e')]({},_0x3f6014,_0x51a815[_0x8700('0x52')]);var _0x129ea4={'where':_0x3f6014[_0x8700('0x4c')]};return db['SmsAccount'][_0x8700('0x2d')](_0x129ea4)[_0x8700('0x34')](function(_0x229ea5){_0x3bd857['count']=_0x229ea5;if(_0x51a815[_0x8700('0x42')][_0x8700('0x53')]){_0x3f6014[_0x8700('0x54')]=[{'all':!![]}];}return db[_0x8700('0x3e')][_0x8700('0x55')](_0x3f6014);})['then'](function(_0x586897){_0x3bd857[_0x8700('0x56')]=_0x586897;return _0x3bd857;})[_0x8700('0x34')](respondWithFilteredResult(_0x2d207a,_0x3f6014))[_0x8700('0x29')](handleError(_0x2d207a,null));};exports[_0x8700('0x57')]=function(_0x1581f2,_0x22e416){var _0x2ce282={'raw':![],'where':{'id':_0x1581f2[_0x8700('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0x8700('0x59')}]},_0x533142={};_0x533142[_0x8700('0x40')]=_[_0x8700('0x41')](db[_0x8700('0x3e')]['rawAttributes']);_0x533142[_0x8700('0x42')]=_['keys'](_0x1581f2[_0x8700('0x42')]);_0x533142[_0x8700('0x43')]=_['intersection'](_0x533142[_0x8700('0x40')],_0x533142[_0x8700('0x42')]);_0x2ce282[_0x8700('0x44')]=_['intersection'](_0x533142['model'],qs[_0x8700('0x46')](_0x1581f2[_0x8700('0x42')][_0x8700('0x46')]));_0x2ce282[_0x8700('0x44')]=_0x2ce282[_0x8700('0x44')][_0x8700('0x47')]?_0x2ce282[_0x8700('0x44')]:_0x533142['model'];if(_0x1581f2[_0x8700('0x42')][_0x8700('0x53')]){_0x2ce282[_0x8700('0x54')]=[{'all':!![]}];}_0x2ce282=_[_0x8700('0x4e')]({},_0x2ce282,_0x1581f2[_0x8700('0x52')]);return db['SmsAccount'][_0x8700('0x5a')](_0x2ce282)[_0x8700('0x34')](handleEntityNotFound(_0x22e416,null))[_0x8700('0x34')](respondWithResult(_0x22e416,null))[_0x8700('0x29')](handleError(_0x22e416,null));};exports['create']=function(_0xa6e983,_0x193efb){return db[_0x8700('0x3e')][_0x8700('0x5b')](_0xa6e983[_0x8700('0x5c')],{})[_0x8700('0x34')](function(_0x28ae66){var _0x209365=_0xa6e983[_0x8700('0x5d')][_0x8700('0x35')]({'plain':!![]});if(!_0x209365)throw new Error(_0x8700('0x5e'));if(_0x209365[_0x8700('0x5f')]==='user'){var _0x46fcd7=_0x28ae66['get']({'plain':!![]});var _0x69f04f='SmsAccounts';return db[_0x8700('0x60')]['find']({'where':{'name':_0x69f04f,'userProfileId':_0x209365['userProfileId']},'raw':!![]})[_0x8700('0x34')](function(_0x68c58b){if(_0x68c58b&&_0x68c58b[_0x8700('0x61')]===0x0){return db['UserProfileResource'][_0x8700('0x5b')]({'name':_0x46fcd7[_0x8700('0x3b')],'resourceId':_0x46fcd7['id'],'type':_0x68c58b[_0x8700('0x3b')],'sectionId':_0x68c58b['id']},{})[_0x8700('0x34')](function(){return _0x28ae66;});}else{return _0x28ae66;}})['catch'](function(_0x1d0f15){logger[_0x8700('0x24')](_0x8700('0x62'),_0x1d0f15);throw _0x1d0f15;});}return _0x28ae66;})[_0x8700('0x34')](respondWithResult(_0x193efb,0xc9))[_0x8700('0x29')](handleError(_0x193efb,null));};exports[_0x8700('0x33')]=function(_0x11cd22,_0x359c7c){if(_0x11cd22[_0x8700('0x5c')]['id']){delete _0x11cd22[_0x8700('0x5c')]['id'];}return db[_0x8700('0x3e')][_0x8700('0x5a')]({'where':{'id':_0x11cd22[_0x8700('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0x8700('0x59')}]})[_0x8700('0x34')](handleEntityNotFound(_0x359c7c,null))[_0x8700('0x34')](saveUpdates(_0x11cd22[_0x8700('0x5c')],null))['then'](respondWithResult(_0x359c7c,null))[_0x8700('0x29')](handleError(_0x359c7c,null));};exports[_0x8700('0x38')]=function(_0x3bc377,_0x496e49){return db[_0x8700('0x3e')][_0x8700('0x5a')]({'where':{'id':_0x3bc377[_0x8700('0x58')]['id']}})[_0x8700('0x34')](handleEntityNotFound(_0x496e49,null))['then'](removeEntity(_0x496e49,null))[_0x8700('0x29')](handleError(_0x496e49,null));};exports[_0x8700('0x63')]=function(_0x416883,_0x148651){return db[_0x8700('0x3e')][_0x8700('0x63')]()['then'](respondWithResult(_0x148651,null))['catch'](handleError(_0x148651,null));};exports['addDisposition']=function(_0x40486e,_0x58632d,_0x22cef7){if(_0x40486e[_0x8700('0x5c')]['id']){delete _0x40486e[_0x8700('0x5c')]['id'];}return db[_0x8700('0x3e')][_0x8700('0x5a')]({'where':{'id':_0x40486e[_0x8700('0x58')]['id']}})['then'](handleEntityNotFound(_0x58632d,null))[_0x8700('0x34')](function(_0x2ee8fa){if(_0x2ee8fa){_0x40486e[_0x8700('0x5c')][_0x8700('0x64')]=_0x2ee8fa['id'];return db['Disposition'][_0x8700('0x5b')](_0x40486e[_0x8700('0x5c')]);}})[_0x8700('0x34')](respondWithResult(_0x58632d,null))['catch'](handleError(_0x58632d,null));};exports[_0x8700('0x65')]=function(_0x45d750,_0x4df1d6,_0x4c1ab8){var _0x43070c={'raw':![],'where':{}};var _0x73d763={};var _0x292f09={'count':0x0,'rows':[]};return db['SmsAccount'][_0x8700('0x66')]({'where':{'id':_0x45d750[_0x8700('0x58')]['id']}})[_0x8700('0x34')](handleEntityNotFound(_0x4df1d6,null))[_0x8700('0x34')](function(_0x554180){if(_0x554180){_0x73d763[_0x8700('0x40')]=_['keys'](db[_0x8700('0x67')][_0x8700('0x3f')]);_0x73d763['query']=_[_0x8700('0x41')](_0x45d750['query']);_0x73d763[_0x8700('0x43')]=_[_0x8700('0x45')](_0x73d763['model'],_0x73d763[_0x8700('0x42')]);_0x43070c[_0x8700('0x44')]=_[_0x8700('0x45')](_0x73d763[_0x8700('0x40')],qs[_0x8700('0x46')](_0x45d750[_0x8700('0x42')][_0x8700('0x46')]));_0x43070c[_0x8700('0x44')]=_0x43070c[_0x8700('0x44')][_0x8700('0x47')]?_0x43070c[_0x8700('0x44')]:_0x73d763[_0x8700('0x40')];if(!_0x45d750[_0x8700('0x42')][_0x8700('0x48')](_0x8700('0x49'))){_0x43070c[_0x8700('0x2f')]=qs['limit'](_0x45d750['query']['limit']);_0x43070c['offset']=qs[_0x8700('0x2e')](_0x45d750['query'][_0x8700('0x2e')]);}_0x43070c['order']=qs[_0x8700('0x4b')](_0x45d750[_0x8700('0x42')][_0x8700('0x4b')]);_0x43070c['where']=qs[_0x8700('0x43')](_[_0x8700('0x4d')](_0x45d750[_0x8700('0x42')],_0x73d763['filters']));_0x43070c[_0x8700('0x4c')][_0x8700('0x64')]=_0x554180['id'];if(_0x45d750['query']['filter']){_0x43070c[_0x8700('0x4c')]=_[_0x8700('0x4e')](_0x43070c[_0x8700('0x4c')],{'$or':_[_0x8700('0x68')](_0x43070c[_0x8700('0x44')],function(_0x1c3d41){var _0x141e73={};_0x141e73[_0x1c3d41]={'$like':'%'+_0x45d750[_0x8700('0x42')]['filter']+'%'};return _0x141e73;})});}_0x43070c=_['merge']({},_0x43070c,_0x45d750['options']);return db[_0x8700('0x67')][_0x8700('0x2d')]({'where':_0x43070c[_0x8700('0x4c')]})[_0x8700('0x34')](function(_0x22a6fc){_0x292f09[_0x8700('0x2d')]=_0x22a6fc;if(_0x45d750['query'][_0x8700('0x53')]){_0x43070c[_0x8700('0x54')]=[{'all':!![]}];}return db[_0x8700('0x67')][_0x8700('0x55')](_0x43070c);})[_0x8700('0x34')](function(_0x173544){_0x292f09[_0x8700('0x56')]=_0x173544;return _0x292f09;});}})[_0x8700('0x34')](respondWithFilteredResult(_0x4df1d6,_0x43070c))[_0x8700('0x29')](handleError(_0x4df1d6,null));};exports[_0x8700('0x69')]=function(_0x4282a1,_0x11f7c8,_0x5d025b){return db[_0x8700('0x3e')][_0x8700('0x5a')]({'where':{'id':_0x4282a1[_0x8700('0x58')]['id']}})[_0x8700('0x34')](handleEntityNotFound(_0x11f7c8,null))[_0x8700('0x34')](function(_0x5403db){if(_0x5403db){return _0x5403db[_0x8700('0x69')](_0x4282a1['query'][_0x8700('0x6a')]);}})[_0x8700('0x34')](respondWithStatusCode(_0x11f7c8,null))[_0x8700('0x29')](handleError(_0x11f7c8,null));};exports[_0x8700('0x6b')]=function(_0x4a5518,_0x518c3c,_0x4a31bd){if(_0x4a5518['body']['id']){delete _0x4a5518['body']['id'];}return db[_0x8700('0x3e')][_0x8700('0x5a')]({'where':{'id':_0x4a5518[_0x8700('0x58')]['id']}})[_0x8700('0x34')](handleEntityNotFound(_0x518c3c,null))[_0x8700('0x34')](function(_0x37c2b5){if(_0x37c2b5){_0x4a5518['body'][_0x8700('0x64')]=_0x37c2b5['id'];return db[_0x8700('0x6c')]['create'](_0x4a5518[_0x8700('0x5c')]);}})[_0x8700('0x34')](respondWithResult(_0x518c3c,null))['catch'](handleError(_0x518c3c,null));};exports[_0x8700('0x6d')]=function(_0x1d508e,_0x15b2fb,_0x520926){var _0x21559d={'raw':![],'where':{}};var _0xa2a6a9={};var _0x2914c4={'count':0x0,'rows':[]};return db[_0x8700('0x3e')][_0x8700('0x66')]({'where':{'id':_0x1d508e[_0x8700('0x58')]['id']}})[_0x8700('0x34')](handleEntityNotFound(_0x15b2fb,null))[_0x8700('0x34')](function(_0x5ae694){if(_0x5ae694){_0xa2a6a9[_0x8700('0x40')]=_[_0x8700('0x41')](db[_0x8700('0x6c')][_0x8700('0x3f')]);_0xa2a6a9[_0x8700('0x42')]=_[_0x8700('0x41')](_0x1d508e[_0x8700('0x42')]);_0xa2a6a9[_0x8700('0x43')]=_[_0x8700('0x45')](_0xa2a6a9[_0x8700('0x40')],_0xa2a6a9[_0x8700('0x42')]);_0x21559d[_0x8700('0x44')]=_[_0x8700('0x45')](_0xa2a6a9[_0x8700('0x40')],qs[_0x8700('0x46')](_0x1d508e[_0x8700('0x42')]['fields']));_0x21559d[_0x8700('0x44')]=_0x21559d[_0x8700('0x44')][_0x8700('0x47')]?_0x21559d[_0x8700('0x44')]:_0xa2a6a9[_0x8700('0x40')];if(!_0x1d508e[_0x8700('0x42')][_0x8700('0x48')](_0x8700('0x49'))){_0x21559d[_0x8700('0x2f')]=qs[_0x8700('0x2f')](_0x1d508e[_0x8700('0x42')][_0x8700('0x2f')]);_0x21559d[_0x8700('0x2e')]=qs[_0x8700('0x2e')](_0x1d508e['query'][_0x8700('0x2e')]);}_0x21559d[_0x8700('0x4a')]=qs[_0x8700('0x4b')](_0x1d508e[_0x8700('0x42')][_0x8700('0x4b')]);_0x21559d[_0x8700('0x4c')]=qs['filters'](_[_0x8700('0x4d')](_0x1d508e[_0x8700('0x42')],_0xa2a6a9[_0x8700('0x43')]));_0x21559d[_0x8700('0x4c')][_0x8700('0x64')]=_0x5ae694['id'];if(_0x1d508e[_0x8700('0x42')]['filter']){_0x21559d['where']=_[_0x8700('0x4e')](_0x21559d[_0x8700('0x4c')],{'$or':_[_0x8700('0x68')](_0x21559d[_0x8700('0x44')],function(_0x4d4eed){var _0x4ac47e={};_0x4ac47e[_0x4d4eed]={'$like':'%'+_0x1d508e['query'][_0x8700('0x51')]+'%'};return _0x4ac47e;})});}_0x21559d=_['merge']({},_0x21559d,_0x1d508e[_0x8700('0x52')]);return db[_0x8700('0x6c')][_0x8700('0x2d')]({'where':_0x21559d[_0x8700('0x4c')]})[_0x8700('0x34')](function(_0x5d0106){_0x2914c4[_0x8700('0x2d')]=_0x5d0106;if(_0x1d508e[_0x8700('0x42')][_0x8700('0x53')]){_0x21559d[_0x8700('0x54')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x21559d);})[_0x8700('0x34')](function(_0x1e04c8){_0x2914c4[_0x8700('0x56')]=_0x1e04c8;return _0x2914c4;});}})['then'](respondWithFilteredResult(_0x15b2fb,_0x21559d))[_0x8700('0x29')](handleError(_0x15b2fb,null));};exports['removeAnswers']=function(_0x5c8664,_0x783d0d,_0x46c4d9){return db['SmsAccount'][_0x8700('0x5a')]({'where':{'id':_0x5c8664['params']['id']}})['then'](handleEntityNotFound(_0x783d0d,null))[_0x8700('0x34')](function(_0x531f84){if(_0x531f84){return _0x531f84['removeAnswers'](_0x5c8664['query'][_0x8700('0x6a')]);}})[_0x8700('0x34')](respondWithStatusCode(_0x783d0d,null))[_0x8700('0x29')](handleError(_0x783d0d,null));};exports['notify']=function(_0x2a7f58,_0x4fb833,_0x596fe3){var _0xaca38e={'channel':_0x8700('0x6e')};var _0x1e2661=[];var _0x15dc46=[];var _0x916c3={};return db['SmsAccount'][_0x8700('0x5a')]({'where':{'id':_0x2a7f58['params']['id']},'include':[{'model':db[_0x8700('0x6f')],'as':_0x8700('0x70')}]})['then'](handleEntityNotFound(_0x4fb833,null))[_0x8700('0x34')](function(_0xa3cc5f){_0xaca38e[_0x8700('0x71')]=_0xa3cc5f;_0xaca38e['applications']=_['orderBy'](_0xa3cc5f[_0x8700('0x70')],[_0x8700('0x72')],['asc']);if(_0xaca38e[_0x8700('0x71')][_0x8700('0x70')]){delete _0xaca38e[_0x8700('0x71')]['Applications'];}return db['CmContact']['describe']();})[_0x8700('0x34')](function(_0x3186e2){if(!_0x3186e2){throw new db[(_0x8700('0x73'))][(_0x8700('0x74'))](_0x8700('0x75'));}_0x1e2661=_[_0x8700('0x76')](_[_0x8700('0x41')](_0x3186e2),['createdAt',_0x8700('0x77')]);_0x15dc46=_[_0x8700('0x76')](_[_0x8700('0x41')](_0x3186e2),['createdAt',_0x8700('0x77'),_0x8700('0x78'),_0x8700('0x79')]);_0xaca38e['body']={'mapKey':_0x8700('0x7a')};if(_0xaca38e[_0x8700('0x71')][_0x8700('0x7b')]){switch(_0xaca38e['account']['type']){case _0x8700('0x7c'):_0xaca38e['body'][_0x8700('0x7d')]=_0x2a7f58[_0x8700('0x5c')][_0x8700('0x7e')];_0xaca38e[_0x8700('0x5c')][_0x8700('0x5c')]=_0x2a7f58[_0x8700('0x5c')][_0x8700('0x7f')];_0xaca38e[_0x8700('0x5c')][_0x8700('0x80')]=_0x2a7f58[_0x8700('0x5c')]['MessageSid'];break;case _0x8700('0x81'):_0xaca38e[_0x8700('0x5c')][_0x8700('0x7d')]='+'+_0x2a7f58[_0x8700('0x5c')]['sender'];_0xaca38e[_0x8700('0x5c')][_0x8700('0x5c')]=_0x2a7f58[_0x8700('0x5c')][_0x8700('0x82')];break;case _0x8700('0x83'):_0xaca38e['body'][_0x8700('0x7d')]=_0x2a7f58[_0x8700('0x5c')][_0x8700('0x7d')];_0xaca38e[_0x8700('0x5c')][_0x8700('0x5c')]=_0x2a7f58[_0x8700('0x5c')][_0x8700('0x26')];break;case'clicksend':_0xaca38e[_0x8700('0x5c')][_0x8700('0x7d')]=_0x2a7f58['body'][_0x8700('0x7d')];_0xaca38e[_0x8700('0x5c')][_0x8700('0x5c')]=_0x2a7f58['body'][_0x8700('0x5c')];_0xaca38e['body'][_0x8700('0x80')]=_0x2a7f58[_0x8700('0x5c')][_0x8700('0x84')];break;case _0x8700('0x85'):_0xaca38e[_0x8700('0x5c')][_0x8700('0x7d')]=_0x2a7f58[_0x8700('0x5c')][_0x8700('0x7e')];_0xaca38e['body']['body']=_0x2a7f58[_0x8700('0x5c')][_0x8700('0x86')];_0xaca38e[_0x8700('0x5c')][_0x8700('0x80')]=_0x2a7f58['body'][_0x8700('0x87')];break;case _0x8700('0x88'):_0xaca38e[_0x8700('0x5c')]['from']='+'+_0x2a7f58[_0x8700('0x5c')][_0x8700('0x89')][0x0][_0x8700('0x7d')];_0xaca38e[_0x8700('0x5c')][_0x8700('0x5c')]=_0x2a7f58[_0x8700('0x5c')][_0x8700('0x89')][0x0][_0x8700('0x82')];_0xaca38e[_0x8700('0x5c')][_0x8700('0x80')]=_0x2a7f58['body'][_0x8700('0x89')][0x0][_0x8700('0x80')];break;case _0x8700('0x8a'):_0xaca38e[_0x8700('0x5c')][_0x8700('0x7d')]=_0x2a7f58[_0x8700('0x5c')][_0x8700('0x8b')];_0xaca38e[_0x8700('0x5c')][_0x8700('0x5c')]=_0x2a7f58[_0x8700('0x5c')][_0x8700('0x8c')]['message'];break;case _0x8700('0x8d'):_0xaca38e[_0x8700('0x5c')][_0x8700('0x7d')]=_0x2a7f58[_0x8700('0x5c')]['fromNumber'];_0xaca38e[_0x8700('0x5c')][_0x8700('0x5c')]=_0x2a7f58['body'][_0x8700('0x82')];_0xaca38e[_0x8700('0x5c')][_0x8700('0x80')]=_0x2a7f58['body'][_0x8700('0x8e')];break;case _0x8700('0x8f'):_0xaca38e[_0x8700('0x5c')][_0x8700('0x7d')]=_0x2a7f58['body'][_0x8700('0x7d')];_0xaca38e[_0x8700('0x5c')][_0x8700('0x5c')]=_0x2a7f58[_0x8700('0x5c')][_0x8700('0x26')];_0xaca38e[_0x8700('0x5c')]['messageId']=_0x2a7f58[_0x8700('0x5c')][_0x8700('0x90')];break;}}if(_0xaca38e[_0x8700('0x5c')]['id']){delete _0xaca38e[_0x8700('0x5c')]['id'];}if(_['isNil'](_0xaca38e[_0x8700('0x5c')]['from'])){throw new db[(_0x8700('0x73'))][(_0x8700('0x74'))](_0x8700('0x91'));}if(_['isNil'](_0xaca38e[_0x8700('0x5c')]['body'])||_0xaca38e[_0x8700('0x5c')][_0x8700('0x5c')]===''){throw new db[(_0x8700('0x73'))][(_0x8700('0x74'))](_0x8700('0x92'));}if(_[_0x8700('0x93')](_0xaca38e[_0x8700('0x5c')]['mapKey'])){throw new db[(_0x8700('0x73'))]['ValidationError'](_0x8700('0x94')+_0x15dc46);}if(!_['includes'](_0x15dc46,_0xaca38e[_0x8700('0x5c')][_0x8700('0x95')])){throw new db['Sequelize'][(_0x8700('0x74'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x15dc46);}_0x916c3[_0xaca38e[_0x8700('0x5c')]['mapKey']]=_0xaca38e[_0x8700('0x5c')]['from'];return db[_0x8700('0x96')][_0x8700('0x5a')]({'where':{'id':_0xaca38e['account'][_0x8700('0x79')]},'include':[{'model':db[_0x8700('0x97')],'as':_0x8700('0x98'),'where':_0x916c3,'limit':0x1,'order':[[_0x8700('0x77'),_0x8700('0x99')]]}]});})[_0x8700('0x34')](handleEntityNotFound(_0x4fb833,null))[_0x8700('0x34')](function(_0x4bfd34){if(_0x4bfd34){_0xaca38e[_0x8700('0x9a')]=_[_0x8700('0x9b')](_0x4bfd34,[_0x8700('0x98')]);if(_0x4bfd34['Contacts']['length']){return _0x4bfd34['Contacts'][0x0];}var _0x2c2b2d=_[_0x8700('0x18')](_0xaca38e[_0x8700('0x5c')],{'firstName':_0xaca38e[_0x8700('0x5c')]['from'],'ListId':_0x4bfd34['id']});_0x2c2b2d[_0xaca38e[_0x8700('0x5c')][_0x8700('0x95')]]=_0xaca38e[_0x8700('0x5c')]['from'];return db['CmContact'][_0x8700('0x5b')](_0x2c2b2d,{'fields':_0x1e2661,'raw':!![]});}})[_0x8700('0x34')](handleEntityNotFound(_0x4fb833,null))['then'](function(_0x8a050c){if(_0x8a050c){_0xaca38e[_0x8700('0x9c')]=_0x8a050c;var _0x3ef9d2={'ContactId':_0x8a050c['id'],'phone':_0xaca38e[_0x8700('0x5c')][_0x8700('0x7d')],'SmsAccountId':_0x2a7f58[_0x8700('0x58')]['id']};var _0xc0b70b={'ContactId':_0x8a050c['id'],'SmsAccountId':_0x2a7f58[_0x8700('0x58')]['id'],'closed':![]};return db[_0x8700('0x9d')][_0x8700('0x5a')]({'where':_0xc0b70b})['then'](function(_0x3f89e5){if(_0x3f89e5){return[_0x3f89e5,![]];}return db[_0x8700('0x9d')][_0x8700('0x5b')](_0x3ef9d2)[_0x8700('0x34')](function(_0x1e7556){return[_0x1e7556,!![]];});});}})['spread'](function(_0x5ada2e,_0x55fe70){_0xaca38e['interaction']=_0x5ada2e[_0x8700('0x35')]({'plain':!![]});_0xaca38e[_0x8700('0x9e')][_0x8700('0x9f')]=![];if(_0x55fe70){if(_0xaca38e[_0x8700('0x71')][_0x8700('0xa0')]){_0xaca38e[_0x8700('0xa1')][_0x8700('0xa2')]({'id':0x0,'priority':_0xaca38e[_0x8700('0xa1')][_0x8700('0x47')]+0x1,'app':_0x8700('0xa3'),'appdata':'unmanaged','interval':'*,*,*,*'});}_0xaca38e[_0x8700('0x9e')][_0x8700('0x9f')]=!![];}return db['SmsMessage'][_0x8700('0x5b')]({'phone':_0xaca38e[_0x8700('0x5c')][_0x8700('0x7d')],'messageId':_0xaca38e[_0x8700('0x5c')][_0x8700('0x80')],'body':_0xaca38e['body'][_0x8700('0x5c')],'SmsAccountId':_0x2a7f58[_0x8700('0x58')]['id'],'SmsInteractionId':_0x5ada2e['id'],'direction':'in','ContactId':_0x5ada2e[_0x8700('0xa4')],'AttachmentId':_0xaca38e[_0x8700('0x5c')][_0x8700('0xa5')]});})[_0x8700('0x34')](function(_0xe3dd95){_0xaca38e['message']=_0xe3dd95;if(_0xaca38e['interaction'][_0x8700('0xa6')]){return db['User'][_0x8700('0x5a')]({'attributes':['id',_0x8700('0x3b')],'where':{'id':_0xaca38e['interaction']['UserId']}})[_0x8700('0x34')](function(_0x41fbf6){if(_0x41fbf6){_0xaca38e[_0x8700('0xa1')][_0x8700('0xa7')]({'id':0x0,'priority':0x0,'app':_0x8700('0xa8'),'appdata':_0x41fbf6[_0x8700('0x3b')]+','+(_0xaca38e['account'][_0x8700('0xa9')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x8700('0xaa'),_0xaca38e);});}return respondWithRpcPromise(_0x8700('0xab'),_0x8700('0xaa'),_0xaca38e);})['then'](function(_0x241b5c){if(_0x241b5c){var _0x43a584=0xc8;var _0x475c53=_0x8700('0xac');logger['info'](_0x8700('0x23'),_0x475c53,_0x43a584,_0x8700('0xad'));logger[_0x8700('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x475c53,_0x43a584,_0x8700('0xad'),JSON[_0x8700('0xae')](_0x241b5c));if(_0xaca38e[_0x8700('0x71')]['type']===_0x8700('0x7c')){return _0x4fb833['status'](_0x43a584)[_0x8700('0xaf')](_0x8700('0xb0'),_0x8700('0xb1'))[_0x8700('0xb2')](_0x8700('0xb3'));}else{return _0x4fb833[_0x8700('0x2a')](_0x43a584)[_0x8700('0x2c')](_0x241b5c);}}})[_0x8700('0x29')](handleError(_0x4fb833,null));};exports[_0x8700('0xb4')]=function(_0x466999,_0x40230d,_0x4501b1){return db['SmsAccount']['findOne']({'where':{'id':_0x466999[_0x8700('0x58')]['id']}})[_0x8700('0x34')](handleEntityNotFound(_0x40230d,null))[_0x8700('0x34')](function(_0x2e2f31){if(_0x2e2f31){return db[_0x8700('0xb5')][_0x8700('0xb6')](function(_0x5f046a){return db[_0x8700('0x6f')]['destroy']({'where':{'SmsAccountId':_0x466999['params']['id']},'transaction':_0x5f046a})[_0x8700('0x34')](function(_0xbd792b){var _0x4ad839=_['map'](_0x466999['body'],function(_0x3b635b){_0x3b635b['SmsAccountId']=_0x466999['params']['id'];return _0x3b635b;});return db[_0x8700('0x6f')]['bulkCreate'](_0x4ad839,{'transaction':_0x5f046a});});})['then'](function(){return db[_0x8700('0x6f')][_0x8700('0xb7')]({'where':{'SmsAccountId':_0x466999[_0x8700('0x58')]['id']},'order':_0x8700('0x72')});});}})[_0x8700('0x34')](respondWithResult(_0x40230d,null))[_0x8700('0x29')](handleError(_0x40230d,null));};exports[_0x8700('0xb8')]=function(_0x4a14cf,_0x37675e,_0x1bd0ac){var _0x13b031={};var _0xc6b05e={};var _0x378575;var _0x3d9c38;return db[_0x8700('0x3e')][_0x8700('0x66')]({'where':{'id':_0x4a14cf['params']['id']}})[_0x8700('0x34')](handleEntityNotFound(_0x37675e,null))[_0x8700('0x34')](function(_0x9be908){if(_0x9be908){_0x378575=_0x9be908;_0xc6b05e[_0x8700('0x40')]=_['keys'](db[_0x8700('0x6f')]['rawAttributes']);_0xc6b05e[_0x8700('0x42')]=_[_0x8700('0x41')](_0x4a14cf[_0x8700('0x42')]);_0xc6b05e['filters']=_[_0x8700('0x45')](_0xc6b05e[_0x8700('0x40')],_0xc6b05e[_0x8700('0x42')]);_0x13b031[_0x8700('0x44')]=_[_0x8700('0x45')](_0xc6b05e[_0x8700('0x40')],qs['fields'](_0x4a14cf[_0x8700('0x42')][_0x8700('0x46')]));_0x13b031[_0x8700('0x44')]=_0x13b031[_0x8700('0x44')][_0x8700('0x47')]?_0x13b031[_0x8700('0x44')]:_0xc6b05e['model'];_0x13b031[_0x8700('0x4a')]=qs[_0x8700('0x4b')](_0x4a14cf['query'][_0x8700('0x4b')]);_0x13b031[_0x8700('0x4c')]=qs[_0x8700('0x43')](_[_0x8700('0x4d')](_0x4a14cf[_0x8700('0x42')],_0xc6b05e[_0x8700('0x43')]));if(_0x4a14cf[_0x8700('0x42')][_0x8700('0x51')]){_0x13b031[_0x8700('0x4c')]=_[_0x8700('0x4e')](_0x13b031['where'],{'$or':_['map'](_0x13b031[_0x8700('0x44')],function(_0x27628){var _0x5ba930={};_0x5ba930[_0x27628]={'$like':'%'+_0x4a14cf['query'][_0x8700('0x51')]+'%'};return _0x5ba930;})});}_0x13b031=_[_0x8700('0x4e')]({},_0x13b031,_0x4a14cf[_0x8700('0x52')]);return _0x378575[_0x8700('0xb8')](_0x13b031);}})[_0x8700('0x34')](function(_0x4bfc3b){if(_0x4bfc3b){_0x3d9c38=_0x4bfc3b['length'];if(!_0x4a14cf[_0x8700('0x42')]['hasOwnProperty'](_0x8700('0x49'))){_0x13b031[_0x8700('0x2f')]=qs[_0x8700('0x2f')](_0x4a14cf['query'][_0x8700('0x2f')]);_0x13b031[_0x8700('0x2e')]=qs[_0x8700('0x2e')](_0x4a14cf[_0x8700('0x42')][_0x8700('0x2e')]);}return _0x378575[_0x8700('0xb8')](_0x13b031);}})[_0x8700('0x34')](function(_0x519516){if(_0x519516){return _0x519516?{'count':_0x3d9c38,'rows':_0x519516}:null;}})[_0x8700('0x34')](respondWithResult(_0x37675e,null))[_0x8700('0x29')](handleError(_0x37675e,null));};exports[_0x8700('0xb9')]=function(_0x4e580e,_0x501104,_0x2c30e3){var _0x3330b7={'raw':![],'where':{}};var _0x1685fa={};var _0x331b73={'count':0x0,'rows':[]};return db['SmsAccount'][_0x8700('0x66')]({'where':{'id':_0x4e580e['params']['id']}})[_0x8700('0x34')](handleEntityNotFound(_0x501104,null))[_0x8700('0x34')](function(_0x1ee1ff){if(_0x1ee1ff){_0x1685fa[_0x8700('0x40')]=_[_0x8700('0x41')](db[_0x8700('0x9d')][_0x8700('0x3f')]);_0x1685fa[_0x8700('0x42')]=_[_0x8700('0x41')](_0x4e580e[_0x8700('0x42')]);_0x1685fa[_0x8700('0x43')]=_[_0x8700('0x45')](_0x1685fa['model'],_0x1685fa[_0x8700('0x42')]);_0x3330b7['attributes']=_['intersection'](_0x1685fa['model'],qs[_0x8700('0x46')](_0x4e580e[_0x8700('0x42')][_0x8700('0x46')]));_0x3330b7['attributes']=_0x3330b7[_0x8700('0x44')][_0x8700('0x47')]?_0x3330b7['attributes']:_0x1685fa[_0x8700('0x40')];if(!_0x4e580e[_0x8700('0x42')][_0x8700('0x48')]('nolimit')){_0x3330b7['limit']=qs['limit'](_0x4e580e[_0x8700('0x42')][_0x8700('0x2f')]);_0x3330b7[_0x8700('0x2e')]=qs['offset'](_0x4e580e[_0x8700('0x42')][_0x8700('0x2e')]);}_0x3330b7[_0x8700('0x4a')]=qs[_0x8700('0x4b')](_0x4e580e[_0x8700('0x42')][_0x8700('0x4b')]);_0x3330b7['where']=qs[_0x8700('0x43')](_['pick'](_0x4e580e[_0x8700('0x42')],_0x1685fa[_0x8700('0x43')]));_0x3330b7[_0x8700('0x4c')]['SmsAccountId']=_0x1ee1ff['id'];if(_0x4e580e[_0x8700('0x42')][_0x8700('0x51')]){_0x3330b7['where']=_['merge'](_0x3330b7[_0x8700('0x4c')],{'$or':_[_0x8700('0x68')](_0x3330b7[_0x8700('0x44')],function(_0x374203){var _0x4068a9={};_0x4068a9[_0x374203]={'$like':'%'+_0x4e580e[_0x8700('0x42')]['filter']+'%'};return _0x4068a9;})});}_0x3330b7=_['merge']({},_0x3330b7,_0x4e580e[_0x8700('0x52')]);return db[_0x8700('0x9d')]['count']({'where':_0x3330b7['where']})[_0x8700('0x34')](function(_0x1e9248){_0x331b73[_0x8700('0x2d')]=_0x1e9248;if(_0x4e580e[_0x8700('0x42')][_0x8700('0x53')]){_0x3330b7['include']=[{'model':db[_0x8700('0x97')],'as':_0x8700('0xba'),'required':![]},{'model':db[_0x8700('0xbb')],'as':_0x8700('0xbc'),'attributes':[_0x8700('0x3b'),_0x8700('0xbd'),'internal'],'required':![]},{'model':db[_0x8700('0xbe')],'as':'Tags','attributes':['id','name',_0x8700('0xbf')],'where':_0x4e580e[_0x8700('0x42')][_0x8700('0xc0')]?{'id':_0x4e580e[_0x8700('0x42')]['tag']}:undefined,'required':_0x4e580e[_0x8700('0x42')][_0x8700('0xc0')]?!![]:![]}];}return db[_0x8700('0x9d')][_0x8700('0x55')](_0x3330b7);})[_0x8700('0x34')](function(_0x30e0c1){_0x331b73[_0x8700('0x56')]=_0x30e0c1;return _0x331b73;});}})[_0x8700('0x34')](respondWithFilteredResult(_0x501104,_0x3330b7))[_0x8700('0x29')](handleError(_0x501104,null));};exports[_0x8700('0xb2')]=function(_0x4dd926,_0x5a86f0,_0x260cea){var _0x2c4f07,_0x564ea0,_0x59ea44;if(_[_0x8700('0x93')](_0x4dd926['body'][_0x8700('0x5c')])||_0x4dd926[_0x8700('0x5c')][_0x8700('0x5c')]===''){throw new db[(_0x8700('0x73'))][(_0x8700('0x74'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x8700('0x93')](_0x4dd926[_0x8700('0x5c')]['to'])){throw new db[(_0x8700('0x73'))][(_0x8700('0x74'))](_0x8700('0xc1'));}_0x2c4f07=_0x4dd926[_0x8700('0x5c')]['to'];return db[_0x8700('0x3e')][_0x8700('0x5a')]({'where':{'id':_0x4dd926[_0x8700('0x58')]['id']},'include':[{'model':db[_0x8700('0x96')],'as':_0x8700('0xc2'),'include':[{'model':db['CmContact'],'as':_0x8700('0x98'),'where':{'mobile':_0x2c4f07},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})['then'](handleEntityNotFound(_0x5a86f0,null))[_0x8700('0x34')](function(_0xd398e2){if(_0xd398e2&&_0xd398e2[_0x8700('0xc2')]){_0x564ea0=_0xd398e2[_0x8700('0x35')]({'plain':!![]});if(_0x564ea0[_0x8700('0xc2')]&&_0x564ea0[_0x8700('0xc2')][_0x8700('0x98')][_0x8700('0x47')]){return _0x564ea0[_0x8700('0xc2')]['Contacts'][0x0];}return db[_0x8700('0x97')]['create'](_['defaults'](_0x4dd926['body'],{'firstName':_0x2c4f07,'mobile':_0x2c4f07,'phone':_0x2c4f07,'ListId':_0x564ea0[_0x8700('0x79')]}));}})[_0x8700('0x34')](handleEntityNotFound(_0x5a86f0,null))[_0x8700('0x34')](function(_0x188c18){if(_0x188c18){_0x59ea44=_0x188c18;return db['SmsInteraction']['find']({'where':{'ContactId':_0x59ea44['id'],'closed':![],'SmsAccountId':_0x564ea0['id']}})[_0x8700('0x34')](function(_0xf786a7){if(_0xf786a7){return[_0xf786a7,![]];}return db[_0x8700('0x9d')][_0x8700('0x5b')]({'UserId':_0x4dd926[_0x8700('0x5d')]['id'],'ContactId':_0x59ea44['id'],'SmsAccountId':_0x564ea0['id'],'phone':_0x2c4f07,'firstMsgDirection':'out','Messages':[_[_0x8700('0x4e')](_0x4dd926[_0x8700('0x5c')],{'read':![],'body':_0x4dd926[_0x8700('0x5c')][_0x8700('0x5c')],'phone':_0x2c4f07,'SmsAccountId':_0x564ea0['id'],'UserId':_0x4dd926['user']['id'],'ContactId':_0x59ea44['id']})]},{'include':[{'model':db[_0x8700('0xc3')],'as':_0x8700('0xc4')}]})['then'](function(_0x11dde1){return[_0x11dde1,!![]];});});}})[_0x8700('0xc5')](function(_0x4a92ca,_0x3f3127){if(_0x3f3127){return _0x4a92ca;}return db[_0x8700('0xc3')][_0x8700('0x5b')](_[_0x8700('0x4e')](_0x4dd926['body'],{'read':![],'body':_0x4dd926[_0x8700('0x5c')]['body'],'phone':_0x2c4f07,'SmsAccountId':_0x564ea0['id'],'SmsInteractionId':_0x4a92ca['id'],'UserId':_0x4dd926[_0x8700('0x5d')]['id'],'ContactId':_0x59ea44['id']}))[_0x8700('0x34')](function(_0x1054d3){_0x4a92ca[_0x8700('0xc6')]['Messages']=[];_0x4a92ca['dataValues']['Messages']['push'](_0x1054d3[_0x8700('0xc6')]);return _0x4a92ca;});})[_0x8700('0x34')](respondWithResult(_0x5a86f0,null))['catch'](handleError(_0x5a86f0,null));};exports[_0x8700('0x2a')]=function(_0x5a000c,_0x12fd8c,_0x307c38){if(_0x5a000c['body']['id']){delete _0x5a000c[_0x8700('0x5c')]['id'];}console['log'](_0x8700('0xc7'),_0x5a000c[_0x8700('0x5c')]);var _0x3e6648,_0x2d7c28,_0x147d0b;return db[_0x8700('0x3e')][_0x8700('0x5a')]({'where':{'id':_0x5a000c[_0x8700('0x58')]['id']}})[_0x8700('0x34')](handleEntityNotFound(_0x12fd8c,null))[_0x8700('0x34')](function(_0x3b40de){if(_0x3b40de){_0x147d0b=_0x3b40de;logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x8700('0x2a'),_0x8700('0xc8'),_0x3b40de[_0x8700('0x7b')],util[_0x8700('0xc9')](_0x5a000c['body'],{'showHidden':![],'depth':null}));switch(_0x3b40de['type']){case _0x8700('0x81'):if(_0x5a000c[_0x8700('0x5c')]['skebby_dispatch_id']&&_0x5a000c[_0x8700('0x5c')][_0x8700('0x2a')]){_0x2d7c28=_0x5a000c[_0x8700('0x5c')][_0x8700('0x2a')];return db[_0x8700('0xc3')]['find']({'where':{'messageId':_0x5a000c['body'][_0x8700('0xca')]}});}break;case _0x8700('0x83'):if(_0x5a000c[_0x8700('0x5c')]['requestid']&&_0x5a000c[_0x8700('0x5c')][_0x8700('0xcb')]){_0x2d7c28=_0x5a000c[_0x8700('0x5c')][_0x8700('0xcb')];return db[_0x8700('0xc3')][_0x8700('0x5a')]({'where':{'messageId':_0x5a000c[_0x8700('0x5c')][_0x8700('0xcc')]}});}break;case _0x8700('0xcd'):if(_0x5a000c['body'][_0x8700('0x84')]&&_0x5a000c[_0x8700('0x5c')][_0x8700('0xce')]){_0x2d7c28=_0x5a000c['body'][_0x8700('0xce')];return db[_0x8700('0xc3')][_0x8700('0x5a')]({'where':{'messageId':_0x5a000c[_0x8700('0x5c')]['message_id']}});}break;case'infobip':var _0x43a696=_0x5a000c[_0x8700('0x5c')][_0x8700('0x89')][0x0];if(_0x43a696[_0x8700('0x80')]&&_0x43a696[_0x8700('0x2a')][_0x8700('0xcf')]===_0x8700('0xd0')){_0x2d7c28=_0x43a696[_0x8700('0x2a')][_0x8700('0xcf')];return db[_0x8700('0xc3')][_0x8700('0x5a')]({'where':{'messageId':_0x43a696[_0x8700('0x80')]}});}break;case'clickatell':if(_0x5a000c[_0x8700('0x5c')][_0x8700('0x80')]&&_0x5a000c['body']['status']){_0x2d7c28=_0x5a000c[_0x8700('0x5c')][_0x8700('0x2a')];return db['SmsMessage'][_0x8700('0x5a')]({'where':{'messageId':_0x5a000c[_0x8700('0x5c')][_0x8700('0x80')]}});}break;case'intelepeer':if(_0x5a000c['body'][_0x8700('0xd1')]&&_0x5a000c[_0x8700('0x5c')]['status']){_0x2d7c28=_0x5a000c[_0x8700('0x5c')][_0x8700('0x2a')];return db[_0x8700('0xc3')]['find']({'where':{'messageId':_0x5a000c[_0x8700('0x5c')][_0x8700('0xd1')]}});}break;}}})['then'](handleEntityNotFound(_0x12fd8c,null))['then'](function(_0xf8c17c){if(_0xf8c17c){_0x3e6648=_0xf8c17c;switch(_0x147d0b[_0x8700('0x7b')]){case'skebby':if(_0x2d7c28===_0x8700('0xd0')){return _0x3e6648[_0x8700('0x33')]({'read':!![]});}else{logger[_0x8700('0x24')](_0x8700('0x23'),_0x8700('0x2a'),_0x8700('0x81'),util[_0x8700('0xc9')](_0x5a000c['body'],{'showHidden':![],'depth':null}));}break;case _0x8700('0x83'):if(_0x2d7c28==='1'){return _0x3e6648[_0x8700('0x33')]({'read':!![]});}else{logger['error'](_0x8700('0x23'),_0x8700('0x2a'),_0x8700('0x81'),util[_0x8700('0xc9')](_0x5a000c[_0x8700('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x8700('0xcd'):if(!_0x5a000c[_0x8700('0x5c')][_0x8700('0xd2')]&&_0x2d7c28>=0xc8&&_0x2d7c28<=0xce){return _0x3e6648[_0x8700('0x33')]({'read':!![]});}else{logger[_0x8700('0x24')](_0x8700('0x23'),_0x8700('0x2a'),_0x8700('0xcd'),util[_0x8700('0xc9')](_0x5a000c['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x1ea7b9=_0x5a000c[_0x8700('0x5c')]['results'][0x0];if(_0x1ea7b9[_0x8700('0x2a')][_0x8700('0xcf')]===_0x8700('0xd0')){return _0x3e6648[_0x8700('0x33')]({'read':!![]});}else{logger[_0x8700('0x24')](_0x8700('0x23'),_0x8700('0x2a'),_0x8700('0x88'),util['inspect'](_0x5a000c['body'],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x2d7c28==_0x8700('0xd3')||_0x2d7c28=='RECEIVED_BY_RECIPIENT'){return _0x3e6648[_0x8700('0x33')]({'read':!![]});}else{logger[_0x8700('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x8700('0x2a'),_0x8700('0x8d'),util[_0x8700('0xc9')](_0x5a000c['body'],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x2d7c28===_0x8700('0xd4')||_0x2d7c28===_0x8700('0xd5')){return _0x3e6648[_0x8700('0x33')]({'read':!![]});}else{logger[_0x8700('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x8700('0x2a'),'intelepeer',util[_0x8700('0xc9')](_0x5a000c[_0x8700('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x3e6648;}})[_0x8700('0x34')](respondWithResult(_0x12fd8c,null))[_0x8700('0x29')](handleError(_0x12fd8c,null));};exports[_0x8700('0xd6')]=function(_0x279723,_0x1c5fe1,_0x53e2f8){var _0x8f22cc,_0x4305f9,_0x30cf5c;return db['SmsAccount'][_0x8700('0x5a')]({'where':{'id':_0x279723['params']['id']}})[_0x8700('0x34')](handleEntityNotFound(_0x1c5fe1,null))[_0x8700('0x34')](function(_0x27ac8e){if(_0x27ac8e){_0x30cf5c=_0x27ac8e;logger[_0x8700('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x8700('0x2a'),_0x8700('0xc8'),_0x27ac8e[_0x8700('0x7b')],util[_0x8700('0xc9')](_0x279723['query'],{'showHidden':![],'depth':null}));switch(_0x27ac8e['type']){case _0x8700('0x8a'):if(_0x279723[_0x8700('0x42')][_0x8700('0xd7')]&&_0x279723['query']['state']){_0x4305f9=_0x279723['query'][_0x8700('0xd8')];return db[_0x8700('0xc3')][_0x8700('0x5a')]({'where':{'messageId':_0x279723[_0x8700('0x42')][_0x8700('0xd7')]}});}break;}}})[_0x8700('0x34')](handleEntityNotFound(_0x1c5fe1,null))[_0x8700('0x34')](function(_0x74004d){if(_0x74004d){_0x8f22cc=_0x74004d;switch(_0x30cf5c['type']){case'csc':if(_0x4305f9==='2'||_0x4305f9==='6'){return _0x8f22cc[_0x8700('0x33')]({'read':!![]});}else{logger[_0x8700('0x24')](_0x8700('0x23'),'status',_0x8700('0x8a'),util['inspect'](_0x279723[_0x8700('0x42')],{'showHidden':![],'depth':null}));};break;}return _0x8f22cc;}})[_0x8700('0x34')](respondWithResult(_0x1c5fe1,null))[_0x8700('0x29')](handleError(_0x1c5fe1,null));};exports['addAgents']=function(_0x151ea6,_0x14e4cd,_0x3f0fd9){return db[_0x8700('0x3e')][_0x8700('0x5a')]({'where':{'id':_0x151ea6[_0x8700('0x58')]['id']}})['then'](handleEntityNotFound(_0x14e4cd,null))[_0x8700('0x34')](function(_0x2ec8f4){if(_0x2ec8f4){return _0x2ec8f4[_0x8700('0xd9')](_0x151ea6['body'][_0x8700('0x6a')],_[_0x8700('0x9b')](_0x151ea6['body'],[_0x8700('0x6a'),'id'])||{})[_0x8700('0xc5')](function(_0x95de1e){for(var _0x160aa2=0x0;_0x160aa2<_0x151ea6[_0x8700('0x5c')]['ids'][_0x8700('0x47')];_0x160aa2+=0x1){socket[_0x8700('0xda')](_0x8700('0xdb'),{'UserId':_0x151ea6['body'][_0x8700('0x6a')][_0x160aa2],'SmsAccountId':_0x151ea6['params']['id']});}return _0x95de1e;});}})[_0x8700('0x34')](respondWithResult(_0x14e4cd,null))[_0x8700('0x29')](handleError(_0x14e4cd,null));};exports[_0x8700('0xdc')]=function(_0x332dd1,_0x16fa68,_0x5a8485){return db[_0x8700('0x3e')][_0x8700('0x5a')]({'where':{'id':_0x332dd1[_0x8700('0x58')]['id']}})[_0x8700('0x34')](handleEntityNotFound(_0x16fa68,null))['then'](function(_0x36ea46){if(_0x36ea46){return _0x36ea46[_0x8700('0xdc')](_0x332dd1[_0x8700('0x42')]['ids'])['then'](function(){if(_[_0x8700('0xdd')](_0x332dd1[_0x8700('0x42')][_0x8700('0x6a')])){for(var _0x232203=0x0;_0x232203<_0x332dd1[_0x8700('0x42')][_0x8700('0x6a')]['length'];_0x232203+=0x1){socket[_0x8700('0xda')]('userSmsAccount:remove',{'UserId':Number(_0x332dd1[_0x8700('0x42')][_0x8700('0x6a')][_0x232203]),'SmsAccountId':Number(_0x332dd1[_0x8700('0x58')]['id'])});}}else{socket[_0x8700('0xda')](_0x8700('0xde'),{'UserId':Number(_0x332dd1[_0x8700('0x42')][_0x8700('0x6a')]),'SmsAccountId':Number(_0x332dd1[_0x8700('0x58')]['id'])});}});}})[_0x8700('0x34')](respondWithStatusCode(_0x16fa68,null))[_0x8700('0x29')](handleError(_0x16fa68,null));};exports[_0x8700('0xdf')]=function(_0x28e3ae,_0xe04557,_0x4d3449){var _0x284d0f={};var _0x1169ef={};var _0x3795f9;var _0x5d5d3b;return db[_0x8700('0x3e')][_0x8700('0x66')]({'where':{'id':_0x28e3ae['params']['id']}})[_0x8700('0x34')](handleEntityNotFound(_0xe04557,null))['then'](function(_0x50e0a3){if(_0x50e0a3){_0x3795f9=_0x50e0a3;_0x1169ef[_0x8700('0x40')]=_[_0x8700('0x41')](db[_0x8700('0xbb')][_0x8700('0x3f')]);_0x1169ef[_0x8700('0x42')]=_[_0x8700('0x41')](_0x28e3ae[_0x8700('0x42')]);_0x1169ef[_0x8700('0x43')]=_[_0x8700('0x45')](_0x1169ef[_0x8700('0x40')],_0x1169ef['query']);_0x284d0f[_0x8700('0x44')]=_[_0x8700('0x45')](_0x1169ef[_0x8700('0x40')],qs[_0x8700('0x46')](_0x28e3ae[_0x8700('0x42')]['fields']));_0x284d0f[_0x8700('0x44')]=_0x284d0f[_0x8700('0x44')][_0x8700('0x47')]?_0x284d0f['attributes']:_0x1169ef[_0x8700('0x40')];_0x284d0f['order']=qs[_0x8700('0x4b')](_0x28e3ae['query'][_0x8700('0x4b')]);_0x284d0f[_0x8700('0x4c')]=qs[_0x8700('0x43')](_[_0x8700('0x4d')](_0x28e3ae[_0x8700('0x42')],_0x1169ef[_0x8700('0x43')]));if(_0x28e3ae[_0x8700('0x42')]['filter']){_0x284d0f[_0x8700('0x4c')]=_[_0x8700('0x4e')](_0x284d0f[_0x8700('0x4c')],{'$or':_[_0x8700('0x68')](_0x284d0f[_0x8700('0x44')],function(_0x32ca84){var _0x1a358b={};_0x1a358b[_0x32ca84]={'$like':'%'+_0x28e3ae[_0x8700('0x42')][_0x8700('0x51')]+'%'};return _0x1a358b;})});}_0x284d0f=_[_0x8700('0x4e')]({},_0x284d0f,_0x28e3ae[_0x8700('0x52')]);return _0x3795f9[_0x8700('0xdf')](_0x284d0f);}})[_0x8700('0x34')](function(_0x43d7f1){if(_0x43d7f1){_0x5d5d3b=_0x43d7f1['length'];if(!_0x28e3ae['query']['hasOwnProperty'](_0x8700('0x49'))){_0x284d0f[_0x8700('0x2f')]=qs[_0x8700('0x2f')](_0x28e3ae[_0x8700('0x42')][_0x8700('0x2f')]);_0x284d0f['offset']=qs['offset'](_0x28e3ae['query'][_0x8700('0x2e')]);}return _0x3795f9['getAgents'](_0x284d0f);}})[_0x8700('0x34')](function(_0x7dedf9){if(_0x7dedf9){return _0x7dedf9?{'count':_0x5d5d3b,'rows':_0x7dedf9}:null;}})['then'](respondWithResult(_0xe04557,null))[_0x8700('0x29')](handleError(_0xe04557,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index df890a1..32151b2 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 _0x4677=['save','remove','emit','hasOwnProperty','hook','events','SmsAccount','setMaxListeners'];(function(_0x492ddd,_0x2ec0d7){var _0x417854=function(_0xb91258){while(--_0xb91258){_0x492ddd['push'](_0x492ddd['shift']());}};_0x417854(++_0x2ec0d7);}(_0x4677,0x155));var _0x7467=function(_0x3a6c67,_0x56b913){_0x3a6c67=_0x3a6c67-0x0;var _0xa76914=_0x4677[_0x3a6c67];return _0xa76914;};'use strict';var EventEmitter=require(_0x7467('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0x7467('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x7467('0x2')](0x0);var events={'afterCreate':_0x7467('0x3'),'afterUpdate':'update','afterDestroy':_0x7467('0x4')};function emitEvent(_0x228e93){return function(_0x22a57e,_0xe227ce,_0x21ce80){SmsAccountEvents[_0x7467('0x5')](_0x228e93+':'+_0x22a57e['id'],_0x22a57e);SmsAccountEvents[_0x7467('0x5')](_0x228e93,_0x22a57e);_0x21ce80(null);};}for(var e in events){if(events[_0x7467('0x6')](e)){var event=events[e];SmsAccount[_0x7467('0x7')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file +var _0x295f=['../../mysqldb','SmsAccount','setMaxListeners','update','remove','emit','hasOwnProperty','exports'];(function(_0xf85b31,_0x74ed3d){var _0x1dc7f3=function(_0x3b78da){while(--_0x3b78da){_0xf85b31['push'](_0xf85b31['shift']());}};_0x1dc7f3(++_0x74ed3d);}(_0x295f,0x168));var _0xf295=function(_0x1de09c,_0x316cf1){_0x1de09c=_0x1de09c-0x0;var _0x25c2ec=_0x295f[_0x1de09c];return _0x25c2ec;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0xf295('0x0'))['db'][_0xf295('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xf295('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf295('0x3'),'afterDestroy':_0xf295('0x4')};function emitEvent(_0x59a1c5){return function(_0x511ab5,_0x269439,_0x21da99){SmsAccountEvents[_0xf295('0x5')](_0x59a1c5+':'+_0x511ab5['id'],_0x511ab5);SmsAccountEvents[_0xf295('0x5')](_0x59a1c5,_0x511ab5);_0x21da99(null);};}for(var e in events){if(events[_0xf295('0x6')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0xf295('0x7')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 35db80e..787cc72 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 _0x0221=['sms_accounts','lodash','util','api','moment','request-promise','rimraf','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount'];(function(_0x31cc23,_0x423417){var _0xd843f7=function(_0x1a322f){while(--_0x1a322f){_0x31cc23['push'](_0x31cc23['shift']());}};_0xd843f7(++_0x423417);}(_0x0221,0x9d));var _0x1022=function(_0x15fd73,_0x462667){_0x15fd73=_0x15fd73-0x0;var _0x41dade=_0x0221[_0x15fd73];return _0x41dade;};'use strict';var _=require(_0x1022('0x0'));var util=require(_0x1022('0x1'));var logger=require('../../config/logger')(_0x1022('0x2'));var moment=require(_0x1022('0x3'));var BPromise=require('bluebird');var rp=require(_0x1022('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1022('0x5'));var config=require(_0x1022('0x6'));var attributes=require(_0x1022('0x7'));module[_0x1022('0x8')]=function(_0x5898ea,_0x2f498b){return _0x5898ea[_0x1022('0x9')](_0x1022('0xa'),attributes,{'tableName':_0x1022('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa74c=['sms_accounts','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x4c15f0,_0x2c6daa){var _0x2f5754=function(_0x292eb2){while(--_0x292eb2){_0x4c15f0['push'](_0x4c15f0['shift']());}};_0x2f5754(++_0x2c6daa);}(_0xa74c,0x1c8));var _0xca74=function(_0x4f2159,_0x3b50b6){_0x4f2159=_0x4f2159-0x0;var _0x5778c1=_0xa74c[_0x4f2159];return _0x5778c1;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xca74('0x0'));var rp=require(_0xca74('0x1'));var fs=require('fs');var path=require(_0xca74('0x2'));var rimraf=require(_0xca74('0x3'));var config=require(_0xca74('0x4'));var attributes=require('./smsAccount.attributes');module[_0xca74('0x5')]=function(_0x2ece06,_0x3b2d2b){return _0x2ece06['define']('SmsAccount',attributes,{'tableName':_0xca74('0x6'),'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 bdf980e..0ccf132 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 _0xd0d9=['map','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','include'];(function(_0x247f3f,_0x5f298e){var _0x1381e6=function(_0x1e8355){while(--_0x1e8355){_0x247f3f['push'](_0x247f3f['shift']());}};_0x1381e6(++_0x5f298e);}(_0xd0d9,0x1c9));var _0x9d0d=function(_0x732ef,_0x55b6c5){_0x732ef=_0x732ef-0x0;var _0xd73cbc=_0xd0d9[_0x732ef];return _0xd73cbc;};'use strict';var _=require(_0x9d0d('0x0'));var util=require(_0x9d0d('0x1'));var moment=require(_0x9d0d('0x2'));var BPromise=require(_0x9d0d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9d0d('0x4'));var db=require(_0x9d0d('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x9d0d('0x6'));var jayson=require(_0x9d0d('0x7'));var client=jayson[_0x9d0d('0x8')][_0x9d0d('0x9')]({'port':0x232a});config['redis']=_[_0x9d0d('0xa')](config[_0x9d0d('0xb')],{'host':_0x9d0d('0xc'),'port':0x18eb});var socket=require(_0x9d0d('0xd'))(new Redis(config[_0x9d0d('0xb')]));require(_0x9d0d('0xe'))[_0x9d0d('0xf')](socket);function respondWithRpcPromise(_0x1392c7,_0x218fe8,_0x1348ae){return new BPromise(function(_0x22b29a,_0x3cf2df){return client[_0x9d0d('0x10')](_0x1392c7,_0x1348ae)[_0x9d0d('0x11')](function(_0x2de52f){logger[_0x9d0d('0x12')](_0x9d0d('0x13'),_0x218fe8,'request\x20sent');logger[_0x9d0d('0x14')](_0x9d0d('0x15'),_0x218fe8,_0x9d0d('0x16'),JSON[_0x9d0d('0x17')](_0x2de52f));if(_0x2de52f['error']){if(_0x2de52f[_0x9d0d('0x18')][_0x9d0d('0x19')]===0x1f4){logger['error'](_0x9d0d('0x13'),_0x218fe8,_0x2de52f[_0x9d0d('0x18')][_0x9d0d('0x1a')]);return _0x3cf2df(_0x2de52f[_0x9d0d('0x18')][_0x9d0d('0x1a')]);}logger[_0x9d0d('0x18')](_0x9d0d('0x13'),_0x218fe8,_0x2de52f['error']['message']);return _0x22b29a(_0x2de52f[_0x9d0d('0x18')][_0x9d0d('0x1a')]);}else{logger[_0x9d0d('0x12')]('SmsAccount,\x20%s,\x20%s',_0x218fe8,_0x9d0d('0x16'));_0x22b29a(_0x2de52f[_0x9d0d('0x1b')][_0x9d0d('0x1a')]);}})[_0x9d0d('0x1c')](function(_0x4f6f4a){logger[_0x9d0d('0x18')](_0x9d0d('0x13'),_0x218fe8,_0x4f6f4a);_0x3cf2df(_0x4f6f4a);});});}exports[_0x9d0d('0x1d')]=function(_0x2de3d2){var _0x113165=this;return new Promise(function(_0x2f3ef1,_0x3571de){return db[_0x9d0d('0x1e')][_0x9d0d('0x1f')]({'raw':_0x2de3d2['options']?_0x2de3d2[_0x9d0d('0x20')][_0x9d0d('0x21')]===undefined?!![]:![]:!![],'where':_0x2de3d2[_0x9d0d('0x20')]?_0x2de3d2[_0x9d0d('0x20')][_0x9d0d('0x22')]||null:null,'attributes':_0x2de3d2['options']?_0x2de3d2[_0x9d0d('0x20')][_0x9d0d('0x23')]||null:null,'include':_0x2de3d2[_0x9d0d('0x20')]?_0x2de3d2[_0x9d0d('0x20')][_0x9d0d('0x24')]?_['map'](_0x2de3d2[_0x9d0d('0x20')]['include'],function(_0x78637c){return{'model':db[_0x78637c['model']],'as':_0x78637c['as'],'attributes':_0x78637c['attributes'],'include':_0x78637c[_0x9d0d('0x24')]?_[_0x9d0d('0x25')](_0x78637c[_0x9d0d('0x24')],function(_0x17dc21){return{'model':db[_0x17dc21['model']],'as':_0x17dc21['as'],'attributes':_0x17dc21['attributes'],'include':_0x17dc21['include']?_[_0x9d0d('0x25')](_0x17dc21[_0x9d0d('0x24')],function(_0x1e3312){return{'model':db[_0x1e3312['model']],'as':_0x1e3312['as'],'attributes':_0x1e3312[_0x9d0d('0x23')]};}):[]};}):[]};}):[]:[]})[_0x9d0d('0x11')](function(_0x43277d){logger['info'](_0x9d0d('0x1d'),_0x2de3d2);logger[_0x9d0d('0x14')](_0x9d0d('0x1d'),_0x2de3d2,JSON['stringify'](_0x43277d));_0x2f3ef1(_0x43277d);})[_0x9d0d('0x1c')](function(_0x521be9){logger[_0x9d0d('0x18')](_0x9d0d('0x1d'),_0x521be9['message'],_0x2de3d2);_0x3571de(_0x113165[_0x9d0d('0x18')](0x1f4,_0x521be9[_0x9d0d('0x1a')]));});});}; \ No newline at end of file +var _0xed86=['info','SmsAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','include','map','model','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','then'];(function(_0x26641c,_0x1ba2a5){var _0x42c01a=function(_0x15c7da){while(--_0x15c7da){_0x26641c['push'](_0x26641c['shift']());}};_0x42c01a(++_0x1ba2a5);}(_0xed86,0x8b));var _0x6ed8=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xed86[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x6ed8('0x0'));var util=require('util');var moment=require(_0x6ed8('0x1'));var BPromise=require(_0x6ed8('0x2'));var rs=require(_0x6ed8('0x3'));var fs=require('fs');var Redis=require(_0x6ed8('0x4'));var db=require(_0x6ed8('0x5'))['db'];var utils=require(_0x6ed8('0x6'));var logger=require(_0x6ed8('0x7'))(_0x6ed8('0x8'));var config=require(_0x6ed8('0x9'));var jayson=require(_0x6ed8('0xa'));var client=jayson[_0x6ed8('0xb')][_0x6ed8('0xc')]({'port':0x232a});config[_0x6ed8('0xd')]=_[_0x6ed8('0xe')](config[_0x6ed8('0xd')],{'host':_0x6ed8('0xf'),'port':0x18eb});var socket=require(_0x6ed8('0x10'))(new Redis(config[_0x6ed8('0xd')]));require(_0x6ed8('0x11'))[_0x6ed8('0x12')](socket);function respondWithRpcPromise(_0x36ee66,_0x2f07b1,_0x58435d){return new BPromise(function(_0x2dfcdd,_0x360453){return client[_0x6ed8('0x13')](_0x36ee66,_0x58435d)[_0x6ed8('0x14')](function(_0x5e9f86){logger[_0x6ed8('0x15')](_0x6ed8('0x16'),_0x2f07b1,'request\x20sent');logger[_0x6ed8('0x17')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2f07b1,_0x6ed8('0x18'),JSON[_0x6ed8('0x19')](_0x5e9f86));if(_0x5e9f86[_0x6ed8('0x1a')]){if(_0x5e9f86['error']['code']===0x1f4){logger['error'](_0x6ed8('0x16'),_0x2f07b1,_0x5e9f86['error'][_0x6ed8('0x1b')]);return _0x360453(_0x5e9f86['error']['message']);}logger[_0x6ed8('0x1a')](_0x6ed8('0x16'),_0x2f07b1,_0x5e9f86[_0x6ed8('0x1a')]['message']);return _0x2dfcdd(_0x5e9f86[_0x6ed8('0x1a')]['message']);}else{logger[_0x6ed8('0x15')](_0x6ed8('0x16'),_0x2f07b1,_0x6ed8('0x18'));_0x2dfcdd(_0x5e9f86[_0x6ed8('0x1c')][_0x6ed8('0x1b')]);}})[_0x6ed8('0x1d')](function(_0x402e37){logger[_0x6ed8('0x1a')](_0x6ed8('0x16'),_0x2f07b1,_0x402e37);_0x360453(_0x402e37);});});}exports[_0x6ed8('0x1e')]=function(_0x5d09b7){var _0x7f0cfe=this;return new Promise(function(_0x430e74,_0x3677dc){return db[_0x6ed8('0x1f')][_0x6ed8('0x20')]({'raw':_0x5d09b7[_0x6ed8('0x21')]?_0x5d09b7[_0x6ed8('0x21')][_0x6ed8('0x22')]===undefined?!![]:![]:!![],'where':_0x5d09b7[_0x6ed8('0x21')]?_0x5d09b7[_0x6ed8('0x21')][_0x6ed8('0x23')]||null:null,'attributes':_0x5d09b7[_0x6ed8('0x21')]?_0x5d09b7[_0x6ed8('0x21')][_0x6ed8('0x24')]||null:null,'include':_0x5d09b7[_0x6ed8('0x21')]?_0x5d09b7[_0x6ed8('0x21')][_0x6ed8('0x25')]?_[_0x6ed8('0x26')](_0x5d09b7[_0x6ed8('0x21')][_0x6ed8('0x25')],function(_0x1864e1){return{'model':db[_0x1864e1[_0x6ed8('0x27')]],'as':_0x1864e1['as'],'attributes':_0x1864e1['attributes'],'include':_0x1864e1[_0x6ed8('0x25')]?_[_0x6ed8('0x26')](_0x1864e1[_0x6ed8('0x25')],function(_0x22f53d){return{'model':db[_0x22f53d[_0x6ed8('0x27')]],'as':_0x22f53d['as'],'attributes':_0x22f53d[_0x6ed8('0x24')],'include':_0x22f53d['include']?_[_0x6ed8('0x26')](_0x22f53d[_0x6ed8('0x25')],function(_0x458a51){return{'model':db[_0x458a51['model']],'as':_0x458a51['as'],'attributes':_0x458a51[_0x6ed8('0x24')]};}):[]};}):[]};}):[]:[]})[_0x6ed8('0x14')](function(_0x572a78){logger[_0x6ed8('0x15')](_0x6ed8('0x1e'),_0x5d09b7);logger[_0x6ed8('0x17')]('ShowSmsAccount',_0x5d09b7,JSON[_0x6ed8('0x19')](_0x572a78));_0x430e74(_0x572a78);})[_0x6ed8('0x1d')](function(_0x129454){logger['error'](_0x6ed8('0x1e'),_0x129454['message'],_0x5d09b7);_0x3677dc(_0x7f0cfe[_0x6ed8('0x1a')](0x1f4,_0x129454[_0x6ed8('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 7025e70..a3af768 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 _0xa2f7=['remove','update','removeListener','length','smsAccount:','./smsAccount.events','save'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0xa2f7,0xfa));var _0x7a2f=function(_0x5bbf47,_0x21f1cd){_0x5bbf47=_0x5bbf47-0x0;var _0x1a1f9a=_0xa2f7[_0x5bbf47];return _0x1a1f9a;};'use strict';var SmsAccountEvents=require(_0x7a2f('0x0'));var events=[_0x7a2f('0x1'),_0x7a2f('0x2'),_0x7a2f('0x3')];function createListener(_0xa765b5,_0xed340){return function(_0x37b68e){_0xed340['emit'](_0xa765b5,_0x37b68e);};}function removeListener(_0x526a7f,_0x4d8ffb){return function(){SmsAccountEvents[_0x7a2f('0x4')](_0x526a7f,_0x4d8ffb);};}exports['register']=function(_0x3f29ca){for(var _0x4e68aa=0x0,_0x3ea7b7=events[_0x7a2f('0x5')];_0x4e68aa<_0x3ea7b7;_0x4e68aa++){var _0x4dc964=events[_0x4e68aa];var _0x3f9161=createListener(_0x7a2f('0x6')+_0x4dc964,_0x3f29ca);SmsAccountEvents['on'](_0x4dc964,_0x3f9161);}}; \ No newline at end of file +var _0xa86a=['removeListener','register','length','smsAccount:','./smsAccount.events','save','remove','emit'];(function(_0x312ff9,_0x542478){var _0x1ece92=function(_0x266e1a){while(--_0x266e1a){_0x312ff9['push'](_0x312ff9['shift']());}};_0x1ece92(++_0x542478);}(_0xa86a,0xb4));var _0xaa86=function(_0x297754,_0x22cbb7){_0x297754=_0x297754-0x0;var _0x499cf7=_0xa86a[_0x297754];return _0x499cf7;};'use strict';var SmsAccountEvents=require(_0xaa86('0x0'));var events=[_0xaa86('0x1'),_0xaa86('0x2'),'update'];function createListener(_0x25d5f4,_0x2ef4fb){return function(_0x3760b5){_0x2ef4fb[_0xaa86('0x3')](_0x25d5f4,_0x3760b5);};}function removeListener(_0x1a5e1f,_0x4937bf){return function(){SmsAccountEvents[_0xaa86('0x4')](_0x1a5e1f,_0x4937bf);};}exports[_0xaa86('0x5')]=function(_0x176bf4){for(var _0x2aae89=0x0,_0x2dae39=events[_0xaa86('0x6')];_0x2aae89<_0x2dae39;_0x2aae89++){var _0x6ab164=events[_0x2aae89];var _0x41c9dc=createListener(_0xaa86('0x7')+_0x6ab164,_0x176bf4);SmsAccountEvents['on'](_0x6ab164,_0x41c9dc);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index d4b7c81..3d1c95d 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 _0x919f=['connect-timeout','express','Router','../../components/auth/service','./smsApplication.controller','get','isAuthenticated','index','/:id','put','update','exports','multer','util','path'];(function(_0x145eca,_0x1d393f){var _0x2ede48=function(_0x2ce60b){while(--_0x2ce60b){_0x145eca['push'](_0x145eca['shift']());}};_0x2ede48(++_0x1d393f);}(_0x919f,0x10b));var _0xf919=function(_0x1a190d,_0x14710b){_0x1a190d=_0x1a190d-0x0;var _0x3f3137=_0x919f[_0x1a190d];return _0x3f3137;};'use strict';var multer=require(_0xf919('0x0'));var util=require(_0xf919('0x1'));var path=require(_0xf919('0x2'));var timeout=require(_0xf919('0x3'));var express=require(_0xf919('0x4'));var router=express[_0xf919('0x5')]();var auth=require(_0xf919('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf919('0x7'));router[_0xf919('0x8')]('/',auth[_0xf919('0x9')](),controller[_0xf919('0xa')]);router[_0xf919('0x8')](_0xf919('0xb'),auth[_0xf919('0x9')](),controller['show']);router['post']('/',auth[_0xf919('0x9')](),controller['create']);router[_0xf919('0xc')]('/:id',auth[_0xf919('0x9')](),controller[_0xf919('0xd')]);router['delete']('/:id',auth[_0xf919('0x9')](),controller['destroy']);module[_0xf919('0xe')]=router; \ No newline at end of file +var _0x6c09=['exports','multer','path','../../components/interaction/service','./smsApplication.controller','isAuthenticated','index','get','/:id','show','post','create','put','delete','destroy'];(function(_0x2fbcea,_0xc5327b){var _0x3ad2e8=function(_0x34ef6e){while(--_0x34ef6e){_0x2fbcea['push'](_0x2fbcea['shift']());}};_0x3ad2e8(++_0xc5327b);}(_0x6c09,0x196));var _0x96c0=function(_0x5628ad,_0x18aabf){_0x5628ad=_0x5628ad-0x0;var _0xcf0555=_0x6c09[_0x5628ad];return _0xcf0555;};'use strict';var multer=require(_0x96c0('0x0'));var util=require('util');var path=require(_0x96c0('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x96c0('0x2'));var config=require('../../config/environment');var controller=require(_0x96c0('0x3'));router['get']('/',auth[_0x96c0('0x4')](),controller[_0x96c0('0x5')]);router[_0x96c0('0x6')](_0x96c0('0x7'),auth['isAuthenticated'](),controller[_0x96c0('0x8')]);router[_0x96c0('0x9')]('/',auth[_0x96c0('0x4')](),controller[_0x96c0('0xa')]);router[_0x96c0('0xb')](_0x96c0('0x7'),auth[_0x96c0('0x4')](),controller['update']);router[_0x96c0('0xc')](_0x96c0('0x7'),auth['isAuthenticated'](),controller[_0x96c0('0xd')]);module[_0x96c0('0xe')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 51ec848..88a88d3 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 _0xe9ef=['*,*,*,*','sequelize','INTEGER','STRING','TEXT'];(function(_0x3c4ffa,_0x51ddbf){var _0x1bc7e7=function(_0xbd6d71){while(--_0xbd6d71){_0x3c4ffa['push'](_0x3c4ffa['shift']());}};_0x1bc7e7(++_0x51ddbf);}(_0xe9ef,0x16e));var _0xfe9e=function(_0x4b2b03,_0xbf34ee){_0x4b2b03=_0x4b2b03-0x0;var _0x1bf0ed=_0xe9ef[_0x4b2b03];return _0x1bf0ed;};'use strict';var Sequelize=require(_0xfe9e('0x0'));module['exports']={'priority':{'type':Sequelize[_0xfe9e('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xfe9e('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xfe9e('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xfe9e('0x2')],'defaultValue':_0xfe9e('0x4')}}; \ No newline at end of file +var _0x2687=['exports','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x346fb3,_0xd3d3ac){var _0x126c95=function(_0x26c07c){while(--_0x26c07c){_0x346fb3['push'](_0x346fb3['shift']());}};_0x126c95(++_0xd3d3ac);}(_0x2687,0x8f));var _0x7268=function(_0x731ce3,_0x46ecda){_0x731ce3=_0x731ce3-0x0;var _0x3ee6be=_0x2687[_0x731ce3];return _0x3ee6be;};'use strict';var Sequelize=require(_0x7268('0x0'));module[_0x7268('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x7268('0x2')],'allowNull':![],'defaultValue':_0x7268('0x3')},'appdata':{'type':Sequelize[_0x7268('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x7268('0x2')],'defaultValue':_0x7268('0x5')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 6f96dbc..50c4634 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 _0x8cdd=['find','catch','create','body','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','SmsApplication','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','key','field','options','findAll','show','params','rawAttributes','includeAll','include'];(function(_0x4f027d,_0x3f9587){var _0xc46890=function(_0x27d06c){while(--_0x27d06c){_0x4f027d['push'](_0x4f027d['shift']());}};_0xc46890(++_0x3f9587);}(_0x8cdd,0x120));var _0xd8cd=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x8cdd[_0x5b561d];return _0x431060;};'use strict';var pdf=require(_0xd8cd('0x0'));var emlformat=require(_0xd8cd('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd8cd('0x2'));var jsonpatch=require(_0xd8cd('0x3'));var rp=require('request-promise');var moment=require(_0xd8cd('0x4'));var BPromise=require(_0xd8cd('0x5'));var Mustache=require(_0xd8cd('0x6'));var util=require(_0xd8cd('0x7'));var path=require(_0xd8cd('0x8'));var sox=require(_0xd8cd('0x9'));var csv=require(_0xd8cd('0xa'));var ejs=require(_0xd8cd('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd8cd('0xc'));var crypto=require(_0xd8cd('0xd'));var jsforce=require(_0xd8cd('0xe'));var deskjs=require(_0xd8cd('0xf'));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(_0xd8cd('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd8cd('0x11'))('api');var utils=require(_0xd8cd('0x12'));var config=require(_0xd8cd('0x13'));var db=require(_0xd8cd('0x14'))['db'];function respondWithStatusCode(_0x2f8144,_0x5a7ab3){_0x5a7ab3=_0x5a7ab3||0xcc;return function(_0x197050){if(_0x197050){return _0x2f8144[_0xd8cd('0x15')](_0x5a7ab3);}return _0x2f8144[_0xd8cd('0x16')](_0x5a7ab3)[_0xd8cd('0x17')]();};}function respondWithResult(_0x218d66,_0x1f7d28){_0x1f7d28=_0x1f7d28||0xc8;return function(_0x18d06c){if(_0x18d06c){return _0x218d66[_0xd8cd('0x16')](_0x1f7d28)[_0xd8cd('0x18')](_0x18d06c);}};}function respondWithFilteredResult(_0x5802e1,_0x29b3ff){return function(_0x5e374a){if(_0x5e374a){var _0x3fe756=_0x5e374a[_0xd8cd('0x19')],_0x506cc2=_0x29b3ff[_0xd8cd('0x1a')],_0x54c11b=_0x29b3ff[_0xd8cd('0x1a')]+_0x29b3ff[_0xd8cd('0x1b')],_0x215d10;if(_0x54c11b>=_0x3fe756){_0x54c11b=_0x3fe756;_0x215d10=0xc8;}else{_0x215d10=0xce;}_0x5802e1['status'](_0x215d10);return _0x5802e1[_0xd8cd('0x1c')](_0xd8cd('0x1d'),_0x506cc2+'-'+_0x54c11b+'/'+_0x3fe756)[_0xd8cd('0x18')](_0x5e374a);}return null;};}function patchUpdates(_0x2462d6){return function(_0x240468){try{jsonpatch[_0xd8cd('0x1e')](_0x240468,_0x2462d6,!![]);}catch(_0x3b304f){return BPromise[_0xd8cd('0x1f')](_0x3b304f);}return _0x240468[_0xd8cd('0x20')]();};}function saveUpdates(_0x3584e8,_0xfe1e75){return function(_0x366b94){if(_0x366b94){return _0x366b94[_0xd8cd('0x21')](_0x3584e8)[_0xd8cd('0x22')](function(_0xda2dd5){return _0xda2dd5;});}return null;};}function removeEntity(_0x157c7e,_0x4d848c){return function(_0x7da359){if(_0x7da359){return _0x7da359[_0xd8cd('0x23')]()['then'](function(){_0x157c7e[_0xd8cd('0x16')](0xcc)[_0xd8cd('0x17')]();});}};}function handleEntityNotFound(_0x4311d7,_0x5dc23a){return function(_0x3d51a2){if(!_0x3d51a2){_0x4311d7['sendStatus'](0x194);}return _0x3d51a2;};}function handleError(_0x20f74c,_0x3caba1){_0x3caba1=_0x3caba1||0x1f4;return function(_0x25446d){logger[_0xd8cd('0x24')](_0x25446d[_0xd8cd('0x25')]);if(_0x25446d['name']){delete _0x25446d[_0xd8cd('0x26')];}_0x20f74c[_0xd8cd('0x16')](_0x3caba1)[_0xd8cd('0x27')](_0x25446d);};}exports[_0xd8cd('0x28')]=function(_0x421fad,_0x1a5830){var _0x14d62f={},_0x3087dc={},_0x4d4708={'count':0x0,'rows':[]};var _0x1c4792=db[_0xd8cd('0x29')]['rawAttributes'];_0x3087dc['model']=_[_0xd8cd('0x2a')](_0x1c4792);_0x3087dc[_0xd8cd('0x2b')]=_[_0xd8cd('0x2a')](_0x421fad[_0xd8cd('0x2b')]);_0x3087dc[_0xd8cd('0x2c')]=_[_0xd8cd('0x2d')](_0x3087dc[_0xd8cd('0x2e')],_0x3087dc[_0xd8cd('0x2b')]);_0x14d62f[_0xd8cd('0x2f')]=_['intersection'](_0x3087dc[_0xd8cd('0x2e')],qs[_0xd8cd('0x30')](_0x421fad[_0xd8cd('0x2b')][_0xd8cd('0x30')]));_0x14d62f[_0xd8cd('0x2f')]=_0x14d62f[_0xd8cd('0x2f')][_0xd8cd('0x31')]?_0x14d62f[_0xd8cd('0x2f')]:_0x3087dc[_0xd8cd('0x2e')];if(!_0x421fad[_0xd8cd('0x2b')][_0xd8cd('0x32')](_0xd8cd('0x33'))){_0x14d62f[_0xd8cd('0x1b')]=qs[_0xd8cd('0x1b')](_0x421fad['query'][_0xd8cd('0x1b')]);_0x14d62f[_0xd8cd('0x1a')]=qs[_0xd8cd('0x1a')](_0x421fad['query'][_0xd8cd('0x1a')]);}_0x14d62f[_0xd8cd('0x34')]=qs['sort'](_0x421fad[_0xd8cd('0x2b')][_0xd8cd('0x35')]);_0x14d62f[_0xd8cd('0x36')]=qs[_0xd8cd('0x2c')](_['pick'](_0x421fad[_0xd8cd('0x2b')],_0x3087dc[_0xd8cd('0x2c')]));if(_0x421fad['query'][_0xd8cd('0x37')]){_0x14d62f[_0xd8cd('0x36')]=_[_0xd8cd('0x38')](_0x14d62f[_0xd8cd('0x36')],{'$or':_['map'](_0x1c4792,function(_0x542dd8){if(_0x542dd8[_0xd8cd('0x39')][_0xd8cd('0x3a')]!=='VIRTUAL'){var _0x1af7b3={};_0x1af7b3[_0x542dd8[_0xd8cd('0x3b')]]={'$like':'%'+_0x421fad['query']['filter']+'%'};return _0x1af7b3;}})});}_0x14d62f=_[_0xd8cd('0x38')]({},_0x14d62f,_0x421fad[_0xd8cd('0x3c')]);var _0x1d588c={'where':_0x14d62f['where']};return db[_0xd8cd('0x29')]['count'](_0x1d588c)[_0xd8cd('0x22')](function(_0x4d1837){_0x4d4708[_0xd8cd('0x19')]=_0x4d1837;if(_0x421fad[_0xd8cd('0x2b')]['includeAll']){_0x14d62f['include']=[{'all':!![]}];}return db['SmsApplication'][_0xd8cd('0x3d')](_0x14d62f);})[_0xd8cd('0x22')](function(_0x288b64){_0x4d4708['rows']=_0x288b64;return _0x4d4708;})[_0xd8cd('0x22')](respondWithFilteredResult(_0x1a5830,_0x14d62f))['catch'](handleError(_0x1a5830,null));};exports[_0xd8cd('0x3e')]=function(_0x1275a0,_0x13c060){var _0x599447={'raw':!![],'where':{'id':_0x1275a0[_0xd8cd('0x3f')]['id']}},_0x2207d2={};_0x2207d2[_0xd8cd('0x2e')]=_[_0xd8cd('0x2a')](db[_0xd8cd('0x29')][_0xd8cd('0x40')]);_0x2207d2[_0xd8cd('0x2b')]=_['keys'](_0x1275a0[_0xd8cd('0x2b')]);_0x2207d2['filters']=_[_0xd8cd('0x2d')](_0x2207d2['model'],_0x2207d2[_0xd8cd('0x2b')]);_0x599447['attributes']=_[_0xd8cd('0x2d')](_0x2207d2[_0xd8cd('0x2e')],qs['fields'](_0x1275a0['query'][_0xd8cd('0x30')]));_0x599447['attributes']=_0x599447[_0xd8cd('0x2f')][_0xd8cd('0x31')]?_0x599447[_0xd8cd('0x2f')]:_0x2207d2[_0xd8cd('0x2e')];if(_0x1275a0['query'][_0xd8cd('0x41')]){_0x599447[_0xd8cd('0x42')]=[{'all':!![]}];}_0x599447=_[_0xd8cd('0x38')]({},_0x599447,_0x1275a0['options']);return db[_0xd8cd('0x29')][_0xd8cd('0x43')](_0x599447)[_0xd8cd('0x22')](handleEntityNotFound(_0x13c060,null))['then'](respondWithResult(_0x13c060,null))[_0xd8cd('0x44')](handleError(_0x13c060,null));};exports[_0xd8cd('0x45')]=function(_0x269ed8,_0x4d2bbe){return db[_0xd8cd('0x29')][_0xd8cd('0x45')](_0x269ed8[_0xd8cd('0x46')],{})[_0xd8cd('0x22')](respondWithResult(_0x4d2bbe,0xc9))[_0xd8cd('0x44')](handleError(_0x4d2bbe,null));};exports[_0xd8cd('0x21')]=function(_0x3d6f7b,_0x13a221){if(_0x3d6f7b[_0xd8cd('0x46')]['id']){delete _0x3d6f7b[_0xd8cd('0x46')]['id'];}return db[_0xd8cd('0x29')][_0xd8cd('0x43')]({'where':{'id':_0x3d6f7b[_0xd8cd('0x3f')]['id']}})[_0xd8cd('0x22')](handleEntityNotFound(_0x13a221,null))[_0xd8cd('0x22')](saveUpdates(_0x3d6f7b[_0xd8cd('0x46')],null))[_0xd8cd('0x22')](respondWithResult(_0x13a221,null))[_0xd8cd('0x44')](handleError(_0x13a221,null));};exports[_0xd8cd('0x23')]=function(_0x3a0c4f,_0x19b024){return db[_0xd8cd('0x29')][_0xd8cd('0x43')]({'where':{'id':_0x3a0c4f[_0xd8cd('0x3f')]['id']}})[_0xd8cd('0x22')](handleEntityNotFound(_0x19b024,null))[_0xd8cd('0x22')](removeEntity(_0x19b024,null))[_0xd8cd('0x44')](handleError(_0x19b024,null));}; \ No newline at end of file +var _0x811c=['findAll','show','find','catch','create','body','update','params','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','then','error','stack','name','send','SmsApplication','rawAttributes','keys','query','intersection','model','attributes','fields','length','nolimit','order','where','filters','filter','merge','map','key','field','options','includeAll','include'];(function(_0x5ee611,_0x4c5f32){var _0x231396=function(_0x3ac840){while(--_0x3ac840){_0x5ee611['push'](_0x5ee611['shift']());}};_0x231396(++_0x4c5f32);}(_0x811c,0xd1));var _0xc811=function(_0x3a913a,_0xc0a980){_0x3a913a=_0x3a913a-0x0;var _0x460f79=_0x811c[_0x3a913a];return _0x460f79;};'use strict';var pdf=require(_0xc811('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc811('0x1'));var zipdir=require(_0xc811('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc811('0x3'));var moment=require(_0xc811('0x4'));var BPromise=require(_0xc811('0x5'));var Mustache=require(_0xc811('0x6'));var util=require(_0xc811('0x7'));var path=require(_0xc811('0x8'));var sox=require(_0xc811('0x9'));var csv=require(_0xc811('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc811('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc811('0xc'));var toCsv=require(_0xc811('0xa'));var querystring=require(_0xc811('0xd'));var Papa=require(_0xc811('0xe'));var Redis=require('ioredis');var authService=require(_0xc811('0xf'));var qs=require(_0xc811('0x10'));var hardwareService=require(_0xc811('0x11'));var logger=require(_0xc811('0x12'))(_0xc811('0x13'));var utils=require(_0xc811('0x14'));var config=require(_0xc811('0x15'));var db=require(_0xc811('0x16'))['db'];function respondWithStatusCode(_0x5c7751,_0x1fa97b){_0x1fa97b=_0x1fa97b||0xcc;return function(_0x23ecb7){if(_0x23ecb7){return _0x5c7751[_0xc811('0x17')](_0x1fa97b);}return _0x5c7751[_0xc811('0x18')](_0x1fa97b)[_0xc811('0x19')]();};}function respondWithResult(_0x4c174e,_0x237a30){_0x237a30=_0x237a30||0xc8;return function(_0x1d3e88){if(_0x1d3e88){return _0x4c174e[_0xc811('0x18')](_0x237a30)[_0xc811('0x1a')](_0x1d3e88);}};}function respondWithFilteredResult(_0x157c73,_0xf5c895){return function(_0x102d93){if(_0x102d93){var _0x1dc4f9=_0x102d93[_0xc811('0x1b')],_0x2a6cdb=_0xf5c895[_0xc811('0x1c')],_0x33cb4d=_0xf5c895[_0xc811('0x1c')]+_0xf5c895[_0xc811('0x1d')],_0x236852;if(_0x33cb4d>=_0x1dc4f9){_0x33cb4d=_0x1dc4f9;_0x236852=0xc8;}else{_0x236852=0xce;}_0x157c73[_0xc811('0x18')](_0x236852);return _0x157c73['set'](_0xc811('0x1e'),_0x2a6cdb+'-'+_0x33cb4d+'/'+_0x1dc4f9)['json'](_0x102d93);}return null;};}function patchUpdates(_0x35ae0){return function(_0x55912a){try{jsonpatch[_0xc811('0x1f')](_0x55912a,_0x35ae0,!![]);}catch(_0x23f9e7){return BPromise[_0xc811('0x20')](_0x23f9e7);}return _0x55912a['save']();};}function saveUpdates(_0x162ca0,_0x5d8848){return function(_0x47e4b9){if(_0x47e4b9){return _0x47e4b9['update'](_0x162ca0)[_0xc811('0x21')](function(_0x1e3f6e){return _0x1e3f6e;});}return null;};}function removeEntity(_0x425971,_0x5e6135){return function(_0x1324da){if(_0x1324da){return _0x1324da['destroy']()[_0xc811('0x21')](function(){_0x425971[_0xc811('0x18')](0xcc)[_0xc811('0x19')]();});}};}function handleEntityNotFound(_0x5108d6,_0x194363){return function(_0x29cf82){if(!_0x29cf82){_0x5108d6[_0xc811('0x17')](0x194);}return _0x29cf82;};}function handleError(_0x23bf8e,_0x57b81f){_0x57b81f=_0x57b81f||0x1f4;return function(_0x250cd0){logger[_0xc811('0x22')](_0x250cd0[_0xc811('0x23')]);if(_0x250cd0['name']){delete _0x250cd0[_0xc811('0x24')];}_0x23bf8e['status'](_0x57b81f)[_0xc811('0x25')](_0x250cd0);};}exports['index']=function(_0x49e1e5,_0x225728){var _0x47f880={},_0x58a89c={},_0x447376={'count':0x0,'rows':[]};var _0x17e411=db[_0xc811('0x26')][_0xc811('0x27')];_0x58a89c['model']=_[_0xc811('0x28')](_0x17e411);_0x58a89c['query']=_['keys'](_0x49e1e5[_0xc811('0x29')]);_0x58a89c['filters']=_[_0xc811('0x2a')](_0x58a89c[_0xc811('0x2b')],_0x58a89c['query']);_0x47f880[_0xc811('0x2c')]=_[_0xc811('0x2a')](_0x58a89c[_0xc811('0x2b')],qs[_0xc811('0x2d')](_0x49e1e5[_0xc811('0x29')][_0xc811('0x2d')]));_0x47f880[_0xc811('0x2c')]=_0x47f880[_0xc811('0x2c')][_0xc811('0x2e')]?_0x47f880[_0xc811('0x2c')]:_0x58a89c['model'];if(!_0x49e1e5[_0xc811('0x29')]['hasOwnProperty'](_0xc811('0x2f'))){_0x47f880[_0xc811('0x1d')]=qs[_0xc811('0x1d')](_0x49e1e5[_0xc811('0x29')]['limit']);_0x47f880[_0xc811('0x1c')]=qs[_0xc811('0x1c')](_0x49e1e5[_0xc811('0x29')][_0xc811('0x1c')]);}_0x47f880[_0xc811('0x30')]=qs['sort'](_0x49e1e5[_0xc811('0x29')]['sort']);_0x47f880[_0xc811('0x31')]=qs[_0xc811('0x32')](_['pick'](_0x49e1e5[_0xc811('0x29')],_0x58a89c[_0xc811('0x32')]));if(_0x49e1e5['query'][_0xc811('0x33')]){_0x47f880[_0xc811('0x31')]=_[_0xc811('0x34')](_0x47f880[_0xc811('0x31')],{'$or':_[_0xc811('0x35')](_0x17e411,function(_0x2f201c){if(_0x2f201c['type'][_0xc811('0x36')]!=='VIRTUAL'){var _0x5fa983={};_0x5fa983[_0x2f201c[_0xc811('0x37')]]={'$like':'%'+_0x49e1e5[_0xc811('0x29')][_0xc811('0x33')]+'%'};return _0x5fa983;}})});}_0x47f880=_[_0xc811('0x34')]({},_0x47f880,_0x49e1e5[_0xc811('0x38')]);var _0x1f5479={'where':_0x47f880[_0xc811('0x31')]};return db[_0xc811('0x26')]['count'](_0x1f5479)[_0xc811('0x21')](function(_0x253a5e){_0x447376[_0xc811('0x1b')]=_0x253a5e;if(_0x49e1e5[_0xc811('0x29')][_0xc811('0x39')]){_0x47f880[_0xc811('0x3a')]=[{'all':!![]}];}return db[_0xc811('0x26')][_0xc811('0x3b')](_0x47f880);})[_0xc811('0x21')](function(_0x22cfd1){_0x447376['rows']=_0x22cfd1;return _0x447376;})[_0xc811('0x21')](respondWithFilteredResult(_0x225728,_0x47f880))['catch'](handleError(_0x225728,null));};exports[_0xc811('0x3c')]=function(_0x278e61,_0x5e5354){var _0x23281d={'raw':!![],'where':{'id':_0x278e61['params']['id']}},_0x295cc1={};_0x295cc1[_0xc811('0x2b')]=_['keys'](db[_0xc811('0x26')][_0xc811('0x27')]);_0x295cc1[_0xc811('0x29')]=_[_0xc811('0x28')](_0x278e61[_0xc811('0x29')]);_0x295cc1[_0xc811('0x32')]=_[_0xc811('0x2a')](_0x295cc1[_0xc811('0x2b')],_0x295cc1['query']);_0x23281d[_0xc811('0x2c')]=_[_0xc811('0x2a')](_0x295cc1[_0xc811('0x2b')],qs['fields'](_0x278e61[_0xc811('0x29')][_0xc811('0x2d')]));_0x23281d[_0xc811('0x2c')]=_0x23281d[_0xc811('0x2c')][_0xc811('0x2e')]?_0x23281d[_0xc811('0x2c')]:_0x295cc1['model'];if(_0x278e61[_0xc811('0x29')][_0xc811('0x39')]){_0x23281d['include']=[{'all':!![]}];}_0x23281d=_[_0xc811('0x34')]({},_0x23281d,_0x278e61[_0xc811('0x38')]);return db[_0xc811('0x26')][_0xc811('0x3d')](_0x23281d)[_0xc811('0x21')](handleEntityNotFound(_0x5e5354,null))[_0xc811('0x21')](respondWithResult(_0x5e5354,null))[_0xc811('0x3e')](handleError(_0x5e5354,null));};exports[_0xc811('0x3f')]=function(_0x70aa20,_0x1eb2ed){return db[_0xc811('0x26')][_0xc811('0x3f')](_0x70aa20[_0xc811('0x40')],{})['then'](respondWithResult(_0x1eb2ed,0xc9))[_0xc811('0x3e')](handleError(_0x1eb2ed,null));};exports[_0xc811('0x41')]=function(_0x7fda98,_0x2a909e){if(_0x7fda98[_0xc811('0x40')]['id']){delete _0x7fda98[_0xc811('0x40')]['id'];}return db[_0xc811('0x26')][_0xc811('0x3d')]({'where':{'id':_0x7fda98[_0xc811('0x42')]['id']}})[_0xc811('0x21')](handleEntityNotFound(_0x2a909e,null))[_0xc811('0x21')](saveUpdates(_0x7fda98[_0xc811('0x40')],null))[_0xc811('0x21')](respondWithResult(_0x2a909e,null))[_0xc811('0x3e')](handleError(_0x2a909e,null));};exports['destroy']=function(_0x3524a9,_0x22af49){return db[_0xc811('0x26')][_0xc811('0x3d')]({'where':{'id':_0x3524a9[_0xc811('0x42')]['id']}})[_0xc811('0x21')](handleEntityNotFound(_0x22af49,null))[_0xc811('0x21')](removeEntity(_0x22af49,null))['catch'](handleError(_0x22af49,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 3778b71..a297202 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 _0x0295=['rimraf','../../config/environment','./smsApplication.attributes','exports','define','utf8mb4_unicode_ci','lodash','api','request-promise','path'];(function(_0x1577ac,_0x10f6fc){var _0x13a475=function(_0x1ceef6){while(--_0x1ceef6){_0x1577ac['push'](_0x1577ac['shift']());}};_0x13a475(++_0x10f6fc);}(_0x0295,0x1f0));var _0x5029=function(_0x4c8c4d,_0x170fc3){_0x4c8c4d=_0x4c8c4d-0x0;var _0x7c72d2=_0x0295[_0x4c8c4d];return _0x7c72d2;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5029('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5029('0x2'));var fs=require('fs');var path=require(_0x5029('0x3'));var rimraf=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var attributes=require(_0x5029('0x6'));module[_0x5029('0x7')]=function(_0x200217,_0x215955){return _0x200217[_0x5029('0x8')]('SmsApplication',attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x5029('0x9')});}; \ No newline at end of file +var _0x0295=['rimraf','../../config/environment','./smsApplication.attributes','exports','define','utf8mb4_unicode_ci','lodash','api','request-promise','path'];(function(_0x8f0d6f,_0x47ffdf){var _0x590286=function(_0xba463){while(--_0xba463){_0x8f0d6f['push'](_0x8f0d6f['shift']());}};_0x590286(++_0x47ffdf);}(_0x0295,0x1f0));var _0x5029=function(_0x4a23a9,_0x17a2c0){_0x4a23a9=_0x4a23a9-0x0;var _0x18c27f=_0x0295[_0x4a23a9];return _0x18c27f;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5029('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5029('0x2'));var fs=require('fs');var path=require(_0x5029('0x3'));var rimraf=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var attributes=require(_0x5029('0x6'));module[_0x5029('0x7')]=function(_0x200217,_0x215955){return _0x200217[_0x5029('0x8')]('SmsApplication',attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x5029('0x9')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 3ca612e..22aed95 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 _0x3711=['lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x5ac2d9,_0x89b453){var _0x56e3a4=function(_0x1c2619){while(--_0x1c2619){_0x5ac2d9['push'](_0x5ac2d9['shift']());}};_0x56e3a4(++_0x89b453);}(_0x3711,0x165));var _0x1371=function(_0x3db639,_0x45c313){_0x3db639=_0x3db639-0x0;var _0x387810=_0x3711[_0x3db639];return _0x387810;};'use strict';var _=require(_0x1371('0x0'));var util=require(_0x1371('0x1'));var moment=require('moment');var BPromise=require(_0x1371('0x2'));var rs=require(_0x1371('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1371('0x4'));var logger=require(_0x1371('0x5'))('rpc');var config=require(_0x1371('0x6'));var jayson=require(_0x1371('0x7'));var client=jayson[_0x1371('0x8')][_0x1371('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x122767,_0x5d13ba,_0x1303f4){return new BPromise(function(_0x31cecf,_0x3af525){return client[_0x1371('0xa')](_0x122767,_0x1303f4)[_0x1371('0xb')](function(_0x9e1b2a){logger[_0x1371('0xc')](_0x1371('0xd'),_0x5d13ba,_0x1371('0xe'));logger['debug']('SmsApplication,\x20%s,\x20%s,\x20%s',_0x5d13ba,_0x1371('0xe'),JSON[_0x1371('0xf')](_0x9e1b2a));if(_0x9e1b2a[_0x1371('0x10')]){if(_0x9e1b2a['error'][_0x1371('0x11')]===0x1f4){logger[_0x1371('0x10')]('SmsApplication,\x20%s,\x20%s',_0x5d13ba,_0x9e1b2a[_0x1371('0x10')][_0x1371('0x12')]);return _0x3af525(_0x9e1b2a[_0x1371('0x10')][_0x1371('0x12')]);}logger[_0x1371('0x10')](_0x1371('0xd'),_0x5d13ba,_0x9e1b2a['error'][_0x1371('0x12')]);return _0x31cecf(_0x9e1b2a[_0x1371('0x10')][_0x1371('0x12')]);}else{logger[_0x1371('0xc')](_0x1371('0xd'),_0x5d13ba,_0x1371('0xe'));_0x31cecf(_0x9e1b2a[_0x1371('0x13')][_0x1371('0x12')]);}})[_0x1371('0x14')](function(_0x170b6a){logger[_0x1371('0x10')](_0x1371('0xd'),_0x5d13ba,_0x170b6a);_0x3af525(_0x170b6a);});});} \ No newline at end of file +var _0x1321=['error','code','message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x3f440d,_0x45b1d5){var _0x503c04=function(_0x28e3b6){while(--_0x28e3b6){_0x3f440d['push'](_0x3f440d['shift']());}};_0x503c04(++_0x45b1d5);}(_0x1321,0x154));var _0x1132=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x1321[_0x1d1779];return _0x2377e9;};'use strict';var _=require('lodash');var util=require(_0x1132('0x0'));var moment=require(_0x1132('0x1'));var BPromise=require(_0x1132('0x2'));var rs=require(_0x1132('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1132('0x4'))['db'];var utils=require(_0x1132('0x5'));var logger=require(_0x1132('0x6'))('rpc');var config=require(_0x1132('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1132('0x8')][_0x1132('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x239f92,_0x305dbd,_0x471266){return new BPromise(function(_0x57256e,_0x21f7e0){return client[_0x1132('0xa')](_0x239f92,_0x471266)[_0x1132('0xb')](function(_0x139911){logger[_0x1132('0xc')](_0x1132('0xd'),_0x305dbd,_0x1132('0xe'));logger[_0x1132('0xf')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x305dbd,_0x1132('0xe'),JSON[_0x1132('0x10')](_0x139911));if(_0x139911[_0x1132('0x11')]){if(_0x139911[_0x1132('0x11')][_0x1132('0x12')]===0x1f4){logger[_0x1132('0x11')](_0x1132('0xd'),_0x305dbd,_0x139911[_0x1132('0x11')][_0x1132('0x13')]);return _0x21f7e0(_0x139911[_0x1132('0x11')][_0x1132('0x13')]);}logger[_0x1132('0x11')]('SmsApplication,\x20%s,\x20%s',_0x305dbd,_0x139911['error']['message']);return _0x57256e(_0x139911['error'][_0x1132('0x13')]);}else{logger['info']('SmsApplication,\x20%s,\x20%s',_0x305dbd,_0x1132('0xe'));_0x57256e(_0x139911[_0x1132('0x14')][_0x1132('0x13')]);}})['catch'](function(_0x49bc49){logger[_0x1132('0x11')](_0x1132('0xd'),_0x305dbd,_0x49bc49);_0x21f7e0(_0x49bc49);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 7182dbc..896ae60 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 _0x9e0c=['get','/:id','show','/:id/messages','getMessages','/:id/download','download','create','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./smsInteraction.controller','isAuthenticated','index','/describe','describe'];(function(_0x1696f9,_0x1628b8){var _0xf302d5=function(_0x2e7c23){while(--_0x2e7c23){_0x1696f9['push'](_0x1696f9['shift']());}};_0xf302d5(++_0x1628b8);}(_0x9e0c,0x11d));var _0xc9e0=function(_0x5a594f,_0x132cbe){_0x5a594f=_0x5a594f-0x0;var _0x1720b2=_0x9e0c[_0x5a594f];return _0x1720b2;};'use strict';var multer=require(_0xc9e0('0x0'));var util=require(_0xc9e0('0x1'));var path=require(_0xc9e0('0x2'));var timeout=require('connect-timeout');var express=require(_0xc9e0('0x3'));var router=express[_0xc9e0('0x4')]();var auth=require(_0xc9e0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc9e0('0x6'));var controller=require(_0xc9e0('0x7'));router['get']('/',auth[_0xc9e0('0x8')](),controller[_0xc9e0('0x9')]);router['get'](_0xc9e0('0xa'),auth[_0xc9e0('0x8')](),controller[_0xc9e0('0xb')]);router[_0xc9e0('0xc')](_0xc9e0('0xd'),auth[_0xc9e0('0x8')](),controller[_0xc9e0('0xe')]);router[_0xc9e0('0xc')](_0xc9e0('0xf'),auth[_0xc9e0('0x8')](),controller[_0xc9e0('0x10')]);router[_0xc9e0('0xc')](_0xc9e0('0x11'),auth[_0xc9e0('0x8')](),controller[_0xc9e0('0x12')]);router['post']('/',auth[_0xc9e0('0x8')](),controller[_0xc9e0('0x13')]);router['post'](_0xc9e0('0xf'),auth[_0xc9e0('0x8')](),controller['addMessage']);router['post'](_0xc9e0('0x14'),auth[_0xc9e0('0x8')](),interaction[_0xc9e0('0x15')](_0xc9e0('0x16'),_0xc9e0('0x17')),controller[_0xc9e0('0x18')]);router[_0xc9e0('0x19')](_0xc9e0('0xd'),auth[_0xc9e0('0x8')](),interaction[_0xc9e0('0x15')]('sms',_0xc9e0('0x1a')),controller[_0xc9e0('0x1b')]);router[_0xc9e0('0x1c')]('/:id',auth[_0xc9e0('0x8')](),interaction['tracked'](_0xc9e0('0x16'),_0xc9e0('0x1d')),controller[_0xc9e0('0x1e')]);router[_0xc9e0('0x1c')]('/:id/tags',auth[_0xc9e0('0x8')](),controller[_0xc9e0('0x1f')]);module[_0xc9e0('0x20')]=router; \ No newline at end of file +var _0xbc45=['exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','getMessages','/:id/download','download','post','/:id/messages','addMessage','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','destroy','delete','/:id/tags'];(function(_0x56f0dd,_0x58b2f2){var _0x18863c=function(_0x5e8259){while(--_0x5e8259){_0x56f0dd['push'](_0x56f0dd['shift']());}};_0x18863c(++_0x58b2f2);}(_0xbc45,0x123));var _0x5bc4=function(_0x202fe8,_0x2f17c1){_0x202fe8=_0x202fe8-0x0;var _0x18f362=_0xbc45[_0x202fe8];return _0x18f362;};'use strict';var multer=require(_0x5bc4('0x0'));var util=require('util');var path=require(_0x5bc4('0x1'));var timeout=require(_0x5bc4('0x2'));var express=require(_0x5bc4('0x3'));var router=express['Router']();var auth=require(_0x5bc4('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5bc4('0x5'));var controller=require('./smsInteraction.controller');router[_0x5bc4('0x6')]('/',auth[_0x5bc4('0x7')](),controller[_0x5bc4('0x8')]);router['get'](_0x5bc4('0x9'),auth['isAuthenticated'](),controller[_0x5bc4('0xa')]);router[_0x5bc4('0x6')](_0x5bc4('0xb'),auth[_0x5bc4('0x7')](),controller['show']);router['get']('/:id/messages',auth[_0x5bc4('0x7')](),controller[_0x5bc4('0xc')]);router[_0x5bc4('0x6')](_0x5bc4('0xd'),auth['isAuthenticated'](),controller[_0x5bc4('0xe')]);router['post']('/',auth[_0x5bc4('0x7')](),controller['create']);router[_0x5bc4('0xf')](_0x5bc4('0x10'),auth['isAuthenticated'](),controller[_0x5bc4('0x11')]);router['post']('/:id/tags',auth[_0x5bc4('0x7')](),interaction[_0x5bc4('0x12')](_0x5bc4('0x13'),_0x5bc4('0x14')),controller[_0x5bc4('0x15')]);router[_0x5bc4('0x16')]('/:id',auth[_0x5bc4('0x7')](),interaction[_0x5bc4('0x12')](_0x5bc4('0x13'),_0x5bc4('0x17')),controller[_0x5bc4('0x18')]);router['delete'](_0x5bc4('0xb'),auth[_0x5bc4('0x7')](),interaction[_0x5bc4('0x12')](_0x5bc4('0x13'),'smsinteraction:destroy'),controller[_0x5bc4('0x19')]);router[_0x5bc4('0x1a')](_0x5bc4('0x1b'),auth[_0x5bc4('0x7')](),controller['removeTags']);module[_0x5bc4('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index f45a289..9e74c26 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 _0x4ac9=['DATE','STRING','ENUM','out','sequelize','moment','BOOLEAN'];(function(_0x56be4f,_0x2988a4){var _0x5b8281=function(_0x531193){while(--_0x531193){_0x56be4f['push'](_0x56be4f['shift']());}};_0x5b8281(++_0x2988a4);}(_0x4ac9,0xba));var _0x94ac=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x4ac9[_0x209941];return _0x1e8729;};'use strict';var Sequelize=require(_0x94ac('0x0'));var moment=require(_0x94ac('0x1'));module['exports']={'closed':{'type':Sequelize[_0x94ac('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x94ac('0x3')]},'disposition':{'type':Sequelize[_0x94ac('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x94ac('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x94ac('0x5')]('in',_0x94ac('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x94ac('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x94ac('0x5')]('in',_0x94ac('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x733a=['moment','exports','DATE','STRING','ENUM','out'];(function(_0x5d499c,_0x374e0e){var _0x3a5de2=function(_0x3ad465){while(--_0x3ad465){_0x5d499c['push'](_0x5d499c['shift']());}};_0x3a5de2(++_0x374e0e);}(_0x733a,0x1f2));var _0xa733=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x733a[_0x29d94e];return _0x106237;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xa733('0x0'));module[_0xa733('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa733('0x2')]},'disposition':{'type':Sequelize[_0xa733('0x3')]},'note':{'type':Sequelize[_0xa733('0x3')]},'phone':{'type':Sequelize[_0xa733('0x3')]},'read1stAt':{'type':Sequelize[_0xa733('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xa733('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa733('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xa733('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 b97c2da..fa68d9d 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 _0x2b88=['save','update','then','destroy','error','send','Users','TagIds','Tags','push','catch','index','SmsInteraction','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','name','color','from','tools_tags','sms_messages','me.direction\x20=\x20\x27in\x27','u.id','ui.SmsInteractionId','user_has_sms_interactions','users','u.id\x20=\x20ui.UserId','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','me.SmsInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false','expr','advancedFilter','parse','forEach','createdAt','dateStart','startOf','day','utc','format','endOf','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','value','TagId','unreadMessages','and','tableAlias','\x20IN\x20?','\x20=\x20?','LIKE','ContactId','c.firstName','c.lastName','\x20LIKE\x20?','c.email','\x20>\x20?','\x20<\x20?','map','filter','isNil','isEmpty','i.SmsAccountId\x20IN\x20?','concat','$gte','$lte','null','\x20IS\x20NULL','replace','\x27\x27\x27\x27','i.phone\x20LIKE\x20?','split','toString','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','DESC','group','i.id','QueryTypes','SELECT','COUNT(*)','COUNT(me.id)','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20IN\x20?','sequelize','merge','a.key','Account.key','i.*','Contact.firstName','Contact.lastName','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','show','params','options','find','create','body','describe','addMessage','SmsMessage','ids','omit','findOne','YYYY-MM-DD\x20HH:mm:ss','includeAll','include','findAll','rows','addTags','setTags','spread','emit','smsInteractionTags:save','removeTags','download','unix','server','files','tmp','root','attachments','direction','User','fullname','CmContact','Contact','firstName','lastName','SmsAccount','Account','Owner','get','10px','40px','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Sms','YYYY-MM-DD','mkdirSync','N.A.','closed','closedAt','Messages','System','out','secret','renderFile','views','downloadInteraction.html','toFile','transcript-','.pdf','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x2b88,0xc1));var _0x82b8=function(_0x85cb49,_0x50a08a){_0x85cb49=_0x85cb49-0x0;var _0x52f463=_0x2b88[_0x85cb49];return _0x52f463;};'use strict';var pdf=require(_0x82b8('0x0'));var emlformat=require(_0x82b8('0x1'));var rimraf=require(_0x82b8('0x2'));var zipdir=require(_0x82b8('0x3'));var jsonpatch=require(_0x82b8('0x4'));var rp=require(_0x82b8('0x5'));var moment=require(_0x82b8('0x6'));var BPromise=require(_0x82b8('0x7'));var Mustache=require('mustache');var util=require(_0x82b8('0x8'));var path=require(_0x82b8('0x9'));var sox=require(_0x82b8('0xa'));var csv=require(_0x82b8('0xb'));var ejs=require(_0x82b8('0xc'));var fs=require('fs');var _=require(_0x82b8('0xd'));var squel=require(_0x82b8('0xe'));var crypto=require(_0x82b8('0xf'));var jsforce=require(_0x82b8('0x10'));var deskjs=require(_0x82b8('0x11'));var toCsv=require(_0x82b8('0xb'));var querystring=require(_0x82b8('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x82b8('0x13'));var qs=require(_0x82b8('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x82b8('0x15'));var config=require(_0x82b8('0x16'));var db=require(_0x82b8('0x17'))['db'];config[_0x82b8('0x18')]=_[_0x82b8('0x19')](config['redis'],{'host':_0x82b8('0x1a'),'port':0x18eb});var socket=require(_0x82b8('0x1b'))(new Redis(config[_0x82b8('0x18')]));require(_0x82b8('0x1c'))[_0x82b8('0x1d')](socket);function respondWithStatusCode(_0x1153cb,_0x13edc0){_0x13edc0=_0x13edc0||0xcc;return function(_0x37464a){if(_0x37464a){return _0x1153cb[_0x82b8('0x1e')](_0x13edc0);}return _0x1153cb[_0x82b8('0x1f')](_0x13edc0)[_0x82b8('0x20')]();};}function respondWithResult(_0x507cab,_0x2a5129){_0x2a5129=_0x2a5129||0xc8;return function(_0x3851d5){if(_0x3851d5){return _0x507cab[_0x82b8('0x1f')](_0x2a5129)[_0x82b8('0x21')](_0x3851d5);}};}function respondWithFilteredResult(_0x76df92,_0x59e372){return function(_0x505b41){if(_0x505b41){var _0x359a9e=_0x505b41[_0x82b8('0x22')],_0x3f9021=_0x59e372[_0x82b8('0x23')],_0x5743fd=_0x59e372[_0x82b8('0x23')]+_0x59e372[_0x82b8('0x24')],_0x3e5b4b;if(_0x5743fd>=_0x359a9e){_0x5743fd=_0x359a9e;_0x3e5b4b=0xc8;}else{_0x3e5b4b=0xce;}_0x76df92['status'](_0x3e5b4b);return _0x76df92[_0x82b8('0x25')](_0x82b8('0x26'),_0x3f9021+'-'+_0x5743fd+'/'+_0x359a9e)[_0x82b8('0x21')](_0x505b41);}return null;};}function patchUpdates(_0x585680){return function(_0x43d39b){try{jsonpatch[_0x82b8('0x27')](_0x43d39b,_0x585680,!![]);}catch(_0x4dc025){return BPromise[_0x82b8('0x28')](_0x4dc025);}return _0x43d39b[_0x82b8('0x29')]();};}function saveUpdates(_0x4269ad,_0x23d7d4){return function(_0xb03527){if(_0xb03527){return _0xb03527[_0x82b8('0x2a')](_0x4269ad)[_0x82b8('0x2b')](function(_0x24de9f){return _0x24de9f;});}return null;};}function removeEntity(_0x5e83f5,_0x228ff6){return function(_0x235c7a){if(_0x235c7a){return _0x235c7a[_0x82b8('0x2c')]()[_0x82b8('0x2b')](function(){_0x5e83f5[_0x82b8('0x1f')](0xcc)[_0x82b8('0x20')]();});}};}function handleEntityNotFound(_0x4b208d,_0x2d059c){return function(_0x33c817){if(!_0x33c817){_0x4b208d[_0x82b8('0x1e')](0x194);}return _0x33c817;};}function handleError(_0x192661,_0xc71270){_0xc71270=_0xc71270||0x1f4;return function(_0x5ed243){logger[_0x82b8('0x2d')](_0x5ed243['stack']);if(_0x5ed243['name']){delete _0x5ed243['name'];}_0x192661['status'](_0xc71270)[_0x82b8('0x2e')](_0x5ed243);};}function getInteractionUsers(_0x4faa3c,_0x582d9c){return new BPromise(function(_0x331929,_0x4d4a4d){try{if(_0x582d9c[_0x4faa3c['id']]){_0x4faa3c[_0x82b8('0x2f')]=_['map'](_0x582d9c[_0x4faa3c['id']],function(_0x5aaa97){return{'id':_0x5aaa97['id']};});}}catch(_0x2b944c){_0x4d4a4d(_0x2b944c);}_0x331929(_0x4faa3c);});}function getInteractionTags(_0x44a418,_0x490ad6){return new BPromise(function(_0xc872e9,_0x4a68f2){try{if(_0x44a418[_0x82b8('0x30')]){_0x44a418[_0x82b8('0x31')]=[];_0x44a418[_0x82b8('0x30')]['split'](',')['forEach'](function(_0x29d8ba){_0x44a418[_0x82b8('0x31')][_0x82b8('0x32')](_0x490ad6[_0x29d8ba]);});}delete _0x44a418[_0x82b8('0x30')];}catch(_0x316808){_0x4a68f2(_0x316808);}_0xc872e9(_0x44a418);});}function updateSmsInteraction(_0x110d70,_0x4489a8,_0x526d31){return new BPromise(function(_0x25942a,_0x5d7112){return getInteractionUsers(_0x110d70,_0x526d31)[_0x82b8('0x2b')](function(_0x2f82c2){return getInteractionTags(_0x2f82c2,_0x4489a8);})[_0x82b8('0x2b')](function(_0x183483){_0x25942a(_0x183483);})[_0x82b8('0x33')](function(_0xd1f82f){_0x5d7112(_0xd1f82f);});});}exports[_0x82b8('0x34')]=function(_0x3b3e12,_0x151b35){var _0x4e275a={},_0x54a649={},_0x1f7324={'count':0x0,'rows':[]};var _0x21d5f9=db[_0x82b8('0x35')][_0x82b8('0x36')];_0x54a649['model']=_[_0x82b8('0x37')](_0x21d5f9);_0x54a649[_0x82b8('0x38')]=_['keys'](_0x3b3e12['query']);_0x54a649[_0x82b8('0x39')]=_[_0x82b8('0x3a')](_0x54a649[_0x82b8('0x3b')],_0x54a649[_0x82b8('0x38')]);_0x4e275a[_0x82b8('0x3c')]=_[_0x82b8('0x3a')](_0x54a649[_0x82b8('0x3b')],qs[_0x82b8('0x3d')](_0x3b3e12['query'][_0x82b8('0x3d')]));_0x4e275a[_0x82b8('0x3c')]=_0x4e275a[_0x82b8('0x3c')][_0x82b8('0x3e')]?_0x4e275a[_0x82b8('0x3c')]:_0x54a649[_0x82b8('0x3b')];if(!_0x3b3e12[_0x82b8('0x38')][_0x82b8('0x3f')](_0x82b8('0x40'))){_0x4e275a[_0x82b8('0x24')]=qs['limit'](_0x3b3e12[_0x82b8('0x38')][_0x82b8('0x24')]);_0x4e275a[_0x82b8('0x23')]=qs[_0x82b8('0x23')](_0x3b3e12[_0x82b8('0x38')]['offset']);}_0x4e275a[_0x82b8('0x41')]=qs[_0x82b8('0x42')](_0x3b3e12[_0x82b8('0x38')][_0x82b8('0x42')]);_0x4e275a[_0x82b8('0x43')]=qs[_0x82b8('0x39')](_[_0x82b8('0x44')](_0x3b3e12['query'],_0x54a649['filters']));var _0x32a357=[];var _0x1ad32b=squel[_0x82b8('0x45')]()[_0x82b8('0x46')]('id')['field'](_0x82b8('0x47'))['field'](_0x82b8('0x48'))[_0x82b8('0x49')](_0x82b8('0x4a'));var _0xd2556e=squel['select']()[_0x82b8('0x46')]('COUNT(*)')['from'](_0x82b8('0x4b'),'me')[_0x82b8('0x43')]('me.SmsInteractionId\x20=\x20i.id')[_0x82b8('0x43')](_0x82b8('0x4c'))[_0x82b8('0x43')]('me.read\x20=\x20false');var _0x3d5b60=squel[_0x82b8('0x45')]()[_0x82b8('0x46')](_0x82b8('0x4d'))[_0x82b8('0x46')](_0x82b8('0x4e'))[_0x82b8('0x49')](_0x82b8('0x4f'),'ui')['left_join'](_0x82b8('0x50'),'u',_0x82b8('0x51'));var _0x4cd69d=squel[_0x82b8('0x45')]()[_0x82b8('0x49')]('sms_interactions','i')[_0x82b8('0x52')](_0x82b8('0x53'),'c',_0x82b8('0x54'))[_0x82b8('0x52')](_0x82b8('0x50'),'o',_0x82b8('0x55'))[_0x82b8('0x52')](_0x82b8('0x56'),'a',_0x82b8('0x57'))[_0x82b8('0x52')](_0x82b8('0x4b'),'me',_0x82b8('0x58'));var _0x225414=squel[_0x82b8('0x59')]();if(_0x3b3e12['query'][_0x82b8('0x5a')]){var _0x4953ee=JSON[_0x82b8('0x5b')](_0x3b3e12[_0x82b8('0x38')]['advancedFilter']);_[_0x82b8('0x37')](_0x4953ee)[_0x82b8('0x5c')](function(_0x3c70e1){var _0x5b5723=_0x4953ee[_0x3c70e1];if(_0x3c70e1===_0x82b8('0x5d')){var _0x27ae64=moment(_0x5b5723['value'][_0x82b8('0x5e')])[_0x82b8('0x5f')](_0x82b8('0x60'))[_0x82b8('0x61')]()[_0x82b8('0x62')]();var _0x3c22a3=moment(_0x3c22a3)[_0x82b8('0x61')]()[_0x82b8('0x63')](_0x82b8('0x60'))['format']();_0x225414['and'](_0x82b8('0x64'),_0x27ae64,_0x3c22a3);}else{if(_[_0x82b8('0x65')](_0x5b5723[_0x82b8('0x66')])){_0x5b5723[_0x82b8('0x66')]['forEach'](function(_0x2c33dd){switch(_0x5b5723[_0x82b8('0x66')][_0x82b8('0x67')]){case'IS':if(_0x3c70e1!==_0x82b8('0x68')&&_0x3c70e1!==_0x82b8('0x69')){if(_['isArray'](_0x5b5723['value'])&&_0x5b5723[_0x82b8('0x67')]['length']>0x1){_0x225414[_0x82b8('0x6a')](_0x5b5723[_0x82b8('0x6b')]+'.'+_0x3c70e1+_0x82b8('0x6c'),_0x5b5723[_0x82b8('0x67')]);}else{_0x225414['and'](_0x5b5723[_0x82b8('0x6b')]+'.'+_0x3c70e1+_0x82b8('0x6d'),_0x5b5723['value'][0x0]);}}break;case'=':_0x225414[_0x82b8('0x6a')](_0x5b5723[_0x82b8('0x6b')]+'.'+_0x3c70e1+'\x20=\x20?',_0x5b5723[_0x82b8('0x67')]);break;case _0x82b8('0x6e'):if(_0x3c70e1===_0x82b8('0x6f')){_0x225414[_0x82b8('0x6a')](_0x82b8('0x70')+'\x20LIKE\x20?','%'+_0x5b5723[_0x82b8('0x67')]+'%');_0x225414['or'](_0x82b8('0x71')+_0x82b8('0x72'),'%'+_0x5b5723[_0x82b8('0x67')]+'%');_0x225414['or'](_0x82b8('0x73')+_0x82b8('0x72'),'%'+_0x5b5723['value']+'%');}else{_0x225414[_0x82b8('0x6a')](_0x5b5723['tableAlias']+'.'+_0x3c70e1+_0x82b8('0x72'),'%'+_0x5b5723[_0x82b8('0x67')]+'%');}break;case'>':_0x225414[_0x82b8('0x6a')](_0x5b5723[_0x82b8('0x6b')]+'.'+_0x3c70e1+_0x82b8('0x74'),_0x5b5723[_0x82b8('0x67')]);break;case'<':_0x225414[_0x82b8('0x6a')](_0x5b5723[_0x82b8('0x6b')]+'.'+_0x3c70e1+_0x82b8('0x75'),_0x5b5723['value']);break;}});}else{switch(_0x5b5723[_0x82b8('0x66')][_0x82b8('0x67')]){case'IS':if(_0x3c70e1!==_0x82b8('0x68')&&_0x3c70e1!==_0x82b8('0x69')){if(_['isArray'](_0x5b5723[_0x82b8('0x67')])&&_0x5b5723[_0x82b8('0x67')][_0x82b8('0x3e')]>0x1){_0x225414[_0x82b8('0x6a')](_0x5b5723[_0x82b8('0x6b')]+'.'+_0x3c70e1+_0x82b8('0x6c'),_0x5b5723['value']);}else{_0x225414[_0x82b8('0x6a')](_0x5b5723[_0x82b8('0x6b')]+'.'+_0x3c70e1+_0x82b8('0x6d'),_0x5b5723[_0x82b8('0x67')][0x0]);}}break;case'=':_0x225414[_0x82b8('0x6a')](_0x5b5723[_0x82b8('0x6b')]+'.'+_0x3c70e1+_0x82b8('0x6d'),_0x5b5723[_0x82b8('0x67')]);break;case _0x82b8('0x6e'):if(_0x3c70e1===_0x82b8('0x6f')){_0x225414[_0x82b8('0x6a')](_0x82b8('0x70')+_0x82b8('0x72'),'%'+_0x5b5723[_0x82b8('0x67')]+'%');_0x225414['or'](_0x82b8('0x71')+'\x20LIKE\x20?','%'+_0x5b5723[_0x82b8('0x67')]+'%');_0x225414['or'](_0x82b8('0x73')+_0x82b8('0x72'),'%'+_0x5b5723[_0x82b8('0x67')]+'%');}else{_0x225414[_0x82b8('0x6a')](_0x5b5723['tableAlias']+'.'+_0x3c70e1+_0x82b8('0x72'),'%'+_0x5b5723[_0x82b8('0x67')]+'%');}break;case'>':_0x225414[_0x82b8('0x6a')](_0x5b5723[_0x82b8('0x6b')]+'.'+_0x3c70e1+_0x82b8('0x74'),_0x5b5723[_0x82b8('0x67')]);break;case'<':_0x225414[_0x82b8('0x6a')](_0x5b5723[_0x82b8('0x6b')]+'.'+_0x3c70e1+_0x82b8('0x75'),_0x5b5723[_0x82b8('0x67')]);break;}}}});}else{var _0x29e572=_(Object[_0x82b8('0x37')](_0x3b3e12[_0x82b8('0x38')]))[_0x82b8('0x76')](function(_0x2d3abb){return _0x21d5f9[_0x82b8('0x3f')](_0x2d3abb)?_0x2d3abb:undefined;})[_0x82b8('0x77')](function(_0x467346){return!_[_0x82b8('0x78')](_0x467346);})[_0x82b8('0x67')]();if(!_[_0x82b8('0x79')](_0x29e572)){_0x29e572[_0x82b8('0x5c')](function(_0x3b2b6f){if(_0x3b2b6f==='SmsAccountId'){_0x4cd69d[_0x82b8('0x43')](_0x82b8('0x7a'),[][_0x82b8('0x7b')](_0x3b3e12[_0x82b8('0x38')][_0x3b2b6f]));}else if(_0x3b2b6f===_0x82b8('0x5d')){var _0x1b958f=JSON[_0x82b8('0x5b')](_0x3b3e12[_0x82b8('0x38')][_0x3b2b6f])[_0x82b8('0x7c')];var _0x34d037=JSON[_0x82b8('0x5b')](_0x3b3e12['query'][_0x3b2b6f])[_0x82b8('0x7d')];_0x4cd69d[_0x82b8('0x43')](_0x82b8('0x64'),_0x1b958f,_0x34d037);}else{if(_0x3b3e12['query'][_0x3b2b6f]===_0x82b8('0x7e')){_0x4cd69d[_0x82b8('0x43')]('i.'+_0x3b2b6f+_0x82b8('0x7f'));}else{_0x4cd69d['where']('i.'+_0x3b2b6f+'\x20=\x20?',_0x3b3e12[_0x82b8('0x38')][_0x3b2b6f]);}}});}if(_0x3b3e12[_0x82b8('0x38')][_0x82b8('0x77')]){var _0x224448=_0x3b3e12[_0x82b8('0x38')]['filter']['replace']('\x5c','\x5c\x5c')[_0x82b8('0x80')]('\x27\x27',_0x82b8('0x81'));if(qs['isNumeric'](_0x224448)){_0x225414['or']('i.id\x20LIKE\x20?',_0x224448+'%')['or'](_0x82b8('0x82'),_0x224448+'%');}else{var _0x3fe9f3=[];_0x224448[_0x82b8('0x83')]('\x20')[_0x82b8('0x5c')](function(_0x6613be){_0x3fe9f3['push']('+'+_0x6613be[_0x82b8('0x84')]());});var _0x1e7154=_0x3fe9f3[_0x82b8('0x85')]('\x20');_0x225414['or'](_0x82b8('0x86'),_0x1e7154)['or'](_0x82b8('0x87'),_0x224448+'%');}}}_0x4cd69d[_0x82b8('0x43')](_0x225414);if(_0x4e275a[_0x82b8('0x41')]){_0x4e275a['order'][_0x82b8('0x5c')](function(_0x418e49){_0x4cd69d[_0x82b8('0x41')]('i.'+_0x418e49[0x0],_0x418e49[0x1]===_0x82b8('0x88')?![]:!![]);});}_0x4cd69d[_0x82b8('0x89')](_0x82b8('0x8a'));var _0x2639ef={'type':db['Sequelize'][_0x82b8('0x8b')][_0x82b8('0x8c')],'raw':!![]};var _0x37f29e=_0x4cd69d['clone']()[_0x82b8('0x46')](_0x82b8('0x8d'))[_0x82b8('0x46')](_0x82b8('0x8e'),_0x82b8('0x69'));if(!_0x3b3e12[_0x82b8('0x38')]['advancedFilter']){if(_0x3b3e12[_0x82b8('0x38')][_0x82b8('0x8f')]){if(_0x3b3e12[_0x82b8('0x38')][_0x82b8('0x8f')]==0x1){_0x37f29e[_0x82b8('0x90')](_0x82b8('0x91'));_0x4cd69d[_0x82b8('0x90')](_0x82b8('0x91'));}else{_0x37f29e[_0x82b8('0x90')]('`unreadMessages`\x20>\x200');_0x4cd69d[_0x82b8('0x90')](_0x82b8('0x92'));}}if(_0x3b3e12['query'][_0x82b8('0x93')]){var _0x892e0f=_[_0x82b8('0x65')](_0x3b3e12[_0x82b8('0x38')][_0x82b8('0x93')])?_0x3b3e12[_0x82b8('0x38')][_0x82b8('0x93')]:new Array(_0x3b3e12['query'][_0x82b8('0x93')]);var _0x409f1d=squel[_0x82b8('0x59')]();_0x892e0f[_0x82b8('0x5c')](function(_0x144070){_0x409f1d['or'](_0x82b8('0x94'),'%,'+_0x144070+',%');});_0x4cd69d[_0x82b8('0x90')](_0x409f1d);_0x37f29e['left_join'](_0x82b8('0x95'),'it',_0x82b8('0x96'));_0x37f29e['left_join'](_0x82b8('0x4a'),'t',_0x82b8('0x97'));_0x37f29e['where']('t.id\x20IN\x20?',_0x892e0f);}}else{var _0x4953ee=JSON[_0x82b8('0x5b')](_0x3b3e12[_0x82b8('0x38')][_0x82b8('0x5a')]);_['keys'](_0x4953ee)['forEach'](function(_0x44496a){var _0x30770f=_0x4953ee[_0x44496a];if(_0x44496a===_0x82b8('0x68')){var _0x6a260c=_0x30770f[_0x82b8('0x67')];var _0x9826b2=squel['expr']();_0x6a260c['forEach'](function(_0x297963){_0x9826b2['or'](_0x82b8('0x94'),'%,'+_0x297963+',%');});_0x4cd69d['having'](_0x9826b2);_0x37f29e[_0x82b8('0x52')](_0x82b8('0x98'),'it',_0x82b8('0x99'));_0x37f29e[_0x82b8('0x52')](_0x82b8('0x4a'),'t',_0x82b8('0x97'));_0x37f29e[_0x82b8('0x43')](_0x82b8('0x9a'),_0x6a260c);}else if(_0x44496a===_0x82b8('0x69')){if(_0x30770f[_0x82b8('0x67')][_0x82b8('0x3e')]===0x1){if(_0x30770f[_0x82b8('0x67')][0x0]===0x1){_0x37f29e[_0x82b8('0x90')](_0x82b8('0x91'));_0x4cd69d[_0x82b8('0x90')](_0x82b8('0x91'));}else{_0x37f29e[_0x82b8('0x90')]('`unreadMessages`\x20>\x200');_0x4cd69d[_0x82b8('0x90')]('`unreadMessages`\x20>\x200');}}}});}db[_0x82b8('0x9b')][_0x82b8('0x38')](_0x37f29e[_0x82b8('0x84')](),_0x2639ef)['then'](function(_0x106a45){_0x1f7324[_0x82b8('0x22')]=_0x106a45['length'];if(_0x1f7324[_0x82b8('0x22')]===0x0)return[];return db[_0x82b8('0x9b')]['query'](_0x1ad32b[_0x82b8('0x84')](),_0x2639ef)[_0x82b8('0x2b')](function(_0x25685f){_0x32a357=_['keyBy'](_0x25685f,'id');_0x2639ef=_[_0x82b8('0x9c')](_0x2639ef,{'model':db[_0x82b8('0x35')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x4cd69d['field']('COUNT(me.id)',_0x82b8('0x69'));_0x4cd69d[_0x82b8('0x46')](_0x82b8('0x9d'),_0x82b8('0x9e'));_0x4cd69d['field'](_0x82b8('0x9f'));_0x4cd69d[_0x82b8('0x46')](_0x82b8('0x70'),_0x82b8('0xa0'));_0x4cd69d[_0x82b8('0x46')]('c.lastName',_0x82b8('0xa1'));_0x4cd69d['field'](_0x82b8('0x73'),'Contact.email');_0x4cd69d[_0x82b8('0x46')](_0x82b8('0xa2'),'Contact.phone');_0x4cd69d[_0x82b8('0x46')](_0x82b8('0xa3'),_0x82b8('0xa4'));_0x4cd69d[_0x82b8('0x46')](_0x82b8('0xa5'),_0x82b8('0xa6'));_0x4cd69d[_0x82b8('0x46')](_0x82b8('0xa7'),_0x82b8('0x30'));_0x4cd69d[_0x82b8('0x52')](_0x82b8('0x95'),'it',_0x82b8('0x96'));_0x4cd69d[_0x82b8('0x52')](_0x82b8('0x4a'),'t',_0x82b8('0x97'));_0x4cd69d['limit'](_0x4e275a[_0x82b8('0x24')]);_0x4cd69d[_0x82b8('0x23')](_0x4e275a[_0x82b8('0x23')]);return db[_0x82b8('0x9b')][_0x82b8('0x38')](_0x4cd69d[_0x82b8('0x84')](),_0x2639ef);})['then'](function(_0x482fbb){_0x3d5b60[_0x82b8('0x43')](_0x82b8('0xa8'),_[_0x82b8('0x76')](_0x482fbb,'id'));return db[_0x82b8('0x9b')][_0x82b8('0x38')](_0x3d5b60[_0x82b8('0x84')](),_0x2639ef)[_0x82b8('0x2b')](function(_0x1dea05){var _0x4e1b06=_[_0x82b8('0xa9')](_0x1dea05,_0x82b8('0xaa'));var _0x2ccee5=[];_0x482fbb['forEach'](function(_0x1aa12f){_0x2ccee5['push'](updateSmsInteraction(_0x1aa12f,_0x32a357,_0x4e1b06));});return BPromise[_0x82b8('0xab')](_0x2ccee5);});});})[_0x82b8('0x2b')](function(_0xeaf735){_0x1f7324['rows']=_0xeaf735;return _0x1f7324;})['then'](respondWithFilteredResult(_0x151b35,_0x4e275a))[_0x82b8('0x33')](handleError(_0x151b35,null));};exports[_0x82b8('0xac')]=function(_0x5db7f0,_0x2be9d3){var _0x31c1ab={'raw':![],'where':{'id':_0x5db7f0[_0x82b8('0xad')]['id']}},_0x6723d5={};_0x6723d5[_0x82b8('0x3b')]=_[_0x82b8('0x37')](db[_0x82b8('0x35')][_0x82b8('0x36')]);_0x6723d5[_0x82b8('0x38')]=_['keys'](_0x5db7f0[_0x82b8('0x38')]);_0x6723d5[_0x82b8('0x39')]=_[_0x82b8('0x3a')](_0x6723d5[_0x82b8('0x3b')],_0x6723d5[_0x82b8('0x38')]);_0x31c1ab[_0x82b8('0x3c')]=_[_0x82b8('0x3a')](_0x6723d5[_0x82b8('0x3b')],qs[_0x82b8('0x3d')](_0x5db7f0['query'][_0x82b8('0x3d')]));_0x31c1ab[_0x82b8('0x3c')]=_0x31c1ab['attributes'][_0x82b8('0x3e')]?_0x31c1ab['attributes']:_0x6723d5['model'];if(_0x5db7f0[_0x82b8('0x38')]['includeAll']){_0x31c1ab['include']=[{'all':!![]}];}_0x31c1ab=_[_0x82b8('0x9c')]({},_0x31c1ab,_0x5db7f0[_0x82b8('0xae')]);return db[_0x82b8('0x35')][_0x82b8('0xaf')](_0x31c1ab)[_0x82b8('0x2b')](handleEntityNotFound(_0x2be9d3,null))[_0x82b8('0x2b')](respondWithResult(_0x2be9d3,null))[_0x82b8('0x33')](handleError(_0x2be9d3,null));};exports[_0x82b8('0xb0')]=function(_0x515c12,_0x29de92){return db[_0x82b8('0x35')][_0x82b8('0xb0')](_0x515c12[_0x82b8('0xb1')],{})['then'](respondWithResult(_0x29de92,0xc9))['catch'](handleError(_0x29de92,null));};exports[_0x82b8('0x2a')]=function(_0x2032ce,_0x36ce22){if(_0x2032ce[_0x82b8('0xb1')]['id']){delete _0x2032ce['body']['id'];}return db[_0x82b8('0x35')][_0x82b8('0xaf')]({'where':{'id':_0x2032ce[_0x82b8('0xad')]['id']}})['then'](handleEntityNotFound(_0x36ce22,null))[_0x82b8('0x2b')](saveUpdates(_0x2032ce['body'],null))[_0x82b8('0x2b')](respondWithResult(_0x36ce22,null))[_0x82b8('0x33')](handleError(_0x36ce22,null));};exports['destroy']=function(_0x8b0678,_0x560f42){return db[_0x82b8('0x35')][_0x82b8('0xaf')]({'where':{'id':_0x8b0678[_0x82b8('0xad')]['id']}})[_0x82b8('0x2b')](handleEntityNotFound(_0x560f42,null))[_0x82b8('0x2b')](removeEntity(_0x560f42,null))[_0x82b8('0x33')](handleError(_0x560f42,null));};exports[_0x82b8('0xb2')]=function(_0x3c0fda,_0x42bc45){return db['SmsInteraction']['describe']()[_0x82b8('0x2b')](respondWithResult(_0x42bc45,null))[_0x82b8('0x33')](handleError(_0x42bc45,null));};exports[_0x82b8('0xb3')]=function(_0x10eef5,_0x3a038c,_0x355c8c){return db[_0x82b8('0xb4')][_0x82b8('0xaf')]({'where':{'id':_0x10eef5['params']['id']}})[_0x82b8('0x2b')](handleEntityNotFound(_0x3a038c,null))[_0x82b8('0x2b')](function(_0x496e80){if(_0x496e80){return _0x496e80[_0x82b8('0xb3')](_0x10eef5['body'][_0x82b8('0xb5')],_[_0x82b8('0xb6')](_0x10eef5[_0x82b8('0xb1')],['ids','id'])||{});}})[_0x82b8('0x2b')](respondWithResult(_0x3a038c,null))['catch'](handleError(_0x3a038c,null));};exports['getMessages']=function(_0x425c87,_0x3b8133,_0x167753){var _0x13abbf={'raw':![],'where':{}};var _0x5d672f={};var _0x4e2577={'count':0x0,'rows':[]};return db[_0x82b8('0x35')][_0x82b8('0xb7')]({'where':{'id':_0x425c87[_0x82b8('0xad')]['id']}})[_0x82b8('0x2b')](handleEntityNotFound(_0x3b8133,null))[_0x82b8('0x2b')](function(_0x5f12ac){if(_0x5f12ac){_0x5d672f[_0x82b8('0x3b')]=_['keys'](db[_0x82b8('0xb4')][_0x82b8('0x36')]);_0x5d672f[_0x82b8('0x38')]=_['keys'](_0x425c87[_0x82b8('0x38')]);_0x5d672f[_0x82b8('0x39')]=_[_0x82b8('0x3a')](_0x5d672f[_0x82b8('0x3b')],_0x5d672f[_0x82b8('0x38')]);_0x13abbf['attributes']=_[_0x82b8('0x3a')](_0x5d672f[_0x82b8('0x3b')],qs[_0x82b8('0x3d')](_0x425c87['query'][_0x82b8('0x3d')]));_0x13abbf['attributes']=_0x13abbf[_0x82b8('0x3c')][_0x82b8('0x3e')]?_0x13abbf[_0x82b8('0x3c')]:_0x5d672f[_0x82b8('0x3b')];if(!_0x425c87[_0x82b8('0x38')][_0x82b8('0x3f')](_0x82b8('0x40'))){_0x13abbf['limit']=qs[_0x82b8('0x24')](_0x425c87[_0x82b8('0x38')][_0x82b8('0x24')]);_0x13abbf[_0x82b8('0x23')]=qs[_0x82b8('0x23')](_0x425c87[_0x82b8('0x38')][_0x82b8('0x23')]);}_0x13abbf[_0x82b8('0x41')]=qs[_0x82b8('0x42')](_0x425c87[_0x82b8('0x38')][_0x82b8('0x42')]);_0x13abbf['where']=qs['filters'](_[_0x82b8('0x44')](_0x425c87[_0x82b8('0x38')],_0x5d672f[_0x82b8('0x39')]));_0x13abbf[_0x82b8('0x43')][_0x82b8('0xaa')]=_0x5f12ac['id'];if(_0x425c87[_0x82b8('0x38')][_0x82b8('0x77')]){_0x13abbf['where']=_[_0x82b8('0x9c')](_0x13abbf[_0x82b8('0x43')],{'$or':_[_0x82b8('0x76')](_0x13abbf[_0x82b8('0x3c')],function(_0x3e325a){var _0x52cc36={};_0x52cc36[_0x3e325a]={'$like':'%'+_0x425c87[_0x82b8('0x38')]['filter']+'%'};return _0x52cc36;})});}if(_0x425c87['query'][_0x82b8('0x7c')]){var _0x12dea8=_0x425c87[_0x82b8('0x38')]['$gte']['split'](',');var _0x199fab={};_0x199fab[_0x12dea8[0x0]]={'$gte':moment(_0x12dea8[0x1])['format'](_0x82b8('0xb8'))};_0x13abbf[_0x82b8('0x43')]=_['merge'](_0x13abbf['where'],_0x199fab);}_0x13abbf=_[_0x82b8('0x9c')]({},_0x13abbf,_0x425c87[_0x82b8('0xae')]);return db['SmsMessage'][_0x82b8('0x22')]({'where':_0x13abbf[_0x82b8('0x43')]})[_0x82b8('0x2b')](function(_0x3ef593){_0x4e2577['count']=_0x3ef593;if(_0x425c87[_0x82b8('0x38')][_0x82b8('0xb9')]){_0x13abbf[_0x82b8('0xba')]=[{'all':!![]}];}return db['SmsMessage'][_0x82b8('0xbb')](_0x13abbf);})[_0x82b8('0x2b')](function(_0x93e59c){_0x4e2577[_0x82b8('0xbc')]=_0x93e59c;return _0x4e2577;});}})[_0x82b8('0x2b')](respondWithFilteredResult(_0x3b8133,_0x13abbf))[_0x82b8('0x33')](handleError(_0x3b8133,null));};exports[_0x82b8('0xbd')]=function(_0x46bfb2,_0x146b60,_0x8753bd){return db['SmsInteraction'][_0x82b8('0xaf')]({'where':{'id':_0x46bfb2[_0x82b8('0xad')]['id']}})[_0x82b8('0x2b')](handleEntityNotFound(_0x146b60,null))[_0x82b8('0x2b')](function(_0x2b3d60){if(_0x2b3d60){return _0x2b3d60[_0x82b8('0xbe')](_0x46bfb2[_0x82b8('0xb1')][_0x82b8('0xb5')],_[_0x82b8('0xb6')](_0x46bfb2[_0x82b8('0xb1')],[_0x82b8('0xb5'),'id'])||{})[_0x82b8('0xbf')](function(){return db['Tag'][_0x82b8('0xbb')]({'attributes':['id',_0x82b8('0x47'),_0x82b8('0x48')],'where':{'id':_0x46bfb2[_0x82b8('0xb1')][_0x82b8('0xb5')]}});})[_0x82b8('0x2b')](function(_0x435bc7){socket[_0x82b8('0xc0')](_0x82b8('0xc1'),{'id':Number(_0x46bfb2[_0x82b8('0xad')]['id']),'tags':_0x435bc7||[]});return{'id':Number(_0x46bfb2['params']['id']),'tags':_0x435bc7||[]};});}})[_0x82b8('0x2b')](respondWithResult(_0x146b60,null))[_0x82b8('0x33')](handleError(_0x146b60,null));};exports[_0x82b8('0xc2')]=function(_0x250186,_0x2dc54f,_0x1fc915){return db[_0x82b8('0x35')][_0x82b8('0xaf')]({'where':{'id':_0x250186[_0x82b8('0xad')]['id']}})[_0x82b8('0x2b')](handleEntityNotFound(_0x2dc54f,null))[_0x82b8('0x2b')](function(_0x4ebdfd){if(_0x4ebdfd){return _0x4ebdfd[_0x82b8('0xc2')](_0x250186[_0x82b8('0x38')]['ids']);}})[_0x82b8('0x2b')](respondWithStatusCode(_0x2dc54f,null))[_0x82b8('0x33')](handleError(_0x2dc54f,null));};exports[_0x82b8('0xc3')]=function(_0x3036cd,_0x11c550){var _0x30dcb9=moment()[_0x82b8('0xc4')]()[_0x82b8('0x84')]();var _0x1ddc27=path['join'](config['root'],_0x82b8('0xc5'),_0x82b8('0xc6'),_0x82b8('0xc7'));var _0x573a03=path[_0x82b8('0x85')](config[_0x82b8('0xc8')],_0x82b8('0xc5'),_0x82b8('0xc6'),_0x82b8('0xc9'));var _0x3ac973=path[_0x82b8('0x85')](_0x1ddc27,_0x30dcb9);var _0x22fb7b=util[_0x82b8('0x62')]('transcript-%d-%s.zip',_0x3036cd[_0x82b8('0xad')]['id'],_0x30dcb9);var _0x20147a=path[_0x82b8('0x85')](_0x1ddc27,_0x22fb7b);var _0x1d847c=![];return db[_0x82b8('0x35')]['find']({'where':{'id':_0x3036cd[_0x82b8('0xad')]['id']},'include':[{'model':db[_0x82b8('0xb4')],'as':'Messages','attributes':['id',_0x82b8('0xb1'),_0x82b8('0x5d'),_0x82b8('0xca'),'secret'],'include':[{'model':db[_0x82b8('0xcb')],'as':_0x82b8('0xcb'),'attributes':['id',_0x82b8('0xcc')],'raw':!![]},{'model':db[_0x82b8('0xcd')],'as':_0x82b8('0xce'),'attributes':['id',_0x82b8('0xcf'),_0x82b8('0xd0')],'raw':!![]}]},{'model':db[_0x82b8('0xd1')],'as':_0x82b8('0xd2'),'attributes':['id','name']},{'model':db[_0x82b8('0xcb')],'as':_0x82b8('0xd3'),'attributes':['id',_0x82b8('0xcc')]}]})['then'](handleEntityNotFound(_0x11c550,null))['then'](function(_0x5774e4){if(_0x5774e4){var _0x327aef=_0x5774e4[_0x82b8('0xd4')]({'plain':!![]});_0x1d847c=!![];var _0x4ba553={'format':'A4','border':_0x82b8('0xd5'),'header':{'height':_0x82b8('0xd6'),'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':_0x82b8('0xd7'),'contents':{'default':util[_0x82b8('0x62')](_0x82b8('0xd8'),util['format'](_0x82b8('0xd9'),_0x82b8('0xda'),_0x327aef['id']),moment()[_0x82b8('0x62')](_0x82b8('0xdb'))[_0x82b8('0x84')]())}}};fs[_0x82b8('0xdc')](_0x3ac973);var _0x144b7a={'channel':_0x82b8('0xda'),'account':_0x327aef[_0x82b8('0xd2')][_0x82b8('0x47')],'agent':_0x327aef['Owner']?_0x327aef[_0x82b8('0xd3')][_0x82b8('0xcc')]:_0x82b8('0xdd'),'createdAt':moment(_0x327aef[_0x82b8('0x5d')])[_0x82b8('0x62')](_0x82b8('0xb8'))[_0x82b8('0x84')](),'closedAt':_0x327aef[_0x82b8('0xde')]?moment(_0x327aef[_0x82b8('0xdf')])[_0x82b8('0x62')](_0x82b8('0xb8'))['toString']():'','disposition':_0x327aef['disposition'],'messages':_(_0x327aef[_0x82b8('0xe0')])[_0x82b8('0x77')]({'secret':![]})['map'](function(_0x2175e6){return{'date':moment(_0x2175e6[_0x82b8('0x5d')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x82b8('0x84')](),'sender':_0x2175e6['direction']==='out'?_0x2175e6[_0x82b8('0xcb')]?_0x2175e6['User']['fullname']:_0x82b8('0xe1'):_0x2175e6['Contact'][_0x82b8('0xcf')]+(_0x2175e6[_0x82b8('0xce')][_0x82b8('0xd0')]?'\x20'+_0x2175e6[_0x82b8('0xce')][_0x82b8('0xd0')]:''),'body':_0x2175e6[_0x82b8('0xb1')],'direction':_0x2175e6['direction']===_0x82b8('0xe2')?'A':'C','secret':_0x2175e6[_0x82b8('0xe3')]};})['value']()};return ejs[_0x82b8('0xe4')](path[_0x82b8('0x85')](config[_0x82b8('0xc8')],_0x82b8('0xc5'),_0x82b8('0xe5'),_0x82b8('0xe6')),{'interaction':_0x144b7a})[_0x82b8('0x2b')](function(_0x37ff4a){return new BPromise(function(_0x372d21,_0xc2046f){pdf[_0x82b8('0xb0')](_0x37ff4a,_0x4ba553)[_0x82b8('0xe7')](path[_0x82b8('0x85')](_0x3ac973,_0x82b8('0xe8')+_0x327aef['id']+'-'+_0x30dcb9+_0x82b8('0xe9')),function(_0x2e9246,_0xf50bbc){if(_0x2e9246)return _0xc2046f(_0x2e9246);_0x372d21(_0xf50bbc);});});});}})[_0x82b8('0x2b')](function(){if(_0x1d847c){return new BPromise(function(_0x321dfb,_0x11194f){zipdir(_0x3ac973,{'saveTo':_0x20147a},function(_0x532dd4,_0x54ec81){if(_0x532dd4)return _0x11194f(_0x532dd4);return _0x321dfb(_0x54ec81);});})['then'](function(){return new BPromise(function(_0x3a7a93,_0x475520){rimraf(_0x3ac973,function(_0x504a01){if(_0x504a01)_0x475520(_0x504a01);return _0x3a7a93();});});})[_0x82b8('0x2b')](function(){return _0x11c550[_0x82b8('0xc3')](_0x20147a,_0x22fb7b,function(_0x33556a){if(_0x33556a){console['log']('err',_0x33556a);}else{fs['unlinkSync'](_0x20147a);}});});}else{return _0x11c550[_0x82b8('0x1e')](0xc8);}})[_0x82b8('0x33')](handleError(_0x11c550,null));}; \ No newline at end of file +var _0x5308=['jsforce','desk.js','to-csv','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','socket.io-emitter','./smsInteraction.socket','status','end','json','count','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','Users','map','Tags','split','forEach','push','TagIds','catch','index','SmsInteraction','rawAttributes','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','filters','field','color','tools_tags','select','COUNT(*)','sms_messages','from','user_has_sms_interactions','left_join','users','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','me.SmsInteractionId\x20=\x20i.id\x20AND\x20me.direction\x20=\x20\x27in\x27\x20AND\x20me.read\x20=\x20false','expr','advancedFilter','createdAt','value','dateStart','startOf','day','utc','format','endOf','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','unreadMessages','and','tableAlias','\x20IN\x20?','\x20=\x20?','LIKE','c.firstName','\x20LIKE\x20?','c.lastName','\x20<\x20?','TagId','ContactId','\x20>\x20?','isNil','SmsAccountId','i.SmsAccountId\x20IN\x20?','parse','$gte','$lte','null','\x20IS\x20NULL','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','toString','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','DESC','i.id','QueryTypes','SELECT','clone','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','having','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','sms_interaction_has_tags','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','sequelize','merge','COUNT(me.id)','a.key','Account.key','i.*','Contact.firstName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','GROUP_CONCAT(DISTINCT\x20t.id)','it.SmsInteractionId\x20=\x20i.id','groupBy','SmsInteractionId','all','rows','show','params','includeAll','include','create','body','update','find','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','options','findAll','setTags','Tag','smsInteractionTags:save','removeTags','download','unix','root','files','tmp','server','attachments','transcript-%d-%s.zip','Messages','direction','User','fullname','CmContact','Contact','firstName','SmsAccount','Owner','get','10px','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\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','Account','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','out','lastName','secret','renderFile','views','downloadInteraction.html','transcript-','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','squel','crypto'];(function(_0x2dd615,_0x18099c){var _0x5255a4=function(_0x3f4c54){while(--_0x3f4c54){_0x2dd615['push'](_0x2dd615['shift']());}};_0x5255a4(++_0x18099c);}(_0x5308,0xd4));var _0x8530=function(_0x22ee1e,_0x3eff80){_0x22ee1e=_0x22ee1e-0x0;var _0x49a5c9=_0x5308[_0x22ee1e];return _0x49a5c9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8530('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8530('0x1'));var jsonpatch=require(_0x8530('0x2'));var rp=require(_0x8530('0x3'));var moment=require(_0x8530('0x4'));var BPromise=require(_0x8530('0x5'));var Mustache=require(_0x8530('0x6'));var util=require('util');var path=require('path');var sox=require(_0x8530('0x7'));var csv=require('to-csv');var ejs=require(_0x8530('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8530('0x9'));var crypto=require(_0x8530('0xa'));var jsforce=require(_0x8530('0xb'));var deskjs=require(_0x8530('0xc'));var toCsv=require(_0x8530('0xd'));var querystring=require('querystring');var Papa=require(_0x8530('0xe'));var Redis=require(_0x8530('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x8530('0x10'));var logger=require(_0x8530('0x11'))(_0x8530('0x12'));var utils=require(_0x8530('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x8530('0x14')]=_[_0x8530('0x15')](config[_0x8530('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0x8530('0x16'))(new Redis(config['redis']));require(_0x8530('0x17'))['register'](socket);function respondWithStatusCode(_0x21343e,_0x39d630){_0x39d630=_0x39d630||0xcc;return function(_0x41bdc9){if(_0x41bdc9){return _0x21343e['sendStatus'](_0x39d630);}return _0x21343e[_0x8530('0x18')](_0x39d630)[_0x8530('0x19')]();};}function respondWithResult(_0x41d88b,_0x316252){_0x316252=_0x316252||0xc8;return function(_0x38f8bb){if(_0x38f8bb){return _0x41d88b['status'](_0x316252)[_0x8530('0x1a')](_0x38f8bb);}};}function respondWithFilteredResult(_0x1e1a70,_0x5cf5d4){return function(_0x771e53){if(_0x771e53){var _0x19e76e=_0x771e53[_0x8530('0x1b')],_0x44a864=_0x5cf5d4['offset'],_0x19611f=_0x5cf5d4['offset']+_0x5cf5d4['limit'],_0xb7afff;if(_0x19611f>=_0x19e76e){_0x19611f=_0x19e76e;_0xb7afff=0xc8;}else{_0xb7afff=0xce;}_0x1e1a70[_0x8530('0x18')](_0xb7afff);return _0x1e1a70['set'](_0x8530('0x1c'),_0x44a864+'-'+_0x19611f+'/'+_0x19e76e)[_0x8530('0x1a')](_0x771e53);}return null;};}function patchUpdates(_0x1c81ab){return function(_0x58da8b){try{jsonpatch[_0x8530('0x1d')](_0x58da8b,_0x1c81ab,!![]);}catch(_0x568a9d){return BPromise['reject'](_0x568a9d);}return _0x58da8b[_0x8530('0x1e')]();};}function saveUpdates(_0x1beb67,_0x64d285){return function(_0x3d50ab){if(_0x3d50ab){return _0x3d50ab['update'](_0x1beb67)[_0x8530('0x1f')](function(_0x4cf521){return _0x4cf521;});}return null;};}function removeEntity(_0x443c5b,_0x23c17a){return function(_0x1d1fd4){if(_0x1d1fd4){return _0x1d1fd4[_0x8530('0x20')]()[_0x8530('0x1f')](function(){_0x443c5b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f8bb7,_0x84da78){return function(_0x49f963){if(!_0x49f963){_0x3f8bb7[_0x8530('0x21')](0x194);}return _0x49f963;};}function handleError(_0x3d00ce,_0x41ebe7){_0x41ebe7=_0x41ebe7||0x1f4;return function(_0x4850fb){logger[_0x8530('0x22')](_0x4850fb[_0x8530('0x23')]);if(_0x4850fb[_0x8530('0x24')]){delete _0x4850fb[_0x8530('0x24')];}_0x3d00ce[_0x8530('0x18')](_0x41ebe7)[_0x8530('0x25')](_0x4850fb);};}function getInteractionUsers(_0x2a02d5,_0x500493){return new BPromise(function(_0x344bde,_0x4ca65a){try{if(_0x500493[_0x2a02d5['id']]){_0x2a02d5[_0x8530('0x26')]=_[_0x8530('0x27')](_0x500493[_0x2a02d5['id']],function(_0x245bc6){return{'id':_0x245bc6['id']};});}}catch(_0x2892b2){_0x4ca65a(_0x2892b2);}_0x344bde(_0x2a02d5);});}function getInteractionTags(_0x35b467,_0x54ccab){return new BPromise(function(_0x577c90,_0x347ad7){try{if(_0x35b467['TagIds']){_0x35b467[_0x8530('0x28')]=[];_0x35b467['TagIds'][_0x8530('0x29')](',')[_0x8530('0x2a')](function(_0x2e2b2a){_0x35b467['Tags'][_0x8530('0x2b')](_0x54ccab[_0x2e2b2a]);});}delete _0x35b467[_0x8530('0x2c')];}catch(_0x5d73d7){_0x347ad7(_0x5d73d7);}_0x577c90(_0x35b467);});}function updateSmsInteraction(_0x4cd085,_0x5c579e,_0xa76d18){return new BPromise(function(_0x2b0355,_0xe165be){return getInteractionUsers(_0x4cd085,_0xa76d18)[_0x8530('0x1f')](function(_0x1608f5){return getInteractionTags(_0x1608f5,_0x5c579e);})[_0x8530('0x1f')](function(_0x8b5510){_0x2b0355(_0x8b5510);})[_0x8530('0x2d')](function(_0x18f358){_0xe165be(_0x18f358);});});}exports[_0x8530('0x2e')]=function(_0x3a9fa8,_0x22aef2){var _0x540bac={},_0x445e44={},_0x24e655={'count':0x0,'rows':[]};var _0x4bc6b3=db[_0x8530('0x2f')][_0x8530('0x30')];_0x445e44[_0x8530('0x31')]=_['keys'](_0x4bc6b3);_0x445e44['query']=_[_0x8530('0x32')](_0x3a9fa8['query']);_0x445e44['filters']=_[_0x8530('0x33')](_0x445e44[_0x8530('0x31')],_0x445e44[_0x8530('0x34')]);_0x540bac[_0x8530('0x35')]=_[_0x8530('0x33')](_0x445e44[_0x8530('0x31')],qs[_0x8530('0x36')](_0x3a9fa8[_0x8530('0x34')][_0x8530('0x36')]));_0x540bac[_0x8530('0x35')]=_0x540bac['attributes'][_0x8530('0x37')]?_0x540bac['attributes']:_0x445e44[_0x8530('0x31')];if(!_0x3a9fa8[_0x8530('0x34')][_0x8530('0x38')](_0x8530('0x39'))){_0x540bac['limit']=qs[_0x8530('0x3a')](_0x3a9fa8[_0x8530('0x34')]['limit']);_0x540bac[_0x8530('0x3b')]=qs[_0x8530('0x3b')](_0x3a9fa8[_0x8530('0x34')][_0x8530('0x3b')]);}_0x540bac[_0x8530('0x3c')]=qs[_0x8530('0x3d')](_0x3a9fa8[_0x8530('0x34')][_0x8530('0x3d')]);_0x540bac[_0x8530('0x3e')]=qs[_0x8530('0x3f')](_['pick'](_0x3a9fa8[_0x8530('0x34')],_0x445e44['filters']));var _0x5864a6=[];var _0x540048=squel['select']()[_0x8530('0x40')]('id')[_0x8530('0x40')]('name')['field'](_0x8530('0x41'))['from'](_0x8530('0x42'));var _0x244ac1=squel[_0x8530('0x43')]()[_0x8530('0x40')](_0x8530('0x44'))['from'](_0x8530('0x45'),'me')[_0x8530('0x3e')]('me.SmsInteractionId\x20=\x20i.id')[_0x8530('0x3e')]('me.direction\x20=\x20\x27in\x27')['where']('me.read\x20=\x20false');var _0x52d68c=squel[_0x8530('0x43')]()['field']('u.id')[_0x8530('0x40')]('ui.SmsInteractionId')[_0x8530('0x46')](_0x8530('0x47'),'ui')[_0x8530('0x48')](_0x8530('0x49'),'u','u.id\x20=\x20ui.UserId');var _0x41711c=squel[_0x8530('0x43')]()[_0x8530('0x46')]('sms_interactions','i')[_0x8530('0x48')](_0x8530('0x4a'),'c',_0x8530('0x4b'))['left_join'](_0x8530('0x49'),'o',_0x8530('0x4c'))['left_join'](_0x8530('0x4d'),'a',_0x8530('0x4e'))[_0x8530('0x48')](_0x8530('0x45'),'me',_0x8530('0x4f'));var _0x532045=squel[_0x8530('0x50')]();if(_0x3a9fa8[_0x8530('0x34')]['advancedFilter']){var _0x358287=JSON['parse'](_0x3a9fa8[_0x8530('0x34')][_0x8530('0x51')]);_[_0x8530('0x32')](_0x358287)['forEach'](function(_0x57fd67){var _0x359075=_0x358287[_0x57fd67];if(_0x57fd67===_0x8530('0x52')){var _0x5d5efe=moment(_0x359075[_0x8530('0x53')][_0x8530('0x54')])[_0x8530('0x55')](_0x8530('0x56'))[_0x8530('0x57')]()[_0x8530('0x58')]();var _0x4859a6=moment(_0x4859a6)[_0x8530('0x57')]()[_0x8530('0x59')]('day')[_0x8530('0x58')]();_0x532045['and'](_0x8530('0x5a'),_0x5d5efe,_0x4859a6);}else{if(_[_0x8530('0x5b')](_0x359075[_0x8530('0x5c')])){_0x359075[_0x8530('0x5c')][_0x8530('0x2a')](function(_0x2e8a7b){switch(_0x359075[_0x8530('0x5c')][_0x8530('0x53')]){case'IS':if(_0x57fd67!=='TagId'&&_0x57fd67!==_0x8530('0x5d')){if(_['isArray'](_0x359075[_0x8530('0x53')])&&_0x359075[_0x8530('0x53')][_0x8530('0x37')]>0x1){_0x532045[_0x8530('0x5e')](_0x359075[_0x8530('0x5f')]+'.'+_0x57fd67+_0x8530('0x60'),_0x359075[_0x8530('0x53')]);}else{_0x532045[_0x8530('0x5e')](_0x359075[_0x8530('0x5f')]+'.'+_0x57fd67+_0x8530('0x61'),_0x359075['value'][0x0]);}}break;case'=':_0x532045[_0x8530('0x5e')](_0x359075[_0x8530('0x5f')]+'.'+_0x57fd67+_0x8530('0x61'),_0x359075[_0x8530('0x53')]);break;case _0x8530('0x62'):if(_0x57fd67==='ContactId'){_0x532045[_0x8530('0x5e')](_0x8530('0x63')+_0x8530('0x64'),'%'+_0x359075[_0x8530('0x53')]+'%');_0x532045['or'](_0x8530('0x65')+'\x20LIKE\x20?','%'+_0x359075[_0x8530('0x53')]+'%');_0x532045['or']('c.email'+_0x8530('0x64'),'%'+_0x359075[_0x8530('0x53')]+'%');}else{_0x532045[_0x8530('0x5e')](_0x359075[_0x8530('0x5f')]+'.'+_0x57fd67+_0x8530('0x64'),'%'+_0x359075[_0x8530('0x53')]+'%');}break;case'>':_0x532045['and'](_0x359075[_0x8530('0x5f')]+'.'+_0x57fd67+'\x20>\x20?',_0x359075[_0x8530('0x53')]);break;case'<':_0x532045[_0x8530('0x5e')](_0x359075[_0x8530('0x5f')]+'.'+_0x57fd67+_0x8530('0x66'),_0x359075['value']);break;}});}else{switch(_0x359075[_0x8530('0x5c')][_0x8530('0x53')]){case'IS':if(_0x57fd67!==_0x8530('0x67')&&_0x57fd67!=='unreadMessages'){if(_[_0x8530('0x5b')](_0x359075['value'])&&_0x359075['value']['length']>0x1){_0x532045['and'](_0x359075[_0x8530('0x5f')]+'.'+_0x57fd67+_0x8530('0x60'),_0x359075[_0x8530('0x53')]);}else{_0x532045[_0x8530('0x5e')](_0x359075[_0x8530('0x5f')]+'.'+_0x57fd67+_0x8530('0x61'),_0x359075[_0x8530('0x53')][0x0]);}}break;case'=':_0x532045[_0x8530('0x5e')](_0x359075['tableAlias']+'.'+_0x57fd67+_0x8530('0x61'),_0x359075['value']);break;case _0x8530('0x62'):if(_0x57fd67===_0x8530('0x68')){_0x532045[_0x8530('0x5e')](_0x8530('0x63')+_0x8530('0x64'),'%'+_0x359075[_0x8530('0x53')]+'%');_0x532045['or']('c.lastName'+_0x8530('0x64'),'%'+_0x359075['value']+'%');_0x532045['or']('c.email'+_0x8530('0x64'),'%'+_0x359075[_0x8530('0x53')]+'%');}else{_0x532045['and'](_0x359075['tableAlias']+'.'+_0x57fd67+_0x8530('0x64'),'%'+_0x359075[_0x8530('0x53')]+'%');}break;case'>':_0x532045['and'](_0x359075[_0x8530('0x5f')]+'.'+_0x57fd67+_0x8530('0x69'),_0x359075[_0x8530('0x53')]);break;case'<':_0x532045[_0x8530('0x5e')](_0x359075[_0x8530('0x5f')]+'.'+_0x57fd67+'\x20<\x20?',_0x359075[_0x8530('0x53')]);break;}}}});}else{var _0x23e28d=_(Object[_0x8530('0x32')](_0x3a9fa8[_0x8530('0x34')]))[_0x8530('0x27')](function(_0x21d6b6){return _0x4bc6b3[_0x8530('0x38')](_0x21d6b6)?_0x21d6b6:undefined;})['filter'](function(_0x5349e3){return!_[_0x8530('0x6a')](_0x5349e3);})[_0x8530('0x53')]();if(!_['isEmpty'](_0x23e28d)){_0x23e28d[_0x8530('0x2a')](function(_0x16e732){if(_0x16e732===_0x8530('0x6b')){_0x41711c[_0x8530('0x3e')](_0x8530('0x6c'),[]['concat'](_0x3a9fa8[_0x8530('0x34')][_0x16e732]));}else if(_0x16e732===_0x8530('0x52')){var _0x1fc28f=JSON[_0x8530('0x6d')](_0x3a9fa8['query'][_0x16e732])[_0x8530('0x6e')];var _0x444da3=JSON['parse'](_0x3a9fa8[_0x8530('0x34')][_0x16e732])[_0x8530('0x6f')];_0x41711c[_0x8530('0x3e')](_0x8530('0x5a'),_0x1fc28f,_0x444da3);}else{if(_0x3a9fa8[_0x8530('0x34')][_0x16e732]===_0x8530('0x70')){_0x41711c[_0x8530('0x3e')]('i.'+_0x16e732+_0x8530('0x71'));}else{_0x41711c['where']('i.'+_0x16e732+_0x8530('0x61'),_0x3a9fa8[_0x8530('0x34')][_0x16e732]);}}});}if(_0x3a9fa8[_0x8530('0x34')][_0x8530('0x72')]){var _0x14d856=_0x3a9fa8[_0x8530('0x34')][_0x8530('0x72')][_0x8530('0x73')]('\x5c','\x5c\x5c')[_0x8530('0x73')]('\x27\x27',_0x8530('0x74'));if(qs[_0x8530('0x75')](_0x14d856)){_0x532045['or'](_0x8530('0x76'),_0x14d856+'%')['or'](_0x8530('0x77'),_0x14d856+'%');}else{var _0x55a5e2=[];_0x14d856['split']('\x20')[_0x8530('0x2a')](function(_0xe4e45e){_0x55a5e2['push']('+'+_0xe4e45e[_0x8530('0x78')]());});var _0x1422a0=_0x55a5e2[_0x8530('0x79')]('\x20');_0x532045['or'](_0x8530('0x7a'),_0x1422a0)['or'](_0x8530('0x7b'),_0x14d856+'%');}}}_0x41711c[_0x8530('0x3e')](_0x532045);if(_0x540bac[_0x8530('0x3c')]){_0x540bac[_0x8530('0x3c')][_0x8530('0x2a')](function(_0x48b32b){_0x41711c[_0x8530('0x3c')]('i.'+_0x48b32b[0x0],_0x48b32b[0x1]===_0x8530('0x7c')?![]:!![]);});}_0x41711c['group'](_0x8530('0x7d'));var _0xa072a1={'type':db['Sequelize'][_0x8530('0x7e')][_0x8530('0x7f')],'raw':!![]};var _0xcba096=_0x41711c[_0x8530('0x80')]()[_0x8530('0x40')]('COUNT(*)')[_0x8530('0x40')]('COUNT(me.id)',_0x8530('0x5d'));if(!_0x3a9fa8[_0x8530('0x34')][_0x8530('0x51')]){if(_0x3a9fa8[_0x8530('0x34')]['read']){if(_0x3a9fa8[_0x8530('0x34')][_0x8530('0x81')]==0x1){_0xcba096['having'](_0x8530('0x82'));_0x41711c['having'](_0x8530('0x82'));}else{_0xcba096['having'](_0x8530('0x83'));_0x41711c[_0x8530('0x84')](_0x8530('0x83'));}}if(_0x3a9fa8[_0x8530('0x34')][_0x8530('0x85')]){var _0x28e5df=_[_0x8530('0x5b')](_0x3a9fa8['query'][_0x8530('0x85')])?_0x3a9fa8['query'][_0x8530('0x85')]:new Array(_0x3a9fa8['query'][_0x8530('0x85')]);var _0x111920=squel[_0x8530('0x50')]();_0x28e5df['forEach'](function(_0x2da6e7){_0x111920['or'](_0x8530('0x86'),'%,'+_0x2da6e7+',%');});_0x41711c[_0x8530('0x84')](_0x111920);_0xcba096[_0x8530('0x48')](_0x8530('0x87'),'it','it.SmsInteractionId\x20=\x20i.id');_0xcba096[_0x8530('0x48')](_0x8530('0x42'),'t',_0x8530('0x88'));_0xcba096[_0x8530('0x3e')](_0x8530('0x89'),_0x28e5df);}}else{var _0x358287=JSON[_0x8530('0x6d')](_0x3a9fa8[_0x8530('0x34')][_0x8530('0x51')]);_[_0x8530('0x32')](_0x358287)[_0x8530('0x2a')](function(_0x593179){var _0x5eb77b=_0x358287[_0x593179];if(_0x593179===_0x8530('0x67')){var _0x3bea08=_0x5eb77b[_0x8530('0x53')];var _0x197cc=squel[_0x8530('0x50')]();_0x3bea08[_0x8530('0x2a')](function(_0x2481f0){_0x197cc['or'](_0x8530('0x86'),'%,'+_0x2481f0+',%');});_0x41711c['having'](_0x197cc);_0xcba096[_0x8530('0x48')](_0x8530('0x8a'),'it',_0x8530('0x8b'));_0xcba096['left_join'](_0x8530('0x42'),'t',_0x8530('0x88'));_0xcba096[_0x8530('0x3e')](_0x8530('0x89'),_0x3bea08);}else if(_0x593179===_0x8530('0x5d')){if(_0x5eb77b[_0x8530('0x53')][_0x8530('0x37')]===0x1){if(_0x5eb77b[_0x8530('0x53')][0x0]===0x1){_0xcba096[_0x8530('0x84')](_0x8530('0x82'));_0x41711c['having'](_0x8530('0x82'));}else{_0xcba096['having'](_0x8530('0x83'));_0x41711c['having']('`unreadMessages`\x20>\x200');}}}});}db['sequelize']['query'](_0xcba096['toString'](),_0xa072a1)[_0x8530('0x1f')](function(_0x1ac810){_0x24e655[_0x8530('0x1b')]=_0x1ac810['length'];if(_0x24e655[_0x8530('0x1b')]===0x0)return[];return db[_0x8530('0x8c')][_0x8530('0x34')](_0x540048[_0x8530('0x78')](),_0xa072a1)[_0x8530('0x1f')](function(_0x35ef06){_0x5864a6=_['keyBy'](_0x35ef06,'id');_0xa072a1=_[_0x8530('0x8d')](_0xa072a1,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});_0x41711c[_0x8530('0x40')](_0x8530('0x8e'),_0x8530('0x5d'));_0x41711c[_0x8530('0x40')](_0x8530('0x8f'),_0x8530('0x90'));_0x41711c[_0x8530('0x40')](_0x8530('0x91'));_0x41711c['field'](_0x8530('0x63'),_0x8530('0x92'));_0x41711c[_0x8530('0x40')](_0x8530('0x65'),_0x8530('0x93'));_0x41711c[_0x8530('0x40')](_0x8530('0x94'),_0x8530('0x95'));_0x41711c['field']('c.phone',_0x8530('0x96'));_0x41711c[_0x8530('0x40')](_0x8530('0x97'),_0x8530('0x98'));_0x41711c[_0x8530('0x40')](_0x8530('0x99'),'Contact.fax');_0x41711c['field'](_0x8530('0x9a'),_0x8530('0x2c'));_0x41711c['left_join'](_0x8530('0x87'),'it',_0x8530('0x9b'));_0x41711c[_0x8530('0x48')]('tools_tags','t',_0x8530('0x88'));_0x41711c[_0x8530('0x3a')](_0x540bac[_0x8530('0x3a')]);_0x41711c[_0x8530('0x3b')](_0x540bac['offset']);return db[_0x8530('0x8c')][_0x8530('0x34')](_0x41711c['toString'](),_0xa072a1);})[_0x8530('0x1f')](function(_0x4280a3){_0x52d68c[_0x8530('0x3e')]('ui.SmsInteractionId\x20IN\x20?',_['map'](_0x4280a3,'id'));return db[_0x8530('0x8c')][_0x8530('0x34')](_0x52d68c['toString'](),_0xa072a1)['then'](function(_0x301329){var _0x16b09b=_[_0x8530('0x9c')](_0x301329,_0x8530('0x9d'));var _0xad5d01=[];_0x4280a3[_0x8530('0x2a')](function(_0x58313a){_0xad5d01['push'](updateSmsInteraction(_0x58313a,_0x5864a6,_0x16b09b));});return BPromise[_0x8530('0x9e')](_0xad5d01);});});})[_0x8530('0x1f')](function(_0x4d37a2){_0x24e655[_0x8530('0x9f')]=_0x4d37a2;return _0x24e655;})[_0x8530('0x1f')](respondWithFilteredResult(_0x22aef2,_0x540bac))[_0x8530('0x2d')](handleError(_0x22aef2,null));};exports[_0x8530('0xa0')]=function(_0x4c3059,_0x5af660){var _0x3094ac={'raw':![],'where':{'id':_0x4c3059[_0x8530('0xa1')]['id']}},_0x376c7a={};_0x376c7a[_0x8530('0x31')]=_[_0x8530('0x32')](db[_0x8530('0x2f')][_0x8530('0x30')]);_0x376c7a[_0x8530('0x34')]=_[_0x8530('0x32')](_0x4c3059[_0x8530('0x34')]);_0x376c7a[_0x8530('0x3f')]=_['intersection'](_0x376c7a[_0x8530('0x31')],_0x376c7a[_0x8530('0x34')]);_0x3094ac[_0x8530('0x35')]=_[_0x8530('0x33')](_0x376c7a[_0x8530('0x31')],qs[_0x8530('0x36')](_0x4c3059['query'][_0x8530('0x36')]));_0x3094ac['attributes']=_0x3094ac[_0x8530('0x35')]['length']?_0x3094ac[_0x8530('0x35')]:_0x376c7a['model'];if(_0x4c3059[_0x8530('0x34')][_0x8530('0xa2')]){_0x3094ac[_0x8530('0xa3')]=[{'all':!![]}];}_0x3094ac=_[_0x8530('0x8d')]({},_0x3094ac,_0x4c3059['options']);return db[_0x8530('0x2f')]['find'](_0x3094ac)['then'](handleEntityNotFound(_0x5af660,null))[_0x8530('0x1f')](respondWithResult(_0x5af660,null))[_0x8530('0x2d')](handleError(_0x5af660,null));};exports['create']=function(_0x2df59e,_0x2b33df){return db[_0x8530('0x2f')][_0x8530('0xa4')](_0x2df59e[_0x8530('0xa5')],{})[_0x8530('0x1f')](respondWithResult(_0x2b33df,0xc9))['catch'](handleError(_0x2b33df,null));};exports[_0x8530('0xa6')]=function(_0x1f4134,_0x25f03f){if(_0x1f4134[_0x8530('0xa5')]['id']){delete _0x1f4134[_0x8530('0xa5')]['id'];}return db['SmsInteraction'][_0x8530('0xa7')]({'where':{'id':_0x1f4134[_0x8530('0xa1')]['id']}})['then'](handleEntityNotFound(_0x25f03f,null))[_0x8530('0x1f')](saveUpdates(_0x1f4134[_0x8530('0xa5')],null))[_0x8530('0x1f')](respondWithResult(_0x25f03f,null))['catch'](handleError(_0x25f03f,null));};exports[_0x8530('0x20')]=function(_0x37adb0,_0x3a30a6){return db['SmsInteraction']['find']({'where':{'id':_0x37adb0[_0x8530('0xa1')]['id']}})[_0x8530('0x1f')](handleEntityNotFound(_0x3a30a6,null))[_0x8530('0x1f')](removeEntity(_0x3a30a6,null))[_0x8530('0x2d')](handleError(_0x3a30a6,null));};exports[_0x8530('0xa8')]=function(_0x27747c,_0x212aec){return db[_0x8530('0x2f')][_0x8530('0xa8')]()['then'](respondWithResult(_0x212aec,null))[_0x8530('0x2d')](handleError(_0x212aec,null));};exports[_0x8530('0xa9')]=function(_0x38e02f,_0x5ab3d0,_0x55f8e8){return db[_0x8530('0xaa')]['find']({'where':{'id':_0x38e02f[_0x8530('0xa1')]['id']}})['then'](handleEntityNotFound(_0x5ab3d0,null))['then'](function(_0x5dcdf8){if(_0x5dcdf8){return _0x5dcdf8[_0x8530('0xa9')](_0x38e02f['body'][_0x8530('0xab')],_[_0x8530('0xac')](_0x38e02f[_0x8530('0xa5')],[_0x8530('0xab'),'id'])||{});}})['then'](respondWithResult(_0x5ab3d0,null))[_0x8530('0x2d')](handleError(_0x5ab3d0,null));};exports[_0x8530('0xad')]=function(_0x978e7b,_0x4bc04c,_0xfa53e1){var _0x559d32={'raw':![],'where':{}};var _0x5e6635={};var _0x572aea={'count':0x0,'rows':[]};return db['SmsInteraction'][_0x8530('0xae')]({'where':{'id':_0x978e7b['params']['id']}})['then'](handleEntityNotFound(_0x4bc04c,null))[_0x8530('0x1f')](function(_0x274851){if(_0x274851){_0x5e6635[_0x8530('0x31')]=_['keys'](db[_0x8530('0xaa')][_0x8530('0x30')]);_0x5e6635[_0x8530('0x34')]=_[_0x8530('0x32')](_0x978e7b[_0x8530('0x34')]);_0x5e6635['filters']=_[_0x8530('0x33')](_0x5e6635[_0x8530('0x31')],_0x5e6635[_0x8530('0x34')]);_0x559d32[_0x8530('0x35')]=_[_0x8530('0x33')](_0x5e6635[_0x8530('0x31')],qs['fields'](_0x978e7b[_0x8530('0x34')][_0x8530('0x36')]));_0x559d32[_0x8530('0x35')]=_0x559d32[_0x8530('0x35')][_0x8530('0x37')]?_0x559d32[_0x8530('0x35')]:_0x5e6635[_0x8530('0x31')];if(!_0x978e7b[_0x8530('0x34')][_0x8530('0x38')](_0x8530('0x39'))){_0x559d32[_0x8530('0x3a')]=qs[_0x8530('0x3a')](_0x978e7b[_0x8530('0x34')][_0x8530('0x3a')]);_0x559d32['offset']=qs[_0x8530('0x3b')](_0x978e7b[_0x8530('0x34')][_0x8530('0x3b')]);}_0x559d32[_0x8530('0x3c')]=qs['sort'](_0x978e7b['query'][_0x8530('0x3d')]);_0x559d32[_0x8530('0x3e')]=qs[_0x8530('0x3f')](_['pick'](_0x978e7b[_0x8530('0x34')],_0x5e6635['filters']));_0x559d32['where'][_0x8530('0x9d')]=_0x274851['id'];if(_0x978e7b[_0x8530('0x34')]['filter']){_0x559d32['where']=_[_0x8530('0x8d')](_0x559d32['where'],{'$or':_[_0x8530('0x27')](_0x559d32['attributes'],function(_0x5c654a){var _0x19d125={};_0x19d125[_0x5c654a]={'$like':'%'+_0x978e7b[_0x8530('0x34')][_0x8530('0x72')]+'%'};return _0x19d125;})});}if(_0x978e7b['query'][_0x8530('0x6e')]){var _0x5a368c=_0x978e7b[_0x8530('0x34')][_0x8530('0x6e')][_0x8530('0x29')](',');var _0x83d93={};_0x83d93[_0x5a368c[0x0]]={'$gte':moment(_0x5a368c[0x1])[_0x8530('0x58')]('YYYY-MM-DD\x20HH:mm:ss')};_0x559d32[_0x8530('0x3e')]=_['merge'](_0x559d32[_0x8530('0x3e')],_0x83d93);}_0x559d32=_[_0x8530('0x8d')]({},_0x559d32,_0x978e7b[_0x8530('0xaf')]);return db[_0x8530('0xaa')]['count']({'where':_0x559d32[_0x8530('0x3e')]})[_0x8530('0x1f')](function(_0x3e3001){_0x572aea[_0x8530('0x1b')]=_0x3e3001;if(_0x978e7b['query'][_0x8530('0xa2')]){_0x559d32[_0x8530('0xa3')]=[{'all':!![]}];}return db['SmsMessage'][_0x8530('0xb0')](_0x559d32);})[_0x8530('0x1f')](function(_0xa122e5){_0x572aea[_0x8530('0x9f')]=_0xa122e5;return _0x572aea;});}})[_0x8530('0x1f')](respondWithFilteredResult(_0x4bc04c,_0x559d32))['catch'](handleError(_0x4bc04c,null));};exports['addTags']=function(_0x40cd99,_0x16f38b,_0x1d80e7){return db['SmsInteraction'][_0x8530('0xa7')]({'where':{'id':_0x40cd99[_0x8530('0xa1')]['id']}})[_0x8530('0x1f')](handleEntityNotFound(_0x16f38b,null))['then'](function(_0x1a7d1a){if(_0x1a7d1a){return _0x1a7d1a[_0x8530('0xb1')](_0x40cd99[_0x8530('0xa5')][_0x8530('0xab')],_[_0x8530('0xac')](_0x40cd99[_0x8530('0xa5')],[_0x8530('0xab'),'id'])||{})['spread'](function(){return db[_0x8530('0xb2')][_0x8530('0xb0')]({'attributes':['id',_0x8530('0x24'),_0x8530('0x41')],'where':{'id':_0x40cd99[_0x8530('0xa5')]['ids']}});})['then'](function(_0x3288b2){socket['emit'](_0x8530('0xb3'),{'id':Number(_0x40cd99[_0x8530('0xa1')]['id']),'tags':_0x3288b2||[]});return{'id':Number(_0x40cd99[_0x8530('0xa1')]['id']),'tags':_0x3288b2||[]};});}})['then'](respondWithResult(_0x16f38b,null))[_0x8530('0x2d')](handleError(_0x16f38b,null));};exports[_0x8530('0xb4')]=function(_0x501d23,_0x32d9a3,_0x4c17c9){return db[_0x8530('0x2f')][_0x8530('0xa7')]({'where':{'id':_0x501d23[_0x8530('0xa1')]['id']}})['then'](handleEntityNotFound(_0x32d9a3,null))[_0x8530('0x1f')](function(_0x1477d8){if(_0x1477d8){return _0x1477d8['removeTags'](_0x501d23[_0x8530('0x34')][_0x8530('0xab')]);}})[_0x8530('0x1f')](respondWithStatusCode(_0x32d9a3,null))[_0x8530('0x2d')](handleError(_0x32d9a3,null));};exports[_0x8530('0xb5')]=function(_0x349fed,_0x4f1251){var _0x436b97=moment()[_0x8530('0xb6')]()['toString']();var _0x48ae63=path[_0x8530('0x79')](config[_0x8530('0xb7')],'server',_0x8530('0xb8'),_0x8530('0xb9'));var _0x2ab484=path[_0x8530('0x79')](config[_0x8530('0xb7')],_0x8530('0xba'),_0x8530('0xb8'),_0x8530('0xbb'));var _0x25d7a6=path[_0x8530('0x79')](_0x48ae63,_0x436b97);var _0x57dfbd=util[_0x8530('0x58')](_0x8530('0xbc'),_0x349fed[_0x8530('0xa1')]['id'],_0x436b97);var _0x34faa1=path[_0x8530('0x79')](_0x48ae63,_0x57dfbd);var _0x4c5c86=![];return db[_0x8530('0x2f')]['find']({'where':{'id':_0x349fed[_0x8530('0xa1')]['id']},'include':[{'model':db[_0x8530('0xaa')],'as':_0x8530('0xbd'),'attributes':['id',_0x8530('0xa5'),_0x8530('0x52'),_0x8530('0xbe'),'secret'],'include':[{'model':db[_0x8530('0xbf')],'as':_0x8530('0xbf'),'attributes':['id',_0x8530('0xc0')],'raw':!![]},{'model':db[_0x8530('0xc1')],'as':_0x8530('0xc2'),'attributes':['id',_0x8530('0xc3'),'lastName'],'raw':!![]}]},{'model':db[_0x8530('0xc4')],'as':'Account','attributes':['id',_0x8530('0x24')]},{'model':db[_0x8530('0xbf')],'as':_0x8530('0xc5'),'attributes':['id','fullname']}]})[_0x8530('0x1f')](handleEntityNotFound(_0x4f1251,null))[_0x8530('0x1f')](function(_0xd30608){if(_0xd30608){var _0x504d45=_0xd30608[_0x8530('0xc6')]({'plain':!![]});_0x4c5c86=!![];var _0x1607bd={'format':'A4','border':_0x8530('0xc7'),'header':{'height':_0x8530('0xc8'),'contents':{'first':_0x8530('0xc9')}},'footer':{'height':_0x8530('0xca'),'contents':{'default':util[_0x8530('0x58')](_0x8530('0xcb'),util[_0x8530('0x58')](_0x8530('0xcc'),'Sms',_0x504d45['id']),moment()['format'](_0x8530('0xcd'))['toString']())}}};fs[_0x8530('0xce')](_0x25d7a6);var _0x3e5b74={'channel':'Sms','account':_0x504d45[_0x8530('0xcf')]['name'],'agent':_0x504d45[_0x8530('0xc5')]?_0x504d45['Owner']['fullname']:_0x8530('0xd0'),'createdAt':moment(_0x504d45[_0x8530('0x52')])[_0x8530('0x58')](_0x8530('0xd1'))[_0x8530('0x78')](),'closedAt':_0x504d45[_0x8530('0xd2')]?moment(_0x504d45[_0x8530('0xd3')])[_0x8530('0x58')](_0x8530('0xd1'))[_0x8530('0x78')]():'','disposition':_0x504d45[_0x8530('0xd4')],'messages':_(_0x504d45[_0x8530('0xbd')])[_0x8530('0x72')]({'secret':![]})[_0x8530('0x27')](function(_0x11b267){return{'date':moment(_0x11b267['createdAt'])[_0x8530('0x58')](_0x8530('0xd1'))[_0x8530('0x78')](),'sender':_0x11b267['direction']===_0x8530('0xd5')?_0x11b267[_0x8530('0xbf')]?_0x11b267[_0x8530('0xbf')][_0x8530('0xc0')]:'System':_0x11b267[_0x8530('0xc2')]['firstName']+(_0x11b267[_0x8530('0xc2')][_0x8530('0xd6')]?'\x20'+_0x11b267[_0x8530('0xc2')][_0x8530('0xd6')]:''),'body':_0x11b267['body'],'direction':_0x11b267[_0x8530('0xbe')]===_0x8530('0xd5')?'A':'C','secret':_0x11b267[_0x8530('0xd7')]};})[_0x8530('0x53')]()};return ejs[_0x8530('0xd8')](path['join'](config[_0x8530('0xb7')],_0x8530('0xba'),_0x8530('0xd9'),_0x8530('0xda')),{'interaction':_0x3e5b74})[_0x8530('0x1f')](function(_0x5a1b70){return new BPromise(function(_0x334f91,_0x3c0f71){pdf['create'](_0x5a1b70,_0x1607bd)['toFile'](path[_0x8530('0x79')](_0x25d7a6,_0x8530('0xdb')+_0x504d45['id']+'-'+_0x436b97+'.pdf'),function(_0x183fd7,_0x5e4c3e){if(_0x183fd7)return _0x3c0f71(_0x183fd7);_0x334f91(_0x5e4c3e);});});});}})['then'](function(){if(_0x4c5c86){return new BPromise(function(_0x569f1a,_0x493c7b){zipdir(_0x25d7a6,{'saveTo':_0x34faa1},function(_0x5e0ffa,_0x333179){if(_0x5e0ffa)return _0x493c7b(_0x5e0ffa);return _0x569f1a(_0x333179);});})[_0x8530('0x1f')](function(){return new BPromise(function(_0x5c6354,_0x4fc577){rimraf(_0x25d7a6,function(_0x479525){if(_0x479525)_0x4fc577(_0x479525);return _0x5c6354();});});})[_0x8530('0x1f')](function(){return _0x4f1251[_0x8530('0xb5')](_0x34faa1,_0x57dfbd,function(_0x345487){if(_0x345487){console[_0x8530('0xdc')](_0x8530('0xdd'),_0x345487);}else{fs[_0x8530('0xde')](_0x34faa1);}});});}else{return _0x4f1251['sendStatus'](0xc8);}})['catch'](handleError(_0x4f1251,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index f8bf0ec..a41f1ec 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 _0xb28d=['getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','hasOwnProperty','exports','SmsInteraction','setMaxListeners','save','update','remove'];(function(_0x5c92d2,_0x2aba85){var _0x5af39c=function(_0x4a04e0){while(--_0x4a04e0){_0x5c92d2['push'](_0x5c92d2['shift']());}};_0x5af39c(++_0x2aba85);}(_0xb28d,0x1eb));var _0xdb28=function(_0x4f2c3a,_0x6bde90){_0x4f2c3a=_0x4f2c3a-0x0;var _0x17d91c=_0xb28d[_0x4f2c3a];return _0x17d91c;};'use strict';var EventEmitter=require('events');var SmsInteraction=require('../../mysqldb')['db'][_0xdb28('0x0')];var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xdb28('0x1')](0x0);var events={'afterCreate':_0xdb28('0x2'),'afterUpdate':_0xdb28('0x3'),'afterDestroy':_0xdb28('0x4')};function emitEvent(_0x1ad78a){return function(_0x30f52d,_0x276dbf,_0x372a23){_0x30f52d[_0xdb28('0x5')]({'attributes':['id'],'raw':!![]})[_0xdb28('0x6')](function(_0x6b0924){_0x30f52d[_0xdb28('0x7')](_0xdb28('0x8'),_0x6b0924[_0xdb28('0x9')](function(_0x486fef){return{'id':_0x486fef['id']};}));return SmsMessage[_0xdb28('0xa')]({'where':{'SmsInteractionId':_0x30f52d['id'],'direction':'in','read':![]},'raw':!![]});})[_0xdb28('0x6')](function(_0x5c77af){_0x30f52d[_0xdb28('0x7')](_0xdb28('0xb'),_0x5c77af[_0xdb28('0xc')]);SmsInteractionEvents[_0xdb28('0xd')](_0x1ad78a+':'+_0x30f52d['id'],_0x30f52d);SmsInteractionEvents[_0xdb28('0xd')](_0x1ad78a,_0x30f52d);_0x372a23(null);})['catch'](_0x372a23(null));};}for(var e in events){if(events[_0xdb28('0xe')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0xdb28('0xf')]=SmsInteractionEvents; \ No newline at end of file +var _0xfb10=['SmsInteraction','SmsMessage','save','update','remove','getUsers','then','Users','map','findAll','unreadMessages','length','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x34f314,_0x4826e2){var _0x2145cb=function(_0x520b0d){while(--_0x520b0d){_0x34f314['push'](_0x34f314['shift']());}};_0x2145cb(++_0x4826e2);}(_0xfb10,0x130));var _0x0fb1=function(_0x56dc8c,_0x1449b3){_0x56dc8c=_0x56dc8c-0x0;var _0x5b2f53=_0xfb10[_0x56dc8c];return _0x5b2f53;};'use strict';var EventEmitter=require(_0x0fb1('0x0'));var SmsInteraction=require(_0x0fb1('0x1'))['db'][_0x0fb1('0x2')];var SmsMessage=require(_0x0fb1('0x1'))['db'][_0x0fb1('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0fb1('0x4'),'afterUpdate':_0x0fb1('0x5'),'afterDestroy':_0x0fb1('0x6')};function emitEvent(_0x569333){return function(_0x3c710c,_0x300c0e,_0x12634f){_0x3c710c[_0x0fb1('0x7')]({'attributes':['id'],'raw':!![]})[_0x0fb1('0x8')](function(_0x431cd6){_0x3c710c['setDataValue'](_0x0fb1('0x9'),_0x431cd6[_0x0fb1('0xa')](function(_0x31b781){return{'id':_0x31b781['id']};}));return SmsMessage[_0x0fb1('0xb')]({'where':{'SmsInteractionId':_0x3c710c['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x5200af){_0x3c710c['setDataValue'](_0x0fb1('0xc'),_0x5200af[_0x0fb1('0xd')]);SmsInteractionEvents[_0x0fb1('0xe')](_0x569333+':'+_0x3c710c['id'],_0x3c710c);SmsInteractionEvents['emit'](_0x569333,_0x3c710c);_0x12634f(null);})['catch'](_0x12634f(null));};}for(var e in events){if(events[_0x0fb1('0xf')](e)){var event=events[e];SmsInteraction[_0x0fb1('0x10')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 4b8ca69..ba89c06 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 _0x66dd=['define','sms_interactions','changed','closedAt','format','../../config/logger','bluebird','request-promise','path','../../config/environment'];(function(_0x50fd4d,_0x3741d8){var _0x4ef920=function(_0x405c52){while(--_0x405c52){_0x50fd4d['push'](_0x50fd4d['shift']());}};_0x4ef920(++_0x3741d8);}(_0x66dd,0x181));var _0xd66d=function(_0x1aab2e,_0x2f60b8){_0x1aab2e=_0x1aab2e-0x0;var _0x5e9478=_0x66dd[_0x1aab2e];return _0x5e9478;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd66d('0x0'))('api');var moment=require('moment');var BPromise=require(_0xd66d('0x1'));var rp=require(_0xd66d('0x2'));var fs=require('fs');var path=require(_0xd66d('0x3'));var rimraf=require('rimraf');var config=require(_0xd66d('0x4'));var attributes=require('./smsInteraction.attributes');module['exports']=function(_0x1387bf,_0x4402b6){return _0x1387bf[_0xd66d('0x5')]('SmsInteraction',attributes,{'tableName':_0xd66d('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1e8ef4,_0x50c8db,_0x1950f8){if(_0x1e8ef4[_0xd66d('0x7')]('closed')){_0x1e8ef4[_0xd66d('0x8')]=moment()[_0xd66d('0x9')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1950f8(null,_0x1e8ef4);}}});}; \ No newline at end of file +var _0x2edc=['closed','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x2edc,0x1d5));var _0xc2ed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2edc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc2ed('0x0'));var util=require('util');var logger=require(_0xc2ed('0x1'))(_0xc2ed('0x2'));var moment=require(_0xc2ed('0x3'));var BPromise=require('bluebird');var rp=require(_0xc2ed('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc2ed('0x5'));var config=require(_0xc2ed('0x6'));var attributes=require(_0xc2ed('0x7'));module[_0xc2ed('0x8')]=function(_0x182b28,_0x6e904f){return _0x182b28[_0xc2ed('0x9')](_0xc2ed('0xa'),attributes,{'tableName':_0xc2ed('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x194752,_0x57bf82,_0x58fcd6){if(_0x194752['changed'](_0xc2ed('0xc'))){_0x194752['closedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x58fcd6(null,_0x194752);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 948778e..7336ad7 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 _0x3b61=['AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','UpdateSmsInteraction','update','body','options','raw','where','attributes','limit','debug','stringify','AddTagsToSmsInteraction','SmsInteraction','addTags'];(function(_0x19aee6,_0xcb2918){var _0x511975=function(_0x4fbb42){while(--_0x4fbb42){_0x19aee6['push'](_0x19aee6['shift']());}};_0x511975(++_0xcb2918);}(_0x3b61,0x127));var _0x13b6=function(_0x497f02,_0x4bb9e8){_0x497f02=_0x497f02-0x0;var _0x685c1c=_0x3b61[_0x497f02];return _0x685c1c;};'use strict';var _=require(_0x13b6('0x0'));var util=require(_0x13b6('0x1'));var moment=require(_0x13b6('0x2'));var BPromise=require('bluebird');var rs=require(_0x13b6('0x3'));var fs=require('fs');var Redis=require(_0x13b6('0x4'));var db=require(_0x13b6('0x5'))['db'];var utils=require(_0x13b6('0x6'));var logger=require(_0x13b6('0x7'))(_0x13b6('0x8'));var config=require(_0x13b6('0x9'));var jayson=require(_0x13b6('0xa'));var client=jayson['client'][_0x13b6('0xb')]({'port':0x232a});config[_0x13b6('0xc')]=_['defaults'](config[_0x13b6('0xc')],{'host':_0x13b6('0xd'),'port':0x18eb});var socket=require(_0x13b6('0xe'))(new Redis(config[_0x13b6('0xc')]));require(_0x13b6('0xf'))[_0x13b6('0x10')](socket);function respondWithRpcPromise(_0x490e6a,_0x1ecc84,_0x45e475){return new BPromise(function(_0x5ac70d,_0x5a0047){return client[_0x13b6('0x11')](_0x490e6a,_0x45e475)[_0x13b6('0x12')](function(_0x52221a){logger[_0x13b6('0x13')](_0x13b6('0x14'),_0x1ecc84,'request\x20sent');logger['debug'](_0x13b6('0x15'),_0x1ecc84,_0x13b6('0x16'),JSON['stringify'](_0x52221a));if(_0x52221a[_0x13b6('0x17')]){if(_0x52221a['error'][_0x13b6('0x18')]===0x1f4){logger[_0x13b6('0x17')](_0x13b6('0x14'),_0x1ecc84,_0x52221a[_0x13b6('0x17')][_0x13b6('0x19')]);return _0x5a0047(_0x52221a[_0x13b6('0x17')][_0x13b6('0x19')]);}logger[_0x13b6('0x17')](_0x13b6('0x14'),_0x1ecc84,_0x52221a['error'][_0x13b6('0x19')]);return _0x5ac70d(_0x52221a[_0x13b6('0x17')]['message']);}else{logger[_0x13b6('0x13')](_0x13b6('0x14'),_0x1ecc84,_0x13b6('0x16'));_0x5ac70d(_0x52221a[_0x13b6('0x1a')][_0x13b6('0x19')]);}})[_0x13b6('0x1b')](function(_0x244084){logger[_0x13b6('0x17')](_0x13b6('0x14'),_0x1ecc84,_0x244084);_0x5a0047(_0x244084);});});}exports[_0x13b6('0x1c')]=function(_0x5e38bf){var _0x5c5a1c=this;return new Promise(function(_0x5915ce,_0x510bca){return db['SmsInteraction'][_0x13b6('0x1d')](_0x5e38bf[_0x13b6('0x1e')],{'raw':_0x5e38bf[_0x13b6('0x1f')]?_0x5e38bf[_0x13b6('0x1f')][_0x13b6('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e38bf['options']?_0x5e38bf['options'][_0x13b6('0x21')]||null:null,'attributes':_0x5e38bf['options']?_0x5e38bf[_0x13b6('0x1f')][_0x13b6('0x22')]||null:null,'limit':_0x5e38bf[_0x13b6('0x1f')]?_0x5e38bf['options'][_0x13b6('0x23')]||null:null})[_0x13b6('0x12')](function(_0x3f60a6){logger[_0x13b6('0x13')]('UpdateSmsInteraction',_0x5e38bf);logger[_0x13b6('0x24')](_0x13b6('0x1c'),_0x5e38bf,JSON[_0x13b6('0x25')](_0x3f60a6));_0x5915ce(_0x3f60a6);})[_0x13b6('0x1b')](function(_0x10c4a7){logger[_0x13b6('0x17')](_0x13b6('0x1c'),_0x10c4a7[_0x13b6('0x19')],_0x5e38bf);_0x510bca(_0x5c5a1c[_0x13b6('0x17')](0x1f4,_0x10c4a7[_0x13b6('0x19')]));});});};exports[_0x13b6('0x26')]=function(_0x3a8e91){return new Promise(function(_0x574edb,_0x9a0926){return db[_0x13b6('0x27')]['find']({'where':_0x3a8e91[_0x13b6('0x1f')]?_0x3a8e91[_0x13b6('0x1f')]['where']||null:null})['then'](function(_0x13ee36){if(_0x13ee36){return _0x13ee36[_0x13b6('0x28')](_0x3a8e91[_0x13b6('0x1e')]['ids'],_['omit'](_0x3a8e91[_0x13b6('0x1e')],['ids','id'])||{});}})['spread'](function(_0x236aa9){logger['info'](_0x13b6('0x29'),_0x3a8e91);logger[_0x13b6('0x24')](_0x13b6('0x29'),_0x3a8e91,JSON[_0x13b6('0x25')](_0x236aa9));_0x574edb(_0x236aa9);})[_0x13b6('0x1b')](function(_0x2ad745){logger[_0x13b6('0x17')]('AddTags',_0x2ad745[_0x13b6('0x19')],_0x3a8e91);_0x9a0926(_this[_0x13b6('0x17')](0x1f4,_0x2ad745[_0x13b6('0x19')]));});});}; \ No newline at end of file +var _0x28a0=['where','limit','UpdateSmsInteraction','find','addTags','body','ids','spread','AddTags','lodash','moment','bluebird','ioredis','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./smsInteraction.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','SmsInteraction,\x20%s,\x20%s','message','result','catch','SmsInteraction','update','options','raw'];(function(_0x314103,_0xde7727){var _0x53729b=function(_0x57b20b){while(--_0x57b20b){_0x314103['push'](_0x314103['shift']());}};_0x53729b(++_0xde7727);}(_0x28a0,0xf3));var _0x028a=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x28a0[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x028a('0x0'));var util=require('util');var moment=require(_0x028a('0x1'));var BPromise=require(_0x028a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x028a('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x028a('0x4'));var config=require(_0x028a('0x5'));var jayson=require(_0x028a('0x6'));var client=jayson[_0x028a('0x7')][_0x028a('0x8')]({'port':0x232a});config['redis']=_[_0x028a('0x9')](config[_0x028a('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x028a('0xb'))(new Redis(config['redis']));require(_0x028a('0xc'))[_0x028a('0xd')](socket);function respondWithRpcPromise(_0x54af31,_0x42af30,_0x4bc910){return new BPromise(function(_0x418530,_0x5551f4){return client[_0x028a('0xe')](_0x54af31,_0x4bc910)[_0x028a('0xf')](function(_0x113122){logger[_0x028a('0x10')]('SmsInteraction,\x20%s,\x20%s',_0x42af30,_0x028a('0x11'));logger[_0x028a('0x12')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x42af30,_0x028a('0x11'),JSON[_0x028a('0x13')](_0x113122));if(_0x113122[_0x028a('0x14')]){if(_0x113122[_0x028a('0x14')][_0x028a('0x15')]===0x1f4){logger[_0x028a('0x14')](_0x028a('0x16'),_0x42af30,_0x113122[_0x028a('0x14')]['message']);return _0x5551f4(_0x113122[_0x028a('0x14')][_0x028a('0x17')]);}logger['error']('SmsInteraction,\x20%s,\x20%s',_0x42af30,_0x113122['error'][_0x028a('0x17')]);return _0x418530(_0x113122[_0x028a('0x14')][_0x028a('0x17')]);}else{logger['info']('SmsInteraction,\x20%s,\x20%s',_0x42af30,_0x028a('0x11'));_0x418530(_0x113122[_0x028a('0x18')][_0x028a('0x17')]);}})[_0x028a('0x19')](function(_0x1761e){logger[_0x028a('0x14')](_0x028a('0x16'),_0x42af30,_0x1761e);_0x5551f4(_0x1761e);});});}exports['UpdateSmsInteraction']=function(_0x47c4aa){var _0x5de3c2=this;return new Promise(function(_0x125fe9,_0x1e5339){return db[_0x028a('0x1a')][_0x028a('0x1b')](_0x47c4aa['body'],{'raw':_0x47c4aa[_0x028a('0x1c')]?_0x47c4aa[_0x028a('0x1c')][_0x028a('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47c4aa[_0x028a('0x1c')]?_0x47c4aa[_0x028a('0x1c')][_0x028a('0x1e')]||null:null,'attributes':_0x47c4aa[_0x028a('0x1c')]?_0x47c4aa['options']['attributes']||null:null,'limit':_0x47c4aa[_0x028a('0x1c')]?_0x47c4aa[_0x028a('0x1c')][_0x028a('0x1f')]||null:null})[_0x028a('0xf')](function(_0x1668f7){logger[_0x028a('0x10')](_0x028a('0x20'),_0x47c4aa);logger[_0x028a('0x12')](_0x028a('0x20'),_0x47c4aa,JSON[_0x028a('0x13')](_0x1668f7));_0x125fe9(_0x1668f7);})[_0x028a('0x19')](function(_0x2d25e5){logger[_0x028a('0x14')]('UpdateSmsInteraction',_0x2d25e5[_0x028a('0x17')],_0x47c4aa);_0x1e5339(_0x5de3c2[_0x028a('0x14')](0x1f4,_0x2d25e5[_0x028a('0x17')]));});});};exports['AddTagsToSmsInteraction']=function(_0x43c1ce){return new Promise(function(_0x32d1fe,_0x516de8){return db[_0x028a('0x1a')][_0x028a('0x21')]({'where':_0x43c1ce[_0x028a('0x1c')]?_0x43c1ce[_0x028a('0x1c')][_0x028a('0x1e')]||null:null})[_0x028a('0xf')](function(_0x5d88c5){if(_0x5d88c5){return _0x5d88c5[_0x028a('0x22')](_0x43c1ce[_0x028a('0x23')][_0x028a('0x24')],_['omit'](_0x43c1ce[_0x028a('0x23')],[_0x028a('0x24'),'id'])||{});}})[_0x028a('0x25')](function(_0x6b1a7e){logger[_0x028a('0x10')](_0x028a('0x26'),_0x43c1ce);logger[_0x028a('0x12')]('AddTags',_0x43c1ce,JSON[_0x028a('0x13')](_0x6b1a7e));_0x32d1fe(_0x6b1a7e);})[_0x028a('0x19')](function(_0x3ccbc5){logger[_0x028a('0x14')]('AddTags',_0x3ccbc5[_0x028a('0x17')],_0x43c1ce);_0x516de8(_this[_0x028a('0x14')](0x1f4,_0x3ccbc5[_0x028a('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 125a449..09cf8b0 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 _0x5c27=['emit','removeListener','register','smsInteraction:','./smsInteraction.events','save','remove','update'];(function(_0x580b13,_0x256587){var _0xdc0422=function(_0x407515){while(--_0x407515){_0x580b13['push'](_0x580b13['shift']());}};_0xdc0422(++_0x256587);}(_0x5c27,0x13c));var _0x75c2=function(_0x5e8282,_0x1f2962){_0x5e8282=_0x5e8282-0x0;var _0x5cd37d=_0x5c27[_0x5e8282];return _0x5cd37d;};'use strict';var SmsInteractionEvents=require(_0x75c2('0x0'));var events=[_0x75c2('0x1'),_0x75c2('0x2'),_0x75c2('0x3')];function createListener(_0xa0114a,_0x9df0d6){return function(_0x5081f6){_0x9df0d6[_0x75c2('0x4')](_0xa0114a,_0x5081f6);};}function removeListener(_0x314b76,_0xd9bddb){return function(){SmsInteractionEvents[_0x75c2('0x5')](_0x314b76,_0xd9bddb);};}exports[_0x75c2('0x6')]=function(_0x16ceca){for(var _0x39fa83=0x0,_0xcbd1c7=events['length'];_0x39fa83<_0xcbd1c7;_0x39fa83++){var _0x32e485=events[_0x39fa83];var _0x41414b=createListener(_0x75c2('0x7')+_0x32e485,_0x16ceca);SmsInteractionEvents['on'](_0x32e485,_0x41414b);}}; \ No newline at end of file +var _0xe6f1=['smsInteraction:','./smsInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0xe9dc99,_0x48ab3d){var _0x420df5=function(_0x168509){while(--_0x168509){_0xe9dc99['push'](_0xe9dc99['shift']());}};_0x420df5(++_0x48ab3d);}(_0xe6f1,0xf1));var _0x1e6f=function(_0x2e937e,_0x925b29){_0x2e937e=_0x2e937e-0x0;var _0xb9cb1b=_0xe6f1[_0x2e937e];return _0xb9cb1b;};'use strict';var SmsInteractionEvents=require(_0x1e6f('0x0'));var events=[_0x1e6f('0x1'),_0x1e6f('0x2'),_0x1e6f('0x3')];function createListener(_0x2f0cf2,_0x54c344){return function(_0x2f4e9e){_0x54c344[_0x1e6f('0x4')](_0x2f0cf2,_0x2f4e9e);};}function removeListener(_0x7e5afd,_0x2624d0){return function(){SmsInteractionEvents[_0x1e6f('0x5')](_0x7e5afd,_0x2624d0);};}exports[_0x1e6f('0x6')]=function(_0x50b25f){for(var _0x3c938f=0x0,_0x4aed91=events['length'];_0x3c938f<_0x4aed91;_0x3c938f++){var _0x568fcf=events[_0x3c938f];var _0x14600f=createListener(_0x1e6f('0x7')+_0x568fcf,_0x50b25f);SmsInteractionEvents['on'](_0x568fcf,_0x14600f);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index ff45a60..99a3d61 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 _0x74b1=['accept','/:id/reject','reject','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','describe','post','sms','smsmessage:create','create','/:id/status','status','put','/:id','/:id/accept'];(function(_0x2c674c,_0x59e732){var _0x7ac0ee=function(_0x117fd3){while(--_0x117fd3){_0x2c674c['push'](_0x2c674c['shift']());}};_0x7ac0ee(++_0x59e732);}(_0x74b1,0xb5));var _0x174b=function(_0x2b9e8a,_0x7b21d4){_0x2b9e8a=_0x2b9e8a-0x0;var _0x520e67=_0x74b1[_0x2b9e8a];return _0x520e67;};'use strict';var multer=require(_0x174b('0x0'));var util=require(_0x174b('0x1'));var path=require('path');var timeout=require(_0x174b('0x2'));var express=require(_0x174b('0x3'));var router=express['Router']();var auth=require(_0x174b('0x4'));var interaction=require(_0x174b('0x5'));var config=require('../../config/environment');var controller=require('./smsMessage.controller');router['get']('/',auth[_0x174b('0x6')](),controller[_0x174b('0x7')]);router[_0x174b('0x8')]('/describe',auth[_0x174b('0x6')](),controller[_0x174b('0x9')]);router['get']('/:id',auth[_0x174b('0x6')](),controller['show']);router[_0x174b('0xa')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x174b('0xb'),_0x174b('0xc')),controller[_0x174b('0xd')]);router[_0x174b('0xa')](_0x174b('0xe'),controller[_0x174b('0xf')]);router[_0x174b('0x10')](_0x174b('0x11'),auth[_0x174b('0x6')](),controller['update']);router[_0x174b('0x10')](_0x174b('0x12'),auth[_0x174b('0x6')](),controller[_0x174b('0x13')]);router[_0x174b('0x10')](_0x174b('0x14'),auth[_0x174b('0x6')](),controller[_0x174b('0x15')]);router[_0x174b('0x16')]('/:id',auth[_0x174b('0x6')](),controller[_0x174b('0x17')]);module[_0x174b('0x18')]=router; \ No newline at end of file +var _0xe24a=['../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','tracked','smsmessage:create','create','status','put','update','/:id/accept','/:id/reject','reject','delete','exports','util','path','connect-timeout','express','Router'];(function(_0x3dbdeb,_0x2a42b7){var _0xfc7132=function(_0x286868){while(--_0x286868){_0x3dbdeb['push'](_0x3dbdeb['shift']());}};_0xfc7132(++_0x2a42b7);}(_0xe24a,0x87));var _0xae24=function(_0x22ca30,_0x4f09f0){_0x22ca30=_0x22ca30-0x0;var _0x5e3aee=_0xe24a[_0x22ca30];return _0x5e3aee;};'use strict';var multer=require('multer');var util=require(_0xae24('0x0'));var path=require(_0xae24('0x1'));var timeout=require(_0xae24('0x2'));var express=require(_0xae24('0x3'));var router=express[_0xae24('0x4')]();var auth=require(_0xae24('0x5'));var interaction=require(_0xae24('0x6'));var config=require(_0xae24('0x7'));var controller=require(_0xae24('0x8'));router[_0xae24('0x9')]('/',auth['isAuthenticated'](),controller[_0xae24('0xa')]);router[_0xae24('0x9')](_0xae24('0xb'),auth[_0xae24('0xc')](),controller[_0xae24('0xd')]);router[_0xae24('0x9')](_0xae24('0xe'),auth['isAuthenticated'](),controller[_0xae24('0xf')]);router[_0xae24('0x10')]('/',auth[_0xae24('0xc')](),interaction[_0xae24('0x11')]('sms',_0xae24('0x12')),controller[_0xae24('0x13')]);router[_0xae24('0x10')]('/:id/status',controller[_0xae24('0x14')]);router[_0xae24('0x15')](_0xae24('0xe'),auth[_0xae24('0xc')](),controller[_0xae24('0x16')]);router['put'](_0xae24('0x17'),auth[_0xae24('0xc')](),controller['accept']);router['put'](_0xae24('0x18'),auth[_0xae24('0xc')](),controller[_0xae24('0x19')]);router[_0xae24('0x1a')](_0xae24('0xe'),auth[_0xae24('0xc')](),controller['destroy']);module[_0xae24('0x1b')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 2a39d10..98f00a7 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 _0x3248=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x684f8d,_0x35f431){var _0x1487d4=function(_0x342f8f){while(--_0x342f8f){_0x684f8d['push'](_0x684f8d['shift']());}};_0x1487d4(++_0x35f431);}(_0x3248,0x1b0));var _0x8324=function(_0x22a3ce,_0x1ce7cb){_0x22a3ce=_0x22a3ce-0x0;var _0x35886c=_0x3248[_0x22a3ce];return _0x35886c;};'use strict';var Sequelize=require(_0x8324('0x0'));module[_0x8324('0x1')]={'body':{'type':Sequelize[_0x8324('0x2')](_0x8324('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x8324('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8324('0x5')]('in',_0x8324('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x8324('0x7')]},'readAt':{'type':Sequelize[_0x8324('0x8')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x0dee=['STRING','DATE','sequelize','exports','medium','ENUM','out'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x0dee,0xf7));var _0xe0de=function(_0x13105c,_0x909442){_0x13105c=_0x13105c-0x0;var _0xee9889=_0x0dee[_0x13105c];return _0xee9889;};'use strict';var Sequelize=require(_0xe0de('0x0'));module[_0xe0de('0x1')]={'body':{'type':Sequelize['TEXT'](_0xe0de('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xe0de('0x3')]('in',_0xe0de('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xe0de('0x5')](0xbe)},'phone':{'type':Sequelize[_0xe0de('0x5')]},'readAt':{'type':Sequelize[_0xe0de('0x6')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index afd8e72..028e447 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 _0xc0ef=['null','AcceptMessage','interface','SIP/%s','channel','accept','acceptmessage','agent','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','event','EventManager','SmsAccount','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsMessage.socket','jayson/promise','http','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','name','send','SmsMessage','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filters','pick','filter','where','map','type','key','VIRTUAL','field','merge','options','includeAll','include','rows','show','create','body','find','params','describe','sms-interactions','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','SmsInteraction','isNil','read1stAt','interaction','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc0ef,0xac));var _0xfc0e=function(_0x1e1c3a,_0x57a7aa){_0x1e1c3a=_0x1e1c3a-0x0;var _0x461dc6=_0xc0ef[_0x1e1c3a];return _0x461dc6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfc0e('0x0'));var rimraf=require(_0xfc0e('0x1'));var zipdir=require(_0xfc0e('0x2'));var jsonpatch=require(_0xfc0e('0x3'));var rp=require(_0xfc0e('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfc0e('0x5'));var util=require(_0xfc0e('0x6'));var path=require(_0xfc0e('0x7'));var sox=require(_0xfc0e('0x8'));var csv=require(_0xfc0e('0x9'));var ejs=require(_0xfc0e('0xa'));var fs=require('fs');var _=require(_0xfc0e('0xb'));var squel=require(_0xfc0e('0xc'));var crypto=require(_0xfc0e('0xd'));var jsforce=require(_0xfc0e('0xe'));var deskjs=require(_0xfc0e('0xf'));var toCsv=require(_0xfc0e('0x9'));var querystring=require(_0xfc0e('0x10'));var Papa=require(_0xfc0e('0x11'));var Redis=require('ioredis');var authService=require(_0xfc0e('0x12'));var qs=require(_0xfc0e('0x13'));var hardwareService=require(_0xfc0e('0x14'));var logger=require(_0xfc0e('0x15'))(_0xfc0e('0x16'));var utils=require(_0xfc0e('0x17'));var config=require(_0xfc0e('0x18'));var db=require(_0xfc0e('0x19'))['db'];config[_0xfc0e('0x1a')]=_[_0xfc0e('0x1b')](config['redis'],{'host':_0xfc0e('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfc0e('0x1a')]));require(_0xfc0e('0x1d'))['register'](socket);var jayson=require(_0xfc0e('0x1e'));var client=jayson['client'][_0xfc0e('0x1f')]({'port':0x232c});var client9002=jayson[_0xfc0e('0x20')][_0xfc0e('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x20cea3,_0x1a7a93,_0x489d72){if(_0x489d72){var _0x5eeffa=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5eeffa[_0xfc0e('0x21')](_0x1a7a93)){return _0x20cea3;}else{throw new Error(_0xfc0e('0x22'));}}else{return _0x20cea3;}}function respondWithRpcPromise(_0x1750ec,_0x42bc48,_0x1ecddc,_0xb22dbc){return new BPromise(function(_0x5a1165,_0x415c7b){var _0x1f6193=_0xb22dbc||client;return _0x1f6193[_0xfc0e('0x23')](_0x1750ec,_0x1ecddc)[_0xfc0e('0x24')](function(_0xd429a9){logger['info'](_0xfc0e('0x25'),_0x42bc48,_0xfc0e('0x26'));logger[_0xfc0e('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x42bc48,'request\x20sent',JSON[_0xfc0e('0x28')](_0xd429a9));if(_0xd429a9['error']){if(_0xd429a9[_0xfc0e('0x29')][_0xfc0e('0x2a')]===0x1f4){logger['error'](_0xfc0e('0x25'),_0x42bc48,_0xd429a9[_0xfc0e('0x29')]['message']);return _0x415c7b(_0xd429a9[_0xfc0e('0x29')][_0xfc0e('0x2b')]);}logger[_0xfc0e('0x29')](_0xfc0e('0x25'),_0x42bc48,_0xd429a9[_0xfc0e('0x29')][_0xfc0e('0x2b')]);return _0x5a1165(_0xd429a9[_0xfc0e('0x29')][_0xfc0e('0x2b')]);}else{logger[_0xfc0e('0x2c')]('SmsMessage,\x20%s,\x20%s',_0x42bc48,_0xfc0e('0x26'));_0x5a1165(_0xd429a9['result']['message']);}})[_0xfc0e('0x2d')](function(_0xa1b8f8){logger[_0xfc0e('0x29')](_0xfc0e('0x25'),_0x42bc48,_0xa1b8f8);_0x415c7b(_0xa1b8f8);});});}function respondWithStatusCode(_0x5d5844,_0x535a27){_0x535a27=_0x535a27||0xcc;return function(_0x5f2001){if(_0x5f2001){return _0x5d5844[_0xfc0e('0x2e')](_0x535a27);}return _0x5d5844[_0xfc0e('0x2f')](_0x535a27)[_0xfc0e('0x30')]();};}function respondWithResult(_0x35cab5,_0x2f7ade){_0x2f7ade=_0x2f7ade||0xc8;return function(_0xcd644c){if(_0xcd644c){return _0x35cab5[_0xfc0e('0x2f')](_0x2f7ade)[_0xfc0e('0x31')](_0xcd644c);}};}function respondWithFilteredResult(_0x328944,_0x2a2480){return function(_0x9aabc2){if(_0x9aabc2){var _0x520fcd=_0x9aabc2[_0xfc0e('0x32')],_0x3c0c16=_0x2a2480[_0xfc0e('0x33')],_0x4b66c3=_0x2a2480['offset']+_0x2a2480[_0xfc0e('0x34')],_0x486db7;if(_0x4b66c3>=_0x520fcd){_0x4b66c3=_0x520fcd;_0x486db7=0xc8;}else{_0x486db7=0xce;}_0x328944[_0xfc0e('0x2f')](_0x486db7);return _0x328944[_0xfc0e('0x35')](_0xfc0e('0x36'),_0x3c0c16+'-'+_0x4b66c3+'/'+_0x520fcd)['json'](_0x9aabc2);}return null;};}function patchUpdates(_0x350936){return function(_0x51cb73){try{jsonpatch[_0xfc0e('0x37')](_0x51cb73,_0x350936,!![]);}catch(_0x5c5567){return BPromise[_0xfc0e('0x38')](_0x5c5567);}return _0x51cb73['save']();};}function saveUpdates(_0x3114bc,_0x1b69f1){return function(_0x37e8e4){if(_0x37e8e4){return _0x37e8e4[_0xfc0e('0x39')](_0x3114bc)['then'](function(_0x189beb){return _0x189beb;});}return null;};}function removeEntity(_0x420dc8,_0x1e7a31){return function(_0x1256cd){if(_0x1256cd){return _0x1256cd[_0xfc0e('0x3a')]()[_0xfc0e('0x24')](function(){_0x420dc8[_0xfc0e('0x2f')](0xcc)[_0xfc0e('0x30')]();});}};}function handleEntityNotFound(_0x34b18c,_0xc5713){return function(_0x1dfc76){if(!_0x1dfc76){_0x34b18c[_0xfc0e('0x2e')](0x194);}return _0x1dfc76;};}function handleError(_0x3bec85,_0x3dbd24){_0x3dbd24=_0x3dbd24||0x1f4;return function(_0x365674){logger[_0xfc0e('0x29')](_0x365674['stack']);if(_0x365674[_0xfc0e('0x3b')]){delete _0x365674[_0xfc0e('0x3b')];}_0x3bec85['status'](_0x3dbd24)[_0xfc0e('0x3c')](_0x365674);};}exports['index']=function(_0x39aa66,_0x411e00){var _0x29e8e6={},_0x5c7533={},_0x145bf3={'count':0x0,'rows':[]};var _0x30dce4=db[_0xfc0e('0x3d')][_0xfc0e('0x3e')];_0x5c7533[_0xfc0e('0x3f')]=_[_0xfc0e('0x40')](_0x30dce4);_0x5c7533['query']=_[_0xfc0e('0x40')](_0x39aa66[_0xfc0e('0x41')]);_0x5c7533['filters']=_[_0xfc0e('0x42')](_0x5c7533[_0xfc0e('0x3f')],_0x5c7533['query']);_0x29e8e6[_0xfc0e('0x43')]=_[_0xfc0e('0x42')](_0x5c7533[_0xfc0e('0x3f')],qs[_0xfc0e('0x44')](_0x39aa66[_0xfc0e('0x41')][_0xfc0e('0x44')]));_0x29e8e6[_0xfc0e('0x43')]=_0x29e8e6[_0xfc0e('0x43')]['length']?_0x29e8e6[_0xfc0e('0x43')]:_0x5c7533[_0xfc0e('0x3f')];if(!_0x39aa66['query'][_0xfc0e('0x45')](_0xfc0e('0x46'))){_0x29e8e6[_0xfc0e('0x34')]=qs[_0xfc0e('0x34')](_0x39aa66[_0xfc0e('0x41')][_0xfc0e('0x34')]);_0x29e8e6[_0xfc0e('0x33')]=qs['offset'](_0x39aa66['query']['offset']);}_0x29e8e6['order']=qs[_0xfc0e('0x47')](_0x39aa66[_0xfc0e('0x41')][_0xfc0e('0x47')]);_0x29e8e6['where']=qs[_0xfc0e('0x48')](_[_0xfc0e('0x49')](_0x39aa66[_0xfc0e('0x41')],_0x5c7533[_0xfc0e('0x48')]));if(_0x39aa66[_0xfc0e('0x41')][_0xfc0e('0x4a')]){_0x29e8e6[_0xfc0e('0x4b')]=_['merge'](_0x29e8e6['where'],{'$or':_[_0xfc0e('0x4c')](_0x30dce4,function(_0x269006){if(_0x269006[_0xfc0e('0x4d')][_0xfc0e('0x4e')]!==_0xfc0e('0x4f')){var _0x110e1e={};_0x110e1e[_0x269006[_0xfc0e('0x50')]]={'$like':'%'+_0x39aa66[_0xfc0e('0x41')][_0xfc0e('0x4a')]+'%'};return _0x110e1e;}})});}_0x29e8e6=_[_0xfc0e('0x51')]({},_0x29e8e6,_0x39aa66[_0xfc0e('0x52')]);var _0x46392d={'where':_0x29e8e6['where']};return db[_0xfc0e('0x3d')][_0xfc0e('0x32')](_0x46392d)['then'](function(_0x4fd83c){_0x145bf3[_0xfc0e('0x32')]=_0x4fd83c;if(_0x39aa66['query'][_0xfc0e('0x53')]){_0x29e8e6[_0xfc0e('0x54')]=[{'all':!![]}];}return db[_0xfc0e('0x3d')]['findAll'](_0x29e8e6);})[_0xfc0e('0x24')](function(_0x3b8a82){_0x145bf3[_0xfc0e('0x55')]=_0x3b8a82;return _0x145bf3;})['then'](respondWithFilteredResult(_0x411e00,_0x29e8e6))[_0xfc0e('0x2d')](handleError(_0x411e00,null));};exports[_0xfc0e('0x56')]=function(_0x2121da,_0xde4462){var _0x4e3b80={'raw':!![],'where':{'id':_0x2121da['params']['id']}},_0x5f6ab6={};_0x5f6ab6[_0xfc0e('0x3f')]=_[_0xfc0e('0x40')](db['SmsMessage'][_0xfc0e('0x3e')]);_0x5f6ab6[_0xfc0e('0x41')]=_[_0xfc0e('0x40')](_0x2121da['query']);_0x5f6ab6['filters']=_[_0xfc0e('0x42')](_0x5f6ab6[_0xfc0e('0x3f')],_0x5f6ab6[_0xfc0e('0x41')]);_0x4e3b80[_0xfc0e('0x43')]=_[_0xfc0e('0x42')](_0x5f6ab6[_0xfc0e('0x3f')],qs['fields'](_0x2121da[_0xfc0e('0x41')][_0xfc0e('0x44')]));_0x4e3b80[_0xfc0e('0x43')]=_0x4e3b80[_0xfc0e('0x43')]['length']?_0x4e3b80[_0xfc0e('0x43')]:_0x5f6ab6['model'];if(_0x2121da[_0xfc0e('0x41')]['includeAll']){_0x4e3b80['include']=[{'all':!![]}];}_0x4e3b80=_['merge']({},_0x4e3b80,_0x2121da[_0xfc0e('0x52')]);return db['SmsMessage']['find'](_0x4e3b80)[_0xfc0e('0x24')](handleEntityNotFound(_0xde4462,null))[_0xfc0e('0x24')](respondWithResult(_0xde4462,null))[_0xfc0e('0x2d')](handleError(_0xde4462,null));};exports[_0xfc0e('0x57')]=function(_0x35aa83,_0x3ac255){return db[_0xfc0e('0x3d')]['create'](_0x35aa83[_0xfc0e('0x58')],{})['then'](respondWithResult(_0x3ac255,0xc9))['catch'](handleError(_0x3ac255,null));};exports[_0xfc0e('0x39')]=function(_0x1377f9,_0x1a82ea){if(_0x1377f9[_0xfc0e('0x58')]['id']){delete _0x1377f9[_0xfc0e('0x58')]['id'];}return db[_0xfc0e('0x3d')]['find']({'where':{'id':_0x1377f9['params']['id']}})[_0xfc0e('0x24')](handleEntityNotFound(_0x1a82ea,null))[_0xfc0e('0x24')](saveUpdates(_0x1377f9[_0xfc0e('0x58')],null))['then'](respondWithResult(_0x1a82ea,null))['catch'](handleError(_0x1a82ea,null));};exports[_0xfc0e('0x3a')]=function(_0x33a900,_0x548602){return db[_0xfc0e('0x3d')][_0xfc0e('0x59')]({'where':{'id':_0x33a900[_0xfc0e('0x5a')]['id']}})[_0xfc0e('0x24')](handleEntityNotFound(_0x548602,null))['then'](removeEntity(_0x548602,null))[_0xfc0e('0x2d')](handleError(_0x548602,null));};exports['describe']=function(_0x257983,_0x2b744){return db['SmsMessage'][_0xfc0e('0x5b')]()['then'](respondWithResult(_0x2b744,null))[_0xfc0e('0x2d')](handleError(_0x2b744,null));};var interaction_log=require(_0xfc0e('0x15'))(_0xfc0e('0x5c'));exports['accept']=function(_0x3040b1,_0x48e38f,_0x460cc7){var _0x1ddafa={'channel':_0xfc0e('0x5d')};if(_0x3040b1[_0xfc0e('0x58')]['id']){delete _0x3040b1[_0xfc0e('0x58')]['id'];}_0x3040b1[_0xfc0e('0x58')][_0xfc0e('0x5e')]=!![];_0x3040b1[_0xfc0e('0x58')][_0xfc0e('0x5f')]=moment()[_0xfc0e('0x60')](_0xfc0e('0x61'));_0x3040b1[_0xfc0e('0x58')][_0xfc0e('0x62')]=_0x3040b1[_0xfc0e('0x58')]['UserId']||_0x3040b1[_0xfc0e('0x63')]['id'];return db[_0xfc0e('0x3d')]['find']({'where':{'id':_0x3040b1[_0xfc0e('0x5a')]['id'],'UserId':null},'include':[{'model':db[_0xfc0e('0x64')],'as':'Contact'}]})[_0xfc0e('0x24')](handleEntityNotFound(_0x48e38f,null))[_0xfc0e('0x24')](saveUpdates(_0x3040b1['body'],null))[_0xfc0e('0x24')](function(_0x252c33){if(_0x252c33){_0x1ddafa[_0xfc0e('0x2b')]=_0x252c33['get']({'plain':!![]});return db[_0xfc0e('0x65')][_0xfc0e('0x59')]({'where':{'id':_0x252c33['SmsInteractionId']}});}return null;})[_0xfc0e('0x24')](handleEntityNotFound(_0x48e38f,null))[_0xfc0e('0x24')](function(_0x50bd9c){if(_0x50bd9c){return _0x50bd9c['update']({'UserId':_0x3040b1['body'][_0xfc0e('0x62')],'read1stAt':_[_0xfc0e('0x66')](_0x50bd9c[_0xfc0e('0x67')])?moment()[_0xfc0e('0x60')](_0xfc0e('0x61')):undefined});}return null;})[_0xfc0e('0x24')](function(_0x48e793){if(_0x48e793){_0x1ddafa[_0xfc0e('0x68')]=_0x48e793[_0xfc0e('0x69')]({'plain':!![]});interaction_log[_0xfc0e('0x2c')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3040b1[_0xfc0e('0x63')]['id'],_0x3040b1[_0xfc0e('0x63')][_0xfc0e('0x3b')],_0x3040b1['user']['role'],_0x1ddafa[_0xfc0e('0x68')]['id'],_0x3040b1[_0xfc0e('0x58')]?JSON['stringify'](_0x3040b1['body']):_0xfc0e('0x6a'));return respondWithRpcPromise(_0xfc0e('0x6b'),'acceptMessage',_0x1ddafa);}return null;})[_0xfc0e('0x24')](function(_0x4b02fb){if(_0x4b02fb){if(_0x3040b1[_0xfc0e('0x58')]['manual']){_0x1ddafa['message'][_0xfc0e('0x6c')]=util[_0xfc0e('0x60')](_0xfc0e('0x6d'),_0x3040b1[_0xfc0e('0x63')][_0xfc0e('0x3b')]);_0x1ddafa[_0xfc0e('0x2b')][_0xfc0e('0x6e')]=_0x1ddafa[_0xfc0e('0x6e')];_0x1ddafa[_0xfc0e('0x2b')]['event']=_0xfc0e('0x6f');return respondWithRpcPromise('EventManager','EventManager',{'event':_0xfc0e('0x70'),'message':_0x1ddafa[_0xfc0e('0x2b')]},client9002)[_0xfc0e('0x24')](function(){return _0x1ddafa;});}return _0x1ddafa;}return null;})[_0xfc0e('0x24')](respondWithResult(_0x48e38f,null))[_0xfc0e('0x2d')](handleError(_0x48e38f,null));};var interaction_log=require(_0xfc0e('0x15'))('sms-interactions');exports[_0xfc0e('0x38')]=function(_0x24753d,_0x20ead1,_0xf1834c){var _0x194120={'agent':{},'channel':'sms'};if(_0x24753d[_0xfc0e('0x58')]['id']){delete _0x24753d[_0xfc0e('0x58')]['id'];}_0x24753d[_0xfc0e('0x58')][_0xfc0e('0x62')]=_0x24753d['body'][_0xfc0e('0x62')]||_0x24753d[_0xfc0e('0x63')]['id'];_0x194120[_0xfc0e('0x71')]['id']=_0x24753d[_0xfc0e('0x58')]['UserId'];return db[_0xfc0e('0x3d')][_0xfc0e('0x59')]({'where':{'id':_0x24753d['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x20ead1,null))[_0xfc0e('0x24')](function(_0x5c3aaf){if(_0x5c3aaf){_0x194120['message']=_0x5c3aaf['get']({'plain':!![]});return db[_0xfc0e('0x65')]['find']({'where':{'id':_0x5c3aaf['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x20ead1,null))['then'](function(_0x4bfab6){if(_0x4bfab6){_0x194120['interaction']=_0x4bfab6[_0xfc0e('0x69')]({'plain':!![]});interaction_log['info'](_0xfc0e('0x72'),_0x24753d[_0xfc0e('0x63')]['id'],_0x24753d[_0xfc0e('0x63')][_0xfc0e('0x3b')],_0x24753d[_0xfc0e('0x63')][_0xfc0e('0x73')],_0x194120[_0xfc0e('0x68')]['id'],_0x24753d['body']?JSON['stringify'](_0x24753d['body']):_0xfc0e('0x6a'));return respondWithRpcPromise(_0xfc0e('0x74'),_0xfc0e('0x75'),_0x194120);}return null;})[_0xfc0e('0x24')](function(_0x312acf){if(_0x312acf){_0x312acf['message']['interface']=util[_0xfc0e('0x60')](_0xfc0e('0x6d'),_0x24753d['user'][_0xfc0e('0x3b')]);_0x312acf['message']['channel']=_0x194120[_0xfc0e('0x6e')];_0x312acf[_0xfc0e('0x2b')][_0xfc0e('0x76')]='reject';respondWithRpcPromise('EventManager',_0xfc0e('0x77'),{'event':'rejectmessage','message':_0x312acf[_0xfc0e('0x2b')]},client9002);return _0x194120;}return null;})[_0xfc0e('0x24')](respondWithResult(_0x20ead1,null))[_0xfc0e('0x2d')](handleError(_0x20ead1,null));};exports[_0xfc0e('0x2f')]=function(_0x2fa117,_0x6c3112,_0x57f6e4){if(_0x2fa117[_0xfc0e('0x58')]['id']){delete _0x2fa117[_0xfc0e('0x58')]['id'];}var _0x50f15d;return db[_0xfc0e('0x3d')][_0xfc0e('0x59')]({'where':{'id':_0x2fa117[_0xfc0e('0x5a')]['id']}})['then'](handleEntityNotFound(_0x6c3112,null))[_0xfc0e('0x24')](function(_0x4df3a2){if(_0x4df3a2){_0x50f15d=_0x4df3a2;return db[_0xfc0e('0x78')]['find']({'where':{'id':_0x4df3a2['SmsAccountId']}});}})[_0xfc0e('0x24')](handleEntityNotFound(_0x6c3112,null))[_0xfc0e('0x24')](function(_0x1888b4){if(_0x1888b4){logger[_0xfc0e('0x27')](_0xfc0e('0x79'),_0xfc0e('0x2f'),_0xfc0e('0x7a'),_0x1888b4[_0xfc0e('0x4d')],util[_0xfc0e('0x7b')](_0x2fa117[_0xfc0e('0x58')],{'showHidden':![],'depth':null}));switch(_0x1888b4[_0xfc0e('0x4d')]){case _0xfc0e('0x7c'):if(_0x2fa117[_0xfc0e('0x58')]['MessageSid']&&_0x2fa117['body'][_0xfc0e('0x7d')]===_0x50f15d[_0xfc0e('0x7e')]){return _0x50f15d[_0xfc0e('0x39')]({'read':!![]});}else{logger[_0xfc0e('0x29')](_0xfc0e('0x7f'),_0xfc0e('0x2f'),_0xfc0e('0x7c'),util[_0xfc0e('0x7b')](_0x2fa117[_0xfc0e('0x58')],{'showHidden':![],'depth':null}));}break;case _0xfc0e('0x80'):if(_0x2fa117['body'][_0xfc0e('0x81')]&&_0x2fa117[_0xfc0e('0x58')]['MessageUUID']===_0x50f15d[_0xfc0e('0x7e')]&&_[_0xfc0e('0x82')]([_0xfc0e('0x83'),_0xfc0e('0x84')],_0x2fa117['body'][_0xfc0e('0x85')])>=0x0){return _0x50f15d[_0xfc0e('0x39')]({'read':!![]});}else{logger[_0xfc0e('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xfc0e('0x86'),util[_0xfc0e('0x7b')](_0x2fa117[_0xfc0e('0x58')],{'showHidden':![],'depth':null}));}break;case _0xfc0e('0x87'):var _0x2de2f1=_0x2fa117[_0xfc0e('0x58')][_0xfc0e('0x88')][0x0];if(_0x2de2f1[_0xfc0e('0x2f')][_0xfc0e('0x89')]===_0xfc0e('0x8a')){return _0x50f15d[_0xfc0e('0x39')]({'read':!![]});}else{logger[_0xfc0e('0x29')](_0xfc0e('0x7f'),'status','infobip',util[_0xfc0e('0x7b')](_0x2fa117[_0xfc0e('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x50f15d;}})[_0xfc0e('0x24')](respondWithResult(_0x6c3112,null))['catch'](handleError(_0x6c3112,null));}; \ No newline at end of file +var _0x9d52=['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~!@#$%^&-_=+[{]}.','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','SmsMessage','rawAttributes','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','key','field','options','includeAll','findAll','rows','params','length','include','find','body','describe','sms','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','Contact','get','SmsInteractionId','isNil','read1stAt','interaction','role','null','AcceptMessage','acceptMessage','manual','interface','channel','accept','EventManager','acceptmessage','reject','agent','SmsInteraction','RejectMessage','rejectMessage','SIP/%s','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','type','inspect','MessageSid','messageId','twilio','plivo','MessageUUID','sent','delivered','Status','SmsAccount,\x20%s,\x20%s,\x20%s','infobip','results','groupName','DELIVERED','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x9d52,0xfa));var _0x29d5=function(_0x1406c8,_0x40a801){_0x1406c8=_0x1406c8-0x0;var _0x3ec6f8=_0x9d52[_0x1406c8];return _0x3ec6f8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x29d5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x29d5('0x1'));var jsonpatch=require(_0x29d5('0x2'));var rp=require(_0x29d5('0x3'));var moment=require(_0x29d5('0x4'));var BPromise=require(_0x29d5('0x5'));var Mustache=require(_0x29d5('0x6'));var util=require(_0x29d5('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x29d5('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x29d5('0x9'));var jsforce=require(_0x29d5('0xa'));var deskjs=require(_0x29d5('0xb'));var toCsv=require('to-csv');var querystring=require(_0x29d5('0xc'));var Papa=require(_0x29d5('0xd'));var Redis=require(_0x29d5('0xe'));var authService=require(_0x29d5('0xf'));var qs=require(_0x29d5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x29d5('0x11'))(_0x29d5('0x12'));var utils=require(_0x29d5('0x13'));var config=require(_0x29d5('0x14'));var db=require(_0x29d5('0x15'))['db'];config[_0x29d5('0x16')]=_[_0x29d5('0x17')](config['redis'],{'host':_0x29d5('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x29d5('0x16')]));require('./smsMessage.socket')[_0x29d5('0x19')](socket);var jayson=require(_0x29d5('0x1a'));var client=jayson[_0x29d5('0x1b')][_0x29d5('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x29d5('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x2ecd8a,_0x3b9503,_0x428720){if(_0x428720){var _0x543f07=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x543f07[_0x29d5('0x1d')](_0x3b9503)){return _0x2ecd8a;}else{throw new Error(_0x29d5('0x1e'));}}else{return _0x2ecd8a;}}function respondWithRpcPromise(_0xb916fb,_0xdee4fe,_0xae0f4a,_0x49f71a){return new BPromise(function(_0x3cf0d7,_0x5a183e){var _0x35762a=_0x49f71a||client;return _0x35762a['request'](_0xb916fb,_0xae0f4a)['then'](function(_0x16dcde){logger[_0x29d5('0x1f')](_0x29d5('0x20'),_0xdee4fe,_0x29d5('0x21'));logger[_0x29d5('0x22')](_0x29d5('0x23'),_0xdee4fe,'request\x20sent',JSON[_0x29d5('0x24')](_0x16dcde));if(_0x16dcde['error']){if(_0x16dcde['error']['code']===0x1f4){logger[_0x29d5('0x25')](_0x29d5('0x20'),_0xdee4fe,_0x16dcde['error'][_0x29d5('0x26')]);return _0x5a183e(_0x16dcde[_0x29d5('0x25')][_0x29d5('0x26')]);}logger[_0x29d5('0x25')](_0x29d5('0x20'),_0xdee4fe,_0x16dcde[_0x29d5('0x25')][_0x29d5('0x26')]);return _0x3cf0d7(_0x16dcde[_0x29d5('0x25')][_0x29d5('0x26')]);}else{logger[_0x29d5('0x1f')](_0x29d5('0x20'),_0xdee4fe,'request\x20sent');_0x3cf0d7(_0x16dcde[_0x29d5('0x27')][_0x29d5('0x26')]);}})[_0x29d5('0x28')](function(_0x3cdf71){logger[_0x29d5('0x25')]('SmsMessage,\x20%s,\x20%s',_0xdee4fe,_0x3cdf71);_0x5a183e(_0x3cdf71);});});}function respondWithStatusCode(_0x1a4340,_0x2022d9){_0x2022d9=_0x2022d9||0xcc;return function(_0x12b808){if(_0x12b808){return _0x1a4340[_0x29d5('0x29')](_0x2022d9);}return _0x1a4340[_0x29d5('0x2a')](_0x2022d9)[_0x29d5('0x2b')]();};}function respondWithResult(_0xdb0760,_0x136a8f){_0x136a8f=_0x136a8f||0xc8;return function(_0x5ee526){if(_0x5ee526){return _0xdb0760[_0x29d5('0x2a')](_0x136a8f)[_0x29d5('0x2c')](_0x5ee526);}};}function respondWithFilteredResult(_0x4dcd3f,_0x4afc6c){return function(_0x3990ac){if(_0x3990ac){var _0x25980e=_0x3990ac[_0x29d5('0x2d')],_0x39a4c4=_0x4afc6c[_0x29d5('0x2e')],_0x31b977=_0x4afc6c[_0x29d5('0x2e')]+_0x4afc6c[_0x29d5('0x2f')],_0x9591cd;if(_0x31b977>=_0x25980e){_0x31b977=_0x25980e;_0x9591cd=0xc8;}else{_0x9591cd=0xce;}_0x4dcd3f[_0x29d5('0x2a')](_0x9591cd);return _0x4dcd3f[_0x29d5('0x30')](_0x29d5('0x31'),_0x39a4c4+'-'+_0x31b977+'/'+_0x25980e)['json'](_0x3990ac);}return null;};}function patchUpdates(_0x4f4558){return function(_0x4c8ba){try{jsonpatch[_0x29d5('0x32')](_0x4c8ba,_0x4f4558,!![]);}catch(_0x30ecbf){return BPromise['reject'](_0x30ecbf);}return _0x4c8ba[_0x29d5('0x33')]();};}function saveUpdates(_0xae2f0d,_0x5c53af){return function(_0xc2e6bd){if(_0xc2e6bd){return _0xc2e6bd[_0x29d5('0x34')](_0xae2f0d)[_0x29d5('0x35')](function(_0x50af28){return _0x50af28;});}return null;};}function removeEntity(_0x5ae448,_0x37f079){return function(_0x198b4b){if(_0x198b4b){return _0x198b4b[_0x29d5('0x36')]()['then'](function(){_0x5ae448[_0x29d5('0x2a')](0xcc)[_0x29d5('0x2b')]();});}};}function handleEntityNotFound(_0x30394d,_0x197207){return function(_0x20909c){if(!_0x20909c){_0x30394d['sendStatus'](0x194);}return _0x20909c;};}function handleError(_0x2620e3,_0x5b217b){_0x5b217b=_0x5b217b||0x1f4;return function(_0x3981c9){logger['error'](_0x3981c9[_0x29d5('0x37')]);if(_0x3981c9['name']){delete _0x3981c9[_0x29d5('0x38')];}_0x2620e3['status'](_0x5b217b)[_0x29d5('0x39')](_0x3981c9);};}exports[_0x29d5('0x3a')]=function(_0x55b658,_0x585e19){var _0x1356fd={},_0x23b30c={},_0x135a39={'count':0x0,'rows':[]};var _0x484811=db[_0x29d5('0x3b')][_0x29d5('0x3c')];_0x23b30c['model']=_['keys'](_0x484811);_0x23b30c['query']=_[_0x29d5('0x3d')](_0x55b658[_0x29d5('0x3e')]);_0x23b30c[_0x29d5('0x3f')]=_[_0x29d5('0x40')](_0x23b30c[_0x29d5('0x41')],_0x23b30c[_0x29d5('0x3e')]);_0x1356fd[_0x29d5('0x42')]=_['intersection'](_0x23b30c[_0x29d5('0x41')],qs[_0x29d5('0x43')](_0x55b658['query']['fields']));_0x1356fd[_0x29d5('0x42')]=_0x1356fd[_0x29d5('0x42')]['length']?_0x1356fd[_0x29d5('0x42')]:_0x23b30c[_0x29d5('0x41')];if(!_0x55b658[_0x29d5('0x3e')][_0x29d5('0x44')](_0x29d5('0x45'))){_0x1356fd[_0x29d5('0x2f')]=qs['limit'](_0x55b658[_0x29d5('0x3e')][_0x29d5('0x2f')]);_0x1356fd[_0x29d5('0x2e')]=qs['offset'](_0x55b658[_0x29d5('0x3e')][_0x29d5('0x2e')]);}_0x1356fd[_0x29d5('0x46')]=qs[_0x29d5('0x47')](_0x55b658[_0x29d5('0x3e')][_0x29d5('0x47')]);_0x1356fd[_0x29d5('0x48')]=qs[_0x29d5('0x3f')](_[_0x29d5('0x49')](_0x55b658[_0x29d5('0x3e')],_0x23b30c[_0x29d5('0x3f')]));if(_0x55b658[_0x29d5('0x3e')][_0x29d5('0x4a')]){_0x1356fd[_0x29d5('0x48')]=_[_0x29d5('0x4b')](_0x1356fd[_0x29d5('0x48')],{'$or':_[_0x29d5('0x4c')](_0x484811,function(_0x1f3942){if(_0x1f3942['type'][_0x29d5('0x4d')]!=='VIRTUAL'){var _0x22fea1={};_0x22fea1[_0x1f3942[_0x29d5('0x4e')]]={'$like':'%'+_0x55b658[_0x29d5('0x3e')][_0x29d5('0x4a')]+'%'};return _0x22fea1;}})});}_0x1356fd=_[_0x29d5('0x4b')]({},_0x1356fd,_0x55b658[_0x29d5('0x4f')]);var _0x41e7cf={'where':_0x1356fd[_0x29d5('0x48')]};return db[_0x29d5('0x3b')][_0x29d5('0x2d')](_0x41e7cf)['then'](function(_0x456ef1){_0x135a39[_0x29d5('0x2d')]=_0x456ef1;if(_0x55b658[_0x29d5('0x3e')][_0x29d5('0x50')]){_0x1356fd['include']=[{'all':!![]}];}return db[_0x29d5('0x3b')][_0x29d5('0x51')](_0x1356fd);})[_0x29d5('0x35')](function(_0x3f7ac8){_0x135a39[_0x29d5('0x52')]=_0x3f7ac8;return _0x135a39;})[_0x29d5('0x35')](respondWithFilteredResult(_0x585e19,_0x1356fd))[_0x29d5('0x28')](handleError(_0x585e19,null));};exports['show']=function(_0x1c5c02,_0x5b9571){var _0x5d896f={'raw':!![],'where':{'id':_0x1c5c02[_0x29d5('0x53')]['id']}},_0x3396af={};_0x3396af[_0x29d5('0x41')]=_[_0x29d5('0x3d')](db[_0x29d5('0x3b')][_0x29d5('0x3c')]);_0x3396af[_0x29d5('0x3e')]=_[_0x29d5('0x3d')](_0x1c5c02[_0x29d5('0x3e')]);_0x3396af[_0x29d5('0x3f')]=_[_0x29d5('0x40')](_0x3396af[_0x29d5('0x41')],_0x3396af[_0x29d5('0x3e')]);_0x5d896f['attributes']=_[_0x29d5('0x40')](_0x3396af[_0x29d5('0x41')],qs[_0x29d5('0x43')](_0x1c5c02[_0x29d5('0x3e')]['fields']));_0x5d896f[_0x29d5('0x42')]=_0x5d896f[_0x29d5('0x42')][_0x29d5('0x54')]?_0x5d896f[_0x29d5('0x42')]:_0x3396af[_0x29d5('0x41')];if(_0x1c5c02[_0x29d5('0x3e')][_0x29d5('0x50')]){_0x5d896f[_0x29d5('0x55')]=[{'all':!![]}];}_0x5d896f=_[_0x29d5('0x4b')]({},_0x5d896f,_0x1c5c02[_0x29d5('0x4f')]);return db[_0x29d5('0x3b')][_0x29d5('0x56')](_0x5d896f)[_0x29d5('0x35')](handleEntityNotFound(_0x5b9571,null))['then'](respondWithResult(_0x5b9571,null))[_0x29d5('0x28')](handleError(_0x5b9571,null));};exports['create']=function(_0x39cf3c,_0x5e6e9e){return db[_0x29d5('0x3b')]['create'](_0x39cf3c[_0x29d5('0x57')],{})[_0x29d5('0x35')](respondWithResult(_0x5e6e9e,0xc9))[_0x29d5('0x28')](handleError(_0x5e6e9e,null));};exports[_0x29d5('0x34')]=function(_0x2e1787,_0x47f996){if(_0x2e1787[_0x29d5('0x57')]['id']){delete _0x2e1787[_0x29d5('0x57')]['id'];}return db['SmsMessage'][_0x29d5('0x56')]({'where':{'id':_0x2e1787[_0x29d5('0x53')]['id']}})[_0x29d5('0x35')](handleEntityNotFound(_0x47f996,null))[_0x29d5('0x35')](saveUpdates(_0x2e1787['body'],null))[_0x29d5('0x35')](respondWithResult(_0x47f996,null))[_0x29d5('0x28')](handleError(_0x47f996,null));};exports[_0x29d5('0x36')]=function(_0x3021f7,_0x464cc4){return db[_0x29d5('0x3b')][_0x29d5('0x56')]({'where':{'id':_0x3021f7['params']['id']}})[_0x29d5('0x35')](handleEntityNotFound(_0x464cc4,null))[_0x29d5('0x35')](removeEntity(_0x464cc4,null))[_0x29d5('0x28')](handleError(_0x464cc4,null));};exports['describe']=function(_0x1d9b05,_0x52cc17){return db['SmsMessage'][_0x29d5('0x58')]()['then'](respondWithResult(_0x52cc17,null))['catch'](handleError(_0x52cc17,null));};var interaction_log=require(_0x29d5('0x11'))('sms-interactions');exports['accept']=function(_0x33d9f6,_0x1260fa,_0x33d431){var _0x4177f1={'channel':_0x29d5('0x59')};if(_0x33d9f6[_0x29d5('0x57')]['id']){delete _0x33d9f6['body']['id'];}_0x33d9f6[_0x29d5('0x57')][_0x29d5('0x5a')]=!![];_0x33d9f6[_0x29d5('0x57')]['readAt']=moment()[_0x29d5('0x5b')](_0x29d5('0x5c'));_0x33d9f6[_0x29d5('0x57')]['UserId']=_0x33d9f6['body'][_0x29d5('0x5d')]||_0x33d9f6[_0x29d5('0x5e')]['id'];return db[_0x29d5('0x3b')][_0x29d5('0x56')]({'where':{'id':_0x33d9f6[_0x29d5('0x53')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x29d5('0x5f')}]})[_0x29d5('0x35')](handleEntityNotFound(_0x1260fa,null))[_0x29d5('0x35')](saveUpdates(_0x33d9f6[_0x29d5('0x57')],null))[_0x29d5('0x35')](function(_0x471b98){if(_0x471b98){_0x4177f1['message']=_0x471b98[_0x29d5('0x60')]({'plain':!![]});return db['SmsInteraction'][_0x29d5('0x56')]({'where':{'id':_0x471b98[_0x29d5('0x61')]}});}return null;})['then'](handleEntityNotFound(_0x1260fa,null))[_0x29d5('0x35')](function(_0x6fd3b9){if(_0x6fd3b9){return _0x6fd3b9[_0x29d5('0x34')]({'UserId':_0x33d9f6[_0x29d5('0x57')][_0x29d5('0x5d')],'read1stAt':_[_0x29d5('0x62')](_0x6fd3b9[_0x29d5('0x63')])?moment()['format'](_0x29d5('0x5c')):undefined});}return null;})[_0x29d5('0x35')](function(_0x211955){if(_0x211955){_0x4177f1[_0x29d5('0x64')]=_0x211955[_0x29d5('0x60')]({'plain':!![]});interaction_log['info']('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x33d9f6[_0x29d5('0x5e')]['id'],_0x33d9f6['user']['name'],_0x33d9f6[_0x29d5('0x5e')][_0x29d5('0x65')],_0x4177f1[_0x29d5('0x64')]['id'],_0x33d9f6['body']?JSON['stringify'](_0x33d9f6[_0x29d5('0x57')]):_0x29d5('0x66'));return respondWithRpcPromise(_0x29d5('0x67'),_0x29d5('0x68'),_0x4177f1);}return null;})[_0x29d5('0x35')](function(_0x4cf4b6){if(_0x4cf4b6){if(_0x33d9f6['body'][_0x29d5('0x69')]){_0x4177f1['message'][_0x29d5('0x6a')]=util[_0x29d5('0x5b')]('SIP/%s',_0x33d9f6[_0x29d5('0x5e')][_0x29d5('0x38')]);_0x4177f1['message'][_0x29d5('0x6b')]=_0x4177f1[_0x29d5('0x6b')];_0x4177f1[_0x29d5('0x26')]['event']=_0x29d5('0x6c');return respondWithRpcPromise(_0x29d5('0x6d'),'EventManager',{'event':_0x29d5('0x6e'),'message':_0x4177f1[_0x29d5('0x26')]},client9002)[_0x29d5('0x35')](function(){return _0x4177f1;});}return _0x4177f1;}return null;})[_0x29d5('0x35')](respondWithResult(_0x1260fa,null))[_0x29d5('0x28')](handleError(_0x1260fa,null));};var interaction_log=require(_0x29d5('0x11'))('sms-interactions');exports[_0x29d5('0x6f')]=function(_0x61d232,_0x15e3d0,_0x1f044d){var _0x560c30={'agent':{},'channel':'sms'};if(_0x61d232[_0x29d5('0x57')]['id']){delete _0x61d232['body']['id'];}_0x61d232['body'][_0x29d5('0x5d')]=_0x61d232[_0x29d5('0x57')][_0x29d5('0x5d')]||_0x61d232[_0x29d5('0x5e')]['id'];_0x560c30[_0x29d5('0x70')]['id']=_0x61d232['body'][_0x29d5('0x5d')];return db['SmsMessage']['find']({'where':{'id':_0x61d232['params']['id'],'UserId':null}})[_0x29d5('0x35')](handleEntityNotFound(_0x15e3d0,null))['then'](function(_0x4816fc){if(_0x4816fc){_0x560c30[_0x29d5('0x26')]=_0x4816fc[_0x29d5('0x60')]({'plain':!![]});return db[_0x29d5('0x71')][_0x29d5('0x56')]({'where':{'id':_0x4816fc[_0x29d5('0x61')]}});}return null;})[_0x29d5('0x35')](handleEntityNotFound(_0x15e3d0,null))['then'](function(_0x4bd162){if(_0x4bd162){_0x560c30[_0x29d5('0x64')]=_0x4bd162[_0x29d5('0x60')]({'plain':!![]});interaction_log[_0x29d5('0x1f')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x61d232[_0x29d5('0x5e')]['id'],_0x61d232[_0x29d5('0x5e')]['name'],_0x61d232[_0x29d5('0x5e')][_0x29d5('0x65')],_0x560c30[_0x29d5('0x64')]['id'],_0x61d232['body']?JSON[_0x29d5('0x24')](_0x61d232[_0x29d5('0x57')]):'null');return respondWithRpcPromise(_0x29d5('0x72'),_0x29d5('0x73'),_0x560c30);}return null;})[_0x29d5('0x35')](function(_0x5a08ea){if(_0x5a08ea){_0x5a08ea[_0x29d5('0x26')][_0x29d5('0x6a')]=util[_0x29d5('0x5b')](_0x29d5('0x74'),_0x61d232[_0x29d5('0x5e')][_0x29d5('0x38')]);_0x5a08ea[_0x29d5('0x26')][_0x29d5('0x6b')]=_0x560c30[_0x29d5('0x6b')];_0x5a08ea[_0x29d5('0x26')]['event']='reject';respondWithRpcPromise(_0x29d5('0x6d'),_0x29d5('0x6d'),{'event':_0x29d5('0x75'),'message':_0x5a08ea[_0x29d5('0x26')]},client9002);return _0x560c30;}return null;})[_0x29d5('0x35')](respondWithResult(_0x15e3d0,null))['catch'](handleError(_0x15e3d0,null));};exports['status']=function(_0x72046f,_0x227f3e,_0x55ec4e){if(_0x72046f[_0x29d5('0x57')]['id']){delete _0x72046f[_0x29d5('0x57')]['id'];}var _0x52620e;return db['SmsMessage'][_0x29d5('0x56')]({'where':{'id':_0x72046f[_0x29d5('0x53')]['id']}})[_0x29d5('0x35')](handleEntityNotFound(_0x227f3e,null))['then'](function(_0x2abf89){if(_0x2abf89){_0x52620e=_0x2abf89;return db[_0x29d5('0x76')][_0x29d5('0x56')]({'where':{'id':_0x2abf89[_0x29d5('0x77')]}});}})[_0x29d5('0x35')](handleEntityNotFound(_0x227f3e,null))[_0x29d5('0x35')](function(_0x1f77e3){if(_0x1f77e3){logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x29d5('0x2a'),_0x29d5('0x78'),_0x1f77e3[_0x29d5('0x79')],util[_0x29d5('0x7a')](_0x72046f['body'],{'showHidden':![],'depth':null}));switch(_0x1f77e3['type']){case'twilio':if(_0x72046f[_0x29d5('0x57')][_0x29d5('0x7b')]&&_0x72046f[_0x29d5('0x57')][_0x29d5('0x7b')]===_0x52620e[_0x29d5('0x7c')]){return _0x52620e[_0x29d5('0x34')]({'read':!![]});}else{logger[_0x29d5('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x29d5('0x2a'),_0x29d5('0x7d'),util[_0x29d5('0x7a')](_0x72046f['body'],{'showHidden':![],'depth':null}));}break;case _0x29d5('0x7e'):if(_0x72046f[_0x29d5('0x57')][_0x29d5('0x7f')]&&_0x72046f[_0x29d5('0x57')][_0x29d5('0x7f')]===_0x52620e[_0x29d5('0x7c')]&&_['indexOf']([_0x29d5('0x80'),_0x29d5('0x81')],_0x72046f[_0x29d5('0x57')][_0x29d5('0x82')])>=0x0){return _0x52620e[_0x29d5('0x34')]({'read':!![]});}else{logger[_0x29d5('0x25')](_0x29d5('0x83'),_0x29d5('0x2a'),'plivio',util['inspect'](_0x72046f[_0x29d5('0x57')],{'showHidden':![],'depth':null}));}break;case _0x29d5('0x84'):var _0x14dfe0=_0x72046f[_0x29d5('0x57')][_0x29d5('0x85')][0x0];if(_0x14dfe0[_0x29d5('0x2a')][_0x29d5('0x86')]===_0x29d5('0x87')){return _0x52620e[_0x29d5('0x34')]({'read':!![]});}else{logger[_0x29d5('0x25')](_0x29d5('0x83'),_0x29d5('0x2a'),'infobip',util[_0x29d5('0x7a')](_0x72046f['body'],{'showHidden':![],'depth':null}));}break;}return _0x52620e;}})[_0x29d5('0x35')](respondWithResult(_0x227f3e,null))['catch'](handleError(_0x227f3e,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 0df56f5..ffb0623 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 _0x93e6=['hasOwnProperty','events','setMaxListeners','update','emit'];(function(_0x46e68b,_0x48e7aa){var _0x44cdae=function(_0x36e8d4){while(--_0x36e8d4){_0x46e68b['push'](_0x46e68b['shift']());}};_0x44cdae(++_0x48e7aa);}(_0x93e6,0x11e));var _0x693e=function(_0x1f6fd5,_0x399cb0){_0x1f6fd5=_0x1f6fd5-0x0;var _0x587d12=_0x93e6[_0x1f6fd5];return _0x587d12;};'use strict';var EventEmitter=require(_0x693e('0x0'));var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x693e('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x693e('0x2'),'afterDestroy':'remove'};function emitEvent(_0x313261){return function(_0x3fb653,_0x17cf23,_0x53e728){SmsMessageEvents[_0x693e('0x3')](_0x313261+':'+_0x3fb653['id'],_0x3fb653);SmsMessageEvents[_0x693e('0x3')](_0x313261,_0x3fb653);_0x53e728(null);};}for(var e in events){if(events[_0x693e('0x4')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0x793b=['hasOwnProperty','hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','remove','emit'];(function(_0x239039,_0x3bd412){var _0xb5fb6c=function(_0x39750f){while(--_0x39750f){_0x239039['push'](_0x239039['shift']());}};_0xb5fb6c(++_0x3bd412);}(_0x793b,0x189));var _0xb793=function(_0x586d4d,_0x5ede3e){_0x586d4d=_0x586d4d-0x0;var _0x3b2fa2=_0x793b[_0x586d4d];return _0x3b2fa2;};'use strict';var EventEmitter=require(_0xb793('0x0'));var SmsMessage=require(_0xb793('0x1'))['db'][_0xb793('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xb793('0x3')](0x0);var events={'afterCreate':_0xb793('0x4'),'afterUpdate':'update','afterDestroy':_0xb793('0x5')};function emitEvent(_0x18aa98){return function(_0x577e1c,_0x56ca69,_0x28d672){SmsMessageEvents[_0xb793('0x6')](_0x18aa98+':'+_0x577e1c['id'],_0x577e1c);SmsMessageEvents[_0xb793('0x6')](_0x18aa98,_0x577e1c);_0x28d672(null);};}for(var e in events){if(events[_0xb793('0x7')](e)){var event=events[e];SmsMessage[_0xb793('0x8')](e,emitEvent(event));}}module[_0xb793('0x9')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 973bca9..689f9f0 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 _0x4fd4=['head','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','toString','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/sms/2/text/advanced','application/json','Missing\x20parameters:\x20base_url','Missing\x20parameters:\x20username,\x20password','csc','crypto','apiKey','login','text','timestamp','sort','length','md5','digest','hex','signature=','https://sms.csc.lv/external/get/send.php?','keys','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','apiMessageId','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','message','refid','status','intelepeer','Token\x20not\x20received','finally','utf8mb4','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','SmsInteractionId','update','catch','SmsAccount','type','twilio','accountSid','authToken','phone','messages','body','remote','/api/sms/messages/','/status?token=','token','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','password','smsMethod','sender','login?username=','username','GET','split','sms','POST','user_key','session_key','then','total_sent','internal_order_id','deliveryReport','read','inspect','connectel','https://smsapi.connectel.se/api/send/','senderString','%s:%s','format','Basic\x20%s','base64','http_code','data','queued_count'];(function(_0x55c130,_0x3820d5){var _0x894f1b=function(_0x478099){while(--_0x478099){_0x55c130['push'](_0x55c130['shift']());}};_0x894f1b(++_0x3820d5);}(_0x4fd4,0x117));var _0x44fd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4fd4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x44fd('0x0'));var util=require(_0x44fd('0x1'));var logger=require(_0x44fd('0x2'))(_0x44fd('0x3'));var moment=require(_0x44fd('0x4'));var BPromise=require('bluebird');var rp=require(_0x44fd('0x5'));var fs=require('fs');var path=require(_0x44fd('0x6'));var rimraf=require(_0x44fd('0x7'));var config=require(_0x44fd('0x8'));var attributes=require(_0x44fd('0x9'));module[_0x44fd('0xa')]=function(_0x9b5a67,_0x2e0406){return _0x9b5a67[_0x44fd('0xb')](_0x44fd('0xc'),attributes,{'tableName':_0x44fd('0xd'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x44fd('0xe')]},{'name':_0x44fd('0xf'),'fields':['body'],'type':_0x44fd('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x200d66,_0x2feb75,_0x252417){var _0x7e7543=_0x9b5a67['models'];var _0x40d53f=_0x200d66[_0x44fd('0x11')]({'plain':!![]});if(_0x40d53f[_0x44fd('0x12')][_0x44fd('0x13')]()==='in'||_0x40d53f[_0x44fd('0x12')]['toLowerCase']()===_0x44fd('0x14')&&!_0x40d53f[_0x44fd('0x15')]&&!_[_0x44fd('0x16')](_0x40d53f[_0x44fd('0x17')])){_0x7e7543['SmsInteraction'][_0x44fd('0x18')]({'where':{'id':_0x40d53f[_0x44fd('0x19')]}})['then'](function(_0x53bd2e){if(_0x53bd2e){_0x53bd2e[_0x44fd('0x1a')]({'lastMsgAt':_0x40d53f['createdAt'],'lastMsgDirection':_0x40d53f[_0x44fd('0x12')][_0x44fd('0x13')]()});}})[_0x44fd('0x1b')](function(_0x430b9e){console['error'](_0x430b9e);});}if(_0x40d53f[_0x44fd('0x12')]==='out'&&!_0x40d53f[_0x44fd('0x15')]){var _0x28d3d4;_0x7e7543[_0x44fd('0x1c')]['find']({'where':{'id':_0x40d53f['SmsAccountId']},'raw':!![]})['then'](function(_0x2fe1b8){_0x28d3d4=_0x2fe1b8;if(_0x28d3d4&&_0x28d3d4[_0x44fd('0x1d')]){switch(_0x28d3d4[_0x44fd('0x1d')]){case'twilio':var _0x7400e0=require(_0x44fd('0x1e'));if(_0x28d3d4[_0x44fd('0x1f')]&&_0x28d3d4[_0x44fd('0x20')]&&_0x28d3d4[_0x44fd('0x21')]){var _0x1e3bb5=new _0x7400e0(_0x28d3d4['accountSid'],_0x28d3d4[_0x44fd('0x20')]);_0x1e3bb5[_0x44fd('0x22')]['create']({'body':_0x40d53f[_0x44fd('0x23')],'to':_0x40d53f[_0x44fd('0x21')],'from':_0x28d3d4[_0x44fd('0x21')],'statusCallback':_0x28d3d4[_0x44fd('0x24')]+_0x44fd('0x25')+_0x40d53f['id']+_0x44fd('0x26')+_0x28d3d4[_0x44fd('0x27')]})['then'](function(_0x109532){if(_0x109532['sid']){return _0x200d66[_0x44fd('0x1a')]({'messageId':_0x109532['sid']});}})[_0x44fd('0x1b')](function(_0x29db4a){logger[_0x44fd('0x28')](_0x44fd('0x29'),'afterCreate',_0x44fd('0x1e'),util['inspect'](_0x29db4a,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x44fd('0x29'),_0x44fd('0x2a'),_0x44fd('0x1e'),_0x44fd('0x2b'));}break;case _0x44fd('0x2c'):var _0x4a09c9='https://api.skebby.it/API/v1.0/REST/';if(_0x28d3d4['username']&&_0x28d3d4[_0x44fd('0x2d')]){var _0x54b830={'recipient':[_0x40d53f['phone']],'message':_0x40d53f['body'],'message_type':_0x28d3d4[_0x44fd('0x2e')]};if(_0x28d3d4[_0x44fd('0x2e')]&&_0x28d3d4[_0x44fd('0x2e')]!=='SI'){_0x54b830[_0x44fd('0x2f')]=_0x28d3d4['phone'];}var _0x5ec1b2={'url':_0x4a09c9+_0x44fd('0x30')+_0x28d3d4[_0x44fd('0x31')]+'&password='+_0x28d3d4[_0x44fd('0x2d')],'method':_0x44fd('0x32')};rp(_0x5ec1b2)['then'](function(_0x29dc36){var _0x36ba19=_0x29dc36[_0x44fd('0x33')](';');var _0x2674a2={'user_key':_0x36ba19[0x0],'session_key':_0x36ba19[0x1]};_0x5ec1b2={'url':_0x4a09c9+_0x44fd('0x34'),'method':_0x44fd('0x35'),'headers':{'user_key':_0x2674a2[_0x44fd('0x36')],'Session_key':_0x2674a2[_0x44fd('0x37')]},'json':!![],'body':_0x54b830};return rp(_0x5ec1b2);})[_0x44fd('0x38')](function(_0x54e62d){if(_0x54e62d[_0x44fd('0x39')]>=0x1){var _0x5f3037={'messageId':_0x54e62d[_0x44fd('0x3a')]};if(_0x28d3d4[_0x44fd('0x2e')]!=='GP'||!_0x28d3d4[_0x44fd('0x3b')]){_0x5f3037[_0x44fd('0x3c')]=!![];}return _0x200d66[_0x44fd('0x1a')](_0x5f3037);}else{return logger[_0x44fd('0x28')](_0x44fd('0x29'),'afterCreate',_0x44fd('0x2c'),util[_0x44fd('0x3d')](_0x54e62d,{'showHidden':![],'depth':null}));}})[_0x44fd('0x1b')](function(_0x2a8469){return logger[_0x44fd('0x28')](_0x44fd('0x29'),_0x44fd('0x2a'),_0x44fd('0x2c'),util[_0x44fd('0x3d')](_0x2a8469,{'showHidden':![],'depth':null}));});}else{logger[_0x44fd('0x28')](_0x44fd('0x29'),_0x44fd('0x2a'),_0x44fd('0x2c'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x44fd('0x3e'):if(_0x28d3d4[_0x44fd('0x20')]){var _0x2cfecd={'recipient':_0x40d53f[_0x44fd('0x21')],'message':_0x40d53f[_0x44fd('0x23')],'sender':_0x28d3d4['senderString']||_0x28d3d4[_0x44fd('0x21')],'authorization':_0x28d3d4['authToken']};var _0x2feb75={'method':_0x44fd('0x35'),'uri':_0x44fd('0x3f'),'body':_0x2cfecd,'json':!![]};rp(_0x2feb75)[_0x44fd('0x38')](function(_0xa6d266){var _0x14cae4={'messageId':_0xa6d266['requestid']};if(!_0x28d3d4[_0x44fd('0x3b')]){_0x14cae4[_0x44fd('0x3c')]=!![];}return _0x200d66[_0x44fd('0x1a')](_0x14cae4);})[_0x44fd('0x1b')](function(_0x2cb7e4){logger[_0x44fd('0x28')](_0x44fd('0x29'),_0x44fd('0x2a'),_0x44fd('0x3e'),util[_0x44fd('0x3d')](_0x2cb7e4,{'showHidden':![],'depth':null}));});}else{logger[_0x44fd('0x28')](_0x44fd('0x29'),_0x44fd('0x2a'),_0x44fd('0x3e'),'Missing\x20parameters:\x20authToken');}break;case'clicksend':if(_0x28d3d4[_0x44fd('0x31')]&&_0x28d3d4[_0x44fd('0x2d')]){var _0x2cfecd={'messages':[{'source':'xCALLY\x20Motion','to':_0x40d53f[_0x44fd('0x21')],'body':_0x40d53f[_0x44fd('0x23')],'from':_0x28d3d4[_0x44fd('0x40')]||_0x28d3d4[_0x44fd('0x21')]}]};var _0x5d8414=util['format'](_0x44fd('0x41'),_0x28d3d4[_0x44fd('0x31')],_0x28d3d4[_0x44fd('0x2d')]);var _0x2feb75={'method':_0x44fd('0x35'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x2cfecd,'headers':{'Authorization':util[_0x44fd('0x42')](_0x44fd('0x43'),new Buffer(_0x5d8414)['toString'](_0x44fd('0x44')))},'json':!![]};rp(_0x2feb75)[_0x44fd('0x38')](function(_0x44834d){if(_0x44834d[_0x44fd('0x45')]>=0xc8&&_0x44834d[_0x44fd('0x45')]<=0xce){if(_0x44834d[_0x44fd('0x46')]&&_0x44834d[_0x44fd('0x46')][_0x44fd('0x47')]>0x0){var _0x598ebb=_[_0x44fd('0x48')](_0x44834d[_0x44fd('0x46')][_0x44fd('0x22')]);var _0x272b8f={'messageId':_0x598ebb['message_id']};if(!_0x28d3d4[_0x44fd('0x3b')]){_0x272b8f[_0x44fd('0x3c')]=!![];}return _0x200d66['update'](_0x272b8f);}else{logger['error'](_0x44fd('0x29'),'afterCreate',_0x44fd('0x49'),util[_0x44fd('0x3d')](_0x44834d,{'showHidden':![],'depth':null}));}}else{logger[_0x44fd('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x44fd('0x2a'),_0x44fd('0x49'),util[_0x44fd('0x3d')](_0x44834d,{'showHidden':![],'depth':null}));}})[_0x44fd('0x1b')](function(_0xd791c7){logger[_0x44fd('0x28')](_0x44fd('0x29'),_0x44fd('0x2a'),_0x44fd('0x49'),util[_0x44fd('0x3d')](_0xd791c7,{'showHidden':![],'depth':null}));});}else{logger[_0x44fd('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x44fd('0x2a'),'clickSend','Missing\x20parameters:\x20username,\x20password');}break;case _0x44fd('0x4a'):if(_0x28d3d4[_0x44fd('0x4b')]&&_0x28d3d4[_0x44fd('0x20')]){var _0x2cfecd={'dst':_0x40d53f[_0x44fd('0x21')],'text':_0x40d53f['body'],'src':_0x28d3d4[_0x44fd('0x40')]||_0x28d3d4['phone'],'url':_0x28d3d4[_0x44fd('0x24')]+'/api/sms/messages/'+_0x40d53f['id']+_0x44fd('0x26')+_0x28d3d4['token']};var _0x5d8414=util['format'](_0x44fd('0x41'),_0x28d3d4[_0x44fd('0x4b')],_0x28d3d4['authToken']);var _0x2feb75={'method':_0x44fd('0x35'),'uri':util[_0x44fd('0x42')](_0x44fd('0x4c'),_0x28d3d4['authId']),'body':_0x2cfecd,'headers':{'Authorization':util[_0x44fd('0x42')](_0x44fd('0x43'),new Buffer(_0x5d8414)[_0x44fd('0x4d')](_0x44fd('0x44')))},'json':!![]};rp(_0x2feb75)[_0x44fd('0x38')](function(_0x10ffa0){var _0x21bec7={'messageId':_0x10ffa0[_0x44fd('0x4e')][0x0]};return _0x200d66[_0x44fd('0x1a')](_0x21bec7);})[_0x44fd('0x1b')](function(_0x1d121e){logger[_0x44fd('0x28')](_0x44fd('0x29'),_0x44fd('0x2a'),_0x44fd('0x4a'),util['inspect'](_0x1d121e,{'showHidden':![],'depth':null}));});}else{logger[_0x44fd('0x28')](_0x44fd('0x29'),_0x44fd('0x2a'),_0x44fd('0x4a'),_0x44fd('0x4f'));}break;case _0x44fd('0x50'):if(_0x28d3d4[_0x44fd('0x31')]&&_0x28d3d4[_0x44fd('0x2d')]){if(_0x28d3d4[_0x44fd('0x51')]){var _0x3a0189={'method':'POST','uri':_0x28d3d4['baseUrl']+'/auth/1/session','body':{'username':_0x28d3d4[_0x44fd('0x31')],'password':_0x28d3d4[_0x44fd('0x2d')]},'json':!![]};return rp(_0x3a0189)[_0x44fd('0x38')](function(_0x66b9c9){var _0x165dbe={'method':'POST','uri':_0x28d3d4['baseUrl']+_0x44fd('0x52'),'body':{'messages':[{'from':_0x28d3d4['phone'],'destinations':[{'to':_0x40d53f[_0x44fd('0x21')]}],'text':_0x40d53f[_0x44fd('0x23')],'notifyUrl':_0x28d3d4[_0x44fd('0x24')]+'/api/sms/messages/'+_0x40d53f['id']+_0x44fd('0x26')+_0x28d3d4[_0x44fd('0x27')],'notifyContentType':_0x44fd('0x53'),'callbackData':_0x28d3d4['phone']+';'+_0x40d53f[_0x44fd('0x23')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x66b9c9[_0x44fd('0x27')]},'json':!![]};return rp(_0x165dbe)['then'](function(_0x3dc82d){if(_0x3dc82d[_0x44fd('0x22')]){var _0x29385e={'messageId':_0x3dc82d[_0x44fd('0x22')][0x0][_0x44fd('0xe')]};if(!_0x28d3d4['deliveryReport']){_0x29385e[_0x44fd('0x3c')]=!![];}return _0x200d66[_0x44fd('0x1a')](_0x29385e);}else{return logger[_0x44fd('0x28')](_0x44fd('0x29'),'afterCreate','infobip',util[_0x44fd('0x3d')](_0x3dc82d,{'showHidden':![],'depth':null}));}});})[_0x44fd('0x1b')](function(_0x1cf19c){return logger['error'](_0x44fd('0x29'),_0x44fd('0x2a'),_0x44fd('0x50'),util[_0x44fd('0x3d')](_0x1cf19c,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x44fd('0x29'),_0x44fd('0x2a'),_0x44fd('0x50'),_0x44fd('0x54'));}}else{logger[_0x44fd('0x28')](_0x44fd('0x29'),_0x44fd('0x2a'),_0x44fd('0x50'),_0x44fd('0x55'));}break;case _0x44fd('0x56'):var _0x31d34a=require(_0x44fd('0x57'));if(_0x28d3d4[_0x44fd('0x58')]){var _0x11d89e={};_0x11d89e[_0x44fd('0x59')]=_0x28d3d4[_0x44fd('0x31')];_0x11d89e['phone']=_0x40d53f[_0x44fd('0x21')];_0x11d89e[_0x44fd('0x2f')]=_0x28d3d4[_0x44fd('0x21')];_0x11d89e[_0x44fd('0x5a')]=_0x40d53f[_0x44fd('0x23')];_0x11d89e[_0x44fd('0x5b')]=+new Date();var _0x2b2e6c='';var _0x4e807e='';var _0x11f686=Object['keys'](_0x11d89e);_0x11f686[_0x44fd('0x5c')]();for(var _0x808495=0x0;_0x808495<_0x11f686[_0x44fd('0x5d')];_0x808495++){if(_0x2b2e6c!=''){_0x2b2e6c+='&';}_0x2b2e6c+=_0x11f686[_0x808495]+'='+encodeURIComponent(_0x11d89e[_0x11f686[_0x808495]]);_0x4e807e+=_0x11d89e[_0x11f686[_0x808495]];}_0x4e807e+=_0x28d3d4[_0x44fd('0x58')];_0x4e807e=_0x31d34a['createHash'](_0x44fd('0x5e'))[_0x44fd('0x1a')](_0x4e807e)[_0x44fd('0x5f')](_0x44fd('0x60'));if(_0x2b2e6c!==''){_0x2b2e6c+='&';}_0x2b2e6c+=_0x44fd('0x61')+_0x4e807e;var _0x5ec1b2={'method':_0x44fd('0x32'),'uri':_0x44fd('0x62')+_0x2b2e6c,'json':!![]};return rp(_0x5ec1b2)['then'](function(_0x55b893){var _0x30e1ba=Object[_0x44fd('0x63')](_0x55b893);if(_0x55b893[_0x30e1ba[0x0]][_0x44fd('0x28')]&&parseInt(_0x55b893[_0x30e1ba[0x0]][_0x44fd('0x28')])===0x0){var _0x541c91={'messageId':_0x55b893[_0x30e1ba[0x0]][_0x44fd('0x64')]};if(!_0x28d3d4[_0x44fd('0x3b')]){_0x541c91[_0x44fd('0x3c')]=!![];}return _0x200d66['update'](_0x541c91);}else{return logger[_0x44fd('0x28')](_0x44fd('0x29'),'afterCreate',_0x44fd('0x56'),util[_0x44fd('0x3d')](_0x55b893[_0x44fd('0x28')],{'showHidden':![],'depth':null}));}})[_0x44fd('0x1b')](function(_0x155a39){return logger[_0x44fd('0x28')](_0x44fd('0x29'),'afterCreate',_0x44fd('0x56'),util[_0x44fd('0x3d')](_0x155a39,{'showHidden':![],'depth':null}));});}else{logger[_0x44fd('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x44fd('0x56'),_0x44fd('0x65'));}break;case _0x44fd('0x66'):if(_0x28d3d4[_0x44fd('0x58')]){var _0x2c374f={'method':_0x44fd('0x35'),'uri':_0x44fd('0x67'),'headers':{'Authorization':_0x28d3d4['apiKey']},'body':{'content':_0x40d53f['body'],'to':[_0x40d53f[_0x44fd('0x21')]],'from':_0x28d3d4['phone'],'binary':![],'clientMessageId':_0x44fd('0x68'),'charset':'UTF-8'},'json':!![]};rp(_0x2c374f)[_0x44fd('0x38')](function(_0xccaf19){if(!_0xccaf19[_0x44fd('0x28')]){var _0x1ea27c={'messageId':_0xccaf19[_0x44fd('0x22')][0x0][_0x44fd('0x69')]};if(!_0x28d3d4[_0x44fd('0x3b')]){_0x1ea27c[_0x44fd('0x3c')]=!![];}return _0x200d66[_0x44fd('0x1a')](_0x1ea27c);}else{return logger[_0x44fd('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x44fd('0x2a'),'clickatell',util[_0x44fd('0x3d')](_0xccaf19[_0x44fd('0x28')],{'showHidden':![],'depth':null}));}})[_0x44fd('0x1b')](function(_0xb32da1){return logger['error'](_0x44fd('0x29'),_0x44fd('0x2a'),_0x44fd('0x66'),util[_0x44fd('0x3d')](_0xb32da1,{'showHidden':![],'depth':null}));});}else{logger[_0x44fd('0x28')](_0x44fd('0x29'),_0x44fd('0x2a'),_0x44fd('0x66'),'Missing\x20parameters:\x20apiKey');}break;case'intelepeer':if(_0x28d3d4[_0x44fd('0x58')]){var _0x469a64={};var _0x5ec1b2={'method':_0x44fd('0x35'),'uri':_0x44fd('0x6a'),'headers':{'Authorization':_0x44fd('0x6b')+_0x28d3d4[_0x44fd('0x58')],'Content-Type':_0x44fd('0x53')},'body':{'from':_0x28d3d4[_0x44fd('0x21')],'to':_0x40d53f[_0x44fd('0x21')],'text':_0x40d53f['body']},'json':!![]};return rp(_0x5ec1b2)[_0x44fd('0x38')](function(_0x353a43){if(_0x353a43[_0x44fd('0x6c')]==0xca){_0x469a64['message']=_0x353a43;var _0x333f1b={'method':'POST','uri':_0x44fd('0x6d'),'headers':{'Authorization':'Bearer\x20'+_0x28d3d4[_0x44fd('0x58')],'Content-Type':_0x44fd('0x53')},'body':{'refid':_0x469a64[_0x44fd('0x6e')][_0x44fd('0x6f')]},'json':!![]};return rp(_0x333f1b)['then'](function(_0xc50cdc){_0x469a64[_0x44fd('0x70')]=_0xc50cdc;var _0x1ad9c0={'messageId':_0x469a64[_0x44fd('0x6e')][_0x44fd('0x6f')],'read':!![]};return _0x200d66[_0x44fd('0x1a')](_0x1ad9c0);});}else{return logger[_0x44fd('0x28')](_0x44fd('0x29'),_0x44fd('0x2a'),_0x44fd('0x71'),util[_0x44fd('0x3d')](_0x353a43,{'showHidden':![],'depth':null}));}})['catch'](function(_0x5ef976){return logger[_0x44fd('0x28')](_0x44fd('0x29'),_0x44fd('0x2a'),_0x44fd('0x71'),util[_0x44fd('0x3d')](_0x5ef976,{'showHidden':![],'depth':null}));});}else{return logger[_0x44fd('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x44fd('0x2a'),_0x44fd('0x71'),_0x44fd('0x72'));}break;}}})[_0x44fd('0x73')](function(){_0x252417();});}else{_0x252417();}}},'charset':_0x44fd('0x74'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x0090=['&password=','GET','split','sms','POST','session_key','total_sent','deliveryReport','Missing\x20parameters:\x20username,\x20password','connectel','authToken','https://smsapi.connectel.se/api/send/','requestid','read','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','senderString','format','%s:%s','toString','base64','http_code','data','message_id','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','timestamp','keys','sort','length','createHash','md5','hex','signature=','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','refid','status','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','toLowerCase','out','secret','isNil','UserId','findOne','then','update','createdAt','direction','catch','error','SmsAccount','type','twilio','accountSid','phone','messages','create','remote','/api/sms/messages/','/status?token=','token','sid','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','skebby','username','password','smsMethod','sender','login?username='];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0090,0x12b));var _0x0009=function(_0x13ba12,_0x49e96a){_0x13ba12=_0x13ba12-0x0;var _0x11d346=_0x0090[_0x13ba12];return _0x11d346;};'use strict';var _=require('lodash');var util=require(_0x0009('0x0'));var logger=require(_0x0009('0x1'))(_0x0009('0x2'));var moment=require(_0x0009('0x3'));var BPromise=require('bluebird');var rp=require(_0x0009('0x4'));var fs=require('fs');var path=require(_0x0009('0x5'));var rimraf=require(_0x0009('0x6'));var config=require(_0x0009('0x7'));var attributes=require(_0x0009('0x8'));module[_0x0009('0x9')]=function(_0x1e53be,_0xdc2abb){return _0x1e53be[_0x0009('0xa')](_0x0009('0xb'),attributes,{'tableName':_0x0009('0xc'),'paranoid':![],'indexes':[{'name':_0x0009('0xd'),'fields':[_0x0009('0xd')]},{'name':_0x0009('0xe'),'fields':[_0x0009('0xf')],'type':_0x0009('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5a0efe,_0x366813,_0x3759b3){var _0x191375=_0x1e53be[_0x0009('0x11')];var _0x33b7be=_0x5a0efe[_0x0009('0x12')]({'plain':!![]});if(_0x33b7be['direction']['toLowerCase']()==='in'||_0x33b7be['direction'][_0x0009('0x13')]()===_0x0009('0x14')&&!_0x33b7be[_0x0009('0x15')]&&!_[_0x0009('0x16')](_0x33b7be[_0x0009('0x17')])){_0x191375['SmsInteraction'][_0x0009('0x18')]({'where':{'id':_0x33b7be['SmsInteractionId']}})[_0x0009('0x19')](function(_0x562402){if(_0x562402){_0x562402[_0x0009('0x1a')]({'lastMsgAt':_0x33b7be[_0x0009('0x1b')],'lastMsgDirection':_0x33b7be[_0x0009('0x1c')]['toLowerCase']()});}})[_0x0009('0x1d')](function(_0x43661c){console[_0x0009('0x1e')](_0x43661c);});}if(_0x33b7be[_0x0009('0x1c')]===_0x0009('0x14')&&!_0x33b7be[_0x0009('0x15')]){var _0x364766;_0x191375[_0x0009('0x1f')]['find']({'where':{'id':_0x33b7be['SmsAccountId']},'raw':!![]})[_0x0009('0x19')](function(_0x3648b7){_0x364766=_0x3648b7;if(_0x364766&&_0x364766[_0x0009('0x20')]){switch(_0x364766[_0x0009('0x20')]){case _0x0009('0x21'):var _0x15b99e=require(_0x0009('0x21'));if(_0x364766[_0x0009('0x22')]&&_0x364766['authToken']&&_0x364766[_0x0009('0x23')]){var _0x529023=new _0x15b99e(_0x364766['accountSid'],_0x364766['authToken']);_0x529023[_0x0009('0x24')][_0x0009('0x25')]({'body':_0x33b7be[_0x0009('0xf')],'to':_0x33b7be[_0x0009('0x23')],'from':_0x364766[_0x0009('0x23')],'statusCallback':_0x364766[_0x0009('0x26')]+_0x0009('0x27')+_0x33b7be['id']+_0x0009('0x28')+_0x364766[_0x0009('0x29')]})[_0x0009('0x19')](function(_0x5c66c8){if(_0x5c66c8[_0x0009('0x2a')]){return _0x5a0efe[_0x0009('0x1a')]({'messageId':_0x5c66c8['sid']});}})['catch'](function(_0x5f1a8f){logger[_0x0009('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0009('0x2b'),_0x0009('0x21'),util[_0x0009('0x2c')](_0x5f1a8f,{'showHidden':![],'depth':null}));});}else{logger[_0x0009('0x1e')](_0x0009('0x2d'),_0x0009('0x2b'),_0x0009('0x21'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x0009('0x2e'):var _0x4e617b='https://api.skebby.it/API/v1.0/REST/';if(_0x364766[_0x0009('0x2f')]&&_0x364766[_0x0009('0x30')]){var _0x2c355f={'recipient':[_0x33b7be[_0x0009('0x23')]],'message':_0x33b7be[_0x0009('0xf')],'message_type':_0x364766['smsMethod']};if(_0x364766[_0x0009('0x31')]&&_0x364766[_0x0009('0x31')]!=='SI'){_0x2c355f[_0x0009('0x32')]=_0x364766[_0x0009('0x23')];}var _0x3d8ad7={'url':_0x4e617b+_0x0009('0x33')+_0x364766[_0x0009('0x2f')]+_0x0009('0x34')+_0x364766['password'],'method':_0x0009('0x35')};rp(_0x3d8ad7)[_0x0009('0x19')](function(_0x2b0b99){var _0x3fd3d3=_0x2b0b99[_0x0009('0x36')](';');var _0x473981={'user_key':_0x3fd3d3[0x0],'session_key':_0x3fd3d3[0x1]};_0x3d8ad7={'url':_0x4e617b+_0x0009('0x37'),'method':_0x0009('0x38'),'headers':{'user_key':_0x473981['user_key'],'Session_key':_0x473981[_0x0009('0x39')]},'json':!![],'body':_0x2c355f};return rp(_0x3d8ad7);})[_0x0009('0x19')](function(_0x32737b){if(_0x32737b[_0x0009('0x3a')]>=0x1){var _0x543254={'messageId':_0x32737b['internal_order_id']};if(_0x364766[_0x0009('0x31')]!=='GP'||!_0x364766[_0x0009('0x3b')]){_0x543254['read']=!![];}return _0x5a0efe[_0x0009('0x1a')](_0x543254);}else{return logger['error'](_0x0009('0x2d'),_0x0009('0x2b'),_0x0009('0x2e'),util[_0x0009('0x2c')](_0x32737b,{'showHidden':![],'depth':null}));}})[_0x0009('0x1d')](function(_0xbe7b3b){return logger[_0x0009('0x1e')](_0x0009('0x2d'),'afterCreate',_0x0009('0x2e'),util[_0x0009('0x2c')](_0xbe7b3b,{'showHidden':![],'depth':null}));});}else{logger[_0x0009('0x1e')](_0x0009('0x2d'),_0x0009('0x2b'),'skebby',_0x0009('0x3c'));}break;case _0x0009('0x3d'):if(_0x364766['authToken']){var _0x196977={'recipient':_0x33b7be[_0x0009('0x23')],'message':_0x33b7be[_0x0009('0xf')],'sender':_0x364766['senderString']||_0x364766[_0x0009('0x23')],'authorization':_0x364766[_0x0009('0x3e')]};var _0x366813={'method':_0x0009('0x38'),'uri':_0x0009('0x3f'),'body':_0x196977,'json':!![]};rp(_0x366813)['then'](function(_0x2a4526){var _0x388783={'messageId':_0x2a4526[_0x0009('0x40')]};if(!_0x364766['deliveryReport']){_0x388783[_0x0009('0x41')]=!![];}return _0x5a0efe['update'](_0x388783);})[_0x0009('0x1d')](function(_0x495240){logger['error'](_0x0009('0x2d'),_0x0009('0x2b'),_0x0009('0x3d'),util['inspect'](_0x495240,{'showHidden':![],'depth':null}));});}else{logger[_0x0009('0x1e')](_0x0009('0x2d'),_0x0009('0x2b'),_0x0009('0x3d'),_0x0009('0x42'));}break;case _0x0009('0x43'):if(_0x364766[_0x0009('0x2f')]&&_0x364766[_0x0009('0x30')]){var _0x196977={'messages':[{'source':_0x0009('0x44'),'to':_0x33b7be[_0x0009('0x23')],'body':_0x33b7be[_0x0009('0xf')],'from':_0x364766[_0x0009('0x45')]||_0x364766[_0x0009('0x23')]}]};var _0x38d583=util[_0x0009('0x46')](_0x0009('0x47'),_0x364766[_0x0009('0x2f')],_0x364766[_0x0009('0x30')]);var _0x366813={'method':_0x0009('0x38'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x196977,'headers':{'Authorization':util[_0x0009('0x46')]('Basic\x20%s',new Buffer(_0x38d583)[_0x0009('0x48')](_0x0009('0x49')))},'json':!![]};rp(_0x366813)[_0x0009('0x19')](function(_0x5b20ca){if(_0x5b20ca[_0x0009('0x4a')]>=0xc8&&_0x5b20ca[_0x0009('0x4a')]<=0xce){if(_0x5b20ca['data']&&_0x5b20ca[_0x0009('0x4b')]['queued_count']>0x0){var _0x464df4=_['head'](_0x5b20ca['data'][_0x0009('0x24')]);var _0x21e66b={'messageId':_0x464df4[_0x0009('0x4c')]};if(!_0x364766[_0x0009('0x3b')]){_0x21e66b[_0x0009('0x41')]=!![];}return _0x5a0efe[_0x0009('0x1a')](_0x21e66b);}else{logger[_0x0009('0x1e')](_0x0009('0x2d'),_0x0009('0x2b'),_0x0009('0x4d'),util[_0x0009('0x2c')](_0x5b20ca,{'showHidden':![],'depth':null}));}}else{logger[_0x0009('0x1e')](_0x0009('0x2d'),_0x0009('0x2b'),'clickSend',util[_0x0009('0x2c')](_0x5b20ca,{'showHidden':![],'depth':null}));}})[_0x0009('0x1d')](function(_0x269a39){logger[_0x0009('0x1e')](_0x0009('0x2d'),_0x0009('0x2b'),'clickSend',util['inspect'](_0x269a39,{'showHidden':![],'depth':null}));});}else{logger[_0x0009('0x1e')](_0x0009('0x2d'),_0x0009('0x2b'),_0x0009('0x4d'),_0x0009('0x3c'));}break;case _0x0009('0x4e'):if(_0x364766[_0x0009('0x4f')]&&_0x364766[_0x0009('0x3e')]){var _0x196977={'dst':_0x33b7be[_0x0009('0x23')],'text':_0x33b7be['body'],'src':_0x364766[_0x0009('0x45')]||_0x364766[_0x0009('0x23')],'url':_0x364766[_0x0009('0x26')]+_0x0009('0x27')+_0x33b7be['id']+_0x0009('0x28')+_0x364766['token']};var _0x38d583=util[_0x0009('0x46')](_0x0009('0x47'),_0x364766[_0x0009('0x4f')],_0x364766['authToken']);var _0x366813={'method':'POST','uri':util[_0x0009('0x46')](_0x0009('0x50'),_0x364766['authId']),'body':_0x196977,'headers':{'Authorization':util['format'](_0x0009('0x51'),new Buffer(_0x38d583)[_0x0009('0x48')]('base64'))},'json':!![]};rp(_0x366813)['then'](function(_0x24aebe){var _0x12a50c={'messageId':_0x24aebe[_0x0009('0x52')][0x0]};return _0x5a0efe[_0x0009('0x1a')](_0x12a50c);})[_0x0009('0x1d')](function(_0x3f2795){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0009('0x2b'),_0x0009('0x4e'),util['inspect'](_0x3f2795,{'showHidden':![],'depth':null}));});}else{logger[_0x0009('0x1e')](_0x0009('0x2d'),_0x0009('0x2b'),'plivo',_0x0009('0x53'));}break;case _0x0009('0x54'):if(_0x364766['username']&&_0x364766[_0x0009('0x30')]){if(_0x364766[_0x0009('0x55')]){var _0x3eeabb={'method':_0x0009('0x38'),'uri':_0x364766[_0x0009('0x55')]+'/auth/1/session','body':{'username':_0x364766[_0x0009('0x2f')],'password':_0x364766[_0x0009('0x30')]},'json':!![]};return rp(_0x3eeabb)[_0x0009('0x19')](function(_0x2ce0b3){var _0x5896cd={'method':'POST','uri':_0x364766[_0x0009('0x55')]+_0x0009('0x56'),'body':{'messages':[{'from':_0x364766[_0x0009('0x23')],'destinations':[{'to':_0x33b7be[_0x0009('0x23')]}],'text':_0x33b7be[_0x0009('0xf')],'notifyUrl':_0x364766[_0x0009('0x26')]+_0x0009('0x27')+_0x33b7be['id']+_0x0009('0x28')+_0x364766[_0x0009('0x29')],'notifyContentType':_0x0009('0x57'),'callbackData':_0x364766[_0x0009('0x23')]+';'+_0x33b7be[_0x0009('0xf')]}]},'headers':{'Authorization':_0x0009('0x58')+_0x2ce0b3[_0x0009('0x29')]},'json':!![]};return rp(_0x5896cd)[_0x0009('0x19')](function(_0x3a4391){if(_0x3a4391[_0x0009('0x24')]){var _0x4535f2={'messageId':_0x3a4391[_0x0009('0x24')][0x0][_0x0009('0xd')]};if(!_0x364766[_0x0009('0x3b')]){_0x4535f2[_0x0009('0x41')]=!![];}return _0x5a0efe[_0x0009('0x1a')](_0x4535f2);}else{return logger[_0x0009('0x1e')](_0x0009('0x2d'),_0x0009('0x2b'),_0x0009('0x54'),util[_0x0009('0x2c')](_0x3a4391,{'showHidden':![],'depth':null}));}});})[_0x0009('0x1d')](function(_0x188246){return logger[_0x0009('0x1e')](_0x0009('0x2d'),'afterCreate',_0x0009('0x54'),util[_0x0009('0x2c')](_0x188246,{'showHidden':![],'depth':null}));});}else{logger[_0x0009('0x1e')](_0x0009('0x2d'),_0x0009('0x2b'),_0x0009('0x54'),_0x0009('0x59'));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x0009('0x54'),_0x0009('0x3c'));}break;case _0x0009('0x5a'):var _0x426d1e=require(_0x0009('0x5b'));if(_0x364766[_0x0009('0x5c')]){var _0x153e28={};_0x153e28[_0x0009('0x5d')]=_0x364766['username'];_0x153e28['phone']=_0x33b7be[_0x0009('0x23')];_0x153e28[_0x0009('0x32')]=_0x364766['phone'];_0x153e28[_0x0009('0x5e')]=_0x33b7be[_0x0009('0xf')];_0x153e28[_0x0009('0x5f')]=+new Date();var _0x4a1618='';var _0x39bd2b='';var _0x3c10ca=Object[_0x0009('0x60')](_0x153e28);_0x3c10ca[_0x0009('0x61')]();for(var _0xdde523=0x0;_0xdde523<_0x3c10ca[_0x0009('0x62')];_0xdde523++){if(_0x4a1618!=''){_0x4a1618+='&';}_0x4a1618+=_0x3c10ca[_0xdde523]+'='+encodeURIComponent(_0x153e28[_0x3c10ca[_0xdde523]]);_0x39bd2b+=_0x153e28[_0x3c10ca[_0xdde523]];}_0x39bd2b+=_0x364766['apiKey'];_0x39bd2b=_0x426d1e[_0x0009('0x63')](_0x0009('0x64'))['update'](_0x39bd2b)['digest'](_0x0009('0x65'));if(_0x4a1618!==''){_0x4a1618+='&';}_0x4a1618+=_0x0009('0x66')+_0x39bd2b;var _0x3d8ad7={'method':_0x0009('0x35'),'uri':'https://sms.csc.lv/external/get/send.php?'+_0x4a1618,'json':!![]};return rp(_0x3d8ad7)[_0x0009('0x19')](function(_0xc8734){var _0x91f718=Object[_0x0009('0x60')](_0xc8734);if(_0xc8734[_0x91f718[0x0]][_0x0009('0x1e')]&&parseInt(_0xc8734[_0x91f718[0x0]][_0x0009('0x1e')])===0x0){var _0x4f7390={'messageId':_0xc8734[_0x91f718[0x0]]['id_sms']};if(!_0x364766[_0x0009('0x3b')]){_0x4f7390[_0x0009('0x41')]=!![];}return _0x5a0efe[_0x0009('0x1a')](_0x4f7390);}else{return logger[_0x0009('0x1e')](_0x0009('0x2d'),_0x0009('0x2b'),_0x0009('0x5a'),util[_0x0009('0x2c')](_0xc8734[_0x0009('0x1e')],{'showHidden':![],'depth':null}));}})[_0x0009('0x1d')](function(_0x57c525){return logger[_0x0009('0x1e')](_0x0009('0x2d'),_0x0009('0x2b'),_0x0009('0x5a'),util['inspect'](_0x57c525,{'showHidden':![],'depth':null}));});}else{logger[_0x0009('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x0009('0x2b'),_0x0009('0x5a'),_0x0009('0x67'));}break;case _0x0009('0x68'):if(_0x364766['apiKey']){var _0x31771b={'method':_0x0009('0x38'),'uri':_0x0009('0x69'),'headers':{'Authorization':_0x364766[_0x0009('0x5c')]},'body':{'content':_0x33b7be[_0x0009('0xf')],'to':[_0x33b7be[_0x0009('0x23')]],'from':_0x364766[_0x0009('0x23')],'binary':![],'clientMessageId':_0x0009('0x6a'),'charset':'UTF-8'},'json':!![]};rp(_0x31771b)[_0x0009('0x19')](function(_0x3cc0b6){if(!_0x3cc0b6[_0x0009('0x1e')]){var _0x184f73={'messageId':_0x3cc0b6[_0x0009('0x24')][0x0]['apiMessageId']};if(!_0x364766[_0x0009('0x3b')]){_0x184f73['read']=!![];}return _0x5a0efe[_0x0009('0x1a')](_0x184f73);}else{return logger[_0x0009('0x1e')](_0x0009('0x2d'),_0x0009('0x2b'),_0x0009('0x68'),util[_0x0009('0x2c')](_0x3cc0b6['error'],{'showHidden':![],'depth':null}));}})[_0x0009('0x1d')](function(_0x2d3f55){return logger['error'](_0x0009('0x2d'),_0x0009('0x2b'),_0x0009('0x68'),util[_0x0009('0x2c')](_0x2d3f55,{'showHidden':![],'depth':null}));});}else{logger[_0x0009('0x1e')](_0x0009('0x2d'),_0x0009('0x2b'),_0x0009('0x68'),_0x0009('0x67'));}break;case _0x0009('0x6b'):if(_0x364766[_0x0009('0x5c')]){var _0x3f47b8={};var _0x3d8ad7={'method':_0x0009('0x38'),'uri':_0x0009('0x6c'),'headers':{'Authorization':_0x0009('0x6d')+_0x364766[_0x0009('0x5c')],'Content-Type':_0x0009('0x57')},'body':{'from':_0x364766['phone'],'to':_0x33b7be[_0x0009('0x23')],'text':_0x33b7be[_0x0009('0xf')]},'json':!![]};return rp(_0x3d8ad7)['then'](function(_0x9fa0a2){if(_0x9fa0a2[_0x0009('0x6e')]==0xca){_0x3f47b8[_0x0009('0x6f')]=_0x9fa0a2;var _0x372552={'method':_0x0009('0x38'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0x0009('0x6d')+_0x364766['apiKey'],'Content-Type':_0x0009('0x57')},'body':{'refid':_0x3f47b8[_0x0009('0x6f')][_0x0009('0x70')]},'json':!![]};return rp(_0x372552)[_0x0009('0x19')](function(_0x14c79c){_0x3f47b8[_0x0009('0x71')]=_0x14c79c;var _0x18333a={'messageId':_0x3f47b8[_0x0009('0x6f')][_0x0009('0x70')],'read':!![]};return _0x5a0efe[_0x0009('0x1a')](_0x18333a);});}else{return logger['error'](_0x0009('0x2d'),_0x0009('0x2b'),_0x0009('0x6b'),util[_0x0009('0x2c')](_0x9fa0a2,{'showHidden':![],'depth':null}));}})[_0x0009('0x1d')](function(_0x44abe0){return logger[_0x0009('0x1e')](_0x0009('0x2d'),_0x0009('0x2b'),'intelepeer',util[_0x0009('0x2c')](_0x44abe0,{'showHidden':![],'depth':null}));});}else{return logger[_0x0009('0x1e')](_0x0009('0x2d'),_0x0009('0x2b'),_0x0009('0x6b'),_0x0009('0x72'));}break;}}})['finally'](function(){_0x3759b3();});}else{_0x3759b3();}}},'charset':_0x0009('0x73'),'collate':_0x0009('0x74')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index c9827eb..4d3c1bd 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 _0x9bbd=['client','http','redis','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','CreateSmsMessage','SmsMessage','body','options','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x123df5,_0xf5ade6){var _0x437774=function(_0x4c77c0){while(--_0x4c77c0){_0x123df5['push'](_0x123df5['shift']());}};_0x437774(++_0xf5ade6);}(_0x9bbd,0x1ed));var _0xd9bb=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x9bbd[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0xd9bb('0x0'));var util=require(_0xd9bb('0x1'));var moment=require(_0xd9bb('0x2'));var BPromise=require('bluebird');var rs=require(_0xd9bb('0x3'));var fs=require('fs');var Redis=require(_0xd9bb('0x4'));var db=require(_0xd9bb('0x5'))['db'];var utils=require(_0xd9bb('0x6'));var logger=require(_0xd9bb('0x7'))(_0xd9bb('0x8'));var config=require(_0xd9bb('0x9'));var jayson=require(_0xd9bb('0xa'));var client=jayson[_0xd9bb('0xb')][_0xd9bb('0xc')]({'port':0x232a});config[_0xd9bb('0xd')]=_['defaults'](config['redis'],{'host':_0xd9bb('0xe'),'port':0x18eb});var socket=require(_0xd9bb('0xf'))(new Redis(config['redis']));require(_0xd9bb('0x10'))[_0xd9bb('0x11')](socket);function respondWithRpcPromise(_0x2f5282,_0x28b3ce,_0x49331a){return new BPromise(function(_0x481d3f,_0x194c02){return client[_0xd9bb('0x12')](_0x2f5282,_0x49331a)[_0xd9bb('0x13')](function(_0x1498eb){logger[_0xd9bb('0x14')]('SmsMessage,\x20%s,\x20%s',_0x28b3ce,_0xd9bb('0x15'));logger[_0xd9bb('0x16')](_0xd9bb('0x17'),_0x28b3ce,_0xd9bb('0x15'),JSON[_0xd9bb('0x18')](_0x1498eb));if(_0x1498eb[_0xd9bb('0x19')]){if(_0x1498eb['error'][_0xd9bb('0x1a')]===0x1f4){logger[_0xd9bb('0x19')](_0xd9bb('0x1b'),_0x28b3ce,_0x1498eb[_0xd9bb('0x19')][_0xd9bb('0x1c')]);return _0x194c02(_0x1498eb[_0xd9bb('0x19')][_0xd9bb('0x1c')]);}logger['error'](_0xd9bb('0x1b'),_0x28b3ce,_0x1498eb[_0xd9bb('0x19')][_0xd9bb('0x1c')]);return _0x481d3f(_0x1498eb[_0xd9bb('0x19')][_0xd9bb('0x1c')]);}else{logger[_0xd9bb('0x14')]('SmsMessage,\x20%s,\x20%s',_0x28b3ce,_0xd9bb('0x15'));_0x481d3f(_0x1498eb[_0xd9bb('0x1d')][_0xd9bb('0x1c')]);}})[_0xd9bb('0x1e')](function(_0xbec78b){logger[_0xd9bb('0x19')]('SmsMessage,\x20%s,\x20%s',_0x28b3ce,_0xbec78b);_0x194c02(_0xbec78b);});});}exports[_0xd9bb('0x1f')]=function(_0x44b411){var _0x2d6c07=this;return new Promise(function(_0x325667,_0x216aef){return db[_0xd9bb('0x20')]['create'](_0x44b411[_0xd9bb('0x21')],{'raw':_0x44b411[_0xd9bb('0x22')]?_0x44b411['options'][_0xd9bb('0x23')]===undefined?!![]:![]:!![]})['then'](function(_0x1558cf){logger[_0xd9bb('0x14')](_0xd9bb('0x1f'),_0x44b411);logger[_0xd9bb('0x16')]('CreateSmsMessage',_0x44b411,JSON['stringify'](_0x1558cf));_0x325667(_0x1558cf);})['catch'](function(_0x21bbfd){logger['error']('CreateSmsMessage',_0x21bbfd[_0xd9bb('0x1c')],_0x44b411);_0x216aef(_0x2d6c07[_0xd9bb('0x19')](0x1f4,_0x21bbfd[_0xd9bb('0x1c')]));});});}; \ No newline at end of file +var _0xc044=['then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','SmsMessage','create','options','CreateSmsMessage','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','redis','defaults','register'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xc044,0x1a3));var _0x4c04=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xc044[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x4c04('0x0'));var util=require(_0x4c04('0x1'));var moment=require(_0x4c04('0x2'));var BPromise=require('bluebird');var rs=require(_0x4c04('0x3'));var fs=require('fs');var Redis=require(_0x4c04('0x4'));var db=require(_0x4c04('0x5'))['db'];var utils=require(_0x4c04('0x6'));var logger=require(_0x4c04('0x7'))(_0x4c04('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x4c04('0x9')]({'port':0x232a});config[_0x4c04('0xa')]=_[_0x4c04('0xb')](config[_0x4c04('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4c04('0xa')]));require('./smsMessage.socket')[_0x4c04('0xc')](socket);function respondWithRpcPromise(_0x28b775,_0x4a56e5,_0x142073){return new BPromise(function(_0x4880b8,_0x40cd29){return client['request'](_0x28b775,_0x142073)[_0x4c04('0xd')](function(_0x53e4ab){logger['info'](_0x4c04('0xe'),_0x4a56e5,_0x4c04('0xf'));logger[_0x4c04('0x10')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4a56e5,_0x4c04('0xf'),JSON[_0x4c04('0x11')](_0x53e4ab));if(_0x53e4ab[_0x4c04('0x12')]){if(_0x53e4ab[_0x4c04('0x12')]['code']===0x1f4){logger[_0x4c04('0x12')](_0x4c04('0xe'),_0x4a56e5,_0x53e4ab[_0x4c04('0x12')]['message']);return _0x40cd29(_0x53e4ab[_0x4c04('0x12')][_0x4c04('0x13')]);}logger[_0x4c04('0x12')]('SmsMessage,\x20%s,\x20%s',_0x4a56e5,_0x53e4ab[_0x4c04('0x12')][_0x4c04('0x13')]);return _0x4880b8(_0x53e4ab['error'][_0x4c04('0x13')]);}else{logger[_0x4c04('0x14')]('SmsMessage,\x20%s,\x20%s',_0x4a56e5,_0x4c04('0xf'));_0x4880b8(_0x53e4ab[_0x4c04('0x15')][_0x4c04('0x13')]);}})[_0x4c04('0x16')](function(_0x284319){logger[_0x4c04('0x12')](_0x4c04('0xe'),_0x4a56e5,_0x284319);_0x40cd29(_0x284319);});});}exports['CreateSmsMessage']=function(_0x413321){var _0x403f58=this;return new Promise(function(_0x3e8405,_0x303aa2){return db[_0x4c04('0x17')][_0x4c04('0x18')](_0x413321['body'],{'raw':_0x413321[_0x4c04('0x19')]?_0x413321[_0x4c04('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x4c04('0xd')](function(_0x256478){logger[_0x4c04('0x14')]('CreateSmsMessage',_0x413321);logger[_0x4c04('0x10')](_0x4c04('0x1a'),_0x413321,JSON[_0x4c04('0x11')](_0x256478));_0x3e8405(_0x256478);})['catch'](function(_0x4d1821){logger[_0x4c04('0x12')](_0x4c04('0x1a'),_0x4d1821['message'],_0x413321);_0x303aa2(_0x403f58[_0x4c04('0x12')](0x1f4,_0x4d1821[_0x4c04('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index b7f4e44..38c4233 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 _0x1ad2=['length','smsMessage:','./smsMessage.events','save','remove','emit','register'];(function(_0x748fad,_0x2df0db){var _0xbd11f5=function(_0x34bd21){while(--_0x34bd21){_0x748fad['push'](_0x748fad['shift']());}};_0xbd11f5(++_0x2df0db);}(_0x1ad2,0x1bb));var _0x21ad=function(_0x482d72,_0x5c9d40){_0x482d72=_0x482d72-0x0;var _0x3d0673=_0x1ad2[_0x482d72];return _0x3d0673;};'use strict';var SmsMessageEvents=require(_0x21ad('0x0'));var events=[_0x21ad('0x1'),_0x21ad('0x2'),'update'];function createListener(_0x496baa,_0x1281ae){return function(_0x484b4d){_0x1281ae[_0x21ad('0x3')](_0x496baa,_0x484b4d);};}function removeListener(_0x1fac70,_0x57c2bf){return function(){SmsMessageEvents['removeListener'](_0x1fac70,_0x57c2bf);};}exports[_0x21ad('0x4')]=function(_0xf060cb){for(var _0x2643a9=0x0,_0x3a259e=events[_0x21ad('0x5')];_0x2643a9<_0x3a259e;_0x2643a9++){var _0x4990f7=events[_0x2643a9];var _0x1b146a=createListener(_0x21ad('0x6')+_0x4990f7,_0xf060cb);SmsMessageEvents['on'](_0x4990f7,_0x1b146a);}}; \ No newline at end of file +var _0x23d7=['remove','update','emit','removeListener','register','length','smsMessage:','./smsMessage.events'];(function(_0x4da387,_0x3eb782){var _0x15ed1e=function(_0x17b273){while(--_0x17b273){_0x4da387['push'](_0x4da387['shift']());}};_0x15ed1e(++_0x3eb782);}(_0x23d7,0x1c7));var _0x723d=function(_0x3bab09,_0x217c29){_0x3bab09=_0x3bab09-0x0;var _0x164376=_0x23d7[_0x3bab09];return _0x164376;};'use strict';var SmsMessageEvents=require(_0x723d('0x0'));var events=['save',_0x723d('0x1'),_0x723d('0x2')];function createListener(_0x413d37,_0x337257){return function(_0x58c623){_0x337257[_0x723d('0x3')](_0x413d37,_0x58c623);};}function removeListener(_0x2fa777,_0x5cd1ff){return function(){SmsMessageEvents[_0x723d('0x4')](_0x2fa777,_0x5cd1ff);};}exports[_0x723d('0x5')]=function(_0x4cdca9){for(var _0x348e3e=0x0,_0x402edb=events[_0x723d('0x6')];_0x348e3e<_0x402edb;_0x348e3e++){var _0x45b9e0=events[_0x348e3e];var _0x168997=createListener(_0x723d('0x7')+_0x45b9e0,_0x4cdca9);SmsMessageEvents['on'](_0x45b9e0,_0x168997);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index ece4c01..9420982 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 _0x2789=['/:id','update','delete','destroy','removeTeams','util','path','express','Router','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','addAgents','put'];(function(_0x3774c7,_0x361f2b){var _0x1db61e=function(_0x442a9e){while(--_0x442a9e){_0x3774c7['push'](_0x3774c7['shift']());}};_0x1db61e(++_0x361f2b);}(_0x2789,0x164));var _0x9278=function(_0x2fc941,_0x1ed2fe){_0x2fc941=_0x2fc941-0x0;var _0x5bfd9e=_0x2789[_0x2fc941];return _0x5bfd9e;};'use strict';var multer=require('multer');var util=require(_0x9278('0x0'));var path=require(_0x9278('0x1'));var timeout=require('connect-timeout');var express=require(_0x9278('0x2'));var router=express[_0x9278('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9278('0x4'));var controller=require(_0x9278('0x5'));router[_0x9278('0x6')]('/',auth[_0x9278('0x7')](),controller[_0x9278('0x8')]);router[_0x9278('0x6')](_0x9278('0x9'),auth[_0x9278('0x7')](),controller[_0x9278('0xa')]);router[_0x9278('0x6')]('/:id',auth[_0x9278('0x7')](),controller[_0x9278('0xb')]);router[_0x9278('0x6')]('/:id/members',auth[_0x9278('0x7')](),controller[_0x9278('0xc')]);router[_0x9278('0x6')](_0x9278('0xd'),auth[_0x9278('0x7')](),controller[_0x9278('0xe')]);router['get'](_0x9278('0xf'),auth[_0x9278('0x7')](),controller[_0x9278('0x10')]);router['post']('/',auth[_0x9278('0x7')](),controller[_0x9278('0x11')]);router[_0x9278('0x12')]('/:id/teams',auth['isAuthenticated'](),controller[_0x9278('0x13')]);router[_0x9278('0x12')](_0x9278('0xf'),auth[_0x9278('0x7')](),controller[_0x9278('0x14')]);router[_0x9278('0x15')](_0x9278('0x16'),auth[_0x9278('0x7')](),controller[_0x9278('0x17')]);router[_0x9278('0x18')](_0x9278('0x16'),auth[_0x9278('0x7')](),controller[_0x9278('0x19')]);router[_0x9278('0x18')](_0x9278('0xd'),auth['isAuthenticated'](),controller[_0x9278('0x1a')]);router['delete'](_0x9278('0xf'),auth[_0x9278('0x7')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xd748=['addTeams','addAgents','delete','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','getMembers','getTeams','/:id/users','getAgents','post','create','/:id/teams'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0xd748,0x1d9));var _0x8d74=function(_0x38b14f,_0xd08fa8){_0x38b14f=_0x38b14f-0x0;var _0x22a324=_0xd748[_0x38b14f];return _0x22a324;};'use strict';var multer=require(_0x8d74('0x0'));var util=require('util');var path=require(_0x8d74('0x1'));var timeout=require(_0x8d74('0x2'));var express=require(_0x8d74('0x3'));var router=express[_0x8d74('0x4')]();var auth=require(_0x8d74('0x5'));var interaction=require(_0x8d74('0x6'));var config=require(_0x8d74('0x7'));var controller=require('./smsQueue.controller');router[_0x8d74('0x8')]('/',auth[_0x8d74('0x9')](),controller[_0x8d74('0xa')]);router[_0x8d74('0x8')](_0x8d74('0xb'),auth[_0x8d74('0x9')](),controller[_0x8d74('0xc')]);router[_0x8d74('0x8')](_0x8d74('0xd'),auth[_0x8d74('0x9')](),controller['show']);router[_0x8d74('0x8')]('/:id/members',auth[_0x8d74('0x9')](),controller[_0x8d74('0xe')]);router[_0x8d74('0x8')]('/:id/teams',auth[_0x8d74('0x9')](),controller[_0x8d74('0xf')]);router[_0x8d74('0x8')](_0x8d74('0x10'),auth[_0x8d74('0x9')](),controller[_0x8d74('0x11')]);router[_0x8d74('0x12')]('/',auth[_0x8d74('0x9')](),controller[_0x8d74('0x13')]);router[_0x8d74('0x12')](_0x8d74('0x14'),auth[_0x8d74('0x9')](),controller[_0x8d74('0x15')]);router[_0x8d74('0x12')](_0x8d74('0x10'),auth[_0x8d74('0x9')](),controller[_0x8d74('0x16')]);router['put'](_0x8d74('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x8d74('0x17')]('/:id',auth[_0x8d74('0x9')](),controller['destroy']);router[_0x8d74('0x17')](_0x8d74('0x14'),auth[_0x8d74('0x9')](),controller['removeTeams']);router[_0x8d74('0x17')](_0x8d74('0x10'),auth[_0x8d74('0x9')](),controller[_0x8d74('0x18')]);module[_0x8d74('0x19')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 7aaa6ff..9c522ee 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 _0x7b19=['STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','exports'];(function(_0x39772f,_0x5605cb){var _0xc9edbf=function(_0x106a39){while(--_0x106a39){_0x39772f['push'](_0x39772f['shift']());}};_0xc9edbf(++_0x5605cb);}(_0x7b19,0x1b7));var _0x97b1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7b19[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x97b1('0x0')]={'name':{'type':Sequelize[_0x97b1('0x1')],'unique':_0x97b1('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x97b1('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x97b1('0x4')](_0x97b1('0x5'),_0x97b1('0x6'),_0x97b1('0x7'))}}; \ No newline at end of file +var _0xfa06=['beepall','sequelize','exports','name','STRING','INTEGER','ENUM'];(function(_0x1e3db2,_0x1f181a){var _0x5e8f54=function(_0x46c380){while(--_0x46c380){_0x1e3db2['push'](_0x1e3db2['shift']());}};_0x5e8f54(++_0x1f181a);}(_0xfa06,0x127));var _0x6fa0=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xfa06[_0x521929];return _0x632436;};'use strict';var Sequelize=require(_0x6fa0('0x0'));module[_0x6fa0('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x6fa0('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6fa0('0x3')]},'timeout':{'type':Sequelize[_0x6fa0('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6fa0('0x5')]('rrmemory',_0x6fa0('0x6'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 724e132..da0d87d 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 _0x1b69=['../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsQueue.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','then','destroy','get','SmsQueues','UserProfileResource','error','stack','name','send','index','SmsQueue','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','key','VIRTUAL','field','options','includeAll','include','rows','catch','show','find','create','body','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserSmsQueue','nolimit','SmsQueueId','map','findAll','findAndCountAll','UserId','agent','smsPause','updatedAt','%s/%s','SIP','createdAt','getTeams','Team','addTeams','teams','User','Agents','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','ids','select','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','SELECT','every','includes','all','union','compact','value','userSmsQueue:remove','addAgents','spread','removeAgents','isArray','getAgents','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service'];(function(_0x1cd5fb,_0x1b0dbf){var _0x38484e=function(_0x318a58){while(--_0x318a58){_0x1cd5fb['push'](_0x1cd5fb['shift']());}};_0x38484e(++_0x1b0dbf);}(_0x1b69,0x190));var _0x91b6=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x1b69[_0x5bd426];return _0x23a7eb;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x91b6('0x0'));var jsonpatch=require(_0x91b6('0x1'));var rp=require(_0x91b6('0x2'));var moment=require('moment');var BPromise=require(_0x91b6('0x3'));var Mustache=require(_0x91b6('0x4'));var util=require(_0x91b6('0x5'));var path=require(_0x91b6('0x6'));var sox=require(_0x91b6('0x7'));var csv=require(_0x91b6('0x8'));var ejs=require(_0x91b6('0x9'));var fs=require('fs');var _=require(_0x91b6('0xa'));var squel=require(_0x91b6('0xb'));var crypto=require(_0x91b6('0xc'));var jsforce=require(_0x91b6('0xd'));var deskjs=require(_0x91b6('0xe'));var toCsv=require(_0x91b6('0x8'));var querystring=require(_0x91b6('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x91b6('0x10'));var qs=require(_0x91b6('0x11'));var hardwareService=require(_0x91b6('0x12'));var logger=require('../../config/logger')(_0x91b6('0x13'));var utils=require(_0x91b6('0x14'));var config=require(_0x91b6('0x15'));var db=require(_0x91b6('0x16'))['db'];config[_0x91b6('0x17')]=_[_0x91b6('0x18')](config['redis'],{'host':_0x91b6('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x91b6('0x17')]));require(_0x91b6('0x1a'))[_0x91b6('0x1b')](socket);function respondWithStatusCode(_0x42dc29,_0x4c65e5){_0x4c65e5=_0x4c65e5||0xcc;return function(_0x8ce679){if(_0x8ce679){return _0x42dc29[_0x91b6('0x1c')](_0x4c65e5);}return _0x42dc29[_0x91b6('0x1d')](_0x4c65e5)[_0x91b6('0x1e')]();};}function respondWithResult(_0x43acc5,_0x5162ee){_0x5162ee=_0x5162ee||0xc8;return function(_0x29841d){if(_0x29841d){return _0x43acc5[_0x91b6('0x1d')](_0x5162ee)[_0x91b6('0x1f')](_0x29841d);}};}function respondWithFilteredResult(_0x15791c,_0x571b04){return function(_0x54f004){if(_0x54f004){var _0x4749ac=_0x54f004[_0x91b6('0x20')],_0xf29bcf=_0x571b04[_0x91b6('0x21')],_0x191b17=_0x571b04['offset']+_0x571b04[_0x91b6('0x22')],_0x1693e5;if(_0x191b17>=_0x4749ac){_0x191b17=_0x4749ac;_0x1693e5=0xc8;}else{_0x1693e5=0xce;}_0x15791c['status'](_0x1693e5);return _0x15791c[_0x91b6('0x23')](_0x91b6('0x24'),_0xf29bcf+'-'+_0x191b17+'/'+_0x4749ac)[_0x91b6('0x1f')](_0x54f004);}return null;};}function patchUpdates(_0x294422){return function(_0x46e684){try{jsonpatch[_0x91b6('0x25')](_0x46e684,_0x294422,!![]);}catch(_0x4297f1){return BPromise[_0x91b6('0x26')](_0x4297f1);}return _0x46e684['save']();};}function saveUpdates(_0x28fd3d,_0x1b877e){return function(_0xe34dc0){if(_0xe34dc0){return _0xe34dc0['update'](_0x28fd3d)[_0x91b6('0x27')](function(_0x2bba08){return _0x2bba08;});}return null;};}function removeEntity(_0x4e1e2c,_0x53675b){return function(_0x2b5e5c){if(_0x2b5e5c){return _0x2b5e5c[_0x91b6('0x28')]()[_0x91b6('0x27')](function(){var _0x18ea3a=_0x2b5e5c[_0x91b6('0x29')]({'plain':!![]});var _0x582775=_0x91b6('0x2a');return db[_0x91b6('0x2b')]['destroy']({'where':{'type':_0x582775,'resourceId':_0x18ea3a['id']}})[_0x91b6('0x27')](function(){return _0x2b5e5c;});})[_0x91b6('0x27')](function(){_0x4e1e2c[_0x91b6('0x1d')](0xcc)[_0x91b6('0x1e')]();});}};}function handleEntityNotFound(_0x737643,_0x239513){return function(_0x3fada5){if(!_0x3fada5){_0x737643[_0x91b6('0x1c')](0x194);}return _0x3fada5;};}function handleError(_0x3465b5,_0x445334){_0x445334=_0x445334||0x1f4;return function(_0x51d011){logger[_0x91b6('0x2c')](_0x51d011[_0x91b6('0x2d')]);if(_0x51d011[_0x91b6('0x2e')]){delete _0x51d011[_0x91b6('0x2e')];}_0x3465b5[_0x91b6('0x1d')](_0x445334)[_0x91b6('0x2f')](_0x51d011);};}exports[_0x91b6('0x30')]=function(_0x2ba3a7,_0x15485d){var _0x2c5804={},_0x2b9cb2={},_0x3fa8e5={'count':0x0,'rows':[]};var _0x3c76e3=db[_0x91b6('0x31')][_0x91b6('0x32')];_0x2b9cb2[_0x91b6('0x33')]=_[_0x91b6('0x34')](_0x3c76e3);_0x2b9cb2[_0x91b6('0x35')]=_[_0x91b6('0x34')](_0x2ba3a7[_0x91b6('0x35')]);_0x2b9cb2[_0x91b6('0x36')]=_[_0x91b6('0x37')](_0x2b9cb2['model'],_0x2b9cb2[_0x91b6('0x35')]);_0x2c5804[_0x91b6('0x38')]=_[_0x91b6('0x37')](_0x2b9cb2[_0x91b6('0x33')],qs['fields'](_0x2ba3a7['query'][_0x91b6('0x39')]));_0x2c5804['attributes']=_0x2c5804[_0x91b6('0x38')][_0x91b6('0x3a')]?_0x2c5804['attributes']:_0x2b9cb2['model'];if(!_0x2ba3a7[_0x91b6('0x35')][_0x91b6('0x3b')]('nolimit')){_0x2c5804[_0x91b6('0x22')]=qs[_0x91b6('0x22')](_0x2ba3a7[_0x91b6('0x35')]['limit']);_0x2c5804[_0x91b6('0x21')]=qs[_0x91b6('0x21')](_0x2ba3a7[_0x91b6('0x35')]['offset']);}_0x2c5804[_0x91b6('0x3c')]=qs[_0x91b6('0x3d')](_0x2ba3a7[_0x91b6('0x35')][_0x91b6('0x3d')]);_0x2c5804[_0x91b6('0x3e')]=qs[_0x91b6('0x36')](_[_0x91b6('0x3f')](_0x2ba3a7[_0x91b6('0x35')],_0x2b9cb2[_0x91b6('0x36')]));if(_0x2ba3a7[_0x91b6('0x35')][_0x91b6('0x40')]){_0x2c5804[_0x91b6('0x3e')]=_[_0x91b6('0x41')](_0x2c5804['where'],{'$or':_['map'](_0x3c76e3,function(_0x1c1460){if(_0x1c1460['type'][_0x91b6('0x42')]!==_0x91b6('0x43')){var _0x472ed9={};_0x472ed9[_0x1c1460[_0x91b6('0x44')]]={'$like':'%'+_0x2ba3a7[_0x91b6('0x35')][_0x91b6('0x40')]+'%'};return _0x472ed9;}})});}_0x2c5804=_['merge']({},_0x2c5804,_0x2ba3a7[_0x91b6('0x45')]);var _0x41d4bf={'where':_0x2c5804['where']};return db[_0x91b6('0x31')][_0x91b6('0x20')](_0x41d4bf)['then'](function(_0x4c04c7){_0x3fa8e5[_0x91b6('0x20')]=_0x4c04c7;if(_0x2ba3a7[_0x91b6('0x35')][_0x91b6('0x46')]){_0x2c5804[_0x91b6('0x47')]=[{'all':!![]}];}return db[_0x91b6('0x31')]['findAll'](_0x2c5804);})[_0x91b6('0x27')](function(_0x22c634){_0x3fa8e5[_0x91b6('0x48')]=_0x22c634;return _0x3fa8e5;})['then'](respondWithFilteredResult(_0x15485d,_0x2c5804))[_0x91b6('0x49')](handleError(_0x15485d,null));};exports[_0x91b6('0x4a')]=function(_0x4bd575,_0x171a21){var _0xc71a1a={'raw':!![],'where':{'id':_0x4bd575['params']['id']}},_0x2b59e8={};_0x2b59e8[_0x91b6('0x33')]=_[_0x91b6('0x34')](db[_0x91b6('0x31')][_0x91b6('0x32')]);_0x2b59e8[_0x91b6('0x35')]=_['keys'](_0x4bd575[_0x91b6('0x35')]);_0x2b59e8[_0x91b6('0x36')]=_['intersection'](_0x2b59e8['model'],_0x2b59e8['query']);_0xc71a1a[_0x91b6('0x38')]=_[_0x91b6('0x37')](_0x2b59e8[_0x91b6('0x33')],qs[_0x91b6('0x39')](_0x4bd575['query']['fields']));_0xc71a1a[_0x91b6('0x38')]=_0xc71a1a[_0x91b6('0x38')][_0x91b6('0x3a')]?_0xc71a1a[_0x91b6('0x38')]:_0x2b59e8[_0x91b6('0x33')];if(_0x4bd575['query'][_0x91b6('0x46')]){_0xc71a1a[_0x91b6('0x47')]=[{'all':!![]}];}_0xc71a1a=_[_0x91b6('0x41')]({},_0xc71a1a,_0x4bd575[_0x91b6('0x45')]);return db['SmsQueue'][_0x91b6('0x4b')](_0xc71a1a)['then'](handleEntityNotFound(_0x171a21,null))[_0x91b6('0x27')](respondWithResult(_0x171a21,null))['catch'](handleError(_0x171a21,null));};exports[_0x91b6('0x4c')]=function(_0x1c125f,_0x484939){return db[_0x91b6('0x31')][_0x91b6('0x4c')](_0x1c125f[_0x91b6('0x4d')],{})['then'](function(_0x54dc6c){var _0x93ad8b=_0x1c125f['user'][_0x91b6('0x29')]({'plain':!![]});if(!_0x93ad8b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x93ad8b['role']==='user'){var _0x4c82a=_0x54dc6c[_0x91b6('0x29')]({'plain':!![]});var _0x1fa30f=_0x91b6('0x2a');return db[_0x91b6('0x4e')][_0x91b6('0x4b')]({'where':{'name':_0x1fa30f,'userProfileId':_0x93ad8b[_0x91b6('0x4f')]},'raw':!![]})['then'](function(_0x3246ae){if(_0x3246ae&&_0x3246ae[_0x91b6('0x50')]===0x0){return db[_0x91b6('0x2b')]['create']({'name':_0x4c82a['name'],'resourceId':_0x4c82a['id'],'type':_0x3246ae[_0x91b6('0x2e')],'sectionId':_0x3246ae['id']},{})[_0x91b6('0x27')](function(){return _0x54dc6c;});}else{return _0x54dc6c;}})['catch'](function(_0x19b40e){logger[_0x91b6('0x2c')](_0x91b6('0x51'),_0x19b40e);throw _0x19b40e;});}return _0x54dc6c;})[_0x91b6('0x27')](respondWithResult(_0x484939,0xc9))[_0x91b6('0x49')](handleError(_0x484939,null));};exports['update']=function(_0x158e85,_0xf2fbd7){if(_0x158e85[_0x91b6('0x4d')]['id']){delete _0x158e85[_0x91b6('0x4d')]['id'];}return db[_0x91b6('0x31')][_0x91b6('0x4b')]({'where':{'id':_0x158e85[_0x91b6('0x52')]['id']}})['then'](handleEntityNotFound(_0xf2fbd7,null))[_0x91b6('0x27')](saveUpdates(_0x158e85['body'],null))[_0x91b6('0x27')](respondWithResult(_0xf2fbd7,null))[_0x91b6('0x49')](handleError(_0xf2fbd7,null));};exports[_0x91b6('0x28')]=function(_0x2c1fcc,_0x1a9167){return db[_0x91b6('0x31')]['find']({'where':{'id':_0x2c1fcc[_0x91b6('0x52')]['id']}})[_0x91b6('0x27')](handleEntityNotFound(_0x1a9167,null))[_0x91b6('0x27')](removeEntity(_0x1a9167,null))[_0x91b6('0x49')](handleError(_0x1a9167,null));};exports['describe']=function(_0x29b7ab,_0x2bc86c){return db[_0x91b6('0x31')][_0x91b6('0x53')]()['then'](respondWithResult(_0x2bc86c,null))[_0x91b6('0x49')](handleError(_0x2bc86c,null));};exports[_0x91b6('0x54')]=function(_0x55ff1a,_0x352719,_0x282678){var _0x2a15cb={'raw':!![],'where':{}},_0x4b064c={},_0x4f4c87;return db[_0x91b6('0x31')][_0x91b6('0x55')]({'where':{'id':_0x55ff1a[_0x91b6('0x52')]['id']}})[_0x91b6('0x27')](handleEntityNotFound(_0x352719,null))[_0x91b6('0x27')](function(_0x17a249){if(_0x17a249){_0x4f4c87=_0x17a249[_0x91b6('0x29')]({'plain':!![]});_0x4b064c[_0x91b6('0x33')]=_[_0x91b6('0x34')](db[_0x91b6('0x56')][_0x91b6('0x32')]);_0x4b064c[_0x91b6('0x35')]=_[_0x91b6('0x34')](_0x55ff1a[_0x91b6('0x35')]);_0x4b064c[_0x91b6('0x36')]=_[_0x91b6('0x37')](_0x4b064c['model'],_0x4b064c[_0x91b6('0x35')]);_0x2a15cb['attributes']=_['intersection'](_0x4b064c[_0x91b6('0x33')],qs[_0x91b6('0x39')](_0x55ff1a[_0x91b6('0x35')][_0x91b6('0x39')]));_0x2a15cb[_0x91b6('0x38')]=_0x2a15cb[_0x91b6('0x38')][_0x91b6('0x3a')]?_0x2a15cb[_0x91b6('0x38')]:_0x4b064c[_0x91b6('0x33')];if(!_0x55ff1a[_0x91b6('0x35')]['hasOwnProperty'](_0x91b6('0x57'))){_0x2a15cb['limit']=qs[_0x91b6('0x22')](_0x55ff1a['query'][_0x91b6('0x22')]);_0x2a15cb[_0x91b6('0x21')]=qs[_0x91b6('0x21')](_0x55ff1a[_0x91b6('0x35')]['offset']);}_0x2a15cb['order']=qs[_0x91b6('0x3d')](_0x55ff1a[_0x91b6('0x35')][_0x91b6('0x3d')]);_0x2a15cb['where']=qs['filters'](_[_0x91b6('0x3f')](_0x55ff1a[_0x91b6('0x35')],_0x4b064c[_0x91b6('0x36')]));_0x2a15cb['where'][_0x91b6('0x58')]=_0x17a249['id'];if(_0x55ff1a[_0x91b6('0x35')][_0x91b6('0x40')]){_0x2a15cb['where']=_[_0x91b6('0x41')](_0x2a15cb[_0x91b6('0x3e')],{'$or':_[_0x91b6('0x59')](_0x2a15cb[_0x91b6('0x38')],function(_0x10a1b9){var _0x200535={};_0x200535[_0x10a1b9]={'$like':'%'+_0x55ff1a['query'][_0x91b6('0x40')]+'%'};return _0x200535;})});}_0x2a15cb=_[_0x91b6('0x41')]({},_0x2a15cb,_0x55ff1a[_0x91b6('0x45')]);return db[_0x91b6('0x56')][_0x91b6('0x5a')](_0x2a15cb);}})[_0x91b6('0x27')](function(_0x53d871){if(_0x53d871){return db['User'][_0x91b6('0x5b')]({'where':{'id':_[_0x91b6('0x59')](_0x53d871,_0x91b6('0x5c')),'role':_0x91b6('0x5d')},'attributes':['id',_0x91b6('0x2e'),_0x91b6('0x5e'),_0x91b6('0x5f'),'createdAt']});}})[_0x91b6('0x27')](function(_0xc13ece){if(_0xc13ece){return{'count':_0xc13ece[_0x91b6('0x20')],'rows':_[_0x91b6('0x59')](_0xc13ece[_0x91b6('0x48')],function(_0x3e51a1){return{'membername':_0x3e51a1[_0x91b6('0x2e')],'UserId':_0x3e51a1['id'],'queue_name':_0x4f4c87['name'],'SmsQueueId':_0x4f4c87['id'],'interface':util['format'](_0x91b6('0x60'),_0x91b6('0x61'),_0x3e51a1['name']),'penalty':0x0,'paused':_0x3e51a1[_0x91b6('0x5e')],'createdAt':_0x3e51a1[_0x91b6('0x62')],'updatedAt':_0x3e51a1[_0x91b6('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x91b6('0x27')](respondWithFilteredResult(_0x352719,_0x2a15cb))[_0x91b6('0x49')](handleError(_0x352719,null));};exports[_0x91b6('0x63')]=function(_0x20a8b9,_0xb47f2f,_0x40173f){var _0x3532bc={};var _0x44a26d={};var _0xdbbfd3;var _0x5c8040;return db[_0x91b6('0x31')][_0x91b6('0x55')]({'where':{'id':_0x20a8b9[_0x91b6('0x52')]['id']}})['then'](handleEntityNotFound(_0xb47f2f,null))['then'](function(_0x2356a7){if(_0x2356a7){_0xdbbfd3=_0x2356a7;_0x44a26d[_0x91b6('0x33')]=_[_0x91b6('0x34')](db[_0x91b6('0x64')][_0x91b6('0x32')]);_0x44a26d[_0x91b6('0x35')]=_[_0x91b6('0x34')](_0x20a8b9[_0x91b6('0x35')]);_0x44a26d[_0x91b6('0x36')]=_['intersection'](_0x44a26d[_0x91b6('0x33')],_0x44a26d['query']);_0x3532bc['attributes']=_[_0x91b6('0x37')](_0x44a26d[_0x91b6('0x33')],qs[_0x91b6('0x39')](_0x20a8b9[_0x91b6('0x35')][_0x91b6('0x39')]));_0x3532bc[_0x91b6('0x38')]=_0x3532bc[_0x91b6('0x38')][_0x91b6('0x3a')]?_0x3532bc['attributes']:_0x44a26d[_0x91b6('0x33')];_0x3532bc[_0x91b6('0x3c')]=qs[_0x91b6('0x3d')](_0x20a8b9['query'][_0x91b6('0x3d')]);_0x3532bc[_0x91b6('0x3e')]=qs['filters'](_['pick'](_0x20a8b9['query'],_0x44a26d[_0x91b6('0x36')]));if(_0x20a8b9[_0x91b6('0x35')][_0x91b6('0x40')]){_0x3532bc[_0x91b6('0x3e')]=_[_0x91b6('0x41')](_0x3532bc[_0x91b6('0x3e')],{'$or':_[_0x91b6('0x59')](_0x3532bc[_0x91b6('0x38')],function(_0x34e2a5){var _0x2834b6={};_0x2834b6[_0x34e2a5]={'$like':'%'+_0x20a8b9[_0x91b6('0x35')][_0x91b6('0x40')]+'%'};return _0x2834b6;})});}_0x3532bc=_['merge']({},_0x3532bc,_0x20a8b9[_0x91b6('0x45')]);return _0xdbbfd3['getTeams'](_0x3532bc);}})[_0x91b6('0x27')](function(_0x4286b7){if(_0x4286b7){_0x5c8040=_0x4286b7['length'];if(!_0x20a8b9[_0x91b6('0x35')][_0x91b6('0x3b')](_0x91b6('0x57'))){_0x3532bc[_0x91b6('0x22')]=qs['limit'](_0x20a8b9['query'][_0x91b6('0x22')]);_0x3532bc[_0x91b6('0x21')]=qs['offset'](_0x20a8b9[_0x91b6('0x35')]['offset']);}return _0xdbbfd3[_0x91b6('0x63')](_0x3532bc);}})[_0x91b6('0x27')](function(_0x56c184){if(_0x56c184){return _0x56c184?{'count':_0x5c8040,'rows':_0x56c184}:null;}})['then'](respondWithResult(_0xb47f2f,null))[_0x91b6('0x49')](handleError(_0xb47f2f,null));};exports[_0x91b6('0x65')]=function(_0x507c93,_0x3fa242,_0xdfef72){var _0x3959b0=_0x507c93[_0x91b6('0x4d')][_0x91b6('0x66')];return db[_0x91b6('0x64')][_0x91b6('0x5a')]({'where':{'id':_[_0x91b6('0x59')](_0x3959b0,'id')},'attributes':['id'],'include':[{'model':db[_0x91b6('0x67')],'as':_0x91b6('0x68'),'attributes':['id','name','online','voicePause',_0x91b6('0x69')],'raw':!![]}]})[_0x91b6('0x27')](function(_0x3d421b){if(_0x3d421b){var _0x5cfa80=_[_0x91b6('0x6a')](_0x3d421b,function(_0x1f17e2){var _0x34e83e=_0x1f17e2[_0x91b6('0x29')]({'plain':!![]});return _0x34e83e[_0x91b6('0x68')];});return db[_0x91b6('0x31')]['find']({'where':{'id':_0x507c93[_0x91b6('0x52')]['id']}})[_0x91b6('0x27')](function(_0x2732d9){return db[_0x91b6('0x6b')][_0x91b6('0x6c')](function(_0x3af395){return _0x2732d9[_0x91b6('0x65')](_['map'](_0x3959b0,'id'),{'transaction':_0x3af395})[_0x91b6('0x27')](function(){return BPromise[_0x91b6('0x6d')](_0x5cfa80,function(_0x1bc26b){return db['UserSmsQueue'][_0x91b6('0x6e')]({'where':{'UserId':_0x1bc26b['id'],'SmsQueueId':_0x507c93['params']['id']},'transaction':_0x3af395});});})[_0x91b6('0x27')](function(){_0x5cfa80[_0x91b6('0x6f')](function(_0xee843){socket[_0x91b6('0x70')](_0x91b6('0x71'),{'UserId':_0xee843['id'],'SmsQueueId':_0x2732d9['id']});});});});});}})['then'](respondWithStatusCode(_0x3fa242,null))['catch'](handleError(_0x3fa242,null));};exports[_0x91b6('0x72')]=function(_0x242f32,_0xecce5a,_0x32900c){return db[_0x91b6('0x64')][_0x91b6('0x5a')]({'where':{'id':_0x242f32[_0x91b6('0x35')][_0x91b6('0x73')]},'attributes':['id'],'include':[{'model':db[_0x91b6('0x67')],'as':_0x91b6('0x68'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xecce5a,null))[_0x91b6('0x27')](function(_0xc8159c){var _0x40fef8=_[_0x91b6('0x59')](_0xc8159c,'id');var _0x2b7c84=[];var _0x5b6c42=[];var _0x368e08=squel[_0x91b6('0x74')]();_0x368e08[_0x91b6('0x44')](_0x91b6('0x75'))[_0x91b6('0x76')]('team_has_sms_queues','tq')[_0x91b6('0x77')](_0x91b6('0x78'),'ut',_0x91b6('0x79'))[_0x91b6('0x3e')](_0x91b6('0x7a'),_0x242f32[_0x91b6('0x52')]['id']);for(var _0x2eb244=0x0;_0x2eb244<_0xc8159c[_0x91b6('0x3a')];_0x2eb244+=0x1){let _0x3c17e4=_0xc8159c[_0x2eb244];for(var _0x14daa=0x0;_0x14daa<_0x3c17e4[_0x91b6('0x68')]['length'];_0x14daa+=0x1){let _0x1097c9=_0x3c17e4['Agents'][_0x14daa];var _0x23e72d=_0x368e08[_0x91b6('0x7b')]();_0x23e72d[_0x91b6('0x3e')](_0x91b6('0x7c'),_0x1097c9['id']);_0x5b6c42[_0x91b6('0x7d')](db[_0x91b6('0x6b')][_0x91b6('0x35')](_0x23e72d['toString'](),{'type':db[_0x91b6('0x6b')]['QueryTypes'][_0x91b6('0x7e')]})[_0x91b6('0x27')](function(_0x5e9c91){if(_0x5e9c91[_0x91b6('0x3a')]===0x1){return _0x1097c9['id'];}else{var _0x4ad560=_[_0x91b6('0x7f')](_[_0x91b6('0x59')](_0x5e9c91,'TeamId'),function(_0x2cb71c){return _[_0x91b6('0x80')](_0x40fef8,_0x2cb71c);});if(_0x4ad560){return _0x1097c9['id'];}}}));}}return BPromise[_0x91b6('0x81')](_0x5b6c42)[_0x91b6('0x27')](function(_0x5e139c){_0x2b7c84=_(_0x2b7c84)[_0x91b6('0x82')](_0x5e139c)[_0x91b6('0x83')]()[_0x91b6('0x84')]();return db['SmsQueue'][_0x91b6('0x4b')]({'where':{'id':_0x242f32[_0x91b6('0x52')]['id']}})[_0x91b6('0x27')](function(_0x4f6804){return db['sequelize'][_0x91b6('0x6c')](function(_0x234c38){return _0x4f6804[_0x91b6('0x72')](_0x242f32[_0x91b6('0x35')][_0x91b6('0x73')],{'transaction':_0x234c38})['then'](function(){if(!_['isEmpty'](_0x2b7c84)){return _0x4f6804['removeAgents'](_0x2b7c84,{'transaction':_0x234c38});}})[_0x91b6('0x27')](function(){_0x2b7c84['forEach'](function(_0x22b2ba){socket['emit'](_0x91b6('0x85'),{'UserId':_0x22b2ba,'SmsQueueId':_0x4f6804['id']});});});});});});})['then'](respondWithStatusCode(_0xecce5a,null))[_0x91b6('0x49')](handleError(_0xecce5a,null));};exports[_0x91b6('0x86')]=function(_0x52dba2,_0x23c6ab,_0x1f9717){return db[_0x91b6('0x31')]['find']({'where':{'id':_0x52dba2['params']['id']}})[_0x91b6('0x27')](handleEntityNotFound(_0x23c6ab,null))[_0x91b6('0x27')](function(_0x2f9cd9){if(_0x2f9cd9){return _0x2f9cd9[_0x91b6('0x86')](_0x52dba2[_0x91b6('0x4d')][_0x91b6('0x73')],_['omit'](_0x52dba2[_0x91b6('0x4d')],[_0x91b6('0x73'),'id'])||{})[_0x91b6('0x87')](function(_0x5e28ab){for(var _0x222107=0x0;_0x222107<_0x52dba2[_0x91b6('0x4d')][_0x91b6('0x73')]['length'];_0x222107+=0x1){socket[_0x91b6('0x70')](_0x91b6('0x71'),{'UserId':_0x52dba2[_0x91b6('0x4d')][_0x91b6('0x73')][_0x222107],'SmsQueueId':_0x52dba2[_0x91b6('0x52')]['id']});}return _0x5e28ab;});}})[_0x91b6('0x27')](respondWithResult(_0x23c6ab,null))[_0x91b6('0x49')](handleError(_0x23c6ab,null));};exports[_0x91b6('0x88')]=function(_0x7498c5,_0x4e3695,_0x452aee){return db['SmsQueue'][_0x91b6('0x4b')]({'where':{'id':_0x7498c5[_0x91b6('0x52')]['id']}})[_0x91b6('0x27')](handleEntityNotFound(_0x4e3695,null))[_0x91b6('0x27')](function(_0x3decc8){if(_0x3decc8){return _0x3decc8[_0x91b6('0x88')](_0x7498c5[_0x91b6('0x35')][_0x91b6('0x73')])[_0x91b6('0x27')](function(){if(_[_0x91b6('0x89')](_0x7498c5[_0x91b6('0x35')][_0x91b6('0x73')])){for(var _0x33d498=0x0;_0x33d498<_0x7498c5[_0x91b6('0x35')][_0x91b6('0x73')][_0x91b6('0x3a')];_0x33d498+=0x1){socket[_0x91b6('0x70')](_0x91b6('0x85'),{'UserId':Number(_0x7498c5[_0x91b6('0x35')][_0x91b6('0x73')][_0x33d498]),'SmsQueueId':Number(_0x7498c5[_0x91b6('0x52')]['id'])});}}else{socket[_0x91b6('0x70')]('userSmsQueue:remove',{'UserId':Number(_0x7498c5['query'][_0x91b6('0x73')]),'SmsQueueId':Number(_0x7498c5[_0x91b6('0x52')]['id'])});}});}})[_0x91b6('0x27')](respondWithStatusCode(_0x4e3695,null))[_0x91b6('0x49')](handleError(_0x4e3695,null));};exports[_0x91b6('0x8a')]=function(_0x44baa7,_0x354506,_0x1dca42){var _0x5d016d={};var _0xa5024f={};var _0x5a92d0;var _0x55d4d9;return db[_0x91b6('0x31')]['findOne']({'where':{'id':_0x44baa7['params']['id']}})[_0x91b6('0x27')](handleEntityNotFound(_0x354506,null))[_0x91b6('0x27')](function(_0x538337){if(_0x538337){_0x5a92d0=_0x538337;_0xa5024f[_0x91b6('0x33')]=_[_0x91b6('0x34')](db[_0x91b6('0x67')][_0x91b6('0x32')]);_0xa5024f[_0x91b6('0x35')]=_[_0x91b6('0x34')](_0x44baa7[_0x91b6('0x35')]);_0xa5024f[_0x91b6('0x36')]=_[_0x91b6('0x37')](_0xa5024f[_0x91b6('0x33')],_0xa5024f['query']);_0x5d016d[_0x91b6('0x38')]=_[_0x91b6('0x37')](_0xa5024f[_0x91b6('0x33')],qs[_0x91b6('0x39')](_0x44baa7[_0x91b6('0x35')][_0x91b6('0x39')]));_0x5d016d['attributes']=_0x5d016d[_0x91b6('0x38')][_0x91b6('0x3a')]?_0x5d016d[_0x91b6('0x38')]:_0xa5024f[_0x91b6('0x33')];_0x5d016d[_0x91b6('0x3c')]=qs[_0x91b6('0x3d')](_0x44baa7[_0x91b6('0x35')]['sort']);_0x5d016d[_0x91b6('0x3e')]=qs[_0x91b6('0x36')](_[_0x91b6('0x3f')](_0x44baa7[_0x91b6('0x35')],_0xa5024f[_0x91b6('0x36')]));if(_0x44baa7[_0x91b6('0x35')][_0x91b6('0x40')]){_0x5d016d[_0x91b6('0x3e')]=_[_0x91b6('0x41')](_0x5d016d[_0x91b6('0x3e')],{'$or':_['map'](_0x5d016d['attributes'],function(_0x16dbd4){var _0x3728d5={};_0x3728d5[_0x16dbd4]={'$like':'%'+_0x44baa7[_0x91b6('0x35')][_0x91b6('0x40')]+'%'};return _0x3728d5;})});}_0x5d016d=_[_0x91b6('0x41')]({},_0x5d016d,_0x44baa7[_0x91b6('0x45')]);return _0x5a92d0[_0x91b6('0x8a')](_0x5d016d);}})['then'](function(_0x262428){if(_0x262428){_0x55d4d9=_0x262428[_0x91b6('0x3a')];if(!_0x44baa7['query'][_0x91b6('0x3b')](_0x91b6('0x57'))){_0x5d016d[_0x91b6('0x22')]=qs[_0x91b6('0x22')](_0x44baa7[_0x91b6('0x35')][_0x91b6('0x22')]);_0x5d016d[_0x91b6('0x21')]=qs['offset'](_0x44baa7['query'][_0x91b6('0x21')]);}return _0x5a92d0['getAgents'](_0x5d016d);}})[_0x91b6('0x27')](function(_0x5ecd82){if(_0x5ecd82){return _0x5ecd82?{'count':_0x55d4d9,'rows':_0x5ecd82}:null;}})['then'](respondWithResult(_0x354506,null))[_0x91b6('0x49')](handleError(_0x354506,null));}; \ No newline at end of file +var _0xe93b=['removeTeams','ids','User','field','from','team_has_sms_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','addAgents','spread','isArray','userSmsQueue:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','./smsQueue.socket','register','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','SmsQueues','UserProfileResource','error','stack','name','index','SmsQueue','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','map','UserSmsQueue','findAndCountAll','UserId','agent','smsPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','addTeams','teams','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userSmsQueue:save'];(function(_0x25a771,_0x5cfb2e){var _0x168bb7=function(_0x25ccf8){while(--_0x25ccf8){_0x25a771['push'](_0x25a771['shift']());}};_0x168bb7(++_0x5cfb2e);}(_0xe93b,0x1c2));var _0xbe93=function(_0x2f79d6,_0x1fbfb4){_0x2f79d6=_0x2f79d6-0x0;var _0xd44f41=_0xe93b[_0x2f79d6];return _0xd44f41;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbe93('0x0'));var rimraf=require(_0xbe93('0x1'));var zipdir=require(_0xbe93('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbe93('0x3'));var moment=require(_0xbe93('0x4'));var BPromise=require(_0xbe93('0x5'));var Mustache=require(_0xbe93('0x6'));var util=require(_0xbe93('0x7'));var path=require(_0xbe93('0x8'));var sox=require(_0xbe93('0x9'));var csv=require(_0xbe93('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbe93('0xb'));var squel=require(_0xbe93('0xc'));var crypto=require(_0xbe93('0xd'));var jsforce=require(_0xbe93('0xe'));var deskjs=require(_0xbe93('0xf'));var toCsv=require(_0xbe93('0xa'));var querystring=require(_0xbe93('0x10'));var Papa=require(_0xbe93('0x11'));var Redis=require(_0xbe93('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xbe93('0x13'));var hardwareService=require(_0xbe93('0x14'));var logger=require(_0xbe93('0x15'))(_0xbe93('0x16'));var utils=require(_0xbe93('0x17'));var config=require(_0xbe93('0x18'));var db=require('../../mysqldb')['db'];config[_0xbe93('0x19')]=_[_0xbe93('0x1a')](config[_0xbe93('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbe93('0x19')]));require(_0xbe93('0x1b'))[_0xbe93('0x1c')](socket);function respondWithStatusCode(_0x5c9c57,_0x527a2f){_0x527a2f=_0x527a2f||0xcc;return function(_0x24ae1c){if(_0x24ae1c){return _0x5c9c57[_0xbe93('0x1d')](_0x527a2f);}return _0x5c9c57[_0xbe93('0x1e')](_0x527a2f)[_0xbe93('0x1f')]();};}function respondWithResult(_0x2a4f52,_0x8749fa){_0x8749fa=_0x8749fa||0xc8;return function(_0x4cd008){if(_0x4cd008){return _0x2a4f52[_0xbe93('0x1e')](_0x8749fa)[_0xbe93('0x20')](_0x4cd008);}};}function respondWithFilteredResult(_0x481af3,_0x13f6f5){return function(_0x4506fc){if(_0x4506fc){var _0x4c2841=_0x4506fc['count'],_0x4cdbb9=_0x13f6f5[_0xbe93('0x21')],_0x4447d6=_0x13f6f5[_0xbe93('0x21')]+_0x13f6f5[_0xbe93('0x22')],_0x37312e;if(_0x4447d6>=_0x4c2841){_0x4447d6=_0x4c2841;_0x37312e=0xc8;}else{_0x37312e=0xce;}_0x481af3[_0xbe93('0x1e')](_0x37312e);return _0x481af3[_0xbe93('0x23')](_0xbe93('0x24'),_0x4cdbb9+'-'+_0x4447d6+'/'+_0x4c2841)[_0xbe93('0x20')](_0x4506fc);}return null;};}function patchUpdates(_0x4f7088){return function(_0x3758c8){try{jsonpatch[_0xbe93('0x25')](_0x3758c8,_0x4f7088,!![]);}catch(_0x1a60ea){return BPromise[_0xbe93('0x26')](_0x1a60ea);}return _0x3758c8[_0xbe93('0x27')]();};}function saveUpdates(_0x4c63bc,_0x9ff333){return function(_0x1321b8){if(_0x1321b8){return _0x1321b8[_0xbe93('0x28')](_0x4c63bc)[_0xbe93('0x29')](function(_0x118e87){return _0x118e87;});}return null;};}function removeEntity(_0x52ae45,_0x4d80ac){return function(_0x14629a){if(_0x14629a){return _0x14629a[_0xbe93('0x2a')]()[_0xbe93('0x29')](function(){var _0x1a3c60=_0x14629a['get']({'plain':!![]});var _0x26470f=_0xbe93('0x2b');return db[_0xbe93('0x2c')][_0xbe93('0x2a')]({'where':{'type':_0x26470f,'resourceId':_0x1a3c60['id']}})[_0xbe93('0x29')](function(){return _0x14629a;});})[_0xbe93('0x29')](function(){_0x52ae45[_0xbe93('0x1e')](0xcc)[_0xbe93('0x1f')]();});}};}function handleEntityNotFound(_0x28da32,_0x34bef0){return function(_0xdcf0c4){if(!_0xdcf0c4){_0x28da32[_0xbe93('0x1d')](0x194);}return _0xdcf0c4;};}function handleError(_0x4c3fce,_0x2dc1c9){_0x2dc1c9=_0x2dc1c9||0x1f4;return function(_0x431b88){logger[_0xbe93('0x2d')](_0x431b88[_0xbe93('0x2e')]);if(_0x431b88['name']){delete _0x431b88[_0xbe93('0x2f')];}_0x4c3fce['status'](_0x2dc1c9)['send'](_0x431b88);};}exports[_0xbe93('0x30')]=function(_0x2ccc40,_0x24f605){var _0x16bc0f={},_0x4fd4d1={},_0x50da57={'count':0x0,'rows':[]};var _0x4113cd=db[_0xbe93('0x31')][_0xbe93('0x32')];_0x4fd4d1[_0xbe93('0x33')]=_[_0xbe93('0x34')](_0x4113cd);_0x4fd4d1[_0xbe93('0x35')]=_[_0xbe93('0x34')](_0x2ccc40[_0xbe93('0x35')]);_0x4fd4d1[_0xbe93('0x36')]=_[_0xbe93('0x37')](_0x4fd4d1[_0xbe93('0x33')],_0x4fd4d1[_0xbe93('0x35')]);_0x16bc0f['attributes']=_['intersection'](_0x4fd4d1[_0xbe93('0x33')],qs[_0xbe93('0x38')](_0x2ccc40[_0xbe93('0x35')][_0xbe93('0x38')]));_0x16bc0f[_0xbe93('0x39')]=_0x16bc0f['attributes'][_0xbe93('0x3a')]?_0x16bc0f[_0xbe93('0x39')]:_0x4fd4d1['model'];if(!_0x2ccc40[_0xbe93('0x35')][_0xbe93('0x3b')](_0xbe93('0x3c'))){_0x16bc0f[_0xbe93('0x22')]=qs[_0xbe93('0x22')](_0x2ccc40[_0xbe93('0x35')][_0xbe93('0x22')]);_0x16bc0f[_0xbe93('0x21')]=qs['offset'](_0x2ccc40[_0xbe93('0x35')][_0xbe93('0x21')]);}_0x16bc0f[_0xbe93('0x3d')]=qs[_0xbe93('0x3e')](_0x2ccc40[_0xbe93('0x35')][_0xbe93('0x3e')]);_0x16bc0f[_0xbe93('0x3f')]=qs['filters'](_[_0xbe93('0x40')](_0x2ccc40[_0xbe93('0x35')],_0x4fd4d1[_0xbe93('0x36')]));if(_0x2ccc40[_0xbe93('0x35')][_0xbe93('0x41')]){_0x16bc0f[_0xbe93('0x3f')]=_[_0xbe93('0x42')](_0x16bc0f[_0xbe93('0x3f')],{'$or':_['map'](_0x4113cd,function(_0x292e8b){if(_0x292e8b[_0xbe93('0x43')][_0xbe93('0x44')]!==_0xbe93('0x45')){var _0x150add={};_0x150add[_0x292e8b['field']]={'$like':'%'+_0x2ccc40['query'][_0xbe93('0x41')]+'%'};return _0x150add;}})});}_0x16bc0f=_[_0xbe93('0x42')]({},_0x16bc0f,_0x2ccc40[_0xbe93('0x46')]);var _0x36d51b={'where':_0x16bc0f[_0xbe93('0x3f')]};return db[_0xbe93('0x31')][_0xbe93('0x47')](_0x36d51b)[_0xbe93('0x29')](function(_0x5856d9){_0x50da57[_0xbe93('0x47')]=_0x5856d9;if(_0x2ccc40[_0xbe93('0x35')][_0xbe93('0x48')]){_0x16bc0f[_0xbe93('0x49')]=[{'all':!![]}];}return db['SmsQueue'][_0xbe93('0x4a')](_0x16bc0f);})[_0xbe93('0x29')](function(_0x16e37f){_0x50da57[_0xbe93('0x4b')]=_0x16e37f;return _0x50da57;})['then'](respondWithFilteredResult(_0x24f605,_0x16bc0f))[_0xbe93('0x4c')](handleError(_0x24f605,null));};exports[_0xbe93('0x4d')]=function(_0x232825,_0x277daa){var _0x1eb49d={'raw':!![],'where':{'id':_0x232825[_0xbe93('0x4e')]['id']}},_0xe35b66={};_0xe35b66['model']=_[_0xbe93('0x34')](db[_0xbe93('0x31')][_0xbe93('0x32')]);_0xe35b66[_0xbe93('0x35')]=_[_0xbe93('0x34')](_0x232825[_0xbe93('0x35')]);_0xe35b66[_0xbe93('0x36')]=_[_0xbe93('0x37')](_0xe35b66[_0xbe93('0x33')],_0xe35b66[_0xbe93('0x35')]);_0x1eb49d[_0xbe93('0x39')]=_['intersection'](_0xe35b66[_0xbe93('0x33')],qs[_0xbe93('0x38')](_0x232825[_0xbe93('0x35')][_0xbe93('0x38')]));_0x1eb49d[_0xbe93('0x39')]=_0x1eb49d['attributes'][_0xbe93('0x3a')]?_0x1eb49d[_0xbe93('0x39')]:_0xe35b66[_0xbe93('0x33')];if(_0x232825[_0xbe93('0x35')]['includeAll']){_0x1eb49d['include']=[{'all':!![]}];}_0x1eb49d=_['merge']({},_0x1eb49d,_0x232825[_0xbe93('0x46')]);return db['SmsQueue'][_0xbe93('0x4f')](_0x1eb49d)[_0xbe93('0x29')](handleEntityNotFound(_0x277daa,null))[_0xbe93('0x29')](respondWithResult(_0x277daa,null))['catch'](handleError(_0x277daa,null));};exports[_0xbe93('0x50')]=function(_0x5d780b,_0x2fe346){return db[_0xbe93('0x31')][_0xbe93('0x50')](_0x5d780b[_0xbe93('0x51')],{})['then'](function(_0x3c3bc6){var _0x45a021=_0x5d780b['user'][_0xbe93('0x52')]({'plain':!![]});if(!_0x45a021)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x45a021['role']==='user'){var _0x2db977=_0x3c3bc6['get']({'plain':!![]});var _0x1c8cd9='SmsQueues';return db[_0xbe93('0x53')]['find']({'where':{'name':_0x1c8cd9,'userProfileId':_0x45a021['userProfileId']},'raw':!![]})['then'](function(_0x4ad90e){if(_0x4ad90e&&_0x4ad90e[_0xbe93('0x54')]===0x0){return db['UserProfileResource'][_0xbe93('0x50')]({'name':_0x2db977[_0xbe93('0x2f')],'resourceId':_0x2db977['id'],'type':_0x4ad90e[_0xbe93('0x2f')],'sectionId':_0x4ad90e['id']},{})['then'](function(){return _0x3c3bc6;});}else{return _0x3c3bc6;}})[_0xbe93('0x4c')](function(_0xc17d7a){logger['error'](_0xbe93('0x55'),_0xc17d7a);throw _0xc17d7a;});}return _0x3c3bc6;})[_0xbe93('0x29')](respondWithResult(_0x2fe346,0xc9))['catch'](handleError(_0x2fe346,null));};exports[_0xbe93('0x28')]=function(_0x3d8cc6,_0x5f843){if(_0x3d8cc6[_0xbe93('0x51')]['id']){delete _0x3d8cc6[_0xbe93('0x51')]['id'];}return db[_0xbe93('0x31')][_0xbe93('0x4f')]({'where':{'id':_0x3d8cc6[_0xbe93('0x4e')]['id']}})[_0xbe93('0x29')](handleEntityNotFound(_0x5f843,null))['then'](saveUpdates(_0x3d8cc6[_0xbe93('0x51')],null))['then'](respondWithResult(_0x5f843,null))['catch'](handleError(_0x5f843,null));};exports[_0xbe93('0x2a')]=function(_0x486930,_0x926251){return db['SmsQueue'][_0xbe93('0x4f')]({'where':{'id':_0x486930[_0xbe93('0x4e')]['id']}})[_0xbe93('0x29')](handleEntityNotFound(_0x926251,null))['then'](removeEntity(_0x926251,null))[_0xbe93('0x4c')](handleError(_0x926251,null));};exports[_0xbe93('0x56')]=function(_0xabeff8,_0x4b3b57){return db[_0xbe93('0x31')][_0xbe93('0x56')]()[_0xbe93('0x29')](respondWithResult(_0x4b3b57,null))[_0xbe93('0x4c')](handleError(_0x4b3b57,null));};exports['getMembers']=function(_0x18335f,_0x233725,_0x2de35e){var _0x3e7e1b={'raw':!![],'where':{}},_0xf8436d={},_0x1ae04d;return db[_0xbe93('0x31')][_0xbe93('0x57')]({'where':{'id':_0x18335f[_0xbe93('0x4e')]['id']}})[_0xbe93('0x29')](handleEntityNotFound(_0x233725,null))[_0xbe93('0x29')](function(_0x11a17e){if(_0x11a17e){_0x1ae04d=_0x11a17e['get']({'plain':!![]});_0xf8436d[_0xbe93('0x33')]=_[_0xbe93('0x34')](db['UserSmsQueue'][_0xbe93('0x32')]);_0xf8436d[_0xbe93('0x35')]=_[_0xbe93('0x34')](_0x18335f[_0xbe93('0x35')]);_0xf8436d['filters']=_[_0xbe93('0x37')](_0xf8436d[_0xbe93('0x33')],_0xf8436d['query']);_0x3e7e1b['attributes']=_[_0xbe93('0x37')](_0xf8436d[_0xbe93('0x33')],qs[_0xbe93('0x38')](_0x18335f[_0xbe93('0x35')][_0xbe93('0x38')]));_0x3e7e1b[_0xbe93('0x39')]=_0x3e7e1b[_0xbe93('0x39')][_0xbe93('0x3a')]?_0x3e7e1b[_0xbe93('0x39')]:_0xf8436d['model'];if(!_0x18335f[_0xbe93('0x35')]['hasOwnProperty'](_0xbe93('0x3c'))){_0x3e7e1b['limit']=qs[_0xbe93('0x22')](_0x18335f['query'][_0xbe93('0x22')]);_0x3e7e1b[_0xbe93('0x21')]=qs[_0xbe93('0x21')](_0x18335f[_0xbe93('0x35')][_0xbe93('0x21')]);}_0x3e7e1b[_0xbe93('0x3d')]=qs['sort'](_0x18335f[_0xbe93('0x35')][_0xbe93('0x3e')]);_0x3e7e1b[_0xbe93('0x3f')]=qs[_0xbe93('0x36')](_[_0xbe93('0x40')](_0x18335f[_0xbe93('0x35')],_0xf8436d[_0xbe93('0x36')]));_0x3e7e1b[_0xbe93('0x3f')]['SmsQueueId']=_0x11a17e['id'];if(_0x18335f[_0xbe93('0x35')][_0xbe93('0x41')]){_0x3e7e1b['where']=_['merge'](_0x3e7e1b[_0xbe93('0x3f')],{'$or':_[_0xbe93('0x58')](_0x3e7e1b[_0xbe93('0x39')],function(_0x2e5578){var _0x24fc7c={};_0x24fc7c[_0x2e5578]={'$like':'%'+_0x18335f[_0xbe93('0x35')][_0xbe93('0x41')]+'%'};return _0x24fc7c;})});}_0x3e7e1b=_['merge']({},_0x3e7e1b,_0x18335f[_0xbe93('0x46')]);return db[_0xbe93('0x59')][_0xbe93('0x4a')](_0x3e7e1b);}})[_0xbe93('0x29')](function(_0x28ad99){if(_0x28ad99){return db['User'][_0xbe93('0x5a')]({'where':{'id':_['map'](_0x28ad99,_0xbe93('0x5b')),'role':_0xbe93('0x5c')},'attributes':['id',_0xbe93('0x2f'),_0xbe93('0x5d'),_0xbe93('0x5e'),'createdAt']});}})['then'](function(_0x5865ad){if(_0x5865ad){return{'count':_0x5865ad['count'],'rows':_[_0xbe93('0x58')](_0x5865ad['rows'],function(_0xe96c78){return{'membername':_0xe96c78[_0xbe93('0x2f')],'UserId':_0xe96c78['id'],'queue_name':_0x1ae04d[_0xbe93('0x2f')],'SmsQueueId':_0x1ae04d['id'],'interface':util[_0xbe93('0x5f')](_0xbe93('0x60'),_0xbe93('0x61'),_0xe96c78[_0xbe93('0x2f')]),'penalty':0x0,'paused':_0xe96c78['smsPause'],'createdAt':_0xe96c78[_0xbe93('0x62')],'updatedAt':_0xe96c78[_0xbe93('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x233725,_0x3e7e1b))[_0xbe93('0x4c')](handleError(_0x233725,null));};exports[_0xbe93('0x63')]=function(_0xd81748,_0x5bb2f5,_0x2808e9){var _0x16b7ab={};var _0x23fcc2={};var _0x25045c;var _0x14c0ba;return db['SmsQueue']['findOne']({'where':{'id':_0xd81748[_0xbe93('0x4e')]['id']}})[_0xbe93('0x29')](handleEntityNotFound(_0x5bb2f5,null))[_0xbe93('0x29')](function(_0x23b988){if(_0x23b988){_0x25045c=_0x23b988;_0x23fcc2[_0xbe93('0x33')]=_['keys'](db[_0xbe93('0x64')][_0xbe93('0x32')]);_0x23fcc2[_0xbe93('0x35')]=_[_0xbe93('0x34')](_0xd81748['query']);_0x23fcc2[_0xbe93('0x36')]=_['intersection'](_0x23fcc2[_0xbe93('0x33')],_0x23fcc2['query']);_0x16b7ab[_0xbe93('0x39')]=_['intersection'](_0x23fcc2[_0xbe93('0x33')],qs['fields'](_0xd81748['query'][_0xbe93('0x38')]));_0x16b7ab[_0xbe93('0x39')]=_0x16b7ab[_0xbe93('0x39')][_0xbe93('0x3a')]?_0x16b7ab[_0xbe93('0x39')]:_0x23fcc2[_0xbe93('0x33')];_0x16b7ab[_0xbe93('0x3d')]=qs[_0xbe93('0x3e')](_0xd81748[_0xbe93('0x35')][_0xbe93('0x3e')]);_0x16b7ab[_0xbe93('0x3f')]=qs['filters'](_[_0xbe93('0x40')](_0xd81748[_0xbe93('0x35')],_0x23fcc2[_0xbe93('0x36')]));if(_0xd81748[_0xbe93('0x35')]['filter']){_0x16b7ab[_0xbe93('0x3f')]=_[_0xbe93('0x42')](_0x16b7ab[_0xbe93('0x3f')],{'$or':_[_0xbe93('0x58')](_0x16b7ab[_0xbe93('0x39')],function(_0x5d687e){var _0x480c0f={};_0x480c0f[_0x5d687e]={'$like':'%'+_0xd81748['query']['filter']+'%'};return _0x480c0f;})});}_0x16b7ab=_['merge']({},_0x16b7ab,_0xd81748['options']);return _0x25045c[_0xbe93('0x63')](_0x16b7ab);}})[_0xbe93('0x29')](function(_0x156a6e){if(_0x156a6e){_0x14c0ba=_0x156a6e[_0xbe93('0x3a')];if(!_0xd81748[_0xbe93('0x35')]['hasOwnProperty'](_0xbe93('0x3c'))){_0x16b7ab['limit']=qs['limit'](_0xd81748[_0xbe93('0x35')][_0xbe93('0x22')]);_0x16b7ab[_0xbe93('0x21')]=qs['offset'](_0xd81748[_0xbe93('0x35')]['offset']);}return _0x25045c[_0xbe93('0x63')](_0x16b7ab);}})[_0xbe93('0x29')](function(_0x831291){if(_0x831291){return _0x831291?{'count':_0x14c0ba,'rows':_0x831291}:null;}})[_0xbe93('0x29')](respondWithResult(_0x5bb2f5,null))[_0xbe93('0x4c')](handleError(_0x5bb2f5,null));};exports[_0xbe93('0x65')]=function(_0x2fb4f,_0x11d340,_0x3e32bd){var _0x6ac40e=_0x2fb4f[_0xbe93('0x51')][_0xbe93('0x66')];return db[_0xbe93('0x64')][_0xbe93('0x4a')]({'where':{'id':_['map'](_0x6ac40e,'id')},'attributes':['id'],'include':[{'model':db['User'],'as':_0xbe93('0x67'),'attributes':['id','name',_0xbe93('0x68'),'voicePause',_0xbe93('0x69')],'raw':!![]}]})[_0xbe93('0x29')](function(_0x46e27c){if(_0x46e27c){var _0x4d735f=_[_0xbe93('0x6a')](_0x46e27c,function(_0x35e429){var _0x4e3995=_0x35e429['get']({'plain':!![]});return _0x4e3995['Agents'];});return db[_0xbe93('0x31')][_0xbe93('0x4f')]({'where':{'id':_0x2fb4f[_0xbe93('0x4e')]['id']}})['then'](function(_0x12f208){return db[_0xbe93('0x6b')][_0xbe93('0x6c')](function(_0x3fa17c){return _0x12f208[_0xbe93('0x65')](_[_0xbe93('0x58')](_0x6ac40e,'id'),{'transaction':_0x3fa17c})[_0xbe93('0x29')](function(){return BPromise[_0xbe93('0x6d')](_0x4d735f,function(_0x5251a8){return db['UserSmsQueue'][_0xbe93('0x6e')]({'where':{'UserId':_0x5251a8['id'],'SmsQueueId':_0x2fb4f[_0xbe93('0x4e')]['id']},'transaction':_0x3fa17c});});})[_0xbe93('0x29')](function(){_0x4d735f[_0xbe93('0x6f')](function(_0x3f8811){socket[_0xbe93('0x70')](_0xbe93('0x71'),{'UserId':_0x3f8811['id'],'SmsQueueId':_0x12f208['id']});});});});});}})[_0xbe93('0x29')](respondWithStatusCode(_0x11d340,null))[_0xbe93('0x4c')](handleError(_0x11d340,null));};exports[_0xbe93('0x72')]=function(_0x4b0ee6,_0x733509,_0x373566){return db['Team'][_0xbe93('0x4a')]({'where':{'id':_0x4b0ee6[_0xbe93('0x35')][_0xbe93('0x73')]},'attributes':['id'],'include':[{'model':db[_0xbe93('0x74')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xbe93('0x29')](handleEntityNotFound(_0x733509,null))[_0xbe93('0x29')](function(_0x577f9b){var _0x20ae71=_['map'](_0x577f9b,'id');var _0x575ed7=[];var _0x38c4fe=[];var _0x224245=squel['select']();_0x224245[_0xbe93('0x75')]('tq.TeamId')[_0xbe93('0x76')](_0xbe93('0x77'),'tq')['join'](_0xbe93('0x78'),'ut',_0xbe93('0x79'))[_0xbe93('0x3f')]('SmsQueueId\x20=\x20?',_0x4b0ee6['params']['id']);for(var _0x4edc74=0x0;_0x4edc74<_0x577f9b[_0xbe93('0x3a')];_0x4edc74+=0x1){let _0x427fab=_0x577f9b[_0x4edc74];for(var _0x50438=0x0;_0x50438<_0x427fab[_0xbe93('0x67')][_0xbe93('0x3a')];_0x50438+=0x1){let _0x535f87=_0x427fab[_0xbe93('0x67')][_0x50438];var _0x31726a=_0x224245[_0xbe93('0x7a')]();_0x31726a[_0xbe93('0x3f')](_0xbe93('0x7b'),_0x535f87['id']);_0x38c4fe[_0xbe93('0x7c')](db['sequelize'][_0xbe93('0x35')](_0x31726a[_0xbe93('0x7d')](),{'type':db[_0xbe93('0x6b')][_0xbe93('0x7e')]['SELECT']})[_0xbe93('0x29')](function(_0x229fde){if(_0x229fde['length']===0x1){return _0x535f87['id'];}else{var _0x35be71=_[_0xbe93('0x7f')](_['map'](_0x229fde,_0xbe93('0x80')),function(_0x42f171){return _[_0xbe93('0x81')](_0x20ae71,_0x42f171);});if(_0x35be71){return _0x535f87['id'];}}}));}}return BPromise[_0xbe93('0x82')](_0x38c4fe)[_0xbe93('0x29')](function(_0x235dd4){_0x575ed7=_(_0x575ed7)[_0xbe93('0x83')](_0x235dd4)[_0xbe93('0x84')]()[_0xbe93('0x85')]();return db[_0xbe93('0x31')][_0xbe93('0x4f')]({'where':{'id':_0x4b0ee6[_0xbe93('0x4e')]['id']}})[_0xbe93('0x29')](function(_0x227e7b){return db[_0xbe93('0x6b')]['transaction'](function(_0x132386){return _0x227e7b[_0xbe93('0x72')](_0x4b0ee6[_0xbe93('0x35')][_0xbe93('0x73')],{'transaction':_0x132386})['then'](function(){if(!_[_0xbe93('0x86')](_0x575ed7)){return _0x227e7b[_0xbe93('0x87')](_0x575ed7,{'transaction':_0x132386});}})['then'](function(){_0x575ed7[_0xbe93('0x6f')](function(_0x4f9511){socket[_0xbe93('0x70')]('userSmsQueue:remove',{'UserId':_0x4f9511,'SmsQueueId':_0x227e7b['id']});});});});});});})[_0xbe93('0x29')](respondWithStatusCode(_0x733509,null))[_0xbe93('0x4c')](handleError(_0x733509,null));};exports[_0xbe93('0x88')]=function(_0x5d8f42,_0xfa47ee,_0x50fbf1){return db[_0xbe93('0x31')][_0xbe93('0x4f')]({'where':{'id':_0x5d8f42[_0xbe93('0x4e')]['id']}})['then'](handleEntityNotFound(_0xfa47ee,null))['then'](function(_0xc32e6b){if(_0xc32e6b){return _0xc32e6b[_0xbe93('0x88')](_0x5d8f42[_0xbe93('0x51')][_0xbe93('0x73')],_['omit'](_0x5d8f42[_0xbe93('0x51')],['ids','id'])||{})[_0xbe93('0x89')](function(_0x45a2c4){for(var _0x2706dd=0x0;_0x2706dd<_0x5d8f42['body'][_0xbe93('0x73')][_0xbe93('0x3a')];_0x2706dd+=0x1){socket[_0xbe93('0x70')](_0xbe93('0x71'),{'UserId':_0x5d8f42['body']['ids'][_0x2706dd],'SmsQueueId':_0x5d8f42['params']['id']});}return _0x45a2c4;});}})[_0xbe93('0x29')](respondWithResult(_0xfa47ee,null))[_0xbe93('0x4c')](handleError(_0xfa47ee,null));};exports['removeAgents']=function(_0x5f12f1,_0x377eca,_0x2970e8){return db['SmsQueue'][_0xbe93('0x4f')]({'where':{'id':_0x5f12f1[_0xbe93('0x4e')]['id']}})['then'](handleEntityNotFound(_0x377eca,null))['then'](function(_0x1d7fa9){if(_0x1d7fa9){return _0x1d7fa9[_0xbe93('0x87')](_0x5f12f1[_0xbe93('0x35')][_0xbe93('0x73')])[_0xbe93('0x29')](function(){if(_[_0xbe93('0x8a')](_0x5f12f1['query'][_0xbe93('0x73')])){for(var _0x419fa8=0x0;_0x419fa8<_0x5f12f1[_0xbe93('0x35')][_0xbe93('0x73')][_0xbe93('0x3a')];_0x419fa8+=0x1){socket[_0xbe93('0x70')]('userSmsQueue:remove',{'UserId':Number(_0x5f12f1[_0xbe93('0x35')][_0xbe93('0x73')][_0x419fa8]),'SmsQueueId':Number(_0x5f12f1['params']['id'])});}}else{socket['emit'](_0xbe93('0x8b'),{'UserId':Number(_0x5f12f1['query']['ids']),'SmsQueueId':Number(_0x5f12f1[_0xbe93('0x4e')]['id'])});}});}})[_0xbe93('0x29')](respondWithStatusCode(_0x377eca,null))[_0xbe93('0x4c')](handleError(_0x377eca,null));};exports[_0xbe93('0x8c')]=function(_0x4faa9d,_0x311979,_0x301a47){var _0x204c6a={};var _0x4a2a67={};var _0x25d213;var _0x2bf47c;return db['SmsQueue'][_0xbe93('0x57')]({'where':{'id':_0x4faa9d[_0xbe93('0x4e')]['id']}})[_0xbe93('0x29')](handleEntityNotFound(_0x311979,null))[_0xbe93('0x29')](function(_0x530543){if(_0x530543){_0x25d213=_0x530543;_0x4a2a67['model']=_['keys'](db['User'][_0xbe93('0x32')]);_0x4a2a67['query']=_[_0xbe93('0x34')](_0x4faa9d[_0xbe93('0x35')]);_0x4a2a67[_0xbe93('0x36')]=_[_0xbe93('0x37')](_0x4a2a67[_0xbe93('0x33')],_0x4a2a67[_0xbe93('0x35')]);_0x204c6a[_0xbe93('0x39')]=_['intersection'](_0x4a2a67[_0xbe93('0x33')],qs['fields'](_0x4faa9d[_0xbe93('0x35')]['fields']));_0x204c6a[_0xbe93('0x39')]=_0x204c6a['attributes'][_0xbe93('0x3a')]?_0x204c6a['attributes']:_0x4a2a67[_0xbe93('0x33')];_0x204c6a[_0xbe93('0x3d')]=qs[_0xbe93('0x3e')](_0x4faa9d['query'][_0xbe93('0x3e')]);_0x204c6a[_0xbe93('0x3f')]=qs[_0xbe93('0x36')](_[_0xbe93('0x40')](_0x4faa9d['query'],_0x4a2a67[_0xbe93('0x36')]));if(_0x4faa9d['query']['filter']){_0x204c6a[_0xbe93('0x3f')]=_[_0xbe93('0x42')](_0x204c6a[_0xbe93('0x3f')],{'$or':_['map'](_0x204c6a[_0xbe93('0x39')],function(_0x354949){var _0x5338d9={};_0x5338d9[_0x354949]={'$like':'%'+_0x4faa9d['query'][_0xbe93('0x41')]+'%'};return _0x5338d9;})});}_0x204c6a=_['merge']({},_0x204c6a,_0x4faa9d[_0xbe93('0x46')]);return _0x25d213['getAgents'](_0x204c6a);}})['then'](function(_0x35306e){if(_0x35306e){_0x2bf47c=_0x35306e[_0xbe93('0x3a')];if(!_0x4faa9d['query']['hasOwnProperty'](_0xbe93('0x3c'))){_0x204c6a[_0xbe93('0x22')]=qs[_0xbe93('0x22')](_0x4faa9d[_0xbe93('0x35')]['limit']);_0x204c6a[_0xbe93('0x21')]=qs[_0xbe93('0x21')](_0x4faa9d[_0xbe93('0x35')][_0xbe93('0x21')]);}return _0x25d213['getAgents'](_0x204c6a);}})[_0xbe93('0x29')](function(_0x1ede25){if(_0x1ede25){return _0x1ede25?{'count':_0x2bf47c,'rows':_0x1ede25}:null;}})['then'](respondWithResult(_0x311979,null))[_0xbe93('0x4c')](handleError(_0x311979,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 76fb2a8..b7d40d3 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 _0x2154=['save','update','emit','exports','../../mysqldb','SmsQueue'];(function(_0x4a45b4,_0x59804f){var _0x1a99c9=function(_0x3aa517){while(--_0x3aa517){_0x4a45b4['push'](_0x4a45b4['shift']());}};_0x1a99c9(++_0x59804f);}(_0x2154,0x1c6));var _0x4215=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x2154[_0x49ca18];return _0x145d54;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0x4215('0x0'))['db'][_0x4215('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4215('0x2'),'afterUpdate':_0x4215('0x3'),'afterDestroy':'remove'};function emitEvent(_0x212c7b){return function(_0x11ce40,_0x5a7d3b,_0x2edf67){SmsQueueEvents[_0x4215('0x4')](_0x212c7b+':'+_0x11ce40['id'],_0x11ce40);SmsQueueEvents[_0x4215('0x4')](_0x212c7b,_0x11ce40);_0x2edf67(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x4215('0x5')]=SmsQueueEvents; \ No newline at end of file +var _0x497c=['hook','exports','events','../../mysqldb','SmsQueue','setMaxListeners','update','remove','emit'];(function(_0x523f67,_0x2c2ef6){var _0x661708=function(_0x593eed){while(--_0x593eed){_0x523f67['push'](_0x523f67['shift']());}};_0x661708(++_0x2c2ef6);}(_0x497c,0x17c));var _0xc497=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0x497c[_0x500419];return _0x241c1a;};'use strict';var EventEmitter=require(_0xc497('0x0'));var SmsQueue=require(_0xc497('0x1'))['db'][_0xc497('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xc497('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc497('0x4'),'afterDestroy':_0xc497('0x5')};function emitEvent(_0xec1b42){return function(_0x424488,_0x5b588a,_0x4b0c1a){SmsQueueEvents['emit'](_0xec1b42+':'+_0x424488['id'],_0x424488);SmsQueueEvents[_0xc497('0x6')](_0xec1b42,_0x424488);_0x4b0c1a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0xc497('0x7')](e,emitEvent(event));}}module[_0xc497('0x8')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 73d6c82..aff46f0 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 _0x7409=['rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x502024,_0x462790){var _0x60c4b8=function(_0x2e7f75){while(--_0x2e7f75){_0x502024['push'](_0x502024['shift']());}};_0x60c4b8(++_0x462790);}(_0x7409,0x6e));var _0x9740=function(_0x345c86,_0x2b12e0){_0x345c86=_0x345c86-0x0;var _0x41e895=_0x7409[_0x345c86];return _0x41e895;};'use strict';var _=require(_0x9740('0x0'));var util=require(_0x9740('0x1'));var logger=require('../../config/logger')(_0x9740('0x2'));var moment=require(_0x9740('0x3'));var BPromise=require(_0x9740('0x4'));var rp=require(_0x9740('0x5'));var fs=require('fs');var path=require(_0x9740('0x6'));var rimraf=require(_0x9740('0x7'));var config=require(_0x9740('0x8'));var attributes=require(_0x9740('0x9'));module[_0x9740('0xa')]=function(_0x547490,_0x19865c){return _0x547490[_0x9740('0xb')](_0x9740('0xc'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd51=['exports','define','SmsQueue','sms_queues','lodash','../../config/logger','api','moment','bluebird','./smsQueue.attributes'];(function(_0x520ca1,_0x37ffd9){var _0x2f2b76=function(_0x253397){while(--_0x253397){_0x520ca1['push'](_0x520ca1['shift']());}};_0x2f2b76(++_0x37ffd9);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x2ec6c7,_0x1d76aa){_0x2ec6c7=_0x2ec6c7-0x0;var _0x111b5c=_0xbd51[_0x2ec6c7];return _0x111b5c;};'use strict';var _=require(_0x1bd5('0x0'));var util=require('util');var logger=require(_0x1bd5('0x1'))(_0x1bd5('0x2'));var moment=require(_0x1bd5('0x3'));var BPromise=require(_0x1bd5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1bd5('0x5'));module[_0x1bd5('0x6')]=function(_0x43e6b6,_0x59ddfb){return _0x43e6b6[_0x1bd5('0x7')](_0x1bd5('0x8'),attributes,{'tableName':_0x1bd5('0x9'),'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 73cf5d6..47e455b 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 _0xa56b=['result','message','catch','GetSmsQueue','options','raw','where','limit','map','include','model','attributes','SmsQueue','find','ShowSmsQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','then','info','request\x20sent','stringify','error','code','SmsQueue,\x20%s,\x20%s'];(function(_0x48d82c,_0x307c29){var _0x2370c7=function(_0x40b563){while(--_0x40b563){_0x48d82c['push'](_0x48d82c['shift']());}};_0x2370c7(++_0x307c29);}(_0xa56b,0x16e));var _0xba56=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xa56b[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0xba56('0x0'));var util=require(_0xba56('0x1'));var moment=require(_0xba56('0x2'));var BPromise=require(_0xba56('0x3'));var rs=require(_0xba56('0x4'));var fs=require('fs');var Redis=require(_0xba56('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xba56('0x6'));var logger=require(_0xba56('0x7'))(_0xba56('0x8'));var config=require('../../config/environment');var jayson=require(_0xba56('0x9'));var client=jayson[_0xba56('0xa')][_0xba56('0xb')]({'port':0x232a});config[_0xba56('0xc')]=_[_0xba56('0xd')](config[_0xba56('0xc')],{'host':_0xba56('0xe'),'port':0x18eb});var socket=require(_0xba56('0xf'))(new Redis(config[_0xba56('0xc')]));require(_0xba56('0x10'))['register'](socket);function respondWithRpcPromise(_0x4d2c0c,_0x350c76,_0x3b49bb){return new BPromise(function(_0x834990,_0x5352cb){return client['request'](_0x4d2c0c,_0x3b49bb)[_0xba56('0x11')](function(_0x23375a){logger[_0xba56('0x12')]('SmsQueue,\x20%s,\x20%s',_0x350c76,_0xba56('0x13'));logger['debug']('SmsQueue,\x20%s,\x20%s,\x20%s',_0x350c76,'request\x20sent',JSON[_0xba56('0x14')](_0x23375a));if(_0x23375a[_0xba56('0x15')]){if(_0x23375a[_0xba56('0x15')][_0xba56('0x16')]===0x1f4){logger[_0xba56('0x15')](_0xba56('0x17'),_0x350c76,_0x23375a[_0xba56('0x15')]['message']);return _0x5352cb(_0x23375a['error']['message']);}logger[_0xba56('0x15')](_0xba56('0x17'),_0x350c76,_0x23375a['error']['message']);return _0x834990(_0x23375a[_0xba56('0x15')]['message']);}else{logger[_0xba56('0x12')](_0xba56('0x17'),_0x350c76,_0xba56('0x13'));_0x834990(_0x23375a[_0xba56('0x18')][_0xba56('0x19')]);}})[_0xba56('0x1a')](function(_0x4a86da){logger[_0xba56('0x15')](_0xba56('0x17'),_0x350c76,_0x4a86da);_0x5352cb(_0x4a86da);});});}exports[_0xba56('0x1b')]=function(_0x25851f){var _0x5a045e=this;return new Promise(function(_0x28b609,_0x4bc2b0){return db['SmsQueue']['findAll']({'raw':_0x25851f[_0xba56('0x1c')]?_0x25851f[_0xba56('0x1c')][_0xba56('0x1d')]===undefined?!![]:![]:!![],'where':_0x25851f[_0xba56('0x1c')]?_0x25851f[_0xba56('0x1c')][_0xba56('0x1e')]||null:null,'attributes':_0x25851f['options']?_0x25851f[_0xba56('0x1c')]['attributes']||null:null,'limit':_0x25851f[_0xba56('0x1c')]?_0x25851f['options'][_0xba56('0x1f')]||null:null,'include':_0x25851f[_0xba56('0x1c')]?_0x25851f[_0xba56('0x1c')]['include']?_[_0xba56('0x20')](_0x25851f['options'][_0xba56('0x21')],function(_0x2720db){return{'model':db[_0x2720db['model']],'as':_0x2720db['as'],'attributes':_0x2720db['attributes'],'include':_0x2720db[_0xba56('0x21')]?_[_0xba56('0x20')](_0x2720db[_0xba56('0x21')],function(_0x5671f8){return{'model':db[_0x5671f8[_0xba56('0x22')]],'as':_0x5671f8['as'],'attributes':_0x5671f8['attributes'],'include':_0x5671f8[_0xba56('0x21')]?_[_0xba56('0x20')](_0x5671f8[_0xba56('0x21')],function(_0xd2e5e5){return{'model':db[_0xd2e5e5[_0xba56('0x22')]],'as':_0xd2e5e5['as'],'attributes':_0xd2e5e5[_0xba56('0x23')]};}):[]};}):[]};}):[]:[]})[_0xba56('0x11')](function(_0x46c083){logger[_0xba56('0x12')]('GetSmsQueue',_0x25851f);logger['debug']('GetSmsQueue',_0x25851f,JSON[_0xba56('0x14')](_0x46c083));_0x28b609(_0x46c083);})[_0xba56('0x1a')](function(_0x47690f){logger[_0xba56('0x15')]('GetSmsQueue',_0x47690f['message'],_0x25851f);_0x4bc2b0(_0x5a045e[_0xba56('0x15')](0x1f4,_0x47690f[_0xba56('0x19')]));});});};exports['ShowSmsQueue']=function(_0x3a1d4f){var _0x58687b=this;return new Promise(function(_0x57c9bf,_0x63b2ef){return db[_0xba56('0x24')][_0xba56('0x25')]({'raw':_0x3a1d4f[_0xba56('0x1c')]?_0x3a1d4f[_0xba56('0x1c')][_0xba56('0x1d')]===undefined?!![]:![]:!![],'where':_0x3a1d4f[_0xba56('0x1c')]?_0x3a1d4f[_0xba56('0x1c')]['where']||null:null,'attributes':_0x3a1d4f[_0xba56('0x1c')]?_0x3a1d4f[_0xba56('0x1c')]['attributes']||null:null,'include':_0x3a1d4f[_0xba56('0x1c')]?_0x3a1d4f[_0xba56('0x1c')][_0xba56('0x21')]?_[_0xba56('0x20')](_0x3a1d4f[_0xba56('0x1c')][_0xba56('0x21')],function(_0x9d814d){return{'model':db[_0x9d814d[_0xba56('0x22')]],'as':_0x9d814d['as'],'attributes':_0x9d814d[_0xba56('0x23')],'include':_0x9d814d['include']?_[_0xba56('0x20')](_0x9d814d['include'],function(_0x2f5fdb){return{'model':db[_0x2f5fdb[_0xba56('0x22')]],'as':_0x2f5fdb['as'],'attributes':_0x2f5fdb[_0xba56('0x23')],'include':_0x2f5fdb[_0xba56('0x21')]?_[_0xba56('0x20')](_0x2f5fdb[_0xba56('0x21')],function(_0x51f2fa){return{'model':db[_0x51f2fa['model']],'as':_0x51f2fa['as'],'attributes':_0x51f2fa[_0xba56('0x23')]};}):[]};}):[]};}):[]:[]})[_0xba56('0x11')](function(_0x4a49ab){logger[_0xba56('0x12')](_0xba56('0x26'),_0x3a1d4f);logger['debug']('ShowSmsQueue',_0x3a1d4f,JSON[_0xba56('0x14')](_0x4a49ab));_0x57c9bf(_0x4a49ab);})[_0xba56('0x1a')](function(_0x370817){logger['error'](_0xba56('0x26'),_0x370817[_0xba56('0x19')],_0x3a1d4f);_0x63b2ef(_0x58687b[_0xba56('0x15')](0x1f4,_0x370817[_0xba56('0x19')]));});});}; \ No newline at end of file +var _0x09e3=['model','attributes','debug','GetSmsQueue','find','ShowSmsQueue','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','SmsQueue','findAll','options','raw','where','limit','map','include'];(function(_0x3dc80f,_0x440d2b){var _0x1f9d0c=function(_0x2cc377){while(--_0x2cc377){_0x3dc80f['push'](_0x3dc80f['shift']());}};_0x1f9d0c(++_0x440d2b);}(_0x09e3,0x134));var _0x309e=function(_0x2c21c8,_0x2d3c34){_0x2c21c8=_0x2c21c8-0x0;var _0x1e5717=_0x09e3[_0x2c21c8];return _0x1e5717;};'use strict';var _=require(_0x309e('0x0'));var util=require(_0x309e('0x1'));var moment=require(_0x309e('0x2'));var BPromise=require(_0x309e('0x3'));var rs=require(_0x309e('0x4'));var fs=require('fs');var Redis=require(_0x309e('0x5'));var db=require(_0x309e('0x6'))['db'];var utils=require(_0x309e('0x7'));var logger=require(_0x309e('0x8'))(_0x309e('0x9'));var config=require(_0x309e('0xa'));var jayson=require(_0x309e('0xb'));var client=jayson['client'][_0x309e('0xc')]({'port':0x232a});config[_0x309e('0xd')]=_[_0x309e('0xe')](config[_0x309e('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x309e('0xf'))(new Redis(config['redis']));require(_0x309e('0x10'))[_0x309e('0x11')](socket);function respondWithRpcPromise(_0x1afe2e,_0x274730,_0x1038cf){return new BPromise(function(_0x3695ab,_0x3aa49f){return client[_0x309e('0x12')](_0x1afe2e,_0x1038cf)[_0x309e('0x13')](function(_0x382d00){logger[_0x309e('0x14')](_0x309e('0x15'),_0x274730,'request\x20sent');logger['debug'](_0x309e('0x16'),_0x274730,_0x309e('0x17'),JSON[_0x309e('0x18')](_0x382d00));if(_0x382d00[_0x309e('0x19')]){if(_0x382d00[_0x309e('0x19')]['code']===0x1f4){logger[_0x309e('0x19')](_0x309e('0x15'),_0x274730,_0x382d00[_0x309e('0x19')][_0x309e('0x1a')]);return _0x3aa49f(_0x382d00[_0x309e('0x19')][_0x309e('0x1a')]);}logger[_0x309e('0x19')](_0x309e('0x15'),_0x274730,_0x382d00[_0x309e('0x19')][_0x309e('0x1a')]);return _0x3695ab(_0x382d00[_0x309e('0x19')]['message']);}else{logger['info'](_0x309e('0x15'),_0x274730,'request\x20sent');_0x3695ab(_0x382d00[_0x309e('0x1b')][_0x309e('0x1a')]);}})['catch'](function(_0x5b910f){logger[_0x309e('0x19')](_0x309e('0x15'),_0x274730,_0x5b910f);_0x3aa49f(_0x5b910f);});});}exports['GetSmsQueue']=function(_0x51ff62){var _0x28a069=this;return new Promise(function(_0x1be2b5,_0x488640){return db[_0x309e('0x1c')][_0x309e('0x1d')]({'raw':_0x51ff62[_0x309e('0x1e')]?_0x51ff62[_0x309e('0x1e')][_0x309e('0x1f')]===undefined?!![]:![]:!![],'where':_0x51ff62[_0x309e('0x1e')]?_0x51ff62[_0x309e('0x1e')][_0x309e('0x20')]||null:null,'attributes':_0x51ff62['options']?_0x51ff62['options']['attributes']||null:null,'limit':_0x51ff62['options']?_0x51ff62[_0x309e('0x1e')][_0x309e('0x21')]||null:null,'include':_0x51ff62[_0x309e('0x1e')]?_0x51ff62[_0x309e('0x1e')]['include']?_[_0x309e('0x22')](_0x51ff62[_0x309e('0x1e')][_0x309e('0x23')],function(_0x47c747){return{'model':db[_0x47c747[_0x309e('0x24')]],'as':_0x47c747['as'],'attributes':_0x47c747[_0x309e('0x25')],'include':_0x47c747[_0x309e('0x23')]?_[_0x309e('0x22')](_0x47c747['include'],function(_0x2b21a6){return{'model':db[_0x2b21a6['model']],'as':_0x2b21a6['as'],'attributes':_0x2b21a6[_0x309e('0x25')],'include':_0x2b21a6['include']?_['map'](_0x2b21a6[_0x309e('0x23')],function(_0x4cb798){return{'model':db[_0x4cb798[_0x309e('0x24')]],'as':_0x4cb798['as'],'attributes':_0x4cb798['attributes']};}):[]};}):[]};}):[]:[]})[_0x309e('0x13')](function(_0x4d23a8){logger[_0x309e('0x14')]('GetSmsQueue',_0x51ff62);logger[_0x309e('0x26')](_0x309e('0x27'),_0x51ff62,JSON[_0x309e('0x18')](_0x4d23a8));_0x1be2b5(_0x4d23a8);})['catch'](function(_0x305fcb){logger[_0x309e('0x19')](_0x309e('0x27'),_0x305fcb[_0x309e('0x1a')],_0x51ff62);_0x488640(_0x28a069[_0x309e('0x19')](0x1f4,_0x305fcb[_0x309e('0x1a')]));});});};exports['ShowSmsQueue']=function(_0x34bac4){var _0xb84155=this;return new Promise(function(_0x1cfd99,_0x3d4924){return db[_0x309e('0x1c')][_0x309e('0x28')]({'raw':_0x34bac4[_0x309e('0x1e')]?_0x34bac4[_0x309e('0x1e')][_0x309e('0x1f')]===undefined?!![]:![]:!![],'where':_0x34bac4[_0x309e('0x1e')]?_0x34bac4[_0x309e('0x1e')][_0x309e('0x20')]||null:null,'attributes':_0x34bac4[_0x309e('0x1e')]?_0x34bac4['options']['attributes']||null:null,'include':_0x34bac4[_0x309e('0x1e')]?_0x34bac4[_0x309e('0x1e')][_0x309e('0x23')]?_[_0x309e('0x22')](_0x34bac4[_0x309e('0x1e')][_0x309e('0x23')],function(_0x596ae0){return{'model':db[_0x596ae0[_0x309e('0x24')]],'as':_0x596ae0['as'],'attributes':_0x596ae0[_0x309e('0x25')],'include':_0x596ae0[_0x309e('0x23')]?_[_0x309e('0x22')](_0x596ae0[_0x309e('0x23')],function(_0x55c17e){return{'model':db[_0x55c17e[_0x309e('0x24')]],'as':_0x55c17e['as'],'attributes':_0x55c17e[_0x309e('0x25')],'include':_0x55c17e[_0x309e('0x23')]?_['map'](_0x55c17e[_0x309e('0x23')],function(_0x42b22e){return{'model':db[_0x42b22e[_0x309e('0x24')]],'as':_0x42b22e['as'],'attributes':_0x42b22e['attributes']};}):[]};}):[]};}):[]:[]})[_0x309e('0x13')](function(_0x4183e1){logger[_0x309e('0x14')]('ShowSmsQueue',_0x34bac4);logger[_0x309e('0x26')](_0x309e('0x29'),_0x34bac4,JSON[_0x309e('0x18')](_0x4183e1));_0x1cfd99(_0x4183e1);})[_0x309e('0x2a')](function(_0x48ee8a){logger['error'](_0x309e('0x29'),_0x48ee8a[_0x309e('0x1a')],_0x34bac4);_0x3d4924(_0xb84155[_0x309e('0x19')](0x1f4,_0x48ee8a[_0x309e('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index d1ae121..5f873de 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 _0xe225=['smsQueue:','save','remove','length'];(function(_0x5a4ac1,_0xb9eb0b){var _0x11dc18=function(_0x49d481){while(--_0x49d481){_0x5a4ac1['push'](_0x5a4ac1['shift']());}};_0x11dc18(++_0xb9eb0b);}(_0xe225,0x1bd));var _0x5e22=function(_0x22c5df,_0x445b1a){_0x22c5df=_0x22c5df-0x0;var _0x193166=_0xe225[_0x22c5df];return _0x193166;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x5e22('0x0'),_0x5e22('0x1'),'update'];function createListener(_0x503eba,_0x4c55ed){return function(_0x39f972){_0x4c55ed['emit'](_0x503eba,_0x39f972);};}function removeListener(_0x45790b,_0x4e0d42){return function(){SmsQueueEvents['removeListener'](_0x45790b,_0x4e0d42);};}exports['register']=function(_0x45595c){for(var _0x35248d=0x0,_0x35736b=events[_0x5e22('0x2')];_0x35248d<_0x35736b;_0x35248d++){var _0x465536=events[_0x35248d];var _0x36ad4d=createListener(_0x5e22('0x3')+_0x465536,_0x45595c);SmsQueueEvents['on'](_0x465536,_0x36ad4d);}}; \ No newline at end of file +var _0x4cc7=['update','emit','removeListener','register','length','smsQueue:','./smsQueue.events','save','remove'];(function(_0x329a33,_0x585897){var _0x2bef80=function(_0x213b94){while(--_0x213b94){_0x329a33['push'](_0x329a33['shift']());}};_0x2bef80(++_0x585897);}(_0x4cc7,0x1b6));var _0x74cc=function(_0x5715de,_0x2d54fe){_0x5715de=_0x5715de-0x0;var _0x3ee069=_0x4cc7[_0x5715de];return _0x3ee069;};'use strict';var SmsQueueEvents=require(_0x74cc('0x0'));var events=[_0x74cc('0x1'),_0x74cc('0x2'),_0x74cc('0x3')];function createListener(_0x1627f8,_0x28a746){return function(_0x432efa){_0x28a746[_0x74cc('0x4')](_0x1627f8,_0x432efa);};}function removeListener(_0x4b3d99,_0x14af2c){return function(){SmsQueueEvents[_0x74cc('0x5')](_0x4b3d99,_0x14af2c);};}exports[_0x74cc('0x6')]=function(_0x3b5d01){for(var _0x225d38=0x0,_0x1d2678=events[_0x74cc('0x7')];_0x225d38<_0x1d2678;_0x225d38++){var _0x2b104a=events[_0x225d38];var _0x3deb8d=createListener(_0x74cc('0x8')+_0x2b104a,_0x3b5d01);SmsQueueEvents['on'](_0x2b104a,_0x3deb8d);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index bc408f8..884ac3f 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 _0x29b1=['get','isAuthenticated','index','/describe','describe','show','create','put','/:id','update','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller'];(function(_0x34ba5a,_0xd7e886){var _0x99fc79=function(_0x5eeac7){while(--_0x5eeac7){_0x34ba5a['push'](_0x34ba5a['shift']());}};_0x99fc79(++_0xd7e886);}(_0x29b1,0x13b));var _0x129b=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0x29b1[_0x3c4737];return _0x2bb926;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x129b('0x0'));var timeout=require(_0x129b('0x1'));var express=require(_0x129b('0x2'));var router=express[_0x129b('0x3')]();var auth=require(_0x129b('0x4'));var interaction=require(_0x129b('0x5'));var config=require(_0x129b('0x6'));var controller=require(_0x129b('0x7'));router[_0x129b('0x8')]('/',auth[_0x129b('0x9')](),controller[_0x129b('0xa')]);router['get'](_0x129b('0xb'),auth['isAuthenticated'](),controller[_0x129b('0xc')]);router[_0x129b('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x129b('0xd')]);router['post']('/',auth[_0x129b('0x9')](),controller[_0x129b('0xe')]);router[_0x129b('0xf')](_0x129b('0x10'),auth[_0x129b('0x9')](),controller[_0x129b('0x11')]);router['delete'](_0x129b('0x10'),auth[_0x129b('0x9')](),controller['destroy']);module[_0x129b('0x12')]=router; \ No newline at end of file +var _0xc15b=['describe','show','create','put','update','/:id','destroy','multer','path','connect-timeout','express','Router','../../config/environment','./smsQueueReport.controller','get','/describe','isAuthenticated'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0xc15b,0xe4));var _0xbc15=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0xc15b[_0x4a7631];return _0x1a5a6f;};'use strict';var multer=require(_0xbc15('0x0'));var util=require('util');var path=require(_0xbc15('0x1'));var timeout=require(_0xbc15('0x2'));var express=require(_0xbc15('0x3'));var router=express[_0xbc15('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbc15('0x5'));var controller=require(_0xbc15('0x6'));router[_0xbc15('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xbc15('0x8'),auth[_0xbc15('0x9')](),controller[_0xbc15('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xbc15('0xb')]);router['post']('/',auth[_0xbc15('0x9')](),controller[_0xbc15('0xc')]);router[_0xbc15('0xd')]('/:id',auth[_0xbc15('0x9')](),controller[_0xbc15('0xe')]);router['delete'](_0xbc15('0xf'),auth[_0xbc15('0x9')](),controller[_0xbc15('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index ec4e0fa..a9fcb6d 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 _0xd4e4=['STRING','DATE','sequelize'];(function(_0x3dda0f,_0x5b9902){var _0x1b0488=function(_0x267031){while(--_0x267031){_0x3dda0f['push'](_0x3dda0f['shift']());}};_0x1b0488(++_0x5b9902);}(_0xd4e4,0x9b));var _0x4d4e=function(_0xa2cee9,_0x2ce867){_0xa2cee9=_0xa2cee9-0x0;var _0x40478c=_0xd4e4[_0xa2cee9];return _0x40478c;};'use strict';var moment=require('moment');var Sequelize=require(_0x4d4e('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x4d4e('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x4d4e('0x2')]},'leaveAt':{'type':Sequelize[_0x4d4e('0x2')]},'acceptAt':{'type':Sequelize[_0x4d4e('0x2')]},'exitAt':{'type':Sequelize[_0x4d4e('0x2')]},'reason':{'type':Sequelize[_0x4d4e('0x1')]}}; \ No newline at end of file +var _0xeb58=['exports','DATE','STRING','moment','sequelize'];(function(_0x41466c,_0x23d08c){var _0x3742d4=function(_0x4c0361){while(--_0x4c0361){_0x41466c['push'](_0x41466c['shift']());}};_0x3742d4(++_0x23d08c);}(_0xeb58,0xa8));var _0x8eb5=function(_0x4741ea,_0x18aede){_0x4741ea=_0x4741ea-0x0;var _0x3d4266=_0xeb58[_0x4741ea];return _0x3d4266;};'use strict';var moment=require(_0x8eb5('0x0'));var Sequelize=require(_0x8eb5('0x1'));module[_0x8eb5('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x8eb5('0x3')]},'leaveAt':{'type':Sequelize[_0x8eb5('0x3')]},'acceptAt':{'type':Sequelize[_0x8eb5('0x3')]},'exitAt':{'type':Sequelize[_0x8eb5('0x3')]},'reason':{'type':Sequelize[_0x8eb5('0x4')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 93e23ff..bd1d727 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 _0xcde7=['model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','params','length','create','body','find','describe','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','name','send','index','SmsQueueReport','rawAttributes','keys','query','filters','intersection'];(function(_0x2e6577,_0x1ba518){var _0x1c904=function(_0x58875c){while(--_0x58875c){_0x2e6577['push'](_0x2e6577['shift']());}};_0x1c904(++_0x1ba518);}(_0xcde7,0x65));var _0x7cde=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xcde7[_0x46e363];return _0x3fb059;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x7cde('0x0'));var zipdir=require(_0x7cde('0x1'));var jsonpatch=require(_0x7cde('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7cde('0x3'));var Mustache=require('mustache');var util=require(_0x7cde('0x4'));var path=require(_0x7cde('0x5'));var sox=require(_0x7cde('0x6'));var csv=require(_0x7cde('0x7'));var ejs=require(_0x7cde('0x8'));var fs=require('fs');var _=require(_0x7cde('0x9'));var squel=require('squel');var crypto=require(_0x7cde('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x7cde('0xb'));var toCsv=require(_0x7cde('0x7'));var querystring=require(_0x7cde('0xc'));var Papa=require(_0x7cde('0xd'));var Redis=require('ioredis');var authService=require(_0x7cde('0xe'));var qs=require(_0x7cde('0xf'));var hardwareService=require(_0x7cde('0x10'));var logger=require(_0x7cde('0x11'))(_0x7cde('0x12'));var utils=require(_0x7cde('0x13'));var config=require(_0x7cde('0x14'));var db=require(_0x7cde('0x15'))['db'];function respondWithStatusCode(_0xbc825c,_0x60c171){_0x60c171=_0x60c171||0xcc;return function(_0x5f127e){if(_0x5f127e){return _0xbc825c[_0x7cde('0x16')](_0x60c171);}return _0xbc825c[_0x7cde('0x17')](_0x60c171)[_0x7cde('0x18')]();};}function respondWithResult(_0x1c51b2,_0x10ed91){_0x10ed91=_0x10ed91||0xc8;return function(_0x27e8dc){if(_0x27e8dc){return _0x1c51b2[_0x7cde('0x17')](_0x10ed91)[_0x7cde('0x19')](_0x27e8dc);}};}function respondWithFilteredResult(_0x2db8a8,_0x5c1579){return function(_0x265821){if(_0x265821){var _0x35b20a=_0x265821[_0x7cde('0x1a')],_0x1b3398=_0x5c1579[_0x7cde('0x1b')],_0x1bad92=_0x5c1579[_0x7cde('0x1b')]+_0x5c1579[_0x7cde('0x1c')],_0x1b9ff1;if(_0x1bad92>=_0x35b20a){_0x1bad92=_0x35b20a;_0x1b9ff1=0xc8;}else{_0x1b9ff1=0xce;}_0x2db8a8[_0x7cde('0x17')](_0x1b9ff1);return _0x2db8a8[_0x7cde('0x1d')](_0x7cde('0x1e'),_0x1b3398+'-'+_0x1bad92+'/'+_0x35b20a)[_0x7cde('0x19')](_0x265821);}return null;};}function patchUpdates(_0x4844d2){return function(_0x1199f5){try{jsonpatch[_0x7cde('0x1f')](_0x1199f5,_0x4844d2,!![]);}catch(_0xf257a5){return BPromise['reject'](_0xf257a5);}return _0x1199f5[_0x7cde('0x20')]();};}function saveUpdates(_0x1a7eb0,_0x5dbf34){return function(_0x1f93f8){if(_0x1f93f8){return _0x1f93f8[_0x7cde('0x21')](_0x1a7eb0)[_0x7cde('0x22')](function(_0x3bf3be){return _0x3bf3be;});}return null;};}function removeEntity(_0x405031,_0x42891f){return function(_0x1200b4){if(_0x1200b4){return _0x1200b4[_0x7cde('0x23')]()['then'](function(){_0x405031[_0x7cde('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5735fe,_0x4e1e8f){return function(_0x261833){if(!_0x261833){_0x5735fe['sendStatus'](0x194);}return _0x261833;};}function handleError(_0xb28727,_0x447a4e){_0x447a4e=_0x447a4e||0x1f4;return function(_0x16439a){logger['error'](_0x16439a['stack']);if(_0x16439a[_0x7cde('0x24')]){delete _0x16439a['name'];}_0xb28727[_0x7cde('0x17')](_0x447a4e)[_0x7cde('0x25')](_0x16439a);};}exports[_0x7cde('0x26')]=function(_0x4b28b2,_0x14b4b1){var _0x44d650={},_0x4cf623={},_0x3a3b36={'count':0x0,'rows':[]};var _0x341479=db[_0x7cde('0x27')][_0x7cde('0x28')];_0x4cf623['model']=_[_0x7cde('0x29')](_0x341479);_0x4cf623['query']=_['keys'](_0x4b28b2[_0x7cde('0x2a')]);_0x4cf623[_0x7cde('0x2b')]=_[_0x7cde('0x2c')](_0x4cf623[_0x7cde('0x2d')],_0x4cf623[_0x7cde('0x2a')]);_0x44d650[_0x7cde('0x2e')]=_['intersection'](_0x4cf623['model'],qs[_0x7cde('0x2f')](_0x4b28b2[_0x7cde('0x2a')][_0x7cde('0x2f')]));_0x44d650[_0x7cde('0x2e')]=_0x44d650['attributes']['length']?_0x44d650[_0x7cde('0x2e')]:_0x4cf623[_0x7cde('0x2d')];if(!_0x4b28b2[_0x7cde('0x2a')][_0x7cde('0x30')](_0x7cde('0x31'))){_0x44d650['limit']=qs['limit'](_0x4b28b2[_0x7cde('0x2a')][_0x7cde('0x1c')]);_0x44d650[_0x7cde('0x1b')]=qs[_0x7cde('0x1b')](_0x4b28b2[_0x7cde('0x2a')]['offset']);}_0x44d650[_0x7cde('0x32')]=qs[_0x7cde('0x33')](_0x4b28b2[_0x7cde('0x2a')][_0x7cde('0x33')]);_0x44d650[_0x7cde('0x34')]=qs['filters'](_[_0x7cde('0x35')](_0x4b28b2[_0x7cde('0x2a')],_0x4cf623[_0x7cde('0x2b')]));if(_0x4b28b2[_0x7cde('0x2a')][_0x7cde('0x36')]){_0x44d650[_0x7cde('0x34')]=_[_0x7cde('0x37')](_0x44d650[_0x7cde('0x34')],{'$or':_[_0x7cde('0x38')](_0x341479,function(_0xc02812){if(_0xc02812[_0x7cde('0x39')][_0x7cde('0x3a')]!==_0x7cde('0x3b')){var _0x563c72={};_0x563c72[_0xc02812[_0x7cde('0x3c')]]={'$like':'%'+_0x4b28b2[_0x7cde('0x2a')][_0x7cde('0x36')]+'%'};return _0x563c72;}})});}_0x44d650=_[_0x7cde('0x37')]({},_0x44d650,_0x4b28b2[_0x7cde('0x3d')]);var _0x47096d={'where':_0x44d650[_0x7cde('0x34')]};return db[_0x7cde('0x27')][_0x7cde('0x1a')](_0x47096d)[_0x7cde('0x22')](function(_0x20b1a7){_0x3a3b36[_0x7cde('0x1a')]=_0x20b1a7;if(_0x4b28b2['query'][_0x7cde('0x3e')]){_0x44d650[_0x7cde('0x3f')]=[{'all':!![]}];}return db[_0x7cde('0x27')][_0x7cde('0x40')](_0x44d650);})[_0x7cde('0x22')](function(_0x4ece89){_0x3a3b36[_0x7cde('0x41')]=_0x4ece89;return _0x3a3b36;})[_0x7cde('0x22')](respondWithFilteredResult(_0x14b4b1,_0x44d650))[_0x7cde('0x42')](handleError(_0x14b4b1,null));};exports['show']=function(_0x4fade6,_0x226e35){var _0x4a0690={'raw':!![],'where':{'id':_0x4fade6[_0x7cde('0x43')]['id']}},_0x50d893={};_0x50d893[_0x7cde('0x2d')]=_[_0x7cde('0x29')](db[_0x7cde('0x27')][_0x7cde('0x28')]);_0x50d893['query']=_['keys'](_0x4fade6['query']);_0x50d893[_0x7cde('0x2b')]=_[_0x7cde('0x2c')](_0x50d893[_0x7cde('0x2d')],_0x50d893['query']);_0x4a0690[_0x7cde('0x2e')]=_[_0x7cde('0x2c')](_0x50d893[_0x7cde('0x2d')],qs[_0x7cde('0x2f')](_0x4fade6[_0x7cde('0x2a')][_0x7cde('0x2f')]));_0x4a0690[_0x7cde('0x2e')]=_0x4a0690[_0x7cde('0x2e')][_0x7cde('0x44')]?_0x4a0690[_0x7cde('0x2e')]:_0x50d893[_0x7cde('0x2d')];if(_0x4fade6[_0x7cde('0x2a')][_0x7cde('0x3e')]){_0x4a0690[_0x7cde('0x3f')]=[{'all':!![]}];}_0x4a0690=_['merge']({},_0x4a0690,_0x4fade6[_0x7cde('0x3d')]);return db[_0x7cde('0x27')]['find'](_0x4a0690)[_0x7cde('0x22')](handleEntityNotFound(_0x226e35,null))['then'](respondWithResult(_0x226e35,null))['catch'](handleError(_0x226e35,null));};exports[_0x7cde('0x45')]=function(_0x479436,_0x2bab9b){return db[_0x7cde('0x27')][_0x7cde('0x45')](_0x479436[_0x7cde('0x46')],{})[_0x7cde('0x22')](respondWithResult(_0x2bab9b,0xc9))[_0x7cde('0x42')](handleError(_0x2bab9b,null));};exports[_0x7cde('0x21')]=function(_0x8dc8a1,_0x57813d){if(_0x8dc8a1['body']['id']){delete _0x8dc8a1[_0x7cde('0x46')]['id'];}return db[_0x7cde('0x27')]['find']({'where':{'id':_0x8dc8a1[_0x7cde('0x43')]['id']}})[_0x7cde('0x22')](handleEntityNotFound(_0x57813d,null))[_0x7cde('0x22')](saveUpdates(_0x8dc8a1[_0x7cde('0x46')],null))[_0x7cde('0x22')](respondWithResult(_0x57813d,null))[_0x7cde('0x42')](handleError(_0x57813d,null));};exports['destroy']=function(_0x46a6d4,_0x1789d2){return db['SmsQueueReport'][_0x7cde('0x47')]({'where':{'id':_0x46a6d4[_0x7cde('0x43')]['id']}})[_0x7cde('0x22')](handleEntityNotFound(_0x1789d2,null))[_0x7cde('0x22')](removeEntity(_0x1789d2,null))[_0x7cde('0x42')](handleError(_0x1789d2,null));};exports[_0x7cde('0x48')]=function(_0x3b9bfa,_0x19aa46){return db['SmsQueueReport'][_0x7cde('0x48')]()['then'](respondWithResult(_0x19aa46,null))[_0x7cde('0x42')](handleError(_0x19aa46,null));}; \ No newline at end of file +var _0x960c=['rimraf','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','SmsQueueReport','rawAttributes','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','sort','where','pick','filter','merge','map','type','field','options','includeAll','include','findAll','show','params','find','create','catch','body','describe','html-pdf'];(function(_0x10bb0d,_0x3e78f8){var _0x56e489=function(_0x417cb0){while(--_0x417cb0){_0x10bb0d['push'](_0x10bb0d['shift']());}};_0x56e489(++_0x3e78f8);}(_0x960c,0x113));var _0xc960=function(_0x45a5b5,_0x1b01bb){_0x45a5b5=_0x45a5b5-0x0;var _0xaaed7c=_0x960c[_0x45a5b5];return _0xaaed7c;};'use strict';var pdf=require(_0xc960('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc960('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc960('0x2'));var rp=require(_0xc960('0x3'));var moment=require(_0xc960('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc960('0x5'));var util=require(_0xc960('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xc960('0x7'));var ejs=require(_0xc960('0x8'));var fs=require('fs');var _=require(_0xc960('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc960('0xa'));var deskjs=require(_0xc960('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc960('0xc'));var Redis=require(_0xc960('0xd'));var authService=require(_0xc960('0xe'));var qs=require(_0xc960('0xf'));var hardwareService=require(_0xc960('0x10'));var logger=require('../../config/logger')(_0xc960('0x11'));var utils=require(_0xc960('0x12'));var config=require(_0xc960('0x13'));var db=require(_0xc960('0x14'))['db'];function respondWithStatusCode(_0x196df7,_0x4400e){_0x4400e=_0x4400e||0xcc;return function(_0x371361){if(_0x371361){return _0x196df7[_0xc960('0x15')](_0x4400e);}return _0x196df7[_0xc960('0x16')](_0x4400e)[_0xc960('0x17')]();};}function respondWithResult(_0x2b1a94,_0x501cb0){_0x501cb0=_0x501cb0||0xc8;return function(_0x3a6e2c){if(_0x3a6e2c){return _0x2b1a94[_0xc960('0x16')](_0x501cb0)[_0xc960('0x18')](_0x3a6e2c);}};}function respondWithFilteredResult(_0x1d4822,_0x5dd24f){return function(_0x1fb9fe){if(_0x1fb9fe){var _0x49326c=_0x1fb9fe[_0xc960('0x19')],_0x195ff0=_0x5dd24f[_0xc960('0x1a')],_0x43cd5a=_0x5dd24f[_0xc960('0x1a')]+_0x5dd24f[_0xc960('0x1b')],_0x1d062a;if(_0x43cd5a>=_0x49326c){_0x43cd5a=_0x49326c;_0x1d062a=0xc8;}else{_0x1d062a=0xce;}_0x1d4822[_0xc960('0x16')](_0x1d062a);return _0x1d4822[_0xc960('0x1c')](_0xc960('0x1d'),_0x195ff0+'-'+_0x43cd5a+'/'+_0x49326c)[_0xc960('0x18')](_0x1fb9fe);}return null;};}function patchUpdates(_0x30503b){return function(_0x3a23b3){try{jsonpatch['apply'](_0x3a23b3,_0x30503b,!![]);}catch(_0x6ad87d){return BPromise[_0xc960('0x1e')](_0x6ad87d);}return _0x3a23b3[_0xc960('0x1f')]();};}function saveUpdates(_0x37410a,_0x27c755){return function(_0x5e0536){if(_0x5e0536){return _0x5e0536[_0xc960('0x20')](_0x37410a)[_0xc960('0x21')](function(_0x232375){return _0x232375;});}return null;};}function removeEntity(_0x2cfd26,_0x353526){return function(_0x881df5){if(_0x881df5){return _0x881df5[_0xc960('0x22')]()[_0xc960('0x21')](function(){_0x2cfd26[_0xc960('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5671f2,_0x9cf5e8){return function(_0x536ed4){if(!_0x536ed4){_0x5671f2[_0xc960('0x15')](0x194);}return _0x536ed4;};}function handleError(_0x48fc21,_0x3b140e){_0x3b140e=_0x3b140e||0x1f4;return function(_0x90c05e){logger[_0xc960('0x23')](_0x90c05e[_0xc960('0x24')]);if(_0x90c05e[_0xc960('0x25')]){delete _0x90c05e[_0xc960('0x25')];}_0x48fc21[_0xc960('0x16')](_0x3b140e)[_0xc960('0x26')](_0x90c05e);};}exports['index']=function(_0x274481,_0x207e5b){var _0x2e1d7d={},_0x9dcee1={},_0x24cc4e={'count':0x0,'rows':[]};var _0x2ebe29=db[_0xc960('0x27')][_0xc960('0x28')];_0x9dcee1['model']=_['keys'](_0x2ebe29);_0x9dcee1['query']=_[_0xc960('0x29')](_0x274481[_0xc960('0x2a')]);_0x9dcee1[_0xc960('0x2b')]=_[_0xc960('0x2c')](_0x9dcee1['model'],_0x9dcee1['query']);_0x2e1d7d[_0xc960('0x2d')]=_[_0xc960('0x2c')](_0x9dcee1[_0xc960('0x2e')],qs[_0xc960('0x2f')](_0x274481[_0xc960('0x2a')]['fields']));_0x2e1d7d[_0xc960('0x2d')]=_0x2e1d7d[_0xc960('0x2d')][_0xc960('0x30')]?_0x2e1d7d['attributes']:_0x9dcee1[_0xc960('0x2e')];if(!_0x274481['query'][_0xc960('0x31')]('nolimit')){_0x2e1d7d[_0xc960('0x1b')]=qs[_0xc960('0x1b')](_0x274481[_0xc960('0x2a')][_0xc960('0x1b')]);_0x2e1d7d[_0xc960('0x1a')]=qs[_0xc960('0x1a')](_0x274481[_0xc960('0x2a')]['offset']);}_0x2e1d7d['order']=qs[_0xc960('0x32')](_0x274481[_0xc960('0x2a')][_0xc960('0x32')]);_0x2e1d7d[_0xc960('0x33')]=qs['filters'](_[_0xc960('0x34')](_0x274481[_0xc960('0x2a')],_0x9dcee1[_0xc960('0x2b')]));if(_0x274481[_0xc960('0x2a')][_0xc960('0x35')]){_0x2e1d7d[_0xc960('0x33')]=_[_0xc960('0x36')](_0x2e1d7d[_0xc960('0x33')],{'$or':_[_0xc960('0x37')](_0x2ebe29,function(_0x228252){if(_0x228252[_0xc960('0x38')]['key']!=='VIRTUAL'){var _0x1b9e8c={};_0x1b9e8c[_0x228252[_0xc960('0x39')]]={'$like':'%'+_0x274481[_0xc960('0x2a')][_0xc960('0x35')]+'%'};return _0x1b9e8c;}})});}_0x2e1d7d=_[_0xc960('0x36')]({},_0x2e1d7d,_0x274481[_0xc960('0x3a')]);var _0x503f94={'where':_0x2e1d7d[_0xc960('0x33')]};return db['SmsQueueReport'][_0xc960('0x19')](_0x503f94)[_0xc960('0x21')](function(_0x40ed9c){_0x24cc4e[_0xc960('0x19')]=_0x40ed9c;if(_0x274481[_0xc960('0x2a')][_0xc960('0x3b')]){_0x2e1d7d[_0xc960('0x3c')]=[{'all':!![]}];}return db['SmsQueueReport'][_0xc960('0x3d')](_0x2e1d7d);})[_0xc960('0x21')](function(_0x123edc){_0x24cc4e['rows']=_0x123edc;return _0x24cc4e;})[_0xc960('0x21')](respondWithFilteredResult(_0x207e5b,_0x2e1d7d))['catch'](handleError(_0x207e5b,null));};exports[_0xc960('0x3e')]=function(_0x65a99f,_0x40f236){var _0x577423={'raw':!![],'where':{'id':_0x65a99f[_0xc960('0x3f')]['id']}},_0xe160c4={};_0xe160c4[_0xc960('0x2e')]=_[_0xc960('0x29')](db[_0xc960('0x27')][_0xc960('0x28')]);_0xe160c4[_0xc960('0x2a')]=_[_0xc960('0x29')](_0x65a99f['query']);_0xe160c4[_0xc960('0x2b')]=_[_0xc960('0x2c')](_0xe160c4[_0xc960('0x2e')],_0xe160c4[_0xc960('0x2a')]);_0x577423[_0xc960('0x2d')]=_[_0xc960('0x2c')](_0xe160c4[_0xc960('0x2e')],qs[_0xc960('0x2f')](_0x65a99f[_0xc960('0x2a')][_0xc960('0x2f')]));_0x577423[_0xc960('0x2d')]=_0x577423[_0xc960('0x2d')]['length']?_0x577423[_0xc960('0x2d')]:_0xe160c4[_0xc960('0x2e')];if(_0x65a99f[_0xc960('0x2a')][_0xc960('0x3b')]){_0x577423[_0xc960('0x3c')]=[{'all':!![]}];}_0x577423=_[_0xc960('0x36')]({},_0x577423,_0x65a99f[_0xc960('0x3a')]);return db['SmsQueueReport'][_0xc960('0x40')](_0x577423)[_0xc960('0x21')](handleEntityNotFound(_0x40f236,null))[_0xc960('0x21')](respondWithResult(_0x40f236,null))['catch'](handleError(_0x40f236,null));};exports[_0xc960('0x41')]=function(_0x2f0c5e,_0x4050a6){return db['SmsQueueReport']['create'](_0x2f0c5e['body'],{})[_0xc960('0x21')](respondWithResult(_0x4050a6,0xc9))[_0xc960('0x42')](handleError(_0x4050a6,null));};exports[_0xc960('0x20')]=function(_0x13d098,_0x39d1c8){if(_0x13d098[_0xc960('0x43')]['id']){delete _0x13d098[_0xc960('0x43')]['id'];}return db['SmsQueueReport'][_0xc960('0x40')]({'where':{'id':_0x13d098[_0xc960('0x3f')]['id']}})[_0xc960('0x21')](handleEntityNotFound(_0x39d1c8,null))[_0xc960('0x21')](saveUpdates(_0x13d098[_0xc960('0x43')],null))[_0xc960('0x21')](respondWithResult(_0x39d1c8,null))['catch'](handleError(_0x39d1c8,null));};exports['destroy']=function(_0x2ec45b,_0x232479){return db['SmsQueueReport']['find']({'where':{'id':_0x2ec45b[_0xc960('0x3f')]['id']}})[_0xc960('0x21')](handleEntityNotFound(_0x232479,null))[_0xc960('0x21')](removeEntity(_0x232479,null))['catch'](handleError(_0x232479,null));};exports[_0xc960('0x44')]=function(_0x1aff82,_0x37f625){return db[_0xc960('0x27')][_0xc960('0x44')]()[_0xc960('0x21')](respondWithResult(_0x37f625,null))[_0xc960('0x42')](handleError(_0x37f625,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 21652be..feb9aa2 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 _0xb190=['../../config/logger','api','bluebird','path','exports','SmsQueueReport','lodash','util'];(function(_0x2ab0cf,_0x2469fb){var _0x2b7455=function(_0x509ead){while(--_0x509ead){_0x2ab0cf['push'](_0x2ab0cf['shift']());}};_0x2b7455(++_0x2469fb);}(_0xb190,0xce));var _0x0b19=function(_0x16e265,_0x504299){_0x16e265=_0x16e265-0x0;var _0x5a3c45=_0xb190[_0x16e265];return _0x5a3c45;};'use strict';var _=require(_0x0b19('0x0'));var util=require(_0x0b19('0x1'));var logger=require(_0x0b19('0x2'))(_0x0b19('0x3'));var moment=require('moment');var BPromise=require(_0x0b19('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0b19('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./smsQueueReport.attributes');module[_0x0b19('0x6')]=function(_0x81dca3,_0x2de62d){return _0x81dca3['define'](_0x0b19('0x7'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x8e0d=['moment','bluebird','path','rimraf','../../config/environment','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','../../config/logger','api'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x8e0d,0x1aa));var _0xd8e0=function(_0x3e0b8f,_0x1cddeb){_0x3e0b8f=_0x3e0b8f-0x0;var _0x22f742=_0x8e0d[_0x3e0b8f];return _0x22f742;};'use strict';var _=require(_0xd8e0('0x0'));var util=require('util');var logger=require(_0xd8e0('0x1'))(_0xd8e0('0x2'));var moment=require(_0xd8e0('0x3'));var BPromise=require(_0xd8e0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd8e0('0x5'));var rimraf=require(_0xd8e0('0x6'));var config=require(_0xd8e0('0x7'));var attributes=require('./smsQueueReport.attributes');module[_0xd8e0('0x8')]=function(_0x460b45,_0x314a53){return _0x460b45[_0xd8e0('0x9')](_0xd8e0('0xa'),attributes,{'tableName':_0xd8e0('0xb'),'paranoid':![],'indexes':[{'name':_0xd8e0('0xc'),'fields':[_0xd8e0('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 7eca560..90536a8 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 _0xeb03=['message','result','catch','SmsQueueReport','create','body','options','raw','CreateSmsQueueReport','where','UpdateSmsQueueReport','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x3e2ce6,_0x1e055c){var _0x4ccc1b=function(_0x3c7cb9){while(--_0x3c7cb9){_0x3e2ce6['push'](_0x3e2ce6['shift']());}};_0x4ccc1b(++_0x1e055c);}(_0xeb03,0x97));var _0x3eb0=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xeb03[_0x3ff085];return _0x2b68c3;};'use strict';var _=require('lodash');var util=require(_0x3eb0('0x0'));var moment=require(_0x3eb0('0x1'));var BPromise=require('bluebird');var rs=require(_0x3eb0('0x2'));var fs=require('fs');var Redis=require(_0x3eb0('0x3'));var db=require(_0x3eb0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3eb0('0x5'))('rpc');var config=require(_0x3eb0('0x6'));var jayson=require(_0x3eb0('0x7'));var client=jayson[_0x3eb0('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe9b61,_0x38ee29,_0x2e8e1e){return new BPromise(function(_0x45f7d0,_0x42b29f){return client[_0x3eb0('0x9')](_0xe9b61,_0x2e8e1e)[_0x3eb0('0xa')](function(_0x338fbc){logger[_0x3eb0('0xb')](_0x3eb0('0xc'),_0x38ee29,_0x3eb0('0xd'));logger[_0x3eb0('0xe')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x38ee29,_0x3eb0('0xd'),JSON[_0x3eb0('0xf')](_0x338fbc));if(_0x338fbc[_0x3eb0('0x10')]){if(_0x338fbc[_0x3eb0('0x10')]['code']===0x1f4){logger[_0x3eb0('0x10')](_0x3eb0('0xc'),_0x38ee29,_0x338fbc[_0x3eb0('0x10')][_0x3eb0('0x11')]);return _0x42b29f(_0x338fbc[_0x3eb0('0x10')][_0x3eb0('0x11')]);}logger[_0x3eb0('0x10')](_0x3eb0('0xc'),_0x38ee29,_0x338fbc[_0x3eb0('0x10')][_0x3eb0('0x11')]);return _0x45f7d0(_0x338fbc[_0x3eb0('0x10')][_0x3eb0('0x11')]);}else{logger[_0x3eb0('0xb')](_0x3eb0('0xc'),_0x38ee29,_0x3eb0('0xd'));_0x45f7d0(_0x338fbc[_0x3eb0('0x12')][_0x3eb0('0x11')]);}})[_0x3eb0('0x13')](function(_0x17ca83){logger['error'](_0x3eb0('0xc'),_0x38ee29,_0x17ca83);_0x42b29f(_0x17ca83);});});}exports['CreateSmsQueueReport']=function(_0x30f339){var _0x2ef2c7=this;return new Promise(function(_0x407d31,_0x55fc3b){return db[_0x3eb0('0x14')][_0x3eb0('0x15')](_0x30f339[_0x3eb0('0x16')],{'raw':_0x30f339[_0x3eb0('0x17')]?_0x30f339[_0x3eb0('0x17')][_0x3eb0('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x48e27b){logger[_0x3eb0('0xb')]('CreateSmsQueueReport',_0x30f339);logger[_0x3eb0('0xe')](_0x3eb0('0x19'),_0x30f339,JSON[_0x3eb0('0xf')](_0x48e27b));_0x407d31(_0x48e27b);})[_0x3eb0('0x13')](function(_0x3483a3){logger[_0x3eb0('0x10')](_0x3eb0('0x19'),_0x3483a3[_0x3eb0('0x11')],_0x30f339);_0x55fc3b(_0x2ef2c7['error'](0x1f4,_0x3483a3['message']));});});};exports['UpdateSmsQueueReport']=function(_0x2b35fc){var _0xd2ac31=this;return new Promise(function(_0x1a92c4,_0x6486f0){return db[_0x3eb0('0x14')]['update'](_0x2b35fc[_0x3eb0('0x16')],{'raw':_0x2b35fc[_0x3eb0('0x17')]?_0x2b35fc[_0x3eb0('0x17')][_0x3eb0('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b35fc[_0x3eb0('0x17')]?_0x2b35fc[_0x3eb0('0x17')][_0x3eb0('0x1a')]||null:null,'attributes':_0x2b35fc['options']?_0x2b35fc['options']['attributes']||null:null,'limit':_0x2b35fc['options']?_0x2b35fc[_0x3eb0('0x17')]['limit']||null:null})[_0x3eb0('0xa')](function(_0x3e364a){logger[_0x3eb0('0xb')](_0x3eb0('0x1b'),_0x2b35fc);logger[_0x3eb0('0xe')](_0x3eb0('0x1b'),_0x2b35fc,JSON[_0x3eb0('0xf')](_0x3e364a));_0x1a92c4(_0x3e364a);})['catch'](function(_0x107f99){logger[_0x3eb0('0x10')](_0x3eb0('0x1b'),_0x107f99[_0x3eb0('0x11')],_0x2b35fc);_0x6486f0(_0xd2ac31[_0x3eb0('0x10')](0x1f4,_0x107f99[_0x3eb0('0x11')]));});});}; \ No newline at end of file +var _0x2520=['SmsQueueReport','update','attributes','limit','catch','util','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','create','body','options','raw','CreateSmsQueueReport','UpdateSmsQueueReport'];(function(_0x324fe8,_0x1ccb46){var _0x4a1cd9=function(_0x506af2){while(--_0x506af2){_0x324fe8['push'](_0x324fe8['shift']());}};_0x4a1cd9(++_0x1ccb46);}(_0x2520,0xf5));var _0x0252=function(_0x458fbb,_0x506583){_0x458fbb=_0x458fbb-0x0;var _0x2979ed=_0x2520[_0x458fbb];return _0x2979ed;};'use strict';var _=require('lodash');var util=require(_0x0252('0x0'));var moment=require('moment');var BPromise=require(_0x0252('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0252('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x0252('0x3'));var logger=require(_0x0252('0x4'))('rpc');var config=require(_0x0252('0x5'));var jayson=require(_0x0252('0x6'));var client=jayson[_0x0252('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15d3c0,_0x39493d,_0x5962ba){return new BPromise(function(_0x4c0dc5,_0x2719ae){return client['request'](_0x15d3c0,_0x5962ba)[_0x0252('0x8')](function(_0x9cc106){logger[_0x0252('0x9')](_0x0252('0xa'),_0x39493d,'request\x20sent');logger[_0x0252('0xb')](_0x0252('0xc'),_0x39493d,_0x0252('0xd'),JSON[_0x0252('0xe')](_0x9cc106));if(_0x9cc106[_0x0252('0xf')]){if(_0x9cc106[_0x0252('0xf')][_0x0252('0x10')]===0x1f4){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x39493d,_0x9cc106['error'][_0x0252('0x11')]);return _0x2719ae(_0x9cc106[_0x0252('0xf')][_0x0252('0x11')]);}logger[_0x0252('0xf')]('SmsQueueReport,\x20%s,\x20%s',_0x39493d,_0x9cc106[_0x0252('0xf')][_0x0252('0x11')]);return _0x4c0dc5(_0x9cc106[_0x0252('0xf')][_0x0252('0x11')]);}else{logger[_0x0252('0x9')]('SmsQueueReport,\x20%s,\x20%s',_0x39493d,_0x0252('0xd'));_0x4c0dc5(_0x9cc106[_0x0252('0x12')][_0x0252('0x11')]);}})['catch'](function(_0x3778da){logger[_0x0252('0xf')](_0x0252('0xa'),_0x39493d,_0x3778da);_0x2719ae(_0x3778da);});});}exports['CreateSmsQueueReport']=function(_0x51f1fa){var _0x594fcd=this;return new Promise(function(_0x4337d9,_0x33ad66){return db['SmsQueueReport'][_0x0252('0x13')](_0x51f1fa[_0x0252('0x14')],{'raw':_0x51f1fa[_0x0252('0x15')]?_0x51f1fa[_0x0252('0x15')][_0x0252('0x16')]===undefined?!![]:![]:!![]})[_0x0252('0x8')](function(_0x3554e9){logger[_0x0252('0x9')](_0x0252('0x17'),_0x51f1fa);logger[_0x0252('0xb')](_0x0252('0x17'),_0x51f1fa,JSON[_0x0252('0xe')](_0x3554e9));_0x4337d9(_0x3554e9);})['catch'](function(_0x58194a){logger['error']('CreateSmsQueueReport',_0x58194a['message'],_0x51f1fa);_0x33ad66(_0x594fcd[_0x0252('0xf')](0x1f4,_0x58194a[_0x0252('0x11')]));});});};exports[_0x0252('0x18')]=function(_0x5622c6){var _0x410d64=this;return new Promise(function(_0x32d770,_0x35e6e7){return db[_0x0252('0x19')][_0x0252('0x1a')](_0x5622c6[_0x0252('0x14')],{'raw':_0x5622c6[_0x0252('0x15')]?_0x5622c6[_0x0252('0x15')][_0x0252('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5622c6[_0x0252('0x15')]?_0x5622c6[_0x0252('0x15')]['where']||null:null,'attributes':_0x5622c6['options']?_0x5622c6[_0x0252('0x15')][_0x0252('0x1b')]||null:null,'limit':_0x5622c6[_0x0252('0x15')]?_0x5622c6[_0x0252('0x15')][_0x0252('0x1c')]||null:null})[_0x0252('0x8')](function(_0x4ebc40){logger[_0x0252('0x9')](_0x0252('0x18'),_0x5622c6);logger[_0x0252('0xb')](_0x0252('0x18'),_0x5622c6,JSON['stringify'](_0x4ebc40));_0x32d770(_0x4ebc40);})[_0x0252('0x1d')](function(_0x23859d){logger[_0x0252('0xf')]('UpdateSmsQueueReport',_0x23859d[_0x0252('0x11')],_0x5622c6);_0x35e6e7(_0x410d64[_0x0252('0xf')](0x1f4,_0x23859d[_0x0252('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index e6672e9..fae1b50 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 _0x578b=['show','post','create','put','/:id','update','destroy','exports','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','isAuthenticated','get','/describe','describe'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x578b,0x104));var _0xb578=function(_0x141486,_0x58ed56){_0x141486=_0x141486-0x0;var _0x1b5fb9=_0x578b[_0x141486];return _0x1b5fb9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb578('0x0'));var timeout=require(_0xb578('0x1'));var express=require('express');var router=express[_0xb578('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xb578('0x3'));var config=require(_0xb578('0x4'));var controller=require(_0xb578('0x5'));router['get']('/',auth[_0xb578('0x6')](),controller['index']);router[_0xb578('0x7')](_0xb578('0x8'),auth['isAuthenticated'](),controller[_0xb578('0x9')]);router[_0xb578('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xb578('0xa')]);router[_0xb578('0xb')]('/',auth[_0xb578('0x6')](),controller[_0xb578('0xc')]);router[_0xb578('0xd')](_0xb578('0xe'),auth['isAuthenticated'](),controller[_0xb578('0xf')]);router['delete'](_0xb578('0xe'),auth[_0xb578('0x6')](),controller[_0xb578('0x10')]);module[_0xb578('0x11')]=router; \ No newline at end of file +var _0x775c=['./smsTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','post','put','update','delete','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x37275e,_0x1eb9b){var _0x6d3d27=function(_0x49dc06){while(--_0x49dc06){_0x37275e['push'](_0x37275e['shift']());}};_0x6d3d27(++_0x1eb9b);}(_0x775c,0x161));var _0xc775=function(_0x5400a1,_0x2275aa){_0x5400a1=_0x5400a1-0x0;var _0x4006c7=_0x775c[_0x5400a1];return _0x4006c7;};'use strict';var multer=require(_0xc775('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc775('0x1'));var express=require(_0xc775('0x2'));var router=express[_0xc775('0x3')]();var auth=require(_0xc775('0x4'));var interaction=require(_0xc775('0x5'));var config=require(_0xc775('0x6'));var controller=require(_0xc775('0x7'));router[_0xc775('0x8')]('/',auth[_0xc775('0x9')](),controller[_0xc775('0xa')]);router[_0xc775('0x8')]('/describe',auth[_0xc775('0x9')](),controller[_0xc775('0xb')]);router[_0xc775('0x8')](_0xc775('0xc'),auth[_0xc775('0x9')](),controller[_0xc775('0xd')]);router[_0xc775('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc775('0xf')](_0xc775('0xc'),auth[_0xc775('0x9')](),controller[_0xc775('0x10')]);router[_0xc775('0x11')](_0xc775('0xc'),auth[_0xc775('0x9')](),controller['destroy']);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 9101e2f..36905ca 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 _0x6da9=['DATE','NOW','moment','sequelize','exports','STRING','ENUM','account','agent','queue'];(function(_0x3d38f0,_0x1750bd){var _0x329af5=function(_0x50cd8d){while(--_0x50cd8d){_0x3d38f0['push'](_0x3d38f0['shift']());}};_0x329af5(++_0x1750bd);}(_0x6da9,0x16a));var _0x96da=function(_0x4a69fb,_0x410bfc){_0x4a69fb=_0x4a69fb-0x0;var _0xdf421a=_0x6da9[_0x4a69fb];return _0xdf421a;};'use strict';var moment=require(_0x96da('0x0'));var Sequelize=require(_0x96da('0x1'));module[_0x96da('0x2')]={'uniqueid':{'type':Sequelize[_0x96da('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x96da('0x4')](_0x96da('0x5'),_0x96da('0x6'),_0x96da('0x7')),'allowNull':![],'defaultValue':_0x96da('0x7')},'transferredAt':{'type':Sequelize[_0x96da('0x8')],'allowNull':![],'defaultValue':Sequelize[_0x96da('0x9')]}}; \ No newline at end of file +var _0xdf06=['account','agent','queue','DATE','NOW','sequelize','exports','STRING'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0xdf06,0x1d5));var _0x6df0=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xdf06[_0x3e5086];return _0xfeb102;};'use strict';var moment=require('moment');var Sequelize=require(_0x6df0('0x0'));module[_0x6df0('0x1')]={'uniqueid':{'type':Sequelize[_0x6df0('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x6df0('0x3'),_0x6df0('0x4'),_0x6df0('0x5')),'allowNull':![],'defaultValue':_0x6df0('0x5')},'transferredAt':{'type':Sequelize[_0x6df0('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x6df0('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 45d9d1a..473b554 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 _0x9e74=['desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','set','apply','update','then','error','stack','name','send','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','filter','merge','map','field','options','SmsTransferReport','includeAll','rows','show','params','rawAttributes','include','find','create','body','catch','destroy','describe','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','util','path','to-csv','squel','crypto'];(function(_0x5bac53,_0x49c531){var _0x3af907=function(_0x48a603){while(--_0x48a603){_0x5bac53['push'](_0x5bac53['shift']());}};_0x3af907(++_0x49c531);}(_0x9e74,0x109));var _0x49e7=function(_0x3038ef,_0x35d2bd){_0x3038ef=_0x3038ef-0x0;var _0x2fade3=_0x9e74[_0x3038ef];return _0x2fade3;};'use strict';var pdf=require(_0x49e7('0x0'));var emlformat=require(_0x49e7('0x1'));var rimraf=require(_0x49e7('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x49e7('0x3'));var moment=require(_0x49e7('0x4'));var BPromise=require(_0x49e7('0x5'));var Mustache=require('mustache');var util=require(_0x49e7('0x6'));var path=require(_0x49e7('0x7'));var sox=require('sox');var csv=require(_0x49e7('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x49e7('0x9'));var crypto=require(_0x49e7('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x49e7('0xb'));var toCsv=require(_0x49e7('0x8'));var querystring=require(_0x49e7('0xc'));var Papa=require(_0x49e7('0xd'));var Redis=require(_0x49e7('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x49e7('0xf'));var hardwareService=require(_0x49e7('0x10'));var logger=require(_0x49e7('0x11'))(_0x49e7('0x12'));var utils=require(_0x49e7('0x13'));var config=require(_0x49e7('0x14'));var db=require(_0x49e7('0x15'))['db'];function respondWithStatusCode(_0x591fb6,_0x38680b){_0x38680b=_0x38680b||0xcc;return function(_0x1dc3f6){if(_0x1dc3f6){return _0x591fb6[_0x49e7('0x16')](_0x38680b);}return _0x591fb6['status'](_0x38680b)[_0x49e7('0x17')]();};}function respondWithResult(_0x302d1a,_0x5a679e){_0x5a679e=_0x5a679e||0xc8;return function(_0x31b7fc){if(_0x31b7fc){return _0x302d1a[_0x49e7('0x18')](_0x5a679e)[_0x49e7('0x19')](_0x31b7fc);}};}function respondWithFilteredResult(_0xd6b68e,_0xa37348){return function(_0x35beb6){if(_0x35beb6){var _0x5a7909=_0x35beb6[_0x49e7('0x1a')],_0x63001b=_0xa37348['offset'],_0x3597c6=_0xa37348['offset']+_0xa37348['limit'],_0x4e6754;if(_0x3597c6>=_0x5a7909){_0x3597c6=_0x5a7909;_0x4e6754=0xc8;}else{_0x4e6754=0xce;}_0xd6b68e[_0x49e7('0x18')](_0x4e6754);return _0xd6b68e[_0x49e7('0x1b')]('Content-Range',_0x63001b+'-'+_0x3597c6+'/'+_0x5a7909)[_0x49e7('0x19')](_0x35beb6);}return null;};}function patchUpdates(_0xb6dbb3){return function(_0x38e21a){try{jsonpatch[_0x49e7('0x1c')](_0x38e21a,_0xb6dbb3,!![]);}catch(_0x3a4c26){return BPromise['reject'](_0x3a4c26);}return _0x38e21a['save']();};}function saveUpdates(_0x315c29,_0x4ca739){return function(_0x198c2c){if(_0x198c2c){return _0x198c2c[_0x49e7('0x1d')](_0x315c29)[_0x49e7('0x1e')](function(_0x1025ce){return _0x1025ce;});}return null;};}function removeEntity(_0x6c2be3,_0x556e12){return function(_0x11bbc6){if(_0x11bbc6){return _0x11bbc6['destroy']()[_0x49e7('0x1e')](function(){_0x6c2be3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x381678,_0xc20ea3){return function(_0x139ddf){if(!_0x139ddf){_0x381678[_0x49e7('0x16')](0x194);}return _0x139ddf;};}function handleError(_0x5b6e53,_0x3671f9){_0x3671f9=_0x3671f9||0x1f4;return function(_0x1a1b23){logger[_0x49e7('0x1f')](_0x1a1b23[_0x49e7('0x20')]);if(_0x1a1b23[_0x49e7('0x21')]){delete _0x1a1b23['name'];}_0x5b6e53[_0x49e7('0x18')](_0x3671f9)[_0x49e7('0x22')](_0x1a1b23);};}exports['index']=function(_0x164ec6,_0x16d2f6){var _0x56bd14={},_0x26f715={},_0x123616={'count':0x0,'rows':[]};var _0x52f882=db['SmsTransferReport']['rawAttributes'];_0x26f715[_0x49e7('0x23')]=_[_0x49e7('0x24')](_0x52f882);_0x26f715[_0x49e7('0x25')]=_[_0x49e7('0x24')](_0x164ec6[_0x49e7('0x25')]);_0x26f715[_0x49e7('0x26')]=_[_0x49e7('0x27')](_0x26f715[_0x49e7('0x23')],_0x26f715[_0x49e7('0x25')]);_0x56bd14['attributes']=_[_0x49e7('0x27')](_0x26f715['model'],qs['fields'](_0x164ec6['query'][_0x49e7('0x28')]));_0x56bd14[_0x49e7('0x29')]=_0x56bd14[_0x49e7('0x29')][_0x49e7('0x2a')]?_0x56bd14[_0x49e7('0x29')]:_0x26f715[_0x49e7('0x23')];if(!_0x164ec6[_0x49e7('0x25')][_0x49e7('0x2b')](_0x49e7('0x2c'))){_0x56bd14[_0x49e7('0x2d')]=qs[_0x49e7('0x2d')](_0x164ec6[_0x49e7('0x25')][_0x49e7('0x2d')]);_0x56bd14[_0x49e7('0x2e')]=qs[_0x49e7('0x2e')](_0x164ec6[_0x49e7('0x25')][_0x49e7('0x2e')]);}_0x56bd14[_0x49e7('0x2f')]=qs[_0x49e7('0x30')](_0x164ec6[_0x49e7('0x25')][_0x49e7('0x30')]);_0x56bd14[_0x49e7('0x31')]=qs[_0x49e7('0x26')](_[_0x49e7('0x32')](_0x164ec6[_0x49e7('0x25')],_0x26f715[_0x49e7('0x26')]));if(_0x164ec6[_0x49e7('0x25')][_0x49e7('0x33')]){_0x56bd14[_0x49e7('0x31')]=_[_0x49e7('0x34')](_0x56bd14[_0x49e7('0x31')],{'$or':_[_0x49e7('0x35')](_0x52f882,function(_0x53b26f){if(_0x53b26f['type']['key']!=='VIRTUAL'){var _0x31d1b2={};_0x31d1b2[_0x53b26f[_0x49e7('0x36')]]={'$like':'%'+_0x164ec6['query'][_0x49e7('0x33')]+'%'};return _0x31d1b2;}})});}_0x56bd14=_[_0x49e7('0x34')]({},_0x56bd14,_0x164ec6[_0x49e7('0x37')]);var _0x20171f={'where':_0x56bd14['where']};return db[_0x49e7('0x38')]['count'](_0x20171f)[_0x49e7('0x1e')](function(_0xb43d3b){_0x123616[_0x49e7('0x1a')]=_0xb43d3b;if(_0x164ec6['query'][_0x49e7('0x39')]){_0x56bd14['include']=[{'all':!![]}];}return db[_0x49e7('0x38')]['findAll'](_0x56bd14);})[_0x49e7('0x1e')](function(_0x5b38fc){_0x123616[_0x49e7('0x3a')]=_0x5b38fc;return _0x123616;})[_0x49e7('0x1e')](respondWithFilteredResult(_0x16d2f6,_0x56bd14))['catch'](handleError(_0x16d2f6,null));};exports[_0x49e7('0x3b')]=function(_0x24516d,_0x244b85){var _0x3d2c74={'raw':!![],'where':{'id':_0x24516d[_0x49e7('0x3c')]['id']}},_0x4cd5aa={};_0x4cd5aa[_0x49e7('0x23')]=_[_0x49e7('0x24')](db[_0x49e7('0x38')][_0x49e7('0x3d')]);_0x4cd5aa[_0x49e7('0x25')]=_['keys'](_0x24516d[_0x49e7('0x25')]);_0x4cd5aa[_0x49e7('0x26')]=_[_0x49e7('0x27')](_0x4cd5aa[_0x49e7('0x23')],_0x4cd5aa[_0x49e7('0x25')]);_0x3d2c74['attributes']=_[_0x49e7('0x27')](_0x4cd5aa[_0x49e7('0x23')],qs[_0x49e7('0x28')](_0x24516d[_0x49e7('0x25')]['fields']));_0x3d2c74[_0x49e7('0x29')]=_0x3d2c74[_0x49e7('0x29')]['length']?_0x3d2c74['attributes']:_0x4cd5aa['model'];if(_0x24516d[_0x49e7('0x25')][_0x49e7('0x39')]){_0x3d2c74[_0x49e7('0x3e')]=[{'all':!![]}];}_0x3d2c74=_[_0x49e7('0x34')]({},_0x3d2c74,_0x24516d[_0x49e7('0x37')]);return db[_0x49e7('0x38')][_0x49e7('0x3f')](_0x3d2c74)[_0x49e7('0x1e')](handleEntityNotFound(_0x244b85,null))[_0x49e7('0x1e')](respondWithResult(_0x244b85,null))['catch'](handleError(_0x244b85,null));};exports['create']=function(_0xff6c2e,_0x468971){return db[_0x49e7('0x38')][_0x49e7('0x40')](_0xff6c2e[_0x49e7('0x41')],{})[_0x49e7('0x1e')](respondWithResult(_0x468971,0xc9))[_0x49e7('0x42')](handleError(_0x468971,null));};exports['update']=function(_0x1ad20d,_0x71a1d8){if(_0x1ad20d['body']['id']){delete _0x1ad20d[_0x49e7('0x41')]['id'];}return db[_0x49e7('0x38')][_0x49e7('0x3f')]({'where':{'id':_0x1ad20d[_0x49e7('0x3c')]['id']}})[_0x49e7('0x1e')](handleEntityNotFound(_0x71a1d8,null))[_0x49e7('0x1e')](saveUpdates(_0x1ad20d['body'],null))['then'](respondWithResult(_0x71a1d8,null))[_0x49e7('0x42')](handleError(_0x71a1d8,null));};exports[_0x49e7('0x43')]=function(_0x5cf3da,_0x4a19f5){return db['SmsTransferReport'][_0x49e7('0x3f')]({'where':{'id':_0x5cf3da['params']['id']}})[_0x49e7('0x1e')](handleEntityNotFound(_0x4a19f5,null))[_0x49e7('0x1e')](removeEntity(_0x4a19f5,null))[_0x49e7('0x42')](handleError(_0x4a19f5,null));};exports['describe']=function(_0x513711,_0xf7cd93){return db[_0x49e7('0x38')][_0x49e7('0x44')]()[_0x49e7('0x1e')](respondWithResult(_0xf7cd93,null))[_0x49e7('0x42')](handleError(_0xf7cd93,null));}; \ No newline at end of file +var _0xdf27=['length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','update','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','stack','send','SmsTransferReport','rawAttributes','keys','query','filters','intersection','model','attributes','fields'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xdf27,0xab));var _0x7df2=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xdf27[_0x2dafbe];return _0x58a45a;};'use strict';var pdf=require(_0x7df2('0x0'));var emlformat=require(_0x7df2('0x1'));var rimraf=require(_0x7df2('0x2'));var zipdir=require(_0x7df2('0x3'));var jsonpatch=require(_0x7df2('0x4'));var rp=require('request-promise');var moment=require(_0x7df2('0x5'));var BPromise=require(_0x7df2('0x6'));var Mustache=require(_0x7df2('0x7'));var util=require('util');var path=require(_0x7df2('0x8'));var sox=require(_0x7df2('0x9'));var csv=require(_0x7df2('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7df2('0xb'));var squel=require(_0x7df2('0xc'));var crypto=require(_0x7df2('0xd'));var jsforce=require(_0x7df2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7df2('0xa'));var querystring=require(_0x7df2('0xf'));var Papa=require(_0x7df2('0x10'));var Redis=require(_0x7df2('0x11'));var authService=require(_0x7df2('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x7df2('0x13'));var logger=require('../../config/logger')(_0x7df2('0x14'));var utils=require(_0x7df2('0x15'));var config=require(_0x7df2('0x16'));var db=require(_0x7df2('0x17'))['db'];function respondWithStatusCode(_0x4a00b6,_0x1e3a8b){_0x1e3a8b=_0x1e3a8b||0xcc;return function(_0x4e79a9){if(_0x4e79a9){return _0x4a00b6[_0x7df2('0x18')](_0x1e3a8b);}return _0x4a00b6[_0x7df2('0x19')](_0x1e3a8b)[_0x7df2('0x1a')]();};}function respondWithResult(_0x492759,_0x56ddf9){_0x56ddf9=_0x56ddf9||0xc8;return function(_0x5a0db2){if(_0x5a0db2){return _0x492759[_0x7df2('0x19')](_0x56ddf9)['json'](_0x5a0db2);}};}function respondWithFilteredResult(_0x3b45fb,_0x424768){return function(_0x13e2e2){if(_0x13e2e2){var _0x43c47e=_0x13e2e2[_0x7df2('0x1b')],_0x318434=_0x424768['offset'],_0x1eb059=_0x424768[_0x7df2('0x1c')]+_0x424768['limit'],_0x4a5e8d;if(_0x1eb059>=_0x43c47e){_0x1eb059=_0x43c47e;_0x4a5e8d=0xc8;}else{_0x4a5e8d=0xce;}_0x3b45fb[_0x7df2('0x19')](_0x4a5e8d);return _0x3b45fb[_0x7df2('0x1d')](_0x7df2('0x1e'),_0x318434+'-'+_0x1eb059+'/'+_0x43c47e)[_0x7df2('0x1f')](_0x13e2e2);}return null;};}function patchUpdates(_0x16f443){return function(_0x16516a){try{jsonpatch[_0x7df2('0x20')](_0x16516a,_0x16f443,!![]);}catch(_0xc1a760){return BPromise[_0x7df2('0x21')](_0xc1a760);}return _0x16516a[_0x7df2('0x22')]();};}function saveUpdates(_0x386c24,_0x3a93bc){return function(_0x4dd293){if(_0x4dd293){return _0x4dd293['update'](_0x386c24)[_0x7df2('0x23')](function(_0xbcd189){return _0xbcd189;});}return null;};}function removeEntity(_0x30fc06,_0xbe3924){return function(_0x22d80d){if(_0x22d80d){return _0x22d80d[_0x7df2('0x24')]()[_0x7df2('0x23')](function(){_0x30fc06[_0x7df2('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x593046,_0xd6f81e){return function(_0x875bb0){if(!_0x875bb0){_0x593046['sendStatus'](0x194);}return _0x875bb0;};}function handleError(_0x4ff55a,_0x28058b){_0x28058b=_0x28058b||0x1f4;return function(_0x43f2c3){logger['error'](_0x43f2c3[_0x7df2('0x25')]);if(_0x43f2c3['name']){delete _0x43f2c3['name'];}_0x4ff55a[_0x7df2('0x19')](_0x28058b)[_0x7df2('0x26')](_0x43f2c3);};}exports['index']=function(_0x2ec6f6,_0x225420){var _0x443968={},_0x8e0098={},_0x157eee={'count':0x0,'rows':[]};var _0x143b7d=db[_0x7df2('0x27')][_0x7df2('0x28')];_0x8e0098['model']=_[_0x7df2('0x29')](_0x143b7d);_0x8e0098['query']=_[_0x7df2('0x29')](_0x2ec6f6[_0x7df2('0x2a')]);_0x8e0098[_0x7df2('0x2b')]=_[_0x7df2('0x2c')](_0x8e0098[_0x7df2('0x2d')],_0x8e0098[_0x7df2('0x2a')]);_0x443968[_0x7df2('0x2e')]=_[_0x7df2('0x2c')](_0x8e0098[_0x7df2('0x2d')],qs[_0x7df2('0x2f')](_0x2ec6f6[_0x7df2('0x2a')][_0x7df2('0x2f')]));_0x443968[_0x7df2('0x2e')]=_0x443968[_0x7df2('0x2e')][_0x7df2('0x30')]?_0x443968[_0x7df2('0x2e')]:_0x8e0098[_0x7df2('0x2d')];if(!_0x2ec6f6['query'][_0x7df2('0x31')](_0x7df2('0x32'))){_0x443968[_0x7df2('0x33')]=qs['limit'](_0x2ec6f6['query'][_0x7df2('0x33')]);_0x443968['offset']=qs[_0x7df2('0x1c')](_0x2ec6f6['query'][_0x7df2('0x1c')]);}_0x443968['order']=qs[_0x7df2('0x34')](_0x2ec6f6[_0x7df2('0x2a')][_0x7df2('0x34')]);_0x443968[_0x7df2('0x35')]=qs[_0x7df2('0x2b')](_[_0x7df2('0x36')](_0x2ec6f6[_0x7df2('0x2a')],_0x8e0098['filters']));if(_0x2ec6f6[_0x7df2('0x2a')][_0x7df2('0x37')]){_0x443968[_0x7df2('0x35')]=_[_0x7df2('0x38')](_0x443968[_0x7df2('0x35')],{'$or':_[_0x7df2('0x39')](_0x143b7d,function(_0x1892d9){if(_0x1892d9[_0x7df2('0x3a')][_0x7df2('0x3b')]!==_0x7df2('0x3c')){var _0x58ed93={};_0x58ed93[_0x1892d9['field']]={'$like':'%'+_0x2ec6f6[_0x7df2('0x2a')][_0x7df2('0x37')]+'%'};return _0x58ed93;}})});}_0x443968=_['merge']({},_0x443968,_0x2ec6f6[_0x7df2('0x3d')]);var _0xa270b2={'where':_0x443968[_0x7df2('0x35')]};return db['SmsTransferReport'][_0x7df2('0x1b')](_0xa270b2)[_0x7df2('0x23')](function(_0x3e06c8){_0x157eee['count']=_0x3e06c8;if(_0x2ec6f6[_0x7df2('0x2a')][_0x7df2('0x3e')]){_0x443968[_0x7df2('0x3f')]=[{'all':!![]}];}return db['SmsTransferReport'][_0x7df2('0x40')](_0x443968);})[_0x7df2('0x23')](function(_0x3ef4fa){_0x157eee[_0x7df2('0x41')]=_0x3ef4fa;return _0x157eee;})[_0x7df2('0x23')](respondWithFilteredResult(_0x225420,_0x443968))[_0x7df2('0x42')](handleError(_0x225420,null));};exports['show']=function(_0x53ebc9,_0x691f9e){var _0x4c7267={'raw':!![],'where':{'id':_0x53ebc9[_0x7df2('0x43')]['id']}},_0x23bb5a={};_0x23bb5a[_0x7df2('0x2d')]=_[_0x7df2('0x29')](db[_0x7df2('0x27')][_0x7df2('0x28')]);_0x23bb5a[_0x7df2('0x2a')]=_[_0x7df2('0x29')](_0x53ebc9[_0x7df2('0x2a')]);_0x23bb5a[_0x7df2('0x2b')]=_[_0x7df2('0x2c')](_0x23bb5a[_0x7df2('0x2d')],_0x23bb5a['query']);_0x4c7267[_0x7df2('0x2e')]=_[_0x7df2('0x2c')](_0x23bb5a[_0x7df2('0x2d')],qs[_0x7df2('0x2f')](_0x53ebc9[_0x7df2('0x2a')][_0x7df2('0x2f')]));_0x4c7267[_0x7df2('0x2e')]=_0x4c7267[_0x7df2('0x2e')][_0x7df2('0x30')]?_0x4c7267[_0x7df2('0x2e')]:_0x23bb5a[_0x7df2('0x2d')];if(_0x53ebc9['query'][_0x7df2('0x3e')]){_0x4c7267[_0x7df2('0x3f')]=[{'all':!![]}];}_0x4c7267=_['merge']({},_0x4c7267,_0x53ebc9[_0x7df2('0x3d')]);return db[_0x7df2('0x27')][_0x7df2('0x44')](_0x4c7267)[_0x7df2('0x23')](handleEntityNotFound(_0x691f9e,null))[_0x7df2('0x23')](respondWithResult(_0x691f9e,null))[_0x7df2('0x42')](handleError(_0x691f9e,null));};exports['create']=function(_0x1bc2cd,_0x60da66){return db[_0x7df2('0x27')][_0x7df2('0x45')](_0x1bc2cd[_0x7df2('0x46')],{})[_0x7df2('0x23')](respondWithResult(_0x60da66,0xc9))[_0x7df2('0x42')](handleError(_0x60da66,null));};exports[_0x7df2('0x47')]=function(_0x3deab7,_0x595aee){if(_0x3deab7[_0x7df2('0x46')]['id']){delete _0x3deab7[_0x7df2('0x46')]['id'];}return db[_0x7df2('0x27')][_0x7df2('0x44')]({'where':{'id':_0x3deab7[_0x7df2('0x43')]['id']}})[_0x7df2('0x23')](handleEntityNotFound(_0x595aee,null))[_0x7df2('0x23')](saveUpdates(_0x3deab7['body'],null))['then'](respondWithResult(_0x595aee,null))[_0x7df2('0x42')](handleError(_0x595aee,null));};exports['destroy']=function(_0x1179a9,_0x3f0f92){return db['SmsTransferReport'][_0x7df2('0x44')]({'where':{'id':_0x1179a9[_0x7df2('0x43')]['id']}})[_0x7df2('0x23')](handleEntityNotFound(_0x3f0f92,null))[_0x7df2('0x23')](removeEntity(_0x3f0f92,null))[_0x7df2('0x42')](handleError(_0x3f0f92,null));};exports[_0x7df2('0x48')]=function(_0x955220,_0x52a7d6){return db[_0x7df2('0x27')][_0x7df2('0x48')]()[_0x7df2('0x23')](respondWithResult(_0x52a7d6,null))['catch'](handleError(_0x52a7d6,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index c6a3f57..0d5b7cf 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 _0xe82b=['SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define'];(function(_0x1711e7,_0x1a7dad){var _0x549853=function(_0xf24be){while(--_0xf24be){_0x1711e7['push'](_0x1711e7['shift']());}};_0x549853(++_0x1a7dad);}(_0xe82b,0x1b3));var _0xbe82=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xe82b[_0x110c3d];return _0x226d67;};'use strict';var _=require(_0xbe82('0x0'));var util=require(_0xbe82('0x1'));var logger=require(_0xbe82('0x2'))(_0xbe82('0x3'));var moment=require(_0xbe82('0x4'));var BPromise=require(_0xbe82('0x5'));var rp=require(_0xbe82('0x6'));var fs=require('fs');var path=require(_0xbe82('0x7'));var rimraf=require(_0xbe82('0x8'));var config=require(_0xbe82('0x9'));var attributes=require(_0xbe82('0xa'));module[_0xbe82('0xb')]=function(_0x5a0787,_0x5cff7e){return _0x5a0787[_0xbe82('0xc')](_0xbe82('0xd'),attributes,{'tableName':_0xbe82('0xe'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xbe82('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf719=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid'];(function(_0x47b15f,_0x103e93){var _0x55bf25=function(_0x51fe7f){while(--_0x51fe7f){_0x47b15f['push'](_0x47b15f['shift']());}};_0x55bf25(++_0x103e93);}(_0xf719,0x180));var _0x9f71=function(_0x4f6864,_0xdb09cc){_0x4f6864=_0x4f6864-0x0;var _0xcd9bd1=_0xf719[_0x4f6864];return _0xcd9bd1;};'use strict';var _=require(_0x9f71('0x0'));var util=require(_0x9f71('0x1'));var logger=require(_0x9f71('0x2'))(_0x9f71('0x3'));var moment=require(_0x9f71('0x4'));var BPromise=require(_0x9f71('0x5'));var rp=require(_0x9f71('0x6'));var fs=require('fs');var path=require(_0x9f71('0x7'));var rimraf=require(_0x9f71('0x8'));var config=require(_0x9f71('0x9'));var attributes=require(_0x9f71('0xa'));module[_0x9f71('0xb')]=function(_0x3ff5d8,_0x209b02){return _0x3ff5d8[_0x9f71('0xc')](_0x9f71('0xd'),attributes,{'tableName':_0x9f71('0xe'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x9f71('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index c91d77a..00d9782 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 _0x79d7=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x79d7,0x9c));var _0x779d=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x79d7[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x779d('0x0'));var util=require('util');var moment=require(_0x779d('0x1'));var BPromise=require(_0x779d('0x2'));var rs=require(_0x779d('0x3'));var fs=require('fs');var Redis=require(_0x779d('0x4'));var db=require(_0x779d('0x5'))['db'];var utils=require(_0x779d('0x6'));var logger=require('../../config/logger')(_0x779d('0x7'));var config=require(_0x779d('0x8'));var jayson=require(_0x779d('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x227c87,_0x4c7fb4,_0xc067dd){return new BPromise(function(_0x2f83f6,_0x4c7c92){return client['request'](_0x227c87,_0xc067dd)['then'](function(_0x5b4ef2){logger[_0x779d('0xa')](_0x779d('0xb'),_0x4c7fb4,_0x779d('0xc'));logger['debug'](_0x779d('0xd'),_0x4c7fb4,'request\x20sent',JSON[_0x779d('0xe')](_0x5b4ef2));if(_0x5b4ef2['error']){if(_0x5b4ef2[_0x779d('0xf')][_0x779d('0x10')]===0x1f4){logger[_0x779d('0xf')]('SmsTransferReport,\x20%s,\x20%s',_0x4c7fb4,_0x5b4ef2[_0x779d('0xf')][_0x779d('0x11')]);return _0x4c7c92(_0x5b4ef2[_0x779d('0xf')][_0x779d('0x11')]);}logger[_0x779d('0xf')](_0x779d('0xb'),_0x4c7fb4,_0x5b4ef2['error'][_0x779d('0x11')]);return _0x2f83f6(_0x5b4ef2[_0x779d('0xf')][_0x779d('0x11')]);}else{logger[_0x779d('0xa')](_0x779d('0xb'),_0x4c7fb4,'request\x20sent');_0x2f83f6(_0x5b4ef2[_0x779d('0x12')][_0x779d('0x11')]);}})[_0x779d('0x13')](function(_0x4cc248){logger[_0x779d('0xf')](_0x779d('0xb'),_0x4c7fb4,_0x4cc248);_0x4c7c92(_0x4cc248);});});} \ No newline at end of file +var _0x73a1=['catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsTransferReport,\x20%s,\x20%s','message','result'];(function(_0x1029c4,_0x5beaab){var _0x505371=function(_0xd33d47){while(--_0xd33d47){_0x1029c4['push'](_0x1029c4['shift']());}};_0x505371(++_0x5beaab);}(_0x73a1,0x161));var _0x173a=function(_0x3a4f18,_0x1af741){_0x3a4f18=_0x3a4f18-0x0;var _0x4c20fc=_0x73a1[_0x3a4f18];return _0x4c20fc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x173a('0x0'));var BPromise=require(_0x173a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x173a('0x2'));var db=require(_0x173a('0x3'))['db'];var utils=require(_0x173a('0x4'));var logger=require(_0x173a('0x5'))(_0x173a('0x6'));var config=require('../../config/environment');var jayson=require(_0x173a('0x7'));var client=jayson[_0x173a('0x8')][_0x173a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xbd8757,_0x12bb11,_0x550e2b){return new BPromise(function(_0x2b545e,_0x2c7090){return client[_0x173a('0xa')](_0xbd8757,_0x550e2b)[_0x173a('0xb')](function(_0x30ffef){logger[_0x173a('0xc')]('SmsTransferReport,\x20%s,\x20%s',_0x12bb11,_0x173a('0xd'));logger['debug'](_0x173a('0xe'),_0x12bb11,_0x173a('0xd'),JSON[_0x173a('0xf')](_0x30ffef));if(_0x30ffef[_0x173a('0x10')]){if(_0x30ffef['error'][_0x173a('0x11')]===0x1f4){logger['error'](_0x173a('0x12'),_0x12bb11,_0x30ffef['error'][_0x173a('0x13')]);return _0x2c7090(_0x30ffef[_0x173a('0x10')]['message']);}logger[_0x173a('0x10')](_0x173a('0x12'),_0x12bb11,_0x30ffef[_0x173a('0x10')][_0x173a('0x13')]);return _0x2b545e(_0x30ffef[_0x173a('0x10')][_0x173a('0x13')]);}else{logger[_0x173a('0xc')](_0x173a('0x12'),_0x12bb11,'request\x20sent');_0x2b545e(_0x30ffef[_0x173a('0x14')][_0x173a('0x13')]);}})[_0x173a('0x15')](function(_0x4b323c){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x12bb11,_0x4b323c);_0x2c7090(_0x4b323c);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 0bc6839..0c03aa0 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 _0xce2f=['now','post','single','file','create','put','delete','exports','multer','util','express','Router','../../components/auth/service','../../config/environment','./sound.controller','get','index','/:id','isAuthenticated','show','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname'];(function(_0x3c88ae,_0x3c3a7a){var _0x41c77c=function(_0x58d60c){while(--_0x58d60c){_0x3c88ae['push'](_0x3c88ae['shift']());}};_0x41c77c(++_0x3c3a7a);}(_0xce2f,0x100));var _0xfce2=function(_0x5138b1,_0x5af30b){_0x5138b1=_0x5138b1-0x0;var _0x3981c9=_0xce2f[_0x5138b1];return _0x3981c9;};'use strict';var multer=require(_0xfce2('0x0'));var util=require(_0xfce2('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfce2('0x2'));var router=express[_0xfce2('0x3')]();var auth=require(_0xfce2('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xfce2('0x5'));var controller=require(_0xfce2('0x6'));router[_0xfce2('0x7')]('/',auth['isAuthenticated'](),controller[_0xfce2('0x8')]);router[_0xfce2('0x7')](_0xfce2('0x9'),auth[_0xfce2('0xa')](),controller[_0xfce2('0xb')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xfce2('0xc')]);var upload=multer({'storage':multer[_0xfce2('0xd')]({'destination':function(_0x28d1da,_0x360909,_0x2fba8f){_0x2fba8f(null,path[_0xfce2('0xe')](config[_0xfce2('0xf')],_0xfce2('0x10')));},'filename':function(_0x3d9bcf,_0x5bbbfd,_0x3f9fba){_0x5bbbfd[_0xfce2('0x11')]=_0x5bbbfd[_0xfce2('0x11')][_0xfce2('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3f9fba(null,util[_0xfce2('0x13')](_0xfce2('0x14'),path[_0xfce2('0x15')](_0x5bbbfd[_0xfce2('0x11')],path[_0xfce2('0x16')](_0x5bbbfd[_0xfce2('0x11')])),Date[_0xfce2('0x17')](),path[_0xfce2('0x16')](_0x5bbbfd[_0xfce2('0x11')])));}})});router[_0xfce2('0x18')]('/',upload[_0xfce2('0x19')](_0xfce2('0x1a')),controller[_0xfce2('0x1b')]);router[_0xfce2('0x1c')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xfce2('0x1d')](_0xfce2('0x9'),auth[_0xfce2('0xa')](),controller[_0xfce2('0x1d')]);module[_0xfce2('0x1e')]=router; \ No newline at end of file +var _0x7276=['server/files/sounds/original/','originalname','replace','%s-%s%s','basename','extname','now','post','single','file','put','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','isAuthenticated','index','get','/:id','show','download','diskStorage','root'];(function(_0x5b1f99,_0x5400b2){var _0x478845=function(_0x463fdc){while(--_0x463fdc){_0x5b1f99['push'](_0x5b1f99['shift']());}};_0x478845(++_0x5400b2);}(_0x7276,0x6b));var _0x6727=function(_0x584735,_0x51209f){_0x584735=_0x584735-0x0;var _0x2697b2=_0x7276[_0x584735];return _0x2697b2;};'use strict';var multer=require('multer');var util=require(_0x6727('0x0'));var path=require(_0x6727('0x1'));var timeout=require(_0x6727('0x2'));var express=require(_0x6727('0x3'));var router=express[_0x6727('0x4')]();var auth=require(_0x6727('0x5'));var interaction=require(_0x6727('0x6'));var config=require(_0x6727('0x7'));var controller=require(_0x6727('0x8'));router['get']('/',auth[_0x6727('0x9')](),controller[_0x6727('0xa')]);router[_0x6727('0xb')](_0x6727('0xc'),auth[_0x6727('0x9')](),controller[_0x6727('0xd')]);router[_0x6727('0xb')]('/:id/download',auth['isAuthenticated'](),controller[_0x6727('0xe')]);var upload=multer({'storage':multer[_0x6727('0xf')]({'destination':function(_0x45bc23,_0x4c62d1,_0x417ae0){_0x417ae0(null,path['join'](config[_0x6727('0x10')],_0x6727('0x11')));},'filename':function(_0x521330,_0xaf54b0,_0x469ad2){_0xaf54b0[_0x6727('0x12')]=_0xaf54b0[_0x6727('0x12')][_0x6727('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x469ad2(null,util['format'](_0x6727('0x14'),path[_0x6727('0x15')](_0xaf54b0[_0x6727('0x12')],path[_0x6727('0x16')](_0xaf54b0[_0x6727('0x12')])),Date[_0x6727('0x17')](),path[_0x6727('0x16')](_0xaf54b0[_0x6727('0x12')])));}})});router[_0x6727('0x18')]('/',upload[_0x6727('0x19')](_0x6727('0x1a')),controller['create']);router[_0x6727('0x1b')](_0x6727('0xc'),auth['isAuthenticated'](),controller[_0x6727('0x1c')]);router['delete'](_0x6727('0xc'),auth[_0x6727('0x9')](),controller[_0x6727('0x1d')]);module[_0x6727('0x1e')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index edd2734..e5b94a8 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 _0x50f6=['sequelize','exports','STRING','INTEGER','FLOAT','BIGINT'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x50f6,0x186));var _0x650f=function(_0x12df55,_0x24a2cf){_0x12df55=_0x12df55-0x0;var _0x2e2b72=_0x50f6[_0x12df55];return _0x2e2b72;};'use strict';var Sequelize=require(_0x650f('0x0'));module[_0x650f('0x1')]={'name':{'type':Sequelize[_0x650f('0x2')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0x650f('0x2')]},'display_name':{'type':Sequelize[_0x650f('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x650f('0x2')]},'original_format':{'type':Sequelize[_0x650f('0x2')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x650f('0x3')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x650f('0x3')]},'converted_format':{'type':Sequelize[_0x650f('0x2')]},'converted_duration':{'type':Sequelize[_0x650f('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x650f('0x5')]},'converted_channelCount':{'type':Sequelize[_0x650f('0x3')]},'converted_bitRate':{'type':Sequelize[_0x650f('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x650f('0x3')]}}; \ No newline at end of file +var _0x1101=['FLOAT','BIGINT','INTEGER','sequelize','exports','STRING'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x1101,0x189));var _0x1110=function(_0x124b56,_0x137225){_0x124b56=_0x124b56-0x0;var _0x2c71ed=_0x1101[_0x124b56];return _0x2c71ed;};'use strict';var Sequelize=require(_0x1110('0x0'));module[_0x1110('0x1')]={'name':{'type':Sequelize[_0x1110('0x2')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0x1110('0x2')]},'display_name':{'type':Sequelize[_0x1110('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x1110('0x2')]},'original_format':{'type':Sequelize[_0x1110('0x2')]},'original_duration':{'type':Sequelize[_0x1110('0x3')]},'original_sampleCount':{'type':Sequelize[_0x1110('0x4')]},'original_channelCount':{'type':Sequelize[_0x1110('0x5')]},'original_bitRate':{'type':Sequelize[_0x1110('0x4')]},'original_sampleRate':{'type':Sequelize[_0x1110('0x5')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0x1110('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x1110('0x4')]},'converted_channelCount':{'type':Sequelize[_0x1110('0x5')]},'converted_bitRate':{'type':Sequelize[_0x1110('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x1110('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 5ea3a38..5efb24a 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 _0x233e=['ValidationError','format','%s.%s','create','file','originalname','extname','basename','filename','substring','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','wav','unlinkSync','src','original_duration','duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','pick','delete','server/files/sounds/original','original_format','html-pdf','rimraf','moment','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','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','reject','save','then','destroy','Sounds','UserProfileResource','error','stack','name','send','index','Sound','rawAttributes','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','map','key','VIRTUAL','field','filter','options','includeAll','include','findAll','rows','catch','params','keys','find','download','existsSync','join','root','server/files/sounds/converted','save_name','converted_format'];(function(_0x169e53,_0x46be55){var _0x252bb3=function(_0x521e7a){while(--_0x521e7a){_0x169e53['push'](_0x169e53['shift']());}};_0x252bb3(++_0x46be55);}(_0x233e,0xa9));var _0xe233=function(_0x2d8029,_0x16a1e8){_0x2d8029=_0x2d8029-0x0;var _0x3fb34d=_0x233e[_0x2d8029];return _0x3fb34d;};'use strict';var pdf=require(_0xe233('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe233('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe233('0x2'));var BPromise=require(_0xe233('0x3'));var Mustache=require(_0xe233('0x4'));var util=require(_0xe233('0x5'));var path=require('path');var sox=require(_0xe233('0x6'));var csv=require(_0xe233('0x7'));var ejs=require(_0xe233('0x8'));var fs=require('fs');var _=require(_0xe233('0x9'));var squel=require(_0xe233('0xa'));var crypto=require(_0xe233('0xb'));var jsforce=require(_0xe233('0xc'));var deskjs=require(_0xe233('0xd'));var toCsv=require(_0xe233('0x7'));var querystring=require(_0xe233('0xe'));var Papa=require(_0xe233('0xf'));var Redis=require('ioredis');var authService=require(_0xe233('0x10'));var qs=require(_0xe233('0x11'));var hardwareService=require(_0xe233('0x12'));var logger=require(_0xe233('0x13'))(_0xe233('0x14'));var utils=require(_0xe233('0x15'));var config=require(_0xe233('0x16'));var db=require(_0xe233('0x17'))['db'];function respondWithStatusCode(_0x59cdce,_0xa1992c){_0xa1992c=_0xa1992c||0xcc;return function(_0x5bf986){if(_0x5bf986){return _0x59cdce[_0xe233('0x18')](_0xa1992c);}return _0x59cdce[_0xe233('0x19')](_0xa1992c)[_0xe233('0x1a')]();};}function respondWithResult(_0x3ded0e,_0x5245c1){_0x5245c1=_0x5245c1||0xc8;return function(_0x4c376f){if(_0x4c376f){return _0x3ded0e['status'](_0x5245c1)[_0xe233('0x1b')](_0x4c376f);}};}function respondWithFilteredResult(_0x35b5a1,_0x5c47c7){return function(_0x4c1df0){if(_0x4c1df0){var _0x4cadea=_0x4c1df0[_0xe233('0x1c')],_0x5738c8=_0x5c47c7[_0xe233('0x1d')],_0x2e7257=_0x5c47c7[_0xe233('0x1d')]+_0x5c47c7[_0xe233('0x1e')],_0x42c085;if(_0x2e7257>=_0x4cadea){_0x2e7257=_0x4cadea;_0x42c085=0xc8;}else{_0x42c085=0xce;}_0x35b5a1[_0xe233('0x19')](_0x42c085);return _0x35b5a1[_0xe233('0x1f')]('Content-Range',_0x5738c8+'-'+_0x2e7257+'/'+_0x4cadea)[_0xe233('0x1b')](_0x4c1df0);}return null;};}function patchUpdates(_0x2774a5){return function(_0x2ab351){try{jsonpatch['apply'](_0x2ab351,_0x2774a5,!![]);}catch(_0x3d442c){return BPromise[_0xe233('0x20')](_0x3d442c);}return _0x2ab351[_0xe233('0x21')]();};}function saveUpdates(_0x115502,_0x317a75){return function(_0x5503f4){if(_0x5503f4){return _0x5503f4['update'](_0x115502)[_0xe233('0x22')](function(_0x5bd543){return _0x5bd543;});}return null;};}function removeEntity(_0x48b59e,_0x467fe5){return function(_0x16b943){if(_0x16b943){return _0x16b943[_0xe233('0x23')]()[_0xe233('0x22')](function(){var _0x3c44c6=_0x16b943['get']({'plain':!![]});var _0x2dc33c=_0xe233('0x24');return db[_0xe233('0x25')][_0xe233('0x23')]({'where':{'type':_0x2dc33c,'resourceId':_0x3c44c6['id']}})[_0xe233('0x22')](function(){return _0x16b943;});})[_0xe233('0x22')](function(){_0x48b59e[_0xe233('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a79d6,_0x80d2e4){return function(_0x281944){if(!_0x281944){_0x1a79d6[_0xe233('0x18')](0x194);}return _0x281944;};}function handleError(_0x3069dc,_0x3e68a7){_0x3e68a7=_0x3e68a7||0x1f4;return function(_0x3bbd92){logger[_0xe233('0x26')](_0x3bbd92[_0xe233('0x27')]);if(_0x3bbd92['name']){delete _0x3bbd92[_0xe233('0x28')];}_0x3069dc['status'](_0x3e68a7)[_0xe233('0x29')](_0x3bbd92);};}exports[_0xe233('0x2a')]=function(_0x5e8f50,_0x561fdf){var _0x27fdd3={},_0x309b41={},_0x29e4a7={'count':0x0,'rows':[]};var _0x289a28=db[_0xe233('0x2b')][_0xe233('0x2c')];_0x309b41['model']=_['keys'](_0x289a28);_0x309b41[_0xe233('0x2d')]=_['keys'](_0x5e8f50[_0xe233('0x2d')]);_0x309b41[_0xe233('0x2e')]=_['intersection'](_0x309b41[_0xe233('0x2f')],_0x309b41[_0xe233('0x2d')]);_0x27fdd3[_0xe233('0x30')]=_[_0xe233('0x31')](_0x309b41[_0xe233('0x2f')],qs[_0xe233('0x32')](_0x5e8f50[_0xe233('0x2d')]['fields']));_0x27fdd3[_0xe233('0x30')]=_0x27fdd3['attributes'][_0xe233('0x33')]?_0x27fdd3[_0xe233('0x30')]:_0x309b41[_0xe233('0x2f')];if(!_0x5e8f50[_0xe233('0x2d')][_0xe233('0x34')](_0xe233('0x35'))){_0x27fdd3[_0xe233('0x1e')]=qs[_0xe233('0x1e')](_0x5e8f50[_0xe233('0x2d')][_0xe233('0x1e')]);_0x27fdd3['offset']=qs[_0xe233('0x1d')](_0x5e8f50[_0xe233('0x2d')][_0xe233('0x1d')]);}_0x27fdd3[_0xe233('0x36')]=qs[_0xe233('0x37')](_0x5e8f50[_0xe233('0x2d')]['sort']);_0x27fdd3[_0xe233('0x38')]=qs[_0xe233('0x2e')](_['pick'](_0x5e8f50[_0xe233('0x2d')],_0x309b41[_0xe233('0x2e')]));if(_0x5e8f50[_0xe233('0x2d')]['filter']){_0x27fdd3[_0xe233('0x38')]=_[_0xe233('0x39')](_0x27fdd3['where'],{'$or':_[_0xe233('0x3a')](_0x289a28,function(_0x1a3bdf){if(_0x1a3bdf['type'][_0xe233('0x3b')]!==_0xe233('0x3c')){var _0x4c668c={};_0x4c668c[_0x1a3bdf[_0xe233('0x3d')]]={'$like':'%'+_0x5e8f50[_0xe233('0x2d')][_0xe233('0x3e')]+'%'};return _0x4c668c;}})});}_0x27fdd3=_[_0xe233('0x39')]({},_0x27fdd3,_0x5e8f50[_0xe233('0x3f')]);var _0x1bd218={'where':_0x27fdd3[_0xe233('0x38')]};return db[_0xe233('0x2b')][_0xe233('0x1c')](_0x1bd218)['then'](function(_0x1b465d){_0x29e4a7['count']=_0x1b465d;if(_0x5e8f50[_0xe233('0x2d')][_0xe233('0x40')]){_0x27fdd3[_0xe233('0x41')]=[{'all':!![]}];}return db[_0xe233('0x2b')][_0xe233('0x42')](_0x27fdd3);})[_0xe233('0x22')](function(_0x4c95f6){_0x29e4a7[_0xe233('0x43')]=_0x4c95f6;return _0x29e4a7;})['then'](respondWithFilteredResult(_0x561fdf,_0x27fdd3))[_0xe233('0x44')](handleError(_0x561fdf,null));};exports['show']=function(_0x7bb7fc,_0x4b2288){var _0x4bddae={'raw':!![],'where':{'id':_0x7bb7fc[_0xe233('0x45')]['id']}},_0x34599d={};_0x34599d[_0xe233('0x2f')]=_[_0xe233('0x46')](db['Sound'][_0xe233('0x2c')]);_0x34599d['query']=_['keys'](_0x7bb7fc[_0xe233('0x2d')]);_0x34599d[_0xe233('0x2e')]=_[_0xe233('0x31')](_0x34599d['model'],_0x34599d['query']);_0x4bddae[_0xe233('0x30')]=_[_0xe233('0x31')](_0x34599d[_0xe233('0x2f')],qs['fields'](_0x7bb7fc[_0xe233('0x2d')][_0xe233('0x32')]));_0x4bddae[_0xe233('0x30')]=_0x4bddae[_0xe233('0x30')][_0xe233('0x33')]?_0x4bddae[_0xe233('0x30')]:_0x34599d[_0xe233('0x2f')];if(_0x7bb7fc[_0xe233('0x2d')][_0xe233('0x40')]){_0x4bddae[_0xe233('0x41')]=[{'all':!![]}];}_0x4bddae=_['merge']({},_0x4bddae,_0x7bb7fc[_0xe233('0x3f')]);return db[_0xe233('0x2b')][_0xe233('0x47')](_0x4bddae)[_0xe233('0x22')](handleEntityNotFound(_0x4b2288,null))['then'](respondWithResult(_0x4b2288,null))['catch'](handleError(_0x4b2288,null));};exports[_0xe233('0x48')]=function(_0x768aba,_0x15028c,_0x57b64d){return db['Sound'][_0xe233('0x47')]({'where':{'id':_0x768aba[_0xe233('0x45')]['id']},'attributes':[_0xe233('0x28'),'save_name','converted_format'],'raw':!![]})[_0xe233('0x22')](handleEntityNotFound(_0x15028c,null))[_0xe233('0x22')](function(_0x50d23e){if(_0x50d23e){if(!fs[_0xe233('0x49')](path[_0xe233('0x4a')](config[_0xe233('0x4b')],_0xe233('0x4c'),_0x50d23e[_0xe233('0x4d')]+'.'+_0x50d23e[_0xe233('0x4e')]))){throw new db['Sequelize'][(_0xe233('0x4f'))]('Sound\x20not\x20found');}return _0x15028c[_0xe233('0x48')](path[_0xe233('0x4a')](config[_0xe233('0x4b')],'server/files/sounds/converted',util[_0xe233('0x50')](_0xe233('0x51'),_0x50d23e[_0xe233('0x4d')],_0x50d23e[_0xe233('0x4e')])),util[_0xe233('0x50')](_0xe233('0x51'),_0x50d23e[_0xe233('0x28')],_0x50d23e['converted_format']));}return null;})[_0xe233('0x44')](handleError(_0x15028c,null));};exports[_0xe233('0x52')]=function(_0x170afc,_0x1a06a9,_0x2b7f7e){var _0x3bbf1f={'name':path['basename'](_0x170afc[_0xe233('0x53')][_0xe233('0x54')],path[_0xe233('0x55')](_0x170afc[_0xe233('0x53')][_0xe233('0x54')])),'save_name':path[_0xe233('0x56')](_0x170afc[_0xe233('0x53')][_0xe233('0x57')],path[_0xe233('0x55')](_0x170afc[_0xe233('0x53')][_0xe233('0x57')])),'original_format':path[_0xe233('0x55')](_0x170afc[_0xe233('0x53')][_0xe233('0x54')])[_0xe233('0x58')](0x1),'converted_format':'wav'};var _0x4f75e0=path['join'](config[_0xe233('0x4b')],'server/files/sounds/original',_0x170afc[_0xe233('0x53')][_0xe233('0x57')]);var _0x1a77f4=path['join'](config[_0xe233('0x4b')],_0xe233('0x4c'),util[_0xe233('0x50')]('%s.%s',path[_0xe233('0x56')](_0x170afc[_0xe233('0x53')]['filename'],path['extname'](_0x170afc[_0xe233('0x53')][_0xe233('0x57')])),_0x3bbf1f[_0xe233('0x4e')]));logger[_0xe233('0x59')]('Sound\x20upload\x20filepath:\x20%s',_0x4f75e0);logger['info'](_0xe233('0x5a'),_0x1a77f4);try{fs[_0xe233('0x5b')](_0x4f75e0,parseInt(_0xe233('0x5c'),0x8));var _0x4eca7b=sox[_0xe233('0x5d')](_0x4f75e0,_0x1a77f4,{'sampleRate':0x1f40,'format':_0xe233('0x5e'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4eca7b['on']('error',function(_0x3d5644){fs[_0xe233('0x5f')](_0x4f75e0);_0x1a06a9[_0xe233('0x19')](0x1f4)[_0xe233('0x29')](_0x3d5644);});_0x4eca7b['on'](_0xe233('0x60'),function(_0x463b86){_0x3bbf1f[_0xe233('0x61')]=isNaN(_0x463b86['duration'])?null:_0x463b86[_0xe233('0x62')]*0x3e8;_0x3bbf1f['original_sampleCount']=isNaN(_0x463b86[_0xe233('0x63')])?null:_0x463b86[_0xe233('0x63')];_0x3bbf1f[_0xe233('0x64')]=isNaN(_0x463b86['channelCount'])?null:_0x463b86[_0xe233('0x65')];_0x3bbf1f[_0xe233('0x66')]=isNaN(_0x463b86[_0xe233('0x67')])?null:_0x463b86['bitRate'];_0x3bbf1f[_0xe233('0x68')]=isNaN(_0x463b86['sampleRate'])?null:_0x463b86[_0xe233('0x69')];});_0x4eca7b['on'](_0xe233('0x6a'),function(_0x490637){_0x3bbf1f['converted_duration']=isNaN(_0x490637['duration'])?null:_0x490637[_0xe233('0x62')]*0x3e8;_0x3bbf1f[_0xe233('0x6b')]=isNaN(_0x490637['sampleCount'])?null:_0x490637['sampleCount'];_0x3bbf1f[_0xe233('0x6c')]=isNaN(_0x490637[_0xe233('0x65')])?null:_0x490637[_0xe233('0x65')];_0x3bbf1f[_0xe233('0x6d')]=isNaN(_0x490637[_0xe233('0x67')])?null:_0x490637[_0xe233('0x67')];_0x3bbf1f[_0xe233('0x6e')]=isNaN(_0x490637['sampleRate'])?null:_0x490637[_0xe233('0x69')];});_0x4eca7b['on'](_0xe233('0x1a'),function(){fs[_0xe233('0x5b')](_0x1a77f4,parseInt(_0xe233('0x5c'),0x8));return db[_0xe233('0x2b')][_0xe233('0x52')](_0x3bbf1f)['then'](function(_0x334bb1){var _0x17327b={'role':_0x170afc[_0xe233('0x6f')][_0xe233('0x70')],'userProfileId':_0x170afc[_0xe233('0x6f')][_0xe233('0x71')]};if(!_0x17327b)throw new Error(_0xe233('0x72'));if(_0x17327b[_0xe233('0x70')]===_0xe233('0x73')){var _0x1f97a8=_0x334bb1[_0xe233('0x74')]({'plain':!![]});return db[_0xe233('0x75')][_0xe233('0x47')]({'where':{'name':_0xe233('0x24'),'userProfileId':_0x17327b['userProfileId']},'raw':!![]})['then'](function(_0x56ecc9){if(_0x56ecc9&&_0x56ecc9[_0xe233('0x76')]===0x0){return db[_0xe233('0x25')][_0xe233('0x52')]({'name':_0x1f97a8[_0xe233('0x28')],'resourceId':_0x1f97a8['id'],'type':_0x56ecc9[_0xe233('0x28')],'sectionId':_0x56ecc9['id']},{})['then'](function(){return _0x334bb1;});}else{return _0x334bb1;}})[_0xe233('0x44')](function(_0x162880){logger[_0xe233('0x26')](_0xe233('0x77'),_0x162880);throw _0x162880;});}return _0x334bb1;})[_0xe233('0x22')](respondWithResult(_0x1a06a9,null))[_0xe233('0x44')](handleError(_0x1a06a9,null));});_0x4eca7b['start']();}catch(_0x541032){_0x1a06a9[_0xe233('0x19')](0x1f4)[_0xe233('0x29')](_0x541032);}};exports['update']=function(_0x44669b,_0x2a559a,_0x11d44a){return db[_0xe233('0x2b')][_0xe233('0x47')]({'where':{'id':_0x44669b[_0xe233('0x45')]['id']}})[_0xe233('0x22')](handleEntityNotFound(_0x2a559a,null))[_0xe233('0x22')](saveUpdates(_[_0xe233('0x78')](_0x44669b[_0xe233('0x6f')],[_0xe233('0x28'),'description']),null))[_0xe233('0x22')](respondWithResult(_0x2a559a,null))[_0xe233('0x44')](handleError(_0x2a559a,null));};exports[_0xe233('0x79')]=function(_0x17a3aa,_0x20ff7f,_0x473ee6){return db[_0xe233('0x2b')][_0xe233('0x47')]({'where':{'id':_0x17a3aa[_0xe233('0x45')]['id']}})['then'](function(_0xc595b1){if(_0xc595b1){return _0xc595b1[_0xe233('0x23')]();}})[_0xe233('0x22')](function(_0x3affb8){var _0x3f29e5=path[_0xe233('0x4a')](config[_0xe233('0x4b')],_0xe233('0x7a'),util[_0xe233('0x50')]('%s.%s',_0x3affb8[_0xe233('0x4d')],_0x3affb8[_0xe233('0x7b')]));var _0x4d2671=path[_0xe233('0x4a')](config[_0xe233('0x4b')],'server/files/sounds/converted',util[_0xe233('0x50')](_0xe233('0x51'),_0x3affb8['save_name'],_0x3affb8[_0xe233('0x4e')]));fs[_0xe233('0x5f')](_0x3f29e5);fs[_0xe233('0x5f')](_0x4d2671);return _0x3affb8;})[_0xe233('0x22')](function(_0x1a6f89){if(_0x1a6f89){return _0x20ff7f[_0xe233('0x19')](0xcc)[_0xe233('0x1a')]();}})[_0xe233('0x22')](handleEntityNotFound(_0x20ff7f,null))[_0xe233('0x44')](handleError(_0x20ff7f,null));}; \ No newline at end of file +var _0xb7f9=['root','server/files/sounds/converted','Sequelize','Sound\x20not\x20found','format','%s.%s','create','basename','originalname','extname','file','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','0777','transcode','unlinkSync','send','src','original_duration','duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','chmodSync','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','Sounds','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','original_format','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','then','destroy','UserProfileResource','error','stack','name','index','Sound','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','type','key','VIRTUAL','field','includeAll','include','rows','catch','show','params','rawAttributes','intersection','find','download','save_name','converted_format','existsSync','join'];(function(_0x1d84a1,_0x40a2b9){var _0x5e3939=function(_0x3c7f11){while(--_0x3c7f11){_0x1d84a1['push'](_0x1d84a1['shift']());}};_0x5e3939(++_0x40a2b9);}(_0xb7f9,0x1ae));var _0x9b7f=function(_0x48e2eb,_0x2df535){_0x48e2eb=_0x48e2eb-0x0;var _0x5eca92=_0xb7f9[_0x48e2eb];return _0x5eca92;};'use strict';var pdf=require(_0x9b7f('0x0'));var emlformat=require(_0x9b7f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9b7f('0x2'));var jsonpatch=require(_0x9b7f('0x3'));var rp=require(_0x9b7f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9b7f('0x5'));var util=require(_0x9b7f('0x6'));var path=require(_0x9b7f('0x7'));var sox=require(_0x9b7f('0x8'));var csv=require(_0x9b7f('0x9'));var ejs=require(_0x9b7f('0xa'));var fs=require('fs');var _=require(_0x9b7f('0xb'));var squel=require(_0x9b7f('0xc'));var crypto=require(_0x9b7f('0xd'));var jsforce=require(_0x9b7f('0xe'));var deskjs=require(_0x9b7f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x9b7f('0x10'));var Papa=require('papaparse');var Redis=require(_0x9b7f('0x11'));var authService=require(_0x9b7f('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x9b7f('0x13'));var logger=require(_0x9b7f('0x14'))(_0x9b7f('0x15'));var utils=require(_0x9b7f('0x16'));var config=require(_0x9b7f('0x17'));var db=require(_0x9b7f('0x18'))['db'];function respondWithStatusCode(_0x5af01,_0x1e8a90){_0x1e8a90=_0x1e8a90||0xcc;return function(_0x2a151a){if(_0x2a151a){return _0x5af01[_0x9b7f('0x19')](_0x1e8a90);}return _0x5af01[_0x9b7f('0x1a')](_0x1e8a90)[_0x9b7f('0x1b')]();};}function respondWithResult(_0x118e8c,_0x1e986b){_0x1e986b=_0x1e986b||0xc8;return function(_0x1578aa){if(_0x1578aa){return _0x118e8c['status'](_0x1e986b)[_0x9b7f('0x1c')](_0x1578aa);}};}function respondWithFilteredResult(_0x415fb5,_0x57bea7){return function(_0x4106d9){if(_0x4106d9){var _0x19a6fd=_0x4106d9[_0x9b7f('0x1d')],_0x558823=_0x57bea7[_0x9b7f('0x1e')],_0x1b4f23=_0x57bea7[_0x9b7f('0x1e')]+_0x57bea7[_0x9b7f('0x1f')],_0x3b9f62;if(_0x1b4f23>=_0x19a6fd){_0x1b4f23=_0x19a6fd;_0x3b9f62=0xc8;}else{_0x3b9f62=0xce;}_0x415fb5[_0x9b7f('0x1a')](_0x3b9f62);return _0x415fb5[_0x9b7f('0x20')](_0x9b7f('0x21'),_0x558823+'-'+_0x1b4f23+'/'+_0x19a6fd)[_0x9b7f('0x1c')](_0x4106d9);}return null;};}function patchUpdates(_0x3c0e35){return function(_0xc45aa4){try{jsonpatch[_0x9b7f('0x22')](_0xc45aa4,_0x3c0e35,!![]);}catch(_0x22e428){return BPromise[_0x9b7f('0x23')](_0x22e428);}return _0xc45aa4['save']();};}function saveUpdates(_0x37fd18,_0x2ae4b3){return function(_0x3b0104){if(_0x3b0104){return _0x3b0104['update'](_0x37fd18)[_0x9b7f('0x24')](function(_0x1bc22a){return _0x1bc22a;});}return null;};}function removeEntity(_0x53c615,_0x190858){return function(_0x11226e){if(_0x11226e){return _0x11226e[_0x9b7f('0x25')]()[_0x9b7f('0x24')](function(){var _0x4ec4f1=_0x11226e['get']({'plain':!![]});var _0x40edbf='Sounds';return db[_0x9b7f('0x26')][_0x9b7f('0x25')]({'where':{'type':_0x40edbf,'resourceId':_0x4ec4f1['id']}})['then'](function(){return _0x11226e;});})[_0x9b7f('0x24')](function(){_0x53c615[_0x9b7f('0x1a')](0xcc)[_0x9b7f('0x1b')]();});}};}function handleEntityNotFound(_0x61fe49,_0x40fc7a){return function(_0xc9c7df){if(!_0xc9c7df){_0x61fe49[_0x9b7f('0x19')](0x194);}return _0xc9c7df;};}function handleError(_0x4ec1df,_0x3ee89a){_0x3ee89a=_0x3ee89a||0x1f4;return function(_0x53c380){logger[_0x9b7f('0x27')](_0x53c380[_0x9b7f('0x28')]);if(_0x53c380[_0x9b7f('0x29')]){delete _0x53c380[_0x9b7f('0x29')];}_0x4ec1df[_0x9b7f('0x1a')](_0x3ee89a)['send'](_0x53c380);};}exports[_0x9b7f('0x2a')]=function(_0x40b9f0,_0xd4c21b){var _0x35ffb4={},_0x5c7024={},_0x1dc8b6={'count':0x0,'rows':[]};var _0x433a53=db[_0x9b7f('0x2b')]['rawAttributes'];_0x5c7024[_0x9b7f('0x2c')]=_['keys'](_0x433a53);_0x5c7024['query']=_[_0x9b7f('0x2d')](_0x40b9f0[_0x9b7f('0x2e')]);_0x5c7024[_0x9b7f('0x2f')]=_['intersection'](_0x5c7024[_0x9b7f('0x2c')],_0x5c7024[_0x9b7f('0x2e')]);_0x35ffb4[_0x9b7f('0x30')]=_['intersection'](_0x5c7024[_0x9b7f('0x2c')],qs[_0x9b7f('0x31')](_0x40b9f0[_0x9b7f('0x2e')][_0x9b7f('0x31')]));_0x35ffb4[_0x9b7f('0x30')]=_0x35ffb4[_0x9b7f('0x30')][_0x9b7f('0x32')]?_0x35ffb4[_0x9b7f('0x30')]:_0x5c7024['model'];if(!_0x40b9f0[_0x9b7f('0x2e')][_0x9b7f('0x33')](_0x9b7f('0x34'))){_0x35ffb4[_0x9b7f('0x1f')]=qs[_0x9b7f('0x1f')](_0x40b9f0[_0x9b7f('0x2e')][_0x9b7f('0x1f')]);_0x35ffb4[_0x9b7f('0x1e')]=qs[_0x9b7f('0x1e')](_0x40b9f0[_0x9b7f('0x2e')]['offset']);}_0x35ffb4[_0x9b7f('0x35')]=qs[_0x9b7f('0x36')](_0x40b9f0['query']['sort']);_0x35ffb4['where']=qs[_0x9b7f('0x2f')](_[_0x9b7f('0x37')](_0x40b9f0[_0x9b7f('0x2e')],_0x5c7024['filters']));if(_0x40b9f0[_0x9b7f('0x2e')][_0x9b7f('0x38')]){_0x35ffb4[_0x9b7f('0x39')]=_[_0x9b7f('0x3a')](_0x35ffb4[_0x9b7f('0x39')],{'$or':_[_0x9b7f('0x3b')](_0x433a53,function(_0x2b13a2){if(_0x2b13a2[_0x9b7f('0x3c')][_0x9b7f('0x3d')]!==_0x9b7f('0x3e')){var _0xb0bbf8={};_0xb0bbf8[_0x2b13a2[_0x9b7f('0x3f')]]={'$like':'%'+_0x40b9f0['query'][_0x9b7f('0x38')]+'%'};return _0xb0bbf8;}})});}_0x35ffb4=_[_0x9b7f('0x3a')]({},_0x35ffb4,_0x40b9f0['options']);var _0x164bae={'where':_0x35ffb4[_0x9b7f('0x39')]};return db[_0x9b7f('0x2b')]['count'](_0x164bae)[_0x9b7f('0x24')](function(_0x32ee93){_0x1dc8b6[_0x9b7f('0x1d')]=_0x32ee93;if(_0x40b9f0[_0x9b7f('0x2e')][_0x9b7f('0x40')]){_0x35ffb4[_0x9b7f('0x41')]=[{'all':!![]}];}return db[_0x9b7f('0x2b')]['findAll'](_0x35ffb4);})[_0x9b7f('0x24')](function(_0x3bd09f){_0x1dc8b6[_0x9b7f('0x42')]=_0x3bd09f;return _0x1dc8b6;})[_0x9b7f('0x24')](respondWithFilteredResult(_0xd4c21b,_0x35ffb4))[_0x9b7f('0x43')](handleError(_0xd4c21b,null));};exports[_0x9b7f('0x44')]=function(_0x39d6cb,_0x2a14a2){var _0x13c924={'raw':!![],'where':{'id':_0x39d6cb[_0x9b7f('0x45')]['id']}},_0x284128={};_0x284128[_0x9b7f('0x2c')]=_[_0x9b7f('0x2d')](db[_0x9b7f('0x2b')][_0x9b7f('0x46')]);_0x284128[_0x9b7f('0x2e')]=_[_0x9b7f('0x2d')](_0x39d6cb[_0x9b7f('0x2e')]);_0x284128[_0x9b7f('0x2f')]=_[_0x9b7f('0x47')](_0x284128['model'],_0x284128[_0x9b7f('0x2e')]);_0x13c924[_0x9b7f('0x30')]=_[_0x9b7f('0x47')](_0x284128[_0x9b7f('0x2c')],qs['fields'](_0x39d6cb[_0x9b7f('0x2e')]['fields']));_0x13c924[_0x9b7f('0x30')]=_0x13c924['attributes'][_0x9b7f('0x32')]?_0x13c924[_0x9b7f('0x30')]:_0x284128[_0x9b7f('0x2c')];if(_0x39d6cb[_0x9b7f('0x2e')][_0x9b7f('0x40')]){_0x13c924[_0x9b7f('0x41')]=[{'all':!![]}];}_0x13c924=_[_0x9b7f('0x3a')]({},_0x13c924,_0x39d6cb['options']);return db[_0x9b7f('0x2b')][_0x9b7f('0x48')](_0x13c924)[_0x9b7f('0x24')](handleEntityNotFound(_0x2a14a2,null))[_0x9b7f('0x24')](respondWithResult(_0x2a14a2,null))[_0x9b7f('0x43')](handleError(_0x2a14a2,null));};exports[_0x9b7f('0x49')]=function(_0x58a7d7,_0x39340d,_0xec4c4a){return db[_0x9b7f('0x2b')][_0x9b7f('0x48')]({'where':{'id':_0x58a7d7[_0x9b7f('0x45')]['id']},'attributes':[_0x9b7f('0x29'),_0x9b7f('0x4a'),_0x9b7f('0x4b')],'raw':!![]})[_0x9b7f('0x24')](handleEntityNotFound(_0x39340d,null))[_0x9b7f('0x24')](function(_0x1602ee){if(_0x1602ee){if(!fs[_0x9b7f('0x4c')](path[_0x9b7f('0x4d')](config[_0x9b7f('0x4e')],_0x9b7f('0x4f'),_0x1602ee['save_name']+'.'+_0x1602ee[_0x9b7f('0x4b')]))){throw new db[(_0x9b7f('0x50'))]['ValidationError'](_0x9b7f('0x51'));}return _0x39340d[_0x9b7f('0x49')](path['join'](config[_0x9b7f('0x4e')],_0x9b7f('0x4f'),util[_0x9b7f('0x52')](_0x9b7f('0x53'),_0x1602ee[_0x9b7f('0x4a')],_0x1602ee['converted_format'])),util['format']('%s.%s',_0x1602ee[_0x9b7f('0x29')],_0x1602ee[_0x9b7f('0x4b')]));}return null;})['catch'](handleError(_0x39340d,null));};exports[_0x9b7f('0x54')]=function(_0xdc9cb7,_0x2929b9,_0x556213){var _0x31f4f7={'name':path[_0x9b7f('0x55')](_0xdc9cb7['file'][_0x9b7f('0x56')],path[_0x9b7f('0x57')](_0xdc9cb7[_0x9b7f('0x58')][_0x9b7f('0x56')])),'save_name':path[_0x9b7f('0x55')](_0xdc9cb7['file']['filename'],path[_0x9b7f('0x57')](_0xdc9cb7['file'][_0x9b7f('0x59')])),'original_format':path[_0x9b7f('0x57')](_0xdc9cb7[_0x9b7f('0x58')][_0x9b7f('0x56')])[_0x9b7f('0x5a')](0x1),'converted_format':_0x9b7f('0x5b')};var _0x2e0eb8=path[_0x9b7f('0x4d')](config[_0x9b7f('0x4e')],_0x9b7f('0x5c'),_0xdc9cb7['file'][_0x9b7f('0x59')]);var _0x213fb1=path['join'](config['root'],_0x9b7f('0x4f'),util[_0x9b7f('0x52')](_0x9b7f('0x53'),path[_0x9b7f('0x55')](_0xdc9cb7[_0x9b7f('0x58')]['filename'],path[_0x9b7f('0x57')](_0xdc9cb7[_0x9b7f('0x58')][_0x9b7f('0x59')])),_0x31f4f7[_0x9b7f('0x4b')]));logger[_0x9b7f('0x5d')](_0x9b7f('0x5e'),_0x2e0eb8);logger[_0x9b7f('0x5d')]('Sound\x20upload\x20destination:\x20%s',_0x213fb1);try{fs['chmodSync'](_0x2e0eb8,parseInt(_0x9b7f('0x5f'),0x8));var _0xa875f6=sox[_0x9b7f('0x60')](_0x2e0eb8,_0x213fb1,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xa875f6['on'](_0x9b7f('0x27'),function(_0x389138){fs[_0x9b7f('0x61')](_0x2e0eb8);_0x2929b9[_0x9b7f('0x1a')](0x1f4)[_0x9b7f('0x62')](_0x389138);});_0xa875f6['on'](_0x9b7f('0x63'),function(_0x293218){_0x31f4f7[_0x9b7f('0x64')]=isNaN(_0x293218[_0x9b7f('0x65')])?null:_0x293218[_0x9b7f('0x65')]*0x3e8;_0x31f4f7['original_sampleCount']=isNaN(_0x293218[_0x9b7f('0x66')])?null:_0x293218[_0x9b7f('0x66')];_0x31f4f7[_0x9b7f('0x67')]=isNaN(_0x293218[_0x9b7f('0x68')])?null:_0x293218[_0x9b7f('0x68')];_0x31f4f7[_0x9b7f('0x69')]=isNaN(_0x293218[_0x9b7f('0x6a')])?null:_0x293218[_0x9b7f('0x6a')];_0x31f4f7[_0x9b7f('0x6b')]=isNaN(_0x293218[_0x9b7f('0x6c')])?null:_0x293218['sampleRate'];});_0xa875f6['on']('dest',function(_0x480ad5){_0x31f4f7[_0x9b7f('0x6d')]=isNaN(_0x480ad5[_0x9b7f('0x65')])?null:_0x480ad5[_0x9b7f('0x65')]*0x3e8;_0x31f4f7[_0x9b7f('0x6e')]=isNaN(_0x480ad5[_0x9b7f('0x66')])?null:_0x480ad5[_0x9b7f('0x66')];_0x31f4f7[_0x9b7f('0x6f')]=isNaN(_0x480ad5[_0x9b7f('0x68')])?null:_0x480ad5[_0x9b7f('0x68')];_0x31f4f7[_0x9b7f('0x70')]=isNaN(_0x480ad5['bitRate'])?null:_0x480ad5[_0x9b7f('0x6a')];_0x31f4f7[_0x9b7f('0x71')]=isNaN(_0x480ad5[_0x9b7f('0x6c')])?null:_0x480ad5[_0x9b7f('0x6c')];});_0xa875f6['on'](_0x9b7f('0x1b'),function(){fs[_0x9b7f('0x72')](_0x213fb1,parseInt(_0x9b7f('0x5f'),0x8));return db[_0x9b7f('0x2b')]['create'](_0x31f4f7)[_0x9b7f('0x24')](function(_0x3a2e50){var _0x24a4e4={'role':_0xdc9cb7[_0x9b7f('0x73')]['role'],'userProfileId':_0xdc9cb7[_0x9b7f('0x73')]['userProfileId']};if(!_0x24a4e4)throw new Error(_0x9b7f('0x74'));if(_0x24a4e4[_0x9b7f('0x75')]===_0x9b7f('0x76')){var _0x178a55=_0x3a2e50[_0x9b7f('0x77')]({'plain':!![]});return db[_0x9b7f('0x78')][_0x9b7f('0x48')]({'where':{'name':_0x9b7f('0x79'),'userProfileId':_0x24a4e4['userProfileId']},'raw':!![]})['then'](function(_0x47cce2){if(_0x47cce2&&_0x47cce2[_0x9b7f('0x7a')]===0x0){return db[_0x9b7f('0x26')][_0x9b7f('0x54')]({'name':_0x178a55['name'],'resourceId':_0x178a55['id'],'type':_0x47cce2[_0x9b7f('0x29')],'sectionId':_0x47cce2['id']},{})[_0x9b7f('0x24')](function(){return _0x3a2e50;});}else{return _0x3a2e50;}})[_0x9b7f('0x43')](function(_0x17158e){logger[_0x9b7f('0x27')](_0x9b7f('0x7b'),_0x17158e);throw _0x17158e;});}return _0x3a2e50;})[_0x9b7f('0x24')](respondWithResult(_0x2929b9,null))[_0x9b7f('0x43')](handleError(_0x2929b9,null));});_0xa875f6[_0x9b7f('0x7c')]();}catch(_0x348b27){_0x2929b9['status'](0x1f4)[_0x9b7f('0x62')](_0x348b27);}};exports['update']=function(_0x59408b,_0x1c69f4,_0x4cde89){return db[_0x9b7f('0x2b')]['find']({'where':{'id':_0x59408b[_0x9b7f('0x45')]['id']}})['then'](handleEntityNotFound(_0x1c69f4,null))[_0x9b7f('0x24')](saveUpdates(_[_0x9b7f('0x37')](_0x59408b[_0x9b7f('0x73')],[_0x9b7f('0x29'),_0x9b7f('0x7d')]),null))[_0x9b7f('0x24')](respondWithResult(_0x1c69f4,null))['catch'](handleError(_0x1c69f4,null));};exports['delete']=function(_0x5700ab,_0x30f1fd,_0x193c1f){return db['Sound'][_0x9b7f('0x48')]({'where':{'id':_0x5700ab['params']['id']}})['then'](function(_0x3c4b62){if(_0x3c4b62){return _0x3c4b62[_0x9b7f('0x25')]();}})[_0x9b7f('0x24')](function(_0x17d5a6){var _0x320200=path['join'](config[_0x9b7f('0x4e')],_0x9b7f('0x5c'),util[_0x9b7f('0x52')](_0x9b7f('0x53'),_0x17d5a6[_0x9b7f('0x4a')],_0x17d5a6[_0x9b7f('0x7e')]));var _0x4c781a=path['join'](config[_0x9b7f('0x4e')],_0x9b7f('0x4f'),util[_0x9b7f('0x52')](_0x9b7f('0x53'),_0x17d5a6[_0x9b7f('0x4a')],_0x17d5a6['converted_format']));fs[_0x9b7f('0x61')](_0x320200);fs[_0x9b7f('0x61')](_0x4c781a);return _0x17d5a6;})[_0x9b7f('0x24')](function(_0x5a80c5){if(_0x5a80c5){return _0x30f1fd['status'](0xcc)[_0x9b7f('0x1b')]();}})['then'](handleEntityNotFound(_0x30f1fd,null))[_0x9b7f('0x43')](handleError(_0x30f1fd,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index e11476d..341a73b 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 _0x691c=['exports','define','Sound','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes'];(function(_0x3f52fc,_0x58b2c5){var _0x21b0cb=function(_0x2d2271){while(--_0x2d2271){_0x3f52fc['push'](_0x3f52fc['shift']());}};_0x21b0cb(++_0x58b2c5);}(_0x691c,0xed));var _0xc691=function(_0x242a81,_0x5ad269){_0x242a81=_0x242a81-0x0;var _0x34dae1=_0x691c[_0x242a81];return _0x34dae1;};'use strict';var _=require('lodash');var util=require(_0xc691('0x0'));var logger=require(_0xc691('0x1'))(_0xc691('0x2'));var moment=require(_0xc691('0x3'));var BPromise=require(_0xc691('0x4'));var rp=require(_0xc691('0x5'));var fs=require('fs');var path=require(_0xc691('0x6'));var rimraf=require(_0xc691('0x7'));var config=require(_0xc691('0x8'));var attributes=require(_0xc691('0x9'));module[_0xc691('0xa')]=function(_0x3d2b71,_0x22a074){return _0x3d2b71[_0xc691('0xb')](_0xc691('0xc'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe31e=['exports','Sound','tools_sounds','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x21fb30,_0x42d8b5){var _0x49fdc1=function(_0x595cbf){while(--_0x595cbf){_0x21fb30['push'](_0x21fb30['shift']());}};_0x49fdc1(++_0x42d8b5);}(_0xe31e,0x1d1));var _0xee31=function(_0x2d2c97,_0x5e24b7){_0x2d2c97=_0x2d2c97-0x0;var _0x4c6bdb=_0xe31e[_0x2d2c97];return _0x4c6bdb;};'use strict';var _=require('lodash');var util=require(_0xee31('0x0'));var logger=require('../../config/logger')(_0xee31('0x1'));var moment=require(_0xee31('0x2'));var BPromise=require(_0xee31('0x3'));var rp=require(_0xee31('0x4'));var fs=require('fs');var path=require(_0xee31('0x5'));var rimraf=require(_0xee31('0x6'));var config=require(_0xee31('0x7'));var attributes=require('./sound.attributes');module[_0xee31('0x8')]=function(_0x38be89,_0x34eb87){return _0x38be89['define'](_0xee31('0x9'),attributes,{'tableName':_0xee31('0xa'),'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 2f19fa7..3d06da3 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 _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Sound,\x20%s,\x20%s','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowSound','Sound','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x56b5ab,_0xd23e08){var _0x6d82fa=function(_0x5043f1){while(--_0x5043f1){_0x56b5ab['push'](_0x56b5ab['shift']());}};_0x6d82fa(++_0xd23e08);}(_0xb10b,0x12a));var _0xbb10=function(_0x350f77,_0x12a9b8){_0x350f77=_0x350f77-0x0;var _0x1305b6=_0xb10b[_0x350f77];return _0x1305b6;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Sound,\x20%s,\x20%s','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowSound','Sound','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x5d5827,_0x688d65){var _0x32f7d1=function(_0x384ab6){while(--_0x384ab6){_0x5d5827['push'](_0x5d5827['shift']());}};_0x32f7d1(++_0x688d65);}(_0xb10b,0x12a));var _0xbb10=function(_0x309d93,_0x157662){_0x309d93=_0x309d93-0x0;var _0x2dd61d=_0xb10b[_0x309d93];return _0x2dd61d;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index e3fb058..744b123 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 _0xd110=['./squareMessage.controller','get','isAuthenticated','create','put','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x15977d,_0x3ead78){var _0x101634=function(_0x54253d){while(--_0x54253d){_0x15977d['push'](_0x15977d['shift']());}};_0x101634(++_0x3ead78);}(_0xd110,0x1e8));var _0x0d11=function(_0x579431,_0x25265e){_0x579431=_0x579431-0x0;var _0x38ddeb=_0xd110[_0x579431];return _0x38ddeb;};'use strict';var multer=require(_0x0d11('0x0'));var util=require(_0x0d11('0x1'));var path=require(_0x0d11('0x2'));var timeout=require('connect-timeout');var express=require(_0x0d11('0x3'));var router=express[_0x0d11('0x4')]();var auth=require(_0x0d11('0x5'));var interaction=require(_0x0d11('0x6'));var config=require(_0x0d11('0x7'));var controller=require(_0x0d11('0x8'));router[_0x0d11('0x9')]('/',auth[_0x0d11('0xa')](),controller['index']);router[_0x0d11('0x9')]('/:id',auth[_0x0d11('0xa')](),controller['show']);router['post']('/',auth[_0x0d11('0xa')](),controller[_0x0d11('0xb')]);router[_0x0d11('0xc')]('/:id',auth[_0x0d11('0xa')](),controller['update']);router[_0x0d11('0xd')]('/:id',auth[_0x0d11('0xa')](),controller[_0x0d11('0xe')]);module[_0x0d11('0xf')]=router; \ No newline at end of file +var _0x3264=['show','post','create','put','/:id','delete','destroy','util','path','connect-timeout','express','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x41e710,_0x21a0ac){var _0x354d06=function(_0x375bcc){while(--_0x375bcc){_0x41e710['push'](_0x41e710['shift']());}};_0x354d06(++_0x21a0ac);}(_0x3264,0x7f));var _0x4326=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x3264[_0x2e4aa2];return _0x5e6092;};'use strict';var multer=require('multer');var util=require(_0x4326('0x0'));var path=require(_0x4326('0x1'));var timeout=require(_0x4326('0x2'));var express=require(_0x4326('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x4326('0x4'));var config=require('../../config/environment');var controller=require('./squareMessage.controller');router[_0x4326('0x5')]('/',auth[_0x4326('0x6')](),controller[_0x4326('0x7')]);router[_0x4326('0x5')]('/:id',auth[_0x4326('0x6')](),controller[_0x4326('0x8')]);router[_0x4326('0x9')]('/',auth[_0x4326('0x6')](),controller[_0x4326('0xa')]);router[_0x4326('0xb')](_0x4326('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x4326('0xd')](_0x4326('0xc'),auth[_0x4326('0x6')](),controller[_0x4326('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index dbe17a7..5fcdb48 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 _0xc697=['ENUM','out','sequelize','exports','STRING','TEXT','medium'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0xc697,0x1d0));var _0x7c69=function(_0x3e0529,_0x33129a){_0x3e0529=_0x3e0529-0x0;var _0xee2119=_0xc697[_0x3e0529];return _0xee2119;};'use strict';var Sequelize=require(_0x7c69('0x0'));module[_0x7c69('0x1')]={'uniqueid':{'type':Sequelize[_0x7c69('0x2')]},'body':{'type':Sequelize[_0x7c69('0x3')](_0x7c69('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0x7c69('0x5')]('in',_0x7c69('0x6')),'defaultValue':_0x7c69('0x6'),'allowNull':![]}}; \ No newline at end of file +var _0xa08c=['exports','TEXT','medium','out','sequelize'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0xa08c,0x130));var _0xca08=function(_0x36a7ce,_0x5ca678){_0x36a7ce=_0x36a7ce-0x0;var _0x5a0546=_0xa08c[_0x36a7ce];return _0x5a0546;};'use strict';var Sequelize=require(_0xca08('0x0'));module[_0xca08('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0xca08('0x2')](_0xca08('0x3')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0xca08('0x4')),'defaultValue':_0xca08('0x4'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 63b5870..5016430 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 _0x1775=['../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','save','update','then','destroy','name','send','SquareMessage','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','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','../../config/license/hardware'];(function(_0x25444c,_0x2a10eb){var _0x5d83ad=function(_0x2a60c9){while(--_0x2a60c9){_0x25444c['push'](_0x25444c['shift']());}};_0x5d83ad(++_0x2a10eb);}(_0x1775,0x1db));var _0x5177=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1775[_0x17d9e3];return _0x14192d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5177('0x0'));var rimraf=require(_0x5177('0x1'));var zipdir=require(_0x5177('0x2'));var jsonpatch=require(_0x5177('0x3'));var rp=require(_0x5177('0x4'));var moment=require(_0x5177('0x5'));var BPromise=require(_0x5177('0x6'));var Mustache=require(_0x5177('0x7'));var util=require(_0x5177('0x8'));var path=require(_0x5177('0x9'));var sox=require(_0x5177('0xa'));var csv=require(_0x5177('0xb'));var ejs=require(_0x5177('0xc'));var fs=require('fs');var _=require(_0x5177('0xd'));var squel=require(_0x5177('0xe'));var crypto=require(_0x5177('0xf'));var jsforce=require(_0x5177('0x10'));var deskjs=require(_0x5177('0x11'));var toCsv=require(_0x5177('0xb'));var querystring=require(_0x5177('0x12'));var Papa=require(_0x5177('0x13'));var Redis=require(_0x5177('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x5177('0x15'));var logger=require(_0x5177('0x16'))(_0x5177('0x17'));var utils=require(_0x5177('0x18'));var config=require(_0x5177('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18f567,_0x22fe21){_0x22fe21=_0x22fe21||0xcc;return function(_0xc613b9){if(_0xc613b9){return _0x18f567[_0x5177('0x1a')](_0x22fe21);}return _0x18f567[_0x5177('0x1b')](_0x22fe21)[_0x5177('0x1c')]();};}function respondWithResult(_0x1ab4f1,_0x2ec90f){_0x2ec90f=_0x2ec90f||0xc8;return function(_0x3e6224){if(_0x3e6224){return _0x1ab4f1[_0x5177('0x1b')](_0x2ec90f)[_0x5177('0x1d')](_0x3e6224);}};}function respondWithFilteredResult(_0x2bf5bb,_0x29cd2c){return function(_0x31aff8){if(_0x31aff8){var _0x1b32e6=_0x31aff8[_0x5177('0x1e')],_0x175ca6=_0x29cd2c['offset'],_0x2ab5e5=_0x29cd2c[_0x5177('0x1f')]+_0x29cd2c[_0x5177('0x20')],_0x7dba6f;if(_0x2ab5e5>=_0x1b32e6){_0x2ab5e5=_0x1b32e6;_0x7dba6f=0xc8;}else{_0x7dba6f=0xce;}_0x2bf5bb[_0x5177('0x1b')](_0x7dba6f);return _0x2bf5bb[_0x5177('0x21')]('Content-Range',_0x175ca6+'-'+_0x2ab5e5+'/'+_0x1b32e6)[_0x5177('0x1d')](_0x31aff8);}return null;};}function patchUpdates(_0x2ebf91){return function(_0x13d5d4){try{jsonpatch['apply'](_0x13d5d4,_0x2ebf91,!![]);}catch(_0x86f5f8){return BPromise['reject'](_0x86f5f8);}return _0x13d5d4[_0x5177('0x22')]();};}function saveUpdates(_0xe221b3,_0x219744){return function(_0x27b732){if(_0x27b732){return _0x27b732[_0x5177('0x23')](_0xe221b3)[_0x5177('0x24')](function(_0x174c4f){return _0x174c4f;});}return null;};}function removeEntity(_0xfc1bd4,_0x2152d4){return function(_0x2a95cc){if(_0x2a95cc){return _0x2a95cc[_0x5177('0x25')]()[_0x5177('0x24')](function(){_0xfc1bd4['status'](0xcc)[_0x5177('0x1c')]();});}};}function handleEntityNotFound(_0x556f96,_0x30b60f){return function(_0x2c68d8){if(!_0x2c68d8){_0x556f96[_0x5177('0x1a')](0x194);}return _0x2c68d8;};}function handleError(_0x2d51d0,_0x4bc8e2){_0x4bc8e2=_0x4bc8e2||0x1f4;return function(_0x2503ef){logger['error'](_0x2503ef['stack']);if(_0x2503ef[_0x5177('0x26')]){delete _0x2503ef[_0x5177('0x26')];}_0x2d51d0['status'](_0x4bc8e2)[_0x5177('0x27')](_0x2503ef);};}exports['index']=function(_0x231d35,_0x1cbd29){var _0x58846c={},_0x3e021a={},_0x2554ec={'count':0x0,'rows':[]};var _0x3c4248=db[_0x5177('0x28')][_0x5177('0x29')];_0x3e021a[_0x5177('0x2a')]=_['keys'](_0x3c4248);_0x3e021a['query']=_[_0x5177('0x2b')](_0x231d35[_0x5177('0x2c')]);_0x3e021a[_0x5177('0x2d')]=_[_0x5177('0x2e')](_0x3e021a[_0x5177('0x2a')],_0x3e021a[_0x5177('0x2c')]);_0x58846c[_0x5177('0x2f')]=_[_0x5177('0x2e')](_0x3e021a['model'],qs[_0x5177('0x30')](_0x231d35[_0x5177('0x2c')]['fields']));_0x58846c[_0x5177('0x2f')]=_0x58846c['attributes'][_0x5177('0x31')]?_0x58846c[_0x5177('0x2f')]:_0x3e021a[_0x5177('0x2a')];if(!_0x231d35['query']['hasOwnProperty'](_0x5177('0x32'))){_0x58846c[_0x5177('0x20')]=qs[_0x5177('0x20')](_0x231d35[_0x5177('0x2c')][_0x5177('0x20')]);_0x58846c[_0x5177('0x1f')]=qs[_0x5177('0x1f')](_0x231d35[_0x5177('0x2c')]['offset']);}_0x58846c[_0x5177('0x33')]=qs[_0x5177('0x34')](_0x231d35['query'][_0x5177('0x34')]);_0x58846c[_0x5177('0x35')]=qs[_0x5177('0x2d')](_[_0x5177('0x36')](_0x231d35[_0x5177('0x2c')],_0x3e021a[_0x5177('0x2d')]));if(_0x231d35['query'][_0x5177('0x37')]){_0x58846c[_0x5177('0x35')]=_[_0x5177('0x38')](_0x58846c[_0x5177('0x35')],{'$or':_[_0x5177('0x39')](_0x3c4248,function(_0xacaa96){if(_0xacaa96[_0x5177('0x3a')]['key']!==_0x5177('0x3b')){var _0x2ff13b={};_0x2ff13b[_0xacaa96['field']]={'$like':'%'+_0x231d35['query'][_0x5177('0x37')]+'%'};return _0x2ff13b;}})});}_0x58846c=_[_0x5177('0x38')]({},_0x58846c,_0x231d35[_0x5177('0x3c')]);var _0x182c78={'where':_0x58846c[_0x5177('0x35')]};return db[_0x5177('0x28')][_0x5177('0x1e')](_0x182c78)[_0x5177('0x24')](function(_0xa2ed49){_0x2554ec[_0x5177('0x1e')]=_0xa2ed49;if(_0x231d35[_0x5177('0x2c')][_0x5177('0x3d')]){_0x58846c[_0x5177('0x3e')]=[{'all':!![]}];}return db['SquareMessage'][_0x5177('0x3f')](_0x58846c);})[_0x5177('0x24')](function(_0x4e3677){_0x2554ec[_0x5177('0x40')]=_0x4e3677;return _0x2554ec;})['then'](respondWithFilteredResult(_0x1cbd29,_0x58846c))[_0x5177('0x41')](handleError(_0x1cbd29,null));};exports[_0x5177('0x42')]=function(_0x3f02f1,_0x5742aa){var _0x56eba4={'raw':!![],'where':{'id':_0x3f02f1[_0x5177('0x43')]['id']}},_0x210510={};_0x210510[_0x5177('0x2a')]=_[_0x5177('0x2b')](db[_0x5177('0x28')][_0x5177('0x29')]);_0x210510[_0x5177('0x2c')]=_[_0x5177('0x2b')](_0x3f02f1['query']);_0x210510[_0x5177('0x2d')]=_['intersection'](_0x210510['model'],_0x210510[_0x5177('0x2c')]);_0x56eba4[_0x5177('0x2f')]=_['intersection'](_0x210510[_0x5177('0x2a')],qs['fields'](_0x3f02f1['query'][_0x5177('0x30')]));_0x56eba4[_0x5177('0x2f')]=_0x56eba4[_0x5177('0x2f')][_0x5177('0x31')]?_0x56eba4[_0x5177('0x2f')]:_0x210510[_0x5177('0x2a')];if(_0x3f02f1[_0x5177('0x2c')]['includeAll']){_0x56eba4['include']=[{'all':!![]}];}_0x56eba4=_[_0x5177('0x38')]({},_0x56eba4,_0x3f02f1['options']);return db[_0x5177('0x28')][_0x5177('0x44')](_0x56eba4)[_0x5177('0x24')](handleEntityNotFound(_0x5742aa,null))[_0x5177('0x24')](respondWithResult(_0x5742aa,null))['catch'](handleError(_0x5742aa,null));};exports[_0x5177('0x45')]=function(_0x24fe77,_0x363c63){return db[_0x5177('0x28')][_0x5177('0x45')](_0x24fe77[_0x5177('0x46')],{})[_0x5177('0x24')](respondWithResult(_0x363c63,0xc9))[_0x5177('0x41')](handleError(_0x363c63,null));};exports[_0x5177('0x23')]=function(_0x296a98,_0x3fec49){if(_0x296a98['body']['id']){delete _0x296a98[_0x5177('0x46')]['id'];}return db['SquareMessage']['find']({'where':{'id':_0x296a98['params']['id']}})[_0x5177('0x24')](handleEntityNotFound(_0x3fec49,null))[_0x5177('0x24')](saveUpdates(_0x296a98['body'],null))[_0x5177('0x24')](respondWithResult(_0x3fec49,null))[_0x5177('0x41')](handleError(_0x3fec49,null));};exports[_0x5177('0x25')]=function(_0x4891fe,_0x1d4ae4){return db['SquareMessage']['find']({'where':{'id':_0x4891fe['params']['id']}})[_0x5177('0x24')](handleEntityNotFound(_0x1d4ae4,null))[_0x5177('0x24')](removeEntity(_0x1d4ae4,null))[_0x5177('0x41')](handleError(_0x1d4ae4,null));}; \ No newline at end of file +var _0xd87e=['catch','show','rawAttributes','merge','find','create','body','update','params','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','status','end','count','offset','limit','set','Content-Range','apply','reject','save','destroy','then','sendStatus','error','stack','name','send','index','SquareMessage','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','map','type','key','VIRTUAL','field','filter','options','includeAll','include','rows'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xd87e,0x1bf));var _0xed87=function(_0x4fb73e,_0x17f37d){_0x4fb73e=_0x4fb73e-0x0;var _0x14de68=_0xd87e[_0x4fb73e];return _0x14de68;};'use strict';var pdf=require(_0xed87('0x0'));var emlformat=require(_0xed87('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xed87('0x2'));var jsonpatch=require(_0xed87('0x3'));var rp=require(_0xed87('0x4'));var moment=require('moment');var BPromise=require(_0xed87('0x5'));var Mustache=require('mustache');var util=require(_0xed87('0x6'));var path=require(_0xed87('0x7'));var sox=require('sox');var csv=require(_0xed87('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xed87('0x9'));var crypto=require(_0xed87('0xa'));var jsforce=require(_0xed87('0xb'));var deskjs=require(_0xed87('0xc'));var toCsv=require('to-csv');var querystring=require(_0xed87('0xd'));var Papa=require(_0xed87('0xe'));var Redis=require(_0xed87('0xf'));var authService=require(_0xed87('0x10'));var qs=require(_0xed87('0x11'));var hardwareService=require(_0xed87('0x12'));var logger=require(_0xed87('0x13'))('api');var utils=require(_0xed87('0x14'));var config=require(_0xed87('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f642f,_0x3bc3c6){_0x3bc3c6=_0x3bc3c6||0xcc;return function(_0x5e912e){if(_0x5e912e){return _0x2f642f['sendStatus'](_0x3bc3c6);}return _0x2f642f[_0xed87('0x16')](_0x3bc3c6)[_0xed87('0x17')]();};}function respondWithResult(_0x353d46,_0x24fc2a){_0x24fc2a=_0x24fc2a||0xc8;return function(_0x16bfd6){if(_0x16bfd6){return _0x353d46[_0xed87('0x16')](_0x24fc2a)['json'](_0x16bfd6);}};}function respondWithFilteredResult(_0x4494da,_0x19b283){return function(_0x1722a6){if(_0x1722a6){var _0x1e9a3d=_0x1722a6[_0xed87('0x18')],_0x2f2fd3=_0x19b283[_0xed87('0x19')],_0xd34e0e=_0x19b283['offset']+_0x19b283[_0xed87('0x1a')],_0x173413;if(_0xd34e0e>=_0x1e9a3d){_0xd34e0e=_0x1e9a3d;_0x173413=0xc8;}else{_0x173413=0xce;}_0x4494da[_0xed87('0x16')](_0x173413);return _0x4494da[_0xed87('0x1b')](_0xed87('0x1c'),_0x2f2fd3+'-'+_0xd34e0e+'/'+_0x1e9a3d)['json'](_0x1722a6);}return null;};}function patchUpdates(_0x211085){return function(_0x473f00){try{jsonpatch[_0xed87('0x1d')](_0x473f00,_0x211085,!![]);}catch(_0x3f9e08){return BPromise[_0xed87('0x1e')](_0x3f9e08);}return _0x473f00[_0xed87('0x1f')]();};}function saveUpdates(_0x195ef8,_0x6df244){return function(_0x3b7981){if(_0x3b7981){return _0x3b7981['update'](_0x195ef8)['then'](function(_0x5db546){return _0x5db546;});}return null;};}function removeEntity(_0x47c121,_0x42609e){return function(_0x5d3ec8){if(_0x5d3ec8){return _0x5d3ec8[_0xed87('0x20')]()[_0xed87('0x21')](function(){_0x47c121['status'](0xcc)[_0xed87('0x17')]();});}};}function handleEntityNotFound(_0x505733,_0x3d1641){return function(_0x24962e){if(!_0x24962e){_0x505733[_0xed87('0x22')](0x194);}return _0x24962e;};}function handleError(_0x2a8733,_0x23ea90){_0x23ea90=_0x23ea90||0x1f4;return function(_0x5d15b3){logger[_0xed87('0x23')](_0x5d15b3[_0xed87('0x24')]);if(_0x5d15b3[_0xed87('0x25')]){delete _0x5d15b3[_0xed87('0x25')];}_0x2a8733[_0xed87('0x16')](_0x23ea90)[_0xed87('0x26')](_0x5d15b3);};}exports[_0xed87('0x27')]=function(_0x4735b3,_0x40b2fa){var _0x38f5c={},_0x469181={},_0x341a35={'count':0x0,'rows':[]};var _0x16a541=db[_0xed87('0x28')]['rawAttributes'];_0x469181[_0xed87('0x29')]=_[_0xed87('0x2a')](_0x16a541);_0x469181['query']=_[_0xed87('0x2a')](_0x4735b3[_0xed87('0x2b')]);_0x469181[_0xed87('0x2c')]=_['intersection'](_0x469181['model'],_0x469181[_0xed87('0x2b')]);_0x38f5c[_0xed87('0x2d')]=_[_0xed87('0x2e')](_0x469181['model'],qs[_0xed87('0x2f')](_0x4735b3[_0xed87('0x2b')][_0xed87('0x2f')]));_0x38f5c[_0xed87('0x2d')]=_0x38f5c[_0xed87('0x2d')][_0xed87('0x30')]?_0x38f5c[_0xed87('0x2d')]:_0x469181[_0xed87('0x29')];if(!_0x4735b3[_0xed87('0x2b')]['hasOwnProperty'](_0xed87('0x31'))){_0x38f5c[_0xed87('0x1a')]=qs['limit'](_0x4735b3[_0xed87('0x2b')]['limit']);_0x38f5c[_0xed87('0x19')]=qs[_0xed87('0x19')](_0x4735b3[_0xed87('0x2b')][_0xed87('0x19')]);}_0x38f5c[_0xed87('0x32')]=qs[_0xed87('0x33')](_0x4735b3[_0xed87('0x2b')][_0xed87('0x33')]);_0x38f5c[_0xed87('0x34')]=qs[_0xed87('0x2c')](_[_0xed87('0x35')](_0x4735b3['query'],_0x469181[_0xed87('0x2c')]));if(_0x4735b3[_0xed87('0x2b')]['filter']){_0x38f5c[_0xed87('0x34')]=_['merge'](_0x38f5c[_0xed87('0x34')],{'$or':_[_0xed87('0x36')](_0x16a541,function(_0x5ee114){if(_0x5ee114[_0xed87('0x37')][_0xed87('0x38')]!==_0xed87('0x39')){var _0x1ba3cf={};_0x1ba3cf[_0x5ee114[_0xed87('0x3a')]]={'$like':'%'+_0x4735b3['query'][_0xed87('0x3b')]+'%'};return _0x1ba3cf;}})});}_0x38f5c=_['merge']({},_0x38f5c,_0x4735b3[_0xed87('0x3c')]);var _0x4ca5f9={'where':_0x38f5c[_0xed87('0x34')]};return db[_0xed87('0x28')][_0xed87('0x18')](_0x4ca5f9)[_0xed87('0x21')](function(_0x319f69){_0x341a35[_0xed87('0x18')]=_0x319f69;if(_0x4735b3[_0xed87('0x2b')][_0xed87('0x3d')]){_0x38f5c[_0xed87('0x3e')]=[{'all':!![]}];}return db['SquareMessage']['findAll'](_0x38f5c);})[_0xed87('0x21')](function(_0x206544){_0x341a35[_0xed87('0x3f')]=_0x206544;return _0x341a35;})[_0xed87('0x21')](respondWithFilteredResult(_0x40b2fa,_0x38f5c))[_0xed87('0x40')](handleError(_0x40b2fa,null));};exports[_0xed87('0x41')]=function(_0x5d1bd0,_0x4398a0){var _0xe2e77={'raw':!![],'where':{'id':_0x5d1bd0['params']['id']}},_0x1c49b0={};_0x1c49b0[_0xed87('0x29')]=_[_0xed87('0x2a')](db[_0xed87('0x28')][_0xed87('0x42')]);_0x1c49b0[_0xed87('0x2b')]=_[_0xed87('0x2a')](_0x5d1bd0[_0xed87('0x2b')]);_0x1c49b0[_0xed87('0x2c')]=_[_0xed87('0x2e')](_0x1c49b0[_0xed87('0x29')],_0x1c49b0['query']);_0xe2e77[_0xed87('0x2d')]=_[_0xed87('0x2e')](_0x1c49b0[_0xed87('0x29')],qs['fields'](_0x5d1bd0['query'][_0xed87('0x2f')]));_0xe2e77[_0xed87('0x2d')]=_0xe2e77[_0xed87('0x2d')][_0xed87('0x30')]?_0xe2e77['attributes']:_0x1c49b0[_0xed87('0x29')];if(_0x5d1bd0[_0xed87('0x2b')]['includeAll']){_0xe2e77[_0xed87('0x3e')]=[{'all':!![]}];}_0xe2e77=_[_0xed87('0x43')]({},_0xe2e77,_0x5d1bd0[_0xed87('0x3c')]);return db[_0xed87('0x28')][_0xed87('0x44')](_0xe2e77)[_0xed87('0x21')](handleEntityNotFound(_0x4398a0,null))[_0xed87('0x21')](respondWithResult(_0x4398a0,null))[_0xed87('0x40')](handleError(_0x4398a0,null));};exports[_0xed87('0x45')]=function(_0x3cb18c,_0x133b8d){return db['SquareMessage'][_0xed87('0x45')](_0x3cb18c[_0xed87('0x46')],{})[_0xed87('0x21')](respondWithResult(_0x133b8d,0xc9))[_0xed87('0x40')](handleError(_0x133b8d,null));};exports[_0xed87('0x47')]=function(_0x1d3f37,_0x1d0962){if(_0x1d3f37[_0xed87('0x46')]['id']){delete _0x1d3f37[_0xed87('0x46')]['id'];}return db[_0xed87('0x28')][_0xed87('0x44')]({'where':{'id':_0x1d3f37[_0xed87('0x48')]['id']}})[_0xed87('0x21')](handleEntityNotFound(_0x1d0962,null))[_0xed87('0x21')](saveUpdates(_0x1d3f37[_0xed87('0x46')],null))[_0xed87('0x21')](respondWithResult(_0x1d0962,null))[_0xed87('0x40')](handleError(_0x1d0962,null));};exports['destroy']=function(_0x2c7bef,_0x1a68a7){return db[_0xed87('0x28')]['find']({'where':{'id':_0x2c7bef[_0xed87('0x48')]['id']}})[_0xed87('0x21')](handleEntityNotFound(_0x1a68a7,null))['then'](removeEntity(_0x1a68a7,null))[_0xed87('0x40')](handleError(_0x1a68a7,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index f449a4b..d668682 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 _0xc2af=['lodash','util','../../config/logger','path','rimraf','../../config/environment','exports','define','SquareMessage'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0xc2af,0xab));var _0xfc2a=function(_0x38f655,_0x357a3b){_0x38f655=_0x38f655-0x0;var _0xe17580=_0xc2af[_0x38f655];return _0xe17580;};'use strict';var _=require(_0xfc2a('0x0'));var util=require(_0xfc2a('0x1'));var logger=require(_0xfc2a('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfc2a('0x3'));var rimraf=require(_0xfc2a('0x4'));var config=require(_0xfc2a('0x5'));var attributes=require('./squareMessage.attributes');module[_0xfc2a('0x6')]=function(_0x445c63,_0x58be57){return _0x445c63[_0xfc2a('0x7')](_0xfc2a('0x8'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa291=['rimraf','../../config/environment','./squareMessage.attributes','exports','SquareMessage','square_messages','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xa291,0x102));var _0x1a29=function(_0x3fa7d3,_0x37f83c){_0x3fa7d3=_0x3fa7d3-0x0;var _0x4c51bd=_0xa291[_0x3fa7d3];return _0x4c51bd;};'use strict';var _=require(_0x1a29('0x0'));var util=require(_0x1a29('0x1'));var logger=require(_0x1a29('0x2'))(_0x1a29('0x3'));var moment=require('moment');var BPromise=require(_0x1a29('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1a29('0x5'));var rimraf=require(_0x1a29('0x6'));var config=require(_0x1a29('0x7'));var attributes=require(_0x1a29('0x8'));module[_0x1a29('0x9')]=function(_0x562327,_0x1d9b0b){return _0x562327['define'](_0x1a29('0xa'),attributes,{'tableName':_0x1a29('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index 29a41df..a8b0c53 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 _0x5159=['../../config/environment','jayson/promise','client','request','info','SquareMessage,\x20%s,\x20%s','debug','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSquareMessage','SquareMessage','create','body','options','then','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x43fef8,_0x3094b4){var _0x2c2235=function(_0x1d923a){while(--_0x1d923a){_0x43fef8['push'](_0x43fef8['shift']());}};_0x2c2235(++_0x3094b4);}(_0x5159,0x6f));var _0x9515=function(_0x1a4568,_0x2af4b7){_0x1a4568=_0x1a4568-0x0;var _0x2343ae=_0x5159[_0x1a4568];return _0x2343ae;};'use strict';var _=require(_0x9515('0x0'));var util=require(_0x9515('0x1'));var moment=require(_0x9515('0x2'));var BPromise=require(_0x9515('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9515('0x4'));var db=require(_0x9515('0x5'))['db'];var utils=require(_0x9515('0x6'));var logger=require(_0x9515('0x7'))(_0x9515('0x8'));var config=require(_0x9515('0x9'));var jayson=require(_0x9515('0xa'));var client=jayson[_0x9515('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d14f5,_0x56f831,_0x3e7d01){return new BPromise(function(_0x434d21,_0x5105b7){return client[_0x9515('0xc')](_0x3d14f5,_0x3e7d01)['then'](function(_0x324c17){logger[_0x9515('0xd')](_0x9515('0xe'),_0x56f831,'request\x20sent');logger[_0x9515('0xf')](_0x9515('0x10'),_0x56f831,_0x9515('0x11'),JSON[_0x9515('0x12')](_0x324c17));if(_0x324c17[_0x9515('0x13')]){if(_0x324c17[_0x9515('0x13')][_0x9515('0x14')]===0x1f4){logger[_0x9515('0x13')](_0x9515('0xe'),_0x56f831,_0x324c17[_0x9515('0x13')][_0x9515('0x15')]);return _0x5105b7(_0x324c17[_0x9515('0x13')][_0x9515('0x15')]);}logger[_0x9515('0x13')]('SquareMessage,\x20%s,\x20%s',_0x56f831,_0x324c17['error']['message']);return _0x434d21(_0x324c17[_0x9515('0x13')]['message']);}else{logger[_0x9515('0xd')](_0x9515('0xe'),_0x56f831,_0x9515('0x11'));_0x434d21(_0x324c17[_0x9515('0x16')][_0x9515('0x15')]);}})[_0x9515('0x17')](function(_0x4622bd){logger[_0x9515('0x13')]('SquareMessage,\x20%s,\x20%s',_0x56f831,_0x4622bd);_0x5105b7(_0x4622bd);});});}exports[_0x9515('0x18')]=function(_0x2c4a97){var _0x5e86a1=this;return new Promise(function(_0x50e196,_0x32c013){return db[_0x9515('0x19')][_0x9515('0x1a')](_0x2c4a97[_0x9515('0x1b')],{'raw':_0x2c4a97[_0x9515('0x1c')]?_0x2c4a97[_0x9515('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x9515('0x1d')](function(_0x3fc454){logger['info']('CreateSquareMessage',_0x2c4a97);logger[_0x9515('0xf')](_0x9515('0x18'),_0x2c4a97,JSON['stringify'](_0x3fc454));_0x50e196(_0x3fc454);})[_0x9515('0x17')](function(_0x462150){logger[_0x9515('0x13')](_0x9515('0x18'),_0x462150[_0x9515('0x15')],_0x2c4a97);_0x32c013(_0x5e86a1[_0x9515('0x13')](0x1f4,_0x462150[_0x9515('0x15')]));});});}; \ No newline at end of file +var _0xbea9=['catch','CreateSquareMessage','body','options','then','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','SquareMessage,\x20%s,\x20%s','debug','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x41ba0c,_0x32fa00){var _0x4a355d=function(_0xb48bbb){while(--_0xb48bbb){_0x41ba0c['push'](_0x41ba0c['shift']());}};_0x4a355d(++_0x32fa00);}(_0xbea9,0xe6));var _0x9bea=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbea9[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x9bea('0x0'));var util=require('util');var moment=require(_0x9bea('0x1'));var BPromise=require(_0x9bea('0x2'));var rs=require(_0x9bea('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9bea('0x4'));var logger=require('../../config/logger')(_0x9bea('0x5'));var config=require(_0x9bea('0x6'));var jayson=require(_0x9bea('0x7'));var client=jayson[_0x9bea('0x8')][_0x9bea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4bb6ea,_0xa94103,_0x5a6afe){return new BPromise(function(_0x476128,_0x3a4af1){return client['request'](_0x4bb6ea,_0x5a6afe)['then'](function(_0x489730){logger[_0x9bea('0xa')](_0x9bea('0xb'),_0xa94103,'request\x20sent');logger[_0x9bea('0xc')](_0x9bea('0xd'),_0xa94103,_0x9bea('0xe'),JSON[_0x9bea('0xf')](_0x489730));if(_0x489730['error']){if(_0x489730[_0x9bea('0x10')][_0x9bea('0x11')]===0x1f4){logger[_0x9bea('0x10')](_0x9bea('0xb'),_0xa94103,_0x489730['error'][_0x9bea('0x12')]);return _0x3a4af1(_0x489730[_0x9bea('0x10')]['message']);}logger[_0x9bea('0x10')](_0x9bea('0xb'),_0xa94103,_0x489730['error'][_0x9bea('0x12')]);return _0x476128(_0x489730[_0x9bea('0x10')][_0x9bea('0x12')]);}else{logger[_0x9bea('0xa')](_0x9bea('0xb'),_0xa94103,_0x9bea('0xe'));_0x476128(_0x489730[_0x9bea('0x13')][_0x9bea('0x12')]);}})[_0x9bea('0x14')](function(_0x59a278){logger[_0x9bea('0x10')](_0x9bea('0xb'),_0xa94103,_0x59a278);_0x3a4af1(_0x59a278);});});}exports[_0x9bea('0x15')]=function(_0x4f4c42){var _0x2a4c7f=this;return new Promise(function(_0x5ec5c3,_0x25ef82){return db['SquareMessage']['create'](_0x4f4c42[_0x9bea('0x16')],{'raw':_0x4f4c42['options']?_0x4f4c42[_0x9bea('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x9bea('0x18')](function(_0xa9b396){logger[_0x9bea('0xa')]('CreateSquareMessage',_0x4f4c42);logger[_0x9bea('0xc')](_0x9bea('0x15'),_0x4f4c42,JSON[_0x9bea('0xf')](_0xa9b396));_0x5ec5c3(_0xa9b396);})[_0x9bea('0x14')](function(_0x433372){logger[_0x9bea('0x10')](_0x9bea('0x15'),_0x433372['message'],_0x4f4c42);_0x25ef82(_0x2a4c7f['error'](0x1f4,_0x433372[_0x9bea('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 5410567..3950e7d 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 _0x40ca=['Router','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/test','15s','test','post','create','put','update','delete','exports','multer','connect-timeout','express'];(function(_0x243a4e,_0x52ac21){var _0x4f9488=function(_0x2cdab5){while(--_0x2cdab5){_0x243a4e['push'](_0x243a4e['shift']());}};_0x4f9488(++_0x52ac21);}(_0x40ca,0x1a1));var _0xa40c=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x40ca[_0x311c35];return _0x5cc50c;};'use strict';var multer=require(_0xa40c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa40c('0x1'));var express=require(_0xa40c('0x2'));var router=express[_0xa40c('0x3')]();var auth=require(_0xa40c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa40c('0x5'));var controller=require('./squareOdbc.controller');router[_0xa40c('0x6')]('/',auth['isAuthenticated'](),controller[_0xa40c('0x7')]);router['get'](_0xa40c('0x8'),auth[_0xa40c('0x9')](),controller[_0xa40c('0xa')]);router[_0xa40c('0x6')](_0xa40c('0xb'),auth['isAuthenticated'](),timeout(_0xa40c('0xc')),controller[_0xa40c('0xd')]);router[_0xa40c('0xe')]('/',auth[_0xa40c('0x9')](),controller[_0xa40c('0xf')]);router[_0xa40c('0x10')](_0xa40c('0x8'),auth[_0xa40c('0x9')](),controller[_0xa40c('0x11')]);router[_0xa40c('0x12')]('/:id',auth[_0xa40c('0x9')](),controller['destroy']);module[_0xa40c('0x13')]=router; \ No newline at end of file +var _0x18a5=['../../config/environment','./squareOdbc.controller','get','/:id','isAuthenticated','show','/:id/test','15s','test','post','create','put','update','destroy','multer','util','express','../../components/auth/service','../../components/interaction/service'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x18a5,0x164));var _0x518a=function(_0x37580a,_0xaf6234){_0x37580a=_0x37580a-0x0;var _0x345149=_0x18a5[_0x37580a];return _0x345149;};'use strict';var multer=require(_0x518a('0x0'));var util=require(_0x518a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x518a('0x2'));var router=express['Router']();var auth=require(_0x518a('0x3'));var interaction=require(_0x518a('0x4'));var config=require(_0x518a('0x5'));var controller=require(_0x518a('0x6'));router[_0x518a('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x518a('0x8'),auth[_0x518a('0x9')](),controller[_0x518a('0xa')]);router[_0x518a('0x7')](_0x518a('0xb'),auth[_0x518a('0x9')](),timeout(_0x518a('0xc')),controller[_0x518a('0xd')]);router[_0x518a('0xe')]('/',auth[_0x518a('0x9')](),controller[_0x518a('0xf')]);router[_0x518a('0x10')](_0x518a('0x8'),auth[_0x518a('0x9')](),controller[_0x518a('0x11')]);router['delete'](_0x518a('0x8'),auth['isAuthenticated'](),controller[_0x518a('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 69e0bf6..9b68149 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 _0xe9b1=['exports','STRING','name'];(function(_0x16fe4c,_0x2421e8){var _0x9999d=function(_0x26160a){while(--_0x26160a){_0x16fe4c['push'](_0x16fe4c['shift']());}};_0x9999d(++_0x2421e8);}(_0xe9b1,0x1b6));var _0x1e9b=function(_0x28b7ab,_0x16a764){_0x28b7ab=_0x28b7ab-0x0;var _0x56791b=_0xe9b1[_0x28b7ab];return _0x56791b;};'use strict';var Sequelize=require('sequelize');module[_0x1e9b('0x0')]={'name':{'type':Sequelize[_0x1e9b('0x1')],'unique':_0x1e9b('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x1e9b('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xabf3=['name','sequelize','exports','STRING'];(function(_0x4e1de9,_0x24448b){var _0x25da2b=function(_0x505205){while(--_0x505205){_0x4e1de9['push'](_0x4e1de9['shift']());}};_0x25da2b(++_0x24448b);}(_0xabf3,0xf9));var _0x3abf=function(_0x4fa9cf,_0x205e79){_0x4fa9cf=_0x4fa9cf-0x0;var _0x5efa52=_0xabf3[_0x4fa9cf];return _0x5efa52;};'use strict';var Sequelize=require(_0x3abf('0x0'));module[_0x3abf('0x1')]={'name':{'type':Sequelize[_0x3abf('0x2')],'unique':_0x3abf('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x3abf('0x2')]},'description':{'type':Sequelize[_0x3abf('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index e15e9ac..4937558 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(_0x48ce20,_0x578e7c){var _0x50c3b3=function(_0x4fde8e){while(--_0x4fde8e){_0x48ce20['push'](_0x48ce20['shift']());}};_0x50c3b3(++_0x578e7c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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(_0x53fc85,_0x4782cc){var _0x12a441=function(_0xdb804b){while(--_0xdb804b){_0x53fc85['push'](_0x53fc85['shift']());}};_0x12a441(++_0x4782cc);}(_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(){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 7645994..fb3ba35 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 _0xb89f=['lodash','util','../../config/logger','api','moment','request-promise','path','./squareOdbc.attributes','exports','SquareOdbc','square_odbc'];(function(_0x255478,_0xb910d8){var _0x5668e1=function(_0x3ff249){while(--_0x3ff249){_0x255478['push'](_0x255478['shift']());}};_0x5668e1(++_0xb910d8);}(_0xb89f,0x1ef));var _0xfb89=function(_0x2ff10e,_0xe2461c){_0x2ff10e=_0x2ff10e-0x0;var _0x2b4fd9=_0xb89f[_0x2ff10e];return _0x2b4fd9;};'use strict';var _=require(_0xfb89('0x0'));var util=require(_0xfb89('0x1'));var logger=require(_0xfb89('0x2'))(_0xfb89('0x3'));var moment=require(_0xfb89('0x4'));var BPromise=require('bluebird');var rp=require(_0xfb89('0x5'));var fs=require('fs');var path=require(_0xfb89('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfb89('0x7'));module[_0xfb89('0x8')]=function(_0xc897c3,_0x55504e){return _0xc897c3['define'](_0xfb89('0x9'),attributes,{'tableName':_0xfb89('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1c71=['request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','define','SquareOdbc','square_odbc','util','bluebird'];(function(_0x50cc54,_0x54c15f){var _0x28ecca=function(_0x4eff92){while(--_0x4eff92){_0x50cc54['push'](_0x50cc54['shift']());}};_0x28ecca(++_0x54c15f);}(_0x1c71,0x120));var _0x11c7=function(_0x3f4a50,_0x5a5db1){_0x3f4a50=_0x3f4a50-0x0;var _0x70a8b2=_0x1c71[_0x3f4a50];return _0x70a8b2;};'use strict';var _=require('lodash');var util=require(_0x11c7('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x11c7('0x1'));var rp=require(_0x11c7('0x2'));var fs=require('fs');var path=require(_0x11c7('0x3'));var rimraf=require(_0x11c7('0x4'));var config=require(_0x11c7('0x5'));var attributes=require(_0x11c7('0x6'));module['exports']=function(_0x2ad37d,_0x4a02a6){return _0x2ad37d[_0x11c7('0x7')](_0x11c7('0x8'),attributes,{'tableName':_0x11c7('0x9'),'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 0a382e8..7bfe2d1 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 _0xb821=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','code','error','SquareOdbc,\x20%s,\x20%s','message','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','model','include','map','debug','lodash','util'];(function(_0x519233,_0xd7014c){var _0x3f4054=function(_0x2078d4){while(--_0x2078d4){_0x519233['push'](_0x519233['shift']());}};_0x3f4054(++_0xd7014c);}(_0xb821,0x1c5));var _0x1b82=function(_0x17d89c,_0x114470){_0x17d89c=_0x17d89c-0x0;var _0x12f2bf=_0xb821[_0x17d89c];return _0x12f2bf;};'use strict';var _=require(_0x1b82('0x0'));var util=require(_0x1b82('0x1'));var moment=require(_0x1b82('0x2'));var BPromise=require(_0x1b82('0x3'));var rs=require(_0x1b82('0x4'));var fs=require('fs');var Redis=require(_0x1b82('0x5'));var db=require(_0x1b82('0x6'))['db'];var utils=require(_0x1b82('0x7'));var logger=require(_0x1b82('0x8'))(_0x1b82('0x9'));var config=require(_0x1b82('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x1b82('0xb')][_0x1b82('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x26a6bc,_0x4e8e19,_0x4b9e98){return new BPromise(function(_0x1e37ea,_0x49d9b8){return client[_0x1b82('0xd')](_0x26a6bc,_0x4b9e98)[_0x1b82('0xe')](function(_0x32cf1e){logger[_0x1b82('0xf')]('SquareOdbc,\x20%s,\x20%s',_0x4e8e19,_0x1b82('0x10'));logger['debug'](_0x1b82('0x11'),_0x4e8e19,'request\x20sent',JSON[_0x1b82('0x12')](_0x32cf1e));if(_0x32cf1e['error']){if(_0x32cf1e['error'][_0x1b82('0x13')]===0x1f4){logger[_0x1b82('0x14')](_0x1b82('0x15'),_0x4e8e19,_0x32cf1e[_0x1b82('0x14')][_0x1b82('0x16')]);return _0x49d9b8(_0x32cf1e['error'][_0x1b82('0x16')]);}logger['error'](_0x1b82('0x15'),_0x4e8e19,_0x32cf1e[_0x1b82('0x14')][_0x1b82('0x16')]);return _0x1e37ea(_0x32cf1e[_0x1b82('0x14')][_0x1b82('0x16')]);}else{logger[_0x1b82('0xf')](_0x1b82('0x15'),_0x4e8e19,_0x1b82('0x10'));_0x1e37ea(_0x32cf1e['result'][_0x1b82('0x16')]);}})[_0x1b82('0x17')](function(_0x5239e5){logger[_0x1b82('0x14')](_0x1b82('0x15'),_0x4e8e19,_0x5239e5);_0x49d9b8(_0x5239e5);});});}exports[_0x1b82('0x18')]=function(_0x5ab19e){var _0x3c0c72=this;return new Promise(function(_0x35db91,_0x332027){return db[_0x1b82('0x19')][_0x1b82('0x1a')]({'raw':_0x5ab19e['options']?_0x5ab19e[_0x1b82('0x1b')][_0x1b82('0x1c')]===undefined?!![]:![]:!![],'where':_0x5ab19e[_0x1b82('0x1b')]?_0x5ab19e[_0x1b82('0x1b')][_0x1b82('0x1d')]||null:null,'attributes':_0x5ab19e[_0x1b82('0x1b')]?_0x5ab19e[_0x1b82('0x1b')][_0x1b82('0x1e')]||null:null,'include':_0x5ab19e[_0x1b82('0x1b')]?_0x5ab19e[_0x1b82('0x1b')]['include']?_['map'](_0x5ab19e['options']['include'],function(_0x32b8b3){return{'model':db[_0x32b8b3[_0x1b82('0x1f')]],'as':_0x32b8b3['as'],'attributes':_0x32b8b3[_0x1b82('0x1e')],'include':_0x32b8b3[_0x1b82('0x20')]?_[_0x1b82('0x21')](_0x32b8b3[_0x1b82('0x20')],function(_0x22fccc){return{'model':db[_0x22fccc[_0x1b82('0x1f')]],'as':_0x22fccc['as'],'attributes':_0x22fccc[_0x1b82('0x1e')],'include':_0x22fccc[_0x1b82('0x20')]?_[_0x1b82('0x21')](_0x22fccc[_0x1b82('0x20')],function(_0x1dbcc3){return{'model':db[_0x1dbcc3['model']],'as':_0x1dbcc3['as'],'attributes':_0x1dbcc3[_0x1b82('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x498cd9){logger[_0x1b82('0xf')](_0x1b82('0x18'),_0x5ab19e);logger[_0x1b82('0x22')]('ShowSquareOdbc',_0x5ab19e,JSON[_0x1b82('0x12')](_0x498cd9));_0x35db91(_0x498cd9);})['catch'](function(_0x328fb6){logger[_0x1b82('0x14')](_0x1b82('0x18'),_0x328fb6['message'],_0x5ab19e);_0x332027(_0x3c0c72['error'](0x1f4,_0x328fb6[_0x1b82('0x16')]));});});}; \ No newline at end of file +var _0x31c8=['client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','include','model','map','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x58f77e,_0x15c937){var _0x2d5d9c=function(_0x505b5e){while(--_0x505b5e){_0x58f77e['push'](_0x58f77e['shift']());}};_0x2d5d9c(++_0x15c937);}(_0x31c8,0x1d3));var _0x831c=function(_0x4e53fb,_0x2fa0c0){_0x4e53fb=_0x4e53fb-0x0;var _0x2a1efe=_0x31c8[_0x4e53fb];return _0x2a1efe;};'use strict';var _=require(_0x831c('0x0'));var util=require(_0x831c('0x1'));var moment=require(_0x831c('0x2'));var BPromise=require(_0x831c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x831c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x831c('0x5'))(_0x831c('0x6'));var config=require(_0x831c('0x7'));var jayson=require(_0x831c('0x8'));var client=jayson[_0x831c('0x9')][_0x831c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f2e29,_0x40b5ab,_0x5ca718){return new BPromise(function(_0x152667,_0x4725b1){return client[_0x831c('0xb')](_0x5f2e29,_0x5ca718)[_0x831c('0xc')](function(_0xac3d79){logger[_0x831c('0xd')](_0x831c('0xe'),_0x40b5ab,_0x831c('0xf'));logger[_0x831c('0x10')](_0x831c('0x11'),_0x40b5ab,_0x831c('0xf'),JSON[_0x831c('0x12')](_0xac3d79));if(_0xac3d79[_0x831c('0x13')]){if(_0xac3d79[_0x831c('0x13')][_0x831c('0x14')]===0x1f4){logger['error'](_0x831c('0xe'),_0x40b5ab,_0xac3d79['error']['message']);return _0x4725b1(_0xac3d79['error'][_0x831c('0x15')]);}logger[_0x831c('0x13')]('SquareOdbc,\x20%s,\x20%s',_0x40b5ab,_0xac3d79[_0x831c('0x13')]['message']);return _0x152667(_0xac3d79[_0x831c('0x13')][_0x831c('0x15')]);}else{logger[_0x831c('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x40b5ab,_0x831c('0xf'));_0x152667(_0xac3d79[_0x831c('0x16')][_0x831c('0x15')]);}})[_0x831c('0x17')](function(_0x276a7c){logger[_0x831c('0x13')](_0x831c('0xe'),_0x40b5ab,_0x276a7c);_0x4725b1(_0x276a7c);});});}exports[_0x831c('0x18')]=function(_0x7a0394){var _0x16dbe8=this;return new Promise(function(_0x372f30,_0x4196c6){return db[_0x831c('0x19')][_0x831c('0x1a')]({'raw':_0x7a0394[_0x831c('0x1b')]?_0x7a0394['options'][_0x831c('0x1c')]===undefined?!![]:![]:!![],'where':_0x7a0394[_0x831c('0x1b')]?_0x7a0394[_0x831c('0x1b')][_0x831c('0x1d')]||null:null,'attributes':_0x7a0394[_0x831c('0x1b')]?_0x7a0394[_0x831c('0x1b')][_0x831c('0x1e')]||null:null,'include':_0x7a0394[_0x831c('0x1b')]?_0x7a0394[_0x831c('0x1b')][_0x831c('0x1f')]?_['map'](_0x7a0394[_0x831c('0x1b')][_0x831c('0x1f')],function(_0x468851){return{'model':db[_0x468851[_0x831c('0x20')]],'as':_0x468851['as'],'attributes':_0x468851[_0x831c('0x1e')],'include':_0x468851[_0x831c('0x1f')]?_[_0x831c('0x21')](_0x468851[_0x831c('0x1f')],function(_0x25e5fa){return{'model':db[_0x25e5fa[_0x831c('0x20')]],'as':_0x25e5fa['as'],'attributes':_0x25e5fa[_0x831c('0x1e')],'include':_0x25e5fa[_0x831c('0x1f')]?_['map'](_0x25e5fa[_0x831c('0x1f')],function(_0x2bd8f6){return{'model':db[_0x2bd8f6[_0x831c('0x20')]],'as':_0x2bd8f6['as'],'attributes':_0x2bd8f6[_0x831c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x831c('0xc')](function(_0x14ee5e){logger[_0x831c('0xd')]('ShowSquareOdbc',_0x7a0394);logger[_0x831c('0x10')](_0x831c('0x18'),_0x7a0394,JSON[_0x831c('0x12')](_0x14ee5e));_0x372f30(_0x14ee5e);})[_0x831c('0x17')](function(_0x3d9846){logger[_0x831c('0x13')](_0x831c('0x18'),_0x3d9846['message'],_0x7a0394);_0x4196c6(_0x16dbe8[_0x831c('0x13')](0x1f4,_0x3d9846[_0x831c('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index d640e03..314ab47 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 _0xf1d5=['../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','show','/:id/users','post','create','addUsers','update','delete','destroy','removeUsers','exports','util','path','connect-timeout','Router'];(function(_0x451539,_0x4ddef2){var _0x290fd9=function(_0x14a9b7){while(--_0x14a9b7){_0x451539['push'](_0x451539['shift']());}};_0x290fd9(++_0x4ddef2);}(_0xf1d5,0x104));var _0x5f1d=function(_0x132cce,_0x2daaad){_0x132cce=_0x132cce-0x0;var _0x4429b8=_0xf1d5[_0x132cce];return _0x4429b8;};'use strict';var multer=require('multer');var util=require(_0x5f1d('0x0'));var path=require(_0x5f1d('0x1'));var timeout=require(_0x5f1d('0x2'));var express=require('express');var router=express[_0x5f1d('0x3')]();var auth=require(_0x5f1d('0x4'));var interaction=require(_0x5f1d('0x5'));var config=require(_0x5f1d('0x6'));var controller=require(_0x5f1d('0x7'));router[_0x5f1d('0x8')]('/',auth[_0x5f1d('0x9')](),controller[_0x5f1d('0xa')]);router[_0x5f1d('0x8')](_0x5f1d('0xb'),auth['isAuthenticated'](),controller[_0x5f1d('0xc')]);router[_0x5f1d('0x8')](_0x5f1d('0xd'),auth[_0x5f1d('0x9')](),controller['getUsers']);router[_0x5f1d('0xe')]('/',auth[_0x5f1d('0x9')](),controller[_0x5f1d('0xf')]);router[_0x5f1d('0xe')](_0x5f1d('0xd'),auth['isAuthenticated'](),controller[_0x5f1d('0x10')]);router['put'](_0x5f1d('0xb'),auth[_0x5f1d('0x9')](),controller[_0x5f1d('0x11')]);router[_0x5f1d('0x12')]('/:id',auth[_0x5f1d('0x9')](),controller[_0x5f1d('0x13')]);router[_0x5f1d('0x12')](_0x5f1d('0xd'),auth['isAuthenticated'](),controller[_0x5f1d('0x14')]);module[_0x5f1d('0x15')]=router; \ No newline at end of file +var _0xc6a7=['../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','show','/:id/users','getUsers','post','create','addUsers','delete','removeUsers','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x1cc130,_0x2b5c31){var _0x1939d9=function(_0x4bf422){while(--_0x4bf422){_0x1cc130['push'](_0x1cc130['shift']());}};_0x1939d9(++_0x2b5c31);}(_0xc6a7,0x8d));var _0x7c6a=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0xc6a7[_0x56916d];return _0x2b7f1f;};'use strict';var multer=require(_0x7c6a('0x0'));var util=require('util');var path=require(_0x7c6a('0x1'));var timeout=require(_0x7c6a('0x2'));var express=require(_0x7c6a('0x3'));var router=express[_0x7c6a('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x7c6a('0x5'));var config=require(_0x7c6a('0x6'));var controller=require(_0x7c6a('0x7'));router[_0x7c6a('0x8')]('/',auth[_0x7c6a('0x9')](),controller[_0x7c6a('0xa')]);router['get'](_0x7c6a('0xb'),auth[_0x7c6a('0x9')](),controller[_0x7c6a('0xc')]);router['get'](_0x7c6a('0xd'),auth[_0x7c6a('0x9')](),controller[_0x7c6a('0xe')]);router[_0x7c6a('0xf')]('/',auth[_0x7c6a('0x9')](),controller[_0x7c6a('0x10')]);router[_0x7c6a('0xf')](_0x7c6a('0xd'),auth[_0x7c6a('0x9')](),controller[_0x7c6a('0x11')]);router['put'](_0x7c6a('0xb'),auth[_0x7c6a('0x9')](),controller['update']);router[_0x7c6a('0x12')](_0x7c6a('0xb'),auth[_0x7c6a('0x9')](),controller['destroy']);router[_0x7c6a('0x12')](_0x7c6a('0xd'),auth[_0x7c6a('0x9')](),controller[_0x7c6a('0x13')]);module[_0x7c6a('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 047bf36..78320d5 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 _0x16ce=['production','exports','STRING','name','TEXT','BLOB','getDataValue','toString','utf8','long'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x16ce,0xfb));var _0xe16c=function(_0x2390a8,_0x2c9abe){_0x2390a8=_0x2390a8-0x0;var _0xaff1e8=_0x16ce[_0x2390a8];return _0xaff1e8;};'use strict';var Sequelize=require('sequelize');module[_0xe16c('0x0')]={'name':{'type':Sequelize[_0xe16c('0x1')],'unique':_0xe16c('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xe16c('0x1')]},'notes':{'type':Sequelize[_0xe16c('0x3')]},'preproduction':{'type':Sequelize[_0xe16c('0x4')]('long'),'get':function(){if(this['getDataValue']('preproduction')){return this[_0xe16c('0x5')]('preproduction')[_0xe16c('0x6')](_0xe16c('0x7'));}}},'production':{'type':Sequelize[_0xe16c('0x4')](_0xe16c('0x8')),'get':function(){if(this[_0xe16c('0x5')](_0xe16c('0x9'))){return this[_0xe16c('0x5')](_0xe16c('0x9'))['toString'](_0xe16c('0x7'));}}}}; \ No newline at end of file +var _0xee55=['utf8','production','sequelize','STRING','BLOB','long','preproduction','getDataValue','toString'];(function(_0xd94fb3,_0x3ec566){var _0xd35537=function(_0x54f847){while(--_0x54f847){_0xd94fb3['push'](_0xd94fb3['shift']());}};_0xd35537(++_0x3ec566);}(_0xee55,0x1a0));var _0x5ee5=function(_0x236c89,_0xd76ba9){_0x236c89=_0x236c89-0x0;var _0x3b2a15=_0xee55[_0x236c89];return _0x3b2a15;};'use strict';var Sequelize=require(_0x5ee5('0x0'));module['exports']={'name':{'type':Sequelize[_0x5ee5('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x5ee5('0x1')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x5ee5('0x2')](_0x5ee5('0x3')),'get':function(){if(this['getDataValue'](_0x5ee5('0x4'))){return this[_0x5ee5('0x5')](_0x5ee5('0x4'))[_0x5ee5('0x6')](_0x5ee5('0x7'));}}},'production':{'type':Sequelize[_0x5ee5('0x2')](_0x5ee5('0x3')),'get':function(){if(this['getDataValue'](_0x5ee5('0x8'))){return this['getDataValue']('production')[_0x5ee5('0x6')]('utf8');}}}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 7660d6f..f8f6514 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 _0xf2cc=['sort','where','filter','merge','map','type','key','includeAll','findAll','rows','catch','show','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SquareProjects','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addUsers','ids','omit','removeUsers','isArray','length','emit','userSquareProject:remove','getUsers','findOne','User','pick','hasOwnProperty','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','path','to-csv','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','socket.io-emitter','./squareProject.socket','register','status','end','count','offset','set','Content-Range','json','apply','update','then','destroy','get','sendStatus','error','stack','name','send','index','SquareProject','rawAttributes','model','keys','filters','intersection','query','attributes','fields','nolimit','limit','order'];(function(_0x1e9390,_0xa18ec2){var _0x5d663e=function(_0x3d6200){while(--_0x3d6200){_0x1e9390['push'](_0x1e9390['shift']());}};_0x5d663e(++_0xa18ec2);}(_0xf2cc,0x13a));var _0xcf2c=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xf2cc[_0x1ac595];return _0x455fff;};'use strict';var pdf=require(_0xcf2c('0x0'));var emlformat=require(_0xcf2c('0x1'));var rimraf=require(_0xcf2c('0x2'));var zipdir=require(_0xcf2c('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcf2c('0x4'));var moment=require('moment');var BPromise=require(_0xcf2c('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xcf2c('0x6'));var sox=require('sox');var csv=require(_0xcf2c('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xcf2c('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcf2c('0x9'));var deskjs=require(_0xcf2c('0xa'));var toCsv=require(_0xcf2c('0x7'));var querystring=require('querystring');var Papa=require(_0xcf2c('0xb'));var Redis=require(_0xcf2c('0xc'));var authService=require(_0xcf2c('0xd'));var qs=require(_0xcf2c('0xe'));var hardwareService=require(_0xcf2c('0xf'));var logger=require(_0xcf2c('0x10'))(_0xcf2c('0x11'));var utils=require(_0xcf2c('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xcf2c('0x13')]=_[_0xcf2c('0x14')](config[_0xcf2c('0x13')],{'host':'localhost','port':0x18eb});var socket=require(_0xcf2c('0x15'))(new Redis(config[_0xcf2c('0x13')]));require(_0xcf2c('0x16'))[_0xcf2c('0x17')](socket);function respondWithStatusCode(_0x2e2fe1,_0x158680){_0x158680=_0x158680||0xcc;return function(_0x2172b1){if(_0x2172b1){return _0x2e2fe1['sendStatus'](_0x158680);}return _0x2e2fe1[_0xcf2c('0x18')](_0x158680)[_0xcf2c('0x19')]();};}function respondWithResult(_0x166be9,_0x10b3a7){_0x10b3a7=_0x10b3a7||0xc8;return function(_0x55dc65){if(_0x55dc65){return _0x166be9[_0xcf2c('0x18')](_0x10b3a7)['json'](_0x55dc65);}};}function respondWithFilteredResult(_0x716cb1,_0x41bad7){return function(_0x38693f){if(_0x38693f){var _0x45f5ea=_0x38693f[_0xcf2c('0x1a')],_0x4e9285=_0x41bad7[_0xcf2c('0x1b')],_0x3c234d=_0x41bad7[_0xcf2c('0x1b')]+_0x41bad7['limit'],_0x492569;if(_0x3c234d>=_0x45f5ea){_0x3c234d=_0x45f5ea;_0x492569=0xc8;}else{_0x492569=0xce;}_0x716cb1[_0xcf2c('0x18')](_0x492569);return _0x716cb1[_0xcf2c('0x1c')](_0xcf2c('0x1d'),_0x4e9285+'-'+_0x3c234d+'/'+_0x45f5ea)[_0xcf2c('0x1e')](_0x38693f);}return null;};}function patchUpdates(_0x1c63bd){return function(_0x2e01b2){try{jsonpatch[_0xcf2c('0x1f')](_0x2e01b2,_0x1c63bd,!![]);}catch(_0x36b5f2){return BPromise['reject'](_0x36b5f2);}return _0x2e01b2['save']();};}function saveUpdates(_0x6b524e,_0x33f9a6){return function(_0x5bbfa2){if(_0x5bbfa2){return _0x5bbfa2[_0xcf2c('0x20')](_0x6b524e)[_0xcf2c('0x21')](function(_0x2d224a){return _0x2d224a;});}return null;};}function removeEntity(_0x24f0db,_0x2ec349){return function(_0x5b1a1e){if(_0x5b1a1e){return _0x5b1a1e[_0xcf2c('0x22')]()[_0xcf2c('0x21')](function(){var _0x2e6417=_0x5b1a1e[_0xcf2c('0x23')]({'plain':!![]});var _0x1c9005='SquareProjects';return db['UserProfileResource'][_0xcf2c('0x22')]({'where':{'type':_0x1c9005,'resourceId':_0x2e6417['id']}})[_0xcf2c('0x21')](function(){return _0x5b1a1e;});})[_0xcf2c('0x21')](function(){_0x24f0db[_0xcf2c('0x18')](0xcc)[_0xcf2c('0x19')]();});}};}function handleEntityNotFound(_0x4a7e07,_0x5e6250){return function(_0x294bef){if(!_0x294bef){_0x4a7e07[_0xcf2c('0x24')](0x194);}return _0x294bef;};}function handleError(_0x5908c1,_0x572c8e){_0x572c8e=_0x572c8e||0x1f4;return function(_0x33a747){logger[_0xcf2c('0x25')](_0x33a747[_0xcf2c('0x26')]);if(_0x33a747[_0xcf2c('0x27')]){delete _0x33a747[_0xcf2c('0x27')];}_0x5908c1[_0xcf2c('0x18')](_0x572c8e)[_0xcf2c('0x28')](_0x33a747);};}exports[_0xcf2c('0x29')]=function(_0x41a9c5,_0x122fcc){var _0x43a807={},_0x3a844a={},_0x39f743={'count':0x0,'rows':[]};var _0x3245b=db[_0xcf2c('0x2a')][_0xcf2c('0x2b')];_0x3a844a[_0xcf2c('0x2c')]=_[_0xcf2c('0x2d')](_0x3245b);_0x3a844a['query']=_['keys'](_0x41a9c5['query']);_0x3a844a[_0xcf2c('0x2e')]=_[_0xcf2c('0x2f')](_0x3a844a['model'],_0x3a844a[_0xcf2c('0x30')]);_0x43a807[_0xcf2c('0x31')]=_[_0xcf2c('0x2f')](_0x3a844a[_0xcf2c('0x2c')],qs[_0xcf2c('0x32')](_0x41a9c5[_0xcf2c('0x30')][_0xcf2c('0x32')]));_0x43a807[_0xcf2c('0x31')]=_0x43a807[_0xcf2c('0x31')]['length']?_0x43a807[_0xcf2c('0x31')]:_0x3a844a['model'];if(!_0x41a9c5[_0xcf2c('0x30')]['hasOwnProperty'](_0xcf2c('0x33'))){_0x43a807[_0xcf2c('0x34')]=qs['limit'](_0x41a9c5[_0xcf2c('0x30')][_0xcf2c('0x34')]);_0x43a807[_0xcf2c('0x1b')]=qs[_0xcf2c('0x1b')](_0x41a9c5['query'][_0xcf2c('0x1b')]);}_0x43a807[_0xcf2c('0x35')]=qs[_0xcf2c('0x36')](_0x41a9c5[_0xcf2c('0x30')][_0xcf2c('0x36')]);_0x43a807[_0xcf2c('0x37')]=qs['filters'](_['pick'](_0x41a9c5['query'],_0x3a844a[_0xcf2c('0x2e')]));if(_0x41a9c5['query'][_0xcf2c('0x38')]){_0x43a807[_0xcf2c('0x37')]=_[_0xcf2c('0x39')](_0x43a807[_0xcf2c('0x37')],{'$or':_[_0xcf2c('0x3a')](_0x3245b,function(_0xf3a073){if(_0xf3a073[_0xcf2c('0x3b')][_0xcf2c('0x3c')]!=='VIRTUAL'){var _0x69d9d={};_0x69d9d[_0xf3a073['field']]={'$like':'%'+_0x41a9c5[_0xcf2c('0x30')][_0xcf2c('0x38')]+'%'};return _0x69d9d;}})});}_0x43a807=_[_0xcf2c('0x39')]({},_0x43a807,_0x41a9c5['options']);var _0x149e69={'where':_0x43a807[_0xcf2c('0x37')]};return db[_0xcf2c('0x2a')][_0xcf2c('0x1a')](_0x149e69)['then'](function(_0x2721c4){_0x39f743[_0xcf2c('0x1a')]=_0x2721c4;if(_0x41a9c5['query'][_0xcf2c('0x3d')]){_0x43a807['include']=[{'all':!![]}];}return db[_0xcf2c('0x2a')][_0xcf2c('0x3e')](_0x43a807);})['then'](function(_0x1ce7be){_0x39f743[_0xcf2c('0x3f')]=_0x1ce7be;return _0x39f743;})[_0xcf2c('0x21')](respondWithFilteredResult(_0x122fcc,_0x43a807))[_0xcf2c('0x40')](handleError(_0x122fcc,null));};exports[_0xcf2c('0x41')]=function(_0x141b1c,_0x3afad3){var _0x3ed7e8={'raw':![],'where':{'id':_0x141b1c['params']['id']}},_0x5552ee={};_0x5552ee['model']=_[_0xcf2c('0x2d')](db[_0xcf2c('0x2a')]['rawAttributes']);_0x5552ee[_0xcf2c('0x30')]=_[_0xcf2c('0x2d')](_0x141b1c[_0xcf2c('0x30')]);_0x5552ee[_0xcf2c('0x2e')]=_[_0xcf2c('0x2f')](_0x5552ee[_0xcf2c('0x2c')],_0x5552ee['query']);_0x3ed7e8['attributes']=_['intersection'](_0x5552ee[_0xcf2c('0x2c')],qs[_0xcf2c('0x32')](_0x141b1c[_0xcf2c('0x30')][_0xcf2c('0x32')]));_0x3ed7e8['attributes']=_0x3ed7e8[_0xcf2c('0x31')]['length']?_0x3ed7e8[_0xcf2c('0x31')]:_0x5552ee['model'];if(_0x141b1c[_0xcf2c('0x30')]['includeAll']){_0x3ed7e8[_0xcf2c('0x42')]=[{'all':!![]}];}_0x3ed7e8=_[_0xcf2c('0x39')]({},_0x3ed7e8,_0x141b1c[_0xcf2c('0x43')]);return db[_0xcf2c('0x2a')][_0xcf2c('0x44')](_0x3ed7e8)[_0xcf2c('0x21')](handleEntityNotFound(_0x3afad3,null))[_0xcf2c('0x21')](respondWithResult(_0x3afad3,null))[_0xcf2c('0x40')](handleError(_0x3afad3,null));};exports[_0xcf2c('0x45')]=function(_0x1b7d91,_0x178ca6){return db[_0xcf2c('0x2a')][_0xcf2c('0x45')](_0x1b7d91[_0xcf2c('0x46')],{})[_0xcf2c('0x21')](function(_0x1fd1ef){var _0x4fad55=_0x1b7d91[_0xcf2c('0x47')][_0xcf2c('0x23')]({'plain':!![]});if(!_0x4fad55)throw new Error(_0xcf2c('0x48'));if(_0x4fad55[_0xcf2c('0x49')]==='user'){var _0x229a91=_0x1fd1ef[_0xcf2c('0x23')]({'plain':!![]});var _0x26e681=_0xcf2c('0x4a');return db[_0xcf2c('0x4b')][_0xcf2c('0x44')]({'where':{'name':_0x26e681,'userProfileId':_0x4fad55['userProfileId']},'raw':!![]})[_0xcf2c('0x21')](function(_0x4bc4d4){if(_0x4bc4d4&&_0x4bc4d4['autoAssociation']===0x0){return db[_0xcf2c('0x4c')][_0xcf2c('0x45')]({'name':_0x229a91['name'],'resourceId':_0x229a91['id'],'type':_0x4bc4d4['name'],'sectionId':_0x4bc4d4['id']},{})[_0xcf2c('0x21')](function(){return _0x1fd1ef;});}else{return _0x1fd1ef;}})[_0xcf2c('0x40')](function(_0x17e009){logger[_0xcf2c('0x25')](_0xcf2c('0x4d'),_0x17e009);throw _0x17e009;});}return _0x1fd1ef;})[_0xcf2c('0x21')](respondWithResult(_0x178ca6,0xc9))['catch'](handleError(_0x178ca6,null));};exports[_0xcf2c('0x20')]=function(_0x5ecf39,_0x2ea699){if(_0x5ecf39[_0xcf2c('0x46')]['id']){delete _0x5ecf39[_0xcf2c('0x46')]['id'];}return db[_0xcf2c('0x2a')][_0xcf2c('0x44')]({'where':{'id':_0x5ecf39[_0xcf2c('0x4e')]['id']}})[_0xcf2c('0x21')](handleEntityNotFound(_0x2ea699,null))[_0xcf2c('0x21')](saveUpdates(_0x5ecf39['body'],null))[_0xcf2c('0x21')](respondWithResult(_0x2ea699,null))['catch'](handleError(_0x2ea699,null));};exports[_0xcf2c('0x22')]=function(_0x1d0286,_0x3d0762){return db[_0xcf2c('0x2a')][_0xcf2c('0x44')]({'where':{'id':_0x1d0286['params']['id']}})[_0xcf2c('0x21')](handleEntityNotFound(_0x3d0762,null))[_0xcf2c('0x21')](removeEntity(_0x3d0762,null))['catch'](handleError(_0x3d0762,null));};exports['addUsers']=function(_0x510bd4,_0x390ab5,_0x5254d6){return db[_0xcf2c('0x2a')]['find']({'where':{'id':_0x510bd4['params']['id']}})[_0xcf2c('0x21')](handleEntityNotFound(_0x390ab5,null))[_0xcf2c('0x21')](function(_0x24ad04){if(_0x24ad04){return _0x24ad04[_0xcf2c('0x4f')](_0x510bd4['body'][_0xcf2c('0x50')],_[_0xcf2c('0x51')](_0x510bd4[_0xcf2c('0x46')],[_0xcf2c('0x50'),'id'])||{});}})[_0xcf2c('0x21')](respondWithResult(_0x390ab5,null))[_0xcf2c('0x40')](handleError(_0x390ab5,null));};exports[_0xcf2c('0x52')]=function(_0x3b70f6,_0x5dcea8,_0x19f730){return db[_0xcf2c('0x2a')][_0xcf2c('0x44')]({'where':{'id':_0x3b70f6[_0xcf2c('0x4e')]['id']}})[_0xcf2c('0x21')](handleEntityNotFound(_0x5dcea8,null))[_0xcf2c('0x21')](function(_0x27b2c7){if(_0x27b2c7){return _0x27b2c7[_0xcf2c('0x52')](_0x3b70f6[_0xcf2c('0x30')]['ids'])[_0xcf2c('0x21')](function(){if(_[_0xcf2c('0x53')](_0x3b70f6[_0xcf2c('0x30')][_0xcf2c('0x50')])){for(var _0x320005=0x0;_0x320005<_0x3b70f6[_0xcf2c('0x30')][_0xcf2c('0x50')][_0xcf2c('0x54')];_0x320005+=0x1){socket[_0xcf2c('0x55')]('userSquareProject:remove',{'UserId':Number(_0x3b70f6[_0xcf2c('0x30')][_0xcf2c('0x50')][_0x320005]),'SquareProjectId':Number(_0x3b70f6[_0xcf2c('0x4e')]['id'])});}}else{socket[_0xcf2c('0x55')](_0xcf2c('0x56'),{'UserId':Number(_0x3b70f6[_0xcf2c('0x30')]['ids']),'SquareProjectId':Number(_0x3b70f6[_0xcf2c('0x4e')]['id'])});}});}})[_0xcf2c('0x21')](respondWithStatusCode(_0x5dcea8,null))[_0xcf2c('0x40')](handleError(_0x5dcea8,null));};exports[_0xcf2c('0x57')]=function(_0x110315,_0x31e5f7,_0x3dccb5){var _0x103b49={};var _0x1e8bcf={};var _0x48fce0;var _0x2ddfca;return db[_0xcf2c('0x2a')][_0xcf2c('0x58')]({'where':{'id':_0x110315[_0xcf2c('0x4e')]['id']}})[_0xcf2c('0x21')](handleEntityNotFound(_0x31e5f7,null))[_0xcf2c('0x21')](function(_0xb43041){if(_0xb43041){_0x48fce0=_0xb43041;_0x1e8bcf[_0xcf2c('0x2c')]=_[_0xcf2c('0x2d')](db[_0xcf2c('0x59')]['rawAttributes']);_0x1e8bcf[_0xcf2c('0x30')]=_[_0xcf2c('0x2d')](_0x110315[_0xcf2c('0x30')]);_0x1e8bcf[_0xcf2c('0x2e')]=_[_0xcf2c('0x2f')](_0x1e8bcf[_0xcf2c('0x2c')],_0x1e8bcf[_0xcf2c('0x30')]);_0x103b49[_0xcf2c('0x31')]=_[_0xcf2c('0x2f')](_0x1e8bcf[_0xcf2c('0x2c')],qs[_0xcf2c('0x32')](_0x110315[_0xcf2c('0x30')][_0xcf2c('0x32')]));_0x103b49[_0xcf2c('0x31')]=_0x103b49[_0xcf2c('0x31')]['length']?_0x103b49['attributes']:_0x1e8bcf[_0xcf2c('0x2c')];_0x103b49['order']=qs[_0xcf2c('0x36')](_0x110315['query']['sort']);_0x103b49[_0xcf2c('0x37')]=qs[_0xcf2c('0x2e')](_[_0xcf2c('0x5a')](_0x110315['query'],_0x1e8bcf[_0xcf2c('0x2e')]));if(_0x110315[_0xcf2c('0x30')]['filter']){_0x103b49[_0xcf2c('0x37')]=_[_0xcf2c('0x39')](_0x103b49[_0xcf2c('0x37')],{'$or':_[_0xcf2c('0x3a')](_0x103b49[_0xcf2c('0x31')],function(_0x282ee2){var _0x37a3d2={};_0x37a3d2[_0x282ee2]={'$like':'%'+_0x110315['query'][_0xcf2c('0x38')]+'%'};return _0x37a3d2;})});}_0x103b49=_[_0xcf2c('0x39')]({},_0x103b49,_0x110315[_0xcf2c('0x43')]);return _0x48fce0['getUsers'](_0x103b49);}})[_0xcf2c('0x21')](function(_0x2c9126){if(_0x2c9126){_0x2ddfca=_0x2c9126[_0xcf2c('0x54')];if(!_0x110315[_0xcf2c('0x30')][_0xcf2c('0x5b')](_0xcf2c('0x33'))){_0x103b49[_0xcf2c('0x34')]=qs[_0xcf2c('0x34')](_0x110315[_0xcf2c('0x30')]['limit']);_0x103b49[_0xcf2c('0x1b')]=qs[_0xcf2c('0x1b')](_0x110315[_0xcf2c('0x30')][_0xcf2c('0x1b')]);}return _0x48fce0['getUsers'](_0x103b49);}})[_0xcf2c('0x21')](function(_0x5243f1){if(_0x5243f1){return _0x5243f1?{'count':_0x2ddfca,'rows':_0x5243f1}:null;}})[_0xcf2c('0x21')](respondWithResult(_0x31e5f7,null))[_0xcf2c('0x40')](handleError(_0x31e5f7,null));}; \ No newline at end of file +var _0x3515=['type','key','field','count','includeAll','include','rows','catch','show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SquareProjects','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','addUsers','ids','removeUsers','emit','userSquareProject:remove','findOne','User','pick','filter','options','getUsers','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/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','limit','set','Content-Range','save','update','then','get','name','send','index','SquareProject','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','merge','map'];(function(_0x385039,_0x14fff6){var _0x433c3f=function(_0x3a7805){while(--_0x3a7805){_0x385039['push'](_0x385039['shift']());}};_0x433c3f(++_0x14fff6);}(_0x3515,0x14f));var _0x5351=function(_0x12bfb2,_0x4e0c00){_0x12bfb2=_0x12bfb2-0x0;var _0x13d174=_0x3515[_0x12bfb2];return _0x13d174;};'use strict';var pdf=require(_0x5351('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5351('0x1'));var zipdir=require(_0x5351('0x2'));var jsonpatch=require(_0x5351('0x3'));var rp=require(_0x5351('0x4'));var moment=require(_0x5351('0x5'));var BPromise=require(_0x5351('0x6'));var Mustache=require(_0x5351('0x7'));var util=require(_0x5351('0x8'));var path=require(_0x5351('0x9'));var sox=require(_0x5351('0xa'));var csv=require(_0x5351('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5351('0xc'));var squel=require(_0x5351('0xd'));var crypto=require(_0x5351('0xe'));var jsforce=require(_0x5351('0xf'));var deskjs=require(_0x5351('0x10'));var toCsv=require(_0x5351('0xb'));var querystring=require(_0x5351('0x11'));var Papa=require(_0x5351('0x12'));var Redis=require(_0x5351('0x13'));var authService=require(_0x5351('0x14'));var qs=require(_0x5351('0x15'));var hardwareService=require(_0x5351('0x16'));var logger=require(_0x5351('0x17'))(_0x5351('0x18'));var utils=require(_0x5351('0x19'));var config=require(_0x5351('0x1a'));var db=require(_0x5351('0x1b'))['db'];config[_0x5351('0x1c')]=_[_0x5351('0x1d')](config['redis'],{'host':_0x5351('0x1e'),'port':0x18eb});var socket=require(_0x5351('0x1f'))(new Redis(config[_0x5351('0x1c')]));require('./squareProject.socket')[_0x5351('0x20')](socket);function respondWithStatusCode(_0x1dab9b,_0x571797){_0x571797=_0x571797||0xcc;return function(_0x15038f){if(_0x15038f){return _0x1dab9b[_0x5351('0x21')](_0x571797);}return _0x1dab9b[_0x5351('0x22')](_0x571797)[_0x5351('0x23')]();};}function respondWithResult(_0x318fed,_0x349f7d){_0x349f7d=_0x349f7d||0xc8;return function(_0x500610){if(_0x500610){return _0x318fed[_0x5351('0x22')](_0x349f7d)[_0x5351('0x24')](_0x500610);}};}function respondWithFilteredResult(_0x404d1,_0x3b453b){return function(_0x256e5a){if(_0x256e5a){var _0x139d1e=_0x256e5a['count'],_0x11cb83=_0x3b453b['offset'],_0x4c664c=_0x3b453b['offset']+_0x3b453b[_0x5351('0x25')],_0x1b7bed;if(_0x4c664c>=_0x139d1e){_0x4c664c=_0x139d1e;_0x1b7bed=0xc8;}else{_0x1b7bed=0xce;}_0x404d1[_0x5351('0x22')](_0x1b7bed);return _0x404d1[_0x5351('0x26')](_0x5351('0x27'),_0x11cb83+'-'+_0x4c664c+'/'+_0x139d1e)[_0x5351('0x24')](_0x256e5a);}return null;};}function patchUpdates(_0x10b9f7){return function(_0x2d1b99){try{jsonpatch['apply'](_0x2d1b99,_0x10b9f7,!![]);}catch(_0x6fc613){return BPromise['reject'](_0x6fc613);}return _0x2d1b99[_0x5351('0x28')]();};}function saveUpdates(_0x477380,_0x12ad44){return function(_0x2d6df6){if(_0x2d6df6){return _0x2d6df6[_0x5351('0x29')](_0x477380)[_0x5351('0x2a')](function(_0x10973d){return _0x10973d;});}return null;};}function removeEntity(_0x42f5b9,_0x2c7877){return function(_0x4ecbca){if(_0x4ecbca){return _0x4ecbca['destroy']()[_0x5351('0x2a')](function(){var _0x143300=_0x4ecbca[_0x5351('0x2b')]({'plain':!![]});var _0x326392='SquareProjects';return db['UserProfileResource']['destroy']({'where':{'type':_0x326392,'resourceId':_0x143300['id']}})[_0x5351('0x2a')](function(){return _0x4ecbca;});})[_0x5351('0x2a')](function(){_0x42f5b9[_0x5351('0x22')](0xcc)[_0x5351('0x23')]();});}};}function handleEntityNotFound(_0x5bb8dd,_0x48b485){return function(_0x4df476){if(!_0x4df476){_0x5bb8dd[_0x5351('0x21')](0x194);}return _0x4df476;};}function handleError(_0x75406d,_0x4c9718){_0x4c9718=_0x4c9718||0x1f4;return function(_0x330f37){logger['error'](_0x330f37['stack']);if(_0x330f37[_0x5351('0x2c')]){delete _0x330f37[_0x5351('0x2c')];}_0x75406d[_0x5351('0x22')](_0x4c9718)[_0x5351('0x2d')](_0x330f37);};}exports[_0x5351('0x2e')]=function(_0x419bdc,_0x3f6790){var _0x3f3bd3={},_0x179df7={},_0x284f22={'count':0x0,'rows':[]};var _0x2fe4f8=db[_0x5351('0x2f')][_0x5351('0x30')];_0x179df7[_0x5351('0x31')]=_[_0x5351('0x32')](_0x2fe4f8);_0x179df7[_0x5351('0x33')]=_[_0x5351('0x32')](_0x419bdc['query']);_0x179df7[_0x5351('0x34')]=_[_0x5351('0x35')](_0x179df7[_0x5351('0x31')],_0x179df7['query']);_0x3f3bd3[_0x5351('0x36')]=_[_0x5351('0x35')](_0x179df7[_0x5351('0x31')],qs[_0x5351('0x37')](_0x419bdc[_0x5351('0x33')][_0x5351('0x37')]));_0x3f3bd3[_0x5351('0x36')]=_0x3f3bd3[_0x5351('0x36')][_0x5351('0x38')]?_0x3f3bd3['attributes']:_0x179df7[_0x5351('0x31')];if(!_0x419bdc[_0x5351('0x33')][_0x5351('0x39')](_0x5351('0x3a'))){_0x3f3bd3[_0x5351('0x25')]=qs[_0x5351('0x25')](_0x419bdc[_0x5351('0x33')][_0x5351('0x25')]);_0x3f3bd3[_0x5351('0x3b')]=qs['offset'](_0x419bdc['query'][_0x5351('0x3b')]);}_0x3f3bd3[_0x5351('0x3c')]=qs[_0x5351('0x3d')](_0x419bdc[_0x5351('0x33')][_0x5351('0x3d')]);_0x3f3bd3[_0x5351('0x3e')]=qs[_0x5351('0x34')](_['pick'](_0x419bdc['query'],_0x179df7[_0x5351('0x34')]));if(_0x419bdc[_0x5351('0x33')]['filter']){_0x3f3bd3['where']=_[_0x5351('0x3f')](_0x3f3bd3[_0x5351('0x3e')],{'$or':_[_0x5351('0x40')](_0x2fe4f8,function(_0x3dba63){if(_0x3dba63[_0x5351('0x41')][_0x5351('0x42')]!=='VIRTUAL'){var _0x2fcb06={};_0x2fcb06[_0x3dba63[_0x5351('0x43')]]={'$like':'%'+_0x419bdc['query']['filter']+'%'};return _0x2fcb06;}})});}_0x3f3bd3=_['merge']({},_0x3f3bd3,_0x419bdc['options']);var _0x350a0c={'where':_0x3f3bd3['where']};return db[_0x5351('0x2f')][_0x5351('0x44')](_0x350a0c)[_0x5351('0x2a')](function(_0x26db69){_0x284f22[_0x5351('0x44')]=_0x26db69;if(_0x419bdc[_0x5351('0x33')][_0x5351('0x45')]){_0x3f3bd3[_0x5351('0x46')]=[{'all':!![]}];}return db[_0x5351('0x2f')]['findAll'](_0x3f3bd3);})[_0x5351('0x2a')](function(_0x55363b){_0x284f22[_0x5351('0x47')]=_0x55363b;return _0x284f22;})[_0x5351('0x2a')](respondWithFilteredResult(_0x3f6790,_0x3f3bd3))[_0x5351('0x48')](handleError(_0x3f6790,null));};exports[_0x5351('0x49')]=function(_0x259b8e,_0x10eeca){var _0x59f453={'raw':![],'where':{'id':_0x259b8e[_0x5351('0x4a')]['id']}},_0x22a778={};_0x22a778['model']=_['keys'](db[_0x5351('0x2f')]['rawAttributes']);_0x22a778['query']=_[_0x5351('0x32')](_0x259b8e[_0x5351('0x33')]);_0x22a778[_0x5351('0x34')]=_[_0x5351('0x35')](_0x22a778[_0x5351('0x31')],_0x22a778[_0x5351('0x33')]);_0x59f453[_0x5351('0x36')]=_[_0x5351('0x35')](_0x22a778[_0x5351('0x31')],qs[_0x5351('0x37')](_0x259b8e[_0x5351('0x33')][_0x5351('0x37')]));_0x59f453[_0x5351('0x36')]=_0x59f453['attributes'][_0x5351('0x38')]?_0x59f453['attributes']:_0x22a778[_0x5351('0x31')];if(_0x259b8e['query'][_0x5351('0x45')]){_0x59f453[_0x5351('0x46')]=[{'all':!![]}];}_0x59f453=_[_0x5351('0x3f')]({},_0x59f453,_0x259b8e['options']);return db[_0x5351('0x2f')]['find'](_0x59f453)[_0x5351('0x2a')](handleEntityNotFound(_0x10eeca,null))[_0x5351('0x2a')](respondWithResult(_0x10eeca,null))['catch'](handleError(_0x10eeca,null));};exports[_0x5351('0x4b')]=function(_0x1535ed,_0x4f8798){return db[_0x5351('0x2f')][_0x5351('0x4b')](_0x1535ed['body'],{})[_0x5351('0x2a')](function(_0x29fe71){var _0x3c7cb9=_0x1535ed[_0x5351('0x4c')][_0x5351('0x2b')]({'plain':!![]});if(!_0x3c7cb9)throw new Error(_0x5351('0x4d'));if(_0x3c7cb9[_0x5351('0x4e')]===_0x5351('0x4c')){var _0x3ade83=_0x29fe71[_0x5351('0x2b')]({'plain':!![]});var _0x33ac3a=_0x5351('0x4f');return db[_0x5351('0x50')][_0x5351('0x51')]({'where':{'name':_0x33ac3a,'userProfileId':_0x3c7cb9[_0x5351('0x52')]},'raw':!![]})['then'](function(_0x48dbfe){if(_0x48dbfe&&_0x48dbfe[_0x5351('0x53')]===0x0){return db[_0x5351('0x54')][_0x5351('0x4b')]({'name':_0x3ade83[_0x5351('0x2c')],'resourceId':_0x3ade83['id'],'type':_0x48dbfe['name'],'sectionId':_0x48dbfe['id']},{})[_0x5351('0x2a')](function(){return _0x29fe71;});}else{return _0x29fe71;}})['catch'](function(_0x93d2a9){logger[_0x5351('0x55')](_0x5351('0x56'),_0x93d2a9);throw _0x93d2a9;});}return _0x29fe71;})[_0x5351('0x2a')](respondWithResult(_0x4f8798,0xc9))[_0x5351('0x48')](handleError(_0x4f8798,null));};exports['update']=function(_0xc38edc,_0x404a72){if(_0xc38edc[_0x5351('0x57')]['id']){delete _0xc38edc[_0x5351('0x57')]['id'];}return db[_0x5351('0x2f')][_0x5351('0x51')]({'where':{'id':_0xc38edc[_0x5351('0x4a')]['id']}})[_0x5351('0x2a')](handleEntityNotFound(_0x404a72,null))['then'](saveUpdates(_0xc38edc['body'],null))[_0x5351('0x2a')](respondWithResult(_0x404a72,null))[_0x5351('0x48')](handleError(_0x404a72,null));};exports[_0x5351('0x58')]=function(_0x397e31,_0x5802b1){return db[_0x5351('0x2f')][_0x5351('0x51')]({'where':{'id':_0x397e31['params']['id']}})[_0x5351('0x2a')](handleEntityNotFound(_0x5802b1,null))[_0x5351('0x2a')](removeEntity(_0x5802b1,null))['catch'](handleError(_0x5802b1,null));};exports[_0x5351('0x59')]=function(_0x115ea8,_0x3d57e4,_0x13e7d2){return db[_0x5351('0x2f')][_0x5351('0x51')]({'where':{'id':_0x115ea8['params']['id']}})[_0x5351('0x2a')](handleEntityNotFound(_0x3d57e4,null))[_0x5351('0x2a')](function(_0x5b80e1){if(_0x5b80e1){return _0x5b80e1['addUsers'](_0x115ea8[_0x5351('0x57')][_0x5351('0x5a')],_['omit'](_0x115ea8[_0x5351('0x57')],[_0x5351('0x5a'),'id'])||{});}})['then'](respondWithResult(_0x3d57e4,null))[_0x5351('0x48')](handleError(_0x3d57e4,null));};exports[_0x5351('0x5b')]=function(_0x24acec,_0x3533b6,_0x47328b){return db['SquareProject'][_0x5351('0x51')]({'where':{'id':_0x24acec[_0x5351('0x4a')]['id']}})[_0x5351('0x2a')](handleEntityNotFound(_0x3533b6,null))['then'](function(_0x5bb78b){if(_0x5bb78b){return _0x5bb78b[_0x5351('0x5b')](_0x24acec[_0x5351('0x33')][_0x5351('0x5a')])['then'](function(){if(_['isArray'](_0x24acec['query']['ids'])){for(var _0x43fbc8=0x0;_0x43fbc8<_0x24acec[_0x5351('0x33')]['ids'][_0x5351('0x38')];_0x43fbc8+=0x1){socket[_0x5351('0x5c')](_0x5351('0x5d'),{'UserId':Number(_0x24acec[_0x5351('0x33')]['ids'][_0x43fbc8]),'SquareProjectId':Number(_0x24acec[_0x5351('0x4a')]['id'])});}}else{socket[_0x5351('0x5c')](_0x5351('0x5d'),{'UserId':Number(_0x24acec['query'][_0x5351('0x5a')]),'SquareProjectId':Number(_0x24acec['params']['id'])});}});}})['then'](respondWithStatusCode(_0x3533b6,null))['catch'](handleError(_0x3533b6,null));};exports['getUsers']=function(_0x107b1a,_0x5b5729,_0x6af45f){var _0x21bcc5={};var _0x4597cd={};var _0x96df88;var _0x1ab499;return db[_0x5351('0x2f')][_0x5351('0x5e')]({'where':{'id':_0x107b1a[_0x5351('0x4a')]['id']}})[_0x5351('0x2a')](handleEntityNotFound(_0x5b5729,null))[_0x5351('0x2a')](function(_0x1bb904){if(_0x1bb904){_0x96df88=_0x1bb904;_0x4597cd[_0x5351('0x31')]=_['keys'](db[_0x5351('0x5f')][_0x5351('0x30')]);_0x4597cd[_0x5351('0x33')]=_['keys'](_0x107b1a[_0x5351('0x33')]);_0x4597cd[_0x5351('0x34')]=_[_0x5351('0x35')](_0x4597cd['model'],_0x4597cd['query']);_0x21bcc5['attributes']=_[_0x5351('0x35')](_0x4597cd[_0x5351('0x31')],qs[_0x5351('0x37')](_0x107b1a[_0x5351('0x33')]['fields']));_0x21bcc5[_0x5351('0x36')]=_0x21bcc5[_0x5351('0x36')]['length']?_0x21bcc5[_0x5351('0x36')]:_0x4597cd['model'];_0x21bcc5[_0x5351('0x3c')]=qs[_0x5351('0x3d')](_0x107b1a[_0x5351('0x33')][_0x5351('0x3d')]);_0x21bcc5['where']=qs[_0x5351('0x34')](_[_0x5351('0x60')](_0x107b1a[_0x5351('0x33')],_0x4597cd['filters']));if(_0x107b1a['query'][_0x5351('0x61')]){_0x21bcc5[_0x5351('0x3e')]=_[_0x5351('0x3f')](_0x21bcc5[_0x5351('0x3e')],{'$or':_[_0x5351('0x40')](_0x21bcc5[_0x5351('0x36')],function(_0x5ec253){var _0x2e10ad={};_0x2e10ad[_0x5ec253]={'$like':'%'+_0x107b1a[_0x5351('0x33')][_0x5351('0x61')]+'%'};return _0x2e10ad;})});}_0x21bcc5=_[_0x5351('0x3f')]({},_0x21bcc5,_0x107b1a[_0x5351('0x62')]);return _0x96df88[_0x5351('0x63')](_0x21bcc5);}})[_0x5351('0x2a')](function(_0x132e6a){if(_0x132e6a){_0x1ab499=_0x132e6a[_0x5351('0x38')];if(!_0x107b1a[_0x5351('0x33')][_0x5351('0x39')](_0x5351('0x3a'))){_0x21bcc5[_0x5351('0x25')]=qs[_0x5351('0x25')](_0x107b1a[_0x5351('0x33')]['limit']);_0x21bcc5[_0x5351('0x3b')]=qs[_0x5351('0x3b')](_0x107b1a[_0x5351('0x33')][_0x5351('0x3b')]);}return _0x96df88[_0x5351('0x63')](_0x21bcc5);}})['then'](function(_0x4fbb09){if(_0x4fbb09){return _0x4fbb09?{'count':_0x1ab499,'rows':_0x4fbb09}:null;}})[_0x5351('0x2a')](respondWithResult(_0x5b5729,null))['catch'](handleError(_0x5b5729,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index a5fb638..16ab01d 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 _0xb890=['exports','events','../../mysqldb','SquareProject','save','update','remove','emit','hasOwnProperty'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xb890,0xc7));var _0x0b89=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb890[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x0b89('0x0'));var SquareProject=require(_0x0b89('0x1'))['db'][_0x0b89('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0b89('0x3'),'afterUpdate':_0x0b89('0x4'),'afterDestroy':_0x0b89('0x5')};function emitEvent(_0x3280d4){return function(_0x12bfd1,_0x4c1daa,_0x27eb03){SquareProjectEvents['emit'](_0x3280d4+':'+_0x12bfd1['id'],_0x12bfd1);SquareProjectEvents[_0x0b89('0x6')](_0x3280d4,_0x12bfd1);_0x27eb03(null);};}for(var e in events){if(events[_0x0b89('0x7')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x0b89('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0x207a=['hasOwnProperty','exports','../../mysqldb','SquareProject','save','update','remove','emit'];(function(_0x559ead,_0x339b0c){var _0x2a1a4b=function(_0x2e2adf){while(--_0x2e2adf){_0x559ead['push'](_0x559ead['shift']());}};_0x2a1a4b(++_0x339b0c);}(_0x207a,0xca));var _0xa207=function(_0x5203f3,_0x231e6d){_0x5203f3=_0x5203f3-0x0;var _0x48296a=_0x207a[_0x5203f3];return _0x48296a;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0xa207('0x0'))['db'][_0xa207('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa207('0x2'),'afterUpdate':_0xa207('0x3'),'afterDestroy':_0xa207('0x4')};function emitEvent(_0x226c3e){return function(_0x18a861,_0x4cd597,_0x3efdb1){SquareProjectEvents[_0xa207('0x5')](_0x226c3e+':'+_0x18a861['id'],_0x18a861);SquareProjectEvents[_0xa207('0x5')](_0x226c3e,_0x18a861);_0x3efdb1(null);};}for(var e in events){if(events[_0xa207('0x6')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0xa207('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 3b89591..cfd8a41 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 _0x88b2=['./squareProject.attributes','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x40f046,_0x1908a1){var _0x29b1f6=function(_0x71e0a6){while(--_0x71e0a6){_0x40f046['push'](_0x40f046['shift']());}};_0x29b1f6(++_0x1908a1);}(_0x88b2,0x119));var _0x288b=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0x88b2[_0x5037ab];return _0x512adb;};'use strict';var _=require('lodash');var util=require(_0x288b('0x0'));var logger=require(_0x288b('0x1'))('api');var moment=require(_0x288b('0x2'));var BPromise=require(_0x288b('0x3'));var rp=require(_0x288b('0x4'));var fs=require('fs');var path=require(_0x288b('0x5'));var rimraf=require(_0x288b('0x6'));var config=require('../../config/environment');var attributes=require(_0x288b('0x7'));module['exports']=function(_0x20da40,_0x193a9b){return _0x20da40['define']('SquareProject',attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x510b=['api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','SquareProject','square_projects','lodash','util'];(function(_0x3791e8,_0xb12ee5){var _0x30654f=function(_0x5d4a5a){while(--_0x5d4a5a){_0x3791e8['push'](_0x3791e8['shift']());}};_0x30654f(++_0xb12ee5);}(_0x510b,0x1d2));var _0xb510=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x510b[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xb510('0x0'));var util=require(_0xb510('0x1'));var logger=require('../../config/logger')(_0xb510('0x2'));var moment=require(_0xb510('0x3'));var BPromise=require(_0xb510('0x4'));var rp=require(_0xb510('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb510('0x6'));var config=require(_0xb510('0x7'));var attributes=require('./squareProject.attributes');module[_0xb510('0x8')]=function(_0x52cab9,_0x8c294d){return _0x52cab9[_0xb510('0x9')](_0xb510('0xa'),attributes,{'tableName':_0xb510('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 1cb6230..a3a86eb 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(_0x5765a4,_0x5b57b2){var _0x26212c=function(_0x5af20f){while(--_0x5af20f){_0x5765a4['push'](_0x5765a4['shift']());}};_0x26212c(++_0x5b57b2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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(_0x1e6eab,_0x216f5b){var _0x5f5517=function(_0x1acf8b){while(--_0x1acf8b){_0x1e6eab['push'](_0x1e6eab['shift']());}};_0x5f5517(++_0x216f5b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});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 76a1051..813773b 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 _0x3140=['removeListener','register','length','squareProject:','./squareProject.events','save','remove','update','emit'];(function(_0x339535,_0x356073){var _0x3e1863=function(_0x33a782){while(--_0x33a782){_0x339535['push'](_0x339535['shift']());}};_0x3e1863(++_0x356073);}(_0x3140,0xaf));var _0x0314=function(_0x3f8282,_0x11b607){_0x3f8282=_0x3f8282-0x0;var _0x50f918=_0x3140[_0x3f8282];return _0x50f918;};'use strict';var SquareProjectEvents=require(_0x0314('0x0'));var events=[_0x0314('0x1'),_0x0314('0x2'),_0x0314('0x3')];function createListener(_0x4ac557,_0x4cf353){return function(_0x285be5){_0x4cf353[_0x0314('0x4')](_0x4ac557,_0x285be5);};}function removeListener(_0x1c0f66,_0x3e4284){return function(){SquareProjectEvents[_0x0314('0x5')](_0x1c0f66,_0x3e4284);};}exports[_0x0314('0x6')]=function(_0x9e308d){for(var _0xf87d26=0x0,_0x11ee94=events[_0x0314('0x7')];_0xf87d26<_0x11ee94;_0xf87d26++){var _0x176944=events[_0xf87d26];var _0x495b27=createListener(_0x0314('0x8')+_0x176944,_0x9e308d);SquareProjectEvents['on'](_0x176944,_0x495b27);}}; \ No newline at end of file +var _0x2bdb=['squareProject:','./squareProject.events','remove','removeListener','register'];(function(_0x388b47,_0x5cdac5){var _0x4859df=function(_0x466a16){while(--_0x466a16){_0x388b47['push'](_0x388b47['shift']());}};_0x4859df(++_0x5cdac5);}(_0x2bdb,0x105));var _0xb2bd=function(_0x1b3323,_0x3bab58){_0x1b3323=_0x1b3323-0x0;var _0x2b62a6=_0x2bdb[_0x1b3323];return _0x2b62a6;};'use strict';var SquareProjectEvents=require(_0xb2bd('0x0'));var events=['save',_0xb2bd('0x1'),'update'];function createListener(_0x3b40de,_0x1d3ddb){return function(_0xab9a35){_0x1d3ddb['emit'](_0x3b40de,_0xab9a35);};}function removeListener(_0x438ced,_0x2be356){return function(){SquareProjectEvents[_0xb2bd('0x2')](_0x438ced,_0x2be356);};}exports[_0xb2bd('0x3')]=function(_0x461137){for(var _0x2ef40b=0x0,_0x3bff5b=events['length'];_0x2ef40b<_0x3bff5b;_0x2ef40b++){var _0x21462b=events[_0x2ef40b];var _0x4d9d3f=createListener(_0xb2bd('0x4')+_0x21462b,_0x461137);SquareProjectEvents['on'](_0x21462b,_0x4d9d3f);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index b1e8607..7d45d29 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 _0xb76c=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','post','create','put','util','path','connect-timeout'];(function(_0x48cff5,_0x4b55b1){var _0xa99042=function(_0x406ecd){while(--_0x406ecd){_0x48cff5['push'](_0x48cff5['shift']());}};_0xa99042(++_0x4b55b1);}(_0xb76c,0x74));var _0xcb76=function(_0x562f3b,_0x4c65ae){_0x562f3b=_0x562f3b-0x0;var _0x1edd55=_0xb76c[_0x562f3b];return _0x1edd55;};'use strict';var multer=require('multer');var util=require(_0xcb76('0x0'));var path=require(_0xcb76('0x1'));var timeout=require(_0xcb76('0x2'));var express=require(_0xcb76('0x3'));var router=express[_0xcb76('0x4')]();var auth=require(_0xcb76('0x5'));var interaction=require(_0xcb76('0x6'));var config=require(_0xcb76('0x7'));var controller=require('./squareRecording.controller');router[_0xcb76('0x8')]('/',auth[_0xcb76('0x9')](),controller[_0xcb76('0xa')]);router[_0xcb76('0x8')](_0xcb76('0xb'),auth[_0xcb76('0x9')](),controller[_0xcb76('0xc')]);router[_0xcb76('0x8')](_0xcb76('0xd'),auth[_0xcb76('0x9')](),controller['download']);router[_0xcb76('0xe')]('/',auth[_0xcb76('0x9')](),controller[_0xcb76('0xf')]);router[_0xcb76('0x10')]('/:id',auth[_0xcb76('0x9')](),controller['update']);router['delete']('/:id',auth[_0xcb76('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd1e4=['isAuthenticated','index','get','/:id','show','/:id/download','post','put','update','delete','multer','path','connect-timeout','express','Router','../../config/environment','./squareRecording.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd1e4,0xc5));var _0x4d1e=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xd1e4[_0x46e363];return _0x3fb059;};'use strict';var multer=require(_0x4d1e('0x0'));var util=require('util');var path=require(_0x4d1e('0x1'));var timeout=require(_0x4d1e('0x2'));var express=require(_0x4d1e('0x3'));var router=express[_0x4d1e('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4d1e('0x5'));var controller=require(_0x4d1e('0x6'));router['get']('/',auth[_0x4d1e('0x7')](),controller[_0x4d1e('0x8')]);router[_0x4d1e('0x9')](_0x4d1e('0xa'),auth[_0x4d1e('0x7')](),controller[_0x4d1e('0xb')]);router[_0x4d1e('0x9')](_0x4d1e('0xc'),auth[_0x4d1e('0x7')](),controller['download']);router[_0x4d1e('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4d1e('0xe')](_0x4d1e('0xa'),auth[_0x4d1e('0x7')](),controller[_0x4d1e('0xf')]);router[_0x4d1e('0x10')](_0x4d1e('0xa'),auth[_0x4d1e('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 102b109..fb95519 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 _0x0ebf=['sequelize','exports','STRING'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x0ebf,0x81));var _0xf0eb=function(_0x95411e,_0x38b4c3){_0x95411e=_0x95411e-0x0;var _0x2c8718=_0x0ebf[_0x95411e];return _0x2c8718;};'use strict';var Sequelize=require(_0xf0eb('0x0'));module[_0xf0eb('0x1')]={'uniqueid':{'type':Sequelize[_0xf0eb('0x2')]},'callerid':{'type':Sequelize[_0xf0eb('0x2')]},'calleridname':{'type':Sequelize[_0xf0eb('0x2')]},'context':{'type':Sequelize[_0xf0eb('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xf0eb('0x2')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0xf0eb('0x2')]},'projectName':{'type':Sequelize[_0xf0eb('0x2')]},'saveName':{'type':Sequelize[_0xf0eb('0x2')]},'filename':{'type':Sequelize[_0xf0eb('0x2')]},'savePath':{'type':Sequelize[_0xf0eb('0x2')]}}; \ No newline at end of file +var _0xcf43=['STRING','exports'];(function(_0x4854d6,_0x2f1264){var _0x3885c0=function(_0x4d564d){while(--_0x4d564d){_0x4854d6['push'](_0x4854d6['shift']());}};_0x3885c0(++_0x2f1264);}(_0xcf43,0x81));var _0x3cf4=function(_0x158987,_0x13dd8a){_0x158987=_0x158987-0x0;var _0x62dbe5=_0xcf43[_0x158987];return _0x62dbe5;};'use strict';var Sequelize=require('sequelize');module[_0x3cf4('0x0')]={'uniqueid':{'type':Sequelize[_0x3cf4('0x1')]},'callerid':{'type':Sequelize[_0x3cf4('0x1')]},'calleridname':{'type':Sequelize[_0x3cf4('0x1')]},'context':{'type':Sequelize[_0x3cf4('0x1')]},'extension':{'type':Sequelize[_0x3cf4('0x1')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x3cf4('0x1')]},'dnid':{'type':Sequelize[_0x3cf4('0x1')]},'projectName':{'type':Sequelize[_0x3cf4('0x1')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x3cf4('0x1')]},'savePath':{'type':Sequelize[_0x3cf4('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 867e895..fe43488 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 _0x777d=['api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','set','Content-Range','reject','then','sendStatus','error','name','send','index','SquareRecording','rawAttributes','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','field','includeAll','include','rows','catch','show','params','length','find','create','body','update','destroy','download','../../components/encryptor','type','uniqueid','savePath','filename','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found','eml-format','rimraf','zip-dir','request-promise','moment','path','to-csv','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x2aa72f,_0x86a346){var _0xc87ae9=function(_0xada91f){while(--_0xada91f){_0x2aa72f['push'](_0x2aa72f['shift']());}};_0xc87ae9(++_0x86a346);}(_0x777d,0xe9));var _0xd777=function(_0x26b9cb,_0x12bc4c){_0x26b9cb=_0x26b9cb-0x0;var _0x3f44e6=_0x777d[_0x26b9cb];return _0x3f44e6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd777('0x0'));var rimraf=require(_0xd777('0x1'));var zipdir=require(_0xd777('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd777('0x3'));var moment=require(_0xd777('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xd777('0x5'));var sox=require('sox');var csv=require(_0xd777('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd777('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd777('0x8'));var toCsv=require(_0xd777('0x6'));var querystring=require(_0xd777('0x9'));var Papa=require(_0xd777('0xa'));var Redis=require(_0xd777('0xb'));var authService=require(_0xd777('0xc'));var qs=require(_0xd777('0xd'));var hardwareService=require(_0xd777('0xe'));var logger=require(_0xd777('0xf'))(_0xd777('0x10'));var utils=require(_0xd777('0x11'));var config=require(_0xd777('0x12'));var db=require(_0xd777('0x13'))['db'];function respondWithStatusCode(_0x5411c5,_0x59dc27){_0x59dc27=_0x59dc27||0xcc;return function(_0x25f574){if(_0x25f574){return _0x5411c5['sendStatus'](_0x59dc27);}return _0x5411c5[_0xd777('0x14')](_0x59dc27)[_0xd777('0x15')]();};}function respondWithResult(_0x11bac0,_0x2f310c){_0x2f310c=_0x2f310c||0xc8;return function(_0x2ac82f){if(_0x2ac82f){return _0x11bac0['status'](_0x2f310c)[_0xd777('0x16')](_0x2ac82f);}};}function respondWithFilteredResult(_0x503630,_0x23b61a){return function(_0x2cd014){if(_0x2cd014){var _0x1e5ecb=_0x2cd014[_0xd777('0x17')],_0x1ef016=_0x23b61a['offset'],_0x25e3f2=_0x23b61a[_0xd777('0x18')]+_0x23b61a['limit'],_0x4f4af5;if(_0x25e3f2>=_0x1e5ecb){_0x25e3f2=_0x1e5ecb;_0x4f4af5=0xc8;}else{_0x4f4af5=0xce;}_0x503630[_0xd777('0x14')](_0x4f4af5);return _0x503630[_0xd777('0x19')](_0xd777('0x1a'),_0x1ef016+'-'+_0x25e3f2+'/'+_0x1e5ecb)[_0xd777('0x16')](_0x2cd014);}return null;};}function patchUpdates(_0x2c6114){return function(_0x201175){try{jsonpatch['apply'](_0x201175,_0x2c6114,!![]);}catch(_0x4d6100){return BPromise[_0xd777('0x1b')](_0x4d6100);}return _0x201175['save']();};}function saveUpdates(_0x179071,_0x560121){return function(_0x58a079){if(_0x58a079){return _0x58a079['update'](_0x179071)[_0xd777('0x1c')](function(_0x4e53ed){return _0x4e53ed;});}return null;};}function removeEntity(_0x4cb07a,_0x49d7fa){return function(_0x48d18c){if(_0x48d18c){return _0x48d18c['destroy']()[_0xd777('0x1c')](function(){_0x4cb07a[_0xd777('0x14')](0xcc)[_0xd777('0x15')]();});}};}function handleEntityNotFound(_0x343405,_0xfebc2f){return function(_0x33c3d4){if(!_0x33c3d4){_0x343405[_0xd777('0x1d')](0x194);}return _0x33c3d4;};}function handleError(_0x87b828,_0x188a3a){_0x188a3a=_0x188a3a||0x1f4;return function(_0x3e637a){logger[_0xd777('0x1e')](_0x3e637a['stack']);if(_0x3e637a[_0xd777('0x1f')]){delete _0x3e637a[_0xd777('0x1f')];}_0x87b828[_0xd777('0x14')](_0x188a3a)[_0xd777('0x20')](_0x3e637a);};}exports[_0xd777('0x21')]=function(_0x5e32de,_0x141e68){var _0x5e752b={},_0x482ad1={},_0x2ff04b={'count':0x0,'rows':[]};var _0x21e38c=db[_0xd777('0x22')][_0xd777('0x23')];_0x482ad1['model']=_[_0xd777('0x24')](_0x21e38c);_0x482ad1[_0xd777('0x25')]=_[_0xd777('0x24')](_0x5e32de[_0xd777('0x25')]);_0x482ad1[_0xd777('0x26')]=_[_0xd777('0x27')](_0x482ad1[_0xd777('0x28')],_0x482ad1[_0xd777('0x25')]);_0x5e752b['attributes']=_[_0xd777('0x27')](_0x482ad1['model'],qs['fields'](_0x5e32de[_0xd777('0x25')][_0xd777('0x29')]));_0x5e752b[_0xd777('0x2a')]=_0x5e752b[_0xd777('0x2a')]['length']?_0x5e752b['attributes']:_0x482ad1[_0xd777('0x28')];if(!_0x5e32de[_0xd777('0x25')][_0xd777('0x2b')](_0xd777('0x2c'))){_0x5e752b[_0xd777('0x2d')]=qs[_0xd777('0x2d')](_0x5e32de['query']['limit']);_0x5e752b[_0xd777('0x18')]=qs[_0xd777('0x18')](_0x5e32de[_0xd777('0x25')][_0xd777('0x18')]);}_0x5e752b[_0xd777('0x2e')]=qs[_0xd777('0x2f')](_0x5e32de[_0xd777('0x25')][_0xd777('0x2f')]);_0x5e752b['where']=qs['filters'](_[_0xd777('0x30')](_0x5e32de['query'],_0x482ad1[_0xd777('0x26')]));if(_0x5e32de[_0xd777('0x25')][_0xd777('0x31')]){_0x5e752b[_0xd777('0x32')]=_['merge'](_0x5e752b[_0xd777('0x32')],{'$or':_['map'](_0x21e38c,function(_0x12b92b){if(_0x12b92b['type']['key']!=='VIRTUAL'){var _0x5591a5={};_0x5591a5[_0x12b92b[_0xd777('0x33')]]={'$like':'%'+_0x5e32de[_0xd777('0x25')][_0xd777('0x31')]+'%'};return _0x5591a5;}})});}_0x5e752b=_['merge']({},_0x5e752b,_0x5e32de['options']);var _0x5be0c0={'where':_0x5e752b[_0xd777('0x32')]};return db[_0xd777('0x22')][_0xd777('0x17')](_0x5be0c0)[_0xd777('0x1c')](function(_0xb8c7fd){_0x2ff04b[_0xd777('0x17')]=_0xb8c7fd;if(_0x5e32de[_0xd777('0x25')][_0xd777('0x34')]){_0x5e752b[_0xd777('0x35')]=[{'all':!![]}];}return db[_0xd777('0x22')]['findAll'](_0x5e752b);})[_0xd777('0x1c')](function(_0x11a5f7){_0x2ff04b[_0xd777('0x36')]=_0x11a5f7;return _0x2ff04b;})[_0xd777('0x1c')](respondWithFilteredResult(_0x141e68,_0x5e752b))[_0xd777('0x37')](handleError(_0x141e68,null));};exports[_0xd777('0x38')]=function(_0x3356c2,_0x1d5822){var _0x3aa0f9={'raw':!![],'where':{'id':_0x3356c2[_0xd777('0x39')]['id']}},_0x34381b={};_0x34381b[_0xd777('0x28')]=_['keys'](db[_0xd777('0x22')]['rawAttributes']);_0x34381b[_0xd777('0x25')]=_[_0xd777('0x24')](_0x3356c2[_0xd777('0x25')]);_0x34381b[_0xd777('0x26')]=_[_0xd777('0x27')](_0x34381b[_0xd777('0x28')],_0x34381b['query']);_0x3aa0f9[_0xd777('0x2a')]=_[_0xd777('0x27')](_0x34381b[_0xd777('0x28')],qs['fields'](_0x3356c2[_0xd777('0x25')][_0xd777('0x29')]));_0x3aa0f9[_0xd777('0x2a')]=_0x3aa0f9[_0xd777('0x2a')][_0xd777('0x3a')]?_0x3aa0f9[_0xd777('0x2a')]:_0x34381b[_0xd777('0x28')];if(_0x3356c2['query'][_0xd777('0x34')]){_0x3aa0f9[_0xd777('0x35')]=[{'all':!![]}];}_0x3aa0f9=_['merge']({},_0x3aa0f9,_0x3356c2['options']);return db[_0xd777('0x22')][_0xd777('0x3b')](_0x3aa0f9)[_0xd777('0x1c')](handleEntityNotFound(_0x1d5822,null))[_0xd777('0x1c')](respondWithResult(_0x1d5822,null))[_0xd777('0x37')](handleError(_0x1d5822,null));};exports[_0xd777('0x3c')]=function(_0xc17811,_0x397ada){return db[_0xd777('0x22')][_0xd777('0x3c')](_0xc17811[_0xd777('0x3d')],{})['then'](respondWithResult(_0x397ada,0xc9))[_0xd777('0x37')](handleError(_0x397ada,null));};exports[_0xd777('0x3e')]=function(_0x56c8e5,_0x478ae2){if(_0x56c8e5['body']['id']){delete _0x56c8e5[_0xd777('0x3d')]['id'];}return db[_0xd777('0x22')][_0xd777('0x3b')]({'where':{'id':_0x56c8e5[_0xd777('0x39')]['id']}})[_0xd777('0x1c')](handleEntityNotFound(_0x478ae2,null))[_0xd777('0x1c')](saveUpdates(_0x56c8e5[_0xd777('0x3d')],null))[_0xd777('0x1c')](respondWithResult(_0x478ae2,null))['catch'](handleError(_0x478ae2,null));};exports[_0xd777('0x3f')]=function(_0x559232,_0x4c059d){return db[_0xd777('0x22')][_0xd777('0x3b')]({'where':{'id':_0x559232['params']['id']}})[_0xd777('0x1c')](handleEntityNotFound(_0x4c059d,null))[_0xd777('0x1c')](removeEntity(_0x4c059d,null))[_0xd777('0x37')](handleError(_0x4c059d,null));};exports[_0xd777('0x40')]=function(_0x47efa6,_0x48740f,_0xe2223a){var _0x58d198=require(_0xd777('0x41'));var _0x24779c=![];var _0xdf8250={};if(_0x47efa6[_0xd777('0x25')][_0xd777('0x42')]&&_0x47efa6['query'][_0xd777('0x42')]===_0xd777('0x43')){_0xdf8250[_0xd777('0x43')]=_0x47efa6['params']['id'];}else{_0xdf8250['id']=_0x47efa6[_0xd777('0x39')]['id'];}return db[_0xd777('0x22')]['find']({'where':_0xdf8250,'attributes':['id',_0xd777('0x44'),_0xd777('0x45')],'raw':!![]})[_0xd777('0x1c')](handleEntityNotFound(_0x48740f,null))['then'](function(_0xbb8cbb){if(_0xbb8cbb){var _0x290ec6=_0xbb8cbb[_0xd777('0x44')];var _0x26b78e=util[_0xd777('0x46')](_0xd777('0x47'),_0x290ec6);if(fs[_0xd777('0x48')](_0x26b78e)){_0x24779c=!![];return _0x58d198[_0xd777('0x49')](_0x26b78e,_0x290ec6,config[_0xd777('0x4a')][_0xd777('0x4b')])[_0xd777('0x1c')](function(){return _0xbb8cbb;});}return _0xbb8cbb;}})[_0xd777('0x1c')](function(_0x3911ba){if(_0x3911ba){var _0x233434=_0x3911ba[_0xd777('0x44')];if(!fs[_0xd777('0x48')](_0x233434)){throw new db[(_0xd777('0x4c'))][(_0xd777('0x4d'))](_0xd777('0x4e'));}if(_0x3911ba[_0xd777('0x45')]){return _0x48740f[_0xd777('0x40')](_0x233434,_0x3911ba[_0xd777('0x45')]+path[_0xd777('0x4f')](_0x233434),function(){if(_0x24779c){fs['unlink'](_0x233434);}});}else{return _0x48740f['download'](_0x233434,function(_0x515a98){if(_0x24779c){fs[_0xd777('0x50')](_0x233434);}});}}})[_0xd777('0x37')](function(_0x271d00){if(_0x271d00[_0xd777('0x51')]===_0xd777('0x4e')){_0x48740f['status'](0x194)[_0xd777('0x20')](_0xd777('0x52'));}else{return handleError(_0x48740f,null);}});}; \ No newline at end of file +var _0x9189=['filename','savePath','existsSync','decryptFile','recording','Sequelize','SquareRecording\x20not\x20found','download','extname','unlink','message','Not\x20found','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','ejs','lodash','squel','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','SquareRecording','keys','query','intersection','model','fields','attributes','length','nolimit','order','sort','filters','pick','filter','where','merge','type','key','VIRTUAL','field','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','../../components/encryptor','uniqueid'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0x9189,0x1b0));var _0x9918=function(_0x281c2e,_0x199d3f){_0x281c2e=_0x281c2e-0x0;var _0x3baba4=_0x9189[_0x281c2e];return _0x3baba4;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x9918('0x0'));var zipdir=require(_0x9918('0x1'));var jsonpatch=require(_0x9918('0x2'));var rp=require(_0x9918('0x3'));var moment=require('moment');var BPromise=require(_0x9918('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9918('0x5'));var sox=require(_0x9918('0x6'));var csv=require('to-csv');var ejs=require(_0x9918('0x7'));var fs=require('fs');var _=require(_0x9918('0x8'));var squel=require(_0x9918('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9918('0xa'));var querystring=require(_0x9918('0xb'));var Papa=require('papaparse');var Redis=require(_0x9918('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x9918('0xd'));var hardwareService=require(_0x9918('0xe'));var logger=require(_0x9918('0xf'))(_0x9918('0x10'));var utils=require(_0x9918('0x11'));var config=require(_0x9918('0x12'));var db=require(_0x9918('0x13'))['db'];function respondWithStatusCode(_0x5175b1,_0x334b55){_0x334b55=_0x334b55||0xcc;return function(_0x1a8f69){if(_0x1a8f69){return _0x5175b1['sendStatus'](_0x334b55);}return _0x5175b1['status'](_0x334b55)[_0x9918('0x14')]();};}function respondWithResult(_0x4b1833,_0x47b734){_0x47b734=_0x47b734||0xc8;return function(_0x15ff69){if(_0x15ff69){return _0x4b1833[_0x9918('0x15')](_0x47b734)['json'](_0x15ff69);}};}function respondWithFilteredResult(_0x2d6c1c,_0x5d05db){return function(_0x131708){if(_0x131708){var _0x27fbe7=_0x131708[_0x9918('0x16')],_0x2a2347=_0x5d05db[_0x9918('0x17')],_0x420db0=_0x5d05db[_0x9918('0x17')]+_0x5d05db[_0x9918('0x18')],_0x90a6cc;if(_0x420db0>=_0x27fbe7){_0x420db0=_0x27fbe7;_0x90a6cc=0xc8;}else{_0x90a6cc=0xce;}_0x2d6c1c[_0x9918('0x15')](_0x90a6cc);return _0x2d6c1c[_0x9918('0x19')](_0x9918('0x1a'),_0x2a2347+'-'+_0x420db0+'/'+_0x27fbe7)[_0x9918('0x1b')](_0x131708);}return null;};}function patchUpdates(_0x132c22){return function(_0x1b6ea2){try{jsonpatch[_0x9918('0x1c')](_0x1b6ea2,_0x132c22,!![]);}catch(_0x2f5b89){return BPromise[_0x9918('0x1d')](_0x2f5b89);}return _0x1b6ea2[_0x9918('0x1e')]();};}function saveUpdates(_0x175f51,_0x42def0){return function(_0x20be15){if(_0x20be15){return _0x20be15[_0x9918('0x1f')](_0x175f51)[_0x9918('0x20')](function(_0x3858f3){return _0x3858f3;});}return null;};}function removeEntity(_0x10e513,_0x5b0fc2){return function(_0x2dc468){if(_0x2dc468){return _0x2dc468[_0x9918('0x21')]()[_0x9918('0x20')](function(){_0x10e513['status'](0xcc)[_0x9918('0x14')]();});}};}function handleEntityNotFound(_0x2367f3,_0x44893d){return function(_0x4562aa){if(!_0x4562aa){_0x2367f3[_0x9918('0x22')](0x194);}return _0x4562aa;};}function handleError(_0x19f897,_0x1bd2cd){_0x1bd2cd=_0x1bd2cd||0x1f4;return function(_0x216cc1){logger[_0x9918('0x23')](_0x216cc1[_0x9918('0x24')]);if(_0x216cc1[_0x9918('0x25')]){delete _0x216cc1[_0x9918('0x25')];}_0x19f897[_0x9918('0x15')](_0x1bd2cd)['send'](_0x216cc1);};}exports[_0x9918('0x26')]=function(_0x345dfb,_0x21c275){var _0x46526f={},_0x1f8549={},_0x4e0c9b={'count':0x0,'rows':[]};var _0x285044=db[_0x9918('0x27')]['rawAttributes'];_0x1f8549['model']=_[_0x9918('0x28')](_0x285044);_0x1f8549['query']=_['keys'](_0x345dfb[_0x9918('0x29')]);_0x1f8549['filters']=_[_0x9918('0x2a')](_0x1f8549[_0x9918('0x2b')],_0x1f8549['query']);_0x46526f['attributes']=_[_0x9918('0x2a')](_0x1f8549[_0x9918('0x2b')],qs[_0x9918('0x2c')](_0x345dfb[_0x9918('0x29')][_0x9918('0x2c')]));_0x46526f['attributes']=_0x46526f[_0x9918('0x2d')][_0x9918('0x2e')]?_0x46526f[_0x9918('0x2d')]:_0x1f8549[_0x9918('0x2b')];if(!_0x345dfb[_0x9918('0x29')]['hasOwnProperty'](_0x9918('0x2f'))){_0x46526f['limit']=qs[_0x9918('0x18')](_0x345dfb['query'][_0x9918('0x18')]);_0x46526f[_0x9918('0x17')]=qs[_0x9918('0x17')](_0x345dfb[_0x9918('0x29')][_0x9918('0x17')]);}_0x46526f[_0x9918('0x30')]=qs[_0x9918('0x31')](_0x345dfb[_0x9918('0x29')][_0x9918('0x31')]);_0x46526f['where']=qs[_0x9918('0x32')](_[_0x9918('0x33')](_0x345dfb[_0x9918('0x29')],_0x1f8549[_0x9918('0x32')]));if(_0x345dfb[_0x9918('0x29')][_0x9918('0x34')]){_0x46526f[_0x9918('0x35')]=_[_0x9918('0x36')](_0x46526f['where'],{'$or':_['map'](_0x285044,function(_0x42e262){if(_0x42e262[_0x9918('0x37')][_0x9918('0x38')]!==_0x9918('0x39')){var _0x58971e={};_0x58971e[_0x42e262[_0x9918('0x3a')]]={'$like':'%'+_0x345dfb['query'][_0x9918('0x34')]+'%'};return _0x58971e;}})});}_0x46526f=_[_0x9918('0x36')]({},_0x46526f,_0x345dfb[_0x9918('0x3b')]);var _0x2f0cd4={'where':_0x46526f['where']};return db['SquareRecording'][_0x9918('0x16')](_0x2f0cd4)[_0x9918('0x20')](function(_0x4c9106){_0x4e0c9b[_0x9918('0x16')]=_0x4c9106;if(_0x345dfb[_0x9918('0x29')][_0x9918('0x3c')]){_0x46526f[_0x9918('0x3d')]=[{'all':!![]}];}return db[_0x9918('0x27')]['findAll'](_0x46526f);})[_0x9918('0x20')](function(_0xd22956){_0x4e0c9b[_0x9918('0x3e')]=_0xd22956;return _0x4e0c9b;})[_0x9918('0x20')](respondWithFilteredResult(_0x21c275,_0x46526f))[_0x9918('0x3f')](handleError(_0x21c275,null));};exports[_0x9918('0x40')]=function(_0x5a7b52,_0x10577f){var _0x1ebb91={'raw':!![],'where':{'id':_0x5a7b52[_0x9918('0x41')]['id']}},_0x373627={};_0x373627['model']=_[_0x9918('0x28')](db[_0x9918('0x27')][_0x9918('0x42')]);_0x373627[_0x9918('0x29')]=_['keys'](_0x5a7b52[_0x9918('0x29')]);_0x373627['filters']=_[_0x9918('0x2a')](_0x373627['model'],_0x373627[_0x9918('0x29')]);_0x1ebb91[_0x9918('0x2d')]=_['intersection'](_0x373627[_0x9918('0x2b')],qs['fields'](_0x5a7b52[_0x9918('0x29')][_0x9918('0x2c')]));_0x1ebb91[_0x9918('0x2d')]=_0x1ebb91[_0x9918('0x2d')][_0x9918('0x2e')]?_0x1ebb91[_0x9918('0x2d')]:_0x373627['model'];if(_0x5a7b52[_0x9918('0x29')][_0x9918('0x3c')]){_0x1ebb91['include']=[{'all':!![]}];}_0x1ebb91=_[_0x9918('0x36')]({},_0x1ebb91,_0x5a7b52[_0x9918('0x3b')]);return db[_0x9918('0x27')][_0x9918('0x43')](_0x1ebb91)[_0x9918('0x20')](handleEntityNotFound(_0x10577f,null))['then'](respondWithResult(_0x10577f,null))[_0x9918('0x3f')](handleError(_0x10577f,null));};exports[_0x9918('0x44')]=function(_0x3d9763,_0x41a952){return db[_0x9918('0x27')][_0x9918('0x44')](_0x3d9763[_0x9918('0x45')],{})[_0x9918('0x20')](respondWithResult(_0x41a952,0xc9))['catch'](handleError(_0x41a952,null));};exports[_0x9918('0x1f')]=function(_0x19044f,_0x570966){if(_0x19044f['body']['id']){delete _0x19044f['body']['id'];}return db[_0x9918('0x27')][_0x9918('0x43')]({'where':{'id':_0x19044f[_0x9918('0x41')]['id']}})['then'](handleEntityNotFound(_0x570966,null))[_0x9918('0x20')](saveUpdates(_0x19044f['body'],null))['then'](respondWithResult(_0x570966,null))[_0x9918('0x3f')](handleError(_0x570966,null));};exports['destroy']=function(_0x5ca79e,_0x7f211a){return db['SquareRecording']['find']({'where':{'id':_0x5ca79e[_0x9918('0x41')]['id']}})[_0x9918('0x20')](handleEntityNotFound(_0x7f211a,null))[_0x9918('0x20')](removeEntity(_0x7f211a,null))['catch'](handleError(_0x7f211a,null));};exports['download']=function(_0x565a58,_0x31ede5,_0x21f758){var _0x20ce19=require(_0x9918('0x46'));var _0x20dd51=![];var _0x6861a3={};if(_0x565a58[_0x9918('0x29')][_0x9918('0x37')]&&_0x565a58[_0x9918('0x29')][_0x9918('0x37')]===_0x9918('0x47')){_0x6861a3[_0x9918('0x47')]=_0x565a58['params']['id'];}else{_0x6861a3['id']=_0x565a58[_0x9918('0x41')]['id'];}return db[_0x9918('0x27')][_0x9918('0x43')]({'where':_0x6861a3,'attributes':['id','savePath',_0x9918('0x48')],'raw':!![]})[_0x9918('0x20')](handleEntityNotFound(_0x31ede5,null))[_0x9918('0x20')](function(_0x28e44c){if(_0x28e44c){var _0x444c86=_0x28e44c[_0x9918('0x49')];var _0x1d9013=util['format']('%s.cypher',_0x444c86);if(fs[_0x9918('0x4a')](_0x1d9013)){_0x20dd51=!![];return _0x20ce19[_0x9918('0x4b')](_0x1d9013,_0x444c86,config['secrets'][_0x9918('0x4c')])[_0x9918('0x20')](function(){return _0x28e44c;});}return _0x28e44c;}})[_0x9918('0x20')](function(_0x52bf3d){if(_0x52bf3d){var _0x390d56=_0x52bf3d[_0x9918('0x49')];if(!fs[_0x9918('0x4a')](_0x390d56)){throw new db[(_0x9918('0x4d'))]['ValidationError'](_0x9918('0x4e'));}if(_0x52bf3d[_0x9918('0x48')]){return _0x31ede5[_0x9918('0x4f')](_0x390d56,_0x52bf3d[_0x9918('0x48')]+path[_0x9918('0x50')](_0x390d56),function(){if(_0x20dd51){fs[_0x9918('0x51')](_0x390d56);}});}else{return _0x31ede5[_0x9918('0x4f')](_0x390d56,function(_0x179d47){if(_0x20dd51){fs[_0x9918('0x51')](_0x390d56);}});}}})[_0x9918('0x3f')](function(_0x233c08){if(_0x233c08[_0x9918('0x52')]===_0x9918('0x4e')){_0x31ede5['status'](0x194)['send'](_0x9918('0x53'));}else{return handleError(_0x31ede5,null);}});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 67bb5d5..b5b745f 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 _0x8b2c=['define','square_recordings','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','exports'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x8b2c,0x91));var _0xc8b2=function(_0x5eb817,_0x494bc9){_0x5eb817=_0x5eb817-0x0;var _0x1bc8a5=_0x8b2c[_0x5eb817];return _0x1bc8a5;};'use strict';var _=require(_0xc8b2('0x0'));var util=require(_0xc8b2('0x1'));var logger=require(_0xc8b2('0x2'))(_0xc8b2('0x3'));var moment=require('moment');var BPromise=require(_0xc8b2('0x4'));var rp=require(_0xc8b2('0x5'));var fs=require('fs');var path=require(_0xc8b2('0x6'));var rimraf=require(_0xc8b2('0x7'));var config=require(_0xc8b2('0x8'));var attributes=require(_0xc8b2('0x9'));module[_0xc8b2('0xa')]=function(_0x209e47,_0x1ee92c){return _0x209e47[_0xc8b2('0xb')]('SquareRecording',attributes,{'tableName':_0xc8b2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb493=['util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','define','SquareRecording','lodash'];(function(_0x567917,_0x1b1a4b){var _0x5a0b19=function(_0x115502){while(--_0x115502){_0x567917['push'](_0x567917['shift']());}};_0x5a0b19(++_0x1b1a4b);}(_0xb493,0x16a));var _0x3b49=function(_0x4d6078,_0xebdf83){_0x4d6078=_0x4d6078-0x0;var _0x181166=_0xb493[_0x4d6078];return _0x181166;};'use strict';var _=require(_0x3b49('0x0'));var util=require(_0x3b49('0x1'));var logger=require(_0x3b49('0x2'))(_0x3b49('0x3'));var moment=require('moment');var BPromise=require(_0x3b49('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3b49('0x5'));var rimraf=require(_0x3b49('0x6'));var config=require(_0x3b49('0x7'));var attributes=require('./squareRecording.attributes');module[_0x3b49('0x8')]=function(_0x5eaebc,_0x412991){return _0x5eaebc[_0x3b49('0x9')](_0x3b49('0xa'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index f2043ef..914d185 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 _0xd675=['rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','SquareRecording,\x20%s,\x20%s','message','catch','CreateSquareRecording','SquareRecording','body','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x11840f,_0x5e1075){var _0x20e2dc=function(_0x166ce3){while(--_0x166ce3){_0x11840f['push'](_0x11840f['shift']());}};_0x20e2dc(++_0x5e1075);}(_0xd675,0x1c3));var _0x5d67=function(_0x1477f6,_0x36e2d6){_0x1477f6=_0x1477f6-0x0;var _0x232dcb=_0xd675[_0x1477f6];return _0x232dcb;};'use strict';var _=require(_0x5d67('0x0'));var util=require(_0x5d67('0x1'));var moment=require(_0x5d67('0x2'));var BPromise=require(_0x5d67('0x3'));var rs=require(_0x5d67('0x4'));var fs=require('fs');var Redis=require(_0x5d67('0x5'));var db=require(_0x5d67('0x6'))['db'];var utils=require(_0x5d67('0x7'));var logger=require('../../config/logger')(_0x5d67('0x8'));var config=require(_0x5d67('0x9'));var jayson=require(_0x5d67('0xa'));var client=jayson[_0x5d67('0xb')][_0x5d67('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2f38e6,_0x338857,_0x5e8841){return new BPromise(function(_0x5e4149,_0xc171c6){return client['request'](_0x2f38e6,_0x5e8841)['then'](function(_0x30540f){logger[_0x5d67('0xd')]('SquareRecording,\x20%s,\x20%s',_0x338857,_0x5d67('0xe'));logger[_0x5d67('0xf')](_0x5d67('0x10'),_0x338857,_0x5d67('0xe'),JSON[_0x5d67('0x11')](_0x30540f));if(_0x30540f['error']){if(_0x30540f[_0x5d67('0x12')]['code']===0x1f4){logger[_0x5d67('0x12')](_0x5d67('0x13'),_0x338857,_0x30540f[_0x5d67('0x12')]['message']);return _0xc171c6(_0x30540f[_0x5d67('0x12')][_0x5d67('0x14')]);}logger[_0x5d67('0x12')]('SquareRecording,\x20%s,\x20%s',_0x338857,_0x30540f['error']['message']);return _0x5e4149(_0x30540f[_0x5d67('0x12')][_0x5d67('0x14')]);}else{logger[_0x5d67('0xd')](_0x5d67('0x13'),_0x338857,_0x5d67('0xe'));_0x5e4149(_0x30540f['result']['message']);}})[_0x5d67('0x15')](function(_0x4db268){logger['error'](_0x5d67('0x13'),_0x338857,_0x4db268);_0xc171c6(_0x4db268);});});}exports[_0x5d67('0x16')]=function(_0x5ba0b2){var _0x31dbc0=this;return new Promise(function(_0x3ecba6,_0x56dcc2){return db[_0x5d67('0x17')]['create'](_0x5ba0b2[_0x5d67('0x18')],{'raw':_0x5ba0b2['options']?_0x5ba0b2['options'][_0x5d67('0x19')]===undefined?!![]:![]:!![]})[_0x5d67('0x1a')](function(_0x7aa144){logger[_0x5d67('0xd')](_0x5d67('0x16'),_0x5ba0b2);logger[_0x5d67('0xf')](_0x5d67('0x16'),_0x5ba0b2,JSON[_0x5d67('0x11')](_0x7aa144));_0x3ecba6(_0x7aa144);})[_0x5d67('0x15')](function(_0x2f10a2){logger[_0x5d67('0x12')]('CreateSquareRecording',_0x2f10a2[_0x5d67('0x14')],_0x5ba0b2);_0x56dcc2(_0x31dbc0[_0x5d67('0x12')](0x1f4,_0x2f10a2[_0x5d67('0x14')]));});});}; \ No newline at end of file +var _0xa5f9=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','CreateSquareRecording','SquareRecording','create','body','options','then','stringify'];(function(_0x19c485,_0x2392ce){var _0x1104b6=function(_0x1d1f10){while(--_0x1d1f10){_0x19c485['push'](_0x19c485['shift']());}};_0x1104b6(++_0x2392ce);}(_0xa5f9,0x129));var _0x9a5f=function(_0x2df832,_0x240a8c){_0x2df832=_0x2df832-0x0;var _0x575133=_0xa5f9[_0x2df832];return _0x575133;};'use strict';var _=require('lodash');var util=require(_0x9a5f('0x0'));var moment=require(_0x9a5f('0x1'));var BPromise=require(_0x9a5f('0x2'));var rs=require(_0x9a5f('0x3'));var fs=require('fs');var Redis=require(_0x9a5f('0x4'));var db=require(_0x9a5f('0x5'))['db'];var utils=require(_0x9a5f('0x6'));var logger=require('../../config/logger')(_0x9a5f('0x7'));var config=require('../../config/environment');var jayson=require(_0x9a5f('0x8'));var client=jayson[_0x9a5f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a2f0e,_0x125273,_0x142160){return new BPromise(function(_0x33ad3c,_0xa6a035){return client[_0x9a5f('0xa')](_0x2a2f0e,_0x142160)['then'](function(_0x51f7bd){logger[_0x9a5f('0xb')](_0x9a5f('0xc'),_0x125273,_0x9a5f('0xd'));logger[_0x9a5f('0xe')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x125273,_0x9a5f('0xd'),JSON['stringify'](_0x51f7bd));if(_0x51f7bd[_0x9a5f('0xf')]){if(_0x51f7bd[_0x9a5f('0xf')][_0x9a5f('0x10')]===0x1f4){logger[_0x9a5f('0xf')](_0x9a5f('0xc'),_0x125273,_0x51f7bd[_0x9a5f('0xf')][_0x9a5f('0x11')]);return _0xa6a035(_0x51f7bd[_0x9a5f('0xf')][_0x9a5f('0x11')]);}logger[_0x9a5f('0xf')](_0x9a5f('0xc'),_0x125273,_0x51f7bd[_0x9a5f('0xf')][_0x9a5f('0x11')]);return _0x33ad3c(_0x51f7bd[_0x9a5f('0xf')][_0x9a5f('0x11')]);}else{logger[_0x9a5f('0xb')]('SquareRecording,\x20%s,\x20%s',_0x125273,_0x9a5f('0xd'));_0x33ad3c(_0x51f7bd[_0x9a5f('0x12')]['message']);}})[_0x9a5f('0x13')](function(_0x50baec){logger[_0x9a5f('0xf')](_0x9a5f('0xc'),_0x125273,_0x50baec);_0xa6a035(_0x50baec);});});}exports[_0x9a5f('0x14')]=function(_0x35f0e3){var _0x199ec7=this;return new Promise(function(_0x1e62ca,_0x180c54){return db[_0x9a5f('0x15')][_0x9a5f('0x16')](_0x35f0e3[_0x9a5f('0x17')],{'raw':_0x35f0e3[_0x9a5f('0x18')]?_0x35f0e3[_0x9a5f('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x9a5f('0x19')](function(_0x3df011){logger[_0x9a5f('0xb')](_0x9a5f('0x14'),_0x35f0e3);logger[_0x9a5f('0xe')]('CreateSquareRecording',_0x35f0e3,JSON[_0x9a5f('0x1a')](_0x3df011));_0x1e62ca(_0x3df011);})[_0x9a5f('0x13')](function(_0x141a69){logger[_0x9a5f('0xf')](_0x9a5f('0x14'),_0x141a69['message'],_0x35f0e3);_0x180c54(_0x199ec7[_0x9a5f('0xf')](0x1f4,_0x141a69[_0x9a5f('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 821340d..7a66378 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 _0x239b=['exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','/describe','isAuthenticated','describe','show','post','create','put','/:id','delete'];(function(_0x237d06,_0x244bda){var _0x236b2d=function(_0x2c36ff){while(--_0x2c36ff){_0x237d06['push'](_0x237d06['shift']());}};_0x236b2d(++_0x244bda);}(_0x239b,0x151));var _0xb239=function(_0x1f1a4b,_0x5a08af){_0x1f1a4b=_0x1f1a4b-0x0;var _0x817ed2=_0x239b[_0x1f1a4b];return _0x817ed2;};'use strict';var multer=require(_0xb239('0x0'));var util=require(_0xb239('0x1'));var path=require(_0xb239('0x2'));var timeout=require('connect-timeout');var express=require(_0xb239('0x3'));var router=express[_0xb239('0x4')]();var auth=require(_0xb239('0x5'));var interaction=require(_0xb239('0x6'));var config=require(_0xb239('0x7'));var controller=require(_0xb239('0x8'));router[_0xb239('0x9')]('/',auth['isAuthenticated'](),controller[_0xb239('0xa')]);router[_0xb239('0x9')](_0xb239('0xb'),auth[_0xb239('0xc')](),controller[_0xb239('0xd')]);router[_0xb239('0x9')]('/:id',auth[_0xb239('0xc')](),controller[_0xb239('0xe')]);router[_0xb239('0xf')]('/',auth[_0xb239('0xc')](),controller[_0xb239('0x10')]);router[_0xb239('0x11')](_0xb239('0x12'),auth[_0xb239('0xc')](),controller['update']);router[_0xb239('0x13')](_0xb239('0x12'),auth['isAuthenticated'](),controller['destroy']);module[_0xb239('0x14')]=router; \ No newline at end of file +var _0x5220=['create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','./squareReport.controller','get','isAuthenticated','index','describe','/:id','post'];(function(_0x39015f,_0x2643a7){var _0x331387=function(_0x500e81){while(--_0x500e81){_0x39015f['push'](_0x39015f['shift']());}};_0x331387(++_0x2643a7);}(_0x5220,0x195));var _0x0522=function(_0x3a6f3b,_0x570b8a){_0x3a6f3b=_0x3a6f3b-0x0;var _0x3594c7=_0x5220[_0x3a6f3b];return _0x3594c7;};'use strict';var multer=require(_0x0522('0x0'));var util=require('util');var path=require(_0x0522('0x1'));var timeout=require(_0x0522('0x2'));var express=require(_0x0522('0x3'));var router=express[_0x0522('0x4')]();var auth=require(_0x0522('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0522('0x6'));router[_0x0522('0x7')]('/',auth[_0x0522('0x8')](),controller[_0x0522('0x9')]);router['get']('/describe',auth[_0x0522('0x8')](),controller[_0x0522('0xa')]);router['get'](_0x0522('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x0522('0xc')]('/',auth[_0x0522('0x8')](),controller[_0x0522('0xd')]);router[_0x0522('0xe')]('/:id',auth[_0x0522('0x8')](),controller[_0x0522('0xf')]);router[_0x0522('0x10')](_0x0522('0xb'),auth[_0x0522('0x8')](),controller[_0x0522('0x11')]);module[_0x0522('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 84219be..624b3d4 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 _0x3b75=['exports','STRING','DATE','BOOLEAN','sequelize'];(function(_0x30aed0,_0x1e29a0){var _0x1c0365=function(_0x4a8ee0){while(--_0x4a8ee0){_0x30aed0['push'](_0x30aed0['shift']());}};_0x1c0365(++_0x1e29a0);}(_0x3b75,0x144));var _0x53b7=function(_0x221b8c,_0x2c7afc){_0x221b8c=_0x221b8c-0x0;var _0x3fab9f=_0x3b75[_0x221b8c];return _0x3fab9f;};'use strict';var Sequelize=require(_0x53b7('0x0'));module[_0x53b7('0x1')]={'network':{'type':Sequelize[_0x53b7('0x2')]},'network_script':{'type':Sequelize[_0x53b7('0x2')]},'request':{'type':Sequelize[_0x53b7('0x2')]},'channel':{'type':Sequelize[_0x53b7('0x2')]},'language':{'type':Sequelize[_0x53b7('0x2')]},'type':{'type':Sequelize[_0x53b7('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x53b7('0x2')]},'calleridname':{'type':Sequelize[_0x53b7('0x2')]},'callingpres':{'type':Sequelize[_0x53b7('0x2')]},'callingani2':{'type':Sequelize[_0x53b7('0x2')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x53b7('0x2')]},'rdnis':{'type':Sequelize[_0x53b7('0x2')]},'context':{'type':Sequelize[_0x53b7('0x2')]},'extension':{'type':Sequelize[_0x53b7('0x2')]},'priority':{'type':Sequelize[_0x53b7('0x2')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x53b7('0x2')]},'threadid':{'type':Sequelize[_0x53b7('0x2')]},'project_name':{'type':Sequelize[_0x53b7('0x2')]},'joinAt':{'type':Sequelize[_0x53b7('0x3')]},'leaveAt':{'type':Sequelize[_0x53b7('0x3')]},'bot':{'type':Sequelize[_0x53b7('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xda55=['exports','STRING','DATE','BOOLEAN','sequelize'];(function(_0x26d719,_0x25bba4){var _0x38be92=function(_0x3c6a01){while(--_0x3c6a01){_0x26d719['push'](_0x26d719['shift']());}};_0x38be92(++_0x25bba4);}(_0xda55,0x6d));var _0x5da5=function(_0x2b149a,_0x5ae66d){_0x2b149a=_0x2b149a-0x0;var _0x11c4ef=_0xda55[_0x2b149a];return _0x11c4ef;};'use strict';var Sequelize=require(_0x5da5('0x0'));module[_0x5da5('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x5da5('0x2')]},'channel':{'type':Sequelize[_0x5da5('0x2')]},'language':{'type':Sequelize[_0x5da5('0x2')]},'type':{'type':Sequelize[_0x5da5('0x2')]},'uniqueid':{'type':Sequelize[_0x5da5('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x5da5('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x5da5('0x2')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x5da5('0x2')]},'callingtns':{'type':Sequelize[_0x5da5('0x2')]},'dnid':{'type':Sequelize[_0x5da5('0x2')]},'rdnis':{'type':Sequelize[_0x5da5('0x2')]},'context':{'type':Sequelize[_0x5da5('0x2')]},'extension':{'type':Sequelize[_0x5da5('0x2')]},'priority':{'type':Sequelize[_0x5da5('0x2')]},'enhanced':{'type':Sequelize[_0x5da5('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x5da5('0x2')]},'project_name':{'type':Sequelize[_0x5da5('0x2')]},'joinAt':{'type':Sequelize[_0x5da5('0x3')]},'leaveAt':{'type':Sequelize[_0x5da5('0x3')]},'bot':{'type':Sequelize[_0x5da5('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 51baf5f..c2af3d4 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 _0x8176=['map','type','key','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','apply','reject','destroy','then','error','stack','send','index','SquareReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0x5b9570,_0x5201a1){var _0x5215ef=function(_0x3a3cf6){while(--_0x3a3cf6){_0x5b9570['push'](_0x5b9570['shift']());}};_0x5215ef(++_0x5201a1);}(_0x8176,0xe1));var _0x6817=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x8176[_0x6c993a];return _0x27f547;};'use strict';var pdf=require(_0x6817('0x0'));var emlformat=require(_0x6817('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x6817('0x2'));var jsonpatch=require(_0x6817('0x3'));var rp=require(_0x6817('0x4'));var moment=require(_0x6817('0x5'));var BPromise=require(_0x6817('0x6'));var Mustache=require(_0x6817('0x7'));var util=require('util');var path=require('path');var sox=require(_0x6817('0x8'));var csv=require('to-csv');var ejs=require(_0x6817('0x9'));var fs=require('fs');var _=require(_0x6817('0xa'));var squel=require('squel');var crypto=require(_0x6817('0xb'));var jsforce=require(_0x6817('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6817('0xd'));var querystring=require(_0x6817('0xe'));var Papa=require(_0x6817('0xf'));var Redis=require(_0x6817('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6817('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6817('0x12'))(_0x6817('0x13'));var utils=require(_0x6817('0x14'));var config=require(_0x6817('0x15'));var db=require(_0x6817('0x16'))['db'];function respondWithStatusCode(_0xb96e0f,_0x16d531){_0x16d531=_0x16d531||0xcc;return function(_0x3657fc){if(_0x3657fc){return _0xb96e0f[_0x6817('0x17')](_0x16d531);}return _0xb96e0f[_0x6817('0x18')](_0x16d531)[_0x6817('0x19')]();};}function respondWithResult(_0x503a47,_0x312b52){_0x312b52=_0x312b52||0xc8;return function(_0x29534f){if(_0x29534f){return _0x503a47[_0x6817('0x18')](_0x312b52)[_0x6817('0x1a')](_0x29534f);}};}function respondWithFilteredResult(_0x27c8b7,_0x438700){return function(_0x12e687){if(_0x12e687){var _0x47120a=_0x12e687[_0x6817('0x1b')],_0x25762d=_0x438700[_0x6817('0x1c')],_0x3e464c=_0x438700[_0x6817('0x1c')]+_0x438700[_0x6817('0x1d')],_0x104746;if(_0x3e464c>=_0x47120a){_0x3e464c=_0x47120a;_0x104746=0xc8;}else{_0x104746=0xce;}_0x27c8b7[_0x6817('0x18')](_0x104746);return _0x27c8b7['set']('Content-Range',_0x25762d+'-'+_0x3e464c+'/'+_0x47120a)['json'](_0x12e687);}return null;};}function patchUpdates(_0x2d7688){return function(_0x275455){try{jsonpatch[_0x6817('0x1e')](_0x275455,_0x2d7688,!![]);}catch(_0x5e63c7){return BPromise[_0x6817('0x1f')](_0x5e63c7);}return _0x275455['save']();};}function saveUpdates(_0x4af449,_0x1b6836){return function(_0x524bc0){if(_0x524bc0){return _0x524bc0['update'](_0x4af449)['then'](function(_0x1ae6d1){return _0x1ae6d1;});}return null;};}function removeEntity(_0x11fb82,_0x8c91f4){return function(_0x1d4851){if(_0x1d4851){return _0x1d4851[_0x6817('0x20')]()[_0x6817('0x21')](function(){_0x11fb82[_0x6817('0x18')](0xcc)[_0x6817('0x19')]();});}};}function handleEntityNotFound(_0x3fa096,_0xa84005){return function(_0x5d74ad){if(!_0x5d74ad){_0x3fa096['sendStatus'](0x194);}return _0x5d74ad;};}function handleError(_0x4fafa4,_0x27937c){_0x27937c=_0x27937c||0x1f4;return function(_0x588dbc){logger[_0x6817('0x22')](_0x588dbc[_0x6817('0x23')]);if(_0x588dbc['name']){delete _0x588dbc['name'];}_0x4fafa4[_0x6817('0x18')](_0x27937c)[_0x6817('0x24')](_0x588dbc);};}exports[_0x6817('0x25')]=function(_0x314643,_0x254730){var _0x2bf559={},_0x370f8f={},_0x558ce1={'count':0x0,'rows':[]};var _0x14f466=db[_0x6817('0x26')][_0x6817('0x27')];_0x370f8f[_0x6817('0x28')]=_[_0x6817('0x29')](_0x14f466);_0x370f8f[_0x6817('0x2a')]=_[_0x6817('0x29')](_0x314643[_0x6817('0x2a')]);_0x370f8f[_0x6817('0x2b')]=_[_0x6817('0x2c')](_0x370f8f[_0x6817('0x28')],_0x370f8f[_0x6817('0x2a')]);_0x2bf559[_0x6817('0x2d')]=_['intersection'](_0x370f8f[_0x6817('0x28')],qs[_0x6817('0x2e')](_0x314643[_0x6817('0x2a')][_0x6817('0x2e')]));_0x2bf559['attributes']=_0x2bf559['attributes']['length']?_0x2bf559[_0x6817('0x2d')]:_0x370f8f['model'];if(!_0x314643['query'][_0x6817('0x2f')](_0x6817('0x30'))){_0x2bf559[_0x6817('0x1d')]=qs[_0x6817('0x1d')](_0x314643[_0x6817('0x2a')][_0x6817('0x1d')]);_0x2bf559[_0x6817('0x1c')]=qs[_0x6817('0x1c')](_0x314643[_0x6817('0x2a')][_0x6817('0x1c')]);}_0x2bf559[_0x6817('0x31')]=qs[_0x6817('0x32')](_0x314643[_0x6817('0x2a')][_0x6817('0x32')]);_0x2bf559[_0x6817('0x33')]=qs[_0x6817('0x2b')](_[_0x6817('0x34')](_0x314643[_0x6817('0x2a')],_0x370f8f[_0x6817('0x2b')]));if(_0x314643[_0x6817('0x2a')][_0x6817('0x35')]){_0x2bf559[_0x6817('0x33')]=_[_0x6817('0x36')](_0x2bf559[_0x6817('0x33')],{'$or':_[_0x6817('0x37')](_0x14f466,function(_0x45d671){if(_0x45d671[_0x6817('0x38')][_0x6817('0x39')]!=='VIRTUAL'){var _0x3ad7d2={};_0x3ad7d2[_0x45d671['field']]={'$like':'%'+_0x314643[_0x6817('0x2a')][_0x6817('0x35')]+'%'};return _0x3ad7d2;}})});}_0x2bf559=_[_0x6817('0x36')]({},_0x2bf559,_0x314643[_0x6817('0x3a')]);var _0x1a9523={'where':_0x2bf559[_0x6817('0x33')]};return db[_0x6817('0x26')][_0x6817('0x1b')](_0x1a9523)[_0x6817('0x21')](function(_0x3484ef){_0x558ce1['count']=_0x3484ef;if(_0x314643['query'][_0x6817('0x3b')]){_0x2bf559[_0x6817('0x3c')]=[{'all':!![]}];}return db[_0x6817('0x26')][_0x6817('0x3d')](_0x2bf559);})[_0x6817('0x21')](function(_0x10649e){_0x558ce1[_0x6817('0x3e')]=_0x10649e;return _0x558ce1;})[_0x6817('0x21')](respondWithFilteredResult(_0x254730,_0x2bf559))[_0x6817('0x3f')](handleError(_0x254730,null));};exports['show']=function(_0x2683b3,_0x533da4){var _0x3f5456={'raw':!![],'where':{'id':_0x2683b3[_0x6817('0x40')]['id']}},_0x3dde8a={};_0x3dde8a[_0x6817('0x28')]=_['keys'](db[_0x6817('0x26')][_0x6817('0x27')]);_0x3dde8a[_0x6817('0x2a')]=_[_0x6817('0x29')](_0x2683b3[_0x6817('0x2a')]);_0x3dde8a[_0x6817('0x2b')]=_['intersection'](_0x3dde8a[_0x6817('0x28')],_0x3dde8a['query']);_0x3f5456[_0x6817('0x2d')]=_[_0x6817('0x2c')](_0x3dde8a[_0x6817('0x28')],qs[_0x6817('0x2e')](_0x2683b3[_0x6817('0x2a')][_0x6817('0x2e')]));_0x3f5456[_0x6817('0x2d')]=_0x3f5456[_0x6817('0x2d')][_0x6817('0x41')]?_0x3f5456[_0x6817('0x2d')]:_0x3dde8a[_0x6817('0x28')];if(_0x2683b3[_0x6817('0x2a')][_0x6817('0x3b')]){_0x3f5456[_0x6817('0x3c')]=[{'all':!![]}];}_0x3f5456=_['merge']({},_0x3f5456,_0x2683b3[_0x6817('0x3a')]);return db[_0x6817('0x26')][_0x6817('0x42')](_0x3f5456)[_0x6817('0x21')](handleEntityNotFound(_0x533da4,null))[_0x6817('0x21')](respondWithResult(_0x533da4,null))[_0x6817('0x3f')](handleError(_0x533da4,null));};exports[_0x6817('0x43')]=function(_0xa69662,_0x238ec7){return db[_0x6817('0x26')][_0x6817('0x43')](_0xa69662[_0x6817('0x44')],{})[_0x6817('0x21')](respondWithResult(_0x238ec7,0xc9))[_0x6817('0x3f')](handleError(_0x238ec7,null));};exports['update']=function(_0x320a83,_0x1a2eeb){if(_0x320a83[_0x6817('0x44')]['id']){delete _0x320a83[_0x6817('0x44')]['id'];}return db[_0x6817('0x26')][_0x6817('0x42')]({'where':{'id':_0x320a83['params']['id']}})[_0x6817('0x21')](handleEntityNotFound(_0x1a2eeb,null))[_0x6817('0x21')](saveUpdates(_0x320a83[_0x6817('0x44')],null))[_0x6817('0x21')](respondWithResult(_0x1a2eeb,null))['catch'](handleError(_0x1a2eeb,null));};exports[_0x6817('0x20')]=function(_0x1b5ccd,_0x3f93ca){return db[_0x6817('0x26')][_0x6817('0x42')]({'where':{'id':_0x1b5ccd['params']['id']}})[_0x6817('0x21')](handleEntityNotFound(_0x3f93ca,null))[_0x6817('0x21')](removeEntity(_0x3f93ca,null))[_0x6817('0x3f')](handleError(_0x3f93ca,null));};exports[_0x6817('0x45')]=function(_0x5bc59b,_0x48f6d9){return db[_0x6817('0x26')][_0x6817('0x45')]()[_0x6817('0x21')](respondWithResult(_0x48f6d9,null))['catch'](handleError(_0x48f6d9,null));}; \ No newline at end of file +var _0xbead=['show','params','include','options','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','SquareReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','findAll','rows','catch'];(function(_0x3a04ab,_0x31b9fd){var _0x4bff6d=function(_0x125f7e){while(--_0x125f7e){_0x3a04ab['push'](_0x3a04ab['shift']());}};_0x4bff6d(++_0x31b9fd);}(_0xbead,0x94));var _0xdbea=function(_0x120376,_0x571898){_0x120376=_0x120376-0x0;var _0x28c529=_0xbead[_0x120376];return _0x28c529;};'use strict';var pdf=require(_0xdbea('0x0'));var emlformat=require(_0xdbea('0x1'));var rimraf=require(_0xdbea('0x2'));var zipdir=require(_0xdbea('0x3'));var jsonpatch=require(_0xdbea('0x4'));var rp=require('request-promise');var moment=require(_0xdbea('0x5'));var BPromise=require(_0xdbea('0x6'));var Mustache=require(_0xdbea('0x7'));var util=require('util');var path=require(_0xdbea('0x8'));var sox=require(_0xdbea('0x9'));var csv=require(_0xdbea('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xdbea('0xb'));var crypto=require(_0xdbea('0xc'));var jsforce=require(_0xdbea('0xd'));var deskjs=require(_0xdbea('0xe'));var toCsv=require(_0xdbea('0xa'));var querystring=require(_0xdbea('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdbea('0x10'));var qs=require(_0xdbea('0x11'));var hardwareService=require(_0xdbea('0x12'));var logger=require(_0xdbea('0x13'))(_0xdbea('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18a88b,_0x28275a){_0x28275a=_0x28275a||0xcc;return function(_0x311937){if(_0x311937){return _0x18a88b[_0xdbea('0x15')](_0x28275a);}return _0x18a88b[_0xdbea('0x16')](_0x28275a)[_0xdbea('0x17')]();};}function respondWithResult(_0x23233d,_0x13b520){_0x13b520=_0x13b520||0xc8;return function(_0x31baca){if(_0x31baca){return _0x23233d[_0xdbea('0x16')](_0x13b520)[_0xdbea('0x18')](_0x31baca);}};}function respondWithFilteredResult(_0x542339,_0x1df1be){return function(_0x1be7d8){if(_0x1be7d8){var _0x520aa8=_0x1be7d8[_0xdbea('0x19')],_0x2f0044=_0x1df1be[_0xdbea('0x1a')],_0x451763=_0x1df1be[_0xdbea('0x1a')]+_0x1df1be[_0xdbea('0x1b')],_0x3da6fb;if(_0x451763>=_0x520aa8){_0x451763=_0x520aa8;_0x3da6fb=0xc8;}else{_0x3da6fb=0xce;}_0x542339[_0xdbea('0x16')](_0x3da6fb);return _0x542339['set'](_0xdbea('0x1c'),_0x2f0044+'-'+_0x451763+'/'+_0x520aa8)['json'](_0x1be7d8);}return null;};}function patchUpdates(_0x1a4bf6){return function(_0x50e8d2){try{jsonpatch[_0xdbea('0x1d')](_0x50e8d2,_0x1a4bf6,!![]);}catch(_0x5f4b70){return BPromise[_0xdbea('0x1e')](_0x5f4b70);}return _0x50e8d2[_0xdbea('0x1f')]();};}function saveUpdates(_0x55c471,_0x12e17a){return function(_0x3ead0b){if(_0x3ead0b){return _0x3ead0b[_0xdbea('0x20')](_0x55c471)[_0xdbea('0x21')](function(_0x149043){return _0x149043;});}return null;};}function removeEntity(_0x235752,_0x500425){return function(_0xd99854){if(_0xd99854){return _0xd99854[_0xdbea('0x22')]()['then'](function(){_0x235752[_0xdbea('0x16')](0xcc)[_0xdbea('0x17')]();});}};}function handleEntityNotFound(_0x1490a4,_0x55fefd){return function(_0x5babba){if(!_0x5babba){_0x1490a4[_0xdbea('0x15')](0x194);}return _0x5babba;};}function handleError(_0x284206,_0x2eae42){_0x2eae42=_0x2eae42||0x1f4;return function(_0x2bbaca){logger[_0xdbea('0x23')](_0x2bbaca[_0xdbea('0x24')]);if(_0x2bbaca[_0xdbea('0x25')]){delete _0x2bbaca[_0xdbea('0x25')];}_0x284206[_0xdbea('0x16')](_0x2eae42)['send'](_0x2bbaca);};}exports['index']=function(_0x5e4222,_0x3e1446){var _0x3df7c8={},_0x26ac24={},_0x42bbd9={'count':0x0,'rows':[]};var _0xa47f57=db[_0xdbea('0x26')][_0xdbea('0x27')];_0x26ac24[_0xdbea('0x28')]=_[_0xdbea('0x29')](_0xa47f57);_0x26ac24[_0xdbea('0x2a')]=_[_0xdbea('0x29')](_0x5e4222[_0xdbea('0x2a')]);_0x26ac24[_0xdbea('0x2b')]=_[_0xdbea('0x2c')](_0x26ac24[_0xdbea('0x28')],_0x26ac24[_0xdbea('0x2a')]);_0x3df7c8[_0xdbea('0x2d')]=_['intersection'](_0x26ac24[_0xdbea('0x28')],qs[_0xdbea('0x2e')](_0x5e4222[_0xdbea('0x2a')]['fields']));_0x3df7c8[_0xdbea('0x2d')]=_0x3df7c8[_0xdbea('0x2d')][_0xdbea('0x2f')]?_0x3df7c8['attributes']:_0x26ac24['model'];if(!_0x5e4222[_0xdbea('0x2a')]['hasOwnProperty'](_0xdbea('0x30'))){_0x3df7c8[_0xdbea('0x1b')]=qs[_0xdbea('0x1b')](_0x5e4222['query'][_0xdbea('0x1b')]);_0x3df7c8[_0xdbea('0x1a')]=qs[_0xdbea('0x1a')](_0x5e4222[_0xdbea('0x2a')][_0xdbea('0x1a')]);}_0x3df7c8[_0xdbea('0x31')]=qs[_0xdbea('0x32')](_0x5e4222['query']['sort']);_0x3df7c8[_0xdbea('0x33')]=qs[_0xdbea('0x2b')](_[_0xdbea('0x34')](_0x5e4222['query'],_0x26ac24[_0xdbea('0x2b')]));if(_0x5e4222[_0xdbea('0x2a')][_0xdbea('0x35')]){_0x3df7c8[_0xdbea('0x33')]=_[_0xdbea('0x36')](_0x3df7c8[_0xdbea('0x33')],{'$or':_[_0xdbea('0x37')](_0xa47f57,function(_0x273ff0){if(_0x273ff0[_0xdbea('0x38')][_0xdbea('0x39')]!==_0xdbea('0x3a')){var _0x431dc8={};_0x431dc8[_0x273ff0['field']]={'$like':'%'+_0x5e4222['query'][_0xdbea('0x35')]+'%'};return _0x431dc8;}})});}_0x3df7c8=_[_0xdbea('0x36')]({},_0x3df7c8,_0x5e4222['options']);var _0x22587e={'where':_0x3df7c8[_0xdbea('0x33')]};return db[_0xdbea('0x26')][_0xdbea('0x19')](_0x22587e)[_0xdbea('0x21')](function(_0x16752f){_0x42bbd9['count']=_0x16752f;if(_0x5e4222[_0xdbea('0x2a')]['includeAll']){_0x3df7c8['include']=[{'all':!![]}];}return db[_0xdbea('0x26')][_0xdbea('0x3b')](_0x3df7c8);})[_0xdbea('0x21')](function(_0x12a6d0){_0x42bbd9[_0xdbea('0x3c')]=_0x12a6d0;return _0x42bbd9;})['then'](respondWithFilteredResult(_0x3e1446,_0x3df7c8))[_0xdbea('0x3d')](handleError(_0x3e1446,null));};exports[_0xdbea('0x3e')]=function(_0x108da4,_0x296c34){var _0x1526a5={'raw':!![],'where':{'id':_0x108da4[_0xdbea('0x3f')]['id']}},_0x2c775a={};_0x2c775a[_0xdbea('0x28')]=_['keys'](db[_0xdbea('0x26')][_0xdbea('0x27')]);_0x2c775a[_0xdbea('0x2a')]=_[_0xdbea('0x29')](_0x108da4['query']);_0x2c775a[_0xdbea('0x2b')]=_['intersection'](_0x2c775a[_0xdbea('0x28')],_0x2c775a[_0xdbea('0x2a')]);_0x1526a5[_0xdbea('0x2d')]=_[_0xdbea('0x2c')](_0x2c775a['model'],qs[_0xdbea('0x2e')](_0x108da4[_0xdbea('0x2a')][_0xdbea('0x2e')]));_0x1526a5[_0xdbea('0x2d')]=_0x1526a5[_0xdbea('0x2d')][_0xdbea('0x2f')]?_0x1526a5[_0xdbea('0x2d')]:_0x2c775a[_0xdbea('0x28')];if(_0x108da4[_0xdbea('0x2a')]['includeAll']){_0x1526a5[_0xdbea('0x40')]=[{'all':!![]}];}_0x1526a5=_[_0xdbea('0x36')]({},_0x1526a5,_0x108da4[_0xdbea('0x41')]);return db[_0xdbea('0x26')][_0xdbea('0x42')](_0x1526a5)['then'](handleEntityNotFound(_0x296c34,null))[_0xdbea('0x21')](respondWithResult(_0x296c34,null))[_0xdbea('0x3d')](handleError(_0x296c34,null));};exports[_0xdbea('0x43')]=function(_0x308977,_0x1ec065){return db[_0xdbea('0x26')][_0xdbea('0x43')](_0x308977['body'],{})[_0xdbea('0x21')](respondWithResult(_0x1ec065,0xc9))[_0xdbea('0x3d')](handleError(_0x1ec065,null));};exports['update']=function(_0x2feee1,_0x46cd05){if(_0x2feee1[_0xdbea('0x44')]['id']){delete _0x2feee1[_0xdbea('0x44')]['id'];}return db['SquareReport'][_0xdbea('0x42')]({'where':{'id':_0x2feee1['params']['id']}})[_0xdbea('0x21')](handleEntityNotFound(_0x46cd05,null))[_0xdbea('0x21')](saveUpdates(_0x2feee1[_0xdbea('0x44')],null))[_0xdbea('0x21')](respondWithResult(_0x46cd05,null))[_0xdbea('0x3d')](handleError(_0x46cd05,null));};exports[_0xdbea('0x22')]=function(_0x13dad0,_0x4a7bd6){return db[_0xdbea('0x26')][_0xdbea('0x42')]({'where':{'id':_0x13dad0[_0xdbea('0x3f')]['id']}})[_0xdbea('0x21')](handleEntityNotFound(_0x4a7bd6,null))[_0xdbea('0x21')](removeEntity(_0x4a7bd6,null))[_0xdbea('0x3d')](handleError(_0x4a7bd6,null));};exports[_0xdbea('0x45')]=function(_0x5879c5,_0x57be90){return db[_0xdbea('0x26')]['describe']()['then'](respondWithResult(_0x57be90,null))[_0xdbea('0x3d')](handleError(_0x57be90,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 6a52bf7..916c1f9 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 _0xa9e0=['exports','define','SquareReport','uniqueid','leaveAt','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./squareReport.attributes'];(function(_0x4d4b16,_0x56100a){var _0x5d48b9=function(_0x492480){while(--_0x492480){_0x4d4b16['push'](_0x4d4b16['shift']());}};_0x5d48b9(++_0x56100a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0x0a9e('0xb'),'project_name']},{'name':'leaveAt','fields':[_0x0a9e('0xc')]}],'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(_0x22c7e0,_0x3e1a17){var _0x41c795=function(_0x3302d7){while(--_0x3302d7){_0x22c7e0['push'](_0x22c7e0['shift']());}};_0x41c795(++_0x3e1a17);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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 7542ab0..525318b 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 _0xbc77=['UpdateSquareReport','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','SquareReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','CreateSquareReport','SquareReport','body','options','update','raw','where','attributes','limit'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xbc77,0x15d));var _0x7bc7=function(_0x836465,_0x5442ae){_0x836465=_0x836465-0x0;var _0x2150ea=_0xbc77[_0x836465];return _0x2150ea;};'use strict';var _=require(_0x7bc7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7bc7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7bc7('0x2'));var db=require(_0x7bc7('0x3'))['db'];var utils=require(_0x7bc7('0x4'));var logger=require(_0x7bc7('0x5'))('rpc');var config=require(_0x7bc7('0x6'));var jayson=require(_0x7bc7('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2ed951,_0x1f56ae,_0x1bdb32){return new BPromise(function(_0x1327cc,_0x92f6b1){return client[_0x7bc7('0x8')](_0x2ed951,_0x1bdb32)[_0x7bc7('0x9')](function(_0x420b98){logger['info'](_0x7bc7('0xa'),_0x1f56ae,_0x7bc7('0xb'));logger[_0x7bc7('0xc')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x1f56ae,_0x7bc7('0xb'),JSON[_0x7bc7('0xd')](_0x420b98));if(_0x420b98[_0x7bc7('0xe')]){if(_0x420b98[_0x7bc7('0xe')][_0x7bc7('0xf')]===0x1f4){logger[_0x7bc7('0xe')]('SquareReport,\x20%s,\x20%s',_0x1f56ae,_0x420b98[_0x7bc7('0xe')][_0x7bc7('0x10')]);return _0x92f6b1(_0x420b98[_0x7bc7('0xe')][_0x7bc7('0x10')]);}logger[_0x7bc7('0xe')]('SquareReport,\x20%s,\x20%s',_0x1f56ae,_0x420b98[_0x7bc7('0xe')][_0x7bc7('0x10')]);return _0x1327cc(_0x420b98[_0x7bc7('0xe')][_0x7bc7('0x10')]);}else{logger[_0x7bc7('0x11')](_0x7bc7('0xa'),_0x1f56ae,_0x7bc7('0xb'));_0x1327cc(_0x420b98['result'][_0x7bc7('0x10')]);}})[_0x7bc7('0x12')](function(_0x3e3862){logger['error'](_0x7bc7('0xa'),_0x1f56ae,_0x3e3862);_0x92f6b1(_0x3e3862);});});}exports[_0x7bc7('0x13')]=function(_0x4632fc){var _0x47192b=this;return new Promise(function(_0xaae8a9,_0x5ec3fc){return db[_0x7bc7('0x14')]['create'](_0x4632fc[_0x7bc7('0x15')],{'raw':_0x4632fc[_0x7bc7('0x16')]?_0x4632fc['options']['raw']===undefined?!![]:![]:!![]})[_0x7bc7('0x9')](function(_0x217cde){logger[_0x7bc7('0x11')](_0x7bc7('0x13'),_0x4632fc);logger['debug'](_0x7bc7('0x13'),_0x4632fc,JSON[_0x7bc7('0xd')](_0x217cde));_0xaae8a9(_0x217cde);})[_0x7bc7('0x12')](function(_0xaa7e43){logger[_0x7bc7('0xe')](_0x7bc7('0x13'),_0xaa7e43[_0x7bc7('0x10')],_0x4632fc);_0x5ec3fc(_0x47192b[_0x7bc7('0xe')](0x1f4,_0xaa7e43[_0x7bc7('0x10')]));});});};exports['UpdateSquareReport']=function(_0x496f9c){var _0x3433ec=this;return new Promise(function(_0x5e69ca,_0x2a41a9){return db[_0x7bc7('0x14')][_0x7bc7('0x17')](_0x496f9c['body'],{'raw':_0x496f9c[_0x7bc7('0x16')]?_0x496f9c[_0x7bc7('0x16')][_0x7bc7('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x496f9c[_0x7bc7('0x16')]?_0x496f9c[_0x7bc7('0x16')][_0x7bc7('0x19')]||null:null,'attributes':_0x496f9c[_0x7bc7('0x16')]?_0x496f9c[_0x7bc7('0x16')][_0x7bc7('0x1a')]||null:null,'limit':_0x496f9c[_0x7bc7('0x16')]?_0x496f9c[_0x7bc7('0x16')][_0x7bc7('0x1b')]||null:null})[_0x7bc7('0x9')](function(_0x299ee0){logger[_0x7bc7('0x11')](_0x7bc7('0x1c'),_0x496f9c);logger[_0x7bc7('0xc')]('UpdateSquareReport',_0x496f9c,JSON['stringify'](_0x299ee0));_0x5e69ca(_0x299ee0);})[_0x7bc7('0x12')](function(_0x3d611a){logger['error']('UpdateSquareReport',_0x3d611a[_0x7bc7('0x10')],_0x496f9c);_0x2a41a9(_0x3433ec[_0x7bc7('0xe')](0x1f4,_0x3d611a[_0x7bc7('0x10')]));});});}; \ No newline at end of file +var _0x844f=['http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','error','code','message','create','options','raw','CreateSquareReport','stringify','UpdateSquareReport','SquareReport','update','attributes','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client'];(function(_0x409849,_0x4303c8){var _0x3d1465=function(_0x4a10d4){while(--_0x4a10d4){_0x409849['push'](_0x409849['shift']());}};_0x3d1465(++_0x4303c8);}(_0x844f,0x19c));var _0xf844=function(_0x1bd3b2,_0x14d3b7){_0x1bd3b2=_0x1bd3b2-0x0;var _0x2b95bc=_0x844f[_0x1bd3b2];return _0x2b95bc;};'use strict';var _=require('lodash');var util=require(_0xf844('0x0'));var moment=require('moment');var BPromise=require(_0xf844('0x1'));var rs=require(_0xf844('0x2'));var fs=require('fs');var Redis=require(_0xf844('0x3'));var db=require(_0xf844('0x4'))['db'];var utils=require(_0xf844('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xf844('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf844('0x7')][_0xf844('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x52bd6f,_0x2c4c00,_0x22c9e0){return new BPromise(function(_0xf92aae,_0x293ad5){return client[_0xf844('0x9')](_0x52bd6f,_0x22c9e0)[_0xf844('0xa')](function(_0x34b57f){logger[_0xf844('0xb')](_0xf844('0xc'),_0x2c4c00,_0xf844('0xd'));logger[_0xf844('0xe')](_0xf844('0xf'),_0x2c4c00,_0xf844('0xd'),JSON['stringify'](_0x34b57f));if(_0x34b57f['error']){if(_0x34b57f[_0xf844('0x10')][_0xf844('0x11')]===0x1f4){logger[_0xf844('0x10')](_0xf844('0xc'),_0x2c4c00,_0x34b57f[_0xf844('0x10')][_0xf844('0x12')]);return _0x293ad5(_0x34b57f['error'][_0xf844('0x12')]);}logger[_0xf844('0x10')](_0xf844('0xc'),_0x2c4c00,_0x34b57f['error'][_0xf844('0x12')]);return _0xf92aae(_0x34b57f['error'][_0xf844('0x12')]);}else{logger[_0xf844('0xb')](_0xf844('0xc'),_0x2c4c00,_0xf844('0xd'));_0xf92aae(_0x34b57f['result']['message']);}})['catch'](function(_0x4b1293){logger[_0xf844('0x10')](_0xf844('0xc'),_0x2c4c00,_0x4b1293);_0x293ad5(_0x4b1293);});});}exports['CreateSquareReport']=function(_0x3835d3){var _0x23505b=this;return new Promise(function(_0x10e4c3,_0x398eb9){return db['SquareReport'][_0xf844('0x13')](_0x3835d3['body'],{'raw':_0x3835d3[_0xf844('0x14')]?_0x3835d3[_0xf844('0x14')][_0xf844('0x15')]===undefined?!![]:![]:!![]})[_0xf844('0xa')](function(_0x3b11d1){logger[_0xf844('0xb')]('CreateSquareReport',_0x3835d3);logger[_0xf844('0xe')](_0xf844('0x16'),_0x3835d3,JSON[_0xf844('0x17')](_0x3b11d1));_0x10e4c3(_0x3b11d1);})['catch'](function(_0x237a85){logger[_0xf844('0x10')](_0xf844('0x16'),_0x237a85[_0xf844('0x12')],_0x3835d3);_0x398eb9(_0x23505b[_0xf844('0x10')](0x1f4,_0x237a85[_0xf844('0x12')]));});});};exports[_0xf844('0x18')]=function(_0x16fa74){var _0x3df36e=this;return new Promise(function(_0x44abc2,_0x3ac65c){return db[_0xf844('0x19')][_0xf844('0x1a')](_0x16fa74['body'],{'raw':_0x16fa74[_0xf844('0x14')]?_0x16fa74[_0xf844('0x14')][_0xf844('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16fa74[_0xf844('0x14')]?_0x16fa74['options']['where']||null:null,'attributes':_0x16fa74[_0xf844('0x14')]?_0x16fa74[_0xf844('0x14')][_0xf844('0x1b')]||null:null,'limit':_0x16fa74[_0xf844('0x14')]?_0x16fa74[_0xf844('0x14')]['limit']||null:null})[_0xf844('0xa')](function(_0x2d7956){logger[_0xf844('0xb')]('UpdateSquareReport',_0x16fa74);logger[_0xf844('0xe')]('UpdateSquareReport',_0x16fa74,JSON[_0xf844('0x17')](_0x2d7956));_0x44abc2(_0x2d7956);})['catch'](function(_0x4dbf5a){logger[_0xf844('0x10')](_0xf844('0x18'),_0x4dbf5a[_0xf844('0x12')],_0x16fa74);_0x3ac65c(_0x3df36e[_0xf844('0x10')](0x1f4,_0x4dbf5a['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index e9625e9..79fb20c 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 _0x55de=['delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareReportDetail.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','update'];(function(_0x5b2cec,_0x3709cf){var _0x446d6e=function(_0x35f5c9){while(--_0x35f5c9){_0x5b2cec['push'](_0x5b2cec['shift']());}};_0x446d6e(++_0x3709cf);}(_0x55de,0xdf));var _0xe55d=function(_0x76517f,_0x325017){_0x76517f=_0x76517f-0x0;var _0x43cc3a=_0x55de[_0x76517f];return _0x43cc3a;};'use strict';var multer=require(_0xe55d('0x0'));var util=require(_0xe55d('0x1'));var path=require('path');var timeout=require(_0xe55d('0x2'));var express=require(_0xe55d('0x3'));var router=express[_0xe55d('0x4')]();var auth=require(_0xe55d('0x5'));var interaction=require(_0xe55d('0x6'));var config=require('../../config/environment');var controller=require(_0xe55d('0x7'));router['get']('/',auth[_0xe55d('0x8')](),controller[_0xe55d('0x9')]);router[_0xe55d('0xa')](_0xe55d('0xb'),auth['isAuthenticated'](),controller[_0xe55d('0xc')]);router[_0xe55d('0xa')](_0xe55d('0xd'),auth['isAuthenticated'](),controller[_0xe55d('0xe')]);router[_0xe55d('0xf')]('/',auth[_0xe55d('0x8')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xe55d('0x10')]);router[_0xe55d('0x11')](_0xe55d('0xd'),auth[_0xe55d('0x8')](),controller[_0xe55d('0x12')]);module[_0xe55d('0x13')]=router; \ No newline at end of file +var _0x5a55=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','index','/describe','isAuthenticated','show','create','put','/:id','update','delete','destroy','exports','util'];(function(_0xf45843,_0x12e7da){var _0x96ce04=function(_0x34e875){while(--_0x34e875){_0xf45843['push'](_0xf45843['shift']());}};_0x96ce04(++_0x12e7da);}(_0x5a55,0x1b4));var _0x55a5=function(_0x5d30b4,_0x199248){_0x5d30b4=_0x5d30b4-0x0;var _0x1acfb8=_0x5a55[_0x5d30b4];return _0x1acfb8;};'use strict';var multer=require('multer');var util=require(_0x55a5('0x0'));var path=require('path');var timeout=require(_0x55a5('0x1'));var express=require(_0x55a5('0x2'));var router=express['Router']();var auth=require(_0x55a5('0x3'));var interaction=require(_0x55a5('0x4'));var config=require(_0x55a5('0x5'));var controller=require(_0x55a5('0x6'));router[_0x55a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x55a5('0x8')]);router[_0x55a5('0x7')](_0x55a5('0x9'),auth[_0x55a5('0xa')](),controller['describe']);router[_0x55a5('0x7')]('/:id',auth[_0x55a5('0xa')](),controller[_0x55a5('0xb')]);router['post']('/',auth[_0x55a5('0xa')](),controller[_0x55a5('0xc')]);router[_0x55a5('0xd')](_0x55a5('0xe'),auth[_0x55a5('0xa')](),controller[_0x55a5('0xf')]);router[_0x55a5('0x10')](_0x55a5('0xe'),auth[_0x55a5('0xa')](),controller[_0x55a5('0x11')]);module[_0x55a5('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 4a807d5..c122253 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 _0x1bee=['STRING','TEXT','sequelize','exports'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x1bee,0x86));var _0xe1be=function(_0x409fb8,_0x5ab3d3){_0x409fb8=_0x409fb8-0x0;var _0x278270=_0x1bee[_0x409fb8];return _0x278270;};'use strict';var Sequelize=require(_0xe1be('0x0'));module[_0xe1be('0x1')]={'uniqueid':{'type':Sequelize[_0xe1be('0x2')]},'node':{'type':Sequelize[_0xe1be('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0xe1be('0x3')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xe1be('0x2')]}}; \ No newline at end of file +var _0x1189=['exports','STRING','TEXT','sequelize'];(function(_0x250262,_0x4a1225){var _0x535b9e=function(_0x32f81c){while(--_0x32f81c){_0x250262['push'](_0x250262['shift']());}};_0x535b9e(++_0x4a1225);}(_0x1189,0x127));var _0x9118=function(_0x40f703,_0x39fdcd){_0x40f703=_0x40f703-0x0;var _0x35db9d=_0x1189[_0x40f703];return _0x35db9d;};'use strict';var Sequelize=require(_0x9118('0x0'));module[_0x9118('0x1')]={'uniqueid':{'type':Sequelize[_0x9118('0x2')]},'node':{'type':Sequelize[_0x9118('0x2')]},'application':{'type':Sequelize[_0x9118('0x2')]},'data':{'type':Sequelize[_0x9118('0x3')]},'project_name':{'type':Sequelize[_0x9118('0x2')]},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 88e8c53..f7df60d 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 _0xc527=['type','key','VIRTUAL','field','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','length','include','find','create','body','describe','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','count','Content-Range','apply','reject','save','update','then','error','name','index','SquareDetailsReport','keys','query','filters','intersection','attributes','fields','model','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','filter','map'];(function(_0x1c149a,_0x441750){var _0x1d93ad=function(_0x398ab1){while(--_0x398ab1){_0x1c149a['push'](_0x1c149a['shift']());}};_0x1d93ad(++_0x441750);}(_0xc527,0xaf));var _0x7c52=function(_0x46bddf,_0x381867){_0x46bddf=_0x46bddf-0x0;var _0x3668aa=_0xc527[_0x46bddf];return _0x3668aa;};'use strict';var pdf=require(_0x7c52('0x0'));var emlformat=require(_0x7c52('0x1'));var rimraf=require(_0x7c52('0x2'));var zipdir=require(_0x7c52('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7c52('0x4'));var moment=require(_0x7c52('0x5'));var BPromise=require(_0x7c52('0x6'));var Mustache=require(_0x7c52('0x7'));var util=require(_0x7c52('0x8'));var path=require(_0x7c52('0x9'));var sox=require(_0x7c52('0xa'));var csv=require(_0x7c52('0xb'));var ejs=require(_0x7c52('0xc'));var fs=require('fs');var _=require(_0x7c52('0xd'));var squel=require(_0x7c52('0xe'));var crypto=require(_0x7c52('0xf'));var jsforce=require(_0x7c52('0x10'));var deskjs=require(_0x7c52('0x11'));var toCsv=require('to-csv');var querystring=require(_0x7c52('0x12'));var Papa=require(_0x7c52('0x13'));var Redis=require(_0x7c52('0x14'));var authService=require(_0x7c52('0x15'));var qs=require(_0x7c52('0x16'));var hardwareService=require(_0x7c52('0x17'));var logger=require(_0x7c52('0x18'))(_0x7c52('0x19'));var utils=require(_0x7c52('0x1a'));var config=require('../../config/environment');var db=require(_0x7c52('0x1b'))['db'];function respondWithStatusCode(_0x1be5e3,_0x481fb){_0x481fb=_0x481fb||0xcc;return function(_0x36b462){if(_0x36b462){return _0x1be5e3['sendStatus'](_0x481fb);}return _0x1be5e3[_0x7c52('0x1c')](_0x481fb)[_0x7c52('0x1d')]();};}function respondWithResult(_0x4eed78,_0x1c8fdd){_0x1c8fdd=_0x1c8fdd||0xc8;return function(_0x51e0e1){if(_0x51e0e1){return _0x4eed78['status'](_0x1c8fdd)[_0x7c52('0x1e')](_0x51e0e1);}};}function respondWithFilteredResult(_0x11032a,_0x33bd67){return function(_0x531f78){if(_0x531f78){var _0x79b3df=_0x531f78[_0x7c52('0x1f')],_0x3b92fc=_0x33bd67['offset'],_0x4fa232=_0x33bd67['offset']+_0x33bd67['limit'],_0x1ce0b5;if(_0x4fa232>=_0x79b3df){_0x4fa232=_0x79b3df;_0x1ce0b5=0xc8;}else{_0x1ce0b5=0xce;}_0x11032a[_0x7c52('0x1c')](_0x1ce0b5);return _0x11032a['set'](_0x7c52('0x20'),_0x3b92fc+'-'+_0x4fa232+'/'+_0x79b3df)['json'](_0x531f78);}return null;};}function patchUpdates(_0x946163){return function(_0x58e841){try{jsonpatch[_0x7c52('0x21')](_0x58e841,_0x946163,!![]);}catch(_0xcdd12f){return BPromise[_0x7c52('0x22')](_0xcdd12f);}return _0x58e841[_0x7c52('0x23')]();};}function saveUpdates(_0x34ff28,_0x2c1968){return function(_0x26c464){if(_0x26c464){return _0x26c464[_0x7c52('0x24')](_0x34ff28)[_0x7c52('0x25')](function(_0x5a4356){return _0x5a4356;});}return null;};}function removeEntity(_0xc3c836,_0x207c8f){return function(_0xae31bf){if(_0xae31bf){return _0xae31bf['destroy']()[_0x7c52('0x25')](function(){_0xc3c836[_0x7c52('0x1c')](0xcc)[_0x7c52('0x1d')]();});}};}function handleEntityNotFound(_0x948144,_0x96066e){return function(_0x525a16){if(!_0x525a16){_0x948144['sendStatus'](0x194);}return _0x525a16;};}function handleError(_0x6eba3d,_0x3f3f2c){_0x3f3f2c=_0x3f3f2c||0x1f4;return function(_0x57fcac){logger[_0x7c52('0x26')](_0x57fcac['stack']);if(_0x57fcac[_0x7c52('0x27')]){delete _0x57fcac[_0x7c52('0x27')];}_0x6eba3d[_0x7c52('0x1c')](_0x3f3f2c)['send'](_0x57fcac);};}exports[_0x7c52('0x28')]=function(_0x28e70f,_0x66a692){var _0x4a6cb9={},_0x4b23ad={},_0x5a7b90={'count':0x0,'rows':[]};var _0x3929be=db[_0x7c52('0x29')]['rawAttributes'];_0x4b23ad['model']=_[_0x7c52('0x2a')](_0x3929be);_0x4b23ad[_0x7c52('0x2b')]=_['keys'](_0x28e70f[_0x7c52('0x2b')]);_0x4b23ad[_0x7c52('0x2c')]=_[_0x7c52('0x2d')](_0x4b23ad['model'],_0x4b23ad[_0x7c52('0x2b')]);_0x4a6cb9[_0x7c52('0x2e')]=_[_0x7c52('0x2d')](_0x4b23ad['model'],qs[_0x7c52('0x2f')](_0x28e70f[_0x7c52('0x2b')][_0x7c52('0x2f')]));_0x4a6cb9[_0x7c52('0x2e')]=_0x4a6cb9[_0x7c52('0x2e')]['length']?_0x4a6cb9[_0x7c52('0x2e')]:_0x4b23ad[_0x7c52('0x30')];if(!_0x28e70f[_0x7c52('0x2b')][_0x7c52('0x31')](_0x7c52('0x32'))){_0x4a6cb9['limit']=qs['limit'](_0x28e70f[_0x7c52('0x2b')][_0x7c52('0x33')]);_0x4a6cb9[_0x7c52('0x34')]=qs[_0x7c52('0x34')](_0x28e70f[_0x7c52('0x2b')]['offset']);}_0x4a6cb9[_0x7c52('0x35')]=qs[_0x7c52('0x36')](_0x28e70f[_0x7c52('0x2b')][_0x7c52('0x36')]);_0x4a6cb9[_0x7c52('0x37')]=qs[_0x7c52('0x2c')](_[_0x7c52('0x38')](_0x28e70f['query'],_0x4b23ad[_0x7c52('0x2c')]));if(_0x28e70f[_0x7c52('0x2b')][_0x7c52('0x39')]){_0x4a6cb9[_0x7c52('0x37')]=_['merge'](_0x4a6cb9[_0x7c52('0x37')],{'$or':_[_0x7c52('0x3a')](_0x3929be,function(_0x2fff96){if(_0x2fff96[_0x7c52('0x3b')][_0x7c52('0x3c')]!==_0x7c52('0x3d')){var _0x8311a7={};_0x8311a7[_0x2fff96[_0x7c52('0x3e')]]={'$like':'%'+_0x28e70f['query'][_0x7c52('0x39')]+'%'};return _0x8311a7;}})});}_0x4a6cb9=_[_0x7c52('0x3f')]({},_0x4a6cb9,_0x28e70f[_0x7c52('0x40')]);var _0x3c2c94={'where':_0x4a6cb9[_0x7c52('0x37')]};return db['SquareDetailsReport'][_0x7c52('0x1f')](_0x3c2c94)[_0x7c52('0x25')](function(_0x8609fd){_0x5a7b90[_0x7c52('0x1f')]=_0x8609fd;if(_0x28e70f['query'][_0x7c52('0x41')]){_0x4a6cb9['include']=[{'all':!![]}];}return db[_0x7c52('0x29')][_0x7c52('0x42')](_0x4a6cb9);})[_0x7c52('0x25')](function(_0x13f28b){_0x5a7b90[_0x7c52('0x43')]=_0x13f28b;return _0x5a7b90;})[_0x7c52('0x25')](respondWithFilteredResult(_0x66a692,_0x4a6cb9))[_0x7c52('0x44')](handleError(_0x66a692,null));};exports[_0x7c52('0x45')]=function(_0xc8d2df,_0x9c61b1){var _0x1d3bc6={'raw':!![],'where':{'id':_0xc8d2df[_0x7c52('0x46')]['id']}},_0x51be9d={};_0x51be9d[_0x7c52('0x30')]=_[_0x7c52('0x2a')](db[_0x7c52('0x29')][_0x7c52('0x47')]);_0x51be9d['query']=_[_0x7c52('0x2a')](_0xc8d2df[_0x7c52('0x2b')]);_0x51be9d['filters']=_[_0x7c52('0x2d')](_0x51be9d[_0x7c52('0x30')],_0x51be9d['query']);_0x1d3bc6[_0x7c52('0x2e')]=_[_0x7c52('0x2d')](_0x51be9d[_0x7c52('0x30')],qs[_0x7c52('0x2f')](_0xc8d2df[_0x7c52('0x2b')]['fields']));_0x1d3bc6[_0x7c52('0x2e')]=_0x1d3bc6[_0x7c52('0x2e')][_0x7c52('0x48')]?_0x1d3bc6[_0x7c52('0x2e')]:_0x51be9d[_0x7c52('0x30')];if(_0xc8d2df[_0x7c52('0x2b')][_0x7c52('0x41')]){_0x1d3bc6[_0x7c52('0x49')]=[{'all':!![]}];}_0x1d3bc6=_[_0x7c52('0x3f')]({},_0x1d3bc6,_0xc8d2df[_0x7c52('0x40')]);return db['SquareDetailsReport'][_0x7c52('0x4a')](_0x1d3bc6)[_0x7c52('0x25')](handleEntityNotFound(_0x9c61b1,null))['then'](respondWithResult(_0x9c61b1,null))[_0x7c52('0x44')](handleError(_0x9c61b1,null));};exports[_0x7c52('0x4b')]=function(_0x2653c3,_0x294905){return db[_0x7c52('0x29')][_0x7c52('0x4b')](_0x2653c3[_0x7c52('0x4c')],{})[_0x7c52('0x25')](respondWithResult(_0x294905,0xc9))[_0x7c52('0x44')](handleError(_0x294905,null));};exports[_0x7c52('0x24')]=function(_0x2d8779,_0x1f01fd){if(_0x2d8779['body']['id']){delete _0x2d8779['body']['id'];}return db[_0x7c52('0x29')]['find']({'where':{'id':_0x2d8779[_0x7c52('0x46')]['id']}})[_0x7c52('0x25')](handleEntityNotFound(_0x1f01fd,null))[_0x7c52('0x25')](saveUpdates(_0x2d8779['body'],null))[_0x7c52('0x25')](respondWithResult(_0x1f01fd,null))[_0x7c52('0x44')](handleError(_0x1f01fd,null));};exports['destroy']=function(_0x30bb96,_0x4e7812){return db[_0x7c52('0x29')][_0x7c52('0x4a')]({'where':{'id':_0x30bb96[_0x7c52('0x46')]['id']}})[_0x7c52('0x25')](handleEntityNotFound(_0x4e7812,null))[_0x7c52('0x25')](removeEntity(_0x4e7812,null))['catch'](handleError(_0x4e7812,null));};exports['describe']=function(_0x1343b8,_0x2cd78a){return db[_0x7c52('0x29')][_0x7c52('0x4d')]()[_0x7c52('0x25')](respondWithResult(_0x2cd78a,null))['catch'](handleError(_0x2cd78a,null));}; \ No newline at end of file +var _0x0070=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','filter','map','key','VIRTUAL','field','merge','options','SquareDetailsReport','includeAll','include','findAll','rows','params','find','catch','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','crypto','jsforce'];(function(_0x37fde9,_0x381ce8){var _0x34f04d=function(_0x2fc9da){while(--_0x2fc9da){_0x37fde9['push'](_0x37fde9['shift']());}};_0x34f04d(++_0x381ce8);}(_0x0070,0x83));var _0x0007=function(_0x1156ce,_0x50f233){_0x1156ce=_0x1156ce-0x0;var _0x2b6d72=_0x0070[_0x1156ce];return _0x2b6d72;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0007('0x0'));var rimraf=require(_0x0007('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0007('0x2'));var rp=require(_0x0007('0x3'));var moment=require(_0x0007('0x4'));var BPromise=require(_0x0007('0x5'));var Mustache=require('mustache');var util=require(_0x0007('0x6'));var path=require(_0x0007('0x7'));var sox=require(_0x0007('0x8'));var csv=require(_0x0007('0x9'));var ejs=require(_0x0007('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x0007('0xb'));var jsforce=require(_0x0007('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0007('0xd'));var Redis=require(_0x0007('0xe'));var authService=require(_0x0007('0xf'));var qs=require(_0x0007('0x10'));var hardwareService=require(_0x0007('0x11'));var logger=require(_0x0007('0x12'))(_0x0007('0x13'));var utils=require('../../config/utils');var config=require(_0x0007('0x14'));var db=require(_0x0007('0x15'))['db'];function respondWithStatusCode(_0x3a97bf,_0x342fe2){_0x342fe2=_0x342fe2||0xcc;return function(_0x584c99){if(_0x584c99){return _0x3a97bf[_0x0007('0x16')](_0x342fe2);}return _0x3a97bf['status'](_0x342fe2)[_0x0007('0x17')]();};}function respondWithResult(_0x4c712b,_0x423499){_0x423499=_0x423499||0xc8;return function(_0x995b95){if(_0x995b95){return _0x4c712b[_0x0007('0x18')](_0x423499)[_0x0007('0x19')](_0x995b95);}};}function respondWithFilteredResult(_0x50458e,_0x5c1128){return function(_0x45b29f){if(_0x45b29f){var _0x4875a0=_0x45b29f[_0x0007('0x1a')],_0x623a0c=_0x5c1128[_0x0007('0x1b')],_0x98dc70=_0x5c1128['offset']+_0x5c1128['limit'],_0x30acc1;if(_0x98dc70>=_0x4875a0){_0x98dc70=_0x4875a0;_0x30acc1=0xc8;}else{_0x30acc1=0xce;}_0x50458e[_0x0007('0x18')](_0x30acc1);return _0x50458e[_0x0007('0x1c')](_0x0007('0x1d'),_0x623a0c+'-'+_0x98dc70+'/'+_0x4875a0)['json'](_0x45b29f);}return null;};}function patchUpdates(_0x16e33e){return function(_0x5d5e55){try{jsonpatch[_0x0007('0x1e')](_0x5d5e55,_0x16e33e,!![]);}catch(_0x416471){return BPromise[_0x0007('0x1f')](_0x416471);}return _0x5d5e55[_0x0007('0x20')]();};}function saveUpdates(_0x434443,_0x1a30ee){return function(_0x4c5e7d){if(_0x4c5e7d){return _0x4c5e7d['update'](_0x434443)[_0x0007('0x21')](function(_0x246250){return _0x246250;});}return null;};}function removeEntity(_0x8ad7c6,_0x4ee190){return function(_0x317ae8){if(_0x317ae8){return _0x317ae8[_0x0007('0x22')]()[_0x0007('0x21')](function(){_0x8ad7c6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xf4c61c,_0x50e33e){return function(_0x16ddc4){if(!_0x16ddc4){_0xf4c61c[_0x0007('0x16')](0x194);}return _0x16ddc4;};}function handleError(_0x13005c,_0x2901d1){_0x2901d1=_0x2901d1||0x1f4;return function(_0x1cf8bb){logger[_0x0007('0x23')](_0x1cf8bb[_0x0007('0x24')]);if(_0x1cf8bb[_0x0007('0x25')]){delete _0x1cf8bb[_0x0007('0x25')];}_0x13005c[_0x0007('0x18')](_0x2901d1)[_0x0007('0x26')](_0x1cf8bb);};}exports[_0x0007('0x27')]=function(_0x2bb139,_0x51cfb1){var _0x3e1f6c={},_0x4be394={},_0xa4187f={'count':0x0,'rows':[]};var _0x3a8115=db['SquareDetailsReport'][_0x0007('0x28')];_0x4be394[_0x0007('0x29')]=_['keys'](_0x3a8115);_0x4be394[_0x0007('0x2a')]=_[_0x0007('0x2b')](_0x2bb139[_0x0007('0x2a')]);_0x4be394[_0x0007('0x2c')]=_[_0x0007('0x2d')](_0x4be394[_0x0007('0x29')],_0x4be394[_0x0007('0x2a')]);_0x3e1f6c['attributes']=_[_0x0007('0x2d')](_0x4be394[_0x0007('0x29')],qs['fields'](_0x2bb139['query'][_0x0007('0x2e')]));_0x3e1f6c[_0x0007('0x2f')]=_0x3e1f6c[_0x0007('0x2f')][_0x0007('0x30')]?_0x3e1f6c[_0x0007('0x2f')]:_0x4be394[_0x0007('0x29')];if(!_0x2bb139[_0x0007('0x2a')][_0x0007('0x31')]('nolimit')){_0x3e1f6c[_0x0007('0x32')]=qs['limit'](_0x2bb139[_0x0007('0x2a')][_0x0007('0x32')]);_0x3e1f6c[_0x0007('0x1b')]=qs['offset'](_0x2bb139[_0x0007('0x2a')]['offset']);}_0x3e1f6c[_0x0007('0x33')]=qs[_0x0007('0x34')](_0x2bb139[_0x0007('0x2a')][_0x0007('0x34')]);_0x3e1f6c[_0x0007('0x35')]=qs['filters'](_['pick'](_0x2bb139[_0x0007('0x2a')],_0x4be394[_0x0007('0x2c')]));if(_0x2bb139[_0x0007('0x2a')][_0x0007('0x36')]){_0x3e1f6c[_0x0007('0x35')]=_['merge'](_0x3e1f6c[_0x0007('0x35')],{'$or':_[_0x0007('0x37')](_0x3a8115,function(_0x5b02c4){if(_0x5b02c4['type'][_0x0007('0x38')]!==_0x0007('0x39')){var _0x5708cf={};_0x5708cf[_0x5b02c4[_0x0007('0x3a')]]={'$like':'%'+_0x2bb139[_0x0007('0x2a')][_0x0007('0x36')]+'%'};return _0x5708cf;}})});}_0x3e1f6c=_[_0x0007('0x3b')]({},_0x3e1f6c,_0x2bb139[_0x0007('0x3c')]);var _0x3f6573={'where':_0x3e1f6c[_0x0007('0x35')]};return db[_0x0007('0x3d')][_0x0007('0x1a')](_0x3f6573)[_0x0007('0x21')](function(_0x346071){_0xa4187f[_0x0007('0x1a')]=_0x346071;if(_0x2bb139[_0x0007('0x2a')][_0x0007('0x3e')]){_0x3e1f6c[_0x0007('0x3f')]=[{'all':!![]}];}return db['SquareDetailsReport'][_0x0007('0x40')](_0x3e1f6c);})[_0x0007('0x21')](function(_0x58d6fe){_0xa4187f[_0x0007('0x41')]=_0x58d6fe;return _0xa4187f;})['then'](respondWithFilteredResult(_0x51cfb1,_0x3e1f6c))['catch'](handleError(_0x51cfb1,null));};exports['show']=function(_0x5b44f8,_0x19329d){var _0x318319={'raw':!![],'where':{'id':_0x5b44f8[_0x0007('0x42')]['id']}},_0x6b67c6={};_0x6b67c6['model']=_[_0x0007('0x2b')](db['SquareDetailsReport']['rawAttributes']);_0x6b67c6[_0x0007('0x2a')]=_['keys'](_0x5b44f8['query']);_0x6b67c6['filters']=_['intersection'](_0x6b67c6[_0x0007('0x29')],_0x6b67c6['query']);_0x318319['attributes']=_['intersection'](_0x6b67c6[_0x0007('0x29')],qs[_0x0007('0x2e')](_0x5b44f8[_0x0007('0x2a')][_0x0007('0x2e')]));_0x318319[_0x0007('0x2f')]=_0x318319[_0x0007('0x2f')][_0x0007('0x30')]?_0x318319['attributes']:_0x6b67c6['model'];if(_0x5b44f8[_0x0007('0x2a')][_0x0007('0x3e')]){_0x318319['include']=[{'all':!![]}];}_0x318319=_['merge']({},_0x318319,_0x5b44f8['options']);return db[_0x0007('0x3d')][_0x0007('0x43')](_0x318319)[_0x0007('0x21')](handleEntityNotFound(_0x19329d,null))[_0x0007('0x21')](respondWithResult(_0x19329d,null))[_0x0007('0x44')](handleError(_0x19329d,null));};exports[_0x0007('0x45')]=function(_0x460061,_0x45f0c2){return db[_0x0007('0x3d')][_0x0007('0x45')](_0x460061[_0x0007('0x46')],{})['then'](respondWithResult(_0x45f0c2,0xc9))['catch'](handleError(_0x45f0c2,null));};exports['update']=function(_0x3a2d69,_0x10734e){if(_0x3a2d69[_0x0007('0x46')]['id']){delete _0x3a2d69[_0x0007('0x46')]['id'];}return db['SquareDetailsReport']['find']({'where':{'id':_0x3a2d69['params']['id']}})[_0x0007('0x21')](handleEntityNotFound(_0x10734e,null))['then'](saveUpdates(_0x3a2d69[_0x0007('0x46')],null))[_0x0007('0x21')](respondWithResult(_0x10734e,null))[_0x0007('0x44')](handleError(_0x10734e,null));};exports[_0x0007('0x22')]=function(_0x105512,_0x9df5ab){return db[_0x0007('0x3d')][_0x0007('0x43')]({'where':{'id':_0x105512[_0x0007('0x42')]['id']}})[_0x0007('0x21')](handleEntityNotFound(_0x9df5ab,null))[_0x0007('0x21')](removeEntity(_0x9df5ab,null))[_0x0007('0x44')](handleError(_0x9df5ab,null));};exports[_0x0007('0x47')]=function(_0x4c7c0b,_0x18fda6){return db[_0x0007('0x3d')][_0x0007('0x47')]()[_0x0007('0x21')](respondWithResult(_0x18fda6,null))[_0x0007('0x44')](handleError(_0x18fda6,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 5a8873c..96e9341 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 _0xecb2=['rimraf','../../config/environment','./squareReportDetail.attributes','exports','SquareDetailsReport','report_square_details','lodash','api','request-promise','path'];(function(_0x28fd74,_0x57640e){var _0x57603e=function(_0x49ae11){while(--_0x49ae11){_0x28fd74['push'](_0x28fd74['shift']());}};_0x57603e(++_0x57640e);}(_0xecb2,0xf6));var _0x2ecb=function(_0xefc4e6,_0x1f104e){_0xefc4e6=_0xefc4e6-0x0;var _0x50a77a=_0xecb2[_0xefc4e6];return _0x50a77a;};'use strict';var _=require(_0x2ecb('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2ecb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2ecb('0x2'));var fs=require('fs');var path=require(_0x2ecb('0x3'));var rimraf=require(_0x2ecb('0x4'));var config=require(_0x2ecb('0x5'));var attributes=require(_0x2ecb('0x6'));module[_0x2ecb('0x7')]=function(_0x4c169f,_0x51b28c){return _0x4c169f['define'](_0x2ecb('0x8'),attributes,{'tableName':_0x2ecb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1751=['../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x1bf1f3,_0x714953){var _0x1ccfc9=function(_0x1a8109){while(--_0x1a8109){_0x1bf1f3['push'](_0x1bf1f3['shift']());}};_0x1ccfc9(++_0x714953);}(_0x1751,0x76));var _0x1175=function(_0x13e7a2,_0x3cc77b){_0x13e7a2=_0x13e7a2-0x0;var _0x1eee9f=_0x1751[_0x13e7a2];return _0x1eee9f;};'use strict';var _=require(_0x1175('0x0'));var util=require(_0x1175('0x1'));var logger=require(_0x1175('0x2'))(_0x1175('0x3'));var moment=require('moment');var BPromise=require(_0x1175('0x4'));var rp=require(_0x1175('0x5'));var fs=require('fs');var path=require(_0x1175('0x6'));var rimraf=require(_0x1175('0x7'));var config=require(_0x1175('0x8'));var attributes=require(_0x1175('0x9'));module[_0x1175('0xa')]=function(_0x171756,_0x3f99ca){return _0x171756[_0x1175('0xb')](_0x1175('0xc'),attributes,{'tableName':_0x1175('0xd'),'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 f2c0812..fb129b1 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 _0x93bb=['message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x1c742e,_0x3cf01a){var _0x3a6a81=function(_0x5e050e){while(--_0x5e050e){_0x1c742e['push'](_0x1c742e['shift']());}};_0x3a6a81(++_0x3cf01a);}(_0x93bb,0x135));var _0xb93b=function(_0x26c85e,_0x56e188){_0x26c85e=_0x26c85e-0x0;var _0x182d50=_0x93bb[_0x26c85e];return _0x182d50;};'use strict';var _=require(_0xb93b('0x0'));var util=require(_0xb93b('0x1'));var moment=require(_0xb93b('0x2'));var BPromise=require(_0xb93b('0x3'));var rs=require(_0xb93b('0x4'));var fs=require('fs');var Redis=require(_0xb93b('0x5'));var db=require(_0xb93b('0x6'))['db'];var utils=require(_0xb93b('0x7'));var logger=require(_0xb93b('0x8'))(_0xb93b('0x9'));var config=require('../../config/environment');var jayson=require(_0xb93b('0xa'));var client=jayson[_0xb93b('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c4dcf,_0x2c27ca,_0x516b0b){return new BPromise(function(_0x35c135,_0x455cb2){return client[_0xb93b('0xc')](_0x3c4dcf,_0x516b0b)[_0xb93b('0xd')](function(_0x1c9b11){logger[_0xb93b('0xe')](_0xb93b('0xf'),_0x2c27ca,_0xb93b('0x10'));logger[_0xb93b('0x11')](_0xb93b('0x12'),_0x2c27ca,_0xb93b('0x10'),JSON['stringify'](_0x1c9b11));if(_0x1c9b11[_0xb93b('0x13')]){if(_0x1c9b11[_0xb93b('0x13')][_0xb93b('0x14')]===0x1f4){logger[_0xb93b('0x13')]('SquareDetailsReport,\x20%s,\x20%s',_0x2c27ca,_0x1c9b11[_0xb93b('0x13')][_0xb93b('0x15')]);return _0x455cb2(_0x1c9b11[_0xb93b('0x13')][_0xb93b('0x15')]);}logger[_0xb93b('0x13')](_0xb93b('0xf'),_0x2c27ca,_0x1c9b11[_0xb93b('0x13')]['message']);return _0x35c135(_0x1c9b11[_0xb93b('0x13')][_0xb93b('0x15')]);}else{logger[_0xb93b('0xe')](_0xb93b('0xf'),_0x2c27ca,_0xb93b('0x10'));_0x35c135(_0x1c9b11[_0xb93b('0x16')]['message']);}})[_0xb93b('0x17')](function(_0x5ee3c4){logger[_0xb93b('0x13')](_0xb93b('0xf'),_0x2c27ca,_0x5ee3c4);_0x455cb2(_0x5ee3c4);});});}exports[_0xb93b('0x18')]=function(_0x11f85b){var _0x1a0eec=this;return new Promise(function(_0x385100,_0x5165b2){return db[_0xb93b('0x19')][_0xb93b('0x1a')](_0x11f85b[_0xb93b('0x1b')],{'raw':_0x11f85b[_0xb93b('0x1c')]?_0x11f85b[_0xb93b('0x1c')][_0xb93b('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x57adc7){logger['info']('CreateSquareDetailsReport',_0x11f85b);logger[_0xb93b('0x11')]('CreateSquareDetailsReport',_0x11f85b,JSON['stringify'](_0x57adc7));_0x385100(_0x57adc7);})[_0xb93b('0x17')](function(_0x3e57aa){logger[_0xb93b('0x13')]('CreateSquareDetailsReport',_0x3e57aa[_0xb93b('0x15')],_0x11f85b);_0x5165b2(_0x1a0eec[_0xb93b('0x13')](0x1f4,_0x3e57aa['message']));});});}; \ No newline at end of file +var _0xeedf=['request\x20sent','debug','stringify','error','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','then','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','info','SquareDetailsReport,\x20%s,\x20%s'];(function(_0x5387d5,_0x522081){var _0x9ad451=function(_0x11140e){while(--_0x11140e){_0x5387d5['push'](_0x5387d5['shift']());}};_0x9ad451(++_0x522081);}(_0xeedf,0x12c));var _0xfeed=function(_0x5b3740,_0x52f2ea){_0x5b3740=_0x5b3740-0x0;var _0x3e1010=_0xeedf[_0x5b3740];return _0x3e1010;};'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});function respondWithRpcPromise(_0x19f2de,_0x52286c,_0x22fd66){return new BPromise(function(_0x5c147d,_0x124bdf){return client['request'](_0x19f2de,_0x22fd66)['then'](function(_0x5163e7){logger[_0xfeed('0xa')](_0xfeed('0xb'),_0x52286c,_0xfeed('0xc'));logger[_0xfeed('0xd')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x52286c,_0xfeed('0xc'),JSON[_0xfeed('0xe')](_0x5163e7));if(_0x5163e7[_0xfeed('0xf')]){if(_0x5163e7[_0xfeed('0xf')]['code']===0x1f4){logger['error'](_0xfeed('0xb'),_0x52286c,_0x5163e7[_0xfeed('0xf')][_0xfeed('0x10')]);return _0x124bdf(_0x5163e7[_0xfeed('0xf')][_0xfeed('0x10')]);}logger[_0xfeed('0xf')]('SquareDetailsReport,\x20%s,\x20%s',_0x52286c,_0x5163e7[_0xfeed('0xf')][_0xfeed('0x10')]);return _0x5c147d(_0x5163e7[_0xfeed('0xf')][_0xfeed('0x10')]);}else{logger[_0xfeed('0xa')](_0xfeed('0xb'),_0x52286c,_0xfeed('0xc'));_0x5c147d(_0x5163e7[_0xfeed('0x11')][_0xfeed('0x10')]);}})[_0xfeed('0x12')](function(_0x17eb91){logger[_0xfeed('0xf')](_0xfeed('0xb'),_0x52286c,_0x17eb91);_0x124bdf(_0x17eb91);});});}exports[_0xfeed('0x13')]=function(_0x55a68d){var _0x3e5bdb=this;return new Promise(function(_0x2cd566,_0x1acdd7){return db[_0xfeed('0x14')][_0xfeed('0x15')](_0x55a68d[_0xfeed('0x16')],{'raw':_0x55a68d[_0xfeed('0x17')]?_0x55a68d[_0xfeed('0x17')][_0xfeed('0x18')]===undefined?!![]:![]:!![]})[_0xfeed('0x19')](function(_0x4f8e36){logger[_0xfeed('0xa')](_0xfeed('0x13'),_0x55a68d);logger[_0xfeed('0xd')]('CreateSquareDetailsReport',_0x55a68d,JSON[_0xfeed('0xe')](_0x4f8e36));_0x2cd566(_0x4f8e36);})[_0xfeed('0x12')](function(_0x322852){logger[_0xfeed('0xf')](_0xfeed('0x13'),_0x322852[_0xfeed('0x10')],_0x55a68d);_0x1acdd7(_0x3e5bdb[_0xfeed('0xf')](0x1f4,_0x322852[_0xfeed('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index cb996ac..f70eba9 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 _0xa417=['/process/:pid/kill','killProcess','express','Router','../../components/auth/service','./system.controller','isAuthenticated','index','get'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0xa417,0x119));var _0x7a41=function(_0x4923ad,_0x1d11b3){_0x4923ad=_0x4923ad-0x0;var _0x4203ca=_0xa417[_0x4923ad];return _0x4203ca;};'use strict';var express=require(_0x7a41('0x0'));var router=express[_0x7a41('0x1')]();var auth=require(_0x7a41('0x2'));var controller=require(_0x7a41('0x3'));router['get']('/',auth[_0x7a41('0x4')](),controller[_0x7a41('0x5')]);router[_0x7a41('0x6')](_0x7a41('0x7'),auth[_0x7a41('0x4')](),controller[_0x7a41('0x8')]);module['exports']=router; \ No newline at end of file +var _0x49a1=['./system.controller','get','isAuthenticated','index','/process/:pid/kill','killProcess','exports','express','../../components/auth/service'];(function(_0x4e783c,_0x51a362){var _0x2fbd6d=function(_0x513e00){while(--_0x513e00){_0x4e783c['push'](_0x4e783c['shift']());}};_0x2fbd6d(++_0x51a362);}(_0x49a1,0xcd));var _0x149a=function(_0x34cd03,_0x22d586){_0x34cd03=_0x34cd03-0x0;var _0x3d1fed=_0x49a1[_0x34cd03];return _0x3d1fed;};'use strict';var express=require(_0x149a('0x0'));var router=express['Router']();var auth=require(_0x149a('0x1'));var controller=require(_0x149a('0x2'));router[_0x149a('0x3')]('/',auth[_0x149a('0x4')](),controller[_0x149a('0x5')]);router[_0x149a('0x3')](_0x149a('0x6'),auth[_0x149a('0x4')](),controller[_0x149a('0x7')]);module[_0x149a('0x8')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index cfc0f7b..1d76cb5 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 _0x90ff=['Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','api','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','status','send','then','json','catch','killProcess','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','indexOf','format','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT'];(function(_0x28beb1,_0x29c4fb){var _0x3b560f=function(_0x3afd21){while(--_0x3afd21){_0x28beb1['push'](_0x28beb1['shift']());}};_0x3b560f(++_0x29c4fb);}(_0x90ff,0xa3));var _0xf90f=function(_0x3f1e44,_0x4c00ad){_0x3f1e44=_0x3f1e44-0x0;var _0x20b6a5=_0x90ff[_0x3f1e44];return _0x20b6a5;};'use strict';var info=require(_0xf90f('0x0'));var exec=require(_0xf90f('0x1'))[_0xf90f('0x2')];var logger=require('../../config/logger')(_0xf90f('0x3'));var util=require('util');var BPromise=require(_0xf90f('0x4'));var _=require(_0xf90f('0x5'));function handleError(_0x583ef4,_0x52afa7,_0x3f6f74){_0x52afa7=_0x52afa7||0x1f4;return function(_0x301b5f){logger[_0xf90f('0x6')](_0xf90f('0x7'),_0x3f6f74,_0x52afa7,util['inspect'](_0x301b5f,{'showHidden':![],'depth':null}));delete _0x301b5f[_0xf90f('0x8')];_0x583ef4[_0xf90f('0x9')](_0x52afa7)[_0xf90f('0xa')](_0x301b5f);};}exports['index']=function(_0x12c618,_0x212522){return info['getAllData']()[_0xf90f('0xb')](function(_0x4fe725){return _0x212522[_0xf90f('0x9')](0xc8)[_0xf90f('0xc')](_0x4fe725);})[_0xf90f('0xd')](function(_0x1acdf3){return _0x212522[_0xf90f('0x9')](0x1f4)['json'](_0x1acdf3);});};exports[_0xf90f('0xe')]=function(_0x190921,_0x305ba9){var _0x4b397a=[_0xf90f('0xf')];return new BPromise(function(_0x19720f,_0x2a2213){return exec(util['format'](_0xf90f('0x10'),_0x190921[_0xf90f('0x11')][_0xf90f('0x12')]),function(_0x112cf9,_0x24d28c,_0x5ad2f0){if(_0x112cf9){return _0x2a2213(_0x112cf9);}return _0x19720f(_0x24d28c);});})[_0xf90f('0xb')](function(_0x181167){var _0x2fb3c7=![];var _0x1f76f9=_0x181167[_0xf90f('0x13')](/\n/);for(var _0x340ee2=0x0,_0x59fbf4=_0x4b397a[_0xf90f('0x14')];_0x340ee2<_0x59fbf4,_0x2fb3c7===![];_0x340ee2+=0x1){if(_0x181167[_0xf90f('0x15')](_0x4b397a[_0x340ee2])>=0x0){_0x2fb3c7=!![];}}if(!_0x2fb3c7){throw new Error(util[_0xf90f('0x16')](_0xf90f('0x17'),_0x190921['params']['pid']));}process[_0xf90f('0x18')](_0x190921[_0xf90f('0x11')][_0xf90f('0x12')],_0xf90f('0x19'));return _0x305ba9['status'](0xc8)[_0xf90f('0xc')]({'message':util['format'](_0xf90f('0x1a'),_0x190921[_0xf90f('0x11')][_0xf90f('0x12')])});})[_0xf90f('0xd')](handleError(_0x305ba9,null,'killProcess'));}; \ No newline at end of file +var _0xaabd=['send','index','getAllData','then','catch','json','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','status'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaabd,0x1c1));var _0xdaab=function(_0x5bf493,_0x3c46bf){_0x5bf493=_0x5bf493-0x0;var _0x5e69b1=_0xaabd[_0x5bf493];return _0x5e69b1;};'use strict';var info=require(_0xdaab('0x0'));var exec=require(_0xdaab('0x1'))[_0xdaab('0x2')];var logger=require('../../config/logger')('api');var util=require(_0xdaab('0x3'));var BPromise=require(_0xdaab('0x4'));var _=require(_0xdaab('0x5'));function handleError(_0x191632,_0x47c5f1,_0x1b46f4){_0x47c5f1=_0x47c5f1||0x1f4;return function(_0x4fcaba){logger[_0xdaab('0x6')](_0xdaab('0x7'),_0x1b46f4,_0x47c5f1,util['inspect'](_0x4fcaba,{'showHidden':![],'depth':null}));delete _0x4fcaba[_0xdaab('0x8')];_0x191632[_0xdaab('0x9')](_0x47c5f1)[_0xdaab('0xa')](_0x4fcaba);};}exports[_0xdaab('0xb')]=function(_0x3b5893,_0x18479d){return info[_0xdaab('0xc')]()[_0xdaab('0xd')](function(_0x377a18){return _0x18479d['status'](0xc8)['json'](_0x377a18);})[_0xdaab('0xe')](function(_0x279bd5){return _0x18479d[_0xdaab('0x9')](0x1f4)[_0xdaab('0xf')](_0x279bd5);});};exports[_0xdaab('0x10')]=function(_0xb38986,_0x2a8f64){var _0x19dbbd=[_0xdaab('0x11')];return new BPromise(function(_0x159a3b,_0x128a07){return exec(util[_0xdaab('0x12')](_0xdaab('0x13'),_0xb38986[_0xdaab('0x14')]['pid']),function(_0xe0acd7,_0x51ac45,_0x4a7f3a){if(_0xe0acd7){return _0x128a07(_0xe0acd7);}return _0x159a3b(_0x51ac45);});})['then'](function(_0x128e80){var _0x317a84=![];var _0x32c63c=_0x128e80[_0xdaab('0x15')](/\n/);for(var _0x956c0b=0x0,_0x17bc1c=_0x19dbbd['length'];_0x956c0b<_0x17bc1c,_0x317a84===![];_0x956c0b+=0x1){if(_0x128e80[_0xdaab('0x16')](_0x19dbbd[_0x956c0b])>=0x0){_0x317a84=!![];}}if(!_0x317a84){throw new Error(util['format'](_0xdaab('0x17'),_0xb38986['params'][_0xdaab('0x18')]));}process['kill'](_0xb38986['params'][_0xdaab('0x18')],_0xdaab('0x19'));return _0x2a8f64[_0xdaab('0x9')](0xc8)[_0xdaab('0xf')]({'message':util[_0xdaab('0x12')](_0xdaab('0x1a'),_0xb38986['params'][_0xdaab('0x18')])});})[_0xdaab('0xe')](handleError(_0x2a8f64,null,_0xdaab('0x10')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 10491a8..d55d92c 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 _0x4fc2=['./tag.controller','get','index','isAuthenticated','show','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x58bc0c,_0x2d520e){var _0xeccdd2=function(_0x1306fa){while(--_0x1306fa){_0x58bc0c['push'](_0x58bc0c['shift']());}};_0xeccdd2(++_0x2d520e);}(_0x4fc2,0x111));var _0x24fc=function(_0x514038,_0x450ef3){_0x514038=_0x514038-0x0;var _0x589720=_0x4fc2[_0x514038];return _0x589720;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var auth=require(_0x24fc('0x5'));var interaction=require(_0x24fc('0x6'));var config=require('../../config/environment');var controller=require(_0x24fc('0x7'));router[_0x24fc('0x8')]('/',auth['isAuthenticated'](),controller[_0x24fc('0x9')]);router[_0x24fc('0x8')]('/:id',auth[_0x24fc('0xa')](),controller[_0x24fc('0xb')]);router[_0x24fc('0xc')]('/',auth[_0x24fc('0xa')](),controller[_0x24fc('0xd')]);router[_0x24fc('0xe')]('/:id',auth[_0x24fc('0xa')](),controller[_0x24fc('0xf')]);router[_0x24fc('0x10')](_0x24fc('0x11'),auth[_0x24fc('0xa')](),controller[_0x24fc('0x12')]);module[_0x24fc('0x13')]=router; \ No newline at end of file +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(_0x362d16,_0x31c1a2){var _0x5596de=function(_0x3e588b){while(--_0x3e588b){_0x362d16['push'](_0x362d16['shift']());}};_0x5596de(++_0x31c1a2);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'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 diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 971cfce..bca3f5e 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 _0x9b66=['sequelize','exports','name','STRING'];(function(_0x1c3c88,_0x56500d){var _0x5065b9=function(_0x3aea5b){while(--_0x3aea5b){_0x1c3c88['push'](_0x1c3c88['shift']());}};_0x5065b9(++_0x56500d);}(_0x9b66,0x160));var _0x69b6=function(_0x81da2b,_0x55ee75){_0x81da2b=_0x81da2b-0x0;var _0x45ca7b=_0x9b66[_0x81da2b];return _0x45ca7b;};'use strict';var Sequelize=require(_0x69b6('0x0'));module[_0x69b6('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x69b6('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x69b6('0x3')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0x69b6('0x3')]}}; \ No newline at end of file +var _0xf007=['sequelize','exports','STRING','#0091EA'];(function(_0x43a9bf,_0xc0cff7){var _0x8013f=function(_0x281c85){while(--_0x281c85){_0x43a9bf['push'](_0x43a9bf['shift']());}};_0x8013f(++_0xc0cff7);}(_0xf007,0xf0));var _0x7f00=function(_0x269fba,_0xa68777){_0x269fba=_0x269fba-0x0;var _0x1eeb74=_0xf007[_0x269fba];return _0x1eeb74;};'use strict';var Sequelize=require(_0x7f00('0x0'));module[_0x7f00('0x1')]={'name':{'type':Sequelize[_0x7f00('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x7f00('0x2')],'defaultValue':_0x7f00('0x3')},'description':{'type':Sequelize[_0x7f00('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index bc8d0fa..a3d1d94 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 _0x1280=['field','filter','options','count','includeAll','include','rows','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','set','apply','update','then','destroy','get','Tags','error','stack','name','send','index','Tag','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','map','type','key','VIRTUAL'];(function(_0x5c6c95,_0x21b9dd){var _0x35f425=function(_0x454462){while(--_0x454462){_0x5c6c95['push'](_0x5c6c95['shift']());}};_0x35f425(++_0x21b9dd);}(_0x1280,0xba));var _0x0128=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0x1280[_0x1b7368];return _0x25d54c;};'use strict';var pdf=require(_0x0128('0x0'));var emlformat=require(_0x0128('0x1'));var rimraf=require(_0x0128('0x2'));var zipdir=require(_0x0128('0x3'));var jsonpatch=require(_0x0128('0x4'));var rp=require(_0x0128('0x5'));var moment=require(_0x0128('0x6'));var BPromise=require(_0x0128('0x7'));var Mustache=require(_0x0128('0x8'));var util=require('util');var path=require(_0x0128('0x9'));var sox=require(_0x0128('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x0128('0xb'));var squel=require(_0x0128('0xc'));var crypto=require(_0x0128('0xd'));var jsforce=require(_0x0128('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0128('0xf'));var Papa=require(_0x0128('0x10'));var Redis=require('ioredis');var authService=require(_0x0128('0x11'));var qs=require(_0x0128('0x12'));var hardwareService=require(_0x0128('0x13'));var logger=require('../../config/logger')(_0x0128('0x14'));var utils=require(_0x0128('0x15'));var config=require(_0x0128('0x16'));var db=require(_0x0128('0x17'))['db'];function respondWithStatusCode(_0x36e4f6,_0x3459bc){_0x3459bc=_0x3459bc||0xcc;return function(_0xa4d9af){if(_0xa4d9af){return _0x36e4f6[_0x0128('0x18')](_0x3459bc);}return _0x36e4f6['status'](_0x3459bc)[_0x0128('0x19')]();};}function respondWithResult(_0x53af5d,_0x4d3c1e){_0x4d3c1e=_0x4d3c1e||0xc8;return function(_0x3ee065){if(_0x3ee065){return _0x53af5d[_0x0128('0x1a')](_0x4d3c1e)[_0x0128('0x1b')](_0x3ee065);}};}function respondWithFilteredResult(_0x2a954f,_0x43539a){return function(_0x4fd99f){if(_0x4fd99f){var _0x247f8b=_0x4fd99f['count'],_0x2b4c26=_0x43539a['offset'],_0x35106a=_0x43539a[_0x0128('0x1c')]+_0x43539a[_0x0128('0x1d')],_0x5098cd;if(_0x35106a>=_0x247f8b){_0x35106a=_0x247f8b;_0x5098cd=0xc8;}else{_0x5098cd=0xce;}_0x2a954f[_0x0128('0x1a')](_0x5098cd);return _0x2a954f[_0x0128('0x1e')]('Content-Range',_0x2b4c26+'-'+_0x35106a+'/'+_0x247f8b)['json'](_0x4fd99f);}return null;};}function patchUpdates(_0x140ee6){return function(_0xdc1ed7){try{jsonpatch[_0x0128('0x1f')](_0xdc1ed7,_0x140ee6,!![]);}catch(_0x11f76e){return BPromise['reject'](_0x11f76e);}return _0xdc1ed7['save']();};}function saveUpdates(_0xc3a962,_0x2c1a5e){return function(_0x283ca2){if(_0x283ca2){return _0x283ca2[_0x0128('0x20')](_0xc3a962)[_0x0128('0x21')](function(_0x5753b4){return _0x5753b4;});}return null;};}function removeEntity(_0x4580fe,_0x1b47ee){return function(_0x1f4391){if(_0x1f4391){return _0x1f4391[_0x0128('0x22')]()[_0x0128('0x21')](function(){var _0x333f54=_0x1f4391[_0x0128('0x23')]({'plain':!![]});var _0x75054e=_0x0128('0x24');return db['UserProfileResource'][_0x0128('0x22')]({'where':{'type':_0x75054e,'resourceId':_0x333f54['id']}})['then'](function(){return _0x1f4391;});})[_0x0128('0x21')](function(){_0x4580fe['status'](0xcc)[_0x0128('0x19')]();});}};}function handleEntityNotFound(_0x175a21,_0x3ad8a9){return function(_0x132fa2){if(!_0x132fa2){_0x175a21[_0x0128('0x18')](0x194);}return _0x132fa2;};}function handleError(_0x13c5ff,_0x270dc8){_0x270dc8=_0x270dc8||0x1f4;return function(_0x22fb36){logger[_0x0128('0x25')](_0x22fb36[_0x0128('0x26')]);if(_0x22fb36[_0x0128('0x27')]){delete _0x22fb36[_0x0128('0x27')];}_0x13c5ff['status'](_0x270dc8)[_0x0128('0x28')](_0x22fb36);};}exports[_0x0128('0x29')]=function(_0x197580,_0x11f7c5){var _0x4d21c7={},_0x3bf940={},_0x4db631={'count':0x0,'rows':[]};var _0x8f11e4=db[_0x0128('0x2a')][_0x0128('0x2b')];_0x3bf940[_0x0128('0x2c')]=_[_0x0128('0x2d')](_0x8f11e4);_0x3bf940[_0x0128('0x2e')]=_[_0x0128('0x2d')](_0x197580[_0x0128('0x2e')]);_0x3bf940['filters']=_[_0x0128('0x2f')](_0x3bf940[_0x0128('0x2c')],_0x3bf940[_0x0128('0x2e')]);_0x4d21c7[_0x0128('0x30')]=_['intersection'](_0x3bf940['model'],qs[_0x0128('0x31')](_0x197580[_0x0128('0x2e')][_0x0128('0x31')]));_0x4d21c7[_0x0128('0x30')]=_0x4d21c7[_0x0128('0x30')][_0x0128('0x32')]?_0x4d21c7[_0x0128('0x30')]:_0x3bf940[_0x0128('0x2c')];if(!_0x197580[_0x0128('0x2e')][_0x0128('0x33')](_0x0128('0x34'))){_0x4d21c7[_0x0128('0x1d')]=qs[_0x0128('0x1d')](_0x197580[_0x0128('0x2e')]['limit']);_0x4d21c7[_0x0128('0x1c')]=qs[_0x0128('0x1c')](_0x197580[_0x0128('0x2e')][_0x0128('0x1c')]);}_0x4d21c7[_0x0128('0x35')]=qs[_0x0128('0x36')](_0x197580[_0x0128('0x2e')][_0x0128('0x36')]);_0x4d21c7[_0x0128('0x37')]=qs[_0x0128('0x38')](_[_0x0128('0x39')](_0x197580[_0x0128('0x2e')],_0x3bf940[_0x0128('0x38')]));if(_0x197580[_0x0128('0x2e')]['filter']){_0x4d21c7[_0x0128('0x37')]=_[_0x0128('0x3a')](_0x4d21c7[_0x0128('0x37')],{'$or':_[_0x0128('0x3b')](_0x8f11e4,function(_0x52c9db){if(_0x52c9db[_0x0128('0x3c')][_0x0128('0x3d')]!==_0x0128('0x3e')){var _0x1e824c={};_0x1e824c[_0x52c9db[_0x0128('0x3f')]]={'$like':'%'+_0x197580[_0x0128('0x2e')][_0x0128('0x40')]+'%'};return _0x1e824c;}})});}_0x4d21c7=_[_0x0128('0x3a')]({},_0x4d21c7,_0x197580[_0x0128('0x41')]);var _0x105064={'where':_0x4d21c7[_0x0128('0x37')]};return db[_0x0128('0x2a')]['count'](_0x105064)[_0x0128('0x21')](function(_0x271f67){_0x4db631[_0x0128('0x42')]=_0x271f67;if(_0x197580[_0x0128('0x2e')][_0x0128('0x43')]){_0x4d21c7[_0x0128('0x44')]=[{'all':!![]}];}return db['Tag']['findAll'](_0x4d21c7);})[_0x0128('0x21')](function(_0x231230){_0x4db631[_0x0128('0x45')]=_0x231230;return _0x4db631;})[_0x0128('0x21')](respondWithFilteredResult(_0x11f7c5,_0x4d21c7))[_0x0128('0x46')](handleError(_0x11f7c5,null));};exports['show']=function(_0x3442cd,_0x299571){var _0x27bc81={'raw':!![],'where':{'id':_0x3442cd[_0x0128('0x47')]['id']}},_0x5bfbf2={};_0x5bfbf2[_0x0128('0x2c')]=_[_0x0128('0x2d')](db[_0x0128('0x2a')][_0x0128('0x2b')]);_0x5bfbf2[_0x0128('0x2e')]=_['keys'](_0x3442cd[_0x0128('0x2e')]);_0x5bfbf2[_0x0128('0x38')]=_['intersection'](_0x5bfbf2[_0x0128('0x2c')],_0x5bfbf2['query']);_0x27bc81[_0x0128('0x30')]=_['intersection'](_0x5bfbf2[_0x0128('0x2c')],qs[_0x0128('0x31')](_0x3442cd[_0x0128('0x2e')]['fields']));_0x27bc81[_0x0128('0x30')]=_0x27bc81[_0x0128('0x30')]['length']?_0x27bc81[_0x0128('0x30')]:_0x5bfbf2[_0x0128('0x2c')];if(_0x3442cd[_0x0128('0x2e')][_0x0128('0x43')]){_0x27bc81[_0x0128('0x44')]=[{'all':!![]}];}_0x27bc81=_[_0x0128('0x3a')]({},_0x27bc81,_0x3442cd[_0x0128('0x41')]);return db[_0x0128('0x2a')]['find'](_0x27bc81)['then'](handleEntityNotFound(_0x299571,null))['then'](respondWithResult(_0x299571,null))[_0x0128('0x46')](handleError(_0x299571,null));};exports[_0x0128('0x48')]=function(_0x2b00cc,_0x119d5a){return db[_0x0128('0x2a')]['create'](_0x2b00cc[_0x0128('0x49')],{})['then'](function(_0x7de574){var _0x1128c0=_0x2b00cc[_0x0128('0x4a')][_0x0128('0x23')]({'plain':!![]});if(!_0x1128c0)throw new Error(_0x0128('0x4b'));if(_0x1128c0[_0x0128('0x4c')]===_0x0128('0x4a')){var _0xdb8891=_0x7de574[_0x0128('0x23')]({'plain':!![]});var _0x260fe6='Tags';return db[_0x0128('0x4d')][_0x0128('0x4e')]({'where':{'name':_0x260fe6,'userProfileId':_0x1128c0[_0x0128('0x4f')]},'raw':!![]})['then'](function(_0x5e8b8e){if(_0x5e8b8e&&_0x5e8b8e[_0x0128('0x50')]===0x0){return db[_0x0128('0x51')][_0x0128('0x48')]({'name':_0xdb8891[_0x0128('0x27')],'resourceId':_0xdb8891['id'],'type':_0x5e8b8e[_0x0128('0x27')],'sectionId':_0x5e8b8e['id']},{})[_0x0128('0x21')](function(){return _0x7de574;});}else{return _0x7de574;}})[_0x0128('0x46')](function(_0x33ae5b){logger[_0x0128('0x25')](_0x0128('0x52'),_0x33ae5b);throw _0x33ae5b;});}return _0x7de574;})['then'](respondWithResult(_0x119d5a,0xc9))[_0x0128('0x46')](handleError(_0x119d5a,null));};exports[_0x0128('0x20')]=function(_0x492f03,_0x1ef15){if(_0x492f03[_0x0128('0x49')]['id']){delete _0x492f03[_0x0128('0x49')]['id'];}return db[_0x0128('0x2a')][_0x0128('0x4e')]({'where':{'id':_0x492f03[_0x0128('0x47')]['id']}})['then'](handleEntityNotFound(_0x1ef15,null))['then'](saveUpdates(_0x492f03[_0x0128('0x49')],null))[_0x0128('0x21')](respondWithResult(_0x1ef15,null))[_0x0128('0x46')](handleError(_0x1ef15,null));};exports[_0x0128('0x22')]=function(_0x3dd3d2,_0x52d55a){return db[_0x0128('0x2a')][_0x0128('0x4e')]({'where':{'id':_0x3dd3d2['params']['id']}})[_0x0128('0x21')](handleEntityNotFound(_0x52d55a,null))['then'](removeEntity(_0x52d55a,null))[_0x0128('0x46')](handleError(_0x52d55a,null));}; \ No newline at end of file +var _0x6fb8=['length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Tags','UserProfileSection','autoAssociation','html-pdf','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','destroy','then','get','UserProfileResource','error','name','send','index','Tag','rawAttributes','model','query','keys','intersection','attributes'];(function(_0x264eb0,_0x36afbb){var _0x633c5e=function(_0x19427a){while(--_0x19427a){_0x264eb0['push'](_0x264eb0['shift']());}};_0x633c5e(++_0x36afbb);}(_0x6fb8,0x104));var _0x86fb=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x6fb8[_0xaa0309];return _0x5de7ce;};'use strict';var pdf=require(_0x86fb('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x86fb('0x1'));var zipdir=require(_0x86fb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x86fb('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x86fb('0x4'));var util=require(_0x86fb('0x5'));var path=require(_0x86fb('0x6'));var sox=require(_0x86fb('0x7'));var csv=require(_0x86fb('0x8'));var ejs=require(_0x86fb('0x9'));var fs=require('fs');var _=require(_0x86fb('0xa'));var squel=require(_0x86fb('0xb'));var crypto=require(_0x86fb('0xc'));var jsforce=require(_0x86fb('0xd'));var deskjs=require(_0x86fb('0xe'));var toCsv=require(_0x86fb('0x8'));var querystring=require(_0x86fb('0xf'));var Papa=require('papaparse');var Redis=require(_0x86fb('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x86fb('0x11'));var hardwareService=require(_0x86fb('0x12'));var logger=require(_0x86fb('0x13'))('api');var utils=require(_0x86fb('0x14'));var config=require('../../config/environment');var db=require(_0x86fb('0x15'))['db'];function respondWithStatusCode(_0x2e830e,_0x13584d){_0x13584d=_0x13584d||0xcc;return function(_0x17bbd6){if(_0x17bbd6){return _0x2e830e[_0x86fb('0x16')](_0x13584d);}return _0x2e830e[_0x86fb('0x17')](_0x13584d)[_0x86fb('0x18')]();};}function respondWithResult(_0x2817ac,_0xab7283){_0xab7283=_0xab7283||0xc8;return function(_0x15be09){if(_0x15be09){return _0x2817ac['status'](_0xab7283)[_0x86fb('0x19')](_0x15be09);}};}function respondWithFilteredResult(_0x58a92c,_0x29bf62){return function(_0x70ebb7){if(_0x70ebb7){var _0x5ecc0b=_0x70ebb7[_0x86fb('0x1a')],_0x20fe52=_0x29bf62[_0x86fb('0x1b')],_0xa930b5=_0x29bf62['offset']+_0x29bf62[_0x86fb('0x1c')],_0x1f60ca;if(_0xa930b5>=_0x5ecc0b){_0xa930b5=_0x5ecc0b;_0x1f60ca=0xc8;}else{_0x1f60ca=0xce;}_0x58a92c[_0x86fb('0x17')](_0x1f60ca);return _0x58a92c[_0x86fb('0x1d')](_0x86fb('0x1e'),_0x20fe52+'-'+_0xa930b5+'/'+_0x5ecc0b)[_0x86fb('0x19')](_0x70ebb7);}return null;};}function patchUpdates(_0x41919c){return function(_0x10fd7e){try{jsonpatch['apply'](_0x10fd7e,_0x41919c,!![]);}catch(_0x3ceac1){return BPromise[_0x86fb('0x1f')](_0x3ceac1);}return _0x10fd7e[_0x86fb('0x20')]();};}function saveUpdates(_0xb22d93,_0x3f4229){return function(_0x41c928){if(_0x41c928){return _0x41c928['update'](_0xb22d93)['then'](function(_0x295b7d){return _0x295b7d;});}return null;};}function removeEntity(_0xf43e6a,_0x37b90f){return function(_0x1ae5a8){if(_0x1ae5a8){return _0x1ae5a8[_0x86fb('0x21')]()[_0x86fb('0x22')](function(){var _0x42809d=_0x1ae5a8[_0x86fb('0x23')]({'plain':!![]});var _0x574645='Tags';return db[_0x86fb('0x24')][_0x86fb('0x21')]({'where':{'type':_0x574645,'resourceId':_0x42809d['id']}})[_0x86fb('0x22')](function(){return _0x1ae5a8;});})[_0x86fb('0x22')](function(){_0xf43e6a['status'](0xcc)[_0x86fb('0x18')]();});}};}function handleEntityNotFound(_0x50da80,_0x59e639){return function(_0x243e9c){if(!_0x243e9c){_0x50da80[_0x86fb('0x16')](0x194);}return _0x243e9c;};}function handleError(_0x30f26f,_0x4762d3){_0x4762d3=_0x4762d3||0x1f4;return function(_0x54ca60){logger[_0x86fb('0x25')](_0x54ca60['stack']);if(_0x54ca60[_0x86fb('0x26')]){delete _0x54ca60[_0x86fb('0x26')];}_0x30f26f[_0x86fb('0x17')](_0x4762d3)[_0x86fb('0x27')](_0x54ca60);};}exports[_0x86fb('0x28')]=function(_0x519df5,_0x4137a6){var _0x2e9d36={},_0x43ca07={},_0x4c6570={'count':0x0,'rows':[]};var _0x370000=db[_0x86fb('0x29')][_0x86fb('0x2a')];_0x43ca07[_0x86fb('0x2b')]=_['keys'](_0x370000);_0x43ca07[_0x86fb('0x2c')]=_[_0x86fb('0x2d')](_0x519df5[_0x86fb('0x2c')]);_0x43ca07['filters']=_[_0x86fb('0x2e')](_0x43ca07[_0x86fb('0x2b')],_0x43ca07[_0x86fb('0x2c')]);_0x2e9d36[_0x86fb('0x2f')]=_[_0x86fb('0x2e')](_0x43ca07[_0x86fb('0x2b')],qs['fields'](_0x519df5[_0x86fb('0x2c')]['fields']));_0x2e9d36[_0x86fb('0x2f')]=_0x2e9d36[_0x86fb('0x2f')][_0x86fb('0x30')]?_0x2e9d36[_0x86fb('0x2f')]:_0x43ca07[_0x86fb('0x2b')];if(!_0x519df5[_0x86fb('0x2c')]['hasOwnProperty'](_0x86fb('0x31'))){_0x2e9d36['limit']=qs[_0x86fb('0x1c')](_0x519df5[_0x86fb('0x2c')][_0x86fb('0x1c')]);_0x2e9d36[_0x86fb('0x1b')]=qs['offset'](_0x519df5['query'][_0x86fb('0x1b')]);}_0x2e9d36[_0x86fb('0x32')]=qs[_0x86fb('0x33')](_0x519df5['query'][_0x86fb('0x33')]);_0x2e9d36[_0x86fb('0x34')]=qs[_0x86fb('0x35')](_[_0x86fb('0x36')](_0x519df5[_0x86fb('0x2c')],_0x43ca07[_0x86fb('0x35')]));if(_0x519df5[_0x86fb('0x2c')][_0x86fb('0x37')]){_0x2e9d36['where']=_[_0x86fb('0x38')](_0x2e9d36[_0x86fb('0x34')],{'$or':_['map'](_0x370000,function(_0x2d93b2){if(_0x2d93b2['type']['key']!==_0x86fb('0x39')){var _0xc007f7={};_0xc007f7[_0x2d93b2[_0x86fb('0x3a')]]={'$like':'%'+_0x519df5[_0x86fb('0x2c')]['filter']+'%'};return _0xc007f7;}})});}_0x2e9d36=_[_0x86fb('0x38')]({},_0x2e9d36,_0x519df5[_0x86fb('0x3b')]);var _0x44baca={'where':_0x2e9d36[_0x86fb('0x34')]};return db[_0x86fb('0x29')][_0x86fb('0x1a')](_0x44baca)[_0x86fb('0x22')](function(_0xde9a62){_0x4c6570['count']=_0xde9a62;if(_0x519df5[_0x86fb('0x2c')][_0x86fb('0x3c')]){_0x2e9d36[_0x86fb('0x3d')]=[{'all':!![]}];}return db['Tag'][_0x86fb('0x3e')](_0x2e9d36);})[_0x86fb('0x22')](function(_0x516f7d){_0x4c6570[_0x86fb('0x3f')]=_0x516f7d;return _0x4c6570;})[_0x86fb('0x22')](respondWithFilteredResult(_0x4137a6,_0x2e9d36))[_0x86fb('0x40')](handleError(_0x4137a6,null));};exports[_0x86fb('0x41')]=function(_0x5a5ede,_0x270dd5){var _0x1fbeab={'raw':!![],'where':{'id':_0x5a5ede[_0x86fb('0x42')]['id']}},_0x73423b={};_0x73423b[_0x86fb('0x2b')]=_['keys'](db[_0x86fb('0x29')][_0x86fb('0x2a')]);_0x73423b[_0x86fb('0x2c')]=_[_0x86fb('0x2d')](_0x5a5ede[_0x86fb('0x2c')]);_0x73423b['filters']=_[_0x86fb('0x2e')](_0x73423b[_0x86fb('0x2b')],_0x73423b[_0x86fb('0x2c')]);_0x1fbeab['attributes']=_[_0x86fb('0x2e')](_0x73423b[_0x86fb('0x2b')],qs[_0x86fb('0x43')](_0x5a5ede[_0x86fb('0x2c')][_0x86fb('0x43')]));_0x1fbeab['attributes']=_0x1fbeab['attributes'][_0x86fb('0x30')]?_0x1fbeab['attributes']:_0x73423b[_0x86fb('0x2b')];if(_0x5a5ede[_0x86fb('0x2c')][_0x86fb('0x3c')]){_0x1fbeab[_0x86fb('0x3d')]=[{'all':!![]}];}_0x1fbeab=_[_0x86fb('0x38')]({},_0x1fbeab,_0x5a5ede[_0x86fb('0x3b')]);return db[_0x86fb('0x29')][_0x86fb('0x44')](_0x1fbeab)[_0x86fb('0x22')](handleEntityNotFound(_0x270dd5,null))['then'](respondWithResult(_0x270dd5,null))[_0x86fb('0x40')](handleError(_0x270dd5,null));};exports[_0x86fb('0x45')]=function(_0x27363f,_0x191b04){return db['Tag'][_0x86fb('0x45')](_0x27363f[_0x86fb('0x46')],{})[_0x86fb('0x22')](function(_0x3d4656){var _0x48a5e5=_0x27363f[_0x86fb('0x47')][_0x86fb('0x23')]({'plain':!![]});if(!_0x48a5e5)throw new Error(_0x86fb('0x48'));if(_0x48a5e5[_0x86fb('0x49')]===_0x86fb('0x47')){var _0x587be0=_0x3d4656[_0x86fb('0x23')]({'plain':!![]});var _0x574a41=_0x86fb('0x4a');return db[_0x86fb('0x4b')][_0x86fb('0x44')]({'where':{'name':_0x574a41,'userProfileId':_0x48a5e5['userProfileId']},'raw':!![]})[_0x86fb('0x22')](function(_0x390c4c){if(_0x390c4c&&_0x390c4c[_0x86fb('0x4c')]===0x0){return db[_0x86fb('0x24')][_0x86fb('0x45')]({'name':_0x587be0[_0x86fb('0x26')],'resourceId':_0x587be0['id'],'type':_0x390c4c[_0x86fb('0x26')],'sectionId':_0x390c4c['id']},{})['then'](function(){return _0x3d4656;});}else{return _0x3d4656;}})[_0x86fb('0x40')](function(_0x5b6d4f){logger[_0x86fb('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b6d4f);throw _0x5b6d4f;});}return _0x3d4656;})[_0x86fb('0x22')](respondWithResult(_0x191b04,0xc9))['catch'](handleError(_0x191b04,null));};exports['update']=function(_0x13fa4f,_0x1a3e54){if(_0x13fa4f[_0x86fb('0x46')]['id']){delete _0x13fa4f[_0x86fb('0x46')]['id'];}return db['Tag'][_0x86fb('0x44')]({'where':{'id':_0x13fa4f[_0x86fb('0x42')]['id']}})[_0x86fb('0x22')](handleEntityNotFound(_0x1a3e54,null))[_0x86fb('0x22')](saveUpdates(_0x13fa4f[_0x86fb('0x46')],null))[_0x86fb('0x22')](respondWithResult(_0x1a3e54,null))['catch'](handleError(_0x1a3e54,null));};exports[_0x86fb('0x21')]=function(_0x138ff3,_0x3c6714){return db[_0x86fb('0x29')][_0x86fb('0x44')]({'where':{'id':_0x138ff3[_0x86fb('0x42')]['id']}})[_0x86fb('0x22')](handleEntityNotFound(_0x3c6714,null))[_0x86fb('0x22')](removeEntity(_0x3c6714,null))[_0x86fb('0x40')](handleError(_0x3c6714,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 2870d8e..f96cb2b 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 _0x64bc=['request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','Tag','tools_tags','lodash','util','../../config/logger','api','bluebird'];(function(_0x58b789,_0x2d4003){var _0x1eb7b5=function(_0x300475){while(--_0x300475){_0x58b789['push'](_0x58b789['shift']());}};_0x1eb7b5(++_0x2d4003);}(_0x64bc,0x14d));var _0xc64b=function(_0x4f2c11,_0x15da99){_0x4f2c11=_0x4f2c11-0x0;var _0x29e71a=_0x64bc[_0x4f2c11];return _0x29e71a;};'use strict';var _=require(_0xc64b('0x0'));var util=require(_0xc64b('0x1'));var logger=require(_0xc64b('0x2'))(_0xc64b('0x3'));var moment=require('moment');var BPromise=require(_0xc64b('0x4'));var rp=require(_0xc64b('0x5'));var fs=require('fs');var path=require(_0xc64b('0x6'));var rimraf=require(_0xc64b('0x7'));var config=require(_0xc64b('0x8'));var attributes=require(_0xc64b('0x9'));module[_0xc64b('0xa')]=function(_0x46c5b2,_0x7aec5f){return _0x46c5b2['define'](_0xc64b('0xb'),attributes,{'tableName':_0xc64b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x76f7=['rimraf','../../config/environment','define','tools_tags','lodash','util','../../config/logger','api'];(function(_0x1d3c10,_0x375fee){var _0x26721d=function(_0x591ee9){while(--_0x591ee9){_0x1d3c10['push'](_0x1d3c10['shift']());}};_0x26721d(++_0x375fee);}(_0x76f7,0x1e4));var _0x776f=function(_0x4c26f1,_0x20e2d6){_0x4c26f1=_0x4c26f1-0x0;var _0x2a79af=_0x76f7[_0x4c26f1];return _0x2a79af;};'use strict';var _=require(_0x776f('0x0'));var util=require(_0x776f('0x1'));var logger=require(_0x776f('0x2'))(_0x776f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x776f('0x4'));var config=require(_0x776f('0x5'));var attributes=require('./tag.attributes');module['exports']=function(_0x5c8655,_0x3c50aa){return _0x5c8655[_0x776f('0x6')]('Tag',attributes,{'tableName':_0x776f('0x7'),'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 1b96602..42f08f0 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 _0x4578=['../../config/utils','../../config/logger','client','http','then','info','Tag,\x20%s,\x20%s','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x28e676,_0x220078){var _0x10172d=function(_0x3725dd){while(--_0x3725dd){_0x28e676['push'](_0x28e676['shift']());}};_0x10172d(++_0x220078);}(_0x4578,0xe1));var _0x8457=function(_0x4f3ee5,_0x38db22){_0x4f3ee5=_0x4f3ee5-0x0;var _0x5280c7=_0x4578[_0x4f3ee5];return _0x5280c7;};'use strict';var _=require(_0x8457('0x0'));var util=require(_0x8457('0x1'));var moment=require(_0x8457('0x2'));var BPromise=require('bluebird');var rs=require(_0x8457('0x3'));var fs=require('fs');var Redis=require(_0x8457('0x4'));var db=require(_0x8457('0x5'))['db'];var utils=require(_0x8457('0x6'));var logger=require(_0x8457('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8457('0x8')][_0x8457('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36e199,_0x37f43c,_0x59e6d8){return new BPromise(function(_0x290e53,_0x39c8db){return client['request'](_0x36e199,_0x59e6d8)[_0x8457('0xa')](function(_0x2eccae){logger[_0x8457('0xb')](_0x8457('0xc'),_0x37f43c,_0x8457('0xd'));logger['debug'](_0x8457('0xe'),_0x37f43c,'request\x20sent',JSON[_0x8457('0xf')](_0x2eccae));if(_0x2eccae[_0x8457('0x10')]){if(_0x2eccae[_0x8457('0x10')][_0x8457('0x11')]===0x1f4){logger[_0x8457('0x10')](_0x8457('0xc'),_0x37f43c,_0x2eccae[_0x8457('0x10')]['message']);return _0x39c8db(_0x2eccae[_0x8457('0x10')][_0x8457('0x12')]);}logger[_0x8457('0x10')](_0x8457('0xc'),_0x37f43c,_0x2eccae[_0x8457('0x10')][_0x8457('0x12')]);return _0x290e53(_0x2eccae[_0x8457('0x10')][_0x8457('0x12')]);}else{logger[_0x8457('0xb')](_0x8457('0xc'),_0x37f43c,'request\x20sent');_0x290e53(_0x2eccae[_0x8457('0x13')][_0x8457('0x12')]);}})[_0x8457('0x14')](function(_0x7a39fb){logger[_0x8457('0x10')](_0x8457('0xc'),_0x37f43c,_0x7a39fb);_0x39c8db(_0x7a39fb);});});} \ No newline at end of file +var _0x7325=['error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Tag,\x20%s,\x20%s','debug','Tag,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x7325,0x195));var _0x5732=function(_0x50dc82,_0x1ca399){_0x50dc82=_0x50dc82-0x0;var _0x4aded6=_0x7325[_0x50dc82];return _0x4aded6;};'use strict';var _=require(_0x5732('0x0'));var util=require('util');var moment=require(_0x5732('0x1'));var BPromise=require(_0x5732('0x2'));var rs=require(_0x5732('0x3'));var fs=require('fs');var Redis=require(_0x5732('0x4'));var db=require(_0x5732('0x5'))['db'];var utils=require(_0x5732('0x6'));var logger=require(_0x5732('0x7'))(_0x5732('0x8'));var config=require(_0x5732('0x9'));var jayson=require(_0x5732('0xa'));var client=jayson['client'][_0x5732('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45ba0f,_0x35a48b,_0x46de38){return new BPromise(function(_0x42acfa,_0x411465){return client[_0x5732('0xc')](_0x45ba0f,_0x46de38)[_0x5732('0xd')](function(_0x15698d){logger[_0x5732('0xe')](_0x5732('0xf'),_0x35a48b,'request\x20sent');logger[_0x5732('0x10')](_0x5732('0x11'),_0x35a48b,_0x5732('0x12'),JSON[_0x5732('0x13')](_0x15698d));if(_0x15698d[_0x5732('0x14')]){if(_0x15698d[_0x5732('0x14')][_0x5732('0x15')]===0x1f4){logger[_0x5732('0x14')](_0x5732('0xf'),_0x35a48b,_0x15698d[_0x5732('0x14')][_0x5732('0x16')]);return _0x411465(_0x15698d[_0x5732('0x14')][_0x5732('0x16')]);}logger['error']('Tag,\x20%s,\x20%s',_0x35a48b,_0x15698d[_0x5732('0x14')]['message']);return _0x42acfa(_0x15698d[_0x5732('0x14')][_0x5732('0x16')]);}else{logger['info'](_0x5732('0xf'),_0x35a48b,'request\x20sent');_0x42acfa(_0x15698d[_0x5732('0x17')]['message']);}})[_0x5732('0x18')](function(_0x4f42db){logger[_0x5732('0x14')](_0x5732('0xf'),_0x35a48b,_0x4f42db);_0x411465(_0x4f42db);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index c64213a..4cbf8f7 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 _0x1c8f=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','isAuthenticated','index','show','/:id/queues','getQueues','post','create','addQueues','/:id/users','put','/:id','update','delete','destroy','removeQueues','removeAgents','multer','util'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0x1c8f,0x10c));var _0xf1c8=function(_0x180b0d,_0x3466f6){_0x180b0d=_0x180b0d-0x0;var _0x9eb04a=_0x1c8f[_0x180b0d];return _0x9eb04a;};'use strict';var multer=require(_0xf1c8('0x0'));var util=require(_0xf1c8('0x1'));var path=require(_0xf1c8('0x2'));var timeout=require(_0xf1c8('0x3'));var express=require(_0xf1c8('0x4'));var router=express[_0xf1c8('0x5')]();var auth=require(_0xf1c8('0x6'));var interaction=require(_0xf1c8('0x7'));var config=require(_0xf1c8('0x8'));var controller=require(_0xf1c8('0x9'));router[_0xf1c8('0xa')]('/',auth[_0xf1c8('0xb')](),controller[_0xf1c8('0xc')]);router[_0xf1c8('0xa')]('/:id',auth[_0xf1c8('0xb')](),controller[_0xf1c8('0xd')]);router[_0xf1c8('0xa')](_0xf1c8('0xe'),auth['isAuthenticated'](),controller[_0xf1c8('0xf')]);router['get']('/:id/users',auth[_0xf1c8('0xb')](),controller['getAgents']);router[_0xf1c8('0x10')]('/',auth[_0xf1c8('0xb')](),controller[_0xf1c8('0x11')]);router['post'](_0xf1c8('0xe'),auth['isAuthenticated'](),controller[_0xf1c8('0x12')]);router[_0xf1c8('0x10')](_0xf1c8('0x13'),auth[_0xf1c8('0xb')](),controller['addAgents']);router[_0xf1c8('0x14')](_0xf1c8('0x15'),auth['isAuthenticated'](),controller[_0xf1c8('0x16')]);router[_0xf1c8('0x17')]('/:id',auth['isAuthenticated'](),controller[_0xf1c8('0x18')]);router[_0xf1c8('0x17')](_0xf1c8('0xe'),auth[_0xf1c8('0xb')](),controller[_0xf1c8('0x19')]);router[_0xf1c8('0x17')](_0xf1c8('0x13'),auth['isAuthenticated'](),controller[_0xf1c8('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x7a98=['multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','isAuthenticated','index','/:id/queues','getQueues','getAgents','post','/:id/users','addAgents','put','/:id','update','delete','destroy','removeQueues','removeAgents','exports'];(function(_0x16e1d5,_0x26b53b){var _0x534f2c=function(_0x324736){while(--_0x324736){_0x16e1d5['push'](_0x16e1d5['shift']());}};_0x534f2c(++_0x26b53b);}(_0x7a98,0x190));var _0x87a9=function(_0x540efb,_0x565f35){_0x540efb=_0x540efb-0x0;var _0x4e86a0=_0x7a98[_0x540efb];return _0x4e86a0;};'use strict';var multer=require(_0x87a9('0x0'));var util=require(_0x87a9('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x87a9('0x2'));var router=express[_0x87a9('0x3')]();var auth=require(_0x87a9('0x4'));var interaction=require(_0x87a9('0x5'));var config=require(_0x87a9('0x6'));var controller=require(_0x87a9('0x7'));router[_0x87a9('0x8')]('/',auth[_0x87a9('0x9')](),controller[_0x87a9('0xa')]);router[_0x87a9('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x87a9('0x8')](_0x87a9('0xb'),auth[_0x87a9('0x9')](),controller[_0x87a9('0xc')]);router[_0x87a9('0x8')]('/:id/users',auth[_0x87a9('0x9')](),controller[_0x87a9('0xd')]);router[_0x87a9('0xe')]('/',auth[_0x87a9('0x9')](),controller['create']);router[_0x87a9('0xe')](_0x87a9('0xb'),auth[_0x87a9('0x9')](),controller['addQueues']);router[_0x87a9('0xe')](_0x87a9('0xf'),auth['isAuthenticated'](),controller[_0x87a9('0x10')]);router[_0x87a9('0x11')](_0x87a9('0x12'),auth[_0x87a9('0x9')](),controller[_0x87a9('0x13')]);router[_0x87a9('0x14')](_0x87a9('0x12'),auth[_0x87a9('0x9')](),controller[_0x87a9('0x15')]);router[_0x87a9('0x14')](_0x87a9('0xb'),auth[_0x87a9('0x9')](),controller[_0x87a9('0x16')]);router[_0x87a9('0x14')](_0x87a9('0xf'),auth['isAuthenticated'](),controller[_0x87a9('0x17')]);module[_0x87a9('0x18')]=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index 748766e..4c68bc7 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 _0x9a3b=['STRING','name','sequelize'];(function(_0x48eddc,_0x5729b2){var _0xc8e91f=function(_0x1df926){while(--_0x1df926){_0x48eddc['push'](_0x48eddc['shift']());}};_0xc8e91f(++_0x5729b2);}(_0x9a3b,0x65));var _0xb9a3=function(_0x4f027d,_0x3f9587){_0x4f027d=_0x4f027d-0x0;var _0xc46890=_0x9a3b[_0x4f027d];return _0xc46890;};'use strict';var Sequelize=require(_0xb9a3('0x0'));module['exports']={'name':{'type':Sequelize[_0xb9a3('0x1')],'allowNull':![],'unique':_0xb9a3('0x2')},'description':{'type':Sequelize[_0xb9a3('0x1')]}}; \ No newline at end of file +var _0x82f2=['exports','name','STRING','sequelize'];(function(_0x2bf9e8,_0x3b1287){var _0x4b0d30=function(_0x5cd303){while(--_0x5cd303){_0x2bf9e8['push'](_0x2bf9e8['shift']());}};_0x4b0d30(++_0x3b1287);}(_0x82f2,0x143));var _0x282f=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0x82f2[_0x36ed3c];return _0x52a2e0;};'use strict';var Sequelize=require(_0x282f('0x0'));module[_0x282f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x282f('0x2')},'description':{'type':Sequelize[_0x282f('0x3')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 9d535b9..a0cff06 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 _0x79cb=['save','update','then','destroy','get','Teams','UserProfileResource','error','stack','name','send','Team','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','include','rows','catch','params','includeAll','create','body','user','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getQueues','findOne','channel','isValidChannel','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','addQueues','Sequelize','ValidationError','add','ids','removeQueues','remove','addAgents','Voice','Mail','Sms','Fax','Openchannel','each','User','findAll','voicePause','interface','UserVoiceQueueRt','isNil','format','SIP/%s','spread','emit','userTeam:save','removeAgents','voice','chat','mail','sms','fax','isArray','userTeam:remove','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','util','path','to-csv','ejs','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','reject'];(function(_0x77b040,_0x38c560){var _0x214a46=function(_0x1fcf53){while(--_0x1fcf53){_0x77b040['push'](_0x77b040['shift']());}};_0x214a46(++_0x38c560);}(_0x79cb,0xd0));var _0xb79c=function(_0x4b3acc,_0x47f3ca){_0x4b3acc=_0x4b3acc-0x0;var _0x4ee7e9=_0x79cb[_0x4b3acc];return _0x4ee7e9;};'use strict';var pdf=require(_0xb79c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb79c('0x1'));var zipdir=require(_0xb79c('0x2'));var jsonpatch=require(_0xb79c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb79c('0x4'));var path=require(_0xb79c('0x5'));var sox=require('sox');var csv=require(_0xb79c('0x6'));var ejs=require(_0xb79c('0x7'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xb79c('0x8'));var jsforce=require(_0xb79c('0x9'));var deskjs=require(_0xb79c('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb79c('0xb'));var authService=require('../../components/auth/service');var qs=require(_0xb79c('0xc'));var hardwareService=require(_0xb79c('0xd'));var logger=require('../../config/logger')(_0xb79c('0xe'));var utils=require('../../config/utils');var config=require(_0xb79c('0xf'));var db=require('../../mysqldb')['db'];config[_0xb79c('0x10')]=_[_0xb79c('0x11')](config['redis'],{'host':_0xb79c('0x12'),'port':0x18eb});var socket=require(_0xb79c('0x13'))(new Redis(config[_0xb79c('0x10')]));require(_0xb79c('0x14'))[_0xb79c('0x15')](socket);function respondWithStatusCode(_0x4ede15,_0x3a9b72){_0x3a9b72=_0x3a9b72||0xcc;return function(_0x237acd){if(_0x237acd){return _0x4ede15[_0xb79c('0x16')](_0x3a9b72);}return _0x4ede15[_0xb79c('0x17')](_0x3a9b72)[_0xb79c('0x18')]();};}function respondWithResult(_0x4807da,_0xaf93e3){_0xaf93e3=_0xaf93e3||0xc8;return function(_0xc7ba59){if(_0xc7ba59){return _0x4807da[_0xb79c('0x17')](_0xaf93e3)['json'](_0xc7ba59);}};}function respondWithFilteredResult(_0x101cc8,_0x1f5c2f){return function(_0x6ede2b){if(_0x6ede2b){var _0x304130=_0x6ede2b[_0xb79c('0x19')],_0x49bbfd=_0x1f5c2f[_0xb79c('0x1a')],_0x246f1e=_0x1f5c2f['offset']+_0x1f5c2f[_0xb79c('0x1b')],_0x5dad84;if(_0x246f1e>=_0x304130){_0x246f1e=_0x304130;_0x5dad84=0xc8;}else{_0x5dad84=0xce;}_0x101cc8[_0xb79c('0x17')](_0x5dad84);return _0x101cc8['set'](_0xb79c('0x1c'),_0x49bbfd+'-'+_0x246f1e+'/'+_0x304130)[_0xb79c('0x1d')](_0x6ede2b);}return null;};}function patchUpdates(_0x5d9a60){return function(_0xd6eec1){try{jsonpatch[_0xb79c('0x1e')](_0xd6eec1,_0x5d9a60,!![]);}catch(_0x217479){return BPromise[_0xb79c('0x1f')](_0x217479);}return _0xd6eec1[_0xb79c('0x20')]();};}function saveUpdates(_0x3f26f4,_0x45db18){return function(_0x3ba040){if(_0x3ba040){return _0x3ba040[_0xb79c('0x21')](_0x3f26f4)[_0xb79c('0x22')](function(_0xdcc48a){return _0xdcc48a;});}return null;};}function removeEntity(_0x312a48,_0x1180a9){return function(_0x280d9d){if(_0x280d9d){return _0x280d9d[_0xb79c('0x23')]()[_0xb79c('0x22')](function(){var _0x318e30=_0x280d9d[_0xb79c('0x24')]({'plain':!![]});var _0xd52305=_0xb79c('0x25');return db[_0xb79c('0x26')][_0xb79c('0x23')]({'where':{'type':_0xd52305,'resourceId':_0x318e30['id']}})[_0xb79c('0x22')](function(){return _0x280d9d;});})[_0xb79c('0x22')](function(){_0x312a48['status'](0xcc)[_0xb79c('0x18')]();});}};}function handleEntityNotFound(_0x4565a3,_0x3c4a0a){return function(_0x3abdfc){if(!_0x3abdfc){_0x4565a3['sendStatus'](0x194);}return _0x3abdfc;};}function handleError(_0x3629cc,_0x4d25e7){_0x4d25e7=_0x4d25e7||0x1f4;return function(_0xb799f9){logger[_0xb79c('0x27')](_0xb799f9[_0xb79c('0x28')]);if(_0xb799f9['name']){delete _0xb799f9[_0xb79c('0x29')];}_0x3629cc['status'](_0x4d25e7)[_0xb79c('0x2a')](_0xb799f9);};}exports['index']=function(_0x122d03,_0x49c0e2){var _0x2e7329={},_0xfe74af={},_0x28b712={'count':0x0,'rows':[]};var _0x2b90a8=db[_0xb79c('0x2b')][_0xb79c('0x2c')];_0xfe74af['model']=_[_0xb79c('0x2d')](_0x2b90a8);_0xfe74af[_0xb79c('0x2e')]=_[_0xb79c('0x2d')](_0x122d03[_0xb79c('0x2e')]);_0xfe74af[_0xb79c('0x2f')]=_[_0xb79c('0x30')](_0xfe74af[_0xb79c('0x31')],_0xfe74af[_0xb79c('0x2e')]);_0x2e7329['attributes']=_[_0xb79c('0x30')](_0xfe74af[_0xb79c('0x31')],qs[_0xb79c('0x32')](_0x122d03[_0xb79c('0x2e')][_0xb79c('0x32')]));_0x2e7329[_0xb79c('0x33')]=_0x2e7329[_0xb79c('0x33')][_0xb79c('0x34')]?_0x2e7329['attributes']:_0xfe74af['model'];if(!_0x122d03[_0xb79c('0x2e')][_0xb79c('0x35')]('nolimit')){_0x2e7329[_0xb79c('0x1b')]=qs['limit'](_0x122d03[_0xb79c('0x2e')][_0xb79c('0x1b')]);_0x2e7329['offset']=qs['offset'](_0x122d03[_0xb79c('0x2e')][_0xb79c('0x1a')]);}_0x2e7329[_0xb79c('0x36')]=qs[_0xb79c('0x37')](_0x122d03[_0xb79c('0x2e')]['sort']);_0x2e7329[_0xb79c('0x38')]=qs[_0xb79c('0x2f')](_[_0xb79c('0x39')](_0x122d03[_0xb79c('0x2e')],_0xfe74af[_0xb79c('0x2f')]));if(_0x122d03[_0xb79c('0x2e')][_0xb79c('0x3a')]){_0x2e7329[_0xb79c('0x38')]=_[_0xb79c('0x3b')](_0x2e7329['where'],{'$or':_['map'](_0x2b90a8,function(_0x1f8e7b){if(_0x1f8e7b[_0xb79c('0x3c')][_0xb79c('0x3d')]!==_0xb79c('0x3e')){var _0x292112={};_0x292112[_0x1f8e7b[_0xb79c('0x3f')]]={'$like':'%'+_0x122d03[_0xb79c('0x2e')][_0xb79c('0x3a')]+'%'};return _0x292112;}})});}_0x2e7329=_['merge']({},_0x2e7329,_0x122d03[_0xb79c('0x40')]);var _0x2553d0={'where':_0x2e7329[_0xb79c('0x38')]};return db[_0xb79c('0x2b')][_0xb79c('0x19')](_0x2553d0)[_0xb79c('0x22')](function(_0x2a1139){_0x28b712[_0xb79c('0x19')]=_0x2a1139;if(_0x122d03[_0xb79c('0x2e')]['includeAll']){_0x2e7329[_0xb79c('0x41')]=[{'all':!![]}];}return db[_0xb79c('0x2b')]['findAll'](_0x2e7329);})[_0xb79c('0x22')](function(_0x82a733){_0x28b712[_0xb79c('0x42')]=_0x82a733;return _0x28b712;})[_0xb79c('0x22')](respondWithFilteredResult(_0x49c0e2,_0x2e7329))[_0xb79c('0x43')](handleError(_0x49c0e2,null));};exports['show']=function(_0x2e98bd,_0x2cb2be){var _0x4cb2ce={'raw':![],'where':{'id':_0x2e98bd[_0xb79c('0x44')]['id']}},_0x1bb4c9={};_0x1bb4c9[_0xb79c('0x31')]=_['keys'](db[_0xb79c('0x2b')][_0xb79c('0x2c')]);_0x1bb4c9[_0xb79c('0x2e')]=_[_0xb79c('0x2d')](_0x2e98bd[_0xb79c('0x2e')]);_0x1bb4c9[_0xb79c('0x2f')]=_[_0xb79c('0x30')](_0x1bb4c9[_0xb79c('0x31')],_0x1bb4c9[_0xb79c('0x2e')]);_0x4cb2ce[_0xb79c('0x33')]=_[_0xb79c('0x30')](_0x1bb4c9[_0xb79c('0x31')],qs[_0xb79c('0x32')](_0x2e98bd[_0xb79c('0x2e')][_0xb79c('0x32')]));_0x4cb2ce[_0xb79c('0x33')]=_0x4cb2ce['attributes']['length']?_0x4cb2ce[_0xb79c('0x33')]:_0x1bb4c9[_0xb79c('0x31')];if(_0x2e98bd[_0xb79c('0x2e')][_0xb79c('0x45')]){_0x4cb2ce[_0xb79c('0x41')]=[{'all':!![]}];}_0x4cb2ce=_[_0xb79c('0x3b')]({},_0x4cb2ce,_0x2e98bd[_0xb79c('0x40')]);return db[_0xb79c('0x2b')]['find'](_0x4cb2ce)[_0xb79c('0x22')](handleEntityNotFound(_0x2cb2be,null))[_0xb79c('0x22')](respondWithResult(_0x2cb2be,null))[_0xb79c('0x43')](handleError(_0x2cb2be,null));};exports['create']=function(_0x53302a,_0xc770e6){return db[_0xb79c('0x2b')][_0xb79c('0x46')](_0x53302a[_0xb79c('0x47')],{})[_0xb79c('0x22')](function(_0x3b0c77){var _0x2aaf5f=_0x53302a['user'][_0xb79c('0x24')]({'plain':!![]});if(!_0x2aaf5f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2aaf5f['role']===_0xb79c('0x48')){var _0x4ea79e=_0x3b0c77[_0xb79c('0x24')]({'plain':!![]});var _0x4870ce=_0xb79c('0x25');return db['UserProfileSection'][_0xb79c('0x49')]({'where':{'name':_0x4870ce,'userProfileId':_0x2aaf5f[_0xb79c('0x4a')]},'raw':!![]})[_0xb79c('0x22')](function(_0x290900){if(_0x290900&&_0x290900[_0xb79c('0x4b')]===0x0){return db[_0xb79c('0x26')][_0xb79c('0x46')]({'name':_0x4ea79e['name'],'resourceId':_0x4ea79e['id'],'type':_0x290900[_0xb79c('0x29')],'sectionId':_0x290900['id']},{})['then'](function(){return _0x3b0c77;});}else{return _0x3b0c77;}})['catch'](function(_0x3bd2d8){logger[_0xb79c('0x27')](_0xb79c('0x4c'),_0x3bd2d8);throw _0x3bd2d8;});}return _0x3b0c77;})[_0xb79c('0x22')](respondWithResult(_0xc770e6,0xc9))['catch'](handleError(_0xc770e6,null));};exports[_0xb79c('0x21')]=function(_0x14b086,_0x2934e6){if(_0x14b086[_0xb79c('0x47')]['id']){delete _0x14b086[_0xb79c('0x47')]['id'];}return db[_0xb79c('0x2b')][_0xb79c('0x49')]({'where':{'id':_0x14b086[_0xb79c('0x44')]['id']}})[_0xb79c('0x22')](handleEntityNotFound(_0x2934e6,null))['then'](saveUpdates(_0x14b086['body'],null))[_0xb79c('0x22')](respondWithResult(_0x2934e6,null))['catch'](handleError(_0x2934e6,null));};exports[_0xb79c('0x23')]=function(_0x2e5b70,_0xfb1448){return db[_0xb79c('0x2b')][_0xb79c('0x49')]({'where':{'id':_0x2e5b70[_0xb79c('0x44')]['id']}})['then'](handleEntityNotFound(_0xfb1448,null))[_0xb79c('0x22')](removeEntity(_0xfb1448,null))[_0xb79c('0x43')](handleError(_0xfb1448,null));};exports[_0xb79c('0x4d')]=function(_0x151686,_0x449bfd,_0x25819a){return db[_0xb79c('0x2b')][_0xb79c('0x4e')]({'where':{'id':_0x151686[_0xb79c('0x44')]['id']}})['then'](handleEntityNotFound(_0x449bfd,null))[_0xb79c('0x22')](function(_0x37813c){if(!_0x151686['query'][_0xb79c('0x4f')]||!utils[_0xb79c('0x50')](_0x151686['query'][_0xb79c('0x4f')])){throw new db['Sequelize']['ValidationError'](_0xb79c('0x51'));}var _0xf89b83={};var _0x4ac016={};_0x4ac016[_0xb79c('0x31')]=_[_0xb79c('0x2d')](db[_[_0xb79c('0x52')](_0x151686['query'][_0xb79c('0x4f')][_0xb79c('0x53')]())+_0xb79c('0x54')][_0xb79c('0x2c')]);_0x4ac016[_0xb79c('0x2e')]=_[_0xb79c('0x2d')](_0x151686[_0xb79c('0x2e')]);_0x4ac016[_0xb79c('0x2f')]=_['intersection'](_0x4ac016[_0xb79c('0x31')],_0x4ac016[_0xb79c('0x2e')]);_0xf89b83[_0xb79c('0x33')]=_['intersection'](_0x4ac016[_0xb79c('0x31')],qs['fields'](_0x151686[_0xb79c('0x2e')]['fields']));_0xf89b83[_0xb79c('0x33')]=_0xf89b83[_0xb79c('0x33')][_0xb79c('0x34')]?_0xf89b83[_0xb79c('0x33')]:_0x4ac016[_0xb79c('0x31')];_0xf89b83[_0xb79c('0x1b')]=qs[_0xb79c('0x1b')](_0x151686[_0xb79c('0x2e')][_0xb79c('0x1b')]);_0xf89b83[_0xb79c('0x1a')]=qs[_0xb79c('0x1a')](_0x151686[_0xb79c('0x2e')][_0xb79c('0x1a')]);_0xf89b83['order']=qs[_0xb79c('0x37')](_0x151686[_0xb79c('0x2e')]['sort']);_0xf89b83[_0xb79c('0x38')]=qs[_0xb79c('0x2f')](_[_0xb79c('0x39')](_0x151686[_0xb79c('0x2e')],_0x4ac016[_0xb79c('0x2f')]));_0xf89b83=_[_0xb79c('0x3b')]({},_0xf89b83,_0x151686[_0xb79c('0x40')]);return _0x37813c[_0xb79c('0x24')+_['capitalize'](_0x151686['query']['channel'][_0xb79c('0x53')]())+_0xb79c('0x55')](_0xf89b83);})[_0xb79c('0x22')](respondWithResult(_0x449bfd,null))[_0xb79c('0x43')](handleError(_0x449bfd,null));};exports[_0xb79c('0x56')]=function(_0x1a3c7d,_0x259b33,_0x2798f1){return db[_0xb79c('0x2b')]['findOne']({'where':{'id':_0x1a3c7d[_0xb79c('0x44')]['id']}})[_0xb79c('0x22')](function(_0x11eced){if(_0x11eced){if(!_0x1a3c7d[_0xb79c('0x47')][_0xb79c('0x4f')]||!utils[_0xb79c('0x50')](_0x1a3c7d[_0xb79c('0x47')][_0xb79c('0x4f')])){throw new db[(_0xb79c('0x57'))][(_0xb79c('0x58'))](_0xb79c('0x51'));}return _0x11eced[_0xb79c('0x59')+_['capitalize'](_0x1a3c7d[_0xb79c('0x47')]['channel']['toLowerCase']())+'Queues'](_0x1a3c7d[_0xb79c('0x47')][_0xb79c('0x5a')]);}return null;})[_0xb79c('0x22')](handleEntityNotFound(_0x259b33,null))[_0xb79c('0x22')](respondWithStatusCode(_0x259b33,null))[_0xb79c('0x43')](handleError(_0x259b33,null));};exports[_0xb79c('0x5b')]=function(_0x291ee5,_0x1f55c2,_0x54c443){return db[_0xb79c('0x2b')]['findOne']({'where':{'id':_0x291ee5['params']['id']}})[_0xb79c('0x22')](function(_0x506302){if(_0x506302){if(!_0x291ee5[_0xb79c('0x2e')][_0xb79c('0x4f')]||!utils[_0xb79c('0x50')](_0x291ee5[_0xb79c('0x2e')][_0xb79c('0x4f')])){throw new db[(_0xb79c('0x57'))][(_0xb79c('0x58'))](_0xb79c('0x51'));}return _0x506302[_0xb79c('0x5c')+_[_0xb79c('0x52')](_0x291ee5[_0xb79c('0x2e')]['channel'][_0xb79c('0x53')]())+_0xb79c('0x55')](_0x291ee5[_0xb79c('0x2e')][_0xb79c('0x5a')]);}return null;})[_0xb79c('0x22')](handleEntityNotFound(_0x1f55c2,null))[_0xb79c('0x22')](respondWithStatusCode(_0x1f55c2,null))[_0xb79c('0x43')](handleError(_0x1f55c2,null));};exports[_0xb79c('0x5d')]=function(_0x9b058c,_0xf5d507,_0x439faa){return db[_0xb79c('0x2b')][_0xb79c('0x49')]({'where':{'id':_0x9b058c[_0xb79c('0x44')]['id']}})[_0xb79c('0x22')](handleEntityNotFound(_0xf5d507,null))[_0xb79c('0x22')](function(_0x360130){if(_0x360130){var _0x594dd1=[_0xb79c('0x5e'),'Chat',_0xb79c('0x5f'),_0xb79c('0x60'),_0xb79c('0x61'),_0xb79c('0x62')];return BPromise[_0xb79c('0x63')](_0x594dd1,function(_0x54c2f6){return _0x360130[_0xb79c('0x24')+_0x54c2f6+_0xb79c('0x55')]({'attributes':['id','name']})[_0xb79c('0x22')](function(_0x5722c4){return BPromise[_0xb79c('0x63')](_0x5722c4,function(_0x120340){return _0x120340['addAgents'](_0x9b058c[_0xb79c('0x47')][_0xb79c('0x5a')])[_0xb79c('0x22')](function(){if(_0x54c2f6===_0xb79c('0x5e')){return db[_0xb79c('0x64')][_0xb79c('0x65')]({'where':{'id':_0x9b058c[_0xb79c('0x47')]['ids']},'attributes':['id','name','online',_0xb79c('0x66'),_0xb79c('0x67')],'raw':!![]})[_0xb79c('0x22')](function(_0x37be17){return BPromise[_0xb79c('0x63')](_[_0xb79c('0x3a')](_0x37be17,{'online':0x1}),function(_0x47a9e2){return db[_0xb79c('0x68')]['upsert']({'membername':_0x47a9e2[_0xb79c('0x29')],'UserId':_0x47a9e2['id'],'queue_name':_0x120340['name'],'VoiceQueueId':_0x120340['id'],'interface':_[_0xb79c('0x69')](_0x47a9e2['interface'])?util[_0xb79c('0x6a')](_0xb79c('0x6b'),_0x47a9e2[_0xb79c('0x29')]):_0x47a9e2[_0xb79c('0x67')],'paused':_0x47a9e2[_0xb79c('0x66')]||![],'penalty':0x0});});});}});});})[_0xb79c('0x22')](function(){return _0x360130;});})[_0xb79c('0x22')](function(){return _0x360130;});}})['then'](function(_0x29210b){if(_0x29210b){return _0x29210b['addAgents'](_0x9b058c[_0xb79c('0x47')][_0xb79c('0x5a')],_['omit'](_0x9b058c[_0xb79c('0x47')],['ids','id'])||{})[_0xb79c('0x6c')](function(_0x581436){for(var _0x186d9d=0x0;_0x186d9d<_0x9b058c['body'][_0xb79c('0x5a')][_0xb79c('0x34')];_0x186d9d+=0x1){socket[_0xb79c('0x6d')](_0xb79c('0x6e'),{'UserId':_0x9b058c[_0xb79c('0x47')][_0xb79c('0x5a')][_0x186d9d],'TeamId':_0x9b058c[_0xb79c('0x44')]['id']});}return _0x581436;});}})[_0xb79c('0x22')](respondWithResult(_0xf5d507,null))[_0xb79c('0x43')](handleError(_0xf5d507,null));};exports[_0xb79c('0x6f')]=function(_0x11a77b,_0x3c25d5,_0x3757e4){return db['Team'][_0xb79c('0x49')]({'where':{'id':_0x11a77b[_0xb79c('0x44')]['id']}})[_0xb79c('0x22')](handleEntityNotFound(_0x3c25d5,null))['then'](function(_0x38eee7){if(_0x38eee7){return BPromise['each']([_0xb79c('0x70'),_0xb79c('0x71'),_0xb79c('0x72'),_0xb79c('0x73'),_0xb79c('0x74'),'openchannel'],function(_0x173315){return _0x38eee7['get'+_[_0xb79c('0x52')](_0x173315)+_0xb79c('0x55')]({'attributes':['id',_0xb79c('0x29')]})['then'](function(_0x2c7d65){return BPromise[_0xb79c('0x63')](_0x2c7d65,function(_0x29e0bb){return _0x29e0bb[_0xb79c('0x6f')](_0x11a77b[_0xb79c('0x2e')][_0xb79c('0x5a')])['then'](function(){if(_0x173315===_0xb79c('0x70')){return db[_0xb79c('0x68')][_0xb79c('0x23')]({'where':{'VoiceQueueId':_0x29e0bb['id'],'UserId':_0x11a77b[_0xb79c('0x2e')][_0xb79c('0x5a')]}});}});});})[_0xb79c('0x22')](function(){return _0x38eee7;});})[_0xb79c('0x22')](function(){return _0x38eee7;});}})['then'](function(_0x265512){if(_0x265512){return _0x265512['removeAgents'](_0x11a77b['query'][_0xb79c('0x5a')])[_0xb79c('0x22')](function(){if(_[_0xb79c('0x75')](_0x11a77b[_0xb79c('0x2e')]['ids'])){for(var _0x26a21e=0x0;_0x26a21e<_0x11a77b[_0xb79c('0x2e')][_0xb79c('0x5a')][_0xb79c('0x34')];_0x26a21e+=0x1){socket[_0xb79c('0x6d')](_0xb79c('0x76'),{'UserId':Number(_0x11a77b[_0xb79c('0x2e')]['ids'][_0x26a21e]),'TeamId':Number(_0x11a77b[_0xb79c('0x44')]['id'])});}}else{socket[_0xb79c('0x6d')]('userTeam:remove',{'UserId':Number(_0x11a77b[_0xb79c('0x2e')][_0xb79c('0x5a')]),'TeamId':Number(_0x11a77b[_0xb79c('0x44')]['id'])});}});}})[_0xb79c('0x22')](respondWithStatusCode(_0x3c25d5,null))['catch'](handleError(_0x3c25d5,null));};exports[_0xb79c('0x77')]=function(_0x38cd88,_0x58a55d,_0x33046d){var _0x12f794={};var _0x56de22={};var _0x48be28;var _0x26c830;return db['Team'][_0xb79c('0x4e')]({'where':{'id':_0x38cd88[_0xb79c('0x44')]['id']}})[_0xb79c('0x22')](handleEntityNotFound(_0x58a55d,null))[_0xb79c('0x22')](function(_0xd8747d){if(_0xd8747d){_0x48be28=_0xd8747d;_0x56de22[_0xb79c('0x31')]=_[_0xb79c('0x2d')](db['User'][_0xb79c('0x2c')]);_0x56de22['query']=_[_0xb79c('0x2d')](_0x38cd88[_0xb79c('0x2e')]);_0x56de22[_0xb79c('0x2f')]=_[_0xb79c('0x30')](_0x56de22['model'],_0x56de22[_0xb79c('0x2e')]);_0x12f794[_0xb79c('0x33')]=_[_0xb79c('0x30')](_0x56de22[_0xb79c('0x31')],qs[_0xb79c('0x32')](_0x38cd88[_0xb79c('0x2e')][_0xb79c('0x32')]));_0x12f794['attributes']=_0x12f794[_0xb79c('0x33')]['length']?_0x12f794['attributes']:_0x56de22[_0xb79c('0x31')];_0x12f794['order']=qs[_0xb79c('0x37')](_0x38cd88[_0xb79c('0x2e')][_0xb79c('0x37')]);_0x12f794[_0xb79c('0x38')]=qs[_0xb79c('0x2f')](_[_0xb79c('0x39')](_0x38cd88[_0xb79c('0x2e')],_0x56de22['filters']));if(_0x38cd88[_0xb79c('0x2e')][_0xb79c('0x3a')]){_0x12f794[_0xb79c('0x38')]=_[_0xb79c('0x3b')](_0x12f794[_0xb79c('0x38')],{'$or':_['map'](_0x12f794[_0xb79c('0x33')],function(_0x4d308b){var _0x5f272a={};_0x5f272a[_0x4d308b]={'$like':'%'+_0x38cd88['query']['filter']+'%'};return _0x5f272a;})});}_0x12f794=_[_0xb79c('0x3b')]({},_0x12f794,_0x38cd88[_0xb79c('0x40')]);return _0x48be28['getAgents'](_0x12f794);}})['then'](function(_0x5845f4){if(_0x5845f4){_0x26c830=_0x5845f4[_0xb79c('0x34')];if(!_0x38cd88['query']['hasOwnProperty']('nolimit')){_0x12f794[_0xb79c('0x1b')]=qs['limit'](_0x38cd88[_0xb79c('0x2e')]['limit']);_0x12f794['offset']=qs[_0xb79c('0x1a')](_0x38cd88['query'][_0xb79c('0x1a')]);}return _0x48be28['getAgents'](_0x12f794);}})['then'](function(_0x11c5ee){if(_0x11c5ee){return _0x11c5ee?{'count':_0x26c830,'rows':_0x11c5ee}:null;}})[_0xb79c('0x22')](respondWithResult(_0x58a55d,null))[_0xb79c('0x43')](handleError(_0x58a55d,null));}; \ No newline at end of file +var _0x0770=['save','update','then','destroy','get','Teams','UserProfileResource','sendStatus','error','stack','name','index','Team','rawAttributes','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','map','type','key','field','options','where','includeAll','include','findAll','rows','catch','params','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getQueues','findOne','channel','Sequelize','toLowerCase','Queue','addQueues','isValidChannel','Unknown\x20channel','add','capitalize','Queues','ids','ValidationError','remove','Voice','Chat','Mail','Sms','Fax','Openchannel','each','addAgents','User','online','voicePause','UserVoiceQueueRt','isNil','interface','SIP/%s','omit','spread','emit','userTeam:save','removeAgents','voice','chat','mail','sms','fax','isArray','userTeam:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','./team.socket','register','status','end','json','count','offset','set','apply','reject'];(function(_0x5c2c72,_0x22cf09){var _0x11c44c=function(_0x37bcca){while(--_0x37bcca){_0x5c2c72['push'](_0x5c2c72['shift']());}};_0x11c44c(++_0x22cf09);}(_0x0770,0x1e3));var _0x0077=function(_0x4c56b6,_0x239082){_0x4c56b6=_0x4c56b6-0x0;var _0x1ee73a=_0x0770[_0x4c56b6];return _0x1ee73a;};'use strict';var pdf=require(_0x0077('0x0'));var emlformat=require(_0x0077('0x1'));var rimraf=require(_0x0077('0x2'));var zipdir=require(_0x0077('0x3'));var jsonpatch=require(_0x0077('0x4'));var rp=require(_0x0077('0x5'));var moment=require(_0x0077('0x6'));var BPromise=require(_0x0077('0x7'));var Mustache=require(_0x0077('0x8'));var util=require(_0x0077('0x9'));var path=require(_0x0077('0xa'));var sox=require(_0x0077('0xb'));var csv=require(_0x0077('0xc'));var ejs=require(_0x0077('0xd'));var fs=require('fs');var _=require(_0x0077('0xe'));var squel=require(_0x0077('0xf'));var crypto=require('crypto');var jsforce=require(_0x0077('0x10'));var deskjs=require(_0x0077('0x11'));var toCsv=require(_0x0077('0xc'));var querystring=require(_0x0077('0x12'));var Papa=require(_0x0077('0x13'));var Redis=require(_0x0077('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x0077('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0077('0x16'));var utils=require('../../config/utils');var config=require(_0x0077('0x17'));var db=require(_0x0077('0x18'))['db'];config[_0x0077('0x19')]=_[_0x0077('0x1a')](config[_0x0077('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0077('0x19')]));require(_0x0077('0x1b'))[_0x0077('0x1c')](socket);function respondWithStatusCode(_0xf14d2b,_0x4b0b3c){_0x4b0b3c=_0x4b0b3c||0xcc;return function(_0xc83d81){if(_0xc83d81){return _0xf14d2b['sendStatus'](_0x4b0b3c);}return _0xf14d2b[_0x0077('0x1d')](_0x4b0b3c)[_0x0077('0x1e')]();};}function respondWithResult(_0x110f4d,_0x16d503){_0x16d503=_0x16d503||0xc8;return function(_0x478281){if(_0x478281){return _0x110f4d[_0x0077('0x1d')](_0x16d503)[_0x0077('0x1f')](_0x478281);}};}function respondWithFilteredResult(_0x11161c,_0x1b17ad){return function(_0x194f76){if(_0x194f76){var _0xe5568f=_0x194f76[_0x0077('0x20')],_0x41ba95=_0x1b17ad[_0x0077('0x21')],_0x455c33=_0x1b17ad[_0x0077('0x21')]+_0x1b17ad['limit'],_0xdbe673;if(_0x455c33>=_0xe5568f){_0x455c33=_0xe5568f;_0xdbe673=0xc8;}else{_0xdbe673=0xce;}_0x11161c[_0x0077('0x1d')](_0xdbe673);return _0x11161c[_0x0077('0x22')]('Content-Range',_0x41ba95+'-'+_0x455c33+'/'+_0xe5568f)[_0x0077('0x1f')](_0x194f76);}return null;};}function patchUpdates(_0xdd8576){return function(_0x2433df){try{jsonpatch[_0x0077('0x23')](_0x2433df,_0xdd8576,!![]);}catch(_0x599763){return BPromise[_0x0077('0x24')](_0x599763);}return _0x2433df[_0x0077('0x25')]();};}function saveUpdates(_0x978abb,_0x449312){return function(_0x14545d){if(_0x14545d){return _0x14545d[_0x0077('0x26')](_0x978abb)[_0x0077('0x27')](function(_0x1f44df){return _0x1f44df;});}return null;};}function removeEntity(_0x718712,_0x427b0e){return function(_0x2fd62f){if(_0x2fd62f){return _0x2fd62f[_0x0077('0x28')]()[_0x0077('0x27')](function(){var _0x578cb8=_0x2fd62f[_0x0077('0x29')]({'plain':!![]});var _0x170c37=_0x0077('0x2a');return db[_0x0077('0x2b')][_0x0077('0x28')]({'where':{'type':_0x170c37,'resourceId':_0x578cb8['id']}})[_0x0077('0x27')](function(){return _0x2fd62f;});})[_0x0077('0x27')](function(){_0x718712[_0x0077('0x1d')](0xcc)[_0x0077('0x1e')]();});}};}function handleEntityNotFound(_0x87be75,_0x1118ac){return function(_0x9eff3c){if(!_0x9eff3c){_0x87be75[_0x0077('0x2c')](0x194);}return _0x9eff3c;};}function handleError(_0x40557c,_0x302666){_0x302666=_0x302666||0x1f4;return function(_0x4fae63){logger[_0x0077('0x2d')](_0x4fae63[_0x0077('0x2e')]);if(_0x4fae63[_0x0077('0x2f')]){delete _0x4fae63[_0x0077('0x2f')];}_0x40557c['status'](_0x302666)['send'](_0x4fae63);};}exports[_0x0077('0x30')]=function(_0x484e67,_0x4827c7){var _0x32acc5={},_0x243416={},_0x288081={'count':0x0,'rows':[]};var _0x3ba8b4=db[_0x0077('0x31')][_0x0077('0x32')];_0x243416[_0x0077('0x33')]=_[_0x0077('0x34')](_0x3ba8b4);_0x243416['query']=_[_0x0077('0x34')](_0x484e67[_0x0077('0x35')]);_0x243416[_0x0077('0x36')]=_['intersection'](_0x243416['model'],_0x243416[_0x0077('0x35')]);_0x32acc5[_0x0077('0x37')]=_['intersection'](_0x243416[_0x0077('0x33')],qs[_0x0077('0x38')](_0x484e67['query'][_0x0077('0x38')]));_0x32acc5[_0x0077('0x37')]=_0x32acc5[_0x0077('0x37')][_0x0077('0x39')]?_0x32acc5[_0x0077('0x37')]:_0x243416[_0x0077('0x33')];if(!_0x484e67['query'][_0x0077('0x3a')](_0x0077('0x3b'))){_0x32acc5['limit']=qs[_0x0077('0x3c')](_0x484e67[_0x0077('0x35')][_0x0077('0x3c')]);_0x32acc5['offset']=qs[_0x0077('0x21')](_0x484e67[_0x0077('0x35')]['offset']);}_0x32acc5[_0x0077('0x3d')]=qs['sort'](_0x484e67[_0x0077('0x35')][_0x0077('0x3e')]);_0x32acc5['where']=qs[_0x0077('0x36')](_[_0x0077('0x3f')](_0x484e67[_0x0077('0x35')],_0x243416['filters']));if(_0x484e67[_0x0077('0x35')][_0x0077('0x40')]){_0x32acc5['where']=_[_0x0077('0x41')](_0x32acc5['where'],{'$or':_[_0x0077('0x42')](_0x3ba8b4,function(_0x43673d){if(_0x43673d[_0x0077('0x43')][_0x0077('0x44')]!=='VIRTUAL'){var _0x4302b4={};_0x4302b4[_0x43673d[_0x0077('0x45')]]={'$like':'%'+_0x484e67[_0x0077('0x35')]['filter']+'%'};return _0x4302b4;}})});}_0x32acc5=_[_0x0077('0x41')]({},_0x32acc5,_0x484e67[_0x0077('0x46')]);var _0x1433c8={'where':_0x32acc5[_0x0077('0x47')]};return db['Team'][_0x0077('0x20')](_0x1433c8)[_0x0077('0x27')](function(_0xe25fb3){_0x288081[_0x0077('0x20')]=_0xe25fb3;if(_0x484e67[_0x0077('0x35')][_0x0077('0x48')]){_0x32acc5[_0x0077('0x49')]=[{'all':!![]}];}return db['Team'][_0x0077('0x4a')](_0x32acc5);})[_0x0077('0x27')](function(_0x25c4bd){_0x288081[_0x0077('0x4b')]=_0x25c4bd;return _0x288081;})[_0x0077('0x27')](respondWithFilteredResult(_0x4827c7,_0x32acc5))[_0x0077('0x4c')](handleError(_0x4827c7,null));};exports['show']=function(_0x3bea86,_0x4c8b16){var _0x44e85a={'raw':![],'where':{'id':_0x3bea86[_0x0077('0x4d')]['id']}},_0x405ed1={};_0x405ed1[_0x0077('0x33')]=_[_0x0077('0x34')](db[_0x0077('0x31')][_0x0077('0x32')]);_0x405ed1[_0x0077('0x35')]=_[_0x0077('0x34')](_0x3bea86[_0x0077('0x35')]);_0x405ed1[_0x0077('0x36')]=_['intersection'](_0x405ed1[_0x0077('0x33')],_0x405ed1[_0x0077('0x35')]);_0x44e85a[_0x0077('0x37')]=_[_0x0077('0x4e')](_0x405ed1['model'],qs[_0x0077('0x38')](_0x3bea86[_0x0077('0x35')][_0x0077('0x38')]));_0x44e85a['attributes']=_0x44e85a[_0x0077('0x37')][_0x0077('0x39')]?_0x44e85a['attributes']:_0x405ed1[_0x0077('0x33')];if(_0x3bea86[_0x0077('0x35')]['includeAll']){_0x44e85a['include']=[{'all':!![]}];}_0x44e85a=_[_0x0077('0x41')]({},_0x44e85a,_0x3bea86[_0x0077('0x46')]);return db[_0x0077('0x31')][_0x0077('0x4f')](_0x44e85a)[_0x0077('0x27')](handleEntityNotFound(_0x4c8b16,null))[_0x0077('0x27')](respondWithResult(_0x4c8b16,null))[_0x0077('0x4c')](handleError(_0x4c8b16,null));};exports[_0x0077('0x50')]=function(_0x1b3bb2,_0x36bc78){return db['Team'][_0x0077('0x50')](_0x1b3bb2[_0x0077('0x51')],{})[_0x0077('0x27')](function(_0x4385cf){var _0x5364cc=_0x1b3bb2[_0x0077('0x52')]['get']({'plain':!![]});if(!_0x5364cc)throw new Error(_0x0077('0x53'));if(_0x5364cc['role']===_0x0077('0x52')){var _0x54c50c=_0x4385cf['get']({'plain':!![]});var _0x453e7a=_0x0077('0x2a');return db[_0x0077('0x54')][_0x0077('0x4f')]({'where':{'name':_0x453e7a,'userProfileId':_0x5364cc[_0x0077('0x55')]},'raw':!![]})[_0x0077('0x27')](function(_0x22079f){if(_0x22079f&&_0x22079f['autoAssociation']===0x0){return db[_0x0077('0x2b')][_0x0077('0x50')]({'name':_0x54c50c[_0x0077('0x2f')],'resourceId':_0x54c50c['id'],'type':_0x22079f['name'],'sectionId':_0x22079f['id']},{})[_0x0077('0x27')](function(){return _0x4385cf;});}else{return _0x4385cf;}})[_0x0077('0x4c')](function(_0x3394da){logger[_0x0077('0x2d')](_0x0077('0x56'),_0x3394da);throw _0x3394da;});}return _0x4385cf;})[_0x0077('0x27')](respondWithResult(_0x36bc78,0xc9))['catch'](handleError(_0x36bc78,null));};exports[_0x0077('0x26')]=function(_0x5af1b3,_0x2d42b3){if(_0x5af1b3['body']['id']){delete _0x5af1b3[_0x0077('0x51')]['id'];}return db[_0x0077('0x31')][_0x0077('0x4f')]({'where':{'id':_0x5af1b3[_0x0077('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2d42b3,null))['then'](saveUpdates(_0x5af1b3[_0x0077('0x51')],null))[_0x0077('0x27')](respondWithResult(_0x2d42b3,null))['catch'](handleError(_0x2d42b3,null));};exports['destroy']=function(_0x1e4a1f,_0x4dbe5f){return db[_0x0077('0x31')][_0x0077('0x4f')]({'where':{'id':_0x1e4a1f[_0x0077('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4dbe5f,null))[_0x0077('0x27')](removeEntity(_0x4dbe5f,null))[_0x0077('0x4c')](handleError(_0x4dbe5f,null));};exports[_0x0077('0x57')]=function(_0x128aec,_0x156e7f,_0x225dc2){return db[_0x0077('0x31')][_0x0077('0x58')]({'where':{'id':_0x128aec['params']['id']}})[_0x0077('0x27')](handleEntityNotFound(_0x156e7f,null))['then'](function(_0x2c490d){if(!_0x128aec[_0x0077('0x35')][_0x0077('0x59')]||!utils['isValidChannel'](_0x128aec['query']['channel'])){throw new db[(_0x0077('0x5a'))]['ValidationError']('Unknown\x20channel');}var _0x52e59={};var _0x8558ea={};_0x8558ea[_0x0077('0x33')]=_['keys'](db[_['capitalize'](_0x128aec[_0x0077('0x35')]['channel'][_0x0077('0x5b')]())+_0x0077('0x5c')]['rawAttributes']);_0x8558ea[_0x0077('0x35')]=_['keys'](_0x128aec[_0x0077('0x35')]);_0x8558ea[_0x0077('0x36')]=_[_0x0077('0x4e')](_0x8558ea[_0x0077('0x33')],_0x8558ea[_0x0077('0x35')]);_0x52e59['attributes']=_[_0x0077('0x4e')](_0x8558ea[_0x0077('0x33')],qs[_0x0077('0x38')](_0x128aec[_0x0077('0x35')]['fields']));_0x52e59['attributes']=_0x52e59['attributes'][_0x0077('0x39')]?_0x52e59['attributes']:_0x8558ea[_0x0077('0x33')];_0x52e59[_0x0077('0x3c')]=qs[_0x0077('0x3c')](_0x128aec[_0x0077('0x35')][_0x0077('0x3c')]);_0x52e59[_0x0077('0x21')]=qs[_0x0077('0x21')](_0x128aec[_0x0077('0x35')][_0x0077('0x21')]);_0x52e59[_0x0077('0x3d')]=qs[_0x0077('0x3e')](_0x128aec[_0x0077('0x35')]['sort']);_0x52e59[_0x0077('0x47')]=qs[_0x0077('0x36')](_[_0x0077('0x3f')](_0x128aec[_0x0077('0x35')],_0x8558ea[_0x0077('0x36')]));_0x52e59=_[_0x0077('0x41')]({},_0x52e59,_0x128aec[_0x0077('0x46')]);return _0x2c490d[_0x0077('0x29')+_['capitalize'](_0x128aec['query'][_0x0077('0x59')][_0x0077('0x5b')]())+'Queues'](_0x52e59);})['then'](respondWithResult(_0x156e7f,null))[_0x0077('0x4c')](handleError(_0x156e7f,null));};exports[_0x0077('0x5d')]=function(_0x35dbeb,_0x3fb3f5,_0x2997d3){return db[_0x0077('0x31')]['findOne']({'where':{'id':_0x35dbeb[_0x0077('0x4d')]['id']}})[_0x0077('0x27')](function(_0x5f2a5d){if(_0x5f2a5d){if(!_0x35dbeb[_0x0077('0x51')][_0x0077('0x59')]||!utils[_0x0077('0x5e')](_0x35dbeb[_0x0077('0x51')][_0x0077('0x59')])){throw new db[(_0x0077('0x5a'))]['ValidationError'](_0x0077('0x5f'));}return _0x5f2a5d[_0x0077('0x60')+_[_0x0077('0x61')](_0x35dbeb[_0x0077('0x51')][_0x0077('0x59')][_0x0077('0x5b')]())+_0x0077('0x62')](_0x35dbeb[_0x0077('0x51')][_0x0077('0x63')]);}return null;})['then'](handleEntityNotFound(_0x3fb3f5,null))[_0x0077('0x27')](respondWithStatusCode(_0x3fb3f5,null))['catch'](handleError(_0x3fb3f5,null));};exports['removeQueues']=function(_0x582c09,_0x4cdb6e,_0x3d4f90){return db[_0x0077('0x31')][_0x0077('0x58')]({'where':{'id':_0x582c09[_0x0077('0x4d')]['id']}})[_0x0077('0x27')](function(_0x505737){if(_0x505737){if(!_0x582c09[_0x0077('0x35')]['channel']||!utils[_0x0077('0x5e')](_0x582c09[_0x0077('0x35')]['channel'])){throw new db[(_0x0077('0x5a'))][(_0x0077('0x64'))](_0x0077('0x5f'));}return _0x505737[_0x0077('0x65')+_[_0x0077('0x61')](_0x582c09[_0x0077('0x35')][_0x0077('0x59')]['toLowerCase']())+_0x0077('0x62')](_0x582c09[_0x0077('0x35')][_0x0077('0x63')]);}return null;})['then'](handleEntityNotFound(_0x4cdb6e,null))[_0x0077('0x27')](respondWithStatusCode(_0x4cdb6e,null))[_0x0077('0x4c')](handleError(_0x4cdb6e,null));};exports['addAgents']=function(_0x4d517f,_0x227760,_0x312253){return db[_0x0077('0x31')][_0x0077('0x4f')]({'where':{'id':_0x4d517f[_0x0077('0x4d')]['id']}})['then'](handleEntityNotFound(_0x227760,null))[_0x0077('0x27')](function(_0x5918df){if(_0x5918df){var _0x18eaee=[_0x0077('0x66'),_0x0077('0x67'),_0x0077('0x68'),_0x0077('0x69'),_0x0077('0x6a'),_0x0077('0x6b')];return BPromise[_0x0077('0x6c')](_0x18eaee,function(_0x1b9bb5){return _0x5918df[_0x0077('0x29')+_0x1b9bb5+_0x0077('0x62')]({'attributes':['id',_0x0077('0x2f')]})[_0x0077('0x27')](function(_0x6cd8b5){return BPromise[_0x0077('0x6c')](_0x6cd8b5,function(_0x5a390c){return _0x5a390c[_0x0077('0x6d')](_0x4d517f[_0x0077('0x51')][_0x0077('0x63')])['then'](function(){if(_0x1b9bb5===_0x0077('0x66')){return db[_0x0077('0x6e')][_0x0077('0x4a')]({'where':{'id':_0x4d517f[_0x0077('0x51')][_0x0077('0x63')]},'attributes':['id','name',_0x0077('0x6f'),_0x0077('0x70'),'interface'],'raw':!![]})[_0x0077('0x27')](function(_0x5b151e){return BPromise[_0x0077('0x6c')](_['filter'](_0x5b151e,{'online':0x1}),function(_0x2d0474){return db[_0x0077('0x71')]['upsert']({'membername':_0x2d0474['name'],'UserId':_0x2d0474['id'],'queue_name':_0x5a390c[_0x0077('0x2f')],'VoiceQueueId':_0x5a390c['id'],'interface':_[_0x0077('0x72')](_0x2d0474[_0x0077('0x73')])?util['format'](_0x0077('0x74'),_0x2d0474[_0x0077('0x2f')]):_0x2d0474[_0x0077('0x73')],'paused':_0x2d0474['voicePause']||![],'penalty':0x0});});});}});});})['then'](function(){return _0x5918df;});})[_0x0077('0x27')](function(){return _0x5918df;});}})[_0x0077('0x27')](function(_0xa864cb){if(_0xa864cb){return _0xa864cb[_0x0077('0x6d')](_0x4d517f['body'][_0x0077('0x63')],_[_0x0077('0x75')](_0x4d517f[_0x0077('0x51')],[_0x0077('0x63'),'id'])||{})[_0x0077('0x76')](function(_0x3f26f0){for(var _0x133531=0x0;_0x133531<_0x4d517f[_0x0077('0x51')][_0x0077('0x63')][_0x0077('0x39')];_0x133531+=0x1){socket[_0x0077('0x77')](_0x0077('0x78'),{'UserId':_0x4d517f[_0x0077('0x51')][_0x0077('0x63')][_0x133531],'TeamId':_0x4d517f[_0x0077('0x4d')]['id']});}return _0x3f26f0;});}})[_0x0077('0x27')](respondWithResult(_0x227760,null))[_0x0077('0x4c')](handleError(_0x227760,null));};exports[_0x0077('0x79')]=function(_0x39037f,_0x5e0539,_0x41e539){return db['Team']['find']({'where':{'id':_0x39037f[_0x0077('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5e0539,null))['then'](function(_0xb07e0e){if(_0xb07e0e){return BPromise[_0x0077('0x6c')]([_0x0077('0x7a'),_0x0077('0x7b'),_0x0077('0x7c'),_0x0077('0x7d'),_0x0077('0x7e'),'openchannel'],function(_0x2093ce){return _0xb07e0e[_0x0077('0x29')+_[_0x0077('0x61')](_0x2093ce)+_0x0077('0x62')]({'attributes':['id',_0x0077('0x2f')]})['then'](function(_0x2792f8){return BPromise['each'](_0x2792f8,function(_0x23c264){return _0x23c264[_0x0077('0x79')](_0x39037f['query']['ids'])[_0x0077('0x27')](function(){if(_0x2093ce==='voice'){return db[_0x0077('0x71')]['destroy']({'where':{'VoiceQueueId':_0x23c264['id'],'UserId':_0x39037f[_0x0077('0x35')][_0x0077('0x63')]}});}});});})[_0x0077('0x27')](function(){return _0xb07e0e;});})[_0x0077('0x27')](function(){return _0xb07e0e;});}})['then'](function(_0xb51236){if(_0xb51236){return _0xb51236[_0x0077('0x79')](_0x39037f[_0x0077('0x35')][_0x0077('0x63')])[_0x0077('0x27')](function(){if(_[_0x0077('0x7f')](_0x39037f['query'][_0x0077('0x63')])){for(var _0x4a7e75=0x0;_0x4a7e75<_0x39037f[_0x0077('0x35')][_0x0077('0x63')][_0x0077('0x39')];_0x4a7e75+=0x1){socket[_0x0077('0x77')](_0x0077('0x80'),{'UserId':Number(_0x39037f[_0x0077('0x35')][_0x0077('0x63')][_0x4a7e75]),'TeamId':Number(_0x39037f[_0x0077('0x4d')]['id'])});}}else{socket['emit']('userTeam:remove',{'UserId':Number(_0x39037f['query'][_0x0077('0x63')]),'TeamId':Number(_0x39037f[_0x0077('0x4d')]['id'])});}});}})[_0x0077('0x27')](respondWithStatusCode(_0x5e0539,null))['catch'](handleError(_0x5e0539,null));};exports[_0x0077('0x81')]=function(_0x375dc1,_0x19da0a,_0x5f2a5e){var _0x4464d4={};var _0x102ea1={};var _0x45ed54;var _0x6b64b8;return db[_0x0077('0x31')][_0x0077('0x58')]({'where':{'id':_0x375dc1['params']['id']}})[_0x0077('0x27')](handleEntityNotFound(_0x19da0a,null))[_0x0077('0x27')](function(_0x503164){if(_0x503164){_0x45ed54=_0x503164;_0x102ea1[_0x0077('0x33')]=_[_0x0077('0x34')](db['User'][_0x0077('0x32')]);_0x102ea1[_0x0077('0x35')]=_[_0x0077('0x34')](_0x375dc1[_0x0077('0x35')]);_0x102ea1[_0x0077('0x36')]=_[_0x0077('0x4e')](_0x102ea1[_0x0077('0x33')],_0x102ea1[_0x0077('0x35')]);_0x4464d4['attributes']=_['intersection'](_0x102ea1[_0x0077('0x33')],qs[_0x0077('0x38')](_0x375dc1['query'][_0x0077('0x38')]));_0x4464d4[_0x0077('0x37')]=_0x4464d4[_0x0077('0x37')][_0x0077('0x39')]?_0x4464d4['attributes']:_0x102ea1[_0x0077('0x33')];_0x4464d4[_0x0077('0x3d')]=qs['sort'](_0x375dc1[_0x0077('0x35')][_0x0077('0x3e')]);_0x4464d4[_0x0077('0x47')]=qs['filters'](_['pick'](_0x375dc1[_0x0077('0x35')],_0x102ea1[_0x0077('0x36')]));if(_0x375dc1[_0x0077('0x35')][_0x0077('0x40')]){_0x4464d4[_0x0077('0x47')]=_[_0x0077('0x41')](_0x4464d4['where'],{'$or':_[_0x0077('0x42')](_0x4464d4['attributes'],function(_0x101889){var _0x5e1f13={};_0x5e1f13[_0x101889]={'$like':'%'+_0x375dc1['query'][_0x0077('0x40')]+'%'};return _0x5e1f13;})});}_0x4464d4=_[_0x0077('0x41')]({},_0x4464d4,_0x375dc1['options']);return _0x45ed54['getAgents'](_0x4464d4);}})[_0x0077('0x27')](function(_0x2ecfe3){if(_0x2ecfe3){_0x6b64b8=_0x2ecfe3[_0x0077('0x39')];if(!_0x375dc1[_0x0077('0x35')][_0x0077('0x3a')](_0x0077('0x3b'))){_0x4464d4[_0x0077('0x3c')]=qs[_0x0077('0x3c')](_0x375dc1[_0x0077('0x35')]['limit']);_0x4464d4[_0x0077('0x21')]=qs[_0x0077('0x21')](_0x375dc1[_0x0077('0x35')][_0x0077('0x21')]);}return _0x45ed54[_0x0077('0x81')](_0x4464d4);}})[_0x0077('0x27')](function(_0x4a0bd6){if(_0x4a0bd6){return _0x4a0bd6?{'count':_0x6b64b8,'rows':_0x4a0bd6}:null;}})[_0x0077('0x27')](respondWithResult(_0x19da0a,null))[_0x0077('0x4c')](handleError(_0x19da0a,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 8c4f241..415b3c5 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 _0x6050=['events','../../mysqldb','Team','setMaxListeners','save','update','hasOwnProperty'];(function(_0x389832,_0x10a4a9){var _0x59429e=function(_0x5f3562){while(--_0x5f3562){_0x389832['push'](_0x389832['shift']());}};_0x59429e(++_0x10a4a9);}(_0x6050,0x196));var _0x0605=function(_0x3870b2,_0x5a0f50){_0x3870b2=_0x3870b2-0x0;var _0x52300=_0x6050[_0x3870b2];return _0x52300;};'use strict';var EventEmitter=require(_0x0605('0x0'));var Team=require(_0x0605('0x1'))['db'][_0x0605('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x0605('0x3')](0x0);var events={'afterCreate':_0x0605('0x4'),'afterUpdate':_0x0605('0x5'),'afterDestroy':'remove'};function emitEvent(_0x22d595){return function(_0x4576f4,_0x43403d,_0x5797b0){TeamEvents['emit'](_0x22d595+':'+_0x4576f4['id'],_0x4576f4);TeamEvents['emit'](_0x22d595,_0x4576f4);_0x5797b0(null);};}for(var e in events){if(events[_0x0605('0x6')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0x68b3=['hook','exports','events','../../mysqldb','Team','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x68b3,0x1d8));var _0x368b=function(_0x277f21,_0x1c02e9){_0x277f21=_0x277f21-0x0;var _0x197e47=_0x68b3[_0x277f21];return _0x197e47;};'use strict';var EventEmitter=require(_0x368b('0x0'));var Team=require(_0x368b('0x1'))['db'][_0x368b('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x368b('0x3')](0x0);var events={'afterCreate':_0x368b('0x4'),'afterUpdate':'update','afterDestroy':_0x368b('0x5')};function emitEvent(_0x3325ac){return function(_0xc40116,_0x404282,_0x5d68cb){TeamEvents[_0x368b('0x6')](_0x3325ac+':'+_0xc40116['id'],_0xc40116);TeamEvents[_0x368b('0x6')](_0x3325ac,_0xc40116);_0x5d68cb(null);};}for(var e in events){if(events[_0x368b('0x7')](e)){var event=events[e];Team[_0x368b('0x8')](e,emitEvent(event));}}module[_0x368b('0x9')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 8537478..3c7e38b 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 _0x5cad=['teams','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./team.attributes','define','Team'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x5cad,0x175));var _0xd5ca=function(_0x13c2cf,_0x568ba5){_0x13c2cf=_0x13c2cf-0x0;var _0x237785=_0x5cad[_0x13c2cf];return _0x237785;};'use strict';var _=require(_0xd5ca('0x0'));var util=require(_0xd5ca('0x1'));var logger=require('../../config/logger')(_0xd5ca('0x2'));var moment=require(_0xd5ca('0x3'));var BPromise=require('bluebird');var rp=require(_0xd5ca('0x4'));var fs=require('fs');var path=require(_0xd5ca('0x5'));var rimraf=require(_0xd5ca('0x6'));var config=require(_0xd5ca('0x7'));var attributes=require(_0xd5ca('0x8'));module['exports']=function(_0x7eab22,_0x46433a){return _0x7eab22[_0xd5ca('0x9')](_0xd5ca('0xa'),attributes,{'tableName':_0xd5ca('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x762d=['moment','bluebird','path','rimraf','exports','define','lodash','util'];(function(_0x3851db,_0x529fc0){var _0x248c94=function(_0x4a1e0c){while(--_0x4a1e0c){_0x3851db['push'](_0x3851db['shift']());}};_0x248c94(++_0x529fc0);}(_0x762d,0x1ae));var _0xd762=function(_0x1f7a84,_0x21d84d){_0x1f7a84=_0x1f7a84-0x0;var _0x50a5d0=_0x762d[_0x1f7a84];return _0x50a5d0;};'use strict';var _=require(_0xd762('0x0'));var util=require(_0xd762('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd762('0x2'));var BPromise=require(_0xd762('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd762('0x4'));var rimraf=require(_0xd762('0x5'));var config=require('../../config/environment');var attributes=require('./team.attributes');module[_0xd762('0x6')]=function(_0xc7f695,_0x41206e){return _0xc7f695[_0xd762('0x7')]('Team',attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index cdcf23d..5a6d84b 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 _0x5632=['request','then','info','Team,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket'];(function(_0x1f7fb2,_0x116309){var _0x61fc27=function(_0x4b981c){while(--_0x4b981c){_0x1f7fb2['push'](_0x1f7fb2['shift']());}};_0x61fc27(++_0x116309);}(_0x5632,0xbf));var _0x2563=function(_0xd38565,_0x1f2a3e){_0xd38565=_0xd38565-0x0;var _0x11e4f6=_0x5632[_0xd38565];return _0x11e4f6;};'use strict';var _=require(_0x2563('0x0'));var util=require(_0x2563('0x1'));var moment=require(_0x2563('0x2'));var BPromise=require(_0x2563('0x3'));var rs=require(_0x2563('0x4'));var fs=require('fs');var Redis=require(_0x2563('0x5'));var db=require(_0x2563('0x6'))['db'];var utils=require(_0x2563('0x7'));var logger=require(_0x2563('0x8'))(_0x2563('0x9'));var config=require(_0x2563('0xa'));var jayson=require(_0x2563('0xb'));var client=jayson[_0x2563('0xc')][_0x2563('0xd')]({'port':0x232a});config[_0x2563('0xe')]=_[_0x2563('0xf')](config[_0x2563('0xe')],{'host':_0x2563('0x10'),'port':0x18eb});var socket=require(_0x2563('0x11'))(new Redis(config[_0x2563('0xe')]));require(_0x2563('0x12'))['register'](socket);function respondWithRpcPromise(_0x2677ee,_0x5d40e0,_0x38fa76){return new BPromise(function(_0x25d938,_0x3458bc){return client[_0x2563('0x13')](_0x2677ee,_0x38fa76)[_0x2563('0x14')](function(_0xbb6a01){logger[_0x2563('0x15')](_0x2563('0x16'),_0x5d40e0,'request\x20sent');logger['debug']('Team,\x20%s,\x20%s,\x20%s',_0x5d40e0,_0x2563('0x17'),JSON[_0x2563('0x18')](_0xbb6a01));if(_0xbb6a01['error']){if(_0xbb6a01[_0x2563('0x19')][_0x2563('0x1a')]===0x1f4){logger[_0x2563('0x19')](_0x2563('0x16'),_0x5d40e0,_0xbb6a01[_0x2563('0x19')][_0x2563('0x1b')]);return _0x3458bc(_0xbb6a01[_0x2563('0x19')][_0x2563('0x1b')]);}logger[_0x2563('0x19')](_0x2563('0x16'),_0x5d40e0,_0xbb6a01['error'][_0x2563('0x1b')]);return _0x25d938(_0xbb6a01[_0x2563('0x19')][_0x2563('0x1b')]);}else{logger[_0x2563('0x15')](_0x2563('0x16'),_0x5d40e0,_0x2563('0x17'));_0x25d938(_0xbb6a01[_0x2563('0x1c')][_0x2563('0x1b')]);}})[_0x2563('0x1d')](function(_0x9cb1bd){logger['error'](_0x2563('0x16'),_0x5d40e0,_0x9cb1bd);_0x3458bc(_0x9cb1bd);});});} \ No newline at end of file +var _0xe31d=['message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','debug','Team,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0xf6a62,_0x557fc6){var _0x4361b1=function(_0xa8969e){while(--_0xa8969e){_0xf6a62['push'](_0xf6a62['shift']());}};_0x4361b1(++_0x557fc6);}(_0xe31d,0x12f));var _0xde31=function(_0x591b22,_0xae1a71){_0x591b22=_0x591b22-0x0;var _0x2811f7=_0xe31d[_0x591b22];return _0x2811f7;};'use strict';var _=require(_0xde31('0x0'));var util=require('util');var moment=require(_0xde31('0x1'));var BPromise=require(_0xde31('0x2'));var rs=require(_0xde31('0x3'));var fs=require('fs');var Redis=require(_0xde31('0x4'));var db=require(_0xde31('0x5'))['db'];var utils=require(_0xde31('0x6'));var logger=require(_0xde31('0x7'))(_0xde31('0x8'));var config=require(_0xde31('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xde31('0xa')]['http']({'port':0x232a});config['redis']=_[_0xde31('0xb')](config[_0xde31('0xc')],{'host':_0xde31('0xd'),'port':0x18eb});var socket=require(_0xde31('0xe'))(new Redis(config[_0xde31('0xc')]));require(_0xde31('0xf'))[_0xde31('0x10')](socket);function respondWithRpcPromise(_0x58c107,_0x313a19,_0x11b1d7){return new BPromise(function(_0x213e91,_0x50bd37){return client[_0xde31('0x11')](_0x58c107,_0x11b1d7)[_0xde31('0x12')](function(_0x5b4a6c){logger[_0xde31('0x13')](_0xde31('0x14'),_0x313a19,'request\x20sent');logger[_0xde31('0x15')](_0xde31('0x16'),_0x313a19,_0xde31('0x17'),JSON[_0xde31('0x18')](_0x5b4a6c));if(_0x5b4a6c['error']){if(_0x5b4a6c[_0xde31('0x19')][_0xde31('0x1a')]===0x1f4){logger[_0xde31('0x19')](_0xde31('0x14'),_0x313a19,_0x5b4a6c[_0xde31('0x19')][_0xde31('0x1b')]);return _0x50bd37(_0x5b4a6c[_0xde31('0x19')]['message']);}logger[_0xde31('0x19')]('Team,\x20%s,\x20%s',_0x313a19,_0x5b4a6c[_0xde31('0x19')][_0xde31('0x1b')]);return _0x213e91(_0x5b4a6c[_0xde31('0x19')]['message']);}else{logger[_0xde31('0x13')](_0xde31('0x14'),_0x313a19,'request\x20sent');_0x213e91(_0x5b4a6c[_0xde31('0x1c')][_0xde31('0x1b')]);}})[_0xde31('0x1d')](function(_0x4eb4e2){logger[_0xde31('0x19')](_0xde31('0x14'),_0x313a19,_0x4eb4e2);_0x50bd37(_0x4eb4e2);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index bd3a888..c4fdca0 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 _0x64b8=['update','register','length','team:','./team.events','remove'];(function(_0xe7281f,_0x2d77c3){var _0x90dc99=function(_0x1e335b){while(--_0x1e335b){_0xe7281f['push'](_0xe7281f['shift']());}};_0x90dc99(++_0x2d77c3);}(_0x64b8,0x88));var _0x864b=function(_0x3e9fe4,_0x2b850e){_0x3e9fe4=_0x3e9fe4-0x0;var _0x24bf9b=_0x64b8[_0x3e9fe4];return _0x24bf9b;};'use strict';var TeamEvents=require(_0x864b('0x0'));var events=['save',_0x864b('0x1'),_0x864b('0x2')];function createListener(_0x1af383,_0xa3fcf5){return function(_0x5aa38b){_0xa3fcf5['emit'](_0x1af383,_0x5aa38b);};}function removeListener(_0xc56b5f,_0x25c3d3){return function(){TeamEvents['removeListener'](_0xc56b5f,_0x25c3d3);};}exports[_0x864b('0x3')]=function(_0x2f8f49){for(var _0x4b525d=0x0,_0x1896e7=events[_0x864b('0x4')];_0x4b525d<_0x1896e7;_0x4b525d++){var _0x1c1709=events[_0x4b525d];var _0x464a43=createListener(_0x864b('0x5')+_0x1c1709,_0x2f8f49);TeamEvents['on'](_0x1c1709,_0x464a43);}}; \ No newline at end of file +var _0x1ae7=['update','emit','removeListener','register','team:','./team.events','remove'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x1ae7,0x140));var _0x71ae=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0x1ae7[_0x18cd5b];return _0x5eaa52;};'use strict';var TeamEvents=require(_0x71ae('0x0'));var events=['save',_0x71ae('0x1'),_0x71ae('0x2')];function createListener(_0x4c4dd6,_0x52bd10){return function(_0x4befa8){_0x52bd10[_0x71ae('0x3')](_0x4c4dd6,_0x4befa8);};}function removeListener(_0x4eb4f8,_0x4d429d){return function(){TeamEvents[_0x71ae('0x4')](_0x4eb4f8,_0x4d429d);};}exports[_0x71ae('0x5')]=function(_0x4323c0){for(var _0x73289c=0x0,_0x286f4c=events['length'];_0x73289c<_0x286f4c;_0x73289c++){var _0x26d760=events[_0x73289c];var _0x31a978=createListener(_0x71ae('0x6')+_0x26d760,_0x4323c0);TeamEvents['on'](_0x26d760,_0x31a978);}}; \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 7e72148..67ca79b 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 _0xe689=['delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index','/:id','show','create','update'];(function(_0x552757,_0x55a52a){var _0x4263fd=function(_0x5332c2){while(--_0x5332c2){_0x552757['push'](_0x552757['shift']());}};_0x4263fd(++_0x55a52a);}(_0xe689,0x1d7));var _0x9e68=function(_0x28f5de,_0x3bff1d){_0x28f5de=_0x28f5de-0x0;var _0x534736=_0xe689[_0x28f5de];return _0x534736;};'use strict';var multer=require('multer');var util=require(_0x9e68('0x0'));var path=require(_0x9e68('0x1'));var timeout=require(_0x9e68('0x2'));var express=require(_0x9e68('0x3'));var router=express['Router']();var auth=require(_0x9e68('0x4'));var interaction=require(_0x9e68('0x5'));var config=require(_0x9e68('0x6'));var controller=require(_0x9e68('0x7'));router[_0x9e68('0x8')]('/',auth[_0x9e68('0x9')](),controller[_0x9e68('0xa')]);router[_0x9e68('0x8')](_0x9e68('0xb'),auth[_0x9e68('0x9')](),controller[_0x9e68('0xc')]);router['post']('/',auth[_0x9e68('0x9')](),controller[_0x9e68('0xd')]);router['put'](_0x9e68('0xb'),auth[_0x9e68('0x9')](),controller[_0x9e68('0xe')]);router[_0x9e68('0xf')](_0x9e68('0xb'),auth[_0x9e68('0x9')](),controller[_0x9e68('0x10')]);module[_0x9e68('0x11')]=router; \ No newline at end of file +var _0x9a8a=['../../components/auth/service','isAuthenticated','index','get','show','post','create','put','/:id','update','delete','destroy','exports','multer','connect-timeout'];(function(_0x4b25a8,_0x35c0d3){var _0xa7c2c1=function(_0x372853){while(--_0x372853){_0x4b25a8['push'](_0x4b25a8['shift']());}};_0xa7c2c1(++_0x35c0d3);}(_0x9a8a,0x193));var _0xa9a8=function(_0x14d077,_0x868d7b){_0x14d077=_0x14d077-0x0;var _0x124458=_0x9a8a[_0x14d077];return _0x124458;};'use strict';var multer=require(_0xa9a8('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa9a8('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0xa9a8('0x2'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./template.controller');router['get']('/',auth[_0xa9a8('0x3')](),controller[_0xa9a8('0x4')]);router[_0xa9a8('0x5')]('/:id',auth[_0xa9a8('0x3')](),controller[_0xa9a8('0x6')]);router[_0xa9a8('0x7')]('/',auth[_0xa9a8('0x3')](),controller[_0xa9a8('0x8')]);router[_0xa9a8('0x9')](_0xa9a8('0xa'),auth[_0xa9a8('0x3')](),controller[_0xa9a8('0xb')]);router[_0xa9a8('0xc')](_0xa9a8('0xa'),auth[_0xa9a8('0x3')](),controller[_0xa9a8('0xd')]);module[_0xa9a8('0xe')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 357de68..4fd3dff 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 _0x505f=['sequelize','exports','STRING'];(function(_0x3b3a82,_0x53b5e0){var _0x267063=function(_0x5aaf3d){while(--_0x5aaf3d){_0x3b3a82['push'](_0x3b3a82['shift']());}};_0x267063(++_0x53b5e0);}(_0x505f,0x1ce));var _0xf505=function(_0x237540,_0x164a4f){_0x237540=_0x237540-0x0;var _0x1aadaf=_0x505f[_0x237540];return _0x1aadaf;};'use strict';var Sequelize=require(_0xf505('0x0'));module[_0xf505('0x1')]={'name':{'type':Sequelize[_0xf505('0x2')]},'description':{'type':Sequelize[_0xf505('0x2')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x85a0=['exports','STRING','sequelize'];(function(_0x153e76,_0x54f30a){var _0x4d6f44=function(_0x4fab89){while(--_0x4fab89){_0x153e76['push'](_0x153e76['shift']());}};_0x4d6f44(++_0x54f30a);}(_0x85a0,0x9e));var _0x085a=function(_0x391eec,_0x2df0ef){_0x391eec=_0x391eec-0x0;var _0x3a025e=_0x85a0[_0x391eec];return _0x3a025e;};'use strict';var Sequelize=require(_0x085a('0x0'));module[_0x085a('0x1')]={'name':{'type':Sequelize[_0x085a('0x2')]},'description':{'type':Sequelize[_0x085a('0x2')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index f46d09f..53e7182 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 _0xceee=['index','Template','rawAttributes','keys','filters','intersection','model','query','attributes','fields','hasOwnProperty','sort','where','merge','map','key','VIRTUAL','field','filter','includeAll','include','findAll','catch','show','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Templates','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','then','get','UserProfileResource','stack','name','send'];(function(_0xac19a1,_0x56d8d3){var _0x27c278=function(_0x154572){while(--_0x154572){_0xac19a1['push'](_0xac19a1['shift']());}};_0x27c278(++_0x56d8d3);}(_0xceee,0xbb));var _0xecee=function(_0xa91e74,_0x54dc56){_0xa91e74=_0xa91e74-0x0;var _0x58c430=_0xceee[_0xa91e74];return _0x58c430;};'use strict';var pdf=require(_0xecee('0x0'));var emlformat=require(_0xecee('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xecee('0x2'));var rp=require(_0xecee('0x3'));var moment=require(_0xecee('0x4'));var BPromise=require(_0xecee('0x5'));var Mustache=require(_0xecee('0x6'));var util=require(_0xecee('0x7'));var path=require('path');var sox=require(_0xecee('0x8'));var csv=require(_0xecee('0x9'));var ejs=require(_0xecee('0xa'));var fs=require('fs');var _=require(_0xecee('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xecee('0xc'));var deskjs=require(_0xecee('0xd'));var toCsv=require('to-csv');var querystring=require(_0xecee('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xecee('0xf'));var qs=require(_0xecee('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xecee('0x11'));var config=require('../../config/environment');var db=require(_0xecee('0x12'))['db'];function respondWithStatusCode(_0x5b2034,_0x2556da){_0x2556da=_0x2556da||0xcc;return function(_0x9af27d){if(_0x9af27d){return _0x5b2034[_0xecee('0x13')](_0x2556da);}return _0x5b2034[_0xecee('0x14')](_0x2556da)[_0xecee('0x15')]();};}function respondWithResult(_0x182ff4,_0x24b240){_0x24b240=_0x24b240||0xc8;return function(_0x3d8a2f){if(_0x3d8a2f){return _0x182ff4['status'](_0x24b240)[_0xecee('0x16')](_0x3d8a2f);}};}function respondWithFilteredResult(_0x1db535,_0x1a2878){return function(_0x23c586){if(_0x23c586){var _0x3e04a0=_0x23c586[_0xecee('0x17')],_0x48a9be=_0x1a2878[_0xecee('0x18')],_0x4754df=_0x1a2878[_0xecee('0x18')]+_0x1a2878[_0xecee('0x19')],_0x13fe90;if(_0x4754df>=_0x3e04a0){_0x4754df=_0x3e04a0;_0x13fe90=0xc8;}else{_0x13fe90=0xce;}_0x1db535[_0xecee('0x14')](_0x13fe90);return _0x1db535[_0xecee('0x1a')](_0xecee('0x1b'),_0x48a9be+'-'+_0x4754df+'/'+_0x3e04a0)[_0xecee('0x16')](_0x23c586);}return null;};}function patchUpdates(_0x11d520){return function(_0x5f484f){try{jsonpatch[_0xecee('0x1c')](_0x5f484f,_0x11d520,!![]);}catch(_0x45a3af){return BPromise[_0xecee('0x1d')](_0x45a3af);}return _0x5f484f[_0xecee('0x1e')]();};}function saveUpdates(_0x318d33,_0x20efd5){return function(_0x481198){if(_0x481198){return _0x481198['update'](_0x318d33)['then'](function(_0x9f8c62){return _0x9f8c62;});}return null;};}function removeEntity(_0x378111,_0x532483){return function(_0x86fe0f){if(_0x86fe0f){return _0x86fe0f[_0xecee('0x1f')]()[_0xecee('0x20')](function(){var _0x39a1ad=_0x86fe0f[_0xecee('0x21')]({'plain':!![]});var _0xc4ef66='Templates';return db[_0xecee('0x22')]['destroy']({'where':{'type':_0xc4ef66,'resourceId':_0x39a1ad['id']}})[_0xecee('0x20')](function(){return _0x86fe0f;});})['then'](function(){_0x378111[_0xecee('0x14')](0xcc)[_0xecee('0x15')]();});}};}function handleEntityNotFound(_0x1ae344,_0x92055f){return function(_0x51f732){if(!_0x51f732){_0x1ae344['sendStatus'](0x194);}return _0x51f732;};}function handleError(_0x25b7af,_0x29f02c){_0x29f02c=_0x29f02c||0x1f4;return function(_0x2e6929){logger['error'](_0x2e6929[_0xecee('0x23')]);if(_0x2e6929[_0xecee('0x24')]){delete _0x2e6929[_0xecee('0x24')];}_0x25b7af[_0xecee('0x14')](_0x29f02c)[_0xecee('0x25')](_0x2e6929);};}exports[_0xecee('0x26')]=function(_0x4410d8,_0x42733d){var _0x4d5bb9={},_0x48e16b={},_0x72ae5f={'count':0x0,'rows':[]};var _0x1d5473=db[_0xecee('0x27')][_0xecee('0x28')];_0x48e16b['model']=_[_0xecee('0x29')](_0x1d5473);_0x48e16b['query']=_[_0xecee('0x29')](_0x4410d8['query']);_0x48e16b[_0xecee('0x2a')]=_[_0xecee('0x2b')](_0x48e16b[_0xecee('0x2c')],_0x48e16b[_0xecee('0x2d')]);_0x4d5bb9[_0xecee('0x2e')]=_['intersection'](_0x48e16b[_0xecee('0x2c')],qs[_0xecee('0x2f')](_0x4410d8[_0xecee('0x2d')][_0xecee('0x2f')]));_0x4d5bb9[_0xecee('0x2e')]=_0x4d5bb9[_0xecee('0x2e')]['length']?_0x4d5bb9[_0xecee('0x2e')]:_0x48e16b[_0xecee('0x2c')];if(!_0x4410d8['query'][_0xecee('0x30')]('nolimit')){_0x4d5bb9[_0xecee('0x19')]=qs['limit'](_0x4410d8['query'][_0xecee('0x19')]);_0x4d5bb9[_0xecee('0x18')]=qs[_0xecee('0x18')](_0x4410d8['query'][_0xecee('0x18')]);}_0x4d5bb9['order']=qs[_0xecee('0x31')](_0x4410d8[_0xecee('0x2d')]['sort']);_0x4d5bb9[_0xecee('0x32')]=qs['filters'](_['pick'](_0x4410d8[_0xecee('0x2d')],_0x48e16b[_0xecee('0x2a')]));if(_0x4410d8['query']['filter']){_0x4d5bb9['where']=_[_0xecee('0x33')](_0x4d5bb9[_0xecee('0x32')],{'$or':_[_0xecee('0x34')](_0x1d5473,function(_0x289698){if(_0x289698['type'][_0xecee('0x35')]!==_0xecee('0x36')){var _0x1054e2={};_0x1054e2[_0x289698[_0xecee('0x37')]]={'$like':'%'+_0x4410d8[_0xecee('0x2d')][_0xecee('0x38')]+'%'};return _0x1054e2;}})});}_0x4d5bb9=_[_0xecee('0x33')]({},_0x4d5bb9,_0x4410d8['options']);var _0x2c8e8b={'where':_0x4d5bb9[_0xecee('0x32')]};return db[_0xecee('0x27')][_0xecee('0x17')](_0x2c8e8b)[_0xecee('0x20')](function(_0x272a38){_0x72ae5f[_0xecee('0x17')]=_0x272a38;if(_0x4410d8[_0xecee('0x2d')][_0xecee('0x39')]){_0x4d5bb9[_0xecee('0x3a')]=[{'all':!![]}];}return db[_0xecee('0x27')][_0xecee('0x3b')](_0x4d5bb9);})[_0xecee('0x20')](function(_0x586c14){_0x72ae5f['rows']=_0x586c14;return _0x72ae5f;})[_0xecee('0x20')](respondWithFilteredResult(_0x42733d,_0x4d5bb9))[_0xecee('0x3c')](handleError(_0x42733d,null));};exports[_0xecee('0x3d')]=function(_0x3f5425,_0x52937f){var _0x21e7ca={'raw':!![],'where':{'id':_0x3f5425['params']['id']}},_0x5ae4ce={};_0x5ae4ce[_0xecee('0x2c')]=_[_0xecee('0x29')](db['Template'][_0xecee('0x28')]);_0x5ae4ce['query']=_[_0xecee('0x29')](_0x3f5425['query']);_0x5ae4ce[_0xecee('0x2a')]=_['intersection'](_0x5ae4ce[_0xecee('0x2c')],_0x5ae4ce['query']);_0x21e7ca['attributes']=_[_0xecee('0x2b')](_0x5ae4ce[_0xecee('0x2c')],qs[_0xecee('0x2f')](_0x3f5425[_0xecee('0x2d')][_0xecee('0x2f')]));_0x21e7ca[_0xecee('0x2e')]=_0x21e7ca[_0xecee('0x2e')][_0xecee('0x3e')]?_0x21e7ca[_0xecee('0x2e')]:_0x5ae4ce['model'];if(_0x3f5425[_0xecee('0x2d')][_0xecee('0x39')]){_0x21e7ca[_0xecee('0x3a')]=[{'all':!![]}];}_0x21e7ca=_[_0xecee('0x33')]({},_0x21e7ca,_0x3f5425['options']);return db[_0xecee('0x27')][_0xecee('0x3f')](_0x21e7ca)[_0xecee('0x20')](handleEntityNotFound(_0x52937f,null))[_0xecee('0x20')](respondWithResult(_0x52937f,null))[_0xecee('0x3c')](handleError(_0x52937f,null));};exports['create']=function(_0x2399c0,_0x43494a){return db[_0xecee('0x27')][_0xecee('0x40')](_0x2399c0[_0xecee('0x41')],{})[_0xecee('0x20')](function(_0x23398c){var _0x2d81c5=_0x2399c0['user'][_0xecee('0x21')]({'plain':!![]});if(!_0x2d81c5)throw new Error(_0xecee('0x42'));if(_0x2d81c5[_0xecee('0x43')]===_0xecee('0x44')){var _0x4ffe13=_0x23398c[_0xecee('0x21')]({'plain':!![]});var _0x1f8477=_0xecee('0x45');return db[_0xecee('0x46')]['find']({'where':{'name':_0x1f8477,'userProfileId':_0x2d81c5['userProfileId']},'raw':!![]})[_0xecee('0x20')](function(_0x14cead){if(_0x14cead&&_0x14cead[_0xecee('0x47')]===0x0){return db[_0xecee('0x22')][_0xecee('0x40')]({'name':_0x4ffe13[_0xecee('0x24')],'resourceId':_0x4ffe13['id'],'type':_0x14cead[_0xecee('0x24')],'sectionId':_0x14cead['id']},{})[_0xecee('0x20')](function(){return _0x23398c;});}else{return _0x23398c;}})[_0xecee('0x3c')](function(_0x19ac9f){logger[_0xecee('0x48')](_0xecee('0x49'),_0x19ac9f);throw _0x19ac9f;});}return _0x23398c;})[_0xecee('0x20')](respondWithResult(_0x43494a,0xc9))[_0xecee('0x3c')](handleError(_0x43494a,null));};exports['update']=function(_0xb08e02,_0x2ff792){if(_0xb08e02[_0xecee('0x41')]['id']){delete _0xb08e02[_0xecee('0x41')]['id'];}return db[_0xecee('0x27')]['find']({'where':{'id':_0xb08e02[_0xecee('0x4a')]['id']}})[_0xecee('0x20')](handleEntityNotFound(_0x2ff792,null))['then'](saveUpdates(_0xb08e02['body'],null))[_0xecee('0x20')](respondWithResult(_0x2ff792,null))[_0xecee('0x3c')](handleError(_0x2ff792,null));};exports[_0xecee('0x1f')]=function(_0x2fe4a8,_0xcbc4d8){return db[_0xecee('0x27')][_0xecee('0x3f')]({'where':{'id':_0x2fe4a8[_0xecee('0x4a')]['id']}})[_0xecee('0x20')](handleEntityNotFound(_0xcbc4d8,null))[_0xecee('0x20')](removeEntity(_0xcbc4d8,null))[_0xecee('0x3c')](handleError(_0xcbc4d8,null));}; \ No newline at end of file +var _0x0dee=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','html-pdf','eml-format','zip-dir','request-promise','moment','mustache','util','path','to-csv','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','count','offset','limit','set','Content-Range','json','apply','reject','save','then','destroy','get','Templates','UserProfileResource','status','error','stack','name','index','rawAttributes','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','map','type','key','VIRTUAL','field','options','Template','include','findAll','rows','show','keys','includeAll','catch','create','body'];(function(_0x56e272,_0x1e2750){var _0x335ee5=function(_0x268a01){while(--_0x268a01){_0x56e272['push'](_0x56e272['shift']());}};_0x335ee5(++_0x1e2750);}(_0x0dee,0xf7));var _0xe0de=function(_0x198268,_0x56d255){_0x198268=_0x198268-0x0;var _0x4e09a5=_0x0dee[_0x198268];return _0x4e09a5;};'use strict';var pdf=require(_0xe0de('0x0'));var emlformat=require(_0xe0de('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xe0de('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0de('0x3'));var moment=require(_0xe0de('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe0de('0x5'));var util=require(_0xe0de('0x6'));var path=require(_0xe0de('0x7'));var sox=require('sox');var csv=require(_0xe0de('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe0de('0x9'));var squel=require(_0xe0de('0xa'));var crypto=require(_0xe0de('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe0de('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe0de('0xd'));var Papa=require('papaparse');var Redis=require(_0xe0de('0xe'));var authService=require(_0xe0de('0xf'));var qs=require(_0xe0de('0x10'));var hardwareService=require(_0xe0de('0x11'));var logger=require('../../config/logger')(_0xe0de('0x12'));var utils=require(_0xe0de('0x13'));var config=require(_0xe0de('0x14'));var db=require(_0xe0de('0x15'))['db'];function respondWithStatusCode(_0x5ae03a,_0x5e44d6){_0x5e44d6=_0x5e44d6||0xcc;return function(_0xb0defb){if(_0xb0defb){return _0x5ae03a[_0xe0de('0x16')](_0x5e44d6);}return _0x5ae03a['status'](_0x5e44d6)['end']();};}function respondWithResult(_0x1ae0cd,_0x176fd6){_0x176fd6=_0x176fd6||0xc8;return function(_0x4e4c41){if(_0x4e4c41){return _0x1ae0cd['status'](_0x176fd6)['json'](_0x4e4c41);}};}function respondWithFilteredResult(_0x4adf3c,_0x1188b7){return function(_0x3ae86f){if(_0x3ae86f){var _0x363b5f=_0x3ae86f[_0xe0de('0x17')],_0xfc026b=_0x1188b7[_0xe0de('0x18')],_0xb711fb=_0x1188b7[_0xe0de('0x18')]+_0x1188b7[_0xe0de('0x19')],_0xee0ba8;if(_0xb711fb>=_0x363b5f){_0xb711fb=_0x363b5f;_0xee0ba8=0xc8;}else{_0xee0ba8=0xce;}_0x4adf3c['status'](_0xee0ba8);return _0x4adf3c[_0xe0de('0x1a')](_0xe0de('0x1b'),_0xfc026b+'-'+_0xb711fb+'/'+_0x363b5f)[_0xe0de('0x1c')](_0x3ae86f);}return null;};}function patchUpdates(_0x1f41d2){return function(_0x22c5b7){try{jsonpatch[_0xe0de('0x1d')](_0x22c5b7,_0x1f41d2,!![]);}catch(_0x4ea410){return BPromise[_0xe0de('0x1e')](_0x4ea410);}return _0x22c5b7[_0xe0de('0x1f')]();};}function saveUpdates(_0x194211,_0x509353){return function(_0x2d7ad8){if(_0x2d7ad8){return _0x2d7ad8['update'](_0x194211)[_0xe0de('0x20')](function(_0x5677f9){return _0x5677f9;});}return null;};}function removeEntity(_0x2ad10a,_0x5d77a9){return function(_0x2551f7){if(_0x2551f7){return _0x2551f7[_0xe0de('0x21')]()[_0xe0de('0x20')](function(){var _0x37cad1=_0x2551f7[_0xe0de('0x22')]({'plain':!![]});var _0x59bb8d=_0xe0de('0x23');return db[_0xe0de('0x24')]['destroy']({'where':{'type':_0x59bb8d,'resourceId':_0x37cad1['id']}})[_0xe0de('0x20')](function(){return _0x2551f7;});})[_0xe0de('0x20')](function(){_0x2ad10a[_0xe0de('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x523891,_0x5877f8){return function(_0x3a41a9){if(!_0x3a41a9){_0x523891[_0xe0de('0x16')](0x194);}return _0x3a41a9;};}function handleError(_0x58edf7,_0x241acd){_0x241acd=_0x241acd||0x1f4;return function(_0x31bab4){logger[_0xe0de('0x26')](_0x31bab4[_0xe0de('0x27')]);if(_0x31bab4['name']){delete _0x31bab4[_0xe0de('0x28')];}_0x58edf7[_0xe0de('0x25')](_0x241acd)['send'](_0x31bab4);};}exports[_0xe0de('0x29')]=function(_0x32ba02,_0x52b466){var _0x569787={},_0x48084f={},_0x4fec50={'count':0x0,'rows':[]};var _0x2e4e4f=db['Template'][_0xe0de('0x2a')];_0x48084f[_0xe0de('0x2b')]=_['keys'](_0x2e4e4f);_0x48084f[_0xe0de('0x2c')]=_['keys'](_0x32ba02[_0xe0de('0x2c')]);_0x48084f[_0xe0de('0x2d')]=_[_0xe0de('0x2e')](_0x48084f[_0xe0de('0x2b')],_0x48084f['query']);_0x569787['attributes']=_[_0xe0de('0x2e')](_0x48084f[_0xe0de('0x2b')],qs[_0xe0de('0x2f')](_0x32ba02['query'][_0xe0de('0x2f')]));_0x569787['attributes']=_0x569787[_0xe0de('0x30')][_0xe0de('0x31')]?_0x569787[_0xe0de('0x30')]:_0x48084f[_0xe0de('0x2b')];if(!_0x32ba02[_0xe0de('0x2c')][_0xe0de('0x32')](_0xe0de('0x33'))){_0x569787[_0xe0de('0x19')]=qs[_0xe0de('0x19')](_0x32ba02[_0xe0de('0x2c')][_0xe0de('0x19')]);_0x569787[_0xe0de('0x18')]=qs['offset'](_0x32ba02[_0xe0de('0x2c')][_0xe0de('0x18')]);}_0x569787[_0xe0de('0x34')]=qs['sort'](_0x32ba02[_0xe0de('0x2c')][_0xe0de('0x35')]);_0x569787['where']=qs[_0xe0de('0x2d')](_['pick'](_0x32ba02[_0xe0de('0x2c')],_0x48084f[_0xe0de('0x2d')]));if(_0x32ba02[_0xe0de('0x2c')][_0xe0de('0x36')]){_0x569787['where']=_[_0xe0de('0x37')](_0x569787[_0xe0de('0x38')],{'$or':_[_0xe0de('0x39')](_0x2e4e4f,function(_0x1aaa2c){if(_0x1aaa2c[_0xe0de('0x3a')][_0xe0de('0x3b')]!==_0xe0de('0x3c')){var _0x5b4c5c={};_0x5b4c5c[_0x1aaa2c[_0xe0de('0x3d')]]={'$like':'%'+_0x32ba02['query'][_0xe0de('0x36')]+'%'};return _0x5b4c5c;}})});}_0x569787=_[_0xe0de('0x37')]({},_0x569787,_0x32ba02[_0xe0de('0x3e')]);var _0x5d9bef={'where':_0x569787[_0xe0de('0x38')]};return db[_0xe0de('0x3f')]['count'](_0x5d9bef)[_0xe0de('0x20')](function(_0x582a36){_0x4fec50['count']=_0x582a36;if(_0x32ba02['query']['includeAll']){_0x569787[_0xe0de('0x40')]=[{'all':!![]}];}return db[_0xe0de('0x3f')][_0xe0de('0x41')](_0x569787);})[_0xe0de('0x20')](function(_0x91c9ac){_0x4fec50[_0xe0de('0x42')]=_0x91c9ac;return _0x4fec50;})[_0xe0de('0x20')](respondWithFilteredResult(_0x52b466,_0x569787))['catch'](handleError(_0x52b466,null));};exports[_0xe0de('0x43')]=function(_0x4f66fc,_0x5e91bb){var _0x5d595e={'raw':!![],'where':{'id':_0x4f66fc['params']['id']}},_0x391e60={};_0x391e60[_0xe0de('0x2b')]=_[_0xe0de('0x44')](db['Template']['rawAttributes']);_0x391e60[_0xe0de('0x2c')]=_['keys'](_0x4f66fc[_0xe0de('0x2c')]);_0x391e60[_0xe0de('0x2d')]=_[_0xe0de('0x2e')](_0x391e60[_0xe0de('0x2b')],_0x391e60[_0xe0de('0x2c')]);_0x5d595e['attributes']=_['intersection'](_0x391e60[_0xe0de('0x2b')],qs[_0xe0de('0x2f')](_0x4f66fc['query'][_0xe0de('0x2f')]));_0x5d595e[_0xe0de('0x30')]=_0x5d595e['attributes'][_0xe0de('0x31')]?_0x5d595e[_0xe0de('0x30')]:_0x391e60[_0xe0de('0x2b')];if(_0x4f66fc[_0xe0de('0x2c')][_0xe0de('0x45')]){_0x5d595e[_0xe0de('0x40')]=[{'all':!![]}];}_0x5d595e=_[_0xe0de('0x37')]({},_0x5d595e,_0x4f66fc['options']);return db[_0xe0de('0x3f')]['find'](_0x5d595e)[_0xe0de('0x20')](handleEntityNotFound(_0x5e91bb,null))[_0xe0de('0x20')](respondWithResult(_0x5e91bb,null))[_0xe0de('0x46')](handleError(_0x5e91bb,null));};exports['create']=function(_0x3c8af7,_0x5e36ac){return db['Template'][_0xe0de('0x47')](_0x3c8af7[_0xe0de('0x48')],{})[_0xe0de('0x20')](function(_0x33f588){var _0x2df3e7=_0x3c8af7[_0xe0de('0x49')][_0xe0de('0x22')]({'plain':!![]});if(!_0x2df3e7)throw new Error(_0xe0de('0x4a'));if(_0x2df3e7[_0xe0de('0x4b')]==='user'){var _0x3f5ce7=_0x33f588['get']({'plain':!![]});var _0x325ce7='Templates';return db[_0xe0de('0x4c')][_0xe0de('0x4d')]({'where':{'name':_0x325ce7,'userProfileId':_0x2df3e7['userProfileId']},'raw':!![]})[_0xe0de('0x20')](function(_0x411f80){if(_0x411f80&&_0x411f80['autoAssociation']===0x0){return db[_0xe0de('0x24')][_0xe0de('0x47')]({'name':_0x3f5ce7[_0xe0de('0x28')],'resourceId':_0x3f5ce7['id'],'type':_0x411f80['name'],'sectionId':_0x411f80['id']},{})[_0xe0de('0x20')](function(){return _0x33f588;});}else{return _0x33f588;}})[_0xe0de('0x46')](function(_0x100e7b){logger['error'](_0xe0de('0x4e'),_0x100e7b);throw _0x100e7b;});}return _0x33f588;})[_0xe0de('0x20')](respondWithResult(_0x5e36ac,0xc9))[_0xe0de('0x46')](handleError(_0x5e36ac,null));};exports['update']=function(_0x1a41f0,_0x577e12){if(_0x1a41f0[_0xe0de('0x48')]['id']){delete _0x1a41f0['body']['id'];}return db[_0xe0de('0x3f')][_0xe0de('0x4d')]({'where':{'id':_0x1a41f0[_0xe0de('0x4f')]['id']}})[_0xe0de('0x20')](handleEntityNotFound(_0x577e12,null))[_0xe0de('0x20')](saveUpdates(_0x1a41f0['body'],null))[_0xe0de('0x20')](respondWithResult(_0x577e12,null))['catch'](handleError(_0x577e12,null));};exports[_0xe0de('0x21')]=function(_0x591dea,_0x1a0de3){return db[_0xe0de('0x3f')][_0xe0de('0x4d')]({'where':{'id':_0x591dea['params']['id']}})['then'](handleEntityNotFound(_0x1a0de3,null))[_0xe0de('0x20')](removeEntity(_0x1a0de3,null))[_0xe0de('0x46')](handleError(_0x1a0de3,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index e22ef2a..5c5c807 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 _0x9c00=['path','rimraf','../../config/environment','./template.attributes','exports','define','Template','tools_templates','lodash','util','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c00,0x1a0));var _0x09c0=function(_0x3c8f26,_0x453699){_0x3c8f26=_0x3c8f26-0x0;var _0x5a4dd7=_0x9c00[_0x3c8f26];return _0x5a4dd7;};'use strict';var _=require(_0x09c0('0x0'));var util=require(_0x09c0('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x09c0('0x2'));var BPromise=require(_0x09c0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x09c0('0x4'));var rimraf=require(_0x09c0('0x5'));var config=require(_0x09c0('0x6'));var attributes=require(_0x09c0('0x7'));module[_0x09c0('0x8')]=function(_0x5914eb,_0x4d5fc3){return _0x5914eb[_0x09c0('0x9')](_0x09c0('0xa'),attributes,{'tableName':_0x09c0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0598=['Template','tools_templates','lodash','util','api','request-promise','path','exports'];(function(_0x151418,_0x2cbffa){var _0x40e29a=function(_0xec4d7){while(--_0xec4d7){_0x151418['push'](_0x151418['shift']());}};_0x40e29a(++_0x2cbffa);}(_0x0598,0x92));var _0x8059=function(_0x34b0c9,_0x3a57a1){_0x34b0c9=_0x34b0c9-0x0;var _0x2b571e=_0x0598[_0x34b0c9];return _0x2b571e;};'use strict';var _=require(_0x8059('0x0'));var util=require(_0x8059('0x1'));var logger=require('../../config/logger')(_0x8059('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8059('0x3'));var fs=require('fs');var path=require(_0x8059('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./template.attributes');module[_0x8059('0x5')]=function(_0xa7d7c1,_0x512c0f){return _0xa7d7c1['define'](_0x8059('0x6'),attributes,{'tableName':_0x8059('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 4e669a2..ed657bb 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 _0x7100=['request\x20sent','error','code','message','result','catch','GetTemplate','Template','findAll','options','raw','where','attributes','limit','map','include','model','stringify','lodash','util','moment','randomstring','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s'];(function(_0x2e2e25,_0x4591ac){var _0x49c7ba=function(_0x47771b){while(--_0x47771b){_0x2e2e25['push'](_0x2e2e25['shift']());}};_0x49c7ba(++_0x4591ac);}(_0x7100,0x167));var _0x0710=function(_0x4c9f6a,_0xcb2cb2){_0x4c9f6a=_0x4c9f6a-0x0;var _0x5df5b9=_0x7100[_0x4c9f6a];return _0x5df5b9;};'use strict';var _=require(_0x0710('0x0'));var util=require(_0x0710('0x1'));var moment=require(_0x0710('0x2'));var BPromise=require('bluebird');var rs=require(_0x0710('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0710('0x4'));var logger=require(_0x0710('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0710('0x6'));var client=jayson[_0x0710('0x7')][_0x0710('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c86fc,_0x5d233f,_0x2edd6a){return new BPromise(function(_0x13eeb7,_0xfbfb81){return client[_0x0710('0x9')](_0x3c86fc,_0x2edd6a)[_0x0710('0xa')](function(_0x1f83ad){logger[_0x0710('0xb')](_0x0710('0xc'),_0x5d233f,_0x0710('0xd'));logger['debug']('Template,\x20%s,\x20%s,\x20%s',_0x5d233f,_0x0710('0xd'),JSON['stringify'](_0x1f83ad));if(_0x1f83ad[_0x0710('0xe')]){if(_0x1f83ad[_0x0710('0xe')][_0x0710('0xf')]===0x1f4){logger[_0x0710('0xe')](_0x0710('0xc'),_0x5d233f,_0x1f83ad[_0x0710('0xe')][_0x0710('0x10')]);return _0xfbfb81(_0x1f83ad[_0x0710('0xe')]['message']);}logger['error']('Template,\x20%s,\x20%s',_0x5d233f,_0x1f83ad[_0x0710('0xe')]['message']);return _0x13eeb7(_0x1f83ad[_0x0710('0xe')][_0x0710('0x10')]);}else{logger[_0x0710('0xb')](_0x0710('0xc'),_0x5d233f,'request\x20sent');_0x13eeb7(_0x1f83ad[_0x0710('0x11')]['message']);}})[_0x0710('0x12')](function(_0x42a1cc){logger[_0x0710('0xe')]('Template,\x20%s,\x20%s',_0x5d233f,_0x42a1cc);_0xfbfb81(_0x42a1cc);});});}exports[_0x0710('0x13')]=function(_0x289079){var _0x1d84b5=this;return new Promise(function(_0x38b1a9,_0x3b1597){return db[_0x0710('0x14')][_0x0710('0x15')]({'raw':_0x289079[_0x0710('0x16')]?_0x289079[_0x0710('0x16')][_0x0710('0x17')]===undefined?!![]:![]:!![],'where':_0x289079[_0x0710('0x16')]?_0x289079['options'][_0x0710('0x18')]||null:null,'attributes':_0x289079['options']?_0x289079[_0x0710('0x16')][_0x0710('0x19')]||null:null,'limit':_0x289079[_0x0710('0x16')]?_0x289079['options'][_0x0710('0x1a')]||null:null,'include':_0x289079[_0x0710('0x16')]?_0x289079['options']['include']?_[_0x0710('0x1b')](_0x289079[_0x0710('0x16')][_0x0710('0x1c')],function(_0x4b0fe6){return{'model':db[_0x4b0fe6[_0x0710('0x1d')]],'as':_0x4b0fe6['as'],'attributes':_0x4b0fe6['attributes'],'include':_0x4b0fe6[_0x0710('0x1c')]?_[_0x0710('0x1b')](_0x4b0fe6[_0x0710('0x1c')],function(_0x4748c3){return{'model':db[_0x4748c3[_0x0710('0x1d')]],'as':_0x4748c3['as'],'attributes':_0x4748c3[_0x0710('0x19')],'include':_0x4748c3['include']?_['map'](_0x4748c3[_0x0710('0x1c')],function(_0x1c7b2e){return{'model':db[_0x1c7b2e[_0x0710('0x1d')]],'as':_0x1c7b2e['as'],'attributes':_0x1c7b2e['attributes']};}):[]};}):[]};}):[]:[]})[_0x0710('0xa')](function(_0x14e6a9){logger['info'](_0x0710('0x13'),_0x289079);logger['debug'](_0x0710('0x13'),_0x289079,JSON[_0x0710('0x1e')](_0x14e6a9));_0x38b1a9(_0x14e6a9);})[_0x0710('0x12')](function(_0x57924d){logger['error'](_0x0710('0x13'),_0x57924d[_0x0710('0x10')],_0x289079);_0x3b1597(_0x1d84b5[_0x0710('0xe')](0x1f4,_0x57924d['message']));});});}; \ No newline at end of file +var _0xa242=['GetTemplate','Template','findAll','options','raw','limit','include','map','attributes','model','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result'];(function(_0x31f308,_0x3db808){var _0x24faed=function(_0x55f55a){while(--_0x55f55a){_0x31f308['push'](_0x31f308['shift']());}};_0x24faed(++_0x3db808);}(_0xa242,0x12c));var _0x2a24=function(_0x480a3e,_0x151f0c){_0x480a3e=_0x480a3e-0x0;var _0x1187e6=_0xa242[_0x480a3e];return _0x1187e6;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x2a24('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2a24('0x1'));var db=require(_0x2a24('0x2'))['db'];var utils=require(_0x2a24('0x3'));var logger=require(_0x2a24('0x4'))(_0x2a24('0x5'));var config=require('../../config/environment');var jayson=require(_0x2a24('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x21b6e3,_0x2be5c7,_0x293fd2){return new BPromise(function(_0x4e9a78,_0x4b3388){return client[_0x2a24('0x7')](_0x21b6e3,_0x293fd2)[_0x2a24('0x8')](function(_0x2c3ea0){logger[_0x2a24('0x9')](_0x2a24('0xa'),_0x2be5c7,'request\x20sent');logger[_0x2a24('0xb')](_0x2a24('0xc'),_0x2be5c7,'request\x20sent',JSON[_0x2a24('0xd')](_0x2c3ea0));if(_0x2c3ea0['error']){if(_0x2c3ea0[_0x2a24('0xe')][_0x2a24('0xf')]===0x1f4){logger[_0x2a24('0xe')](_0x2a24('0xa'),_0x2be5c7,_0x2c3ea0['error'][_0x2a24('0x10')]);return _0x4b3388(_0x2c3ea0[_0x2a24('0xe')]['message']);}logger[_0x2a24('0xe')](_0x2a24('0xa'),_0x2be5c7,_0x2c3ea0['error'][_0x2a24('0x10')]);return _0x4e9a78(_0x2c3ea0[_0x2a24('0xe')][_0x2a24('0x10')]);}else{logger[_0x2a24('0x9')]('Template,\x20%s,\x20%s',_0x2be5c7,_0x2a24('0x11'));_0x4e9a78(_0x2c3ea0[_0x2a24('0x12')][_0x2a24('0x10')]);}})['catch'](function(_0x4fd4d5){logger[_0x2a24('0xe')](_0x2a24('0xa'),_0x2be5c7,_0x4fd4d5);_0x4b3388(_0x4fd4d5);});});}exports[_0x2a24('0x13')]=function(_0x16c2c3){var _0x360d81=this;return new Promise(function(_0x4107c4,_0x3441e3){return db[_0x2a24('0x14')][_0x2a24('0x15')]({'raw':_0x16c2c3[_0x2a24('0x16')]?_0x16c2c3['options'][_0x2a24('0x17')]===undefined?!![]:![]:!![],'where':_0x16c2c3[_0x2a24('0x16')]?_0x16c2c3[_0x2a24('0x16')]['where']||null:null,'attributes':_0x16c2c3[_0x2a24('0x16')]?_0x16c2c3['options']['attributes']||null:null,'limit':_0x16c2c3[_0x2a24('0x16')]?_0x16c2c3[_0x2a24('0x16')][_0x2a24('0x18')]||null:null,'include':_0x16c2c3['options']?_0x16c2c3[_0x2a24('0x16')][_0x2a24('0x19')]?_[_0x2a24('0x1a')](_0x16c2c3[_0x2a24('0x16')][_0x2a24('0x19')],function(_0x5d56e4){return{'model':db[_0x5d56e4['model']],'as':_0x5d56e4['as'],'attributes':_0x5d56e4[_0x2a24('0x1b')],'include':_0x5d56e4['include']?_['map'](_0x5d56e4[_0x2a24('0x19')],function(_0x119848){return{'model':db[_0x119848[_0x2a24('0x1c')]],'as':_0x119848['as'],'attributes':_0x119848[_0x2a24('0x1b')],'include':_0x119848[_0x2a24('0x19')]?_[_0x2a24('0x1a')](_0x119848[_0x2a24('0x19')],function(_0x2d35aa){return{'model':db[_0x2d35aa[_0x2a24('0x1c')]],'as':_0x2d35aa['as'],'attributes':_0x2d35aa[_0x2a24('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2a24('0x8')](function(_0x446975){logger[_0x2a24('0x9')](_0x2a24('0x13'),_0x16c2c3);logger[_0x2a24('0xb')](_0x2a24('0x13'),_0x16c2c3,JSON[_0x2a24('0xd')](_0x446975));_0x4107c4(_0x446975);})['catch'](function(_0x21f412){logger[_0x2a24('0xe')]('GetTemplate',_0x21f412[_0x2a24('0x10')],_0x16c2c3);_0x3441e3(_0x360d81[_0x2a24('0xe')](0x1f4,_0x21f412[_0x2a24('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index c2adc7d..fcc78f2 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(_0x452426,_0x4961d5){var _0x5d560c=function(_0x5ccf42){while(--_0x5ccf42){_0x452426['push'](_0x452426['shift']());}};_0x5d560c(++_0x4961d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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(_0x127044,_0x3fb785){var _0x391986=function(_0x42bfb4){while(--_0x42bfb4){_0x127044['push'](_0x127044['shift']());}};_0x391986(++_0x3fb785);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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 d4c0946..7d09d5f 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 _0xaee5=['exports','STRING','BOOLEAN'];(function(_0x4ab9d9,_0x23831d){var _0x546e63=function(_0x28c653){while(--_0x28c653){_0x4ab9d9['push'](_0x4ab9d9['shift']());}};_0x546e63(++_0x23831d);}(_0xaee5,0x105));var _0x5aee=function(_0x24ba37,_0x29f57b){_0x24ba37=_0x24ba37-0x0;var _0xcbd3fb=_0xaee5[_0x24ba37];return _0xcbd3fb;};'use strict';var Sequelize=require('sequelize');module[_0x5aee('0x0')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x5aee('0x1')]},'description':{'type':Sequelize[_0x5aee('0x1')]},'status':{'type':Sequelize[_0x5aee('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xe6db=['STRING','sequelize'];(function(_0x48b473,_0x51c3af){var _0x299d69=function(_0x1ae01b){while(--_0x1ae01b){_0x48b473['push'](_0x48b473['shift']());}};_0x299d69(++_0x51c3af);}(_0xe6db,0x161));var _0xbe6d=function(_0x569a10,_0x520236){_0x569a10=_0x569a10-0x0;var _0x56f370=_0xe6db[_0x569a10];return _0x56f370;};'use strict';var Sequelize=require(_0xbe6d('0x0'));module['exports']={'name':{'type':Sequelize[_0xbe6d('0x1')]},'channel':{'type':Sequelize[_0xbe6d('0x1')]},'description':{'type':Sequelize[_0xbe6d('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 5f7528f..bb1a720 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 _0x6dc3=['filter','merge','map','type','key','VIRTUAL','field','includeAll','include','findAll','rows','catch','params','options','find','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','create','body','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','order','nolimit','getAnyConditions','Action','getActions','html-pdf','eml-format','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/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','reject','update','then','destroy','get','Triggers','UserProfileResource','error','name','send','Trigger','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick'];(function(_0x18079c,_0x98f8c4){var _0x3cdf1b=function(_0x5ca999){while(--_0x5ca999){_0x18079c['push'](_0x18079c['shift']());}};_0x3cdf1b(++_0x98f8c4);}(_0x6dc3,0x1e9));var _0x36dc=function(_0x5e1fa9,_0x1bae45){_0x5e1fa9=_0x5e1fa9-0x0;var _0x4e86a2=_0x6dc3[_0x5e1fa9];return _0x4e86a2;};'use strict';var pdf=require(_0x36dc('0x0'));var emlformat=require(_0x36dc('0x1'));var rimraf=require(_0x36dc('0x2'));var zipdir=require(_0x36dc('0x3'));var jsonpatch=require(_0x36dc('0x4'));var rp=require(_0x36dc('0x5'));var moment=require(_0x36dc('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x36dc('0x7'));var util=require(_0x36dc('0x8'));var path=require(_0x36dc('0x9'));var sox=require(_0x36dc('0xa'));var csv=require(_0x36dc('0xb'));var ejs=require(_0x36dc('0xc'));var fs=require('fs');var _=require(_0x36dc('0xd'));var squel=require(_0x36dc('0xe'));var crypto=require(_0x36dc('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x36dc('0x10'));var toCsv=require(_0x36dc('0xb'));var querystring=require('querystring');var Papa=require(_0x36dc('0x11'));var Redis=require(_0x36dc('0x12'));var authService=require(_0x36dc('0x13'));var qs=require(_0x36dc('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x36dc('0x15'))(_0x36dc('0x16'));var utils=require(_0x36dc('0x17'));var config=require(_0x36dc('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14f0c3,_0x240d43){_0x240d43=_0x240d43||0xcc;return function(_0x16116d){if(_0x16116d){return _0x14f0c3[_0x36dc('0x19')](_0x240d43);}return _0x14f0c3[_0x36dc('0x1a')](_0x240d43)[_0x36dc('0x1b')]();};}function respondWithResult(_0xd97ed8,_0x154f70){_0x154f70=_0x154f70||0xc8;return function(_0x3bbfad){if(_0x3bbfad){return _0xd97ed8[_0x36dc('0x1a')](_0x154f70)[_0x36dc('0x1c')](_0x3bbfad);}};}function respondWithFilteredResult(_0x246411,_0xd1da61){return function(_0x53bcc2){if(_0x53bcc2){var _0x302c95=_0x53bcc2[_0x36dc('0x1d')],_0x48557d=_0xd1da61[_0x36dc('0x1e')],_0x3b8dbf=_0xd1da61[_0x36dc('0x1e')]+_0xd1da61[_0x36dc('0x1f')],_0x437adc;if(_0x3b8dbf>=_0x302c95){_0x3b8dbf=_0x302c95;_0x437adc=0xc8;}else{_0x437adc=0xce;}_0x246411[_0x36dc('0x1a')](_0x437adc);return _0x246411[_0x36dc('0x20')]('Content-Range',_0x48557d+'-'+_0x3b8dbf+'/'+_0x302c95)[_0x36dc('0x1c')](_0x53bcc2);}return null;};}function patchUpdates(_0x40b076){return function(_0x452384){try{jsonpatch['apply'](_0x452384,_0x40b076,!![]);}catch(_0xb94045){return BPromise[_0x36dc('0x21')](_0xb94045);}return _0x452384['save']();};}function saveUpdates(_0x5d3c52,_0x3197d2){return function(_0x48d879){if(_0x48d879){return _0x48d879[_0x36dc('0x22')](_0x5d3c52)[_0x36dc('0x23')](function(_0x5d0948){return _0x5d0948;});}return null;};}function removeEntity(_0x58dec6,_0x473c1f){return function(_0xf8a7c){if(_0xf8a7c){return _0xf8a7c[_0x36dc('0x24')]()[_0x36dc('0x23')](function(){var _0x11bc91=_0xf8a7c[_0x36dc('0x25')]({'plain':!![]});var _0x26f466=_0x36dc('0x26');return db[_0x36dc('0x27')][_0x36dc('0x24')]({'where':{'type':_0x26f466,'resourceId':_0x11bc91['id']}})[_0x36dc('0x23')](function(){return _0xf8a7c;});})[_0x36dc('0x23')](function(){_0x58dec6['status'](0xcc)[_0x36dc('0x1b')]();});}};}function handleEntityNotFound(_0x4ad1cf,_0x462053){return function(_0x59947d){if(!_0x59947d){_0x4ad1cf['sendStatus'](0x194);}return _0x59947d;};}function handleError(_0xc8d3b1,_0x19825b){_0x19825b=_0x19825b||0x1f4;return function(_0x22ce2c){logger[_0x36dc('0x28')](_0x22ce2c['stack']);if(_0x22ce2c[_0x36dc('0x29')]){delete _0x22ce2c[_0x36dc('0x29')];}_0xc8d3b1[_0x36dc('0x1a')](_0x19825b)[_0x36dc('0x2a')](_0x22ce2c);};}exports['index']=function(_0x3e1ad6,_0x759fa5){var _0x2c5d15={},_0x308aa5={},_0x2ab23b={'count':0x0,'rows':[]};var _0x5db632=db[_0x36dc('0x2b')][_0x36dc('0x2c')];_0x308aa5[_0x36dc('0x2d')]=_['keys'](_0x5db632);_0x308aa5[_0x36dc('0x2e')]=_[_0x36dc('0x2f')](_0x3e1ad6['query']);_0x308aa5[_0x36dc('0x30')]=_[_0x36dc('0x31')](_0x308aa5[_0x36dc('0x2d')],_0x308aa5['query']);_0x2c5d15[_0x36dc('0x32')]=_[_0x36dc('0x31')](_0x308aa5['model'],qs['fields'](_0x3e1ad6[_0x36dc('0x2e')][_0x36dc('0x33')]));_0x2c5d15[_0x36dc('0x32')]=_0x2c5d15[_0x36dc('0x32')][_0x36dc('0x34')]?_0x2c5d15[_0x36dc('0x32')]:_0x308aa5[_0x36dc('0x2d')];if(!_0x3e1ad6[_0x36dc('0x2e')][_0x36dc('0x35')]('nolimit')){_0x2c5d15['limit']=qs[_0x36dc('0x1f')](_0x3e1ad6[_0x36dc('0x2e')]['limit']);_0x2c5d15[_0x36dc('0x1e')]=qs[_0x36dc('0x1e')](_0x3e1ad6[_0x36dc('0x2e')][_0x36dc('0x1e')]);}_0x2c5d15['order']=qs['sort'](_0x3e1ad6[_0x36dc('0x2e')][_0x36dc('0x36')]);_0x2c5d15[_0x36dc('0x37')]=qs[_0x36dc('0x30')](_[_0x36dc('0x38')](_0x3e1ad6[_0x36dc('0x2e')],_0x308aa5['filters']));if(_0x3e1ad6[_0x36dc('0x2e')][_0x36dc('0x39')]){_0x2c5d15['where']=_[_0x36dc('0x3a')](_0x2c5d15[_0x36dc('0x37')],{'$or':_[_0x36dc('0x3b')](_0x5db632,function(_0x1f1789){if(_0x1f1789[_0x36dc('0x3c')][_0x36dc('0x3d')]!==_0x36dc('0x3e')){var _0x457a32={};_0x457a32[_0x1f1789[_0x36dc('0x3f')]]={'$like':'%'+_0x3e1ad6[_0x36dc('0x2e')][_0x36dc('0x39')]+'%'};return _0x457a32;}})});}_0x2c5d15=_[_0x36dc('0x3a')]({},_0x2c5d15,_0x3e1ad6['options']);var _0x126f46={'where':_0x2c5d15['where']};return db[_0x36dc('0x2b')][_0x36dc('0x1d')](_0x126f46)[_0x36dc('0x23')](function(_0x57ba38){_0x2ab23b[_0x36dc('0x1d')]=_0x57ba38;if(_0x3e1ad6[_0x36dc('0x2e')][_0x36dc('0x40')]){_0x2c5d15[_0x36dc('0x41')]=[{'all':!![]}];}return db[_0x36dc('0x2b')][_0x36dc('0x42')](_0x2c5d15);})[_0x36dc('0x23')](function(_0x1edbba){_0x2ab23b[_0x36dc('0x43')]=_0x1edbba;return _0x2ab23b;})[_0x36dc('0x23')](respondWithFilteredResult(_0x759fa5,_0x2c5d15))[_0x36dc('0x44')](handleError(_0x759fa5,null));};exports['show']=function(_0x255a93,_0x16894f){var _0x5c2d05={'raw':![],'where':{'id':_0x255a93[_0x36dc('0x45')]['id']}},_0x590401={};_0x590401[_0x36dc('0x2d')]=_[_0x36dc('0x2f')](db['Trigger'][_0x36dc('0x2c')]);_0x590401[_0x36dc('0x2e')]=_[_0x36dc('0x2f')](_0x255a93[_0x36dc('0x2e')]);_0x590401[_0x36dc('0x30')]=_[_0x36dc('0x31')](_0x590401[_0x36dc('0x2d')],_0x590401['query']);_0x5c2d05[_0x36dc('0x32')]=_['intersection'](_0x590401[_0x36dc('0x2d')],qs[_0x36dc('0x33')](_0x255a93[_0x36dc('0x2e')][_0x36dc('0x33')]));_0x5c2d05[_0x36dc('0x32')]=_0x5c2d05['attributes'][_0x36dc('0x34')]?_0x5c2d05[_0x36dc('0x32')]:_0x590401[_0x36dc('0x2d')];if(_0x255a93['query']['includeAll']){_0x5c2d05['include']=[{'all':!![]}];}_0x5c2d05=_[_0x36dc('0x3a')]({},_0x5c2d05,_0x255a93[_0x36dc('0x46')]);return db[_0x36dc('0x2b')][_0x36dc('0x47')](_0x5c2d05)[_0x36dc('0x23')](handleEntityNotFound(_0x16894f,null))[_0x36dc('0x23')](respondWithResult(_0x16894f,null))[_0x36dc('0x44')](handleError(_0x16894f,null));};exports['create']=function(_0x4d8068,_0x544674){return db[_0x36dc('0x2b')]['create'](_0x4d8068['body'],{})['then'](function(_0x2127b3){var _0x331383=_0x4d8068['user'][_0x36dc('0x25')]({'plain':!![]});if(!_0x331383)throw new Error(_0x36dc('0x48'));if(_0x331383[_0x36dc('0x49')]===_0x36dc('0x4a')){var _0x2ee4e5=_0x2127b3['get']({'plain':!![]});var _0xabbf8b=_0x36dc('0x26');return db[_0x36dc('0x4b')][_0x36dc('0x47')]({'where':{'name':_0xabbf8b,'userProfileId':_0x331383[_0x36dc('0x4c')]},'raw':!![]})[_0x36dc('0x23')](function(_0x33b830){if(_0x33b830&&_0x33b830['autoAssociation']===0x0){return db[_0x36dc('0x27')][_0x36dc('0x4d')]({'name':_0x2ee4e5[_0x36dc('0x29')],'resourceId':_0x2ee4e5['id'],'type':_0x33b830[_0x36dc('0x29')],'sectionId':_0x33b830['id']},{})['then'](function(){return _0x2127b3;});}else{return _0x2127b3;}})[_0x36dc('0x44')](function(_0x3d804d){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d804d);throw _0x3d804d;});}return _0x2127b3;})[_0x36dc('0x23')](respondWithResult(_0x544674,0xc9))[_0x36dc('0x44')](handleError(_0x544674,null));};exports[_0x36dc('0x22')]=function(_0x200397,_0x50d265){if(_0x200397[_0x36dc('0x4e')]['id']){delete _0x200397[_0x36dc('0x4e')]['id'];}return db[_0x36dc('0x2b')]['find']({'where':{'id':_0x200397[_0x36dc('0x45')]['id']}})[_0x36dc('0x23')](handleEntityNotFound(_0x50d265,null))[_0x36dc('0x23')](saveUpdates(_0x200397['body'],null))['then'](respondWithResult(_0x50d265,null))[_0x36dc('0x44')](handleError(_0x50d265,null));};exports[_0x36dc('0x24')]=function(_0x22f453,_0x1b6d70){return db[_0x36dc('0x2b')]['find']({'where':{'id':_0x22f453[_0x36dc('0x45')]['id']}})[_0x36dc('0x23')](handleEntityNotFound(_0x1b6d70,null))[_0x36dc('0x23')](removeEntity(_0x1b6d70,null))[_0x36dc('0x44')](handleError(_0x1b6d70,null));};exports[_0x36dc('0x4f')]=function(_0x4a9649,_0x597766,_0x14b336){if(_0x4a9649['body']['id']){delete _0x4a9649[_0x36dc('0x4e')]['id'];}return db[_0x36dc('0x2b')][_0x36dc('0x47')]({'where':{'id':_0x4a9649[_0x36dc('0x45')]['id']}})['then'](handleEntityNotFound(_0x597766,null))[_0x36dc('0x23')](function(_0x19e5ab){if(_0x19e5ab){_0x4a9649[_0x36dc('0x4e')][_0x36dc('0x50')]=_0x19e5ab['id'];return db[_0x36dc('0x51')][_0x36dc('0x4d')](_0x4a9649[_0x36dc('0x4e')]);}})['then'](respondWithResult(_0x597766,null))[_0x36dc('0x44')](handleError(_0x597766,null));};exports[_0x36dc('0x52')]=function(_0x4ea1d8,_0x7baca7,_0x163193){if(_0x4ea1d8['body']['id']){delete _0x4ea1d8[_0x36dc('0x4e')]['id'];}return db[_0x36dc('0x2b')][_0x36dc('0x47')]({'where':{'id':_0x4ea1d8['params']['id']}})[_0x36dc('0x23')](handleEntityNotFound(_0x7baca7,null))[_0x36dc('0x23')](function(_0x5a8aef){if(_0x5a8aef){_0x4ea1d8['body'][_0x36dc('0x53')]=_0x5a8aef['id'];return db[_0x36dc('0x51')]['create'](_0x4ea1d8[_0x36dc('0x4e')]);}})[_0x36dc('0x23')](respondWithResult(_0x7baca7,null))[_0x36dc('0x44')](handleError(_0x7baca7,null));};exports[_0x36dc('0x54')]=function(_0x20d373,_0x5d4a62,_0x11906d){var _0x5efcd8={};var _0xc80e7e={};var _0x5d6c94;var _0x51fe7e;return db[_0x36dc('0x2b')][_0x36dc('0x55')]({'where':{'id':_0x20d373[_0x36dc('0x45')]['id']}})['then'](handleEntityNotFound(_0x5d4a62,null))['then'](function(_0x4c07a5){if(_0x4c07a5){_0x5d6c94=_0x4c07a5;_0xc80e7e[_0x36dc('0x2d')]=_[_0x36dc('0x2f')](db[_0x36dc('0x51')][_0x36dc('0x2c')]);_0xc80e7e['query']=_['keys'](_0x20d373[_0x36dc('0x2e')]);_0xc80e7e[_0x36dc('0x30')]=_[_0x36dc('0x31')](_0xc80e7e[_0x36dc('0x2d')],_0xc80e7e[_0x36dc('0x2e')]);_0x5efcd8[_0x36dc('0x32')]=_['intersection'](_0xc80e7e[_0x36dc('0x2d')],qs['fields'](_0x20d373['query'][_0x36dc('0x33')]));_0x5efcd8[_0x36dc('0x32')]=_0x5efcd8[_0x36dc('0x32')][_0x36dc('0x34')]?_0x5efcd8[_0x36dc('0x32')]:_0xc80e7e[_0x36dc('0x2d')];_0x5efcd8[_0x36dc('0x56')]=qs[_0x36dc('0x36')](_0x20d373[_0x36dc('0x2e')]['sort']);_0x5efcd8[_0x36dc('0x37')]=qs['filters'](_[_0x36dc('0x38')](_0x20d373[_0x36dc('0x2e')],_0xc80e7e[_0x36dc('0x30')]));if(_0x20d373['query'][_0x36dc('0x39')]){_0x5efcd8[_0x36dc('0x37')]=_['merge'](_0x5efcd8[_0x36dc('0x37')],{'$or':_[_0x36dc('0x3b')](_0x5efcd8['attributes'],function(_0x327c98){var _0x221d08={};_0x221d08[_0x327c98]={'$like':'%'+_0x20d373[_0x36dc('0x2e')]['filter']+'%'};return _0x221d08;})});}_0x5efcd8=_['merge']({},_0x5efcd8,_0x20d373['options']);return _0x5d6c94[_0x36dc('0x54')](_0x5efcd8);}})[_0x36dc('0x23')](function(_0x398f60){if(_0x398f60){_0x51fe7e=_0x398f60[_0x36dc('0x34')];if(!_0x20d373[_0x36dc('0x2e')][_0x36dc('0x35')](_0x36dc('0x57'))){_0x5efcd8[_0x36dc('0x1f')]=qs['limit'](_0x20d373[_0x36dc('0x2e')][_0x36dc('0x1f')]);_0x5efcd8[_0x36dc('0x1e')]=qs[_0x36dc('0x1e')](_0x20d373[_0x36dc('0x2e')][_0x36dc('0x1e')]);}return _0x5d6c94[_0x36dc('0x54')](_0x5efcd8);}})[_0x36dc('0x23')](function(_0x1045b2){if(_0x1045b2){return _0x1045b2?{'count':_0x51fe7e,'rows':_0x1045b2}:null;}})[_0x36dc('0x23')](respondWithResult(_0x5d4a62,null))[_0x36dc('0x44')](handleError(_0x5d4a62,null));};exports['getAnyConditions']=function(_0x740119,_0x2eddc5,_0x13c709){var _0x5adcac={};var _0x592d58={};var _0x53f72d;var _0xfcdffb;return db[_0x36dc('0x2b')][_0x36dc('0x55')]({'where':{'id':_0x740119[_0x36dc('0x45')]['id']}})[_0x36dc('0x23')](handleEntityNotFound(_0x2eddc5,null))[_0x36dc('0x23')](function(_0xdc9b69){if(_0xdc9b69){_0x53f72d=_0xdc9b69;_0x592d58[_0x36dc('0x2d')]=_[_0x36dc('0x2f')](db[_0x36dc('0x51')]['rawAttributes']);_0x592d58[_0x36dc('0x2e')]=_['keys'](_0x740119['query']);_0x592d58[_0x36dc('0x30')]=_[_0x36dc('0x31')](_0x592d58['model'],_0x592d58[_0x36dc('0x2e')]);_0x5adcac[_0x36dc('0x32')]=_[_0x36dc('0x31')](_0x592d58[_0x36dc('0x2d')],qs['fields'](_0x740119[_0x36dc('0x2e')]['fields']));_0x5adcac[_0x36dc('0x32')]=_0x5adcac[_0x36dc('0x32')][_0x36dc('0x34')]?_0x5adcac['attributes']:_0x592d58[_0x36dc('0x2d')];_0x5adcac[_0x36dc('0x56')]=qs[_0x36dc('0x36')](_0x740119[_0x36dc('0x2e')]['sort']);_0x5adcac['where']=qs[_0x36dc('0x30')](_[_0x36dc('0x38')](_0x740119[_0x36dc('0x2e')],_0x592d58[_0x36dc('0x30')]));if(_0x740119[_0x36dc('0x2e')][_0x36dc('0x39')]){_0x5adcac[_0x36dc('0x37')]=_['merge'](_0x5adcac[_0x36dc('0x37')],{'$or':_[_0x36dc('0x3b')](_0x5adcac[_0x36dc('0x32')],function(_0x4e90fb){var _0xb93bc5={};_0xb93bc5[_0x4e90fb]={'$like':'%'+_0x740119[_0x36dc('0x2e')][_0x36dc('0x39')]+'%'};return _0xb93bc5;})});}_0x5adcac=_[_0x36dc('0x3a')]({},_0x5adcac,_0x740119['options']);return _0x53f72d[_0x36dc('0x58')](_0x5adcac);}})[_0x36dc('0x23')](function(_0x1df679){if(_0x1df679){_0xfcdffb=_0x1df679[_0x36dc('0x34')];if(!_0x740119['query'][_0x36dc('0x35')](_0x36dc('0x57'))){_0x5adcac[_0x36dc('0x1f')]=qs[_0x36dc('0x1f')](_0x740119['query']['limit']);_0x5adcac[_0x36dc('0x1e')]=qs[_0x36dc('0x1e')](_0x740119[_0x36dc('0x2e')]['offset']);}return _0x53f72d['getAnyConditions'](_0x5adcac);}})[_0x36dc('0x23')](function(_0x6fc573){if(_0x6fc573){return _0x6fc573?{'count':_0xfcdffb,'rows':_0x6fc573}:null;}})[_0x36dc('0x23')](respondWithResult(_0x2eddc5,null))['catch'](handleError(_0x2eddc5,null));};exports['addAction']=function(_0x182808,_0x17959d,_0x5286db){if(_0x182808[_0x36dc('0x4e')]['id']){delete _0x182808[_0x36dc('0x4e')]['id'];}return db[_0x36dc('0x2b')]['find']({'where':{'id':_0x182808['params']['id']}})[_0x36dc('0x23')](handleEntityNotFound(_0x17959d,null))[_0x36dc('0x23')](function(_0x43b120){if(_0x43b120){_0x182808[_0x36dc('0x4e')]['TriggerId']=_0x43b120['id'];return db[_0x36dc('0x59')][_0x36dc('0x4d')](_0x182808['body']);}})['then'](respondWithResult(_0x17959d,null))[_0x36dc('0x44')](handleError(_0x17959d,null));};exports[_0x36dc('0x5a')]=function(_0x26dedb,_0x197efd,_0x5101eb){var _0x59d68e={};var _0x2b0b78={};var _0x716154;var _0x40d9aa;return db[_0x36dc('0x2b')][_0x36dc('0x55')]({'where':{'id':_0x26dedb[_0x36dc('0x45')]['id']}})[_0x36dc('0x23')](handleEntityNotFound(_0x197efd,null))[_0x36dc('0x23')](function(_0x120516){if(_0x120516){_0x716154=_0x120516;_0x2b0b78['model']=_[_0x36dc('0x2f')](db[_0x36dc('0x59')][_0x36dc('0x2c')]);_0x2b0b78['query']=_[_0x36dc('0x2f')](_0x26dedb['query']);_0x2b0b78[_0x36dc('0x30')]=_['intersection'](_0x2b0b78[_0x36dc('0x2d')],_0x2b0b78[_0x36dc('0x2e')]);_0x59d68e['attributes']=_[_0x36dc('0x31')](_0x2b0b78[_0x36dc('0x2d')],qs[_0x36dc('0x33')](_0x26dedb['query'][_0x36dc('0x33')]));_0x59d68e[_0x36dc('0x32')]=_0x59d68e[_0x36dc('0x32')]['length']?_0x59d68e[_0x36dc('0x32')]:_0x2b0b78['model'];_0x59d68e[_0x36dc('0x56')]=qs[_0x36dc('0x36')](_0x26dedb['query'][_0x36dc('0x36')]);_0x59d68e['where']=qs[_0x36dc('0x30')](_[_0x36dc('0x38')](_0x26dedb[_0x36dc('0x2e')],_0x2b0b78[_0x36dc('0x30')]));if(_0x26dedb['query']['filter']){_0x59d68e[_0x36dc('0x37')]=_[_0x36dc('0x3a')](_0x59d68e[_0x36dc('0x37')],{'$or':_[_0x36dc('0x3b')](_0x59d68e[_0x36dc('0x32')],function(_0x51fcc5){var _0x1bbd9c={};_0x1bbd9c[_0x51fcc5]={'$like':'%'+_0x26dedb[_0x36dc('0x2e')][_0x36dc('0x39')]+'%'};return _0x1bbd9c;})});}_0x59d68e=_['merge']({},_0x59d68e,_0x26dedb[_0x36dc('0x46')]);return _0x716154[_0x36dc('0x5a')](_0x59d68e);}})['then'](function(_0x407246){if(_0x407246){_0x40d9aa=_0x407246[_0x36dc('0x34')];if(!_0x26dedb[_0x36dc('0x2e')]['hasOwnProperty'](_0x36dc('0x57'))){_0x59d68e[_0x36dc('0x1f')]=qs['limit'](_0x26dedb['query'][_0x36dc('0x1f')]);_0x59d68e['offset']=qs[_0x36dc('0x1e')](_0x26dedb['query'][_0x36dc('0x1e')]);}return _0x716154['getActions'](_0x59d68e);}})[_0x36dc('0x23')](function(_0x306730){if(_0x306730){return _0x306730?{'count':_0x40d9aa,'rows':_0x306730}:null;}})[_0x36dc('0x23')](respondWithResult(_0x197efd,null))[_0x36dc('0x44')](handleError(_0x197efd,null));}; \ No newline at end of file +var _0x54d4=['stack','name','send','index','Trigger','rawAttributes','model','keys','query','intersection','attributes','hasOwnProperty','offset','order','sort','where','pick','merge','map','type','key','VIRTUAL','filter','options','count','includeAll','include','findAll','catch','show','params','filters','fields','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','find','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','findOne','getAllConditions','nolimit','getAnyConditions','length','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','sendStatus','status','limit','reject','update','then','destroy','get','Triggers','UserProfileResource','end','error'];(function(_0x3db722,_0x30c101){var _0x389e1d=function(_0x3a3d66){while(--_0x3a3d66){_0x3db722['push'](_0x3db722['shift']());}};_0x389e1d(++_0x30c101);}(_0x54d4,0xe5));var _0x454d=function(_0xfdec06,_0x9fa2f4){_0xfdec06=_0xfdec06-0x0;var _0x58a539=_0x54d4[_0xfdec06];return _0x58a539;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x454d('0x0'));var rimraf=require(_0x454d('0x1'));var zipdir=require(_0x454d('0x2'));var jsonpatch=require(_0x454d('0x3'));var rp=require(_0x454d('0x4'));var moment=require('moment');var BPromise=require(_0x454d('0x5'));var Mustache=require(_0x454d('0x6'));var util=require('util');var path=require('path');var sox=require(_0x454d('0x7'));var csv=require(_0x454d('0x8'));var ejs=require(_0x454d('0x9'));var fs=require('fs');var _=require(_0x454d('0xa'));var squel=require(_0x454d('0xb'));var crypto=require('crypto');var jsforce=require(_0x454d('0xc'));var deskjs=require(_0x454d('0xd'));var toCsv=require(_0x454d('0x8'));var querystring=require(_0x454d('0xe'));var Papa=require(_0x454d('0xf'));var Redis=require('ioredis');var authService=require(_0x454d('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x454d('0x11'));var logger=require('../../config/logger')(_0x454d('0x12'));var utils=require(_0x454d('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x275c5b,_0x57abe5){_0x57abe5=_0x57abe5||0xcc;return function(_0x316330){if(_0x316330){return _0x275c5b[_0x454d('0x14')](_0x57abe5);}return _0x275c5b[_0x454d('0x15')](_0x57abe5)['end']();};}function respondWithResult(_0x1dc698,_0x4b4722){_0x4b4722=_0x4b4722||0xc8;return function(_0xc65c1){if(_0xc65c1){return _0x1dc698['status'](_0x4b4722)['json'](_0xc65c1);}};}function respondWithFilteredResult(_0x532d50,_0x36a520){return function(_0x3758ad){if(_0x3758ad){var _0x43458b=_0x3758ad['count'],_0x26ecfb=_0x36a520['offset'],_0x5c5655=_0x36a520['offset']+_0x36a520[_0x454d('0x16')],_0x263c5e;if(_0x5c5655>=_0x43458b){_0x5c5655=_0x43458b;_0x263c5e=0xc8;}else{_0x263c5e=0xce;}_0x532d50['status'](_0x263c5e);return _0x532d50['set']('Content-Range',_0x26ecfb+'-'+_0x5c5655+'/'+_0x43458b)['json'](_0x3758ad);}return null;};}function patchUpdates(_0x2ba88d){return function(_0x30c8d4){try{jsonpatch['apply'](_0x30c8d4,_0x2ba88d,!![]);}catch(_0x38d57a){return BPromise[_0x454d('0x17')](_0x38d57a);}return _0x30c8d4['save']();};}function saveUpdates(_0x2e27c4,_0x113b64){return function(_0x2b84ea){if(_0x2b84ea){return _0x2b84ea[_0x454d('0x18')](_0x2e27c4)[_0x454d('0x19')](function(_0x2fb428){return _0x2fb428;});}return null;};}function removeEntity(_0x2a417a,_0x35fba8){return function(_0x4af88e){if(_0x4af88e){return _0x4af88e[_0x454d('0x1a')]()[_0x454d('0x19')](function(){var _0x4db921=_0x4af88e[_0x454d('0x1b')]({'plain':!![]});var _0x201e8c=_0x454d('0x1c');return db[_0x454d('0x1d')][_0x454d('0x1a')]({'where':{'type':_0x201e8c,'resourceId':_0x4db921['id']}})[_0x454d('0x19')](function(){return _0x4af88e;});})[_0x454d('0x19')](function(){_0x2a417a[_0x454d('0x15')](0xcc)[_0x454d('0x1e')]();});}};}function handleEntityNotFound(_0x1e75b3,_0x1f272a){return function(_0x165e06){if(!_0x165e06){_0x1e75b3[_0x454d('0x14')](0x194);}return _0x165e06;};}function handleError(_0x55c26b,_0x5647b7){_0x5647b7=_0x5647b7||0x1f4;return function(_0x2119f8){logger[_0x454d('0x1f')](_0x2119f8[_0x454d('0x20')]);if(_0x2119f8[_0x454d('0x21')]){delete _0x2119f8[_0x454d('0x21')];}_0x55c26b['status'](_0x5647b7)[_0x454d('0x22')](_0x2119f8);};}exports[_0x454d('0x23')]=function(_0xc8f436,_0x1b823f){var _0x3f07d2={},_0x497f8e={},_0x1ad5f9={'count':0x0,'rows':[]};var _0x274b0d=db[_0x454d('0x24')][_0x454d('0x25')];_0x497f8e[_0x454d('0x26')]=_[_0x454d('0x27')](_0x274b0d);_0x497f8e[_0x454d('0x28')]=_[_0x454d('0x27')](_0xc8f436[_0x454d('0x28')]);_0x497f8e['filters']=_[_0x454d('0x29')](_0x497f8e[_0x454d('0x26')],_0x497f8e[_0x454d('0x28')]);_0x3f07d2[_0x454d('0x2a')]=_[_0x454d('0x29')](_0x497f8e['model'],qs['fields'](_0xc8f436[_0x454d('0x28')]['fields']));_0x3f07d2['attributes']=_0x3f07d2[_0x454d('0x2a')]['length']?_0x3f07d2[_0x454d('0x2a')]:_0x497f8e['model'];if(!_0xc8f436[_0x454d('0x28')][_0x454d('0x2b')]('nolimit')){_0x3f07d2['limit']=qs['limit'](_0xc8f436[_0x454d('0x28')][_0x454d('0x16')]);_0x3f07d2[_0x454d('0x2c')]=qs[_0x454d('0x2c')](_0xc8f436[_0x454d('0x28')]['offset']);}_0x3f07d2[_0x454d('0x2d')]=qs['sort'](_0xc8f436[_0x454d('0x28')][_0x454d('0x2e')]);_0x3f07d2[_0x454d('0x2f')]=qs['filters'](_[_0x454d('0x30')](_0xc8f436['query'],_0x497f8e['filters']));if(_0xc8f436['query']['filter']){_0x3f07d2[_0x454d('0x2f')]=_[_0x454d('0x31')](_0x3f07d2[_0x454d('0x2f')],{'$or':_[_0x454d('0x32')](_0x274b0d,function(_0x2e310b){if(_0x2e310b[_0x454d('0x33')][_0x454d('0x34')]!==_0x454d('0x35')){var _0xb50d83={};_0xb50d83[_0x2e310b['field']]={'$like':'%'+_0xc8f436[_0x454d('0x28')][_0x454d('0x36')]+'%'};return _0xb50d83;}})});}_0x3f07d2=_[_0x454d('0x31')]({},_0x3f07d2,_0xc8f436[_0x454d('0x37')]);var _0x170af6={'where':_0x3f07d2['where']};return db[_0x454d('0x24')][_0x454d('0x38')](_0x170af6)[_0x454d('0x19')](function(_0x62d0b){_0x1ad5f9[_0x454d('0x38')]=_0x62d0b;if(_0xc8f436['query'][_0x454d('0x39')]){_0x3f07d2[_0x454d('0x3a')]=[{'all':!![]}];}return db['Trigger'][_0x454d('0x3b')](_0x3f07d2);})[_0x454d('0x19')](function(_0x490ead){_0x1ad5f9['rows']=_0x490ead;return _0x1ad5f9;})['then'](respondWithFilteredResult(_0x1b823f,_0x3f07d2))[_0x454d('0x3c')](handleError(_0x1b823f,null));};exports[_0x454d('0x3d')]=function(_0x2cbfda,_0xb5e9b4){var _0x3be8d6={'raw':![],'where':{'id':_0x2cbfda[_0x454d('0x3e')]['id']}},_0x53caeb={};_0x53caeb[_0x454d('0x26')]=_[_0x454d('0x27')](db[_0x454d('0x24')]['rawAttributes']);_0x53caeb[_0x454d('0x28')]=_[_0x454d('0x27')](_0x2cbfda['query']);_0x53caeb[_0x454d('0x3f')]=_[_0x454d('0x29')](_0x53caeb[_0x454d('0x26')],_0x53caeb['query']);_0x3be8d6[_0x454d('0x2a')]=_[_0x454d('0x29')](_0x53caeb[_0x454d('0x26')],qs[_0x454d('0x40')](_0x2cbfda[_0x454d('0x28')][_0x454d('0x40')]));_0x3be8d6['attributes']=_0x3be8d6[_0x454d('0x2a')]['length']?_0x3be8d6[_0x454d('0x2a')]:_0x53caeb[_0x454d('0x26')];if(_0x2cbfda['query'][_0x454d('0x39')]){_0x3be8d6[_0x454d('0x3a')]=[{'all':!![]}];}_0x3be8d6=_[_0x454d('0x31')]({},_0x3be8d6,_0x2cbfda[_0x454d('0x37')]);return db[_0x454d('0x24')]['find'](_0x3be8d6)[_0x454d('0x19')](handleEntityNotFound(_0xb5e9b4,null))['then'](respondWithResult(_0xb5e9b4,null))['catch'](handleError(_0xb5e9b4,null));};exports[_0x454d('0x41')]=function(_0x56fc34,_0x4f4cae){return db['Trigger']['create'](_0x56fc34[_0x454d('0x42')],{})[_0x454d('0x19')](function(_0x45e73b){var _0x2dd5eb=_0x56fc34[_0x454d('0x43')]['get']({'plain':!![]});if(!_0x2dd5eb)throw new Error(_0x454d('0x44'));if(_0x2dd5eb['role']===_0x454d('0x43')){var _0x316f5a=_0x45e73b[_0x454d('0x1b')]({'plain':!![]});var _0x2a5703=_0x454d('0x1c');return db[_0x454d('0x45')]['find']({'where':{'name':_0x2a5703,'userProfileId':_0x2dd5eb[_0x454d('0x46')]},'raw':!![]})[_0x454d('0x19')](function(_0x4721ea){if(_0x4721ea&&_0x4721ea[_0x454d('0x47')]===0x0){return db['UserProfileResource']['create']({'name':_0x316f5a[_0x454d('0x21')],'resourceId':_0x316f5a['id'],'type':_0x4721ea['name'],'sectionId':_0x4721ea['id']},{})[_0x454d('0x19')](function(){return _0x45e73b;});}else{return _0x45e73b;}})[_0x454d('0x3c')](function(_0x5c6f88){logger[_0x454d('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5c6f88);throw _0x5c6f88;});}return _0x45e73b;})[_0x454d('0x19')](respondWithResult(_0x4f4cae,0xc9))[_0x454d('0x3c')](handleError(_0x4f4cae,null));};exports[_0x454d('0x18')]=function(_0x20e6c5,_0x28ace3){if(_0x20e6c5[_0x454d('0x42')]['id']){delete _0x20e6c5[_0x454d('0x42')]['id'];}return db[_0x454d('0x24')]['find']({'where':{'id':_0x20e6c5[_0x454d('0x3e')]['id']}})[_0x454d('0x19')](handleEntityNotFound(_0x28ace3,null))[_0x454d('0x19')](saveUpdates(_0x20e6c5[_0x454d('0x42')],null))[_0x454d('0x19')](respondWithResult(_0x28ace3,null))[_0x454d('0x3c')](handleError(_0x28ace3,null));};exports['destroy']=function(_0x5cd307,_0xb24b48){return db[_0x454d('0x24')][_0x454d('0x48')]({'where':{'id':_0x5cd307[_0x454d('0x3e')]['id']}})['then'](handleEntityNotFound(_0xb24b48,null))[_0x454d('0x19')](removeEntity(_0xb24b48,null))[_0x454d('0x3c')](handleError(_0xb24b48,null));};exports[_0x454d('0x49')]=function(_0x548d3a,_0x565600,_0x322f13){if(_0x548d3a['body']['id']){delete _0x548d3a[_0x454d('0x42')]['id'];}return db['Trigger'][_0x454d('0x48')]({'where':{'id':_0x548d3a[_0x454d('0x3e')]['id']}})[_0x454d('0x19')](handleEntityNotFound(_0x565600,null))[_0x454d('0x19')](function(_0x10a227){if(_0x10a227){_0x548d3a[_0x454d('0x42')][_0x454d('0x4a')]=_0x10a227['id'];return db[_0x454d('0x4b')][_0x454d('0x41')](_0x548d3a[_0x454d('0x42')]);}})['then'](respondWithResult(_0x565600,null))['catch'](handleError(_0x565600,null));};exports[_0x454d('0x4c')]=function(_0xfbe8ba,_0xdc2903,_0x5689bb){if(_0xfbe8ba[_0x454d('0x42')]['id']){delete _0xfbe8ba[_0x454d('0x42')]['id'];}return db[_0x454d('0x24')]['find']({'where':{'id':_0xfbe8ba[_0x454d('0x3e')]['id']}})['then'](handleEntityNotFound(_0xdc2903,null))[_0x454d('0x19')](function(_0x3b377e){if(_0x3b377e){_0xfbe8ba[_0x454d('0x42')][_0x454d('0x4d')]=_0x3b377e['id'];return db['Condition']['create'](_0xfbe8ba[_0x454d('0x42')]);}})[_0x454d('0x19')](respondWithResult(_0xdc2903,null))[_0x454d('0x3c')](handleError(_0xdc2903,null));};exports['getAllConditions']=function(_0x53750e,_0x3cf271,_0x139db1){var _0x4edbc1={};var _0x5b9299={};var _0x47a39b;var _0x36b706;return db['Trigger'][_0x454d('0x4e')]({'where':{'id':_0x53750e['params']['id']}})[_0x454d('0x19')](handleEntityNotFound(_0x3cf271,null))[_0x454d('0x19')](function(_0x54605e){if(_0x54605e){_0x47a39b=_0x54605e;_0x5b9299['model']=_[_0x454d('0x27')](db['Condition']['rawAttributes']);_0x5b9299['query']=_[_0x454d('0x27')](_0x53750e['query']);_0x5b9299[_0x454d('0x3f')]=_[_0x454d('0x29')](_0x5b9299[_0x454d('0x26')],_0x5b9299['query']);_0x4edbc1['attributes']=_[_0x454d('0x29')](_0x5b9299[_0x454d('0x26')],qs['fields'](_0x53750e[_0x454d('0x28')][_0x454d('0x40')]));_0x4edbc1['attributes']=_0x4edbc1[_0x454d('0x2a')]['length']?_0x4edbc1[_0x454d('0x2a')]:_0x5b9299[_0x454d('0x26')];_0x4edbc1[_0x454d('0x2d')]=qs[_0x454d('0x2e')](_0x53750e[_0x454d('0x28')][_0x454d('0x2e')]);_0x4edbc1[_0x454d('0x2f')]=qs[_0x454d('0x3f')](_[_0x454d('0x30')](_0x53750e[_0x454d('0x28')],_0x5b9299[_0x454d('0x3f')]));if(_0x53750e[_0x454d('0x28')][_0x454d('0x36')]){_0x4edbc1[_0x454d('0x2f')]=_[_0x454d('0x31')](_0x4edbc1[_0x454d('0x2f')],{'$or':_[_0x454d('0x32')](_0x4edbc1['attributes'],function(_0x5514eb){var _0x567def={};_0x567def[_0x5514eb]={'$like':'%'+_0x53750e[_0x454d('0x28')][_0x454d('0x36')]+'%'};return _0x567def;})});}_0x4edbc1=_[_0x454d('0x31')]({},_0x4edbc1,_0x53750e[_0x454d('0x37')]);return _0x47a39b[_0x454d('0x4f')](_0x4edbc1);}})[_0x454d('0x19')](function(_0x52848d){if(_0x52848d){_0x36b706=_0x52848d['length'];if(!_0x53750e['query'][_0x454d('0x2b')](_0x454d('0x50'))){_0x4edbc1[_0x454d('0x16')]=qs['limit'](_0x53750e[_0x454d('0x28')][_0x454d('0x16')]);_0x4edbc1[_0x454d('0x2c')]=qs['offset'](_0x53750e[_0x454d('0x28')]['offset']);}return _0x47a39b[_0x454d('0x4f')](_0x4edbc1);}})['then'](function(_0x33bfaa){if(_0x33bfaa){return _0x33bfaa?{'count':_0x36b706,'rows':_0x33bfaa}:null;}})[_0x454d('0x19')](respondWithResult(_0x3cf271,null))[_0x454d('0x3c')](handleError(_0x3cf271,null));};exports[_0x454d('0x51')]=function(_0x2b419b,_0xa763f4,_0xf7f1eb){var _0x100548={};var _0x9381d2={};var _0x164c36;var _0x58fe22;return db[_0x454d('0x24')][_0x454d('0x4e')]({'where':{'id':_0x2b419b[_0x454d('0x3e')]['id']}})[_0x454d('0x19')](handleEntityNotFound(_0xa763f4,null))['then'](function(_0x22d677){if(_0x22d677){_0x164c36=_0x22d677;_0x9381d2['model']=_[_0x454d('0x27')](db[_0x454d('0x4b')][_0x454d('0x25')]);_0x9381d2[_0x454d('0x28')]=_['keys'](_0x2b419b[_0x454d('0x28')]);_0x9381d2['filters']=_[_0x454d('0x29')](_0x9381d2['model'],_0x9381d2['query']);_0x100548['attributes']=_[_0x454d('0x29')](_0x9381d2['model'],qs[_0x454d('0x40')](_0x2b419b['query']['fields']));_0x100548[_0x454d('0x2a')]=_0x100548['attributes'][_0x454d('0x52')]?_0x100548[_0x454d('0x2a')]:_0x9381d2[_0x454d('0x26')];_0x100548[_0x454d('0x2d')]=qs[_0x454d('0x2e')](_0x2b419b[_0x454d('0x28')][_0x454d('0x2e')]);_0x100548['where']=qs['filters'](_['pick'](_0x2b419b[_0x454d('0x28')],_0x9381d2[_0x454d('0x3f')]));if(_0x2b419b[_0x454d('0x28')][_0x454d('0x36')]){_0x100548['where']=_[_0x454d('0x31')](_0x100548[_0x454d('0x2f')],{'$or':_[_0x454d('0x32')](_0x100548[_0x454d('0x2a')],function(_0x129046){var _0xf8d069={};_0xf8d069[_0x129046]={'$like':'%'+_0x2b419b['query'][_0x454d('0x36')]+'%'};return _0xf8d069;})});}_0x100548=_[_0x454d('0x31')]({},_0x100548,_0x2b419b['options']);return _0x164c36['getAnyConditions'](_0x100548);}})[_0x454d('0x19')](function(_0x11353c){if(_0x11353c){_0x58fe22=_0x11353c[_0x454d('0x52')];if(!_0x2b419b['query'][_0x454d('0x2b')](_0x454d('0x50'))){_0x100548['limit']=qs[_0x454d('0x16')](_0x2b419b[_0x454d('0x28')][_0x454d('0x16')]);_0x100548[_0x454d('0x2c')]=qs[_0x454d('0x2c')](_0x2b419b[_0x454d('0x28')]['offset']);}return _0x164c36[_0x454d('0x51')](_0x100548);}})[_0x454d('0x19')](function(_0x51f849){if(_0x51f849){return _0x51f849?{'count':_0x58fe22,'rows':_0x51f849}:null;}})[_0x454d('0x19')](respondWithResult(_0xa763f4,null))['catch'](handleError(_0xa763f4,null));};exports[_0x454d('0x53')]=function(_0x5d25ca,_0x4a4452,_0x5ce862){if(_0x5d25ca[_0x454d('0x42')]['id']){delete _0x5d25ca[_0x454d('0x42')]['id'];}return db[_0x454d('0x24')]['find']({'where':{'id':_0x5d25ca[_0x454d('0x3e')]['id']}})[_0x454d('0x19')](handleEntityNotFound(_0x4a4452,null))[_0x454d('0x19')](function(_0x3e06f3){if(_0x3e06f3){_0x5d25ca[_0x454d('0x42')][_0x454d('0x54')]=_0x3e06f3['id'];return db[_0x454d('0x55')][_0x454d('0x41')](_0x5d25ca['body']);}})[_0x454d('0x19')](respondWithResult(_0x4a4452,null))[_0x454d('0x3c')](handleError(_0x4a4452,null));};exports[_0x454d('0x56')]=function(_0x18b6e9,_0x4192d6,_0x34f935){var _0x43e500={};var _0xdef308={};var _0x1ba818;var _0x126f4f;return db[_0x454d('0x24')][_0x454d('0x4e')]({'where':{'id':_0x18b6e9[_0x454d('0x3e')]['id']}})[_0x454d('0x19')](handleEntityNotFound(_0x4192d6,null))[_0x454d('0x19')](function(_0x52dddc){if(_0x52dddc){_0x1ba818=_0x52dddc;_0xdef308['model']=_['keys'](db[_0x454d('0x55')][_0x454d('0x25')]);_0xdef308[_0x454d('0x28')]=_[_0x454d('0x27')](_0x18b6e9['query']);_0xdef308[_0x454d('0x3f')]=_[_0x454d('0x29')](_0xdef308[_0x454d('0x26')],_0xdef308[_0x454d('0x28')]);_0x43e500[_0x454d('0x2a')]=_['intersection'](_0xdef308[_0x454d('0x26')],qs['fields'](_0x18b6e9[_0x454d('0x28')][_0x454d('0x40')]));_0x43e500['attributes']=_0x43e500[_0x454d('0x2a')]['length']?_0x43e500[_0x454d('0x2a')]:_0xdef308['model'];_0x43e500[_0x454d('0x2d')]=qs[_0x454d('0x2e')](_0x18b6e9[_0x454d('0x28')][_0x454d('0x2e')]);_0x43e500[_0x454d('0x2f')]=qs[_0x454d('0x3f')](_[_0x454d('0x30')](_0x18b6e9[_0x454d('0x28')],_0xdef308['filters']));if(_0x18b6e9['query']['filter']){_0x43e500['where']=_[_0x454d('0x31')](_0x43e500[_0x454d('0x2f')],{'$or':_[_0x454d('0x32')](_0x43e500[_0x454d('0x2a')],function(_0x3aaa63){var _0xf99c6b={};_0xf99c6b[_0x3aaa63]={'$like':'%'+_0x18b6e9[_0x454d('0x28')]['filter']+'%'};return _0xf99c6b;})});}_0x43e500=_[_0x454d('0x31')]({},_0x43e500,_0x18b6e9[_0x454d('0x37')]);return _0x1ba818['getActions'](_0x43e500);}})[_0x454d('0x19')](function(_0x2f9fd4){if(_0x2f9fd4){_0x126f4f=_0x2f9fd4[_0x454d('0x52')];if(!_0x18b6e9['query'][_0x454d('0x2b')]('nolimit')){_0x43e500[_0x454d('0x16')]=qs['limit'](_0x18b6e9['query'][_0x454d('0x16')]);_0x43e500[_0x454d('0x2c')]=qs[_0x454d('0x2c')](_0x18b6e9[_0x454d('0x28')][_0x454d('0x2c')]);}return _0x1ba818[_0x454d('0x56')](_0x43e500);}})[_0x454d('0x19')](function(_0x3dea8e){if(_0x3dea8e){return _0x3dea8e?{'count':_0x126f4f,'rows':_0x3dea8e}:null;}})['then'](respondWithResult(_0x4192d6,null))['catch'](handleError(_0x4192d6,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 50666a0..bd987b0 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 _0xe706=['request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','lodash','util','../../config/logger','moment','bluebird'];(function(_0x2fd1fe,_0x1c8456){var _0x500fff=function(_0x4d124c){while(--_0x4d124c){_0x2fd1fe['push'](_0x2fd1fe['shift']());}};_0x500fff(++_0x1c8456);}(_0xe706,0xa3));var _0x6e70=function(_0x575934,_0x4a6760){_0x575934=_0x575934-0x0;var _0x109a3d=_0xe706[_0x575934];return _0x109a3d;};'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 +var _0x0713=['moment','bluebird','request-promise','rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','../../config/logger','api'];(function(_0x3afec1,_0x285954){var _0x16549b=function(_0x4da419){while(--_0x4da419){_0x3afec1['push'](_0x3afec1['shift']());}};_0x16549b(++_0x285954);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 07eb050..cf8a644 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 _0xee4f=['message','result','GetTrigger','findAll','options','limit','include','map','model','attributes','stringify','catch','ShowTrigger','find','raw','where','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x527733,_0x16051c){var _0x5400ba=function(_0x265d39){while(--_0x265d39){_0x527733['push'](_0x527733['shift']());}};_0x5400ba(++_0x16051c);}(_0xee4f,0x1de));var _0xfee4=function(_0x11fb78,_0x2cd389){_0x11fb78=_0x11fb78-0x0;var _0x602cb0=_0xee4f[_0x11fb78];return _0x602cb0;};'use strict';var _=require('lodash');var util=require(_0xfee4('0x0'));var moment=require(_0xfee4('0x1'));var BPromise=require(_0xfee4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfee4('0x3'))['db'];var utils=require(_0xfee4('0x4'));var logger=require('../../config/logger')(_0xfee4('0x5'));var config=require(_0xfee4('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfee4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x51f5ed,_0x392cf8,_0x16010e){return new BPromise(function(_0x5756c1,_0x1cbe89){return client[_0xfee4('0x8')](_0x51f5ed,_0x16010e)[_0xfee4('0x9')](function(_0x2ed743){logger[_0xfee4('0xa')](_0xfee4('0xb'),_0x392cf8,_0xfee4('0xc'));logger[_0xfee4('0xd')](_0xfee4('0xe'),_0x392cf8,_0xfee4('0xc'),JSON['stringify'](_0x2ed743));if(_0x2ed743['error']){if(_0x2ed743[_0xfee4('0xf')][_0xfee4('0x10')]===0x1f4){logger[_0xfee4('0xf')](_0xfee4('0xb'),_0x392cf8,_0x2ed743[_0xfee4('0xf')][_0xfee4('0x11')]);return _0x1cbe89(_0x2ed743[_0xfee4('0xf')]['message']);}logger[_0xfee4('0xf')](_0xfee4('0xb'),_0x392cf8,_0x2ed743[_0xfee4('0xf')][_0xfee4('0x11')]);return _0x5756c1(_0x2ed743[_0xfee4('0xf')][_0xfee4('0x11')]);}else{logger[_0xfee4('0xa')]('Trigger,\x20%s,\x20%s',_0x392cf8,'request\x20sent');_0x5756c1(_0x2ed743[_0xfee4('0x12')]['message']);}})['catch'](function(_0xb68c1c){logger[_0xfee4('0xf')](_0xfee4('0xb'),_0x392cf8,_0xb68c1c);_0x1cbe89(_0xb68c1c);});});}exports[_0xfee4('0x13')]=function(_0xb24a5){var _0x5680d8=this;return new Promise(function(_0x55b2a8,_0x54d991){return db['Trigger'][_0xfee4('0x14')]({'raw':_0xb24a5['options']?_0xb24a5[_0xfee4('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0xb24a5[_0xfee4('0x15')]?_0xb24a5[_0xfee4('0x15')]['where']||null:null,'attributes':_0xb24a5[_0xfee4('0x15')]?_0xb24a5['options']['attributes']||null:null,'limit':_0xb24a5[_0xfee4('0x15')]?_0xb24a5[_0xfee4('0x15')][_0xfee4('0x16')]||null:null,'include':_0xb24a5['options']?_0xb24a5[_0xfee4('0x15')][_0xfee4('0x17')]?_[_0xfee4('0x18')](_0xb24a5['options']['include'],function(_0x35db02){return{'model':db[_0x35db02[_0xfee4('0x19')]],'as':_0x35db02['as'],'attributes':_0x35db02['attributes'],'include':_0x35db02[_0xfee4('0x17')]?_['map'](_0x35db02[_0xfee4('0x17')],function(_0x266a91){return{'model':db[_0x266a91[_0xfee4('0x19')]],'as':_0x266a91['as'],'attributes':_0x266a91[_0xfee4('0x1a')],'include':_0x266a91['include']?_[_0xfee4('0x18')](_0x266a91[_0xfee4('0x17')],function(_0x172078){return{'model':db[_0x172078[_0xfee4('0x19')]],'as':_0x172078['as'],'attributes':_0x172078['attributes']};}):[]};}):[]};}):[]:[]})[_0xfee4('0x9')](function(_0x38336e){logger['info'](_0xfee4('0x13'),_0xb24a5);logger[_0xfee4('0xd')](_0xfee4('0x13'),_0xb24a5,JSON[_0xfee4('0x1b')](_0x38336e));_0x55b2a8(_0x38336e);})[_0xfee4('0x1c')](function(_0x564fac){logger[_0xfee4('0xf')]('GetTrigger',_0x564fac[_0xfee4('0x11')],_0xb24a5);_0x54d991(_0x5680d8[_0xfee4('0xf')](0x1f4,_0x564fac[_0xfee4('0x11')]));});});};exports[_0xfee4('0x1d')]=function(_0x498483){var _0x45ef2d=this;return new Promise(function(_0x839dee,_0x5abc68){return db['Trigger'][_0xfee4('0x1e')]({'raw':_0x498483['options']?_0x498483[_0xfee4('0x15')][_0xfee4('0x1f')]===undefined?!![]:![]:!![],'where':_0x498483['options']?_0x498483[_0xfee4('0x15')][_0xfee4('0x20')]||null:null,'attributes':_0x498483[_0xfee4('0x15')]?_0x498483[_0xfee4('0x15')]['attributes']||null:null,'include':_0x498483['options']?_0x498483['options'][_0xfee4('0x17')]?_['map'](_0x498483[_0xfee4('0x15')]['include'],function(_0xc949ff){return{'model':db[_0xc949ff[_0xfee4('0x19')]],'as':_0xc949ff['as'],'attributes':_0xc949ff[_0xfee4('0x1a')],'include':_0xc949ff[_0xfee4('0x17')]?_['map'](_0xc949ff[_0xfee4('0x17')],function(_0x5e019a){return{'model':db[_0x5e019a[_0xfee4('0x19')]],'as':_0x5e019a['as'],'attributes':_0x5e019a['attributes'],'include':_0x5e019a['include']?_[_0xfee4('0x18')](_0x5e019a[_0xfee4('0x17')],function(_0x42e03b){return{'model':db[_0x42e03b[_0xfee4('0x19')]],'as':_0x42e03b['as'],'attributes':_0x42e03b[_0xfee4('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xfee4('0x9')](function(_0x547029){logger[_0xfee4('0xa')]('ShowTrigger',_0x498483);logger[_0xfee4('0xd')]('ShowTrigger',_0x498483,JSON[_0xfee4('0x1b')](_0x547029));_0x839dee(_0x547029);})['catch'](function(_0x4afe6d){logger['error'](_0xfee4('0x1d'),_0x4afe6d[_0xfee4('0x11')],_0x498483);_0x5abc68(_0x45ef2d[_0xfee4('0xf')](0x1f4,_0x4afe6d[_0xfee4('0x11')]));});});}; \ No newline at end of file +var _0x633c=['GetTrigger','stringify','find','ShowTrigger','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','request','then','info','debug','code','error','Trigger,\x20%s,\x20%s','message','catch','Trigger','options','raw','where','attributes','limit','include','map','model'];(function(_0x2d4798,_0x4e213d){var _0x3007df=function(_0x5bcf38){while(--_0x5bcf38){_0x2d4798['push'](_0x2d4798['shift']());}};_0x3007df(++_0x4e213d);}(_0x633c,0xe4));var _0xc633=function(_0x451553,_0x306e5c){_0x451553=_0x451553-0x0;var _0x2c60f8=_0x633c[_0x451553];return _0x2c60f8;};'use strict';var _=require(_0xc633('0x0'));var util=require(_0xc633('0x1'));var moment=require(_0xc633('0x2'));var BPromise=require(_0xc633('0x3'));var rs=require(_0xc633('0x4'));var fs=require('fs');var Redis=require(_0xc633('0x5'));var db=require(_0xc633('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc633('0x7'));var config=require(_0xc633('0x8'));var jayson=require(_0xc633('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5553cf,_0x16d23d,_0x4c4ca9){return new BPromise(function(_0x3e45d6,_0x2b029d){return client[_0xc633('0xa')](_0x5553cf,_0x4c4ca9)[_0xc633('0xb')](function(_0x5dd2b1){logger[_0xc633('0xc')]('Trigger,\x20%s,\x20%s',_0x16d23d,'request\x20sent');logger[_0xc633('0xd')]('Trigger,\x20%s,\x20%s,\x20%s',_0x16d23d,'request\x20sent',JSON['stringify'](_0x5dd2b1));if(_0x5dd2b1['error']){if(_0x5dd2b1['error'][_0xc633('0xe')]===0x1f4){logger[_0xc633('0xf')](_0xc633('0x10'),_0x16d23d,_0x5dd2b1['error'][_0xc633('0x11')]);return _0x2b029d(_0x5dd2b1[_0xc633('0xf')][_0xc633('0x11')]);}logger[_0xc633('0xf')]('Trigger,\x20%s,\x20%s',_0x16d23d,_0x5dd2b1[_0xc633('0xf')]['message']);return _0x3e45d6(_0x5dd2b1[_0xc633('0xf')][_0xc633('0x11')]);}else{logger[_0xc633('0xc')]('Trigger,\x20%s,\x20%s',_0x16d23d,'request\x20sent');_0x3e45d6(_0x5dd2b1['result']['message']);}})[_0xc633('0x12')](function(_0x39f8a0){logger[_0xc633('0xf')](_0xc633('0x10'),_0x16d23d,_0x39f8a0);_0x2b029d(_0x39f8a0);});});}exports['GetTrigger']=function(_0x7fabee){var _0x582e92=this;return new Promise(function(_0x359dbd,_0xcb76ec){return db[_0xc633('0x13')]['findAll']({'raw':_0x7fabee[_0xc633('0x14')]?_0x7fabee[_0xc633('0x14')][_0xc633('0x15')]===undefined?!![]:![]:!![],'where':_0x7fabee[_0xc633('0x14')]?_0x7fabee['options'][_0xc633('0x16')]||null:null,'attributes':_0x7fabee['options']?_0x7fabee[_0xc633('0x14')][_0xc633('0x17')]||null:null,'limit':_0x7fabee[_0xc633('0x14')]?_0x7fabee[_0xc633('0x14')][_0xc633('0x18')]||null:null,'include':_0x7fabee[_0xc633('0x14')]?_0x7fabee[_0xc633('0x14')][_0xc633('0x19')]?_[_0xc633('0x1a')](_0x7fabee[_0xc633('0x14')]['include'],function(_0x378ac3){return{'model':db[_0x378ac3[_0xc633('0x1b')]],'as':_0x378ac3['as'],'attributes':_0x378ac3['attributes'],'include':_0x378ac3[_0xc633('0x19')]?_[_0xc633('0x1a')](_0x378ac3[_0xc633('0x19')],function(_0x39be8d){return{'model':db[_0x39be8d[_0xc633('0x1b')]],'as':_0x39be8d['as'],'attributes':_0x39be8d[_0xc633('0x17')],'include':_0x39be8d[_0xc633('0x19')]?_[_0xc633('0x1a')](_0x39be8d['include'],function(_0x103609){return{'model':db[_0x103609['model']],'as':_0x103609['as'],'attributes':_0x103609[_0xc633('0x17')]};}):[]};}):[]};}):[]:[]})[_0xc633('0xb')](function(_0x700051){logger['info']('GetTrigger',_0x7fabee);logger['debug'](_0xc633('0x1c'),_0x7fabee,JSON[_0xc633('0x1d')](_0x700051));_0x359dbd(_0x700051);})[_0xc633('0x12')](function(_0x579806){logger[_0xc633('0xf')](_0xc633('0x1c'),_0x579806[_0xc633('0x11')],_0x7fabee);_0xcb76ec(_0x582e92['error'](0x1f4,_0x579806[_0xc633('0x11')]));});});};exports['ShowTrigger']=function(_0x3f7da3){var _0x1ca411=this;return new Promise(function(_0x45d43d,_0x1fa30a){return db['Trigger'][_0xc633('0x1e')]({'raw':_0x3f7da3[_0xc633('0x14')]?_0x3f7da3[_0xc633('0x14')][_0xc633('0x15')]===undefined?!![]:![]:!![],'where':_0x3f7da3[_0xc633('0x14')]?_0x3f7da3[_0xc633('0x14')][_0xc633('0x16')]||null:null,'attributes':_0x3f7da3[_0xc633('0x14')]?_0x3f7da3[_0xc633('0x14')][_0xc633('0x17')]||null:null,'include':_0x3f7da3[_0xc633('0x14')]?_0x3f7da3[_0xc633('0x14')][_0xc633('0x19')]?_[_0xc633('0x1a')](_0x3f7da3[_0xc633('0x14')][_0xc633('0x19')],function(_0x1d1c9f){return{'model':db[_0x1d1c9f[_0xc633('0x1b')]],'as':_0x1d1c9f['as'],'attributes':_0x1d1c9f[_0xc633('0x17')],'include':_0x1d1c9f[_0xc633('0x19')]?_[_0xc633('0x1a')](_0x1d1c9f[_0xc633('0x19')],function(_0x248be4){return{'model':db[_0x248be4[_0xc633('0x1b')]],'as':_0x248be4['as'],'attributes':_0x248be4[_0xc633('0x17')],'include':_0x248be4['include']?_[_0xc633('0x1a')](_0x248be4[_0xc633('0x19')],function(_0x3237ac){return{'model':db[_0x3237ac[_0xc633('0x1b')]],'as':_0x3237ac['as'],'attributes':_0x3237ac[_0xc633('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x16fe1d){logger[_0xc633('0xc')](_0xc633('0x1f'),_0x3f7da3);logger[_0xc633('0xd')]('ShowTrigger',_0x3f7da3,JSON['stringify'](_0x16fe1d));_0x45d43d(_0x16fe1d);})[_0xc633('0x12')](function(_0x1ae8dc){logger[_0xc633('0xf')](_0xc633('0x1f'),_0x1ae8dc[_0xc633('0x11')],_0x3f7da3);_0x1fa30a(_0x1ca411[_0xc633('0xf')](0x1f4,_0x1ae8dc[_0xc633('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 8cb464d..891bb82 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 _0x28c0=['isAuthenticated','show','post','clone','create','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','index','/:id'];(function(_0x4ef3fe,_0x3e9e16){var _0x350d64=function(_0x260686){while(--_0x260686){_0x4ef3fe['push'](_0x4ef3fe['shift']());}};_0x350d64(++_0x3e9e16);}(_0x28c0,0x16e));var _0x028c=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x28c0[_0x11005e];return _0x29338f;};'use strict';var multer=require(_0x028c('0x0'));var util=require(_0x028c('0x1'));var path=require(_0x028c('0x2'));var timeout=require(_0x028c('0x3'));var express=require('express');var router=express[_0x028c('0x4')]();var auth=require(_0x028c('0x5'));var interaction=require(_0x028c('0x6'));var config=require(_0x028c('0x7'));var controller=require(_0x028c('0x8'));router[_0x028c('0x9')]('/',auth['isAuthenticated'](),controller[_0x028c('0xa')]);router[_0x028c('0x9')](_0x028c('0xb'),auth[_0x028c('0xc')](),controller[_0x028c('0xd')]);router[_0x028c('0xe')]('/:id/clone',auth[_0x028c('0xc')](),controller[_0x028c('0xf')]);router[_0x028c('0xe')]('/',auth['isAuthenticated'](),controller[_0x028c('0x10')]);router[_0x028c('0x11')]('/:id',auth[_0x028c('0xc')](),controller[_0x028c('0x12')]);router[_0x028c('0x13')](_0x028c('0xb'),auth[_0x028c('0xc')](),controller['destroy']);module[_0x028c('0x14')]=router; \ No newline at end of file +var _0xc216=['create','update','destroy','multer','util','express','Router','../../components/interaction/service','get','isAuthenticated','/:id','show','post','clone'];(function(_0x2acd68,_0x18e303){var _0x4a68d3=function(_0x73caa8){while(--_0x73caa8){_0x2acd68['push'](_0x2acd68['shift']());}};_0x4a68d3(++_0x18e303);}(_0xc216,0x1ed));var _0x6c21=function(_0x3b90ab,_0x174a22){_0x3b90ab=_0x3b90ab-0x0;var _0x206e92=_0xc216[_0x3b90ab];return _0x206e92;};'use strict';var multer=require(_0x6c21('0x0'));var util=require(_0x6c21('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6c21('0x2'));var router=express[_0x6c21('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x6c21('0x4'));var config=require('../../config/environment');var controller=require('./trunk.controller');router[_0x6c21('0x5')]('/',auth[_0x6c21('0x6')](),controller['index']);router['get'](_0x6c21('0x7'),auth['isAuthenticated'](),controller[_0x6c21('0x8')]);router[_0x6c21('0x9')]('/:id/clone',auth[_0x6c21('0x6')](),controller[_0x6c21('0xa')]);router[_0x6c21('0x9')]('/',auth[_0x6c21('0x6')](),controller[_0x6c21('0xb')]);router['put'](_0x6c21('0x7'),auth['isAuthenticated'](),controller[_0x6c21('0xc')]);router['delete'](_0x6c21('0x7'),auth['isAuthenticated'](),controller[_0x6c21('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 8ce5f2c..39769b6 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(_0x4a9d08,_0x17ee10){var _0x5efecc=function(_0x149dad){while(--_0x149dad){_0x4a9d08['push'](_0x4a9d08['shift']());}};_0x5efecc(++_0x17ee10);}(_0x757a,0xde));var _0xa757=function(_0x311d0b,_0x2d0c88){_0x311d0b=_0x311d0b-0x0;var _0x319f49=_0x757a[_0x311d0b];return _0x319f49;};'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 _0xbaf0=['setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','auto','yes','outgoing','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','INTEGER','always','accept','refuse','originate','uac','uas','pai','fingerprint','active','passive','actpass','dynamic','nonat','update,nonat','exports','STRING','name','ENUM','friend','user','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','udp'];(function(_0x2ff022,_0x183a9c){var _0x1cbaa5=function(_0x342bd9){while(--_0x342bd9){_0x2ff022['push'](_0x2ff022['shift']());}};_0x1cbaa5(++_0x183a9c);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x4'),_0x0baf('0x5'),'peer'),'allowNull':![],'defaultValue':_0x0baf('0x4')},'context':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'defaultValue':_0x0baf('0x6')},'callingpres':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x7'),_0x0baf('0x8'),_0x0baf('0x9'),_0x0baf('0xa'),_0x0baf('0xb'),'PROHIB_PASSED_SCREEN',_0x0baf('0xc'),'PROHIB')},'deny':{'type':Sequelize[_0x0baf('0x1')]},'permit':{'type':Sequelize[_0x0baf('0x1')]},'secret':{'type':Sequelize[_0x0baf('0x1')]},'md5secret':{'type':Sequelize[_0x0baf('0x1')]},'remotesecret':{'type':Sequelize[_0x0baf('0x1')]},'transport':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':_0x0baf('0xd'),'set':function(_0x245a6b){this[_0x0baf('0xe')](_0x0baf('0xf'),_0x245a6b?_0x245a6b[_0x0baf('0x10')](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0x0baf('0x11')](_0x0baf('0xf'))[_0x0baf('0x12')](','):null;},'comment':_0x0baf('0x13')},'dtmfmode':{'type':Sequelize['ENUM'](_0x0baf('0x14'),'info',_0x0baf('0x15'),_0x0baf('0x16'),_0x0baf('0x17')),'defaultValue':_0x0baf('0x14')},'directmedia':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no','nonat','update',_0x0baf('0x19')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0baf('0x1')]},'directmediadeny':{'type':Sequelize[_0x0baf('0x1')]},'nat':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':'force_rport,comedia','set':function(_0x63c820){this[_0x0baf('0xe')](_0x0baf('0x1a'),_0x63c820?_0x63c820[_0x0baf('0x10')](','):null);},'get':function(){return this[_0x0baf('0x11')](_0x0baf('0x1a'))?this['getDataValue']('nat')[_0x0baf('0x12')](','):null;},'comment':_0x0baf('0x1b')},'callgroup':{'type':Sequelize[_0x0baf('0x1')]},'namedcallgroup':{'type':Sequelize[_0x0baf('0x1')]},'pickupgroup':{'type':Sequelize[_0x0baf('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x0baf('0x1')]},'language':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0baf('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':_0x0baf('0x1c')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0baf('0x1d'),'set':function(_0x482522){this[_0x0baf('0xe')]('allow',_0x482522?_0x482522['join'](';'):_0x0baf('0x1d'));},'get':function(){return this['getDataValue']('allow')?this[_0x0baf('0x11')](_0x0baf('0x1e'))[_0x0baf('0x12')](';'):null;},'comment':_0x0baf('0x1f')},'autoframing':{'type':Sequelize[_0x0baf('0x3')]('yes','no')},'insecure':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':_0x0baf('0x20'),'set':function(_0x1ca35a){this[_0x0baf('0xe')](_0x0baf('0x21'),_0x1ca35a?_0x1ca35a[_0x0baf('0x10')](','):null);},'get':function(){return this[_0x0baf('0x11')]('insecure')?this[_0x0baf('0x11')](_0x0baf('0x21'))[_0x0baf('0x12')](','):null;},'comment':_0x0baf('0x22')},'trustrpid':{'type':Sequelize['ENUM'](_0x0baf('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0baf('0x3')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no',_0x0baf('0x23'))},'promiscredir':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no')},'useclientcode':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x0baf('0x1')]},'callerid':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':_0x0baf('0x24')},'amaflags':{'type':Sequelize[_0x0baf('0x1')]},'callcounter':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no'),'defaultValue':_0x0baf('0x18')},'busylevel':{'type':Sequelize[_0x0baf('0x25')](0xb)},'allowoverlap':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no')},'allowsubscribe':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no')},'allowtransfer':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x0baf('0x18'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x0baf('0x1')]},'videosupport':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no',_0x0baf('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x27'),_0x0baf('0x28'),_0x0baf('0x29'))},'session_expires':{'type':Sequelize[_0x0baf('0x25')](0xb)},'session_minse':{'type':Sequelize[_0x0baf('0x25')](0xb)},'session_refresher':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x2a'),'uas'),'defaultValue':_0x0baf('0x2b')},'t38pt_usertpsource':{'type':Sequelize[_0x0baf('0x1')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x0baf('0x1')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x0baf('0x1')]},'defaultuser':{'type':Sequelize[_0x0baf('0x1')]},'rtptimeout':{'type':Sequelize[_0x0baf('0x25')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x0baf('0x25')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x0baf('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no',_0x0baf('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0baf('0x1')]},'callbackextension':{'type':Sequelize[_0x0baf('0x1')]},'timert1':{'type':Sequelize[_0x0baf('0x25')](0xb)},'timerb':{'type':Sequelize[_0x0baf('0x25')](0xb)},'qualifyfreq':{'type':Sequelize[_0x0baf('0x25')](0xb)},'contactpermit':{'type':Sequelize[_0x0baf('0x1')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x0baf('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x0baf('0x1')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x0baf('0x25')](0xb)},'encryption':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no')},'force_avp':{'type':Sequelize[_0x0baf('0x3')]('yes','no')},'icesupport':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x0baf('0x18'),'no')},'dtlsverify':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no',_0x0baf('0x2d'),'certificate')},'dtlsrekey':{'type':Sequelize[_0x0baf('0x25')](0xb)},'dtlscertfile':{'type':Sequelize[_0x0baf('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0x0baf('0x1')]},'dtlscipher':{'type':Sequelize[_0x0baf('0x1')]},'dtlscafile':{'type':Sequelize[_0x0baf('0x1')]},'dtlscapath':{'type':Sequelize[_0x0baf('0x1')]},'dtlssetup':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x2e'),_0x0baf('0x2f'),_0x0baf('0x30')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x0baf('0x1')]},'recordofffeature':{'type':Sequelize[_0x0baf('0x1')]},'call_limit':{'type':Sequelize[_0x0baf('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0x0baf('0x18'),'no')},'subscribemwi':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no')},'vmexten':{'type':Sequelize[_0x0baf('0x1')]},'mohinterpret':{'type':Sequelize[_0x0baf('0x1')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0x0baf('0x1')]},'description':{'type':Sequelize[_0x0baf('0x1')]},'host':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':_0x0baf('0x31')},'canreinvite':{'type':Sequelize[_0x0baf('0x3')](_0x0baf('0x18'),'no',_0x0baf('0x32'),'update',_0x0baf('0x33')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x0baf('0x1')]},'otherFields':{'type':Sequelize[_0x0baf('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index c1b5585..b27f750 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 _0xbb07=['join','/etc/asterisk/sip_xcally_trunks.conf','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','user','root','server/files/templates/registry.ejs','render','writeFileSync','Reload','server/files/templates/trunk.ejs','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','json','count','offset','limit','Content-Range','reject','save','update','get','Trunks','UserProfileResource','destroy','end','name','send','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','map','type','key','VIRTUAL','field','options','Trunk','includeAll','include','findAll','rows','merge','params','find','omit','createdAt','updatedAt','body','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','utf8'];(function(_0x6f5ec1,_0x393540){var _0x23d424=function(_0x4642ef){while(--_0x4642ef){_0x6f5ec1['push'](_0x6f5ec1['shift']());}};_0x23d424(++_0x393540);}(_0xbb07,0x14c));var _0x7bb0=function(_0x4f17f6,_0x350c26){_0x4f17f6=_0x4f17f6-0x0;var _0x387c32=_0xbb07[_0x4f17f6];return _0x387c32;};'use strict';var pdf=require(_0x7bb0('0x0'));var emlformat=require(_0x7bb0('0x1'));var rimraf=require(_0x7bb0('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7bb0('0x3'));var rp=require(_0x7bb0('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7bb0('0x5'));var util=require(_0x7bb0('0x6'));var path=require(_0x7bb0('0x7'));var sox=require(_0x7bb0('0x8'));var csv=require(_0x7bb0('0x9'));var ejs=require(_0x7bb0('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7bb0('0xb'));var crypto=require(_0x7bb0('0xc'));var jsforce=require(_0x7bb0('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7bb0('0xe'));var Papa=require(_0x7bb0('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7bb0('0x10'));var hardwareService=require(_0x7bb0('0x11'));var logger=require(_0x7bb0('0x12'))(_0x7bb0('0x13'));var utils=require('../../config/utils');var config=require(_0x7bb0('0x14'));var db=require('../../mysqldb')['db'];var jayson=require(_0x7bb0('0x15'));var client=jayson[_0x7bb0('0x16')][_0x7bb0('0x17')]({'port':0x232a});function checkPasswordPattern(_0x4955ff,_0x1e0e50,_0x37e230){if(_0x37e230){var _0x1e6f42=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1e6f42[_0x7bb0('0x18')](_0x1e0e50)){return _0x4955ff;}else{throw new Error(_0x7bb0('0x19'));}}else{return _0x4955ff;}}function respondWithRpcPromise(_0x169ee0,_0x1a469e,_0x2a10bd,_0x2473d7){return new BPromise(function(_0x4fb8dd,_0xe574cc){var _0x1a03f4=_0x2473d7||client;return _0x1a03f4[_0x7bb0('0x1a')](_0x169ee0,_0x2a10bd)[_0x7bb0('0x1b')](function(_0x1ec883){logger[_0x7bb0('0x1c')](_0x7bb0('0x1d'),_0x1a469e,_0x7bb0('0x1e'));logger[_0x7bb0('0x1f')](_0x7bb0('0x20'),_0x1a469e,_0x7bb0('0x1e'),JSON[_0x7bb0('0x21')](_0x1ec883));if(_0x1ec883[_0x7bb0('0x22')]){if(_0x1ec883[_0x7bb0('0x22')]['code']===0x1f4){logger[_0x7bb0('0x22')](_0x7bb0('0x1d'),_0x1a469e,_0x1ec883[_0x7bb0('0x22')][_0x7bb0('0x23')]);return _0xe574cc(_0x1ec883[_0x7bb0('0x22')][_0x7bb0('0x23')]);}logger[_0x7bb0('0x22')](_0x7bb0('0x1d'),_0x1a469e,_0x1ec883[_0x7bb0('0x22')]['message']);return _0x4fb8dd(_0x1ec883[_0x7bb0('0x22')][_0x7bb0('0x23')]);}else{logger[_0x7bb0('0x1c')](_0x7bb0('0x1d'),_0x1a469e,_0x7bb0('0x1e'));_0x4fb8dd(_0x1ec883[_0x7bb0('0x24')][_0x7bb0('0x23')]);}})[_0x7bb0('0x25')](function(_0xb8fec1){logger[_0x7bb0('0x22')](_0x7bb0('0x1d'),_0x1a469e,_0xb8fec1);_0xe574cc(_0xb8fec1);});});}function respondWithStatusCode(_0x238bb4,_0x574f4d){_0x574f4d=_0x574f4d||0xcc;return function(_0x10285f){if(_0x10285f){return _0x238bb4['sendStatus'](_0x574f4d);}return _0x238bb4[_0x7bb0('0x26')](_0x574f4d)['end']();};}function respondWithResult(_0x3294bb,_0x17ec73){_0x17ec73=_0x17ec73||0xc8;return function(_0x244271){if(_0x244271){return _0x3294bb['status'](_0x17ec73)[_0x7bb0('0x27')](_0x244271);}};}function respondWithFilteredResult(_0x667c84,_0x3ae9ef){return function(_0x52804e){if(_0x52804e){var _0x43a492=_0x52804e[_0x7bb0('0x28')],_0x27afea=_0x3ae9ef[_0x7bb0('0x29')],_0x3a041a=_0x3ae9ef[_0x7bb0('0x29')]+_0x3ae9ef[_0x7bb0('0x2a')],_0x2f51dc;if(_0x3a041a>=_0x43a492){_0x3a041a=_0x43a492;_0x2f51dc=0xc8;}else{_0x2f51dc=0xce;}_0x667c84[_0x7bb0('0x26')](_0x2f51dc);return _0x667c84['set'](_0x7bb0('0x2b'),_0x27afea+'-'+_0x3a041a+'/'+_0x43a492)[_0x7bb0('0x27')](_0x52804e);}return null;};}function patchUpdates(_0x4b1f6b){return function(_0x1d1fa4){try{jsonpatch['apply'](_0x1d1fa4,_0x4b1f6b,!![]);}catch(_0x153332){return BPromise[_0x7bb0('0x2c')](_0x153332);}return _0x1d1fa4[_0x7bb0('0x2d')]();};}function saveUpdates(_0x3db8ee,_0x4aed28){return function(_0x453169){if(_0x453169){return _0x453169[_0x7bb0('0x2e')](_0x3db8ee)[_0x7bb0('0x1b')](function(_0x2ea459){return _0x2ea459;});}return null;};}function removeEntity(_0x350abe,_0x1f921a){return function(_0x3a1471){if(_0x3a1471){return _0x3a1471['destroy']()['then'](function(){var _0x4b0f43=_0x3a1471[_0x7bb0('0x2f')]({'plain':!![]});var _0x485785=_0x7bb0('0x30');return db[_0x7bb0('0x31')][_0x7bb0('0x32')]({'where':{'type':_0x485785,'resourceId':_0x4b0f43['id']}})[_0x7bb0('0x1b')](function(){return _0x3a1471;});})[_0x7bb0('0x1b')](function(){_0x350abe['status'](0xcc)[_0x7bb0('0x33')]();});}};}function handleEntityNotFound(_0x38f1e4,_0x3c63fd){return function(_0x373f3a){if(!_0x373f3a){_0x38f1e4['sendStatus'](0x194);}return _0x373f3a;};}function handleError(_0x64cb92,_0x1cc494){_0x1cc494=_0x1cc494||0x1f4;return function(_0x149e4f){logger[_0x7bb0('0x22')](_0x149e4f['stack']);if(_0x149e4f[_0x7bb0('0x34')]){delete _0x149e4f['name'];}_0x64cb92[_0x7bb0('0x26')](_0x1cc494)[_0x7bb0('0x35')](_0x149e4f);};}exports['index']=function(_0x20125c,_0x55a064){var _0x4d7e5d={},_0x5ac39d={},_0x4d8c99={'count':0x0,'rows':[]};var _0x4300dc=db['Trunk'][_0x7bb0('0x36')];_0x5ac39d[_0x7bb0('0x37')]=_[_0x7bb0('0x38')](_0x4300dc);_0x5ac39d[_0x7bb0('0x39')]=_['keys'](_0x20125c[_0x7bb0('0x39')]);_0x5ac39d[_0x7bb0('0x3a')]=_[_0x7bb0('0x3b')](_0x5ac39d['model'],_0x5ac39d['query']);_0x4d7e5d['attributes']=_[_0x7bb0('0x3b')](_0x5ac39d[_0x7bb0('0x37')],qs[_0x7bb0('0x3c')](_0x20125c[_0x7bb0('0x39')][_0x7bb0('0x3c')]));_0x4d7e5d['attributes']=_0x4d7e5d[_0x7bb0('0x3d')][_0x7bb0('0x3e')]?_0x4d7e5d[_0x7bb0('0x3d')]:_0x5ac39d[_0x7bb0('0x37')];if(!_0x20125c[_0x7bb0('0x39')][_0x7bb0('0x3f')](_0x7bb0('0x40'))){_0x4d7e5d['limit']=qs['limit'](_0x20125c['query']['limit']);_0x4d7e5d[_0x7bb0('0x29')]=qs[_0x7bb0('0x29')](_0x20125c[_0x7bb0('0x39')][_0x7bb0('0x29')]);}_0x4d7e5d[_0x7bb0('0x41')]=qs[_0x7bb0('0x42')](_0x20125c[_0x7bb0('0x39')][_0x7bb0('0x42')]);_0x4d7e5d['where']=qs['filters'](_[_0x7bb0('0x43')](_0x20125c[_0x7bb0('0x39')],_0x5ac39d[_0x7bb0('0x3a')]));if(_0x20125c[_0x7bb0('0x39')][_0x7bb0('0x44')]){_0x4d7e5d[_0x7bb0('0x45')]=_['merge'](_0x4d7e5d[_0x7bb0('0x45')],{'$or':_[_0x7bb0('0x46')](_0x4300dc,function(_0x116618){if(_0x116618[_0x7bb0('0x47')][_0x7bb0('0x48')]!==_0x7bb0('0x49')){var _0x2427cc={};_0x2427cc[_0x116618[_0x7bb0('0x4a')]]={'$like':'%'+_0x20125c[_0x7bb0('0x39')]['filter']+'%'};return _0x2427cc;}})});}_0x4d7e5d=_['merge']({},_0x4d7e5d,_0x20125c[_0x7bb0('0x4b')]);var _0xdedc38={'where':_0x4d7e5d[_0x7bb0('0x45')]};return db[_0x7bb0('0x4c')]['count'](_0xdedc38)[_0x7bb0('0x1b')](function(_0x285145){_0x4d8c99[_0x7bb0('0x28')]=_0x285145;if(_0x20125c[_0x7bb0('0x39')][_0x7bb0('0x4d')]){_0x4d7e5d[_0x7bb0('0x4e')]=[{'all':!![]}];}return db['Trunk'][_0x7bb0('0x4f')](_0x4d7e5d);})['then'](function(_0x4ce5de){_0x4d8c99[_0x7bb0('0x50')]=_0x4ce5de;return _0x4d8c99;})[_0x7bb0('0x1b')](respondWithFilteredResult(_0x55a064,_0x4d7e5d))[_0x7bb0('0x25')](handleError(_0x55a064,null));};exports['show']=function(_0x280624,_0x73ed82){var _0x4ea7a9={'raw':![],'where':{'id':_0x280624['params']['id']}},_0x1f1632={};_0x1f1632[_0x7bb0('0x37')]=_[_0x7bb0('0x38')](db[_0x7bb0('0x4c')][_0x7bb0('0x36')]);_0x1f1632['query']=_[_0x7bb0('0x38')](_0x280624[_0x7bb0('0x39')]);_0x1f1632[_0x7bb0('0x3a')]=_['intersection'](_0x1f1632[_0x7bb0('0x37')],_0x1f1632[_0x7bb0('0x39')]);_0x4ea7a9[_0x7bb0('0x3d')]=_['intersection'](_0x1f1632[_0x7bb0('0x37')],qs['fields'](_0x280624[_0x7bb0('0x39')][_0x7bb0('0x3c')]));_0x4ea7a9[_0x7bb0('0x3d')]=_0x4ea7a9[_0x7bb0('0x3d')][_0x7bb0('0x3e')]?_0x4ea7a9[_0x7bb0('0x3d')]:_0x1f1632[_0x7bb0('0x37')];if(_0x280624[_0x7bb0('0x39')][_0x7bb0('0x4d')]){_0x4ea7a9[_0x7bb0('0x4e')]=[{'all':!![]}];}_0x4ea7a9=_[_0x7bb0('0x51')]({},_0x4ea7a9,_0x280624[_0x7bb0('0x4b')]);return db[_0x7bb0('0x4c')]['find'](_0x4ea7a9)[_0x7bb0('0x1b')](handleEntityNotFound(_0x73ed82,null))[_0x7bb0('0x1b')](respondWithResult(_0x73ed82,null))[_0x7bb0('0x25')](handleError(_0x73ed82,null));};exports['clone']=function(_0x14d1cc,_0x38c354){var _0x275365={'raw':![],'where':{'id':_0x14d1cc[_0x7bb0('0x52')]['id']}},_0x46d5a2={};_0x46d5a2[_0x7bb0('0x37')]=_[_0x7bb0('0x38')](db[_0x7bb0('0x4c')][_0x7bb0('0x36')]);_0x275365[_0x7bb0('0x3d')]=_['intersection'](_0x46d5a2[_0x7bb0('0x37')],qs[_0x7bb0('0x3c')](_0x14d1cc[_0x7bb0('0x39')]['fields']));_0x275365[_0x7bb0('0x3d')]=_0x275365['attributes'][_0x7bb0('0x3e')]?_0x275365[_0x7bb0('0x3d')]:_0x46d5a2[_0x7bb0('0x37')];if(_0x14d1cc[_0x7bb0('0x39')][_0x7bb0('0x4d')]){_0x275365[_0x7bb0('0x4e')]=[{'all':!![]}];}_0x275365=_[_0x7bb0('0x51')]({},_0x275365,_0x14d1cc[_0x7bb0('0x4b')]);return db[_0x7bb0('0x4c')][_0x7bb0('0x53')](_0x275365)[_0x7bb0('0x1b')](handleEntityNotFound(_0x38c354,null))[_0x7bb0('0x1b')](function(_0x1f0607){if(_0x1f0607){var _0xc0902b=_0x1f0607[_0x7bb0('0x2f')]({'plain':!![]});_0xc0902b=qs[_0x7bb0('0x54')](_0xc0902b,['id',_0x7bb0('0x55'),_0x7bb0('0x56')]);_0x14d1cc['body']=_['omit'](_0x14d1cc[_0x7bb0('0x57')],['id','createdAt','updatedAt']);return db['Trunk'][_0x7bb0('0x58')](_[_0x7bb0('0x51')](_0xc0902b,_0x14d1cc[_0x7bb0('0x57')]),{'include':_0x14d1cc[_0x7bb0('0x39')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x27108e){var _0x2c6961=_0x14d1cc['user'][_0x7bb0('0x2f')]({'plain':!![]});if(!_0x2c6961)throw new Error(_0x7bb0('0x59'));if(_0x2c6961[_0x7bb0('0x5a')]==='user'){var _0x59acab=_0x27108e['get']({'plain':!![]});var _0x4e85e1=_0x7bb0('0x30');return db[_0x7bb0('0x5b')][_0x7bb0('0x53')]({'where':{'name':_0x4e85e1,'userProfileId':_0x2c6961[_0x7bb0('0x5c')]},'raw':!![]})[_0x7bb0('0x1b')](function(_0x178795){if(_0x178795&&_0x178795['autoAssociation']===0x0){return db[_0x7bb0('0x31')][_0x7bb0('0x58')]({'name':_0x59acab[_0x7bb0('0x34')],'resourceId':_0x59acab['id'],'type':_0x178795[_0x7bb0('0x34')],'sectionId':_0x178795['id']},{})['then'](function(){return _0x27108e;});}else{return _0x27108e;}})[_0x7bb0('0x25')](function(_0x48bb60){logger[_0x7bb0('0x22')](_0x7bb0('0x5d'),_0x48bb60);throw _0x48bb60;});}return _0x27108e;});}})[_0x7bb0('0x1b')](respondWithResult(_0x38c354,0xc9))[_0x7bb0('0x25')](handleError(_0x38c354,null));};exports['create']=function(_0x1fd047,_0x195c79,_0x4d2087){var _0x2afa55;return db[_0x7bb0('0x4c')][_0x7bb0('0x58')](_0x1fd047[_0x7bb0('0x57')],{'raw':!![]})[_0x7bb0('0x1b')](function(_0x5e746c){_0x2afa55=_0x5e746c;return db[_0x7bb0('0x4c')][_0x7bb0('0x4f')]({'raw':!![]});})[_0x7bb0('0x1b')](function(_0x475659){var _0x2d9fa6=fs[_0x7bb0('0x5e')](path['join'](config['root'],'server/files/templates/trunk.ejs'),_0x7bb0('0x5f'));var _0x586254=fs[_0x7bb0('0x5e')](path[_0x7bb0('0x60')](config['root'],'server/files/templates/registry.ejs'),_0x7bb0('0x5f'));var _0xd444d6=ejs['render'](_0x2d9fa6,{'trunks':_0x475659||[]});fs['writeFileSync'](_0x7bb0('0x61'),_0xd444d6);if(_0x2afa55['registry']){var _0x2a7fb8=ejs['render'](_0x586254,{'trunks':_0x475659||[]});fs['writeFileSync'](_0x7bb0('0x62'),_0x2a7fb8);}})['then'](function(){return respondWithRpcPromise('Reload',_0x7bb0('0x58'),{'module':_0x7bb0('0x63')});})['then'](function(){var _0x5955e7=_0x1fd047[_0x7bb0('0x64')][_0x7bb0('0x2f')]({'plain':!![]});if(!_0x5955e7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5955e7['role']===_0x7bb0('0x64')){var _0x1eb9d7=_0x2afa55[_0x7bb0('0x2f')]({'plain':!![]});return db['UserProfileSection'][_0x7bb0('0x53')]({'where':{'name':_0x7bb0('0x30'),'userProfileId':_0x5955e7[_0x7bb0('0x5c')]},'raw':!![]})[_0x7bb0('0x1b')](function(_0x2764ad){if(_0x2764ad&&_0x2764ad['autoAssociation']===0x0){return db[_0x7bb0('0x31')][_0x7bb0('0x58')]({'name':_0x1eb9d7[_0x7bb0('0x34')],'resourceId':_0x1eb9d7['id'],'type':_0x2764ad[_0x7bb0('0x34')],'sectionId':_0x2764ad['id']},{})[_0x7bb0('0x1b')](function(){return _0x2afa55;});}else{return _0x2afa55;}})[_0x7bb0('0x25')](function(_0x2ad333){logger[_0x7bb0('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ad333);throw _0x2ad333;});}return _0x2afa55;})[_0x7bb0('0x1b')](respondWithResult(_0x195c79,0xc9))[_0x7bb0('0x25')](handleError(_0x195c79,null));};exports['update']=function(_0x58d485,_0x44d758,_0x1f8f42){var _0x4e4062;return db['Trunk'][_0x7bb0('0x53')]({'where':{'id':_0x58d485['params']['id']}})[_0x7bb0('0x1b')](handleEntityNotFound(_0x44d758,null))[_0x7bb0('0x1b')](saveUpdates(_0x58d485[_0x7bb0('0x57')],null))['then'](function(_0x3bbea2){if(_0x3bbea2){_0x4e4062=_0x3bbea2;return db[_0x7bb0('0x4c')][_0x7bb0('0x4f')]({'raw':!![]});}})[_0x7bb0('0x1b')](function(_0x5c1890){if(_0x5c1890){var _0x31836f=fs[_0x7bb0('0x5e')](path[_0x7bb0('0x60')](config[_0x7bb0('0x65')],'server/files/templates/trunk.ejs'),'utf8');var _0x45f47d=fs[_0x7bb0('0x5e')](path[_0x7bb0('0x60')](config[_0x7bb0('0x65')],_0x7bb0('0x66')),_0x7bb0('0x5f'));var _0x3c896b=ejs[_0x7bb0('0x67')](_0x31836f,{'trunks':_0x5c1890||[]});fs[_0x7bb0('0x68')]('/etc/asterisk/sip_xcally_trunks.conf',_0x3c896b);var _0x3af3a0=ejs[_0x7bb0('0x67')](_0x45f47d,{'trunks':_0x5c1890||[]});fs[_0x7bb0('0x68')](_0x7bb0('0x62'),_0x3af3a0);return respondWithRpcPromise(_0x7bb0('0x69'),_0x7bb0('0x2e'),{'module':'chan_sip.so'});}return null;})[_0x7bb0('0x1b')](function(_0x1e11d6){if(_0x1e11d6){return _0x4e4062;}})['then'](respondWithResult(_0x44d758,null))[_0x7bb0('0x25')](handleError(_0x44d758,null));};exports[_0x7bb0('0x32')]=function(_0x3e9404,_0x57f3d2,_0x35ab04){var _0x421e49;return db[_0x7bb0('0x4c')][_0x7bb0('0x53')]({'where':{'id':_0x3e9404[_0x7bb0('0x52')]['id']}})[_0x7bb0('0x1b')](handleEntityNotFound(_0x57f3d2,null))[_0x7bb0('0x1b')](removeEntity(_0x57f3d2,null))['then'](function(){return db[_0x7bb0('0x4c')]['findAll']({'raw':!![]});})[_0x7bb0('0x1b')](function(_0x5ac32e){var _0x13951f=fs[_0x7bb0('0x5e')](path[_0x7bb0('0x60')](config[_0x7bb0('0x65')],_0x7bb0('0x6a')),_0x7bb0('0x5f'));var _0x138a18=fs[_0x7bb0('0x5e')](path['join'](config[_0x7bb0('0x65')],'server/files/templates/registry.ejs'),_0x7bb0('0x5f'));var _0x508228=ejs[_0x7bb0('0x67')](_0x13951f,{'trunks':_0x5ac32e});var _0x5db0f2=ejs[_0x7bb0('0x67')](_0x138a18,{'trunks':_0x5ac32e});fs[_0x7bb0('0x68')](_0x7bb0('0x61'),_0x508228);fs[_0x7bb0('0x68')](_0x7bb0('0x62'),_0x5db0f2);return respondWithRpcPromise(_0x7bb0('0x69'),_0x7bb0('0x32'),{'module':_0x7bb0('0x63')});})[_0x7bb0('0x25')](handleError(_0x57f3d2,null));}; \ No newline at end of file +var _0x2a5b=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','create','join','server/files/templates/trunk.ejs','readFileSync','server/files/templates/registry.ejs','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','root','/etc/asterisk/sip_xcally_registers.conf','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','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','debug','error','code','Trunk,\x20%s,\x20%s','message','result','catch','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','get','UserProfileResource','destroy','stack','name','send','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','map','VIRTUAL','field','merge','options','Trunk','includeAll','include','findAll','params','find','omit','createdAt','updatedAt','body','role','Trunks','UserProfileSection'];(function(_0x50a64b,_0x1f8753){var _0x518fca=function(_0x95f0b9){while(--_0x95f0b9){_0x50a64b['push'](_0x50a64b['shift']());}};_0x518fca(++_0x1f8753);}(_0x2a5b,0x79));var _0xb2a5=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x2a5b[_0x4f9b18];return _0x29f20c;};'use strict';var pdf=require(_0xb2a5('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb2a5('0x1'));var zipdir=require(_0xb2a5('0x2'));var jsonpatch=require(_0xb2a5('0x3'));var rp=require('request-promise');var moment=require(_0xb2a5('0x4'));var BPromise=require(_0xb2a5('0x5'));var Mustache=require(_0xb2a5('0x6'));var util=require(_0xb2a5('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xb2a5('0x8'));var ejs=require(_0xb2a5('0x9'));var fs=require('fs');var _=require(_0xb2a5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb2a5('0xb'));var toCsv=require(_0xb2a5('0x8'));var querystring=require(_0xb2a5('0xc'));var Papa=require(_0xb2a5('0xd'));var Redis=require('ioredis');var authService=require(_0xb2a5('0xe'));var qs=require(_0xb2a5('0xf'));var hardwareService=require(_0xb2a5('0x10'));var logger=require(_0xb2a5('0x11'))('api');var utils=require(_0xb2a5('0x12'));var config=require(_0xb2a5('0x13'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xb2a5('0x14')]({'port':0x232a});function checkPasswordPattern(_0x1e1ad6,_0x4995c2,_0x38898d){if(_0x38898d){var _0x294f77=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x294f77[_0xb2a5('0x15')](_0x4995c2)){return _0x1e1ad6;}else{throw new Error(_0xb2a5('0x16'));}}else{return _0x1e1ad6;}}function respondWithRpcPromise(_0x3e2177,_0x5608b3,_0x33771d,_0x3a1173){return new BPromise(function(_0x55d8a3,_0x53ab79){var _0x55048e=_0x3a1173||client;return _0x55048e[_0xb2a5('0x17')](_0x3e2177,_0x33771d)[_0xb2a5('0x18')](function(_0x215326){logger[_0xb2a5('0x19')]('Trunk,\x20%s,\x20%s',_0x5608b3,'request\x20sent');logger[_0xb2a5('0x1a')]('Trunk,\x20%s,\x20%s,\x20%s',_0x5608b3,'request\x20sent',JSON['stringify'](_0x215326));if(_0x215326[_0xb2a5('0x1b')]){if(_0x215326['error'][_0xb2a5('0x1c')]===0x1f4){logger[_0xb2a5('0x1b')](_0xb2a5('0x1d'),_0x5608b3,_0x215326[_0xb2a5('0x1b')][_0xb2a5('0x1e')]);return _0x53ab79(_0x215326[_0xb2a5('0x1b')][_0xb2a5('0x1e')]);}logger[_0xb2a5('0x1b')](_0xb2a5('0x1d'),_0x5608b3,_0x215326[_0xb2a5('0x1b')][_0xb2a5('0x1e')]);return _0x55d8a3(_0x215326[_0xb2a5('0x1b')]['message']);}else{logger[_0xb2a5('0x19')]('Trunk,\x20%s,\x20%s',_0x5608b3,'request\x20sent');_0x55d8a3(_0x215326[_0xb2a5('0x1f')][_0xb2a5('0x1e')]);}})[_0xb2a5('0x20')](function(_0x376df6){logger['error']('Trunk,\x20%s,\x20%s',_0x5608b3,_0x376df6);_0x53ab79(_0x376df6);});});}function respondWithStatusCode(_0x3ca454,_0x4c6b1d){_0x4c6b1d=_0x4c6b1d||0xcc;return function(_0xabb1a1){if(_0xabb1a1){return _0x3ca454['sendStatus'](_0x4c6b1d);}return _0x3ca454[_0xb2a5('0x21')](_0x4c6b1d)[_0xb2a5('0x22')]();};}function respondWithResult(_0x30ed99,_0x3f2fb5){_0x3f2fb5=_0x3f2fb5||0xc8;return function(_0x1920cf){if(_0x1920cf){return _0x30ed99[_0xb2a5('0x21')](_0x3f2fb5)[_0xb2a5('0x23')](_0x1920cf);}};}function respondWithFilteredResult(_0x718ef2,_0x5ad817){return function(_0x5321e1){if(_0x5321e1){var _0x56f75e=_0x5321e1[_0xb2a5('0x24')],_0x3c501e=_0x5ad817[_0xb2a5('0x25')],_0x4ea35e=_0x5ad817[_0xb2a5('0x25')]+_0x5ad817[_0xb2a5('0x26')],_0x46c6e0;if(_0x4ea35e>=_0x56f75e){_0x4ea35e=_0x56f75e;_0x46c6e0=0xc8;}else{_0x46c6e0=0xce;}_0x718ef2[_0xb2a5('0x21')](_0x46c6e0);return _0x718ef2[_0xb2a5('0x27')](_0xb2a5('0x28'),_0x3c501e+'-'+_0x4ea35e+'/'+_0x56f75e)['json'](_0x5321e1);}return null;};}function patchUpdates(_0x53a99b){return function(_0x345e2e){try{jsonpatch['apply'](_0x345e2e,_0x53a99b,!![]);}catch(_0x3fbc28){return BPromise[_0xb2a5('0x29')](_0x3fbc28);}return _0x345e2e[_0xb2a5('0x2a')]();};}function saveUpdates(_0x3c3217,_0x3f0686){return function(_0x16c359){if(_0x16c359){return _0x16c359[_0xb2a5('0x2b')](_0x3c3217)[_0xb2a5('0x18')](function(_0x52e10d){return _0x52e10d;});}return null;};}function removeEntity(_0x50e221,_0x4ff47d){return function(_0x29752f){if(_0x29752f){return _0x29752f['destroy']()[_0xb2a5('0x18')](function(){var _0x6b6671=_0x29752f[_0xb2a5('0x2c')]({'plain':!![]});var _0x3c5603='Trunks';return db[_0xb2a5('0x2d')][_0xb2a5('0x2e')]({'where':{'type':_0x3c5603,'resourceId':_0x6b6671['id']}})[_0xb2a5('0x18')](function(){return _0x29752f;});})[_0xb2a5('0x18')](function(){_0x50e221[_0xb2a5('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58b6bc,_0x5a54df){return function(_0x2830e5){if(!_0x2830e5){_0x58b6bc['sendStatus'](0x194);}return _0x2830e5;};}function handleError(_0x245f6b,_0x2df4cf){_0x2df4cf=_0x2df4cf||0x1f4;return function(_0x21fce3){logger[_0xb2a5('0x1b')](_0x21fce3[_0xb2a5('0x2f')]);if(_0x21fce3['name']){delete _0x21fce3[_0xb2a5('0x30')];}_0x245f6b[_0xb2a5('0x21')](_0x2df4cf)[_0xb2a5('0x31')](_0x21fce3);};}exports['index']=function(_0x28471e,_0x830814){var _0x286ff5={},_0x3a5fc1={},_0x188c84={'count':0x0,'rows':[]};var _0x279108=db['Trunk'][_0xb2a5('0x32')];_0x3a5fc1[_0xb2a5('0x33')]=_[_0xb2a5('0x34')](_0x279108);_0x3a5fc1[_0xb2a5('0x35')]=_['keys'](_0x28471e[_0xb2a5('0x35')]);_0x3a5fc1[_0xb2a5('0x36')]=_[_0xb2a5('0x37')](_0x3a5fc1[_0xb2a5('0x33')],_0x3a5fc1['query']);_0x286ff5['attributes']=_['intersection'](_0x3a5fc1[_0xb2a5('0x33')],qs[_0xb2a5('0x38')](_0x28471e[_0xb2a5('0x35')][_0xb2a5('0x38')]));_0x286ff5['attributes']=_0x286ff5[_0xb2a5('0x39')][_0xb2a5('0x3a')]?_0x286ff5[_0xb2a5('0x39')]:_0x3a5fc1[_0xb2a5('0x33')];if(!_0x28471e[_0xb2a5('0x35')][_0xb2a5('0x3b')](_0xb2a5('0x3c'))){_0x286ff5[_0xb2a5('0x26')]=qs['limit'](_0x28471e[_0xb2a5('0x35')][_0xb2a5('0x26')]);_0x286ff5[_0xb2a5('0x25')]=qs['offset'](_0x28471e['query'][_0xb2a5('0x25')]);}_0x286ff5['order']=qs[_0xb2a5('0x3d')](_0x28471e[_0xb2a5('0x35')][_0xb2a5('0x3d')]);_0x286ff5[_0xb2a5('0x3e')]=qs[_0xb2a5('0x36')](_[_0xb2a5('0x3f')](_0x28471e[_0xb2a5('0x35')],_0x3a5fc1[_0xb2a5('0x36')]));if(_0x28471e[_0xb2a5('0x35')][_0xb2a5('0x40')]){_0x286ff5[_0xb2a5('0x3e')]=_['merge'](_0x286ff5[_0xb2a5('0x3e')],{'$or':_[_0xb2a5('0x41')](_0x279108,function(_0x2477be){if(_0x2477be['type']['key']!==_0xb2a5('0x42')){var _0x4b9e57={};_0x4b9e57[_0x2477be[_0xb2a5('0x43')]]={'$like':'%'+_0x28471e[_0xb2a5('0x35')][_0xb2a5('0x40')]+'%'};return _0x4b9e57;}})});}_0x286ff5=_[_0xb2a5('0x44')]({},_0x286ff5,_0x28471e[_0xb2a5('0x45')]);var _0x13f8e2={'where':_0x286ff5[_0xb2a5('0x3e')]};return db[_0xb2a5('0x46')][_0xb2a5('0x24')](_0x13f8e2)[_0xb2a5('0x18')](function(_0x5c483f){_0x188c84['count']=_0x5c483f;if(_0x28471e[_0xb2a5('0x35')][_0xb2a5('0x47')]){_0x286ff5[_0xb2a5('0x48')]=[{'all':!![]}];}return db[_0xb2a5('0x46')][_0xb2a5('0x49')](_0x286ff5);})[_0xb2a5('0x18')](function(_0x1677ca){_0x188c84['rows']=_0x1677ca;return _0x188c84;})[_0xb2a5('0x18')](respondWithFilteredResult(_0x830814,_0x286ff5))['catch'](handleError(_0x830814,null));};exports['show']=function(_0x28e671,_0x2f12a5){var _0x260122={'raw':![],'where':{'id':_0x28e671[_0xb2a5('0x4a')]['id']}},_0x308ec8={};_0x308ec8[_0xb2a5('0x33')]=_[_0xb2a5('0x34')](db[_0xb2a5('0x46')][_0xb2a5('0x32')]);_0x308ec8['query']=_['keys'](_0x28e671['query']);_0x308ec8['filters']=_[_0xb2a5('0x37')](_0x308ec8[_0xb2a5('0x33')],_0x308ec8['query']);_0x260122[_0xb2a5('0x39')]=_['intersection'](_0x308ec8[_0xb2a5('0x33')],qs[_0xb2a5('0x38')](_0x28e671['query']['fields']));_0x260122[_0xb2a5('0x39')]=_0x260122[_0xb2a5('0x39')][_0xb2a5('0x3a')]?_0x260122['attributes']:_0x308ec8['model'];if(_0x28e671['query'][_0xb2a5('0x47')]){_0x260122[_0xb2a5('0x48')]=[{'all':!![]}];}_0x260122=_[_0xb2a5('0x44')]({},_0x260122,_0x28e671[_0xb2a5('0x45')]);return db['Trunk'][_0xb2a5('0x4b')](_0x260122)[_0xb2a5('0x18')](handleEntityNotFound(_0x2f12a5,null))[_0xb2a5('0x18')](respondWithResult(_0x2f12a5,null))[_0xb2a5('0x20')](handleError(_0x2f12a5,null));};exports['clone']=function(_0x666526,_0x5c48ff){var _0x4c76f2={'raw':![],'where':{'id':_0x666526[_0xb2a5('0x4a')]['id']}},_0x1a859c={};_0x1a859c['model']=_[_0xb2a5('0x34')](db[_0xb2a5('0x46')][_0xb2a5('0x32')]);_0x4c76f2[_0xb2a5('0x39')]=_[_0xb2a5('0x37')](_0x1a859c[_0xb2a5('0x33')],qs['fields'](_0x666526[_0xb2a5('0x35')][_0xb2a5('0x38')]));_0x4c76f2[_0xb2a5('0x39')]=_0x4c76f2[_0xb2a5('0x39')][_0xb2a5('0x3a')]?_0x4c76f2['attributes']:_0x1a859c[_0xb2a5('0x33')];if(_0x666526[_0xb2a5('0x35')][_0xb2a5('0x47')]){_0x4c76f2['include']=[{'all':!![]}];}_0x4c76f2=_['merge']({},_0x4c76f2,_0x666526[_0xb2a5('0x45')]);return db['Trunk'][_0xb2a5('0x4b')](_0x4c76f2)[_0xb2a5('0x18')](handleEntityNotFound(_0x5c48ff,null))['then'](function(_0x59bcc8){if(_0x59bcc8){var _0xb1fe21=_0x59bcc8[_0xb2a5('0x2c')]({'plain':!![]});_0xb1fe21=qs[_0xb2a5('0x4c')](_0xb1fe21,['id',_0xb2a5('0x4d'),_0xb2a5('0x4e')]);_0x666526[_0xb2a5('0x4f')]=_['omit'](_0x666526['body'],['id',_0xb2a5('0x4d'),_0xb2a5('0x4e')]);return db[_0xb2a5('0x46')]['create'](_[_0xb2a5('0x44')](_0xb1fe21,_0x666526['body']),{'include':_0x666526[_0xb2a5('0x35')]['includeAll']?[{'all':!![]}]:undefined})[_0xb2a5('0x18')](function(_0xac70fc){var _0x1c2d45=_0x666526['user'][_0xb2a5('0x2c')]({'plain':!![]});if(!_0x1c2d45)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1c2d45[_0xb2a5('0x50')]==='user'){var _0x4afa49=_0xac70fc[_0xb2a5('0x2c')]({'plain':!![]});var _0x5b746e=_0xb2a5('0x51');return db[_0xb2a5('0x52')][_0xb2a5('0x4b')]({'where':{'name':_0x5b746e,'userProfileId':_0x1c2d45[_0xb2a5('0x53')]},'raw':!![]})[_0xb2a5('0x18')](function(_0x355f7b){if(_0x355f7b&&_0x355f7b[_0xb2a5('0x54')]===0x0){return db[_0xb2a5('0x2d')]['create']({'name':_0x4afa49[_0xb2a5('0x30')],'resourceId':_0x4afa49['id'],'type':_0x355f7b[_0xb2a5('0x30')],'sectionId':_0x355f7b['id']},{})['then'](function(){return _0xac70fc;});}else{return _0xac70fc;}})[_0xb2a5('0x20')](function(_0x2dc987){logger[_0xb2a5('0x1b')](_0xb2a5('0x55'),_0x2dc987);throw _0x2dc987;});}return _0xac70fc;});}})[_0xb2a5('0x18')](respondWithResult(_0x5c48ff,0xc9))[_0xb2a5('0x20')](handleError(_0x5c48ff,null));};exports[_0xb2a5('0x56')]=function(_0x3832b0,_0x288f27,_0x201526){var _0x2cd43f;return db[_0xb2a5('0x46')][_0xb2a5('0x56')](_0x3832b0[_0xb2a5('0x4f')],{'raw':!![]})[_0xb2a5('0x18')](function(_0x35fc80){_0x2cd43f=_0x35fc80;return db[_0xb2a5('0x46')][_0xb2a5('0x49')]({'raw':!![]});})['then'](function(_0x28475a){var _0x42a306=fs['readFileSync'](path[_0xb2a5('0x57')](config['root'],_0xb2a5('0x58')),'utf8');var _0x59c3af=fs[_0xb2a5('0x59')](path[_0xb2a5('0x57')](config['root'],_0xb2a5('0x5a')),_0xb2a5('0x5b'));var _0x2a5097=ejs[_0xb2a5('0x5c')](_0x42a306,{'trunks':_0x28475a||[]});fs[_0xb2a5('0x5d')](_0xb2a5('0x5e'),_0x2a5097);if(_0x2cd43f[_0xb2a5('0x5f')]){var _0x45b624=ejs[_0xb2a5('0x5c')](_0x59c3af,{'trunks':_0x28475a||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x45b624);}})[_0xb2a5('0x18')](function(){return respondWithRpcPromise(_0xb2a5('0x60'),'create',{'module':_0xb2a5('0x61')});})[_0xb2a5('0x18')](function(){var _0x473415=_0x3832b0[_0xb2a5('0x62')][_0xb2a5('0x2c')]({'plain':!![]});if(!_0x473415)throw new Error(_0xb2a5('0x63'));if(_0x473415[_0xb2a5('0x50')]===_0xb2a5('0x62')){var _0x4e6aae=_0x2cd43f['get']({'plain':!![]});return db['UserProfileSection'][_0xb2a5('0x4b')]({'where':{'name':_0xb2a5('0x51'),'userProfileId':_0x473415[_0xb2a5('0x53')]},'raw':!![]})[_0xb2a5('0x18')](function(_0x593be4){if(_0x593be4&&_0x593be4[_0xb2a5('0x54')]===0x0){return db[_0xb2a5('0x2d')]['create']({'name':_0x4e6aae['name'],'resourceId':_0x4e6aae['id'],'type':_0x593be4['name'],'sectionId':_0x593be4['id']},{})['then'](function(){return _0x2cd43f;});}else{return _0x2cd43f;}})[_0xb2a5('0x20')](function(_0x778167){logger[_0xb2a5('0x1b')](_0xb2a5('0x55'),_0x778167);throw _0x778167;});}return _0x2cd43f;})[_0xb2a5('0x18')](respondWithResult(_0x288f27,0xc9))['catch'](handleError(_0x288f27,null));};exports[_0xb2a5('0x2b')]=function(_0x567e25,_0x204fd6,_0x104604){var _0x125e21;return db['Trunk'][_0xb2a5('0x4b')]({'where':{'id':_0x567e25[_0xb2a5('0x4a')]['id']}})[_0xb2a5('0x18')](handleEntityNotFound(_0x204fd6,null))[_0xb2a5('0x18')](saveUpdates(_0x567e25['body'],null))[_0xb2a5('0x18')](function(_0x2b6bac){if(_0x2b6bac){_0x125e21=_0x2b6bac;return db[_0xb2a5('0x46')]['findAll']({'raw':!![]});}})[_0xb2a5('0x18')](function(_0x15b6b9){if(_0x15b6b9){var _0x30eb2d=fs[_0xb2a5('0x59')](path['join'](config[_0xb2a5('0x64')],_0xb2a5('0x58')),_0xb2a5('0x5b'));var _0x34a7cf=fs[_0xb2a5('0x59')](path['join'](config[_0xb2a5('0x64')],_0xb2a5('0x5a')),_0xb2a5('0x5b'));var _0x253b75=ejs['render'](_0x30eb2d,{'trunks':_0x15b6b9||[]});fs['writeFileSync'](_0xb2a5('0x5e'),_0x253b75);var _0x577af9=ejs[_0xb2a5('0x5c')](_0x34a7cf,{'trunks':_0x15b6b9||[]});fs[_0xb2a5('0x5d')](_0xb2a5('0x65'),_0x577af9);return respondWithRpcPromise(_0xb2a5('0x60'),'update',{'module':_0xb2a5('0x61')});}return null;})[_0xb2a5('0x18')](function(_0x530446){if(_0x530446){return _0x125e21;}})[_0xb2a5('0x18')](respondWithResult(_0x204fd6,null))['catch'](handleError(_0x204fd6,null));};exports[_0xb2a5('0x2e')]=function(_0x4f1908,_0x3c07aa,_0x52d8d0){var _0x27dee4;return db['Trunk']['find']({'where':{'id':_0x4f1908[_0xb2a5('0x4a')]['id']}})[_0xb2a5('0x18')](handleEntityNotFound(_0x3c07aa,null))[_0xb2a5('0x18')](removeEntity(_0x3c07aa,null))[_0xb2a5('0x18')](function(){return db[_0xb2a5('0x46')][_0xb2a5('0x49')]({'raw':!![]});})[_0xb2a5('0x18')](function(_0x50e4f2){var _0xd78e6b=fs[_0xb2a5('0x59')](path[_0xb2a5('0x57')](config['root'],'server/files/templates/trunk.ejs'),'utf8');var _0x166b00=fs[_0xb2a5('0x59')](path[_0xb2a5('0x57')](config[_0xb2a5('0x64')],'server/files/templates/registry.ejs'),_0xb2a5('0x5b'));var _0x45eab1=ejs[_0xb2a5('0x5c')](_0xd78e6b,{'trunks':_0x50e4f2});var _0x4189f9=ejs[_0xb2a5('0x5c')](_0x166b00,{'trunks':_0x50e4f2});fs[_0xb2a5('0x5d')](_0xb2a5('0x5e'),_0x45eab1);fs[_0xb2a5('0x5d')](_0xb2a5('0x65'),_0x4189f9);return respondWithRpcPromise(_0xb2a5('0x60'),_0xb2a5('0x2e'),{'module':'chan_sip.so'});})[_0xb2a5('0x20')](handleError(_0x3c07aa,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 20a3e02..be9bbb0 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 _0x81bd=['../../config/environment','./trunk.attributes','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x55b535,_0x1bfcc4){var _0x30b444=function(_0x2fcf22){while(--_0x2fcf22){_0x55b535['push'](_0x55b535['shift']());}};_0x30b444(++_0x1bfcc4);}(_0x81bd,0x7c));var _0xd81b=function(_0x2b9af6,_0x475a9b){_0x2b9af6=_0x2b9af6-0x0;var _0x20ed39=_0x81bd[_0x2b9af6];return _0x20ed39;};'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')]('Trunk',attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb7a8=['request-promise','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','util','../../config/logger','moment','bluebird'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xb7a8,0xec));var _0x8b7a=function(_0x5cf097,_0x2113f4){_0x5cf097=_0x5cf097-0x0;var _0x13f630=_0xb7a8[_0x5cf097];return _0x13f630;};'use strict';var _=require('lodash');var util=require(_0x8b7a('0x0'));var logger=require(_0x8b7a('0x1'))('api');var moment=require(_0x8b7a('0x2'));var BPromise=require(_0x8b7a('0x3'));var rp=require(_0x8b7a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b7a('0x5'));var config=require(_0x8b7a('0x6'));var attributes=require(_0x8b7a('0x7'));module[_0x8b7a('0x8')]=function(_0x1d61f3,_0x42e4c1){return _0x1d61f3[_0x8b7a('0x9')](_0x8b7a('0xa'),attributes,{'tableName':_0x8b7a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index 4b97e57..ba21f23 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 _0x334a=['include','map','model','GetTrunk','ShowTrunk','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','Trunk','findAll','options','where','attributes','limit'];(function(_0x184e8d,_0xa0cfa6){var _0x191b45=function(_0x3b2134){while(--_0x3b2134){_0x184e8d['push'](_0x184e8d['shift']());}};_0x191b45(++_0xa0cfa6);}(_0x334a,0xe6));var _0xa334=function(_0x2a8b00,_0x25810d){_0x2a8b00=_0x2a8b00-0x0;var _0x571dc1=_0x334a[_0x2a8b00];return _0x571dc1;};'use strict';var _=require(_0xa334('0x0'));var util=require(_0xa334('0x1'));var moment=require('moment');var BPromise=require(_0xa334('0x2'));var rs=require(_0xa334('0x3'));var fs=require('fs');var Redis=require(_0xa334('0x4'));var db=require(_0xa334('0x5'))['db'];var utils=require(_0xa334('0x6'));var logger=require(_0xa334('0x7'))(_0xa334('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1d93b8,_0x28b5e6,_0x391f35){return new BPromise(function(_0x191f0e,_0x1aac6f){return client[_0xa334('0x9')](_0x1d93b8,_0x391f35)[_0xa334('0xa')](function(_0x47abb6){logger[_0xa334('0xb')](_0xa334('0xc'),_0x28b5e6,_0xa334('0xd'));logger['debug'](_0xa334('0xe'),_0x28b5e6,_0xa334('0xd'),JSON[_0xa334('0xf')](_0x47abb6));if(_0x47abb6[_0xa334('0x10')]){if(_0x47abb6['error']['code']===0x1f4){logger[_0xa334('0x10')]('Trunk,\x20%s,\x20%s',_0x28b5e6,_0x47abb6[_0xa334('0x10')][_0xa334('0x11')]);return _0x1aac6f(_0x47abb6[_0xa334('0x10')][_0xa334('0x11')]);}logger[_0xa334('0x10')]('Trunk,\x20%s,\x20%s',_0x28b5e6,_0x47abb6[_0xa334('0x10')][_0xa334('0x11')]);return _0x191f0e(_0x47abb6['error']['message']);}else{logger[_0xa334('0xb')](_0xa334('0xc'),_0x28b5e6,_0xa334('0xd'));_0x191f0e(_0x47abb6[_0xa334('0x12')][_0xa334('0x11')]);}})[_0xa334('0x13')](function(_0x576b9c){logger[_0xa334('0x10')]('Trunk,\x20%s,\x20%s',_0x28b5e6,_0x576b9c);_0x1aac6f(_0x576b9c);});});}exports['GetTrunk']=function(_0x1b0994){var _0x36690e=this;return new Promise(function(_0x10089c,_0xac26e5){return db[_0xa334('0x14')][_0xa334('0x15')]({'raw':_0x1b0994[_0xa334('0x16')]?_0x1b0994[_0xa334('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x1b0994['options']?_0x1b0994[_0xa334('0x16')][_0xa334('0x17')]||null:null,'attributes':_0x1b0994['options']?_0x1b0994[_0xa334('0x16')][_0xa334('0x18')]||null:null,'limit':_0x1b0994[_0xa334('0x16')]?_0x1b0994[_0xa334('0x16')][_0xa334('0x19')]||null:null,'include':_0x1b0994[_0xa334('0x16')]?_0x1b0994[_0xa334('0x16')][_0xa334('0x1a')]?_[_0xa334('0x1b')](_0x1b0994[_0xa334('0x16')][_0xa334('0x1a')],function(_0x17799a){return{'model':db[_0x17799a[_0xa334('0x1c')]],'as':_0x17799a['as'],'attributes':_0x17799a[_0xa334('0x18')],'include':_0x17799a[_0xa334('0x1a')]?_[_0xa334('0x1b')](_0x17799a[_0xa334('0x1a')],function(_0x4cf410){return{'model':db[_0x4cf410[_0xa334('0x1c')]],'as':_0x4cf410['as'],'attributes':_0x4cf410[_0xa334('0x18')],'include':_0x4cf410[_0xa334('0x1a')]?_[_0xa334('0x1b')](_0x4cf410[_0xa334('0x1a')],function(_0x185e35){return{'model':db[_0x185e35[_0xa334('0x1c')]],'as':_0x185e35['as'],'attributes':_0x185e35['attributes']};}):[]};}):[]};}):[]:[]})[_0xa334('0xa')](function(_0x2ac007){logger['info']('GetTrunk',_0x1b0994);logger['debug'](_0xa334('0x1d'),_0x1b0994,JSON[_0xa334('0xf')](_0x2ac007));_0x10089c(_0x2ac007);})['catch'](function(_0x436376){logger[_0xa334('0x10')](_0xa334('0x1d'),_0x436376['message'],_0x1b0994);_0xac26e5(_0x36690e[_0xa334('0x10')](0x1f4,_0x436376[_0xa334('0x11')]));});});};exports[_0xa334('0x1e')]=function(_0x1740a8){var _0x164939=this;return new Promise(function(_0x4d2bce,_0x266ffb){return db['Trunk'][_0xa334('0x1f')]({'raw':_0x1740a8[_0xa334('0x16')]?_0x1740a8['options']['raw']===undefined?!![]:![]:!![],'where':_0x1740a8[_0xa334('0x16')]?_0x1740a8[_0xa334('0x16')][_0xa334('0x17')]||null:null,'attributes':_0x1740a8[_0xa334('0x16')]?_0x1740a8['options'][_0xa334('0x18')]||null:null,'include':_0x1740a8['options']?_0x1740a8[_0xa334('0x16')][_0xa334('0x1a')]?_[_0xa334('0x1b')](_0x1740a8[_0xa334('0x16')]['include'],function(_0x6bdf37){return{'model':db[_0x6bdf37[_0xa334('0x1c')]],'as':_0x6bdf37['as'],'attributes':_0x6bdf37['attributes'],'include':_0x6bdf37[_0xa334('0x1a')]?_[_0xa334('0x1b')](_0x6bdf37[_0xa334('0x1a')],function(_0x555baa){return{'model':db[_0x555baa[_0xa334('0x1c')]],'as':_0x555baa['as'],'attributes':_0x555baa[_0xa334('0x18')],'include':_0x555baa[_0xa334('0x1a')]?_[_0xa334('0x1b')](_0x555baa['include'],function(_0x1bbd7a){return{'model':db[_0x1bbd7a[_0xa334('0x1c')]],'as':_0x1bbd7a['as'],'attributes':_0x1bbd7a[_0xa334('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x19a39b){logger[_0xa334('0xb')]('ShowTrunk',_0x1740a8);logger['debug'](_0xa334('0x1e'),_0x1740a8,JSON['stringify'](_0x19a39b));_0x4d2bce(_0x19a39b);})['catch'](function(_0x366fb){logger[_0xa334('0x10')]('ShowTrunk',_0x366fb[_0xa334('0x11')],_0x1740a8);_0x266ffb(_0x164939['error'](0x1f4,_0x366fb[_0xa334('0x11')]));});});}; \ No newline at end of file +var _0xca72=['request\x20sent','error','code','message','result','catch','GetTrunk','Trunk','findAll','options','raw','where','limit','include','map','model','attributes','debug','stringify','find','ShowTrunk','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s'];(function(_0x3d78b5,_0x4936ed){var _0x380d7b=function(_0x1b7bf8){while(--_0x1b7bf8){_0x3d78b5['push'](_0x3d78b5['shift']());}};_0x380d7b(++_0x4936ed);}(_0xca72,0x111));var _0x2ca7=function(_0x2cc8bb,_0x5f2607){_0x2cc8bb=_0x2cc8bb-0x0;var _0x140e40=_0xca72[_0x2cc8bb];return _0x140e40;};'use strict';var _=require('lodash');var util=require(_0x2ca7('0x0'));var moment=require(_0x2ca7('0x1'));var BPromise=require(_0x2ca7('0x2'));var rs=require(_0x2ca7('0x3'));var fs=require('fs');var Redis=require(_0x2ca7('0x4'));var db=require(_0x2ca7('0x5'))['db'];var utils=require(_0x2ca7('0x6'));var logger=require('../../config/logger')(_0x2ca7('0x7'));var config=require('../../config/environment');var jayson=require(_0x2ca7('0x8'));var client=jayson[_0x2ca7('0x9')][_0x2ca7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x247271,_0x3f6c06,_0x318938){return new BPromise(function(_0x1638ae,_0x5ca236){return client[_0x2ca7('0xb')](_0x247271,_0x318938)[_0x2ca7('0xc')](function(_0x2fc161){logger[_0x2ca7('0xd')](_0x2ca7('0xe'),_0x3f6c06,'request\x20sent');logger['debug']('Trunk,\x20%s,\x20%s,\x20%s',_0x3f6c06,_0x2ca7('0xf'),JSON['stringify'](_0x2fc161));if(_0x2fc161['error']){if(_0x2fc161[_0x2ca7('0x10')][_0x2ca7('0x11')]===0x1f4){logger[_0x2ca7('0x10')](_0x2ca7('0xe'),_0x3f6c06,_0x2fc161['error'][_0x2ca7('0x12')]);return _0x5ca236(_0x2fc161[_0x2ca7('0x10')][_0x2ca7('0x12')]);}logger['error'](_0x2ca7('0xe'),_0x3f6c06,_0x2fc161['error']['message']);return _0x1638ae(_0x2fc161[_0x2ca7('0x10')]['message']);}else{logger[_0x2ca7('0xd')](_0x2ca7('0xe'),_0x3f6c06,'request\x20sent');_0x1638ae(_0x2fc161[_0x2ca7('0x13')][_0x2ca7('0x12')]);}})[_0x2ca7('0x14')](function(_0xb0b22){logger['error'](_0x2ca7('0xe'),_0x3f6c06,_0xb0b22);_0x5ca236(_0xb0b22);});});}exports[_0x2ca7('0x15')]=function(_0x41811c){var _0x4e579e=this;return new Promise(function(_0x1e7d0e,_0x2516fc){return db[_0x2ca7('0x16')][_0x2ca7('0x17')]({'raw':_0x41811c[_0x2ca7('0x18')]?_0x41811c[_0x2ca7('0x18')][_0x2ca7('0x19')]===undefined?!![]:![]:!![],'where':_0x41811c[_0x2ca7('0x18')]?_0x41811c[_0x2ca7('0x18')][_0x2ca7('0x1a')]||null:null,'attributes':_0x41811c[_0x2ca7('0x18')]?_0x41811c['options']['attributes']||null:null,'limit':_0x41811c[_0x2ca7('0x18')]?_0x41811c['options'][_0x2ca7('0x1b')]||null:null,'include':_0x41811c[_0x2ca7('0x18')]?_0x41811c[_0x2ca7('0x18')][_0x2ca7('0x1c')]?_[_0x2ca7('0x1d')](_0x41811c[_0x2ca7('0x18')][_0x2ca7('0x1c')],function(_0x2f23ac){return{'model':db[_0x2f23ac[_0x2ca7('0x1e')]],'as':_0x2f23ac['as'],'attributes':_0x2f23ac[_0x2ca7('0x1f')],'include':_0x2f23ac[_0x2ca7('0x1c')]?_[_0x2ca7('0x1d')](_0x2f23ac['include'],function(_0x1de44e){return{'model':db[_0x1de44e[_0x2ca7('0x1e')]],'as':_0x1de44e['as'],'attributes':_0x1de44e[_0x2ca7('0x1f')],'include':_0x1de44e[_0x2ca7('0x1c')]?_[_0x2ca7('0x1d')](_0x1de44e[_0x2ca7('0x1c')],function(_0x399a59){return{'model':db[_0x399a59[_0x2ca7('0x1e')]],'as':_0x399a59['as'],'attributes':_0x399a59[_0x2ca7('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x2ca7('0xc')](function(_0x2368fd){logger[_0x2ca7('0xd')](_0x2ca7('0x15'),_0x41811c);logger[_0x2ca7('0x20')](_0x2ca7('0x15'),_0x41811c,JSON[_0x2ca7('0x21')](_0x2368fd));_0x1e7d0e(_0x2368fd);})[_0x2ca7('0x14')](function(_0x3ff0cb){logger[_0x2ca7('0x10')](_0x2ca7('0x15'),_0x3ff0cb['message'],_0x41811c);_0x2516fc(_0x4e579e[_0x2ca7('0x10')](0x1f4,_0x3ff0cb['message']));});});};exports['ShowTrunk']=function(_0x4a5948){var _0x10cd0e=this;return new Promise(function(_0x650012,_0x350b07){return db[_0x2ca7('0x16')][_0x2ca7('0x22')]({'raw':_0x4a5948['options']?_0x4a5948['options'][_0x2ca7('0x19')]===undefined?!![]:![]:!![],'where':_0x4a5948['options']?_0x4a5948['options'][_0x2ca7('0x1a')]||null:null,'attributes':_0x4a5948[_0x2ca7('0x18')]?_0x4a5948[_0x2ca7('0x18')][_0x2ca7('0x1f')]||null:null,'include':_0x4a5948[_0x2ca7('0x18')]?_0x4a5948[_0x2ca7('0x18')][_0x2ca7('0x1c')]?_[_0x2ca7('0x1d')](_0x4a5948[_0x2ca7('0x18')][_0x2ca7('0x1c')],function(_0x3c26c9){return{'model':db[_0x3c26c9[_0x2ca7('0x1e')]],'as':_0x3c26c9['as'],'attributes':_0x3c26c9[_0x2ca7('0x1f')],'include':_0x3c26c9[_0x2ca7('0x1c')]?_[_0x2ca7('0x1d')](_0x3c26c9['include'],function(_0x8adf03){return{'model':db[_0x8adf03[_0x2ca7('0x1e')]],'as':_0x8adf03['as'],'attributes':_0x8adf03[_0x2ca7('0x1f')],'include':_0x8adf03[_0x2ca7('0x1c')]?_[_0x2ca7('0x1d')](_0x8adf03[_0x2ca7('0x1c')],function(_0x415854){return{'model':db[_0x415854[_0x2ca7('0x1e')]],'as':_0x415854['as'],'attributes':_0x415854['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2946c3){logger[_0x2ca7('0xd')]('ShowTrunk',_0x4a5948);logger[_0x2ca7('0x20')](_0x2ca7('0x23'),_0x4a5948,JSON[_0x2ca7('0x21')](_0x2946c3));_0x650012(_0x2946c3);})[_0x2ca7('0x14')](function(_0xae6e22){logger[_0x2ca7('0x10')](_0x2ca7('0x23'),_0xae6e22[_0x2ca7('0x12')],_0x4a5948);_0x350b07(_0x10cd0e['error'](0x1f4,_0xae6e22[_0x2ca7('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 81eb6e2..c28d87b 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 _0xe706=['getSquareProjects','getApiKey','post','bulkCreate','create','/:id/queues','addQueues','diskStorage','join','server/files/images/','format','%s-%s','now','originalname','single','file','addAvatar','login','/:id/logout','logout','pause','/:id/unpause','unpause','/:id/teams','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addFaxAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addSquareProjects','/:id/api_key','createApiKey','put','update','/:id/password','removeQueues','removeTeams','delete','destroy','removeChatInteractions','removeFaxInteractions','removeSmsInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/avatar','getAvatar','/:id/contacts','getContacts','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','/:id/recordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','getTeams','getLists','getVoicePrefixes','/:id/fax_accounts','/:id/mail_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/square_projects'];(function(_0x528b92,_0x2a3971){var _0x171eba=function(_0x28e199){while(--_0x28e199){_0x528b92['push'](_0x528b92['shift']());}};_0x171eba(++_0x2a3971);}(_0xe706,0xa3));var _0x6e70=function(_0xeb996f,_0x5e1c36){_0xeb996f=_0xeb996f-0x0;var _0xe1d530=_0xe706[_0xeb996f];return _0xe1d530;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var auth=require(_0x6e70('0x5'));var interaction=require(_0x6e70('0x6'));var config=require(_0x6e70('0x7'));var controller=require(_0x6e70('0x8'));router[_0x6e70('0x9')]('/',auth[_0x6e70('0xa')](),controller[_0x6e70('0xb')]);router[_0x6e70('0x9')](_0x6e70('0xc'),auth[_0x6e70('0xa')](),controller[_0x6e70('0xd')]);router[_0x6e70('0x9')](_0x6e70('0xe'),auth[_0x6e70('0xa')](),controller[_0x6e70('0xf')]);router[_0x6e70('0x9')](_0x6e70('0x10'),controller[_0x6e70('0x11')]);router[_0x6e70('0x9')](_0x6e70('0x12'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x13')]);router['get']('/:id/queues',auth[_0x6e70('0xa')](),controller[_0x6e70('0x14')]);router[_0x6e70('0x9')](_0x6e70('0x15'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x16')]);router[_0x6e70('0x9')](_0x6e70('0x17'),auth['isAuthenticated'](),controller['getGroups']);router['get'](_0x6e70('0x18'),auth['isAuthenticated'](),controller['getRecordings']);router[_0x6e70('0x9')](_0x6e70('0x19'),auth['isAuthenticated'](),controller[_0x6e70('0x1a')]);router['get'](_0x6e70('0x1b'),auth[_0x6e70('0xa')](),controller['getChatInteractions']);router['get'](_0x6e70('0x1c'),auth['isAuthenticated'](),controller[_0x6e70('0x1d')]);router[_0x6e70('0x9')]('/:id/mail/interactions',auth['isAuthenticated'](),controller[_0x6e70('0x1e')]);router[_0x6e70('0x9')](_0x6e70('0x1f'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x20')]);router[_0x6e70('0x9')](_0x6e70('0x21'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x22')]);router[_0x6e70('0x9')]('/:id/teams',auth[_0x6e70('0xa')](),controller[_0x6e70('0x23')]);router[_0x6e70('0x9')]('/:id/lists',auth[_0x6e70('0xa')](),controller[_0x6e70('0x24')]);router[_0x6e70('0x9')]('/:id/agents',auth[_0x6e70('0xa')](),controller['getAgents']);router['get']('/:id/prefixes',auth[_0x6e70('0xa')](),controller[_0x6e70('0x25')]);router['get'](_0x6e70('0x26'),auth[_0x6e70('0xa')](),controller['getFaxAccounts']);router[_0x6e70('0x9')](_0x6e70('0x27'),auth[_0x6e70('0xa')](),controller['getMailAccounts']);router['get'](_0x6e70('0x28'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x29')]);router[_0x6e70('0x9')](_0x6e70('0x2a'),auth['isAuthenticated'](),controller[_0x6e70('0x2b')]);router[_0x6e70('0x9')](_0x6e70('0x2c'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x2d')]);router[_0x6e70('0x9')](_0x6e70('0x2e'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x2f')]);router[_0x6e70('0x9')]('/:id/scheduled_calls',auth[_0x6e70('0xa')](),controller['getScheduledCalls']);router[_0x6e70('0x9')]('/:id/api_key',auth[_0x6e70('0xa')](),controller[_0x6e70('0x30')]);router[_0x6e70('0x31')]('/create_many',auth[_0x6e70('0xa')](),controller[_0x6e70('0x32')]);router['post'](_0x6e70('0x12'),auth[_0x6e70('0xa')](),controller['addContacts']);router[_0x6e70('0x31')]('/',auth[_0x6e70('0xa')](),controller[_0x6e70('0x33')]);router[_0x6e70('0x31')](_0x6e70('0x34'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x35')]);var upload=multer({'storage':multer[_0x6e70('0x36')]({'destination':function(_0xf146fd,_0x419a41,_0x4d32d8){_0x4d32d8(null,path[_0x6e70('0x37')](config['root'],_0x6e70('0x38')));},'filename':function(_0x3222a2,_0x98c683,_0x32d12d){_0x32d12d(null,util[_0x6e70('0x39')](_0x6e70('0x3a'),Date[_0x6e70('0x3b')](),_0x98c683[_0x6e70('0x3c')]));}})});router[_0x6e70('0x31')](_0x6e70('0x10'),upload[_0x6e70('0x3d')](_0x6e70('0x3e')),controller[_0x6e70('0x3f')]);router['post']('/:id/login',auth['isAuthenticated'](),controller[_0x6e70('0x40')]);router[_0x6e70('0x31')](_0x6e70('0x41'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x42')]);router[_0x6e70('0x31')]('/:id/pause',auth[_0x6e70('0xa')](),controller[_0x6e70('0x43')]);router[_0x6e70('0x31')](_0x6e70('0x44'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x45')]);router[_0x6e70('0x31')](_0x6e70('0x46'),auth['isAuthenticated'](),controller[_0x6e70('0x47')]);router[_0x6e70('0x31')](_0x6e70('0x48'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x49')]);router[_0x6e70('0x31')](_0x6e70('0x4a'),auth['isAuthenticated'](),controller['addMailInteractions']);router['post'](_0x6e70('0x4b'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x4c')]);router[_0x6e70('0x31')](_0x6e70('0x4d'),auth['isAuthenticated'](),controller[_0x6e70('0x4e')]);router[_0x6e70('0x31')](_0x6e70('0x4f'),auth['isAuthenticated'](),controller['addOpenchannelInteractions']);router['post'](_0x6e70('0x26'),auth['isAuthenticated'](),controller[_0x6e70('0x50')]);router[_0x6e70('0x31')](_0x6e70('0x27'),auth[_0x6e70('0xa')](),controller['addMailAccounts']);router[_0x6e70('0x31')]('/:id/openchannel_accounts',auth[_0x6e70('0xa')](),controller[_0x6e70('0x51')]);router[_0x6e70('0x31')](_0x6e70('0x2a'),auth['isAuthenticated'](),controller[_0x6e70('0x52')]);router[_0x6e70('0x31')](_0x6e70('0x2c'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x53')]);router[_0x6e70('0x31')](_0x6e70('0x2e'),auth['isAuthenticated'](),controller[_0x6e70('0x54')]);router[_0x6e70('0x31')](_0x6e70('0x55'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x56')]);router[_0x6e70('0x57')](_0x6e70('0xe'),auth['isAuthenticated'](),controller[_0x6e70('0x58')]);router['put'](_0x6e70('0x59'),auth[_0x6e70('0xa')](),controller['changePassword']);router['delete'](_0x6e70('0x34'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x5a')]);router['delete']('/:id/teams',auth[_0x6e70('0xa')](),controller[_0x6e70('0x5b')]);router[_0x6e70('0x5c')](_0x6e70('0xe'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x5d')]);router['delete'](_0x6e70('0x48'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x5e')]);router[_0x6e70('0x5c')](_0x6e70('0x4a'),auth['isAuthenticated'](),controller['removeMailInteractions']);router[_0x6e70('0x5c')](_0x6e70('0x4b'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x5f')]);router[_0x6e70('0x5c')]('/:id/sms_interactions',auth[_0x6e70('0xa')](),controller[_0x6e70('0x60')]);router[_0x6e70('0x5c')](_0x6e70('0x4f'),auth[_0x6e70('0xa')](),controller['removeOpenchannelInteractions']);router[_0x6e70('0x5c')](_0x6e70('0x26'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x61')]);router[_0x6e70('0x5c')](_0x6e70('0x27'),auth['isAuthenticated'](),controller[_0x6e70('0x62')]);router[_0x6e70('0x5c')]('/:id/openchannel_accounts',auth[_0x6e70('0xa')](),controller[_0x6e70('0x63')]);router['delete'](_0x6e70('0x2a'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x64')]);router[_0x6e70('0x5c')](_0x6e70('0x2c'),auth['isAuthenticated'](),controller[_0x6e70('0x65')]);router[_0x6e70('0x5c')](_0x6e70('0x2e'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x66')]);router[_0x6e70('0x5c')](_0x6e70('0x55'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x67')]);module[_0x6e70('0x68')]=router; \ No newline at end of file +var _0xdafe=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','describe','show','/:id/avatar','getContacts','/:id/queues','getQueues','/:id/queues_rt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/teams','getTeams','getLists','/:id/agents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/: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','/:id/contacts','addContacts','create','addQueues','diskStorage','join','server/files/images/','format','%s-%s','originalname','single','file','/:id/login','login','/:id/logout','/:id/pause','pause','/:id/unpause','unpause','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addFaxAccounts','/:id/mail_accounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addSquareProjects','createApiKey','put','/:id','update','/:id/password','changePassword','delete','removeQueues','destroy','removeMailInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','exports','multer','util'];(function(_0x29df9a,_0x42aff3){var _0x3a8e96=function(_0x70fbe7){while(--_0x70fbe7){_0x29df9a['push'](_0x29df9a['shift']());}};_0x3a8e96(++_0x42aff3);}(_0xdafe,0x6a));var _0xedaf=function(_0x2f3f20,_0x5d70e3){_0x2f3f20=_0x2f3f20-0x0;var _0x35dc9b=_0xdafe[_0x2f3f20];return _0x35dc9b;};'use strict';var multer=require(_0xedaf('0x0'));var util=require(_0xedaf('0x1'));var path=require(_0xedaf('0x2'));var timeout=require(_0xedaf('0x3'));var express=require(_0xedaf('0x4'));var router=express[_0xedaf('0x5')]();var auth=require(_0xedaf('0x6'));var interaction=require(_0xedaf('0x7'));var config=require(_0xedaf('0x8'));var controller=require(_0xedaf('0x9'));router[_0xedaf('0xa')]('/',auth[_0xedaf('0xb')](),controller['index']);router[_0xedaf('0xa')]('/describe',auth[_0xedaf('0xb')](),controller[_0xedaf('0xc')]);router['get']('/:id',auth[_0xedaf('0xb')](),controller[_0xedaf('0xd')]);router[_0xedaf('0xa')](_0xedaf('0xe'),controller['getAvatar']);router['get']('/:id/contacts',auth['isAuthenticated'](),controller[_0xedaf('0xf')]);router[_0xedaf('0xa')](_0xedaf('0x10'),auth['isAuthenticated'](),controller[_0xedaf('0x11')]);router[_0xedaf('0xa')](_0xedaf('0x12'),auth[_0xedaf('0xb')](),controller['getVoiceQueuesRt']);router[_0xedaf('0xa')](_0xedaf('0x13'),auth['isAuthenticated'](),controller[_0xedaf('0x14')]);router[_0xedaf('0xa')](_0xedaf('0x15'),auth[_0xedaf('0xb')](),controller[_0xedaf('0x16')]);router[_0xedaf('0xa')](_0xedaf('0x17'),auth[_0xedaf('0xb')](),controller['getScreenRecordings']);router[_0xedaf('0xa')](_0xedaf('0x18'),auth['isAuthenticated'](),controller[_0xedaf('0x19')]);router[_0xedaf('0xa')]('/:id/openchannel/interactions',auth[_0xedaf('0xb')](),controller[_0xedaf('0x1a')]);router[_0xedaf('0xa')](_0xedaf('0x1b'),auth[_0xedaf('0xb')](),controller['getMailInteractions']);router[_0xedaf('0xa')](_0xedaf('0x1c'),auth[_0xedaf('0xb')](),controller[_0xedaf('0x1d')]);router[_0xedaf('0xa')](_0xedaf('0x1e'),auth['isAuthenticated'](),controller[_0xedaf('0x1f')]);router['get'](_0xedaf('0x20'),auth['isAuthenticated'](),controller[_0xedaf('0x21')]);router['get']('/:id/lists',auth[_0xedaf('0xb')](),controller[_0xedaf('0x22')]);router[_0xedaf('0xa')](_0xedaf('0x23'),auth['isAuthenticated'](),controller['getAgents']);router['get'](_0xedaf('0x24'),auth[_0xedaf('0xb')](),controller[_0xedaf('0x25')]);router[_0xedaf('0xa')](_0xedaf('0x26'),auth['isAuthenticated'](),controller[_0xedaf('0x27')]);router[_0xedaf('0xa')]('/:id/mail_accounts',auth[_0xedaf('0xb')](),controller['getMailAccounts']);router[_0xedaf('0xa')](_0xedaf('0x28'),auth[_0xedaf('0xb')](),controller[_0xedaf('0x29')]);router[_0xedaf('0xa')](_0xedaf('0x2a'),auth[_0xedaf('0xb')](),controller[_0xedaf('0x2b')]);router[_0xedaf('0xa')](_0xedaf('0x2c'),auth['isAuthenticated'](),controller[_0xedaf('0x2d')]);router[_0xedaf('0xa')](_0xedaf('0x2e'),auth[_0xedaf('0xb')](),controller[_0xedaf('0x2f')]);router[_0xedaf('0xa')](_0xedaf('0x30'),auth[_0xedaf('0xb')](),controller[_0xedaf('0x31')]);router[_0xedaf('0xa')](_0xedaf('0x32'),auth[_0xedaf('0xb')](),controller['getApiKey']);router[_0xedaf('0x33')](_0xedaf('0x34'),auth[_0xedaf('0xb')](),controller['bulkCreate']);router[_0xedaf('0x33')](_0xedaf('0x35'),auth['isAuthenticated'](),controller[_0xedaf('0x36')]);router['post']('/',auth[_0xedaf('0xb')](),controller[_0xedaf('0x37')]);router['post']('/:id/queues',auth[_0xedaf('0xb')](),controller[_0xedaf('0x38')]);var upload=multer({'storage':multer[_0xedaf('0x39')]({'destination':function(_0xac3684,_0x425b2e,_0xe08029){_0xe08029(null,path[_0xedaf('0x3a')](config['root'],_0xedaf('0x3b')));},'filename':function(_0x3c41a7,_0x45e7dd,_0x7e9a69){_0x7e9a69(null,util[_0xedaf('0x3c')](_0xedaf('0x3d'),Date['now'](),_0x45e7dd[_0xedaf('0x3e')]));}})});router[_0xedaf('0x33')](_0xedaf('0xe'),upload[_0xedaf('0x3f')](_0xedaf('0x40')),controller['addAvatar']);router[_0xedaf('0x33')](_0xedaf('0x41'),auth['isAuthenticated'](),controller[_0xedaf('0x42')]);router[_0xedaf('0x33')](_0xedaf('0x43'),auth[_0xedaf('0xb')](),controller['logout']);router[_0xedaf('0x33')](_0xedaf('0x44'),auth[_0xedaf('0xb')](),controller[_0xedaf('0x45')]);router[_0xedaf('0x33')](_0xedaf('0x46'),auth[_0xedaf('0xb')](),controller[_0xedaf('0x47')]);router[_0xedaf('0x33')](_0xedaf('0x20'),auth['isAuthenticated'](),controller['addTeams']);router[_0xedaf('0x33')](_0xedaf('0x48'),auth[_0xedaf('0xb')](),controller[_0xedaf('0x49')]);router[_0xedaf('0x33')](_0xedaf('0x4a'),auth[_0xedaf('0xb')](),controller[_0xedaf('0x4b')]);router[_0xedaf('0x33')](_0xedaf('0x4c'),auth[_0xedaf('0xb')](),controller[_0xedaf('0x4d')]);router[_0xedaf('0x33')]('/:id/sms_interactions',auth[_0xedaf('0xb')](),controller[_0xedaf('0x4e')]);router[_0xedaf('0x33')](_0xedaf('0x4f'),auth[_0xedaf('0xb')](),controller[_0xedaf('0x50')]);router[_0xedaf('0x33')](_0xedaf('0x26'),auth['isAuthenticated'](),controller[_0xedaf('0x51')]);router[_0xedaf('0x33')](_0xedaf('0x52'),auth['isAuthenticated'](),controller[_0xedaf('0x53')]);router['post']('/:id/openchannel_accounts',auth[_0xedaf('0xb')](),controller[_0xedaf('0x54')]);router[_0xedaf('0x33')](_0xedaf('0x2a'),auth[_0xedaf('0xb')](),controller[_0xedaf('0x55')]);router['post'](_0xedaf('0x2c'),auth[_0xedaf('0xb')](),controller[_0xedaf('0x56')]);router[_0xedaf('0x33')](_0xedaf('0x2e'),auth[_0xedaf('0xb')](),controller[_0xedaf('0x57')]);router[_0xedaf('0x33')](_0xedaf('0x32'),auth[_0xedaf('0xb')](),controller[_0xedaf('0x58')]);router[_0xedaf('0x59')](_0xedaf('0x5a'),auth[_0xedaf('0xb')](),controller[_0xedaf('0x5b')]);router[_0xedaf('0x59')](_0xedaf('0x5c'),auth[_0xedaf('0xb')](),controller[_0xedaf('0x5d')]);router[_0xedaf('0x5e')]('/:id/queues',auth[_0xedaf('0xb')](),controller[_0xedaf('0x5f')]);router[_0xedaf('0x5e')](_0xedaf('0x20'),auth[_0xedaf('0xb')](),controller['removeTeams']);router[_0xedaf('0x5e')](_0xedaf('0x5a'),auth[_0xedaf('0xb')](),controller[_0xedaf('0x60')]);router[_0xedaf('0x5e')]('/:id/chat_interactions',auth[_0xedaf('0xb')](),controller['removeChatInteractions']);router['delete'](_0xedaf('0x4a'),auth['isAuthenticated'](),controller[_0xedaf('0x61')]);router[_0xedaf('0x5e')](_0xedaf('0x4c'),auth[_0xedaf('0xb')](),controller['removeFaxInteractions']);router[_0xedaf('0x5e')]('/:id/sms_interactions',auth[_0xedaf('0xb')](),controller[_0xedaf('0x62')]);router[_0xedaf('0x5e')](_0xedaf('0x4f'),auth[_0xedaf('0xb')](),controller[_0xedaf('0x63')]);router[_0xedaf('0x5e')](_0xedaf('0x26'),auth['isAuthenticated'](),controller[_0xedaf('0x64')]);router[_0xedaf('0x5e')]('/:id/mail_accounts',auth[_0xedaf('0xb')](),controller[_0xedaf('0x65')]);router[_0xedaf('0x5e')](_0xedaf('0x28'),auth[_0xedaf('0xb')](),controller[_0xedaf('0x66')]);router[_0xedaf('0x5e')](_0xedaf('0x2a'),auth['isAuthenticated'](),controller[_0xedaf('0x67')]);router[_0xedaf('0x5e')]('/:id/chat_websites',auth[_0xedaf('0xb')](),controller[_0xedaf('0x68')]);router[_0xedaf('0x5e')](_0xedaf('0x2e'),auth['isAuthenticated'](),controller[_0xedaf('0x69')]);router[_0xedaf('0x5e')](_0xedaf('0x32'),auth[_0xedaf('0xb')](),controller[_0xedaf('0x6a')]);module[_0xedaf('0x6b')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 2122b7a..5737d8b 100644 --- a/server/api/user/user.attributes.js +++ b/server/api/user/user.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','passive','update,nonat','showWebBar','get','wss','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','encryption','icesupport','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','sequelize','moment','util','STRING','setDataValue','name','defaultuser','callerid','getDataValue','internal','email','admin','user','agent','telephone','INTEGER','format','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','ENUM','peer','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','join','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never'];(function(_0x47ea4a,_0x275731){var _0x430016=function(_0x46f10b){while(--_0x46f10b){_0x47ea4a['push'](_0x47ea4a['shift']());}};_0x430016(++_0x275731);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x333808){this[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x333808);this[_0x0a9e('0x4')](_0x0a9e('0x6'),_0x333808);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'set':function(_0x441e3a){this[_0x0a9e('0x4')]('fullname',_0x441e3a);this['setDataValue'](_0x0a9e('0x7'),util['format']('\x22%s\x22\x20<%s>',_0x441e3a,this[_0x0a9e('0x8')](_0x0a9e('0x9'))));}},'alias':{'type':Sequelize[_0x0a9e('0x3')]},'email':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':_0x0a9e('0xa'),'validate':{'isEmail':!![]},'set':function(_0xbd1168){if(_0xbd1168){this['setDataValue']('email',_0xbd1168['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe')),'allowNull':![]},'password':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':![],'unique':_0x0a9e('0x9'),'set':function(_0x2b4227){this[_0x0a9e('0x4')](_0x0a9e('0x9'),_0x2b4227);this[_0x0a9e('0x4')]('accountcode',_0x2b4227);this[_0x0a9e('0x4')]('callerid',util[_0x0a9e('0x10')]('\x22%s\x22\x20<%s>',this[_0x0a9e('0x8')](_0x0a9e('0x11')),_0x2b4227));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0a9e('0x3')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x0a9e('0x3')]},'zipcode':{'type':Sequelize[_0x0a9e('0x3')]},'userpic':{'type':Sequelize[_0x0a9e('0x3')]},'city':{'type':Sequelize[_0x0a9e('0x3')]},'country':{'type':Sequelize[_0x0a9e('0x3')]},'online':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0a9e('0x13')]},'voicePause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':_0x0a9e('0x14')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x0a9e('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'description':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x0a9e('0xf')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x0a9e('0x15')]('friend',_0x0a9e('0xc'),_0x0a9e('0x16')),'allowNull':!![],'defaultValue':_0x0a9e('0x17')},'context':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x18')},'callingpres':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x19'),_0x0a9e('0x1a'),'ALLOWED_FAILED_SCREEN',_0x0a9e('0x1b'),_0x0a9e('0x1c'),_0x0a9e('0x1d'),_0x0a9e('0x1e'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x1f'),'set':function(_0x2e8759){this[_0x0a9e('0x4')]('transport',_0x2e8759?_0x2e8759[_0x0a9e('0x20')](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x21'))?this[_0x0a9e('0x8')](_0x0a9e('0x21'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x23')},'dtmfmode':{'type':Sequelize['ENUM'](_0x0a9e('0x24'),_0x0a9e('0x25'),_0x0a9e('0x26'),_0x0a9e('0x27'),_0x0a9e('0x28')),'allowNull':!![],'defaultValue':_0x0a9e('0x24')},'directmedia':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x0a9e('0x2b'),'set':function(_0xd1836d){this[_0x0a9e('0x4')](_0x0a9e('0x2c'),_0xd1836d?_0xd1836d['join'](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x2c'))?this['getDataValue'](_0x0a9e('0x2c'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x2d')},'callgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'language':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':_0x0a9e('0x2e')},'allow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x546ef8){this[_0x0a9e('0x4')](_0x0a9e('0x2f'),_0x546ef8?_0x546ef8['join'](';'):_0x0a9e('0x30'));},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x2f'))?this[_0x0a9e('0x8')]('allow')['split'](';'):null;},'comment':_0x0a9e('0x31')},'autoframing':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'set':function(_0x1dec2e){this[_0x0a9e('0x4')]('insecure',_0x1dec2e?_0x1dec2e[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x32'))?this[_0x0a9e('0x8')](_0x0a9e('0x32'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x33')},'trustrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no',_0x0a9e('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x35')},'amaflags':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'busylevel':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0a9e('0x15')]('yes','no',_0x0a9e('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x0a9e('0x37'),_0x0a9e('0x38'),_0x0a9e('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x3a'),'uas'),'allowNull':!![],'defaultValue':_0x0a9e('0x3b')},'t38pt_usertpsource':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'keepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no',_0x0a9e('0x3c'),_0x0a9e('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0a9e('0x15')]('active',_0x0a9e('0x3e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),_0x0a9e('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0a9e('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x0a9e('0x13')]},'showWebBar':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0,'set':function(_0x5d86e9){this[_0x0a9e('0x4')](_0x0a9e('0x40'),_0x5d86e9);var _0x5239ef=this[_0x0a9e('0x41')]({'plain':!![]});switch(_0x5d86e9){case 0x0:case 0x1:var _0x5cc8fb=_0x5239ef[_0x0a9e('0x21')]?_['isArray'](_0x5239ef['transport'])?_0x5239ef['transport'][_0x0a9e('0x20')]():_0x5239ef['transport']:_0x0a9e('0x1f');if(_0x5cc8fb===_0x0a9e('0x42')){_0x5cc8fb=_0x0a9e('0x1f');}this[_0x0a9e('0x4')](_0x0a9e('0x21'),_0x5cc8fb);this[_0x0a9e('0x4')]('encryption','no');this[_0x0a9e('0x4')]('avpf',null);this[_0x0a9e('0x4')](_0x0a9e('0x43'),null);this[_0x0a9e('0x4')]('icesupport',null);this[_0x0a9e('0x4')](_0x0a9e('0x44'),null);this[_0x0a9e('0x4')](_0x0a9e('0x45'),null);this['setDataValue'](_0x0a9e('0x46'),null);this[_0x0a9e('0x4')]('dtlscertfile',null);this[_0x0a9e('0x4')](_0x0a9e('0x47'),null);this[_0x0a9e('0x4')](_0x0a9e('0x48'),'no');break;case 0x2:this[_0x0a9e('0x4')]('transport',_0x0a9e('0x42'));this[_0x0a9e('0x4')](_0x0a9e('0x49'),'yes');this[_0x0a9e('0x4')]('avpf','yes');this[_0x0a9e('0x4')](_0x0a9e('0x43'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x4a'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x44'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x45'),'no');this[_0x0a9e('0x4')](_0x0a9e('0x46'),_0x0a9e('0x4b'));this[_0x0a9e('0x4')](_0x0a9e('0x4c'),_0x5239ef[_0x0a9e('0x4c')]||_0x0a9e('0x4d'));this['setDataValue'](_0x0a9e('0x47'),_0x5239ef[_0x0a9e('0x47')]||_0x0a9e('0x4e'));this['setDataValue'](_0x0a9e('0x48'),_0x0a9e('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x83f0b2){this[_0x0a9e('0x4')](_0x0a9e('0x4f'),_0x83f0b2?_0x83f0b2[_0x0a9e('0x20')](','):[]);},'get':function(){return this[_0x0a9e('0x8')]('permissions')?_['map'](this['getDataValue'](_0x0a9e('0x4f'))[_0x0a9e('0x22')](','),function(_0x1104ad){return parseInt(_0x1104ad,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x0a9e('0x3')]},'passwordResetAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x50'))?this[_0x0a9e('0x8')](_0x0a9e('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'interface':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x30a4c7){if(typeof _0x30a4c7===_0x0a9e('0x51')){var _0x332367=_0x30a4c7==='1'?!![]:_0x30a4c7==='0'?![]:_0x30a4c7===_0x0a9e('0x52')?!![]:_0x30a4c7===_0x0a9e('0x53')?![]:![];this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x332367);}else{this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x30a4c7);}}},'blocked':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x25744a){this[_0x0a9e('0x4')]('blocked',_0x25744a);if(_0x25744a===!![]){this[_0x0a9e('0x4')](_0x0a9e('0x55'),moment());this[_0x0a9e('0x4')]('loginAttempts',0x0);}else{this[_0x0a9e('0x4')](_0x0a9e('0x55'),null);}}},'blockedAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xa9e0=['\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','passive','update,nonat','showWebBar','get','wss','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','encryption','icesupport','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','sequelize','moment','util','STRING','setDataValue','name','defaultuser','callerid','getDataValue','internal','email','admin','user','agent','telephone','INTEGER','format','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','ENUM','peer','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','join','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never'];(function(_0x18a08e,_0x1f3799){var _0x5e5a4c=function(_0x74c28){while(--_0x74c28){_0x18a08e['push'](_0x18a08e['shift']());}};_0x5e5a4c(++_0x1f3799);}(_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 afabc8f..a31c2c9 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 _0xbe12=['ids','agent\x20role','admin','../../config/license/util','telephones','users','isNil','format','internal','Setting','findById','securePassword','min_internal','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','SELECT','from','mailbox','VoiceMail','fullname','email','permissions','101','102','110','104','106','108','109','111','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','changePassword','oldPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20one','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword','authenticate','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','newPassword','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','findOne','addQueues','channel','online','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','spread','QueueId','emit','Queue:save','VoiceQueue','voice','SIP/%s','penalty','each','UserVoiceQueueRt','upsert','removeQueues','Queues','Queue:remove','addAvatar','userpic','file','filename','getAvatar','join','server/files/images/logos/default_profile.png','download','existsSync','root','server/files/images/','getContacts','CmContact','CmList','Tags','tag','map','Queue','Unknown\x20role','getVoiceQueuesRt','order','getGroups','ChatGroup','getRecordings','UserId','VoiceRecording','getScreenRecordings','ScreenRecording','ChatInteraction','getChatInteractions','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','x-forwarded-for','connection','remoteAddress','socket','getVoiceQueues','push','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','device','PAUSE','LOGININPAUSE','concat','isMiddleware','resolve','all','QueuePause','updateAttributes','DEFAULT\x20PAUSE','mailPause','chatPause','openchannelPause','smsPause','manual','mail','chat','fax','sms','%s%s','Pause','unpause','getTeams','Team','addTeams','omit','removeTeams','getLists','getAgents','values','send','addChatInteractions','user_has_chat_interactions:save','isArray','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','SquareProject','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls','$and','$gt','$gte','$lt','$lte','$ne','$eq','$not','$notBetween','$in','$notIn','$like','$iLike','$notILike','$overlap','$contains','$contained','$any','CmHopper','firstName','Contact','dialActive','getApiKey','retrieveApiKey','You\x20don\x27t\x20have\x20sufficient\x20privelages\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','apiKeyNonce','apiKeyIat','removeApiKey','API\x20key\x20not\x20available','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./user.socket','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','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','User,\x20%s,\x20%s','message','request\x20sent','result','catch','sendStatus','status','count','offset','limit','set','json','apply','reject','save','update','destroy','Users','user','Agents','agent','Telephones','telephone','filter','ignore','value','includes','role','name','UserProfileResource','end','stack','rawAttributes','differenceBy','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','key','VIRTUAL','sequelize','col','field','lower','options','User','includeAll','include','findAll','rows','show','password','salt','find','bulkCreate','body','params','describe','addContacts'];(function(_0x22b39b,_0x2b7d63){var _0x280e1d=function(_0xc74635){while(--_0xc74635){_0x22b39b['push'](_0x22b39b['shift']());}};_0x280e1d(++_0x2b7d63);}(_0xbe12,0xea));var _0x2be1=function(_0x495207,_0x25afce){_0x495207=_0x495207-0x0;var _0x707b63=_0xbe12[_0x495207];return _0x707b63;};'use strict';var pdf=require(_0x2be1('0x0'));var emlformat=require(_0x2be1('0x1'));var rimraf=require(_0x2be1('0x2'));var zipdir=require(_0x2be1('0x3'));var jsonpatch=require(_0x2be1('0x4'));var rp=require(_0x2be1('0x5'));var moment=require(_0x2be1('0x6'));var BPromise=require(_0x2be1('0x7'));var Mustache=require(_0x2be1('0x8'));var util=require(_0x2be1('0x9'));var path=require(_0x2be1('0xa'));var sox=require(_0x2be1('0xb'));var csv=require('to-csv');var ejs=require(_0x2be1('0xc'));var fs=require('fs');var _=require(_0x2be1('0xd'));var squel=require('squel');var crypto=require(_0x2be1('0xe'));var jsforce=require(_0x2be1('0xf'));var deskjs=require(_0x2be1('0x10'));var toCsv=require(_0x2be1('0x11'));var querystring=require(_0x2be1('0x12'));var Papa=require(_0x2be1('0x13'));var Redis=require(_0x2be1('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x2be1('0x15'));var hardwareService=require(_0x2be1('0x16'));var logger=require(_0x2be1('0x17'))(_0x2be1('0x18'));var utils=require(_0x2be1('0x19'));var config=require('../../config/environment');var db=require(_0x2be1('0x1a'))['db'];config[_0x2be1('0x1b')]=_[_0x2be1('0x1c')](config[_0x2be1('0x1b')],{'host':_0x2be1('0x1d'),'port':0x18eb});var socket=require(_0x2be1('0x1e'))(new Redis(config['redis']));require(_0x2be1('0x1f'))['register'](socket);var jayson=require(_0x2be1('0x20'));var client=jayson[_0x2be1('0x21')]['http']({'port':0x232a});function checkPasswordPattern(_0x9d3b9,_0x21be96,_0x4dad4f){if(_0x4dad4f){var _0x42a0ad=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x42a0ad[_0x2be1('0x22')](_0x21be96)){return _0x9d3b9;}else{throw new Error(_0x2be1('0x23'));}}else{return _0x9d3b9;}}function respondWithRpcPromise(_0x31cb4d,_0x441041,_0x3628bf,_0x4b8f07){return new BPromise(function(_0x1dbfc0,_0x2f2251){var _0x91def4=_0x4b8f07||client;return _0x91def4[_0x2be1('0x24')](_0x31cb4d,_0x3628bf)[_0x2be1('0x25')](function(_0x4f5d10){logger[_0x2be1('0x26')]('User,\x20%s,\x20%s',_0x441041,'request\x20sent');logger[_0x2be1('0x27')](_0x2be1('0x28'),_0x441041,'request\x20sent',JSON[_0x2be1('0x29')](_0x4f5d10));if(_0x4f5d10[_0x2be1('0x2a')]){if(_0x4f5d10[_0x2be1('0x2a')][_0x2be1('0x2b')]===0x1f4){logger[_0x2be1('0x2a')](_0x2be1('0x2c'),_0x441041,_0x4f5d10['error'][_0x2be1('0x2d')]);return _0x2f2251(_0x4f5d10[_0x2be1('0x2a')][_0x2be1('0x2d')]);}logger['error']('User,\x20%s,\x20%s',_0x441041,_0x4f5d10[_0x2be1('0x2a')]['message']);return _0x1dbfc0(_0x4f5d10[_0x2be1('0x2a')][_0x2be1('0x2d')]);}else{logger[_0x2be1('0x26')](_0x2be1('0x2c'),_0x441041,_0x2be1('0x2e'));_0x1dbfc0(_0x4f5d10[_0x2be1('0x2f')]['message']);}})[_0x2be1('0x30')](function(_0x441589){logger[_0x2be1('0x2a')]('User,\x20%s,\x20%s',_0x441041,_0x441589);_0x2f2251(_0x441589);});});}function respondWithStatusCode(_0x53ee55,_0x1a10c5){_0x1a10c5=_0x1a10c5||0xcc;return function(_0x45d8db){if(_0x45d8db){return _0x53ee55[_0x2be1('0x31')](_0x1a10c5);}return _0x53ee55[_0x2be1('0x32')](_0x1a10c5)['end']();};}function respondWithResult(_0x528957,_0x52acb6){_0x52acb6=_0x52acb6||0xc8;return function(_0x22c49e){if(_0x22c49e){return _0x528957[_0x2be1('0x32')](_0x52acb6)['json'](_0x22c49e);}};}function respondWithFilteredResult(_0x50983b,_0x3c1854){return function(_0x327846){if(_0x327846){var _0x34a775=_0x327846[_0x2be1('0x33')],_0x4a1c54=_0x3c1854[_0x2be1('0x34')],_0x4aef31=_0x3c1854[_0x2be1('0x34')]+_0x3c1854[_0x2be1('0x35')],_0x56ecbe;if(_0x4aef31>=_0x34a775){_0x4aef31=_0x34a775;_0x56ecbe=0xc8;}else{_0x56ecbe=0xce;}_0x50983b[_0x2be1('0x32')](_0x56ecbe);return _0x50983b[_0x2be1('0x36')]('Content-Range',_0x4a1c54+'-'+_0x4aef31+'/'+_0x34a775)[_0x2be1('0x37')](_0x327846);}return null;};}function patchUpdates(_0x31193e){return function(_0x28e391){try{jsonpatch[_0x2be1('0x38')](_0x28e391,_0x31193e,!![]);}catch(_0x3cd28e){return BPromise[_0x2be1('0x39')](_0x3cd28e);}return _0x28e391[_0x2be1('0x3a')]();};}function saveUpdates(_0xb1573b,_0x4f2c8f){return function(_0x5f2131){if(_0x5f2131){return _0x5f2131[_0x2be1('0x3b')](_0xb1573b)[_0x2be1('0x25')](function(_0xb9d10f){return _0xb9d10f;});}return null;};}function removeEntity(_0x611287,_0x4d0110){return function(_0x26e3c0){if(_0x26e3c0){return _0x26e3c0[_0x2be1('0x3c')]()[_0x2be1('0x25')](function(){var _0x400601=_0x26e3c0['get']({'plain':!![]});var _0x5015e3=[{'name':_0x2be1('0x3d'),'value':_0x2be1('0x3e'),'ignore':!![]},{'name':_0x2be1('0x3f'),'value':_0x2be1('0x40'),'ignore':![]},{'name':_0x2be1('0x41'),'value':_0x2be1('0x42'),'ignore':![]}];var _0x366bd2=_(_0x5015e3)[_0x2be1('0x43')](_0x2be1('0x44'))['map'](_0x2be1('0x45'))['value']();if(_[_0x2be1('0x46')](_0x366bd2,_0x400601[_0x2be1('0x47')])){return;}var _0x5ec4c6=_['find'](_0x5015e3,[_0x2be1('0x45'),_0x400601['role']])[_0x2be1('0x48')];return db[_0x2be1('0x49')]['destroy']({'where':{'type':_0x5ec4c6,'resourceId':_0x400601['id']}})[_0x2be1('0x25')](function(){return _0x26e3c0;});})[_0x2be1('0x25')](function(){_0x611287['status'](0xcc)[_0x2be1('0x4a')]();});}};}function handleEntityNotFound(_0x18c593,_0xf143cc){return function(_0x558dc5){if(!_0x558dc5){_0x18c593[_0x2be1('0x31')](0x194);}return _0x558dc5;};}function handleError(_0x2d3928,_0xb698aa){_0xb698aa=_0xb698aa||0x1f4;return function(_0x20c1d0){logger[_0x2be1('0x2a')](_0x20c1d0[_0x2be1('0x4b')]);if(_0x20c1d0[_0x2be1('0x48')]){delete _0x20c1d0['name'];}_0x2d3928['status'](_0xb698aa)['send'](_0x20c1d0);};}exports['index']=function(_0x3edb2f,_0x55bd09){var _0x19c416={},_0x47d54b={},_0x315725={'count':0x0,'rows':[]};var _0x28f2d2=db['User'][_0x2be1('0x4c')];_0x47d54b['model']=_[_0x2be1('0x4d')](_['keys'](_0x28f2d2),['password','salt']);_0x47d54b[_0x2be1('0x4e')]=_[_0x2be1('0x4f')](_0x3edb2f[_0x2be1('0x4e')]);_0x47d54b[_0x2be1('0x50')]=_[_0x2be1('0x51')](_0x47d54b[_0x2be1('0x52')],_0x47d54b[_0x2be1('0x4e')]);_0x19c416[_0x2be1('0x53')]=_[_0x2be1('0x51')](_0x47d54b['model'],qs[_0x2be1('0x54')](_0x3edb2f[_0x2be1('0x4e')]['fields']));_0x19c416[_0x2be1('0x53')]=_0x19c416[_0x2be1('0x53')][_0x2be1('0x55')]?_0x19c416[_0x2be1('0x53')]:_0x47d54b[_0x2be1('0x52')];if(!_0x3edb2f[_0x2be1('0x4e')][_0x2be1('0x56')](_0x2be1('0x57'))){_0x19c416[_0x2be1('0x35')]=qs['limit'](_0x3edb2f[_0x2be1('0x4e')][_0x2be1('0x35')]);_0x19c416[_0x2be1('0x34')]=qs[_0x2be1('0x34')](_0x3edb2f[_0x2be1('0x4e')][_0x2be1('0x34')]);}_0x19c416['order']=qs['sort'](_0x3edb2f[_0x2be1('0x4e')][_0x2be1('0x58')]);_0x19c416['where']=qs[_0x2be1('0x50')](_[_0x2be1('0x59')](_0x3edb2f[_0x2be1('0x4e')],_0x47d54b[_0x2be1('0x50')]));if(_0x3edb2f[_0x2be1('0x4e')][_0x2be1('0x43')]){_0x19c416[_0x2be1('0x5a')]=_[_0x2be1('0x5b')](_0x19c416['where'],{'$or':_['map'](_0x28f2d2,function(_0xaf4834){if(_0xaf4834['type'][_0x2be1('0x5c')]!==_0x2be1('0x5d')){return db['sequelize']['where'](db['sequelize']['fn']('lower',db[_0x2be1('0x5e')][_0x2be1('0x5f')](_0xaf4834[_0x2be1('0x60')])),{'$like':db[_0x2be1('0x5e')]['fn'](_0x2be1('0x61'),'%'+_0x3edb2f['query'][_0x2be1('0x43')]+'%')});}})});}_0x19c416=_['merge']({},_0x19c416,_0x3edb2f[_0x2be1('0x62')]);var _0x208d90={'where':_0x19c416[_0x2be1('0x5a')]};return db[_0x2be1('0x63')][_0x2be1('0x33')](_0x208d90)[_0x2be1('0x25')](function(_0x23c8c2){_0x315725['count']=_0x23c8c2;if(_0x3edb2f[_0x2be1('0x4e')][_0x2be1('0x64')]){_0x19c416[_0x2be1('0x65')]=[{'all':!![]}];}return db[_0x2be1('0x63')][_0x2be1('0x66')](_0x19c416);})[_0x2be1('0x25')](function(_0x17950b){_0x315725[_0x2be1('0x67')]=_0x17950b;return _0x315725;})['then'](respondWithFilteredResult(_0x55bd09,_0x19c416))['catch'](handleError(_0x55bd09,null));};exports[_0x2be1('0x68')]=function(_0x1fa2e4,_0x10c5f7){var _0x4e3851={'raw':![],'where':{'id':_0x1fa2e4['params']['id']}},_0x353d89={};_0x353d89[_0x2be1('0x52')]=_[_0x2be1('0x4d')](_[_0x2be1('0x4f')](db['User'][_0x2be1('0x4c')]),[_0x2be1('0x69'),_0x2be1('0x6a')]);_0x353d89[_0x2be1('0x4e')]=_[_0x2be1('0x4f')](_0x1fa2e4[_0x2be1('0x4e')]);_0x353d89[_0x2be1('0x50')]=_[_0x2be1('0x51')](_0x353d89[_0x2be1('0x52')],_0x353d89[_0x2be1('0x4e')]);_0x4e3851['attributes']=_['intersection'](_0x353d89[_0x2be1('0x52')],qs[_0x2be1('0x54')](_0x1fa2e4[_0x2be1('0x4e')][_0x2be1('0x54')]));_0x4e3851[_0x2be1('0x53')]=_0x4e3851[_0x2be1('0x53')][_0x2be1('0x55')]?_0x4e3851[_0x2be1('0x53')]:_0x353d89[_0x2be1('0x52')];if(_0x1fa2e4[_0x2be1('0x4e')][_0x2be1('0x64')]){_0x4e3851[_0x2be1('0x65')]=[{'all':!![]}];}_0x4e3851=_[_0x2be1('0x5b')]({},_0x4e3851,_0x1fa2e4[_0x2be1('0x62')]);return db[_0x2be1('0x63')][_0x2be1('0x6b')](_0x4e3851)['then'](handleEntityNotFound(_0x10c5f7,null))[_0x2be1('0x25')](respondWithResult(_0x10c5f7,null))['catch'](handleError(_0x10c5f7,null));};exports[_0x2be1('0x6c')]=function(_0x212e41,_0xf32cff){return db[_0x2be1('0x63')]['bulkCreate'](_0x212e41[_0x2be1('0x6d')],{'raw':![],'individualHooks':!![]})[_0x2be1('0x25')](respondWithResult(_0xf32cff,0xc9))[_0x2be1('0x30')](handleError(_0xf32cff,null));};exports[_0x2be1('0x3b')]=function(_0x3c38b2,_0xa8d4c6){if(_0x3c38b2[_0x2be1('0x6d')]['id']){delete _0x3c38b2['body']['id'];}delete _0x3c38b2['body']['role'];return db[_0x2be1('0x63')][_0x2be1('0x6b')]({'where':{'id':_0x3c38b2[_0x2be1('0x6e')]['id']}})[_0x2be1('0x25')](handleEntityNotFound(_0xa8d4c6,null))[_0x2be1('0x25')](saveUpdates(_0x3c38b2[_0x2be1('0x6d')],null))['then'](respondWithResult(_0xa8d4c6,null))[_0x2be1('0x30')](handleError(_0xa8d4c6,null));};exports[_0x2be1('0x6f')]=function(_0x12d992,_0x1fc5f9){return db[_0x2be1('0x63')][_0x2be1('0x6f')]()['then'](respondWithResult(_0x1fc5f9,null))[_0x2be1('0x30')](handleError(_0x1fc5f9,null));};exports[_0x2be1('0x70')]=function(_0x566e71,_0x52de12,_0x23287d){return db[_0x2be1('0x63')][_0x2be1('0x6b')]({'where':{'id':_0x566e71[_0x2be1('0x6e')]['id']}})[_0x2be1('0x25')](handleEntityNotFound(_0x52de12,null))['then'](function(_0x4e24f9){if(_0x4e24f9){return _0x4e24f9[_0x2be1('0x70')](_0x566e71[_0x2be1('0x6d')][_0x2be1('0x71')],_['omit'](_0x566e71[_0x2be1('0x6d')],[_0x2be1('0x71'),'id'])||{});}})[_0x2be1('0x25')](respondWithResult(_0x52de12,null))[_0x2be1('0x30')](handleError(_0x52de12,null));};var getLicense=function(_0xb9eca1){return new BPromise(function(_0x408914,_0xcbe23f){var _0x24b215=0x0;_0xb9eca1[_0x2be1('0x6d')][_0x2be1('0x47')]===_0x2be1('0x40')&&_0x408914(_0x2be1('0x72'));return db['User'][_0x2be1('0x33')]({'where':{'$or':[{'role':_0xb9eca1['body'][_0x2be1('0x47')]===_0x2be1('0x42')?_0x2be1('0x42'):[_0x2be1('0x73'),_0x2be1('0x3e')]}]}})[_0x2be1('0x25')](function(_0x40bc6b){_0x24b215=_0x40bc6b;return require(_0x2be1('0x74'))['getLicense']();})[_0x2be1('0x25')](function(_0x1bece4){var _0x312ee9=_0xb9eca1[_0x2be1('0x6d')][_0x2be1('0x47')]==='telephone'?_0x2be1('0x75'):_0x2be1('0x76');if(!_[_0x2be1('0x77')](_0x1bece4[_0x312ee9])&&_0x24b215>=_0x1bece4[_0x312ee9]){return _0xcbe23f({'message':'License\x20limit\x20reached'});}return _0x408914(util[_0x2be1('0x78')]('count\x20%s:\x20%s',_0x312ee9,_0x24b215));})[_0x2be1('0x30')](function(_0x5cff3c){return _0xcbe23f(_0x5cff3c);});});};exports['create']=function(_0x312aaf,_0x523f1e){return getLicense(_0x312aaf)[_0x2be1('0x25')](function(_0x3cdf6e){if(!_0x312aaf[_0x2be1('0x6d')][_0x2be1('0x79')]){var _0x4f526d;return db[_0x2be1('0x7a')][_0x2be1('0x7b')](0x1)[_0x2be1('0x25')](function(_0x101ff1){_0x101ff1['securePassword']=!![];return checkPasswordPattern(_0x101ff1,_0x312aaf['body']['password'],_0x101ff1[_0x2be1('0x7c')]);})[_0x2be1('0x25')](function(_0x408a85){_0x4f526d=_0x408a85[_0x2be1('0x7d')];return db[_0x2be1('0x63')]['max'](_0x2be1('0x79'));})['then'](function(_0x5bd49b){if(_['isNil'](_0x5bd49b)){if(_0x4f526d){_0x312aaf[_0x2be1('0x6d')][_0x2be1('0x79')]=_0x4f526d;}else{_0x312aaf[_0x2be1('0x6d')][_0x2be1('0x79')]=0x1;}}else{if(_['isNil'](_0x4f526d)||_0x4f526d==_0x5bd49b){_0x312aaf[_0x2be1('0x6d')][_0x2be1('0x79')]=_0x5bd49b+0x1;}else if(_0x4f526d>_0x5bd49b){_0x312aaf[_0x2be1('0x6d')][_0x2be1('0x79')]=_0x4f526d;}else{return db[_0x2be1('0x5e')][_0x2be1('0x4e')](_0x2be1('0x7e'),{'type':db[_0x2be1('0x5e')][_0x2be1('0x7f')][_0x2be1('0x80')]})[_0x2be1('0x25')](function(_0x11de90){if(_0x11de90&&_0x11de90[_0x2be1('0x55')]){for(var _0x5f0991=0x0,_0x385f47=_0x11de90[_0x2be1('0x55')];_0x5f0991<_0x385f47&&_[_0x2be1('0x77')](_0x312aaf[_0x2be1('0x6d')]['internal']);_0x5f0991++){if(_0x4f526d<=_0x11de90[_0x5f0991][_0x2be1('0x81')]){_0x312aaf[_0x2be1('0x6d')][_0x2be1('0x79')]=_0x11de90[_0x5f0991][_0x2be1('0x81')];}else if(_0x4f526d>_0x11de90[_0x5f0991]['from']&&_0x4f526d<=_0x11de90[_0x5f0991]['to']){_0x312aaf[_0x2be1('0x6d')][_0x2be1('0x79')]=_0x4f526d;}}}if(_['isNil'](_0x312aaf[_0x2be1('0x6d')][_0x2be1('0x79')])){_0x312aaf['body'][_0x2be1('0x79')]=_0x5bd49b+0x1;}});}}});}})['then'](function(){if(_0x312aaf[_0x2be1('0x6d')]['voicemail']){_0x312aaf[_0x2be1('0x6d')][_0x2be1('0x82')]=_0x312aaf[_0x2be1('0x6d')][_0x2be1('0x79')];_0x312aaf[_0x2be1('0x6d')][_0x2be1('0x83')]={'mailbox':_0x312aaf[_0x2be1('0x6d')]['internal'],'password':_0x312aaf[_0x2be1('0x6d')]['password'],'fullname':_0x312aaf['body'][_0x2be1('0x84')],'email':_0x312aaf['body'][_0x2be1('0x85')]};}if(_0x312aaf[_0x2be1('0x6d')]&&_0x312aaf[_0x2be1('0x6d')]['role']===_0x2be1('0x40')){_0x312aaf['body'][_0x2be1('0x86')]=[_0x2be1('0x87'),_0x2be1('0x88'),'103',_0x2be1('0x89'),_0x2be1('0x8a'),'105',_0x2be1('0x8b'),'107',_0x2be1('0x8c'),_0x2be1('0x8d'),'100',_0x2be1('0x8e')];}return db[_0x2be1('0x63')][_0x2be1('0x8f')](_0x312aaf['body'],{'include':[{'model':db[_0x2be1('0x83')],'as':'VoiceMail'}]});})[_0x2be1('0x25')](function(_0x4cfcde){if(_0x312aaf['body']['role']===_0x2be1('0x3e'))return _0x4cfcde;var _0xe7b068=_0x312aaf[_0x2be1('0x3e')][_0x2be1('0x90')]({'plain':!![]});if(!_0xe7b068)throw new Error(_0x2be1('0x91'));if(_0xe7b068[_0x2be1('0x47')]===_0x2be1('0x3e')){var _0x4c8c4e=_0x4cfcde[_0x2be1('0x90')]({'plain':!![]});var _0xe0c70c=[{'name':_0x2be1('0x3f'),'value':'agent'},{'name':_0x2be1('0x41'),'value':_0x2be1('0x42')}];var _0x41bfc9=_[_0x2be1('0x6b')](_0xe0c70c,[_0x2be1('0x45'),_0x4c8c4e[_0x2be1('0x47')]])[_0x2be1('0x48')];return db['UserProfileSection'][_0x2be1('0x6b')]({'where':{'name':_0x41bfc9,'userProfileId':_0xe7b068[_0x2be1('0x92')]},'raw':!![]})['then'](function(_0x5437e4){if(_0x5437e4&&_0x5437e4[_0x2be1('0x93')]===0x0){return db[_0x2be1('0x49')]['create']({'name':_0x4c8c4e[_0x2be1('0x48')],'resourceId':_0x4c8c4e['id'],'type':_0x5437e4[_0x2be1('0x48')],'sectionId':_0x5437e4['id']},{})[_0x2be1('0x25')](function(){return _0x4cfcde;});}else{return _0x4cfcde;}})[_0x2be1('0x30')](function(_0x41d845){logger[_0x2be1('0x2a')](_0x2be1('0x94'),_0x41d845);throw _0x41d845;});}return _0x4cfcde;})['then'](respondWithResult(_0x523f1e,0xc9))[_0x2be1('0x30')](handleError(_0x523f1e,null));};exports[_0x2be1('0x95')]=function(_0x321376,_0x25f8ca,_0x36b292){var _0x4fc8e4=![];if(_0x321376['body']['id']){delete _0x321376[_0x2be1('0x6d')]['id'];}if(!_[_0x2be1('0x77')](_0x321376['body'][_0x2be1('0x96')])){if(_0x321376[_0x2be1('0x6d')]['oldPassword']===_0x321376[_0x2be1('0x6d')]['newPassword']){throw new Error(_0x2be1('0x97'));}}return db[_0x2be1('0x63')]['find']({'where':{'id':_0x321376[_0x2be1('0x6e')]['id']}})['then'](function(_0xa50155){if(_0xa50155){if(_0xa50155['id']==_0x321376[_0x2be1('0x3e')]['id']){if(!_0x321376[_0x2be1('0x6d')][_0x2be1('0x96')]||!_0x321376['body']['newPassword']){throw new db[(_0x2be1('0x98'))][(_0x2be1('0x99'))](_0x2be1('0x9a'));}if(!_0xa50155[_0x2be1('0x9b')](_0x321376[_0x2be1('0x6d')][_0x2be1('0x96')])){throw new db['Sequelize'][(_0x2be1('0x99'))](_0x2be1('0x9c'));}if(_0x321376[_0x2be1('0x6d')]['oldPassword']==_0x321376[_0x2be1('0x6d')]['newPassword']){throw new db[(_0x2be1('0x98'))][(_0x2be1('0x99'))](_0x2be1('0x9d'));}return _0xa50155;}else if(_0x321376['user']['role']==_0x2be1('0x73')){if(!_0x321376[_0x2be1('0x6d')][_0x2be1('0x9e')]){throw new db[(_0x2be1('0x98'))]['ValidationError'](_0x2be1('0x9f'));}return _0xa50155;}else if(_0x321376['user'][_0x2be1('0x47')]=='user'){if(!_0x321376['body'][_0x2be1('0x9e')]){throw new db['Sequelize']['ValidationError'](_0x2be1('0x9f'));}if(_0xa50155['role']!=_0x2be1('0x40')){throw new db[(_0x2be1('0x98'))]['ValidationError'](_0x2be1('0xa0'));}return _0xa50155;}else{throw new db[(_0x2be1('0x98'))][(_0x2be1('0x99'))](_0x2be1('0xa0'));}}return null;})[_0x2be1('0x25')](handleEntityNotFound(_0x25f8ca,null))[_0x2be1('0x25')](function(_0x5b5778){return db[_0x2be1('0x7a')][_0x2be1('0xa1')]({'attributes':['id',_0x2be1('0x7c')]})[_0x2be1('0x25')](function(_0x5d14fe){_0x4fc8e4=_0x5d14fe['securePassword'];return checkPasswordPattern(_0x5b5778,_0x321376[_0x2be1('0x6d')]['newPassword'],_0x4fc8e4);});})[_0x2be1('0x25')](saveUpdates({'password':_0x321376['body'][_0x2be1('0x9e')],'passwordResetAt':_0x321376['user']['id']==_0x321376['params']['id']?moment():null},null))[_0x2be1('0x25')](respondWithResult(_0x25f8ca,null))[_0x2be1('0x30')](handleError(_0x25f8ca,null));};exports[_0x2be1('0xa2')]=function(_0x4c09e6,_0x14c547,_0xbf7ec9){var _0x5b38f6=_0x4c09e6[_0x2be1('0x6d')][_0x2be1('0xa3')];return db[_0x2be1('0x63')][_0x2be1('0x6b')]({'where':{'id':_0x4c09e6['params']['id']},'attributes':['id','name',_0x2be1('0x47'),_0x2be1('0xa4'),_0x2be1('0xa5'),_0x2be1('0xa6'),_0x2be1('0xa7')]})[_0x2be1('0x25')](handleEntityNotFound(_0x14c547,null))['then'](function(_0x5980a5){if(_0x5980a5){if(!utils[_0x2be1('0xa8')](_0x5b38f6)){throw new db[(_0x2be1('0x98'))][(_0x2be1('0x99'))](_0x2be1('0xa9'));}return _0x5980a5[_0x2be1('0xaa')+_[_0x2be1('0xab')](_0x5b38f6[_0x2be1('0xac')]())+'Queues'](_0x4c09e6[_0x2be1('0x6d')][_0x2be1('0x71')],{'penalty':_0x4c09e6[_0x2be1('0x6d')]['penalty']||0x0})[_0x2be1('0xad')](function(_0x3f2c4d){for(var _0x41e4ef=0x0;_0x41e4ef<_0x4c09e6['body'][_0x2be1('0x71')][_0x2be1('0x55')];_0x41e4ef+=0x1){var _0x40088e={'UserId':_0x4c09e6[_0x2be1('0x6e')]['id']};_0x40088e[_['capitalize'](_0x5b38f6[_0x2be1('0xac')]())+_0x2be1('0xae')]=_0x4c09e6[_0x2be1('0x6d')]['ids'][_0x41e4ef];socket[_0x2be1('0xaf')]('user'+_[_0x2be1('0xab')](_0x5b38f6['toLowerCase']())+_0x2be1('0xb0'),_0x40088e);}return _0x3f2c4d;})['then'](function(){if(_0x5b38f6==='voice'){return db[_0x2be1('0xb1')][_0x2be1('0x66')]({'where':{'id':_0x4c09e6['body'][_0x2be1('0x71')]||[]},'raw':!![],'attributes':['id',_0x2be1('0x48')]});}})[_0x2be1('0x25')](function(_0x3f5e6b){var _0x359fc0=_0x5980a5[_0x2be1('0x90')]({'plain':!![]});var _0x3320ba=[];if(_0x5b38f6===_0x2be1('0xb2')&&_0x359fc0[_0x2be1('0x47')]===_0x2be1('0x40')&&_0x359fc0[_0x2be1('0xa4')]){for(var _0x5bfc25=0x0;_0x5bfc25<_0x3f5e6b[_0x2be1('0x55')];_0x5bfc25+=0x1){_0x3320ba['push']({'membername':_0x359fc0[_0x2be1('0x48')],'UserId':_0x359fc0['id'],'queue_name':_0x3f5e6b[_0x5bfc25]['name'],'VoiceQueueId':_0x3f5e6b[_0x5bfc25]['id'],'interface':_[_0x2be1('0x77')](_0x359fc0[_0x2be1('0xa7')])?util[_0x2be1('0x78')](_0x2be1('0xb3'),_0x359fc0[_0x2be1('0x48')]):_0x359fc0['interface'],'paused':_0x359fc0['voicePause']||![],'penalty':_0x4c09e6[_0x2be1('0x6d')][_0x2be1('0xb4')]||0x0});}return BPromise[_0x2be1('0xb5')](_0x3320ba,function(_0x4a3f6a){return db[_0x2be1('0xb6')][_0x2be1('0xb7')](_0x4a3f6a);});}return _0x5980a5;});}})[_0x2be1('0x25')](respondWithStatusCode(_0x14c547,null))[_0x2be1('0x30')](handleError(_0x14c547,null));};exports[_0x2be1('0xb8')]=function(_0x203a30,_0x25aaf8,_0x19e348){var _0x1d15e6;return db[_0x2be1('0x63')][_0x2be1('0x6b')]({'where':{'id':_0x203a30[_0x2be1('0x6e')]['id']},'attributes':['id',_0x2be1('0x48'),'role']})[_0x2be1('0x25')](handleEntityNotFound(_0x25aaf8,null))[_0x2be1('0x25')](function(_0x4b5cb9){if(_0x4b5cb9){_0x1d15e6=_0x4b5cb9;if(!_0x203a30[_0x2be1('0x4e')][_0x2be1('0xa3')]||!utils[_0x2be1('0xa8')](_0x203a30['query'][_0x2be1('0xa3')])){throw new db['Sequelize'][(_0x2be1('0x99'))]('Unknown\x20channel');}return _0x4b5cb9['remove'+_['capitalize'](_0x203a30[_0x2be1('0x4e')][_0x2be1('0xa3')][_0x2be1('0xac')]())+_0x2be1('0xb9')](_0x203a30[_0x2be1('0x4e')]['ids']);}})['then'](function(_0x467cd3){for(var _0x1faab4=0x0;_0x1faab4<_0x203a30[_0x2be1('0x4e')][_0x2be1('0x71')][_0x2be1('0x55')];_0x1faab4+=0x1){var _0x53b490={'UserId':_0x203a30[_0x2be1('0x6e')]['id']};_0x53b490[_['capitalize'](_0x203a30['query'][_0x2be1('0xa3')][_0x2be1('0xac')]())+_0x2be1('0xae')]=_0x203a30[_0x2be1('0x4e')]['ids'][_0x1faab4];socket[_0x2be1('0xaf')](_0x2be1('0x3e')+_['capitalize'](_0x203a30[_0x2be1('0x4e')][_0x2be1('0xa3')][_0x2be1('0xac')]())+_0x2be1('0xba'),_0x53b490);}return _0x467cd3;})['then'](function(){if(_0x203a30['query'][_0x2be1('0xa3')]===_0x2be1('0xb2')){return db[_0x2be1('0xb6')]['destroy']({'where':{'UserId':_0x203a30['params']['id'],'VoiceQueueId':_0x203a30['query'][_0x2be1('0x71')]},'individualHooks':!![]})[_0x2be1('0x25')](function(){return _0x1d15e6;});}return _0x1d15e6;})[_0x2be1('0x25')](respondWithStatusCode(_0x25aaf8,null))[_0x2be1('0x30')](handleError(_0x25aaf8,null));};exports[_0x2be1('0xbb')]=function(_0x3b416a,_0x56fd48,_0x3fe829){_0x3b416a['body'][_0x2be1('0xbc')]=_0x3b416a[_0x2be1('0xbd')][_0x2be1('0xbe')];return db[_0x2be1('0x63')]['find']({'where':{'id':_0x3b416a[_0x2be1('0x6e')]['id']}})[_0x2be1('0x25')](handleEntityNotFound(_0x56fd48,null))['then'](saveUpdates(_0x3b416a[_0x2be1('0x6d')],null))[_0x2be1('0x25')](respondWithResult(_0x56fd48,null))[_0x2be1('0x30')](handleError(_0x56fd48,null));};exports[_0x2be1('0xbf')]=function(_0x32b69f,_0x5c8077,_0x43ae25){var _0x2c6da4=path[_0x2be1('0xc0')](config['root'],_0x2be1('0xc1'));return db['User'][_0x2be1('0x6b')]({'where':{'id':_0x32b69f['params']['id']},'attributes':['id','userpic'],'raw':!![]})[_0x2be1('0x25')](handleEntityNotFound(_0x5c8077,null))[_0x2be1('0x25')](function(_0x26a2c9){if(_0x26a2c9){if(_[_0x2be1('0x77')](_0x26a2c9['userpic'])){return _0x5c8077[_0x2be1('0xc2')](_0x2c6da4);}else{if(!fs[_0x2be1('0xc3')](path[_0x2be1('0xc0')](config[_0x2be1('0xc4')],_0x2be1('0xc5'),_0x26a2c9[_0x2be1('0xbc')]))){return _0x5c8077[_0x2be1('0xc2')](_0x2c6da4);}return _0x5c8077['download'](path[_0x2be1('0xc0')](config['root'],_0x2be1('0xc5'),_0x26a2c9[_0x2be1('0xbc')]));}}})[_0x2be1('0x30')](handleError(_0x5c8077,null));};exports[_0x2be1('0xc6')]=function(_0x348597,_0x2b5861,_0x4ec4a1){var _0x5dc56d={};var _0x4e0b43={};var _0x310fbc;var _0x3d011b;return db[_0x2be1('0x63')]['findOne']({'where':{'id':_0x348597[_0x2be1('0x6e')]['id']}})['then'](handleEntityNotFound(_0x2b5861,null))[_0x2be1('0x25')](function(_0x34976e){if(_0x34976e){_0x310fbc=_0x34976e;_0x4e0b43['model']=_[_0x2be1('0x4f')](db[_0x2be1('0xc7')]['rawAttributes']);_0x4e0b43['query']=_[_0x2be1('0x4f')](_0x348597[_0x2be1('0x4e')]);_0x4e0b43[_0x2be1('0x50')]=_['intersection'](_0x4e0b43['model'],_0x4e0b43[_0x2be1('0x4e')]);_0x5dc56d[_0x2be1('0x53')]=_[_0x2be1('0x51')](_0x4e0b43[_0x2be1('0x52')],qs[_0x2be1('0x54')](_0x348597[_0x2be1('0x4e')][_0x2be1('0x54')]));_0x5dc56d[_0x2be1('0x53')]=_0x5dc56d[_0x2be1('0x53')]['length']?_0x5dc56d['attributes']:_0x4e0b43[_0x2be1('0x52')];_0x5dc56d['order']=qs[_0x2be1('0x58')](_0x348597[_0x2be1('0x4e')][_0x2be1('0x58')]);_0x5dc56d[_0x2be1('0x5a')]=qs[_0x2be1('0x50')](_[_0x2be1('0x59')](_0x348597[_0x2be1('0x4e')],_0x4e0b43[_0x2be1('0x50')]));if(_0x348597[_0x2be1('0x4e')][_0x2be1('0x43')]){_0x5dc56d[_0x2be1('0x5a')]=_[_0x2be1('0x5b')](_0x5dc56d['where'],{'$or':_['map'](_0x5dc56d[_0x2be1('0x53')],function(_0x3446aa){var _0xb1f1d2={};_0xb1f1d2[_0x3446aa]={'$like':'%'+_0x348597[_0x2be1('0x4e')][_0x2be1('0x43')]+'%'};return _0xb1f1d2;})});}_0x5dc56d=_[_0x2be1('0x5b')]({},_0x5dc56d,_0x348597['options']);return _0x310fbc[_0x2be1('0xc6')](_0x5dc56d);}})[_0x2be1('0x25')](function(_0x1aae12){if(_0x1aae12){_0x3d011b=_0x1aae12['length'];if(_0x348597[_0x2be1('0x4e')][_0x2be1('0x56')](_0x2be1('0x64'))){_0x5dc56d[_0x2be1('0x65')]=[{'model':db[_0x2be1('0xc8')],'as':'List','required':![]},{'model':db['Tag'],'as':_0x2be1('0xc9'),'attributes':['id',_0x2be1('0x48'),'color'],'where':_0x348597[_0x2be1('0x4e')][_0x2be1('0xca')]?{'id':_0x348597[_0x2be1('0x4e')][_0x2be1('0xca')]}:undefined,'required':_0x348597[_0x2be1('0x4e')]['tag']?!![]:![]}];}if(!_0x348597[_0x2be1('0x4e')][_0x2be1('0x56')](_0x2be1('0x57'))){_0x5dc56d[_0x2be1('0x35')]=qs[_0x2be1('0x35')](_0x348597[_0x2be1('0x4e')][_0x2be1('0x35')]);_0x5dc56d[_0x2be1('0x34')]=qs[_0x2be1('0x34')](_0x348597[_0x2be1('0x4e')]['offset']);}return _0x310fbc[_0x2be1('0xc6')](_0x5dc56d);}})[_0x2be1('0x25')](function(_0x510ab7){if(_0x510ab7){return _0x510ab7?{'count':_0x3d011b,'rows':_0x510ab7}:null;}})['then'](respondWithResult(_0x2b5861,null))[_0x2be1('0x30')](handleError(_0x2b5861,null));};exports['getQueues']=function(_0x5e0aed,_0x345ea7,_0x542977){var _0x1a1819;var _0x35f9b1;var _0x825205={};var _0x48882b;return db[_0x2be1('0x63')][_0x2be1('0xa1')]({'where':{'id':_0x5e0aed[_0x2be1('0x6e')]['id']},'attributes':['id',_0x2be1('0x48'),_0x2be1('0x47')]})[_0x2be1('0x25')](handleEntityNotFound(_0x345ea7,null))[_0x2be1('0x25')](function(_0x5c362c){if(!utils['isValidChannel'](_0x5e0aed[_0x2be1('0x4e')]['channel'])){throw new db[(_0x2be1('0x98'))][(_0x2be1('0x99'))](_0x2be1('0xa9'));}_0x1a1819=_0x5c362c;var _0x38cb82={};_0x38cb82[_0x2be1('0x52')]=_['keys'](db[_[_0x2be1('0xab')](_0x5e0aed['query'][_0x2be1('0xa3')])+'Queue'][_0x2be1('0x4c')]);_0x38cb82[_0x2be1('0x4e')]=_['keys'](_0x5e0aed[_0x2be1('0x4e')]);_0x38cb82[_0x2be1('0x50')]=_[_0x2be1('0x51')](_0x38cb82[_0x2be1('0x52')],_0x38cb82[_0x2be1('0x4e')]);_0x825205[_0x2be1('0x53')]=_[_0x2be1('0x51')](_0x38cb82['model'],qs[_0x2be1('0x54')](_0x5e0aed[_0x2be1('0x4e')][_0x2be1('0x54')]));_0x825205[_0x2be1('0x53')]=_0x825205['attributes'][_0x2be1('0x55')]?_0x825205['attributes']:_0x38cb82['model'];_0x825205['order']=qs[_0x2be1('0x58')](_0x5e0aed[_0x2be1('0x4e')][_0x2be1('0x58')]);_0x825205[_0x2be1('0x5a')]=qs[_0x2be1('0x50')](_[_0x2be1('0x59')](_0x5e0aed[_0x2be1('0x4e')],_0x38cb82[_0x2be1('0x50')]));if(_0x5e0aed[_0x2be1('0x4e')]['filter']){_0x825205[_0x2be1('0x5a')]=_[_0x2be1('0x5b')](_0x825205[_0x2be1('0x5a')],{'$or':_[_0x2be1('0xcb')](_0x825205[_0x2be1('0x53')],function(_0x58aa4a){var _0x5ccd3b={};_0x5ccd3b[_0x58aa4a]={'$like':'%'+_0x5e0aed[_0x2be1('0x4e')]['filter']+'%'};return _0x5ccd3b;})});}_0x825205=_[_0x2be1('0x5b')]({},_0x825205,_0x5e0aed[_0x2be1('0x62')]);switch(_0x1a1819['role']){case _0x2be1('0x73'):return db[_['capitalize'](_0x5e0aed[_0x2be1('0x4e')][_0x2be1('0xa3')])+_0x2be1('0xcc')][_0x2be1('0x66')](_0x825205);case _0x2be1('0x3e'):case _0x2be1('0x40'):return _0x1a1819['get'+_[_0x2be1('0xab')](_0x5e0aed[_0x2be1('0x4e')]['channel'])+_0x2be1('0xb9')](_0x825205);default:throw new db[(_0x2be1('0x98'))][(_0x2be1('0x99'))](_0x2be1('0xcd'));}})[_0x2be1('0x25')](function(_0xdd52c9){_0x48882b=_0xdd52c9[_0x2be1('0x55')];if(!_0x5e0aed[_0x2be1('0x4e')][_0x2be1('0x56')](_0x2be1('0x57'))){_0x825205[_0x2be1('0x35')]=qs[_0x2be1('0x35')](_0x5e0aed[_0x2be1('0x4e')]['limit']);_0x825205[_0x2be1('0x34')]=qs[_0x2be1('0x34')](_0x5e0aed[_0x2be1('0x4e')]['offset']);}switch(_0x1a1819[_0x2be1('0x47')]){case _0x2be1('0x73'):return db[_[_0x2be1('0xab')](_0x5e0aed[_0x2be1('0x4e')]['channel'])+_0x2be1('0xcc')][_0x2be1('0x66')](_0x825205);case _0x2be1('0x3e'):case _0x2be1('0x40'):return _0x1a1819[_0x2be1('0x90')+_[_0x2be1('0xab')](_0x5e0aed[_0x2be1('0x4e')][_0x2be1('0xa3')])+_0x2be1('0xb9')](_0x825205);}})[_0x2be1('0x25')](function(_0x38c6aa){return{'count':_0x48882b,'rows':_0x38c6aa};})[_0x2be1('0x25')](respondWithResult(_0x345ea7,null))[_0x2be1('0x30')](handleError(_0x345ea7,null));};exports[_0x2be1('0xce')]=function(_0xe0f8,_0x2cd874,_0x246e27){var _0xbe450={};var _0x439a3b={};var _0x82204c;var _0x1229a9;return db['User'][_0x2be1('0xa1')]({'where':{'id':_0xe0f8[_0x2be1('0x6e')]['id']}})[_0x2be1('0x25')](handleEntityNotFound(_0x2cd874,null))[_0x2be1('0x25')](function(_0x5a081b){if(_0x5a081b){_0x82204c=_0x5a081b;_0x439a3b['model']=_['keys'](db['UserVoiceQueueRt']['rawAttributes']);_0x439a3b[_0x2be1('0x4e')]=_[_0x2be1('0x4f')](_0xe0f8[_0x2be1('0x4e')]);_0x439a3b[_0x2be1('0x50')]=_[_0x2be1('0x51')](_0x439a3b['model'],_0x439a3b['query']);_0xbe450[_0x2be1('0x53')]=_[_0x2be1('0x51')](_0x439a3b[_0x2be1('0x52')],qs[_0x2be1('0x54')](_0xe0f8[_0x2be1('0x4e')][_0x2be1('0x54')]));_0xbe450[_0x2be1('0x53')]=_0xbe450[_0x2be1('0x53')][_0x2be1('0x55')]?_0xbe450['attributes']:_0x439a3b[_0x2be1('0x52')];_0xbe450[_0x2be1('0xcf')]=qs[_0x2be1('0x58')](_0xe0f8[_0x2be1('0x4e')][_0x2be1('0x58')]);_0xbe450[_0x2be1('0x5a')]=qs[_0x2be1('0x50')](_[_0x2be1('0x59')](_0xe0f8[_0x2be1('0x4e')],_0x439a3b[_0x2be1('0x50')]));if(_0xe0f8['query'][_0x2be1('0x43')]){_0xbe450['where']=_[_0x2be1('0x5b')](_0xbe450[_0x2be1('0x5a')],{'$or':_[_0x2be1('0xcb')](_0xbe450[_0x2be1('0x53')],function(_0x321648){var _0x386eaa={};_0x386eaa[_0x321648]={'$like':'%'+_0xe0f8[_0x2be1('0x4e')]['filter']+'%'};return _0x386eaa;})});}_0xbe450=_['merge']({},_0xbe450,_0xe0f8[_0x2be1('0x62')]);return _0x82204c[_0x2be1('0xce')](_0xbe450);}})[_0x2be1('0x25')](function(_0x8b78f3){if(_0x8b78f3){_0x1229a9=_0x8b78f3['length'];if(!_0xe0f8[_0x2be1('0x4e')]['hasOwnProperty'](_0x2be1('0x57'))){_0xbe450[_0x2be1('0x35')]=qs[_0x2be1('0x35')](_0xe0f8[_0x2be1('0x4e')][_0x2be1('0x35')]);_0xbe450[_0x2be1('0x34')]=qs[_0x2be1('0x34')](_0xe0f8[_0x2be1('0x4e')][_0x2be1('0x34')]);}return _0x82204c[_0x2be1('0xce')](_0xbe450);}})[_0x2be1('0x25')](function(_0x560431){if(_0x560431){return _0x560431?{'count':_0x1229a9,'rows':_0x560431}:null;}})[_0x2be1('0x25')](respondWithResult(_0x2cd874,null))[_0x2be1('0x30')](handleError(_0x2cd874,null));};exports[_0x2be1('0xd0')]=function(_0xdb225,_0x4a4ecb,_0x4668fa){var _0x471927={};var _0x315346={};var _0x296117;var _0x1d829d;return db[_0x2be1('0x63')][_0x2be1('0xa1')]({'where':{'id':_0xdb225[_0x2be1('0x6e')]['id']}})[_0x2be1('0x25')](handleEntityNotFound(_0x4a4ecb,null))[_0x2be1('0x25')](function(_0x1823ef){if(_0x1823ef){_0x296117=_0x1823ef;_0x315346['model']=_[_0x2be1('0x4f')](db[_0x2be1('0xd1')][_0x2be1('0x4c')]);_0x315346[_0x2be1('0x4e')]=_['keys'](_0xdb225[_0x2be1('0x4e')]);_0x315346[_0x2be1('0x50')]=_[_0x2be1('0x51')](_0x315346[_0x2be1('0x52')],_0x315346[_0x2be1('0x4e')]);_0x471927[_0x2be1('0x53')]=_[_0x2be1('0x51')](_0x315346[_0x2be1('0x52')],qs[_0x2be1('0x54')](_0xdb225[_0x2be1('0x4e')][_0x2be1('0x54')]));_0x471927['attributes']=_0x471927['attributes'][_0x2be1('0x55')]?_0x471927[_0x2be1('0x53')]:_0x315346[_0x2be1('0x52')];_0x471927['order']=qs['sort'](_0xdb225[_0x2be1('0x4e')][_0x2be1('0x58')]);_0x471927[_0x2be1('0x5a')]=qs[_0x2be1('0x50')](_[_0x2be1('0x59')](_0xdb225[_0x2be1('0x4e')],_0x315346[_0x2be1('0x50')]));if(_0xdb225[_0x2be1('0x4e')][_0x2be1('0x43')]){_0x471927[_0x2be1('0x5a')]=_['merge'](_0x471927['where'],{'$or':_[_0x2be1('0xcb')](_0x471927[_0x2be1('0x53')],function(_0xb8a57c){var _0x4137d9={};_0x4137d9[_0xb8a57c]={'$like':'%'+_0xdb225[_0x2be1('0x4e')][_0x2be1('0x43')]+'%'};return _0x4137d9;})});}_0x471927=_[_0x2be1('0x5b')]({},_0x471927,_0xdb225['options']);return _0x296117[_0x2be1('0xd0')](_0x471927);}})[_0x2be1('0x25')](function(_0x175958){if(_0x175958){_0x1d829d=_0x175958['length'];if(!_0xdb225[_0x2be1('0x4e')][_0x2be1('0x56')](_0x2be1('0x57'))){_0x471927[_0x2be1('0x35')]=qs['limit'](_0xdb225[_0x2be1('0x4e')][_0x2be1('0x35')]);_0x471927[_0x2be1('0x34')]=qs[_0x2be1('0x34')](_0xdb225[_0x2be1('0x4e')][_0x2be1('0x34')]);}return _0x296117[_0x2be1('0xd0')](_0x471927);}})[_0x2be1('0x25')](function(_0x34f37b){if(_0x34f37b){return _0x34f37b?{'count':_0x1d829d,'rows':_0x34f37b}:null;}})[_0x2be1('0x25')](respondWithResult(_0x4a4ecb,null))[_0x2be1('0x30')](handleError(_0x4a4ecb,null));};exports[_0x2be1('0xd2')]=function(_0x1448a2,_0x22ec43,_0x209b9c){var _0x593291={'raw':!![],'where':{}};var _0x387c2c={};var _0x21925e={'count':0x0,'rows':[]};return db['User'][_0x2be1('0xa1')]({'where':{'id':_0x1448a2[_0x2be1('0x6e')]['id']}})[_0x2be1('0x25')](handleEntityNotFound(_0x22ec43,null))[_0x2be1('0x25')](function(_0x2972f3){if(_0x2972f3){_0x387c2c[_0x2be1('0x52')]=_[_0x2be1('0x4f')](db['VoiceRecording'][_0x2be1('0x4c')]);_0x387c2c[_0x2be1('0x4e')]=_[_0x2be1('0x4f')](_0x1448a2['query']);_0x387c2c[_0x2be1('0x50')]=_['intersection'](_0x387c2c[_0x2be1('0x52')],_0x387c2c[_0x2be1('0x4e')]);_0x593291[_0x2be1('0x53')]=_[_0x2be1('0x51')](_0x387c2c[_0x2be1('0x52')],qs[_0x2be1('0x54')](_0x1448a2['query'][_0x2be1('0x54')]));_0x593291[_0x2be1('0x53')]=_0x593291[_0x2be1('0x53')]['length']?_0x593291[_0x2be1('0x53')]:_0x387c2c['model'];if(!_0x1448a2[_0x2be1('0x4e')][_0x2be1('0x56')](_0x2be1('0x57'))){_0x593291[_0x2be1('0x35')]=qs[_0x2be1('0x35')](_0x1448a2[_0x2be1('0x4e')]['limit']);_0x593291[_0x2be1('0x34')]=qs['offset'](_0x1448a2['query'][_0x2be1('0x34')]);}_0x593291[_0x2be1('0xcf')]=qs[_0x2be1('0x58')](_0x1448a2['query'][_0x2be1('0x58')]);_0x593291['where']=qs[_0x2be1('0x50')](_['pick'](_0x1448a2['query'],_0x387c2c[_0x2be1('0x50')]));_0x593291[_0x2be1('0x5a')][_0x2be1('0xd3')]=_0x2972f3['id'];if(_0x1448a2[_0x2be1('0x4e')][_0x2be1('0x43')]){_0x593291[_0x2be1('0x5a')]=_['merge'](_0x593291[_0x2be1('0x5a')],{'$or':_[_0x2be1('0xcb')](_0x593291[_0x2be1('0x53')],function(_0x85ee3d){var _0x2ddf19={};_0x2ddf19[_0x85ee3d]={'$like':'%'+_0x1448a2['query'][_0x2be1('0x43')]+'%'};return _0x2ddf19;})});}_0x593291=_[_0x2be1('0x5b')]({},_0x593291,_0x1448a2[_0x2be1('0x62')]);return db['VoiceRecording']['count']({'where':_0x593291[_0x2be1('0x5a')]})[_0x2be1('0x25')](function(_0x257808){_0x21925e['count']=_0x257808;if(_0x1448a2['query'][_0x2be1('0x64')]){_0x593291[_0x2be1('0x65')]=[{'all':!![]}];}return db[_0x2be1('0xd4')][_0x2be1('0x66')](_0x593291);})[_0x2be1('0x25')](function(_0x583dc4){_0x21925e[_0x2be1('0x67')]=_0x583dc4;return _0x21925e;});}})[_0x2be1('0x25')](respondWithFilteredResult(_0x22ec43,_0x593291))['catch'](handleError(_0x22ec43,null));};exports[_0x2be1('0xd5')]=function(_0xceac97,_0x25c10a,_0x1d76ba){var _0x402159={'raw':!![],'where':{}};var _0xbda3dd={};var _0x585d4f={'count':0x0,'rows':[]};return db[_0x2be1('0x63')]['findOne']({'where':{'id':_0xceac97[_0x2be1('0x6e')]['id']}})[_0x2be1('0x25')](handleEntityNotFound(_0x25c10a,null))[_0x2be1('0x25')](function(_0x449d6a){if(_0x449d6a){_0xbda3dd['model']=_['keys'](db[_0x2be1('0xd6')][_0x2be1('0x4c')]);_0xbda3dd[_0x2be1('0x4e')]=_[_0x2be1('0x4f')](_0xceac97[_0x2be1('0x4e')]);_0xbda3dd[_0x2be1('0x50')]=_[_0x2be1('0x51')](_0xbda3dd[_0x2be1('0x52')],_0xbda3dd[_0x2be1('0x4e')]);_0x402159[_0x2be1('0x53')]=_[_0x2be1('0x51')](_0xbda3dd[_0x2be1('0x52')],qs[_0x2be1('0x54')](_0xceac97[_0x2be1('0x4e')][_0x2be1('0x54')]));_0x402159[_0x2be1('0x53')]=_0x402159[_0x2be1('0x53')][_0x2be1('0x55')]?_0x402159[_0x2be1('0x53')]:_0xbda3dd[_0x2be1('0x52')];if(!_0xceac97[_0x2be1('0x4e')]['hasOwnProperty']('nolimit')){_0x402159[_0x2be1('0x35')]=qs[_0x2be1('0x35')](_0xceac97[_0x2be1('0x4e')]['limit']);_0x402159[_0x2be1('0x34')]=qs[_0x2be1('0x34')](_0xceac97[_0x2be1('0x4e')][_0x2be1('0x34')]);}_0x402159[_0x2be1('0xcf')]=qs[_0x2be1('0x58')](_0xceac97[_0x2be1('0x4e')][_0x2be1('0x58')]);_0x402159[_0x2be1('0x5a')]=qs[_0x2be1('0x50')](_[_0x2be1('0x59')](_0xceac97[_0x2be1('0x4e')],_0xbda3dd[_0x2be1('0x50')]));_0x402159[_0x2be1('0x5a')][_0x2be1('0xd3')]=_0x449d6a['id'];if(_0xceac97[_0x2be1('0x4e')][_0x2be1('0x43')]){_0x402159[_0x2be1('0x5a')]=_[_0x2be1('0x5b')](_0x402159['where'],{'$or':_[_0x2be1('0xcb')](_0x402159[_0x2be1('0x53')],function(_0x957d26){var _0x4d63ac={};_0x4d63ac[_0x957d26]={'$like':'%'+_0xceac97['query']['filter']+'%'};return _0x4d63ac;})});}_0x402159=_[_0x2be1('0x5b')]({},_0x402159,_0xceac97[_0x2be1('0x62')]);return db['ScreenRecording'][_0x2be1('0x33')]({'where':_0x402159[_0x2be1('0x5a')]})[_0x2be1('0x25')](function(_0x4cdbbf){_0x585d4f[_0x2be1('0x33')]=_0x4cdbbf;if(_0xceac97[_0x2be1('0x4e')]['includeAll']){_0x402159[_0x2be1('0x65')]=[{'all':!![]}];}return db[_0x2be1('0xd6')][_0x2be1('0x66')](_0x402159);})[_0x2be1('0x25')](function(_0x1327a1){_0x585d4f[_0x2be1('0x67')]=_0x1327a1;return _0x585d4f;});}})[_0x2be1('0x25')](respondWithFilteredResult(_0x25c10a,_0x402159))[_0x2be1('0x30')](handleError(_0x25c10a,null));};exports['getChatInteractions']=function(_0x17244c,_0x56bbd6,_0x2c22ff){var _0x28f353={};var _0x3ac776={};var _0x3a9522;var _0x381ccc;return db['User'][_0x2be1('0xa1')]({'where':{'id':_0x17244c[_0x2be1('0x6e')]['id']}})[_0x2be1('0x25')](handleEntityNotFound(_0x56bbd6,null))['then'](function(_0x2383f7){if(_0x2383f7){_0x3a9522=_0x2383f7;_0x3ac776['model']=_[_0x2be1('0x4f')](db[_0x2be1('0xd7')][_0x2be1('0x4c')]);_0x3ac776[_0x2be1('0x4e')]=_[_0x2be1('0x4f')](_0x17244c['query']);_0x3ac776[_0x2be1('0x50')]=_[_0x2be1('0x51')](_0x3ac776[_0x2be1('0x52')],_0x3ac776['query']);_0x28f353[_0x2be1('0x53')]=_[_0x2be1('0x51')](_0x3ac776[_0x2be1('0x52')],qs[_0x2be1('0x54')](_0x17244c['query'][_0x2be1('0x54')]));_0x28f353[_0x2be1('0x53')]=_0x28f353['attributes'][_0x2be1('0x55')]?_0x28f353[_0x2be1('0x53')]:_0x3ac776['model'];_0x28f353[_0x2be1('0xcf')]=qs['sort'](_0x17244c[_0x2be1('0x4e')][_0x2be1('0x58')]);_0x28f353['where']=qs[_0x2be1('0x50')](_[_0x2be1('0x59')](_0x17244c[_0x2be1('0x4e')],_0x3ac776[_0x2be1('0x50')]));if(_0x17244c['query']['filter']){_0x28f353[_0x2be1('0x5a')]=_[_0x2be1('0x5b')](_0x28f353[_0x2be1('0x5a')],{'$or':_[_0x2be1('0xcb')](_0x28f353[_0x2be1('0x53')],function(_0x2e7705){var _0x1cd547={};_0x1cd547[_0x2e7705]={'$like':'%'+_0x17244c[_0x2be1('0x4e')][_0x2be1('0x43')]+'%'};return _0x1cd547;})});}_0x28f353=_[_0x2be1('0x5b')]({},_0x28f353,_0x17244c[_0x2be1('0x62')]);return _0x3a9522[_0x2be1('0xd8')](_0x28f353);}})[_0x2be1('0x25')](function(_0x52ec9f){if(_0x52ec9f){_0x381ccc=_0x52ec9f[_0x2be1('0x55')];if(!_0x17244c[_0x2be1('0x4e')][_0x2be1('0x56')](_0x2be1('0x57'))){_0x28f353[_0x2be1('0x35')]=qs[_0x2be1('0x35')](_0x17244c['query']['limit']);_0x28f353[_0x2be1('0x34')]=qs['offset'](_0x17244c[_0x2be1('0x4e')][_0x2be1('0x34')]);}return _0x3a9522[_0x2be1('0xd8')](_0x28f353);}})[_0x2be1('0x25')](function(_0x123cd6){if(_0x123cd6){return _0x123cd6?{'count':_0x381ccc,'rows':_0x123cd6}:null;}})[_0x2be1('0x25')](respondWithResult(_0x56bbd6,null))[_0x2be1('0x30')](handleError(_0x56bbd6,null));};exports['getOpenchannelInteractions']=function(_0x16f72f,_0x52e3f4,_0xfa8f5d){var _0x15e930={};var _0x5ef8ab={};var _0x57c2b8;var _0x29f1f6;return db[_0x2be1('0x63')][_0x2be1('0xa1')]({'where':{'id':_0x16f72f['params']['id']}})[_0x2be1('0x25')](handleEntityNotFound(_0x52e3f4,null))[_0x2be1('0x25')](function(_0x6fc11e){if(_0x6fc11e){_0x57c2b8=_0x6fc11e;_0x5ef8ab[_0x2be1('0x52')]=_[_0x2be1('0x4f')](db['OpenchannelInteraction'][_0x2be1('0x4c')]);_0x5ef8ab[_0x2be1('0x4e')]=_[_0x2be1('0x4f')](_0x16f72f[_0x2be1('0x4e')]);_0x5ef8ab[_0x2be1('0x50')]=_[_0x2be1('0x51')](_0x5ef8ab[_0x2be1('0x52')],_0x5ef8ab[_0x2be1('0x4e')]);_0x15e930[_0x2be1('0x53')]=_['intersection'](_0x5ef8ab['model'],qs[_0x2be1('0x54')](_0x16f72f[_0x2be1('0x4e')][_0x2be1('0x54')]));_0x15e930[_0x2be1('0x53')]=_0x15e930[_0x2be1('0x53')][_0x2be1('0x55')]?_0x15e930[_0x2be1('0x53')]:_0x5ef8ab['model'];_0x15e930[_0x2be1('0xcf')]=qs[_0x2be1('0x58')](_0x16f72f[_0x2be1('0x4e')][_0x2be1('0x58')]);_0x15e930[_0x2be1('0x5a')]=qs[_0x2be1('0x50')](_['pick'](_0x16f72f[_0x2be1('0x4e')],_0x5ef8ab[_0x2be1('0x50')]));if(_0x16f72f[_0x2be1('0x4e')]['filter']){_0x15e930[_0x2be1('0x5a')]=_[_0x2be1('0x5b')](_0x15e930[_0x2be1('0x5a')],{'$or':_[_0x2be1('0xcb')](_0x15e930[_0x2be1('0x53')],function(_0x3c1a27){var _0x3099c2={};_0x3099c2[_0x3c1a27]={'$like':'%'+_0x16f72f[_0x2be1('0x4e')][_0x2be1('0x43')]+'%'};return _0x3099c2;})});}_0x15e930=_[_0x2be1('0x5b')]({},_0x15e930,_0x16f72f[_0x2be1('0x62')]);return _0x57c2b8[_0x2be1('0xd9')](_0x15e930);}})[_0x2be1('0x25')](function(_0x2adec8){if(_0x2adec8){_0x29f1f6=_0x2adec8[_0x2be1('0x55')];if(!_0x16f72f[_0x2be1('0x4e')][_0x2be1('0x56')](_0x2be1('0x57'))){_0x15e930[_0x2be1('0x35')]=qs[_0x2be1('0x35')](_0x16f72f['query'][_0x2be1('0x35')]);_0x15e930[_0x2be1('0x34')]=qs[_0x2be1('0x34')](_0x16f72f[_0x2be1('0x4e')][_0x2be1('0x34')]);}return _0x57c2b8[_0x2be1('0xd9')](_0x15e930);}})[_0x2be1('0x25')](function(_0x1eef59){if(_0x1eef59){return _0x1eef59?{'count':_0x29f1f6,'rows':_0x1eef59}:null;}})['then'](respondWithResult(_0x52e3f4,null))[_0x2be1('0x30')](handleError(_0x52e3f4,null));};exports[_0x2be1('0xda')]=function(_0x242ed,_0x3768b3,_0x3404d7){var _0x38c6f9={'raw':!![],'where':{}};var _0x4435e2={};var _0x27d614={'count':0x0,'rows':[]};return db[_0x2be1('0x63')]['findOne']({'where':{'id':_0x242ed[_0x2be1('0x6e')]['id']}})[_0x2be1('0x25')](handleEntityNotFound(_0x3768b3,null))['then'](function(_0x10aaf0){if(_0x10aaf0){_0x4435e2[_0x2be1('0x52')]=_[_0x2be1('0x4f')](db[_0x2be1('0xdb')][_0x2be1('0x4c')]);_0x4435e2[_0x2be1('0x4e')]=_[_0x2be1('0x4f')](_0x242ed[_0x2be1('0x4e')]);_0x4435e2[_0x2be1('0x50')]=_[_0x2be1('0x51')](_0x4435e2['model'],_0x4435e2[_0x2be1('0x4e')]);_0x38c6f9[_0x2be1('0x53')]=_[_0x2be1('0x51')](_0x4435e2[_0x2be1('0x52')],qs[_0x2be1('0x54')](_0x242ed[_0x2be1('0x4e')][_0x2be1('0x54')]));_0x38c6f9[_0x2be1('0x53')]=_0x38c6f9[_0x2be1('0x53')]['length']?_0x38c6f9['attributes']:_0x4435e2[_0x2be1('0x52')];if(!_0x242ed['query']['hasOwnProperty']('nolimit')){_0x38c6f9['limit']=qs['limit'](_0x242ed['query'][_0x2be1('0x35')]);_0x38c6f9[_0x2be1('0x34')]=qs[_0x2be1('0x34')](_0x242ed['query'][_0x2be1('0x34')]);}_0x38c6f9[_0x2be1('0xcf')]=qs[_0x2be1('0x58')](_0x242ed[_0x2be1('0x4e')][_0x2be1('0x58')]);_0x38c6f9[_0x2be1('0x5a')]=qs['filters'](_[_0x2be1('0x59')](_0x242ed[_0x2be1('0x4e')],_0x4435e2[_0x2be1('0x50')]));_0x38c6f9['where'][_0x2be1('0xd3')]=_0x10aaf0['id'];if(_0x242ed['query'][_0x2be1('0x43')]){_0x38c6f9[_0x2be1('0x5a')]=_[_0x2be1('0x5b')](_0x38c6f9[_0x2be1('0x5a')],{'$or':_[_0x2be1('0xcb')](_0x38c6f9[_0x2be1('0x53')],function(_0x1ea1d2){var _0x26adcb={};_0x26adcb[_0x1ea1d2]={'$like':'%'+_0x242ed['query'][_0x2be1('0x43')]+'%'};return _0x26adcb;})});}_0x38c6f9=_[_0x2be1('0x5b')]({},_0x38c6f9,_0x242ed[_0x2be1('0x62')]);return db[_0x2be1('0xdb')]['count']({'where':_0x38c6f9['where']})[_0x2be1('0x25')](function(_0x51051d){_0x27d614['count']=_0x51051d;if(_0x242ed[_0x2be1('0x4e')][_0x2be1('0x64')]){_0x38c6f9[_0x2be1('0x65')]=[{'all':!![]}];}return db[_0x2be1('0xdb')][_0x2be1('0x66')](_0x38c6f9);})[_0x2be1('0x25')](function(_0x55f368){_0x27d614[_0x2be1('0x67')]=_0x55f368;return _0x27d614;});}})['then'](respondWithFilteredResult(_0x3768b3,_0x38c6f9))[_0x2be1('0x30')](handleError(_0x3768b3,null));};exports[_0x2be1('0xdc')]=function(_0x206ebc,_0x15293b,_0x31b784){var _0x3d0324={};var _0x420ca0={};var _0x26f580;var _0x53d782;return db[_0x2be1('0x63')][_0x2be1('0xa1')]({'where':{'id':_0x206ebc[_0x2be1('0x6e')]['id']}})[_0x2be1('0x25')](handleEntityNotFound(_0x15293b,null))['then'](function(_0x412c8b){if(_0x412c8b){_0x26f580=_0x412c8b;_0x420ca0[_0x2be1('0x52')]=_[_0x2be1('0x4f')](db[_0x2be1('0xdd')]['rawAttributes']);_0x420ca0['query']=_[_0x2be1('0x4f')](_0x206ebc[_0x2be1('0x4e')]);_0x420ca0[_0x2be1('0x50')]=_[_0x2be1('0x51')](_0x420ca0[_0x2be1('0x52')],_0x420ca0[_0x2be1('0x4e')]);_0x3d0324[_0x2be1('0x53')]=_[_0x2be1('0x51')](_0x420ca0['model'],qs[_0x2be1('0x54')](_0x206ebc[_0x2be1('0x4e')][_0x2be1('0x54')]));_0x3d0324[_0x2be1('0x53')]=_0x3d0324['attributes']['length']?_0x3d0324['attributes']:_0x420ca0['model'];_0x3d0324[_0x2be1('0xcf')]=qs[_0x2be1('0x58')](_0x206ebc[_0x2be1('0x4e')][_0x2be1('0x58')]);_0x3d0324[_0x2be1('0x5a')]=qs[_0x2be1('0x50')](_[_0x2be1('0x59')](_0x206ebc[_0x2be1('0x4e')],_0x420ca0[_0x2be1('0x50')]));if(_0x206ebc[_0x2be1('0x4e')]['filter']){_0x3d0324[_0x2be1('0x5a')]=_['merge'](_0x3d0324['where'],{'$or':_[_0x2be1('0xcb')](_0x3d0324[_0x2be1('0x53')],function(_0x250b8d){var _0xebe9ae={};_0xebe9ae[_0x250b8d]={'$like':'%'+_0x206ebc[_0x2be1('0x4e')]['filter']+'%'};return _0xebe9ae;})});}_0x3d0324=_[_0x2be1('0x5b')]({},_0x3d0324,_0x206ebc[_0x2be1('0x62')]);return _0x26f580['getSmsInteractions'](_0x3d0324);}})[_0x2be1('0x25')](function(_0x47e43c){if(_0x47e43c){_0x53d782=_0x47e43c[_0x2be1('0x55')];if(!_0x206ebc['query'][_0x2be1('0x56')](_0x2be1('0x57'))){_0x3d0324['limit']=qs['limit'](_0x206ebc['query']['limit']);_0x3d0324['offset']=qs[_0x2be1('0x34')](_0x206ebc['query'][_0x2be1('0x34')]);}return _0x26f580[_0x2be1('0xdc')](_0x3d0324);}})[_0x2be1('0x25')](function(_0x245b20){if(_0x245b20){return _0x245b20?{'count':_0x53d782,'rows':_0x245b20}:null;}})[_0x2be1('0x25')](respondWithResult(_0x15293b,null))[_0x2be1('0x30')](handleError(_0x15293b,null));};exports[_0x2be1('0xde')]=function(_0x29031b,_0x4695b6,_0x56febe){var _0x33f30d={};var _0x4d09a6={};var _0x451969;var _0x38d8ca;return db['User'][_0x2be1('0xa1')]({'where':{'id':_0x29031b[_0x2be1('0x6e')]['id']}})[_0x2be1('0x25')](handleEntityNotFound(_0x4695b6,null))['then'](function(_0x4f070f){if(_0x4f070f){_0x451969=_0x4f070f;_0x4d09a6[_0x2be1('0x52')]=_[_0x2be1('0x4f')](db[_0x2be1('0xdf')][_0x2be1('0x4c')]);_0x4d09a6[_0x2be1('0x4e')]=_['keys'](_0x29031b['query']);_0x4d09a6[_0x2be1('0x50')]=_[_0x2be1('0x51')](_0x4d09a6[_0x2be1('0x52')],_0x4d09a6[_0x2be1('0x4e')]);_0x33f30d[_0x2be1('0x53')]=_[_0x2be1('0x51')](_0x4d09a6[_0x2be1('0x52')],qs[_0x2be1('0x54')](_0x29031b[_0x2be1('0x4e')][_0x2be1('0x54')]));_0x33f30d[_0x2be1('0x53')]=_0x33f30d['attributes']['length']?_0x33f30d[_0x2be1('0x53')]:_0x4d09a6[_0x2be1('0x52')];_0x33f30d[_0x2be1('0xcf')]=qs['sort'](_0x29031b['query']['sort']);_0x33f30d[_0x2be1('0x5a')]=qs[_0x2be1('0x50')](_[_0x2be1('0x59')](_0x29031b[_0x2be1('0x4e')],_0x4d09a6['filters']));if(_0x29031b[_0x2be1('0x4e')][_0x2be1('0x43')]){_0x33f30d[_0x2be1('0x5a')]=_[_0x2be1('0x5b')](_0x33f30d[_0x2be1('0x5a')],{'$or':_[_0x2be1('0xcb')](_0x33f30d['attributes'],function(_0x1110f8){var _0x478f6d={};_0x478f6d[_0x1110f8]={'$like':'%'+_0x29031b['query'][_0x2be1('0x43')]+'%'};return _0x478f6d;})});}_0x33f30d=_['merge']({},_0x33f30d,_0x29031b[_0x2be1('0x62')]);return _0x451969['getFaxInteractions'](_0x33f30d);}})['then'](function(_0xb8c34){if(_0xb8c34){_0x38d8ca=_0xb8c34['length'];if(!_0x29031b['query'][_0x2be1('0x56')]('nolimit')){_0x33f30d[_0x2be1('0x35')]=qs['limit'](_0x29031b[_0x2be1('0x4e')][_0x2be1('0x35')]);_0x33f30d[_0x2be1('0x34')]=qs[_0x2be1('0x34')](_0x29031b[_0x2be1('0x4e')][_0x2be1('0x34')]);}return _0x451969['getFaxInteractions'](_0x33f30d);}})[_0x2be1('0x25')](function(_0x48dddd){if(_0x48dddd){return _0x48dddd?{'count':_0x38d8ca,'rows':_0x48dddd}:null;}})['then'](respondWithResult(_0x4695b6,null))['catch'](handleError(_0x4695b6,null));};exports[_0x2be1('0xe0')]=function(_0x48c877,_0x3f4a8b,_0x29cc9f){var _0xd20f88;var _0x3280e2;var _0x1c61e;var _0x215525=!_[_0x2be1('0x77')](_0x48c877[_0x2be1('0x6e')]['id'])?_0x48c877[_0x2be1('0x6e')]['id']:!_[_0x2be1('0x77')](_0x48c877[_0x2be1('0x3e')]['id'])?_0x48c877[_0x2be1('0x3e')]['id']:null;return db['User']['find']({'where':{'id':_0x215525,'role':'agent'},'attributes':['id',_0x2be1('0x48'),_0x2be1('0xe1'),_0x2be1('0xe2'),_0x2be1('0x47'),_0x2be1('0x79'),_0x2be1('0xa5')]})[_0x2be1('0x25')](handleEntityNotFound(_0x3f4a8b,null))[_0x2be1('0x25')](function(_0x2481f3){if(_0x2481f3){_0xd20f88=_0x2481f3;if(_0x48c877[_0x2be1('0x6d')][_0x2be1('0xa7')]){_0x1c61e=util[_0x2be1('0x78')](_0x2be1('0xe3'),_0xd20f88[_0x48c877[_0x2be1('0x6d')][_0x2be1('0xa7')]]);}else if(_0x48c877['body'][_0x2be1('0xe4')]){_0x1c61e=util['format'](_0x2be1('0xb3'),_0x48c877['body']['intrf']);}else{_0x1c61e=util[_0x2be1('0x78')](_0x2be1('0xb3'),_0xd20f88[_0x2be1('0x48')]);}socket['to'](util['format'](_0x2be1('0xe5'),_0xd20f88[_0x2be1('0x48')]))['emit']('user:forcelogout',{'ip':_0x48c877['headers'][_0x2be1('0xe6')]||_0x48c877[_0x2be1('0xe7')][_0x2be1('0xe8')]||_0x48c877[_0x2be1('0xe9')]['remoteAddress']||_0x48c877[_0x2be1('0xe7')]['socket'][_0x2be1('0xe8')]});return db['UserVoiceQueueRt'][_0x2be1('0x3c')]({'where':{'membername':_0xd20f88[_0x2be1('0x48')]},'individualHooks':!![]});}})[_0x2be1('0x25')](function(_0x1e746a){if(_0xd20f88){return _0xd20f88[_0x2be1('0xea')]({'raw':!![]});}})['then'](function(_0xa75ae6){var _0x13edeb=[];if(_0xa75ae6){_0x3280e2=_0xa75ae6;if(_0x3280e2[_0x2be1('0x55')]){for(var _0x12aecb=0x0;_0x12aecb<_0x3280e2[_0x2be1('0x55')];_0x12aecb++){_0x13edeb[_0x2be1('0xeb')]({'membername':_0xd20f88[_0x2be1('0x48')],'UserId':_0xd20f88['id'],'queue_name':_0x3280e2[_0x12aecb]['name'],'VoiceQueueId':_0x3280e2[_0x12aecb]['id'],'interface':_0x1c61e,'paused':_0xd20f88[_0x2be1('0xa5')]||![],'penalty':_0x3280e2[_0x12aecb][_0x2be1('0xec')]||0x0});}return BPromise['each'](_0x13edeb,function(_0x244ceb){return db['UserVoiceQueueRt'][_0x2be1('0xb7')](_0x244ceb);});}}})[_0x2be1('0x25')](function(){return db[_0x2be1('0xed')][_0x2be1('0x66')]({'where':{'membername':_0xd20f88[_0x2be1('0x48')],'exitAt':null}});})[_0x2be1('0x25')](function(_0x593b64){var _0x55ea80=[];_0x593b64[_0x2be1('0xee')](function(_0x20316e){_0x55ea80['push'](_0x20316e['update']({'exitAt':moment()[_0x2be1('0x78')](_0x2be1('0xef'))}));});return BPromise['all'](_0x55ea80);})[_0x2be1('0x25')](function(){var _0x2568e4=[];var _0x2ea5ff=[];var _0x15425d=utils[_0x2be1('0xf0')]();var _0x89db2f={'membername':_0xd20f88[_0x2be1('0x48')],'interface':_0x1c61e,'enterAt':moment()['format'](_0x2be1('0xef')),'role':_0xd20f88[_0x2be1('0x47')],'internal':_0xd20f88[_0x2be1('0x79')]};_0x15425d[_0x2be1('0xee')](function(_0x4c0557){_0x2568e4['push'](_[_0x2be1('0x5b')]({'channel':_0x4c0557,'type':_0x2be1('0xf1'),'data1':_0x48c877[_0x2be1('0x6d')][_0x2be1('0xf2')],'data2':_0x1c61e},_0x89db2f));if(_0xd20f88['loginInPause']){_0x2ea5ff[_0x2be1('0xeb')](_[_0x2be1('0x5b')]({'channel':_0x4c0557,'type':_0x2be1('0xf3'),'data1':_0x2be1('0xf4')},_0x89db2f));}});return db[_0x2be1('0xed')]['bulkCreate'](_0x2568e4[_0x2be1('0xf5')](_0x2ea5ff),{'individualHooks':!![]});})[_0x2be1('0x25')](function(){return _0xd20f88[_0x2be1('0x3b')]({'online':!![],'lastLoginAt':moment()[_0x2be1('0x78')](_0x2be1('0xef')),'voicePause':_0xd20f88[_0x2be1('0xa5')]||![],'mailPause':_0xd20f88[_0x2be1('0xa5')]||![],'chatPause':_0xd20f88[_0x2be1('0xa5')]||![],'faxPause':_0xd20f88[_0x2be1('0xa5')]||![],'smsPause':_0xd20f88['loginInPause']||![],'openchannelPause':_0xd20f88[_0x2be1('0xa5')]||![],'pauseType':_0xd20f88['loginInPause']?_0x2be1('0xf4'):null,'interface':_0x1c61e,'lastPauseAt':moment()[_0x2be1('0x78')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x2be1('0x25')](function(_0x18ab45){if(_0x48c877[_0x2be1('0xf6')]){return _0x29cc9f();}else{return BPromise[_0x2be1('0xf7')](_0x18ab45)[_0x2be1('0x25')](respondWithResult(_0x3f4a8b,null));}})['catch'](handleError(_0x3f4a8b,null));};exports['logout']=function(_0x1988d3,_0x63d2bf,_0x59db5a){var _0xc8d1;return db[_0x2be1('0x63')][_0x2be1('0x6b')]({'where':{'id':_0x1988d3[_0x2be1('0x6e')]['id'],'role':_0x2be1('0x40')},'attributes':['id',_0x2be1('0x48'),_0x2be1('0x47')]})[_0x2be1('0x25')](handleEntityNotFound(_0x63d2bf,null))[_0x2be1('0x25')](function(_0x24db79){if(_0x24db79){_0xc8d1=_0x24db79;return db[_0x2be1('0xb6')][_0x2be1('0x3c')]({'where':{'membername':_0xc8d1[_0x2be1('0x48')]},'individualHooks':!![]});}})['then'](function(){return db[_0x2be1('0xed')][_0x2be1('0x66')]({'where':{'membername':_0xc8d1[_0x2be1('0x48')],'exitAt':null}});})['then'](function(_0x219a18){var _0x5c5d66=[];_0x219a18[_0x2be1('0xee')](function(_0x3cfdd3){_0x5c5d66[_0x2be1('0xeb')](_0x3cfdd3[_0x2be1('0x3b')]({'exitAt':moment()[_0x2be1('0x78')](_0x2be1('0xef'))}));});return BPromise[_0x2be1('0xf8')](_0x5c5d66);})[_0x2be1('0x25')](function(){return _0xc8d1[_0x2be1('0x3b')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})[_0x2be1('0x25')](respondWithResult(_0x63d2bf,null))[_0x2be1('0x30')](handleError(_0x63d2bf,null));};exports['pause']=function(_0x371244,_0x34fb6a,_0x2c5984){var _0x164fa5;return db['UserVoiceQueueRt'][_0x2be1('0x3b')]({'paused':0x1},{'where':{'UserId':_0x371244[_0x2be1('0x6e')]['id']},'individualHooks':!![]})[_0x2be1('0x25')](function(){return db[_0x2be1('0x63')][_0x2be1('0x6b')]({'where':{'id':_0x371244['params']['id'],'role':_0x2be1('0x40')},'attributes':['id',_0x2be1('0x48'),_0x2be1('0x47'),_0x2be1('0x79'),_0x2be1('0xa7')]});})['then'](handleEntityNotFound(_0x34fb6a,null))[_0x2be1('0x25')](function(_0xb6a913){if(_0xb6a913){_0x164fa5=_0xb6a913;return respondWithRpcPromise(_0x2be1('0xf9'),'pause',{'id':_0x164fa5['id'],'name':_0x164fa5[_0x2be1('0x48')],'pause':!![]});}})[_0x2be1('0x25')](function(){if(_0x164fa5){return db[_0x2be1('0xed')]['findAll']({'where':{'membername':_0x164fa5['name'],'type':'PAUSE','exitAt':null}});}})[_0x2be1('0x25')](function(_0x3a6600){if(_0x3a6600[_0x2be1('0x55')]){var _0x12adc7=moment()[_0x2be1('0x78')](_0x2be1('0xef'));for(var _0x580a04=0x0,_0x101af0=_0x3a6600['length'];_0x580a04<_0x101af0;_0x580a04++){_0x3a6600[_0x580a04][_0x2be1('0xfa')]({'exitAt':_0x12adc7});}}})['then'](function(){var _0x20793f=[];var _0x2c52d2=utils[_0x2be1('0xf0')]();_0x2c52d2['forEach'](function(_0x5ea89c){_0x20793f['push']({'channel':_0x5ea89c,'membername':_0x164fa5['name'],'interface':_[_0x2be1('0x77')](_0x164fa5[_0x2be1('0xa7')])?util[_0x2be1('0x78')](_0x2be1('0xb3'),_0x164fa5['name']):_0x164fa5[_0x2be1('0xa7')],'type':_0x2be1('0xf3'),'enterAt':moment()[_0x2be1('0x78')](_0x2be1('0xef')),'data1':_0x371244[_0x2be1('0x6d')]['type']||_0x2be1('0xfb'),'role':_0x164fa5[_0x2be1('0x47')],'internal':_0x164fa5[_0x2be1('0x79')]});});return db[_0x2be1('0xed')][_0x2be1('0x6c')](_0x20793f,{'individualHooks':!![]});})[_0x2be1('0x25')](function(){return _0x164fa5[_0x2be1('0x3b')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x371244[_0x2be1('0x6d')]['type']||_0x2be1('0xfb'),'lastPauseAt':moment()[_0x2be1('0x78')](_0x2be1('0xef'))});})[_0x2be1('0x25')](respondWithResult(_0x34fb6a,null))[_0x2be1('0x30')](handleError(_0x34fb6a,null));};exports['unpause']=function(_0x4e92f0,_0x424800,_0x251ce8){var _0x3c0205;return db['User'][_0x2be1('0x6b')]({'where':{'id':_0x4e92f0[_0x2be1('0x6e')]['id']},'attributes':['id',_0x2be1('0x48'),_0x2be1('0x47'),_0x2be1('0xa6'),_0x2be1('0xfc'),_0x2be1('0xfd'),'faxPause',_0x2be1('0xfe'),_0x2be1('0xff'),'pauseType','lastPauseAt']})[_0x2be1('0x25')](handleEntityNotFound(_0x424800,null))[_0x2be1('0x25')](function(_0x4cee94){if(_0x4cee94){_0x3c0205=_0x4cee94;if(_0x4e92f0[_0x2be1('0x6d')]['channel']&&!utils[_0x2be1('0xa8')](_0x4e92f0[_0x2be1('0x6d')][_0x2be1('0xa3')])){throw new db[(_0x2be1('0x98'))]['ValidationError'](_0x2be1('0xa9'));}switch(_0x4e92f0[_0x2be1('0x6d')][_0x2be1('0xa3')]){case _0x2be1('0xb2'):return respondWithRpcPromise(_0x2be1('0xf9'),'unpause',{'id':_0x3c0205['id'],'name':_0x3c0205['name'],'pause':![]})[_0x2be1('0x25')](function(){return db[_0x2be1('0xb6')][_0x2be1('0x3b')]({'paused':0x0},{'where':{'UserId':_0x3c0205['id']},'individualHooks':!![]});})['then'](function(){return db[_0x2be1('0xed')]['find']({'where':{'channel':_0x4e92f0[_0x2be1('0x6d')][_0x2be1('0xa3')],'membername':_0x3c0205[_0x2be1('0x48')],'type':_0x2be1('0xf3'),'exitAt':null}});})[_0x2be1('0x25')](function(_0x421944){if(_0x421944){return _0x421944[_0x2be1('0x3b')]({'exitAt':moment()[_0x2be1('0x78')](_0x2be1('0xef')),'data2':_0x2be1('0x100')},{'individualHooks':!![]});}return null;})[_0x2be1('0x25')](function(){return _0x3c0205['update']({'voicePause':![]});});case _0x2be1('0x101'):case _0x2be1('0x102'):case _0x2be1('0x103'):case _0x2be1('0x104'):case'openchannel':return db[_0x2be1('0xed')][_0x2be1('0x6b')]({'where':{'channel':_0x4e92f0[_0x2be1('0x6d')][_0x2be1('0xa3')],'membername':_0x3c0205[_0x2be1('0x48')],'type':_0x2be1('0xf3'),'exitAt':null}})[_0x2be1('0x25')](function(_0x5b6118){if(_0x5b6118){return _0x5b6118[_0x2be1('0x3b')]({'exitAt':moment()[_0x2be1('0x78')](_0x2be1('0xef')),'data2':_0x2be1('0x100')},{'individualHooks':!![]});}return null;})[_0x2be1('0x25')](function(){var _0x3696db={};_['set'](_0x3696db,util[_0x2be1('0x78')](_0x2be1('0x105'),_0x4e92f0['body'][_0x2be1('0xa3')],_0x2be1('0x106')),![]);return _0x3c0205[_0x2be1('0x3b')](_0x3696db);});default:return respondWithRpcPromise(_0x2be1('0xf9'),_0x2be1('0x107'),{'id':_0x3c0205['id'],'name':_0x3c0205[_0x2be1('0x48')],'pause':![]})[_0x2be1('0x25')](function(){return db[_0x2be1('0xb6')][_0x2be1('0x3b')]({'paused':0x0},{'where':{'UserId':_0x3c0205['id']}});})[_0x2be1('0x25')](function(){return db['MemberReport'][_0x2be1('0x66')]({'where':{'membername':_0x3c0205[_0x2be1('0x48')],'type':'PAUSE','exitAt':null}});})['then'](function(_0x32078e){var _0x39d4bf=[];_0x32078e[_0x2be1('0xee')](function(_0x214e8d){_0x39d4bf[_0x2be1('0xeb')](_0x214e8d[_0x2be1('0x3b')]({'exitAt':moment()[_0x2be1('0x78')](_0x2be1('0xef')),'data2':_0x2be1('0x100')}));});return BPromise[_0x2be1('0xf8')](_0x39d4bf);})['then'](function(){return _0x3c0205[_0x2be1('0x3b')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})['then'](respondWithResult(_0x424800,null))['catch'](handleError(_0x424800,null));};exports[_0x2be1('0x108')]=function(_0x5a3c0d,_0x258d85,_0x1b0cad){var _0x41f28e={};var _0x6675d={};var _0x5eabc2;var _0x2b2b7c;return db['User']['findOne']({'where':{'id':_0x5a3c0d[_0x2be1('0x6e')]['id']}})['then'](handleEntityNotFound(_0x258d85,null))['then'](function(_0x2ee1a9){if(_0x2ee1a9){_0x5eabc2=_0x2ee1a9;_0x6675d[_0x2be1('0x52')]=_[_0x2be1('0x4f')](db[_0x2be1('0x109')][_0x2be1('0x4c')]);_0x6675d['query']=_['keys'](_0x5a3c0d['query']);_0x6675d[_0x2be1('0x50')]=_['intersection'](_0x6675d[_0x2be1('0x52')],_0x6675d[_0x2be1('0x4e')]);_0x41f28e[_0x2be1('0x53')]=_[_0x2be1('0x51')](_0x6675d['model'],qs['fields'](_0x5a3c0d[_0x2be1('0x4e')][_0x2be1('0x54')]));_0x41f28e[_0x2be1('0x53')]=_0x41f28e[_0x2be1('0x53')][_0x2be1('0x55')]?_0x41f28e[_0x2be1('0x53')]:_0x6675d[_0x2be1('0x52')];_0x41f28e[_0x2be1('0xcf')]=qs[_0x2be1('0x58')](_0x5a3c0d[_0x2be1('0x4e')][_0x2be1('0x58')]);_0x41f28e[_0x2be1('0x5a')]=qs[_0x2be1('0x50')](_[_0x2be1('0x59')](_0x5a3c0d['query'],_0x6675d[_0x2be1('0x50')]));if(_0x5a3c0d['query']['filter']){_0x41f28e[_0x2be1('0x5a')]=_[_0x2be1('0x5b')](_0x41f28e[_0x2be1('0x5a')],{'$or':_['map'](_0x41f28e['attributes'],function(_0x9986b7){var _0x251682={};_0x251682[_0x9986b7]={'$like':'%'+_0x5a3c0d[_0x2be1('0x4e')][_0x2be1('0x43')]+'%'};return _0x251682;})});}_0x41f28e=_[_0x2be1('0x5b')]({},_0x41f28e,_0x5a3c0d[_0x2be1('0x62')]);return _0x5eabc2[_0x2be1('0x108')](_0x41f28e);}})[_0x2be1('0x25')](function(_0x46448d){if(_0x46448d){_0x2b2b7c=_0x46448d[_0x2be1('0x55')];if(!_0x5a3c0d['query']['hasOwnProperty'](_0x2be1('0x57'))){_0x41f28e[_0x2be1('0x35')]=qs[_0x2be1('0x35')](_0x5a3c0d[_0x2be1('0x4e')][_0x2be1('0x35')]);_0x41f28e[_0x2be1('0x34')]=qs[_0x2be1('0x34')](_0x5a3c0d[_0x2be1('0x4e')]['offset']);}return _0x5eabc2[_0x2be1('0x108')](_0x41f28e);}})[_0x2be1('0x25')](function(_0x596320){if(_0x596320){return _0x596320?{'count':_0x2b2b7c,'rows':_0x596320}:null;}})[_0x2be1('0x25')](respondWithResult(_0x258d85,null))[_0x2be1('0x30')](handleError(_0x258d85,null));};exports['addTeams']=function(_0x4633b3,_0x3b44cc,_0x50da2a){return db[_0x2be1('0x63')][_0x2be1('0x6b')]({'where':{'id':_0x4633b3[_0x2be1('0x6e')]['id']}})[_0x2be1('0x25')](handleEntityNotFound(_0x3b44cc,null))[_0x2be1('0x25')](function(_0x2edbdf){if(_0x2edbdf){return _0x2edbdf[_0x2be1('0x10a')](_0x4633b3['body'][_0x2be1('0x71')],_[_0x2be1('0x10b')](_0x4633b3[_0x2be1('0x6d')],[_0x2be1('0x71'),'id'])||{});}})['then'](respondWithResult(_0x3b44cc,null))[_0x2be1('0x30')](handleError(_0x3b44cc,null));};exports[_0x2be1('0x10c')]=function(_0x3eaf7e,_0xa6b047,_0xe46ee1){return db[_0x2be1('0x63')]['find']({'where':{'id':_0x3eaf7e[_0x2be1('0x6e')]['id']}})['then'](handleEntityNotFound(_0xa6b047,null))['then'](function(_0xa60994){if(_0xa60994){return _0xa60994[_0x2be1('0x10c')](_0x3eaf7e[_0x2be1('0x4e')]['ids']);}})['then'](respondWithStatusCode(_0xa6b047,null))['catch'](handleError(_0xa6b047,null));};exports[_0x2be1('0x10d')]=function(_0x5e40e0,_0x53783f,_0x2cd339){var _0x217c0c={};var _0xb51d0b={};var _0x15dc02;var _0x12883f;return db[_0x2be1('0x63')][_0x2be1('0xa1')]({'where':{'id':_0x5e40e0[_0x2be1('0x6e')]['id']}})[_0x2be1('0x25')](handleEntityNotFound(_0x53783f,null))[_0x2be1('0x25')](function(_0x30e44e){if(_0x30e44e){_0x15dc02=_0x30e44e;_0xb51d0b[_0x2be1('0x52')]=_[_0x2be1('0x4f')](db[_0x2be1('0xc8')][_0x2be1('0x4c')]);_0xb51d0b[_0x2be1('0x4e')]=_['keys'](_0x5e40e0[_0x2be1('0x4e')]);_0xb51d0b[_0x2be1('0x50')]=_[_0x2be1('0x51')](_0xb51d0b['model'],_0xb51d0b[_0x2be1('0x4e')]);_0x217c0c[_0x2be1('0x53')]=_[_0x2be1('0x51')](_0xb51d0b['model'],qs[_0x2be1('0x54')](_0x5e40e0[_0x2be1('0x4e')]['fields']));_0x217c0c[_0x2be1('0x53')]=_0x217c0c[_0x2be1('0x53')]['length']?_0x217c0c[_0x2be1('0x53')]:_0xb51d0b[_0x2be1('0x52')];_0x217c0c['order']=qs['sort'](_0x5e40e0[_0x2be1('0x4e')][_0x2be1('0x58')]);_0x217c0c[_0x2be1('0x5a')]=qs[_0x2be1('0x50')](_[_0x2be1('0x59')](_0x5e40e0[_0x2be1('0x4e')],_0xb51d0b['filters']));if(_0x5e40e0[_0x2be1('0x4e')][_0x2be1('0x43')]){_0x217c0c[_0x2be1('0x5a')]=_[_0x2be1('0x5b')](_0x217c0c[_0x2be1('0x5a')],{'$or':_[_0x2be1('0xcb')](_0x217c0c['attributes'],function(_0x58a604){var _0x2a66bf={};_0x2a66bf[_0x58a604]={'$like':'%'+_0x5e40e0[_0x2be1('0x4e')][_0x2be1('0x43')]+'%'};return _0x2a66bf;})});}_0x217c0c=_['merge']({},_0x217c0c,_0x5e40e0[_0x2be1('0x62')]);return _0x15dc02[_0x2be1('0x10d')](_0x217c0c);}})[_0x2be1('0x25')](function(_0x5be11f){if(_0x5be11f){_0x12883f=_0x5be11f[_0x2be1('0x55')];if(!_0x5e40e0['query'][_0x2be1('0x56')]('nolimit')){_0x217c0c['limit']=qs[_0x2be1('0x35')](_0x5e40e0[_0x2be1('0x4e')]['limit']);_0x217c0c[_0x2be1('0x34')]=qs[_0x2be1('0x34')](_0x5e40e0[_0x2be1('0x4e')][_0x2be1('0x34')]);}return _0x15dc02[_0x2be1('0x10d')](_0x217c0c);}})[_0x2be1('0x25')](function(_0x41af){if(_0x41af){return _0x41af?{'count':_0x12883f,'rows':_0x41af}:null;}})['then'](respondWithResult(_0x53783f,null))['catch'](handleError(_0x53783f,null));};exports[_0x2be1('0x10e')]=function(_0x101915,_0xb75f4c,_0x5291cb){var _0x3c16f4={};var _0x59cead={};var _0x4c6f55;var _0x55b272;return db[_0x2be1('0x63')]['findOne']({'where':{'id':_0x101915[_0x2be1('0x6e')]['id']}})[_0x2be1('0x25')](handleEntityNotFound(_0xb75f4c,null))[_0x2be1('0x25')](function(_0x256c34){if(_0x256c34){_0x4c6f55=_0x256c34;_0x59cead[_0x2be1('0x52')]=_[_0x2be1('0x4f')](db['User']['rawAttributes']);_0x59cead['query']=_['keys'](_0x101915['query']);_0x59cead[_0x2be1('0x50')]=_[_0x2be1('0x51')](_0x59cead['model'],_0x59cead[_0x2be1('0x4e')]);_0x3c16f4[_0x2be1('0x53')]=_[_0x2be1('0x51')](_0x59cead['model'],qs[_0x2be1('0x54')](_0x101915['query'][_0x2be1('0x54')]));_0x3c16f4[_0x2be1('0x53')]=_0x3c16f4[_0x2be1('0x53')]['length']?_0x3c16f4[_0x2be1('0x53')]:_0x59cead[_0x2be1('0x52')];_0x3c16f4[_0x2be1('0xcf')]=qs['sort'](_0x101915['query'][_0x2be1('0x58')]);_0x3c16f4[_0x2be1('0x5a')]=qs['filters'](_[_0x2be1('0x59')](_0x101915[_0x2be1('0x4e')],_0x59cead[_0x2be1('0x50')]));if(_0x101915[_0x2be1('0x4e')]['filter']){_0x3c16f4['where']=_[_0x2be1('0x5b')](_0x3c16f4['where'],{'$or':_[_0x2be1('0xcb')](_0x3c16f4[_0x2be1('0x53')],function(_0x5d918b){var _0x4f5f1c={};_0x4f5f1c[_0x5d918b]={'$like':'%'+_0x101915[_0x2be1('0x4e')][_0x2be1('0x43')]+'%'};return _0x4f5f1c;})});}_0x3c16f4[_0x2be1('0x52')]=db[_0x2be1('0x63')];_0x3c16f4['as']='Agents';_0x3c16f4=_[_0x2be1('0x5b')]({},_0x3c16f4,_0x101915[_0x2be1('0x62')]);return _0x4c6f55[_0x2be1('0xea')]({'include':[_0x3c16f4]});}})[_0x2be1('0x25')](function(_0xc69dd0){if(_0xc69dd0){var _0x1c8371={},_0xfd5480=[],_0x22ea0d=0x0;for(var _0x6f4ea5=0x0;_0x6f4ea5<_0xc69dd0[_0x2be1('0x55')];_0x6f4ea5+=0x1){for(var _0x1de6b0=0x0,_0xbc4e7;_0x1de6b0<_0xc69dd0[_0x6f4ea5][_0x2be1('0x3f')][_0x2be1('0x55')];_0x1de6b0+=0x1){_0xbc4e7=_0xc69dd0[_0x6f4ea5][_0x2be1('0x3f')][_0x1de6b0]['get']({'plain':!![]});_0x1c8371[_0xbc4e7['id']]=_0xbc4e7;}}_0x1c8371=_[_0x2be1('0x10f')](_0x1c8371);for(var _0x1380bf=qs[_0x2be1('0x34')](_0x101915[_0x2be1('0x4e')][_0x2be1('0x34')]);_0x1380bf<_0x1c8371[_0x2be1('0x55')]&&_0xfd5480['length']=_0x3dbe9c){_0x4b36a5=_0x3dbe9c;_0x479d7f=0xc8;}else{_0x479d7f=0xce;}_0x52873f[_0x6892('0x2b')](_0x479d7f);return _0x52873f['set']('Content-Range',_0x40ee10+'-'+_0x4b36a5+'/'+_0x3dbe9c)[_0x6892('0x2d')](_0x32ca69);}return null;};}function patchUpdates(_0x21557f){return function(_0x2310a3){try{jsonpatch[_0x6892('0x31')](_0x2310a3,_0x21557f,!![]);}catch(_0x5b5df0){return BPromise[_0x6892('0x32')](_0x5b5df0);}return _0x2310a3[_0x6892('0x33')]();};}function saveUpdates(_0x33dbe7,_0x561358){return function(_0x542539){if(_0x542539){return _0x542539['update'](_0x33dbe7)[_0x6892('0x21')](function(_0x43a269){return _0x43a269;});}return null;};}function removeEntity(_0x402a8e,_0x45bac6){return function(_0x491c93){if(_0x491c93){return _0x491c93[_0x6892('0x34')]()[_0x6892('0x21')](function(){var _0x277a5b=_0x491c93[_0x6892('0x35')]({'plain':!![]});var _0x4beef3=[{'name':_0x6892('0x36'),'value':_0x6892('0x37'),'ignore':!![]},{'name':_0x6892('0x38'),'value':_0x6892('0x39'),'ignore':![]},{'name':_0x6892('0x3a'),'value':_0x6892('0x3b'),'ignore':![]}];var _0x535e4b=_(_0x4beef3)[_0x6892('0x3c')](_0x6892('0x3d'))[_0x6892('0x3e')](_0x6892('0x3f'))[_0x6892('0x3f')]();if(_[_0x6892('0x40')](_0x535e4b,_0x277a5b[_0x6892('0x41')])){return;}var _0x2cbcfc=_[_0x6892('0x42')](_0x4beef3,['value',_0x277a5b[_0x6892('0x41')]])[_0x6892('0x43')];return db['UserProfileResource'][_0x6892('0x34')]({'where':{'type':_0x2cbcfc,'resourceId':_0x277a5b['id']}})[_0x6892('0x21')](function(){return _0x491c93;});})[_0x6892('0x21')](function(){_0x402a8e[_0x6892('0x2b')](0xcc)[_0x6892('0x2c')]();});}};}function handleEntityNotFound(_0x414ae1,_0x3d22a4){return function(_0x562ad5){if(!_0x562ad5){_0x414ae1['sendStatus'](0x194);}return _0x562ad5;};}function handleError(_0x322bb7,_0x985668){_0x985668=_0x985668||0x1f4;return function(_0x471fdd){logger[_0x6892('0x26')](_0x471fdd[_0x6892('0x44')]);if(_0x471fdd['name']){delete _0x471fdd[_0x6892('0x43')];}_0x322bb7[_0x6892('0x2b')](_0x985668)['send'](_0x471fdd);};}exports['index']=function(_0x381428,_0x8db580){var _0xf53502={},_0xd1f7c2={},_0x408e03={'count':0x0,'rows':[]};var _0x5321cc=db[_0x6892('0x45')][_0x6892('0x46')];_0xd1f7c2[_0x6892('0x47')]=_[_0x6892('0x48')](_[_0x6892('0x49')](_0x5321cc),[_0x6892('0x4a'),_0x6892('0x4b')]);_0xd1f7c2['query']=_[_0x6892('0x49')](_0x381428[_0x6892('0x4c')]);_0xd1f7c2[_0x6892('0x4d')]=_[_0x6892('0x4e')](_0xd1f7c2[_0x6892('0x47')],_0xd1f7c2[_0x6892('0x4c')]);_0xf53502[_0x6892('0x4f')]=_[_0x6892('0x4e')](_0xd1f7c2[_0x6892('0x47')],qs[_0x6892('0x50')](_0x381428[_0x6892('0x4c')][_0x6892('0x50')]));_0xf53502[_0x6892('0x4f')]=_0xf53502[_0x6892('0x4f')][_0x6892('0x51')]?_0xf53502[_0x6892('0x4f')]:_0xd1f7c2[_0x6892('0x47')];if(!_0x381428['query'][_0x6892('0x52')](_0x6892('0x53'))){_0xf53502[_0x6892('0x30')]=qs[_0x6892('0x30')](_0x381428[_0x6892('0x4c')][_0x6892('0x30')]);_0xf53502[_0x6892('0x2f')]=qs[_0x6892('0x2f')](_0x381428[_0x6892('0x4c')]['offset']);}_0xf53502[_0x6892('0x54')]=qs[_0x6892('0x55')](_0x381428['query']['sort']);_0xf53502[_0x6892('0x56')]=qs[_0x6892('0x4d')](_[_0x6892('0x57')](_0x381428['query'],_0xd1f7c2[_0x6892('0x4d')]));if(_0x381428[_0x6892('0x4c')][_0x6892('0x3c')]){_0xf53502[_0x6892('0x56')]=_[_0x6892('0x58')](_0xf53502[_0x6892('0x56')],{'$or':_[_0x6892('0x3e')](_0x5321cc,function(_0x9bcf96){if(_0x9bcf96['type']['key']!=='VIRTUAL'){return db[_0x6892('0x59')][_0x6892('0x56')](db[_0x6892('0x59')]['fn'](_0x6892('0x5a'),db[_0x6892('0x59')][_0x6892('0x5b')](_0x9bcf96[_0x6892('0x5c')])),{'$like':db['sequelize']['fn'](_0x6892('0x5a'),'%'+_0x381428[_0x6892('0x4c')]['filter']+'%')});}})});}_0xf53502=_[_0x6892('0x58')]({},_0xf53502,_0x381428[_0x6892('0x5d')]);var _0x549b8f={'where':_0xf53502[_0x6892('0x56')]};return db[_0x6892('0x45')][_0x6892('0x2e')](_0x549b8f)['then'](function(_0x9477d8){_0x408e03[_0x6892('0x2e')]=_0x9477d8;if(_0x381428[_0x6892('0x4c')][_0x6892('0x5e')]){_0xf53502[_0x6892('0x5f')]=[{'all':!![]}];}return db[_0x6892('0x45')][_0x6892('0x60')](_0xf53502);})[_0x6892('0x21')](function(_0x1fa0a6){_0x408e03['rows']=_0x1fa0a6;return _0x408e03;})[_0x6892('0x21')](respondWithFilteredResult(_0x8db580,_0xf53502))[_0x6892('0x29')](handleError(_0x8db580,null));};exports[_0x6892('0x61')]=function(_0x160078,_0x2d5cbf){var _0x2f893f={'raw':![],'where':{'id':_0x160078[_0x6892('0x62')]['id']}},_0x532281={};_0x532281['model']=_[_0x6892('0x48')](_[_0x6892('0x49')](db[_0x6892('0x45')]['rawAttributes']),[_0x6892('0x4a'),_0x6892('0x4b')]);_0x532281[_0x6892('0x4c')]=_[_0x6892('0x49')](_0x160078[_0x6892('0x4c')]);_0x532281[_0x6892('0x4d')]=_[_0x6892('0x4e')](_0x532281[_0x6892('0x47')],_0x532281[_0x6892('0x4c')]);_0x2f893f['attributes']=_[_0x6892('0x4e')](_0x532281[_0x6892('0x47')],qs['fields'](_0x160078['query'][_0x6892('0x50')]));_0x2f893f['attributes']=_0x2f893f[_0x6892('0x4f')][_0x6892('0x51')]?_0x2f893f['attributes']:_0x532281['model'];if(_0x160078[_0x6892('0x4c')][_0x6892('0x5e')]){_0x2f893f['include']=[{'all':!![]}];}_0x2f893f=_[_0x6892('0x58')]({},_0x2f893f,_0x160078[_0x6892('0x5d')]);return db['User'][_0x6892('0x42')](_0x2f893f)[_0x6892('0x21')](handleEntityNotFound(_0x2d5cbf,null))[_0x6892('0x21')](respondWithResult(_0x2d5cbf,null))[_0x6892('0x29')](handleError(_0x2d5cbf,null));};exports[_0x6892('0x63')]=function(_0x4324c3,_0x54e1bc){return db[_0x6892('0x45')]['bulkCreate'](_0x4324c3['body'],{'raw':![],'individualHooks':!![]})[_0x6892('0x21')](respondWithResult(_0x54e1bc,0xc9))[_0x6892('0x29')](handleError(_0x54e1bc,null));};exports['update']=function(_0x5f4993,_0x4210e5){if(_0x5f4993[_0x6892('0x64')]['id']){delete _0x5f4993[_0x6892('0x64')]['id'];}delete _0x5f4993[_0x6892('0x64')][_0x6892('0x41')];return db[_0x6892('0x45')][_0x6892('0x42')]({'where':{'id':_0x5f4993[_0x6892('0x62')]['id']}})[_0x6892('0x21')](handleEntityNotFound(_0x4210e5,null))[_0x6892('0x21')](saveUpdates(_0x5f4993['body'],null))[_0x6892('0x21')](respondWithResult(_0x4210e5,null))[_0x6892('0x29')](handleError(_0x4210e5,null));};exports[_0x6892('0x65')]=function(_0x2c8a44,_0x44aa9b){return db['User'][_0x6892('0x65')]()[_0x6892('0x21')](respondWithResult(_0x44aa9b,null))[_0x6892('0x29')](handleError(_0x44aa9b,null));};exports[_0x6892('0x66')]=function(_0xce78f9,_0x16fea4,_0x2baec5){return db[_0x6892('0x45')][_0x6892('0x42')]({'where':{'id':_0xce78f9[_0x6892('0x62')]['id']}})[_0x6892('0x21')](handleEntityNotFound(_0x16fea4,null))[_0x6892('0x21')](function(_0x4b436){if(_0x4b436){return _0x4b436[_0x6892('0x66')](_0xce78f9[_0x6892('0x64')][_0x6892('0x67')],_[_0x6892('0x68')](_0xce78f9[_0x6892('0x64')],[_0x6892('0x67'),'id'])||{});}})[_0x6892('0x21')](respondWithResult(_0x16fea4,null))[_0x6892('0x29')](handleError(_0x16fea4,null));};var getLicense=function(_0x1a6502){return new BPromise(function(_0x145cf4,_0x2d9e60){var _0x57981c=0x0;_0x1a6502[_0x6892('0x64')][_0x6892('0x41')]===_0x6892('0x39')&&_0x145cf4(_0x6892('0x69'));return db['User'][_0x6892('0x2e')]({'where':{'$or':[{'role':_0x1a6502[_0x6892('0x64')][_0x6892('0x41')]===_0x6892('0x3b')?'telephone':[_0x6892('0x6a'),_0x6892('0x37')]}]}})['then'](function(_0x4d03b0){_0x57981c=_0x4d03b0;return require(_0x6892('0x6b'))[_0x6892('0x6c')]();})['then'](function(_0x23067b){var _0x113799=_0x1a6502[_0x6892('0x64')][_0x6892('0x41')]===_0x6892('0x3b')?_0x6892('0x6d'):_0x6892('0x6e');if(!_[_0x6892('0x6f')](_0x23067b[_0x113799])&&_0x57981c>=_0x23067b[_0x113799]){return _0x2d9e60({'message':_0x6892('0x70')});}return _0x145cf4(util['format'](_0x6892('0x71'),_0x113799,_0x57981c));})[_0x6892('0x29')](function(_0x5860cd){return _0x2d9e60(_0x5860cd);});});};exports[_0x6892('0x72')]=function(_0x47b26a,_0x2db495){return getLicense(_0x47b26a)['then'](function(_0x379149){if(!_0x47b26a[_0x6892('0x64')][_0x6892('0x73')]){var _0x490cf6;return db[_0x6892('0x74')][_0x6892('0x75')](0x1)[_0x6892('0x21')](function(_0x4ac843){_0x4ac843[_0x6892('0x76')]=!![];return checkPasswordPattern(_0x4ac843,_0x47b26a[_0x6892('0x64')][_0x6892('0x4a')],_0x4ac843[_0x6892('0x76')]);})[_0x6892('0x21')](function(_0x3696db){_0x490cf6=_0x3696db['min_internal'];return db[_0x6892('0x45')][_0x6892('0x77')](_0x6892('0x73'));})[_0x6892('0x21')](function(_0xb17172){if(_[_0x6892('0x6f')](_0xb17172)){if(_0x490cf6){_0x47b26a[_0x6892('0x64')]['internal']=_0x490cf6;}else{_0x47b26a[_0x6892('0x64')][_0x6892('0x73')]=0x1;}}else{if(_[_0x6892('0x6f')](_0x490cf6)||_0x490cf6==_0xb17172){_0x47b26a[_0x6892('0x64')][_0x6892('0x73')]=_0xb17172+0x1;}else if(_0x490cf6>_0xb17172){_0x47b26a[_0x6892('0x64')][_0x6892('0x73')]=_0x490cf6;}else{return db[_0x6892('0x59')][_0x6892('0x4c')](_0x6892('0x78'),{'type':db[_0x6892('0x59')][_0x6892('0x79')][_0x6892('0x7a')]})[_0x6892('0x21')](function(_0x536050){if(_0x536050&&_0x536050[_0x6892('0x51')]){for(var _0x428755=0x0,_0x576e42=_0x536050[_0x6892('0x51')];_0x428755<_0x576e42&&_[_0x6892('0x6f')](_0x47b26a[_0x6892('0x64')]['internal']);_0x428755++){if(_0x490cf6<=_0x536050[_0x428755][_0x6892('0x7b')]){_0x47b26a['body'][_0x6892('0x73')]=_0x536050[_0x428755][_0x6892('0x7b')];}else if(_0x490cf6>_0x536050[_0x428755]['from']&&_0x490cf6<=_0x536050[_0x428755]['to']){_0x47b26a['body'][_0x6892('0x73')]=_0x490cf6;}}}if(_[_0x6892('0x6f')](_0x47b26a[_0x6892('0x64')][_0x6892('0x73')])){_0x47b26a[_0x6892('0x64')][_0x6892('0x73')]=_0xb17172+0x1;}});}}});}})[_0x6892('0x21')](function(){if(_0x47b26a[_0x6892('0x64')][_0x6892('0x7c')]){_0x47b26a[_0x6892('0x64')][_0x6892('0x7d')]=_0x47b26a['body'][_0x6892('0x73')];_0x47b26a[_0x6892('0x64')][_0x6892('0x7e')]={'mailbox':_0x47b26a[_0x6892('0x64')][_0x6892('0x73')],'password':_0x47b26a[_0x6892('0x64')][_0x6892('0x4a')],'fullname':_0x47b26a['body'][_0x6892('0x7f')],'email':_0x47b26a[_0x6892('0x64')][_0x6892('0x80')]};}if(_0x47b26a['body']&&_0x47b26a[_0x6892('0x64')][_0x6892('0x41')]===_0x6892('0x39')){_0x47b26a['body']['permissions']=[_0x6892('0x81'),_0x6892('0x82'),_0x6892('0x83'),_0x6892('0x84'),_0x6892('0x85'),'105',_0x6892('0x86'),_0x6892('0x87'),_0x6892('0x88'),_0x6892('0x89'),_0x6892('0x8a'),_0x6892('0x8b')];}return db[_0x6892('0x45')][_0x6892('0x72')](_0x47b26a[_0x6892('0x64')],{'include':[{'model':db[_0x6892('0x7e')],'as':_0x6892('0x7e')}]});})['then'](function(_0xa15710){if(_0x47b26a[_0x6892('0x64')][_0x6892('0x41')]==='user')return _0xa15710;var _0x531fff=_0x47b26a[_0x6892('0x37')][_0x6892('0x35')]({'plain':!![]});if(!_0x531fff)throw new Error(_0x6892('0x8c'));if(_0x531fff['role']===_0x6892('0x37')){var _0x445f2a=_0xa15710[_0x6892('0x35')]({'plain':!![]});var _0x52d092=[{'name':'Agents','value':_0x6892('0x39')},{'name':_0x6892('0x3a'),'value':_0x6892('0x3b')}];var _0xf7be01=_[_0x6892('0x42')](_0x52d092,[_0x6892('0x3f'),_0x445f2a[_0x6892('0x41')]])[_0x6892('0x43')];return db[_0x6892('0x8d')][_0x6892('0x42')]({'where':{'name':_0xf7be01,'userProfileId':_0x531fff[_0x6892('0x8e')]},'raw':!![]})['then'](function(_0x295216){if(_0x295216&&_0x295216[_0x6892('0x8f')]===0x0){return db[_0x6892('0x90')]['create']({'name':_0x445f2a[_0x6892('0x43')],'resourceId':_0x445f2a['id'],'type':_0x295216[_0x6892('0x43')],'sectionId':_0x295216['id']},{})[_0x6892('0x21')](function(){return _0xa15710;});}else{return _0xa15710;}})['catch'](function(_0x1af835){logger[_0x6892('0x26')](_0x6892('0x91'),_0x1af835);throw _0x1af835;});}return _0xa15710;})[_0x6892('0x21')](respondWithResult(_0x2db495,0xc9))[_0x6892('0x29')](handleError(_0x2db495,null));};exports[_0x6892('0x92')]=function(_0x3fffd0,_0x37517d,_0x22234c){var _0x35e003=![];if(_0x3fffd0[_0x6892('0x64')]['id']){delete _0x3fffd0['body']['id'];}if(!_['isNil'](_0x3fffd0['body'][_0x6892('0x93')])){if(_0x3fffd0['body'][_0x6892('0x93')]===_0x3fffd0[_0x6892('0x64')][_0x6892('0x94')]){throw new Error(_0x6892('0x95'));}}return db[_0x6892('0x45')][_0x6892('0x42')]({'where':{'id':_0x3fffd0[_0x6892('0x62')]['id']}})['then'](function(_0x200f5c){if(_0x200f5c){if(_0x200f5c['id']==_0x3fffd0[_0x6892('0x37')]['id']){if(!_0x3fffd0[_0x6892('0x64')][_0x6892('0x93')]||!_0x3fffd0['body'][_0x6892('0x94')]){throw new db[(_0x6892('0x96'))][(_0x6892('0x97'))](_0x6892('0x98'));}if(!_0x200f5c[_0x6892('0x99')](_0x3fffd0['body'][_0x6892('0x93')])){throw new db['Sequelize'][(_0x6892('0x97'))](_0x6892('0x9a'));}if(_0x3fffd0[_0x6892('0x64')][_0x6892('0x93')]==_0x3fffd0[_0x6892('0x64')][_0x6892('0x94')]){throw new db[(_0x6892('0x96'))][(_0x6892('0x97'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}return _0x200f5c;}else if(_0x3fffd0[_0x6892('0x37')][_0x6892('0x41')]==_0x6892('0x6a')){if(!_0x3fffd0[_0x6892('0x64')][_0x6892('0x94')]){throw new db['Sequelize'][(_0x6892('0x97'))](_0x6892('0x9b'));}return _0x200f5c;}else if(_0x3fffd0[_0x6892('0x37')][_0x6892('0x41')]==_0x6892('0x37')){if(!_0x3fffd0['body']['newPassword']){throw new db['Sequelize'][(_0x6892('0x97'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x200f5c['role']!=_0x6892('0x39')){throw new db['Sequelize'][(_0x6892('0x97'))](_0x6892('0x9c'));}return _0x200f5c;}else{throw new db[(_0x6892('0x96'))][(_0x6892('0x97'))]('Unauthorized');}}return null;})[_0x6892('0x21')](handleEntityNotFound(_0x37517d,null))[_0x6892('0x21')](function(_0x923fdb){return db[_0x6892('0x74')][_0x6892('0x9d')]({'attributes':['id',_0x6892('0x76')]})['then'](function(_0x515ee3){_0x35e003=_0x515ee3[_0x6892('0x76')];return checkPasswordPattern(_0x923fdb,_0x3fffd0[_0x6892('0x64')][_0x6892('0x94')],_0x35e003);});})[_0x6892('0x21')](saveUpdates({'password':_0x3fffd0['body'][_0x6892('0x94')],'passwordResetAt':_0x3fffd0[_0x6892('0x37')]['id']==_0x3fffd0[_0x6892('0x62')]['id']?moment():null},null))[_0x6892('0x21')](respondWithResult(_0x37517d,null))[_0x6892('0x29')](handleError(_0x37517d,null));};exports['addQueues']=function(_0x47a6e1,_0x866a63,_0x2d7616){var _0x1f281c=_0x47a6e1[_0x6892('0x64')][_0x6892('0x9e')];return db[_0x6892('0x45')][_0x6892('0x42')]({'where':{'id':_0x47a6e1[_0x6892('0x62')]['id']},'attributes':['id',_0x6892('0x43'),_0x6892('0x41'),_0x6892('0x9f'),_0x6892('0xa0'),_0x6892('0xa1'),_0x6892('0xa2')]})[_0x6892('0x21')](handleEntityNotFound(_0x866a63,null))[_0x6892('0x21')](function(_0x2dabcb){if(_0x2dabcb){if(!utils['isValidChannel'](_0x1f281c)){throw new db[(_0x6892('0x96'))][(_0x6892('0x97'))](_0x6892('0xa3'));}return _0x2dabcb['add'+_[_0x6892('0xa4')](_0x1f281c[_0x6892('0xa5')]())+_0x6892('0xa6')](_0x47a6e1['body']['ids'],{'penalty':_0x47a6e1[_0x6892('0x64')][_0x6892('0xa7')]||0x0})[_0x6892('0xa8')](function(_0x3740da){for(var _0xebdccb=0x0;_0xebdccb<_0x47a6e1[_0x6892('0x64')][_0x6892('0x67')][_0x6892('0x51')];_0xebdccb+=0x1){var _0xb13d1d={'UserId':_0x47a6e1['params']['id']};_0xb13d1d[_[_0x6892('0xa4')](_0x1f281c['toLowerCase']())+_0x6892('0xa9')]=_0x47a6e1['body'][_0x6892('0x67')][_0xebdccb];socket[_0x6892('0xaa')]('user'+_[_0x6892('0xa4')](_0x1f281c[_0x6892('0xa5')]())+_0x6892('0xab'),_0xb13d1d);}return _0x3740da;})['then'](function(){if(_0x1f281c==='voice'){return db[_0x6892('0xac')][_0x6892('0x60')]({'where':{'id':_0x47a6e1[_0x6892('0x64')][_0x6892('0x67')]||[]},'raw':!![],'attributes':['id','name']});}})[_0x6892('0x21')](function(_0x59d447){var _0x4ed851=_0x2dabcb[_0x6892('0x35')]({'plain':!![]});var _0x3c27fb=[];if(_0x1f281c===_0x6892('0xad')&&_0x4ed851['role']===_0x6892('0x39')&&_0x4ed851[_0x6892('0x9f')]){for(var _0x11af9d=0x0;_0x11af9d<_0x59d447[_0x6892('0x51')];_0x11af9d+=0x1){_0x3c27fb['push']({'membername':_0x4ed851[_0x6892('0x43')],'UserId':_0x4ed851['id'],'queue_name':_0x59d447[_0x11af9d][_0x6892('0x43')],'VoiceQueueId':_0x59d447[_0x11af9d]['id'],'interface':_[_0x6892('0x6f')](_0x4ed851[_0x6892('0xa2')])?util['format'](_0x6892('0xae'),_0x4ed851[_0x6892('0x43')]):_0x4ed851[_0x6892('0xa2')],'paused':_0x4ed851[_0x6892('0xa1')]||![],'penalty':_0x47a6e1[_0x6892('0x64')]['penalty']||0x0});}return BPromise[_0x6892('0xaf')](_0x3c27fb,function(_0x4aa643){return db['UserVoiceQueueRt'][_0x6892('0xb0')](_0x4aa643);});}return _0x2dabcb;});}})[_0x6892('0x21')](respondWithStatusCode(_0x866a63,null))[_0x6892('0x29')](handleError(_0x866a63,null));};exports['removeQueues']=function(_0x4d29ee,_0x48540c,_0x31a3f5){var _0x2800c9;return db[_0x6892('0x45')][_0x6892('0x42')]({'where':{'id':_0x4d29ee[_0x6892('0x62')]['id']},'attributes':['id','name','role']})[_0x6892('0x21')](handleEntityNotFound(_0x48540c,null))['then'](function(_0x31974){if(_0x31974){_0x2800c9=_0x31974;if(!_0x4d29ee[_0x6892('0x4c')][_0x6892('0x9e')]||!utils[_0x6892('0xb1')](_0x4d29ee[_0x6892('0x4c')]['channel'])){throw new db[(_0x6892('0x96'))]['ValidationError'](_0x6892('0xa3'));}return _0x31974[_0x6892('0xb2')+_[_0x6892('0xa4')](_0x4d29ee['query']['channel']['toLowerCase']())+_0x6892('0xa6')](_0x4d29ee['query'][_0x6892('0x67')]);}})['then'](function(_0x80a4d9){for(var _0x5d1474=0x0;_0x5d1474<_0x4d29ee[_0x6892('0x4c')][_0x6892('0x67')][_0x6892('0x51')];_0x5d1474+=0x1){var _0x7cc023={'UserId':_0x4d29ee[_0x6892('0x62')]['id']};_0x7cc023[_['capitalize'](_0x4d29ee[_0x6892('0x4c')][_0x6892('0x9e')]['toLowerCase']())+_0x6892('0xa9')]=_0x4d29ee['query']['ids'][_0x5d1474];socket['emit'](_0x6892('0x37')+_[_0x6892('0xa4')](_0x4d29ee[_0x6892('0x4c')][_0x6892('0x9e')][_0x6892('0xa5')]())+'Queue:remove',_0x7cc023);}return _0x80a4d9;})[_0x6892('0x21')](function(){if(_0x4d29ee[_0x6892('0x4c')][_0x6892('0x9e')]===_0x6892('0xad')){return db[_0x6892('0xb3')]['destroy']({'where':{'UserId':_0x4d29ee['params']['id'],'VoiceQueueId':_0x4d29ee[_0x6892('0x4c')][_0x6892('0x67')]},'individualHooks':!![]})[_0x6892('0x21')](function(){return _0x2800c9;});}return _0x2800c9;})[_0x6892('0x21')](respondWithStatusCode(_0x48540c,null))[_0x6892('0x29')](handleError(_0x48540c,null));};exports[_0x6892('0xb4')]=function(_0x1929c9,_0x55dc4f,_0x4bbb7a){_0x1929c9['body'][_0x6892('0xb5')]=_0x1929c9['file']['filename'];return db[_0x6892('0x45')][_0x6892('0x42')]({'where':{'id':_0x1929c9[_0x6892('0x62')]['id']}})[_0x6892('0x21')](handleEntityNotFound(_0x55dc4f,null))[_0x6892('0x21')](saveUpdates(_0x1929c9[_0x6892('0x64')],null))[_0x6892('0x21')](respondWithResult(_0x55dc4f,null))[_0x6892('0x29')](handleError(_0x55dc4f,null));};exports[_0x6892('0xb6')]=function(_0x4f5670,_0x263832,_0x17c7df){var _0x1d0796=path[_0x6892('0xb7')](config[_0x6892('0xb8')],_0x6892('0xb9'));return db['User'][_0x6892('0x42')]({'where':{'id':_0x4f5670[_0x6892('0x62')]['id']},'attributes':['id',_0x6892('0xb5')],'raw':!![]})[_0x6892('0x21')](handleEntityNotFound(_0x263832,null))[_0x6892('0x21')](function(_0x311a22){if(_0x311a22){if(_[_0x6892('0x6f')](_0x311a22[_0x6892('0xb5')])){return _0x263832['download'](_0x1d0796);}else{if(!fs[_0x6892('0xba')](path[_0x6892('0xb7')](config[_0x6892('0xb8')],_0x6892('0xbb'),_0x311a22[_0x6892('0xb5')]))){return _0x263832[_0x6892('0xbc')](_0x1d0796);}return _0x263832[_0x6892('0xbc')](path[_0x6892('0xb7')](config[_0x6892('0xb8')],_0x6892('0xbb'),_0x311a22[_0x6892('0xb5')]));}}})[_0x6892('0x29')](handleError(_0x263832,null));};exports[_0x6892('0xbd')]=function(_0x53eb02,_0x88e4b7,_0x5d3595){var _0x5e3ecd={};var _0x4e81a8={};var _0x4e98e6;var _0x49b7a8;return db['User']['findOne']({'where':{'id':_0x53eb02['params']['id']}})['then'](handleEntityNotFound(_0x88e4b7,null))['then'](function(_0x25efcb){if(_0x25efcb){_0x4e98e6=_0x25efcb;_0x4e81a8[_0x6892('0x47')]=_[_0x6892('0x49')](db['CmContact'][_0x6892('0x46')]);_0x4e81a8[_0x6892('0x4c')]=_[_0x6892('0x49')](_0x53eb02[_0x6892('0x4c')]);_0x4e81a8['filters']=_[_0x6892('0x4e')](_0x4e81a8[_0x6892('0x47')],_0x4e81a8[_0x6892('0x4c')]);_0x5e3ecd[_0x6892('0x4f')]=_['intersection'](_0x4e81a8['model'],qs[_0x6892('0x50')](_0x53eb02['query'][_0x6892('0x50')]));_0x5e3ecd[_0x6892('0x4f')]=_0x5e3ecd[_0x6892('0x4f')][_0x6892('0x51')]?_0x5e3ecd[_0x6892('0x4f')]:_0x4e81a8[_0x6892('0x47')];_0x5e3ecd[_0x6892('0x54')]=qs[_0x6892('0x55')](_0x53eb02['query'][_0x6892('0x55')]);_0x5e3ecd['where']=qs['filters'](_[_0x6892('0x57')](_0x53eb02[_0x6892('0x4c')],_0x4e81a8[_0x6892('0x4d')]));if(_0x53eb02[_0x6892('0x4c')][_0x6892('0x3c')]){_0x5e3ecd[_0x6892('0x56')]=_['merge'](_0x5e3ecd[_0x6892('0x56')],{'$or':_['map'](_0x5e3ecd[_0x6892('0x4f')],function(_0x33121b){var _0x28679f={};_0x28679f[_0x33121b]={'$like':'%'+_0x53eb02[_0x6892('0x4c')][_0x6892('0x3c')]+'%'};return _0x28679f;})});}_0x5e3ecd=_['merge']({},_0x5e3ecd,_0x53eb02[_0x6892('0x5d')]);return _0x4e98e6[_0x6892('0xbd')](_0x5e3ecd);}})[_0x6892('0x21')](function(_0xf95c30){if(_0xf95c30){_0x49b7a8=_0xf95c30[_0x6892('0x51')];if(_0x53eb02[_0x6892('0x4c')][_0x6892('0x52')](_0x6892('0x5e'))){_0x5e3ecd['include']=[{'model':db['CmList'],'as':'List','required':![]},{'model':db[_0x6892('0xbe')],'as':'Tags','attributes':['id',_0x6892('0x43'),_0x6892('0xbf')],'where':_0x53eb02[_0x6892('0x4c')][_0x6892('0xc0')]?{'id':_0x53eb02['query']['tag']}:undefined,'required':_0x53eb02['query'][_0x6892('0xc0')]?!![]:![]}];}if(!_0x53eb02[_0x6892('0x4c')][_0x6892('0x52')]('nolimit')){_0x5e3ecd['limit']=qs[_0x6892('0x30')](_0x53eb02[_0x6892('0x4c')][_0x6892('0x30')]);_0x5e3ecd[_0x6892('0x2f')]=qs['offset'](_0x53eb02['query'][_0x6892('0x2f')]);}return _0x4e98e6[_0x6892('0xbd')](_0x5e3ecd);}})['then'](function(_0x4e2f9b){if(_0x4e2f9b){return _0x4e2f9b?{'count':_0x49b7a8,'rows':_0x4e2f9b}:null;}})['then'](respondWithResult(_0x88e4b7,null))[_0x6892('0x29')](handleError(_0x88e4b7,null));};exports['getQueues']=function(_0xe3d5ae,_0x1438ce,_0x5a23d0){var _0x2808af;var _0x2e9650;var _0x537df1={};var _0x39c4ae;return db[_0x6892('0x45')][_0x6892('0x9d')]({'where':{'id':_0xe3d5ae[_0x6892('0x62')]['id']},'attributes':['id',_0x6892('0x43'),_0x6892('0x41')]})[_0x6892('0x21')](handleEntityNotFound(_0x1438ce,null))['then'](function(_0x715ced){if(!utils[_0x6892('0xb1')](_0xe3d5ae[_0x6892('0x4c')][_0x6892('0x9e')])){throw new db[(_0x6892('0x96'))][(_0x6892('0x97'))](_0x6892('0xa3'));}_0x2808af=_0x715ced;var _0x1a41f2={};_0x1a41f2[_0x6892('0x47')]=_[_0x6892('0x49')](db[_['capitalize'](_0xe3d5ae[_0x6892('0x4c')][_0x6892('0x9e')])+_0x6892('0xc1')]['rawAttributes']);_0x1a41f2[_0x6892('0x4c')]=_[_0x6892('0x49')](_0xe3d5ae['query']);_0x1a41f2['filters']=_[_0x6892('0x4e')](_0x1a41f2['model'],_0x1a41f2['query']);_0x537df1['attributes']=_['intersection'](_0x1a41f2['model'],qs[_0x6892('0x50')](_0xe3d5ae[_0x6892('0x4c')][_0x6892('0x50')]));_0x537df1[_0x6892('0x4f')]=_0x537df1[_0x6892('0x4f')][_0x6892('0x51')]?_0x537df1[_0x6892('0x4f')]:_0x1a41f2[_0x6892('0x47')];_0x537df1[_0x6892('0x54')]=qs[_0x6892('0x55')](_0xe3d5ae[_0x6892('0x4c')][_0x6892('0x55')]);_0x537df1['where']=qs[_0x6892('0x4d')](_['pick'](_0xe3d5ae['query'],_0x1a41f2[_0x6892('0x4d')]));if(_0xe3d5ae[_0x6892('0x4c')][_0x6892('0x3c')]){_0x537df1[_0x6892('0x56')]=_[_0x6892('0x58')](_0x537df1[_0x6892('0x56')],{'$or':_['map'](_0x537df1[_0x6892('0x4f')],function(_0x407a29){var _0x2501e4={};_0x2501e4[_0x407a29]={'$like':'%'+_0xe3d5ae['query']['filter']+'%'};return _0x2501e4;})});}_0x537df1=_[_0x6892('0x58')]({},_0x537df1,_0xe3d5ae[_0x6892('0x5d')]);switch(_0x2808af[_0x6892('0x41')]){case _0x6892('0x6a'):return db[_[_0x6892('0xa4')](_0xe3d5ae[_0x6892('0x4c')][_0x6892('0x9e')])+'Queue'][_0x6892('0x60')](_0x537df1);case'user':case _0x6892('0x39'):return _0x2808af[_0x6892('0x35')+_[_0x6892('0xa4')](_0xe3d5ae[_0x6892('0x4c')][_0x6892('0x9e')])+_0x6892('0xa6')](_0x537df1);default:throw new db[(_0x6892('0x96'))][(_0x6892('0x97'))](_0x6892('0xc2'));}})['then'](function(_0x1dad9b){_0x39c4ae=_0x1dad9b[_0x6892('0x51')];if(!_0xe3d5ae[_0x6892('0x4c')][_0x6892('0x52')](_0x6892('0x53'))){_0x537df1[_0x6892('0x30')]=qs[_0x6892('0x30')](_0xe3d5ae['query'][_0x6892('0x30')]);_0x537df1[_0x6892('0x2f')]=qs[_0x6892('0x2f')](_0xe3d5ae[_0x6892('0x4c')][_0x6892('0x2f')]);}switch(_0x2808af[_0x6892('0x41')]){case _0x6892('0x6a'):return db[_[_0x6892('0xa4')](_0xe3d5ae[_0x6892('0x4c')][_0x6892('0x9e')])+_0x6892('0xc1')]['findAll'](_0x537df1);case'user':case _0x6892('0x39'):return _0x2808af['get'+_[_0x6892('0xa4')](_0xe3d5ae[_0x6892('0x4c')][_0x6892('0x9e')])+_0x6892('0xa6')](_0x537df1);}})[_0x6892('0x21')](function(_0x4cf661){return{'count':_0x39c4ae,'rows':_0x4cf661};})[_0x6892('0x21')](respondWithResult(_0x1438ce,null))['catch'](handleError(_0x1438ce,null));};exports[_0x6892('0xc3')]=function(_0x186277,_0x13974b,_0x38aa02){var _0x3679b8={};var _0xfb787a={};var _0x210302;var _0x21becd;return db['User'][_0x6892('0x9d')]({'where':{'id':_0x186277[_0x6892('0x62')]['id']}})[_0x6892('0x21')](handleEntityNotFound(_0x13974b,null))[_0x6892('0x21')](function(_0x3bedaf){if(_0x3bedaf){_0x210302=_0x3bedaf;_0xfb787a[_0x6892('0x47')]=_[_0x6892('0x49')](db[_0x6892('0xb3')][_0x6892('0x46')]);_0xfb787a[_0x6892('0x4c')]=_[_0x6892('0x49')](_0x186277[_0x6892('0x4c')]);_0xfb787a[_0x6892('0x4d')]=_[_0x6892('0x4e')](_0xfb787a[_0x6892('0x47')],_0xfb787a[_0x6892('0x4c')]);_0x3679b8[_0x6892('0x4f')]=_['intersection'](_0xfb787a['model'],qs['fields'](_0x186277[_0x6892('0x4c')][_0x6892('0x50')]));_0x3679b8['attributes']=_0x3679b8['attributes'][_0x6892('0x51')]?_0x3679b8['attributes']:_0xfb787a[_0x6892('0x47')];_0x3679b8[_0x6892('0x54')]=qs['sort'](_0x186277['query'][_0x6892('0x55')]);_0x3679b8['where']=qs[_0x6892('0x4d')](_[_0x6892('0x57')](_0x186277['query'],_0xfb787a['filters']));if(_0x186277[_0x6892('0x4c')]['filter']){_0x3679b8[_0x6892('0x56')]=_[_0x6892('0x58')](_0x3679b8['where'],{'$or':_['map'](_0x3679b8[_0x6892('0x4f')],function(_0x5eac7d){var _0x5f1f06={};_0x5f1f06[_0x5eac7d]={'$like':'%'+_0x186277[_0x6892('0x4c')][_0x6892('0x3c')]+'%'};return _0x5f1f06;})});}_0x3679b8=_[_0x6892('0x58')]({},_0x3679b8,_0x186277[_0x6892('0x5d')]);return _0x210302[_0x6892('0xc3')](_0x3679b8);}})[_0x6892('0x21')](function(_0x38f15b){if(_0x38f15b){_0x21becd=_0x38f15b[_0x6892('0x51')];if(!_0x186277['query']['hasOwnProperty'](_0x6892('0x53'))){_0x3679b8[_0x6892('0x30')]=qs[_0x6892('0x30')](_0x186277[_0x6892('0x4c')][_0x6892('0x30')]);_0x3679b8[_0x6892('0x2f')]=qs[_0x6892('0x2f')](_0x186277[_0x6892('0x4c')][_0x6892('0x2f')]);}return _0x210302[_0x6892('0xc3')](_0x3679b8);}})[_0x6892('0x21')](function(_0xc03eca){if(_0xc03eca){return _0xc03eca?{'count':_0x21becd,'rows':_0xc03eca}:null;}})[_0x6892('0x21')](respondWithResult(_0x13974b,null))[_0x6892('0x29')](handleError(_0x13974b,null));};exports[_0x6892('0xc4')]=function(_0x37c8e8,_0x2e0f8c,_0x28cc39){var _0x1f1f9d={};var _0x9b7eff={};var _0x468596;var _0x1a0572;return db[_0x6892('0x45')][_0x6892('0x9d')]({'where':{'id':_0x37c8e8['params']['id']}})['then'](handleEntityNotFound(_0x2e0f8c,null))[_0x6892('0x21')](function(_0x3f247c){if(_0x3f247c){_0x468596=_0x3f247c;_0x9b7eff[_0x6892('0x47')]=_[_0x6892('0x49')](db[_0x6892('0xc5')][_0x6892('0x46')]);_0x9b7eff['query']=_[_0x6892('0x49')](_0x37c8e8[_0x6892('0x4c')]);_0x9b7eff[_0x6892('0x4d')]=_[_0x6892('0x4e')](_0x9b7eff[_0x6892('0x47')],_0x9b7eff[_0x6892('0x4c')]);_0x1f1f9d[_0x6892('0x4f')]=_[_0x6892('0x4e')](_0x9b7eff[_0x6892('0x47')],qs[_0x6892('0x50')](_0x37c8e8[_0x6892('0x4c')]['fields']));_0x1f1f9d[_0x6892('0x4f')]=_0x1f1f9d[_0x6892('0x4f')][_0x6892('0x51')]?_0x1f1f9d['attributes']:_0x9b7eff[_0x6892('0x47')];_0x1f1f9d['order']=qs['sort'](_0x37c8e8[_0x6892('0x4c')][_0x6892('0x55')]);_0x1f1f9d[_0x6892('0x56')]=qs[_0x6892('0x4d')](_[_0x6892('0x57')](_0x37c8e8[_0x6892('0x4c')],_0x9b7eff[_0x6892('0x4d')]));if(_0x37c8e8[_0x6892('0x4c')]['filter']){_0x1f1f9d[_0x6892('0x56')]=_[_0x6892('0x58')](_0x1f1f9d[_0x6892('0x56')],{'$or':_[_0x6892('0x3e')](_0x1f1f9d[_0x6892('0x4f')],function(_0x6d46bd){var _0x4d115b={};_0x4d115b[_0x6d46bd]={'$like':'%'+_0x37c8e8[_0x6892('0x4c')]['filter']+'%'};return _0x4d115b;})});}_0x1f1f9d=_[_0x6892('0x58')]({},_0x1f1f9d,_0x37c8e8[_0x6892('0x5d')]);return _0x468596[_0x6892('0xc4')](_0x1f1f9d);}})[_0x6892('0x21')](function(_0x2ae73a){if(_0x2ae73a){_0x1a0572=_0x2ae73a[_0x6892('0x51')];if(!_0x37c8e8[_0x6892('0x4c')][_0x6892('0x52')](_0x6892('0x53'))){_0x1f1f9d[_0x6892('0x30')]=qs[_0x6892('0x30')](_0x37c8e8[_0x6892('0x4c')]['limit']);_0x1f1f9d['offset']=qs[_0x6892('0x2f')](_0x37c8e8[_0x6892('0x4c')]['offset']);}return _0x468596[_0x6892('0xc4')](_0x1f1f9d);}})[_0x6892('0x21')](function(_0x1ebe54){if(_0x1ebe54){return _0x1ebe54?{'count':_0x1a0572,'rows':_0x1ebe54}:null;}})[_0x6892('0x21')](respondWithResult(_0x2e0f8c,null))[_0x6892('0x29')](handleError(_0x2e0f8c,null));};exports[_0x6892('0xc6')]=function(_0x3efad0,_0xa82829,_0x4abecf){var _0x3de2ce={'raw':!![],'where':{}};var _0x334e97={};var _0x403787={'count':0x0,'rows':[]};return db[_0x6892('0x45')][_0x6892('0x9d')]({'where':{'id':_0x3efad0[_0x6892('0x62')]['id']}})['then'](handleEntityNotFound(_0xa82829,null))['then'](function(_0x3792fc){if(_0x3792fc){_0x334e97[_0x6892('0x47')]=_[_0x6892('0x49')](db[_0x6892('0xc7')][_0x6892('0x46')]);_0x334e97['query']=_[_0x6892('0x49')](_0x3efad0[_0x6892('0x4c')]);_0x334e97[_0x6892('0x4d')]=_[_0x6892('0x4e')](_0x334e97[_0x6892('0x47')],_0x334e97[_0x6892('0x4c')]);_0x3de2ce[_0x6892('0x4f')]=_['intersection'](_0x334e97['model'],qs['fields'](_0x3efad0[_0x6892('0x4c')][_0x6892('0x50')]));_0x3de2ce['attributes']=_0x3de2ce['attributes']['length']?_0x3de2ce[_0x6892('0x4f')]:_0x334e97['model'];if(!_0x3efad0[_0x6892('0x4c')]['hasOwnProperty'](_0x6892('0x53'))){_0x3de2ce['limit']=qs['limit'](_0x3efad0['query'][_0x6892('0x30')]);_0x3de2ce[_0x6892('0x2f')]=qs[_0x6892('0x2f')](_0x3efad0[_0x6892('0x4c')][_0x6892('0x2f')]);}_0x3de2ce[_0x6892('0x54')]=qs['sort'](_0x3efad0[_0x6892('0x4c')][_0x6892('0x55')]);_0x3de2ce[_0x6892('0x56')]=qs[_0x6892('0x4d')](_[_0x6892('0x57')](_0x3efad0[_0x6892('0x4c')],_0x334e97[_0x6892('0x4d')]));_0x3de2ce['where'][_0x6892('0xc8')]=_0x3792fc['id'];if(_0x3efad0[_0x6892('0x4c')][_0x6892('0x3c')]){_0x3de2ce['where']=_[_0x6892('0x58')](_0x3de2ce[_0x6892('0x56')],{'$or':_[_0x6892('0x3e')](_0x3de2ce[_0x6892('0x4f')],function(_0x5b9f47){var _0x38ff2f={};_0x38ff2f[_0x5b9f47]={'$like':'%'+_0x3efad0[_0x6892('0x4c')]['filter']+'%'};return _0x38ff2f;})});}_0x3de2ce=_[_0x6892('0x58')]({},_0x3de2ce,_0x3efad0[_0x6892('0x5d')]);return db['VoiceRecording'][_0x6892('0x2e')]({'where':_0x3de2ce[_0x6892('0x56')]})[_0x6892('0x21')](function(_0x4e56d1){_0x403787[_0x6892('0x2e')]=_0x4e56d1;if(_0x3efad0[_0x6892('0x4c')][_0x6892('0x5e')]){_0x3de2ce[_0x6892('0x5f')]=[{'all':!![]}];}return db[_0x6892('0xc7')][_0x6892('0x60')](_0x3de2ce);})[_0x6892('0x21')](function(_0x2b3c8f){_0x403787[_0x6892('0xc9')]=_0x2b3c8f;return _0x403787;});}})['then'](respondWithFilteredResult(_0xa82829,_0x3de2ce))[_0x6892('0x29')](handleError(_0xa82829,null));};exports[_0x6892('0xca')]=function(_0x2c67de,_0x34d42e,_0x4374f5){var _0x2d5242={'raw':!![],'where':{}};var _0x12a973={};var _0x7290c8={'count':0x0,'rows':[]};return db[_0x6892('0x45')][_0x6892('0x9d')]({'where':{'id':_0x2c67de[_0x6892('0x62')]['id']}})[_0x6892('0x21')](handleEntityNotFound(_0x34d42e,null))[_0x6892('0x21')](function(_0x4edfd5){if(_0x4edfd5){_0x12a973['model']=_['keys'](db['ScreenRecording'][_0x6892('0x46')]);_0x12a973[_0x6892('0x4c')]=_[_0x6892('0x49')](_0x2c67de['query']);_0x12a973['filters']=_['intersection'](_0x12a973[_0x6892('0x47')],_0x12a973[_0x6892('0x4c')]);_0x2d5242[_0x6892('0x4f')]=_[_0x6892('0x4e')](_0x12a973[_0x6892('0x47')],qs['fields'](_0x2c67de[_0x6892('0x4c')][_0x6892('0x50')]));_0x2d5242[_0x6892('0x4f')]=_0x2d5242[_0x6892('0x4f')][_0x6892('0x51')]?_0x2d5242[_0x6892('0x4f')]:_0x12a973[_0x6892('0x47')];if(!_0x2c67de['query']['hasOwnProperty']('nolimit')){_0x2d5242[_0x6892('0x30')]=qs['limit'](_0x2c67de[_0x6892('0x4c')]['limit']);_0x2d5242[_0x6892('0x2f')]=qs[_0x6892('0x2f')](_0x2c67de[_0x6892('0x4c')]['offset']);}_0x2d5242[_0x6892('0x54')]=qs[_0x6892('0x55')](_0x2c67de['query'][_0x6892('0x55')]);_0x2d5242['where']=qs['filters'](_[_0x6892('0x57')](_0x2c67de['query'],_0x12a973['filters']));_0x2d5242['where'][_0x6892('0xc8')]=_0x4edfd5['id'];if(_0x2c67de[_0x6892('0x4c')][_0x6892('0x3c')]){_0x2d5242['where']=_[_0x6892('0x58')](_0x2d5242[_0x6892('0x56')],{'$or':_[_0x6892('0x3e')](_0x2d5242[_0x6892('0x4f')],function(_0x3c59b5){var _0x44f1cf={};_0x44f1cf[_0x3c59b5]={'$like':'%'+_0x2c67de[_0x6892('0x4c')][_0x6892('0x3c')]+'%'};return _0x44f1cf;})});}_0x2d5242=_[_0x6892('0x58')]({},_0x2d5242,_0x2c67de[_0x6892('0x5d')]);return db[_0x6892('0xcb')]['count']({'where':_0x2d5242['where']})[_0x6892('0x21')](function(_0x5bfac7){_0x7290c8[_0x6892('0x2e')]=_0x5bfac7;if(_0x2c67de['query'][_0x6892('0x5e')]){_0x2d5242[_0x6892('0x5f')]=[{'all':!![]}];}return db[_0x6892('0xcb')]['findAll'](_0x2d5242);})[_0x6892('0x21')](function(_0x574feb){_0x7290c8[_0x6892('0xc9')]=_0x574feb;return _0x7290c8;});}})[_0x6892('0x21')](respondWithFilteredResult(_0x34d42e,_0x2d5242))['catch'](handleError(_0x34d42e,null));};exports[_0x6892('0xcc')]=function(_0x158501,_0x512917,_0x4d0e4f){var _0x168e39={};var _0x7793f={};var _0x3c80ea;var _0x1b7bda;return db[_0x6892('0x45')]['findOne']({'where':{'id':_0x158501['params']['id']}})[_0x6892('0x21')](handleEntityNotFound(_0x512917,null))[_0x6892('0x21')](function(_0x96ea75){if(_0x96ea75){_0x3c80ea=_0x96ea75;_0x7793f[_0x6892('0x47')]=_['keys'](db[_0x6892('0xcd')][_0x6892('0x46')]);_0x7793f[_0x6892('0x4c')]=_[_0x6892('0x49')](_0x158501[_0x6892('0x4c')]);_0x7793f['filters']=_['intersection'](_0x7793f[_0x6892('0x47')],_0x7793f[_0x6892('0x4c')]);_0x168e39[_0x6892('0x4f')]=_['intersection'](_0x7793f[_0x6892('0x47')],qs['fields'](_0x158501['query'][_0x6892('0x50')]));_0x168e39['attributes']=_0x168e39[_0x6892('0x4f')][_0x6892('0x51')]?_0x168e39[_0x6892('0x4f')]:_0x7793f[_0x6892('0x47')];_0x168e39[_0x6892('0x54')]=qs[_0x6892('0x55')](_0x158501[_0x6892('0x4c')]['sort']);_0x168e39[_0x6892('0x56')]=qs[_0x6892('0x4d')](_[_0x6892('0x57')](_0x158501[_0x6892('0x4c')],_0x7793f[_0x6892('0x4d')]));if(_0x158501['query']['filter']){_0x168e39[_0x6892('0x56')]=_[_0x6892('0x58')](_0x168e39['where'],{'$or':_[_0x6892('0x3e')](_0x168e39[_0x6892('0x4f')],function(_0x26ad45){var _0x44cc50={};_0x44cc50[_0x26ad45]={'$like':'%'+_0x158501[_0x6892('0x4c')][_0x6892('0x3c')]+'%'};return _0x44cc50;})});}_0x168e39=_['merge']({},_0x168e39,_0x158501[_0x6892('0x5d')]);return _0x3c80ea[_0x6892('0xcc')](_0x168e39);}})['then'](function(_0x582c68){if(_0x582c68){_0x1b7bda=_0x582c68[_0x6892('0x51')];if(!_0x158501['query'][_0x6892('0x52')]('nolimit')){_0x168e39[_0x6892('0x30')]=qs[_0x6892('0x30')](_0x158501[_0x6892('0x4c')][_0x6892('0x30')]);_0x168e39[_0x6892('0x2f')]=qs[_0x6892('0x2f')](_0x158501[_0x6892('0x4c')]['offset']);}return _0x3c80ea[_0x6892('0xcc')](_0x168e39);}})['then'](function(_0x46b802){if(_0x46b802){return _0x46b802?{'count':_0x1b7bda,'rows':_0x46b802}:null;}})['then'](respondWithResult(_0x512917,null))['catch'](handleError(_0x512917,null));};exports[_0x6892('0xce')]=function(_0x39d4a9,_0x49d58b,_0x1b0cf5){var _0x3331ed={};var _0x3b29d2={};var _0x392411;var _0x1939cb;return db[_0x6892('0x45')]['findOne']({'where':{'id':_0x39d4a9[_0x6892('0x62')]['id']}})[_0x6892('0x21')](handleEntityNotFound(_0x49d58b,null))[_0x6892('0x21')](function(_0x2f07e9){if(_0x2f07e9){_0x392411=_0x2f07e9;_0x3b29d2['model']=_['keys'](db[_0x6892('0xcf')][_0x6892('0x46')]);_0x3b29d2['query']=_['keys'](_0x39d4a9[_0x6892('0x4c')]);_0x3b29d2['filters']=_[_0x6892('0x4e')](_0x3b29d2[_0x6892('0x47')],_0x3b29d2[_0x6892('0x4c')]);_0x3331ed[_0x6892('0x4f')]=_[_0x6892('0x4e')](_0x3b29d2[_0x6892('0x47')],qs['fields'](_0x39d4a9[_0x6892('0x4c')][_0x6892('0x50')]));_0x3331ed['attributes']=_0x3331ed[_0x6892('0x4f')][_0x6892('0x51')]?_0x3331ed[_0x6892('0x4f')]:_0x3b29d2['model'];_0x3331ed[_0x6892('0x54')]=qs['sort'](_0x39d4a9[_0x6892('0x4c')][_0x6892('0x55')]);_0x3331ed[_0x6892('0x56')]=qs[_0x6892('0x4d')](_['pick'](_0x39d4a9[_0x6892('0x4c')],_0x3b29d2[_0x6892('0x4d')]));if(_0x39d4a9['query'][_0x6892('0x3c')]){_0x3331ed[_0x6892('0x56')]=_[_0x6892('0x58')](_0x3331ed[_0x6892('0x56')],{'$or':_[_0x6892('0x3e')](_0x3331ed[_0x6892('0x4f')],function(_0x15d1be){var _0x5dd0aa={};_0x5dd0aa[_0x15d1be]={'$like':'%'+_0x39d4a9[_0x6892('0x4c')][_0x6892('0x3c')]+'%'};return _0x5dd0aa;})});}_0x3331ed=_[_0x6892('0x58')]({},_0x3331ed,_0x39d4a9[_0x6892('0x5d')]);return _0x392411[_0x6892('0xce')](_0x3331ed);}})[_0x6892('0x21')](function(_0x379132){if(_0x379132){_0x1939cb=_0x379132[_0x6892('0x51')];if(!_0x39d4a9[_0x6892('0x4c')][_0x6892('0x52')](_0x6892('0x53'))){_0x3331ed[_0x6892('0x30')]=qs[_0x6892('0x30')](_0x39d4a9['query'][_0x6892('0x30')]);_0x3331ed[_0x6892('0x2f')]=qs[_0x6892('0x2f')](_0x39d4a9[_0x6892('0x4c')][_0x6892('0x2f')]);}return _0x392411[_0x6892('0xce')](_0x3331ed);}})[_0x6892('0x21')](function(_0x26cf3f){if(_0x26cf3f){return _0x26cf3f?{'count':_0x1939cb,'rows':_0x26cf3f}:null;}})[_0x6892('0x21')](respondWithResult(_0x49d58b,null))[_0x6892('0x29')](handleError(_0x49d58b,null));};exports['getMailInteractions']=function(_0x4e9cc3,_0x2d2a1f,_0x260db5){var _0x3cbf25={'raw':!![],'where':{}};var _0x1e7645={};var _0x57442d={'count':0x0,'rows':[]};return db[_0x6892('0x45')]['findOne']({'where':{'id':_0x4e9cc3[_0x6892('0x62')]['id']}})[_0x6892('0x21')](handleEntityNotFound(_0x2d2a1f,null))['then'](function(_0x42b13f){if(_0x42b13f){_0x1e7645[_0x6892('0x47')]=_[_0x6892('0x49')](db[_0x6892('0xd0')][_0x6892('0x46')]);_0x1e7645[_0x6892('0x4c')]=_[_0x6892('0x49')](_0x4e9cc3[_0x6892('0x4c')]);_0x1e7645['filters']=_[_0x6892('0x4e')](_0x1e7645[_0x6892('0x47')],_0x1e7645[_0x6892('0x4c')]);_0x3cbf25['attributes']=_[_0x6892('0x4e')](_0x1e7645['model'],qs[_0x6892('0x50')](_0x4e9cc3['query'][_0x6892('0x50')]));_0x3cbf25[_0x6892('0x4f')]=_0x3cbf25[_0x6892('0x4f')][_0x6892('0x51')]?_0x3cbf25['attributes']:_0x1e7645['model'];if(!_0x4e9cc3[_0x6892('0x4c')]['hasOwnProperty'](_0x6892('0x53'))){_0x3cbf25[_0x6892('0x30')]=qs[_0x6892('0x30')](_0x4e9cc3[_0x6892('0x4c')][_0x6892('0x30')]);_0x3cbf25[_0x6892('0x2f')]=qs[_0x6892('0x2f')](_0x4e9cc3[_0x6892('0x4c')][_0x6892('0x2f')]);}_0x3cbf25[_0x6892('0x54')]=qs[_0x6892('0x55')](_0x4e9cc3[_0x6892('0x4c')]['sort']);_0x3cbf25[_0x6892('0x56')]=qs[_0x6892('0x4d')](_[_0x6892('0x57')](_0x4e9cc3[_0x6892('0x4c')],_0x1e7645[_0x6892('0x4d')]));_0x3cbf25[_0x6892('0x56')][_0x6892('0xc8')]=_0x42b13f['id'];if(_0x4e9cc3[_0x6892('0x4c')][_0x6892('0x3c')]){_0x3cbf25[_0x6892('0x56')]=_[_0x6892('0x58')](_0x3cbf25[_0x6892('0x56')],{'$or':_['map'](_0x3cbf25['attributes'],function(_0x98e654){var _0x48ba04={};_0x48ba04[_0x98e654]={'$like':'%'+_0x4e9cc3[_0x6892('0x4c')][_0x6892('0x3c')]+'%'};return _0x48ba04;})});}_0x3cbf25=_[_0x6892('0x58')]({},_0x3cbf25,_0x4e9cc3[_0x6892('0x5d')]);return db[_0x6892('0xd0')][_0x6892('0x2e')]({'where':_0x3cbf25[_0x6892('0x56')]})['then'](function(_0x3ea5c0){_0x57442d['count']=_0x3ea5c0;if(_0x4e9cc3['query'][_0x6892('0x5e')]){_0x3cbf25[_0x6892('0x5f')]=[{'all':!![]}];}return db[_0x6892('0xd0')][_0x6892('0x60')](_0x3cbf25);})[_0x6892('0x21')](function(_0x32654b){_0x57442d[_0x6892('0xc9')]=_0x32654b;return _0x57442d;});}})[_0x6892('0x21')](respondWithFilteredResult(_0x2d2a1f,_0x3cbf25))[_0x6892('0x29')](handleError(_0x2d2a1f,null));};exports['getSmsInteractions']=function(_0x33d7b6,_0x2d45d,_0x2b522b){var _0x4e26be={};var _0x2b72d5={};var _0x46d42d;var _0x20bd04;return db['User'][_0x6892('0x9d')]({'where':{'id':_0x33d7b6['params']['id']}})[_0x6892('0x21')](handleEntityNotFound(_0x2d45d,null))[_0x6892('0x21')](function(_0x4c2169){if(_0x4c2169){_0x46d42d=_0x4c2169;_0x2b72d5['model']=_[_0x6892('0x49')](db[_0x6892('0xd1')][_0x6892('0x46')]);_0x2b72d5[_0x6892('0x4c')]=_[_0x6892('0x49')](_0x33d7b6[_0x6892('0x4c')]);_0x2b72d5[_0x6892('0x4d')]=_[_0x6892('0x4e')](_0x2b72d5[_0x6892('0x47')],_0x2b72d5[_0x6892('0x4c')]);_0x4e26be[_0x6892('0x4f')]=_[_0x6892('0x4e')](_0x2b72d5['model'],qs['fields'](_0x33d7b6[_0x6892('0x4c')][_0x6892('0x50')]));_0x4e26be[_0x6892('0x4f')]=_0x4e26be[_0x6892('0x4f')][_0x6892('0x51')]?_0x4e26be[_0x6892('0x4f')]:_0x2b72d5['model'];_0x4e26be[_0x6892('0x54')]=qs[_0x6892('0x55')](_0x33d7b6['query'][_0x6892('0x55')]);_0x4e26be['where']=qs[_0x6892('0x4d')](_[_0x6892('0x57')](_0x33d7b6[_0x6892('0x4c')],_0x2b72d5[_0x6892('0x4d')]));if(_0x33d7b6[_0x6892('0x4c')]['filter']){_0x4e26be['where']=_[_0x6892('0x58')](_0x4e26be['where'],{'$or':_['map'](_0x4e26be[_0x6892('0x4f')],function(_0x430531){var _0x10a6ba={};_0x10a6ba[_0x430531]={'$like':'%'+_0x33d7b6['query'][_0x6892('0x3c')]+'%'};return _0x10a6ba;})});}_0x4e26be=_['merge']({},_0x4e26be,_0x33d7b6[_0x6892('0x5d')]);return _0x46d42d[_0x6892('0xd2')](_0x4e26be);}})['then'](function(_0x1c6676){if(_0x1c6676){_0x20bd04=_0x1c6676[_0x6892('0x51')];if(!_0x33d7b6[_0x6892('0x4c')][_0x6892('0x52')](_0x6892('0x53'))){_0x4e26be[_0x6892('0x30')]=qs[_0x6892('0x30')](_0x33d7b6[_0x6892('0x4c')]['limit']);_0x4e26be[_0x6892('0x2f')]=qs[_0x6892('0x2f')](_0x33d7b6['query'][_0x6892('0x2f')]);}return _0x46d42d['getSmsInteractions'](_0x4e26be);}})[_0x6892('0x21')](function(_0x34eb48){if(_0x34eb48){return _0x34eb48?{'count':_0x20bd04,'rows':_0x34eb48}:null;}})[_0x6892('0x21')](respondWithResult(_0x2d45d,null))[_0x6892('0x29')](handleError(_0x2d45d,null));};exports[_0x6892('0xd3')]=function(_0x4a2dcc,_0x45ce3a,_0x5ddee5){var _0x4571b0={};var _0x236820={};var _0x5b62a1;var _0x4194ba;return db['User'][_0x6892('0x9d')]({'where':{'id':_0x4a2dcc[_0x6892('0x62')]['id']}})[_0x6892('0x21')](handleEntityNotFound(_0x45ce3a,null))[_0x6892('0x21')](function(_0x5253d7){if(_0x5253d7){_0x5b62a1=_0x5253d7;_0x236820['model']=_[_0x6892('0x49')](db['FaxInteraction'][_0x6892('0x46')]);_0x236820['query']=_['keys'](_0x4a2dcc[_0x6892('0x4c')]);_0x236820[_0x6892('0x4d')]=_['intersection'](_0x236820[_0x6892('0x47')],_0x236820[_0x6892('0x4c')]);_0x4571b0[_0x6892('0x4f')]=_[_0x6892('0x4e')](_0x236820[_0x6892('0x47')],qs[_0x6892('0x50')](_0x4a2dcc[_0x6892('0x4c')][_0x6892('0x50')]));_0x4571b0[_0x6892('0x4f')]=_0x4571b0[_0x6892('0x4f')][_0x6892('0x51')]?_0x4571b0[_0x6892('0x4f')]:_0x236820[_0x6892('0x47')];_0x4571b0[_0x6892('0x54')]=qs['sort'](_0x4a2dcc[_0x6892('0x4c')][_0x6892('0x55')]);_0x4571b0['where']=qs[_0x6892('0x4d')](_[_0x6892('0x57')](_0x4a2dcc[_0x6892('0x4c')],_0x236820[_0x6892('0x4d')]));if(_0x4a2dcc['query'][_0x6892('0x3c')]){_0x4571b0[_0x6892('0x56')]=_[_0x6892('0x58')](_0x4571b0[_0x6892('0x56')],{'$or':_[_0x6892('0x3e')](_0x4571b0[_0x6892('0x4f')],function(_0x32ea9b){var _0x190959={};_0x190959[_0x32ea9b]={'$like':'%'+_0x4a2dcc[_0x6892('0x4c')][_0x6892('0x3c')]+'%'};return _0x190959;})});}_0x4571b0=_[_0x6892('0x58')]({},_0x4571b0,_0x4a2dcc[_0x6892('0x5d')]);return _0x5b62a1[_0x6892('0xd3')](_0x4571b0);}})['then'](function(_0xee4a84){if(_0xee4a84){_0x4194ba=_0xee4a84['length'];if(!_0x4a2dcc[_0x6892('0x4c')][_0x6892('0x52')](_0x6892('0x53'))){_0x4571b0['limit']=qs[_0x6892('0x30')](_0x4a2dcc['query'][_0x6892('0x30')]);_0x4571b0['offset']=qs[_0x6892('0x2f')](_0x4a2dcc[_0x6892('0x4c')][_0x6892('0x2f')]);}return _0x5b62a1['getFaxInteractions'](_0x4571b0);}})['then'](function(_0x2dadb7){if(_0x2dadb7){return _0x2dadb7?{'count':_0x4194ba,'rows':_0x2dadb7}:null;}})[_0x6892('0x21')](respondWithResult(_0x45ce3a,null))[_0x6892('0x29')](handleError(_0x45ce3a,null));};exports['login']=function(_0x10729c,_0x41b7a3,_0x384579){var _0x356ee6;var _0x501224;var _0x4ff5ac;var _0x4beb30=!_['isNil'](_0x10729c['params']['id'])?_0x10729c[_0x6892('0x62')]['id']:!_['isNil'](_0x10729c[_0x6892('0x37')]['id'])?_0x10729c[_0x6892('0x37')]['id']:null;return db[_0x6892('0x45')][_0x6892('0x42')]({'where':{'id':_0x4beb30,'role':_0x6892('0x39')},'attributes':['id',_0x6892('0x43'),_0x6892('0xd4'),'mobile','role','internal',_0x6892('0xa0')]})[_0x6892('0x21')](handleEntityNotFound(_0x41b7a3,null))[_0x6892('0x21')](function(_0x489631){if(_0x489631){_0x356ee6=_0x489631;if(_0x10729c[_0x6892('0x64')][_0x6892('0xa2')]){_0x4ff5ac=util[_0x6892('0xd5')](_0x6892('0xd6'),_0x356ee6[_0x10729c[_0x6892('0x64')][_0x6892('0xa2')]]);}else if(_0x10729c[_0x6892('0x64')]['intrf']){_0x4ff5ac=util[_0x6892('0xd5')](_0x6892('0xae'),_0x10729c[_0x6892('0x64')][_0x6892('0xd7')]);}else{_0x4ff5ac=util[_0x6892('0xd5')](_0x6892('0xae'),_0x356ee6['name']);}socket['to'](util['format'](_0x6892('0xd8'),_0x356ee6['name']))[_0x6892('0xaa')](_0x6892('0xd9'),{'ip':_0x10729c[_0x6892('0xda')][_0x6892('0xdb')]||_0x10729c['connection'][_0x6892('0xdc')]||_0x10729c[_0x6892('0xdd')][_0x6892('0xdc')]||_0x10729c['connection'][_0x6892('0xdd')]['remoteAddress']});return db[_0x6892('0xb3')][_0x6892('0x34')]({'where':{'membername':_0x356ee6['name']},'individualHooks':!![]});}})[_0x6892('0x21')](function(_0x203949){if(_0x356ee6){return _0x356ee6[_0x6892('0xde')]({'raw':!![]});}})[_0x6892('0x21')](function(_0x5c4c32){var _0x32c41f=[];if(_0x5c4c32){_0x501224=_0x5c4c32;if(_0x501224[_0x6892('0x51')]){for(var _0x113da8=0x0;_0x113da8<_0x501224[_0x6892('0x51')];_0x113da8++){_0x32c41f[_0x6892('0xdf')]({'membername':_0x356ee6[_0x6892('0x43')],'UserId':_0x356ee6['id'],'queue_name':_0x501224[_0x113da8][_0x6892('0x43')],'VoiceQueueId':_0x501224[_0x113da8]['id'],'interface':_0x4ff5ac,'paused':_0x356ee6['loginInPause']||![],'penalty':_0x501224[_0x113da8][_0x6892('0xe0')]||0x0});}return BPromise[_0x6892('0xaf')](_0x32c41f,function(_0x381c3e){return db[_0x6892('0xb3')][_0x6892('0xb0')](_0x381c3e);});}}})[_0x6892('0x21')](function(){return db[_0x6892('0xe1')]['findAll']({'where':{'membername':_0x356ee6[_0x6892('0x43')],'exitAt':null}});})['then'](function(_0x533270){var _0x397b9d=[];_0x533270[_0x6892('0xe2')](function(_0x372f85){_0x397b9d[_0x6892('0xdf')](_0x372f85[_0x6892('0xe3')]({'exitAt':moment()[_0x6892('0xd5')](_0x6892('0xe4'))}));});return BPromise[_0x6892('0xe5')](_0x397b9d);})[_0x6892('0x21')](function(){var _0x42da5a=[];var _0x58d45c=[];var _0x51a954=utils[_0x6892('0xe6')]();var _0x59acb7={'membername':_0x356ee6[_0x6892('0x43')],'interface':_0x4ff5ac,'enterAt':moment()[_0x6892('0xd5')](_0x6892('0xe4')),'role':_0x356ee6['role'],'internal':_0x356ee6[_0x6892('0x73')]};_0x51a954[_0x6892('0xe2')](function(_0x2a0c4b){_0x42da5a[_0x6892('0xdf')](_['merge']({'channel':_0x2a0c4b,'type':'LOGIN','data1':_0x10729c[_0x6892('0x64')][_0x6892('0xe7')],'data2':_0x4ff5ac},_0x59acb7));if(_0x356ee6[_0x6892('0xa0')]){_0x58d45c[_0x6892('0xdf')](_[_0x6892('0x58')]({'channel':_0x2a0c4b,'type':_0x6892('0xe8'),'data1':'LOGININPAUSE'},_0x59acb7));}});return db['MemberReport']['bulkCreate'](_0x42da5a['concat'](_0x58d45c),{'individualHooks':!![]});})['then'](function(){return _0x356ee6[_0x6892('0xe3')]({'online':!![],'lastLoginAt':moment()[_0x6892('0xd5')](_0x6892('0xe4')),'voicePause':_0x356ee6[_0x6892('0xa0')]||![],'mailPause':_0x356ee6[_0x6892('0xa0')]||![],'chatPause':_0x356ee6[_0x6892('0xa0')]||![],'faxPause':_0x356ee6[_0x6892('0xa0')]||![],'smsPause':_0x356ee6['loginInPause']||![],'openchannelPause':_0x356ee6[_0x6892('0xa0')]||![],'pauseType':_0x356ee6[_0x6892('0xa0')]?_0x6892('0xe9'):null,'interface':_0x4ff5ac,'lastPauseAt':moment()[_0x6892('0xd5')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x6892('0x21')](function(_0x1ca922){if(_0x10729c[_0x6892('0xea')]){return _0x384579();}else{return BPromise[_0x6892('0xeb')](_0x1ca922)['then'](respondWithResult(_0x41b7a3,null));}})[_0x6892('0x29')](handleError(_0x41b7a3,null));};exports['logout']=function(_0x49bb0a,_0x332edd,_0x2beb80){var _0x59e90b;return db[_0x6892('0x45')][_0x6892('0x42')]({'where':{'id':_0x49bb0a[_0x6892('0x62')]['id'],'role':_0x6892('0x39')},'attributes':['id',_0x6892('0x43'),'role']})['then'](handleEntityNotFound(_0x332edd,null))[_0x6892('0x21')](function(_0x2168fb){if(_0x2168fb){_0x59e90b=_0x2168fb;return db['UserVoiceQueueRt'][_0x6892('0x34')]({'where':{'membername':_0x59e90b['name']},'individualHooks':!![]});}})[_0x6892('0x21')](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x59e90b[_0x6892('0x43')],'exitAt':null}});})[_0x6892('0x21')](function(_0x14c7e6){var _0x5020dd=[];_0x14c7e6[_0x6892('0xe2')](function(_0x2e057a){_0x5020dd['push'](_0x2e057a[_0x6892('0xe3')]({'exitAt':moment()[_0x6892('0xd5')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x6892('0xe5')](_0x5020dd);})[_0x6892('0x21')](function(){return _0x59e90b[_0x6892('0xe3')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})[_0x6892('0x21')](respondWithResult(_0x332edd,null))[_0x6892('0x29')](handleError(_0x332edd,null));};exports[_0x6892('0xec')]=function(_0xaeef62,_0x3b29e6,_0x19eddd){var _0xaa3e56;return db[_0x6892('0xb3')][_0x6892('0xe3')]({'paused':0x1},{'where':{'UserId':_0xaeef62[_0x6892('0x62')]['id']},'individualHooks':!![]})[_0x6892('0x21')](function(){return db[_0x6892('0x45')]['find']({'where':{'id':_0xaeef62[_0x6892('0x62')]['id'],'role':'agent'},'attributes':['id','name',_0x6892('0x41'),_0x6892('0x73'),'interface']});})[_0x6892('0x21')](handleEntityNotFound(_0x3b29e6,null))[_0x6892('0x21')](function(_0x38275c){if(_0x38275c){_0xaa3e56=_0x38275c;return respondWithRpcPromise(_0x6892('0xed'),_0x6892('0xec'),{'id':_0xaa3e56['id'],'name':_0xaa3e56[_0x6892('0x43')],'pause':!![]});}})[_0x6892('0x21')](function(){if(_0xaa3e56){return db['MemberReport']['findAll']({'where':{'membername':_0xaa3e56['name'],'type':_0x6892('0xe8'),'exitAt':null}});}})[_0x6892('0x21')](function(_0x2abb3a){if(_0x2abb3a[_0x6892('0x51')]){var _0x53680e=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x3ea891=0x0,_0x2f8d4f=_0x2abb3a[_0x6892('0x51')];_0x3ea891<_0x2f8d4f;_0x3ea891++){_0x2abb3a[_0x3ea891][_0x6892('0xee')]({'exitAt':_0x53680e});}}})[_0x6892('0x21')](function(){var _0x16fbdb=[];var _0x38eca1=utils[_0x6892('0xe6')]();_0x38eca1['forEach'](function(_0x163562){_0x16fbdb['push']({'channel':_0x163562,'membername':_0xaa3e56['name'],'interface':_['isNil'](_0xaa3e56[_0x6892('0xa2')])?util[_0x6892('0xd5')](_0x6892('0xae'),_0xaa3e56[_0x6892('0x43')]):_0xaa3e56[_0x6892('0xa2')],'type':'PAUSE','enterAt':moment()[_0x6892('0xd5')](_0x6892('0xe4')),'data1':_0xaeef62[_0x6892('0x64')][_0x6892('0xef')]||_0x6892('0xf0'),'role':_0xaa3e56[_0x6892('0x41')],'internal':_0xaa3e56[_0x6892('0x73')]});});return db['MemberReport'][_0x6892('0x63')](_0x16fbdb,{'individualHooks':!![]});})[_0x6892('0x21')](function(){return _0xaa3e56['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0xaeef62[_0x6892('0x64')][_0x6892('0xef')]||_0x6892('0xf0'),'lastPauseAt':moment()[_0x6892('0xd5')](_0x6892('0xe4'))});})[_0x6892('0x21')](respondWithResult(_0x3b29e6,null))['catch'](handleError(_0x3b29e6,null));};exports['unpause']=function(_0x2fa2c1,_0x5b7e43,_0x486d9d){var _0x6d62eb;return db[_0x6892('0x45')][_0x6892('0x42')]({'where':{'id':_0x2fa2c1[_0x6892('0x62')]['id']},'attributes':['id',_0x6892('0x43'),'role','voicePause',_0x6892('0xf1'),_0x6892('0xf2'),_0x6892('0xf3'),_0x6892('0xf4'),_0x6892('0xf5'),_0x6892('0xf6'),_0x6892('0xf7')]})[_0x6892('0x21')](handleEntityNotFound(_0x5b7e43,null))[_0x6892('0x21')](function(_0x357df0){if(_0x357df0){_0x6d62eb=_0x357df0;if(_0x2fa2c1[_0x6892('0x64')]['channel']&&!utils[_0x6892('0xb1')](_0x2fa2c1[_0x6892('0x64')]['channel'])){throw new db[(_0x6892('0x96'))][(_0x6892('0x97'))](_0x6892('0xa3'));}switch(_0x2fa2c1[_0x6892('0x64')]['channel']){case _0x6892('0xad'):return respondWithRpcPromise('QueuePause','unpause',{'id':_0x6d62eb['id'],'name':_0x6d62eb[_0x6892('0x43')],'pause':![]})[_0x6892('0x21')](function(){return db['UserVoiceQueueRt'][_0x6892('0xe3')]({'paused':0x0},{'where':{'UserId':_0x6d62eb['id']},'individualHooks':!![]});})[_0x6892('0x21')](function(){return db[_0x6892('0xe1')][_0x6892('0x42')]({'where':{'channel':_0x2fa2c1[_0x6892('0x64')][_0x6892('0x9e')],'membername':_0x6d62eb[_0x6892('0x43')],'type':_0x6892('0xe8'),'exitAt':null}});})[_0x6892('0x21')](function(_0x230baa){if(_0x230baa){return _0x230baa[_0x6892('0xe3')]({'exitAt':moment()[_0x6892('0xd5')](_0x6892('0xe4')),'data2':_0x6892('0xf8')},{'individualHooks':!![]});}return null;})[_0x6892('0x21')](function(){return _0x6d62eb[_0x6892('0xe3')]({'voicePause':![]});});case _0x6892('0xf9'):case _0x6892('0xfa'):case _0x6892('0xfb'):case _0x6892('0xfc'):case'openchannel':return db[_0x6892('0xe1')][_0x6892('0x42')]({'where':{'channel':_0x2fa2c1[_0x6892('0x64')]['channel'],'membername':_0x6d62eb[_0x6892('0x43')],'type':'PAUSE','exitAt':null}})[_0x6892('0x21')](function(_0x11a1cd){if(_0x11a1cd){return _0x11a1cd['update']({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x6892('0xf8')},{'individualHooks':!![]});}return null;})['then'](function(){var _0x2bdeb8={};_['set'](_0x2bdeb8,util[_0x6892('0xd5')](_0x6892('0xfd'),_0x2fa2c1[_0x6892('0x64')][_0x6892('0x9e')],_0x6892('0xfe')),![]);return _0x6d62eb['update'](_0x2bdeb8);});default:return respondWithRpcPromise('QueuePause',_0x6892('0xff'),{'id':_0x6d62eb['id'],'name':_0x6d62eb[_0x6892('0x43')],'pause':![]})[_0x6892('0x21')](function(){return db['UserVoiceQueueRt'][_0x6892('0xe3')]({'paused':0x0},{'where':{'UserId':_0x6d62eb['id']}});})[_0x6892('0x21')](function(){return db[_0x6892('0xe1')]['findAll']({'where':{'membername':_0x6d62eb['name'],'type':'PAUSE','exitAt':null}});})['then'](function(_0xbaabbe){var _0x4b1c52=[];_0xbaabbe[_0x6892('0xe2')](function(_0x6c491e){_0x4b1c52[_0x6892('0xdf')](_0x6c491e[_0x6892('0xe3')]({'exitAt':moment()[_0x6892('0xd5')](_0x6892('0xe4')),'data2':_0x6892('0xf8')}));});return BPromise['all'](_0x4b1c52);})['then'](function(){return _0x6d62eb[_0x6892('0xe3')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x6892('0x21')](respondWithResult(_0x5b7e43,null))[_0x6892('0x29')](handleError(_0x5b7e43,null));};exports['getTeams']=function(_0xd49fd7,_0x525933,_0x295463){var _0x195755={};var _0x209c09={};var _0x29a39e;var _0x451e0b;return db['User'][_0x6892('0x9d')]({'where':{'id':_0xd49fd7[_0x6892('0x62')]['id']}})[_0x6892('0x21')](handleEntityNotFound(_0x525933,null))[_0x6892('0x21')](function(_0x51ad26){if(_0x51ad26){_0x29a39e=_0x51ad26;_0x209c09[_0x6892('0x47')]=_['keys'](db[_0x6892('0x100')][_0x6892('0x46')]);_0x209c09[_0x6892('0x4c')]=_[_0x6892('0x49')](_0xd49fd7[_0x6892('0x4c')]);_0x209c09[_0x6892('0x4d')]=_[_0x6892('0x4e')](_0x209c09[_0x6892('0x47')],_0x209c09['query']);_0x195755[_0x6892('0x4f')]=_['intersection'](_0x209c09[_0x6892('0x47')],qs[_0x6892('0x50')](_0xd49fd7['query'][_0x6892('0x50')]));_0x195755[_0x6892('0x4f')]=_0x195755[_0x6892('0x4f')][_0x6892('0x51')]?_0x195755['attributes']:_0x209c09[_0x6892('0x47')];_0x195755[_0x6892('0x54')]=qs['sort'](_0xd49fd7['query'][_0x6892('0x55')]);_0x195755[_0x6892('0x56')]=qs[_0x6892('0x4d')](_['pick'](_0xd49fd7[_0x6892('0x4c')],_0x209c09[_0x6892('0x4d')]));if(_0xd49fd7[_0x6892('0x4c')][_0x6892('0x3c')]){_0x195755['where']=_[_0x6892('0x58')](_0x195755[_0x6892('0x56')],{'$or':_['map'](_0x195755[_0x6892('0x4f')],function(_0x4f07e7){var _0x4f85d4={};_0x4f85d4[_0x4f07e7]={'$like':'%'+_0xd49fd7[_0x6892('0x4c')][_0x6892('0x3c')]+'%'};return _0x4f85d4;})});}_0x195755=_['merge']({},_0x195755,_0xd49fd7[_0x6892('0x5d')]);return _0x29a39e[_0x6892('0x101')](_0x195755);}})[_0x6892('0x21')](function(_0x23f5f0){if(_0x23f5f0){_0x451e0b=_0x23f5f0['length'];if(!_0xd49fd7['query'][_0x6892('0x52')]('nolimit')){_0x195755[_0x6892('0x30')]=qs[_0x6892('0x30')](_0xd49fd7['query'][_0x6892('0x30')]);_0x195755[_0x6892('0x2f')]=qs[_0x6892('0x2f')](_0xd49fd7['query']['offset']);}return _0x29a39e[_0x6892('0x101')](_0x195755);}})[_0x6892('0x21')](function(_0x42cf88){if(_0x42cf88){return _0x42cf88?{'count':_0x451e0b,'rows':_0x42cf88}:null;}})[_0x6892('0x21')](respondWithResult(_0x525933,null))[_0x6892('0x29')](handleError(_0x525933,null));};exports[_0x6892('0x102')]=function(_0x5d5ba4,_0x4dbf38,_0x3f36e7){return db[_0x6892('0x45')][_0x6892('0x42')]({'where':{'id':_0x5d5ba4[_0x6892('0x62')]['id']}})[_0x6892('0x21')](handleEntityNotFound(_0x4dbf38,null))[_0x6892('0x21')](function(_0xc708e4){if(_0xc708e4){return _0xc708e4['addTeams'](_0x5d5ba4[_0x6892('0x64')][_0x6892('0x67')],_[_0x6892('0x68')](_0x5d5ba4[_0x6892('0x64')],['ids','id'])||{});}})[_0x6892('0x21')](respondWithResult(_0x4dbf38,null))[_0x6892('0x29')](handleError(_0x4dbf38,null));};exports[_0x6892('0x103')]=function(_0x59bfd0,_0x4222d1,_0x68d690){return db[_0x6892('0x45')][_0x6892('0x42')]({'where':{'id':_0x59bfd0['params']['id']}})[_0x6892('0x21')](handleEntityNotFound(_0x4222d1,null))[_0x6892('0x21')](function(_0x3de9d9){if(_0x3de9d9){return _0x3de9d9[_0x6892('0x103')](_0x59bfd0['query'][_0x6892('0x67')]);}})[_0x6892('0x21')](respondWithStatusCode(_0x4222d1,null))[_0x6892('0x29')](handleError(_0x4222d1,null));};exports[_0x6892('0x104')]=function(_0x16f738,_0x2872a4,_0x16401b){var _0x173fff={};var _0x52b047={};var _0x1b3c2f;var _0x425037;return db[_0x6892('0x45')][_0x6892('0x9d')]({'where':{'id':_0x16f738[_0x6892('0x62')]['id']}})[_0x6892('0x21')](handleEntityNotFound(_0x2872a4,null))[_0x6892('0x21')](function(_0x56fefd){if(_0x56fefd){_0x1b3c2f=_0x56fefd;_0x52b047[_0x6892('0x47')]=_[_0x6892('0x49')](db['CmList']['rawAttributes']);_0x52b047['query']=_[_0x6892('0x49')](_0x16f738[_0x6892('0x4c')]);_0x52b047[_0x6892('0x4d')]=_['intersection'](_0x52b047[_0x6892('0x47')],_0x52b047[_0x6892('0x4c')]);_0x173fff[_0x6892('0x4f')]=_[_0x6892('0x4e')](_0x52b047[_0x6892('0x47')],qs[_0x6892('0x50')](_0x16f738[_0x6892('0x4c')][_0x6892('0x50')]));_0x173fff[_0x6892('0x4f')]=_0x173fff[_0x6892('0x4f')][_0x6892('0x51')]?_0x173fff[_0x6892('0x4f')]:_0x52b047[_0x6892('0x47')];_0x173fff[_0x6892('0x54')]=qs[_0x6892('0x55')](_0x16f738[_0x6892('0x4c')][_0x6892('0x55')]);_0x173fff['where']=qs['filters'](_[_0x6892('0x57')](_0x16f738[_0x6892('0x4c')],_0x52b047[_0x6892('0x4d')]));if(_0x16f738[_0x6892('0x4c')][_0x6892('0x3c')]){_0x173fff[_0x6892('0x56')]=_['merge'](_0x173fff['where'],{'$or':_[_0x6892('0x3e')](_0x173fff[_0x6892('0x4f')],function(_0x11d3c5){var _0x32e9ab={};_0x32e9ab[_0x11d3c5]={'$like':'%'+_0x16f738[_0x6892('0x4c')][_0x6892('0x3c')]+'%'};return _0x32e9ab;})});}_0x173fff=_['merge']({},_0x173fff,_0x16f738[_0x6892('0x5d')]);return _0x1b3c2f[_0x6892('0x104')](_0x173fff);}})[_0x6892('0x21')](function(_0x439e22){if(_0x439e22){_0x425037=_0x439e22['length'];if(!_0x16f738[_0x6892('0x4c')]['hasOwnProperty'](_0x6892('0x53'))){_0x173fff[_0x6892('0x30')]=qs[_0x6892('0x30')](_0x16f738[_0x6892('0x4c')][_0x6892('0x30')]);_0x173fff[_0x6892('0x2f')]=qs[_0x6892('0x2f')](_0x16f738[_0x6892('0x4c')][_0x6892('0x2f')]);}return _0x1b3c2f[_0x6892('0x104')](_0x173fff);}})[_0x6892('0x21')](function(_0xdff3c3){if(_0xdff3c3){return _0xdff3c3?{'count':_0x425037,'rows':_0xdff3c3}:null;}})[_0x6892('0x21')](respondWithResult(_0x2872a4,null))[_0x6892('0x29')](handleError(_0x2872a4,null));};exports[_0x6892('0x105')]=function(_0x52dcc3,_0xc46582,_0x2f2bb3){var _0x226ac1={};var _0x506523={};var _0x4259f2;var _0x1f21f2;return db[_0x6892('0x45')][_0x6892('0x9d')]({'where':{'id':_0x52dcc3[_0x6892('0x62')]['id']}})[_0x6892('0x21')](handleEntityNotFound(_0xc46582,null))[_0x6892('0x21')](function(_0x91590b){if(_0x91590b){_0x4259f2=_0x91590b;_0x506523[_0x6892('0x47')]=_[_0x6892('0x49')](db[_0x6892('0x45')][_0x6892('0x46')]);_0x506523['query']=_[_0x6892('0x49')](_0x52dcc3[_0x6892('0x4c')]);_0x506523['filters']=_[_0x6892('0x4e')](_0x506523[_0x6892('0x47')],_0x506523[_0x6892('0x4c')]);_0x226ac1[_0x6892('0x4f')]=_[_0x6892('0x4e')](_0x506523[_0x6892('0x47')],qs[_0x6892('0x50')](_0x52dcc3[_0x6892('0x4c')][_0x6892('0x50')]));_0x226ac1['attributes']=_0x226ac1['attributes']['length']?_0x226ac1['attributes']:_0x506523[_0x6892('0x47')];_0x226ac1[_0x6892('0x54')]=qs[_0x6892('0x55')](_0x52dcc3['query']['sort']);_0x226ac1[_0x6892('0x56')]=qs[_0x6892('0x4d')](_['pick'](_0x52dcc3['query'],_0x506523[_0x6892('0x4d')]));if(_0x52dcc3[_0x6892('0x4c')][_0x6892('0x3c')]){_0x226ac1[_0x6892('0x56')]=_[_0x6892('0x58')](_0x226ac1['where'],{'$or':_[_0x6892('0x3e')](_0x226ac1[_0x6892('0x4f')],function(_0x101c55){var _0x5a9741={};_0x5a9741[_0x101c55]={'$like':'%'+_0x52dcc3[_0x6892('0x4c')][_0x6892('0x3c')]+'%'};return _0x5a9741;})});}_0x226ac1[_0x6892('0x47')]=db[_0x6892('0x45')];_0x226ac1['as']=_0x6892('0x38');_0x226ac1=_[_0x6892('0x58')]({},_0x226ac1,_0x52dcc3[_0x6892('0x5d')]);return _0x4259f2[_0x6892('0xde')]({'include':[_0x226ac1]});}})[_0x6892('0x21')](function(_0x52208c){if(_0x52208c){var _0x110a0a={},_0x3e7182=[],_0x5eb719=0x0;for(var _0x1c552e=0x0;_0x1c552e<_0x52208c[_0x6892('0x51')];_0x1c552e+=0x1){for(var _0x320ad5=0x0,_0x12e387;_0x320ad5<_0x52208c[_0x1c552e][_0x6892('0x38')][_0x6892('0x51')];_0x320ad5+=0x1){_0x12e387=_0x52208c[_0x1c552e]['Agents'][_0x320ad5]['get']({'plain':!![]});_0x110a0a[_0x12e387['id']]=_0x12e387;}}_0x110a0a=_[_0x6892('0x106')](_0x110a0a);for(var _0x206bfe=qs[_0x6892('0x2f')](_0x52dcc3['query'][_0x6892('0x2f')]);_0x206bfe<_0x110a0a[_0x6892('0x51')]&&_0x3e7182['length']=_0x24f75[_0x0d8b('0x4e')]){throw new Error(_0x0d8b('0x4f'));}})[_0x0d8b('0xd')](function(){if(_0x156859){return db[_0x0d8b('0x2b')]['destroy']({'where':{'membername':_0x156859[_0x0d8b('0x27')]},'individualHooks':!![]});}})[_0x0d8b('0xd')](function(){if(_0x156859){return _0x156859['getVoiceQueues']({'raw':!![]});}})[_0x0d8b('0xd')](function(_0x105df9){if(_0x156859){if(_0x105df9){var _0x303d6=[];_0x40d265=_0x105df9;if(_0x40d265[_0x0d8b('0x2d')]){for(var _0x16141a=0x0;_0x16141a<_0x40d265[_0x0d8b('0x2d')];_0x16141a++){_0x303d6[_0x0d8b('0x2f')](db[_0x0d8b('0x2b')][_0x0d8b('0x50')]({'membername':_0x156859[_0x0d8b('0x27')],'UserId':_0x156859['id'],'queue_name':_0x40d265[_0x16141a][_0x0d8b('0x27')],'VoiceQueueId':_0x40d265[_0x16141a]['id'],'interface':_0x1ca60c,'paused':_0x156859[_0x0d8b('0x4a')]||![],'penalty':_0x40d265[_0x16141a]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x0d8b('0x47')](_0x303d6);}}}})[_0x0d8b('0xd')](function(){if(_0x156859){return db[_0x0d8b('0x35')]['findAll']({'where':{'membername':_0x156859['name'],'exitAt':null}});}})[_0x0d8b('0xd')](function(_0x3aeb45){if(_0x156859){if(_0x3aeb45&&_0x3aeb45[_0x0d8b('0x2d')]){var _0x5b76af=[];_0x3aeb45['forEach'](function(_0x42de18){_0x5b76af[_0x0d8b('0x2f')](_0x42de18[_0x0d8b('0x2c')]({'exitAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31'))}));});return BPromise[_0x0d8b('0x47')](_0x5b76af);}}})[_0x0d8b('0xd')](function(_0x2c826b){if(_0x156859){var _0x20a3dd=[];var _0x3a5aea=[];var _0x195901=utils[_0x0d8b('0x51')]();var _0x3b060e={'membername':_0x156859['name'],'interface':_0x1ca60c,'enterAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31')),'role':_0x156859['role'],'internal':_0x156859['internal']};_0x195901[_0x0d8b('0x2e')](function(_0x1dad9f){_0x20a3dd[_0x0d8b('0x2f')](_[_0x0d8b('0x52')]({'channel':_0x1dad9f,'type':_0x0d8b('0x53'),'data1':_0x0d8b('0x54'),'data2':_0x1ca60c},_0x3b060e));if(_0x156859['loginInPause']){_0x3a5aea['push'](_['merge']({'channel':_0x1dad9f,'type':_0x0d8b('0x44'),'data1':_0x0d8b('0x55')},_0x3b060e));}});return db[_0x0d8b('0x35')][_0x0d8b('0x36')](_0x20a3dd[_0x0d8b('0x56')](_0x3a5aea),{'individualHooks':!![]});}})[_0x0d8b('0xd')](function(){if(_0x156859){return _0x156859['update']({'online':!![],'lastLoginAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31')),'voicePause':_0x156859['loginInPause']||![],'mailPause':_0x156859[_0x0d8b('0x4a')]||![],'chatPause':_0x156859['loginInPause']||![],'faxPause':_0x156859[_0x0d8b('0x4a')]||![],'smsPause':_0x156859[_0x0d8b('0x4a')]||![],'openchannelPause':_0x156859[_0x0d8b('0x4a')]||![],'pauseType':_0x156859[_0x0d8b('0x4a')]?_0x0d8b('0x55'):null,'lastPauseAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31')),'interface':_0x1ca60c});}})[_0x0d8b('0xd')](function(_0x391121){_0x435090(_0x391121);})[_0x0d8b('0x18')](function(_0x276558){_0x2ab72b(_0x70e4b2[_0x0d8b('0x14')](0x1f4,_0x276558['message']));});});}; \ No newline at end of file +var _0xd8b0=['util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','localhost','./user.socket','register','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetUser','User','findAll','raw','options','attributes','limit','include','model','map','ShowUser','find','where','PauseUser','name','role','internal','interface','UserVoiceQueueRt','update','length','forEach','push','format','YYYY-MM-DD\x20HH:mm:ss','body','DEFAULT\x20PAUSE','uniqueid','MemberReport','bulkCreate','type','UnpauseUser','channel','Unknown\x20channel','voice','system','mail','chat','fax','sms','set','%s%s','Pause','PAUSE','findOne','destroy','all','LoginUser','mobile','loginInPause','count','agent','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','upsert','getChannels','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash'];(function(_0x3359a4,_0x1a2f3e){var _0x19f334=function(_0x5e920e){while(--_0x5e920e){_0x3359a4['push'](_0x3359a4['shift']());}};_0x19f334(++_0x1a2f3e);}(_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});config[_0x0d8b('0x9')]=_['defaults'](config[_0x0d8b('0x9')],{'host':_0x0d8b('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0d8b('0x9')]));require(_0x0d8b('0xb'))[_0x0d8b('0xc')](socket);function respondWithRpcPromise(_0x1f4800,_0x28ff7f,_0x1cac62){return new BPromise(function(_0x2c5e9e,_0x28f87c){return client['request'](_0x1f4800,_0x1cac62)[_0x0d8b('0xd')](function(_0x4e0269){logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x28ff7f,_0x0d8b('0x10'));logger[_0x0d8b('0x11')](_0x0d8b('0x12'),_0x28ff7f,_0x0d8b('0x10'),JSON[_0x0d8b('0x13')](_0x4e0269));if(_0x4e0269[_0x0d8b('0x14')]){if(_0x4e0269[_0x0d8b('0x14')][_0x0d8b('0x15')]===0x1f4){logger[_0x0d8b('0x14')](_0x0d8b('0xf'),_0x28ff7f,_0x4e0269[_0x0d8b('0x14')][_0x0d8b('0x16')]);return _0x28f87c(_0x4e0269['error'][_0x0d8b('0x16')]);}logger[_0x0d8b('0x14')](_0x0d8b('0xf'),_0x28ff7f,_0x4e0269[_0x0d8b('0x14')][_0x0d8b('0x16')]);return _0x2c5e9e(_0x4e0269['error'][_0x0d8b('0x16')]);}else{logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x28ff7f,_0x0d8b('0x10'));_0x2c5e9e(_0x4e0269[_0x0d8b('0x17')][_0x0d8b('0x16')]);}})[_0x0d8b('0x18')](function(_0xa3612a){logger['error'](_0x0d8b('0xf'),_0x28ff7f,_0xa3612a);_0x28f87c(_0xa3612a);});});}exports[_0x0d8b('0x19')]=function(_0x196c0a){var _0x143372=this;return new Promise(function(_0x24e8ed,_0x5b709c){return db[_0x0d8b('0x1a')][_0x0d8b('0x1b')]({'raw':_0x196c0a['options']?_0x196c0a['options'][_0x0d8b('0x1c')]===undefined?!![]:![]:!![],'where':_0x196c0a['options']?_0x196c0a['options']['where']||null:null,'attributes':_0x196c0a[_0x0d8b('0x1d')]?_0x196c0a[_0x0d8b('0x1d')][_0x0d8b('0x1e')]||null:null,'limit':_0x196c0a[_0x0d8b('0x1d')]?_0x196c0a[_0x0d8b('0x1d')][_0x0d8b('0x1f')]||null:null,'include':_0x196c0a[_0x0d8b('0x1d')]?_0x196c0a[_0x0d8b('0x1d')][_0x0d8b('0x20')]?_['map'](_0x196c0a[_0x0d8b('0x1d')][_0x0d8b('0x20')],function(_0x5363e3){return{'model':db[_0x5363e3[_0x0d8b('0x21')]],'as':_0x5363e3['as'],'attributes':_0x5363e3['attributes'],'include':_0x5363e3[_0x0d8b('0x20')]?_[_0x0d8b('0x22')](_0x5363e3[_0x0d8b('0x20')],function(_0x4fe6f9){return{'model':db[_0x4fe6f9['model']],'as':_0x4fe6f9['as'],'attributes':_0x4fe6f9[_0x0d8b('0x1e')],'include':_0x4fe6f9[_0x0d8b('0x20')]?_['map'](_0x4fe6f9[_0x0d8b('0x20')],function(_0x59aa83){return{'model':db[_0x59aa83[_0x0d8b('0x21')]],'as':_0x59aa83['as'],'attributes':_0x59aa83['attributes']};}):[]};}):[]};}):[]:[]})[_0x0d8b('0xd')](function(_0x48f24f){logger[_0x0d8b('0xe')]('GetUser',_0x196c0a);logger[_0x0d8b('0x11')]('GetUser',_0x196c0a,JSON[_0x0d8b('0x13')](_0x48f24f));_0x24e8ed(_0x48f24f);})[_0x0d8b('0x18')](function(_0x2c058d){logger['error']('GetUser',_0x2c058d['message'],_0x196c0a);_0x5b709c(_0x143372[_0x0d8b('0x14')](0x1f4,_0x2c058d['message']));});});};exports[_0x0d8b('0x23')]=function(_0x54f6f3){var _0x5d05fc=this;return new Promise(function(_0x36017a,_0x1b6920){return db[_0x0d8b('0x1a')][_0x0d8b('0x24')]({'raw':_0x54f6f3[_0x0d8b('0x1d')]?_0x54f6f3[_0x0d8b('0x1d')][_0x0d8b('0x1c')]===undefined?!![]:![]:!![],'where':_0x54f6f3[_0x0d8b('0x1d')]?_0x54f6f3['options'][_0x0d8b('0x25')]||null:null,'attributes':_0x54f6f3[_0x0d8b('0x1d')]?_0x54f6f3['options'][_0x0d8b('0x1e')]||null:null,'include':_0x54f6f3[_0x0d8b('0x1d')]?_0x54f6f3[_0x0d8b('0x1d')]['include']?_[_0x0d8b('0x22')](_0x54f6f3[_0x0d8b('0x1d')][_0x0d8b('0x20')],function(_0x31ceba){return{'model':db[_0x31ceba[_0x0d8b('0x21')]],'as':_0x31ceba['as'],'attributes':_0x31ceba['attributes'],'include':_0x31ceba[_0x0d8b('0x20')]?_[_0x0d8b('0x22')](_0x31ceba['include'],function(_0x1180ac){return{'model':db[_0x1180ac[_0x0d8b('0x21')]],'as':_0x1180ac['as'],'attributes':_0x1180ac[_0x0d8b('0x1e')],'include':_0x1180ac[_0x0d8b('0x20')]?_[_0x0d8b('0x22')](_0x1180ac['include'],function(_0x497a71){return{'model':db[_0x497a71[_0x0d8b('0x21')]],'as':_0x497a71['as'],'attributes':_0x497a71['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xc179bd){logger[_0x0d8b('0xe')](_0x0d8b('0x23'),_0x54f6f3);logger[_0x0d8b('0x11')](_0x0d8b('0x23'),_0x54f6f3,JSON[_0x0d8b('0x13')](_0xc179bd));_0x36017a(_0xc179bd);})['catch'](function(_0x6e5bab){logger[_0x0d8b('0x14')](_0x0d8b('0x23'),_0x6e5bab[_0x0d8b('0x16')],_0x54f6f3);_0x1b6920(_0x5d05fc[_0x0d8b('0x14')](0x1f4,_0x6e5bab[_0x0d8b('0x16')]));});});};exports[_0x0d8b('0x26')]=function(_0x5c980b){var _0x1d06b6=this;return new Promise(function(_0x34acb5,_0x3fa955){var _0x1f196d;return db['User'][_0x0d8b('0x24')]({'where':_0x5c980b['options'][_0x0d8b('0x25')]||{},'attributes':['id',_0x0d8b('0x27'),_0x0d8b('0x28'),_0x0d8b('0x29'),_0x0d8b('0x2a')]})[_0x0d8b('0xd')](function(_0x1ff17d){if(_0x1ff17d){_0x1f196d=_0x1ff17d;return db[_0x0d8b('0x2b')][_0x0d8b('0x2c')]({'paused':0x1},{'where':{'UserId':_0x1f196d['id']},'individualHooks':!![]});}})[_0x0d8b('0xd')](function(){if(_0x1f196d){return db['MemberReport']['findAll']({'where':{'membername':_0x1f196d['name'],'type':'PAUSE','exitAt':null}});}})['then'](function(_0x1a46f6){if(_0x1f196d){if(_0x1a46f6&&_0x1a46f6[_0x0d8b('0x2d')]){var _0x1e2433=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x1b216d=0x0,_0x192de1=_0x1a46f6[_0x0d8b('0x2d')];_0x1b216d<_0x192de1;_0x1b216d++){_0x1a46f6[_0x1b216d]['updateAttributes']({'exitAt':_0x1e2433});}}}})[_0x0d8b('0xd')](function(){if(_0x1f196d){var _0x26941a=[];var _0x5059ad=utils['getChannels']();_0x5059ad[_0x0d8b('0x2e')](function(_0x495870){_0x26941a[_0x0d8b('0x2f')]({'channel':_0x495870,'membername':_0x1f196d['name'],'interface':_['isNil'](_0x1f196d[_0x0d8b('0x2a')])?util[_0x0d8b('0x30')]('SIP/%s',_0x1f196d['name']):_0x1f196d['interface'],'type':'PAUSE','enterAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31')),'data1':_0x5c980b[_0x0d8b('0x32')]['type']||_0x0d8b('0x33'),'role':_0x1f196d[_0x0d8b('0x28')],'internal':_0x1f196d[_0x0d8b('0x29')],'uniqueid':_0x5c980b[_0x0d8b('0x32')][_0x0d8b('0x34')]||null});});return db[_0x0d8b('0x35')][_0x0d8b('0x36')](_0x26941a,{'individualHooks':!![]});}})[_0x0d8b('0xd')](function(){if(_0x1f196d){return _0x1f196d[_0x0d8b('0x2c')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x5c980b[_0x0d8b('0x32')][_0x0d8b('0x37')]||_0x0d8b('0x33'),'lastPauseAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31'))});}})[_0x0d8b('0xd')](function(_0xdfcf32){_0x34acb5(_0xdfcf32);})[_0x0d8b('0x18')](function(_0x1e162c){_0x3fa955(_0x1d06b6[_0x0d8b('0x14')](0x1f4,_0x1e162c['message']));});});};exports[_0x0d8b('0x38')]=function(_0x4d8850){var _0x5d29ab=this;return new Promise(function(_0x39a31d,_0x113fb7){var _0x3f943a;return db[_0x0d8b('0x1a')]['findOne']({'where':_0x4d8850[_0x0d8b('0x1d')][_0x0d8b('0x25')]||{},'attributes':['id',_0x0d8b('0x27')]})[_0x0d8b('0xd')](function(_0x45cd22){if(_0x45cd22){_0x3f943a=_0x45cd22;if(_0x4d8850['body']['channel']&&!utils['isValidChannel'](_0x4d8850['body'][_0x0d8b('0x39')])){throw new Error(_0x0d8b('0x3a'));}switch(_0x4d8850['body']['channel']){case _0x0d8b('0x3b'):return db[_0x0d8b('0x2b')]['update']({'paused':0x0},{'where':{'UserId':_0x3f943a['id']}})['then'](function(){return db[_0x0d8b('0x35')][_0x0d8b('0x24')]({'where':{'channel':_0x4d8850[_0x0d8b('0x32')][_0x0d8b('0x39')],'membername':_0x3f943a[_0x0d8b('0x27')],'type':'PAUSE','exitAt':null}});})[_0x0d8b('0xd')](function(_0x2afe34){if(_0x2afe34){return _0x2afe34['update']({'exitAt':moment()['format'](_0x0d8b('0x31')),'data2':_0x0d8b('0x3c')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x3f943a['update']({'voicePause':![]});});case _0x0d8b('0x3d'):case _0x0d8b('0x3e'):case _0x0d8b('0x3f'):case _0x0d8b('0x40'):case'openchannel':return db[_0x0d8b('0x35')]['find']({'where':{'channel':_0x4d8850['body'][_0x0d8b('0x39')],'membername':_0x3f943a[_0x0d8b('0x27')],'type':'PAUSE','exitAt':null}})['then'](function(_0x44ed23){return _0x44ed23[_0x0d8b('0x2c')]({'exitAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31')),'data2':_0x0d8b('0x3c')},{'individualHooks':!![]});})[_0x0d8b('0xd')](function(){var _0x3978e5={};_[_0x0d8b('0x41')](_0x3978e5,util['format'](_0x0d8b('0x42'),_0x4d8850[_0x0d8b('0x32')][_0x0d8b('0x39')],_0x0d8b('0x43')),![]);return _0x3f943a[_0x0d8b('0x2c')](_0x3978e5);});default:return db[_0x0d8b('0x2b')][_0x0d8b('0x2c')]({'paused':0x0},{'where':{'UserId':_0x3f943a['id']}})[_0x0d8b('0xd')](function(){return db[_0x0d8b('0x35')]['findAll']({'where':{'membername':_0x3f943a[_0x0d8b('0x27')],'type':_0x0d8b('0x44'),'exitAt':null}});})[_0x0d8b('0xd')](function(_0x23de9e){var _0x43ad22=[];_0x23de9e['forEach'](function(_0x1e1dce){_0x43ad22[_0x0d8b('0x2f')](_0x1e1dce[_0x0d8b('0x2c')]({'exitAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31')),'data2':'system'}));});return BPromise['all'](_0x43ad22);})[_0x0d8b('0xd')](function(){return _0x3f943a[_0x0d8b('0x2c')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x0d8b('0xd')](function(_0xbbb520){_0x39a31d(_0xbbb520);})['catch'](function(_0x199122){_0x113fb7(_0x5d29ab[_0x0d8b('0x14')](0x1f4,_0x199122[_0x0d8b('0x16')]));});});};exports['LogoutUser']=function(_0x2f19f4){var _0x532a85=this;return new Promise(function(_0x2fce07,_0x3ed63e){var _0x1efce6;return db[_0x0d8b('0x1a')][_0x0d8b('0x45')]({'where':_0x2f19f4[_0x0d8b('0x1d')]['where']||{},'attributes':['id',_0x0d8b('0x27')]})['then'](function(_0x71e8d8){if(_0x71e8d8){_0x1efce6=_0x71e8d8;return db[_0x0d8b('0x2b')][_0x0d8b('0x46')]({'where':{'membername':_0x1efce6[_0x0d8b('0x27')]},'individualHooks':!![]});}})['then'](function(){if(_0x1efce6){return db[_0x0d8b('0x35')][_0x0d8b('0x1b')]({'where':{'membername':_0x1efce6[_0x0d8b('0x27')],'exitAt':null}});}})[_0x0d8b('0xd')](function(_0x2ccdae){if(_0x1efce6){if(_0x2ccdae&&_0x2ccdae[_0x0d8b('0x2d')]){var _0x223fd8=[];_0x2ccdae[_0x0d8b('0x2e')](function(_0x2ce282){_0x223fd8[_0x0d8b('0x2f')](_0x2ce282['update']({'exitAt':moment()['format'](_0x0d8b('0x31'))}));});return BPromise[_0x0d8b('0x47')](_0x223fd8);}}})['then'](function(){if(_0x1efce6){return _0x1efce6[_0x0d8b('0x2c')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x5cc960){_0x2fce07(_0x5cc960);})[_0x0d8b('0x18')](function(_0x1c4e96){_0x3ed63e(_0x532a85['error'](0x1f4,_0x1c4e96['message']));});});};exports[_0x0d8b('0x48')]=function(_0x1c007b){var _0x70e4b2=this;return new Promise(function(_0x435090,_0x2ab72b){var _0x156859;var _0x40d265;var _0x5b4402;var _0x1ca60c;return db['User'][_0x0d8b('0x45')]({'where':_0x1c007b[_0x0d8b('0x1d')][_0x0d8b('0x25')]||{},'attributes':['id',_0x0d8b('0x27'),'role',_0x0d8b('0x49'),'phone',_0x0d8b('0x29'),_0x0d8b('0x4a'),_0x0d8b('0x2a')]})[_0x0d8b('0xd')](function(_0xc5c35f){if(_0xc5c35f){_0x156859=_0xc5c35f;_0x1ca60c=_0x1c007b[_0x0d8b('0x32')][_0x0d8b('0x2a')]?_0x1c007b[_0x0d8b('0x32')][_0x0d8b('0x2a')]:util[_0x0d8b('0x30')]('SIP/%s',_0x156859[_0x0d8b('0x27')]);return db['User'][_0x0d8b('0x4b')]({'where':{'role':_0x0d8b('0x4c'),'online':!![],'id':{'$ne':_0x156859['id']}}});}})['then'](function(_0x1a62b9){if(_0x1a62b9){_0x5b4402=_0x1a62b9;return require('../../config/license/util')[_0x0d8b('0x4d')]();}})[_0x0d8b('0xd')](function(_0x24f75){if(_0x24f75&&_0x24f75[_0x0d8b('0x4e')]&&_0x5b4402>=_0x24f75[_0x0d8b('0x4e')]){throw new Error(_0x0d8b('0x4f'));}})[_0x0d8b('0xd')](function(){if(_0x156859){return db[_0x0d8b('0x2b')]['destroy']({'where':{'membername':_0x156859[_0x0d8b('0x27')]},'individualHooks':!![]});}})[_0x0d8b('0xd')](function(){if(_0x156859){return _0x156859['getVoiceQueues']({'raw':!![]});}})[_0x0d8b('0xd')](function(_0x105df9){if(_0x156859){if(_0x105df9){var _0x303d6=[];_0x40d265=_0x105df9;if(_0x40d265[_0x0d8b('0x2d')]){for(var _0x16141a=0x0;_0x16141a<_0x40d265[_0x0d8b('0x2d')];_0x16141a++){_0x303d6[_0x0d8b('0x2f')](db[_0x0d8b('0x2b')][_0x0d8b('0x50')]({'membername':_0x156859[_0x0d8b('0x27')],'UserId':_0x156859['id'],'queue_name':_0x40d265[_0x16141a][_0x0d8b('0x27')],'VoiceQueueId':_0x40d265[_0x16141a]['id'],'interface':_0x1ca60c,'paused':_0x156859[_0x0d8b('0x4a')]||![],'penalty':_0x40d265[_0x16141a]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x0d8b('0x47')](_0x303d6);}}}})[_0x0d8b('0xd')](function(){if(_0x156859){return db[_0x0d8b('0x35')]['findAll']({'where':{'membername':_0x156859['name'],'exitAt':null}});}})[_0x0d8b('0xd')](function(_0x3aeb45){if(_0x156859){if(_0x3aeb45&&_0x3aeb45[_0x0d8b('0x2d')]){var _0x5b76af=[];_0x3aeb45['forEach'](function(_0x42de18){_0x5b76af[_0x0d8b('0x2f')](_0x42de18[_0x0d8b('0x2c')]({'exitAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31'))}));});return BPromise[_0x0d8b('0x47')](_0x5b76af);}}})[_0x0d8b('0xd')](function(_0x2c826b){if(_0x156859){var _0x20a3dd=[];var _0x3a5aea=[];var _0x195901=utils[_0x0d8b('0x51')]();var _0x3b060e={'membername':_0x156859['name'],'interface':_0x1ca60c,'enterAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31')),'role':_0x156859['role'],'internal':_0x156859['internal']};_0x195901[_0x0d8b('0x2e')](function(_0x1dad9f){_0x20a3dd[_0x0d8b('0x2f')](_[_0x0d8b('0x52')]({'channel':_0x1dad9f,'type':_0x0d8b('0x53'),'data1':_0x0d8b('0x54'),'data2':_0x1ca60c},_0x3b060e));if(_0x156859['loginInPause']){_0x3a5aea['push'](_['merge']({'channel':_0x1dad9f,'type':_0x0d8b('0x44'),'data1':_0x0d8b('0x55')},_0x3b060e));}});return db[_0x0d8b('0x35')][_0x0d8b('0x36')](_0x20a3dd[_0x0d8b('0x56')](_0x3a5aea),{'individualHooks':!![]});}})[_0x0d8b('0xd')](function(){if(_0x156859){return _0x156859['update']({'online':!![],'lastLoginAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31')),'voicePause':_0x156859['loginInPause']||![],'mailPause':_0x156859[_0x0d8b('0x4a')]||![],'chatPause':_0x156859['loginInPause']||![],'faxPause':_0x156859[_0x0d8b('0x4a')]||![],'smsPause':_0x156859[_0x0d8b('0x4a')]||![],'openchannelPause':_0x156859[_0x0d8b('0x4a')]||![],'pauseType':_0x156859[_0x0d8b('0x4a')]?_0x0d8b('0x55'):null,'lastPauseAt':moment()[_0x0d8b('0x30')](_0x0d8b('0x31')),'interface':_0x1ca60c});}})[_0x0d8b('0xd')](function(_0x391121){_0x435090(_0x391121);})[_0x0d8b('0x18')](function(_0x276558){_0x2ab72b(_0x70e4b2[_0x0d8b('0x14')](0x1f4,_0x276558['message']));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index e444fb1..233ae16 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 _0x830a=['remove','update','removeListener','register','./user.events','save'];(function(_0x22b93d,_0x39acea){var _0x256de7=function(_0x2967a0){while(--_0x2967a0){_0x22b93d['push'](_0x22b93d['shift']());}};_0x256de7(++_0x39acea);}(_0x830a,0x6a));var _0xa830=function(_0x568b72,_0x1399aa){_0x568b72=_0x568b72-0x0;var _0x1762b5=_0x830a[_0x568b72];return _0x1762b5;};'use strict';var UserEvents=require(_0xa830('0x0'));var events=[_0xa830('0x1'),_0xa830('0x2'),_0xa830('0x3')];function createListener(_0x3d5094,_0x11156b){return function(_0x5208c6){_0x11156b['emit'](_0x3d5094,_0x5208c6);};}function removeListener(_0x51aa89,_0x886a36){return function(){UserEvents[_0xa830('0x4')](_0x51aa89,_0x886a36);};}exports[_0xa830('0x5')]=function(_0x191323){for(var _0x2ead50=0x0,_0x5dd505=events['length'];_0x2ead50<_0x5dd505;_0x2ead50++){var _0x3bf718=events[_0x2ead50];var _0x275af0=createListener('user:'+_0x3bf718,_0x191323);UserEvents['on'](_0x3bf718,_0x275af0);}}; \ No newline at end of file +var _0xd341=['removeListener','register','length','./user.events','save','remove','update','emit'];(function(_0x15d6ef,_0x572a07){var _0x402ef2=function(_0x11f00e){while(--_0x11f00e){_0x15d6ef['push'](_0x15d6ef['shift']());}};_0x402ef2(++_0x572a07);}(_0xd341,0x9b));var _0x1d34=function(_0x5e6f9c,_0x1b69a5){_0x5e6f9c=_0x5e6f9c-0x0;var _0x57e264=_0xd341[_0x5e6f9c];return _0x57e264;};'use strict';var UserEvents=require(_0x1d34('0x0'));var events=[_0x1d34('0x1'),_0x1d34('0x2'),_0x1d34('0x3')];function createListener(_0x13d5ce,_0x361537){return function(_0x483361){_0x361537[_0x1d34('0x4')](_0x13d5ce,_0x483361);};}function removeListener(_0x423aef,_0x216aeb){return function(){UserEvents[_0x1d34('0x5')](_0x423aef,_0x216aeb);};}exports[_0x1d34('0x6')]=function(_0x40ceb8){for(var _0xda2e91=0x0,_0x5b02c0=events[_0x1d34('0x7')];_0xda2e91<_0x5b02c0;_0xda2e91++){var _0x130bcb=events[_0xda2e91];var _0x276e41=createListener('user:'+_0x130bcb,_0x40ceb8);UserEvents['on'](_0x130bcb,_0x276e41);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index d9ff883..ab2a233 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 _0x5fc3=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x7ab432,_0x2f8e75){var _0x4463f2=function(_0x780a1d){while(--_0x780a1d){_0x7ab432['push'](_0x7ab432['shift']());}};_0x4463f2(++_0x2f8e75);}(_0x5fc3,0xa8));var _0x35fc=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0x5fc3[_0x11ce46];return _0x368a1e;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var auth=require(_0x35fc('0x5'));var interaction=require(_0x35fc('0x6'));var config=require('../../config/environment');module[_0x35fc('0x7')]=router; \ No newline at end of file +var _0x6050=['exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x468989,_0x2d7d05){var _0x3de51b=function(_0x42bc23){while(--_0x42bc23){_0x468989['push'](_0x468989['shift']());}};_0x3de51b(++_0x2d7d05);}(_0x6050,0x196));var _0x0605=function(_0x37f3f0,_0x15c960){_0x37f3f0=_0x37f3f0-0x0;var _0x1a065f=_0x6050[_0x37f3f0];return _0x1a065f;};'use strict';var multer=require(_0x0605('0x0'));var util=require(_0x0605('0x1'));var path=require(_0x0605('0x2'));var timeout=require(_0x0605('0x3'));var express=require(_0x0605('0x4'));var router=express[_0x0605('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x0605('0x6'));var config=require(_0x0605('0x7'));module[_0x0605('0x8')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 5992e96..dc5ca44 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 _0xe407=['exports','INTEGER','sequelize'];(function(_0x61dad8,_0xd06b53){var _0x44af4c=function(_0x524425){while(--_0x524425){_0x61dad8['push'](_0x61dad8['shift']());}};_0x44af4c(++_0xd06b53);}(_0xe407,0x1a0));var _0x7e40=function(_0x912327,_0x23ea5f){_0x912327=_0x912327-0x0;var _0x40f928=_0xe407[_0x912327];return _0x40f928;};'use strict';var Sequelize=require(_0x7e40('0x0'));module[_0x7e40('0x1')]={'penalty':{'type':Sequelize[_0x7e40('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6516=['sequelize','exports','INTEGER'];(function(_0x371143,_0x37b129){var _0x549ea7=function(_0x49964a){while(--_0x49964a){_0x371143['push'](_0x371143['shift']());}};_0x549ea7(++_0x37b129);}(_0x6516,0x156));var _0x6651=function(_0x5e7f1d,_0x3f0936){_0x5e7f1d=_0x5e7f1d-0x0;var _0x5cd101=_0x6516[_0x5e7f1d];return _0x5cd101;};'use strict';var Sequelize=require(_0x6651('0x0'));module[_0x6651('0x1')]={'penalty':{'type':Sequelize[_0x6651('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index c2e239d..0a555e6 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 _0x82d3=['rimraf','../../config/environment','./userChatQueue.attributes','define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x456a8f,_0x26953e){var _0x159be6=function(_0x406225){while(--_0x406225){_0x456a8f['push'](_0x456a8f['shift']());}};_0x159be6(++_0x26953e);}(_0x82d3,0x13e));var _0x382d=function(_0x3073e6,_0x249bae){_0x3073e6=_0x3073e6-0x0;var _0xd589e3=_0x82d3[_0x3073e6];return _0xd589e3;};'use strict';var _=require(_0x382d('0x0'));var util=require(_0x382d('0x1'));var logger=require(_0x382d('0x2'))(_0x382d('0x3'));var moment=require('moment');var BPromise=require(_0x382d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x382d('0x5'));var rimraf=require(_0x382d('0x6'));var config=require(_0x382d('0x7'));var attributes=require(_0x382d('0x8'));module['exports']=function(_0x525fe4,_0x331427){return _0x525fe4[_0x382d('0x9')](_0x382d('0xa'),attributes,{'tableName':_0x382d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf853=['path','../../config/environment','exports','UserChatQueue','user_has_chat_queues','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5a5cea,_0x44b8c1){var _0x13234b=function(_0x47072b){while(--_0x47072b){_0x5a5cea['push'](_0x5a5cea['shift']());}};_0x13234b(++_0x44b8c1);}(_0xf853,0x19c));var _0x3f85=function(_0x3725ee,_0x543bd9){_0x3725ee=_0x3725ee-0x0;var _0x399c71=_0xf853[_0x3725ee];return _0x399c71;};'use strict';var _=require('lodash');var util=require(_0x3f85('0x0'));var logger=require(_0x3f85('0x1'))(_0x3f85('0x2'));var moment=require(_0x3f85('0x3'));var BPromise=require(_0x3f85('0x4'));var rp=require(_0x3f85('0x5'));var fs=require('fs');var path=require(_0x3f85('0x6'));var rimraf=require('rimraf');var config=require(_0x3f85('0x7'));var attributes=require('./userChatQueue.attributes');module[_0x3f85('0x8')]=function(_0xdd8d83,_0x531ecf){return _0xdd8d83['define'](_0x3f85('0x9'),attributes,{'tableName':_0x3f85('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 6db4899..4d4488d 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 _0x0776=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','bluebird','randomstring'];(function(_0x5db03e,_0x521953){var _0x18f911=function(_0x1a935b){while(--_0x1a935b){_0x5db03e['push'](_0x5db03e['shift']());}};_0x18f911(++_0x521953);}(_0x0776,0xad));var _0x6077=function(_0x4bba85,_0x47ab15){_0x4bba85=_0x4bba85-0x0;var _0x2c9996=_0x0776[_0x4bba85];return _0x2c9996;};'use strict';var _=require(_0x6077('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6077('0x1'));var rs=require(_0x6077('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6077('0x3'))['db'];var utils=require(_0x6077('0x4'));var logger=require(_0x6077('0x5'))(_0x6077('0x6'));var config=require(_0x6077('0x7'));var jayson=require(_0x6077('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4ca604,_0x576180,_0x3723df){return new BPromise(function(_0x2de56b,_0x596516){return client[_0x6077('0x9')](_0x4ca604,_0x3723df)[_0x6077('0xa')](function(_0x23f89b){logger[_0x6077('0xb')](_0x6077('0xc'),_0x576180,'request\x20sent');logger[_0x6077('0xd')](_0x6077('0xe'),_0x576180,_0x6077('0xf'),JSON[_0x6077('0x10')](_0x23f89b));if(_0x23f89b['error']){if(_0x23f89b[_0x6077('0x11')][_0x6077('0x12')]===0x1f4){logger[_0x6077('0x11')]('UserChatQueue,\x20%s,\x20%s',_0x576180,_0x23f89b[_0x6077('0x11')][_0x6077('0x13')]);return _0x596516(_0x23f89b[_0x6077('0x11')]['message']);}logger[_0x6077('0x11')](_0x6077('0xc'),_0x576180,_0x23f89b[_0x6077('0x11')][_0x6077('0x13')]);return _0x2de56b(_0x23f89b[_0x6077('0x11')]['message']);}else{logger[_0x6077('0xb')](_0x6077('0xc'),_0x576180,'request\x20sent');_0x2de56b(_0x23f89b[_0x6077('0x14')]['message']);}})[_0x6077('0x15')](function(_0x19432a){logger[_0x6077('0x11')](_0x6077('0xc'),_0x576180,_0x19432a);_0x596516(_0x19432a);});});} \ No newline at end of file +var _0x2ce1=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','bluebird'];(function(_0x3c8b46,_0x34e053){var _0x4bf0a8=function(_0x4fd53f){while(--_0x4fd53f){_0x3c8b46['push'](_0x3c8b46['shift']());}};_0x4bf0a8(++_0x34e053);}(_0x2ce1,0x8b));var _0x12ce=function(_0xa26515,_0x414374){_0xa26515=_0xa26515-0x0;var _0x36035a=_0x2ce1[_0xa26515];return _0x36035a;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x12ce('0x0'));var rs=require(_0x12ce('0x1'));var fs=require('fs');var Redis=require(_0x12ce('0x2'));var db=require(_0x12ce('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x12ce('0x4'))(_0x12ce('0x5'));var config=require('../../config/environment');var jayson=require(_0x12ce('0x6'));var client=jayson[_0x12ce('0x7')][_0x12ce('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5a4cde,_0x32c7c8,_0x4eef9a){return new BPromise(function(_0x21ef24,_0x276bce){return client[_0x12ce('0x9')](_0x5a4cde,_0x4eef9a)['then'](function(_0xd0fd35){logger[_0x12ce('0xa')](_0x12ce('0xb'),_0x32c7c8,_0x12ce('0xc'));logger['debug'](_0x12ce('0xd'),_0x32c7c8,'request\x20sent',JSON[_0x12ce('0xe')](_0xd0fd35));if(_0xd0fd35['error']){if(_0xd0fd35['error'][_0x12ce('0xf')]===0x1f4){logger[_0x12ce('0x10')](_0x12ce('0xb'),_0x32c7c8,_0xd0fd35[_0x12ce('0x10')][_0x12ce('0x11')]);return _0x276bce(_0xd0fd35[_0x12ce('0x10')]['message']);}logger[_0x12ce('0x10')]('UserChatQueue,\x20%s,\x20%s',_0x32c7c8,_0xd0fd35[_0x12ce('0x10')][_0x12ce('0x11')]);return _0x21ef24(_0xd0fd35[_0x12ce('0x10')]['message']);}else{logger[_0x12ce('0xa')](_0x12ce('0xb'),_0x32c7c8,_0x12ce('0xc'));_0x21ef24(_0xd0fd35[_0x12ce('0x12')][_0x12ce('0x11')]);}})[_0x12ce('0x13')](function(_0x56a72a){logger['error'](_0x12ce('0xb'),_0x32c7c8,_0x56a72a);_0x276bce(_0x56a72a);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 07edcfb..20d4ab1 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 _0x277c=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','path','connect-timeout'];(function(_0x2cca16,_0xe44f31){var _0xf0b715=function(_0x3b4f39){while(--_0x3b4f39){_0x2cca16['push'](_0x2cca16['shift']());}};_0xf0b715(++_0xe44f31);}(_0x277c,0x153));var _0xc277=function(_0x3eb26d,_0x3823fb){_0x3eb26d=_0x3eb26d-0x0;var _0x377022=_0x277c[_0x3eb26d];return _0x377022;};'use strict';var multer=require(_0xc277('0x0'));var util=require('util');var path=require(_0xc277('0x1'));var timeout=require(_0xc277('0x2'));var express=require(_0xc277('0x3'));var router=express[_0xc277('0x4')]();var auth=require(_0xc277('0x5'));var interaction=require(_0xc277('0x6'));var config=require(_0xc277('0x7'));module[_0xc277('0x8')]=router; \ No newline at end of file +var _0x0a6b=['../../components/auth/service','../../components/interaction/service','../../config/environment','multer','express'];(function(_0x39ea89,_0x112373){var _0x230d7a=function(_0xd472eb){while(--_0xd472eb){_0x39ea89['push'](_0x39ea89['shift']());}};_0x230d7a(++_0x112373);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x36d51b,_0x5360fd){_0x36d51b=_0x36d51b-0x0;var _0x3e43cd=_0x0a6b[_0x36d51b];return _0x3e43cd;};'use strict';var multer=require(_0xb0a6('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb0a6('0x1'));var router=express['Router']();var auth=require(_0xb0a6('0x2'));var interaction=require(_0xb0a6('0x3'));var config=require(_0xb0a6('0x4'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 5b69af0..4d01585 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 _0xf48c=['INTEGER','STRING','sequelize','exports'];(function(_0x92bc95,_0x2dbcc0){var _0x1d671e=function(_0x44546e){while(--_0x44546e){_0x92bc95['push'](_0x92bc95['shift']());}};_0x1d671e(++_0x2dbcc0);}(_0xf48c,0x10e));var _0xcf48=function(_0x1ad3ae,_0x48492c){_0x1ad3ae=_0x1ad3ae-0x0;var _0x2985f7=_0xf48c[_0x1ad3ae];return _0x2985f7;};'use strict';var Sequelize=require(_0xcf48('0x0'));module[_0xcf48('0x1')]={'penalty':{'type':Sequelize[_0xcf48('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0xcf48('0x3')]}}; \ No newline at end of file +var _0xd898=['exports','INTEGER','STRING','sequelize'];(function(_0x5234a6,_0x314a5d){var _0x1f8955=function(_0xb6717c){while(--_0xb6717c){_0x5234a6['push'](_0x5234a6['shift']());}};_0x1f8955(++_0x314a5d);}(_0xd898,0x133));var _0x8d89=function(_0x2cc0fb,_0x2e7808){_0x2cc0fb=_0x2cc0fb-0x0;var _0x567fbd=_0xd898[_0x2cc0fb];return _0x567fbd;};'use strict';var Sequelize=require(_0x8d89('0x0'));module[_0x8d89('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x8d89('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x8d89('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 6141baa..c3617a5 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 _0xbe7b=['api','moment','request-promise','../../config/environment','exports','define','user_has_fax_queues','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbe7b,0xe3));var _0xbbe7=function(_0xc3127b,_0x44dbe7){_0xc3127b=_0xc3127b-0x0;var _0x50de6b=_0xbe7b[_0xc3127b];return _0x50de6b;};'use strict';var _=require(_0xbbe7('0x0'));var util=require(_0xbbe7('0x1'));var logger=require(_0xbbe7('0x2'))(_0xbbe7('0x3'));var moment=require(_0xbbe7('0x4'));var BPromise=require('bluebird');var rp=require(_0xbbe7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbbe7('0x6'));var attributes=require('./userFaxQueue.attributes');module[_0xbbe7('0x7')]=function(_0x5e64ef,_0x41a059){return _0x5e64ef[_0xbbe7('0x8')]('UserFaxQueue',attributes,{'tableName':_0xbbe7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8821=['user_has_fax_queues','lodash','util','../../config/logger','api','moment','bluebird','../../config/environment','./userFaxQueue.attributes','define','UserFaxQueue'];(function(_0x36a43c,_0x173a44){var _0x3745ee=function(_0x3f7edc){while(--_0x3f7edc){_0x36a43c['push'](_0x36a43c['shift']());}};_0x3745ee(++_0x173a44);}(_0x8821,0xc7));var _0x1882=function(_0x499210,_0x325b29){_0x499210=_0x499210-0x0;var _0x2e153d=_0x8821[_0x499210];return _0x2e153d;};'use strict';var _=require(_0x1882('0x0'));var util=require(_0x1882('0x1'));var logger=require(_0x1882('0x2'))(_0x1882('0x3'));var moment=require(_0x1882('0x4'));var BPromise=require(_0x1882('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1882('0x6'));var attributes=require(_0x1882('0x7'));module['exports']=function(_0x5d3e62,_0x53fae0){return _0x5d3e62[_0x1882('0x8')](_0x1882('0x9'),attributes,{'tableName':_0x1882('0xa'),'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 1331b51..5e4a68a 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 _0xc258=['http','request','then','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','code','error','message','result','lodash','moment','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x4894aa,_0x19f667){var _0x15de3c=function(_0x35cabc){while(--_0x35cabc){_0x4894aa['push'](_0x4894aa['shift']());}};_0x15de3c(++_0x19f667);}(_0xc258,0xdc));var _0x8c25=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc258[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x8c25('0x0'));var util=require('util');var moment=require(_0x8c25('0x1'));var BPromise=require(_0x8c25('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c25('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x8c25('0x4'))('rpc');var config=require(_0x8c25('0x5'));var jayson=require(_0x8c25('0x6'));var client=jayson[_0x8c25('0x7')][_0x8c25('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x491475,_0x5b1ca7,_0x2c2282){return new BPromise(function(_0x316311,_0x580bd2){return client[_0x8c25('0x9')](_0x491475,_0x2c2282)[_0x8c25('0xa')](function(_0x492f88){logger['info'](_0x8c25('0xb'),_0x5b1ca7,_0x8c25('0xc'));logger[_0x8c25('0xd')](_0x8c25('0xe'),_0x5b1ca7,'request\x20sent',JSON['stringify'](_0x492f88));if(_0x492f88['error']){if(_0x492f88['error'][_0x8c25('0xf')]===0x1f4){logger[_0x8c25('0x10')]('UserFaxQueue,\x20%s,\x20%s',_0x5b1ca7,_0x492f88[_0x8c25('0x10')][_0x8c25('0x11')]);return _0x580bd2(_0x492f88['error'][_0x8c25('0x11')]);}logger[_0x8c25('0x10')](_0x8c25('0xb'),_0x5b1ca7,_0x492f88[_0x8c25('0x10')][_0x8c25('0x11')]);return _0x316311(_0x492f88[_0x8c25('0x10')]['message']);}else{logger['info']('UserFaxQueue,\x20%s,\x20%s',_0x5b1ca7,_0x8c25('0xc'));_0x316311(_0x492f88[_0x8c25('0x12')][_0x8c25('0x11')]);}})['catch'](function(_0x557ced){logger[_0x8c25('0x10')](_0x8c25('0xb'),_0x5b1ca7,_0x557ced);_0x580bd2(_0x557ced);});});} \ No newline at end of file +var _0xbeb6=['../../config/environment','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x458197,_0x1a2716){var _0x402eea=function(_0x4b21e3){while(--_0x4b21e3){_0x458197['push'](_0x458197['shift']());}};_0x402eea(++_0x1a2716);}(_0xbeb6,0xe7));var _0x6beb=function(_0x453ccb,_0x28cdae){_0x453ccb=_0x453ccb-0x0;var _0x2fe6b9=_0xbeb6[_0x453ccb];return _0x2fe6b9;};'use strict';var _=require(_0x6beb('0x0'));var util=require(_0x6beb('0x1'));var moment=require(_0x6beb('0x2'));var BPromise=require('bluebird');var rs=require(_0x6beb('0x3'));var fs=require('fs');var Redis=require(_0x6beb('0x4'));var db=require(_0x6beb('0x5'))['db'];var utils=require(_0x6beb('0x6'));var logger=require(_0x6beb('0x7'))(_0x6beb('0x8'));var config=require(_0x6beb('0x9'));var jayson=require(_0x6beb('0xa'));var client=jayson[_0x6beb('0xb')][_0x6beb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5e1e6a,_0xfaa36d,_0x1843ed){return new BPromise(function(_0x3e50af,_0x51c629){return client[_0x6beb('0xd')](_0x5e1e6a,_0x1843ed)[_0x6beb('0xe')](function(_0xde13fd){logger[_0x6beb('0xf')](_0x6beb('0x10'),_0xfaa36d,'request\x20sent');logger[_0x6beb('0x11')](_0x6beb('0x12'),_0xfaa36d,_0x6beb('0x13'),JSON[_0x6beb('0x14')](_0xde13fd));if(_0xde13fd[_0x6beb('0x15')]){if(_0xde13fd['error'][_0x6beb('0x16')]===0x1f4){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0xfaa36d,_0xde13fd[_0x6beb('0x15')][_0x6beb('0x17')]);return _0x51c629(_0xde13fd[_0x6beb('0x15')][_0x6beb('0x17')]);}logger[_0x6beb('0x15')]('UserFaxQueue,\x20%s,\x20%s',_0xfaa36d,_0xde13fd[_0x6beb('0x15')][_0x6beb('0x17')]);return _0x3e50af(_0xde13fd['error']['message']);}else{logger[_0x6beb('0xf')](_0x6beb('0x10'),_0xfaa36d,_0x6beb('0x13'));_0x3e50af(_0xde13fd['result']['message']);}})['catch'](function(_0x40e44a){logger[_0x6beb('0x15')]('UserFaxQueue,\x20%s,\x20%s',_0xfaa36d,_0x40e44a);_0x51c629(_0x40e44a);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 79af04b..2545819 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 _0xdc59=['../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path','Router'];(function(_0xcf807,_0x4c736b){var _0x2ef9e9=function(_0x33ed42){while(--_0x33ed42){_0xcf807['push'](_0xcf807['shift']());}};_0x2ef9e9(++_0x4c736b);}(_0xdc59,0x12c));var _0x9dc5=function(_0x36c6eb,_0x4fb127){_0x36c6eb=_0x36c6eb-0x0;var _0x30675b=_0xdc59[_0x36c6eb];return _0x30675b;};'use strict';var multer=require(_0x9dc5('0x0'));var util=require(_0x9dc5('0x1'));var path=require(_0x9dc5('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9dc5('0x3')]();var auth=require(_0x9dc5('0x4'));var interaction=require(_0x9dc5('0x5'));var config=require(_0x9dc5('0x6'));module[_0x9dc5('0x7')]=router; \ No newline at end of file +var _0xdf55=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x1711fd,_0x223682){var _0x1fa838=function(_0x395edc){while(--_0x395edc){_0x1711fd['push'](_0x1711fd['shift']());}};_0x1fa838(++_0x223682);}(_0xdf55,0x83));var _0x5df5=function(_0x2fa457,_0x7021df){_0x2fa457=_0x2fa457-0x0;var _0x4f250a=_0xdf55[_0x2fa457];return _0x4f250a;};'use strict';var multer=require(_0x5df5('0x0'));var util=require(_0x5df5('0x1'));var path=require('path');var timeout=require(_0x5df5('0x2'));var express=require(_0x5df5('0x3'));var router=express['Router']();var auth=require(_0x5df5('0x4'));var interaction=require(_0x5df5('0x5'));var config=require(_0x5df5('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index e4e970e..38cc21e 100644 --- a/server/api/userMailQueue/userMailQueue.attributes.js +++ b/server/api/userMailQueue/userMailQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x53c0=['exports','sequelize'];(function(_0x29311d,_0x3f9e23){var _0xa29b8f=function(_0x2bb490){while(--_0x2bb490){_0x29311d['push'](_0x29311d['shift']());}};_0xa29b8f(++_0x3f9e23);}(_0x53c0,0x1a7));var _0x053c=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x53c0[_0x9df060];return _0x338dfe;};'use strict';var Sequelize=require(_0x053c('0x0'));module[_0x053c('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xae12=['INTEGER','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xae12,0x8e));var _0x2ae1=function(_0x3fa296,_0x2bd315){_0x3fa296=_0x3fa296-0x0;var _0x10b19f=_0xae12[_0x3fa296];return _0x10b19f;};'use strict';var Sequelize=require(_0x2ae1('0x0'));module[_0x2ae1('0x1')]={'penalty':{'type':Sequelize[_0x2ae1('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 7958509..b7430d7 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 _0xd117=['request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x55d829,_0x43f06c){var _0x52163b=function(_0x493cd8){while(--_0x493cd8){_0x55d829['push'](_0x55d829['shift']());}};_0x52163b(++_0x43f06c);}(_0xd117,0x182));var _0x7d11=function(_0x313c96,_0x3cee6e){_0x313c96=_0x313c96-0x0;var _0x522f53=_0xd117[_0x313c96];return _0x522f53;};'use strict';var _=require(_0x7d11('0x0'));var util=require(_0x7d11('0x1'));var logger=require(_0x7d11('0x2'))(_0x7d11('0x3'));var moment=require(_0x7d11('0x4'));var BPromise=require(_0x7d11('0x5'));var rp=require(_0x7d11('0x6'));var fs=require('fs');var path=require(_0x7d11('0x7'));var rimraf=require(_0x7d11('0x8'));var config=require(_0x7d11('0x9'));var attributes=require(_0x7d11('0xa'));module[_0x7d11('0xb')]=function(_0x27d7e8,_0x40c3c4){return _0x27d7e8[_0x7d11('0xc')](_0x7d11('0xd'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6d38=['util','../../config/logger','api','request-promise','rimraf','../../config/environment','./userMailQueue.attributes','define','UserMailQueue'];(function(_0xc79cab,_0x34199e){var _0x2e1dc3=function(_0x2d25ba){while(--_0x2d25ba){_0xc79cab['push'](_0xc79cab['shift']());}};_0x2e1dc3(++_0x34199e);}(_0x6d38,0x1ef));var _0x86d3=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x6d38[_0x3e5086];return _0xfeb102;};'use strict';var _=require('lodash');var util=require(_0x86d3('0x0'));var logger=require(_0x86d3('0x1'))(_0x86d3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x86d3('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x86d3('0x4'));var config=require(_0x86d3('0x5'));var attributes=require(_0x86d3('0x6'));module['exports']=function(_0x2d8272,_0xfbbc15){return _0x2d8272[_0x86d3('0x7')](_0x86d3('0x8'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index c114acf..e18b654 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 _0xd555=['request','then','UserMailQueue,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x178f01,_0x2d9b58){var _0x2a8624=function(_0x12846b){while(--_0x12846b){_0x178f01['push'](_0x178f01['shift']());}};_0x2a8624(++_0x2d9b58);}(_0xd555,0xfa));var _0x5d55=function(_0x5ac5e8,_0xc333d2){_0x5ac5e8=_0x5ac5e8-0x0;var _0x5eb1ff=_0xd555[_0x5ac5e8];return _0x5eb1ff;};'use strict';var _=require(_0x5d55('0x0'));var util=require(_0x5d55('0x1'));var moment=require(_0x5d55('0x2'));var BPromise=require(_0x5d55('0x3'));var rs=require(_0x5d55('0x4'));var fs=require('fs');var Redis=require(_0x5d55('0x5'));var db=require(_0x5d55('0x6'))['db'];var utils=require(_0x5d55('0x7'));var logger=require(_0x5d55('0x8'))(_0x5d55('0x9'));var config=require(_0x5d55('0xa'));var jayson=require(_0x5d55('0xb'));var client=jayson[_0x5d55('0xc')][_0x5d55('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xedf469,_0x11daf3,_0x265bab){return new BPromise(function(_0x1e3033,_0x5c10d8){return client[_0x5d55('0xe')](_0xedf469,_0x265bab)[_0x5d55('0xf')](function(_0x552411){logger['info'](_0x5d55('0x10'),_0x11daf3,'request\x20sent');logger['debug']('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x11daf3,'request\x20sent',JSON[_0x5d55('0x11')](_0x552411));if(_0x552411['error']){if(_0x552411['error'][_0x5d55('0x12')]===0x1f4){logger[_0x5d55('0x13')](_0x5d55('0x10'),_0x11daf3,_0x552411[_0x5d55('0x13')][_0x5d55('0x14')]);return _0x5c10d8(_0x552411[_0x5d55('0x13')][_0x5d55('0x14')]);}logger[_0x5d55('0x13')](_0x5d55('0x10'),_0x11daf3,_0x552411[_0x5d55('0x13')][_0x5d55('0x14')]);return _0x1e3033(_0x552411[_0x5d55('0x13')][_0x5d55('0x14')]);}else{logger['info'](_0x5d55('0x10'),_0x11daf3,_0x5d55('0x15'));_0x1e3033(_0x552411[_0x5d55('0x16')][_0x5d55('0x14')]);}})[_0x5d55('0x17')](function(_0x290f40){logger[_0x5d55('0x13')](_0x5d55('0x10'),_0x11daf3,_0x290f40);_0x5c10d8(_0x290f40);});});} \ No newline at end of file +var _0xc9bc=['ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','info','request\x20sent','debug','stringify','error','code','message','UserMailQueue,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x350202,_0x2100ec){var _0x2c59de=function(_0x433709){while(--_0x433709){_0x350202['push'](_0x350202['shift']());}};_0x2c59de(++_0x2100ec);}(_0xc9bc,0x13b));var _0xcc9b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc9bc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xcc9b('0x0'));var util=require(_0xcc9b('0x1'));var moment=require(_0xcc9b('0x2'));var BPromise=require(_0xcc9b('0x3'));var rs=require(_0xcc9b('0x4'));var fs=require('fs');var Redis=require(_0xcc9b('0x5'));var db=require(_0xcc9b('0x6'))['db'];var utils=require(_0xcc9b('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xcc9b('0x8'));var jayson=require(_0xcc9b('0x9'));var client=jayson['client'][_0xcc9b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x460c46,_0xd6b9c7,_0x584cdb){return new BPromise(function(_0x1db2c6,_0x28f552){return client['request'](_0x460c46,_0x584cdb)['then'](function(_0x3e9e4f){logger[_0xcc9b('0xb')]('UserMailQueue,\x20%s,\x20%s',_0xd6b9c7,_0xcc9b('0xc'));logger[_0xcc9b('0xd')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0xd6b9c7,_0xcc9b('0xc'),JSON[_0xcc9b('0xe')](_0x3e9e4f));if(_0x3e9e4f[_0xcc9b('0xf')]){if(_0x3e9e4f['error'][_0xcc9b('0x10')]===0x1f4){logger['error']('UserMailQueue,\x20%s,\x20%s',_0xd6b9c7,_0x3e9e4f[_0xcc9b('0xf')]['message']);return _0x28f552(_0x3e9e4f[_0xcc9b('0xf')]['message']);}logger[_0xcc9b('0xf')]('UserMailQueue,\x20%s,\x20%s',_0xd6b9c7,_0x3e9e4f[_0xcc9b('0xf')][_0xcc9b('0x11')]);return _0x1db2c6(_0x3e9e4f[_0xcc9b('0xf')][_0xcc9b('0x11')]);}else{logger[_0xcc9b('0xb')](_0xcc9b('0x12'),_0xd6b9c7,_0xcc9b('0xc'));_0x1db2c6(_0x3e9e4f['result'][_0xcc9b('0x11')]);}})[_0xcc9b('0x13')](function(_0x413ebd){logger[_0xcc9b('0xf')](_0xcc9b('0x12'),_0xd6b9c7,_0x413ebd);_0x28f552(_0x413ebd);});});} \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 1d584a2..85a0b20 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 _0x5a5a=['exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x5a5a,0x1d1));var _0xa5a5=function(_0x1dce91,_0x5021c7){_0x1dce91=_0x1dce91-0x0;var _0x57834e=_0x5a5a[_0x1dce91];return _0x57834e;};'use strict';var multer=require('multer');var util=require(_0xa5a5('0x0'));var path=require(_0xa5a5('0x1'));var timeout=require(_0xa5a5('0x2'));var express=require(_0xa5a5('0x3'));var router=express[_0xa5a5('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xa5a5('0x5'));var config=require(_0xa5a5('0x6'));module[_0xa5a5('0x7')]=router; \ No newline at end of file +var _0xf417=['connect-timeout','Router','../../config/environment','util','path'];(function(_0x52c8f5,_0x56489b){var _0x271fba=function(_0x3a0094){while(--_0x3a0094){_0x52c8f5['push'](_0x52c8f5['shift']());}};_0x271fba(++_0x56489b);}(_0xf417,0x8f));var _0x7f41=function(_0x15b6b9,_0x1fe81a){_0x15b6b9=_0x15b6b9-0x0;var _0x1c2465=_0xf417[_0x15b6b9];return _0x1c2465;};'use strict';var multer=require('multer');var util=require(_0x7f41('0x0'));var path=require(_0x7f41('0x1'));var timeout=require(_0x7f41('0x2'));var express=require('express');var router=express[_0x7f41('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7f41('0x4'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 20e0583..0ebe33b 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 _0x72d2=['INTEGER','exports'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x72d2,0x7f));var _0x272d=function(_0x2dea58,_0x59d6f0){_0x2dea58=_0x2dea58-0x0;var _0x2b23c2=_0x72d2[_0x2dea58];return _0x2b23c2;};'use strict';var Sequelize=require('sequelize');module[_0x272d('0x0')]={'penalty':{'type':Sequelize[_0x272d('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x913e=['sequelize'];(function(_0xde13cb,_0x29e33b){var _0x144994=function(_0x58e5b1){while(--_0x58e5b1){_0xde13cb['push'](_0xde13cb['shift']());}};_0x144994(++_0x29e33b);}(_0x913e,0x13e));var _0xe913=function(_0x3fd3a3,_0x36c863){_0x3fd3a3=_0x3fd3a3-0x0;var _0xa3e4d5=_0x913e[_0x3fd3a3];return _0xa3e4d5;};'use strict';var Sequelize=require(_0xe913('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 29dd44f..2deb182 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 _0x4119=['rimraf','./userOpenchannelQueue.attributes','exports','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x5c52c6,_0x54cee7){var _0x286b8f=function(_0x42dd50){while(--_0x42dd50){_0x5c52c6['push'](_0x5c52c6['shift']());}};_0x286b8f(++_0x54cee7);}(_0x4119,0x125));var _0x9411=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x4119[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x9411('0x0'));var util=require(_0x9411('0x1'));var logger=require('../../config/logger')(_0x9411('0x2'));var moment=require(_0x9411('0x3'));var BPromise=require(_0x9411('0x4'));var rp=require(_0x9411('0x5'));var fs=require('fs');var path=require(_0x9411('0x6'));var rimraf=require(_0x9411('0x7'));var config=require('../../config/environment');var attributes=require(_0x9411('0x8'));module[_0x9411('0x9')]=function(_0x40730d,_0x516875){return _0x40730d['define'](_0x9411('0xa'),attributes,{'tableName':_0x9411('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x31dd=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','define','UserOpenchannelQueue','lodash','util'];(function(_0x28a465,_0x558c2c){var _0x258386=function(_0x384486){while(--_0x384486){_0x28a465['push'](_0x28a465['shift']());}};_0x258386(++_0x558c2c);}(_0x31dd,0x1e8));var _0xd31d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x31dd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd31d('0x0'));var util=require(_0xd31d('0x1'));var logger=require(_0xd31d('0x2'))(_0xd31d('0x3'));var moment=require('moment');var BPromise=require(_0xd31d('0x4'));var rp=require(_0xd31d('0x5'));var fs=require('fs');var path=require(_0xd31d('0x6'));var rimraf=require('rimraf');var config=require(_0xd31d('0x7'));var attributes=require('./userOpenchannelQueue.attributes');module['exports']=function(_0x51e666,_0x172913){return _0x51e666[_0xd31d('0x8')](_0xd31d('0x9'),attributes,{'tableName':'user_has_openchannel_queues','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 b17af58..1690dcf 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 _0x3a19=['bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment'];(function(_0x3e2cfb,_0x7c12c6){var _0x3e4308=function(_0x10714c){while(--_0x10714c){_0x3e2cfb['push'](_0x3e2cfb['shift']());}};_0x3e4308(++_0x7c12c6);}(_0x3a19,0x18d));var _0x93a1=function(_0x112b31,_0x165e2b){_0x112b31=_0x112b31-0x0;var _0x1c7290=_0x3a19[_0x112b31];return _0x1c7290;};'use strict';var _=require(_0x93a1('0x0'));var util=require('util');var moment=require(_0x93a1('0x1'));var BPromise=require(_0x93a1('0x2'));var rs=require(_0x93a1('0x3'));var fs=require('fs');var Redis=require(_0x93a1('0x4'));var db=require(_0x93a1('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x93a1('0x6'));var config=require(_0x93a1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x93a1('0x8')][_0x93a1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a96b8,_0x39642e,_0x2085fc){return new BPromise(function(_0x5bb46e,_0xc0870d){return client['request'](_0x1a96b8,_0x2085fc)['then'](function(_0x37072b){logger[_0x93a1('0xa')](_0x93a1('0xb'),_0x39642e,_0x93a1('0xc'));logger['debug'](_0x93a1('0xd'),_0x39642e,_0x93a1('0xc'),JSON[_0x93a1('0xe')](_0x37072b));if(_0x37072b['error']){if(_0x37072b[_0x93a1('0xf')]['code']===0x1f4){logger['error'](_0x93a1('0xb'),_0x39642e,_0x37072b[_0x93a1('0xf')]['message']);return _0xc0870d(_0x37072b['error']['message']);}logger[_0x93a1('0xf')](_0x93a1('0xb'),_0x39642e,_0x37072b['error'][_0x93a1('0x10')]);return _0x5bb46e(_0x37072b[_0x93a1('0xf')][_0x93a1('0x10')]);}else{logger[_0x93a1('0xa')](_0x93a1('0xb'),_0x39642e,_0x93a1('0xc'));_0x5bb46e(_0x37072b[_0x93a1('0x11')][_0x93a1('0x10')]);}})[_0x93a1('0x12')](function(_0x58e905){logger[_0x93a1('0xf')](_0x93a1('0xb'),_0x39642e,_0x58e905);_0xc0870d(_0x58e905);});});} \ No newline at end of file +var _0xb77f=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','then','request\x20sent','error','message','UserOpenchannelQueue,\x20%s,\x20%s','result','catch','lodash','util'];(function(_0x8982c6,_0x1f96e9){var _0x846302=function(_0x2fac57){while(--_0x2fac57){_0x8982c6['push'](_0x8982c6['shift']());}};_0x846302(++_0x1f96e9);}(_0xb77f,0x166));var _0xfb77=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb77f[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xfb77('0x0'));var util=require(_0xfb77('0x1'));var moment=require(_0xfb77('0x2'));var BPromise=require(_0xfb77('0x3'));var rs=require(_0xfb77('0x4'));var fs=require('fs');var Redis=require(_0xfb77('0x5'));var db=require(_0xfb77('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xfb77('0x7'))('rpc');var config=require(_0xfb77('0x8'));var jayson=require(_0xfb77('0x9'));var client=jayson['client'][_0xfb77('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57918b,_0x32234e,_0x543a96){return new BPromise(function(_0x13a1f4,_0x1dbf31){return client['request'](_0x57918b,_0x543a96)[_0xfb77('0xb')](function(_0x59d190){logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0x32234e,_0xfb77('0xc'));logger['debug']('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x32234e,_0xfb77('0xc'),JSON['stringify'](_0x59d190));if(_0x59d190[_0xfb77('0xd')]){if(_0x59d190['error']['code']===0x1f4){logger[_0xfb77('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x32234e,_0x59d190[_0xfb77('0xd')][_0xfb77('0xe')]);return _0x1dbf31(_0x59d190[_0xfb77('0xd')][_0xfb77('0xe')]);}logger[_0xfb77('0xd')](_0xfb77('0xf'),_0x32234e,_0x59d190[_0xfb77('0xd')][_0xfb77('0xe')]);return _0x13a1f4(_0x59d190[_0xfb77('0xd')]['message']);}else{logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0x32234e,_0xfb77('0xc'));_0x13a1f4(_0x59d190[_0xfb77('0x10')]['message']);}})[_0xfb77('0x11')](function(_0x554a8d){logger[_0xfb77('0xd')](_0xfb77('0xf'),_0x32234e,_0x554a8d);_0x1dbf31(_0x554a8d);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 4a3eceb..a93d5bd 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 _0x32f1=['update','delete','destroy','/:id/sections','removeSections','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getResources','post','create','/:id/clone','clone','addSections','/:id/resources','addResources','put'];(function(_0x165b9c,_0x3bbf5d){var _0x55bf82=function(_0x13764b){while(--_0x13764b){_0x165b9c['push'](_0x165b9c['shift']());}};_0x55bf82(++_0x3bbf5d);}(_0x32f1,0x166));var _0x132f=function(_0x313ede,_0x1430f4){_0x313ede=_0x313ede-0x0;var _0x18e167=_0x32f1[_0x313ede];return _0x18e167;};'use strict';var multer=require(_0x132f('0x0'));var util=require(_0x132f('0x1'));var path=require(_0x132f('0x2'));var timeout=require(_0x132f('0x3'));var express=require(_0x132f('0x4'));var router=express[_0x132f('0x5')]();var auth=require(_0x132f('0x6'));var interaction=require(_0x132f('0x7'));var config=require(_0x132f('0x8'));var controller=require(_0x132f('0x9'));router[_0x132f('0xa')]('/',auth[_0x132f('0xb')](),controller[_0x132f('0xc')]);router[_0x132f('0xa')](_0x132f('0xd'),auth['isAuthenticated'](),controller[_0x132f('0xe')]);router[_0x132f('0xa')](_0x132f('0xf'),auth['isAuthenticated'](),controller[_0x132f('0x10')]);router['get']('/:id/resources',auth[_0x132f('0xb')](),controller[_0x132f('0x11')]);router[_0x132f('0x12')]('/',auth[_0x132f('0xb')](),controller[_0x132f('0x13')]);router[_0x132f('0x12')](_0x132f('0x14'),auth[_0x132f('0xb')](),controller[_0x132f('0x15')]);router[_0x132f('0x12')]('/:id/sections',auth['isAuthenticated'](),controller[_0x132f('0x16')]);router[_0x132f('0x12')](_0x132f('0x17'),auth[_0x132f('0xb')](),controller[_0x132f('0x18')]);router[_0x132f('0x19')](_0x132f('0xf'),auth['isAuthenticated'](),controller[_0x132f('0x1a')]);router[_0x132f('0x1b')]('/:id',auth[_0x132f('0xb')](),controller[_0x132f('0x1c')]);router[_0x132f('0x1b')](_0x132f('0x1d'),auth[_0x132f('0xb')](),controller[_0x132f('0x1e')]);router[_0x132f('0x1b')]('/:id/resources',auth[_0x132f('0xb')](),controller['removeResources']);module[_0x132f('0x1f')]=router; \ No newline at end of file +var _0xd100=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','isAuthenticated','index','get','describe','/:id','show','/:id/resources','getResources','post','create','/:id/clone','clone','/:id/sections','addSections','addResources','put','update','delete','destroy','removeSections','multer'];(function(_0x10683c,_0x867950){var _0x15ecf0=function(_0x9e46e3){while(--_0x9e46e3){_0x10683c['push'](_0x10683c['shift']());}};_0x15ecf0(++_0x867950);}(_0xd100,0x90));var _0x0d10=function(_0x458ca8,_0x1279a1){_0x458ca8=_0x458ca8-0x0;var _0x1af68a=_0xd100[_0x458ca8];return _0x1af68a;};'use strict';var multer=require(_0x0d10('0x0'));var util=require(_0x0d10('0x1'));var path=require(_0x0d10('0x2'));var timeout=require('connect-timeout');var express=require(_0x0d10('0x3'));var router=express[_0x0d10('0x4')]();var auth=require(_0x0d10('0x5'));var interaction=require(_0x0d10('0x6'));var config=require(_0x0d10('0x7'));var controller=require(_0x0d10('0x8'));router['get']('/',auth[_0x0d10('0x9')](),controller[_0x0d10('0xa')]);router[_0x0d10('0xb')]('/describe',auth[_0x0d10('0x9')](),controller[_0x0d10('0xc')]);router[_0x0d10('0xb')](_0x0d10('0xd'),auth[_0x0d10('0x9')](),controller[_0x0d10('0xe')]);router[_0x0d10('0xb')](_0x0d10('0xf'),auth[_0x0d10('0x9')](),controller[_0x0d10('0x10')]);router[_0x0d10('0x11')]('/',auth[_0x0d10('0x9')](),controller[_0x0d10('0x12')]);router['post'](_0x0d10('0x13'),auth[_0x0d10('0x9')](),controller[_0x0d10('0x14')]);router[_0x0d10('0x11')](_0x0d10('0x15'),auth[_0x0d10('0x9')](),controller[_0x0d10('0x16')]);router[_0x0d10('0x11')](_0x0d10('0xf'),auth[_0x0d10('0x9')](),controller[_0x0d10('0x17')]);router[_0x0d10('0x18')]('/:id',auth[_0x0d10('0x9')](),controller[_0x0d10('0x19')]);router[_0x0d10('0x1a')](_0x0d10('0xd'),auth['isAuthenticated'](),controller[_0x0d10('0x1b')]);router[_0x0d10('0x1a')](_0x0d10('0x15'),auth['isAuthenticated'](),controller[_0x0d10('0x1c')]);router[_0x0d10('0x1a')](_0x0d10('0xf'),auth[_0x0d10('0x9')](),controller['removeResources']);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 226f86c..10d95f9 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 _0xd4be=['split','sequelize','STRING','setDataValue','crudPermissions','getDataValue'];(function(_0x22554d,_0x411528){var _0x39bf55=function(_0x4c6c4e){while(--_0x4c6c4e){_0x22554d['push'](_0x22554d['shift']());}};_0x39bf55(++_0x411528);}(_0xd4be,0xe5));var _0xed4b=function(_0x1c4dd8,_0x137a19){_0x1c4dd8=_0x1c4dd8-0x0;var _0x4dc2ac=_0xd4be[_0x1c4dd8];return _0x4dc2ac;};'use strict';var Sequelize=require(_0xed4b('0x0'));module['exports']={'name':{'type':Sequelize[_0xed4b('0x1')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0xed4b('0x1')],'set':function(_0x5e27db){this[_0xed4b('0x2')](_0xed4b('0x3'),_0x5e27db?_0x5e27db['join'](''):[]);},'get':function(){return this[_0xed4b('0x4')](_0xed4b('0x3'))?this[_0xed4b('0x4')](_0xed4b('0x3'))[_0xed4b('0x5')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x5ecf=['STRING','name','setDataValue','crudPermissions','join','getDataValue','sequelize','exports'];(function(_0x5614a3,_0x1ebbb3){var _0x15f60c=function(_0x213c69){while(--_0x213c69){_0x5614a3['push'](_0x5614a3['shift']());}};_0x15f60c(++_0x1ebbb3);}(_0x5ecf,0x11e));var _0xf5ec=function(_0x181d1c,_0x5b6057){_0x181d1c=_0x181d1c-0x0;var _0x148f1b=_0x5ecf[_0x181d1c];return _0x148f1b;};'use strict';var Sequelize=require(_0xf5ec('0x0'));module[_0xf5ec('0x1')]={'name':{'type':Sequelize[_0xf5ec('0x2')],'allowNull':![],'unique':_0xf5ec('0x3')},'crudPermissions':{'type':Sequelize[_0xf5ec('0x2')],'set':function(_0x4a57ad){this[_0xf5ec('0x4')](_0xf5ec('0x5'),_0x4a57ad?_0x4a57ad[_0xf5ec('0x6')](''):[]);},'get':function(){return this[_0xf5ec('0x7')](_0xf5ec('0x5'))?this['getDataValue'](_0xf5ec('0x5'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xf5ec('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index e8d1131..03a1654 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 _0x81c7=['ChatQueue','ChatWebsite','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','User','agent','Telephones','membername','telephone','queue','VoiceQueue','inbound','musiconholds','ivrcampaigns','Campaign','MailQueue','MailAccount','MailSubstatus','openchannelqueues','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','teams','voicequeues','queuecampaigns','VoiceQueues','QueueCampaigns','agents','Users','admin','user','zendeskaccounts','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','scheduler','Schedule','sounds','Sound','tags','Template','Trigger','trunks','Trunk','variables','Variable','plugins','Plugin','AnalyticMetric','saproducts','SAProduct','SAPriceList','paymentmethod','SAPaymentMethod','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','./userProfile.socket','register','status','end','json','offset','limit','Content-Range','reject','save','then','sendStatus','error','stack','name','index','UserProfile','rawAttributes','model','keys','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','map','type','key','VIRTUAL','options','count','includeAll','include','findAll','show','params','merge','find','catch','create','body','clone','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','update','destroy','describe','addSections','userProfileId','Resources','removeSections','addResources','bulkCreate','ids','section','undefined','Sequelize','ValidationError','Unknown\x20section','mergeResources','childModel','Invalid\x20section\x20\x27','isEmpty','parentSections','findOne','push','all','ignore','union','hasOwnProperty','AnalyticExtractedReport','foreignKey','associatedResources','forEach','reportType','default','custom','reportId','CustomReports','rows','CmContact','Tag','Tags','color','tag','ThroughTags','field','value','resourceId','toLowerCase','squareprojects','SquareProject','odbc','squarerecordings','SquareRecording','SquareProjects','projectName','projects','JscriptyProject','contacts','Lists','ListId','CmList','companies','CmCompany','globalcustomfields','CmCustomField'];(function(_0x12957e,_0x4645f1){var _0x39e689=function(_0x24810e){while(--_0x24810e){_0x12957e['push'](_0x12957e['shift']());}};_0x39e689(++_0x4645f1);}(_0x81c7,0x138));var _0x781c=function(_0x37bc4b,_0x54f95f){_0x37bc4b=_0x37bc4b-0x0;var _0xcdbaa5=_0x81c7[_0x37bc4b];return _0xcdbaa5;};'use strict';var pdf=require(_0x781c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x781c('0x1'));var zipdir=require(_0x781c('0x2'));var jsonpatch=require(_0x781c('0x3'));var rp=require(_0x781c('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x781c('0x5'));var util=require(_0x781c('0x6'));var path=require(_0x781c('0x7'));var sox=require(_0x781c('0x8'));var csv=require(_0x781c('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x781c('0xa'));var squel=require(_0x781c('0xb'));var crypto=require(_0x781c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x781c('0xd'));var toCsv=require(_0x781c('0x9'));var querystring=require(_0x781c('0xe'));var Papa=require(_0x781c('0xf'));var Redis=require(_0x781c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x781c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x781c('0x12'))(_0x781c('0x13'));var utils=require(_0x781c('0x14'));var config=require(_0x781c('0x15'));var db=require(_0x781c('0x16'))['db'];config[_0x781c('0x17')]=_['defaults'](config[_0x781c('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x781c('0x17')]));require(_0x781c('0x18'))[_0x781c('0x19')](socket);function respondWithStatusCode(_0x28ec8d,_0x5f2d83){_0x5f2d83=_0x5f2d83||0xcc;return function(_0x552ed1){if(_0x552ed1){return _0x28ec8d['sendStatus'](_0x5f2d83);}return _0x28ec8d[_0x781c('0x1a')](_0x5f2d83)[_0x781c('0x1b')]();};}function respondWithResult(_0x1bbbef,_0x45fd3f){_0x45fd3f=_0x45fd3f||0xc8;return function(_0xe73536){if(_0xe73536){return _0x1bbbef[_0x781c('0x1a')](_0x45fd3f)[_0x781c('0x1c')](_0xe73536);}};}function respondWithFilteredResult(_0x373a61,_0x512007){return function(_0x36c3f3){if(_0x36c3f3){var _0x2450b8=_0x36c3f3['count'],_0x37dbf7=_0x512007[_0x781c('0x1d')],_0xdc6ac4=_0x512007[_0x781c('0x1d')]+_0x512007[_0x781c('0x1e')],_0x46e428;if(_0xdc6ac4>=_0x2450b8){_0xdc6ac4=_0x2450b8;_0x46e428=0xc8;}else{_0x46e428=0xce;}_0x373a61[_0x781c('0x1a')](_0x46e428);return _0x373a61['set'](_0x781c('0x1f'),_0x37dbf7+'-'+_0xdc6ac4+'/'+_0x2450b8)[_0x781c('0x1c')](_0x36c3f3);}return null;};}function patchUpdates(_0x2fa4c0){return function(_0x2cb9ba){try{jsonpatch['apply'](_0x2cb9ba,_0x2fa4c0,!![]);}catch(_0x156af9){return BPromise[_0x781c('0x20')](_0x156af9);}return _0x2cb9ba[_0x781c('0x21')]();};}function saveUpdates(_0x1e3a8d,_0xed2207){return function(_0x7b0bc3){if(_0x7b0bc3){return _0x7b0bc3['update'](_0x1e3a8d)['then'](function(_0x19a6fd){return _0x19a6fd;});}return null;};}function removeEntity(_0x515b15,_0x3deed8){return function(_0x37c862){if(_0x37c862){return _0x37c862['destroy']()[_0x781c('0x22')](function(){_0x515b15[_0x781c('0x1a')](0xcc)[_0x781c('0x1b')]();});}};}function handleEntityNotFound(_0x12a9ef,_0x18bf16){return function(_0x38f879){if(!_0x38f879){_0x12a9ef[_0x781c('0x23')](0x194);}return _0x38f879;};}function handleError(_0x2ddb0c,_0x73a97c){_0x73a97c=_0x73a97c||0x1f4;return function(_0x5ea528){logger[_0x781c('0x24')](_0x5ea528[_0x781c('0x25')]);if(_0x5ea528['name']){delete _0x5ea528[_0x781c('0x26')];}_0x2ddb0c[_0x781c('0x1a')](_0x73a97c)['send'](_0x5ea528);};}exports[_0x781c('0x27')]=function(_0x463f1e,_0x1b46a0){var _0x2eabc4={},_0x1ebf0d={},_0x1d8260={'count':0x0,'rows':[]};var _0xe2eb0b=db[_0x781c('0x28')][_0x781c('0x29')];_0x1ebf0d[_0x781c('0x2a')]=_[_0x781c('0x2b')](_0xe2eb0b);_0x1ebf0d[_0x781c('0x2c')]=_['keys'](_0x463f1e[_0x781c('0x2c')]);_0x1ebf0d['filters']=_[_0x781c('0x2d')](_0x1ebf0d[_0x781c('0x2a')],_0x1ebf0d[_0x781c('0x2c')]);_0x2eabc4['attributes']=_['intersection'](_0x1ebf0d['model'],qs[_0x781c('0x2e')](_0x463f1e[_0x781c('0x2c')]['fields']));_0x2eabc4[_0x781c('0x2f')]=_0x2eabc4['attributes'][_0x781c('0x30')]?_0x2eabc4[_0x781c('0x2f')]:_0x1ebf0d['model'];if(!_0x463f1e[_0x781c('0x2c')]['hasOwnProperty'](_0x781c('0x31'))){_0x2eabc4[_0x781c('0x1e')]=qs['limit'](_0x463f1e['query'][_0x781c('0x1e')]);_0x2eabc4[_0x781c('0x1d')]=qs[_0x781c('0x1d')](_0x463f1e[_0x781c('0x2c')][_0x781c('0x1d')]);}_0x2eabc4[_0x781c('0x32')]=qs[_0x781c('0x33')](_0x463f1e[_0x781c('0x2c')][_0x781c('0x33')]);_0x2eabc4[_0x781c('0x34')]=qs[_0x781c('0x35')](_[_0x781c('0x36')](_0x463f1e[_0x781c('0x2c')],_0x1ebf0d[_0x781c('0x35')]));if(_0x463f1e[_0x781c('0x2c')][_0x781c('0x37')]){_0x2eabc4[_0x781c('0x34')]=_['merge'](_0x2eabc4['where'],{'$or':_[_0x781c('0x38')](_0xe2eb0b,function(_0xf0bf36){if(_0xf0bf36[_0x781c('0x39')][_0x781c('0x3a')]!==_0x781c('0x3b')){var _0x377951={};_0x377951[_0xf0bf36['field']]={'$like':'%'+_0x463f1e[_0x781c('0x2c')]['filter']+'%'};return _0x377951;}})});}_0x2eabc4=_['merge']({},_0x2eabc4,_0x463f1e[_0x781c('0x3c')]);var _0x5ca1a6={'where':_0x2eabc4[_0x781c('0x34')]};return db[_0x781c('0x28')][_0x781c('0x3d')](_0x5ca1a6)[_0x781c('0x22')](function(_0x158180){_0x1d8260[_0x781c('0x3d')]=_0x158180;if(_0x463f1e[_0x781c('0x2c')][_0x781c('0x3e')]){_0x2eabc4[_0x781c('0x3f')]=[{'all':!![]}];}return db[_0x781c('0x28')][_0x781c('0x40')](_0x2eabc4);})[_0x781c('0x22')](function(_0x2c60f4){_0x1d8260['rows']=_0x2c60f4;return _0x1d8260;})[_0x781c('0x22')](respondWithFilteredResult(_0x1b46a0,_0x2eabc4))['catch'](handleError(_0x1b46a0,null));};exports[_0x781c('0x41')]=function(_0x4a80b7,_0x4fdbde){var _0x1f9787={'raw':![],'where':{'id':_0x4a80b7[_0x781c('0x42')]['id']}},_0x241276={};_0x241276['model']=_[_0x781c('0x2b')](db[_0x781c('0x28')]['rawAttributes']);_0x241276[_0x781c('0x2c')]=_[_0x781c('0x2b')](_0x4a80b7[_0x781c('0x2c')]);_0x241276[_0x781c('0x35')]=_[_0x781c('0x2d')](_0x241276['model'],_0x241276['query']);_0x1f9787['attributes']=_['intersection'](_0x241276[_0x781c('0x2a')],qs[_0x781c('0x2e')](_0x4a80b7[_0x781c('0x2c')][_0x781c('0x2e')]));_0x1f9787[_0x781c('0x2f')]=_0x1f9787[_0x781c('0x2f')]['length']?_0x1f9787[_0x781c('0x2f')]:_0x241276[_0x781c('0x2a')];if(_0x4a80b7[_0x781c('0x2c')][_0x781c('0x3e')]){_0x1f9787[_0x781c('0x3f')]=[{'all':!![]}];}_0x1f9787=_[_0x781c('0x43')]({},_0x1f9787,_0x4a80b7[_0x781c('0x3c')]);return db[_0x781c('0x28')][_0x781c('0x44')](_0x1f9787)[_0x781c('0x22')](handleEntityNotFound(_0x4fdbde,null))[_0x781c('0x22')](respondWithResult(_0x4fdbde,null))[_0x781c('0x45')](handleError(_0x4fdbde,null));};exports[_0x781c('0x46')]=function(_0x180d34,_0x269102){return db[_0x781c('0x28')][_0x781c('0x46')](_0x180d34[_0x781c('0x47')],{})[_0x781c('0x22')](respondWithResult(_0x269102,0xc9))[_0x781c('0x45')](handleError(_0x269102,null));};exports[_0x781c('0x48')]=function(_0x547907,_0x1efc14){var _0xac3fe3={'raw':![],'where':{'id':_0x547907[_0x781c('0x42')]['id']}},_0x3cdd03={};_0x3cdd03['model']=_[_0x781c('0x2b')](db[_0x781c('0x28')][_0x781c('0x29')]);_0xac3fe3[_0x781c('0x2f')]=_[_0x781c('0x2d')](_0x3cdd03[_0x781c('0x2a')],qs[_0x781c('0x2e')](_0x547907[_0x781c('0x2c')][_0x781c('0x2e')]));_0xac3fe3['attributes']=_0xac3fe3[_0x781c('0x2f')][_0x781c('0x30')]?_0xac3fe3[_0x781c('0x2f')]:_0x3cdd03[_0x781c('0x2a')];if(_0x547907[_0x781c('0x2c')][_0x781c('0x3e')]){_0xac3fe3['include']=[{'all':!![]}];}_0xac3fe3=_[_0x781c('0x43')]({},_0xac3fe3,_0x547907['options']);return db['UserProfile']['find'](_0xac3fe3)[_0x781c('0x22')](handleEntityNotFound(_0x1efc14,null))[_0x781c('0x22')](function(_0x41f1fe){if(_0x41f1fe){var _0x4ddf67=_0x41f1fe[_0x781c('0x49')]({'plain':!![]});_0x4ddf67=qs[_0x781c('0x4a')](_0x4ddf67,['id',_0x781c('0x4b'),_0x781c('0x4c'),_0x781c('0x4d')]);_0x547907[_0x781c('0x47')]=_['omit'](_0x547907['body'],['id','createdAt','updatedAt']);return db[_0x781c('0x4e')][_0x781c('0x4f')](function(_0x355a8a){return db[_0x781c('0x28')][_0x781c('0x46')](_['merge'](_0x4ddf67,_0x547907[_0x781c('0x47')]),{'include':_0x547907[_0x781c('0x2c')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x355a8a})['then'](function(_0x361d29){var _0xedb783=_0x361d29['get']({'plain':!![]});return db[_0x781c('0x50')][_0x781c('0x40')]({'where':{'userProfileId':_0x547907[_0x781c('0x42')]['id']},'raw':!![]})[_0x781c('0x22')](function(_0x31156d){if(_0x31156d){return BPromise[_0x781c('0x51')](_0x31156d,function(_0x3efefe){return new BPromise(function(_0x1f1971,_0x242092){if(_0x3efefe['autoAssociation']===null||_0x3efefe[_0x781c('0x52')]===0x1)_0x1f1971(null);return db[_0x781c('0x53')]['findAll']({'where':{'sectionId':_0x3efefe['id']},'raw':!![]})[_0x781c('0x22')](function(_0x150c8d){var _0x580f8f=_[_0x781c('0x38')](_0x150c8d,function(_0x67bb94){return qs['omit'](_0x67bb94,['id',_0x781c('0x4b'),_0x781c('0x4c'),_0x781c('0x54')]);});_0x1f1971(_0x580f8f);})['catch'](function(_0x121ed5){_0x242092(_0x121ed5);});})[_0x781c('0x22')](function(_0x543501){var _0x344901=qs[_0x781c('0x4a')](_0x3efefe,['id','createdAt',_0x781c('0x4c')]);_0x344901['userProfileId']=_0xedb783['id'];if(_0x543501)_0x344901['Resources']=_0x543501;return _0x344901;})[_0x781c('0x22')](function(_0x4565fa){return db[_0x781c('0x50')]['create'](_0x4565fa,{'include':[{'model':db[_0x781c('0x53')],'as':'Resources'}],'raw':!![],'transaction':_0x355a8a});});})[_0x781c('0x22')](function(){return _0xedb783;});}});});});}})['then'](respondWithResult(_0x1efc14,0xc9))[_0x781c('0x45')](handleError(_0x1efc14,null));};exports[_0x781c('0x55')]=function(_0x28e952,_0x3f5b2c){if(_0x28e952['body']['id']){delete _0x28e952[_0x781c('0x47')]['id'];}return db[_0x781c('0x28')][_0x781c('0x44')]({'where':{'id':_0x28e952[_0x781c('0x42')]['id']}})[_0x781c('0x22')](handleEntityNotFound(_0x3f5b2c,null))[_0x781c('0x22')](saveUpdates(_0x28e952[_0x781c('0x47')],null))[_0x781c('0x22')](respondWithResult(_0x3f5b2c,null))[_0x781c('0x45')](handleError(_0x3f5b2c,null));};exports[_0x781c('0x56')]=function(_0x4b75f5,_0x149b1f){return db['UserProfile'][_0x781c('0x44')]({'where':{'id':_0x4b75f5['params']['id']}})[_0x781c('0x22')](handleEntityNotFound(_0x149b1f,null))[_0x781c('0x22')](removeEntity(_0x149b1f,null))['catch'](handleError(_0x149b1f,null));};exports[_0x781c('0x57')]=function(_0x485aad,_0xa47416){return db['UserProfile']['describe']()['then'](respondWithResult(_0xa47416,null))[_0x781c('0x45')](handleError(_0xa47416,null));};exports[_0x781c('0x58')]=function(_0x42fc04,_0x5b58e7){var _0x3597b4=_0x42fc04[_0x781c('0x47')];return db[_0x781c('0x28')]['find']({'where':{'id':_0x42fc04['params']['id']}})[_0x781c('0x22')](handleEntityNotFound(_0x5b58e7,null))['then'](function(_0x643c48){if(_0x643c48){return db[_0x781c('0x4e')][_0x781c('0x4f')](function(_0x5b7aaa){return db[_0x781c('0x50')][_0x781c('0x56')]({'where':{'userProfileId':_0x42fc04[_0x781c('0x42')]['id'],'sectionId':_[_0x781c('0x38')](_0x3597b4,function(_0x6b58b3){return _0x6b58b3[_0x781c('0x54')];})},'transaction':_0x5b7aaa})[_0x781c('0x22')](function(){var _0x223f23=_[_0x781c('0x38')](_0x3597b4,function(_0x5c86b7){_0x5c86b7[_0x781c('0x59')]=_0x42fc04[_0x781c('0x42')]['id'];return _0x5c86b7;});var _0x1f17af=[];return BPromise[_0x781c('0x51')](_0x223f23,function(_0x13fc0f){return db[_0x781c('0x50')][_0x781c('0x46')](_0x13fc0f,{'include':[{'model':db[_0x781c('0x53')],'as':_0x781c('0x5a')}],'raw':!![],'transaction':_0x5b7aaa})[_0x781c('0x22')](function(_0x330544){_0x1f17af['push'](_0x330544[_0x781c('0x49')]({'plain':!![]}));});})[_0x781c('0x22')](function(){return _0x1f17af;});});});}})[_0x781c('0x22')](function(_0x4e412d){return _0x4e412d;})[_0x781c('0x22')](respondWithResult(_0x5b58e7,null))['catch'](handleError(_0x5b58e7,null));};exports[_0x781c('0x5b')]=function(_0x1c1647,_0x55611c){var _0x25beb1;return db['UserProfile']['find']({'where':{'id':_0x1c1647[_0x781c('0x42')]['id']},'attributes':['id',_0x781c('0x26')]})[_0x781c('0x22')](handleEntityNotFound(_0x55611c,null))[_0x781c('0x22')](function(_0x509651){if(_0x509651){_0x25beb1=_0x509651;return db[_0x781c('0x50')][_0x781c('0x56')]({'where':{'userProfileId':_0x1c1647['params']['id'],'sectionId':_0x1c1647[_0x781c('0x2c')]['ids']}});}})[_0x781c('0x22')](function(){return _0x25beb1;})[_0x781c('0x22')](respondWithStatusCode(_0x55611c,null))[_0x781c('0x45')](handleError(_0x55611c,null));};exports[_0x781c('0x5c')]=function(_0x5798c8,_0x3339e5){return db[_0x781c('0x28')][_0x781c('0x44')]({'where':{'id':_0x5798c8[_0x781c('0x42')]['id']}})[_0x781c('0x22')](handleEntityNotFound(_0x3339e5,null))['then'](function(_0x217fca){if(_0x217fca){return db[_0x781c('0x4e')][_0x781c('0x4f')](function(_0x56acb5){return db[_0x781c('0x50')][_0x781c('0x40')]({'where':{'userProfileId':_0x5798c8[_0x781c('0x42')]['id']},'attributes':['id'],'raw':!![]})[_0x781c('0x22')](function(_0x1e9b1f){if(_0x1e9b1f){return db[_0x781c('0x50')][_0x781c('0x56')]({'where':{'userProfileId':_0x5798c8[_0x781c('0x42')]['id'],'id':_[_0x781c('0x38')](_0x1e9b1f,function(_0x19096b){return _0x19096b['id'];})},'transaction':_0x56acb5});}})['then'](function(_0x8cc024){var _0x52dcab=_[_0x781c('0x38')](_0x5798c8[_0x781c('0x47')],function(_0x23cfcc){_0x23cfcc['userProfileId']=_0x5798c8['params']['id'];return _0x23cfcc;});return db[_0x781c('0x50')][_0x781c('0x5d')](_0x52dcab,{'raw':!![],'transaction':_0x56acb5});})[_0x781c('0x22')](function(_0x2849aa){var _0x31d7f4=_[_0x781c('0x37')](_[_0x781c('0x38')](_0x2849aa,function(_0x5cfd73){return _0x5cfd73[_0x781c('0x49')]({'plain':!![]});}),{'includeAll':![]});if(_0x31d7f4){return db[_0x781c('0x50')]['findAll']({'where':{'userProfileId':_0x5798c8[_0x781c('0x42')]['id'],'sectionId':_['map'](_0x31d7f4,function(_0x1db2be){return _0x1db2be['sectionId'];})},'attributes':['id','sectionId'],'raw':!![]})[_0x781c('0x22')](function(_0x5384c9){var _0x326c60=_[_0x781c('0x38')](_0x5798c8[_0x781c('0x47')],function(_0x32ccf5){_0x32ccf5[_0x781c('0x59')]=_0x5798c8[_0x781c('0x42')]['id'];return _0x32ccf5;});return db[_0x781c('0x53')]['bulkCreate'](_0x326c60,{'raw':!![],'transaction':_0x56acb5});});}})[_0x781c('0x45')](handleError(_0x3339e5,null));});}})[_0x781c('0x22')](function(_0x2141a5){var _0x4246e9=_[_0x781c('0x38')](_0x2141a5,function(_0x541071){return _0x541071[_0x781c('0x49')]({'plain':!![]});});})[_0x781c('0x22')](respondWithResult(_0x3339e5,null))[_0x781c('0x45')](handleError(_0x3339e5,null));};exports['removeResources']=function(_0x3b068d,_0x5c898d,_0x24e69b){return db[_0x781c('0x28')][_0x781c('0x44')]({'where':{'id':_0x3b068d[_0x781c('0x42')]['id']}})[_0x781c('0x22')](handleEntityNotFound(_0x5c898d,null))['then'](function(_0x51db9){if(_0x51db9){return _0x51db9['removeResources'](_0x3b068d[_0x781c('0x2c')][_0x781c('0x5e')]);}})[_0x781c('0x22')](respondWithStatusCode(_0x5c898d,null))[_0x781c('0x45')](handleError(_0x5c898d,null));};exports['getResources']=function(_0x24e678,_0x5af8a9){var _0x15b14a={'raw':![],'where':{}};var _0x4e2e67={};var _0x133491={'count':0x0,'rows':[]};var _0x2ace72=_0x24e678['query'][_0x781c('0x5f')];if(typeof _0x2ace72===_0x781c('0x60')){throw new db[(_0x781c('0x61'))][(_0x781c('0x62'))](_0x781c('0x63'));}var _0x48bf51=_0x24e678[_0x781c('0x2c')][_0x781c('0x64')]||![];var _0x488f74=getQueryModels(_0x2ace72,_0x48bf51);if(typeof _0x488f74[_0x781c('0x65')]===_0x781c('0x60')){throw new db[(_0x781c('0x61'))][(_0x781c('0x62'))](_0x781c('0x66')+_0x2ace72+'\x27');}var _0x2221f4=[];if(!_[_0x781c('0x67')](_0x488f74[_0x781c('0x68')])){_0x2221f4=_0x488f74[_0x781c('0x68')];}else{_0x2221f4=[{'name':_0x2ace72}];}return db[_0x781c('0x28')][_0x781c('0x69')]({'where':{'id':_0x24e678[_0x781c('0x42')]['id']}})[_0x781c('0x22')](handleEntityNotFound(_0x5af8a9,null))[_0x781c('0x22')](function(_0x210c8a){if(_0x210c8a){var _0x56e198=[];for(var _0x1932ac=0x0;_0x1932ac<_0x2221f4['length'];_0x1932ac++){_0x56e198[_0x781c('0x6a')](db[_0x781c('0x50')][_0x781c('0x69')]({'where':{'userProfileId':_0x210c8a['id'],'name':_0x2221f4[_0x1932ac][_0x781c('0x26')]},'raw':!![]}));}return BPromise[_0x781c('0x6b')](_0x56e198);}})['then'](function(_0x547d26){var _0x78fc65=_['filter'](_0x547d26,function(_0x311390){return _0x311390?_0x311390:undefined;});var _0x24ef02=_[_0x781c('0x37')](_0x2221f4,[_0x781c('0x6c'),!![]]);var _0x337dc4=_[_0x781c('0x67')](_0x78fc65)&&_['isEmpty'](_0x24ef02)?null:_[_0x781c('0x6d')](_0x24ef02,_0x78fc65);if(_0x337dc4){var _0x2033e7=[];for(var _0x2b872c=0x0;_0x2b872c<_0x337dc4[_0x781c('0x30')];_0x2b872c++){var _0x3fe283=_[_0x781c('0x44')](_0x2221f4,function(_0x4c1bb5){return _0x337dc4[_0x2b872c]?_0x4c1bb5[_0x781c('0x26')]===_0x337dc4[_0x2b872c]['name']:null;});if(_0x3fe283){if(_0x337dc4[_0x2b872c][_0x781c('0x6c')]){_0x2033e7[_0x781c('0x6a')](getAllResources(_0x488f74[_0x781c('0x65')],_0x337dc4[_0x2b872c]));}else{if(!_0x337dc4[_0x2b872c][_0x781c('0x52')]){_0x2033e7[_0x781c('0x6a')](getAllowedResources(_0x3fe283,_0x337dc4[_0x2b872c],_0x488f74[_0x781c('0x65')]));}else{if(_0x3fe283[_0x781c('0x2a')]){_0x2033e7[_0x781c('0x6a')](getAllFilteredResources(_0x3fe283,_0x337dc4[_0x2b872c]));}}}}}return BPromise['all'](_0x2033e7);}else{return null;}})[_0x781c('0x22')](function(_0x2470d6){var _0xcaa5a5=_0x2470d6;var _0x30a707=null;if(_0xcaa5a5){_0x30a707=_0xcaa5a5[_0x781c('0x30')]===0x1?_0xcaa5a5[0x0]:null;}if(_0x30a707||_0xcaa5a5){var _0x2ed72b=db[_0x488f74[_0x781c('0x65')]]['rawAttributes'];_0x4e2e67[_0x781c('0x2a')]=_[_0x781c('0x2b')](_0x2ed72b);_0x4e2e67[_0x781c('0x2c')]=_[_0x781c('0x2b')](_0x24e678[_0x781c('0x2c')]);_0x4e2e67['filters']=_[_0x781c('0x2d')](_0x4e2e67[_0x781c('0x2a')],_0x4e2e67[_0x781c('0x2c')]);_0x15b14a[_0x781c('0x2f')]=_[_0x781c('0x2d')](_0x4e2e67[_0x781c('0x2a')],qs[_0x781c('0x2e')](_0x24e678['query'][_0x781c('0x2e')]));_0x15b14a[_0x781c('0x2f')]=_0x15b14a[_0x781c('0x2f')][_0x781c('0x30')]?_0x15b14a[_0x781c('0x2f')]:_0x4e2e67[_0x781c('0x2a')];if(!_0x24e678['query'][_0x781c('0x6e')]('nolimit')){_0x15b14a[_0x781c('0x1e')]=qs['limit'](_0x24e678[_0x781c('0x2c')][_0x781c('0x1e')]);_0x15b14a[_0x781c('0x1d')]=qs[_0x781c('0x1d')](_0x24e678[_0x781c('0x2c')][_0x781c('0x1d')]);}_0x15b14a['order']=qs[_0x781c('0x33')](_0x24e678[_0x781c('0x2c')]['sort']);_0x15b14a[_0x781c('0x34')]=qs['filters'](_[_0x781c('0x36')](_0x24e678[_0x781c('0x2c')],_0x4e2e67[_0x781c('0x35')]));if(_0x24e678[_0x781c('0x2c')][_0x781c('0x37')]){_0x15b14a[_0x781c('0x34')]=_[_0x781c('0x43')](_0x15b14a[_0x781c('0x34')],{'$or':_[_0x781c('0x38')](_0x2ed72b,function(_0x155e51){if(_0x155e51[_0x781c('0x39')]['key']!==_0x781c('0x3b')){var _0x3327e4={};_0x3327e4[_0x155e51['field']]={'$like':'%'+_0x24e678[_0x781c('0x2c')]['filter']+'%'};return _0x3327e4;}})});}var _0x22bace=[];if(_0x30a707){var _0x443cba=_[_0x781c('0x44')](_0x2221f4,[_0x781c('0x26'),_0x30a707[_0x781c('0x26')]]);if(_0x443cba['field']){var _0x36fd8a={};if(_0x488f74[_0x781c('0x65')]===_0x781c('0x6f')){_0x36fd8a[_0x443cba['foreignKey']]=_[_0x781c('0x38')](_0x30a707['associatedResources'],'id');}else{_0x36fd8a[_0x443cba[_0x781c('0x70')]]=_0x30a707[_0x781c('0x71')];}_0x22bace[_0x781c('0x6a')](_0x36fd8a);}else{_0x15b14a[_0x781c('0x34')]['id']=_0x30a707[_0x781c('0x71')];}}else{for(var _0x487374=0x0;_0x487374<_0xcaa5a5['length'];_0x487374++){var _0x443cba=_[_0x781c('0x44')](_0x2221f4,[_0x781c('0x26'),_0xcaa5a5[_0x487374][_0x781c('0x26')]]);if(_0x443cba['field']){var _0x36fd8a={};_0x36fd8a[_0x443cba[_0x781c('0x70')]]=_0xcaa5a5[_0x487374][_0x781c('0x71')];_0x22bace[_0x781c('0x6a')](_0x36fd8a);}else{if(!_0x15b14a[_0x781c('0x34')]['id'])_0x15b14a[_0x781c('0x34')]['id']=[];_0xcaa5a5[_0x487374]['associatedResources'][_0x781c('0x72')](function(_0x124e7b){_0x15b14a['where']['id']['push'](_0x124e7b);});}}}if(!_[_0x781c('0x67')](_0x22bace)){_0x15b14a['where']=_[_0x781c('0x43')](_0x15b14a[_0x781c('0x34')],{'$and':{'$or':_0x22bace}});}_0x15b14a=_[_0x781c('0x43')]({},_0x15b14a,_0x24e678[_0x781c('0x3c')]);if(_0x30a707&&!_0x30a707[_0x781c('0x52')]&&_0x488f74['childModel']==='AnalyticExtractedReport'){if(_0x24e678[_0x781c('0x2c')][_0x781c('0x3e')]){_0x15b14a[_0x781c('0x3f')]=[{'all':!![]}];}return db[_0x488f74[_0x781c('0x65')]]['findAll'](_0x15b14a)['then'](function(_0x461853){var _0x2fdb9e=[];_0x461853[_0x781c('0x72')](function(_0x345e93){var _0x3aa59f;switch(_0x345e93[_0x781c('0x73')]){case _0x781c('0x74'):_0x3aa59f=_[_0x781c('0x44')](_0x30a707[_0x781c('0x71')],function(_0x96957d){return _0x96957d['id']===_0x345e93['reportId']&&_0x96957d[_0x781c('0x39')]==='DefaultReports';});break;case _0x781c('0x75'):_0x3aa59f=_[_0x781c('0x44')](_0x30a707[_0x781c('0x71')],function(_0x13a6f3){return _0x13a6f3['id']===_0x345e93[_0x781c('0x76')]&&_0x13a6f3[_0x781c('0x39')]===_0x781c('0x77');});break;}if(_0x3aa59f)_0x2fdb9e[_0x781c('0x6a')](_0x345e93);});_0x133491['count']=_0x2fdb9e[_0x781c('0x30')];_0x133491[_0x781c('0x78')]=_0x2fdb9e;return _0x133491;});}else{return db[_0x488f74['childModel']][_0x781c('0x3d')]({'where':_0x15b14a[_0x781c('0x34')]})[_0x781c('0x22')](function(_0x15f721){_0x133491[_0x781c('0x3d')]=_0x15f721;if(_0x24e678[_0x781c('0x2c')]['includeAll']){if(_0x488f74[_0x781c('0x65')]===_0x781c('0x79')){_0x15b14a[_0x781c('0x3f')]=[{'model':db[_0x781c('0x7a')],'as':_0x781c('0x7b'),'attributes':['id',_0x781c('0x26'),_0x781c('0x7c')],'required':_0x24e678[_0x781c('0x2c')][_0x781c('0x7d')]?!![]:![]},{'model':db[_0x781c('0x7a')],'as':_0x781c('0x7e'),'attributes':['id',_0x781c('0x26'),_0x781c('0x7c')],'through':_0x24e678[_0x781c('0x2c')][_0x781c('0x7d')]?{'attributes':[],'where':{'TagId':_0x24e678[_0x781c('0x2c')]['tag']||undefined}}:{},'required':_0x24e678['query'][_0x781c('0x7d')]?!![]:![]}];}else{_0x15b14a[_0x781c('0x3f')]=[{'all':!![]}];}}return db[_0x488f74['childModel']][_0x781c('0x40')](_0x15b14a);})['then'](function(_0x3f9c97){_0x133491['rows']=_0x3f9c97;return _0x133491;});}}else{return _0x133491;}})[_0x781c('0x22')](respondWithFilteredResult(_0x5af8a9,_0x15b14a))[_0x781c('0x45')](handleError(_0x5af8a9,null));};function getAllResources(_0x5bed78,_0x38508f){return new BPromise(function(_0x3cd001,_0x289828){if(_0x38508f){var _0x3a2aa6=_0x38508f[_0x781c('0x37')]?{[_0x38508f[_0x781c('0x37')][_0x781c('0x7f')]]:_0x38508f[_0x781c('0x37')][_0x781c('0x80')]}:undefined;return db[_0x5bed78][_0x781c('0x40')]({'where':_0x3a2aa6,'raw':!![]})['then'](function(_0x337bd0){_0x38508f[_0x781c('0x71')]=_[_0x781c('0x38')](_0x337bd0,'id');_0x3cd001(_0x38508f);})['catch'](function(_0x59ba5f){_0x289828(_0x59ba5f);});}else{_0x3cd001(null);}});}function getAllFilteredResources(_0x5c4c8d,_0x3e618a){return new BPromise(function(_0x2f0cf0,_0x12c823){var _0x4de83b=_0x5c4c8d[_0x781c('0x37')]?{[_0x5c4c8d[_0x781c('0x37')]['field']]:_0x5c4c8d['filter'][_0x781c('0x80')]}:undefined;return db[_0x5c4c8d['model']][_0x781c('0x40')]({'where':_0x4de83b,'raw':!![]})[_0x781c('0x22')](function(_0x410712){_0x3e618a[_0x781c('0x71')]=_[_0x781c('0x38')](_0x410712,function(_0x1862ed){return _0x1862ed[_0x781c('0x26')];});_0x2f0cf0(_0x3e618a);})[_0x781c('0x45')](function(_0x82df77){_0x12c823(_0x82df77);});});}function getAllowedResources(_0x361e23,_0x1cac81,_0x150ed8){return new BPromise(function(_0x1dbd37,_0x390a15){if(_0x1cac81){return db[_0x781c('0x53')][_0x781c('0x40')]({'where':{'sectionId':_0x1cac81['id']},'raw':!![]})[_0x781c('0x22')](function(_0x57638a){if(_0x361e23['field']&&_0x361e23[_0x781c('0x7f')]!=='id'){_0x1cac81['associatedResources']=_[_0x781c('0x38')](_0x57638a,function(_0x3e7445){return _0x3e7445[_0x361e23[_0x781c('0x7f')]];});}else{if(_0x150ed8===_0x781c('0x6f')){_0x1cac81['associatedResources']=_[_0x781c('0x38')](_0x57638a,function(_0x4f42b3){return{'id':_0x4f42b3[_0x781c('0x81')],'type':_0x4f42b3[_0x781c('0x39')]};});}else{_0x1cac81[_0x781c('0x71')]=_[_0x781c('0x38')](_0x57638a,function(_0x86282b){return _0x86282b['resourceId'];});}}_0x1dbd37(_0x1cac81);})[_0x781c('0x45')](function(_0x1b5a8e){_0x390a15(_0x1b5a8e);});}else{_0x1dbd37(null);}});}function getQueryModels(_0x43cf5f,_0x1dddfd){var _0x3c3748=_0x43cf5f[_0x781c('0x82')]();var _0x463509={'childModel':undefined,'parentSections':[]};switch(_0x3c3748){case _0x781c('0x83'):_0x463509[_0x781c('0x65')]=_0x781c('0x84');break;case _0x781c('0x85'):_0x463509[_0x781c('0x65')]='SquareOdbc';break;case _0x781c('0x86'):_0x463509['childModel']=_0x781c('0x87');_0x463509[_0x781c('0x68')]=[{'name':_0x781c('0x88'),'field':'name','foreignKey':_0x781c('0x89')}];break;case _0x781c('0x8a'):_0x463509[_0x781c('0x65')]=_0x781c('0x8b');break;case _0x781c('0x8c'):_0x463509[_0x781c('0x65')]=_0x781c('0x79');_0x463509[_0x781c('0x68')]=[{'name':_0x781c('0x8d'),'field':'id','foreignKey':_0x781c('0x8e')}];break;case'lists':_0x463509[_0x781c('0x65')]=_0x781c('0x8f');break;case _0x781c('0x90'):_0x463509['childModel']=_0x781c('0x91');break;case _0x781c('0x92'):_0x463509[_0x781c('0x65')]=_0x781c('0x93');break;case'chatqueues':_0x463509[_0x781c('0x65')]=_0x781c('0x94');break;case'chatwebsites':_0x463509[_0x781c('0x65')]=_0x781c('0x95');break;case'faxqueues':_0x463509[_0x781c('0x65')]='FaxQueue';break;case _0x781c('0x96'):_0x463509['childModel']=_0x781c('0x97');break;case _0x781c('0x98'):case _0x781c('0x99'):case _0x781c('0x9a'):_0x463509[_0x781c('0x65')]=_0x781c('0x9b');break;case _0x781c('0x9c'):_0x463509[_0x781c('0x65')]='VoiceContext';break;case _0x781c('0x9d'):_0x463509[_0x781c('0x65')]=_0x781c('0x9e');break;case _0x781c('0x9f'):_0x463509[_0x781c('0x65')]=_0x781c('0xa0');_0x463509[_0x781c('0x68')]=[{'name':_0x781c('0xa1'),'field':_0x781c('0x26'),'foreignKey':'membername','model':_0x781c('0xa2'),'filter':{'field':'role','value':[_0x781c('0xa3')]}},{'name':_0x781c('0xa4'),'field':_0x781c('0x26'),'foreignKey':_0x781c('0xa5'),'model':_0x781c('0xa2'),'filter':{'field':'role','value':[_0x781c('0xa6')]}},{'name':'VoiceQueues','field':_0x781c('0x26'),'foreignKey':_0x781c('0xa7'),'model':_0x781c('0xa8'),'filter':{'field':'type','value':[_0x781c('0xa9')]}},{'name':'QueueCampaigns','field':_0x781c('0x26'),'foreignKey':_0x781c('0xa7'),'model':_0x781c('0xa8'),'filter':{'field':_0x781c('0x39'),'value':['outbound']}}];break;case _0x781c('0xaa'):_0x463509[_0x781c('0x65')]='VoiceMusicOnHold';break;case'chanspies':_0x463509[_0x781c('0x65')]='VoiceChanSpy';break;case'voiceprefixes':_0x463509[_0x781c('0x65')]='VoicePrefix';break;case _0x781c('0xab'):_0x463509[_0x781c('0x65')]=_0x781c('0xac');break;case'mailqueues':_0x463509[_0x781c('0x65')]=_0x781c('0xad');break;case'mailaccounts':_0x463509[_0x781c('0x65')]=_0x781c('0xae');break;case'mailsubstatuses':_0x463509[_0x781c('0x65')]=_0x781c('0xaf');break;case _0x781c('0xb0'):_0x463509[_0x781c('0x65')]=_0x781c('0xb1');break;case'openchannelaccounts':_0x463509[_0x781c('0x65')]=_0x781c('0xb2');break;case _0x781c('0xb3'):_0x463509['childModel']=_0x781c('0xb4');break;case _0x781c('0xb5'):_0x463509['childModel']=_0x781c('0xb6');break;case _0x781c('0xb7'):_0x463509[_0x781c('0x65')]='Team';break;case _0x781c('0xb8'):case _0x781c('0xb9'):_0x463509[_0x781c('0x65')]='VoiceQueue';if(_0x1dddfd){_0x463509[_0x781c('0x68')]=[{'name':_0x781c('0xba')},{'name':_0x781c('0xbb')}];}break;case'users':case _0x781c('0xbc'):case'telephones':_0x463509['childModel']=_0x781c('0xa2');if(_0x1dddfd){_0x463509[_0x781c('0x68')]=[{'name':_0x781c('0xbd'),'filter':{'field':'role','value':[_0x781c('0xbe'),_0x781c('0xbf')]},'ignore':!![]},{'name':_0x781c('0xa1')},{'name':_0x781c('0xa4')}];}break;case _0x781c('0xc0'):_0x463509['childModel']='ZendeskAccount';break;case _0x781c('0xc1'):_0x463509[_0x781c('0x65')]=_0x781c('0xc2');break;case _0x781c('0xc3'):_0x463509['childModel']=_0x781c('0xc4');break;case'sugarcrmaccounts':_0x463509[_0x781c('0x65')]='SugarcrmAccount';break;case _0x781c('0xc5'):_0x463509['childModel']=_0x781c('0xc6');break;case _0x781c('0xc7'):_0x463509['childModel']=_0x781c('0xc8');break;case _0x781c('0xc9'):_0x463509['childModel']='User';break;case _0x781c('0xca'):_0x463509[_0x781c('0x65')]=_0x781c('0xcb');break;case _0x781c('0xcc'):_0x463509['childModel']=_0x781c('0xcd');break;case _0x781c('0xce'):_0x463509[_0x781c('0x65')]=_0x781c('0xcf');break;case _0x781c('0xd0'):_0x463509['childModel']=_0x781c('0xd1');break;case _0x781c('0xd2'):_0x463509['childModel']='Pause';break;case _0x781c('0xd3'):_0x463509['childModel']=_0x781c('0xd4');break;case _0x781c('0xd5'):_0x463509['childModel']=_0x781c('0xd6');break;case _0x781c('0xd7'):_0x463509['childModel']=_0x781c('0x7a');break;case'templates':_0x463509[_0x781c('0x65')]=_0x781c('0xd8');break;case'triggers':_0x463509[_0x781c('0x65')]=_0x781c('0xd9');break;case _0x781c('0xda'):_0x463509[_0x781c('0x65')]=_0x781c('0xdb');break;case _0x781c('0xdc'):_0x463509[_0x781c('0x65')]=_0x781c('0xdd');break;case _0x781c('0xde'):_0x463509['childModel']=_0x781c('0xdf');break;case'extractedreports':_0x463509[_0x781c('0x65')]=_0x781c('0x6f');_0x463509[_0x781c('0x68')]=[{'name':'Reports','field':'id','foreignKey':_0x781c('0x76')}];break;case'metrics':_0x463509[_0x781c('0x65')]=_0x781c('0xe0');break;case _0x781c('0xe1'):_0x463509[_0x781c('0x65')]=_0x781c('0xe2');break;case'sapricelists':_0x463509[_0x781c('0x65')]=_0x781c('0xe3');break;case _0x781c('0xe4'):_0x463509[_0x781c('0x65')]=_0x781c('0xe5');break;default:return _0x463509;}return _0x463509;} \ No newline at end of file +var _0xaaa1=['model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','limit','sort','where','pick','merge','map','type','key','VIRTUAL','filter','findAll','rows','catch','show','params','includeAll','include','options','find','create','clone','get','omit','updatedAt','crudPermissions','body','sequelize','UserProfileSection','each','autoAssociation','createdAt','Resources','UserProfileResource','addSections','transaction','sectionId','userProfileId','push','removeSections','ids','removeResources','getResources','section','undefined','Sequelize','ValidationError','Unknown\x20section','mergeResources','childModel','isEmpty','parentSections','findOne','all','ignore','union','length','nolimit','order','field','AnalyticExtractedReport','foreignKey','associatedResources','forEach','reportType','default','reportId','DefaultReports','CustomReports','CmContact','Tag','Tags','color','tag','value','resourceId','toLowerCase','squareprojects','SquareProject','SquareOdbc','squarerecordings','SquareRecording','projectName','projects','JscriptyProject','contacts','Lists','ListId','lists','globalcustomfields','CmCustomField','ChatQueue','chatwebsites','ChatWebsite','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','voicemails','voicerecordings','VoiceRecording','User','role','Telephones','membername','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsaccounts','SmsAccount','teams','Team','voicequeues','users','agents','telephones','Users','user','Agents','zendeskaccounts','salesforceaccounts','SalesforceAccount','sugarcrmaccounts','zohoaccounts','ZohoAccount','dispositions','Disposition','customdashboards','Dashboard','pauses','Pause','Schedule','Sound','tags','templates','triggers','Trigger','trunks','Trunk','variables','Variable','extractedreports','Reports','metrics','AnalyticMetric','saproducts','SAProduct','sapricelists','SAPriceList','paymentmethod','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','register','sendStatus','status','end','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','UserProfile','rawAttributes'];(function(_0x2bcd9e,_0x1bef3a){var _0xc3ccf4=function(_0x3d6eb7){while(--_0x3d6eb7){_0x2bcd9e['push'](_0x2bcd9e['shift']());}};_0xc3ccf4(++_0x1bef3a);}(_0xaaa1,0x193));var _0x1aaa=function(_0x24da2d,_0x175d10){_0x24da2d=_0x24da2d-0x0;var _0x4721be=_0xaaa1[_0x24da2d];return _0x4721be;};'use strict';var pdf=require(_0x1aaa('0x0'));var emlformat=require(_0x1aaa('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x1aaa('0x2'));var jsonpatch=require(_0x1aaa('0x3'));var rp=require(_0x1aaa('0x4'));var moment=require(_0x1aaa('0x5'));var BPromise=require(_0x1aaa('0x6'));var Mustache=require(_0x1aaa('0x7'));var util=require(_0x1aaa('0x8'));var path=require('path');var sox=require(_0x1aaa('0x9'));var csv=require(_0x1aaa('0xa'));var ejs=require(_0x1aaa('0xb'));var fs=require('fs');var _=require(_0x1aaa('0xc'));var squel=require(_0x1aaa('0xd'));var crypto=require(_0x1aaa('0xe'));var jsforce=require(_0x1aaa('0xf'));var deskjs=require(_0x1aaa('0x10'));var toCsv=require(_0x1aaa('0xa'));var querystring=require(_0x1aaa('0x11'));var Papa=require('papaparse');var Redis=require(_0x1aaa('0x12'));var authService=require(_0x1aaa('0x13'));var qs=require(_0x1aaa('0x14'));var hardwareService=require(_0x1aaa('0x15'));var logger=require(_0x1aaa('0x16'))(_0x1aaa('0x17'));var utils=require('../../config/utils');var config=require(_0x1aaa('0x18'));var db=require(_0x1aaa('0x19'))['db'];config[_0x1aaa('0x1a')]=_[_0x1aaa('0x1b')](config[_0x1aaa('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./userProfile.socket')[_0x1aaa('0x1c')](socket);function respondWithStatusCode(_0x1b6489,_0x55c0b0){_0x55c0b0=_0x55c0b0||0xcc;return function(_0x35b081){if(_0x35b081){return _0x1b6489[_0x1aaa('0x1d')](_0x55c0b0);}return _0x1b6489[_0x1aaa('0x1e')](_0x55c0b0)[_0x1aaa('0x1f')]();};}function respondWithResult(_0x5b8380,_0x135669){_0x135669=_0x135669||0xc8;return function(_0x48afc8){if(_0x48afc8){return _0x5b8380['status'](_0x135669)['json'](_0x48afc8);}};}function respondWithFilteredResult(_0x23f7d0,_0x3fe952){return function(_0x4ebd7e){if(_0x4ebd7e){var _0x22aa9a=_0x4ebd7e[_0x1aaa('0x20')],_0x3aff6d=_0x3fe952['offset'],_0x1d1d1e=_0x3fe952[_0x1aaa('0x21')]+_0x3fe952['limit'],_0x211fef;if(_0x1d1d1e>=_0x22aa9a){_0x1d1d1e=_0x22aa9a;_0x211fef=0xc8;}else{_0x211fef=0xce;}_0x23f7d0['status'](_0x211fef);return _0x23f7d0['set'](_0x1aaa('0x22'),_0x3aff6d+'-'+_0x1d1d1e+'/'+_0x22aa9a)[_0x1aaa('0x23')](_0x4ebd7e);}return null;};}function patchUpdates(_0x3323a8){return function(_0x47e329){try{jsonpatch[_0x1aaa('0x24')](_0x47e329,_0x3323a8,!![]);}catch(_0x5e170d){return BPromise[_0x1aaa('0x25')](_0x5e170d);}return _0x47e329[_0x1aaa('0x26')]();};}function saveUpdates(_0x10dc92,_0x55a1ed){return function(_0x399811){if(_0x399811){return _0x399811[_0x1aaa('0x27')](_0x10dc92)[_0x1aaa('0x28')](function(_0x2112b1){return _0x2112b1;});}return null;};}function removeEntity(_0x5d65fa,_0x385045){return function(_0x45e3d3){if(_0x45e3d3){return _0x45e3d3[_0x1aaa('0x29')]()['then'](function(){_0x5d65fa[_0x1aaa('0x1e')](0xcc)[_0x1aaa('0x1f')]();});}};}function handleEntityNotFound(_0x8c383d,_0x488da7){return function(_0x11269a){if(!_0x11269a){_0x8c383d[_0x1aaa('0x1d')](0x194);}return _0x11269a;};}function handleError(_0x3f9944,_0x6596aa){_0x6596aa=_0x6596aa||0x1f4;return function(_0x1dd3d0){logger['error'](_0x1dd3d0[_0x1aaa('0x2a')]);if(_0x1dd3d0[_0x1aaa('0x2b')]){delete _0x1dd3d0[_0x1aaa('0x2b')];}_0x3f9944[_0x1aaa('0x1e')](_0x6596aa)[_0x1aaa('0x2c')](_0x1dd3d0);};}exports['index']=function(_0x4ccb53,_0x121072){var _0x1325cd={},_0x2aa663={},_0x533d51={'count':0x0,'rows':[]};var _0x5c9de6=db[_0x1aaa('0x2d')][_0x1aaa('0x2e')];_0x2aa663[_0x1aaa('0x2f')]=_[_0x1aaa('0x30')](_0x5c9de6);_0x2aa663[_0x1aaa('0x31')]=_['keys'](_0x4ccb53[_0x1aaa('0x31')]);_0x2aa663[_0x1aaa('0x32')]=_[_0x1aaa('0x33')](_0x2aa663[_0x1aaa('0x2f')],_0x2aa663[_0x1aaa('0x31')]);_0x1325cd[_0x1aaa('0x34')]=_['intersection'](_0x2aa663[_0x1aaa('0x2f')],qs[_0x1aaa('0x35')](_0x4ccb53['query'][_0x1aaa('0x35')]));_0x1325cd[_0x1aaa('0x34')]=_0x1325cd[_0x1aaa('0x34')]['length']?_0x1325cd[_0x1aaa('0x34')]:_0x2aa663['model'];if(!_0x4ccb53['query'][_0x1aaa('0x36')]('nolimit')){_0x1325cd[_0x1aaa('0x37')]=qs['limit'](_0x4ccb53['query'][_0x1aaa('0x37')]);_0x1325cd[_0x1aaa('0x21')]=qs[_0x1aaa('0x21')](_0x4ccb53[_0x1aaa('0x31')][_0x1aaa('0x21')]);}_0x1325cd['order']=qs[_0x1aaa('0x38')](_0x4ccb53[_0x1aaa('0x31')][_0x1aaa('0x38')]);_0x1325cd[_0x1aaa('0x39')]=qs[_0x1aaa('0x32')](_[_0x1aaa('0x3a')](_0x4ccb53[_0x1aaa('0x31')],_0x2aa663[_0x1aaa('0x32')]));if(_0x4ccb53[_0x1aaa('0x31')]['filter']){_0x1325cd[_0x1aaa('0x39')]=_[_0x1aaa('0x3b')](_0x1325cd['where'],{'$or':_[_0x1aaa('0x3c')](_0x5c9de6,function(_0x2e0950){if(_0x2e0950[_0x1aaa('0x3d')][_0x1aaa('0x3e')]!==_0x1aaa('0x3f')){var _0x5c78cc={};_0x5c78cc[_0x2e0950['field']]={'$like':'%'+_0x4ccb53[_0x1aaa('0x31')][_0x1aaa('0x40')]+'%'};return _0x5c78cc;}})});}_0x1325cd=_[_0x1aaa('0x3b')]({},_0x1325cd,_0x4ccb53['options']);var _0x465dbd={'where':_0x1325cd[_0x1aaa('0x39')]};return db[_0x1aaa('0x2d')][_0x1aaa('0x20')](_0x465dbd)[_0x1aaa('0x28')](function(_0x3fa290){_0x533d51[_0x1aaa('0x20')]=_0x3fa290;if(_0x4ccb53[_0x1aaa('0x31')]['includeAll']){_0x1325cd['include']=[{'all':!![]}];}return db['UserProfile'][_0x1aaa('0x41')](_0x1325cd);})[_0x1aaa('0x28')](function(_0x1a9d12){_0x533d51[_0x1aaa('0x42')]=_0x1a9d12;return _0x533d51;})[_0x1aaa('0x28')](respondWithFilteredResult(_0x121072,_0x1325cd))[_0x1aaa('0x43')](handleError(_0x121072,null));};exports[_0x1aaa('0x44')]=function(_0x51c3cc,_0x347f31){var _0x5a5ed9={'raw':![],'where':{'id':_0x51c3cc[_0x1aaa('0x45')]['id']}},_0x553417={};_0x553417[_0x1aaa('0x2f')]=_[_0x1aaa('0x30')](db['UserProfile'][_0x1aaa('0x2e')]);_0x553417['query']=_[_0x1aaa('0x30')](_0x51c3cc[_0x1aaa('0x31')]);_0x553417[_0x1aaa('0x32')]=_[_0x1aaa('0x33')](_0x553417['model'],_0x553417[_0x1aaa('0x31')]);_0x5a5ed9[_0x1aaa('0x34')]=_[_0x1aaa('0x33')](_0x553417[_0x1aaa('0x2f')],qs[_0x1aaa('0x35')](_0x51c3cc[_0x1aaa('0x31')][_0x1aaa('0x35')]));_0x5a5ed9[_0x1aaa('0x34')]=_0x5a5ed9['attributes']['length']?_0x5a5ed9['attributes']:_0x553417['model'];if(_0x51c3cc[_0x1aaa('0x31')][_0x1aaa('0x46')]){_0x5a5ed9[_0x1aaa('0x47')]=[{'all':!![]}];}_0x5a5ed9=_[_0x1aaa('0x3b')]({},_0x5a5ed9,_0x51c3cc[_0x1aaa('0x48')]);return db[_0x1aaa('0x2d')][_0x1aaa('0x49')](_0x5a5ed9)[_0x1aaa('0x28')](handleEntityNotFound(_0x347f31,null))[_0x1aaa('0x28')](respondWithResult(_0x347f31,null))[_0x1aaa('0x43')](handleError(_0x347f31,null));};exports['create']=function(_0x4e0fd9,_0x50c06b){return db[_0x1aaa('0x2d')][_0x1aaa('0x4a')](_0x4e0fd9['body'],{})[_0x1aaa('0x28')](respondWithResult(_0x50c06b,0xc9))[_0x1aaa('0x43')](handleError(_0x50c06b,null));};exports[_0x1aaa('0x4b')]=function(_0x21be60,_0x2c1caa){var _0x24e5a8={'raw':![],'where':{'id':_0x21be60[_0x1aaa('0x45')]['id']}},_0x57a36a={};_0x57a36a['model']=_[_0x1aaa('0x30')](db[_0x1aaa('0x2d')]['rawAttributes']);_0x24e5a8['attributes']=_[_0x1aaa('0x33')](_0x57a36a['model'],qs[_0x1aaa('0x35')](_0x21be60['query'][_0x1aaa('0x35')]));_0x24e5a8[_0x1aaa('0x34')]=_0x24e5a8[_0x1aaa('0x34')]['length']?_0x24e5a8['attributes']:_0x57a36a[_0x1aaa('0x2f')];if(_0x21be60['query'][_0x1aaa('0x46')]){_0x24e5a8['include']=[{'all':!![]}];}_0x24e5a8=_[_0x1aaa('0x3b')]({},_0x24e5a8,_0x21be60[_0x1aaa('0x48')]);return db[_0x1aaa('0x2d')][_0x1aaa('0x49')](_0x24e5a8)[_0x1aaa('0x28')](handleEntityNotFound(_0x2c1caa,null))[_0x1aaa('0x28')](function(_0x698ccd){if(_0x698ccd){var _0x220826=_0x698ccd[_0x1aaa('0x4c')]({'plain':!![]});_0x220826=qs[_0x1aaa('0x4d')](_0x220826,['id','createdAt',_0x1aaa('0x4e'),_0x1aaa('0x4f')]);_0x21be60[_0x1aaa('0x50')]=_[_0x1aaa('0x4d')](_0x21be60[_0x1aaa('0x50')],['id','createdAt',_0x1aaa('0x4e')]);return db[_0x1aaa('0x51')]['transaction'](function(_0x314a98){return db[_0x1aaa('0x2d')][_0x1aaa('0x4a')](_[_0x1aaa('0x3b')](_0x220826,_0x21be60[_0x1aaa('0x50')]),{'include':_0x21be60[_0x1aaa('0x31')][_0x1aaa('0x46')]?[{'all':!![]}]:undefined,'transaction':_0x314a98})['then'](function(_0x55de){var _0x3f2a6c=_0x55de[_0x1aaa('0x4c')]({'plain':!![]});return db[_0x1aaa('0x52')][_0x1aaa('0x41')]({'where':{'userProfileId':_0x21be60[_0x1aaa('0x45')]['id']},'raw':!![]})[_0x1aaa('0x28')](function(_0x48321e){if(_0x48321e){return BPromise[_0x1aaa('0x53')](_0x48321e,function(_0xa37d0e){return new BPromise(function(_0x1148fa,_0x247fec){if(_0xa37d0e[_0x1aaa('0x54')]===null||_0xa37d0e[_0x1aaa('0x54')]===0x1)_0x1148fa(null);return db['UserProfileResource'][_0x1aaa('0x41')]({'where':{'sectionId':_0xa37d0e['id']},'raw':!![]})[_0x1aaa('0x28')](function(_0x1fab4e){var _0x162a61=_[_0x1aaa('0x3c')](_0x1fab4e,function(_0x1417f9){return qs['omit'](_0x1417f9,['id',_0x1aaa('0x55'),_0x1aaa('0x4e'),'sectionId']);});_0x1148fa(_0x162a61);})[_0x1aaa('0x43')](function(_0x36805b){_0x247fec(_0x36805b);});})[_0x1aaa('0x28')](function(_0x1032a1){var _0x58744c=qs[_0x1aaa('0x4d')](_0xa37d0e,['id',_0x1aaa('0x55'),'updatedAt']);_0x58744c['userProfileId']=_0x3f2a6c['id'];if(_0x1032a1)_0x58744c[_0x1aaa('0x56')]=_0x1032a1;return _0x58744c;})[_0x1aaa('0x28')](function(_0x42ba43){return db[_0x1aaa('0x52')][_0x1aaa('0x4a')](_0x42ba43,{'include':[{'model':db[_0x1aaa('0x57')],'as':_0x1aaa('0x56')}],'raw':!![],'transaction':_0x314a98});});})[_0x1aaa('0x28')](function(){return _0x3f2a6c;});}});});});}})[_0x1aaa('0x28')](respondWithResult(_0x2c1caa,0xc9))['catch'](handleError(_0x2c1caa,null));};exports['update']=function(_0x2d2945,_0x51bcad){if(_0x2d2945[_0x1aaa('0x50')]['id']){delete _0x2d2945[_0x1aaa('0x50')]['id'];}return db['UserProfile'][_0x1aaa('0x49')]({'where':{'id':_0x2d2945[_0x1aaa('0x45')]['id']}})[_0x1aaa('0x28')](handleEntityNotFound(_0x51bcad,null))[_0x1aaa('0x28')](saveUpdates(_0x2d2945[_0x1aaa('0x50')],null))['then'](respondWithResult(_0x51bcad,null))[_0x1aaa('0x43')](handleError(_0x51bcad,null));};exports[_0x1aaa('0x29')]=function(_0xc888b7,_0x3e8ff9){return db['UserProfile'][_0x1aaa('0x49')]({'where':{'id':_0xc888b7[_0x1aaa('0x45')]['id']}})[_0x1aaa('0x28')](handleEntityNotFound(_0x3e8ff9,null))[_0x1aaa('0x28')](removeEntity(_0x3e8ff9,null))[_0x1aaa('0x43')](handleError(_0x3e8ff9,null));};exports['describe']=function(_0x1a97bc,_0x398f44){return db[_0x1aaa('0x2d')]['describe']()[_0x1aaa('0x28')](respondWithResult(_0x398f44,null))[_0x1aaa('0x43')](handleError(_0x398f44,null));};exports[_0x1aaa('0x58')]=function(_0x13f5b3,_0x5f1ca0){var _0x4d1db5=_0x13f5b3[_0x1aaa('0x50')];return db[_0x1aaa('0x2d')]['find']({'where':{'id':_0x13f5b3['params']['id']}})['then'](handleEntityNotFound(_0x5f1ca0,null))[_0x1aaa('0x28')](function(_0x342f1a){if(_0x342f1a){return db[_0x1aaa('0x51')][_0x1aaa('0x59')](function(_0xda33b4){return db[_0x1aaa('0x52')][_0x1aaa('0x29')]({'where':{'userProfileId':_0x13f5b3['params']['id'],'sectionId':_[_0x1aaa('0x3c')](_0x4d1db5,function(_0x597162){return _0x597162[_0x1aaa('0x5a')];})},'transaction':_0xda33b4})[_0x1aaa('0x28')](function(){var _0x56a5c3=_['map'](_0x4d1db5,function(_0x107418){_0x107418[_0x1aaa('0x5b')]=_0x13f5b3[_0x1aaa('0x45')]['id'];return _0x107418;});var _0x4f5880=[];return BPromise['each'](_0x56a5c3,function(_0x16084a){return db[_0x1aaa('0x52')]['create'](_0x16084a,{'include':[{'model':db[_0x1aaa('0x57')],'as':_0x1aaa('0x56')}],'raw':!![],'transaction':_0xda33b4})[_0x1aaa('0x28')](function(_0x4cd2d4){_0x4f5880[_0x1aaa('0x5c')](_0x4cd2d4[_0x1aaa('0x4c')]({'plain':!![]}));});})['then'](function(){return _0x4f5880;});});});}})[_0x1aaa('0x28')](function(_0x3cc6ec){return _0x3cc6ec;})[_0x1aaa('0x28')](respondWithResult(_0x5f1ca0,null))['catch'](handleError(_0x5f1ca0,null));};exports[_0x1aaa('0x5d')]=function(_0x6d5dbe,_0x43eeb3){var _0x244a5e;return db[_0x1aaa('0x2d')]['find']({'where':{'id':_0x6d5dbe[_0x1aaa('0x45')]['id']},'attributes':['id',_0x1aaa('0x2b')]})[_0x1aaa('0x28')](handleEntityNotFound(_0x43eeb3,null))['then'](function(_0x4a0116){if(_0x4a0116){_0x244a5e=_0x4a0116;return db['UserProfileSection'][_0x1aaa('0x29')]({'where':{'userProfileId':_0x6d5dbe[_0x1aaa('0x45')]['id'],'sectionId':_0x6d5dbe['query'][_0x1aaa('0x5e')]}});}})[_0x1aaa('0x28')](function(){return _0x244a5e;})[_0x1aaa('0x28')](respondWithStatusCode(_0x43eeb3,null))[_0x1aaa('0x43')](handleError(_0x43eeb3,null));};exports['addResources']=function(_0x674c00,_0x45eea9){return db['UserProfile'][_0x1aaa('0x49')]({'where':{'id':_0x674c00[_0x1aaa('0x45')]['id']}})[_0x1aaa('0x28')](handleEntityNotFound(_0x45eea9,null))[_0x1aaa('0x28')](function(_0x456000){if(_0x456000){return db[_0x1aaa('0x51')][_0x1aaa('0x59')](function(_0x17cfcb){return db[_0x1aaa('0x52')]['findAll']({'where':{'userProfileId':_0x674c00['params']['id']},'attributes':['id'],'raw':!![]})[_0x1aaa('0x28')](function(_0x37cbd3){if(_0x37cbd3){return db[_0x1aaa('0x52')][_0x1aaa('0x29')]({'where':{'userProfileId':_0x674c00[_0x1aaa('0x45')]['id'],'id':_[_0x1aaa('0x3c')](_0x37cbd3,function(_0x4d78a8){return _0x4d78a8['id'];})},'transaction':_0x17cfcb});}})[_0x1aaa('0x28')](function(_0x2f24c0){var _0x1064c6=_['map'](_0x674c00[_0x1aaa('0x50')],function(_0xb1fd14){_0xb1fd14['userProfileId']=_0x674c00[_0x1aaa('0x45')]['id'];return _0xb1fd14;});return db[_0x1aaa('0x52')]['bulkCreate'](_0x1064c6,{'raw':!![],'transaction':_0x17cfcb});})['then'](function(_0x53db52){var _0xc70638=_['filter'](_[_0x1aaa('0x3c')](_0x53db52,function(_0x3d3fcc){return _0x3d3fcc[_0x1aaa('0x4c')]({'plain':!![]});}),{'includeAll':![]});if(_0xc70638){return db[_0x1aaa('0x52')]['findAll']({'where':{'userProfileId':_0x674c00[_0x1aaa('0x45')]['id'],'sectionId':_[_0x1aaa('0x3c')](_0xc70638,function(_0xbf57cf){return _0xbf57cf['sectionId'];})},'attributes':['id',_0x1aaa('0x5a')],'raw':!![]})[_0x1aaa('0x28')](function(_0x579f08){var _0x4bc194=_[_0x1aaa('0x3c')](_0x674c00[_0x1aaa('0x50')],function(_0x1df44a){_0x1df44a[_0x1aaa('0x5b')]=_0x674c00[_0x1aaa('0x45')]['id'];return _0x1df44a;});return db[_0x1aaa('0x57')]['bulkCreate'](_0x4bc194,{'raw':!![],'transaction':_0x17cfcb});});}})[_0x1aaa('0x43')](handleError(_0x45eea9,null));});}})[_0x1aaa('0x28')](function(_0xf513d2){var _0x10c4e4=_[_0x1aaa('0x3c')](_0xf513d2,function(_0x466868){return _0x466868[_0x1aaa('0x4c')]({'plain':!![]});});})[_0x1aaa('0x28')](respondWithResult(_0x45eea9,null))[_0x1aaa('0x43')](handleError(_0x45eea9,null));};exports[_0x1aaa('0x5f')]=function(_0x49c64a,_0x509113,_0x5d034c){return db[_0x1aaa('0x2d')][_0x1aaa('0x49')]({'where':{'id':_0x49c64a[_0x1aaa('0x45')]['id']}})[_0x1aaa('0x28')](handleEntityNotFound(_0x509113,null))['then'](function(_0x19c57e){if(_0x19c57e){return _0x19c57e['removeResources'](_0x49c64a[_0x1aaa('0x31')][_0x1aaa('0x5e')]);}})[_0x1aaa('0x28')](respondWithStatusCode(_0x509113,null))[_0x1aaa('0x43')](handleError(_0x509113,null));};exports[_0x1aaa('0x60')]=function(_0x46e23d,_0x159af0){var _0x3ff982={'raw':![],'where':{}};var _0x4ab180={};var _0x2acf0a={'count':0x0,'rows':[]};var _0x83e16f=_0x46e23d['query'][_0x1aaa('0x61')];if(typeof _0x83e16f===_0x1aaa('0x62')){throw new db[(_0x1aaa('0x63'))][(_0x1aaa('0x64'))](_0x1aaa('0x65'));}var _0x39bb6b=_0x46e23d[_0x1aaa('0x31')][_0x1aaa('0x66')]||![];var _0x3cad1e=getQueryModels(_0x83e16f,_0x39bb6b);if(typeof _0x3cad1e[_0x1aaa('0x67')]==='undefined'){throw new db[(_0x1aaa('0x63'))][(_0x1aaa('0x64'))]('Invalid\x20section\x20\x27'+_0x83e16f+'\x27');}var _0x557c1a=[];if(!_[_0x1aaa('0x68')](_0x3cad1e[_0x1aaa('0x69')])){_0x557c1a=_0x3cad1e[_0x1aaa('0x69')];}else{_0x557c1a=[{'name':_0x83e16f}];}return db[_0x1aaa('0x2d')][_0x1aaa('0x6a')]({'where':{'id':_0x46e23d[_0x1aaa('0x45')]['id']}})[_0x1aaa('0x28')](handleEntityNotFound(_0x159af0,null))[_0x1aaa('0x28')](function(_0x4c512c){if(_0x4c512c){var _0x269aae=[];for(var _0x29c4a0=0x0;_0x29c4a0<_0x557c1a['length'];_0x29c4a0++){_0x269aae[_0x1aaa('0x5c')](db['UserProfileSection']['findOne']({'where':{'userProfileId':_0x4c512c['id'],'name':_0x557c1a[_0x29c4a0][_0x1aaa('0x2b')]},'raw':!![]}));}return BPromise[_0x1aaa('0x6b')](_0x269aae);}})['then'](function(_0x24f800){var _0x250a77=_['filter'](_0x24f800,function(_0x5a24a2){return _0x5a24a2?_0x5a24a2:undefined;});var _0x17c469=_[_0x1aaa('0x40')](_0x557c1a,[_0x1aaa('0x6c'),!![]]);var _0x384063=_[_0x1aaa('0x68')](_0x250a77)&&_[_0x1aaa('0x68')](_0x17c469)?null:_[_0x1aaa('0x6d')](_0x17c469,_0x250a77);if(_0x384063){var _0x30096e=[];for(var _0x25169d=0x0;_0x25169d<_0x384063[_0x1aaa('0x6e')];_0x25169d++){var _0x238932=_[_0x1aaa('0x49')](_0x557c1a,function(_0x5445bc){return _0x384063[_0x25169d]?_0x5445bc[_0x1aaa('0x2b')]===_0x384063[_0x25169d][_0x1aaa('0x2b')]:null;});if(_0x238932){if(_0x384063[_0x25169d][_0x1aaa('0x6c')]){_0x30096e[_0x1aaa('0x5c')](getAllResources(_0x3cad1e[_0x1aaa('0x67')],_0x384063[_0x25169d]));}else{if(!_0x384063[_0x25169d]['autoAssociation']){_0x30096e['push'](getAllowedResources(_0x238932,_0x384063[_0x25169d],_0x3cad1e[_0x1aaa('0x67')]));}else{if(_0x238932['model']){_0x30096e['push'](getAllFilteredResources(_0x238932,_0x384063[_0x25169d]));}}}}}return BPromise['all'](_0x30096e);}else{return null;}})[_0x1aaa('0x28')](function(_0x30da2e){var _0x3179f1=_0x30da2e;var _0x4e7dab=null;if(_0x3179f1){_0x4e7dab=_0x3179f1[_0x1aaa('0x6e')]===0x1?_0x3179f1[0x0]:null;}if(_0x4e7dab||_0x3179f1){var _0x8bad61=db[_0x3cad1e[_0x1aaa('0x67')]][_0x1aaa('0x2e')];_0x4ab180['model']=_[_0x1aaa('0x30')](_0x8bad61);_0x4ab180[_0x1aaa('0x31')]=_[_0x1aaa('0x30')](_0x46e23d[_0x1aaa('0x31')]);_0x4ab180[_0x1aaa('0x32')]=_[_0x1aaa('0x33')](_0x4ab180['model'],_0x4ab180['query']);_0x3ff982[_0x1aaa('0x34')]=_[_0x1aaa('0x33')](_0x4ab180[_0x1aaa('0x2f')],qs[_0x1aaa('0x35')](_0x46e23d[_0x1aaa('0x31')][_0x1aaa('0x35')]));_0x3ff982[_0x1aaa('0x34')]=_0x3ff982[_0x1aaa('0x34')][_0x1aaa('0x6e')]?_0x3ff982['attributes']:_0x4ab180['model'];if(!_0x46e23d[_0x1aaa('0x31')][_0x1aaa('0x36')](_0x1aaa('0x6f'))){_0x3ff982['limit']=qs['limit'](_0x46e23d['query'][_0x1aaa('0x37')]);_0x3ff982[_0x1aaa('0x21')]=qs[_0x1aaa('0x21')](_0x46e23d['query'][_0x1aaa('0x21')]);}_0x3ff982[_0x1aaa('0x70')]=qs[_0x1aaa('0x38')](_0x46e23d[_0x1aaa('0x31')]['sort']);_0x3ff982[_0x1aaa('0x39')]=qs[_0x1aaa('0x32')](_[_0x1aaa('0x3a')](_0x46e23d[_0x1aaa('0x31')],_0x4ab180[_0x1aaa('0x32')]));if(_0x46e23d[_0x1aaa('0x31')]['filter']){_0x3ff982['where']=_['merge'](_0x3ff982[_0x1aaa('0x39')],{'$or':_['map'](_0x8bad61,function(_0x3d9933){if(_0x3d9933['type'][_0x1aaa('0x3e')]!==_0x1aaa('0x3f')){var _0x5954ca={};_0x5954ca[_0x3d9933[_0x1aaa('0x71')]]={'$like':'%'+_0x46e23d[_0x1aaa('0x31')][_0x1aaa('0x40')]+'%'};return _0x5954ca;}})});}var _0xdd1e02=[];if(_0x4e7dab){var _0x531fdd=_[_0x1aaa('0x49')](_0x557c1a,[_0x1aaa('0x2b'),_0x4e7dab['name']]);if(_0x531fdd[_0x1aaa('0x71')]){var _0x537d13={};if(_0x3cad1e[_0x1aaa('0x67')]===_0x1aaa('0x72')){_0x537d13[_0x531fdd[_0x1aaa('0x73')]]=_[_0x1aaa('0x3c')](_0x4e7dab[_0x1aaa('0x74')],'id');}else{_0x537d13[_0x531fdd['foreignKey']]=_0x4e7dab[_0x1aaa('0x74')];}_0xdd1e02[_0x1aaa('0x5c')](_0x537d13);}else{_0x3ff982['where']['id']=_0x4e7dab[_0x1aaa('0x74')];}}else{for(var _0x435d13=0x0;_0x435d13<_0x3179f1['length'];_0x435d13++){var _0x531fdd=_[_0x1aaa('0x49')](_0x557c1a,[_0x1aaa('0x2b'),_0x3179f1[_0x435d13]['name']]);if(_0x531fdd[_0x1aaa('0x71')]){var _0x537d13={};_0x537d13[_0x531fdd['foreignKey']]=_0x3179f1[_0x435d13][_0x1aaa('0x74')];_0xdd1e02['push'](_0x537d13);}else{if(!_0x3ff982[_0x1aaa('0x39')]['id'])_0x3ff982[_0x1aaa('0x39')]['id']=[];_0x3179f1[_0x435d13]['associatedResources']['forEach'](function(_0x814240){_0x3ff982[_0x1aaa('0x39')]['id'][_0x1aaa('0x5c')](_0x814240);});}}}if(!_['isEmpty'](_0xdd1e02)){_0x3ff982[_0x1aaa('0x39')]=_['merge'](_0x3ff982['where'],{'$and':{'$or':_0xdd1e02}});}_0x3ff982=_[_0x1aaa('0x3b')]({},_0x3ff982,_0x46e23d[_0x1aaa('0x48')]);if(_0x4e7dab&&!_0x4e7dab[_0x1aaa('0x54')]&&_0x3cad1e['childModel']===_0x1aaa('0x72')){if(_0x46e23d['query'][_0x1aaa('0x46')]){_0x3ff982[_0x1aaa('0x47')]=[{'all':!![]}];}return db[_0x3cad1e[_0x1aaa('0x67')]][_0x1aaa('0x41')](_0x3ff982)[_0x1aaa('0x28')](function(_0x2ffd9f){var _0x3f9d83=[];_0x2ffd9f[_0x1aaa('0x75')](function(_0x3ae1e6){var _0x32f886;switch(_0x3ae1e6[_0x1aaa('0x76')]){case _0x1aaa('0x77'):_0x32f886=_[_0x1aaa('0x49')](_0x4e7dab[_0x1aaa('0x74')],function(_0x240f5c){return _0x240f5c['id']===_0x3ae1e6[_0x1aaa('0x78')]&&_0x240f5c['type']===_0x1aaa('0x79');});break;case'custom':_0x32f886=_[_0x1aaa('0x49')](_0x4e7dab['associatedResources'],function(_0x4f51f4){return _0x4f51f4['id']===_0x3ae1e6[_0x1aaa('0x78')]&&_0x4f51f4[_0x1aaa('0x3d')]===_0x1aaa('0x7a');});break;}if(_0x32f886)_0x3f9d83[_0x1aaa('0x5c')](_0x3ae1e6);});_0x2acf0a[_0x1aaa('0x20')]=_0x3f9d83[_0x1aaa('0x6e')];_0x2acf0a[_0x1aaa('0x42')]=_0x3f9d83;return _0x2acf0a;});}else{return db[_0x3cad1e[_0x1aaa('0x67')]][_0x1aaa('0x20')]({'where':_0x3ff982[_0x1aaa('0x39')]})[_0x1aaa('0x28')](function(_0x3ba169){_0x2acf0a[_0x1aaa('0x20')]=_0x3ba169;if(_0x46e23d[_0x1aaa('0x31')]['includeAll']){if(_0x3cad1e[_0x1aaa('0x67')]===_0x1aaa('0x7b')){_0x3ff982['include']=[{'model':db[_0x1aaa('0x7c')],'as':_0x1aaa('0x7d'),'attributes':['id',_0x1aaa('0x2b'),_0x1aaa('0x7e')],'required':_0x46e23d[_0x1aaa('0x31')]['tag']?!![]:![]},{'model':db[_0x1aaa('0x7c')],'as':'ThroughTags','attributes':['id',_0x1aaa('0x2b'),_0x1aaa('0x7e')],'through':_0x46e23d[_0x1aaa('0x31')]['tag']?{'attributes':[],'where':{'TagId':_0x46e23d['query'][_0x1aaa('0x7f')]||undefined}}:{},'required':_0x46e23d[_0x1aaa('0x31')]['tag']?!![]:![]}];}else{_0x3ff982['include']=[{'all':!![]}];}}return db[_0x3cad1e[_0x1aaa('0x67')]][_0x1aaa('0x41')](_0x3ff982);})[_0x1aaa('0x28')](function(_0x75fb53){_0x2acf0a[_0x1aaa('0x42')]=_0x75fb53;return _0x2acf0a;});}}else{return _0x2acf0a;}})[_0x1aaa('0x28')](respondWithFilteredResult(_0x159af0,_0x3ff982))[_0x1aaa('0x43')](handleError(_0x159af0,null));};function getAllResources(_0x1c059b,_0x49ebe5){return new BPromise(function(_0x231550,_0x3ab5f2){if(_0x49ebe5){var _0x2e6d2f=_0x49ebe5[_0x1aaa('0x40')]?{[_0x49ebe5[_0x1aaa('0x40')][_0x1aaa('0x71')]]:_0x49ebe5[_0x1aaa('0x40')][_0x1aaa('0x80')]}:undefined;return db[_0x1c059b][_0x1aaa('0x41')]({'where':_0x2e6d2f,'raw':!![]})['then'](function(_0x19017c){_0x49ebe5[_0x1aaa('0x74')]=_['map'](_0x19017c,'id');_0x231550(_0x49ebe5);})[_0x1aaa('0x43')](function(_0x5b390f){_0x3ab5f2(_0x5b390f);});}else{_0x231550(null);}});}function getAllFilteredResources(_0x263e3b,_0x1b4a51){return new BPromise(function(_0x1108b8,_0x143f2c){var _0x5d5525=_0x263e3b['filter']?{[_0x263e3b['filter'][_0x1aaa('0x71')]]:_0x263e3b[_0x1aaa('0x40')][_0x1aaa('0x80')]}:undefined;return db[_0x263e3b[_0x1aaa('0x2f')]][_0x1aaa('0x41')]({'where':_0x5d5525,'raw':!![]})['then'](function(_0x4401b9){_0x1b4a51[_0x1aaa('0x74')]=_[_0x1aaa('0x3c')](_0x4401b9,function(_0x1e6d86){return _0x1e6d86[_0x1aaa('0x2b')];});_0x1108b8(_0x1b4a51);})[_0x1aaa('0x43')](function(_0x4cf807){_0x143f2c(_0x4cf807);});});}function getAllowedResources(_0x38f6a4,_0x4472c6,_0xfb5f70){return new BPromise(function(_0x37ae2d,_0x14f946){if(_0x4472c6){return db[_0x1aaa('0x57')]['findAll']({'where':{'sectionId':_0x4472c6['id']},'raw':!![]})[_0x1aaa('0x28')](function(_0x265446){if(_0x38f6a4[_0x1aaa('0x71')]&&_0x38f6a4[_0x1aaa('0x71')]!=='id'){_0x4472c6[_0x1aaa('0x74')]=_['map'](_0x265446,function(_0x3c1ede){return _0x3c1ede[_0x38f6a4[_0x1aaa('0x71')]];});}else{if(_0xfb5f70==='AnalyticExtractedReport'){_0x4472c6['associatedResources']=_[_0x1aaa('0x3c')](_0x265446,function(_0xfd4e81){return{'id':_0xfd4e81[_0x1aaa('0x81')],'type':_0xfd4e81['type']};});}else{_0x4472c6[_0x1aaa('0x74')]=_['map'](_0x265446,function(_0x1b164b){return _0x1b164b[_0x1aaa('0x81')];});}}_0x37ae2d(_0x4472c6);})[_0x1aaa('0x43')](function(_0x5f5bbc){_0x14f946(_0x5f5bbc);});}else{_0x37ae2d(null);}});}function getQueryModels(_0xbfe36f,_0x5e6970){var _0x47ffd1=_0xbfe36f[_0x1aaa('0x82')]();var _0x33b67e={'childModel':undefined,'parentSections':[]};switch(_0x47ffd1){case _0x1aaa('0x83'):_0x33b67e[_0x1aaa('0x67')]=_0x1aaa('0x84');break;case'odbc':_0x33b67e['childModel']=_0x1aaa('0x85');break;case _0x1aaa('0x86'):_0x33b67e[_0x1aaa('0x67')]=_0x1aaa('0x87');_0x33b67e[_0x1aaa('0x69')]=[{'name':'SquareProjects','field':_0x1aaa('0x2b'),'foreignKey':_0x1aaa('0x88')}];break;case _0x1aaa('0x89'):_0x33b67e[_0x1aaa('0x67')]=_0x1aaa('0x8a');break;case _0x1aaa('0x8b'):_0x33b67e[_0x1aaa('0x67')]='CmContact';_0x33b67e[_0x1aaa('0x69')]=[{'name':_0x1aaa('0x8c'),'field':'id','foreignKey':_0x1aaa('0x8d')}];break;case _0x1aaa('0x8e'):_0x33b67e[_0x1aaa('0x67')]='CmList';break;case'companies':_0x33b67e[_0x1aaa('0x67')]='CmCompany';break;case _0x1aaa('0x8f'):_0x33b67e[_0x1aaa('0x67')]=_0x1aaa('0x90');break;case'chatqueues':_0x33b67e[_0x1aaa('0x67')]=_0x1aaa('0x91');break;case _0x1aaa('0x92'):_0x33b67e[_0x1aaa('0x67')]=_0x1aaa('0x93');break;case'faxqueues':_0x33b67e[_0x1aaa('0x67')]='FaxQueue';break;case _0x1aaa('0x94'):_0x33b67e['childModel']=_0x1aaa('0x95');break;case _0x1aaa('0x96'):case _0x1aaa('0x97'):case _0x1aaa('0x98'):_0x33b67e[_0x1aaa('0x67')]=_0x1aaa('0x99');break;case _0x1aaa('0x9a'):_0x33b67e[_0x1aaa('0x67')]='VoiceContext';break;case _0x1aaa('0x9b'):_0x33b67e[_0x1aaa('0x67')]='VoiceMail';break;case _0x1aaa('0x9c'):_0x33b67e[_0x1aaa('0x67')]=_0x1aaa('0x9d');_0x33b67e[_0x1aaa('0x69')]=[{'name':'Agents','field':_0x1aaa('0x2b'),'foreignKey':'membername','model':_0x1aaa('0x9e'),'filter':{'field':_0x1aaa('0x9f'),'value':['agent']}},{'name':_0x1aaa('0xa0'),'field':_0x1aaa('0x2b'),'foreignKey':_0x1aaa('0xa1'),'model':_0x1aaa('0x9e'),'filter':{'field':_0x1aaa('0x9f'),'value':[_0x1aaa('0xa2')]}},{'name':_0x1aaa('0xa3'),'field':'name','foreignKey':_0x1aaa('0xa4'),'model':_0x1aaa('0xa5'),'filter':{'field':'type','value':[_0x1aaa('0xa6')]}},{'name':_0x1aaa('0xa7'),'field':_0x1aaa('0x2b'),'foreignKey':_0x1aaa('0xa4'),'model':_0x1aaa('0xa5'),'filter':{'field':_0x1aaa('0x3d'),'value':[_0x1aaa('0xa8')]}}];break;case _0x1aaa('0xa9'):_0x33b67e[_0x1aaa('0x67')]=_0x1aaa('0xaa');break;case'chanspies':_0x33b67e[_0x1aaa('0x67')]='VoiceChanSpy';break;case _0x1aaa('0xab'):_0x33b67e[_0x1aaa('0x67')]=_0x1aaa('0xac');break;case _0x1aaa('0xad'):_0x33b67e[_0x1aaa('0x67')]=_0x1aaa('0xae');break;case _0x1aaa('0xaf'):_0x33b67e['childModel']='MailQueue';break;case _0x1aaa('0xb0'):_0x33b67e[_0x1aaa('0x67')]=_0x1aaa('0xb1');break;case _0x1aaa('0xb2'):_0x33b67e['childModel']=_0x1aaa('0xb3');break;case'openchannelqueues':_0x33b67e['childModel']=_0x1aaa('0xb4');break;case _0x1aaa('0xb5'):_0x33b67e[_0x1aaa('0x67')]=_0x1aaa('0xb6');break;case'smsqueues':_0x33b67e[_0x1aaa('0x67')]='SmsQueue';break;case _0x1aaa('0xb7'):_0x33b67e['childModel']=_0x1aaa('0xb8');break;case _0x1aaa('0xb9'):_0x33b67e[_0x1aaa('0x67')]=_0x1aaa('0xba');break;case _0x1aaa('0xbb'):case'queuecampaigns':_0x33b67e[_0x1aaa('0x67')]=_0x1aaa('0xa5');if(_0x5e6970){_0x33b67e[_0x1aaa('0x69')]=[{'name':_0x1aaa('0xa3')},{'name':_0x1aaa('0xa7')}];}break;case _0x1aaa('0xbc'):case _0x1aaa('0xbd'):case _0x1aaa('0xbe'):_0x33b67e[_0x1aaa('0x67')]=_0x1aaa('0x9e');if(_0x5e6970){_0x33b67e[_0x1aaa('0x69')]=[{'name':_0x1aaa('0xbf'),'filter':{'field':_0x1aaa('0x9f'),'value':['admin',_0x1aaa('0xc0')]},'ignore':!![]},{'name':_0x1aaa('0xc1')},{'name':_0x1aaa('0xa0')}];}break;case _0x1aaa('0xc2'):_0x33b67e[_0x1aaa('0x67')]='ZendeskAccount';break;case _0x1aaa('0xc3'):_0x33b67e['childModel']=_0x1aaa('0xc4');break;case'freshdeskaccounts':_0x33b67e[_0x1aaa('0x67')]='FreshdeskAccount';break;case _0x1aaa('0xc5'):_0x33b67e[_0x1aaa('0x67')]='SugarcrmAccount';break;case'deskaccounts':_0x33b67e[_0x1aaa('0x67')]='DeskAccount';break;case _0x1aaa('0xc6'):_0x33b67e['childModel']=_0x1aaa('0xc7');break;case'vtigeraccounts':_0x33b67e['childModel']=_0x1aaa('0x9e');break;case'cannedanswers':_0x33b67e['childModel']='CannedAnswer';break;case _0x1aaa('0xc8'):_0x33b67e['childModel']=_0x1aaa('0xc9');break;case _0x1aaa('0xca'):_0x33b67e[_0x1aaa('0x67')]=_0x1aaa('0xcb');break;case'intervals':_0x33b67e['childModel']='Interval';break;case _0x1aaa('0xcc'):_0x33b67e[_0x1aaa('0x67')]=_0x1aaa('0xcd');break;case'scheduler':_0x33b67e[_0x1aaa('0x67')]=_0x1aaa('0xce');break;case'sounds':_0x33b67e[_0x1aaa('0x67')]=_0x1aaa('0xcf');break;case _0x1aaa('0xd0'):_0x33b67e[_0x1aaa('0x67')]='Tag';break;case _0x1aaa('0xd1'):_0x33b67e[_0x1aaa('0x67')]='Template';break;case _0x1aaa('0xd2'):_0x33b67e[_0x1aaa('0x67')]=_0x1aaa('0xd3');break;case _0x1aaa('0xd4'):_0x33b67e[_0x1aaa('0x67')]=_0x1aaa('0xd5');break;case _0x1aaa('0xd6'):_0x33b67e['childModel']=_0x1aaa('0xd7');break;case'plugins':_0x33b67e['childModel']='Plugin';break;case _0x1aaa('0xd8'):_0x33b67e[_0x1aaa('0x67')]=_0x1aaa('0x72');_0x33b67e['parentSections']=[{'name':_0x1aaa('0xd9'),'field':'id','foreignKey':_0x1aaa('0x78')}];break;case _0x1aaa('0xda'):_0x33b67e['childModel']=_0x1aaa('0xdb');break;case _0x1aaa('0xdc'):_0x33b67e[_0x1aaa('0x67')]=_0x1aaa('0xdd');break;case _0x1aaa('0xde'):_0x33b67e[_0x1aaa('0x67')]=_0x1aaa('0xdf');break;case _0x1aaa('0xe0'):_0x33b67e[_0x1aaa('0x67')]='SAPaymentMethod';break;default:return _0x33b67e;}return _0x33b67e;} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 25562ec..aaf604d 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 _0x0a0b=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserProfile','update'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x0a0b,0x71));var _0xb0a0=function(_0x165d73,_0x3f049d){_0x165d73=_0x165d73-0x0;var _0x5c0e97=_0x0a0b[_0x165d73];return _0x5c0e97;};'use strict';var EventEmitter=require(_0xb0a0('0x0'));var UserProfile=require(_0xb0a0('0x1'))['db'][_0xb0a0('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xb0a0('0x3'),'afterDestroy':_0xb0a0('0x4')};function emitEvent(_0x5e5020){return function(_0x3bb167,_0x42ff8e,_0x3e4dbd){UserProfileEvents[_0xb0a0('0x5')](_0x5e5020+':'+_0x3bb167['id'],_0x3bb167);UserProfileEvents[_0xb0a0('0x5')](_0x5e5020,_0x3bb167);_0x3e4dbd(null);};}for(var e in events){if(events[_0xb0a0('0x6')](e)){var event=events[e];UserProfile[_0xb0a0('0x7')](e,emitEvent(event));}}module[_0xb0a0('0x8')]=UserProfileEvents; \ No newline at end of file +var _0xb490=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x5e9edf,_0x586dc6){var _0x5b8b14=function(_0x3aaa40){while(--_0x3aaa40){_0x5e9edf['push'](_0x5e9edf['shift']());}};_0x5b8b14(++_0x586dc6);}(_0xb490,0x14f));var _0x0b49=function(_0x169cd5,_0x15bc69){_0x169cd5=_0x169cd5-0x0;var _0x1db52b=_0xb490[_0x169cd5];return _0x1db52b;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x0b49('0x0'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0b49('0x1'),'afterUpdate':_0x0b49('0x2'),'afterDestroy':_0x0b49('0x3')};function emitEvent(_0x37071a){return function(_0x3284b7,_0x39c11e,_0x22e925){UserProfileEvents[_0x0b49('0x4')](_0x37071a+':'+_0x3284b7['id'],_0x3284b7);UserProfileEvents[_0x0b49('0x4')](_0x37071a,_0x3284b7);_0x22e925(null);};}for(var e in events){if(events[_0x0b49('0x5')](e)){var event=events[e];UserProfile[_0x0b49('0x6')](e,emitEvent(event));}}module[_0x0b49('0x7')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index cc9502a..def965d 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 _0xc704=['bluebird','request-promise','../../config/environment','exports','define','lodash','util','../../config/logger','api','moment'];(function(_0x78601a,_0x83dd){var _0x4ed023=function(_0x4cd33c){while(--_0x4cd33c){_0x78601a['push'](_0x78601a['shift']());}};_0x4ed023(++_0x83dd);}(_0xc704,0x1d1));var _0x4c70=function(_0x1a3a03,_0x4b3d23){_0x1a3a03=_0x1a3a03-0x0;var _0x2df408=_0xc704[_0x1a3a03];return _0x2df408;};'use strict';var _=require(_0x4c70('0x0'));var util=require(_0x4c70('0x1'));var logger=require(_0x4c70('0x2'))(_0x4c70('0x3'));var moment=require(_0x4c70('0x4'));var BPromise=require(_0x4c70('0x5'));var rp=require(_0x4c70('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4c70('0x7'));var attributes=require('./userProfile.attributes');module[_0x4c70('0x8')]=function(_0x73f0ee,_0x17c8f5){return _0x73f0ee[_0x4c70('0x9')]('UserProfile',attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x05bf=['define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x3bb5b4,_0x128455){var _0x586c60=function(_0x179226){while(--_0x179226){_0x3bb5b4['push'](_0x3bb5b4['shift']());}};_0x586c60(++_0x128455);}(_0x05bf,0xe5));var _0xf05b=function(_0x1716c9,_0x765d89){_0x1716c9=_0x1716c9-0x0;var _0x5f5aef=_0x05bf[_0x1716c9];return _0x5f5aef;};'use strict';var _=require(_0xf05b('0x0'));var util=require(_0xf05b('0x1'));var logger=require(_0xf05b('0x2'))(_0xf05b('0x3'));var moment=require(_0xf05b('0x4'));var BPromise=require(_0xf05b('0x5'));var rp=require(_0xf05b('0x6'));var fs=require('fs');var path=require(_0xf05b('0x7'));var rimraf=require(_0xf05b('0x8'));var config=require(_0xf05b('0x9'));var attributes=require('./userProfile.attributes');module[_0xf05b('0xa')]=function(_0x5bf664,_0x52db0e){return _0x5bf664[_0xf05b('0xb')]('UserProfile',attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 11aaabe..be1eeb7 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 _0xc12e=['then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request'];(function(_0x4c1a82,_0x151269){var _0x246af8=function(_0x2eac62){while(--_0x2eac62){_0x4c1a82['push'](_0x4c1a82['shift']());}};_0x246af8(++_0x151269);}(_0xc12e,0x1ce));var _0xec12=function(_0x23245e,_0x14f32b){_0x23245e=_0x23245e-0x0;var _0x3813af=_0xc12e[_0x23245e];return _0x3813af;};'use strict';var _=require('lodash');var util=require(_0xec12('0x0'));var moment=require('moment');var BPromise=require(_0xec12('0x1'));var rs=require(_0xec12('0x2'));var fs=require('fs');var Redis=require(_0xec12('0x3'));var db=require(_0xec12('0x4'))['db'];var utils=require(_0xec12('0x5'));var logger=require(_0xec12('0x6'))(_0xec12('0x7'));var config=require(_0xec12('0x8'));var jayson=require(_0xec12('0x9'));var client=jayson[_0xec12('0xa')][_0xec12('0xb')]({'port':0x232a});config[_0xec12('0xc')]=_[_0xec12('0xd')](config['redis'],{'host':_0xec12('0xe'),'port':0x18eb});var socket=require(_0xec12('0xf'))(new Redis(config['redis']));require('./userProfile.socket')[_0xec12('0x10')](socket);function respondWithRpcPromise(_0x125e50,_0xca9a2,_0x298755){return new BPromise(function(_0x16682,_0x125f01){return client[_0xec12('0x11')](_0x125e50,_0x298755)[_0xec12('0x12')](function(_0x152a4b){logger[_0xec12('0x13')](_0xec12('0x14'),_0xca9a2,_0xec12('0x15'));logger[_0xec12('0x16')](_0xec12('0x17'),_0xca9a2,'request\x20sent',JSON[_0xec12('0x18')](_0x152a4b));if(_0x152a4b[_0xec12('0x19')]){if(_0x152a4b[_0xec12('0x19')][_0xec12('0x1a')]===0x1f4){logger[_0xec12('0x19')]('UserProfile,\x20%s,\x20%s',_0xca9a2,_0x152a4b['error']['message']);return _0x125f01(_0x152a4b[_0xec12('0x19')][_0xec12('0x1b')]);}logger[_0xec12('0x19')]('UserProfile,\x20%s,\x20%s',_0xca9a2,_0x152a4b[_0xec12('0x19')][_0xec12('0x1b')]);return _0x16682(_0x152a4b['error'][_0xec12('0x1b')]);}else{logger[_0xec12('0x13')]('UserProfile,\x20%s,\x20%s',_0xca9a2,_0xec12('0x15'));_0x16682(_0x152a4b[_0xec12('0x1c')]['message']);}})[_0xec12('0x1d')](function(_0x74d0d){logger[_0xec12('0x19')](_0xec12('0x14'),_0xca9a2,_0x74d0d);_0x125f01(_0x74d0d);});});} \ No newline at end of file +var _0x4977=['jayson/promise','http','redis','localhost','socket.io-emitter','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x4977,0x1ee));var _0x7497=function(_0x4fbf5c,_0x141bbc){_0x4fbf5c=_0x4fbf5c-0x0;var _0x5dad49=_0x4977[_0x4fbf5c];return _0x5dad49;};'use strict';var _=require(_0x7497('0x0'));var util=require(_0x7497('0x1'));var moment=require(_0x7497('0x2'));var BPromise=require(_0x7497('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7497('0x4'));var db=require(_0x7497('0x5'))['db'];var utils=require(_0x7497('0x6'));var logger=require(_0x7497('0x7'))(_0x7497('0x8'));var config=require(_0x7497('0x9'));var jayson=require(_0x7497('0xa'));var client=jayson['client'][_0x7497('0xb')]({'port':0x232a});config[_0x7497('0xc')]=_['defaults'](config['redis'],{'host':_0x7497('0xd'),'port':0x18eb});var socket=require(_0x7497('0xe'))(new Redis(config[_0x7497('0xc')]));require(_0x7497('0xf'))[_0x7497('0x10')](socket);function respondWithRpcPromise(_0x3af61d,_0x2bd428,_0xee310e){return new BPromise(function(_0x50e78f,_0x45311){return client[_0x7497('0x11')](_0x3af61d,_0xee310e)[_0x7497('0x12')](function(_0x586ee7){logger[_0x7497('0x13')](_0x7497('0x14'),_0x2bd428,_0x7497('0x15'));logger['debug'](_0x7497('0x16'),_0x2bd428,_0x7497('0x15'),JSON[_0x7497('0x17')](_0x586ee7));if(_0x586ee7[_0x7497('0x18')]){if(_0x586ee7[_0x7497('0x18')][_0x7497('0x19')]===0x1f4){logger[_0x7497('0x18')](_0x7497('0x14'),_0x2bd428,_0x586ee7['error'][_0x7497('0x1a')]);return _0x45311(_0x586ee7[_0x7497('0x18')][_0x7497('0x1a')]);}logger[_0x7497('0x18')](_0x7497('0x14'),_0x2bd428,_0x586ee7[_0x7497('0x18')]['message']);return _0x50e78f(_0x586ee7[_0x7497('0x18')][_0x7497('0x1a')]);}else{logger[_0x7497('0x13')](_0x7497('0x14'),_0x2bd428,_0x7497('0x15'));_0x50e78f(_0x586ee7[_0x7497('0x1b')][_0x7497('0x1a')]);}})['catch'](function(_0x64e8f4){logger['error'](_0x7497('0x14'),_0x2bd428,_0x64e8f4);_0x45311(_0x64e8f4);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index f8aa217..8b98724 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 _0x6dfa=['update','register','length','userProfile:','./userProfile.events','save','remove'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x6dfa,0x7b));var _0xa6df=function(_0x1ba134,_0x4e241f){_0x1ba134=_0x1ba134-0x0;var _0x4b5259=_0x6dfa[_0x1ba134];return _0x4b5259;};'use strict';var UserProfileEvents=require(_0xa6df('0x0'));var events=[_0xa6df('0x1'),_0xa6df('0x2'),_0xa6df('0x3')];function createListener(_0x38f44c,_0x496a2f){return function(_0x1965ad){_0x496a2f['emit'](_0x38f44c,_0x1965ad);};}function removeListener(_0x2ea163,_0x4da450){return function(){UserProfileEvents['removeListener'](_0x2ea163,_0x4da450);};}exports[_0xa6df('0x4')]=function(_0x273081){for(var _0x3299a2=0x0,_0x4721a5=events[_0xa6df('0x5')];_0x3299a2<_0x4721a5;_0x3299a2++){var _0x16e528=events[_0x3299a2];var _0x57f22d=createListener(_0xa6df('0x6')+_0x16e528,_0x273081);UserProfileEvents['on'](_0x16e528,_0x57f22d);}}; \ No newline at end of file +var _0xc18a=['removeListener','register','length','userProfile:','./userProfile.events','save','remove','update','emit'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0xc18a,0x1cf));var _0xac18=function(_0xc417af,_0x479abd){_0xc417af=_0xc417af-0x0;var _0x25a231=_0xc18a[_0xc417af];return _0x25a231;};'use strict';var UserProfileEvents=require(_0xac18('0x0'));var events=[_0xac18('0x1'),_0xac18('0x2'),_0xac18('0x3')];function createListener(_0x48266f,_0x3a3e96){return function(_0x2651c2){_0x3a3e96[_0xac18('0x4')](_0x48266f,_0x2651c2);};}function removeListener(_0x3da5f5,_0x42f646){return function(){UserProfileEvents[_0xac18('0x5')](_0x3da5f5,_0x42f646);};}exports[_0xac18('0x6')]=function(_0x395493){for(var _0x49136f=0x0,_0xab6cb=events[_0xac18('0x7')];_0x49136f<_0xab6cb;_0x49136f++){var _0x542a9=events[_0x49136f];var _0x2bf4b8=createListener(_0xac18('0x8')+_0x542a9,_0x395493);UserProfileEvents['on'](_0x542a9,_0x2bf4b8);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index a79f170..685fad4 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 _0x6db4=['util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy','exports'];(function(_0x13b392,_0x3481f2){var _0x39db24=function(_0xab91e5){while(--_0xab91e5){_0x13b392['push'](_0x13b392['shift']());}};_0x39db24(++_0x3481f2);}(_0x6db4,0x111));var _0x46db=function(_0x54d2c8,_0x4bccca){_0x54d2c8=_0x54d2c8-0x0;var _0x6560c9=_0x6db4[_0x54d2c8];return _0x6560c9;};'use strict';var multer=require('multer');var util=require(_0x46db('0x0'));var path=require(_0x46db('0x1'));var timeout=require(_0x46db('0x2'));var express=require(_0x46db('0x3'));var router=express[_0x46db('0x4')]();var auth=require(_0x46db('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x46db('0x6'));var controller=require(_0x46db('0x7'));router[_0x46db('0x8')]('/',auth[_0x46db('0x9')](),controller[_0x46db('0xa')]);router[_0x46db('0x8')](_0x46db('0xb'),auth['isAuthenticated'](),controller[_0x46db('0xc')]);router[_0x46db('0x8')](_0x46db('0xd'),auth[_0x46db('0x9')](),controller[_0x46db('0xe')]);router[_0x46db('0xf')]('/',auth[_0x46db('0x9')](),controller[_0x46db('0x10')]);router[_0x46db('0x11')](_0x46db('0xd'),auth[_0x46db('0x9')](),controller[_0x46db('0x12')]);router['delete'](_0x46db('0xd'),auth[_0x46db('0x9')](),controller[_0x46db('0x13')]);module[_0x46db('0x14')]=router; \ No newline at end of file +var _0x4991=['isAuthenticated','/describe','describe','/:id','show','create','delete','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x4991,0xf7));var _0x1499=function(_0x12e099,_0x11a924){_0x12e099=_0x12e099-0x0;var _0x59dbfb=_0x4991[_0x12e099];return _0x59dbfb;};'use strict';var multer=require(_0x1499('0x0'));var util=require('util');var path=require(_0x1499('0x1'));var timeout=require('connect-timeout');var express=require(_0x1499('0x2'));var router=express[_0x1499('0x3')]();var auth=require(_0x1499('0x4'));var interaction=require(_0x1499('0x5'));var config=require(_0x1499('0x6'));var controller=require(_0x1499('0x7'));router[_0x1499('0x8')]('/',auth[_0x1499('0x9')](),controller['index']);router[_0x1499('0x8')](_0x1499('0xa'),auth[_0x1499('0x9')](),controller[_0x1499('0xb')]);router[_0x1499('0x8')](_0x1499('0xc'),auth[_0x1499('0x9')](),controller[_0x1499('0xd')]);router['post']('/',auth[_0x1499('0x9')](),controller[_0x1499('0xe')]);router['put'](_0x1499('0xc'),auth[_0x1499('0x9')](),controller['update']);router[_0x1499('0xf')](_0x1499('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 81c917f..90b3897 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 _0xf7fd=['INTEGER','sequelize','STRING'];(function(_0x14064a,_0xdc7bf0){var _0x4f993e=function(_0x5e9e3f){while(--_0x5e9e3f){_0x14064a['push'](_0x14064a['shift']());}};_0x4f993e(++_0xdc7bf0);}(_0xf7fd,0x18a));var _0xdf7f=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xf7fd[_0x9aada2];return _0x196dff;};'use strict';var Sequelize=require(_0xdf7f('0x0'));module['exports']={'name':{'type':Sequelize[_0xdf7f('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xdf7f('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xdf7f('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xf10d=['INTEGER','sequelize','exports','STRING'];(function(_0x5df5aa,_0x396dae){var _0x52cc13=function(_0x17e21d){while(--_0x17e21d){_0x5df5aa['push'](_0x5df5aa['shift']());}};_0x52cc13(++_0x396dae);}(_0xf10d,0x125));var _0xdf10=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0xf10d[_0x455c6c];return _0x488242;};'use strict';var Sequelize=require(_0xdf10('0x0'));module[_0xdf10('0x1')]={'name':{'type':Sequelize[_0xdf10('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xdf10('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf10('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 74fa100..ecc6e83 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 _0xc2e4=['count','offset','limit','set','Content-Range','apply','reject','destroy','then','stack','name','send','index','UserProfileResource','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','key','VIRTUAL','field','filter','options','includeAll','include','rows','catch','create','body','update','find','params','describe','html-pdf','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','lodash','squel','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/logger','../../config/environment','sendStatus','status','end','json'];(function(_0x3f4f72,_0x5d9746){var _0x45e2de=function(_0x1daf3f){while(--_0x1daf3f){_0x3f4f72['push'](_0x3f4f72['shift']());}};_0x45e2de(++_0x5d9746);}(_0xc2e4,0x6e));var _0x4c2e=function(_0x3b4b4d,_0x43164e){_0x3b4b4d=_0x3b4b4d-0x0;var _0x577e1b=_0xc2e4[_0x3b4b4d];return _0x577e1b;};'use strict';var pdf=require(_0x4c2e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4c2e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4c2e('0x2'));var rp=require(_0x4c2e('0x3'));var moment=require(_0x4c2e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4c2e('0x5'));var util=require(_0x4c2e('0x6'));var path=require('path');var sox=require(_0x4c2e('0x7'));var csv=require('to-csv');var ejs=require(_0x4c2e('0x8'));var fs=require('fs');var _=require(_0x4c2e('0x9'));var squel=require(_0x4c2e('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4c2e('0xb'));var toCsv=require(_0x4c2e('0xc'));var querystring=require(_0x4c2e('0xd'));var Papa=require(_0x4c2e('0xe'));var Redis=require('ioredis');var authService=require(_0x4c2e('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4c2e('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x4c2e('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4dab2d,_0x2c5ab4){_0x2c5ab4=_0x2c5ab4||0xcc;return function(_0x4a2d92){if(_0x4a2d92){return _0x4dab2d[_0x4c2e('0x12')](_0x2c5ab4);}return _0x4dab2d[_0x4c2e('0x13')](_0x2c5ab4)[_0x4c2e('0x14')]();};}function respondWithResult(_0x40d150,_0x4f5264){_0x4f5264=_0x4f5264||0xc8;return function(_0x4a3824){if(_0x4a3824){return _0x40d150[_0x4c2e('0x13')](_0x4f5264)[_0x4c2e('0x15')](_0x4a3824);}};}function respondWithFilteredResult(_0x191940,_0x336e22){return function(_0x28c40a){if(_0x28c40a){var _0xb707f3=_0x28c40a[_0x4c2e('0x16')],_0x411af8=_0x336e22[_0x4c2e('0x17')],_0x1bd4ca=_0x336e22['offset']+_0x336e22[_0x4c2e('0x18')],_0x137617;if(_0x1bd4ca>=_0xb707f3){_0x1bd4ca=_0xb707f3;_0x137617=0xc8;}else{_0x137617=0xce;}_0x191940[_0x4c2e('0x13')](_0x137617);return _0x191940[_0x4c2e('0x19')](_0x4c2e('0x1a'),_0x411af8+'-'+_0x1bd4ca+'/'+_0xb707f3)[_0x4c2e('0x15')](_0x28c40a);}return null;};}function patchUpdates(_0x3f1427){return function(_0x3dd610){try{jsonpatch[_0x4c2e('0x1b')](_0x3dd610,_0x3f1427,!![]);}catch(_0x3b4cf8){return BPromise[_0x4c2e('0x1c')](_0x3b4cf8);}return _0x3dd610['save']();};}function saveUpdates(_0x585036,_0x1b4a4b){return function(_0x48eb95){if(_0x48eb95){return _0x48eb95['update'](_0x585036)['then'](function(_0x25e6e0){return _0x25e6e0;});}return null;};}function removeEntity(_0x472bc2,_0x41a381){return function(_0x5436c8){if(_0x5436c8){return _0x5436c8[_0x4c2e('0x1d')]()[_0x4c2e('0x1e')](function(){_0x472bc2['status'](0xcc)[_0x4c2e('0x14')]();});}};}function handleEntityNotFound(_0x84d491,_0x9caa99){return function(_0x5b9065){if(!_0x5b9065){_0x84d491[_0x4c2e('0x12')](0x194);}return _0x5b9065;};}function handleError(_0x40063d,_0x22c540){_0x22c540=_0x22c540||0x1f4;return function(_0x1f777b){logger['error'](_0x1f777b[_0x4c2e('0x1f')]);if(_0x1f777b[_0x4c2e('0x20')]){delete _0x1f777b['name'];}_0x40063d[_0x4c2e('0x13')](_0x22c540)[_0x4c2e('0x21')](_0x1f777b);};}exports[_0x4c2e('0x22')]=function(_0x18d7f5,_0x2c061f){var _0x3f8b75={},_0x433d76={},_0x5c3ef5={'count':0x0,'rows':[]};var _0x242d46=db[_0x4c2e('0x23')][_0x4c2e('0x24')];_0x433d76[_0x4c2e('0x25')]=_[_0x4c2e('0x26')](_0x242d46);_0x433d76[_0x4c2e('0x27')]=_[_0x4c2e('0x26')](_0x18d7f5[_0x4c2e('0x27')]);_0x433d76[_0x4c2e('0x28')]=_[_0x4c2e('0x29')](_0x433d76[_0x4c2e('0x25')],_0x433d76['query']);_0x3f8b75[_0x4c2e('0x2a')]=_['intersection'](_0x433d76[_0x4c2e('0x25')],qs['fields'](_0x18d7f5[_0x4c2e('0x27')][_0x4c2e('0x2b')]));_0x3f8b75[_0x4c2e('0x2a')]=_0x3f8b75[_0x4c2e('0x2a')][_0x4c2e('0x2c')]?_0x3f8b75['attributes']:_0x433d76[_0x4c2e('0x25')];if(!_0x18d7f5[_0x4c2e('0x27')]['hasOwnProperty'](_0x4c2e('0x2d'))){_0x3f8b75['limit']=qs[_0x4c2e('0x18')](_0x18d7f5[_0x4c2e('0x27')][_0x4c2e('0x18')]);_0x3f8b75[_0x4c2e('0x17')]=qs['offset'](_0x18d7f5[_0x4c2e('0x27')][_0x4c2e('0x17')]);}_0x3f8b75[_0x4c2e('0x2e')]=qs[_0x4c2e('0x2f')](_0x18d7f5[_0x4c2e('0x27')][_0x4c2e('0x2f')]);_0x3f8b75[_0x4c2e('0x30')]=qs['filters'](_[_0x4c2e('0x31')](_0x18d7f5[_0x4c2e('0x27')],_0x433d76[_0x4c2e('0x28')]));if(_0x18d7f5[_0x4c2e('0x27')]['filter']){_0x3f8b75[_0x4c2e('0x30')]=_[_0x4c2e('0x32')](_0x3f8b75[_0x4c2e('0x30')],{'$or':_['map'](_0x242d46,function(_0x3625d9){if(_0x3625d9['type'][_0x4c2e('0x33')]!==_0x4c2e('0x34')){var _0x190267={};_0x190267[_0x3625d9[_0x4c2e('0x35')]]={'$like':'%'+_0x18d7f5['query'][_0x4c2e('0x36')]+'%'};return _0x190267;}})});}_0x3f8b75=_[_0x4c2e('0x32')]({},_0x3f8b75,_0x18d7f5[_0x4c2e('0x37')]);var _0x3e5919={'where':_0x3f8b75[_0x4c2e('0x30')]};return db[_0x4c2e('0x23')]['count'](_0x3e5919)[_0x4c2e('0x1e')](function(_0x39b6f5){_0x5c3ef5[_0x4c2e('0x16')]=_0x39b6f5;if(_0x18d7f5['query'][_0x4c2e('0x38')]){_0x3f8b75[_0x4c2e('0x39')]=[{'all':!![]}];}return db[_0x4c2e('0x23')]['findAll'](_0x3f8b75);})[_0x4c2e('0x1e')](function(_0x34ca69){_0x5c3ef5[_0x4c2e('0x3a')]=_0x34ca69;return _0x5c3ef5;})[_0x4c2e('0x1e')](respondWithFilteredResult(_0x2c061f,_0x3f8b75))[_0x4c2e('0x3b')](handleError(_0x2c061f,null));};exports['show']=function(_0x1b30ce,_0x54974e){var _0x45dc83={'raw':![],'where':{'id':_0x1b30ce['params']['id']}},_0x454842={};_0x454842[_0x4c2e('0x25')]=_[_0x4c2e('0x26')](db[_0x4c2e('0x23')][_0x4c2e('0x24')]);_0x454842[_0x4c2e('0x27')]=_[_0x4c2e('0x26')](_0x1b30ce['query']);_0x454842[_0x4c2e('0x28')]=_['intersection'](_0x454842[_0x4c2e('0x25')],_0x454842['query']);_0x45dc83[_0x4c2e('0x2a')]=_[_0x4c2e('0x29')](_0x454842[_0x4c2e('0x25')],qs['fields'](_0x1b30ce['query'][_0x4c2e('0x2b')]));_0x45dc83['attributes']=_0x45dc83[_0x4c2e('0x2a')]['length']?_0x45dc83['attributes']:_0x454842[_0x4c2e('0x25')];if(_0x1b30ce['query']['includeAll']){_0x45dc83[_0x4c2e('0x39')]=[{'all':!![]}];}_0x45dc83=_[_0x4c2e('0x32')]({},_0x45dc83,_0x1b30ce['options']);return db[_0x4c2e('0x23')]['find'](_0x45dc83)['then'](handleEntityNotFound(_0x54974e,null))[_0x4c2e('0x1e')](respondWithResult(_0x54974e,null))[_0x4c2e('0x3b')](handleError(_0x54974e,null));};exports['create']=function(_0x25065a,_0x54f7ec){return db['UserProfileResource'][_0x4c2e('0x3c')](_0x25065a[_0x4c2e('0x3d')],{})[_0x4c2e('0x1e')](respondWithResult(_0x54f7ec,0xc9))[_0x4c2e('0x3b')](handleError(_0x54f7ec,null));};exports[_0x4c2e('0x3e')]=function(_0xcae8f6,_0x20ccd3){if(_0xcae8f6[_0x4c2e('0x3d')]['id']){delete _0xcae8f6[_0x4c2e('0x3d')]['id'];}return db[_0x4c2e('0x23')][_0x4c2e('0x3f')]({'where':{'id':_0xcae8f6[_0x4c2e('0x40')]['id']}})[_0x4c2e('0x1e')](handleEntityNotFound(_0x20ccd3,null))[_0x4c2e('0x1e')](saveUpdates(_0xcae8f6['body'],null))['then'](respondWithResult(_0x20ccd3,null))[_0x4c2e('0x3b')](handleError(_0x20ccd3,null));};exports['destroy']=function(_0x5ae904,_0x385b91){return db[_0x4c2e('0x23')][_0x4c2e('0x3f')]({'where':{'id':_0x5ae904['params']['id']}})['then'](handleEntityNotFound(_0x385b91,null))[_0x4c2e('0x1e')](removeEntity(_0x385b91,null))[_0x4c2e('0x3b')](handleError(_0x385b91,null));};exports[_0x4c2e('0x41')]=function(_0x5c9ae0,_0x609226){return db[_0x4c2e('0x23')][_0x4c2e('0x41')]()[_0x4c2e('0x1e')](respondWithResult(_0x609226,null))[_0x4c2e('0x3b')](handleError(_0x609226,null));}; \ No newline at end of file +var _0x6418=['attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','VIRTUAL','field','count','include','findAll','catch','rawAttributes','options','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','limit','Content-Range','save','update','then','destroy','sendStatus','stack','name','send','index','UserProfileResource','model','keys','query'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6418,0xfa));var _0x8641=function(_0x5798a1,_0x231f23){_0x5798a1=_0x5798a1-0x0;var _0xf5b859=_0x6418[_0x5798a1];return _0xf5b859;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8641('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8641('0x1'));var jsonpatch=require(_0x8641('0x2'));var rp=require(_0x8641('0x3'));var moment=require(_0x8641('0x4'));var BPromise=require(_0x8641('0x5'));var Mustache=require(_0x8641('0x6'));var util=require(_0x8641('0x7'));var path=require(_0x8641('0x8'));var sox=require(_0x8641('0x9'));var csv=require(_0x8641('0xa'));var ejs=require(_0x8641('0xb'));var fs=require('fs');var _=require(_0x8641('0xc'));var squel=require(_0x8641('0xd'));var crypto=require(_0x8641('0xe'));var jsforce=require(_0x8641('0xf'));var deskjs=require(_0x8641('0x10'));var toCsv=require(_0x8641('0xa'));var querystring=require(_0x8641('0x11'));var Papa=require(_0x8641('0x12'));var Redis=require(_0x8641('0x13'));var authService=require(_0x8641('0x14'));var qs=require(_0x8641('0x15'));var hardwareService=require(_0x8641('0x16'));var logger=require(_0x8641('0x17'))(_0x8641('0x18'));var utils=require(_0x8641('0x19'));var config=require(_0x8641('0x1a'));var db=require(_0x8641('0x1b'))['db'];function respondWithStatusCode(_0x2451f9,_0x549db3){_0x549db3=_0x549db3||0xcc;return function(_0x520c80){if(_0x520c80){return _0x2451f9['sendStatus'](_0x549db3);}return _0x2451f9[_0x8641('0x1c')](_0x549db3)['end']();};}function respondWithResult(_0x4c3e5c,_0x489f14){_0x489f14=_0x489f14||0xc8;return function(_0x43255f){if(_0x43255f){return _0x4c3e5c['status'](_0x489f14)[_0x8641('0x1d')](_0x43255f);}};}function respondWithFilteredResult(_0x2e3ca1,_0x1afde1){return function(_0x571abf){if(_0x571abf){var _0x1d9206=_0x571abf['count'],_0x42eeba=_0x1afde1[_0x8641('0x1e')],_0x24d101=_0x1afde1[_0x8641('0x1e')]+_0x1afde1[_0x8641('0x1f')],_0x306113;if(_0x24d101>=_0x1d9206){_0x24d101=_0x1d9206;_0x306113=0xc8;}else{_0x306113=0xce;}_0x2e3ca1['status'](_0x306113);return _0x2e3ca1['set'](_0x8641('0x20'),_0x42eeba+'-'+_0x24d101+'/'+_0x1d9206)[_0x8641('0x1d')](_0x571abf);}return null;};}function patchUpdates(_0x4593b6){return function(_0x398236){try{jsonpatch['apply'](_0x398236,_0x4593b6,!![]);}catch(_0x4afff7){return BPromise['reject'](_0x4afff7);}return _0x398236[_0x8641('0x21')]();};}function saveUpdates(_0x38be64,_0x1d09e2){return function(_0x1f2a23){if(_0x1f2a23){return _0x1f2a23[_0x8641('0x22')](_0x38be64)[_0x8641('0x23')](function(_0x2c625b){return _0x2c625b;});}return null;};}function removeEntity(_0x2dd5cf,_0x110af4){return function(_0x50c993){if(_0x50c993){return _0x50c993[_0x8641('0x24')]()[_0x8641('0x23')](function(){_0x2dd5cf[_0x8641('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x403353,_0x3e1f33){return function(_0x30b2b5){if(!_0x30b2b5){_0x403353[_0x8641('0x25')](0x194);}return _0x30b2b5;};}function handleError(_0x2431e6,_0x3638f1){_0x3638f1=_0x3638f1||0x1f4;return function(_0x3517ea){logger['error'](_0x3517ea[_0x8641('0x26')]);if(_0x3517ea['name']){delete _0x3517ea[_0x8641('0x27')];}_0x2431e6['status'](_0x3638f1)[_0x8641('0x28')](_0x3517ea);};}exports[_0x8641('0x29')]=function(_0xaf59e5,_0xd708af){var _0x136ff0={},_0x5123b6={},_0x506a8e={'count':0x0,'rows':[]};var _0x6e1aa3=db[_0x8641('0x2a')]['rawAttributes'];_0x5123b6[_0x8641('0x2b')]=_[_0x8641('0x2c')](_0x6e1aa3);_0x5123b6[_0x8641('0x2d')]=_[_0x8641('0x2c')](_0xaf59e5[_0x8641('0x2d')]);_0x5123b6['filters']=_['intersection'](_0x5123b6[_0x8641('0x2b')],_0x5123b6[_0x8641('0x2d')]);_0x136ff0[_0x8641('0x2e')]=_[_0x8641('0x2f')](_0x5123b6[_0x8641('0x2b')],qs[_0x8641('0x30')](_0xaf59e5[_0x8641('0x2d')][_0x8641('0x30')]));_0x136ff0[_0x8641('0x2e')]=_0x136ff0['attributes'][_0x8641('0x31')]?_0x136ff0[_0x8641('0x2e')]:_0x5123b6[_0x8641('0x2b')];if(!_0xaf59e5[_0x8641('0x2d')][_0x8641('0x32')](_0x8641('0x33'))){_0x136ff0['limit']=qs['limit'](_0xaf59e5[_0x8641('0x2d')][_0x8641('0x1f')]);_0x136ff0[_0x8641('0x1e')]=qs[_0x8641('0x1e')](_0xaf59e5[_0x8641('0x2d')][_0x8641('0x1e')]);}_0x136ff0[_0x8641('0x34')]=qs[_0x8641('0x35')](_0xaf59e5[_0x8641('0x2d')][_0x8641('0x35')]);_0x136ff0[_0x8641('0x36')]=qs[_0x8641('0x37')](_[_0x8641('0x38')](_0xaf59e5['query'],_0x5123b6['filters']));if(_0xaf59e5[_0x8641('0x2d')][_0x8641('0x39')]){_0x136ff0['where']=_[_0x8641('0x3a')](_0x136ff0[_0x8641('0x36')],{'$or':_[_0x8641('0x3b')](_0x6e1aa3,function(_0x56074a){if(_0x56074a[_0x8641('0x3c')]['key']!==_0x8641('0x3d')){var _0x2420b9={};_0x2420b9[_0x56074a[_0x8641('0x3e')]]={'$like':'%'+_0xaf59e5[_0x8641('0x2d')]['filter']+'%'};return _0x2420b9;}})});}_0x136ff0=_[_0x8641('0x3a')]({},_0x136ff0,_0xaf59e5['options']);var _0x1ac7d8={'where':_0x136ff0[_0x8641('0x36')]};return db[_0x8641('0x2a')][_0x8641('0x3f')](_0x1ac7d8)['then'](function(_0x5180c8){_0x506a8e[_0x8641('0x3f')]=_0x5180c8;if(_0xaf59e5['query']['includeAll']){_0x136ff0[_0x8641('0x40')]=[{'all':!![]}];}return db['UserProfileResource'][_0x8641('0x41')](_0x136ff0);})[_0x8641('0x23')](function(_0x46ddfb){_0x506a8e['rows']=_0x46ddfb;return _0x506a8e;})['then'](respondWithFilteredResult(_0xd708af,_0x136ff0))[_0x8641('0x42')](handleError(_0xd708af,null));};exports['show']=function(_0x58be72,_0x5751eb){var _0x296ced={'raw':![],'where':{'id':_0x58be72['params']['id']}},_0x50fb66={};_0x50fb66[_0x8641('0x2b')]=_[_0x8641('0x2c')](db['UserProfileResource'][_0x8641('0x43')]);_0x50fb66[_0x8641('0x2d')]=_[_0x8641('0x2c')](_0x58be72[_0x8641('0x2d')]);_0x50fb66[_0x8641('0x37')]=_[_0x8641('0x2f')](_0x50fb66[_0x8641('0x2b')],_0x50fb66['query']);_0x296ced['attributes']=_['intersection'](_0x50fb66[_0x8641('0x2b')],qs[_0x8641('0x30')](_0x58be72['query'][_0x8641('0x30')]));_0x296ced['attributes']=_0x296ced[_0x8641('0x2e')][_0x8641('0x31')]?_0x296ced['attributes']:_0x50fb66[_0x8641('0x2b')];if(_0x58be72[_0x8641('0x2d')]['includeAll']){_0x296ced[_0x8641('0x40')]=[{'all':!![]}];}_0x296ced=_['merge']({},_0x296ced,_0x58be72[_0x8641('0x44')]);return db[_0x8641('0x2a')][_0x8641('0x45')](_0x296ced)[_0x8641('0x23')](handleEntityNotFound(_0x5751eb,null))[_0x8641('0x23')](respondWithResult(_0x5751eb,null))[_0x8641('0x42')](handleError(_0x5751eb,null));};exports[_0x8641('0x46')]=function(_0x426c98,_0x19d4d5){return db['UserProfileResource'][_0x8641('0x46')](_0x426c98[_0x8641('0x47')],{})['then'](respondWithResult(_0x19d4d5,0xc9))[_0x8641('0x42')](handleError(_0x19d4d5,null));};exports['update']=function(_0x5e95b6,_0x5bc462){if(_0x5e95b6[_0x8641('0x47')]['id']){delete _0x5e95b6[_0x8641('0x47')]['id'];}return db[_0x8641('0x2a')][_0x8641('0x45')]({'where':{'id':_0x5e95b6['params']['id']}})[_0x8641('0x23')](handleEntityNotFound(_0x5bc462,null))['then'](saveUpdates(_0x5e95b6[_0x8641('0x47')],null))[_0x8641('0x23')](respondWithResult(_0x5bc462,null))[_0x8641('0x42')](handleError(_0x5bc462,null));};exports[_0x8641('0x24')]=function(_0x4744fd,_0x1129d3){return db['UserProfileResource'][_0x8641('0x45')]({'where':{'id':_0x4744fd[_0x8641('0x48')]['id']}})[_0x8641('0x23')](handleEntityNotFound(_0x1129d3,null))[_0x8641('0x23')](removeEntity(_0x1129d3,null))['catch'](handleError(_0x1129d3,null));};exports[_0x8641('0x49')]=function(_0x4a2897,_0x47d4ee){return db[_0x8641('0x2a')]['describe']()[_0x8641('0x23')](respondWithResult(_0x47d4ee,null))[_0x8641('0x42')](handleError(_0x47d4ee,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index c32f6b4..71e7418 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 _0x2053=['rimraf','./userProfileResource.attributes','exports','define','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x58fc2f,_0x111399){var _0x3a1312=function(_0x3d2ff2){while(--_0x3d2ff2){_0x58fc2f['push'](_0x58fc2f['shift']());}};_0x3a1312(++_0x111399);}(_0x2053,0x6a));var _0x3205=function(_0x3eb564,_0x4f7b48){_0x3eb564=_0x3eb564-0x0;var _0xee5b39=_0x2053[_0x3eb564];return _0xee5b39;};'use strict';var _=require(_0x3205('0x0'));var util=require('util');var logger=require(_0x3205('0x1'))(_0x3205('0x2'));var moment=require(_0x3205('0x3'));var BPromise=require(_0x3205('0x4'));var rp=require(_0x3205('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3205('0x6'));var config=require('../../config/environment');var attributes=require(_0x3205('0x7'));module[_0x3205('0x8')]=function(_0x7bbcbc,_0x3ca218){return _0x7bbcbc[_0x3205('0x9')]('UserProfileResource',attributes,{'tableName':_0x3205('0xa'),'paranoid':![],'indexes':[{'name':_0x3205('0xb'),'fields':[_0x3205('0xc'),_0x3205('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcbe1=['../../config/environment','./userProfileResource.attributes','exports','define','user_profile_has_resources','resourceId','sectionId','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x431660,_0x108c78){var _0x57c9a8=function(_0x4daeb2){while(--_0x4daeb2){_0x431660['push'](_0x431660['shift']());}};_0x57c9a8(++_0x108c78);}(_0xcbe1,0x124));var _0x1cbe=function(_0x109b6e,_0xbf489f){_0x109b6e=_0x109b6e-0x0;var _0x1e8595=_0xcbe1[_0x109b6e];return _0x1e8595;};'use strict';var _=require(_0x1cbe('0x0'));var util=require(_0x1cbe('0x1'));var logger=require('../../config/logger')(_0x1cbe('0x2'));var moment=require(_0x1cbe('0x3'));var BPromise=require(_0x1cbe('0x4'));var rp=require(_0x1cbe('0x5'));var fs=require('fs');var path=require(_0x1cbe('0x6'));var rimraf=require(_0x1cbe('0x7'));var config=require(_0x1cbe('0x8'));var attributes=require(_0x1cbe('0x9'));module[_0x1cbe('0xa')]=function(_0x42c300,_0x5db07c){return _0x42c300[_0x1cbe('0xb')]('UserProfileResource',attributes,{'tableName':_0x1cbe('0xc'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x1cbe('0xd'),_0x1cbe('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 0f45138..ba39479 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 _0x6d38=['request','then','UserProfileResource,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x1a1ac0,_0x5f5b05){var _0x1077f2=function(_0x5783c3){while(--_0x5783c3){_0x1a1ac0['push'](_0x1a1ac0['shift']());}};_0x1077f2(++_0x5f5b05);}(_0x6d38,0x1ef));var _0x86d3=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x6d38[_0x122096];return _0x3d1966;};'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']('UserProfileResource,\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 +var _0x0adf=['request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','code','error','UserProfileResource,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info'];(function(_0x128641,_0x1ec4c1){var _0x228d4c=function(_0x13604e){while(--_0x13604e){_0x128641['push'](_0x128641['shift']());}};_0x228d4c(++_0x1ec4c1);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x5e80ac,_0x4a7ead){_0x5e80ac=_0x5e80ac-0x0;var _0x52efd7=_0x0adf[_0x5e80ac];return _0x52efd7;};'use strict';var _=require(_0xf0ad('0x0'));var util=require(_0xf0ad('0x1'));var moment=require(_0xf0ad('0x2'));var BPromise=require('bluebird');var rs=require(_0xf0ad('0x3'));var fs=require('fs');var Redis=require(_0xf0ad('0x4'));var db=require(_0xf0ad('0x5'))['db'];var utils=require(_0xf0ad('0x6'));var logger=require(_0xf0ad('0x7'))(_0xf0ad('0x8'));var config=require(_0xf0ad('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf0ad('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2eca0e,_0x44cf37,_0x170574){return new BPromise(function(_0x41c99d,_0xa9a315){return client[_0xf0ad('0xb')](_0x2eca0e,_0x170574)[_0xf0ad('0xc')](function(_0x5bdf69){logger[_0xf0ad('0xd')]('UserProfileResource,\x20%s,\x20%s',_0x44cf37,_0xf0ad('0xe'));logger[_0xf0ad('0xf')](_0xf0ad('0x10'),_0x44cf37,_0xf0ad('0xe'),JSON[_0xf0ad('0x11')](_0x5bdf69));if(_0x5bdf69['error']){if(_0x5bdf69['error'][_0xf0ad('0x12')]===0x1f4){logger[_0xf0ad('0x13')](_0xf0ad('0x14'),_0x44cf37,_0x5bdf69[_0xf0ad('0x13')]['message']);return _0xa9a315(_0x5bdf69[_0xf0ad('0x13')][_0xf0ad('0x15')]);}logger['error']('UserProfileResource,\x20%s,\x20%s',_0x44cf37,_0x5bdf69['error'][_0xf0ad('0x15')]);return _0x41c99d(_0x5bdf69['error'][_0xf0ad('0x15')]);}else{logger[_0xf0ad('0xd')](_0xf0ad('0x14'),_0x44cf37,_0xf0ad('0xe'));_0x41c99d(_0x5bdf69[_0xf0ad('0x16')]['message']);}})[_0xf0ad('0x17')](function(_0x285ab0){logger[_0xf0ad('0x13')](_0xf0ad('0x14'),_0x44cf37,_0x285ab0);_0xa9a315(_0x285ab0);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index a76c5fa..978fd79 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 _0x3faa=['isAuthenticated','index','/:id','show','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./userProfileSection.controller'];(function(_0x54813d,_0x101c1f){var _0x561eea=function(_0x1faa0a){while(--_0x1faa0a){_0x54813d['push'](_0x54813d['shift']());}};_0x561eea(++_0x101c1f);}(_0x3faa,0x87));var _0xa3fa=function(_0x5e06d0,_0x2b5796){_0x5e06d0=_0x5e06d0-0x0;var _0x4b9fe9=_0x3faa[_0x5e06d0];return _0x4b9fe9;};'use strict';var multer=require(_0xa3fa('0x0'));var util=require(_0xa3fa('0x1'));var path=require(_0xa3fa('0x2'));var timeout=require(_0xa3fa('0x3'));var express=require(_0xa3fa('0x4'));var router=express[_0xa3fa('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xa3fa('0x6'));var config=require(_0xa3fa('0x7'));var controller=require(_0xa3fa('0x8'));router['get']('/',auth[_0xa3fa('0x9')](),controller[_0xa3fa('0xa')]);router['get']('/describe',auth[_0xa3fa('0x9')](),controller['describe']);router['get'](_0xa3fa('0xb'),auth[_0xa3fa('0x9')](),controller[_0xa3fa('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa3fa('0xd')]);router['put']('/:id',auth[_0xa3fa('0x9')](),controller[_0xa3fa('0xe')]);router[_0xa3fa('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xa3fa('0x10')]);module[_0xa3fa('0x11')]=router; \ No newline at end of file +var _0x1035=['put','update','delete','destroy','exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','/describe','/:id','show','create'];(function(_0x46a00c,_0x57cd8a){var _0x247873=function(_0x4edc83){while(--_0x4edc83){_0x46a00c['push'](_0x46a00c['shift']());}};_0x247873(++_0x57cd8a);}(_0x1035,0xdd));var _0x5103=function(_0x567758,_0x533bba){_0x567758=_0x567758-0x0;var _0x1d0e7f=_0x1035[_0x567758];return _0x1d0e7f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5103('0x0'));var timeout=require(_0x5103('0x1'));var express=require('express');var router=express[_0x5103('0x2')]();var auth=require(_0x5103('0x3'));var interaction=require(_0x5103('0x4'));var config=require(_0x5103('0x5'));var controller=require(_0x5103('0x6'));router[_0x5103('0x7')]('/',auth[_0x5103('0x8')](),controller['index']);router['get'](_0x5103('0x9'),auth[_0x5103('0x8')](),controller['describe']);router[_0x5103('0x7')](_0x5103('0xa'),auth['isAuthenticated'](),controller[_0x5103('0xb')]);router['post']('/',auth[_0x5103('0x8')](),controller[_0x5103('0xc')]);router[_0x5103('0xd')](_0x5103('0xa'),auth[_0x5103('0x8')](),controller[_0x5103('0xe')]);router[_0x5103('0xf')](_0x5103('0xa'),auth[_0x5103('0x8')](),controller[_0x5103('0x10')]);module[_0x5103('0x11')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 5f0d74a..8569b61 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(_0x6fbac5,_0x3a3229){var _0x86c2e=function(_0x5aa648){while(--_0x5aa648){_0x6fbac5['push'](_0x6fbac5['shift']());}};_0x86c2e(++_0x3a3229);}(_0xedd9,0xfc));var _0x9edd=function(_0x44ddd4,_0x49f6d4){_0x44ddd4=_0x44ddd4-0x0;var _0x258882=_0xedd9[_0x44ddd4];return _0x258882;};'use strict';var Sequelize=require('sequelize');module[_0x9edd('0x0')]={'name':{'type':Sequelize[_0x9edd('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x9edd('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x9edd('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x9edd('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x9edd('0x1')],'set':function(_0x36b53f){this['setDataValue'](_0x9edd('0x4'),_0x36b53f?_0x36b53f[_0x9edd('0x5')](''):[]);},'get':function(){return this[_0x9edd('0x6')](_0x9edd('0x4'))?this['getDataValue'](_0x9edd('0x4'))['split'](''):[];}}}; \ No newline at end of file +var _0xa9e0=['crudPermissions','join','getDataValue','sequelize','exports','STRING','BOOLEAN','setDataValue'];(function(_0x1ff6c3,_0x13cc8e){var _0x3967bd=function(_0xf8698c){while(--_0xf8698c){_0x1ff6c3['push'](_0x1ff6c3['shift']());}};_0x3967bd(++_0x13cc8e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x0a9e('0x2')],'set':function(_0x432180){this[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x432180?_0x432180[_0x0a9e('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0x0a9e('0x5'))?this[_0x0a9e('0x7')](_0x0a9e('0x5'))['split'](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 90a6bfc..54d048c 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 _0xadb5=['then','sendStatus','error','name','send','index','UserProfileSection','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','nolimit','where','pick','filter','merge','type','VIRTUAL','field','options','includeAll','include','findAll','show','params','find','create','body','catch','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','status','end','json','count','offset','limit','Content-Range','apply','save','update','destroy'];(function(_0x563299,_0x33082d){var _0x494bcc=function(_0x50fc3d){while(--_0x50fc3d){_0x563299['push'](_0x563299['shift']());}};_0x494bcc(++_0x33082d);}(_0xadb5,0xad));var _0x5adb=function(_0x37a051,_0x5b8dde){_0x37a051=_0x37a051-0x0;var _0x23423d=_0xadb5[_0x37a051];return _0x23423d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5adb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5adb('0x1'));var jsonpatch=require(_0x5adb('0x2'));var rp=require(_0x5adb('0x3'));var moment=require('moment');var BPromise=require(_0x5adb('0x4'));var Mustache=require(_0x5adb('0x5'));var util=require(_0x5adb('0x6'));var path=require('path');var sox=require(_0x5adb('0x7'));var csv=require(_0x5adb('0x8'));var ejs=require(_0x5adb('0x9'));var fs=require('fs');var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x8'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5adb('0x14'));var utils=require(_0x5adb('0x15'));var config=require(_0x5adb('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29f0d5,_0x56012f){_0x56012f=_0x56012f||0xcc;return function(_0x2a0b70){if(_0x2a0b70){return _0x29f0d5['sendStatus'](_0x56012f);}return _0x29f0d5[_0x5adb('0x17')](_0x56012f)[_0x5adb('0x18')]();};}function respondWithResult(_0x44abe3,_0x5c929a){_0x5c929a=_0x5c929a||0xc8;return function(_0x2a545b){if(_0x2a545b){return _0x44abe3[_0x5adb('0x17')](_0x5c929a)[_0x5adb('0x19')](_0x2a545b);}};}function respondWithFilteredResult(_0x5263ec,_0x2312de){return function(_0x518823){if(_0x518823){var _0x367d82=_0x518823[_0x5adb('0x1a')],_0x42a482=_0x2312de[_0x5adb('0x1b')],_0x30614e=_0x2312de[_0x5adb('0x1b')]+_0x2312de[_0x5adb('0x1c')],_0x304784;if(_0x30614e>=_0x367d82){_0x30614e=_0x367d82;_0x304784=0xc8;}else{_0x304784=0xce;}_0x5263ec[_0x5adb('0x17')](_0x304784);return _0x5263ec['set'](_0x5adb('0x1d'),_0x42a482+'-'+_0x30614e+'/'+_0x367d82)['json'](_0x518823);}return null;};}function patchUpdates(_0x1d9e86){return function(_0x558f76){try{jsonpatch[_0x5adb('0x1e')](_0x558f76,_0x1d9e86,!![]);}catch(_0x50e84f){return BPromise['reject'](_0x50e84f);}return _0x558f76[_0x5adb('0x1f')]();};}function saveUpdates(_0x1bed20,_0x438671){return function(_0x1fd4a7){if(_0x1fd4a7){return _0x1fd4a7[_0x5adb('0x20')](_0x1bed20)['then'](function(_0x3255b3){return _0x3255b3;});}return null;};}function removeEntity(_0x5c296e,_0x4e9f16){return function(_0x3754cc){if(_0x3754cc){return _0x3754cc[_0x5adb('0x21')]()[_0x5adb('0x22')](function(){_0x5c296e[_0x5adb('0x17')](0xcc)[_0x5adb('0x18')]();});}};}function handleEntityNotFound(_0x413911,_0xfd9bb9){return function(_0x4ca150){if(!_0x4ca150){_0x413911[_0x5adb('0x23')](0x194);}return _0x4ca150;};}function handleError(_0x373cc3,_0x3220cd){_0x3220cd=_0x3220cd||0x1f4;return function(_0x3839fb){logger[_0x5adb('0x24')](_0x3839fb['stack']);if(_0x3839fb[_0x5adb('0x25')]){delete _0x3839fb[_0x5adb('0x25')];}_0x373cc3['status'](_0x3220cd)[_0x5adb('0x26')](_0x3839fb);};}exports[_0x5adb('0x27')]=function(_0x1a0acd,_0x55b40a){var _0x13ad1d={},_0xbe21b1={},_0x3a4fca={'count':0x0,'rows':[]};var _0x2c64a3=db[_0x5adb('0x28')][_0x5adb('0x29')];_0xbe21b1['model']=_['keys'](_0x2c64a3);_0xbe21b1['query']=_[_0x5adb('0x2a')](_0x1a0acd[_0x5adb('0x2b')]);_0xbe21b1[_0x5adb('0x2c')]=_[_0x5adb('0x2d')](_0xbe21b1[_0x5adb('0x2e')],_0xbe21b1['query']);_0x13ad1d[_0x5adb('0x2f')]=_[_0x5adb('0x2d')](_0xbe21b1[_0x5adb('0x2e')],qs[_0x5adb('0x30')](_0x1a0acd[_0x5adb('0x2b')][_0x5adb('0x30')]));_0x13ad1d[_0x5adb('0x2f')]=_0x13ad1d[_0x5adb('0x2f')][_0x5adb('0x31')]?_0x13ad1d[_0x5adb('0x2f')]:_0xbe21b1['model'];if(!_0x1a0acd[_0x5adb('0x2b')]['hasOwnProperty'](_0x5adb('0x32'))){_0x13ad1d[_0x5adb('0x1c')]=qs['limit'](_0x1a0acd[_0x5adb('0x2b')][_0x5adb('0x1c')]);_0x13ad1d[_0x5adb('0x1b')]=qs['offset'](_0x1a0acd[_0x5adb('0x2b')][_0x5adb('0x1b')]);}_0x13ad1d['order']=qs['sort'](_0x1a0acd[_0x5adb('0x2b')]['sort']);_0x13ad1d[_0x5adb('0x33')]=qs[_0x5adb('0x2c')](_[_0x5adb('0x34')](_0x1a0acd[_0x5adb('0x2b')],_0xbe21b1[_0x5adb('0x2c')]));if(_0x1a0acd['query'][_0x5adb('0x35')]){_0x13ad1d[_0x5adb('0x33')]=_[_0x5adb('0x36')](_0x13ad1d['where'],{'$or':_['map'](_0x2c64a3,function(_0x32eb69){if(_0x32eb69[_0x5adb('0x37')]['key']!==_0x5adb('0x38')){var _0x4a4260={};_0x4a4260[_0x32eb69[_0x5adb('0x39')]]={'$like':'%'+_0x1a0acd['query'][_0x5adb('0x35')]+'%'};return _0x4a4260;}})});}_0x13ad1d=_['merge']({},_0x13ad1d,_0x1a0acd[_0x5adb('0x3a')]);var _0x23a1db={'where':_0x13ad1d['where']};return db[_0x5adb('0x28')]['count'](_0x23a1db)[_0x5adb('0x22')](function(_0x34e828){_0x3a4fca[_0x5adb('0x1a')]=_0x34e828;if(_0x1a0acd['query'][_0x5adb('0x3b')]){_0x13ad1d[_0x5adb('0x3c')]=[{'all':!![]}];}return db[_0x5adb('0x28')][_0x5adb('0x3d')](_0x13ad1d);})[_0x5adb('0x22')](function(_0x52d74f){_0x3a4fca['rows']=_0x52d74f;return _0x3a4fca;})['then'](respondWithFilteredResult(_0x55b40a,_0x13ad1d))['catch'](handleError(_0x55b40a,null));};exports[_0x5adb('0x3e')]=function(_0x2fbe14,_0x3a104a){var _0x399489={'raw':![],'where':{'id':_0x2fbe14[_0x5adb('0x3f')]['id']}},_0x130e18={};_0x130e18[_0x5adb('0x2e')]=_[_0x5adb('0x2a')](db['UserProfileSection']['rawAttributes']);_0x130e18[_0x5adb('0x2b')]=_['keys'](_0x2fbe14[_0x5adb('0x2b')]);_0x130e18[_0x5adb('0x2c')]=_[_0x5adb('0x2d')](_0x130e18[_0x5adb('0x2e')],_0x130e18[_0x5adb('0x2b')]);_0x399489['attributes']=_[_0x5adb('0x2d')](_0x130e18[_0x5adb('0x2e')],qs['fields'](_0x2fbe14[_0x5adb('0x2b')][_0x5adb('0x30')]));_0x399489['attributes']=_0x399489[_0x5adb('0x2f')][_0x5adb('0x31')]?_0x399489[_0x5adb('0x2f')]:_0x130e18[_0x5adb('0x2e')];if(_0x2fbe14[_0x5adb('0x2b')][_0x5adb('0x3b')]){_0x399489[_0x5adb('0x3c')]=[{'all':!![]}];}_0x399489=_['merge']({},_0x399489,_0x2fbe14['options']);return db[_0x5adb('0x28')][_0x5adb('0x40')](_0x399489)[_0x5adb('0x22')](handleEntityNotFound(_0x3a104a,null))[_0x5adb('0x22')](respondWithResult(_0x3a104a,null))['catch'](handleError(_0x3a104a,null));};exports['create']=function(_0xaa32e4,_0x4d7d86){return db[_0x5adb('0x28')][_0x5adb('0x41')](_0xaa32e4[_0x5adb('0x42')],{})['then'](respondWithResult(_0x4d7d86,0xc9))[_0x5adb('0x43')](handleError(_0x4d7d86,null));};exports[_0x5adb('0x20')]=function(_0x5b574c,_0x7786c4){if(_0x5b574c[_0x5adb('0x42')]['id']){delete _0x5b574c[_0x5adb('0x42')]['id'];}return db[_0x5adb('0x28')][_0x5adb('0x40')]({'where':{'id':_0x5b574c[_0x5adb('0x3f')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x7786c4,null))[_0x5adb('0x22')](saveUpdates(_0x5b574c['body'],null))[_0x5adb('0x22')](respondWithResult(_0x7786c4,null))['catch'](handleError(_0x7786c4,null));};exports['destroy']=function(_0x5015ee,_0x3cd211){return db[_0x5adb('0x28')][_0x5adb('0x40')]({'where':{'id':_0x5015ee['params']['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x3cd211,null))['then'](removeEntity(_0x3cd211,null))[_0x5adb('0x43')](handleError(_0x3cd211,null));};exports[_0x5adb('0x44')]=function(_0x3f9dc7,_0x541537){return db[_0x5adb('0x28')]['describe']()[_0x5adb('0x22')](respondWithResult(_0x541537,null))[_0x5adb('0x43')](handleError(_0x541537,null));}; \ No newline at end of file +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(_0x1fe5f5,_0x171ac6){var _0x4b6d9d=function(_0x247f88){while(--_0x247f88){_0x1fe5f5['push'](_0x1fe5f5['shift']());}};_0x4b6d9d(++_0x171ac6);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3b1106,_0x4bd523){_0x3b1106=_0x3b1106-0x0;var _0x1fbeef=_0x0b0e[_0x3b1106];return _0x1fbeef;};'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 diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index d085db0..3d17bb5 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 _0x086d=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId'];(function(_0x11b58d,_0x555c55){var _0xc2811b=function(_0x396d22){while(--_0x396d22){_0x11b58d['push'](_0x11b58d['shift']());}};_0xc2811b(++_0x555c55);}(_0x086d,0xb4));var _0xd086=function(_0x155c2e,_0x4092ed){_0x155c2e=_0x155c2e-0x0;var _0x11b6aa=_0x086d[_0x155c2e];return _0x11b6aa;};'use strict';var _=require(_0xd086('0x0'));var util=require(_0xd086('0x1'));var logger=require(_0xd086('0x2'))(_0xd086('0x3'));var moment=require(_0xd086('0x4'));var BPromise=require(_0xd086('0x5'));var rp=require(_0xd086('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd086('0x7'));module[_0xd086('0x8')]=function(_0x3f0e90,_0x205149){return _0x3f0e90[_0xd086('0x9')](_0xd086('0xa'),attributes,{'tableName':_0xd086('0xb'),'paranoid':![],'indexes':[{'name':_0xd086('0xc'),'fields':[_0xd086('0xd'),_0xd086('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xeed7=['rimraf','./userProfileSection.attributes','exports','define','UserProfileSection','sectionId','userProfileId','../../config/logger','api','bluebird','request-promise','path'];(function(_0x2f1e81,_0x477b1c){var _0x513078=function(_0x3d8f8e){while(--_0x3d8f8e){_0x2f1e81['push'](_0x2f1e81['shift']());}};_0x513078(++_0x477b1c);}(_0xeed7,0xdf));var _0x7eed=function(_0x4d8d6e,_0x10a9cb){_0x4d8d6e=_0x4d8d6e-0x0;var _0xa450af=_0xeed7[_0x4d8d6e];return _0xa450af;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7eed('0x0'))(_0x7eed('0x1'));var moment=require('moment');var BPromise=require(_0x7eed('0x2'));var rp=require(_0x7eed('0x3'));var fs=require('fs');var path=require(_0x7eed('0x4'));var rimraf=require(_0x7eed('0x5'));var config=require('../../config/environment');var attributes=require(_0x7eed('0x6'));module[_0x7eed('0x7')]=function(_0x5975af,_0x307a00){return _0x5975af[_0x7eed('0x8')](_0x7eed('0x9'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x7eed('0xa'),_0x7eed('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index d707cfc..5273720 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 _0xc324=['catch','lodash','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','client','http','then','UserProfileSection,\x20%s,\x20%s','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result'];(function(_0x3ecde9,_0x5c25e3){var _0x3de770=function(_0x512264){while(--_0x512264){_0x3ecde9['push'](_0x3ecde9['shift']());}};_0x3de770(++_0x5c25e3);}(_0xc324,0x1c9));var _0x4c32=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc324[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x4c32('0x0'));var util=require(_0x4c32('0x1'));var moment=require('moment');var BPromise=require(_0x4c32('0x2'));var rs=require(_0x4c32('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4c32('0x4'));var logger=require('../../config/logger')(_0x4c32('0x5'));var config=require(_0x4c32('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4c32('0x7')][_0x4c32('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2b473b,_0x76c77f,_0x2f90ea){return new BPromise(function(_0xd9e001,_0x222a11){return client['request'](_0x2b473b,_0x2f90ea)[_0x4c32('0x9')](function(_0x5ac3d2){logger['info'](_0x4c32('0xa'),_0x76c77f,'request\x20sent');logger[_0x4c32('0xb')](_0x4c32('0xc'),_0x76c77f,_0x4c32('0xd'),JSON['stringify'](_0x5ac3d2));if(_0x5ac3d2['error']){if(_0x5ac3d2['error']['code']===0x1f4){logger['error'](_0x4c32('0xa'),_0x76c77f,_0x5ac3d2[_0x4c32('0xe')][_0x4c32('0xf')]);return _0x222a11(_0x5ac3d2['error'][_0x4c32('0xf')]);}logger[_0x4c32('0xe')]('UserProfileSection,\x20%s,\x20%s',_0x76c77f,_0x5ac3d2[_0x4c32('0xe')][_0x4c32('0xf')]);return _0xd9e001(_0x5ac3d2[_0x4c32('0xe')]['message']);}else{logger[_0x4c32('0x10')](_0x4c32('0xa'),_0x76c77f,_0x4c32('0xd'));_0xd9e001(_0x5ac3d2[_0x4c32('0x11')][_0x4c32('0xf')]);}})[_0x4c32('0x12')](function(_0x4da7bd){logger['error'](_0x4c32('0xa'),_0x76c77f,_0x4da7bd);_0x222a11(_0x4da7bd);});});} \ No newline at end of file +var _0x2d8b=['http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','message','result','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x2d8b,0x13b));var _0xb2d8=function(_0x1090a9,_0x55ae97){_0x1090a9=_0x1090a9-0x0;var _0x277e95=_0x2d8b[_0x1090a9];return _0x277e95;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xb2d8('0x0'));var rs=require(_0xb2d8('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb2d8('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xb2d8('0x3'))(_0xb2d8('0x4'));var config=require(_0xb2d8('0x5'));var jayson=require(_0xb2d8('0x6'));var client=jayson[_0xb2d8('0x7')][_0xb2d8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xf4afa8,_0x185c70,_0x55da90){return new BPromise(function(_0x2ea2d1,_0x4e12e8){return client[_0xb2d8('0x9')](_0xf4afa8,_0x55da90)[_0xb2d8('0xa')](function(_0x46926c){logger[_0xb2d8('0xb')](_0xb2d8('0xc'),_0x185c70,_0xb2d8('0xd'));logger['debug'](_0xb2d8('0xe'),_0x185c70,_0xb2d8('0xd'),JSON[_0xb2d8('0xf')](_0x46926c));if(_0x46926c['error']){if(_0x46926c[_0xb2d8('0x10')]['code']===0x1f4){logger[_0xb2d8('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x185c70,_0x46926c[_0xb2d8('0x10')]['message']);return _0x4e12e8(_0x46926c[_0xb2d8('0x10')]['message']);}logger['error']('UserProfileSection,\x20%s,\x20%s',_0x185c70,_0x46926c[_0xb2d8('0x10')][_0xb2d8('0x11')]);return _0x2ea2d1(_0x46926c[_0xb2d8('0x10')][_0xb2d8('0x11')]);}else{logger[_0xb2d8('0xb')](_0xb2d8('0xc'),_0x185c70,_0xb2d8('0xd'));_0x2ea2d1(_0x46926c[_0xb2d8('0x12')]['message']);}})['catch'](function(_0x68ae29){logger[_0xb2d8('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x185c70,_0x68ae29);_0x4e12e8(_0x68ae29);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index a63e184..31e3475 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 _0x7bd0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x12fbb6,_0x2edea8){var _0x7436a2=function(_0x46cbf0){while(--_0x46cbf0){_0x12fbb6['push'](_0x12fbb6['shift']());}};_0x7436a2(++_0x2edea8);}(_0x7bd0,0x111));var _0x07bd=function(_0x4812e0,_0x2ccf3c){_0x4812e0=_0x4812e0-0x0;var _0x252e0f=_0x7bd0[_0x4812e0];return _0x252e0f;};'use strict';var multer=require(_0x07bd('0x0'));var util=require(_0x07bd('0x1'));var path=require(_0x07bd('0x2'));var timeout=require(_0x07bd('0x3'));var express=require(_0x07bd('0x4'));var router=express[_0x07bd('0x5')]();var auth=require(_0x07bd('0x6'));var interaction=require(_0x07bd('0x7'));var config=require('../../config/environment');module[_0x07bd('0x8')]=router; \ No newline at end of file +var _0x7412=['connect-timeout','Router','multer'];(function(_0x12503a,_0x5036d9){var _0x85c500=function(_0xea3319){while(--_0xea3319){_0x12503a['push'](_0x12503a['shift']());}};_0x85c500(++_0x5036d9);}(_0x7412,0x161));var _0x2741=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x7412[_0x38537f];return _0x141e23;};'use strict';var multer=require(_0x2741('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2741('0x1'));var express=require('express');var router=express[_0x2741('0x2')]();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 diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index e2d9ae4..dc7ac84 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 _0xd532=['exports'];(function(_0x17eca6,_0x2fe44c){var _0x42db1e=function(_0x31614d){while(--_0x31614d){_0x17eca6['push'](_0x17eca6['shift']());}};_0x42db1e(++_0x2fe44c);}(_0xd532,0x140));var _0x2d53=function(_0x2b4bd9,_0x23b7d4){_0x2b4bd9=_0x2b4bd9-0x0;var _0x101080=_0xd532[_0x2b4bd9];return _0x101080;};'use strict';var Sequelize=require('sequelize');module[_0x2d53('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x91f2=['sequelize','exports','INTEGER'];(function(_0x1b852e,_0x185f0d){var _0x2fd5cf=function(_0x1dc638){while(--_0x1dc638){_0x1b852e['push'](_0x1b852e['shift']());}};_0x2fd5cf(++_0x185f0d);}(_0x91f2,0x1bf));var _0x291f=function(_0x4c6bf5,_0x4b726d){_0x4c6bf5=_0x4c6bf5-0x0;var _0x268743=_0x91f2[_0x4c6bf5];return _0x268743;};'use strict';var Sequelize=require(_0x291f('0x0'));module[_0x291f('0x1')]={'penalty':{'type':Sequelize[_0x291f('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 7ba60a6..e925a59 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 _0xf90c=['../../config/environment','./userSmsQueue.attributes','exports','define','user_has_sms_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1cdeb1,_0x34027a){var _0x507968=function(_0x30d671){while(--_0x30d671){_0x1cdeb1['push'](_0x1cdeb1['shift']());}};_0x507968(++_0x34027a);}(_0xf90c,0x1a9));var _0xcf90=function(_0x4a19a3,_0x4c4d09){_0x4a19a3=_0x4a19a3-0x0;var _0x279539=_0xf90c[_0x4a19a3];return _0x279539;};'use strict';var _=require(_0xcf90('0x0'));var util=require(_0xcf90('0x1'));var logger=require(_0xcf90('0x2'))(_0xcf90('0x3'));var moment=require(_0xcf90('0x4'));var BPromise=require(_0xcf90('0x5'));var rp=require(_0xcf90('0x6'));var fs=require('fs');var path=require(_0xcf90('0x7'));var rimraf=require(_0xcf90('0x8'));var config=require(_0xcf90('0x9'));var attributes=require(_0xcf90('0xa'));module[_0xcf90('0xb')]=function(_0x311285,_0x4ee42f){return _0x311285[_0xcf90('0xc')]('UserSmsQueue',attributes,{'tableName':_0xcf90('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6337=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','UserSmsQueue','util','../../config/logger'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x6337,0x18a));var _0x7633=function(_0x586b8e,_0x59934d){_0x586b8e=_0x586b8e-0x0;var _0x4af9ea=_0x6337[_0x586b8e];return _0x4af9ea;};'use strict';var _=require('lodash');var util=require(_0x7633('0x0'));var logger=require(_0x7633('0x1'))(_0x7633('0x2'));var moment=require(_0x7633('0x3'));var BPromise=require(_0x7633('0x4'));var rp=require(_0x7633('0x5'));var fs=require('fs');var path=require(_0x7633('0x6'));var rimraf=require(_0x7633('0x7'));var config=require(_0x7633('0x8'));var attributes=require('./userSmsQueue.attributes');module[_0x7633('0x9')]=function(_0x27e596,_0x470054){return _0x27e596['define'](_0x7633('0xa'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index 4c11996..55e9956 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 _0xa622=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','catch','lodash'];(function(_0x3ea913,_0x255df2){var _0x2b4f28=function(_0x48bb25){while(--_0x48bb25){_0x3ea913['push'](_0x3ea913['shift']());}};_0x2b4f28(++_0x255df2);}(_0xa622,0x1e3));var _0x2a62=function(_0x371c28,_0x39799b){_0x371c28=_0x371c28-0x0;var _0x581522=_0xa622[_0x371c28];return _0x581522;};'use strict';var _=require(_0x2a62('0x0'));var util=require(_0x2a62('0x1'));var moment=require('moment');var BPromise=require(_0x2a62('0x2'));var rs=require(_0x2a62('0x3'));var fs=require('fs');var Redis=require(_0x2a62('0x4'));var db=require(_0x2a62('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2a62('0x6'))(_0x2a62('0x7'));var config=require(_0x2a62('0x8'));var jayson=require(_0x2a62('0x9'));var client=jayson[_0x2a62('0xa')][_0x2a62('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x41b95a,_0x193168,_0x5891ce){return new BPromise(function(_0xd7391,_0x435530){return client[_0x2a62('0xc')](_0x41b95a,_0x5891ce)[_0x2a62('0xd')](function(_0x3c9a86){logger['info'](_0x2a62('0xe'),_0x193168,_0x2a62('0xf'));logger[_0x2a62('0x10')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x193168,_0x2a62('0xf'),JSON['stringify'](_0x3c9a86));if(_0x3c9a86[_0x2a62('0x11')]){if(_0x3c9a86[_0x2a62('0x11')]['code']===0x1f4){logger[_0x2a62('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x193168,_0x3c9a86[_0x2a62('0x11')]['message']);return _0x435530(_0x3c9a86[_0x2a62('0x11')][_0x2a62('0x12')]);}logger[_0x2a62('0x11')](_0x2a62('0xe'),_0x193168,_0x3c9a86[_0x2a62('0x11')]['message']);return _0xd7391(_0x3c9a86[_0x2a62('0x11')][_0x2a62('0x12')]);}else{logger[_0x2a62('0x13')](_0x2a62('0xe'),_0x193168,'request\x20sent');_0xd7391(_0x3c9a86[_0x2a62('0x14')][_0x2a62('0x12')]);}})[_0x2a62('0x15')](function(_0x41a940){logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x193168,_0x41a940);_0x435530(_0x41a940);});});} \ No newline at end of file +var _0x1081=['message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','client','http','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3f1ce4,_0x10ec60){var _0x5d96a9=function(_0x467e29){while(--_0x467e29){_0x3f1ce4['push'](_0x3f1ce4['shift']());}};_0x5d96a9(++_0x10ec60);}(_0x1081,0x1b2));var _0x1108=function(_0x213ad4,_0x4dbe95){_0x213ad4=_0x213ad4-0x0;var _0x50211b=_0x1081[_0x213ad4];return _0x50211b;};'use strict';var _=require(_0x1108('0x0'));var util=require(_0x1108('0x1'));var moment=require(_0x1108('0x2'));var BPromise=require('bluebird');var rs=require(_0x1108('0x3'));var fs=require('fs');var Redis=require(_0x1108('0x4'));var db=require(_0x1108('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1108('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1108('0x7')][_0x1108('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5e2828,_0x5c1e5a,_0x576114){return new BPromise(function(_0x35da6c,_0x128b95){return client['request'](_0x5e2828,_0x576114)[_0x1108('0x9')](function(_0x572857){logger[_0x1108('0xa')](_0x1108('0xb'),_0x5c1e5a,_0x1108('0xc'));logger['debug'](_0x1108('0xd'),_0x5c1e5a,_0x1108('0xc'),JSON[_0x1108('0xe')](_0x572857));if(_0x572857[_0x1108('0xf')]){if(_0x572857[_0x1108('0xf')]['code']===0x1f4){logger[_0x1108('0xf')](_0x1108('0xb'),_0x5c1e5a,_0x572857['error'][_0x1108('0x10')]);return _0x128b95(_0x572857['error'][_0x1108('0x10')]);}logger[_0x1108('0xf')]('UserSmsQueue,\x20%s,\x20%s',_0x5c1e5a,_0x572857['error'][_0x1108('0x10')]);return _0x35da6c(_0x572857['error']['message']);}else{logger[_0x1108('0xa')](_0x1108('0xb'),_0x5c1e5a,'request\x20sent');_0x35da6c(_0x572857['result'][_0x1108('0x10')]);}})[_0x1108('0x11')](function(_0x5968f6){logger['error'](_0x1108('0xb'),_0x5c1e5a,_0x5968f6);_0x128b95(_0x5968f6);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index b59d2ab..703487d 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 _0x7923=['util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','multer'];(function(_0x37a7c6,_0x3a84b6){var _0x539905=function(_0xa00c20){while(--_0xa00c20){_0x37a7c6['push'](_0x37a7c6['shift']());}};_0x539905(++_0x3a84b6);}(_0x7923,0x8f));var _0x3792=function(_0x253ff3,_0x4e0518){_0x253ff3=_0x253ff3-0x0;var _0x1b5936=_0x7923[_0x253ff3];return _0x1b5936;};'use strict';var multer=require(_0x3792('0x0'));var util=require(_0x3792('0x1'));var path=require(_0x3792('0x2'));var timeout=require(_0x3792('0x3'));var express=require(_0x3792('0x4'));var router=express[_0x3792('0x5')]();var auth=require(_0x3792('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3792('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(_0x1f3c1a,_0x3f0e70){var _0x2761c2=function(_0x325600){while(--_0x325600){_0x1f3c1a['push'](_0x1f3c1a['shift']());}};_0x2761c2(++_0x3f0e70);}(_0xbc48,0x111));var _0x8bc4=function(_0x455bbf,_0x487eb1){_0x455bbf=_0x455bbf-0x0;var _0x31cc6a=_0xbc48[_0x455bbf];return _0x31cc6a;};'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 b17dcce..c13ed3a 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 _0xfe82=['INTEGER','exports'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xfe82,0x117));var _0x2fe8=function(_0x1ae75a,_0x375310){_0x1ae75a=_0x1ae75a-0x0;var _0x7ab4b0=_0xfe82[_0x1ae75a];return _0x7ab4b0;};'use strict';var Sequelize=require('sequelize');module[_0x2fe8('0x0')]={'penalty':{'type':Sequelize[_0x2fe8('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x950a=['sequelize','INTEGER'];(function(_0x4392af,_0xec5afe){var _0x9fa8eb=function(_0x41d7a4){while(--_0x41d7a4){_0x4392af['push'](_0x4392af['shift']());}};_0x9fa8eb(++_0xec5afe);}(_0x950a,0x10a));var _0xa950=function(_0x432d38,_0x201399){_0x432d38=_0x432d38-0x0;var _0x39c577=_0x950a[_0x432d38];return _0x39c577;};'use strict';var Sequelize=require(_0xa950('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xa950('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 97d8847..00043c8 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 _0xb8e1=['UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define'];(function(_0x231962,_0x382414){var _0x40a960=function(_0x5e8708){while(--_0x5e8708){_0x231962['push'](_0x231962['shift']());}};_0x40a960(++_0x382414);}(_0xb8e1,0x84));var _0x1b8e=function(_0x3d3e3b,_0x3067e9){_0x3d3e3b=_0x3d3e3b-0x0;var _0x72f1c5=_0xb8e1[_0x3d3e3b];return _0x72f1c5;};'use strict';var _=require(_0x1b8e('0x0'));var util=require(_0x1b8e('0x1'));var logger=require(_0x1b8e('0x2'))(_0x1b8e('0x3'));var moment=require(_0x1b8e('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1b8e('0x5'));var rimraf=require(_0x1b8e('0x6'));var config=require(_0x1b8e('0x7'));var attributes=require(_0x1b8e('0x8'));module[_0x1b8e('0x9')]=function(_0x45aa6f,_0x3842ce){return _0x45aa6f[_0x1b8e('0xa')](_0x1b8e('0xb'),attributes,{'tableName':_0x1b8e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc588=['bluebird','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','lodash','util','../../config/logger','api','moment'];(function(_0x1705bb,_0x16b47c){var _0x3ce402=function(_0x285dcb){while(--_0x285dcb){_0x1705bb['push'](_0x1705bb['shift']());}};_0x3ce402(++_0x16b47c);}(_0xc588,0x140));var _0x8c58=function(_0x18ac3f,_0x386630){_0x18ac3f=_0x18ac3f-0x0;var _0x4c6563=_0xc588[_0x18ac3f];return _0x4c6563;};'use strict';var _=require(_0x8c58('0x0'));var util=require(_0x8c58('0x1'));var logger=require(_0x8c58('0x2'))(_0x8c58('0x3'));var moment=require(_0x8c58('0x4'));var BPromise=require(_0x8c58('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8c58('0x6'));var rimraf=require(_0x8c58('0x7'));var config=require(_0x8c58('0x8'));var attributes=require(_0x8c58('0x9'));module[_0x8c58('0xa')]=function(_0x882a01,_0x54bbbf){return _0x882a01[_0x8c58('0xb')](_0x8c58('0xc'),attributes,{'tableName':'user_has_voice_queues','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 e30bd76..8b5c940 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 _0xf37d=['UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\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','client','http','request','then','info'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xf37d,0x14e));var _0xdf37=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0xf37d[_0x5ddaac];return _0x2a9c58;};'use strict';var _=require(_0xdf37('0x0'));var util=require(_0xdf37('0x1'));var moment=require(_0xdf37('0x2'));var BPromise=require(_0xdf37('0x3'));var rs=require(_0xdf37('0x4'));var fs=require('fs');var Redis=require(_0xdf37('0x5'));var db=require(_0xdf37('0x6'))['db'];var utils=require(_0xdf37('0x7'));var logger=require(_0xdf37('0x8'))(_0xdf37('0x9'));var config=require(_0xdf37('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xdf37('0xb')][_0xdf37('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xda591e,_0x53e542,_0x85d066){return new BPromise(function(_0x4e3808,_0x1f3efc){return client[_0xdf37('0xd')](_0xda591e,_0x85d066)[_0xdf37('0xe')](function(_0x44762e){logger[_0xdf37('0xf')](_0xdf37('0x10'),_0x53e542,_0xdf37('0x11'));logger[_0xdf37('0x12')](_0xdf37('0x13'),_0x53e542,_0xdf37('0x11'),JSON[_0xdf37('0x14')](_0x44762e));if(_0x44762e['error']){if(_0x44762e[_0xdf37('0x15')][_0xdf37('0x16')]===0x1f4){logger[_0xdf37('0x15')]('UserVoiceQueue,\x20%s,\x20%s',_0x53e542,_0x44762e['error'][_0xdf37('0x17')]);return _0x1f3efc(_0x44762e[_0xdf37('0x15')][_0xdf37('0x17')]);}logger[_0xdf37('0x15')](_0xdf37('0x10'),_0x53e542,_0x44762e[_0xdf37('0x15')][_0xdf37('0x17')]);return _0x4e3808(_0x44762e[_0xdf37('0x15')][_0xdf37('0x17')]);}else{logger[_0xdf37('0xf')](_0xdf37('0x10'),_0x53e542,'request\x20sent');_0x4e3808(_0x44762e[_0xdf37('0x18')]['message']);}})['catch'](function(_0x380047){logger[_0xdf37('0x15')](_0xdf37('0x10'),_0x53e542,_0x380047);_0x1f3efc(_0x380047);});});} \ No newline at end of file +var _0x24f9=['UserVoiceQueue,\x20%s,\x20%s','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info'];(function(_0x5b8b97,_0x6b4dfa){var _0x1fdf84=function(_0x2ced4c){while(--_0x2ced4c){_0x5b8b97['push'](_0x5b8b97['shift']());}};_0x1fdf84(++_0x6b4dfa);}(_0x24f9,0x15d));var _0x924f=function(_0x29107d,_0x1cdbf9){_0x29107d=_0x29107d-0x0;var _0x3b2d1d=_0x24f9[_0x29107d];return _0x3b2d1d;};'use strict';var _=require('lodash');var util=require(_0x924f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x924f('0x1'));var fs=require('fs');var Redis=require(_0x924f('0x2'));var db=require(_0x924f('0x3'))['db'];var utils=require(_0x924f('0x4'));var logger=require(_0x924f('0x5'))('rpc');var config=require(_0x924f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x924f('0x7')][_0x924f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1aea5d,_0x545000,_0xd38390){return new BPromise(function(_0x1fd466,_0x43a5b5){return client[_0x924f('0x9')](_0x1aea5d,_0xd38390)['then'](function(_0x31ea0f){logger[_0x924f('0xa')](_0x924f('0xb'),_0x545000,_0x924f('0xc'));logger['debug'](_0x924f('0xd'),_0x545000,_0x924f('0xc'),JSON[_0x924f('0xe')](_0x31ea0f));if(_0x31ea0f['error']){if(_0x31ea0f[_0x924f('0xf')][_0x924f('0x10')]===0x1f4){logger[_0x924f('0xf')](_0x924f('0xb'),_0x545000,_0x31ea0f[_0x924f('0xf')]['message']);return _0x43a5b5(_0x31ea0f['error']['message']);}logger[_0x924f('0xf')](_0x924f('0xb'),_0x545000,_0x31ea0f[_0x924f('0xf')]['message']);return _0x1fd466(_0x31ea0f[_0x924f('0xf')][_0x924f('0x11')]);}else{logger[_0x924f('0xa')](_0x924f('0xb'),_0x545000,_0x924f('0xc'));_0x1fd466(_0x31ea0f['result']['message']);}})['catch'](function(_0x2aef99){logger[_0x924f('0xf')](_0x924f('0xb'),_0x545000,_0x2aef99);_0x43a5b5(_0x2aef99);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 6dbea86..53b0e2d 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 _0x0650=['util','path','connect-timeout','Router','../../config/environment','exports','multer'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x0650,0x1aa));var _0x0065=function(_0x4ec3ab,_0x50a5de){_0x4ec3ab=_0x4ec3ab-0x0;var _0x229613=_0x0650[_0x4ec3ab];return _0x229613;};'use strict';var multer=require(_0x0065('0x0'));var util=require(_0x0065('0x1'));var path=require(_0x0065('0x2'));var timeout=require(_0x0065('0x3'));var express=require('express');var router=express[_0x0065('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0065('0x5'));module[_0x0065('0x6')]=router; \ No newline at end of file +var _0x814b=['Router','../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout','express'];(function(_0x41c466,_0x3af094){var _0x3dce82=function(_0x34b541){while(--_0x34b541){_0x41c466['push'](_0x41c466['shift']());}};_0x3dce82(++_0x3af094);}(_0x814b,0x1a2));var _0xb814=function(_0x584291,_0x24b5b3){_0x584291=_0x584291-0x0;var _0x4e7d08=_0x814b[_0x584291];return _0x4e7d08;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xb814('0x6'));var config=require(_0xb814('0x7'));module[_0xb814('0x8')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 69cb662..a6cea1a 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 _0xa7cf=['Required\x20by\x20Asterisk','STRING','queue_interface','exports','INTEGER'];(function(_0x101a0d,_0x22c2d8){var _0x45b1f1=function(_0x53028d){while(--_0x53028d){_0x101a0d['push'](_0x101a0d['shift']());}};_0x45b1f1(++_0x22c2d8);}(_0xa7cf,0xe4));var _0xfa7c=function(_0x5b5cde,_0x1f7c5f){_0x5b5cde=_0x5b5cde-0x0;var _0x364ad2=_0xa7cf[_0x5b5cde];return _0x364ad2;};'use strict';var Sequelize=require('sequelize');module[_0xfa7c('0x0')]={'uniqueid':{'type':Sequelize[_0xfa7c('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0xfa7c('0x2')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0xfa7c('0x3')],'allowNull':![],'unique':_0xfa7c('0x4'),'comment':_0xfa7c('0x2')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0xfa7c('0x3')],'allowNull':![],'unique':_0xfa7c('0x4'),'comment':_0xfa7c('0x2')},'penalty':{'type':Sequelize[_0xfa7c('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0xfa7c('0x1')](0xb),'defaultValue':0x0,'comment':_0xfa7c('0x2')}}; \ No newline at end of file +var _0x45da=['INTEGER','Required\x20by\x20Asterisk','queue_interface','sequelize','exports'];(function(_0x35ae74,_0x548aba){var _0x252ff3=function(_0x3f5de6){while(--_0x3f5de6){_0x35ae74['push'](_0x35ae74['shift']());}};_0x252ff3(++_0x548aba);}(_0x45da,0x175));var _0xa45d=function(_0x36e001,_0x448946){_0x36e001=_0x36e001-0x0;var _0x4988b0=_0x45da[_0x36e001];return _0x4988b0;};'use strict';var Sequelize=require(_0xa45d('0x0'));module[_0xa45d('0x1')]={'uniqueid':{'type':Sequelize[_0xa45d('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xa45d('0x3')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0xa45d('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xa45d('0x4'),'comment':_0xa45d('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':_0xa45d('0x3')},'penalty':{'type':Sequelize[_0xa45d('0x2')](0xb),'defaultValue':0x0,'comment':_0xa45d('0x3')},'paused':{'type':Sequelize[_0xa45d('0x2')](0xb),'defaultValue':0x0,'comment':_0xa45d('0x3')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 451b884..6a18d4a 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 _0x087b=['hook','exports','events','../../mysqldb','save','remove','emit','hasOwnProperty'];(function(_0x3f81b3,_0x2719de){var _0x25099f=function(_0x11a23c){while(--_0x11a23c){_0x3f81b3['push'](_0x3f81b3['shift']());}};_0x25099f(++_0x2719de);}(_0x087b,0x11a));var _0xb087=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x087b[_0x57b54c];return _0x59cc19;};'use strict';var EventEmitter=require(_0xb087('0x0'));var UserVoiceQueueRt=require(_0xb087('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb087('0x2'),'afterUpdate':'update','afterDestroy':_0xb087('0x3')};function emitEvent(_0x2020b7){return function(_0x1d3299,_0xf1cf84,_0x183efd){UserVoiceQueueRtEvents[_0xb087('0x4')](_0x2020b7+':'+_0x1d3299['id'],_0x1d3299);UserVoiceQueueRtEvents[_0xb087('0x4')](_0x2020b7,_0x1d3299);_0x183efd(null);};}for(var e in events){if(events[_0xb087('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0xb087('0x6')](e,emitEvent(event));}}module[_0xb087('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x14a0=['setMaxListeners','save','update','remove','emit','exports','../../mysqldb','UserVoiceQueueRt'];(function(_0x1f3953,_0x507219){var _0x5f0e26=function(_0x485c8d){while(--_0x485c8d){_0x1f3953['push'](_0x1f3953['shift']());}};_0x5f0e26(++_0x507219);}(_0x14a0,0x8e));var _0x014a=function(_0x4fb347,_0x2d0332){_0x4fb347=_0x4fb347-0x0;var _0x33ed2f=_0x14a0[_0x4fb347];return _0x33ed2f;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x014a('0x0'))['db'][_0x014a('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x014a('0x2')](0x0);var events={'afterCreate':_0x014a('0x3'),'afterUpdate':_0x014a('0x4'),'afterDestroy':_0x014a('0x5')};function emitEvent(_0xb2d36a){return function(_0x521a59,_0x57a522,_0x1730a5){UserVoiceQueueRtEvents[_0x014a('0x6')](_0xb2d36a+':'+_0x521a59['id'],_0x521a59);UserVoiceQueueRtEvents[_0x014a('0x6')](_0xb2d36a,_0x521a59);_0x1730a5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x014a('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index c8829f9..2a41b2f 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 _0x9e0c=['util','api','bluebird','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','define','user_has_voice_queues_rt'];(function(_0x2571e7,_0x239007){var _0x47cfcf=function(_0x4e3a6a){while(--_0x4e3a6a){_0x2571e7['push'](_0x2571e7['shift']());}};_0x47cfcf(++_0x239007);}(_0x9e0c,0x1e6));var _0xc9e0=function(_0x35203d,_0x291c59){_0x35203d=_0x35203d-0x0;var _0x1e6d98=_0x9e0c[_0x35203d];return _0x1e6d98;};'use strict';var _=require('lodash');var util=require(_0xc9e0('0x0'));var logger=require('../../config/logger')(_0xc9e0('0x1'));var moment=require('moment');var BPromise=require(_0xc9e0('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc9e0('0x3'));var rimraf=require(_0xc9e0('0x4'));var config=require(_0xc9e0('0x5'));var attributes=require(_0xc9e0('0x6'));module['exports']=function(_0x5480d6,_0x5e1de8){return _0x5480d6[_0xc9e0('0x7')]('UserVoiceQueueRt',attributes,{'tableName':_0xc9e0('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4a7a=['../../config/environment','UserVoiceQueueRt','user_has_voice_queues_rt','util','../../config/logger','bluebird','request-promise','path'];(function(_0x3b4b1d,_0x15029e){var _0x488c36=function(_0x56c8b3){while(--_0x56c8b3){_0x3b4b1d['push'](_0x3b4b1d['shift']());}};_0x488c36(++_0x15029e);}(_0x4a7a,0x18b));var _0xa4a7=function(_0x59312d,_0x52bb25){_0x59312d=_0x59312d-0x0;var _0x13ca66=_0x4a7a[_0x59312d];return _0x13ca66;};'use strict';var _=require('lodash');var util=require(_0xa4a7('0x0'));var logger=require(_0xa4a7('0x1'))('api');var moment=require('moment');var BPromise=require(_0xa4a7('0x2'));var rp=require(_0xa4a7('0x3'));var fs=require('fs');var path=require(_0xa4a7('0x4'));var rimraf=require('rimraf');var config=require(_0xa4a7('0x5'));var attributes=require('./userVoiceQueueRt.attributes');module['exports']=function(_0x108523,_0x535ddf){return _0x108523['define'](_0xa4a7('0x6'),attributes,{'tableName':_0xa4a7('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 249c67b..509ff58 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 _0x0e8c=['client','http','defaults','redis','socket.io-emitter','register','request','then','info','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','UserVoiceQueueRt,\x20%s,\x20%s','message','catch','GetVoiceQueueRtPauses','findAll','options','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x44105a,_0xd3d69f){var _0x2d3b6d=function(_0x56192e){while(--_0x56192e){_0x44105a['push'](_0x44105a['shift']());}};_0x2d3b6d(++_0xd3d69f);}(_0x0e8c,0x1b3));var _0xc0e8=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x0e8c[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require(_0xc0e8('0x0'));var moment=require('moment');var BPromise=require(_0xc0e8('0x1'));var rs=require(_0xc0e8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc0e8('0x3'))['db'];var utils=require(_0xc0e8('0x4'));var logger=require(_0xc0e8('0x5'))('rpc');var config=require(_0xc0e8('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xc0e8('0x7')][_0xc0e8('0x8')]({'port':0x232a});config['redis']=_[_0xc0e8('0x9')](config[_0xc0e8('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xc0e8('0xb'))(new Redis(config['redis']));require('./userVoiceQueueRt.socket')[_0xc0e8('0xc')](socket);function respondWithRpcPromise(_0x27bb54,_0x34b20a,_0x39cff2){return new BPromise(function(_0x2753c4,_0x1cbd03){return client[_0xc0e8('0xd')](_0x27bb54,_0x39cff2)[_0xc0e8('0xe')](function(_0x4d0b4){logger[_0xc0e8('0xf')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x34b20a,_0xc0e8('0x10'));logger[_0xc0e8('0x11')](_0xc0e8('0x12'),_0x34b20a,_0xc0e8('0x10'),JSON[_0xc0e8('0x13')](_0x4d0b4));if(_0x4d0b4[_0xc0e8('0x14')]){if(_0x4d0b4[_0xc0e8('0x14')][_0xc0e8('0x15')]===0x1f4){logger[_0xc0e8('0x14')](_0xc0e8('0x16'),_0x34b20a,_0x4d0b4[_0xc0e8('0x14')][_0xc0e8('0x17')]);return _0x1cbd03(_0x4d0b4[_0xc0e8('0x14')][_0xc0e8('0x17')]);}logger[_0xc0e8('0x14')](_0xc0e8('0x16'),_0x34b20a,_0x4d0b4['error'][_0xc0e8('0x17')]);return _0x2753c4(_0x4d0b4[_0xc0e8('0x14')][_0xc0e8('0x17')]);}else{logger[_0xc0e8('0xf')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x34b20a,_0xc0e8('0x10'));_0x2753c4(_0x4d0b4['result'][_0xc0e8('0x17')]);}})[_0xc0e8('0x18')](function(_0x4c455a){logger[_0xc0e8('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x34b20a,_0x4c455a);_0x1cbd03(_0x4c455a);});});}exports[_0xc0e8('0x19')]=function(_0x3afc0e){var _0x12054c=this;return new Promise(function(_0x3c6b39,_0x48bd40){return db['UserVoiceQueueRt'][_0xc0e8('0x1a')]({'raw':_0x3afc0e[_0xc0e8('0x1b')]?_0x3afc0e[_0xc0e8('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3afc0e[_0xc0e8('0x1b')]?_0x3afc0e['options'][_0xc0e8('0x1c')]||null:null,'attributes':[[db[_0xc0e8('0x1d')]['fn'](_0xc0e8('0x1e'),db[_0xc0e8('0x1d')]['fn']('IF',db[_0xc0e8('0x1d')][_0xc0e8('0x1f')](_0xc0e8('0x20')))),_0xc0e8('0x21')]]})[_0xc0e8('0xe')](function(_0x160c19){logger[_0xc0e8('0xf')](_0xc0e8('0x19'),_0x3afc0e);logger[_0xc0e8('0x11')](_0xc0e8('0x19'),_0x3afc0e,JSON[_0xc0e8('0x13')](_0x160c19));_0x3c6b39(_0x160c19);})[_0xc0e8('0x18')](function(_0xea4fbc){logger[_0xc0e8('0x14')](_0xc0e8('0x19'),_0xea4fbc[_0xc0e8('0x17')],_0x3afc0e);_0x48bd40(_0x12054c[_0xc0e8('0x14')](0x1f4,_0xea4fbc['message']));});});}; \ No newline at end of file +var _0x116c=['error','message','result','catch','UserVoiceQueueRt','findAll','options','where','sequelize','COUNT','`paused`\x20=\x201,\x201,\x20null','GetVoiceQueueRtPauses','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1a809b,_0x4c15e3){var _0x5d90e6=function(_0x5dd2e1){while(--_0x5dd2e1){_0x1a809b['push'](_0x1a809b['shift']());}};_0x5d90e6(++_0x4c15e3);}(_0x116c,0x161));var _0xc116=function(_0x504708,_0x5462f8){_0x504708=_0x504708-0x0;var _0x3599fd=_0x116c[_0x504708];return _0x3599fd;};'use strict';var _=require(_0xc116('0x0'));var util=require(_0xc116('0x1'));var moment=require('moment');var BPromise=require(_0xc116('0x2'));var rs=require(_0xc116('0x3'));var fs=require('fs');var Redis=require(_0xc116('0x4'));var db=require(_0xc116('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc116('0x6'));var config=require(_0xc116('0x7'));var jayson=require(_0xc116('0x8'));var client=jayson[_0xc116('0x9')][_0xc116('0xa')]({'port':0x232a});config[_0xc116('0xb')]=_['defaults'](config['redis'],{'host':_0xc116('0xc'),'port':0x18eb});var socket=require(_0xc116('0xd'))(new Redis(config[_0xc116('0xb')]));require('./userVoiceQueueRt.socket')[_0xc116('0xe')](socket);function respondWithRpcPromise(_0x1dc9ad,_0x19f6b3,_0x42d5cb){return new BPromise(function(_0x15912c,_0xbcf72e){return client[_0xc116('0xf')](_0x1dc9ad,_0x42d5cb)[_0xc116('0x10')](function(_0x4d8668){logger[_0xc116('0x11')](_0xc116('0x12'),_0x19f6b3,_0xc116('0x13'));logger[_0xc116('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x19f6b3,'request\x20sent',JSON['stringify'](_0x4d8668));if(_0x4d8668[_0xc116('0x15')]){if(_0x4d8668[_0xc116('0x15')]['code']===0x1f4){logger[_0xc116('0x15')](_0xc116('0x12'),_0x19f6b3,_0x4d8668[_0xc116('0x15')][_0xc116('0x16')]);return _0xbcf72e(_0x4d8668[_0xc116('0x15')][_0xc116('0x16')]);}logger[_0xc116('0x15')](_0xc116('0x12'),_0x19f6b3,_0x4d8668[_0xc116('0x15')][_0xc116('0x16')]);return _0x15912c(_0x4d8668[_0xc116('0x15')][_0xc116('0x16')]);}else{logger['info'](_0xc116('0x12'),_0x19f6b3,_0xc116('0x13'));_0x15912c(_0x4d8668[_0xc116('0x17')][_0xc116('0x16')]);}})[_0xc116('0x18')](function(_0x574326){logger[_0xc116('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x19f6b3,_0x574326);_0xbcf72e(_0x574326);});});}exports['GetVoiceQueueRtPauses']=function(_0x503e2e){var _0x20ea73=this;return new Promise(function(_0x2a1c09,_0x127741){return db[_0xc116('0x19')][_0xc116('0x1a')]({'raw':_0x503e2e[_0xc116('0x1b')]?_0x503e2e[_0xc116('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x503e2e[_0xc116('0x1b')]?_0x503e2e[_0xc116('0x1b')][_0xc116('0x1c')]||null:null,'attributes':[[db[_0xc116('0x1d')]['fn'](_0xc116('0x1e'),db[_0xc116('0x1d')]['fn']('IF',db['sequelize']['literal'](_0xc116('0x1f')))),'outboundQueuePauses']]})[_0xc116('0x10')](function(_0x2c6c2b){logger['info']('GetVoiceQueueRtPauses',_0x503e2e);logger[_0xc116('0x14')](_0xc116('0x20'),_0x503e2e,JSON[_0xc116('0x21')](_0x2c6c2b));_0x2a1c09(_0x2c6c2b);})['catch'](function(_0x323f0b){logger[_0xc116('0x15')](_0xc116('0x20'),_0x323f0b[_0xc116('0x16')],_0x503e2e);_0x127741(_0x20ea73['error'](0x1f4,_0x323f0b[_0xc116('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 4f2ae16..1a06eae 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 _0x7dfd=['./userVoiceQueueRt.events','save','remove','update','emit','removeListener','register','length','userVoiceQueueRt:'];(function(_0x3936ae,_0x176807){var _0x35e130=function(_0x4b0696){while(--_0x4b0696){_0x3936ae['push'](_0x3936ae['shift']());}};_0x35e130(++_0x176807);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var UserVoiceQueueRtEvents=require(_0xd7df('0x0'));var events=[_0xd7df('0x1'),_0xd7df('0x2'),_0xd7df('0x3')];function createListener(_0x346f5f,_0x28c3c9){return function(_0x176418){_0x28c3c9[_0xd7df('0x4')](_0x346f5f,_0x176418);};}function removeListener(_0x3ef231,_0x3d8c5a){return function(){UserVoiceQueueRtEvents[_0xd7df('0x5')](_0x3ef231,_0x3d8c5a);};}exports[_0xd7df('0x6')]=function(_0x36cf0f){for(var _0x39ce98=0x0,_0x354ea7=events[_0xd7df('0x7')];_0x39ce98<_0x354ea7;_0x39ce98++){var _0x2c48a4=events[_0x39ce98];var _0x5c220a=createListener(_0xd7df('0x8')+_0x2c48a4,_0x36cf0f);UserVoiceQueueRtEvents['on'](_0x2c48a4,_0x5c220a);}}; \ No newline at end of file +var _0x3f8a=['userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','update','emit','removeListener','register','length'];(function(_0x2bf6be,_0x5b23f1){var _0x532ef4=function(_0x3760df){while(--_0x3760df){_0x2bf6be['push'](_0x2bf6be['shift']());}};_0x532ef4(++_0x5b23f1);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x4a710c,_0x1dd160){_0x4a710c=_0x4a710c-0x0;var _0x31c65d=_0x3f8a[_0x4a710c];return _0x31c65d;};'use strict';var UserVoiceQueueRtEvents=require(_0xa3f8('0x0'));var events=[_0xa3f8('0x1'),_0xa3f8('0x2'),_0xa3f8('0x3')];function createListener(_0x512b4c,_0x467a6c){return function(_0x143375){_0x467a6c[_0xa3f8('0x4')](_0x512b4c,_0x143375);};}function removeListener(_0x15b6aa,_0x2553fd){return function(){UserVoiceQueueRtEvents[_0xa3f8('0x5')](_0x15b6aa,_0x2553fd);};}exports[_0xa3f8('0x6')]=function(_0x471464){for(var _0x1f160a=0x0,_0xf895d9=events[_0xa3f8('0x7')];_0x1f160a<_0xf895d9;_0x1f160a++){var _0x268332=events[_0x1f160a];var _0x2faf2e=createListener(_0xa3f8('0x8')+_0x268332,_0x471464);UserVoiceQueueRtEvents['on'](_0x268332,_0x2faf2e);}}; \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 18988f8..43dc562 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 _0xe706=['update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x2e3545,_0x20a6ec){var _0xcf18f=function(_0x3c85dd){while(--_0x3c85dd){_0x2e3545['push'](_0x2e3545['shift']());}};_0xcf18f(++_0x20a6ec);}(_0xe706,0xa3));var _0x6e70=function(_0x37ae17,_0x12491a){_0x37ae17=_0x37ae17-0x0;var _0x24b60f=_0xe706[_0x37ae17];return _0x24b60f;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var auth=require(_0x6e70('0x5'));var interaction=require(_0x6e70('0x6'));var config=require(_0x6e70('0x7'));var controller=require(_0x6e70('0x8'));router[_0x6e70('0x9')]('/',auth[_0x6e70('0xa')](),controller[_0x6e70('0xb')]);router[_0x6e70('0x9')](_0x6e70('0xc'),auth[_0x6e70('0xa')](),controller[_0x6e70('0xd')]);router[_0x6e70('0xe')]('/',auth[_0x6e70('0xa')](),controller[_0x6e70('0xf')]);router[_0x6e70('0x10')](_0x6e70('0xc'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x11')]);router[_0x6e70('0x12')](_0x6e70('0xc'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x13')]);module['exports']=router; \ No newline at end of file +var _0x70e0=['create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','show','post','isAuthenticated'];(function(_0x246227,_0x12bfcb){var _0x37bd4a=function(_0x4670f4){while(--_0x4670f4){_0x246227['push'](_0x246227['shift']());}};_0x37bd4a(++_0x12bfcb);}(_0x70e0,0x17b));var _0x070e=function(_0x1b5e1f,_0x21d078){_0x1b5e1f=_0x1b5e1f-0x0;var _0x4d945c=_0x70e0[_0x1b5e1f];return _0x4d945c;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var auth=require(_0x070e('0x4'));var interaction=require(_0x070e('0x5'));var config=require(_0x070e('0x6'));var controller=require('./variable.controller');router[_0x070e('0x7')]('/',auth['isAuthenticated'](),controller[_0x070e('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x070e('0x9')]);router[_0x070e('0xa')]('/',auth[_0x070e('0xb')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')](_0x070e('0xe'),auth[_0x070e('0xb')](),controller['update']);router['delete'](_0x070e('0xe'),auth[_0x070e('0xb')](),controller[_0x070e('0xf')]);module[_0x070e('0x10')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index e24a514..6db32c5 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 _0x97a0=['exports','STRING','sequelize'];(function(_0x1aa3fe,_0x27c5fa){var _0x163cee=function(_0x2a1505){while(--_0x2a1505){_0x1aa3fe['push'](_0x1aa3fe['shift']());}};_0x163cee(++_0x27c5fa);}(_0x97a0,0xc5));var _0x097a=function(_0x647f09,_0x56bca7){_0x647f09=_0x647f09-0x0;var _0x13b2b9=_0x97a0[_0x647f09];return _0x13b2b9;};'use strict';var Sequelize=require(_0x097a('0x0'));module[_0x097a('0x1')]={'name':{'type':Sequelize[_0x097a('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x097a('0x2')]}}; \ No newline at end of file +var _0x5167=['exports','name','STRING','sequelize'];(function(_0x1ca684,_0x3f6761){var _0x4ce5d9=function(_0x92b38d){while(--_0x92b38d){_0x1ca684['push'](_0x1ca684['shift']());}};_0x4ce5d9(++_0x3f6761);}(_0x5167,0xff));var _0x7516=function(_0x3a6153,_0x23e815){_0x3a6153=_0x3a6153-0x0;var _0x10a2ee=_0x5167[_0x3a6153];return _0x10a2ee;};'use strict';var Sequelize=require(_0x7516('0x0'));module[_0x7516('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x7516('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7516('0x3')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 3fedca5..01103dd 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 _0x7c5d=['model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','count','includeAll','include','rows','show','params','options','find','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','offset','Content-Range','save','update','then','get','Variables','UserProfileResource','destroy','sendStatus','error','name','index','Variable','rawAttributes'];(function(_0x801cd2,_0x234a4d){var _0xa4c9e7=function(_0xb888d3){while(--_0xb888d3){_0x801cd2['push'](_0x801cd2['shift']());}};_0xa4c9e7(++_0x234a4d);}(_0x7c5d,0xba));var _0xd7c5=function(_0x32357d,_0x30c0bb){_0x32357d=_0x32357d-0x0;var _0x168773=_0x7c5d[_0x32357d];return _0x168773;};'use strict';var pdf=require(_0xd7c5('0x0'));var emlformat=require(_0xd7c5('0x1'));var rimraf=require(_0xd7c5('0x2'));var zipdir=require(_0xd7c5('0x3'));var jsonpatch=require(_0xd7c5('0x4'));var rp=require(_0xd7c5('0x5'));var moment=require(_0xd7c5('0x6'));var BPromise=require(_0xd7c5('0x7'));var Mustache=require(_0xd7c5('0x8'));var util=require(_0xd7c5('0x9'));var path=require(_0xd7c5('0xa'));var sox=require(_0xd7c5('0xb'));var csv=require(_0xd7c5('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd7c5('0xd'));var squel=require(_0xd7c5('0xe'));var crypto=require(_0xd7c5('0xf'));var jsforce=require(_0xd7c5('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xd7c5('0xc'));var querystring=require(_0xd7c5('0x11'));var Papa=require(_0xd7c5('0x12'));var Redis=require(_0xd7c5('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xd7c5('0x14'));var logger=require(_0xd7c5('0x15'))(_0xd7c5('0x16'));var utils=require(_0xd7c5('0x17'));var config=require(_0xd7c5('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x529a49,_0x5bda90){_0x5bda90=_0x5bda90||0xcc;return function(_0x2464cb){if(_0x2464cb){return _0x529a49['sendStatus'](_0x5bda90);}return _0x529a49[_0xd7c5('0x19')](_0x5bda90)[_0xd7c5('0x1a')]();};}function respondWithResult(_0x41f53d,_0x390484){_0x390484=_0x390484||0xc8;return function(_0x1b17d9){if(_0x1b17d9){return _0x41f53d['status'](_0x390484)['json'](_0x1b17d9);}};}function respondWithFilteredResult(_0x163373,_0x4f2019){return function(_0x5984ab){if(_0x5984ab){var _0xcf79ec=_0x5984ab['count'],_0x347737=_0x4f2019[_0xd7c5('0x1b')],_0x57dbe7=_0x4f2019[_0xd7c5('0x1b')]+_0x4f2019['limit'],_0x227f98;if(_0x57dbe7>=_0xcf79ec){_0x57dbe7=_0xcf79ec;_0x227f98=0xc8;}else{_0x227f98=0xce;}_0x163373[_0xd7c5('0x19')](_0x227f98);return _0x163373['set'](_0xd7c5('0x1c'),_0x347737+'-'+_0x57dbe7+'/'+_0xcf79ec)['json'](_0x5984ab);}return null;};}function patchUpdates(_0x2aae9c){return function(_0x460a29){try{jsonpatch['apply'](_0x460a29,_0x2aae9c,!![]);}catch(_0x60c209){return BPromise['reject'](_0x60c209);}return _0x460a29[_0xd7c5('0x1d')]();};}function saveUpdates(_0x293547,_0x44254e){return function(_0x7fb9f0){if(_0x7fb9f0){return _0x7fb9f0[_0xd7c5('0x1e')](_0x293547)[_0xd7c5('0x1f')](function(_0x42fa38){return _0x42fa38;});}return null;};}function removeEntity(_0xe86f5f,_0x1b5607){return function(_0x42ee15){if(_0x42ee15){return _0x42ee15['destroy']()[_0xd7c5('0x1f')](function(){var _0x5185cd=_0x42ee15[_0xd7c5('0x20')]({'plain':!![]});var _0x1c74cf=_0xd7c5('0x21');return db[_0xd7c5('0x22')][_0xd7c5('0x23')]({'where':{'type':_0x1c74cf,'resourceId':_0x5185cd['id']}})[_0xd7c5('0x1f')](function(){return _0x42ee15;});})[_0xd7c5('0x1f')](function(){_0xe86f5f[_0xd7c5('0x19')](0xcc)[_0xd7c5('0x1a')]();});}};}function handleEntityNotFound(_0x5d1289,_0x401ebc){return function(_0x3d3002){if(!_0x3d3002){_0x5d1289[_0xd7c5('0x24')](0x194);}return _0x3d3002;};}function handleError(_0x179264,_0x3b2a06){_0x3b2a06=_0x3b2a06||0x1f4;return function(_0x13a442){logger[_0xd7c5('0x25')](_0x13a442['stack']);if(_0x13a442[_0xd7c5('0x26')]){delete _0x13a442['name'];}_0x179264[_0xd7c5('0x19')](_0x3b2a06)['send'](_0x13a442);};}exports[_0xd7c5('0x27')]=function(_0x835c19,_0x492821){var _0x52684f={},_0x3f353f={},_0xf2b433={'count':0x0,'rows':[]};var _0x3b0544=db[_0xd7c5('0x28')][_0xd7c5('0x29')];_0x3f353f[_0xd7c5('0x2a')]=_[_0xd7c5('0x2b')](_0x3b0544);_0x3f353f[_0xd7c5('0x2c')]=_['keys'](_0x835c19['query']);_0x3f353f[_0xd7c5('0x2d')]=_[_0xd7c5('0x2e')](_0x3f353f['model'],_0x3f353f['query']);_0x52684f[_0xd7c5('0x2f')]=_[_0xd7c5('0x2e')](_0x3f353f[_0xd7c5('0x2a')],qs[_0xd7c5('0x30')](_0x835c19['query'][_0xd7c5('0x30')]));_0x52684f['attributes']=_0x52684f[_0xd7c5('0x2f')][_0xd7c5('0x31')]?_0x52684f[_0xd7c5('0x2f')]:_0x3f353f[_0xd7c5('0x2a')];if(!_0x835c19[_0xd7c5('0x2c')]['hasOwnProperty'](_0xd7c5('0x32'))){_0x52684f[_0xd7c5('0x33')]=qs[_0xd7c5('0x33')](_0x835c19['query']['limit']);_0x52684f[_0xd7c5('0x1b')]=qs[_0xd7c5('0x1b')](_0x835c19[_0xd7c5('0x2c')][_0xd7c5('0x1b')]);}_0x52684f[_0xd7c5('0x34')]=qs[_0xd7c5('0x35')](_0x835c19[_0xd7c5('0x2c')]['sort']);_0x52684f[_0xd7c5('0x36')]=qs[_0xd7c5('0x2d')](_[_0xd7c5('0x37')](_0x835c19[_0xd7c5('0x2c')],_0x3f353f['filters']));if(_0x835c19[_0xd7c5('0x2c')][_0xd7c5('0x38')]){_0x52684f[_0xd7c5('0x36')]=_[_0xd7c5('0x39')](_0x52684f[_0xd7c5('0x36')],{'$or':_['map'](_0x3b0544,function(_0x5b2ce4){if(_0x5b2ce4[_0xd7c5('0x3a')][_0xd7c5('0x3b')]!==_0xd7c5('0x3c')){var _0x39282b={};_0x39282b[_0x5b2ce4['field']]={'$like':'%'+_0x835c19[_0xd7c5('0x2c')][_0xd7c5('0x38')]+'%'};return _0x39282b;}})});}_0x52684f=_['merge']({},_0x52684f,_0x835c19['options']);var _0x485f8f={'where':_0x52684f['where']};return db['Variable'][_0xd7c5('0x3d')](_0x485f8f)[_0xd7c5('0x1f')](function(_0x575b18){_0xf2b433[_0xd7c5('0x3d')]=_0x575b18;if(_0x835c19['query'][_0xd7c5('0x3e')]){_0x52684f[_0xd7c5('0x3f')]=[{'all':!![]}];}return db['Variable']['findAll'](_0x52684f);})[_0xd7c5('0x1f')](function(_0x42e568){_0xf2b433[_0xd7c5('0x40')]=_0x42e568;return _0xf2b433;})['then'](respondWithFilteredResult(_0x492821,_0x52684f))['catch'](handleError(_0x492821,null));};exports[_0xd7c5('0x41')]=function(_0x465475,_0x1f4ace){var _0x256192={'raw':!![],'where':{'id':_0x465475[_0xd7c5('0x42')]['id']}},_0x21fd90={};_0x21fd90[_0xd7c5('0x2a')]=_[_0xd7c5('0x2b')](db['Variable'][_0xd7c5('0x29')]);_0x21fd90[_0xd7c5('0x2c')]=_[_0xd7c5('0x2b')](_0x465475[_0xd7c5('0x2c')]);_0x21fd90[_0xd7c5('0x2d')]=_[_0xd7c5('0x2e')](_0x21fd90['model'],_0x21fd90[_0xd7c5('0x2c')]);_0x256192[_0xd7c5('0x2f')]=_[_0xd7c5('0x2e')](_0x21fd90['model'],qs['fields'](_0x465475['query'][_0xd7c5('0x30')]));_0x256192[_0xd7c5('0x2f')]=_0x256192[_0xd7c5('0x2f')][_0xd7c5('0x31')]?_0x256192[_0xd7c5('0x2f')]:_0x21fd90[_0xd7c5('0x2a')];if(_0x465475[_0xd7c5('0x2c')][_0xd7c5('0x3e')]){_0x256192['include']=[{'all':!![]}];}_0x256192=_[_0xd7c5('0x39')]({},_0x256192,_0x465475[_0xd7c5('0x43')]);return db[_0xd7c5('0x28')][_0xd7c5('0x44')](_0x256192)[_0xd7c5('0x1f')](handleEntityNotFound(_0x1f4ace,null))[_0xd7c5('0x1f')](respondWithResult(_0x1f4ace,null))[_0xd7c5('0x45')](handleError(_0x1f4ace,null));};exports['create']=function(_0x2db2bb,_0x2bf6c3){return db['Variable']['create'](_0x2db2bb[_0xd7c5('0x46')],{})[_0xd7c5('0x1f')](function(_0x794ca6){var _0x1e4a59=_0x2db2bb[_0xd7c5('0x47')][_0xd7c5('0x20')]({'plain':!![]});if(!_0x1e4a59)throw new Error(_0xd7c5('0x48'));if(_0x1e4a59[_0xd7c5('0x49')]===_0xd7c5('0x47')){var _0x342776=_0x794ca6['get']({'plain':!![]});var _0x5541ad=_0xd7c5('0x21');return db[_0xd7c5('0x4a')]['find']({'where':{'name':_0x5541ad,'userProfileId':_0x1e4a59['userProfileId']},'raw':!![]})[_0xd7c5('0x1f')](function(_0x4e7793){if(_0x4e7793&&_0x4e7793[_0xd7c5('0x4b')]===0x0){return db['UserProfileResource']['create']({'name':_0x342776[_0xd7c5('0x26')],'resourceId':_0x342776['id'],'type':_0x4e7793[_0xd7c5('0x26')],'sectionId':_0x4e7793['id']},{})['then'](function(){return _0x794ca6;});}else{return _0x794ca6;}})['catch'](function(_0x410ec7){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x410ec7);throw _0x410ec7;});}return _0x794ca6;})[_0xd7c5('0x1f')](respondWithResult(_0x2bf6c3,0xc9))[_0xd7c5('0x45')](handleError(_0x2bf6c3,null));};exports[_0xd7c5('0x1e')]=function(_0x3a4288,_0x3610eb){if(_0x3a4288[_0xd7c5('0x46')]['id']){delete _0x3a4288[_0xd7c5('0x46')]['id'];}return db[_0xd7c5('0x28')][_0xd7c5('0x44')]({'where':{'id':_0x3a4288[_0xd7c5('0x42')]['id']}})[_0xd7c5('0x1f')](handleEntityNotFound(_0x3610eb,null))['then'](saveUpdates(_0x3a4288[_0xd7c5('0x46')],null))['then'](respondWithResult(_0x3610eb,null))[_0xd7c5('0x45')](handleError(_0x3610eb,null));};exports['destroy']=function(_0x2d40a0,_0x146be6){return db[_0xd7c5('0x28')][_0xd7c5('0x44')]({'where':{'id':_0x2d40a0[_0xd7c5('0x42')]['id']}})[_0xd7c5('0x1f')](handleEntityNotFound(_0x146be6,null))[_0xd7c5('0x1f')](removeEntity(_0x146be6,null))[_0xd7c5('0x45')](handleError(_0x146be6,null));}; \ No newline at end of file +var _0x3c28=['../../mysqldb','sendStatus','end','status','count','offset','set','Content-Range','apply','reject','update','destroy','get','Variables','UserProfileResource','then','error','stack','name','send','index','Variable','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','filter','merge','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils'];(function(_0x3b150c,_0x2f93f8){var _0x5cd414=function(_0x26305e){while(--_0x26305e){_0x3b150c['push'](_0x3b150c['shift']());}};_0x5cd414(++_0x2f93f8);}(_0x3c28,0xda));var _0x83c2=function(_0x1e9eb2,_0x57cf01){_0x1e9eb2=_0x1e9eb2-0x0;var _0x38caab=_0x3c28[_0x1e9eb2];return _0x38caab;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x83c2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x83c2('0x1'));var jsonpatch=require(_0x83c2('0x2'));var rp=require(_0x83c2('0x3'));var moment=require(_0x83c2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x83c2('0x5'));var util=require(_0x83c2('0x6'));var path=require(_0x83c2('0x7'));var sox=require(_0x83c2('0x8'));var csv=require(_0x83c2('0x9'));var ejs=require(_0x83c2('0xa'));var fs=require('fs');var _=require(_0x83c2('0xb'));var squel=require(_0x83c2('0xc'));var crypto=require('crypto');var jsforce=require(_0x83c2('0xd'));var deskjs=require(_0x83c2('0xe'));var toCsv=require(_0x83c2('0x9'));var querystring=require(_0x83c2('0xf'));var Papa=require(_0x83c2('0x10'));var Redis=require(_0x83c2('0x11'));var authService=require(_0x83c2('0x12'));var qs=require(_0x83c2('0x13'));var hardwareService=require(_0x83c2('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x83c2('0x15'));var config=require('../../config/environment');var db=require(_0x83c2('0x16'))['db'];function respondWithStatusCode(_0x5c5534,_0x2b1188){_0x2b1188=_0x2b1188||0xcc;return function(_0x2d4906){if(_0x2d4906){return _0x5c5534[_0x83c2('0x17')](_0x2b1188);}return _0x5c5534['status'](_0x2b1188)[_0x83c2('0x18')]();};}function respondWithResult(_0x1d0127,_0x377652){_0x377652=_0x377652||0xc8;return function(_0x2b9a56){if(_0x2b9a56){return _0x1d0127[_0x83c2('0x19')](_0x377652)['json'](_0x2b9a56);}};}function respondWithFilteredResult(_0x33fe4f,_0x1124e3){return function(_0x26d8ce){if(_0x26d8ce){var _0x4705ac=_0x26d8ce[_0x83c2('0x1a')],_0x3b73e1=_0x1124e3['offset'],_0x5314e2=_0x1124e3[_0x83c2('0x1b')]+_0x1124e3['limit'],_0x4dfaa4;if(_0x5314e2>=_0x4705ac){_0x5314e2=_0x4705ac;_0x4dfaa4=0xc8;}else{_0x4dfaa4=0xce;}_0x33fe4f[_0x83c2('0x19')](_0x4dfaa4);return _0x33fe4f[_0x83c2('0x1c')](_0x83c2('0x1d'),_0x3b73e1+'-'+_0x5314e2+'/'+_0x4705ac)['json'](_0x26d8ce);}return null;};}function patchUpdates(_0x524187){return function(_0x523979){try{jsonpatch[_0x83c2('0x1e')](_0x523979,_0x524187,!![]);}catch(_0x170971){return BPromise[_0x83c2('0x1f')](_0x170971);}return _0x523979['save']();};}function saveUpdates(_0x39f219,_0x3ae1bc){return function(_0x5afde0){if(_0x5afde0){return _0x5afde0[_0x83c2('0x20')](_0x39f219)['then'](function(_0x55e733){return _0x55e733;});}return null;};}function removeEntity(_0x328535,_0x575014){return function(_0x17a7bd){if(_0x17a7bd){return _0x17a7bd[_0x83c2('0x21')]()['then'](function(){var _0x22e076=_0x17a7bd[_0x83c2('0x22')]({'plain':!![]});var _0xbec4f8=_0x83c2('0x23');return db[_0x83c2('0x24')][_0x83c2('0x21')]({'where':{'type':_0xbec4f8,'resourceId':_0x22e076['id']}})['then'](function(){return _0x17a7bd;});})[_0x83c2('0x25')](function(){_0x328535[_0x83c2('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cd2a5,_0x2bba47){return function(_0x242c1a){if(!_0x242c1a){_0x5cd2a5[_0x83c2('0x17')](0x194);}return _0x242c1a;};}function handleError(_0x27f7a1,_0xf4cd72){_0xf4cd72=_0xf4cd72||0x1f4;return function(_0x4d7459){logger[_0x83c2('0x26')](_0x4d7459[_0x83c2('0x27')]);if(_0x4d7459[_0x83c2('0x28')]){delete _0x4d7459[_0x83c2('0x28')];}_0x27f7a1[_0x83c2('0x19')](_0xf4cd72)[_0x83c2('0x29')](_0x4d7459);};}exports[_0x83c2('0x2a')]=function(_0x494cba,_0x5e1311){var _0x2e43d1={},_0x14c7ad={},_0x2a69f4={'count':0x0,'rows':[]};var _0x35bf20=db[_0x83c2('0x2b')][_0x83c2('0x2c')];_0x14c7ad[_0x83c2('0x2d')]=_[_0x83c2('0x2e')](_0x35bf20);_0x14c7ad[_0x83c2('0x2f')]=_[_0x83c2('0x2e')](_0x494cba['query']);_0x14c7ad[_0x83c2('0x30')]=_[_0x83c2('0x31')](_0x14c7ad['model'],_0x14c7ad[_0x83c2('0x2f')]);_0x2e43d1[_0x83c2('0x32')]=_['intersection'](_0x14c7ad[_0x83c2('0x2d')],qs[_0x83c2('0x33')](_0x494cba['query'][_0x83c2('0x33')]));_0x2e43d1[_0x83c2('0x32')]=_0x2e43d1[_0x83c2('0x32')][_0x83c2('0x34')]?_0x2e43d1[_0x83c2('0x32')]:_0x14c7ad[_0x83c2('0x2d')];if(!_0x494cba[_0x83c2('0x2f')][_0x83c2('0x35')](_0x83c2('0x36'))){_0x2e43d1[_0x83c2('0x37')]=qs[_0x83c2('0x37')](_0x494cba[_0x83c2('0x2f')]['limit']);_0x2e43d1['offset']=qs[_0x83c2('0x1b')](_0x494cba[_0x83c2('0x2f')][_0x83c2('0x1b')]);}_0x2e43d1[_0x83c2('0x38')]=qs['sort'](_0x494cba[_0x83c2('0x2f')]['sort']);_0x2e43d1[_0x83c2('0x39')]=qs[_0x83c2('0x30')](_['pick'](_0x494cba['query'],_0x14c7ad['filters']));if(_0x494cba['query'][_0x83c2('0x3a')]){_0x2e43d1[_0x83c2('0x39')]=_[_0x83c2('0x3b')](_0x2e43d1[_0x83c2('0x39')],{'$or':_['map'](_0x35bf20,function(_0x1e6cd6){if(_0x1e6cd6[_0x83c2('0x3c')][_0x83c2('0x3d')]!==_0x83c2('0x3e')){var _0x3ae206={};_0x3ae206[_0x1e6cd6[_0x83c2('0x3f')]]={'$like':'%'+_0x494cba[_0x83c2('0x2f')]['filter']+'%'};return _0x3ae206;}})});}_0x2e43d1=_[_0x83c2('0x3b')]({},_0x2e43d1,_0x494cba[_0x83c2('0x40')]);var _0x29e768={'where':_0x2e43d1['where']};return db[_0x83c2('0x2b')][_0x83c2('0x1a')](_0x29e768)[_0x83c2('0x25')](function(_0xba86f9){_0x2a69f4[_0x83c2('0x1a')]=_0xba86f9;if(_0x494cba[_0x83c2('0x2f')][_0x83c2('0x41')]){_0x2e43d1[_0x83c2('0x42')]=[{'all':!![]}];}return db[_0x83c2('0x2b')][_0x83c2('0x43')](_0x2e43d1);})[_0x83c2('0x25')](function(_0x39ba22){_0x2a69f4[_0x83c2('0x44')]=_0x39ba22;return _0x2a69f4;})[_0x83c2('0x25')](respondWithFilteredResult(_0x5e1311,_0x2e43d1))['catch'](handleError(_0x5e1311,null));};exports[_0x83c2('0x45')]=function(_0x2accdc,_0x40cd55){var _0x482513={'raw':!![],'where':{'id':_0x2accdc[_0x83c2('0x46')]['id']}},_0xb26227={};_0xb26227[_0x83c2('0x2d')]=_['keys'](db[_0x83c2('0x2b')][_0x83c2('0x2c')]);_0xb26227['query']=_[_0x83c2('0x2e')](_0x2accdc['query']);_0xb26227[_0x83c2('0x30')]=_['intersection'](_0xb26227[_0x83c2('0x2d')],_0xb26227[_0x83c2('0x2f')]);_0x482513[_0x83c2('0x32')]=_[_0x83c2('0x31')](_0xb26227[_0x83c2('0x2d')],qs['fields'](_0x2accdc[_0x83c2('0x2f')][_0x83c2('0x33')]));_0x482513[_0x83c2('0x32')]=_0x482513[_0x83c2('0x32')][_0x83c2('0x34')]?_0x482513[_0x83c2('0x32')]:_0xb26227[_0x83c2('0x2d')];if(_0x2accdc['query'][_0x83c2('0x41')]){_0x482513[_0x83c2('0x42')]=[{'all':!![]}];}_0x482513=_[_0x83c2('0x3b')]({},_0x482513,_0x2accdc[_0x83c2('0x40')]);return db[_0x83c2('0x2b')][_0x83c2('0x47')](_0x482513)['then'](handleEntityNotFound(_0x40cd55,null))[_0x83c2('0x25')](respondWithResult(_0x40cd55,null))['catch'](handleError(_0x40cd55,null));};exports[_0x83c2('0x48')]=function(_0x288ca5,_0x2830f5){return db[_0x83c2('0x2b')][_0x83c2('0x48')](_0x288ca5[_0x83c2('0x49')],{})[_0x83c2('0x25')](function(_0x512c61){var _0x1e1d1f=_0x288ca5[_0x83c2('0x4a')]['get']({'plain':!![]});if(!_0x1e1d1f)throw new Error(_0x83c2('0x4b'));if(_0x1e1d1f['role']==='user'){var _0x540809=_0x512c61[_0x83c2('0x22')]({'plain':!![]});var _0x69b10d=_0x83c2('0x23');return db[_0x83c2('0x4c')][_0x83c2('0x47')]({'where':{'name':_0x69b10d,'userProfileId':_0x1e1d1f[_0x83c2('0x4d')]},'raw':!![]})[_0x83c2('0x25')](function(_0x1ef496){if(_0x1ef496&&_0x1ef496['autoAssociation']===0x0){return db[_0x83c2('0x24')][_0x83c2('0x48')]({'name':_0x540809[_0x83c2('0x28')],'resourceId':_0x540809['id'],'type':_0x1ef496[_0x83c2('0x28')],'sectionId':_0x1ef496['id']},{})['then'](function(){return _0x512c61;});}else{return _0x512c61;}})[_0x83c2('0x4e')](function(_0x493236){logger[_0x83c2('0x26')](_0x83c2('0x4f'),_0x493236);throw _0x493236;});}return _0x512c61;})[_0x83c2('0x25')](respondWithResult(_0x2830f5,0xc9))['catch'](handleError(_0x2830f5,null));};exports['update']=function(_0x191c26,_0xad63f6){if(_0x191c26[_0x83c2('0x49')]['id']){delete _0x191c26[_0x83c2('0x49')]['id'];}return db[_0x83c2('0x2b')][_0x83c2('0x47')]({'where':{'id':_0x191c26['params']['id']}})[_0x83c2('0x25')](handleEntityNotFound(_0xad63f6,null))[_0x83c2('0x25')](saveUpdates(_0x191c26[_0x83c2('0x49')],null))['then'](respondWithResult(_0xad63f6,null))[_0x83c2('0x4e')](handleError(_0xad63f6,null));};exports[_0x83c2('0x21')]=function(_0x5be828,_0x4d8a3a){return db[_0x83c2('0x2b')][_0x83c2('0x47')]({'where':{'id':_0x5be828['params']['id']}})[_0x83c2('0x25')](handleEntityNotFound(_0x4d8a3a,null))[_0x83c2('0x25')](removeEntity(_0x4d8a3a,null))[_0x83c2('0x4e')](handleError(_0x4d8a3a,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 16fe6ff..b5a62ee 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 _0xc051=['tools_variables','lodash','util','moment','bluebird','request-promise','path','../../config/environment','./variable.attributes','exports','define','Variable'];(function(_0x34f56a,_0x5e0955){var _0xc726f4=function(_0x112d68){while(--_0x112d68){_0x34f56a['push'](_0x34f56a['shift']());}};_0xc726f4(++_0x5e0955);}(_0xc051,0xb5));var _0x1c05=function(_0x4de833,_0x288970){_0x4de833=_0x4de833-0x0;var _0x35d3fd=_0xc051[_0x4de833];return _0x35d3fd;};'use strict';var _=require(_0x1c05('0x0'));var util=require(_0x1c05('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1c05('0x2'));var BPromise=require(_0x1c05('0x3'));var rp=require(_0x1c05('0x4'));var fs=require('fs');var path=require(_0x1c05('0x5'));var rimraf=require('rimraf');var config=require(_0x1c05('0x6'));var attributes=require(_0x1c05('0x7'));module[_0x1c05('0x8')]=function(_0x294fcb,_0x14284f){return _0x294fcb[_0x1c05('0x9')](_0x1c05('0xa'),attributes,{'tableName':_0x1c05('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7374=['Variable','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','define'];(function(_0x176a12,_0x5b52ee){var _0x4c9b0f=function(_0x5dd3a5){while(--_0x5dd3a5){_0x176a12['push'](_0x176a12['shift']());}};_0x4c9b0f(++_0x5b52ee);}(_0x7374,0x1b9));var _0x4737=function(_0x278a46,_0x2cc0a9){_0x278a46=_0x278a46-0x0;var _0x5c277f=_0x7374[_0x278a46];return _0x5c277f;};'use strict';var _=require(_0x4737('0x0'));var util=require(_0x4737('0x1'));var logger=require(_0x4737('0x2'))(_0x4737('0x3'));var moment=require(_0x4737('0x4'));var BPromise=require('bluebird');var rp=require(_0x4737('0x5'));var fs=require('fs');var path=require(_0x4737('0x6'));var rimraf=require(_0x4737('0x7'));var config=require(_0x4737('0x8'));var attributes=require('./variable.attributes');module['exports']=function(_0x162bf0,_0xc35930){return _0x162bf0[_0x4737('0x9')](_0x4737('0xa'),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 bef4096..b6e42dc 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 _0x9ca2=['raw','where','attributes','include','model','map','debug','ShowVariable','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','error','code','message','catch','Variable','find','options'];(function(_0x5f4a84,_0x33d504){var _0x2060fd=function(_0x495cbb){while(--_0x495cbb){_0x5f4a84['push'](_0x5f4a84['shift']());}};_0x2060fd(++_0x33d504);}(_0x9ca2,0x195));var _0x29ca=function(_0x4046f5,_0x414664){_0x4046f5=_0x4046f5-0x0;var _0x3ab280=_0x9ca2[_0x4046f5];return _0x3ab280;};'use strict';var _=require(_0x29ca('0x0'));var util=require(_0x29ca('0x1'));var moment=require(_0x29ca('0x2'));var BPromise=require(_0x29ca('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x29ca('0x4'));var db=require(_0x29ca('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x29ca('0x6'))(_0x29ca('0x7'));var config=require(_0x29ca('0x8'));var jayson=require(_0x29ca('0x9'));var client=jayson[_0x29ca('0xa')][_0x29ca('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a9998,_0x2d1074,_0x508193){return new BPromise(function(_0x279b65,_0x24fb73){return client[_0x29ca('0xc')](_0x4a9998,_0x508193)[_0x29ca('0xd')](function(_0x17222a){logger[_0x29ca('0xe')](_0x29ca('0xf'),_0x2d1074,_0x29ca('0x10'));logger['debug']('Variable,\x20%s,\x20%s,\x20%s',_0x2d1074,'request\x20sent',JSON['stringify'](_0x17222a));if(_0x17222a['error']){if(_0x17222a[_0x29ca('0x11')][_0x29ca('0x12')]===0x1f4){logger[_0x29ca('0x11')]('Variable,\x20%s,\x20%s',_0x2d1074,_0x17222a[_0x29ca('0x11')][_0x29ca('0x13')]);return _0x24fb73(_0x17222a[_0x29ca('0x11')]['message']);}logger[_0x29ca('0x11')]('Variable,\x20%s,\x20%s',_0x2d1074,_0x17222a['error'][_0x29ca('0x13')]);return _0x279b65(_0x17222a[_0x29ca('0x11')][_0x29ca('0x13')]);}else{logger[_0x29ca('0xe')](_0x29ca('0xf'),_0x2d1074,'request\x20sent');_0x279b65(_0x17222a['result'][_0x29ca('0x13')]);}})[_0x29ca('0x14')](function(_0xd221de){logger[_0x29ca('0x11')](_0x29ca('0xf'),_0x2d1074,_0xd221de);_0x24fb73(_0xd221de);});});}exports['ShowVariable']=function(_0x1e5d48){var _0xcc4a71=this;return new Promise(function(_0x40c93f,_0x46c84c){return db[_0x29ca('0x15')][_0x29ca('0x16')]({'raw':_0x1e5d48[_0x29ca('0x17')]?_0x1e5d48['options'][_0x29ca('0x18')]===undefined?!![]:![]:!![],'where':_0x1e5d48[_0x29ca('0x17')]?_0x1e5d48[_0x29ca('0x17')][_0x29ca('0x19')]||null:null,'attributes':_0x1e5d48['options']?_0x1e5d48[_0x29ca('0x17')][_0x29ca('0x1a')]||null:null,'include':_0x1e5d48[_0x29ca('0x17')]?_0x1e5d48[_0x29ca('0x17')][_0x29ca('0x1b')]?_['map'](_0x1e5d48[_0x29ca('0x17')][_0x29ca('0x1b')],function(_0x5e216c){return{'model':db[_0x5e216c[_0x29ca('0x1c')]],'as':_0x5e216c['as'],'attributes':_0x5e216c[_0x29ca('0x1a')],'include':_0x5e216c[_0x29ca('0x1b')]?_[_0x29ca('0x1d')](_0x5e216c[_0x29ca('0x1b')],function(_0x58fcbe){return{'model':db[_0x58fcbe[_0x29ca('0x1c')]],'as':_0x58fcbe['as'],'attributes':_0x58fcbe[_0x29ca('0x1a')],'include':_0x58fcbe[_0x29ca('0x1b')]?_[_0x29ca('0x1d')](_0x58fcbe[_0x29ca('0x1b')],function(_0x3aed75){return{'model':db[_0x3aed75[_0x29ca('0x1c')]],'as':_0x3aed75['as'],'attributes':_0x3aed75[_0x29ca('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4e77a9){logger[_0x29ca('0xe')]('ShowVariable',_0x1e5d48);logger[_0x29ca('0x1e')](_0x29ca('0x1f'),_0x1e5d48,JSON[_0x29ca('0x20')](_0x4e77a9));_0x40c93f(_0x4e77a9);})[_0x29ca('0x14')](function(_0x2266d0){logger[_0x29ca('0x11')](_0x29ca('0x1f'),_0x2266d0['message'],_0x1e5d48);_0x46c84c(_0xcc4a71['error'](0x1f4,_0x2266d0[_0x29ca('0x13')]));});});}; \ No newline at end of file +var _0x252a=['map','model','ShowVariable','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','Variable,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','find','options','raw','where','attributes','include'];(function(_0x401204,_0x53e4de){var _0x337b84=function(_0x5e5f01){while(--_0x5e5f01){_0x401204['push'](_0x401204['shift']());}};_0x337b84(++_0x53e4de);}(_0x252a,0x1b5));var _0xa252=function(_0x56708c,_0x403b1e){_0x56708c=_0x56708c-0x0;var _0x5b243c=_0x252a[_0x56708c];return _0x5b243c;};'use strict';var _=require(_0xa252('0x0'));var util=require('util');var moment=require(_0xa252('0x1'));var BPromise=require(_0xa252('0x2'));var rs=require(_0xa252('0x3'));var fs=require('fs');var Redis=require(_0xa252('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa252('0x5'));var logger=require(_0xa252('0x6'))(_0xa252('0x7'));var config=require(_0xa252('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa252('0x9')][_0xa252('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4439fe,_0x5b8faa,_0x3f0d70){return new BPromise(function(_0x377635,_0x3abe44){return client[_0xa252('0xb')](_0x4439fe,_0x3f0d70)[_0xa252('0xc')](function(_0x36ff50){logger['info'](_0xa252('0xd'),_0x5b8faa,'request\x20sent');logger[_0xa252('0xe')]('Variable,\x20%s,\x20%s,\x20%s',_0x5b8faa,_0xa252('0xf'),JSON[_0xa252('0x10')](_0x36ff50));if(_0x36ff50[_0xa252('0x11')]){if(_0x36ff50[_0xa252('0x11')][_0xa252('0x12')]===0x1f4){logger['error'](_0xa252('0xd'),_0x5b8faa,_0x36ff50[_0xa252('0x11')][_0xa252('0x13')]);return _0x3abe44(_0x36ff50[_0xa252('0x11')][_0xa252('0x13')]);}logger[_0xa252('0x11')](_0xa252('0xd'),_0x5b8faa,_0x36ff50[_0xa252('0x11')]['message']);return _0x377635(_0x36ff50[_0xa252('0x11')][_0xa252('0x13')]);}else{logger['info'](_0xa252('0xd'),_0x5b8faa,_0xa252('0xf'));_0x377635(_0x36ff50[_0xa252('0x14')][_0xa252('0x13')]);}})[_0xa252('0x15')](function(_0x278a00){logger[_0xa252('0x11')](_0xa252('0xd'),_0x5b8faa,_0x278a00);_0x3abe44(_0x278a00);});});}exports['ShowVariable']=function(_0x29e69b){var _0x46619d=this;return new Promise(function(_0x1627b6,_0x428edc){return db['Variable'][_0xa252('0x16')]({'raw':_0x29e69b[_0xa252('0x17')]?_0x29e69b[_0xa252('0x17')][_0xa252('0x18')]===undefined?!![]:![]:!![],'where':_0x29e69b[_0xa252('0x17')]?_0x29e69b[_0xa252('0x17')][_0xa252('0x19')]||null:null,'attributes':_0x29e69b['options']?_0x29e69b[_0xa252('0x17')][_0xa252('0x1a')]||null:null,'include':_0x29e69b['options']?_0x29e69b['options'][_0xa252('0x1b')]?_[_0xa252('0x1c')](_0x29e69b[_0xa252('0x17')][_0xa252('0x1b')],function(_0x361eb5){return{'model':db[_0x361eb5[_0xa252('0x1d')]],'as':_0x361eb5['as'],'attributes':_0x361eb5[_0xa252('0x1a')],'include':_0x361eb5[_0xa252('0x1b')]?_[_0xa252('0x1c')](_0x361eb5[_0xa252('0x1b')],function(_0x2e5bb8){return{'model':db[_0x2e5bb8['model']],'as':_0x2e5bb8['as'],'attributes':_0x2e5bb8['attributes'],'include':_0x2e5bb8['include']?_[_0xa252('0x1c')](_0x2e5bb8['include'],function(_0x541b6c){return{'model':db[_0x541b6c[_0xa252('0x1d')]],'as':_0x541b6c['as'],'attributes':_0x541b6c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4e69a0){logger['info'](_0xa252('0x1e'),_0x29e69b);logger[_0xa252('0xe')](_0xa252('0x1e'),_0x29e69b,JSON['stringify'](_0x4e69a0));_0x1627b6(_0x4e69a0);})[_0xa252('0x15')](function(_0x5e700e){logger[_0xa252('0x11')](_0xa252('0x1e'),_0x5e700e[_0xa252('0x13')],_0x29e69b);_0x428edc(_0x46619d[_0xa252('0x11')](0x1f4,_0x5e700e[_0xa252('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index b9fb223..203e2b0 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 _0xb11b=['reset','pull','/restart','/migrations','migrations','exports','express','Router','./version.controller','get','index','/fetch','isAuthenticated','fetch','canUpdate'];(function(_0x234c55,_0x2a65b5){var _0x14be52=function(_0x465d0e){while(--_0x465d0e){_0x234c55['push'](_0x234c55['shift']());}};_0x14be52(++_0x2a65b5);}(_0xb11b,0xd8));var _0xbb11=function(_0x59eb35,_0x1722b8){_0x59eb35=_0x59eb35-0x0;var _0x188430=_0xb11b[_0x59eb35];return _0x188430;};'use strict';var express=require(_0xbb11('0x0'));var router=express[_0xbb11('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xbb11('0x2'));router[_0xbb11('0x3')]('/',controller[_0xbb11('0x4')]);router[_0xbb11('0x3')](_0xbb11('0x5'),auth[_0xbb11('0x6')](),auth['canUpdate'](),controller[_0xbb11('0x7')]);router['get']('/reset',auth['isAuthenticated'](),auth[_0xbb11('0x8')](),controller[_0xbb11('0x9')]);router['get']('/pull',auth[_0xbb11('0x6')](),auth[_0xbb11('0x8')](),controller[_0xbb11('0xa')]);router[_0xbb11('0x3')](_0xbb11('0xb'),auth[_0xbb11('0x6')](),controller['restart']);router[_0xbb11('0x3')](_0xbb11('0xc'),controller[_0xbb11('0xd')]);module[_0xbb11('0xe')]=router; \ No newline at end of file +var _0x49c0=['/migrations','migrations','exports','express','Router','../../components/auth/service','./version.controller','get','canUpdate','reset','/pull','isAuthenticated','pull','/restart'];(function(_0x3f9837,_0x261e87){var _0x1b69e3=function(_0x2ef59d){while(--_0x2ef59d){_0x3f9837['push'](_0x3f9837['shift']());}};_0x1b69e3(++_0x261e87);}(_0x49c0,0xe3));var _0x049c=function(_0x5ec565,_0x17a2ca){_0x5ec565=_0x5ec565-0x0;var _0x3a719a=_0x49c0[_0x5ec565];return _0x3a719a;};'use strict';var express=require(_0x049c('0x0'));var router=express[_0x049c('0x1')]();var auth=require(_0x049c('0x2'));var controller=require(_0x049c('0x3'));router[_0x049c('0x4')]('/',controller['index']);router['get']('/fetch',auth['isAuthenticated'](),auth[_0x049c('0x5')](),controller['fetch']);router[_0x049c('0x4')]('/reset',auth['isAuthenticated'](),auth[_0x049c('0x5')](),controller[_0x049c('0x6')]);router[_0x049c('0x4')](_0x049c('0x7'),auth[_0x049c('0x8')](),auth[_0x049c('0x5')](),controller[_0x049c('0x9')]);router[_0x049c('0x4')](_0x049c('0xa'),auth[_0x049c('0x8')](),controller['restart']);router[_0x049c('0x4')](_0x049c('0xb'),controller[_0x049c('0xc')]);module[_0x049c('0xd')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index f1c49ee..5103022 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 _0x0a6d=['getQueryInterface','sequelize','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','map','Database\x20migrated\x20successfully\x20from\x20version\x20','last','Database\x20already\x20up-to-date','umzug','path','pkginfo','version','compare-versions','child_process','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','query','latest','fetch','tags','2.0.0','status','json','origin','master','error','info','git\x20fetch','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard','restart','motion2','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','root','server','length','replace','.js','exports','push','Migration'];(function(_0x36b4ff,_0x2a6cf8){var _0x5bc724=function(_0x2a49f0){while(--_0x2a49f0){_0x36b4ff['push'](_0x36b4ff['shift']());}};_0x5bc724(++_0x2a6cf8);}(_0x0a6d,0xd1));var _0xd0a6=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x0a6d[_0x4b369d];return _0x571a98;};'use strict';var Umzug=require(_0xd0a6('0x0'));var path=require(_0xd0a6('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0xd0a6('0x2'))(module,_0xd0a6('0x3'));var compareVersions=require(_0xd0a6('0x4'));var exec=require(_0xd0a6('0x5'))['exec'];var db=require(_0xd0a6('0x6'))['db'];var config=require(_0xd0a6('0x7'));var pm2=require(_0xd0a6('0x8'));var logger=require(_0xd0a6('0x9'))(_0xd0a6('0xa'));var git=require('simple-git')(config['root']);exports['index']=function(_0x1d8298,_0x55b59c){var _0x1c9ed4={'current':module['exports'][_0xd0a6('0x3')],'phonebar':0x2};if(_0x1d8298[_0xd0a6('0xb')]&&_0x1d8298[_0xd0a6('0xb')][_0xd0a6('0xc')]){return git[_0xd0a6('0xd')]()[_0xd0a6('0xe')](function(_0x4d9479,_0x155c2e){_0x1c9ed4[_0xd0a6('0xc')]=(_0x4d9479?module['exports'][_0xd0a6('0x3')]:_0x155c2e[_0xd0a6('0xc')])||_0xd0a6('0xf');return _0x55b59c[_0xd0a6('0x10')](0xc8)[_0xd0a6('0x11')](_0x1c9ed4);});}else{return _0x55b59c[_0xd0a6('0x10')](0xc8)['json'](_0x1c9ed4);}};exports['fetch']=function(_0x5dccff,_0x364748){return git[_0xd0a6('0xd')]([_0xd0a6('0x12'),_0xd0a6('0x13')],function(_0x287249){if(_0x287249){logger[_0xd0a6('0x14')](_0x287249);return _0x364748[_0xd0a6('0x10')](0x1f4)[_0xd0a6('0x11')](_0x287249);}logger[_0xd0a6('0x15')](_0xd0a6('0x16'));return _0x364748[_0xd0a6('0x10')](0xc8)[_0xd0a6('0x11')]({'output':'git\x20fetch\x20origin\x20master'});});};exports['reset']=function(_0x4a7e3e,_0x627af7){return git[_0xd0a6('0x17')]([_0xd0a6('0x18'),_0xd0a6('0x19')],function(_0x311042){if(_0x311042){logger[_0xd0a6('0x14')](_0x311042);return _0x627af7['status'](0x1f4)[_0xd0a6('0x11')](_0x311042);}logger[_0xd0a6('0x15')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x627af7[_0xd0a6('0x10')](0xc8)[_0xd0a6('0x11')]({'output':_0xd0a6('0x1a')});});};exports['pull']=function(_0x393867,_0x2da888){exec('npm\x20install\x20--production',function(_0xc31feb,_0x437c00,_0x521640){logger[_0xd0a6('0x15')](_0x437c00);logger[_0xd0a6('0x15')](_0x521640);if(_0xc31feb){logger[_0xd0a6('0x14')](_0xc31feb);return _0x2da888[_0xd0a6('0x10')](0x1f4)[_0xd0a6('0x11')](_0xc31feb);}return _0x2da888[_0xd0a6('0x10')](0xc8)[_0xd0a6('0x11')]({'output':_0x437c00});});};exports[_0xd0a6('0x1b')]=function(_0x50400c,_0x56c47d){return pm2[_0xd0a6('0x1b')](_0xd0a6('0x1c'))['then'](function(_0x2c4e07){logger[_0xd0a6('0x15')](_0xd0a6('0x1d'),_0x2c4e07);return _0x56c47d['status'](0xc8)['json']({'output':_0xd0a6('0x1e')});})[_0xd0a6('0x1f')](function(_0xf31cf3){logger[_0xd0a6('0x14')](_0xf31cf3);return _0x56c47d[_0xd0a6('0x10')](0x1f4)[_0xd0a6('0x11')](_0xf31cf3);});};exports[_0xd0a6('0x20')]=function(_0x5ddd85,_0x2d18df){var _0x442e74=fs['readdirSync'](path['join'](config[_0xd0a6('0x21')],_0xd0a6('0x22'),_0xd0a6('0x20')));var _0x5eb994=[];for(var _0x3a4d5f=0x0;_0x3a4d5f<_0x442e74[_0xd0a6('0x23')];_0x3a4d5f++){var _0x270388=_0x442e74[_0x3a4d5f][_0xd0a6('0x24')](_0xd0a6('0x25'),'');if(compareVersions(module[_0xd0a6('0x26')]['version'],_0x270388)===-0x1){_0x5eb994[_0xd0a6('0x27')](_0x270388);}}if(_0x5eb994[_0xd0a6('0x23')]){var _0x375bf9=_0x5eb994['sort'](compareVersions);var _0x2151c7=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0xd0a6('0x28')],'modelName':_0xd0a6('0x28'),'columnName':_0xd0a6('0x3')},'migrations':{'params':[db['sequelize'][_0xd0a6('0x29')](),db[_0xd0a6('0x2a')][_0xd0a6('0x2b')],function(){throw new Error(_0xd0a6('0x2c'));}],'path':path[_0xd0a6('0x2d')](config[_0xd0a6('0x21')],'server',_0xd0a6('0x20')),'pattern':/\.js$/}});_0x2151c7['up']({'migrations':_[_0xd0a6('0x2e')](_0x375bf9,function(_0x4e05ab){return _0x4e05ab+_0xd0a6('0x25');})})['then'](function(){return _0x2d18df[_0xd0a6('0x10')](0xc8)[_0xd0a6('0x11')]({'output':_0xd0a6('0x2f')+module[_0xd0a6('0x26')][_0xd0a6('0x3')]+'\x20to\x20'+_[_0xd0a6('0x30')](_0x375bf9),'migrations':_[_0xd0a6('0x2d')](_0x375bf9)});})[_0xd0a6('0x1f')](function(_0x267ca5){if(_0x267ca5 instanceof db[_0xd0a6('0x2a')]['UniqueConstraintError']){return _0x2d18df[_0xd0a6('0x10')](0xc8)['json']({'output':_0xd0a6('0x31')});}else{return _0x2d18df[_0xd0a6('0x10')](0x1f4)[_0xd0a6('0x11')](_0x267ca5);}});}else{return _0x2d18df['status'](0xc8)['json']({'output':_0xd0a6('0x31')});}}; \ No newline at end of file +var _0xa3ec=['path','lodash','pkginfo','compare-versions','child_process','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','index','exports','version','query','latest','fetch','tags','2.0.0','json','status','origin','master','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','error','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','readdirSync','server','migrations','length','replace','.js','push','sequelize','Migration','getQueryInterface','join','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug'];(function(_0x4b7cba,_0x1b9ab5){var _0x5d0fab=function(_0x4d4872){while(--_0x4d4872){_0x4b7cba['push'](_0x4b7cba['shift']());}};_0x5d0fab(++_0x1b9ab5);}(_0xa3ec,0x195));var _0xca3e=function(_0xf559ac,_0x3a82b4){_0xf559ac=_0xf559ac-0x0;var _0x134a25=_0xa3ec[_0xf559ac];return _0x134a25;};'use strict';var Umzug=require(_0xca3e('0x0'));var path=require(_0xca3e('0x1'));var fs=require('fs');var _=require(_0xca3e('0x2'));var pkginfo=require(_0xca3e('0x3'))(module,'version');var compareVersions=require(_0xca3e('0x4'));var exec=require(_0xca3e('0x5'))['exec'];var db=require(_0xca3e('0x6'))['db'];var config=require(_0xca3e('0x7'));var pm2=require(_0xca3e('0x8'));var logger=require(_0xca3e('0x9'))(_0xca3e('0xa'));var git=require(_0xca3e('0xb'))(config[_0xca3e('0xc')]);exports[_0xca3e('0xd')]=function(_0x556e65,_0x15836a){var _0x572760={'current':module[_0xca3e('0xe')][_0xca3e('0xf')],'phonebar':0x2};if(_0x556e65[_0xca3e('0x10')]&&_0x556e65[_0xca3e('0x10')][_0xca3e('0x11')]){return git[_0xca3e('0x12')]()[_0xca3e('0x13')](function(_0xd76761,_0x2d968e){_0x572760[_0xca3e('0x11')]=(_0xd76761?module[_0xca3e('0xe')][_0xca3e('0xf')]:_0x2d968e['latest'])||_0xca3e('0x14');return _0x15836a['status'](0xc8)[_0xca3e('0x15')](_0x572760);});}else{return _0x15836a[_0xca3e('0x16')](0xc8)[_0xca3e('0x15')](_0x572760);}};exports[_0xca3e('0x12')]=function(_0x17e34c,_0x2f01fa){return git[_0xca3e('0x12')]([_0xca3e('0x17'),_0xca3e('0x18')],function(_0x4f3c2f){if(_0x4f3c2f){logger['error'](_0x4f3c2f);return _0x2f01fa[_0xca3e('0x16')](0x1f4)[_0xca3e('0x15')](_0x4f3c2f);}logger['info'](_0xca3e('0x19'));return _0x2f01fa[_0xca3e('0x16')](0xc8)['json']({'output':_0xca3e('0x1a')});});};exports[_0xca3e('0x1b')]=function(_0xbfb6b3,_0x541bbc){return git['reset']([_0xca3e('0x1c'),_0xca3e('0x1d')],function(_0x19aa05){if(_0x19aa05){logger['error'](_0x19aa05);return _0x541bbc[_0xca3e('0x16')](0x1f4)[_0xca3e('0x15')](_0x19aa05);}logger[_0xca3e('0x1e')](_0xca3e('0x1f'));return _0x541bbc[_0xca3e('0x16')](0xc8)[_0xca3e('0x15')]({'output':_0xca3e('0x20')});});};exports[_0xca3e('0x21')]=function(_0x194ad4,_0x1678fa){exec('npm\x20install\x20--production',function(_0x44e774,_0x3815a1,_0xcf9fbe){logger[_0xca3e('0x1e')](_0x3815a1);logger[_0xca3e('0x1e')](_0xcf9fbe);if(_0x44e774){logger[_0xca3e('0x22')](_0x44e774);return _0x1678fa[_0xca3e('0x16')](0x1f4)['json'](_0x44e774);}return _0x1678fa[_0xca3e('0x16')](0xc8)[_0xca3e('0x15')]({'output':_0x3815a1});});};exports[_0xca3e('0x23')]=function(_0x3d7bce,_0x78bd23){return pm2['restart'](_0xca3e('0x24'))[_0xca3e('0x25')](function(_0x50dd91){logger[_0xca3e('0x1e')](_0xca3e('0x26'),_0x50dd91);return _0x78bd23[_0xca3e('0x16')](0xc8)[_0xca3e('0x15')]({'output':_0xca3e('0x27')});})[_0xca3e('0x28')](function(_0x483417){logger['error'](_0x483417);return _0x78bd23[_0xca3e('0x16')](0x1f4)['json'](_0x483417);});};exports['migrations']=function(_0x59e3fb,_0x298857){var _0x1adcd2=fs[_0xca3e('0x29')](path['join'](config[_0xca3e('0xc')],_0xca3e('0x2a'),_0xca3e('0x2b')));var _0x5a02b8=[];for(var _0x5a62da=0x0;_0x5a62da<_0x1adcd2[_0xca3e('0x2c')];_0x5a62da++){var _0x5293c4=_0x1adcd2[_0x5a62da][_0xca3e('0x2d')](_0xca3e('0x2e'),'');if(compareVersions(module['exports'][_0xca3e('0xf')],_0x5293c4)===-0x1){_0x5a02b8[_0xca3e('0x2f')](_0x5293c4);}}if(_0x5a02b8[_0xca3e('0x2c')]){var _0x5e840c=_0x5a02b8['sort'](compareVersions);var _0x2d922f=new Umzug({'storage':_0xca3e('0x30'),'storageOptions':{'model':db['Migration'],'modelName':_0xca3e('0x31'),'columnName':_0xca3e('0xf')},'migrations':{'params':[db[_0xca3e('0x30')][_0xca3e('0x32')](),db[_0xca3e('0x30')]['constructor'],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[_0xca3e('0x33')](config[_0xca3e('0xc')],_0xca3e('0x2a'),_0xca3e('0x2b')),'pattern':/\.js$/}});_0x2d922f['up']({'migrations':_[_0xca3e('0x34')](_0x5e840c,function(_0x42a56f){return _0x42a56f+_0xca3e('0x2e');})})[_0xca3e('0x25')](function(){return _0x298857[_0xca3e('0x16')](0xc8)['json']({'output':_0xca3e('0x35')+module['exports']['version']+_0xca3e('0x36')+_[_0xca3e('0x37')](_0x5e840c),'migrations':_['join'](_0x5e840c)});})[_0xca3e('0x28')](function(_0x49c5e3){if(_0x49c5e3 instanceof db[_0xca3e('0x30')][_0xca3e('0x38')]){return _0x298857[_0xca3e('0x16')](0xc8)[_0xca3e('0x15')]({'output':_0xca3e('0x39')});}else{return _0x298857[_0xca3e('0x16')](0x1f4)[_0xca3e('0x15')](_0x49c5e3);}});}else{return _0x298857[_0xca3e('0x16')](0xc8)[_0xca3e('0x15')]({'output':_0xca3e('0x39')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index f931753..b6ee2f0 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 _0xd101=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0xd3ad9b,_0x5152ce){var _0x26de7c=function(_0x33a31b){while(--_0x33a31b){_0xd3ad9b['push'](_0xd3ad9b['shift']());}};_0x26de7c(++_0x5152ce);}(_0xd101,0xc1));var _0x1d10=function(_0x39db48,_0x5c300a){_0x39db48=_0x39db48-0x0;var _0x2e497b=_0xd101[_0x39db48];return _0x2e497b;};'use strict';var multer=require(_0x1d10('0x0'));var util=require('util');var path=require(_0x1d10('0x1'));var timeout=require(_0x1d10('0x2'));var express=require(_0x1d10('0x3'));var router=express[_0x1d10('0x4')]();var auth=require(_0x1d10('0x5'));var interaction=require(_0x1d10('0x6'));var config=require(_0x1d10('0x7'));var controller=require(_0x1d10('0x8'));router['get']('/',auth[_0x1d10('0x9')](),controller[_0x1d10('0xa')]);router[_0x1d10('0xb')](_0x1d10('0xc'),auth[_0x1d10('0x9')](),controller[_0x1d10('0xd')]);router[_0x1d10('0xb')](_0x1d10('0xe'),auth[_0x1d10('0x9')](),controller[_0x1d10('0xf')]);router[_0x1d10('0x10')]('/',auth[_0x1d10('0x9')](),controller[_0x1d10('0x11')]);router[_0x1d10('0x12')](_0x1d10('0xe'),auth[_0x1d10('0x9')](),controller[_0x1d10('0x13')]);router['delete'](_0x1d10('0xe'),auth[_0x1d10('0x9')](),controller[_0x1d10('0x14')]);module[_0x1d10('0x15')]=router; \ No newline at end of file +var _0x2a07=['post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x2a07,0x74));var _0x72a0=function(_0xff6ae1,_0x5c13e2){_0xff6ae1=_0xff6ae1-0x0;var _0x389fa2=_0x2a07[_0xff6ae1];return _0x389fa2;};'use strict';var multer=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var path=require(_0x72a0('0x2'));var timeout=require(_0x72a0('0x3'));var express=require(_0x72a0('0x4'));var router=express['Router']();var auth=require(_0x72a0('0x5'));var interaction=require(_0x72a0('0x6'));var config=require(_0x72a0('0x7'));var controller=require(_0x72a0('0x8'));router[_0x72a0('0x9')]('/',auth[_0x72a0('0xa')](),controller[_0x72a0('0xb')]);router[_0x72a0('0x9')](_0x72a0('0xc'),auth[_0x72a0('0xa')](),controller[_0x72a0('0xd')]);router[_0x72a0('0x9')](_0x72a0('0xe'),auth[_0x72a0('0xa')](),controller[_0x72a0('0xf')]);router[_0x72a0('0x10')]('/',auth['isAuthenticated'](),controller[_0x72a0('0x11')]);router[_0x72a0('0x12')]('/:id',auth[_0x72a0('0xa')](),controller[_0x72a0('0x13')]);router[_0x72a0('0x14')](_0x72a0('0xe'),auth[_0x72a0('0xa')](),controller['destroy']);module[_0x72a0('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 8141a69..b7a24d8 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 _0x30cc=['INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','DATE'];(function(_0x3a1287,_0x4926f0){var _0x5cf44f=function(_0x222636){while(--_0x222636){_0x3a1287['push'](_0x3a1287['shift']());}};_0x5cf44f(++_0x4926f0);}(_0x30cc,0x1cb));var _0xc30c=function(_0x1857c6,_0x48840c){_0x1857c6=_0x1857c6-0x0;var _0x51011c=_0x30cc[_0x1857c6];return _0x51011c;};'use strict';var Sequelize=require('sequelize');module[_0xc30c('0x0')]={'type':{'type':Sequelize[_0xc30c('0x1')]},'uniqueid':{'type':Sequelize[_0xc30c('0x1')]},'calleridnum':{'type':Sequelize[_0xc30c('0x1')]},'calleridname':{'type':Sequelize[_0xc30c('0x1')]},'queue':{'type':Sequelize[_0xc30c('0x1')]},'interface':{'type':Sequelize[_0xc30c('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xc30c('0x2')]},'agentconnectAt':{'type':Sequelize[_0xc30c('0x2')]},'agentcompleteAt':{'type':Sequelize[_0xc30c('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0xc30c('0x2')]},'agentdumpAt':{'type':Sequelize[_0xc30c('0x2')]},'holdtime':{'type':Sequelize[_0xc30c('0x3')]},'agentcomplete':{'type':Sequelize[_0xc30c('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xc30c('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xc30c('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0xc30c('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xc30c('0x3')]},'reason':{'type':Sequelize[_0xc30c('0x1')]},'lastevent':{'type':Sequelize[_0xc30c('0x1')]},'channel':{'type':Sequelize[_0xc30c('0x1')]},'channelstate':{'type':Sequelize[_0xc30c('0x3')]},'channelstatedesc':{'type':Sequelize[_0xc30c('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xc30c('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xc30c('0x1')]},'context':{'type':Sequelize[_0xc30c('0x1')]},'exten':{'type':Sequelize[_0xc30c('0x1')]},'priority':{'type':Sequelize[_0xc30c('0x1')]},'destchannel':{'type':Sequelize[_0xc30c('0x1')]},'destchannelstate':{'type':Sequelize[_0xc30c('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xc30c('0x1')]},'destcalleridnum':{'type':Sequelize[_0xc30c('0x1')]},'destcalleridname':{'type':Sequelize[_0xc30c('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xc30c('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xc30c('0x1')]},'destaccountcode':{'type':Sequelize[_0xc30c('0x1')]},'destcontext':{'type':Sequelize[_0xc30c('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xc30c('0x1')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xc30c('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xc30c('0x1')],'comment':_0xc30c('0x5')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xc30c('0x1')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x4459=['BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','INTEGER'];(function(_0x48ca6c,_0x487fdf){var _0x3f0963=function(_0x29827f){while(--_0x29827f){_0x48ca6c['push'](_0x48ca6c['shift']());}};_0x3f0963(++_0x487fdf);}(_0x4459,0x113));var _0x9445=function(_0x16f8aa,_0x4a0b8b){_0x16f8aa=_0x16f8aa-0x0;var _0x39fd18=_0x4459[_0x16f8aa];return _0x39fd18;};'use strict';var Sequelize=require(_0x9445('0x0'));module[_0x9445('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x9445('0x2')]},'calleridnum':{'type':Sequelize[_0x9445('0x2')]},'calleridname':{'type':Sequelize[_0x9445('0x2')]},'queue':{'type':Sequelize[_0x9445('0x2')]},'interface':{'type':Sequelize[_0x9445('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x9445('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x9445('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x9445('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x9445('0x4')]},'agentacw':{'type':Sequelize[_0x9445('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x9445('0x4')]},'reason':{'type':Sequelize[_0x9445('0x2')]},'lastevent':{'type':Sequelize[_0x9445('0x2')]},'channel':{'type':Sequelize[_0x9445('0x2')]},'channelstate':{'type':Sequelize[_0x9445('0x4')]},'channelstatedesc':{'type':Sequelize[_0x9445('0x2')]},'connectedlinenum':{'type':Sequelize[_0x9445('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x9445('0x2')]},'exten':{'type':Sequelize[_0x9445('0x2')]},'priority':{'type':Sequelize[_0x9445('0x2')]},'destchannel':{'type':Sequelize[_0x9445('0x2')]},'destchannelstate':{'type':Sequelize[_0x9445('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x9445('0x2')]},'destcalleridnum':{'type':Sequelize[_0x9445('0x2')]},'destcalleridname':{'type':Sequelize[_0x9445('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x9445('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x9445('0x2')]},'destlanguage':{'type':Sequelize[_0x9445('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x9445('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x9445('0x2')]},'destuniqueid':{'type':Sequelize[_0x9445('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x9445('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x9445('0x2')]},'transfer':{'type':Sequelize[_0x9445('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x9445('0x6')},'transferexten':{'type':Sequelize[_0x9445('0x2')]},'transferuniqueid':{'type':Sequelize[_0x9445('0x2')]},'agententerreason':{'type':Sequelize[_0x9445('0x4')],'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 c1788af..5d19c14 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 _0x08c8=['include','rows','catch','params','options','find','create','body','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','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','VoiceAgentReport','rawAttributes','model','keys','query','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','includeAll'];(function(_0x4d3b41,_0x4281e1){var _0x2dc795=function(_0x106729){while(--_0x106729){_0x4d3b41['push'](_0x4d3b41['shift']());}};_0x2dc795(++_0x4281e1);}(_0x08c8,0x1b9));var _0x808c=function(_0x5e2526,_0x3a500c){_0x5e2526=_0x5e2526-0x0;var _0x1e27a0=_0x08c8[_0x5e2526];return _0x1e27a0;};'use strict';var pdf=require(_0x808c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x808c('0x1'));var zipdir=require(_0x808c('0x2'));var jsonpatch=require(_0x808c('0x3'));var rp=require(_0x808c('0x4'));var moment=require('moment');var BPromise=require(_0x808c('0x5'));var Mustache=require(_0x808c('0x6'));var util=require('util');var path=require(_0x808c('0x7'));var sox=require(_0x808c('0x8'));var csv=require(_0x808c('0x9'));var ejs=require(_0x808c('0xa'));var fs=require('fs');var _=require(_0x808c('0xb'));var squel=require(_0x808c('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x808c('0xd'));var toCsv=require('to-csv');var querystring=require(_0x808c('0xe'));var Papa=require(_0x808c('0xf'));var Redis=require('ioredis');var authService=require(_0x808c('0x10'));var qs=require(_0x808c('0x11'));var hardwareService=require(_0x808c('0x12'));var logger=require(_0x808c('0x13'))(_0x808c('0x14'));var utils=require(_0x808c('0x15'));var config=require(_0x808c('0x16'));var db=require(_0x808c('0x17'))['db'];function respondWithStatusCode(_0x2daa13,_0x4f7ccc){_0x4f7ccc=_0x4f7ccc||0xcc;return function(_0x16a829){if(_0x16a829){return _0x2daa13['sendStatus'](_0x4f7ccc);}return _0x2daa13['status'](_0x4f7ccc)[_0x808c('0x18')]();};}function respondWithResult(_0x30b6e6,_0x17faf9){_0x17faf9=_0x17faf9||0xc8;return function(_0x298fe5){if(_0x298fe5){return _0x30b6e6[_0x808c('0x19')](_0x17faf9)['json'](_0x298fe5);}};}function respondWithFilteredResult(_0x4a3a94,_0x2e4e2d){return function(_0x48fc18){if(_0x48fc18){var _0x5e2932=_0x48fc18[_0x808c('0x1a')],_0x5d9145=_0x2e4e2d[_0x808c('0x1b')],_0xc861e1=_0x2e4e2d[_0x808c('0x1b')]+_0x2e4e2d[_0x808c('0x1c')],_0x3d0ab4;if(_0xc861e1>=_0x5e2932){_0xc861e1=_0x5e2932;_0x3d0ab4=0xc8;}else{_0x3d0ab4=0xce;}_0x4a3a94['status'](_0x3d0ab4);return _0x4a3a94[_0x808c('0x1d')](_0x808c('0x1e'),_0x5d9145+'-'+_0xc861e1+'/'+_0x5e2932)[_0x808c('0x1f')](_0x48fc18);}return null;};}function patchUpdates(_0x4c0b82){return function(_0x2980a4){try{jsonpatch[_0x808c('0x20')](_0x2980a4,_0x4c0b82,!![]);}catch(_0x4d78d5){return BPromise[_0x808c('0x21')](_0x4d78d5);}return _0x2980a4['save']();};}function saveUpdates(_0x44790a,_0xff1ad2){return function(_0x533e08){if(_0x533e08){return _0x533e08[_0x808c('0x22')](_0x44790a)[_0x808c('0x23')](function(_0x426235){return _0x426235;});}return null;};}function removeEntity(_0x217cda,_0x132294){return function(_0x328208){if(_0x328208){return _0x328208[_0x808c('0x24')]()[_0x808c('0x23')](function(){_0x217cda[_0x808c('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e3fec,_0x3f60af){return function(_0x55788b){if(!_0x55788b){_0x4e3fec[_0x808c('0x25')](0x194);}return _0x55788b;};}function handleError(_0x5dd0fe,_0x25eea4){_0x25eea4=_0x25eea4||0x1f4;return function(_0x37b713){logger[_0x808c('0x26')](_0x37b713[_0x808c('0x27')]);if(_0x37b713[_0x808c('0x28')]){delete _0x37b713[_0x808c('0x28')];}_0x5dd0fe[_0x808c('0x19')](_0x25eea4)[_0x808c('0x29')](_0x37b713);};}exports[_0x808c('0x2a')]=function(_0x8b3b12,_0xd3e3d2){var _0x229a34={},_0x13abd8={},_0x556a0f={'count':0x0,'rows':[]};var _0x464240=db[_0x808c('0x2b')][_0x808c('0x2c')];_0x13abd8[_0x808c('0x2d')]=_[_0x808c('0x2e')](_0x464240);_0x13abd8[_0x808c('0x2f')]=_[_0x808c('0x2e')](_0x8b3b12['query']);_0x13abd8[_0x808c('0x30')]=_['intersection'](_0x13abd8[_0x808c('0x2d')],_0x13abd8['query']);_0x229a34['attributes']=_[_0x808c('0x31')](_0x13abd8[_0x808c('0x2d')],qs['fields'](_0x8b3b12[_0x808c('0x2f')]['fields']));_0x229a34[_0x808c('0x32')]=_0x229a34[_0x808c('0x32')][_0x808c('0x33')]?_0x229a34[_0x808c('0x32')]:_0x13abd8[_0x808c('0x2d')];if(!_0x8b3b12[_0x808c('0x2f')]['hasOwnProperty'](_0x808c('0x34'))){_0x229a34[_0x808c('0x1c')]=qs['limit'](_0x8b3b12[_0x808c('0x2f')][_0x808c('0x1c')]);_0x229a34[_0x808c('0x1b')]=qs[_0x808c('0x1b')](_0x8b3b12[_0x808c('0x2f')][_0x808c('0x1b')]);}_0x229a34[_0x808c('0x35')]=qs['sort'](_0x8b3b12['query'][_0x808c('0x36')]);_0x229a34[_0x808c('0x37')]=qs[_0x808c('0x30')](_[_0x808c('0x38')](_0x8b3b12[_0x808c('0x2f')],_0x13abd8[_0x808c('0x30')]));if(_0x8b3b12[_0x808c('0x2f')][_0x808c('0x39')]){_0x229a34['where']=_[_0x808c('0x3a')](_0x229a34[_0x808c('0x37')],{'$or':_[_0x808c('0x3b')](_0x464240,function(_0x1509c6){if(_0x1509c6[_0x808c('0x3c')]['key']!==_0x808c('0x3d')){var _0x1f949b={};_0x1f949b[_0x1509c6['field']]={'$like':'%'+_0x8b3b12[_0x808c('0x2f')][_0x808c('0x39')]+'%'};return _0x1f949b;}})});}_0x229a34=_[_0x808c('0x3a')]({},_0x229a34,_0x8b3b12['options']);var _0x59526e={'where':_0x229a34['where']};return db[_0x808c('0x2b')]['count'](_0x59526e)[_0x808c('0x23')](function(_0x18db00){_0x556a0f['count']=_0x18db00;if(_0x8b3b12[_0x808c('0x2f')][_0x808c('0x3e')]){_0x229a34[_0x808c('0x3f')]=[{'all':!![]}];}return db[_0x808c('0x2b')]['findAll'](_0x229a34);})['then'](function(_0x5df49b){_0x556a0f[_0x808c('0x40')]=_0x5df49b;return _0x556a0f;})[_0x808c('0x23')](respondWithFilteredResult(_0xd3e3d2,_0x229a34))[_0x808c('0x41')](handleError(_0xd3e3d2,null));};exports['show']=function(_0x5d6be8,_0x78c540){var _0x565737={'raw':![],'where':{'id':_0x5d6be8[_0x808c('0x42')]['id']}},_0x449d7a={};_0x449d7a[_0x808c('0x2d')]=_[_0x808c('0x2e')](db['VoiceAgentReport'][_0x808c('0x2c')]);_0x449d7a[_0x808c('0x2f')]=_[_0x808c('0x2e')](_0x5d6be8[_0x808c('0x2f')]);_0x449d7a[_0x808c('0x30')]=_[_0x808c('0x31')](_0x449d7a[_0x808c('0x2d')],_0x449d7a[_0x808c('0x2f')]);_0x565737[_0x808c('0x32')]=_[_0x808c('0x31')](_0x449d7a['model'],qs['fields'](_0x5d6be8[_0x808c('0x2f')]['fields']));_0x565737[_0x808c('0x32')]=_0x565737['attributes'][_0x808c('0x33')]?_0x565737['attributes']:_0x449d7a['model'];if(_0x5d6be8[_0x808c('0x2f')]['includeAll']){_0x565737[_0x808c('0x3f')]=[{'all':!![]}];}_0x565737=_[_0x808c('0x3a')]({},_0x565737,_0x5d6be8[_0x808c('0x43')]);return db[_0x808c('0x2b')][_0x808c('0x44')](_0x565737)[_0x808c('0x23')](handleEntityNotFound(_0x78c540,null))[_0x808c('0x23')](respondWithResult(_0x78c540,null))['catch'](handleError(_0x78c540,null));};exports[_0x808c('0x45')]=function(_0x4970fe,_0x4c8ae1){return db[_0x808c('0x2b')][_0x808c('0x45')](_0x4970fe[_0x808c('0x46')],{})[_0x808c('0x23')](respondWithResult(_0x4c8ae1,0xc9))[_0x808c('0x41')](handleError(_0x4c8ae1,null));};exports[_0x808c('0x22')]=function(_0x2daa26,_0x3f0e32){if(_0x2daa26[_0x808c('0x46')]['id']){delete _0x2daa26[_0x808c('0x46')]['id'];}return db[_0x808c('0x2b')][_0x808c('0x44')]({'where':{'id':_0x2daa26['params']['id']}})[_0x808c('0x23')](handleEntityNotFound(_0x3f0e32,null))[_0x808c('0x23')](saveUpdates(_0x2daa26[_0x808c('0x46')],null))[_0x808c('0x23')](respondWithResult(_0x3f0e32,null))[_0x808c('0x41')](handleError(_0x3f0e32,null));};exports[_0x808c('0x24')]=function(_0x2599ea,_0x129128){return db[_0x808c('0x2b')][_0x808c('0x44')]({'where':{'id':_0x2599ea['params']['id']}})['then'](handleEntityNotFound(_0x129128,null))[_0x808c('0x23')](removeEntity(_0x129128,null))[_0x808c('0x41')](handleError(_0x129128,null));};exports[_0x808c('0x47')]=function(_0x1efe4e,_0x2e9893){return db[_0x808c('0x2b')][_0x808c('0x47')]()['then'](respondWithResult(_0x2e9893,null))['catch'](handleError(_0x2e9893,null));}; \ No newline at end of file +var _0x15a0=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','json','reject','update','then','destroy','error','name','send','index','VoiceAgentReport','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','rows','catch','show','params','find','create','body','describe','eml-format','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x15a0,0x15c));var _0x015a=function(_0xcfe8cc,_0xb83aeb){_0xcfe8cc=_0xcfe8cc-0x0;var _0x55ac53=_0x15a0[_0xcfe8cc];return _0x55ac53;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x015a('0x0'));var rimraf=require(_0x015a('0x1'));var zipdir=require(_0x015a('0x2'));var jsonpatch=require(_0x015a('0x3'));var rp=require(_0x015a('0x4'));var moment=require(_0x015a('0x5'));var BPromise=require(_0x015a('0x6'));var Mustache=require(_0x015a('0x7'));var util=require(_0x015a('0x8'));var path=require(_0x015a('0x9'));var sox=require(_0x015a('0xa'));var csv=require(_0x015a('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x015a('0xc'));var crypto=require(_0x015a('0xd'));var jsforce=require(_0x015a('0xe'));var deskjs=require(_0x015a('0xf'));var toCsv=require(_0x015a('0xb'));var querystring=require(_0x015a('0x10'));var Papa=require(_0x015a('0x11'));var Redis=require(_0x015a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x015a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x015a('0x14'))(_0x015a('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x015a('0x16'))['db'];function respondWithStatusCode(_0x202f76,_0x2b1d35){_0x2b1d35=_0x2b1d35||0xcc;return function(_0x250a3d){if(_0x250a3d){return _0x202f76[_0x015a('0x17')](_0x2b1d35);}return _0x202f76[_0x015a('0x18')](_0x2b1d35)[_0x015a('0x19')]();};}function respondWithResult(_0x1219ff,_0x5e97cb){_0x5e97cb=_0x5e97cb||0xc8;return function(_0x414df2){if(_0x414df2){return _0x1219ff[_0x015a('0x18')](_0x5e97cb)['json'](_0x414df2);}};}function respondWithFilteredResult(_0xead4dd,_0x620be8){return function(_0x5ae8f5){if(_0x5ae8f5){var _0x10dc4e=_0x5ae8f5[_0x015a('0x1a')],_0x12de5d=_0x620be8[_0x015a('0x1b')],_0x3bcdc1=_0x620be8['offset']+_0x620be8[_0x015a('0x1c')],_0x594eac;if(_0x3bcdc1>=_0x10dc4e){_0x3bcdc1=_0x10dc4e;_0x594eac=0xc8;}else{_0x594eac=0xce;}_0xead4dd[_0x015a('0x18')](_0x594eac);return _0xead4dd['set'](_0x015a('0x1d'),_0x12de5d+'-'+_0x3bcdc1+'/'+_0x10dc4e)[_0x015a('0x1e')](_0x5ae8f5);}return null;};}function patchUpdates(_0xffe29d){return function(_0x48e9dd){try{jsonpatch['apply'](_0x48e9dd,_0xffe29d,!![]);}catch(_0x5e70c1){return BPromise[_0x015a('0x1f')](_0x5e70c1);}return _0x48e9dd['save']();};}function saveUpdates(_0x231df0,_0xc3ae99){return function(_0x3a89d9){if(_0x3a89d9){return _0x3a89d9[_0x015a('0x20')](_0x231df0)[_0x015a('0x21')](function(_0x321c3e){return _0x321c3e;});}return null;};}function removeEntity(_0x433d24,_0x11f640){return function(_0xcc777b){if(_0xcc777b){return _0xcc777b[_0x015a('0x22')]()[_0x015a('0x21')](function(){_0x433d24['status'](0xcc)[_0x015a('0x19')]();});}};}function handleEntityNotFound(_0x14a0b9,_0x24b88d){return function(_0x1bf1f3){if(!_0x1bf1f3){_0x14a0b9['sendStatus'](0x194);}return _0x1bf1f3;};}function handleError(_0x49078b,_0x6ad976){_0x6ad976=_0x6ad976||0x1f4;return function(_0x59d6d3){logger[_0x015a('0x23')](_0x59d6d3['stack']);if(_0x59d6d3[_0x015a('0x24')]){delete _0x59d6d3['name'];}_0x49078b[_0x015a('0x18')](_0x6ad976)[_0x015a('0x25')](_0x59d6d3);};}exports[_0x015a('0x26')]=function(_0x1c702c,_0x101fff){var _0x253939={},_0x2a45a0={},_0x50c6b1={'count':0x0,'rows':[]};var _0x4df217=db[_0x015a('0x27')]['rawAttributes'];_0x2a45a0['model']=_[_0x015a('0x28')](_0x4df217);_0x2a45a0[_0x015a('0x29')]=_[_0x015a('0x28')](_0x1c702c[_0x015a('0x29')]);_0x2a45a0[_0x015a('0x2a')]=_['intersection'](_0x2a45a0[_0x015a('0x2b')],_0x2a45a0['query']);_0x253939['attributes']=_[_0x015a('0x2c')](_0x2a45a0[_0x015a('0x2b')],qs[_0x015a('0x2d')](_0x1c702c[_0x015a('0x29')][_0x015a('0x2d')]));_0x253939['attributes']=_0x253939[_0x015a('0x2e')][_0x015a('0x2f')]?_0x253939[_0x015a('0x2e')]:_0x2a45a0[_0x015a('0x2b')];if(!_0x1c702c[_0x015a('0x29')][_0x015a('0x30')](_0x015a('0x31'))){_0x253939[_0x015a('0x1c')]=qs['limit'](_0x1c702c[_0x015a('0x29')][_0x015a('0x1c')]);_0x253939[_0x015a('0x1b')]=qs[_0x015a('0x1b')](_0x1c702c[_0x015a('0x29')]['offset']);}_0x253939['order']=qs['sort'](_0x1c702c['query']['sort']);_0x253939[_0x015a('0x32')]=qs['filters'](_[_0x015a('0x33')](_0x1c702c['query'],_0x2a45a0[_0x015a('0x2a')]));if(_0x1c702c[_0x015a('0x29')][_0x015a('0x34')]){_0x253939[_0x015a('0x32')]=_[_0x015a('0x35')](_0x253939[_0x015a('0x32')],{'$or':_[_0x015a('0x36')](_0x4df217,function(_0x712838){if(_0x712838[_0x015a('0x37')][_0x015a('0x38')]!==_0x015a('0x39')){var _0x3c4101={};_0x3c4101[_0x712838[_0x015a('0x3a')]]={'$like':'%'+_0x1c702c[_0x015a('0x29')]['filter']+'%'};return _0x3c4101;}})});}_0x253939=_[_0x015a('0x35')]({},_0x253939,_0x1c702c[_0x015a('0x3b')]);var _0x5d77f7={'where':_0x253939[_0x015a('0x32')]};return db[_0x015a('0x27')][_0x015a('0x1a')](_0x5d77f7)[_0x015a('0x21')](function(_0x3e7ac2){_0x50c6b1[_0x015a('0x1a')]=_0x3e7ac2;if(_0x1c702c[_0x015a('0x29')][_0x015a('0x3c')]){_0x253939[_0x015a('0x3d')]=[{'all':!![]}];}return db['VoiceAgentReport']['findAll'](_0x253939);})[_0x015a('0x21')](function(_0x2fa215){_0x50c6b1[_0x015a('0x3e')]=_0x2fa215;return _0x50c6b1;})[_0x015a('0x21')](respondWithFilteredResult(_0x101fff,_0x253939))[_0x015a('0x3f')](handleError(_0x101fff,null));};exports[_0x015a('0x40')]=function(_0x26dcb3,_0x1dd62d){var _0x972cb4={'raw':![],'where':{'id':_0x26dcb3[_0x015a('0x41')]['id']}},_0x3b794d={};_0x3b794d['model']=_['keys'](db[_0x015a('0x27')]['rawAttributes']);_0x3b794d['query']=_['keys'](_0x26dcb3[_0x015a('0x29')]);_0x3b794d[_0x015a('0x2a')]=_['intersection'](_0x3b794d[_0x015a('0x2b')],_0x3b794d[_0x015a('0x29')]);_0x972cb4[_0x015a('0x2e')]=_[_0x015a('0x2c')](_0x3b794d['model'],qs[_0x015a('0x2d')](_0x26dcb3[_0x015a('0x29')][_0x015a('0x2d')]));_0x972cb4['attributes']=_0x972cb4['attributes'][_0x015a('0x2f')]?_0x972cb4[_0x015a('0x2e')]:_0x3b794d['model'];if(_0x26dcb3[_0x015a('0x29')][_0x015a('0x3c')]){_0x972cb4[_0x015a('0x3d')]=[{'all':!![]}];}_0x972cb4=_[_0x015a('0x35')]({},_0x972cb4,_0x26dcb3['options']);return db[_0x015a('0x27')][_0x015a('0x42')](_0x972cb4)['then'](handleEntityNotFound(_0x1dd62d,null))['then'](respondWithResult(_0x1dd62d,null))['catch'](handleError(_0x1dd62d,null));};exports['create']=function(_0x2e9430,_0x5c6de5){return db['VoiceAgentReport'][_0x015a('0x43')](_0x2e9430[_0x015a('0x44')],{})[_0x015a('0x21')](respondWithResult(_0x5c6de5,0xc9))[_0x015a('0x3f')](handleError(_0x5c6de5,null));};exports[_0x015a('0x20')]=function(_0x599704,_0x1a1c05){if(_0x599704[_0x015a('0x44')]['id']){delete _0x599704[_0x015a('0x44')]['id'];}return db[_0x015a('0x27')][_0x015a('0x42')]({'where':{'id':_0x599704[_0x015a('0x41')]['id']}})[_0x015a('0x21')](handleEntityNotFound(_0x1a1c05,null))[_0x015a('0x21')](saveUpdates(_0x599704[_0x015a('0x44')],null))[_0x015a('0x21')](respondWithResult(_0x1a1c05,null))[_0x015a('0x3f')](handleError(_0x1a1c05,null));};exports[_0x015a('0x22')]=function(_0xb8d9c5,_0x1a42b2){return db[_0x015a('0x27')][_0x015a('0x42')]({'where':{'id':_0xb8d9c5[_0x015a('0x41')]['id']}})[_0x015a('0x21')](handleEntityNotFound(_0x1a42b2,null))[_0x015a('0x21')](removeEntity(_0x1a42b2,null))[_0x015a('0x3f')](handleError(_0x1a42b2,null));};exports[_0x015a('0x45')]=function(_0x2ddafe,_0x24cc15){return db[_0x015a('0x27')][_0x015a('0x45')]()[_0x015a('0x21')](respondWithResult(_0x24cc15,null))['catch'](handleError(_0x24cc15,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index 3164c5b..345998c 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 _0x7581=['uniqueid','destuniqueid','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','VoiceAgentReport','report_agent'];(function(_0x28c939,_0x110e29){var _0x527fe9=function(_0x1df2a6){while(--_0x1df2a6){_0x28c939['push'](_0x28c939['shift']());}};_0x527fe9(++_0x110e29);}(_0x7581,0xf9));var _0x1758=function(_0x54dbaa,_0x1e792d){_0x54dbaa=_0x54dbaa-0x0;var _0x23625d=_0x7581[_0x54dbaa];return _0x23625d;};'use strict';var _=require(_0x1758('0x0'));var util=require(_0x1758('0x1'));var logger=require(_0x1758('0x2'))('api');var moment=require(_0x1758('0x3'));var BPromise=require('bluebird');var rp=require(_0x1758('0x4'));var fs=require('fs');var path=require(_0x1758('0x5'));var rimraf=require(_0x1758('0x6'));var config=require(_0x1758('0x7'));var attributes=require('./voiceAgentReport.attributes');module[_0x1758('0x8')]=function(_0x55e372,_0x338abc){return _0x55e372['define'](_0x1758('0x9'),attributes,{'tableName':_0x1758('0xa'),'paranoid':![],'indexes':[{'fields':[_0x1758('0xb'),_0x1758('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xda60=['uniqueid','destuniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xda60,0x102));var _0x0da6=function(_0x662a05,_0x541cc5){_0x662a05=_0x662a05-0x0;var _0x421218=_0xda60[_0x662a05];return _0x421218;};'use strict';var _=require(_0x0da6('0x0'));var util=require(_0x0da6('0x1'));var logger=require(_0x0da6('0x2'))(_0x0da6('0x3'));var moment=require(_0x0da6('0x4'));var BPromise=require('bluebird');var rp=require(_0x0da6('0x5'));var fs=require('fs');var path=require(_0x0da6('0x6'));var rimraf=require(_0x0da6('0x7'));var config=require(_0x0da6('0x8'));var attributes=require(_0x0da6('0x9'));module[_0x0da6('0xa')]=function(_0x440b59,_0x39f645){return _0x440b59[_0x0da6('0xb')](_0x0da6('0xc'),attributes,{'tableName':_0x0da6('0xd'),'paranoid':![],'indexes':[{'fields':[_0x0da6('0xe'),_0x0da6('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index e055092..698059d 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 _0x9957=['catch','CreateVoiceAgentReport','create','options','raw','UpdateVoiceAgentReport','update','body','where','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x4c8f89,_0x318d19){var _0x5c5685=function(_0x28ea15){while(--_0x28ea15){_0x4c8f89['push'](_0x4c8f89['shift']());}};_0x5c5685(++_0x318d19);}(_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']('VoiceAgentReport,\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['VoiceAgentReport'][_0x7995('0x19')](_0x291317['body'],{'raw':_0x291317['options']?_0x291317[_0x7995('0x1a')][_0x7995('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x3a9b54){logger['info']('CreateVoiceAgentReport',_0x291317);logger[_0x7995('0x10')](_0x7995('0x18'),_0x291317,JSON[_0x7995('0x12')](_0x3a9b54));_0x37a7d4(_0x3a9b54);})[_0x7995('0x17')](function(_0x460924){logger[_0x7995('0x13')]('CreateVoiceAgentReport',_0x460924[_0x7995('0x15')],_0x291317);_0x4faa60(_0x1e1415[_0x7995('0x13')](0x1f4,_0x460924[_0x7995('0x15')]));});});};exports[_0x7995('0x1c')]=function(_0x563799){var _0x13bc35=this;return new Promise(function(_0x475351,_0x472195){return db['VoiceAgentReport'][_0x7995('0x1d')](_0x563799[_0x7995('0x1e')],{'raw':_0x563799[_0x7995('0x1a')]?_0x563799[_0x7995('0x1a')][_0x7995('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x563799[_0x7995('0x1a')]?_0x563799['options'][_0x7995('0x1f')]||null:null,'attributes':_0x563799['options']?_0x563799[_0x7995('0x1a')][_0x7995('0x20')]||null:null,'limit':_0x563799[_0x7995('0x1a')]?_0x563799[_0x7995('0x1a')][_0x7995('0x21')]||null:null})['then'](function(_0x9b2a15){logger['info'](_0x7995('0x1c'),_0x563799);logger[_0x7995('0x10')](_0x7995('0x1c'),_0x563799,JSON['stringify'](_0x9b2a15));_0x475351(_0x9b2a15);})['catch'](function(_0x48e573){logger[_0x7995('0x13')](_0x7995('0x1c'),_0x48e573[_0x7995('0x15')],_0x563799);_0x472195(_0x13bc35[_0x7995('0x13')](0x1f4,_0x48e573[_0x7995('0x15')]));});});}; \ No newline at end of file +var _0x814b=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateVoiceAgentReport','body','raw','stringify','VoiceAgentReport','update','options','where','attributes','limit','UpdateVoiceAgentReport','lodash','util'];(function(_0x3690de,_0xaad404){var _0x9737de=function(_0x4bc616){while(--_0x4bc616){_0x3690de['push'](_0x3690de['shift']());}};_0x9737de(++_0xaad404);}(_0x814b,0x1a2));var _0xb814=function(_0x20c205,_0x39bc5e){_0x20c205=_0x20c205-0x0;var _0x3d6cf2=_0x814b[_0x20c205];return _0x3d6cf2;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('VoiceAgentReport,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}exports[_0xb814('0x18')]=function(_0x55ba16){var _0x270598=this;return new Promise(function(_0xfac75b,_0x4c3007){return db['VoiceAgentReport']['create'](_0x55ba16[_0xb814('0x19')],{'raw':_0x55ba16['options']?_0x55ba16['options'][_0xb814('0x1a')]===undefined?!![]:![]:!![]})[_0xb814('0xd')](function(_0x25b6b6){logger['info'](_0xb814('0x18'),_0x55ba16);logger['debug'](_0xb814('0x18'),_0x55ba16,JSON[_0xb814('0x1b')](_0x25b6b6));_0xfac75b(_0x25b6b6);})[_0xb814('0x17')](function(_0x470e81){logger[_0xb814('0x13')](_0xb814('0x18'),_0x470e81[_0xb814('0x15')],_0x55ba16);_0x4c3007(_0x270598['error'](0x1f4,_0x470e81[_0xb814('0x15')]));});});};exports['UpdateVoiceAgentReport']=function(_0x3f81d0){var _0x457dac=this;return new Promise(function(_0x31c7ec,_0x208927){return db[_0xb814('0x1c')][_0xb814('0x1d')](_0x3f81d0[_0xb814('0x19')],{'raw':_0x3f81d0['options']?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f81d0[_0xb814('0x1e')]?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x1f')]||null:null,'attributes':_0x3f81d0[_0xb814('0x1e')]?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x20')]||null:null,'limit':_0x3f81d0['options']?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x21')]||null:null})['then'](function(_0x9008b2){logger[_0xb814('0xe')](_0xb814('0x22'),_0x3f81d0);logger['debug'](_0xb814('0x22'),_0x3f81d0,JSON[_0xb814('0x1b')](_0x9008b2));_0x31c7ec(_0x9008b2);})['catch'](function(_0x338a28){logger['error'](_0xb814('0x22'),_0x338a28['message'],_0x3f81d0);_0x208927(_0x457dac['error'](0x1f4,_0x338a28[_0xb814('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 8afe57e..b502aef 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 _0x82fe=['update','delete','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/describe','describe','get','isAuthenticated','show','create'];(function(_0x424900,_0x5565b8){var _0x32968d=function(_0x1255c9){while(--_0x1255c9){_0x424900['push'](_0x424900['shift']());}};_0x32968d(++_0x5565b8);}(_0x82fe,0x1ef));var _0xe82f=function(_0x4f75b5,_0x4db76d){_0x4f75b5=_0x4f75b5-0x0;var _0x5c263b=_0x82fe[_0x4f75b5];return _0x5c263b;};'use strict';var multer=require(_0xe82f('0x0'));var util=require(_0xe82f('0x1'));var path=require(_0xe82f('0x2'));var timeout=require(_0xe82f('0x3'));var express=require('express');var router=express[_0xe82f('0x4')]();var auth=require(_0xe82f('0x5'));var interaction=require(_0xe82f('0x6'));var config=require(_0xe82f('0x7'));var controller=require('./voiceCallReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xe82f('0x8')]);router['get'](_0xe82f('0x9'),auth['isAuthenticated'](),controller[_0xe82f('0xa')]);router[_0xe82f('0xb')]('/:id',auth[_0xe82f('0xc')](),controller[_0xe82f('0xd')]);router['post']('/',auth[_0xe82f('0xc')](),controller[_0xe82f('0xe')]);router['put']('/:id',auth[_0xe82f('0xc')](),controller[_0xe82f('0xf')]);router[_0xe82f('0x10')]('/:id',auth[_0xe82f('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x4932=['put','destroy','exports','multer','util','path','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','index','isAuthenticated','describe','get','/:id','create'];(function(_0x403fc7,_0x32931a){var _0x5d0827=function(_0x5ea698){while(--_0x5ea698){_0x403fc7['push'](_0x403fc7['shift']());}};_0x5d0827(++_0x32931a);}(_0x4932,0x15c));var _0x2493=function(_0x3c13bc,_0x4c385b){_0x3c13bc=_0x3c13bc-0x0;var _0x1a2c27=_0x4932[_0x3c13bc];return _0x1a2c27;};'use strict';var multer=require(_0x2493('0x0'));var util=require(_0x2493('0x1'));var path=require(_0x2493('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x2493('0x3'));var config=require(_0x2493('0x4'));var controller=require(_0x2493('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x2493('0x6')]);router['get']('/describe',auth[_0x2493('0x7')](),controller[_0x2493('0x8')]);router[_0x2493('0x9')](_0x2493('0xa'),auth[_0x2493('0x7')](),controller['show']);router['post']('/',auth[_0x2493('0x7')](),controller[_0x2493('0xb')]);router[_0x2493('0xc')](_0x2493('0xa'),auth[_0x2493('0x7')](),controller['update']);router['delete'](_0x2493('0xa'),auth['isAuthenticated'](),controller[_0x2493('0xd')]);module[_0x2493('0xe')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index c7300a0..e8f62d4 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 _0x4bf0=['TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound','internal','inbound-fax','outbound-fax'];(function(_0x562e5a,_0x2acd72){var _0x39fb42=function(_0x3799d6){while(--_0x3799d6){_0x562e5a['push'](_0x562e5a['shift']());}};_0x39fb42(++_0x2acd72);}(_0x4bf0,0x137));var _0x04bf=function(_0x807724,_0x39250b){_0x807724=_0x807724-0x0;var _0x3890ba=_0x4bf0[_0x807724];return _0x3890ba;};'use strict';var Sequelize=require(_0x04bf('0x0'));module[_0x04bf('0x1')]={'uniqueid':{'type':Sequelize[_0x04bf('0x2')]},'type':{'type':Sequelize[_0x04bf('0x3')](_0x04bf('0x4'),_0x04bf('0x5'),'outbound',_0x04bf('0x6'),_0x04bf('0x7'),'dialer')},'tag':{'type':Sequelize[_0x04bf('0x2')]},'accountcode':{'type':Sequelize[_0x04bf('0x2')]},'source':{'type':Sequelize[_0x04bf('0x2')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0x04bf('0x2')]},'callerid':{'type':Sequelize[_0x04bf('0x2')]},'channel':{'type':Sequelize[_0x04bf('0x2')]},'destinationchannel':{'type':Sequelize[_0x04bf('0x2')]},'lastapplication':{'type':Sequelize[_0x04bf('0x2')]},'lastdata':{'type':Sequelize[_0x04bf('0x8')]},'starttime':{'type':Sequelize[_0x04bf('0x9')]},'systemanswertime':{'type':Sequelize[_0x04bf('0x9')]},'answertime':{'type':Sequelize[_0x04bf('0x9')]},'endtime':{'type':Sequelize[_0x04bf('0x9')]},'duration':{'type':Sequelize[_0x04bf('0xa')]},'billableseconds':{'type':Sequelize[_0x04bf('0xa')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x04bf('0x2')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x04bf('0x2')]},'note':{'type':Sequelize[_0x04bf('0x2')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0x04bf('0xa')]},'sipcallid':{'type':Sequelize[_0x04bf('0x2')]}}; \ No newline at end of file +var _0xd8a3=['STRING','ENUM','inbound','internal','outbound','inbound-fax','TEXT','DATE','INTEGER','sequelize'];(function(_0x216799,_0x44b817){var _0x3661c3=function(_0x28f85e){while(--_0x28f85e){_0x216799['push'](_0x216799['shift']());}};_0x3661c3(++_0x44b817);}(_0xd8a3,0xdb));var _0x3d8a=function(_0x25f00d,_0xafd3fd){_0x25f00d=_0x25f00d-0x0;var _0x376f18=_0xd8a3[_0x25f00d];return _0x376f18;};'use strict';var Sequelize=require(_0x3d8a('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x3d8a('0x1')]},'type':{'type':Sequelize[_0x3d8a('0x2')](_0x3d8a('0x3'),_0x3d8a('0x4'),_0x3d8a('0x5'),_0x3d8a('0x6'),'outbound-fax','dialer')},'tag':{'type':Sequelize[_0x3d8a('0x1')]},'accountcode':{'type':Sequelize[_0x3d8a('0x1')]},'source':{'type':Sequelize[_0x3d8a('0x1')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0x3d8a('0x1')]},'callerid':{'type':Sequelize[_0x3d8a('0x1')]},'channel':{'type':Sequelize[_0x3d8a('0x1')]},'destinationchannel':{'type':Sequelize[_0x3d8a('0x1')]},'lastapplication':{'type':Sequelize[_0x3d8a('0x1')]},'lastdata':{'type':Sequelize[_0x3d8a('0x7')]},'starttime':{'type':Sequelize[_0x3d8a('0x8')]},'systemanswertime':{'type':Sequelize[_0x3d8a('0x8')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x3d8a('0x8')]},'duration':{'type':Sequelize[_0x3d8a('0x9')]},'billableseconds':{'type':Sequelize[_0x3d8a('0x9')]},'mohtime':{'type':Sequelize[_0x3d8a('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x3d8a('0x1')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x3d8a('0x1')]},'userDisposition':{'type':Sequelize[_0x3d8a('0x1')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0x3d8a('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index e72ba87..497b9f5 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 _0xb8f9=['sox','to-csv','ejs','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','map','type','key','VIRTUAL','field','options','VoiceCallReport','include','alias','User','findAll','rows','catch','show','includeAll','find','body','describe','uniqueid','params','user','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','path'];(function(_0x99c413,_0x2cfd2a){var _0x5b1038=function(_0x49f700){while(--_0x49f700){_0x99c413['push'](_0x99c413['shift']());}};_0x5b1038(++_0x2cfd2a);}(_0xb8f9,0xe6));var _0x9b8f=function(_0x3cd283,_0x2b8542){_0x3cd283=_0x3cd283-0x0;var _0x5ea1f0=_0xb8f9[_0x3cd283];return _0x5ea1f0;};'use strict';var pdf=require(_0x9b8f('0x0'));var emlformat=require(_0x9b8f('0x1'));var rimraf=require(_0x9b8f('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9b8f('0x3'));var rp=require('request-promise');var moment=require(_0x9b8f('0x4'));var BPromise=require(_0x9b8f('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9b8f('0x6'));var sox=require(_0x9b8f('0x7'));var csv=require(_0x9b8f('0x8'));var ejs=require(_0x9b8f('0x9'));var fs=require('fs');var _=require(_0x9b8f('0xa'));var squel=require('squel');var crypto=require(_0x9b8f('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9b8f('0x8'));var querystring=require(_0x9b8f('0xc'));var Papa=require(_0x9b8f('0xd'));var Redis=require(_0x9b8f('0xe'));var authService=require(_0x9b8f('0xf'));var qs=require(_0x9b8f('0x10'));var hardwareService=require(_0x9b8f('0x11'));var logger=require(_0x9b8f('0x12'))(_0x9b8f('0x13'));var utils=require(_0x9b8f('0x14'));var config=require(_0x9b8f('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x77d970,_0x36610d){_0x36610d=_0x36610d||0xcc;return function(_0x49bbc2){if(_0x49bbc2){return _0x77d970[_0x9b8f('0x16')](_0x36610d);}return _0x77d970[_0x9b8f('0x17')](_0x36610d)[_0x9b8f('0x18')]();};}function respondWithResult(_0x15c180,_0x22bce6){_0x22bce6=_0x22bce6||0xc8;return function(_0x4471e9){if(_0x4471e9){return _0x15c180[_0x9b8f('0x17')](_0x22bce6)[_0x9b8f('0x19')](_0x4471e9);}};}function respondWithFilteredResult(_0x129efd,_0x38623b){return function(_0x14b6d0){if(_0x14b6d0){var _0xd2d80b=_0x14b6d0[_0x9b8f('0x1a')],_0x12990a=_0x38623b[_0x9b8f('0x1b')],_0x590f79=_0x38623b[_0x9b8f('0x1b')]+_0x38623b[_0x9b8f('0x1c')],_0x3f9d75;if(_0x590f79>=_0xd2d80b){_0x590f79=_0xd2d80b;_0x3f9d75=0xc8;}else{_0x3f9d75=0xce;}_0x129efd[_0x9b8f('0x17')](_0x3f9d75);return _0x129efd[_0x9b8f('0x1d')](_0x9b8f('0x1e'),_0x12990a+'-'+_0x590f79+'/'+_0xd2d80b)[_0x9b8f('0x19')](_0x14b6d0);}return null;};}function patchUpdates(_0xd4015c){return function(_0x303c60){try{jsonpatch[_0x9b8f('0x1f')](_0x303c60,_0xd4015c,!![]);}catch(_0x2bf23e){return BPromise[_0x9b8f('0x20')](_0x2bf23e);}return _0x303c60[_0x9b8f('0x21')]();};}function saveUpdates(_0x426c38,_0x4a1c5e){return function(_0x33bfc1){if(_0x33bfc1){return _0x33bfc1[_0x9b8f('0x22')](_0x426c38)[_0x9b8f('0x23')](function(_0x1e99f5){return _0x1e99f5;});}return null;};}function removeEntity(_0x1da034,_0x538d42){return function(_0x13f652){if(_0x13f652){return _0x13f652[_0x9b8f('0x24')]()[_0x9b8f('0x23')](function(){_0x1da034['status'](0xcc)[_0x9b8f('0x18')]();});}};}function handleEntityNotFound(_0x4e22ab,_0x4bdb61){return function(_0x4743d){if(!_0x4743d){_0x4e22ab[_0x9b8f('0x16')](0x194);}return _0x4743d;};}function handleError(_0x5d14c9,_0x1e5d60){_0x1e5d60=_0x1e5d60||0x1f4;return function(_0xd60782){logger[_0x9b8f('0x25')](_0xd60782[_0x9b8f('0x26')]);if(_0xd60782['name']){delete _0xd60782[_0x9b8f('0x27')];}_0x5d14c9[_0x9b8f('0x17')](_0x1e5d60)[_0x9b8f('0x28')](_0xd60782);};}exports['index']=function(_0x3b8750,_0x49c19b){var _0x5202e8={},_0x35fb28={},_0x510cb5={'count':0x0,'rows':[]};var _0x485e30=db['VoiceCallReport'][_0x9b8f('0x29')];_0x35fb28[_0x9b8f('0x2a')]=_['keys'](_0x485e30);_0x35fb28[_0x9b8f('0x2b')]=_[_0x9b8f('0x2c')](_0x3b8750[_0x9b8f('0x2b')]);_0x35fb28[_0x9b8f('0x2d')]=_[_0x9b8f('0x2e')](_0x35fb28[_0x9b8f('0x2a')],_0x35fb28[_0x9b8f('0x2b')]);_0x5202e8['attributes']=_['intersection'](_0x35fb28[_0x9b8f('0x2a')],qs[_0x9b8f('0x2f')](_0x3b8750[_0x9b8f('0x2b')][_0x9b8f('0x2f')]));_0x5202e8[_0x9b8f('0x30')]=_0x5202e8[_0x9b8f('0x30')][_0x9b8f('0x31')]?_0x5202e8['attributes']:_0x35fb28[_0x9b8f('0x2a')];if(!_0x3b8750['query'][_0x9b8f('0x32')](_0x9b8f('0x33'))){_0x5202e8[_0x9b8f('0x1c')]=qs[_0x9b8f('0x1c')](_0x3b8750['query'][_0x9b8f('0x1c')]);_0x5202e8['offset']=qs[_0x9b8f('0x1b')](_0x3b8750['query'][_0x9b8f('0x1b')]);}_0x5202e8[_0x9b8f('0x34')]=qs[_0x9b8f('0x35')](_0x3b8750['query'][_0x9b8f('0x35')]);_0x5202e8['where']=qs['filters'](_[_0x9b8f('0x36')](_0x3b8750[_0x9b8f('0x2b')],_0x35fb28['filters']));if(_0x3b8750[_0x9b8f('0x2b')][_0x9b8f('0x37')]){_0x5202e8['where']=_[_0x9b8f('0x38')](_0x5202e8[_0x9b8f('0x39')],{'$or':_[_0x9b8f('0x3a')](_0x485e30,function(_0x4534ed){if(_0x4534ed[_0x9b8f('0x3b')][_0x9b8f('0x3c')]!==_0x9b8f('0x3d')){var _0x4eb779={};_0x4eb779[_0x4534ed[_0x9b8f('0x3e')]]={'$like':'%'+_0x3b8750[_0x9b8f('0x2b')][_0x9b8f('0x37')]+'%'};return _0x4eb779;}})});}_0x5202e8=_[_0x9b8f('0x38')]({},_0x5202e8,_0x3b8750[_0x9b8f('0x3f')]);var _0x2859c3={'where':_0x5202e8[_0x9b8f('0x39')]};return db[_0x9b8f('0x40')][_0x9b8f('0x1a')](_0x2859c3)[_0x9b8f('0x23')](function(_0x4bd1e4){_0x510cb5[_0x9b8f('0x1a')]=_0x4bd1e4;if(_0x3b8750[_0x9b8f('0x2b')]['includeAll']){_0x5202e8[_0x9b8f('0x41')]=[{'attributes':['id',_0x9b8f('0x27'),'fullname',_0x9b8f('0x42')],'model':db[_0x9b8f('0x43')],'as':'User'}];}return db['VoiceCallReport'][_0x9b8f('0x44')](_0x5202e8);})[_0x9b8f('0x23')](function(_0x1b4aa9){_0x510cb5[_0x9b8f('0x45')]=_0x1b4aa9;return _0x510cb5;})[_0x9b8f('0x23')](respondWithFilteredResult(_0x49c19b,_0x5202e8))[_0x9b8f('0x46')](handleError(_0x49c19b,null));};exports[_0x9b8f('0x47')]=function(_0xede1cc,_0xc35d1c){var _0x5b6d12={'raw':!![],'where':{'id':_0xede1cc['params']['id']}},_0x1ab3fe={};_0x1ab3fe['model']=_[_0x9b8f('0x2c')](db[_0x9b8f('0x40')][_0x9b8f('0x29')]);_0x1ab3fe[_0x9b8f('0x2b')]=_[_0x9b8f('0x2c')](_0xede1cc['query']);_0x1ab3fe[_0x9b8f('0x2d')]=_[_0x9b8f('0x2e')](_0x1ab3fe['model'],_0x1ab3fe['query']);_0x5b6d12[_0x9b8f('0x30')]=_[_0x9b8f('0x2e')](_0x1ab3fe[_0x9b8f('0x2a')],qs['fields'](_0xede1cc[_0x9b8f('0x2b')][_0x9b8f('0x2f')]));_0x5b6d12[_0x9b8f('0x30')]=_0x5b6d12[_0x9b8f('0x30')][_0x9b8f('0x31')]?_0x5b6d12[_0x9b8f('0x30')]:_0x1ab3fe[_0x9b8f('0x2a')];if(_0xede1cc[_0x9b8f('0x2b')][_0x9b8f('0x48')]){_0x5b6d12[_0x9b8f('0x41')]=[{'all':!![]}];}_0x5b6d12=_[_0x9b8f('0x38')]({},_0x5b6d12,_0xede1cc[_0x9b8f('0x3f')]);return db[_0x9b8f('0x40')][_0x9b8f('0x49')](_0x5b6d12)[_0x9b8f('0x23')](handleEntityNotFound(_0xc35d1c,null))[_0x9b8f('0x23')](respondWithResult(_0xc35d1c,null))['catch'](handleError(_0xc35d1c,null));};exports['create']=function(_0x15ec92,_0x2a9650){return db['VoiceCallReport']['create'](_0x15ec92[_0x9b8f('0x4a')],{})[_0x9b8f('0x23')](respondWithResult(_0x2a9650,0xc9))[_0x9b8f('0x46')](handleError(_0x2a9650,null));};exports['destroy']=function(_0x85d969,_0x196269){return db[_0x9b8f('0x40')]['find']({'where':{'id':_0x85d969['params']['id']}})[_0x9b8f('0x23')](handleEntityNotFound(_0x196269,null))[_0x9b8f('0x23')](removeEntity(_0x196269,null))[_0x9b8f('0x46')](handleError(_0x196269,null));};exports[_0x9b8f('0x4b')]=function(_0x1e706a,_0x5430cb){return db[_0x9b8f('0x40')][_0x9b8f('0x4b')]()['then'](respondWithResult(_0x5430cb,null))[_0x9b8f('0x46')](handleError(_0x5430cb,null));};exports[_0x9b8f('0x22')]=function(_0x2e1919,_0x3fc690){if(_0x2e1919[_0x9b8f('0x4a')][_0x9b8f('0x4c')]){delete _0x2e1919[_0x9b8f('0x4a')][_0x9b8f('0x4c')];}return db[_0x9b8f('0x40')][_0x9b8f('0x49')]({'where':{'uniqueid':_0x2e1919[_0x9b8f('0x4d')]['id'],'UserId':{'$or':[null,_0x2e1919[_0x9b8f('0x4e')]['id']]}}})[_0x9b8f('0x23')](handleEntityNotFound(_0x3fc690,null))[_0x9b8f('0x23')](saveUpdates(_0x2e1919['body'],null))[_0x9b8f('0x23')](respondWithResult(_0x3fc690,null))[_0x9b8f('0x46')](handleError(_0x3fc690,null));}; \ No newline at end of file +var _0x03c2=['rawAttributes','keys','catch','create','body','find','describe','uniqueid','user','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','sox','ejs','crypto','desk.js','to-csv','papaparse','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','update','then','destroy','name','send','index','VoiceCallReport','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','count','includeAll','include','fullname','alias','User','rows','show','params'];(function(_0x531278,_0x9f32d3){var _0x242ddc=function(_0x25cd37){while(--_0x25cd37){_0x531278['push'](_0x531278['shift']());}};_0x242ddc(++_0x9f32d3);}(_0x03c2,0x9d));var _0x203c=function(_0x578ecf,_0x15f218){_0x578ecf=_0x578ecf-0x0;var _0x47a171=_0x03c2[_0x578ecf];return _0x47a171;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x203c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x203c('0x1'));var jsonpatch=require(_0x203c('0x2'));var rp=require('request-promise');var moment=require(_0x203c('0x3'));var BPromise=require(_0x203c('0x4'));var Mustache=require('mustache');var util=require(_0x203c('0x5'));var path=require('path');var sox=require(_0x203c('0x6'));var csv=require('to-csv');var ejs=require(_0x203c('0x7'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x203c('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x203c('0x9'));var toCsv=require(_0x203c('0xa'));var querystring=require('querystring');var Papa=require(_0x203c('0xb'));var Redis=require(_0x203c('0xc'));var authService=require(_0x203c('0xd'));var qs=require(_0x203c('0xe'));var hardwareService=require(_0x203c('0xf'));var logger=require(_0x203c('0x10'))(_0x203c('0x11'));var utils=require(_0x203c('0x12'));var config=require(_0x203c('0x13'));var db=require(_0x203c('0x14'))['db'];function respondWithStatusCode(_0x16cbb9,_0x3a1873){_0x3a1873=_0x3a1873||0xcc;return function(_0x531aea){if(_0x531aea){return _0x16cbb9['sendStatus'](_0x3a1873);}return _0x16cbb9[_0x203c('0x15')](_0x3a1873)[_0x203c('0x16')]();};}function respondWithResult(_0x3d7159,_0x5dd388){_0x5dd388=_0x5dd388||0xc8;return function(_0x1eb156){if(_0x1eb156){return _0x3d7159[_0x203c('0x15')](_0x5dd388)[_0x203c('0x17')](_0x1eb156);}};}function respondWithFilteredResult(_0x35c3fa,_0x100e64){return function(_0x1a3d3b){if(_0x1a3d3b){var _0x277786=_0x1a3d3b['count'],_0x5f7fee=_0x100e64[_0x203c('0x18')],_0x1266c8=_0x100e64[_0x203c('0x18')]+_0x100e64[_0x203c('0x19')],_0x5aba1a;if(_0x1266c8>=_0x277786){_0x1266c8=_0x277786;_0x5aba1a=0xc8;}else{_0x5aba1a=0xce;}_0x35c3fa[_0x203c('0x15')](_0x5aba1a);return _0x35c3fa[_0x203c('0x1a')](_0x203c('0x1b'),_0x5f7fee+'-'+_0x1266c8+'/'+_0x277786)['json'](_0x1a3d3b);}return null;};}function patchUpdates(_0x2305dc){return function(_0x4a355b){try{jsonpatch[_0x203c('0x1c')](_0x4a355b,_0x2305dc,!![]);}catch(_0x5219c8){return BPromise[_0x203c('0x1d')](_0x5219c8);}return _0x4a355b[_0x203c('0x1e')]();};}function saveUpdates(_0x1843ee,_0x40684f){return function(_0x27e9e5){if(_0x27e9e5){return _0x27e9e5[_0x203c('0x1f')](_0x1843ee)[_0x203c('0x20')](function(_0x31f692){return _0x31f692;});}return null;};}function removeEntity(_0x45bb38,_0x466766){return function(_0x24a78d){if(_0x24a78d){return _0x24a78d[_0x203c('0x21')]()[_0x203c('0x20')](function(){_0x45bb38[_0x203c('0x15')](0xcc)[_0x203c('0x16')]();});}};}function handleEntityNotFound(_0x3d5e85,_0x535dcb){return function(_0x15102d){if(!_0x15102d){_0x3d5e85['sendStatus'](0x194);}return _0x15102d;};}function handleError(_0x4c582f,_0x467398){_0x467398=_0x467398||0x1f4;return function(_0x2c8b19){logger['error'](_0x2c8b19['stack']);if(_0x2c8b19[_0x203c('0x22')]){delete _0x2c8b19['name'];}_0x4c582f[_0x203c('0x15')](_0x467398)[_0x203c('0x23')](_0x2c8b19);};}exports[_0x203c('0x24')]=function(_0xe01f47,_0x33d932){var _0x766216={},_0x2c73f5={},_0x3655e4={'count':0x0,'rows':[]};var _0x44b52c=db[_0x203c('0x25')]['rawAttributes'];_0x2c73f5[_0x203c('0x26')]=_['keys'](_0x44b52c);_0x2c73f5[_0x203c('0x27')]=_['keys'](_0xe01f47[_0x203c('0x27')]);_0x2c73f5[_0x203c('0x28')]=_[_0x203c('0x29')](_0x2c73f5['model'],_0x2c73f5[_0x203c('0x27')]);_0x766216[_0x203c('0x2a')]=_[_0x203c('0x29')](_0x2c73f5['model'],qs[_0x203c('0x2b')](_0xe01f47['query'][_0x203c('0x2b')]));_0x766216[_0x203c('0x2a')]=_0x766216['attributes'][_0x203c('0x2c')]?_0x766216[_0x203c('0x2a')]:_0x2c73f5['model'];if(!_0xe01f47['query'][_0x203c('0x2d')](_0x203c('0x2e'))){_0x766216[_0x203c('0x19')]=qs[_0x203c('0x19')](_0xe01f47[_0x203c('0x27')][_0x203c('0x19')]);_0x766216['offset']=qs['offset'](_0xe01f47[_0x203c('0x27')][_0x203c('0x18')]);}_0x766216[_0x203c('0x2f')]=qs[_0x203c('0x30')](_0xe01f47['query'][_0x203c('0x30')]);_0x766216[_0x203c('0x31')]=qs[_0x203c('0x28')](_[_0x203c('0x32')](_0xe01f47[_0x203c('0x27')],_0x2c73f5['filters']));if(_0xe01f47[_0x203c('0x27')][_0x203c('0x33')]){_0x766216[_0x203c('0x31')]=_[_0x203c('0x34')](_0x766216['where'],{'$or':_[_0x203c('0x35')](_0x44b52c,function(_0x500911){if(_0x500911['type'][_0x203c('0x36')]!==_0x203c('0x37')){var _0x6d9cec={};_0x6d9cec[_0x500911['field']]={'$like':'%'+_0xe01f47[_0x203c('0x27')][_0x203c('0x33')]+'%'};return _0x6d9cec;}})});}_0x766216=_['merge']({},_0x766216,_0xe01f47['options']);var _0x4c5ef9={'where':_0x766216['where']};return db[_0x203c('0x25')]['count'](_0x4c5ef9)[_0x203c('0x20')](function(_0x2acfc2){_0x3655e4[_0x203c('0x38')]=_0x2acfc2;if(_0xe01f47['query'][_0x203c('0x39')]){_0x766216[_0x203c('0x3a')]=[{'attributes':['id',_0x203c('0x22'),_0x203c('0x3b'),_0x203c('0x3c')],'model':db['User'],'as':_0x203c('0x3d')}];}return db[_0x203c('0x25')]['findAll'](_0x766216);})['then'](function(_0x28ce38){_0x3655e4[_0x203c('0x3e')]=_0x28ce38;return _0x3655e4;})[_0x203c('0x20')](respondWithFilteredResult(_0x33d932,_0x766216))['catch'](handleError(_0x33d932,null));};exports[_0x203c('0x3f')]=function(_0x2dbbf9,_0x4503a6){var _0x3d5818={'raw':!![],'where':{'id':_0x2dbbf9[_0x203c('0x40')]['id']}},_0xeec62b={};_0xeec62b[_0x203c('0x26')]=_['keys'](db[_0x203c('0x25')][_0x203c('0x41')]);_0xeec62b['query']=_[_0x203c('0x42')](_0x2dbbf9[_0x203c('0x27')]);_0xeec62b[_0x203c('0x28')]=_[_0x203c('0x29')](_0xeec62b[_0x203c('0x26')],_0xeec62b[_0x203c('0x27')]);_0x3d5818['attributes']=_['intersection'](_0xeec62b[_0x203c('0x26')],qs[_0x203c('0x2b')](_0x2dbbf9[_0x203c('0x27')][_0x203c('0x2b')]));_0x3d5818['attributes']=_0x3d5818[_0x203c('0x2a')]['length']?_0x3d5818[_0x203c('0x2a')]:_0xeec62b[_0x203c('0x26')];if(_0x2dbbf9['query']['includeAll']){_0x3d5818[_0x203c('0x3a')]=[{'all':!![]}];}_0x3d5818=_[_0x203c('0x34')]({},_0x3d5818,_0x2dbbf9['options']);return db[_0x203c('0x25')]['find'](_0x3d5818)[_0x203c('0x20')](handleEntityNotFound(_0x4503a6,null))['then'](respondWithResult(_0x4503a6,null))[_0x203c('0x43')](handleError(_0x4503a6,null));};exports[_0x203c('0x44')]=function(_0x1bb5c1,_0x1f3e4f){return db['VoiceCallReport']['create'](_0x1bb5c1[_0x203c('0x45')],{})[_0x203c('0x20')](respondWithResult(_0x1f3e4f,0xc9))[_0x203c('0x43')](handleError(_0x1f3e4f,null));};exports[_0x203c('0x21')]=function(_0x20dd4d,_0xb6af09){return db[_0x203c('0x25')][_0x203c('0x46')]({'where':{'id':_0x20dd4d[_0x203c('0x40')]['id']}})[_0x203c('0x20')](handleEntityNotFound(_0xb6af09,null))[_0x203c('0x20')](removeEntity(_0xb6af09,null))[_0x203c('0x43')](handleError(_0xb6af09,null));};exports['describe']=function(_0x1aedde,_0x447c87){return db[_0x203c('0x25')][_0x203c('0x47')]()[_0x203c('0x20')](respondWithResult(_0x447c87,null))[_0x203c('0x43')](handleError(_0x447c87,null));};exports[_0x203c('0x1f')]=function(_0x2b06c0,_0x155982){if(_0x2b06c0[_0x203c('0x45')][_0x203c('0x48')]){delete _0x2b06c0[_0x203c('0x45')]['uniqueid'];}return db[_0x203c('0x25')][_0x203c('0x46')]({'where':{'uniqueid':_0x2b06c0[_0x203c('0x40')]['id'],'UserId':{'$or':[null,_0x2b06c0[_0x203c('0x49')]['id']]}}})[_0x203c('0x20')](handleEntityNotFound(_0x155982,null))[_0x203c('0x20')](saveUpdates(_0x2b06c0[_0x203c('0x45')],null))[_0x203c('0x20')](respondWithResult(_0x155982,null))[_0x203c('0x43')](handleError(_0x155982,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 2825e78..f976f7c 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 _0xcf7d=['rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','report_call','util','api','moment','bluebird','request-promise','path'];(function(_0x2f2908,_0x31ed5d){var _0x521c1f=function(_0x40090a){while(--_0x40090a){_0x2f2908['push'](_0x2f2908['shift']());}};_0x521c1f(++_0x31ed5d);}(_0xcf7d,0x186));var _0xdcf7=function(_0x489bb5,_0x4b7caa){_0x489bb5=_0x489bb5-0x0;var _0x55ef76=_0xcf7d[_0x489bb5];return _0x55ef76;};'use strict';var _=require('lodash');var util=require(_0xdcf7('0x0'));var logger=require('../../config/logger')(_0xdcf7('0x1'));var moment=require(_0xdcf7('0x2'));var BPromise=require(_0xdcf7('0x3'));var rp=require(_0xdcf7('0x4'));var fs=require('fs');var path=require(_0xdcf7('0x5'));var rimraf=require(_0xdcf7('0x6'));var config=require(_0xdcf7('0x7'));var attributes=require(_0xdcf7('0x8'));module[_0xdcf7('0x9')]=function(_0x4205f8,_0x5ab04d){return _0x4205f8[_0xdcf7('0xa')]('VoiceCallReport',attributes,{'tableName':_0xdcf7('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xceee=['define','VoiceCallReport','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','exports'];(function(_0xe33f53,_0x50ee2e){var _0x21a01b=function(_0x4490cb){while(--_0x4490cb){_0xe33f53['push'](_0xe33f53['shift']());}};_0x21a01b(++_0x50ee2e);}(_0xceee,0x1bb));var _0xecee=function(_0x43a42c,_0x236c5d){_0x43a42c=_0x43a42c-0x0;var _0x141378=_0xceee[_0x43a42c];return _0x141378;};'use strict';var _=require(_0xecee('0x0'));var util=require(_0xecee('0x1'));var logger=require(_0xecee('0x2'))(_0xecee('0x3'));var moment=require(_0xecee('0x4'));var BPromise=require('bluebird');var rp=require(_0xecee('0x5'));var fs=require('fs');var path=require(_0xecee('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceCallReport.attributes');module[_0xecee('0x7')]=function(_0x10193a,_0x251456){return _0x10193a[_0xecee('0x8')](_0xecee('0x9'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0xecee('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 62b8c5a..dbd2414 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 _0x004e=['CreateVoiceCallReport','create','body','UpdateVoiceCallReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceCallReport,\x20%s,\x20%s','message','request\x20sent','result','GetVoiceCallReport','VoiceCallReport','options','raw','where','limit','include','map','attributes','model','catch'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x004e,0x9c));var _0xe004=function(_0x3ac661,_0xba5e99){_0x3ac661=_0x3ac661-0x0;var _0x1ef48c=_0x004e[_0x3ac661];return _0x1ef48c;};'use strict';var _=require(_0xe004('0x0'));var util=require(_0xe004('0x1'));var moment=require(_0xe004('0x2'));var BPromise=require(_0xe004('0x3'));var rs=require(_0xe004('0x4'));var fs=require('fs');var Redis=require(_0xe004('0x5'));var db=require(_0xe004('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe004('0x7'));var config=require(_0xe004('0x8'));var jayson=require(_0xe004('0x9'));var client=jayson[_0xe004('0xa')][_0xe004('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2af9b3,_0x2937ac,_0x331712){return new BPromise(function(_0x50c497,_0x3b3490){return client['request'](_0x2af9b3,_0x331712)[_0xe004('0xc')](function(_0x5dfc38){logger[_0xe004('0xd')]('VoiceCallReport,\x20%s,\x20%s',_0x2937ac,'request\x20sent');logger[_0xe004('0xe')](_0xe004('0xf'),_0x2937ac,'request\x20sent',JSON[_0xe004('0x10')](_0x5dfc38));if(_0x5dfc38[_0xe004('0x11')]){if(_0x5dfc38['error'][_0xe004('0x12')]===0x1f4){logger['error'](_0xe004('0x13'),_0x2937ac,_0x5dfc38[_0xe004('0x11')][_0xe004('0x14')]);return _0x3b3490(_0x5dfc38[_0xe004('0x11')]['message']);}logger[_0xe004('0x11')](_0xe004('0x13'),_0x2937ac,_0x5dfc38[_0xe004('0x11')]['message']);return _0x50c497(_0x5dfc38['error'][_0xe004('0x14')]);}else{logger[_0xe004('0xd')](_0xe004('0x13'),_0x2937ac,_0xe004('0x15'));_0x50c497(_0x5dfc38[_0xe004('0x16')][_0xe004('0x14')]);}})['catch'](function(_0x51cbef){logger['error'](_0xe004('0x13'),_0x2937ac,_0x51cbef);_0x3b3490(_0x51cbef);});});}exports[_0xe004('0x17')]=function(_0x513c0a){var _0x41533e=this;return new Promise(function(_0x54bb43,_0x50b4e8){return db[_0xe004('0x18')]['findAll']({'raw':_0x513c0a[_0xe004('0x19')]?_0x513c0a[_0xe004('0x19')][_0xe004('0x1a')]===undefined?!![]:![]:!![],'where':_0x513c0a['options']?_0x513c0a[_0xe004('0x19')][_0xe004('0x1b')]||null:null,'attributes':_0x513c0a['options']?_0x513c0a[_0xe004('0x19')]['attributes']||null:null,'limit':_0x513c0a[_0xe004('0x19')]?_0x513c0a[_0xe004('0x19')][_0xe004('0x1c')]||null:null,'include':_0x513c0a[_0xe004('0x19')]?_0x513c0a[_0xe004('0x19')][_0xe004('0x1d')]?_[_0xe004('0x1e')](_0x513c0a['options'][_0xe004('0x1d')],function(_0x522362){return{'model':db[_0x522362['model']],'as':_0x522362['as'],'attributes':_0x522362[_0xe004('0x1f')],'include':_0x522362[_0xe004('0x1d')]?_['map'](_0x522362['include'],function(_0x587b48){return{'model':db[_0x587b48['model']],'as':_0x587b48['as'],'attributes':_0x587b48[_0xe004('0x1f')],'include':_0x587b48['include']?_[_0xe004('0x1e')](_0x587b48[_0xe004('0x1d')],function(_0xa52070){return{'model':db[_0xa52070[_0xe004('0x20')]],'as':_0xa52070['as'],'attributes':_0xa52070['attributes']};}):[]};}):[]};}):[]:[]})[_0xe004('0xc')](function(_0x34abed){logger[_0xe004('0xd')](_0xe004('0x17'),_0x513c0a);logger['debug'](_0xe004('0x17'),_0x513c0a,JSON[_0xe004('0x10')](_0x34abed));_0x54bb43(_0x34abed);})[_0xe004('0x21')](function(_0x212041){logger[_0xe004('0x11')](_0xe004('0x17'),_0x212041[_0xe004('0x14')],_0x513c0a);_0x50b4e8(_0x41533e[_0xe004('0x11')](0x1f4,_0x212041[_0xe004('0x14')]));});});};exports[_0xe004('0x22')]=function(_0x6c6092){var _0x307dbb=this;return new Promise(function(_0x16815c,_0x54c677){return db[_0xe004('0x18')][_0xe004('0x23')](_0x6c6092[_0xe004('0x24')],{'raw':_0x6c6092[_0xe004('0x19')]?_0x6c6092[_0xe004('0x19')][_0xe004('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x3b7fca){logger[_0xe004('0xd')]('CreateVoiceCallReport',_0x6c6092);logger['debug'](_0xe004('0x22'),_0x6c6092,JSON['stringify'](_0x3b7fca));_0x16815c(_0x3b7fca);})['catch'](function(_0x39a6f){logger[_0xe004('0x11')](_0xe004('0x22'),_0x39a6f[_0xe004('0x14')],_0x6c6092);_0x54c677(_0x307dbb[_0xe004('0x11')](0x1f4,_0x39a6f[_0xe004('0x14')]));});});};exports[_0xe004('0x25')]=function(_0x136ef7){var _0x5cd3ed=this;return new Promise(function(_0x268287,_0x44553c){return db[_0xe004('0x18')]['update'](_0x136ef7[_0xe004('0x24')],{'raw':_0x136ef7[_0xe004('0x19')]?_0x136ef7[_0xe004('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x136ef7['options']?_0x136ef7['options']['where']||null:null,'attributes':_0x136ef7[_0xe004('0x19')]?_0x136ef7[_0xe004('0x19')]['attributes']||null:null,'limit':_0x136ef7['options']?_0x136ef7[_0xe004('0x19')][_0xe004('0x1c')]||null:null})[_0xe004('0xc')](function(_0x1e9bac){logger[_0xe004('0xd')](_0xe004('0x25'),_0x136ef7);logger['debug'](_0xe004('0x25'),_0x136ef7,JSON[_0xe004('0x10')](_0x1e9bac));_0x268287(_0x1e9bac);})[_0xe004('0x21')](function(_0x54e6af){logger[_0xe004('0x11')]('UpdateVoiceCallReport',_0x54e6af[_0xe004('0x14')],_0x136ef7);_0x44553c(_0x5cd3ed[_0xe004('0x11')](0x1f4,_0x54e6af[_0xe004('0x14')]));});});}; \ No newline at end of file +var _0xea15=['CreateVoiceCallReport','body','raw','update','UpdateVoiceCallReport','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','where','attributes','limit','include','map','model'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xea15,0xe3));var _0x5ea1=function(_0x127168,_0x2d3c4e){_0x127168=_0x127168-0x0;var _0x27e9a1=_0xea15[_0x127168];return _0x27e9a1;};'use strict';var _=require(_0x5ea1('0x0'));var util=require('util');var moment=require(_0x5ea1('0x1'));var BPromise=require(_0x5ea1('0x2'));var rs=require(_0x5ea1('0x3'));var fs=require('fs');var Redis=require(_0x5ea1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5ea1('0x5'));var logger=require('../../config/logger')(_0x5ea1('0x6'));var config=require('../../config/environment');var jayson=require(_0x5ea1('0x7'));var client=jayson[_0x5ea1('0x8')][_0x5ea1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x56b8f2,_0x196cf2,_0x5a53d2){return new BPromise(function(_0x12d177,_0x3ca396){return client[_0x5ea1('0xa')](_0x56b8f2,_0x5a53d2)[_0x5ea1('0xb')](function(_0x1351e3){logger[_0x5ea1('0xc')](_0x5ea1('0xd'),_0x196cf2,_0x5ea1('0xe'));logger[_0x5ea1('0xf')](_0x5ea1('0x10'),_0x196cf2,_0x5ea1('0xe'),JSON[_0x5ea1('0x11')](_0x1351e3));if(_0x1351e3[_0x5ea1('0x12')]){if(_0x1351e3[_0x5ea1('0x12')]['code']===0x1f4){logger[_0x5ea1('0x12')](_0x5ea1('0xd'),_0x196cf2,_0x1351e3[_0x5ea1('0x12')][_0x5ea1('0x13')]);return _0x3ca396(_0x1351e3[_0x5ea1('0x12')][_0x5ea1('0x13')]);}logger[_0x5ea1('0x12')](_0x5ea1('0xd'),_0x196cf2,_0x1351e3['error'][_0x5ea1('0x13')]);return _0x12d177(_0x1351e3[_0x5ea1('0x12')]['message']);}else{logger['info']('VoiceCallReport,\x20%s,\x20%s',_0x196cf2,_0x5ea1('0xe'));_0x12d177(_0x1351e3[_0x5ea1('0x14')][_0x5ea1('0x13')]);}})[_0x5ea1('0x15')](function(_0xf175bc){logger[_0x5ea1('0x12')](_0x5ea1('0xd'),_0x196cf2,_0xf175bc);_0x3ca396(_0xf175bc);});});}exports[_0x5ea1('0x16')]=function(_0x5dc5cc){var _0x43a756=this;return new Promise(function(_0x1bd6b9,_0x5ef636){return db[_0x5ea1('0x17')][_0x5ea1('0x18')]({'raw':_0x5dc5cc['options']?_0x5dc5cc[_0x5ea1('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5dc5cc['options']?_0x5dc5cc[_0x5ea1('0x19')][_0x5ea1('0x1a')]||null:null,'attributes':_0x5dc5cc['options']?_0x5dc5cc[_0x5ea1('0x19')][_0x5ea1('0x1b')]||null:null,'limit':_0x5dc5cc[_0x5ea1('0x19')]?_0x5dc5cc[_0x5ea1('0x19')][_0x5ea1('0x1c')]||null:null,'include':_0x5dc5cc[_0x5ea1('0x19')]?_0x5dc5cc[_0x5ea1('0x19')][_0x5ea1('0x1d')]?_[_0x5ea1('0x1e')](_0x5dc5cc[_0x5ea1('0x19')][_0x5ea1('0x1d')],function(_0x289543){return{'model':db[_0x289543[_0x5ea1('0x1f')]],'as':_0x289543['as'],'attributes':_0x289543['attributes'],'include':_0x289543[_0x5ea1('0x1d')]?_['map'](_0x289543[_0x5ea1('0x1d')],function(_0x1463de){return{'model':db[_0x1463de['model']],'as':_0x1463de['as'],'attributes':_0x1463de['attributes'],'include':_0x1463de[_0x5ea1('0x1d')]?_[_0x5ea1('0x1e')](_0x1463de[_0x5ea1('0x1d')],function(_0xf8824){return{'model':db[_0xf8824[_0x5ea1('0x1f')]],'as':_0xf8824['as'],'attributes':_0xf8824['attributes']};}):[]};}):[]};}):[]:[]})[_0x5ea1('0xb')](function(_0xaf0d00){logger['info'](_0x5ea1('0x16'),_0x5dc5cc);logger[_0x5ea1('0xf')](_0x5ea1('0x16'),_0x5dc5cc,JSON[_0x5ea1('0x11')](_0xaf0d00));_0x1bd6b9(_0xaf0d00);})['catch'](function(_0x29c576){logger[_0x5ea1('0x12')](_0x5ea1('0x16'),_0x29c576[_0x5ea1('0x13')],_0x5dc5cc);_0x5ef636(_0x43a756['error'](0x1f4,_0x29c576[_0x5ea1('0x13')]));});});};exports[_0x5ea1('0x20')]=function(_0x49ed23){var _0x44eb7c=this;return new Promise(function(_0x1b5def,_0x4a0139){return db['VoiceCallReport']['create'](_0x49ed23[_0x5ea1('0x21')],{'raw':_0x49ed23[_0x5ea1('0x19')]?_0x49ed23[_0x5ea1('0x19')][_0x5ea1('0x22')]===undefined?!![]:![]:!![]})['then'](function(_0x400feb){logger[_0x5ea1('0xc')](_0x5ea1('0x20'),_0x49ed23);logger[_0x5ea1('0xf')]('CreateVoiceCallReport',_0x49ed23,JSON[_0x5ea1('0x11')](_0x400feb));_0x1b5def(_0x400feb);})['catch'](function(_0x143a62){logger[_0x5ea1('0x12')](_0x5ea1('0x20'),_0x143a62[_0x5ea1('0x13')],_0x49ed23);_0x4a0139(_0x44eb7c['error'](0x1f4,_0x143a62[_0x5ea1('0x13')]));});});};exports['UpdateVoiceCallReport']=function(_0x2b24a1){var _0x3a17df=this;return new Promise(function(_0xf7fd1e,_0x3d2a1d){return db[_0x5ea1('0x17')][_0x5ea1('0x23')](_0x2b24a1[_0x5ea1('0x21')],{'raw':_0x2b24a1[_0x5ea1('0x19')]?_0x2b24a1[_0x5ea1('0x19')][_0x5ea1('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b24a1[_0x5ea1('0x19')]?_0x2b24a1[_0x5ea1('0x19')][_0x5ea1('0x1a')]||null:null,'attributes':_0x2b24a1[_0x5ea1('0x19')]?_0x2b24a1[_0x5ea1('0x19')][_0x5ea1('0x1b')]||null:null,'limit':_0x2b24a1[_0x5ea1('0x19')]?_0x2b24a1['options'][_0x5ea1('0x1c')]||null:null})[_0x5ea1('0xb')](function(_0x24eb81){logger[_0x5ea1('0xc')](_0x5ea1('0x24'),_0x2b24a1);logger['debug'](_0x5ea1('0x24'),_0x2b24a1,JSON[_0x5ea1('0x11')](_0x24eb81));_0xf7fd1e(_0x24eb81);})[_0x5ea1('0x15')](function(_0x52d926){logger[_0x5ea1('0x12')](_0x5ea1('0x24'),_0x52d926[_0x5ea1('0x13')],_0x2b24a1);_0x3d2a1d(_0x3a17df[_0x5ea1('0x12')](0x1f4,_0x52d926[_0x5ea1('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index baa0390..274d529 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 _0x3e84=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','show','post','put','/:id','update','destroy','exports','util','path','connect-timeout','express'];(function(_0x20b720,_0x56866b){var _0x50697c=function(_0x4e486b){while(--_0x4e486b){_0x20b720['push'](_0x20b720['shift']());}};_0x50697c(++_0x56866b);}(_0x3e84,0xd4));var _0x43e8=function(_0x332264,_0x15ad59){_0x332264=_0x332264-0x0;var _0x214cd2=_0x3e84[_0x332264];return _0x214cd2;};'use strict';var multer=require('multer');var util=require(_0x43e8('0x0'));var path=require(_0x43e8('0x1'));var timeout=require(_0x43e8('0x2'));var express=require(_0x43e8('0x3'));var router=express[_0x43e8('0x4')]();var auth=require(_0x43e8('0x5'));var interaction=require(_0x43e8('0x6'));var config=require(_0x43e8('0x7'));var controller=require(_0x43e8('0x8'));router[_0x43e8('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x43e8('0x9')]('/:id',auth[_0x43e8('0xa')](),controller[_0x43e8('0xb')]);router[_0x43e8('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x43e8('0xd')](_0x43e8('0xe'),auth[_0x43e8('0xa')](),controller[_0x43e8('0xf')]);router['delete'](_0x43e8('0xe'),auth[_0x43e8('0xa')](),controller[_0x43e8('0x10')]);module[_0x43e8('0x11')]=router; \ No newline at end of file +var _0xc803=['delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','/:id','isAuthenticated','show','post','put'];(function(_0x16d2f3,_0x332f03){var _0x5cf03b=function(_0x129c29){while(--_0x129c29){_0x16d2f3['push'](_0x16d2f3['shift']());}};_0x5cf03b(++_0x332f03);}(_0xc803,0x1cd));var _0x3c80=function(_0x4c89fb,_0x320d7d){_0x4c89fb=_0x4c89fb-0x0;var _0x1ab19a=_0xc803[_0x4c89fb];return _0x1ab19a;};'use strict';var multer=require(_0x3c80('0x0'));var util=require(_0x3c80('0x1'));var path=require(_0x3c80('0x2'));var timeout=require('connect-timeout');var express=require(_0x3c80('0x3'));var router=express[_0x3c80('0x4')]();var auth=require(_0x3c80('0x5'));var interaction=require(_0x3c80('0x6'));var config=require(_0x3c80('0x7'));var controller=require(_0x3c80('0x8'));router[_0x3c80('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3c80('0x9')](_0x3c80('0xa'),auth[_0x3c80('0xb')](),controller[_0x3c80('0xc')]);router[_0x3c80('0xd')]('/',auth[_0x3c80('0xb')](),controller['create']);router[_0x3c80('0xe')](_0x3c80('0xa'),auth[_0x3c80('0xb')](),controller['update']);router[_0x3c80('0xf')](_0x3c80('0xa'),auth[_0x3c80('0xb')](),controller[_0x3c80('0x10')]);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 d1c0e99..ff234de 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 _0xe342=['getDataValue','STRING','join'];(function(_0x453694,_0x2e77f9){var _0x232f22=function(_0x2f05c4){while(--_0x2f05c4){_0x453694['push'](_0x453694['shift']());}};_0x232f22(++_0x2e77f9);}(_0xe342,0x10c));var _0x2e34=function(_0x34df4a,_0x209d10){_0x34df4a=_0x34df4a-0x0;var _0x145c69=_0xe342[_0x34df4a];return _0x145c69;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x2e34('0x0')]},'prefix':{'type':Sequelize[_0x2e34('0x0')],'unique':'name','allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x103013){this['setDataValue']('options',_0x103013?_0x103013[_0x2e34('0x1')](''):[]);},'get':function(){return this[_0x2e34('0x2')]('options')?this[_0x2e34('0x2')]('options')['split'](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x2e34('0x0')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x2e34('0x0')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x16e1=['exports','name','STRING','setDataValue','options','join','getDataValue','split','BOOLEAN','sequelize'];(function(_0x345217,_0x138efe){var _0x536365=function(_0x25b0ef){while(--_0x25b0ef){_0x345217['push'](_0x345217['shift']());}};_0x536365(++_0x138efe);}(_0x16e1,0xb3));var _0x116e=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x16e1[_0x565c49];return _0x20ca34;};'use strict';var Sequelize=require(_0x116e('0x0'));module[_0x116e('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING'],'unique':_0x116e('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x116e('0x3')],'set':function(_0x29b9a1){this[_0x116e('0x4')](_0x116e('0x5'),_0x29b9a1?_0x29b9a1[_0x116e('0x6')](''):[]);},'get':function(){return this[_0x116e('0x7')]('options')?this[_0x116e('0x7')](_0x116e('0x5'))[_0x116e('0x8')](''):[];}},'auth':{'type':Sequelize[_0x116e('0x9')],'defaultValue':![]},'password':{'type':Sequelize[_0x116e('0x3')]},'record':{'type':Sequelize[_0x116e('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x116e('0x3')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 7a1e8b6..3204523 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 _0xfb4c=['order','sort','where','pick','filter','merge','field','options','includeAll','include','findAll','rows','show','params','VoiceChanSpy','length','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','error','body','html-pdf','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','save','update','then','destroy','get','ChanSpies','UserProfileResource','stack','name','send','index','rawAttributes','model','query','keys','filters','intersection','fields','attributes','nolimit'];(function(_0x36fbef,_0x4ffc84){var _0x45e270=function(_0x32dd95){while(--_0x32dd95){_0x36fbef['push'](_0x36fbef['shift']());}};_0x45e270(++_0x4ffc84);}(_0xfb4c,0x108));var _0xcfb4=function(_0x412a5a,_0x336e5e){_0x412a5a=_0x412a5a-0x0;var _0x1b5c0b=_0xfb4c[_0x412a5a];return _0x1b5c0b;};'use strict';var pdf=require(_0xcfb4('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xcfb4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcfb4('0x2'));var rp=require(_0xcfb4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xcfb4('0x4'));var util=require(_0xcfb4('0x5'));var path=require(_0xcfb4('0x6'));var sox=require(_0xcfb4('0x7'));var csv=require('to-csv');var ejs=require(_0xcfb4('0x8'));var fs=require('fs');var _=require(_0xcfb4('0x9'));var squel=require(_0xcfb4('0xa'));var crypto=require(_0xcfb4('0xb'));var jsforce=require(_0xcfb4('0xc'));var deskjs=require(_0xcfb4('0xd'));var toCsv=require(_0xcfb4('0xe'));var querystring=require(_0xcfb4('0xf'));var Papa=require(_0xcfb4('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xcfb4('0x11'));var hardwareService=require(_0xcfb4('0x12'));var logger=require(_0xcfb4('0x13'))(_0xcfb4('0x14'));var utils=require('../../config/utils');var config=require(_0xcfb4('0x15'));var db=require(_0xcfb4('0x16'))['db'];function respondWithStatusCode(_0x590951,_0x4fd0d5){_0x4fd0d5=_0x4fd0d5||0xcc;return function(_0xc19b99){if(_0xc19b99){return _0x590951[_0xcfb4('0x17')](_0x4fd0d5);}return _0x590951[_0xcfb4('0x18')](_0x4fd0d5)[_0xcfb4('0x19')]();};}function respondWithResult(_0x5e92fa,_0xe72c47){_0xe72c47=_0xe72c47||0xc8;return function(_0x3a12dc){if(_0x3a12dc){return _0x5e92fa[_0xcfb4('0x18')](_0xe72c47)[_0xcfb4('0x1a')](_0x3a12dc);}};}function respondWithFilteredResult(_0x231f1c,_0x3cc58a){return function(_0x4028ea){if(_0x4028ea){var _0x23f010=_0x4028ea[_0xcfb4('0x1b')],_0x273d40=_0x3cc58a[_0xcfb4('0x1c')],_0xf67631=_0x3cc58a['offset']+_0x3cc58a[_0xcfb4('0x1d')],_0x337356;if(_0xf67631>=_0x23f010){_0xf67631=_0x23f010;_0x337356=0xc8;}else{_0x337356=0xce;}_0x231f1c[_0xcfb4('0x18')](_0x337356);return _0x231f1c[_0xcfb4('0x1e')]('Content-Range',_0x273d40+'-'+_0xf67631+'/'+_0x23f010)[_0xcfb4('0x1a')](_0x4028ea);}return null;};}function patchUpdates(_0x4e1897){return function(_0x38ecca){try{jsonpatch[_0xcfb4('0x1f')](_0x38ecca,_0x4e1897,!![]);}catch(_0xf43b68){return BPromise['reject'](_0xf43b68);}return _0x38ecca[_0xcfb4('0x20')]();};}function saveUpdates(_0x36d937,_0xfec2e){return function(_0x3a75bf){if(_0x3a75bf){return _0x3a75bf[_0xcfb4('0x21')](_0x36d937)[_0xcfb4('0x22')](function(_0xb10bdc){return _0xb10bdc;});}return null;};}function removeEntity(_0x3a26b7,_0x544d1f){return function(_0x21ed59){if(_0x21ed59){return _0x21ed59[_0xcfb4('0x23')]()[_0xcfb4('0x22')](function(){var _0x542f97=_0x21ed59[_0xcfb4('0x24')]({'plain':!![]});var _0x4b4688=_0xcfb4('0x25');return db[_0xcfb4('0x26')][_0xcfb4('0x23')]({'where':{'type':_0x4b4688,'resourceId':_0x542f97['id']}})[_0xcfb4('0x22')](function(){return _0x21ed59;});})[_0xcfb4('0x22')](function(){_0x3a26b7[_0xcfb4('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48a18d,_0x469de1){return function(_0x3b3113){if(!_0x3b3113){_0x48a18d[_0xcfb4('0x17')](0x194);}return _0x3b3113;};}function handleError(_0x62694f,_0x2028b1){_0x2028b1=_0x2028b1||0x1f4;return function(_0x5bf738){logger['error'](_0x5bf738[_0xcfb4('0x27')]);if(_0x5bf738[_0xcfb4('0x28')]){delete _0x5bf738[_0xcfb4('0x28')];}_0x62694f[_0xcfb4('0x18')](_0x2028b1)[_0xcfb4('0x29')](_0x5bf738);};}exports[_0xcfb4('0x2a')]=function(_0x1a7203,_0x538952){var _0x4f5ffb={},_0x35ccdb={},_0x451713={'count':0x0,'rows':[]};var _0x6d8ea=db['VoiceChanSpy'][_0xcfb4('0x2b')];_0x35ccdb[_0xcfb4('0x2c')]=_['keys'](_0x6d8ea);_0x35ccdb[_0xcfb4('0x2d')]=_[_0xcfb4('0x2e')](_0x1a7203[_0xcfb4('0x2d')]);_0x35ccdb[_0xcfb4('0x2f')]=_[_0xcfb4('0x30')](_0x35ccdb[_0xcfb4('0x2c')],_0x35ccdb['query']);_0x4f5ffb['attributes']=_[_0xcfb4('0x30')](_0x35ccdb[_0xcfb4('0x2c')],qs[_0xcfb4('0x31')](_0x1a7203[_0xcfb4('0x2d')][_0xcfb4('0x31')]));_0x4f5ffb[_0xcfb4('0x32')]=_0x4f5ffb[_0xcfb4('0x32')]['length']?_0x4f5ffb[_0xcfb4('0x32')]:_0x35ccdb['model'];if(!_0x1a7203['query']['hasOwnProperty'](_0xcfb4('0x33'))){_0x4f5ffb['limit']=qs[_0xcfb4('0x1d')](_0x1a7203[_0xcfb4('0x2d')][_0xcfb4('0x1d')]);_0x4f5ffb[_0xcfb4('0x1c')]=qs[_0xcfb4('0x1c')](_0x1a7203['query'][_0xcfb4('0x1c')]);}_0x4f5ffb[_0xcfb4('0x34')]=qs[_0xcfb4('0x35')](_0x1a7203['query'][_0xcfb4('0x35')]);_0x4f5ffb[_0xcfb4('0x36')]=qs['filters'](_[_0xcfb4('0x37')](_0x1a7203[_0xcfb4('0x2d')],_0x35ccdb[_0xcfb4('0x2f')]));if(_0x1a7203['query'][_0xcfb4('0x38')]){_0x4f5ffb[_0xcfb4('0x36')]=_[_0xcfb4('0x39')](_0x4f5ffb['where'],{'$or':_['map'](_0x6d8ea,function(_0x2162ea){if(_0x2162ea['type']['key']!=='VIRTUAL'){var _0x249aa9={};_0x249aa9[_0x2162ea[_0xcfb4('0x3a')]]={'$like':'%'+_0x1a7203[_0xcfb4('0x2d')][_0xcfb4('0x38')]+'%'};return _0x249aa9;}})});}_0x4f5ffb=_[_0xcfb4('0x39')]({},_0x4f5ffb,_0x1a7203[_0xcfb4('0x3b')]);var _0x3cea94={'where':_0x4f5ffb[_0xcfb4('0x36')]};return db['VoiceChanSpy'][_0xcfb4('0x1b')](_0x3cea94)[_0xcfb4('0x22')](function(_0x15312e){_0x451713[_0xcfb4('0x1b')]=_0x15312e;if(_0x1a7203[_0xcfb4('0x2d')][_0xcfb4('0x3c')]){_0x4f5ffb[_0xcfb4('0x3d')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0xcfb4('0x3e')](_0x4f5ffb);})[_0xcfb4('0x22')](function(_0x4b8010){_0x451713[_0xcfb4('0x3f')]=_0x4b8010;return _0x451713;})[_0xcfb4('0x22')](respondWithFilteredResult(_0x538952,_0x4f5ffb))['catch'](handleError(_0x538952,null));};exports[_0xcfb4('0x40')]=function(_0x48c5b5,_0x509eb6){var _0x3b7b27={'raw':![],'where':{'id':_0x48c5b5[_0xcfb4('0x41')]['id']}},_0x7d1a63={};_0x7d1a63[_0xcfb4('0x2c')]=_[_0xcfb4('0x2e')](db[_0xcfb4('0x42')][_0xcfb4('0x2b')]);_0x7d1a63['query']=_[_0xcfb4('0x2e')](_0x48c5b5[_0xcfb4('0x2d')]);_0x7d1a63[_0xcfb4('0x2f')]=_[_0xcfb4('0x30')](_0x7d1a63['model'],_0x7d1a63[_0xcfb4('0x2d')]);_0x3b7b27[_0xcfb4('0x32')]=_[_0xcfb4('0x30')](_0x7d1a63[_0xcfb4('0x2c')],qs['fields'](_0x48c5b5[_0xcfb4('0x2d')][_0xcfb4('0x31')]));_0x3b7b27[_0xcfb4('0x32')]=_0x3b7b27[_0xcfb4('0x32')][_0xcfb4('0x43')]?_0x3b7b27['attributes']:_0x7d1a63[_0xcfb4('0x2c')];if(_0x48c5b5[_0xcfb4('0x2d')][_0xcfb4('0x3c')]){_0x3b7b27[_0xcfb4('0x3d')]=[{'all':!![]}];}_0x3b7b27=_[_0xcfb4('0x39')]({},_0x3b7b27,_0x48c5b5[_0xcfb4('0x3b')]);return db[_0xcfb4('0x42')]['find'](_0x3b7b27)[_0xcfb4('0x22')](handleEntityNotFound(_0x509eb6,null))[_0xcfb4('0x22')](respondWithResult(_0x509eb6,null))[_0xcfb4('0x44')](handleError(_0x509eb6,null));};exports[_0xcfb4('0x45')]=function(_0x519e7b,_0x379609){return db[_0xcfb4('0x42')][_0xcfb4('0x45')](_0x519e7b['body'],{})[_0xcfb4('0x22')](function(_0xafb83c){var _0x3a0ca7=_0x519e7b[_0xcfb4('0x46')][_0xcfb4('0x24')]({'plain':!![]});if(!_0x3a0ca7)throw new Error(_0xcfb4('0x47'));if(_0x3a0ca7[_0xcfb4('0x48')]===_0xcfb4('0x46')){var _0x5da451=_0xafb83c[_0xcfb4('0x24')]({'plain':!![]});var _0x2cd76e='ChanSpies';return db[_0xcfb4('0x49')][_0xcfb4('0x4a')]({'where':{'name':_0x2cd76e,'userProfileId':_0x3a0ca7[_0xcfb4('0x4b')]},'raw':!![]})[_0xcfb4('0x22')](function(_0x360dfb){if(_0x360dfb&&_0x360dfb[_0xcfb4('0x4c')]===0x0){return db[_0xcfb4('0x26')][_0xcfb4('0x45')]({'name':_0x5da451['name'],'resourceId':_0x5da451['id'],'type':_0x360dfb[_0xcfb4('0x28')],'sectionId':_0x360dfb['id']},{})[_0xcfb4('0x22')](function(){return _0xafb83c;});}else{return _0xafb83c;}})['catch'](function(_0x3ee901){logger[_0xcfb4('0x4d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3ee901);throw _0x3ee901;});}return _0xafb83c;})[_0xcfb4('0x22')](respondWithResult(_0x379609,0xc9))[_0xcfb4('0x44')](handleError(_0x379609,null));};exports['update']=function(_0x1c9ca7,_0xdf121e){if(_0x1c9ca7[_0xcfb4('0x4e')]['id']){delete _0x1c9ca7[_0xcfb4('0x4e')]['id'];}return db[_0xcfb4('0x42')][_0xcfb4('0x4a')]({'where':{'id':_0x1c9ca7['params']['id']}})['then'](handleEntityNotFound(_0xdf121e,null))[_0xcfb4('0x22')](saveUpdates(_0x1c9ca7[_0xcfb4('0x4e')],null))[_0xcfb4('0x22')](respondWithResult(_0xdf121e,null))[_0xcfb4('0x44')](handleError(_0xdf121e,null));};exports[_0xcfb4('0x23')]=function(_0x5c811d,_0x2ebc1b){return db[_0xcfb4('0x42')][_0xcfb4('0x4a')]({'where':{'id':_0x5c811d[_0xcfb4('0x41')]['id']}})[_0xcfb4('0x22')](handleEntityNotFound(_0x2ebc1b,null))['then'](removeEntity(_0x2ebc1b,null))[_0xcfb4('0x44')](handleError(_0x2ebc1b,null));}; \ No newline at end of file +var _0x49b6=['error','name','send','index','VoiceChanSpy','rawAttributes','keys','query','filters','attributes','intersection','fields','model','hasOwnProperty','nolimit','sort','where','pick','merge','map','type','key','VIRTUAL','field','options','findAll','rows','catch','show','params','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ChanSpies','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','limit','set','apply','reject','save','then','destroy','get'];(function(_0x2bcb75,_0x5789a7){var _0x175345=function(_0x3a7d41){while(--_0x3a7d41){_0x2bcb75['push'](_0x2bcb75['shift']());}};_0x175345(++_0x5789a7);}(_0x49b6,0x7d));var _0x649b=function(_0x43841f,_0x4df0c4){_0x43841f=_0x43841f-0x0;var _0x417f61=_0x49b6[_0x43841f];return _0x417f61;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x649b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x649b('0x1'));var jsonpatch=require(_0x649b('0x2'));var rp=require(_0x649b('0x3'));var moment=require(_0x649b('0x4'));var BPromise=require(_0x649b('0x5'));var Mustache=require(_0x649b('0x6'));var util=require(_0x649b('0x7'));var path=require('path');var sox=require(_0x649b('0x8'));var csv=require(_0x649b('0x9'));var ejs=require(_0x649b('0xa'));var fs=require('fs');var _=require(_0x649b('0xb'));var squel=require('squel');var crypto=require(_0x649b('0xc'));var jsforce=require(_0x649b('0xd'));var deskjs=require(_0x649b('0xe'));var toCsv=require(_0x649b('0x9'));var querystring=require(_0x649b('0xf'));var Papa=require(_0x649b('0x10'));var Redis=require(_0x649b('0x11'));var authService=require(_0x649b('0x12'));var qs=require(_0x649b('0x13'));var hardwareService=require(_0x649b('0x14'));var logger=require('../../config/logger')(_0x649b('0x15'));var utils=require(_0x649b('0x16'));var config=require(_0x649b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26cb24,_0x3b32b5){_0x3b32b5=_0x3b32b5||0xcc;return function(_0x40f701){if(_0x40f701){return _0x26cb24[_0x649b('0x18')](_0x3b32b5);}return _0x26cb24[_0x649b('0x19')](_0x3b32b5)[_0x649b('0x1a')]();};}function respondWithResult(_0x4c4287,_0x4d570c){_0x4d570c=_0x4d570c||0xc8;return function(_0x3655e2){if(_0x3655e2){return _0x4c4287[_0x649b('0x19')](_0x4d570c)['json'](_0x3655e2);}};}function respondWithFilteredResult(_0x3092a7,_0x5cf00f){return function(_0x28717a){if(_0x28717a){var _0x490c82=_0x28717a[_0x649b('0x1b')],_0x3a6430=_0x5cf00f[_0x649b('0x1c')],_0x19fdd4=_0x5cf00f['offset']+_0x5cf00f[_0x649b('0x1d')],_0x22fa11;if(_0x19fdd4>=_0x490c82){_0x19fdd4=_0x490c82;_0x22fa11=0xc8;}else{_0x22fa11=0xce;}_0x3092a7[_0x649b('0x19')](_0x22fa11);return _0x3092a7[_0x649b('0x1e')]('Content-Range',_0x3a6430+'-'+_0x19fdd4+'/'+_0x490c82)['json'](_0x28717a);}return null;};}function patchUpdates(_0x188f68){return function(_0x4639ee){try{jsonpatch[_0x649b('0x1f')](_0x4639ee,_0x188f68,!![]);}catch(_0x4bd9d1){return BPromise[_0x649b('0x20')](_0x4bd9d1);}return _0x4639ee[_0x649b('0x21')]();};}function saveUpdates(_0x32ba69,_0x323023){return function(_0x290350){if(_0x290350){return _0x290350['update'](_0x32ba69)[_0x649b('0x22')](function(_0x3547f7){return _0x3547f7;});}return null;};}function removeEntity(_0x1798e7,_0x38bc40){return function(_0x5762ab){if(_0x5762ab){return _0x5762ab[_0x649b('0x23')]()[_0x649b('0x22')](function(){var _0x4648cb=_0x5762ab[_0x649b('0x24')]({'plain':!![]});var _0x40887b='ChanSpies';return db['UserProfileResource'][_0x649b('0x23')]({'where':{'type':_0x40887b,'resourceId':_0x4648cb['id']}})[_0x649b('0x22')](function(){return _0x5762ab;});})[_0x649b('0x22')](function(){_0x1798e7['status'](0xcc)[_0x649b('0x1a')]();});}};}function handleEntityNotFound(_0x5b666c,_0x4dd4f5){return function(_0x44259a){if(!_0x44259a){_0x5b666c['sendStatus'](0x194);}return _0x44259a;};}function handleError(_0x11a00b,_0xcc7945){_0xcc7945=_0xcc7945||0x1f4;return function(_0x520aeb){logger[_0x649b('0x25')](_0x520aeb['stack']);if(_0x520aeb[_0x649b('0x26')]){delete _0x520aeb[_0x649b('0x26')];}_0x11a00b[_0x649b('0x19')](_0xcc7945)[_0x649b('0x27')](_0x520aeb);};}exports[_0x649b('0x28')]=function(_0x255600,_0x381e86){var _0x35ac44={},_0x58d353={},_0x504fba={'count':0x0,'rows':[]};var _0x140f82=db[_0x649b('0x29')][_0x649b('0x2a')];_0x58d353['model']=_[_0x649b('0x2b')](_0x140f82);_0x58d353[_0x649b('0x2c')]=_[_0x649b('0x2b')](_0x255600[_0x649b('0x2c')]);_0x58d353[_0x649b('0x2d')]=_['intersection'](_0x58d353['model'],_0x58d353[_0x649b('0x2c')]);_0x35ac44[_0x649b('0x2e')]=_[_0x649b('0x2f')](_0x58d353['model'],qs['fields'](_0x255600[_0x649b('0x2c')][_0x649b('0x30')]));_0x35ac44['attributes']=_0x35ac44[_0x649b('0x2e')]['length']?_0x35ac44['attributes']:_0x58d353[_0x649b('0x31')];if(!_0x255600[_0x649b('0x2c')][_0x649b('0x32')](_0x649b('0x33'))){_0x35ac44[_0x649b('0x1d')]=qs[_0x649b('0x1d')](_0x255600[_0x649b('0x2c')][_0x649b('0x1d')]);_0x35ac44['offset']=qs[_0x649b('0x1c')](_0x255600[_0x649b('0x2c')][_0x649b('0x1c')]);}_0x35ac44['order']=qs[_0x649b('0x34')](_0x255600['query'][_0x649b('0x34')]);_0x35ac44[_0x649b('0x35')]=qs['filters'](_[_0x649b('0x36')](_0x255600[_0x649b('0x2c')],_0x58d353[_0x649b('0x2d')]));if(_0x255600['query']['filter']){_0x35ac44[_0x649b('0x35')]=_[_0x649b('0x37')](_0x35ac44[_0x649b('0x35')],{'$or':_[_0x649b('0x38')](_0x140f82,function(_0x4ba108){if(_0x4ba108[_0x649b('0x39')][_0x649b('0x3a')]!==_0x649b('0x3b')){var _0x7420d0={};_0x7420d0[_0x4ba108[_0x649b('0x3c')]]={'$like':'%'+_0x255600[_0x649b('0x2c')]['filter']+'%'};return _0x7420d0;}})});}_0x35ac44=_['merge']({},_0x35ac44,_0x255600[_0x649b('0x3d')]);var _0x3853d1={'where':_0x35ac44[_0x649b('0x35')]};return db[_0x649b('0x29')][_0x649b('0x1b')](_0x3853d1)[_0x649b('0x22')](function(_0x1ea300){_0x504fba['count']=_0x1ea300;if(_0x255600[_0x649b('0x2c')]['includeAll']){_0x35ac44['include']=[{'all':!![]}];}return db[_0x649b('0x29')][_0x649b('0x3e')](_0x35ac44);})[_0x649b('0x22')](function(_0x2846ca){_0x504fba[_0x649b('0x3f')]=_0x2846ca;return _0x504fba;})[_0x649b('0x22')](respondWithFilteredResult(_0x381e86,_0x35ac44))[_0x649b('0x40')](handleError(_0x381e86,null));};exports[_0x649b('0x41')]=function(_0x2302c1,_0x169847){var _0x11dae7={'raw':![],'where':{'id':_0x2302c1[_0x649b('0x42')]['id']}},_0x510254={};_0x510254[_0x649b('0x31')]=_[_0x649b('0x2b')](db[_0x649b('0x29')][_0x649b('0x2a')]);_0x510254[_0x649b('0x2c')]=_[_0x649b('0x2b')](_0x2302c1['query']);_0x510254[_0x649b('0x2d')]=_[_0x649b('0x2f')](_0x510254[_0x649b('0x31')],_0x510254['query']);_0x11dae7[_0x649b('0x2e')]=_[_0x649b('0x2f')](_0x510254[_0x649b('0x31')],qs[_0x649b('0x30')](_0x2302c1['query'][_0x649b('0x30')]));_0x11dae7[_0x649b('0x2e')]=_0x11dae7['attributes']['length']?_0x11dae7[_0x649b('0x2e')]:_0x510254[_0x649b('0x31')];if(_0x2302c1['query'][_0x649b('0x43')]){_0x11dae7[_0x649b('0x44')]=[{'all':!![]}];}_0x11dae7=_[_0x649b('0x37')]({},_0x11dae7,_0x2302c1['options']);return db[_0x649b('0x29')][_0x649b('0x45')](_0x11dae7)['then'](handleEntityNotFound(_0x169847,null))['then'](respondWithResult(_0x169847,null))[_0x649b('0x40')](handleError(_0x169847,null));};exports['create']=function(_0x5d9ab8,_0x4d4889){return db[_0x649b('0x29')][_0x649b('0x46')](_0x5d9ab8[_0x649b('0x47')],{})['then'](function(_0x53fa4f){var _0x1aa8e4=_0x5d9ab8['user']['get']({'plain':!![]});if(!_0x1aa8e4)throw new Error(_0x649b('0x48'));if(_0x1aa8e4[_0x649b('0x49')]===_0x649b('0x4a')){var _0x16f31c=_0x53fa4f[_0x649b('0x24')]({'plain':!![]});var _0x58577d=_0x649b('0x4b');return db[_0x649b('0x4c')]['find']({'where':{'name':_0x58577d,'userProfileId':_0x1aa8e4[_0x649b('0x4d')]},'raw':!![]})[_0x649b('0x22')](function(_0x28cc15){if(_0x28cc15&&_0x28cc15[_0x649b('0x4e')]===0x0){return db[_0x649b('0x4f')][_0x649b('0x46')]({'name':_0x16f31c[_0x649b('0x26')],'resourceId':_0x16f31c['id'],'type':_0x28cc15[_0x649b('0x26')],'sectionId':_0x28cc15['id']},{})[_0x649b('0x22')](function(){return _0x53fa4f;});}else{return _0x53fa4f;}})[_0x649b('0x40')](function(_0x3921dc){logger[_0x649b('0x25')](_0x649b('0x50'),_0x3921dc);throw _0x3921dc;});}return _0x53fa4f;})['then'](respondWithResult(_0x4d4889,0xc9))['catch'](handleError(_0x4d4889,null));};exports['update']=function(_0x1a486d,_0x22bd26){if(_0x1a486d[_0x649b('0x47')]['id']){delete _0x1a486d[_0x649b('0x47')]['id'];}return db[_0x649b('0x29')]['find']({'where':{'id':_0x1a486d['params']['id']}})[_0x649b('0x22')](handleEntityNotFound(_0x22bd26,null))[_0x649b('0x22')](saveUpdates(_0x1a486d[_0x649b('0x47')],null))['then'](respondWithResult(_0x22bd26,null))[_0x649b('0x40')](handleError(_0x22bd26,null));};exports['destroy']=function(_0x2e7d57,_0x370fde){return db[_0x649b('0x29')]['find']({'where':{'id':_0x2e7d57['params']['id']}})[_0x649b('0x22')](handleEntityNotFound(_0x370fde,null))[_0x649b('0x22')](removeEntity(_0x370fde,null))[_0x649b('0x40')](handleError(_0x370fde,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index ed27fa5..7db2fa0 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 _0x7d86=['findAll','then','catch','exports','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','destroy','bulkCreate','lodash','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,ab','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7d86,0x86));var _0x67d8=function(_0x3c3007,_0xc77c81){_0x3c3007=_0x3c3007-0x0;var _0x1a6bb5=_0x7d86[_0x3c3007];return _0x1a6bb5;};'use strict';var _=require(_0x67d8('0x0'));var util=require('util');var BPromise=require(_0x67d8('0x1'));var attributes=require(_0x67d8('0x2'));var getUserApplications=function(_0x1f833f,_0xd94f63,_0x382a09){var _0x431294=0x1;var _0x3f58a1=[];var _0x517caf={'context':_0xd94f63[_0x67d8('0x3')]||_0x67d8('0x4'),'exten':util[_0x67d8('0x5')](_0x67d8('0x6'),_0x1f833f[_0x67d8('0x7')],_0x382a09),'type':_0x67d8('0x8'),'isApp':![],'ChanSpyId':_0x1f833f['id'],'UserId':_0xd94f63['id']};_0x3f58a1[_0x67d8('0x9')](_[_0x67d8('0xa')]({'app':_0x67d8('0xb'),'appdata':util[_0x67d8('0x5')](_0x67d8('0xc'),_0x67d8('0xd')),'priority':_0x431294++},_0x517caf));if(_0x1f833f[_0x67d8('0xe')]){_0x3f58a1[_0x67d8('0x9')](_[_0x67d8('0xa')]({'app':_0x67d8('0xf'),'appdata':util[_0x67d8('0x5')](_0x67d8('0x10'),_0x1f833f[_0x67d8('0x11')]),'priority':_0x431294++},_0x517caf));}if(_0x1f833f[_0x67d8('0x12')]){_0x3f58a1[_0x67d8('0x9')](_['merge']({'app':_0x67d8('0x13'),'appdata':_0x1f833f[_0x67d8('0x14')],'priority':_0x431294++},_0x517caf));}_0x3f58a1[_0x67d8('0x9')](_['merge']({'app':_0x67d8('0x15'),'appdata':util[_0x67d8('0x5')](_0x67d8('0x16'),_0xd94f63[_0x67d8('0x17')],_0x1f833f[_0x67d8('0x18')]?_0x1f833f[_0x67d8('0x18')][_0x67d8('0x19')](''):''),'priority':_0x431294++},_0x517caf));if(_0x1f833f['record']){_0x3f58a1[_0x67d8('0x9')](_[_0x67d8('0xa')]({'app':_0x67d8('0x1a'),'priority':_0x431294++},_0x517caf));}return _0x3f58a1;};var getChanSpyApplications=function(_0x509998,_0x2c0e96){var _0x1a3bfe=[];for(var _0x4b2795=0x0,_0x36d0bf=0x1;_0x4b2795<_0x2c0e96[_0x67d8('0x1b')];_0x4b2795++,_0x36d0bf=0x1){_0x1a3bfe=_0x1a3bfe[_0x67d8('0x1c')](getUserApplications(_0x509998,_0x2c0e96[_0x4b2795],_0x2c0e96[_0x4b2795][_0x67d8('0x1d')]));if(_0x2c0e96[_0x4b2795][_0x67d8('0x1d')]!=_0x2c0e96[_0x4b2795][_0x67d8('0x17')]){_0x1a3bfe=_0x1a3bfe['concat'](getUserApplications(_0x509998,_0x2c0e96[_0x4b2795],_0x2c0e96[_0x4b2795][_0x67d8('0x17')]));}}return _0x1a3bfe;};var getChanSpyPromise=function(_0xf6f30b,_0x434810){return new BPromise(function(_0x14a81f,_0x180cd7){return _0xf6f30b['User'][_0x67d8('0x1e')]({'attributes':['id',_0x67d8('0x17'),'internal'],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x67d8('0x1f')](function(_0x5c7cad){if(_0x5c7cad){return _0x14a81f(getChanSpyApplications(_0x434810,_0x5c7cad));}return _0x14a81f([]);})[_0x67d8('0x20')](function(_0x322f4b){_0x180cd7(_0x322f4b);});});};module[_0x67d8('0x21')]=function(_0x490e0e,_0x576858){var _0x45c110=_0x490e0e[_0x67d8('0x22')];return _0x490e0e[_0x67d8('0x23')](_0x67d8('0x24'),attributes,{'tableName':_0x67d8('0x25'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5a6725,_0x3cc171,_0x29613c){return getChanSpyPromise(_0x45c110,_0x5a6725)['then'](function(_0x509ee9){if(_0x509ee9&&_0x509ee9[_0x67d8('0x1b')]){return _0x45c110[_0x67d8('0x26')]['bulkCreate'](_0x509ee9);}})[_0x67d8('0x1f')](function(){_0x29613c();})[_0x67d8('0x20')](function(_0x4de8ae){_0x29613c(_0x4de8ae);});},'afterUpdate':function(_0x5a3a33,_0x432a5a,_0x32802e){return _0x45c110['VoiceExtension'][_0x67d8('0x27')]({'where':{'ChanSpyId':_0x5a3a33['id']}})[_0x67d8('0x1f')](function(){return getChanSpyPromise(_0x45c110,_0x5a3a33);})['then'](function(_0x1e7e8f){if(_0x1e7e8f&&_0x1e7e8f['length']){return _0x45c110[_0x67d8('0x26')][_0x67d8('0x28')](_0x1e7e8f);}})[_0x67d8('0x1f')](function(){_0x32802e();})['catch'](function(_0x57cbb5){_0x32802e(_0x57cbb5);});},'afterDestroy':function(_0x4fd60d,_0x19099f,_0x51bcfc){return _0x45c110[_0x67d8('0x26')][_0x67d8('0x27')]({'where':{'ChanSpyId':_0x4fd60d['id']}})[_0x67d8('0x1f')](function(){_0x51bcfc();})[_0x67d8('0x20')](function(_0x5d994b){_0x51bcfc(_0x5d994b);});}}});}; \ No newline at end of file +var _0xa886=['from-sip','format','prefix','system','merge','Set','CDR(type)=%s','chanspy','push','MixMonitor','recordingFormat','auth','password','SIP/%s,%s','name','options','join','record','length','internal','concat','User','agent','then','exports','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','catch','destroy','util','bluebird','./voiceChanSpy.attributes','context'];(function(_0x3dc967,_0x55c8c5){var _0x53572c=function(_0x8ba65d){while(--_0x8ba65d){_0x3dc967['push'](_0x3dc967['shift']());}};_0x53572c(++_0x55c8c5);}(_0xa886,0x193));var _0x6a88=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xa886[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0x6a88('0x0'));var BPromise=require(_0x6a88('0x1'));var attributes=require(_0x6a88('0x2'));var getUserApplications=function(_0x338500,_0x1abdf7,_0x4b1e61){var _0x341f5f=0x1;var _0x587252=[];var _0x4d2c65={'context':_0x1abdf7[_0x6a88('0x3')]||_0x6a88('0x4'),'exten':util[_0x6a88('0x5')]('%s%s',_0x338500[_0x6a88('0x6')],_0x4b1e61),'type':_0x6a88('0x7'),'isApp':![],'ChanSpyId':_0x338500['id'],'UserId':_0x1abdf7['id']};_0x587252['push'](_[_0x6a88('0x8')]({'app':_0x6a88('0x9'),'appdata':util[_0x6a88('0x5')](_0x6a88('0xa'),_0x6a88('0xb')),'priority':_0x341f5f++},_0x4d2c65));if(_0x338500['record']){_0x587252[_0x6a88('0xc')](_[_0x6a88('0x8')]({'app':_0x6a88('0xd'),'appdata':util[_0x6a88('0x5')]('${UNIQUEID}.%s,ab',_0x338500[_0x6a88('0xe')]),'priority':_0x341f5f++},_0x4d2c65));}if(_0x338500[_0x6a88('0xf')]){_0x587252[_0x6a88('0xc')](_[_0x6a88('0x8')]({'app':'Authenticate','appdata':_0x338500[_0x6a88('0x10')],'priority':_0x341f5f++},_0x4d2c65));}_0x587252[_0x6a88('0xc')](_[_0x6a88('0x8')]({'app':'ChanSpy','appdata':util[_0x6a88('0x5')](_0x6a88('0x11'),_0x1abdf7[_0x6a88('0x12')],_0x338500[_0x6a88('0x13')]?_0x338500[_0x6a88('0x13')][_0x6a88('0x14')](''):''),'priority':_0x341f5f++},_0x4d2c65));if(_0x338500[_0x6a88('0x15')]){_0x587252[_0x6a88('0xc')](_[_0x6a88('0x8')]({'app':'StopMixMonitor','priority':_0x341f5f++},_0x4d2c65));}return _0x587252;};var getChanSpyApplications=function(_0x5f3bb0,_0x4a66c7){var _0x19acb2=[];for(var _0x48de88=0x0,_0x2dedd3=0x1;_0x48de88<_0x4a66c7[_0x6a88('0x16')];_0x48de88++,_0x2dedd3=0x1){_0x19acb2=_0x19acb2['concat'](getUserApplications(_0x5f3bb0,_0x4a66c7[_0x48de88],_0x4a66c7[_0x48de88][_0x6a88('0x17')]));if(_0x4a66c7[_0x48de88][_0x6a88('0x17')]!=_0x4a66c7[_0x48de88][_0x6a88('0x12')]){_0x19acb2=_0x19acb2[_0x6a88('0x18')](getUserApplications(_0x5f3bb0,_0x4a66c7[_0x48de88],_0x4a66c7[_0x48de88][_0x6a88('0x12')]));}}return _0x19acb2;};var getChanSpyPromise=function(_0x4dfda3,_0x381484){return new BPromise(function(_0x40b7fe,_0x57ffe2){return _0x4dfda3[_0x6a88('0x19')]['findAll']({'attributes':['id',_0x6a88('0x12'),_0x6a88('0x17')],'where':{'role':_0x6a88('0x1a'),'chanspy':!![]},'raw':!![]})[_0x6a88('0x1b')](function(_0x2ec805){if(_0x2ec805){return _0x40b7fe(getChanSpyApplications(_0x381484,_0x2ec805));}return _0x40b7fe([]);})['catch'](function(_0x32c5df){_0x57ffe2(_0x32c5df);});});};module[_0x6a88('0x1c')]=function(_0x3d5e56,_0x2f034e){var _0x46ecb3=_0x3d5e56[_0x6a88('0x1d')];return _0x3d5e56[_0x6a88('0x1e')](_0x6a88('0x1f'),attributes,{'tableName':_0x6a88('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2c5ce5,_0x31cb6b,_0x4592ad){return getChanSpyPromise(_0x46ecb3,_0x2c5ce5)[_0x6a88('0x1b')](function(_0x3b19bf){if(_0x3b19bf&&_0x3b19bf[_0x6a88('0x16')]){return _0x46ecb3[_0x6a88('0x21')][_0x6a88('0x22')](_0x3b19bf);}})[_0x6a88('0x1b')](function(){_0x4592ad();})[_0x6a88('0x23')](function(_0xc6300f){_0x4592ad(_0xc6300f);});},'afterUpdate':function(_0x389fe0,_0x20b90d,_0x4237f3){return _0x46ecb3[_0x6a88('0x21')][_0x6a88('0x24')]({'where':{'ChanSpyId':_0x389fe0['id']}})['then'](function(){return getChanSpyPromise(_0x46ecb3,_0x389fe0);})[_0x6a88('0x1b')](function(_0x1664ef){if(_0x1664ef&&_0x1664ef[_0x6a88('0x16')]){return _0x46ecb3[_0x6a88('0x21')][_0x6a88('0x22')](_0x1664ef);}})['then'](function(){_0x4237f3();})['catch'](function(_0x49f849){_0x4237f3(_0x49f849);});},'afterDestroy':function(_0x333787,_0x50720a,_0x178c96){return _0x46ecb3[_0x6a88('0x21')][_0x6a88('0x24')]({'where':{'ChanSpyId':_0x333787['id']}})['then'](function(){_0x178c96();})[_0x6a88('0x23')](function(_0x170984){_0x178c96(_0x170984);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 70b42e7..25a4ba3 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 _0xcaee=['VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x420f2a,_0x2cc58d){var _0x28f802=function(_0x3329cc){while(--_0x3329cc){_0x420f2a['push'](_0x420f2a['shift']());}};_0x28f802(++_0x2cc58d);}(_0xcaee,0x1b8));var _0xecae=function(_0x455f19,_0x4f8f3a){_0x455f19=_0x455f19-0x0;var _0x422f21=_0xcaee[_0x455f19];return _0x422f21;};'use strict';var _=require(_0xecae('0x0'));var util=require(_0xecae('0x1'));var moment=require(_0xecae('0x2'));var BPromise=require(_0xecae('0x3'));var rs=require(_0xecae('0x4'));var fs=require('fs');var Redis=require(_0xecae('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xecae('0x6'));var logger=require('../../config/logger')(_0xecae('0x7'));var config=require(_0xecae('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xecae('0x9')][_0xecae('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c2193,_0x2e00e4,_0x93f127){return new BPromise(function(_0x596e21,_0x187e1f){return client[_0xecae('0xb')](_0x1c2193,_0x93f127)[_0xecae('0xc')](function(_0x4371c6){logger['info'](_0xecae('0xd'),_0x2e00e4,_0xecae('0xe'));logger[_0xecae('0xf')](_0xecae('0x10'),_0x2e00e4,_0xecae('0xe'),JSON[_0xecae('0x11')](_0x4371c6));if(_0x4371c6['error']){if(_0x4371c6['error'][_0xecae('0x12')]===0x1f4){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x2e00e4,_0x4371c6[_0xecae('0x13')][_0xecae('0x14')]);return _0x187e1f(_0x4371c6[_0xecae('0x13')][_0xecae('0x14')]);}logger[_0xecae('0x13')](_0xecae('0xd'),_0x2e00e4,_0x4371c6[_0xecae('0x13')]['message']);return _0x596e21(_0x4371c6[_0xecae('0x13')]['message']);}else{logger[_0xecae('0x15')](_0xecae('0xd'),_0x2e00e4,_0xecae('0xe'));_0x596e21(_0x4371c6[_0xecae('0x16')][_0xecae('0x14')]);}})[_0xecae('0x17')](function(_0x147be4){logger['error'](_0xecae('0xd'),_0x2e00e4,_0x147be4);_0x187e1f(_0x147be4);});});} \ No newline at end of file +var _0x2dff=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','VoiceChanSpy,\x20%s,\x20%s','message','info','result','lodash'];(function(_0x45f49f,_0x53d9e5){var _0x1fb5c6=function(_0x440913){while(--_0x440913){_0x45f49f['push'](_0x45f49f['shift']());}};_0x1fb5c6(++_0x53d9e5);}(_0x2dff,0x11d));var _0xf2df=function(_0x4ff6fa,_0x4f2bbb){_0x4ff6fa=_0x4ff6fa-0x0;var _0x48e0a6=_0x2dff[_0x4ff6fa];return _0x48e0a6;};'use strict';var _=require(_0xf2df('0x0'));var util=require('util');var moment=require(_0xf2df('0x1'));var BPromise=require(_0xf2df('0x2'));var rs=require(_0xf2df('0x3'));var fs=require('fs');var Redis=require(_0xf2df('0x4'));var db=require(_0xf2df('0x5'))['db'];var utils=require(_0xf2df('0x6'));var logger=require(_0xf2df('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf2df('0x8'));var client=jayson[_0xf2df('0x9')][_0xf2df('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4346b8,_0x4c38f0,_0x283f2c){return new BPromise(function(_0x5b3776,_0x52fba5){return client[_0xf2df('0xb')](_0x4346b8,_0x283f2c)[_0xf2df('0xc')](function(_0x371425){logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x4c38f0,_0xf2df('0xd'));logger[_0xf2df('0xe')](_0xf2df('0xf'),_0x4c38f0,_0xf2df('0xd'),JSON[_0xf2df('0x10')](_0x371425));if(_0x371425[_0xf2df('0x11')]){if(_0x371425['error']['code']===0x1f4){logger[_0xf2df('0x11')](_0xf2df('0x12'),_0x4c38f0,_0x371425['error'][_0xf2df('0x13')]);return _0x52fba5(_0x371425[_0xf2df('0x11')][_0xf2df('0x13')]);}logger['error'](_0xf2df('0x12'),_0x4c38f0,_0x371425['error'][_0xf2df('0x13')]);return _0x5b3776(_0x371425[_0xf2df('0x11')]['message']);}else{logger[_0xf2df('0x14')]('VoiceChanSpy,\x20%s,\x20%s',_0x4c38f0,_0xf2df('0xd'));_0x5b3776(_0x371425[_0xf2df('0x15')][_0xf2df('0x13')]);}})['catch'](function(_0x3918eb){logger[_0xf2df('0x11')](_0xf2df('0x12'),_0x4c38f0,_0x3918eb);_0x52fba5(_0x3918eb);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index f9b2eb3..8ed16e1 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 _0x5d4e=['create','put','/:id','update','delete','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceContext.controller','isAuthenticated','show','post'];(function(_0x13d9b1,_0x3156cf){var _0x2eb160=function(_0x5cd2f9){while(--_0x5cd2f9){_0x13d9b1['push'](_0x13d9b1['shift']());}};_0x2eb160(++_0x3156cf);}(_0x5d4e,0x138));var _0xe5d4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5d4e[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0xe5d4('0x0'));var path=require(_0xe5d4('0x1'));var timeout=require(_0xe5d4('0x2'));var express=require(_0xe5d4('0x3'));var router=express[_0xe5d4('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xe5d4('0x5'));var config=require(_0xe5d4('0x6'));var controller=require(_0xe5d4('0x7'));router['get']('/',auth[_0xe5d4('0x8')](),controller['index']);router['get']('/:id',auth[_0xe5d4('0x8')](),controller[_0xe5d4('0x9')]);router[_0xe5d4('0xa')]('/',auth[_0xe5d4('0x8')](),controller[_0xe5d4('0xb')]);router[_0xe5d4('0xc')](_0xe5d4('0xd'),auth[_0xe5d4('0x8')](),controller[_0xe5d4('0xe')]);router[_0xe5d4('0xf')](_0xe5d4('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xe5d4('0x10')]=router; \ No newline at end of file +var _0x0bb4=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','index','isAuthenticated','show','put','/:id','update','delete','destroy','exports'];(function(_0x5270bf,_0x174d63){var _0x4c3cad=function(_0x189490){while(--_0x189490){_0x5270bf['push'](_0x5270bf['shift']());}};_0x4c3cad(++_0x174d63);}(_0x0bb4,0x77));var _0x40bb=function(_0x5c4388,_0x25bd2f){_0x5c4388=_0x5c4388-0x0;var _0x3eb567=_0x0bb4[_0x5c4388];return _0x3eb567;};'use strict';var multer=require(_0x40bb('0x0'));var util=require(_0x40bb('0x1'));var path=require('path');var timeout=require(_0x40bb('0x2'));var express=require(_0x40bb('0x3'));var router=express[_0x40bb('0x4')]();var auth=require(_0x40bb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x40bb('0x6'));var controller=require('./voiceContext.controller');router[_0x40bb('0x7')]('/',auth['isAuthenticated'](),controller[_0x40bb('0x8')]);router[_0x40bb('0x7')]('/:id',auth[_0x40bb('0x9')](),controller[_0x40bb('0xa')]);router['post']('/',auth[_0x40bb('0x9')](),controller['create']);router[_0x40bb('0xb')](_0x40bb('0xc'),auth[_0x40bb('0x9')](),controller[_0x40bb('0xd')]);router[_0x40bb('0xe')](_0x40bb('0xc'),auth[_0x40bb('0x9')](),controller[_0x40bb('0xf')]);module[_0x40bb('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 0f62ced..33fc913 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 _0x41ff=['sequelize','exports','STRING','name'];(function(_0x5d954e,_0x57a422){var _0x48948c=function(_0x4f6bab){while(--_0x4f6bab){_0x5d954e['push'](_0x5d954e['shift']());}};_0x48948c(++_0x57a422);}(_0x41ff,0x68));var _0xf41f=function(_0x432ac4,_0x31e1d6){_0x432ac4=_0x432ac4-0x0;var _0x413550=_0x41ff[_0x432ac4];return _0x413550;};'use strict';var Sequelize=require(_0xf41f('0x0'));module[_0xf41f('0x1')]={'name':{'type':Sequelize[_0xf41f('0x2')],'unique':_0xf41f('0x3')},'description':{'type':Sequelize[_0xf41f('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0xd4cd=['STRING','BOOLEAN','sequelize','name'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xd4cd,0x116));var _0xdd4c=function(_0x2ec2bf,_0x64e983){_0x2ec2bf=_0x2ec2bf-0x0;var _0x2c279c=_0xd4cd[_0x2ec2bf];return _0x2c279c;};'use strict';var Sequelize=require(_0xdd4c('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xdd4c('0x1')},'description':{'type':Sequelize[_0xdd4c('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xdd4c('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 2f6cadb..b5efe59 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 _0x82c4=['fields','query','attributes','length','order','sort','where','filters','pick','filter','map','key','field','options','rows','show','params','rawAttributes','includeAll','include','merge','create','body','findAll','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','/etc/asterisk/extensions_xcally_contexts.conf','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','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','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','get','Contexts','stack','name','send','index','VoiceContext','model','keys','intersection'];(function(_0x5ec5d8,_0x5cdc5c){var _0x2b28f2=function(_0x38256e){while(--_0x38256e){_0x5ec5d8['push'](_0x5ec5d8['shift']());}};_0x2b28f2(++_0x5cdc5c);}(_0x82c4,0x1ca));var _0x482c=function(_0xd67f28,_0x2396b3){_0xd67f28=_0xd67f28-0x0;var _0x3b7ed4=_0x82c4[_0xd67f28];return _0x3b7ed4;};'use strict';var pdf=require(_0x482c('0x0'));var emlformat=require(_0x482c('0x1'));var rimraf=require(_0x482c('0x2'));var zipdir=require(_0x482c('0x3'));var jsonpatch=require(_0x482c('0x4'));var rp=require(_0x482c('0x5'));var moment=require(_0x482c('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x482c('0x7'));var util=require('util');var path=require(_0x482c('0x8'));var sox=require('sox');var csv=require(_0x482c('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x482c('0xa'));var squel=require(_0x482c('0xb'));var crypto=require(_0x482c('0xc'));var jsforce=require(_0x482c('0xd'));var deskjs=require(_0x482c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x482c('0xf'));var Papa=require(_0x482c('0x10'));var Redis=require(_0x482c('0x11'));var authService=require(_0x482c('0x12'));var qs=require(_0x482c('0x13'));var hardwareService=require(_0x482c('0x14'));var logger=require('../../config/logger')(_0x482c('0x15'));var utils=require(_0x482c('0x16'));var config=require(_0x482c('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0x482c('0x18'));var client=jayson[_0x482c('0x19')][_0x482c('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x56aafd,_0x4bfb3a,_0x7b12cf){if(_0x7b12cf){var _0x30e02b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x30e02b['test'](_0x4bfb3a)){return _0x56aafd;}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 _0x56aafd;}}function respondWithRpcPromise(_0x14452b,_0xe3f853,_0x46016e,_0x3dfbc8){return new BPromise(function(_0x37a4f0,_0x119635){var _0x3beedb=_0x3dfbc8||client;return _0x3beedb[_0x482c('0x1b')](_0x14452b,_0x46016e)[_0x482c('0x1c')](function(_0x1758fb){logger[_0x482c('0x1d')](_0x482c('0x1e'),_0xe3f853,'request\x20sent');logger[_0x482c('0x1f')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0xe3f853,_0x482c('0x20'),JSON[_0x482c('0x21')](_0x1758fb));if(_0x1758fb['error']){if(_0x1758fb['error'][_0x482c('0x22')]===0x1f4){logger['error'](_0x482c('0x1e'),_0xe3f853,_0x1758fb[_0x482c('0x23')][_0x482c('0x24')]);return _0x119635(_0x1758fb[_0x482c('0x23')]['message']);}logger[_0x482c('0x23')](_0x482c('0x1e'),_0xe3f853,_0x1758fb[_0x482c('0x23')][_0x482c('0x24')]);return _0x37a4f0(_0x1758fb[_0x482c('0x23')]['message']);}else{logger['info'](_0x482c('0x1e'),_0xe3f853,_0x482c('0x20'));_0x37a4f0(_0x1758fb[_0x482c('0x25')]['message']);}})[_0x482c('0x26')](function(_0x579d2f){logger[_0x482c('0x23')](_0x482c('0x1e'),_0xe3f853,_0x579d2f);_0x119635(_0x579d2f);});});}function respondWithStatusCode(_0x4f1108,_0x466583){_0x466583=_0x466583||0xcc;return function(_0x5436e2){if(_0x5436e2){return _0x4f1108['sendStatus'](_0x466583);}return _0x4f1108[_0x482c('0x27')](_0x466583)[_0x482c('0x28')]();};}function respondWithResult(_0x36b25c,_0x1f4501){_0x1f4501=_0x1f4501||0xc8;return function(_0x3bd5bb){if(_0x3bd5bb){return _0x36b25c[_0x482c('0x27')](_0x1f4501)[_0x482c('0x29')](_0x3bd5bb);}};}function respondWithFilteredResult(_0x5ad788,_0xb65836){return function(_0x255417){if(_0x255417){var _0x58da7c=_0x255417[_0x482c('0x2a')],_0xb01bc3=_0xb65836['offset'],_0x52b6fc=_0xb65836[_0x482c('0x2b')]+_0xb65836[_0x482c('0x2c')],_0x54782d;if(_0x52b6fc>=_0x58da7c){_0x52b6fc=_0x58da7c;_0x54782d=0xc8;}else{_0x54782d=0xce;}_0x5ad788[_0x482c('0x27')](_0x54782d);return _0x5ad788[_0x482c('0x2d')](_0x482c('0x2e'),_0xb01bc3+'-'+_0x52b6fc+'/'+_0x58da7c)[_0x482c('0x29')](_0x255417);}return null;};}function patchUpdates(_0x36b00d){return function(_0x3e9b22){try{jsonpatch[_0x482c('0x2f')](_0x3e9b22,_0x36b00d,!![]);}catch(_0x2d3800){return BPromise[_0x482c('0x30')](_0x2d3800);}return _0x3e9b22[_0x482c('0x31')]();};}function saveUpdates(_0x164704,_0x8779c2){return function(_0x1eac87){if(_0x1eac87){return _0x1eac87[_0x482c('0x32')](_0x164704)[_0x482c('0x1c')](function(_0x37456e){return _0x37456e;});}return null;};}function removeEntity(_0x58c49b,_0x4bc837){return function(_0x520b6b){if(_0x520b6b){return _0x520b6b[_0x482c('0x33')]()[_0x482c('0x1c')](function(){var _0x46d06a=_0x520b6b[_0x482c('0x34')]({'plain':!![]});var _0x59905b=_0x482c('0x35');return db['UserProfileResource'][_0x482c('0x33')]({'where':{'type':_0x59905b,'resourceId':_0x46d06a['id']}})[_0x482c('0x1c')](function(){return _0x520b6b;});})[_0x482c('0x1c')](function(){_0x58c49b[_0x482c('0x27')](0xcc)[_0x482c('0x28')]();});}};}function handleEntityNotFound(_0x19cfc8,_0x129a31){return function(_0x34e80c){if(!_0x34e80c){_0x19cfc8['sendStatus'](0x194);}return _0x34e80c;};}function handleError(_0x5783a7,_0x467a70){_0x467a70=_0x467a70||0x1f4;return function(_0x4a4756){logger[_0x482c('0x23')](_0x4a4756[_0x482c('0x36')]);if(_0x4a4756[_0x482c('0x37')]){delete _0x4a4756['name'];}_0x5783a7[_0x482c('0x27')](_0x467a70)[_0x482c('0x38')](_0x4a4756);};}exports[_0x482c('0x39')]=function(_0x43c06e,_0x54a629){var _0xa5982a={},_0x52a610={},_0x1de7f4={'count':0x0,'rows':[]};var _0x4fc994=db[_0x482c('0x3a')]['rawAttributes'];_0x52a610[_0x482c('0x3b')]=_[_0x482c('0x3c')](_0x4fc994);_0x52a610['query']=_[_0x482c('0x3c')](_0x43c06e['query']);_0x52a610['filters']=_[_0x482c('0x3d')](_0x52a610['model'],_0x52a610['query']);_0xa5982a['attributes']=_['intersection'](_0x52a610[_0x482c('0x3b')],qs[_0x482c('0x3e')](_0x43c06e[_0x482c('0x3f')][_0x482c('0x3e')]));_0xa5982a[_0x482c('0x40')]=_0xa5982a['attributes'][_0x482c('0x41')]?_0xa5982a[_0x482c('0x40')]:_0x52a610[_0x482c('0x3b')];if(!_0x43c06e[_0x482c('0x3f')]['hasOwnProperty']('nolimit')){_0xa5982a[_0x482c('0x2c')]=qs[_0x482c('0x2c')](_0x43c06e[_0x482c('0x3f')][_0x482c('0x2c')]);_0xa5982a[_0x482c('0x2b')]=qs[_0x482c('0x2b')](_0x43c06e[_0x482c('0x3f')][_0x482c('0x2b')]);}_0xa5982a[_0x482c('0x42')]=qs[_0x482c('0x43')](_0x43c06e[_0x482c('0x3f')]['sort']);_0xa5982a[_0x482c('0x44')]=qs[_0x482c('0x45')](_[_0x482c('0x46')](_0x43c06e[_0x482c('0x3f')],_0x52a610[_0x482c('0x45')]));if(_0x43c06e[_0x482c('0x3f')][_0x482c('0x47')]){_0xa5982a['where']=_['merge'](_0xa5982a[_0x482c('0x44')],{'$or':_[_0x482c('0x48')](_0x4fc994,function(_0xbece12){if(_0xbece12['type'][_0x482c('0x49')]!=='VIRTUAL'){var _0x1331d6={};_0x1331d6[_0xbece12[_0x482c('0x4a')]]={'$like':'%'+_0x43c06e[_0x482c('0x3f')][_0x482c('0x47')]+'%'};return _0x1331d6;}})});}_0xa5982a=_['merge']({},_0xa5982a,_0x43c06e[_0x482c('0x4b')]);var _0x2c37f3={'where':_0xa5982a[_0x482c('0x44')]};return db['VoiceContext'][_0x482c('0x2a')](_0x2c37f3)[_0x482c('0x1c')](function(_0xcf89c4){_0x1de7f4['count']=_0xcf89c4;if(_0x43c06e['query']['includeAll']){_0xa5982a['include']=[{'all':!![]}];}return db['VoiceContext']['findAll'](_0xa5982a);})[_0x482c('0x1c')](function(_0x5bd0c5){_0x1de7f4[_0x482c('0x4c')]=_0x5bd0c5;return _0x1de7f4;})[_0x482c('0x1c')](respondWithFilteredResult(_0x54a629,_0xa5982a))[_0x482c('0x26')](handleError(_0x54a629,null));};exports[_0x482c('0x4d')]=function(_0x40174a,_0x351eb4){var _0x37be4f={'raw':![],'where':{'id':_0x40174a[_0x482c('0x4e')]['id']}},_0x2f4941={};_0x2f4941[_0x482c('0x3b')]=_[_0x482c('0x3c')](db[_0x482c('0x3a')][_0x482c('0x4f')]);_0x2f4941[_0x482c('0x3f')]=_[_0x482c('0x3c')](_0x40174a[_0x482c('0x3f')]);_0x2f4941[_0x482c('0x45')]=_[_0x482c('0x3d')](_0x2f4941[_0x482c('0x3b')],_0x2f4941['query']);_0x37be4f[_0x482c('0x40')]=_[_0x482c('0x3d')](_0x2f4941['model'],qs[_0x482c('0x3e')](_0x40174a[_0x482c('0x3f')][_0x482c('0x3e')]));_0x37be4f[_0x482c('0x40')]=_0x37be4f[_0x482c('0x40')]['length']?_0x37be4f['attributes']:_0x2f4941[_0x482c('0x3b')];if(_0x40174a[_0x482c('0x3f')][_0x482c('0x50')]){_0x37be4f[_0x482c('0x51')]=[{'all':!![]}];}_0x37be4f=_[_0x482c('0x52')]({},_0x37be4f,_0x40174a[_0x482c('0x4b')]);return db[_0x482c('0x3a')]['find'](_0x37be4f)['then'](handleEntityNotFound(_0x351eb4,null))['then'](respondWithResult(_0x351eb4,null))[_0x482c('0x26')](handleError(_0x351eb4,null));};exports[_0x482c('0x53')]=function(_0x3e5bfe,_0x2281e9,_0x45744d){var _0x16f6e0;return db[_0x482c('0x3a')][_0x482c('0x53')](_0x3e5bfe[_0x482c('0x54')],{'raw':!![]})[_0x482c('0x1c')](function(_0x38f81c){_0x16f6e0=_0x38f81c;return db['VoiceContext'][_0x482c('0x55')]({'raw':!![]});})[_0x482c('0x1c')](function(_0x1fe26e){var _0x2ec196=fs[_0x482c('0x56')](path[_0x482c('0x57')](config[_0x482c('0x58')],_0x482c('0x59')),_0x482c('0x5a'));var _0x3f3db6=ejs[_0x482c('0x5b')](_0x2ec196,{'contexts':_0x1fe26e||[]});fs[_0x482c('0x5c')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x3f3db6);})['then'](function(){return respondWithRpcPromise(_0x482c('0x5d'),_0x482c('0x53'),{'module':_0x482c('0x5e')});})[_0x482c('0x1c')](function(){var _0xa5ffff=_0x3e5bfe[_0x482c('0x5f')]['get']({'plain':!![]});if(!_0xa5ffff)throw new Error(_0x482c('0x60'));if(_0xa5ffff[_0x482c('0x61')]===_0x482c('0x5f')){var _0x1f44f0=_0x16f6e0[_0x482c('0x34')]({'plain':!![]});return db[_0x482c('0x62')][_0x482c('0x63')]({'where':{'name':_0x482c('0x35'),'userProfileId':_0xa5ffff[_0x482c('0x64')]},'raw':!![]})[_0x482c('0x1c')](function(_0xd168ac){if(_0xd168ac&&_0xd168ac[_0x482c('0x65')]===0x0){return db['UserProfileResource'][_0x482c('0x53')]({'name':_0x1f44f0['name'],'resourceId':_0x1f44f0['id'],'type':_0xd168ac[_0x482c('0x37')],'sectionId':_0xd168ac['id']},{})[_0x482c('0x1c')](function(){return _0x16f6e0;});}else{return _0x16f6e0;}})[_0x482c('0x26')](function(_0x1a9c83){logger[_0x482c('0x23')](_0x482c('0x66'),_0x1a9c83);throw _0x1a9c83;});}return _0x16f6e0;})['then'](respondWithResult(_0x2281e9,0xc9))[_0x482c('0x26')](handleError(_0x2281e9,null));};exports[_0x482c('0x32')]=function(_0x577b7f,_0x49fb5f,_0x390c0a){var _0x981891;return db['VoiceContext'][_0x482c('0x63')]({'where':{'id':_0x577b7f[_0x482c('0x4e')]['id']}})[_0x482c('0x1c')](handleEntityNotFound(_0x49fb5f,null))[_0x482c('0x1c')](saveUpdates(_0x577b7f['body'],null))[_0x482c('0x1c')](function(_0x387fca){if(_0x387fca){_0x981891=_0x387fca;return db[_0x482c('0x3a')][_0x482c('0x55')]({'raw':!![]});}})[_0x482c('0x1c')](function(_0x2fc65f){var _0x574068=fs['readFileSync'](path[_0x482c('0x57')](config[_0x482c('0x58')],_0x482c('0x59')),'utf8');var _0x23349f=ejs[_0x482c('0x5b')](_0x574068,{'contexts':_0x2fc65f||[]});fs[_0x482c('0x5c')](_0x482c('0x67'),_0x23349f);})[_0x482c('0x1c')](function(){return respondWithRpcPromise(_0x482c('0x5d'),_0x482c('0x32'),{'module':_0x482c('0x5e')});})[_0x482c('0x1c')](function(){return _0x981891;})['then'](respondWithResult(_0x49fb5f,null))['catch'](handleError(_0x49fb5f,null));};exports[_0x482c('0x33')]=function(_0x2099f5,_0x530cdb,_0x5d11ce){var _0x2475e1;return db[_0x482c('0x3a')][_0x482c('0x63')]({'where':{'id':_0x2099f5['params']['id']}})['then'](handleEntityNotFound(_0x530cdb,null))['then'](removeEntity(_0x530cdb,null))[_0x482c('0x1c')](function(){return db[_0x482c('0x3a')][_0x482c('0x55')]({'raw':!![]});})[_0x482c('0x1c')](function(_0x2333da){var _0xcbd59b=fs['readFileSync'](path['join'](config[_0x482c('0x58')],_0x482c('0x59')),_0x482c('0x5a'));var _0x244fc0=ejs[_0x482c('0x5b')](_0xcbd59b,{'contexts':_0x2333da});fs[_0x482c('0x5c')](_0x482c('0x67'),_0x244fc0);return respondWithRpcPromise(_0x482c('0x5d'),_0x482c('0x33'),{'module':_0x482c('0x5e')});})[_0x482c('0x26')](handleError(_0x530cdb,null));}; \ No newline at end of file +var _0x5496=['message','result','catch','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','update','then','get','Contexts','UserProfileResource','destroy','stack','name','VoiceContext','rawAttributes','model','keys','query','filters','intersection','fields','length','attributes','hasOwnProperty','limit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','field','options','include','findAll','show','params','includeAll','find','create','body','readFileSync','join','root','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','server/files/templates/context.ejs','Reload','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../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','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x5496,0x175));var _0x6549=function(_0x27800a,_0x5aa25e){_0x27800a=_0x27800a-0x0;var _0x352988=_0x5496[_0x27800a];return _0x352988;};'use strict';var pdf=require(_0x6549('0x0'));var emlformat=require(_0x6549('0x1'));var rimraf=require(_0x6549('0x2'));var zipdir=require(_0x6549('0x3'));var jsonpatch=require(_0x6549('0x4'));var rp=require('request-promise');var moment=require(_0x6549('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6549('0x6'));var util=require(_0x6549('0x7'));var path=require(_0x6549('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6549('0x9'));var fs=require('fs');var _=require(_0x6549('0xa'));var squel=require('squel');var crypto=require(_0x6549('0xb'));var jsforce=require(_0x6549('0xc'));var deskjs=require(_0x6549('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6549('0xe'));var Papa=require(_0x6549('0xf'));var Redis=require(_0x6549('0x10'));var authService=require(_0x6549('0x11'));var qs=require(_0x6549('0x12'));var hardwareService=require(_0x6549('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x6549('0x14'));var config=require(_0x6549('0x15'));var db=require(_0x6549('0x16'))['db'];var jayson=require(_0x6549('0x17'));var client=jayson[_0x6549('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x4dfb06,_0x3f844f,_0x39d78c){if(_0x39d78c){var _0x57a149=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x57a149[_0x6549('0x19')](_0x3f844f)){return _0x4dfb06;}else{throw new Error(_0x6549('0x1a'));}}else{return _0x4dfb06;}}function respondWithRpcPromise(_0x195d25,_0x12b068,_0xc0e859,_0x86ae9d){return new BPromise(function(_0x55c112,_0x5db86d){var _0x384f75=_0x86ae9d||client;return _0x384f75[_0x6549('0x1b')](_0x195d25,_0xc0e859)['then'](function(_0x238a04){logger[_0x6549('0x1c')](_0x6549('0x1d'),_0x12b068,_0x6549('0x1e'));logger[_0x6549('0x1f')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x12b068,'request\x20sent',JSON[_0x6549('0x20')](_0x238a04));if(_0x238a04['error']){if(_0x238a04['error'][_0x6549('0x21')]===0x1f4){logger[_0x6549('0x22')](_0x6549('0x1d'),_0x12b068,_0x238a04[_0x6549('0x22')][_0x6549('0x23')]);return _0x5db86d(_0x238a04['error'][_0x6549('0x23')]);}logger['error'](_0x6549('0x1d'),_0x12b068,_0x238a04[_0x6549('0x22')][_0x6549('0x23')]);return _0x55c112(_0x238a04[_0x6549('0x22')][_0x6549('0x23')]);}else{logger[_0x6549('0x1c')](_0x6549('0x1d'),_0x12b068,_0x6549('0x1e'));_0x55c112(_0x238a04[_0x6549('0x24')][_0x6549('0x23')]);}})[_0x6549('0x25')](function(_0x1fbfa4){logger[_0x6549('0x22')]('VoiceContext,\x20%s,\x20%s',_0x12b068,_0x1fbfa4);_0x5db86d(_0x1fbfa4);});});}function respondWithStatusCode(_0x30404e,_0x1bc8db){_0x1bc8db=_0x1bc8db||0xcc;return function(_0x53bbca){if(_0x53bbca){return _0x30404e[_0x6549('0x26')](_0x1bc8db);}return _0x30404e[_0x6549('0x27')](_0x1bc8db)[_0x6549('0x28')]();};}function respondWithResult(_0x583c7d,_0x31a95){_0x31a95=_0x31a95||0xc8;return function(_0xfb51a1){if(_0xfb51a1){return _0x583c7d[_0x6549('0x27')](_0x31a95)[_0x6549('0x29')](_0xfb51a1);}};}function respondWithFilteredResult(_0x442862,_0x3edf02){return function(_0x2f58f7){if(_0x2f58f7){var _0xa6c718=_0x2f58f7[_0x6549('0x2a')],_0x4c52f1=_0x3edf02['offset'],_0x1794bc=_0x3edf02[_0x6549('0x2b')]+_0x3edf02['limit'],_0x136518;if(_0x1794bc>=_0xa6c718){_0x1794bc=_0xa6c718;_0x136518=0xc8;}else{_0x136518=0xce;}_0x442862['status'](_0x136518);return _0x442862['set'](_0x6549('0x2c'),_0x4c52f1+'-'+_0x1794bc+'/'+_0xa6c718)[_0x6549('0x29')](_0x2f58f7);}return null;};}function patchUpdates(_0x4f3069){return function(_0x30aac6){try{jsonpatch[_0x6549('0x2d')](_0x30aac6,_0x4f3069,!![]);}catch(_0x2e481f){return BPromise[_0x6549('0x2e')](_0x2e481f);}return _0x30aac6[_0x6549('0x2f')]();};}function saveUpdates(_0xebf799,_0x464adf){return function(_0x504c42){if(_0x504c42){return _0x504c42[_0x6549('0x30')](_0xebf799)[_0x6549('0x31')](function(_0x2d52fe){return _0x2d52fe;});}return null;};}function removeEntity(_0x33bf79,_0x89c41c){return function(_0x81c049){if(_0x81c049){return _0x81c049['destroy']()[_0x6549('0x31')](function(){var _0x5bb783=_0x81c049[_0x6549('0x32')]({'plain':!![]});var _0x49872c=_0x6549('0x33');return db[_0x6549('0x34')][_0x6549('0x35')]({'where':{'type':_0x49872c,'resourceId':_0x5bb783['id']}})['then'](function(){return _0x81c049;});})[_0x6549('0x31')](function(){_0x33bf79[_0x6549('0x27')](0xcc)[_0x6549('0x28')]();});}};}function handleEntityNotFound(_0x3040e3,_0x5b8624){return function(_0x54f971){if(!_0x54f971){_0x3040e3['sendStatus'](0x194);}return _0x54f971;};}function handleError(_0x9d88fa,_0xccba54){_0xccba54=_0xccba54||0x1f4;return function(_0x4a1d09){logger[_0x6549('0x22')](_0x4a1d09[_0x6549('0x36')]);if(_0x4a1d09[_0x6549('0x37')]){delete _0x4a1d09[_0x6549('0x37')];}_0x9d88fa[_0x6549('0x27')](_0xccba54)['send'](_0x4a1d09);};}exports['index']=function(_0x1fcacf,_0x663fec){var _0x31ddaa={},_0xa79ffb={},_0xa96598={'count':0x0,'rows':[]};var _0x789559=db[_0x6549('0x38')][_0x6549('0x39')];_0xa79ffb[_0x6549('0x3a')]=_[_0x6549('0x3b')](_0x789559);_0xa79ffb['query']=_[_0x6549('0x3b')](_0x1fcacf[_0x6549('0x3c')]);_0xa79ffb[_0x6549('0x3d')]=_[_0x6549('0x3e')](_0xa79ffb[_0x6549('0x3a')],_0xa79ffb['query']);_0x31ddaa['attributes']=_['intersection'](_0xa79ffb[_0x6549('0x3a')],qs[_0x6549('0x3f')](_0x1fcacf[_0x6549('0x3c')][_0x6549('0x3f')]));_0x31ddaa['attributes']=_0x31ddaa['attributes'][_0x6549('0x40')]?_0x31ddaa[_0x6549('0x41')]:_0xa79ffb[_0x6549('0x3a')];if(!_0x1fcacf['query'][_0x6549('0x42')]('nolimit')){_0x31ddaa[_0x6549('0x43')]=qs[_0x6549('0x43')](_0x1fcacf[_0x6549('0x3c')][_0x6549('0x43')]);_0x31ddaa[_0x6549('0x2b')]=qs[_0x6549('0x2b')](_0x1fcacf[_0x6549('0x3c')]['offset']);}_0x31ddaa[_0x6549('0x44')]=qs[_0x6549('0x45')](_0x1fcacf[_0x6549('0x3c')][_0x6549('0x45')]);_0x31ddaa[_0x6549('0x46')]=qs[_0x6549('0x3d')](_[_0x6549('0x47')](_0x1fcacf[_0x6549('0x3c')],_0xa79ffb[_0x6549('0x3d')]));if(_0x1fcacf[_0x6549('0x3c')][_0x6549('0x48')]){_0x31ddaa[_0x6549('0x46')]=_[_0x6549('0x49')](_0x31ddaa[_0x6549('0x46')],{'$or':_[_0x6549('0x4a')](_0x789559,function(_0x1bc338){if(_0x1bc338['type'][_0x6549('0x4b')]!==_0x6549('0x4c')){var _0x5b1789={};_0x5b1789[_0x1bc338[_0x6549('0x4d')]]={'$like':'%'+_0x1fcacf['query'][_0x6549('0x48')]+'%'};return _0x5b1789;}})});}_0x31ddaa=_['merge']({},_0x31ddaa,_0x1fcacf[_0x6549('0x4e')]);var _0x465fff={'where':_0x31ddaa['where']};return db[_0x6549('0x38')][_0x6549('0x2a')](_0x465fff)[_0x6549('0x31')](function(_0x18a751){_0xa96598[_0x6549('0x2a')]=_0x18a751;if(_0x1fcacf['query']['includeAll']){_0x31ddaa[_0x6549('0x4f')]=[{'all':!![]}];}return db[_0x6549('0x38')][_0x6549('0x50')](_0x31ddaa);})[_0x6549('0x31')](function(_0x1e562b){_0xa96598['rows']=_0x1e562b;return _0xa96598;})[_0x6549('0x31')](respondWithFilteredResult(_0x663fec,_0x31ddaa))[_0x6549('0x25')](handleError(_0x663fec,null));};exports[_0x6549('0x51')]=function(_0x6121af,_0xa4c650){var _0x25a6ee={'raw':![],'where':{'id':_0x6121af[_0x6549('0x52')]['id']}},_0x28c0b2={};_0x28c0b2['model']=_[_0x6549('0x3b')](db['VoiceContext'][_0x6549('0x39')]);_0x28c0b2[_0x6549('0x3c')]=_[_0x6549('0x3b')](_0x6121af['query']);_0x28c0b2[_0x6549('0x3d')]=_[_0x6549('0x3e')](_0x28c0b2[_0x6549('0x3a')],_0x28c0b2['query']);_0x25a6ee[_0x6549('0x41')]=_[_0x6549('0x3e')](_0x28c0b2[_0x6549('0x3a')],qs[_0x6549('0x3f')](_0x6121af[_0x6549('0x3c')][_0x6549('0x3f')]));_0x25a6ee['attributes']=_0x25a6ee[_0x6549('0x41')]['length']?_0x25a6ee[_0x6549('0x41')]:_0x28c0b2[_0x6549('0x3a')];if(_0x6121af[_0x6549('0x3c')][_0x6549('0x53')]){_0x25a6ee[_0x6549('0x4f')]=[{'all':!![]}];}_0x25a6ee=_[_0x6549('0x49')]({},_0x25a6ee,_0x6121af[_0x6549('0x4e')]);return db[_0x6549('0x38')][_0x6549('0x54')](_0x25a6ee)[_0x6549('0x31')](handleEntityNotFound(_0xa4c650,null))[_0x6549('0x31')](respondWithResult(_0xa4c650,null))[_0x6549('0x25')](handleError(_0xa4c650,null));};exports['create']=function(_0x14ea60,_0x194f89,_0x325c0a){var _0x1eaa0f;return db[_0x6549('0x38')][_0x6549('0x55')](_0x14ea60[_0x6549('0x56')],{'raw':!![]})[_0x6549('0x31')](function(_0x4da0dc){_0x1eaa0f=_0x4da0dc;return db[_0x6549('0x38')][_0x6549('0x50')]({'raw':!![]});})[_0x6549('0x31')](function(_0x23c5f4){var _0x2b0ba8=fs[_0x6549('0x57')](path[_0x6549('0x58')](config[_0x6549('0x59')],'server/files/templates/context.ejs'),_0x6549('0x5a'));var _0x3b89d0=ejs[_0x6549('0x5b')](_0x2b0ba8,{'contexts':_0x23c5f4||[]});fs[_0x6549('0x5c')](_0x6549('0x5d'),_0x3b89d0);})[_0x6549('0x31')](function(){return respondWithRpcPromise('Reload',_0x6549('0x55'),{'module':_0x6549('0x5e')});})['then'](function(){var _0x38bce4=_0x14ea60[_0x6549('0x5f')][_0x6549('0x32')]({'plain':!![]});if(!_0x38bce4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x38bce4[_0x6549('0x60')]===_0x6549('0x5f')){var _0x5c05c9=_0x1eaa0f[_0x6549('0x32')]({'plain':!![]});return db['UserProfileSection'][_0x6549('0x54')]({'where':{'name':'Contexts','userProfileId':_0x38bce4[_0x6549('0x61')]},'raw':!![]})[_0x6549('0x31')](function(_0x1b791c){if(_0x1b791c&&_0x1b791c[_0x6549('0x62')]===0x0){return db[_0x6549('0x34')][_0x6549('0x55')]({'name':_0x5c05c9[_0x6549('0x37')],'resourceId':_0x5c05c9['id'],'type':_0x1b791c[_0x6549('0x37')],'sectionId':_0x1b791c['id']},{})[_0x6549('0x31')](function(){return _0x1eaa0f;});}else{return _0x1eaa0f;}})[_0x6549('0x25')](function(_0x92adfb){logger[_0x6549('0x22')](_0x6549('0x63'),_0x92adfb);throw _0x92adfb;});}return _0x1eaa0f;})[_0x6549('0x31')](respondWithResult(_0x194f89,0xc9))['catch'](handleError(_0x194f89,null));};exports[_0x6549('0x30')]=function(_0x355f53,_0x51d376,_0xfb11e1){var _0x8eb1eb;return db[_0x6549('0x38')][_0x6549('0x54')]({'where':{'id':_0x355f53['params']['id']}})[_0x6549('0x31')](handleEntityNotFound(_0x51d376,null))[_0x6549('0x31')](saveUpdates(_0x355f53[_0x6549('0x56')],null))[_0x6549('0x31')](function(_0x53d016){if(_0x53d016){_0x8eb1eb=_0x53d016;return db[_0x6549('0x38')]['findAll']({'raw':!![]});}})[_0x6549('0x31')](function(_0x16dc29){var _0x101221=fs[_0x6549('0x57')](path[_0x6549('0x58')](config[_0x6549('0x59')],_0x6549('0x64')),_0x6549('0x5a'));var _0x36504c=ejs[_0x6549('0x5b')](_0x101221,{'contexts':_0x16dc29||[]});fs['writeFileSync'](_0x6549('0x5d'),_0x36504c);})[_0x6549('0x31')](function(){return respondWithRpcPromise(_0x6549('0x65'),_0x6549('0x30'),{'module':_0x6549('0x5e')});})[_0x6549('0x31')](function(){return _0x8eb1eb;})['then'](respondWithResult(_0x51d376,null))['catch'](handleError(_0x51d376,null));};exports[_0x6549('0x35')]=function(_0x11886e,_0x34ee76,_0x4e8333){var _0x1be12c;return db[_0x6549('0x38')]['find']({'where':{'id':_0x11886e[_0x6549('0x52')]['id']}})[_0x6549('0x31')](handleEntityNotFound(_0x34ee76,null))[_0x6549('0x31')](removeEntity(_0x34ee76,null))[_0x6549('0x31')](function(){return db[_0x6549('0x38')][_0x6549('0x50')]({'raw':!![]});})[_0x6549('0x31')](function(_0x402c26){var _0x503935=fs[_0x6549('0x57')](path['join'](config[_0x6549('0x59')],_0x6549('0x64')),'utf8');var _0x372b67=ejs[_0x6549('0x5b')](_0x503935,{'contexts':_0x402c26});fs[_0x6549('0x5c')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x372b67);return respondWithRpcPromise(_0x6549('0x65'),_0x6549('0x35'),{'module':_0x6549('0x5e')});})[_0x6549('0x25')](handleError(_0x34ee76,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index b9e0436..0145d30 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 _0x521e=['VoiceContext','voice_contexts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','exports','define'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x521e,0x17c));var _0xe521=function(_0x30cea0,_0x2d7962){_0x30cea0=_0x30cea0-0x0;var _0xf69c2=_0x521e[_0x30cea0];return _0xf69c2;};'use strict';var _=require(_0xe521('0x0'));var util=require(_0xe521('0x1'));var logger=require(_0xe521('0x2'))(_0xe521('0x3'));var moment=require('moment');var BPromise=require(_0xe521('0x4'));var rp=require(_0xe521('0x5'));var fs=require('fs');var path=require(_0xe521('0x6'));var rimraf=require(_0xe521('0x7'));var config=require(_0xe521('0x8'));var attributes=require(_0xe521('0x9'));module[_0xe521('0xa')]=function(_0x1f0817,_0x54815e){return _0x1f0817[_0xe521('0xb')](_0xe521('0xc'),attributes,{'tableName':_0xe521('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x991b=['util','../../config/logger','api','moment','bluebird','path','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','lodash'];(function(_0x49d62b,_0x30b283){var _0x178bfe=function(_0xfbeb7e){while(--_0xfbeb7e){_0x49d62b['push'](_0x49d62b['shift']());}};_0x178bfe(++_0x30b283);}(_0x991b,0x9b));var _0xb991=function(_0x2849e9,_0xc9fe3){_0x2849e9=_0x2849e9-0x0;var _0x4d4461=_0x991b[_0x2849e9];return _0x4d4461;};'use strict';var _=require(_0xb991('0x0'));var util=require(_0xb991('0x1'));var logger=require(_0xb991('0x2'))(_0xb991('0x3'));var moment=require(_0xb991('0x4'));var BPromise=require(_0xb991('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb991('0x6'));var rimraf=require('rimraf');var config=require(_0xb991('0x7'));var attributes=require(_0xb991('0x8'));module[_0xb991('0x9')]=function(_0x13fb4a,_0x26fc40){return _0x13fb4a[_0xb991('0xa')](_0xb991('0xb'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index 13a3cf7..e461ebd 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 _0x4952=['VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x98c834,_0xbb9afa){var _0x5c7f5c=function(_0x4c8b3c){while(--_0x4c8b3c){_0x98c834['push'](_0x98c834['shift']());}};_0x5c7f5c(++_0xbb9afa);}(_0x4952,0x65));var _0x2495=function(_0x522ae8,_0x3b637e){_0x522ae8=_0x522ae8-0x0;var _0x3189b9=_0x4952[_0x522ae8];return _0x3189b9;};'use strict';var _=require(_0x2495('0x0'));var util=require('util');var moment=require(_0x2495('0x1'));var BPromise=require(_0x2495('0x2'));var rs=require(_0x2495('0x3'));var fs=require('fs');var Redis=require(_0x2495('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2495('0x5'));var logger=require(_0x2495('0x6'))(_0x2495('0x7'));var config=require('../../config/environment');var jayson=require(_0x2495('0x8'));var client=jayson[_0x2495('0x9')][_0x2495('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1fd0b8,_0x1d6c55,_0x395568){return new BPromise(function(_0x28924b,_0x254586){return client[_0x2495('0xb')](_0x1fd0b8,_0x395568)[_0x2495('0xc')](function(_0x187fb6){logger[_0x2495('0xd')](_0x2495('0xe'),_0x1d6c55,_0x2495('0xf'));logger[_0x2495('0x10')](_0x2495('0x11'),_0x1d6c55,_0x2495('0xf'),JSON['stringify'](_0x187fb6));if(_0x187fb6[_0x2495('0x12')]){if(_0x187fb6['error'][_0x2495('0x13')]===0x1f4){logger[_0x2495('0x12')](_0x2495('0xe'),_0x1d6c55,_0x187fb6[_0x2495('0x12')]['message']);return _0x254586(_0x187fb6[_0x2495('0x12')]['message']);}logger[_0x2495('0x12')](_0x2495('0xe'),_0x1d6c55,_0x187fb6[_0x2495('0x12')][_0x2495('0x14')]);return _0x28924b(_0x187fb6['error'][_0x2495('0x14')]);}else{logger[_0x2495('0xd')]('VoiceContext,\x20%s,\x20%s',_0x1d6c55,_0x2495('0xf'));_0x28924b(_0x187fb6[_0x2495('0x15')][_0x2495('0x14')]);}})[_0x2495('0x16')](function(_0x4bd832){logger[_0x2495('0x12')](_0x2495('0xe'),_0x1d6c55,_0x4bd832);_0x254586(_0x4bd832);});});} \ No newline at end of file +var _0x0257=['debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','info','VoiceContext,\x20%s,\x20%s','request\x20sent'];(function(_0x2110bb,_0x5bf49e){var _0x5cf87c=function(_0x3cb360){while(--_0x3cb360){_0x2110bb['push'](_0x2110bb['shift']());}};_0x5cf87c(++_0x5bf49e);}(_0x0257,0x12e));var _0x7025=function(_0xcc26d2,_0x20c921){_0xcc26d2=_0xcc26d2-0x0;var _0x3841e2=_0x0257[_0xcc26d2];return _0x3841e2;};'use strict';var _=require(_0x7025('0x0'));var util=require(_0x7025('0x1'));var moment=require(_0x7025('0x2'));var BPromise=require(_0x7025('0x3'));var rs=require(_0x7025('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7025('0x5'))['db'];var utils=require(_0x7025('0x6'));var logger=require(_0x7025('0x7'))('rpc');var config=require(_0x7025('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7025('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3a5058,_0x3ba093,_0x1c12a5){return new BPromise(function(_0x5338a5,_0x479413){return client['request'](_0x3a5058,_0x1c12a5)['then'](function(_0x32b413){logger[_0x7025('0xa')](_0x7025('0xb'),_0x3ba093,_0x7025('0xc'));logger[_0x7025('0xd')](_0x7025('0xe'),_0x3ba093,'request\x20sent',JSON[_0x7025('0xf')](_0x32b413));if(_0x32b413['error']){if(_0x32b413['error'][_0x7025('0x10')]===0x1f4){logger[_0x7025('0x11')](_0x7025('0xb'),_0x3ba093,_0x32b413[_0x7025('0x11')]['message']);return _0x479413(_0x32b413[_0x7025('0x11')][_0x7025('0x12')]);}logger[_0x7025('0x11')](_0x7025('0xb'),_0x3ba093,_0x32b413[_0x7025('0x11')][_0x7025('0x12')]);return _0x5338a5(_0x32b413[_0x7025('0x11')][_0x7025('0x12')]);}else{logger[_0x7025('0xa')](_0x7025('0xb'),_0x3ba093,_0x7025('0xc'));_0x5338a5(_0x32b413[_0x7025('0x13')][_0x7025('0x12')]);}})[_0x7025('0x14')](function(_0x26ecc0){logger['error'](_0x7025('0xb'),_0x3ba093,_0x26ecc0);_0x479413(_0x26ecc0);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index d7abfec..271a1ca 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 _0x6a14=['../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','delete','util','path','express'];(function(_0x2b3b9a,_0xb50fb5){var _0x59825e=function(_0x31ef26){while(--_0x31ef26){_0x2b3b9a['push'](_0x2b3b9a['shift']());}};_0x59825e(++_0xb50fb5);}(_0x6a14,0x6d));var _0x46a1=function(_0x439660,_0x3e13d3){_0x439660=_0x439660-0x0;var _0x2fa049=_0x6a14[_0x439660];return _0x2fa049;};'use strict';var multer=require('multer');var util=require(_0x46a1('0x0'));var path=require(_0x46a1('0x1'));var timeout=require('connect-timeout');var express=require(_0x46a1('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x46a1('0x3'));var controller=require('./voiceDialReport.controller');router[_0x46a1('0x4')]('/',auth[_0x46a1('0x5')](),controller[_0x46a1('0x6')]);router['get'](_0x46a1('0x7'),auth['isAuthenticated'](),controller[_0x46a1('0x8')]);router['get']('/:id',auth[_0x46a1('0x5')](),controller[_0x46a1('0x9')]);router[_0x46a1('0xa')]('/',auth[_0x46a1('0x5')](),controller[_0x46a1('0xb')]);router[_0x46a1('0xc')](_0x46a1('0xd'),auth[_0x46a1('0x5')](),controller[_0x46a1('0xe')]);router[_0x46a1('0xf')]('/:id',auth[_0x46a1('0x5')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5d9e=['Router','../../components/auth/service','../../components/interaction/service','./voiceDialReport.controller','isAuthenticated','index','get','describe','/:id','post','create','put','update','destroy','exports','util','path','connect-timeout'];(function(_0x5ea1c8,_0x1ed256){var _0x432358=function(_0xd46520){while(--_0xd46520){_0x5ea1c8['push'](_0x5ea1c8['shift']());}};_0x432358(++_0x1ed256);}(_0x5d9e,0x165));var _0xe5d9=function(_0xcb7d42,_0x55c823){_0xcb7d42=_0xcb7d42-0x0;var _0x186611=_0x5d9e[_0xcb7d42];return _0x186611;};'use strict';var multer=require('multer');var util=require(_0xe5d9('0x0'));var path=require(_0xe5d9('0x1'));var timeout=require(_0xe5d9('0x2'));var express=require('express');var router=express[_0xe5d9('0x3')]();var auth=require(_0xe5d9('0x4'));var interaction=require(_0xe5d9('0x5'));var config=require('../../config/environment');var controller=require(_0xe5d9('0x6'));router['get']('/',auth[_0xe5d9('0x7')](),controller[_0xe5d9('0x8')]);router[_0xe5d9('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xe5d9('0xa')]);router[_0xe5d9('0x9')](_0xe5d9('0xb'),auth[_0xe5d9('0x7')](),controller['show']);router[_0xe5d9('0xc')]('/',auth[_0xe5d9('0x7')](),controller[_0xe5d9('0xd')]);router[_0xe5d9('0xe')]('/:id',auth[_0xe5d9('0x7')](),controller[_0xe5d9('0xf')]);router['delete'](_0xe5d9('0xb'),auth[_0xe5d9('0x7')](),controller[_0xe5d9('0x10')]);module[_0xe5d9('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 09ecd28..2575850 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 _0x201d=['STRING','INTEGER','DATE','called,connect,complete','sequelize','exports'];(function(_0x3ef45e,_0xe84f33){var _0x69e7c=function(_0x43ba11){while(--_0x43ba11){_0x3ef45e['push'](_0x3ef45e['shift']());}};_0x69e7c(++_0xe84f33);}(_0x201d,0x184));var _0xd201=function(_0x5e078a,_0x13dbea){_0x5e078a=_0x5e078a-0x0;var _0x41ea30=_0x201d[_0x5e078a];return _0x41ea30;};'use strict';var Sequelize=require(_0xd201('0x0'));module[_0xd201('0x1')]={'privilege':{'type':Sequelize[_0xd201('0x2')]},'channel':{'type':Sequelize[_0xd201('0x2')]},'channelstate':{'type':Sequelize[_0xd201('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xd201('0x2')]},'connectedlinenum':{'type':Sequelize[_0xd201('0x2')]},'connectedlinename':{'type':Sequelize[_0xd201('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xd201('0x2')]},'context':{'type':Sequelize[_0xd201('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xd201('0x3')]},'uniqueid':{'type':Sequelize[_0xd201('0x2')]},'linkedid':{'type':Sequelize[_0xd201('0x2')]},'destchannel':{'type':Sequelize[_0xd201('0x2')]},'destchannelstate':{'type':Sequelize[_0xd201('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xd201('0x2')]},'destcalleridnum':{'type':Sequelize[_0xd201('0x2')]},'destcalleridname':{'type':Sequelize[_0xd201('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xd201('0x2')]},'destaccountcode':{'type':Sequelize[_0xd201('0x2')]},'destcontext':{'type':Sequelize[_0xd201('0x2')]},'destexten':{'type':Sequelize[_0xd201('0x2')]},'destpriority':{'type':Sequelize[_0xd201('0x3')]},'destuniqueid':{'type':Sequelize[_0xd201('0x2')]},'destlinkedid':{'type':Sequelize[_0xd201('0x2')]},'dialstring':{'type':Sequelize[_0xd201('0x2')]},'dialstatus':{'type':Sequelize[_0xd201('0x2')]},'starttime':{'type':Sequelize[_0xd201('0x4')]},'answertime':{'type':Sequelize[_0xd201('0x4')]},'endtime':{'type':Sequelize[_0xd201('0x4')]},'lastevent':{'type':Sequelize[_0xd201('0x2')],'comment':_0xd201('0x5')},'routeId':{'type':Sequelize[_0xd201('0x3')]},'duration':{'type':Sequelize[_0xd201('0x3')]},'holdtime':{'type':Sequelize[_0xd201('0x3')]},'billableseconds':{'type':Sequelize[_0xd201('0x3')]}}; \ No newline at end of file +var _0xfd52=['DATE','called,connect,complete','sequelize','STRING','INTEGER'];(function(_0x5c3056,_0x4b5bca){var _0x2d3393=function(_0x28612d){while(--_0x28612d){_0x5c3056['push'](_0x5c3056['shift']());}};_0x2d3393(++_0x4b5bca);}(_0xfd52,0xc0));var _0x2fd5=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xfd52[_0x28947d];return _0x12d2ee;};'use strict';var Sequelize=require(_0x2fd5('0x0'));module['exports']={'privilege':{'type':Sequelize[_0x2fd5('0x1')]},'channel':{'type':Sequelize[_0x2fd5('0x1')]},'channelstate':{'type':Sequelize[_0x2fd5('0x2')]},'channelstatedesc':{'type':Sequelize[_0x2fd5('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x2fd5('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x2fd5('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x2fd5('0x1')]},'exten':{'type':Sequelize[_0x2fd5('0x1')]},'priority':{'type':Sequelize[_0x2fd5('0x2')]},'uniqueid':{'type':Sequelize[_0x2fd5('0x1')]},'linkedid':{'type':Sequelize[_0x2fd5('0x1')]},'destchannel':{'type':Sequelize[_0x2fd5('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x2fd5('0x1')]},'destcalleridnum':{'type':Sequelize[_0x2fd5('0x1')]},'destcalleridname':{'type':Sequelize[_0x2fd5('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x2fd5('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x2fd5('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x2fd5('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x2fd5('0x1')]},'dialstring':{'type':Sequelize[_0x2fd5('0x1')]},'dialstatus':{'type':Sequelize[_0x2fd5('0x1')]},'starttime':{'type':Sequelize[_0x2fd5('0x3')]},'answertime':{'type':Sequelize[_0x2fd5('0x3')]},'endtime':{'type':Sequelize[_0x2fd5('0x3')]},'lastevent':{'type':Sequelize[_0x2fd5('0x1')],'comment':_0x2fd5('0x4')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0x2fd5('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 7843187..7cc52fe 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 _0x47d6=['attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','map','type','VIRTUAL','field','filter','merge','options','includeAll','findAll','rows','catch','show','params','find','create','body','describe','html-pdf','eml-format','zip-dir','moment','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','status','json','count','offset','Content-Range','apply','reject','update','then','destroy','end','sendStatus','error','stack','name','send','index','VoiceDialReport','rawAttributes','model','keys','query','filters'];(function(_0x2180bd,_0x212355){var _0x51eda1=function(_0x440038){while(--_0x440038){_0x2180bd['push'](_0x2180bd['shift']());}};_0x51eda1(++_0x212355);}(_0x47d6,0x13b));var _0x647d=function(_0xd650c5,_0x5bf52b){_0xd650c5=_0xd650c5-0x0;var _0x13867a=_0x47d6[_0xd650c5];return _0x13867a;};'use strict';var pdf=require(_0x647d('0x0'));var emlformat=require(_0x647d('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x647d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x647d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x647d('0x4'));var util=require('util');var path=require(_0x647d('0x5'));var sox=require(_0x647d('0x6'));var csv=require('to-csv');var ejs=require(_0x647d('0x7'));var fs=require('fs');var _=require(_0x647d('0x8'));var squel=require(_0x647d('0x9'));var crypto=require(_0x647d('0xa'));var jsforce=require(_0x647d('0xb'));var deskjs=require(_0x647d('0xc'));var toCsv=require(_0x647d('0xd'));var querystring=require(_0x647d('0xe'));var Papa=require(_0x647d('0xf'));var Redis=require(_0x647d('0x10'));var authService=require(_0x647d('0x11'));var qs=require(_0x647d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x647d('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x647d('0x14'));var db=require(_0x647d('0x15'))['db'];function respondWithStatusCode(_0x383a3f,_0x113425){_0x113425=_0x113425||0xcc;return function(_0x3b5808){if(_0x3b5808){return _0x383a3f['sendStatus'](_0x113425);}return _0x383a3f['status'](_0x113425)['end']();};}function respondWithResult(_0x3793af,_0x16052d){_0x16052d=_0x16052d||0xc8;return function(_0x4d4fa4){if(_0x4d4fa4){return _0x3793af[_0x647d('0x16')](_0x16052d)[_0x647d('0x17')](_0x4d4fa4);}};}function respondWithFilteredResult(_0x217a00,_0x4cca5a){return function(_0x2242e7){if(_0x2242e7){var _0x44f8ad=_0x2242e7[_0x647d('0x18')],_0x5d07c5=_0x4cca5a['offset'],_0x300d04=_0x4cca5a[_0x647d('0x19')]+_0x4cca5a['limit'],_0x5c9114;if(_0x300d04>=_0x44f8ad){_0x300d04=_0x44f8ad;_0x5c9114=0xc8;}else{_0x5c9114=0xce;}_0x217a00[_0x647d('0x16')](_0x5c9114);return _0x217a00['set'](_0x647d('0x1a'),_0x5d07c5+'-'+_0x300d04+'/'+_0x44f8ad)[_0x647d('0x17')](_0x2242e7);}return null;};}function patchUpdates(_0x442b22){return function(_0x19d845){try{jsonpatch[_0x647d('0x1b')](_0x19d845,_0x442b22,!![]);}catch(_0x27b3cd){return BPromise[_0x647d('0x1c')](_0x27b3cd);}return _0x19d845['save']();};}function saveUpdates(_0x50dcc5,_0x2bb0fd){return function(_0xe171ce){if(_0xe171ce){return _0xe171ce[_0x647d('0x1d')](_0x50dcc5)[_0x647d('0x1e')](function(_0x1ca3d4){return _0x1ca3d4;});}return null;};}function removeEntity(_0x3d1389,_0x23cacc){return function(_0x29b4ea){if(_0x29b4ea){return _0x29b4ea[_0x647d('0x1f')]()['then'](function(){_0x3d1389['status'](0xcc)[_0x647d('0x20')]();});}};}function handleEntityNotFound(_0x4a85b1,_0x1d872c){return function(_0x1c5b60){if(!_0x1c5b60){_0x4a85b1[_0x647d('0x21')](0x194);}return _0x1c5b60;};}function handleError(_0x4f26aa,_0x1eda52){_0x1eda52=_0x1eda52||0x1f4;return function(_0x5122ff){logger[_0x647d('0x22')](_0x5122ff[_0x647d('0x23')]);if(_0x5122ff[_0x647d('0x24')]){delete _0x5122ff[_0x647d('0x24')];}_0x4f26aa['status'](_0x1eda52)[_0x647d('0x25')](_0x5122ff);};}exports[_0x647d('0x26')]=function(_0x56edbe,_0x4a6c87){var _0x812bce={},_0x583ba6={},_0x381d08={'count':0x0,'rows':[]};var _0x36a753=db[_0x647d('0x27')][_0x647d('0x28')];_0x583ba6[_0x647d('0x29')]=_[_0x647d('0x2a')](_0x36a753);_0x583ba6[_0x647d('0x2b')]=_['keys'](_0x56edbe[_0x647d('0x2b')]);_0x583ba6[_0x647d('0x2c')]=_['intersection'](_0x583ba6['model'],_0x583ba6[_0x647d('0x2b')]);_0x812bce[_0x647d('0x2d')]=_[_0x647d('0x2e')](_0x583ba6[_0x647d('0x29')],qs[_0x647d('0x2f')](_0x56edbe[_0x647d('0x2b')][_0x647d('0x2f')]));_0x812bce['attributes']=_0x812bce[_0x647d('0x2d')][_0x647d('0x30')]?_0x812bce[_0x647d('0x2d')]:_0x583ba6['model'];if(!_0x56edbe[_0x647d('0x2b')][_0x647d('0x31')](_0x647d('0x32'))){_0x812bce['limit']=qs[_0x647d('0x33')](_0x56edbe[_0x647d('0x2b')]['limit']);_0x812bce['offset']=qs[_0x647d('0x19')](_0x56edbe[_0x647d('0x2b')]['offset']);}_0x812bce['order']=qs['sort'](_0x56edbe['query'][_0x647d('0x34')]);_0x812bce[_0x647d('0x35')]=qs[_0x647d('0x2c')](_[_0x647d('0x36')](_0x56edbe[_0x647d('0x2b')],_0x583ba6['filters']));if(_0x56edbe[_0x647d('0x2b')]['filter']){_0x812bce[_0x647d('0x35')]=_['merge'](_0x812bce[_0x647d('0x35')],{'$or':_[_0x647d('0x37')](_0x36a753,function(_0x3c59ff){if(_0x3c59ff[_0x647d('0x38')]['key']!==_0x647d('0x39')){var _0x2068f9={};_0x2068f9[_0x3c59ff[_0x647d('0x3a')]]={'$like':'%'+_0x56edbe['query'][_0x647d('0x3b')]+'%'};return _0x2068f9;}})});}_0x812bce=_[_0x647d('0x3c')]({},_0x812bce,_0x56edbe[_0x647d('0x3d')]);var _0x37efd4={'where':_0x812bce[_0x647d('0x35')]};return db[_0x647d('0x27')]['count'](_0x37efd4)[_0x647d('0x1e')](function(_0x3796d9){_0x381d08['count']=_0x3796d9;if(_0x56edbe[_0x647d('0x2b')][_0x647d('0x3e')]){_0x812bce['include']=[{'all':!![]}];}return db['VoiceDialReport'][_0x647d('0x3f')](_0x812bce);})['then'](function(_0x4fcae4){_0x381d08[_0x647d('0x40')]=_0x4fcae4;return _0x381d08;})[_0x647d('0x1e')](respondWithFilteredResult(_0x4a6c87,_0x812bce))[_0x647d('0x41')](handleError(_0x4a6c87,null));};exports[_0x647d('0x42')]=function(_0x1e4441,_0xa76730){var _0xa69263={'raw':!![],'where':{'id':_0x1e4441[_0x647d('0x43')]['id']}},_0x2a9e32={};_0x2a9e32[_0x647d('0x29')]=_[_0x647d('0x2a')](db[_0x647d('0x27')]['rawAttributes']);_0x2a9e32[_0x647d('0x2b')]=_[_0x647d('0x2a')](_0x1e4441[_0x647d('0x2b')]);_0x2a9e32[_0x647d('0x2c')]=_[_0x647d('0x2e')](_0x2a9e32['model'],_0x2a9e32[_0x647d('0x2b')]);_0xa69263[_0x647d('0x2d')]=_['intersection'](_0x2a9e32[_0x647d('0x29')],qs[_0x647d('0x2f')](_0x1e4441[_0x647d('0x2b')][_0x647d('0x2f')]));_0xa69263[_0x647d('0x2d')]=_0xa69263['attributes']['length']?_0xa69263[_0x647d('0x2d')]:_0x2a9e32[_0x647d('0x29')];if(_0x1e4441[_0x647d('0x2b')][_0x647d('0x3e')]){_0xa69263['include']=[{'all':!![]}];}_0xa69263=_[_0x647d('0x3c')]({},_0xa69263,_0x1e4441[_0x647d('0x3d')]);return db['VoiceDialReport'][_0x647d('0x44')](_0xa69263)['then'](handleEntityNotFound(_0xa76730,null))['then'](respondWithResult(_0xa76730,null))[_0x647d('0x41')](handleError(_0xa76730,null));};exports[_0x647d('0x45')]=function(_0x5da738,_0x33bdd2){return db['VoiceDialReport'][_0x647d('0x45')](_0x5da738[_0x647d('0x46')],{})[_0x647d('0x1e')](respondWithResult(_0x33bdd2,0xc9))[_0x647d('0x41')](handleError(_0x33bdd2,null));};exports[_0x647d('0x1d')]=function(_0x326b63,_0x137b9a){if(_0x326b63[_0x647d('0x46')]['id']){delete _0x326b63[_0x647d('0x46')]['id'];}return db[_0x647d('0x27')][_0x647d('0x44')]({'where':{'id':_0x326b63[_0x647d('0x43')]['id']}})[_0x647d('0x1e')](handleEntityNotFound(_0x137b9a,null))[_0x647d('0x1e')](saveUpdates(_0x326b63[_0x647d('0x46')],null))[_0x647d('0x1e')](respondWithResult(_0x137b9a,null))[_0x647d('0x41')](handleError(_0x137b9a,null));};exports[_0x647d('0x1f')]=function(_0x5158c5,_0x584261){return db[_0x647d('0x27')][_0x647d('0x44')]({'where':{'id':_0x5158c5[_0x647d('0x43')]['id']}})[_0x647d('0x1e')](handleEntityNotFound(_0x584261,null))[_0x647d('0x1e')](removeEntity(_0x584261,null))[_0x647d('0x41')](handleError(_0x584261,null));};exports[_0x647d('0x47')]=function(_0x4a7e9d,_0x1ac9ca){return db['VoiceDialReport'][_0x647d('0x47')]()[_0x647d('0x1e')](respondWithResult(_0x1ac9ca,null))[_0x647d('0x41')](handleError(_0x1ac9ca,null));}; \ No newline at end of file +var _0xf7cb=['name','index','VoiceDialReport','keys','query','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','key','VIRTUAL','field','options','count','then','includeAll','include','rows','catch','show','params','rawAttributes','filters','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','set','apply','reject','save','update','destroy','sendStatus'];(function(_0x174316,_0x2a70d4){var _0x1e4972=function(_0x4bdf40){while(--_0x4bdf40){_0x174316['push'](_0x174316['shift']());}};_0x1e4972(++_0x2a70d4);}(_0xf7cb,0x197));var _0xbf7c=function(_0x54932e,_0x420247){_0x54932e=_0x54932e-0x0;var _0x560ac4=_0xf7cb[_0x54932e];return _0x560ac4;};'use strict';var pdf=require(_0xbf7c('0x0'));var emlformat=require(_0xbf7c('0x1'));var rimraf=require(_0xbf7c('0x2'));var zipdir=require(_0xbf7c('0x3'));var jsonpatch=require(_0xbf7c('0x4'));var rp=require(_0xbf7c('0x5'));var moment=require('moment');var BPromise=require(_0xbf7c('0x6'));var Mustache=require(_0xbf7c('0x7'));var util=require('util');var path=require(_0xbf7c('0x8'));var sox=require(_0xbf7c('0x9'));var csv=require(_0xbf7c('0xa'));var ejs=require(_0xbf7c('0xb'));var fs=require('fs');var _=require(_0xbf7c('0xc'));var squel=require(_0xbf7c('0xd'));var crypto=require(_0xbf7c('0xe'));var jsforce=require(_0xbf7c('0xf'));var deskjs=require(_0xbf7c('0x10'));var toCsv=require(_0xbf7c('0xa'));var querystring=require(_0xbf7c('0x11'));var Papa=require('papaparse');var Redis=require(_0xbf7c('0x12'));var authService=require(_0xbf7c('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xbf7c('0x14'));var logger=require(_0xbf7c('0x15'))('api');var utils=require(_0xbf7c('0x16'));var config=require(_0xbf7c('0x17'));var db=require(_0xbf7c('0x18'))['db'];function respondWithStatusCode(_0x4b9ce3,_0x15b21f){_0x15b21f=_0x15b21f||0xcc;return function(_0x1c459d){if(_0x1c459d){return _0x4b9ce3['sendStatus'](_0x15b21f);}return _0x4b9ce3[_0xbf7c('0x19')](_0x15b21f)[_0xbf7c('0x1a')]();};}function respondWithResult(_0x1d43f3,_0x11987e){_0x11987e=_0x11987e||0xc8;return function(_0x2959aa){if(_0x2959aa){return _0x1d43f3['status'](_0x11987e)[_0xbf7c('0x1b')](_0x2959aa);}};}function respondWithFilteredResult(_0x3201de,_0x3e0006){return function(_0x37511e){if(_0x37511e){var _0x49b1a1=_0x37511e['count'],_0x117cd6=_0x3e0006[_0xbf7c('0x1c')],_0x59f324=_0x3e0006['offset']+_0x3e0006[_0xbf7c('0x1d')],_0x3cde17;if(_0x59f324>=_0x49b1a1){_0x59f324=_0x49b1a1;_0x3cde17=0xc8;}else{_0x3cde17=0xce;}_0x3201de['status'](_0x3cde17);return _0x3201de[_0xbf7c('0x1e')]('Content-Range',_0x117cd6+'-'+_0x59f324+'/'+_0x49b1a1)[_0xbf7c('0x1b')](_0x37511e);}return null;};}function patchUpdates(_0x3c67f3){return function(_0x2c5126){try{jsonpatch[_0xbf7c('0x1f')](_0x2c5126,_0x3c67f3,!![]);}catch(_0x1ac1e7){return BPromise[_0xbf7c('0x20')](_0x1ac1e7);}return _0x2c5126[_0xbf7c('0x21')]();};}function saveUpdates(_0x499f7b,_0x584e2a){return function(_0x9a08a7){if(_0x9a08a7){return _0x9a08a7[_0xbf7c('0x22')](_0x499f7b)['then'](function(_0x517aea){return _0x517aea;});}return null;};}function removeEntity(_0x5829f9,_0x5cba03){return function(_0x2c93df){if(_0x2c93df){return _0x2c93df[_0xbf7c('0x23')]()['then'](function(){_0x5829f9[_0xbf7c('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d15fb,_0x24f6a5){return function(_0x59fd11){if(!_0x59fd11){_0x1d15fb[_0xbf7c('0x24')](0x194);}return _0x59fd11;};}function handleError(_0x296549,_0x10ad91){_0x10ad91=_0x10ad91||0x1f4;return function(_0x3f5649){logger['error'](_0x3f5649['stack']);if(_0x3f5649[_0xbf7c('0x25')]){delete _0x3f5649[_0xbf7c('0x25')];}_0x296549[_0xbf7c('0x19')](_0x10ad91)['send'](_0x3f5649);};}exports[_0xbf7c('0x26')]=function(_0x7c55e3,_0x1ebbd1){var _0x47d30c={},_0x482de7={},_0x4da48d={'count':0x0,'rows':[]};var _0x1771fa=db[_0xbf7c('0x27')]['rawAttributes'];_0x482de7['model']=_[_0xbf7c('0x28')](_0x1771fa);_0x482de7['query']=_[_0xbf7c('0x28')](_0x7c55e3[_0xbf7c('0x29')]);_0x482de7['filters']=_[_0xbf7c('0x2a')](_0x482de7['model'],_0x482de7[_0xbf7c('0x29')]);_0x47d30c['attributes']=_[_0xbf7c('0x2a')](_0x482de7['model'],qs[_0xbf7c('0x2b')](_0x7c55e3[_0xbf7c('0x29')][_0xbf7c('0x2b')]));_0x47d30c[_0xbf7c('0x2c')]=_0x47d30c[_0xbf7c('0x2c')][_0xbf7c('0x2d')]?_0x47d30c[_0xbf7c('0x2c')]:_0x482de7[_0xbf7c('0x2e')];if(!_0x7c55e3[_0xbf7c('0x29')][_0xbf7c('0x2f')](_0xbf7c('0x30'))){_0x47d30c['limit']=qs['limit'](_0x7c55e3['query'][_0xbf7c('0x1d')]);_0x47d30c[_0xbf7c('0x1c')]=qs['offset'](_0x7c55e3[_0xbf7c('0x29')][_0xbf7c('0x1c')]);}_0x47d30c[_0xbf7c('0x31')]=qs[_0xbf7c('0x32')](_0x7c55e3['query'][_0xbf7c('0x32')]);_0x47d30c[_0xbf7c('0x33')]=qs['filters'](_[_0xbf7c('0x34')](_0x7c55e3[_0xbf7c('0x29')],_0x482de7['filters']));if(_0x7c55e3['query']['filter']){_0x47d30c[_0xbf7c('0x33')]=_[_0xbf7c('0x35')](_0x47d30c[_0xbf7c('0x33')],{'$or':_[_0xbf7c('0x36')](_0x1771fa,function(_0x2085b2){if(_0x2085b2[_0xbf7c('0x37')][_0xbf7c('0x38')]!==_0xbf7c('0x39')){var _0x23c951={};_0x23c951[_0x2085b2[_0xbf7c('0x3a')]]={'$like':'%'+_0x7c55e3['query']['filter']+'%'};return _0x23c951;}})});}_0x47d30c=_[_0xbf7c('0x35')]({},_0x47d30c,_0x7c55e3[_0xbf7c('0x3b')]);var _0x2bd720={'where':_0x47d30c[_0xbf7c('0x33')]};return db[_0xbf7c('0x27')][_0xbf7c('0x3c')](_0x2bd720)[_0xbf7c('0x3d')](function(_0x26a78e){_0x4da48d[_0xbf7c('0x3c')]=_0x26a78e;if(_0x7c55e3[_0xbf7c('0x29')][_0xbf7c('0x3e')]){_0x47d30c[_0xbf7c('0x3f')]=[{'all':!![]}];}return db['VoiceDialReport']['findAll'](_0x47d30c);})[_0xbf7c('0x3d')](function(_0x2803e2){_0x4da48d[_0xbf7c('0x40')]=_0x2803e2;return _0x4da48d;})[_0xbf7c('0x3d')](respondWithFilteredResult(_0x1ebbd1,_0x47d30c))[_0xbf7c('0x41')](handleError(_0x1ebbd1,null));};exports[_0xbf7c('0x42')]=function(_0x23e5ae,_0x2cb8e7){var _0x563a3a={'raw':!![],'where':{'id':_0x23e5ae[_0xbf7c('0x43')]['id']}},_0x541876={};_0x541876[_0xbf7c('0x2e')]=_['keys'](db[_0xbf7c('0x27')][_0xbf7c('0x44')]);_0x541876[_0xbf7c('0x29')]=_[_0xbf7c('0x28')](_0x23e5ae['query']);_0x541876[_0xbf7c('0x45')]=_[_0xbf7c('0x2a')](_0x541876['model'],_0x541876[_0xbf7c('0x29')]);_0x563a3a[_0xbf7c('0x2c')]=_[_0xbf7c('0x2a')](_0x541876['model'],qs[_0xbf7c('0x2b')](_0x23e5ae[_0xbf7c('0x29')][_0xbf7c('0x2b')]));_0x563a3a['attributes']=_0x563a3a[_0xbf7c('0x2c')][_0xbf7c('0x2d')]?_0x563a3a[_0xbf7c('0x2c')]:_0x541876[_0xbf7c('0x2e')];if(_0x23e5ae[_0xbf7c('0x29')][_0xbf7c('0x3e')]){_0x563a3a[_0xbf7c('0x3f')]=[{'all':!![]}];}_0x563a3a=_['merge']({},_0x563a3a,_0x23e5ae[_0xbf7c('0x3b')]);return db[_0xbf7c('0x27')][_0xbf7c('0x46')](_0x563a3a)[_0xbf7c('0x3d')](handleEntityNotFound(_0x2cb8e7,null))['then'](respondWithResult(_0x2cb8e7,null))[_0xbf7c('0x41')](handleError(_0x2cb8e7,null));};exports[_0xbf7c('0x47')]=function(_0xd584e4,_0x946be7){return db[_0xbf7c('0x27')][_0xbf7c('0x47')](_0xd584e4[_0xbf7c('0x48')],{})['then'](respondWithResult(_0x946be7,0xc9))[_0xbf7c('0x41')](handleError(_0x946be7,null));};exports['update']=function(_0x49747a,_0x18bbff){if(_0x49747a[_0xbf7c('0x48')]['id']){delete _0x49747a[_0xbf7c('0x48')]['id'];}return db['VoiceDialReport']['find']({'where':{'id':_0x49747a[_0xbf7c('0x43')]['id']}})[_0xbf7c('0x3d')](handleEntityNotFound(_0x18bbff,null))['then'](saveUpdates(_0x49747a[_0xbf7c('0x48')],null))[_0xbf7c('0x3d')](respondWithResult(_0x18bbff,null))['catch'](handleError(_0x18bbff,null));};exports[_0xbf7c('0x23')]=function(_0x4c4b37,_0x98781d){return db[_0xbf7c('0x27')][_0xbf7c('0x46')]({'where':{'id':_0x4c4b37['params']['id']}})[_0xbf7c('0x3d')](handleEntityNotFound(_0x98781d,null))[_0xbf7c('0x3d')](removeEntity(_0x98781d,null))[_0xbf7c('0x41')](handleError(_0x98781d,null));};exports[_0xbf7c('0x49')]=function(_0x2e5b98,_0x552712){return db['VoiceDialReport']['describe']()[_0xbf7c('0x3d')](respondWithResult(_0x552712,null))[_0xbf7c('0x41')](handleError(_0x552712,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 99bcb72..24728b0 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 _0x9656=['api','bluebird','../../config/environment','exports','VoiceDialReport','report_dial','lodash','../../config/logger'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0x9656,0x15e));var _0x6965=function(_0x3f7421,_0x16b1ef){_0x3f7421=_0x3f7421-0x0;var _0x499687=_0x9656[_0x3f7421];return _0x499687;};'use strict';var _=require(_0x6965('0x0'));var util=require('util');var logger=require(_0x6965('0x1'))(_0x6965('0x2'));var moment=require('moment');var BPromise=require(_0x6965('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6965('0x4'));var attributes=require('./voiceDialReport.attributes');module[_0x6965('0x5')]=function(_0x563cc2,_0xc5e807){return _0x563cc2['define'](_0x6965('0x6'),attributes,{'tableName':_0x6965('0x7'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x3276=['uniqueid','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','report_dial'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x3276,0xc7));var _0x6327=function(_0x46b88e,_0x1ff26d){_0x46b88e=_0x46b88e-0x0;var _0x60eb48=_0x3276[_0x46b88e];return _0x60eb48;};'use strict';var _=require(_0x6327('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6327('0x1'));var moment=require(_0x6327('0x2'));var BPromise=require(_0x6327('0x3'));var rp=require(_0x6327('0x4'));var fs=require('fs');var path=require(_0x6327('0x5'));var rimraf=require(_0x6327('0x6'));var config=require(_0x6327('0x7'));var attributes=require('./voiceDialReport.attributes');module['exports']=function(_0x10b982,_0x37adde){return _0x10b982[_0x6327('0x8')]('VoiceDialReport',attributes,{'tableName':_0x6327('0x9'),'paranoid':![],'indexes':[{'fields':[_0x6327('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index bbca417..af3d54f 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 _0xe009=['rpc','../../config/environment','jayson/promise','client','http','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','then','debug','UpdateVoiceDialReport','update','where','attributes','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x4a2183,_0x53e74d){var _0xc7c01d=function(_0x526d67){while(--_0x526d67){_0x4a2183['push'](_0x4a2183['shift']());}};_0xc7c01d(++_0x53e74d);}(_0xe009,0x122));var _0x9e00=function(_0x418346,_0xe565b2){_0x418346=_0x418346-0x0;var _0x6b9a0c=_0xe009[_0x418346];return _0x6b9a0c;};'use strict';var _=require(_0x9e00('0x0'));var util=require(_0x9e00('0x1'));var moment=require(_0x9e00('0x2'));var BPromise=require(_0x9e00('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9e00('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9e00('0x5'));var logger=require(_0x9e00('0x6'))(_0x9e00('0x7'));var config=require(_0x9e00('0x8'));var jayson=require(_0x9e00('0x9'));var client=jayson[_0x9e00('0xa')][_0x9e00('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x402bb0,_0x22417d,_0x1eb956){return new BPromise(function(_0x5da6a4,_0x292a51){return client['request'](_0x402bb0,_0x1eb956)['then'](function(_0x531c9b){logger[_0x9e00('0xc')](_0x9e00('0xd'),_0x22417d,_0x9e00('0xe'));logger['debug'](_0x9e00('0xf'),_0x22417d,_0x9e00('0xe'),JSON[_0x9e00('0x10')](_0x531c9b));if(_0x531c9b['error']){if(_0x531c9b[_0x9e00('0x11')]['code']===0x1f4){logger['error'](_0x9e00('0xd'),_0x22417d,_0x531c9b['error'][_0x9e00('0x12')]);return _0x292a51(_0x531c9b[_0x9e00('0x11')][_0x9e00('0x12')]);}logger[_0x9e00('0x11')](_0x9e00('0xd'),_0x22417d,_0x531c9b[_0x9e00('0x11')]['message']);return _0x5da6a4(_0x531c9b['error'][_0x9e00('0x12')]);}else{logger['info'](_0x9e00('0xd'),_0x22417d,_0x9e00('0xe'));_0x5da6a4(_0x531c9b[_0x9e00('0x13')][_0x9e00('0x12')]);}})['catch'](function(_0x4f9007){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x22417d,_0x4f9007);_0x292a51(_0x4f9007);});});}exports[_0x9e00('0x14')]=function(_0x5971eb){var _0x2c88e9=this;return new Promise(function(_0x4402b,_0x4d5527){return db[_0x9e00('0x15')][_0x9e00('0x16')](_0x5971eb[_0x9e00('0x17')],{'raw':_0x5971eb[_0x9e00('0x18')]?_0x5971eb[_0x9e00('0x18')][_0x9e00('0x19')]===undefined?!![]:![]:!![]})[_0x9e00('0x1a')](function(_0x306094){logger['info']('CreateVoiceDialReport',_0x5971eb);logger[_0x9e00('0x1b')](_0x9e00('0x14'),_0x5971eb,JSON[_0x9e00('0x10')](_0x306094));_0x4402b(_0x306094);})['catch'](function(_0x217bcd){logger[_0x9e00('0x11')](_0x9e00('0x14'),_0x217bcd['message'],_0x5971eb);_0x4d5527(_0x2c88e9[_0x9e00('0x11')](0x1f4,_0x217bcd[_0x9e00('0x12')]));});});};exports[_0x9e00('0x1c')]=function(_0x781601){var _0x826a6=this;return new Promise(function(_0xe40857,_0x12df8e){return db[_0x9e00('0x15')][_0x9e00('0x1d')](_0x781601[_0x9e00('0x17')],{'raw':_0x781601[_0x9e00('0x18')]?_0x781601[_0x9e00('0x18')][_0x9e00('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x781601[_0x9e00('0x18')]?_0x781601[_0x9e00('0x18')][_0x9e00('0x1e')]||null:null,'attributes':_0x781601[_0x9e00('0x18')]?_0x781601[_0x9e00('0x18')][_0x9e00('0x1f')]||null:null,'limit':_0x781601['options']?_0x781601['options']['limit']||null:null})[_0x9e00('0x1a')](function(_0xd88357){logger[_0x9e00('0xc')](_0x9e00('0x1c'),_0x781601);logger['debug'](_0x9e00('0x1c'),_0x781601,JSON[_0x9e00('0x10')](_0xd88357));_0xe40857(_0xd88357);})[_0x9e00('0x20')](function(_0x54a102){logger[_0x9e00('0x11')](_0x9e00('0x1c'),_0x54a102[_0x9e00('0x12')],_0x781601);_0x12df8e(_0x826a6[_0x9e00('0x11')](0x1f4,_0x54a102[_0x9e00('0x12')]));});});}; \ No newline at end of file +var _0x867f=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','body','options','CreateVoiceDialReport','stringify','VoiceDialReport','update','raw','where','attributes','limit','UpdateVoiceDialReport','lodash'];(function(_0x40d8d7,_0x30dd5e){var _0x3454cc=function(_0x512c1b){while(--_0x512c1b){_0x40d8d7['push'](_0x40d8d7['shift']());}};_0x3454cc(++_0x30dd5e);}(_0x867f,0xe6));var _0xf867=function(_0x555d87,_0x207a9c){_0x555d87=_0x555d87-0x0;var _0x47a78e=_0x867f[_0x555d87];return _0x47a78e;};'use strict';var _=require(_0xf867('0x0'));var util=require(_0xf867('0x1'));var moment=require(_0xf867('0x2'));var BPromise=require(_0xf867('0x3'));var rs=require(_0xf867('0x4'));var fs=require('fs');var Redis=require(_0xf867('0x5'));var db=require(_0xf867('0x6'))['db'];var utils=require(_0xf867('0x7'));var logger=require(_0xf867('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf867('0x9'));var client=jayson[_0xf867('0xa')][_0xf867('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2841d1,_0x3fe5d1,_0x5c35f9){return new BPromise(function(_0x583f87,_0x26cfba){return client['request'](_0x2841d1,_0x5c35f9)[_0xf867('0xc')](function(_0x2b1c12){logger[_0xf867('0xd')](_0xf867('0xe'),_0x3fe5d1,_0xf867('0xf'));logger[_0xf867('0x10')](_0xf867('0x11'),_0x3fe5d1,_0xf867('0xf'),JSON['stringify'](_0x2b1c12));if(_0x2b1c12[_0xf867('0x12')]){if(_0x2b1c12['error']['code']===0x1f4){logger[_0xf867('0x12')](_0xf867('0xe'),_0x3fe5d1,_0x2b1c12[_0xf867('0x12')]['message']);return _0x26cfba(_0x2b1c12['error'][_0xf867('0x13')]);}logger['error'](_0xf867('0xe'),_0x3fe5d1,_0x2b1c12['error']['message']);return _0x583f87(_0x2b1c12[_0xf867('0x12')][_0xf867('0x13')]);}else{logger[_0xf867('0xd')](_0xf867('0xe'),_0x3fe5d1,_0xf867('0xf'));_0x583f87(_0x2b1c12[_0xf867('0x14')][_0xf867('0x13')]);}})[_0xf867('0x15')](function(_0x33c10b){logger['error'](_0xf867('0xe'),_0x3fe5d1,_0x33c10b);_0x26cfba(_0x33c10b);});});}exports['CreateVoiceDialReport']=function(_0x39f9e8){var _0x47dfa7=this;return new Promise(function(_0x51bdb3,_0x1a5592){return db['VoiceDialReport']['create'](_0x39f9e8[_0xf867('0x16')],{'raw':_0x39f9e8[_0xf867('0x17')]?_0x39f9e8['options']['raw']===undefined?!![]:![]:!![]})[_0xf867('0xc')](function(_0x23e7dd){logger[_0xf867('0xd')](_0xf867('0x18'),_0x39f9e8);logger[_0xf867('0x10')](_0xf867('0x18'),_0x39f9e8,JSON[_0xf867('0x19')](_0x23e7dd));_0x51bdb3(_0x23e7dd);})[_0xf867('0x15')](function(_0x586a25){logger['error'](_0xf867('0x18'),_0x586a25['message'],_0x39f9e8);_0x1a5592(_0x47dfa7[_0xf867('0x12')](0x1f4,_0x586a25[_0xf867('0x13')]));});});};exports['UpdateVoiceDialReport']=function(_0x419b6f){var _0x169f15=this;return new Promise(function(_0x53dc5a,_0x231076){return db[_0xf867('0x1a')][_0xf867('0x1b')](_0x419b6f[_0xf867('0x16')],{'raw':_0x419b6f[_0xf867('0x17')]?_0x419b6f[_0xf867('0x17')][_0xf867('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x419b6f[_0xf867('0x17')]?_0x419b6f[_0xf867('0x17')][_0xf867('0x1d')]||null:null,'attributes':_0x419b6f[_0xf867('0x17')]?_0x419b6f[_0xf867('0x17')][_0xf867('0x1e')]||null:null,'limit':_0x419b6f[_0xf867('0x17')]?_0x419b6f[_0xf867('0x17')][_0xf867('0x1f')]||null:null})['then'](function(_0xb6d069){logger[_0xf867('0xd')](_0xf867('0x20'),_0x419b6f);logger[_0xf867('0x10')](_0xf867('0x20'),_0x419b6f,JSON[_0xf867('0x19')](_0xb6d069));_0x53dc5a(_0xb6d069);})[_0xf867('0x15')](function(_0x517b9c){logger[_0xf867('0x12')](_0xf867('0x20'),_0x517b9c[_0xf867('0x13')],_0x419b6f);_0x231076(_0x169f15[_0xf867('0x12')](0x1f4,_0x517b9c[_0xf867('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 1483456..3ffb1f1 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 _0x0137=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','/:id','show','post','/:id/applications','addApplications','update','delete','exports','multer','util','path'];(function(_0x1976c5,_0x1a8947){var _0xe37be7=function(_0x4d4eda){while(--_0x4d4eda){_0x1976c5['push'](_0x1976c5['shift']());}};_0xe37be7(++_0x1a8947);}(_0x0137,0x1d8));var _0x7013=function(_0x2fc6cf,_0x2bb133){_0x2fc6cf=_0x2fc6cf-0x0;var _0xf2ade3=_0x0137[_0x2fc6cf];return _0xf2ade3;};'use strict';var multer=require(_0x7013('0x0'));var util=require(_0x7013('0x1'));var path=require(_0x7013('0x2'));var timeout=require(_0x7013('0x3'));var express=require(_0x7013('0x4'));var router=express['Router']();var auth=require(_0x7013('0x5'));var interaction=require(_0x7013('0x6'));var config=require(_0x7013('0x7'));var controller=require(_0x7013('0x8'));router[_0x7013('0x9')]('/',auth[_0x7013('0xa')](),controller['index']);router[_0x7013('0x9')](_0x7013('0xb'),auth['isAuthenticated'](),controller[_0x7013('0xc')]);router[_0x7013('0xd')]('/',auth[_0x7013('0xa')](),controller['create']);router[_0x7013('0xd')](_0x7013('0xe'),auth[_0x7013('0xa')](),controller[_0x7013('0xf')]);router['put'](_0x7013('0xb'),auth[_0x7013('0xa')](),controller[_0x7013('0x10')]);router[_0x7013('0x11')](_0x7013('0xb'),auth[_0x7013('0xa')](),controller['destroy']);module[_0x7013('0x12')]=router; \ No newline at end of file +var _0x1c9a=['multer','path','express','Router','../../components/auth/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','show','post','create','/:id/applications','put','/:id','update','delete','destroy','exports'];(function(_0x56085e,_0x5c69e9){var _0x4de130=function(_0x120b34){while(--_0x120b34){_0x56085e['push'](_0x56085e['shift']());}};_0x4de130(++_0x5c69e9);}(_0x1c9a,0x98));var _0xa1c9=function(_0x24fb2a,_0x55c5ce){_0x24fb2a=_0x24fb2a-0x0;var _0x49937f=_0x1c9a[_0x24fb2a];return _0x49937f;};'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('0xa')]('/',auth['isAuthenticated'](),controller[_0xa1c9('0xb')]);router[_0xa1c9('0xa')](_0xa1c9('0xc'),auth[_0xa1c9('0x8')](),controller['addApplications']);router[_0xa1c9('0xd')](_0xa1c9('0xe'),auth[_0xa1c9('0x8')](),controller[_0xa1c9('0xf')]);router[_0xa1c9('0x10')](_0xa1c9('0xe'),auth[_0xa1c9('0x8')](),controller[_0xa1c9('0x11')]);module[_0xa1c9('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 56583a1..325cd44 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 _0x3c81=['INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','exports','compositeIndex','STRING','NoOp','ENUM','inbound','outbound','internal','outbound-fax','any','*,*,*,*'];(function(_0x1d895d,_0x3e5c93){var _0x2dae23=function(_0x443cd0){while(--_0x443cd0){_0x1d895d['push'](_0x1d895d['shift']());}};_0x2dae23(++_0x3e5c93);}(_0x3c81,0x102));var _0x13c8=function(_0x305ed9,_0x586621){_0x305ed9=_0x305ed9-0x0;var _0x32b57f=_0x3c81[_0x305ed9];return _0x32b57f;};'use strict';var Sequelize=require(_0x13c8('0x0'));module[_0x13c8('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x13c8('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x13c8('0x3')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x13c8('0x3')],'allowNull':![],'defaultValue':_0x13c8('0x4')},'appdata':{'type':Sequelize[_0x13c8('0x3')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x13c8('0x5')](_0x13c8('0x6'),_0x13c8('0x7'),_0x13c8('0x8'),'inbound-fax',_0x13c8('0x9'),'system',_0x13c8('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0x13c8('0x3')]},'interval':{'type':Sequelize[_0x13c8('0x3')],'allowNull':![],'defaultValue':_0x13c8('0xb')},'IntervalId':{'type':Sequelize[_0x13c8('0xc')]},'isApp':{'type':Sequelize[_0x13c8('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x13c8('0x3')],'defaultValue':null},'callerID':{'type':Sequelize[_0x13c8('0x3')],'allowNull':!![]},'record':{'type':Sequelize[_0x13c8('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x13c8('0xc')]},'recordingFormat':{'type':Sequelize[_0x13c8('0x3')],'defaultValue':_0x13c8('0xe')},'answer':{'type':Sequelize[_0x13c8('0xd')],'defaultValue':!![]},'name':{'type':Sequelize[_0x13c8('0xf')],'get':function(_0x5ab91d){return this[_0x13c8('0x10')](_0x13c8('0x11'));}}}; \ No newline at end of file +var _0x0565=['*,*,*,*','INTEGER','BOOLEAN','exten','sequelize','exports','STRING','compositeIndex','ENUM','inbound','outbound','outbound-fax','system','any'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0x0565,0xf2));var _0x5056=function(_0x39d544,_0x35c14f){_0x39d544=_0x39d544-0x0;var _0x5a5ff2=_0x0565[_0x39d544];return _0x5a5ff2;};'use strict';var Sequelize=require(_0x5056('0x0'));module[_0x5056('0x1')]={'context':{'type':Sequelize[_0x5056('0x2')],'allowNull':![],'unique':_0x5056('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x5056('0x2')],'allowNull':![],'unique':_0x5056('0x3')},'priority':{'type':Sequelize[_0x5056('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x5056('0x3')},'tag':{'type':Sequelize[_0x5056('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x5056('0x2')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0x5056('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x5056('0x4')](_0x5056('0x5'),_0x5056('0x6'),'internal','inbound-fax',_0x5056('0x7'),_0x5056('0x8'),_0x5056('0x9')),'allowNull':![]},'description':{'type':Sequelize[_0x5056('0x2')]},'interval':{'type':Sequelize[_0x5056('0x2')],'allowNull':![],'defaultValue':_0x5056('0xa')},'IntervalId':{'type':Sequelize[_0x5056('0xb')]},'isApp':{'type':Sequelize[_0x5056('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0x5056('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x5056('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x5056('0xb')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x5056('0xc')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x548bcf){return this['getDataValue'](_0x5056('0xd'));}}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 8f99c27..2578f35 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 _0xacc6=['userProfileId','context','description','recordingFormat','cutdigits','mandatoryDisposition','findOne','sequelize','transaction','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','destroy','then','get','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','value','includes','type','find','name','UserProfileResource','error','stack','send','index','VoiceExtension','rawAttributes','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','map','key','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','catch','show','params','create','startsWith','exten','body','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','InboundRoutes'];(function(_0x101a17,_0x5d047a){var _0x3b76ee=function(_0x89be1b){while(--_0x89be1b){_0x101a17['push'](_0x101a17['shift']());}};_0x3b76ee(++_0x5d047a);}(_0xacc6,0x150));var _0x6acc=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0xacc6[_0x257642];return _0x3d813b;};'use strict';var pdf=require(_0x6acc('0x0'));var emlformat=require(_0x6acc('0x1'));var rimraf=require(_0x6acc('0x2'));var zipdir=require(_0x6acc('0x3'));var jsonpatch=require(_0x6acc('0x4'));var rp=require('request-promise');var moment=require(_0x6acc('0x5'));var BPromise=require(_0x6acc('0x6'));var Mustache=require(_0x6acc('0x7'));var util=require('util');var path=require(_0x6acc('0x8'));var sox=require('sox');var csv=require(_0x6acc('0x9'));var ejs=require(_0x6acc('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6acc('0xb'));var crypto=require('crypto');var jsforce=require(_0x6acc('0xc'));var deskjs=require(_0x6acc('0xd'));var toCsv=require(_0x6acc('0x9'));var querystring=require(_0x6acc('0xe'));var Papa=require('papaparse');var Redis=require(_0x6acc('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x6acc('0x10'));var hardwareService=require(_0x6acc('0x11'));var logger=require(_0x6acc('0x12'))(_0x6acc('0x13'));var utils=require(_0x6acc('0x14'));var config=require(_0x6acc('0x15'));var db=require('../../mysqldb')['db'];config[_0x6acc('0x16')]=_[_0x6acc('0x17')](config[_0x6acc('0x16')],{'host':_0x6acc('0x18'),'port':0x18eb});var socket=require(_0x6acc('0x19'))(new Redis(config['redis']));require('./voiceExtension.socket')[_0x6acc('0x1a')](socket);function respondWithStatusCode(_0x497356,_0x14a543){_0x14a543=_0x14a543||0xcc;return function(_0x230318){if(_0x230318){return _0x497356[_0x6acc('0x1b')](_0x14a543);}return _0x497356[_0x6acc('0x1c')](_0x14a543)[_0x6acc('0x1d')]();};}function respondWithResult(_0x4034fb,_0xf24527){_0xf24527=_0xf24527||0xc8;return function(_0xc07208){if(_0xc07208){return _0x4034fb[_0x6acc('0x1c')](_0xf24527)[_0x6acc('0x1e')](_0xc07208);}};}function respondWithFilteredResult(_0x31c4c2,_0x410afb){return function(_0x24f513){if(_0x24f513){var _0x4c7f9f=_0x24f513[_0x6acc('0x1f')],_0x3818d8=_0x410afb[_0x6acc('0x20')],_0x17e367=_0x410afb[_0x6acc('0x20')]+_0x410afb[_0x6acc('0x21')],_0x4ee616;if(_0x17e367>=_0x4c7f9f){_0x17e367=_0x4c7f9f;_0x4ee616=0xc8;}else{_0x4ee616=0xce;}_0x31c4c2['status'](_0x4ee616);return _0x31c4c2[_0x6acc('0x22')]('Content-Range',_0x3818d8+'-'+_0x17e367+'/'+_0x4c7f9f)['json'](_0x24f513);}return null;};}function patchUpdates(_0x4af9e){return function(_0x5d5382){try{jsonpatch[_0x6acc('0x23')](_0x5d5382,_0x4af9e,!![]);}catch(_0x3edf4a){return BPromise[_0x6acc('0x24')](_0x3edf4a);}return _0x5d5382[_0x6acc('0x25')]();};}function saveUpdates(_0x245536,_0x5ecb25){return function(_0x3e4a71){if(_0x3e4a71){return _0x3e4a71[_0x6acc('0x26')](_0x245536)['then'](function(_0x334416){return _0x334416;});}return null;};}function removeEntity(_0x5ba0b6,_0x22abf1){return function(_0x1db7bd){if(_0x1db7bd){return _0x1db7bd[_0x6acc('0x27')]()[_0x6acc('0x28')](function(){var _0x5277b6=_0x1db7bd[_0x6acc('0x29')]({'plain':!![]});var _0xa4d97c=[{'name':'InboundRoutes','value':_0x6acc('0x2a'),'ignore':![]},{'name':_0x6acc('0x2b'),'value':_0x6acc('0x2c'),'ignore':![]},{'name':_0x6acc('0x2d'),'value':_0x6acc('0x2e'),'ignore':![]}];var _0x472220=_(_0xa4d97c)[_0x6acc('0x2f')](_0x6acc('0x30'))['map'](_0x6acc('0x31'))[_0x6acc('0x31')]();if(_[_0x6acc('0x32')](_0x472220,_0x5277b6[_0x6acc('0x33')])){return;}var _0x1bcfad=_[_0x6acc('0x34')](_0xa4d97c,[_0x6acc('0x31'),_0x5277b6[_0x6acc('0x33')]])[_0x6acc('0x35')];return db[_0x6acc('0x36')]['destroy']({'where':{'type':_0x1bcfad,'resourceId':_0x5277b6['id']}})['then'](function(){return _0x1db7bd;});})['then'](function(){_0x5ba0b6['status'](0xcc)[_0x6acc('0x1d')]();});}};}function handleEntityNotFound(_0x23a581,_0x3b8ef2){return function(_0x3a9217){if(!_0x3a9217){_0x23a581[_0x6acc('0x1b')](0x194);}return _0x3a9217;};}function handleError(_0x2c6c4e,_0x5e4feb){_0x5e4feb=_0x5e4feb||0x1f4;return function(_0x5942c3){logger[_0x6acc('0x37')](_0x5942c3[_0x6acc('0x38')]);if(_0x5942c3[_0x6acc('0x35')]){delete _0x5942c3[_0x6acc('0x35')];}_0x2c6c4e['status'](_0x5e4feb)[_0x6acc('0x39')](_0x5942c3);};}exports[_0x6acc('0x3a')]=function(_0x59a327,_0x46e7f5){var _0x3ce52f={},_0x33208e={},_0x4f1761={'count':0x0,'rows':[]};var _0x518cff=db[_0x6acc('0x3b')][_0x6acc('0x3c')];_0x33208e['model']=_['keys'](_0x518cff);_0x33208e[_0x6acc('0x3d')]=_[_0x6acc('0x3e')](_0x59a327[_0x6acc('0x3d')]);_0x33208e['filters']=_[_0x6acc('0x3f')](_0x33208e[_0x6acc('0x40')],_0x33208e[_0x6acc('0x3d')]);_0x3ce52f[_0x6acc('0x41')]=_[_0x6acc('0x3f')](_0x33208e['model'],qs[_0x6acc('0x42')](_0x59a327['query'][_0x6acc('0x42')]));_0x3ce52f[_0x6acc('0x41')]=_0x3ce52f['attributes'][_0x6acc('0x43')]?_0x3ce52f['attributes']:_0x33208e['model'];if(!_0x59a327[_0x6acc('0x3d')][_0x6acc('0x44')](_0x6acc('0x45'))){_0x3ce52f['limit']=qs[_0x6acc('0x21')](_0x59a327['query'][_0x6acc('0x21')]);_0x3ce52f['offset']=qs[_0x6acc('0x20')](_0x59a327[_0x6acc('0x3d')]['offset']);}_0x3ce52f[_0x6acc('0x46')]=qs[_0x6acc('0x47')](_0x59a327[_0x6acc('0x3d')][_0x6acc('0x47')]);_0x3ce52f[_0x6acc('0x48')]=qs[_0x6acc('0x49')](_[_0x6acc('0x4a')](_0x59a327['query'],_0x33208e['filters']));if(_0x59a327[_0x6acc('0x3d')][_0x6acc('0x2f')]){_0x3ce52f[_0x6acc('0x48')]=_['merge'](_0x3ce52f[_0x6acc('0x48')],{'$or':_[_0x6acc('0x4b')](_0x518cff,function(_0x24a8f0){if(_0x24a8f0[_0x6acc('0x33')][_0x6acc('0x4c')]!==_0x6acc('0x4d')){var _0x2cceb0={};_0x2cceb0[_0x24a8f0[_0x6acc('0x4e')]]={'$like':'%'+_0x59a327[_0x6acc('0x3d')][_0x6acc('0x2f')]+'%'};return _0x2cceb0;}})});}_0x3ce52f=_[_0x6acc('0x4f')]({},_0x3ce52f,_0x59a327[_0x6acc('0x50')]);var _0x5c938d={'where':_0x3ce52f['where']};return db['VoiceExtension'][_0x6acc('0x1f')](_0x5c938d)['then'](function(_0x48f3ef){_0x4f1761[_0x6acc('0x1f')]=_0x48f3ef;if(_0x59a327[_0x6acc('0x3d')][_0x6acc('0x51')]){_0x3ce52f[_0x6acc('0x52')]=[{'all':!![]}];}return db[_0x6acc('0x3b')][_0x6acc('0x53')](_0x3ce52f);})[_0x6acc('0x28')](function(_0x2c0be8){_0x4f1761[_0x6acc('0x54')]=_0x2c0be8;return _0x4f1761;})[_0x6acc('0x28')](respondWithFilteredResult(_0x46e7f5,_0x3ce52f))[_0x6acc('0x55')](handleError(_0x46e7f5,null));};exports[_0x6acc('0x56')]=function(_0x1ff2a6,_0x578e7c){var _0x4591c4={'raw':![],'where':{'id':_0x1ff2a6['params']['id']}},_0x3e4afa={};_0x3e4afa[_0x6acc('0x40')]=_['keys'](db[_0x6acc('0x3b')][_0x6acc('0x3c')]);_0x3e4afa['query']=_[_0x6acc('0x3e')](_0x1ff2a6[_0x6acc('0x3d')]);_0x3e4afa[_0x6acc('0x49')]=_[_0x6acc('0x3f')](_0x3e4afa[_0x6acc('0x40')],_0x3e4afa['query']);_0x4591c4[_0x6acc('0x41')]=_[_0x6acc('0x3f')](_0x3e4afa[_0x6acc('0x40')],qs[_0x6acc('0x42')](_0x1ff2a6[_0x6acc('0x3d')][_0x6acc('0x42')]));_0x4591c4[_0x6acc('0x41')]=_0x4591c4[_0x6acc('0x41')][_0x6acc('0x43')]?_0x4591c4[_0x6acc('0x41')]:_0x3e4afa[_0x6acc('0x40')];if(_0x1ff2a6[_0x6acc('0x3d')][_0x6acc('0x51')]){_0x4591c4[_0x6acc('0x52')]=[{'all':!![]}];}_0x4591c4=_[_0x6acc('0x4f')]({},_0x4591c4,_0x1ff2a6[_0x6acc('0x50')]);return db[_0x6acc('0x3b')]['find'](_0x4591c4)['then'](handleEntityNotFound(_0x578e7c,null))['then'](respondWithResult(_0x578e7c,null))[_0x6acc('0x55')](handleError(_0x578e7c,null));};exports[_0x6acc('0x27')]=function(_0x5d63ee,_0x13e10e){return db[_0x6acc('0x3b')][_0x6acc('0x34')]({'where':{'id':_0x5d63ee[_0x6acc('0x57')]['id']}})['then'](handleEntityNotFound(_0x13e10e,null))[_0x6acc('0x28')](removeEntity(_0x13e10e,null))[_0x6acc('0x55')](handleError(_0x13e10e,null));};exports[_0x6acc('0x58')]=function(_0x1a1e1f,_0x459b99){if(_0x1a1e1f['body'][_0x6acc('0x33')]===_0x6acc('0x2c')&&!_[_0x6acc('0x59')](_0x1a1e1f['body'][_0x6acc('0x5a')],'_')){_0x1a1e1f[_0x6acc('0x5b')][_0x6acc('0x5a')]='_'[_0x6acc('0x5c')](_0x1a1e1f['body'][_0x6acc('0x5a')]);}return db[_0x6acc('0x3b')]['create'](_0x1a1e1f[_0x6acc('0x5b')],{'raw':![]})['then'](function(_0x56f551){var _0x56c1f8=_0x1a1e1f[_0x6acc('0x5d')][_0x6acc('0x29')]({'plain':!![]});if(!_0x56c1f8)throw new Error(_0x6acc('0x5e'));if(_0x56c1f8['role']===_0x6acc('0x5d')){var _0x38be46=_0x56f551['get']({'plain':!![]});var _0xae3072=[{'name':_0x6acc('0x5f'),'value':_0x6acc('0x2a')},{'name':_0x6acc('0x2b'),'value':_0x6acc('0x2c')},{'name':_0x6acc('0x2d'),'value':_0x6acc('0x2e')}];var _0x5818fa=_['find'](_0xae3072,['value',_0x38be46[_0x6acc('0x33')]])[_0x6acc('0x35')];return db['UserProfileSection'][_0x6acc('0x34')]({'where':{'name':_0x5818fa,'userProfileId':_0x56c1f8[_0x6acc('0x60')]},'raw':!![]})['then'](function(_0x3b8dc8){if(_0x3b8dc8&&_0x3b8dc8['autoAssociation']===0x0){return db[_0x6acc('0x36')][_0x6acc('0x58')]({'name':_0x38be46[_0x6acc('0x35')],'resourceId':_0x38be46['id'],'type':_0x3b8dc8[_0x6acc('0x35')],'sectionId':_0x3b8dc8['id']},{})['then'](function(){return _0x56f551;});}else{return _0x56f551;}})['catch'](function(_0x52e441){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x52e441);throw _0x52e441;});}return _0x56f551;})[_0x6acc('0x28')](respondWithResult(_0x459b99,0xc9))[_0x6acc('0x55')](handleError(_0x459b99,null));};exports[_0x6acc('0x26')]=function(_0x319d12,_0x53c90b){if(_0x319d12['body']['id']){delete _0x319d12[_0x6acc('0x5b')]['id'];}return db['VoiceExtension'][_0x6acc('0x34')]({'where':{'id':_0x319d12['params']['id']}})[_0x6acc('0x28')](handleEntityNotFound(_0x53c90b,null))[_0x6acc('0x28')](function(_0x7e28ff){if(_0x7e28ff){return db[_0x6acc('0x3b')][_0x6acc('0x26')](_[_0x6acc('0x4a')](_0x319d12[_0x6acc('0x5b')],[_0x6acc('0x5a'),_0x6acc('0x61'),_0x6acc('0x62'),_0x6acc('0x63'),_0x6acc('0x64'),_0x6acc('0x65')]),{'where':{'context':_0x7e28ff[_0x6acc('0x61')],'exten':_0x7e28ff[_0x6acc('0x5a')]},'individualHooks':!![]})[_0x6acc('0x28')](function(_0x241318){return _0x241318;});}return null;})[_0x6acc('0x28')](respondWithStatusCode(_0x53c90b,null))[_0x6acc('0x55')](handleError(_0x53c90b,null));};exports['addApplications']=function(_0x320580,_0x47aa7a,_0x34dbe2){return db['VoiceExtension'][_0x6acc('0x66')]({'where':{'id':_0x320580['params']['id']}})[_0x6acc('0x28')](handleEntityNotFound(_0x47aa7a,null))['then'](function(_0x54da14){if(_0x54da14){return db[_0x6acc('0x67')][_0x6acc('0x68')](function(_0x5a18b0){return db[_0x6acc('0x3b')][_0x6acc('0x27')]({'where':{'VoiceExtensionId':_0x320580[_0x6acc('0x57')]['id']},'transaction':_0x5a18b0})['then'](function(_0x42097a){var _0x6f3ffd=_[_0x6acc('0x4b')](_0x320580[_0x6acc('0x5b')],function(_0x5b3bd5){_0x5b3bd5['VoiceExtensionId']=_0x320580[_0x6acc('0x57')]['id'];return _0x5b3bd5;});return db[_0x6acc('0x3b')][_0x6acc('0x69')](_0x6f3ffd,{'transaction':_0x5a18b0});});})['then'](function(){return db['VoiceExtension'][_0x6acc('0x6a')]({'where':{'isApp':!![],'VoiceExtensionId':_0x320580[_0x6acc('0x57')]['id']},'order':_0x6acc('0x6b')});});}})['then'](respondWithResult(_0x47aa7a,null))['catch'](handleError(_0x47aa7a,null));}; \ No newline at end of file +var _0x9a4d=['InboundRoutes','inbound','OutboundRoutes','InternalRoutes','internal','filter','ignore','map','value','includes','type','find','UserProfileResource','end','stack','name','send','VoiceExtension','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','nolimit','offset','where','merge','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','show','params','catch','create','body','outbound','exten','concat','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','pick','context','description','recordingFormat','cutdigits','mandatoryDisposition','addApplications','findOne','sequelize','transaction','VoiceExtensionId','html-pdf','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','json','limit','set','Content-Range','apply','update','then','destroy','get'];(function(_0x29ca76,_0x2ac39e){var _0x56c496=function(_0x5ccabc){while(--_0x5ccabc){_0x29ca76['push'](_0x29ca76['shift']());}};_0x56c496(++_0x2ac39e);}(_0x9a4d,0xa8));var _0xd9a4=function(_0xea3feb,_0x29a19d){_0xea3feb=_0xea3feb-0x0;var _0x4871c2=_0x9a4d[_0xea3feb];return _0x4871c2;};'use strict';var pdf=require(_0xd9a4('0x0'));var emlformat=require(_0xd9a4('0x1'));var rimraf=require(_0xd9a4('0x2'));var zipdir=require(_0xd9a4('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd9a4('0x4'));var Mustache=require(_0xd9a4('0x5'));var util=require(_0xd9a4('0x6'));var path=require(_0xd9a4('0x7'));var sox=require(_0xd9a4('0x8'));var csv=require('to-csv');var ejs=require(_0xd9a4('0x9'));var fs=require('fs');var _=require(_0xd9a4('0xa'));var squel=require(_0xd9a4('0xb'));var crypto=require(_0xd9a4('0xc'));var jsforce=require(_0xd9a4('0xd'));var deskjs=require(_0xd9a4('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd9a4('0xf'));var Papa=require(_0xd9a4('0x10'));var Redis=require(_0xd9a4('0x11'));var authService=require(_0xd9a4('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xd9a4('0x13'));var logger=require(_0xd9a4('0x14'))(_0xd9a4('0x15'));var utils=require(_0xd9a4('0x16'));var config=require(_0xd9a4('0x17'));var db=require('../../mysqldb')['db'];config[_0xd9a4('0x18')]=_[_0xd9a4('0x19')](config[_0xd9a4('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xd9a4('0x1a'))(new Redis(config[_0xd9a4('0x18')]));require(_0xd9a4('0x1b'))[_0xd9a4('0x1c')](socket);function respondWithStatusCode(_0x2a161a,_0xbf8313){_0xbf8313=_0xbf8313||0xcc;return function(_0x261bd0){if(_0x261bd0){return _0x2a161a[_0xd9a4('0x1d')](_0xbf8313);}return _0x2a161a[_0xd9a4('0x1e')](_0xbf8313)['end']();};}function respondWithResult(_0x168428,_0x3c174e){_0x3c174e=_0x3c174e||0xc8;return function(_0x5ce69c){if(_0x5ce69c){return _0x168428[_0xd9a4('0x1e')](_0x3c174e)[_0xd9a4('0x1f')](_0x5ce69c);}};}function respondWithFilteredResult(_0x303cab,_0x326ce2){return function(_0x150eef){if(_0x150eef){var _0x5be5b4=_0x150eef['count'],_0x2ff29c=_0x326ce2['offset'],_0xa096f=_0x326ce2['offset']+_0x326ce2[_0xd9a4('0x20')],_0x40b43e;if(_0xa096f>=_0x5be5b4){_0xa096f=_0x5be5b4;_0x40b43e=0xc8;}else{_0x40b43e=0xce;}_0x303cab[_0xd9a4('0x1e')](_0x40b43e);return _0x303cab[_0xd9a4('0x21')](_0xd9a4('0x22'),_0x2ff29c+'-'+_0xa096f+'/'+_0x5be5b4)[_0xd9a4('0x1f')](_0x150eef);}return null;};}function patchUpdates(_0x25ef52){return function(_0x1d68b7){try{jsonpatch[_0xd9a4('0x23')](_0x1d68b7,_0x25ef52,!![]);}catch(_0x4a158a){return BPromise['reject'](_0x4a158a);}return _0x1d68b7['save']();};}function saveUpdates(_0x91ad93,_0x2d0dd3){return function(_0x552d8b){if(_0x552d8b){return _0x552d8b[_0xd9a4('0x24')](_0x91ad93)[_0xd9a4('0x25')](function(_0x832415){return _0x832415;});}return null;};}function removeEntity(_0x1a3f77,_0x458d77){return function(_0x4d013e){if(_0x4d013e){return _0x4d013e[_0xd9a4('0x26')]()['then'](function(){var _0x3a76c6=_0x4d013e[_0xd9a4('0x27')]({'plain':!![]});var _0x107e89=[{'name':_0xd9a4('0x28'),'value':_0xd9a4('0x29'),'ignore':![]},{'name':_0xd9a4('0x2a'),'value':'outbound','ignore':![]},{'name':_0xd9a4('0x2b'),'value':_0xd9a4('0x2c'),'ignore':![]}];var _0x20a293=_(_0x107e89)[_0xd9a4('0x2d')](_0xd9a4('0x2e'))[_0xd9a4('0x2f')](_0xd9a4('0x30'))[_0xd9a4('0x30')]();if(_[_0xd9a4('0x31')](_0x20a293,_0x3a76c6[_0xd9a4('0x32')])){return;}var _0x5a2dcc=_[_0xd9a4('0x33')](_0x107e89,[_0xd9a4('0x30'),_0x3a76c6[_0xd9a4('0x32')]])['name'];return db[_0xd9a4('0x34')]['destroy']({'where':{'type':_0x5a2dcc,'resourceId':_0x3a76c6['id']}})[_0xd9a4('0x25')](function(){return _0x4d013e;});})[_0xd9a4('0x25')](function(){_0x1a3f77['status'](0xcc)[_0xd9a4('0x35')]();});}};}function handleEntityNotFound(_0x57b7e5,_0xcb06c8){return function(_0x33c97d){if(!_0x33c97d){_0x57b7e5[_0xd9a4('0x1d')](0x194);}return _0x33c97d;};}function handleError(_0x3fbf25,_0x15f947){_0x15f947=_0x15f947||0x1f4;return function(_0x4cc9ba){logger['error'](_0x4cc9ba[_0xd9a4('0x36')]);if(_0x4cc9ba['name']){delete _0x4cc9ba[_0xd9a4('0x37')];}_0x3fbf25[_0xd9a4('0x1e')](_0x15f947)[_0xd9a4('0x38')](_0x4cc9ba);};}exports['index']=function(_0x524415,_0x471b95){var _0x279d43={},_0x219680={},_0x16dce8={'count':0x0,'rows':[]};var _0x318b0a=db[_0xd9a4('0x39')][_0xd9a4('0x3a')];_0x219680['model']=_[_0xd9a4('0x3b')](_0x318b0a);_0x219680[_0xd9a4('0x3c')]=_[_0xd9a4('0x3b')](_0x524415[_0xd9a4('0x3c')]);_0x219680[_0xd9a4('0x3d')]=_[_0xd9a4('0x3e')](_0x219680[_0xd9a4('0x3f')],_0x219680['query']);_0x279d43[_0xd9a4('0x40')]=_[_0xd9a4('0x3e')](_0x219680[_0xd9a4('0x3f')],qs['fields'](_0x524415['query'][_0xd9a4('0x41')]));_0x279d43[_0xd9a4('0x40')]=_0x279d43['attributes'][_0xd9a4('0x42')]?_0x279d43[_0xd9a4('0x40')]:_0x219680[_0xd9a4('0x3f')];if(!_0x524415[_0xd9a4('0x3c')]['hasOwnProperty'](_0xd9a4('0x43'))){_0x279d43[_0xd9a4('0x20')]=qs['limit'](_0x524415[_0xd9a4('0x3c')]['limit']);_0x279d43['offset']=qs[_0xd9a4('0x44')](_0x524415[_0xd9a4('0x3c')][_0xd9a4('0x44')]);}_0x279d43['order']=qs['sort'](_0x524415[_0xd9a4('0x3c')]['sort']);_0x279d43[_0xd9a4('0x45')]=qs['filters'](_['pick'](_0x524415[_0xd9a4('0x3c')],_0x219680[_0xd9a4('0x3d')]));if(_0x524415[_0xd9a4('0x3c')]['filter']){_0x279d43[_0xd9a4('0x45')]=_[_0xd9a4('0x46')](_0x279d43[_0xd9a4('0x45')],{'$or':_[_0xd9a4('0x2f')](_0x318b0a,function(_0x4de6f8){if(_0x4de6f8[_0xd9a4('0x32')][_0xd9a4('0x47')]!==_0xd9a4('0x48')){var _0x57dd31={};_0x57dd31[_0x4de6f8[_0xd9a4('0x49')]]={'$like':'%'+_0x524415[_0xd9a4('0x3c')]['filter']+'%'};return _0x57dd31;}})});}_0x279d43=_[_0xd9a4('0x46')]({},_0x279d43,_0x524415[_0xd9a4('0x4a')]);var _0x4b71c9={'where':_0x279d43[_0xd9a4('0x45')]};return db[_0xd9a4('0x39')][_0xd9a4('0x4b')](_0x4b71c9)[_0xd9a4('0x25')](function(_0x2ecd3c){_0x16dce8[_0xd9a4('0x4b')]=_0x2ecd3c;if(_0x524415[_0xd9a4('0x3c')][_0xd9a4('0x4c')]){_0x279d43[_0xd9a4('0x4d')]=[{'all':!![]}];}return db[_0xd9a4('0x39')][_0xd9a4('0x4e')](_0x279d43);})[_0xd9a4('0x25')](function(_0x82df8b){_0x16dce8[_0xd9a4('0x4f')]=_0x82df8b;return _0x16dce8;})[_0xd9a4('0x25')](respondWithFilteredResult(_0x471b95,_0x279d43))['catch'](handleError(_0x471b95,null));};exports[_0xd9a4('0x50')]=function(_0x193789,_0x419c64){var _0x1754e1={'raw':![],'where':{'id':_0x193789[_0xd9a4('0x51')]['id']}},_0x41b547={};_0x41b547[_0xd9a4('0x3f')]=_[_0xd9a4('0x3b')](db[_0xd9a4('0x39')][_0xd9a4('0x3a')]);_0x41b547[_0xd9a4('0x3c')]=_['keys'](_0x193789[_0xd9a4('0x3c')]);_0x41b547[_0xd9a4('0x3d')]=_[_0xd9a4('0x3e')](_0x41b547[_0xd9a4('0x3f')],_0x41b547[_0xd9a4('0x3c')]);_0x1754e1['attributes']=_['intersection'](_0x41b547[_0xd9a4('0x3f')],qs[_0xd9a4('0x41')](_0x193789[_0xd9a4('0x3c')][_0xd9a4('0x41')]));_0x1754e1[_0xd9a4('0x40')]=_0x1754e1['attributes'][_0xd9a4('0x42')]?_0x1754e1[_0xd9a4('0x40')]:_0x41b547[_0xd9a4('0x3f')];if(_0x193789[_0xd9a4('0x3c')][_0xd9a4('0x4c')]){_0x1754e1['include']=[{'all':!![]}];}_0x1754e1=_[_0xd9a4('0x46')]({},_0x1754e1,_0x193789['options']);return db['VoiceExtension']['find'](_0x1754e1)[_0xd9a4('0x25')](handleEntityNotFound(_0x419c64,null))['then'](respondWithResult(_0x419c64,null))[_0xd9a4('0x52')](handleError(_0x419c64,null));};exports[_0xd9a4('0x26')]=function(_0x5eabe1,_0x471ca6){return db['VoiceExtension'][_0xd9a4('0x33')]({'where':{'id':_0x5eabe1[_0xd9a4('0x51')]['id']}})[_0xd9a4('0x25')](handleEntityNotFound(_0x471ca6,null))[_0xd9a4('0x25')](removeEntity(_0x471ca6,null))[_0xd9a4('0x52')](handleError(_0x471ca6,null));};exports[_0xd9a4('0x53')]=function(_0x284d9e,_0xc8db55){if(_0x284d9e[_0xd9a4('0x54')][_0xd9a4('0x32')]===_0xd9a4('0x55')&&!_['startsWith'](_0x284d9e['body'][_0xd9a4('0x56')],'_')){_0x284d9e[_0xd9a4('0x54')]['exten']='_'[_0xd9a4('0x57')](_0x284d9e[_0xd9a4('0x54')][_0xd9a4('0x56')]);}return db[_0xd9a4('0x39')][_0xd9a4('0x53')](_0x284d9e[_0xd9a4('0x54')],{'raw':![]})[_0xd9a4('0x25')](function(_0x4b3a30){var _0x1c93d0=_0x284d9e['user']['get']({'plain':!![]});if(!_0x1c93d0)throw new Error(_0xd9a4('0x58'));if(_0x1c93d0[_0xd9a4('0x59')]===_0xd9a4('0x5a')){var _0x360c3e=_0x4b3a30[_0xd9a4('0x27')]({'plain':!![]});var _0x222904=[{'name':_0xd9a4('0x28'),'value':_0xd9a4('0x29')},{'name':_0xd9a4('0x2a'),'value':_0xd9a4('0x55')},{'name':_0xd9a4('0x2b'),'value':'internal'}];var _0x59ad24=_[_0xd9a4('0x33')](_0x222904,[_0xd9a4('0x30'),_0x360c3e['type']])[_0xd9a4('0x37')];return db['UserProfileSection'][_0xd9a4('0x33')]({'where':{'name':_0x59ad24,'userProfileId':_0x1c93d0['userProfileId']},'raw':!![]})[_0xd9a4('0x25')](function(_0x45279c){if(_0x45279c&&_0x45279c[_0xd9a4('0x5b')]===0x0){return db['UserProfileResource'][_0xd9a4('0x53')]({'name':_0x360c3e[_0xd9a4('0x37')],'resourceId':_0x360c3e['id'],'type':_0x45279c['name'],'sectionId':_0x45279c['id']},{})[_0xd9a4('0x25')](function(){return _0x4b3a30;});}else{return _0x4b3a30;}})[_0xd9a4('0x52')](function(_0x5b08e4){logger['error'](_0xd9a4('0x5c'),_0x5b08e4);throw _0x5b08e4;});}return _0x4b3a30;})[_0xd9a4('0x25')](respondWithResult(_0xc8db55,0xc9))[_0xd9a4('0x52')](handleError(_0xc8db55,null));};exports[_0xd9a4('0x24')]=function(_0x5c6c31,_0x31dc43){if(_0x5c6c31[_0xd9a4('0x54')]['id']){delete _0x5c6c31['body']['id'];}return db[_0xd9a4('0x39')][_0xd9a4('0x33')]({'where':{'id':_0x5c6c31['params']['id']}})[_0xd9a4('0x25')](handleEntityNotFound(_0x31dc43,null))[_0xd9a4('0x25')](function(_0x334159){if(_0x334159){return db['VoiceExtension']['update'](_[_0xd9a4('0x5d')](_0x5c6c31[_0xd9a4('0x54')],[_0xd9a4('0x56'),_0xd9a4('0x5e'),_0xd9a4('0x5f'),_0xd9a4('0x60'),_0xd9a4('0x61'),_0xd9a4('0x62')]),{'where':{'context':_0x334159[_0xd9a4('0x5e')],'exten':_0x334159[_0xd9a4('0x56')]},'individualHooks':!![]})[_0xd9a4('0x25')](function(_0x315b7b){return _0x315b7b;});}return null;})[_0xd9a4('0x25')](respondWithStatusCode(_0x31dc43,null))['catch'](handleError(_0x31dc43,null));};exports[_0xd9a4('0x63')]=function(_0x5d85c2,_0x33edc3,_0x2915e9){return db['VoiceExtension'][_0xd9a4('0x64')]({'where':{'id':_0x5d85c2['params']['id']}})['then'](handleEntityNotFound(_0x33edc3,null))['then'](function(_0x2e80c4){if(_0x2e80c4){return db[_0xd9a4('0x65')][_0xd9a4('0x66')](function(_0x3110ae){return db[_0xd9a4('0x39')]['destroy']({'where':{'VoiceExtensionId':_0x5d85c2['params']['id']},'transaction':_0x3110ae})['then'](function(_0x42e8a5){var _0x2cebca=_[_0xd9a4('0x2f')](_0x5d85c2[_0xd9a4('0x54')],function(_0x2a03de){_0x2a03de[_0xd9a4('0x67')]=_0x5d85c2[_0xd9a4('0x51')]['id'];return _0x2a03de;});return db['VoiceExtension']['bulkCreate'](_0x2cebca,{'transaction':_0x3110ae});});})[_0xd9a4('0x25')](function(){return db[_0xd9a4('0x39')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x5d85c2[_0xd9a4('0x51')]['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})[_0xd9a4('0x25')](respondWithResult(_0x33edc3,null))['catch'](handleError(_0x33edc3,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index ac6365a..ddb3f1c 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 _0x008c=['save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','VoiceExtension','setMaxListeners'];(function(_0x1d62ef,_0x4af41f){var _0x11511a=function(_0x3718b4){while(--_0x3718b4){_0x1d62ef['push'](_0x1d62ef['shift']());}};_0x11511a(++_0x4af41f);}(_0x008c,0x188));var _0xc008=function(_0x18ccd6,_0x1098e8){_0x18ccd6=_0x18ccd6-0x0;var _0x587d2c=_0x008c[_0x18ccd6];return _0x587d2c;};'use strict';var EventEmitter=require(_0xc008('0x0'));var VoiceExtension=require(_0xc008('0x1'))['db'][_0xc008('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xc008('0x3')](0x0);var events={'afterCreate':_0xc008('0x4'),'afterUpdate':'update','afterDestroy':_0xc008('0x5')};function emitEvent(_0x47063f){return function(_0x10b33c,_0x163bd9,_0x1cbe76){VoiceExtensionEvents[_0xc008('0x6')](_0x47063f+':'+_0x10b33c['id'],_0x10b33c);VoiceExtensionEvents[_0xc008('0x6')](_0x47063f,_0x10b33c);_0x1cbe76(null);};}for(var e in events){if(events[_0xc008('0x7')](e)){var event=events[e];VoiceExtension[_0xc008('0x8')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file +var _0x008c=['save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','VoiceExtension','setMaxListeners'];(function(_0x11f137,_0x50cc0a){var _0x2b304a=function(_0xa4ab02){while(--_0xa4ab02){_0x11f137['push'](_0x11f137['shift']());}};_0x2b304a(++_0x50cc0a);}(_0x008c,0x188));var _0xc008=function(_0x1e0c0e,_0x5ccb80){_0x1e0c0e=_0x1e0c0e-0x0;var _0x53fecc=_0x008c[_0x1e0c0e];return _0x53fecc;};'use strict';var EventEmitter=require(_0xc008('0x0'));var VoiceExtension=require(_0xc008('0x1'))['db'][_0xc008('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xc008('0x3')](0x0);var events={'afterCreate':_0xc008('0x4'),'afterUpdate':'update','afterDestroy':_0xc008('0x5')};function emitEvent(_0x47063f){return function(_0x10b33c,_0x163bd9,_0x1cbe76){VoiceExtensionEvents[_0xc008('0x6')](_0x47063f+':'+_0x10b33c['id'],_0x10b33c);VoiceExtensionEvents[_0xc008('0x6')](_0x47063f,_0x10b33c);_0x1cbe76(null);};}for(var e in events){if(events[_0xc008('0x7')](e)){var event=events[e];VoiceExtension[_0xc008('0x8')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index f9ec290..ed94e17 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 _0xe260=['path','rimraf','../../config/environment','./voiceExtension.attributes','exports','define','VoiceExtension','voice_extensions','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x2feb53,_0x264ef7){var _0x5700ee=function(_0x700c98){while(--_0x700c98){_0x2feb53['push'](_0x2feb53['shift']());}};_0x5700ee(++_0x264ef7);}(_0xe260,0xb0));var _0x0e26=function(_0x5b5012,_0x19b72f){_0x5b5012=_0x5b5012-0x0;var _0x3c793b=_0xe260[_0x5b5012];return _0x3c793b;};'use strict';var _=require(_0x0e26('0x0'));var util=require(_0x0e26('0x1'));var logger=require(_0x0e26('0x2'))(_0x0e26('0x3'));var moment=require('moment');var BPromise=require(_0x0e26('0x4'));var rp=require(_0x0e26('0x5'));var fs=require('fs');var path=require(_0x0e26('0x6'));var rimraf=require(_0x0e26('0x7'));var config=require(_0x0e26('0x8'));var attributes=require(_0x0e26('0x9'));module[_0x0e26('0xa')]=function(_0x1f9be2,_0x4fa339){return _0x1f9be2[_0x0e26('0xb')](_0x0e26('0xc'),attributes,{'tableName':_0x0e26('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f54=['bluebird','request-promise','path','rimraf','./voiceExtension.attributes','VoiceExtension','voice_extensions','lodash','util','../../config/logger'];(function(_0x4cfdfb,_0x261771){var _0x5ceef8=function(_0x427e49){while(--_0x427e49){_0x4cfdfb['push'](_0x4cfdfb['shift']());}};_0x5ceef8(++_0x261771);}(_0x6f54,0xcf));var _0x46f5=function(_0x593346,_0x4c5dd1){_0x593346=_0x593346-0x0;var _0x459973=_0x6f54[_0x593346];return _0x459973;};'use strict';var _=require(_0x46f5('0x0'));var util=require(_0x46f5('0x1'));var logger=require(_0x46f5('0x2'))('api');var moment=require('moment');var BPromise=require(_0x46f5('0x3'));var rp=require(_0x46f5('0x4'));var fs=require('fs');var path=require(_0x46f5('0x5'));var rimraf=require(_0x46f5('0x6'));var config=require('../../config/environment');var attributes=require(_0x46f5('0x7'));module['exports']=function(_0x479d56,_0x21c3d2){return _0x479d56['define'](_0x46f5('0x8'),attributes,{'tableName':_0x46f5('0x9'),'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 7f4616b..e4fac7d 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 _0x9ffd=['./voiceExtension.socket','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','attributes','limit','include','map','model','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0xe75fc2,_0x3fb22a){var _0x34ea2c=function(_0x3e3b4d){while(--_0x3e3b4d){_0xe75fc2['push'](_0xe75fc2['shift']());}};_0x34ea2c(++_0x3fb22a);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x3ffde7,_0x5a7f2b){_0x3ffde7=_0x3ffde7-0x0;var _0x412f57=_0x9ffd[_0x3ffde7];return _0x412f57;};'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});config[_0xd9ff('0xb')]=_[_0xd9ff('0xc')](config[_0xd9ff('0xb')],{'host':_0xd9ff('0xd'),'port':0x18eb});var socket=require(_0xd9ff('0xe'))(new Redis(config[_0xd9ff('0xb')]));require(_0xd9ff('0xf'))['register'](socket);function respondWithRpcPromise(_0x54a555,_0x567f79,_0x5aa954){return new BPromise(function(_0x2355ab,_0x2fd77a){return client[_0xd9ff('0x10')](_0x54a555,_0x5aa954)[_0xd9ff('0x11')](function(_0x37d2c0){logger[_0xd9ff('0x12')](_0xd9ff('0x13'),_0x567f79,_0xd9ff('0x14'));logger['debug']('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x567f79,_0xd9ff('0x14'),JSON[_0xd9ff('0x15')](_0x37d2c0));if(_0x37d2c0[_0xd9ff('0x16')]){if(_0x37d2c0[_0xd9ff('0x16')][_0xd9ff('0x17')]===0x1f4){logger['error'](_0xd9ff('0x13'),_0x567f79,_0x37d2c0[_0xd9ff('0x16')]['message']);return _0x2fd77a(_0x37d2c0[_0xd9ff('0x16')]['message']);}logger['error']('VoiceExtension,\x20%s,\x20%s',_0x567f79,_0x37d2c0['error'][_0xd9ff('0x18')]);return _0x2355ab(_0x37d2c0['error'][_0xd9ff('0x18')]);}else{logger[_0xd9ff('0x12')](_0xd9ff('0x13'),_0x567f79,_0xd9ff('0x14'));_0x2355ab(_0x37d2c0[_0xd9ff('0x19')][_0xd9ff('0x18')]);}})[_0xd9ff('0x1a')](function(_0x128588){logger[_0xd9ff('0x16')](_0xd9ff('0x13'),_0x567f79,_0x128588);_0x2fd77a(_0x128588);});});}exports[_0xd9ff('0x1b')]=function(_0x39ef37){var _0x46a6ab=this;return new Promise(function(_0x4c8740,_0x4cf8ec){return db[_0xd9ff('0x1c')][_0xd9ff('0x1d')]({'raw':_0x39ef37['options']?_0x39ef37['options']['raw']===undefined?!![]:![]:!![],'where':_0x39ef37['options']?_0x39ef37[_0xd9ff('0x1e')]['where']||null:null,'attributes':_0x39ef37[_0xd9ff('0x1e')]?_0x39ef37[_0xd9ff('0x1e')][_0xd9ff('0x1f')]||null:null,'limit':_0x39ef37[_0xd9ff('0x1e')]?_0x39ef37[_0xd9ff('0x1e')][_0xd9ff('0x20')]||null:null,'include':_0x39ef37['options']?_0x39ef37['options'][_0xd9ff('0x21')]?_['map'](_0x39ef37[_0xd9ff('0x1e')]['include'],function(_0x285002){return{'model':db[_0x285002['model']],'as':_0x285002['as'],'attributes':_0x285002[_0xd9ff('0x1f')],'include':_0x285002[_0xd9ff('0x21')]?_[_0xd9ff('0x22')](_0x285002[_0xd9ff('0x21')],function(_0x5d685e){return{'model':db[_0x5d685e[_0xd9ff('0x23')]],'as':_0x5d685e['as'],'attributes':_0x5d685e[_0xd9ff('0x1f')],'include':_0x5d685e[_0xd9ff('0x21')]?_[_0xd9ff('0x22')](_0x5d685e['include'],function(_0x1d3684){return{'model':db[_0x1d3684[_0xd9ff('0x23')]],'as':_0x1d3684['as'],'attributes':_0x1d3684[_0xd9ff('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xd9ff('0x11')](function(_0x263d3a){logger[_0xd9ff('0x12')](_0xd9ff('0x1b'),_0x39ef37);logger[_0xd9ff('0x24')](_0xd9ff('0x1b'),_0x39ef37,JSON['stringify'](_0x263d3a));_0x4c8740(_0x263d3a);})[_0xd9ff('0x1a')](function(_0x4ba2be){logger[_0xd9ff('0x16')](_0xd9ff('0x1b'),_0x4ba2be[_0xd9ff('0x18')],_0x39ef37);_0x4cf8ec(_0x46a6ab['error'](0x1f4,_0x4ba2be[_0xd9ff('0x18')]));});});}; \ No newline at end of file +var _0x9ffd=['./voiceExtension.socket','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','attributes','limit','include','map','model','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x36c6e6,_0x263d4f){var _0x35e0c2=function(_0x2b3178){while(--_0x2b3178){_0x36c6e6['push'](_0x36c6e6['shift']());}};_0x35e0c2(++_0x263d4f);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x1e68a6,_0x1b6fac){_0x1e68a6=_0x1e68a6-0x0;var _0xf26b5=_0x9ffd[_0x1e68a6];return _0xf26b5;};'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});config[_0xd9ff('0xb')]=_[_0xd9ff('0xc')](config[_0xd9ff('0xb')],{'host':_0xd9ff('0xd'),'port':0x18eb});var socket=require(_0xd9ff('0xe'))(new Redis(config[_0xd9ff('0xb')]));require(_0xd9ff('0xf'))['register'](socket);function respondWithRpcPromise(_0x54a555,_0x567f79,_0x5aa954){return new BPromise(function(_0x2355ab,_0x2fd77a){return client[_0xd9ff('0x10')](_0x54a555,_0x5aa954)[_0xd9ff('0x11')](function(_0x37d2c0){logger[_0xd9ff('0x12')](_0xd9ff('0x13'),_0x567f79,_0xd9ff('0x14'));logger['debug']('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x567f79,_0xd9ff('0x14'),JSON[_0xd9ff('0x15')](_0x37d2c0));if(_0x37d2c0[_0xd9ff('0x16')]){if(_0x37d2c0[_0xd9ff('0x16')][_0xd9ff('0x17')]===0x1f4){logger['error'](_0xd9ff('0x13'),_0x567f79,_0x37d2c0[_0xd9ff('0x16')]['message']);return _0x2fd77a(_0x37d2c0[_0xd9ff('0x16')]['message']);}logger['error']('VoiceExtension,\x20%s,\x20%s',_0x567f79,_0x37d2c0['error'][_0xd9ff('0x18')]);return _0x2355ab(_0x37d2c0['error'][_0xd9ff('0x18')]);}else{logger[_0xd9ff('0x12')](_0xd9ff('0x13'),_0x567f79,_0xd9ff('0x14'));_0x2355ab(_0x37d2c0[_0xd9ff('0x19')][_0xd9ff('0x18')]);}})[_0xd9ff('0x1a')](function(_0x128588){logger[_0xd9ff('0x16')](_0xd9ff('0x13'),_0x567f79,_0x128588);_0x2fd77a(_0x128588);});});}exports[_0xd9ff('0x1b')]=function(_0x39ef37){var _0x46a6ab=this;return new Promise(function(_0x4c8740,_0x4cf8ec){return db[_0xd9ff('0x1c')][_0xd9ff('0x1d')]({'raw':_0x39ef37['options']?_0x39ef37['options']['raw']===undefined?!![]:![]:!![],'where':_0x39ef37['options']?_0x39ef37[_0xd9ff('0x1e')]['where']||null:null,'attributes':_0x39ef37[_0xd9ff('0x1e')]?_0x39ef37[_0xd9ff('0x1e')][_0xd9ff('0x1f')]||null:null,'limit':_0x39ef37[_0xd9ff('0x1e')]?_0x39ef37[_0xd9ff('0x1e')][_0xd9ff('0x20')]||null:null,'include':_0x39ef37['options']?_0x39ef37['options'][_0xd9ff('0x21')]?_['map'](_0x39ef37[_0xd9ff('0x1e')]['include'],function(_0x285002){return{'model':db[_0x285002['model']],'as':_0x285002['as'],'attributes':_0x285002[_0xd9ff('0x1f')],'include':_0x285002[_0xd9ff('0x21')]?_[_0xd9ff('0x22')](_0x285002[_0xd9ff('0x21')],function(_0x5d685e){return{'model':db[_0x5d685e[_0xd9ff('0x23')]],'as':_0x5d685e['as'],'attributes':_0x5d685e[_0xd9ff('0x1f')],'include':_0x5d685e[_0xd9ff('0x21')]?_[_0xd9ff('0x22')](_0x5d685e['include'],function(_0x1d3684){return{'model':db[_0x1d3684[_0xd9ff('0x23')]],'as':_0x1d3684['as'],'attributes':_0x1d3684[_0xd9ff('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xd9ff('0x11')](function(_0x263d3a){logger[_0xd9ff('0x12')](_0xd9ff('0x1b'),_0x39ef37);logger[_0xd9ff('0x24')](_0xd9ff('0x1b'),_0x39ef37,JSON['stringify'](_0x263d3a));_0x4c8740(_0x263d3a);})[_0xd9ff('0x1a')](function(_0x4ba2be){logger[_0xd9ff('0x16')](_0xd9ff('0x1b'),_0x4ba2be[_0xd9ff('0x18')],_0x39ef37);_0x4cf8ec(_0x46a6ab['error'](0x1f4,_0x4ba2be[_0xd9ff('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 2c5de5e..9889f7d 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 _0x38a3=['update','register','length','./voiceExtension.events','save','remove'];(function(_0x786e9,_0x1a029){var _0x1f891b=function(_0x31ad7c){while(--_0x31ad7c){_0x786e9['push'](_0x786e9['shift']());}};_0x1f891b(++_0x1a029);}(_0x38a3,0x13b));var _0x338a=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x38a3[_0x4b369d];return _0x571a98;};'use strict';var VoiceExtensionEvents=require(_0x338a('0x0'));var events=[_0x338a('0x1'),_0x338a('0x2'),_0x338a('0x3')];function createListener(_0x220458,_0x237498){return function(_0xf6c459){_0x237498['emit'](_0x220458,_0xf6c459);};}function removeListener(_0x29812b,_0x16b5b3){return function(){VoiceExtensionEvents['removeListener'](_0x29812b,_0x16b5b3);};}exports[_0x338a('0x4')]=function(_0x1da3c7){for(var _0x228e5a=0x0,_0x43823a=events[_0x338a('0x5')];_0x228e5a<_0x43823a;_0x228e5a++){var _0x51b356=events[_0x228e5a];var _0x24b82a=createListener('voiceExtension:'+_0x51b356,_0x1da3c7);VoiceExtensionEvents['on'](_0x51b356,_0x24b82a);}}; \ No newline at end of file +var _0xeebd=['./voiceExtension.events','save','remove','update','emit','removeListener','register','length','voiceExtension:'];(function(_0x496b11,_0x576cb0){var _0x3030ac=function(_0x38185b){while(--_0x38185b){_0x496b11['push'](_0x496b11['shift']());}};_0x3030ac(++_0x576cb0);}(_0xeebd,0xf3));var _0xdeeb=function(_0x596dbd,_0x51bd2a){_0x596dbd=_0x596dbd-0x0;var _0x2d7113=_0xeebd[_0x596dbd];return _0x2d7113;};'use strict';var VoiceExtensionEvents=require(_0xdeeb('0x0'));var events=[_0xdeeb('0x1'),_0xdeeb('0x2'),_0xdeeb('0x3')];function createListener(_0xe9f810,_0x25e6a1){return function(_0x1eb47a){_0x25e6a1[_0xdeeb('0x4')](_0xe9f810,_0x1eb47a);};}function removeListener(_0x57a309,_0x20f612){return function(){VoiceExtensionEvents[_0xdeeb('0x5')](_0x57a309,_0x20f612);};}exports[_0xdeeb('0x6')]=function(_0x2dd686){for(var _0x5baf29=0x0,_0x35ff0d=events[_0xdeeb('0x7')];_0x5baf29<_0x35ff0d;_0x5baf29++){var _0x56cfd9=events[_0x5baf29];var _0x1f35fc=createListener(_0xdeeb('0x8')+_0x56cfd9,_0x2dd686);VoiceExtensionEvents['on'](_0x56cfd9,_0x1f35fc);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 90d46b5..317dc4d 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 _0xb332=['destroy','multer','path','express','../../components/auth/service','../../components/interaction/service','./voiceMail.controller','get','/:id','isAuthenticated','show','getMessages','put','update'];(function(_0x5c1cb3,_0x448afe){var _0x15abf9=function(_0x4a3ced){while(--_0x4a3ced){_0x5c1cb3['push'](_0x5c1cb3['shift']());}};_0x15abf9(++_0x448afe);}(_0xb332,0x10b));var _0x2b33=function(_0x186376,_0x5d988a){_0x186376=_0x186376-0x0;var _0x2dbdd9=_0xb332[_0x186376];return _0x2dbdd9;};'use strict';var multer=require(_0x2b33('0x0'));var util=require('util');var path=require(_0x2b33('0x1'));var timeout=require('connect-timeout');var express=require(_0x2b33('0x2'));var router=express['Router']();var auth=require(_0x2b33('0x3'));var interaction=require(_0x2b33('0x4'));var config=require('../../config/environment');var controller=require(_0x2b33('0x5'));router[_0x2b33('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2b33('0x6')](_0x2b33('0x7'),auth[_0x2b33('0x8')](),controller[_0x2b33('0x9')]);router[_0x2b33('0x6')]('/:id/messages',auth['isAuthenticated'](),controller[_0x2b33('0xa')]);router['post']('/',auth[_0x2b33('0x8')](),controller['create']);router[_0x2b33('0xb')](_0x2b33('0x7'),auth[_0x2b33('0x8')](),controller[_0x2b33('0xc')]);router['delete']('/:id',auth[_0x2b33('0x8')](),controller[_0x2b33('0xd')]);module['exports']=router; \ No newline at end of file +var _0xd24f=['update','delete','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','put'];(function(_0x2d1406,_0x8a575e){var _0x31a9fb=function(_0x35ac19){while(--_0x35ac19){_0x2d1406['push'](_0x2d1406['shift']());}};_0x31a9fb(++_0x8a575e);}(_0xd24f,0x1a5));var _0xfd24=function(_0x16e705,_0x3c1245){_0x16e705=_0x16e705-0x0;var _0x1008fd=_0xd24f[_0x16e705];return _0x1008fd;};'use strict';var multer=require(_0xfd24('0x0'));var util=require('util');var path=require(_0xfd24('0x1'));var timeout=require('connect-timeout');var express=require(_0xfd24('0x2'));var router=express[_0xfd24('0x3')]();var auth=require(_0xfd24('0x4'));var interaction=require(_0xfd24('0x5'));var config=require(_0xfd24('0x6'));var controller=require(_0xfd24('0x7'));router[_0xfd24('0x8')]('/',auth[_0xfd24('0x9')](),controller[_0xfd24('0xa')]);router['get'](_0xfd24('0xb'),auth[_0xfd24('0x9')](),controller[_0xfd24('0xc')]);router[_0xfd24('0x8')](_0xfd24('0xd'),auth[_0xfd24('0x9')](),controller[_0xfd24('0xe')]);router['post']('/',auth[_0xfd24('0x9')](),controller['create']);router[_0xfd24('0xf')](_0xfd24('0xb'),auth[_0xfd24('0x9')](),controller[_0xfd24('0x10')]);router[_0xfd24('0x11')](_0xfd24('0xb'),auth[_0xfd24('0x9')](),controller['destroy']);module[_0xfd24('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 18248ad..12c1aab 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 _0x4082=['ENUM','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','fullname','\x20-\x20','getDataValue','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','string','trim','central','yes'];(function(_0x1f7413,_0x3388c3){var _0x2d2775=function(_0x5e5b4){while(--_0x5e5b4){_0x1f7413['push'](_0x1f7413['shift']());}};_0x2d2775(++_0x3388c3);}(_0x4082,0xb4));var _0x2408=function(_0x236d24,_0x29e80a){_0x236d24=_0x236d24-0x0;var _0x1574cf=_0x4082[_0x236d24];return _0x1574cf;};'use strict';var Sequelize=require(_0x2408('0x0'));module[_0x2408('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x2408('0x2')],'defaultValue':_0x2408('0x3'),'unique':_0x2408('0x4')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x2408('0x4')},'password':{'type':Sequelize[_0x2408('0x2')]},'fullname':{'type':Sequelize[_0x2408('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x1228fa){this[_0x2408('0x5')]('email',typeof _0x1228fa===_0x2408('0x6')&&_0x1228fa[_0x2408('0x7')]()?_0x1228fa[_0x2408('0x7')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x2408('0x2')],'defaultValue':_0x2408('0x8')},'attach':{'type':Sequelize['ENUM'](_0x2408('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x2408('0xa')](_0x2408('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x2408('0xa')](_0x2408('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x2408('0xa')](_0x2408('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x2408('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0x2408('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x2408('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x2408('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x2408('0xa')](_0x2408('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0x2408('0x9'),'no'),'defaultValue':_0x2408('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x2408('0xa')](_0x2408('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x2408('0xa')](_0x2408('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x2408('0xa')](_0x2408('0x9'),'no'),'defaultValue':_0x2408('0x9'),'allowNull':![]},'stamp':{'type':_0x2408('0xc')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x2408('0x2')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x2408('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x2408('0xe')],'get':function(){return this['getDataValue'](_0x2408('0xf'))+_0x2408('0x10')+this[_0x2408('0x11')](_0x2408('0x12'));}}}; \ No newline at end of file +var _0xe0ec=['from-voicemail','contest_mailbox','trim','central','ENUM','yes','INTEGER','VIRTUAL','getDataValue','fullname','mailbox','sequelize','exports','STRING'];(function(_0x50e593,_0x3ae998){var _0x3821d0=function(_0x53c295){while(--_0x53c295){_0x50e593['push'](_0x50e593['shift']());}};_0x3821d0(++_0x3ae998);}(_0xe0ec,0x13f));var _0xce0e=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0xe0ec[_0x24f31b];return _0x488401;};'use strict';var Sequelize=require(_0xce0e('0x0'));module[_0xce0e('0x1')]={'customer_id':{'type':Sequelize[_0xce0e('0x2')]},'context':{'type':Sequelize[_0xce0e('0x2')],'defaultValue':_0xce0e('0x3'),'unique':_0xce0e('0x4')},'mailbox':{'type':Sequelize[_0xce0e('0x2')],'defaultValue':'','allowNull':![],'unique':_0xce0e('0x4')},'password':{'type':Sequelize[_0xce0e('0x2')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x276fe9){this['setDataValue']('email',typeof _0x276fe9==='string'&&_0x276fe9[_0xce0e('0x5')]()?_0x276fe9[_0xce0e('0x5')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0xce0e('0x2')],'defaultValue':_0xce0e('0x6')},'attach':{'type':Sequelize[_0xce0e('0x7')](_0xce0e('0x8'),'no'),'defaultValue':_0xce0e('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0xce0e('0x7')](_0xce0e('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0xce0e('0x2')]},'callback':{'type':Sequelize[_0xce0e('0x2')]},'review':{'type':Sequelize['ENUM'](_0xce0e('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xce0e('0x7')](_0xce0e('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xce0e('0x7')](_0xce0e('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0xce0e('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xce0e('0x7')](_0xce0e('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xce0e('0x7')](_0xce0e('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0xce0e('0x8'),'no'),'defaultValue':_0xce0e('0x8'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0xce0e('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xce0e('0x7')](_0xce0e('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0xce0e('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0xce0e('0x9')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xce0e('0x9')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xce0e('0xa')],'get':function(){return this[_0xce0e('0xb')](_0xce0e('0xc'))+'\x20-\x20'+this['getDataValue'](_0xce0e('0xd'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 535ace9..00ca293 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 _0x6570=['squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','limit','set','Content-Range','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','stack','name','send','index','VoiceMail','rawAttributes','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','offset','sort','pick','filter','where','map','VIRTUAL','field','merge','options','includeAll','include','rows','catch','params','fields','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage','mailbox','findAndCountAll','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','lodash'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x6570,0x1e7));var _0x0657=function(_0x2b68fc,_0x10362e){_0x2b68fc=_0x2b68fc-0x0;var _0x2e3490=_0x6570[_0x2b68fc];return _0x2e3490;};'use strict';var pdf=require(_0x0657('0x0'));var emlformat=require(_0x0657('0x1'));var rimraf=require(_0x0657('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0657('0x3'));var rp=require(_0x0657('0x4'));var moment=require(_0x0657('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0657('0x6'));var util=require('util');var path=require(_0x0657('0x7'));var sox=require(_0x0657('0x8'));var csv=require(_0x0657('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0657('0xa'));var squel=require(_0x0657('0xb'));var crypto=require('crypto');var jsforce=require(_0x0657('0xc'));var deskjs=require(_0x0657('0xd'));var toCsv=require(_0x0657('0x9'));var querystring=require('querystring');var Papa=require(_0x0657('0xe'));var Redis=require(_0x0657('0xf'));var authService=require(_0x0657('0x10'));var qs=require(_0x0657('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0657('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x0657('0x13'));var db=require(_0x0657('0x14'))['db'];function respondWithStatusCode(_0x2e9870,_0x1ce2d9){_0x1ce2d9=_0x1ce2d9||0xcc;return function(_0x449c24){if(_0x449c24){return _0x2e9870[_0x0657('0x15')](_0x1ce2d9);}return _0x2e9870['status'](_0x1ce2d9)[_0x0657('0x16')]();};}function respondWithResult(_0xd9905f,_0x5cd7e0){_0x5cd7e0=_0x5cd7e0||0xc8;return function(_0x5ab7f2){if(_0x5ab7f2){return _0xd9905f[_0x0657('0x17')](_0x5cd7e0)[_0x0657('0x18')](_0x5ab7f2);}};}function respondWithFilteredResult(_0x1bc030,_0x2578c2){return function(_0x273451){if(_0x273451){var _0x4f0851=_0x273451[_0x0657('0x19')],_0x377e9e=_0x2578c2['offset'],_0x2e1a24=_0x2578c2['offset']+_0x2578c2[_0x0657('0x1a')],_0x2aa332;if(_0x2e1a24>=_0x4f0851){_0x2e1a24=_0x4f0851;_0x2aa332=0xc8;}else{_0x2aa332=0xce;}_0x1bc030[_0x0657('0x17')](_0x2aa332);return _0x1bc030[_0x0657('0x1b')](_0x0657('0x1c'),_0x377e9e+'-'+_0x2e1a24+'/'+_0x4f0851)['json'](_0x273451);}return null;};}function patchUpdates(_0x22143c){return function(_0x1f49b3){try{jsonpatch['apply'](_0x1f49b3,_0x22143c,!![]);}catch(_0x15823b){return BPromise[_0x0657('0x1d')](_0x15823b);}return _0x1f49b3[_0x0657('0x1e')]();};}function saveUpdates(_0x2bd5bb,_0x113d59){return function(_0x512361){if(_0x512361){return _0x512361[_0x0657('0x1f')](_0x2bd5bb)[_0x0657('0x20')](function(_0x2f2535){return _0x2f2535;});}return null;};}function removeEntity(_0x1bb6c0,_0x25f105){return function(_0x41e94b){if(_0x41e94b){return _0x41e94b[_0x0657('0x21')]()[_0x0657('0x20')](function(){var _0x1f000d=_0x41e94b[_0x0657('0x22')]({'plain':!![]});var _0x3fff1e=_0x0657('0x23');return db[_0x0657('0x24')][_0x0657('0x21')]({'where':{'type':_0x3fff1e,'resourceId':_0x1f000d['id']}})[_0x0657('0x20')](function(){return _0x41e94b;});})[_0x0657('0x20')](function(){_0x1bb6c0[_0x0657('0x17')](0xcc)[_0x0657('0x16')]();});}};}function handleEntityNotFound(_0x23ade8,_0x1ed835){return function(_0xe80b23){if(!_0xe80b23){_0x23ade8[_0x0657('0x15')](0x194);}return _0xe80b23;};}function handleError(_0x7248b5,_0x1f735d){_0x1f735d=_0x1f735d||0x1f4;return function(_0xac4ed0){logger['error'](_0xac4ed0[_0x0657('0x25')]);if(_0xac4ed0[_0x0657('0x26')]){delete _0xac4ed0['name'];}_0x7248b5[_0x0657('0x17')](_0x1f735d)[_0x0657('0x27')](_0xac4ed0);};}exports[_0x0657('0x28')]=function(_0x2b6aae,_0xe3534f){var _0x4dacb6={},_0x11a50f={},_0x571971={'count':0x0,'rows':[]};var _0x29a1d7=db[_0x0657('0x29')][_0x0657('0x2a')];_0x11a50f[_0x0657('0x2b')]=_[_0x0657('0x2c')](_0x29a1d7);_0x11a50f[_0x0657('0x2d')]=_[_0x0657('0x2c')](_0x2b6aae[_0x0657('0x2d')]);_0x11a50f[_0x0657('0x2e')]=_[_0x0657('0x2f')](_0x11a50f[_0x0657('0x2b')],_0x11a50f[_0x0657('0x2d')]);_0x4dacb6[_0x0657('0x30')]=_[_0x0657('0x2f')](_0x11a50f[_0x0657('0x2b')],qs['fields'](_0x2b6aae['query']['fields']));_0x4dacb6[_0x0657('0x30')]=_0x4dacb6[_0x0657('0x30')][_0x0657('0x31')]?_0x4dacb6[_0x0657('0x30')]:_0x11a50f[_0x0657('0x2b')];if(!_0x2b6aae[_0x0657('0x2d')][_0x0657('0x32')](_0x0657('0x33'))){_0x4dacb6[_0x0657('0x1a')]=qs[_0x0657('0x1a')](_0x2b6aae['query'][_0x0657('0x1a')]);_0x4dacb6[_0x0657('0x34')]=qs['offset'](_0x2b6aae[_0x0657('0x2d')][_0x0657('0x34')]);}_0x4dacb6['order']=qs[_0x0657('0x35')](_0x2b6aae[_0x0657('0x2d')][_0x0657('0x35')]);_0x4dacb6['where']=qs[_0x0657('0x2e')](_[_0x0657('0x36')](_0x2b6aae['query'],_0x11a50f[_0x0657('0x2e')]));if(_0x2b6aae[_0x0657('0x2d')][_0x0657('0x37')]){_0x4dacb6[_0x0657('0x38')]=_['merge'](_0x4dacb6[_0x0657('0x38')],{'$or':_[_0x0657('0x39')](_0x29a1d7,function(_0x4facf5){if(_0x4facf5['type']['key']!==_0x0657('0x3a')){var _0x608548={};_0x608548[_0x4facf5[_0x0657('0x3b')]]={'$like':'%'+_0x2b6aae['query'][_0x0657('0x37')]+'%'};return _0x608548;}})});}_0x4dacb6=_[_0x0657('0x3c')]({},_0x4dacb6,_0x2b6aae[_0x0657('0x3d')]);var _0x1105b9={'where':_0x4dacb6[_0x0657('0x38')]};return db[_0x0657('0x29')][_0x0657('0x19')](_0x1105b9)[_0x0657('0x20')](function(_0x19967a){_0x571971[_0x0657('0x19')]=_0x19967a;if(_0x2b6aae['query'][_0x0657('0x3e')]){_0x4dacb6[_0x0657('0x3f')]=[{'all':!![]}];}return db[_0x0657('0x29')]['findAll'](_0x4dacb6);})[_0x0657('0x20')](function(_0x1df472){_0x571971[_0x0657('0x40')]=_0x1df472;return _0x571971;})[_0x0657('0x20')](respondWithFilteredResult(_0xe3534f,_0x4dacb6))[_0x0657('0x41')](handleError(_0xe3534f,null));};exports['show']=function(_0x474a34,_0x2e6dbc){var _0x36fc43={'raw':!![],'where':{'id':_0x474a34[_0x0657('0x42')]['id']}},_0x507252={};_0x507252[_0x0657('0x2b')]=_[_0x0657('0x2c')](db[_0x0657('0x29')][_0x0657('0x2a')]);_0x507252[_0x0657('0x2d')]=_[_0x0657('0x2c')](_0x474a34[_0x0657('0x2d')]);_0x507252['filters']=_[_0x0657('0x2f')](_0x507252['model'],_0x507252[_0x0657('0x2d')]);_0x36fc43[_0x0657('0x30')]=_[_0x0657('0x2f')](_0x507252[_0x0657('0x2b')],qs[_0x0657('0x43')](_0x474a34[_0x0657('0x2d')]['fields']));_0x36fc43[_0x0657('0x30')]=_0x36fc43['attributes'][_0x0657('0x31')]?_0x36fc43[_0x0657('0x30')]:_0x507252[_0x0657('0x2b')];if(_0x474a34['query'][_0x0657('0x3e')]){_0x36fc43['include']=[{'all':!![]}];}_0x36fc43=_[_0x0657('0x3c')]({},_0x36fc43,_0x474a34['options']);return db[_0x0657('0x29')][_0x0657('0x44')](_0x36fc43)[_0x0657('0x20')](handleEntityNotFound(_0x2e6dbc,null))[_0x0657('0x20')](respondWithResult(_0x2e6dbc,null))[_0x0657('0x41')](handleError(_0x2e6dbc,null));};exports[_0x0657('0x45')]=function(_0x2760a6,_0x429583){return db[_0x0657('0x29')]['create'](_0x2760a6[_0x0657('0x46')],{})[_0x0657('0x20')](function(_0x14107d){var _0xc80009=_0x2760a6['user'][_0x0657('0x22')]({'plain':!![]});if(!_0xc80009)throw new Error(_0x0657('0x47'));if(_0xc80009[_0x0657('0x48')]===_0x0657('0x49')){var _0xebf92c=_0x14107d[_0x0657('0x22')]({'plain':!![]});var _0x5b8da2=_0x0657('0x23');return db[_0x0657('0x4a')][_0x0657('0x44')]({'where':{'name':_0x5b8da2,'userProfileId':_0xc80009['userProfileId']},'raw':!![]})[_0x0657('0x20')](function(_0x1d67dd){if(_0x1d67dd&&_0x1d67dd[_0x0657('0x4b')]===0x0){return db['UserProfileResource'][_0x0657('0x45')]({'name':_0xebf92c[_0x0657('0x26')],'resourceId':_0xebf92c['id'],'type':_0x1d67dd[_0x0657('0x26')],'sectionId':_0x1d67dd['id']},{})[_0x0657('0x20')](function(){return _0x14107d;});}else{return _0x14107d;}})[_0x0657('0x41')](function(_0x14924c){logger[_0x0657('0x4c')](_0x0657('0x4d'),_0x14924c);throw _0x14924c;});}return _0x14107d;})[_0x0657('0x20')](respondWithResult(_0x429583,0xc9))[_0x0657('0x41')](handleError(_0x429583,null));};exports[_0x0657('0x1f')]=function(_0x4e3b11,_0x134020){if(_0x4e3b11['body']['id']){delete _0x4e3b11[_0x0657('0x46')]['id'];}return db[_0x0657('0x29')][_0x0657('0x44')]({'where':{'id':_0x4e3b11[_0x0657('0x42')]['id']}})[_0x0657('0x20')](handleEntityNotFound(_0x134020,null))['then'](saveUpdates(_0x4e3b11[_0x0657('0x46')],null))[_0x0657('0x20')](respondWithResult(_0x134020,null))[_0x0657('0x41')](handleError(_0x134020,null));};exports['destroy']=function(_0x2e1a3e,_0x461f6c){return db[_0x0657('0x29')]['find']({'where':{'id':_0x2e1a3e[_0x0657('0x42')]['id']}})[_0x0657('0x20')](handleEntityNotFound(_0x461f6c,null))[_0x0657('0x20')](removeEntity(_0x461f6c,null))[_0x0657('0x41')](handleError(_0x461f6c,null));};exports[_0x0657('0x4e')]=function(_0x3d174a,_0x133023,_0x17e9e2){return db[_0x0657('0x29')][_0x0657('0x4f')]({'where':{'id':_0x3d174a[_0x0657('0x42')]['id']}})['then'](handleEntityNotFound(_0x133023,null))[_0x0657('0x20')](function(_0x24e06c){var _0x230a1f;var _0x4c5d52={},_0xaa3fd9={};_0xaa3fd9[_0x0657('0x2b')]=_[_0x0657('0x2c')](db[_0x0657('0x50')][_0x0657('0x2a')]);_0xaa3fd9[_0x0657('0x2d')]=_[_0x0657('0x2c')](_0x3d174a['query']);_0xaa3fd9[_0x0657('0x2e')]=_['intersection'](_0xaa3fd9[_0x0657('0x2b')],_0xaa3fd9[_0x0657('0x2d')]);_0x4c5d52[_0x0657('0x30')]=_[_0x0657('0x2f')](_0xaa3fd9[_0x0657('0x2b')],qs['fields'](_0x3d174a[_0x0657('0x2d')][_0x0657('0x43')]));_0x4c5d52[_0x0657('0x30')]=_0x4c5d52[_0x0657('0x30')][_0x0657('0x31')]?_0x4c5d52[_0x0657('0x30')]:_0xaa3fd9[_0x0657('0x2b')];if(!_0x3d174a[_0x0657('0x2d')]['hasOwnProperty']('nolimit')){_0x4c5d52[_0x0657('0x1a')]=qs[_0x0657('0x1a')](_0x3d174a[_0x0657('0x2d')][_0x0657('0x1a')]);_0x4c5d52[_0x0657('0x34')]=qs[_0x0657('0x34')](_0x3d174a[_0x0657('0x2d')][_0x0657('0x34')]);}_0x4c5d52['order']=qs['sort'](_0x3d174a['query'][_0x0657('0x35')]);_0x4c5d52[_0x0657('0x38')]=qs[_0x0657('0x2e')](_[_0x0657('0x36')](_0x3d174a[_0x0657('0x2d')],_0xaa3fd9['filters']));if(_0x3d174a[_0x0657('0x2d')]['filter']){_0x4c5d52[_0x0657('0x38')]=_[_0x0657('0x3c')](_0x4c5d52[_0x0657('0x38')],{'$or':_[_0x0657('0x39')](_0x4c5d52[_0x0657('0x30')],function(_0x6c2d13){var _0x33c241={};_0x33c241[_0x6c2d13]={'$like':'%'+_0x3d174a[_0x0657('0x2d')][_0x0657('0x37')]+'%'};return _0x33c241;})});}_0x4c5d52[_0x0657('0x38')]=_[_0x0657('0x3c')](_0x4c5d52[_0x0657('0x38')],{'mailboxuser':_0x24e06c[_0x0657('0x51')]});_0x4c5d52=_[_0x0657('0x3c')]({},_0x4c5d52,_0x3d174a[_0x0657('0x3d')]);return db[_0x0657('0x50')][_0x0657('0x52')](_0x4c5d52)[_0x0657('0x20')](respondWithFilteredResult(_0x133023,_0x4c5d52));})[_0x0657('0x41')](handleError(_0x133023,null));}; \ No newline at end of file +var _0xac3e=['zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','update','then','destroy','get','Voicemails','UserProfileResource','error','stack','name','send','index','VoiceMail','rawAttributes','keys','query','attributes','intersection','model','fields','length','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','findOne','VoiceMailMessage','hasOwnProperty','nolimit','mailbox','html-pdf','eml-format','rimraf'];(function(_0x23f8c6,_0x57418f){var _0x2b941b=function(_0x3b4fdb){while(--_0x3b4fdb){_0x23f8c6['push'](_0x23f8c6['shift']());}};_0x2b941b(++_0x57418f);}(_0xac3e,0xad));var _0xeac3=function(_0x1b6311,_0x42ec20){_0x1b6311=_0x1b6311-0x0;var _0x25aab6=_0xac3e[_0x1b6311];return _0x25aab6;};'use strict';var pdf=require(_0xeac3('0x0'));var emlformat=require(_0xeac3('0x1'));var rimraf=require(_0xeac3('0x2'));var zipdir=require(_0xeac3('0x3'));var jsonpatch=require(_0xeac3('0x4'));var rp=require(_0xeac3('0x5'));var moment=require(_0xeac3('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xeac3('0x7'));var sox=require(_0xeac3('0x8'));var csv=require(_0xeac3('0x9'));var ejs=require(_0xeac3('0xa'));var fs=require('fs');var _=require(_0xeac3('0xb'));var squel=require(_0xeac3('0xc'));var crypto=require(_0xeac3('0xd'));var jsforce=require(_0xeac3('0xe'));var deskjs=require(_0xeac3('0xf'));var toCsv=require('to-csv');var querystring=require(_0xeac3('0x10'));var Papa=require(_0xeac3('0x11'));var Redis=require(_0xeac3('0x12'));var authService=require(_0xeac3('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xeac3('0x14'));var logger=require(_0xeac3('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xeac3('0x16'))['db'];function respondWithStatusCode(_0x5e7ddd,_0x5c2a40){_0x5c2a40=_0x5c2a40||0xcc;return function(_0x43aec8){if(_0x43aec8){return _0x5e7ddd[_0xeac3('0x17')](_0x5c2a40);}return _0x5e7ddd['status'](_0x5c2a40)[_0xeac3('0x18')]();};}function respondWithResult(_0x527ec5,_0x221db2){_0x221db2=_0x221db2||0xc8;return function(_0x3d3b1a){if(_0x3d3b1a){return _0x527ec5[_0xeac3('0x19')](_0x221db2)[_0xeac3('0x1a')](_0x3d3b1a);}};}function respondWithFilteredResult(_0xb9a69b,_0x294c3c){return function(_0x4b7d60){if(_0x4b7d60){var _0x4e92df=_0x4b7d60[_0xeac3('0x1b')],_0x11d0a8=_0x294c3c[_0xeac3('0x1c')],_0x4b0233=_0x294c3c[_0xeac3('0x1c')]+_0x294c3c[_0xeac3('0x1d')],_0x32853a;if(_0x4b0233>=_0x4e92df){_0x4b0233=_0x4e92df;_0x32853a=0xc8;}else{_0x32853a=0xce;}_0xb9a69b[_0xeac3('0x19')](_0x32853a);return _0xb9a69b[_0xeac3('0x1e')](_0xeac3('0x1f'),_0x11d0a8+'-'+_0x4b0233+'/'+_0x4e92df)[_0xeac3('0x1a')](_0x4b7d60);}return null;};}function patchUpdates(_0x4c750b){return function(_0x594670){try{jsonpatch[_0xeac3('0x20')](_0x594670,_0x4c750b,!![]);}catch(_0x2108e5){return BPromise['reject'](_0x2108e5);}return _0x594670['save']();};}function saveUpdates(_0x5d3c38,_0x3c00fb){return function(_0x1d7e00){if(_0x1d7e00){return _0x1d7e00[_0xeac3('0x21')](_0x5d3c38)[_0xeac3('0x22')](function(_0x8e49fc){return _0x8e49fc;});}return null;};}function removeEntity(_0x718e53,_0x4b4ab6){return function(_0x1cbdf1){if(_0x1cbdf1){return _0x1cbdf1[_0xeac3('0x23')]()[_0xeac3('0x22')](function(){var _0x5aa95b=_0x1cbdf1[_0xeac3('0x24')]({'plain':!![]});var _0x45f7f7=_0xeac3('0x25');return db[_0xeac3('0x26')][_0xeac3('0x23')]({'where':{'type':_0x45f7f7,'resourceId':_0x5aa95b['id']}})[_0xeac3('0x22')](function(){return _0x1cbdf1;});})[_0xeac3('0x22')](function(){_0x718e53[_0xeac3('0x19')](0xcc)[_0xeac3('0x18')]();});}};}function handleEntityNotFound(_0x39b5a8,_0x32d153){return function(_0x4dabcb){if(!_0x4dabcb){_0x39b5a8[_0xeac3('0x17')](0x194);}return _0x4dabcb;};}function handleError(_0x585e38,_0x4ba604){_0x4ba604=_0x4ba604||0x1f4;return function(_0x46166c){logger[_0xeac3('0x27')](_0x46166c[_0xeac3('0x28')]);if(_0x46166c['name']){delete _0x46166c[_0xeac3('0x29')];}_0x585e38[_0xeac3('0x19')](_0x4ba604)[_0xeac3('0x2a')](_0x46166c);};}exports[_0xeac3('0x2b')]=function(_0x59439a,_0xbf976a){var _0x4438c0={},_0x5a906f={},_0x4c08da={'count':0x0,'rows':[]};var _0x4866e8=db[_0xeac3('0x2c')][_0xeac3('0x2d')];_0x5a906f['model']=_[_0xeac3('0x2e')](_0x4866e8);_0x5a906f[_0xeac3('0x2f')]=_[_0xeac3('0x2e')](_0x59439a['query']);_0x5a906f['filters']=_['intersection'](_0x5a906f['model'],_0x5a906f[_0xeac3('0x2f')]);_0x4438c0[_0xeac3('0x30')]=_[_0xeac3('0x31')](_0x5a906f[_0xeac3('0x32')],qs[_0xeac3('0x33')](_0x59439a[_0xeac3('0x2f')][_0xeac3('0x33')]));_0x4438c0['attributes']=_0x4438c0['attributes'][_0xeac3('0x34')]?_0x4438c0['attributes']:_0x5a906f[_0xeac3('0x32')];if(!_0x59439a[_0xeac3('0x2f')]['hasOwnProperty']('nolimit')){_0x4438c0[_0xeac3('0x1d')]=qs[_0xeac3('0x1d')](_0x59439a[_0xeac3('0x2f')]['limit']);_0x4438c0[_0xeac3('0x1c')]=qs[_0xeac3('0x1c')](_0x59439a[_0xeac3('0x2f')][_0xeac3('0x1c')]);}_0x4438c0[_0xeac3('0x35')]=qs[_0xeac3('0x36')](_0x59439a['query'][_0xeac3('0x36')]);_0x4438c0[_0xeac3('0x37')]=qs[_0xeac3('0x38')](_[_0xeac3('0x39')](_0x59439a[_0xeac3('0x2f')],_0x5a906f['filters']));if(_0x59439a[_0xeac3('0x2f')][_0xeac3('0x3a')]){_0x4438c0[_0xeac3('0x37')]=_[_0xeac3('0x3b')](_0x4438c0[_0xeac3('0x37')],{'$or':_[_0xeac3('0x3c')](_0x4866e8,function(_0xfa40dc){if(_0xfa40dc[_0xeac3('0x3d')][_0xeac3('0x3e')]!==_0xeac3('0x3f')){var _0x137bd5={};_0x137bd5[_0xfa40dc[_0xeac3('0x40')]]={'$like':'%'+_0x59439a[_0xeac3('0x2f')][_0xeac3('0x3a')]+'%'};return _0x137bd5;}})});}_0x4438c0=_[_0xeac3('0x3b')]({},_0x4438c0,_0x59439a[_0xeac3('0x41')]);var _0x39fb4e={'where':_0x4438c0[_0xeac3('0x37')]};return db[_0xeac3('0x2c')][_0xeac3('0x1b')](_0x39fb4e)['then'](function(_0x68de67){_0x4c08da[_0xeac3('0x1b')]=_0x68de67;if(_0x59439a[_0xeac3('0x2f')][_0xeac3('0x42')]){_0x4438c0[_0xeac3('0x43')]=[{'all':!![]}];}return db[_0xeac3('0x2c')][_0xeac3('0x44')](_0x4438c0);})['then'](function(_0x4e2f36){_0x4c08da[_0xeac3('0x45')]=_0x4e2f36;return _0x4c08da;})[_0xeac3('0x22')](respondWithFilteredResult(_0xbf976a,_0x4438c0))[_0xeac3('0x46')](handleError(_0xbf976a,null));};exports[_0xeac3('0x47')]=function(_0x36b75b,_0x2947f1){var _0xf88d47={'raw':!![],'where':{'id':_0x36b75b[_0xeac3('0x48')]['id']}},_0x28c755={};_0x28c755[_0xeac3('0x32')]=_[_0xeac3('0x2e')](db[_0xeac3('0x2c')][_0xeac3('0x2d')]);_0x28c755[_0xeac3('0x2f')]=_['keys'](_0x36b75b[_0xeac3('0x2f')]);_0x28c755['filters']=_[_0xeac3('0x31')](_0x28c755[_0xeac3('0x32')],_0x28c755[_0xeac3('0x2f')]);_0xf88d47[_0xeac3('0x30')]=_[_0xeac3('0x31')](_0x28c755['model'],qs[_0xeac3('0x33')](_0x36b75b[_0xeac3('0x2f')]['fields']));_0xf88d47[_0xeac3('0x30')]=_0xf88d47[_0xeac3('0x30')][_0xeac3('0x34')]?_0xf88d47[_0xeac3('0x30')]:_0x28c755[_0xeac3('0x32')];if(_0x36b75b[_0xeac3('0x2f')][_0xeac3('0x42')]){_0xf88d47['include']=[{'all':!![]}];}_0xf88d47=_[_0xeac3('0x3b')]({},_0xf88d47,_0x36b75b[_0xeac3('0x41')]);return db[_0xeac3('0x2c')]['find'](_0xf88d47)['then'](handleEntityNotFound(_0x2947f1,null))[_0xeac3('0x22')](respondWithResult(_0x2947f1,null))[_0xeac3('0x46')](handleError(_0x2947f1,null));};exports['create']=function(_0x108e71,_0x22491f){return db[_0xeac3('0x2c')][_0xeac3('0x49')](_0x108e71[_0xeac3('0x4a')],{})[_0xeac3('0x22')](function(_0x2294a4){var _0x3fab65=_0x108e71['user']['get']({'plain':!![]});if(!_0x3fab65)throw new Error(_0xeac3('0x4b'));if(_0x3fab65[_0xeac3('0x4c')]===_0xeac3('0x4d')){var _0x446782=_0x2294a4[_0xeac3('0x24')]({'plain':!![]});var _0x3cce75='Voicemails';return db[_0xeac3('0x4e')]['find']({'where':{'name':_0x3cce75,'userProfileId':_0x3fab65[_0xeac3('0x4f')]},'raw':!![]})[_0xeac3('0x22')](function(_0x662201){if(_0x662201&&_0x662201[_0xeac3('0x50')]===0x0){return db['UserProfileResource'][_0xeac3('0x49')]({'name':_0x446782[_0xeac3('0x29')],'resourceId':_0x446782['id'],'type':_0x662201[_0xeac3('0x29')],'sectionId':_0x662201['id']},{})[_0xeac3('0x22')](function(){return _0x2294a4;});}else{return _0x2294a4;}})[_0xeac3('0x46')](function(_0x339d25){logger[_0xeac3('0x27')](_0xeac3('0x51'),_0x339d25);throw _0x339d25;});}return _0x2294a4;})[_0xeac3('0x22')](respondWithResult(_0x22491f,0xc9))[_0xeac3('0x46')](handleError(_0x22491f,null));};exports[_0xeac3('0x21')]=function(_0x342440,_0x1f5843){if(_0x342440['body']['id']){delete _0x342440[_0xeac3('0x4a')]['id'];}return db[_0xeac3('0x2c')][_0xeac3('0x52')]({'where':{'id':_0x342440[_0xeac3('0x48')]['id']}})['then'](handleEntityNotFound(_0x1f5843,null))[_0xeac3('0x22')](saveUpdates(_0x342440[_0xeac3('0x4a')],null))['then'](respondWithResult(_0x1f5843,null))[_0xeac3('0x46')](handleError(_0x1f5843,null));};exports[_0xeac3('0x23')]=function(_0x1f6bab,_0x29b9a7){return db[_0xeac3('0x2c')][_0xeac3('0x52')]({'where':{'id':_0x1f6bab[_0xeac3('0x48')]['id']}})[_0xeac3('0x22')](handleEntityNotFound(_0x29b9a7,null))[_0xeac3('0x22')](removeEntity(_0x29b9a7,null))[_0xeac3('0x46')](handleError(_0x29b9a7,null));};exports['getMessages']=function(_0x2fcf64,_0x394ed7,_0x7c4d1e){return db[_0xeac3('0x2c')][_0xeac3('0x53')]({'where':{'id':_0x2fcf64['params']['id']}})[_0xeac3('0x22')](handleEntityNotFound(_0x394ed7,null))[_0xeac3('0x22')](function(_0x8e4fcb){var _0x433c64;var _0x4c102a={},_0x323278={};_0x323278[_0xeac3('0x32')]=_[_0xeac3('0x2e')](db[_0xeac3('0x54')][_0xeac3('0x2d')]);_0x323278[_0xeac3('0x2f')]=_[_0xeac3('0x2e')](_0x2fcf64[_0xeac3('0x2f')]);_0x323278[_0xeac3('0x38')]=_[_0xeac3('0x31')](_0x323278['model'],_0x323278[_0xeac3('0x2f')]);_0x4c102a[_0xeac3('0x30')]=_[_0xeac3('0x31')](_0x323278[_0xeac3('0x32')],qs['fields'](_0x2fcf64[_0xeac3('0x2f')][_0xeac3('0x33')]));_0x4c102a['attributes']=_0x4c102a[_0xeac3('0x30')]['length']?_0x4c102a[_0xeac3('0x30')]:_0x323278[_0xeac3('0x32')];if(!_0x2fcf64[_0xeac3('0x2f')][_0xeac3('0x55')](_0xeac3('0x56'))){_0x4c102a[_0xeac3('0x1d')]=qs['limit'](_0x2fcf64[_0xeac3('0x2f')][_0xeac3('0x1d')]);_0x4c102a[_0xeac3('0x1c')]=qs[_0xeac3('0x1c')](_0x2fcf64[_0xeac3('0x2f')][_0xeac3('0x1c')]);}_0x4c102a[_0xeac3('0x35')]=qs[_0xeac3('0x36')](_0x2fcf64[_0xeac3('0x2f')][_0xeac3('0x36')]);_0x4c102a['where']=qs[_0xeac3('0x38')](_[_0xeac3('0x39')](_0x2fcf64[_0xeac3('0x2f')],_0x323278[_0xeac3('0x38')]));if(_0x2fcf64[_0xeac3('0x2f')][_0xeac3('0x3a')]){_0x4c102a['where']=_['merge'](_0x4c102a[_0xeac3('0x37')],{'$or':_[_0xeac3('0x3c')](_0x4c102a[_0xeac3('0x30')],function(_0x50b3b2){var _0x4dbe7c={};_0x4dbe7c[_0x50b3b2]={'$like':'%'+_0x2fcf64[_0xeac3('0x2f')][_0xeac3('0x3a')]+'%'};return _0x4dbe7c;})});}_0x4c102a[_0xeac3('0x37')]=_[_0xeac3('0x3b')](_0x4c102a[_0xeac3('0x37')],{'mailboxuser':_0x8e4fcb[_0xeac3('0x57')]});_0x4c102a=_['merge']({},_0x4c102a,_0x2fcf64[_0xeac3('0x41')]);return db[_0xeac3('0x54')]['findAndCountAll'](_0x4c102a)[_0xeac3('0x22')](respondWithFilteredResult(_0x394ed7,_0x4c102a));})[_0xeac3('0x46')](handleError(_0x394ed7,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 94a9818..9c55ee3 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 _0xbaf5=['api','moment','rimraf','exports','define','voice_voicemail','mailbox_context','mailbox','context','util','../../config/logger'];(function(_0x50bfd9,_0x14b960){var _0x4b38fa=function(_0x3de690){while(--_0x3de690){_0x50bfd9['push'](_0x50bfd9['shift']());}};_0x4b38fa(++_0x14b960);}(_0xbaf5,0x195));var _0x5baf=function(_0x152bc1,_0x1d857c){_0x152bc1=_0x152bc1-0x0;var _0x3a84f5=_0xbaf5[_0x152bc1];return _0x3a84f5;};'use strict';var _=require('lodash');var util=require(_0x5baf('0x0'));var logger=require(_0x5baf('0x1'))(_0x5baf('0x2'));var moment=require(_0x5baf('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5baf('0x4'));var config=require('../../config/environment');var attributes=require('./voiceMail.attributes');module[_0x5baf('0x5')]=function(_0x38ffd0,_0x5575bb){return _0x38ffd0[_0x5baf('0x6')]('VoiceMail',attributes,{'tableName':_0x5baf('0x7'),'paranoid':![],'indexes':[{'name':_0x5baf('0x8'),'fields':[_0x5baf('0x9'),_0x5baf('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x75da=['rimraf','../../config/environment','./voiceMail.attributes','exports','define','voice_voicemail','mailbox_context','mailbox','context','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x10fe8a,_0x5a7cca){var _0x30d86b=function(_0x11b83a){while(--_0x11b83a){_0x10fe8a['push'](_0x10fe8a['shift']());}};_0x30d86b(++_0x5a7cca);}(_0x75da,0x16e));var _0xa75d=function(_0x218f4f,_0x5bd075){_0x218f4f=_0x218f4f-0x0;var _0x5ce4fe=_0x75da[_0x218f4f];return _0x5ce4fe;};'use strict';var _=require(_0xa75d('0x0'));var util=require(_0xa75d('0x1'));var logger=require(_0xa75d('0x2'))(_0xa75d('0x3'));var moment=require(_0xa75d('0x4'));var BPromise=require(_0xa75d('0x5'));var rp=require(_0xa75d('0x6'));var fs=require('fs');var path=require(_0xa75d('0x7'));var rimraf=require(_0xa75d('0x8'));var config=require(_0xa75d('0x9'));var attributes=require(_0xa75d('0xa'));module[_0xa75d('0xb')]=function(_0x320d32,_0x45e264){return _0x320d32[_0xa75d('0xc')]('VoiceMail',attributes,{'tableName':_0xa75d('0xd'),'paranoid':![],'indexes':[{'name':_0xa75d('0xe'),'fields':[_0xa75d('0xf'),_0xa75d('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index fe17de3..4b2d8fb 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 _0x93ac=['debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceMail,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','request','info','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x93ac,0xc6));var _0xc93a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x93ac[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc93a('0x0'));var util=require(_0xc93a('0x1'));var moment=require('moment');var BPromise=require(_0xc93a('0x2'));var rs=require(_0xc93a('0x3'));var fs=require('fs');var Redis=require(_0xc93a('0x4'));var db=require(_0xc93a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc93a('0x6'))('rpc');var config=require(_0xc93a('0x7'));var jayson=require(_0xc93a('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3974e1,_0x4846a0,_0x27307b){return new BPromise(function(_0x21db11,_0x293f77){return client[_0xc93a('0x9')](_0x3974e1,_0x27307b)['then'](function(_0x111002){logger[_0xc93a('0xa')]('VoiceMail,\x20%s,\x20%s',_0x4846a0,_0xc93a('0xb'));logger[_0xc93a('0xc')](_0xc93a('0xd'),_0x4846a0,_0xc93a('0xb'),JSON[_0xc93a('0xe')](_0x111002));if(_0x111002[_0xc93a('0xf')]){if(_0x111002['error'][_0xc93a('0x10')]===0x1f4){logger[_0xc93a('0xf')]('VoiceMail,\x20%s,\x20%s',_0x4846a0,_0x111002['error'][_0xc93a('0x11')]);return _0x293f77(_0x111002[_0xc93a('0xf')][_0xc93a('0x11')]);}logger[_0xc93a('0xf')](_0xc93a('0x12'),_0x4846a0,_0x111002[_0xc93a('0xf')][_0xc93a('0x11')]);return _0x21db11(_0x111002[_0xc93a('0xf')][_0xc93a('0x11')]);}else{logger['info']('VoiceMail,\x20%s,\x20%s',_0x4846a0,_0xc93a('0xb'));_0x21db11(_0x111002[_0xc93a('0x13')][_0xc93a('0x11')]);}})[_0xc93a('0x14')](function(_0x45b53a){logger['error'](_0xc93a('0x12'),_0x4846a0,_0x45b53a);_0x293f77(_0x45b53a);});});} \ No newline at end of file +var _0x1f40=['error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','VoiceMail,\x20%s,\x20%s','request\x20sent','VoiceMail,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xa506d7,_0x25dde2){var _0x2b24bf=function(_0x204fe6){while(--_0x204fe6){_0xa506d7['push'](_0xa506d7['shift']());}};_0x2b24bf(++_0x25dde2);}(_0x1f40,0x12f));var _0x01f4=function(_0x359b10,_0x1485b7){_0x359b10=_0x359b10-0x0;var _0x4c824d=_0x1f40[_0x359b10];return _0x4c824d;};'use strict';var _=require(_0x01f4('0x0'));var util=require(_0x01f4('0x1'));var moment=require(_0x01f4('0x2'));var BPromise=require(_0x01f4('0x3'));var rs=require(_0x01f4('0x4'));var fs=require('fs');var Redis=require(_0x01f4('0x5'));var db=require(_0x01f4('0x6'))['db'];var utils=require(_0x01f4('0x7'));var logger=require(_0x01f4('0x8'))(_0x01f4('0x9'));var config=require(_0x01f4('0xa'));var jayson=require(_0x01f4('0xb'));var client=jayson[_0x01f4('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x391728,_0x5b84a9,_0x45ca50){return new BPromise(function(_0x5697c1,_0x345b6c){return client[_0x01f4('0xd')](_0x391728,_0x45ca50)['then'](function(_0x59fbc9){logger[_0x01f4('0xe')](_0x01f4('0xf'),_0x5b84a9,_0x01f4('0x10'));logger['debug'](_0x01f4('0x11'),_0x5b84a9,_0x01f4('0x10'),JSON[_0x01f4('0x12')](_0x59fbc9));if(_0x59fbc9[_0x01f4('0x13')]){if(_0x59fbc9[_0x01f4('0x13')][_0x01f4('0x14')]===0x1f4){logger[_0x01f4('0x13')](_0x01f4('0xf'),_0x5b84a9,_0x59fbc9[_0x01f4('0x13')]['message']);return _0x345b6c(_0x59fbc9[_0x01f4('0x13')][_0x01f4('0x15')]);}logger[_0x01f4('0x13')](_0x01f4('0xf'),_0x5b84a9,_0x59fbc9[_0x01f4('0x13')][_0x01f4('0x15')]);return _0x5697c1(_0x59fbc9['error'][_0x01f4('0x15')]);}else{logger[_0x01f4('0xe')](_0x01f4('0xf'),_0x5b84a9,'request\x20sent');_0x5697c1(_0x59fbc9['result'][_0x01f4('0x15')]);}})[_0x01f4('0x16')](function(_0x1a489a){logger[_0x01f4('0x13')](_0x01f4('0xf'),_0x5b84a9,_0x1a489a);_0x345b6c(_0x1a489a);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 518c75c..2bd0f3e 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 _0x93c5=['get','isAuthenticated','index','/:id/download','download','post','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x4d7c88,_0x1c76d5){var _0x3e99c8=function(_0x3d7bad){while(--_0x3d7bad){_0x4d7c88['push'](_0x4d7c88['shift']());}};_0x3e99c8(++_0x1c76d5);}(_0x93c5,0x8a));var _0x593c=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x93c5[_0x513aa5];return _0x1a1a7c;};'use strict';var multer=require('multer');var util=require(_0x593c('0x0'));var path=require(_0x593c('0x1'));var timeout=require(_0x593c('0x2'));var express=require(_0x593c('0x3'));var router=express[_0x593c('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x593c('0x5'));var config=require('../../config/environment');var controller=require('./voiceMailMessage.controller');router[_0x593c('0x6')]('/',auth[_0x593c('0x7')](),controller[_0x593c('0x8')]);router['get']('/:id',auth[_0x593c('0x7')](),controller['show']);router[_0x593c('0x6')](_0x593c('0x9'),auth['isAuthenticated'](),controller[_0x593c('0xa')]);router[_0x593c('0xb')]('/',auth[_0x593c('0x7')](),controller['create']);router[_0x593c('0xc')](_0x593c('0xd'),auth[_0x593c('0x7')](),controller[_0x593c('0xe')]);router[_0x593c('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x593c('0x10')]);module[_0x593c('0x11')]=router; \ No newline at end of file +var _0x4d5f=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceMailMessage.controller','isAuthenticated','index','get','/:id','show','/:id/download','download','create'];(function(_0x64f962,_0x104d8e){var _0x2d11d5=function(_0x5217fb){while(--_0x5217fb){_0x64f962['push'](_0x64f962['shift']());}};_0x2d11d5(++_0x104d8e);}(_0x4d5f,0x82));var _0xf4d5=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x4d5f[_0x18ab2a];return _0x16dcee;};'use strict';var multer=require(_0xf4d5('0x0'));var util=require(_0xf4d5('0x1'));var path=require(_0xf4d5('0x2'));var timeout=require(_0xf4d5('0x3'));var express=require(_0xf4d5('0x4'));var router=express[_0xf4d5('0x5')]();var auth=require(_0xf4d5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf4d5('0x7'));var controller=require(_0xf4d5('0x8'));router['get']('/',auth[_0xf4d5('0x9')](),controller[_0xf4d5('0xa')]);router[_0xf4d5('0xb')](_0xf4d5('0xc'),auth[_0xf4d5('0x9')](),controller[_0xf4d5('0xd')]);router[_0xf4d5('0xb')](_0xf4d5('0xe'),auth[_0xf4d5('0x9')](),controller[_0xf4d5('0xf')]);router['post']('/',auth[_0xf4d5('0x9')](),controller[_0xf4d5('0x10')]);router['put'](_0xf4d5('0xc'),auth[_0xf4d5('0x9')](),controller[_0xf4d5('0x11')]);router[_0xf4d5('0x12')](_0xf4d5('0xc'),auth[_0xf4d5('0x9')](),controller[_0xf4d5('0x13')]);module[_0xf4d5('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 91214e3..45f75db 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 _0x7fc8=['INTEGER','STRING','BLOB','long','exports','VIRTUAL','getDataValue'];(function(_0x57b3f7,_0x5854ce){var _0xfed86c=function(_0x205a54){while(--_0x205a54){_0x57b3f7['push'](_0x57b3f7['shift']());}};_0xfed86c(++_0x5854ce);}(_0x7fc8,0xd6));var _0x87fc=function(_0x1e0237,_0x5456bd){_0x1e0237=_0x1e0237-0x0;var _0x2a68fa=_0x7fc8[_0x1e0237];return _0x2a68fa;};'use strict';var Sequelize=require('sequelize');module[_0x87fc('0x0')]={'name':{'type':Sequelize[_0x87fc('0x1')],'get':function(_0x3bbed6){return this[_0x87fc('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x87fc('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x87fc('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x87fc('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x87fc('0x4')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0x87fc('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x87fc('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x87fc('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0x87fc('0x5')](_0x87fc('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x87fc('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x87fc('0x4')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','allowNull':![]}}; \ No newline at end of file +var _0xb991=['exports','INTEGER','STRING','BLOB','long','TIMESTAMP','sequelize'];(function(_0x948b4c,_0x458526){var _0x11eec8=function(_0x2a5487){while(--_0x2a5487){_0x948b4c['push'](_0x948b4c['shift']());}};_0x11eec8(++_0x458526);}(_0xb991,0xb5));var _0x1b99=function(_0x9e0cb3,_0x9cd497){_0x9e0cb3=_0x9e0cb3-0x0;var _0x5926b7=_0xb991[_0x9e0cb3];return _0x5926b7;};'use strict';var Sequelize=require(_0x1b99('0x0'));module[_0x1b99('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x39f6f4){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0x1b99('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0x1b99('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x1b99('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x1b99('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x1b99('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x1b99('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x1b99('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x1b99('0x4')](_0x1b99('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x1b99('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x1b99('0x3')],'defaultValue':''},'stamp':{'type':_0x1b99('0x6'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 0e8c130..96f5f57 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 _0x7583=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','count','offset','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','VoiceMailMessage','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','params','rawAttributes','create','body','find','download','recording','msg_id','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','send'];(function(_0x1501b9,_0x4181c5){var _0x4c080b=function(_0x8ea476){while(--_0x8ea476){_0x1501b9['push'](_0x1501b9['shift']());}};_0x4c080b(++_0x4181c5);}(_0x7583,0x144));var _0x3758=function(_0x3f92bc,_0x482ad4){_0x3f92bc=_0x3f92bc-0x0;var _0xa15d20=_0x7583[_0x3f92bc];return _0xa15d20;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3758('0x0'));var rimraf=require(_0x3758('0x1'));var zipdir=require(_0x3758('0x2'));var jsonpatch=require(_0x3758('0x3'));var rp=require(_0x3758('0x4'));var moment=require(_0x3758('0x5'));var BPromise=require(_0x3758('0x6'));var Mustache=require(_0x3758('0x7'));var util=require(_0x3758('0x8'));var path=require(_0x3758('0x9'));var sox=require('sox');var csv=require(_0x3758('0xa'));var ejs=require(_0x3758('0xb'));var fs=require('fs');var _=require(_0x3758('0xc'));var squel=require(_0x3758('0xd'));var crypto=require('crypto');var jsforce=require(_0x3758('0xe'));var deskjs=require(_0x3758('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3758('0x10'));var qs=require(_0x3758('0x11'));var hardwareService=require(_0x3758('0x12'));var logger=require('../../config/logger')(_0x3758('0x13'));var utils=require(_0x3758('0x14'));var config=require(_0x3758('0x15'));var db=require(_0x3758('0x16'))['db'];function respondWithStatusCode(_0x67aca2,_0x111e8c){_0x111e8c=_0x111e8c||0xcc;return function(_0x580154){if(_0x580154){return _0x67aca2[_0x3758('0x17')](_0x111e8c);}return _0x67aca2['status'](_0x111e8c)[_0x3758('0x18')]();};}function respondWithResult(_0x4815a4,_0x1b0ad9){_0x1b0ad9=_0x1b0ad9||0xc8;return function(_0x4f2546){if(_0x4f2546){return _0x4815a4['status'](_0x1b0ad9)['json'](_0x4f2546);}};}function respondWithFilteredResult(_0x5d5959,_0xc20f82){return function(_0x4b67be){if(_0x4b67be){var _0x1075b1=_0x4b67be[_0x3758('0x19')],_0x46748c=_0xc20f82[_0x3758('0x1a')],_0x461509=_0xc20f82[_0x3758('0x1a')]+_0xc20f82[_0x3758('0x1b')],_0x5a6a54;if(_0x461509>=_0x1075b1){_0x461509=_0x1075b1;_0x5a6a54=0xc8;}else{_0x5a6a54=0xce;}_0x5d5959[_0x3758('0x1c')](_0x5a6a54);return _0x5d5959[_0x3758('0x1d')](_0x3758('0x1e'),_0x46748c+'-'+_0x461509+'/'+_0x1075b1)['json'](_0x4b67be);}return null;};}function patchUpdates(_0x353e14){return function(_0x5f47f0){try{jsonpatch[_0x3758('0x1f')](_0x5f47f0,_0x353e14,!![]);}catch(_0x5ce207){return BPromise[_0x3758('0x20')](_0x5ce207);}return _0x5f47f0[_0x3758('0x21')]();};}function saveUpdates(_0x4aff88,_0x10f720){return function(_0x1cfe99){if(_0x1cfe99){return _0x1cfe99[_0x3758('0x22')](_0x4aff88)[_0x3758('0x23')](function(_0x4ce81e){return _0x4ce81e;});}return null;};}function removeEntity(_0x11de8d,_0x3c190d){return function(_0x54d769){if(_0x54d769){return _0x54d769[_0x3758('0x24')]()[_0x3758('0x23')](function(){_0x11de8d['status'](0xcc)[_0x3758('0x18')]();});}};}function handleEntityNotFound(_0xee4b15,_0x35dd52){return function(_0x361673){if(!_0x361673){_0xee4b15[_0x3758('0x17')](0x194);}return _0x361673;};}function handleError(_0x5a6da1,_0x32f72f){_0x32f72f=_0x32f72f||0x1f4;return function(_0x9c03e2){logger[_0x3758('0x25')](_0x9c03e2[_0x3758('0x26')]);if(_0x9c03e2[_0x3758('0x27')]){delete _0x9c03e2[_0x3758('0x27')];}_0x5a6da1[_0x3758('0x1c')](_0x32f72f)['send'](_0x9c03e2);};}exports[_0x3758('0x28')]=function(_0x57181f,_0x55ea9d){var _0x59bb95={},_0x1b50ac={},_0x12d41e={'count':0x0,'rows':[]};var _0x42d340=db[_0x3758('0x29')]['rawAttributes'];_0x1b50ac[_0x3758('0x2a')]=_['differenceBy'](_['keys'](_0x42d340),['name']);_0x1b50ac[_0x3758('0x2b')]=_[_0x3758('0x2c')](_0x57181f['query']);_0x1b50ac[_0x3758('0x2d')]=_[_0x3758('0x2e')](_0x1b50ac[_0x3758('0x2a')],_0x1b50ac[_0x3758('0x2b')]);_0x59bb95[_0x3758('0x2f')]=_[_0x3758('0x2e')](_0x1b50ac[_0x3758('0x2a')],qs[_0x3758('0x30')](_0x57181f[_0x3758('0x2b')][_0x3758('0x30')]));_0x59bb95[_0x3758('0x2f')]=_0x59bb95[_0x3758('0x2f')][_0x3758('0x31')]?_0x59bb95[_0x3758('0x2f')]:_0x1b50ac[_0x3758('0x2a')];if(!_0x57181f[_0x3758('0x2b')]['hasOwnProperty'](_0x3758('0x32'))){_0x59bb95[_0x3758('0x1b')]=qs[_0x3758('0x1b')](_0x57181f[_0x3758('0x2b')][_0x3758('0x1b')]);_0x59bb95[_0x3758('0x1a')]=qs[_0x3758('0x1a')](_0x57181f[_0x3758('0x2b')][_0x3758('0x1a')]);}_0x59bb95[_0x3758('0x33')]=qs['sort'](_0x57181f[_0x3758('0x2b')][_0x3758('0x34')]);_0x59bb95[_0x3758('0x35')]=qs['filters'](_['pick'](_0x57181f[_0x3758('0x2b')],_0x1b50ac[_0x3758('0x2d')]));if(_0x57181f[_0x3758('0x2b')][_0x3758('0x36')]){_0x59bb95[_0x3758('0x35')]=_[_0x3758('0x37')](_0x59bb95['where'],{'$or':_['map'](_0x42d340,function(_0x2c6141){if(_0x2c6141['type'][_0x3758('0x38')]!==_0x3758('0x39')){var _0x486c89={};_0x486c89[_0x2c6141[_0x3758('0x3a')]]={'$like':'%'+_0x57181f[_0x3758('0x2b')][_0x3758('0x36')]+'%'};return _0x486c89;}})});}_0x59bb95=_[_0x3758('0x37')]({},_0x59bb95,_0x57181f[_0x3758('0x3b')]);var _0x1b47b2={'where':_0x59bb95[_0x3758('0x35')]};return db['VoiceMailMessage']['count'](_0x1b47b2)[_0x3758('0x23')](function(_0x25b84d){_0x12d41e[_0x3758('0x19')]=_0x25b84d;if(_0x57181f[_0x3758('0x2b')][_0x3758('0x3c')]){_0x59bb95[_0x3758('0x3d')]=[{'all':!![]}];}return db[_0x3758('0x29')][_0x3758('0x3e')](_0x59bb95);})['then'](function(_0x3427fc){_0x12d41e[_0x3758('0x3f')]=_0x3427fc;return _0x12d41e;})[_0x3758('0x23')](respondWithFilteredResult(_0x55ea9d,_0x59bb95))[_0x3758('0x40')](handleError(_0x55ea9d,null));};exports['show']=function(_0x55a0c5,_0x24ee20){var _0x5eebc6={'raw':!![],'where':{'id':_0x55a0c5[_0x3758('0x41')]['id']}},_0x313c35={};_0x313c35[_0x3758('0x2a')]=_[_0x3758('0x2c')](db[_0x3758('0x29')][_0x3758('0x42')]);_0x313c35[_0x3758('0x2b')]=_[_0x3758('0x2c')](_0x55a0c5[_0x3758('0x2b')]);_0x313c35[_0x3758('0x2d')]=_[_0x3758('0x2e')](_0x313c35[_0x3758('0x2a')],_0x313c35['query']);_0x5eebc6[_0x3758('0x2f')]=_[_0x3758('0x2e')](_0x313c35[_0x3758('0x2a')],qs['fields'](_0x55a0c5['query']['fields']));_0x5eebc6['attributes']=_0x5eebc6[_0x3758('0x2f')][_0x3758('0x31')]?_0x5eebc6[_0x3758('0x2f')]:_0x313c35[_0x3758('0x2a')];if(_0x55a0c5['query'][_0x3758('0x3c')]){_0x5eebc6[_0x3758('0x3d')]=[{'all':!![]}];}_0x5eebc6=_[_0x3758('0x37')]({},_0x5eebc6,_0x55a0c5[_0x3758('0x3b')]);return db[_0x3758('0x29')]['find'](_0x5eebc6)[_0x3758('0x23')](handleEntityNotFound(_0x24ee20,null))[_0x3758('0x23')](respondWithResult(_0x24ee20,null))[_0x3758('0x40')](handleError(_0x24ee20,null));};exports[_0x3758('0x43')]=function(_0x2de602,_0x441338){return db[_0x3758('0x29')][_0x3758('0x43')](_0x2de602['body'],{})[_0x3758('0x23')](respondWithResult(_0x441338,0xc9))[_0x3758('0x40')](handleError(_0x441338,null));};exports[_0x3758('0x22')]=function(_0x41919a,_0x3e4179){if(_0x41919a[_0x3758('0x44')]['id']){delete _0x41919a[_0x3758('0x44')]['id'];}return db[_0x3758('0x29')][_0x3758('0x45')]({'where':{'id':_0x41919a[_0x3758('0x41')]['id']}})[_0x3758('0x23')](handleEntityNotFound(_0x3e4179,null))[_0x3758('0x23')](saveUpdates(_0x41919a['body'],null))[_0x3758('0x23')](respondWithResult(_0x3e4179,null))['catch'](handleError(_0x3e4179,null));};exports[_0x3758('0x24')]=function(_0x2f5083,_0x101275){return db[_0x3758('0x29')][_0x3758('0x45')]({'where':{'id':_0x2f5083['params']['id']}})[_0x3758('0x23')](handleEntityNotFound(_0x101275,null))[_0x3758('0x23')](removeEntity(_0x101275,null))[_0x3758('0x40')](handleError(_0x101275,null));};exports[_0x3758('0x46')]=function(_0x3b60c2,_0x1e2e9e,_0x213381){return db['VoiceMailMessage'][_0x3758('0x45')]({'where':{'id':_0x3b60c2[_0x3758('0x41')]['id']},'attributes':['id',_0x3758('0x47'),_0x3758('0x48')]})[_0x3758('0x23')](handleEntityNotFound(_0x1e2e9e,null))[_0x3758('0x23')](function(_0x11728a){if(_0x11728a){if(!_0x11728a[_0x3758('0x47')]){throw new db['Sequelize'][(_0x3758('0x49'))](_0x3758('0x4a'));}var _0x5779b7={'Content-Type':_0x3758('0x4b'),'Content-Disposition':_0x3758('0x4c')};if(_0x11728a['msg_id']){_0x5779b7[_0x3758('0x4d')]=_0x3758('0x4e')+_0x11728a[_0x3758('0x48')]+_0x3758('0x4f');}_0x1e2e9e[_0x3758('0x1d')](_0x5779b7);return _0x1e2e9e[_0x3758('0x50')](new Buffer(_0x11728a['recording']));}})[_0x3758('0x40')](handleError(_0x1e2e9e,null));}; \ No newline at end of file +var _0x86bf=['html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','model','differenceBy','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','offset','sort','where','pick','merge','map','VIRTUAL','field','filter','options','VoiceMailMessage','includeAll','include','findAll','rows','show','params','rawAttributes','length','find','catch','create','body','download','recording','Sequelize','VoiceMailMessage\x20not\x20found','attachment','attachment;\x20filename=\x22','.wav\x22'];(function(_0x346339,_0x308879){var _0x3b2786=function(_0x31c737){while(--_0x31c737){_0x346339['push'](_0x346339['shift']());}};_0x3b2786(++_0x308879);}(_0x86bf,0xa2));var _0xf86b=function(_0x8b4a5c,_0x4c404c){_0x8b4a5c=_0x8b4a5c-0x0;var _0xb0b1a3=_0x86bf[_0x8b4a5c];return _0xb0b1a3;};'use strict';var pdf=require(_0xf86b('0x0'));var emlformat=require(_0xf86b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xf86b('0x2'));var jsonpatch=require(_0xf86b('0x3'));var rp=require(_0xf86b('0x4'));var moment=require('moment');var BPromise=require(_0xf86b('0x5'));var Mustache=require('mustache');var util=require(_0xf86b('0x6'));var path=require(_0xf86b('0x7'));var sox=require(_0xf86b('0x8'));var csv=require(_0xf86b('0x9'));var ejs=require(_0xf86b('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf86b('0xb'));var crypto=require('crypto');var jsforce=require(_0xf86b('0xc'));var deskjs=require(_0xf86b('0xd'));var toCsv=require(_0xf86b('0x9'));var querystring=require(_0xf86b('0xe'));var Papa=require(_0xf86b('0xf'));var Redis=require(_0xf86b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf86b('0x11'));var hardwareService=require(_0xf86b('0x12'));var logger=require(_0xf86b('0x13'))(_0xf86b('0x14'));var utils=require(_0xf86b('0x15'));var config=require(_0xf86b('0x16'));var db=require(_0xf86b('0x17'))['db'];function respondWithStatusCode(_0x3ce3e5,_0xc6cbcc){_0xc6cbcc=_0xc6cbcc||0xcc;return function(_0x5a5d8c){if(_0x5a5d8c){return _0x3ce3e5[_0xf86b('0x18')](_0xc6cbcc);}return _0x3ce3e5[_0xf86b('0x19')](_0xc6cbcc)[_0xf86b('0x1a')]();};}function respondWithResult(_0x2b8f92,_0x105a34){_0x105a34=_0x105a34||0xc8;return function(_0x1e4af7){if(_0x1e4af7){return _0x2b8f92[_0xf86b('0x19')](_0x105a34)['json'](_0x1e4af7);}};}function respondWithFilteredResult(_0xbc7efb,_0x2d1527){return function(_0x2839e5){if(_0x2839e5){var _0x2c2f16=_0x2839e5[_0xf86b('0x1b')],_0x18abc8=_0x2d1527['offset'],_0x31ed8a=_0x2d1527['offset']+_0x2d1527[_0xf86b('0x1c')],_0x77f44a;if(_0x31ed8a>=_0x2c2f16){_0x31ed8a=_0x2c2f16;_0x77f44a=0xc8;}else{_0x77f44a=0xce;}_0xbc7efb[_0xf86b('0x19')](_0x77f44a);return _0xbc7efb[_0xf86b('0x1d')](_0xf86b('0x1e'),_0x18abc8+'-'+_0x31ed8a+'/'+_0x2c2f16)['json'](_0x2839e5);}return null;};}function patchUpdates(_0x57deb5){return function(_0xf80e8b){try{jsonpatch['apply'](_0xf80e8b,_0x57deb5,!![]);}catch(_0x211527){return BPromise[_0xf86b('0x1f')](_0x211527);}return _0xf80e8b[_0xf86b('0x20')]();};}function saveUpdates(_0x3cedd1,_0x3aa8a1){return function(_0x4015d2){if(_0x4015d2){return _0x4015d2[_0xf86b('0x21')](_0x3cedd1)[_0xf86b('0x22')](function(_0x289b9c){return _0x289b9c;});}return null;};}function removeEntity(_0xe157ad,_0x23fe70){return function(_0xeb9cc2){if(_0xeb9cc2){return _0xeb9cc2[_0xf86b('0x23')]()[_0xf86b('0x22')](function(){_0xe157ad[_0xf86b('0x19')](0xcc)[_0xf86b('0x1a')]();});}};}function handleEntityNotFound(_0x686e33,_0x4820f9){return function(_0x1ff5a3){if(!_0x1ff5a3){_0x686e33['sendStatus'](0x194);}return _0x1ff5a3;};}function handleError(_0x594b27,_0x33375a){_0x33375a=_0x33375a||0x1f4;return function(_0x133af3){logger[_0xf86b('0x24')](_0x133af3[_0xf86b('0x25')]);if(_0x133af3[_0xf86b('0x26')]){delete _0x133af3['name'];}_0x594b27['status'](_0x33375a)[_0xf86b('0x27')](_0x133af3);};}exports[_0xf86b('0x28')]=function(_0xdb56c0,_0x4d4cfa){var _0x350044={},_0x346d44={},_0x25ec6e={'count':0x0,'rows':[]};var _0x2cf5a3=db['VoiceMailMessage']['rawAttributes'];_0x346d44[_0xf86b('0x29')]=_[_0xf86b('0x2a')](_[_0xf86b('0x2b')](_0x2cf5a3),[_0xf86b('0x26')]);_0x346d44[_0xf86b('0x2c')]=_['keys'](_0xdb56c0[_0xf86b('0x2c')]);_0x346d44[_0xf86b('0x2d')]=_[_0xf86b('0x2e')](_0x346d44['model'],_0x346d44['query']);_0x350044['attributes']=_[_0xf86b('0x2e')](_0x346d44['model'],qs[_0xf86b('0x2f')](_0xdb56c0[_0xf86b('0x2c')]['fields']));_0x350044[_0xf86b('0x30')]=_0x350044[_0xf86b('0x30')]['length']?_0x350044['attributes']:_0x346d44[_0xf86b('0x29')];if(!_0xdb56c0['query'][_0xf86b('0x31')](_0xf86b('0x32'))){_0x350044[_0xf86b('0x1c')]=qs['limit'](_0xdb56c0[_0xf86b('0x2c')]['limit']);_0x350044['offset']=qs[_0xf86b('0x33')](_0xdb56c0[_0xf86b('0x2c')]['offset']);}_0x350044['order']=qs[_0xf86b('0x34')](_0xdb56c0[_0xf86b('0x2c')][_0xf86b('0x34')]);_0x350044[_0xf86b('0x35')]=qs['filters'](_[_0xf86b('0x36')](_0xdb56c0['query'],_0x346d44[_0xf86b('0x2d')]));if(_0xdb56c0[_0xf86b('0x2c')]['filter']){_0x350044[_0xf86b('0x35')]=_[_0xf86b('0x37')](_0x350044['where'],{'$or':_[_0xf86b('0x38')](_0x2cf5a3,function(_0x4f5ad1){if(_0x4f5ad1['type']['key']!==_0xf86b('0x39')){var _0x37f5db={};_0x37f5db[_0x4f5ad1[_0xf86b('0x3a')]]={'$like':'%'+_0xdb56c0['query'][_0xf86b('0x3b')]+'%'};return _0x37f5db;}})});}_0x350044=_[_0xf86b('0x37')]({},_0x350044,_0xdb56c0[_0xf86b('0x3c')]);var _0x43497e={'where':_0x350044[_0xf86b('0x35')]};return db[_0xf86b('0x3d')]['count'](_0x43497e)[_0xf86b('0x22')](function(_0x133c60){_0x25ec6e[_0xf86b('0x1b')]=_0x133c60;if(_0xdb56c0[_0xf86b('0x2c')][_0xf86b('0x3e')]){_0x350044[_0xf86b('0x3f')]=[{'all':!![]}];}return db[_0xf86b('0x3d')][_0xf86b('0x40')](_0x350044);})[_0xf86b('0x22')](function(_0x1f0506){_0x25ec6e[_0xf86b('0x41')]=_0x1f0506;return _0x25ec6e;})['then'](respondWithFilteredResult(_0x4d4cfa,_0x350044))['catch'](handleError(_0x4d4cfa,null));};exports[_0xf86b('0x42')]=function(_0x39b398,_0x151191){var _0x5c9d57={'raw':!![],'where':{'id':_0x39b398[_0xf86b('0x43')]['id']}},_0x43b6e7={};_0x43b6e7['model']=_[_0xf86b('0x2b')](db['VoiceMailMessage'][_0xf86b('0x44')]);_0x43b6e7[_0xf86b('0x2c')]=_[_0xf86b('0x2b')](_0x39b398[_0xf86b('0x2c')]);_0x43b6e7[_0xf86b('0x2d')]=_[_0xf86b('0x2e')](_0x43b6e7[_0xf86b('0x29')],_0x43b6e7['query']);_0x5c9d57[_0xf86b('0x30')]=_['intersection'](_0x43b6e7[_0xf86b('0x29')],qs['fields'](_0x39b398[_0xf86b('0x2c')][_0xf86b('0x2f')]));_0x5c9d57[_0xf86b('0x30')]=_0x5c9d57[_0xf86b('0x30')][_0xf86b('0x45')]?_0x5c9d57[_0xf86b('0x30')]:_0x43b6e7[_0xf86b('0x29')];if(_0x39b398[_0xf86b('0x2c')][_0xf86b('0x3e')]){_0x5c9d57[_0xf86b('0x3f')]=[{'all':!![]}];}_0x5c9d57=_[_0xf86b('0x37')]({},_0x5c9d57,_0x39b398[_0xf86b('0x3c')]);return db[_0xf86b('0x3d')][_0xf86b('0x46')](_0x5c9d57)['then'](handleEntityNotFound(_0x151191,null))[_0xf86b('0x22')](respondWithResult(_0x151191,null))[_0xf86b('0x47')](handleError(_0x151191,null));};exports[_0xf86b('0x48')]=function(_0x372716,_0x4c76cf){return db['VoiceMailMessage'][_0xf86b('0x48')](_0x372716[_0xf86b('0x49')],{})[_0xf86b('0x22')](respondWithResult(_0x4c76cf,0xc9))[_0xf86b('0x47')](handleError(_0x4c76cf,null));};exports[_0xf86b('0x21')]=function(_0x310051,_0x743271){if(_0x310051['body']['id']){delete _0x310051[_0xf86b('0x49')]['id'];}return db[_0xf86b('0x3d')]['find']({'where':{'id':_0x310051[_0xf86b('0x43')]['id']}})[_0xf86b('0x22')](handleEntityNotFound(_0x743271,null))['then'](saveUpdates(_0x310051['body'],null))[_0xf86b('0x22')](respondWithResult(_0x743271,null))['catch'](handleError(_0x743271,null));};exports[_0xf86b('0x23')]=function(_0x143259,_0x52b282){return db[_0xf86b('0x3d')][_0xf86b('0x46')]({'where':{'id':_0x143259[_0xf86b('0x43')]['id']}})[_0xf86b('0x22')](handleEntityNotFound(_0x52b282,null))[_0xf86b('0x22')](removeEntity(_0x52b282,null))['catch'](handleError(_0x52b282,null));};exports[_0xf86b('0x4a')]=function(_0x2dd535,_0x34dcaa,_0x4fed05){return db['VoiceMailMessage']['find']({'where':{'id':_0x2dd535['params']['id']},'attributes':['id','recording','msg_id']})[_0xf86b('0x22')](handleEntityNotFound(_0x34dcaa,null))[_0xf86b('0x22')](function(_0x52ea9e){if(_0x52ea9e){if(!_0x52ea9e[_0xf86b('0x4b')]){throw new db[(_0xf86b('0x4c'))]['ValidationError'](_0xf86b('0x4d'));}var _0x249270={'Content-Type':'audio/wav','Content-Disposition':_0xf86b('0x4e')};if(_0x52ea9e['msg_id']){_0x249270['Content-Disposition']=_0xf86b('0x4f')+_0x52ea9e['msg_id']+_0xf86b('0x50');}_0x34dcaa[_0xf86b('0x1d')](_0x249270);return _0x34dcaa[_0xf86b('0x27')](new Buffer(_0x52ea9e[_0xf86b('0x4b')]));}})[_0xf86b('0x47')](handleError(_0x34dcaa,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 4dfe77a..d1fd682 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 _0x66df=['./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x388646,_0x46f9b2){var _0x236a0d=function(_0x10f514){while(--_0x10f514){_0x388646['push'](_0x388646['shift']());}};_0x236a0d(++_0x46f9b2);}(_0x66df,0x68));var _0xf66d=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x66df[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0xf66d('0x0'));var util=require(_0xf66d('0x1'));var logger=require(_0xf66d('0x2'))(_0xf66d('0x3'));var moment=require(_0xf66d('0x4'));var BPromise=require('bluebird');var rp=require(_0xf66d('0x5'));var fs=require('fs');var path=require(_0xf66d('0x6'));var rimraf=require(_0xf66d('0x7'));var config=require('../../config/environment');var attributes=require(_0xf66d('0x8'));module[_0xf66d('0x9')]=function(_0x3931a8,_0x8c1eb1){return _0x3931a8[_0xf66d('0xa')](_0xf66d('0xb'),attributes,{'tableName':_0xf66d('0xc'),'paranoid':![],'indexes':[{'name':_0xf66d('0xd'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file +var _0x6be2=['util','moment','bluebird','path','rimraf','../../config/environment','./voiceMailMessage.attributes','VoiceMailMessage','voice_voicemail_messages','dir','lodash'];(function(_0x587dd0,_0x273922){var _0x56f153=function(_0x27fb33){while(--_0x27fb33){_0x587dd0['push'](_0x587dd0['shift']());}};_0x56f153(++_0x273922);}(_0x6be2,0x83));var _0x26be=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6be2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x26be('0x0'));var util=require(_0x26be('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x26be('0x2'));var BPromise=require(_0x26be('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x26be('0x4'));var rimraf=require(_0x26be('0x5'));var config=require(_0x26be('0x6'));var attributes=require(_0x26be('0x7'));module['exports']=function(_0x33cc3d,_0x1f3c23){return _0x33cc3d['define'](_0x26be('0x8'),attributes,{'tableName':_0x26be('0x9'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0x26be('0xa')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 07cc2c3..e9e5912 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 _0x24fa=['rpc','jayson/promise','client','http','info','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code','VoiceMailMessage,\x20%s,\x20%s','message','result','catch','lodash','util','../../mysqldb'];(function(_0x27d193,_0x1c9865){var _0x5f5ac7=function(_0x46a724){while(--_0x46a724){_0x27d193['push'](_0x27d193['shift']());}};_0x5f5ac7(++_0x1c9865);}(_0x24fa,0xad));var _0xa24f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x24fa[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xa24f('0x0'));var util=require(_0xa24f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa24f('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa24f('0x3'));var config=require('../../config/environment');var jayson=require(_0xa24f('0x4'));var client=jayson[_0xa24f('0x5')][_0xa24f('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5e108e,_0x1b1674,_0x33252f){return new BPromise(function(_0x2e03b3,_0x2e16d9){return client['request'](_0x5e108e,_0x33252f)['then'](function(_0xec1b62){logger[_0xa24f('0x7')]('VoiceMailMessage,\x20%s,\x20%s',_0x1b1674,_0xa24f('0x8'));logger['debug'](_0xa24f('0x9'),_0x1b1674,_0xa24f('0x8'),JSON['stringify'](_0xec1b62));if(_0xec1b62['error']){if(_0xec1b62[_0xa24f('0xa')][_0xa24f('0xb')]===0x1f4){logger[_0xa24f('0xa')](_0xa24f('0xc'),_0x1b1674,_0xec1b62[_0xa24f('0xa')][_0xa24f('0xd')]);return _0x2e16d9(_0xec1b62[_0xa24f('0xa')][_0xa24f('0xd')]);}logger['error'](_0xa24f('0xc'),_0x1b1674,_0xec1b62[_0xa24f('0xa')][_0xa24f('0xd')]);return _0x2e03b3(_0xec1b62[_0xa24f('0xa')]['message']);}else{logger[_0xa24f('0x7')]('VoiceMailMessage,\x20%s,\x20%s',_0x1b1674,_0xa24f('0x8'));_0x2e03b3(_0xec1b62[_0xa24f('0xe')]['message']);}})[_0xa24f('0xf')](function(_0x8eb13e){logger[_0xa24f('0xa')]('VoiceMailMessage,\x20%s,\x20%s',_0x1b1674,_0x8eb13e);_0x2e16d9(_0x8eb13e);});});} \ No newline at end of file +var _0xf2bc=['../../config/utils','rpc','../../config/environment','client','request','then','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf2bc,0x1f3));var _0xcf2b=function(_0x5d89f2,_0x43a018){_0x5d89f2=_0x5d89f2-0x0;var _0x522838=_0xf2bc[_0x5d89f2];return _0x522838;};'use strict';var _=require(_0xcf2b('0x0'));var util=require(_0xcf2b('0x1'));var moment=require(_0xcf2b('0x2'));var BPromise=require(_0xcf2b('0x3'));var rs=require(_0xcf2b('0x4'));var fs=require('fs');var Redis=require(_0xcf2b('0x5'));var db=require(_0xcf2b('0x6'))['db'];var utils=require(_0xcf2b('0x7'));var logger=require('../../config/logger')(_0xcf2b('0x8'));var config=require(_0xcf2b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xcf2b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45a6e5,_0x3a338f,_0x55997e){return new BPromise(function(_0x463b9b,_0x37e3e4){return client[_0xcf2b('0xb')](_0x45a6e5,_0x55997e)[_0xcf2b('0xc')](function(_0x176170){logger['info'](_0xcf2b('0xd'),_0x3a338f,_0xcf2b('0xe'));logger['debug'](_0xcf2b('0xf'),_0x3a338f,_0xcf2b('0xe'),JSON[_0xcf2b('0x10')](_0x176170));if(_0x176170[_0xcf2b('0x11')]){if(_0x176170[_0xcf2b('0x11')][_0xcf2b('0x12')]===0x1f4){logger[_0xcf2b('0x11')]('VoiceMailMessage,\x20%s,\x20%s',_0x3a338f,_0x176170[_0xcf2b('0x11')][_0xcf2b('0x13')]);return _0x37e3e4(_0x176170[_0xcf2b('0x11')][_0xcf2b('0x13')]);}logger[_0xcf2b('0x11')](_0xcf2b('0xd'),_0x3a338f,_0x176170[_0xcf2b('0x11')][_0xcf2b('0x13')]);return _0x463b9b(_0x176170[_0xcf2b('0x11')][_0xcf2b('0x13')]);}else{logger[_0xcf2b('0x14')]('VoiceMailMessage,\x20%s,\x20%s',_0x3a338f,'request\x20sent');_0x463b9b(_0x176170[_0xcf2b('0x15')]['message']);}})[_0xcf2b('0x16')](function(_0xa6f2cd){logger[_0xcf2b('0x11')](_0xcf2b('0xd'),_0x3a338f,_0xa6f2cd);_0x37e3e4(_0xa6f2cd);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 3852abb..fab936f 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 _0x702d=['isAuthenticated','get','/:id','getSounds','post','create','/:id/sounds','addSound','put','update','delete','destroy','/:id/sounds/:id2','removeSound','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller'];(function(_0x34e69b,_0x5a1036){var _0x1a95f1=function(_0x18db01){while(--_0x18db01){_0x34e69b['push'](_0x34e69b['shift']());}};_0x1a95f1(++_0x5a1036);}(_0x702d,0x147));var _0xd702=function(_0x58ea84,_0x5440ad){_0x58ea84=_0x58ea84-0x0;var _0x31b569=_0x702d[_0x58ea84];return _0x31b569;};'use strict';var multer=require(_0xd702('0x0'));var util=require(_0xd702('0x1'));var path=require(_0xd702('0x2'));var timeout=require(_0xd702('0x3'));var express=require(_0xd702('0x4'));var router=express['Router']();var auth=require(_0xd702('0x5'));var interaction=require(_0xd702('0x6'));var config=require(_0xd702('0x7'));var controller=require(_0xd702('0x8'));router['get']('/',auth[_0xd702('0x9')](),controller['index']);router[_0xd702('0xa')](_0xd702('0xb'),auth[_0xd702('0x9')](),controller['show']);router[_0xd702('0xa')]('/:id/sounds',auth[_0xd702('0x9')](),controller[_0xd702('0xc')]);router[_0xd702('0xd')]('/',auth[_0xd702('0x9')](),controller[_0xd702('0xe')]);router[_0xd702('0xd')](_0xd702('0xf'),auth[_0xd702('0x9')](),controller[_0xd702('0x10')]);router[_0xd702('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xd702('0x12')]);router[_0xd702('0x13')](_0xd702('0xb'),auth['isAuthenticated'](),controller[_0xd702('0x14')]);router[_0xd702('0x13')](_0xd702('0x15'),auth[_0xd702('0x9')](),controller[_0xd702('0x16')]);module[_0xd702('0x17')]=router; \ No newline at end of file +var _0x5ff3=['removeSound','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/sounds','getSounds','post','put','delete','destroy','/:id/sounds/:id2'];(function(_0x333dcf,_0x1b1a33){var _0x51105d=function(_0x532408){while(--_0x532408){_0x333dcf['push'](_0x333dcf['shift']());}};_0x51105d(++_0x1b1a33);}(_0x5ff3,0x17d));var _0x35ff=function(_0x305f4a,_0x17eeca){_0x305f4a=_0x305f4a-0x0;var _0x375bd7=_0x5ff3[_0x305f4a];return _0x375bd7;};'use strict';var multer=require('multer');var util=require(_0x35ff('0x0'));var path=require('path');var timeout=require(_0x35ff('0x1'));var express=require('express');var router=express[_0x35ff('0x2')]();var auth=require(_0x35ff('0x3'));var interaction=require(_0x35ff('0x4'));var config=require(_0x35ff('0x5'));var controller=require('./voiceMusicOnHold.controller');router[_0x35ff('0x6')]('/',auth[_0x35ff('0x7')](),controller[_0x35ff('0x8')]);router[_0x35ff('0x6')](_0x35ff('0x9'),auth['isAuthenticated'](),controller[_0x35ff('0xa')]);router['get'](_0x35ff('0xb'),auth[_0x35ff('0x7')](),controller[_0x35ff('0xc')]);router['post']('/',auth[_0x35ff('0x7')](),controller['create']);router[_0x35ff('0xd')](_0x35ff('0xb'),auth['isAuthenticated'](),controller['addSound']);router[_0x35ff('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x35ff('0xf')](_0x35ff('0x9'),auth[_0x35ff('0x7')](),controller[_0x35ff('0x10')]);router['delete'](_0x35ff('0x11'),auth[_0x35ff('0x7')](),controller[_0x35ff('0x12')]);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 e8cd532..6a7e0a0 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 _0xf542=['mp3','TIMESTAMP','BOOLEAN','exports','STRING','name','ENUM','custom','files','mp3nb','quietmp3nb','quietmp3'];(function(_0x92f299,_0x2d4553){var _0x194c8c=function(_0x28753b){while(--_0x28753b){_0x92f299['push'](_0x92f299['shift']());}};_0x194c8c(++_0x2d4553);}(_0xf542,0x7b));var _0x2f54=function(_0x50a8b0,_0x419fd6){_0x50a8b0=_0x50a8b0-0x0;var _0x48b9fd=_0xf542[_0x50a8b0];return _0x48b9fd;};'use strict';var Sequelize=require('sequelize');module[_0x2f54('0x0')]={'name':{'type':Sequelize[_0x2f54('0x1')],'allowNull':![],'unique':_0x2f54('0x2')},'mode':{'type':Sequelize[_0x2f54('0x3')](_0x2f54('0x4'),_0x2f54('0x5'),_0x2f54('0x6'),_0x2f54('0x7'),_0x2f54('0x8'),_0x2f54('0x9')),'allowNull':!![],'defaultValue':_0x2f54('0x5')},'directory':{'type':Sequelize[_0x2f54('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x2f54('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x2f54('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x2f54('0x1')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x2f54('0x1')],'allowNull':!![]},'stamp':{'type':_0x2f54('0xa')},'defaultEntry':{'type':Sequelize[_0x2f54('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8e74=['sequelize','exports','name','ENUM','custom','files','mp3nb','quietmp3nb','mp3','STRING','alpha','TIMESTAMP','BOOLEAN'];(function(_0xf033ec,_0x2bcf84){var _0x28bd7=function(_0x18bd25){while(--_0x18bd25){_0xf033ec['push'](_0xf033ec['shift']());}};_0x28bd7(++_0x2bcf84);}(_0x8e74,0x1c7));var _0x48e7=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0x8e74[_0x42bdad];return _0x122626;};'use strict';var Sequelize=require(_0x48e7('0x0'));module[_0x48e7('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x48e7('0x2')},'mode':{'type':Sequelize[_0x48e7('0x3')](_0x48e7('0x4'),_0x48e7('0x5'),_0x48e7('0x6'),_0x48e7('0x7'),'quietmp3',_0x48e7('0x8')),'allowNull':!![],'defaultValue':_0x48e7('0x5')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x48e7('0x9')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0x48e7('0x9')],'allowNull':!![],'defaultValue':_0x48e7('0xa')},'format':{'type':Sequelize[_0x48e7('0x9')],'allowNull':!![]},'stamp':{'type':_0x48e7('0xb')},'defaultEntry':{'type':Sequelize[_0x48e7('0xc')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index 8d3015e..6493edd 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 _0x8ad0=['field','options','count','include','findAll','catch','params','includeAll','body','find','create','sequelize','directory','join','root','server/files/moh','mode','mkdirSync','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','transaction','readdirSync','unlinkSync','rmdirSync','ValidationError','message','addSound','Sound','findOne','converted_format','createdAt','format','%s.%s','extname','Sequelize','id2','save_name','pick','getSounds','nolimit','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','set','Content-Range','reject','save','then','get','MusicOnHolds','destroy','error','stack','name','send','index','VoiceMusicOnHold','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','filter','merge','map','type','VIRTUAL'];(function(_0x3705c7,_0x3c2111){var _0x1362b1=function(_0x5f3a1c){while(--_0x5f3a1c){_0x3705c7['push'](_0x3705c7['shift']());}};_0x1362b1(++_0x3c2111);}(_0x8ad0,0xfa));var _0x08ad=function(_0x11cc63,_0x282674){_0x11cc63=_0x11cc63-0x0;var _0x397c95=_0x8ad0[_0x11cc63];return _0x397c95;};'use strict';var pdf=require(_0x08ad('0x0'));var emlformat=require(_0x08ad('0x1'));var rimraf=require(_0x08ad('0x2'));var zipdir=require(_0x08ad('0x3'));var jsonpatch=require(_0x08ad('0x4'));var rp=require('request-promise');var moment=require(_0x08ad('0x5'));var BPromise=require(_0x08ad('0x6'));var Mustache=require(_0x08ad('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x08ad('0x8'));var ejs=require(_0x08ad('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x08ad('0xa'));var jsforce=require(_0x08ad('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x08ad('0xc'));var Papa=require(_0x08ad('0xd'));var Redis=require(_0x08ad('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x08ad('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x08ad('0x10'))(_0x08ad('0x11'));var utils=require(_0x08ad('0x12'));var config=require(_0x08ad('0x13'));var db=require(_0x08ad('0x14'))['db'];function respondWithStatusCode(_0x1fd4b2,_0x4dba47){_0x4dba47=_0x4dba47||0xcc;return function(_0x5d480d){if(_0x5d480d){return _0x1fd4b2[_0x08ad('0x15')](_0x4dba47);}return _0x1fd4b2['status'](_0x4dba47)[_0x08ad('0x16')]();};}function respondWithResult(_0x12825e,_0x350201){_0x350201=_0x350201||0xc8;return function(_0x1052df){if(_0x1052df){return _0x12825e[_0x08ad('0x17')](_0x350201)[_0x08ad('0x18')](_0x1052df);}};}function respondWithFilteredResult(_0x5b141c,_0x265b2b){return function(_0x5c3306){if(_0x5c3306){var _0x28ec69=_0x5c3306['count'],_0x71c653=_0x265b2b['offset'],_0x2ceaa5=_0x265b2b[_0x08ad('0x19')]+_0x265b2b['limit'],_0x97ac88;if(_0x2ceaa5>=_0x28ec69){_0x2ceaa5=_0x28ec69;_0x97ac88=0xc8;}else{_0x97ac88=0xce;}_0x5b141c[_0x08ad('0x17')](_0x97ac88);return _0x5b141c[_0x08ad('0x1a')](_0x08ad('0x1b'),_0x71c653+'-'+_0x2ceaa5+'/'+_0x28ec69)['json'](_0x5c3306);}return null;};}function patchUpdates(_0x4b5294){return function(_0xed0dcd){try{jsonpatch['apply'](_0xed0dcd,_0x4b5294,!![]);}catch(_0x4aae98){return BPromise[_0x08ad('0x1c')](_0x4aae98);}return _0xed0dcd[_0x08ad('0x1d')]();};}function saveUpdates(_0x322d09,_0x206e8a){return function(_0x5255fd){if(_0x5255fd){return _0x5255fd['update'](_0x322d09)[_0x08ad('0x1e')](function(_0x23d8e7){return _0x23d8e7;});}return null;};}function removeEntity(_0x39112b,_0x52edac){return function(_0x385917){if(_0x385917){return _0x385917['destroy']()[_0x08ad('0x1e')](function(){var _0x2272d5=_0x385917[_0x08ad('0x1f')]({'plain':!![]});var _0x417f24=_0x08ad('0x20');return db['UserProfileResource'][_0x08ad('0x21')]({'where':{'type':_0x417f24,'resourceId':_0x2272d5['id']}})[_0x08ad('0x1e')](function(){return _0x385917;});})[_0x08ad('0x1e')](function(){_0x39112b['status'](0xcc)[_0x08ad('0x16')]();});}};}function handleEntityNotFound(_0x337196,_0x1335c2){return function(_0x419163){if(!_0x419163){_0x337196['sendStatus'](0x194);}return _0x419163;};}function handleError(_0x4a044e,_0x31edf8){_0x31edf8=_0x31edf8||0x1f4;return function(_0x4dc4bf){logger[_0x08ad('0x22')](_0x4dc4bf[_0x08ad('0x23')]);if(_0x4dc4bf['name']){delete _0x4dc4bf[_0x08ad('0x24')];}_0x4a044e['status'](_0x31edf8)[_0x08ad('0x25')](_0x4dc4bf);};}exports[_0x08ad('0x26')]=function(_0x19641a,_0x20781e){var _0x1d83a3={},_0x46da0c={},_0x4da2d0={'count':0x0,'rows':[]};var _0x32cea8=db[_0x08ad('0x27')][_0x08ad('0x28')];_0x46da0c[_0x08ad('0x29')]=_[_0x08ad('0x2a')](_0x32cea8);_0x46da0c[_0x08ad('0x2b')]=_[_0x08ad('0x2a')](_0x19641a[_0x08ad('0x2b')]);_0x46da0c[_0x08ad('0x2c')]=_[_0x08ad('0x2d')](_0x46da0c['model'],_0x46da0c[_0x08ad('0x2b')]);_0x1d83a3['attributes']=_['intersection'](_0x46da0c[_0x08ad('0x29')],qs['fields'](_0x19641a[_0x08ad('0x2b')][_0x08ad('0x2e')]));_0x1d83a3[_0x08ad('0x2f')]=_0x1d83a3['attributes'][_0x08ad('0x30')]?_0x1d83a3[_0x08ad('0x2f')]:_0x46da0c[_0x08ad('0x29')];if(!_0x19641a['query'][_0x08ad('0x31')]('nolimit')){_0x1d83a3[_0x08ad('0x32')]=qs[_0x08ad('0x32')](_0x19641a['query'][_0x08ad('0x32')]);_0x1d83a3['offset']=qs[_0x08ad('0x19')](_0x19641a[_0x08ad('0x2b')][_0x08ad('0x19')]);}_0x1d83a3[_0x08ad('0x33')]=qs[_0x08ad('0x34')](_0x19641a[_0x08ad('0x2b')]['sort']);_0x1d83a3[_0x08ad('0x35')]=qs[_0x08ad('0x2c')](_['pick'](_0x19641a[_0x08ad('0x2b')],_0x46da0c['filters']));if(_0x19641a[_0x08ad('0x2b')][_0x08ad('0x36')]){_0x1d83a3[_0x08ad('0x35')]=_[_0x08ad('0x37')](_0x1d83a3[_0x08ad('0x35')],{'$or':_[_0x08ad('0x38')](_0x32cea8,function(_0x4f8231){if(_0x4f8231[_0x08ad('0x39')]['key']!==_0x08ad('0x3a')){var _0x5d0ca7={};_0x5d0ca7[_0x4f8231[_0x08ad('0x3b')]]={'$like':'%'+_0x19641a[_0x08ad('0x2b')][_0x08ad('0x36')]+'%'};return _0x5d0ca7;}})});}_0x1d83a3=_['merge']({},_0x1d83a3,_0x19641a[_0x08ad('0x3c')]);var _0x2cf330={'where':_0x1d83a3[_0x08ad('0x35')]};return db[_0x08ad('0x27')][_0x08ad('0x3d')](_0x2cf330)[_0x08ad('0x1e')](function(_0x59488b){_0x4da2d0['count']=_0x59488b;if(_0x19641a[_0x08ad('0x2b')]['includeAll']){_0x1d83a3[_0x08ad('0x3e')]=[{'all':!![]}];}return db[_0x08ad('0x27')][_0x08ad('0x3f')](_0x1d83a3);})[_0x08ad('0x1e')](function(_0x190ab2){_0x4da2d0['rows']=_0x190ab2;return _0x4da2d0;})[_0x08ad('0x1e')](respondWithFilteredResult(_0x20781e,_0x1d83a3))[_0x08ad('0x40')](handleError(_0x20781e,null));};exports['show']=function(_0x503359,_0x443f38){var _0x205ddf={'raw':![],'where':{'id':_0x503359[_0x08ad('0x41')]['id']}},_0x54aa8c={};_0x54aa8c[_0x08ad('0x29')]=_[_0x08ad('0x2a')](db[_0x08ad('0x27')]['rawAttributes']);_0x54aa8c['query']=_[_0x08ad('0x2a')](_0x503359[_0x08ad('0x2b')]);_0x54aa8c[_0x08ad('0x2c')]=_[_0x08ad('0x2d')](_0x54aa8c['model'],_0x54aa8c[_0x08ad('0x2b')]);_0x205ddf[_0x08ad('0x2f')]=_[_0x08ad('0x2d')](_0x54aa8c[_0x08ad('0x29')],qs['fields'](_0x503359[_0x08ad('0x2b')][_0x08ad('0x2e')]));_0x205ddf['attributes']=_0x205ddf[_0x08ad('0x2f')][_0x08ad('0x30')]?_0x205ddf['attributes']:_0x54aa8c['model'];if(_0x503359[_0x08ad('0x2b')][_0x08ad('0x42')]){_0x205ddf['include']=[{'all':!![]}];}_0x205ddf=_['merge']({},_0x205ddf,_0x503359[_0x08ad('0x3c')]);return db[_0x08ad('0x27')]['find'](_0x205ddf)[_0x08ad('0x1e')](handleEntityNotFound(_0x443f38,null))[_0x08ad('0x1e')](respondWithResult(_0x443f38,null))[_0x08ad('0x40')](handleError(_0x443f38,null));};exports['update']=function(_0x3163fc,_0x390385){if(_0x3163fc[_0x08ad('0x43')]['id']){delete _0x3163fc[_0x08ad('0x43')]['id'];}return db[_0x08ad('0x27')][_0x08ad('0x44')]({'where':{'id':_0x3163fc[_0x08ad('0x41')]['id']}})[_0x08ad('0x1e')](handleEntityNotFound(_0x390385,null))[_0x08ad('0x1e')](saveUpdates(_0x3163fc[_0x08ad('0x43')],null))[_0x08ad('0x1e')](respondWithResult(_0x390385,null))[_0x08ad('0x40')](handleError(_0x390385,null));};exports[_0x08ad('0x45')]=function(_0xde267d,_0x55ad66,_0x288b86){return db[_0x08ad('0x46')]['transaction'](function(_0x309166){if(_0xde267d[_0x08ad('0x43')]['mode']==='files'){_0xde267d['body'][_0x08ad('0x47')]=path[_0x08ad('0x48')](config[_0x08ad('0x49')],_0x08ad('0x4a'),_0xde267d[_0x08ad('0x43')]['name']);}return db['VoiceMusicOnHold']['create'](_0xde267d[_0x08ad('0x43')],{'transaction':_0x309166})[_0x08ad('0x1e')](function(_0x375dcc){if(_0xde267d[_0x08ad('0x43')][_0x08ad('0x4b')]==='files'){fs[_0x08ad('0x4c')](_0x375dcc['directory'],parseInt('0777',0x8));}var _0x65ae56=_0xde267d[_0x08ad('0x4d')][_0x08ad('0x1f')]({'plain':!![]});if(!_0x65ae56)throw new Error(_0x08ad('0x4e'));if(_0x65ae56[_0x08ad('0x4f')]===_0x08ad('0x4d')){var _0x32d4c7=_0x375dcc[_0x08ad('0x1f')]({'plain':!![]});return db[_0x08ad('0x50')][_0x08ad('0x44')]({'where':{'name':_0x08ad('0x20'),'userProfileId':_0x65ae56['userProfileId']},'raw':!![]})[_0x08ad('0x1e')](function(_0x5d2a06){if(_0x5d2a06&&_0x5d2a06[_0x08ad('0x51')]===0x0){return db[_0x08ad('0x52')][_0x08ad('0x45')]({'name':_0x32d4c7['name'],'resourceId':_0x32d4c7['id'],'type':_0x5d2a06[_0x08ad('0x24')],'sectionId':_0x5d2a06['id']},{})['then'](function(){return _0x375dcc;});}else{return _0x375dcc;}})['catch'](function(_0x2c1641){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2c1641);});}return _0x375dcc;});})['then'](respondWithResult(_0x55ad66,0xc9))['catch'](handleError(_0x55ad66,null));};exports[_0x08ad('0x21')]=function(_0x86891f,_0x139f58,_0x3aebb8){var _0x1f3552;return db[_0x08ad('0x27')][_0x08ad('0x44')]({'where':{'id':_0x86891f['params']['id']}})[_0x08ad('0x1e')](function(_0x337441){if(_0x337441){return db[_0x08ad('0x46')][_0x08ad('0x53')](function(_0x139cf3){return _0x337441[_0x08ad('0x21')]({'transaction':_0x139cf3,'raw':!![]})[_0x08ad('0x1e')](function(_0x3f3cda){if(_0x3f3cda[_0x08ad('0x47')]){fs[_0x08ad('0x54')](_0x3f3cda[_0x08ad('0x47')])['forEach'](function(_0x2a5088){fs[_0x08ad('0x55')](path[_0x08ad('0x48')](_0x3f3cda[_0x08ad('0x47')],_0x2a5088));});fs[_0x08ad('0x56')](_0x3f3cda[_0x08ad('0x47')]);}return _0x3f3cda;});})['catch'](function(_0x444bc1){throw new db['Sequelize'][(_0x08ad('0x57'))](_0x444bc1[_0x08ad('0x58')]);});}})[_0x08ad('0x1e')](handleEntityNotFound(_0x139f58,null))[_0x08ad('0x1e')](removeEntity(_0x139f58,null))[_0x08ad('0x40')](handleError(_0x139f58,null));};exports[_0x08ad('0x59')]=function(_0x381bb5,_0x547963,_0x154a94){return db[_0x08ad('0x46')][_0x08ad('0x53')](function(_0x321834){var _0x315939;return db[_0x08ad('0x27')][_0x08ad('0x44')]({'where':{'id':_0x381bb5[_0x08ad('0x41')]['id']}})['then'](function(_0x148295){if(_0x148295){_0x315939=_0x148295;return _0x148295[_0x08ad('0x59')](_0x381bb5[_0x08ad('0x43')]['id'],{'transaction':_0x321834});}})[_0x08ad('0x1e')](function(_0x337e7c){if(_0x337e7c){return db[_0x08ad('0x5a')][_0x08ad('0x5b')]({'where':{'id':_0x381bb5[_0x08ad('0x43')]['id']},'attributes':['id','name','save_name',_0x08ad('0x5c'),_0x08ad('0x5d')],'raw':!![]});}})[_0x08ad('0x1e')](function(_0x19c7bc){if(_0x19c7bc){var _0x57749d=path[_0x08ad('0x48')](config[_0x08ad('0x49')],'server/files/sounds/converted',util[_0x08ad('0x5e')](_0x08ad('0x5f'),path['basename'](_0x19c7bc['save_name'],path[_0x08ad('0x60')](_0x19c7bc['save_name'])),_0x19c7bc[_0x08ad('0x5c')]));var _0x5f2328=path[_0x08ad('0x48')](config[_0x08ad('0x49')],_0x08ad('0x4a'),_0x315939[_0x08ad('0x24')],util['format']('%s.%s',_0x19c7bc[_0x08ad('0x24')],_0x19c7bc[_0x08ad('0x5c')]));fs['symlinkSync'](_0x57749d,_0x5f2328);return _0x19c7bc;}})[_0x08ad('0x40')](function(_0x5bf58a){throw new db[(_0x08ad('0x61'))]['ValidationError'](_0x5bf58a[_0x08ad('0x58')]);});})['then'](handleEntityNotFound(_0x547963,null))[_0x08ad('0x1e')](respondWithResult(_0x547963,0xc9))[_0x08ad('0x40')](handleError(_0x547963,null));};exports['removeSound']=function(_0x3f6122,_0x1855de,_0x5649cd){return db[_0x08ad('0x46')][_0x08ad('0x53')](function(_0x20d1ce){var _0x1db82e;return db[_0x08ad('0x27')][_0x08ad('0x5b')]({'where':{'id':_0x3f6122[_0x08ad('0x41')]['id']}})[_0x08ad('0x1e')](handleEntityNotFound(_0x1855de,null))[_0x08ad('0x1e')](function(_0xfb4754){if(_0xfb4754){_0x1db82e=_0xfb4754;return _0xfb4754['removeSound'](_0x3f6122[_0x08ad('0x41')][_0x08ad('0x62')]);}})[_0x08ad('0x1e')](function(_0xfcb50d){if(_0xfcb50d){return db[_0x08ad('0x5a')]['findOne']({'where':{'id':_0x3f6122['params'][_0x08ad('0x62')]},'attributes':['id','name',_0x08ad('0x63'),_0x08ad('0x5c'),'createdAt'],'raw':!![]});}})[_0x08ad('0x1e')](function(_0x2f1d35){if(_0x2f1d35){fs[_0x08ad('0x55')](path[_0x08ad('0x48')](_0x1db82e[_0x08ad('0x47')],util[_0x08ad('0x5e')](_0x08ad('0x5f'),_0x2f1d35['name'],_0x2f1d35['converted_format'])));return _0x2f1d35;}})[_0x08ad('0x40')](function(_0x398948){throw new db[(_0x08ad('0x61'))]['ValidationError'](_0x398948[_0x08ad('0x58')]);});})[_0x08ad('0x1e')](handleEntityNotFound(_0x1855de,null))[_0x08ad('0x1e')](respondWithStatusCode(_0x1855de,0xcc))[_0x08ad('0x40')](handleError(_0x1855de,null));};exports['getSounds']=function(_0x5ab293,_0x17ef12,_0x351241){var _0x3af898={};var _0xd93d2c={};var _0x40b73b;var _0x2cfcec;return db[_0x08ad('0x27')][_0x08ad('0x5b')]({'where':{'id':_0x5ab293[_0x08ad('0x41')]['id']}})[_0x08ad('0x1e')](handleEntityNotFound(_0x17ef12,null))[_0x08ad('0x1e')](function(_0x1f2be7){if(_0x1f2be7){_0x40b73b=_0x1f2be7;_0xd93d2c['model']=_['keys'](db[_0x08ad('0x5a')][_0x08ad('0x28')]);_0xd93d2c[_0x08ad('0x2b')]=_[_0x08ad('0x2a')](_0x5ab293['query']);_0xd93d2c[_0x08ad('0x2c')]=_[_0x08ad('0x2d')](_0xd93d2c['model'],_0xd93d2c[_0x08ad('0x2b')]);_0x3af898[_0x08ad('0x2f')]=_[_0x08ad('0x2d')](_0xd93d2c['model'],qs[_0x08ad('0x2e')](_0x5ab293[_0x08ad('0x2b')][_0x08ad('0x2e')]));_0x3af898[_0x08ad('0x2f')]=_0x3af898['attributes']['length']?_0x3af898[_0x08ad('0x2f')]:_0xd93d2c[_0x08ad('0x29')];_0x3af898[_0x08ad('0x33')]=qs[_0x08ad('0x34')](_0x5ab293['query'][_0x08ad('0x34')]);_0x3af898[_0x08ad('0x35')]=qs[_0x08ad('0x2c')](_[_0x08ad('0x64')](_0x5ab293[_0x08ad('0x2b')],_0xd93d2c[_0x08ad('0x2c')]));if(_0x5ab293[_0x08ad('0x2b')][_0x08ad('0x36')]){_0x3af898[_0x08ad('0x35')]=_[_0x08ad('0x37')](_0x3af898[_0x08ad('0x35')],{'$or':_['map'](_0x3af898[_0x08ad('0x2f')],function(_0x5c88d7){var _0x421fe1={};_0x421fe1[_0x5c88d7]={'$like':'%'+_0x5ab293[_0x08ad('0x2b')][_0x08ad('0x36')]+'%'};return _0x421fe1;})});}_0x3af898=_['merge']({},_0x3af898,_0x5ab293['options']);return _0x40b73b[_0x08ad('0x65')](_0x3af898);}})[_0x08ad('0x1e')](function(_0x5284ca){if(_0x5284ca){_0x2cfcec=_0x5284ca[_0x08ad('0x30')];if(!_0x5ab293[_0x08ad('0x2b')][_0x08ad('0x31')](_0x08ad('0x66'))){_0x3af898[_0x08ad('0x32')]=qs[_0x08ad('0x32')](_0x5ab293[_0x08ad('0x2b')][_0x08ad('0x32')]);_0x3af898[_0x08ad('0x19')]=qs[_0x08ad('0x19')](_0x5ab293[_0x08ad('0x2b')][_0x08ad('0x19')]);}return _0x40b73b[_0x08ad('0x65')](_0x3af898);}})[_0x08ad('0x1e')](function(_0x5c3955){if(_0x5c3955){return _0x5c3955?{'count':_0x2cfcec,'rows':_0x5c3955}:null;}})[_0x08ad('0x1e')](respondWithResult(_0x17ef12,null))[_0x08ad('0x40')](handleError(_0x17ef12,null));}; \ No newline at end of file +var _0x7dc0=['squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','stack','name','send','index','VoiceMusicOnHold','rawAttributes','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','map','key','options','count','includeAll','findAll','catch','params','include','find','body','create','sequelize','transaction','files','directory','join','root','server/files/moh','mkdirSync','user','role','UserProfileSection','userProfileId','autoAssociation','forEach','rmdirSync','Sequelize','message','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','id2','ValidationError','getSounds','order','sort','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs'];(function(_0x5b26cb,_0x527ab0){var _0x563d12=function(_0x472b38){while(--_0x472b38){_0x5b26cb['push'](_0x5b26cb['shift']());}};_0x563d12(++_0x527ab0);}(_0x7dc0,0x18f));var _0x07dc=function(_0x51cc1d,_0xaa88ae){_0x51cc1d=_0x51cc1d-0x0;var _0x2eb9f2=_0x7dc0[_0x51cc1d];return _0x2eb9f2;};'use strict';var pdf=require(_0x07dc('0x0'));var emlformat=require(_0x07dc('0x1'));var rimraf=require(_0x07dc('0x2'));var zipdir=require(_0x07dc('0x3'));var jsonpatch=require(_0x07dc('0x4'));var rp=require(_0x07dc('0x5'));var moment=require(_0x07dc('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x07dc('0x7'));var util=require(_0x07dc('0x8'));var path=require(_0x07dc('0x9'));var sox=require(_0x07dc('0xa'));var csv=require(_0x07dc('0xb'));var ejs=require(_0x07dc('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x07dc('0xd'));var crypto=require(_0x07dc('0xe'));var jsforce=require(_0x07dc('0xf'));var deskjs=require(_0x07dc('0x10'));var toCsv=require(_0x07dc('0xb'));var querystring=require('querystring');var Papa=require(_0x07dc('0x11'));var Redis=require('ioredis');var authService=require(_0x07dc('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x07dc('0x13'))(_0x07dc('0x14'));var utils=require(_0x07dc('0x15'));var config=require(_0x07dc('0x16'));var db=require(_0x07dc('0x17'))['db'];function respondWithStatusCode(_0x50b0be,_0x165fab){_0x165fab=_0x165fab||0xcc;return function(_0x437a8c){if(_0x437a8c){return _0x50b0be[_0x07dc('0x18')](_0x165fab);}return _0x50b0be['status'](_0x165fab)['end']();};}function respondWithResult(_0x134b9f,_0x1a80d9){_0x1a80d9=_0x1a80d9||0xc8;return function(_0x3a4307){if(_0x3a4307){return _0x134b9f['status'](_0x1a80d9)[_0x07dc('0x19')](_0x3a4307);}};}function respondWithFilteredResult(_0xf68613,_0x5faa2b){return function(_0x1fc98c){if(_0x1fc98c){var _0x44f208=_0x1fc98c['count'],_0x3abd96=_0x5faa2b[_0x07dc('0x1a')],_0x9d3a21=_0x5faa2b['offset']+_0x5faa2b[_0x07dc('0x1b')],_0xebdd9b;if(_0x9d3a21>=_0x44f208){_0x9d3a21=_0x44f208;_0xebdd9b=0xc8;}else{_0xebdd9b=0xce;}_0xf68613['status'](_0xebdd9b);return _0xf68613[_0x07dc('0x1c')](_0x07dc('0x1d'),_0x3abd96+'-'+_0x9d3a21+'/'+_0x44f208)['json'](_0x1fc98c);}return null;};}function patchUpdates(_0x3980ea){return function(_0x593dec){try{jsonpatch[_0x07dc('0x1e')](_0x593dec,_0x3980ea,!![]);}catch(_0x191ce4){return BPromise['reject'](_0x191ce4);}return _0x593dec[_0x07dc('0x1f')]();};}function saveUpdates(_0x48f263,_0xd5c004){return function(_0x5a76ac){if(_0x5a76ac){return _0x5a76ac[_0x07dc('0x20')](_0x48f263)[_0x07dc('0x21')](function(_0x4c6170){return _0x4c6170;});}return null;};}function removeEntity(_0x47d35a,_0x381664){return function(_0x597c){if(_0x597c){return _0x597c[_0x07dc('0x22')]()['then'](function(){var _0x4f2382=_0x597c[_0x07dc('0x23')]({'plain':!![]});var _0x2b9e90=_0x07dc('0x24');return db[_0x07dc('0x25')][_0x07dc('0x22')]({'where':{'type':_0x2b9e90,'resourceId':_0x4f2382['id']}})['then'](function(){return _0x597c;});})[_0x07dc('0x21')](function(){_0x47d35a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x20e079,_0x36011c){return function(_0x4c5f59){if(!_0x4c5f59){_0x20e079[_0x07dc('0x18')](0x194);}return _0x4c5f59;};}function handleError(_0x44d16d,_0x440f85){_0x440f85=_0x440f85||0x1f4;return function(_0x44404a){logger['error'](_0x44404a[_0x07dc('0x26')]);if(_0x44404a[_0x07dc('0x27')]){delete _0x44404a[_0x07dc('0x27')];}_0x44d16d['status'](_0x440f85)[_0x07dc('0x28')](_0x44404a);};}exports[_0x07dc('0x29')]=function(_0x1e7503,_0x5c1ec4){var _0x35db40={},_0x5833c8={},_0x3461ed={'count':0x0,'rows':[]};var _0x2bdb3e=db[_0x07dc('0x2a')][_0x07dc('0x2b')];_0x5833c8[_0x07dc('0x2c')]=_[_0x07dc('0x2d')](_0x2bdb3e);_0x5833c8['query']=_[_0x07dc('0x2d')](_0x1e7503['query']);_0x5833c8[_0x07dc('0x2e')]=_[_0x07dc('0x2f')](_0x5833c8['model'],_0x5833c8[_0x07dc('0x30')]);_0x35db40[_0x07dc('0x31')]=_[_0x07dc('0x2f')](_0x5833c8[_0x07dc('0x2c')],qs[_0x07dc('0x32')](_0x1e7503['query'][_0x07dc('0x32')]));_0x35db40['attributes']=_0x35db40[_0x07dc('0x31')][_0x07dc('0x33')]?_0x35db40['attributes']:_0x5833c8[_0x07dc('0x2c')];if(!_0x1e7503['query'][_0x07dc('0x34')](_0x07dc('0x35'))){_0x35db40['limit']=qs[_0x07dc('0x1b')](_0x1e7503[_0x07dc('0x30')][_0x07dc('0x1b')]);_0x35db40[_0x07dc('0x1a')]=qs[_0x07dc('0x1a')](_0x1e7503[_0x07dc('0x30')][_0x07dc('0x1a')]);}_0x35db40['order']=qs['sort'](_0x1e7503[_0x07dc('0x30')]['sort']);_0x35db40[_0x07dc('0x36')]=qs[_0x07dc('0x2e')](_[_0x07dc('0x37')](_0x1e7503[_0x07dc('0x30')],_0x5833c8[_0x07dc('0x2e')]));if(_0x1e7503['query'][_0x07dc('0x38')]){_0x35db40[_0x07dc('0x36')]=_[_0x07dc('0x39')](_0x35db40[_0x07dc('0x36')],{'$or':_[_0x07dc('0x3a')](_0x2bdb3e,function(_0x3adadf){if(_0x3adadf['type'][_0x07dc('0x3b')]!=='VIRTUAL'){var _0x3c587c={};_0x3c587c[_0x3adadf['field']]={'$like':'%'+_0x1e7503['query'][_0x07dc('0x38')]+'%'};return _0x3c587c;}})});}_0x35db40=_[_0x07dc('0x39')]({},_0x35db40,_0x1e7503[_0x07dc('0x3c')]);var _0x4b18e2={'where':_0x35db40['where']};return db['VoiceMusicOnHold'][_0x07dc('0x3d')](_0x4b18e2)['then'](function(_0x41061b){_0x3461ed[_0x07dc('0x3d')]=_0x41061b;if(_0x1e7503[_0x07dc('0x30')][_0x07dc('0x3e')]){_0x35db40['include']=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x07dc('0x3f')](_0x35db40);})['then'](function(_0x296479){_0x3461ed['rows']=_0x296479;return _0x3461ed;})[_0x07dc('0x21')](respondWithFilteredResult(_0x5c1ec4,_0x35db40))[_0x07dc('0x40')](handleError(_0x5c1ec4,null));};exports['show']=function(_0xf7a396,_0x1d8f0d){var _0x29cbf6={'raw':![],'where':{'id':_0xf7a396[_0x07dc('0x41')]['id']}},_0x54edb5={};_0x54edb5[_0x07dc('0x2c')]=_['keys'](db[_0x07dc('0x2a')][_0x07dc('0x2b')]);_0x54edb5[_0x07dc('0x30')]=_[_0x07dc('0x2d')](_0xf7a396[_0x07dc('0x30')]);_0x54edb5[_0x07dc('0x2e')]=_[_0x07dc('0x2f')](_0x54edb5[_0x07dc('0x2c')],_0x54edb5[_0x07dc('0x30')]);_0x29cbf6[_0x07dc('0x31')]=_['intersection'](_0x54edb5[_0x07dc('0x2c')],qs[_0x07dc('0x32')](_0xf7a396['query'][_0x07dc('0x32')]));_0x29cbf6[_0x07dc('0x31')]=_0x29cbf6['attributes'][_0x07dc('0x33')]?_0x29cbf6[_0x07dc('0x31')]:_0x54edb5['model'];if(_0xf7a396['query']['includeAll']){_0x29cbf6[_0x07dc('0x42')]=[{'all':!![]}];}_0x29cbf6=_['merge']({},_0x29cbf6,_0xf7a396[_0x07dc('0x3c')]);return db[_0x07dc('0x2a')][_0x07dc('0x43')](_0x29cbf6)[_0x07dc('0x21')](handleEntityNotFound(_0x1d8f0d,null))[_0x07dc('0x21')](respondWithResult(_0x1d8f0d,null))[_0x07dc('0x40')](handleError(_0x1d8f0d,null));};exports[_0x07dc('0x20')]=function(_0x566724,_0x1f2f45){if(_0x566724[_0x07dc('0x44')]['id']){delete _0x566724[_0x07dc('0x44')]['id'];}return db['VoiceMusicOnHold'][_0x07dc('0x43')]({'where':{'id':_0x566724[_0x07dc('0x41')]['id']}})[_0x07dc('0x21')](handleEntityNotFound(_0x1f2f45,null))[_0x07dc('0x21')](saveUpdates(_0x566724[_0x07dc('0x44')],null))[_0x07dc('0x21')](respondWithResult(_0x1f2f45,null))[_0x07dc('0x40')](handleError(_0x1f2f45,null));};exports[_0x07dc('0x45')]=function(_0x3ab2f2,_0x3cd635,_0x11e825){return db[_0x07dc('0x46')][_0x07dc('0x47')](function(_0xbe103e){if(_0x3ab2f2[_0x07dc('0x44')]['mode']===_0x07dc('0x48')){_0x3ab2f2[_0x07dc('0x44')][_0x07dc('0x49')]=path[_0x07dc('0x4a')](config[_0x07dc('0x4b')],_0x07dc('0x4c'),_0x3ab2f2['body'][_0x07dc('0x27')]);}return db[_0x07dc('0x2a')][_0x07dc('0x45')](_0x3ab2f2[_0x07dc('0x44')],{'transaction':_0xbe103e})[_0x07dc('0x21')](function(_0x4c7c06){if(_0x3ab2f2['body']['mode']===_0x07dc('0x48')){fs[_0x07dc('0x4d')](_0x4c7c06[_0x07dc('0x49')],parseInt('0777',0x8));}var _0x10b4ed=_0x3ab2f2[_0x07dc('0x4e')][_0x07dc('0x23')]({'plain':!![]});if(!_0x10b4ed)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x10b4ed[_0x07dc('0x4f')]===_0x07dc('0x4e')){var _0x53a405=_0x4c7c06[_0x07dc('0x23')]({'plain':!![]});return db[_0x07dc('0x50')]['find']({'where':{'name':'MusicOnHolds','userProfileId':_0x10b4ed[_0x07dc('0x51')]},'raw':!![]})[_0x07dc('0x21')](function(_0x15db1d){if(_0x15db1d&&_0x15db1d[_0x07dc('0x52')]===0x0){return db['UserProfileResource'][_0x07dc('0x45')]({'name':_0x53a405[_0x07dc('0x27')],'resourceId':_0x53a405['id'],'type':_0x15db1d['name'],'sectionId':_0x15db1d['id']},{})[_0x07dc('0x21')](function(){return _0x4c7c06;});}else{return _0x4c7c06;}})[_0x07dc('0x40')](function(_0x53603a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x53603a);});}return _0x4c7c06;});})['then'](respondWithResult(_0x3cd635,0xc9))['catch'](handleError(_0x3cd635,null));};exports[_0x07dc('0x22')]=function(_0x27dd27,_0x47c109,_0x27a611){var _0x228d37;return db[_0x07dc('0x2a')][_0x07dc('0x43')]({'where':{'id':_0x27dd27['params']['id']}})[_0x07dc('0x21')](function(_0x5ec350){if(_0x5ec350){return db[_0x07dc('0x46')][_0x07dc('0x47')](function(_0x29900a){return _0x5ec350[_0x07dc('0x22')]({'transaction':_0x29900a,'raw':!![]})['then'](function(_0x19dc3e){if(_0x19dc3e['directory']){fs['readdirSync'](_0x19dc3e[_0x07dc('0x49')])[_0x07dc('0x53')](function(_0x2733be){fs['unlinkSync'](path['join'](_0x19dc3e['directory'],_0x2733be));});fs[_0x07dc('0x54')](_0x19dc3e[_0x07dc('0x49')]);}return _0x19dc3e;});})['catch'](function(_0x161aa7){throw new db[(_0x07dc('0x55'))]['ValidationError'](_0x161aa7[_0x07dc('0x56')]);});}})['then'](handleEntityNotFound(_0x47c109,null))[_0x07dc('0x21')](removeEntity(_0x47c109,null))['catch'](handleError(_0x47c109,null));};exports[_0x07dc('0x57')]=function(_0x2aad36,_0x162d78,_0x31b8eb){return db[_0x07dc('0x46')][_0x07dc('0x47')](function(_0x406007){var _0x1e8180;return db['VoiceMusicOnHold'][_0x07dc('0x43')]({'where':{'id':_0x2aad36[_0x07dc('0x41')]['id']}})[_0x07dc('0x21')](function(_0x4c4153){if(_0x4c4153){_0x1e8180=_0x4c4153;return _0x4c4153[_0x07dc('0x57')](_0x2aad36[_0x07dc('0x44')]['id'],{'transaction':_0x406007});}})[_0x07dc('0x21')](function(_0x3c5fbd){if(_0x3c5fbd){return db[_0x07dc('0x58')][_0x07dc('0x59')]({'where':{'id':_0x2aad36[_0x07dc('0x44')]['id']},'attributes':['id',_0x07dc('0x27'),_0x07dc('0x5a'),_0x07dc('0x5b'),_0x07dc('0x5c')],'raw':!![]});}})['then'](function(_0x1a8de9){if(_0x1a8de9){var _0x55c1b1=path['join'](config[_0x07dc('0x4b')],_0x07dc('0x5d'),util[_0x07dc('0x5e')](_0x07dc('0x5f'),path[_0x07dc('0x60')](_0x1a8de9['save_name'],path[_0x07dc('0x61')](_0x1a8de9[_0x07dc('0x5a')])),_0x1a8de9[_0x07dc('0x5b')]));var _0x34934b=path[_0x07dc('0x4a')](config[_0x07dc('0x4b')],_0x07dc('0x4c'),_0x1e8180[_0x07dc('0x27')],util[_0x07dc('0x5e')](_0x07dc('0x5f'),_0x1a8de9['name'],_0x1a8de9[_0x07dc('0x5b')]));fs['symlinkSync'](_0x55c1b1,_0x34934b);return _0x1a8de9;}})[_0x07dc('0x40')](function(_0x9eea2){throw new db[(_0x07dc('0x55'))]['ValidationError'](_0x9eea2[_0x07dc('0x56')]);});})['then'](handleEntityNotFound(_0x162d78,null))[_0x07dc('0x21')](respondWithResult(_0x162d78,0xc9))[_0x07dc('0x40')](handleError(_0x162d78,null));};exports['removeSound']=function(_0x676909,_0x3de3e1,_0x465312){return db[_0x07dc('0x46')][_0x07dc('0x47')](function(_0x4343e0){var _0x25d4d3;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x676909['params']['id']}})['then'](handleEntityNotFound(_0x3de3e1,null))[_0x07dc('0x21')](function(_0x5d96c4){if(_0x5d96c4){_0x25d4d3=_0x5d96c4;return _0x5d96c4['removeSound'](_0x676909[_0x07dc('0x41')]['id2']);}})[_0x07dc('0x21')](function(_0xc45f60){if(_0xc45f60){return db['Sound'][_0x07dc('0x59')]({'where':{'id':_0x676909['params'][_0x07dc('0x62')]},'attributes':['id',_0x07dc('0x27'),_0x07dc('0x5a'),_0x07dc('0x5b'),_0x07dc('0x5c')],'raw':!![]});}})[_0x07dc('0x21')](function(_0x137e93){if(_0x137e93){fs['unlinkSync'](path[_0x07dc('0x4a')](_0x25d4d3[_0x07dc('0x49')],util[_0x07dc('0x5e')](_0x07dc('0x5f'),_0x137e93[_0x07dc('0x27')],_0x137e93[_0x07dc('0x5b')])));return _0x137e93;}})[_0x07dc('0x40')](function(_0x4dda32){throw new db[(_0x07dc('0x55'))][(_0x07dc('0x63'))](_0x4dda32[_0x07dc('0x56')]);});})[_0x07dc('0x21')](handleEntityNotFound(_0x3de3e1,null))[_0x07dc('0x21')](respondWithStatusCode(_0x3de3e1,0xcc))[_0x07dc('0x40')](handleError(_0x3de3e1,null));};exports[_0x07dc('0x64')]=function(_0x5f39e8,_0x51dc73,_0x33835f){var _0x1f9cd5={};var _0x3a55cd={};var _0x3a7381;var _0x132703;return db[_0x07dc('0x2a')]['findOne']({'where':{'id':_0x5f39e8[_0x07dc('0x41')]['id']}})[_0x07dc('0x21')](handleEntityNotFound(_0x51dc73,null))['then'](function(_0x3400ff){if(_0x3400ff){_0x3a7381=_0x3400ff;_0x3a55cd['model']=_[_0x07dc('0x2d')](db[_0x07dc('0x58')][_0x07dc('0x2b')]);_0x3a55cd[_0x07dc('0x30')]=_[_0x07dc('0x2d')](_0x5f39e8[_0x07dc('0x30')]);_0x3a55cd[_0x07dc('0x2e')]=_['intersection'](_0x3a55cd['model'],_0x3a55cd['query']);_0x1f9cd5[_0x07dc('0x31')]=_[_0x07dc('0x2f')](_0x3a55cd[_0x07dc('0x2c')],qs[_0x07dc('0x32')](_0x5f39e8[_0x07dc('0x30')][_0x07dc('0x32')]));_0x1f9cd5[_0x07dc('0x31')]=_0x1f9cd5['attributes'][_0x07dc('0x33')]?_0x1f9cd5[_0x07dc('0x31')]:_0x3a55cd[_0x07dc('0x2c')];_0x1f9cd5[_0x07dc('0x65')]=qs[_0x07dc('0x66')](_0x5f39e8[_0x07dc('0x30')][_0x07dc('0x66')]);_0x1f9cd5[_0x07dc('0x36')]=qs[_0x07dc('0x2e')](_['pick'](_0x5f39e8[_0x07dc('0x30')],_0x3a55cd[_0x07dc('0x2e')]));if(_0x5f39e8[_0x07dc('0x30')][_0x07dc('0x38')]){_0x1f9cd5[_0x07dc('0x36')]=_['merge'](_0x1f9cd5['where'],{'$or':_[_0x07dc('0x3a')](_0x1f9cd5[_0x07dc('0x31')],function(_0x231515){var _0x18b4d0={};_0x18b4d0[_0x231515]={'$like':'%'+_0x5f39e8['query'][_0x07dc('0x38')]+'%'};return _0x18b4d0;})});}_0x1f9cd5=_[_0x07dc('0x39')]({},_0x1f9cd5,_0x5f39e8[_0x07dc('0x3c')]);return _0x3a7381[_0x07dc('0x64')](_0x1f9cd5);}})[_0x07dc('0x21')](function(_0x56ec44){if(_0x56ec44){_0x132703=_0x56ec44[_0x07dc('0x33')];if(!_0x5f39e8['query'][_0x07dc('0x34')](_0x07dc('0x35'))){_0x1f9cd5[_0x07dc('0x1b')]=qs[_0x07dc('0x1b')](_0x5f39e8['query'][_0x07dc('0x1b')]);_0x1f9cd5['offset']=qs[_0x07dc('0x1a')](_0x5f39e8[_0x07dc('0x30')]['offset']);}return _0x3a7381[_0x07dc('0x64')](_0x1f9cd5);}})[_0x07dc('0x21')](function(_0x1aaa93){if(_0x1aaa93){return _0x1aaa93?{'count':_0x132703,'rows':_0x1aaa93}:null;}})[_0x07dc('0x21')](respondWithResult(_0x51dc73,null))['catch'](handleError(_0x51dc73,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 86479ed..4f26420 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 _0x3136=['api','bluebird','request-promise','path','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','util','../../config/logger'];(function(_0x331274,_0x333dc6){var _0x302a82=function(_0x12ddbe){while(--_0x12ddbe){_0x331274['push'](_0x331274['shift']());}};_0x302a82(++_0x333dc6);}(_0x3136,0x8d));var _0x6313=function(_0x56d6ae,_0x3fe38f){_0x56d6ae=_0x56d6ae-0x0;var _0x344a3d=_0x3136[_0x56d6ae];return _0x344a3d;};'use strict';var _=require('lodash');var util=require(_0x6313('0x0'));var logger=require(_0x6313('0x1'))(_0x6313('0x2'));var moment=require('moment');var BPromise=require(_0x6313('0x3'));var rp=require(_0x6313('0x4'));var fs=require('fs');var path=require(_0x6313('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6313('0x6'));module[_0x6313('0x7')]=function(_0x22a6de,_0x41de78){return _0x22a6de[_0x6313('0x8')](_0x6313('0x9'),attributes,{'tableName':_0x6313('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfe4e=['./voiceMusicOnHold.attributes','VoiceMusicOnHold','lodash','api','moment','request-promise','path','rimraf'];(function(_0x616fb8,_0x177e11){var _0x739e20=function(_0xfe27e9){while(--_0xfe27e9){_0x616fb8['push'](_0x616fb8['shift']());}};_0x739e20(++_0x177e11);}(_0xfe4e,0x1d2));var _0xefe4=function(_0x21d0e6,_0x5a7aa6){_0x21d0e6=_0x21d0e6-0x0;var _0x1cc2d1=_0xfe4e[_0x21d0e6];return _0x1cc2d1;};'use strict';var _=require(_0xefe4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xefe4('0x1'));var moment=require(_0xefe4('0x2'));var BPromise=require('bluebird');var rp=require(_0xefe4('0x3'));var fs=require('fs');var path=require(_0xefe4('0x4'));var rimraf=require(_0xefe4('0x5'));var config=require('../../config/environment');var attributes=require(_0xefe4('0x6'));module['exports']=function(_0x13df44,_0xd6b76c){return _0x13df44['define'](_0xefe4('0x7'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index 38272d0..50e0372 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 _0x6dcd=['then','info','VoiceMusicOnHold,\x20%s,\x20%s','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x2ed6ae,_0x4f257d){var _0x2461a0=function(_0x29a292){while(--_0x29a292){_0x2ed6ae['push'](_0x2ed6ae['shift']());}};_0x2461a0(++_0x4f257d);}(_0x6dcd,0x115));var _0xd6dc=function(_0x302223,_0xf7f109){_0x302223=_0x302223-0x0;var _0xb76fd3=_0x6dcd[_0x302223];return _0xb76fd3;};'use strict';var _=require('lodash');var util=require(_0xd6dc('0x0'));var moment=require('moment');var BPromise=require(_0xd6dc('0x1'));var rs=require(_0xd6dc('0x2'));var fs=require('fs');var Redis=require(_0xd6dc('0x3'));var db=require(_0xd6dc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd6dc('0x5'))(_0xd6dc('0x6'));var config=require(_0xd6dc('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd6dc('0x8')][_0xd6dc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f6451,_0x20e7c2,_0x217919){return new BPromise(function(_0x23dd83,_0x367ea6){return client[_0xd6dc('0xa')](_0x4f6451,_0x217919)[_0xd6dc('0xb')](function(_0x28ee6e){logger[_0xd6dc('0xc')](_0xd6dc('0xd'),_0x20e7c2,'request\x20sent');logger['debug'](_0xd6dc('0xe'),_0x20e7c2,'request\x20sent',JSON['stringify'](_0x28ee6e));if(_0x28ee6e['error']){if(_0x28ee6e[_0xd6dc('0xf')]['code']===0x1f4){logger['error'](_0xd6dc('0xd'),_0x20e7c2,_0x28ee6e[_0xd6dc('0xf')][_0xd6dc('0x10')]);return _0x367ea6(_0x28ee6e['error'][_0xd6dc('0x10')]);}logger['error'](_0xd6dc('0xd'),_0x20e7c2,_0x28ee6e[_0xd6dc('0xf')][_0xd6dc('0x10')]);return _0x23dd83(_0x28ee6e[_0xd6dc('0xf')][_0xd6dc('0x10')]);}else{logger[_0xd6dc('0xc')](_0xd6dc('0xd'),_0x20e7c2,_0xd6dc('0x11'));_0x23dd83(_0x28ee6e['result'][_0xd6dc('0x10')]);}})['catch'](function(_0x46d1c6){logger[_0xd6dc('0xf')](_0xd6dc('0xd'),_0x20e7c2,_0x46d1c6);_0x367ea6(_0x46d1c6);});});} \ No newline at end of file +var _0x3408=['request\x20sent','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','client','http','then','info','VoiceMusicOnHold,\x20%s,\x20%s'];(function(_0xad35fd,_0xee91b3){var _0x188450=function(_0x570f6a){while(--_0x570f6a){_0xad35fd['push'](_0xad35fd['shift']());}};_0x188450(++_0xee91b3);}(_0x3408,0x15d));var _0x8340=function(_0x3e66e7,_0x45b745){_0x3e66e7=_0x3e66e7-0x0;var _0x3e8b25=_0x3408[_0x3e66e7];return _0x3e8b25;};'use strict';var _=require(_0x8340('0x0'));var util=require('util');var moment=require(_0x8340('0x1'));var BPromise=require(_0x8340('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8340('0x3'));var logger=require(_0x8340('0x4'))(_0x8340('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8340('0x6')][_0x8340('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x440374,_0xb8d5f2,_0x20107c){return new BPromise(function(_0x202a5f,_0x44c617){return client['request'](_0x440374,_0x20107c)[_0x8340('0x8')](function(_0x24328a){logger[_0x8340('0x9')](_0x8340('0xa'),_0xb8d5f2,_0x8340('0xb'));logger['debug'](_0x8340('0xc'),_0xb8d5f2,'request\x20sent',JSON[_0x8340('0xd')](_0x24328a));if(_0x24328a[_0x8340('0xe')]){if(_0x24328a[_0x8340('0xe')][_0x8340('0xf')]===0x1f4){logger[_0x8340('0xe')](_0x8340('0xa'),_0xb8d5f2,_0x24328a[_0x8340('0xe')][_0x8340('0x10')]);return _0x44c617(_0x24328a[_0x8340('0xe')]['message']);}logger[_0x8340('0xe')](_0x8340('0xa'),_0xb8d5f2,_0x24328a['error'][_0x8340('0x10')]);return _0x202a5f(_0x24328a[_0x8340('0xe')][_0x8340('0x10')]);}else{logger[_0x8340('0x9')](_0x8340('0xa'),_0xb8d5f2,'request\x20sent');_0x202a5f(_0x24328a[_0x8340('0x11')]['message']);}})['catch'](function(_0x2bbcc5){logger[_0x8340('0xe')](_0x8340('0xa'),_0xb8d5f2,_0x2bbcc5);_0x44c617(_0x2bbcc5);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index d3a11f1..5f83c43 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 _0x9e6f=['isAuthenticated','index','describe','/:id','show','create','post','/:id/users','addAgents','put','update','delete','removeAgents','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get'];(function(_0x91f494,_0x1c59a6){var _0x189811=function(_0x29a7b3){while(--_0x29a7b3){_0x91f494['push'](_0x91f494['shift']());}};_0x189811(++_0x1c59a6);}(_0x9e6f,0x76));var _0xf9e6=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x9e6f[_0x28947d];return _0x12d2ee;};'use strict';var multer=require(_0xf9e6('0x0'));var util=require('util');var path=require(_0xf9e6('0x1'));var timeout=require(_0xf9e6('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xf9e6('0x3'));var interaction=require(_0xf9e6('0x4'));var config=require(_0xf9e6('0x5'));var controller=require(_0xf9e6('0x6'));router[_0xf9e6('0x7')]('/',auth[_0xf9e6('0x8')](),controller[_0xf9e6('0x9')]);router[_0xf9e6('0x7')]('/describe',auth[_0xf9e6('0x8')](),controller[_0xf9e6('0xa')]);router[_0xf9e6('0x7')](_0xf9e6('0xb'),auth[_0xf9e6('0x8')](),controller[_0xf9e6('0xc')]);router[_0xf9e6('0x7')]('/:id/users',auth[_0xf9e6('0x8')](),controller['getAgents']);router['post']('/',auth[_0xf9e6('0x8')](),controller[_0xf9e6('0xd')]);router[_0xf9e6('0xe')](_0xf9e6('0xf'),auth[_0xf9e6('0x8')](),controller[_0xf9e6('0x10')]);router[_0xf9e6('0x11')](_0xf9e6('0xb'),auth[_0xf9e6('0x8')](),controller[_0xf9e6('0x12')]);router['delete'](_0xf9e6('0xb'),auth[_0xf9e6('0x8')](),controller['destroy']);router[_0xf9e6('0x13')](_0xf9e6('0xf'),auth['isAuthenticated'](),controller[_0xf9e6('0x14')]);module['exports']=router; \ No newline at end of file +var _0x5580=['path','express','Router','../../components/auth/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','describe','/:id','show','getAgents','post','create','/:id/users','addAgents','put','update','destroy','removeAgents','exports','multer','util'];(function(_0x4a4423,_0xe0dd30){var _0x50170b=function(_0x17af2a){while(--_0x17af2a){_0x4a4423['push'](_0x4a4423['shift']());}};_0x50170b(++_0xe0dd30);}(_0x5580,0xa6));var _0x0558=function(_0x59679d,_0x1a0b65){_0x59679d=_0x59679d-0x0;var _0x4e438e=_0x5580[_0x59679d];return _0x4e438e;};'use strict';var multer=require(_0x0558('0x0'));var util=require(_0x0558('0x1'));var path=require(_0x0558('0x2'));var timeout=require('connect-timeout');var express=require(_0x0558('0x3'));var router=express[_0x0558('0x4')]();var auth=require(_0x0558('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0558('0x6'));var controller=require(_0x0558('0x7'));router[_0x0558('0x8')]('/',auth[_0x0558('0x9')](),controller[_0x0558('0xa')]);router[_0x0558('0x8')]('/describe',auth[_0x0558('0x9')](),controller[_0x0558('0xb')]);router[_0x0558('0x8')](_0x0558('0xc'),auth['isAuthenticated'](),controller[_0x0558('0xd')]);router['get']('/:id/users',auth[_0x0558('0x9')](),controller[_0x0558('0xe')]);router[_0x0558('0xf')]('/',auth[_0x0558('0x9')](),controller[_0x0558('0x10')]);router[_0x0558('0xf')](_0x0558('0x11'),auth['isAuthenticated'](),controller[_0x0558('0x12')]);router[_0x0558('0x13')](_0x0558('0xc'),auth[_0x0558('0x9')](),controller[_0x0558('0x14')]);router['delete'](_0x0558('0xc'),auth['isAuthenticated'](),controller[_0x0558('0x15')]);router['delete'](_0x0558('0x11'),auth[_0x0558('0x9')](),controller[_0x0558('0x16')]);module[_0x0558('0x17')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 97d9480..4506ec3 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 _0xfe73=['sequelize','exports','STRING','name','VIRTUAL','getDataValue','INTEGER'];(function(_0x1b1e76,_0x31695b){var _0x3d743a=function(_0x4ae27b){while(--_0x4ae27b){_0x1b1e76['push'](_0x1b1e76['shift']());}};_0x3d743a(++_0x31695b);}(_0xfe73,0xf5));var _0x3fe7=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0xfe73[_0x2f45ea];return _0x485a84;};'use strict';var Sequelize=require(_0x3fe7('0x0'));module[_0x3fe7('0x1')]={'name':{'type':Sequelize[_0x3fe7('0x2')],'allowNull':![],'unique':_0x3fe7('0x3')},'prefix':{'type':Sequelize[_0x3fe7('0x4')],'get':function(_0x55e7b8){return'system-'+this[_0x3fe7('0x5')](_0x3fe7('0x3'))+'-';}},'description':{'type':Sequelize[_0x3fe7('0x2')]},'callerIdAll':{'type':Sequelize[_0x3fe7('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x3fe7('0x6')]}}; \ No newline at end of file +var _0x534f=['INTEGER','sequelize','STRING','name','VIRTUAL','system-','getDataValue'];(function(_0x255a1d,_0x7db9a4){var _0x353a22=function(_0x1ba3e7){while(--_0x1ba3e7){_0x255a1d['push'](_0x255a1d['shift']());}};_0x353a22(++_0x7db9a4);}(_0x534f,0xf6));var _0xf534=function(_0x1d4d38,_0x2bbbc5){_0x1d4d38=_0x1d4d38-0x0;var _0x207718=_0x534f[_0x1d4d38];return _0x207718;};'use strict';var Sequelize=require(_0xf534('0x0'));module['exports']={'name':{'type':Sequelize[_0xf534('0x1')],'allowNull':![],'unique':_0xf534('0x2')},'prefix':{'type':Sequelize[_0xf534('0x3')],'get':function(_0xfbcf86){return _0xf534('0x4')+this[_0xf534('0x5')](_0xf534('0x2'))+'-';}},'description':{'type':Sequelize[_0xf534('0x1')]},'callerIdAll':{'type':Sequelize[_0xf534('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0xf534('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 6f4a2f1..ed55e27 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 _0x9957=['CDR(prefix)=','callerIdAll','push','PREFIX-CALLERIDALL=','No\x20callerid\x20available','${EXTEN:','charAt','body','system-','update','findById','addAgents','params','omit','spread','emit','ids','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','nolimit','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','sendStatus','status','end','json','offset','set','Content-Range','reject','save','then','destroy','VoicePrefixes','UserProfileResource','error','name','VoicePrefix','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','order','sort','pick','filter','where','merge','map','key','VIRTUAL','field','options','count','includeAll','findAll','rows','catch','rawAttributes','find','describe','create','sequelize','transaction','VoiceExtension','VoiceExtensionId','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','description','Voice\x20Prefix\x20Extension','priority','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','prefix','Set'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var hardwareService=require(_0x7995('0x15'));var logger=require(_0x7995('0x16'))('api');var utils=require(_0x7995('0x17'));var config=require(_0x7995('0x18'));var db=require('../../mysqldb')['db'];config[_0x7995('0x19')]=_[_0x7995('0x1a')](config[_0x7995('0x19')],{'host':_0x7995('0x1b'),'port':0x18eb});var socket=require(_0x7995('0x1c'))(new Redis(config[_0x7995('0x19')]));require(_0x7995('0x1d'))['register'](socket);function respondWithStatusCode(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xcc;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1e')](_0x2b4e94);}return _0x58f5ad[_0x7995('0x1f')](_0x2b4e94)[_0x7995('0x20')]();};}function respondWithResult(_0x1a5310,_0x2202ce){_0x2202ce=_0x2202ce||0xc8;return function(_0x41cbf0){if(_0x41cbf0){return _0x1a5310['status'](_0x2202ce)[_0x7995('0x21')](_0x41cbf0);}};}function respondWithFilteredResult(_0x565d97,_0x2f832e){return function(_0x37f297){if(_0x37f297){var _0x43d4b8=_0x37f297['count'],_0x291317=_0x2f832e['offset'],_0x1e1415=_0x2f832e[_0x7995('0x22')]+_0x2f832e['limit'],_0x37a7d4;if(_0x1e1415>=_0x43d4b8){_0x1e1415=_0x43d4b8;_0x37a7d4=0xc8;}else{_0x37a7d4=0xce;}_0x565d97['status'](_0x37a7d4);return _0x565d97[_0x7995('0x23')](_0x7995('0x24'),_0x291317+'-'+_0x1e1415+'/'+_0x43d4b8)['json'](_0x37f297);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x25')](_0x3e4c54);}return _0x51f276[_0x7995('0x26')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x27')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x28')]()[_0x7995('0x27')](function(){var _0x472195=_0x563799['get']({'plain':!![]});var _0x39df42=_0x7995('0x29');return db[_0x7995('0x2a')][_0x7995('0x28')]({'where':{'type':_0x39df42,'resourceId':_0x472195['id']}})[_0x7995('0x27')](function(){return _0x563799;});})[_0x7995('0x27')](function(){_0x204507['status'](0xcc)[_0x7995('0x20')]();});}};}function handleEntityNotFound(_0x5911c3,_0x229742){return function(_0x49bc7e){if(!_0x49bc7e){_0x5911c3[_0x7995('0x1e')](0x194);}return _0x49bc7e;};}function handleError(_0x132a42,_0x11c1eb){_0x11c1eb=_0x11c1eb||0x1f4;return function(_0x4b6f99){logger[_0x7995('0x2b')](_0x4b6f99['stack']);if(_0x4b6f99[_0x7995('0x2c')]){delete _0x4b6f99[_0x7995('0x2c')];}_0x132a42[_0x7995('0x1f')](_0x11c1eb)['send'](_0x4b6f99);};}exports['index']=function(_0x48e573,_0x3573be){var _0xe6b0b3={},_0x327a81={},_0x2b874d={'count':0x0,'rows':[]};var _0x2e3493=db[_0x7995('0x2d')]['rawAttributes'];_0x327a81['model']=_[_0x7995('0x2e')](_0x2e3493);_0x327a81['query']=_[_0x7995('0x2e')](_0x48e573[_0x7995('0x2f')]);_0x327a81[_0x7995('0x30')]=_[_0x7995('0x31')](_0x327a81[_0x7995('0x32')],_0x327a81['query']);_0xe6b0b3[_0x7995('0x33')]=_[_0x7995('0x31')](_0x327a81['model'],qs['fields'](_0x48e573['query'][_0x7995('0x34')]));_0xe6b0b3[_0x7995('0x33')]=_0xe6b0b3['attributes'][_0x7995('0x35')]?_0xe6b0b3['attributes']:_0x327a81[_0x7995('0x32')];if(!_0x48e573[_0x7995('0x2f')][_0x7995('0x36')]('nolimit')){_0xe6b0b3['limit']=qs[_0x7995('0x37')](_0x48e573['query']['limit']);_0xe6b0b3[_0x7995('0x22')]=qs[_0x7995('0x22')](_0x48e573['query'][_0x7995('0x22')]);}_0xe6b0b3[_0x7995('0x38')]=qs[_0x7995('0x39')](_0x48e573[_0x7995('0x2f')][_0x7995('0x39')]);_0xe6b0b3['where']=qs[_0x7995('0x30')](_[_0x7995('0x3a')](_0x48e573[_0x7995('0x2f')],_0x327a81[_0x7995('0x30')]));if(_0x48e573['query'][_0x7995('0x3b')]){_0xe6b0b3[_0x7995('0x3c')]=_[_0x7995('0x3d')](_0xe6b0b3[_0x7995('0x3c')],{'$or':_[_0x7995('0x3e')](_0x2e3493,function(_0x1035dc){if(_0x1035dc['type'][_0x7995('0x3f')]!==_0x7995('0x40')){var _0x8a1be0={};_0x8a1be0[_0x1035dc[_0x7995('0x41')]]={'$like':'%'+_0x48e573[_0x7995('0x2f')][_0x7995('0x3b')]+'%'};return _0x8a1be0;}})});}_0xe6b0b3=_[_0x7995('0x3d')]({},_0xe6b0b3,_0x48e573[_0x7995('0x42')]);var _0x1234e1={'where':_0xe6b0b3[_0x7995('0x3c')]};return db[_0x7995('0x2d')][_0x7995('0x43')](_0x1234e1)[_0x7995('0x27')](function(_0x53cda2){_0x2b874d['count']=_0x53cda2;if(_0x48e573[_0x7995('0x2f')][_0x7995('0x44')]){_0xe6b0b3['include']=[{'all':!![]}];}return db['VoicePrefix'][_0x7995('0x45')](_0xe6b0b3);})['then'](function(_0x504a33){_0x2b874d[_0x7995('0x46')]=_0x504a33;return _0x2b874d;})[_0x7995('0x27')](respondWithFilteredResult(_0x3573be,_0xe6b0b3))[_0x7995('0x47')](handleError(_0x3573be,null));};exports['show']=function(_0x46ac4f,_0x5e85b9){var _0x3993b5={'raw':![],'where':{'id':_0x46ac4f['params']['id']}},_0x5a8881={};_0x5a8881[_0x7995('0x32')]=_[_0x7995('0x2e')](db[_0x7995('0x2d')][_0x7995('0x48')]);_0x5a8881['query']=_[_0x7995('0x2e')](_0x46ac4f[_0x7995('0x2f')]);_0x5a8881[_0x7995('0x30')]=_[_0x7995('0x31')](_0x5a8881['model'],_0x5a8881['query']);_0x3993b5[_0x7995('0x33')]=_['intersection'](_0x5a8881[_0x7995('0x32')],qs['fields'](_0x46ac4f[_0x7995('0x2f')]['fields']));_0x3993b5[_0x7995('0x33')]=_0x3993b5[_0x7995('0x33')]['length']?_0x3993b5[_0x7995('0x33')]:_0x5a8881[_0x7995('0x32')];if(_0x46ac4f[_0x7995('0x2f')][_0x7995('0x44')]){_0x3993b5['include']=[{'all':!![]}];}_0x3993b5=_[_0x7995('0x3d')]({},_0x3993b5,_0x46ac4f[_0x7995('0x42')]);return db[_0x7995('0x2d')]['find'](_0x3993b5)[_0x7995('0x27')](handleEntityNotFound(_0x5e85b9,null))[_0x7995('0x27')](respondWithResult(_0x5e85b9,null))[_0x7995('0x47')](handleError(_0x5e85b9,null));};exports[_0x7995('0x28')]=function(_0x255313,_0x51934b){return db[_0x7995('0x2d')][_0x7995('0x49')]({'where':{'id':_0x255313['params']['id']}})[_0x7995('0x27')](handleEntityNotFound(_0x51934b,null))['then'](removeEntity(_0x51934b,null))[_0x7995('0x47')](handleError(_0x51934b,null));};exports[_0x7995('0x4a')]=function(_0x1afab4,_0x30e220){return db[_0x7995('0x2d')][_0x7995('0x4a')]()[_0x7995('0x27')](respondWithResult(_0x30e220,null))['catch'](handleError(_0x30e220,null));};exports[_0x7995('0x4b')]=function(_0x32f4be,_0x418eb9){var _0x4ffc8a;return db[_0x7995('0x4c')][_0x7995('0x4d')](function(_0x12d4b8){return db['VoicePrefix']['create'](_0x32f4be['body'],{'transaction':_0x12d4b8})[_0x7995('0x27')](function(_0x1fd1ca){_0x4ffc8a=_0x1fd1ca['get']({'plain':!![]});return db[_0x7995('0x4e')][_0x7995('0x49')]({'where':{'id':_0x4ffc8a[_0x7995('0x4f')]},'raw':!![]})[_0x7995('0x27')](function(_0xc04004){return createVoicePrefixExtensions(_0x4ffc8a,_0xc04004,_0x12d4b8);});});})['then'](function(){var _0x29ee32=_0x32f4be['user'][_0x7995('0x50')]({'plain':!![]});if(!_0x29ee32)throw new Error(_0x7995('0x51'));if(_0x29ee32[_0x7995('0x52')]==='user'){var _0x5e1f34=_0x4ffc8a;return db['UserProfileSection']['find']({'where':{'name':_0x7995('0x29'),'userProfileId':_0x29ee32[_0x7995('0x53')]},'raw':!![]})[_0x7995('0x27')](function(_0x150261){if(_0x150261&&_0x150261[_0x7995('0x54')]===0x0){return db[_0x7995('0x2a')][_0x7995('0x4b')]({'name':_0x5e1f34[_0x7995('0x2c')],'resourceId':_0x5e1f34['id'],'type':_0x150261[_0x7995('0x2c')],'sectionId':_0x150261['id']},{})[_0x7995('0x27')](function(){return _0x4ffc8a;});}else{return _0x4ffc8a;}})[_0x7995('0x47')](function(_0x133c63){logger[_0x7995('0x2b')](_0x7995('0x55'),_0x133c63);throw _0x133c63;});}return _0x4ffc8a;})[_0x7995('0x27')](respondWithResult(_0x418eb9,null))[_0x7995('0x47')](handleError(_0x418eb9,null));};function Extension(_0x447a2b,_0x223e08,_0x45e86e,_0x50b7c2){this[_0x7995('0x56')]=_0x7995('0x57');this[_0x7995('0x58')]=_0x447a2b;this[_0x7995('0x59')]=_0x45e86e;this['type']='system';this[_0x7995('0x5a')]=_0x7995('0x5b');this[_0x7995('0x5c')]=_0x223e08;this[_0x7995('0x5d')]=_0x50b7c2;}function createVoicePrefixExtensions(_0x51c50b,_0x13cd7b,_0x74ff38){return new BPromise(function(_0xef5044,_0x33c49c){var _0x502d43=new Extension(formatPrefixName(_0x51c50b['prefix']),0x1,_0x7995('0x5e'),_0x7995('0x5f'));_0x502d43[_0x7995('0x60')]=_0x51c50b['id'];return db[_0x7995('0x4e')][_0x7995('0x4b')](_0x502d43,{'transaction':_0x74ff38})[_0x7995('0x27')](function(_0x1d4689){var _0x1e2206=_0x1d4689[_0x7995('0x50')]({'plain':!![]});var _0x50caf5=_[_0x7995('0x3e')](addVoicePrefixExtensions(_0x51c50b,_0x13cd7b),function(_0x3ec5a8){_0x3ec5a8[_0x7995('0x4f')]=_0x1e2206['id'];_0x3ec5a8[_0x7995('0x60')]=_0x51c50b['id'];return _0x3ec5a8;});return db['VoiceExtension']['bulkCreate'](_0x50caf5,{'transaction':_0x74ff38})[_0x7995('0x27')](function(_0xebb5c8){if(!_0xebb5c8){return _0x33c49c('Extensions\x20creation\x20failed');}else{return _0xef5044(_0xebb5c8);}})[_0x7995('0x47')](function(_0x375fc9){return _0x33c49c(_0x375fc9);});});;});};function addVoicePrefixExtensions(_0x2e3421,_0x57727e){var _0x32cb04=[];var _0x4ed662=formatPrefixName(_0x2e3421[_0x7995('0x61')]);_0x32cb04['push'](new Extension(_0x4ed662,0x2,_0x7995('0x62'),_0x7995('0x63')+_0x2e3421[_0x7995('0x2c')]));if(_0x2e3421[_0x7995('0x64')]){_0x32cb04[_0x7995('0x65')](new Extension(_0x4ed662,0x3,_0x7995('0x62'),_0x7995('0x66')+_0x2e3421[_0x7995('0x64')]));}else{_0x32cb04[_0x7995('0x65')](new Extension(_0x4ed662,0x3,_0x7995('0x5e'),_0x7995('0x67')));}_0x32cb04[_0x7995('0x65')](new Extension(_0x4ed662,0x4,'goto',_0x57727e[_0x7995('0x56')]+','+_0x7995('0x68')+(0x8+_0x2e3421[_0x7995('0x2c')][_0x7995('0x35')])+'}'+','+0x1));return _0x32cb04;}function formatPrefixName(_0x2c6548){var _0x54a2e0='_';for(var _0x4b54f2=0x0;_0x4b54f2<_0x2c6548[_0x7995('0x35')];_0x4b54f2++){if(_0x2c6548[_0x7995('0x69')](_0x4b54f2)=='-'){_0x54a2e0+=_0x2c6548[_0x7995('0x69')](_0x4b54f2);}else{_0x54a2e0+='['+_0x2c6548[_0x7995('0x69')](_0x4b54f2)+']';}}_0x54a2e0+='.';return _0x54a2e0;}exports['update']=function(_0x22d317,_0x50a12e,_0x5df621){var _0xca8238=_0x22d317[_0x7995('0x6a')];_0xca8238[_0x7995('0x61')]=_0x7995('0x6b')+_0xca8238[_0x7995('0x2c')]+'-';return db[_0x7995('0x4c')][_0x7995('0x4d')](function(_0x13dc73){return db[_0x7995('0x2d')][_0x7995('0x6c')](_0xca8238,{'where':{'id':_0xca8238['id']},'transaction':_0x13dc73})['then'](function(){return db[_0x7995('0x4e')][_0x7995('0x28')]({'where':{'VoicePrefixId':_0xca8238['id']},'transaction':_0x13dc73})[_0x7995('0x27')](function(){return db['VoiceExtension'][_0x7995('0x49')]({'where':{'id':_0xca8238[_0x7995('0x4f')]},'raw':!![]})[_0x7995('0x27')](function(_0x3a7d9d){return createVoicePrefixExtensions(_0xca8238,_0x3a7d9d,_0x13dc73);});});});})[_0x7995('0x27')](function(){return db[_0x7995('0x2d')][_0x7995('0x6d')](_0xca8238['id']);})[_0x7995('0x27')](respondWithResult(_0x50a12e,null))[_0x7995('0x47')](handleError(_0x50a12e,null));};exports[_0x7995('0x6e')]=function(_0x435a1b,_0x535131,_0x5e8b4c){return db[_0x7995('0x2d')][_0x7995('0x49')]({'where':{'id':_0x435a1b[_0x7995('0x6f')]['id']}})[_0x7995('0x27')](handleEntityNotFound(_0x535131,null))['then'](function(_0x3b45e8){if(_0x3b45e8){return _0x3b45e8[_0x7995('0x6e')](_0x435a1b['body']['ids'],_[_0x7995('0x70')](_0x435a1b[_0x7995('0x6a')],['ids','id'])||{})[_0x7995('0x71')](function(_0x5b1cba){for(var _0x3758f9=0x0;_0x3758f9<_0x435a1b[_0x7995('0x6a')]['ids']['length'];_0x3758f9+=0x1){socket[_0x7995('0x72')]('userVoicePrefix:save',{'UserId':_0x435a1b[_0x7995('0x6a')][_0x7995('0x73')][_0x3758f9],'VoicePrefixId':_0x435a1b[_0x7995('0x6f')]['id']});}return _0x5b1cba;});}})[_0x7995('0x27')](respondWithResult(_0x535131,null))[_0x7995('0x47')](handleError(_0x535131,null));};exports[_0x7995('0x74')]=function(_0x8af865,_0x14cb17,_0x29e0ee){return db[_0x7995('0x2d')][_0x7995('0x49')]({'where':{'id':_0x8af865[_0x7995('0x6f')]['id']}})[_0x7995('0x27')](handleEntityNotFound(_0x14cb17,null))[_0x7995('0x27')](function(_0x36e3a7){if(_0x36e3a7){return _0x36e3a7[_0x7995('0x74')](_0x8af865[_0x7995('0x2f')][_0x7995('0x73')])[_0x7995('0x27')](function(){if(_[_0x7995('0x75')](_0x8af865[_0x7995('0x2f')][_0x7995('0x73')])){for(var _0x11fe75=0x0;_0x11fe75<_0x8af865[_0x7995('0x2f')][_0x7995('0x73')][_0x7995('0x35')];_0x11fe75+=0x1){socket[_0x7995('0x72')](_0x7995('0x76'),{'UserId':Number(_0x8af865['query'][_0x7995('0x73')][_0x11fe75]),'VoicePrefixId':Number(_0x8af865[_0x7995('0x6f')]['id'])});}}else{socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x8af865[_0x7995('0x2f')][_0x7995('0x73')]),'VoicePrefixId':Number(_0x8af865[_0x7995('0x6f')]['id'])});}});}})[_0x7995('0x27')](respondWithStatusCode(_0x14cb17,null))[_0x7995('0x47')](handleError(_0x14cb17,null));};exports[_0x7995('0x77')]=function(_0x5507a0,_0x2f8a2d,_0xb68962){var _0x3fea6a={};var _0x77b03f={};var _0x7d9c6e;var _0x3f0bff;return db[_0x7995('0x2d')][_0x7995('0x78')]({'where':{'id':_0x5507a0['params']['id']}})[_0x7995('0x27')](handleEntityNotFound(_0x2f8a2d,null))[_0x7995('0x27')](function(_0x5c04c9){if(_0x5c04c9){_0x7d9c6e=_0x5c04c9;_0x77b03f['model']=_[_0x7995('0x2e')](db[_0x7995('0x79')][_0x7995('0x48')]);_0x77b03f[_0x7995('0x2f')]=_[_0x7995('0x2e')](_0x5507a0['query']);_0x77b03f[_0x7995('0x30')]=_[_0x7995('0x31')](_0x77b03f['model'],_0x77b03f[_0x7995('0x2f')]);_0x3fea6a[_0x7995('0x33')]=_['intersection'](_0x77b03f[_0x7995('0x32')],qs['fields'](_0x5507a0[_0x7995('0x2f')][_0x7995('0x34')]));_0x3fea6a[_0x7995('0x33')]=_0x3fea6a[_0x7995('0x33')][_0x7995('0x35')]?_0x3fea6a['attributes']:_0x77b03f[_0x7995('0x32')];_0x3fea6a[_0x7995('0x38')]=qs[_0x7995('0x39')](_0x5507a0['query'][_0x7995('0x39')]);_0x3fea6a[_0x7995('0x3c')]=qs[_0x7995('0x30')](_[_0x7995('0x3a')](_0x5507a0['query'],_0x77b03f[_0x7995('0x30')]));if(_0x5507a0[_0x7995('0x2f')][_0x7995('0x3b')]){_0x3fea6a['where']=_['merge'](_0x3fea6a[_0x7995('0x3c')],{'$or':_[_0x7995('0x3e')](_0x3fea6a['attributes'],function(_0x590373){var _0x2e3dfe={};_0x2e3dfe[_0x590373]={'$like':'%'+_0x5507a0[_0x7995('0x2f')][_0x7995('0x3b')]+'%'};return _0x2e3dfe;})});}_0x3fea6a=_[_0x7995('0x3d')]({},_0x3fea6a,_0x5507a0[_0x7995('0x42')]);return _0x7d9c6e['getAgents'](_0x3fea6a);}})['then'](function(_0x393cb7){if(_0x393cb7){_0x3f0bff=_0x393cb7['length'];if(!_0x5507a0['query'][_0x7995('0x36')](_0x7995('0x7a'))){_0x3fea6a[_0x7995('0x37')]=qs['limit'](_0x5507a0[_0x7995('0x2f')][_0x7995('0x37')]);_0x3fea6a[_0x7995('0x22')]=qs[_0x7995('0x22')](_0x5507a0[_0x7995('0x2f')]['offset']);}return _0x7d9c6e[_0x7995('0x77')](_0x3fea6a);}})[_0x7995('0x27')](function(_0x1a2d6a){if(_0x1a2d6a){return _0x1a2d6a?{'count':_0x3f0bff,'rows':_0x1a2d6a}:null;}})[_0x7995('0x27')](respondWithResult(_0x2f8a2d,null))['catch'](handleError(_0x2f8a2d,null));}; \ No newline at end of file +var _0x5fc3=['create','sequelize','transaction','body','find','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','app','system','description','priority','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','Extensions\x20creation\x20failed','prefix','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','context','charAt','VoiceExtension','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','isArray','length','userVoicePrefix:remove','getAgents','findOne','User','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','localhost','./voicePrefix.socket','register','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','get','VoicePrefixes','sendStatus','error','stack','name','send','index','VoicePrefix','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','map','type','key','field','filter','options','includeAll','include','findAll','rows','catch','show','params','describe'];(function(_0x493b9f,_0x3b60bd){var _0x1d2d55=function(_0x4a17b0){while(--_0x4a17b0){_0x493b9f['push'](_0x493b9f['shift']());}};_0x1d2d55(++_0x3b60bd);}(_0x5fc3,0xa8));var _0x35fc=function(_0x13187a,_0x2fcec4){_0x13187a=_0x13187a-0x0;var _0x65b85f=_0x5fc3[_0x13187a];return _0x65b85f;};'use strict';var pdf=require(_0x35fc('0x0'));var emlformat=require(_0x35fc('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x35fc('0x2'));var jsonpatch=require(_0x35fc('0x3'));var rp=require(_0x35fc('0x4'));var moment=require(_0x35fc('0x5'));var BPromise=require(_0x35fc('0x6'));var Mustache=require('mustache');var util=require(_0x35fc('0x7'));var path=require(_0x35fc('0x8'));var sox=require(_0x35fc('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0xe'));var querystring=require(_0x35fc('0xf'));var Papa=require(_0x35fc('0x10'));var Redis=require(_0x35fc('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x12'));var hardwareService=require(_0x35fc('0x13'));var logger=require('../../config/logger')(_0x35fc('0x14'));var utils=require(_0x35fc('0x15'));var config=require('../../config/environment');var db=require(_0x35fc('0x16'))['db'];config[_0x35fc('0x17')]=_['defaults'](config['redis'],{'host':_0x35fc('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x35fc('0x17')]));require(_0x35fc('0x19'))[_0x35fc('0x1a')](socket);function respondWithStatusCode(_0x29730f,_0x38d9f2){_0x38d9f2=_0x38d9f2||0xcc;return function(_0x5cfe94){if(_0x5cfe94){return _0x29730f['sendStatus'](_0x38d9f2);}return _0x29730f['status'](_0x38d9f2)['end']();};}function respondWithResult(_0x398b67,_0x229d56){_0x229d56=_0x229d56||0xc8;return function(_0x53b898){if(_0x53b898){return _0x398b67[_0x35fc('0x1b')](_0x229d56)[_0x35fc('0x1c')](_0x53b898);}};}function respondWithFilteredResult(_0x1121fa,_0x480851){return function(_0x26ba54){if(_0x26ba54){var _0x45c8b7=_0x26ba54[_0x35fc('0x1d')],_0x553677=_0x480851['offset'],_0x41e165=_0x480851[_0x35fc('0x1e')]+_0x480851[_0x35fc('0x1f')],_0x363e47;if(_0x41e165>=_0x45c8b7){_0x41e165=_0x45c8b7;_0x363e47=0xc8;}else{_0x363e47=0xce;}_0x1121fa[_0x35fc('0x1b')](_0x363e47);return _0x1121fa['set'](_0x35fc('0x20'),_0x553677+'-'+_0x41e165+'/'+_0x45c8b7)[_0x35fc('0x1c')](_0x26ba54);}return null;};}function patchUpdates(_0x3229d1){return function(_0x251a1f){try{jsonpatch[_0x35fc('0x21')](_0x251a1f,_0x3229d1,!![]);}catch(_0x21f1a9){return BPromise[_0x35fc('0x22')](_0x21f1a9);}return _0x251a1f[_0x35fc('0x23')]();};}function saveUpdates(_0x2405e8,_0x427eae){return function(_0x5bd2b8){if(_0x5bd2b8){return _0x5bd2b8[_0x35fc('0x24')](_0x2405e8)[_0x35fc('0x25')](function(_0x257719){return _0x257719;});}return null;};}function removeEntity(_0x2d8183,_0x3b4743){return function(_0x55e9e7){if(_0x55e9e7){return _0x55e9e7[_0x35fc('0x26')]()[_0x35fc('0x25')](function(){var _0x561bf8=_0x55e9e7[_0x35fc('0x27')]({'plain':!![]});var _0x5a93df=_0x35fc('0x28');return db['UserProfileResource'][_0x35fc('0x26')]({'where':{'type':_0x5a93df,'resourceId':_0x561bf8['id']}})['then'](function(){return _0x55e9e7;});})[_0x35fc('0x25')](function(){_0x2d8183[_0x35fc('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x519264,_0x47774c){return function(_0x58edb6){if(!_0x58edb6){_0x519264[_0x35fc('0x29')](0x194);}return _0x58edb6;};}function handleError(_0x1a5d92,_0x57001c){_0x57001c=_0x57001c||0x1f4;return function(_0x26b7cb){logger[_0x35fc('0x2a')](_0x26b7cb[_0x35fc('0x2b')]);if(_0x26b7cb[_0x35fc('0x2c')]){delete _0x26b7cb[_0x35fc('0x2c')];}_0x1a5d92[_0x35fc('0x1b')](_0x57001c)[_0x35fc('0x2d')](_0x26b7cb);};}exports[_0x35fc('0x2e')]=function(_0x54aedc,_0x1cd1ae){var _0x220931={},_0x22af18={},_0x52acc5={'count':0x0,'rows':[]};var _0xe79f52=db[_0x35fc('0x2f')][_0x35fc('0x30')];_0x22af18[_0x35fc('0x31')]=_[_0x35fc('0x32')](_0xe79f52);_0x22af18[_0x35fc('0x33')]=_[_0x35fc('0x32')](_0x54aedc[_0x35fc('0x33')]);_0x22af18[_0x35fc('0x34')]=_[_0x35fc('0x35')](_0x22af18['model'],_0x22af18['query']);_0x220931[_0x35fc('0x36')]=_['intersection'](_0x22af18[_0x35fc('0x31')],qs[_0x35fc('0x37')](_0x54aedc[_0x35fc('0x33')][_0x35fc('0x37')]));_0x220931[_0x35fc('0x36')]=_0x220931[_0x35fc('0x36')]['length']?_0x220931[_0x35fc('0x36')]:_0x22af18[_0x35fc('0x31')];if(!_0x54aedc[_0x35fc('0x33')][_0x35fc('0x38')](_0x35fc('0x39'))){_0x220931[_0x35fc('0x1f')]=qs['limit'](_0x54aedc[_0x35fc('0x33')][_0x35fc('0x1f')]);_0x220931[_0x35fc('0x1e')]=qs['offset'](_0x54aedc[_0x35fc('0x33')]['offset']);}_0x220931[_0x35fc('0x3a')]=qs[_0x35fc('0x3b')](_0x54aedc[_0x35fc('0x33')][_0x35fc('0x3b')]);_0x220931['where']=qs['filters'](_['pick'](_0x54aedc[_0x35fc('0x33')],_0x22af18['filters']));if(_0x54aedc[_0x35fc('0x33')]['filter']){_0x220931[_0x35fc('0x3c')]=_[_0x35fc('0x3d')](_0x220931[_0x35fc('0x3c')],{'$or':_[_0x35fc('0x3e')](_0xe79f52,function(_0x1c10e0){if(_0x1c10e0[_0x35fc('0x3f')][_0x35fc('0x40')]!=='VIRTUAL'){var _0x4467f8={};_0x4467f8[_0x1c10e0[_0x35fc('0x41')]]={'$like':'%'+_0x54aedc['query'][_0x35fc('0x42')]+'%'};return _0x4467f8;}})});}_0x220931=_[_0x35fc('0x3d')]({},_0x220931,_0x54aedc[_0x35fc('0x43')]);var _0x1d2ffe={'where':_0x220931[_0x35fc('0x3c')]};return db[_0x35fc('0x2f')]['count'](_0x1d2ffe)[_0x35fc('0x25')](function(_0x267858){_0x52acc5[_0x35fc('0x1d')]=_0x267858;if(_0x54aedc['query'][_0x35fc('0x44')]){_0x220931[_0x35fc('0x45')]=[{'all':!![]}];}return db['VoicePrefix'][_0x35fc('0x46')](_0x220931);})[_0x35fc('0x25')](function(_0x43b77c){_0x52acc5[_0x35fc('0x47')]=_0x43b77c;return _0x52acc5;})[_0x35fc('0x25')](respondWithFilteredResult(_0x1cd1ae,_0x220931))[_0x35fc('0x48')](handleError(_0x1cd1ae,null));};exports[_0x35fc('0x49')]=function(_0x3ec51f,_0x5a7e9e){var _0x596e83={'raw':![],'where':{'id':_0x3ec51f[_0x35fc('0x4a')]['id']}},_0x210d5d={};_0x210d5d['model']=_['keys'](db['VoicePrefix'][_0x35fc('0x30')]);_0x210d5d[_0x35fc('0x33')]=_['keys'](_0x3ec51f[_0x35fc('0x33')]);_0x210d5d[_0x35fc('0x34')]=_[_0x35fc('0x35')](_0x210d5d[_0x35fc('0x31')],_0x210d5d['query']);_0x596e83['attributes']=_['intersection'](_0x210d5d['model'],qs['fields'](_0x3ec51f[_0x35fc('0x33')][_0x35fc('0x37')]));_0x596e83['attributes']=_0x596e83[_0x35fc('0x36')]['length']?_0x596e83[_0x35fc('0x36')]:_0x210d5d[_0x35fc('0x31')];if(_0x3ec51f[_0x35fc('0x33')][_0x35fc('0x44')]){_0x596e83[_0x35fc('0x45')]=[{'all':!![]}];}_0x596e83=_['merge']({},_0x596e83,_0x3ec51f[_0x35fc('0x43')]);return db[_0x35fc('0x2f')]['find'](_0x596e83)[_0x35fc('0x25')](handleEntityNotFound(_0x5a7e9e,null))[_0x35fc('0x25')](respondWithResult(_0x5a7e9e,null))[_0x35fc('0x48')](handleError(_0x5a7e9e,null));};exports[_0x35fc('0x26')]=function(_0x5bc8c3,_0x3666a5){return db['VoicePrefix']['find']({'where':{'id':_0x5bc8c3[_0x35fc('0x4a')]['id']}})[_0x35fc('0x25')](handleEntityNotFound(_0x3666a5,null))[_0x35fc('0x25')](removeEntity(_0x3666a5,null))[_0x35fc('0x48')](handleError(_0x3666a5,null));};exports[_0x35fc('0x4b')]=function(_0x302a7b,_0x405320){return db[_0x35fc('0x2f')]['describe']()[_0x35fc('0x25')](respondWithResult(_0x405320,null))[_0x35fc('0x48')](handleError(_0x405320,null));};exports[_0x35fc('0x4c')]=function(_0x40b5c7,_0x2ad481){var _0x1e3221;return db[_0x35fc('0x4d')][_0x35fc('0x4e')](function(_0x35fb53){return db[_0x35fc('0x2f')][_0x35fc('0x4c')](_0x40b5c7[_0x35fc('0x4f')],{'transaction':_0x35fb53})[_0x35fc('0x25')](function(_0x3146e2){_0x1e3221=_0x3146e2['get']({'plain':!![]});return db['VoiceExtension'][_0x35fc('0x50')]({'where':{'id':_0x1e3221[_0x35fc('0x51')]},'raw':!![]})[_0x35fc('0x25')](function(_0x2bf0b0){return createVoicePrefixExtensions(_0x1e3221,_0x2bf0b0,_0x35fb53);});});})[_0x35fc('0x25')](function(){var _0x3e6494=_0x40b5c7['user']['get']({'plain':!![]});if(!_0x3e6494)throw new Error(_0x35fc('0x52'));if(_0x3e6494[_0x35fc('0x53')]===_0x35fc('0x54')){var _0x38bc78=_0x1e3221;return db['UserProfileSection'][_0x35fc('0x50')]({'where':{'name':_0x35fc('0x28'),'userProfileId':_0x3e6494['userProfileId']},'raw':!![]})[_0x35fc('0x25')](function(_0x2536d3){if(_0x2536d3&&_0x2536d3['autoAssociation']===0x0){return db[_0x35fc('0x55')][_0x35fc('0x4c')]({'name':_0x38bc78[_0x35fc('0x2c')],'resourceId':_0x38bc78['id'],'type':_0x2536d3[_0x35fc('0x2c')],'sectionId':_0x2536d3['id']},{})['then'](function(){return _0x1e3221;});}else{return _0x1e3221;}})['catch'](function(_0x502a15){logger[_0x35fc('0x2a')](_0x35fc('0x56'),_0x502a15);throw _0x502a15;});}return _0x1e3221;})['then'](respondWithResult(_0x2ad481,null))[_0x35fc('0x48')](handleError(_0x2ad481,null));};function Extension(_0x1f89b3,_0x381640,_0x145854,_0x46c59b){this['context']=_0x35fc('0x57');this[_0x35fc('0x58')]=_0x1f89b3;this[_0x35fc('0x59')]=_0x145854;this['type']=_0x35fc('0x5a');this[_0x35fc('0x5b')]='Voice\x20Prefix\x20Extension';this[_0x35fc('0x5c')]=_0x381640;this[_0x35fc('0x5d')]=_0x46c59b;}function createVoicePrefixExtensions(_0x1c46b1,_0x1c4c33,_0x314666){return new BPromise(function(_0x41453b,_0x8501d1){var _0x998fd9=new Extension(formatPrefixName(_0x1c46b1['prefix']),0x1,_0x35fc('0x5e'),_0x35fc('0x5f'));_0x998fd9[_0x35fc('0x60')]=_0x1c46b1['id'];return db['VoiceExtension'][_0x35fc('0x4c')](_0x998fd9,{'transaction':_0x314666})['then'](function(_0x4ceacc){var _0x5d4a39=_0x4ceacc[_0x35fc('0x27')]({'plain':!![]});var _0xb1c68a=_[_0x35fc('0x3e')](addVoicePrefixExtensions(_0x1c46b1,_0x1c4c33),function(_0x13901c){_0x13901c[_0x35fc('0x51')]=_0x5d4a39['id'];_0x13901c['VoicePrefixId']=_0x1c46b1['id'];return _0x13901c;});return db['VoiceExtension']['bulkCreate'](_0xb1c68a,{'transaction':_0x314666})['then'](function(_0x51d231){if(!_0x51d231){return _0x8501d1(_0x35fc('0x61'));}else{return _0x41453b(_0x51d231);}})[_0x35fc('0x48')](function(_0xd470e8){return _0x8501d1(_0xd470e8);});});;});};function addVoicePrefixExtensions(_0x3ef680,_0x511e8b){var _0x458eb8=[];var _0x20b042=formatPrefixName(_0x3ef680[_0x35fc('0x62')]);_0x458eb8[_0x35fc('0x63')](new Extension(_0x20b042,0x2,_0x35fc('0x64'),_0x35fc('0x65')+_0x3ef680[_0x35fc('0x2c')]));if(_0x3ef680[_0x35fc('0x66')]){_0x458eb8[_0x35fc('0x63')](new Extension(_0x20b042,0x3,'Set',_0x35fc('0x67')+_0x3ef680['callerIdAll']));}else{_0x458eb8[_0x35fc('0x63')](new Extension(_0x20b042,0x3,_0x35fc('0x5e'),_0x35fc('0x68')));}_0x458eb8[_0x35fc('0x63')](new Extension(_0x20b042,0x4,'goto',_0x511e8b[_0x35fc('0x69')]+','+'${EXTEN:'+(0x8+_0x3ef680['name']['length'])+'}'+','+0x1));return _0x458eb8;}function formatPrefixName(_0x10dd1a){var _0x5dfeb7='_';for(var _0x3c9027=0x0;_0x3c9027<_0x10dd1a['length'];_0x3c9027++){if(_0x10dd1a[_0x35fc('0x6a')](_0x3c9027)=='-'){_0x5dfeb7+=_0x10dd1a['charAt'](_0x3c9027);}else{_0x5dfeb7+='['+_0x10dd1a[_0x35fc('0x6a')](_0x3c9027)+']';}}_0x5dfeb7+='.';return _0x5dfeb7;}exports[_0x35fc('0x24')]=function(_0x3400f0,_0x1d81a5,_0x5c2ec0){var _0x3d0ecc=_0x3400f0[_0x35fc('0x4f')];_0x3d0ecc[_0x35fc('0x62')]='system-'+_0x3d0ecc[_0x35fc('0x2c')]+'-';return db[_0x35fc('0x4d')][_0x35fc('0x4e')](function(_0x3c1b56){return db[_0x35fc('0x2f')][_0x35fc('0x24')](_0x3d0ecc,{'where':{'id':_0x3d0ecc['id']},'transaction':_0x3c1b56})[_0x35fc('0x25')](function(){return db[_0x35fc('0x6b')]['destroy']({'where':{'VoicePrefixId':_0x3d0ecc['id']},'transaction':_0x3c1b56})[_0x35fc('0x25')](function(){return db[_0x35fc('0x6b')][_0x35fc('0x50')]({'where':{'id':_0x3d0ecc['VoiceExtensionId']},'raw':!![]})[_0x35fc('0x25')](function(_0x1b76f0){return createVoicePrefixExtensions(_0x3d0ecc,_0x1b76f0,_0x3c1b56);});});});})['then'](function(){return db['VoicePrefix'][_0x35fc('0x6c')](_0x3d0ecc['id']);})['then'](respondWithResult(_0x1d81a5,null))[_0x35fc('0x48')](handleError(_0x1d81a5,null));};exports[_0x35fc('0x6d')]=function(_0x43638e,_0x10952a,_0x1932c9){return db[_0x35fc('0x2f')][_0x35fc('0x50')]({'where':{'id':_0x43638e[_0x35fc('0x4a')]['id']}})[_0x35fc('0x25')](handleEntityNotFound(_0x10952a,null))[_0x35fc('0x25')](function(_0x65ee1b){if(_0x65ee1b){return _0x65ee1b[_0x35fc('0x6d')](_0x43638e[_0x35fc('0x4f')][_0x35fc('0x6e')],_[_0x35fc('0x6f')](_0x43638e[_0x35fc('0x4f')],[_0x35fc('0x6e'),'id'])||{})[_0x35fc('0x70')](function(_0x3b2160){for(var _0x3f3f36=0x0;_0x3f3f36<_0x43638e['body'][_0x35fc('0x6e')]['length'];_0x3f3f36+=0x1){socket[_0x35fc('0x71')](_0x35fc('0x72'),{'UserId':_0x43638e[_0x35fc('0x4f')][_0x35fc('0x6e')][_0x3f3f36],'VoicePrefixId':_0x43638e[_0x35fc('0x4a')]['id']});}return _0x3b2160;});}})[_0x35fc('0x25')](respondWithResult(_0x10952a,null))[_0x35fc('0x48')](handleError(_0x10952a,null));};exports[_0x35fc('0x73')]=function(_0x2fed7b,_0x2656e5,_0x2ee880){return db['VoicePrefix'][_0x35fc('0x50')]({'where':{'id':_0x2fed7b[_0x35fc('0x4a')]['id']}})[_0x35fc('0x25')](handleEntityNotFound(_0x2656e5,null))[_0x35fc('0x25')](function(_0x3a973d){if(_0x3a973d){return _0x3a973d[_0x35fc('0x73')](_0x2fed7b['query'][_0x35fc('0x6e')])[_0x35fc('0x25')](function(){if(_[_0x35fc('0x74')](_0x2fed7b[_0x35fc('0x33')][_0x35fc('0x6e')])){for(var _0x3e2a8e=0x0;_0x3e2a8e<_0x2fed7b[_0x35fc('0x33')][_0x35fc('0x6e')][_0x35fc('0x75')];_0x3e2a8e+=0x1){socket['emit'](_0x35fc('0x76'),{'UserId':Number(_0x2fed7b['query'][_0x35fc('0x6e')][_0x3e2a8e]),'VoicePrefixId':Number(_0x2fed7b[_0x35fc('0x4a')]['id'])});}}else{socket['emit'](_0x35fc('0x76'),{'UserId':Number(_0x2fed7b[_0x35fc('0x33')][_0x35fc('0x6e')]),'VoicePrefixId':Number(_0x2fed7b[_0x35fc('0x4a')]['id'])});}});}})[_0x35fc('0x25')](respondWithStatusCode(_0x2656e5,null))[_0x35fc('0x48')](handleError(_0x2656e5,null));};exports[_0x35fc('0x77')]=function(_0x452c10,_0x25ee61,_0x5806bf){var _0x4c70e2={};var _0x4e7c7b={};var _0x531117;var _0x160a6f;return db[_0x35fc('0x2f')][_0x35fc('0x78')]({'where':{'id':_0x452c10[_0x35fc('0x4a')]['id']}})[_0x35fc('0x25')](handleEntityNotFound(_0x25ee61,null))['then'](function(_0x226fdf){if(_0x226fdf){_0x531117=_0x226fdf;_0x4e7c7b[_0x35fc('0x31')]=_[_0x35fc('0x32')](db[_0x35fc('0x79')]['rawAttributes']);_0x4e7c7b[_0x35fc('0x33')]=_[_0x35fc('0x32')](_0x452c10[_0x35fc('0x33')]);_0x4e7c7b['filters']=_[_0x35fc('0x35')](_0x4e7c7b[_0x35fc('0x31')],_0x4e7c7b[_0x35fc('0x33')]);_0x4c70e2[_0x35fc('0x36')]=_[_0x35fc('0x35')](_0x4e7c7b[_0x35fc('0x31')],qs[_0x35fc('0x37')](_0x452c10[_0x35fc('0x33')]['fields']));_0x4c70e2[_0x35fc('0x36')]=_0x4c70e2[_0x35fc('0x36')][_0x35fc('0x75')]?_0x4c70e2[_0x35fc('0x36')]:_0x4e7c7b[_0x35fc('0x31')];_0x4c70e2[_0x35fc('0x3a')]=qs['sort'](_0x452c10[_0x35fc('0x33')]['sort']);_0x4c70e2['where']=qs[_0x35fc('0x34')](_['pick'](_0x452c10[_0x35fc('0x33')],_0x4e7c7b[_0x35fc('0x34')]));if(_0x452c10[_0x35fc('0x33')]['filter']){_0x4c70e2[_0x35fc('0x3c')]=_[_0x35fc('0x3d')](_0x4c70e2[_0x35fc('0x3c')],{'$or':_[_0x35fc('0x3e')](_0x4c70e2[_0x35fc('0x36')],function(_0x5abdf9){var _0x5512f6={};_0x5512f6[_0x5abdf9]={'$like':'%'+_0x452c10['query'][_0x35fc('0x42')]+'%'};return _0x5512f6;})});}_0x4c70e2=_['merge']({},_0x4c70e2,_0x452c10[_0x35fc('0x43')]);return _0x531117[_0x35fc('0x77')](_0x4c70e2);}})[_0x35fc('0x25')](function(_0xdce898){if(_0xdce898){_0x160a6f=_0xdce898['length'];if(!_0x452c10[_0x35fc('0x33')][_0x35fc('0x38')](_0x35fc('0x39'))){_0x4c70e2['limit']=qs[_0x35fc('0x1f')](_0x452c10[_0x35fc('0x33')][_0x35fc('0x1f')]);_0x4c70e2['offset']=qs['offset'](_0x452c10['query'][_0x35fc('0x1e')]);}return _0x531117[_0x35fc('0x77')](_0x4c70e2);}})[_0x35fc('0x25')](function(_0x3858a9){if(_0x3858a9){return _0x3858a9?{'count':_0x160a6f,'rows':_0x3858a9}:null;}})['then'](respondWithResult(_0x25ee61,null))[_0x35fc('0x48')](handleError(_0x25ee61,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 5f20aa7..98d8fc2 100644 --- a/server/api/voicePrefix/voicePrefix.events.js +++ b/server/api/voicePrefix/voicePrefix.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['hasOwnProperty','hook','exports','events','../../mysqldb','VoicePrefix','update','emit'];(function(_0xf168d3,_0x43dcfc){var _0x17fb54=function(_0x3d9674){while(--_0x3d9674){_0xf168d3['push'](_0xf168d3['shift']());}};_0x17fb54(++_0x43dcfc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'use strict';var EventEmitter=require(_0x0a9e('0x0'));var VoicePrefix=require(_0x0a9e('0x1'))['db'][_0x0a9e('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0a9e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x333808){return function(_0x432180,_0x2ab90b,_0x991246){VoicePrefixEvents[_0x0a9e('0x4')](_0x333808+':'+_0x432180['id'],_0x432180);VoicePrefixEvents['emit'](_0x333808,_0x432180);_0x991246(null);};}for(var e in events){if(events[_0x0a9e('0x5')](e)){var event=events[e];VoicePrefix[_0x0a9e('0x6')](e,emitEvent(event));}}module[_0x0a9e('0x7')]=VoicePrefixEvents; \ No newline at end of file +var _0xb10b=['hasOwnProperty','hook','events','VoicePrefix','setMaxListeners','save','remove','emit'];(function(_0x3da0dd,_0x44ae2a){var _0x2664d1=function(_0x211fc0){while(--_0x211fc0){_0x3da0dd['push'](_0x3da0dd['shift']());}};_0x2664d1(++_0x44ae2a);}(_0xb10b,0x12a));var _0xbb10=function(_0xb4788,_0x1efb8d){_0xb4788=_0xb4788-0x0;var _0xd49d21=_0xb10b[_0xb4788];return _0xd49d21;};'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 2fe4d7c..19d5bed 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 _0xd1b9=['api','bluebird','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','define','voice_prefixes','lodash','util','../../config/logger'];(function(_0x5c53f3,_0x21c13a){var _0x4ea02f=function(_0x1e49ad){while(--_0x1e49ad){_0x5c53f3['push'](_0x5c53f3['shift']());}};_0x4ea02f(++_0x21c13a);}(_0xd1b9,0x75));var _0x9d1b=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0xd1b9[_0x172747];return _0x509692;};'use strict';var _=require(_0x9d1b('0x0'));var util=require(_0x9d1b('0x1'));var logger=require(_0x9d1b('0x2'))(_0x9d1b('0x3'));var moment=require('moment');var BPromise=require(_0x9d1b('0x4'));var rp=require(_0x9d1b('0x5'));var fs=require('fs');var path=require(_0x9d1b('0x6'));var rimraf=require(_0x9d1b('0x7'));var config=require(_0x9d1b('0x8'));var attributes=require(_0x9d1b('0x9'));module['exports']=function(_0x25b5df,_0x2687d4){return _0x25b5df[_0x9d1b('0xa')]('VoicePrefix',attributes,{'tableName':_0x9d1b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8aae=['path','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3e1fcd,_0x3db6af){var _0x3cc39b=function(_0x438d45){while(--_0x438d45){_0x3e1fcd['push'](_0x3e1fcd['shift']());}};_0x3cc39b(++_0x3db6af);}(_0x8aae,0xda));var _0xe8aa=function(_0x22212e,_0x47fe28){_0x22212e=_0x22212e-0x0;var _0x5f2d47=_0x8aae[_0x22212e];return _0x5f2d47;};'use strict';var _=require(_0xe8aa('0x0'));var util=require('util');var logger=require(_0xe8aa('0x1'))(_0xe8aa('0x2'));var moment=require(_0xe8aa('0x3'));var BPromise=require(_0xe8aa('0x4'));var rp=require(_0xe8aa('0x5'));var fs=require('fs');var path=require(_0xe8aa('0x6'));var rimraf=require(_0xe8aa('0x7'));var config=require(_0xe8aa('0x8'));var attributes=require(_0xe8aa('0x9'));module[_0xe8aa('0xa')]=function(_0xee7bee,_0x2d023d){return _0xee7bee[_0xe8aa('0xb')](_0xe8aa('0xc'),attributes,{'tableName':_0xe8aa('0xd'),'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 e795808..a6b8a58 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 _0x6392=['VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','VoicePrefix,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','defaults','socket.io-emitter','./voicePrefix.socket','register','info','request\x20sent','debug'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6392,0x95));var _0x2639=function(_0x6723fa,_0x45ef22){_0x6723fa=_0x6723fa-0x0;var _0x475eb6=_0x6392[_0x6723fa];return _0x475eb6;};'use strict';var _=require(_0x2639('0x0'));var util=require(_0x2639('0x1'));var moment=require(_0x2639('0x2'));var BPromise=require(_0x2639('0x3'));var rs=require(_0x2639('0x4'));var fs=require('fs');var Redis=require(_0x2639('0x5'));var db=require(_0x2639('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2639('0x7'))(_0x2639('0x8'));var config=require('../../config/environment');var jayson=require(_0x2639('0x9'));var client=jayson[_0x2639('0xa')]['http']({'port':0x232a});config[_0x2639('0xb')]=_[_0x2639('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2639('0xd'))(new Redis(config['redis']));require(_0x2639('0xe'))[_0x2639('0xf')](socket);function respondWithRpcPromise(_0x304054,_0x2f50a9,_0x2b2d31){return new BPromise(function(_0x3a12b8,_0x190907){return client['request'](_0x304054,_0x2b2d31)['then'](function(_0x1fbecc){logger[_0x2639('0x10')]('VoicePrefix,\x20%s,\x20%s',_0x2f50a9,_0x2639('0x11'));logger[_0x2639('0x12')](_0x2639('0x13'),_0x2f50a9,_0x2639('0x11'),JSON['stringify'](_0x1fbecc));if(_0x1fbecc[_0x2639('0x14')]){if(_0x1fbecc[_0x2639('0x14')][_0x2639('0x15')]===0x1f4){logger['error'](_0x2639('0x16'),_0x2f50a9,_0x1fbecc[_0x2639('0x14')][_0x2639('0x17')]);return _0x190907(_0x1fbecc['error'][_0x2639('0x17')]);}logger[_0x2639('0x14')](_0x2639('0x16'),_0x2f50a9,_0x1fbecc['error'][_0x2639('0x17')]);return _0x3a12b8(_0x1fbecc[_0x2639('0x14')]['message']);}else{logger['info'](_0x2639('0x16'),_0x2f50a9,_0x2639('0x11'));_0x3a12b8(_0x1fbecc['result'][_0x2639('0x17')]);}})['catch'](function(_0x1553ca){logger['error'](_0x2639('0x16'),_0x2f50a9,_0x1553ca);_0x190907(_0x1553ca);});});} \ No newline at end of file +var _0x8be5=['jayson/promise','client','http','redis','defaults','socket.io-emitter','./voicePrefix.socket','request','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','catch','util','bluebird','../../config/logger','rpc','../../config/environment'];(function(_0x3f6af9,_0x553094){var _0x6cc311=function(_0x11a9a4){while(--_0x11a9a4){_0x3f6af9['push'](_0x3f6af9['shift']());}};_0x6cc311(++_0x553094);}(_0x8be5,0x171));var _0x58be=function(_0x5cb720,_0x3c4ed2){_0x5cb720=_0x5cb720-0x0;var _0x2bcaca=_0x8be5[_0x5cb720];return _0x2bcaca;};'use strict';var _=require('lodash');var util=require(_0x58be('0x0'));var moment=require('moment');var BPromise=require(_0x58be('0x1'));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(_0x58be('0x2'))(_0x58be('0x3'));var config=require(_0x58be('0x4'));var jayson=require(_0x58be('0x5'));var client=jayson[_0x58be('0x6')][_0x58be('0x7')]({'port':0x232a});config[_0x58be('0x8')]=_[_0x58be('0x9')](config[_0x58be('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x58be('0xa'))(new Redis(config[_0x58be('0x8')]));require(_0x58be('0xb'))['register'](socket);function respondWithRpcPromise(_0x4fa5e0,_0x59f33d,_0x28e9cd){return new BPromise(function(_0xf01afd,_0x3d96a1){return client[_0x58be('0xc')](_0x4fa5e0,_0x28e9cd)[_0x58be('0xd')](function(_0x1e9636){logger['info'](_0x58be('0xe'),_0x59f33d,_0x58be('0xf'));logger[_0x58be('0x10')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x59f33d,_0x58be('0xf'),JSON[_0x58be('0x11')](_0x1e9636));if(_0x1e9636[_0x58be('0x12')]){if(_0x1e9636[_0x58be('0x12')]['code']===0x1f4){logger[_0x58be('0x12')]('VoicePrefix,\x20%s,\x20%s',_0x59f33d,_0x1e9636[_0x58be('0x12')][_0x58be('0x13')]);return _0x3d96a1(_0x1e9636[_0x58be('0x12')][_0x58be('0x13')]);}logger[_0x58be('0x12')]('VoicePrefix,\x20%s,\x20%s',_0x59f33d,_0x1e9636['error'][_0x58be('0x13')]);return _0xf01afd(_0x1e9636[_0x58be('0x12')]['message']);}else{logger[_0x58be('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x59f33d,_0x58be('0xf'));_0xf01afd(_0x1e9636['result'][_0x58be('0x13')]);}})[_0x58be('0x15')](function(_0x1874e3){logger[_0x58be('0x12')](_0x58be('0xe'),_0x59f33d,_0x1874e3);_0x3d96a1(_0x1874e3);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 15ae50b..029bd40 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 _0x7d94=['length','voicePrefix:','./voicePrefix.events','save','remove','update','emit','register'];(function(_0x3c65a4,_0x3b5c91){var _0x3f9ffa=function(_0xe229f){while(--_0xe229f){_0x3c65a4['push'](_0x3c65a4['shift']());}};_0x3f9ffa(++_0x3b5c91);}(_0x7d94,0x13a));var _0x47d9=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x7d94[_0x36884e];return _0x1cc367;};'use strict';var VoicePrefixEvents=require(_0x47d9('0x0'));var events=[_0x47d9('0x1'),_0x47d9('0x2'),_0x47d9('0x3')];function createListener(_0x1175a0,_0x4ac81f){return function(_0x521b70){_0x4ac81f[_0x47d9('0x4')](_0x1175a0,_0x521b70);};}function removeListener(_0x461a43,_0x30c4ce){return function(){VoicePrefixEvents['removeListener'](_0x461a43,_0x30c4ce);};}exports[_0x47d9('0x5')]=function(_0x122eca){for(var _0x4681ef=0x0,_0x1c146f=events[_0x47d9('0x6')];_0x4681ef<_0x1c146f;_0x4681ef++){var _0x1048a6=events[_0x4681ef];var _0x23da57=createListener(_0x47d9('0x7')+_0x1048a6,_0x122eca);VoicePrefixEvents['on'](_0x1048a6,_0x23da57);}}; \ No newline at end of file +var _0xb3f6=['save','update','emit','removeListener','length','./voicePrefix.events'];(function(_0x5277cc,_0x218537){var _0x389503=function(_0x5da8d0){while(--_0x5da8d0){_0x5277cc['push'](_0x5277cc['shift']());}};_0x389503(++_0x218537);}(_0xb3f6,0x1c7));var _0x6b3f=function(_0x5a4b81,_0x51b161){_0x5a4b81=_0x5a4b81-0x0;var _0x4dbeb8=_0xb3f6[_0x5a4b81];return _0x4dbeb8;};'use strict';var VoicePrefixEvents=require(_0x6b3f('0x0'));var events=[_0x6b3f('0x1'),'remove',_0x6b3f('0x2')];function createListener(_0x284941,_0x2e1052){return function(_0x689da7){_0x2e1052[_0x6b3f('0x3')](_0x284941,_0x689da7);};}function removeListener(_0x41d5a1,_0x502a37){return function(){VoicePrefixEvents[_0x6b3f('0x4')](_0x41d5a1,_0x502a37);};}exports['register']=function(_0x563ea0){for(var _0x2ed620=0x0,_0x419fb5=events[_0x6b3f('0x5')];_0x2ed620<_0x419fb5;_0x2ed620++){var _0x502e37=events[_0x2ed620];var _0x17a928=createListener('voicePrefix:'+_0x502e37,_0x563ea0);VoicePrefixEvents['on'](_0x502e37,_0x17a928);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 6b44f34..4b47c99 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 _0xa92a=['multer','connect-timeout','express','Router','../../components/interaction/service','index','get','/:id','isAuthenticated','show','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','/:id/users','/:id/members','/:id/blacklists','post','create','/:id/clone','addTeams','/:id/lists','addLists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeBlackLists','exports'];(function(_0x92be87,_0x333832){var _0x455a37=function(_0x5b6519){while(--_0x5b6519){_0x92be87['push'](_0x92be87['shift']());}};_0x455a37(++_0x333832);}(_0xa92a,0x1c7));var _0xaa92=function(_0xccf869,_0x2556a5){_0xccf869=_0xccf869-0x0;var _0x21a9db=_0xa92a[_0xccf869];return _0x21a9db;};'use strict';var multer=require(_0xaa92('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xaa92('0x1'));var express=require(_0xaa92('0x2'));var router=express[_0xaa92('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xaa92('0x4'));var config=require('../../config/environment');var controller=require('./voiceQueue.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xaa92('0x5')]);router[_0xaa92('0x6')](_0xaa92('0x7'),auth[_0xaa92('0x8')](),controller[_0xaa92('0x9')]);router[_0xaa92('0x6')]('/:id/hoppers',auth[_0xaa92('0x8')](),controller[_0xaa92('0xa')]);router[_0xaa92('0x6')](_0xaa92('0xb'),auth[_0xaa92('0x8')](),controller[_0xaa92('0xc')]);router['get'](_0xaa92('0xd'),auth[_0xaa92('0x8')](),controller['getHopperFinals']);router[_0xaa92('0x6')](_0xaa92('0xe'),auth[_0xaa92('0x8')](),controller[_0xaa92('0xf')]);router['get'](_0xaa92('0x10'),auth[_0xaa92('0x8')](),controller[_0xaa92('0x11')]);router[_0xaa92('0x6')](_0xaa92('0x12'),auth[_0xaa92('0x8')](),controller['getAgents']);router[_0xaa92('0x6')](_0xaa92('0x13'),auth[_0xaa92('0x8')](),controller['getMembers']);router[_0xaa92('0x6')]('/:id/lists',auth['isAuthenticated'](),controller['getLists']);router[_0xaa92('0x6')](_0xaa92('0x14'),auth['isAuthenticated'](),controller['getBlackLists']);router[_0xaa92('0x15')]('/',auth[_0xaa92('0x8')](),controller[_0xaa92('0x16')]);router[_0xaa92('0x15')](_0xaa92('0x17'),auth[_0xaa92('0x8')](),controller['clone']);router[_0xaa92('0x15')]('/:id/teams',auth[_0xaa92('0x8')](),controller[_0xaa92('0x18')]);router[_0xaa92('0x15')](_0xaa92('0x12'),auth[_0xaa92('0x8')](),controller['addAgents']);router[_0xaa92('0x15')](_0xaa92('0x19'),auth[_0xaa92('0x8')](),controller[_0xaa92('0x1a')]);router[_0xaa92('0x15')]('/:id/blacklists',auth[_0xaa92('0x8')](),controller[_0xaa92('0x1b')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xaa92('0x1c')]);router[_0xaa92('0x1d')](_0xaa92('0x7'),auth[_0xaa92('0x8')](),controller[_0xaa92('0x1e')]);router['delete'](_0xaa92('0x10'),auth[_0xaa92('0x8')](),controller[_0xaa92('0x1f')]);router['delete'](_0xaa92('0x12'),auth['isAuthenticated'](),controller[_0xaa92('0x20')]);router[_0xaa92('0x1d')](_0xaa92('0x19'),auth[_0xaa92('0x8')](),controller['removeLists']);router[_0xaa92('0x1d')](_0xaa92('0x14'),auth[_0xaa92('0x8')](),controller[_0xaa92('0x21')]);module[_0xaa92('0x22')]=router; \ No newline at end of file +var _0x84bb=['/:id/members','getMembers','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','clone','/:id/teams','addTeams','addAgents','addLists','addBlackLists','put','update','delete','removeAgents','removeLists','removeBlackLists','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','index','/:id','show','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getTeams','/:id/users'];(function(_0x513726,_0xafdc9f){var _0x1d46c5=function(_0x2ed08e){while(--_0x2ed08e){_0x513726['push'](_0x513726['shift']());}};_0x1d46c5(++_0xafdc9f);}(_0x84bb,0x1d7));var _0xb84b=function(_0x1ae125,_0x20820a){_0x1ae125=_0x1ae125-0x0;var _0x1f3b2b=_0x84bb[_0x1ae125];return _0x1f3b2b;};'use strict';var multer=require(_0xb84b('0x0'));var util=require(_0xb84b('0x1'));var path=require(_0xb84b('0x2'));var timeout=require(_0xb84b('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xb84b('0x4'));var interaction=require(_0xb84b('0x5'));var config=require(_0xb84b('0x6'));var controller=require(_0xb84b('0x7'));router[_0xb84b('0x8')]('/',auth[_0xb84b('0x9')](),controller[_0xb84b('0xa')]);router['get'](_0xb84b('0xb'),auth[_0xb84b('0x9')](),controller[_0xb84b('0xc')]);router[_0xb84b('0x8')]('/:id/hoppers',auth[_0xb84b('0x9')](),controller[_0xb84b('0xd')]);router[_0xb84b('0x8')](_0xb84b('0xe'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xb84b('0x8')](_0xb84b('0xf'),auth[_0xb84b('0x9')](),controller[_0xb84b('0x10')]);router['get'](_0xb84b('0x11'),auth[_0xb84b('0x9')](),controller[_0xb84b('0x12')]);router['get']('/:id/teams',auth[_0xb84b('0x9')](),controller[_0xb84b('0x13')]);router[_0xb84b('0x8')](_0xb84b('0x14'),auth[_0xb84b('0x9')](),controller['getAgents']);router[_0xb84b('0x8')](_0xb84b('0x15'),auth['isAuthenticated'](),controller[_0xb84b('0x16')]);router[_0xb84b('0x8')](_0xb84b('0x17'),auth[_0xb84b('0x9')](),controller[_0xb84b('0x18')]);router['get'](_0xb84b('0x19'),auth[_0xb84b('0x9')](),controller[_0xb84b('0x1a')]);router[_0xb84b('0x1b')]('/',auth['isAuthenticated'](),controller[_0xb84b('0x1c')]);router[_0xb84b('0x1b')]('/:id/clone',auth[_0xb84b('0x9')](),controller[_0xb84b('0x1d')]);router[_0xb84b('0x1b')](_0xb84b('0x1e'),auth['isAuthenticated'](),controller[_0xb84b('0x1f')]);router[_0xb84b('0x1b')](_0xb84b('0x14'),auth[_0xb84b('0x9')](),controller[_0xb84b('0x20')]);router[_0xb84b('0x1b')](_0xb84b('0x17'),auth[_0xb84b('0x9')](),controller[_0xb84b('0x21')]);router[_0xb84b('0x1b')](_0xb84b('0x19'),auth['isAuthenticated'](),controller[_0xb84b('0x22')]);router[_0xb84b('0x23')](_0xb84b('0xb'),auth['isAuthenticated'](),controller[_0xb84b('0x24')]);router['delete'](_0xb84b('0xb'),auth[_0xb84b('0x9')](),controller['destroy']);router[_0xb84b('0x25')](_0xb84b('0x1e'),auth[_0xb84b('0x9')](),controller['removeTeams']);router[_0xb84b('0x25')](_0xb84b('0x14'),auth[_0xb84b('0x9')](),controller[_0xb84b('0x26')]);router[_0xb84b('0x25')]('/:id/lists',auth[_0xb84b('0x9')](),controller[_0xb84b('0x27')]);router[_0xb84b('0x25')](_0xb84b('0x19'),auth[_0xb84b('0x9')](),controller[_0xb84b('0x28')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index aa66def..40f2b10 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 _0xbd59=['#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','STRING','name','ENUM','outbound','inbound','ringall','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','rrordered','setDataValue','getDataValue','dialMethod','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','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)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length'];(function(_0x407d03,_0x1d8bd2){var _0x17a165=function(_0x205c11){while(--_0x205c11){_0x407d03['push'](_0x407d03['shift']());}};_0x17a165(++_0x1d8bd2);}(_0xbd59,0x173));var _0x9bd5=function(_0x4b6d57,_0xbb1dfe){_0x4b6d57=_0x4b6d57-0x0;var _0x7ddd94=_0xbd59[_0x4b6d57];return _0x7ddd94;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9bd5('0x0')],'allowNull':![],'unique':_0x9bd5('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x9bd5('0x2')]('inbound',_0x9bd5('0x3')),'allowNull':![],'defaultValue':_0x9bd5('0x4')},'musiconhold':{'type':Sequelize[_0x9bd5('0x0')],'defaultValue':'default'},'announce':{'type':Sequelize[_0x9bd5('0x0')],'defaultValue':''},'strategy':{'type':Sequelize[_0x9bd5('0x2')]('rr',_0x9bd5('0x5'),_0x9bd5('0x6'),_0x9bd5('0x7'),_0x9bd5('0x8'),_0x9bd5('0x9'),_0x9bd5('0xa'),_0x9bd5('0xb'),_0x9bd5('0xc')),'allowNull':![],'defaultValue':'ringall','set':function(_0x58c5e5){this[_0x9bd5('0xd')]('strategy',_0x58c5e5?_0x58c5e5:_0x9bd5('0x9'));},'get':function(){var _0x3e0a91=this['getDataValue']('type');var _0x548cbc=this[_0x9bd5('0xe')](_0x9bd5('0xf'));var _0x28780a=this[_0x9bd5('0xe')]('strategy');if(_0x3e0a91===_0x9bd5('0x4')){return _0x28780a;}if(_0x548cbc===_0x9bd5('0x10')&&_0x28780a==='rrmemory'||_0x548cbc===_0x9bd5('0x10')&&_0x28780a===_0x9bd5('0x11')){return _0x28780a;}if(_0x548cbc===_0x9bd5('0x12')||_0x548cbc===_0x9bd5('0x13')||_0x548cbc===_0x9bd5('0x14')){return _0x28780a;}return null;}},'servicelevel':{'type':Sequelize[_0x9bd5('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x9bd5('0x0')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x9bd5('0x15')](0xb)},'timeout':{'type':Sequelize[_0x9bd5('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x9bd5('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0x9bd5('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x9bd5('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x9bd5('0x2')]('yes','no'),'defaultValue':_0x9bd5('0x16')},'autopause':{'type':Sequelize[_0x9bd5('0x2')](_0x9bd5('0x16'),'no',_0x9bd5('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x9bd5('0x2')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x9bd5('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x9bd5('0x2')](_0x9bd5('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x9bd5('0x2')](_0x9bd5('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x9bd5('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x9bd5('0x2')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x9bd5('0x0')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x9bd5('0x0')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x9bd5('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x9bd5('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x9bd5('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x9bd5('0x2')](_0x9bd5('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x9bd5('0x2')](_0x9bd5('0x16'),'no'),'defaultValue':_0x9bd5('0x16')},'announce_holdtime':{'type':Sequelize['ENUM'](_0x9bd5('0x16'),'no',_0x9bd5('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x9bd5('0x2')](_0x9bd5('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0x9bd5('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x9bd5('0x0')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x9bd5('0x0')]},'queue_youarenext':{'type':Sequelize[_0x9bd5('0x0')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x9bd5('0x0')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x9bd5('0x0')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x9bd5('0x0')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x9bd5('0x0')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x9bd5('0x0')]},'queue_quantity1':{'type':Sequelize[_0x9bd5('0x0')]},'queue_quantity2':{'type':Sequelize[_0x9bd5('0x0')]},'queue_periodic_announce':{'type':Sequelize[_0x9bd5('0x0')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x432909){this[_0x9bd5('0xd')](_0x9bd5('0x19'),_0x432909?_0x432909[_0x9bd5('0x1a')](','):[]);},'get':function(){return this[_0x9bd5('0xe')](_0x9bd5('0x19'))?this[_0x9bd5('0xe')]('periodic_announce')[_0x9bd5('0x1b')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0x9bd5('0x16'),'set':function(_0xbce99b){this['setDataValue'](_0x9bd5('0x1c'),_0xbce99b?_0xbce99b[_0x9bd5('0x1a')](','):[]);},'get':function(){return this[_0x9bd5('0xe')](_0x9bd5('0x1c'))?this['getDataValue']('joinempty')['split'](','):[];}},'leavewhenempty':{'type':Sequelize[_0x9bd5('0x0')],'defaultValue':'no','set':function(_0x1d5286){this['setDataValue'](_0x9bd5('0x1d'),_0x1d5286?_0x1d5286[_0x9bd5('0x1a')](','):[]);},'get':function(){return this[_0x9bd5('0xe')]('leavewhenempty')?this[_0x9bd5('0xe')](_0x9bd5('0x1d'))[_0x9bd5('0x1b')](','):[];}},'reportholdtime':{'type':Sequelize[_0x9bd5('0x2')](_0x9bd5('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x9bd5('0x2')](_0x9bd5('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x9bd5('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x9bd5('0x2')](_0x9bd5('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x9bd5('0x0')]},'description':{'type':Sequelize[_0x9bd5('0x0')]},'acw':{'type':Sequelize[_0x9bd5('0x1e')],'defaultValue':0x0,'set':function(_0x5ba46a){this[_0x9bd5('0xd')]('acw',_0x5ba46a);if(_0x5ba46a){if(this[_0x9bd5('0xe')]('wrapuptime')<0x2){this[_0x9bd5('0xd')](_0x9bd5('0x1f'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x9bd5('0x20')},'dialMethod':{'type':Sequelize[_0x9bd5('0x2')](_0x9bd5('0x21'),_0x9bd5('0x12'),'power',_0x9bd5('0x13'),_0x9bd5('0x10')),'defaultValue':'progressive','comment':_0x9bd5('0x22')},'dialLimitChannel':{'type':Sequelize[_0x9bd5('0x15')](0x4)[_0x9bd5('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x9bd5('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x9bd5('0x24')},'dialPowerLevel':{'type':Sequelize[_0x9bd5('0x25')](0x2)[_0x9bd5('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x9bd5('0x26')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0x9bd5('0x27'),_0x9bd5('0x28')),'defaultValue':_0x9bd5('0x28'),'comment':_0x9bd5('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x9bd5('0x25')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x9bd5('0x2a')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x9bd5('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize[_0x9bd5('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x9bd5('0x15')](0x3)[_0x9bd5('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9bd5('0x2c')},'dialQueueOptions':{'type':Sequelize[_0x9bd5('0x0')],'defaultValue':_0x9bd5('0x2d'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x9bd5('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9bd5('0x2e')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x9bd5('0x2f')},'dialCongestionMaxRetry':{'type':Sequelize[_0x9bd5('0x15')](0x3)[_0x9bd5('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9bd5('0x30')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x9bd5('0x15')](0x5)[_0x9bd5('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x9bd5('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9bd5('0x31')},'dialBusyRetryFrequency':{'type':Sequelize[_0x9bd5('0x15')](0x5)[_0x9bd5('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x9bd5('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x9bd5('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9bd5('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0x9bd5('0x15')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x9bd5('0x34')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x9bd5('0x35')},'dialPrefix':{'type':Sequelize[_0x9bd5('0x0')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x9bd5('0x2')](_0x9bd5('0x36'),'never',_0x9bd5('0x37')),'defaultValue':_0x9bd5('0x36')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x9bd5('0x38')},'dialAMDInitialSilence':{'type':Sequelize[_0x9bd5('0x15')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x9bd5('0x39')},'dialAMDGreeting':{'type':Sequelize[_0x9bd5('0x15')](0x9)[_0x9bd5('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x9bd5('0x3a')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x9bd5('0x23')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x9bd5('0x3b')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x9bd5('0x15')](0x9)[_0x9bd5('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x9bd5('0x15')](0x9)[_0x9bd5('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x9bd5('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x9bd5('0x23')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x9bd5('0x3d')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x9bd5('0x15')](0x9)[_0x9bd5('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x9bd5('0x15')](0x5)[_0x9bd5('0x23')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x9bd5('0x3e')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x9bd5('0x15')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x9bd5('0x3f')},'dialRecallMeTimeout':{'type':Sequelize[_0x9bd5('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x9bd5('0x40')},'dialRecallInQueue':{'type':Sequelize[_0x9bd5('0x1e')],'defaultValue':0x0,'comment':_0x9bd5('0x41')},'dialOrderByScheduledAt':{'type':Sequelize[_0x9bd5('0x2')](_0x9bd5('0x42'),'ASC'),'defaultValue':_0x9bd5('0x42')},'dialQueueProject2':{'type':Sequelize[_0x9bd5('0x0')],'comment':_0x9bd5('0x2f')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x9bd5('0x1e')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x9bd5('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x9bd5('0x15')](0x3)[_0x9bd5('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x9bd5('0x43')},'dialCutDigit':{'type':Sequelize[_0x9bd5('0x15')](0x3)[_0x9bd5('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x9bd5('0x44')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9bd5('0x15')],'allowNull':!![],'comment':_0x9bd5('0x45')},'mandatoryDisposition':{'type':Sequelize[_0x9bd5('0x1e')],'defaultValue':![],'comment':_0x9bd5('0x46'),'set':function(_0x254afe){if(!_0x254afe)this['setDataValue'](_0x9bd5('0x47'),null);this[_0x9bd5('0xd')]('mandatoryDisposition',_0x254afe);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x9bd5('0x15')](0x3)[_0x9bd5('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x9bd5('0x15')](0x3)[_0x9bd5('0x23')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0x572e=['#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','outbound','default','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','rrordered','ringall','setDataValue','strategy','getDataValue','dialMethod','inbound','booked','roundrobin','predictive','power','INTEGER','yes','all','once','TEXT','join','periodic_announce','joinempty','split','leavewhenempty','BOOLEAN','wrapuptime','progressive','Dial\x20Method.','UNSIGNED','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','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)','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\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length'];(function(_0x5ceeb5,_0x2d2cbb){var _0x1a563a=function(_0x28d27d){while(--_0x28d27d){_0x5ceeb5['push'](_0x5ceeb5['shift']());}};_0x1a563a(++_0x2d2cbb);}(_0x572e,0x9d));var _0xe572=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0x572e[_0x494d1f];return _0x457b6e;};'use strict';var Sequelize=require(_0xe572('0x0'));module[_0xe572('0x1')]={'name':{'type':Sequelize[_0xe572('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xe572('0x3')]('inbound',_0xe572('0x4')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0xe572('0x2')],'defaultValue':_0xe572('0x5')},'announce':{'type':Sequelize[_0xe572('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0xe572('0x3')]('rr','ringall',_0xe572('0x6'),_0xe572('0x7'),_0xe572('0x8'),_0xe572('0x9'),_0xe572('0xa'),_0xe572('0xb'),_0xe572('0xc')),'allowNull':![],'defaultValue':_0xe572('0xd'),'set':function(_0x45058d){this[_0xe572('0xe')](_0xe572('0xf'),_0x45058d?_0x45058d:'rrmemory');},'get':function(){var _0x1f59ec=this['getDataValue']('type');var _0x28b233=this[_0xe572('0x10')](_0xe572('0x11'));var _0x39afca=this['getDataValue'](_0xe572('0xf'));if(_0x1f59ec===_0xe572('0x12')){return _0x39afca;}if(_0x28b233===_0xe572('0x13')&&_0x39afca==='rrmemory'||_0x28b233==='booked'&&_0x39afca===_0xe572('0x14')){return _0x39afca;}if(_0x28b233==='progressive'||_0x28b233===_0xe572('0x15')||_0x28b233===_0xe572('0x16')){return _0x39afca;}return null;}},'servicelevel':{'type':Sequelize[_0xe572('0x17')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xe572('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xe572('0x17')](0xb)},'timeout':{'type':Sequelize[_0xe572('0x17')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xe572('0x17')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0xe572('0x17')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xe572('0x3')]('yes','no'),'defaultValue':_0xe572('0x18')},'autopause':{'type':Sequelize[_0xe572('0x3')](_0xe572('0x18'),'no',_0xe572('0x19')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xe572('0x17')](0xb)},'autopausebusy':{'type':Sequelize[_0xe572('0x3')](_0xe572('0x18'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xe572('0x3')](_0xe572('0x18'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xe572('0x17')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xe572('0x3')](_0xe572('0x18'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xe572('0x3')](_0xe572('0x18'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xe572('0x3')](_0xe572('0x18'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xe572('0x3')](_0xe572('0x18'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xe572('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xe572('0x17')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xe572('0x17')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xe572('0x3')](_0xe572('0x18'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xe572('0x3')](_0xe572('0x18'),'no'),'defaultValue':_0xe572('0x18')},'announce_holdtime':{'type':Sequelize[_0xe572('0x3')](_0xe572('0x18'),'no',_0xe572('0x1a')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xe572('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xe572('0x3')](_0xe572('0x18'),'no')},'announce_position_limit':{'type':Sequelize[_0xe572('0x17')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xe572('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xe572('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xe572('0x2')]},'queue_youarenext':{'type':Sequelize[_0xe572('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xe572('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xe572('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xe572('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xe572('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xe572('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xe572('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xe572('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xe572('0x2')]},'queue_quantity1':{'type':Sequelize[_0xe572('0x2')]},'queue_quantity2':{'type':Sequelize[_0xe572('0x2')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0xe572('0x2')]},'periodic_announce':{'type':Sequelize[_0xe572('0x1b')],'set':function(_0x286a80){this[_0xe572('0xe')]('periodic_announce',_0x286a80?_0x286a80[_0xe572('0x1c')](','):[]);},'get':function(){return this[_0xe572('0x10')]('periodic_announce')?this[_0xe572('0x10')](_0xe572('0x1d'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0xe572('0x2')],'defaultValue':_0xe572('0x18'),'set':function(_0xd8296b){this[_0xe572('0xe')](_0xe572('0x1e'),_0xd8296b?_0xd8296b['join'](','):[]);},'get':function(){return this[_0xe572('0x10')](_0xe572('0x1e'))?this[_0xe572('0x10')](_0xe572('0x1e'))[_0xe572('0x1f')](','):[];}},'leavewhenempty':{'type':Sequelize[_0xe572('0x2')],'defaultValue':'no','set':function(_0x76f5d9){this[_0xe572('0xe')](_0xe572('0x20'),_0x76f5d9?_0x76f5d9[_0xe572('0x1c')](','):[]);},'get':function(){return this[_0xe572('0x10')]('leavewhenempty')?this[_0xe572('0x10')](_0xe572('0x20'))['split'](','):[];}},'reportholdtime':{'type':Sequelize[_0xe572('0x3')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xe572('0x17')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xe572('0x2')]},'description':{'type':Sequelize[_0xe572('0x2')]},'acw':{'type':Sequelize[_0xe572('0x21')],'defaultValue':0x0,'set':function(_0x5a8651){this[_0xe572('0xe')]('acw',_0x5a8651);if(_0x5a8651){if(this[_0xe572('0x10')]('wrapuptime')<0x2){this['setDataValue'](_0xe572('0x22'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xe572('0x17')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xe572('0x21')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize['ENUM']('preview',_0xe572('0x23'),'power','predictive',_0xe572('0x13')),'defaultValue':'progressive','comment':_0xe572('0x24')},'dialLimitChannel':{'type':Sequelize[_0xe572('0x17')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0xe572('0x17')](0x4)[_0xe572('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0xe572('0x26')](0x2)[_0xe572('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xe572('0x27')},'dialPredictiveOptimization':{'type':Sequelize[_0xe572('0x3')](_0xe572('0x28'),'dropRate'),'defaultValue':_0xe572('0x29'),'comment':_0xe572('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xe572('0x26')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xe572('0x2b')},'dialPredictiveInterval':{'type':Sequelize[_0xe572('0x17')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xe572('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize[_0xe572('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xe572('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe572('0x2d')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':'tTxX','comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0xe572('0x17')](0x3)[_0xe572('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe572('0x2e')},'dialQueueProject':{'type':Sequelize[_0xe572('0x2')],'comment':_0xe572('0x2f')},'dialCongestionMaxRetry':{'type':Sequelize[_0xe572('0x17')](0x3)[_0xe572('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe572('0x30')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xe572('0x17')](0x5)[_0xe572('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe572('0x31')},'dialBusyMaxRetry':{'type':Sequelize[_0xe572('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe572('0x32')},'dialBusyRetryFrequency':{'type':Sequelize[_0xe572('0x17')](0x5)[_0xe572('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe572('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xe572('0x17')](0x3)[_0xe572('0x25')],'defaultValue':0x3,'comment':_0xe572('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe572('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe572('0x35')},'dialGlobalMaxRetry':{'type':Sequelize[_0xe572('0x17')](0x3)[_0xe572('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xe572('0x36')},'dialTimezone':{'type':Sequelize[_0xe572('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xe572('0x3')](_0xe572('0x37'),_0xe572('0x38'),_0xe572('0x39')),'defaultValue':_0xe572('0x37')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xe572('0x3a')},'dialAMDInitialSilence':{'type':Sequelize[_0xe572('0x17')](0x9)[_0xe572('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xe572('0x17')](0x9)[_0xe572('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xe572('0x17')](0x9)[_0xe572('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xe572('0x3b')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xe572('0x17')](0x9)[_0xe572('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe572('0x3c')},'dialAMDMinWordLength':{'type':Sequelize[_0xe572('0x17')](0x9)[_0xe572('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xe572('0x3d')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xe572('0x17')](0x9)[_0xe572('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xe572('0x17')](0x9)[_0xe572('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xe572('0x3e')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xe572('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xe572('0x3f')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xe572('0x17')](0x9)[_0xe572('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe572('0x40')},'dialRecallMeTimeout':{'type':Sequelize[_0xe572('0x17')](0x5)[_0xe572('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xe572('0x41')},'dialRecallInQueue':{'type':Sequelize[_0xe572('0x21')],'defaultValue':0x0,'comment':_0xe572('0x42')},'dialOrderByScheduledAt':{'type':Sequelize[_0xe572('0x3')](_0xe572('0x43'),'ASC'),'defaultValue':_0xe572('0x43')},'dialQueueProject2':{'type':Sequelize[_0xe572('0x2')],'comment':_0xe572('0x2f')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xe572('0x21')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xe572('0x17')](0x3)[_0xe572('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe572('0x44')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe572('0x45')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe572('0x17')],'allowNull':!![],'comment':_0xe572('0x46')},'mandatoryDisposition':{'type':Sequelize[_0xe572('0x21')],'defaultValue':![],'comment':_0xe572('0x47'),'set':function(_0x302db2){if(!_0x302db2)this[_0xe572('0xe')](_0xe572('0x48'),null);this[_0xe572('0xe')](_0xe572('0x49'),_0x302db2);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xe572('0x17')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xe572('0x17')](0x3)[_0xe572('0x25')],'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 4eb0da7..6725cb0 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 _0xee6a=['User','Agents','online','voicePause','interface','flatMap','forEach','penalty','each','UserVoiceQueueRt','SIP/%s','emit','userVoiceQueue:save','removeTeams','select','field','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','sequelize','toString','QueryTypes','every','TeamId','all','union','compact','ids','removeAgents','userVoiceQueue:remove','addAgents','omit','spread','isEmpty','push','isNil','isArray','getAgents','getMembers','CmList','getLists','addLists','dialCheckDuplicateType','always','insert','into','fromQuery','phone','scheduledAt','ListId','NOW()','ContactId','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./voiceQueue.socket','register','sendStatus','end','status','Content-Range','json','reject','save','update','then','destroy','VoiceQueues','inbound','QueueCampaigns','outbound','ignore','map','value','includes','type','find','name','UserProfileResource','error','stack','send','VoiceQueue','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','filters','pick','merge','filter','options','count','includeAll','rows','catch','show','params','include','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','clone','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','VoiceQueueId','CmHopper','findAll','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams'];(function(_0x3b2413,_0x131702){var _0x315318=function(_0x9eb7d){while(--_0x9eb7d){_0x3b2413['push'](_0x3b2413['shift']());}};_0x315318(++_0x131702);}(_0xee6a,0xfc));var _0xaee6=function(_0x4eacc2,_0xafb0b7){_0x4eacc2=_0x4eacc2-0x0;var _0x3b1911=_0xee6a[_0x4eacc2];return _0x3b1911;};'use strict';var pdf=require(_0xaee6('0x0'));var emlformat=require(_0xaee6('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xaee6('0x2'));var jsonpatch=require(_0xaee6('0x3'));var rp=require(_0xaee6('0x4'));var moment=require(_0xaee6('0x5'));var BPromise=require(_0xaee6('0x6'));var Mustache=require('mustache');var util=require(_0xaee6('0x7'));var path=require(_0xaee6('0x8'));var sox=require(_0xaee6('0x9'));var csv=require('to-csv');var ejs=require(_0xaee6('0xa'));var fs=require('fs');var _=require(_0xaee6('0xb'));var squel=require(_0xaee6('0xc'));var crypto=require(_0xaee6('0xd'));var jsforce=require(_0xaee6('0xe'));var deskjs=require(_0xaee6('0xf'));var toCsv=require(_0xaee6('0x10'));var querystring=require(_0xaee6('0x11'));var Papa=require(_0xaee6('0x12'));var Redis=require('ioredis');var authService=require(_0xaee6('0x13'));var qs=require(_0xaee6('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xaee6('0x15'));var utils=require(_0xaee6('0x16'));var config=require(_0xaee6('0x17'));var db=require(_0xaee6('0x18'))['db'];config[_0xaee6('0x19')]=_[_0xaee6('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaee6('0x19')]));require(_0xaee6('0x1b'))[_0xaee6('0x1c')](socket);function respondWithStatusCode(_0x21c823,_0x5ec623){_0x5ec623=_0x5ec623||0xcc;return function(_0x395e7f){if(_0x395e7f){return _0x21c823[_0xaee6('0x1d')](_0x5ec623);}return _0x21c823['status'](_0x5ec623)[_0xaee6('0x1e')]();};}function respondWithResult(_0x26b660,_0x435b63){_0x435b63=_0x435b63||0xc8;return function(_0xeeb02d){if(_0xeeb02d){return _0x26b660[_0xaee6('0x1f')](_0x435b63)['json'](_0xeeb02d);}};}function respondWithFilteredResult(_0x272c1f,_0x1fd747){return function(_0x978efa){if(_0x978efa){var _0x1f3738=_0x978efa['count'],_0x20d77d=_0x1fd747['offset'],_0x1f9ce0=_0x1fd747['offset']+_0x1fd747['limit'],_0x2e8e79;if(_0x1f9ce0>=_0x1f3738){_0x1f9ce0=_0x1f3738;_0x2e8e79=0xc8;}else{_0x2e8e79=0xce;}_0x272c1f[_0xaee6('0x1f')](_0x2e8e79);return _0x272c1f['set'](_0xaee6('0x20'),_0x20d77d+'-'+_0x1f9ce0+'/'+_0x1f3738)[_0xaee6('0x21')](_0x978efa);}return null;};}function patchUpdates(_0xc52e46){return function(_0x4cb0e0){try{jsonpatch['apply'](_0x4cb0e0,_0xc52e46,!![]);}catch(_0x2400be){return BPromise[_0xaee6('0x22')](_0x2400be);}return _0x4cb0e0[_0xaee6('0x23')]();};}function saveUpdates(_0x5ead88,_0x2968ce){return function(_0x32327c){if(_0x32327c){return _0x32327c[_0xaee6('0x24')](_0x5ead88)[_0xaee6('0x25')](function(_0x3adde4){return _0x3adde4;});}return null;};}function removeEntity(_0x237d00,_0x4482ce){return function(_0x39c96b){if(_0x39c96b){return _0x39c96b[_0xaee6('0x26')]()[_0xaee6('0x25')](function(){var _0x178912=_0x39c96b['get']({'plain':!![]});var _0x4ea7da=[{'name':_0xaee6('0x27'),'value':_0xaee6('0x28'),'ignore':![]},{'name':_0xaee6('0x29'),'value':_0xaee6('0x2a'),'ignore':![]}];var _0x34b0a8=_(_0x4ea7da)['filter'](_0xaee6('0x2b'))[_0xaee6('0x2c')]('value')[_0xaee6('0x2d')]();if(_[_0xaee6('0x2e')](_0x34b0a8,_0x178912[_0xaee6('0x2f')])){return;}var _0xa7447e=_[_0xaee6('0x30')](_0x4ea7da,[_0xaee6('0x2d'),_0x178912[_0xaee6('0x2f')]])[_0xaee6('0x31')];return db[_0xaee6('0x32')]['destroy']({'where':{'type':_0xa7447e,'resourceId':_0x178912['id']}})[_0xaee6('0x25')](function(){return _0x39c96b;});})[_0xaee6('0x25')](function(){_0x237d00['status'](0xcc)[_0xaee6('0x1e')]();});}};}function handleEntityNotFound(_0x450aea,_0x2740ec){return function(_0x358fb7){if(!_0x358fb7){_0x450aea[_0xaee6('0x1d')](0x194);}return _0x358fb7;};}function handleError(_0x4dc279,_0x1d01b5){_0x1d01b5=_0x1d01b5||0x1f4;return function(_0x3597da){logger[_0xaee6('0x33')](_0x3597da[_0xaee6('0x34')]);if(_0x3597da[_0xaee6('0x31')]){delete _0x3597da[_0xaee6('0x31')];}_0x4dc279['status'](_0x1d01b5)[_0xaee6('0x35')](_0x3597da);};}exports['index']=function(_0x376afb,_0xc1107c){var _0x5f3ae1={},_0x583eb8={},_0x51723d={'count':0x0,'rows':[]};var _0x1dc82c=db[_0xaee6('0x36')][_0xaee6('0x37')];_0x583eb8[_0xaee6('0x38')]=_[_0xaee6('0x39')](_0x1dc82c);_0x583eb8['query']=_[_0xaee6('0x39')](_0x376afb[_0xaee6('0x3a')]);_0x583eb8['filters']=_[_0xaee6('0x3b')](_0x583eb8[_0xaee6('0x38')],_0x583eb8[_0xaee6('0x3a')]);_0x5f3ae1['attributes']=_[_0xaee6('0x3b')](_0x583eb8[_0xaee6('0x38')],qs[_0xaee6('0x3c')](_0x376afb[_0xaee6('0x3a')][_0xaee6('0x3c')]));_0x5f3ae1[_0xaee6('0x3d')]=_0x5f3ae1[_0xaee6('0x3d')][_0xaee6('0x3e')]?_0x5f3ae1[_0xaee6('0x3d')]:_0x583eb8['model'];if(!_0x376afb[_0xaee6('0x3a')][_0xaee6('0x3f')](_0xaee6('0x40'))){_0x5f3ae1['limit']=qs[_0xaee6('0x41')](_0x376afb[_0xaee6('0x3a')]['limit']);_0x5f3ae1[_0xaee6('0x42')]=qs[_0xaee6('0x42')](_0x376afb[_0xaee6('0x3a')]['offset']);}_0x5f3ae1[_0xaee6('0x43')]=qs[_0xaee6('0x44')](_0x376afb[_0xaee6('0x3a')][_0xaee6('0x44')]);_0x5f3ae1[_0xaee6('0x45')]=qs[_0xaee6('0x46')](_[_0xaee6('0x47')](_0x376afb['query'],_0x583eb8[_0xaee6('0x46')]));if(_0x376afb[_0xaee6('0x3a')]['filter']){_0x5f3ae1[_0xaee6('0x45')]=_[_0xaee6('0x48')](_0x5f3ae1[_0xaee6('0x45')],{'$or':_['map'](_0x1dc82c,function(_0x2592ab){if(_0x2592ab[_0xaee6('0x2f')]['key']!=='VIRTUAL'){var _0x1927ba={};_0x1927ba[_0x2592ab['field']]={'$like':'%'+_0x376afb[_0xaee6('0x3a')][_0xaee6('0x49')]+'%'};return _0x1927ba;}})});}_0x5f3ae1=_['merge']({},_0x5f3ae1,_0x376afb[_0xaee6('0x4a')]);var _0x41f5f2={'where':_0x5f3ae1[_0xaee6('0x45')]};return db[_0xaee6('0x36')][_0xaee6('0x4b')](_0x41f5f2)[_0xaee6('0x25')](function(_0x20fa2e){_0x51723d['count']=_0x20fa2e;if(_0x376afb[_0xaee6('0x3a')][_0xaee6('0x4c')]){_0x5f3ae1['include']=[{'all':!![]}];}return db[_0xaee6('0x36')]['findAll'](_0x5f3ae1);})['then'](function(_0x4eb6e6){_0x51723d[_0xaee6('0x4d')]=_0x4eb6e6;return _0x51723d;})[_0xaee6('0x25')](respondWithFilteredResult(_0xc1107c,_0x5f3ae1))[_0xaee6('0x4e')](handleError(_0xc1107c,null));};exports[_0xaee6('0x4f')]=function(_0x30e5a9,_0x33345e){var _0x528969={'raw':![],'where':{'id':_0x30e5a9[_0xaee6('0x50')]['id']}},_0x392e22={};_0x392e22['model']=_[_0xaee6('0x39')](db[_0xaee6('0x36')]['rawAttributes']);_0x392e22[_0xaee6('0x3a')]=_['keys'](_0x30e5a9[_0xaee6('0x3a')]);_0x392e22['filters']=_[_0xaee6('0x3b')](_0x392e22[_0xaee6('0x38')],_0x392e22[_0xaee6('0x3a')]);_0x528969['attributes']=_[_0xaee6('0x3b')](_0x392e22[_0xaee6('0x38')],qs[_0xaee6('0x3c')](_0x30e5a9[_0xaee6('0x3a')][_0xaee6('0x3c')]));_0x528969[_0xaee6('0x3d')]=_0x528969[_0xaee6('0x3d')][_0xaee6('0x3e')]?_0x528969[_0xaee6('0x3d')]:_0x392e22['model'];if(_0x30e5a9['query'][_0xaee6('0x4c')]){_0x528969[_0xaee6('0x51')]=[{'all':!![]}];}_0x528969=_[_0xaee6('0x48')]({},_0x528969,_0x30e5a9[_0xaee6('0x4a')]);return db['VoiceQueue'][_0xaee6('0x30')](_0x528969)[_0xaee6('0x25')](handleEntityNotFound(_0x33345e,null))[_0xaee6('0x25')](respondWithResult(_0x33345e,null))[_0xaee6('0x4e')](handleError(_0x33345e,null));};exports[_0xaee6('0x52')]=function(_0x30103b,_0xde9523){return db[_0xaee6('0x36')][_0xaee6('0x52')](_0x30103b[_0xaee6('0x53')],{})[_0xaee6('0x25')](function(_0x47fe0f){var _0x1c2b28=_0x30103b[_0xaee6('0x54')][_0xaee6('0x55')]({'plain':!![]});if(!_0x1c2b28)throw new Error(_0xaee6('0x56'));if(_0x1c2b28[_0xaee6('0x57')]===_0xaee6('0x54')){var _0x260dde=_0x47fe0f[_0xaee6('0x55')]({'plain':!![]});var _0x3e38a6=[{'name':_0xaee6('0x27'),'value':'inbound'},{'name':'QueueCampaigns','value':'outbound'}];var _0x25ec0a=_[_0xaee6('0x30')](_0x3e38a6,['value',_0x260dde[_0xaee6('0x2f')]])[_0xaee6('0x31')];return db[_0xaee6('0x58')][_0xaee6('0x30')]({'where':{'name':_0x25ec0a,'userProfileId':_0x1c2b28[_0xaee6('0x59')]},'raw':!![]})[_0xaee6('0x25')](function(_0x334be1){if(_0x334be1&&_0x334be1[_0xaee6('0x5a')]===0x0){return db[_0xaee6('0x32')]['create']({'name':_0x260dde[_0xaee6('0x31')],'resourceId':_0x260dde['id'],'type':_0x334be1[_0xaee6('0x31')],'sectionId':_0x334be1['id']},{})[_0xaee6('0x25')](function(){return _0x47fe0f;});}else{return _0x47fe0f;}})[_0xaee6('0x4e')](function(_0x2edc35){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2edc35);throw _0x2edc35;});}return _0x47fe0f;})[_0xaee6('0x25')](respondWithResult(_0xde9523,0xc9))[_0xaee6('0x4e')](handleError(_0xde9523,null));};exports[_0xaee6('0x5b')]=function(_0x1c4677,_0x46a3cc){var _0x285b41={'raw':![],'where':{'id':_0x1c4677[_0xaee6('0x50')]['id']}},_0x22485d={};_0x22485d[_0xaee6('0x38')]=_[_0xaee6('0x39')](db[_0xaee6('0x36')][_0xaee6('0x37')]);_0x285b41[_0xaee6('0x3d')]=_['intersection'](_0x22485d[_0xaee6('0x38')],qs[_0xaee6('0x3c')](_0x1c4677[_0xaee6('0x3a')][_0xaee6('0x3c')]));_0x285b41[_0xaee6('0x3d')]=_0x285b41[_0xaee6('0x3d')][_0xaee6('0x3e')]?_0x285b41[_0xaee6('0x3d')]:_0x22485d[_0xaee6('0x38')];if(_0x1c4677[_0xaee6('0x3a')]['includeAll']){_0x285b41[_0xaee6('0x51')]=[{'all':!![]}];}_0x285b41=_['merge']({},_0x285b41,_0x1c4677[_0xaee6('0x4a')]);return db[_0xaee6('0x36')][_0xaee6('0x30')](_0x285b41)[_0xaee6('0x25')](handleEntityNotFound(_0x46a3cc,null))[_0xaee6('0x25')](function(_0x4b4433){if(_0x4b4433){var _0x20abac=_0x4b4433[_0xaee6('0x55')]({'plain':!![]});_0x20abac=qs['omit'](_0x20abac,['id',_0xaee6('0x5c'),_0xaee6('0x5d')]);_0x1c4677[_0xaee6('0x53')]=_['omit'](_0x1c4677[_0xaee6('0x53')],['id',_0xaee6('0x5c'),_0xaee6('0x5d')]);return db[_0xaee6('0x36')][_0xaee6('0x52')](_[_0xaee6('0x48')](_0x20abac,_0x1c4677[_0xaee6('0x53')]),{'include':_0x1c4677[_0xaee6('0x3a')][_0xaee6('0x4c')]?[{'all':!![]}]:undefined})[_0xaee6('0x25')](function(_0x2e2425){var _0x241c62=_0x1c4677[_0xaee6('0x54')]['get']({'plain':!![]});if(!_0x241c62)throw new Error(_0xaee6('0x56'));if(_0x241c62[_0xaee6('0x57')]===_0xaee6('0x54')){var _0x2a708e=_0x2e2425[_0xaee6('0x55')]({'plain':!![]});var _0x450183=[{'name':_0xaee6('0x27'),'value':_0xaee6('0x28')},{'name':_0xaee6('0x29'),'value':_0xaee6('0x2a')}];var _0xb76375=_[_0xaee6('0x30')](_0x450183,[_0xaee6('0x2d'),_0x2a708e['type']])[_0xaee6('0x31')];return db['UserProfileSection'][_0xaee6('0x30')]({'where':{'name':_0xb76375,'userProfileId':_0x241c62[_0xaee6('0x59')]},'raw':!![]})['then'](function(_0x118364){if(_0x118364&&_0x118364['autoAssociation']===0x0){return db[_0xaee6('0x32')][_0xaee6('0x52')]({'name':_0x2a708e[_0xaee6('0x31')],'resourceId':_0x2a708e['id'],'type':_0x118364[_0xaee6('0x31')],'sectionId':_0x118364['id']},{})[_0xaee6('0x25')](function(){return _0x2e2425;});}else{return _0x2e2425;}})[_0xaee6('0x4e')](function(_0xa608c0){logger[_0xaee6('0x33')](_0xaee6('0x5e'),_0xa608c0);throw _0xa608c0;});}return _0x2e2425;});}})['then'](respondWithResult(_0x46a3cc,0xc9))[_0xaee6('0x4e')](handleError(_0x46a3cc,null));};exports[_0xaee6('0x24')]=function(_0x26d1c3,_0x51c82e){if(_0x26d1c3[_0xaee6('0x53')]['id']){delete _0x26d1c3['body']['id'];}return db[_0xaee6('0x36')][_0xaee6('0x30')]({'where':{'id':_0x26d1c3[_0xaee6('0x50')]['id']}})[_0xaee6('0x25')](handleEntityNotFound(_0x51c82e,null))[_0xaee6('0x25')](saveUpdates(_0x26d1c3[_0xaee6('0x53')],null))[_0xaee6('0x25')](respondWithResult(_0x51c82e,null))[_0xaee6('0x4e')](handleError(_0x51c82e,null));};exports['destroy']=function(_0x13fae4,_0x1779b3){return db[_0xaee6('0x36')][_0xaee6('0x30')]({'where':{'id':_0x13fae4[_0xaee6('0x50')]['id']}})[_0xaee6('0x25')](handleEntityNotFound(_0x1779b3,null))[_0xaee6('0x25')](removeEntity(_0x1779b3,null))[_0xaee6('0x4e')](handleError(_0x1779b3,null));};exports[_0xaee6('0x5f')]=function(_0x315451,_0x4f0403,_0x119261){var _0xbb7b05={'raw':![],'where':{}};var _0x3c27f7={};var _0x21a200={'count':0x0,'rows':[]};return db[_0xaee6('0x36')][_0xaee6('0x60')]({'where':{'id':_0x315451[_0xaee6('0x50')]['id']}})[_0xaee6('0x25')](handleEntityNotFound(_0x4f0403,null))['then'](function(_0xd41c75){if(_0xd41c75){_0x3c27f7[_0xaee6('0x38')]=_[_0xaee6('0x39')](db['CmHopper'][_0xaee6('0x37')]);_0x3c27f7[_0xaee6('0x3a')]=_[_0xaee6('0x39')](_0x315451[_0xaee6('0x3a')]);_0x3c27f7[_0xaee6('0x46')]=_[_0xaee6('0x3b')](_0x3c27f7['model'],_0x3c27f7[_0xaee6('0x3a')]);_0xbb7b05[_0xaee6('0x3d')]=_[_0xaee6('0x3b')](_0x3c27f7[_0xaee6('0x38')],qs[_0xaee6('0x3c')](_0x315451[_0xaee6('0x3a')][_0xaee6('0x3c')]));_0xbb7b05[_0xaee6('0x3d')]=_0xbb7b05[_0xaee6('0x3d')][_0xaee6('0x3e')]?_0xbb7b05[_0xaee6('0x3d')]:_0x3c27f7['model'];if(!_0x315451['query'][_0xaee6('0x3f')](_0xaee6('0x40'))){_0xbb7b05[_0xaee6('0x41')]=qs['limit'](_0x315451['query'][_0xaee6('0x41')]);_0xbb7b05[_0xaee6('0x42')]=qs[_0xaee6('0x42')](_0x315451['query']['offset']);}_0xbb7b05[_0xaee6('0x43')]=qs[_0xaee6('0x44')](_0x315451['query'][_0xaee6('0x44')]);_0xbb7b05[_0xaee6('0x45')]=qs['filters'](_['pick'](_0x315451[_0xaee6('0x3a')],_0x3c27f7[_0xaee6('0x46')]));_0xbb7b05[_0xaee6('0x45')][_0xaee6('0x61')]=_0xd41c75['id'];if(_0x315451[_0xaee6('0x3a')][_0xaee6('0x49')]){_0xbb7b05[_0xaee6('0x45')]=_[_0xaee6('0x48')](_0xbb7b05[_0xaee6('0x45')],{'$or':_[_0xaee6('0x2c')](_0xbb7b05[_0xaee6('0x3d')],function(_0x370d75){var _0x375cff={};_0x375cff[_0x370d75]={'$like':'%'+_0x315451[_0xaee6('0x3a')][_0xaee6('0x49')]+'%'};return _0x375cff;})});}_0xbb7b05=_['merge']({},_0xbb7b05,_0x315451[_0xaee6('0x4a')]);return db[_0xaee6('0x62')][_0xaee6('0x4b')]({'where':_0xbb7b05[_0xaee6('0x45')]})[_0xaee6('0x25')](function(_0x492e01){_0x21a200[_0xaee6('0x4b')]=_0x492e01;if(_0x315451[_0xaee6('0x3a')]['includeAll']){_0xbb7b05[_0xaee6('0x51')]=[{'all':!![]}];}return db[_0xaee6('0x62')][_0xaee6('0x63')](_0xbb7b05);})['then'](function(_0x552d28){_0x21a200[_0xaee6('0x4d')]=_0x552d28;return _0x21a200;});}})[_0xaee6('0x25')](respondWithFilteredResult(_0x4f0403,_0xbb7b05))[_0xaee6('0x4e')](handleError(_0x4f0403,null));};exports['getHopperHistories']=function(_0x1774e4,_0x21a75e,_0x4bee66){var _0x198227={'raw':!![],'where':{}};var _0x3f5c11={};var _0x57fc77={'count':0x0,'rows':[]};return db[_0xaee6('0x36')][_0xaee6('0x60')]({'where':{'id':_0x1774e4[_0xaee6('0x50')]['id']}})[_0xaee6('0x25')](handleEntityNotFound(_0x21a75e,null))[_0xaee6('0x25')](function(_0x188f2b){if(_0x188f2b){_0x3f5c11[_0xaee6('0x38')]=_[_0xaee6('0x39')](db[_0xaee6('0x64')][_0xaee6('0x37')]);_0x3f5c11[_0xaee6('0x3a')]=_['keys'](_0x1774e4[_0xaee6('0x3a')]);_0x3f5c11[_0xaee6('0x46')]=_[_0xaee6('0x3b')](_0x3f5c11[_0xaee6('0x38')],_0x3f5c11[_0xaee6('0x3a')]);_0x198227[_0xaee6('0x3d')]=_[_0xaee6('0x3b')](_0x3f5c11['model'],qs[_0xaee6('0x3c')](_0x1774e4[_0xaee6('0x3a')][_0xaee6('0x3c')]));_0x198227[_0xaee6('0x3d')]=_0x198227['attributes'][_0xaee6('0x3e')]?_0x198227[_0xaee6('0x3d')]:_0x3f5c11['model'];if(!_0x1774e4['query']['hasOwnProperty'](_0xaee6('0x40'))){_0x198227[_0xaee6('0x41')]=qs[_0xaee6('0x41')](_0x1774e4[_0xaee6('0x3a')]['limit']);_0x198227[_0xaee6('0x42')]=qs[_0xaee6('0x42')](_0x1774e4[_0xaee6('0x3a')][_0xaee6('0x42')]);}_0x198227[_0xaee6('0x43')]=qs[_0xaee6('0x44')](_0x1774e4[_0xaee6('0x3a')][_0xaee6('0x44')]);_0x198227[_0xaee6('0x45')]=qs[_0xaee6('0x46')](_['pick'](_0x1774e4[_0xaee6('0x3a')],_0x3f5c11[_0xaee6('0x46')]));_0x198227[_0xaee6('0x45')][_0xaee6('0x61')]=_0x188f2b['id'];if(_0x1774e4[_0xaee6('0x3a')][_0xaee6('0x49')]){_0x198227[_0xaee6('0x45')]=_['merge'](_0x198227[_0xaee6('0x45')],{'$or':_[_0xaee6('0x2c')](_0x198227[_0xaee6('0x3d')],function(_0x35e606){var _0x58e29a={};_0x58e29a[_0x35e606]={'$like':'%'+_0x1774e4['query'][_0xaee6('0x49')]+'%'};return _0x58e29a;})});}_0x198227=_[_0xaee6('0x48')]({},_0x198227,_0x1774e4[_0xaee6('0x4a')]);return db['CmHopperHistory'][_0xaee6('0x4b')]({'where':_0x198227[_0xaee6('0x45')]})[_0xaee6('0x25')](function(_0x5b4614){_0x57fc77['count']=_0x5b4614;if(_0x1774e4[_0xaee6('0x3a')][_0xaee6('0x4c')]){_0x198227[_0xaee6('0x51')]=[{'all':!![]}];}return db[_0xaee6('0x64')][_0xaee6('0x63')](_0x198227);})['then'](function(_0x48df56){_0x57fc77[_0xaee6('0x4d')]=_0x48df56;return _0x57fc77;});}})['then'](respondWithFilteredResult(_0x21a75e,_0x198227))[_0xaee6('0x4e')](handleError(_0x21a75e,null));};exports['getHopperFinals']=function(_0x4d9ee5,_0x9aab53,_0x373f5e){var _0x441d87={'raw':!![],'where':{}};var _0x2e4a02={};var _0x1ffcba={'count':0x0,'rows':[]};return db[_0xaee6('0x36')][_0xaee6('0x60')]({'where':{'id':_0x4d9ee5[_0xaee6('0x50')]['id']}})[_0xaee6('0x25')](handleEntityNotFound(_0x9aab53,null))[_0xaee6('0x25')](function(_0x1a5325){if(_0x1a5325){_0x2e4a02[_0xaee6('0x38')]=_['keys'](db[_0xaee6('0x65')][_0xaee6('0x37')]);_0x2e4a02[_0xaee6('0x3a')]=_[_0xaee6('0x39')](_0x4d9ee5['query']);_0x2e4a02['filters']=_['intersection'](_0x2e4a02[_0xaee6('0x38')],_0x2e4a02[_0xaee6('0x3a')]);_0x441d87[_0xaee6('0x3d')]=_[_0xaee6('0x3b')](_0x2e4a02[_0xaee6('0x38')],qs[_0xaee6('0x3c')](_0x4d9ee5[_0xaee6('0x3a')]['fields']));_0x441d87[_0xaee6('0x3d')]=_0x441d87[_0xaee6('0x3d')]['length']?_0x441d87[_0xaee6('0x3d')]:_0x2e4a02[_0xaee6('0x38')];if(!_0x4d9ee5['query'][_0xaee6('0x3f')](_0xaee6('0x40'))){_0x441d87['limit']=qs[_0xaee6('0x41')](_0x4d9ee5[_0xaee6('0x3a')][_0xaee6('0x41')]);_0x441d87[_0xaee6('0x42')]=qs[_0xaee6('0x42')](_0x4d9ee5[_0xaee6('0x3a')]['offset']);}_0x441d87[_0xaee6('0x43')]=qs['sort'](_0x4d9ee5[_0xaee6('0x3a')][_0xaee6('0x44')]);_0x441d87[_0xaee6('0x45')]=qs[_0xaee6('0x46')](_[_0xaee6('0x47')](_0x4d9ee5['query'],_0x2e4a02['filters']));_0x441d87[_0xaee6('0x45')]['VoiceQueueId']=_0x1a5325['id'];if(_0x4d9ee5['query'][_0xaee6('0x49')]){_0x441d87[_0xaee6('0x45')]=_['merge'](_0x441d87['where'],{'$or':_[_0xaee6('0x2c')](_0x441d87[_0xaee6('0x3d')],function(_0x55f366){var _0x31171f={};_0x31171f[_0x55f366]={'$like':'%'+_0x4d9ee5['query']['filter']+'%'};return _0x31171f;})});}_0x441d87=_[_0xaee6('0x48')]({},_0x441d87,_0x4d9ee5[_0xaee6('0x4a')]);return db[_0xaee6('0x65')][_0xaee6('0x4b')]({'where':_0x441d87[_0xaee6('0x45')]})[_0xaee6('0x25')](function(_0x5233f5){_0x1ffcba[_0xaee6('0x4b')]=_0x5233f5;if(_0x4d9ee5[_0xaee6('0x3a')]['includeAll']){_0x441d87['include']=[{'all':!![]}];}return db[_0xaee6('0x65')][_0xaee6('0x63')](_0x441d87);})[_0xaee6('0x25')](function(_0x3f2d1d){_0x1ffcba[_0xaee6('0x4d')]=_0x3f2d1d;return _0x1ffcba;});}})[_0xaee6('0x25')](respondWithFilteredResult(_0x9aab53,_0x441d87))['catch'](handleError(_0x9aab53,null));};exports[_0xaee6('0x66')]=function(_0x3cbb0d,_0x346ccf,_0x5ac288){var _0x3bafed={'raw':!![],'where':{}};var _0x1be1e5={};var _0x43aee2={'count':0x0,'rows':[]};return db[_0xaee6('0x36')]['findOne']({'where':{'id':_0x3cbb0d[_0xaee6('0x50')]['id']}})[_0xaee6('0x25')](handleEntityNotFound(_0x346ccf,null))['then'](function(_0x5159a7){if(_0x5159a7){_0x1be1e5['model']=_[_0xaee6('0x39')](db[_0xaee6('0x67')][_0xaee6('0x37')]);_0x1be1e5[_0xaee6('0x3a')]=_[_0xaee6('0x39')](_0x3cbb0d[_0xaee6('0x3a')]);_0x1be1e5['filters']=_[_0xaee6('0x3b')](_0x1be1e5[_0xaee6('0x38')],_0x1be1e5[_0xaee6('0x3a')]);_0x3bafed[_0xaee6('0x3d')]=_[_0xaee6('0x3b')](_0x1be1e5[_0xaee6('0x38')],qs['fields'](_0x3cbb0d[_0xaee6('0x3a')][_0xaee6('0x3c')]));_0x3bafed[_0xaee6('0x3d')]=_0x3bafed[_0xaee6('0x3d')]['length']?_0x3bafed[_0xaee6('0x3d')]:_0x1be1e5[_0xaee6('0x38')];if(!_0x3cbb0d[_0xaee6('0x3a')][_0xaee6('0x3f')]('nolimit')){_0x3bafed[_0xaee6('0x41')]=qs[_0xaee6('0x41')](_0x3cbb0d[_0xaee6('0x3a')][_0xaee6('0x41')]);_0x3bafed[_0xaee6('0x42')]=qs[_0xaee6('0x42')](_0x3cbb0d['query']['offset']);}_0x3bafed[_0xaee6('0x43')]=qs[_0xaee6('0x44')](_0x3cbb0d['query'][_0xaee6('0x44')]);_0x3bafed[_0xaee6('0x45')]=qs[_0xaee6('0x46')](_[_0xaee6('0x47')](_0x3cbb0d['query'],_0x1be1e5[_0xaee6('0x46')]));_0x3bafed['where']['VoiceQueueId']=_0x5159a7['id'];if(_0x3cbb0d[_0xaee6('0x3a')][_0xaee6('0x49')]){_0x3bafed['where']=_[_0xaee6('0x48')](_0x3bafed[_0xaee6('0x45')],{'$or':_[_0xaee6('0x2c')](_0x3bafed['attributes'],function(_0xd6520){var _0x1d050f={};_0x1d050f[_0xd6520]={'$like':'%'+_0x3cbb0d[_0xaee6('0x3a')][_0xaee6('0x49')]+'%'};return _0x1d050f;})});}_0x3bafed=_[_0xaee6('0x48')]({},_0x3bafed,_0x3cbb0d['options']);return db[_0xaee6('0x67')]['count']({'where':_0x3bafed['where']})[_0xaee6('0x25')](function(_0x206678){_0x43aee2['count']=_0x206678;if(_0x3cbb0d[_0xaee6('0x3a')][_0xaee6('0x4c')]){_0x3bafed[_0xaee6('0x51')]=[{'all':!![]}];}return db[_0xaee6('0x67')]['findAll'](_0x3bafed);})[_0xaee6('0x25')](function(_0x3f933b){_0x43aee2[_0xaee6('0x4d')]=_0x3f933b;return _0x43aee2;});}})[_0xaee6('0x25')](respondWithFilteredResult(_0x346ccf,_0x3bafed))[_0xaee6('0x4e')](handleError(_0x346ccf,null));};exports[_0xaee6('0x68')]=function(_0x5ed676,_0xb8f77e,_0x4e063b){var _0x106fe3={};var _0x3b05c3={};var _0x112936;var _0x4a406f;return db['VoiceQueue']['findOne']({'where':{'id':_0x5ed676['params']['id']}})['then'](handleEntityNotFound(_0xb8f77e,null))[_0xaee6('0x25')](function(_0x5f552e){if(_0x5f552e){_0x112936=_0x5f552e;_0x3b05c3[_0xaee6('0x38')]=_['keys'](db[_0xaee6('0x69')][_0xaee6('0x37')]);_0x3b05c3['query']=_[_0xaee6('0x39')](_0x5ed676['query']);_0x3b05c3[_0xaee6('0x46')]=_[_0xaee6('0x3b')](_0x3b05c3['model'],_0x3b05c3['query']);_0x106fe3[_0xaee6('0x3d')]=_[_0xaee6('0x3b')](_0x3b05c3[_0xaee6('0x38')],qs[_0xaee6('0x3c')](_0x5ed676['query']['fields']));_0x106fe3['attributes']=_0x106fe3['attributes'][_0xaee6('0x3e')]?_0x106fe3[_0xaee6('0x3d')]:_0x3b05c3[_0xaee6('0x38')];_0x106fe3['order']=qs[_0xaee6('0x44')](_0x5ed676[_0xaee6('0x3a')][_0xaee6('0x44')]);_0x106fe3[_0xaee6('0x45')]=qs[_0xaee6('0x46')](_[_0xaee6('0x47')](_0x5ed676[_0xaee6('0x3a')],_0x3b05c3['filters']));if(_0x5ed676[_0xaee6('0x3a')]['filter']){_0x106fe3['where']=_[_0xaee6('0x48')](_0x106fe3[_0xaee6('0x45')],{'$or':_['map'](_0x106fe3['attributes'],function(_0x202b23){var _0x510eff={};_0x510eff[_0x202b23]={'$like':'%'+_0x5ed676[_0xaee6('0x3a')]['filter']+'%'};return _0x510eff;})});}_0x106fe3=_[_0xaee6('0x48')]({},_0x106fe3,_0x5ed676[_0xaee6('0x4a')]);return _0x112936[_0xaee6('0x68')](_0x106fe3);}})['then'](function(_0x12fa3b){if(_0x12fa3b){_0x4a406f=_0x12fa3b['length'];if(!_0x5ed676[_0xaee6('0x3a')][_0xaee6('0x3f')](_0xaee6('0x40'))){_0x106fe3['limit']=qs[_0xaee6('0x41')](_0x5ed676[_0xaee6('0x3a')][_0xaee6('0x41')]);_0x106fe3['offset']=qs['offset'](_0x5ed676[_0xaee6('0x3a')][_0xaee6('0x42')]);}return _0x112936[_0xaee6('0x68')](_0x106fe3);}})[_0xaee6('0x25')](function(_0x3ad4fc){if(_0x3ad4fc){return _0x3ad4fc?{'count':_0x4a406f,'rows':_0x3ad4fc}:null;}})[_0xaee6('0x25')](respondWithResult(_0xb8f77e,null))[_0xaee6('0x4e')](handleError(_0xb8f77e,null));};exports[_0xaee6('0x6a')]=function(_0x3498e9,_0x3ea8b0,_0x2ca50b){var _0x26e814=_0x3498e9[_0xaee6('0x53')][_0xaee6('0x6b')];return db['Team'][_0xaee6('0x63')]({'where':{'id':_[_0xaee6('0x2c')](_0x26e814,'id')},'attributes':['id'],'include':[{'model':db[_0xaee6('0x6c')],'as':_0xaee6('0x6d'),'attributes':['id',_0xaee6('0x31'),_0xaee6('0x6e'),_0xaee6('0x6f'),_0xaee6('0x70')],'raw':!![]}]})[_0xaee6('0x25')](function(_0x4c4f53){if(_0x4c4f53){var _0x334873=_[_0xaee6('0x71')](_0x4c4f53,function(_0x3228ce){var _0xcb038d=_0x3228ce[_0xaee6('0x55')]({'plain':!![]});_0xcb038d[_0xaee6('0x6d')][_0xaee6('0x72')](function(_0x4f464a){_0x4f464a[_0xaee6('0x73')]=_[_0xaee6('0x30')](_0x26e814,{'id':_0xcb038d['id']})[_0xaee6('0x73')];});return _0xcb038d[_0xaee6('0x6d')];});return db[_0xaee6('0x36')]['find']({'where':{'id':_0x3498e9['params']['id']}})[_0xaee6('0x25')](function(_0x8b5d6d){return db['sequelize']['transaction'](function(_0x3a41c0){return _0x8b5d6d[_0xaee6('0x6a')](_['map'](_0x26e814,'id'),{'transaction':_0x3a41c0})[_0xaee6('0x25')](function(){return BPromise[_0xaee6('0x74')](_0x334873,function(_0x3bedc6){return db['UserVoiceQueue']['findOrCreate']({'where':{'UserId':_0x3bedc6['id'],'VoiceQueueId':_0x3498e9[_0xaee6('0x50')]['id']},'defaults':{'penalty':_0x3bedc6[_0xaee6('0x73')]},'transaction':_0x3a41c0});});})[_0xaee6('0x25')](function(){return BPromise['each'](_[_0xaee6('0x49')](_0x334873,{'online':!![]}),function(_0x254bfd){return db[_0xaee6('0x75')]['upsert']({'membername':_0x254bfd[_0xaee6('0x31')],'UserId':_0x254bfd['id'],'queue_name':_0x8b5d6d[_0xaee6('0x31')],'VoiceQueueId':_0x8b5d6d['id'],'interface':_['isNil'](_0x254bfd[_0xaee6('0x70')])?util['format'](_0xaee6('0x76'),_0x254bfd[_0xaee6('0x31')]):_0x254bfd[_0xaee6('0x70')],'paused':_0x254bfd[_0xaee6('0x6f')]||![],'penalty':_0x254bfd[_0xaee6('0x73')]},{'transaction':_0x3a41c0});});})[_0xaee6('0x25')](function(){_0x334873['forEach'](function(_0x452e48){socket[_0xaee6('0x77')](_0xaee6('0x78'),{'UserId':_0x452e48['id'],'VoiceQueueId':_0x8b5d6d['id']});});});});});}})[_0xaee6('0x25')](respondWithStatusCode(_0x3ea8b0,null))[_0xaee6('0x4e')](handleError(_0x3ea8b0,null));};exports[_0xaee6('0x79')]=function(_0x435886,_0x48e5ba,_0x15e495){return db[_0xaee6('0x69')]['findAll']({'where':{'id':_0x435886['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xaee6('0x6c')],'as':_0xaee6('0x6d'),'attributes':['id'],'raw':!![]}]})[_0xaee6('0x25')](handleEntityNotFound(_0x48e5ba,null))[_0xaee6('0x25')](function(_0x337af1){var _0xb8e568=_[_0xaee6('0x2c')](_0x337af1,'id');var _0x2d3e59=[];var _0x31a78c=[];var _0x522f02=squel[_0xaee6('0x7a')]();_0x522f02[_0xaee6('0x7b')]('tq.TeamId')[_0xaee6('0x7c')](_0xaee6('0x7d'),'tq')[_0xaee6('0x7e')](_0xaee6('0x7f'),'ut',_0xaee6('0x80'))[_0xaee6('0x45')](_0xaee6('0x81'),_0x435886[_0xaee6('0x50')]['id']);for(var _0x6a40e7=0x0;_0x6a40e7<_0x337af1[_0xaee6('0x3e')];_0x6a40e7+=0x1){let _0x24cd92=_0x337af1[_0x6a40e7];for(var _0x5dfeed=0x0;_0x5dfeed<_0x24cd92[_0xaee6('0x6d')][_0xaee6('0x3e')];_0x5dfeed+=0x1){let _0x544be8=_0x24cd92['Agents'][_0x5dfeed];var _0x31615e=_0x522f02['clone']();_0x31615e[_0xaee6('0x45')](_0xaee6('0x82'),_0x544be8['id']);_0x31a78c['push'](db[_0xaee6('0x83')][_0xaee6('0x3a')](_0x31615e[_0xaee6('0x84')](),{'type':db[_0xaee6('0x83')][_0xaee6('0x85')]['SELECT']})[_0xaee6('0x25')](function(_0x395bd9){if(_0x395bd9[_0xaee6('0x3e')]===0x1){return _0x544be8['id'];}else{var _0x422cfc=_[_0xaee6('0x86')](_[_0xaee6('0x2c')](_0x395bd9,_0xaee6('0x87')),function(_0x2a8b00){return _[_0xaee6('0x2e')](_0xb8e568,_0x2a8b00);});if(_0x422cfc){return _0x544be8['id'];}}}));}}return BPromise[_0xaee6('0x88')](_0x31a78c)[_0xaee6('0x25')](function(_0x556d70){_0x2d3e59=_(_0x2d3e59)[_0xaee6('0x89')](_0x556d70)[_0xaee6('0x8a')]()['value']();return db[_0xaee6('0x36')]['find']({'where':{'id':_0x435886['params']['id']}})[_0xaee6('0x25')](function(_0x17ef21){return db[_0xaee6('0x83')]['transaction'](function(_0x2a3f03){return _0x17ef21[_0xaee6('0x79')](_0x435886[_0xaee6('0x3a')][_0xaee6('0x8b')],{'transaction':_0x2a3f03})[_0xaee6('0x25')](function(){if(!_['isEmpty'](_0x2d3e59)){return _0x17ef21[_0xaee6('0x8c')](_0x2d3e59,{'transaction':_0x2a3f03})[_0xaee6('0x25')](function(){return db[_0xaee6('0x75')]['destroy']({'where':{'VoiceQueueId':_0x435886['params']['id'],'UserId':_0x2d3e59},'transaction':_0x2a3f03});});}})[_0xaee6('0x25')](function(){_0x2d3e59[_0xaee6('0x72')](function(_0x31cdff){socket[_0xaee6('0x77')](_0xaee6('0x8d'),{'UserId':_0x31cdff,'VoiceQueueId':_0x17ef21['id']});});});});});});})[_0xaee6('0x25')](respondWithStatusCode(_0x48e5ba,null))[_0xaee6('0x4e')](handleError(_0x48e5ba,null));};exports[_0xaee6('0x8e')]=function(_0x2c06c7,_0x33b150,_0x27f987){var _0x4c0c1e,_0x336741;return db[_0xaee6('0x36')][_0xaee6('0x30')]({'where':{'id':_0x2c06c7[_0xaee6('0x50')]['id']}})[_0xaee6('0x25')](handleEntityNotFound(_0x33b150,null))[_0xaee6('0x25')](function(_0xad954b){if(_0xad954b){_0x336741=_0xad954b;return _0xad954b['addAgents'](_0x2c06c7[_0xaee6('0x53')][_0xaee6('0x8b')],_[_0xaee6('0x8f')](_0x2c06c7[_0xaee6('0x53')],[_0xaee6('0x8b'),'id'])||{})[_0xaee6('0x90')](function(_0x4eb9b7){for(var _0x1eeff2=0x0;_0x1eeff2<_0x2c06c7[_0xaee6('0x53')][_0xaee6('0x8b')][_0xaee6('0x3e')];_0x1eeff2+=0x1){socket[_0xaee6('0x77')](_0xaee6('0x78'),{'UserId':_0x2c06c7[_0xaee6('0x53')]['ids'][_0x1eeff2],'VoiceQueueId':_0x2c06c7[_0xaee6('0x50')]['id']});}return _0x4eb9b7;});}})['then'](function(_0x59b041){_0x4c0c1e=_0x59b041||[];if(_0x336741){return db['User'][_0xaee6('0x63')]({'where':{'id':_0x2c06c7['body'][_0xaee6('0x8b')]},'attributes':['id','name',_0xaee6('0x6e'),_0xaee6('0x6f'),_0xaee6('0x70')],'raw':!![]});}})[_0xaee6('0x25')](function(_0x2055e8){if(!_[_0xaee6('0x91')](_0x2055e8)){var _0x281495=[];for(var _0x528c2a=0x0;_0x528c2a<_0x2055e8['length'];_0x528c2a++){if(_0x2055e8[_0x528c2a][_0xaee6('0x6e')]){_0x281495[_0xaee6('0x92')](db[_0xaee6('0x75')]['upsert']({'membername':_0x2055e8[_0x528c2a]['name'],'UserId':_0x2055e8[_0x528c2a]['id'],'queue_name':_0x336741[_0xaee6('0x31')],'VoiceQueueId':_0x336741['id'],'interface':_[_0xaee6('0x93')](_0x2055e8[_0x528c2a]['interface'])?util['format'](_0xaee6('0x76'),_0x2055e8[_0x528c2a][_0xaee6('0x31')]):_0x2055e8[_0x528c2a][_0xaee6('0x70')],'paused':_0x2055e8[_0x528c2a][_0xaee6('0x6f')]||![],'penalty':_0x2c06c7[_0xaee6('0x53')]['penalty']||0x0}));}}return BPromise['all'](_0x281495);}})[_0xaee6('0x25')](function(){return _0x4c0c1e;})[_0xaee6('0x25')](respondWithResult(_0x33b150,null))[_0xaee6('0x4e')](handleError(_0x33b150,null));};exports[_0xaee6('0x8c')]=function(_0x986c4a,_0x1d8b2d,_0x39ada6){return db[_0xaee6('0x36')][_0xaee6('0x30')]({'where':{'id':_0x986c4a[_0xaee6('0x50')]['id']}})[_0xaee6('0x25')](handleEntityNotFound(_0x1d8b2d,null))[_0xaee6('0x25')](function(_0x1c99e2){if(_0x1c99e2){return _0x1c99e2[_0xaee6('0x8c')](_0x986c4a[_0xaee6('0x3a')][_0xaee6('0x8b')])[_0xaee6('0x25')](function(){if(_[_0xaee6('0x94')](_0x986c4a['query'][_0xaee6('0x8b')])){for(var _0x412a00=0x0;_0x412a00<_0x986c4a[_0xaee6('0x3a')][_0xaee6('0x8b')]['length'];_0x412a00+=0x1){socket['emit']('userVoiceQueue:remove',{'UserId':Number(_0x986c4a[_0xaee6('0x3a')]['ids'][_0x412a00]),'VoiceQueueId':Number(_0x986c4a[_0xaee6('0x50')]['id'])});}}else{socket['emit'](_0xaee6('0x8d'),{'UserId':Number(_0x986c4a[_0xaee6('0x3a')][_0xaee6('0x8b')]),'VoiceQueueId':Number(_0x986c4a[_0xaee6('0x50')]['id'])});}});}})['then'](function(_0x17789e){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x986c4a[_0xaee6('0x50')]['id'],'UserId':_0x986c4a[_0xaee6('0x3a')][_0xaee6('0x8b')]}})[_0xaee6('0x25')](function(){return _0x17789e;});})[_0xaee6('0x25')](respondWithStatusCode(_0x1d8b2d,null))['catch'](handleError(_0x1d8b2d,null));};exports[_0xaee6('0x95')]=function(_0x5f0a49,_0x59d2e2,_0x5ab8fb){var _0x21c185={};var _0x5359dd={};var _0xe96bb7;var _0x1ad567;return db[_0xaee6('0x36')][_0xaee6('0x60')]({'where':{'id':_0x5f0a49[_0xaee6('0x50')]['id']}})[_0xaee6('0x25')](handleEntityNotFound(_0x59d2e2,null))[_0xaee6('0x25')](function(_0x371d5c){if(_0x371d5c){_0xe96bb7=_0x371d5c;_0x5359dd['model']=_[_0xaee6('0x39')](db[_0xaee6('0x6c')][_0xaee6('0x37')]);_0x5359dd[_0xaee6('0x3a')]=_['keys'](_0x5f0a49['query']);_0x5359dd['filters']=_[_0xaee6('0x3b')](_0x5359dd['model'],_0x5359dd[_0xaee6('0x3a')]);_0x21c185[_0xaee6('0x3d')]=_['intersection'](_0x5359dd[_0xaee6('0x38')],qs[_0xaee6('0x3c')](_0x5f0a49[_0xaee6('0x3a')][_0xaee6('0x3c')]));_0x21c185[_0xaee6('0x3d')]=_0x21c185['attributes'][_0xaee6('0x3e')]?_0x21c185['attributes']:_0x5359dd[_0xaee6('0x38')];_0x21c185[_0xaee6('0x43')]=qs['sort'](_0x5f0a49[_0xaee6('0x3a')][_0xaee6('0x44')]);_0x21c185['where']=qs['filters'](_[_0xaee6('0x47')](_0x5f0a49[_0xaee6('0x3a')],_0x5359dd['filters']));if(_0x5f0a49[_0xaee6('0x3a')]['filter']){_0x21c185['where']=_['merge'](_0x21c185[_0xaee6('0x45')],{'$or':_['map'](_0x21c185[_0xaee6('0x3d')],function(_0x111578){var _0xedcd4={};_0xedcd4[_0x111578]={'$like':'%'+_0x5f0a49[_0xaee6('0x3a')][_0xaee6('0x49')]+'%'};return _0xedcd4;})});}_0x21c185=_[_0xaee6('0x48')]({},_0x21c185,_0x5f0a49['options']);return _0xe96bb7['getAgents'](_0x21c185);}})['then'](function(_0x43256){if(_0x43256){_0x1ad567=_0x43256[_0xaee6('0x3e')];if(!_0x5f0a49[_0xaee6('0x3a')][_0xaee6('0x3f')](_0xaee6('0x40'))){_0x21c185[_0xaee6('0x41')]=qs[_0xaee6('0x41')](_0x5f0a49[_0xaee6('0x3a')][_0xaee6('0x41')]);_0x21c185[_0xaee6('0x42')]=qs[_0xaee6('0x42')](_0x5f0a49[_0xaee6('0x3a')][_0xaee6('0x42')]);}return _0xe96bb7[_0xaee6('0x95')](_0x21c185);}})[_0xaee6('0x25')](function(_0x960cad){if(_0x960cad){return _0x960cad?{'count':_0x1ad567,'rows':_0x960cad}:null;}})[_0xaee6('0x25')](respondWithResult(_0x59d2e2,null))['catch'](handleError(_0x59d2e2,null));};exports[_0xaee6('0x96')]=function(_0x3262b8,_0x5c9fb6,_0x31ac5e){var _0x2ad88c={};var _0x347e30={};var _0x1ae3b5;var _0x1606c6;return db[_0xaee6('0x36')][_0xaee6('0x60')]({'where':{'id':_0x3262b8['params']['id']}})['then'](handleEntityNotFound(_0x5c9fb6,null))[_0xaee6('0x25')](function(_0x144b24){if(_0x144b24){_0x1ae3b5=_0x144b24;_0x347e30[_0xaee6('0x38')]=_[_0xaee6('0x39')](db[_0xaee6('0x75')][_0xaee6('0x37')]);_0x347e30['query']=_['keys'](_0x3262b8[_0xaee6('0x3a')]);_0x347e30['filters']=_['intersection'](_0x347e30[_0xaee6('0x38')],_0x347e30['query']);_0x2ad88c[_0xaee6('0x3d')]=_[_0xaee6('0x3b')](_0x347e30[_0xaee6('0x38')],qs[_0xaee6('0x3c')](_0x3262b8[_0xaee6('0x3a')][_0xaee6('0x3c')]));_0x2ad88c[_0xaee6('0x3d')]=_0x2ad88c[_0xaee6('0x3d')][_0xaee6('0x3e')]?_0x2ad88c[_0xaee6('0x3d')]:_0x347e30[_0xaee6('0x38')];_0x2ad88c[_0xaee6('0x43')]=qs[_0xaee6('0x44')](_0x3262b8['query']['sort']);_0x2ad88c['where']=qs['filters'](_['pick'](_0x3262b8[_0xaee6('0x3a')],_0x347e30[_0xaee6('0x46')]));if(_0x3262b8['query'][_0xaee6('0x49')]){_0x2ad88c[_0xaee6('0x45')]=_['merge'](_0x2ad88c['where'],{'$or':_[_0xaee6('0x2c')](_0x2ad88c[_0xaee6('0x3d')],function(_0x10dfb0){var _0x4a5543={};_0x4a5543[_0x10dfb0]={'$like':'%'+_0x3262b8['query'][_0xaee6('0x49')]+'%'};return _0x4a5543;})});}_0x2ad88c=_[_0xaee6('0x48')]({},_0x2ad88c,_0x3262b8[_0xaee6('0x4a')]);return _0x1ae3b5['getMembers'](_0x2ad88c);}})[_0xaee6('0x25')](function(_0x4082a1){if(_0x4082a1){_0x1606c6=_0x4082a1[_0xaee6('0x3e')];if(!_0x3262b8[_0xaee6('0x3a')][_0xaee6('0x3f')]('nolimit')){_0x2ad88c[_0xaee6('0x41')]=qs[_0xaee6('0x41')](_0x3262b8['query'][_0xaee6('0x41')]);_0x2ad88c[_0xaee6('0x42')]=qs[_0xaee6('0x42')](_0x3262b8[_0xaee6('0x3a')][_0xaee6('0x42')]);}return _0x1ae3b5[_0xaee6('0x96')](_0x2ad88c);}})['then'](function(_0x1772a4){return _0x1772a4?{'count':_0x1606c6,'rows':_0x1772a4}:null;})[_0xaee6('0x25')](respondWithResult(_0x5c9fb6,null))[_0xaee6('0x4e')](handleError(_0x5c9fb6,null));};exports['getLists']=function(_0x2e58e9,_0x41e063,_0x1af557){var _0x1781fb={};var _0x2c71f3={};var _0x58c114;var _0x312c8b;return db[_0xaee6('0x36')][_0xaee6('0x60')]({'where':{'id':_0x2e58e9[_0xaee6('0x50')]['id']}})[_0xaee6('0x25')](handleEntityNotFound(_0x41e063,null))[_0xaee6('0x25')](function(_0x3eb83e){if(_0x3eb83e){_0x58c114=_0x3eb83e;_0x2c71f3[_0xaee6('0x38')]=_['keys'](db[_0xaee6('0x97')]['rawAttributes']);_0x2c71f3[_0xaee6('0x3a')]=_[_0xaee6('0x39')](_0x2e58e9[_0xaee6('0x3a')]);_0x2c71f3['filters']=_['intersection'](_0x2c71f3[_0xaee6('0x38')],_0x2c71f3[_0xaee6('0x3a')]);_0x1781fb[_0xaee6('0x3d')]=_[_0xaee6('0x3b')](_0x2c71f3['model'],qs['fields'](_0x2e58e9[_0xaee6('0x3a')][_0xaee6('0x3c')]));_0x1781fb[_0xaee6('0x3d')]=_0x1781fb[_0xaee6('0x3d')][_0xaee6('0x3e')]?_0x1781fb[_0xaee6('0x3d')]:_0x2c71f3[_0xaee6('0x38')];_0x1781fb[_0xaee6('0x43')]=qs[_0xaee6('0x44')](_0x2e58e9[_0xaee6('0x3a')][_0xaee6('0x44')]);_0x1781fb[_0xaee6('0x45')]=qs['filters'](_[_0xaee6('0x47')](_0x2e58e9[_0xaee6('0x3a')],_0x2c71f3['filters']));if(_0x2e58e9[_0xaee6('0x3a')][_0xaee6('0x49')]){_0x1781fb[_0xaee6('0x45')]=_[_0xaee6('0x48')](_0x1781fb[_0xaee6('0x45')],{'$or':_[_0xaee6('0x2c')](_0x1781fb[_0xaee6('0x3d')],function(_0x1582e9){var _0x507d14={};_0x507d14[_0x1582e9]={'$like':'%'+_0x2e58e9[_0xaee6('0x3a')][_0xaee6('0x49')]+'%'};return _0x507d14;})});}_0x1781fb=_[_0xaee6('0x48')]({},_0x1781fb,_0x2e58e9[_0xaee6('0x4a')]);return _0x58c114[_0xaee6('0x98')](_0x1781fb);}})[_0xaee6('0x25')](function(_0x4d774b){if(_0x4d774b){_0x312c8b=_0x4d774b[_0xaee6('0x3e')];if(!_0x2e58e9['query'][_0xaee6('0x3f')](_0xaee6('0x40'))){_0x1781fb[_0xaee6('0x41')]=qs['limit'](_0x2e58e9['query'][_0xaee6('0x41')]);_0x1781fb[_0xaee6('0x42')]=qs[_0xaee6('0x42')](_0x2e58e9[_0xaee6('0x3a')][_0xaee6('0x42')]);}return _0x58c114[_0xaee6('0x98')](_0x1781fb);}})['then'](function(_0x5daa70){if(_0x5daa70){return _0x5daa70?{'count':_0x312c8b,'rows':_0x5daa70}:null;}})['then'](respondWithResult(_0x41e063,null))[_0xaee6('0x4e')](handleError(_0x41e063,null));};exports[_0xaee6('0x99')]=function(_0x470f03,_0x5134fd,_0x2c5475){var _0x4a4c25,_0x3a902f;return db['VoiceQueue']['find']({'where':{'id':_0x470f03['params']['id']}})[_0xaee6('0x25')](handleEntityNotFound(_0x5134fd,null))[_0xaee6('0x25')](function(_0x5b9f76){if(_0x5b9f76){_0x3a902f=_0x5b9f76;return _0x5b9f76['addLists'](_0x470f03[_0xaee6('0x53')][_0xaee6('0x8b')],_[_0xaee6('0x8f')](_0x470f03['body'],[_0xaee6('0x8b'),'id'])||{});}return null;})[_0xaee6('0x90')](function(_0x2fb59b){var _0x150899;_0x4a4c25=_0x2fb59b||[];var _0x525a8d=[];if(_0x2fb59b){for(var _0x21bc14=0x0;_0x21bc14<_0x2fb59b[_0xaee6('0x3e')];_0x21bc14+=0x1){var _0x1ef0e3=_0x2fb59b[_0x21bc14][_0xaee6('0x55')]({'plain':!![]});_0x3a902f[_0xaee6('0x9a')]=_0x470f03[_0xaee6('0x53')]['dialCheckDuplicateType']?_0x470f03[_0xaee6('0x53')][_0xaee6('0x9a')]:_0x3a902f[_0xaee6('0x9a')];switch(_0x3a902f[_0xaee6('0x9a')]){case _0xaee6('0x9b'):_0x150899=squel[_0xaee6('0x9c')]()[_0xaee6('0x9d')]('cm_hopper')[_0xaee6('0x9e')]([_0xaee6('0x9f'),_0xaee6('0xa0'),'ContactId',_0xaee6('0xa1'),_0xaee6('0x61'),'createdAt',_0xaee6('0x5d')],squel[_0xaee6('0x7a')]()[_0xaee6('0x7b')](_0xaee6('0x9f'),_0xaee6('0x9f'))['field'](_0xaee6('0xa2'),_0xaee6('0xa0'))[_0xaee6('0x7b')]('id',_0xaee6('0xa3'))['field'](_0x1ef0e3[_0xaee6('0xa4')][_0xaee6('0x84')](),_0xaee6('0xa1'))['field'](_0x470f03[_0xaee6('0x50')]['id'][_0xaee6('0x84')](),_0xaee6('0x61'))[_0xaee6('0x7b')](_0xaee6('0xa2'),_0xaee6('0x5c'))[_0xaee6('0x7b')](_0xaee6('0xa2'),_0xaee6('0x5d'))[_0xaee6('0x7c')](_0xaee6('0xa5'))[_0xaee6('0x45')](_0xaee6('0xa6'))[_0xaee6('0x45')](_0xaee6('0xa7'),_0x1ef0e3[_0xaee6('0xa4')][_0xaee6('0x84')]())[_0xaee6('0x45')](_0xaee6('0xa8'))[_0xaee6('0x45')]('phone\x20NOT\x20IN\x20(?)',squel[_0xaee6('0x7a')]()[_0xaee6('0x7b')](_0xaee6('0xa9'))[_0xaee6('0x7c')](_0xaee6('0xaa'))['where'](_0xaee6('0x81'),_0x470f03['params']['id'][_0xaee6('0x84')]()))[_0xaee6('0x45')](_0xaee6('0xab'),squel[_0xaee6('0x7a')]()['field'](_0xaee6('0xac'))[_0xaee6('0x7c')](_0xaee6('0xad'))[_0xaee6('0x45')]('VoiceQueueId\x20=\x20?',_0x470f03[_0xaee6('0x50')]['id'][_0xaee6('0x84')]())))[_0xaee6('0x84')]();break;case _0xaee6('0xae'):_0x150899=squel[_0xaee6('0x9c')]()['into'](_0xaee6('0xad'))[_0xaee6('0x9e')]([_0xaee6('0x9f'),_0xaee6('0xa0'),_0xaee6('0xa3'),_0xaee6('0xa1'),_0xaee6('0x61'),_0xaee6('0x5c'),_0xaee6('0x5d')],squel[_0xaee6('0x7a')]()[_0xaee6('0x7b')](_0xaee6('0x9f'),_0xaee6('0x9f'))[_0xaee6('0x7b')]('NOW()','scheduledAt')[_0xaee6('0x7b')]('id','ContactId')[_0xaee6('0x7b')](_0x1ef0e3[_0xaee6('0xa4')][_0xaee6('0x84')](),_0xaee6('0xa1'))['field'](_0x470f03[_0xaee6('0x50')]['id']['toString'](),_0xaee6('0x61'))['field'](_0xaee6('0xa2'),_0xaee6('0x5c'))[_0xaee6('0x7b')](_0xaee6('0xa2'),_0xaee6('0x5d'))[_0xaee6('0x7c')]('cm_contacts')[_0xaee6('0x45')](_0xaee6('0xa6'))[_0xaee6('0x45')](_0xaee6('0xa7'),_0x1ef0e3[_0xaee6('0xa4')]['toString']())[_0xaee6('0x45')](_0xaee6('0xa8'))[_0xaee6('0x45')]('phone\x20NOT\x20IN\x20(?)',squel[_0xaee6('0x7a')]()[_0xaee6('0x7b')](_0xaee6('0xac'))['from'](_0xaee6('0xad'))[_0xaee6('0x45')](_0xaee6('0x81'),_0x470f03[_0xaee6('0x50')]['id'][_0xaee6('0x84')]())))[_0xaee6('0x84')]();break;default:_0x150899=squel[_0xaee6('0x9c')]()['into'](_0xaee6('0xad'))[_0xaee6('0x9e')](['phone','scheduledAt',_0xaee6('0xa3'),'ListId',_0xaee6('0x61'),_0xaee6('0x5c'),_0xaee6('0x5d')],squel['select']()[_0xaee6('0x7b')](_0xaee6('0x9f'),_0xaee6('0x9f'))[_0xaee6('0x7b')](_0xaee6('0xa2'),_0xaee6('0xa0'))[_0xaee6('0x7b')]('id',_0xaee6('0xa3'))[_0xaee6('0x7b')](_0x1ef0e3[_0xaee6('0xa4')][_0xaee6('0x84')](),_0xaee6('0xa1'))[_0xaee6('0x7b')](_0x470f03[_0xaee6('0x50')]['id'][_0xaee6('0x84')](),_0xaee6('0x61'))[_0xaee6('0x7b')]('NOW()',_0xaee6('0x5c'))[_0xaee6('0x7b')](_0xaee6('0xa2'),'updatedAt')[_0xaee6('0x7c')](_0xaee6('0xa5'))[_0xaee6('0x45')](_0xaee6('0xa6'))[_0xaee6('0x45')]('ListId\x20=\x20?',_0x1ef0e3[_0xaee6('0xa4')][_0xaee6('0x84')]())[_0xaee6('0x45')]('phone\x20IS\x20NOT\x20NULL'))[_0xaee6('0x84')]();}_0x525a8d[_0xaee6('0x92')](db[_0xaee6('0x83')][_0xaee6('0x3a')](_0x150899));}return BPromise[_0xaee6('0x88')](_0x525a8d);}})[_0xaee6('0x25')](function(){return _0x4a4c25;})[_0xaee6('0x25')](respondWithResult(_0x5134fd,null))['catch'](handleError(_0x5134fd,null));};exports[_0xaee6('0xaf')]=function(_0x74d378,_0x12641e,_0x174e7f){return db[_0xaee6('0x36')][_0xaee6('0x30')]({'where':{'id':_0x74d378[_0xaee6('0x50')]['id']}})[_0xaee6('0x25')](handleEntityNotFound(_0x12641e,null))[_0xaee6('0x25')](function(_0x259a91){if(_0x259a91){return _0x259a91[_0xaee6('0xaf')](_0x74d378['query'][_0xaee6('0x8b')]);}})[_0xaee6('0x25')](function(_0x4b5a98){if(_0x4b5a98){return db[_0xaee6('0x62')][_0xaee6('0x26')]({'where':{'ListId':_0x74d378[_0xaee6('0x3a')][_0xaee6('0x8b')],'VoiceQueueId':_0x74d378['params']['id']}})[_0xaee6('0x25')](function(){return _0x4b5a98;});}})[_0xaee6('0x25')](respondWithStatusCode(_0x12641e,null))[_0xaee6('0x4e')](handleError(_0x12641e,null));};exports[_0xaee6('0xb0')]=function(_0x267283,_0x5edb47,_0x43694a){var _0x3857dc={};var _0x359412={};var _0x3351f9;var _0x3bf2ac;return db['VoiceQueue'][_0xaee6('0x60')]({'where':{'id':_0x267283[_0xaee6('0x50')]['id']}})[_0xaee6('0x25')](handleEntityNotFound(_0x5edb47,null))['then'](function(_0x3c0e31){if(_0x3c0e31){_0x3351f9=_0x3c0e31;_0x359412[_0xaee6('0x38')]=_[_0xaee6('0x39')](db[_0xaee6('0x97')][_0xaee6('0x37')]);_0x359412[_0xaee6('0x3a')]=_[_0xaee6('0x39')](_0x267283[_0xaee6('0x3a')]);_0x359412[_0xaee6('0x46')]=_['intersection'](_0x359412[_0xaee6('0x38')],_0x359412[_0xaee6('0x3a')]);_0x3857dc[_0xaee6('0x3d')]=_[_0xaee6('0x3b')](_0x359412[_0xaee6('0x38')],qs[_0xaee6('0x3c')](_0x267283[_0xaee6('0x3a')][_0xaee6('0x3c')]));_0x3857dc[_0xaee6('0x3d')]=_0x3857dc['attributes'][_0xaee6('0x3e')]?_0x3857dc[_0xaee6('0x3d')]:_0x359412['model'];_0x3857dc[_0xaee6('0x43')]=qs[_0xaee6('0x44')](_0x267283[_0xaee6('0x3a')][_0xaee6('0x44')]);_0x3857dc[_0xaee6('0x45')]=qs[_0xaee6('0x46')](_[_0xaee6('0x47')](_0x267283[_0xaee6('0x3a')],_0x359412['filters']));if(_0x267283[_0xaee6('0x3a')][_0xaee6('0x49')]){_0x3857dc['where']=_[_0xaee6('0x48')](_0x3857dc[_0xaee6('0x45')],{'$or':_[_0xaee6('0x2c')](_0x3857dc[_0xaee6('0x3d')],function(_0x1dba25){var _0x9a7b0e={};_0x9a7b0e[_0x1dba25]={'$like':'%'+_0x267283[_0xaee6('0x3a')][_0xaee6('0x49')]+'%'};return _0x9a7b0e;})});}_0x3857dc=_['merge']({},_0x3857dc,_0x267283[_0xaee6('0x4a')]);return _0x3351f9[_0xaee6('0xb0')](_0x3857dc);}})['then'](function(_0x1d1aa){if(_0x1d1aa){_0x3bf2ac=_0x1d1aa['length'];if(!_0x267283['query']['hasOwnProperty'](_0xaee6('0x40'))){_0x3857dc[_0xaee6('0x41')]=qs[_0xaee6('0x41')](_0x267283[_0xaee6('0x3a')][_0xaee6('0x41')]);_0x3857dc['offset']=qs['offset'](_0x267283[_0xaee6('0x3a')][_0xaee6('0x42')]);}return _0x3351f9[_0xaee6('0xb0')](_0x3857dc);}})['then'](function(_0x5e06f6){if(_0x5e06f6){return _0x5e06f6?{'count':_0x3bf2ac,'rows':_0x5e06f6}:null;}})[_0xaee6('0x25')](respondWithResult(_0x5edb47,null))['catch'](handleError(_0x5edb47,null));};exports[_0xaee6('0xb1')]=function(_0x488a2b,_0x36f3c1,_0x223156){var _0x4c22c3,_0x57cf47;return db[_0xaee6('0x36')][_0xaee6('0x30')]({'where':{'id':_0x488a2b[_0xaee6('0x50')]['id']}})[_0xaee6('0x25')](handleEntityNotFound(_0x36f3c1,null))['then'](function(_0x174af3){if(_0x174af3){_0x57cf47=_0x174af3;return _0x174af3['addBlackLists'](_0x488a2b[_0xaee6('0x53')][_0xaee6('0x8b')],_[_0xaee6('0x8f')](_0x488a2b['body'],[_0xaee6('0x8b'),'id'])||{});}return null;})[_0xaee6('0x90')](function(_0xa084fd){var _0x376553;_0x4c22c3=_0xa084fd||[];var _0x56a62b=[];if(_0xa084fd){for(var _0x12d2fa=0x0;_0x12d2fa<_0xa084fd[_0xaee6('0x3e')];_0x12d2fa+=0x1){var _0x25b874=_0xa084fd[_0x12d2fa][_0xaee6('0x55')]({'plain':!![]});_0x376553=squel[_0xaee6('0x9c')]()[_0xaee6('0x9d')](_0xaee6('0xb2'))[_0xaee6('0x9e')]([_0xaee6('0x9f'),_0xaee6('0xa3'),'ListId',_0xaee6('0x61'),_0xaee6('0x5c'),_0xaee6('0x5d')],squel[_0xaee6('0x7a')]()[_0xaee6('0x7b')](_0xaee6('0x9f'),_0xaee6('0x9f'))['field']('id',_0xaee6('0xa3'))[_0xaee6('0x7b')](_0x25b874[_0xaee6('0xa4')][_0xaee6('0x84')](),_0xaee6('0xa1'))[_0xaee6('0x7b')](_0x488a2b[_0xaee6('0x50')]['id'][_0xaee6('0x84')](),_0xaee6('0x61'))['field'](_0xaee6('0xa2'),_0xaee6('0x5c'))['field'](_0xaee6('0xa2'),_0xaee6('0x5d'))[_0xaee6('0x7c')](_0xaee6('0xa5'))[_0xaee6('0x45')](_0xaee6('0xa6'))[_0xaee6('0x45')](_0xaee6('0xa7'),_0x25b874[_0xaee6('0xa4')]['toString']())[_0xaee6('0x45')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x56a62b[_0xaee6('0x92')](db[_0xaee6('0x83')][_0xaee6('0x3a')](_0x376553));}return BPromise[_0xaee6('0x88')](_0x56a62b);}})[_0xaee6('0x25')](function(){return _0x4c22c3;})['then'](respondWithResult(_0x36f3c1,null))['catch'](handleError(_0x36f3c1,null));};exports[_0xaee6('0xb3')]=function(_0x457add,_0x461247,_0xe42a52){return db[_0xaee6('0x36')]['find']({'where':{'id':_0x457add[_0xaee6('0x50')]['id']}})[_0xaee6('0x25')](handleEntityNotFound(_0x461247,null))[_0xaee6('0x25')](function(_0x3249a8){if(_0x3249a8){return _0x3249a8[_0xaee6('0xb3')](_0x457add[_0xaee6('0x3a')][_0xaee6('0x8b')]);}})[_0xaee6('0x25')](function(_0xadd502){if(_0xadd502){return db[_0xaee6('0x67')][_0xaee6('0x26')]({'where':{'ListId':_0x457add['query'][_0xaee6('0x8b')],'VoiceQueueId':_0x457add[_0xaee6('0x50')]['id']}})[_0xaee6('0x25')](function(){return _0xadd502;});}})[_0xaee6('0x25')](respondWithStatusCode(_0x461247,null))[_0xaee6('0x4e')](handleError(_0x461247,null));}; \ No newline at end of file +var _0x13a1=['removeLists','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','VoiceQueues','QueueCampaigns','outbound','filter','ignore','map','value','includes','type','find','UserProfileResource','sendStatus','error','name','send','model','keys','query','filters','attributes','fields','length','sort','where','pick','merge','key','VIRTUAL','field','options','includeAll','include','findAll','catch','params','VoiceQueue','rawAttributes','intersection','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','inbound','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','updatedAt','body','omit','createdAt','role','getHoppers','findOne','CmHopper','nolimit','order','rows','getHopperHistories','CmHopperHistory','hasOwnProperty','VoiceQueueId','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','interface','flatMap','forEach','penalty','sequelize','transaction','UserVoiceQueue','findOrCreate','each','upsert','isNil','format','SIP/%s','voicePause','emit','select','tq.TeamId','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','all','removeTeams','ids','isEmpty','UserVoiceQueueRt','userVoiceQueue:remove','addAgents','userVoiceQueue:save','removeAgents','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','scheduledAt','ListId','NOW()','CmListId','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','fromQuery','ContactId','cm_contacts'];(function(_0xa4606a,_0x5d9f61){var _0xd2f4f4=function(_0x5c13af){while(--_0x5c13af){_0xa4606a['push'](_0xa4606a['shift']());}};_0xd2f4f4(++_0x5d9f61);}(_0x13a1,0x174));var _0x113a=function(_0x4f2b23,_0x419a5f){_0x4f2b23=_0x4f2b23-0x0;var _0x56f722=_0x13a1[_0x4f2b23];return _0x56f722;};'use strict';var pdf=require(_0x113a('0x0'));var emlformat=require(_0x113a('0x1'));var rimraf=require(_0x113a('0x2'));var zipdir=require(_0x113a('0x3'));var jsonpatch=require(_0x113a('0x4'));var rp=require('request-promise');var moment=require(_0x113a('0x5'));var BPromise=require(_0x113a('0x6'));var Mustache=require(_0x113a('0x7'));var util=require('util');var path=require('path');var sox=require(_0x113a('0x8'));var csv=require('to-csv');var ejs=require(_0x113a('0x9'));var fs=require('fs');var _=require(_0x113a('0xa'));var squel=require(_0x113a('0xb'));var crypto=require(_0x113a('0xc'));var jsforce=require(_0x113a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x113a('0xe'));var querystring=require(_0x113a('0xf'));var Papa=require(_0x113a('0x10'));var Redis=require(_0x113a('0x11'));var authService=require(_0x113a('0x12'));var qs=require(_0x113a('0x13'));var hardwareService=require(_0x113a('0x14'));var logger=require('../../config/logger')(_0x113a('0x15'));var utils=require(_0x113a('0x16'));var config=require(_0x113a('0x17'));var db=require(_0x113a('0x18'))['db'];config[_0x113a('0x19')]=_[_0x113a('0x1a')](config[_0x113a('0x19')],{'host':_0x113a('0x1b'),'port':0x18eb});var socket=require(_0x113a('0x1c'))(new Redis(config[_0x113a('0x19')]));require(_0x113a('0x1d'))['register'](socket);function respondWithStatusCode(_0x577587,_0x24d903){_0x24d903=_0x24d903||0xcc;return function(_0x1e9f16){if(_0x1e9f16){return _0x577587['sendStatus'](_0x24d903);}return _0x577587[_0x113a('0x1e')](_0x24d903)[_0x113a('0x1f')]();};}function respondWithResult(_0x4fa1d6,_0xbb3551){_0xbb3551=_0xbb3551||0xc8;return function(_0xa885ba){if(_0xa885ba){return _0x4fa1d6[_0x113a('0x1e')](_0xbb3551)[_0x113a('0x20')](_0xa885ba);}};}function respondWithFilteredResult(_0x501917,_0x4b715a){return function(_0xe7cb2b){if(_0xe7cb2b){var _0x1a0971=_0xe7cb2b[_0x113a('0x21')],_0x4973b1=_0x4b715a[_0x113a('0x22')],_0x31dacb=_0x4b715a[_0x113a('0x22')]+_0x4b715a[_0x113a('0x23')],_0x5dc24f;if(_0x31dacb>=_0x1a0971){_0x31dacb=_0x1a0971;_0x5dc24f=0xc8;}else{_0x5dc24f=0xce;}_0x501917[_0x113a('0x1e')](_0x5dc24f);return _0x501917[_0x113a('0x24')](_0x113a('0x25'),_0x4973b1+'-'+_0x31dacb+'/'+_0x1a0971)[_0x113a('0x20')](_0xe7cb2b);}return null;};}function patchUpdates(_0xfdbf16){return function(_0x12e975){try{jsonpatch['apply'](_0x12e975,_0xfdbf16,!![]);}catch(_0x20bb93){return BPromise[_0x113a('0x26')](_0x20bb93);}return _0x12e975[_0x113a('0x27')]();};}function saveUpdates(_0x27b120,_0x4c03b2){return function(_0x1d3df6){if(_0x1d3df6){return _0x1d3df6[_0x113a('0x28')](_0x27b120)[_0x113a('0x29')](function(_0x457773){return _0x457773;});}return null;};}function removeEntity(_0x3a8fcf,_0xde18f3){return function(_0x2633eb){if(_0x2633eb){return _0x2633eb[_0x113a('0x2a')]()[_0x113a('0x29')](function(){var _0x27cc41=_0x2633eb[_0x113a('0x2b')]({'plain':!![]});var _0x273338=[{'name':_0x113a('0x2c'),'value':'inbound','ignore':![]},{'name':_0x113a('0x2d'),'value':_0x113a('0x2e'),'ignore':![]}];var _0x6c3b79=_(_0x273338)[_0x113a('0x2f')](_0x113a('0x30'))[_0x113a('0x31')](_0x113a('0x32'))[_0x113a('0x32')]();if(_[_0x113a('0x33')](_0x6c3b79,_0x27cc41[_0x113a('0x34')])){return;}var _0x3349fe=_[_0x113a('0x35')](_0x273338,[_0x113a('0x32'),_0x27cc41[_0x113a('0x34')]])['name'];return db[_0x113a('0x36')][_0x113a('0x2a')]({'where':{'type':_0x3349fe,'resourceId':_0x27cc41['id']}})[_0x113a('0x29')](function(){return _0x2633eb;});})[_0x113a('0x29')](function(){_0x3a8fcf['status'](0xcc)[_0x113a('0x1f')]();});}};}function handleEntityNotFound(_0x27a006,_0x362750){return function(_0x364c6e){if(!_0x364c6e){_0x27a006[_0x113a('0x37')](0x194);}return _0x364c6e;};}function handleError(_0x158f0f,_0x1389bd){_0x1389bd=_0x1389bd||0x1f4;return function(_0x15aead){logger[_0x113a('0x38')](_0x15aead['stack']);if(_0x15aead[_0x113a('0x39')]){delete _0x15aead[_0x113a('0x39')];}_0x158f0f[_0x113a('0x1e')](_0x1389bd)[_0x113a('0x3a')](_0x15aead);};}exports['index']=function(_0x564a2b,_0x15708a){var _0x5e2673={},_0x49cc56={},_0x906d38={'count':0x0,'rows':[]};var _0x523584=db['VoiceQueue']['rawAttributes'];_0x49cc56[_0x113a('0x3b')]=_[_0x113a('0x3c')](_0x523584);_0x49cc56[_0x113a('0x3d')]=_[_0x113a('0x3c')](_0x564a2b[_0x113a('0x3d')]);_0x49cc56[_0x113a('0x3e')]=_['intersection'](_0x49cc56[_0x113a('0x3b')],_0x49cc56[_0x113a('0x3d')]);_0x5e2673[_0x113a('0x3f')]=_['intersection'](_0x49cc56[_0x113a('0x3b')],qs[_0x113a('0x40')](_0x564a2b[_0x113a('0x3d')][_0x113a('0x40')]));_0x5e2673[_0x113a('0x3f')]=_0x5e2673[_0x113a('0x3f')][_0x113a('0x41')]?_0x5e2673[_0x113a('0x3f')]:_0x49cc56[_0x113a('0x3b')];if(!_0x564a2b[_0x113a('0x3d')]['hasOwnProperty']('nolimit')){_0x5e2673[_0x113a('0x23')]=qs['limit'](_0x564a2b[_0x113a('0x3d')]['limit']);_0x5e2673[_0x113a('0x22')]=qs['offset'](_0x564a2b[_0x113a('0x3d')][_0x113a('0x22')]);}_0x5e2673['order']=qs[_0x113a('0x42')](_0x564a2b[_0x113a('0x3d')]['sort']);_0x5e2673[_0x113a('0x43')]=qs[_0x113a('0x3e')](_[_0x113a('0x44')](_0x564a2b[_0x113a('0x3d')],_0x49cc56[_0x113a('0x3e')]));if(_0x564a2b[_0x113a('0x3d')][_0x113a('0x2f')]){_0x5e2673[_0x113a('0x43')]=_[_0x113a('0x45')](_0x5e2673['where'],{'$or':_[_0x113a('0x31')](_0x523584,function(_0x3e3c65){if(_0x3e3c65['type'][_0x113a('0x46')]!==_0x113a('0x47')){var _0x41ba23={};_0x41ba23[_0x3e3c65[_0x113a('0x48')]]={'$like':'%'+_0x564a2b['query'][_0x113a('0x2f')]+'%'};return _0x41ba23;}})});}_0x5e2673=_[_0x113a('0x45')]({},_0x5e2673,_0x564a2b[_0x113a('0x49')]);var _0x45219c={'where':_0x5e2673['where']};return db['VoiceQueue']['count'](_0x45219c)[_0x113a('0x29')](function(_0x44bede){_0x906d38[_0x113a('0x21')]=_0x44bede;if(_0x564a2b['query'][_0x113a('0x4a')]){_0x5e2673[_0x113a('0x4b')]=[{'all':!![]}];}return db['VoiceQueue'][_0x113a('0x4c')](_0x5e2673);})[_0x113a('0x29')](function(_0x468965){_0x906d38['rows']=_0x468965;return _0x906d38;})['then'](respondWithFilteredResult(_0x15708a,_0x5e2673))[_0x113a('0x4d')](handleError(_0x15708a,null));};exports['show']=function(_0x3e750d,_0x330137){var _0x4c2a46={'raw':![],'where':{'id':_0x3e750d[_0x113a('0x4e')]['id']}},_0x2770b9={};_0x2770b9[_0x113a('0x3b')]=_[_0x113a('0x3c')](db[_0x113a('0x4f')][_0x113a('0x50')]);_0x2770b9['query']=_['keys'](_0x3e750d[_0x113a('0x3d')]);_0x2770b9[_0x113a('0x3e')]=_[_0x113a('0x51')](_0x2770b9[_0x113a('0x3b')],_0x2770b9['query']);_0x4c2a46[_0x113a('0x3f')]=_[_0x113a('0x51')](_0x2770b9['model'],qs[_0x113a('0x40')](_0x3e750d[_0x113a('0x3d')]['fields']));_0x4c2a46['attributes']=_0x4c2a46[_0x113a('0x3f')][_0x113a('0x41')]?_0x4c2a46[_0x113a('0x3f')]:_0x2770b9[_0x113a('0x3b')];if(_0x3e750d['query'][_0x113a('0x4a')]){_0x4c2a46[_0x113a('0x4b')]=[{'all':!![]}];}_0x4c2a46=_['merge']({},_0x4c2a46,_0x3e750d['options']);return db[_0x113a('0x4f')]['find'](_0x4c2a46)[_0x113a('0x29')](handleEntityNotFound(_0x330137,null))[_0x113a('0x29')](respondWithResult(_0x330137,null))[_0x113a('0x4d')](handleError(_0x330137,null));};exports[_0x113a('0x52')]=function(_0x44e400,_0x557794){return db[_0x113a('0x4f')]['create'](_0x44e400['body'],{})[_0x113a('0x29')](function(_0x1cda07){var _0x2c5a2b=_0x44e400['user'][_0x113a('0x2b')]({'plain':!![]});if(!_0x2c5a2b)throw new Error(_0x113a('0x53'));if(_0x2c5a2b['role']===_0x113a('0x54')){var _0x209cab=_0x1cda07[_0x113a('0x2b')]({'plain':!![]});var _0x451d20=[{'name':_0x113a('0x2c'),'value':_0x113a('0x55')},{'name':_0x113a('0x2d'),'value':'outbound'}];var _0x49573d=_[_0x113a('0x35')](_0x451d20,['value',_0x209cab['type']])[_0x113a('0x39')];return db[_0x113a('0x56')][_0x113a('0x35')]({'where':{'name':_0x49573d,'userProfileId':_0x2c5a2b[_0x113a('0x57')]},'raw':!![]})[_0x113a('0x29')](function(_0x592431){if(_0x592431&&_0x592431[_0x113a('0x58')]===0x0){return db[_0x113a('0x36')][_0x113a('0x52')]({'name':_0x209cab[_0x113a('0x39')],'resourceId':_0x209cab['id'],'type':_0x592431[_0x113a('0x39')],'sectionId':_0x592431['id']},{})[_0x113a('0x29')](function(){return _0x1cda07;});}else{return _0x1cda07;}})['catch'](function(_0x2f59bd){logger[_0x113a('0x38')](_0x113a('0x59'),_0x2f59bd);throw _0x2f59bd;});}return _0x1cda07;})[_0x113a('0x29')](respondWithResult(_0x557794,0xc9))[_0x113a('0x4d')](handleError(_0x557794,null));};exports[_0x113a('0x5a')]=function(_0x4a8c22,_0x50f3f7){var _0x54705d={'raw':![],'where':{'id':_0x4a8c22[_0x113a('0x4e')]['id']}},_0x104067={};_0x104067[_0x113a('0x3b')]=_[_0x113a('0x3c')](db[_0x113a('0x4f')][_0x113a('0x50')]);_0x54705d[_0x113a('0x3f')]=_['intersection'](_0x104067[_0x113a('0x3b')],qs['fields'](_0x4a8c22[_0x113a('0x3d')][_0x113a('0x40')]));_0x54705d[_0x113a('0x3f')]=_0x54705d['attributes'][_0x113a('0x41')]?_0x54705d['attributes']:_0x104067[_0x113a('0x3b')];if(_0x4a8c22[_0x113a('0x3d')][_0x113a('0x4a')]){_0x54705d[_0x113a('0x4b')]=[{'all':!![]}];}_0x54705d=_[_0x113a('0x45')]({},_0x54705d,_0x4a8c22[_0x113a('0x49')]);return db[_0x113a('0x4f')][_0x113a('0x35')](_0x54705d)[_0x113a('0x29')](handleEntityNotFound(_0x50f3f7,null))[_0x113a('0x29')](function(_0x4efc8b){if(_0x4efc8b){var _0x31ecea=_0x4efc8b['get']({'plain':!![]});_0x31ecea=qs['omit'](_0x31ecea,['id','createdAt',_0x113a('0x5b')]);_0x4a8c22[_0x113a('0x5c')]=_[_0x113a('0x5d')](_0x4a8c22[_0x113a('0x5c')],['id',_0x113a('0x5e'),'updatedAt']);return db['VoiceQueue'][_0x113a('0x52')](_['merge'](_0x31ecea,_0x4a8c22[_0x113a('0x5c')]),{'include':_0x4a8c22[_0x113a('0x3d')]['includeAll']?[{'all':!![]}]:undefined})[_0x113a('0x29')](function(_0x7f5250){var _0x3951bf=_0x4a8c22['user'][_0x113a('0x2b')]({'plain':!![]});if(!_0x3951bf)throw new Error(_0x113a('0x53'));if(_0x3951bf[_0x113a('0x5f')]===_0x113a('0x54')){var _0xededce=_0x7f5250['get']({'plain':!![]});var _0x5f46d1=[{'name':_0x113a('0x2c'),'value':'inbound'},{'name':_0x113a('0x2d'),'value':_0x113a('0x2e')}];var _0x4dd457=_[_0x113a('0x35')](_0x5f46d1,[_0x113a('0x32'),_0xededce['type']])[_0x113a('0x39')];return db['UserProfileSection']['find']({'where':{'name':_0x4dd457,'userProfileId':_0x3951bf['userProfileId']},'raw':!![]})[_0x113a('0x29')](function(_0x12b134){if(_0x12b134&&_0x12b134['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0xededce['name'],'resourceId':_0xededce['id'],'type':_0x12b134['name'],'sectionId':_0x12b134['id']},{})[_0x113a('0x29')](function(){return _0x7f5250;});}else{return _0x7f5250;}})['catch'](function(_0x31851a){logger['error'](_0x113a('0x59'),_0x31851a);throw _0x31851a;});}return _0x7f5250;});}})[_0x113a('0x29')](respondWithResult(_0x50f3f7,0xc9))[_0x113a('0x4d')](handleError(_0x50f3f7,null));};exports[_0x113a('0x28')]=function(_0x36483c,_0x3cbe6b){if(_0x36483c[_0x113a('0x5c')]['id']){delete _0x36483c[_0x113a('0x5c')]['id'];}return db[_0x113a('0x4f')]['find']({'where':{'id':_0x36483c[_0x113a('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3cbe6b,null))[_0x113a('0x29')](saveUpdates(_0x36483c[_0x113a('0x5c')],null))['then'](respondWithResult(_0x3cbe6b,null))[_0x113a('0x4d')](handleError(_0x3cbe6b,null));};exports[_0x113a('0x2a')]=function(_0x106089,_0x34bdf4){return db[_0x113a('0x4f')]['find']({'where':{'id':_0x106089[_0x113a('0x4e')]['id']}})[_0x113a('0x29')](handleEntityNotFound(_0x34bdf4,null))[_0x113a('0x29')](removeEntity(_0x34bdf4,null))[_0x113a('0x4d')](handleError(_0x34bdf4,null));};exports[_0x113a('0x60')]=function(_0x39f8c1,_0x4199ae,_0x2c165b){var _0x596159={'raw':![],'where':{}};var _0x896964={};var _0x47d0f4={'count':0x0,'rows':[]};return db[_0x113a('0x4f')][_0x113a('0x61')]({'where':{'id':_0x39f8c1[_0x113a('0x4e')]['id']}})[_0x113a('0x29')](handleEntityNotFound(_0x4199ae,null))[_0x113a('0x29')](function(_0x4d8e7f){if(_0x4d8e7f){_0x896964[_0x113a('0x3b')]=_['keys'](db[_0x113a('0x62')][_0x113a('0x50')]);_0x896964[_0x113a('0x3d')]=_[_0x113a('0x3c')](_0x39f8c1[_0x113a('0x3d')]);_0x896964['filters']=_['intersection'](_0x896964[_0x113a('0x3b')],_0x896964['query']);_0x596159[_0x113a('0x3f')]=_[_0x113a('0x51')](_0x896964[_0x113a('0x3b')],qs[_0x113a('0x40')](_0x39f8c1['query'][_0x113a('0x40')]));_0x596159[_0x113a('0x3f')]=_0x596159[_0x113a('0x3f')]['length']?_0x596159[_0x113a('0x3f')]:_0x896964[_0x113a('0x3b')];if(!_0x39f8c1[_0x113a('0x3d')]['hasOwnProperty'](_0x113a('0x63'))){_0x596159['limit']=qs[_0x113a('0x23')](_0x39f8c1[_0x113a('0x3d')]['limit']);_0x596159[_0x113a('0x22')]=qs['offset'](_0x39f8c1['query'][_0x113a('0x22')]);}_0x596159[_0x113a('0x64')]=qs[_0x113a('0x42')](_0x39f8c1[_0x113a('0x3d')][_0x113a('0x42')]);_0x596159[_0x113a('0x43')]=qs['filters'](_['pick'](_0x39f8c1[_0x113a('0x3d')],_0x896964[_0x113a('0x3e')]));_0x596159[_0x113a('0x43')]['VoiceQueueId']=_0x4d8e7f['id'];if(_0x39f8c1['query'][_0x113a('0x2f')]){_0x596159[_0x113a('0x43')]=_[_0x113a('0x45')](_0x596159['where'],{'$or':_[_0x113a('0x31')](_0x596159[_0x113a('0x3f')],function(_0x57025f){var _0xd12bd6={};_0xd12bd6[_0x57025f]={'$like':'%'+_0x39f8c1[_0x113a('0x3d')][_0x113a('0x2f')]+'%'};return _0xd12bd6;})});}_0x596159=_[_0x113a('0x45')]({},_0x596159,_0x39f8c1['options']);return db['CmHopper']['count']({'where':_0x596159[_0x113a('0x43')]})[_0x113a('0x29')](function(_0x4d39f1){_0x47d0f4[_0x113a('0x21')]=_0x4d39f1;if(_0x39f8c1['query'][_0x113a('0x4a')]){_0x596159[_0x113a('0x4b')]=[{'all':!![]}];}return db[_0x113a('0x62')][_0x113a('0x4c')](_0x596159);})['then'](function(_0x4b3535){_0x47d0f4[_0x113a('0x65')]=_0x4b3535;return _0x47d0f4;});}})[_0x113a('0x29')](respondWithFilteredResult(_0x4199ae,_0x596159))[_0x113a('0x4d')](handleError(_0x4199ae,null));};exports[_0x113a('0x66')]=function(_0x14be32,_0x702e55,_0x56d1e4){var _0x2a7481={'raw':!![],'where':{}};var _0x58602b={};var _0x5ca5c6={'count':0x0,'rows':[]};return db[_0x113a('0x4f')][_0x113a('0x61')]({'where':{'id':_0x14be32[_0x113a('0x4e')]['id']}})[_0x113a('0x29')](handleEntityNotFound(_0x702e55,null))[_0x113a('0x29')](function(_0x50bd16){if(_0x50bd16){_0x58602b[_0x113a('0x3b')]=_['keys'](db[_0x113a('0x67')]['rawAttributes']);_0x58602b[_0x113a('0x3d')]=_[_0x113a('0x3c')](_0x14be32[_0x113a('0x3d')]);_0x58602b[_0x113a('0x3e')]=_['intersection'](_0x58602b[_0x113a('0x3b')],_0x58602b['query']);_0x2a7481[_0x113a('0x3f')]=_['intersection'](_0x58602b['model'],qs[_0x113a('0x40')](_0x14be32[_0x113a('0x3d')][_0x113a('0x40')]));_0x2a7481[_0x113a('0x3f')]=_0x2a7481[_0x113a('0x3f')][_0x113a('0x41')]?_0x2a7481[_0x113a('0x3f')]:_0x58602b['model'];if(!_0x14be32['query'][_0x113a('0x68')]('nolimit')){_0x2a7481['limit']=qs[_0x113a('0x23')](_0x14be32[_0x113a('0x3d')][_0x113a('0x23')]);_0x2a7481[_0x113a('0x22')]=qs[_0x113a('0x22')](_0x14be32[_0x113a('0x3d')]['offset']);}_0x2a7481[_0x113a('0x64')]=qs['sort'](_0x14be32[_0x113a('0x3d')][_0x113a('0x42')]);_0x2a7481[_0x113a('0x43')]=qs['filters'](_[_0x113a('0x44')](_0x14be32[_0x113a('0x3d')],_0x58602b[_0x113a('0x3e')]));_0x2a7481[_0x113a('0x43')]['VoiceQueueId']=_0x50bd16['id'];if(_0x14be32[_0x113a('0x3d')][_0x113a('0x2f')]){_0x2a7481[_0x113a('0x43')]=_['merge'](_0x2a7481[_0x113a('0x43')],{'$or':_['map'](_0x2a7481[_0x113a('0x3f')],function(_0x5dbc30){var _0x52d029={};_0x52d029[_0x5dbc30]={'$like':'%'+_0x14be32[_0x113a('0x3d')]['filter']+'%'};return _0x52d029;})});}_0x2a7481=_[_0x113a('0x45')]({},_0x2a7481,_0x14be32[_0x113a('0x49')]);return db[_0x113a('0x67')][_0x113a('0x21')]({'where':_0x2a7481[_0x113a('0x43')]})[_0x113a('0x29')](function(_0xa3e5a1){_0x5ca5c6[_0x113a('0x21')]=_0xa3e5a1;if(_0x14be32[_0x113a('0x3d')][_0x113a('0x4a')]){_0x2a7481[_0x113a('0x4b')]=[{'all':!![]}];}return db[_0x113a('0x67')][_0x113a('0x4c')](_0x2a7481);})[_0x113a('0x29')](function(_0x1373c6){_0x5ca5c6['rows']=_0x1373c6;return _0x5ca5c6;});}})[_0x113a('0x29')](respondWithFilteredResult(_0x702e55,_0x2a7481))[_0x113a('0x4d')](handleError(_0x702e55,null));};exports['getHopperFinals']=function(_0x13798d,_0x177f32,_0x371464){var _0x1d5383={'raw':!![],'where':{}};var _0x44b5c4={};var _0x1191b1={'count':0x0,'rows':[]};return db[_0x113a('0x4f')]['findOne']({'where':{'id':_0x13798d[_0x113a('0x4e')]['id']}})[_0x113a('0x29')](handleEntityNotFound(_0x177f32,null))[_0x113a('0x29')](function(_0x1e36c9){if(_0x1e36c9){_0x44b5c4[_0x113a('0x3b')]=_['keys'](db['CmHopperFinal'][_0x113a('0x50')]);_0x44b5c4[_0x113a('0x3d')]=_[_0x113a('0x3c')](_0x13798d['query']);_0x44b5c4['filters']=_[_0x113a('0x51')](_0x44b5c4[_0x113a('0x3b')],_0x44b5c4[_0x113a('0x3d')]);_0x1d5383[_0x113a('0x3f')]=_[_0x113a('0x51')](_0x44b5c4[_0x113a('0x3b')],qs[_0x113a('0x40')](_0x13798d['query'][_0x113a('0x40')]));_0x1d5383[_0x113a('0x3f')]=_0x1d5383[_0x113a('0x3f')]['length']?_0x1d5383[_0x113a('0x3f')]:_0x44b5c4['model'];if(!_0x13798d[_0x113a('0x3d')][_0x113a('0x68')](_0x113a('0x63'))){_0x1d5383[_0x113a('0x23')]=qs[_0x113a('0x23')](_0x13798d[_0x113a('0x3d')][_0x113a('0x23')]);_0x1d5383[_0x113a('0x22')]=qs[_0x113a('0x22')](_0x13798d[_0x113a('0x3d')][_0x113a('0x22')]);}_0x1d5383['order']=qs[_0x113a('0x42')](_0x13798d[_0x113a('0x3d')]['sort']);_0x1d5383[_0x113a('0x43')]=qs[_0x113a('0x3e')](_['pick'](_0x13798d[_0x113a('0x3d')],_0x44b5c4[_0x113a('0x3e')]));_0x1d5383[_0x113a('0x43')][_0x113a('0x69')]=_0x1e36c9['id'];if(_0x13798d[_0x113a('0x3d')][_0x113a('0x2f')]){_0x1d5383['where']=_[_0x113a('0x45')](_0x1d5383[_0x113a('0x43')],{'$or':_[_0x113a('0x31')](_0x1d5383['attributes'],function(_0x1bd282){var _0x4e0dde={};_0x4e0dde[_0x1bd282]={'$like':'%'+_0x13798d['query'][_0x113a('0x2f')]+'%'};return _0x4e0dde;})});}_0x1d5383=_[_0x113a('0x45')]({},_0x1d5383,_0x13798d[_0x113a('0x49')]);return db[_0x113a('0x6a')][_0x113a('0x21')]({'where':_0x1d5383[_0x113a('0x43')]})['then'](function(_0x853689){_0x1191b1['count']=_0x853689;if(_0x13798d['query'][_0x113a('0x4a')]){_0x1d5383[_0x113a('0x4b')]=[{'all':!![]}];}return db[_0x113a('0x6a')][_0x113a('0x4c')](_0x1d5383);})[_0x113a('0x29')](function(_0x4a66e3){_0x1191b1['rows']=_0x4a66e3;return _0x1191b1;});}})[_0x113a('0x29')](respondWithFilteredResult(_0x177f32,_0x1d5383))[_0x113a('0x4d')](handleError(_0x177f32,null));};exports[_0x113a('0x6b')]=function(_0x3b8ab9,_0x278c25,_0x4a6257){var _0x3dd75f={'raw':!![],'where':{}};var _0x43d0b9={};var _0x529b26={'count':0x0,'rows':[]};return db[_0x113a('0x4f')][_0x113a('0x61')]({'where':{'id':_0x3b8ab9[_0x113a('0x4e')]['id']}})[_0x113a('0x29')](handleEntityNotFound(_0x278c25,null))[_0x113a('0x29')](function(_0x555f9e){if(_0x555f9e){_0x43d0b9[_0x113a('0x3b')]=_[_0x113a('0x3c')](db[_0x113a('0x6c')][_0x113a('0x50')]);_0x43d0b9['query']=_['keys'](_0x3b8ab9['query']);_0x43d0b9['filters']=_['intersection'](_0x43d0b9['model'],_0x43d0b9[_0x113a('0x3d')]);_0x3dd75f['attributes']=_['intersection'](_0x43d0b9['model'],qs[_0x113a('0x40')](_0x3b8ab9[_0x113a('0x3d')][_0x113a('0x40')]));_0x3dd75f[_0x113a('0x3f')]=_0x3dd75f[_0x113a('0x3f')][_0x113a('0x41')]?_0x3dd75f['attributes']:_0x43d0b9[_0x113a('0x3b')];if(!_0x3b8ab9['query']['hasOwnProperty'](_0x113a('0x63'))){_0x3dd75f[_0x113a('0x23')]=qs[_0x113a('0x23')](_0x3b8ab9[_0x113a('0x3d')]['limit']);_0x3dd75f[_0x113a('0x22')]=qs[_0x113a('0x22')](_0x3b8ab9[_0x113a('0x3d')]['offset']);}_0x3dd75f[_0x113a('0x64')]=qs[_0x113a('0x42')](_0x3b8ab9['query']['sort']);_0x3dd75f['where']=qs[_0x113a('0x3e')](_[_0x113a('0x44')](_0x3b8ab9[_0x113a('0x3d')],_0x43d0b9[_0x113a('0x3e')]));_0x3dd75f['where'][_0x113a('0x69')]=_0x555f9e['id'];if(_0x3b8ab9[_0x113a('0x3d')][_0x113a('0x2f')]){_0x3dd75f['where']=_['merge'](_0x3dd75f[_0x113a('0x43')],{'$or':_['map'](_0x3dd75f[_0x113a('0x3f')],function(_0x5363a5){var _0x377900={};_0x377900[_0x5363a5]={'$like':'%'+_0x3b8ab9[_0x113a('0x3d')][_0x113a('0x2f')]+'%'};return _0x377900;})});}_0x3dd75f=_[_0x113a('0x45')]({},_0x3dd75f,_0x3b8ab9[_0x113a('0x49')]);return db[_0x113a('0x6c')][_0x113a('0x21')]({'where':_0x3dd75f[_0x113a('0x43')]})[_0x113a('0x29')](function(_0x18ac2e){_0x529b26[_0x113a('0x21')]=_0x18ac2e;if(_0x3b8ab9['query'][_0x113a('0x4a')]){_0x3dd75f[_0x113a('0x4b')]=[{'all':!![]}];}return db[_0x113a('0x6c')][_0x113a('0x4c')](_0x3dd75f);})[_0x113a('0x29')](function(_0x5bffa5){_0x529b26[_0x113a('0x65')]=_0x5bffa5;return _0x529b26;});}})['then'](respondWithFilteredResult(_0x278c25,_0x3dd75f))[_0x113a('0x4d')](handleError(_0x278c25,null));};exports[_0x113a('0x6d')]=function(_0x36f9d8,_0x1b98c2,_0x363446){var _0xca5cdd={};var _0x1bc8d5={};var _0x25b5c1;var _0x4f0156;return db[_0x113a('0x4f')][_0x113a('0x61')]({'where':{'id':_0x36f9d8[_0x113a('0x4e')]['id']}})[_0x113a('0x29')](handleEntityNotFound(_0x1b98c2,null))[_0x113a('0x29')](function(_0x138d07){if(_0x138d07){_0x25b5c1=_0x138d07;_0x1bc8d5[_0x113a('0x3b')]=_[_0x113a('0x3c')](db[_0x113a('0x6e')]['rawAttributes']);_0x1bc8d5[_0x113a('0x3d')]=_[_0x113a('0x3c')](_0x36f9d8[_0x113a('0x3d')]);_0x1bc8d5['filters']=_[_0x113a('0x51')](_0x1bc8d5[_0x113a('0x3b')],_0x1bc8d5[_0x113a('0x3d')]);_0xca5cdd[_0x113a('0x3f')]=_[_0x113a('0x51')](_0x1bc8d5[_0x113a('0x3b')],qs[_0x113a('0x40')](_0x36f9d8['query'][_0x113a('0x40')]));_0xca5cdd[_0x113a('0x3f')]=_0xca5cdd[_0x113a('0x3f')][_0x113a('0x41')]?_0xca5cdd[_0x113a('0x3f')]:_0x1bc8d5[_0x113a('0x3b')];_0xca5cdd[_0x113a('0x64')]=qs[_0x113a('0x42')](_0x36f9d8['query'][_0x113a('0x42')]);_0xca5cdd[_0x113a('0x43')]=qs[_0x113a('0x3e')](_[_0x113a('0x44')](_0x36f9d8[_0x113a('0x3d')],_0x1bc8d5[_0x113a('0x3e')]));if(_0x36f9d8[_0x113a('0x3d')]['filter']){_0xca5cdd[_0x113a('0x43')]=_[_0x113a('0x45')](_0xca5cdd['where'],{'$or':_[_0x113a('0x31')](_0xca5cdd[_0x113a('0x3f')],function(_0x3c0829){var _0xa88264={};_0xa88264[_0x3c0829]={'$like':'%'+_0x36f9d8[_0x113a('0x3d')]['filter']+'%'};return _0xa88264;})});}_0xca5cdd=_[_0x113a('0x45')]({},_0xca5cdd,_0x36f9d8[_0x113a('0x49')]);return _0x25b5c1[_0x113a('0x6d')](_0xca5cdd);}})['then'](function(_0x5c2f60){if(_0x5c2f60){_0x4f0156=_0x5c2f60[_0x113a('0x41')];if(!_0x36f9d8[_0x113a('0x3d')][_0x113a('0x68')]('nolimit')){_0xca5cdd[_0x113a('0x23')]=qs[_0x113a('0x23')](_0x36f9d8[_0x113a('0x3d')][_0x113a('0x23')]);_0xca5cdd[_0x113a('0x22')]=qs[_0x113a('0x22')](_0x36f9d8[_0x113a('0x3d')]['offset']);}return _0x25b5c1[_0x113a('0x6d')](_0xca5cdd);}})[_0x113a('0x29')](function(_0x2cd410){if(_0x2cd410){return _0x2cd410?{'count':_0x4f0156,'rows':_0x2cd410}:null;}})[_0x113a('0x29')](respondWithResult(_0x1b98c2,null))[_0x113a('0x4d')](handleError(_0x1b98c2,null));};exports[_0x113a('0x6f')]=function(_0x16d551,_0x4bd941,_0x2b5f2e){var _0x547ad9=_0x16d551['body'][_0x113a('0x70')];return db[_0x113a('0x6e')][_0x113a('0x4c')]({'where':{'id':_[_0x113a('0x31')](_0x547ad9,'id')},'attributes':['id'],'include':[{'model':db[_0x113a('0x71')],'as':_0x113a('0x72'),'attributes':['id',_0x113a('0x39'),_0x113a('0x73'),'voicePause',_0x113a('0x74')],'raw':!![]}]})[_0x113a('0x29')](function(_0x2888eb){if(_0x2888eb){var _0x14fd85=_[_0x113a('0x75')](_0x2888eb,function(_0x238013){var _0x2c58fd=_0x238013[_0x113a('0x2b')]({'plain':!![]});_0x2c58fd[_0x113a('0x72')][_0x113a('0x76')](function(_0x5b3cbe){_0x5b3cbe['penalty']=_['find'](_0x547ad9,{'id':_0x2c58fd['id']})[_0x113a('0x77')];});return _0x2c58fd['Agents'];});return db[_0x113a('0x4f')]['find']({'where':{'id':_0x16d551[_0x113a('0x4e')]['id']}})[_0x113a('0x29')](function(_0x1baea1){return db[_0x113a('0x78')][_0x113a('0x79')](function(_0x3aef2e){return _0x1baea1['addTeams'](_[_0x113a('0x31')](_0x547ad9,'id'),{'transaction':_0x3aef2e})['then'](function(){return BPromise['each'](_0x14fd85,function(_0xea9dc5){return db[_0x113a('0x7a')][_0x113a('0x7b')]({'where':{'UserId':_0xea9dc5['id'],'VoiceQueueId':_0x16d551['params']['id']},'defaults':{'penalty':_0xea9dc5[_0x113a('0x77')]},'transaction':_0x3aef2e});});})[_0x113a('0x29')](function(){return BPromise[_0x113a('0x7c')](_[_0x113a('0x2f')](_0x14fd85,{'online':!![]}),function(_0x21f1a2){return db['UserVoiceQueueRt'][_0x113a('0x7d')]({'membername':_0x21f1a2['name'],'UserId':_0x21f1a2['id'],'queue_name':_0x1baea1[_0x113a('0x39')],'VoiceQueueId':_0x1baea1['id'],'interface':_[_0x113a('0x7e')](_0x21f1a2[_0x113a('0x74')])?util[_0x113a('0x7f')](_0x113a('0x80'),_0x21f1a2[_0x113a('0x39')]):_0x21f1a2[_0x113a('0x74')],'paused':_0x21f1a2[_0x113a('0x81')]||![],'penalty':_0x21f1a2['penalty']},{'transaction':_0x3aef2e});});})[_0x113a('0x29')](function(){_0x14fd85[_0x113a('0x76')](function(_0xca6a49){socket[_0x113a('0x82')]('userVoiceQueue:save',{'UserId':_0xca6a49['id'],'VoiceQueueId':_0x1baea1['id']});});});});});}})[_0x113a('0x29')](respondWithStatusCode(_0x4bd941,null))[_0x113a('0x4d')](handleError(_0x4bd941,null));};exports['removeTeams']=function(_0x7bb57c,_0x2faf8c,_0xba5aa5){return db[_0x113a('0x6e')][_0x113a('0x4c')]({'where':{'id':_0x7bb57c['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x113a('0x71')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x113a('0x29')](handleEntityNotFound(_0x2faf8c,null))[_0x113a('0x29')](function(_0x1833b3){var _0x2aa683=_[_0x113a('0x31')](_0x1833b3,'id');var _0x5e3bdb=[];var _0x4aff67=[];var _0x5a6c70=squel[_0x113a('0x83')]();_0x5a6c70[_0x113a('0x48')](_0x113a('0x84'))['from'](_0x113a('0x85'),'tq')[_0x113a('0x86')](_0x113a('0x87'),'ut',_0x113a('0x88'))[_0x113a('0x43')](_0x113a('0x89'),_0x7bb57c[_0x113a('0x4e')]['id']);for(var _0x20264f=0x0;_0x20264f<_0x1833b3['length'];_0x20264f+=0x1){let _0x2559df=_0x1833b3[_0x20264f];for(var _0x7d7c7a=0x0;_0x7d7c7a<_0x2559df[_0x113a('0x72')][_0x113a('0x41')];_0x7d7c7a+=0x1){let _0x25716c=_0x2559df[_0x113a('0x72')][_0x7d7c7a];var _0x1c4b9f=_0x5a6c70[_0x113a('0x5a')]();_0x1c4b9f[_0x113a('0x43')](_0x113a('0x8a'),_0x25716c['id']);_0x4aff67[_0x113a('0x8b')](db[_0x113a('0x78')][_0x113a('0x3d')](_0x1c4b9f['toString'](),{'type':db['sequelize'][_0x113a('0x8c')][_0x113a('0x8d')]})[_0x113a('0x29')](function(_0x4c0c75){if(_0x4c0c75[_0x113a('0x41')]===0x1){return _0x25716c['id'];}else{var _0x50f947=_[_0x113a('0x8e')](_[_0x113a('0x31')](_0x4c0c75,_0x113a('0x8f')),function(_0x70ff23){return _[_0x113a('0x33')](_0x2aa683,_0x70ff23);});if(_0x50f947){return _0x25716c['id'];}}}));}}return BPromise[_0x113a('0x90')](_0x4aff67)[_0x113a('0x29')](function(_0x242a78){_0x5e3bdb=_(_0x5e3bdb)['union'](_0x242a78)['compact']()['value']();return db[_0x113a('0x4f')][_0x113a('0x35')]({'where':{'id':_0x7bb57c[_0x113a('0x4e')]['id']}})[_0x113a('0x29')](function(_0x166e07){return db[_0x113a('0x78')][_0x113a('0x79')](function(_0x4d8747){return _0x166e07[_0x113a('0x91')](_0x7bb57c[_0x113a('0x3d')][_0x113a('0x92')],{'transaction':_0x4d8747})[_0x113a('0x29')](function(){if(!_[_0x113a('0x93')](_0x5e3bdb)){return _0x166e07['removeAgents'](_0x5e3bdb,{'transaction':_0x4d8747})[_0x113a('0x29')](function(){return db[_0x113a('0x94')]['destroy']({'where':{'VoiceQueueId':_0x7bb57c[_0x113a('0x4e')]['id'],'UserId':_0x5e3bdb},'transaction':_0x4d8747});});}})[_0x113a('0x29')](function(){_0x5e3bdb['forEach'](function(_0x2b24d4){socket[_0x113a('0x82')](_0x113a('0x95'),{'UserId':_0x2b24d4,'VoiceQueueId':_0x166e07['id']});});});});});});})[_0x113a('0x29')](respondWithStatusCode(_0x2faf8c,null))[_0x113a('0x4d')](handleError(_0x2faf8c,null));};exports[_0x113a('0x96')]=function(_0xbbd008,_0x5abc2c,_0x5f0cbf){var _0x4d9282,_0x80893e;return db[_0x113a('0x4f')][_0x113a('0x35')]({'where':{'id':_0xbbd008['params']['id']}})[_0x113a('0x29')](handleEntityNotFound(_0x5abc2c,null))['then'](function(_0x5edaeb){if(_0x5edaeb){_0x80893e=_0x5edaeb;return _0x5edaeb['addAgents'](_0xbbd008[_0x113a('0x5c')]['ids'],_[_0x113a('0x5d')](_0xbbd008[_0x113a('0x5c')],[_0x113a('0x92'),'id'])||{})['spread'](function(_0x382ea5){for(var _0x1fcbd0=0x0;_0x1fcbd0<_0xbbd008['body'][_0x113a('0x92')][_0x113a('0x41')];_0x1fcbd0+=0x1){socket['emit'](_0x113a('0x97'),{'UserId':_0xbbd008['body'][_0x113a('0x92')][_0x1fcbd0],'VoiceQueueId':_0xbbd008[_0x113a('0x4e')]['id']});}return _0x382ea5;});}})[_0x113a('0x29')](function(_0x30153b){_0x4d9282=_0x30153b||[];if(_0x80893e){return db[_0x113a('0x71')]['findAll']({'where':{'id':_0xbbd008['body']['ids']},'attributes':['id',_0x113a('0x39'),_0x113a('0x73'),_0x113a('0x81'),'interface'],'raw':!![]});}})[_0x113a('0x29')](function(_0x462000){if(!_['isEmpty'](_0x462000)){var _0xad844f=[];for(var _0x45db58=0x0;_0x45db58<_0x462000[_0x113a('0x41')];_0x45db58++){if(_0x462000[_0x45db58]['online']){_0xad844f[_0x113a('0x8b')](db[_0x113a('0x94')][_0x113a('0x7d')]({'membername':_0x462000[_0x45db58][_0x113a('0x39')],'UserId':_0x462000[_0x45db58]['id'],'queue_name':_0x80893e[_0x113a('0x39')],'VoiceQueueId':_0x80893e['id'],'interface':_[_0x113a('0x7e')](_0x462000[_0x45db58][_0x113a('0x74')])?util[_0x113a('0x7f')](_0x113a('0x80'),_0x462000[_0x45db58][_0x113a('0x39')]):_0x462000[_0x45db58][_0x113a('0x74')],'paused':_0x462000[_0x45db58][_0x113a('0x81')]||![],'penalty':_0xbbd008[_0x113a('0x5c')][_0x113a('0x77')]||0x0}));}}return BPromise[_0x113a('0x90')](_0xad844f);}})[_0x113a('0x29')](function(){return _0x4d9282;})[_0x113a('0x29')](respondWithResult(_0x5abc2c,null))['catch'](handleError(_0x5abc2c,null));};exports[_0x113a('0x98')]=function(_0x560c02,_0x359156,_0x1ac544){return db[_0x113a('0x4f')][_0x113a('0x35')]({'where':{'id':_0x560c02[_0x113a('0x4e')]['id']}})[_0x113a('0x29')](handleEntityNotFound(_0x359156,null))[_0x113a('0x29')](function(_0x1da314){if(_0x1da314){return _0x1da314[_0x113a('0x98')](_0x560c02[_0x113a('0x3d')][_0x113a('0x92')])[_0x113a('0x29')](function(){if(_[_0x113a('0x99')](_0x560c02['query'][_0x113a('0x92')])){for(var _0x126a1f=0x0;_0x126a1f<_0x560c02[_0x113a('0x3d')][_0x113a('0x92')][_0x113a('0x41')];_0x126a1f+=0x1){socket[_0x113a('0x82')]('userVoiceQueue:remove',{'UserId':Number(_0x560c02[_0x113a('0x3d')][_0x113a('0x92')][_0x126a1f]),'VoiceQueueId':Number(_0x560c02[_0x113a('0x4e')]['id'])});}}else{socket[_0x113a('0x82')](_0x113a('0x95'),{'UserId':Number(_0x560c02[_0x113a('0x3d')][_0x113a('0x92')]),'VoiceQueueId':Number(_0x560c02[_0x113a('0x4e')]['id'])});}});}})['then'](function(_0x11865e){return db[_0x113a('0x94')][_0x113a('0x2a')]({'where':{'VoiceQueueId':_0x560c02['params']['id'],'UserId':_0x560c02['query']['ids']}})[_0x113a('0x29')](function(){return _0x11865e;});})['then'](respondWithStatusCode(_0x359156,null))[_0x113a('0x4d')](handleError(_0x359156,null));};exports[_0x113a('0x9a')]=function(_0x3160e8,_0x4b0ecb,_0x297834){var _0x4126e0={};var _0x1c7f45={};var _0x391d04;var _0x4c9cc0;return db[_0x113a('0x4f')]['findOne']({'where':{'id':_0x3160e8['params']['id']}})[_0x113a('0x29')](handleEntityNotFound(_0x4b0ecb,null))[_0x113a('0x29')](function(_0x16025f){if(_0x16025f){_0x391d04=_0x16025f;_0x1c7f45[_0x113a('0x3b')]=_['keys'](db[_0x113a('0x71')][_0x113a('0x50')]);_0x1c7f45[_0x113a('0x3d')]=_[_0x113a('0x3c')](_0x3160e8[_0x113a('0x3d')]);_0x1c7f45[_0x113a('0x3e')]=_[_0x113a('0x51')](_0x1c7f45[_0x113a('0x3b')],_0x1c7f45[_0x113a('0x3d')]);_0x4126e0[_0x113a('0x3f')]=_['intersection'](_0x1c7f45[_0x113a('0x3b')],qs[_0x113a('0x40')](_0x3160e8[_0x113a('0x3d')][_0x113a('0x40')]));_0x4126e0[_0x113a('0x3f')]=_0x4126e0[_0x113a('0x3f')][_0x113a('0x41')]?_0x4126e0[_0x113a('0x3f')]:_0x1c7f45[_0x113a('0x3b')];_0x4126e0[_0x113a('0x64')]=qs[_0x113a('0x42')](_0x3160e8['query'][_0x113a('0x42')]);_0x4126e0[_0x113a('0x43')]=qs[_0x113a('0x3e')](_['pick'](_0x3160e8[_0x113a('0x3d')],_0x1c7f45[_0x113a('0x3e')]));if(_0x3160e8['query'][_0x113a('0x2f')]){_0x4126e0[_0x113a('0x43')]=_[_0x113a('0x45')](_0x4126e0[_0x113a('0x43')],{'$or':_['map'](_0x4126e0[_0x113a('0x3f')],function(_0x4af59c){var _0x18e97d={};_0x18e97d[_0x4af59c]={'$like':'%'+_0x3160e8['query'][_0x113a('0x2f')]+'%'};return _0x18e97d;})});}_0x4126e0=_[_0x113a('0x45')]({},_0x4126e0,_0x3160e8[_0x113a('0x49')]);return _0x391d04[_0x113a('0x9a')](_0x4126e0);}})[_0x113a('0x29')](function(_0x59c565){if(_0x59c565){_0x4c9cc0=_0x59c565['length'];if(!_0x3160e8[_0x113a('0x3d')][_0x113a('0x68')]('nolimit')){_0x4126e0[_0x113a('0x23')]=qs[_0x113a('0x23')](_0x3160e8[_0x113a('0x3d')]['limit']);_0x4126e0[_0x113a('0x22')]=qs[_0x113a('0x22')](_0x3160e8['query'][_0x113a('0x22')]);}return _0x391d04[_0x113a('0x9a')](_0x4126e0);}})[_0x113a('0x29')](function(_0x3d527d){if(_0x3d527d){return _0x3d527d?{'count':_0x4c9cc0,'rows':_0x3d527d}:null;}})[_0x113a('0x29')](respondWithResult(_0x4b0ecb,null))[_0x113a('0x4d')](handleError(_0x4b0ecb,null));};exports[_0x113a('0x9b')]=function(_0x3ba9a6,_0x2e9403,_0x195dec){var _0x3871b3={};var _0x152c9f={};var _0x435466;var _0x18db0a;return db[_0x113a('0x4f')]['findOne']({'where':{'id':_0x3ba9a6['params']['id']}})['then'](handleEntityNotFound(_0x2e9403,null))['then'](function(_0x23a305){if(_0x23a305){_0x435466=_0x23a305;_0x152c9f['model']=_[_0x113a('0x3c')](db[_0x113a('0x94')][_0x113a('0x50')]);_0x152c9f[_0x113a('0x3d')]=_[_0x113a('0x3c')](_0x3ba9a6[_0x113a('0x3d')]);_0x152c9f[_0x113a('0x3e')]=_[_0x113a('0x51')](_0x152c9f[_0x113a('0x3b')],_0x152c9f[_0x113a('0x3d')]);_0x3871b3[_0x113a('0x3f')]=_[_0x113a('0x51')](_0x152c9f[_0x113a('0x3b')],qs[_0x113a('0x40')](_0x3ba9a6[_0x113a('0x3d')][_0x113a('0x40')]));_0x3871b3[_0x113a('0x3f')]=_0x3871b3['attributes'][_0x113a('0x41')]?_0x3871b3[_0x113a('0x3f')]:_0x152c9f[_0x113a('0x3b')];_0x3871b3[_0x113a('0x64')]=qs[_0x113a('0x42')](_0x3ba9a6['query'][_0x113a('0x42')]);_0x3871b3['where']=qs[_0x113a('0x3e')](_[_0x113a('0x44')](_0x3ba9a6[_0x113a('0x3d')],_0x152c9f[_0x113a('0x3e')]));if(_0x3ba9a6[_0x113a('0x3d')][_0x113a('0x2f')]){_0x3871b3[_0x113a('0x43')]=_[_0x113a('0x45')](_0x3871b3['where'],{'$or':_['map'](_0x3871b3[_0x113a('0x3f')],function(_0x397653){var _0x4486b9={};_0x4486b9[_0x397653]={'$like':'%'+_0x3ba9a6['query'][_0x113a('0x2f')]+'%'};return _0x4486b9;})});}_0x3871b3=_['merge']({},_0x3871b3,_0x3ba9a6[_0x113a('0x49')]);return _0x435466['getMembers'](_0x3871b3);}})[_0x113a('0x29')](function(_0x1e38a4){if(_0x1e38a4){_0x18db0a=_0x1e38a4[_0x113a('0x41')];if(!_0x3ba9a6['query'][_0x113a('0x68')]('nolimit')){_0x3871b3[_0x113a('0x23')]=qs[_0x113a('0x23')](_0x3ba9a6[_0x113a('0x3d')][_0x113a('0x23')]);_0x3871b3[_0x113a('0x22')]=qs[_0x113a('0x22')](_0x3ba9a6[_0x113a('0x3d')][_0x113a('0x22')]);}return _0x435466[_0x113a('0x9b')](_0x3871b3);}})[_0x113a('0x29')](function(_0xb885aa){return _0xb885aa?{'count':_0x18db0a,'rows':_0xb885aa}:null;})['then'](respondWithResult(_0x2e9403,null))[_0x113a('0x4d')](handleError(_0x2e9403,null));};exports[_0x113a('0x9c')]=function(_0xfae0df,_0x948ee5,_0x5b36ae){var _0x3138f9={};var _0x149394={};var _0x55e109;var _0x143f64;return db[_0x113a('0x4f')][_0x113a('0x61')]({'where':{'id':_0xfae0df['params']['id']}})['then'](handleEntityNotFound(_0x948ee5,null))['then'](function(_0x4cab91){if(_0x4cab91){_0x55e109=_0x4cab91;_0x149394[_0x113a('0x3b')]=_['keys'](db[_0x113a('0x9d')]['rawAttributes']);_0x149394[_0x113a('0x3d')]=_[_0x113a('0x3c')](_0xfae0df[_0x113a('0x3d')]);_0x149394[_0x113a('0x3e')]=_[_0x113a('0x51')](_0x149394['model'],_0x149394['query']);_0x3138f9[_0x113a('0x3f')]=_[_0x113a('0x51')](_0x149394[_0x113a('0x3b')],qs[_0x113a('0x40')](_0xfae0df['query'][_0x113a('0x40')]));_0x3138f9[_0x113a('0x3f')]=_0x3138f9[_0x113a('0x3f')][_0x113a('0x41')]?_0x3138f9['attributes']:_0x149394[_0x113a('0x3b')];_0x3138f9[_0x113a('0x64')]=qs['sort'](_0xfae0df[_0x113a('0x3d')][_0x113a('0x42')]);_0x3138f9['where']=qs[_0x113a('0x3e')](_[_0x113a('0x44')](_0xfae0df[_0x113a('0x3d')],_0x149394['filters']));if(_0xfae0df[_0x113a('0x3d')]['filter']){_0x3138f9['where']=_[_0x113a('0x45')](_0x3138f9[_0x113a('0x43')],{'$or':_['map'](_0x3138f9['attributes'],function(_0x979b6a){var _0x362138={};_0x362138[_0x979b6a]={'$like':'%'+_0xfae0df[_0x113a('0x3d')][_0x113a('0x2f')]+'%'};return _0x362138;})});}_0x3138f9=_[_0x113a('0x45')]({},_0x3138f9,_0xfae0df[_0x113a('0x49')]);return _0x55e109[_0x113a('0x9c')](_0x3138f9);}})[_0x113a('0x29')](function(_0x1f1f29){if(_0x1f1f29){_0x143f64=_0x1f1f29[_0x113a('0x41')];if(!_0xfae0df[_0x113a('0x3d')][_0x113a('0x68')](_0x113a('0x63'))){_0x3138f9[_0x113a('0x23')]=qs[_0x113a('0x23')](_0xfae0df[_0x113a('0x3d')][_0x113a('0x23')]);_0x3138f9['offset']=qs[_0x113a('0x22')](_0xfae0df['query'][_0x113a('0x22')]);}return _0x55e109['getLists'](_0x3138f9);}})[_0x113a('0x29')](function(_0x62b061){if(_0x62b061){return _0x62b061?{'count':_0x143f64,'rows':_0x62b061}:null;}})[_0x113a('0x29')](respondWithResult(_0x948ee5,null))[_0x113a('0x4d')](handleError(_0x948ee5,null));};exports['addLists']=function(_0x1782c5,_0x154337,_0x265beb){var _0x43be60,_0x2864ab;return db[_0x113a('0x4f')][_0x113a('0x35')]({'where':{'id':_0x1782c5['params']['id']}})[_0x113a('0x29')](handleEntityNotFound(_0x154337,null))[_0x113a('0x29')](function(_0x3a06aa){if(_0x3a06aa){_0x2864ab=_0x3a06aa;return _0x3a06aa[_0x113a('0x9e')](_0x1782c5['body'][_0x113a('0x92')],_[_0x113a('0x5d')](_0x1782c5['body'],[_0x113a('0x92'),'id'])||{});}return null;})['spread'](function(_0x1129ae){var _0x37584c;_0x43be60=_0x1129ae||[];var _0x4202b6=[];if(_0x1129ae){for(var _0x497161=0x0;_0x497161<_0x1129ae[_0x113a('0x41')];_0x497161+=0x1){var _0x56f742=_0x1129ae[_0x497161]['get']({'plain':!![]});_0x2864ab[_0x113a('0x9f')]=_0x1782c5['body']['dialCheckDuplicateType']?_0x1782c5[_0x113a('0x5c')][_0x113a('0x9f')]:_0x2864ab[_0x113a('0x9f')];switch(_0x2864ab[_0x113a('0x9f')]){case _0x113a('0xa0'):_0x37584c=squel[_0x113a('0xa1')]()[_0x113a('0xa2')](_0x113a('0xa3'))['fromQuery']([_0x113a('0xa4'),_0x113a('0xa5'),'ContactId',_0x113a('0xa6'),_0x113a('0x69'),'createdAt',_0x113a('0x5b')],squel['select']()[_0x113a('0x48')]('phone',_0x113a('0xa4'))[_0x113a('0x48')](_0x113a('0xa7'),'scheduledAt')['field']('id','ContactId')[_0x113a('0x48')](_0x56f742[_0x113a('0xa8')]['toString'](),_0x113a('0xa6'))[_0x113a('0x48')](_0x1782c5[_0x113a('0x4e')]['id'][_0x113a('0xa9')](),_0x113a('0x69'))[_0x113a('0x48')](_0x113a('0xa7'),_0x113a('0x5e'))[_0x113a('0x48')]('NOW()',_0x113a('0x5b'))[_0x113a('0xaa')]('cm_contacts')['where'](_0x113a('0xab'))[_0x113a('0x43')](_0x113a('0xac'),_0x56f742[_0x113a('0xa8')][_0x113a('0xa9')]())[_0x113a('0x43')](_0x113a('0xad'))[_0x113a('0x43')]('phone\x20NOT\x20IN\x20(?)',squel[_0x113a('0x83')]()[_0x113a('0x48')]('COALESCE(calleridnum,\x27\x27)')[_0x113a('0xaa')](_0x113a('0xae'))[_0x113a('0x43')]('VoiceQueueId\x20=\x20?',_0x1782c5[_0x113a('0x4e')]['id'][_0x113a('0xa9')]()))[_0x113a('0x43')](_0x113a('0xaf'),squel[_0x113a('0x83')]()[_0x113a('0x48')](_0x113a('0xb0'))['from'](_0x113a('0xa3'))[_0x113a('0x43')](_0x113a('0x89'),_0x1782c5[_0x113a('0x4e')]['id'][_0x113a('0xa9')]())))[_0x113a('0xa9')]();break;case'onlyIfOpen':_0x37584c=squel[_0x113a('0xa1')]()[_0x113a('0xa2')](_0x113a('0xa3'))[_0x113a('0xb1')]([_0x113a('0xa4'),'scheduledAt','ContactId','ListId',_0x113a('0x69'),_0x113a('0x5e'),_0x113a('0x5b')],squel['select']()['field']('phone',_0x113a('0xa4'))['field'](_0x113a('0xa7'),_0x113a('0xa5'))[_0x113a('0x48')]('id',_0x113a('0xb2'))[_0x113a('0x48')](_0x56f742[_0x113a('0xa8')][_0x113a('0xa9')](),_0x113a('0xa6'))[_0x113a('0x48')](_0x1782c5[_0x113a('0x4e')]['id'][_0x113a('0xa9')](),_0x113a('0x69'))[_0x113a('0x48')](_0x113a('0xa7'),_0x113a('0x5e'))[_0x113a('0x48')](_0x113a('0xa7'),_0x113a('0x5b'))['from'](_0x113a('0xb3'))[_0x113a('0x43')]('deletedAt\x20IS\x20NULL')[_0x113a('0x43')](_0x113a('0xac'),_0x56f742[_0x113a('0xa8')][_0x113a('0xa9')]())[_0x113a('0x43')]('phone\x20IS\x20NOT\x20NULL')[_0x113a('0x43')]('phone\x20NOT\x20IN\x20(?)',squel[_0x113a('0x83')]()[_0x113a('0x48')]('COALESCE(phone,\x27\x27)')['from']('cm_hopper')[_0x113a('0x43')](_0x113a('0x89'),_0x1782c5[_0x113a('0x4e')]['id'][_0x113a('0xa9')]())))['toString']();break;default:_0x37584c=squel['insert']()[_0x113a('0xa2')](_0x113a('0xa3'))[_0x113a('0xb1')]([_0x113a('0xa4'),_0x113a('0xa5'),_0x113a('0xb2'),_0x113a('0xa6'),_0x113a('0x69'),_0x113a('0x5e'),_0x113a('0x5b')],squel['select']()[_0x113a('0x48')](_0x113a('0xa4'),_0x113a('0xa4'))[_0x113a('0x48')](_0x113a('0xa7'),_0x113a('0xa5'))[_0x113a('0x48')]('id',_0x113a('0xb2'))[_0x113a('0x48')](_0x56f742[_0x113a('0xa8')][_0x113a('0xa9')](),_0x113a('0xa6'))['field'](_0x1782c5[_0x113a('0x4e')]['id']['toString'](),_0x113a('0x69'))['field'](_0x113a('0xa7'),'createdAt')['field'](_0x113a('0xa7'),_0x113a('0x5b'))[_0x113a('0xaa')](_0x113a('0xb3'))[_0x113a('0x43')](_0x113a('0xab'))[_0x113a('0x43')](_0x113a('0xac'),_0x56f742['CmListId'][_0x113a('0xa9')]())[_0x113a('0x43')](_0x113a('0xad')))['toString']();}_0x4202b6['push'](db[_0x113a('0x78')]['query'](_0x37584c));}return BPromise[_0x113a('0x90')](_0x4202b6);}})[_0x113a('0x29')](function(){return _0x43be60;})[_0x113a('0x29')](respondWithResult(_0x154337,null))[_0x113a('0x4d')](handleError(_0x154337,null));};exports[_0x113a('0xb4')]=function(_0x412438,_0x4ac967,_0x44b975){return db['VoiceQueue'][_0x113a('0x35')]({'where':{'id':_0x412438['params']['id']}})['then'](handleEntityNotFound(_0x4ac967,null))[_0x113a('0x29')](function(_0x523d7a){if(_0x523d7a){return _0x523d7a[_0x113a('0xb4')](_0x412438[_0x113a('0x3d')][_0x113a('0x92')]);}})['then'](function(_0x5ea8ce){if(_0x5ea8ce){return db[_0x113a('0x62')]['destroy']({'where':{'ListId':_0x412438[_0x113a('0x3d')][_0x113a('0x92')],'VoiceQueueId':_0x412438[_0x113a('0x4e')]['id']}})[_0x113a('0x29')](function(){return _0x5ea8ce;});}})[_0x113a('0x29')](respondWithStatusCode(_0x4ac967,null))[_0x113a('0x4d')](handleError(_0x4ac967,null));};exports['getBlackLists']=function(_0x1b1520,_0xf7f5fa,_0x1689e2){var _0x42f705={};var _0x323b42={};var _0x4c241b;var _0x5e4719;return db[_0x113a('0x4f')][_0x113a('0x61')]({'where':{'id':_0x1b1520[_0x113a('0x4e')]['id']}})['then'](handleEntityNotFound(_0xf7f5fa,null))[_0x113a('0x29')](function(_0x2dc7b7){if(_0x2dc7b7){_0x4c241b=_0x2dc7b7;_0x323b42[_0x113a('0x3b')]=_[_0x113a('0x3c')](db['CmList'][_0x113a('0x50')]);_0x323b42[_0x113a('0x3d')]=_[_0x113a('0x3c')](_0x1b1520[_0x113a('0x3d')]);_0x323b42[_0x113a('0x3e')]=_[_0x113a('0x51')](_0x323b42[_0x113a('0x3b')],_0x323b42[_0x113a('0x3d')]);_0x42f705[_0x113a('0x3f')]=_[_0x113a('0x51')](_0x323b42['model'],qs['fields'](_0x1b1520[_0x113a('0x3d')][_0x113a('0x40')]));_0x42f705[_0x113a('0x3f')]=_0x42f705[_0x113a('0x3f')][_0x113a('0x41')]?_0x42f705['attributes']:_0x323b42[_0x113a('0x3b')];_0x42f705[_0x113a('0x64')]=qs[_0x113a('0x42')](_0x1b1520[_0x113a('0x3d')][_0x113a('0x42')]);_0x42f705[_0x113a('0x43')]=qs['filters'](_[_0x113a('0x44')](_0x1b1520[_0x113a('0x3d')],_0x323b42[_0x113a('0x3e')]));if(_0x1b1520[_0x113a('0x3d')][_0x113a('0x2f')]){_0x42f705[_0x113a('0x43')]=_[_0x113a('0x45')](_0x42f705['where'],{'$or':_[_0x113a('0x31')](_0x42f705[_0x113a('0x3f')],function(_0x11592){var _0x1a5aa3={};_0x1a5aa3[_0x11592]={'$like':'%'+_0x1b1520[_0x113a('0x3d')][_0x113a('0x2f')]+'%'};return _0x1a5aa3;})});}_0x42f705=_[_0x113a('0x45')]({},_0x42f705,_0x1b1520['options']);return _0x4c241b['getBlackLists'](_0x42f705);}})[_0x113a('0x29')](function(_0x410760){if(_0x410760){_0x5e4719=_0x410760['length'];if(!_0x1b1520[_0x113a('0x3d')]['hasOwnProperty'](_0x113a('0x63'))){_0x42f705[_0x113a('0x23')]=qs[_0x113a('0x23')](_0x1b1520[_0x113a('0x3d')][_0x113a('0x23')]);_0x42f705['offset']=qs[_0x113a('0x22')](_0x1b1520[_0x113a('0x3d')][_0x113a('0x22')]);}return _0x4c241b['getBlackLists'](_0x42f705);}})['then'](function(_0x4fa453){if(_0x4fa453){return _0x4fa453?{'count':_0x5e4719,'rows':_0x4fa453}:null;}})[_0x113a('0x29')](respondWithResult(_0xf7f5fa,null))[_0x113a('0x4d')](handleError(_0xf7f5fa,null));};exports['addBlackLists']=function(_0x42bf9c,_0x2ce956,_0x4d93b8){var _0x38565e,_0x337c41;return db[_0x113a('0x4f')][_0x113a('0x35')]({'where':{'id':_0x42bf9c['params']['id']}})['then'](handleEntityNotFound(_0x2ce956,null))[_0x113a('0x29')](function(_0x16ddb0){if(_0x16ddb0){_0x337c41=_0x16ddb0;return _0x16ddb0[_0x113a('0xb5')](_0x42bf9c[_0x113a('0x5c')]['ids'],_['omit'](_0x42bf9c[_0x113a('0x5c')],[_0x113a('0x92'),'id'])||{});}return null;})['spread'](function(_0x112865){var _0x34d44f;_0x38565e=_0x112865||[];var _0x55edb5=[];if(_0x112865){for(var _0x41dec2=0x0;_0x41dec2<_0x112865[_0x113a('0x41')];_0x41dec2+=0x1){var _0x24b191=_0x112865[_0x41dec2][_0x113a('0x2b')]({'plain':!![]});_0x34d44f=squel[_0x113a('0xa1')]()['into'](_0x113a('0xb6'))[_0x113a('0xb1')](['phone',_0x113a('0xb2'),_0x113a('0xa6'),'VoiceQueueId',_0x113a('0x5e'),_0x113a('0x5b')],squel['select']()[_0x113a('0x48')]('phone',_0x113a('0xa4'))[_0x113a('0x48')]('id',_0x113a('0xb2'))[_0x113a('0x48')](_0x24b191[_0x113a('0xa8')][_0x113a('0xa9')](),_0x113a('0xa6'))[_0x113a('0x48')](_0x42bf9c['params']['id'][_0x113a('0xa9')](),'VoiceQueueId')[_0x113a('0x48')](_0x113a('0xa7'),_0x113a('0x5e'))[_0x113a('0x48')](_0x113a('0xa7'),_0x113a('0x5b'))[_0x113a('0xaa')](_0x113a('0xb3'))['where'](_0x113a('0xab'))[_0x113a('0x43')](_0x113a('0xac'),_0x24b191[_0x113a('0xa8')][_0x113a('0xa9')]())[_0x113a('0x43')](_0x113a('0xad')))['toString']();_0x55edb5[_0x113a('0x8b')](db['sequelize'][_0x113a('0x3d')](_0x34d44f));}return BPromise[_0x113a('0x90')](_0x55edb5);}})[_0x113a('0x29')](function(){return _0x38565e;})[_0x113a('0x29')](respondWithResult(_0x2ce956,null))[_0x113a('0x4d')](handleError(_0x2ce956,null));};exports[_0x113a('0xb7')]=function(_0x52064a,_0x49a552,_0x2fe116){return db[_0x113a('0x4f')][_0x113a('0x35')]({'where':{'id':_0x52064a['params']['id']}})[_0x113a('0x29')](handleEntityNotFound(_0x49a552,null))[_0x113a('0x29')](function(_0x5c3d08){if(_0x5c3d08){return _0x5c3d08['removeBlackLists'](_0x52064a[_0x113a('0x3d')][_0x113a('0x92')]);}})[_0x113a('0x29')](function(_0x365458){if(_0x365458){return db[_0x113a('0x6c')]['destroy']({'where':{'ListId':_0x52064a['query']['ids'],'VoiceQueueId':_0x52064a[_0x113a('0x4e')]['id']}})[_0x113a('0x29')](function(){return _0x365458;});}})[_0x113a('0x29')](respondWithStatusCode(_0x49a552,null))['catch'](handleError(_0x49a552,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 56393ca..9f12ba2 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 _0x4e6f=['VoiceQueue','save','update','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0x4e6f,0x17e));var _0xf4e6=function(_0x1f44eb,_0xff2616){_0x1f44eb=_0x1f44eb-0x0;var _0x2e09e9=_0x4e6f[_0x1f44eb];return _0x2e09e9;};'use strict';var EventEmitter=require(_0xf4e6('0x0'));var VoiceQueue=require(_0xf4e6('0x1'))['db'][_0xf4e6('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf4e6('0x3'),'afterUpdate':_0xf4e6('0x4'),'afterDestroy':_0xf4e6('0x5')};function emitEvent(_0x5e69ba){return function(_0x2516dd,_0x426881,_0x18e8be){VoiceQueueEvents['emit'](_0x5e69ba+':'+_0x2516dd['id'],_0x2516dd);VoiceQueueEvents[_0xf4e6('0x6')](_0x5e69ba,_0x2516dd);_0x18e8be(null);};}for(var e in events){if(events[_0xf4e6('0x7')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file +var _0xc932=['save','update','emit','hasOwnProperty','events','../../mysqldb','VoiceQueue','setMaxListeners'];(function(_0x3d14a8,_0x394bf1){var _0x58abc6=function(_0x1a40a4){while(--_0x1a40a4){_0x3d14a8['push'](_0x3d14a8['shift']());}};_0x58abc6(++_0x394bf1);}(_0xc932,0x11c));var _0x2c93=function(_0x5dc45d,_0x55f90f){_0x5dc45d=_0x5dc45d-0x0;var _0x4ce697=_0xc932[_0x5dc45d];return _0x4ce697;};'use strict';var EventEmitter=require(_0x2c93('0x0'));var VoiceQueue=require(_0x2c93('0x1'))['db'][_0x2c93('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x2c93('0x3')](0x0);var events={'afterCreate':_0x2c93('0x4'),'afterUpdate':_0x2c93('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2d7daa){return function(_0x516140,_0x376897,_0x5b93eb){VoiceQueueEvents[_0x2c93('0x6')](_0x2d7daa+':'+_0x516140['id'],_0x516140);VoiceQueueEvents['emit'](_0x2d7daa,_0x516140);_0x5b93eb(null);};}for(var e in events){if(events[_0x2c93('0x7')](e)){var event=events[e];VoiceQueue['hook'](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 011a116..17a4623 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 _0xee5b=['request-promise','path','rimraf','exports','define','lodash','../../config/logger','api','bluebird'];(function(_0x48bd0b,_0x3f0f4f){var _0xc8da95=function(_0x250305){while(--_0x250305){_0x48bd0b['push'](_0x48bd0b['shift']());}};_0xc8da95(++_0x3f0f4f);}(_0xee5b,0x1f4));var _0xbee5=function(_0x1cfc88,_0x25e138){_0x1cfc88=_0x1cfc88-0x0;var _0x25a112=_0xee5b[_0x1cfc88];return _0x25a112;};'use strict';var _=require(_0xbee5('0x0'));var util=require('util');var logger=require(_0xbee5('0x1'))(_0xbee5('0x2'));var moment=require('moment');var BPromise=require(_0xbee5('0x3'));var rp=require(_0xbee5('0x4'));var fs=require('fs');var path=require(_0xbee5('0x5'));var rimraf=require(_0xbee5('0x6'));var config=require('../../config/environment');var attributes=require('./voiceQueue.attributes');module[_0xbee5('0x7')]=function(_0x2c0bde,_0xab6e4d){return _0x2c0bde[_0xbee5('0x8')]('VoiceQueue',attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf109=['VoiceQueue','voice_queues','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','define'];(function(_0x372597,_0x55320d){var _0x25056c=function(_0x52745b){while(--_0x52745b){_0x372597['push'](_0x372597['shift']());}};_0x25056c(++_0x55320d);}(_0xf109,0xce));var _0x9f10=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xf109[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0x9f10('0x0'));var util=require(_0x9f10('0x1'));var logger=require(_0x9f10('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9f10('0x3'));var fs=require('fs');var path=require(_0x9f10('0x4'));var rimraf=require(_0x9f10('0x5'));var config=require(_0x9f10('0x6'));var attributes=require(_0x9f10('0x7'));module[_0x9f10('0x8')]=function(_0x408fe8,_0xd3137b){return _0x408fe8[_0x9f10('0x9')](_0x9f10('0xa'),attributes,{'tableName':_0x9f10('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 1303cb8..7a5b083 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(_0x3af529,_0xf4d73){var _0x5cf4c2=function(_0x24418d){while(--_0x24418d){_0x3af529['push'](_0x3af529['shift']());}};_0x5cf4c2(++_0xf4d73);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});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 _0xa9e0=['register','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowVoiceQueue','VoiceQueue','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter'];(function(_0xfd5f9c,_0x281f89){var _0x2c60b4=function(_0x40e072){while(--_0x40e072){_0xfd5f9c['push'](_0xfd5f9c['shift']());}};_0x2c60b4(++_0x281f89);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});config[_0x0a9e('0xa')]=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xc'))(new Redis(config['redis']));require('./voiceQueue.socket')[_0x0a9e('0xd')](socket);function respondWithRpcPromise(_0xf81284,_0x307b3e,_0x3ab53f){return new BPromise(function(_0xfeb75b,_0xbd1168){return client['request'](_0xf81284,_0x3ab53f)['then'](function(_0x527cdd){logger['info'](_0x0a9e('0xe'),_0x307b3e,_0x0a9e('0xf'));logger[_0x0a9e('0x10')](_0x0a9e('0x11'),_0x307b3e,_0x0a9e('0xf'),JSON[_0x0a9e('0x12')](_0x527cdd));if(_0x527cdd['error']){if(_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x14')]===0x1f4){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x15')]);return _0xbd1168(_0x527cdd['error'][_0x0a9e('0x15')]);}logger['error'](_0x0a9e('0xe'),_0x307b3e,_0x527cdd['error'][_0x0a9e('0x15')]);return _0xfeb75b(_0x527cdd[_0x0a9e('0x13')]['message']);}else{logger[_0x0a9e('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x307b3e,_0x0a9e('0xf'));_0xfeb75b(_0x527cdd[_0x0a9e('0x17')][_0x0a9e('0x15')]);}})[_0x0a9e('0x18')](function(_0x31b1ca){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x31b1ca);_0xbd1168(_0x31b1ca);});});}exports[_0x0a9e('0x19')]=function(_0x1314ae){var _0x112016=this;return new Promise(function(_0x1c696a,_0x105080){return db['VoiceQueue'][_0x0a9e('0x1a')]({'raw':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae['options'][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x1314ae['options']?_0x1314ae['options'][_0x0a9e('0x1d')]||null:null,'attributes':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'limit':_0x1314ae['options']?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')]||null:null,'include':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x1314ae[_0x0a9e('0x1b')]['include'],function(_0x59181e){return{'model':db[_0x59181e[_0x0a9e('0x22')]],'as':_0x59181e['as'],'attributes':_0x59181e[_0x0a9e('0x1e')],'include':_0x59181e[_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x59181e['include'],function(_0x384319){return{'model':db[_0x384319['model']],'as':_0x384319['as'],'attributes':_0x384319[_0x0a9e('0x1e')],'include':_0x384319['include']?_[_0x0a9e('0x21')](_0x384319[_0x0a9e('0x20')],function(_0x25fba9){return{'model':db[_0x25fba9[_0x0a9e('0x22')]],'as':_0x25fba9['as'],'attributes':_0x25fba9[_0x0a9e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x11c3b6){logger[_0x0a9e('0x16')]('GetVoiceQueue',_0x1314ae);logger[_0x0a9e('0x10')](_0x0a9e('0x19'),_0x1314ae,JSON[_0x0a9e('0x12')](_0x11c3b6));_0x1c696a(_0x11c3b6);})[_0x0a9e('0x18')](function(_0x5c877d){logger[_0x0a9e('0x13')](_0x0a9e('0x19'),_0x5c877d[_0x0a9e('0x15')],_0x1314ae);_0x105080(_0x112016[_0x0a9e('0x13')](0x1f4,_0x5c877d[_0x0a9e('0x15')]));});});};exports[_0x0a9e('0x24')]=function(_0x296f41){var _0x2e8759=this;return new Promise(function(_0x1dbde2,_0x540530){return db[_0x0a9e('0x25')]['find']({'raw':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')]['where']||null:null,'attributes':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'include':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')][_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x296f41[_0x0a9e('0x1b')]['include'],function(_0x44295a){return{'model':db[_0x44295a['model']],'as':_0x44295a['as'],'attributes':_0x44295a[_0x0a9e('0x1e')],'include':_0x44295a[_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x44295a[_0x0a9e('0x20')],function(_0x567193){return{'model':db[_0x567193[_0x0a9e('0x22')]],'as':_0x567193['as'],'attributes':_0x567193[_0x0a9e('0x1e')],'include':_0x567193[_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x567193['include'],function(_0x54135e){return{'model':db[_0x54135e[_0x0a9e('0x22')]],'as':_0x54135e['as'],'attributes':_0x54135e['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x3d9717){logger[_0x0a9e('0x16')](_0x0a9e('0x24'),_0x296f41);logger['debug'](_0x0a9e('0x24'),_0x296f41,JSON[_0x0a9e('0x12')](_0x3d9717));_0x1dbde2(_0x3d9717);})[_0x0a9e('0x18')](function(_0x533942){logger[_0x0a9e('0x13')](_0x0a9e('0x24'),_0x533942[_0x0a9e('0x15')],_0x296f41);_0x540530(_0x2e8759['error'](0x1f4,_0x533942['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 55fd8b8..53b1f07 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 _0xa1a0=['save','remove','removeListener','length','voiceQueue:','./voiceQueue.events'];(function(_0x5deb0a,_0xc192bb){var _0x33d0ce=function(_0x3f1aa8){while(--_0x3f1aa8){_0x5deb0a['push'](_0x5deb0a['shift']());}};_0x33d0ce(++_0xc192bb);}(_0xa1a0,0x10d));var _0x0a1a=function(_0x185ce6,_0x80b049){_0x185ce6=_0x185ce6-0x0;var _0xb2b554=_0xa1a0[_0x185ce6];return _0xb2b554;};'use strict';var VoiceQueueEvents=require(_0x0a1a('0x0'));var events=[_0x0a1a('0x1'),_0x0a1a('0x2'),'update'];function createListener(_0x4192db,_0x535d04){return function(_0x3eb57f){_0x535d04['emit'](_0x4192db,_0x3eb57f);};}function removeListener(_0x33e362,_0x52cf61){return function(){VoiceQueueEvents[_0x0a1a('0x3')](_0x33e362,_0x52cf61);};}exports['register']=function(_0xbf627c){for(var _0x2d5ca6=0x0,_0x139901=events[_0x0a1a('0x4')];_0x2d5ca6<_0x139901;_0x2d5ca6++){var _0x16ffd3=events[_0x2d5ca6];var _0x43277a=createListener(_0x0a1a('0x5')+_0x16ffd3,_0xbf627c);VoiceQueueEvents['on'](_0x16ffd3,_0x43277a);}}; \ No newline at end of file +var _0x3852=['length','./voiceQueue.events','save','remove','emit','removeListener'];(function(_0x575864,_0xa665a6){var _0x51e7a3=function(_0x1062c1){while(--_0x1062c1){_0x575864['push'](_0x575864['shift']());}};_0x51e7a3(++_0xa665a6);}(_0x3852,0x193));var _0x2385=function(_0x2be22c,_0x15e806){_0x2be22c=_0x2be22c-0x0;var _0x78384d=_0x3852[_0x2be22c];return _0x78384d;};'use strict';var VoiceQueueEvents=require(_0x2385('0x0'));var events=[_0x2385('0x1'),_0x2385('0x2'),'update'];function createListener(_0x13c15f,_0xe30c84){return function(_0x17b20a){_0xe30c84[_0x2385('0x3')](_0x13c15f,_0x17b20a);};}function removeListener(_0x184978,_0x2e6ac2){return function(){VoiceQueueEvents[_0x2385('0x4')](_0x184978,_0x2e6ac2);};}exports['register']=function(_0x52bc44){for(var _0x421f77=0x0,_0x36e349=events[_0x2385('0x5')];_0x421f77<_0x36e349;_0x421f77++){var _0x2754ad=events[_0x421f77];var _0x9ceb6e=createListener('voiceQueue:'+_0x2754ad,_0x52bc44);VoiceQueueEvents['on'](_0x2754ad,_0x9ceb6e);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 71d66bf..72304fb 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 _0x77c9=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','/describe','describe','/index','getVoiceQueuesReport','/:id','post','create','put','update','destroy','exports','multer','util','connect-timeout'];(function(_0x4ea7c3,_0x2c4914){var _0x5c6626=function(_0x5a818b){while(--_0x5a818b){_0x4ea7c3['push'](_0x4ea7c3['shift']());}};_0x5c6626(++_0x2c4914);}(_0x77c9,0x177));var _0x977c=function(_0x495c2b,_0x5044b0){_0x495c2b=_0x495c2b-0x0;var _0x370520=_0x77c9[_0x495c2b];return _0x370520;};'use strict';var multer=require(_0x977c('0x0'));var util=require(_0x977c('0x1'));var path=require('path');var timeout=require(_0x977c('0x2'));var express=require(_0x977c('0x3'));var router=express['Router']();var auth=require(_0x977c('0x4'));var interaction=require(_0x977c('0x5'));var config=require(_0x977c('0x6'));var controller=require(_0x977c('0x7'));router[_0x977c('0x8')]('/',auth[_0x977c('0x9')](),controller['index']);router[_0x977c('0x8')](_0x977c('0xa'),auth[_0x977c('0x9')](),controller[_0x977c('0xb')]);router[_0x977c('0x8')](_0x977c('0xc'),auth[_0x977c('0x9')](),controller[_0x977c('0xd')]);router['get'](_0x977c('0xe'),auth[_0x977c('0x9')](),controller['show']);router[_0x977c('0xf')]('/',auth['isAuthenticated'](),controller[_0x977c('0x10')]);router[_0x977c('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x977c('0x12')]);router['delete'](_0x977c('0xe'),auth[_0x977c('0x9')](),controller[_0x977c('0x13')]);module[_0x977c('0x14')]=router; \ No newline at end of file +var _0x20f0=['Router','../../components/auth/service','../../components/interaction/service','./voiceQueueReport.controller','isAuthenticated','index','get','describe','/index','getVoiceQueuesReport','show','post','create','/:id','update','delete','destroy','multer','path','connect-timeout'];(function(_0x18fc83,_0x205c12){var _0x397c28=function(_0x545253){while(--_0x545253){_0x18fc83['push'](_0x18fc83['shift']());}};_0x397c28(++_0x205c12);}(_0x20f0,0x1b5));var _0x020f=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x20f0[_0x13d07a];return _0x5ee0ee;};'use strict';var multer=require(_0x020f('0x0'));var util=require('util');var path=require(_0x020f('0x1'));var timeout=require(_0x020f('0x2'));var express=require('express');var router=express[_0x020f('0x3')]();var auth=require(_0x020f('0x4'));var interaction=require(_0x020f('0x5'));var config=require('../../config/environment');var controller=require(_0x020f('0x6'));router['get']('/',auth[_0x020f('0x7')](),controller[_0x020f('0x8')]);router[_0x020f('0x9')]('/describe',auth[_0x020f('0x7')](),controller[_0x020f('0xa')]);router[_0x020f('0x9')](_0x020f('0xb'),auth[_0x020f('0x7')](),controller[_0x020f('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x020f('0xd')]);router[_0x020f('0xe')]('/',auth['isAuthenticated'](),controller[_0x020f('0xf')]);router['put'](_0x020f('0x10'),auth[_0x020f('0x7')](),controller[_0x020f('0x11')]);router[_0x020f('0x12')](_0x020f('0x10'),auth[_0x020f('0x7')](),controller[_0x020f('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 20af062..aae9297 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 _0x86d4=['COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','STRING','DATE','getDataValue','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','queuecallerleaveAt','setDataValue','INTEGER','BOOLEAN'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x86d4,0xf8));var _0x486d=function(_0x5dd918,_0x2adecd){_0x5dd918=_0x5dd918-0x0;var _0x4eb3ae=_0x86d4[_0x5dd918];return _0x4eb3ae;};'use strict';var Sequelize=require(_0x486d('0x0'));var moment=require('moment');module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x486d('0x1')]},'calleridnum':{'type':Sequelize[_0x486d('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x486d('0x1')]},'queuecallerjoinAt':{'type':Sequelize[_0x486d('0x2')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x3e970a){var _0x498fcd=moment(_0x3e970a);var _0x35b0a0=moment(this[_0x486d('0x3')]('queuecallerjoinAt'))[_0x486d('0x4')](_0x486d('0x5'));var _0x1dddd4=_0x498fcd[_0x486d('0x6')](_0x35b0a0,_0x486d('0x7'));this['setDataValue'](_0x486d('0x8'),_0x3e970a);this[_0x486d('0x9')]('holdtime',_0x1dddd4||null);}},'position':{'type':Sequelize[_0x486d('0xa')]},'count':{'type':Sequelize[_0x486d('0xa')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x486d('0x2')]},'queuecallercomplete':{'type':Sequelize[_0x486d('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x486d('0x2')]},'queuecallerexit':{'type':Sequelize[_0x486d('0xb')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x486d('0x2')]},'queuecallerexitreason':{'type':Sequelize[_0x486d('0x1')],'comment':_0x486d('0xc')},'originalposition':{'type':Sequelize[_0x486d('0xa')]},'channel':{'type':Sequelize[_0x486d('0x1')]},'connectedlinenum':{'type':Sequelize[_0x486d('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x486d('0x1')]},'context':{'type':Sequelize[_0x486d('0x1')]},'exten':{'type':Sequelize[_0x486d('0x1')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x486d('0xa')]},'mohtime':{'type':Sequelize[_0x486d('0xa')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x486d('0x1')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x486d('0x1')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x486d('0x1')]},'disposition':{'type':Sequelize[_0x486d('0x1')]},'queuecallerenterreason':{'type':Sequelize[_0x486d('0xa')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa2bb=['sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','seconds','setDataValue','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x2f9b25,_0x124efb){var _0x5864ad=function(_0x5085e8){while(--_0x5085e8){_0x2f9b25['push'](_0x2f9b25['shift']());}};_0x5864ad(++_0x124efb);}(_0xa2bb,0xb4));var _0xba2b=function(_0x57f4b2,_0xf506cd){_0x57f4b2=_0x57f4b2-0x0;var _0x242289=_0xa2bb[_0x57f4b2];return _0x242289;};'use strict';var Sequelize=require(_0xba2b('0x0'));var moment=require(_0xba2b('0x1'));module[_0xba2b('0x2')]={'type':{'type':Sequelize[_0xba2b('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xba2b('0x3')]},'calleridname':{'type':Sequelize[_0xba2b('0x3')]},'queue':{'type':Sequelize[_0xba2b('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0xba2b('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0xba2b('0x4')],'set':function(_0x785e5f){var _0x39381d=moment(_0x785e5f);var _0x4d4a07=moment(this[_0xba2b('0x5')](_0xba2b('0x6')))['format'](_0xba2b('0x7'));var _0x5fc320=_0x39381d['diff'](_0x4d4a07,_0xba2b('0x8'));this['setDataValue']('queuecallerleaveAt',_0x785e5f);this[_0xba2b('0x9')](_0xba2b('0xa'),_0x5fc320||null);}},'position':{'type':Sequelize[_0xba2b('0xb')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0xba2b('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xba2b('0x4')]},'queuecallercomplete':{'type':Sequelize[_0xba2b('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xba2b('0x4')]},'queuecallerexit':{'type':Sequelize[_0xba2b('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xba2b('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0xba2b('0x3')],'comment':_0xba2b('0xd')},'originalposition':{'type':Sequelize[_0xba2b('0xb')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xba2b('0x3')]},'connectedlinename':{'type':Sequelize[_0xba2b('0x3')]},'accountcode':{'type':Sequelize[_0xba2b('0x3')]},'context':{'type':Sequelize[_0xba2b('0x3')]},'exten':{'type':Sequelize[_0xba2b('0x3')]},'priority':{'type':Sequelize[_0xba2b('0x3')]},'holdtime':{'type':Sequelize[_0xba2b('0xb')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xba2b('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xba2b('0x3')]},'transfer':{'type':Sequelize[_0xba2b('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0xba2b('0xe')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xba2b('0x3')]},'disposition':{'type':Sequelize[_0xba2b('0x3')]},'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 d63cf2e..53e8952 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 _0x9997=['VoiceQueueReport','rawAttributes','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','map','type','VIRTUAL','field','options','includeAll','include','rows','catch','show','create','update','body','find','params','destroy','describe','filter','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','count','offset','limit','set','Content-Range','json','save','then','error','name','send','index'];(function(_0x535aa5,_0x238372){var _0x2b60c9=function(_0x16c54c){while(--_0x16c54c){_0x535aa5['push'](_0x535aa5['shift']());}};_0x2b60c9(++_0x238372);}(_0x9997,0x14b));var _0x7999=function(_0x4164f2,_0x38669f){_0x4164f2=_0x4164f2-0x0;var _0x2575c7=_0x9997[_0x4164f2];return _0x2575c7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7999('0x0'));var rimraf=require(_0x7999('0x1'));var zipdir=require(_0x7999('0x2'));var jsonpatch=require(_0x7999('0x3'));var rp=require('request-promise');var moment=require(_0x7999('0x4'));var BPromise=require(_0x7999('0x5'));var Mustache=require(_0x7999('0x6'));var util=require(_0x7999('0x7'));var path=require(_0x7999('0x8'));var sox=require(_0x7999('0x9'));var csv=require(_0x7999('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x7999('0xb'));var crypto=require(_0x7999('0xc'));var jsforce=require(_0x7999('0xd'));var deskjs=require(_0x7999('0xe'));var toCsv=require(_0x7999('0xa'));var querystring=require(_0x7999('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7999('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x7999('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x7999('0x12'));var db=require(_0x7999('0x13'))['db'];config[_0x7999('0x14')]=_[_0x7999('0x15')](config[_0x7999('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0x7999('0x16'))(new Redis(config[_0x7999('0x14')]));require('./voiceQueueReport.socket')[_0x7999('0x17')](socket);function respondWithStatusCode(_0x2fe469,_0x99bbe6){_0x99bbe6=_0x99bbe6||0xcc;return function(_0xd3d4da){if(_0xd3d4da){return _0x2fe469[_0x7999('0x18')](_0x99bbe6);}return _0x2fe469[_0x7999('0x19')](_0x99bbe6)[_0x7999('0x1a')]();};}function respondWithResult(_0x2e25eb,_0xbeb9d7){_0xbeb9d7=_0xbeb9d7||0xc8;return function(_0x585add){if(_0x585add){return _0x2e25eb[_0x7999('0x19')](_0xbeb9d7)['json'](_0x585add);}};}function respondWithFilteredResult(_0x49717e,_0x4afa43){return function(_0x12da3d){if(_0x12da3d){var _0x5c5306=_0x12da3d[_0x7999('0x1b')],_0x147ae1=_0x4afa43[_0x7999('0x1c')],_0x3f4be2=_0x4afa43[_0x7999('0x1c')]+_0x4afa43[_0x7999('0x1d')],_0x30029f;if(_0x3f4be2>=_0x5c5306){_0x3f4be2=_0x5c5306;_0x30029f=0xc8;}else{_0x30029f=0xce;}_0x49717e[_0x7999('0x19')](_0x30029f);return _0x49717e[_0x7999('0x1e')](_0x7999('0x1f'),_0x147ae1+'-'+_0x3f4be2+'/'+_0x5c5306)[_0x7999('0x20')](_0x12da3d);}return null;};}function patchUpdates(_0x4d45f3){return function(_0x96c0ae){try{jsonpatch['apply'](_0x96c0ae,_0x4d45f3,!![]);}catch(_0x5e2eb2){return BPromise['reject'](_0x5e2eb2);}return _0x96c0ae[_0x7999('0x21')]();};}function saveUpdates(_0xd8db3e,_0x2d71bd){return function(_0x50e03a){if(_0x50e03a){return _0x50e03a['update'](_0xd8db3e)[_0x7999('0x22')](function(_0x5b1b8a){return _0x5b1b8a;});}return null;};}function removeEntity(_0x482c92,_0x5143e3){return function(_0x562fd3){if(_0x562fd3){return _0x562fd3['destroy']()[_0x7999('0x22')](function(){_0x482c92[_0x7999('0x19')](0xcc)[_0x7999('0x1a')]();});}};}function handleEntityNotFound(_0x18930e,_0x25bc09){return function(_0x12afd2){if(!_0x12afd2){_0x18930e[_0x7999('0x18')](0x194);}return _0x12afd2;};}function handleError(_0x5a030c,_0x27400b){_0x27400b=_0x27400b||0x1f4;return function(_0x41022a){logger[_0x7999('0x23')](_0x41022a['stack']);if(_0x41022a['name']){delete _0x41022a[_0x7999('0x24')];}_0x5a030c[_0x7999('0x19')](_0x27400b)[_0x7999('0x25')](_0x41022a);};}exports[_0x7999('0x26')]=function(_0x3c3001,_0xa0c84c){var _0x2a6043={},_0x520079={},_0x3df6fb={'count':0x0,'rows':[]};var _0x134add=db[_0x7999('0x27')][_0x7999('0x28')];_0x520079['model']=_[_0x7999('0x29')](_0x134add);_0x520079[_0x7999('0x2a')]=_[_0x7999('0x29')](_0x3c3001[_0x7999('0x2a')]);_0x520079[_0x7999('0x2b')]=_['intersection'](_0x520079[_0x7999('0x2c')],_0x520079[_0x7999('0x2a')]);_0x2a6043[_0x7999('0x2d')]=_[_0x7999('0x2e')](_0x520079[_0x7999('0x2c')],qs[_0x7999('0x2f')](_0x3c3001['query'][_0x7999('0x2f')]));_0x2a6043[_0x7999('0x2d')]=_0x2a6043[_0x7999('0x2d')][_0x7999('0x30')]?_0x2a6043['attributes']:_0x520079[_0x7999('0x2c')];if(!_0x3c3001[_0x7999('0x2a')][_0x7999('0x31')](_0x7999('0x32'))){_0x2a6043[_0x7999('0x1d')]=qs[_0x7999('0x1d')](_0x3c3001[_0x7999('0x2a')][_0x7999('0x1d')]);_0x2a6043[_0x7999('0x1c')]=qs[_0x7999('0x1c')](_0x3c3001['query'][_0x7999('0x1c')]);}_0x2a6043['order']=qs[_0x7999('0x33')](_0x3c3001[_0x7999('0x2a')][_0x7999('0x33')]);_0x2a6043['where']=qs[_0x7999('0x2b')](_[_0x7999('0x34')](_0x3c3001[_0x7999('0x2a')],_0x520079['filters']));if(_0x3c3001[_0x7999('0x2a')]['filter']){_0x2a6043[_0x7999('0x35')]=_[_0x7999('0x36')](_0x2a6043['where'],{'$or':_[_0x7999('0x37')](_0x134add,function(_0x5e9089){if(_0x5e9089[_0x7999('0x38')]['key']!==_0x7999('0x39')){var _0x5d84bb={};_0x5d84bb[_0x5e9089[_0x7999('0x3a')]]={'$like':'%'+_0x3c3001[_0x7999('0x2a')]['filter']+'%'};return _0x5d84bb;}})});}_0x2a6043=_[_0x7999('0x36')]({},_0x2a6043,_0x3c3001[_0x7999('0x3b')]);var _0xd0be6d={'where':_0x2a6043['where']};return db['VoiceQueueReport'][_0x7999('0x1b')](_0xd0be6d)[_0x7999('0x22')](function(_0x22ad27){_0x3df6fb[_0x7999('0x1b')]=_0x22ad27;if(_0x3c3001[_0x7999('0x2a')][_0x7999('0x3c')]){_0x2a6043[_0x7999('0x3d')]=[{'all':!![]}];}return db[_0x7999('0x27')]['findAll'](_0x2a6043);})[_0x7999('0x22')](function(_0x2a67d9){_0x3df6fb[_0x7999('0x3e')]=_0x2a67d9;return _0x3df6fb;})[_0x7999('0x22')](respondWithFilteredResult(_0xa0c84c,_0x2a6043))[_0x7999('0x3f')](handleError(_0xa0c84c,null));};exports[_0x7999('0x40')]=function(_0x2e50d1,_0x51e911){var _0x1c7041={'raw':![],'where':{'id':_0x2e50d1['params']['id']}},_0x56053d={};_0x56053d[_0x7999('0x2c')]=_[_0x7999('0x29')](db[_0x7999('0x27')][_0x7999('0x28')]);_0x56053d[_0x7999('0x2a')]=_[_0x7999('0x29')](_0x2e50d1[_0x7999('0x2a')]);_0x56053d[_0x7999('0x2b')]=_[_0x7999('0x2e')](_0x56053d[_0x7999('0x2c')],_0x56053d[_0x7999('0x2a')]);_0x1c7041[_0x7999('0x2d')]=_[_0x7999('0x2e')](_0x56053d[_0x7999('0x2c')],qs['fields'](_0x2e50d1[_0x7999('0x2a')]['fields']));_0x1c7041[_0x7999('0x2d')]=_0x1c7041[_0x7999('0x2d')][_0x7999('0x30')]?_0x1c7041[_0x7999('0x2d')]:_0x56053d['model'];if(_0x2e50d1['query'][_0x7999('0x3c')]){_0x1c7041[_0x7999('0x3d')]=[{'all':!![]}];}_0x1c7041=_[_0x7999('0x36')]({},_0x1c7041,_0x2e50d1[_0x7999('0x3b')]);return db[_0x7999('0x27')]['find'](_0x1c7041)[_0x7999('0x22')](handleEntityNotFound(_0x51e911,null))[_0x7999('0x22')](respondWithResult(_0x51e911,null))['catch'](handleError(_0x51e911,null));};exports[_0x7999('0x41')]=function(_0x514b6,_0x56e1e2){return db[_0x7999('0x27')]['create'](_0x514b6['body'],{})[_0x7999('0x22')](respondWithResult(_0x56e1e2,0xc9))[_0x7999('0x3f')](handleError(_0x56e1e2,null));};exports[_0x7999('0x42')]=function(_0x2e0865,_0x434c74){if(_0x2e0865[_0x7999('0x43')]['id']){delete _0x2e0865['body']['id'];}return db['VoiceQueueReport'][_0x7999('0x44')]({'where':{'id':_0x2e0865[_0x7999('0x45')]['id']}})[_0x7999('0x22')](handleEntityNotFound(_0x434c74,null))[_0x7999('0x22')](saveUpdates(_0x2e0865[_0x7999('0x43')],null))['then'](respondWithResult(_0x434c74,null))[_0x7999('0x3f')](handleError(_0x434c74,null));};exports[_0x7999('0x46')]=function(_0x3c9a7c,_0x5148db){return db[_0x7999('0x27')][_0x7999('0x44')]({'where':{'id':_0x3c9a7c['params']['id']}})[_0x7999('0x22')](handleEntityNotFound(_0x5148db,null))[_0x7999('0x22')](removeEntity(_0x5148db,null))[_0x7999('0x3f')](handleError(_0x5148db,null));};exports[_0x7999('0x47')]=function(_0x112468,_0x3dcb02){return db[_0x7999('0x27')][_0x7999('0x47')]()['then'](respondWithResult(_0x3dcb02,null))[_0x7999('0x3f')](handleError(_0x3dcb02,null));};exports['getVoiceQueuesReport']=function(_0x1b60f7,_0x511566){var _0x554f66={},_0x7c4c75={},_0x59c45d={'count':0x0,'rows':[]};_0x7c4c75[_0x7999('0x2c')]=_['keys'](db[_0x7999('0x27')][_0x7999('0x28')]);_0x7c4c75[_0x7999('0x2a')]=_['keys'](_0x1b60f7[_0x7999('0x2a')]);_0x7c4c75['filters']=_['intersection'](_0x7c4c75[_0x7999('0x2c')],_0x7c4c75['query']);_0x554f66[_0x7999('0x2d')]=_[_0x7999('0x2e')](_0x7c4c75[_0x7999('0x2c')],qs[_0x7999('0x2f')](_0x1b60f7[_0x7999('0x2a')]['fields']));_0x554f66[_0x7999('0x2d')]=_0x554f66['attributes'][_0x7999('0x30')]?_0x554f66['attributes']:_0x7c4c75[_0x7999('0x2c')];if(!_0x1b60f7['query'][_0x7999('0x31')](_0x7999('0x32'))){_0x554f66[_0x7999('0x1d')]=qs[_0x7999('0x1d')](_0x1b60f7[_0x7999('0x2a')][_0x7999('0x1d')]);_0x554f66[_0x7999('0x1c')]=qs[_0x7999('0x1c')](_0x1b60f7[_0x7999('0x2a')][_0x7999('0x1c')]);}_0x554f66['order']=qs['sort'](_0x1b60f7[_0x7999('0x2a')][_0x7999('0x33')]);_0x554f66[_0x7999('0x35')]=qs[_0x7999('0x2b')](_['pick'](_0x1b60f7[_0x7999('0x2a')],_0x7c4c75[_0x7999('0x2b')]));if(_0x1b60f7[_0x7999('0x2a')][_0x7999('0x48')]){_0x554f66[_0x7999('0x35')]=_[_0x7999('0x36')](_0x554f66[_0x7999('0x35')],{'$or':_[_0x7999('0x37')](_0x554f66['attributes'],function(_0x5a25bd){var _0x1ce2b3={};_0x1ce2b3[_0x5a25bd]={'$like':'%'+_0x1b60f7[_0x7999('0x2a')][_0x7999('0x48')]+'%'};return _0x1ce2b3;})});}_0x554f66=_['merge']({},_0x554f66,_0x1b60f7[_0x7999('0x3b')]);var _0x591f73={'where':_0x554f66[_0x7999('0x35')]};return db[_0x7999('0x27')]['count'](_0x591f73)[_0x7999('0x22')](function(_0x3f0b14){_0x59c45d[_0x7999('0x1b')]=_0x3f0b14;if(_0x1b60f7[_0x7999('0x2a')][_0x7999('0x3c')]){_0x554f66[_0x7999('0x3d')]=[{'all':!![]}];}return db[_0x7999('0x27')]['findAll'](_0x554f66);})[_0x7999('0x22')](function(_0x5d61f8){_0x59c45d['rows']=_0x5d61f8;return _0x59c45d;})['then'](respondWithFilteredResult(_0x511566,_0x554f66,_0x7999('0x49')))[_0x7999('0x3f')](handleError(_0x511566,null,_0x7999('0x49')));}; \ No newline at end of file +var _0xc606=['to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','status','json','count','offset','set','reject','then','destroy','sendStatus','error','stack','name','index','model','keys','query','filters','fields','attributes','length','nolimit','limit','sort','filter','where','map','key','VIRTUAL','merge','includeAll','include','VoiceQueueReport','findAll','rows','catch','show','params','rawAttributes','intersection','options','find','create','body','update','describe','getVoiceQueuesReport','order','pick','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x36a330,_0x146fc6){var _0x57a01e=function(_0x102d6f){while(--_0x102d6f){_0x36a330['push'](_0x36a330['shift']());}};_0x57a01e(++_0x146fc6);}(_0xc606,0x17c));var _0x6c60=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0xc606[_0x4b2863];return _0x567d67;};'use strict';var pdf=require(_0x6c60('0x0'));var emlformat=require(_0x6c60('0x1'));var rimraf=require(_0x6c60('0x2'));var zipdir=require(_0x6c60('0x3'));var jsonpatch=require(_0x6c60('0x4'));var rp=require(_0x6c60('0x5'));var moment=require(_0x6c60('0x6'));var BPromise=require(_0x6c60('0x7'));var Mustache=require(_0x6c60('0x8'));var util=require(_0x6c60('0x9'));var path=require('path');var sox=require('sox');var csv=require(_0x6c60('0xa'));var ejs=require(_0x6c60('0xb'));var fs=require('fs');var _=require(_0x6c60('0xc'));var squel=require('squel');var crypto=require(_0x6c60('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6c60('0xe'));var toCsv=require(_0x6c60('0xa'));var querystring=require('querystring');var Papa=require(_0x6c60('0xf'));var Redis=require(_0x6c60('0x10'));var authService=require(_0x6c60('0x11'));var qs=require(_0x6c60('0x12'));var hardwareService=require(_0x6c60('0x13'));var logger=require(_0x6c60('0x14'))(_0x6c60('0x15'));var utils=require(_0x6c60('0x16'));var config=require(_0x6c60('0x17'));var db=require(_0x6c60('0x18'))['db'];config[_0x6c60('0x19')]=_[_0x6c60('0x1a')](config[_0x6c60('0x19')],{'host':_0x6c60('0x1b'),'port':0x18eb});var socket=require(_0x6c60('0x1c'))(new Redis(config['redis']));require(_0x6c60('0x1d'))['register'](socket);function respondWithStatusCode(_0x55c463,_0x1de91a){_0x1de91a=_0x1de91a||0xcc;return function(_0x49ab5b){if(_0x49ab5b){return _0x55c463['sendStatus'](_0x1de91a);}return _0x55c463[_0x6c60('0x1e')](_0x1de91a)['end']();};}function respondWithResult(_0x3f62a3,_0x54e6bf){_0x54e6bf=_0x54e6bf||0xc8;return function(_0x5b7b20){if(_0x5b7b20){return _0x3f62a3[_0x6c60('0x1e')](_0x54e6bf)[_0x6c60('0x1f')](_0x5b7b20);}};}function respondWithFilteredResult(_0x388793,_0x1d2386){return function(_0x334540){if(_0x334540){var _0x4b2a0d=_0x334540[_0x6c60('0x20')],_0x4450f0=_0x1d2386['offset'],_0x21ff22=_0x1d2386[_0x6c60('0x21')]+_0x1d2386['limit'],_0x3326ce;if(_0x21ff22>=_0x4b2a0d){_0x21ff22=_0x4b2a0d;_0x3326ce=0xc8;}else{_0x3326ce=0xce;}_0x388793[_0x6c60('0x1e')](_0x3326ce);return _0x388793[_0x6c60('0x22')]('Content-Range',_0x4450f0+'-'+_0x21ff22+'/'+_0x4b2a0d)[_0x6c60('0x1f')](_0x334540);}return null;};}function patchUpdates(_0x112c4d){return function(_0xeb4a43){try{jsonpatch['apply'](_0xeb4a43,_0x112c4d,!![]);}catch(_0x37c366){return BPromise[_0x6c60('0x23')](_0x37c366);}return _0xeb4a43['save']();};}function saveUpdates(_0x27b374,_0x55d26d){return function(_0x14062a){if(_0x14062a){return _0x14062a['update'](_0x27b374)[_0x6c60('0x24')](function(_0x577399){return _0x577399;});}return null;};}function removeEntity(_0x1fc44e,_0x2a345c){return function(_0x37a17a){if(_0x37a17a){return _0x37a17a[_0x6c60('0x25')]()[_0x6c60('0x24')](function(){_0x1fc44e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x258c1d,_0x5f0362){return function(_0x38b6dd){if(!_0x38b6dd){_0x258c1d[_0x6c60('0x26')](0x194);}return _0x38b6dd;};}function handleError(_0x7cf4c4,_0x316bf2){_0x316bf2=_0x316bf2||0x1f4;return function(_0x3be0b7){logger[_0x6c60('0x27')](_0x3be0b7[_0x6c60('0x28')]);if(_0x3be0b7[_0x6c60('0x29')]){delete _0x3be0b7['name'];}_0x7cf4c4[_0x6c60('0x1e')](_0x316bf2)['send'](_0x3be0b7);};}exports[_0x6c60('0x2a')]=function(_0x3412fc,_0x21f454){var _0xdd0b81={},_0x5c9579={},_0x334f57={'count':0x0,'rows':[]};var _0x38f0a1=db['VoiceQueueReport']['rawAttributes'];_0x5c9579[_0x6c60('0x2b')]=_[_0x6c60('0x2c')](_0x38f0a1);_0x5c9579['query']=_['keys'](_0x3412fc[_0x6c60('0x2d')]);_0x5c9579[_0x6c60('0x2e')]=_['intersection'](_0x5c9579[_0x6c60('0x2b')],_0x5c9579[_0x6c60('0x2d')]);_0xdd0b81['attributes']=_['intersection'](_0x5c9579['model'],qs['fields'](_0x3412fc[_0x6c60('0x2d')][_0x6c60('0x2f')]));_0xdd0b81['attributes']=_0xdd0b81[_0x6c60('0x30')][_0x6c60('0x31')]?_0xdd0b81[_0x6c60('0x30')]:_0x5c9579['model'];if(!_0x3412fc[_0x6c60('0x2d')]['hasOwnProperty'](_0x6c60('0x32'))){_0xdd0b81[_0x6c60('0x33')]=qs[_0x6c60('0x33')](_0x3412fc[_0x6c60('0x2d')][_0x6c60('0x33')]);_0xdd0b81[_0x6c60('0x21')]=qs[_0x6c60('0x21')](_0x3412fc[_0x6c60('0x2d')][_0x6c60('0x21')]);}_0xdd0b81['order']=qs[_0x6c60('0x34')](_0x3412fc[_0x6c60('0x2d')][_0x6c60('0x34')]);_0xdd0b81['where']=qs[_0x6c60('0x2e')](_['pick'](_0x3412fc[_0x6c60('0x2d')],_0x5c9579['filters']));if(_0x3412fc[_0x6c60('0x2d')][_0x6c60('0x35')]){_0xdd0b81[_0x6c60('0x36')]=_['merge'](_0xdd0b81[_0x6c60('0x36')],{'$or':_[_0x6c60('0x37')](_0x38f0a1,function(_0x3764f6){if(_0x3764f6['type'][_0x6c60('0x38')]!==_0x6c60('0x39')){var _0x1474b1={};_0x1474b1[_0x3764f6['field']]={'$like':'%'+_0x3412fc[_0x6c60('0x2d')][_0x6c60('0x35')]+'%'};return _0x1474b1;}})});}_0xdd0b81=_[_0x6c60('0x3a')]({},_0xdd0b81,_0x3412fc['options']);var _0x255053={'where':_0xdd0b81['where']};return db['VoiceQueueReport']['count'](_0x255053)[_0x6c60('0x24')](function(_0x5aff75){_0x334f57[_0x6c60('0x20')]=_0x5aff75;if(_0x3412fc[_0x6c60('0x2d')][_0x6c60('0x3b')]){_0xdd0b81[_0x6c60('0x3c')]=[{'all':!![]}];}return db[_0x6c60('0x3d')][_0x6c60('0x3e')](_0xdd0b81);})[_0x6c60('0x24')](function(_0x488ce1){_0x334f57[_0x6c60('0x3f')]=_0x488ce1;return _0x334f57;})[_0x6c60('0x24')](respondWithFilteredResult(_0x21f454,_0xdd0b81))[_0x6c60('0x40')](handleError(_0x21f454,null));};exports[_0x6c60('0x41')]=function(_0x283021,_0x45be63){var _0x22aab0={'raw':![],'where':{'id':_0x283021[_0x6c60('0x42')]['id']}},_0x2e4dd1={};_0x2e4dd1[_0x6c60('0x2b')]=_['keys'](db[_0x6c60('0x3d')][_0x6c60('0x43')]);_0x2e4dd1[_0x6c60('0x2d')]=_['keys'](_0x283021[_0x6c60('0x2d')]);_0x2e4dd1[_0x6c60('0x2e')]=_[_0x6c60('0x44')](_0x2e4dd1[_0x6c60('0x2b')],_0x2e4dd1[_0x6c60('0x2d')]);_0x22aab0[_0x6c60('0x30')]=_['intersection'](_0x2e4dd1[_0x6c60('0x2b')],qs[_0x6c60('0x2f')](_0x283021[_0x6c60('0x2d')][_0x6c60('0x2f')]));_0x22aab0['attributes']=_0x22aab0[_0x6c60('0x30')]['length']?_0x22aab0[_0x6c60('0x30')]:_0x2e4dd1[_0x6c60('0x2b')];if(_0x283021[_0x6c60('0x2d')][_0x6c60('0x3b')]){_0x22aab0[_0x6c60('0x3c')]=[{'all':!![]}];}_0x22aab0=_[_0x6c60('0x3a')]({},_0x22aab0,_0x283021[_0x6c60('0x45')]);return db[_0x6c60('0x3d')][_0x6c60('0x46')](_0x22aab0)['then'](handleEntityNotFound(_0x45be63,null))[_0x6c60('0x24')](respondWithResult(_0x45be63,null))[_0x6c60('0x40')](handleError(_0x45be63,null));};exports[_0x6c60('0x47')]=function(_0x46b363,_0x520ecb){return db['VoiceQueueReport'][_0x6c60('0x47')](_0x46b363[_0x6c60('0x48')],{})[_0x6c60('0x24')](respondWithResult(_0x520ecb,0xc9))[_0x6c60('0x40')](handleError(_0x520ecb,null));};exports[_0x6c60('0x49')]=function(_0x10440c,_0x1a94b2){if(_0x10440c[_0x6c60('0x48')]['id']){delete _0x10440c[_0x6c60('0x48')]['id'];}return db[_0x6c60('0x3d')][_0x6c60('0x46')]({'where':{'id':_0x10440c[_0x6c60('0x42')]['id']}})['then'](handleEntityNotFound(_0x1a94b2,null))['then'](saveUpdates(_0x10440c[_0x6c60('0x48')],null))['then'](respondWithResult(_0x1a94b2,null))[_0x6c60('0x40')](handleError(_0x1a94b2,null));};exports[_0x6c60('0x25')]=function(_0x1546bb,_0x8aba5){return db[_0x6c60('0x3d')]['find']({'where':{'id':_0x1546bb[_0x6c60('0x42')]['id']}})[_0x6c60('0x24')](handleEntityNotFound(_0x8aba5,null))[_0x6c60('0x24')](removeEntity(_0x8aba5,null))[_0x6c60('0x40')](handleError(_0x8aba5,null));};exports[_0x6c60('0x4a')]=function(_0x564419,_0x754669){return db['VoiceQueueReport'][_0x6c60('0x4a')]()[_0x6c60('0x24')](respondWithResult(_0x754669,null))['catch'](handleError(_0x754669,null));};exports[_0x6c60('0x4b')]=function(_0x2f0517,_0x5d741e){var _0xa88b17={},_0xb168fe={},_0x43152e={'count':0x0,'rows':[]};_0xb168fe[_0x6c60('0x2b')]=_[_0x6c60('0x2c')](db[_0x6c60('0x3d')][_0x6c60('0x43')]);_0xb168fe[_0x6c60('0x2d')]=_[_0x6c60('0x2c')](_0x2f0517[_0x6c60('0x2d')]);_0xb168fe[_0x6c60('0x2e')]=_[_0x6c60('0x44')](_0xb168fe['model'],_0xb168fe[_0x6c60('0x2d')]);_0xa88b17['attributes']=_[_0x6c60('0x44')](_0xb168fe[_0x6c60('0x2b')],qs[_0x6c60('0x2f')](_0x2f0517[_0x6c60('0x2d')]['fields']));_0xa88b17[_0x6c60('0x30')]=_0xa88b17['attributes']['length']?_0xa88b17[_0x6c60('0x30')]:_0xb168fe[_0x6c60('0x2b')];if(!_0x2f0517['query']['hasOwnProperty'](_0x6c60('0x32'))){_0xa88b17[_0x6c60('0x33')]=qs[_0x6c60('0x33')](_0x2f0517[_0x6c60('0x2d')][_0x6c60('0x33')]);_0xa88b17['offset']=qs[_0x6c60('0x21')](_0x2f0517[_0x6c60('0x2d')][_0x6c60('0x21')]);}_0xa88b17[_0x6c60('0x4c')]=qs[_0x6c60('0x34')](_0x2f0517[_0x6c60('0x2d')]['sort']);_0xa88b17[_0x6c60('0x36')]=qs['filters'](_[_0x6c60('0x4d')](_0x2f0517[_0x6c60('0x2d')],_0xb168fe[_0x6c60('0x2e')]));if(_0x2f0517['query'][_0x6c60('0x35')]){_0xa88b17[_0x6c60('0x36')]=_[_0x6c60('0x3a')](_0xa88b17[_0x6c60('0x36')],{'$or':_['map'](_0xa88b17[_0x6c60('0x30')],function(_0x3a363f){var _0x3ae986={};_0x3ae986[_0x3a363f]={'$like':'%'+_0x2f0517['query'][_0x6c60('0x35')]+'%'};return _0x3ae986;})});}_0xa88b17=_[_0x6c60('0x3a')]({},_0xa88b17,_0x2f0517[_0x6c60('0x45')]);var _0x3591f0={'where':_0xa88b17[_0x6c60('0x36')]};return db[_0x6c60('0x3d')]['count'](_0x3591f0)[_0x6c60('0x24')](function(_0x1b81a8){_0x43152e[_0x6c60('0x20')]=_0x1b81a8;if(_0x2f0517[_0x6c60('0x2d')][_0x6c60('0x3b')]){_0xa88b17['include']=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0xa88b17);})['then'](function(_0x5391a){_0x43152e[_0x6c60('0x3f')]=_0x5391a;return _0x43152e;})[_0x6c60('0x24')](respondWithFilteredResult(_0x5d741e,_0xa88b17,_0x6c60('0x4b')))['catch'](handleError(_0x5d741e,null,'getVoiceQueuesReport'));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 6b575b8..d8ebc55 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 _0xdded=['../../mysqldb','VoiceQueueReport','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x37862a,_0x2bc98e){var _0x5b0104=function(_0x391413){while(--_0x391413){_0x37862a['push'](_0x37862a['shift']());}};_0x5b0104(++_0x2bc98e);}(_0xdded,0x1a0));var _0xddde=function(_0x991ed7,_0x37842f){_0x991ed7=_0x991ed7-0x0;var _0x17f6f7=_0xdded[_0x991ed7];return _0x17f6f7;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0xddde('0x0'))['db'][_0xddde('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xddde('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xddde('0x3'),'afterDestroy':_0xddde('0x4')};function emitEvent(_0x246b1b){return function(_0xdadc92,_0x14697c,_0x515205){VoiceQueueReportEvents[_0xddde('0x5')](_0x246b1b+':'+_0xdadc92['id'],_0xdadc92);VoiceQueueReportEvents[_0xddde('0x5')](_0x246b1b,_0xdadc92);_0x515205(null);};}for(var e in events){if(events[_0xddde('0x6')](e)){var event=events[e];VoiceQueueReport[_0xddde('0x7')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file +var _0x7d28=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','update'];(function(_0x3efd04,_0x3af2fd){var _0x160278=function(_0x51e7a1){while(--_0x51e7a1){_0x3efd04['push'](_0x3efd04['shift']());}};_0x160278(++_0x3af2fd);}(_0x7d28,0x112));var _0x87d2=function(_0x5c9269,_0x375f47){_0x5c9269=_0x5c9269-0x0;var _0x1a9ffb=_0x7d28[_0x5c9269];return _0x1a9ffb;};'use strict';var EventEmitter=require(_0x87d2('0x0'));var VoiceQueueReport=require(_0x87d2('0x1'))['db'][_0x87d2('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x87d2('0x3')](0x0);var events={'afterCreate':_0x87d2('0x4'),'afterUpdate':_0x87d2('0x5'),'afterDestroy':'remove'};function emitEvent(_0x12bc59){return function(_0x4f436f,_0x4ba6cd,_0x2d45da){VoiceQueueReportEvents['emit'](_0x12bc59+':'+_0x4f436f['id'],_0x4f436f);VoiceQueueReportEvents[_0x87d2('0x6')](_0x12bc59,_0x4f436f);_0x2d45da(null);};}for(var e in events){if(events[_0x87d2('0x7')](e)){var event=events[e];VoiceQueueReport[_0x87d2('0x8')](e,emitEvent(event));}}module[_0x87d2('0x9')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 6d6aa39..5a0b94e 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 _0xa683=['bluebird','request-promise','rimraf','./voiceQueueReport.attributes','define','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger','api','moment'];(function(_0x3aeda3,_0x2f2fb5){var _0xd0fc72=function(_0x36f541){while(--_0x36f541){_0x3aeda3['push'](_0x3aeda3['shift']());}};_0xd0fc72(++_0x2f2fb5);}(_0xa683,0x1c2));var _0x3a68=function(_0xc9b51f,_0x7cb33a){_0xc9b51f=_0xc9b51f-0x0;var _0x3ef25e=_0xa683[_0xc9b51f];return _0x3ef25e;};'use strict';var _=require(_0x3a68('0x0'));var util=require(_0x3a68('0x1'));var logger=require(_0x3a68('0x2'))(_0x3a68('0x3'));var moment=require(_0x3a68('0x4'));var BPromise=require(_0x3a68('0x5'));var rp=require(_0x3a68('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3a68('0x7'));var config=require('../../config/environment');var attributes=require(_0x3a68('0x8'));module['exports']=function(_0x5e7baa,_0x54780f){return _0x5e7baa[_0x3a68('0x9')]('VoiceQueueReport',attributes,{'tableName':_0x3a68('0xa'),'paranoid':![],'indexes':[{'fields':[_0x3a68('0xb')]},{'fields':[_0x3a68('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2206=['../../config/logger','api','bluebird','request-promise','path','rimraf','exports','define','VoiceQueueReport','report_queue','uniqueid','lodash','util'];(function(_0x34bc33,_0x13cf5a){var _0x5a62b4=function(_0x4fd58d){while(--_0x4fd58d){_0x34bc33['push'](_0x34bc33['shift']());}};_0x5a62b4(++_0x13cf5a);}(_0x2206,0xb4));var _0x6220=function(_0x23a5ba,_0x15eeba){_0x23a5ba=_0x23a5ba-0x0;var _0x3b1ba9=_0x2206[_0x23a5ba];return _0x3b1ba9;};'use strict';var _=require(_0x6220('0x0'));var util=require(_0x6220('0x1'));var logger=require(_0x6220('0x2'))(_0x6220('0x3'));var moment=require('moment');var BPromise=require(_0x6220('0x4'));var rp=require(_0x6220('0x5'));var fs=require('fs');var path=require(_0x6220('0x6'));var rimraf=require(_0x6220('0x7'));var config=require('../../config/environment');var attributes=require('./voiceQueueReport.attributes');module[_0x6220('0x8')]=function(_0x91d8f,_0x1ba3f3){return _0x91d8f[_0x6220('0x9')](_0x6220('0xa'),attributes,{'tableName':_0x6220('0xb'),'paranoid':![],'indexes':[{'fields':[_0x6220('0xc')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 491a344..f1c7b27 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 _0x40f1=['code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','where','attributes','limit','include','model','map','then','stringify','body','raw','CreateVoiceQueueReport','UpdateVoiceQueueReport','update','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','request','info','VoiceQueueReport,\x20%s,\x20%s','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x5d71ba,_0x3385fd){var _0x107e21=function(_0x1ce2e5){while(--_0x1ce2e5){_0x5d71ba['push'](_0x5d71ba['shift']());}};_0x107e21(++_0x3385fd);}(_0x40f1,0x99));var _0x140f=function(_0x3b290b,_0x529947){_0x3b290b=_0x3b290b-0x0;var _0x1b992e=_0x40f1[_0x3b290b];return _0x1b992e;};'use strict';var _=require(_0x140f('0x0'));var util=require(_0x140f('0x1'));var moment=require(_0x140f('0x2'));var BPromise=require(_0x140f('0x3'));var rs=require(_0x140f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x140f('0x5'))['db'];var utils=require(_0x140f('0x6'));var logger=require(_0x140f('0x7'))('rpc');var config=require(_0x140f('0x8'));var jayson=require(_0x140f('0x9'));var client=jayson['client'][_0x140f('0xa')]({'port':0x232a});config[_0x140f('0xb')]=_[_0x140f('0xc')](config[_0x140f('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x140f('0xd'))(new Redis(config[_0x140f('0xb')]));require(_0x140f('0xe'))[_0x140f('0xf')](socket);function respondWithRpcPromise(_0xea65b8,_0x4fcd18,_0x42a034){return new BPromise(function(_0x149fcc,_0x3b465f){return client[_0x140f('0x10')](_0xea65b8,_0x42a034)['then'](function(_0x48a203){logger[_0x140f('0x11')](_0x140f('0x12'),_0x4fcd18,'request\x20sent');logger[_0x140f('0x13')](_0x140f('0x14'),_0x4fcd18,_0x140f('0x15'),JSON['stringify'](_0x48a203));if(_0x48a203[_0x140f('0x16')]){if(_0x48a203[_0x140f('0x16')][_0x140f('0x17')]===0x1f4){logger[_0x140f('0x16')](_0x140f('0x12'),_0x4fcd18,_0x48a203[_0x140f('0x16')][_0x140f('0x18')]);return _0x3b465f(_0x48a203[_0x140f('0x16')]['message']);}logger[_0x140f('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0x4fcd18,_0x48a203[_0x140f('0x16')][_0x140f('0x18')]);return _0x149fcc(_0x48a203['error'][_0x140f('0x18')]);}else{logger[_0x140f('0x11')](_0x140f('0x12'),_0x4fcd18,'request\x20sent');_0x149fcc(_0x48a203[_0x140f('0x19')][_0x140f('0x18')]);}})[_0x140f('0x1a')](function(_0x787c7a){logger[_0x140f('0x16')](_0x140f('0x12'),_0x4fcd18,_0x787c7a);_0x3b465f(_0x787c7a);});});}exports[_0x140f('0x1b')]=function(_0x15bdc3){var _0x266ef4=this;return new Promise(function(_0x13676a,_0x3de6a3){return db[_0x140f('0x1c')][_0x140f('0x1d')]({'raw':_0x15bdc3[_0x140f('0x1e')]?_0x15bdc3[_0x140f('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x15bdc3['options']?_0x15bdc3['options'][_0x140f('0x1f')]||null:null,'attributes':_0x15bdc3[_0x140f('0x1e')]?_0x15bdc3[_0x140f('0x1e')][_0x140f('0x20')]||null:null,'limit':_0x15bdc3[_0x140f('0x1e')]?_0x15bdc3[_0x140f('0x1e')][_0x140f('0x21')]||null:null,'include':_0x15bdc3[_0x140f('0x1e')]?_0x15bdc3[_0x140f('0x1e')][_0x140f('0x22')]?_['map'](_0x15bdc3['options']['include'],function(_0x281ee5){return{'model':db[_0x281ee5[_0x140f('0x23')]],'as':_0x281ee5['as'],'attributes':_0x281ee5[_0x140f('0x20')],'include':_0x281ee5[_0x140f('0x22')]?_['map'](_0x281ee5['include'],function(_0x1a42d1){return{'model':db[_0x1a42d1['model']],'as':_0x1a42d1['as'],'attributes':_0x1a42d1[_0x140f('0x20')],'include':_0x1a42d1[_0x140f('0x22')]?_[_0x140f('0x24')](_0x1a42d1[_0x140f('0x22')],function(_0x1f5a9d){return{'model':db[_0x1f5a9d[_0x140f('0x23')]],'as':_0x1f5a9d['as'],'attributes':_0x1f5a9d[_0x140f('0x20')]};}):[]};}):[]};}):[]:[]})[_0x140f('0x25')](function(_0x4d4bac){logger[_0x140f('0x11')](_0x140f('0x1b'),_0x15bdc3);logger['debug'](_0x140f('0x1b'),_0x15bdc3,JSON[_0x140f('0x26')](_0x4d4bac));_0x13676a(_0x4d4bac);})[_0x140f('0x1a')](function(_0x26fd55){logger[_0x140f('0x16')](_0x140f('0x1b'),_0x26fd55['message'],_0x15bdc3);_0x3de6a3(_0x266ef4[_0x140f('0x16')](0x1f4,_0x26fd55[_0x140f('0x18')]));});});};exports['CreateVoiceQueueReport']=function(_0x5178ff){var _0x1b894c=this;return new Promise(function(_0x468908,_0x211b50){return db[_0x140f('0x1c')]['create'](_0x5178ff[_0x140f('0x27')],{'raw':_0x5178ff[_0x140f('0x1e')]?_0x5178ff[_0x140f('0x1e')][_0x140f('0x28')]===undefined?!![]:![]:!![]})[_0x140f('0x25')](function(_0x2ae4ec){logger[_0x140f('0x11')]('CreateVoiceQueueReport',_0x5178ff);logger[_0x140f('0x13')](_0x140f('0x29'),_0x5178ff,JSON[_0x140f('0x26')](_0x2ae4ec));_0x468908(_0x2ae4ec);})[_0x140f('0x1a')](function(_0x20a79e){logger[_0x140f('0x16')]('CreateVoiceQueueReport',_0x20a79e['message'],_0x5178ff);_0x211b50(_0x1b894c[_0x140f('0x16')](0x1f4,_0x20a79e[_0x140f('0x18')]));});});};exports[_0x140f('0x2a')]=function(_0x3c9ae8){var _0x17d9da=this;return new Promise(function(_0x5ef162,_0x3271de){return db['VoiceQueueReport'][_0x140f('0x2b')](_0x3c9ae8['body'],{'raw':_0x3c9ae8[_0x140f('0x1e')]?_0x3c9ae8[_0x140f('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c9ae8[_0x140f('0x1e')]?_0x3c9ae8[_0x140f('0x1e')][_0x140f('0x1f')]||null:null,'attributes':_0x3c9ae8['options']?_0x3c9ae8[_0x140f('0x1e')][_0x140f('0x20')]||null:null,'limit':_0x3c9ae8[_0x140f('0x1e')]?_0x3c9ae8['options'][_0x140f('0x21')]||null:null})['then'](function(_0x25190a){logger['info'](_0x140f('0x2a'),_0x3c9ae8);logger[_0x140f('0x13')]('UpdateVoiceQueueReport',_0x3c9ae8,JSON[_0x140f('0x26')](_0x25190a));_0x5ef162(_0x25190a);})[_0x140f('0x1a')](function(_0x335606){logger[_0x140f('0x16')](_0x140f('0x2a'),_0x335606[_0x140f('0x18')],_0x3c9ae8);_0x3271de(_0x17d9da['error'](0x1f4,_0x335606['message']));});});}; \ No newline at end of file +var _0x3d7b=['VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','include','map','model','stringify','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','lodash','util','moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','request','then','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xd511d,_0x3546b9){var _0x3f148e=function(_0x51f35f){while(--_0x51f35f){_0xd511d['push'](_0xd511d['shift']());}};_0x3f148e(++_0x3546b9);}(_0x3d7b,0x8d));var _0xb3d7=function(_0x31a51b,_0x4775e8){_0x31a51b=_0x31a51b-0x0;var _0x38d5d8=_0x3d7b[_0x31a51b];return _0x38d5d8;};'use strict';var _=require(_0xb3d7('0x0'));var util=require(_0xb3d7('0x1'));var moment=require(_0xb3d7('0x2'));var BPromise=require('bluebird');var rs=require(_0xb3d7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb3d7('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb3d7('0x5'));var config=require(_0xb3d7('0x6'));var jayson=require(_0xb3d7('0x7'));var client=jayson['client'][_0xb3d7('0x8')]({'port':0x232a});config[_0xb3d7('0x9')]=_[_0xb3d7('0xa')](config[_0xb3d7('0x9')],{'host':_0xb3d7('0xb'),'port':0x18eb});var socket=require(_0xb3d7('0xc'))(new Redis(config[_0xb3d7('0x9')]));require(_0xb3d7('0xd'))['register'](socket);function respondWithRpcPromise(_0x2e7403,_0x436c9a,_0x3dd906){return new BPromise(function(_0x4be84e,_0x46af07){return client[_0xb3d7('0xe')](_0x2e7403,_0x3dd906)[_0xb3d7('0xf')](function(_0x3cd2db){logger['info'](_0xb3d7('0x10'),_0x436c9a,_0xb3d7('0x11'));logger[_0xb3d7('0x12')](_0xb3d7('0x13'),_0x436c9a,_0xb3d7('0x11'),JSON['stringify'](_0x3cd2db));if(_0x3cd2db[_0xb3d7('0x14')]){if(_0x3cd2db['error']['code']===0x1f4){logger[_0xb3d7('0x14')](_0xb3d7('0x10'),_0x436c9a,_0x3cd2db[_0xb3d7('0x14')]['message']);return _0x46af07(_0x3cd2db['error'][_0xb3d7('0x15')]);}logger[_0xb3d7('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x436c9a,_0x3cd2db[_0xb3d7('0x14')][_0xb3d7('0x15')]);return _0x4be84e(_0x3cd2db[_0xb3d7('0x14')][_0xb3d7('0x15')]);}else{logger[_0xb3d7('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0x436c9a,'request\x20sent');_0x4be84e(_0x3cd2db[_0xb3d7('0x17')][_0xb3d7('0x15')]);}})[_0xb3d7('0x18')](function(_0x32dfc6){logger[_0xb3d7('0x14')](_0xb3d7('0x10'),_0x436c9a,_0x32dfc6);_0x46af07(_0x32dfc6);});});}exports[_0xb3d7('0x19')]=function(_0x2cb278){var _0x5d7289=this;return new Promise(function(_0x5564ee,_0x5397e9){return db[_0xb3d7('0x1a')][_0xb3d7('0x1b')]({'raw':_0x2cb278[_0xb3d7('0x1c')]?_0x2cb278[_0xb3d7('0x1c')][_0xb3d7('0x1d')]===undefined?!![]:![]:!![],'where':_0x2cb278[_0xb3d7('0x1c')]?_0x2cb278['options'][_0xb3d7('0x1e')]||null:null,'attributes':_0x2cb278[_0xb3d7('0x1c')]?_0x2cb278[_0xb3d7('0x1c')][_0xb3d7('0x1f')]||null:null,'limit':_0x2cb278[_0xb3d7('0x1c')]?_0x2cb278[_0xb3d7('0x1c')]['limit']||null:null,'include':_0x2cb278[_0xb3d7('0x1c')]?_0x2cb278[_0xb3d7('0x1c')][_0xb3d7('0x20')]?_[_0xb3d7('0x21')](_0x2cb278[_0xb3d7('0x1c')][_0xb3d7('0x20')],function(_0x5a7046){return{'model':db[_0x5a7046[_0xb3d7('0x22')]],'as':_0x5a7046['as'],'attributes':_0x5a7046[_0xb3d7('0x1f')],'include':_0x5a7046[_0xb3d7('0x20')]?_[_0xb3d7('0x21')](_0x5a7046['include'],function(_0x30f205){return{'model':db[_0x30f205[_0xb3d7('0x22')]],'as':_0x30f205['as'],'attributes':_0x30f205[_0xb3d7('0x1f')],'include':_0x30f205[_0xb3d7('0x20')]?_[_0xb3d7('0x21')](_0x30f205['include'],function(_0x4b62aa){return{'model':db[_0x4b62aa[_0xb3d7('0x22')]],'as':_0x4b62aa['as'],'attributes':_0x4b62aa[_0xb3d7('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb3d7('0xf')](function(_0x3de360){logger[_0xb3d7('0x16')]('GetVoiceQueueReport',_0x2cb278);logger['debug'](_0xb3d7('0x19'),_0x2cb278,JSON[_0xb3d7('0x23')](_0x3de360));_0x5564ee(_0x3de360);})[_0xb3d7('0x18')](function(_0x4dc164){logger['error'](_0xb3d7('0x19'),_0x4dc164[_0xb3d7('0x15')],_0x2cb278);_0x5397e9(_0x5d7289[_0xb3d7('0x14')](0x1f4,_0x4dc164[_0xb3d7('0x15')]));});});};exports[_0xb3d7('0x24')]=function(_0x3267f6){var _0x185fe5=this;return new Promise(function(_0x4b7993,_0x1a0674){return db[_0xb3d7('0x1a')][_0xb3d7('0x25')](_0x3267f6[_0xb3d7('0x26')],{'raw':_0x3267f6[_0xb3d7('0x1c')]?_0x3267f6[_0xb3d7('0x1c')][_0xb3d7('0x1d')]===undefined?!![]:![]:!![]})[_0xb3d7('0xf')](function(_0x39dce2){logger['info'](_0xb3d7('0x24'),_0x3267f6);logger[_0xb3d7('0x12')](_0xb3d7('0x24'),_0x3267f6,JSON['stringify'](_0x39dce2));_0x4b7993(_0x39dce2);})[_0xb3d7('0x18')](function(_0x5c2a0b){logger[_0xb3d7('0x14')](_0xb3d7('0x24'),_0x5c2a0b[_0xb3d7('0x15')],_0x3267f6);_0x1a0674(_0x185fe5['error'](0x1f4,_0x5c2a0b[_0xb3d7('0x15')]));});});};exports[_0xb3d7('0x27')]=function(_0x3222b0){var _0x5aa83a=this;return new Promise(function(_0x2d560c,_0x320f1e){return db[_0xb3d7('0x1a')]['update'](_0x3222b0[_0xb3d7('0x26')],{'raw':_0x3222b0[_0xb3d7('0x1c')]?_0x3222b0[_0xb3d7('0x1c')][_0xb3d7('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3222b0[_0xb3d7('0x1c')]?_0x3222b0['options'][_0xb3d7('0x1e')]||null:null,'attributes':_0x3222b0[_0xb3d7('0x1c')]?_0x3222b0[_0xb3d7('0x1c')]['attributes']||null:null,'limit':_0x3222b0[_0xb3d7('0x1c')]?_0x3222b0['options']['limit']||null:null})['then'](function(_0x185301){logger[_0xb3d7('0x16')]('UpdateVoiceQueueReport',_0x3222b0);logger[_0xb3d7('0x12')](_0xb3d7('0x27'),_0x3222b0,JSON[_0xb3d7('0x23')](_0x185301));_0x2d560c(_0x185301);})['catch'](function(_0xdb51ec){logger[_0xb3d7('0x14')](_0xb3d7('0x27'),_0xdb51ec[_0xb3d7('0x15')],_0x3222b0);_0x320f1e(_0x5aa83a[_0xb3d7('0x14')](0x1f4,_0xdb51ec[_0xb3d7('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 9a0c524..7bbcbce 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 _0x2ab3=['emit','removeListener','length','voiceQueueReport:','./voiceQueueReport.events','save','update'];(function(_0x5b6da2,_0x326ba3){var _0x2dd112=function(_0x5972e7){while(--_0x5972e7){_0x5b6da2['push'](_0x5b6da2['shift']());}};_0x2dd112(++_0x326ba3);}(_0x2ab3,0x162));var _0x32ab=function(_0x513047,_0x2199c5){_0x513047=_0x513047-0x0;var _0x15b779=_0x2ab3[_0x513047];return _0x15b779;};'use strict';var VoiceQueueReportEvents=require(_0x32ab('0x0'));var events=[_0x32ab('0x1'),'remove',_0x32ab('0x2')];function createListener(_0x311d7f,_0x5a1b9a){return function(_0x55c51d){_0x5a1b9a[_0x32ab('0x3')](_0x311d7f,_0x55c51d);};}function removeListener(_0x38b4e0,_0x40ef15){return function(){VoiceQueueReportEvents[_0x32ab('0x4')](_0x38b4e0,_0x40ef15);};}exports['register']=function(_0xce9968){for(var _0x166335=0x0,_0x120976=events[_0x32ab('0x5')];_0x166335<_0x120976;_0x166335++){var _0x195824=events[_0x166335];var _0x23bd19=createListener(_0x32ab('0x6')+_0x195824,_0xce9968);VoiceQueueReportEvents['on'](_0x195824,_0x23bd19);}}; \ No newline at end of file +var _0x8292=['length','voiceQueueReport:','save','remove','emit','register'];(function(_0x45ce30,_0x2b5ec7){var _0x2eeafb=function(_0x3faf9d){while(--_0x3faf9d){_0x45ce30['push'](_0x45ce30['shift']());}};_0x2eeafb(++_0x2b5ec7);}(_0x8292,0x14c));var _0x2829=function(_0x25ab51,_0x4f84f5){_0x25ab51=_0x25ab51-0x0;var _0x3b4aa0=_0x8292[_0x25ab51];return _0x3b4aa0;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x2829('0x0'),_0x2829('0x1'),'update'];function createListener(_0xcc9bd6,_0x372658){return function(_0x1a0708){_0x372658[_0x2829('0x2')](_0xcc9bd6,_0x1a0708);};}function removeListener(_0x160c78,_0xbae49a){return function(){VoiceQueueReportEvents['removeListener'](_0x160c78,_0xbae49a);};}exports[_0x2829('0x3')]=function(_0xec00f8){for(var _0x45bc4b=0x0,_0x3e3dae=events[_0x2829('0x4')];_0x45bc4b<_0x3e3dae;_0x45bc4b++){var _0x50de53=events[_0x45bc4b];var _0x437c65=createListener(_0x2829('0x5')+_0x50de53,_0xec00f8);VoiceQueueReportEvents['on'](_0x50de53,_0x437c65);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 55ce6cc..8ea13ff 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 _0x46cb=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer'];(function(_0x1c163e,_0x129d9d){var _0x3f1872=function(_0x3dc790){while(--_0x3dc790){_0x1c163e['push'](_0x1c163e['shift']());}};_0x3f1872(++_0x129d9d);}(_0x46cb,0x84));var _0xb46c=function(_0x310990,_0x245984){_0x310990=_0x310990-0x0;var _0x648534=_0x46cb[_0x310990];return _0x648534;};'use strict';var multer=require(_0xb46c('0x0'));var util=require(_0xb46c('0x1'));var path=require(_0xb46c('0x2'));var timeout=require(_0xb46c('0x3'));var express=require('express');var router=express[_0xb46c('0x4')]();var auth=require(_0xb46c('0x5'));var interaction=require(_0xb46c('0x6'));var config=require(_0xb46c('0x7'));var controller=require('./voiceQueuesLog.controller');router[_0xb46c('0x8')]('/',auth[_0xb46c('0x9')](),controller[_0xb46c('0xa')]);router['get'](_0xb46c('0xb'),auth['isAuthenticated'](),controller[_0xb46c('0xc')]);router[_0xb46c('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb46c('0xe')](_0xb46c('0xb'),auth[_0xb46c('0x9')](),controller[_0xb46c('0xf')]);router[_0xb46c('0x10')](_0xb46c('0xb'),auth['isAuthenticated'](),controller[_0xb46c('0x11')]);module[_0xb46c('0x12')]=router; \ No newline at end of file +var _0x853e=['../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','/:id','show','post','create','put','util','connect-timeout','Router','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x853e,0x1ea));var _0xe853=function(_0x20bdbd,_0x1d206b){_0x20bdbd=_0x20bdbd-0x0;var _0x1e41c4=_0x853e[_0x20bdbd];return _0x1e41c4;};'use strict';var multer=require('multer');var util=require(_0xe853('0x0'));var path=require('path');var timeout=require(_0xe853('0x1'));var express=require('express');var router=express[_0xe853('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xe853('0x3'));var config=require(_0xe853('0x4'));var controller=require(_0xe853('0x5'));router[_0xe853('0x6')]('/',auth[_0xe853('0x7')](),controller['index']);router[_0xe853('0x6')](_0xe853('0x8'),auth[_0xe853('0x7')](),controller[_0xe853('0x9')]);router[_0xe853('0xa')]('/',auth[_0xe853('0x7')](),controller[_0xe853('0xb')]);router[_0xe853('0xc')](_0xe853('0x8'),auth[_0xe853('0x7')](),controller['update']);router['delete']('/:id',auth[_0xe853('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 04c783c..8b30a4b 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 _0xd0bb=['moment','exports','STRING','DATE','format','sequelize'];(function(_0x18ceca,_0x2c4d35){var _0x298579=function(_0x448234){while(--_0x448234){_0x18ceca['push'](_0x18ceca['shift']());}};_0x298579(++_0x2c4d35);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x4f3c9b,_0x28e078){_0x4f3c9b=_0x4f3c9b-0x0;var _0x84e58a=_0xd0bb[_0x4f3c9b];return _0x84e58a;};'use strict';var Sequelize=require(_0xbd0b('0x0'));var moment=require(_0xbd0b('0x1'));module[_0xbd0b('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0xbd0b('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xbd0b('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xbd0b('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xbd0b('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xbd0b('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xbd0b('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xbd0b('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xbd0b('0x4')],'allowNull':![],'defaultValue':moment()[_0xbd0b('0x5')]('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file +var _0xe14b=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','STRING'];(function(_0x347e84,_0x446aa6){var _0x422b41=function(_0x2cde10){while(--_0x2cde10){_0x347e84['push'](_0x347e84['shift']());}};_0x422b41(++_0x446aa6);}(_0xe14b,0x93));var _0xbe14=function(_0x378a76,_0x57f70f){_0x378a76=_0x378a76-0x0;var _0x4bffac=_0xe14b[_0x378a76];return _0x4bffac;};'use strict';var Sequelize=require(_0xbe14('0x0'));var moment=require(_0xbe14('0x1'));module['exports']={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0xbe14('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xbe14('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xbe14('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xbe14('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xbe14('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xbe14('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xbe14('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xbe14('0x3')],'allowNull':![],'defaultValue':moment()[_0xbe14('0x4')](_0xbe14('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 9254690..5033bac 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 _0xaa1b=['options','find','create','body','catch','params','destroy','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','field','merge','VoiceQueuesLog','include','findAll','rawAttributes','includeAll'];(function(_0x38cec7,_0x2358b2){var _0x3e89d7=function(_0x190c21){while(--_0x190c21){_0x38cec7['push'](_0x38cec7['shift']());}};_0x3e89d7(++_0x2358b2);}(_0xaa1b,0x123));var _0xbaa1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xaa1b[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0xbaa1('0x0'));var emlformat=require(_0xbaa1('0x1'));var rimraf=require(_0xbaa1('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbaa1('0x3'));var rp=require('request-promise');var moment=require(_0xbaa1('0x4'));var BPromise=require(_0xbaa1('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xbaa1('0x6'));var csv=require(_0xbaa1('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbaa1('0x8'));var squel=require('squel');var crypto=require(_0xbaa1('0x9'));var jsforce=require(_0xbaa1('0xa'));var deskjs=require(_0xbaa1('0xb'));var toCsv=require(_0xbaa1('0x7'));var querystring=require(_0xbaa1('0xc'));var Papa=require(_0xbaa1('0xd'));var Redis=require('ioredis');var authService=require(_0xbaa1('0xe'));var qs=require(_0xbaa1('0xf'));var hardwareService=require(_0xbaa1('0x10'));var logger=require(_0xbaa1('0x11'))(_0xbaa1('0x12'));var utils=require(_0xbaa1('0x13'));var config=require(_0xbaa1('0x14'));var db=require(_0xbaa1('0x15'))['db'];function respondWithStatusCode(_0x363cc1,_0xcc0547){_0xcc0547=_0xcc0547||0xcc;return function(_0x8ce72d){if(_0x8ce72d){return _0x363cc1[_0xbaa1('0x16')](_0xcc0547);}return _0x363cc1['status'](_0xcc0547)['end']();};}function respondWithResult(_0x5b5d2e,_0x4f18b0){_0x4f18b0=_0x4f18b0||0xc8;return function(_0x2184ab){if(_0x2184ab){return _0x5b5d2e[_0xbaa1('0x17')](_0x4f18b0)[_0xbaa1('0x18')](_0x2184ab);}};}function respondWithFilteredResult(_0x26c1f5,_0x41d76a){return function(_0x2e7db5){if(_0x2e7db5){var _0x30f191=_0x2e7db5[_0xbaa1('0x19')],_0xdbaa8b=_0x41d76a[_0xbaa1('0x1a')],_0x35a3fd=_0x41d76a[_0xbaa1('0x1a')]+_0x41d76a[_0xbaa1('0x1b')],_0x2a0c0b;if(_0x35a3fd>=_0x30f191){_0x35a3fd=_0x30f191;_0x2a0c0b=0xc8;}else{_0x2a0c0b=0xce;}_0x26c1f5[_0xbaa1('0x17')](_0x2a0c0b);return _0x26c1f5[_0xbaa1('0x1c')](_0xbaa1('0x1d'),_0xdbaa8b+'-'+_0x35a3fd+'/'+_0x30f191)[_0xbaa1('0x18')](_0x2e7db5);}return null;};}function patchUpdates(_0x302cd3){return function(_0x4fa97e){try{jsonpatch[_0xbaa1('0x1e')](_0x4fa97e,_0x302cd3,!![]);}catch(_0x3e3f4a){return BPromise[_0xbaa1('0x1f')](_0x3e3f4a);}return _0x4fa97e[_0xbaa1('0x20')]();};}function saveUpdates(_0x54997f,_0x2b59c3){return function(_0x5c2115){if(_0x5c2115){return _0x5c2115[_0xbaa1('0x21')](_0x54997f)[_0xbaa1('0x22')](function(_0x1c38f3){return _0x1c38f3;});}return null;};}function removeEntity(_0x365810,_0x3b2f53){return function(_0x5a7d21){if(_0x5a7d21){return _0x5a7d21['destroy']()[_0xbaa1('0x22')](function(){_0x365810[_0xbaa1('0x17')](0xcc)[_0xbaa1('0x23')]();});}};}function handleEntityNotFound(_0x34946c,_0x117079){return function(_0x113bbd){if(!_0x113bbd){_0x34946c['sendStatus'](0x194);}return _0x113bbd;};}function handleError(_0x243eeb,_0x33287f){_0x33287f=_0x33287f||0x1f4;return function(_0x28e508){logger[_0xbaa1('0x24')](_0x28e508[_0xbaa1('0x25')]);if(_0x28e508[_0xbaa1('0x26')]){delete _0x28e508[_0xbaa1('0x26')];}_0x243eeb[_0xbaa1('0x17')](_0x33287f)[_0xbaa1('0x27')](_0x28e508);};}exports['index']=function(_0x2b80a4,_0x29298c){var _0xd2cae3={},_0x2913ae={},_0x109187={'count':0x0,'rows':[]};var _0x422925=db['VoiceQueuesLog']['rawAttributes'];_0x2913ae[_0xbaa1('0x28')]=_[_0xbaa1('0x29')](_0x422925);_0x2913ae[_0xbaa1('0x2a')]=_['keys'](_0x2b80a4[_0xbaa1('0x2a')]);_0x2913ae[_0xbaa1('0x2b')]=_['intersection'](_0x2913ae[_0xbaa1('0x28')],_0x2913ae['query']);_0xd2cae3[_0xbaa1('0x2c')]=_[_0xbaa1('0x2d')](_0x2913ae[_0xbaa1('0x28')],qs['fields'](_0x2b80a4['query'][_0xbaa1('0x2e')]));_0xd2cae3[_0xbaa1('0x2c')]=_0xd2cae3[_0xbaa1('0x2c')][_0xbaa1('0x2f')]?_0xd2cae3[_0xbaa1('0x2c')]:_0x2913ae[_0xbaa1('0x28')];if(!_0x2b80a4['query'][_0xbaa1('0x30')](_0xbaa1('0x31'))){_0xd2cae3[_0xbaa1('0x1b')]=qs[_0xbaa1('0x1b')](_0x2b80a4['query'][_0xbaa1('0x1b')]);_0xd2cae3['offset']=qs[_0xbaa1('0x1a')](_0x2b80a4[_0xbaa1('0x2a')][_0xbaa1('0x1a')]);}_0xd2cae3[_0xbaa1('0x32')]=qs['sort'](_0x2b80a4[_0xbaa1('0x2a')][_0xbaa1('0x33')]);_0xd2cae3[_0xbaa1('0x34')]=qs['filters'](_[_0xbaa1('0x35')](_0x2b80a4[_0xbaa1('0x2a')],_0x2913ae['filters']));if(_0x2b80a4[_0xbaa1('0x2a')][_0xbaa1('0x36')]){_0xd2cae3[_0xbaa1('0x34')]=_['merge'](_0xd2cae3[_0xbaa1('0x34')],{'$or':_['map'](_0x422925,function(_0x5dfc96){if(_0x5dfc96[_0xbaa1('0x37')]['key']!==_0xbaa1('0x38')){var _0x19328f={};_0x19328f[_0x5dfc96[_0xbaa1('0x39')]]={'$like':'%'+_0x2b80a4['query'][_0xbaa1('0x36')]+'%'};return _0x19328f;}})});}_0xd2cae3=_[_0xbaa1('0x3a')]({},_0xd2cae3,_0x2b80a4['options']);var _0x35dbb2={'where':_0xd2cae3[_0xbaa1('0x34')]};return db[_0xbaa1('0x3b')][_0xbaa1('0x19')](_0x35dbb2)[_0xbaa1('0x22')](function(_0x35b873){_0x109187[_0xbaa1('0x19')]=_0x35b873;if(_0x2b80a4[_0xbaa1('0x2a')]['includeAll']){_0xd2cae3[_0xbaa1('0x3c')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0xbaa1('0x3d')](_0xd2cae3);})[_0xbaa1('0x22')](function(_0x1ab91e){_0x109187['rows']=_0x1ab91e;return _0x109187;})[_0xbaa1('0x22')](respondWithFilteredResult(_0x29298c,_0xd2cae3))['catch'](handleError(_0x29298c,null));};exports['show']=function(_0x278417,_0x5245a9){var _0x20e707={'raw':!![],'where':{'id':_0x278417['params']['id']}},_0x5efda0={};_0x5efda0[_0xbaa1('0x28')]=_[_0xbaa1('0x29')](db[_0xbaa1('0x3b')][_0xbaa1('0x3e')]);_0x5efda0[_0xbaa1('0x2a')]=_[_0xbaa1('0x29')](_0x278417[_0xbaa1('0x2a')]);_0x5efda0[_0xbaa1('0x2b')]=_[_0xbaa1('0x2d')](_0x5efda0[_0xbaa1('0x28')],_0x5efda0[_0xbaa1('0x2a')]);_0x20e707[_0xbaa1('0x2c')]=_[_0xbaa1('0x2d')](_0x5efda0[_0xbaa1('0x28')],qs['fields'](_0x278417['query'][_0xbaa1('0x2e')]));_0x20e707[_0xbaa1('0x2c')]=_0x20e707[_0xbaa1('0x2c')][_0xbaa1('0x2f')]?_0x20e707[_0xbaa1('0x2c')]:_0x5efda0[_0xbaa1('0x28')];if(_0x278417[_0xbaa1('0x2a')][_0xbaa1('0x3f')]){_0x20e707['include']=[{'all':!![]}];}_0x20e707=_[_0xbaa1('0x3a')]({},_0x20e707,_0x278417[_0xbaa1('0x40')]);return db[_0xbaa1('0x3b')][_0xbaa1('0x41')](_0x20e707)[_0xbaa1('0x22')](handleEntityNotFound(_0x5245a9,null))[_0xbaa1('0x22')](respondWithResult(_0x5245a9,null))['catch'](handleError(_0x5245a9,null));};exports['create']=function(_0x3c6468,_0x54136e){return db[_0xbaa1('0x3b')][_0xbaa1('0x42')](_0x3c6468[_0xbaa1('0x43')],{})['then'](respondWithResult(_0x54136e,0xc9))[_0xbaa1('0x44')](handleError(_0x54136e,null));};exports[_0xbaa1('0x21')]=function(_0xa61fb7,_0x13a358){if(_0xa61fb7[_0xbaa1('0x43')]['id']){delete _0xa61fb7['body']['id'];}return db['VoiceQueuesLog'][_0xbaa1('0x41')]({'where':{'id':_0xa61fb7[_0xbaa1('0x45')]['id']}})[_0xbaa1('0x22')](handleEntityNotFound(_0x13a358,null))[_0xbaa1('0x22')](saveUpdates(_0xa61fb7[_0xbaa1('0x43')],null))[_0xbaa1('0x22')](respondWithResult(_0x13a358,null))[_0xbaa1('0x44')](handleError(_0x13a358,null));};exports[_0xbaa1('0x46')]=function(_0xa4dd12,_0x19c7f5){return db[_0xbaa1('0x3b')]['find']({'where':{'id':_0xa4dd12[_0xbaa1('0x45')]['id']}})[_0xbaa1('0x22')](handleEntityNotFound(_0x19c7f5,null))[_0xbaa1('0x22')](removeEntity(_0x19c7f5,null))[_0xbaa1('0x44')](handleError(_0x19c7f5,null));}; \ No newline at end of file +var _0xe1e8=['show','params','find','body','html-pdf','rimraf','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','offset','limit','status','set','Content-Range','reject','save','update','destroy','then','error','name','VoiceQueuesLog','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','merge','map','type','VIRTUAL','field','filter','options','count','includeAll','include','findAll','rows','catch'];(function(_0x4573c2,_0x3763e9){var _0x573a59=function(_0x2cbed6){while(--_0x2cbed6){_0x4573c2['push'](_0x4573c2['shift']());}};_0x573a59(++_0x3763e9);}(_0xe1e8,0x1cb));var _0x8e1e=function(_0x3a1ea7,_0x380789){_0x3a1ea7=_0x3a1ea7-0x0;var _0x2f19ec=_0xe1e8[_0x3a1ea7];return _0x2f19ec;};'use strict';var pdf=require(_0x8e1e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8e1e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8e1e('0x2'));var moment=require(_0x8e1e('0x3'));var BPromise=require(_0x8e1e('0x4'));var Mustache=require(_0x8e1e('0x5'));var util=require('util');var path=require('path');var sox=require(_0x8e1e('0x6'));var csv=require(_0x8e1e('0x7'));var ejs=require(_0x8e1e('0x8'));var fs=require('fs');var _=require(_0x8e1e('0x9'));var squel=require('squel');var crypto=require(_0x8e1e('0xa'));var jsforce=require(_0x8e1e('0xb'));var deskjs=require(_0x8e1e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8e1e('0xd'));var Redis=require(_0x8e1e('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x8e1e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8e1e('0x10'))(_0x8e1e('0x11'));var utils=require(_0x8e1e('0x12'));var config=require(_0x8e1e('0x13'));var db=require(_0x8e1e('0x14'))['db'];function respondWithStatusCode(_0x4dced4,_0x23695e){_0x23695e=_0x23695e||0xcc;return function(_0x206783){if(_0x206783){return _0x4dced4[_0x8e1e('0x15')](_0x23695e);}return _0x4dced4['status'](_0x23695e)[_0x8e1e('0x16')]();};}function respondWithResult(_0x4c4a52,_0x3b5e9f){_0x3b5e9f=_0x3b5e9f||0xc8;return function(_0x161bb7){if(_0x161bb7){return _0x4c4a52['status'](_0x3b5e9f)['json'](_0x161bb7);}};}function respondWithFilteredResult(_0x5c6fc4,_0x11269c){return function(_0x120903){if(_0x120903){var _0x2d2d4f=_0x120903['count'],_0x1bd383=_0x11269c[_0x8e1e('0x17')],_0xf439a=_0x11269c[_0x8e1e('0x17')]+_0x11269c[_0x8e1e('0x18')],_0x585e3a;if(_0xf439a>=_0x2d2d4f){_0xf439a=_0x2d2d4f;_0x585e3a=0xc8;}else{_0x585e3a=0xce;}_0x5c6fc4[_0x8e1e('0x19')](_0x585e3a);return _0x5c6fc4[_0x8e1e('0x1a')](_0x8e1e('0x1b'),_0x1bd383+'-'+_0xf439a+'/'+_0x2d2d4f)['json'](_0x120903);}return null;};}function patchUpdates(_0x2c8221){return function(_0x297d5b){try{jsonpatch['apply'](_0x297d5b,_0x2c8221,!![]);}catch(_0x4e9fd4){return BPromise[_0x8e1e('0x1c')](_0x4e9fd4);}return _0x297d5b[_0x8e1e('0x1d')]();};}function saveUpdates(_0xa6f8f5,_0x3e77ea){return function(_0x325028){if(_0x325028){return _0x325028[_0x8e1e('0x1e')](_0xa6f8f5)['then'](function(_0x7ad0a5){return _0x7ad0a5;});}return null;};}function removeEntity(_0x4bb9df,_0x557af1){return function(_0x4e2e6d){if(_0x4e2e6d){return _0x4e2e6d[_0x8e1e('0x1f')]()[_0x8e1e('0x20')](function(){_0x4bb9df['status'](0xcc)[_0x8e1e('0x16')]();});}};}function handleEntityNotFound(_0x47972b,_0x323286){return function(_0x499c31){if(!_0x499c31){_0x47972b['sendStatus'](0x194);}return _0x499c31;};}function handleError(_0x24976b,_0x3b4e0a){_0x3b4e0a=_0x3b4e0a||0x1f4;return function(_0x309fbd){logger[_0x8e1e('0x21')](_0x309fbd['stack']);if(_0x309fbd[_0x8e1e('0x22')]){delete _0x309fbd[_0x8e1e('0x22')];}_0x24976b[_0x8e1e('0x19')](_0x3b4e0a)['send'](_0x309fbd);};}exports['index']=function(_0xbd295f,_0x582228){var _0x170eeb={},_0x3e797d={},_0x7e733f={'count':0x0,'rows':[]};var _0x296129=db[_0x8e1e('0x23')][_0x8e1e('0x24')];_0x3e797d[_0x8e1e('0x25')]=_[_0x8e1e('0x26')](_0x296129);_0x3e797d['query']=_['keys'](_0xbd295f[_0x8e1e('0x27')]);_0x3e797d[_0x8e1e('0x28')]=_[_0x8e1e('0x29')](_0x3e797d[_0x8e1e('0x25')],_0x3e797d['query']);_0x170eeb[_0x8e1e('0x2a')]=_[_0x8e1e('0x29')](_0x3e797d[_0x8e1e('0x25')],qs[_0x8e1e('0x2b')](_0xbd295f[_0x8e1e('0x27')]['fields']));_0x170eeb[_0x8e1e('0x2a')]=_0x170eeb[_0x8e1e('0x2a')][_0x8e1e('0x2c')]?_0x170eeb[_0x8e1e('0x2a')]:_0x3e797d[_0x8e1e('0x25')];if(!_0xbd295f[_0x8e1e('0x27')]['hasOwnProperty'](_0x8e1e('0x2d'))){_0x170eeb[_0x8e1e('0x18')]=qs['limit'](_0xbd295f[_0x8e1e('0x27')]['limit']);_0x170eeb[_0x8e1e('0x17')]=qs[_0x8e1e('0x17')](_0xbd295f[_0x8e1e('0x27')][_0x8e1e('0x17')]);}_0x170eeb['order']=qs['sort'](_0xbd295f[_0x8e1e('0x27')][_0x8e1e('0x2e')]);_0x170eeb[_0x8e1e('0x2f')]=qs['filters'](_['pick'](_0xbd295f[_0x8e1e('0x27')],_0x3e797d[_0x8e1e('0x28')]));if(_0xbd295f[_0x8e1e('0x27')]['filter']){_0x170eeb[_0x8e1e('0x2f')]=_[_0x8e1e('0x30')](_0x170eeb['where'],{'$or':_[_0x8e1e('0x31')](_0x296129,function(_0xab1ddd){if(_0xab1ddd[_0x8e1e('0x32')]['key']!==_0x8e1e('0x33')){var _0x46de06={};_0x46de06[_0xab1ddd[_0x8e1e('0x34')]]={'$like':'%'+_0xbd295f['query'][_0x8e1e('0x35')]+'%'};return _0x46de06;}})});}_0x170eeb=_[_0x8e1e('0x30')]({},_0x170eeb,_0xbd295f[_0x8e1e('0x36')]);var _0x15a3ed={'where':_0x170eeb[_0x8e1e('0x2f')]};return db['VoiceQueuesLog']['count'](_0x15a3ed)[_0x8e1e('0x20')](function(_0xe71547){_0x7e733f[_0x8e1e('0x37')]=_0xe71547;if(_0xbd295f[_0x8e1e('0x27')][_0x8e1e('0x38')]){_0x170eeb[_0x8e1e('0x39')]=[{'all':!![]}];}return db[_0x8e1e('0x23')][_0x8e1e('0x3a')](_0x170eeb);})[_0x8e1e('0x20')](function(_0x1a9b74){_0x7e733f[_0x8e1e('0x3b')]=_0x1a9b74;return _0x7e733f;})[_0x8e1e('0x20')](respondWithFilteredResult(_0x582228,_0x170eeb))[_0x8e1e('0x3c')](handleError(_0x582228,null));};exports[_0x8e1e('0x3d')]=function(_0x2e01d5,_0x3c372c){var _0xee4fee={'raw':!![],'where':{'id':_0x2e01d5[_0x8e1e('0x3e')]['id']}},_0x37241e={};_0x37241e['model']=_[_0x8e1e('0x26')](db['VoiceQueuesLog'][_0x8e1e('0x24')]);_0x37241e[_0x8e1e('0x27')]=_['keys'](_0x2e01d5[_0x8e1e('0x27')]);_0x37241e[_0x8e1e('0x28')]=_[_0x8e1e('0x29')](_0x37241e['model'],_0x37241e[_0x8e1e('0x27')]);_0xee4fee['attributes']=_[_0x8e1e('0x29')](_0x37241e['model'],qs[_0x8e1e('0x2b')](_0x2e01d5[_0x8e1e('0x27')][_0x8e1e('0x2b')]));_0xee4fee[_0x8e1e('0x2a')]=_0xee4fee[_0x8e1e('0x2a')][_0x8e1e('0x2c')]?_0xee4fee[_0x8e1e('0x2a')]:_0x37241e[_0x8e1e('0x25')];if(_0x2e01d5[_0x8e1e('0x27')][_0x8e1e('0x38')]){_0xee4fee[_0x8e1e('0x39')]=[{'all':!![]}];}_0xee4fee=_[_0x8e1e('0x30')]({},_0xee4fee,_0x2e01d5[_0x8e1e('0x36')]);return db[_0x8e1e('0x23')][_0x8e1e('0x3f')](_0xee4fee)[_0x8e1e('0x20')](handleEntityNotFound(_0x3c372c,null))[_0x8e1e('0x20')](respondWithResult(_0x3c372c,null))[_0x8e1e('0x3c')](handleError(_0x3c372c,null));};exports['create']=function(_0x4cce17,_0x4b1bad){return db['VoiceQueuesLog']['create'](_0x4cce17[_0x8e1e('0x40')],{})[_0x8e1e('0x20')](respondWithResult(_0x4b1bad,0xc9))[_0x8e1e('0x3c')](handleError(_0x4b1bad,null));};exports['update']=function(_0x2091bf,_0x3862e7){if(_0x2091bf[_0x8e1e('0x40')]['id']){delete _0x2091bf['body']['id'];}return db[_0x8e1e('0x23')][_0x8e1e('0x3f')]({'where':{'id':_0x2091bf['params']['id']}})[_0x8e1e('0x20')](handleEntityNotFound(_0x3862e7,null))[_0x8e1e('0x20')](saveUpdates(_0x2091bf[_0x8e1e('0x40')],null))[_0x8e1e('0x20')](respondWithResult(_0x3862e7,null))['catch'](handleError(_0x3862e7,null));};exports[_0x8e1e('0x1f')]=function(_0x16d169,_0x26a8dd){return db[_0x8e1e('0x23')]['find']({'where':{'id':_0x16d169[_0x8e1e('0x3e')]['id']}})[_0x8e1e('0x20')](handleEntityNotFound(_0x26a8dd,null))[_0x8e1e('0x20')](removeEntity(_0x26a8dd,null))[_0x8e1e('0x3c')](handleError(_0x26a8dd,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 085e335..86b1af4 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 _0x2316=['moment','request-promise','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','../../config/logger'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x2316,0x1b8));var _0x6231=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0x2316[_0x710815];return _0x5b3b89;};'use strict';var _=require(_0x6231('0x0'));var util=require('util');var logger=require(_0x6231('0x1'))('api');var moment=require(_0x6231('0x2'));var BPromise=require('bluebird');var rp=require(_0x6231('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6231('0x4'));var config=require(_0x6231('0x5'));var attributes=require(_0x6231('0x6'));module[_0x6231('0x7')]=function(_0x27f98b,_0x52d839){return _0x27f98b['define'](_0x6231('0x8'),attributes,{'tableName':_0x6231('0x9'),'paranoid':![],'indexes':[{'name':_0x6231('0xa'),'fields':[_0x6231('0xb'),_0x6231('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7c6f=['dtm','lodash','util','api','moment','request-promise','rimraf','./voiceQueuesLog.attributes','define','voice_queues_log','event'];(function(_0x3b3aca,_0x5e03f8){var _0x12ad5c=function(_0x55bab5){while(--_0x55bab5){_0x3b3aca['push'](_0x3b3aca['shift']());}};_0x12ad5c(++_0x5e03f8);}(_0x7c6f,0x109));var _0xf7c6=function(_0x1fcda0,_0x5270af){_0x1fcda0=_0x1fcda0-0x0;var _0x36a1a6=_0x7c6f[_0x1fcda0];return _0x36a1a6;};'use strict';var _=require(_0xf7c6('0x0'));var util=require(_0xf7c6('0x1'));var logger=require('../../config/logger')(_0xf7c6('0x2'));var moment=require(_0xf7c6('0x3'));var BPromise=require('bluebird');var rp=require(_0xf7c6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf7c6('0x5'));var config=require('../../config/environment');var attributes=require(_0xf7c6('0x6'));module['exports']=function(_0x2f38ff,_0x1b661a){return _0x2f38ff[_0xf7c6('0x7')]('VoiceQueuesLog',attributes,{'tableName':_0xf7c6('0x8'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0xf7c6('0x9'),_0xf7c6('0xa')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 70a467d..594d249 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 _0x12ed=['bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','VoiceQueuesLog,\x20%s,\x20%s','message','lodash','util'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0x12ed,0x1d9));var _0xd12e=function(_0x43facb,_0x31b17b){_0x43facb=_0x43facb-0x0;var _0xc73e2b=_0x12ed[_0x43facb];return _0xc73e2b;};'use strict';var _=require(_0xd12e('0x0'));var util=require(_0xd12e('0x1'));var moment=require('moment');var BPromise=require(_0xd12e('0x2'));var rs=require(_0xd12e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd12e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd12e('0x5'))(_0xd12e('0x6'));var config=require(_0xd12e('0x7'));var jayson=require(_0xd12e('0x8'));var client=jayson[_0xd12e('0x9')][_0xd12e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xce1716,_0x47bd77,_0x1d2112){return new BPromise(function(_0x3751e0,_0x1c2c1e){return client[_0xd12e('0xb')](_0xce1716,_0x1d2112)[_0xd12e('0xc')](function(_0x427330){logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x47bd77,_0xd12e('0xd'));logger[_0xd12e('0xe')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x47bd77,_0xd12e('0xd'),JSON[_0xd12e('0xf')](_0x427330));if(_0x427330['error']){if(_0x427330[_0xd12e('0x10')]['code']===0x1f4){logger[_0xd12e('0x10')](_0xd12e('0x11'),_0x47bd77,_0x427330[_0xd12e('0x10')][_0xd12e('0x12')]);return _0x1c2c1e(_0x427330[_0xd12e('0x10')][_0xd12e('0x12')]);}logger[_0xd12e('0x10')](_0xd12e('0x11'),_0x47bd77,_0x427330[_0xd12e('0x10')][_0xd12e('0x12')]);return _0x3751e0(_0x427330[_0xd12e('0x10')]['message']);}else{logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x47bd77,_0xd12e('0xd'));_0x3751e0(_0x427330['result'][_0xd12e('0x12')]);}})['catch'](function(_0x55e582){logger[_0xd12e('0x10')]('VoiceQueuesLog,\x20%s,\x20%s',_0x47bd77,_0x55e582);_0x1c2c1e(_0x55e582);});});} \ No newline at end of file +var _0x8ced=['info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','rpc','client','http','request','then'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x8ced,0xc7));var _0xd8ce=function(_0x5c14f6,_0x2979d8){_0x5c14f6=_0x5c14f6-0x0;var _0x4949b3=_0x8ced[_0x5c14f6];return _0x4949b3;};'use strict';var _=require(_0xd8ce('0x0'));var util=require('util');var moment=require(_0xd8ce('0x1'));var BPromise=require(_0xd8ce('0x2'));var rs=require(_0xd8ce('0x3'));var fs=require('fs');var Redis=require(_0xd8ce('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd8ce('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd8ce('0x6')][_0xd8ce('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x184141,_0x5b5dd8,_0x514e10){return new BPromise(function(_0x3b58c1,_0x4bf1cb){return client[_0xd8ce('0x8')](_0x184141,_0x514e10)[_0xd8ce('0x9')](function(_0x498394){logger[_0xd8ce('0xa')](_0xd8ce('0xb'),_0x5b5dd8,_0xd8ce('0xc'));logger[_0xd8ce('0xd')](_0xd8ce('0xe'),_0x5b5dd8,_0xd8ce('0xc'),JSON['stringify'](_0x498394));if(_0x498394[_0xd8ce('0xf')]){if(_0x498394[_0xd8ce('0xf')]['code']===0x1f4){logger[_0xd8ce('0xf')](_0xd8ce('0xb'),_0x5b5dd8,_0x498394[_0xd8ce('0xf')][_0xd8ce('0x10')]);return _0x4bf1cb(_0x498394[_0xd8ce('0xf')][_0xd8ce('0x10')]);}logger[_0xd8ce('0xf')](_0xd8ce('0xb'),_0x5b5dd8,_0x498394[_0xd8ce('0xf')]['message']);return _0x3b58c1(_0x498394[_0xd8ce('0xf')]['message']);}else{logger[_0xd8ce('0xa')](_0xd8ce('0xb'),_0x5b5dd8,_0xd8ce('0xc'));_0x3b58c1(_0x498394[_0xd8ce('0x11')]['message']);}})[_0xd8ce('0x12')](function(_0x422cd1){logger['error'](_0xd8ce('0xb'),_0x5b5dd8,_0x422cd1);_0x4bf1cb(_0x422cd1);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index b120101..3b89e12 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 _0x4ea3=['connect-timeout','Router','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','/:id/downloads','downloads','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x3207aa,_0xe86a72){var _0x51758f=function(_0x9ff790){while(--_0x9ff790){_0x3207aa['push'](_0x3207aa['shift']());}};_0x51758f(++_0xe86a72);}(_0x4ea3,0x70));var _0x34ea=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x4ea3[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x34ea('0x0'));var util=require(_0x34ea('0x1'));var path=require(_0x34ea('0x2'));var timeout=require(_0x34ea('0x3'));var express=require('express');var router=express[_0x34ea('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x34ea('0x5'));var config=require('../../config/environment');var controller=require('./voiceRecording.controller');router[_0x34ea('0x6')]('/',auth[_0x34ea('0x7')](),controller[_0x34ea('0x8')]);router[_0x34ea('0x6')](_0x34ea('0x9'),auth[_0x34ea('0x7')](),controller[_0x34ea('0xa')]);router['get'](_0x34ea('0xb'),auth[_0x34ea('0x7')](),controller[_0x34ea('0xc')]);router['get'](_0x34ea('0xd'),auth[_0x34ea('0x7')](),controller['download']);router['get'](_0x34ea('0xe'),controller[_0x34ea('0xf')]);router[_0x34ea('0x10')]('/',auth['isAuthenticated'](),controller[_0x34ea('0x11')]);router[_0x34ea('0x12')](_0x34ea('0xb'),auth[_0x34ea('0x7')](),controller[_0x34ea('0x13')]);router[_0x34ea('0x14')](_0x34ea('0xb'),auth[_0x34ea('0x7')](),controller[_0x34ea('0x15')]);module[_0x34ea('0x16')]=router; \ No newline at end of file +var _0xc3fe=['../../components/auth/service','../../config/environment','./voiceRecording.controller','get','/describe','isAuthenticated','show','/:id/download','download','/:id/downloads','downloads','post','put','/:id','exports','multer','util','path','express','Router'];(function(_0x55a359,_0x418dfc){var _0x47cb13=function(_0x4004e1){while(--_0x4004e1){_0x55a359['push'](_0x55a359['shift']());}};_0x47cb13(++_0x418dfc);}(_0xc3fe,0xff));var _0xec3f=function(_0x390039,_0x4415c6){_0x390039=_0x390039-0x0;var _0x2e7850=_0xc3fe[_0x390039];return _0x2e7850;};'use strict';var multer=require(_0xec3f('0x0'));var util=require(_0xec3f('0x1'));var path=require(_0xec3f('0x2'));var timeout=require('connect-timeout');var express=require(_0xec3f('0x3'));var router=express[_0xec3f('0x4')]();var auth=require(_0xec3f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xec3f('0x6'));var controller=require(_0xec3f('0x7'));router[_0xec3f('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xec3f('0x8')](_0xec3f('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0xec3f('0x8')]('/:id',auth[_0xec3f('0xa')](),controller[_0xec3f('0xb')]);router[_0xec3f('0x8')](_0xec3f('0xc'),auth['isAuthenticated'](),controller[_0xec3f('0xd')]);router[_0xec3f('0x8')](_0xec3f('0xe'),controller[_0xec3f('0xf')]);router[_0xec3f('0x10')]('/',auth[_0xec3f('0xa')](),controller['create']);router[_0xec3f('0x11')](_0xec3f('0x12'),auth[_0xec3f('0xa')](),controller['update']);router['delete'](_0xec3f('0x12'),auth['isAuthenticated'](),controller['destroy']);module[_0xec3f('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 1991c8b..2c35a93 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 _0x526b=['moment','path','exports','getDataValue','value','extname','STRING','channel','setDataValue','membername','INTEGER','DATE','createdAt','format','MM-DD-YYYY\x20HH:mm','updatedAt','toString','sequelize'];(function(_0x22cb21,_0x433b0a){var _0x4dd943=function(_0x4cb420){while(--_0x4cb420){_0x22cb21['push'](_0x22cb21['shift']());}};_0x4dd943(++_0x433b0a);}(_0x526b,0x167));var _0xb526=function(_0x57ca3f,_0x4fe389){_0x57ca3f=_0x57ca3f-0x0;var _0x363918=_0x526b[_0x57ca3f];return _0x363918;};'use strict';var Sequelize=require(_0xb526('0x0'));var moment=require(_0xb526('0x1'));var path=require(_0xb526('0x2'));module[_0xb526('0x3')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xb526('0x4')](_0xb526('0x5'))?path[_0xb526('0x6')](this[_0xb526('0x4')](_0xb526('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0xb526('0x7')]},'channel':{'type':Sequelize['STRING'],'set':function(_0x2c0ee9){if(_0x2c0ee9){this['setDataValue'](_0xb526('0x8'),_0x2c0ee9);this[_0xb526('0x9')](_0xb526('0xa'),_0x2c0ee9['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0xb526('0x7')]},'calleridnum':{'type':Sequelize[_0xb526('0x7')]},'calleridname':{'type':Sequelize[_0xb526('0x7')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xb526('0x7')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xb526('0x7')]},'value':{'type':Sequelize[_0xb526('0x7')]},'type':{'type':Sequelize[_0xb526('0x7')]},'rating':{'type':Sequelize[_0xb526('0xb')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0xb526('0x7')]},'userDisposition':{'type':Sequelize['STRING']},'createdAt':{'type':Sequelize[_0xb526('0xc')],'get':function(){return moment(this['getDataValue'](_0xb526('0xd')))[_0xb526('0xe')](_0xb526('0xf'))['toString']();}},'updatedAt':{'type':Sequelize[_0xb526('0xc')],'get':function(){return moment(this[_0xb526('0x4')](_0xb526('0x10')))[_0xb526('0xe')](_0xb526('0xf'))[_0xb526('0x11')]();}}}; \ No newline at end of file +var _0x10dc=['getDataValue','value','extname','STRING','setDataValue','split','DATE','createdAt','toString','updatedAt','format','moment','path','VIRTUAL'];(function(_0x4c277a,_0x206bf9){var _0x1d4b98=function(_0x103b84){while(--_0x103b84){_0x4c277a['push'](_0x4c277a['shift']());}};_0x1d4b98(++_0x206bf9);}(_0x10dc,0x6d));var _0xc10d=function(_0x5864ef,_0x496812){_0x5864ef=_0x5864ef-0x0;var _0x21c244=_0x10dc[_0x5864ef];return _0x21c244;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xc10d('0x0'));var path=require(_0xc10d('0x1'));module['exports']={'format':{'type':Sequelize[_0xc10d('0x2')],'get':function(){return this[_0xc10d('0x3')](_0xc10d('0x4'))?path[_0xc10d('0x5')](this[_0xc10d('0x3')](_0xc10d('0x4'))):undefined;}},'uniqueid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xc10d('0x6')],'set':function(_0x1ecb90){if(_0x1ecb90){this['setDataValue']('channel',_0x1ecb90);this[_0xc10d('0x7')]('membername',_0x1ecb90[_0xc10d('0x8')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0xc10d('0x6')]},'calleridnum':{'type':Sequelize[_0xc10d('0x6')]},'calleridname':{'type':Sequelize[_0xc10d('0x6')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xc10d('0x6')]},'exten':{'type':Sequelize['STRING']},'value':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xc10d('0x6')]},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'createdAt':{'type':Sequelize[_0xc10d('0x9')],'get':function(){return moment(this[_0xc10d('0x3')](_0xc10d('0xa')))['format']('MM-DD-YYYY\x20HH:mm')[_0xc10d('0xb')]();}},'updatedAt':{'type':Sequelize[_0xc10d('0x9')],'get':function(){return moment(this[_0xc10d('0x3')](_0xc10d('0xc')))[_0xc10d('0xd')]('MM-DD-YYYY\x20HH:mm')[_0xc10d('0xb')]();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index c58ab77..4c25a7b 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 _0xc99b=['filter','options','includeAll','findAll','rows','catch','params','keys','find','body','describe','download','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','ValidationError','filename','extname','unlink','VoiceRecording\x20not\x20found','Not\x20found','downloads','../../components/encryptor','sequelize','MD5','col','token','$and','push','Sequelize','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','name','send','VoiceRecording','rawAttributes','model','differenceBy','format','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','key','field'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc99b,0x81));var _0xbc99=function(_0x2c5231,_0x51913c){_0x2c5231=_0x2c5231-0x0;var _0x569090=_0xc99b[_0x2c5231];return _0x569090;};'use strict';var pdf=require(_0xbc99('0x0'));var emlformat=require(_0xbc99('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xbc99('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbc99('0x3'));var moment=require(_0xbc99('0x4'));var BPromise=require(_0xbc99('0x5'));var Mustache=require(_0xbc99('0x6'));var util=require(_0xbc99('0x7'));var path=require(_0xbc99('0x8'));var sox=require(_0xbc99('0x9'));var csv=require('to-csv');var ejs=require(_0xbc99('0xa'));var fs=require('fs');var _=require(_0xbc99('0xb'));var squel=require(_0xbc99('0xc'));var crypto=require('crypto');var jsforce=require(_0xbc99('0xd'));var deskjs=require(_0xbc99('0xe'));var toCsv=require('to-csv');var querystring=require(_0xbc99('0xf'));var Papa=require(_0xbc99('0x10'));var Redis=require('ioredis');var authService=require(_0xbc99('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbc99('0x12'))(_0xbc99('0x13'));var utils=require(_0xbc99('0x14'));var config=require(_0xbc99('0x15'));var db=require(_0xbc99('0x16'))['db'];function respondWithStatusCode(_0x15378b,_0x28491d){_0x28491d=_0x28491d||0xcc;return function(_0x547cf1){if(_0x547cf1){return _0x15378b[_0xbc99('0x17')](_0x28491d);}return _0x15378b['status'](_0x28491d)[_0xbc99('0x18')]();};}function respondWithResult(_0x150618,_0x1e0e73){_0x1e0e73=_0x1e0e73||0xc8;return function(_0x4350e1){if(_0x4350e1){return _0x150618[_0xbc99('0x19')](_0x1e0e73)[_0xbc99('0x1a')](_0x4350e1);}};}function respondWithFilteredResult(_0x55fdae,_0x5c6a4d){return function(_0x25282a){if(_0x25282a){var _0x4365ec=_0x25282a[_0xbc99('0x1b')],_0x49b695=_0x5c6a4d[_0xbc99('0x1c')],_0x3b7f0a=_0x5c6a4d[_0xbc99('0x1c')]+_0x5c6a4d[_0xbc99('0x1d')],_0x2d22e5;if(_0x3b7f0a>=_0x4365ec){_0x3b7f0a=_0x4365ec;_0x2d22e5=0xc8;}else{_0x2d22e5=0xce;}_0x55fdae['status'](_0x2d22e5);return _0x55fdae[_0xbc99('0x1e')](_0xbc99('0x1f'),_0x49b695+'-'+_0x3b7f0a+'/'+_0x4365ec)[_0xbc99('0x1a')](_0x25282a);}return null;};}function patchUpdates(_0x3d3e44){return function(_0x574a61){try{jsonpatch[_0xbc99('0x20')](_0x574a61,_0x3d3e44,!![]);}catch(_0xf6ddd9){return BPromise[_0xbc99('0x21')](_0xf6ddd9);}return _0x574a61[_0xbc99('0x22')]();};}function saveUpdates(_0x5a9413,_0x4402b3){return function(_0x2c4ef9){if(_0x2c4ef9){return _0x2c4ef9[_0xbc99('0x23')](_0x5a9413)[_0xbc99('0x24')](function(_0x1dbb5e){return _0x1dbb5e;});}return null;};}function removeEntity(_0xe70e81,_0x3c3077){return function(_0x2ef897){if(_0x2ef897){return _0x2ef897[_0xbc99('0x25')]()['then'](function(){_0xe70e81[_0xbc99('0x19')](0xcc)[_0xbc99('0x18')]();});}};}function handleEntityNotFound(_0x4214b0,_0x313cc9){return function(_0x2c730f){if(!_0x2c730f){_0x4214b0[_0xbc99('0x17')](0x194);}return _0x2c730f;};}function handleError(_0x2196a4,_0x1bf6de){_0x1bf6de=_0x1bf6de||0x1f4;return function(_0x436145){logger['error'](_0x436145['stack']);if(_0x436145[_0xbc99('0x26')]){delete _0x436145['name'];}_0x2196a4[_0xbc99('0x19')](_0x1bf6de)[_0xbc99('0x27')](_0x436145);};}exports['index']=function(_0x59832b,_0x381f21){var _0x3316ed={},_0xf5ac66={},_0x32c10d={'count':0x0,'rows':[]};var _0x3b180a=db[_0xbc99('0x28')][_0xbc99('0x29')];_0xf5ac66[_0xbc99('0x2a')]=_[_0xbc99('0x2b')](_['keys'](_0x3b180a),[_0xbc99('0x2c')]);_0xf5ac66['query']=_['keys'](_0x59832b[_0xbc99('0x2d')]);_0xf5ac66[_0xbc99('0x2e')]=_[_0xbc99('0x2f')](_0xf5ac66[_0xbc99('0x2a')],_0xf5ac66[_0xbc99('0x2d')]);_0x3316ed[_0xbc99('0x30')]=_['intersection'](_0xf5ac66[_0xbc99('0x2a')],qs[_0xbc99('0x31')](_0x59832b['query'][_0xbc99('0x31')]));_0x3316ed[_0xbc99('0x30')]=_0x3316ed[_0xbc99('0x30')][_0xbc99('0x32')]?_0x3316ed[_0xbc99('0x30')]:_0xf5ac66[_0xbc99('0x2a')];if(!_0x59832b[_0xbc99('0x2d')][_0xbc99('0x33')](_0xbc99('0x34'))){_0x3316ed[_0xbc99('0x1d')]=qs['limit'](_0x59832b['query'][_0xbc99('0x1d')]);_0x3316ed[_0xbc99('0x1c')]=qs['offset'](_0x59832b[_0xbc99('0x2d')][_0xbc99('0x1c')]);}_0x3316ed[_0xbc99('0x35')]=qs[_0xbc99('0x36')](_0x59832b[_0xbc99('0x2d')][_0xbc99('0x36')]);_0x3316ed[_0xbc99('0x37')]=qs['filters'](_[_0xbc99('0x38')](_0x59832b['query'],_0xf5ac66[_0xbc99('0x2e')]));if(_0x59832b[_0xbc99('0x2d')]['filter']){_0x3316ed[_0xbc99('0x37')]=_[_0xbc99('0x39')](_0x3316ed['where'],{'$or':_['map'](_0x3b180a,function(_0x5cc3ba){if(_0x5cc3ba[_0xbc99('0x3a')][_0xbc99('0x3b')]!=='VIRTUAL'){var _0x22a9e4={};_0x22a9e4[_0x5cc3ba[_0xbc99('0x3c')]]={'$like':'%'+_0x59832b[_0xbc99('0x2d')][_0xbc99('0x3d')]+'%'};return _0x22a9e4;}})});}_0x3316ed=_[_0xbc99('0x39')]({},_0x3316ed,_0x59832b[_0xbc99('0x3e')]);var _0x2351e0={'where':_0x3316ed['where']};return db[_0xbc99('0x28')][_0xbc99('0x1b')](_0x2351e0)[_0xbc99('0x24')](function(_0x1bbd6c){_0x32c10d['count']=_0x1bbd6c;if(_0x59832b[_0xbc99('0x2d')][_0xbc99('0x3f')]){_0x3316ed['include']=[{'all':!![]}];}return db[_0xbc99('0x28')][_0xbc99('0x40')](_0x3316ed);})['then'](function(_0x558caf){_0x32c10d[_0xbc99('0x41')]=_0x558caf;return _0x32c10d;})[_0xbc99('0x24')](respondWithFilteredResult(_0x381f21,_0x3316ed))[_0xbc99('0x42')](handleError(_0x381f21,null));};exports['show']=function(_0x1ae5f4,_0x162b31){var _0x242086={'raw':![],'where':{'id':_0x1ae5f4[_0xbc99('0x43')]['id']}},_0xecf68f={};_0xecf68f[_0xbc99('0x2a')]=_[_0xbc99('0x44')](db[_0xbc99('0x28')][_0xbc99('0x29')]);_0xecf68f['query']=_['keys'](_0x1ae5f4['query']);_0xecf68f[_0xbc99('0x2e')]=_[_0xbc99('0x2f')](_0xecf68f['model'],_0xecf68f[_0xbc99('0x2d')]);_0x242086[_0xbc99('0x30')]=_[_0xbc99('0x2f')](_0xecf68f[_0xbc99('0x2a')],qs[_0xbc99('0x31')](_0x1ae5f4[_0xbc99('0x2d')][_0xbc99('0x31')]));_0x242086['attributes']=_0x242086[_0xbc99('0x30')][_0xbc99('0x32')]?_0x242086[_0xbc99('0x30')]:_0xecf68f['model'];if(_0x1ae5f4['query'][_0xbc99('0x3f')]){_0x242086['include']=[{'all':!![]}];}_0x242086=_['merge']({},_0x242086,_0x1ae5f4[_0xbc99('0x3e')]);return db[_0xbc99('0x28')][_0xbc99('0x45')](_0x242086)[_0xbc99('0x24')](handleEntityNotFound(_0x162b31,null))[_0xbc99('0x24')](respondWithResult(_0x162b31,null))[_0xbc99('0x42')](handleError(_0x162b31,null));};exports['create']=function(_0x5a3424,_0x2dea4b){return db[_0xbc99('0x28')]['create'](_0x5a3424[_0xbc99('0x46')],{})[_0xbc99('0x24')](respondWithResult(_0x2dea4b,0xc9))[_0xbc99('0x42')](handleError(_0x2dea4b,null));};exports['update']=function(_0x2f4050,_0x1ab920){if(_0x2f4050[_0xbc99('0x46')]['id']){delete _0x2f4050['body']['id'];}return db[_0xbc99('0x28')][_0xbc99('0x45')]({'where':{'id':_0x2f4050['params']['id']}})[_0xbc99('0x24')](handleEntityNotFound(_0x1ab920,null))[_0xbc99('0x24')](saveUpdates(_0x2f4050[_0xbc99('0x46')],null))['then'](respondWithResult(_0x1ab920,null))[_0xbc99('0x42')](handleError(_0x1ab920,null));};exports['destroy']=function(_0x2e5e6b,_0x54526a){return db['VoiceRecording'][_0xbc99('0x45')]({'where':{'id':_0x2e5e6b[_0xbc99('0x43')]['id']}})['then'](handleEntityNotFound(_0x54526a,null))[_0xbc99('0x24')](removeEntity(_0x54526a,null))[_0xbc99('0x42')](handleError(_0x54526a,null));};exports[_0xbc99('0x47')]=function(_0x489c34,_0x365a53){return db[_0xbc99('0x28')][_0xbc99('0x47')]()[_0xbc99('0x24')](respondWithResult(_0x365a53,null))[_0xbc99('0x42')](handleError(_0x365a53,null));};exports[_0xbc99('0x48')]=function(_0x2bc957,_0x37956d,_0x49c1f7){var _0x4f64f8=require('../../components/encryptor');var _0x236330=![];var _0x2d4c89={};if(_0x2bc957[_0xbc99('0x2d')][_0xbc99('0x3a')]&&_0x2bc957['query'][_0xbc99('0x3a')]===_0xbc99('0x49')){_0x2d4c89['uniqueid']=_0x2bc957['params']['id'];}else{_0x2d4c89['id']=_0x2bc957['params']['id'];}return db['VoiceRecording']['find']({'where':_0x2d4c89,'attributes':['id',_0xbc99('0x4a')],'raw':!![]})[_0xbc99('0x24')](handleEntityNotFound(_0x37956d,null))[_0xbc99('0x24')](function(_0x354119){if(_0x354119){var _0x4c0017=_0x354119['value'];var _0x4f0189=util[_0xbc99('0x2c')](_0xbc99('0x4b'),_0x4c0017);if(fs[_0xbc99('0x4c')](_0x4f0189)){_0x236330=!![];return _0x4f64f8[_0xbc99('0x4d')](_0x4f0189,_0x4c0017,config[_0xbc99('0x4e')][_0xbc99('0x4f')])['then'](function(){return _0x354119;});}return _0x354119;}})['then'](function(_0x4d8650){if(_0x4d8650){var _0x1f1212=_0x4d8650[_0xbc99('0x4a')];if(!fs['existsSync'](_0x1f1212)){throw new db['Sequelize'][(_0xbc99('0x50'))]('VoiceRecording\x20not\x20found');}if(_0x4d8650[_0xbc99('0x51')]){return _0x37956d[_0xbc99('0x48')](_0x1f1212,_0x4d8650[_0xbc99('0x51')]+path[_0xbc99('0x52')](_0x1f1212),function(){if(_0x236330){fs['unlink'](_0x1f1212);}});}else{return _0x37956d[_0xbc99('0x48')](_0x1f1212,function(_0x5540ae){if(_0x236330){fs[_0xbc99('0x53')](_0x1f1212);}});}}})[_0xbc99('0x42')](function(_0x334641){if(_0x334641['message']===_0xbc99('0x54')){_0x37956d[_0xbc99('0x19')](0x194)[_0xbc99('0x27')](_0xbc99('0x55'));}else{return handleError(_0x37956d,null);}});};exports[_0xbc99('0x56')]=function(_0x4cdadc,_0x1a8e7d,_0x274314){var _0x347cc4=require(_0xbc99('0x57'));var _0x2dd4e2=![];var _0x54709b={'$and':[db[_0xbc99('0x58')][_0xbc99('0x37')](db[_0xbc99('0x58')]['fn'](_0xbc99('0x59'),db['sequelize'][_0xbc99('0x5a')](_0xbc99('0x49'))),_0x4cdadc[_0xbc99('0x2d')][_0xbc99('0x5b')])]};if(_0x4cdadc[_0xbc99('0x2d')][_0xbc99('0x3a')]&&_0x4cdadc[_0xbc99('0x2d')]['type']===_0xbc99('0x49')){_0x54709b[_0xbc99('0x5c')][_0xbc99('0x5d')]({'uniqueid':_0x4cdadc[_0xbc99('0x43')]['id']});}else{_0x54709b[_0xbc99('0x5c')][_0xbc99('0x5d')]({'id':_0x4cdadc[_0xbc99('0x43')]['id']});}return db[_0xbc99('0x28')][_0xbc99('0x45')]({'where':_0x54709b,'attributes':['id','value'],'raw':!![]})[_0xbc99('0x24')](handleEntityNotFound(_0x1a8e7d,null))[_0xbc99('0x24')](function(_0x49b203){if(_0x49b203){var _0x55ba85=util[_0xbc99('0x2c')](_0xbc99('0x4b'),_0x49b203[_0xbc99('0x4a')]);if(fs['existsSync'](_0x55ba85)){_0x2dd4e2=!![];return _0x347cc4[_0xbc99('0x4d')](_0x55ba85,_0x49b203[_0xbc99('0x4a')],config[_0xbc99('0x4e')][_0xbc99('0x4f')])[_0xbc99('0x24')](function(){return _0x49b203;});}return _0x49b203;}})[_0xbc99('0x24')](function(_0x4be06d){if(_0x4be06d){if(!fs[_0xbc99('0x4c')](_0x4be06d[_0xbc99('0x4a')])){throw new db[(_0xbc99('0x5e'))][(_0xbc99('0x50'))]('VoiceRecording\x20not\x20found');}if(_0x4be06d[_0xbc99('0x51')]){return _0x1a8e7d['download'](_0x4be06d[_0xbc99('0x4a')],_0x4be06d[_0xbc99('0x51')]+path['extname'](_0x4be06d[_0xbc99('0x4a')]),function(){if(_0x2dd4e2){fs[_0xbc99('0x53')](_0x4be06d[_0xbc99('0x4a')]);}});}else{return _0x1a8e7d[_0xbc99('0x48')](_0x4be06d[_0xbc99('0x4a')],function(_0x335bf2){if(_0x2dd4e2){fs[_0xbc99('0x53')](_0x4be06d[_0xbc99('0x4a')]);}});}}})[_0xbc99('0x42')](handleError(_0x1a8e7d,null));}; \ No newline at end of file +var _0x4a6a=['../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','VoiceRecording','rawAttributes','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','options','includeAll','include','findAll','rows','find','catch','create','body','update','params','describe','download','../../components/encryptor','uniqueid','value','format','%s.cypher','decryptFile','secrets','recording','existsSync','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','col','token','$and','push','Sequelize','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api'];(function(_0x2093a7,_0x54f485){var _0x43f928=function(_0x265b20){while(--_0x265b20){_0x2093a7['push'](_0x2093a7['shift']());}};_0x43f928(++_0x54f485);}(_0x4a6a,0x1e3));var _0xa4a6=function(_0xc5cf2b,_0x21f0b5){_0xc5cf2b=_0xc5cf2b-0x0;var _0x1f1681=_0x4a6a[_0xc5cf2b];return _0x1f1681;};'use strict';var pdf=require(_0xa4a6('0x0'));var emlformat=require(_0xa4a6('0x1'));var rimraf=require(_0xa4a6('0x2'));var zipdir=require(_0xa4a6('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa4a6('0x4'));var moment=require('moment');var BPromise=require(_0xa4a6('0x5'));var Mustache=require(_0xa4a6('0x6'));var util=require(_0xa4a6('0x7'));var path=require(_0xa4a6('0x8'));var sox=require(_0xa4a6('0x9'));var csv=require(_0xa4a6('0xa'));var ejs=require(_0xa4a6('0xb'));var fs=require('fs');var _=require(_0xa4a6('0xc'));var squel=require('squel');var crypto=require(_0xa4a6('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa4a6('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa4a6('0xf'));var Papa=require(_0xa4a6('0x10'));var Redis=require(_0xa4a6('0x11'));var authService=require(_0xa4a6('0x12'));var qs=require(_0xa4a6('0x13'));var hardwareService=require(_0xa4a6('0x14'));var logger=require('../../config/logger')(_0xa4a6('0x15'));var utils=require('../../config/utils');var config=require(_0xa4a6('0x16'));var db=require(_0xa4a6('0x17'))['db'];function respondWithStatusCode(_0x3cf359,_0x189a40){_0x189a40=_0x189a40||0xcc;return function(_0x62b346){if(_0x62b346){return _0x3cf359[_0xa4a6('0x18')](_0x189a40);}return _0x3cf359['status'](_0x189a40)[_0xa4a6('0x19')]();};}function respondWithResult(_0x6be13,_0x584a1d){_0x584a1d=_0x584a1d||0xc8;return function(_0x32ab4f){if(_0x32ab4f){return _0x6be13[_0xa4a6('0x1a')](_0x584a1d)[_0xa4a6('0x1b')](_0x32ab4f);}};}function respondWithFilteredResult(_0xabc5d5,_0x394046){return function(_0x5f09e7){if(_0x5f09e7){var _0x4f2a31=_0x5f09e7[_0xa4a6('0x1c')],_0x22f4b8=_0x394046[_0xa4a6('0x1d')],_0x4a8341=_0x394046[_0xa4a6('0x1d')]+_0x394046[_0xa4a6('0x1e')],_0x20c439;if(_0x4a8341>=_0x4f2a31){_0x4a8341=_0x4f2a31;_0x20c439=0xc8;}else{_0x20c439=0xce;}_0xabc5d5[_0xa4a6('0x1a')](_0x20c439);return _0xabc5d5[_0xa4a6('0x1f')](_0xa4a6('0x20'),_0x22f4b8+'-'+_0x4a8341+'/'+_0x4f2a31)[_0xa4a6('0x1b')](_0x5f09e7);}return null;};}function patchUpdates(_0x2c8899){return function(_0x1e2f0f){try{jsonpatch[_0xa4a6('0x21')](_0x1e2f0f,_0x2c8899,!![]);}catch(_0x156b36){return BPromise[_0xa4a6('0x22')](_0x156b36);}return _0x1e2f0f[_0xa4a6('0x23')]();};}function saveUpdates(_0x1ac262,_0x8a042f){return function(_0xc52676){if(_0xc52676){return _0xc52676['update'](_0x1ac262)[_0xa4a6('0x24')](function(_0x587ea7){return _0x587ea7;});}return null;};}function removeEntity(_0x2b482e,_0x5c333d){return function(_0x3a1da0){if(_0x3a1da0){return _0x3a1da0[_0xa4a6('0x25')]()[_0xa4a6('0x24')](function(){_0x2b482e[_0xa4a6('0x1a')](0xcc)[_0xa4a6('0x19')]();});}};}function handleEntityNotFound(_0x2ecf39,_0x46213f){return function(_0x23311f){if(!_0x23311f){_0x2ecf39[_0xa4a6('0x18')](0x194);}return _0x23311f;};}function handleError(_0x1c0024,_0x2245db){_0x2245db=_0x2245db||0x1f4;return function(_0x41cd5c){logger[_0xa4a6('0x26')](_0x41cd5c[_0xa4a6('0x27')]);if(_0x41cd5c[_0xa4a6('0x28')]){delete _0x41cd5c['name'];}_0x1c0024[_0xa4a6('0x1a')](_0x2245db)[_0xa4a6('0x29')](_0x41cd5c);};}exports[_0xa4a6('0x2a')]=function(_0x5dbebf,_0x6b6e75){var _0x2d7f6e={},_0x5e5512={},_0x2080a1={'count':0x0,'rows':[]};var _0x1ecc62=db[_0xa4a6('0x2b')][_0xa4a6('0x2c')];_0x5e5512['model']=_['differenceBy'](_[_0xa4a6('0x2d')](_0x1ecc62),['format']);_0x5e5512[_0xa4a6('0x2e')]=_[_0xa4a6('0x2d')](_0x5dbebf[_0xa4a6('0x2e')]);_0x5e5512['filters']=_[_0xa4a6('0x2f')](_0x5e5512[_0xa4a6('0x30')],_0x5e5512[_0xa4a6('0x2e')]);_0x2d7f6e[_0xa4a6('0x31')]=_[_0xa4a6('0x2f')](_0x5e5512[_0xa4a6('0x30')],qs[_0xa4a6('0x32')](_0x5dbebf['query'][_0xa4a6('0x32')]));_0x2d7f6e[_0xa4a6('0x31')]=_0x2d7f6e[_0xa4a6('0x31')][_0xa4a6('0x33')]?_0x2d7f6e['attributes']:_0x5e5512[_0xa4a6('0x30')];if(!_0x5dbebf['query'][_0xa4a6('0x34')](_0xa4a6('0x35'))){_0x2d7f6e[_0xa4a6('0x1e')]=qs[_0xa4a6('0x1e')](_0x5dbebf[_0xa4a6('0x2e')][_0xa4a6('0x1e')]);_0x2d7f6e[_0xa4a6('0x1d')]=qs[_0xa4a6('0x1d')](_0x5dbebf['query']['offset']);}_0x2d7f6e['order']=qs[_0xa4a6('0x36')](_0x5dbebf[_0xa4a6('0x2e')][_0xa4a6('0x36')]);_0x2d7f6e[_0xa4a6('0x37')]=qs[_0xa4a6('0x38')](_[_0xa4a6('0x39')](_0x5dbebf['query'],_0x5e5512[_0xa4a6('0x38')]));if(_0x5dbebf[_0xa4a6('0x2e')][_0xa4a6('0x3a')]){_0x2d7f6e[_0xa4a6('0x37')]=_[_0xa4a6('0x3b')](_0x2d7f6e[_0xa4a6('0x37')],{'$or':_[_0xa4a6('0x3c')](_0x1ecc62,function(_0x50924a){if(_0x50924a[_0xa4a6('0x3d')][_0xa4a6('0x3e')]!==_0xa4a6('0x3f')){var _0x38a190={};_0x38a190[_0x50924a['field']]={'$like':'%'+_0x5dbebf[_0xa4a6('0x2e')][_0xa4a6('0x3a')]+'%'};return _0x38a190;}})});}_0x2d7f6e=_[_0xa4a6('0x3b')]({},_0x2d7f6e,_0x5dbebf[_0xa4a6('0x40')]);var _0x4379d7={'where':_0x2d7f6e['where']};return db[_0xa4a6('0x2b')][_0xa4a6('0x1c')](_0x4379d7)[_0xa4a6('0x24')](function(_0x209bd1){_0x2080a1['count']=_0x209bd1;if(_0x5dbebf[_0xa4a6('0x2e')][_0xa4a6('0x41')]){_0x2d7f6e[_0xa4a6('0x42')]=[{'all':!![]}];}return db['VoiceRecording'][_0xa4a6('0x43')](_0x2d7f6e);})['then'](function(_0x4a0a1f){_0x2080a1[_0xa4a6('0x44')]=_0x4a0a1f;return _0x2080a1;})[_0xa4a6('0x24')](respondWithFilteredResult(_0x6b6e75,_0x2d7f6e))['catch'](handleError(_0x6b6e75,null));};exports['show']=function(_0x4e4a18,_0x92ad40){var _0x522211={'raw':![],'where':{'id':_0x4e4a18['params']['id']}},_0x2374cb={};_0x2374cb[_0xa4a6('0x30')]=_[_0xa4a6('0x2d')](db[_0xa4a6('0x2b')][_0xa4a6('0x2c')]);_0x2374cb['query']=_['keys'](_0x4e4a18[_0xa4a6('0x2e')]);_0x2374cb['filters']=_[_0xa4a6('0x2f')](_0x2374cb[_0xa4a6('0x30')],_0x2374cb['query']);_0x522211[_0xa4a6('0x31')]=_['intersection'](_0x2374cb['model'],qs[_0xa4a6('0x32')](_0x4e4a18[_0xa4a6('0x2e')]['fields']));_0x522211[_0xa4a6('0x31')]=_0x522211[_0xa4a6('0x31')][_0xa4a6('0x33')]?_0x522211[_0xa4a6('0x31')]:_0x2374cb[_0xa4a6('0x30')];if(_0x4e4a18['query'][_0xa4a6('0x41')]){_0x522211[_0xa4a6('0x42')]=[{'all':!![]}];}_0x522211=_[_0xa4a6('0x3b')]({},_0x522211,_0x4e4a18[_0xa4a6('0x40')]);return db[_0xa4a6('0x2b')][_0xa4a6('0x45')](_0x522211)[_0xa4a6('0x24')](handleEntityNotFound(_0x92ad40,null))['then'](respondWithResult(_0x92ad40,null))[_0xa4a6('0x46')](handleError(_0x92ad40,null));};exports[_0xa4a6('0x47')]=function(_0x1a95dc,_0x22bc48){return db['VoiceRecording'][_0xa4a6('0x47')](_0x1a95dc[_0xa4a6('0x48')],{})[_0xa4a6('0x24')](respondWithResult(_0x22bc48,0xc9))[_0xa4a6('0x46')](handleError(_0x22bc48,null));};exports[_0xa4a6('0x49')]=function(_0x22c2dd,_0x48959e){if(_0x22c2dd[_0xa4a6('0x48')]['id']){delete _0x22c2dd[_0xa4a6('0x48')]['id'];}return db['VoiceRecording'][_0xa4a6('0x45')]({'where':{'id':_0x22c2dd[_0xa4a6('0x4a')]['id']}})[_0xa4a6('0x24')](handleEntityNotFound(_0x48959e,null))['then'](saveUpdates(_0x22c2dd[_0xa4a6('0x48')],null))[_0xa4a6('0x24')](respondWithResult(_0x48959e,null))[_0xa4a6('0x46')](handleError(_0x48959e,null));};exports[_0xa4a6('0x25')]=function(_0x51f943,_0xeb807d){return db[_0xa4a6('0x2b')]['find']({'where':{'id':_0x51f943[_0xa4a6('0x4a')]['id']}})[_0xa4a6('0x24')](handleEntityNotFound(_0xeb807d,null))['then'](removeEntity(_0xeb807d,null))[_0xa4a6('0x46')](handleError(_0xeb807d,null));};exports[_0xa4a6('0x4b')]=function(_0x1d94fb,_0x46ce21){return db['VoiceRecording'][_0xa4a6('0x4b')]()[_0xa4a6('0x24')](respondWithResult(_0x46ce21,null))['catch'](handleError(_0x46ce21,null));};exports[_0xa4a6('0x4c')]=function(_0x148b9a,_0x17ff36,_0xf9d9e1){var _0x151ba7=require(_0xa4a6('0x4d'));var _0x3421fa=![];var _0x475b29={};if(_0x148b9a['query'][_0xa4a6('0x3d')]&&_0x148b9a['query'][_0xa4a6('0x3d')]===_0xa4a6('0x4e')){_0x475b29[_0xa4a6('0x4e')]=_0x148b9a[_0xa4a6('0x4a')]['id'];}else{_0x475b29['id']=_0x148b9a[_0xa4a6('0x4a')]['id'];}return db[_0xa4a6('0x2b')][_0xa4a6('0x45')]({'where':_0x475b29,'attributes':['id','value'],'raw':!![]})[_0xa4a6('0x24')](handleEntityNotFound(_0x17ff36,null))[_0xa4a6('0x24')](function(_0x2713af){if(_0x2713af){var _0xc88b95=_0x2713af[_0xa4a6('0x4f')];var _0x34085b=util[_0xa4a6('0x50')](_0xa4a6('0x51'),_0xc88b95);if(fs['existsSync'](_0x34085b)){_0x3421fa=!![];return _0x151ba7[_0xa4a6('0x52')](_0x34085b,_0xc88b95,config[_0xa4a6('0x53')][_0xa4a6('0x54')])[_0xa4a6('0x24')](function(){return _0x2713af;});}return _0x2713af;}})['then'](function(_0x544aca){if(_0x544aca){var _0x14ab0d=_0x544aca[_0xa4a6('0x4f')];if(!fs[_0xa4a6('0x55')](_0x14ab0d)){throw new db['Sequelize'][(_0xa4a6('0x56'))](_0xa4a6('0x57'));}if(_0x544aca[_0xa4a6('0x58')]){return _0x17ff36[_0xa4a6('0x4c')](_0x14ab0d,_0x544aca['filename']+path[_0xa4a6('0x59')](_0x14ab0d),function(){if(_0x3421fa){fs['unlink'](_0x14ab0d);}});}else{return _0x17ff36[_0xa4a6('0x4c')](_0x14ab0d,function(_0x360bba){if(_0x3421fa){fs[_0xa4a6('0x5a')](_0x14ab0d);}});}}})[_0xa4a6('0x46')](function(_0x50c0b7){if(_0x50c0b7[_0xa4a6('0x5b')]==='VoiceRecording\x20not\x20found'){_0x17ff36['status'](0x194)[_0xa4a6('0x29')](_0xa4a6('0x5c'));}else{return handleError(_0x17ff36,null);}});};exports[_0xa4a6('0x5d')]=function(_0x441b41,_0x207697,_0x1176fc){var _0x269d38=require('../../components/encryptor');var _0x4970d4=![];var _0x2a553d={'$and':[db[_0xa4a6('0x5e')]['where'](db[_0xa4a6('0x5e')]['fn'](_0xa4a6('0x5f'),db['sequelize'][_0xa4a6('0x60')]('uniqueid')),_0x441b41['query'][_0xa4a6('0x61')])]};if(_0x441b41['query'][_0xa4a6('0x3d')]&&_0x441b41[_0xa4a6('0x2e')]['type']===_0xa4a6('0x4e')){_0x2a553d[_0xa4a6('0x62')][_0xa4a6('0x63')]({'uniqueid':_0x441b41['params']['id']});}else{_0x2a553d['$and'][_0xa4a6('0x63')]({'id':_0x441b41[_0xa4a6('0x4a')]['id']});}return db[_0xa4a6('0x2b')]['find']({'where':_0x2a553d,'attributes':['id',_0xa4a6('0x4f')],'raw':!![]})[_0xa4a6('0x24')](handleEntityNotFound(_0x207697,null))[_0xa4a6('0x24')](function(_0x449589){if(_0x449589){var _0x984caa=util['format'](_0xa4a6('0x51'),_0x449589[_0xa4a6('0x4f')]);if(fs[_0xa4a6('0x55')](_0x984caa)){_0x4970d4=!![];return _0x269d38[_0xa4a6('0x52')](_0x984caa,_0x449589[_0xa4a6('0x4f')],config[_0xa4a6('0x53')][_0xa4a6('0x54')])['then'](function(){return _0x449589;});}return _0x449589;}})[_0xa4a6('0x24')](function(_0x487ca4){if(_0x487ca4){if(!fs[_0xa4a6('0x55')](_0x487ca4[_0xa4a6('0x4f')])){throw new db[(_0xa4a6('0x64'))][(_0xa4a6('0x56'))](_0xa4a6('0x57'));}if(_0x487ca4[_0xa4a6('0x58')]){return _0x207697['download'](_0x487ca4[_0xa4a6('0x4f')],_0x487ca4[_0xa4a6('0x58')]+path[_0xa4a6('0x59')](_0x487ca4['value']),function(){if(_0x4970d4){fs[_0xa4a6('0x5a')](_0x487ca4[_0xa4a6('0x4f')]);}});}else{return _0x207697['download'](_0x487ca4['value'],function(_0x514c73){if(_0x4970d4){fs[_0xa4a6('0x5a')](_0x487ca4[_0xa4a6('0x4f')]);}});}}})['catch'](handleError(_0x207697,null));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 295f3a8..2d0c60b 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 _0xd8a5=['moment','request-promise','rimraf','./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings','uniqueid','lodash','util','api'];(function(_0xec212b,_0x1c99ec){var _0x4e354e=function(_0xd329d9){while(--_0xd329d9){_0xec212b['push'](_0xec212b['shift']());}};_0x4e354e(++_0x1c99ec);}(_0xd8a5,0xa5));var _0x5d8a=function(_0x1fde18,_0x82ace){_0x1fde18=_0x1fde18-0x0;var _0x5063f5=_0xd8a5[_0x1fde18];return _0x5063f5;};'use strict';var _=require(_0x5d8a('0x0'));var util=require(_0x5d8a('0x1'));var logger=require('../../config/logger')(_0x5d8a('0x2'));var moment=require(_0x5d8a('0x3'));var BPromise=require('bluebird');var rp=require(_0x5d8a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5d8a('0x5'));var config=require('../../config/environment');var attributes=require(_0x5d8a('0x6'));module[_0x5d8a('0x7')]=function(_0x145a83,_0x588298){return _0x145a83[_0x5d8a('0x8')](_0x5d8a('0x9'),attributes,{'tableName':_0x5d8a('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x5d8a('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc169=['define','voice_recordings','uniqueid','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xc169,0x1dc));var _0x9c16=function(_0x571449,_0x7353c2){_0x571449=_0x571449-0x0;var _0x305bf6=_0xc169[_0x571449];return _0x305bf6;};'use strict';var _=require(_0x9c16('0x0'));var util=require(_0x9c16('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9c16('0x2'));var BPromise=require(_0x9c16('0x3'));var rp=require(_0x9c16('0x4'));var fs=require('fs');var path=require(_0x9c16('0x5'));var rimraf=require(_0x9c16('0x6'));var config=require(_0x9c16('0x7'));var attributes=require('./voiceRecording.attributes');module['exports']=function(_0x149ead,_0x3b539e){return _0x149ead[_0x9c16('0x8')]('VoiceRecording',attributes,{'tableName':_0x9c16('0x9'),'paranoid':![],'indexes':[{'name':_0x9c16('0xa'),'fields':[_0x9c16('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index b1a1514..4f61148 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 _0x5699=['debug','stringify','catch','CreateVoiceRecording','../../components/encryptor','callRecordingEncryption','create','body','value','format','encryptFile','recording','unlink','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','error','code','VoiceRecording,\x20%s,\x20%s','message','result','UpdateVoiceRecording','options','raw','where','limit'];(function(_0x345494,_0x42752e){var _0xc06241=function(_0x473dd2){while(--_0x473dd2){_0x345494['push'](_0x345494['shift']());}};_0xc06241(++_0x42752e);}(_0x5699,0xfd));var _0x9569=function(_0x4cb235,_0xe2d444){_0x4cb235=_0x4cb235-0x0;var _0x144ea3=_0x5699[_0x4cb235];return _0x144ea3;};'use strict';var _=require(_0x9569('0x0'));var util=require(_0x9569('0x1'));var moment=require(_0x9569('0x2'));var BPromise=require('bluebird');var rs=require(_0x9569('0x3'));var fs=require('fs');var Redis=require(_0x9569('0x4'));var db=require(_0x9569('0x5'))['db'];var utils=require(_0x9569('0x6'));var logger=require('../../config/logger')(_0x9569('0x7'));var config=require(_0x9569('0x8'));var jayson=require(_0x9569('0x9'));var client=jayson[_0x9569('0xa')][_0x9569('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1dc5cb,_0x420463,_0x2d1815){return new BPromise(function(_0x404863,_0x23f993){return client[_0x9569('0xc')](_0x1dc5cb,_0x2d1815)[_0x9569('0xd')](function(_0x1b3395){logger[_0x9569('0xe')]('VoiceRecording,\x20%s,\x20%s',_0x420463,_0x9569('0xf'));logger['debug'](_0x9569('0x10'),_0x420463,_0x9569('0xf'),JSON['stringify'](_0x1b3395));if(_0x1b3395[_0x9569('0x11')]){if(_0x1b3395['error'][_0x9569('0x12')]===0x1f4){logger[_0x9569('0x11')](_0x9569('0x13'),_0x420463,_0x1b3395[_0x9569('0x11')][_0x9569('0x14')]);return _0x23f993(_0x1b3395[_0x9569('0x11')][_0x9569('0x14')]);}logger[_0x9569('0x11')](_0x9569('0x13'),_0x420463,_0x1b3395[_0x9569('0x11')][_0x9569('0x14')]);return _0x404863(_0x1b3395[_0x9569('0x11')]['message']);}else{logger[_0x9569('0xe')](_0x9569('0x13'),_0x420463,_0x9569('0xf'));_0x404863(_0x1b3395[_0x9569('0x15')][_0x9569('0x14')]);}})['catch'](function(_0x2530db){logger[_0x9569('0x11')](_0x9569('0x13'),_0x420463,_0x2530db);_0x23f993(_0x2530db);});});}exports[_0x9569('0x16')]=function(_0x5de721){var _0x2b5433=this;return new Promise(function(_0x5c5c1f,_0xb6dc0){return db['VoiceRecording']['update'](_0x5de721['body'],{'raw':_0x5de721[_0x9569('0x17')]?_0x5de721[_0x9569('0x17')][_0x9569('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5de721[_0x9569('0x17')]?_0x5de721['options'][_0x9569('0x19')]||null:null,'attributes':_0x5de721['options']?_0x5de721['options']['attributes']||null:null,'limit':_0x5de721['options']?_0x5de721[_0x9569('0x17')][_0x9569('0x1a')]||null:null})['then'](function(_0x78d958){logger['info'](_0x9569('0x16'),_0x5de721);logger[_0x9569('0x1b')](_0x9569('0x16'),_0x5de721,JSON[_0x9569('0x1c')](_0x78d958));_0x5c5c1f(_0x78d958);})[_0x9569('0x1d')](function(_0x40e1dd){logger['error'](_0x9569('0x16'),_0x40e1dd['message'],_0x5de721);_0xb6dc0(_0x2b5433['error'](0x1f4,_0x40e1dd[_0x9569('0x14')]));});});};exports[_0x9569('0x1e')]=function(_0x39dc3e){var _0x4b5a69=this;return new Promise(function(_0x5c82d2,_0x4b4ccc){var _0x27e759=require(_0x9569('0x1f'));var _0x23413e;return db['Setting']['findOne']({'attributes':['id',_0x9569('0x20')],'where':{'id':0x1},'raw':!![]})[_0x9569('0xd')](function(_0x306564){_0x23413e=_0x306564;return db['VoiceRecording'][_0x9569('0x21')](_0x39dc3e[_0x9569('0x22')]);})[_0x9569('0xd')](function(_0x1ffda7){if(_0x23413e[_0x9569('0x20')]&&fs['existsSync'](_0x1ffda7[_0x9569('0x23')])){var _0x3f3b0e=util[_0x9569('0x24')]('%s.cypher',_0x1ffda7[_0x9569('0x23')]);return _0x27e759[_0x9569('0x25')](_0x1ffda7[_0x9569('0x23')],_0x3f3b0e,config['secrets'][_0x9569('0x26')])[_0x9569('0xd')](function(){fs[_0x9569('0x27')](_0x1ffda7[_0x9569('0x23')]);logger[_0x9569('0xe')]('CreateVoiceRecording\x20file\x20encrypted');return _0x1ffda7;});}return _0x1ffda7;})[_0x9569('0xd')](function(_0x20966c){logger[_0x9569('0xe')](_0x9569('0x1e'),_0x39dc3e);logger['debug']('CreateVoiceRecording',_0x39dc3e,JSON[_0x9569('0x1c')](_0x20966c));_0x5c82d2(_0x20966c);})[_0x9569('0x1d')](function(_0x58f98a){logger['error']('CreateVoiceRecording',_0x58f98a['message'],_0x39dc3e);_0x4b4ccc(_0x4b5a69[_0x9569('0x11')](0x1f4,_0x58f98a[_0x9569('0x14')]));});});}; \ No newline at end of file +var _0x25d4=['debug','request\x20sent','error','code','VoiceRecording,\x20%s,\x20%s','message','result','catch','UpdateVoiceRecording','body','options','raw','where','limit','stringify','CreateVoiceRecording','Setting','callRecordingEncryption','VoiceRecording','create','existsSync','value','%s.cypher','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x3724d7,_0x5740be){var _0x2059ca=function(_0x49982a){while(--_0x49982a){_0x3724d7['push'](_0x3724d7['shift']());}};_0x2059ca(++_0x5740be);}(_0x25d4,0xb1));var _0x425d=function(_0x28f679,_0x320209){_0x28f679=_0x28f679-0x0;var _0xe1d769=_0x25d4[_0x28f679];return _0xe1d769;};'use strict';var _=require(_0x425d('0x0'));var util=require(_0x425d('0x1'));var moment=require(_0x425d('0x2'));var BPromise=require(_0x425d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x425d('0x4'));var db=require(_0x425d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x425d('0x6'))('rpc');var config=require(_0x425d('0x7'));var jayson=require(_0x425d('0x8'));var client=jayson[_0x425d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3755b6,_0x5eab62,_0x3b1aec){return new BPromise(function(_0x5936ef,_0x5a1885){return client[_0x425d('0xa')](_0x3755b6,_0x3b1aec)[_0x425d('0xb')](function(_0x3df270){logger[_0x425d('0xc')]('VoiceRecording,\x20%s,\x20%s',_0x5eab62,'request\x20sent');logger[_0x425d('0xd')]('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x5eab62,_0x425d('0xe'),JSON['stringify'](_0x3df270));if(_0x3df270[_0x425d('0xf')]){if(_0x3df270[_0x425d('0xf')][_0x425d('0x10')]===0x1f4){logger[_0x425d('0xf')](_0x425d('0x11'),_0x5eab62,_0x3df270[_0x425d('0xf')][_0x425d('0x12')]);return _0x5a1885(_0x3df270[_0x425d('0xf')]['message']);}logger[_0x425d('0xf')](_0x425d('0x11'),_0x5eab62,_0x3df270[_0x425d('0xf')][_0x425d('0x12')]);return _0x5936ef(_0x3df270[_0x425d('0xf')][_0x425d('0x12')]);}else{logger[_0x425d('0xc')](_0x425d('0x11'),_0x5eab62,_0x425d('0xe'));_0x5936ef(_0x3df270[_0x425d('0x13')]['message']);}})[_0x425d('0x14')](function(_0x33c37a){logger[_0x425d('0xf')](_0x425d('0x11'),_0x5eab62,_0x33c37a);_0x5a1885(_0x33c37a);});});}exports[_0x425d('0x15')]=function(_0x3a81ad){var _0x42d92b=this;return new Promise(function(_0x1f1dd6,_0x1be86c){return db['VoiceRecording']['update'](_0x3a81ad[_0x425d('0x16')],{'raw':_0x3a81ad[_0x425d('0x17')]?_0x3a81ad[_0x425d('0x17')][_0x425d('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a81ad[_0x425d('0x17')]?_0x3a81ad[_0x425d('0x17')][_0x425d('0x19')]||null:null,'attributes':_0x3a81ad[_0x425d('0x17')]?_0x3a81ad[_0x425d('0x17')]['attributes']||null:null,'limit':_0x3a81ad[_0x425d('0x17')]?_0x3a81ad[_0x425d('0x17')][_0x425d('0x1a')]||null:null})[_0x425d('0xb')](function(_0x3cbb8e){logger[_0x425d('0xc')](_0x425d('0x15'),_0x3a81ad);logger[_0x425d('0xd')](_0x425d('0x15'),_0x3a81ad,JSON[_0x425d('0x1b')](_0x3cbb8e));_0x1f1dd6(_0x3cbb8e);})[_0x425d('0x14')](function(_0xae083f){logger[_0x425d('0xf')](_0x425d('0x15'),_0xae083f['message'],_0x3a81ad);_0x1be86c(_0x42d92b[_0x425d('0xf')](0x1f4,_0xae083f[_0x425d('0x12')]));});});};exports[_0x425d('0x1c')]=function(_0x265117){var _0xad1ed7=this;return new Promise(function(_0x434a62,_0x3332c8){var _0x10b6ea=require('../../components/encryptor');var _0xe62b86;return db[_0x425d('0x1d')]['findOne']({'attributes':['id',_0x425d('0x1e')],'where':{'id':0x1},'raw':!![]})[_0x425d('0xb')](function(_0xd0cff2){_0xe62b86=_0xd0cff2;return db[_0x425d('0x1f')][_0x425d('0x20')](_0x265117[_0x425d('0x16')]);})[_0x425d('0xb')](function(_0x49d372){if(_0xe62b86[_0x425d('0x1e')]&&fs[_0x425d('0x21')](_0x49d372[_0x425d('0x22')])){var _0x10b699=util['format'](_0x425d('0x23'),_0x49d372[_0x425d('0x22')]);return _0x10b6ea['encryptFile'](_0x49d372[_0x425d('0x22')],_0x10b699,config['secrets']['recording'])[_0x425d('0xb')](function(){fs[_0x425d('0x24')](_0x49d372['value']);logger[_0x425d('0xc')](_0x425d('0x25'));return _0x49d372;});}return _0x49d372;})['then'](function(_0x5d3c2c){logger[_0x425d('0xc')](_0x425d('0x1c'),_0x265117);logger[_0x425d('0xd')](_0x425d('0x1c'),_0x265117,JSON[_0x425d('0x1b')](_0x5d3c2c));_0x434a62(_0x5d3c2c);})[_0x425d('0x14')](function(_0x54df6a){logger['error'](_0x425d('0x1c'),_0x54df6a[_0x425d('0x12')],_0x265117);_0x3332c8(_0xad1ed7[_0x425d('0xf')](0x1f4,_0x54df6a[_0x425d('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 0ff44f0..3452ba5 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 _0x695d=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','index','/:id','show','post','isAuthenticated','create','put','update','destroy','multer','util'];(function(_0x4fc492,_0x59451a){var _0xeb17f3=function(_0x58a09d){while(--_0x58a09d){_0x4fc492['push'](_0x4fc492['shift']());}};_0xeb17f3(++_0x59451a);}(_0x695d,0xc6));var _0xd695=function(_0x4413a1,_0x55a868){_0x4413a1=_0x4413a1-0x0;var _0x184cf3=_0x695d[_0x4413a1];return _0x184cf3;};'use strict';var multer=require(_0xd695('0x0'));var util=require(_0xd695('0x1'));var path=require(_0xd695('0x2'));var timeout=require(_0xd695('0x3'));var express=require(_0xd695('0x4'));var router=express[_0xd695('0x5')]();var auth=require(_0xd695('0x6'));var interaction=require(_0xd695('0x7'));var config=require(_0xd695('0x8'));var controller=require(_0xd695('0x9'));router[_0xd695('0xa')]('/',auth['isAuthenticated'](),controller[_0xd695('0xb')]);router[_0xd695('0xa')](_0xd695('0xc'),auth['isAuthenticated'](),controller[_0xd695('0xd')]);router[_0xd695('0xe')]('/',auth[_0xd695('0xf')](),controller[_0xd695('0x10')]);router[_0xd695('0x11')]('/:id',auth[_0xd695('0xf')](),controller[_0xd695('0x12')]);router['delete'](_0xd695('0xc'),auth['isAuthenticated'](),controller[_0xd695('0x13')]);module['exports']=router; \ No newline at end of file +var _0x2490=['Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','update','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x3a454b,_0x44e177){var _0x4699af=function(_0x28264a){while(--_0x28264a){_0x3a454b['push'](_0x3a454b['shift']());}};_0x4699af(++_0x44e177);}(_0x2490,0x17c));var _0x0249=function(_0x27a38d,_0x1647e2){_0x27a38d=_0x27a38d-0x0;var _0x4b8448=_0x2490[_0x27a38d];return _0x4b8448;};'use strict';var multer=require('multer');var util=require(_0x0249('0x0'));var path=require(_0x0249('0x1'));var timeout=require(_0x0249('0x2'));var express=require(_0x0249('0x3'));var router=express[_0x0249('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x0249('0x5'));var config=require(_0x0249('0x6'));var controller=require('./voiceTransferReport.controller');router[_0x0249('0x7')]('/',auth[_0x0249('0x8')](),controller[_0x0249('0x9')]);router[_0x0249('0x7')](_0x0249('0xa'),auth[_0x0249('0x8')](),controller['show']);router[_0x0249('0xb')]('/',auth[_0x0249('0x8')](),controller['create']);router['put']('/:id',auth[_0x0249('0x8')](),controller[_0x0249('0xc')]);router[_0x0249('0xd')](_0x0249('0xa'),auth[_0x0249('0x8')](),controller[_0x0249('0xe')]);module[_0x0249('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 49878f1..58f7c1c 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 _0x71e6=['STRING','ENUM','Yes','sequelize','moment','exports','attended'];(function(_0x4c82ca,_0xaf78bf){var _0x143bdf=function(_0xc877a4){while(--_0xc877a4){_0x4c82ca['push'](_0x4c82ca['shift']());}};_0x143bdf(++_0xaf78bf);}(_0x71e6,0x1ed));var _0x671e=function(_0x27a6e3,_0x466699){_0x27a6e3=_0x27a6e3-0x0;var _0xc6e431=_0x71e6[_0x27a6e3];return _0xc6e431;};'use strict';var Sequelize=require(_0x671e('0x0'));var moment=require(_0x671e('0x1'));module[_0x671e('0x2')]={'type':{'type':Sequelize['ENUM']('blind',_0x671e('0x3'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x671e('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x671e('0x4')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0x671e('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0x671e('0x4')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x671e('0x4')]},'transfererexten':{'type':Sequelize[_0x671e('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x671e('0x4')]},'transfereechannel':{'type':Sequelize[_0x671e('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0x671e('0x4')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0x671e('0x4')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x671e('0x4')]},'transfereecontext':{'type':Sequelize[_0x671e('0x4')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0x671e('0x5')](_0x671e('0x6'),'No')},'context':{'type':Sequelize[_0x671e('0x4')]},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2b60=['exports','blind','attended','STRING','ENUM','Yes','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2b60,0x1db));var _0x02b6=function(_0x4ca712,_0x331444){_0x4ca712=_0x4ca712-0x0;var _0x5c1671=_0x2b60[_0x4ca712];return _0x5c1671;};'use strict';var Sequelize=require(_0x02b6('0x0'));var moment=require('moment');module[_0x02b6('0x1')]={'type':{'type':Sequelize['ENUM'](_0x02b6('0x2'),_0x02b6('0x3'))},'result':{'type':Sequelize[_0x02b6('0x4')]},'transfererchannel':{'type':Sequelize[_0x02b6('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x02b6('0x4')]},'transferercalleridname':{'type':Sequelize[_0x02b6('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0x02b6('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0x02b6('0x4')]},'transfereraccountcode':{'type':Sequelize[_0x02b6('0x4')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x02b6('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x02b6('0x4')]},'transfereechannel':{'type':Sequelize[_0x02b6('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0x02b6('0x4')]},'transfereecalleridname':{'type':Sequelize[_0x02b6('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0x02b6('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0x02b6('0x4')]},'transfereecontext':{'type':Sequelize[_0x02b6('0x4')]},'transfereeexten':{'type':Sequelize[_0x02b6('0x4')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0x02b6('0x5')](_0x02b6('0x6'),'No')},'context':{'type':Sequelize[_0x02b6('0x4')]},'extension':{'type':Sequelize[_0x02b6('0x4')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 95e1e55..fd0b3d5 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 _0x36e4=['VoiceTransferReport','include','findAll','catch','show','includeAll','merge','options','find','create','body','params','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','save','update','then','destroy','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','where','type','key','VIRTUAL','field'];(function(_0x57d91e,_0x46eba2){var _0x1b4096=function(_0xd0089c){while(--_0xd0089c){_0x57d91e['push'](_0x57d91e['shift']());}};_0x1b4096(++_0x46eba2);}(_0x36e4,0x1aa));var _0x436e=function(_0x444851,_0x42cdde){_0x444851=_0x444851-0x0;var _0x2bb7e4=_0x36e4[_0x444851];return _0x2bb7e4;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x436e('0x0'));var rp=require(_0x436e('0x1'));var moment=require('moment');var BPromise=require(_0x436e('0x2'));var Mustache=require(_0x436e('0x3'));var util=require(_0x436e('0x4'));var path=require('path');var sox=require(_0x436e('0x5'));var csv=require(_0x436e('0x6'));var ejs=require(_0x436e('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x436e('0x8'));var crypto=require(_0x436e('0x9'));var jsforce=require(_0x436e('0xa'));var deskjs=require(_0x436e('0xb'));var toCsv=require(_0x436e('0x6'));var querystring=require(_0x436e('0xc'));var Papa=require(_0x436e('0xd'));var Redis=require(_0x436e('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x436e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x436e('0x10'))(_0x436e('0x11'));var utils=require(_0x436e('0x12'));var config=require(_0x436e('0x13'));var db=require(_0x436e('0x14'))['db'];function respondWithStatusCode(_0x4d3d97,_0x5521ab){_0x5521ab=_0x5521ab||0xcc;return function(_0x57600b){if(_0x57600b){return _0x4d3d97[_0x436e('0x15')](_0x5521ab);}return _0x4d3d97[_0x436e('0x16')](_0x5521ab)[_0x436e('0x17')]();};}function respondWithResult(_0x1724ef,_0x34e211){_0x34e211=_0x34e211||0xc8;return function(_0x39edea){if(_0x39edea){return _0x1724ef[_0x436e('0x16')](_0x34e211)[_0x436e('0x18')](_0x39edea);}};}function respondWithFilteredResult(_0xe29d23,_0x1c9171){return function(_0x482e6e){if(_0x482e6e){var _0x54069=_0x482e6e[_0x436e('0x19')],_0x47aebc=_0x1c9171[_0x436e('0x1a')],_0x4c21c1=_0x1c9171[_0x436e('0x1a')]+_0x1c9171[_0x436e('0x1b')],_0x8b3f1f;if(_0x4c21c1>=_0x54069){_0x4c21c1=_0x54069;_0x8b3f1f=0xc8;}else{_0x8b3f1f=0xce;}_0xe29d23[_0x436e('0x16')](_0x8b3f1f);return _0xe29d23[_0x436e('0x1c')]('Content-Range',_0x47aebc+'-'+_0x4c21c1+'/'+_0x54069)[_0x436e('0x18')](_0x482e6e);}return null;};}function patchUpdates(_0x31f562){return function(_0x5c96f0){try{jsonpatch[_0x436e('0x1d')](_0x5c96f0,_0x31f562,!![]);}catch(_0x83ef1d){return BPromise['reject'](_0x83ef1d);}return _0x5c96f0[_0x436e('0x1e')]();};}function saveUpdates(_0x448b4c,_0x2b9d99){return function(_0x5d78ee){if(_0x5d78ee){return _0x5d78ee[_0x436e('0x1f')](_0x448b4c)[_0x436e('0x20')](function(_0x37465f){return _0x37465f;});}return null;};}function removeEntity(_0x1ce446,_0x2ce61f){return function(_0x4c2c11){if(_0x4c2c11){return _0x4c2c11[_0x436e('0x21')]()[_0x436e('0x20')](function(){_0x1ce446[_0x436e('0x16')](0xcc)[_0x436e('0x17')]();});}};}function handleEntityNotFound(_0x53bb07,_0x1d9250){return function(_0x18d1c2){if(!_0x18d1c2){_0x53bb07[_0x436e('0x15')](0x194);}return _0x18d1c2;};}function handleError(_0x1e5bac,_0x11f0dc){_0x11f0dc=_0x11f0dc||0x1f4;return function(_0x2243ea){logger[_0x436e('0x22')](_0x2243ea[_0x436e('0x23')]);if(_0x2243ea[_0x436e('0x24')]){delete _0x2243ea[_0x436e('0x24')];}_0x1e5bac['status'](_0x11f0dc)[_0x436e('0x25')](_0x2243ea);};}exports[_0x436e('0x26')]=function(_0x2a422b,_0x5a2e25){var _0x32889c={},_0x46f95a={},_0x36910d={'count':0x0,'rows':[]};var _0x470119=db['VoiceTransferReport'][_0x436e('0x27')];_0x46f95a[_0x436e('0x28')]=_[_0x436e('0x29')](_0x470119);_0x46f95a[_0x436e('0x2a')]=_[_0x436e('0x29')](_0x2a422b[_0x436e('0x2a')]);_0x46f95a[_0x436e('0x2b')]=_[_0x436e('0x2c')](_0x46f95a[_0x436e('0x28')],_0x46f95a[_0x436e('0x2a')]);_0x32889c[_0x436e('0x2d')]=_[_0x436e('0x2c')](_0x46f95a[_0x436e('0x28')],qs[_0x436e('0x2e')](_0x2a422b[_0x436e('0x2a')]['fields']));_0x32889c[_0x436e('0x2d')]=_0x32889c[_0x436e('0x2d')][_0x436e('0x2f')]?_0x32889c[_0x436e('0x2d')]:_0x46f95a['model'];if(!_0x2a422b[_0x436e('0x2a')]['hasOwnProperty'](_0x436e('0x30'))){_0x32889c[_0x436e('0x1b')]=qs[_0x436e('0x1b')](_0x2a422b[_0x436e('0x2a')][_0x436e('0x1b')]);_0x32889c['offset']=qs['offset'](_0x2a422b['query']['offset']);}_0x32889c[_0x436e('0x31')]=qs[_0x436e('0x32')](_0x2a422b['query'][_0x436e('0x32')]);_0x32889c['where']=qs['filters'](_['pick'](_0x2a422b[_0x436e('0x2a')],_0x46f95a[_0x436e('0x2b')]));if(_0x2a422b[_0x436e('0x2a')][_0x436e('0x33')]){_0x32889c[_0x436e('0x34')]=_['merge'](_0x32889c[_0x436e('0x34')],{'$or':_['map'](_0x470119,function(_0x39f3f7){if(_0x39f3f7[_0x436e('0x35')][_0x436e('0x36')]!==_0x436e('0x37')){var _0x577ce0={};_0x577ce0[_0x39f3f7[_0x436e('0x38')]]={'$like':'%'+_0x2a422b[_0x436e('0x2a')]['filter']+'%'};return _0x577ce0;}})});}_0x32889c=_['merge']({},_0x32889c,_0x2a422b['options']);var _0x10a9b8={'where':_0x32889c[_0x436e('0x34')]};return db[_0x436e('0x39')][_0x436e('0x19')](_0x10a9b8)[_0x436e('0x20')](function(_0xde65b4){_0x36910d[_0x436e('0x19')]=_0xde65b4;if(_0x2a422b['query']['includeAll']){_0x32889c[_0x436e('0x3a')]=[{'all':!![]}];}return db[_0x436e('0x39')][_0x436e('0x3b')](_0x32889c);})[_0x436e('0x20')](function(_0x168872){_0x36910d['rows']=_0x168872;return _0x36910d;})[_0x436e('0x20')](respondWithFilteredResult(_0x5a2e25,_0x32889c))[_0x436e('0x3c')](handleError(_0x5a2e25,null));};exports[_0x436e('0x3d')]=function(_0x5ff2f2,_0xb934b9){var _0x5c21f9={'raw':!![],'where':{'id':_0x5ff2f2['params']['id']}},_0x460572={};_0x460572[_0x436e('0x28')]=_[_0x436e('0x29')](db[_0x436e('0x39')]['rawAttributes']);_0x460572[_0x436e('0x2a')]=_[_0x436e('0x29')](_0x5ff2f2[_0x436e('0x2a')]);_0x460572[_0x436e('0x2b')]=_[_0x436e('0x2c')](_0x460572[_0x436e('0x28')],_0x460572[_0x436e('0x2a')]);_0x5c21f9[_0x436e('0x2d')]=_[_0x436e('0x2c')](_0x460572[_0x436e('0x28')],qs[_0x436e('0x2e')](_0x5ff2f2['query'][_0x436e('0x2e')]));_0x5c21f9[_0x436e('0x2d')]=_0x5c21f9[_0x436e('0x2d')][_0x436e('0x2f')]?_0x5c21f9[_0x436e('0x2d')]:_0x460572['model'];if(_0x5ff2f2['query'][_0x436e('0x3e')]){_0x5c21f9['include']=[{'all':!![]}];}_0x5c21f9=_[_0x436e('0x3f')]({},_0x5c21f9,_0x5ff2f2[_0x436e('0x40')]);return db[_0x436e('0x39')][_0x436e('0x41')](_0x5c21f9)[_0x436e('0x20')](handleEntityNotFound(_0xb934b9,null))[_0x436e('0x20')](respondWithResult(_0xb934b9,null))[_0x436e('0x3c')](handleError(_0xb934b9,null));};exports[_0x436e('0x42')]=function(_0xe1ef2c,_0x3e3000){return db[_0x436e('0x39')][_0x436e('0x42')](_0xe1ef2c['body'],{})[_0x436e('0x20')](respondWithResult(_0x3e3000,0xc9))[_0x436e('0x3c')](handleError(_0x3e3000,null));};exports[_0x436e('0x1f')]=function(_0x332b03,_0x4105b0){if(_0x332b03['body']['id']){delete _0x332b03[_0x436e('0x43')]['id'];}return db['VoiceTransferReport']['find']({'where':{'id':_0x332b03[_0x436e('0x44')]['id']}})[_0x436e('0x20')](handleEntityNotFound(_0x4105b0,null))['then'](saveUpdates(_0x332b03[_0x436e('0x43')],null))['then'](respondWithResult(_0x4105b0,null))[_0x436e('0x3c')](handleError(_0x4105b0,null));};exports[_0x436e('0x21')]=function(_0x143bc7,_0x3952e8){return db[_0x436e('0x39')][_0x436e('0x41')]({'where':{'id':_0x143bc7[_0x436e('0x44')]['id']}})['then'](handleEntityNotFound(_0x3952e8,null))['then'](removeEntity(_0x3952e8,null))['catch'](handleError(_0x3952e8,null));}; \ No newline at end of file +var _0x1def=['merge','type','key','VIRTUAL','field','options','include','findAll','rows','catch','show','fields','includeAll','find','create','body','params','destroy','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','sendStatus','stack','name','send','index','VoiceTransferReport','rawAttributes','model','keys','query','intersection','attributes','length','hasOwnProperty','sort','filters','filter','where'];(function(_0x1395c2,_0x2b3878){var _0xcb95d=function(_0x529efb){while(--_0x529efb){_0x1395c2['push'](_0x1395c2['shift']());}};_0xcb95d(++_0x2b3878);}(_0x1def,0x1d4));var _0xf1de=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x1def[_0x1035c1];return _0x308d67;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf1de('0x0'));var jsonpatch=require(_0xf1de('0x1'));var rp=require(_0xf1de('0x2'));var moment=require(_0xf1de('0x3'));var BPromise=require(_0xf1de('0x4'));var Mustache=require(_0xf1de('0x5'));var util=require(_0xf1de('0x6'));var path=require(_0xf1de('0x7'));var sox=require(_0xf1de('0x8'));var csv=require(_0xf1de('0x9'));var ejs=require(_0xf1de('0xa'));var fs=require('fs');var _=require(_0xf1de('0xb'));var squel=require(_0xf1de('0xc'));var crypto=require(_0xf1de('0xd'));var jsforce=require(_0xf1de('0xe'));var deskjs=require(_0xf1de('0xf'));var toCsv=require(_0xf1de('0x9'));var querystring=require(_0xf1de('0x10'));var Papa=require(_0xf1de('0x11'));var Redis=require(_0xf1de('0x12'));var authService=require(_0xf1de('0x13'));var qs=require(_0xf1de('0x14'));var hardwareService=require(_0xf1de('0x15'));var logger=require(_0xf1de('0x16'))(_0xf1de('0x17'));var utils=require(_0xf1de('0x18'));var config=require(_0xf1de('0x19'));var db=require(_0xf1de('0x1a'))['db'];function respondWithStatusCode(_0x5c25fd,_0x377606){_0x377606=_0x377606||0xcc;return function(_0x86b8d0){if(_0x86b8d0){return _0x5c25fd['sendStatus'](_0x377606);}return _0x5c25fd[_0xf1de('0x1b')](_0x377606)[_0xf1de('0x1c')]();};}function respondWithResult(_0x16c950,_0x7d20a6){_0x7d20a6=_0x7d20a6||0xc8;return function(_0x49b71d){if(_0x49b71d){return _0x16c950[_0xf1de('0x1b')](_0x7d20a6)[_0xf1de('0x1d')](_0x49b71d);}};}function respondWithFilteredResult(_0xe45893,_0x8032aa){return function(_0x3667d1){if(_0x3667d1){var _0x57bf5a=_0x3667d1[_0xf1de('0x1e')],_0x106e94=_0x8032aa[_0xf1de('0x1f')],_0x1a376a=_0x8032aa[_0xf1de('0x1f')]+_0x8032aa[_0xf1de('0x20')],_0xba8e9c;if(_0x1a376a>=_0x57bf5a){_0x1a376a=_0x57bf5a;_0xba8e9c=0xc8;}else{_0xba8e9c=0xce;}_0xe45893['status'](_0xba8e9c);return _0xe45893[_0xf1de('0x21')](_0xf1de('0x22'),_0x106e94+'-'+_0x1a376a+'/'+_0x57bf5a)['json'](_0x3667d1);}return null;};}function patchUpdates(_0x3468b6){return function(_0xd32d37){try{jsonpatch['apply'](_0xd32d37,_0x3468b6,!![]);}catch(_0x5c26be){return BPromise[_0xf1de('0x23')](_0x5c26be);}return _0xd32d37[_0xf1de('0x24')]();};}function saveUpdates(_0x4b060a,_0x3e0224){return function(_0x5e979c){if(_0x5e979c){return _0x5e979c[_0xf1de('0x25')](_0x4b060a)[_0xf1de('0x26')](function(_0x3d6b1c){return _0x3d6b1c;});}return null;};}function removeEntity(_0x986266,_0x40fa00){return function(_0x3bee88){if(_0x3bee88){return _0x3bee88['destroy']()[_0xf1de('0x26')](function(){_0x986266['status'](0xcc)[_0xf1de('0x1c')]();});}};}function handleEntityNotFound(_0x5a0d91,_0xec1eae){return function(_0x3ba787){if(!_0x3ba787){_0x5a0d91[_0xf1de('0x27')](0x194);}return _0x3ba787;};}function handleError(_0x205c47,_0x3f58a2){_0x3f58a2=_0x3f58a2||0x1f4;return function(_0x3ee108){logger['error'](_0x3ee108[_0xf1de('0x28')]);if(_0x3ee108[_0xf1de('0x29')]){delete _0x3ee108[_0xf1de('0x29')];}_0x205c47[_0xf1de('0x1b')](_0x3f58a2)[_0xf1de('0x2a')](_0x3ee108);};}exports[_0xf1de('0x2b')]=function(_0x4f91f1,_0x37218a){var _0x3fc05a={},_0x32f13f={},_0x1cc78a={'count':0x0,'rows':[]};var _0x17c381=db[_0xf1de('0x2c')][_0xf1de('0x2d')];_0x32f13f[_0xf1de('0x2e')]=_[_0xf1de('0x2f')](_0x17c381);_0x32f13f[_0xf1de('0x30')]=_['keys'](_0x4f91f1[_0xf1de('0x30')]);_0x32f13f['filters']=_['intersection'](_0x32f13f[_0xf1de('0x2e')],_0x32f13f[_0xf1de('0x30')]);_0x3fc05a['attributes']=_[_0xf1de('0x31')](_0x32f13f[_0xf1de('0x2e')],qs['fields'](_0x4f91f1[_0xf1de('0x30')]['fields']));_0x3fc05a[_0xf1de('0x32')]=_0x3fc05a[_0xf1de('0x32')][_0xf1de('0x33')]?_0x3fc05a[_0xf1de('0x32')]:_0x32f13f['model'];if(!_0x4f91f1['query'][_0xf1de('0x34')]('nolimit')){_0x3fc05a['limit']=qs[_0xf1de('0x20')](_0x4f91f1['query']['limit']);_0x3fc05a[_0xf1de('0x1f')]=qs[_0xf1de('0x1f')](_0x4f91f1[_0xf1de('0x30')]['offset']);}_0x3fc05a['order']=qs[_0xf1de('0x35')](_0x4f91f1[_0xf1de('0x30')][_0xf1de('0x35')]);_0x3fc05a['where']=qs['filters'](_['pick'](_0x4f91f1['query'],_0x32f13f[_0xf1de('0x36')]));if(_0x4f91f1['query'][_0xf1de('0x37')]){_0x3fc05a[_0xf1de('0x38')]=_[_0xf1de('0x39')](_0x3fc05a[_0xf1de('0x38')],{'$or':_['map'](_0x17c381,function(_0x4cb642){if(_0x4cb642[_0xf1de('0x3a')][_0xf1de('0x3b')]!==_0xf1de('0x3c')){var _0xdff4fc={};_0xdff4fc[_0x4cb642[_0xf1de('0x3d')]]={'$like':'%'+_0x4f91f1[_0xf1de('0x30')][_0xf1de('0x37')]+'%'};return _0xdff4fc;}})});}_0x3fc05a=_[_0xf1de('0x39')]({},_0x3fc05a,_0x4f91f1[_0xf1de('0x3e')]);var _0x1fbfaa={'where':_0x3fc05a[_0xf1de('0x38')]};return db[_0xf1de('0x2c')][_0xf1de('0x1e')](_0x1fbfaa)['then'](function(_0x3def5e){_0x1cc78a['count']=_0x3def5e;if(_0x4f91f1['query']['includeAll']){_0x3fc05a[_0xf1de('0x3f')]=[{'all':!![]}];}return db[_0xf1de('0x2c')][_0xf1de('0x40')](_0x3fc05a);})[_0xf1de('0x26')](function(_0x5b5de4){_0x1cc78a[_0xf1de('0x41')]=_0x5b5de4;return _0x1cc78a;})[_0xf1de('0x26')](respondWithFilteredResult(_0x37218a,_0x3fc05a))[_0xf1de('0x42')](handleError(_0x37218a,null));};exports[_0xf1de('0x43')]=function(_0x2c31c6,_0x4d493c){var _0x1b4283={'raw':!![],'where':{'id':_0x2c31c6['params']['id']}},_0x232b20={};_0x232b20[_0xf1de('0x2e')]=_['keys'](db[_0xf1de('0x2c')][_0xf1de('0x2d')]);_0x232b20['query']=_[_0xf1de('0x2f')](_0x2c31c6[_0xf1de('0x30')]);_0x232b20[_0xf1de('0x36')]=_[_0xf1de('0x31')](_0x232b20['model'],_0x232b20['query']);_0x1b4283[_0xf1de('0x32')]=_[_0xf1de('0x31')](_0x232b20['model'],qs['fields'](_0x2c31c6['query'][_0xf1de('0x44')]));_0x1b4283[_0xf1de('0x32')]=_0x1b4283[_0xf1de('0x32')][_0xf1de('0x33')]?_0x1b4283['attributes']:_0x232b20[_0xf1de('0x2e')];if(_0x2c31c6[_0xf1de('0x30')][_0xf1de('0x45')]){_0x1b4283[_0xf1de('0x3f')]=[{'all':!![]}];}_0x1b4283=_[_0xf1de('0x39')]({},_0x1b4283,_0x2c31c6[_0xf1de('0x3e')]);return db['VoiceTransferReport'][_0xf1de('0x46')](_0x1b4283)['then'](handleEntityNotFound(_0x4d493c,null))['then'](respondWithResult(_0x4d493c,null))[_0xf1de('0x42')](handleError(_0x4d493c,null));};exports[_0xf1de('0x47')]=function(_0x1e159a,_0x3b7331){return db[_0xf1de('0x2c')]['create'](_0x1e159a['body'],{})[_0xf1de('0x26')](respondWithResult(_0x3b7331,0xc9))[_0xf1de('0x42')](handleError(_0x3b7331,null));};exports[_0xf1de('0x25')]=function(_0x4e031d,_0x23fea1){if(_0x4e031d[_0xf1de('0x48')]['id']){delete _0x4e031d[_0xf1de('0x48')]['id'];}return db[_0xf1de('0x2c')][_0xf1de('0x46')]({'where':{'id':_0x4e031d[_0xf1de('0x49')]['id']}})['then'](handleEntityNotFound(_0x23fea1,null))['then'](saveUpdates(_0x4e031d[_0xf1de('0x48')],null))[_0xf1de('0x26')](respondWithResult(_0x23fea1,null))[_0xf1de('0x42')](handleError(_0x23fea1,null));};exports[_0xf1de('0x4a')]=function(_0x107c45,_0x70879b){return db['VoiceTransferReport'][_0xf1de('0x46')]({'where':{'id':_0x107c45['params']['id']}})[_0xf1de('0x26')](handleEntityNotFound(_0x70879b,null))[_0xf1de('0x26')](removeEntity(_0x70879b,null))[_0xf1de('0x42')](handleError(_0x70879b,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 8ef931e..0bf759c 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 _0x27dd=['api','moment','bluebird','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','lodash','../../config/logger'];(function(_0x21a96a,_0x75e2d6){var _0x1d6986=function(_0x2a3f8d){while(--_0x2a3f8d){_0x21a96a['push'](_0x21a96a['shift']());}};_0x1d6986(++_0x75e2d6);}(_0x27dd,0x142));var _0xd27d=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x27dd[_0x39096d];return _0x13da4f;};'use strict';var _=require(_0xd27d('0x0'));var util=require('util');var logger=require(_0xd27d('0x1'))(_0xd27d('0x2'));var moment=require(_0xd27d('0x3'));var BPromise=require(_0xd27d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd27d('0x5'));var rimraf=require(_0xd27d('0x6'));var config=require(_0xd27d('0x7'));var attributes=require(_0xd27d('0x8'));module[_0xd27d('0x9')]=function(_0x342154,_0x5ab19d){return _0x342154[_0xd27d('0xa')](_0xd27d('0xb'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb871=['VoiceTransferReport','lodash','util','../../config/logger','api','moment','path','../../config/environment','exports','define'];(function(_0x4d951c,_0x3a64b7){var _0x45b142=function(_0x5d00fe){while(--_0x5d00fe){_0x4d951c['push'](_0x4d951c['shift']());}};_0x45b142(++_0x3a64b7);}(_0xb871,0x6f));var _0x1b87=function(_0x35e54a,_0x46953a){_0x35e54a=_0x35e54a-0x0;var _0x35c2b0=_0xb871[_0x35e54a];return _0x35c2b0;};'use strict';var _=require(_0x1b87('0x0'));var util=require(_0x1b87('0x1'));var logger=require(_0x1b87('0x2'))(_0x1b87('0x3'));var moment=require(_0x1b87('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1b87('0x5'));var rimraf=require('rimraf');var config=require(_0x1b87('0x6'));var attributes=require('./voiceTransferReport.attributes');module[_0x1b87('0x7')]=function(_0x5e89e4,_0x3b665e){return _0x5e89e4[_0x1b87('0x8')](_0x1b87('0x9'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 3f76b90..1e9b0ed 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 _0x7151=['stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','message','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options'];(function(_0x119112,_0x49ba1f){var _0x45a6b9=function(_0x2b0985){while(--_0x2b0985){_0x119112['push'](_0x119112['shift']());}};_0x45a6b9(++_0x49ba1f);}(_0x7151,0x105));var _0x1715=function(_0x2e092e,_0x1bbef3){_0x2e092e=_0x2e092e-0x0;var _0x4d4f52=_0x7151[_0x2e092e];return _0x4d4f52;};'use strict';var _=require(_0x1715('0x0'));var util=require('util');var moment=require(_0x1715('0x1'));var BPromise=require(_0x1715('0x2'));var rs=require(_0x1715('0x3'));var fs=require('fs');var Redis=require(_0x1715('0x4'));var db=require(_0x1715('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1715('0x6'))(_0x1715('0x7'));var config=require('../../config/environment');var jayson=require(_0x1715('0x8'));var client=jayson[_0x1715('0x9')][_0x1715('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x274471,_0x1a9e52,_0xde6d30){return new BPromise(function(_0x1dc74c,_0x187b5d){return client['request'](_0x274471,_0xde6d30)[_0x1715('0xb')](function(_0x3d4cc4){logger[_0x1715('0xc')](_0x1715('0xd'),_0x1a9e52,_0x1715('0xe'));logger[_0x1715('0xf')](_0x1715('0x10'),_0x1a9e52,_0x1715('0xe'),JSON['stringify'](_0x3d4cc4));if(_0x3d4cc4['error']){if(_0x3d4cc4['error']['code']===0x1f4){logger[_0x1715('0x11')](_0x1715('0xd'),_0x1a9e52,_0x3d4cc4['error']['message']);return _0x187b5d(_0x3d4cc4[_0x1715('0x11')][_0x1715('0x12')]);}logger[_0x1715('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x1a9e52,_0x3d4cc4[_0x1715('0x11')]['message']);return _0x1dc74c(_0x3d4cc4[_0x1715('0x11')]['message']);}else{logger[_0x1715('0xc')](_0x1715('0xd'),_0x1a9e52,'request\x20sent');_0x1dc74c(_0x3d4cc4['result']['message']);}})[_0x1715('0x13')](function(_0x169bea){logger[_0x1715('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x1a9e52,_0x169bea);_0x187b5d(_0x169bea);});});}exports[_0x1715('0x14')]=function(_0x3b278a){var _0x3a9256=this;return new Promise(function(_0x39afd6,_0x52176e){return db[_0x1715('0x15')][_0x1715('0x16')](_0x3b278a[_0x1715('0x17')],{'raw':_0x3b278a[_0x1715('0x18')]?_0x3b278a['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x415d36){logger['info'](_0x1715('0x14'),_0x3b278a);logger[_0x1715('0xf')](_0x1715('0x14'),_0x3b278a,JSON[_0x1715('0x19')](_0x415d36));_0x39afd6(_0x415d36);})[_0x1715('0x13')](function(_0x50741a){logger[_0x1715('0x11')]('CreateVoiceTransferReport',_0x50741a[_0x1715('0x12')],_0x3b278a);_0x52176e(_0x3a9256[_0x1715('0x11')](0x1f4,_0x50741a['message']));});});}; \ No newline at end of file +var _0xa1c1=['stringify','error','code','message','result','CreateVoiceTransferReport','VoiceTransferReport','options','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x4efb6,_0x44e1ea){var _0x23b346=function(_0xa4aa0f){while(--_0xa4aa0f){_0x4efb6['push'](_0x4efb6['shift']());}};_0x23b346(++_0x44e1ea);}(_0xa1c1,0xb8));var _0x1a1c=function(_0x20af15,_0x1e0f52){_0x20af15=_0x20af15-0x0;var _0x2c7b91=_0xa1c1[_0x20af15];return _0x2c7b91;};'use strict';var _=require('lodash');var util=require(_0x1a1c('0x0'));var moment=require(_0x1a1c('0x1'));var BPromise=require(_0x1a1c('0x2'));var rs=require(_0x1a1c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1a1c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1a1c('0x5'))('rpc');var config=require(_0x1a1c('0x6'));var jayson=require(_0x1a1c('0x7'));var client=jayson['client'][_0x1a1c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5e94aa,_0x466b43,_0x117028){return new BPromise(function(_0x3473b0,_0x3ab847){return client[_0x1a1c('0x9')](_0x5e94aa,_0x117028)[_0x1a1c('0xa')](function(_0x328924){logger[_0x1a1c('0xb')](_0x1a1c('0xc'),_0x466b43,_0x1a1c('0xd'));logger[_0x1a1c('0xe')](_0x1a1c('0xf'),_0x466b43,_0x1a1c('0xd'),JSON[_0x1a1c('0x10')](_0x328924));if(_0x328924[_0x1a1c('0x11')]){if(_0x328924[_0x1a1c('0x11')][_0x1a1c('0x12')]===0x1f4){logger[_0x1a1c('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x466b43,_0x328924[_0x1a1c('0x11')][_0x1a1c('0x13')]);return _0x3ab847(_0x328924['error'][_0x1a1c('0x13')]);}logger[_0x1a1c('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x466b43,_0x328924[_0x1a1c('0x11')][_0x1a1c('0x13')]);return _0x3473b0(_0x328924['error'][_0x1a1c('0x13')]);}else{logger['info'](_0x1a1c('0xc'),_0x466b43,_0x1a1c('0xd'));_0x3473b0(_0x328924[_0x1a1c('0x14')][_0x1a1c('0x13')]);}})['catch'](function(_0x268ab8){logger[_0x1a1c('0x11')](_0x1a1c('0xc'),_0x466b43,_0x268ab8);_0x3ab847(_0x268ab8);});});}exports[_0x1a1c('0x15')]=function(_0x275504){var _0x127fc7=this;return new Promise(function(_0x855c7c,_0x3349bb){return db[_0x1a1c('0x16')]['create'](_0x275504['body'],{'raw':_0x275504[_0x1a1c('0x17')]?_0x275504[_0x1a1c('0x17')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x53087e){logger[_0x1a1c('0xb')](_0x1a1c('0x15'),_0x275504);logger[_0x1a1c('0xe')](_0x1a1c('0x15'),_0x275504,JSON[_0x1a1c('0x10')](_0x53087e));_0x855c7c(_0x53087e);})[_0x1a1c('0x18')](function(_0x2d20ac){logger['error']('CreateVoiceTransferReport',_0x2d20ac[_0x1a1c('0x13')],_0x275504);_0x3349bb(_0x127fc7['error'](0x1f4,_0x2d20ac['message']));});});}; \ No newline at end of file diff --git a/server/app.js b/server/app.js index 808af6f..d720f4f 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x635e=['default','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./mysqldb','./rpc','./config/logger','./config/pm2/config','./config/schedule','sequelize','sync','listen','then','info','start','Online\x20apps:','map','filter','online','name','join','Offline\x20apps:','status','None'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x635e,0xdc));var _0xe635=function(_0x2290a9,_0x212aaf){_0x2290a9=_0x2290a9-0x0;var _0x193dab=_0x635e[_0x2290a9];return _0x193dab;};'use strict';var _=require('lodash');var mysqldb=require(_0xe635('0x0'));var rpc=require(_0xe635('0x1'));var config=require('./config/environment');var logger=require(_0xe635('0x2'))('app');var pm2=require('./config/pm2');var pm2Config=require(_0xe635('0x3'));var schedule=require(_0xe635('0x4'));var chat=require('./config/schedule/chat');function main(){return mysqldb['db'][_0xe635('0x5')][_0xe635('0x6')]()['then'](function(){return rpc[_0xe635('0x7')]();})[_0xe635('0x8')](function(_0x5eea1e){logger[_0xe635('0x9')](_0x5eea1e);return chat[_0xe635('0xa')]();})['then'](function(){return schedule[_0xe635('0xa')]();})['then'](function(_0x45269b){logger[_0xe635('0x9')](_0x45269b);return pm2[_0xe635('0xa')](pm2Config);})[_0xe635('0x8')](function(_0x3b63a7){logger[_0xe635('0x9')](_0xe635('0xb'),_[_0xe635('0xc')](_[_0xe635('0xd')](_0x3b63a7,{'status':_0xe635('0xe')}),_0xe635('0xf'))[_0xe635('0x10')]());logger[_0xe635('0x9')](_0xe635('0x11'),_[_0xe635('0xc')](_[_0xe635('0xd')](_0x3b63a7,function(_0x2e5fe6){return _0x2e5fe6[_0xe635('0x12')]!==_0xe635('0xe');}),'name')[_0xe635('0x10')]()||_0xe635('0x13'));config['seedDB']&&require('./config/seedDB')[_0xe635('0x14')]();require('./config/license')['default']();})['catch'](function(_0x3e2fb7){logger[_0xe635('0x15')](_0xe635('0x16'),_0x3e2fb7);process[_0xe635('0x17')](0x1);});}main(); \ No newline at end of file +var _0xe1be=['./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','sequelize','then','listen','start','info','Online\x20apps:','online','name','join','map','status','seedDB','./config/seedDB','default','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash'];(function(_0x7f98b6,_0x2c2e8c){var _0x215a05=function(_0x1ba6b7){while(--_0x1ba6b7){_0x7f98b6['push'](_0x7f98b6['shift']());}};_0x215a05(++_0x2c2e8c);}(_0xe1be,0x117));var _0xee1b=function(_0x23d575,_0x298cac){_0x23d575=_0x23d575-0x0;var _0x271302=_0xe1be[_0x23d575];return _0x271302;};'use strict';var _=require(_0xee1b('0x0'));var mysqldb=require(_0xee1b('0x1'));var rpc=require(_0xee1b('0x2'));var config=require(_0xee1b('0x3'));var logger=require(_0xee1b('0x4'))(_0xee1b('0x5'));var pm2=require(_0xee1b('0x6'));var pm2Config=require(_0xee1b('0x7'));var schedule=require(_0xee1b('0x8'));var chat=require(_0xee1b('0x9'));function main(){return mysqldb['db'][_0xee1b('0xa')]['sync']()[_0xee1b('0xb')](function(){return rpc[_0xee1b('0xc')]();})[_0xee1b('0xb')](function(_0x43e304){logger['info'](_0x43e304);return chat[_0xee1b('0xd')]();})[_0xee1b('0xb')](function(){return schedule[_0xee1b('0xd')]();})[_0xee1b('0xb')](function(_0x4215e7){logger[_0xee1b('0xe')](_0x4215e7);return pm2['start'](pm2Config);})[_0xee1b('0xb')](function(_0x1b452d){logger[_0xee1b('0xe')](_0xee1b('0xf'),_['map'](_['filter'](_0x1b452d,{'status':_0xee1b('0x10')}),_0xee1b('0x11'))[_0xee1b('0x12')]());logger[_0xee1b('0xe')]('Offline\x20apps:',_[_0xee1b('0x13')](_['filter'](_0x1b452d,function(_0x420a8d){return _0x420a8d[_0xee1b('0x14')]!=='online';}),_0xee1b('0x11'))[_0xee1b('0x12')]()||'None');config[_0xee1b('0x15')]&&require(_0xee1b('0x16'))[_0xee1b('0x17')]();require('./config/license')['default']();})[_0xee1b('0x18')](function(_0x3dc7a6){logger[_0xee1b('0x19')](_0xee1b('0x1a'),_0x3dc7a6);process[_0xee1b('0x1b')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 4f1c5ae..94f695b 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 _0xba95=['basic-auth','crypto','ipaddr.js','secrets','session','role','fullname','name','internal','email','userpic','permissions','voicePause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','phoneBarRemoteControlPort','phoneBarRemoteControl','interface','userProfileId','isChatInteractionAuthorized','user','ChatInteraction','findOne','params','closed','disposition','then','status','unmanaged','Unmanaged.','Forbidden.','use','headers','authorization','startsWith','User','find','authenticate','pass','json','Wrong\x20credentials.','catch','Bearer','Unknown\x20authorization\x20format','query','apikey','verify','getUuid','sub','isEqual','apiKeyNonce','nonce','log','Unrecognized\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','isAuthenticated','../../config/license/util','getLicense','update','Forbidden','canUpdate','sign','signToken','userRoles','isMiddleware','cookie','motion.token','motion.user','stringify','redirect','/dashboards/general','isNil','apiKeyIat','randomBytes','toString','now','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','HS512','lodash','express-jwt'];(function(_0x237404,_0x55b81f){var _0xea3a05=function(_0x13e01c){while(--_0x13e01c){_0x237404['push'](_0x237404['shift']());}};_0xea3a05(++_0x55b81f);}(_0xba95,0x1ac));var _0x5ba9=function(_0x518980,_0x3c0c1b){_0x518980=_0x518980-0x0;var _0x190962=_0xba95[_0x518980];return _0x190962;};'use strict';var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var hardwareConf=require('../../config/license/hardware');var _=require(_0x5ba9('0x0'));var jwt=require('jsonwebtoken');var expressJwt=require(_0x5ba9('0x1'));var compose=require('composable-middleware');var basicAuth=require(_0x5ba9('0x2'));var crypto=require(_0x5ba9('0x3'));var ipaddr=require(_0x5ba9('0x4'));var validateJwt=expressJwt({'secret':config[_0x5ba9('0x5')][_0x5ba9('0x6')]});var userAttributes=['id',_0x5ba9('0x7'),_0x5ba9('0x8'),_0x5ba9('0x9'),_0x5ba9('0xa'),_0x5ba9('0xb'),_0x5ba9('0xc'),_0x5ba9('0xd'),_0x5ba9('0xe'),'chatPause',_0x5ba9('0xf'),_0x5ba9('0x10'),_0x5ba9('0x11'),_0x5ba9('0x12'),_0x5ba9('0x13'),_0x5ba9('0x14'),_0x5ba9('0x15'),_0x5ba9('0x16'),_0x5ba9('0x17'),_0x5ba9('0x18')];exports[_0x5ba9('0x19')]=function(){return isAuthenticated(!![])['use'](function(_0x2d0b7e,_0x144e99,_0x29cf78){if(_0x2d0b7e[_0x5ba9('0x1a')]){_0x29cf78();}else{return db[_0x5ba9('0x1b')][_0x5ba9('0x1c')]({'where':{'id':_0x2d0b7e[_0x5ba9('0x1d')]['id']},'attributes':['id',_0x5ba9('0x1e'),_0x5ba9('0x1f')],'raw':!![]})[_0x5ba9('0x20')](function(_0xa143bd){if(_0xa143bd&&_0xa143bd['closed']){return _0x144e99[_0x5ba9('0x21')](_0xa143bd[_0x5ba9('0x1f')]===_0x5ba9('0x22')?0x195:0x193)['json']({'message':_0xa143bd[_0x5ba9('0x1f')]==='unmanaged'?_0x5ba9('0x23'):_0x5ba9('0x24')});}else{_0x29cf78();}})['catch'](function(_0x1e8a90){_0x29cf78(_0x1e8a90);});}});};function isAuthenticated(_0x4c9ad9){return compose()[_0x5ba9('0x25')](function(_0x526c82,_0x464549,_0x41f574){if(_0x526c82[_0x5ba9('0x26')][_0x5ba9('0x27')]){if(_[_0x5ba9('0x28')](_0x526c82['headers'][_0x5ba9('0x27')],'Basic')){var _0x4aca42=basicAuth(_0x526c82);db[_0x5ba9('0x29')][_0x5ba9('0x2a')]({'where':{'name':_0x4aca42[_0x5ba9('0x9')]}})[_0x5ba9('0x20')](function(_0x470833){if(!_0x470833||!_0x470833[_0x5ba9('0x2b')](_0x4aca42[_0x5ba9('0x2c')])){return _0x464549[_0x5ba9('0x21')](0x191)[_0x5ba9('0x2d')]({'message':_0x5ba9('0x2e')});}_0x526c82[_0x5ba9('0x1a')]={'id':_0x470833['id']};_0x41f574();})[_0x5ba9('0x2f')](function(_0x463b3d){_0x41f574(_0x463b3d);});}else if(_['startsWith'](_0x526c82['headers'][_0x5ba9('0x27')],_0x5ba9('0x30'))){validateJwt(_0x526c82,_0x464549,_0x41f574);}else{if(_0x4c9ad9){_0x41f574();}else{return _0x464549[_0x5ba9('0x21')](0x193)[_0x5ba9('0x2d')]({'message':_0x5ba9('0x31')});}}}else if(_0x526c82[_0x5ba9('0x32')][_0x5ba9('0x33')]){try{var _0xf723b3=jwt[_0x5ba9('0x34')](_0x526c82[_0x5ba9('0x32')]['apikey'],config['secrets']['session'],{'audience':hardwareConf[_0x5ba9('0x35')](),'issuer':hardwareConf[_0x5ba9('0x35')]()});db['User']['find']({'where':{'id':_0xf723b3[_0x5ba9('0x36')]}})[_0x5ba9('0x20')](function(_0x3c9207){if(!_0x3c9207||!_[_0x5ba9('0x37')](_0x3c9207[_0x5ba9('0x38')],_0xf723b3[_0x5ba9('0x39')])){return _0x464549[_0x5ba9('0x21')](0x193)[_0x5ba9('0x2d')]({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}_0x526c82[_0x5ba9('0x1a')]={'id':_0x3c9207['id']};_0x41f574();})[_0x5ba9('0x2f')](function(_0x161d70){_0x41f574(_0x161d70);});}catch(_0x19a743){console[_0x5ba9('0x3a')](_0x19a743);return _0x464549['status'](0x193)[_0x5ba9('0x2d')]({'message':_0x5ba9('0x3b')});}}else if(_0x4c9ad9){_0x41f574();}else{return _0x464549[_0x5ba9('0x21')](0x193)[_0x5ba9('0x2d')]({'message':_0x5ba9('0x31')});}})[_0x5ba9('0x25')](function(_0x49fc8b,_0x4d7973,_0x1b3dad){if(_0x49fc8b['user']){db[_0x5ba9('0x29')]['find']({'where':{'id':_0x49fc8b[_0x5ba9('0x1a')]['id']},'attributes':userAttributes})[_0x5ba9('0x20')](function(_0x164522){if(!_0x164522){return _0x4d7973[_0x5ba9('0x21')](0x194)['json']({'message':_0x5ba9('0x3c')});}_0x49fc8b[_0x5ba9('0x1a')]=_0x164522;_0x1b3dad();})[_0x5ba9('0x2f')](function(_0x32cd3f){_0x1b3dad(_0x32cd3f);});}else if(_0x4c9ad9){_0x1b3dad();}else{return _0x4d7973[_0x5ba9('0x21')](0x194)[_0x5ba9('0x2d')]({'message':_0x5ba9('0x3d')});}});}exports[_0x5ba9('0x3e')]=isAuthenticated;function canUpdate(){return compose()[_0x5ba9('0x25')](function(_0x4af9e1,_0x1ef243,_0x294c79){return require(_0x5ba9('0x3f'))[_0x5ba9('0x40')]()[_0x5ba9('0x20')](function(_0x2e83f3){if(_0x2e83f3[_0x5ba9('0x41')]){_0x294c79();}else{return _0x1ef243[_0x5ba9('0x21')](0x193)[_0x5ba9('0x2d')]({'message':_0x5ba9('0x42')});}})[_0x5ba9('0x2f')](function(_0x261a18){_0x294c79(_0x261a18);});});}exports[_0x5ba9('0x43')]=canUpdate;function signToken(_0x459d80,_0x1a7935){return jwt[_0x5ba9('0x44')]({'id':_0x459d80,'role':_0x1a7935},config[_0x5ba9('0x5')][_0x5ba9('0x6')],{'expiresIn':0x15180});}exports[_0x5ba9('0x45')]=signToken;exports['hasRole']=function(_0x3be381){if(!_0x3be381){throw new Error('Required\x20role\x20needs\x20to\x20be\x20set');}return compose()[_0x5ba9('0x25')](isAuthenticated())[_0x5ba9('0x25')](function meetsRequirements(_0x22f51c,_0x4ce816,_0x1208ff){if(config[_0x5ba9('0x46')]['indexOf'](_0x22f51c[_0x5ba9('0x1a')]['role'])>=config[_0x5ba9('0x46')]['indexOf'](_0x3be381)){return _0x1208ff();}else{return _0x4ce816[_0x5ba9('0x21')](0x193)[_0x5ba9('0x2d')]({'message':_0x5ba9('0x42')});}});};exports[_0x5ba9('0x47')]=function(_0x2e0854,_0x3fb2e2,_0x476305){_0x2e0854[_0x5ba9('0x47')]=!![];return _0x476305();};exports['setTokenCookie']=function(_0x34a997,_0x50ced8){if(!_0x34a997['user']){return _0x50ced8['status'](0x194)[_0x5ba9('0x2d')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x185f0b=signToken(_0x34a997[_0x5ba9('0x1a')]['id'],_0x34a997['user'][_0x5ba9('0x7')]);_0x50ced8[_0x5ba9('0x48')](_0x5ba9('0x49'),_0x185f0b);_0x50ced8[_0x5ba9('0x48')](_0x5ba9('0x4a'),JSON[_0x5ba9('0x4b')](_['pick'](_0x34a997['user'],userAttributes)));_0x50ced8[_0x5ba9('0x4c')](_0x5ba9('0x4d'));};exports['retrieveApiKey']=function(_0x3bc8d1){if(_['isNil'](_0x3bc8d1[_0x5ba9('0x38')])||_[_0x5ba9('0x4e')](_0x3bc8d1[_0x5ba9('0x4f')]))return null;else return createJwt(_0x3bc8d1);};exports['generateApiKey']=function(_0x14ed37){_0x14ed37[_0x5ba9('0x38')]=crypto[_0x5ba9('0x50')](0x10)[_0x5ba9('0x51')]('hex');_0x14ed37['apiKeyIat']=Math['floor'](Date[_0x5ba9('0x52')]()/0x3e8)[_0x5ba9('0x51')]();return createJwt(_0x14ed37);};exports[_0x5ba9('0x53')]=function(_0x3d5396,_0xc92cb){if(_0x3d5396[_0x5ba9('0x32')][_0x5ba9('0x33')]){jwt[_0x5ba9('0x34')](_0x3d5396['query']['apikey'],config[_0x5ba9('0x5')][_0x5ba9('0x6')],{'nonce':_0xc92cb['apiKeyNonce'],'iat':_0xc92cb[_0x5ba9('0x4f')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf['getUuid']()});return generateApiKey(_0xc92cb);}else{throw{'message':_0x5ba9('0x54')};}};function createJwt(_0x6a2342){return jwt[_0x5ba9('0x44')]({'iat':_0x6a2342['apiKeyIat'],'nonce':_0x6a2342[_0x5ba9('0x38')]},config[_0x5ba9('0x5')][_0x5ba9('0x6')],{'algorithm':_0x5ba9('0x55'),'subject':_0x6a2342['id'][_0x5ba9('0x51')](),'issuer':hardwareConf[_0x5ba9('0x35')](),'audience':hardwareConf[_0x5ba9('0x35')]()});} \ No newline at end of file +var _0x01ca=['findOne','params','closed','disposition','then','unmanaged','json','catch','headers','startsWith','authorization','User','status','Wrong\x20credentials.','Bearer','query','apikey','verify','getUuid','find','sub','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Unrecognized\x20API\x20access\x20key','Unknown\x20authorization\x20format','User\x20not\x20found.','User\x20object\x20not\x20found.','isAuthenticated','getLicense','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.','motion.token','cookie','stringify','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','generateApiKey','randomBytes','toString','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','lodash','jsonwebtoken','composable-middleware','basic-auth','crypto','ipaddr.js','secrets','session','role','fullname','internal','email','userpic','permissions','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','phoneBarRemoteControlPort','interface','use','user','ChatInteraction'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x01ca,0x132));var _0xa01c=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0x01ca[_0x19b3f9];return _0x18c3f6;};'use strict';var db=require(_0xa01c('0x0'))['db'];var config=require(_0xa01c('0x1'));var hardwareConf=require(_0xa01c('0x2'));var _=require(_0xa01c('0x3'));var jwt=require(_0xa01c('0x4'));var expressJwt=require('express-jwt');var compose=require(_0xa01c('0x5'));var basicAuth=require(_0xa01c('0x6'));var crypto=require(_0xa01c('0x7'));var ipaddr=require(_0xa01c('0x8'));var validateJwt=expressJwt({'secret':config[_0xa01c('0x9')][_0xa01c('0xa')]});var userAttributes=['id',_0xa01c('0xb'),_0xa01c('0xc'),'name',_0xa01c('0xd'),_0xa01c('0xe'),_0xa01c('0xf'),_0xa01c('0x10'),_0xa01c('0x11'),_0xa01c('0x12'),_0xa01c('0x13'),_0xa01c('0x14'),_0xa01c('0x15'),_0xa01c('0x16'),_0xa01c('0x17'),_0xa01c('0x18'),_0xa01c('0x19'),'phoneBarRemoteControl',_0xa01c('0x1a'),'userProfileId'];exports['isChatInteractionAuthorized']=function(){return isAuthenticated(!![])[_0xa01c('0x1b')](function(_0x5dd501,_0x232e1d,_0x5f3eb7){if(_0x5dd501[_0xa01c('0x1c')]){_0x5f3eb7();}else{return db[_0xa01c('0x1d')][_0xa01c('0x1e')]({'where':{'id':_0x5dd501[_0xa01c('0x1f')]['id']},'attributes':['id',_0xa01c('0x20'),_0xa01c('0x21')],'raw':!![]})[_0xa01c('0x22')](function(_0x27ee4a){if(_0x27ee4a&&_0x27ee4a[_0xa01c('0x20')]){return _0x232e1d['status'](_0x27ee4a['disposition']===_0xa01c('0x23')?0x195:0x193)[_0xa01c('0x24')]({'message':_0x27ee4a[_0xa01c('0x21')]===_0xa01c('0x23')?'Unmanaged.':'Forbidden.'});}else{_0x5f3eb7();}})[_0xa01c('0x25')](function(_0xd6b1bb){_0x5f3eb7(_0xd6b1bb);});}});};function isAuthenticated(_0xd0105a){return compose()[_0xa01c('0x1b')](function(_0x17452e,_0x428ecb,_0x35034a){if(_0x17452e[_0xa01c('0x26')]['authorization']){if(_[_0xa01c('0x27')](_0x17452e['headers'][_0xa01c('0x28')],'Basic')){var _0x365f9a=basicAuth(_0x17452e);db[_0xa01c('0x29')]['find']({'where':{'name':_0x365f9a['name']}})[_0xa01c('0x22')](function(_0x25b55f){if(!_0x25b55f||!_0x25b55f['authenticate'](_0x365f9a['pass'])){return _0x428ecb[_0xa01c('0x2a')](0x191)[_0xa01c('0x24')]({'message':_0xa01c('0x2b')});}_0x17452e['user']={'id':_0x25b55f['id']};_0x35034a();})['catch'](function(_0x14b4e0){_0x35034a(_0x14b4e0);});}else if(_[_0xa01c('0x27')](_0x17452e[_0xa01c('0x26')][_0xa01c('0x28')],_0xa01c('0x2c'))){validateJwt(_0x17452e,_0x428ecb,_0x35034a);}else{if(_0xd0105a){_0x35034a();}else{return _0x428ecb['status'](0x193)[_0xa01c('0x24')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x17452e[_0xa01c('0x2d')][_0xa01c('0x2e')]){try{var _0xb778b6=jwt[_0xa01c('0x2f')](_0x17452e[_0xa01c('0x2d')][_0xa01c('0x2e')],config[_0xa01c('0x9')][_0xa01c('0xa')],{'audience':hardwareConf[_0xa01c('0x30')](),'issuer':hardwareConf[_0xa01c('0x30')]()});db[_0xa01c('0x29')][_0xa01c('0x31')]({'where':{'id':_0xb778b6[_0xa01c('0x32')]}})[_0xa01c('0x22')](function(_0x5dc49c){if(!_0x5dc49c||!_[_0xa01c('0x33')](_0x5dc49c[_0xa01c('0x34')],_0xb778b6[_0xa01c('0x35')])){return _0x428ecb['status'](0x193)[_0xa01c('0x24')]({'message':_0xa01c('0x36')});}_0x17452e[_0xa01c('0x1c')]={'id':_0x5dc49c['id']};_0x35034a();})[_0xa01c('0x25')](function(_0x9fa089){_0x35034a(_0x9fa089);});}catch(_0x40748c){console['log'](_0x40748c);return _0x428ecb[_0xa01c('0x2a')](0x193)[_0xa01c('0x24')]({'message':_0xa01c('0x37')});}}else if(_0xd0105a){_0x35034a();}else{return _0x428ecb[_0xa01c('0x2a')](0x193)[_0xa01c('0x24')]({'message':_0xa01c('0x38')});}})['use'](function(_0x264343,_0x5ebe09,_0x3d2640){if(_0x264343['user']){db[_0xa01c('0x29')][_0xa01c('0x31')]({'where':{'id':_0x264343[_0xa01c('0x1c')]['id']},'attributes':userAttributes})['then'](function(_0x3bf94b){if(!_0x3bf94b){return _0x5ebe09['status'](0x194)[_0xa01c('0x24')]({'message':_0xa01c('0x39')});}_0x264343[_0xa01c('0x1c')]=_0x3bf94b;_0x3d2640();})[_0xa01c('0x25')](function(_0x41f8b0){_0x3d2640(_0x41f8b0);});}else if(_0xd0105a){_0x3d2640();}else{return _0x5ebe09[_0xa01c('0x2a')](0x194)[_0xa01c('0x24')]({'message':_0xa01c('0x3a')});}});}exports[_0xa01c('0x3b')]=isAuthenticated;function canUpdate(){return compose()[_0xa01c('0x1b')](function(_0x5e7abd,_0x12b3a6,_0x379d6a){return require('../../config/license/util')[_0xa01c('0x3c')]()[_0xa01c('0x22')](function(_0xc8e570){if(_0xc8e570['update']){_0x379d6a();}else{return _0x12b3a6[_0xa01c('0x2a')](0x193)[_0xa01c('0x24')]({'message':_0xa01c('0x3d')});}})['catch'](function(_0x48c77d){_0x379d6a(_0x48c77d);});});}exports['canUpdate']=canUpdate;function signToken(_0x2ad9eb,_0x25576a){return jwt[_0xa01c('0x3e')]({'id':_0x2ad9eb,'role':_0x25576a},config[_0xa01c('0x9')][_0xa01c('0xa')],{'expiresIn':0x15180});}exports[_0xa01c('0x3f')]=signToken;exports[_0xa01c('0x40')]=function(_0x599b26){if(!_0x599b26){throw new Error(_0xa01c('0x41'));}return compose()[_0xa01c('0x1b')](isAuthenticated())[_0xa01c('0x1b')](function meetsRequirements(_0x289ccb,_0xb319ec,_0x19ba6e){if(config['userRoles']['indexOf'](_0x289ccb[_0xa01c('0x1c')][_0xa01c('0xb')])>=config[_0xa01c('0x42')][_0xa01c('0x43')](_0x599b26)){return _0x19ba6e();}else{return _0xb319ec[_0xa01c('0x2a')](0x193)[_0xa01c('0x24')]({'message':_0xa01c('0x3d')});}});};exports[_0xa01c('0x44')]=function(_0x3cde66,_0xc1bb3a,_0x3196ac){_0x3cde66[_0xa01c('0x44')]=!![];return _0x3196ac();};exports[_0xa01c('0x45')]=function(_0x4b3d6e,_0x2bc6b1){if(!_0x4b3d6e[_0xa01c('0x1c')]){return _0x2bc6b1[_0xa01c('0x2a')](0x194)['json']({'message':_0xa01c('0x46')});}var _0x2b0dd0=signToken(_0x4b3d6e['user']['id'],_0x4b3d6e[_0xa01c('0x1c')][_0xa01c('0xb')]);_0x2bc6b1['cookie'](_0xa01c('0x47'),_0x2b0dd0);_0x2bc6b1[_0xa01c('0x48')]('motion.user',JSON[_0xa01c('0x49')](_['pick'](_0x4b3d6e[_0xa01c('0x1c')],userAttributes)));_0x2bc6b1[_0xa01c('0x4a')](_0xa01c('0x4b'));};exports[_0xa01c('0x4c')]=function(_0x116896){if(_[_0xa01c('0x4d')](_0x116896[_0xa01c('0x34')])||_[_0xa01c('0x4d')](_0x116896[_0xa01c('0x4e')]))return null;else return createJwt(_0x116896);};exports[_0xa01c('0x4f')]=function(_0x3c5685){_0x3c5685['apiKeyNonce']=crypto[_0xa01c('0x50')](0x10)[_0xa01c('0x51')]('hex');_0x3c5685[_0xa01c('0x4e')]=Math['floor'](Date[_0xa01c('0x52')]()/0x3e8)['toString']();return createJwt(_0x3c5685);};exports['regenerateApiKey']=function(_0x53e197,_0xd04c9d){if(_0x53e197[_0xa01c('0x2d')][_0xa01c('0x2e')]){jwt['verify'](_0x53e197[_0xa01c('0x2d')]['apikey'],config[_0xa01c('0x9')][_0xa01c('0xa')],{'nonce':_0xd04c9d[_0xa01c('0x34')],'iat':_0xd04c9d[_0xa01c('0x4e')],'audience':hardwareConf[_0xa01c('0x30')](),'issuer':hardwareConf[_0xa01c('0x30')]()});return generateApiKey(_0xd04c9d);}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};function createJwt(_0x4bcabd){return jwt['sign']({'iat':_0x4bcabd[_0xa01c('0x4e')],'nonce':_0x4bcabd[_0xa01c('0x34')]},config[_0xa01c('0x9')][_0xa01c('0xa')],{'algorithm':_0xa01c('0x53'),'subject':_0x4bcabd['id'][_0xa01c('0x51')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf['getUuid']()});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 3f26298..d981c0f 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 _0x36a2=['aes192','hasOwnProperty','encryptFile','createReadStream','createCipher','algorithm','data','update','binary','write','end','close','unlink','decryptFile','createWriteStream','createDecipher','final','crypto','bluebird'];(function(_0x5146f3,_0xe728c4){var _0x2672bb=function(_0x5a4a34){while(--_0x5a4a34){_0x5146f3['push'](_0x5146f3['shift']());}};_0x2672bb(++_0xe728c4);}(_0x36a2,0x70));var _0x236a=function(_0x8afdd0,_0x548ad1){_0x8afdd0=_0x8afdd0-0x0;var _0x3de7ac=_0x36a2[_0x8afdd0];return _0x3de7ac;};'use strict';var crypto=require(_0x236a('0x0'));var fs=require('fs');var BPromise=require(_0x236a('0x1'));var defaultOptions={'algorithm':_0x236a('0x2')};function combineOptions(_0x25027c){var _0x2b55bf={};for(var _0x2a7733 in defaultOptions){if(defaultOptions[_0x236a('0x3')](_0x2a7733)){_0x2b55bf[_0x2a7733]=defaultOptions[_0x2a7733];}}if(_0x25027c){for(var _0x4e3077 in _0x25027c){if(_0x25027c[_0x236a('0x3')](_0x4e3077)){_0x2b55bf[_0x4e3077]=_0x25027c[_0x4e3077];}}}return _0x2b55bf;}exports[_0x236a('0x4')]=function(_0xcbd982,_0x2a34b6,_0x2980e9,_0xea5aca){return new BPromise(function(_0x2da7c7,_0x2a36e7){_0xea5aca=combineOptions(_0xea5aca);var _0x57d65a=new Buffer(_0x2980e9);var _0x345a72=fs[_0x236a('0x5')](_0xcbd982);var _0x1d1502=fs['createWriteStream'](_0x2a34b6);var _0x590fa2=crypto[_0x236a('0x6')](_0xea5aca[_0x236a('0x7')],_0x57d65a);_0x345a72['on'](_0x236a('0x8'),function(_0x58f7ea){var _0x95c295=new Buffer(_0x590fa2[_0x236a('0x9')](_0x58f7ea),_0x236a('0xa'));_0x1d1502[_0x236a('0xb')](_0x95c295);});_0x345a72['on'](_0x236a('0xc'),function(){try{var _0x2d1adb=new Buffer(_0x590fa2['final'](_0x236a('0xa')),'binary');_0x1d1502[_0x236a('0xb')](_0x2d1adb);_0x1d1502[_0x236a('0xc')]();_0x1d1502['on'](_0x236a('0xd'),function(){return _0x2da7c7(_0x2a34b6);});}catch(_0x4b9d64){fs[_0x236a('0xe')](_0x2a34b6);return _0x2a36e7(_0x4b9d64);}});});};exports[_0x236a('0xf')]=function(_0x76d11e,_0x39a1aa,_0x51b86f,_0x16e309){return new BPromise(function(_0x24d3bd,_0x42d14c){_0x16e309=combineOptions(_0x16e309);var _0x2c7ac4=new Buffer(_0x51b86f);var _0x173c74=fs[_0x236a('0x5')](_0x76d11e);var _0x374db6=fs[_0x236a('0x10')](_0x39a1aa);var _0x12fecf=crypto[_0x236a('0x11')](_0x16e309['algorithm'],_0x2c7ac4);_0x173c74['on']('data',function(_0x50480f){var _0x30fe6e=new Buffer(_0x12fecf['update'](_0x50480f),_0x236a('0xa'));_0x374db6['write'](_0x30fe6e);});_0x173c74['on'](_0x236a('0xc'),function(){try{var _0x1b813c=new Buffer(_0x12fecf[_0x236a('0x12')](_0x236a('0xa')),_0x236a('0xa'));_0x374db6[_0x236a('0xb')](_0x1b813c);_0x374db6['end']();_0x374db6['on']('close',function(){return _0x24d3bd(_0x39a1aa);});}catch(_0xc84b44){fs[_0x236a('0xe')](_0x39a1aa);return _0x42d14c(_0xc84b44);}});});}; \ No newline at end of file +var _0xd07a=['hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','algorithm','data','binary','end','write','close','unlink','decryptFile','createDecipher','update','final','crypto','bluebird','aes192'];(function(_0xed90d1,_0x35f9e4){var _0x4ef9e2=function(_0x594ce6){while(--_0x594ce6){_0xed90d1['push'](_0xed90d1['shift']());}};_0x4ef9e2(++_0x35f9e4);}(_0xd07a,0xce));var _0xad07=function(_0x3124f8,_0x1a8b23){_0x3124f8=_0x3124f8-0x0;var _0x5bab5f=_0xd07a[_0x3124f8];return _0x5bab5f;};'use strict';var crypto=require(_0xad07('0x0'));var fs=require('fs');var BPromise=require(_0xad07('0x1'));var defaultOptions={'algorithm':_0xad07('0x2')};function combineOptions(_0x584ff0){var _0x234656={};for(var _0x1b58de in defaultOptions){if(defaultOptions['hasOwnProperty'](_0x1b58de)){_0x234656[_0x1b58de]=defaultOptions[_0x1b58de];}}if(_0x584ff0){for(var _0x23d5ad in _0x584ff0){if(_0x584ff0[_0xad07('0x3')](_0x23d5ad)){_0x234656[_0x23d5ad]=_0x584ff0[_0x23d5ad];}}}return _0x234656;}exports[_0xad07('0x4')]=function(_0x1bb47f,_0x415c6c,_0x24bd8c,_0x3ef799){return new BPromise(function(_0x10d67f,_0xad66c6){_0x3ef799=combineOptions(_0x3ef799);var _0x23eb41=new Buffer(_0x24bd8c);var _0x546400=fs[_0xad07('0x5')](_0x1bb47f);var _0x3bfd65=fs[_0xad07('0x6')](_0x415c6c);var _0x3d4f65=crypto[_0xad07('0x7')](_0x3ef799[_0xad07('0x8')],_0x23eb41);_0x546400['on'](_0xad07('0x9'),function(_0x29913f){var _0xe9497a=new Buffer(_0x3d4f65['update'](_0x29913f),_0xad07('0xa'));_0x3bfd65['write'](_0xe9497a);});_0x546400['on'](_0xad07('0xb'),function(){try{var _0x598181=new Buffer(_0x3d4f65['final'](_0xad07('0xa')),'binary');_0x3bfd65[_0xad07('0xc')](_0x598181);_0x3bfd65[_0xad07('0xb')]();_0x3bfd65['on'](_0xad07('0xd'),function(){return _0x10d67f(_0x415c6c);});}catch(_0x41ac2f){fs[_0xad07('0xe')](_0x415c6c);return _0xad66c6(_0x41ac2f);}});});};exports[_0xad07('0xf')]=function(_0x2b1aa0,_0xab9e5b,_0x52a0bb,_0x587df1){return new BPromise(function(_0x5daa8d,_0x1fa8a7){_0x587df1=combineOptions(_0x587df1);var _0x456d9b=new Buffer(_0x52a0bb);var _0x1b0d90=fs[_0xad07('0x5')](_0x2b1aa0);var _0x145fe4=fs[_0xad07('0x6')](_0xab9e5b);var _0x2c9464=crypto[_0xad07('0x10')](_0x587df1[_0xad07('0x8')],_0x456d9b);_0x1b0d90['on'](_0xad07('0x9'),function(_0x4b5d70){var _0x560b28=new Buffer(_0x2c9464[_0xad07('0x11')](_0x4b5d70),'binary');_0x145fe4['write'](_0x560b28);});_0x1b0d90['on']('end',function(){try{var _0x3904a6=new Buffer(_0x2c9464[_0xad07('0x12')](_0xad07('0xa')),_0xad07('0xa'));_0x145fe4[_0xad07('0xc')](_0x3904a6);_0x145fe4['end']();_0x145fe4['on'](_0xad07('0xd'),function(){return _0x5daa8d(_0xab9e5b);});}catch(_0x1e6a04){fs[_0xad07('0xe')](_0xab9e5b);return _0x1fa8a7(_0x1e6a04);}});});}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index da7a3d2..226b73a 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 _0x4d1b=['join','mkdirSync','each','length','%s%d.%s','csv','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','path','lodash','to-csv','zip-dir','rimraf','../../mysqldb','dbH','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','query','QueryTypes','SELECT','num','Empty','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','existsSync'];(function(_0x429e7e,_0xc4193f){var _0x247ee=function(_0x45d816){while(--_0x45d816){_0x429e7e['push'](_0x429e7e['shift']());}};_0x247ee(++_0xc4193f);}(_0x4d1b,0x13a));var _0xb4d1=function(_0x31991b,_0xaf75d2){_0x31991b=_0x31991b-0x0;var _0x307304=_0x4d1b[_0x31991b];return _0x307304;};'use strict';var util=require('util');var path=require(_0xb4d1('0x0'));var _=require(_0xb4d1('0x1'));var csv=require(_0xb4d1('0x2'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0xb4d1('0x3'));var rimraf=require(_0xb4d1('0x4'));var db=require(_0xb4d1('0x5'))['db'];var dbH=require(_0xb4d1('0x5'))[_0xb4d1('0x6')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xb4d1('0x7')][0x2]);var QUERY=process[_0xb4d1('0x7')][0x3];var PATH=process[_0xb4d1('0x7')][0x4];function analyticExtractedReport(_0x132813,_0x5a65e4){var _0x2a09a9={'status':_0x132813};var _0x5d58e0={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5a65e4){_0x2a09a9[_0xb4d1('0x8')]=_0x5a65e4;}return db[_0xb4d1('0x9')][_0xb4d1('0xa')](_0x2a09a9,_0x5d58e0);}function main(){var _0xad4fc8=0x1388;var _0xd83361;logger[_0xb4d1('0xb')](util[_0xb4d1('0xc')](_0xb4d1('0xd'),EXTRACTED_REPORT_ID,_0xb4d1('0xe')));return db[_0xb4d1('0xf')][_0xb4d1('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xb4d1('0x11'),_0xb4d1('0x12')]})[_0xb4d1('0x13')](function(_0x5110a8){if(_0x5110a8){_0xd83361=_0x5110a8;_0xad4fc8=_0xd83361[_0xb4d1('0x12')]||0x1388;}})[_0xb4d1('0x13')](function(){return dbH[_0xb4d1('0x14')][_0xb4d1('0x15')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize'][_0xb4d1('0x16')][_0xb4d1('0x17')]});})[_0xb4d1('0x13')](function(_0xb1c26e){if(!_0xb1c26e[0x0][_0xb4d1('0x18')]){return analyticExtractedReport(_0xb4d1('0x19'));}var _0x48c7f0=[];var _0x452ac5=0x0;var _0xfd00ff=!![];if(_0xb1c26e&&_0xb1c26e['length']){var _0x2eacca=_0xb1c26e[0x0][_0xb4d1('0x18')]%(_0x452ac5+_0xad4fc8);if(_0xd83361[_0xb4d1('0x11')]){for(;_0xfd00ff;_0x452ac5+=_0xad4fc8,_0x2eacca=_0xb1c26e[0x0][_0xb4d1('0x18')]%(_0x452ac5+_0xad4fc8)){if(_0x2eacca==0x0||_0x2eacca==_0xb1c26e[0x0][_0xb4d1('0x18')]){_0xfd00ff=![];}_0x48c7f0[_0xb4d1('0x1a')](dbH[_0xb4d1('0x14')][_0xb4d1('0x15')](util[_0xb4d1('0xc')](_0xb4d1('0x1b'),QUERY,_0xad4fc8,_0x452ac5),{'type':dbH[_0xb4d1('0x14')][_0xb4d1('0x16')]['SELECT']}));}}else{_0x48c7f0['push'](dbH[_0xb4d1('0x14')][_0xb4d1('0x15')](QUERY,{'type':dbH[_0xb4d1('0x14')]['QueryTypes'][_0xb4d1('0x17')]}));}}var _0x3be1e6=path['dirname'](PATH);var _0x2812a6=path[_0xb4d1('0x1c')](PATH,'.csv');var _0x1d5c8c=_0xd83361[_0xb4d1('0x11')]&&_0x48c7f0['length']>0x1;var _0x4a56c3=[];if(!fs[_0xb4d1('0x1d')](path[_0xb4d1('0x1e')](_0x3be1e6,_0x2812a6))&&_0x1d5c8c){fs[_0xb4d1('0x1f')](path[_0xb4d1('0x1e')](_0x3be1e6,_0x2812a6));}return BPromise[_0xb4d1('0x20')](_0x48c7f0,function(_0x253d08){_0x4a56c3[_0xb4d1('0x1a')](_0x253d08);})[_0xb4d1('0x13')](function(){for(var _0xa633b4=0x0;_0xa633b4<_0x4a56c3[_0xb4d1('0x21')];_0xa633b4+=0x1){var _0x4b0a1a;var _0x57ffc1=_0x4a56c3[_0xa633b4];if(_0x1d5c8c){_0x4b0a1a=path['join'](_0x3be1e6,_0x2812a6,util[_0xb4d1('0xc')](_0xb4d1('0x22'),_0x2812a6,_0xa633b4,_0xb4d1('0x23')));}else{_0x4b0a1a=path[_0xb4d1('0x1e')](_0x3be1e6,util[_0xb4d1('0xc')]('%s.%s',_0x2812a6,_0xb4d1('0x23')));}fs['writeFileSync'](_0x4b0a1a,csv(_0x57ffc1));}})[_0xb4d1('0x13')](function(){if(_0x1d5c8c){zipdir(path['join'](_0x3be1e6,_0x2812a6),{'saveTo':path[_0xb4d1('0x1e')](_0x3be1e6,util[_0xb4d1('0xc')](_0xb4d1('0x24'),_0x2812a6,_0xb4d1('0x25')))},function(_0x3dcf17,_0x5769fb){});rimraf(path['join'](_0x3be1e6,_0x2812a6),function(){});}})[_0xb4d1('0x13')](function(){logger[_0xb4d1('0xb')](util[_0xb4d1('0xc')](_0xb4d1('0x26'),EXTRACTED_REPORT_ID,_0xb4d1('0xe')));return analyticExtractedReport(_0xb4d1('0x27'),_0x1d5c8c?util[_0xb4d1('0xc')](_0xb4d1('0x24'),_0x2812a6,_0x1d5c8c?_0xb4d1('0x25'):_0xb4d1('0x23')):null);});})[_0xb4d1('0x28')](function(_0x296ece){logger['info'](util[_0xb4d1('0xc')](_0xb4d1('0x29'),EXTRACTED_REPORT_ID,_0xb4d1('0xe')),util['inspect'](_0x296ece,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xb4d1('0x2a'));});}main(); \ No newline at end of file +var _0x2ee5=['dbH','analytics','argv','savename','AnalyticExtractedReport','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeCsv','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','then','num','Empty','push','%s\x20limit\x20%d\x20OFFSET\x20%d','.csv','length','join','mkdirSync','each','%s%d.%s','csv','%s.%s','writeFileSync','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','util','lodash','to-csv','bluebird','rimraf','../../mysqldb'];(function(_0x562faa,_0x23adc7){var _0xc70f59=function(_0x2d7dec){while(--_0x2d7dec){_0x562faa['push'](_0x562faa['shift']());}};_0xc70f59(++_0x23adc7);}(_0x2ee5,0x16b));var _0x52ee=function(_0xbc35ae,_0x1b79a1){_0xbc35ae=_0xbc35ae-0x0;var _0x527b4c=_0x2ee5[_0xbc35ae];return _0x527b4c;};'use strict';var util=require(_0x52ee('0x0'));var path=require('path');var _=require(_0x52ee('0x1'));var csv=require(_0x52ee('0x2'));var fs=require('fs');var BPromise=require(_0x52ee('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0x52ee('0x4'));var db=require(_0x52ee('0x5'))['db'];var dbH=require(_0x52ee('0x5'))[_0x52ee('0x6')];var logger=require('../../config/logger')(_0x52ee('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x52ee('0x8')][0x2]);var QUERY=process[_0x52ee('0x8')][0x3];var PATH=process[_0x52ee('0x8')][0x4];function analyticExtractedReport(_0x2e3b20,_0x5d8552){var _0x15e746={'status':_0x2e3b20};var _0x5bc298={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5d8552){_0x15e746[_0x52ee('0x9')]=_0x5d8552;}return db[_0x52ee('0xa')]['update'](_0x15e746,_0x5bc298);}function main(){var _0x150937=0x1388;var _0xb56dcc;logger['info'](util[_0x52ee('0xb')](_0x52ee('0xc'),EXTRACTED_REPORT_ID,'CSV'));return db[_0x52ee('0xd')][_0x52ee('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x52ee('0xf'),_0x52ee('0x10')]})['then'](function(_0x5626b6){if(_0x5626b6){_0xb56dcc=_0x5626b6;_0x150937=_0xb56dcc['splitSizeCsv']||0x1388;}})['then'](function(){return dbH[_0x52ee('0x11')][_0x52ee('0x12')](util['format'](_0x52ee('0x13'),QUERY),{'type':dbH[_0x52ee('0x11')][_0x52ee('0x14')][_0x52ee('0x15')]});})[_0x52ee('0x16')](function(_0x1c681e){if(!_0x1c681e[0x0][_0x52ee('0x17')]){return analyticExtractedReport(_0x52ee('0x18'));}var _0x292802=[];var _0x2e4555=0x0;var _0x240994=!![];if(_0x1c681e&&_0x1c681e['length']){var _0x331ad9=_0x1c681e[0x0][_0x52ee('0x17')]%(_0x2e4555+_0x150937);if(_0xb56dcc[_0x52ee('0xf')]){for(;_0x240994;_0x2e4555+=_0x150937,_0x331ad9=_0x1c681e[0x0][_0x52ee('0x17')]%(_0x2e4555+_0x150937)){if(_0x331ad9==0x0||_0x331ad9==_0x1c681e[0x0][_0x52ee('0x17')]){_0x240994=![];}_0x292802[_0x52ee('0x19')](dbH[_0x52ee('0x11')]['query'](util[_0x52ee('0xb')](_0x52ee('0x1a'),QUERY,_0x150937,_0x2e4555),{'type':dbH[_0x52ee('0x11')][_0x52ee('0x14')][_0x52ee('0x15')]}));}}else{_0x292802['push'](dbH[_0x52ee('0x11')]['query'](QUERY,{'type':dbH['sequelize'][_0x52ee('0x14')][_0x52ee('0x15')]}));}}var _0x148662=path['dirname'](PATH);var _0x2d9797=path['basename'](PATH,_0x52ee('0x1b'));var _0x25dcdd=_0xb56dcc[_0x52ee('0xf')]&&_0x292802[_0x52ee('0x1c')]>0x1;var _0x58f4c0=[];if(!fs['existsSync'](path[_0x52ee('0x1d')](_0x148662,_0x2d9797))&&_0x25dcdd){fs[_0x52ee('0x1e')](path[_0x52ee('0x1d')](_0x148662,_0x2d9797));}return BPromise[_0x52ee('0x1f')](_0x292802,function(_0x550390){_0x58f4c0[_0x52ee('0x19')](_0x550390);})[_0x52ee('0x16')](function(){for(var _0x5b782c=0x0;_0x5b782c<_0x58f4c0['length'];_0x5b782c+=0x1){var _0x10d8b0;var _0x52fe85=_0x58f4c0[_0x5b782c];if(_0x25dcdd){_0x10d8b0=path[_0x52ee('0x1d')](_0x148662,_0x2d9797,util[_0x52ee('0xb')](_0x52ee('0x20'),_0x2d9797,_0x5b782c,_0x52ee('0x21')));}else{_0x10d8b0=path[_0x52ee('0x1d')](_0x148662,util['format'](_0x52ee('0x22'),_0x2d9797,_0x52ee('0x21')));}fs[_0x52ee('0x23')](_0x10d8b0,csv(_0x52fe85));}})['then'](function(){if(_0x25dcdd){zipdir(path[_0x52ee('0x1d')](_0x148662,_0x2d9797),{'saveTo':path[_0x52ee('0x1d')](_0x148662,util[_0x52ee('0xb')](_0x52ee('0x22'),_0x2d9797,'zip'))},function(_0x313116,_0x326b00){});rimraf(path[_0x52ee('0x1d')](_0x148662,_0x2d9797),function(){});}})[_0x52ee('0x16')](function(){logger['info'](util[_0x52ee('0xb')](_0x52ee('0x24'),EXTRACTED_REPORT_ID,_0x52ee('0x25')));return analyticExtractedReport('Completed',_0x25dcdd?util['format'](_0x52ee('0x22'),_0x2d9797,_0x25dcdd?'zip':_0x52ee('0x21')):null);});})[_0x52ee('0x26')](function(_0x4ded63){logger['info'](util['format'](_0x52ee('0x27'),EXTRACTED_REPORT_ID,_0x52ee('0x25')),util[_0x52ee('0x28')](_0x4ded63,{'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 8db651d..5d58e61 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 _0x5b10=['Empty','find','split','then','splitSizePdf','length','sequelize','query','format','SELECT','QueryTypes','existsSync','join','mkdirSync','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','landscape','header','black','body','content','/fonts/Roboto-Medium.ttf','/fonts/Roboto-MediumItalic.ttf','%s%d.%s','pdf','pipe','finish','error','err','end','%s.%s','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','PDF','findOne','catch','Failed','lodash','bluebird','util','moment','pdfmake/src/printer','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','hasOwnProperty','push','tableHeader','num'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5b10,0x122));var _0x05b1=function(_0x363a7b,_0x32d1ba){_0x363a7b=_0x363a7b-0x0;var _0x5280dc=_0x5b10[_0x363a7b];return _0x5280dc;};'use strict';var _=require(_0x05b1('0x0'));var fs=require('fs');var BPromise=require(_0x05b1('0x1'));var util=require(_0x05b1('0x2'));var path=require('path');var moment=require(_0x05b1('0x3'));var PdfPrinter=require(_0x05b1('0x4'));var zipdir=require(_0x05b1('0x5'));var rimraf=require(_0x05b1('0x6'));var db=require(_0x05b1('0x7'))['db'];var dbH=require('../../mysqldb')[_0x05b1('0x8')];var logger=require(_0x05b1('0x9'))(_0x05b1('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x05b1('0xb')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x05b1('0xb')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x05b1('0xc');var _extractedReport;function analyticExtractedReport(_0x349d63,_0x499b8d){var _0x1c1c4a={'status':_0x349d63};var _0x264aad={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x499b8d){_0x1c1c4a[_0x05b1('0xd')]=_0x499b8d;}return db[_0x05b1('0xe')][_0x05b1('0xf')](_0x1c1c4a,_0x264aad);}function getHeader(_0x4a0a5a){var _0x302ccd=[];for(var _0x3ea967 in _0x4a0a5a){if(_0x4a0a5a[_0x05b1('0x10')](_0x3ea967)){_0x302ccd[_0x05b1('0x11')]({'text':_0x3ea967,'style':_0x05b1('0x12')});}}return _0x302ccd;}function extractReport(_0x646615){var _0x157cce=0x1388;var _0x1dbb3e;if(!_0x646615[0x0][_0x05b1('0x13')]){return analyticExtractedReport(_0x05b1('0x14'));}var _0x17c6a9=[];var _0x456b1b=0x0;var _0x4274dd=!![];var _0x43d8ad=path['dirname'](PATH);var _0x16e1e4=path['basename'](PATH,'.pdf');var _0x333134=![];var _0x32b8a5=[];return db['Setting'][_0x05b1('0x15')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x05b1('0x16'),'splitSizePdf']})[_0x05b1('0x17')](function(_0xf8ee68){if(_0xf8ee68){_0x1dbb3e=_0xf8ee68;_0x157cce=_0x1dbb3e[_0x05b1('0x18')]||0x3e8;}})[_0x05b1('0x17')](function(){if(_0x646615&&_0x646615[_0x05b1('0x19')]){var _0x20d628=_0x646615[0x0][_0x05b1('0x13')]%(_0x456b1b+_0x157cce);if(_0x1dbb3e[_0x05b1('0x16')]){for(;_0x4274dd;_0x456b1b+=_0x157cce,_0x20d628=_0x646615[0x0][_0x05b1('0x13')]%(_0x456b1b+_0x157cce)){if(_0x20d628==0x0||_0x20d628==_0x646615[0x0]['num']){_0x4274dd=![];}_0x17c6a9[_0x05b1('0x11')](dbH[_0x05b1('0x1a')][_0x05b1('0x1b')](util[_0x05b1('0x1c')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x157cce,_0x456b1b),{'type':dbH[_0x05b1('0x1a')]['QueryTypes'][_0x05b1('0x1d')]}));}}else{_0x17c6a9[_0x05b1('0x11')](dbH[_0x05b1('0x1a')][_0x05b1('0x1b')](QUERY,{'type':dbH[_0x05b1('0x1a')][_0x05b1('0x1e')][_0x05b1('0x1d')]}));}}_0x333134=_0x1dbb3e[_0x05b1('0x16')]&&_0x17c6a9[_0x05b1('0x19')]>0x1;if(!fs[_0x05b1('0x1f')](path[_0x05b1('0x20')](_0x43d8ad,_0x16e1e4))&&_0x333134){fs[_0x05b1('0x21')](path[_0x05b1('0x20')](_0x43d8ad,_0x16e1e4));}return BPromise[_0x05b1('0x22')](_0x17c6a9,function(_0x58709c){_0x32b8a5[_0x05b1('0x11')](_0x58709c);});})['then'](function(){return BPromise[_0x05b1('0x22')](_0x17c6a9,function(_0x5b3d18,_0x464529){var _0x241d94;var _0x534e44=util[_0x05b1('0x1c')](_0x05b1('0x23'),NAME,_extractedReport[_0x05b1('0x24')],moment(_extractedReport[_0x05b1('0x25')])['format'](FORMAT),moment(_extractedReport[_0x05b1('0x26')])['format'](FORMAT));var _0x292334={'pageSize':'A4','pageOrientation':_0x05b1('0x27'),'content':[{'text':_0x534e44,'style':_0x05b1('0x28')}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x05b1('0x29')}}};var _0x8e35a8={'headerRows':0x1,'body':[]};_0x8e35a8[_0x05b1('0x2a')][_0x05b1('0x11')](getHeader(_0x5b3d18[0x0]));var _0x4960ca;for(var _0x28657c=0x0;_0x28657c<_0x5b3d18[_0x05b1('0x19')];_0x28657c+=0x1){_0x4960ca=[];for(var _0x2e709a in _0x5b3d18[_0x28657c]){if(_0x5b3d18[_0x28657c][_0x05b1('0x10')](_0x2e709a)){_0x4960ca[_0x05b1('0x11')](_0x5b3d18[_0x28657c][_0x2e709a]?_['toString'](_0x5b3d18[_0x28657c][_0x2e709a]):'');}}_0x8e35a8[_0x05b1('0x2a')][_0x05b1('0x11')](_0x4960ca);}_0x292334[_0x05b1('0x2b')][_0x05b1('0x11')]({'table':_0x8e35a8});return new BPromise(function(_0x3dc978,_0x406ccf){var _0x5b6b2d=new PdfPrinter({'Roboto':{'normal':__dirname+'/fonts/Roboto-Regular.ttf','bold':__dirname+_0x05b1('0x2c'),'italics':__dirname+'/fonts/Roboto-Italic.ttf','bolditalics':__dirname+_0x05b1('0x2d')}});var _0x38388f=_0x5b6b2d['createPdfKitDocument'](_0x292334);if(_0x333134){_0x241d94=path[_0x05b1('0x20')](_0x43d8ad,_0x16e1e4,util[_0x05b1('0x1c')](_0x05b1('0x2e'),_0x16e1e4,_0x464529,_0x05b1('0x2f')));}else{_0x241d94=path['join'](_0x43d8ad,util[_0x05b1('0x1c')]('%s.%s',_0x16e1e4,_0x05b1('0x2f')));}var _0x4ee3b0=_0x38388f[_0x05b1('0x30')](fs['createWriteStream'](_0x241d94));_0x4ee3b0['on'](_0x05b1('0x31'),function(){_0x3dc978();});_0x4ee3b0['on'](_0x05b1('0x32'),function(_0x70efc4){console['log'](_0x05b1('0x33'),_0x70efc4);_0x406ccf(_0x70efc4);});_0x38388f[_0x05b1('0x34')]();});});})[_0x05b1('0x17')](function(){if(_0x333134){return new BPromise(function(_0x22af6e,_0x4c7da7){zipdir(path[_0x05b1('0x20')](_0x43d8ad,_0x16e1e4),{'saveTo':path['join'](_0x43d8ad,util[_0x05b1('0x1c')](_0x05b1('0x35'),_0x16e1e4,_0x05b1('0x36')))},function(_0x50037d){if(_0x50037d){_0x4c7da7(_0x50037d);}else{_0x22af6e();}});});}})[_0x05b1('0x17')](function(){if(_0x333134){rimraf(path[_0x05b1('0x20')](_0x43d8ad,_0x16e1e4),function(){});}})[_0x05b1('0x17')](function(){logger[_0x05b1('0x37')](util['format'](_0x05b1('0x38'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x05b1('0x39'),_0x333134?util[_0x05b1('0x1c')](_0x05b1('0x35'),_0x16e1e4,_0x333134?_0x05b1('0x36'):_0x05b1('0x2f')):null);});}function main(){logger[_0x05b1('0x37')](util[_0x05b1('0x1c')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x05b1('0x3a')));return db[_0x05b1('0xe')][_0x05b1('0x3b')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x05b1('0x17')](function(_0x4094e4){_extractedReport=_0x4094e4;return dbH[_0x05b1('0x1a')][_0x05b1('0x1b')](util[_0x05b1('0x1c')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x05b1('0x1a')][_0x05b1('0x1e')][_0x05b1('0x1d')]});})['then'](extractReport)[_0x05b1('0x3c')](function(_0x49b156){logger[_0x05b1('0x37')](util[_0x05b1('0x1c')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x05b1('0x3a')),util['inspect'](_0x49b156,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x05b1('0x3d'));});}main(); \ No newline at end of file +var _0xd8c7=['basename','.pdf','split','splitSizePdf','then','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','sequelize','length','existsSync','join','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','format','endDate','header','black','body','hasOwnProperty','content','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','%s%d.%s','pdf','%s.%s','pipe','createWriteStream','finish','error','log','err','end','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','inspect','Failed','lodash','bluebird','util','path','moment','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','push','tableHeader','num','Empty'];(function(_0x39633b,_0x3de446){var _0x4e4ccb=function(_0xcb07d5){while(--_0xcb07d5){_0x39633b['push'](_0x39633b['shift']());}};_0x4e4ccb(++_0x3de446);}(_0xd8c7,0x6a));var _0x7d8c=function(_0x4068d9,_0x3ca8e6){_0x4068d9=_0x4068d9-0x0;var _0x4aab68=_0xd8c7[_0x4068d9];return _0x4aab68;};'use strict';var _=require(_0x7d8c('0x0'));var fs=require('fs');var BPromise=require(_0x7d8c('0x1'));var util=require(_0x7d8c('0x2'));var path=require(_0x7d8c('0x3'));var moment=require(_0x7d8c('0x4'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require('zip-dir');var rimraf=require(_0x7d8c('0x5'));var db=require(_0x7d8c('0x6'))['db'];var dbH=require(_0x7d8c('0x6'))[_0x7d8c('0x7')];var logger=require(_0x7d8c('0x8'))(_0x7d8c('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x7d8c('0xa')][0x2]);var QUERY=process[_0x7d8c('0xa')][0x3];var PATH=process[_0x7d8c('0xa')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x7d8c('0xb');var _extractedReport;function analyticExtractedReport(_0x2437d4,_0x48e2e1){var _0x521d43={'status':_0x2437d4};var _0x2ecfc2={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x48e2e1){_0x521d43[_0x7d8c('0xc')]=_0x48e2e1;}return db['AnalyticExtractedReport'][_0x7d8c('0xd')](_0x521d43,_0x2ecfc2);}function getHeader(_0x3affda){var _0x19b8a1=[];for(var _0x165516 in _0x3affda){if(_0x3affda['hasOwnProperty'](_0x165516)){_0x19b8a1[_0x7d8c('0xe')]({'text':_0x165516,'style':_0x7d8c('0xf')});}}return _0x19b8a1;}function extractReport(_0x5ea427){var _0x56886c=0x1388;var _0x550097;if(!_0x5ea427[0x0][_0x7d8c('0x10')]){return analyticExtractedReport(_0x7d8c('0x11'));}var _0x3a6644=[];var _0x21f189=0x0;var _0x48908d=!![];var _0x519b99=path['dirname'](PATH);var _0x25709a=path[_0x7d8c('0x12')](PATH,_0x7d8c('0x13'));var _0x2d01e3=![];var _0x4d86d1=[];return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x7d8c('0x14'),_0x7d8c('0x15')]})[_0x7d8c('0x16')](function(_0x13682c){if(_0x13682c){_0x550097=_0x13682c;_0x56886c=_0x550097[_0x7d8c('0x15')]||0x3e8;}})[_0x7d8c('0x16')](function(){if(_0x5ea427&&_0x5ea427['length']){var _0x3b7e66=_0x5ea427[0x0][_0x7d8c('0x10')]%(_0x21f189+_0x56886c);if(_0x550097['split']){for(;_0x48908d;_0x21f189+=_0x56886c,_0x3b7e66=_0x5ea427[0x0][_0x7d8c('0x10')]%(_0x21f189+_0x56886c)){if(_0x3b7e66==0x0||_0x3b7e66==_0x5ea427[0x0]['num']){_0x48908d=![];}_0x3a6644[_0x7d8c('0xe')](dbH['sequelize']['query'](util['format'](_0x7d8c('0x17'),QUERY,_0x56886c,_0x21f189),{'type':dbH['sequelize'][_0x7d8c('0x18')][_0x7d8c('0x19')]}));}}else{_0x3a6644[_0x7d8c('0xe')](dbH[_0x7d8c('0x1a')]['query'](QUERY,{'type':dbH[_0x7d8c('0x1a')]['QueryTypes']['SELECT']}));}}_0x2d01e3=_0x550097[_0x7d8c('0x14')]&&_0x3a6644[_0x7d8c('0x1b')]>0x1;if(!fs[_0x7d8c('0x1c')](path[_0x7d8c('0x1d')](_0x519b99,_0x25709a))&&_0x2d01e3){fs['mkdirSync'](path[_0x7d8c('0x1d')](_0x519b99,_0x25709a));}return BPromise['each'](_0x3a6644,function(_0x558e1d){_0x4d86d1[_0x7d8c('0xe')](_0x558e1d);});})[_0x7d8c('0x16')](function(){return BPromise['each'](_0x3a6644,function(_0xd2c9fd,_0x542326){var _0x2f99eb;var _0x39a3bb=util['format'](_0x7d8c('0x1e'),NAME,_extractedReport['name'],moment(_extractedReport[_0x7d8c('0x1f')])[_0x7d8c('0x20')](FORMAT),moment(_extractedReport[_0x7d8c('0x21')])[_0x7d8c('0x20')](FORMAT));var _0x2d93cb={'pageSize':'A4','pageOrientation':'landscape','content':[{'text':_0x39a3bb,'style':_0x7d8c('0x22')}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x7d8c('0x23')}}};var _0x4c363c={'headerRows':0x1,'body':[]};_0x4c363c[_0x7d8c('0x24')]['push'](getHeader(_0xd2c9fd[0x0]));var _0x27a215;for(var _0x411f83=0x0;_0x411f83<_0xd2c9fd[_0x7d8c('0x1b')];_0x411f83+=0x1){_0x27a215=[];for(var _0x295076 in _0xd2c9fd[_0x411f83]){if(_0xd2c9fd[_0x411f83][_0x7d8c('0x25')](_0x295076)){_0x27a215[_0x7d8c('0xe')](_0xd2c9fd[_0x411f83][_0x295076]?_['toString'](_0xd2c9fd[_0x411f83][_0x295076]):'');}}_0x4c363c[_0x7d8c('0x24')][_0x7d8c('0xe')](_0x27a215);}_0x2d93cb[_0x7d8c('0x26')][_0x7d8c('0xe')]({'table':_0x4c363c});return new BPromise(function(_0x29ada0,_0x8263c0){var _0xd51512=new PdfPrinter({'Roboto':{'normal':__dirname+'/fonts/Roboto-Regular.ttf','bold':__dirname+_0x7d8c('0x27'),'italics':__dirname+_0x7d8c('0x28'),'bolditalics':__dirname+_0x7d8c('0x29')}});var _0x55b26f=_0xd51512['createPdfKitDocument'](_0x2d93cb);if(_0x2d01e3){_0x2f99eb=path[_0x7d8c('0x1d')](_0x519b99,_0x25709a,util[_0x7d8c('0x20')](_0x7d8c('0x2a'),_0x25709a,_0x542326,_0x7d8c('0x2b')));}else{_0x2f99eb=path[_0x7d8c('0x1d')](_0x519b99,util['format'](_0x7d8c('0x2c'),_0x25709a,'pdf'));}var _0x256bf9=_0x55b26f[_0x7d8c('0x2d')](fs[_0x7d8c('0x2e')](_0x2f99eb));_0x256bf9['on'](_0x7d8c('0x2f'),function(){_0x29ada0();});_0x256bf9['on'](_0x7d8c('0x30'),function(_0x4bab2c){console[_0x7d8c('0x31')](_0x7d8c('0x32'),_0x4bab2c);_0x8263c0(_0x4bab2c);});_0x55b26f[_0x7d8c('0x33')]();});});})['then'](function(){if(_0x2d01e3){return new BPromise(function(_0x2168f8,_0x1ee441){zipdir(path[_0x7d8c('0x1d')](_0x519b99,_0x25709a),{'saveTo':path[_0x7d8c('0x1d')](_0x519b99,util[_0x7d8c('0x20')]('%s.%s',_0x25709a,_0x7d8c('0x34')))},function(_0x5e0a21){if(_0x5e0a21){_0x1ee441(_0x5e0a21);}else{_0x2168f8();}});});}})[_0x7d8c('0x16')](function(){if(_0x2d01e3){rimraf(path['join'](_0x519b99,_0x25709a),function(){});}})['then'](function(){logger[_0x7d8c('0x35')](util[_0x7d8c('0x20')](_0x7d8c('0x36'),EXTRACTED_REPORT_ID,_0x7d8c('0x37')));return analyticExtractedReport('Completed',_0x2d01e3?util[_0x7d8c('0x20')](_0x7d8c('0x2c'),_0x25709a,_0x2d01e3?'zip':'pdf'):null);});}function main(){logger[_0x7d8c('0x35')](util[_0x7d8c('0x20')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x7d8c('0x38')));return db['AnalyticExtractedReport'][_0x7d8c('0x39')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x365a2c){_extractedReport=_0x365a2c;return dbH['sequelize']['query'](util[_0x7d8c('0x20')](_0x7d8c('0x3a'),QUERY),{'type':dbH[_0x7d8c('0x1a')][_0x7d8c('0x18')][_0x7d8c('0x19')]});})[_0x7d8c('0x16')](extractReport)[_0x7d8c('0x3b')](function(_0x5d46a5){logger[_0x7d8c('0x35')](util[_0x7d8c('0x20')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'),util[_0x7d8c('0x3c')](_0x5d46a5,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x7d8c('0x3d'));});}main(); \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index ba3cf6c..ddf3a7d 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 _0xe6cf=['SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','split','push','dirname','.xlsx','length','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','util','lodash','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','splitSizeXlsx','then','sequelize','query','format'];(function(_0x37270f,_0x3dcb8f){var _0x2792ff=function(_0x2f1fe3){while(--_0x2f1fe3){_0x37270f['push'](_0x37270f['shift']());}};_0x2792ff(++_0x3dcb8f);}(_0xe6cf,0x73));var _0xfe6c=function(_0x539ce1,_0x4a65eb){_0x539ce1=_0x539ce1-0x0;var _0x20be8e=_0xe6cf[_0x539ce1];return _0x20be8e;};'use strict';var util=require(_0xfe6c('0x0'));var path=require('path');var _=require(_0xfe6c('0x1'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0xfe6c('0x2'));var zipdir=require(_0xfe6c('0x3'));var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require(_0xfe6c('0x4'))[_0xfe6c('0x5')];var logger=require(_0xfe6c('0x6'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xfe6c('0x7')][0x2]);var QUERY=process[_0xfe6c('0x7')][0x3];var PATH=process[_0xfe6c('0x7')][0x4];function analyticExtractedReport(_0x38f191,_0x2876f1){var _0x422aab={'status':_0x38f191};var _0x5c0353={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2876f1){_0x422aab[_0xfe6c('0x8')]=_0x2876f1;}return db[_0xfe6c('0x9')][_0xfe6c('0xa')](_0x422aab,_0x5c0353);}function main(){var _0x122415=0x1388;var _0x4bab13;logger[_0xfe6c('0xb')](util['format'](_0xfe6c('0xc'),EXTRACTED_REPORT_ID,_0xfe6c('0xd')));return db[_0xfe6c('0xe')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xfe6c('0xf')]})[_0xfe6c('0x10')](function(_0x458b20){if(_0x458b20){_0x4bab13=_0x458b20;_0x122415=_0x4bab13['splitSizeXlsx']||0x1388;}})[_0xfe6c('0x10')](function(){return dbH[_0xfe6c('0x11')][_0xfe6c('0x12')](util[_0xfe6c('0x13')](_0xfe6c('0x14'),QUERY),{'type':dbH['sequelize'][_0xfe6c('0x15')][_0xfe6c('0x16')]});})['then'](function(_0x16684b){if(!_0x16684b[0x0][_0xfe6c('0x17')]){return analyticExtractedReport(_0xfe6c('0x18'));}var _0x272d7c=[];var _0x1c9c8f=0x0;var _0x2faa4c=!![];if(_0x4bab13[_0xfe6c('0x19')]){if(_0x16684b&&_0x16684b['length']){var _0x29ee47=_0x16684b[0x0][_0xfe6c('0x17')]%(_0x1c9c8f+_0x122415);for(;_0x2faa4c;_0x1c9c8f+=_0x122415,_0x29ee47=_0x16684b[0x0][_0xfe6c('0x17')]%(_0x1c9c8f+_0x122415)){if(_0x29ee47==0x0||_0x29ee47==_0x16684b[0x0][_0xfe6c('0x17')]){_0x2faa4c=![];}_0x272d7c['push'](dbH['sequelize']['query'](util[_0xfe6c('0x13')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x122415,_0x1c9c8f),{'type':dbH[_0xfe6c('0x11')][_0xfe6c('0x15')]['SELECT']}));}}}else{_0x272d7c[_0xfe6c('0x1a')](dbH[_0xfe6c('0x11')]['query'](QUERY,{'type':dbH[_0xfe6c('0x11')][_0xfe6c('0x15')][_0xfe6c('0x16')]}));}var _0x512fb0=path[_0xfe6c('0x1b')](PATH);var _0x442435=path['basename'](PATH,_0xfe6c('0x1c'));var _0x4c14ba=_0x4bab13[_0xfe6c('0x19')]&&_0x272d7c[_0xfe6c('0x1d')]>0x1;var _0x47f47b=[];if(!fs[_0xfe6c('0x1e')](path[_0xfe6c('0x1f')](_0x512fb0,_0x442435))&&_0x4c14ba){fs[_0xfe6c('0x20')](path['join'](_0x512fb0,_0x442435));}return BPromise[_0xfe6c('0x21')](_0x272d7c,function(_0x35acf7){_0x47f47b['push'](_0x35acf7);})['then'](function(){for(var _0x20fb4c=0x0;_0x20fb4c<_0x47f47b['length'];_0x20fb4c+=0x1){var _0x4c9c83;var _0xc5e06e=_0x47f47b[_0x20fb4c];if(_0x4c14ba){_0x4c9c83=path[_0xfe6c('0x1f')](_0x512fb0,_0x442435,util['format'](_0xfe6c('0x22'),_0x442435,_0x20fb4c,_0xfe6c('0x23')));}else{_0x4c9c83=path[_0xfe6c('0x1f')](_0x512fb0,util['format'](_0xfe6c('0x24'),_0x442435,_0xfe6c('0x23')));}fs[_0xfe6c('0x25')](_0x4c9c83,json2xls(_0xc5e06e),_0xfe6c('0x26'));}})[_0xfe6c('0x10')](function(){if(_0x4c14ba){zipdir(path[_0xfe6c('0x1f')](_0x512fb0,_0x442435),{'saveTo':path[_0xfe6c('0x1f')](_0x512fb0,util[_0xfe6c('0x13')]('%s.%s',_0x442435,'zip'))},function(_0x1fbeda,_0x37bcfc){});rimraf(path[_0xfe6c('0x1f')](_0x512fb0,_0x442435),function(){});}})[_0xfe6c('0x10')](function(){logger[_0xfe6c('0xb')](util[_0xfe6c('0x13')](_0xfe6c('0x27'),EXTRACTED_REPORT_ID,_0xfe6c('0xd')));return analyticExtractedReport(_0xfe6c('0x28'),_0x4c14ba?util['format'](_0xfe6c('0x24'),_0x442435,_0x4c14ba?_0xfe6c('0x29'):_0xfe6c('0x23')):null);});})[_0xfe6c('0x2a')](function(_0xfd9980){logger[_0xfe6c('0xb')](util[_0xfe6c('0x13')](_0xfe6c('0x2b'),EXTRACTED_REPORT_ID,_0xfe6c('0xd')),util['inspect'](_0xfd9980,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xfe6c('0x2c'));});}main(); \ No newline at end of file +var _0x8bef=['SELECT','push','dirname','basename','length','existsSync','join','mkdirSync','each','%s%d.%s','%s.%s','xlsx','writeFileSync','binary','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','split','then','splitSizeXlsx','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','Empty','num','%s\x20limit\x20%d\x20OFFSET\x20%d'];(function(_0x5c092b,_0x7916f){var _0x3bc79b=function(_0x245840){while(--_0x245840){_0x5c092b['push'](_0x5c092b['shift']());}};_0x3bc79b(++_0x7916f);}(_0x8bef,0x17c));var _0xf8be=function(_0x120e59,_0x443649){_0x120e59=_0x120e59-0x0;var _0x53ff80=_0x8bef[_0x120e59];return _0x53ff80;};'use strict';var util=require('util');var path=require('path');var _=require(_0xf8be('0x0'));var fs=require('fs');var json2xls=require(_0xf8be('0x1'));var BPromise=require(_0xf8be('0x2'));var zipdir=require(_0xf8be('0x3'));var rimraf=require(_0xf8be('0x4'));var db=require(_0xf8be('0x5'))['db'];var dbH=require(_0xf8be('0x5'))[_0xf8be('0x6')];var logger=require('../../config/logger')(_0xf8be('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0xf8be('0x8')][0x2]);var QUERY=process[_0xf8be('0x8')][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0x3be753,_0x164efe){var _0x3728bb={'status':_0x3be753};var _0x201369={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x164efe){_0x3728bb['savename']=_0x164efe;}return db[_0xf8be('0x9')][_0xf8be('0xa')](_0x3728bb,_0x201369);}function main(){var _0x57f10a=0x1388;var _0x2dc6a5;logger[_0xf8be('0xb')](util[_0xf8be('0xc')](_0xf8be('0xd'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0xf8be('0xe')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xf8be('0xf'),'splitSizeXlsx']})[_0xf8be('0x10')](function(_0x3b3966){if(_0x3b3966){_0x2dc6a5=_0x3b3966;_0x57f10a=_0x2dc6a5[_0xf8be('0x11')]||0x1388;}})[_0xf8be('0x10')](function(){return dbH[_0xf8be('0x12')][_0xf8be('0x13')](util[_0xf8be('0xc')](_0xf8be('0x14'),QUERY),{'type':dbH[_0xf8be('0x12')][_0xf8be('0x15')]['SELECT']});})[_0xf8be('0x10')](function(_0x4c0af3){if(!_0x4c0af3[0x0]['num']){return analyticExtractedReport(_0xf8be('0x16'));}var _0x16f446=[];var _0xfd7d4e=0x0;var _0x3e1327=!![];if(_0x2dc6a5[_0xf8be('0xf')]){if(_0x4c0af3&&_0x4c0af3['length']){var _0x38f8f3=_0x4c0af3[0x0][_0xf8be('0x17')]%(_0xfd7d4e+_0x57f10a);for(;_0x3e1327;_0xfd7d4e+=_0x57f10a,_0x38f8f3=_0x4c0af3[0x0][_0xf8be('0x17')]%(_0xfd7d4e+_0x57f10a)){if(_0x38f8f3==0x0||_0x38f8f3==_0x4c0af3[0x0]['num']){_0x3e1327=![];}_0x16f446['push'](dbH[_0xf8be('0x12')][_0xf8be('0x13')](util[_0xf8be('0xc')](_0xf8be('0x18'),QUERY,_0x57f10a,_0xfd7d4e),{'type':dbH[_0xf8be('0x12')][_0xf8be('0x15')][_0xf8be('0x19')]}));}}}else{_0x16f446[_0xf8be('0x1a')](dbH['sequelize'][_0xf8be('0x13')](QUERY,{'type':dbH[_0xf8be('0x12')]['QueryTypes'][_0xf8be('0x19')]}));}var _0x44221c=path[_0xf8be('0x1b')](PATH);var _0x403417=path[_0xf8be('0x1c')](PATH,'.xlsx');var _0x8074dd=_0x2dc6a5[_0xf8be('0xf')]&&_0x16f446[_0xf8be('0x1d')]>0x1;var _0xb492fc=[];if(!fs[_0xf8be('0x1e')](path[_0xf8be('0x1f')](_0x44221c,_0x403417))&&_0x8074dd){fs[_0xf8be('0x20')](path[_0xf8be('0x1f')](_0x44221c,_0x403417));}return BPromise[_0xf8be('0x21')](_0x16f446,function(_0x4337ac){_0xb492fc[_0xf8be('0x1a')](_0x4337ac);})[_0xf8be('0x10')](function(){for(var _0xf0ea46=0x0;_0xf0ea46<_0xb492fc[_0xf8be('0x1d')];_0xf0ea46+=0x1){var _0x451256;var _0x4b84bc=_0xb492fc[_0xf0ea46];if(_0x8074dd){_0x451256=path['join'](_0x44221c,_0x403417,util[_0xf8be('0xc')](_0xf8be('0x22'),_0x403417,_0xf0ea46,'xlsx'));}else{_0x451256=path[_0xf8be('0x1f')](_0x44221c,util['format'](_0xf8be('0x23'),_0x403417,_0xf8be('0x24')));}fs[_0xf8be('0x25')](_0x451256,json2xls(_0x4b84bc),_0xf8be('0x26'));}})[_0xf8be('0x10')](function(){if(_0x8074dd){zipdir(path[_0xf8be('0x1f')](_0x44221c,_0x403417),{'saveTo':path[_0xf8be('0x1f')](_0x44221c,util['format']('%s.%s',_0x403417,'zip'))},function(_0x2541e1,_0x299cd8){});rimraf(path['join'](_0x44221c,_0x403417),function(){});}})['then'](function(){logger['info'](util['format'](_0xf8be('0x27'),EXTRACTED_REPORT_ID,_0xf8be('0x28')));return analyticExtractedReport(_0xf8be('0x29'),_0x8074dd?util[_0xf8be('0xc')](_0xf8be('0x23'),_0x403417,_0x8074dd?'zip':_0xf8be('0x24')):null);});})[_0xf8be('0x2a')](function(_0x3b2609){logger[_0xf8be('0xb')](util[_0xf8be('0xc')](_0xf8be('0x2b'),EXTRACTED_REPORT_ID,'XLSX'),util[_0xf8be('0x2c')](_0x3b2609,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index e2fa892..bd2fa3e 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 _0xdc3c=['outbound','extension','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','context','push','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','toLowerCase','createdAt','updatedAt','interval','intervals','tag','CDR(tag)=','callerID','length','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime','last','concat','Hangup','transaction','destroy','sortBy','error','rewrite','models','findAll','VoiceExtension','IntervalId','then','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','playback','hasOwnProperty','find','extensions','type','Set','format','priority','VoiceExtensionId'];(function(_0x77773a,_0x5a7026){var _0x1091a2=function(_0x276af5){while(--_0x276af5){_0x77773a['push'](_0x77773a['shift']());}};_0x1091a2(++_0x5a7026);}(_0xdc3c,0x1bb));var _0xcdc3=function(_0xf4e57,_0x5a1d8d){_0xf4e57=_0xf4e57-0x0;var _0x249b84=_0xdc3c[_0xf4e57];return _0x249b84;};'use strict';var _=require('lodash');var util=require('util');function rewrite(_0x5f42ae,_0xdcd91){var _0x1045e8=this;return _0x5f42ae[_0xcdc3('0x0')]['Interval'][_0xcdc3('0x1')]({'raw':!![]})['then'](function(_0x1141fa){_0x1045e8['intervals']=_0x1141fa;return _0x5f42ae[_0xcdc3('0x0')][_0xcdc3('0x2')][_0xcdc3('0x1')]({'where':{'IntervalId':_0xdcd91[_0xcdc3('0x3')]},'raw':!![]});})[_0xcdc3('0x4')](function(_0x4444ab){return _0x5f42ae[_0xcdc3('0x0')][_0xcdc3('0x2')][_0xcdc3('0x1')]({'where':{'exten':{'$in':_['uniq'](_[_0xcdc3('0x5')](_0x4444ab,_0xcdc3('0x6')))}},'order':[{'raw':_0xcdc3('0x7')}],'raw':!![]});})[_0xcdc3('0x4')](function(_0x393165){var _0x433b9c=_[_0xcdc3('0x8')](_0x393165,{'priority':'1'});var _0x1a0465=_[_0xcdc3('0x8')](_0x393165,{'isApp':0x1});var _0x43cb33=_[_0xcdc3('0x9')](_0x1a0465,_0xcdc3('0x6'));var _0x197cca=['queue',_0xcdc3('0xa')];var _0x17086d=[];var _0x1bdf8c=[];for(var _0xe3e42c in _0x43cb33){if(_0x43cb33[_0xcdc3('0xb')](_0xe3e42c)){_0x1045e8['priority']=0x2;_0x1045e8['extensions']=[];_0x1045e8['extension']=_[_0xcdc3('0xc')](_0x433b9c,{'exten':_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0x6')]});_0x1045e8[_0xcdc3('0xd')]['push']({'type':_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0xe')],'app':_0xcdc3('0xf'),'appdata':util[_0xcdc3('0x10')]('CDR(type)=%s',_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0xe')]),'context':_0x43cb33[_0xe3e42c][0x0]['context'],'exten':_0x43cb33[_0xe3e42c][0x0]['exten'],'priority':_0x1045e8[_0xcdc3('0x11')]++,'VoiceExtensionId':_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0x12')]});if(_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0xe')]===_0xcdc3('0x13')){if(_0x1045e8[_0xcdc3('0x14')]){_0x1045e8['extensions']['push']({'type':_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0xe')],'app':_0xcdc3('0xf'),'appdata':_0xcdc3('0x15')+(_0x1045e8['extension']['cutdigits']?_0xcdc3('0x16')+_0x1045e8[_0xcdc3('0x14')][_0xcdc3('0x17')]+'}':_0xcdc3('0x18')),'context':_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0x19')],'exten':_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0x6')],'priority':_0x1045e8[_0xcdc3('0x11')]++,'VoiceExtensionId':_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0x12')]});}_0x1045e8['extensions'][_0xcdc3('0x1a')]({'type':_0x43cb33[_0xe3e42c][0x0]['type'],'app':_0xcdc3('0xf'),'appdata':'CDR(routeid)='+_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0x12')],'context':_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0x19')],'exten':_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0x6')],'priority':_0x1045e8['priority']++,'VoiceExtensionId':_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0x12')]});var _0x2f9143=_0x1045e8['priority']++;_0x1045e8[_0xcdc3('0xd')]['push']({'type':_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0xe')],'app':_0xcdc3('0x1b'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x2f9143+0x2)+_0xcdc3('0x1c')+(_0x2f9143+0x1)+')','context':_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0x19')],'exten':_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0x6')],'priority':_0x2f9143,'VoiceExtensionId':_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0x12')]});if(_0x1045e8[_0xcdc3('0x14')]){_0x1045e8[_0xcdc3('0xd')]['push']({'type':_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0xe')],'app':_0xcdc3('0xf'),'appdata':_0x1045e8[_0xcdc3('0x14')]['cutdigits']?_0xcdc3('0x1d')+_0x1045e8[_0xcdc3('0x14')][_0xcdc3('0x17')]+'}':_0xcdc3('0x1e'),'context':_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0x19')],'exten':_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0x6')],'priority':_0x1045e8[_0xcdc3('0x11')]++,'VoiceExtensionId':_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0x12')]});}_0x1045e8[_0xcdc3('0xd')][_0xcdc3('0x1a')]({'type':_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0xe')],'app':_0xcdc3('0xf'),'appdata':_0xcdc3('0x1f')+_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0x12')],'context':_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0x19')],'exten':_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0x6')],'priority':_0x1045e8['priority']++,'VoiceExtensionId':_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0x12')]});if(_0x1045e8[_0xcdc3('0x14')]&&_0x1045e8[_0xcdc3('0x14')][_0xcdc3('0xb')](_0xcdc3('0x20'))&&_0x1045e8[_0xcdc3('0x14')][_0xcdc3('0x20')]!==_0xcdc3('0x21')){_0x1045e8[_0xcdc3('0xd')]['push']({'type':_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0xe')],'app':_0xcdc3('0xf'),'appdata':_0xcdc3('0x22'),'context':_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0x19')],'exten':_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0x6')],'priority':_0x1045e8[_0xcdc3('0x11')]++,'VoiceExtensionId':_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0x12')]});_0x1045e8[_0xcdc3('0xd')][_0xcdc3('0x1a')]({'type':_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0xe')],'app':_0xcdc3('0xf'),'appdata':_0xcdc3('0x23')+_0x1045e8['extension'][_0xcdc3('0x20')]||_0xcdc3('0x24'),'context':_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0x19')],'exten':_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0x6')],'priority':_0x1045e8[_0xcdc3('0x11')]++,'VoiceExtensionId':_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0x12')]});}}_0x1045e8[_0xcdc3('0xd')][_0xcdc3('0x1a')]({'type':_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0xe')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0x19')],'exten':_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0x6')],'priority':_0x1045e8[_0xcdc3('0x11')]++,'VoiceExtensionId':_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0x12')]});_0x1045e8[_0xcdc3('0xd')][_0xcdc3('0x1a')]({'type':_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0xe')],'app':'Set','appdata':_0xcdc3('0x25'),'context':_0x43cb33[_0xe3e42c][0x0]['context'],'exten':_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0x6')],'priority':_0x1045e8[_0xcdc3('0x11')]++,'VoiceExtensionId':_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0x12')]});_0x1045e8['extensions']['push']({'type':_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0xe')],'app':_0xcdc3('0xf'),'appdata':_0xcdc3('0x26'),'context':_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0x19')],'exten':_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0x6')],'priority':_0x1045e8[_0xcdc3('0x11')]++,'VoiceExtensionId':_0x43cb33[_0xe3e42c][0x0]['VoiceExtensionId']});for(var _0xaad5c4=0x0,_0x2fbc1b=0x0;_0xaad5c4<_0x43cb33[_0xe3e42c]['length'];_0xaad5c4+=0x1,_0x2fbc1b=0x0){var _0x28470d=_0x43cb33[_0xe3e42c][_0xaad5c4];if(_0x28470d[_0xcdc3('0xe')]){_0x28470d[_0xcdc3('0xe')]=_0x28470d[_0xcdc3('0xe')][_0xcdc3('0x27')]();}var _0x52f2f2=[];var _0x47a811=[];delete _0x28470d['id'];delete _0x28470d[_0xcdc3('0x28')];delete _0x28470d[_0xcdc3('0x29')];var _0x4abb7f=_0x28470d[_0xcdc3('0x2a')]!=='*,*,*,*'?[_0x28470d[_0xcdc3('0x2a')]]:_0x28470d[_0xcdc3('0x3')]?_[_0xcdc3('0x5')](_[_0xcdc3('0x8')](_0x1045e8[_0xcdc3('0x2b')],{'IntervalId':_0x28470d[_0xcdc3('0x3')]}),_0xcdc3('0x2a')):[];if(_0x28470d[_0xcdc3('0xb')](_0xcdc3('0x2c'))){if(_0x28470d[_0xcdc3('0x2c')]&&_0x28470d[_0xcdc3('0x2c')]!=='--'){_0x52f2f2[_0xcdc3('0x1a')]({'type':_0x28470d['type'],'app':_0xcdc3('0xf'),'appdata':_0xcdc3('0x2d')+_0x28470d[_0xcdc3('0x2c')],'context':_0x28470d[_0xcdc3('0x19')],'exten':_0x28470d[_0xcdc3('0x6')],'priority':_0x4abb7f['length']+_0x1045e8['priority']+_0x2fbc1b++,'VoiceExtensionId':_0x28470d[_0xcdc3('0x12')]});}}if(_0x28470d[_0xcdc3('0xe')]===_0xcdc3('0x13')&&_0x28470d[_0xcdc3('0xb')](_0xcdc3('0x2e'))){if(_0x28470d[_0xcdc3('0x2e')]){_0x52f2f2['push']({'type':_0x28470d[_0xcdc3('0xe')],'app':_0xcdc3('0x1b'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x28470d[_0xcdc3('0x2e')]+')','context':_0x28470d[_0xcdc3('0x19')],'exten':_0x28470d['exten'],'priority':_0x4abb7f[_0xcdc3('0x2f')]+_0x1045e8['priority']+_0x2fbc1b++,'VoiceExtensionId':_0x28470d['VoiceExtensionId']});}else{_0x52f2f2[_0xcdc3('0x1a')]({'type':_0x28470d[_0xcdc3('0xe')],'app':_0xcdc3('0x1b'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x28470d[_0xcdc3('0x19')],'exten':_0x28470d[_0xcdc3('0x6')],'priority':_0x4abb7f[_0xcdc3('0x2f')]+_0x1045e8[_0xcdc3('0x11')]+_0x2fbc1b++,'VoiceExtensionId':_0x28470d[_0xcdc3('0x12')]});}}if(_0x28470d[_0xcdc3('0xb')]('answer')){if(_0x197cca[_0xcdc3('0x30')](_0x28470d[_0xcdc3('0x31')]['toLowerCase']())>=0x0&&_0x28470d[_0xcdc3('0x32')]!==_0xcdc3('0x33')){if(_0x28470d['answer']){_0x52f2f2[_0xcdc3('0x1a')]({'type':_0x28470d[_0xcdc3('0xe')],'app':_0xcdc3('0x1b'),'appdata':_0xcdc3('0x34'),'context':_0x28470d[_0xcdc3('0x19')],'exten':_0x28470d[_0xcdc3('0x6')],'priority':_0x4abb7f[_0xcdc3('0x2f')]+_0x1045e8[_0xcdc3('0x11')]+_0x2fbc1b++,'VoiceExtensionId':_0x28470d[_0xcdc3('0x12')]});_0x52f2f2['push']({'type':_0x28470d[_0xcdc3('0xe')],'app':_0xcdc3('0xf'),'appdata':_0xcdc3('0x35'),'context':_0x28470d[_0xcdc3('0x19')],'exten':_0x28470d[_0xcdc3('0x6')],'priority':_0x4abb7f['length']+_0x1045e8['priority']+_0x2fbc1b++,'VoiceExtensionId':_0x28470d[_0xcdc3('0x12')]});}else{_0x52f2f2[_0xcdc3('0x1a')]({'type':_0x28470d['type'],'app':_0xcdc3('0x1b'),'appdata':_0xcdc3('0x36'),'context':_0x28470d[_0xcdc3('0x19')],'exten':_0x28470d[_0xcdc3('0x6')],'priority':_0x4abb7f[_0xcdc3('0x2f')]+_0x1045e8[_0xcdc3('0x11')]+_0x2fbc1b++,'VoiceExtensionId':_0x28470d[_0xcdc3('0x12')]});_0x52f2f2[_0xcdc3('0x1a')]({'type':_0x28470d[_0xcdc3('0xe')],'app':_0xcdc3('0xf'),'appdata':_0xcdc3('0x37'),'context':_0x28470d[_0xcdc3('0x19')],'exten':_0x28470d[_0xcdc3('0x6')],'priority':_0x4abb7f[_0xcdc3('0x2f')]+_0x1045e8[_0xcdc3('0x11')]+_0x2fbc1b++,'VoiceExtensionId':_0x28470d[_0xcdc3('0x12')]});}}}for(var _0x23169d=0x0;_0x23169d<_0x4abb7f[_0xcdc3('0x2f')];_0x23169d+=0x1){var _0x3d5097=_0x1045e8[_0xcdc3('0x11')]+_0x4abb7f['length'];var _0x2efdff=_0x23169d===_0x4abb7f[_0xcdc3('0x2f')]-0x1?_0x1045e8['priority']+_0x52f2f2[_0xcdc3('0x2f')]+_0x47a811['length']+0x2:_0x1045e8[_0xcdc3('0x11')]+_0x23169d+0x1;_0x52f2f2[_0xcdc3('0x38')](_0x23169d,0x0,{'type':_0x28470d['type'],'app':_0xcdc3('0x39'),'appdata':_0x4abb7f[_0x23169d]+'?'+_0x28470d[_0xcdc3('0x19')]+',${EXTEN},'+_0x3d5097+':'+_0x28470d[_0xcdc3('0x19')]+',${EXTEN},'+_0x2efdff,'exten':_0x28470d[_0xcdc3('0x6')],'context':_0x28470d[_0xcdc3('0x19')],'priority':_0x1045e8[_0xcdc3('0x11')]+_0x23169d,'VoiceExtensionId':_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0x12')]});}_0x28470d[_0xcdc3('0x11')]=_0x52f2f2[_0xcdc3('0x2f')]?_[_0xcdc3('0x3a')](_0x52f2f2)[_0xcdc3('0x11')]+0x1:_0x1045e8[_0xcdc3('0x11')];_0x1045e8[_0xcdc3('0x11')]=(_0x47a811[_0xcdc3('0x2f')]?_[_0xcdc3('0x3a')](_0x47a811)[_0xcdc3('0x11')]:_0x28470d[_0xcdc3('0x11')])+0x1;_0x1045e8[_0xcdc3('0xd')]=_[_0xcdc3('0x3b')](_0x1045e8[_0xcdc3('0xd')],_0x52f2f2,[_0x28470d],_0x47a811);}_0x1045e8[_0xcdc3('0xd')][_0xcdc3('0x1a')]({'type':_0x43cb33[_0xe3e42c][0x0]['type'],'app':_0xcdc3('0x3c'),'exten':_0x43cb33[_0xe3e42c][0x0]['exten'],'context':_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0x19')],'priority':_0x1045e8[_0xcdc3('0x11')],'VoiceExtensionId':_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0x12')]});_0x17086d[_0xcdc3('0x1a')](_0x43cb33[_0xe3e42c][0x0][_0xcdc3('0x12')]);_0x1bdf8c=_[_0xcdc3('0x3b')](_0x1bdf8c,_0x1045e8['extensions']);}}return _0x5f42ae[_0xcdc3('0x3d')](function(_0x1c138f){return _0x5f42ae[_0xcdc3('0x0')][_0xcdc3('0x2')][_0xcdc3('0x3e')]({'where':{'VoiceExtensionId':{'$in':_0x17086d}},'transaction':_0x1c138f})[_0xcdc3('0x4')](function(_0x395200){return _0x5f42ae[_0xcdc3('0x0')][_0xcdc3('0x2')]['bulkCreate'](_[_0xcdc3('0x3f')](_0x1bdf8c,_0xcdc3('0x11')),{'transaction':_0x1c138f});});});})['catch'](function(_0x3a713f){console[_0xcdc3('0x40')](_0x3a713f);});}exports[_0xcdc3('0x41')]=rewrite; \ No newline at end of file +var _0x25e3=['VoiceExtensionId','push','Set','CDR(destination)=','cutdigits','${EXTEN:','priority','CDR(routeid)=','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=noprefix','outboundrouteid=','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','recordingFormat','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','tag','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','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','destroy','sortBy','catch','error','rewrite','lodash','util','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','playback','hasOwnProperty','extensions','extension','find','format','type','context'];(function(_0x2ad21f,_0x1ec114){var _0x4c1c1f=function(_0x40840a){while(--_0x40840a){_0x2ad21f['push'](_0x2ad21f['shift']());}};_0x4c1c1f(++_0x1ec114);}(_0x25e3,0xc3));var _0x325e=function(_0x779653,_0x55423d){_0x779653=_0x779653-0x0;var _0x2daba1=_0x25e3[_0x779653];return _0x2daba1;};'use strict';var _=require(_0x325e('0x0'));var util=require(_0x325e('0x1'));function rewrite(_0x1655b3,_0x3bddb9){var _0x9d5857=this;return _0x1655b3[_0x325e('0x2')][_0x325e('0x3')][_0x325e('0x4')]({'raw':!![]})[_0x325e('0x5')](function(_0x256821){_0x9d5857[_0x325e('0x6')]=_0x256821;return _0x1655b3['models'][_0x325e('0x7')][_0x325e('0x4')]({'where':{'IntervalId':_0x3bddb9[_0x325e('0x8')]},'raw':!![]});})[_0x325e('0x5')](function(_0x1cf87b){return _0x1655b3['models']['VoiceExtension']['findAll']({'where':{'exten':{'$in':_['uniq'](_['map'](_0x1cf87b,_0x325e('0x9')))}},'order':[{'raw':_0x325e('0xa')}],'raw':!![]});})['then'](function(_0x11df2e){var _0x2be750=_['filter'](_0x11df2e,{'priority':'1'});var _0x36e00d=_[_0x325e('0xb')](_0x11df2e,{'isApp':0x1});var _0x29035c=_[_0x325e('0xc')](_0x36e00d,_0x325e('0x9'));var _0xa49c4=['queue',_0x325e('0xd')];var _0x5cd73c=[];var _0x2b2664=[];for(var _0x1b3ce9 in _0x29035c){if(_0x29035c[_0x325e('0xe')](_0x1b3ce9)){_0x9d5857['priority']=0x2;_0x9d5857[_0x325e('0xf')]=[];_0x9d5857[_0x325e('0x10')]=_[_0x325e('0x11')](_0x2be750,{'exten':_0x29035c[_0x1b3ce9][0x0]['exten']});_0x9d5857[_0x325e('0xf')]['push']({'type':_0x29035c[_0x1b3ce9][0x0]['type'],'app':'Set','appdata':util[_0x325e('0x12')]('CDR(type)=%s',_0x29035c[_0x1b3ce9][0x0][_0x325e('0x13')]),'context':_0x29035c[_0x1b3ce9][0x0][_0x325e('0x14')],'exten':_0x29035c[_0x1b3ce9][0x0][_0x325e('0x9')],'priority':_0x9d5857['priority']++,'VoiceExtensionId':_0x29035c[_0x1b3ce9][0x0][_0x325e('0x15')]});if(_0x29035c[_0x1b3ce9][0x0][_0x325e('0x13')]==='outbound'){if(_0x9d5857['extension']){_0x9d5857['extensions'][_0x325e('0x16')]({'type':_0x29035c[_0x1b3ce9][0x0][_0x325e('0x13')],'app':_0x325e('0x17'),'appdata':_0x325e('0x18')+(_0x9d5857[_0x325e('0x10')][_0x325e('0x19')]?_0x325e('0x1a')+_0x9d5857[_0x325e('0x10')][_0x325e('0x19')]+'}':'${EXTEN}'),'context':_0x29035c[_0x1b3ce9][0x0][_0x325e('0x14')],'exten':_0x29035c[_0x1b3ce9][0x0][_0x325e('0x9')],'priority':_0x9d5857[_0x325e('0x1b')]++,'VoiceExtensionId':_0x29035c[_0x1b3ce9][0x0][_0x325e('0x15')]});}_0x9d5857['extensions'][_0x325e('0x16')]({'type':_0x29035c[_0x1b3ce9][0x0][_0x325e('0x13')],'app':'Set','appdata':_0x325e('0x1c')+_0x29035c[_0x1b3ce9][0x0][_0x325e('0x15')],'context':_0x29035c[_0x1b3ce9][0x0][_0x325e('0x14')],'exten':_0x29035c[_0x1b3ce9][0x0][_0x325e('0x9')],'priority':_0x9d5857[_0x325e('0x1b')]++,'VoiceExtensionId':_0x29035c[_0x1b3ce9][0x0][_0x325e('0x15')]});var _0x15e170=_0x9d5857['priority']++;_0x9d5857['extensions'][_0x325e('0x16')]({'type':_0x29035c[_0x1b3ce9][0x0][_0x325e('0x13')],'app':'ExecIf','appdata':_0x325e('0x1d')+(_0x15e170+0x2)+'):Goto('+(_0x15e170+0x1)+')','context':_0x29035c[_0x1b3ce9][0x0][_0x325e('0x14')],'exten':_0x29035c[_0x1b3ce9][0x0][_0x325e('0x9')],'priority':_0x15e170,'VoiceExtensionId':_0x29035c[_0x1b3ce9][0x0]['VoiceExtensionId']});if(_0x9d5857['extension']){_0x9d5857[_0x325e('0xf')][_0x325e('0x16')]({'type':_0x29035c[_0x1b3ce9][0x0][_0x325e('0x13')],'app':'Set','appdata':_0x9d5857[_0x325e('0x10')][_0x325e('0x19')]?'CDR(prefix)=${EXTEN:0:'+_0x9d5857[_0x325e('0x10')]['cutdigits']+'}':_0x325e('0x1e'),'context':_0x29035c[_0x1b3ce9][0x0]['context'],'exten':_0x29035c[_0x1b3ce9][0x0]['exten'],'priority':_0x9d5857[_0x325e('0x1b')]++,'VoiceExtensionId':_0x29035c[_0x1b3ce9][0x0][_0x325e('0x15')]});}_0x9d5857['extensions'][_0x325e('0x16')]({'type':_0x29035c[_0x1b3ce9][0x0][_0x325e('0x13')],'app':_0x325e('0x17'),'appdata':_0x325e('0x1f')+_0x29035c[_0x1b3ce9][0x0][_0x325e('0x15')],'context':_0x29035c[_0x1b3ce9][0x0]['context'],'exten':_0x29035c[_0x1b3ce9][0x0][_0x325e('0x9')],'priority':_0x9d5857['priority']++,'VoiceExtensionId':_0x29035c[_0x1b3ce9][0x0]['VoiceExtensionId']});if(_0x9d5857[_0x325e('0x10')]&&_0x9d5857[_0x325e('0x10')][_0x325e('0xe')]('recordingFormat')&&_0x9d5857['extension']['recordingFormat']!==_0x325e('0x20')){_0x9d5857[_0x325e('0xf')]['push']({'type':_0x29035c[_0x1b3ce9][0x0][_0x325e('0x13')],'app':_0x325e('0x17'),'appdata':_0x325e('0x21'),'context':_0x29035c[_0x1b3ce9][0x0][_0x325e('0x14')],'exten':_0x29035c[_0x1b3ce9][0x0]['exten'],'priority':_0x9d5857[_0x325e('0x1b')]++,'VoiceExtensionId':_0x29035c[_0x1b3ce9][0x0]['VoiceExtensionId']});_0x9d5857[_0x325e('0xf')][_0x325e('0x16')]({'type':_0x29035c[_0x1b3ce9][0x0]['type'],'app':'Set','appdata':_0x325e('0x22')+_0x9d5857[_0x325e('0x10')][_0x325e('0x23')]||_0x325e('0x24'),'context':_0x29035c[_0x1b3ce9][0x0][_0x325e('0x14')],'exten':_0x29035c[_0x1b3ce9][0x0][_0x325e('0x9')],'priority':_0x9d5857[_0x325e('0x1b')]++,'VoiceExtensionId':_0x29035c[_0x1b3ce9][0x0][_0x325e('0x15')]});}}_0x9d5857[_0x325e('0xf')][_0x325e('0x16')]({'type':_0x29035c[_0x1b3ce9][0x0][_0x325e('0x13')],'app':_0x325e('0x17'),'appdata':_0x325e('0x25'),'context':_0x29035c[_0x1b3ce9][0x0][_0x325e('0x14')],'exten':_0x29035c[_0x1b3ce9][0x0]['exten'],'priority':_0x9d5857[_0x325e('0x1b')]++,'VoiceExtensionId':_0x29035c[_0x1b3ce9][0x0][_0x325e('0x15')]});_0x9d5857[_0x325e('0xf')][_0x325e('0x16')]({'type':_0x29035c[_0x1b3ce9][0x0][_0x325e('0x13')],'app':_0x325e('0x17'),'appdata':_0x325e('0x26'),'context':_0x29035c[_0x1b3ce9][0x0][_0x325e('0x14')],'exten':_0x29035c[_0x1b3ce9][0x0][_0x325e('0x9')],'priority':_0x9d5857[_0x325e('0x1b')]++,'VoiceExtensionId':_0x29035c[_0x1b3ce9][0x0][_0x325e('0x15')]});_0x9d5857[_0x325e('0xf')][_0x325e('0x16')]({'type':_0x29035c[_0x1b3ce9][0x0][_0x325e('0x13')],'app':'Set','appdata':_0x325e('0x27'),'context':_0x29035c[_0x1b3ce9][0x0][_0x325e('0x14')],'exten':_0x29035c[_0x1b3ce9][0x0][_0x325e('0x9')],'priority':_0x9d5857['priority']++,'VoiceExtensionId':_0x29035c[_0x1b3ce9][0x0][_0x325e('0x15')]});for(var _0xdc6f58=0x0,_0x2781c6=0x0;_0xdc6f58<_0x29035c[_0x1b3ce9][_0x325e('0x28')];_0xdc6f58+=0x1,_0x2781c6=0x0){var _0x1acbb6=_0x29035c[_0x1b3ce9][_0xdc6f58];if(_0x1acbb6[_0x325e('0x13')]){_0x1acbb6[_0x325e('0x13')]=_0x1acbb6[_0x325e('0x13')][_0x325e('0x29')]();}var _0x365138=[];var _0x26cfc9=[];delete _0x1acbb6['id'];delete _0x1acbb6[_0x325e('0x2a')];delete _0x1acbb6[_0x325e('0x2b')];var _0x507e19=_0x1acbb6[_0x325e('0x2c')]!==_0x325e('0x2d')?[_0x1acbb6[_0x325e('0x2c')]]:_0x1acbb6['IntervalId']?_['map'](_[_0x325e('0xb')](_0x9d5857[_0x325e('0x6')],{'IntervalId':_0x1acbb6[_0x325e('0x8')]}),_0x325e('0x2c')):[];if(_0x1acbb6[_0x325e('0xe')]('tag')){if(_0x1acbb6[_0x325e('0x2e')]&&_0x1acbb6[_0x325e('0x2e')]!=='--'){_0x365138[_0x325e('0x16')]({'type':_0x1acbb6[_0x325e('0x13')],'app':_0x325e('0x17'),'appdata':'CDR(tag)='+_0x1acbb6[_0x325e('0x2e')],'context':_0x1acbb6[_0x325e('0x14')],'exten':_0x1acbb6[_0x325e('0x9')],'priority':_0x507e19['length']+_0x9d5857['priority']+_0x2781c6++,'VoiceExtensionId':_0x1acbb6[_0x325e('0x15')]});}}if(_0x1acbb6[_0x325e('0x13')]===_0x325e('0x2f')&&_0x1acbb6[_0x325e('0xe')](_0x325e('0x30'))){if(_0x1acbb6['callerID']){_0x365138[_0x325e('0x16')]({'type':_0x1acbb6['type'],'app':_0x325e('0x31'),'appdata':_0x325e('0x32')+_0x1acbb6['callerID']+')','context':_0x1acbb6[_0x325e('0x14')],'exten':_0x1acbb6[_0x325e('0x9')],'priority':_0x507e19['length']+_0x9d5857['priority']+_0x2781c6++,'VoiceExtensionId':_0x1acbb6[_0x325e('0x15')]});}else{_0x365138['push']({'type':_0x1acbb6[_0x325e('0x13')],'app':'ExecIf','appdata':_0x325e('0x33'),'context':_0x1acbb6[_0x325e('0x14')],'exten':_0x1acbb6[_0x325e('0x9')],'priority':_0x507e19['length']+_0x9d5857['priority']+_0x2781c6++,'VoiceExtensionId':_0x1acbb6[_0x325e('0x15')]});}}if(_0x1acbb6[_0x325e('0xe')](_0x325e('0x34'))){if(_0xa49c4[_0x325e('0x35')](_0x1acbb6[_0x325e('0x36')][_0x325e('0x29')]())>=0x0&&_0x1acbb6[_0x325e('0x37')]!==_0x325e('0x38')){if(_0x1acbb6[_0x325e('0x34')]){_0x365138[_0x325e('0x16')]({'type':_0x1acbb6[_0x325e('0x13')],'app':'ExecIf','appdata':_0x325e('0x39'),'context':_0x1acbb6[_0x325e('0x14')],'exten':_0x1acbb6[_0x325e('0x9')],'priority':_0x507e19[_0x325e('0x28')]+_0x9d5857[_0x325e('0x1b')]+_0x2781c6++,'VoiceExtensionId':_0x1acbb6[_0x325e('0x15')]});_0x365138['push']({'type':_0x1acbb6[_0x325e('0x13')],'app':'Set','appdata':_0x325e('0x3a'),'context':_0x1acbb6['context'],'exten':_0x1acbb6[_0x325e('0x9')],'priority':_0x507e19[_0x325e('0x28')]+_0x9d5857[_0x325e('0x1b')]+_0x2781c6++,'VoiceExtensionId':_0x1acbb6['VoiceExtensionId']});}else{_0x365138['push']({'type':_0x1acbb6[_0x325e('0x13')],'app':_0x325e('0x31'),'appdata':_0x325e('0x3b'),'context':_0x1acbb6['context'],'exten':_0x1acbb6['exten'],'priority':_0x507e19[_0x325e('0x28')]+_0x9d5857[_0x325e('0x1b')]+_0x2781c6++,'VoiceExtensionId':_0x1acbb6[_0x325e('0x15')]});_0x365138['push']({'type':_0x1acbb6[_0x325e('0x13')],'app':_0x325e('0x17'),'appdata':_0x325e('0x3c'),'context':_0x1acbb6[_0x325e('0x14')],'exten':_0x1acbb6['exten'],'priority':_0x507e19['length']+_0x9d5857['priority']+_0x2781c6++,'VoiceExtensionId':_0x1acbb6[_0x325e('0x15')]});}}}for(var _0x19aba7=0x0;_0x19aba7<_0x507e19[_0x325e('0x28')];_0x19aba7+=0x1){var _0x25b8f8=_0x9d5857['priority']+_0x507e19['length'];var _0x2f0791=_0x19aba7===_0x507e19[_0x325e('0x28')]-0x1?_0x9d5857[_0x325e('0x1b')]+_0x365138[_0x325e('0x28')]+_0x26cfc9[_0x325e('0x28')]+0x2:_0x9d5857[_0x325e('0x1b')]+_0x19aba7+0x1;_0x365138[_0x325e('0x3d')](_0x19aba7,0x0,{'type':_0x1acbb6[_0x325e('0x13')],'app':_0x325e('0x3e'),'appdata':_0x507e19[_0x19aba7]+'?'+_0x1acbb6[_0x325e('0x14')]+_0x325e('0x3f')+_0x25b8f8+':'+_0x1acbb6[_0x325e('0x14')]+_0x325e('0x3f')+_0x2f0791,'exten':_0x1acbb6[_0x325e('0x9')],'context':_0x1acbb6['context'],'priority':_0x9d5857[_0x325e('0x1b')]+_0x19aba7,'VoiceExtensionId':_0x29035c[_0x1b3ce9][0x0][_0x325e('0x15')]});}_0x1acbb6[_0x325e('0x1b')]=_0x365138[_0x325e('0x28')]?_[_0x325e('0x40')](_0x365138)[_0x325e('0x1b')]+0x1:_0x9d5857[_0x325e('0x1b')];_0x9d5857[_0x325e('0x1b')]=(_0x26cfc9[_0x325e('0x28')]?_[_0x325e('0x40')](_0x26cfc9)[_0x325e('0x1b')]:_0x1acbb6[_0x325e('0x1b')])+0x1;_0x9d5857[_0x325e('0xf')]=_[_0x325e('0x41')](_0x9d5857[_0x325e('0xf')],_0x365138,[_0x1acbb6],_0x26cfc9);}_0x9d5857[_0x325e('0xf')]['push']({'type':_0x29035c[_0x1b3ce9][0x0][_0x325e('0x13')],'app':_0x325e('0x42'),'exten':_0x29035c[_0x1b3ce9][0x0][_0x325e('0x9')],'context':_0x29035c[_0x1b3ce9][0x0][_0x325e('0x14')],'priority':_0x9d5857[_0x325e('0x1b')],'VoiceExtensionId':_0x29035c[_0x1b3ce9][0x0][_0x325e('0x15')]});_0x5cd73c[_0x325e('0x16')](_0x29035c[_0x1b3ce9][0x0][_0x325e('0x15')]);_0x2b2664=_[_0x325e('0x41')](_0x2b2664,_0x9d5857[_0x325e('0xf')]);}}return _0x1655b3['transaction'](function(_0x23c168){return _0x1655b3[_0x325e('0x2')][_0x325e('0x7')][_0x325e('0x43')]({'where':{'VoiceExtensionId':{'$in':_0x5cd73c}},'transaction':_0x23c168})[_0x325e('0x5')](function(_0x943086){return _0x1655b3[_0x325e('0x2')]['VoiceExtension']['bulkCreate'](_[_0x325e('0x44')](_0x2b2664,'priority'),{'transaction':_0x23c168});});});})[_0x325e('0x45')](function(_0x9bb9f9){console[_0x325e('0x46')](_0x9bb9f9);});}exports[_0x325e('0x47')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 00d86ad..6c047fc 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 _0x6033=['updatedAt','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','\x20=\x20?','str','calleridnum','cm_hopper_final','cm_hopper_black','id\x20IN\x20?','VoiceQueue','findAll','outbound','Lists','dialCheckDuplicateType','always','sequelize','query','onlyIfOpen','VoiceQueueId','CmList','BlackLists','all','CampaignId','Campaign','get','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','stringify','finally','emit','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','info','CSV\x20import\x20process\x20stopped!','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','bluebird','util','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','defaults','redis','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName\x20not\x20specified!','phone','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','checkHopper','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','select','field','toString','NOW()','createdAt'];(function(_0x4fa438,_0x1f15a7){var _0x4e3958=function(_0x28f510){while(--_0x28f510){_0x4fa438['push'](_0x4fa438['shift']());}};_0x4e3958(++_0x1f15a7);}(_0x6033,0x10a));var _0x3603=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6033[_0x20a584];return _0x4b41a8;};'use strict';var BPromise=require(_0x3603('0x0'));var util=require(_0x3603('0x1'));var _=require('lodash');var fs=require('fs');var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0x3603('0x2'));var db=require(_0x3603('0x3'))['db'];var config=require(_0x3603('0x4'));var logger=require(_0x3603('0x5'))(_0x3603('0x6'));config['redis']=_[_0x3603('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3603('0x8')]));require(_0x3603('0x9'))[_0x3603('0xa')](socket);try{if(!process[_0x3603('0xb')][0x2]||process[_0x3603('0xb')][0x2]===_0x3603('0xc')||process[_0x3603('0xb')][0x2]===_0x3603('0xd')){throw new Error(_0x3603('0xe'));}var FILEPATH=process['argv'][0x2];if(!process[_0x3603('0xb')][0x3]||process[_0x3603('0xb')][0x3]===_0x3603('0xc')||process[_0x3603('0xb')][0x3]===_0x3603('0xd')||!process[_0x3603('0xb')][0x4]||process[_0x3603('0xb')][0x4]===_0x3603('0xc')||process['argv'][0x4]===_0x3603('0xd')){throw new Error(_0x3603('0xf'));}var FIELDS=_[_0x3603('0x10')](process[_0x3603('0xb')][0x3][_0x3603('0x11')](','),process['argv'][0x4][_0x3603('0x11')](','));if(!process[_0x3603('0xb')][0x5]||process[_0x3603('0xb')][0x5]===_0x3603('0xc')||process[_0x3603('0xb')][0x5]===_0x3603('0xd')){throw new Error(_0x3603('0x12'));}var LISTID=process[_0x3603('0xb')][0x5];var COMPANYID=process[_0x3603('0xb')][0x6]&&process[_0x3603('0xb')][0x6]!==_0x3603('0xc')&&process['argv'][0x6]!==_0x3603('0xd')?process[_0x3603('0xb')][0x6]:null;var DUPLICATES=process[_0x3603('0xb')][0x7]&&process[_0x3603('0xb')][0x7]!==_0x3603('0xc')&&process[_0x3603('0xb')][0x7]!==_0x3603('0xd')?process[_0x3603('0xb')][0x7]:null;if(!process[_0x3603('0xb')][0x8]||process[_0x3603('0xb')][0x8]===_0x3603('0xc')||process[_0x3603('0xb')][0x8]==='null'){throw new Error(_0x3603('0x13'));}var SOCKET_TIMESTAMP=process[_0x3603('0xb')][0x8];}catch(_0x6a7de7){logger[_0x3603('0x14')](_0x6a7de7);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(_0x477a4a,_0x1df6e1,_0x1c8135,_0xcb47de){var _0x432a7a={'message':_0x1df6e1};_0x432a7a[_0x477a4a]=!![];if(_0x1c8135){_0x432a7a[_0x3603('0x15')]=_0x1c8135;}if(_0xcb47de){_0x432a7a[_0x3603('0x16')]=_0xcb47de;}return _0x432a7a;}function isEmail(_0x36c54d){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))*$/[_0x3603('0x17')](_0x36c54d);}function checkRow(_0x41aef8,_0x2a68c7,_0x1140fc){return new BPromise(function(_0x134767,_0x167196){if(_[_0x3603('0x18')](_0x41aef8)){return _0x167196(handleCheckRowError(_0x3603('0x14'),_0x3603('0x19'),null,_0x1140fc));}if(_0x41aef8[_0x3603('0x1a')]&&_0x41aef8['errors'][_0x3603('0x1b')]){var _0x54d24a=_[_0x3603('0x1c')](_0x41aef8['errors'],_0x3603('0x1d'))[_0x3603('0x1e')](';');return _0x167196(handleCheckRowError(_0x3603('0x14'),_0x54d24a,null,_0x1140fc));}var _0x193116={};for(var _0x3f899d in FIELDS){if(FIELDS[_0x3603('0x1f')](_0x3f899d)&&FIELDS[_0x3f899d]){_0x193116[_0x3f899d]=_0x41aef8[_0x3603('0x20')][0x0][FIELDS[_0x3f899d]]||_0x41aef8[_0x3603('0x20')][0x0]['\ufeff'+FIELDS[_0x3f899d]];}}if(!_0x193116['firstName']){return _0x167196(handleCheckRowError('error',_0x3603('0x21'),null,_0x1140fc));}if(!_0x193116[_0x3603('0x22')]){return _0x167196(handleCheckRowError('error','phone\x20not\x20specified!',null,_0x1140fc));}if(_0x193116['birthDate']){var _0xb75f24=moment(_0x193116[_0x3603('0x23')],'YYYY-MM-DD');if(!_0xb75f24[_0x3603('0x24')]()){return _0x167196(handleCheckRowError(_0x3603('0x14'),_0x3603('0x25'),null,_0x1140fc));}}if(_0x193116[_0x3603('0x26')]){if(!isEmail(_0x193116['email'])){return _0x167196(handleCheckRowError(_0x3603('0x14'),_0x3603('0x27'),null,_0x1140fc));}}_0x193116[_0x3603('0x28')]=LISTID;_0x193116[_0x3603('0x29')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x2a68c7){var _0x2ad1f9={};for(var _0x5bfbe4=0x0,_0x46eefb=DUPLICATES[_0x3603('0x1b')];_0x5bfbe4<_0x46eefb;_0x5bfbe4+=0x1){_0x2ad1f9[DUPLICATES[_0x5bfbe4]]=_0x193116[DUPLICATES[_0x5bfbe4]];}var _0x5aaeed=_[_0x3603('0x2a')](_0x2a68c7,_0x2ad1f9);if(_0x5aaeed){return _0x167196(handleCheckRowError(_0x3603('0x2b'),_0x3603('0x2c'),_0x5aaeed,_0x1140fc));}}return db[_0x3603('0x2d')][_0x3603('0x2e')](_0x193116,{'raw':!![],'hooks':![],'fields':_['keys'](_0x193116)})[_0x3603('0x2f')](function(_0x4d47b8){if(DUPLICATES&&DUPLICATES[_0x3603('0x1b')]&&_0x2a68c7){_0x2a68c7[_0x3603('0x30')](_[_0x3603('0x31')](_0x193116,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x4d47b8['id'];return _0x134767();})[_0x3603('0x32')](function(_0x401b30){return _0x167196(handleCheckRowError(_0x3603('0x14'),_0x3603('0x33')+(_0x401b30[_0x3603('0x1d')]||JSON['stringify'](_0x401b30)),null,_0x1140fc));});});}function checkHopper(){function _0x967465(){return function(_0xf3eb00){logger['error']('cmContact',_0x3603('0x34'),util['inspect'](_0xf3eb00,{'showHidden':![],'depth':null}));};}var _0x1f4af3=function(_0x1c4da7,_0x4e4ab3){var _0x525dd0=squel[_0x3603('0x35')]()[_0x3603('0x36')](_0x3603('0x37'))[_0x3603('0x38')]([_0x3603('0x22'),_0x3603('0x39'),_0x3603('0x3a'),'ListId',_0x4e4ab3,'createdAt','updatedAt'],squel[_0x3603('0x3b')]()[_0x3603('0x3c')](_0x3603('0x22'),_0x3603('0x22'))[_0x3603('0x3c')]('NOW()','scheduledAt')[_0x3603('0x3c')]('id',_0x3603('0x3a'))[_0x3603('0x3c')](LISTID[_0x3603('0x3d')](),'ListId')[_0x3603('0x3c')](_0x1c4da7['id'][_0x3603('0x3d')](),_0x4e4ab3)[_0x3603('0x3c')](_0x3603('0x3e'),_0x3603('0x3f'))[_0x3603('0x3c')](_0x3603('0x3e'),_0x3603('0x40'))['from'](_0x3603('0x41'))[_0x3603('0x42')](_0x3603('0x43'))[_0x3603('0x42')](_0x3603('0x44'),LISTID[_0x3603('0x3d')]())['where'](_0x3603('0x45'))['where'](_0x3603('0x46'),squel['select']()[_0x3603('0x3c')](_0x3603('0x22'))[_0x3603('0x47')]('cm_hopper')[_0x3603('0x42')](_0x4e4ab3+_0x3603('0x48'),_0x1c4da7['id'][_0x3603('0x3d')]())))[_0x3603('0x3d')]();return _0x525dd0;};var _0xc0cfcf=function(_0x33c3ec,_0x54e904){var _0x3b071c=squel[_0x3603('0x35')]()[_0x3603('0x36')](_0x3603('0x37'))[_0x3603('0x38')]([_0x3603('0x22'),_0x3603('0x39'),_0x3603('0x3a'),_0x3603('0x28'),_0x54e904,_0x3603('0x3f'),_0x3603('0x40')],squel[_0x3603('0x3b')]()[_0x3603('0x3c')]('phone','phone')['field'](_0x3603('0x3e'),_0x3603('0x39'))[_0x3603('0x3c')]('id',_0x3603('0x3a'))[_0x3603('0x3c')](LISTID[_0x3603('0x3d')](),_0x3603('0x28'))[_0x3603('0x3c')](_0x33c3ec['id'][_0x3603('0x3d')](),_0x54e904)[_0x3603('0x3c')]('NOW()',_0x3603('0x3f'))[_0x3603('0x3c')]('NOW()',_0x3603('0x40'))['from'](_0x3603('0x41'))['where'](_0x3603('0x43'))[_0x3603('0x42')](_0x3603('0x44'),LISTID['toString']())[_0x3603('0x42')]('id\x20IN\x20?',squel[_0x3603('0x49')](hopperContacts))[_0x3603('0x42')]('phone\x20IS\x20NOT\x20NULL')[_0x3603('0x42')](_0x3603('0x46'),squel['select']()[_0x3603('0x3c')](_0x3603('0x4a'))[_0x3603('0x47')](_0x3603('0x4b'))['where'](_0x54e904+_0x3603('0x48'),_0x33c3ec['id'][_0x3603('0x3d')]()))[_0x3603('0x42')](_0x3603('0x46'),squel[_0x3603('0x3b')]()[_0x3603('0x3c')](_0x3603('0x22'))[_0x3603('0x47')](_0x3603('0x37'))[_0x3603('0x42')](_0x54e904+_0x3603('0x48'),_0x33c3ec['id'][_0x3603('0x3d')]())))[_0x3603('0x3d')]();return _0x3b071c;};function _0x394808(_0x4b1f0b,_0x2211f3){var _0x5348fe=squel['insert']()[_0x3603('0x36')](_0x3603('0x37'))[_0x3603('0x38')]([_0x3603('0x22'),_0x3603('0x39'),'ContactId',_0x3603('0x28'),_0x2211f3,_0x3603('0x3f'),'updatedAt'],squel[_0x3603('0x3b')]()[_0x3603('0x3c')](_0x3603('0x22'),'phone')[_0x3603('0x3c')]('NOW()',_0x3603('0x39'))[_0x3603('0x3c')]('id','ContactId')[_0x3603('0x3c')](LISTID['toString'](),'ListId')['field'](_0x4b1f0b['id'][_0x3603('0x3d')](),_0x2211f3)[_0x3603('0x3c')](_0x3603('0x3e'),_0x3603('0x3f'))[_0x3603('0x3c')](_0x3603('0x3e'),_0x3603('0x40'))[_0x3603('0x47')](_0x3603('0x41'))[_0x3603('0x42')]('deletedAt\x20IS\x20NULL')['where'](_0x3603('0x44'),LISTID[_0x3603('0x3d')]())[_0x3603('0x42')]('id\x20IN\x20?',squel[_0x3603('0x49')](hopperContacts))[_0x3603('0x42')](_0x3603('0x45')))[_0x3603('0x3d')]();return _0x5348fe;}function _0x4fc49a(_0x41f173,_0x4cbbcc){var _0x1c8fe0=squel[_0x3603('0x35')]()['into'](_0x3603('0x4c'))['fromQuery'](['phone','ContactId',_0x3603('0x28'),_0x4cbbcc,_0x3603('0x3f'),_0x3603('0x40')],squel[_0x3603('0x3b')]()[_0x3603('0x3c')](_0x3603('0x22'),_0x3603('0x22'))[_0x3603('0x3c')]('id','ContactId')[_0x3603('0x3c')](LISTID[_0x3603('0x3d')](),_0x3603('0x28'))[_0x3603('0x3c')](_0x41f173['id']['toString'](),_0x4cbbcc)[_0x3603('0x3c')](_0x3603('0x3e'),_0x3603('0x3f'))[_0x3603('0x3c')]('NOW()',_0x3603('0x40'))[_0x3603('0x47')](_0x3603('0x41'))[_0x3603('0x42')](_0x3603('0x43'))[_0x3603('0x42')](_0x3603('0x44'),LISTID['toString']())[_0x3603('0x42')](_0x3603('0x4d'),squel[_0x3603('0x49')](hopperContacts))[_0x3603('0x42')](_0x3603('0x45')))[_0x3603('0x3d')]();return _0x1c8fe0;}return db[_0x3603('0x4e')][_0x3603('0x4f')]({'where':{'type':_0x3603('0x50')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':_0x3603('0x51'),'where':{'id':LISTID}}]})[_0x3603('0x2f')](function(_0x2687c2){var _0x3cb567=[];if(_0x2687c2){var _0x2f6a94;for(var _0x5180d8=0x0,_0x4d448c;_0x5180d8<_0x2687c2[_0x3603('0x1b')];_0x5180d8+=0x1){_0x4d448c=_0x2687c2[_0x5180d8]['get']({'plain':!![]});switch(_0x4d448c[_0x3603('0x52')]){case _0x3603('0x53'):_0x3cb567['push'](db[_0x3603('0x54')][_0x3603('0x55')](_0xc0cfcf(_0x4d448c,'VoiceQueueId'))[_0x3603('0x2f')](function(){})[_0x3603('0x32')](_0x967465()));break;case _0x3603('0x56'):_0x3cb567[_0x3603('0x30')](db[_0x3603('0x54')][_0x3603('0x55')](_0x1f4af3(_0x4d448c,_0x3603('0x57')))[_0x3603('0x2f')](function(){})['catch'](_0x967465()));break;default:_0x3cb567[_0x3603('0x30')](db['sequelize']['query'](_0x394808(_0x4d448c,_0x3603('0x57')))[_0x3603('0x2f')](function(){})[_0x3603('0x32')](_0x967465()));}}}return _0x3cb567;})['all']()[_0x3603('0x2f')](function(){return db[_0x3603('0x4e')][_0x3603('0x4f')]({'where':{'type':_0x3603('0x50')},'attributes':['id'],'include':[{'model':db[_0x3603('0x58')],'as':_0x3603('0x59'),'where':{'id':LISTID}}]})[_0x3603('0x2f')](function(_0x5ef35d){var _0x279fb0=[];if(_0x5ef35d){var _0x28a846;for(var _0x1fc917=0x0,_0x9af1ec;_0x1fc917<_0x5ef35d[_0x3603('0x1b')];_0x1fc917+=0x1){_0x9af1ec=_0x5ef35d[_0x1fc917]['get']({'plain':!![]});_0x279fb0['push'](db[_0x3603('0x54')]['query'](_0x4fc49a(_0x9af1ec,_0x3603('0x57')))[_0x3603('0x2f')](function(){})[_0x3603('0x32')](_0x967465()));}}return _0x279fb0;})[_0x3603('0x5a')]();})['then'](function(){return db['Campaign'][_0x3603('0x4f')]({'attributes':['id',_0x3603('0x52')],'include':[{'model':db[_0x3603('0x58')],'as':'Lists','where':{'id':LISTID}}]})['then'](function(_0x52e5fd){var _0x23700a=[];if(_0x52e5fd){for(var _0x5e8e15=0x0,_0x488e53;_0x5e8e15<_0x52e5fd['length'];_0x5e8e15+=0x1){_0x488e53=_0x52e5fd[_0x5e8e15]['get']({'plain':!![]});switch(_0x488e53[_0x3603('0x52')]){case'always':_0x23700a['push'](db[_0x3603('0x54')]['query'](_0xc0cfcf(_0x488e53,_0x3603('0x5b')))[_0x3603('0x2f')](function(){})[_0x3603('0x32')](_0x967465()));break;case _0x3603('0x56'):_0x23700a['push'](db['sequelize']['query'](_0x1f4af3(_0x488e53,'CampaignId'))['then'](function(){})['catch'](_0x967465()));break;default:_0x23700a[_0x3603('0x30')](db[_0x3603('0x54')][_0x3603('0x55')](_0x394808(_0x488e53,_0x3603('0x5b')))['then'](function(){})[_0x3603('0x32')](_0x967465()));}}}return _0x23700a;})[_0x3603('0x5a')]();})['then'](function(){return db[_0x3603('0x5c')][_0x3603('0x4f')]({'attributes':['id'],'include':[{'model':db[_0x3603('0x58')],'as':'BlackLists','where':{'id':LISTID}}]})['then'](function(_0x1c8365){var _0xe464e1=[];if(_0x1c8365){for(var _0x2d72c3=0x0,_0x421f2a;_0x2d72c3<_0x1c8365['length'];_0x2d72c3+=0x1){_0x421f2a=_0x1c8365[_0x2d72c3][_0x3603('0x5d')]({'plain':!![]});_0xe464e1[_0x3603('0x30')](db[_0x3603('0x54')]['query'](_0x4fc49a(_0x421f2a,_0x3603('0x5b')))[_0x3603('0x2f')](function(){})[_0x3603('0x32')](_0x967465()));}}return _0xe464e1;})['all']();})[_0x3603('0x32')](function(_0x2462ad){logger[_0x3603('0x14')](_0x3603('0x5e'),_0x3603('0x5f'),_0x2462ad[_0x3603('0x1d')]);});}var processPromises=function(_0x405eee){return BPromise['all'](promises)[_0x3603('0x2f')](function(_0x5c0d18){})[_0x3603('0x32')](function(_0x1a732f){logger[_0x3603('0x14')](_0x3603('0x60'),JSON[_0x3603('0x61')](_0x1a732f));})[_0x3603('0x62')](function(){socket[_0x3603('0x63')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x405eee){return _0x405eee[_0x3603('0x64')]();}});};var endCsv=function(){return BPromise[_0x3603('0x65')]()[_0x3603('0x2f')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x3603('0x63')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x3603('0x66')](FILEPATH);}catch(_0x1cd9d3){logger[_0x3603('0x14')](_0x3603('0x67'),JSON['stringify'](_0x1cd9d3));}finally{process['exit'](0x0);}});};process['on'](_0x3603('0x68'),function(){logger[_0x3603('0x69')](_0x3603('0x6a'));endCsv();});function main(){return BPromise[_0x3603('0x65')]()[_0x3603('0x2f')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x3603('0x11')](',');return db[_0x3603('0x2d')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x3603('0x2f')](function(_0xd3b6c5){var _0x287124=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x287124,{'header':!![],'skipEmptyLines':!![],'step':function(_0x37f0f4,_0x34bfe3){total+=0x1;var _0x46b884=total;promises['push'](checkRow(_0x37f0f4,_0xd3b6c5,_0x46b884)[_0x3603('0x2f')](function(){success+=0x1;})[_0x3603('0x32')](function(_0x117c33){if(_0x117c33[_0x3603('0x14')]){errors+=0x1;delete _0x117c33['error'];}else if(_0x117c33[_0x3603('0x2b')]){duplicates+=0x1;delete _0x117c33[_0x3603('0x2b')];}rows['push'](_0x117c33);}));if(total%0xc8===0x0){_0x34bfe3[_0x3603('0x6b')]();return processPromises(_0x34bfe3);}},'complete':function(){return processPromises()[_0x3603('0x2f')](function(){logger[_0x3603('0x69')](_0x3603('0x6c'));endCsv();});},'error':function(_0x385690,_0x395cd4){logger[_0x3603('0x69')](_0x3603('0x6d'),JSON[_0x3603('0x61')](_0x385690));endCsv();}});})['catch'](function(_0xd3281){logger[_0x3603('0x14')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x3603('0x61')](_0xd3281));});}main(); \ No newline at end of file +var _0xfb7f=['id\x20IN\x20?','str','calleridnum','from','cm_hopper_final','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','always','sequelize','query','VoiceQueueId','onlyIfOpen','all','BlackLists','get','Campaign','CampaignId','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resolve','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','createReadStream','parse','pause','stringify','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','../../../mysqldb','../../../config/environment','../../../config/logger','api','localhost','socket.io-emitter','redis','../../../api/cmContact/cmContact.socket','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','test','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','CompanyId','find','duplicate','CmContact','create','keys','then','push','catch','Error\x20while\x20creating\x20contact:\x20','cmContact','checkHopper','insert','cm_hopper','fromQuery','scheduledAt','ListId','createdAt','updatedAt','field','ContactId','toString','NOW()','cm_contacts','where','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','\x20=\x20?','into','ListId\x20=\x20?'];(function(_0x36e9a2,_0x482c50){var _0x50945c=function(_0x1bee2e){while(--_0x1bee2e){_0x36e9a2['push'](_0x36e9a2['shift']());}};_0x50945c(++_0x482c50);}(_0xfb7f,0x103));var _0xffb7=function(_0x555c2e,_0x10eb46){_0x555c2e=_0x555c2e-0x0;var _0x15170d=_0xfb7f[_0x555c2e];return _0x15170d;};'use strict';var BPromise=require(_0xffb7('0x0'));var util=require(_0xffb7('0x1'));var _=require(_0xffb7('0x2'));var fs=require('fs');var squel=require(_0xffb7('0x3'));var Papa=require(_0xffb7('0x4'));var Redis=require('ioredis');var db=require(_0xffb7('0x5'))['db'];var config=require(_0xffb7('0x6'));var logger=require(_0xffb7('0x7'))(_0xffb7('0x8'));config['redis']=_['defaults'](config['redis'],{'host':_0xffb7('0x9'),'port':0x18eb});var socket=require(_0xffb7('0xa'))(new Redis(config[_0xffb7('0xb')]));require(_0xffb7('0xc'))['register'](socket);try{if(!process['argv'][0x2]||process[_0xffb7('0xd')][0x2]===_0xffb7('0xe')||process[_0xffb7('0xd')][0x2]==='null'){throw new Error(_0xffb7('0xf'));}var FILEPATH=process[_0xffb7('0xd')][0x2];if(!process[_0xffb7('0xd')][0x3]||process[_0xffb7('0xd')][0x3]==='undefined'||process['argv'][0x3]===_0xffb7('0x10')||!process[_0xffb7('0xd')][0x4]||process[_0xffb7('0xd')][0x4]==='undefined'||process[_0xffb7('0xd')][0x4]===_0xffb7('0x10')){throw new Error(_0xffb7('0x11'));}var FIELDS=_[_0xffb7('0x12')](process[_0xffb7('0xd')][0x3][_0xffb7('0x13')](','),process[_0xffb7('0xd')][0x4][_0xffb7('0x13')](','));if(!process[_0xffb7('0xd')][0x5]||process[_0xffb7('0xd')][0x5]==='undefined'||process['argv'][0x5]===_0xffb7('0x10')){throw new Error(_0xffb7('0x14'));}var LISTID=process['argv'][0x5];var COMPANYID=process['argv'][0x6]&&process[_0xffb7('0xd')][0x6]!==_0xffb7('0xe')&&process[_0xffb7('0xd')][0x6]!==_0xffb7('0x10')?process['argv'][0x6]:null;var DUPLICATES=process[_0xffb7('0xd')][0x7]&&process[_0xffb7('0xd')][0x7]!==_0xffb7('0xe')&&process['argv'][0x7]!=='null'?process[_0xffb7('0xd')][0x7]:null;if(!process[_0xffb7('0xd')][0x8]||process['argv'][0x8]===_0xffb7('0xe')||process['argv'][0x8]===_0xffb7('0x10')){throw new Error(_0xffb7('0x15'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x5d0db5){logger[_0xffb7('0x16')](_0x5d0db5);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(_0x286856,_0x3058c1,_0x4eb54a,_0x1dce8d){var _0x29b889={'message':_0x3058c1};_0x29b889[_0x286856]=!![];if(_0x4eb54a){_0x29b889[_0xffb7('0x17')]=_0x4eb54a;}if(_0x1dce8d){_0x29b889['index']=_0x1dce8d;}return _0x29b889;}function isEmail(_0x18847f){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))*$/[_0xffb7('0x18')](_0x18847f);}function checkRow(_0x123a5b,_0x1f8086,_0x59a047){return new BPromise(function(_0x5954b6,_0x3d98fa){if(_['isNil'](_0x123a5b)){return _0x3d98fa(handleCheckRowError('error',_0xffb7('0x19'),null,_0x59a047));}if(_0x123a5b[_0xffb7('0x1a')]&&_0x123a5b[_0xffb7('0x1a')][_0xffb7('0x1b')]){var _0x867af6=_[_0xffb7('0x1c')](_0x123a5b[_0xffb7('0x1a')],_0xffb7('0x1d'))[_0xffb7('0x1e')](';');return _0x3d98fa(handleCheckRowError(_0xffb7('0x16'),_0x867af6,null,_0x59a047));}var _0x2e5300={};for(var _0x5aa783 in FIELDS){if(FIELDS['hasOwnProperty'](_0x5aa783)&&FIELDS[_0x5aa783]){_0x2e5300[_0x5aa783]=_0x123a5b[_0xffb7('0x1f')][0x0][FIELDS[_0x5aa783]]||_0x123a5b[_0xffb7('0x1f')][0x0]['\ufeff'+FIELDS[_0x5aa783]];}}if(!_0x2e5300[_0xffb7('0x20')]){return _0x3d98fa(handleCheckRowError(_0xffb7('0x16'),_0xffb7('0x21'),null,_0x59a047));}if(!_0x2e5300[_0xffb7('0x22')]){return _0x3d98fa(handleCheckRowError(_0xffb7('0x16'),_0xffb7('0x23'),null,_0x59a047));}if(_0x2e5300[_0xffb7('0x24')]){var _0x2ea2df=moment(_0x2e5300[_0xffb7('0x24')],_0xffb7('0x25'));if(!_0x2ea2df[_0xffb7('0x26')]()){return _0x3d98fa(handleCheckRowError(_0xffb7('0x16'),_0xffb7('0x27'),null,_0x59a047));}}if(_0x2e5300['email']){if(!isEmail(_0x2e5300[_0xffb7('0x28')])){return _0x3d98fa(handleCheckRowError('error',_0xffb7('0x29'),null,_0x59a047));}}_0x2e5300['ListId']=LISTID;_0x2e5300[_0xffb7('0x2a')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xffb7('0x1b')]&&_0x1f8086){var _0x3791a9={};for(var _0x44da6a=0x0,_0x46a3c1=DUPLICATES[_0xffb7('0x1b')];_0x44da6a<_0x46a3c1;_0x44da6a+=0x1){_0x3791a9[DUPLICATES[_0x44da6a]]=_0x2e5300[DUPLICATES[_0x44da6a]];}var _0x163f39=_[_0xffb7('0x2b')](_0x1f8086,_0x3791a9);if(_0x163f39){return _0x3d98fa(handleCheckRowError(_0xffb7('0x2c'),'Duplicate\x20Contact',_0x163f39,_0x59a047));}}return db[_0xffb7('0x2d')][_0xffb7('0x2e')](_0x2e5300,{'raw':!![],'hooks':![],'fields':_[_0xffb7('0x2f')](_0x2e5300)})[_0xffb7('0x30')](function(_0x268b8a){if(DUPLICATES&&DUPLICATES[_0xffb7('0x1b')]&&_0x1f8086){_0x1f8086[_0xffb7('0x31')](_['pick'](_0x2e5300,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x268b8a['id'];return _0x5954b6();})[_0xffb7('0x32')](function(_0x11d0ce){return _0x3d98fa(handleCheckRowError(_0xffb7('0x16'),_0xffb7('0x33')+(_0x11d0ce[_0xffb7('0x1d')]||JSON['stringify'](_0x11d0ce)),null,_0x59a047));});});}function checkHopper(){function _0x1f902d(){return function(_0x468165){logger[_0xffb7('0x16')](_0xffb7('0x34'),_0xffb7('0x35'),util['inspect'](_0x468165,{'showHidden':![],'depth':null}));};}var _0x275d0e=function(_0x1805f4,_0x1240f5){var _0x568f2e=squel[_0xffb7('0x36')]()['into'](_0xffb7('0x37'))[_0xffb7('0x38')]([_0xffb7('0x22'),_0xffb7('0x39'),'ContactId',_0xffb7('0x3a'),_0x1240f5,_0xffb7('0x3b'),_0xffb7('0x3c')],squel['select']()['field']('phone','phone')[_0xffb7('0x3d')]('NOW()','scheduledAt')['field']('id',_0xffb7('0x3e'))['field'](LISTID[_0xffb7('0x3f')](),_0xffb7('0x3a'))['field'](_0x1805f4['id']['toString'](),_0x1240f5)[_0xffb7('0x3d')](_0xffb7('0x40'),_0xffb7('0x3b'))['field']('NOW()',_0xffb7('0x3c'))['from'](_0xffb7('0x41'))[_0xffb7('0x42')](_0xffb7('0x43'))[_0xffb7('0x42')]('ListId\x20=\x20?',LISTID[_0xffb7('0x3f')]())[_0xffb7('0x42')](_0xffb7('0x44'))[_0xffb7('0x42')](_0xffb7('0x45'),squel[_0xffb7('0x46')]()[_0xffb7('0x3d')]('phone')['from']('cm_hopper')[_0xffb7('0x42')](_0x1240f5+_0xffb7('0x47'),_0x1805f4['id'][_0xffb7('0x3f')]())))[_0xffb7('0x3f')]();return _0x568f2e;};var _0x59363c=function(_0x1f5985,_0x19b5b9){var _0x585591=squel[_0xffb7('0x36')]()[_0xffb7('0x48')](_0xffb7('0x37'))['fromQuery']([_0xffb7('0x22'),'scheduledAt',_0xffb7('0x3e'),_0xffb7('0x3a'),_0x19b5b9,'createdAt',_0xffb7('0x3c')],squel[_0xffb7('0x46')]()[_0xffb7('0x3d')](_0xffb7('0x22'),_0xffb7('0x22'))[_0xffb7('0x3d')](_0xffb7('0x40'),_0xffb7('0x39'))[_0xffb7('0x3d')]('id','ContactId')[_0xffb7('0x3d')](LISTID[_0xffb7('0x3f')](),'ListId')[_0xffb7('0x3d')](_0x1f5985['id'][_0xffb7('0x3f')](),_0x19b5b9)[_0xffb7('0x3d')](_0xffb7('0x40'),_0xffb7('0x3b'))[_0xffb7('0x3d')](_0xffb7('0x40'),_0xffb7('0x3c'))['from'](_0xffb7('0x41'))['where'](_0xffb7('0x43'))[_0xffb7('0x42')](_0xffb7('0x49'),LISTID[_0xffb7('0x3f')]())[_0xffb7('0x42')](_0xffb7('0x4a'),squel[_0xffb7('0x4b')](hopperContacts))[_0xffb7('0x42')](_0xffb7('0x44'))[_0xffb7('0x42')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xffb7('0x3d')](_0xffb7('0x4c'))[_0xffb7('0x4d')](_0xffb7('0x4e'))[_0xffb7('0x42')](_0x19b5b9+'\x20=\x20?',_0x1f5985['id'][_0xffb7('0x3f')]()))[_0xffb7('0x42')]('phone\x20NOT\x20IN\x20(?)',squel[_0xffb7('0x46')]()[_0xffb7('0x3d')]('phone')[_0xffb7('0x4d')](_0xffb7('0x37'))[_0xffb7('0x42')](_0x19b5b9+_0xffb7('0x47'),_0x1f5985['id'][_0xffb7('0x3f')]())))[_0xffb7('0x3f')]();return _0x585591;};function _0x49bad5(_0x3819df,_0x48780a){var _0x4982c4=squel['insert']()[_0xffb7('0x48')](_0xffb7('0x37'))[_0xffb7('0x38')]([_0xffb7('0x22'),_0xffb7('0x39'),'ContactId',_0xffb7('0x3a'),_0x48780a,_0xffb7('0x3b'),_0xffb7('0x3c')],squel['select']()[_0xffb7('0x3d')](_0xffb7('0x22'),_0xffb7('0x22'))[_0xffb7('0x3d')](_0xffb7('0x40'),_0xffb7('0x39'))[_0xffb7('0x3d')]('id',_0xffb7('0x3e'))[_0xffb7('0x3d')](LISTID[_0xffb7('0x3f')](),_0xffb7('0x3a'))[_0xffb7('0x3d')](_0x3819df['id'][_0xffb7('0x3f')](),_0x48780a)['field'](_0xffb7('0x40'),_0xffb7('0x3b'))[_0xffb7('0x3d')](_0xffb7('0x40'),'updatedAt')[_0xffb7('0x4d')]('cm_contacts')[_0xffb7('0x42')](_0xffb7('0x43'))[_0xffb7('0x42')]('ListId\x20=\x20?',LISTID[_0xffb7('0x3f')]())[_0xffb7('0x42')](_0xffb7('0x4a'),squel['str'](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0xffb7('0x3f')]();return _0x4982c4;}function _0x19bdbf(_0x12ac56,_0x19d113){var _0x2eecfc=squel[_0xffb7('0x36')]()[_0xffb7('0x48')](_0xffb7('0x4f'))['fromQuery'](['phone',_0xffb7('0x3e'),_0xffb7('0x3a'),_0x19d113,_0xffb7('0x3b'),'updatedAt'],squel['select']()['field'](_0xffb7('0x22'),_0xffb7('0x22'))[_0xffb7('0x3d')]('id','ContactId')[_0xffb7('0x3d')](LISTID['toString'](),'ListId')[_0xffb7('0x3d')](_0x12ac56['id'][_0xffb7('0x3f')](),_0x19d113)['field'](_0xffb7('0x40'),_0xffb7('0x3b'))[_0xffb7('0x3d')](_0xffb7('0x40'),_0xffb7('0x3c'))['from']('cm_contacts')['where'](_0xffb7('0x43'))[_0xffb7('0x42')](_0xffb7('0x49'),LISTID[_0xffb7('0x3f')]())[_0xffb7('0x42')]('id\x20IN\x20?',squel['str'](hopperContacts))['where'](_0xffb7('0x44')))['toString']();return _0x2eecfc;}return db[_0xffb7('0x50')][_0xffb7('0x51')]({'where':{'type':_0xffb7('0x52')},'attributes':['id',_0xffb7('0x53')],'include':[{'model':db[_0xffb7('0x54')],'as':_0xffb7('0x55'),'where':{'id':LISTID}}]})['then'](function(_0x33a82e){var _0x5a9e92=[];if(_0x33a82e){var _0x594f99;for(var _0x2023c8=0x0,_0x5e6688;_0x2023c8<_0x33a82e[_0xffb7('0x1b')];_0x2023c8+=0x1){_0x5e6688=_0x33a82e[_0x2023c8]['get']({'plain':!![]});switch(_0x5e6688[_0xffb7('0x53')]){case _0xffb7('0x56'):_0x5a9e92['push'](db[_0xffb7('0x57')][_0xffb7('0x58')](_0x59363c(_0x5e6688,_0xffb7('0x59')))['then'](function(){})[_0xffb7('0x32')](_0x1f902d()));break;case _0xffb7('0x5a'):_0x5a9e92[_0xffb7('0x31')](db[_0xffb7('0x57')][_0xffb7('0x58')](_0x275d0e(_0x5e6688,_0xffb7('0x59')))[_0xffb7('0x30')](function(){})[_0xffb7('0x32')](_0x1f902d()));break;default:_0x5a9e92['push'](db[_0xffb7('0x57')][_0xffb7('0x58')](_0x49bad5(_0x5e6688,_0xffb7('0x59')))[_0xffb7('0x30')](function(){})['catch'](_0x1f902d()));}}}return _0x5a9e92;})[_0xffb7('0x5b')]()[_0xffb7('0x30')](function(){return db[_0xffb7('0x50')][_0xffb7('0x51')]({'where':{'type':_0xffb7('0x52')},'attributes':['id'],'include':[{'model':db[_0xffb7('0x54')],'as':_0xffb7('0x5c'),'where':{'id':LISTID}}]})[_0xffb7('0x30')](function(_0x31674f){var _0x485157=[];if(_0x31674f){var _0x605a5c;for(var _0x137a9a=0x0,_0x4fe53b;_0x137a9a<_0x31674f[_0xffb7('0x1b')];_0x137a9a+=0x1){_0x4fe53b=_0x31674f[_0x137a9a][_0xffb7('0x5d')]({'plain':!![]});_0x485157[_0xffb7('0x31')](db[_0xffb7('0x57')][_0xffb7('0x58')](_0x19bdbf(_0x4fe53b,'VoiceQueueId'))[_0xffb7('0x30')](function(){})['catch'](_0x1f902d()));}}return _0x485157;})['all']();})[_0xffb7('0x30')](function(){return db[_0xffb7('0x5e')][_0xffb7('0x51')]({'attributes':['id',_0xffb7('0x53')],'include':[{'model':db[_0xffb7('0x54')],'as':_0xffb7('0x55'),'where':{'id':LISTID}}]})[_0xffb7('0x30')](function(_0x4ab77b){var _0xf56f81=[];if(_0x4ab77b){for(var _0x19921e=0x0,_0x5866b6;_0x19921e<_0x4ab77b[_0xffb7('0x1b')];_0x19921e+=0x1){_0x5866b6=_0x4ab77b[_0x19921e][_0xffb7('0x5d')]({'plain':!![]});switch(_0x5866b6[_0xffb7('0x53')]){case'always':_0xf56f81[_0xffb7('0x31')](db[_0xffb7('0x57')]['query'](_0x59363c(_0x5866b6,_0xffb7('0x5f')))[_0xffb7('0x30')](function(){})[_0xffb7('0x32')](_0x1f902d()));break;case _0xffb7('0x5a'):_0xf56f81['push'](db['sequelize']['query'](_0x275d0e(_0x5866b6,'CampaignId'))[_0xffb7('0x30')](function(){})[_0xffb7('0x32')](_0x1f902d()));break;default:_0xf56f81[_0xffb7('0x31')](db[_0xffb7('0x57')]['query'](_0x49bad5(_0x5866b6,_0xffb7('0x5f')))[_0xffb7('0x30')](function(){})['catch'](_0x1f902d()));}}}return _0xf56f81;})['all']();})[_0xffb7('0x30')](function(){return db['Campaign'][_0xffb7('0x51')]({'attributes':['id'],'include':[{'model':db[_0xffb7('0x54')],'as':'BlackLists','where':{'id':LISTID}}]})[_0xffb7('0x30')](function(_0x564d38){var _0x1f0b40=[];if(_0x564d38){for(var _0x3b40be=0x0,_0x584930;_0x3b40be<_0x564d38[_0xffb7('0x1b')];_0x3b40be+=0x1){_0x584930=_0x564d38[_0x3b40be][_0xffb7('0x5d')]({'plain':!![]});_0x1f0b40['push'](db[_0xffb7('0x57')][_0xffb7('0x58')](_0x19bdbf(_0x584930,_0xffb7('0x5f')))[_0xffb7('0x30')](function(){})[_0xffb7('0x32')](_0x1f902d()));}}return _0x1f0b40;})[_0xffb7('0x5b')]();})[_0xffb7('0x32')](function(_0x239692){logger[_0xffb7('0x16')]('cmContact,\x20%s,\x20%s',_0xffb7('0x60'),_0x239692[_0xffb7('0x1d')]);});}var processPromises=function(_0x2bde94){return BPromise['all'](promises)[_0xffb7('0x30')](function(_0x3ef36d){})[_0xffb7('0x32')](function(_0x277f5c){logger['error'](_0xffb7('0x61'),JSON['stringify'](_0x277f5c));})[_0xffb7('0x62')](function(){socket[_0xffb7('0x63')](_0xffb7('0x64')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x2bde94){return _0x2bde94['resume']();}});};var endCsv=function(){return BPromise[_0xffb7('0x65')]()[_0xffb7('0x30')](function(){if(hopperContacts){return checkHopper();}})[_0xffb7('0x30')](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x204b0f){logger[_0xffb7('0x16')](_0xffb7('0x66'),JSON['stringify'](_0x204b0f));}finally{process[_0xffb7('0x67')](0x0);}});};process['on'](_0xffb7('0x68'),function(){logger[_0xffb7('0x69')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0xffb7('0x65')]()[_0xffb7('0x30')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xffb7('0x13')](',');return db[_0xffb7('0x2d')][_0xffb7('0x51')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xffb7('0x30')](function(_0x251c8c){var _0x2da3af=fs[_0xffb7('0x6a')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xffb7('0x6b')](_0x2da3af,{'header':!![],'skipEmptyLines':!![],'step':function(_0x269948,_0x9e37e7){total+=0x1;var _0xf35b99=total;promises[_0xffb7('0x31')](checkRow(_0x269948,_0x251c8c,_0xf35b99)['then'](function(){success+=0x1;})[_0xffb7('0x32')](function(_0x1a9a6f){if(_0x1a9a6f[_0xffb7('0x16')]){errors+=0x1;delete _0x1a9a6f['error'];}else if(_0x1a9a6f[_0xffb7('0x2c')]){duplicates+=0x1;delete _0x1a9a6f['duplicate'];}rows[_0xffb7('0x31')](_0x1a9a6f);}));if(total%0xc8===0x0){_0x9e37e7[_0xffb7('0x6c')]();return processPromises(_0x9e37e7);}},'complete':function(){return processPromises()[_0xffb7('0x30')](function(){logger[_0xffb7('0x69')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x262ee5,_0x34e931){logger[_0xffb7('0x69')]('CSV\x20parse\x20error',JSON[_0xffb7('0x6d')](_0x262ee5));endCsv();}});})['catch'](function(_0x3447ed){logger[_0xffb7('0x16')](_0xffb7('0x6e'),JSON[_0xffb7('0x6d')](_0x3447ed));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 236f01f..c53216a 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 _0xf59a=['insert','into','cm_hopper','createdAt','priority','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','\x22always\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_contacts.phone','fromQuery','ContactId','updatedAt','.id\x20=\x20','.CmListId\x20=\x20?','\x20=\x20?','concat','keys','ListId','CompanyId',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','id\x20IN\x20?','MIN(id)','min_id','group','toString','info','Received\x20SIGINT','error','message','exit','errors','push','code','sequelize','query','catch','main','stringify','send','start','binding','socket_timestamp','root','.csv','header','writeFileSync','parse','createReadStream','data','length','hasOwnProperty','replace','scheduledat','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','UserId','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','SystemRow','appendFileSync','rows','emit','Abort\x20parser','abort','duplicates','cm_contacts_','CREATE\x20TABLE\x20','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','campaigns','CampaignId','each','then','finish','affectedRows','contact:import:','unlink','complete','argv','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','map','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','ioredis','../../../mysqldb','../../../config/logger','import','defaults','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId'];(function(_0x3e816c,_0x14b2ae){var _0x436f4b=function(_0x5ace27){while(--_0x5ace27){_0x3e816c['push'](_0x3e816c['shift']());}};_0x436f4b(++_0x14b2ae);}(_0xf59a,0xe9));var _0xaf59=function(_0x124619,_0x282505){_0x124619=_0x124619-0x0;var _0x3e79c8=_0xf59a[_0x124619];return _0x3e79c8;};'use strict';var fs=require('fs');var path=require(_0xaf59('0x0'));var _=require(_0xaf59('0x1'));var Papa=require(_0xaf59('0x2'));var util=require(_0xaf59('0x3'));var BPromise=require(_0xaf59('0x4'));var moment=require(_0xaf59('0x5'));var squel=require('squel');var Redis=require(_0xaf59('0x6'));var db=require(_0xaf59('0x7'))['db'];var config=require('../../../config/environment');var logger=require(_0xaf59('0x8'))(_0xaf59('0x9'));config['redis']=_[_0xaf59('0xa')](config[_0xaf59('0xb')],{'host':_0xaf59('0xc'),'port':0x18eb});var socket=require(_0xaf59('0xd'))(new Redis(config[_0xaf59('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xaf59('0xe')](_0xaf59('0xf'));function isEmail(_0x5ba062){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))*$/[_0xaf59('0x10')](_0x5ba062);}function selectNotIn(_0x44520b,_0x11ed16,_0x248491,_0x3d6b2e,_0xe93c6c){return squel[_0xaf59('0x11')]()[_0xaf59('0x12')](_0xaf59('0x13'))[_0xaf59('0x14')](_0x3d6b2e)[_0xaf59('0x15')](_0x11ed16,null,_0x11ed16+'.id\x20=\x20'+_0x3d6b2e+'.'+_0x248491)[_0xaf59('0x16')](_0x3d6b2e+'.'+_0x248491+_0xaf59('0x17')+_0x44520b+'.'+_0x248491)[_0xaf59('0x16')](_0x11ed16+_0xaf59('0x18')+_0xe93c6c[_0xaf59('0x15')]()+')');}function insertCmHopper(_0x5ccfa4,_0x11c60e,_0x52e723,_0x46397d,_0x2d7275){var _0x5aefec=['cm_contacts.phone','cm_contacts.scheduledat',_0xaf59('0x19'),_0xaf59('0x1a'),_0x11c60e+'.'+_0x46397d,_0xaf59('0x1b'),_0xaf59('0x1c'),_0xaf59('0x1d'),_0xaf59('0x1e'),'\x22'+_0x2d7275+'\x22'];return squel[_0xaf59('0x1f')]()[_0xaf59('0x20')](_0xaf59('0x21'))['fromQuery']([_0xaf59('0x13'),'scheduledat','ContactId','ListId',_0x46397d,_0xaf59('0x22'),'updatedAt',_0xaf59('0x23'),'UserId',_0xaf59('0x24')],squel[_0xaf59('0x11')]()[_0xaf59('0x25')](_0x5aefec)['from'](_0x11c60e)[_0xaf59('0x15')](_0xaf59('0x26'),null,_0xaf59('0x27')+_0x11c60e+_0xaf59('0x28'))[_0xaf59('0x15')](_0x52e723,null,_0x52e723+'.id\x20=\x20'+_0x11c60e+'.'+_0x46397d)[_0xaf59('0x16')](_0x11c60e+'.CmListId\x20=\x20?',_0x5ccfa4)[_0xaf59('0x16')]('cm_contacts.createdAt\x20=\x20?',NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x11c60e,_0x52e723,_0x46397d,_0xaf59('0x21'),[_0xaf59('0x29'),'\x22onlyIfOpen\x22']))['where'](_0xaf59('0x2a'),selectNotIn(_0x11c60e,_0x52e723,_0x46397d,'cm_hopper',['\x22always\x22'])))['toString']();}function insertCmHopperBlack(_0x372780,_0xe48e2a,_0xd841ee,_0x3ee63b){var _0x4d1456=[_0xaf59('0x2b'),_0xaf59('0x19'),'cm_contacts.ListId',_0xe48e2a+'.'+_0x3ee63b,_0xaf59('0x1b'),_0xaf59('0x1c')];return squel[_0xaf59('0x1f')]()[_0xaf59('0x20')]('cm_hopper_black')[_0xaf59('0x2c')]([_0xaf59('0x13'),_0xaf59('0x2d'),'ListId',_0x3ee63b,_0xaf59('0x22'),_0xaf59('0x2e')],squel[_0xaf59('0x11')]()[_0xaf59('0x25')](_0x4d1456)[_0xaf59('0x14')](_0xe48e2a)[_0xaf59('0x15')](_0xaf59('0x26'),null,_0xaf59('0x27')+_0xe48e2a+_0xaf59('0x28'))['join'](_0xd841ee,null,_0xd841ee+_0xaf59('0x2f')+_0xe48e2a+'.'+_0x3ee63b)[_0xaf59('0x16')](_0xe48e2a+_0xaf59('0x30'),_0x372780)[_0xaf59('0x16')]('cm_contacts.createdAt\x20=\x20?',NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0xaf59('0x11')]()[_0xaf59('0x12')]('phone')['from']('cm_hopper_black')['where']('ListId\x20=\x20?',_0x372780)[_0xaf59('0x16')](_0x3ee63b+_0xaf59('0x31'),_0xe48e2a+'.'+_0x3ee63b)))['toString']();}function insertCmContact(_0xdc867a,_0x30bdf2,_0x330b96,_0x3499eb){var _0x300f8c=_[_0xaf59('0x32')](_[_0xaf59('0x33')](_0x3499eb),[_0xaf59('0x34'),_0xaf59('0x35'),_0xaf59('0x22'),_0xaf59('0x2e')]);return squel[_0xaf59('0x1f')]()[_0xaf59('0x20')]('cm_contacts')[_0xaf59('0x2c')](_0x300f8c,squel['select']()[_0xaf59('0x25')](_0x300f8c)[_0xaf59('0x14')](_0x30bdf2)[_0xaf59('0x16')]('('+_0x330b96['join'](',')+_0xaf59('0x36'),squel[_0xaf59('0x11')]()[_0xaf59('0x25')](_0x330b96)['from'](_0xaf59('0x26'))[_0xaf59('0x16')](_0xaf59('0x37'),_0xdc867a))[_0xaf59('0x16')](_0xaf59('0x38'),squel[_0xaf59('0x11')]()['field'](_0xaf59('0x39'),_0xaf59('0x3a'))['from'](_0x30bdf2)[_0xaf59('0x3b')](_0x330b96[_0xaf59('0x15')](','))))[_0xaf59('0x3c')]();}function handleStop(){logger[_0xaf59('0x3d')](_0xaf59('0x3e'));stopped=!![];}function handleUncaughtException(_0x7e05c3){logger[_0xaf59('0x3f')](_0x7e05c3[_0xaf59('0x40')]);process[_0xaf59('0x41')](0x1);}function handleError(_0x4f17a0,_0x62e01a){stats[_0xaf59('0x42')][_0xaf59('0x43')]({'name':_0x62e01a[_0xaf59('0x44')],'message':_0x62e01a[_0xaf59('0x40')],'row':_0x4f17a0});}function handleQuery(_0x17c539){logger[_0xaf59('0x3d')](_0x17c539);return db[_0xaf59('0x45')][_0xaf59('0x46')](_0x17c539)['spread'](function(_0x37eb73){results[_0xaf59('0x43')](_0x37eb73);})[_0xaf59('0x47')](function(_0x57a289){logger[_0xaf59('0x3f')](_0x57a289[_0xaf59('0x40')]);});}function main(_0x3e9f1b,_0x4dad16,_0x16b5c3,_0x13d514){logger[_0xaf59('0x3d')](_0xaf59('0x48'),_0x3e9f1b,JSON[_0xaf59('0x49')](_0x4dad16));process[_0xaf59('0x4a')](_0xaf59('0x4b'));var _0xe36255=_0x4dad16[_0xaf59('0x4c')];var _0x2c4b93=_0x4dad16[_0xaf59('0x4d')];var _0xc6799c=path[_0xaf59('0x15')](config[_0xaf59('0x4e')],'server/files/tmp',_0x2c4b93+_0xaf59('0x4f'));var _0x2bc3e9=_['keys'](_0xe36255)['join']();logger['info'](_0xaf59('0x50'),_0x2bc3e9);fs[_0xaf59('0x51')](_0xc6799c,_0x2bc3e9+'\x0a');Papa[_0xaf59('0x52')](fs[_0xaf59('0x53')](_0x3e9f1b),{'header':!![],'skipEmptyLines':!![],'step':function(_0x2025b3,_0x327f25){try{for(var _0x273d49=0x0,_0x5b7708=[];_0x273d49<_0x2025b3[_0xaf59('0x54')][_0xaf59('0x55')];_0x273d49++){stats['rows']+=0x1;if(_0x2025b3[_0xaf59('0x42')][_0x273d49]){handleError(_0x2025b3['data'][_0x273d49],_0x2025b3['errors'][_0x273d49]);}else{var _0x46ac1a=[];for(var _0x2a8488 in _0xe36255){if(_0xe36255[_0xaf59('0x56')](_0x2a8488)){if(_0x2025b3[_0xaf59('0x54')][_0x273d49][_0xe36255[_0x2a8488]]){var _0x41611d=_['trim'](_0x2025b3[_0xaf59('0x54')][_0x273d49][_0xe36255[_0x2a8488]][_0xaf59('0x57')](/"/g,'\x27'));switch(_0x2a8488){case _0xaf59('0x58'):var _0x106c80=moment(_0x41611d,_0xaf59('0xf'),!![]);if(_0x106c80[_0xaf59('0x59')]()){_0x5b7708[_0xaf59('0x43')]('\x22'+_0x41611d+'\x22');}else{_0x46ac1a[_0xaf59('0x43')](_0xaf59('0x5a'));}break;case _0xaf59('0x23'):var _0x5038b0=parseInt(_0x41611d);_0x41611d=_['isNaN'](_0x5038b0)||_0x5038b0<0x0||_0x5038b0>0x4?_0x13d514?0x3:0x2:_0x5038b0;_0x5b7708[_0xaf59('0x43')]('\x22'+_0x41611d+'\x22');break;case _0xaf59('0x5b'):var _0x5e78c3=parseInt(_0x41611d);if(_[_0xaf59('0x5c')](_0x5e78c3)&&_[_0xaf59('0x5d')](_0x16b5c3,_0x5e78c3)){_0x5b7708[_0xaf59('0x43')]('\x22'+_0x5e78c3+'\x22');}else{_0x46ac1a['push'](_0xaf59('0x5e'));}break;case _0xaf59('0x5f'):if(isEmail(_0x41611d)){_0x5b7708['push']('\x22'+_0x41611d+'\x22');}else{_0x46ac1a[_0xaf59('0x43')](_0xaf59('0x60'));}break;case _0xaf59('0x61'):var _0x144f28=moment(_0x41611d,'YYYY-MM-DD',!![]);if(_0x144f28[_0xaf59('0x59')]()){_0x5b7708['push']('\x22'+_0x41611d+'\x22');}else{_0x46ac1a['push'](_0xaf59('0x62'));}break;default:_0x5b7708['push']('\x22'+_0x41611d+'\x22');}}else{switch(_0x2a8488){case'firstName':case _0xaf59('0x13'):_0x46ac1a[_0xaf59('0x43')](_0x2a8488+'\x20not\x20specified');break;default:_0x5b7708[_0xaf59('0x43')]('\x22\x22');}}}}if(_0x46ac1a[_0xaf59('0x55')]){handleError(_0x2025b3[_0xaf59('0x54')][_0x273d49],{'code':_0xaf59('0x63'),'message':_0x46ac1a[_0xaf59('0x15')]()});}else{fs[_0xaf59('0x64')](_0xc6799c,_0x5b7708[_0xaf59('0x15')]()+'\x0a');}_0x5b7708=[];}if(!(stats[_0xaf59('0x65')]%0xc8)){socket[_0xaf59('0x66')]('contact:import:'+_0x2c4b93,stats);stats[_0xaf59('0x42')]=[];}}if(stopped){logger[_0xaf59('0x3d')](_0xaf59('0x67'));_0x327f25[_0xaf59('0x68')]();}}catch(_0x377206){handleError(_0x2025b3[_0xaf59('0x54')][_0x273d49],{'code':'SystemError','message':_0x377206[_0xaf59('0x40')]});logger[_0xaf59('0x3f')]('step',_0x377206[_0xaf59('0x40')]);}},'complete':function(){try{var _0x3f94b8=[];var _0x210d6c=_0xaf59('0x26');if(_0x4dad16[_0xaf59('0x69')]&&_0x4dad16[_0xaf59('0x69')][_0xaf59('0x55')]){_0x210d6c=_0xaf59('0x6a')+_0x2c4b93;_0x3f94b8['push'](_0xaf59('0x6b')+_0x210d6c+'\x20LIKE\x20cm_contacts;');}var _0x4186b3=util['format'](_0xaf59('0x6c'),_0xc6799c,_0x210d6c,_0x2bc3e9,_0x4dad16[_0xaf59('0x34')],_0x4dad16[_0xaf59('0x35')]||null,NOW,NOW);if(_[_0xaf59('0x6d')](_0xe36255['scheduledat'])){_0x4186b3+=',\x20scheduledAt\x20=\x20NOW()';}_0x3f94b8['push'](_0x4186b3);if(_0x4dad16[_0xaf59('0x69')]&&_0x4dad16[_0xaf59('0x69')][_0xaf59('0x55')]){_0x3f94b8['push'](insertCmContact(_0x4dad16[_0xaf59('0x34')],_0x210d6c,_0x4dad16[_0xaf59('0x69')],_0xe36255));_0x3f94b8[_0xaf59('0x43')]('DROP\x20TABLE\x20'+_0x210d6c+';');}_0x3f94b8[_0xaf59('0x43')](insertCmHopper(_0x4dad16['ListId'],_0xaf59('0x6e'),_0xaf59('0x6f'),_0xaf59('0x70'),_0x13d514));_0x3f94b8['push'](insertCmHopperBlack(_0x4dad16['ListId'],'voice_queues_has_cm_blacklists',_0xaf59('0x6f'),_0xaf59('0x70')));_0x3f94b8[_0xaf59('0x43')](insertCmHopper(_0x4dad16[_0xaf59('0x34')],'campaigns_has_cm_lists',_0xaf59('0x71'),_0xaf59('0x72'),_0x13d514));_0x3f94b8[_0xaf59('0x43')](insertCmHopperBlack(_0x4dad16['ListId'],'campaigns_has_cm_blacklists',_0xaf59('0x71'),_0xaf59('0x72')));BPromise[_0xaf59('0x73')](_0x3f94b8,handleQuery)[_0xaf59('0x74')](function(_0xae00c0){stats[_0xaf59('0x75')]=!![];stats[_0xaf59('0x76')]=_0x4dad16[_0xaf59('0x69')]&&_0x4dad16[_0xaf59('0x69')][_0xaf59('0x55')]?results[0x2][_0xaf59('0x76')]:results[0x0][_0xaf59('0x76')];socket[_0xaf59('0x66')](_0xaf59('0x77')+_0x2c4b93,stats);fs[_0xaf59('0x78')](_0x3e9f1b);fs[_0xaf59('0x78')](_0xc6799c);process[_0xaf59('0x41')](0x0);})['catch'](function(_0x996329){logger[_0xaf59('0x3f')](_0x996329[_0xaf59('0x40')]);process['exit'](0x1);});}catch(_0x53649a){logger[_0xaf59('0x3f')](_0xaf59('0x79'),_0x53649a[_0xaf59('0x40')]);process['exit'](0x1);}},'error':function(_0x5ce662,_0x39d663,_0x49b1c1,_0x1ae93e){throw new Error(_0x1ae93e);}});}function validate(){if(process['argv']&&process[_0xaf59('0x7a')][_0xaf59('0x55')]<0x4){throw new Error('arguments\x20\x20\x20');}var _0x5a4ff1=path['join'](config['root'],_0xaf59('0x7b'),process[_0xaf59('0x7a')][0x2]);if(!fs[_0xaf59('0x7c')](_0x5a4ff1)){throw new Error(_0xaf59('0x7d'));}var _0x200feb={};try{_0x200feb=JSON[_0xaf59('0x52')](process[_0xaf59('0x7a')][0x3]);if(!_0x200feb[_0xaf59('0x4c')]){throw new Error(_0xaf59('0x7e'));}if(!_0x200feb[_0xaf59('0x4c')][_0xaf59('0x13')]){throw new Error(_0xaf59('0x7f'));}if(!_0x200feb[_0xaf59('0x4c')]['firstName']){throw new Error(_0xaf59('0x80'));}var _0x42fc41=0x0;if(_0x200feb[_0xaf59('0x4c')][_0xaf59('0x5b')]){_0x42fc41=0x1;}if(!_0x200feb[_0xaf59('0x34')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x38f576){throw new Error('body\x20id\x20mandatory');}var _0x1f422d=[];try{_0x1f422d=_[_0xaf59('0x81')](JSON[_0xaf59('0x52')](process['argv'][0x4]),'id');}catch(_0x5a2207){logger[_0xaf59('0x3d')]('No\x20agent\x20available');}main(_0x5a4ff1,_0x200feb,_0x1f422d,_0x42fc41);}validate();process['on'](_0xaf59('0x82'),handleStop);process['on'](_0xaf59('0x83'),handleUncaughtException); \ No newline at end of file +var _0x5543=['scheduledat',',\x20scheduledAt\x20=\x20NOW()','duplicates','DROP\x20TABLE\x20','voice_queues_has_cm_lists','VoiceQueueId','voice_queues','CampaignId','campaigns_has_cm_blacklists','campaigns','then','affectedRows','argv','arguments\x20\x20\x20','root','file\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','UserId','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','ContactId','createdAt','updatedAt','priority','recallme','cm_contacts','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','ListId','fields','cm_contacts.ListId\x20=\x20','ListId\x20=\x20?','\x20=\x20?','concat','keys',')\x20NOT\x20IN\x20?','id\x20IN\x20?','min_id','info','error','message','exit','errors','push','code','sequelize','spread','catch','main','stringify','send','start','binding','socket_timestamp','server/files/tmp','.csv','writeFileSync','parse','createReadStream','data','length','replace','YYYY-MM-DD\x20HH:mm:ss','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','SystemRow','appendFileSync','rows','emit','Abort\x20parser','abort','SystemError','step','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil'];(function(_0x49b24f,_0xa8785a){var _0x2481e0=function(_0x4f5964){while(--_0x4f5964){_0x49b24f['push'](_0x49b24f['shift']());}};_0x2481e0(++_0xa8785a);}(_0x5543,0x9d));var _0x3554=function(_0x3fc97b,_0x20ca29){_0x3fc97b=_0x3fc97b-0x0;var _0x3a0c82=_0x5543[_0x3fc97b];return _0x3a0c82;};'use strict';var fs=require('fs');var path=require(_0x3554('0x0'));var _=require(_0x3554('0x1'));var Papa=require(_0x3554('0x2'));var util=require(_0x3554('0x3'));var BPromise=require(_0x3554('0x4'));var moment=require(_0x3554('0x5'));var squel=require(_0x3554('0x6'));var Redis=require(_0x3554('0x7'));var db=require(_0x3554('0x8'))['db'];var config=require(_0x3554('0x9'));var logger=require(_0x3554('0xa'))(_0x3554('0xb'));config[_0x3554('0xc')]=_[_0x3554('0xd')](config[_0x3554('0xc')],{'host':_0x3554('0xe'),'port':0x18eb});var socket=require(_0x3554('0xf'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x3554('0x10')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x3b3f5c){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))*$/[_0x3554('0x11')](_0x3b3f5c);}function selectNotIn(_0x496cc5,_0x57d368,_0x3ccbe8,_0x1b3060,_0x1a1360){return squel[_0x3554('0x12')]()[_0x3554('0x13')](_0x3554('0x14'))[_0x3554('0x15')](_0x1b3060)[_0x3554('0x16')](_0x57d368,null,_0x57d368+_0x3554('0x17')+_0x1b3060+'.'+_0x3ccbe8)[_0x3554('0x18')](_0x1b3060+'.'+_0x3ccbe8+_0x3554('0x19')+_0x496cc5+'.'+_0x3ccbe8)['where'](_0x57d368+_0x3554('0x1a')+_0x1a1360[_0x3554('0x16')]()+')');}function insertCmHopper(_0x42916b,_0x2b5701,_0xb7b62b,_0x5de075,_0x51acb0){var _0x4cf66e=[_0x3554('0x1b'),_0x3554('0x1c'),_0x3554('0x1d'),_0x3554('0x1e'),_0x2b5701+'.'+_0x5de075,_0x3554('0x1f'),_0x3554('0x20'),'cm_contacts.priority',_0x3554('0x21'),'\x22'+_0x51acb0+'\x22'];return squel[_0x3554('0x22')]()[_0x3554('0x23')](_0x3554('0x24'))[_0x3554('0x25')](['phone','scheduledat',_0x3554('0x26'),'ListId',_0x5de075,_0x3554('0x27'),_0x3554('0x28'),_0x3554('0x29'),'UserId',_0x3554('0x2a')],squel['select']()['fields'](_0x4cf66e)['from'](_0x2b5701)[_0x3554('0x16')](_0x3554('0x2b'),null,'cm_contacts.ListId\x20=\x20'+_0x2b5701+_0x3554('0x2c'))[_0x3554('0x16')](_0xb7b62b,null,_0xb7b62b+_0x3554('0x17')+_0x2b5701+'.'+_0x5de075)[_0x3554('0x18')](_0x2b5701+_0x3554('0x2d'),_0x42916b)[_0x3554('0x18')](_0x3554('0x2e'),NOW)[_0x3554('0x18')](_0x3554('0x2f'),selectNotIn(_0x2b5701,_0xb7b62b,_0x5de075,_0x3554('0x24'),[_0x3554('0x30'),_0x3554('0x31')]))['where'](_0x3554('0x2f'),selectNotIn(_0x2b5701,_0xb7b62b,_0x5de075,_0x3554('0x24'),[_0x3554('0x30')])))[_0x3554('0x32')]();}function insertCmHopperBlack(_0x5f4310,_0x2b66f9,_0x390d4f,_0x1d2694){var _0x5d647f=['cm_contacts.phone',_0x3554('0x1d'),_0x3554('0x1e'),_0x2b66f9+'.'+_0x1d2694,_0x3554('0x1f'),'cm_contacts.updatedAt'];return squel[_0x3554('0x22')]()[_0x3554('0x23')]('cm_hopper_black')[_0x3554('0x25')](['phone',_0x3554('0x26'),_0x3554('0x33'),_0x1d2694,_0x3554('0x27'),'updatedAt'],squel[_0x3554('0x12')]()[_0x3554('0x34')](_0x5d647f)[_0x3554('0x15')](_0x2b66f9)[_0x3554('0x16')]('cm_contacts',null,_0x3554('0x35')+_0x2b66f9+'.CmListId')[_0x3554('0x16')](_0x390d4f,null,_0x390d4f+_0x3554('0x17')+_0x2b66f9+'.'+_0x1d2694)[_0x3554('0x18')](_0x2b66f9+_0x3554('0x2d'),_0x5f4310)[_0x3554('0x18')](_0x3554('0x2e'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x3554('0x13')](_0x3554('0x14'))[_0x3554('0x15')]('cm_hopper_black')[_0x3554('0x18')](_0x3554('0x36'),_0x5f4310)['where'](_0x1d2694+_0x3554('0x37'),_0x2b66f9+'.'+_0x1d2694)))['toString']();}function insertCmContact(_0x21dd17,_0x452363,_0x4006f1,_0x427b7f){var _0x3f1917=_[_0x3554('0x38')](_[_0x3554('0x39')](_0x427b7f),['ListId','CompanyId','createdAt','updatedAt']);return squel[_0x3554('0x22')]()[_0x3554('0x23')]('cm_contacts')['fromQuery'](_0x3f1917,squel[_0x3554('0x12')]()[_0x3554('0x34')](_0x3f1917)['from'](_0x452363)[_0x3554('0x18')]('('+_0x4006f1['join'](',')+_0x3554('0x3a'),squel[_0x3554('0x12')]()['fields'](_0x4006f1)['from'](_0x3554('0x2b'))[_0x3554('0x18')](_0x3554('0x36'),_0x21dd17))[_0x3554('0x18')](_0x3554('0x3b'),squel[_0x3554('0x12')]()[_0x3554('0x13')]('MIN(id)',_0x3554('0x3c'))[_0x3554('0x15')](_0x452363)['group'](_0x4006f1['join'](','))))[_0x3554('0x32')]();}function handleStop(){logger[_0x3554('0x3d')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x54cb77){logger[_0x3554('0x3e')](_0x54cb77[_0x3554('0x3f')]);process[_0x3554('0x40')](0x1);}function handleError(_0x57eac,_0x47955b){stats[_0x3554('0x41')][_0x3554('0x42')]({'name':_0x47955b[_0x3554('0x43')],'message':_0x47955b['message'],'row':_0x57eac});}function handleQuery(_0x5f4f75){logger[_0x3554('0x3d')](_0x5f4f75);return db[_0x3554('0x44')]['query'](_0x5f4f75)[_0x3554('0x45')](function(_0x34e088){results[_0x3554('0x42')](_0x34e088);})[_0x3554('0x46')](function(_0x1b97fb){logger[_0x3554('0x3e')](_0x1b97fb[_0x3554('0x3f')]);});}function main(_0x5aeb19,_0x148640,_0x2c5c09,_0x2f697c){logger[_0x3554('0x3d')](_0x3554('0x47'),_0x5aeb19,JSON[_0x3554('0x48')](_0x148640));process[_0x3554('0x49')](_0x3554('0x4a'));var _0x59be72=_0x148640[_0x3554('0x4b')];var _0x540f32=_0x148640[_0x3554('0x4c')];var _0xcf4b58=path['join'](config['root'],_0x3554('0x4d'),_0x540f32+_0x3554('0x4e'));var _0x179e08=_['keys'](_0x59be72)['join']();logger[_0x3554('0x3d')]('header',_0x179e08);fs[_0x3554('0x4f')](_0xcf4b58,_0x179e08+'\x0a');Papa[_0x3554('0x50')](fs[_0x3554('0x51')](_0x5aeb19),{'header':!![],'skipEmptyLines':!![],'step':function(_0x36aca1,_0x4591f6){try{for(var _0x38055f=0x0,_0x436872=[];_0x38055f<_0x36aca1[_0x3554('0x52')][_0x3554('0x53')];_0x38055f++){stats['rows']+=0x1;if(_0x36aca1['errors'][_0x38055f]){handleError(_0x36aca1['data'][_0x38055f],_0x36aca1[_0x3554('0x41')][_0x38055f]);}else{var _0x278121=[];for(var _0xc234b6 in _0x59be72){if(_0x59be72['hasOwnProperty'](_0xc234b6)){if(_0x36aca1[_0x3554('0x52')][_0x38055f][_0x59be72[_0xc234b6]]){var _0x3afb5b=_['trim'](_0x36aca1[_0x3554('0x52')][_0x38055f][_0x59be72[_0xc234b6]][_0x3554('0x54')](/"/g,'\x27'));switch(_0xc234b6){case'scheduledat':var _0x42e789=moment(_0x3afb5b,_0x3554('0x55'),!![]);if(_0x42e789['isValid']()){_0x436872['push']('\x22'+_0x3afb5b+'\x22');}else{_0x278121[_0x3554('0x42')](_0x3554('0x56'));}break;case'priority':var _0x53e1df=parseInt(_0x3afb5b);_0x3afb5b=_[_0x3554('0x57')](_0x53e1df)||_0x53e1df<0x0||_0x53e1df>0x4?_0x2f697c?0x3:0x2:_0x53e1df;_0x436872[_0x3554('0x42')]('\x22'+_0x3afb5b+'\x22');break;case'UserId':var _0x599c2d=parseInt(_0x3afb5b);if(_[_0x3554('0x58')](_0x599c2d)&&_[_0x3554('0x59')](_0x2c5c09,_0x599c2d)){_0x436872[_0x3554('0x42')]('\x22'+_0x599c2d+'\x22');}else{_0x278121[_0x3554('0x42')](_0x3554('0x5a'));}break;case _0x3554('0x5b'):if(isEmail(_0x3afb5b)){_0x436872[_0x3554('0x42')]('\x22'+_0x3afb5b+'\x22');}else{_0x278121[_0x3554('0x42')](_0x3554('0x5c'));}break;case'dateOfBirth':var _0x262621=moment(_0x3afb5b,'YYYY-MM-DD',!![]);if(_0x262621['isValid']()){_0x436872[_0x3554('0x42')]('\x22'+_0x3afb5b+'\x22');}else{_0x278121['push'](_0x3554('0x5d'));}break;default:_0x436872['push']('\x22'+_0x3afb5b+'\x22');}}else{switch(_0xc234b6){case'firstName':case _0x3554('0x14'):_0x278121['push'](_0xc234b6+_0x3554('0x5e'));break;default:_0x436872[_0x3554('0x42')]('\x22\x22');}}}}if(_0x278121[_0x3554('0x53')]){handleError(_0x36aca1[_0x3554('0x52')][_0x38055f],{'code':_0x3554('0x5f'),'message':_0x278121['join']()});}else{fs[_0x3554('0x60')](_0xcf4b58,_0x436872[_0x3554('0x16')]()+'\x0a');}_0x436872=[];}if(!(stats[_0x3554('0x61')]%0xc8)){socket[_0x3554('0x62')]('contact:import:'+_0x540f32,stats);stats[_0x3554('0x41')]=[];}}if(stopped){logger[_0x3554('0x3d')](_0x3554('0x63'));_0x4591f6[_0x3554('0x64')]();}}catch(_0x5a2a59){handleError(_0x36aca1['data'][_0x38055f],{'code':_0x3554('0x65'),'message':_0x5a2a59[_0x3554('0x3f')]});logger[_0x3554('0x3e')](_0x3554('0x66'),_0x5a2a59[_0x3554('0x3f')]);}},'complete':function(){try{var _0x4060a4=[];var _0x5f41ce=_0x3554('0x2b');if(_0x148640['duplicates']&&_0x148640['duplicates'][_0x3554('0x53')]){_0x5f41ce='cm_contacts_'+_0x540f32;_0x4060a4[_0x3554('0x42')](_0x3554('0x67')+_0x5f41ce+_0x3554('0x68'));}var _0x27e520=util['format'](_0x3554('0x69'),_0xcf4b58,_0x5f41ce,_0x179e08,_0x148640[_0x3554('0x33')],_0x148640['CompanyId']||null,NOW,NOW);if(_[_0x3554('0x6a')](_0x59be72[_0x3554('0x6b')])){_0x27e520+=_0x3554('0x6c');}_0x4060a4[_0x3554('0x42')](_0x27e520);if(_0x148640[_0x3554('0x6d')]&&_0x148640[_0x3554('0x6d')][_0x3554('0x53')]){_0x4060a4[_0x3554('0x42')](insertCmContact(_0x148640[_0x3554('0x33')],_0x5f41ce,_0x148640[_0x3554('0x6d')],_0x59be72));_0x4060a4[_0x3554('0x42')](_0x3554('0x6e')+_0x5f41ce+';');}_0x4060a4['push'](insertCmHopper(_0x148640[_0x3554('0x33')],_0x3554('0x6f'),'voice_queues',_0x3554('0x70'),_0x2f697c));_0x4060a4['push'](insertCmHopperBlack(_0x148640[_0x3554('0x33')],'voice_queues_has_cm_blacklists',_0x3554('0x71'),'VoiceQueueId'));_0x4060a4[_0x3554('0x42')](insertCmHopper(_0x148640[_0x3554('0x33')],'campaigns_has_cm_lists','campaigns',_0x3554('0x72'),_0x2f697c));_0x4060a4[_0x3554('0x42')](insertCmHopperBlack(_0x148640[_0x3554('0x33')],_0x3554('0x73'),_0x3554('0x74'),_0x3554('0x72')));BPromise['each'](_0x4060a4,handleQuery)[_0x3554('0x75')](function(_0x40a22c){stats['finish']=!![];stats[_0x3554('0x76')]=_0x148640[_0x3554('0x6d')]&&_0x148640[_0x3554('0x6d')]['length']?results[0x2][_0x3554('0x76')]:results[0x0][_0x3554('0x76')];socket[_0x3554('0x62')]('contact:import:'+_0x540f32,stats);fs['unlink'](_0x5aeb19);fs['unlink'](_0xcf4b58);process[_0x3554('0x40')](0x0);})['catch'](function(_0xc16718){logger['error'](_0xc16718[_0x3554('0x3f')]);process[_0x3554('0x40')](0x1);});}catch(_0x42a156){logger[_0x3554('0x3e')]('complete',_0x42a156[_0x3554('0x3f')]);process['exit'](0x1);}},'error':function(_0x434601,_0xe5096,_0x478ec4,_0x176b24){throw new Error(_0x176b24);}});}function validate(){if(process[_0x3554('0x77')]&&process[_0x3554('0x77')][_0x3554('0x53')]<0x4){throw new Error(_0x3554('0x78'));}var _0x591ddf=path[_0x3554('0x16')](config[_0x3554('0x79')],_0x3554('0x4d'),process['argv'][0x2]);if(!fs['existsSync'](_0x591ddf)){throw new Error(_0x3554('0x7a'));}var _0x30b8e5={};try{_0x30b8e5=JSON[_0x3554('0x50')](process['argv'][0x3]);if(!_0x30b8e5[_0x3554('0x4b')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x30b8e5['binding'][_0x3554('0x14')]){throw new Error(_0x3554('0x7b'));}if(!_0x30b8e5[_0x3554('0x4b')]['firstName']){throw new Error(_0x3554('0x7c'));}var _0x4fc8c1=0x0;if(_0x30b8e5[_0x3554('0x4b')][_0x3554('0x7d')]){_0x4fc8c1=0x1;}if(!_0x30b8e5['ListId']){throw new Error(_0x3554('0x7e'));}}catch(_0x3c4698){throw new Error(_0x3554('0x7f'));}var _0x2db4e2=[];try{_0x2db4e2=_[_0x3554('0x80')](JSON[_0x3554('0x50')](process[_0x3554('0x77')][0x4]),'id');}catch(_0x56969e){logger['info'](_0x3554('0x81'));}main(_0x591ddf,_0x30b8e5,_0x2db4e2,_0x4fc8c1);}validate();process['on'](_0x3554('0x82'),handleStop);process['on'](_0x3554('0x83'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 6f2332c..d9b933f 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 _0x5f66=['***\x20Time\x20Info\x20***','Agent\x20Ring','agentconnectAt','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','***\x20Call\x20Info\x20***','Called\x20Number','Member\x20Name','starttime','Answer\x20Time','Complete\x20Time','endtime','Duration','Billable\x20Time','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','variable','queue','calleridnum','outbound','push','Outbound\x20Call','getDescriptions','keyValue','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','UniqueId','uniqueid','Date','agentcalledAt','Agent\x20Number','destcalleridnum'];(function(_0x4c57f9,_0x5e0d75){var _0x33a3fa=function(_0x3a3a67){while(--_0x3a3a67){_0x4c57f9['push'](_0x4c57f9['shift']());}};_0x33a3fa(++_0x5e0d75);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x5f66[_0x4243a3];return _0x1b2a33;};'use strict';exports['getSubjects']=function(_0x61c60c,_0x4a3887){var _0x2d5fd9=[{'type':_0x65f6('0x0'),'content':_0x65f6('0x1'),'variableName':null}];switch(_0x61c60c[_0x65f6('0x2')]()){case _0x65f6('0x3'):switch(_0x4a3887['toLowerCase']()){case _0x65f6('0x4'):_0x2d5fd9['push']({'type':_0x65f6('0x5'),'content':'','variableName':_0x65f6('0x6')});_0x2d5fd9['push']({'type':'variable','content':'','variableName':_0x65f6('0x7')});break;case _0x65f6('0x8'):_0x2d5fd9[_0x65f6('0x9')]({'type':_0x65f6('0x0'),'content':_0x65f6('0xa'),'variableName':null});_0x2d5fd9[_0x65f6('0x9')]({'type':'variable','content':'','variableName':'destcalleridnum'});break;}}return _0x2d5fd9;};exports[_0x65f6('0xb')]=function(_0x2f6d5b,_0x264647){var _0x25c416=[];switch(_0x2f6d5b['toLowerCase']()){case _0x65f6('0x3'):switch(_0x264647['toLowerCase']()){case'inbound':_0x25c416=[{'type':_0x65f6('0x0'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x65f6('0xc'),'content':'','key':'Caller\x20Number','keyType':_0x65f6('0x5'),'variableName':_0x65f6('0x7')},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0xd'),'keyType':_0x65f6('0x5'),'variableName':_0x65f6('0xe')},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0xf'),'keyType':_0x65f6('0x5'),'variableName':_0x65f6('0x10')},{'type':'keyValue','content':'','key':_0x65f6('0x11'),'keyType':'variable','variableName':'queue'},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x12'),'keyType':_0x65f6('0x5'),'variableName':_0x65f6('0x13')},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x14'),'keyType':_0x65f6('0x5'),'variableName':_0x65f6('0x15')},{'type':'string','content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x65f6('0xc'),'content':'','key':'Agent\x20Name','keyType':'variable','variableName':'destcalleridname'},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x16'),'keyType':'variable','variableName':_0x65f6('0x17')},{'type':_0x65f6('0x0'),'content':_0x65f6('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x19'),'keyType':_0x65f6('0x5'),'variableName':'agentcalledAt'},{'type':_0x65f6('0xc'),'content':'','key':'Agent\x20Connect','keyType':'variable','variableName':_0x65f6('0x1a')},{'type':_0x65f6('0xc'),'content':'','key':'Agent\x20Complete','keyType':_0x65f6('0x5'),'variableName':_0x65f6('0x1b')},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x1c'),'keyType':'variable','variableName':_0x65f6('0x1d')},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x1e'),'keyType':'variable','variableName':'talktime'}];break;case'outbound':_0x25c416=[{'type':_0x65f6('0x0'),'content':_0x65f6('0x1f'),'variableName':null},{'type':'keyValue','content':'','key':_0x65f6('0x20'),'keyType':_0x65f6('0x5'),'keyContent':'','variableName':'destcalleridnum'},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x21'),'keyType':_0x65f6('0x5'),'keyContent':'','variableName':'membername'},{'type':'keyValue','content':'','key':'UniqueId','keyType':_0x65f6('0x5'),'keyContent':'','variableName':_0x65f6('0x13')},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x14'),'keyType':_0x65f6('0x5'),'keyContent':'','variableName':_0x65f6('0x22')},{'type':_0x65f6('0x0'),'content':'***\x20Time\x20Info\x20***'},{'type':'keyValue','content':'','key':_0x65f6('0x23'),'keyType':_0x65f6('0x5'),'keyContent':'','variableName':'answertime'},{'type':'keyValue','content':'','key':_0x65f6('0x24'),'keyType':_0x65f6('0x5'),'keyContent':'','variableName':_0x65f6('0x25')},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x26'),'keyType':_0x65f6('0x5'),'keyContent':'','variableName':'duration'},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x27'),'keyType':_0x65f6('0x5'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x25c416;}; \ No newline at end of file +var _0xdb28=['toLowerCase','voice','inbound','variable','queue','calleridnum','outbound','push','string','Outbound\x20Call','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','uniqueid','Date','agentcalledAt','Agent\x20Name','destcalleridname','Agent\x20Number','destcalleridnum','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','membername','UniqueId','Complete\x20Time','Duration','Billable\x20Time','billableseconds','getSubjects','[xCALLY\x20Ticket]'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xdb28,0x106));var _0x8db2=function(_0x126e3d,_0x485c66){_0x126e3d=_0x126e3d-0x0;var _0x59d503=_0xdb28[_0x126e3d];return _0x59d503;};'use strict';exports[_0x8db2('0x0')]=function(_0x4221b3,_0x1dc797){var _0xf66e59=[{'type':'string','content':_0x8db2('0x1'),'variableName':null}];switch(_0x4221b3[_0x8db2('0x2')]()){case _0x8db2('0x3'):switch(_0x1dc797[_0x8db2('0x2')]()){case _0x8db2('0x4'):_0xf66e59['push']({'type':_0x8db2('0x5'),'content':'','variableName':_0x8db2('0x6')});_0xf66e59['push']({'type':'variable','content':'','variableName':_0x8db2('0x7')});break;case _0x8db2('0x8'):_0xf66e59[_0x8db2('0x9')]({'type':_0x8db2('0xa'),'content':_0x8db2('0xb'),'variableName':null});_0xf66e59[_0x8db2('0x9')]({'type':_0x8db2('0x5'),'content':'','variableName':'destcalleridnum'});break;}}return _0xf66e59;};exports[_0x8db2('0xc')]=function(_0x476216,_0x1f62af){var _0x57015f=[];switch(_0x476216[_0x8db2('0x2')]()){case _0x8db2('0x3'):switch(_0x1f62af['toLowerCase']()){case _0x8db2('0x4'):_0x57015f=[{'type':_0x8db2('0xa'),'content':_0x8db2('0xd'),'key':null,'keyType':null,'variableName':null},{'type':_0x8db2('0xe'),'content':'','key':_0x8db2('0xf'),'keyType':'variable','variableName':'calleridnum'},{'type':_0x8db2('0xe'),'content':'','key':_0x8db2('0x10'),'keyType':_0x8db2('0x5'),'variableName':_0x8db2('0x11')},{'type':_0x8db2('0xe'),'content':'','key':_0x8db2('0x12'),'keyType':_0x8db2('0x5'),'variableName':_0x8db2('0x13')},{'type':_0x8db2('0xe'),'content':'','key':_0x8db2('0x14'),'keyType':'variable','variableName':_0x8db2('0x6')},{'type':_0x8db2('0xe'),'content':'','key':'UniqueId','keyType':_0x8db2('0x5'),'variableName':_0x8db2('0x15')},{'type':_0x8db2('0xe'),'content':'','key':_0x8db2('0x16'),'keyType':_0x8db2('0x5'),'variableName':_0x8db2('0x17')},{'type':'string','content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x8db2('0xe'),'content':'','key':_0x8db2('0x18'),'keyType':_0x8db2('0x5'),'variableName':_0x8db2('0x19')},{'type':'keyValue','content':'','key':_0x8db2('0x1a'),'keyType':_0x8db2('0x5'),'variableName':_0x8db2('0x1b')},{'type':_0x8db2('0xa'),'content':_0x8db2('0x1c'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x8db2('0x1d'),'keyType':_0x8db2('0x5'),'variableName':_0x8db2('0x17')},{'type':_0x8db2('0xe'),'content':'','key':_0x8db2('0x1e'),'keyType':_0x8db2('0x5'),'variableName':_0x8db2('0x1f')},{'type':'keyValue','content':'','key':_0x8db2('0x20'),'keyType':'variable','variableName':'agentcompleteAt'},{'type':'keyValue','content':'','key':'Hold\x20Time','keyType':_0x8db2('0x5'),'variableName':_0x8db2('0x21')},{'type':_0x8db2('0xe'),'content':'','key':_0x8db2('0x22'),'keyType':_0x8db2('0x5'),'variableName':_0x8db2('0x23')}];break;case'outbound':_0x57015f=[{'type':_0x8db2('0xa'),'content':_0x8db2('0xd'),'variableName':null},{'type':_0x8db2('0xe'),'content':'','key':_0x8db2('0x24'),'keyType':'variable','keyContent':'','variableName':_0x8db2('0x1b')},{'type':_0x8db2('0xe'),'content':'','key':_0x8db2('0x25'),'keyType':_0x8db2('0x5'),'keyContent':'','variableName':_0x8db2('0x26')},{'type':_0x8db2('0xe'),'content':'','key':_0x8db2('0x27'),'keyType':_0x8db2('0x5'),'keyContent':'','variableName':_0x8db2('0x15')},{'type':'keyValue','content':'','key':_0x8db2('0x16'),'keyType':'variable','keyContent':'','variableName':'starttime'},{'type':_0x8db2('0xa'),'content':_0x8db2('0x1c')},{'type':_0x8db2('0xe'),'content':'','key':'Answer\x20Time','keyType':_0x8db2('0x5'),'keyContent':'','variableName':'answertime'},{'type':_0x8db2('0xe'),'content':'','key':_0x8db2('0x28'),'keyType':_0x8db2('0x5'),'keyContent':'','variableName':'endtime'},{'type':'keyValue','content':'','key':_0x8db2('0x29'),'keyType':_0x8db2('0x5'),'keyContent':'','variableName':'duration'},{'type':'keyValue','content':'','key':_0x8db2('0x2a'),'keyType':_0x8db2('0x5'),'keyContent':'','variableName':_0x8db2('0x2b')}];break;}}return _0x57015f;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index d175305..81f2a58 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 _0xf282=['user','query','clone','body','omit','html','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','role','null','Interaction','findOne','update','info','catch','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf282,0x85));var _0x2f28=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xf282[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x2f28('0x0'));var db=require(_0x2f28('0x1'))['db'];var loggers={'openchannel':require(_0x2f28('0x2'))(_0x2f28('0x3')),'mail':require(_0x2f28('0x2'))(_0x2f28('0x4')),'fax':require('../../config/logger')(_0x2f28('0x5')),'sms':require(_0x2f28('0x2'))(_0x2f28('0x6')),'chat':require(_0x2f28('0x2'))(_0x2f28('0x7'))};function getInteractionId(_0x349e21,_0x29ecac,_0x59c539){if(_0x349e21&&_0x349e21[_[_0x2f28('0x8')](_0x59c539)+_0x2f28('0x9')]){return _0x349e21[_[_0x2f28('0x8')](_0x59c539)+_0x2f28('0x9')];}else if(_0x349e21&&_0x349e21['id']){return _0x349e21['id'];}else if(_0x29ecac&&_0x29ecac['id']){return _0x29ecac['id'];}else{return _0x2f28('0xa');}}function log(_0x4c2091,_0x2d08bc,_0x151446,_0x38f6e1,_0x379a54,_0x249636){loggers[_0x379a54[_0x2f28('0xb')]()][_0x4c2091](_0x2f28('0xc'),_0x249636[_0x2f28('0xd')](),_0x2d08bc?_0x2d08bc['id']:null,_0x2d08bc?_0x2d08bc['name']:null,_0x2d08bc?_0x2d08bc[_0x2f28('0xe')]:null,getInteractionId(_0x151446,_0x38f6e1,_0x379a54),_0x151446?JSON['stringify'](_0x151446):_0x2f28('0xf'));}function updateUser(_0xe32c63,_0x3ed494,_0x17834f,_0x435eaf,_0x5368c1){db[_[_0x2f28('0x8')](_0x435eaf)+_0x2f28('0x10')][_0x2f28('0x11')]({'where':{'id':getInteractionId(_0x3ed494,_0x17834f,_0x435eaf)}})['then'](function(_0x558421){if(_0x558421){return _0x558421[_0x2f28('0x12')]({'UserId':_0xe32c63?_0xe32c63['id']:null});}})['then'](function(_0x13a0fa){if(_0x13a0fa){log(_0x2f28('0x13'),_0xe32c63,_0x3ed494,_0x17834f,_0x435eaf,_0x5368c1);}})[_0x2f28('0x14')](function(){log(_0x2f28('0x15'),_0xe32c63,_0x3ed494,_0x17834f,_0x435eaf,_0x5368c1);});}exports['tracked']=function(_0x2c8abc,_0x1389a4){return function(_0x266ad6,_0x70ec3d,_0x6aa7b5){var _0x3170ae=_0x266ad6[_0x2f28('0x16')];var _0x251aea={};var _0x4ad710=_0x266ad6[_0x2f28('0x17')];if(_0x251aea){_0x251aea=_[_0x2f28('0x18')](_0x266ad6[_0x2f28('0x19')]);_0x251aea=_[_0x2f28('0x1a')](_0x251aea,[_0x2f28('0x19'),_0x2f28('0x1b'),_0x2f28('0x1c'),_0x2f28('0x1d'),_0x2f28('0x1e')]);}updateUser(_0x3170ae,_0x251aea,_0x4ad710,_0x2c8abc,_0x1389a4);_0x6aa7b5(null);};}; \ No newline at end of file +var _0x0dba=['InteractionId','unknown','toUpperCase','name','role','stringify','Interaction','findOne','then','update','info','catch','error','tracked','user','query','clone','body','omit','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','upperFirst'];(function(_0x18fb16,_0x45edbc){var _0x147b0d=function(_0x5b1b00){while(--_0x5b1b00){_0x18fb16['push'](_0x18fb16['shift']());}};_0x147b0d(++_0x45edbc);}(_0x0dba,0x136));var _0xa0db=function(_0x87523,_0x29ce7e){_0x87523=_0x87523-0x0;var _0x565bba=_0x0dba[_0x87523];return _0x565bba;};'use strict';var _=require(_0xa0db('0x0'));var db=require(_0xa0db('0x1'))['db'];var loggers={'openchannel':require(_0xa0db('0x2'))(_0xa0db('0x3')),'mail':require(_0xa0db('0x2'))(_0xa0db('0x4')),'fax':require(_0xa0db('0x2'))(_0xa0db('0x5')),'sms':require(_0xa0db('0x2'))(_0xa0db('0x6')),'chat':require(_0xa0db('0x2'))(_0xa0db('0x7'))};function getInteractionId(_0x4d6ece,_0x53472e,_0x5b77ce){if(_0x4d6ece&&_0x4d6ece[_[_0xa0db('0x8')](_0x5b77ce)+_0xa0db('0x9')]){return _0x4d6ece[_[_0xa0db('0x8')](_0x5b77ce)+'InteractionId'];}else if(_0x4d6ece&&_0x4d6ece['id']){return _0x4d6ece['id'];}else if(_0x53472e&&_0x53472e['id']){return _0x53472e['id'];}else{return _0xa0db('0xa');}}function log(_0x36d0be,_0x35445a,_0x355016,_0x5a73f1,_0x22f535,_0x1ac6a2){loggers[_0x22f535['toLowerCase']()][_0x36d0be]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1ac6a2[_0xa0db('0xb')](),_0x35445a?_0x35445a['id']:null,_0x35445a?_0x35445a[_0xa0db('0xc')]:null,_0x35445a?_0x35445a[_0xa0db('0xd')]:null,getInteractionId(_0x355016,_0x5a73f1,_0x22f535),_0x355016?JSON[_0xa0db('0xe')](_0x355016):'null');}function updateUser(_0x15ef0d,_0x19145b,_0xb161b6,_0x679cf9,_0x20bd3c){db[_[_0xa0db('0x8')](_0x679cf9)+_0xa0db('0xf')][_0xa0db('0x10')]({'where':{'id':getInteractionId(_0x19145b,_0xb161b6,_0x679cf9)}})[_0xa0db('0x11')](function(_0x5cb17f){if(_0x5cb17f){return _0x5cb17f[_0xa0db('0x12')]({'UserId':_0x15ef0d?_0x15ef0d['id']:null});}})[_0xa0db('0x11')](function(_0x24efb1){if(_0x24efb1){log(_0xa0db('0x13'),_0x15ef0d,_0x19145b,_0xb161b6,_0x679cf9,_0x20bd3c);}})[_0xa0db('0x14')](function(){log(_0xa0db('0x15'),_0x15ef0d,_0x19145b,_0xb161b6,_0x679cf9,_0x20bd3c);});}exports[_0xa0db('0x16')]=function(_0x12a3e8,_0x279e61){return function(_0x590f63,_0x1cffec,_0x215658){var _0x4be2e2=_0x590f63[_0xa0db('0x17')];var _0x2786ae={};var _0x7eecf8=_0x590f63[_0xa0db('0x18')];if(_0x2786ae){_0x2786ae=_[_0xa0db('0x19')](_0x590f63[_0xa0db('0x1a')]);_0x2786ae=_[_0xa0db('0x1b')](_0x2786ae,['body','html','phone','fax',_0xa0db('0x1c')]);}updateUser(_0x4be2e2,_0x2786ae,_0x7eecf8,_0x12a3e8,_0x279e61);_0x215658(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 136148d..b1ddd3d 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 _0xd770=['isUserLimit','crypto','util','composable-middleware','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','update','base64','utf8','final','parse','License','findOne','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user'];(function(_0x3c7d9c,_0x30c7b0){var _0x107232=function(_0x3c6fcb){while(--_0x3c6fcb){_0x3c7d9c['push'](_0x3c7d9c['shift']());}};_0x107232(++_0x30c7b0);}(_0xd770,0x145));var _0x0d77=function(_0x104482,_0x4b8f5b){_0x104482=_0x104482-0x0;var _0x46285c=_0xd770[_0x104482];return _0x46285c;};'use strict';var crypto=require(_0x0d77('0x0'));var util=require(_0x0d77('0x1'));var compose=require(_0x0d77('0x2'));var db=require('../../mysqldb')['db'];var config=require(_0x0d77('0x3'));function getValueFromLicense(_0x31f9a8,_0x1e58e8){if(_0x31f9a8&&_0x1e58e8){if(_0x1e58e8[_0x0d77('0x4')]&&_0x1e58e8['license']){var _0xcda018=_0x1e58e8[_0x0d77('0x4')];var _0x49df2a=_0x1e58e8[_0x0d77('0x5')];var _0x28fb34=_0xcda018[_0x0d77('0x6')]('-')[0x4];var _0x352d75=_0xcda018[_0x0d77('0x6')]('-')[0x0];var _0x50fcd8=crypto[_0x0d77('0x7')](_0x0d77('0x8'),util[_0x0d77('0x9')]('%s:%s:%s',_0x28fb34,_0xcda018,_0x352d75));var _0x5dff67=_0x50fcd8[_0x0d77('0xa')](_0x49df2a,_0x0d77('0xb'),_0x0d77('0xc'));_0x5dff67+=_0x50fcd8[_0x0d77('0xd')](_0x0d77('0xc'));var _0xbd85d9=JSON[_0x0d77('0xe')](_0x5dff67);return _0xbd85d9['hasOwnProperty'](_0x31f9a8)?_0xbd85d9[_0x31f9a8]:null;}}return null;}function isLimit(_0x361322,_0x3b0d25,_0x42a3e9,_0x4ece71){var _0x362c14=_0x3b0d25;return compose()['use'](function(_0x516086,_0x4c51cd,_0x12ff2f){return db[_0x0d77('0xf')][_0x0d77('0x10')]({'where':{'id':0x1},'raw':!![]})[_0x0d77('0x11')](function(_0x1bf918){var _0x5f3546=getValueFromLicense(_0x361322,_0x1bf918);return _0x5f3546?_0x5f3546:_0x362c14;})[_0x0d77('0x11')](function(_0x345b9a){_0x362c14=_0x345b9a;return _0x42a3e9['count'](_0x4ece71);})['then'](function(_0x5b1c77){if(_0x5b1c77>=_0x362c14){return _0x4c51cd[_0x0d77('0x12')](0x193)[_0x0d77('0x13')]({'message':util[_0x0d77('0x9')](_0x0d77('0x14'),_0x361322)});}_0x12ff2f();})[_0x0d77('0x15')](function(_0x1cf15e){_0x12ff2f(_0x1cf15e);});});}function isUserLimit(){return isLimit(_0x0d77('0x16'),0x1,db[_0x0d77('0x17')],{'where':{'$or':[{'role':_0x0d77('0x18')},{'role':_0x0d77('0x19')}]}});}exports[_0x0d77('0x1a')]=isUserLimit; \ No newline at end of file +var _0x8e61=['catch','users','User','admin','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','update','base64','utf8','final','hasOwnProperty','use','License','findOne','then','count','status','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached'];(function(_0x2a7e8f,_0x5905ce){var _0xd3f2ae=function(_0x3db7d9){while(--_0x3db7d9){_0x2a7e8f['push'](_0x2a7e8f['shift']());}};_0xd3f2ae(++_0x5905ce);}(_0x8e61,0x163));var _0x18e6=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x8e61[_0x550d12];return _0x12103d;};'use strict';var crypto=require(_0x18e6('0x0'));var util=require(_0x18e6('0x1'));var compose=require(_0x18e6('0x2'));var db=require(_0x18e6('0x3'))['db'];var config=require(_0x18e6('0x4'));function getValueFromLicense(_0x4e0c0a,_0x51e06b){if(_0x4e0c0a&&_0x51e06b){if(_0x51e06b[_0x18e6('0x5')]&&_0x51e06b[_0x18e6('0x6')]){var _0x222c7e=_0x51e06b[_0x18e6('0x5')];var _0x30b72d=_0x51e06b[_0x18e6('0x6')];var _0x62fd3=_0x222c7e[_0x18e6('0x7')]('-')[0x4];var _0x2739a1=_0x222c7e[_0x18e6('0x7')]('-')[0x0];var _0x7aba6c=crypto[_0x18e6('0x8')](_0x18e6('0x9'),util['format']('%s:%s:%s',_0x62fd3,_0x222c7e,_0x2739a1));var _0x12046b=_0x7aba6c[_0x18e6('0xa')](_0x30b72d,_0x18e6('0xb'),_0x18e6('0xc'));_0x12046b+=_0x7aba6c[_0x18e6('0xd')]('utf8');var _0x1a4a00=JSON['parse'](_0x12046b);return _0x1a4a00[_0x18e6('0xe')](_0x4e0c0a)?_0x1a4a00[_0x4e0c0a]:null;}}return null;}function isLimit(_0x17bd38,_0x8dd62,_0x29ac6b,_0x5a75f1){var _0x770d3b=_0x8dd62;return compose()[_0x18e6('0xf')](function(_0x15a02f,_0x1d09e7,_0x2f24f2){return db[_0x18e6('0x10')][_0x18e6('0x11')]({'where':{'id':0x1},'raw':!![]})[_0x18e6('0x12')](function(_0x42b02e){var _0x1ea9e4=getValueFromLicense(_0x17bd38,_0x42b02e);return _0x1ea9e4?_0x1ea9e4:_0x770d3b;})[_0x18e6('0x12')](function(_0x730dc9){_0x770d3b=_0x730dc9;return _0x29ac6b[_0x18e6('0x13')](_0x5a75f1);})[_0x18e6('0x12')](function(_0x253ac7){if(_0x253ac7>=_0x770d3b){return _0x1d09e7[_0x18e6('0x14')](0x193)['json']({'message':util[_0x18e6('0x15')](_0x18e6('0x16'),_0x17bd38)});}_0x2f24f2();})[_0x18e6('0x17')](function(_0x30b09e){_0x2f24f2(_0x30b09e);});});}function isUserLimit(){return isLimit(_0x18e6('0x18'),0x1,db[_0x18e6('0x19')],{'where':{'$or':[{'role':_0x18e6('0x1a')},{'role':'user'}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 07ec33c..9556219 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 _0x831f=['omit','isArray','length','isObject','unset','isNumeric','match','lodash','sequelize','fields','split','filters','forOwn','parse','offset','map','priority','cast','substr','DESC','unsigned','ASC'];(function(_0x4fe5da,_0xb7eb37){var _0x3a3538=function(_0x434a03){while(--_0x434a03){_0x4fe5da['push'](_0x4fe5da['shift']());}};_0x3a3538(++_0xb7eb37);}(_0x831f,0xa1));var _0xf831=function(_0x2d513f,_0x126f93){_0x2d513f=_0x2d513f-0x0;var _0x2488c3=_0x831f[_0x2d513f];return _0x2488c3;};'use strict';var _=require(_0xf831('0x0'));var moment=require('moment');var sequelize=require(_0xf831('0x1'));var LIMIT_VALUE=0xfa;exports[_0xf831('0x2')]=function(_0x44e073){var _0x2fdcec=null;if(_0x44e073){_0x2fdcec=_0x44e073[_0xf831('0x3')](',');}return _0x2fdcec;};exports[_0xf831('0x4')]=function(_0x30db54){var _0x4a029b={};if(!_['isEmpty'](_0x30db54)){_0x4a029b={};_[_0xf831('0x5')](_0x30db54,function(_0x23c056,_0x1010f1){try{_0x4a029b[_0x1010f1]=_['isArray'](_0x23c056)?_0x23c056:JSON[_0xf831('0x6')](_0x23c056);}catch(_0x1fbdc1){_0x4a029b[_0x1010f1]=_0x23c056[_0xf831('0x3')](',');}});}return _0x4a029b;};exports['limit']=function(_0x101dfc){_0x101dfc=parseInt(_0x101dfc,0xa);if(!_0x101dfc||_0x101dfc<0x0){_0x101dfc=LIMIT_VALUE;}return _0x101dfc;};exports[_0xf831('0x7')]=function(_0x413c92){_0x413c92=parseInt(_0x413c92,0xa);if(!_0x413c92||_0x413c92<0x0){_0x413c92=0x0;}return _0x413c92;};exports['sort']=function(_0x46e873){var _0x21ac2f,_0x3694b7=null;if(_0x46e873){_0x21ac2f=_0x46e873[_0xf831('0x3')](',');_0x3694b7=_[_0xf831('0x8')](_0x21ac2f,function(_0x4a72de){if(_0x4a72de['indexOf']('-')===0x0){return[_0x4a72de===_0xf831('0x9')?sequelize[_0xf831('0xa')](sequelize['col'](_0xf831('0x9')),'unsigned'):_0x4a72de[_0xf831('0xb')](0x1),_0xf831('0xc')];}else{return[_0x4a72de===_0xf831('0x9')?sequelize[_0xf831('0xa')](sequelize['col']('priority'),_0xf831('0xd')):_0x4a72de,_0xf831('0xe')];}});}return _0x3694b7;};exports[_0xf831('0xf')]=function(_0x2eb898,_0x365e53){if(_['isEmpty'](_0x2eb898)){return _0x2eb898;}if(_[_0xf831('0x10')](_0x2eb898)){for(var _0x800173=0x0;_0x800173<_0x2eb898[_0xf831('0x11')];_0x800173+=0x1){_0x2eb898[_0x800173]=this[_0xf831('0xf')](_0x2eb898[_0x800173],_0x365e53);}return _0x2eb898;}if(!_[_0xf831('0x12')](_0x2eb898)){return _0x2eb898;}if(_['isString'](_0x365e53)){_0x365e53=[_0x365e53];}if(!_['isArray'](_0x365e53)){return _0x2eb898;}for(var _0x1f964c=0x0;_0x1f964c<_0x365e53[_0xf831('0x11')];_0x1f964c+=0x1){_[_0xf831('0x13')](_0x2eb898,_0x365e53[_0x1f964c]);}for(var _0x1d25a1 in _0x2eb898){if(_0x2eb898['hasOwnProperty'](_0x1d25a1)){_0x2eb898[_0x1d25a1]=this[_0xf831('0xf')](_0x2eb898[_0x1d25a1],_0x365e53);}}return _0x2eb898;};exports[_0xf831('0x14')]=function(_0x43650b){return _0x43650b[_0xf831('0x15')](RegExp('^[0-9]*$'))?!![]:![];};exports['isEmail']=function(_0x5a9c8c){return _0x5a9c8c[_0xf831('0x15')](/^\S+@\S+$/)?!![]:![];}; \ No newline at end of file +var _0x5576=['isNumeric','match','^[0-9]*$','isEmail','lodash','moment','sequelize','fields','split','isEmpty','forOwn','isArray','parse','limit','offset','sort','map','indexOf','priority','cast','col','unsigned','substr','DESC','omit','isString','unset','hasOwnProperty'];(function(_0x1b6563,_0x3bf0f1){var _0xdea7b8=function(_0x49e6c6){while(--_0x49e6c6){_0x1b6563['push'](_0x1b6563['shift']());}};_0xdea7b8(++_0x3bf0f1);}(_0x5576,0x11c));var _0x6557=function(_0x35f83e,_0x30ec55){_0x35f83e=_0x35f83e-0x0;var _0x249b05=_0x5576[_0x35f83e];return _0x249b05;};'use strict';var _=require(_0x6557('0x0'));var moment=require(_0x6557('0x1'));var sequelize=require(_0x6557('0x2'));var LIMIT_VALUE=0xfa;exports[_0x6557('0x3')]=function(_0x1a771d){var _0x1bbc9d=null;if(_0x1a771d){_0x1bbc9d=_0x1a771d[_0x6557('0x4')](',');}return _0x1bbc9d;};exports['filters']=function(_0x28d9f2){var _0x88c1d8={};if(!_[_0x6557('0x5')](_0x28d9f2)){_0x88c1d8={};_[_0x6557('0x6')](_0x28d9f2,function(_0x377cc2,_0x4146f2){try{_0x88c1d8[_0x4146f2]=_[_0x6557('0x7')](_0x377cc2)?_0x377cc2:JSON[_0x6557('0x8')](_0x377cc2);}catch(_0x49a4b8){_0x88c1d8[_0x4146f2]=_0x377cc2[_0x6557('0x4')](',');}});}return _0x88c1d8;};exports[_0x6557('0x9')]=function(_0x1598bf){_0x1598bf=parseInt(_0x1598bf,0xa);if(!_0x1598bf||_0x1598bf<0x0){_0x1598bf=LIMIT_VALUE;}return _0x1598bf;};exports[_0x6557('0xa')]=function(_0x147aa3){_0x147aa3=parseInt(_0x147aa3,0xa);if(!_0x147aa3||_0x147aa3<0x0){_0x147aa3=0x0;}return _0x147aa3;};exports[_0x6557('0xb')]=function(_0xd77322){var _0x496504,_0x5f4adb=null;if(_0xd77322){_0x496504=_0xd77322[_0x6557('0x4')](',');_0x5f4adb=_[_0x6557('0xc')](_0x496504,function(_0x4f913e){if(_0x4f913e[_0x6557('0xd')]('-')===0x0){return[_0x4f913e===_0x6557('0xe')?sequelize[_0x6557('0xf')](sequelize[_0x6557('0x10')](_0x6557('0xe')),_0x6557('0x11')):_0x4f913e[_0x6557('0x12')](0x1),_0x6557('0x13')];}else{return[_0x4f913e===_0x6557('0xe')?sequelize['cast'](sequelize['col'](_0x6557('0xe')),_0x6557('0x11')):_0x4f913e,'ASC'];}});}return _0x5f4adb;};exports[_0x6557('0x14')]=function(_0x31e35a,_0x3ba0a6){if(_[_0x6557('0x5')](_0x31e35a)){return _0x31e35a;}if(_[_0x6557('0x7')](_0x31e35a)){for(var _0x31053f=0x0;_0x31053f<_0x31e35a['length'];_0x31053f+=0x1){_0x31e35a[_0x31053f]=this['omit'](_0x31e35a[_0x31053f],_0x3ba0a6);}return _0x31e35a;}if(!_['isObject'](_0x31e35a)){return _0x31e35a;}if(_[_0x6557('0x15')](_0x3ba0a6)){_0x3ba0a6=[_0x3ba0a6];}if(!_['isArray'](_0x3ba0a6)){return _0x31e35a;}for(var _0x4f1349=0x0;_0x4f1349<_0x3ba0a6['length'];_0x4f1349+=0x1){_[_0x6557('0x16')](_0x31e35a,_0x3ba0a6[_0x4f1349]);}for(var _0x3befc9 in _0x31e35a){if(_0x31e35a[_0x6557('0x17')](_0x3befc9)){_0x31e35a[_0x3befc9]=this[_0x6557('0x14')](_0x31e35a[_0x3befc9],_0x3ba0a6);}}return _0x31e35a;};exports[_0x6557('0x18')]=function(_0x105caf){return _0x105caf[_0x6557('0x19')](RegExp(_0x6557('0x1a')))?!![]:![];};exports[_0x6557('0x1b')]=function(_0x44e75d){return _0x44e75d['match'](/^\S+@\S+$/)?!![]:![];}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 3c0c40b..c2475d7 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -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(_0x5989e6,_0xb49987){var _0x132f4a=function(_0x79055f){while(--_0x79055f){_0x5989e6['push'](_0x5989e6['shift']());}};_0x132f4a(++_0xb49987);}(_0xe706,0xa3));var _0x6e70=function(_0xf7fb0c,_0x2f198b){_0xf7fb0c=_0xf7fb0c-0x0;var _0x31545c=_0xe706[_0xf7fb0c];return _0x31545c;};'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 +var _0x0713=['use','join','root','favicon.ico','set','appPath','development','test','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','50mb','json','initialize','body-parser','method-override','cookie-parser','errorhandler','path','cors','moment','./environment','../mysqldb','default','get','env','production'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var express=require('express');var favicon=require('serve-favicon');var bodyParser=require(_0x3071('0x0'));var methodOverride=require(_0x3071('0x1'));var cookieParser=require(_0x3071('0x2'));var errorHandler=require(_0x3071('0x3'));var path=require(_0x3071('0x4'));var passport=require('passport');var cors=require(_0x3071('0x5'));var moment=require(_0x3071('0x6'));var config=require(_0x3071('0x7'));var db=require(_0x3071('0x8'))['db'];exports[_0x3071('0x9')]=function(_0x41cf76){var _0x1d3dd6=_0x41cf76[_0x3071('0xa')](_0x3071('0xb'));if(_0x1d3dd6===_0x3071('0xc')){_0x41cf76[_0x3071('0xd')](favicon(path[_0x3071('0xe')](config[_0x3071('0xf')],'public',_0x3071('0x10'))));_0x41cf76[_0x3071('0x11')](_0x3071('0x12'),path[_0x3071('0xe')](config[_0x3071('0xf')],'public'));}if(_0x1d3dd6===_0x3071('0x13')||_0x1d3dd6===_0x3071('0x14')){_0x41cf76[_0x3071('0xd')](favicon(path[_0x3071('0xe')](config[_0x3071('0xf')],'client','favicon.ico')));_0x41cf76[_0x3071('0x11')]('appPath',path[_0x3071('0xe')](config[_0x3071('0xf')],'client'));_0x41cf76[_0x3071('0xd')](errorHandler());}_0x41cf76['set'](_0x3071('0x15'),function(_0x45c93b,_0x1271d0){if(this[_0x45c93b]instanceof Date){_0x1271d0=this[_0x45c93b][_0x3071('0x16')]()[_0x3071('0x17')]('.')[0x0]+'Z';}return _0x1271d0;});_0x41cf76[_0x3071('0xd')](express[_0x3071('0x18')](_0x41cf76[_0x3071('0xa')](_0x3071('0x12'))));_0x41cf76[_0x3071('0x11')]('views',config[_0x3071('0xf')]+_0x3071('0x19'));_0x41cf76[_0x3071('0x1a')](_0x3071('0x1b'),require(_0x3071('0x1c'))[_0x3071('0x1d')]);_0x41cf76[_0x3071('0x11')](_0x3071('0x1e'),'html');_0x41cf76[_0x3071('0xd')](bodyParser[_0x3071('0x1f')]({'limit':_0x3071('0x20'),'extended':!![]}));_0x41cf76['use'](bodyParser[_0x3071('0x21')]({'limit':'50mb'}));_0x41cf76[_0x3071('0xd')](cors());_0x41cf76[_0x3071('0xd')](methodOverride());_0x41cf76[_0x3071('0xd')](cookieParser());_0x41cf76[_0x3071('0xd')](passport[_0x3071('0x22')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index e5816dc..5ce7c02 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 _0xe11f=['lodash','child_process','execSync','keys','length','filter','family','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','orderBy','cpus','map','model','join','createHash','md5','digest','hex','getUuid','platform','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','ipAddress','update','substring'];(function(_0x21af3a,_0x386e1d){var _0x268a49=function(_0x41a650){while(--_0x41a650){_0x21af3a['push'](_0x21af3a['shift']());}};_0x268a49(++_0x386e1d);}(_0xe11f,0x176));var _0xfe11=function(_0xe1b39d,_0x4f1545){_0xe1b39d=_0xe1b39d-0x0;var _0x2148e7=_0xe11f[_0xe1b39d];return _0x2148e7;};'use strict';var _=require(_0xfe11('0x0'));var os=require('os');var crypto=require('crypto');var machine=require('bimedia-machine-uuid');var exec=require(_0xfe11('0x1'))[_0xfe11('0x2')];function getInterfaces(){var _0x5f062d=[];var _0xe3ee6c=os['networkInterfaces']();var _0x4fd346=_['orderBy'](_[_0xfe11('0x3')](_0xe3ee6c));for(var _0x339d64=0x0;_0x339d64<_0x4fd346[_0xfe11('0x4')];_0x339d64++){var _0x1c5c93=_0xe3ee6c[_0x4fd346[_0x339d64]][_0xfe11('0x5')](function(_0x2f6c9){return _0x2f6c9[_0xfe11('0x6')]===_0xfe11('0x7')&&_0x2f6c9[_0xfe11('0x8')]===![];});_0x5f062d=_0x5f062d[_0xfe11('0x9')](_0x1c5c93);}return _0x5f062d;}function getFirstInterface(){var _0x570217=_[_0xfe11('0xa')](getInterfaces());return{'macAddress':_0x570217&&_0x570217['mac']?_0x570217[_0xfe11('0xb')]:_0xfe11('0xc'),'ipAddress':_0x570217&&_0x570217[_0xfe11('0xd')]?_0x570217[_0xfe11('0xd')]:_0xfe11('0xe')};}exports[_0xfe11('0xf')]=getFirstInterface;function getCPUhash(){var _0x1bc456=_[_0xfe11('0x10')](os[_0xfe11('0x11')]()[_0xfe11('0x12')](function(_0x3c473e){return _0x3c473e[_0xfe11('0x13')];}))[_0xfe11('0x14')](':');return crypto[_0xfe11('0x15')](_0xfe11('0x16'))['update'](_0x1bc456)[_0xfe11('0x17')](_0xfe11('0x18'));}exports[_0xfe11('0x19')]=function(){switch(os[_0xfe11('0x1a')]()){case _0xfe11('0x1b'):return exec(_0xfe11('0x1c'),{'encoding':_0xfe11('0x1d')})[_0xfe11('0x1e')]('\x0d\x0a','');default:var _0x3ab98d=getFirstInterface();var _0x15b199=getCPUhash();var _0x204089=_0x15b199+'|'+os['hostname']()+'|'+_0x3ab98d['macAddress']+'|'+_0x3ab98d[_0xfe11('0x1f')];var _0x283366=crypto[_0xfe11('0x15')](_0xfe11('0x16'))[_0xfe11('0x20')](_0x204089)[_0xfe11('0x17')](_0xfe11('0x18'));return _0x283366[_0xfe11('0x21')](0x0,0x8)+'-'+_0x283366[_0xfe11('0x21')](0x8,0xc)+'-'+_0x283366[_0xfe11('0x21')](0xc,0x10)+'-'+_0x283366[_0xfe11('0x21')](0x10,0x14)+'-'+_0x283366[_0xfe11('0x21')](0x14);}}; \ No newline at end of file +var _0x7724=['macAddress','ipAddress','createHash','digest','hex','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','orderBy','keys','length','filter','family','internal','concat','head','address','127.0.0.1','getFirstInterface','cpus','map','join','md5','update','platform','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname'];(function(_0x3c4553,_0x4e8bc5){var _0xa5d979=function(_0x256dd6){while(--_0x256dd6){_0x3c4553['push'](_0x3c4553['shift']());}};_0xa5d979(++_0x4e8bc5);}(_0x7724,0xe6));var _0x4772=function(_0x454e21,_0x20e8fe){_0x454e21=_0x454e21-0x0;var _0x2c96b9=_0x7724[_0x454e21];return _0x2c96b9;};'use strict';var _=require(_0x4772('0x0'));var os=require('os');var crypto=require(_0x4772('0x1'));var machine=require(_0x4772('0x2'));var exec=require(_0x4772('0x3'))[_0x4772('0x4')];function getInterfaces(){var _0x3b93b5=[];var _0x2c7c40=os['networkInterfaces']();var _0x3fdaad=_[_0x4772('0x5')](_[_0x4772('0x6')](_0x2c7c40));for(var _0x1b20b8=0x0;_0x1b20b8<_0x3fdaad[_0x4772('0x7')];_0x1b20b8++){var _0x2d9554=_0x2c7c40[_0x3fdaad[_0x1b20b8]][_0x4772('0x8')](function(_0x10d7d6){return _0x10d7d6[_0x4772('0x9')]==='IPv4'&&_0x10d7d6[_0x4772('0xa')]===![];});_0x3b93b5=_0x3b93b5[_0x4772('0xb')](_0x2d9554);}return _0x3b93b5;}function getFirstInterface(){var _0x39fbdb=_[_0x4772('0xc')](getInterfaces());return{'macAddress':_0x39fbdb&&_0x39fbdb['mac']?_0x39fbdb['mac']:'00:00:00:00:00:00','ipAddress':_0x39fbdb&&_0x39fbdb[_0x4772('0xd')]?_0x39fbdb['address']:_0x4772('0xe')};}exports[_0x4772('0xf')]=getFirstInterface;function getCPUhash(){var _0x1025a5=_[_0x4772('0x5')](os[_0x4772('0x10')]()[_0x4772('0x11')](function(_0xcb69d7){return _0xcb69d7['model'];}))[_0x4772('0x12')](':');return crypto['createHash'](_0x4772('0x13'))[_0x4772('0x14')](_0x1025a5)['digest']('hex');}exports['getUuid']=function(){switch(os[_0x4772('0x15')]()){case'win32':return exec(_0x4772('0x16'),{'encoding':_0x4772('0x17')})[_0x4772('0x18')]('\x0d\x0a','');default:var _0x541108=getFirstInterface();var _0x2d18da=getCPUhash();var _0x4e32a8=_0x2d18da+'|'+os[_0x4772('0x19')]()+'|'+_0x541108[_0x4772('0x1a')]+'|'+_0x541108[_0x4772('0x1b')];var _0x34092f=crypto[_0x4772('0x1c')](_0x4772('0x13'))[_0x4772('0x14')](_0x4e32a8)[_0x4772('0x1d')](_0x4772('0x1e'));return _0x34092f[_0x4772('0x1f')](0x0,0x8)+'-'+_0x34092f[_0x4772('0x1f')](0x8,0xc)+'-'+_0x34092f[_0x4772('0x1f')](0xc,0x10)+'-'+_0x34092f[_0x4772('0x1f')](0x10,0x14)+'-'+_0x34092f[_0x4772('0x1f')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 091771a..00a3927 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 _0x0020=['base64','final','createDecipher','||FIELD||VALUE||\x0a','User','admin','email','|reason|','|uuid|','|name|','fullname','|email|','getFirstInterface','ipAddress','openIssue','MOTLICENSE','Motion\x20License\x20Alert','active','license','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','data1','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','uuid','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','update','diff','days','DEMO\x20START\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','error','message','getUuid','License','findOrCreate','spread','default','util','crypto','moment','bluebird','pkginfo','../../mysqldb','../environment','./hardware','../logger','../../api/jira/jira.controller','format','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','then','catch','createCipher','aes-256-ctr','session','utf8'];(function(_0x38ef27,_0x3205d3){var _0x35ea=function(_0x521ff8){while(--_0x521ff8){_0x38ef27['push'](_0x38ef27['shift']());}};_0x35ea(++_0x3205d3);}(_0x0020,0x1c5));var _0x0002=function(_0x2b8347,_0x14e3f2){_0x2b8347=_0x2b8347-0x0;var _0x15e93e=_0x0020[_0x2b8347];return _0x15e93e;};'use strict';var util=require(_0x0002('0x0'));var crypto=require(_0x0002('0x1'));var moment=require(_0x0002('0x2'));var rp=require('request-promise');var BPromise=require(_0x0002('0x3'));var pkginfo=require(_0x0002('0x4'))(module,'version');var db=require(_0x0002('0x5'))['db'];var config=require(_0x0002('0x6'));var hardware=require(_0x0002('0x7'));var logger=require(_0x0002('0x8'))('license');var jira=require(_0x0002('0x9'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x1a98e4){return new BPromise(function(_0x77de55,_0x55c8ff){var _0x3a8753=util[_0x0002('0xa')]('%s/api/servers/%s/check?version=%s',HOST,_0x1a98e4,module[_0x0002('0xb')]['version']);if(oldToken){_0x3a8753=util[_0x0002('0xa')](_0x0002('0xc'),HOST,_0x1a98e4,module['exports']['version'],oldToken);}var _0x30cca6={'uri':_0x3a8753,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x30cca6)[_0x0002('0xd')](function(_0x5f221f){_0x77de55(_0x5f221f);})[_0x0002('0xe')](function(_0x5354c8){_0x55c8ff(_0x5354c8);});});}function encryptDate(_0x2a2bbc){var _0x1f59cb=crypto[_0x0002('0xf')](_0x0002('0x10'),config['secrets'][_0x0002('0x11')]);var _0x3c219c=_0x1f59cb['update'](_0x2a2bbc,_0x0002('0x12'),_0x0002('0x13'));_0x3c219c+=_0x1f59cb[_0x0002('0x14')](_0x0002('0x13'));return _0x3c219c;}function decryptDate(_0x1e983f){var _0x4cadcf=crypto[_0x0002('0x15')](_0x0002('0x10'),config['secrets']['session']);var _0x256525=_0x4cadcf['update'](_0x1e983f,_0x0002('0x13'),'utf8');_0x256525+=_0x4cadcf['final']('utf8');return _0x256525;}function sendJiraAlert(_0x18c73f,_0x4e6050,_0x557a2d){var _0x121756=_0x0002('0x16');return db[_0x0002('0x17')]['findOne']({'where':{'role':_0x0002('0x18')},'attributes':['fullname',_0x0002('0x19')],'raw':!![]})[_0x0002('0xd')](function(_0x3d483e){ADMIN=_0x3d483e;_0x121756+=_0x0002('0x1a')+_0x557a2d+'|\x0a';_0x121756+=_0x0002('0x1b')+_0x18c73f+'|\x0a';_0x121756+='|machineUuid|'+_0x4e6050+'|\x0a';_0x121756+=_0x0002('0x1c')+ADMIN[_0x0002('0x1d')]+'|\x0a';_0x121756+=_0x0002('0x1e')+ADMIN[_0x0002('0x19')]+'|\x0a';return _0x121756;})[_0x0002('0xd')](function(_0x380bec){var _0x114102=hardware[_0x0002('0x1f')]()[_0x0002('0x20')];return jira[_0x0002('0x21')]({'key':_0x0002('0x22'),'summary':_0x0002('0x23'),'description':_0x380bec,'issuetype':'Alert','oldToken':_0x18c73f,'newToken':_0x4e6050,'email':ADMIN[_0x0002('0x19')],'name':ADMIN[_0x0002('0x1d')],'reason':GRAY_PERIOD_REASON,'ip':_0x114102});});}function manageLicense(_0x15993a,_0x79a298){var _0x37cc2e=_0x79a298['get']({'plain':!![]});httpRequest(_0x15993a)[_0x0002('0xd')](function(_0xe1e6f4){if(oldToken){oldToken=undefined;}if(_0xe1e6f4[_0x0002('0x24')]){if(!_0x37cc2e[_0x0002('0x25')]&&_0x37cc2e['license']!=_0xe1e6f4['license']||_0x37cc2e[_0x0002('0x25')]&&_0x37cc2e[_0x0002('0x26')]){logger[_0x0002('0x27')](_0x0002('0x28'));}if(_0x37cc2e['license']&&!_0x37cc2e[_0x0002('0x26')]&&_0x37cc2e[_0x0002('0x25')]!=_0xe1e6f4[_0x0002('0x25')]){logger[_0x0002('0x27')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x37cc2e[_0x0002('0x25')]&&!_0x37cc2e[_0x0002('0x26')]&&_0x37cc2e[_0x0002('0x25')]==_0xe1e6f4['license']){return _0x79a298;}return _0x79a298['update']({'data1':_0x15993a,'data2':null,'license':_0xe1e6f4[_0x0002('0x25')]});}else{if(_0xe1e6f4['license']||_0x37cc2e[_0x0002('0x25')]){if(!_0x37cc2e['data2']){if(_0x37cc2e[_0x0002('0x29')]==_0x15993a){GRAY_PERIOD_REASON='Disabled';logger[_0x0002('0x27')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x0002('0x2a');oldToken=_0x37cc2e['data1'];logger[_0x0002('0x27')](_0x0002('0x2b'),_0x37cc2e[_0x0002('0x29')],_0x15993a);}sendJiraAlert(_0x37cc2e[_0x0002('0x29')],_0xe1e6f4[_0x0002('0x2c')],GRAY_PERIOD_REASON);logger[_0x0002('0x27')](_0x0002('0x2d'),GRAY_PERIOD_REASON[_0x0002('0x2e')](),moment()[_0x0002('0xa')]('YYYY-MM-DD\x20HH:mm'));return _0x79a298[_0x0002('0x2f')]({'data2':encryptDate(moment()[_0x0002('0xa')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x0002('0x30')](decryptDate(_0x37cc2e[_0x0002('0x26')]),_0x0002('0x31'))>DAYS){logger['info'](_0x0002('0x32'),moment()[_0x0002('0xa')](_0x0002('0x33')));return _0x79a298[_0x0002('0x2f')]({'data1':_0x15993a,'data2':null,'license':null});}}}else{if(_0x37cc2e[_0x0002('0x29')]!=_0x15993a){logger[_0x0002('0x27')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x37cc2e[_0x0002('0x29')],_0x15993a);return _0x79a298['update']({'data1':_0x15993a,'data2':null,'license':null});}}}return _0x79a298;})[_0x0002('0xd')](function(_0x54e65a){_0x79a298=_0x54e65a;})[_0x0002('0xe')](function(_0x167687){logger[_0x0002('0x34')](_0x167687[_0x0002('0x35')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x0002('0x36')](),_0x79a298);},TIME);});}function defaultLicense(){var _0x230b70=hardware[_0x0002('0x36')]();if(_0x230b70){return db[_0x0002('0x37')][_0x0002('0x38')]({'where':{'id':0x1},'defaults':{'data1':_0x230b70}})[_0x0002('0x39')](function(_0x421eb2,_0x3eca95){logger[_0x0002('0x27')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x230b70);manageLicense(_0x230b70,_0x421eb2);})[_0x0002('0xe')](function(_0x446bd6){logger[_0x0002('0x34')](_0x446bd6['message']);});}}exports[_0x0002('0x3a')]=defaultLicense; \ No newline at end of file +var _0x06e0=['admin','email','then','|reason|','|uuid|','|machineUuid|','|name|','fullname','|email|','getFirstInterface','ipAddress','openIssue','MOTLICENSE','Motion\x20License\x20Alert','active','data2','info','data1','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','uuid','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','days','DEMO\x20START\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','error','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','crypto','moment','request-promise','bluebird','pkginfo','../../mysqldb','../environment','./hardware','../logger','license','../../api/jira/jira.controller','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','version','catch','createCipher','aes-256-ctr','secrets','session','base64','createDecipher','update','utf8','||FIELD||VALUE||\x0a','findOne'];(function(_0x5d0f48,_0xefc46a){var _0x43b14f=function(_0x3673ca){while(--_0x3673ca){_0x5d0f48['push'](_0x5d0f48['shift']());}};_0x43b14f(++_0xefc46a);}(_0x06e0,0x1eb));var _0x006e=function(_0x597106,_0x44de51){_0x597106=_0x597106-0x0;var _0x3ca6b5=_0x06e0[_0x597106];return _0x3ca6b5;};'use strict';var util=require(_0x006e('0x0'));var crypto=require(_0x006e('0x1'));var moment=require(_0x006e('0x2'));var rp=require(_0x006e('0x3'));var BPromise=require(_0x006e('0x4'));var pkginfo=require(_0x006e('0x5'))(module,'version');var db=require(_0x006e('0x6'))['db'];var config=require(_0x006e('0x7'));var hardware=require(_0x006e('0x8'));var logger=require(_0x006e('0x9'))(_0x006e('0xa'));var jira=require(_0x006e('0xb'));var HOST=_0x006e('0xc');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x5a9bc7){return new BPromise(function(_0x1aebc9,_0x27fcf4){var _0x2559b1=util[_0x006e('0xd')](_0x006e('0xe'),HOST,_0x5a9bc7,module[_0x006e('0xf')]['version']);if(oldToken){_0x2559b1=util['format'](_0x006e('0x10'),HOST,_0x5a9bc7,module[_0x006e('0xf')][_0x006e('0x11')],oldToken);}var _0x550be2={'uri':_0x2559b1,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x550be2)['then'](function(_0x514dc6){_0x1aebc9(_0x514dc6);})[_0x006e('0x12')](function(_0x1ea830){_0x27fcf4(_0x1ea830);});});}function encryptDate(_0x39bad0){var _0x212b92=crypto[_0x006e('0x13')](_0x006e('0x14'),config[_0x006e('0x15')][_0x006e('0x16')]);var _0x4ee642=_0x212b92['update'](_0x39bad0,'utf8',_0x006e('0x17'));_0x4ee642+=_0x212b92['final'](_0x006e('0x17'));return _0x4ee642;}function decryptDate(_0x13d4bd){var _0x958c66=crypto[_0x006e('0x18')](_0x006e('0x14'),config[_0x006e('0x15')][_0x006e('0x16')]);var _0x204e4c=_0x958c66[_0x006e('0x19')](_0x13d4bd,_0x006e('0x17'),'utf8');_0x204e4c+=_0x958c66['final'](_0x006e('0x1a'));return _0x204e4c;}function sendJiraAlert(_0x237ad2,_0x1e3505,_0x521d15){var _0x2925f8=_0x006e('0x1b');return db['User'][_0x006e('0x1c')]({'where':{'role':_0x006e('0x1d')},'attributes':['fullname',_0x006e('0x1e')],'raw':!![]})[_0x006e('0x1f')](function(_0x5f26a1){ADMIN=_0x5f26a1;_0x2925f8+=_0x006e('0x20')+_0x521d15+'|\x0a';_0x2925f8+=_0x006e('0x21')+_0x237ad2+'|\x0a';_0x2925f8+=_0x006e('0x22')+_0x1e3505+'|\x0a';_0x2925f8+=_0x006e('0x23')+ADMIN[_0x006e('0x24')]+'|\x0a';_0x2925f8+=_0x006e('0x25')+ADMIN[_0x006e('0x1e')]+'|\x0a';return _0x2925f8;})[_0x006e('0x1f')](function(_0x3ca8be){var _0x248d77=hardware[_0x006e('0x26')]()[_0x006e('0x27')];return jira[_0x006e('0x28')]({'key':_0x006e('0x29'),'summary':_0x006e('0x2a'),'description':_0x3ca8be,'issuetype':'Alert','oldToken':_0x237ad2,'newToken':_0x1e3505,'email':ADMIN[_0x006e('0x1e')],'name':ADMIN[_0x006e('0x24')],'reason':GRAY_PERIOD_REASON,'ip':_0x248d77});});}function manageLicense(_0x25f4c9,_0x295e1f){var _0x47f7fa=_0x295e1f['get']({'plain':!![]});httpRequest(_0x25f4c9)[_0x006e('0x1f')](function(_0x483e95){if(oldToken){oldToken=undefined;}if(_0x483e95[_0x006e('0x2b')]){if(!_0x47f7fa[_0x006e('0xa')]&&_0x47f7fa[_0x006e('0xa')]!=_0x483e95[_0x006e('0xa')]||_0x47f7fa['license']&&_0x47f7fa[_0x006e('0x2c')]){logger[_0x006e('0x2d')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x47f7fa[_0x006e('0xa')]&&!_0x47f7fa[_0x006e('0x2c')]&&_0x47f7fa[_0x006e('0xa')]!=_0x483e95[_0x006e('0xa')]){logger[_0x006e('0x2d')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x47f7fa[_0x006e('0xa')]&&!_0x47f7fa[_0x006e('0x2c')]&&_0x47f7fa[_0x006e('0xa')]==_0x483e95[_0x006e('0xa')]){return _0x295e1f;}return _0x295e1f[_0x006e('0x19')]({'data1':_0x25f4c9,'data2':null,'license':_0x483e95[_0x006e('0xa')]});}else{if(_0x483e95[_0x006e('0xa')]||_0x47f7fa[_0x006e('0xa')]){if(!_0x47f7fa[_0x006e('0x2c')]){if(_0x47f7fa[_0x006e('0x2e')]==_0x25f4c9){GRAY_PERIOD_REASON=_0x006e('0x2f');logger[_0x006e('0x2d')](_0x006e('0x30'));}else{GRAY_PERIOD_REASON=_0x006e('0x31');oldToken=_0x47f7fa[_0x006e('0x2e')];logger['info'](_0x006e('0x32'),_0x47f7fa[_0x006e('0x2e')],_0x25f4c9);}sendJiraAlert(_0x47f7fa['data1'],_0x483e95[_0x006e('0x33')],GRAY_PERIOD_REASON);logger[_0x006e('0x2d')](_0x006e('0x34'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x006e('0xd')]('YYYY-MM-DD\x20HH:mm'));return _0x295e1f['update']({'data2':encryptDate(moment()[_0x006e('0xd')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()['diff'](decryptDate(_0x47f7fa[_0x006e('0x2c')]),_0x006e('0x35'))>DAYS){logger[_0x006e('0x2d')](_0x006e('0x36'),moment()[_0x006e('0xd')](_0x006e('0x37')));return _0x295e1f[_0x006e('0x19')]({'data1':_0x25f4c9,'data2':null,'license':null});}}}else{if(_0x47f7fa[_0x006e('0x2e')]!=_0x25f4c9){logger['info'](_0x006e('0x32'),_0x47f7fa[_0x006e('0x2e')],_0x25f4c9);return _0x295e1f['update']({'data1':_0x25f4c9,'data2':null,'license':null});}}}return _0x295e1f;})[_0x006e('0x1f')](function(_0x3e616a){_0x295e1f=_0x3e616a;})[_0x006e('0x12')](function(_0x23602f){logger[_0x006e('0x38')](_0x23602f[_0x006e('0x39')]);})[_0x006e('0x3a')](function(){setTimeout(function(){manageLicense(hardware[_0x006e('0x3b')](),_0x295e1f);},TIME);});}function defaultLicense(){var _0xcfa604=hardware[_0x006e('0x3b')]();if(_0xcfa604){return db[_0x006e('0x3c')][_0x006e('0x3d')]({'where':{'id':0x1},'defaults':{'data1':_0xcfa604}})[_0x006e('0x3e')](function(_0x3ce60e,_0x152001){logger[_0x006e('0x2d')](_0x006e('0x3f'),_0xcfa604);manageLicense(_0xcfa604,_0x3ce60e);})[_0x006e('0x12')](function(_0x213e81){logger[_0x006e('0x38')](_0x213e81[_0x006e('0x39')]);});}}exports[_0x006e('0x40')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index b2fac23..5bb6d98 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 _0xe6d1=['final','deadline','add','days','grayReason','machineUuid','changed','disabled','2027-01-01T00:00:00.000Z','Breaking\x20license','message','Demo\x20license','getUuid','getLicense','find','defaults','checkLicense','lodash','moment','../environment','../../mysqldb','license','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','parse','demo','uuid','secrets','session','utf8'];(function(_0x24530d,_0x819d7a){var _0x2c4f83=function(_0x508922){while(--_0x508922){_0x24530d['push'](_0x24530d['shift']());}};_0x2c4f83(++_0x819d7a);}(_0xe6d1,0xf5));var _0x1e6d=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xe6d1[_0x82129b];return _0x2ae5dc;};'use strict';var crypto=require('crypto');var util=require('util');var _=require(_0x1e6d('0x0'));var moment=require(_0x1e6d('0x1'));var hardware=require('./hardware');var config=require(_0x1e6d('0x2'));var db=require(_0x1e6d('0x3'))['db'];function checkLicense(_0x27dd1c,_0x23de6c){if(_0x27dd1c){try{var _0x3048c7=_0x23de6c||_0x27dd1c[_0x1e6d('0x4')];if(_[_0x1e6d('0x5')](_0x3048c7)){throw new Error(_0x1e6d('0x6'));}var _0x492b4a=_0x27dd1c[_0x1e6d('0x7')];var _0x5b4026=_0x27dd1c[_0x1e6d('0x8')];var _0x33f859=_0x492b4a['split']('-')[0x4];var _0x3b96d5=_0x492b4a[_0x1e6d('0x9')]('-')[0x0];var _0x1a18e6=crypto[_0x1e6d('0xa')](_0x1e6d('0xb'),util[_0x1e6d('0xc')](_0x1e6d('0xd'),_0x33f859,_0x492b4a,_0x3b96d5));var _0x5a123f=_0x1a18e6[_0x1e6d('0xe')](_0x3048c7,'base64','utf8');_0x5a123f+=_0x1a18e6['final']('utf8');var _0x1edf4b=JSON[_0x1e6d('0xf')](_0x5a123f);_0x1edf4b[_0x1e6d('0x10')]=![];_0x1edf4b[_0x1e6d('0x11')]=_0x492b4a;_0x1edf4b['machineUuid']=hardware['getUuid']();if(_0x5b4026){var _0x5e31a1=crypto[_0x1e6d('0xa')]('aes-256-ctr',config[_0x1e6d('0x12')][_0x1e6d('0x13')]);var _0x515cf3=_0x5e31a1[_0x1e6d('0xe')](_0x5b4026,'base64',_0x1e6d('0x14'));_0x515cf3+=_0x5e31a1[_0x1e6d('0x15')]('utf8');_0x1edf4b['gray']=_0x515cf3;_0x1edf4b[_0x1e6d('0x16')]=moment(_0x515cf3)[_0x1e6d('0x17')](0x7,_0x1e6d('0x18'))[_0x1e6d('0xc')]();_0x1edf4b[_0x1e6d('0x19')]=_0x1edf4b[_0x1e6d('0x11')]!=_0x1edf4b[_0x1e6d('0x1a')]?_0x1e6d('0x1b'):_0x1e6d('0x1c');}return _0x1edf4b;}catch(_0x1c439e){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x1e6d('0x1d'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x1e6d('0x1e'),'uuid':_0x27dd1c[_0x1e6d('0x7')],'machineUuid':hardware['getUuid'](),'message':_0x1c439e[_0x1e6d('0x1f')],'virtual':0x0,'voice':!![],'preferred':![],'screenrecording':![],'sales':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x1e6d('0x1d'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x1e6d('0x20'),'uuid':_0x27dd1c[_0x1e6d('0x7')],'machineUuid':hardware[_0x1e6d('0x21')](),'virtual':0x0,'voice':!![],'preferred':![],'screenrecording':![],'sales':![]};}exports[_0x1e6d('0x22')]=function(_0x3deb2e){return db['License'][_0x1e6d('0x23')](_[_0x1e6d('0x24')](_0x3deb2e,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x1bbcee){return checkLicense(_0x1bbcee,null);});};exports[_0x1e6d('0x25')]=checkLicense; \ No newline at end of file +var _0x45c1=['message','Demo\x20license','License','find','defaults','then','crypto','util','moment','./hardware','../../mysqldb','license','isEmpty','data1','data2','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','final','parse','demo','machineUuid','secrets','session','utf8','deadline','add','grayReason','disabled','2027-01-01T00:00:00.000Z','Breaking\x20license','getUuid'];(function(_0x281d34,_0x49c822){var _0x3c82c3=function(_0x27b741){while(--_0x27b741){_0x281d34['push'](_0x281d34['shift']());}};_0x3c82c3(++_0x49c822);}(_0x45c1,0x126));var _0x145c=function(_0x285bc5,_0xf86514){_0x285bc5=_0x285bc5-0x0;var _0x3c644a=_0x45c1[_0x285bc5];return _0x3c644a;};'use strict';var crypto=require(_0x145c('0x0'));var util=require(_0x145c('0x1'));var _=require('lodash');var moment=require(_0x145c('0x2'));var hardware=require(_0x145c('0x3'));var config=require('../environment');var db=require(_0x145c('0x4'))['db'];function checkLicense(_0x2fdfb2,_0x4f8a19){if(_0x2fdfb2){try{var _0x1b284a=_0x4f8a19||_0x2fdfb2[_0x145c('0x5')];if(_[_0x145c('0x6')](_0x1b284a)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x43a9ce=_0x2fdfb2[_0x145c('0x7')];var _0x17e389=_0x2fdfb2[_0x145c('0x8')];var _0x1f9fda=_0x43a9ce['split']('-')[0x4];var _0x3d9722=_0x43a9ce[_0x145c('0x9')]('-')[0x0];var _0x4dc150=crypto[_0x145c('0xa')](_0x145c('0xb'),util[_0x145c('0xc')](_0x145c('0xd'),_0x1f9fda,_0x43a9ce,_0x3d9722));var _0x47e9ce=_0x4dc150[_0x145c('0xe')](_0x1b284a,_0x145c('0xf'),'utf8');_0x47e9ce+=_0x4dc150[_0x145c('0x10')]('utf8');var _0x4fafab=JSON[_0x145c('0x11')](_0x47e9ce);_0x4fafab[_0x145c('0x12')]=![];_0x4fafab['uuid']=_0x43a9ce;_0x4fafab[_0x145c('0x13')]=hardware['getUuid']();if(_0x17e389){var _0x43b96a=crypto['createDecipher'](_0x145c('0xb'),config[_0x145c('0x14')][_0x145c('0x15')]);var _0x568942=_0x43b96a[_0x145c('0xe')](_0x17e389,'base64','utf8');_0x568942+=_0x43b96a[_0x145c('0x10')](_0x145c('0x16'));_0x4fafab['gray']=_0x568942;_0x4fafab[_0x145c('0x17')]=moment(_0x568942)[_0x145c('0x18')](0x7,'days')[_0x145c('0xc')]();_0x4fafab[_0x145c('0x19')]=_0x4fafab['uuid']!=_0x4fafab[_0x145c('0x13')]?'changed':_0x145c('0x1a');}return _0x4fafab;}catch(_0x3bfc49){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x145c('0x1b'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x145c('0x1c'),'uuid':_0x2fdfb2[_0x145c('0x7')],'machineUuid':hardware[_0x145c('0x1d')](),'message':_0x3bfc49[_0x145c('0x1e')],'virtual':0x0,'voice':!![],'preferred':![],'screenrecording':![],'sales':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x145c('0x1b'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x145c('0x1f'),'uuid':_0x2fdfb2['data1'],'machineUuid':hardware[_0x145c('0x1d')](),'virtual':0x0,'voice':!![],'preferred':![],'screenrecording':![],'sales':![]};}exports['getLicense']=function(_0x26efde){return db[_0x145c('0x20')][_0x145c('0x21')](_[_0x145c('0x22')](_0x26efde,{'raw':!![],'where':{'id':0x1}}))[_0x145c('0x23')](function(_0x343efc){return checkLicense(_0x343efc,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 bbe8e54..1a28a7e 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 _0x04b8=['http://localhost:9000','app-id','secret'];(function(_0x49bc16,_0xa1afa6){var _0x32e057=function(_0x4be257){while(--_0x4be257){_0x49bc16['push'](_0x49bc16['shift']());}};_0x32e057(++_0xa1afa6);}(_0x04b8,0x159));var _0x804b=function(_0x7268c1,_0x398217){_0x7268c1=_0x7268c1-0x0;var _0x397c21=_0x04b8[_0x7268c1];return _0x397c21;};'use strict';module['exports']={'DOMAIN':_0x804b('0x0'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x804b('0x1'),'GOOGLE_SECRET':_0x804b('0x2'),'DEBUG':''}; \ No newline at end of file +var _0xd1d4=['http://localhost:9000','app-id','exports'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xd1d4,0xfb));var _0x4d1d=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0xd1d4[_0x16d10f];return _0x50c823;};'use strict';module[_0x4d1d('0x0')]={'DOMAIN':_0x4d1d('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x4d1d('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index f1bca40..5a880c6 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0901=['/var','%s-%s.log','[%s]\x20[%s]\x20%s\x20-\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','level','message','exports','Logger','transports','File','error','%s-%s','info','Console','debugLevel','moment','winston','util','INFO'];(function(_0x408762,_0x1e2f39){var _0x5e9e3e=function(_0x1e4e3e){while(--_0x1e4e3e){_0x408762['push'](_0x408762['shift']());}};_0x5e9e3e(++_0x1e2f39);}(_0x0901,0x178));var _0x1090=function(_0xe76dc4,_0x440f47){_0xe76dc4=_0xe76dc4-0x0;var _0x1fa135=_0x0901[_0xe76dc4];return _0x1fa135;};'use strict';var moment=require(_0x1090('0x0'));var winston=require(_0x1090('0x1'));var util=require(_0x1090('0x2'));var path=require('path');var debugLevel=_0x1090('0x3');function filename(_0x4b25db,_0x7d8b99){return path['join'](_0x1090('0x4'),'log','xcally',util['format'](_0x1090('0x5'),_0x4b25db,_0x7d8b99));}function formatter(_0x30f5fd,_0x47e404){return util['format'](_0x1090('0x6'),moment()[_0x1090('0x7')](_0x1090('0x8')),_0x47e404[_0x1090('0x9')]['toUpperCase'](),_0x30f5fd,_0x47e404[_0x1090('0xa')]);}module[_0x1090('0xb')]=function(_0xd404df){return new winston[(_0x1090('0xc'))]({'transports':[new winston[(_0x1090('0xd'))][(_0x1090('0xe'))]({'name':util[_0x1090('0x7')]('%s-%s',_0xd404df,_0x1090('0xf')),'filename':filename(_0xd404df,_0x1090('0xf')),'level':_0x1090('0xf'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x431ea8){return formatter(_0xd404df,_0x431ea8);}}),new winston['transports'][(_0x1090('0xe'))]({'name':util['format'](_0x1090('0x10'),_0xd404df,_0x1090('0x11')),'filename':filename(_0xd404df,'info'),'level':_0x1090('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4d00bc){return formatter(_0xd404df,_0x4d00bc);}}),new winston['transports'][(_0x1090('0x12'))]({'level':process['env'][_0x1090('0x13')]||debugLevel,'json':![],'formatter':function(_0xfc4255){return formatter(_0xd404df,_0xfc4255);}})]});}; \ No newline at end of file +var _0x3302=['exports','Logger','transports','File','%s-%s','error','info','Console','debugLevel','moment','winston','util','path','INFO','join','/var','log','xcally','format','%s-%s.log','toUpperCase'];(function(_0x6df205,_0x77b4cf){var _0x5933bd=function(_0x4c40f6){while(--_0x4c40f6){_0x6df205['push'](_0x6df205['shift']());}};_0x5933bd(++_0x77b4cf);}(_0x3302,0x12f));var _0x2330=function(_0x4c6475,_0xb5b84e){_0x4c6475=_0x4c6475-0x0;var _0x3d1621=_0x3302[_0x4c6475];return _0x3d1621;};'use strict';var moment=require(_0x2330('0x0'));var winston=require(_0x2330('0x1'));var util=require(_0x2330('0x2'));var path=require(_0x2330('0x3'));var debugLevel=_0x2330('0x4');function filename(_0x8fffcd,_0x4b0832){return path[_0x2330('0x5')](_0x2330('0x6'),_0x2330('0x7'),_0x2330('0x8'),util[_0x2330('0x9')](_0x2330('0xa'),_0x8fffcd,_0x4b0832));}function formatter(_0x5def2f,_0x10e589){return util[_0x2330('0x9')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x2330('0x9')]('YYYY-MM-DD\x20HH:mm:ss'),_0x10e589['level'][_0x2330('0xb')](),_0x5def2f,_0x10e589['message']);}module[_0x2330('0xc')]=function(_0x928d81){return new winston[(_0x2330('0xd'))]({'transports':[new winston[(_0x2330('0xe'))][(_0x2330('0xf'))]({'name':util[_0x2330('0x9')](_0x2330('0x10'),_0x928d81,_0x2330('0x11')),'filename':filename(_0x928d81,_0x2330('0x11')),'level':_0x2330('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4fb8c0){return formatter(_0x928d81,_0x4fb8c0);}}),new winston[(_0x2330('0xe'))][(_0x2330('0xf'))]({'name':util[_0x2330('0x9')](_0x2330('0x10'),_0x928d81,_0x2330('0x12')),'filename':filename(_0x928d81,'info'),'level':_0x2330('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x56993e){return formatter(_0x928d81,_0x56993e);}}),new winston['transports'][(_0x2330('0x13'))]({'level':process['env'][_0x2330('0x14')]||debugLevel,'json':![],'formatter':function(_0x36dd71){return formatter(_0x928d81,_0x36dd71);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index a769f76..a4a9414 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 _0x5195=['routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','path','join','ami','agi','../../services/email/index.js'];(function(_0x5c9397,_0xe6bc88){var _0x194baf=function(_0x50d093){while(--_0x50d093){_0x5c9397['push'](_0x5c9397['shift']());}};_0x194baf(++_0xe6bc88);}(_0x5195,0x1a2));var _0x5519=function(_0x506cbe,_0x818678){_0x506cbe=_0x506cbe-0x0;var _0x4fdaa7=_0x5195[_0x506cbe];return _0x4fdaa7;};'use strict';var path=require(_0x5519('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path[_0x5519('0x1')](__dirname,'../../services/express/index.js')},{'name':_0x5519('0x2'),'script':path[_0x5519('0x1')](__dirname,'../../services/ami/index.js')},{'name':_0x5519('0x3'),'script':path[_0x5519('0x1')](__dirname,'../../services/agi/index.js')},{'name':'email','script':path[_0x5519('0x1')](__dirname,_0x5519('0x4'))},{'name':_0x5519('0x5'),'script':path[_0x5519('0x1')](__dirname,_0x5519('0x6'))},{'name':_0x5519('0x7'),'script':path[_0x5519('0x1')](__dirname,_0x5519('0x8'))}]};module['exports']=config; \ No newline at end of file +var _0x8ed3=['path','express','../../services/express/index.js','ami','join','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','routing','xdr','../../services/xdr/index.js'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x8ed3,0x1d4));var _0x38ed=function(_0x1da5f4,_0x44bca7){_0x1da5f4=_0x1da5f4-0x0;var _0x58e944=_0x8ed3[_0x1da5f4];return _0x58e944;};'use strict';var path=require(_0x38ed('0x0'));var os=require('os');var config={'apps':[{'name':_0x38ed('0x1'),'script':path['join'](__dirname,_0x38ed('0x2'))},{'name':_0x38ed('0x3'),'script':path[_0x38ed('0x4')](__dirname,_0x38ed('0x5'))},{'name':_0x38ed('0x6'),'script':path[_0x38ed('0x4')](__dirname,_0x38ed('0x7'))},{'name':_0x38ed('0x8'),'script':path['join'](__dirname,_0x38ed('0x9'))},{'name':_0x38ed('0xa'),'script':path[_0x38ed('0x4')](__dirname,'../../services/routing/index.js')},{'name':_0x38ed('0xb'),'script':path[_0x38ed('0x4')](__dirname,_0x38ed('0xc'))}]};module['exports']=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 3de8c65..1aeb1a9 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 _0xedd9=['restart','list','describe','delete','saved','bluebird','./config','connect','connected','start','then','stop','disconnect'];(function(_0x3e3857,_0x3d1ad3){var _0x5f4be5=function(_0x447b43){while(--_0x447b43){_0x3e3857['push'](_0x3e3857['shift']());}};_0x5f4be5(++_0x3d1ad3);}(_0xedd9,0xfc));var _0x9edd=function(_0x127e00,_0x1427e0){_0x127e00=_0x127e00-0x0;var _0x583edb=_0xedd9[_0x127e00];return _0x583edb;};'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 +var _0x008c=['start','then','disconnect','stop','restart','list','describe','delete','pm2','bluebird','./config','connected'];(function(_0x24ab40,_0x2ba539){var _0x24fe6c=function(_0x3a39ff){while(--_0x3a39ff){_0x24ab40['push'](_0x24ab40['shift']());}};_0x24fe6c(++_0x2ba539);}(_0x008c,0x188));var _0xc008=function(_0x9166ea,_0x1f21b0){_0x9166ea=_0x9166ea-0x0;var _0xdceec9=_0x008c[_0x9166ea];return _0xdceec9;};'use strict';var pm2=require(_0xc008('0x0'));var BPromise=require(_0xc008('0x1'));var config=require(_0xc008('0x2'));function connect(){return new BPromise(function(_0xae17af,_0x1d119a){return pm2['connect'](function(_0x3641af){if(_0x3641af){return _0x1d119a(_0x3641af);}return _0xae17af(_0xc008('0x3'));});});};exports[_0xc008('0x4')]=function(_0x163bd9){return connect()[_0xc008('0x5')](function(){return new BPromise(function(_0x1679e0,_0x13aa7){return pm2[_0xc008('0x4')](_0x163bd9,function(_0x9c8cb2,_0x4af530){if(_0x9c8cb2){return _0x13aa7(_0x9c8cb2);}pm2[_0xc008('0x6')]();return _0x1679e0(_0x4af530);});});});};exports['stop']=function(_0x30be38){return connect()['then'](function(){return new BPromise(function(_0x52041f,_0x27830d){return pm2[_0xc008('0x7')](_0x30be38,function(_0x57c46d,_0x51ba7d){if(_0x57c46d){return _0x27830d(_0x57c46d);}pm2['disconnect']();return _0x52041f(_0x51ba7d);});});});};exports[_0xc008('0x8')]=function(_0xc881aa){return connect()['then'](function(){return new BPromise(function(_0xae2dab,_0x332fd4){return pm2[_0xc008('0x8')](_0xc881aa,function(_0x2a5b4e,_0x9ffa93){if(_0x2a5b4e){return _0x332fd4(_0x2a5b4e);}pm2[_0xc008('0x6')]();return _0xae2dab(_0x9ffa93);});});});};exports[_0xc008('0x9')]=function(){return connect()['then'](function(){return new BPromise(function(_0x560e28,_0x33f44c){return pm2['list'](function(_0x25e13f,_0x4584e1){if(_0x25e13f){return _0x33f44c(_0x25e13f);}pm2[_0xc008('0x6')]();return _0x560e28(_0x4584e1);});});});};exports[_0xc008('0xa')]=function(_0x3f0ecf){return connect()['then'](function(){return new BPromise(function(_0x5e894e,_0x4bd0f4){return pm2[_0xc008('0xa')](_0x3f0ecf,function(_0x15a6ad,_0x3cafe3){if(_0x15a6ad){return _0x4bd0f4(_0x15a6ad);}pm2[_0xc008('0x6')]();return _0x5e894e(_0x3cafe3);});});});};exports['delete']=function(_0x53b06e){return connect()['then'](function(){return new BPromise(function(_0x5c2668,_0x46042b){return pm2[_0xc008('0xb')](_0x53b06e,function(_0x501137,_0x813397){if(_0x501137){return _0x46042b(_0x501137);}pm2['disconnect']();return _0x5c2668(_0x813397);});});});};exports['dump']=function(){return connect()['then'](function(){return new BPromise(function(_0x50261c,_0x5754a0){return pm2['dump'](function(_0x5560b1){if(_0x5560b1){return _0x5754a0(_0x5560b1);}return _0x50261c('saved');});});});}; \ No newline at end of file diff --git a/server/config/schedule/automaticRenewSubscription.js b/server/config/schedule/automaticRenewSubscription.js index af53e1f..a2b63ce 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 _0xaf83=['error','startSubscription','lodash','ioredis','../../mysqldb','../../config/environment','Setting','find','chatTimeout','ChatInteraction','findAll','lastMsgAt','then','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','chatInteraction:update','catch'];(function(_0x1e500e,_0x2c9d74){var _0x10dc5e=function(_0x354423){while(--_0x354423){_0x1e500e['push'](_0x1e500e['shift']());}};_0x10dc5e(++_0x2c9d74);}(_0xaf83,0x1ba));var _0x3af8=function(_0x2f78bd,_0x3c4b24){_0x2f78bd=_0x2f78bd-0x0;var _0x48383e=_0xaf83[_0x2f78bd];return _0x48383e;};'use strict';var _=require(_0x3af8('0x0'));var moment=require('moment');var Redis=require(_0x3af8('0x1'));var db=require(_0x3af8('0x2'))['db'];var config=require(_0x3af8('0x3'));function subscriptionsAutomatic(){var _0x1bda37=0x0;var _0x339b4f=[];return db[_0x3af8('0x4')][_0x3af8('0x5')]({'raw':!![],'attributes':['id',_0x3af8('0x6')],'where':{'id':0x1}})['then'](function(_0x78c608){_0x1bda37=_0x78c608[_0x3af8('0x6')];if(_0x1bda37){return db[_0x3af8('0x7')][_0x3af8('0x8')]({'raw':!![],'attributes':['id',_0x3af8('0x9')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x78c608[_0x3af8('0x6')],'minutes')}}});}else{return[];}})[_0x3af8('0xa')](function(_0x25c9d8){_0x339b4f=_0x25c9d8;if(_0x1bda37){return db[_0x3af8('0x7')][_0x3af8('0xb')]({'closeReason':_0x3af8('0xc'),'disposition':_0x3af8('0xd'),'closed':!![],'closedAt':moment()[_0x3af8('0xe')](_0x3af8('0xf'))},{'where':{'id':_['map'](_0x339b4f||[],'id')}});}})[_0x3af8('0xa')](function(_0x1bffa2){for(var _0x229122=0x0;_0x229122<_0x339b4f['length'];_0x229122++){io['emit'](_0x3af8('0x10'),{'id':_0x339b4f[_0x229122]['id'],'closed':!![]});}})[_0x3af8('0x11')](function(_0x4e038d){console[_0x3af8('0x12')](_0x4e038d);});}exports[_0x3af8('0x13')]=function(){setInterval(function(){return subscriptionsAutomatic();},0x3c*0x3e8);return subscriptionsAutomatic();}; \ No newline at end of file +var _0xc9a7=['update','system','format','YYYY-MM-DD\x20HH:mm:ss','map','length','emit','catch','error','startSubscription','lodash','moment','../../mysqldb','Setting','find','chatTimeout','ChatInteraction','findAll','lastMsgAt','subtract','then'];(function(_0x5b0b35,_0x314f9b){var _0x198c11=function(_0x132787){while(--_0x132787){_0x5b0b35['push'](_0x5b0b35['shift']());}};_0x198c11(++_0x314f9b);}(_0xc9a7,0x184));var _0x7c9a=function(_0x243201,_0x5e6321){_0x243201=_0x243201-0x0;var _0x3c9156=_0xc9a7[_0x243201];return _0x3c9156;};'use strict';var _=require(_0x7c9a('0x0'));var moment=require(_0x7c9a('0x1'));var Redis=require('ioredis');var db=require(_0x7c9a('0x2'))['db'];var config=require('../../config/environment');function subscriptionsAutomatic(){var _0x2982af=0x0;var _0x5d7059=[];return db[_0x7c9a('0x3')][_0x7c9a('0x4')]({'raw':!![],'attributes':['id',_0x7c9a('0x5')],'where':{'id':0x1}})['then'](function(_0x9d893c){_0x2982af=_0x9d893c[_0x7c9a('0x5')];if(_0x2982af){return db[_0x7c9a('0x6')][_0x7c9a('0x7')]({'raw':!![],'attributes':['id',_0x7c9a('0x8')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x7c9a('0x9')](_0x9d893c[_0x7c9a('0x5')],'minutes')}}});}else{return[];}})[_0x7c9a('0xa')](function(_0x35defc){_0x5d7059=_0x35defc;if(_0x2982af){return db['ChatInteraction'][_0x7c9a('0xb')]({'closeReason':_0x7c9a('0xc'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x7c9a('0xd')](_0x7c9a('0xe'))},{'where':{'id':_[_0x7c9a('0xf')](_0x5d7059||[],'id')}});}})[_0x7c9a('0xa')](function(_0x211d3e){for(var _0x4d4a82=0x0;_0x4d4a82<_0x5d7059[_0x7c9a('0x10')];_0x4d4a82++){io[_0x7c9a('0x11')]('chatInteraction:update',{'id':_0x5d7059[_0x4d4a82]['id'],'closed':!![]});}})[_0x7c9a('0x12')](function(_0x396186){console[_0x7c9a('0x13')](_0x396186);});}exports[_0x7c9a('0x14')]=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 a33f0bf..c174b96 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 _0x51ba=['length','emit','chatInteraction:update','start','moment','ioredis','../../mysqldb','../../config/environment','redis','Setting','find','then','ChatInteraction','findAll','lastMsgAt','subtract','chatTimeout','update','system','timeout','format'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x51ba,0x169));var _0xa51b=function(_0xf98bd,_0x520d6c){_0xf98bd=_0xf98bd-0x0;var _0x57cb7a=_0x51ba[_0xf98bd];return _0x57cb7a;};'use strict';var _=require('lodash');var moment=require(_0xa51b('0x0'));var Redis=require(_0xa51b('0x1'));var db=require(_0xa51b('0x2'))['db'];var config=require(_0xa51b('0x3'));config[_0xa51b('0x4')]=_['defaults'](config[_0xa51b('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x3592cb=0x0;var _0xb59af1=[];return db[_0xa51b('0x5')][_0xa51b('0x6')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0xa51b('0x7')](function(_0x5cff86){_0x3592cb=_0x5cff86['chatTimeout'];if(_0x3592cb){return db[_0xa51b('0x8')][_0xa51b('0x9')]({'raw':!![],'attributes':['id',_0xa51b('0xa')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xa51b('0xb')](_0x5cff86[_0xa51b('0xc')],'minutes')}}});}else{return[];}})[_0xa51b('0x7')](function(_0x37abd7){_0xb59af1=_0x37abd7;if(_0x3592cb){return db['ChatInteraction'][_0xa51b('0xd')]({'closeReason':_0xa51b('0xe'),'disposition':_0xa51b('0xf'),'closed':!![],'closedAt':moment()[_0xa51b('0x10')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_['map'](_0xb59af1||[],'id')}});}})[_0xa51b('0x7')](function(_0xb3ea8c){for(var _0x4f70c6=0x0;_0x4f70c6<_0xb59af1[_0xa51b('0x11')];_0x4f70c6++){io[_0xa51b('0x12')](_0xa51b('0x13'),{'id':_0xb59af1[_0x4f70c6]['id'],'closed':!![]});}})['catch'](function(_0x53551b){console['error'](_0x53551b);});}exports[_0xa51b('0x14')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x3f43=['map','length','emit','catch','error','start','lodash','moment','ioredis','../../config/environment','redis','socket.io-emitter','Setting','find','then','chatTimeout','ChatInteraction','findAll','lastMsgAt','subtract','minutes','system','timeout','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0x3f43,0x1e6));var _0x33f4=function(_0x131393,_0x113489){_0x131393=_0x131393-0x0;var _0xd506fb=_0x3f43[_0x131393];return _0xd506fb;};'use strict';var _=require(_0x33f4('0x0'));var moment=require(_0x33f4('0x1'));var Redis=require(_0x33f4('0x2'));var db=require('../../mysqldb')['db'];var config=require(_0x33f4('0x3'));config[_0x33f4('0x4')]=_['defaults'](config[_0x33f4('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x33f4('0x5'))(new Redis(config['redis']));function closeInteractions(){var _0x215c09=0x0;var _0x5e1105=[];return db[_0x33f4('0x6')][_0x33f4('0x7')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x33f4('0x8')](function(_0x10cabc){_0x215c09=_0x10cabc[_0x33f4('0x9')];if(_0x215c09){return db[_0x33f4('0xa')][_0x33f4('0xb')]({'raw':!![],'attributes':['id',_0x33f4('0xc')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x33f4('0xd')](_0x10cabc[_0x33f4('0x9')],_0x33f4('0xe'))}}});}else{return[];}})['then'](function(_0x1b054e){_0x5e1105=_0x1b054e;if(_0x215c09){return db[_0x33f4('0xa')]['update']({'closeReason':_0x33f4('0xf'),'disposition':_0x33f4('0x10'),'closed':!![],'closedAt':moment()['format'](_0x33f4('0x11'))},{'where':{'id':_[_0x33f4('0x12')](_0x5e1105||[],'id')}});}})[_0x33f4('0x8')](function(_0x5b5337){for(var _0x3e0edc=0x0;_0x3e0edc<_0x5e1105[_0x33f4('0x13')];_0x3e0edc++){io[_0x33f4('0x14')]('chatInteraction:update',{'id':_0x5e1105[_0x3e0edc]['id'],'closed':!![]});}})[_0x33f4('0x15')](function(_0xaf3a14){console[_0x33f4('0x16')](_0xaf3a14);});}exports[_0x33f4('0x17')]=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 4f7b7de..6e2a208 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 _0x3708=['jobs','map','toString','keyBy','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','index','my\x20id','run\x20job','cron','active','isBetween','startAt','endAt','start','add\x20cron','update\x20cron','run','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','Smtp','service','host','MailAccount','port','secure','authentication','pass','format','\x22%s\x22\x20<%s>','name','user','bcc','Report\x20%s\x20last\x20%s\x20%s','join','savename','%s.%s','extname','zip','existsSync','status','Sent','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','attachments','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','then','error','error\x20mail','stringify','email\x20sent','catch','data','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtractUnit','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','no\x20report\x20id','Schedule','findAll','keys'];(function(_0x45346d,_0xffd56b){var _0x5ce7ca=function(_0x27ce87){while(--_0x27ce87){_0x45346d['push'](_0x45346d['shift']());}};_0x5ce7ca(++_0xffd56b);}(_0x3708,0xd1));var _0x8370=function(_0xeb0aaa,_0xfaf8a1){_0xeb0aaa=_0xeb0aaa-0x0;var _0x1ed78b=_0x3708[_0xeb0aaa];return _0x1ed78b;};'use strict';var fs=require('fs');var util=require(_0x8370('0x0'));var path=require(_0x8370('0x1'));var _=require(_0x8370('0x2'));var moment=require(_0x8370('0x3'));var CronJobManager=require(_0x8370('0x4'));var jayson=require(_0x8370('0x5'));var BPromise=require(_0x8370('0x6'));var logger=require('../logger')(_0x8370('0x7'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x8370('0x8'));var analyticDefaultReportController=require(_0x8370('0x9'));var client=jayson[_0x8370('0xa')][_0x8370('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x559ead,_0x56aa8c){return function(){logger[_0x8370('0xc')](_0x8370('0xd'),_0x559ead[_0x8370('0xe')]);var _0x5ddf00=!![];var _0x25469d={'tls':{'rejectUnauthorized':![]}};if(_0x559ead['MailAccount'][_0x8370('0xf')]['service']){_0x25469d['service']=_0x559ead['MailAccount'][_0x8370('0xf')][_0x8370('0x10')];}else{_0x25469d[_0x8370('0x11')]=_0x559ead[_0x8370('0x12')][_0x8370('0xf')][_0x8370('0x11')];_0x25469d[_0x8370('0x13')]=_0x559ead[_0x8370('0x12')]['Smtp']['port'];_0x25469d[_0x8370('0x14')]=_0x559ead[_0x8370('0x12')]['Smtp'][_0x8370('0x14')];}if(_0x559ead[_0x8370('0x12')][_0x8370('0xf')][_0x8370('0x15')]){_0x25469d['auth']={'user':_0x559ead[_0x8370('0x12')][_0x8370('0xf')]['user'],'pass':_0x559ead[_0x8370('0x12')][_0x8370('0xf')][_0x8370('0x16')]};}var _0x24998c={'account':_0x25469d,'message':{'from':util[_0x8370('0x17')](_0x8370('0x18'),_0x559ead[_0x8370('0x12')][_0x8370('0x19')],_0x559ead[_0x8370('0x12')]['email']||_0x559ead['MailAccount']['Smtp'][_0x8370('0x1a')]),'to':_0x559ead[_0x8370('0xe')],'cc':_0x559ead['cc'],'bcc':_0x559ead[_0x8370('0x1b')],'subject':util[_0x8370('0x17')](_0x8370('0x1c'),_0x56aa8c[_0x8370('0x19')],_0x559ead['subtractNumber'],_0x559ead['subtractUnit'])}};var _0x42b2f3=path[_0x8370('0x1d')](__dirname,'../../files/reports');var _0x2758c3=_0x56aa8c[_0x8370('0x1e')];var _0x4057fd=util[_0x8370('0x17')](_0x8370('0x1f'),path['basename'](_0x56aa8c[_0x8370('0x1e')],path[_0x8370('0x20')](_0x56aa8c['savename'])),_0x8370('0x21'));var _0x514c09=path[_0x8370('0x1d')](_0x42b2f3,_0x2758c3);var _0x278284=path[_0x8370('0x1d')](_0x42b2f3,_0x4057fd);if(fs[_0x8370('0x22')](_0x514c09)){_0x56aa8c[_0x8370('0x23')]=_0x8370('0x24');_0x24998c['message']['attachments']=[{'filename':_0x2758c3,'path':_0x514c09}];_0x24998c[_0x8370('0x25')][_0x8370('0x26')]=util[_0x8370('0x17')](_0x8370('0x27'),JSON['stringify'](_0x56aa8c,null,0x2));}else if(fs[_0x8370('0x22')](_0x278284)){_0x56aa8c[_0x8370('0x23')]='Sent';_0x24998c[_0x8370('0x25')][_0x8370('0x28')]=[{'filename':_0x4057fd,'path':_0x278284}];}else{_0x24998c[_0x8370('0x25')][_0x8370('0x26')]=_0x8370('0x29');if(!_0x559ead[_0x8370('0x2a')]){_0x5ddf00=![];logger[_0x8370('0xc')](_0x8370('0x2b'));}}if(_0x5ddf00){return client[_0x8370('0x2c')]('SendMail',_0x24998c)[_0x8370('0x2d')](function(_0x12083d){if(_0x12083d[_0x8370('0x2e')]){return logger[_0x8370('0x2e')](_0x8370('0x2f'),JSON[_0x8370('0x30')](_0x12083d));}return logger[_0x8370('0xc')](_0x8370('0x31'));})[_0x8370('0x32')](function(_0x11ac49){return logger[_0x8370('0x2e')]('error\x20mail',JSON[_0x8370('0x30')](_0x11ac49));});}};}function handleError(){return function(_0x13e318){return logger[_0x8370('0x2e')](JSON['stringify'](_0x13e318));};}function handleResult(_0x4e5af3){return function(_0x155f46){logger[_0x8370('0xc')](_0x8370('0x33'),JSON[_0x8370('0x30')](_0x155f46));if(_0x4e5af3[_0x8370('0x12')]&&_0x4e5af3['MailAccount'][_0x8370('0xf')]&&!_[_0x8370('0x34')](_0x4e5af3[_0x8370('0xe')])){setTimeout(handleSendEmail(_0x4e5af3,_0x155f46),0x3c*0x3e8);}};}function handleJob(_0x58016e){return function(){try{if(_[_0x8370('0x34')](_0x58016e[_0x8370('0x35')])){return logger[_0x8370('0xc')](_0x8370('0x36'));}if(_[_0x8370('0x34')](_0x58016e[_0x8370('0x37')])){return logger[_0x8370('0xc')](_0x8370('0x38'));}var _0x261374={'startDate':moment()[_0x8370('0x39')](_0x58016e[_0x8370('0x35')],_0x58016e['subtractUnit'])[_0x8370('0x17')](_0x8370('0x3a')),'endDate':moment()[_0x8370('0x17')](_0x8370('0x3a')),'type':_0x8370('0x3b'),'output':_0x58016e[_0x8370('0x3c')],'name':_0x58016e[_0x8370('0x19')]};if(!_['isNil'](_0x58016e[_0x8370('0x3d')])){logger[_0x8370('0xc')](_0x8370('0x3e'),_0x58016e[_0x8370('0x3d')]);return analyticDefaultReportController[_0x8370('0x3f')]({'id':_0x58016e[_0x8370('0x3d')]},_0x261374)[_0x8370('0x2d')](handleResult(_0x58016e))[_0x8370('0x32')](handleError());}if(!_[_0x8370('0x34')](_0x58016e[_0x8370('0x40')])){logger[_0x8370('0xc')](_0x8370('0x41'),_0x58016e[_0x8370('0x40')]);return analyticCustomReportController['runReport']({'id':_0x58016e[_0x8370('0x40')]},_0x261374)[_0x8370('0x2d')](handleResult(_0x58016e))['catch'](handleError());}}catch(_0x23102c){logger[_0x8370('0x2e')](JSON[_0x8370('0x30')](_0x23102c));}return logger['info'](_0x8370('0x42'));};}function getJobs(_0x58f53a){var _0x4cbce7={};if(_0x58f53a){_0x4cbce7['id']=_0x58f53a;}return db[_0x8370('0x43')][_0x8370('0x44')]({'where':_0x4cbce7,'include':[{'model':db[_0x8370('0x12')],'attributes':['id',_0x8370('0x19'),_0x8370('0xe')],'include':[{'model':db['MailServerOut'],'as':_0x8370('0xf')}]}]})[_0x8370('0x2d')](function(_0x3ee407){var _0x2e3c9d=_[_0x8370('0x45')](manager[_0x8370('0x46')]);var _0x5a6861=_[_0x8370('0x47')](_0x3ee407,function(_0x3f2683){return _0x3f2683['id'][_0x8370('0x48')]();});var _0x1eb825=_[_0x8370('0x49')](_0x3ee407,function(_0x7fc1e4){return _0x7fc1e4['id'][_0x8370('0x48')]();});var _0x17501a=_0x58f53a?_0x5a6861:_[_0x8370('0x4a')](_0x5a6861,_0x2e3c9d);var _0x27b34d=_[_0x8370('0x4b')](_0x5a6861,_0x2e3c9d);var _0x69d24=_[_0x8370('0x4a')](_0x2e3c9d,_0x5a6861);var _0x1815df;var _0x53fba5;for(_0x1815df=0x0;_0x1815df<_0x69d24[_0x8370('0x4c')]&&!_0x58f53a;_0x1815df+=0x1){_0x53fba5=_0x69d24[_0x1815df][_0x8370('0x48')]();if(manager[_0x8370('0x4d')](_0x53fba5)){manager[_0x8370('0x4e')](_0x53fba5);manager[_0x8370('0x4f')](_0x53fba5);logger[_0x8370('0xc')](_0x8370('0x50'),_0x53fba5);}}logger[_0x8370('0xc')]('toRun',JSON[_0x8370('0x30')](_0x17501a));for(_0x1815df=0x0;_0x1815df<_0x17501a['length'];_0x1815df+=0x1){_0x53fba5=_0x17501a[_0x1815df][_0x8370('0x48')]();logger[_0x8370('0xc')](_0x8370('0x51'),_0x53fba5);if(_0x58f53a){logger[_0x8370('0xc')](_0x8370('0x52'),_0x58f53a);logger[_0x8370('0xc')](JSON[_0x8370('0x30')](_0x1eb825[_0x53fba5]));BPromise['resolve']()[_0x8370('0x2d')](handleJob(_0x1eb825[_0x53fba5]));logger[_0x8370('0xc')](_0x8370('0x53'),_0x1eb825[_0x53fba5]['name'],_0x1eb825[_0x53fba5][_0x8370('0x54')]);}else if(_0x1eb825[_0x53fba5][_0x8370('0x54')]&&_0x1eb825[_0x53fba5][_0x8370('0x55')]&&moment()[_0x8370('0x56')](_0x1eb825[_0x53fba5][_0x8370('0x57')],_0x1eb825[_0x53fba5][_0x8370('0x58')])){manager['add'](_0x53fba5,_0x1eb825[_0x53fba5][_0x8370('0x54')],handleJob(_0x1eb825[_0x53fba5]));manager[_0x8370('0x59')](_0x53fba5);logger[_0x8370('0xc')](_0x8370('0x5a'),_0x1eb825[_0x53fba5][_0x8370('0x19')],_0x1eb825[_0x53fba5][_0x8370('0x54')]);}else if(manager[_0x8370('0x4d')](_0x53fba5)){manager[_0x8370('0x4e')](_0x53fba5);manager[_0x8370('0x4f')](_0x53fba5);logger[_0x8370('0xc')]('stop\x20cron',_0x1eb825[_0x53fba5][_0x8370('0x19')],_0x1eb825[_0x53fba5][_0x8370('0x54')]);}}for(_0x1815df=0x0,_0x53fba5;_0x1815df<_0x27b34d[_0x8370('0x4c')]&&!_0x58f53a;_0x1815df+=0x1){_0x53fba5=_0x27b34d[_0x1815df][_0x8370('0x48')]();if(manager[_0x8370('0x4d')](_0x53fba5)){if(_0x1eb825[_0x53fba5][_0x8370('0x54')]&&_0x1eb825[_0x53fba5][_0x8370('0x55')]&&moment()[_0x8370('0x56')](_0x1eb825[_0x53fba5][_0x8370('0x57')],_0x1eb825[_0x53fba5]['endAt'])){manager['update'](_0x53fba5,_0x1eb825[_0x53fba5][_0x8370('0x54')],handleJob(_0x1eb825[_0x53fba5]));logger[_0x8370('0xc')](_0x8370('0x5b'),_0x1eb825[_0x53fba5]['name'],_0x1eb825[_0x53fba5]['cron']);}else{manager['stop'](_0x53fba5);manager[_0x8370('0x4f')](_0x53fba5);logger[_0x8370('0xc')]('stop\x20cron',_0x1eb825[_0x53fba5]['name'],_0x1eb825[_0x53fba5][_0x8370('0x54')]);}}}})[_0x8370('0x32')](function(_0x393325){logger[_0x8370('0x2e')](JSON['stringify'](_0x393325));});}exports[_0x8370('0x5c')]=function(_0x3bf451){return getJobs(_0x3bf451);};exports[_0x8370('0x59')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x0d93=['update\x20cron','stop\x20cron','run','start','util','path','lodash','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email','service','MailAccount','Smtp','host','port','secure','user','format','\x22%s\x22\x20<%s>','name','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','../../files/reports','savename','%s.%s','basename','extname','zip','join','existsSync','status','Sent','message','attachments','stringify','text','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','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','subtractNumber','YYYY-MM-DD\x20HH:mm:ss','scheduled','exec\x20defaul\x20report\x20id:%s','runReport','DefaultReportId','CustomReportId','exec\x20custom\x20report\x20id:%s','Schedule','findAll','MailServerOut','keys','jobs','map','keyBy','toString','difference','intersection','exists','stop','deleteJob','toRun','length','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','add','endAt'];(function(_0x1e03e4,_0x362f76){var _0x4a887e=function(_0x13f548){while(--_0x13f548){_0x1e03e4['push'](_0x1e03e4['shift']());}};_0x4a887e(++_0x362f76);}(_0x0d93,0x118));var _0x30d9=function(_0x4c4037,_0x15054b){_0x4c4037=_0x4c4037-0x0;var _0x357862=_0x0d93[_0x4c4037];return _0x357862;};'use strict';var fs=require('fs');var util=require(_0x30d9('0x0'));var path=require(_0x30d9('0x1'));var _=require(_0x30d9('0x2'));var moment=require('moment');var CronJobManager=require('cron-job-manager');var jayson=require(_0x30d9('0x3'));var BPromise=require(_0x30d9('0x4'));var logger=require(_0x30d9('0x5'))(_0x30d9('0x6'));var db=require(_0x30d9('0x7'))['db'];var analyticCustomReportController=require(_0x30d9('0x8'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x30d9('0x9')][_0x30d9('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x1db818,_0xcdbe29){return function(){logger['info'](_0x30d9('0xb'),_0x1db818[_0x30d9('0xc')]);var _0x41c12d=!![];var _0x5d07e6={'tls':{'rejectUnauthorized':![]}};if(_0x1db818['MailAccount']['Smtp'][_0x30d9('0xd')]){_0x5d07e6[_0x30d9('0xd')]=_0x1db818[_0x30d9('0xe')][_0x30d9('0xf')][_0x30d9('0xd')];}else{_0x5d07e6[_0x30d9('0x10')]=_0x1db818['MailAccount'][_0x30d9('0xf')][_0x30d9('0x10')];_0x5d07e6[_0x30d9('0x11')]=_0x1db818[_0x30d9('0xe')][_0x30d9('0xf')][_0x30d9('0x11')];_0x5d07e6[_0x30d9('0x12')]=_0x1db818[_0x30d9('0xe')][_0x30d9('0xf')]['secure'];}if(_0x1db818[_0x30d9('0xe')][_0x30d9('0xf')]['authentication']){_0x5d07e6['auth']={'user':_0x1db818[_0x30d9('0xe')][_0x30d9('0xf')][_0x30d9('0x13')],'pass':_0x1db818[_0x30d9('0xe')][_0x30d9('0xf')]['pass']};}var _0x5ad81e={'account':_0x5d07e6,'message':{'from':util[_0x30d9('0x14')](_0x30d9('0x15'),_0x1db818[_0x30d9('0xe')][_0x30d9('0x16')],_0x1db818['MailAccount'][_0x30d9('0xc')]||_0x1db818[_0x30d9('0xe')][_0x30d9('0xf')][_0x30d9('0x13')]),'to':_0x1db818['email'],'cc':_0x1db818['cc'],'bcc':_0x1db818[_0x30d9('0x17')],'subject':util[_0x30d9('0x14')](_0x30d9('0x18'),_0xcdbe29[_0x30d9('0x16')],_0x1db818['subtractNumber'],_0x1db818[_0x30d9('0x19')])}};var _0x398a8f=path['join'](__dirname,_0x30d9('0x1a'));var _0x457b69=_0xcdbe29[_0x30d9('0x1b')];var _0x2399e9=util['format'](_0x30d9('0x1c'),path[_0x30d9('0x1d')](_0xcdbe29[_0x30d9('0x1b')],path[_0x30d9('0x1e')](_0xcdbe29[_0x30d9('0x1b')])),_0x30d9('0x1f'));var _0x2e7efb=path[_0x30d9('0x20')](_0x398a8f,_0x457b69);var _0x12ff57=path[_0x30d9('0x20')](_0x398a8f,_0x2399e9);if(fs[_0x30d9('0x21')](_0x2e7efb)){_0xcdbe29[_0x30d9('0x22')]=_0x30d9('0x23');_0x5ad81e[_0x30d9('0x24')][_0x30d9('0x25')]=[{'filename':_0x457b69,'path':_0x2e7efb}];_0x5ad81e['message']['text']=util[_0x30d9('0x14')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0x30d9('0x26')](_0xcdbe29,null,0x2));}else if(fs[_0x30d9('0x21')](_0x12ff57)){_0xcdbe29[_0x30d9('0x22')]=_0x30d9('0x23');_0x5ad81e[_0x30d9('0x24')]['attachments']=[{'filename':_0x2399e9,'path':_0x12ff57}];}else{_0x5ad81e[_0x30d9('0x24')][_0x30d9('0x27')]=_0x30d9('0x28');if(!_0x1db818['sendIfEmpty']){_0x41c12d=![];logger[_0x30d9('0x29')](_0x30d9('0x2a'));}}if(_0x41c12d){return client[_0x30d9('0x2b')](_0x30d9('0x2c'),_0x5ad81e)[_0x30d9('0x2d')](function(_0x4d0dc2){if(_0x4d0dc2[_0x30d9('0x2e')]){return logger['error'](_0x30d9('0x2f'),JSON[_0x30d9('0x26')](_0x4d0dc2));}return logger['info'](_0x30d9('0x30'));})[_0x30d9('0x31')](function(_0x1f3026){return logger[_0x30d9('0x2e')]('error\x20mail',JSON[_0x30d9('0x26')](_0x1f3026));});}};}function handleError(){return function(_0x4ee757){return logger[_0x30d9('0x2e')](JSON[_0x30d9('0x26')](_0x4ee757));};}function handleResult(_0x12c662){return function(_0x323f58){logger[_0x30d9('0x29')](_0x30d9('0x32'),JSON[_0x30d9('0x26')](_0x323f58));if(_0x12c662[_0x30d9('0xe')]&&_0x12c662[_0x30d9('0xe')][_0x30d9('0xf')]&&!_[_0x30d9('0x33')](_0x12c662[_0x30d9('0xc')])){setTimeout(handleSendEmail(_0x12c662,_0x323f58),0x3c*0x3e8);}};}function handleJob(_0x163998){return function(){try{if(_['isNil'](_0x163998['subtractNumber'])){return logger['info'](_0x30d9('0x34'));}if(_[_0x30d9('0x33')](_0x163998['subtractUnit'])){return logger['info'](_0x30d9('0x35'));}var _0x331d64={'startDate':moment()[_0x30d9('0x36')](_0x163998[_0x30d9('0x37')],_0x163998[_0x30d9('0x19')])['format'](_0x30d9('0x38')),'endDate':moment()[_0x30d9('0x14')](_0x30d9('0x38')),'type':_0x30d9('0x39'),'output':_0x163998['output'],'name':_0x163998[_0x30d9('0x16')]};if(!_[_0x30d9('0x33')](_0x163998['DefaultReportId'])){logger['info'](_0x30d9('0x3a'),_0x163998['DefaultReportId']);return analyticDefaultReportController[_0x30d9('0x3b')]({'id':_0x163998[_0x30d9('0x3c')]},_0x331d64)[_0x30d9('0x2d')](handleResult(_0x163998))[_0x30d9('0x31')](handleError());}if(!_[_0x30d9('0x33')](_0x163998[_0x30d9('0x3d')])){logger[_0x30d9('0x29')](_0x30d9('0x3e'),_0x163998['CustomReportId']);return analyticCustomReportController[_0x30d9('0x3b')]({'id':_0x163998[_0x30d9('0x3d')]},_0x331d64)[_0x30d9('0x2d')](handleResult(_0x163998))[_0x30d9('0x31')](handleError());}}catch(_0x5a9344){logger[_0x30d9('0x2e')](JSON[_0x30d9('0x26')](_0x5a9344));}return logger[_0x30d9('0x29')]('no\x20report\x20id');};}function getJobs(_0xad45a2){var _0x166d1e={};if(_0xad45a2){_0x166d1e['id']=_0xad45a2;}return db[_0x30d9('0x3f')][_0x30d9('0x40')]({'where':_0x166d1e,'include':[{'model':db[_0x30d9('0xe')],'attributes':['id',_0x30d9('0x16'),'email'],'include':[{'model':db[_0x30d9('0x41')],'as':'Smtp'}]}]})['then'](function(_0x5c2aeb){var _0x281727=_[_0x30d9('0x42')](manager[_0x30d9('0x43')]);var _0x587174=_[_0x30d9('0x44')](_0x5c2aeb,function(_0x31acec){return _0x31acec['id']['toString']();});var _0x5de2d2=_[_0x30d9('0x45')](_0x5c2aeb,function(_0x5eccd3){return _0x5eccd3['id'][_0x30d9('0x46')]();});var _0x2301e7=_0xad45a2?_0x587174:_[_0x30d9('0x47')](_0x587174,_0x281727);var _0x24acc8=_[_0x30d9('0x48')](_0x587174,_0x281727);var _0x51ea0e=_['difference'](_0x281727,_0x587174);var _0xc22807;var _0x575dde;for(_0xc22807=0x0;_0xc22807<_0x51ea0e['length']&&!_0xad45a2;_0xc22807+=0x1){_0x575dde=_0x51ea0e[_0xc22807][_0x30d9('0x46')]();if(manager[_0x30d9('0x49')](_0x575dde)){manager[_0x30d9('0x4a')](_0x575dde);manager[_0x30d9('0x4b')](_0x575dde);logger[_0x30d9('0x29')]('delete\x20cron',_0x575dde);}}logger[_0x30d9('0x29')](_0x30d9('0x4c'),JSON['stringify'](_0x2301e7));for(_0xc22807=0x0;_0xc22807<_0x2301e7[_0x30d9('0x4d')];_0xc22807+=0x1){_0x575dde=_0x2301e7[_0xc22807][_0x30d9('0x46')]();logger[_0x30d9('0x29')](_0x30d9('0x4e'),_0x575dde);if(_0xad45a2){logger['info'](_0x30d9('0x4f'),_0xad45a2);logger[_0x30d9('0x29')](JSON[_0x30d9('0x26')](_0x5de2d2[_0x575dde]));BPromise[_0x30d9('0x50')]()[_0x30d9('0x2d')](handleJob(_0x5de2d2[_0x575dde]));logger[_0x30d9('0x29')](_0x30d9('0x51'),_0x5de2d2[_0x575dde][_0x30d9('0x16')],_0x5de2d2[_0x575dde]['cron']);}else if(_0x5de2d2[_0x575dde][_0x30d9('0x52')]&&_0x5de2d2[_0x575dde][_0x30d9('0x53')]&&moment()[_0x30d9('0x54')](_0x5de2d2[_0x575dde][_0x30d9('0x55')],_0x5de2d2[_0x575dde]['endAt'])){manager[_0x30d9('0x56')](_0x575dde,_0x5de2d2[_0x575dde][_0x30d9('0x52')],handleJob(_0x5de2d2[_0x575dde]));manager['start'](_0x575dde);logger[_0x30d9('0x29')]('add\x20cron',_0x5de2d2[_0x575dde][_0x30d9('0x16')],_0x5de2d2[_0x575dde][_0x30d9('0x52')]);}else if(manager[_0x30d9('0x49')](_0x575dde)){manager['stop'](_0x575dde);manager[_0x30d9('0x4b')](_0x575dde);logger[_0x30d9('0x29')]('stop\x20cron',_0x5de2d2[_0x575dde]['name'],_0x5de2d2[_0x575dde][_0x30d9('0x52')]);}}for(_0xc22807=0x0,_0x575dde;_0xc22807<_0x24acc8[_0x30d9('0x4d')]&&!_0xad45a2;_0xc22807+=0x1){_0x575dde=_0x24acc8[_0xc22807][_0x30d9('0x46')]();if(manager['exists'](_0x575dde)){if(_0x5de2d2[_0x575dde]['cron']&&_0x5de2d2[_0x575dde]['active']&&moment()[_0x30d9('0x54')](_0x5de2d2[_0x575dde][_0x30d9('0x55')],_0x5de2d2[_0x575dde][_0x30d9('0x57')])){manager['update'](_0x575dde,_0x5de2d2[_0x575dde][_0x30d9('0x52')],handleJob(_0x5de2d2[_0x575dde]));logger['info'](_0x30d9('0x58'),_0x5de2d2[_0x575dde][_0x30d9('0x16')],_0x5de2d2[_0x575dde][_0x30d9('0x52')]);}else{manager[_0x30d9('0x4a')](_0x575dde);manager[_0x30d9('0x4b')](_0x575dde);logger[_0x30d9('0x29')](_0x30d9('0x59'),_0x5de2d2[_0x575dde]['name'],_0x5de2d2[_0x575dde][_0x30d9('0x52')]);}}}})['catch'](function(_0x2cacae){logger[_0x30d9('0x2e')](JSON[_0x30d9('0x26')](_0x2cacae));});}exports[_0x30d9('0x5a')]=function(_0x3a15e4){return getJobs(_0x3a15e4);};exports[_0x30d9('0x5b')]=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 d52b13d..54d7c2b 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0766=['CmHopper','bulkCreate','finished\x20populating','hopper1','contacts2','hopper2','catch','push','Innocenzo','innocenzo.biondo','@xcally.com','now','Biondo','CmContact','destroy','then','log'];(function(_0x5cf7dc,_0x556c22){var _0x18fe27=function(_0x1ef580){while(--_0x1ef580){_0x5cf7dc['push'](_0x5cf7dc['shift']());}};_0x18fe27(++_0x556c22);}(_0x0766,0xa0));var _0x6076=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0766[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x6076('0x0')]({'id':i,'firstName':_0x6076('0x1')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x6076('0x2')+i+_0x6076('0x3')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x6076('0x0')]({'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[_0x6076('0x4')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x6076('0x0')]({'id':i,'firstName':_0x6076('0x1')+i,'lastName':_0x6076('0x5')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x6076('0x3')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x6076('0x0')]({'id':i,'active':![],'scheduledat':Date[_0x6076('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x6076('0x4')](),'updatedAt':Date['now']()});}db[_0x6076('0x6')][_0x6076('0x7')]({'where':{}})['then'](function(){return db[_0x6076('0x6')]['bulkCreate'](contacts);})[_0x6076('0x8')](function(){console[_0x6076('0x9')]('finished\x20populating','contacts1');return db[_0x6076('0xa')][_0x6076('0x7')]({'where':{}});})[_0x6076('0x8')](function(){return db[_0x6076('0xa')][_0x6076('0xb')](hopper);})['then'](function(){console[_0x6076('0x9')](_0x6076('0xc'),_0x6076('0xd'));return db['CmContact'][_0x6076('0xb')](contacts2);})[_0x6076('0x8')](function(){console['log'](_0x6076('0xc'),_0x6076('0xe'));return db[_0x6076('0xa')][_0x6076('0xb')](hopper2);})['then'](function(){console[_0x6076('0x9')]('finished\x20populating',_0x6076('0xf'));})[_0x6076('0x10')](function(_0x1b3e51){console[_0x6076('0x9')](_0x1b3e51);}); \ No newline at end of file +var _0x62b3=['log','finished\x20populating','contacts1','CmHopper','hopper1','hopper2','catch','util','push','Innocenzo','Biondo','@xcally.com','now','innocenzo.biondo','destroy','then','CmContact','bulkCreate'];(function(_0x4c9b84,_0x4b2bf0){var _0x391c1b=function(_0x212834){while(--_0x212834){_0x4c9b84['push'](_0x4c9b84['shift']());}};_0x391c1b(++_0x4b2bf0);}(_0x62b3,0xdf));var _0x362b=function(_0x5e11d5,_0x4d0583){_0x5e11d5=_0x5e11d5-0x0;var _0x3d611e=_0x62b3[_0x5e11d5];return _0x3d611e;};'use strict';var util=require(_0x362b('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x362b('0x1')]({'id':i,'firstName':_0x362b('0x2')+i,'lastName':_0x362b('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x362b('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x362b('0x1')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x362b('0x5')](),'updatedAt':Date[_0x362b('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x362b('0x1')]({'id':i,'firstName':'Innocenzo'+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x362b('0x6')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x362b('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x362b('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x362b('0x5')](),'updatedAt':Date[_0x362b('0x5')]()});}db['CmContact'][_0x362b('0x7')]({'where':{}})[_0x362b('0x8')](function(){return db[_0x362b('0x9')][_0x362b('0xa')](contacts);})[_0x362b('0x8')](function(){console[_0x362b('0xb')](_0x362b('0xc'),_0x362b('0xd'));return db[_0x362b('0xe')][_0x362b('0x7')]({'where':{}});})[_0x362b('0x8')](function(){return db[_0x362b('0xe')][_0x362b('0xa')](hopper);})['then'](function(){console[_0x362b('0xb')](_0x362b('0xc'),_0x362b('0xf'));return db[_0x362b('0x9')]['bulkCreate'](contacts2);})[_0x362b('0x8')](function(){console[_0x362b('0xb')](_0x362b('0xc'),'contacts2');return db[_0x362b('0xe')][_0x362b('0xa')](hopper2);})[_0x362b('0x8')](function(){console[_0x362b('0xb')](_0x362b('0xc'),_0x362b('0x10'));})[_0x362b('0x11')](function(_0xfc438d){console[_0x362b('0xb')](_0xfc438d);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index f2b8d8a..a65b43a 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcae1=['udp','wss','all','yes','/etc/pki/tls/private/motion.key','actpass','User','bulkCreate','log','add\x20user','catch','util','push','format','%s%s','agent','%s%s@xcally.com','password','friend'];(function(_0x3c42cd,_0x5b4018){var _0x21a9b9=function(_0x2aa0b9){while(--_0x2aa0b9){_0x3c42cd['push'](_0x3c42cd['shift']());}};_0x21a9b9(++_0x5b4018);}(_0xcae1,0x1c0));var _0x1cae=function(_0x44b827,_0x1bb1aa){_0x44b827=_0x44b827-0x0;var _0x527342=_0xcae1[_0x44b827];return _0x527342;};'use strict';var util=require(_0x1cae('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x1cae('0x1')]({'name':util[_0x1cae('0x2')](_0x1cae('0x3'),_0x1cae('0x4'),i),'fullname':util['format'](_0x1cae('0x3'),_0x1cae('0x4'),i),'email':util[_0x1cae('0x2')](_0x1cae('0x5'),_0x1cae('0x4'),i),'role':'agent','password':_0x1cae('0x6'),'internal':0xfa0+i,'type':_0x1cae('0x7'),'transport':[_0x1cae('0x8'),'ws',_0x1cae('0x9')],'disallow':[_0x1cae('0xa')],'allow':['ulaw'],'defaultuser':util[_0x1cae('0x2')](_0x1cae('0x3'),'agent',i),'encryption':_0x1cae('0xb'),'avpf':_0x1cae('0xb'),'force_avp':_0x1cae('0xb'),'icesupport':_0x1cae('0xb'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x1cae('0xc'),'dtlssetup':_0x1cae('0xd'),'callerid':util[_0x1cae('0x2')]('\x22%s\x22\x20<%s>',util[_0x1cae('0x2')](_0x1cae('0x3'),_0x1cae('0x4'),i),0xfa0+i)});}db[_0x1cae('0xe')][_0x1cae('0xf')](users)['then'](function(){console[_0x1cae('0x10')](_0x1cae('0x11'));})[_0x1cae('0x12')](function(_0x2c8c25){console['log'](_0x2c8c25);}); \ No newline at end of file +var _0xbdc7=['/etc/pki/tls/private/motion.key','actpass','User','then','log','add\x20user','catch','util','%s%s','format','agent','friend','wss','all','yes','/etc/pki/tls/certs/motion.crt'];(function(_0x28ee8e,_0x82a820){var _0x2296d2=function(_0x4f0fbf){while(--_0x4f0fbf){_0x28ee8e['push'](_0x28ee8e['shift']());}};_0x2296d2(++_0x82a820);}(_0xbdc7,0x87));var _0x7bdc=function(_0x4ab948,_0xd78043){_0x4ab948=_0x4ab948-0x0;var _0x2af2f6=_0xbdc7[_0x4ab948];return _0x2af2f6;};'use strict';var util=require(_0x7bdc('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util['format'](_0x7bdc('0x1'),'agent',i),'fullname':util[_0x7bdc('0x2')](_0x7bdc('0x1'),_0x7bdc('0x3'),i),'email':util[_0x7bdc('0x2')]('%s%s@xcally.com',_0x7bdc('0x3'),i),'role':_0x7bdc('0x3'),'password':'password','internal':0xfa0+i,'type':_0x7bdc('0x4'),'transport':['udp','ws',_0x7bdc('0x5')],'disallow':[_0x7bdc('0x6')],'allow':['ulaw'],'defaultuser':util[_0x7bdc('0x2')](_0x7bdc('0x1'),_0x7bdc('0x3'),i),'encryption':'yes','avpf':'yes','force_avp':_0x7bdc('0x7'),'icesupport':_0x7bdc('0x7'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0x7bdc('0x8'),'dtlsprivatekey':_0x7bdc('0x9'),'dtlssetup':_0x7bdc('0xa'),'callerid':util[_0x7bdc('0x2')]('\x22%s\x22\x20<%s>',util['format'](_0x7bdc('0x1'),_0x7bdc('0x3'),i),0xfa0+i)});}db[_0x7bdc('0xb')]['bulkCreate'](users)[_0x7bdc('0xc')](function(){console[_0x7bdc('0xd')](_0x7bdc('0xe'));})[_0x7bdc('0xf')](function(_0x41f1c4){console[_0x7bdc('0xd')](_0x41f1c4);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index d80d6cc..3aff81b 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa472=['user','OpenchannelQueues','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','all','length','voice','chat','fax','sms','mail','openchannel','telephone:%s','trunk:%s','ChatInteractions','removeChatInteractions','emit','leave','MailInteractions','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','catch','log','default','connection','setMaxListeners','address','request','remoteAddress','connectedAt','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','Agents','User','name','role','agent','telephone','type','ivr','UserProfileSection','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','then','map','where','Campaign','%s:queue:%s','format','query','find','userProfileId','handshake','ChatInteraction','MailInteraction','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','user:%s','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk'];(function(_0x55677b,_0x3e5655){var _0x104b88=function(_0x78d34f){while(--_0x78d34f){_0x55677b['push'](_0x55677b['shift']());}};_0x104b88(++_0x3e5655);}(_0xa472,0x1b6));var _0x2a47=function(_0xf9e877,_0x2bcf9e){_0xf9e877=_0xf9e877-0x0;var _0x4c720e=_0xa472[_0xf9e877];return _0x4c720e;};'use strict';var _=require(_0x2a47('0x0'));var util=require(_0x2a47('0x1'));var BPromise=require(_0x2a47('0x2'));var db=require(_0x2a47('0x3'))['db'];var config=require(_0x2a47('0x4'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0x2a47('0x5'),'model':db[_0x2a47('0x6')],'attributes':['id',_0x2a47('0x7'),_0x2a47('0x8')],'raw':!![],'where':{'role':_0x2a47('0x9')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x2a47('0x7')],'where':{'role':_0x2a47('0xa')}};var queryTrunks={'raw':!![],'attributes':['id',_0x2a47('0x7')]};var queryAgents={'raw':!![],'attributes':['id',_0x2a47('0x7')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x2a47('0x7'),_0x2a47('0xb')],'where':{'type':_0x2a47('0xc')}};function getAssociatedResources(_0x228a64,_0x1f2a0b,_0x79af4d){return db[_0x2a47('0xd')]['findOne']({'where':{'name':_0x228a64,'userProfileId':_0x1f2a0b},'raw':!![]})['then'](function(_0x3678c2){if(_0x3678c2){if(_0x3678c2[_0x2a47('0xe')]){switch(_0x228a64){case _0x2a47('0xf'):case _0x2a47('0x10'):case _0x2a47('0x11'):case _0x2a47('0x12'):case _0x2a47('0x13'):case'OpenchannelQueues':return db[_0x79af4d][_0x2a47('0x14')](queryQueues);case _0x2a47('0x15'):return db[_0x79af4d][_0x2a47('0x14')](queryTelephones);case _0x2a47('0x16'):return db[_0x79af4d][_0x2a47('0x14')](queryTrunks);case _0x2a47('0x17'):return db[_0x79af4d][_0x2a47('0x14')](queryCampaigns);}}else{return db[_0x2a47('0x18')][_0x2a47('0x14')]({'attributes':[_0x2a47('0x19')],'where':{'sectionId':_0x3678c2['id']},'raw':!![]})[_0x2a47('0x1a')](function(_0x2c4d10){if(_0x2c4d10){var _0x4d3a3d={'where':{'id':_[_0x2a47('0x1b')](_0x2c4d10,_0x2a47('0x19'))},'raw':!![]};switch(_0x79af4d){case _0x2a47('0x6'):_0x4d3a3d[_0x2a47('0x1c')][_0x2a47('0x8')]='telephone';break;case _0x2a47('0x1d'):_0x4d3a3d[_0x2a47('0x1c')][_0x2a47('0xb')]=_0x2a47('0xc');break;}return db[_0x79af4d]['findAll'](_0x4d3a3d);}else{return[];}});}}else{return[];}})[_0x2a47('0x1a')](function(_0x35cf39){return _0x35cf39;});}function joinOrLeaveQueues(_0x5a90f0,_0x706248,_0x5cd47b,_0x5cd8a2){_0x5a90f0[_0x706248](util['format'](_0x2a47('0x1e'),_0x5cd47b,_0x5cd8a2[_0x2a47('0x7')]));if(_0x5cd8a2[_0x2a47('0x5')]){for(var _0x586703=0x0;_0x586703<_0x5cd8a2[_0x2a47('0x5')]['length'];_0x586703+=0x1){_0x5a90f0[_0x706248](util[_0x2a47('0x1f')]('user:%s',_0x5cd8a2['Agents'][_0x586703]['name']));}}}function joinOrLeave(_0xb841c7,_0x193f02,_0x594ac5){var _0x32d462;if(_0xb841c7['handshake'][_0x2a47('0x20')]['id']){db[_0x2a47('0x6')][_0x2a47('0x21')]({'attributes':['id',_0x2a47('0x7'),'role',_0x2a47('0x22')],'where':{'id':_0xb841c7[_0x2a47('0x23')][_0x2a47('0x20')]['id']},'include':[{'model':db[_0x2a47('0x24')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x2a47('0x25')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x2a47('0x26')],'as':_0x2a47('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x2a47('0x28')],'as':_0x2a47('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x2a47('0x2a')],'as':_0x2a47('0x2b'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x3af51b){if(_0x3af51b){_0x32d462=_0x3af51b;_0xb841c7[_0x193f02](util[_0x2a47('0x1f')](_0x2a47('0x2c'),_0x3af51b[_0x2a47('0x7')]));var _0x2e9d6e=[];switch(_0x3af51b[_0x2a47('0x8')]){case _0x2a47('0x2d'):_0xb841c7[_0x193f02](_0x2a47('0x2e'));_0xb841c7[_0x193f02](_0x2a47('0x2f'));if(queryQueues[_0x2a47('0x30')]('include')){delete queryQueues[_0x2a47('0x31')];}_0x2e9d6e[_0x2a47('0x32')](db[_0x2a47('0x33')][_0x2a47('0x14')](queryQueues));_0x2e9d6e[_0x2a47('0x32')](db['ChatQueue']['findAll'](queryQueues));_0x2e9d6e[_0x2a47('0x32')](db[_0x2a47('0x34')][_0x2a47('0x14')](queryQueues));_0x2e9d6e[_0x2a47('0x32')](db[_0x2a47('0x35')][_0x2a47('0x14')](queryQueues));_0x2e9d6e[_0x2a47('0x32')](db[_0x2a47('0x36')][_0x2a47('0x14')](queryQueues));_0x2e9d6e['push'](db[_0x2a47('0x37')]['findAll'](queryQueues));_0x2e9d6e[_0x2a47('0x32')](db[_0x2a47('0x6')][_0x2a47('0x14')](queryTelephones));_0x2e9d6e[_0x2a47('0x32')](db[_0x2a47('0x38')][_0x2a47('0x14')](queryTrunks));_0x2e9d6e[_0x2a47('0x32')](db[_0x2a47('0x1d')][_0x2a47('0x14')](queryCampaigns));_0x2e9d6e[_0x2a47('0x32')](db['User'][_0x2a47('0x14')](queryAgents));break;case _0x2a47('0x39'):_0xb841c7[_0x193f02](_0x2a47('0x2e'));_0xb841c7[_0x193f02](_0x2a47('0x2f'));_0x2e9d6e[_0x2a47('0x32')](getAssociatedResources(_0x2a47('0xf'),_0x3af51b[_0x2a47('0x22')],_0x2a47('0x33')));_0x2e9d6e[_0x2a47('0x32')](getAssociatedResources(_0x2a47('0x10'),_0x3af51b['userProfileId'],'ChatQueue'));_0x2e9d6e[_0x2a47('0x32')](getAssociatedResources('FaxQueues',_0x3af51b[_0x2a47('0x22')],_0x2a47('0x34')));_0x2e9d6e['push'](getAssociatedResources('SmsQueues',_0x3af51b['userProfileId'],_0x2a47('0x35')));_0x2e9d6e[_0x2a47('0x32')](getAssociatedResources(_0x2a47('0x13'),_0x3af51b[_0x2a47('0x22')],'MailQueue'));_0x2e9d6e[_0x2a47('0x32')](getAssociatedResources(_0x2a47('0x3a'),_0x3af51b[_0x2a47('0x22')],_0x2a47('0x37')));_0x2e9d6e[_0x2a47('0x32')](getAssociatedResources(_0x2a47('0x15'),_0x3af51b['userProfileId'],_0x2a47('0x6')));_0x2e9d6e['push'](getAssociatedResources(_0x2a47('0x16'),_0x3af51b[_0x2a47('0x22')],_0x2a47('0x38')));_0x2e9d6e['push'](getAssociatedResources(_0x2a47('0x17'),_0x3af51b['userProfileId'],'Campaign'));_0x2e9d6e[_0x2a47('0x32')](db[_0x2a47('0x6')][_0x2a47('0x14')](queryAgents));break;case'agent':_0xb841c7[_0x193f02](_0x2a47('0x2e'));_0xb841c7[_0x193f02](_0x2a47('0x2f'));_0x2e9d6e[_0x2a47('0x32')](_0x3af51b[_0x2a47('0x3b')]({'attributes':['id','name']}));_0x2e9d6e[_0x2a47('0x32')](_0x3af51b[_0x2a47('0x3c')]({'attributes':['id',_0x2a47('0x7')]}));_0x2e9d6e[_0x2a47('0x32')](_0x3af51b[_0x2a47('0x3d')]({'attributes':['id',_0x2a47('0x7')]}));_0x2e9d6e[_0x2a47('0x32')](_0x3af51b[_0x2a47('0x3e')]({'attributes':['id',_0x2a47('0x7')]}));_0x2e9d6e['push'](_0x3af51b[_0x2a47('0x3f')]({'attributes':['id',_0x2a47('0x7')]}));_0x2e9d6e[_0x2a47('0x32')](_0x3af51b['getOpenchannelQueues']({'attributes':['id','name']}));break;}return BPromise[_0x2a47('0x40')](_0x2e9d6e);}})[_0x2a47('0x1a')](function(_0x38af74){if(_0x38af74&&_0x38af74['length']){for(var _0x56fa6e=0x0;_0x56fa6e<_0x38af74[_0x2a47('0x41')];_0x56fa6e+=0x1){for(var _0x53b373=0x0;_0x53b373<_0x38af74[_0x56fa6e][_0x2a47('0x41')];_0x53b373+=0x1){switch(_0x56fa6e){case 0x0:joinOrLeaveQueues(_0xb841c7,_0x193f02,_0x2a47('0x42'),_0x38af74[_0x56fa6e][_0x53b373]);break;case 0x1:joinOrLeaveQueues(_0xb841c7,_0x193f02,_0x2a47('0x43'),_0x38af74[_0x56fa6e][_0x53b373]);break;case 0x2:joinOrLeaveQueues(_0xb841c7,_0x193f02,_0x2a47('0x44'),_0x38af74[_0x56fa6e][_0x53b373]);break;case 0x3:joinOrLeaveQueues(_0xb841c7,_0x193f02,_0x2a47('0x45'),_0x38af74[_0x56fa6e][_0x53b373]);break;case 0x4:joinOrLeaveQueues(_0xb841c7,_0x193f02,_0x2a47('0x46'),_0x38af74[_0x56fa6e][_0x53b373]);break;case 0x5:joinOrLeaveQueues(_0xb841c7,_0x193f02,_0x2a47('0x47'),_0x38af74[_0x56fa6e][_0x53b373]);break;case 0x6:_0xb841c7[_0x193f02](util[_0x2a47('0x1f')](_0x2a47('0x48'),_0x38af74[_0x56fa6e][_0x53b373][_0x2a47('0x7')]));break;case 0x7:_0xb841c7[_0x193f02](util[_0x2a47('0x1f')](_0x2a47('0x49'),_0x38af74[_0x56fa6e][_0x53b373][_0x2a47('0x7')]));break;case 0x8:_0xb841c7[_0x193f02](util[_0x2a47('0x1f')]('campaign:%s:%s',_0x38af74[_0x56fa6e][_0x53b373][_0x2a47('0xb')],_0x38af74[_0x56fa6e][_0x53b373][_0x2a47('0x7')]));break;case 0x9:_0xb841c7[_0x193f02](util[_0x2a47('0x1f')](_0x2a47('0x2c'),_0x38af74[_0x56fa6e][_0x53b373][_0x2a47('0x7')]));break;}}}}})[_0x2a47('0x1a')](function(){if(_0x193f02==='leave'){var _0x51b55d=_[_0x2a47('0x1b')](_0x32d462[_0x2a47('0x4a')],'id');return _0x32d462[_0x2a47('0x4b')](_0x51b55d)[_0x2a47('0x1a')](function(){for(var _0x3e2a4f=0x0;_0x3e2a4f<_0x51b55d[_0x2a47('0x41')];_0x3e2a4f+=0x1){_0x594ac5[_0x2a47('0x4c')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x51b55d[_0x3e2a4f]),'UserId':Number(_0x32d462['id'])});}});}})[_0x2a47('0x1a')](function(){if(_0x193f02===_0x2a47('0x4d')){var _0x55c6a0=_[_0x2a47('0x1b')](_0x32d462[_0x2a47('0x4e')],'id');return _0x32d462[_0x2a47('0x4f')](_0x55c6a0)[_0x2a47('0x1a')](function(){for(var _0x13e2cb=0x0;_0x13e2cb<_0x55c6a0['length'];_0x13e2cb+=0x1){_0x594ac5['emit'](_0x2a47('0x50'),{'MailInteractionId':Number(_0x55c6a0[_0x13e2cb]),'UserId':Number(_0x32d462['id'])});}});}})[_0x2a47('0x1a')](function(){if(_0x193f02==='leave'){var _0x18ac88=_[_0x2a47('0x1b')](_0x32d462[_0x2a47('0x27')],'id');return _0x32d462[_0x2a47('0x51')](_0x18ac88)[_0x2a47('0x1a')](function(){for(var _0x22ff95=0x0;_0x22ff95<_0x18ac88[_0x2a47('0x41')];_0x22ff95+=0x1){_0x594ac5[_0x2a47('0x4c')](_0x2a47('0x52'),{'FaxInteractionId':Number(_0x18ac88[_0x22ff95]),'UserId':Number(_0x32d462['id'])});}});}})[_0x2a47('0x1a')](function(){if(_0x193f02===_0x2a47('0x4d')){var _0x556466=_['map'](_0x32d462['SmsInteractions'],'id');return _0x32d462['removeSmsInteractions'](_0x556466)[_0x2a47('0x1a')](function(){for(var _0x20ed8d=0x0;_0x20ed8d<_0x556466[_0x2a47('0x41')];_0x20ed8d+=0x1){_0x594ac5[_0x2a47('0x4c')](_0x2a47('0x53'),{'SmsInteractionId':Number(_0x556466[_0x20ed8d]),'UserId':Number(_0x32d462['id'])});}});}})[_0x2a47('0x1a')](function(){if(_0x193f02===_0x2a47('0x4d')){var _0x199aed=_[_0x2a47('0x1b')](_0x32d462[_0x2a47('0x2b')],'id');return _0x32d462[_0x2a47('0x54')](_0x199aed)[_0x2a47('0x1a')](function(){for(var _0x518f7e=0x0;_0x518f7e<_0x199aed[_0x2a47('0x41')];_0x518f7e+=0x1){_0x594ac5[_0x2a47('0x4c')](_0x2a47('0x55'),{'OpenchannelInteractionId':Number(_0x199aed[_0x518f7e]),'UserId':Number(_0x32d462['id'])});}});}})[_0x2a47('0x56')](function(_0x521406){_0xb841c7[_0x2a47('0x57')](_0x521406);});}}function onDisconnect(_0x45e6c2,_0x5847a8){joinOrLeave(_0x45e6c2,'leave',_0x5847a8);}function onConnect(_0x1e2063){joinOrLeave(_0x1e2063,'join');}exports[_0x2a47('0x58')]=function(_0x3f1e23){_0x3f1e23['on'](_0x2a47('0x59'),function(_0x5f43ee){_0x5f43ee[_0x2a47('0x5a')](0x0);_0x5f43ee[_0x2a47('0x5b')]=_0x5f43ee[_0x2a47('0x5c')][_0x2a47('0x59')][_0x2a47('0x5d')]+':'+_0x5f43ee[_0x2a47('0x5c')]['connection']['remotePort'];_0x5f43ee[_0x2a47('0x5e')]=new Date();_0x5f43ee[_0x2a47('0x57')]=function(_0xd7afaf){console[_0x2a47('0x57')]('SocketIO\x20'+_0x5f43ee[_0x2a47('0x5f')][_0x2a47('0x7')]+'['+_0x5f43ee['address']+']',_0xd7afaf);};_0x5f43ee['on'](_0x2a47('0x60'),function(){onDisconnect(_0x5f43ee,_0x3f1e23);_0x5f43ee[_0x2a47('0x57')](_0x2a47('0x61'));});onConnect(_0x5f43ee);_0x5f43ee[_0x2a47('0x57')](_0x2a47('0x62'));});}; \ No newline at end of file +var _0x6e05=['findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','where','Campaign','format','length','user:%s','query','handshake','ChatInteraction','ChatInteractions','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','FaxQueue','MailQueue','user','userProfileId','ChatQueue','SmsQueue','OpenchannelQueue','Trunk','getChatQueues','getFaxQueues','getOpenchannelQueues','voice','chat','sms','openchannel','telephone:%s','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','catch','log','join','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','SocketIO\x20','disconnect','DISCONNECTED','CONNECTED','lodash','bluebird','../mysqldb','./environment','name','Agents','User','role','telephone','agent','type','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','MailQueues','OpenchannelQueues'];(function(_0x297533,_0x3c4b29){var _0x104442=function(_0x4b32f2){while(--_0x4b32f2){_0x297533['push'](_0x297533['shift']());}};_0x104442(++_0x3c4b29);}(_0x6e05,0x15c));var _0x56e0=function(_0x4cd4e4,_0x1857a2){_0x4cd4e4=_0x4cd4e4-0x0;var _0x18cf3b=_0x6e05[_0x4cd4e4];return _0x18cf3b;};'use strict';var _=require(_0x56e0('0x0'));var util=require('util');var BPromise=require(_0x56e0('0x1'));var db=require(_0x56e0('0x2'))['db'];var config=require(_0x56e0('0x3'));var queryQueues={'attributes':['id',_0x56e0('0x4')],'include':[{'as':_0x56e0('0x5'),'model':db[_0x56e0('0x6')],'attributes':['id',_0x56e0('0x4'),_0x56e0('0x7')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x56e0('0x4')],'where':{'role':_0x56e0('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0x56e0('0x4')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x56e0('0x9')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x56e0('0x4'),_0x56e0('0xa')],'where':{'type':'ivr'}};function getAssociatedResources(_0x2aae55,_0x51e13e,_0x42d9bd){return db[_0x56e0('0xb')][_0x56e0('0xc')]({'where':{'name':_0x2aae55,'userProfileId':_0x51e13e},'raw':!![]})[_0x56e0('0xd')](function(_0x248631){if(_0x248631){if(_0x248631[_0x56e0('0xe')]){switch(_0x2aae55){case _0x56e0('0xf'):case _0x56e0('0x10'):case _0x56e0('0x11'):case'SmsQueues':case _0x56e0('0x12'):case _0x56e0('0x13'):return db[_0x42d9bd][_0x56e0('0x14')](queryQueues);case _0x56e0('0x15'):return db[_0x42d9bd][_0x56e0('0x14')](queryTelephones);case _0x56e0('0x16'):return db[_0x42d9bd]['findAll'](queryTrunks);case _0x56e0('0x17'):return db[_0x42d9bd]['findAll'](queryCampaigns);}}else{return db[_0x56e0('0x18')][_0x56e0('0x14')]({'attributes':[_0x56e0('0x19')],'where':{'sectionId':_0x248631['id']},'raw':!![]})[_0x56e0('0xd')](function(_0x5e9088){if(_0x5e9088){var _0x1d2853={'where':{'id':_[_0x56e0('0x1a')](_0x5e9088,_0x56e0('0x19'))},'raw':!![]};switch(_0x42d9bd){case'User':_0x1d2853[_0x56e0('0x1b')][_0x56e0('0x7')]=_0x56e0('0x8');break;case _0x56e0('0x1c'):_0x1d2853['where'][_0x56e0('0xa')]='ivr';break;}return db[_0x42d9bd]['findAll'](_0x1d2853);}else{return[];}});}}else{return[];}})[_0x56e0('0xd')](function(_0x119f89){return _0x119f89;});}function joinOrLeaveQueues(_0x47336c,_0x1181b7,_0x39fb8e,_0x363553){_0x47336c[_0x1181b7](util[_0x56e0('0x1d')]('%s:queue:%s',_0x39fb8e,_0x363553[_0x56e0('0x4')]));if(_0x363553['Agents']){for(var _0x246944=0x0;_0x246944<_0x363553[_0x56e0('0x5')][_0x56e0('0x1e')];_0x246944+=0x1){_0x47336c[_0x1181b7](util['format'](_0x56e0('0x1f'),_0x363553[_0x56e0('0x5')][_0x246944]['name']));}}}function joinOrLeave(_0x1f95a3,_0x3e1c53,_0x2cf889){var _0x4c5689;if(_0x1f95a3['handshake'][_0x56e0('0x20')]['id']){db[_0x56e0('0x6')]['find']({'attributes':['id',_0x56e0('0x4'),_0x56e0('0x7'),'userProfileId'],'where':{'id':_0x1f95a3[_0x56e0('0x21')][_0x56e0('0x20')]['id']},'include':[{'model':db[_0x56e0('0x22')],'as':_0x56e0('0x23'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x56e0('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x56e0('0x25')],'as':_0x56e0('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x56e0('0x27')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x56e0('0x28')],'as':_0x56e0('0x29'),'attributes':['id'],'raw':!![]}]})[_0x56e0('0xd')](function(_0x40d842){if(_0x40d842){_0x4c5689=_0x40d842;_0x1f95a3[_0x3e1c53](util[_0x56e0('0x1d')](_0x56e0('0x1f'),_0x40d842[_0x56e0('0x4')]));var _0x584182=[];switch(_0x40d842[_0x56e0('0x7')]){case _0x56e0('0x2a'):_0x1f95a3[_0x3e1c53](_0x56e0('0x2b'));_0x1f95a3[_0x3e1c53](_0x56e0('0x2c'));if(queryQueues[_0x56e0('0x2d')](_0x56e0('0x2e'))){delete queryQueues[_0x56e0('0x2e')];}_0x584182[_0x56e0('0x2f')](db[_0x56e0('0x30')]['findAll'](queryQueues));_0x584182[_0x56e0('0x2f')](db['ChatQueue'][_0x56e0('0x14')](queryQueues));_0x584182[_0x56e0('0x2f')](db[_0x56e0('0x31')][_0x56e0('0x14')](queryQueues));_0x584182[_0x56e0('0x2f')](db['SmsQueue'][_0x56e0('0x14')](queryQueues));_0x584182['push'](db[_0x56e0('0x32')][_0x56e0('0x14')](queryQueues));_0x584182[_0x56e0('0x2f')](db['OpenchannelQueue'][_0x56e0('0x14')](queryQueues));_0x584182['push'](db['User'][_0x56e0('0x14')](queryTelephones));_0x584182[_0x56e0('0x2f')](db['Trunk'][_0x56e0('0x14')](queryTrunks));_0x584182[_0x56e0('0x2f')](db[_0x56e0('0x1c')][_0x56e0('0x14')](queryCampaigns));_0x584182[_0x56e0('0x2f')](db[_0x56e0('0x6')][_0x56e0('0x14')](queryAgents));break;case _0x56e0('0x33'):_0x1f95a3[_0x3e1c53](_0x56e0('0x2b'));_0x1f95a3[_0x3e1c53](_0x56e0('0x2c'));_0x584182['push'](getAssociatedResources(_0x56e0('0xf'),_0x40d842[_0x56e0('0x34')],'VoiceQueue'));_0x584182[_0x56e0('0x2f')](getAssociatedResources(_0x56e0('0x10'),_0x40d842[_0x56e0('0x34')],_0x56e0('0x35')));_0x584182[_0x56e0('0x2f')](getAssociatedResources(_0x56e0('0x11'),_0x40d842['userProfileId'],_0x56e0('0x31')));_0x584182[_0x56e0('0x2f')](getAssociatedResources('SmsQueues',_0x40d842[_0x56e0('0x34')],_0x56e0('0x36')));_0x584182[_0x56e0('0x2f')](getAssociatedResources(_0x56e0('0x12'),_0x40d842[_0x56e0('0x34')],_0x56e0('0x32')));_0x584182[_0x56e0('0x2f')](getAssociatedResources(_0x56e0('0x13'),_0x40d842[_0x56e0('0x34')],_0x56e0('0x37')));_0x584182[_0x56e0('0x2f')](getAssociatedResources(_0x56e0('0x15'),_0x40d842[_0x56e0('0x34')],_0x56e0('0x6')));_0x584182[_0x56e0('0x2f')](getAssociatedResources('Trunks',_0x40d842[_0x56e0('0x34')],_0x56e0('0x38')));_0x584182[_0x56e0('0x2f')](getAssociatedResources('IvrCampaigns',_0x40d842[_0x56e0('0x34')],_0x56e0('0x1c')));_0x584182['push'](db[_0x56e0('0x6')][_0x56e0('0x14')](queryAgents));break;case _0x56e0('0x9'):_0x1f95a3[_0x3e1c53](_0x56e0('0x2b'));_0x1f95a3[_0x3e1c53](_0x56e0('0x2c'));_0x584182[_0x56e0('0x2f')](_0x40d842['getVoiceQueues']({'attributes':['id',_0x56e0('0x4')]}));_0x584182[_0x56e0('0x2f')](_0x40d842[_0x56e0('0x39')]({'attributes':['id',_0x56e0('0x4')]}));_0x584182[_0x56e0('0x2f')](_0x40d842[_0x56e0('0x3a')]({'attributes':['id','name']}));_0x584182[_0x56e0('0x2f')](_0x40d842['getSmsQueues']({'attributes':['id',_0x56e0('0x4')]}));_0x584182[_0x56e0('0x2f')](_0x40d842['getMailQueues']({'attributes':['id',_0x56e0('0x4')]}));_0x584182['push'](_0x40d842[_0x56e0('0x3b')]({'attributes':['id',_0x56e0('0x4')]}));break;}return BPromise['all'](_0x584182);}})[_0x56e0('0xd')](function(_0x25af8f){if(_0x25af8f&&_0x25af8f[_0x56e0('0x1e')]){for(var _0x2b0141=0x0;_0x2b0141<_0x25af8f[_0x56e0('0x1e')];_0x2b0141+=0x1){for(var _0x1d6bc0=0x0;_0x1d6bc0<_0x25af8f[_0x2b0141][_0x56e0('0x1e')];_0x1d6bc0+=0x1){switch(_0x2b0141){case 0x0:joinOrLeaveQueues(_0x1f95a3,_0x3e1c53,_0x56e0('0x3c'),_0x25af8f[_0x2b0141][_0x1d6bc0]);break;case 0x1:joinOrLeaveQueues(_0x1f95a3,_0x3e1c53,_0x56e0('0x3d'),_0x25af8f[_0x2b0141][_0x1d6bc0]);break;case 0x2:joinOrLeaveQueues(_0x1f95a3,_0x3e1c53,'fax',_0x25af8f[_0x2b0141][_0x1d6bc0]);break;case 0x3:joinOrLeaveQueues(_0x1f95a3,_0x3e1c53,_0x56e0('0x3e'),_0x25af8f[_0x2b0141][_0x1d6bc0]);break;case 0x4:joinOrLeaveQueues(_0x1f95a3,_0x3e1c53,'mail',_0x25af8f[_0x2b0141][_0x1d6bc0]);break;case 0x5:joinOrLeaveQueues(_0x1f95a3,_0x3e1c53,_0x56e0('0x3f'),_0x25af8f[_0x2b0141][_0x1d6bc0]);break;case 0x6:_0x1f95a3[_0x3e1c53](util[_0x56e0('0x1d')](_0x56e0('0x40'),_0x25af8f[_0x2b0141][_0x1d6bc0][_0x56e0('0x4')]));break;case 0x7:_0x1f95a3[_0x3e1c53](util[_0x56e0('0x1d')](_0x56e0('0x41'),_0x25af8f[_0x2b0141][_0x1d6bc0][_0x56e0('0x4')]));break;case 0x8:_0x1f95a3[_0x3e1c53](util[_0x56e0('0x1d')](_0x56e0('0x42'),_0x25af8f[_0x2b0141][_0x1d6bc0][_0x56e0('0xa')],_0x25af8f[_0x2b0141][_0x1d6bc0][_0x56e0('0x4')]));break;case 0x9:_0x1f95a3[_0x3e1c53](util[_0x56e0('0x1d')](_0x56e0('0x1f'),_0x25af8f[_0x2b0141][_0x1d6bc0][_0x56e0('0x4')]));break;}}}}})[_0x56e0('0xd')](function(){if(_0x3e1c53===_0x56e0('0x43')){var _0x5b0719=_[_0x56e0('0x1a')](_0x4c5689['ChatInteractions'],'id');return _0x4c5689[_0x56e0('0x44')](_0x5b0719)[_0x56e0('0xd')](function(){for(var _0x3542bf=0x0;_0x3542bf<_0x5b0719['length'];_0x3542bf+=0x1){_0x2cf889[_0x56e0('0x45')](_0x56e0('0x46'),{'ChatInteractionId':Number(_0x5b0719[_0x3542bf]),'UserId':Number(_0x4c5689['id'])});}});}})[_0x56e0('0xd')](function(){if(_0x3e1c53===_0x56e0('0x43')){var _0x17a3d5=_[_0x56e0('0x1a')](_0x4c5689[_0x56e0('0x24')],'id');return _0x4c5689[_0x56e0('0x47')](_0x17a3d5)['then'](function(){for(var _0x538480=0x0;_0x538480<_0x17a3d5[_0x56e0('0x1e')];_0x538480+=0x1){_0x2cf889[_0x56e0('0x45')](_0x56e0('0x48'),{'MailInteractionId':Number(_0x17a3d5[_0x538480]),'UserId':Number(_0x4c5689['id'])});}});}})[_0x56e0('0xd')](function(){if(_0x3e1c53===_0x56e0('0x43')){var _0x1d41ff=_[_0x56e0('0x1a')](_0x4c5689[_0x56e0('0x26')],'id');return _0x4c5689[_0x56e0('0x49')](_0x1d41ff)[_0x56e0('0xd')](function(){for(var _0x581e56=0x0;_0x581e56<_0x1d41ff['length'];_0x581e56+=0x1){_0x2cf889[_0x56e0('0x45')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x1d41ff[_0x581e56]),'UserId':Number(_0x4c5689['id'])});}});}})[_0x56e0('0xd')](function(){if(_0x3e1c53===_0x56e0('0x43')){var _0x147007=_['map'](_0x4c5689['SmsInteractions'],'id');return _0x4c5689[_0x56e0('0x4a')](_0x147007)[_0x56e0('0xd')](function(){for(var _0x2c6b04=0x0;_0x2c6b04<_0x147007[_0x56e0('0x1e')];_0x2c6b04+=0x1){_0x2cf889[_0x56e0('0x45')](_0x56e0('0x4b'),{'SmsInteractionId':Number(_0x147007[_0x2c6b04]),'UserId':Number(_0x4c5689['id'])});}});}})[_0x56e0('0xd')](function(){if(_0x3e1c53===_0x56e0('0x43')){var _0x362e24=_[_0x56e0('0x1a')](_0x4c5689[_0x56e0('0x29')],'id');return _0x4c5689[_0x56e0('0x4c')](_0x362e24)[_0x56e0('0xd')](function(){for(var _0xd67f86=0x0;_0xd67f86<_0x362e24[_0x56e0('0x1e')];_0xd67f86+=0x1){_0x2cf889['emit'](_0x56e0('0x4d'),{'OpenchannelInteractionId':Number(_0x362e24[_0xd67f86]),'UserId':Number(_0x4c5689['id'])});}});}})[_0x56e0('0x4e')](function(_0x385399){_0x1f95a3[_0x56e0('0x4f')](_0x385399);});}}function onDisconnect(_0xbf729f,_0x478dec){joinOrLeave(_0xbf729f,_0x56e0('0x43'),_0x478dec);}function onConnect(_0x97284f){joinOrLeave(_0x97284f,_0x56e0('0x50'));}exports[_0x56e0('0x51')]=function(_0x490517){_0x490517['on'](_0x56e0('0x52'),function(_0x4a5822){_0x4a5822[_0x56e0('0x53')](0x0);_0x4a5822[_0x56e0('0x54')]=_0x4a5822[_0x56e0('0x55')][_0x56e0('0x52')][_0x56e0('0x56')]+':'+_0x4a5822[_0x56e0('0x55')]['connection'][_0x56e0('0x57')];_0x4a5822['connectedAt']=new Date();_0x4a5822[_0x56e0('0x4f')]=function(_0x44175e){console['log'](_0x56e0('0x58')+_0x4a5822['nsp'][_0x56e0('0x4')]+'['+_0x4a5822[_0x56e0('0x54')]+']',_0x44175e);};_0x4a5822['on'](_0x56e0('0x59'),function(){onDisconnect(_0x4a5822,_0x490517);_0x4a5822[_0x56e0('0x4f')](_0x56e0('0x5a'));});onConnect(_0x4a5822);_0x4a5822[_0x56e0('0x4f')](_0x56e0('0x5b'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index d2858a6..a641998 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 _0x4e86=['ChatMessage','newmessage','SmsInteraction','Sms','SmsMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','request','EventManager','then','info','error','get','event','UserId','name','interface','SIP/%s','channel','incomingmessage','catch','changed','closed','User','format','default','length','model','hook','callback','toLowerCase','condition','../../mysqldb','../logger','triggers','client','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction'];(function(_0x9bb04e,_0x43a156){var _0x31a008=function(_0x43950c){while(--_0x43950c){_0x9bb04e['push'](_0x9bb04e['shift']());}};_0x31a008(++_0x43a156);}(_0x4e86,0xe6));var _0x64e8=function(_0x42b89a,_0x5842f4){_0x42b89a=_0x42b89a-0x0;var _0x33e70d=_0x4e86[_0x42b89a];return _0x33e70d;};'use strict';var util=require('util');var db=require(_0x64e8('0x0'))['db'];var jayson=require('jayson/promise');var logger=require(_0x64e8('0x1'))(_0x64e8('0x2'));var client=jayson[_0x64e8('0x3')]['http']({'port':0x232a});var triggers=[{'channel':_0x64e8('0x4'),'model':_0x64e8('0x5'),'event':_0x64e8('0x6'),'condition':_0x64e8('0x7'),'callback':afterCreate},{'channel':_0x64e8('0x4'),'model':'ChatInteraction','event':_0x64e8('0x8'),'condition':_0x64e8('0x9'),'callback':afterUpdate},{'channel':'Chat','model':_0x64e8('0xa'),'event':_0x64e8('0x6'),'condition':_0x64e8('0xb'),'callback':afterCreateMessage},{'channel':'Sms','model':_0x64e8('0xc'),'event':'afterCreate','condition':_0x64e8('0x7'),'callback':afterCreate},{'channel':_0x64e8('0xd'),'model':'SmsInteraction','event':_0x64e8('0x8'),'condition':_0x64e8('0x9'),'callback':afterUpdate},{'channel':_0x64e8('0xd'),'model':_0x64e8('0xe'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x64e8('0xf'),'model':_0x64e8('0x10'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0x64e8('0xf'),'model':_0x64e8('0x10'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0x64e8('0xf'),'model':_0x64e8('0x11'),'event':_0x64e8('0x6'),'condition':_0x64e8('0xb'),'callback':afterCreateMessage},{'channel':_0x64e8('0x12'),'model':'MailInteraction','event':_0x64e8('0x6'),'condition':_0x64e8('0x7'),'callback':afterCreate},{'channel':_0x64e8('0x12'),'model':_0x64e8('0x13'),'event':_0x64e8('0x8'),'condition':_0x64e8('0x9'),'callback':afterUpdate},{'channel':'Mail','model':_0x64e8('0x14'),'event':_0x64e8('0x6'),'condition':_0x64e8('0xb'),'callback':afterCreateMessage},{'channel':_0x64e8('0x15'),'model':_0x64e8('0x16'),'event':_0x64e8('0x6'),'condition':_0x64e8('0x7'),'callback':afterCreate},{'channel':_0x64e8('0x15'),'model':_0x64e8('0x16'),'event':_0x64e8('0x8'),'condition':_0x64e8('0x9'),'callback':afterUpdate},{'channel':'Openchannel','model':'OpenchannelMessage','event':'afterCreate','condition':'newmessage','callback':afterCreateMessage}];function request(_0x814388){return client[_0x64e8('0x17')](_0x64e8('0x18'),_0x814388)[_0x64e8('0x19')](function(_0x4a4f04){logger[_0x64e8('0x1a')]('Trigger,\x20%s',_0x64e8('0x18'),_0x4a4f04);if(_0x4a4f04['error']){if(_0x4a4f04['error']['code']===0x1f4){logger[_0x64e8('0x1b')]('Trigger,\x20%s',_0x64e8('0x18'),_0x4a4f04[_0x64e8('0x1b')]);}}})['catch'](function(_0x374ff1){logger['error']('Trigger,\x20%s',_0x64e8('0x18'),_0x374ff1);});}function afterCreateMessage(_0x580a8d,_0x3f16bb){return function(_0x44fbf4,_0xaf8dfb){_0x44fbf4=_0x44fbf4[_0x64e8('0x1c')]({'plain':!![]});_0x44fbf4['channel']=_0x580a8d;_0x44fbf4[_0x64e8('0x1d')]=_0x44fbf4['direction'];if(_0x44fbf4[_0x64e8('0x1e')]){return db['User']['find']({'where':{'id':_0x44fbf4[_0x64e8('0x1e')]},'attributes':['id',_0x64e8('0x1f')],'raw':!![]})[_0x64e8('0x19')](function(_0x515a6f){_0x44fbf4[_0x64e8('0x20')]=util['format'](_0x64e8('0x21'),_0x515a6f['name']);_0x44fbf4[_0x64e8('0x22')]=_0x580a8d;return request({'event':_0x64e8('0x23'),'message':_0x44fbf4});})[_0x64e8('0x24')](function(_0x153935){console['error'](_0x153935);});}else{return request({'event':'outgoingmessage','message':_0x44fbf4});}};}function afterCreate(_0x40f9e6,_0x3742e1){return function(_0x44a30c,_0x2a26f9){_0x44a30c=_0x44a30c[_0x64e8('0x1c')]({'plain':!![]});_0x44a30c[_0x64e8('0x22')]=_0x40f9e6;_0x44a30c[_0x64e8('0x1d')]='opened';return request({'event':_0x3742e1,'message':_0x44a30c});};}function afterUpdate(_0x19a907,_0x22069e){return function(_0x1e7327,_0x16402d){if(_0x1e7327[_0x64e8('0x25')](_0x64e8('0x26'))&&_0x1e7327['closed']){_0x1e7327=_0x1e7327[_0x64e8('0x1c')]({'plain':!![]});_0x1e7327['channel']=_0x19a907;_0x1e7327['event']=_0x64e8('0x26');if(_0x1e7327[_0x64e8('0x1e')]){return db[_0x64e8('0x27')]['find']({'where':{'id':_0x1e7327['UserId']},'attributes':['id',_0x64e8('0x1f')],'raw':!![]})[_0x64e8('0x19')](function(_0x10a437){_0x1e7327[_0x64e8('0x20')]=util[_0x64e8('0x28')](_0x64e8('0x21'),_0x10a437[_0x64e8('0x1f')]);return request({'event':_0x22069e,'message':_0x1e7327});})[_0x64e8('0x24')](function(_0x12dc46){console[_0x64e8('0x1b')](_0x12dc46);});}else{return request({'event':_0x22069e,'message':_0x1e7327});}}};}exports[_0x64e8('0x29')]=function(){for(var _0x4b1a9b=0x0;_0x4b1a9b=_0x3eefa0['agents']){throw Error(_0x770c('0x15'));}_0x32df0b(_0xcedc81);})[_0x770c('0x16')](function(_0xfd43f1){_0x216d6d(_0xfd43f1);});});}; \ No newline at end of file +var _0x1f2f=['./license/util','voice','mail','chat','fax','sms','openchannel','getChannels','isValidChannel','toLowerCase','includes','clearBlockUser','isUndefined','blockedAt','getLicense','agent','count','agents','catch','lodash','../mysqldb'];(function(_0x552128,_0x21c201){var _0x2392ce=function(_0x3a09f8){while(--_0x3a09f8){_0x552128['push'](_0x552128['shift']());}};_0x2392ce(++_0x21c201);}(_0x1f2f,0xa6));var _0xf1f2=function(_0x4c99ee,_0x2d8768){_0x4c99ee=_0x4c99ee-0x0;var _0x24bc5f=_0x1f2f[_0x4c99ee];return _0x24bc5f;};'use strict';var _=require(_0xf1f2('0x0'));var BPromise=require('bluebird');var db=require(_0xf1f2('0x1'))['db'];var util=require(_0xf1f2('0x2'));var channels=[_0xf1f2('0x3'),_0xf1f2('0x4'),_0xf1f2('0x5'),_0xf1f2('0x6'),_0xf1f2('0x7'),_0xf1f2('0x8')];exports[_0xf1f2('0x9')]=function(){return channels;};exports[_0xf1f2('0xa')]=function(_0x39414c){_0x39414c=_0x39414c[_0xf1f2('0xb')]();return _[_0xf1f2('0xc')](channels,_0x39414c);};exports[_0xf1f2('0xd')]=function(_0x17b433,_0x3b5357,_0x28440e,_0x58b878){var _0x21ce9b={'loginAttempts':_0x3b5357,'blocked':_0x28440e};if(!_[_0xf1f2('0xe')](_0x58b878)){_0x21ce9b[_0xf1f2('0xf')]=_0x58b878;}return _0x17b433['updateAttributes'](_0x21ce9b);};exports[_0xf1f2('0x10')]=function(_0xde483e){return new BPromise(function(_0x364074,_0xc32835){var _0x580217=0x0;if(_0xde483e['role']!==_0xf1f2('0x11')){_0x364074(_0xde483e);}db['User'][_0xf1f2('0x12')]({'where':{'role':_0xf1f2('0x11'),'online':!![],'id':{'$ne':_0xde483e['id']}}})['then'](function(_0x14a12c){_0x580217=_0x14a12c;return util[_0xf1f2('0x10')]();})['then'](function(_0x450eff){if(_0x450eff&&_0x450eff[_0xf1f2('0x13')]&&_0x580217>=_0x450eff['agents']){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x364074(_0xde483e);})[_0xf1f2('0x14')](function(_0x21747a){_0xc32835(_0x21747a);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 0b341c6..710fe74 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7f41=['404','status','json','send','exports'];(function(_0x562772,_0x26dba8){var _0x17c42d=function(_0x43999f){while(--_0x43999f){_0x562772['push'](_0x562772['shift']());}};_0x17c42d(++_0x26dba8);}(_0x7f41,0x1d0));var _0x17f4=function(_0x382381,_0x183bab){_0x382381=_0x382381-0x0;var _0x22215a=_0x7f41[_0x382381];return _0x22215a;};'use strict';module[_0x17f4('0x0')][0x194]=function pageNotFound(_0x5a4c36,_0x33ae42){var _0x48eff4=_0x17f4('0x1');var _0x478e78=0x194;var _0x1b1d3d={'status':_0x478e78};_0x33ae42[_0x17f4('0x2')](_0x1b1d3d['status']);_0x33ae42['render'](_0x48eff4,{},function(_0x5ed2ac,_0x169e00){if(_0x5ed2ac){return _0x33ae42[_0x17f4('0x2')](_0x1b1d3d[_0x17f4('0x2')])[_0x17f4('0x3')](_0x1b1d3d);}_0x33ae42[_0x17f4('0x4')](_0x169e00);});}; \ No newline at end of file +var _0x2413=['exports','404','status','json'];(function(_0x4f8a9f,_0x350bac){var _0x273ded=function(_0x4f9ca8){while(--_0x4f9ca8){_0x4f8a9f['push'](_0x4f8a9f['shift']());}};_0x273ded(++_0x350bac);}(_0x2413,0x134));var _0x3241=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x2413[_0x4a9fb1];return _0x348672;};'use strict';module[_0x3241('0x0')][0x194]=function pageNotFound(_0x157c18,_0x3686a0){var _0x6fbd73=_0x3241('0x1');var _0x21f10b=0x194;var _0x3831be={'status':_0x21f10b};_0x3686a0['status'](_0x3831be['status']);_0x3686a0['render'](_0x6fbd73,{},function(_0x345ca0,_0x7eba62){if(_0x345ca0){return _0x3686a0['status'](_0x3831be[_0x3241('0x2')])[_0x3241('0x3')](_0x3831be);}_0x3686a0['send'](_0x7eba62);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 7cb9247..acbc1f7 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4d49=['../api/userProfileResource/userProfileResource.model','CrmNation','../api/crmNation/crmNation.model','CrmWorkflow','../api/crmWorkflow/crmWorkflow.model','CrmTask','../api/crmTask/crmTask.model','CrmActionsList','SATypeProduct','../api/saTypeProduct/saTypeProduct.model','SAUnitMeasure','../api/saUnitMeasure/saUnitMeasure.model','SAInvoiceLaw','../api/saInvoiceLaw/saInvoiceLaw.model','SAProduct','../api/saProduct/saProduct.model','SASalesCondition','../api/saSalesCondition/saSalesCondition.model','SAPriceList','../api/saPriceList/saPriceList.model','SAProductPricesList','../api/saProductPricesList/saProductPricesList.model','SADossier','SARequest','SAQuotation','../api/saQuotation/saQuotation.model','SAProductQuotation','../api/saProductQuotation/saProductQuotation.model','SAOrder','SAProforma','../api/saProforma/saProforma.model','SAInvoice','../api/saInvoice/saInvoice.model','../api/saAsset/saAsset.model','SAInvoiceDetail','../api/saInvoiceDetail/saInvoiceDetail.model','SAProformaDetail','../api/saProformaDetail/saProformaDetail.model','SAPayment','../api/saPayment/saPayment.model','../api/saPaymentMethod/saPaymentMethod.model','SACreditNote','../api/saCreditNote/saCreditNote.model','SACreditNoteDetail','../api/saCreditNoteDetail/saCreditNoteDetail.model','SAInvoiceNumber','SACreditNoteNumber','SACompanyType','../api/saCompanyType/saCompanyType.model','SACompanyRelationship','../api/saCompanyRelationship/saCompanyRelationship.model','User','hasOne','VoiceMail','cascade','Recordings','UserId','hasMany','VoiceQueuesRt','Extensions','CmHopperFinal','HopperFinals','CmHopperHistory','OpenchannelInteraction','ChatInteractions','SmsInteractions','belongsTo','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','MailInteractions','user_has_mail_interactions','FaxInteractions','user_has_sms_interactions','OpenchannelInteractions','VoiceQueues','MailQueue','MailQueues','FaxQueues','SmsQueues','OpenchannelQueues','UserOpenchannelQueue','CmList','VoicePrefixes','user_has_voice_prefixes','ChatWebsite','ChatWebsites','user_has_chat_websites','FaxAccounts','MailAccounts','user_has_mail_accounts','OpenchannelAccount','OpenchannelAccounts','SmsAccounts','SquareProject','SquareProjects','ChanSpyId','VoiceContext','Sounds','moh_has_sounds','VoiceQueueId','HopperHistories','HopperBlacks','JscriptySessions','TrunkBackup','TrunkBackupId','Pause','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','team_has_voice_queues','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','VoiceMailMessage','VoiceCallReport','QueueCalls','uniqueid','AgentReports','Contact','MailAccountId','MailServerOut','Imap','Smtp','Disposition','Dispositions','Interactions','Applications','List','ListId','TemplateId','MailInteractionId','Account','mail_interaction_has_tags','Tags','Attachment','Attachments','Interaction','restrict','IntervalId','TagId','FaxAccountId','Answers','FaxApplication','Exntensions','user_has_fax_accounts','FaxQueue','ContactId','Owner','fax_interaction_has_tags','ThroughTags','Users','user_has_fax_interactions','FaxInteractionId','AttachmentId','team_has_fax_queues','SmsAccountId','SmsMessage','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','user_has_openchannel_accounts','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','team_has_openchannel_queues','ChatWebsiteId','ChatApplication','Agent','Queue','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','team_has_chat_queues','ChatGroupId','Members','CompanyId','PriceLists','Dossiers','SAPaymentMethod','PaymentMethod','saPaymentMethod','Hoppers','Company','cm_contact_has_tags','Campaign','CampaignId','OwnerId','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','AutomationId','Intervals','MailApplications','ChatApplications','FaxApplications','Schedule','DefaultReportId','CustomReportId','Mohs','AllConditions','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','MetricId','AnalyticMetric','Configurations','AccountId','Subjects','DescriptionId','FieldId','Subject','Description','Field','Variable','VariableId','SubjectId','Descriptions','DeskAccount','int_desk_configuration_has_tags','ZohoAccount','ZendeskConfiguration','ZendeskField','int_zendesk_configuration_has_tags','int_vtiger_configuration_has_tags','ServicenowConfiguration','Dynamics365Account','SessionId','SmsQueueReport','ProjectId','user_has_square_projects','ChatQueues','TrunkId','SquareProjectId','campaigns_has_cm_blacklists','FromAccount','FromUserId','FromAgent','ToUserId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToAgent','ToChatQueueId','ToChatWebsiteId','FaxTransferReport','FromFaxAccountId','ToFaxQueueId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','UserProfileSections','userProfileId','Resources','sectionId','WorkflowId','CrmWorkflowStep','WorkflowStepId','CrmWorkflowNextStep','crm_workflow_steps_has_crm_workflow_steps','TaskId','UnitMeasureId','ProductId','SaleCondition','TypeSalesConditionId','PriceListId','ProductPriceList','ProductPriceListId','Product','Pricelist','DossierId','Workflow','WorkflowStep','Requests','RequestId','Quotations','QuotationId','Dossier','ProductPricesList','Quotation','Invoice','InvoiceId','Orders','Request','ProformaId','Proforma','Order','Details','Payments','OrderId','Companies','CreditNote','CreditNoteId','CompanyType','saCompanyType','CompanyRelationship','saCompanyRelationship','../config/environment','lodash','jstz','determine','sequelize','defaultsDeep','motion2','xcall','xC@LL1234','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','127.0.0.1','database','username','options','password','../api/user/user.model','VoiceChanSpy','import','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','VoiceRecording','../api/voiceRecording/voiceRecording.model','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','FaxAccount','../api/faxAccount/faxAccount.model','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatInteraction','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','CmCustomField','Action','Automation','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','../api/cdr/cdr.model','VoiceQueuesLog','Sound','../api/sound/sound.model','Tag','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','../api/variable/variable.model','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../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','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','Network','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SquareReport','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','../api/setting/setting.model','SquareOdbc','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Migration','../api/migration/migration.model','../api/attachment/attachment.model','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','../api/faxTransferReport/faxTransferReport.model','SmsTransferReport','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','UserProfileResource'];(function(_0x63a404,_0x4733d2){var _0x27d690=function(_0x55939f){while(--_0x55939f){_0x63a404['push'](_0x63a404['shift']());}};_0x27d690(++_0x4733d2);}(_0x4d49,0x141));var _0x94d4=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x4d49[_0x397e5f];return _0x5302b8;};'use strict';var path=require('path');var config=require(_0x94d4('0x0'));var Sequelize=require('sequelize');var _=require(_0x94d4('0x1'));var jstz=require(_0x94d4('0x2'));var timezone=jstz[_0x94d4('0x3')]();config[_0x94d4('0x4')]=_[_0x94d4('0x5')](config[_0x94d4('0x4')],{'database':_0x94d4('0x6'),'username':_0x94d4('0x7'),'password':_0x94d4('0x8'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x94d4('0x9'),'dialectOptions':{'charset':_0x94d4('0xa')},'logging':![],'timezone':timezone[_0x94d4('0xb')](),'define':{'charset':_0x94d4('0xc'),'collate':_0x94d4('0xd')}}});config[_0x94d4('0xe')]=_['defaultsDeep'](config[_0x94d4('0xe')],{'database':_0x94d4('0x6'),'username':'xcall','password':_0x94d4('0x8'),'options':{'host':_0x94d4('0xf'),'port':0xcea,'dialect':_0x94d4('0x9'),'dialectOptions':{'charset':_0x94d4('0xa')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x94d4('0xc'),'collate':_0x94d4('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x94d4('0x4')][_0x94d4('0x10')],config[_0x94d4('0x4')][_0x94d4('0x11')],config['sequelize']['password'],config['sequelize'][_0x94d4('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x94d4('0xe')]['database'],config[_0x94d4('0xe')][_0x94d4('0x11')],config['sequelizeHistory'][_0x94d4('0x13')],config['sequelizeHistory'][_0x94d4('0x12')])};db['User']=db['sequelize']['import'](_0x94d4('0x14'));db[_0x94d4('0x15')]=db[_0x94d4('0x4')]['import']('../api/voiceChanSpy/voiceChanSpy.model');db['VoiceContext']=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x17'));db[_0x94d4('0x18')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x19'));db[_0x94d4('0x1a')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x1b'));db[_0x94d4('0x1c')]=db['sequelize'][_0x94d4('0x16')]('../api/voiceQueue/voiceQueue.model');db[_0x94d4('0x1d')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x1e'));db['ScreenRecording']=db[_0x94d4('0x4')][_0x94d4('0x16')]('../api/screenRecording/screenRecording.model');db['VoiceMail']=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x1f'));db['VoiceMailMessage']=db[_0x94d4('0x4')]['import'](_0x94d4('0x20'));db['VoiceCallReport']=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x21'));db[_0x94d4('0x22')]=db[_0x94d4('0x4')][_0x94d4('0x16')]('../api/voiceDialReport/voiceDialReport.model');db[_0x94d4('0x23')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x24'));db[_0x94d4('0x25')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x26'));db[_0x94d4('0x27')]=db[_0x94d4('0x4')]['import'](_0x94d4('0x28'));db[_0x94d4('0x29')]=db['sequelize'][_0x94d4('0x16')](_0x94d4('0x2a'));db[_0x94d4('0x2b')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x2c'));db[_0x94d4('0x2d')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x2e'));db[_0x94d4('0x2f')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x30'));db[_0x94d4('0x31')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x32'));db[_0x94d4('0x33')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x34'));db[_0x94d4('0x35')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x36'));db[_0x94d4('0x37')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x38'));db['UserOpenchannelQueue']=db[_0x94d4('0x4')]['import'](_0x94d4('0x39'));db[_0x94d4('0x3a')]=db[_0x94d4('0x4')][_0x94d4('0x16')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x94d4('0x4')]['import'](_0x94d4('0x3b'));db[_0x94d4('0x3c')]=db[_0x94d4('0x4')]['import'](_0x94d4('0x3d'));db['MailQueue']=db['sequelize']['import'](_0x94d4('0x3e'));db[_0x94d4('0x3f')]=db[_0x94d4('0x4')]['import'](_0x94d4('0x40'));db[_0x94d4('0x41')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x42'));db[_0x94d4('0x43')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x44'));db[_0x94d4('0x45')]=db[_0x94d4('0x4')]['import'](_0x94d4('0x46'));db[_0x94d4('0x47')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x48'));db[_0x94d4('0x49')]=db['sequelize'][_0x94d4('0x16')](_0x94d4('0x4a'));db[_0x94d4('0x4b')]=db[_0x94d4('0x4')][_0x94d4('0x16')]('../api/dashboardItem/dashboardItem.model');db[_0x94d4('0x4c')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x4d'));db['FaxApplication']=db['sequelize'][_0x94d4('0x16')](_0x94d4('0x4e'));db[_0x94d4('0x4f')]=db[_0x94d4('0x4')]['import'](_0x94d4('0x50'));db[_0x94d4('0x51')]=db[_0x94d4('0x4')][_0x94d4('0x16')]('../api/faxMessage/faxMessage.model');db['FaxQueue']=db[_0x94d4('0x4')]['import'](_0x94d4('0x52'));db[_0x94d4('0x53')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x54'));db[_0x94d4('0x55')]=db['sequelize'][_0x94d4('0x16')](_0x94d4('0x56'));db[_0x94d4('0x57')]=db[_0x94d4('0x4')]['import']('../api/smsApplication/smsApplication.model');db[_0x94d4('0x58')]=db['sequelize'][_0x94d4('0x16')](_0x94d4('0x59'));db['SmsMessage']=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x5a'));db[_0x94d4('0x5b')]=db[_0x94d4('0x4')]['import'](_0x94d4('0x5c'));db['OpenchannelAccount']=db[_0x94d4('0x4')]['import'](_0x94d4('0x5d'));db[_0x94d4('0x5e')]=db['sequelize'][_0x94d4('0x16')](_0x94d4('0x5f'));db['OpenchannelInteraction']=db[_0x94d4('0x4')]['import'](_0x94d4('0x60'));db[_0x94d4('0x61')]=db['sequelize'][_0x94d4('0x16')](_0x94d4('0x62'));db[_0x94d4('0x63')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x64'));db['ChatWebsite']=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x65'));db[_0x94d4('0x66')]=db['sequelize'][_0x94d4('0x16')]('../api/openchannelQueueReport/openchannelQueueReport.model');db['ChatApplication']=db['sequelize'][_0x94d4('0x16')]('../api/chatApplication/chatApplication.model');db[_0x94d4('0x67')]=db['sequelize']['import']('../api/chatInteraction/chatInteraction.model');db[_0x94d4('0x68')]=db[_0x94d4('0x4')]['import'](_0x94d4('0x69'));db[_0x94d4('0x6a')]=db[_0x94d4('0x4')][_0x94d4('0x16')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x94d4('0x6b')]=db[_0x94d4('0x4')][_0x94d4('0x16')]('../api/chatQueue/chatQueue.model');db[_0x94d4('0x6c')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x6d'));db[_0x94d4('0x6e')]=db[_0x94d4('0x4')]['import'](_0x94d4('0x6f'));db[_0x94d4('0x70')]=db['sequelize'][_0x94d4('0x16')](_0x94d4('0x71'));db[_0x94d4('0x72')]=db[_0x94d4('0x4')]['import'](_0x94d4('0x73'));db[_0x94d4('0x74')]=db[_0x94d4('0x4')]['import'](_0x94d4('0x75'));db[_0x94d4('0x76')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x77'));db['CmHopperFinal']=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x78'));db['CmHopperHistory']=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x79'));db[_0x94d4('0x7a')]=db[_0x94d4('0x4')]['import']('../api/reportAgentPreview/reportAgentPreview.model');db[_0x94d4('0x7b')]=db[_0x94d4('0x4')][_0x94d4('0x16')]('../api/cmCustomField/cmCustomField.model');db[_0x94d4('0x7c')]=db[_0x94d4('0x4')][_0x94d4('0x16')]('../api/action/action.model');db[_0x94d4('0x7d')]=db['sequelize'][_0x94d4('0x16')]('../api/automation/automation.model');db[_0x94d4('0x7e')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x7f'));db['Disposition']=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x80'));db[_0x94d4('0x81')]=db['sequelize'][_0x94d4('0x16')](_0x94d4('0x82'));db[_0x94d4('0x83')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x84'));db['Pause']=db['sequelize'][_0x94d4('0x16')]('../api/pause/pause.model');db['Cdr']=db[_0x94d4('0x4')]['import'](_0x94d4('0x85'));db[_0x94d4('0x86')]=db[_0x94d4('0x4')][_0x94d4('0x16')]('../api/voiceQueuesLog/voiceQueuesLog.model');db['Schedule']=db[_0x94d4('0x4')][_0x94d4('0x16')]('../api/schedule/schedule.model');db[_0x94d4('0x87')]=db[_0x94d4('0x4')]['import'](_0x94d4('0x88'));db[_0x94d4('0x89')]=db[_0x94d4('0x4')][_0x94d4('0x16')]('../api/tag/tag.model');db[_0x94d4('0x8a')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x8b'));db[_0x94d4('0x8c')]=db['sequelize'][_0x94d4('0x16')](_0x94d4('0x8d'));db['Variable']=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x8e'));db['Integration']=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x8f'));db[_0x94d4('0x90')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x91'));db[_0x94d4('0x92')]=db[_0x94d4('0x4')]['import'](_0x94d4('0x93'));db[_0x94d4('0x94')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x95'));db[_0x94d4('0x96')]=db['sequelize'][_0x94d4('0x16')](_0x94d4('0x97'));db['AnalyticMetric']=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x98'));db[_0x94d4('0x99')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x9a'));db[_0x94d4('0x9b')]=db['sequelize'][_0x94d4('0x16')](_0x94d4('0x9c'));db[_0x94d4('0x9d')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x9e'));db[_0x94d4('0x9f')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0xa0'));db[_0x94d4('0xa1')]=db['sequelize']['import']('../api/intSalesforceField/intSalesforceField.model');db[_0x94d4('0xa2')]=db['sequelize'][_0x94d4('0x16')](_0x94d4('0xa3'));db[_0x94d4('0xa4')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0xa5'));db[_0x94d4('0xa6')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0xa7'));db['DeskAccount']=db[_0x94d4('0x4')][_0x94d4('0x16')]('../api/intDeskAccount/intDeskAccount.model');db[_0x94d4('0xa8')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0xa9'));db[_0x94d4('0xaa')]=db[_0x94d4('0x4')]['import']('../api/intDeskField/intDeskField.model');db['ZohoAccount']=db[_0x94d4('0x4')]['import'](_0x94d4('0xab'));db[_0x94d4('0xac')]=db['sequelize'][_0x94d4('0x16')](_0x94d4('0xad'));db[_0x94d4('0xae')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0xaf'));db[_0x94d4('0xb0')]=db['sequelize'][_0x94d4('0x16')](_0x94d4('0xb1'));db['ZendeskConfiguration']=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0xb2'));db['ZendeskField']=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0xb3'));db[_0x94d4('0xb4')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0xb5'));db[_0x94d4('0xb6')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0xb7'));db[_0x94d4('0xb8')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0xb9'));db[_0x94d4('0xba')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0xbb'));db[_0x94d4('0xbc')]=db[_0x94d4('0x4')][_0x94d4('0x16')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x94d4('0xbd')]=db[_0x94d4('0x4')]['import']('../api/intVtigerField/intVtigerField.model');db[_0x94d4('0xbe')]=db['sequelize'][_0x94d4('0x16')](_0x94d4('0xbf'));db['ServicenowConfiguration']=db['sequelize'][_0x94d4('0x16')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0x94d4('0xc0')]=db[_0x94d4('0x4')]['import'](_0x94d4('0xc1'));db['Dynamics365Account']=db['sequelize']['import']('../api/intDynamics365Account/intDynamics365Account.model');db[_0x94d4('0xc2')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0xc3'));db[_0x94d4('0xc4')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0xc5'));db['Integration']=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x8f'));db[_0x94d4('0xc6')]=db['sequelize'][_0x94d4('0x16')]('../api/network/network.model');db[_0x94d4('0xc7')]=db[_0x94d4('0x4')]['import'](_0x94d4('0xc8'));db[_0x94d4('0xc9')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0xca'));db[_0x94d4('0xcb')]=db['sequelize'][_0x94d4('0x16')](_0x94d4('0xcc'));db[_0x94d4('0xcd')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0xce'));db[_0x94d4('0xcf')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0xd0'));db['SmsQueueReport']=db[_0x94d4('0x4')][_0x94d4('0x16')]('../api/smsQueueReport/smsQueueReport.model');db[_0x94d4('0xd1')]=db['sequelize'][_0x94d4('0x16')]('../api/squareReport/squareReport.model');db[_0x94d4('0xd2')]=db[_0x94d4('0x4')]['import'](_0x94d4('0xd3'));db[_0x94d4('0xd4')]=db[_0x94d4('0x4')]['import'](_0x94d4('0xd5'));db['Setting']=db['sequelize'][_0x94d4('0x16')](_0x94d4('0xd6'));db[_0x94d4('0xd7')]=db[_0x94d4('0x4')][_0x94d4('0x16')]('../api/squareOdbc/squareOdbc.model');db['SquareProject']=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0xd8'));db[_0x94d4('0xd9')]=db[_0x94d4('0x4')]['import'](_0x94d4('0xda'));db[_0x94d4('0xdb')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0xdc'));db[_0x94d4('0xdd')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0xde'));db[_0x94d4('0xdf')]=db[_0x94d4('0x4')]['import'](_0x94d4('0xe0'));db['Campaign']=db['sequelize']['import']('../api/campaign/campaign.model');db[_0x94d4('0xe1')]=db['sequelize'][_0x94d4('0x16')](_0x94d4('0xe2'));db['Attachment']=db['sequelize'][_0x94d4('0x16')](_0x94d4('0xe3'));db['Plugin']=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0xe4'));db[_0x94d4('0xe5')]=db['sequelize'][_0x94d4('0x16')](_0x94d4('0xe6'));db[_0x94d4('0xe7')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0xe8'));db['FaxTransferReport']=db['sequelize'][_0x94d4('0x16')](_0x94d4('0xe9'));db['OpenchannelTransferReport']=db['sequelize']['import']('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0x94d4('0xea')]=db[_0x94d4('0x4')][_0x94d4('0x16')]('../api/smsTransferReport/smsTransferReport.model');db['CmList']=db['sequelize'][_0x94d4('0x16')](_0x94d4('0xeb'));db[_0x94d4('0xec')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0xed'));db[_0x94d4('0xee')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0xef'));db[_0x94d4('0xf0')]=db['sequelize'][_0x94d4('0x16')]('../api/userProfileSection/userProfileSection.model');db[_0x94d4('0xf1')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0xf2'));db[_0x94d4('0xf3')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0xf4'));db[_0x94d4('0xf5')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0xf6'));db['CrmWorkflowStep']=db[_0x94d4('0x4')][_0x94d4('0x16')]('../api/crmWorkflowstep/crmWorkflowstep.model');db[_0x94d4('0xf7')]=db['sequelize'][_0x94d4('0x16')](_0x94d4('0xf8'));db[_0x94d4('0xf9')]=db[_0x94d4('0x4')][_0x94d4('0x16')]('../api/crmActionsList/crmActionsList.model');db[_0x94d4('0xfa')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0xfb'));db[_0x94d4('0xfc')]=db['sequelize']['import'](_0x94d4('0xfd'));db[_0x94d4('0xfe')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0xff'));db[_0x94d4('0x100')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x101'));db[_0x94d4('0x102')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x103'));db[_0x94d4('0x104')]=db['sequelize'][_0x94d4('0x16')](_0x94d4('0x105'));db[_0x94d4('0x106')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x107'));db[_0x94d4('0x108')]=db[_0x94d4('0x4')][_0x94d4('0x16')]('../api/saDossier/saDossier.model');db[_0x94d4('0x109')]=db[_0x94d4('0x4')][_0x94d4('0x16')]('../api/saRequest/saRequest.model');db[_0x94d4('0x10a')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x10b'));db[_0x94d4('0x10c')]=db[_0x94d4('0x4')]['import'](_0x94d4('0x10d'));db[_0x94d4('0x10e')]=db[_0x94d4('0x4')][_0x94d4('0x16')]('../api/saOrder/saOrder.model');db[_0x94d4('0x10f')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x110'));db[_0x94d4('0x111')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x112'));db['SAAsset']=db[_0x94d4('0x4')]['import'](_0x94d4('0x113'));db[_0x94d4('0x114')]=db[_0x94d4('0x4')]['import'](_0x94d4('0x115'));db[_0x94d4('0x116')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x117'));db[_0x94d4('0x118')]=db['sequelize'][_0x94d4('0x16')](_0x94d4('0x119'));db['SAPaymentMethod']=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x11a'));db[_0x94d4('0x11b')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x11c'));db[_0x94d4('0x11d')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x11e'));db[_0x94d4('0x11f')]=db[_0x94d4('0x4')][_0x94d4('0x16')]('../api/saInvoiceNumber/saInvoiceNumber.model');db[_0x94d4('0x120')]=db[_0x94d4('0x4')]['import']('../api/saCreditNoteNumber/saCreditNoteNumber.model');db[_0x94d4('0x121')]=db['sequelize'][_0x94d4('0x16')](_0x94d4('0x122'));db[_0x94d4('0x123')]=db[_0x94d4('0x4')][_0x94d4('0x16')](_0x94d4('0x124'));db[_0x94d4('0x125')][_0x94d4('0x126')](db[_0x94d4('0x127')],{'as':_0x94d4('0x127'),'onDelete':_0x94d4('0x128'),'foreignKey':'UserId'});db[_0x94d4('0x125')]['hasMany'](db[_0x94d4('0x1d')],{'as':_0x94d4('0x129'),'foreignKey':_0x94d4('0x12a')});db[_0x94d4('0x125')][_0x94d4('0x12b')](db[_0x94d4('0x2d')],{'as':_0x94d4('0x12c'),'foreignKey':_0x94d4('0x12a')});db[_0x94d4('0x125')][_0x94d4('0x12b')](db[_0x94d4('0x18')],{'as':_0x94d4('0x12d'),'onDelete':_0x94d4('0x128'),'hooks':!![]});db['User']['hasMany'](db[_0x94d4('0x12e')],{'as':_0x94d4('0x12f'),'foreignKey':_0x94d4('0x12a')});db[_0x94d4('0x125')][_0x94d4('0x12b')](db[_0x94d4('0x130')],{'as':'HopperHistory','foreignKey':'UserId'});db[_0x94d4('0x125')][_0x94d4('0x12b')](db[_0x94d4('0x7a')],{'as':_0x94d4('0x7a'),'foreignKey':_0x94d4('0x12a')});db[_0x94d4('0x125')][_0x94d4('0x12b')](db[_0x94d4('0x131')],{'as':'OpenchannelInteractions','foreignKey':_0x94d4('0x12a')});db[_0x94d4('0x125')][_0x94d4('0x12b')](db[_0x94d4('0x67')],{'as':_0x94d4('0x132'),'foreignKey':_0x94d4('0x12a')});db[_0x94d4('0x125')]['hasMany'](db[_0x94d4('0x58')],{'as':_0x94d4('0x133'),'foreignKey':_0x94d4('0x12a')});db['User'][_0x94d4('0x12b')](db[_0x94d4('0x4f')],{'as':'FaxInteractions','foreignKey':_0x94d4('0x12a')});db['User'][_0x94d4('0x12b')](db[_0x94d4('0x41')],{'as':'MailInteractions','foreignKey':_0x94d4('0x12a')});db['User'][_0x94d4('0x134')](db[_0x94d4('0xee')],{'as':_0x94d4('0xee'),'foreignKey':'userProfileId'});db[_0x94d4('0x125')][_0x94d4('0x135')](db['ChatGroup'],{'as':_0x94d4('0x136'),'through':_0x94d4('0x137')});db[_0x94d4('0x125')][_0x94d4('0x135')](db[_0x94d4('0x72')],{'as':_0x94d4('0x138'),'through':_0x94d4('0x139')});db[_0x94d4('0x125')][_0x94d4('0x135')](db['CmList'],{'as':_0x94d4('0x13a'),'through':_0x94d4('0x13b')});db[_0x94d4('0x125')][_0x94d4('0x135')](db[_0x94d4('0xdd')],{'through':'user_has_teams'});db['User'][_0x94d4('0x135')](db[_0x94d4('0x41')],{'as':_0x94d4('0x13c'),'through':_0x94d4('0x13d')});db['User'][_0x94d4('0x135')](db[_0x94d4('0x67')],{'as':_0x94d4('0x132'),'through':'user_has_chat_interactions'});db['User'][_0x94d4('0x135')](db[_0x94d4('0x4f')],{'as':_0x94d4('0x13e'),'through':'user_has_fax_interactions'});db[_0x94d4('0x125')][_0x94d4('0x135')](db[_0x94d4('0x58')],{'as':_0x94d4('0x133'),'through':_0x94d4('0x13f')});db[_0x94d4('0x125')][_0x94d4('0x135')](db['OpenchannelInteraction'],{'as':_0x94d4('0x140'),'through':'user_has_openchannel_interactions'});db[_0x94d4('0x125')][_0x94d4('0x135')](db['VoiceQueue'],{'as':_0x94d4('0x141'),'through':_0x94d4('0x2f'),'required':![]});db['User'][_0x94d4('0x135')](db[_0x94d4('0x142')],{'as':_0x94d4('0x143'),'through':_0x94d4('0x33'),'required':![]});db[_0x94d4('0x125')][_0x94d4('0x135')](db[_0x94d4('0x6b')],{'as':'ChatQueues','through':_0x94d4('0x31'),'required':![],'hooks':!![]});db['User']['belongsToMany'](db['FaxQueue'],{'as':_0x94d4('0x144'),'through':'UserFaxQueue','required':![]});db['User'][_0x94d4('0x135')](db[_0x94d4('0x5b')],{'as':_0x94d4('0x145'),'through':'UserSmsQueue','required':![]});db[_0x94d4('0x125')]['belongsToMany'](db[_0x94d4('0x63')],{'as':_0x94d4('0x146'),'through':_0x94d4('0x147'),'required':![]});db['User']['belongsToMany'](db[_0x94d4('0x148')],{'through':_0x94d4('0x13b')});db[_0x94d4('0x125')][_0x94d4('0x135')](db[_0x94d4('0xec')],{'as':_0x94d4('0x149'),'through':_0x94d4('0x14a'),'required':![]});db[_0x94d4('0x125')][_0x94d4('0x135')](db[_0x94d4('0x14b')],{'as':_0x94d4('0x14c'),'through':_0x94d4('0x14d')});db[_0x94d4('0x125')]['belongsToMany'](db[_0x94d4('0x4c')],{'as':_0x94d4('0x14e'),'through':'user_has_fax_accounts'});db[_0x94d4('0x125')]['belongsToMany'](db[_0x94d4('0x3c')],{'as':_0x94d4('0x14f'),'through':_0x94d4('0x150')});db['User'][_0x94d4('0x135')](db[_0x94d4('0x151')],{'as':_0x94d4('0x152'),'through':'user_has_openchannel_accounts'});db['User'][_0x94d4('0x135')](db[_0x94d4('0x55')],{'as':_0x94d4('0x153'),'through':'user_has_sms_accounts'});db[_0x94d4('0x125')][_0x94d4('0x135')](db[_0x94d4('0x154')],{'as':_0x94d4('0x155'),'through':'user_has_square_projects'});db[_0x94d4('0x15')][_0x94d4('0x12b')](db[_0x94d4('0x18')],{'as':'SpiedAgents','onDelete':_0x94d4('0x128'),'foreignKey':_0x94d4('0x156')});db[_0x94d4('0x157')][_0x94d4('0x12b')](db[_0x94d4('0x18')],{'onDelete':_0x94d4('0x128')});db[_0x94d4('0x18')][_0x94d4('0x12b')](db[_0x94d4('0x18')],{'as':'Applications','onDelete':_0x94d4('0x128')});db[_0x94d4('0x1a')]['belongsToMany'](db['Sound'],{'as':_0x94d4('0x158'),'through':_0x94d4('0x159')});db[_0x94d4('0x1c')][_0x94d4('0x12b')](db[_0x94d4('0x2d')],{'as':'Members','foreignKey':_0x94d4('0x15a')});db[_0x94d4('0x1c')]['hasMany'](db['CmHopper'],{'as':'Hoppers','foreignKey':_0x94d4('0x15a')});db[_0x94d4('0x1c')][_0x94d4('0x12b')](db[_0x94d4('0x12e')],{'as':_0x94d4('0x12f'),'foreignKey':_0x94d4('0x15a')});db[_0x94d4('0x1c')][_0x94d4('0x12b')](db[_0x94d4('0x130')],{'as':_0x94d4('0x15b'),'foreignKey':_0x94d4('0x15a')});db[_0x94d4('0x1c')]['hasMany'](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x94d4('0x15a')});db['VoiceQueue'][_0x94d4('0x12b')](db[_0x94d4('0x76')],{'as':_0x94d4('0x15c'),'foreignKey':'VoiceQueueId'});db[_0x94d4('0x1c')][_0x94d4('0x12b')](db[_0x94d4('0xcf')],{'as':_0x94d4('0x15d'),'foreignKey':_0x94d4('0x15a')});db[_0x94d4('0x1c')][_0x94d4('0x134')](db[_0x94d4('0x29')],{'as':_0x94d4('0x29'),'foreignKey':'TrunkId'});db['VoiceQueue'][_0x94d4('0x134')](db['Trunk'],{'as':_0x94d4('0x15e'),'foreignKey':_0x94d4('0x15f')});db[_0x94d4('0x1c')][_0x94d4('0x134')](db[_0x94d4('0x83')],{'as':'Interval','foreignKey':'IntervalId'});db[_0x94d4('0x1c')][_0x94d4('0x134')](db[_0x94d4('0x160')],{'as':_0x94d4('0x161'),'foreignKey':_0x94d4('0x162')});db['VoiceQueue'][_0x94d4('0x135')](db[_0x94d4('0x148')],{'as':_0x94d4('0x13a'),'through':_0x94d4('0x163')});db[_0x94d4('0x1c')][_0x94d4('0x135')](db[_0x94d4('0x125')],{'as':_0x94d4('0x164'),'through':_0x94d4('0x2f')});db[_0x94d4('0x1c')][_0x94d4('0x135')](db[_0x94d4('0xdd')],{'as':_0x94d4('0x165'),'through':_0x94d4('0x166')});db[_0x94d4('0x1c')][_0x94d4('0x135')](db[_0x94d4('0x148')],{'as':_0x94d4('0x167'),'through':_0x94d4('0x168')});db[_0x94d4('0x1d')][_0x94d4('0x134')](db[_0x94d4('0x125')],{'as':'User','foreignKey':_0x94d4('0x12a')});db['ScreenRecording']['belongsTo'](db['User'],{'as':'User','foreignKey':_0x94d4('0x12a')});db[_0x94d4('0x127')][_0x94d4('0x12b')](db['VoiceMailMessage'],{'as':_0x94d4('0x169'),'onDelete':_0x94d4('0x128'),'foreignKey':_0x94d4('0x16a'),'sourceKey':'mailbox'});db[_0x94d4('0x16b')][_0x94d4('0x134')](db[_0x94d4('0x127')],{'foreignKey':_0x94d4('0x16a'),'targetKey':'mailbox'});db[_0x94d4('0x16c')]['hasMany'](db[_0x94d4('0x25')],{'as':_0x94d4('0x16d'),'foreignKey':_0x94d4('0x16e'),'constraints':![]});db[_0x94d4('0x16c')][_0x94d4('0x12b')](db[_0x94d4('0x23')],{'as':_0x94d4('0x16f'),'foreignKey':'uniqueid','constraints':![]});db[_0x94d4('0x16c')][_0x94d4('0x134')](db[_0x94d4('0x125')],{'as':_0x94d4('0x125'),'foreignKey':_0x94d4('0x12a')});db['VoiceCallReport'][_0x94d4('0x134')](db['CmContact'],{'as':_0x94d4('0x170'),'foreignKey':'ContactId'});db[_0x94d4('0x3a')][_0x94d4('0x134')](db[_0x94d4('0x3c')],{'as':_0x94d4('0x3c'),'foreignKey':_0x94d4('0x171')});db[_0x94d4('0x172')][_0x94d4('0x134')](db['MailAccount'],{'as':_0x94d4('0x3c'),'foreignKey':'MailAccountId'});db['MailAccount'][_0x94d4('0x126')](db[_0x94d4('0x3a')],{'as':_0x94d4('0x173'),'onDelete':_0x94d4('0x128')});db[_0x94d4('0x3c')]['hasOne'](db[_0x94d4('0x172')],{'as':_0x94d4('0x174'),'onDelete':'cascade'});db[_0x94d4('0x3c')]['hasMany'](db[_0x94d4('0x175')],{'as':_0x94d4('0x176'),'foreignKey':_0x94d4('0x171')});db['MailAccount']['hasMany'](db[_0x94d4('0x7e')],{'as':'Answers','foreignKey':'MailAccountId'});db['MailAccount'][_0x94d4('0x12b')](db['MailMessage'],{'as':_0x94d4('0x169'),'foreignKey':'MailAccountId'});db[_0x94d4('0x3c')][_0x94d4('0x12b')](db[_0x94d4('0x41')],{'as':_0x94d4('0x177')});db[_0x94d4('0x3c')]['hasMany'](db[_0x94d4('0x45')],{'as':_0x94d4('0x178')});db[_0x94d4('0x3c')][_0x94d4('0x134')](db[_0x94d4('0x148')],{'as':_0x94d4('0x179'),'foreignKey':_0x94d4('0x17a')});db[_0x94d4('0x3c')]['belongsTo'](db[_0x94d4('0x8a')],{'as':_0x94d4('0x8a'),'foreignKey':_0x94d4('0x17b')});db[_0x94d4('0x3c')][_0x94d4('0x134')](db[_0x94d4('0x160')],{'as':_0x94d4('0x161'),'foreignKey':_0x94d4('0x162')});db['MailAccount'][_0x94d4('0x135')](db[_0x94d4('0x125')],{'as':_0x94d4('0x164'),'through':_0x94d4('0x150')});db['MailQueue'][_0x94d4('0x135')](db[_0x94d4('0x125')],{'as':_0x94d4('0x164'),'through':_0x94d4('0x33')});db['MailQueue'][_0x94d4('0x135')](db[_0x94d4('0xdd')],{'through':'team_has_mail_queues','as':_0x94d4('0x165')});db[_0x94d4('0x41')]['hasMany'](db['MailMessage'],{'as':'Messages','onDelete':_0x94d4('0x128'),'foreignKey':_0x94d4('0x17c')});db[_0x94d4('0x41')][_0x94d4('0x134')](db[_0x94d4('0x3c')],{'as':_0x94d4('0x17d'),'foreignKey':_0x94d4('0x171')});db[_0x94d4('0x41')][_0x94d4('0x134')](db[_0x94d4('0x72')],{'as':_0x94d4('0x170'),'foreignKey':'ContactId'});db[_0x94d4('0x41')][_0x94d4('0x134')](db[_0x94d4('0x125')],{'as':'Owner','foreignKey':'UserId'});db['MailInteraction'][_0x94d4('0x135')](db['Tag'],{'through':_0x94d4('0x17e'),'as':_0x94d4('0x17f')});db['MailInteraction'][_0x94d4('0x135')](db[_0x94d4('0x89')],{'through':_0x94d4('0x17e'),'as':'ThroughTags'});db['MailInteraction'][_0x94d4('0x135')](db['User'],{'as':'Users','through':_0x94d4('0x13d'),'foreignKey':_0x94d4('0x17c')});db[_0x94d4('0x43')][_0x94d4('0x12b')](db[_0x94d4('0x180')],{'as':_0x94d4('0x181'),'onDelete':_0x94d4('0x128')});db['MailMessage'][_0x94d4('0x134')](db[_0x94d4('0x125')],{'as':'User'});db[_0x94d4('0x43')][_0x94d4('0x134')](db[_0x94d4('0x72')],{'onDelete':_0x94d4('0x128'),'as':'Contact'});db[_0x94d4('0x43')][_0x94d4('0x134')](db[_0x94d4('0x41')],{'as':_0x94d4('0x182'),'foreignKey':_0x94d4('0x17c')});db[_0x94d4('0x43')]['belongsTo'](db[_0x94d4('0x3c')],{'as':'Account','foreignKey':_0x94d4('0x171')});db[_0x94d4('0x45')]['belongsTo'](db[_0x94d4('0x125')],{'onDelete':'restrict'});db[_0x94d4('0x45')][_0x94d4('0x134')](db[_0x94d4('0x142')],{'onDelete':_0x94d4('0x183')});db['MailApplication'][_0x94d4('0x134')](db[_0x94d4('0x3c')],{'onDelete':_0x94d4('0x183')});db[_0x94d4('0x45')][_0x94d4('0x134')](db[_0x94d4('0x83')],{'onDelete':'restrict','foreignKey':_0x94d4('0x184')});db[_0x94d4('0x45')]['belongsTo'](db[_0x94d4('0x89')],{'onDelete':_0x94d4('0x183'),'foreignKey':_0x94d4('0x185')});db[_0x94d4('0x47')]['belongsTo'](db[_0x94d4('0x3c')],{});db[_0x94d4('0x47')][_0x94d4('0x134')](db['CmList'],{'as':_0x94d4('0x179'),'foreignKey':_0x94d4('0x17a')});db['MailQueueReport'][_0x94d4('0x134')](db['CmContact'],{'as':_0x94d4('0x170'),'foreignKey':'ContactId'});db[_0x94d4('0x47')][_0x94d4('0x134')](db[_0x94d4('0x41')],{});db[_0x94d4('0x47')][_0x94d4('0x134')](db[_0x94d4('0x43')],{});db[_0x94d4('0x47')][_0x94d4('0x134')](db[_0x94d4('0x125')],{});db[_0x94d4('0x47')][_0x94d4('0x134')](db[_0x94d4('0x142')],{});db[_0x94d4('0x49')][_0x94d4('0x12b')](db[_0x94d4('0x4b')],{'as':'Items','onDelete':_0x94d4('0x128')});db['FaxAccount'][_0x94d4('0x12b')](db[_0x94d4('0x175')],{'as':_0x94d4('0x176'),'foreignKey':_0x94d4('0x186')});db['FaxAccount']['hasMany'](db['CannedAnswer'],{'as':_0x94d4('0x187'),'foreignKey':_0x94d4('0x186')});db[_0x94d4('0x4c')][_0x94d4('0x12b')](db[_0x94d4('0x4f')],{'as':'Interactions'});db[_0x94d4('0x4c')][_0x94d4('0x12b')](db[_0x94d4('0x188')],{'as':'Applications'});db[_0x94d4('0x4c')][_0x94d4('0x12b')](db[_0x94d4('0x18')],{'as':_0x94d4('0x189'),'onDelete':_0x94d4('0x128')});db['FaxAccount'][_0x94d4('0x12b')](db[_0x94d4('0x51')],{'as':_0x94d4('0x169')});db[_0x94d4('0x4c')]['belongsTo'](db[_0x94d4('0x29')],{'as':_0x94d4('0x29')});db[_0x94d4('0x4c')]['belongsTo'](db[_0x94d4('0x148')],{'as':_0x94d4('0x179'),'foreignKey':_0x94d4('0x17a')});db['FaxAccount']['belongsTo'](db[_0x94d4('0x160')],{'as':_0x94d4('0x161'),'foreignKey':_0x94d4('0x162')});db[_0x94d4('0x4c')][_0x94d4('0x135')](db[_0x94d4('0x125')],{'as':_0x94d4('0x164'),'through':_0x94d4('0x18a')});db['FaxApplication'][_0x94d4('0x134')](db[_0x94d4('0x125')],{'onDelete':_0x94d4('0x183')});db['FaxApplication'][_0x94d4('0x134')](db[_0x94d4('0x18b')],{'onDelete':_0x94d4('0x183')});db['FaxApplication']['belongsTo'](db[_0x94d4('0x4c')],{'onDelete':_0x94d4('0x183')});db[_0x94d4('0x188')]['belongsTo'](db['Tag'],{'onDelete':_0x94d4('0x183'),'foreignKey':_0x94d4('0x185')});db[_0x94d4('0x4f')][_0x94d4('0x12b')](db[_0x94d4('0x51')],{'as':'Messages','onDelete':'cascade','foreignKey':'FaxInteractionId'});db[_0x94d4('0x4f')][_0x94d4('0x134')](db[_0x94d4('0x4c')],{'as':_0x94d4('0x17d'),'foreignKey':_0x94d4('0x186')});db[_0x94d4('0x4f')]['belongsTo'](db[_0x94d4('0x72')],{'as':'Contact','foreignKey':_0x94d4('0x18c')});db['FaxInteraction'][_0x94d4('0x134')](db['User'],{'as':_0x94d4('0x18d'),'foreignKey':_0x94d4('0x12a')});db[_0x94d4('0x4f')][_0x94d4('0x135')](db[_0x94d4('0x89')],{'through':_0x94d4('0x18e'),'as':_0x94d4('0x17f')});db[_0x94d4('0x4f')][_0x94d4('0x135')](db['Tag'],{'through':_0x94d4('0x18e'),'as':_0x94d4('0x18f')});db['FaxInteraction'][_0x94d4('0x135')](db[_0x94d4('0x125')],{'as':_0x94d4('0x190'),'through':_0x94d4('0x191'),'foreignKey':'FaxInteractionId'});db[_0x94d4('0x51')][_0x94d4('0x134')](db[_0x94d4('0x125')],{'onDelete':_0x94d4('0x128'),'as':_0x94d4('0x125')});db['FaxMessage'][_0x94d4('0x134')](db[_0x94d4('0x4f')],{'as':_0x94d4('0x182'),'foreignKey':_0x94d4('0x192')});db[_0x94d4('0x51')][_0x94d4('0x134')](db[_0x94d4('0x72')],{'onDelete':_0x94d4('0x128'),'as':_0x94d4('0x170')});db[_0x94d4('0x51')]['belongsTo'](db[_0x94d4('0x180')],{'as':'Attachment','foreignKey':_0x94d4('0x193')});db[_0x94d4('0x51')]['belongsTo'](db[_0x94d4('0x4c')],{'as':_0x94d4('0x17d'),'foreignKey':_0x94d4('0x186')});db[_0x94d4('0x18b')][_0x94d4('0x135')](db['User'],{'as':_0x94d4('0x164'),'through':_0x94d4('0x35')});db['FaxQueue'][_0x94d4('0x135')](db['Team'],{'through':_0x94d4('0x194'),'as':_0x94d4('0x165')});db['FaxQueueReport'][_0x94d4('0x134')](db[_0x94d4('0x4c')],{});db[_0x94d4('0x53')][_0x94d4('0x134')](db[_0x94d4('0x148')],{'as':_0x94d4('0x179'),'foreignKey':_0x94d4('0x17a')});db['FaxQueueReport']['belongsTo'](db[_0x94d4('0x72')],{'as':_0x94d4('0x170'),'foreignKey':_0x94d4('0x18c')});db[_0x94d4('0x53')][_0x94d4('0x134')](db[_0x94d4('0x4f')],{});db[_0x94d4('0x53')]['belongsTo'](db[_0x94d4('0x51')],{});db[_0x94d4('0x53')]['belongsTo'](db['User'],{});db[_0x94d4('0x53')][_0x94d4('0x134')](db[_0x94d4('0x18b')],{});db['SmsAccount'][_0x94d4('0x12b')](db[_0x94d4('0x175')],{'as':_0x94d4('0x176'),'foreignKey':_0x94d4('0x195')});db[_0x94d4('0x55')][_0x94d4('0x12b')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x94d4('0x195')});db[_0x94d4('0x55')]['hasMany'](db[_0x94d4('0x196')],{'as':_0x94d4('0x169'),'foreignKey':'SmsAccountId'});db[_0x94d4('0x55')][_0x94d4('0x12b')](db[_0x94d4('0x58')],{'as':_0x94d4('0x177')});db[_0x94d4('0x55')][_0x94d4('0x12b')](db[_0x94d4('0x57')],{'as':'Applications'});db['SmsAccount'][_0x94d4('0x134')](db[_0x94d4('0x148')],{'as':'List','foreignKey':_0x94d4('0x17a')});db['SmsAccount'][_0x94d4('0x134')](db[_0x94d4('0x160')],{'as':_0x94d4('0x161'),'foreignKey':_0x94d4('0x162')});db[_0x94d4('0x55')][_0x94d4('0x135')](db[_0x94d4('0x125')],{'as':_0x94d4('0x164'),'through':'user_has_sms_accounts'});db[_0x94d4('0x57')][_0x94d4('0x134')](db[_0x94d4('0x125')],{'onDelete':'restrict'});db['SmsApplication'][_0x94d4('0x134')](db[_0x94d4('0x5b')],{'onDelete':_0x94d4('0x183')});db['SmsApplication'][_0x94d4('0x134')](db[_0x94d4('0x55')],{'onDelete':_0x94d4('0x183')});db['SmsApplication'][_0x94d4('0x134')](db[_0x94d4('0x83')],{'onDelete':'restrict','foreignKey':_0x94d4('0x184')});db[_0x94d4('0x57')][_0x94d4('0x134')](db['Tag'],{'onDelete':_0x94d4('0x183'),'foreignKey':_0x94d4('0x185')});db[_0x94d4('0x58')][_0x94d4('0x12b')](db[_0x94d4('0x196')],{'as':'Messages','onDelete':_0x94d4('0x128'),'foreignKey':_0x94d4('0x197')});db['SmsInteraction'][_0x94d4('0x134')](db['SmsAccount'],{'as':'Account','foreignKey':'SmsAccountId'});db[_0x94d4('0x58')][_0x94d4('0x134')](db[_0x94d4('0x72')],{'as':_0x94d4('0x170'),'foreignKey':_0x94d4('0x18c')});db[_0x94d4('0x58')][_0x94d4('0x134')](db[_0x94d4('0x125')],{'as':_0x94d4('0x18d'),'foreignKey':_0x94d4('0x12a')});db[_0x94d4('0x58')]['belongsToMany'](db[_0x94d4('0x89')],{'through':_0x94d4('0x198'),'as':'Tags'});db[_0x94d4('0x58')][_0x94d4('0x135')](db[_0x94d4('0x89')],{'through':'sms_interaction_has_tags','as':_0x94d4('0x18f')});db['SmsInteraction'][_0x94d4('0x135')](db[_0x94d4('0x125')],{'as':'Users','through':_0x94d4('0x13f'),'foreignKey':_0x94d4('0x197')});db['SmsMessage'][_0x94d4('0x134')](db[_0x94d4('0x125')],{'as':_0x94d4('0x125')});db[_0x94d4('0x196')][_0x94d4('0x134')](db[_0x94d4('0x72')],{'onDelete':'cascade','as':_0x94d4('0x170')});db['SmsMessage'][_0x94d4('0x134')](db[_0x94d4('0x58')],{'onDelete':_0x94d4('0x128'),'as':_0x94d4('0x182'),'foreignKey':_0x94d4('0x197')});db['SmsMessage'][_0x94d4('0x134')](db[_0x94d4('0x55')],{'as':'Account','foreignKey':_0x94d4('0x195')});db['SmsQueue']['belongsToMany'](db[_0x94d4('0x125')],{'as':_0x94d4('0x164'),'through':'UserSmsQueue','foreignKey':_0x94d4('0x199')});db[_0x94d4('0x5b')][_0x94d4('0x135')](db['Team'],{'through':_0x94d4('0x19a'),'as':_0x94d4('0x165')});db['OpenchannelAccount'][_0x94d4('0x12b')](db[_0x94d4('0x175')],{'as':_0x94d4('0x176'),'foreignKey':_0x94d4('0x19b')});db[_0x94d4('0x151')]['hasMany'](db[_0x94d4('0x7e')],{'as':_0x94d4('0x187'),'foreignKey':_0x94d4('0x19b')});db['OpenchannelAccount'][_0x94d4('0x12b')](db[_0x94d4('0x131')],{'as':'Interactions','foreignKey':_0x94d4('0x19b')});db[_0x94d4('0x151')][_0x94d4('0x12b')](db[_0x94d4('0x61')],{'as':_0x94d4('0x169'),'foreignKey':_0x94d4('0x19b')});db[_0x94d4('0x151')]['hasMany'](db[_0x94d4('0x5e')],{'as':_0x94d4('0x178'),'foreignKey':_0x94d4('0x19b')});db[_0x94d4('0x151')][_0x94d4('0x134')](db[_0x94d4('0x148')],{'as':_0x94d4('0x179'),'foreignKey':'ListId'});db[_0x94d4('0x151')][_0x94d4('0x134')](db[_0x94d4('0x160')],{'as':_0x94d4('0x161'),'foreignKey':_0x94d4('0x162')});db[_0x94d4('0x151')][_0x94d4('0x135')](db[_0x94d4('0x125')],{'as':_0x94d4('0x164'),'through':_0x94d4('0x19c')});db[_0x94d4('0x5e')][_0x94d4('0x134')](db[_0x94d4('0x125')],{'onDelete':_0x94d4('0x183')});db[_0x94d4('0x5e')][_0x94d4('0x134')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0x94d4('0x19d')});db['OpenchannelApplication']['belongsTo'](db['OpenchannelAccount'],{'onDelete':_0x94d4('0x183'),'foreignKey':_0x94d4('0x19b')});db[_0x94d4('0x5e')][_0x94d4('0x134')](db['Interval'],{'onDelete':_0x94d4('0x183'),'foreignKey':_0x94d4('0x184')});db[_0x94d4('0x5e')]['belongsTo'](db[_0x94d4('0x89')],{'onDelete':_0x94d4('0x183'),'foreignKey':'TagId'});db['OpenchannelInteraction'][_0x94d4('0x12b')](db[_0x94d4('0x61')],{'as':'Messages','onDelete':_0x94d4('0x128'),'foreignKey':_0x94d4('0x19e')});db['OpenchannelInteraction'][_0x94d4('0x134')](db[_0x94d4('0x151')],{'as':_0x94d4('0x17d'),'foreignKey':_0x94d4('0x19b')});db[_0x94d4('0x131')][_0x94d4('0x134')](db['CmContact'],{'as':_0x94d4('0x170'),'foreignKey':'ContactId'});db[_0x94d4('0x131')][_0x94d4('0x134')](db[_0x94d4('0x125')],{'as':_0x94d4('0x18d'),'foreignKey':_0x94d4('0x12a')});db[_0x94d4('0x131')][_0x94d4('0x135')](db['Tag'],{'through':_0x94d4('0x19f'),'as':_0x94d4('0x17f')});db['OpenchannelInteraction']['belongsToMany'](db['Tag'],{'through':_0x94d4('0x19f'),'as':_0x94d4('0x18f')});db[_0x94d4('0x131')][_0x94d4('0x135')](db[_0x94d4('0x125')],{'as':_0x94d4('0x190'),'through':_0x94d4('0x1a0'),'foreignKey':_0x94d4('0x19e')});db[_0x94d4('0x61')]['belongsTo'](db['User'],{'onDelete':'cascade','as':'User'});db[_0x94d4('0x61')][_0x94d4('0x134')](db[_0x94d4('0x72')],{'onDelete':_0x94d4('0x128'),'as':_0x94d4('0x170')});db['OpenchannelMessage'][_0x94d4('0x134')](db[_0x94d4('0x131')],{'onDelete':'cascade','as':_0x94d4('0x182'),'foreignKey':_0x94d4('0x19e')});db[_0x94d4('0x61')][_0x94d4('0x134')](db[_0x94d4('0x180')],{'as':_0x94d4('0x180'),'foreignKey':_0x94d4('0x193')});db[_0x94d4('0x61')]['belongsTo'](db[_0x94d4('0x151')],{'as':_0x94d4('0x17d'),'foreignKey':_0x94d4('0x19b')});db[_0x94d4('0x63')][_0x94d4('0x135')](db[_0x94d4('0x125')],{'as':'Agents','through':'UserOpenchannelQueue','foreignKey':_0x94d4('0x19d')});db[_0x94d4('0x63')]['belongsToMany'](db[_0x94d4('0xdd')],{'through':_0x94d4('0x1a1'),'as':'Teams'});db[_0x94d4('0x14b')][_0x94d4('0x12b')](db[_0x94d4('0x175')],{'as':'Dispositions','foreignKey':'ChatWebsiteId'});db[_0x94d4('0x14b')][_0x94d4('0x12b')](db[_0x94d4('0x7e')],{'as':_0x94d4('0x187'),'foreignKey':_0x94d4('0x1a2')});db[_0x94d4('0x14b')]['hasMany'](db[_0x94d4('0x6e')],{'as':'ProactiveActions'});db[_0x94d4('0x14b')][_0x94d4('0x12b')](db[_0x94d4('0x67')],{'as':_0x94d4('0x177')});db['ChatWebsite']['hasMany'](db[_0x94d4('0x1a3')],{'as':_0x94d4('0x178')});db[_0x94d4('0x14b')]['hasMany'](db[_0x94d4('0x68')],{'as':_0x94d4('0x169')});db[_0x94d4('0x14b')]['belongsTo'](db[_0x94d4('0x148')],{'as':_0x94d4('0x179'),'foreignKey':_0x94d4('0x17a')});db[_0x94d4('0x14b')]['belongsTo'](db[_0x94d4('0x83')],{'as':_0x94d4('0x83'),'foreignKey':_0x94d4('0x184')});db['ChatWebsite'][_0x94d4('0x134')](db[_0x94d4('0x160')],{'as':'mandatoryDispositionPause','foreignKey':_0x94d4('0x162')});db[_0x94d4('0x14b')]['belongsToMany'](db['User'],{'as':'Agents','through':'user_has_chat_websites'});db[_0x94d4('0x66')][_0x94d4('0x134')](db[_0x94d4('0x151')],{});db[_0x94d4('0x66')][_0x94d4('0x134')](db['CmList'],{'as':'List','foreignKey':_0x94d4('0x17a')});db[_0x94d4('0x66')][_0x94d4('0x134')](db['CmContact'],{'as':_0x94d4('0x170'),'foreignKey':_0x94d4('0x18c')});db[_0x94d4('0x66')]['belongsTo'](db['OpenchannelInteraction'],{});db['OpenchannelQueueReport'][_0x94d4('0x134')](db[_0x94d4('0x61')],{});db[_0x94d4('0x66')][_0x94d4('0x134')](db[_0x94d4('0x125')],{});db[_0x94d4('0x66')][_0x94d4('0x134')](db[_0x94d4('0x63')],{});db[_0x94d4('0x1a3')][_0x94d4('0x134')](db[_0x94d4('0x125')],{'as':_0x94d4('0x1a4'),'foreignKey':'UserId','onDelete':_0x94d4('0x183')});db[_0x94d4('0x1a3')][_0x94d4('0x134')](db[_0x94d4('0x6b')],{'as':_0x94d4('0x1a5'),'foreignKey':'ChatQueueId','onDelete':_0x94d4('0x183')});db['ChatApplication'][_0x94d4('0x134')](db[_0x94d4('0x14b')],{'as':_0x94d4('0x1a6'),'foreignKey':_0x94d4('0x1a2'),'onDelete':_0x94d4('0x183')});db[_0x94d4('0x1a3')]['belongsTo'](db[_0x94d4('0x89')],{'onDelete':_0x94d4('0x183'),'foreignKey':_0x94d4('0x185')});db[_0x94d4('0x67')][_0x94d4('0x12b')](db[_0x94d4('0x68')],{'as':_0x94d4('0x169'),'onDelete':'cascade','foreignKey':_0x94d4('0x1a7')});db['ChatInteraction'][_0x94d4('0x134')](db[_0x94d4('0x14b')],{'as':'Account','foreignKey':_0x94d4('0x1a2')});db[_0x94d4('0x67')]['belongsTo'](db['CmContact'],{'as':_0x94d4('0x170'),'foreignKey':'ContactId'});db[_0x94d4('0x67')][_0x94d4('0x134')](db['User'],{'as':_0x94d4('0x18d'),'foreignKey':_0x94d4('0x12a')});db[_0x94d4('0x67')][_0x94d4('0x135')](db[_0x94d4('0x89')],{'through':_0x94d4('0x1a8'),'as':_0x94d4('0x17f')});db[_0x94d4('0x67')][_0x94d4('0x135')](db[_0x94d4('0x89')],{'through':_0x94d4('0x1a8'),'as':_0x94d4('0x18f')});db[_0x94d4('0x67')][_0x94d4('0x135')](db[_0x94d4('0x125')],{'as':'Users','through':_0x94d4('0x1a9'),'foreignKey':_0x94d4('0x1a7')});db[_0x94d4('0x68')][_0x94d4('0x134')](db['User'],{'onDelete':_0x94d4('0x128'),'as':'User'});db['ChatMessage'][_0x94d4('0x134')](db['CmContact'],{'onDelete':_0x94d4('0x128'),'as':_0x94d4('0x170'),'foreignKey':'ContactId'});db[_0x94d4('0x68')][_0x94d4('0x134')](db[_0x94d4('0x67')],{'onDelete':_0x94d4('0x128'),'as':_0x94d4('0x182'),'foreignKey':_0x94d4('0x1a7')});db[_0x94d4('0x68')][_0x94d4('0x134')](db[_0x94d4('0x180')],{'as':_0x94d4('0x180'),'foreignKey':_0x94d4('0x193')});db[_0x94d4('0x68')][_0x94d4('0x134')](db[_0x94d4('0x14b')],{'as':_0x94d4('0x17d'),'foreignKey':_0x94d4('0x1a2')});db[_0x94d4('0x6a')][_0x94d4('0x134')](db[_0x94d4('0x72')],{'onDelete':_0x94d4('0x128'),'as':_0x94d4('0x170'),'foreignKey':_0x94d4('0x18c')});db[_0x94d4('0x6a')][_0x94d4('0x134')](db[_0x94d4('0x14b')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x94d4('0x6b')][_0x94d4('0x135')](db[_0x94d4('0x125')],{'as':'Agents','through':'UserChatQueue','hooks':!![]});db['ChatQueue'][_0x94d4('0x135')](db[_0x94d4('0xdd')],{'through':_0x94d4('0x1aa'),'as':_0x94d4('0x165')});db['ChatGroup']['hasMany'](db[_0x94d4('0xc9')],{'as':_0x94d4('0x169'),'foreignKey':_0x94d4('0x1ab'),'onDelete':_0x94d4('0x128')});db['ChatGroup']['belongsToMany'](db[_0x94d4('0x125')],{'as':_0x94d4('0x1ac'),'through':_0x94d4('0x137')});db[_0x94d4('0x6e')][_0x94d4('0x134')](db[_0x94d4('0x14b')],{'as':'Website','foreignKey':_0x94d4('0x1a2')});db['CmCompany']['hasOne'](db[_0x94d4('0x70')],{'as':'RelatedCompany'});db[_0x94d4('0x70')][_0x94d4('0x12b')](db[_0x94d4('0x72')],{'as':'Contacts','foreignKey':_0x94d4('0x1ad')});db[_0x94d4('0x70')][_0x94d4('0x12b')](db['SAPriceList'],{'as':_0x94d4('0x1ae'),'foreignKey':_0x94d4('0x1ad')});db[_0x94d4('0x70')][_0x94d4('0x12b')](db[_0x94d4('0x108')],{'as':_0x94d4('0x1af'),'foreignKey':'CompanyId'});db[_0x94d4('0x70')]['belongsTo'](db[_0x94d4('0x1b0')],{'as':_0x94d4('0x1b1'),'foreignKey':_0x94d4('0x1b2')});db[_0x94d4('0x72')]['hasMany'](db[_0x94d4('0x74')],{'as':_0x94d4('0x1b3'),'foreignKey':'ContactId'});db[_0x94d4('0x72')]['hasMany'](db[_0x94d4('0x12e')],{'as':'HopperFinals','foreignKey':'ContactId'});db[_0x94d4('0x72')][_0x94d4('0x12b')](db[_0x94d4('0x130')],{'as':_0x94d4('0x15b'),'foreignKey':_0x94d4('0x18c')});db[_0x94d4('0x72')]['hasMany'](db['ReportAgentPreview'],{'as':_0x94d4('0x7a'),'foreignKey':_0x94d4('0x18c')});db['CmContact']['hasMany'](db[_0x94d4('0xcf')],{'as':_0x94d4('0x15d'),'foreignKey':'ContactId'});db[_0x94d4('0x72')]['hasMany'](db[_0x94d4('0x131')],{'as':_0x94d4('0x140'),'foreignKey':_0x94d4('0x18c'),'onDelete':_0x94d4('0x183')});db[_0x94d4('0x72')][_0x94d4('0x12b')](db['ChatInteraction'],{'as':_0x94d4('0x132'),'foreignKey':_0x94d4('0x18c'),'onDelete':'restrict'});db[_0x94d4('0x72')][_0x94d4('0x12b')](db[_0x94d4('0x58')],{'as':'SmsInteractions','foreignKey':_0x94d4('0x18c'),'onDelete':_0x94d4('0x183')});db[_0x94d4('0x72')][_0x94d4('0x12b')](db['FaxInteraction'],{'as':_0x94d4('0x13e'),'foreignKey':_0x94d4('0x18c'),'onDelete':_0x94d4('0x183')});db[_0x94d4('0x72')][_0x94d4('0x12b')](db[_0x94d4('0x41')],{'as':'MailInteractions','foreignKey':_0x94d4('0x18c'),'onDelete':'restrict'});db['CmContact'][_0x94d4('0x12b')](db['SADossier'],{'as':_0x94d4('0x170'),'foreignKey':_0x94d4('0x18c'),'onDelete':'restrict'});db[_0x94d4('0x72')][_0x94d4('0x134')](db[_0x94d4('0x70')],{'as':_0x94d4('0x1b4'),'foreignKey':'CompanyId'});db['CmContact'][_0x94d4('0x134')](db['CmList'],{'as':_0x94d4('0x179'),'foreignKey':_0x94d4('0x17a'),'onDelete':_0x94d4('0x128')});db['CmContact'][_0x94d4('0x135')](db[_0x94d4('0x125')],{'as':'Users','through':'cm_user_has_contacts'});db[_0x94d4('0x72')][_0x94d4('0x135')](db[_0x94d4('0x89')],{'as':_0x94d4('0x17f'),'through':_0x94d4('0x1b5')});db['CmContact'][_0x94d4('0x135')](db[_0x94d4('0x89')],{'through':_0x94d4('0x1b5'),'as':_0x94d4('0x18f')});db['CmHopper']['belongsTo'](db[_0x94d4('0x72')],{'as':'Contact','foreignKey':_0x94d4('0x18c'),'onDelete':'cascade'});db['CmHopper'][_0x94d4('0x134')](db[_0x94d4('0x148')],{'as':_0x94d4('0x179'),'foreignKey':_0x94d4('0x17a'),'onDelete':_0x94d4('0x128')});db[_0x94d4('0x74')][_0x94d4('0x134')](db['User'],{'as':_0x94d4('0x1a4'),'foreignKey':_0x94d4('0x12a')});db[_0x94d4('0x74')][_0x94d4('0x134')](db[_0x94d4('0x1c')],{'as':'Queue','foreignKey':_0x94d4('0x15a'),'onDelete':_0x94d4('0x128')});db['CmHopper'][_0x94d4('0x134')](db[_0x94d4('0x1b6')],{'as':_0x94d4('0x1b6'),'foreignKey':_0x94d4('0x1b7'),'onDelete':_0x94d4('0x128')});db[_0x94d4('0x74')][_0x94d4('0x134')](db['User'],{'as':_0x94d4('0x18d'),'foreignKey':_0x94d4('0x1b8')});db[_0x94d4('0x76')][_0x94d4('0x134')](db['CmContact'],{'as':_0x94d4('0x170'),'foreignKey':_0x94d4('0x18c'),'onDelete':'cascade'});db[_0x94d4('0x76')]['belongsTo'](db[_0x94d4('0x148')],{'as':_0x94d4('0x179'),'foreignKey':_0x94d4('0x17a'),'onDelete':_0x94d4('0x128')});db[_0x94d4('0x76')][_0x94d4('0x134')](db['VoiceQueue'],{'as':_0x94d4('0x1a5'),'foreignKey':_0x94d4('0x15a'),'onDelete':'cascade'});db[_0x94d4('0x76')][_0x94d4('0x134')](db['Campaign'],{'as':_0x94d4('0x1b6'),'foreignKey':_0x94d4('0x1b7'),'onDelete':_0x94d4('0x128')});db[_0x94d4('0x7d')][_0x94d4('0x12b')](db[_0x94d4('0x81')],{'as':{'plural':'All','singular':_0x94d4('0x1b9')},'foreignKey':_0x94d4('0x1ba'),'onDelete':'cascade','hooks':!![]});db[_0x94d4('0x7d')][_0x94d4('0x12b')](db[_0x94d4('0x81')],{'as':{'plural':_0x94d4('0x1bb'),'singular':_0x94d4('0x1bc')},'foreignKey':_0x94d4('0x1bd'),'onDelete':_0x94d4('0x128'),'hooks':!![]});db[_0x94d4('0x7d')]['hasMany'](db['Action'],{'as':_0x94d4('0x1be'),'foreignKey':_0x94d4('0x1bf'),'onDelete':'cascade','hooks':!![]});db['Interval']['hasMany'](db[_0x94d4('0x83')],{'as':_0x94d4('0x1c0'),'foreignKey':_0x94d4('0x184'),'onDelete':_0x94d4('0x128'),'hooks':!![],'required':![]});db[_0x94d4('0x83')][_0x94d4('0x12b')](db[_0x94d4('0x18')],{'as':_0x94d4('0x12d'),'foreignKey':_0x94d4('0x184'),'onDelete':_0x94d4('0x183')});db[_0x94d4('0x83')][_0x94d4('0x12b')](db[_0x94d4('0x45')],{'as':_0x94d4('0x1c1'),'foreignKey':_0x94d4('0x184')});db[_0x94d4('0x83')][_0x94d4('0x12b')](db['ChatApplication'],{'as':_0x94d4('0x1c2'),'foreignKey':_0x94d4('0x184')});db[_0x94d4('0x83')]['hasMany'](db[_0x94d4('0x188')],{'as':_0x94d4('0x1c3'),'foreignKey':_0x94d4('0x184')});db[_0x94d4('0x83')][_0x94d4('0x12b')](db[_0x94d4('0x57')],{'as':'SmsApplications','foreignKey':_0x94d4('0x184')});db[_0x94d4('0x1c4')][_0x94d4('0x134')](db[_0x94d4('0x3c')],{});db[_0x94d4('0x1c4')][_0x94d4('0x134')](db[_0x94d4('0x94')],{'foreignKey':_0x94d4('0x1c5')});db[_0x94d4('0x1c4')][_0x94d4('0x134')](db['AnalyticCustomReport'],{'foreignKey':_0x94d4('0x1c6')});db[_0x94d4('0x87')][_0x94d4('0x135')](db[_0x94d4('0x1a')],{'as':_0x94d4('0x1c7'),'through':_0x94d4('0x159'),'onDelete':_0x94d4('0x183')});db[_0x94d4('0x89')][_0x94d4('0x135')](db[_0x94d4('0x72')],{'through':_0x94d4('0x1b5')});db[_0x94d4('0x89')]['belongsToMany'](db['ChatInteraction'],{'through':_0x94d4('0x1a8')});db[_0x94d4('0x89')][_0x94d4('0x135')](db[_0x94d4('0x41')],{'through':'mail_interaction_has_tags'});db['Tag']['belongsToMany'](db[_0x94d4('0x58')],{'through':_0x94d4('0x198')});db[_0x94d4('0x89')][_0x94d4('0x135')](db['FaxInteraction'],{'through':_0x94d4('0x18e')});db[_0x94d4('0x89')][_0x94d4('0x135')](db[_0x94d4('0x131')],{'through':_0x94d4('0x19f')});db[_0x94d4('0x8c')][_0x94d4('0x12b')](db[_0x94d4('0x81')],{'as':{'plural':_0x94d4('0x1c8'),'singular':'AllCondition'},'foreignKey':_0x94d4('0x1c9'),'onDelete':_0x94d4('0x128'),'hooks':!![]});db[_0x94d4('0x8c')][_0x94d4('0x12b')](db[_0x94d4('0x81')],{'as':{'plural':_0x94d4('0x1ca'),'singular':_0x94d4('0x1cb')},'foreignKey':_0x94d4('0x1cc'),'onDelete':_0x94d4('0x128'),'hooks':!![]});db[_0x94d4('0x8c')][_0x94d4('0x12b')](db['Action'],{'as':'Actions','foreignKey':_0x94d4('0x1cd'),'onDelete':_0x94d4('0x128'),'hooks':!![]});db[_0x94d4('0x92')]['hasMany'](db[_0x94d4('0x99')],{'as':'Fields','onDelete':_0x94d4('0x128'),'foreignKey':'CustomReportId','hooks':!![]});db[_0x94d4('0x94')][_0x94d4('0x12b')](db[_0x94d4('0x99')],{'as':_0x94d4('0x1ce'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db['AnalyticMetric'][_0x94d4('0x12b')](db['AnalyticFieldReport'],{'as':_0x94d4('0x1ce'),'onDelete':_0x94d4('0x128'),'foreignKey':_0x94d4('0x1cf')});db[_0x94d4('0x99')]['belongsTo'](db[_0x94d4('0x1d0')],{'foreignKey':_0x94d4('0x1cf')});db[_0x94d4('0x9d')][_0x94d4('0x12b')](db['SalesforceConfiguration'],{'as':_0x94d4('0x1d1'),'onDelete':'cascade','foreignKey':_0x94d4('0x1d2')});db[_0x94d4('0x9f')][_0x94d4('0x12b')](db[_0x94d4('0xa1')],{'as':_0x94d4('0x1d3'),'onDelete':_0x94d4('0x128'),'foreignKey':'SubjectId'});db[_0x94d4('0x9f')][_0x94d4('0x12b')](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x94d4('0x128'),'foreignKey':_0x94d4('0x1d4')});db['SalesforceConfiguration'][_0x94d4('0x12b')](db[_0x94d4('0xa1')],{'as':_0x94d4('0x1ce'),'onDelete':_0x94d4('0x128'),'foreignKey':_0x94d4('0x1d5')});db[_0x94d4('0x9f')][_0x94d4('0x134')](db[_0x94d4('0x9d')],{'as':_0x94d4('0x17d'),'foreignKey':_0x94d4('0x1d2')});db[_0x94d4('0xa1')][_0x94d4('0x12b')](db[_0x94d4('0xa1')],{'as':_0x94d4('0x1d6'),'foreignKey':'SubjectId'});db[_0x94d4('0xa1')][_0x94d4('0x12b')](db[_0x94d4('0xa1')],{'as':_0x94d4('0x1d7'),'foreignKey':_0x94d4('0x1d4')});db[_0x94d4('0xa1')]['hasMany'](db[_0x94d4('0xa1')],{'as':_0x94d4('0x1d8'),'foreignKey':_0x94d4('0x1d5')});db['SalesforceField']['belongsTo'](db[_0x94d4('0x1d9')],{'as':_0x94d4('0x1d9'),'foreignKey':_0x94d4('0x1da')});db[_0x94d4('0xa2')][_0x94d4('0x12b')](db['SugarcrmConfiguration'],{'as':_0x94d4('0x1d1'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x94d4('0xa4')][_0x94d4('0x12b')](db[_0x94d4('0xa6')],{'as':_0x94d4('0x1d3'),'onDelete':_0x94d4('0x128'),'foreignKey':_0x94d4('0x1db')});db[_0x94d4('0xa4')][_0x94d4('0x12b')](db[_0x94d4('0xa6')],{'as':_0x94d4('0x1dc'),'onDelete':_0x94d4('0x128'),'foreignKey':_0x94d4('0x1d4')});db[_0x94d4('0xa4')][_0x94d4('0x12b')](db[_0x94d4('0xa6')],{'as':_0x94d4('0x1ce'),'onDelete':_0x94d4('0x128'),'foreignKey':_0x94d4('0x1d5')});db[_0x94d4('0xa4')][_0x94d4('0x134')](db['SugarcrmAccount'],{'as':'Account','foreignKey':_0x94d4('0x1d2')});db['SugarcrmField'][_0x94d4('0x12b')](db[_0x94d4('0xa6')],{'as':_0x94d4('0x1d6'),'foreignKey':_0x94d4('0x1db')});db[_0x94d4('0xa6')][_0x94d4('0x12b')](db[_0x94d4('0xa6')],{'as':_0x94d4('0x1d7'),'foreignKey':_0x94d4('0x1d4')});db[_0x94d4('0xa6')][_0x94d4('0x12b')](db[_0x94d4('0xa6')],{'as':_0x94d4('0x1d8'),'foreignKey':_0x94d4('0x1d5')});db[_0x94d4('0xa6')][_0x94d4('0x134')](db['Variable'],{'as':_0x94d4('0x1d9'),'foreignKey':'VariableId'});db[_0x94d4('0x1dd')][_0x94d4('0x12b')](db['DeskConfiguration'],{'as':_0x94d4('0x1d1'),'onDelete':_0x94d4('0x128'),'foreignKey':_0x94d4('0x1d2')});db[_0x94d4('0xa8')]['hasMany'](db[_0x94d4('0xaa')],{'as':_0x94d4('0x1d3'),'onDelete':_0x94d4('0x128'),'foreignKey':_0x94d4('0x1db')});db[_0x94d4('0xa8')][_0x94d4('0x12b')](db[_0x94d4('0xaa')],{'as':_0x94d4('0x1dc'),'onDelete':'cascade','foreignKey':_0x94d4('0x1d4')});db['DeskConfiguration'][_0x94d4('0x12b')](db[_0x94d4('0xaa')],{'as':'Fields','onDelete':_0x94d4('0x128'),'foreignKey':'FieldId'});db[_0x94d4('0xa8')][_0x94d4('0x134')](db['DeskAccount'],{'as':_0x94d4('0x17d'),'foreignKey':_0x94d4('0x1d2')});db[_0x94d4('0xa8')][_0x94d4('0x135')](db[_0x94d4('0x89')],{'through':_0x94d4('0x1de')});db[_0x94d4('0xaa')][_0x94d4('0x12b')](db['DeskField'],{'as':_0x94d4('0x1d6'),'foreignKey':_0x94d4('0x1db')});db[_0x94d4('0xaa')]['hasMany'](db['DeskField'],{'as':_0x94d4('0x1d7'),'foreignKey':'DescriptionId'});db['DeskField'][_0x94d4('0x12b')](db[_0x94d4('0xaa')],{'as':'Field','foreignKey':_0x94d4('0x1d5')});db[_0x94d4('0xaa')][_0x94d4('0x134')](db[_0x94d4('0x1d9')],{'as':_0x94d4('0x1d9'),'foreignKey':_0x94d4('0x1da')});db[_0x94d4('0x1df')]['hasMany'](db[_0x94d4('0xac')],{'as':_0x94d4('0x1d1'),'onDelete':_0x94d4('0x128'),'foreignKey':_0x94d4('0x1d2')});db[_0x94d4('0xac')][_0x94d4('0x12b')](db[_0x94d4('0xae')],{'as':'Subjects','onDelete':_0x94d4('0x128'),'foreignKey':'SubjectId'});db[_0x94d4('0xac')]['hasMany'](db[_0x94d4('0xae')],{'as':_0x94d4('0x1dc'),'onDelete':_0x94d4('0x128'),'foreignKey':_0x94d4('0x1d4')});db['ZohoConfiguration'][_0x94d4('0x12b')](db[_0x94d4('0xae')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x94d4('0x1d5')});db[_0x94d4('0xac')][_0x94d4('0x134')](db[_0x94d4('0x1df')],{'as':_0x94d4('0x17d'),'foreignKey':_0x94d4('0x1d2')});db['ZohoField'][_0x94d4('0x12b')](db[_0x94d4('0xae')],{'as':_0x94d4('0x1d6'),'foreignKey':_0x94d4('0x1db')});db[_0x94d4('0xae')][_0x94d4('0x12b')](db[_0x94d4('0xae')],{'as':_0x94d4('0x1d7'),'foreignKey':_0x94d4('0x1d4')});db[_0x94d4('0xae')][_0x94d4('0x12b')](db[_0x94d4('0xae')],{'as':_0x94d4('0x1d8'),'foreignKey':_0x94d4('0x1d5')});db['ZohoField'][_0x94d4('0x134')](db[_0x94d4('0x1d9')],{'as':_0x94d4('0x1d9'),'foreignKey':_0x94d4('0x1da')});db['ZendeskAccount'][_0x94d4('0x12b')](db[_0x94d4('0x1e0')],{'as':_0x94d4('0x1d1'),'onDelete':_0x94d4('0x128'),'foreignKey':'AccountId'});db[_0x94d4('0x1e0')][_0x94d4('0x12b')](db[_0x94d4('0x1e1')],{'as':_0x94d4('0x1d3'),'foreignKey':_0x94d4('0x1db')});db['ZendeskConfiguration'][_0x94d4('0x12b')](db[_0x94d4('0x1e1')],{'as':_0x94d4('0x1dc'),'foreignKey':_0x94d4('0x1d4')});db[_0x94d4('0x1e0')][_0x94d4('0x12b')](db[_0x94d4('0x1e1')],{'as':_0x94d4('0x1ce'),'foreignKey':_0x94d4('0x1d5')});db[_0x94d4('0x1e0')]['belongsTo'](db[_0x94d4('0xb0')],{'as':_0x94d4('0x17d'),'foreignKey':'AccountId'});db[_0x94d4('0x1e0')][_0x94d4('0x135')](db['Tag'],{'through':_0x94d4('0x1e2')});db[_0x94d4('0x1e1')][_0x94d4('0x12b')](db[_0x94d4('0x1e1')],{'as':_0x94d4('0x1d6'),'foreignKey':'SubjectId'});db[_0x94d4('0x1e1')][_0x94d4('0x12b')](db[_0x94d4('0x1e1')],{'as':_0x94d4('0x1d7'),'foreignKey':'DescriptionId'});db['ZendeskField']['hasMany'](db[_0x94d4('0x1e1')],{'as':_0x94d4('0x1d8'),'foreignKey':_0x94d4('0x1d5')});db[_0x94d4('0x1e1')]['belongsTo'](db['Variable'],{'as':_0x94d4('0x1d9'),'foreignKey':_0x94d4('0x1da')});db['FreshdeskAccount'][_0x94d4('0x12b')](db[_0x94d4('0xb6')],{'as':_0x94d4('0x1d1'),'onDelete':_0x94d4('0x128'),'foreignKey':'AccountId'});db[_0x94d4('0xb6')]['hasMany'](db['FreshdeskField'],{'as':_0x94d4('0x1d3'),'onDelete':_0x94d4('0x128'),'foreignKey':_0x94d4('0x1db')});db[_0x94d4('0xb6')][_0x94d4('0x12b')](db[_0x94d4('0xb8')],{'as':_0x94d4('0x1dc'),'onDelete':_0x94d4('0x128'),'foreignKey':_0x94d4('0x1d4')});db[_0x94d4('0xb6')][_0x94d4('0x12b')](db['FreshdeskField'],{'as':_0x94d4('0x1ce'),'onDelete':_0x94d4('0x128'),'foreignKey':'FieldId'});db[_0x94d4('0xb6')][_0x94d4('0x134')](db['FreshdeskAccount'],{'as':_0x94d4('0x17d'),'foreignKey':'AccountId'});db[_0x94d4('0xb6')][_0x94d4('0x135')](db[_0x94d4('0x89')],{'through':'int_freshdesk_configuration_has_tags'});db['FreshdeskField'][_0x94d4('0x12b')](db[_0x94d4('0xb8')],{'as':_0x94d4('0x1d6'),'foreignKey':_0x94d4('0x1db')});db[_0x94d4('0xb8')][_0x94d4('0x12b')](db[_0x94d4('0xb8')],{'as':_0x94d4('0x1d7'),'foreignKey':_0x94d4('0x1d4')});db[_0x94d4('0xb8')][_0x94d4('0x12b')](db['FreshdeskField'],{'as':_0x94d4('0x1d8'),'foreignKey':_0x94d4('0x1d5')});db[_0x94d4('0xb8')][_0x94d4('0x134')](db[_0x94d4('0x1d9')],{'as':_0x94d4('0x1d9'),'foreignKey':_0x94d4('0x1da')});db[_0x94d4('0xba')][_0x94d4('0x12b')](db[_0x94d4('0xbc')],{'as':_0x94d4('0x1d1'),'onDelete':_0x94d4('0x128'),'foreignKey':_0x94d4('0x1d2')});db[_0x94d4('0xbc')][_0x94d4('0x12b')](db[_0x94d4('0xbd')],{'as':_0x94d4('0x1d3'),'foreignKey':'SubjectId'});db[_0x94d4('0xbc')][_0x94d4('0x12b')](db['VtigerField'],{'as':_0x94d4('0x1dc'),'foreignKey':_0x94d4('0x1d4')});db['VtigerConfiguration'][_0x94d4('0x12b')](db[_0x94d4('0xbd')],{'as':_0x94d4('0x1ce'),'foreignKey':_0x94d4('0x1d5')});db[_0x94d4('0xbc')][_0x94d4('0x134')](db[_0x94d4('0xba')],{'as':_0x94d4('0x17d'),'foreignKey':'AccountId'});db[_0x94d4('0xbc')][_0x94d4('0x135')](db[_0x94d4('0x89')],{'through':_0x94d4('0x1e3')});db[_0x94d4('0xbd')][_0x94d4('0x12b')](db[_0x94d4('0xbd')],{'as':_0x94d4('0x1d6'),'foreignKey':_0x94d4('0x1db')});db[_0x94d4('0xbd')]['hasMany'](db[_0x94d4('0xbd')],{'as':'Description','foreignKey':_0x94d4('0x1d4')});db[_0x94d4('0xbd')][_0x94d4('0x12b')](db[_0x94d4('0xbd')],{'as':_0x94d4('0x1d8'),'foreignKey':_0x94d4('0x1d5')});db['VtigerField']['belongsTo'](db[_0x94d4('0x1d9')],{'as':_0x94d4('0x1d9'),'foreignKey':_0x94d4('0x1da')});db[_0x94d4('0xbe')]['hasMany'](db['ServicenowConfiguration'],{'as':_0x94d4('0x1d1'),'onDelete':_0x94d4('0x128'),'foreignKey':_0x94d4('0x1d2')});db[_0x94d4('0x1e4')][_0x94d4('0x12b')](db[_0x94d4('0xc0')],{'as':_0x94d4('0x1d3'),'foreignKey':'SubjectId'});db[_0x94d4('0x1e4')][_0x94d4('0x12b')](db[_0x94d4('0xc0')],{'as':_0x94d4('0x1dc'),'foreignKey':_0x94d4('0x1d4')});db[_0x94d4('0x1e4')][_0x94d4('0x12b')](db[_0x94d4('0xc0')],{'as':'Fields','foreignKey':_0x94d4('0x1d5')});db['ServicenowConfiguration'][_0x94d4('0x134')](db['ServicenowAccount'],{'as':'Account','foreignKey':_0x94d4('0x1d2')});db['ServicenowField']['hasMany'](db[_0x94d4('0xc0')],{'as':_0x94d4('0x1d6'),'foreignKey':_0x94d4('0x1db')});db[_0x94d4('0xc0')][_0x94d4('0x12b')](db['ServicenowField'],{'as':'Description','foreignKey':_0x94d4('0x1d4')});db[_0x94d4('0xc0')][_0x94d4('0x12b')](db['ServicenowField'],{'as':_0x94d4('0x1d8'),'foreignKey':_0x94d4('0x1d5')});db[_0x94d4('0xc0')][_0x94d4('0x134')](db[_0x94d4('0x1d9')],{'as':'Variable','foreignKey':'VariableId'});db[_0x94d4('0x1e5')][_0x94d4('0x12b')](db[_0x94d4('0xc2')],{'as':'Configurations','onDelete':_0x94d4('0x128'),'foreignKey':'AccountId'});db[_0x94d4('0xc2')][_0x94d4('0x12b')](db[_0x94d4('0xc4')],{'as':_0x94d4('0x1d3'),'onDelete':'cascade','foreignKey':_0x94d4('0x1db')});db[_0x94d4('0xc2')][_0x94d4('0x12b')](db['Dynamics365Field'],{'as':_0x94d4('0x1dc'),'onDelete':_0x94d4('0x128'),'foreignKey':'DescriptionId'});db[_0x94d4('0xc2')][_0x94d4('0x12b')](db['Dynamics365Field'],{'as':_0x94d4('0x1ce'),'onDelete':_0x94d4('0x128'),'foreignKey':'FieldId'});db[_0x94d4('0xc2')]['belongsTo'](db[_0x94d4('0x1e5')],{'as':_0x94d4('0x17d'),'foreignKey':'AccountId'});db[_0x94d4('0xc4')]['hasMany'](db[_0x94d4('0xc4')],{'as':_0x94d4('0x1d6'),'foreignKey':_0x94d4('0x1db')});db[_0x94d4('0xc4')]['hasMany'](db['Dynamics365Field'],{'as':'Description','foreignKey':_0x94d4('0x1d4')});db[_0x94d4('0xc4')][_0x94d4('0x12b')](db[_0x94d4('0xc4')],{'as':_0x94d4('0x1d8'),'foreignKey':_0x94d4('0x1d5')});db[_0x94d4('0xc4')]['belongsTo'](db[_0x94d4('0x1d9')],{'as':_0x94d4('0x1d9'),'foreignKey':_0x94d4('0x1da')});db[_0x94d4('0xc7')]['belongsTo'](db[_0x94d4('0x14b')],{});db[_0x94d4('0xc7')][_0x94d4('0x134')](db[_0x94d4('0x148')],{'as':_0x94d4('0x179'),'foreignKey':_0x94d4('0x17a')});db[_0x94d4('0xc7')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0x94d4('0x18c')});db[_0x94d4('0xc7')]['belongsTo'](db['ChatInteraction'],{});db['ChatQueueReport'][_0x94d4('0x134')](db[_0x94d4('0x68')],{});db[_0x94d4('0xc7')][_0x94d4('0x134')](db[_0x94d4('0x125')],{});db[_0x94d4('0xc7')][_0x94d4('0x134')](db[_0x94d4('0x6b')],{});db['ChatInternalMessage'][_0x94d4('0x134')](db[_0x94d4('0x125')],{'onDelete':_0x94d4('0x128'),'foreignKey':'FromId'});db[_0x94d4('0xc9')][_0x94d4('0x134')](db['User'],{'onDelete':'cascade','foreignKey':'ToId'});db[_0x94d4('0xcf')]['hasMany'](db[_0x94d4('0xcd')],{'foreignKey':_0x94d4('0x1e6'),'onDelete':'cascade'});db[_0x94d4('0xcf')]['hasMany'](db[_0x94d4('0xcb')],{'foreignKey':_0x94d4('0x1e6'),'onDelete':_0x94d4('0x128')});db[_0x94d4('0x1e7')][_0x94d4('0x134')](db[_0x94d4('0x55')],{});db[_0x94d4('0x1e7')][_0x94d4('0x134')](db['CmList'],{'as':_0x94d4('0x179'),'foreignKey':_0x94d4('0x17a')});db[_0x94d4('0x1e7')][_0x94d4('0x134')](db[_0x94d4('0x72')],{'as':_0x94d4('0x170'),'foreignKey':'ContactId'});db[_0x94d4('0x1e7')][_0x94d4('0x134')](db[_0x94d4('0x58')],{});db['SmsQueueReport'][_0x94d4('0x134')](db[_0x94d4('0x196')],{});db[_0x94d4('0x1e7')][_0x94d4('0x134')](db[_0x94d4('0x125')],{});db[_0x94d4('0x1e7')][_0x94d4('0x134')](db[_0x94d4('0x5b')],{});db[_0x94d4('0xd4')][_0x94d4('0x12b')](db[_0x94d4('0xcf')],{'foreignKey':_0x94d4('0x1e8')});db[_0x94d4('0xd4')][_0x94d4('0x12b')](db['JscriptyQuestionReport'],{'foreignKey':_0x94d4('0x1e8')});db[_0x94d4('0xd4')][_0x94d4('0x12b')](db[_0x94d4('0xcb')],{'foreignKey':'ProjectId'});db[_0x94d4('0x154')][_0x94d4('0x135')](db['User'],{'as':_0x94d4('0x190'),'through':_0x94d4('0x1e9')});db[_0x94d4('0xdd')]['belongsToMany'](db[_0x94d4('0x125')],{'as':_0x94d4('0x164'),'through':'user_has_teams'});db[_0x94d4('0xdd')][_0x94d4('0x135')](db['VoiceQueue'],{'through':'team_has_voice_queues','as':_0x94d4('0x141')});db[_0x94d4('0xdd')][_0x94d4('0x135')](db[_0x94d4('0x142')],{'through':'team_has_mail_queues','as':'MailQueues'});db[_0x94d4('0xdd')][_0x94d4('0x135')](db[_0x94d4('0x6b')],{'through':_0x94d4('0x1aa'),'as':_0x94d4('0x1ea')});db['Team']['belongsToMany'](db[_0x94d4('0x18b')],{'through':_0x94d4('0x194'),'as':_0x94d4('0x144')});db[_0x94d4('0xdd')][_0x94d4('0x135')](db[_0x94d4('0x5b')],{'through':_0x94d4('0x19a'),'as':'SmsQueues'});db[_0x94d4('0xdd')][_0x94d4('0x135')](db[_0x94d4('0x63')],{'through':_0x94d4('0x1a1'),'as':_0x94d4('0x146')});db['Campaign'][_0x94d4('0x12b')](db['CmHopper'],{'as':_0x94d4('0x1b3'),'foreignKey':_0x94d4('0x1b7')});db['Campaign'][_0x94d4('0x12b')](db[_0x94d4('0x12e')],{'as':'HopperFinals','foreignKey':'CampaignId'});db[_0x94d4('0x1b6')]['hasMany'](db[_0x94d4('0x130')],{'as':_0x94d4('0x15b'),'foreignKey':_0x94d4('0x1b7')});db[_0x94d4('0x1b6')][_0x94d4('0x12b')](db[_0x94d4('0x76')],{'as':_0x94d4('0x15c'),'foreignKey':_0x94d4('0x1b7')});db[_0x94d4('0x1b6')][_0x94d4('0x134')](db[_0x94d4('0x29')],{'as':_0x94d4('0x29'),'foreignKey':_0x94d4('0x1eb')});db[_0x94d4('0x1b6')]['belongsTo'](db[_0x94d4('0x29')],{'as':_0x94d4('0x15e'),'foreignKey':_0x94d4('0x15f')});db[_0x94d4('0x1b6')][_0x94d4('0x134')](db[_0x94d4('0x83')],{'as':'Interval','foreignKey':_0x94d4('0x184')});db[_0x94d4('0x1b6')][_0x94d4('0x134')](db[_0x94d4('0x154')],{'as':_0x94d4('0x154'),'foreignKey':_0x94d4('0x1ec')});db[_0x94d4('0x1b6')][_0x94d4('0x135')](db[_0x94d4('0x148')],{'as':_0x94d4('0x13a'),'through':'campaigns_has_cm_lists'});db['Campaign'][_0x94d4('0x135')](db[_0x94d4('0x148')],{'as':_0x94d4('0x167'),'through':_0x94d4('0x1ed')});db[_0x94d4('0xe5')][_0x94d4('0x134')](db[_0x94d4('0x43')],{});db[_0x94d4('0xe5')][_0x94d4('0x134')](db['MailInteraction'],{});db[_0x94d4('0xe5')]['belongsTo'](db[_0x94d4('0x3c')],{'foreignKey':'FromMailAccountId','as':_0x94d4('0x1ee')});db[_0x94d4('0xe5')][_0x94d4('0x134')](db['User'],{'foreignKey':_0x94d4('0x1ef'),'as':_0x94d4('0x1f0')});db[_0x94d4('0xe5')][_0x94d4('0x134')](db[_0x94d4('0x125')],{'foreignKey':_0x94d4('0x1f1'),'as':'ToAgent'});db['MailTransferReport'][_0x94d4('0x134')](db[_0x94d4('0x142')],{'foreignKey':'ToMailQueueId','as':_0x94d4('0x1f2')});db[_0x94d4('0xe5')][_0x94d4('0x134')](db[_0x94d4('0x3c')],{'foreignKey':_0x94d4('0x1f3'),'as':_0x94d4('0x1f4')});db['ChatTransferReport'][_0x94d4('0x134')](db[_0x94d4('0x68')],{});db['ChatTransferReport'][_0x94d4('0x134')](db['ChatInteraction'],{});db['ChatTransferReport']['belongsTo'](db[_0x94d4('0x14b')],{'foreignKey':_0x94d4('0x1f5'),'as':'FromAccount'});db[_0x94d4('0xe7')][_0x94d4('0x134')](db[_0x94d4('0x125')],{'foreignKey':_0x94d4('0x1ef'),'as':_0x94d4('0x1f0')});db[_0x94d4('0xe7')]['belongsTo'](db['User'],{'foreignKey':'ToUserId','as':_0x94d4('0x1f6')});db[_0x94d4('0xe7')][_0x94d4('0x134')](db[_0x94d4('0x6b')],{'foreignKey':_0x94d4('0x1f7'),'as':_0x94d4('0x1f2')});db[_0x94d4('0xe7')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x94d4('0x1f8'),'as':_0x94d4('0x1f4')});db[_0x94d4('0x1f9')][_0x94d4('0x134')](db[_0x94d4('0x51')],{});db[_0x94d4('0x1f9')][_0x94d4('0x134')](db[_0x94d4('0x4f')],{});db[_0x94d4('0x1f9')][_0x94d4('0x134')](db['FaxAccount'],{'foreignKey':_0x94d4('0x1fa'),'as':_0x94d4('0x1ee')});db[_0x94d4('0x1f9')]['belongsTo'](db[_0x94d4('0x125')],{'foreignKey':_0x94d4('0x1ef'),'as':'FromAgent'});db[_0x94d4('0x1f9')][_0x94d4('0x134')](db[_0x94d4('0x125')],{'foreignKey':_0x94d4('0x1f1'),'as':'ToAgent'});db[_0x94d4('0x1f9')][_0x94d4('0x134')](db[_0x94d4('0x18b')],{'foreignKey':_0x94d4('0x1fb'),'as':_0x94d4('0x1f2')});db[_0x94d4('0x1f9')]['belongsTo'](db['FaxAccount'],{'foreignKey':'ToFaxAccountId','as':_0x94d4('0x1f4')});db[_0x94d4('0x1fc')]['belongsTo'](db[_0x94d4('0x61')],{});db[_0x94d4('0x1fc')][_0x94d4('0x134')](db[_0x94d4('0x131')],{});db['OpenchannelTransferReport'][_0x94d4('0x134')](db[_0x94d4('0x151')],{'foreignKey':_0x94d4('0x1fd'),'as':_0x94d4('0x1ee')});db[_0x94d4('0x1fc')][_0x94d4('0x134')](db[_0x94d4('0x125')],{'foreignKey':_0x94d4('0x1ef'),'as':_0x94d4('0x1f0')});db[_0x94d4('0x1fc')]['belongsTo'](db[_0x94d4('0x125')],{'foreignKey':_0x94d4('0x1f1'),'as':_0x94d4('0x1f6')});db[_0x94d4('0x1fc')][_0x94d4('0x134')](db[_0x94d4('0x63')],{'foreignKey':_0x94d4('0x1fe'),'as':_0x94d4('0x1f2')});db[_0x94d4('0x1fc')]['belongsTo'](db[_0x94d4('0x151')],{'foreignKey':_0x94d4('0x1ff'),'as':_0x94d4('0x1f4')});db[_0x94d4('0xea')][_0x94d4('0x134')](db[_0x94d4('0x196')],{});db[_0x94d4('0xea')]['belongsTo'](db[_0x94d4('0x58')],{});db[_0x94d4('0xea')][_0x94d4('0x134')](db['SmsAccount'],{'foreignKey':_0x94d4('0x200'),'as':_0x94d4('0x1ee')});db['SmsTransferReport']['belongsTo'](db[_0x94d4('0x125')],{'foreignKey':'FromUserId','as':_0x94d4('0x1f0')});db[_0x94d4('0xea')]['belongsTo'](db[_0x94d4('0x125')],{'foreignKey':_0x94d4('0x1f1'),'as':_0x94d4('0x1f6')});db['SmsTransferReport']['belongsTo'](db[_0x94d4('0x5b')],{'foreignKey':_0x94d4('0x201'),'as':'ToQueue'});db[_0x94d4('0xea')][_0x94d4('0x134')](db['SmsAccount'],{'foreignKey':_0x94d4('0x202'),'as':_0x94d4('0x1f4')});db[_0x94d4('0x148')][_0x94d4('0x12b')](db['Disposition'],{'as':_0x94d4('0x176'),'foreignKey':_0x94d4('0x17a')});db[_0x94d4('0x148')][_0x94d4('0x12b')](db[_0x94d4('0x7b')],{'as':_0x94d4('0x203'),'foreignKey':_0x94d4('0x17a')});db[_0x94d4('0x148')]['hasMany'](db[_0x94d4('0x72')],{'as':_0x94d4('0x138'),'onDelete':_0x94d4('0x128'),'foreignKey':'ListId'});db[_0x94d4('0x148')]['hasMany'](db[_0x94d4('0x12e')],{'as':_0x94d4('0x12f'),'foreignKey':'ListId'});db[_0x94d4('0x148')][_0x94d4('0x12b')](db[_0x94d4('0x130')],{'as':'HopperHistory','foreignKey':_0x94d4('0x17a')});db[_0x94d4('0x148')]['hasMany'](db[_0x94d4('0x7a')],{'as':_0x94d4('0x7a'),'foreignKey':_0x94d4('0x17a')});db[_0x94d4('0x148')]['belongsToMany'](db['VoiceQueue'],{'as':_0x94d4('0x204'),'through':_0x94d4('0x163')});db['CmList']['belongsToMany'](db[_0x94d4('0x125')],{'as':_0x94d4('0x164'),'through':_0x94d4('0x13b')});db[_0x94d4('0xec')][_0x94d4('0x12b')](db[_0x94d4('0x18')],{'as':_0x94d4('0x12d'),'onDelete':_0x94d4('0x183')});db[_0x94d4('0xec')][_0x94d4('0x135')](db[_0x94d4('0x125')],{'as':'Agents','through':_0x94d4('0x14a')});db[_0x94d4('0xee')][_0x94d4('0x12b')](db[_0x94d4('0x125')],{'as':_0x94d4('0x190'),'foreignKey':'userProfileId'});db[_0x94d4('0xee')][_0x94d4('0x12b')](db['UserProfileSection'],{'as':_0x94d4('0x205'),'foreignKey':_0x94d4('0x206'),'onDelete':'cascade'});db[_0x94d4('0xf0')][_0x94d4('0x12b')](db[_0x94d4('0xf1')],{'as':_0x94d4('0x207'),'foreignKey':_0x94d4('0x208'),'onDelete':_0x94d4('0x128')});db[_0x94d4('0xf5')][_0x94d4('0x12b')](db['CrmWorkflowStep'],{'foreignKey':_0x94d4('0x209')});db[_0x94d4('0xf5')][_0x94d4('0x12b')](db[_0x94d4('0x108')],{'foreignKey':_0x94d4('0x209')});db[_0x94d4('0x20a')]['hasOne'](db['CrmTask'],{'foreignKey':'WorkflowStepId'});db[_0x94d4('0x20a')][_0x94d4('0x12b')](db['SADossier'],{'foreignKey':_0x94d4('0x20b')});db[_0x94d4('0x20a')][_0x94d4('0x135')](db[_0x94d4('0x20a')],{'as':_0x94d4('0x20c'),'through':_0x94d4('0x20d')});db[_0x94d4('0xf7')][_0x94d4('0x12b')](db[_0x94d4('0xf9')],{'foreignKey':_0x94d4('0x20e')});db[_0x94d4('0xf7')][_0x94d4('0x134')](db[_0x94d4('0x20a')],{'foreignKey':_0x94d4('0x20b'),'as':_0x94d4('0x20a')});db[_0x94d4('0xf9')]['belongsTo'](db[_0x94d4('0xf7')],{'foreignKey':'TaskId','as':_0x94d4('0xf7')});db[_0x94d4('0xfa')][_0x94d4('0x12b')](db[_0x94d4('0x100')],{'foreignKey':'TypeProductId'});db[_0x94d4('0xfc')]['hasMany'](db[_0x94d4('0x100')],{'foreignKey':_0x94d4('0x20f')});db[_0x94d4('0x100')][_0x94d4('0x12b')](db[_0x94d4('0x106')],{'foreignKey':_0x94d4('0x210')});db[_0x94d4('0x100')][_0x94d4('0x134')](db[_0x94d4('0x102')],{'as':_0x94d4('0x211'),'foreignKey':_0x94d4('0x212')});db[_0x94d4('0x100')][_0x94d4('0x134')](db[_0x94d4('0xfc')],{'as':'UnitMeasure','foreignKey':_0x94d4('0x20f')});db[_0x94d4('0x100')]['belongsTo'](db[_0x94d4('0xfa')],{'as':'TypeProduct','foreignKey':'TypeProductId'});db['SASalesCondition'][_0x94d4('0x12b')](db['SAProduct'],{'foreignKey':_0x94d4('0x212')});db['SAPriceList'][_0x94d4('0x12b')](db[_0x94d4('0x106')],{'foreignKey':_0x94d4('0x213')});db[_0x94d4('0x106')][_0x94d4('0x12b')](db['SAProductQuotation'],{'as':_0x94d4('0x214'),'foreignKey':_0x94d4('0x215')});db[_0x94d4('0x106')][_0x94d4('0x134')](db[_0x94d4('0x100')],{'as':_0x94d4('0x216'),'foreignKey':_0x94d4('0x210')});db[_0x94d4('0x106')][_0x94d4('0x134')](db[_0x94d4('0x104')],{'as':_0x94d4('0x217'),'foreignKey':_0x94d4('0x213')});db[_0x94d4('0x108')]['hasMany'](db[_0x94d4('0x109')],{'as':_0x94d4('0x1af'),'foreignKey':'DossierId'});db[_0x94d4('0x108')][_0x94d4('0x12b')](db['SAQuotation'],{'as':'Dossiers','foreignKey':_0x94d4('0x218')});db[_0x94d4('0x108')]['hasMany'](db['SAOrder'],{'as':_0x94d4('0x1af'),'foreignKey':_0x94d4('0x218')});db[_0x94d4('0x108')][_0x94d4('0x12b')](db[_0x94d4('0x10f')],{'as':_0x94d4('0x1af'),'foreignKey':_0x94d4('0x218')});db['SADossier']['belongsTo'](db[_0x94d4('0x70')],{'as':_0x94d4('0x1b4'),'foreignKey':_0x94d4('0x1ad')});db[_0x94d4('0x108')][_0x94d4('0x134')](db['CmContact'],{'as':'Contact','foreignKey':_0x94d4('0x18c')});db[_0x94d4('0x108')][_0x94d4('0x134')](db['CrmWorkflow'],{'as':_0x94d4('0x219'),'foreignKey':_0x94d4('0x209')});db[_0x94d4('0x108')]['belongsTo'](db[_0x94d4('0x20a')],{'as':_0x94d4('0x21a'),'foreignKey':_0x94d4('0x20b')});db['SADossier'][_0x94d4('0x134')](db[_0x94d4('0x125')],{'as':_0x94d4('0x125'),'foreignKey':_0x94d4('0x12a')});db[_0x94d4('0x109')][_0x94d4('0x12b')](db[_0x94d4('0x10a')],{'as':_0x94d4('0x21b'),'foreignKey':'RequestId'});db[_0x94d4('0x109')][_0x94d4('0x12b')](db[_0x94d4('0x10e')],{'as':_0x94d4('0x21b'),'foreignKey':'RequestId'});db[_0x94d4('0x109')][_0x94d4('0x12b')](db[_0x94d4('0x10f')],{'as':_0x94d4('0x21b'),'foreignKey':_0x94d4('0x21c')});db[_0x94d4('0x109')][_0x94d4('0x134')](db['SADossier'],{'as':'Dossier','foreignKey':'DossierId'});db[_0x94d4('0x10a')][_0x94d4('0x12b')](db['SAProductQuotation'],{'as':_0x94d4('0x21d'),'foreignKey':'QuotationId'});db[_0x94d4('0x10a')]['hasMany'](db[_0x94d4('0x10e')],{'as':_0x94d4('0x21d'),'foreignKey':_0x94d4('0x21e')});db[_0x94d4('0x10a')][_0x94d4('0x12b')](db[_0x94d4('0x10f')],{'as':_0x94d4('0x21d'),'foreignKey':_0x94d4('0x21e')});db[_0x94d4('0x10a')][_0x94d4('0x134')](db[_0x94d4('0x108')],{'as':_0x94d4('0x21f'),'foreignKey':_0x94d4('0x218')});db[_0x94d4('0x10a')][_0x94d4('0x134')](db[_0x94d4('0x109')],{'as':'Request','foreignKey':_0x94d4('0x21c')});db['SAProductQuotation'][_0x94d4('0x134')](db[_0x94d4('0x106')],{'as':_0x94d4('0x220'),'foreignKey':_0x94d4('0x215')});db[_0x94d4('0x10c')][_0x94d4('0x134')](db[_0x94d4('0x10a')],{'as':_0x94d4('0x221'),'foreignKey':_0x94d4('0x21e')});db[_0x94d4('0x10c')][_0x94d4('0x134')](db[_0x94d4('0x10f')],{'as':'Proforma','foreignKey':'ProformaId'});db[_0x94d4('0x10c')][_0x94d4('0x134')](db[_0x94d4('0x111')],{'as':_0x94d4('0x222'),'foreignKey':_0x94d4('0x223')});db[_0x94d4('0x10e')][_0x94d4('0x12b')](db[_0x94d4('0x10f')],{'as':_0x94d4('0x224'),'foreignKey':'OrderId'});db['SAOrder']['belongsTo'](db[_0x94d4('0x108')],{'as':_0x94d4('0x21f'),'foreignKey':_0x94d4('0x218')});db['SAOrder'][_0x94d4('0x134')](db[_0x94d4('0x109')],{'as':_0x94d4('0x225'),'foreignKey':'RequestId'});db[_0x94d4('0x10e')][_0x94d4('0x134')](db[_0x94d4('0x10a')],{'as':_0x94d4('0x221'),'foreignKey':_0x94d4('0x21e')});db[_0x94d4('0x10f')][_0x94d4('0x12b')](db[_0x94d4('0x111')],{'as':'Proforma','foreignKey':'ProformaId'});db['SAProforma'][_0x94d4('0x12b')](db[_0x94d4('0x10c')],{'as':'Proforma','foreignKey':_0x94d4('0x226')});db[_0x94d4('0x10f')][_0x94d4('0x12b')](db['SAProformaDetail'],{'as':_0x94d4('0x227'),'foreignKey':_0x94d4('0x226')});db[_0x94d4('0x10f')][_0x94d4('0x12b')](db[_0x94d4('0x118')],{'as':'Proforma','foreignKey':_0x94d4('0x226')});db[_0x94d4('0x10f')]['belongsTo'](db['SADossier'],{'as':'Dossier','foreignKey':_0x94d4('0x218')});db['SAProforma'][_0x94d4('0x134')](db[_0x94d4('0x109')],{'as':'Request','foreignKey':'RequestId'});db[_0x94d4('0x10f')][_0x94d4('0x134')](db[_0x94d4('0x10a')],{'as':'Quotation','foreignKey':_0x94d4('0x21e')});db[_0x94d4('0x10f')][_0x94d4('0x134')](db[_0x94d4('0x10e')],{'as':_0x94d4('0x228'),'foreignKey':'OrderId'});db[_0x94d4('0x111')][_0x94d4('0x12b')](db['SAProductQuotation'],{'as':_0x94d4('0x21d'),'foreignKey':_0x94d4('0x223')});db[_0x94d4('0x111')]['hasMany'](db['SAInvoiceDetail'],{'as':_0x94d4('0x229'),'foreignKey':_0x94d4('0x223')});db[_0x94d4('0x111')][_0x94d4('0x12b')](db[_0x94d4('0x118')],{'as':_0x94d4('0x22a'),'foreignKey':_0x94d4('0x223')});db[_0x94d4('0x111')][_0x94d4('0x134')](db[_0x94d4('0x108')],{'as':_0x94d4('0x21f'),'foreignKey':_0x94d4('0x218')});db[_0x94d4('0x111')]['belongsTo'](db['SARequest'],{'as':_0x94d4('0x225'),'foreignKey':'RequestId'});db[_0x94d4('0x111')]['belongsTo'](db[_0x94d4('0x10a')],{'as':'Quotation','foreignKey':_0x94d4('0x21e')});db[_0x94d4('0x111')][_0x94d4('0x134')](db[_0x94d4('0x10e')],{'as':'Order','foreignKey':_0x94d4('0x22b')});db[_0x94d4('0x114')][_0x94d4('0x134')](db[_0x94d4('0x111')],{'as':_0x94d4('0x222'),'foreignKey':_0x94d4('0x223')});db[_0x94d4('0x116')][_0x94d4('0x134')](db[_0x94d4('0x10f')],{'as':'Proforma','foreignKey':'ProformaId'});db[_0x94d4('0x118')][_0x94d4('0x134')](db['SAInvoice'],{'as':_0x94d4('0x222'),'foreignKey':_0x94d4('0x223')});db[_0x94d4('0x118')][_0x94d4('0x134')](db[_0x94d4('0x10f')],{'as':_0x94d4('0x227'),'foreignKey':_0x94d4('0x226')});db['SAPaymentMethod'][_0x94d4('0x12b')](db[_0x94d4('0x70')],{'as':_0x94d4('0x22c'),'foreignKey':_0x94d4('0x1b2')});db[_0x94d4('0x11d')][_0x94d4('0x134')](db[_0x94d4('0x11b')],{'as':_0x94d4('0x22d'),'foreignKey':_0x94d4('0x22e')});db[_0x94d4('0x121')]['hasMany'](db['CmCompany'],{'as':_0x94d4('0x22f'),'foreignKey':_0x94d4('0x230')});db[_0x94d4('0x123')][_0x94d4('0x12b')](db[_0x94d4('0x70')],{'as':_0x94d4('0x231'),'foreignKey':_0x94d4('0x232')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x71b4=['CampaignId','OwnerId','CmHopperBlack','All','Any','OneAny','AutomationAnyId','Actions','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','Mohs','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','AnalyticFieldReport','CustomReportId','Fields','Configurations','AccountId','SalesforceConfiguration','SalesforceField','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Field','SugarcrmAccount','VariableId','DeskField','ZendeskConfiguration','FreshdeskAccount','FreshdeskField','int_freshdesk_configuration_has_tags','VtigerAccount','VtigerField','int_vtiger_configuration_has_tags','ServicenowField','Dynamics365Account','ChatQueueReport','ChatInternalMessage','FromId','ToId','JscriptyQuestionReport','SessionId','JscriptyAnswerReport','ProjectId','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromAccount','FromUserId','FromAgent','ToUserId','ToMailQueueId','ToQueue','ToAccount','FromChatWebsiteId','ToAgent','ToChatQueueId','FromFaxAccountId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','SmsTransferReport','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','voice_queues_has_cm_lists','UserProfileSections','Resources','sectionId','WorkflowId','CrmWorkflowStep','WorkflowStepId','CrmWorkflowNextStep','crm_workflow_steps_has_crm_workflow_steps','TaskId','SAProduct','TypeProductId','UnitMeasureId','ProductId','SaleCondition','TypeSalesConditionId','UnitMeasure','TypeProduct','PriceListId','ProductPriceList','ProductPriceListId','Product','Pricelist','DossierId','Workflow','WorkflowStep','Requests','RequestId','Dossier','Quotations','QuotationId','Quotation','Proforma','ProformaId','Invoice','InvoiceId','OrderId','Request','Order','Payments','Companies','CreditNote','CreditNoteId','saCompanyType','CompanyRelationship','saCompanyRelationship','sequelize','jstz','determine','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','utf8mb4','name','utf8_general_ci','sequelizeHistory','mysql','utf8','database','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserFaxQueue','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','../api/mailServerIn/mailServerIn.model','MailServerOut','../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','MailQueueReport','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','../api/smsApplication/smsApplication.model','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','Pause','../api/pause/pause.model','Cdr','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','Sound','../api/sound/sound.model','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','ZohoAccount','ZohoConfiguration','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','ServicenowAccount','ServicenowConfiguration','../api/intServicenowField/intServicenowField.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','Network','../api/network/network.model','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','SquareMessage','../api/squareMessage/squareMessage.model','License','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','../api/attachment/attachment.model','Plugin','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','OpenchannelTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','../api/voicePrefix/voicePrefix.model','UserProfile','UserProfileSection','UserProfileResource','../api/userProfileResource/userProfileResource.model','../api/crmNation/crmNation.model','CrmWorkflow','../api/crmWorkflow/crmWorkflow.model','../api/crmWorkflowstep/crmWorkflowstep.model','CrmTask','../api/crmTask/crmTask.model','CrmActionsList','SATypeProduct','SAUnitMeasure','../api/saInvoiceLaw/saInvoiceLaw.model','SASalesCondition','../api/saSalesCondition/saSalesCondition.model','SAPriceList','../api/saPriceList/saPriceList.model','SAProductPricesList','../api/saProductPricesList/saProductPricesList.model','SADossier','../api/saDossier/saDossier.model','SARequest','../api/saRequest/saRequest.model','SAQuotation','../api/saQuotation/saQuotation.model','SAProductQuotation','../api/saProductQuotation/saProductQuotation.model','SAOrder','SAProforma','../api/saProforma/saProforma.model','SAInvoice','../api/saInvoice/saInvoice.model','SAAsset','../api/saAsset/saAsset.model','SAInvoiceDetail','../api/saProformaDetail/saProformaDetail.model','SAPayment','../api/saPayment/saPayment.model','../api/saPaymentMethod/saPaymentMethod.model','SACreditNote','../api/saCreditNote/saCreditNote.model','SACreditNoteDetail','../api/saCreditNoteDetail/saCreditNoteDetail.model','../api/saInvoiceNumber/saInvoiceNumber.model','SACreditNoteNumber','../api/saCreditNoteNumber/saCreditNoteNumber.model','SACompanyType','../api/saCompanyType/saCompanyType.model','SACompanyRelationship','../api/saCompanyRelationship/saCompanyRelationship.model','cascade','UserId','hasMany','Extensions','HopperFinals','CmHopperHistory','HopperHistory','ChatInteractions','SmsInteraction','SmsInteractions','FaxInteractions','MailInteractions','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','cm_user_has_contacts','Lists','cm_user_has_lists','Team','user_has_teams','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','VoiceQueues','MailQueues','UserMailQueue','ChatQueue','FaxQueues','SmsQueues','OpenchannelQueues','UserOpenchannelQueue','CmList','VoicePrefix','VoicePrefixes','ChatWebsite','user_has_fax_accounts','MailAccount','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','SquareProjects','ChanSpyId','VoiceMusicOnHold','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperHistories','HopperBlacks','Trunk','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','team_has_voice_queues','BlackLists','voice_queues_has_cm_blacklists','mailboxuser','mailbox','uniqueid','Contact','MailServerIn','MailAccountId','hasOne','Imap','Smtp','Dispositions','Answers','Messages','Interactions','Applications','List','TemplateId','mandatoryDispositionPauseId','Agents','team_has_mail_queues','Teams','MailInteractionId','Account','ContactId','Owner','Tag','Tags','mail_interaction_has_tags','ThroughTags','Attachment','Attachments','Interaction','restrict','TagId','ListId','FaxAccountId','Exntensions','FaxInteractionId','fax_interaction_has_tags','Users','SmsAccountId','sms_interaction_has_tags','SmsInteractionId','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','AttachmentId','team_has_openchannel_queues','ChatWebsiteId','ChatApplication','user_has_chat_websites','Agent','Queue','Website','ChatInteractionId','chat_interaction_has_tags','ChatGroupId','RelatedCompany','Contacts','CompanyId','Dossiers','SAPaymentMethod','PaymentMethod','saPaymentMethod','JscriptySessions','OpenchannelInteractions','Company','cm_contact_has_tags'];(function(_0x168998,_0x21547e){var _0xbb7371=function(_0x58e081){while(--_0x58e081){_0x168998['push'](_0x168998['shift']());}};_0xbb7371(++_0x21547e);}(_0x71b4,0x7e));var _0x471b=function(_0x153744,_0x5a1042){_0x153744=_0x153744-0x0;var _0x560e22=_0x71b4[_0x153744];return _0x560e22;};'use strict';var path=require('path');var config=require('../config/environment');var Sequelize=require(_0x471b('0x0'));var _=require('lodash');var jstz=require(_0x471b('0x1'));var timezone=jstz[_0x471b('0x2')]();config[_0x471b('0x0')]=_[_0x471b('0x3')](config['sequelize'],{'database':_0x471b('0x4'),'username':_0x471b('0x5'),'password':_0x471b('0x6'),'options':{'host':_0x471b('0x7'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x471b('0x8')},'logging':![],'timezone':timezone[_0x471b('0x9')](),'define':{'charset':'utf8','collate':_0x471b('0xa')}}});config[_0x471b('0xb')]=_[_0x471b('0x3')](config[_0x471b('0xb')],{'database':'motion2','username':'xcall','password':'xC@LL1234','options':{'host':_0x471b('0x7'),'port':0xcea,'dialect':_0x471b('0xc'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x471b('0xd'),'collate':_0x471b('0xa')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x471b('0xe')],config[_0x471b('0x0')][_0x471b('0xf')],config[_0x471b('0x0')][_0x471b('0x10')],config[_0x471b('0x0')][_0x471b('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x471b('0xb')][_0x471b('0xe')],config[_0x471b('0xb')][_0x471b('0xf')],config[_0x471b('0xb')]['password'],config[_0x471b('0xb')][_0x471b('0x11')])};db[_0x471b('0x12')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x14'));db[_0x471b('0x15')]=db['sequelize'][_0x471b('0x13')](_0x471b('0x16'));db[_0x471b('0x17')]=db[_0x471b('0x0')]['import']('../api/voiceContext/voiceContext.model');db[_0x471b('0x18')]=db['sequelize']['import'](_0x471b('0x19'));db['VoiceMusicOnHold']=db[_0x471b('0x0')][_0x471b('0x13')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0x471b('0x1a')]=db['sequelize'][_0x471b('0x13')](_0x471b('0x1b'));db[_0x471b('0x1c')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x1d'));db[_0x471b('0x1e')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x1f'));db[_0x471b('0x20')]=db['sequelize']['import'](_0x471b('0x21'));db[_0x471b('0x22')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x23'));db[_0x471b('0x24')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x25'));db[_0x471b('0x26')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x27'));db['VoiceAgentReport']=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x28'));db[_0x471b('0x29')]=db[_0x471b('0x0')]['import'](_0x471b('0x2a'));db['MemberReport']=db[_0x471b('0x0')]['import'](_0x471b('0x2b'));db['Trunk']=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x2c'));db['VoiceTransferReport']=db[_0x471b('0x0')]['import'](_0x471b('0x2d'));db[_0x471b('0x2e')]=db[_0x471b('0x0')][_0x471b('0x13')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x471b('0x2f')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x30'));db[_0x471b('0x31')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x32'));db['UserMailQueue']=db[_0x471b('0x0')][_0x471b('0x13')]('../api/userMailQueue/userMailQueue.model');db[_0x471b('0x33')]=db[_0x471b('0x0')]['import']('../api/userFaxQueue/userFaxQueue.model');db[_0x471b('0x34')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x35'));db['UserOpenchannelQueue']=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x36'));db['MailServerIn']=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x37'));db[_0x471b('0x38')]=db[_0x471b('0x0')][_0x471b('0x13')]('../api/mailServerOut/mailServerOut.model');db['MailAccount']=db[_0x471b('0x0')]['import'](_0x471b('0x39'));db[_0x471b('0x3a')]=db[_0x471b('0x0')]['import'](_0x471b('0x3b'));db[_0x471b('0x3c')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x3d'));db[_0x471b('0x3e')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x3f'));db[_0x471b('0x40')]=db['sequelize'][_0x471b('0x13')](_0x471b('0x41'));db[_0x471b('0x42')]=db[_0x471b('0x0')][_0x471b('0x13')]('../api/mailApplication/mailApplication.model');db[_0x471b('0x43')]=db['sequelize'][_0x471b('0x13')]('../api/mailQueueReport/mailQueueReport.model');db[_0x471b('0x44')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x45'));db[_0x471b('0x46')]=db[_0x471b('0x0')]['import'](_0x471b('0x47'));db[_0x471b('0x48')]=db[_0x471b('0x0')]['import'](_0x471b('0x49'));db[_0x471b('0x4a')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x4b'));db[_0x471b('0x4c')]=db['sequelize'][_0x471b('0x13')](_0x471b('0x4d'));db[_0x471b('0x4e')]=db[_0x471b('0x0')]['import'](_0x471b('0x4f'));db[_0x471b('0x50')]=db['sequelize'][_0x471b('0x13')](_0x471b('0x51'));db[_0x471b('0x52')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x53'));db[_0x471b('0x54')]=db[_0x471b('0x0')]['import']('../api/smsAccount/smsAccount.model');db[_0x471b('0x55')]=db['sequelize'][_0x471b('0x13')](_0x471b('0x56'));db['SmsInteraction']=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x57'));db[_0x471b('0x58')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x59'));db[_0x471b('0x5a')]=db['sequelize'][_0x471b('0x13')]('../api/smsQueue/smsQueue.model');db[_0x471b('0x5b')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x5c'));db[_0x471b('0x5d')]=db[_0x471b('0x0')][_0x471b('0x13')]('../api/openchannelApplication/openchannelApplication.model');db[_0x471b('0x5e')]=db['sequelize'][_0x471b('0x13')](_0x471b('0x5f'));db[_0x471b('0x60')]=db[_0x471b('0x0')]['import'](_0x471b('0x61'));db[_0x471b('0x62')]=db[_0x471b('0x0')][_0x471b('0x13')]('../api/openchannelQueue/openchannelQueue.model');db['ChatWebsite']=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x63'));db[_0x471b('0x64')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x65'));db['ChatApplication']=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x66'));db[_0x471b('0x67')]=db[_0x471b('0x0')]['import'](_0x471b('0x68'));db[_0x471b('0x69')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x6a'));db[_0x471b('0x6b')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x6c'));db['ChatQueue']=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x6d'));db[_0x471b('0x6e')]=db[_0x471b('0x0')]['import'](_0x471b('0x6f'));db[_0x471b('0x70')]=db[_0x471b('0x0')]['import']('../api/chatProactiveAction/chatProactiveAction.model');db[_0x471b('0x71')]=db['sequelize'][_0x471b('0x13')](_0x471b('0x72'));db[_0x471b('0x73')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x74'));db[_0x471b('0x75')]=db['sequelize'][_0x471b('0x13')](_0x471b('0x76'));db['CmHopperBlack']=db[_0x471b('0x0')][_0x471b('0x13')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0x471b('0x77')]=db[_0x471b('0x0')]['import'](_0x471b('0x78'));db['CmHopperHistory']=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x79'));db[_0x471b('0x7a')]=db['sequelize'][_0x471b('0x13')](_0x471b('0x7b'));db[_0x471b('0x7c')]=db['sequelize'][_0x471b('0x13')](_0x471b('0x7d'));db[_0x471b('0x7e')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x7f'));db[_0x471b('0x80')]=db[_0x471b('0x0')][_0x471b('0x13')]('../api/automation/automation.model');db[_0x471b('0x81')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x82'));db[_0x471b('0x83')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x84'));db[_0x471b('0x85')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x86'));db[_0x471b('0x87')]=db[_0x471b('0x0')][_0x471b('0x13')]('../api/interval/interval.model');db[_0x471b('0x88')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x89'));db[_0x471b('0x8a')]=db[_0x471b('0x0')][_0x471b('0x13')]('../api/cdr/cdr.model');db[_0x471b('0x8b')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x8c'));db[_0x471b('0x8d')]=db[_0x471b('0x0')][_0x471b('0x13')]('../api/schedule/schedule.model');db[_0x471b('0x8e')]=db['sequelize']['import'](_0x471b('0x8f'));db['Tag']=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x90'));db[_0x471b('0x91')]=db['sequelize'][_0x471b('0x13')](_0x471b('0x92'));db[_0x471b('0x93')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x94'));db[_0x471b('0x95')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x96'));db[_0x471b('0x97')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x98'));db['IntegrationReport']=db[_0x471b('0x0')][_0x471b('0x13')]('../api/integrationReport/integrationReport.model');db['AnalyticCustomReport']=db[_0x471b('0x0')]['import'](_0x471b('0x99'));db[_0x471b('0x9a')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x9b'));db[_0x471b('0x9c')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x9d'));db[_0x471b('0x9e')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x9f'));db['AnalyticFieldReport']=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0xa0'));db[_0x471b('0xa1')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0xa2'));db[_0x471b('0xa3')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0xa4'));db['SalesforceConfiguration']=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0xa5'));db['SalesforceField']=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0xa6'));db['SugarcrmAccount']=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0xa7'));db[_0x471b('0xa8')]=db[_0x471b('0x0')]['import']('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0x471b('0xa9')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0xaa'));db[_0x471b('0xab')]=db[_0x471b('0x0')][_0x471b('0x13')]('../api/intDeskAccount/intDeskAccount.model');db[_0x471b('0xac')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0xad'));db['DeskField']=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0xae'));db[_0x471b('0xaf')]=db[_0x471b('0x0')]['import']('../api/intZohoAccount/intZohoAccount.model');db[_0x471b('0xb0')]=db[_0x471b('0x0')][_0x471b('0x13')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0x471b('0xb1')]=db[_0x471b('0x0')][_0x471b('0x13')]('../api/intZohoField/intZohoField.model');db[_0x471b('0xb2')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0xb3'));db['ZendeskConfiguration']=db[_0x471b('0x0')][_0x471b('0x13')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0x471b('0xb4')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0xb5'));db['FreshdeskAccount']=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0xb6'));db[_0x471b('0xb7')]=db['sequelize'][_0x471b('0x13')](_0x471b('0xb8'));db['FreshdeskField']=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0xb9'));db['VtigerAccount']=db[_0x471b('0x0')]['import']('../api/intVtigerAccount/intVtigerAccount.model');db[_0x471b('0xba')]=db['sequelize'][_0x471b('0x13')](_0x471b('0xbb'));db['VtigerField']=db['sequelize'][_0x471b('0x13')](_0x471b('0xbc'));db[_0x471b('0xbd')]=db[_0x471b('0x0')][_0x471b('0x13')]('../api/intServicenowAccount/intServicenowAccount.model');db[_0x471b('0xbe')]=db[_0x471b('0x0')]['import']('../api/intServicenowConfiguration/intServicenowConfiguration.model');db['ServicenowField']=db[_0x471b('0x0')]['import'](_0x471b('0xbf'));db['Dynamics365Account']=db[_0x471b('0x0')]['import']('../api/intDynamics365Account/intDynamics365Account.model');db[_0x471b('0xc0')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0xc1'));db[_0x471b('0xc2')]=db['sequelize'][_0x471b('0x13')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0x471b('0x97')]=db['sequelize']['import'](_0x471b('0x98'));db[_0x471b('0xc3')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0xc4'));db['ChatQueueReport']=db['sequelize'][_0x471b('0x13')](_0x471b('0xc5'));db['ChatInternalMessage']=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0xc6'));db['JscriptyAnswerReport']=db[_0x471b('0x0')]['import'](_0x471b('0xc7'));db['JscriptyQuestionReport']=db['sequelize']['import'](_0x471b('0xc8'));db[_0x471b('0xc9')]=db[_0x471b('0x0')][_0x471b('0x13')]('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0x471b('0xca')]=db['sequelize']['import'](_0x471b('0xcb'));db[_0x471b('0xcc')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0xcd'));db[_0x471b('0xce')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0xcf'));db[_0x471b('0xd0')]=db[_0x471b('0x0')][_0x471b('0x13')]('../api/jscriptyProject/jscriptyProject.model');db[_0x471b('0xd1')]=db['sequelize'][_0x471b('0x13')](_0x471b('0xd2'));db['SquareOdbc']=db['sequelize'][_0x471b('0x13')](_0x471b('0xd3'));db[_0x471b('0xd4')]=db['sequelize'][_0x471b('0x13')](_0x471b('0xd5'));db[_0x471b('0xd6')]=db[_0x471b('0x0')][_0x471b('0x13')]('../api/squareRecording/squareRecording.model');db[_0x471b('0xd7')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0xd8'));db['Team']=db[_0x471b('0x0')][_0x471b('0x13')]('../api/team/team.model');db[_0x471b('0xd9')]=db[_0x471b('0x0')]['import']('../api/license/license.model');db[_0x471b('0xda')]=db[_0x471b('0x0')]['import'](_0x471b('0xdb'));db[_0x471b('0xdc')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0xdd'));db['Attachment']=db[_0x471b('0x0')]['import'](_0x471b('0xde'));db[_0x471b('0xdf')]=db['sequelize'][_0x471b('0x13')]('../api/plugin/plugin.model');db[_0x471b('0xe0')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0xe1'));db[_0x471b('0xe2')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0xe3'));db[_0x471b('0xe4')]=db[_0x471b('0x0')][_0x471b('0x13')]('../api/faxTransferReport/faxTransferReport.model');db[_0x471b('0xe5')]=db[_0x471b('0x0')][_0x471b('0x13')]('../api/openchannelTransferReport/openchannelTransferReport.model');db['SmsTransferReport']=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0xe6'));db['CmList']=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0xe7'));db['VoicePrefix']=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0xe8'));db[_0x471b('0xe9')]=db['sequelize']['import']('../api/userProfile/userProfile.model');db[_0x471b('0xea')]=db[_0x471b('0x0')][_0x471b('0x13')]('../api/userProfileSection/userProfileSection.model');db[_0x471b('0xeb')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0xec'));db['CrmNation']=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0xed'));db[_0x471b('0xee')]=db[_0x471b('0x0')]['import'](_0x471b('0xef'));db['CrmWorkflowStep']=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0xf0'));db[_0x471b('0xf1')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0xf2'));db[_0x471b('0xf3')]=db[_0x471b('0x0')][_0x471b('0x13')]('../api/crmActionsList/crmActionsList.model');db[_0x471b('0xf4')]=db[_0x471b('0x0')][_0x471b('0x13')]('../api/saTypeProduct/saTypeProduct.model');db[_0x471b('0xf5')]=db[_0x471b('0x0')][_0x471b('0x13')]('../api/saUnitMeasure/saUnitMeasure.model');db['SAInvoiceLaw']=db['sequelize'][_0x471b('0x13')](_0x471b('0xf6'));db['SAProduct']=db[_0x471b('0x0')][_0x471b('0x13')]('../api/saProduct/saProduct.model');db[_0x471b('0xf7')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0xf8'));db[_0x471b('0xf9')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0xfa'));db[_0x471b('0xfb')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0xfc'));db[_0x471b('0xfd')]=db['sequelize'][_0x471b('0x13')](_0x471b('0xfe'));db[_0x471b('0xff')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x100'));db[_0x471b('0x101')]=db['sequelize']['import'](_0x471b('0x102'));db[_0x471b('0x103')]=db['sequelize'][_0x471b('0x13')](_0x471b('0x104'));db[_0x471b('0x105')]=db[_0x471b('0x0')][_0x471b('0x13')]('../api/saOrder/saOrder.model');db[_0x471b('0x106')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x107'));db[_0x471b('0x108')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x109'));db[_0x471b('0x10a')]=db['sequelize'][_0x471b('0x13')](_0x471b('0x10b'));db[_0x471b('0x10c')]=db[_0x471b('0x0')]['import']('../api/saInvoiceDetail/saInvoiceDetail.model');db['SAProformaDetail']=db['sequelize'][_0x471b('0x13')](_0x471b('0x10d'));db[_0x471b('0x10e')]=db['sequelize']['import'](_0x471b('0x10f'));db['SAPaymentMethod']=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x110'));db[_0x471b('0x111')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x112'));db[_0x471b('0x113')]=db[_0x471b('0x0')]['import'](_0x471b('0x114'));db['SAInvoiceNumber']=db[_0x471b('0x0')]['import'](_0x471b('0x115'));db[_0x471b('0x116')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x117'));db[_0x471b('0x118')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x119'));db[_0x471b('0x11a')]=db[_0x471b('0x0')][_0x471b('0x13')](_0x471b('0x11b'));db[_0x471b('0x12')]['hasOne'](db[_0x471b('0x20')],{'as':_0x471b('0x20'),'onDelete':_0x471b('0x11c'),'foreignKey':_0x471b('0x11d')});db[_0x471b('0x12')][_0x471b('0x11e')](db[_0x471b('0x1c')],{'as':'Recordings','foreignKey':_0x471b('0x11d')});db[_0x471b('0x12')][_0x471b('0x11e')](db[_0x471b('0x2e')],{'as':'VoiceQueuesRt','foreignKey':'UserId'});db[_0x471b('0x12')][_0x471b('0x11e')](db[_0x471b('0x18')],{'as':_0x471b('0x11f'),'onDelete':_0x471b('0x11c'),'hooks':!![]});db['User'][_0x471b('0x11e')](db[_0x471b('0x77')],{'as':_0x471b('0x120'),'foreignKey':_0x471b('0x11d')});db[_0x471b('0x12')][_0x471b('0x11e')](db[_0x471b('0x121')],{'as':_0x471b('0x122'),'foreignKey':_0x471b('0x11d')});db[_0x471b('0x12')][_0x471b('0x11e')](db[_0x471b('0x7a')],{'as':'ReportAgentPreview','foreignKey':_0x471b('0x11d')});db[_0x471b('0x12')][_0x471b('0x11e')](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','foreignKey':_0x471b('0x11d')});db['User'][_0x471b('0x11e')](db[_0x471b('0x67')],{'as':_0x471b('0x123'),'foreignKey':_0x471b('0x11d')});db[_0x471b('0x12')][_0x471b('0x11e')](db[_0x471b('0x124')],{'as':_0x471b('0x125'),'foreignKey':_0x471b('0x11d')});db[_0x471b('0x12')][_0x471b('0x11e')](db[_0x471b('0x4c')],{'as':_0x471b('0x126'),'foreignKey':_0x471b('0x11d')});db[_0x471b('0x12')][_0x471b('0x11e')](db[_0x471b('0x3e')],{'as':_0x471b('0x127'),'foreignKey':_0x471b('0x11d')});db[_0x471b('0x12')][_0x471b('0x128')](db['UserProfile'],{'as':'UserProfile','foreignKey':_0x471b('0x129')});db[_0x471b('0x12')][_0x471b('0x12a')](db[_0x471b('0x6e')],{'as':_0x471b('0x12b'),'through':_0x471b('0x12c')});db[_0x471b('0x12')]['belongsToMany'](db['CmContact'],{'as':'Contacts','through':_0x471b('0x12d')});db[_0x471b('0x12')][_0x471b('0x12a')](db['CmList'],{'as':_0x471b('0x12e'),'through':_0x471b('0x12f')});db[_0x471b('0x12')][_0x471b('0x12a')](db[_0x471b('0x130')],{'through':_0x471b('0x131')});db[_0x471b('0x12')][_0x471b('0x12a')](db[_0x471b('0x3e')],{'as':_0x471b('0x127'),'through':'user_has_mail_interactions'});db[_0x471b('0x12')]['belongsToMany'](db[_0x471b('0x67')],{'as':_0x471b('0x123'),'through':_0x471b('0x132')});db[_0x471b('0x12')][_0x471b('0x12a')](db[_0x471b('0x4c')],{'as':_0x471b('0x126'),'through':_0x471b('0x133')});db[_0x471b('0x12')][_0x471b('0x12a')](db[_0x471b('0x124')],{'as':_0x471b('0x125'),'through':_0x471b('0x134')});db[_0x471b('0x12')][_0x471b('0x12a')](db[_0x471b('0x5e')],{'as':'OpenchannelInteractions','through':_0x471b('0x135')});db[_0x471b('0x12')][_0x471b('0x12a')](db[_0x471b('0x1a')],{'as':_0x471b('0x136'),'through':_0x471b('0x2f'),'required':![]});db[_0x471b('0x12')][_0x471b('0x12a')](db[_0x471b('0x3a')],{'as':_0x471b('0x137'),'through':_0x471b('0x138'),'required':![]});db[_0x471b('0x12')]['belongsToMany'](db[_0x471b('0x139')],{'as':'ChatQueues','through':_0x471b('0x31'),'required':![],'hooks':!![]});db['User']['belongsToMany'](db[_0x471b('0x50')],{'as':_0x471b('0x13a'),'through':'UserFaxQueue','required':![]});db[_0x471b('0x12')][_0x471b('0x12a')](db[_0x471b('0x5a')],{'as':_0x471b('0x13b'),'through':_0x471b('0x34'),'required':![]});db[_0x471b('0x12')]['belongsToMany'](db[_0x471b('0x62')],{'as':_0x471b('0x13c'),'through':_0x471b('0x13d'),'required':![]});db[_0x471b('0x12')][_0x471b('0x12a')](db[_0x471b('0x13e')],{'through':_0x471b('0x12f')});db['User'][_0x471b('0x12a')](db[_0x471b('0x13f')],{'as':_0x471b('0x140'),'through':'user_has_voice_prefixes','required':![]});db['User'][_0x471b('0x12a')](db[_0x471b('0x141')],{'as':'ChatWebsites','through':'user_has_chat_websites'});db[_0x471b('0x12')][_0x471b('0x12a')](db[_0x471b('0x48')],{'as':'FaxAccounts','through':_0x471b('0x142')});db['User']['belongsToMany'](db[_0x471b('0x143')],{'as':_0x471b('0x144'),'through':_0x471b('0x145')});db[_0x471b('0x12')]['belongsToMany'](db[_0x471b('0x5b')],{'as':_0x471b('0x146'),'through':_0x471b('0x147')});db['User']['belongsToMany'](db[_0x471b('0x54')],{'as':_0x471b('0x148'),'through':_0x471b('0x149')});db[_0x471b('0x12')][_0x471b('0x12a')](db[_0x471b('0xd4')],{'as':_0x471b('0x14a'),'through':'user_has_square_projects'});db[_0x471b('0x15')][_0x471b('0x11e')](db[_0x471b('0x18')],{'as':'SpiedAgents','onDelete':'cascade','foreignKey':_0x471b('0x14b')});db[_0x471b('0x17')][_0x471b('0x11e')](db['VoiceExtension'],{'onDelete':_0x471b('0x11c')});db[_0x471b('0x18')][_0x471b('0x11e')](db[_0x471b('0x18')],{'as':'Applications','onDelete':_0x471b('0x11c')});db[_0x471b('0x14c')]['belongsToMany'](db[_0x471b('0x8e')],{'as':_0x471b('0x14d'),'through':_0x471b('0x14e')});db['VoiceQueue']['hasMany'](db[_0x471b('0x2e')],{'as':_0x471b('0x14f'),'foreignKey':_0x471b('0x150')});db['VoiceQueue'][_0x471b('0x11e')](db[_0x471b('0x75')],{'as':_0x471b('0x151'),'foreignKey':'VoiceQueueId'});db[_0x471b('0x1a')][_0x471b('0x11e')](db[_0x471b('0x77')],{'as':_0x471b('0x120'),'foreignKey':_0x471b('0x150')});db['VoiceQueue'][_0x471b('0x11e')](db[_0x471b('0x121')],{'as':_0x471b('0x152'),'foreignKey':_0x471b('0x150')});db[_0x471b('0x1a')][_0x471b('0x11e')](db[_0x471b('0x7a')],{'as':_0x471b('0x7a'),'foreignKey':'VoiceQueueId'});db[_0x471b('0x1a')]['hasMany'](db['CmHopperBlack'],{'as':_0x471b('0x153'),'foreignKey':_0x471b('0x150')});db['VoiceQueue'][_0x471b('0x11e')](db[_0x471b('0xc9')],{'as':'JscriptySessions','foreignKey':'VoiceQueueId'});db[_0x471b('0x1a')][_0x471b('0x128')](db[_0x471b('0x154')],{'as':'Trunk','foreignKey':_0x471b('0x155')});db[_0x471b('0x1a')][_0x471b('0x128')](db[_0x471b('0x154')],{'as':_0x471b('0x156'),'foreignKey':_0x471b('0x157')});db[_0x471b('0x1a')]['belongsTo'](db['Interval'],{'as':_0x471b('0x87'),'foreignKey':_0x471b('0x158')});db[_0x471b('0x1a')][_0x471b('0x128')](db[_0x471b('0x88')],{'as':_0x471b('0x159'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x471b('0x1a')][_0x471b('0x12a')](db[_0x471b('0x13e')],{'as':_0x471b('0x12e'),'through':'voice_queues_has_cm_lists'});db[_0x471b('0x1a')][_0x471b('0x12a')](db[_0x471b('0x12')],{'as':'Agents','through':_0x471b('0x2f')});db[_0x471b('0x1a')]['belongsToMany'](db[_0x471b('0x130')],{'as':'Teams','through':_0x471b('0x15a')});db[_0x471b('0x1a')][_0x471b('0x12a')](db[_0x471b('0x13e')],{'as':_0x471b('0x15b'),'through':_0x471b('0x15c')});db[_0x471b('0x1c')][_0x471b('0x128')](db[_0x471b('0x12')],{'as':_0x471b('0x12'),'foreignKey':_0x471b('0x11d')});db[_0x471b('0x1e')]['belongsTo'](db[_0x471b('0x12')],{'as':_0x471b('0x12'),'foreignKey':_0x471b('0x11d')});db['VoiceMail'][_0x471b('0x11e')](db[_0x471b('0x22')],{'as':'Messages','onDelete':_0x471b('0x11c'),'foreignKey':_0x471b('0x15d'),'sourceKey':_0x471b('0x15e')});db[_0x471b('0x22')]['belongsTo'](db[_0x471b('0x20')],{'foreignKey':_0x471b('0x15d'),'targetKey':_0x471b('0x15e')});db[_0x471b('0x24')]['hasMany'](db[_0x471b('0x29')],{'as':'QueueCalls','foreignKey':_0x471b('0x15f'),'constraints':![]});db[_0x471b('0x24')][_0x471b('0x11e')](db['VoiceAgentReport'],{'as':'AgentReports','foreignKey':_0x471b('0x15f'),'constraints':![]});db[_0x471b('0x24')]['belongsTo'](db[_0x471b('0x12')],{'as':_0x471b('0x12'),'foreignKey':_0x471b('0x11d')});db['VoiceCallReport']['belongsTo'](db['CmContact'],{'as':_0x471b('0x160'),'foreignKey':'ContactId'});db[_0x471b('0x161')][_0x471b('0x128')](db[_0x471b('0x143')],{'as':'MailAccount','foreignKey':_0x471b('0x162')});db['MailServerOut'][_0x471b('0x128')](db[_0x471b('0x143')],{'as':_0x471b('0x143'),'foreignKey':_0x471b('0x162')});db[_0x471b('0x143')][_0x471b('0x163')](db[_0x471b('0x161')],{'as':_0x471b('0x164'),'onDelete':_0x471b('0x11c')});db[_0x471b('0x143')]['hasOne'](db['MailServerOut'],{'as':_0x471b('0x165'),'onDelete':_0x471b('0x11c')});db[_0x471b('0x143')]['hasMany'](db[_0x471b('0x83')],{'as':_0x471b('0x166'),'foreignKey':_0x471b('0x162')});db[_0x471b('0x143')][_0x471b('0x11e')](db['CannedAnswer'],{'as':_0x471b('0x167'),'foreignKey':'MailAccountId'});db[_0x471b('0x143')][_0x471b('0x11e')](db[_0x471b('0x40')],{'as':_0x471b('0x168'),'foreignKey':'MailAccountId'});db['MailAccount'][_0x471b('0x11e')](db[_0x471b('0x3e')],{'as':_0x471b('0x169')});db['MailAccount'][_0x471b('0x11e')](db['MailApplication'],{'as':_0x471b('0x16a')});db[_0x471b('0x143')][_0x471b('0x128')](db[_0x471b('0x13e')],{'as':_0x471b('0x16b'),'foreignKey':'ListId'});db['MailAccount'][_0x471b('0x128')](db[_0x471b('0x91')],{'as':_0x471b('0x91'),'foreignKey':_0x471b('0x16c')});db[_0x471b('0x143')][_0x471b('0x128')](db[_0x471b('0x88')],{'as':_0x471b('0x159'),'foreignKey':_0x471b('0x16d')});db[_0x471b('0x143')][_0x471b('0x12a')](db[_0x471b('0x12')],{'as':'Agents','through':_0x471b('0x145')});db[_0x471b('0x3a')][_0x471b('0x12a')](db[_0x471b('0x12')],{'as':_0x471b('0x16e'),'through':_0x471b('0x138')});db[_0x471b('0x3a')][_0x471b('0x12a')](db[_0x471b('0x130')],{'through':_0x471b('0x16f'),'as':_0x471b('0x170')});db[_0x471b('0x3e')]['hasMany'](db[_0x471b('0x40')],{'as':_0x471b('0x168'),'onDelete':'cascade','foreignKey':_0x471b('0x171')});db[_0x471b('0x3e')][_0x471b('0x128')](db[_0x471b('0x143')],{'as':_0x471b('0x172'),'foreignKey':_0x471b('0x162')});db[_0x471b('0x3e')]['belongsTo'](db[_0x471b('0x73')],{'as':_0x471b('0x160'),'foreignKey':_0x471b('0x173')});db['MailInteraction'][_0x471b('0x128')](db[_0x471b('0x12')],{'as':_0x471b('0x174'),'foreignKey':_0x471b('0x11d')});db[_0x471b('0x3e')][_0x471b('0x12a')](db[_0x471b('0x175')],{'through':'mail_interaction_has_tags','as':_0x471b('0x176')});db[_0x471b('0x3e')][_0x471b('0x12a')](db[_0x471b('0x175')],{'through':_0x471b('0x177'),'as':_0x471b('0x178')});db[_0x471b('0x3e')][_0x471b('0x12a')](db['User'],{'as':'Users','through':'user_has_mail_interactions','foreignKey':'MailInteractionId'});db[_0x471b('0x40')][_0x471b('0x11e')](db[_0x471b('0x179')],{'as':_0x471b('0x17a'),'onDelete':_0x471b('0x11c')});db[_0x471b('0x40')][_0x471b('0x128')](db['User'],{'as':'User'});db['MailMessage'][_0x471b('0x128')](db[_0x471b('0x73')],{'onDelete':_0x471b('0x11c'),'as':'Contact'});db[_0x471b('0x40')][_0x471b('0x128')](db[_0x471b('0x3e')],{'as':_0x471b('0x17b'),'foreignKey':_0x471b('0x171')});db[_0x471b('0x40')][_0x471b('0x128')](db['MailAccount'],{'as':_0x471b('0x172'),'foreignKey':_0x471b('0x162')});db[_0x471b('0x42')]['belongsTo'](db[_0x471b('0x12')],{'onDelete':'restrict'});db[_0x471b('0x42')][_0x471b('0x128')](db[_0x471b('0x3a')],{'onDelete':_0x471b('0x17c')});db[_0x471b('0x42')][_0x471b('0x128')](db[_0x471b('0x143')],{'onDelete':_0x471b('0x17c')});db['MailApplication'][_0x471b('0x128')](db[_0x471b('0x87')],{'onDelete':_0x471b('0x17c'),'foreignKey':'IntervalId'});db[_0x471b('0x42')][_0x471b('0x128')](db[_0x471b('0x175')],{'onDelete':_0x471b('0x17c'),'foreignKey':_0x471b('0x17d')});db[_0x471b('0x43')][_0x471b('0x128')](db[_0x471b('0x143')],{});db[_0x471b('0x43')][_0x471b('0x128')](db[_0x471b('0x13e')],{'as':_0x471b('0x16b'),'foreignKey':_0x471b('0x17e')});db['MailQueueReport'][_0x471b('0x128')](db[_0x471b('0x73')],{'as':'Contact','foreignKey':_0x471b('0x173')});db['MailQueueReport'][_0x471b('0x128')](db[_0x471b('0x3e')],{});db[_0x471b('0x43')][_0x471b('0x128')](db[_0x471b('0x40')],{});db[_0x471b('0x43')]['belongsTo'](db['User'],{});db['MailQueueReport'][_0x471b('0x128')](db[_0x471b('0x3a')],{});db[_0x471b('0x44')][_0x471b('0x11e')](db[_0x471b('0x46')],{'as':'Items','onDelete':_0x471b('0x11c')});db[_0x471b('0x48')][_0x471b('0x11e')](db[_0x471b('0x83')],{'as':_0x471b('0x166'),'foreignKey':_0x471b('0x17f')});db['FaxAccount']['hasMany'](db[_0x471b('0x81')],{'as':_0x471b('0x167'),'foreignKey':_0x471b('0x17f')});db[_0x471b('0x48')][_0x471b('0x11e')](db[_0x471b('0x4c')],{'as':_0x471b('0x169')});db[_0x471b('0x48')][_0x471b('0x11e')](db['FaxApplication'],{'as':_0x471b('0x16a')});db[_0x471b('0x48')][_0x471b('0x11e')](db[_0x471b('0x18')],{'as':_0x471b('0x180'),'onDelete':_0x471b('0x11c')});db[_0x471b('0x48')][_0x471b('0x11e')](db[_0x471b('0x4e')],{'as':_0x471b('0x168')});db[_0x471b('0x48')][_0x471b('0x128')](db[_0x471b('0x154')],{'as':_0x471b('0x154')});db['FaxAccount'][_0x471b('0x128')](db[_0x471b('0x13e')],{'as':_0x471b('0x16b'),'foreignKey':_0x471b('0x17e')});db[_0x471b('0x48')]['belongsTo'](db[_0x471b('0x88')],{'as':_0x471b('0x159'),'foreignKey':_0x471b('0x16d')});db[_0x471b('0x48')][_0x471b('0x12a')](db[_0x471b('0x12')],{'as':_0x471b('0x16e'),'through':_0x471b('0x142')});db[_0x471b('0x4a')][_0x471b('0x128')](db['User'],{'onDelete':_0x471b('0x17c')});db[_0x471b('0x4a')][_0x471b('0x128')](db['FaxQueue'],{'onDelete':_0x471b('0x17c')});db[_0x471b('0x4a')]['belongsTo'](db['FaxAccount'],{'onDelete':'restrict'});db['FaxApplication'][_0x471b('0x128')](db[_0x471b('0x175')],{'onDelete':_0x471b('0x17c'),'foreignKey':_0x471b('0x17d')});db[_0x471b('0x4c')][_0x471b('0x11e')](db[_0x471b('0x4e')],{'as':_0x471b('0x168'),'onDelete':'cascade','foreignKey':_0x471b('0x181')});db[_0x471b('0x4c')][_0x471b('0x128')](db[_0x471b('0x48')],{'as':'Account','foreignKey':_0x471b('0x17f')});db[_0x471b('0x4c')][_0x471b('0x128')](db[_0x471b('0x73')],{'as':_0x471b('0x160'),'foreignKey':_0x471b('0x173')});db[_0x471b('0x4c')]['belongsTo'](db[_0x471b('0x12')],{'as':_0x471b('0x174'),'foreignKey':_0x471b('0x11d')});db['FaxInteraction']['belongsToMany'](db['Tag'],{'through':_0x471b('0x182'),'as':_0x471b('0x176')});db[_0x471b('0x4c')][_0x471b('0x12a')](db[_0x471b('0x175')],{'through':_0x471b('0x182'),'as':'ThroughTags'});db[_0x471b('0x4c')][_0x471b('0x12a')](db[_0x471b('0x12')],{'as':_0x471b('0x183'),'through':_0x471b('0x133'),'foreignKey':'FaxInteractionId'});db[_0x471b('0x4e')]['belongsTo'](db[_0x471b('0x12')],{'onDelete':_0x471b('0x11c'),'as':_0x471b('0x12')});db[_0x471b('0x4e')][_0x471b('0x128')](db['FaxInteraction'],{'as':_0x471b('0x17b'),'foreignKey':'FaxInteractionId'});db['FaxMessage'][_0x471b('0x128')](db['CmContact'],{'onDelete':_0x471b('0x11c'),'as':_0x471b('0x160')});db['FaxMessage'][_0x471b('0x128')](db[_0x471b('0x179')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x471b('0x4e')][_0x471b('0x128')](db[_0x471b('0x48')],{'as':_0x471b('0x172'),'foreignKey':'FaxAccountId'});db[_0x471b('0x50')][_0x471b('0x12a')](db['User'],{'as':'Agents','through':_0x471b('0x33')});db[_0x471b('0x50')]['belongsToMany'](db[_0x471b('0x130')],{'through':'team_has_fax_queues','as':_0x471b('0x170')});db[_0x471b('0x52')][_0x471b('0x128')](db[_0x471b('0x48')],{});db[_0x471b('0x52')][_0x471b('0x128')](db['CmList'],{'as':_0x471b('0x16b'),'foreignKey':_0x471b('0x17e')});db[_0x471b('0x52')]['belongsTo'](db['CmContact'],{'as':_0x471b('0x160'),'foreignKey':_0x471b('0x173')});db[_0x471b('0x52')][_0x471b('0x128')](db[_0x471b('0x4c')],{});db[_0x471b('0x52')]['belongsTo'](db[_0x471b('0x4e')],{});db[_0x471b('0x52')][_0x471b('0x128')](db[_0x471b('0x12')],{});db[_0x471b('0x52')][_0x471b('0x128')](db['FaxQueue'],{});db[_0x471b('0x54')][_0x471b('0x11e')](db['Disposition'],{'as':_0x471b('0x166'),'foreignKey':'SmsAccountId'});db[_0x471b('0x54')][_0x471b('0x11e')](db[_0x471b('0x81')],{'as':'Answers','foreignKey':'SmsAccountId'});db['SmsAccount'][_0x471b('0x11e')](db[_0x471b('0x58')],{'as':_0x471b('0x168'),'foreignKey':_0x471b('0x184')});db['SmsAccount'][_0x471b('0x11e')](db[_0x471b('0x124')],{'as':_0x471b('0x169')});db[_0x471b('0x54')]['hasMany'](db['SmsApplication'],{'as':'Applications'});db[_0x471b('0x54')][_0x471b('0x128')](db[_0x471b('0x13e')],{'as':_0x471b('0x16b'),'foreignKey':'ListId'});db[_0x471b('0x54')][_0x471b('0x128')](db[_0x471b('0x88')],{'as':_0x471b('0x159'),'foreignKey':_0x471b('0x16d')});db[_0x471b('0x54')][_0x471b('0x12a')](db[_0x471b('0x12')],{'as':_0x471b('0x16e'),'through':'user_has_sms_accounts'});db[_0x471b('0x55')]['belongsTo'](db[_0x471b('0x12')],{'onDelete':_0x471b('0x17c')});db[_0x471b('0x55')][_0x471b('0x128')](db['SmsQueue'],{'onDelete':_0x471b('0x17c')});db[_0x471b('0x55')]['belongsTo'](db['SmsAccount'],{'onDelete':_0x471b('0x17c')});db['SmsApplication']['belongsTo'](db[_0x471b('0x87')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0x471b('0x55')][_0x471b('0x128')](db[_0x471b('0x175')],{'onDelete':_0x471b('0x17c'),'foreignKey':_0x471b('0x17d')});db[_0x471b('0x124')][_0x471b('0x11e')](db['SmsMessage'],{'as':_0x471b('0x168'),'onDelete':'cascade','foreignKey':'SmsInteractionId'});db[_0x471b('0x124')][_0x471b('0x128')](db['SmsAccount'],{'as':_0x471b('0x172'),'foreignKey':_0x471b('0x184')});db[_0x471b('0x124')][_0x471b('0x128')](db[_0x471b('0x73')],{'as':_0x471b('0x160'),'foreignKey':'ContactId'});db[_0x471b('0x124')][_0x471b('0x128')](db[_0x471b('0x12')],{'as':_0x471b('0x174'),'foreignKey':_0x471b('0x11d')});db[_0x471b('0x124')]['belongsToMany'](db['Tag'],{'through':_0x471b('0x185'),'as':_0x471b('0x176')});db[_0x471b('0x124')][_0x471b('0x12a')](db[_0x471b('0x175')],{'through':_0x471b('0x185'),'as':_0x471b('0x178')});db[_0x471b('0x124')][_0x471b('0x12a')](db[_0x471b('0x12')],{'as':_0x471b('0x183'),'through':_0x471b('0x134'),'foreignKey':_0x471b('0x186')});db[_0x471b('0x58')][_0x471b('0x128')](db[_0x471b('0x12')],{'as':'User'});db[_0x471b('0x58')][_0x471b('0x128')](db[_0x471b('0x73')],{'onDelete':_0x471b('0x11c'),'as':_0x471b('0x160')});db[_0x471b('0x58')][_0x471b('0x128')](db[_0x471b('0x124')],{'onDelete':_0x471b('0x11c'),'as':_0x471b('0x17b'),'foreignKey':_0x471b('0x186')});db[_0x471b('0x58')][_0x471b('0x128')](db[_0x471b('0x54')],{'as':_0x471b('0x172'),'foreignKey':_0x471b('0x184')});db['SmsQueue'][_0x471b('0x12a')](db[_0x471b('0x12')],{'as':_0x471b('0x16e'),'through':'UserSmsQueue','foreignKey':_0x471b('0x187')});db[_0x471b('0x5a')][_0x471b('0x12a')](db[_0x471b('0x130')],{'through':_0x471b('0x188'),'as':'Teams'});db[_0x471b('0x5b')]['hasMany'](db[_0x471b('0x83')],{'as':_0x471b('0x166'),'foreignKey':_0x471b('0x189')});db['OpenchannelAccount']['hasMany'](db[_0x471b('0x81')],{'as':_0x471b('0x167'),'foreignKey':_0x471b('0x189')});db['OpenchannelAccount'][_0x471b('0x11e')](db[_0x471b('0x5e')],{'as':_0x471b('0x169'),'foreignKey':'OpenchannelAccountId'});db[_0x471b('0x5b')][_0x471b('0x11e')](db['OpenchannelMessage'],{'as':_0x471b('0x168'),'foreignKey':_0x471b('0x189')});db['OpenchannelAccount'][_0x471b('0x11e')](db[_0x471b('0x5d')],{'as':_0x471b('0x16a'),'foreignKey':_0x471b('0x189')});db[_0x471b('0x5b')][_0x471b('0x128')](db[_0x471b('0x13e')],{'as':'List','foreignKey':'ListId'});db[_0x471b('0x5b')]['belongsTo'](db[_0x471b('0x88')],{'as':_0x471b('0x159'),'foreignKey':_0x471b('0x16d')});db['OpenchannelAccount']['belongsToMany'](db['User'],{'as':_0x471b('0x16e'),'through':_0x471b('0x147')});db[_0x471b('0x5d')][_0x471b('0x128')](db[_0x471b('0x12')],{'onDelete':_0x471b('0x17c')});db['OpenchannelApplication'][_0x471b('0x128')](db[_0x471b('0x62')],{'onDelete':_0x471b('0x17c'),'foreignKey':_0x471b('0x18a')});db[_0x471b('0x5d')][_0x471b('0x128')](db[_0x471b('0x5b')],{'onDelete':_0x471b('0x17c'),'foreignKey':_0x471b('0x189')});db['OpenchannelApplication'][_0x471b('0x128')](db[_0x471b('0x87')],{'onDelete':_0x471b('0x17c'),'foreignKey':'IntervalId'});db[_0x471b('0x5d')][_0x471b('0x128')](db[_0x471b('0x175')],{'onDelete':_0x471b('0x17c'),'foreignKey':_0x471b('0x17d')});db[_0x471b('0x5e')][_0x471b('0x11e')](db[_0x471b('0x60')],{'as':_0x471b('0x168'),'onDelete':_0x471b('0x11c'),'foreignKey':_0x471b('0x18b')});db['OpenchannelInteraction'][_0x471b('0x128')](db[_0x471b('0x5b')],{'as':_0x471b('0x172'),'foreignKey':_0x471b('0x189')});db[_0x471b('0x5e')][_0x471b('0x128')](db[_0x471b('0x73')],{'as':_0x471b('0x160'),'foreignKey':_0x471b('0x173')});db[_0x471b('0x5e')][_0x471b('0x128')](db['User'],{'as':_0x471b('0x174'),'foreignKey':_0x471b('0x11d')});db[_0x471b('0x5e')][_0x471b('0x12a')](db[_0x471b('0x175')],{'through':_0x471b('0x18c'),'as':_0x471b('0x176')});db['OpenchannelInteraction'][_0x471b('0x12a')](db['Tag'],{'through':_0x471b('0x18c'),'as':_0x471b('0x178')});db[_0x471b('0x5e')][_0x471b('0x12a')](db['User'],{'as':_0x471b('0x183'),'through':_0x471b('0x135'),'foreignKey':'OpenchannelInteractionId'});db[_0x471b('0x60')][_0x471b('0x128')](db[_0x471b('0x12')],{'onDelete':'cascade','as':'User'});db[_0x471b('0x60')][_0x471b('0x128')](db['CmContact'],{'onDelete':_0x471b('0x11c'),'as':_0x471b('0x160')});db[_0x471b('0x60')][_0x471b('0x128')](db['OpenchannelInteraction'],{'onDelete':_0x471b('0x11c'),'as':_0x471b('0x17b'),'foreignKey':_0x471b('0x18b')});db[_0x471b('0x60')]['belongsTo'](db[_0x471b('0x179')],{'as':_0x471b('0x179'),'foreignKey':_0x471b('0x18d')});db[_0x471b('0x60')]['belongsTo'](db[_0x471b('0x5b')],{'as':_0x471b('0x172'),'foreignKey':_0x471b('0x189')});db['OpenchannelQueue'][_0x471b('0x12a')](db['User'],{'as':_0x471b('0x16e'),'through':_0x471b('0x13d'),'foreignKey':_0x471b('0x18a')});db[_0x471b('0x62')]['belongsToMany'](db[_0x471b('0x130')],{'through':_0x471b('0x18e'),'as':_0x471b('0x170')});db[_0x471b('0x141')]['hasMany'](db[_0x471b('0x83')],{'as':'Dispositions','foreignKey':_0x471b('0x18f')});db[_0x471b('0x141')][_0x471b('0x11e')](db[_0x471b('0x81')],{'as':_0x471b('0x167'),'foreignKey':_0x471b('0x18f')});db[_0x471b('0x141')][_0x471b('0x11e')](db['ChatProactiveAction'],{'as':'ProactiveActions'});db[_0x471b('0x141')][_0x471b('0x11e')](db[_0x471b('0x67')],{'as':'Interactions'});db[_0x471b('0x141')][_0x471b('0x11e')](db[_0x471b('0x190')],{'as':_0x471b('0x16a')});db[_0x471b('0x141')]['hasMany'](db[_0x471b('0x69')],{'as':_0x471b('0x168')});db[_0x471b('0x141')]['belongsTo'](db[_0x471b('0x13e')],{'as':_0x471b('0x16b'),'foreignKey':_0x471b('0x17e')});db[_0x471b('0x141')][_0x471b('0x128')](db['Interval'],{'as':_0x471b('0x87'),'foreignKey':_0x471b('0x158')});db['ChatWebsite'][_0x471b('0x128')](db[_0x471b('0x88')],{'as':_0x471b('0x159'),'foreignKey':_0x471b('0x16d')});db[_0x471b('0x141')][_0x471b('0x12a')](db[_0x471b('0x12')],{'as':'Agents','through':_0x471b('0x191')});db[_0x471b('0x64')][_0x471b('0x128')](db[_0x471b('0x5b')],{});db[_0x471b('0x64')][_0x471b('0x128')](db[_0x471b('0x13e')],{'as':_0x471b('0x16b'),'foreignKey':'ListId'});db[_0x471b('0x64')]['belongsTo'](db[_0x471b('0x73')],{'as':_0x471b('0x160'),'foreignKey':'ContactId'});db[_0x471b('0x64')][_0x471b('0x128')](db[_0x471b('0x5e')],{});db['OpenchannelQueueReport'][_0x471b('0x128')](db[_0x471b('0x60')],{});db[_0x471b('0x64')][_0x471b('0x128')](db['User'],{});db[_0x471b('0x64')][_0x471b('0x128')](db[_0x471b('0x62')],{});db[_0x471b('0x190')][_0x471b('0x128')](db[_0x471b('0x12')],{'as':_0x471b('0x192'),'foreignKey':_0x471b('0x11d'),'onDelete':_0x471b('0x17c')});db[_0x471b('0x190')][_0x471b('0x128')](db[_0x471b('0x139')],{'as':_0x471b('0x193'),'foreignKey':'ChatQueueId','onDelete':_0x471b('0x17c')});db['ChatApplication'][_0x471b('0x128')](db[_0x471b('0x141')],{'as':_0x471b('0x194'),'foreignKey':_0x471b('0x18f'),'onDelete':_0x471b('0x17c')});db['ChatApplication'][_0x471b('0x128')](db[_0x471b('0x175')],{'onDelete':'restrict','foreignKey':_0x471b('0x17d')});db[_0x471b('0x67')][_0x471b('0x11e')](db[_0x471b('0x69')],{'as':_0x471b('0x168'),'onDelete':_0x471b('0x11c'),'foreignKey':_0x471b('0x195')});db[_0x471b('0x67')][_0x471b('0x128')](db[_0x471b('0x141')],{'as':_0x471b('0x172'),'foreignKey':_0x471b('0x18f')});db[_0x471b('0x67')][_0x471b('0x128')](db[_0x471b('0x73')],{'as':_0x471b('0x160'),'foreignKey':_0x471b('0x173')});db[_0x471b('0x67')][_0x471b('0x128')](db[_0x471b('0x12')],{'as':_0x471b('0x174'),'foreignKey':_0x471b('0x11d')});db[_0x471b('0x67')]['belongsToMany'](db[_0x471b('0x175')],{'through':_0x471b('0x196'),'as':_0x471b('0x176')});db[_0x471b('0x67')][_0x471b('0x12a')](db[_0x471b('0x175')],{'through':'chat_interaction_has_tags','as':_0x471b('0x178')});db[_0x471b('0x67')][_0x471b('0x12a')](db[_0x471b('0x12')],{'as':_0x471b('0x183'),'through':_0x471b('0x132'),'foreignKey':'ChatInteractionId'});db['ChatMessage'][_0x471b('0x128')](db[_0x471b('0x12')],{'onDelete':_0x471b('0x11c'),'as':_0x471b('0x12')});db[_0x471b('0x69')][_0x471b('0x128')](db[_0x471b('0x73')],{'onDelete':_0x471b('0x11c'),'as':_0x471b('0x160'),'foreignKey':_0x471b('0x173')});db[_0x471b('0x69')]['belongsTo'](db[_0x471b('0x67')],{'onDelete':'cascade','as':_0x471b('0x17b'),'foreignKey':_0x471b('0x195')});db[_0x471b('0x69')][_0x471b('0x128')](db[_0x471b('0x179')],{'as':'Attachment','foreignKey':_0x471b('0x18d')});db[_0x471b('0x69')][_0x471b('0x128')](db[_0x471b('0x141')],{'as':_0x471b('0x172'),'foreignKey':_0x471b('0x18f')});db[_0x471b('0x6b')][_0x471b('0x128')](db[_0x471b('0x73')],{'onDelete':'cascade','as':_0x471b('0x160'),'foreignKey':_0x471b('0x173')});db[_0x471b('0x6b')]['belongsTo'](db[_0x471b('0x141')],{'as':_0x471b('0x172'),'foreignKey':_0x471b('0x18f')});db[_0x471b('0x139')][_0x471b('0x12a')](db['User'],{'as':_0x471b('0x16e'),'through':_0x471b('0x31'),'hooks':!![]});db[_0x471b('0x139')][_0x471b('0x12a')](db[_0x471b('0x130')],{'through':'team_has_chat_queues','as':'Teams'});db['ChatGroup'][_0x471b('0x11e')](db['ChatInternalMessage'],{'as':_0x471b('0x168'),'foreignKey':_0x471b('0x197'),'onDelete':_0x471b('0x11c')});db['ChatGroup'][_0x471b('0x12a')](db[_0x471b('0x12')],{'as':_0x471b('0x14f'),'through':_0x471b('0x12c')});db[_0x471b('0x70')][_0x471b('0x128')](db[_0x471b('0x141')],{'as':_0x471b('0x194'),'foreignKey':_0x471b('0x18f')});db[_0x471b('0x71')][_0x471b('0x163')](db['CmCompany'],{'as':_0x471b('0x198')});db[_0x471b('0x71')][_0x471b('0x11e')](db[_0x471b('0x73')],{'as':_0x471b('0x199'),'foreignKey':_0x471b('0x19a')});db['CmCompany'][_0x471b('0x11e')](db[_0x471b('0xf9')],{'as':'PriceLists','foreignKey':'CompanyId'});db[_0x471b('0x71')][_0x471b('0x11e')](db[_0x471b('0xfd')],{'as':_0x471b('0x19b'),'foreignKey':_0x471b('0x19a')});db['CmCompany'][_0x471b('0x128')](db[_0x471b('0x19c')],{'as':_0x471b('0x19d'),'foreignKey':_0x471b('0x19e')});db[_0x471b('0x73')]['hasMany'](db[_0x471b('0x75')],{'as':_0x471b('0x151'),'foreignKey':_0x471b('0x173')});db['CmContact'][_0x471b('0x11e')](db[_0x471b('0x77')],{'as':_0x471b('0x120'),'foreignKey':'ContactId'});db['CmContact'][_0x471b('0x11e')](db[_0x471b('0x121')],{'as':_0x471b('0x152'),'foreignKey':_0x471b('0x173')});db[_0x471b('0x73')][_0x471b('0x11e')](db['ReportAgentPreview'],{'as':_0x471b('0x7a'),'foreignKey':_0x471b('0x173')});db[_0x471b('0x73')][_0x471b('0x11e')](db['JscriptySessionReport'],{'as':_0x471b('0x19f'),'foreignKey':'ContactId'});db['CmContact'][_0x471b('0x11e')](db['OpenchannelInteraction'],{'as':_0x471b('0x1a0'),'foreignKey':_0x471b('0x173'),'onDelete':_0x471b('0x17c')});db[_0x471b('0x73')][_0x471b('0x11e')](db[_0x471b('0x67')],{'as':_0x471b('0x123'),'foreignKey':_0x471b('0x173'),'onDelete':_0x471b('0x17c')});db[_0x471b('0x73')][_0x471b('0x11e')](db[_0x471b('0x124')],{'as':_0x471b('0x125'),'foreignKey':'ContactId','onDelete':_0x471b('0x17c')});db[_0x471b('0x73')]['hasMany'](db['FaxInteraction'],{'as':_0x471b('0x126'),'foreignKey':'ContactId','onDelete':_0x471b('0x17c')});db[_0x471b('0x73')]['hasMany'](db['MailInteraction'],{'as':_0x471b('0x127'),'foreignKey':_0x471b('0x173'),'onDelete':_0x471b('0x17c')});db[_0x471b('0x73')][_0x471b('0x11e')](db[_0x471b('0xfd')],{'as':_0x471b('0x160'),'foreignKey':_0x471b('0x173'),'onDelete':'restrict'});db[_0x471b('0x73')][_0x471b('0x128')](db[_0x471b('0x71')],{'as':_0x471b('0x1a1'),'foreignKey':_0x471b('0x19a')});db[_0x471b('0x73')][_0x471b('0x128')](db[_0x471b('0x13e')],{'as':_0x471b('0x16b'),'foreignKey':_0x471b('0x17e'),'onDelete':'cascade'});db[_0x471b('0x73')][_0x471b('0x12a')](db[_0x471b('0x12')],{'as':_0x471b('0x183'),'through':_0x471b('0x12d')});db[_0x471b('0x73')]['belongsToMany'](db[_0x471b('0x175')],{'as':_0x471b('0x176'),'through':_0x471b('0x1a2')});db[_0x471b('0x73')][_0x471b('0x12a')](db[_0x471b('0x175')],{'through':_0x471b('0x1a2'),'as':'ThroughTags'});db[_0x471b('0x75')]['belongsTo'](db['CmContact'],{'as':_0x471b('0x160'),'foreignKey':_0x471b('0x173'),'onDelete':_0x471b('0x11c')});db['CmHopper'][_0x471b('0x128')](db[_0x471b('0x13e')],{'as':_0x471b('0x16b'),'foreignKey':'ListId','onDelete':_0x471b('0x11c')});db['CmHopper'][_0x471b('0x128')](db[_0x471b('0x12')],{'as':_0x471b('0x192'),'foreignKey':_0x471b('0x11d')});db[_0x471b('0x75')][_0x471b('0x128')](db[_0x471b('0x1a')],{'as':_0x471b('0x193'),'foreignKey':_0x471b('0x150'),'onDelete':_0x471b('0x11c')});db[_0x471b('0x75')][_0x471b('0x128')](db['Campaign'],{'as':_0x471b('0xda'),'foreignKey':_0x471b('0x1a3'),'onDelete':_0x471b('0x11c')});db[_0x471b('0x75')][_0x471b('0x128')](db[_0x471b('0x12')],{'as':'Owner','foreignKey':_0x471b('0x1a4')});db[_0x471b('0x1a5')][_0x471b('0x128')](db['CmContact'],{'as':'Contact','foreignKey':_0x471b('0x173'),'onDelete':_0x471b('0x11c')});db[_0x471b('0x1a5')]['belongsTo'](db[_0x471b('0x13e')],{'as':'List','foreignKey':_0x471b('0x17e'),'onDelete':_0x471b('0x11c')});db[_0x471b('0x1a5')]['belongsTo'](db[_0x471b('0x1a')],{'as':'Queue','foreignKey':_0x471b('0x150'),'onDelete':_0x471b('0x11c')});db[_0x471b('0x1a5')][_0x471b('0x128')](db[_0x471b('0xda')],{'as':'Campaign','foreignKey':_0x471b('0x1a3'),'onDelete':'cascade'});db[_0x471b('0x80')][_0x471b('0x11e')](db['Condition'],{'as':{'plural':_0x471b('0x1a6'),'singular':'OneAll'},'foreignKey':'AutomationAllId','onDelete':_0x471b('0x11c'),'hooks':!![]});db[_0x471b('0x80')][_0x471b('0x11e')](db[_0x471b('0x85')],{'as':{'plural':_0x471b('0x1a7'),'singular':_0x471b('0x1a8')},'foreignKey':_0x471b('0x1a9'),'onDelete':_0x471b('0x11c'),'hooks':!![]});db['Automation'][_0x471b('0x11e')](db[_0x471b('0x7e')],{'as':_0x471b('0x1aa'),'foreignKey':'AutomationId','onDelete':_0x471b('0x11c'),'hooks':!![]});db[_0x471b('0x87')][_0x471b('0x11e')](db[_0x471b('0x87')],{'as':_0x471b('0x1ab'),'foreignKey':_0x471b('0x158'),'onDelete':_0x471b('0x11c'),'hooks':!![],'required':![]});db[_0x471b('0x87')][_0x471b('0x11e')](db[_0x471b('0x18')],{'as':'Extensions','foreignKey':'IntervalId','onDelete':_0x471b('0x17c')});db[_0x471b('0x87')][_0x471b('0x11e')](db[_0x471b('0x42')],{'as':_0x471b('0x1ac'),'foreignKey':_0x471b('0x158')});db['Interval'][_0x471b('0x11e')](db[_0x471b('0x190')],{'as':_0x471b('0x1ad'),'foreignKey':_0x471b('0x158')});db[_0x471b('0x87')][_0x471b('0x11e')](db['FaxApplication'],{'as':_0x471b('0x1ae'),'foreignKey':_0x471b('0x158')});db[_0x471b('0x87')][_0x471b('0x11e')](db['SmsApplication'],{'as':_0x471b('0x1af'),'foreignKey':'IntervalId'});db[_0x471b('0x8d')]['belongsTo'](db['MailAccount'],{});db['Schedule']['belongsTo'](db[_0x471b('0x9a')],{'foreignKey':_0x471b('0x1b0')});db[_0x471b('0x8d')][_0x471b('0x128')](db['AnalyticCustomReport'],{'foreignKey':'CustomReportId'});db[_0x471b('0x8e')][_0x471b('0x12a')](db['VoiceMusicOnHold'],{'as':_0x471b('0x1b1'),'through':_0x471b('0x14e'),'onDelete':'restrict'});db[_0x471b('0x175')][_0x471b('0x12a')](db[_0x471b('0x73')],{'through':_0x471b('0x1a2')});db['Tag'][_0x471b('0x12a')](db[_0x471b('0x67')],{'through':'chat_interaction_has_tags'});db[_0x471b('0x175')][_0x471b('0x12a')](db[_0x471b('0x3e')],{'through':_0x471b('0x177')});db[_0x471b('0x175')][_0x471b('0x12a')](db['SmsInteraction'],{'through':_0x471b('0x185')});db[_0x471b('0x175')][_0x471b('0x12a')](db[_0x471b('0x4c')],{'through':_0x471b('0x182')});db[_0x471b('0x175')][_0x471b('0x12a')](db[_0x471b('0x5e')],{'through':'openchannel_interaction_has_tags'});db[_0x471b('0x93')][_0x471b('0x11e')](db[_0x471b('0x85')],{'as':{'plural':'AllConditions','singular':_0x471b('0x1b2')},'foreignKey':_0x471b('0x1b3'),'onDelete':_0x471b('0x11c'),'hooks':!![]});db[_0x471b('0x93')][_0x471b('0x11e')](db[_0x471b('0x85')],{'as':{'plural':_0x471b('0x1b4'),'singular':_0x471b('0x1b5')},'foreignKey':_0x471b('0x1b6'),'onDelete':'cascade','hooks':!![]});db[_0x471b('0x93')][_0x471b('0x11e')](db[_0x471b('0x7e')],{'as':_0x471b('0x1aa'),'foreignKey':_0x471b('0x1b7'),'onDelete':_0x471b('0x11c'),'hooks':!![]});db['AnalyticCustomReport'][_0x471b('0x11e')](db[_0x471b('0x1b8')],{'as':'Fields','onDelete':_0x471b('0x11c'),'foreignKey':_0x471b('0x1b9'),'hooks':!![]});db[_0x471b('0x9a')][_0x471b('0x11e')](db[_0x471b('0x1b8')],{'as':_0x471b('0x1ba'),'onDelete':'cascade','foreignKey':_0x471b('0x1b0')});db['AnalyticMetric']['hasMany'](db[_0x471b('0x1b8')],{'as':_0x471b('0x1ba'),'onDelete':'cascade','foreignKey':'MetricId'});db['AnalyticFieldReport'][_0x471b('0x128')](db[_0x471b('0x9e')],{'foreignKey':'MetricId'});db[_0x471b('0xa3')][_0x471b('0x11e')](db['SalesforceConfiguration'],{'as':_0x471b('0x1bb'),'onDelete':_0x471b('0x11c'),'foreignKey':_0x471b('0x1bc')});db[_0x471b('0x1bd')]['hasMany'](db[_0x471b('0x1be')],{'as':_0x471b('0x1bf'),'onDelete':_0x471b('0x11c'),'foreignKey':_0x471b('0x1c0')});db[_0x471b('0x1bd')][_0x471b('0x11e')](db['SalesforceField'],{'as':_0x471b('0x1c1'),'onDelete':_0x471b('0x11c'),'foreignKey':_0x471b('0x1c2')});db[_0x471b('0x1bd')]['hasMany'](db['SalesforceField'],{'as':'Fields','onDelete':_0x471b('0x11c'),'foreignKey':_0x471b('0x1c3')});db[_0x471b('0x1bd')][_0x471b('0x128')](db[_0x471b('0xa3')],{'as':'Account','foreignKey':_0x471b('0x1bc')});db['SalesforceField'][_0x471b('0x11e')](db[_0x471b('0x1be')],{'as':_0x471b('0x1c4'),'foreignKey':_0x471b('0x1c0')});db[_0x471b('0x1be')][_0x471b('0x11e')](db[_0x471b('0x1be')],{'as':_0x471b('0x1c5'),'foreignKey':'DescriptionId'});db[_0x471b('0x1be')][_0x471b('0x11e')](db['SalesforceField'],{'as':_0x471b('0x1c6'),'foreignKey':_0x471b('0x1c3')});db[_0x471b('0x1be')][_0x471b('0x128')](db[_0x471b('0x95')],{'as':_0x471b('0x95'),'foreignKey':'VariableId'});db[_0x471b('0x1c7')][_0x471b('0x11e')](db[_0x471b('0xa8')],{'as':_0x471b('0x1bb'),'onDelete':'cascade','foreignKey':_0x471b('0x1bc')});db['SugarcrmConfiguration'][_0x471b('0x11e')](db[_0x471b('0xa9')],{'as':_0x471b('0x1bf'),'onDelete':_0x471b('0x11c'),'foreignKey':'SubjectId'});db[_0x471b('0xa8')][_0x471b('0x11e')](db[_0x471b('0xa9')],{'as':'Descriptions','onDelete':_0x471b('0x11c'),'foreignKey':_0x471b('0x1c2')});db[_0x471b('0xa8')][_0x471b('0x11e')](db['SugarcrmField'],{'as':_0x471b('0x1ba'),'onDelete':_0x471b('0x11c'),'foreignKey':_0x471b('0x1c3')});db[_0x471b('0xa8')][_0x471b('0x128')](db['SugarcrmAccount'],{'as':_0x471b('0x172'),'foreignKey':'AccountId'});db[_0x471b('0xa9')][_0x471b('0x11e')](db[_0x471b('0xa9')],{'as':_0x471b('0x1c4'),'foreignKey':'SubjectId'});db[_0x471b('0xa9')][_0x471b('0x11e')](db['SugarcrmField'],{'as':'Description','foreignKey':_0x471b('0x1c2')});db['SugarcrmField']['hasMany'](db[_0x471b('0xa9')],{'as':_0x471b('0x1c6'),'foreignKey':'FieldId'});db[_0x471b('0xa9')][_0x471b('0x128')](db[_0x471b('0x95')],{'as':_0x471b('0x95'),'foreignKey':_0x471b('0x1c8')});db['DeskAccount'][_0x471b('0x11e')](db[_0x471b('0xac')],{'as':_0x471b('0x1bb'),'onDelete':_0x471b('0x11c'),'foreignKey':'AccountId'});db[_0x471b('0xac')][_0x471b('0x11e')](db[_0x471b('0x1c9')],{'as':_0x471b('0x1bf'),'onDelete':_0x471b('0x11c'),'foreignKey':'SubjectId'});db['DeskConfiguration'][_0x471b('0x11e')](db['DeskField'],{'as':_0x471b('0x1c1'),'onDelete':'cascade','foreignKey':_0x471b('0x1c2')});db[_0x471b('0xac')][_0x471b('0x11e')](db[_0x471b('0x1c9')],{'as':_0x471b('0x1ba'),'onDelete':'cascade','foreignKey':_0x471b('0x1c3')});db[_0x471b('0xac')][_0x471b('0x128')](db[_0x471b('0xab')],{'as':_0x471b('0x172'),'foreignKey':'AccountId'});db[_0x471b('0xac')][_0x471b('0x12a')](db[_0x471b('0x175')],{'through':'int_desk_configuration_has_tags'});db[_0x471b('0x1c9')][_0x471b('0x11e')](db[_0x471b('0x1c9')],{'as':_0x471b('0x1c4'),'foreignKey':'SubjectId'});db[_0x471b('0x1c9')][_0x471b('0x11e')](db[_0x471b('0x1c9')],{'as':_0x471b('0x1c5'),'foreignKey':_0x471b('0x1c2')});db[_0x471b('0x1c9')][_0x471b('0x11e')](db[_0x471b('0x1c9')],{'as':'Field','foreignKey':'FieldId'});db['DeskField'][_0x471b('0x128')](db['Variable'],{'as':'Variable','foreignKey':_0x471b('0x1c8')});db[_0x471b('0xaf')][_0x471b('0x11e')](db[_0x471b('0xb0')],{'as':_0x471b('0x1bb'),'onDelete':_0x471b('0x11c'),'foreignKey':_0x471b('0x1bc')});db[_0x471b('0xb0')][_0x471b('0x11e')](db['ZohoField'],{'as':'Subjects','onDelete':_0x471b('0x11c'),'foreignKey':'SubjectId'});db['ZohoConfiguration'][_0x471b('0x11e')](db[_0x471b('0xb1')],{'as':_0x471b('0x1c1'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x471b('0xb0')][_0x471b('0x11e')](db['ZohoField'],{'as':_0x471b('0x1ba'),'onDelete':_0x471b('0x11c'),'foreignKey':_0x471b('0x1c3')});db['ZohoConfiguration'][_0x471b('0x128')](db[_0x471b('0xaf')],{'as':_0x471b('0x172'),'foreignKey':'AccountId'});db[_0x471b('0xb1')][_0x471b('0x11e')](db['ZohoField'],{'as':_0x471b('0x1c4'),'foreignKey':_0x471b('0x1c0')});db['ZohoField'][_0x471b('0x11e')](db[_0x471b('0xb1')],{'as':_0x471b('0x1c5'),'foreignKey':_0x471b('0x1c2')});db[_0x471b('0xb1')][_0x471b('0x11e')](db['ZohoField'],{'as':'Field','foreignKey':_0x471b('0x1c3')});db[_0x471b('0xb1')]['belongsTo'](db['Variable'],{'as':_0x471b('0x95'),'foreignKey':_0x471b('0x1c8')});db['ZendeskAccount'][_0x471b('0x11e')](db['ZendeskConfiguration'],{'as':_0x471b('0x1bb'),'onDelete':_0x471b('0x11c'),'foreignKey':_0x471b('0x1bc')});db[_0x471b('0x1ca')][_0x471b('0x11e')](db[_0x471b('0xb4')],{'as':_0x471b('0x1bf'),'foreignKey':_0x471b('0x1c0')});db[_0x471b('0x1ca')]['hasMany'](db['ZendeskField'],{'as':_0x471b('0x1c1'),'foreignKey':_0x471b('0x1c2')});db['ZendeskConfiguration'][_0x471b('0x11e')](db['ZendeskField'],{'as':'Fields','foreignKey':'FieldId'});db[_0x471b('0x1ca')][_0x471b('0x128')](db['ZendeskAccount'],{'as':_0x471b('0x172'),'foreignKey':'AccountId'});db[_0x471b('0x1ca')]['belongsToMany'](db[_0x471b('0x175')],{'through':'int_zendesk_configuration_has_tags'});db['ZendeskField'][_0x471b('0x11e')](db[_0x471b('0xb4')],{'as':'Subject','foreignKey':_0x471b('0x1c0')});db[_0x471b('0xb4')][_0x471b('0x11e')](db[_0x471b('0xb4')],{'as':_0x471b('0x1c5'),'foreignKey':_0x471b('0x1c2')});db[_0x471b('0xb4')]['hasMany'](db[_0x471b('0xb4')],{'as':_0x471b('0x1c6'),'foreignKey':_0x471b('0x1c3')});db[_0x471b('0xb4')][_0x471b('0x128')](db['Variable'],{'as':_0x471b('0x95'),'foreignKey':_0x471b('0x1c8')});db[_0x471b('0x1cb')][_0x471b('0x11e')](db[_0x471b('0xb7')],{'as':_0x471b('0x1bb'),'onDelete':_0x471b('0x11c'),'foreignKey':'AccountId'});db['FreshdeskConfiguration'][_0x471b('0x11e')](db['FreshdeskField'],{'as':_0x471b('0x1bf'),'onDelete':_0x471b('0x11c'),'foreignKey':_0x471b('0x1c0')});db['FreshdeskConfiguration']['hasMany'](db[_0x471b('0x1cc')],{'as':_0x471b('0x1c1'),'onDelete':_0x471b('0x11c'),'foreignKey':'DescriptionId'});db['FreshdeskConfiguration']['hasMany'](db[_0x471b('0x1cc')],{'as':_0x471b('0x1ba'),'onDelete':_0x471b('0x11c'),'foreignKey':'FieldId'});db[_0x471b('0xb7')][_0x471b('0x128')](db[_0x471b('0x1cb')],{'as':_0x471b('0x172'),'foreignKey':_0x471b('0x1bc')});db[_0x471b('0xb7')][_0x471b('0x12a')](db[_0x471b('0x175')],{'through':_0x471b('0x1cd')});db['FreshdeskField'][_0x471b('0x11e')](db[_0x471b('0x1cc')],{'as':_0x471b('0x1c4'),'foreignKey':_0x471b('0x1c0')});db[_0x471b('0x1cc')][_0x471b('0x11e')](db[_0x471b('0x1cc')],{'as':_0x471b('0x1c5'),'foreignKey':_0x471b('0x1c2')});db[_0x471b('0x1cc')][_0x471b('0x11e')](db[_0x471b('0x1cc')],{'as':_0x471b('0x1c6'),'foreignKey':_0x471b('0x1c3')});db[_0x471b('0x1cc')][_0x471b('0x128')](db[_0x471b('0x95')],{'as':_0x471b('0x95'),'foreignKey':_0x471b('0x1c8')});db[_0x471b('0x1ce')][_0x471b('0x11e')](db[_0x471b('0xba')],{'as':_0x471b('0x1bb'),'onDelete':'cascade','foreignKey':_0x471b('0x1bc')});db[_0x471b('0xba')]['hasMany'](db[_0x471b('0x1cf')],{'as':_0x471b('0x1bf'),'foreignKey':_0x471b('0x1c0')});db[_0x471b('0xba')][_0x471b('0x11e')](db[_0x471b('0x1cf')],{'as':_0x471b('0x1c1'),'foreignKey':_0x471b('0x1c2')});db[_0x471b('0xba')][_0x471b('0x11e')](db['VtigerField'],{'as':'Fields','foreignKey':_0x471b('0x1c3')});db[_0x471b('0xba')][_0x471b('0x128')](db[_0x471b('0x1ce')],{'as':_0x471b('0x172'),'foreignKey':_0x471b('0x1bc')});db['VtigerConfiguration'][_0x471b('0x12a')](db[_0x471b('0x175')],{'through':_0x471b('0x1d0')});db['VtigerField'][_0x471b('0x11e')](db[_0x471b('0x1cf')],{'as':_0x471b('0x1c4'),'foreignKey':'SubjectId'});db['VtigerField'][_0x471b('0x11e')](db[_0x471b('0x1cf')],{'as':_0x471b('0x1c5'),'foreignKey':_0x471b('0x1c2')});db[_0x471b('0x1cf')][_0x471b('0x11e')](db[_0x471b('0x1cf')],{'as':_0x471b('0x1c6'),'foreignKey':_0x471b('0x1c3')});db[_0x471b('0x1cf')][_0x471b('0x128')](db[_0x471b('0x95')],{'as':_0x471b('0x95'),'foreignKey':'VariableId'});db[_0x471b('0xbd')][_0x471b('0x11e')](db[_0x471b('0xbe')],{'as':_0x471b('0x1bb'),'onDelete':_0x471b('0x11c'),'foreignKey':_0x471b('0x1bc')});db[_0x471b('0xbe')][_0x471b('0x11e')](db[_0x471b('0x1d1')],{'as':_0x471b('0x1bf'),'foreignKey':'SubjectId'});db[_0x471b('0xbe')]['hasMany'](db[_0x471b('0x1d1')],{'as':_0x471b('0x1c1'),'foreignKey':_0x471b('0x1c2')});db[_0x471b('0xbe')][_0x471b('0x11e')](db[_0x471b('0x1d1')],{'as':_0x471b('0x1ba'),'foreignKey':_0x471b('0x1c3')});db[_0x471b('0xbe')][_0x471b('0x128')](db[_0x471b('0xbd')],{'as':_0x471b('0x172'),'foreignKey':_0x471b('0x1bc')});db[_0x471b('0x1d1')][_0x471b('0x11e')](db[_0x471b('0x1d1')],{'as':_0x471b('0x1c4'),'foreignKey':_0x471b('0x1c0')});db[_0x471b('0x1d1')][_0x471b('0x11e')](db[_0x471b('0x1d1')],{'as':_0x471b('0x1c5'),'foreignKey':'DescriptionId'});db[_0x471b('0x1d1')][_0x471b('0x11e')](db['ServicenowField'],{'as':_0x471b('0x1c6'),'foreignKey':_0x471b('0x1c3')});db[_0x471b('0x1d1')][_0x471b('0x128')](db[_0x471b('0x95')],{'as':_0x471b('0x95'),'foreignKey':_0x471b('0x1c8')});db[_0x471b('0x1d2')][_0x471b('0x11e')](db[_0x471b('0xc0')],{'as':_0x471b('0x1bb'),'onDelete':_0x471b('0x11c'),'foreignKey':_0x471b('0x1bc')});db['Dynamics365Configuration'][_0x471b('0x11e')](db['Dynamics365Field'],{'as':'Subjects','onDelete':_0x471b('0x11c'),'foreignKey':_0x471b('0x1c0')});db['Dynamics365Configuration'][_0x471b('0x11e')](db[_0x471b('0xc2')],{'as':_0x471b('0x1c1'),'onDelete':_0x471b('0x11c'),'foreignKey':_0x471b('0x1c2')});db['Dynamics365Configuration'][_0x471b('0x11e')](db[_0x471b('0xc2')],{'as':_0x471b('0x1ba'),'onDelete':'cascade','foreignKey':_0x471b('0x1c3')});db[_0x471b('0xc0')][_0x471b('0x128')](db[_0x471b('0x1d2')],{'as':_0x471b('0x172'),'foreignKey':_0x471b('0x1bc')});db[_0x471b('0xc2')][_0x471b('0x11e')](db['Dynamics365Field'],{'as':_0x471b('0x1c4'),'foreignKey':'SubjectId'});db[_0x471b('0xc2')][_0x471b('0x11e')](db[_0x471b('0xc2')],{'as':_0x471b('0x1c5'),'foreignKey':_0x471b('0x1c2')});db[_0x471b('0xc2')]['hasMany'](db[_0x471b('0xc2')],{'as':_0x471b('0x1c6'),'foreignKey':_0x471b('0x1c3')});db[_0x471b('0xc2')][_0x471b('0x128')](db[_0x471b('0x95')],{'as':_0x471b('0x95'),'foreignKey':'VariableId'});db['ChatQueueReport'][_0x471b('0x128')](db['ChatWebsite'],{});db[_0x471b('0x1d3')]['belongsTo'](db[_0x471b('0x13e')],{'as':_0x471b('0x16b'),'foreignKey':_0x471b('0x17e')});db['ChatQueueReport'][_0x471b('0x128')](db[_0x471b('0x73')],{'as':_0x471b('0x160'),'foreignKey':_0x471b('0x173')});db[_0x471b('0x1d3')][_0x471b('0x128')](db[_0x471b('0x67')],{});db[_0x471b('0x1d3')][_0x471b('0x128')](db[_0x471b('0x69')],{});db[_0x471b('0x1d3')]['belongsTo'](db[_0x471b('0x12')],{});db[_0x471b('0x1d3')][_0x471b('0x128')](db['ChatQueue'],{});db[_0x471b('0x1d4')][_0x471b('0x128')](db['User'],{'onDelete':_0x471b('0x11c'),'foreignKey':_0x471b('0x1d5')});db['ChatInternalMessage'][_0x471b('0x128')](db[_0x471b('0x12')],{'onDelete':_0x471b('0x11c'),'foreignKey':_0x471b('0x1d6')});db['JscriptySessionReport'][_0x471b('0x11e')](db[_0x471b('0x1d7')],{'foreignKey':_0x471b('0x1d8'),'onDelete':_0x471b('0x11c')});db[_0x471b('0xc9')][_0x471b('0x11e')](db[_0x471b('0x1d9')],{'foreignKey':_0x471b('0x1d8'),'onDelete':'cascade'});db[_0x471b('0xca')][_0x471b('0x128')](db[_0x471b('0x54')],{});db[_0x471b('0xca')][_0x471b('0x128')](db[_0x471b('0x13e')],{'as':_0x471b('0x16b'),'foreignKey':_0x471b('0x17e')});db['SmsQueueReport'][_0x471b('0x128')](db[_0x471b('0x73')],{'as':_0x471b('0x160'),'foreignKey':_0x471b('0x173')});db[_0x471b('0xca')]['belongsTo'](db[_0x471b('0x124')],{});db['SmsQueueReport'][_0x471b('0x128')](db[_0x471b('0x58')],{});db['SmsQueueReport'][_0x471b('0x128')](db[_0x471b('0x12')],{});db[_0x471b('0xca')][_0x471b('0x128')](db['SmsQueue'],{});db[_0x471b('0xd0')][_0x471b('0x11e')](db[_0x471b('0xc9')],{'foreignKey':_0x471b('0x1da')});db[_0x471b('0xd0')][_0x471b('0x11e')](db[_0x471b('0x1d7')],{'foreignKey':_0x471b('0x1da')});db[_0x471b('0xd0')]['hasMany'](db[_0x471b('0x1d9')],{'foreignKey':_0x471b('0x1da')});db[_0x471b('0xd4')][_0x471b('0x12a')](db[_0x471b('0x12')],{'as':_0x471b('0x183'),'through':'user_has_square_projects'});db[_0x471b('0x130')]['belongsToMany'](db[_0x471b('0x12')],{'as':_0x471b('0x16e'),'through':_0x471b('0x131')});db[_0x471b('0x130')]['belongsToMany'](db[_0x471b('0x1a')],{'through':'team_has_voice_queues','as':_0x471b('0x136')});db['Team'][_0x471b('0x12a')](db[_0x471b('0x3a')],{'through':_0x471b('0x16f'),'as':_0x471b('0x137')});db[_0x471b('0x130')]['belongsToMany'](db[_0x471b('0x139')],{'through':'team_has_chat_queues','as':'ChatQueues'});db[_0x471b('0x130')]['belongsToMany'](db[_0x471b('0x50')],{'through':'team_has_fax_queues','as':_0x471b('0x13a')});db[_0x471b('0x130')][_0x471b('0x12a')](db[_0x471b('0x5a')],{'through':_0x471b('0x188'),'as':_0x471b('0x13b')});db[_0x471b('0x130')][_0x471b('0x12a')](db['OpenchannelQueue'],{'through':_0x471b('0x18e'),'as':_0x471b('0x13c')});db[_0x471b('0xda')][_0x471b('0x11e')](db[_0x471b('0x75')],{'as':'Hoppers','foreignKey':_0x471b('0x1a3')});db[_0x471b('0xda')][_0x471b('0x11e')](db[_0x471b('0x77')],{'as':_0x471b('0x120'),'foreignKey':_0x471b('0x1a3')});db['Campaign'][_0x471b('0x11e')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0x471b('0x1a3')});db['Campaign']['hasMany'](db['CmHopperBlack'],{'as':_0x471b('0x153'),'foreignKey':_0x471b('0x1a3')});db[_0x471b('0xda')][_0x471b('0x128')](db['Trunk'],{'as':'Trunk','foreignKey':_0x471b('0x155')});db[_0x471b('0xda')][_0x471b('0x128')](db[_0x471b('0x154')],{'as':_0x471b('0x156'),'foreignKey':'TrunkBackupId'});db[_0x471b('0xda')][_0x471b('0x128')](db[_0x471b('0x87')],{'as':_0x471b('0x87'),'foreignKey':_0x471b('0x158')});db[_0x471b('0xda')]['belongsTo'](db[_0x471b('0xd4')],{'as':_0x471b('0xd4'),'foreignKey':_0x471b('0x1db')});db[_0x471b('0xda')][_0x471b('0x12a')](db[_0x471b('0x13e')],{'as':'Lists','through':_0x471b('0x1dc')});db[_0x471b('0xda')][_0x471b('0x12a')](db[_0x471b('0x13e')],{'as':_0x471b('0x15b'),'through':_0x471b('0x1dd')});db[_0x471b('0xe0')][_0x471b('0x128')](db[_0x471b('0x40')],{});db[_0x471b('0xe0')][_0x471b('0x128')](db[_0x471b('0x3e')],{});db['MailTransferReport'][_0x471b('0x128')](db[_0x471b('0x143')],{'foreignKey':'FromMailAccountId','as':_0x471b('0x1de')});db['MailTransferReport']['belongsTo'](db[_0x471b('0x12')],{'foreignKey':_0x471b('0x1df'),'as':_0x471b('0x1e0')});db[_0x471b('0xe0')][_0x471b('0x128')](db[_0x471b('0x12')],{'foreignKey':_0x471b('0x1e1'),'as':'ToAgent'});db[_0x471b('0xe0')][_0x471b('0x128')](db[_0x471b('0x3a')],{'foreignKey':_0x471b('0x1e2'),'as':_0x471b('0x1e3')});db[_0x471b('0xe0')][_0x471b('0x128')](db[_0x471b('0x143')],{'foreignKey':'ToMailAccountId','as':_0x471b('0x1e4')});db[_0x471b('0xe2')][_0x471b('0x128')](db[_0x471b('0x69')],{});db[_0x471b('0xe2')][_0x471b('0x128')](db[_0x471b('0x67')],{});db[_0x471b('0xe2')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x471b('0x1e5'),'as':_0x471b('0x1de')});db['ChatTransferReport'][_0x471b('0x128')](db[_0x471b('0x12')],{'foreignKey':_0x471b('0x1df'),'as':_0x471b('0x1e0')});db[_0x471b('0xe2')][_0x471b('0x128')](db[_0x471b('0x12')],{'foreignKey':'ToUserId','as':_0x471b('0x1e6')});db['ChatTransferReport'][_0x471b('0x128')](db[_0x471b('0x139')],{'foreignKey':_0x471b('0x1e7'),'as':_0x471b('0x1e3')});db[_0x471b('0xe2')][_0x471b('0x128')](db[_0x471b('0x141')],{'foreignKey':'ToChatWebsiteId','as':_0x471b('0x1e4')});db[_0x471b('0xe4')][_0x471b('0x128')](db['FaxMessage'],{});db[_0x471b('0xe4')][_0x471b('0x128')](db[_0x471b('0x4c')],{});db['FaxTransferReport']['belongsTo'](db[_0x471b('0x48')],{'foreignKey':_0x471b('0x1e8'),'as':_0x471b('0x1de')});db[_0x471b('0xe4')][_0x471b('0x128')](db[_0x471b('0x12')],{'foreignKey':_0x471b('0x1df'),'as':_0x471b('0x1e0')});db['FaxTransferReport'][_0x471b('0x128')](db[_0x471b('0x12')],{'foreignKey':_0x471b('0x1e1'),'as':'ToAgent'});db[_0x471b('0xe4')][_0x471b('0x128')](db[_0x471b('0x50')],{'foreignKey':'ToFaxQueueId','as':_0x471b('0x1e3')});db[_0x471b('0xe4')][_0x471b('0x128')](db[_0x471b('0x48')],{'foreignKey':_0x471b('0x1e9'),'as':_0x471b('0x1e4')});db[_0x471b('0xe5')]['belongsTo'](db[_0x471b('0x60')],{});db['OpenchannelTransferReport'][_0x471b('0x128')](db['OpenchannelInteraction'],{});db[_0x471b('0xe5')][_0x471b('0x128')](db['OpenchannelAccount'],{'foreignKey':_0x471b('0x1ea'),'as':_0x471b('0x1de')});db[_0x471b('0xe5')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x471b('0x1e0')});db['OpenchannelTransferReport'][_0x471b('0x128')](db[_0x471b('0x12')],{'foreignKey':'ToUserId','as':_0x471b('0x1e6')});db[_0x471b('0xe5')][_0x471b('0x128')](db[_0x471b('0x62')],{'foreignKey':_0x471b('0x1eb'),'as':_0x471b('0x1e3')});db[_0x471b('0xe5')]['belongsTo'](db['OpenchannelAccount'],{'foreignKey':_0x471b('0x1ec'),'as':_0x471b('0x1e4')});db['SmsTransferReport'][_0x471b('0x128')](db[_0x471b('0x58')],{});db['SmsTransferReport']['belongsTo'](db[_0x471b('0x124')],{});db['SmsTransferReport']['belongsTo'](db[_0x471b('0x54')],{'foreignKey':_0x471b('0x1ed'),'as':_0x471b('0x1de')});db[_0x471b('0x1ee')][_0x471b('0x128')](db['User'],{'foreignKey':_0x471b('0x1df'),'as':_0x471b('0x1e0')});db[_0x471b('0x1ee')]['belongsTo'](db[_0x471b('0x12')],{'foreignKey':'ToUserId','as':_0x471b('0x1e6')});db[_0x471b('0x1ee')][_0x471b('0x128')](db[_0x471b('0x5a')],{'foreignKey':_0x471b('0x1ef'),'as':_0x471b('0x1e3')});db[_0x471b('0x1ee')]['belongsTo'](db['SmsAccount'],{'foreignKey':_0x471b('0x1f0'),'as':_0x471b('0x1e4')});db[_0x471b('0x13e')][_0x471b('0x11e')](db[_0x471b('0x83')],{'as':_0x471b('0x166'),'foreignKey':'ListId'});db[_0x471b('0x13e')]['hasMany'](db['CmCustomField'],{'as':_0x471b('0x1f1'),'foreignKey':_0x471b('0x17e')});db[_0x471b('0x13e')][_0x471b('0x11e')](db[_0x471b('0x73')],{'as':_0x471b('0x199'),'onDelete':_0x471b('0x11c'),'foreignKey':_0x471b('0x17e')});db['CmList'][_0x471b('0x11e')](db['CmHopperFinal'],{'as':_0x471b('0x120'),'foreignKey':_0x471b('0x17e')});db[_0x471b('0x13e')]['hasMany'](db[_0x471b('0x121')],{'as':_0x471b('0x122'),'foreignKey':_0x471b('0x17e')});db['CmList'][_0x471b('0x11e')](db[_0x471b('0x7a')],{'as':_0x471b('0x7a'),'foreignKey':'ListId'});db[_0x471b('0x13e')][_0x471b('0x12a')](db[_0x471b('0x1a')],{'as':_0x471b('0x1f2'),'through':_0x471b('0x1f3')});db[_0x471b('0x13e')][_0x471b('0x12a')](db[_0x471b('0x12')],{'as':_0x471b('0x16e'),'through':_0x471b('0x12f')});db[_0x471b('0x13f')][_0x471b('0x11e')](db['VoiceExtension'],{'as':_0x471b('0x11f'),'onDelete':_0x471b('0x17c')});db[_0x471b('0x13f')][_0x471b('0x12a')](db[_0x471b('0x12')],{'as':'Agents','through':'user_has_voice_prefixes'});db[_0x471b('0xe9')][_0x471b('0x11e')](db[_0x471b('0x12')],{'as':_0x471b('0x183'),'foreignKey':_0x471b('0x129')});db['UserProfile'][_0x471b('0x11e')](db[_0x471b('0xea')],{'as':_0x471b('0x1f4'),'foreignKey':_0x471b('0x129'),'onDelete':_0x471b('0x11c')});db[_0x471b('0xea')][_0x471b('0x11e')](db[_0x471b('0xeb')],{'as':_0x471b('0x1f5'),'foreignKey':_0x471b('0x1f6'),'onDelete':_0x471b('0x11c')});db[_0x471b('0xee')][_0x471b('0x11e')](db['CrmWorkflowStep'],{'foreignKey':_0x471b('0x1f7')});db['CrmWorkflow'][_0x471b('0x11e')](db[_0x471b('0xfd')],{'foreignKey':_0x471b('0x1f7')});db[_0x471b('0x1f8')][_0x471b('0x163')](db[_0x471b('0xf1')],{'foreignKey':_0x471b('0x1f9')});db[_0x471b('0x1f8')][_0x471b('0x11e')](db[_0x471b('0xfd')],{'foreignKey':'WorkflowStepId'});db[_0x471b('0x1f8')][_0x471b('0x12a')](db[_0x471b('0x1f8')],{'as':_0x471b('0x1fa'),'through':_0x471b('0x1fb')});db[_0x471b('0xf1')]['hasMany'](db[_0x471b('0xf3')],{'foreignKey':_0x471b('0x1fc')});db[_0x471b('0xf1')][_0x471b('0x128')](db[_0x471b('0x1f8')],{'foreignKey':_0x471b('0x1f9'),'as':_0x471b('0x1f8')});db[_0x471b('0xf3')]['belongsTo'](db[_0x471b('0xf1')],{'foreignKey':_0x471b('0x1fc'),'as':_0x471b('0xf1')});db[_0x471b('0xf4')][_0x471b('0x11e')](db[_0x471b('0x1fd')],{'foreignKey':_0x471b('0x1fe')});db[_0x471b('0xf5')][_0x471b('0x11e')](db[_0x471b('0x1fd')],{'foreignKey':_0x471b('0x1ff')});db[_0x471b('0x1fd')]['hasMany'](db['SAProductPricesList'],{'foreignKey':_0x471b('0x200')});db[_0x471b('0x1fd')]['belongsTo'](db[_0x471b('0xf7')],{'as':_0x471b('0x201'),'foreignKey':_0x471b('0x202')});db['SAProduct'][_0x471b('0x128')](db[_0x471b('0xf5')],{'as':_0x471b('0x203'),'foreignKey':_0x471b('0x1ff')});db[_0x471b('0x1fd')][_0x471b('0x128')](db[_0x471b('0xf4')],{'as':_0x471b('0x204'),'foreignKey':_0x471b('0x1fe')});db[_0x471b('0xf7')]['hasMany'](db['SAProduct'],{'foreignKey':_0x471b('0x202')});db[_0x471b('0xf9')]['hasMany'](db[_0x471b('0xfb')],{'foreignKey':_0x471b('0x205')});db[_0x471b('0xfb')]['hasMany'](db[_0x471b('0x103')],{'as':_0x471b('0x206'),'foreignKey':_0x471b('0x207')});db[_0x471b('0xfb')]['belongsTo'](db[_0x471b('0x1fd')],{'as':_0x471b('0x208'),'foreignKey':_0x471b('0x200')});db['SAProductPricesList'][_0x471b('0x128')](db[_0x471b('0xf9')],{'as':_0x471b('0x209'),'foreignKey':_0x471b('0x205')});db[_0x471b('0xfd')]['hasMany'](db[_0x471b('0xff')],{'as':_0x471b('0x19b'),'foreignKey':_0x471b('0x20a')});db[_0x471b('0xfd')][_0x471b('0x11e')](db[_0x471b('0x101')],{'as':_0x471b('0x19b'),'foreignKey':'DossierId'});db[_0x471b('0xfd')][_0x471b('0x11e')](db[_0x471b('0x105')],{'as':_0x471b('0x19b'),'foreignKey':_0x471b('0x20a')});db[_0x471b('0xfd')][_0x471b('0x11e')](db[_0x471b('0x106')],{'as':_0x471b('0x19b'),'foreignKey':_0x471b('0x20a')});db['SADossier'][_0x471b('0x128')](db['CmCompany'],{'as':'Company','foreignKey':_0x471b('0x19a')});db[_0x471b('0xfd')]['belongsTo'](db['CmContact'],{'as':_0x471b('0x160'),'foreignKey':'ContactId'});db[_0x471b('0xfd')][_0x471b('0x128')](db[_0x471b('0xee')],{'as':_0x471b('0x20b'),'foreignKey':'WorkflowId'});db[_0x471b('0xfd')][_0x471b('0x128')](db['CrmWorkflowStep'],{'as':_0x471b('0x20c'),'foreignKey':'WorkflowStepId'});db[_0x471b('0xfd')][_0x471b('0x128')](db[_0x471b('0x12')],{'as':_0x471b('0x12'),'foreignKey':_0x471b('0x11d')});db[_0x471b('0xff')]['hasMany'](db[_0x471b('0x101')],{'as':_0x471b('0x20d'),'foreignKey':_0x471b('0x20e')});db[_0x471b('0xff')]['hasMany'](db[_0x471b('0x105')],{'as':_0x471b('0x20d'),'foreignKey':_0x471b('0x20e')});db[_0x471b('0xff')][_0x471b('0x11e')](db[_0x471b('0x106')],{'as':_0x471b('0x20d'),'foreignKey':_0x471b('0x20e')});db[_0x471b('0xff')]['belongsTo'](db[_0x471b('0xfd')],{'as':_0x471b('0x20f'),'foreignKey':_0x471b('0x20a')});db['SAQuotation']['hasMany'](db[_0x471b('0x103')],{'as':_0x471b('0x210'),'foreignKey':_0x471b('0x211')});db[_0x471b('0x101')][_0x471b('0x11e')](db[_0x471b('0x105')],{'as':_0x471b('0x210'),'foreignKey':_0x471b('0x211')});db[_0x471b('0x101')][_0x471b('0x11e')](db[_0x471b('0x106')],{'as':_0x471b('0x210'),'foreignKey':'QuotationId'});db['SAQuotation']['belongsTo'](db['SADossier'],{'as':_0x471b('0x20f'),'foreignKey':_0x471b('0x20a')});db[_0x471b('0x101')]['belongsTo'](db['SARequest'],{'as':'Request','foreignKey':_0x471b('0x20e')});db[_0x471b('0x103')][_0x471b('0x128')](db[_0x471b('0xfb')],{'as':'ProductPricesList','foreignKey':_0x471b('0x207')});db[_0x471b('0x103')][_0x471b('0x128')](db[_0x471b('0x101')],{'as':_0x471b('0x212'),'foreignKey':_0x471b('0x211')});db[_0x471b('0x103')][_0x471b('0x128')](db[_0x471b('0x106')],{'as':_0x471b('0x213'),'foreignKey':_0x471b('0x214')});db[_0x471b('0x103')]['belongsTo'](db[_0x471b('0x108')],{'as':_0x471b('0x215'),'foreignKey':_0x471b('0x216')});db[_0x471b('0x105')][_0x471b('0x11e')](db[_0x471b('0x106')],{'as':'Orders','foreignKey':_0x471b('0x217')});db[_0x471b('0x105')][_0x471b('0x128')](db['SADossier'],{'as':_0x471b('0x20f'),'foreignKey':'DossierId'});db[_0x471b('0x105')][_0x471b('0x128')](db[_0x471b('0xff')],{'as':_0x471b('0x218'),'foreignKey':_0x471b('0x20e')});db[_0x471b('0x105')]['belongsTo'](db['SAQuotation'],{'as':_0x471b('0x212'),'foreignKey':'QuotationId'});db['SAProforma']['hasMany'](db[_0x471b('0x108')],{'as':_0x471b('0x213'),'foreignKey':_0x471b('0x214')});db['SAProforma'][_0x471b('0x11e')](db[_0x471b('0x103')],{'as':_0x471b('0x213'),'foreignKey':_0x471b('0x214')});db[_0x471b('0x106')][_0x471b('0x11e')](db['SAProformaDetail'],{'as':'Proforma','foreignKey':_0x471b('0x214')});db['SAProforma'][_0x471b('0x11e')](db[_0x471b('0x10e')],{'as':'Proforma','foreignKey':_0x471b('0x214')});db[_0x471b('0x106')][_0x471b('0x128')](db[_0x471b('0xfd')],{'as':_0x471b('0x20f'),'foreignKey':_0x471b('0x20a')});db['SAProforma'][_0x471b('0x128')](db[_0x471b('0xff')],{'as':_0x471b('0x218'),'foreignKey':'RequestId'});db[_0x471b('0x106')][_0x471b('0x128')](db['SAQuotation'],{'as':'Quotation','foreignKey':_0x471b('0x211')});db[_0x471b('0x106')]['belongsTo'](db[_0x471b('0x105')],{'as':_0x471b('0x219'),'foreignKey':_0x471b('0x217')});db['SAInvoice'][_0x471b('0x11e')](db[_0x471b('0x103')],{'as':_0x471b('0x210'),'foreignKey':_0x471b('0x216')});db[_0x471b('0x108')][_0x471b('0x11e')](db[_0x471b('0x10c')],{'as':'Details','foreignKey':_0x471b('0x216')});db[_0x471b('0x108')]['hasMany'](db[_0x471b('0x10e')],{'as':_0x471b('0x21a'),'foreignKey':_0x471b('0x216')});db[_0x471b('0x108')]['belongsTo'](db[_0x471b('0xfd')],{'as':_0x471b('0x20f'),'foreignKey':_0x471b('0x20a')});db[_0x471b('0x108')][_0x471b('0x128')](db[_0x471b('0xff')],{'as':'Request','foreignKey':_0x471b('0x20e')});db[_0x471b('0x108')]['belongsTo'](db[_0x471b('0x101')],{'as':'Quotation','foreignKey':_0x471b('0x211')});db[_0x471b('0x108')]['belongsTo'](db['SAOrder'],{'as':_0x471b('0x219'),'foreignKey':'OrderId'});db[_0x471b('0x10c')][_0x471b('0x128')](db['SAInvoice'],{'as':_0x471b('0x215'),'foreignKey':_0x471b('0x216')});db['SAProformaDetail'][_0x471b('0x128')](db[_0x471b('0x106')],{'as':_0x471b('0x213'),'foreignKey':_0x471b('0x214')});db['SAPayment'][_0x471b('0x128')](db[_0x471b('0x108')],{'as':'Invoice','foreignKey':'InvoiceId'});db[_0x471b('0x10e')][_0x471b('0x128')](db[_0x471b('0x106')],{'as':_0x471b('0x213'),'foreignKey':_0x471b('0x214')});db[_0x471b('0x19c')]['hasMany'](db['CmCompany'],{'as':_0x471b('0x21b'),'foreignKey':'saPaymentMethod'});db[_0x471b('0x113')][_0x471b('0x128')](db['SACreditNote'],{'as':_0x471b('0x21c'),'foreignKey':_0x471b('0x21d')});db[_0x471b('0x118')][_0x471b('0x11e')](db[_0x471b('0x71')],{'as':'CompanyType','foreignKey':_0x471b('0x21e')});db['SACompanyRelationship'][_0x471b('0x11e')](db[_0x471b('0x71')],{'as':_0x471b('0x21f'),'foreignKey':_0x471b('0x220')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 78b5fce..dcdf780 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaa40=['./api/squareOdbc','/api/square/projects','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/campaigns','./api/campaign','/api/migrations','./api/attachment','/api/plugins','./api/plugin','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','./api/smsTransferReport','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','./api/userProfileResource','/api/crm/nations','./api/crmNation','/api/crm/workflows','./api/crmWorkflow','/api/crm/workflowsteps','./api/crmWorkflowstep','./api/crmTask','/api/crm/actionslists','./api/saTypeProduct','/api/sa/unitmeasures','./api/saUnitMeasure','./api/saInvoiceLaw','/api/sa/products','./api/saProduct','/api/sa/salescondions','./api/saSalesCondition','./api/saPriceList','/api/sa/productpriceslists','./api/saProductPricesList','./api/saDossier','/api/sa/requests','./api/saRequest','/api/sa/quotations','./api/saProductQuotation','./api/saOrder','./api/saProforma','/api/sa/invoices','./api/saInvoice','/api/sa/assets','./api/saAsset','/api/sa/invoice_details','./api/saInvoiceDetail','/api/sa/proforma_details','./api/saProformaDetail','/api/sa/payments','./api/saPayment','/api/sa/paymentMethods','./api/saPaymentMethod','/api/sa/creditNotes','./api/saCreditNoteDetail','/api/sa/invoice_numberss','./api/saInvoiceNumber','/api/sa/company_types','./api/saCompanyType','/api/sa/company_relationshipes','./api/saCompanyRelationship','/api/auth/local','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','/api/system','./api/system','/api/pm2','./api/pm2','/apidoc','static','join','root','/www','/demo','snippet','/plugins','route','get','sendFile','resolve','appPath','express','express-winston','util','./errors','./config/environment','./config/logger','api','auth','default','use','logger','format','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','method','headers','x-forwarded-for','remoteAddress','statusCode','user','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)','connection','url','responseTime','name','role','other','agent_name','test','./api/user','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','./api/voiceQueueReport','./api/memberReport','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','/api/sms/applications','./api/smsApplication','./api/smsInteraction','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','./api/cmCompany','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','/api/intervals','./api/interval','/api/pauses','/api/cdr','./api/cdr','/api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','./api/tag','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','/api/analytics/field_reports','./api/analyticFieldReport','./api/intSalesforceAccount','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/setting','/api/square/odbc'];(function(_0x437249,_0x17a89b){var _0x1194f7=function(_0x153b4f){while(--_0x153b4f){_0x437249['push'](_0x437249['shift']());}};_0x1194f7(++_0x17a89b);}(_0xaa40,0x18f));var _0x0aa4=function(_0xfa7784,_0x1d1091){_0xfa7784=_0xfa7784-0x0;var _0x5ae352=_0xaa40[_0xfa7784];return _0x5ae352;};'use strict';var path=require('path');var express=require(_0x0aa4('0x0'));var ewinston=require(_0x0aa4('0x1'));var util=require(_0x0aa4('0x2'));var errors=require(_0x0aa4('0x3'));var config=require(_0x0aa4('0x4'));var logger=require(_0x0aa4('0x5'))(_0x0aa4('0x6'));var authLogger=require(_0x0aa4('0x5'))(_0x0aa4('0x7'));exports[_0x0aa4('0x8')]=function(_0x37527d){_0x37527d[_0x0aa4('0x9')](ewinston[_0x0aa4('0xa')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x5378e6,_0x226a9b){return util[_0x0aa4('0xb')](_0x0aa4('0xc'),_0x5378e6[_0x0aa4('0xd')],_0x5378e6[_0x0aa4('0xe')]['x-forwarded-for']?_0x5378e6[_0x0aa4('0xe')][_0x0aa4('0xf')]:_0x5378e6['connection'][_0x0aa4('0x10')]||_0x5378e6['ip'],_0x5378e6['url'],_0x226a9b[_0x0aa4('0x11')],_0x226a9b['responseTime'],_0x5378e6[_0x0aa4('0x12')]?_0x5378e6[_0x0aa4('0x12')]['id']:null,_0x5378e6[_0x0aa4('0x12')]?_0x5378e6[_0x0aa4('0x12')]['name']:null,_0x5378e6[_0x0aa4('0x12')]?_0x5378e6[_0x0aa4('0x12')]['role']:null);}}));_0x37527d[_0x0aa4('0x9')](ewinston[_0x0aa4('0xa')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x14741a,_0x43c7ff){var _0x2581d1='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x14741a[_0x0aa4('0x13')]&&_0x14741a['body'][_0x0aa4('0x14')]&&_0x14741a[_0x0aa4('0x13')][_0x0aa4('0x15')]){_0x2581d1=_0x0aa4('0x16');}return util[_0x0aa4('0xb')](_0x2581d1,_0x14741a[_0x0aa4('0xd')],_0x14741a[_0x0aa4('0xe')][_0x0aa4('0xf')]?_0x14741a['headers'][_0x0aa4('0xf')]:_0x14741a[_0x0aa4('0x17')][_0x0aa4('0x10')]||_0x14741a['ip'],_0x14741a[_0x0aa4('0x18')],_0x43c7ff[_0x0aa4('0x11')],_0x43c7ff[_0x0aa4('0x19')],_0x14741a[_0x0aa4('0x12')]?_0x14741a[_0x0aa4('0x12')]['id']:null,_0x14741a['user']?_0x14741a[_0x0aa4('0x12')][_0x0aa4('0x1a')]:null,_0x14741a['user']?_0x14741a[_0x0aa4('0x12')][_0x0aa4('0x1b')]:null,_0x14741a[_0x0aa4('0x13')]&&_0x14741a['body'][_0x0aa4('0x14')]?_0x14741a[_0x0aa4('0x13')][_0x0aa4('0x14')]:_0x0aa4('0x1c'),_0x14741a['body']&&_0x14741a['body'][_0x0aa4('0x15')]?_0x14741a[_0x0aa4('0x13')]['agent_id']:'',_0x14741a['body']&&_0x14741a['body'][_0x0aa4('0x1d')]?_0x14741a[_0x0aa4('0x13')][_0x0aa4('0x1d')]:'');},'ignoreRoute':function(_0x533645){var _0x23631b=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x23631b[_0x0aa4('0x1e')](_0x533645[_0x0aa4('0x18')]);}}));_0x37527d[_0x0aa4('0x9')]('/api/users',require(_0x0aa4('0x1f')));_0x37527d['use']('/api/voice/chanspy',require('./api/voiceChanSpy'));_0x37527d[_0x0aa4('0x9')]('/api/voice/contexts',require('./api/voiceContext'));_0x37527d['use'](_0x0aa4('0x20'),require('./api/voiceExtension'));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x21'),require(_0x0aa4('0x22')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x23'),require(_0x0aa4('0x24')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x25'),require(_0x0aa4('0x26')));_0x37527d['use'](_0x0aa4('0x27'),require(_0x0aa4('0x28')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x29'),require(_0x0aa4('0x2a')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x2b'),require(_0x0aa4('0x2c')));_0x37527d[_0x0aa4('0x9')]('/api/voice/calls/reports',require(_0x0aa4('0x2d')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x2e'),require(_0x0aa4('0x2f')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x30'),require(_0x0aa4('0x31')));_0x37527d[_0x0aa4('0x9')]('/api/voice/queues/reports',require(_0x0aa4('0x32')));_0x37527d[_0x0aa4('0x9')]('/api/members/reports',require(_0x0aa4('0x33')));_0x37527d[_0x0aa4('0x9')]('/api/trunks',require(_0x0aa4('0x34')));_0x37527d['use'](_0x0aa4('0x35'),require(_0x0aa4('0x36')));_0x37527d[_0x0aa4('0x9')]('/api/mail/out_servers',require('./api/mailServerOut'));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x37'),require(_0x0aa4('0x38')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x39'),require(_0x0aa4('0x3a')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x3b'),require(_0x0aa4('0x3c')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x3d'),require(_0x0aa4('0x3e')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x3f'),require(_0x0aa4('0x40')));_0x37527d[_0x0aa4('0x9')]('/api/mail/applications',require(_0x0aa4('0x41')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x42'),require(_0x0aa4('0x43')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x44'),require(_0x0aa4('0x45')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x46'),require(_0x0aa4('0x47')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x48'),require(_0x0aa4('0x49')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x4a'),require(_0x0aa4('0x4b')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x4c'),require(_0x0aa4('0x4d')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x4e'),require('./api/faxMessage'));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x4f'),require(_0x0aa4('0x50')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x51'),require(_0x0aa4('0x52')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x53'),require('./api/smsAccount'));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x54'),require(_0x0aa4('0x55')));_0x37527d[_0x0aa4('0x9')]('/api/sms/interactions',require(_0x0aa4('0x56')));_0x37527d[_0x0aa4('0x9')]('/api/sms/messages',require(_0x0aa4('0x57')));_0x37527d['use'](_0x0aa4('0x58'),require(_0x0aa4('0x59')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x5a'),require('./api/openchannelAccount'));_0x37527d['use'](_0x0aa4('0x5b'),require(_0x0aa4('0x5c')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x5d'),require(_0x0aa4('0x5e')));_0x37527d['use'](_0x0aa4('0x5f'),require(_0x0aa4('0x60')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x61'),require(_0x0aa4('0x62')));_0x37527d[_0x0aa4('0x9')]('/api/chat/websites',require(_0x0aa4('0x63')));_0x37527d[_0x0aa4('0x9')]('/api/openchannel/reports/queue',require(_0x0aa4('0x64')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x65'),require(_0x0aa4('0x66')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x67'),require(_0x0aa4('0x68')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x69'),require('./api/chatMessage'));_0x37527d['use'](_0x0aa4('0x6a'),require(_0x0aa4('0x6b')));_0x37527d['use'](_0x0aa4('0x6c'),require('./api/chatQueue'));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x6d'),require(_0x0aa4('0x6e')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x6f'),require(_0x0aa4('0x70')));_0x37527d[_0x0aa4('0x9')]('/api/cm/companies',require(_0x0aa4('0x71')));_0x37527d[_0x0aa4('0x9')]('/api/cm/contacts',require('./api/cmContact'));_0x37527d[_0x0aa4('0x9')]('/api/cm/hopper',require('./api/cmHopper'));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x72'),require(_0x0aa4('0x73')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x74'),require(_0x0aa4('0x75')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x76'),require(_0x0aa4('0x77')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x78'),require(_0x0aa4('0x79')));_0x37527d[_0x0aa4('0x9')]('/api/actions',require('./api/action'));_0x37527d['use'](_0x0aa4('0x7a'),require(_0x0aa4('0x7b')));_0x37527d['use'](_0x0aa4('0x7c'),require(_0x0aa4('0x7d')));_0x37527d['use'](_0x0aa4('0x7e'),require(_0x0aa4('0x7f')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x80'),require('./api/condition'));_0x37527d['use'](_0x0aa4('0x81'),require(_0x0aa4('0x82')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x83'),require('./api/pause'));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x84'),require(_0x0aa4('0x85')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x86'),require('./api/voiceQueuesLog'));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x87'),require(_0x0aa4('0x88')));_0x37527d[_0x0aa4('0x9')]('/api/sounds',require(_0x0aa4('0x89')));_0x37527d[_0x0aa4('0x9')]('/api/tags',require(_0x0aa4('0x8a')));_0x37527d['use'](_0x0aa4('0x8b'),require(_0x0aa4('0x8c')));_0x37527d['use'](_0x0aa4('0x8d'),require(_0x0aa4('0x8e')));_0x37527d['use'](_0x0aa4('0x8f'),require(_0x0aa4('0x90')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x91'),require('./api/integration'));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x92'),require(_0x0aa4('0x93')));_0x37527d['use'](_0x0aa4('0x94'),require('./api/analyticCustomReport'));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x95'),require(_0x0aa4('0x96')));_0x37527d['use'](_0x0aa4('0x97'),require(_0x0aa4('0x98')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x99'),require('./api/analyticMetric'));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x9a'),require(_0x0aa4('0x9b')));_0x37527d['use']('/api/analytics/tree_reports',require('./api/analyticTreeReport'));_0x37527d[_0x0aa4('0x9')]('/api/integrations/salesforce/accounts',require(_0x0aa4('0x9c')));_0x37527d[_0x0aa4('0x9')]('/api/integrations/salesforce/configurations',require(_0x0aa4('0x9d')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x9e'),require(_0x0aa4('0x9f')));_0x37527d['use']('/api/integrations/sugarcrm/accounts',require(_0x0aa4('0xa0')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0xa1'),require(_0x0aa4('0xa2')));_0x37527d[_0x0aa4('0x9')]('/api/integrations/sugarcrm/fields',require(_0x0aa4('0xa3')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0xa4'),require(_0x0aa4('0xa5')));_0x37527d['use'](_0x0aa4('0xa6'),require(_0x0aa4('0xa7')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0xa8'),require(_0x0aa4('0xa9')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0xaa'),require(_0x0aa4('0xab')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0xac'),require(_0x0aa4('0xad')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0xae'),require(_0x0aa4('0xaf')));_0x37527d['use']('/api/integrations/zendesk/accounts',require(_0x0aa4('0xb0')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0xb1'),require(_0x0aa4('0xb2')));_0x37527d[_0x0aa4('0x9')]('/api/integrations/zendesk/fields',require('./api/intZendeskField'));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0xb3'),require(_0x0aa4('0xb4')));_0x37527d['use'](_0x0aa4('0xb5'),require('./api/intFreshdeskConfiguration'));_0x37527d[_0x0aa4('0x9')]('/api/integrations/freshdesk/fields',require(_0x0aa4('0xb6')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0xb7'),require(_0x0aa4('0xb8')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0xb9'),require('./api/intVtigerConfiguration'));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0xba'),require('./api/intVtigerField'));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0xbb'),require(_0x0aa4('0xbc')));_0x37527d['use'](_0x0aa4('0xbd'),require('./api/intServicenowConfiguration'));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0xbe'),require(_0x0aa4('0xbf')));_0x37527d[_0x0aa4('0x9')]('/api/integrations/dynamics365/accounts',require('./api/intDynamics365Account'));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0xc0'),require('./api/intDynamics365Configuration'));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0xc1'),require(_0x0aa4('0xc2')));_0x37527d['use']('/api/networks',require('./api/network'));_0x37527d['use']('/api/chat/reports/queue',require(_0x0aa4('0xc3')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0xc4'),require(_0x0aa4('0xc5')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0xc6'),require('./api/jscriptyAnswerReport'));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0xc7'),require('./api/jscriptyQuestionReport'));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0xc8'),require('./api/jscriptySessionReport'));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0xc9'),require(_0x0aa4('0xca')));_0x37527d['use'](_0x0aa4('0xcb'),require('./api/squareReport'));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0xcc'),require(_0x0aa4('0xcd')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0xce'),require('./api/jscriptyProject'));_0x37527d[_0x0aa4('0x9')]('/api/settings',require(_0x0aa4('0xcf')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0xd0'),require(_0x0aa4('0xd1')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0xd2'),require('./api/squareProject'));_0x37527d[_0x0aa4('0x9')]('/api/square/recordings',require(_0x0aa4('0xd3')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0xd4'),require(_0x0aa4('0xd5')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0xd6'),require(_0x0aa4('0xd7')));_0x37527d['use']('/api/license',require('./api/license'));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0xd8'),require(_0x0aa4('0xd9')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0xda'),require('./api/migration'));_0x37527d[_0x0aa4('0x9')]('/api/attachments',require(_0x0aa4('0xdb')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0xdc'),require(_0x0aa4('0xdd')));_0x37527d['use']('/api/mail/reports/transfer',require('./api/mailTransferReport'));_0x37527d['use']('/api/chat/reports/transfer',require('./api/chatTransferReport'));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0xde'),require(_0x0aa4('0xdf')));_0x37527d['use'](_0x0aa4('0xe0'),require(_0x0aa4('0xe1')));_0x37527d[_0x0aa4('0x9')]('/api/sms/reports/transfer',require(_0x0aa4('0xe2')));_0x37527d[_0x0aa4('0x9')]('/api/cm/lists',require(_0x0aa4('0xe3')));_0x37527d['use'](_0x0aa4('0xe4'),require(_0x0aa4('0xe5')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0xe6'),require('./api/userProfile'));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0xe7'),require('./api/userProfileSection'));_0x37527d['use']('/api/userProfile/resources',require(_0x0aa4('0xe8')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0xe9'),require(_0x0aa4('0xea')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0xeb'),require(_0x0aa4('0xec')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0xed'),require(_0x0aa4('0xee')));_0x37527d['use']('/api/crm/tasks',require(_0x0aa4('0xef')));_0x37527d['use'](_0x0aa4('0xf0'),require('./api/crmActionsList'));_0x37527d[_0x0aa4('0x9')]('/api/sa/typeproducts',require(_0x0aa4('0xf1')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0xf2'),require(_0x0aa4('0xf3')));_0x37527d[_0x0aa4('0x9')]('/api/sa/invoicelaws',require(_0x0aa4('0xf4')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0xf5'),require(_0x0aa4('0xf6')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0xf7'),require(_0x0aa4('0xf8')));_0x37527d[_0x0aa4('0x9')]('/api/sa/pricelists',require(_0x0aa4('0xf9')));_0x37527d['use'](_0x0aa4('0xfa'),require(_0x0aa4('0xfb')));_0x37527d[_0x0aa4('0x9')]('/api/sa/dossiers',require(_0x0aa4('0xfc')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0xfd'),require(_0x0aa4('0xfe')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0xff'),require('./api/saQuotation'));_0x37527d[_0x0aa4('0x9')]('/api/sa/productquotations',require(_0x0aa4('0x100')));_0x37527d[_0x0aa4('0x9')]('/api/sa/orders',require(_0x0aa4('0x101')));_0x37527d[_0x0aa4('0x9')]('/api/sa/proformas',require(_0x0aa4('0x102')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x103'),require(_0x0aa4('0x104')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x105'),require(_0x0aa4('0x106')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x107'),require(_0x0aa4('0x108')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x109'),require(_0x0aa4('0x10a')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x10b'),require(_0x0aa4('0x10c')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x10d'),require(_0x0aa4('0x10e')));_0x37527d['use'](_0x0aa4('0x10f'),require('./api/saCreditNote'));_0x37527d[_0x0aa4('0x9')]('/api/sa/creditNote_details',require(_0x0aa4('0x110')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x111'),require(_0x0aa4('0x112')));_0x37527d[_0x0aa4('0x9')]('/api/sa/creditNote_numberss',require('./api/saCreditNoteNumber'));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x113'),require(_0x0aa4('0x114')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x115'),require(_0x0aa4('0x116')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x117'),require('./api/authLocal'));_0x37527d['use'](_0x0aa4('0x118'),require(_0x0aa4('0x119')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x11a'),require(_0x0aa4('0x11b')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x11c'),require(_0x0aa4('0x11d')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x11e'),require('./api/version'));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x11f'),require(_0x0aa4('0x120')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x121'),require(_0x0aa4('0x122')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x123'),express[_0x0aa4('0x124')](path[_0x0aa4('0x125')](config[_0x0aa4('0x126')],'/apidoc')));_0x37527d[_0x0aa4('0x9')]('/www',express[_0x0aa4('0x124')](path[_0x0aa4('0x125')](config['root'],_0x0aa4('0x127'))));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x128'),express[_0x0aa4('0x124')](path[_0x0aa4('0x125')](config[_0x0aa4('0x126')],_0x0aa4('0x128'))));_0x37527d[_0x0aa4('0x9')]('/snippet',express[_0x0aa4('0x124')](path[_0x0aa4('0x125')](config[_0x0aa4('0x126')],_0x0aa4('0x129'),'1.0.14')));_0x37527d[_0x0aa4('0x9')](_0x0aa4('0x12a'),express[_0x0aa4('0x124')](path[_0x0aa4('0x125')](config['root'],'/server/files/plugins')));_0x37527d[_0x0aa4('0x12b')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0x0aa4('0x12c')](errors[0x194]);_0x37527d['route']('/*')['get'](function(_0xfa3bf8,_0x5a86d5){_0x5a86d5[_0x0aa4('0x12d')](path[_0x0aa4('0x12e')](_0x37527d[_0x0aa4('0x12c')](_0x0aa4('0x12f'))+'/index.html'));});}; \ No newline at end of file +var _0x27df=['/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','./api/intFreshdeskField','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','./api/intServicenowField','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','./api/intDynamics365Field','./api/network','/api/chat/reports/queue','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','./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/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/campaigns','/api/migrations','/api/attachments','./api/attachment','/api/plugins','/api/mail/reports/transfer','/api/chat/reports/transfer','/api/fax/reports/transfer','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/crm/nations','./api/crmNation','./api/crmWorkflow','/api/crm/workflowsteps','./api/crmWorkflowstep','/api/crm/tasks','./api/crmActionsList','/api/sa/typeproducts','./api/saTypeProduct','./api/saUnitMeasure','/api/sa/invoicelaws','./api/saInvoiceLaw','./api/saProduct','./api/saSalesCondition','/api/sa/productpriceslists','./api/saProductPricesList','/api/sa/dossiers','./api/saDossier','./api/saRequest','/api/sa/quotations','./api/saQuotation','/api/sa/productquotations','./api/saOrder','/api/sa/proformas','./api/saProforma','./api/saInvoice','/api/sa/assets','./api/saAsset','/api/sa/invoice_details','./api/saInvoiceDetail','/api/sa/proforma_details','/api/sa/payments','./api/saPayment','/api/sa/paymentMethods','./api/saCreditNote','/api/sa/invoice_numberss','./api/saInvoiceNumber','/api/sa/creditNote_numberss','./api/saCreditNoteNumber','/api/sa/company_types','/api/sa/company_relationshipes','./api/saCompanyRelationship','/api/auth/local','/api/auth/google','/api/jira','./api/jira','/api/rpc','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/apidoc','static','/www','join','root','/demo','/snippet','1.0.14','/plugins','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','path','express','express-winston','util','./errors','./config/environment','api','./config/logger','auth','default','use','format','method','headers','x-forwarded-for','remoteAddress','url','statusCode','responseTime','user','name','role','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','device','agent_id','agent_name','/api/users','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','/api/mail/interactions','./api/mailInteraction','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','./api/faxApplication','/api/fax/interactions','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueueReport','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','./api/openchannelMessage','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','/api/chat/offline_messages','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','./api/voiceQueuesLog','/api/schedules','/api/sounds','/api/tags','./api/tag','./api/template','/api/triggers','./api/trigger','./api/variable','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport'];(function(_0x4df74c,_0x170640){var _0x20be2e=function(_0x44b73e){while(--_0x44b73e){_0x4df74c['push'](_0x4df74c['shift']());}};_0x20be2e(++_0x170640);}(_0x27df,0x1d4));var _0xf27d=function(_0x142e1b,_0x599c4a){_0x142e1b=_0x142e1b-0x0;var _0xb9dcd7=_0x27df[_0x142e1b];return _0xb9dcd7;};'use strict';var path=require(_0xf27d('0x0'));var express=require(_0xf27d('0x1'));var ewinston=require(_0xf27d('0x2'));var util=require(_0xf27d('0x3'));var errors=require(_0xf27d('0x4'));var config=require(_0xf27d('0x5'));var logger=require('./config/logger')(_0xf27d('0x6'));var authLogger=require(_0xf27d('0x7'))(_0xf27d('0x8'));exports[_0xf27d('0x9')]=function(_0xcd4ea4){_0xcd4ea4[_0xf27d('0xa')](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x33c277,_0x4ddd47){return util[_0xf27d('0xb')]('%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s',_0x33c277[_0xf27d('0xc')],_0x33c277[_0xf27d('0xd')][_0xf27d('0xe')]?_0x33c277[_0xf27d('0xd')]['x-forwarded-for']:_0x33c277['connection'][_0xf27d('0xf')]||_0x33c277['ip'],_0x33c277[_0xf27d('0x10')],_0x4ddd47[_0xf27d('0x11')],_0x4ddd47[_0xf27d('0x12')],_0x33c277[_0xf27d('0x13')]?_0x33c277['user']['id']:null,_0x33c277[_0xf27d('0x13')]?_0x33c277[_0xf27d('0x13')][_0xf27d('0x14')]:null,_0x33c277['user']?_0x33c277['user'][_0xf27d('0x15')]:null);}}));_0xcd4ea4['use'](ewinston['logger']({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x498fb5,_0x187409){var _0x2b5ef9=_0xf27d('0x16');if(_0x498fb5[_0xf27d('0x17')]&&_0x498fb5[_0xf27d('0x17')][_0xf27d('0x18')]&&_0x498fb5['body'][_0xf27d('0x19')]){_0x2b5ef9='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0xf27d('0xb')](_0x2b5ef9,_0x498fb5[_0xf27d('0xc')],_0x498fb5[_0xf27d('0xd')][_0xf27d('0xe')]?_0x498fb5[_0xf27d('0xd')][_0xf27d('0xe')]:_0x498fb5['connection']['remoteAddress']||_0x498fb5['ip'],_0x498fb5[_0xf27d('0x10')],_0x187409['statusCode'],_0x187409[_0xf27d('0x12')],_0x498fb5[_0xf27d('0x13')]?_0x498fb5[_0xf27d('0x13')]['id']:null,_0x498fb5['user']?_0x498fb5[_0xf27d('0x13')][_0xf27d('0x14')]:null,_0x498fb5['user']?_0x498fb5['user'][_0xf27d('0x15')]:null,_0x498fb5[_0xf27d('0x17')]&&_0x498fb5[_0xf27d('0x17')][_0xf27d('0x18')]?_0x498fb5[_0xf27d('0x17')][_0xf27d('0x18')]:'other',_0x498fb5['body']&&_0x498fb5[_0xf27d('0x17')][_0xf27d('0x19')]?_0x498fb5[_0xf27d('0x17')][_0xf27d('0x19')]:'',_0x498fb5['body']&&_0x498fb5[_0xf27d('0x17')][_0xf27d('0x1a')]?_0x498fb5[_0xf27d('0x17')]['agent_name']:'');},'ignoreRoute':function(_0x2d893d){var _0xe78e8=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0xe78e8['test'](_0x2d893d[_0xf27d('0x10')]);}}));_0xcd4ea4['use'](_0xf27d('0x1b'),require('./api/user'));_0xcd4ea4[_0xf27d('0xa')]('/api/voice/chanspy',require(_0xf27d('0x1c')));_0xcd4ea4[_0xf27d('0xa')]('/api/voice/contexts',require(_0xf27d('0x1d')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x1e'),require(_0xf27d('0x1f')));_0xcd4ea4[_0xf27d('0xa')]('/api/voice/mohs',require(_0xf27d('0x20')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x21'),require(_0xf27d('0x22')));_0xcd4ea4['use'](_0xf27d('0x23'),require(_0xf27d('0x24')));_0xcd4ea4['use'](_0xf27d('0x25'),require('./api/screenRecording'));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x26'),require(_0xf27d('0x27')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x28'),require(_0xf27d('0x29')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x2a'),require(_0xf27d('0x2b')));_0xcd4ea4['use']('/api/voice/dials/reports',require(_0xf27d('0x2c')));_0xcd4ea4['use'](_0xf27d('0x2d'),require(_0xf27d('0x2e')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x2f'),require(_0xf27d('0x30')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x31'),require(_0xf27d('0x32')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x33'),require(_0xf27d('0x34')));_0xcd4ea4[_0xf27d('0xa')]('/api/voice/transfers/reports',require('./api/voiceTransferReport'));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x35'),require(_0xf27d('0x36')));_0xcd4ea4['use'](_0xf27d('0x37'),require(_0xf27d('0x38')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x39'),require(_0xf27d('0x3a')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x3b'),require('./api/mailSubstatus'));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x3c'),require(_0xf27d('0x3d')));_0xcd4ea4[_0xf27d('0xa')]('/api/mail/messages',require('./api/mailMessage'));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x3e'),require(_0xf27d('0x3f')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x40'),require(_0xf27d('0x41')));_0xcd4ea4['use'](_0xf27d('0x42'),require(_0xf27d('0x43')));_0xcd4ea4[_0xf27d('0xa')]('/api/dashboards/items',require(_0xf27d('0x44')));_0xcd4ea4['use'](_0xf27d('0x45'),require(_0xf27d('0x46')));_0xcd4ea4[_0xf27d('0xa')]('/api/fax/applications',require(_0xf27d('0x47')));_0xcd4ea4['use'](_0xf27d('0x48'),require('./api/faxInteraction'));_0xcd4ea4['use'](_0xf27d('0x49'),require(_0xf27d('0x4a')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x4b'),require('./api/faxQueue'));_0xcd4ea4['use']('/api/fax/reports/queue',require(_0xf27d('0x4c')));_0xcd4ea4[_0xf27d('0xa')]('/api/sms/accounts',require(_0xf27d('0x4d')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x4e'),require(_0xf27d('0x4f')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x50'),require(_0xf27d('0x51')));_0xcd4ea4[_0xf27d('0xa')]('/api/sms/messages',require('./api/smsMessage'));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x52'),require(_0xf27d('0x53')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x54'),require('./api/openchannelAccount'));_0xcd4ea4['use']('/api/openchannel/applications',require(_0xf27d('0x55')));_0xcd4ea4['use'](_0xf27d('0x56'),require(_0xf27d('0x57')));_0xcd4ea4[_0xf27d('0xa')]('/api/openchannel/messages',require(_0xf27d('0x58')));_0xcd4ea4[_0xf27d('0xa')]('/api/openchannel/queues',require(_0xf27d('0x59')));_0xcd4ea4['use'](_0xf27d('0x5a'),require(_0xf27d('0x5b')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x5c'),require(_0xf27d('0x5d')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x5e'),require(_0xf27d('0x5f')));_0xcd4ea4['use'](_0xf27d('0x60'),require(_0xf27d('0x61')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x62'),require('./api/chatMessage'));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x63'),require('./api/chatOfflineMessage'));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x64'),require(_0xf27d('0x65')));_0xcd4ea4['use'](_0xf27d('0x66'),require(_0xf27d('0x67')));_0xcd4ea4['use']('/api/chat/proactive_actions',require(_0xf27d('0x68')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x69'),require(_0xf27d('0x6a')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x6b'),require(_0xf27d('0x6c')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x6d'),require(_0xf27d('0x6e')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x6f'),require(_0xf27d('0x70')));_0xcd4ea4['use'](_0xf27d('0x71'),require(_0xf27d('0x72')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x73'),require(_0xf27d('0x74')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x75'),require(_0xf27d('0x76')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x77'),require(_0xf27d('0x78')));_0xcd4ea4['use']('/api/automations',require(_0xf27d('0x79')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x7a'),require(_0xf27d('0x7b')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x7c'),require(_0xf27d('0x7d')));_0xcd4ea4[_0xf27d('0xa')]('/api/conditions',require('./api/condition'));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x7e'),require(_0xf27d('0x7f')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x80'),require(_0xf27d('0x81')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x82'),require(_0xf27d('0x83')));_0xcd4ea4['use']('/api/voiceQueuesLog',require(_0xf27d('0x84')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x85'),require('./api/schedule'));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x86'),require('./api/sound'));_0xcd4ea4['use'](_0xf27d('0x87'),require(_0xf27d('0x88')));_0xcd4ea4[_0xf27d('0xa')]('/api/templates',require(_0xf27d('0x89')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x8a'),require(_0xf27d('0x8b')));_0xcd4ea4[_0xf27d('0xa')]('/api/variables',require(_0xf27d('0x8c')));_0xcd4ea4[_0xf27d('0xa')]('/api/integrations',require('./api/integration'));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x8d'),require('./api/integrationReport'));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x8e'),require(_0xf27d('0x8f')));_0xcd4ea4['use'](_0xf27d('0x90'),require(_0xf27d('0x91')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x92'),require('./api/analyticExtractedReport'));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x93'),require(_0xf27d('0x94')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x95'),require(_0xf27d('0x96')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x97'),require('./api/analyticTreeReport'));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x98'),require(_0xf27d('0x99')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x9a'),require(_0xf27d('0x9b')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x9c'),require(_0xf27d('0x9d')));_0xcd4ea4[_0xf27d('0xa')]('/api/integrations/sugarcrm/accounts',require(_0xf27d('0x9e')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x9f'),require(_0xf27d('0xa0')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0xa1'),require('./api/intSugarcrmField'));_0xcd4ea4['use']('/api/integrations/desk/accounts',require(_0xf27d('0xa2')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0xa3'),require(_0xf27d('0xa4')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0xa5'),require('./api/intDeskField'));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0xa6'),require(_0xf27d('0xa7')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0xa8'),require(_0xf27d('0xa9')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0xaa'),require(_0xf27d('0xab')));_0xcd4ea4['use'](_0xf27d('0xac'),require(_0xf27d('0xad')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0xae'),require(_0xf27d('0xaf')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0xb0'),require(_0xf27d('0xb1')));_0xcd4ea4[_0xf27d('0xa')]('/api/integrations/freshdesk/accounts',require(_0xf27d('0xb2')));_0xcd4ea4['use'](_0xf27d('0xb3'),require('./api/intFreshdeskConfiguration'));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0xb4'),require(_0xf27d('0xb5')));_0xcd4ea4['use']('/api/integrations/vtiger/accounts',require(_0xf27d('0xb6')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0xb7'),require(_0xf27d('0xb8')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0xb9'),require('./api/intVtigerField'));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0xba'),require(_0xf27d('0xbb')));_0xcd4ea4['use'](_0xf27d('0xbc'),require('./api/intServicenowConfiguration'));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0xbd'),require(_0xf27d('0xbe')));_0xcd4ea4[_0xf27d('0xa')]('/api/integrations/dynamics365/accounts',require(_0xf27d('0xbf')));_0xcd4ea4['use'](_0xf27d('0xc0'),require(_0xf27d('0xc1')));_0xcd4ea4[_0xf27d('0xa')]('/api/integrations/dynamics365/fields',require(_0xf27d('0xc2')));_0xcd4ea4[_0xf27d('0xa')]('/api/networks',require(_0xf27d('0xc3')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0xc4'),require('./api/chatQueueReport'));_0xcd4ea4[_0xf27d('0xa')]('/api/chat/internal/messages',require(_0xf27d('0xc5')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0xc6'),require(_0xf27d('0xc7')));_0xcd4ea4['use']('/api/jscripty/questions/reports',require(_0xf27d('0xc8')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0xc9'),require(_0xf27d('0xca')));_0xcd4ea4['use'](_0xf27d('0xcb'),require(_0xf27d('0xcc')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0xcd'),require('./api/squareReport'));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0xce'),require(_0xf27d('0xcf')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0xd0'),require(_0xf27d('0xd1')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0xd2'),require(_0xf27d('0xd3')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0xd4'),require(_0xf27d('0xd5')));_0xcd4ea4[_0xf27d('0xa')]('/api/square/projects',require(_0xf27d('0xd6')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0xd7'),require(_0xf27d('0xd8')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0xd9'),require(_0xf27d('0xda')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0xdb'),require(_0xf27d('0xdc')));_0xcd4ea4['use']('/api/license',require('./api/license'));_0xcd4ea4['use'](_0xf27d('0xdd'),require('./api/campaign'));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0xde'),require('./api/migration'));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0xdf'),require(_0xf27d('0xe0')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0xe1'),require('./api/plugin'));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0xe2'),require('./api/mailTransferReport'));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0xe3'),require('./api/chatTransferReport'));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0xe4'),require('./api/faxTransferReport'));_0xcd4ea4['use'](_0xf27d('0xe5'),require(_0xf27d('0xe6')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0xe7'),require(_0xf27d('0xe8')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0xe9'),require(_0xf27d('0xea')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0xeb'),require(_0xf27d('0xec')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0xed'),require('./api/userProfile'));_0xcd4ea4[_0xf27d('0xa')]('/api/userProfile/sections',require(_0xf27d('0xee')));_0xcd4ea4['use'](_0xf27d('0xef'),require(_0xf27d('0xf0')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0xf1'),require(_0xf27d('0xf2')));_0xcd4ea4[_0xf27d('0xa')]('/api/crm/workflows',require(_0xf27d('0xf3')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0xf4'),require(_0xf27d('0xf5')));_0xcd4ea4['use'](_0xf27d('0xf6'),require('./api/crmTask'));_0xcd4ea4['use']('/api/crm/actionslists',require(_0xf27d('0xf7')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0xf8'),require(_0xf27d('0xf9')));_0xcd4ea4[_0xf27d('0xa')]('/api/sa/unitmeasures',require(_0xf27d('0xfa')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0xfb'),require(_0xf27d('0xfc')));_0xcd4ea4[_0xf27d('0xa')]('/api/sa/products',require(_0xf27d('0xfd')));_0xcd4ea4[_0xf27d('0xa')]('/api/sa/salescondions',require(_0xf27d('0xfe')));_0xcd4ea4[_0xf27d('0xa')]('/api/sa/pricelists',require('./api/saPriceList'));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0xff'),require(_0xf27d('0x100')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x101'),require(_0xf27d('0x102')));_0xcd4ea4['use']('/api/sa/requests',require(_0xf27d('0x103')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x104'),require(_0xf27d('0x105')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x106'),require('./api/saProductQuotation'));_0xcd4ea4[_0xf27d('0xa')]('/api/sa/orders',require(_0xf27d('0x107')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x108'),require(_0xf27d('0x109')));_0xcd4ea4[_0xf27d('0xa')]('/api/sa/invoices',require(_0xf27d('0x10a')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x10b'),require(_0xf27d('0x10c')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x10d'),require(_0xf27d('0x10e')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x10f'),require('./api/saProformaDetail'));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x110'),require(_0xf27d('0x111')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x112'),require('./api/saPaymentMethod'));_0xcd4ea4['use']('/api/sa/creditNotes',require(_0xf27d('0x113')));_0xcd4ea4[_0xf27d('0xa')]('/api/sa/creditNote_details',require('./api/saCreditNoteDetail'));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x114'),require(_0xf27d('0x115')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x116'),require(_0xf27d('0x117')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x118'),require('./api/saCompanyType'));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x119'),require(_0xf27d('0x11a')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x11b'),require('./api/authLocal'));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x11c'),require('./api/authGoogle'));_0xcd4ea4['use'](_0xf27d('0x11d'),require(_0xf27d('0x11e')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x11f'),require('./api/rpc'));_0xcd4ea4[_0xf27d('0xa')]('/api/version',require(_0xf27d('0x120')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x121'),require(_0xf27d('0x122')));_0xcd4ea4['use'](_0xf27d('0x123'),require(_0xf27d('0x124')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x125'),express[_0xf27d('0x126')](path['join'](config['root'],_0xf27d('0x125'))));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x127'),express['static'](path[_0xf27d('0x128')](config[_0xf27d('0x129')],_0xf27d('0x127'))));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x12a'),express[_0xf27d('0x126')](path[_0xf27d('0x128')](config[_0xf27d('0x129')],'/demo')));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x12b'),express[_0xf27d('0x126')](path[_0xf27d('0x128')](config['root'],'snippet',_0xf27d('0x12c'))));_0xcd4ea4[_0xf27d('0xa')](_0xf27d('0x12d'),express[_0xf27d('0x126')](path[_0xf27d('0x128')](config[_0xf27d('0x129')],'/server/files/plugins')));_0xcd4ea4['route'](_0xf27d('0x12e'))[_0xf27d('0x12f')](errors[0x194]);_0xcd4ea4['route']('/*')[_0xf27d('0x12f')](function(_0x3f020d,_0xaa7318){_0xaa7318[_0xf27d('0x130')](path[_0xf27d('0x131')](_0xcd4ea4['get']('appPath')+'/index.html'));});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 83e1ba6..7ac2f7b 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf50b=['../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','rpc','port','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','../config/environment','listen','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc'];(function(_0x1364f9,_0x422296){var _0x1af7b9=function(_0x193612){while(--_0x193612){_0x1364f9['push'](_0x1364f9['shift']());}};_0x1af7b9(++_0x422296);}(_0xf50b,0xc8));var _0xbf50=function(_0x7c80c2,_0x4f6692){_0x7c80c2=_0x7c80c2-0x0;var _0x591d12=_0xf50b[_0x7c80c2];return _0x591d12;};'use strict';var jayson=require(_0xbf50('0x0'));var BPromise=require(_0xbf50('0x1'));var _=require('lodash');var config=require(_0xbf50('0x2'));exports[_0xbf50('0x3')]=function(){return new BPromise(function(_0x3336bb,_0x443bf8){var _0x5f0c1a={};_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require('../api/user/user.rpc'));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require(_0xbf50('0x5')));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require(_0xbf50('0x6')));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require(_0xbf50('0x7')));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require(_0xbf50('0x8')));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x5f0c1a=_['merge'](_0x5f0c1a,require(_0xbf50('0x9')));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require(_0xbf50('0xa')));_0x5f0c1a=_['merge'](_0x5f0c1a,require(_0xbf50('0xb')));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require(_0xbf50('0xc')));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require(_0xbf50('0xd')));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require(_0xbf50('0xe')));_0x5f0c1a=_['merge'](_0x5f0c1a,require(_0xbf50('0xf')));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require(_0xbf50('0x10')));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require(_0xbf50('0x11')));_0x5f0c1a=_['merge'](_0x5f0c1a,require('../api/mailMessage/mailMessage.rpc'));_0x5f0c1a=_['merge'](_0x5f0c1a,require(_0xbf50('0x12')));_0x5f0c1a=_['merge'](_0x5f0c1a,require(_0xbf50('0x13')));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require(_0xbf50('0x14')));_0x5f0c1a=_['merge'](_0x5f0c1a,require(_0xbf50('0x15')));_0x5f0c1a=_['merge'](_0x5f0c1a,require(_0xbf50('0x16')));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require(_0xbf50('0x17')));_0x5f0c1a=_['merge'](_0x5f0c1a,require(_0xbf50('0x18')));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require(_0xbf50('0x19')));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require(_0xbf50('0x1a')));_0x5f0c1a=_['merge'](_0x5f0c1a,require(_0xbf50('0x1b')));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require(_0xbf50('0x1c')));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require(_0xbf50('0x1d')));_0x5f0c1a=_['merge'](_0x5f0c1a,require(_0xbf50('0x1e')));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require(_0xbf50('0x1f')));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require(_0xbf50('0x20')));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require(_0xbf50('0x21')));_0x5f0c1a=_['merge'](_0x5f0c1a,require(_0xbf50('0x22')));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require(_0xbf50('0x23')));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require('../api/chatMessage/chatMessage.rpc'));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require(_0xbf50('0x24')));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require(_0xbf50('0x25')));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require(_0xbf50('0x26')));_0x5f0c1a=_['merge'](_0x5f0c1a,require(_0xbf50('0x27')));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require(_0xbf50('0x28')));_0x5f0c1a=_['merge'](_0x5f0c1a,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require('../api/interval/interval.rpc'));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require('../api/pause/pause.rpc'));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require(_0xbf50('0x29')));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require(_0xbf50('0x2a')));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require(_0xbf50('0x2b')));_0x5f0c1a=_['merge'](_0x5f0c1a,require(_0xbf50('0x2c')));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require(_0xbf50('0x2d')));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require(_0xbf50('0x2e')));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require(_0xbf50('0x2f')));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require(_0xbf50('0x30')));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require(_0xbf50('0x31')));_0x5f0c1a=_['merge'](_0x5f0c1a,require(_0xbf50('0x32')));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require(_0xbf50('0x33')));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require(_0xbf50('0x34')));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require(_0xbf50('0x35')));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require(_0xbf50('0x36')));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require(_0xbf50('0x37')));_0x5f0c1a=_['merge'](_0x5f0c1a,require(_0xbf50('0x38')));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require('../api/squareOdbc/squareOdbc.rpc'));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require(_0xbf50('0x39')));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require(_0xbf50('0x3a')));_0x5f0c1a=_['merge'](_0x5f0c1a,require(_0xbf50('0x3b')));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require(_0xbf50('0x3c')));_0x5f0c1a=_[_0xbf50('0x4')](_0x5f0c1a,require(_0xbf50('0x3d')));_0x5f0c1a=_['merge'](_0x5f0c1a,require(_0xbf50('0x3e')));var _0x410d5f=jayson['server'](_0x5f0c1a)['http']();var _0x1ce198=config[_0xbf50('0x3f')][_0xbf50('0x40')]||config[_0xbf50('0x40')]+0x1;var _0x57ab5d=config[_0xbf50('0x3f')]['ip']||'localhost';_0x410d5f['on'](_0xbf50('0x41'),function(_0x120b82){return _0x443bf8(_0x120b82);});_0x410d5f[_0xbf50('0x3')](_0x1ce198,_0x57ab5d,function(){console[_0xbf50('0x42')](_0xbf50('0x43'),_0x57ab5d,_0x1ce198);require(_0xbf50('0x44'))[_0xbf50('0x45')]();return _0x3336bb(_0xbf50('0x46')+_0x57ab5d+':'+_0x1ce198);});});}; \ No newline at end of file +var _0x2e3b=['../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareMessage/squareMessage.rpc','../api/plugin/plugin.rpc','server','http','rpc','localhost','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','bluebird','lodash','../config/environment','listen','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc'];(function(_0x188883,_0x5edf0c){var _0x1b6038=function(_0x4031d1){while(--_0x4031d1){_0x188883['push'](_0x188883['shift']());}};_0x1b6038(++_0x5edf0c);}(_0x2e3b,0x81));var _0xb2e3=function(_0x1843a1,_0x1a9d70){_0x1843a1=_0x1843a1-0x0;var _0x4632fb=_0x2e3b[_0x1843a1];return _0x4632fb;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xb2e3('0x0'));var _=require(_0xb2e3('0x1'));var config=require(_0xb2e3('0x2'));exports[_0xb2e3('0x3')]=function(){return new BPromise(function(_0x30bed6,_0x282621){var _0x1529ca={};_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require('../api/user/user.rpc'));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require(_0xb2e3('0x5')));_0x1529ca=_['merge'](_0x1529ca,require(_0xb2e3('0x6')));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require('../api/voiceRecording/voiceRecording.rpc'));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require(_0xb2e3('0x7')));_0x1529ca=_['merge'](_0x1529ca,require(_0xb2e3('0x8')));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require(_0xb2e3('0x9')));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require(_0xb2e3('0xa')));_0x1529ca=_['merge'](_0x1529ca,require(_0xb2e3('0xb')));_0x1529ca=_['merge'](_0x1529ca,require(_0xb2e3('0xc')));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require(_0xb2e3('0xd')));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require(_0xb2e3('0xe')));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require(_0xb2e3('0xf')));_0x1529ca=_['merge'](_0x1529ca,require('../api/mailAccount/mailAccount.rpc'));_0x1529ca=_['merge'](_0x1529ca,require(_0xb2e3('0x10')));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require(_0xb2e3('0x11')));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require('../api/mailMessage/mailMessage.rpc'));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require(_0xb2e3('0x12')));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require(_0xb2e3('0x13')));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require(_0xb2e3('0x14')));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require(_0xb2e3('0x15')));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require('../api/faxInteraction/faxInteraction.rpc'));_0x1529ca=_['merge'](_0x1529ca,require('../api/faxMessage/faxMessage.rpc'));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require(_0xb2e3('0x16')));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require(_0xb2e3('0x17')));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require(_0xb2e3('0x18')));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require('../api/smsInteraction/smsInteraction.rpc'));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require('../api/smsMessage/smsMessage.rpc'));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require(_0xb2e3('0x19')));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require(_0xb2e3('0x1a')));_0x1529ca=_['merge'](_0x1529ca,require(_0xb2e3('0x1b')));_0x1529ca=_['merge'](_0x1529ca,require(_0xb2e3('0x1c')));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require(_0xb2e3('0x1d')));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require(_0xb2e3('0x1e')));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require(_0xb2e3('0x1f')));_0x1529ca=_['merge'](_0x1529ca,require(_0xb2e3('0x20')));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require(_0xb2e3('0x21')));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require('../api/cmHopper/cmHopper.rpc'));_0x1529ca=_['merge'](_0x1529ca,require(_0xb2e3('0x22')));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require(_0xb2e3('0x23')));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require(_0xb2e3('0x24')));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require(_0xb2e3('0x25')));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require('../api/interval/interval.rpc'));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require(_0xb2e3('0x26')));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require(_0xb2e3('0x27')));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require(_0xb2e3('0x28')));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require('../api/trigger/trigger.rpc'));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require('../api/variable/variable.rpc'));_0x1529ca=_['merge'](_0x1529ca,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require(_0xb2e3('0x29')));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x1529ca=_['merge'](_0x1529ca,require(_0xb2e3('0x2a')));_0x1529ca=_['merge'](_0x1529ca,require(_0xb2e3('0x2b')));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require(_0xb2e3('0x2c')));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require(_0xb2e3('0x2d')));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require(_0xb2e3('0x2e')));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x1529ca=_['merge'](_0x1529ca,require('../api/squareReport/squareReport.rpc'));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require('../api/squareOdbc/squareOdbc.rpc'));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require('../api/squareProject/squareProject.rpc'));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require('../api/squareRecording/squareRecording.rpc'));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require(_0xb2e3('0x2f')));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require('../api/campaign/campaign.rpc'));_0x1529ca=_['merge'](_0x1529ca,require('../api/attachment/attachment.rpc'));_0x1529ca=_[_0xb2e3('0x4')](_0x1529ca,require(_0xb2e3('0x30')));var _0x232a6d=jayson[_0xb2e3('0x31')](_0x1529ca)[_0xb2e3('0x32')]();var _0x4a5597=config[_0xb2e3('0x33')]['port']||config['port']+0x1;var _0x364ff3=config[_0xb2e3('0x33')]['ip']||_0xb2e3('0x34');_0x232a6d['on']('error',function(_0x4618a7){return _0x282621(_0x4618a7);});_0x232a6d[_0xb2e3('0x3')](_0x4a5597,_0x364ff3,function(){console[_0xb2e3('0x35')](_0xb2e3('0x36'),_0x364ff3,_0x4a5597);require(_0xb2e3('0x37'))[_0xb2e3('0x38')]();return _0x30bed6(_0xb2e3('0x39')+_0x364ff3+':'+_0x4a5597);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index c27047f..4746ba3 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 _0xfcd7=['format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','VERBOSE\x20\x22%s\x22','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setVariable','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','setPriority','noop','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','exec','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','util','events','call','setEncoding','utf8','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','search','function','no\x20code','result=','indexOf','substr','startsWith','split','length','match','error','code','close','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','prototype','sendRequest','sync','getData'];(function(_0x2b12e2,_0x3936d4){var _0x57a779=function(_0x525def){while(--_0x525def){_0x2b12e2['push'](_0x2b12e2['shift']());}};_0x57a779(++_0x3936d4);}(_0xfcd7,0xde));var _0x7fcd=function(_0x393c70,_0x2b2df0){_0x393c70=_0x393c70-0x0;var _0x2cb1aa=_0xfcd7[_0x393c70];return _0x2cb1aa;};'use strict';var util=require(_0x7fcd('0x0'));var _=require('lodash');var EventEmitter=require(_0x7fcd('0x1'))['EventEmitter'];var AGIReply=require('./reply');var AGIError=require('./error');function AGIChannel(_0x538e4c){var _0x262ecc=this,_0x2b2706=new AGIReply(),_0x137162=![],_0x102ac6={};EventEmitter[_0x7fcd('0x2')](_0x262ecc);_0x538e4c[_0x7fcd('0x3')](_0x7fcd('0x4'));_0x538e4c['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x2b2706[_0x7fcd('0x3')](_0x7fcd('0x4'));_0x2b2706['on']('headers',function(_0x411cf4){for(var _0x328745 in _0x411cf4){_0x262ecc[_0x328745]=_0x411cf4[_0x328745];}_0x262ecc[_0x7fcd('0x5')](_0x7fcd('0x6'));});_0x2b2706['on'](_0x7fcd('0x7'),function(_0x3b99f2){if(_0x3b99f2[_0x7fcd('0x8')]()==_0x7fcd('0x9')){_0x262ecc[_0x7fcd('0x5')](_0x7fcd('0x9'));return;}if(_0x3b99f2[_0x7fcd('0xa')](0x0,0xb)==_0x7fcd('0xb')){_0x137162=!![];}if(_0x137162){_0x102ac6['rx']+=_0x3b99f2+'\x0a';if(_0x3b99f2[_0x7fcd('0xc')]('520\x20End\x20of\x20proper')!=-0x1){_0x137162=![];}}else{_0x102ac6['rx']=_0x3b99f2;}if(_0x137162){return;}if(typeof _0x102ac6['cb']==_0x7fcd('0xd')){var _0x526330=_0x102ac6['rx'][_0x7fcd('0xa')](0x0,0x3),_0x1a472c=null,_0x2a1302=null;_0x526330=parseInt(_0x526330);if(isNaN(_0x526330)){_0x102ac6['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x7fcd('0xe')});return;}if(_0x526330!=0xc8){_0x102ac6['cb'](null,{'code':_0x526330,'result':-0x1,'extra':'KO'});return;}_0x1a472c=_0x102ac6['rx'][_0x7fcd('0xa')](0x4)['replace'](_0x7fcd('0xf'),'');if(_0x1a472c[_0x7fcd('0x10')]('\x20')!=-0x1){_0x1a472c=_0x1a472c[_0x7fcd('0x11')](0x0,_0x1a472c[_0x7fcd('0x10')]('\x20'));}if(_[_0x7fcd('0x12')](_0x1a472c,'-1')){_0x1a472c=parseInt(_0x1a472c);}_0x2a1302=_0x102ac6['rx'][_0x7fcd('0x13')]('\x20');if(_0x2a1302[_0x7fcd('0x14')]==0x3){_0x2a1302=_0x2a1302[0x2][_0x7fcd('0xa')](0x1,_0x2a1302[0x2][_0x7fcd('0x14')]-0x1);}else if(_0x2a1302['length']>0x3){var _0x251f4c=/\((.+)\)/;var _0x52ded6=_0x102ac6['rx'][_0x7fcd('0x15')](_0x251f4c);if(_0x52ded6){_0x2a1302=_0x52ded6[0x1];}else{_0x2a1302=null;}}else{_0x2a1302=null;}_0x102ac6['cb'](null,{'code':_0x526330,'result':_0x1a472c,'extra':_0x2a1302});}});_0x538e4c['on'](_0x7fcd('0x16'),function(_0x5b2534){_0x262ecc[_0x7fcd('0x5')](_0x7fcd('0x16'),new AGIError('E_AGI_SOCKET_ERROR',_0x5b2534[_0x7fcd('0x17')]));});_0x538e4c['on'](_0x7fcd('0x18'),function(){_0x262ecc[_0x7fcd('0x5')](_0x7fcd('0x18'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x538e4c['on']('timeout',function(){_0x262ecc['emit'](_0x7fcd('0x19'),new AGIError(_0x7fcd('0x1a')));_0x538e4c[_0x7fcd('0x1b')]();});_0x538e4c[_0x7fcd('0x1c')](_0x2b2706);this[_0x7fcd('0x1d')]=function(_0x201276,_0x22cac0){var _0x201276=_0x201276||'',_0x22cac0=typeof _0x22cac0==_0x7fcd('0xd')?_0x22cac0:new Function();_0x102ac6={'tx':_0x201276,'rx':'','cb':_0x22cac0};_0x538e4c['write'](_0x201276+'\x0a');},this[_0x7fcd('0x18')]=function(){_0x538e4c[_0x7fcd('0x1b')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x7fcd('0x1e')][_0x7fcd('0x1f')]=function(_0x5ac703){return this['command'][_0x7fcd('0x20')](this,_0x5ac703);};AGIChannel['prototype']['answer']=function(){return this[_0x7fcd('0x1f')]('ANSWER');};AGIChannel[_0x7fcd('0x1e')][_0x7fcd('0x21')]=function(_0x2228b8,_0x4648cc,_0x1bf1fe){_0x2228b8=_0x2228b8===undefined?'beep':_0x2228b8;_0x4648cc=_0x4648cc===undefined?'5':_0x4648cc;_0x1bf1fe=_0x1bf1fe===undefined?'1':_0x1bf1fe;return this[_0x7fcd('0x1f')](util[_0x7fcd('0x22')](_0x7fcd('0x23'),_0x2228b8,_0x4648cc*0x3e8,_0x1bf1fe));};AGIChannel[_0x7fcd('0x1e')]['noop']=function(_0xa195bd){_0xa195bd=_0xa195bd||'NO\x20MESSAGE';return this['sendRequest'](util[_0x7fcd('0x22')](_0x7fcd('0x24'),_0xa195bd));};AGIChannel[_0x7fcd('0x1e')]['exec']=function(_0x12700b,_0xdf13d9){if(_[_0x7fcd('0x25')](_0xdf13d9)){return this[_0x7fcd('0x1f')](util['format'](_0x7fcd('0x26'),_0x12700b,_0xdf13d9[_0x7fcd('0x27')](',')));}return this['sendRequest'](util['format']('EXEC\x20%s\x20%s',_0x12700b,_0xdf13d9));};AGIChannel['prototype'][_0x7fcd('0x28')]=function(_0x4beba8){return this[_0x7fcd('0x1f')](util[_0x7fcd('0x22')](_0x7fcd('0x29'),_0x4beba8));};AGIChannel['prototype'][_0x7fcd('0x2a')]=function(_0x3e370b){return this[_0x7fcd('0x1f')](util[_0x7fcd('0x22')](_0x7fcd('0x2b'),_0x3e370b));};AGIChannel[_0x7fcd('0x1e')]['setPriority']=function(_0x1b703b){return this[_0x7fcd('0x1f')](util[_0x7fcd('0x22')]('SET\x20PRIORITY\x20%s',_0x1b703b));};AGIChannel[_0x7fcd('0x1e')]['hangup']=function(){return this[_0x7fcd('0x1f')]('HANGUP');};AGIChannel[_0x7fcd('0x1e')][_0x7fcd('0x2c')]=function(_0x472270,_0x3dbf0c){return this['sendRequest'](util['format'](_0x7fcd('0x2d'),_0x472270,_0x3dbf0c?_0x3dbf0c[_0x7fcd('0x2e')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x7fcd('0x1e')][_0x7fcd('0x2f')]=function(_0x2b778d,_0x295653){return this[_0x7fcd('0x1f')](util[_0x7fcd('0x22')](_0x7fcd('0x30'),_0x2b778d,_0x295653));};AGIChannel[_0x7fcd('0x1e')]['sayDigits']=function(_0x1f655c,_0xe0c1e3){return this[_0x7fcd('0x1f')](util[_0x7fcd('0x22')]('SAY\x20DIGITS\x20%s\x20%s',_0x1f655c,_0xe0c1e3));};AGIChannel[_0x7fcd('0x1e')]['sayPhonetic']=function(_0x41c4f8,_0x458e1f){return this[_0x7fcd('0x1f')](util[_0x7fcd('0x22')](_0x7fcd('0x31'),_0x41c4f8,_0x458e1f));};AGIChannel['prototype']['continueAt']=function(_0x166145,_0xef9fe6,_0x50db48){_0xef9fe6=_0xef9fe6||this['extension'];_0x50db48=_0x50db48||0x1;this[_0x7fcd('0x28')](_0x166145);this[_0x7fcd('0x2a')](_0xef9fe6);this[_0x7fcd('0x32')](_0x50db48);return this[_0x7fcd('0x33')](util[_0x7fcd('0x22')](_0x7fcd('0x34'),_0x166145,_0xef9fe6,_0x50db48));};AGIChannel[_0x7fcd('0x1e')][_0x7fcd('0x35')]=function(_0x121109){return this[_0x7fcd('0x1f')](util[_0x7fcd('0x22')](_0x7fcd('0x36'),_0x121109));};AGIChannel['prototype']['recordFile']=function(_0x55346e,_0x310895,_0x19d9c9,_0x528892,_0x2296c9,_0x78f632){_0x310895=_0x310895||_0x7fcd('0x37');_0x19d9c9=_0x19d9c9||'';_0x528892=_0x528892===undefined?-0x1:_0x528892==='-1'?-0x1:_0x528892*0x3e8;_0x2296c9=_0x2296c9===undefined?'':'s='+_0x2296c9;_0x78f632=_0x78f632?_0x7fcd('0x38'):'';return this['sendRequest'](util[_0x7fcd('0x22')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x55346e,_0x310895,_0x19d9c9,_0x528892,_0x78f632,_0x2296c9));};AGIChannel['prototype']['streamFile']=function(_0x1d8aa7,_0xe610bf){_0xe610bf=_0xe610bf||'';return this[_0x7fcd('0x1f')](util[_0x7fcd('0x22')](_0x7fcd('0x39'),_0x1d8aa7,_0xe610bf));};AGIChannel[_0x7fcd('0x1e')][_0x7fcd('0x3a')]=function(_0x45c1b0){return this['exec'](_0x7fcd('0x3b'),_0x45c1b0);};AGIChannel[_0x7fcd('0x1e')][_0x7fcd('0x3c')]=function(_0x15c5af){return this[_0x7fcd('0x3d')](_0x7fcd('0x3e'),_0x15c5af);};AGIChannel['prototype'][_0x7fcd('0x16')]=function(_0x2b8a8b,_0x42259e){this[_0x7fcd('0x33')](util[_0x7fcd('0x22')](_0x7fcd('0x3f'),_0x2b8a8b['id'],_0x2b8a8b['label'],_0x42259e));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file +var _0x3dea=['HANGUP','setVariable','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','util','lodash','events','EventEmitter','./reply','./error','call','setEncoding','utf8','headers','ready','toLowerCase','emit','substring','520-Invalid','520\x20End\x20of\x20proper','no\x20code','replace','result=','indexOf','substr','startsWith','split','length','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','destroy','pipe','command','function','write','inherits','prototype','sendRequest','sync','ANSWER','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','format','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','hangup'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3dea,0x140));var _0xa3de=function(_0x2093a8,_0x1f8d5d){_0x2093a8=_0x2093a8-0x0;var _0x51ffc2=_0x3dea[_0x2093a8];return _0x51ffc2;};'use strict';var util=require(_0xa3de('0x0'));var _=require(_0xa3de('0x1'));var EventEmitter=require(_0xa3de('0x2'))[_0xa3de('0x3')];var AGIReply=require(_0xa3de('0x4'));var AGIError=require(_0xa3de('0x5'));function AGIChannel(_0x1de651){var _0x1f3316=this,_0x358ad3=new AGIReply(),_0x287804=![],_0x4515b6={};EventEmitter[_0xa3de('0x6')](_0x1f3316);_0x1de651[_0xa3de('0x7')](_0xa3de('0x8'));_0x1de651['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x358ad3[_0xa3de('0x7')](_0xa3de('0x8'));_0x358ad3['on'](_0xa3de('0x9'),function(_0x1524a9){for(var _0x554259 in _0x1524a9){_0x1f3316[_0x554259]=_0x1524a9[_0x554259];}_0x1f3316['emit'](_0xa3de('0xa'));});_0x358ad3['on']('line',function(_0x19b997){if(_0x19b997[_0xa3de('0xb')]()=='hangup'){_0x1f3316[_0xa3de('0xc')]('hangup');return;}if(_0x19b997[_0xa3de('0xd')](0x0,0xb)==_0xa3de('0xe')){_0x287804=!![];}if(_0x287804){_0x4515b6['rx']+=_0x19b997+'\x0a';if(_0x19b997['search'](_0xa3de('0xf'))!=-0x1){_0x287804=![];}}else{_0x4515b6['rx']=_0x19b997;}if(_0x287804){return;}if(typeof _0x4515b6['cb']=='function'){var _0x3d265a=_0x4515b6['rx'][_0xa3de('0xd')](0x0,0x3),_0x265d35=null,_0x5534ee=null;_0x3d265a=parseInt(_0x3d265a);if(isNaN(_0x3d265a)){_0x4515b6['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xa3de('0x10')});return;}if(_0x3d265a!=0xc8){_0x4515b6['cb'](null,{'code':_0x3d265a,'result':-0x1,'extra':'KO'});return;}_0x265d35=_0x4515b6['rx']['substring'](0x4)[_0xa3de('0x11')](_0xa3de('0x12'),'');if(_0x265d35[_0xa3de('0x13')]('\x20')!=-0x1){_0x265d35=_0x265d35[_0xa3de('0x14')](0x0,_0x265d35['indexOf']('\x20'));}if(_[_0xa3de('0x15')](_0x265d35,'-1')){_0x265d35=parseInt(_0x265d35);}_0x5534ee=_0x4515b6['rx'][_0xa3de('0x16')]('\x20');if(_0x5534ee[_0xa3de('0x17')]==0x3){_0x5534ee=_0x5534ee[0x2][_0xa3de('0xd')](0x1,_0x5534ee[0x2][_0xa3de('0x17')]-0x1);}else if(_0x5534ee[_0xa3de('0x17')]>0x3){var _0x2120df=/\((.+)\)/;var _0x3e0de7=_0x4515b6['rx']['match'](_0x2120df);if(_0x3e0de7){_0x5534ee=_0x3e0de7[0x1];}else{_0x5534ee=null;}}else{_0x5534ee=null;}_0x4515b6['cb'](null,{'code':_0x3d265a,'result':_0x265d35,'extra':_0x5534ee});}});_0x1de651['on'](_0xa3de('0x18'),function(_0x3caf1e){_0x1f3316[_0xa3de('0xc')]('error',new AGIError(_0xa3de('0x19'),_0x3caf1e[_0xa3de('0x1a')]));});_0x1de651['on'](_0xa3de('0x1b'),function(){_0x1f3316[_0xa3de('0xc')](_0xa3de('0x1b'),new AGIError(_0xa3de('0x1c')));});_0x1de651['on'](_0xa3de('0x1d'),function(){_0x1f3316[_0xa3de('0xc')](_0xa3de('0x1d'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x1de651[_0xa3de('0x1e')]();});_0x1de651[_0xa3de('0x1f')](_0x358ad3);this[_0xa3de('0x20')]=function(_0x10f448,_0x3bd2a3){var _0x10f448=_0x10f448||'',_0x3bd2a3=typeof _0x3bd2a3==_0xa3de('0x21')?_0x3bd2a3:new Function();_0x4515b6={'tx':_0x10f448,'rx':'','cb':_0x3bd2a3};_0x1de651[_0xa3de('0x22')](_0x10f448+'\x0a');},this['close']=function(){_0x1de651[_0xa3de('0x1e')]();};}util[_0xa3de('0x23')](AGIChannel,EventEmitter);AGIChannel[_0xa3de('0x24')][_0xa3de('0x25')]=function(_0x37d420){return this[_0xa3de('0x20')][_0xa3de('0x26')](this,_0x37d420);};AGIChannel[_0xa3de('0x24')]['answer']=function(){return this['sendRequest'](_0xa3de('0x27'));};AGIChannel[_0xa3de('0x24')]['getData']=function(_0x23bbd1,_0x332c5a,_0x51e98e){_0x23bbd1=_0x23bbd1===undefined?_0xa3de('0x28'):_0x23bbd1;_0x332c5a=_0x332c5a===undefined?'5':_0x332c5a;_0x51e98e=_0x51e98e===undefined?'1':_0x51e98e;return this['sendRequest'](util['format'](_0xa3de('0x29'),_0x23bbd1,_0x332c5a*0x3e8,_0x51e98e));};AGIChannel[_0xa3de('0x24')][_0xa3de('0x2a')]=function(_0x410b2a){_0x410b2a=_0x410b2a||'NO\x20MESSAGE';return this[_0xa3de('0x25')](util[_0xa3de('0x2b')](_0xa3de('0x2c'),_0x410b2a));};AGIChannel[_0xa3de('0x24')][_0xa3de('0x2d')]=function(_0x15c6f4,_0x17e850){if(_[_0xa3de('0x2e')](_0x17e850)){return this['sendRequest'](util['format'](_0xa3de('0x2f'),_0x15c6f4,_0x17e850['join'](',')));}return this[_0xa3de('0x25')](util['format'](_0xa3de('0x2f'),_0x15c6f4,_0x17e850));};AGIChannel[_0xa3de('0x24')][_0xa3de('0x30')]=function(_0x4dc3f6){return this[_0xa3de('0x25')](util['format'](_0xa3de('0x31'),_0x4dc3f6));};AGIChannel[_0xa3de('0x24')][_0xa3de('0x32')]=function(_0x6c7e33){return this[_0xa3de('0x25')](util['format'](_0xa3de('0x33'),_0x6c7e33));};AGIChannel[_0xa3de('0x24')][_0xa3de('0x34')]=function(_0x1512e9){return this[_0xa3de('0x25')](util[_0xa3de('0x2b')](_0xa3de('0x35'),_0x1512e9));};AGIChannel[_0xa3de('0x24')][_0xa3de('0x36')]=function(){return this[_0xa3de('0x25')](_0xa3de('0x37'));};AGIChannel[_0xa3de('0x24')][_0xa3de('0x38')]=function(_0x3da0ba,_0x510e28){return this['sendRequest'](util['format']('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x3da0ba,_0x510e28?_0x510e28[_0xa3de('0x39')]()[_0xa3de('0x11')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xa3de('0x24')][_0xa3de('0x3a')]=function(_0x2190e0,_0x2702de){return this['sendRequest'](util[_0xa3de('0x2b')](_0xa3de('0x3b'),_0x2190e0,_0x2702de));};AGIChannel['prototype']['sayDigits']=function(_0xb66433,_0x4978a8){return this[_0xa3de('0x25')](util[_0xa3de('0x2b')](_0xa3de('0x3c'),_0xb66433,_0x4978a8));};AGIChannel[_0xa3de('0x24')]['sayPhonetic']=function(_0x596f8c,_0x4cbd83){return this['sendRequest'](util[_0xa3de('0x2b')](_0xa3de('0x3d'),_0x596f8c,_0x4cbd83));};AGIChannel[_0xa3de('0x24')][_0xa3de('0x3e')]=function(_0x2ecb11,_0x3e0eab,_0x191b97){_0x3e0eab=_0x3e0eab||this[_0xa3de('0x3f')];_0x191b97=_0x191b97||0x1;this[_0xa3de('0x30')](_0x2ecb11);this[_0xa3de('0x32')](_0x3e0eab);this['setPriority'](_0x191b97);return this[_0xa3de('0x2a')](util[_0xa3de('0x2b')](_0xa3de('0x40'),_0x2ecb11,_0x3e0eab,_0x191b97));};AGIChannel[_0xa3de('0x24')][_0xa3de('0x41')]=function(_0x39ec22){return this[_0xa3de('0x25')](util[_0xa3de('0x2b')](_0xa3de('0x42'),_0x39ec22));};AGIChannel[_0xa3de('0x24')]['recordFile']=function(_0x44993b,_0x8340b3,_0x3d0896,_0x3cabd7,_0x679674,_0x397705){_0x8340b3=_0x8340b3||_0xa3de('0x43');_0x3d0896=_0x3d0896||'';_0x3cabd7=_0x3cabd7===undefined?-0x1:_0x3cabd7==='-1'?-0x1:_0x3cabd7*0x3e8;_0x679674=_0x679674===undefined?'':'s='+_0x679674;_0x397705=_0x397705?_0xa3de('0x44'):'';return this[_0xa3de('0x25')](util[_0xa3de('0x2b')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x44993b,_0x8340b3,_0x3d0896,_0x3cabd7,_0x397705,_0x679674));};AGIChannel['prototype']['streamFile']=function(_0x3045a3,_0x1dcd57){_0x1dcd57=_0x1dcd57||'';return this[_0xa3de('0x25')](util[_0xa3de('0x2b')](_0xa3de('0x45'),_0x3045a3,_0x1dcd57));};AGIChannel[_0xa3de('0x24')][_0xa3de('0x46')]=function(_0x5e37a0){return this[_0xa3de('0x2d')](_0xa3de('0x47'),_0x5e37a0);};AGIChannel[_0xa3de('0x24')][_0xa3de('0x48')]=function(_0x177188){return this['exec']('WAIT',_0x177188);};AGIChannel[_0xa3de('0x24')][_0xa3de('0x18')]=function(_0x497e77,_0x2310cb){this['noop'](util[_0xa3de('0x2b')](_0xa3de('0x49'),_0x497e77['id'],_0x497e77['label'],_0x2310cb));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xa3de('0x4a')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 9126175..9fbba1a 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 _0xe51f=['format','apply','message','name','exports','Undefined\x20error.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push'];(function(_0x487c7e,_0x12b629){var _0x5d36a7=function(_0x29b78d){while(--_0x29b78d){_0x487c7e['push'](_0x487c7e['shift']());}};_0x5d36a7(++_0x12b629);}(_0xe51f,0xf3));var _0xfe51=function(_0x411ab4,_0x5ac7ed){_0x411ab4=_0x411ab4-0x0;var _0x370136=_0xe51f[_0x411ab4];return _0x370136;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0xfe51('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':_0xfe51('0x1'),'E_AGI_SERVER_MAXCONNECTION':_0xfe51('0x2'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0xfe51('0x3'),'E_AGI_SOCKET_TIMEOUT':_0xfe51('0x4'),'E_AGI_COMMAND_EMPTY':_0xfe51('0x5'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0xfe51('0x6')};function AGIError(_0x2b2859){var _0x2b2859=_0x2b2859||null,_0x5e0444=_0x5e0444||[],_0x54f7b7=0x1,_0x1b2225='';if(!error[_0x2b2859]){_0x2b2859=_0xfe51('0x7');}_0x5e0444[_0xfe51('0x8')](error[_0x2b2859]);while(arguments[_0x54f7b7]){_0x5e0444[_0xfe51('0x8')](arguments[_0x54f7b7]);_0x54f7b7++;}_0x1b2225=util[_0xfe51('0x9')][_0xfe51('0xa')](util,_0x5e0444);this[_0xfe51('0xb')]=_0x1b2225;this[_0xfe51('0xc')]=_0x2b2859;}module[_0xfe51('0xd')]=AGIError; \ No newline at end of file +var _0xba75=['E_AGI_UNDEFINED','push','format','message','name','exports','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.entry\x27\x20menu.'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xba75,0x1e6));var _0x5ba7=function(_0x36328f,_0x47b04d){_0x36328f=_0x36328f-0x0;var _0x5543f5=_0xba75[_0x36328f];return _0x5543f5;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x5ba7('0x0'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x5ba7('0x1'),'E_AGI_SERVER_CLOSE':_0x5ba7('0x2'),'E_AGI_SERVER_MAXCONNECTION':_0x5ba7('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0x5ba7('0x4'),'E_AGI_SOCKET_ERROR':_0x5ba7('0x5'),'E_AGI_SOCKET_CLOSE':_0x5ba7('0x6'),'E_AGI_SOCKET_TIMEOUT':_0x5ba7('0x7'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x5ba7('0x8')};function AGIError(_0x1139c1){var _0x1139c1=_0x1139c1||null,_0x4b8892=_0x4b8892||[],_0x49b53a=0x1,_0x18bb56='';if(!error[_0x1139c1]){_0x1139c1=_0x5ba7('0x9');}_0x4b8892['push'](error[_0x1139c1]);while(arguments[_0x49b53a]){_0x4b8892[_0x5ba7('0xa')](arguments[_0x49b53a]);_0x49b53a++;}_0x18bb56=util[_0x5ba7('0xb')]['apply'](util,_0x4b8892);this[_0x5ba7('0xc')]=_0x18bb56;this[_0x5ba7('0xd')]=_0x1139c1;}module[_0x5ba7('0xe')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 9b2cb24..c18a553 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 _0xfff0=['condition','split','length','vswitch','target','agicommand','invalid','traverseBFS','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','../../../config/logger','agi','menu','getsecretdigits','vertices','edges','prototype','addVertex','push','numberOfEdges','size','relations','getVertex','info','no\x20vertex\x20found','stop\x20traverse','no\x20edge/s\x20available'];(function(_0x2d2258,_0x2ce510){var _0x18e155=function(_0x11949e){while(--_0x11949e){_0x2d2258['push'](_0x2d2258['shift']());}};_0x18e155(++_0x2ce510);}(_0xfff0,0x139));var _0x0fff=function(_0x329c34,_0x21c417){_0x329c34=_0x329c34-0x0;var _0x5ef4a0=_0xfff0[_0x329c34];return _0x5ef4a0;};'use strict';var _=require('lodash');var logger=require(_0x0fff('0x0'))(_0x0fff('0x1'));var verticesWithRetry=[_0x0fff('0x2'),'getdigits',_0x0fff('0x3')];var Graph=function(){this[_0x0fff('0x4')]={};this[_0x0fff('0x5')]={};this['numberOfEdges']=0x0;};Graph[_0x0fff('0x6')][_0x0fff('0x7')]=function(_0x53c517){this[_0x0fff('0x4')][_0x53c517['id']]=_0x53c517;this[_0x0fff('0x5')][_0x53c517['id']]=[];};Graph[_0x0fff('0x6')]['addEdge']=function(_0x24cfb0,_0x5e9672,_0x1f2658){this['edges'][_0x24cfb0][_0x0fff('0x8')]({'target':_0x5e9672,'condition':_0x1f2658});this[_0x0fff('0x9')]+=0x1;};Graph['prototype'][_0x0fff('0xa')]=function(){return _[_0x0fff('0xa')](this[_0x0fff('0x4')]);};Graph[_0x0fff('0x6')][_0x0fff('0xb')]=function(){return this[_0x0fff('0x9')];};Graph[_0x0fff('0x6')][_0x0fff('0xc')]=function(_0x2a0e49){return this[_0x0fff('0x4')][_0x2a0e49];};Graph[_0x0fff('0x6')]['traverseBFS']=function(_0x1fb243,_0x4b62a4){if(!this[_0x0fff('0x4')][_0x1fb243]){return logger[_0x0fff('0xd')](_0x0fff('0xe'));}var _0x2c0322=_0x4b62a4(this['vertices'][_0x1fb243]);if(!_0x2c0322){return logger['info'](_0x0fff('0xf'));}if(this['edges'][_0x1fb243]['length']===0x0){return logger['info'](_0x0fff('0x10'));}for(var _0x41e2e7=0x0,_0x5eab2e=[],_0x431b33=![];_0x41e2e7\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','dnid','uniqueid','arg_1','callerid','evtHangup','toJson','mxGraphModel','root','agicommand','hasOwnProperty','retry','maxRetry','addVertex','mxCell','isArray','length','target','value','getSquareProject','then','catch','createSquareReport','indexOf','substring','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','hangup','sync','production','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','omit','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','toString','agicommand\x20not\x20found','finally','clear','isUndefined','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s'];(function(_0x30633b,_0x19fe1b){var _0x5c3513=function(_0x3a0d1d){while(--_0x3a0d1d){_0x30633b['push'](_0x30633b['shift']());}};_0x5c3513(++_0x19fe1b);}(_0xed1f,0x6a));var _0xfed1=function(_0x1a7846,_0x59723e){_0x1a7846=_0x1a7846-0x0;var _0x48049=_0xed1f[_0x1a7846];return _0x48049;};'use strict';var parser=require(_0xfed1('0x0'));var _=require(_0xfed1('0x1'));var syncho=require(_0xfed1('0x2'));var util=require(_0xfed1('0x3'));var moment=require(_0xfed1('0x4'));var config=require(_0xfed1('0x5'));var logger=require(_0xfed1('0x6'))(_0xfed1('0x7'));var utilLicense=require(_0xfed1('0x8'));var rpc=require(_0xfed1('0x9'));var mailRpc=require(_0xfed1('0xa'));var Graph=require(_0xfed1('0xb'));var Vertices=require(_0xfed1('0xc'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xfed1('0x7')]=_[_0xfed1('0xd')](config[_0xfed1('0x7')],{'ip':_0xfed1('0xe'),'port':0x11dd});function connectionHandler(_0x2967ef){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x2967ef);agiHandler(_0x2967ef);}catch(_0x42dd5c){logger[_0xfed1('0xf')](_0x42dd5c['stack']);}});});}function listeningHandler(){console[_0xfed1('0x10')](_0xfed1('0x11'),config['agi'][_0xfed1('0x12')]);logger['info'](util[_0xfed1('0x13')](_0xfed1('0x14'),config['agi']['ip'],config['agi'][_0xfed1('0x12')]));}function errorHandler(_0xe84ba6){if(_0xe84ba6&&_0xe84ba6['name']&&_0xe84ba6[_0xfed1('0x15')]){logger['error'](util['format'](_0xfed1('0x16'),_0xe84ba6[_0xfed1('0x17')],_0xe84ba6['message']));}else{logger[_0xfed1('0xf')](util['format']('[ERROR]\x20%s',_0xe84ba6[_0xfed1('0x18')]));}}function closeHandler(){logger[_0xfed1('0x19')](util[_0xfed1('0x13')](_0xfed1('0x1a'),this['arg_1'],this[_0xfed1('0x1b')],this['callerid'],this[_0xfed1('0x1c')],this[_0xfed1('0x1d')]));try{createSquareReport(this);}catch(_0x489a0f){logger[_0xfed1('0xf')](_0x489a0f[_0xfed1('0x18')]);}}function timeoutHandler(){logger['info'](util['format']('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xfed1('0x1e')],this['calleridname'],this[_0xfed1('0x1f')],this[_0xfed1('0x1c')],this['uniqueid']));}function hangupHandler(){logger[_0xfed1('0x19')](util[_0xfed1('0x13')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xfed1('0x1e')],this[_0xfed1('0x1b')],this[_0xfed1('0x1f')],this[_0xfed1('0x1c')],this['uniqueid']));this[_0xfed1('0x20')]=!![];}function getRoot(_0x59333e){return parser[_0xfed1('0x21')](_0x59333e,{'object':!![]})[_0xfed1('0x22')][_0xfed1('0x23')];}function addVertex(_0x532ec2,_0x41d22c,_0x594917){_0x41d22c[_0xfed1('0x24')]=_0x594917;if(_0x41d22c[_0xfed1('0x25')](_0xfed1('0x26'))){_0x41d22c[_0xfed1('0x27')]=parseInt(_0x41d22c[_0xfed1('0x26')],0xa);}_0x532ec2[_0xfed1('0x28')](_['omit'](_0x41d22c,_0xfed1('0x29')));}function initGraph(_0xcb1cdc,_0x49072b){var _0x1d6c72=new Graph();for(var _0x2b9dd2 in _0xcb1cdc){if(_0xcb1cdc[_0xfed1('0x25')](_0x2b9dd2)){if(_[_0xfed1('0x2a')](_0xcb1cdc[_0x2b9dd2])){for(var _0x3b9122=0x0;_0x3b9122<_0xcb1cdc[_0x2b9dd2][_0xfed1('0x2b')];_0x3b9122+=0x1){addVertex(_0x1d6c72,_0xcb1cdc[_0x2b9dd2][_0x3b9122],_0x2b9dd2);}}else{addVertex(_0x1d6c72,_0xcb1cdc[_0x2b9dd2],_0x2b9dd2);}}}for(var _0x583953=0x0;_0x583953<_0x49072b[_0xfed1('0x2b')];_0x583953+=0x1){if(_0x49072b[_0x583953]['source']&&_0x49072b[_0x583953][_0xfed1('0x2c')]){_0x1d6c72['addEdge'](_0x49072b[_0x583953]['source'],_0x49072b[_0x583953][_0xfed1('0x2c')],_0x49072b[_0x583953][_0xfed1('0x2d')]);}}return _0x1d6c72;}function getSquareProject(_0x2d334e,_0x599c23){rpc[_0xfed1('0x2e')](_0x2d334e)[_0xfed1('0x2f')](function(_0x13f414){_0x599c23(null,_0x13f414);})[_0xfed1('0x30')](function(_0x12399f){_0x599c23(null,_0x12399f);});}function createSquareReport(_0x30272b,_0x5ccc3a){rpc[_0xfed1('0x31')](_0x30272b)[_0xfed1('0x2f')](function(_0x4fc309){if(_0x5ccc3a){_0x5ccc3a(null,_0x4fc309);}})['catch'](function(_0x28bd98){if(_0x5ccc3a){_0x5ccc3a(null,_0x28bd98);}});}function setChannelVariables(_0x2d10f5){for(var _0x2def09 in _0x2d10f5){if(_0x2d10f5[_0xfed1('0x25')](_0x2def09)){if(_0x2def09[_0xfed1('0x32')]('agi_')===0x0){_0x2d10f5[_0x2def09[_0xfed1('0x33')](0x4)]=_0x2d10f5[_0x2def09];delete _0x2d10f5[_0x2def09];}}}}function getLogFromObject(_0x21b292){return util[_0xfed1('0x34')](_0x21b292,{'showHidden':![],'depth':null});}function agiHandler(_0x349de1){var _0xa4c53c,_0x4fde94,_0x1da4b7,_0x4a81be,_0x11c5bd;logger[_0xfed1('0x35')](_0xfed1('0x36'),JSON[_0xfed1('0x37')](_0x349de1,null,0x2));logger[_0xfed1('0x19')](util[_0xfed1('0x13')](_0xfed1('0x38'),_0x349de1[_0xfed1('0x1e')],_0x349de1['calleridname'],_0x349de1[_0xfed1('0x1f')],_0x349de1[_0xfed1('0x1c')],_0x349de1[_0xfed1('0x1d')]));_0x349de1['on'](_0xfed1('0xf'),errorHandler);_0x349de1['on']('close',closeHandler);_0x349de1['on']('timeout',timeoutHandler);_0x349de1[_0xfed1('0x20')]=![];_0x349de1['on'](_0xfed1('0x39'),hangupHandler);var _0x1d06af=getSquareProject[_0xfed1('0x3a')](null,_0x349de1[_0xfed1('0x1e')]);if(_0x1d06af){if(_0x1d06af[_0xfed1('0x3b')]){_0xa4c53c=getRoot(_0x1d06af[_0xfed1('0x3b')]);if(_0xa4c53c&&_0xa4c53c[_0xfed1('0x3c')]){logger['debug']('root',JSON[_0xfed1('0x37')](_0xa4c53c,null,0x2));_0x349de1[_0xfed1('0x3d')]=moment()['format'](_0xfed1('0x3e'));_0x4fde94=initGraph(_[_0xfed1('0x3f')](_0xa4c53c,_0xfed1('0x29')),_0xa4c53c[_0xfed1('0x29')]);_0x1da4b7=new Vertices(_0x349de1,rpc,mailRpc);logger[_0xfed1('0x19')](util[_0xfed1('0x13')](_0xfed1('0x40'),_0x349de1[_0xfed1('0x1e')],_0x349de1[_0xfed1('0x1b')],_0x349de1['callerid'],_0x349de1['dnid'],_0x349de1['uniqueid']));_0x4fde94[_0xfed1('0x41')](_0xa4c53c[_0xfed1('0x3c')]['id'],function(_0x2f8f08){try{_0x2f8f08=_0x1da4b7['clear'](_0x2f8f08);logger[_0xfed1('0x35')]('vertex',JSON[_0xfed1('0x37')](_0x2f8f08,null,0x2));if(_0x2f8f08[_0xfed1('0x24')]===_0xfed1('0x42')){logger['info'](_0xfed1('0x43'));_0x349de1[_0xfed1('0x44')]=_0x2f8f08[_0xfed1('0x44')]||_0x349de1['context'];_0x349de1[_0xfed1('0x45')]=_0x2f8f08['extension'];_0x349de1[_0xfed1('0x46')]=_0x2f8f08[_0xfed1('0x46')]?_0x2f8f08[_0xfed1('0x46')]-0x1:0x1;return null;}else if(_0x2f8f08&&_0x1da4b7[_0x2f8f08[_0xfed1('0x24')]]){_0x11c5bd=_0x1da4b7[_0x2f8f08[_0xfed1('0x24')]](_0x2f8f08);logger[_0xfed1('0x19')](_0xfed1('0x47'),JSON[_0xfed1('0x37')](_0x11c5bd,null,0x2));if(_0x11c5bd&&_0x11c5bd[_0xfed1('0x48')]===AGI_CODE_SUCCESS&&_0x11c5bd['result']!==AGI_RESULT_ERROR&&!_0x349de1[_0xfed1('0x20')]){logger[_0xfed1('0x35')](_0xfed1('0x47'),getLogFromObject(_0x11c5bd));return _['isUndefined'](_0x11c5bd['result'])?null:_0x11c5bd[_0xfed1('0x49')][_0xfed1('0x4a')]();}else{logger[_0xfed1('0xf')](_0xfed1('0x47'),getLogFromObject(_0x11c5bd));return null;}}else{logger[_0xfed1('0xf')](_0xfed1('0x4b'));return null;}}catch(_0x2547ee){logger[_0xfed1('0xf')](_0x2547ee[_0xfed1('0x18')]);return null;}});if(_0xa4c53c[_0xfed1('0x4c')]){logger[_0xfed1('0x19')](util[_0xfed1('0x13')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x349de1[_0xfed1('0x1e')],_0x349de1[_0xfed1('0x1b')],_0x349de1[_0xfed1('0x1f')],_0x349de1[_0xfed1('0x1c')],_0x349de1[_0xfed1('0x1d')]));_0x4fde94[_0xfed1('0x41')](_0xa4c53c['finally']['id'],function(_0x1dd879){try{_0x1dd879=_0x1da4b7[_0xfed1('0x4d')](_0x1dd879);logger[_0xfed1('0x35')]('vertex',JSON[_0xfed1('0x37')](_0x1dd879,null,0x2));if(_0x1dd879&&_0x1da4b7[_0x1dd879[_0xfed1('0x24')]]){_0x11c5bd=_0x1da4b7[_0x1dd879[_0xfed1('0x24')]](_0x1dd879);if(_0x11c5bd){logger[_0xfed1('0x35')]('response',getLogFromObject(_0x11c5bd));return _[_0xfed1('0x4e')](_0x11c5bd[_0xfed1('0x49')])?null:_0x11c5bd[_0xfed1('0x49')][_0xfed1('0x4a')]();}else{logger[_0xfed1('0xf')](_0xfed1('0x47'),getLogFromObject(_0x11c5bd));return null;}}else{logger[_0xfed1('0xf')](_0xfed1('0x4b'));return null;}}catch(_0x2365db){logger[_0xfed1('0xf')](_0x2365db[_0xfed1('0x18')]);return null;}});}logger[_0xfed1('0x19')](util[_0xfed1('0x13')](_0xfed1('0x4f'),_0x349de1[_0xfed1('0x1e')],_0x349de1[_0xfed1('0x1b')],_0x349de1[_0xfed1('0x1f')],_0x349de1[_0xfed1('0x1c')],_0x349de1['uniqueid']));logger['info'](util[_0xfed1('0x13')](_0xfed1('0x50'),_0x349de1[_0xfed1('0x44')],_0x349de1[_0xfed1('0x45')],parseInt(_0x349de1['priority'],0xa)+0x1));_0x349de1[_0xfed1('0x51')](_0x349de1[_0xfed1('0x44')],_0x349de1['extension'],parseInt(_0x349de1['priority'],0xa)+0x1);_0x349de1['close']();}}else{logger[_0xfed1('0xf')](util[_0xfed1('0x13')](_0xfed1('0x52'),_0x349de1[_0xfed1('0x1e')]));_0x349de1[_0xfed1('0x51')](_0x349de1[_0xfed1('0x44')],_0x349de1[_0xfed1('0x45')],parseInt(_0x349de1[_0xfed1('0x46')],0xa)+0x1);_0x349de1[_0xfed1('0x53')]();}}else{logger[_0xfed1('0xf')](util['format']('Project\x20%s\x20not\x20found',_0x349de1[_0xfed1('0x1e')]));_0x349de1[_0xfed1('0x51')](_0x349de1[_0xfed1('0x44')],_0x349de1[_0xfed1('0x45')],parseInt(_0x349de1[_0xfed1('0x46')],0xa)+0x1);_0x349de1[_0xfed1('0x53')]();}}function main(){var _0x122702;return utilLicense[_0xfed1('0x54')]()[_0xfed1('0x2f')](function(_0x427fa6){if(_0x427fa6){if(_0x427fa6[_0xfed1('0x55')]){if(_0x427fa6[_0xfed1('0x56')]&&_0x427fa6[_0xfed1('0x56')]>0x0){logger[_0xfed1('0x19')](util[_0xfed1('0x13')](_0xfed1('0x57'),_0x427fa6[_0xfed1('0x56')]));_0x122702=_0x427fa6['callysquare'];}else{logger['info'](_0xfed1('0x58'));}}else{logger[_0xfed1('0x19')](_0xfed1('0x59'));_0x122702=-0x1;}}})[_0xfed1('0x30')](function(_0x23a4f0){logger[_0xfed1('0xf')](_0xfed1('0x5a'),_0x23a4f0[_0xfed1('0x18')]);})[_0xfed1('0x4c')](function(){var _0x1f2250=require(_0xfed1('0x5b'))(config[_0xfed1('0x7')][_0xfed1('0x12')],config[_0xfed1('0x7')]['ip'],_0x122702);_0x1f2250['on']('error',errorHandler);_0x1f2250['on'](_0xfed1('0x5c'),listeningHandler);_0x1f2250['on']('connection',connectionHandler);_0x1f2250['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0x8ece=['catch','createSquareReport','indexOf','agi_','substring','inspect','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','production','start','debug','root','joinAt','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','toString','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','finally','clear','isUndefined','agicommand\x20not\x20found','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','xml2json','lodash','syncho','util','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','./vertices','defaults','127.0.0.1','nextTick','error','log','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[ERROR]\x20%s','stack','arg_1','calleridname','callerid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','mxGraphModel','agicommand','hasOwnProperty','retry','addVertex','omit','mxCell','isArray','length','source','target','value','then'];(function(_0x194e30,_0x1df61f){var _0x575e47=function(_0x516bae){while(--_0x516bae){_0x194e30['push'](_0x194e30['shift']());}};_0x575e47(++_0x1df61f);}(_0x8ece,0x195));var _0xe8ec=function(_0x59929d,_0x54b15c){_0x59929d=_0x59929d-0x0;var _0x2d8394=_0x8ece[_0x59929d];return _0x2d8394;};'use strict';var parser=require(_0xe8ec('0x0'));var _=require(_0xe8ec('0x1'));var syncho=require(_0xe8ec('0x2'));var util=require(_0xe8ec('0x3'));var moment=require('moment');var config=require('../../config/environment');var logger=require(_0xe8ec('0x4'))(_0xe8ec('0x5'));var utilLicense=require(_0xe8ec('0x6'));var rpc=require(_0xe8ec('0x7'));var mailRpc=require(_0xe8ec('0x8'));var Graph=require('./graph');var Vertices=require(_0xe8ec('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xe8ec('0x5')]=_[_0xe8ec('0xa')](config[_0xe8ec('0x5')],{'ip':_0xe8ec('0xb'),'port':0x11dd});function connectionHandler(_0x122f36){process[_0xe8ec('0xc')](function(){syncho(function(){try{setChannelVariables(_0x122f36);agiHandler(_0x122f36);}catch(_0x5525f8){logger[_0xe8ec('0xd')](_0x5525f8['stack']);}});});}function listeningHandler(){console[_0xe8ec('0xe')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0xe8ec('0x5')][_0xe8ec('0xf')]);logger[_0xe8ec('0x10')](util[_0xe8ec('0x11')](_0xe8ec('0x12'),config[_0xe8ec('0x5')]['ip'],config[_0xe8ec('0x5')][_0xe8ec('0xf')]));}function errorHandler(_0x4f361f){if(_0x4f361f&&_0x4f361f[_0xe8ec('0x13')]&&_0x4f361f[_0xe8ec('0x14')]){logger[_0xe8ec('0xd')](util[_0xe8ec('0x11')]('[%s]\x20%s',_0x4f361f[_0xe8ec('0x13')],_0x4f361f[_0xe8ec('0x14')]));}else{logger[_0xe8ec('0xd')](util[_0xe8ec('0x11')](_0xe8ec('0x15'),_0x4f361f[_0xe8ec('0x16')]));}}function closeHandler(){logger[_0xe8ec('0x10')](util[_0xe8ec('0x11')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xe8ec('0x17')],this[_0xe8ec('0x18')],this[_0xe8ec('0x19')],this['dnid'],this[_0xe8ec('0x1a')]));try{createSquareReport(this);}catch(_0x20e847){logger[_0xe8ec('0xd')](_0x20e847[_0xe8ec('0x16')]);}}function timeoutHandler(){logger[_0xe8ec('0x10')](util[_0xe8ec('0x11')](_0xe8ec('0x1b'),this[_0xe8ec('0x17')],this['calleridname'],this[_0xe8ec('0x19')],this[_0xe8ec('0x1c')],this[_0xe8ec('0x1a')]));}function hangupHandler(){logger[_0xe8ec('0x10')](util[_0xe8ec('0x11')](_0xe8ec('0x1d'),this[_0xe8ec('0x17')],this[_0xe8ec('0x18')],this[_0xe8ec('0x19')],this['dnid'],this[_0xe8ec('0x1a')]));this[_0xe8ec('0x1e')]=!![];}function getRoot(_0x3de125){return parser[_0xe8ec('0x1f')](_0x3de125,{'object':!![]})[_0xe8ec('0x20')]['root'];}function addVertex(_0x2e05d8,_0x78b6f4,_0x431af0){_0x78b6f4[_0xe8ec('0x21')]=_0x431af0;if(_0x78b6f4[_0xe8ec('0x22')](_0xe8ec('0x23'))){_0x78b6f4['maxRetry']=parseInt(_0x78b6f4['retry'],0xa);}_0x2e05d8[_0xe8ec('0x24')](_[_0xe8ec('0x25')](_0x78b6f4,_0xe8ec('0x26')));}function initGraph(_0x2966d7,_0xbec801){var _0x3519a5=new Graph();for(var _0x267356 in _0x2966d7){if(_0x2966d7[_0xe8ec('0x22')](_0x267356)){if(_[_0xe8ec('0x27')](_0x2966d7[_0x267356])){for(var _0x2e2d47=0x0;_0x2e2d47<_0x2966d7[_0x267356][_0xe8ec('0x28')];_0x2e2d47+=0x1){addVertex(_0x3519a5,_0x2966d7[_0x267356][_0x2e2d47],_0x267356);}}else{addVertex(_0x3519a5,_0x2966d7[_0x267356],_0x267356);}}}for(var _0x1b314d=0x0;_0x1b314d<_0xbec801[_0xe8ec('0x28')];_0x1b314d+=0x1){if(_0xbec801[_0x1b314d][_0xe8ec('0x29')]&&_0xbec801[_0x1b314d][_0xe8ec('0x2a')]){_0x3519a5['addEdge'](_0xbec801[_0x1b314d][_0xe8ec('0x29')],_0xbec801[_0x1b314d][_0xe8ec('0x2a')],_0xbec801[_0x1b314d][_0xe8ec('0x2b')]);}}return _0x3519a5;}function getSquareProject(_0x52c0b1,_0x28cd63){rpc['getSquareProject'](_0x52c0b1)[_0xe8ec('0x2c')](function(_0x3b27d3){_0x28cd63(null,_0x3b27d3);})[_0xe8ec('0x2d')](function(_0xb5fcbb){_0x28cd63(null,_0xb5fcbb);});}function createSquareReport(_0x9c83b9,_0x4a89b9){rpc[_0xe8ec('0x2e')](_0x9c83b9)[_0xe8ec('0x2c')](function(_0x357119){if(_0x4a89b9){_0x4a89b9(null,_0x357119);}})['catch'](function(_0x2bc9e4){if(_0x4a89b9){_0x4a89b9(null,_0x2bc9e4);}});}function setChannelVariables(_0x4bfb2a){for(var _0x469f79 in _0x4bfb2a){if(_0x4bfb2a[_0xe8ec('0x22')](_0x469f79)){if(_0x469f79[_0xe8ec('0x2f')](_0xe8ec('0x30'))===0x0){_0x4bfb2a[_0x469f79[_0xe8ec('0x31')](0x4)]=_0x4bfb2a[_0x469f79];delete _0x4bfb2a[_0x469f79];}}}}function getLogFromObject(_0x757785){return util[_0xe8ec('0x32')](_0x757785,{'showHidden':![],'depth':null});}function agiHandler(_0x2277cc){var _0x7a1722,_0x538be3,_0x1191b3,_0x145f3e,_0x18cd13;logger['debug'](_0xe8ec('0x33'),JSON[_0xe8ec('0x34')](_0x2277cc,null,0x2));logger['info'](util[_0xe8ec('0x11')](_0xe8ec('0x35'),_0x2277cc[_0xe8ec('0x17')],_0x2277cc[_0xe8ec('0x18')],_0x2277cc['callerid'],_0x2277cc[_0xe8ec('0x1c')],_0x2277cc[_0xe8ec('0x1a')]));_0x2277cc['on'](_0xe8ec('0xd'),errorHandler);_0x2277cc['on'](_0xe8ec('0x36'),closeHandler);_0x2277cc['on'](_0xe8ec('0x37'),timeoutHandler);_0x2277cc[_0xe8ec('0x1e')]=![];_0x2277cc['on'](_0xe8ec('0x38'),hangupHandler);var _0x29f78a=getSquareProject['sync'](null,_0x2277cc['arg_1']);if(_0x29f78a){if(_0x29f78a[_0xe8ec('0x39')]){_0x7a1722=getRoot(_0x29f78a[_0xe8ec('0x39')]);if(_0x7a1722&&_0x7a1722[_0xe8ec('0x3a')]){logger[_0xe8ec('0x3b')](_0xe8ec('0x3c'),JSON[_0xe8ec('0x34')](_0x7a1722,null,0x2));_0x2277cc[_0xe8ec('0x3d')]=moment()['format'](_0xe8ec('0x3e'));_0x538be3=initGraph(_['omit'](_0x7a1722,_0xe8ec('0x26')),_0x7a1722[_0xe8ec('0x26')]);_0x1191b3=new Vertices(_0x2277cc,rpc,mailRpc);logger['info'](util['format'](_0xe8ec('0x3f'),_0x2277cc[_0xe8ec('0x17')],_0x2277cc[_0xe8ec('0x18')],_0x2277cc['callerid'],_0x2277cc[_0xe8ec('0x1c')],_0x2277cc[_0xe8ec('0x1a')]));_0x538be3[_0xe8ec('0x40')](_0x7a1722[_0xe8ec('0x3a')]['id'],function(_0x3d52c9){try{_0x3d52c9=_0x1191b3['clear'](_0x3d52c9);logger['debug'](_0xe8ec('0x41'),JSON['stringify'](_0x3d52c9,null,0x2));if(_0x3d52c9[_0xe8ec('0x21')]===_0xe8ec('0x42')){logger[_0xe8ec('0x10')](_0xe8ec('0x43'));_0x2277cc[_0xe8ec('0x44')]=_0x3d52c9[_0xe8ec('0x44')]||_0x2277cc[_0xe8ec('0x44')];_0x2277cc['extension']=_0x3d52c9[_0xe8ec('0x45')];_0x2277cc[_0xe8ec('0x46')]=_0x3d52c9[_0xe8ec('0x46')]?_0x3d52c9[_0xe8ec('0x46')]-0x1:0x1;return null;}else if(_0x3d52c9&&_0x1191b3[_0x3d52c9[_0xe8ec('0x21')]]){_0x18cd13=_0x1191b3[_0x3d52c9[_0xe8ec('0x21')]](_0x3d52c9);logger[_0xe8ec('0x10')](_0xe8ec('0x47'),JSON['stringify'](_0x18cd13,null,0x2));if(_0x18cd13&&_0x18cd13[_0xe8ec('0x48')]===AGI_CODE_SUCCESS&&_0x18cd13[_0xe8ec('0x49')]!==AGI_RESULT_ERROR&&!_0x2277cc[_0xe8ec('0x1e')]){logger['debug'](_0xe8ec('0x47'),getLogFromObject(_0x18cd13));return _['isUndefined'](_0x18cd13[_0xe8ec('0x49')])?null:_0x18cd13[_0xe8ec('0x49')][_0xe8ec('0x4a')]();}else{logger['error'](_0xe8ec('0x47'),getLogFromObject(_0x18cd13));return null;}}else{logger[_0xe8ec('0xd')]('agicommand\x20not\x20found');return null;}}catch(_0x1479c3){logger['error'](_0x1479c3[_0xe8ec('0x16')]);return null;}});if(_0x7a1722['finally']){logger[_0xe8ec('0x10')](util[_0xe8ec('0x11')](_0xe8ec('0x4b'),_0x2277cc[_0xe8ec('0x17')],_0x2277cc['calleridname'],_0x2277cc['callerid'],_0x2277cc['dnid'],_0x2277cc[_0xe8ec('0x1a')]));_0x538be3[_0xe8ec('0x40')](_0x7a1722[_0xe8ec('0x4c')]['id'],function(_0x5a900e){try{_0x5a900e=_0x1191b3[_0xe8ec('0x4d')](_0x5a900e);logger[_0xe8ec('0x3b')](_0xe8ec('0x41'),JSON[_0xe8ec('0x34')](_0x5a900e,null,0x2));if(_0x5a900e&&_0x1191b3[_0x5a900e[_0xe8ec('0x21')]]){_0x18cd13=_0x1191b3[_0x5a900e['agicommand']](_0x5a900e);if(_0x18cd13){logger[_0xe8ec('0x3b')](_0xe8ec('0x47'),getLogFromObject(_0x18cd13));return _[_0xe8ec('0x4e')](_0x18cd13[_0xe8ec('0x49')])?null:_0x18cd13[_0xe8ec('0x49')][_0xe8ec('0x4a')]();}else{logger[_0xe8ec('0xd')]('response',getLogFromObject(_0x18cd13));return null;}}else{logger[_0xe8ec('0xd')](_0xe8ec('0x4f'));return null;}}catch(_0x59dc46){logger[_0xe8ec('0xd')](_0x59dc46[_0xe8ec('0x16')]);return null;}});}logger[_0xe8ec('0x10')](util[_0xe8ec('0x11')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x2277cc[_0xe8ec('0x17')],_0x2277cc[_0xe8ec('0x18')],_0x2277cc[_0xe8ec('0x19')],_0x2277cc[_0xe8ec('0x1c')],_0x2277cc[_0xe8ec('0x1a')]));logger[_0xe8ec('0x10')](util['format'](_0xe8ec('0x50'),_0x2277cc[_0xe8ec('0x44')],_0x2277cc['extension'],parseInt(_0x2277cc['priority'],0xa)+0x1));_0x2277cc[_0xe8ec('0x51')](_0x2277cc['context'],_0x2277cc['extension'],parseInt(_0x2277cc[_0xe8ec('0x46')],0xa)+0x1);_0x2277cc[_0xe8ec('0x36')]();}}else{logger[_0xe8ec('0xd')](util[_0xe8ec('0x11')](_0xe8ec('0x52'),_0x2277cc[_0xe8ec('0x17')]));_0x2277cc['continueAt'](_0x2277cc['context'],_0x2277cc[_0xe8ec('0x45')],parseInt(_0x2277cc[_0xe8ec('0x46')],0xa)+0x1);_0x2277cc['close']();}}else{logger['error'](util[_0xe8ec('0x11')](_0xe8ec('0x53'),_0x2277cc[_0xe8ec('0x17')]));_0x2277cc['continueAt'](_0x2277cc['context'],_0x2277cc[_0xe8ec('0x45')],parseInt(_0x2277cc[_0xe8ec('0x46')],0xa)+0x1);_0x2277cc[_0xe8ec('0x36')]();}}function main(){var _0x20a431;return utilLicense['getLicense']()['then'](function(_0x17d1e4){if(_0x17d1e4){if(_0x17d1e4['voice']){if(_0x17d1e4[_0xe8ec('0x54')]&&_0x17d1e4[_0xe8ec('0x54')]>0x0){logger['info'](util[_0xe8ec('0x11')]('[LICENSE]\x20CHANNELS:\x20%s',_0x17d1e4[_0xe8ec('0x54')]));_0x20a431=_0x17d1e4['callysquare'];}else{logger[_0xe8ec('0x10')](_0xe8ec('0x55'));}}else{logger[_0xe8ec('0x10')](_0xe8ec('0x56'));_0x20a431=-0x1;}}})[_0xe8ec('0x2d')](function(_0x30a9b0){logger['error'](_0xe8ec('0x57'),_0x30a9b0['stack']);})[_0xe8ec('0x4c')](function(){var _0x1184aa=require(_0xe8ec('0x58'))(config[_0xe8ec('0x5')][_0xe8ec('0xf')],config['agi']['ip'],_0x20a431);_0x1184aa['on'](_0xe8ec('0xd'),errorHandler);_0x1184aa['on'](_0xe8ec('0x59'),listeningHandler);_0x1184aa['on']('connection',connectionHandler);_0x1184aa['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 1d5c8a5..4ada6ef 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(_0x1056d0,_0x107d79){var _0x4d8980=function(_0x448582){while(--_0x448582){_0x1056d0['push'](_0x1056d0['shift']());}};_0x4d8980(++_0x107d79);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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 _0x34e8=['catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then','error','message'];(function(_0x1586bf,_0x22349c){var _0x329d7d=function(_0x9e8f02){while(--_0x9e8f02){_0x1586bf['push'](_0x1586bf['shift']());}};_0x329d7d(++_0x22349c);}(_0x34e8,0x12c));var _0x834e=function(_0x3b5f65,_0x1562ea){_0x3b5f65=_0x3b5f65-0x0;var _0xef4b0=_0x34e8[_0x3b5f65];return _0xef4b0;};'use strict';var BPromise=require(_0x834e('0x0'));var jayson=require(_0x834e('0x1'));var client=jayson[_0x834e('0x2')][_0x834e('0x3')]({'port':0x232b});function request(_0x530939,_0x832422){return new BPromise(function(_0x21e2e0,_0x472111){return client[_0x834e('0x4')](_0x530939,_0x832422)[_0x834e('0x5')](function(_0x19a3e0){if(_0x19a3e0[_0x834e('0x6')]){return _0x472111(_0x19a3e0['error'][_0x834e('0x7')]);}else{return _0x21e2e0(_0x19a3e0['result']);}})[_0x834e('0x8')](function(_0x3cc2e3){return _0x472111(_0x3cc2e3);});});}exports[_0x834e('0x9')]=function(_0x2e69e2,_0x33ea05){return request(_0x834e('0xa'),{'account':_0x2e69e2,'message':_0x33ea05});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 2d01028..accee08 100644 --- a/server/services/agi/reply.js +++ b/server/services/agi/reply.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['call','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','_localBuffer','toString','indexOf','substring','split','trim','slice','length','emit','headers','line','exports','util','Transform'];(function(_0x2df1f2,_0x58d388){var _0x38652b=function(_0x18e322){while(--_0x18e322){_0x2df1f2['push'](_0x2df1f2['shift']());}};_0x38652b(++_0x58d388);}(_0xb10b,0x12a));var _0xbb10=function(_0x4c440b,_0x3ea627){_0x4c440b=_0x4c440b-0x0;var _0x2d48cf=_0xb10b[_0x4c440b];return _0x2d48cf;};'use strict';var util=require(_0xbb10('0x0'));var Transform=require('stream')[_0xbb10('0x1')];function AGIReply(_0x35bc5f){Transform[_0xbb10('0x2')](this,_0x35bc5f);this['_localBuffer']='';this[_0xbb10('0x3')]=![];}util[_0xbb10('0x4')](AGIReply,Transform);AGIReply[_0xbb10('0x5')][_0xbb10('0x6')]=function(_0x49baf4,_0x312b72,_0x481979){var _0x328583='\x0a',_0x3cdd53=['\x0a\x0a',_0xbb10('0x7')],_0x513741=-0x1,_0x1b9e94=-0x1,_0x3fb675='',_0x21370f=0x0,_0x1c3ee5='',_0x2353ef='';this[_0xbb10('0x8')]+=_0x49baf4[_0xbb10('0x9')]();_0x1c3ee5=this['_localBuffer'];if(!this['_inBody']){_0x21370f=0x0;while(_0x3cdd53[_0x21370f]){while((_0x1b9e94=_0x1c3ee5[_0xbb10('0xa')](_0x3cdd53[_0x21370f]))!=-0x1){_0x3fb675=_0x3cdd53[_0x21370f];_0x2353ef=_0x1c3ee5[_0xbb10('0xb')](0x0,_0x1b9e94);_0x1c3ee5=_0x1c3ee5[_0xbb10('0xb')](_0x1b9e94+_0x3fb675['length']);var _0x408248=_0x2353ef[_0xbb10('0xc')](_0x328583),_0x5be7e0=0x0,_0x44fb19={},_0x916a32='',_0x285009='',_0x193a27=-0x1;while(_0x408248[_0x5be7e0]){_0x193a27=_0x408248[_0x5be7e0][_0xbb10('0xa')](':');if(_0x193a27!=-0x1){_0x916a32=_0x408248[_0x5be7e0]['slice'](0x0,_0x193a27)[_0xbb10('0xd')]();_0x285009=_0x408248[_0x5be7e0][_0xbb10('0xe')](_0x193a27+0x1)[_0xbb10('0xd')]();if(_0x916a32[_0xbb10('0xf')]>0x0){_0x44fb19[_0x916a32]=_0x285009;}}else{}_0x5be7e0++;}this[_0xbb10('0x10')](_0xbb10('0x11'),_0x44fb19);this[_0xbb10('0x3')]=!![];}_0x21370f++;}this[_0xbb10('0x8')]=_0x1c3ee5;}else{while((_0x513741=_0x1c3ee5[_0xbb10('0xa')](_0x328583))!=-0x1){_0x2353ef=_0x1c3ee5[_0xbb10('0xb')](0x0,_0x513741);this['emit'](_0xbb10('0x12'),_0x2353ef);_0x1c3ee5=_0x1c3ee5[_0xbb10('0xb')](_0x513741+_0x328583[_0xbb10('0xf')]);}this[_0xbb10('0x8')]=_0x1c3ee5;}_0x481979();};module[_0xbb10('0x13')]=AGIReply; \ No newline at end of file +var _0x7a54=['substring','length','split','indexOf','slice','trim','emit','util','stream','Transform','call','_localBuffer','inherits','prototype','_transform','toString','_inBody'];(function(_0x566620,_0x46730f){var _0x1d1420=function(_0x1d75fa){while(--_0x1d75fa){_0x566620['push'](_0x566620['shift']());}};_0x1d1420(++_0x46730f);}(_0x7a54,0x106));var _0x47a5=function(_0x2a3b64,_0x755557){_0x2a3b64=_0x2a3b64-0x0;var _0x15e7e0=_0x7a54[_0x2a3b64];return _0x15e7e0;};'use strict';var util=require(_0x47a5('0x0'));var Transform=require(_0x47a5('0x1'))[_0x47a5('0x2')];function AGIReply(_0x58157c){Transform[_0x47a5('0x3')](this,_0x58157c);this[_0x47a5('0x4')]='';this['_inBody']=![];}util[_0x47a5('0x5')](AGIReply,Transform);AGIReply[_0x47a5('0x6')][_0x47a5('0x7')]=function(_0x3717e1,_0xfdf934,_0x545a97){var _0x3d5629='\x0a',_0x59199c=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x343372=-0x1,_0x30e405=-0x1,_0x506eda='',_0x194fb0=0x0,_0x5077f3='',_0x5d90b3='';this[_0x47a5('0x4')]+=_0x3717e1[_0x47a5('0x8')]();_0x5077f3=this['_localBuffer'];if(!this[_0x47a5('0x9')]){_0x194fb0=0x0;while(_0x59199c[_0x194fb0]){while((_0x30e405=_0x5077f3['indexOf'](_0x59199c[_0x194fb0]))!=-0x1){_0x506eda=_0x59199c[_0x194fb0];_0x5d90b3=_0x5077f3['substring'](0x0,_0x30e405);_0x5077f3=_0x5077f3[_0x47a5('0xa')](_0x30e405+_0x506eda[_0x47a5('0xb')]);var _0x2f399b=_0x5d90b3[_0x47a5('0xc')](_0x3d5629),_0x250fad=0x0,_0xd612dd={},_0xd308b8='',_0x1eae59='',_0x5beb89=-0x1;while(_0x2f399b[_0x250fad]){_0x5beb89=_0x2f399b[_0x250fad][_0x47a5('0xd')](':');if(_0x5beb89!=-0x1){_0xd308b8=_0x2f399b[_0x250fad][_0x47a5('0xe')](0x0,_0x5beb89)[_0x47a5('0xf')]();_0x1eae59=_0x2f399b[_0x250fad][_0x47a5('0xe')](_0x5beb89+0x1)[_0x47a5('0xf')]();if(_0xd308b8[_0x47a5('0xb')]>0x0){_0xd612dd[_0xd308b8]=_0x1eae59;}}else{}_0x250fad++;}this[_0x47a5('0x10')]('headers',_0xd612dd);this[_0x47a5('0x9')]=!![];}_0x194fb0++;}this[_0x47a5('0x4')]=_0x5077f3;}else{while((_0x343372=_0x5077f3[_0x47a5('0xd')](_0x3d5629))!=-0x1){_0x5d90b3=_0x5077f3[_0x47a5('0xa')](0x0,_0x343372);this[_0x47a5('0x10')]('line',_0x5d90b3);_0x5077f3=_0x5077f3['substring'](_0x343372+_0x3d5629[_0x47a5('0xb')]);}this['_localBuffer']=_0x5077f3;}_0x545a97();};module['exports']=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 7567d9c..7c75912 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 _0xefc9=['ShowUser','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','Intervals','getSmsAccountById','ShowSmsAccount','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','phone','CreateCmContact','getPauseById','ShowPause','agentLogin','agentUnpause','UnpauseUser','agentLogout','moment','util','jayson/promise','client','http','request','then','error','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','email','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','dsn'];(function(_0x3508b6,_0xb0cff3){var _0x2bc9de=function(_0x21a1ee){while(--_0x21a1ee){_0x3508b6['push'](_0x3508b6['shift']());}};_0x2bc9de(++_0xb0cff3);}(_0xefc9,0x1bf));var _0x9efc=function(_0x42e370,_0x5c2216){_0x42e370=_0x42e370-0x0;var _0x2891ff=_0xefc9[_0x42e370];return _0x2891ff;};'use strict';var BPromise=require('bluebird');var moment=require(_0x9efc('0x0'));var _=require('lodash');var util=require(_0x9efc('0x1'));var jayson=require(_0x9efc('0x2'));var client=jayson[_0x9efc('0x3')][_0x9efc('0x4')]({'port':0x2329});function request(_0x5a0ea3,_0x3237ab){return new BPromise(function(_0x22f13e,_0x1f0b0e){return client[_0x9efc('0x5')](_0x5a0ea3,_0x3237ab)[_0x9efc('0x6')](function(_0x3b02ad){if(_0x3b02ad[_0x9efc('0x7')]){return _0x1f0b0e(_0x3b02ad[_0x9efc('0x7')]['message']);}else{return _0x22f13e(_0x3b02ad['result']);}})['catch'](function(_0x50430a){return _0x1f0b0e(_0x50430a);});});}exports['getSquareProject']=function(_0x1f7e0a){return request(_0x9efc('0x8'),{'options':{'raw':![],'where':{'name':_0x1f7e0a},'attributes':[_0x9efc('0x9')]}});};exports[_0x9efc('0xa')]=function(_0x5b4ca7){return request(_0x9efc('0xb'),{'options':{'raw':![],'where':{'id':_0x5b4ca7},'include':[{'model':_0x9efc('0xc'),'as':_0x9efc('0xd')}],'attributes':['id',_0x9efc('0xe'),_0x9efc('0xf')]}});};exports['getSquareProjectById']=function(_0x4569c4){return request(_0x9efc('0x8'),{'options':{'where':{'id':_0x4569c4},'attributes':[_0x9efc('0xe')]}});};exports['getVoiceQueueById']=function(_0x154e1c){return request(_0x9efc('0x10'),{'options':{'where':{'id':_0x154e1c},'attributes':[_0x9efc('0xe')]}});};exports[_0x9efc('0x11')]=function(_0x3402f0){return request(_0x9efc('0x12'),{'options':{'where':{'id':_0x3402f0},'attributes':['name']}});};exports[_0x9efc('0x13')]=function(_0x3b4c50){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x3b4c50},'attributes':[_0x9efc('0x14')]}});};exports['getUserById']=function(_0x318ae4){return request(_0x9efc('0x15'),{'options':{'where':{'id':_0x318ae4},'attributes':['name']}});};exports['getTrunkById']=function(_0x53b78e){return request(_0x9efc('0x16'),{'options':{'where':{'id':_0x53b78e},'attributes':[_0x9efc('0xe')]}});};exports[_0x9efc('0x17')]=function(_0x3667c9){return request(_0x9efc('0x18'),{'options':{'where':{'id':_0x3667c9},'attributes':[_0x9efc('0x19')]}});};exports[_0x9efc('0x1a')]=function(_0xd33ea9){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0xd33ea9},'include':[{'model':'Interval','as':_0x9efc('0x1b')}]}});};exports[_0x9efc('0x1c')]=function(_0x2e3d2c){return request(_0x9efc('0x1d'),{'options':{'where':{'id':_0x2e3d2c},'attributes':['id','name']}});};exports['createSmsMessage']=function(_0x2ec80c){return request(_0x9efc('0x1e'),{'body':_0x2ec80c});};exports[_0x9efc('0x1f')]=function(_0x3d9a8f){return request(_0x9efc('0x20'),{'body':_0x3d9a8f});};exports[_0x9efc('0x21')]=function(_0x466fef){return request('CreateSquareReport',{'body':_[_0x9efc('0x22')](_0x466fef,{'project_name':_0x466fef[_0x9efc('0x23')],'prev_project_name':_0x466fef[_0x9efc('0x24')]||'','is_subproject':_0x466fef[_0x9efc('0x24')]?!![]:![],'leaveAt':moment()[_0x9efc('0x25')](_0x9efc('0x26'))})});};exports[_0x9efc('0x27')]=function(_0x562ef8){return request(_0x9efc('0x28'),{'body':_0x562ef8});};exports[_0x9efc('0x29')]=function(_0x1cc5e7){return request(_0x9efc('0x2a'),{'body':_0x1cc5e7});};exports[_0x9efc('0x2b')]=function(_0x113196){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x113196[_0x9efc('0x2c')],'ListId':_0x113196['ListId']}}})[_0x9efc('0x6')](function(_0x47b851){if(_0x47b851){return _0x47b851;}return request(_0x9efc('0x2d'),{'body':_0x113196});});};exports[_0x9efc('0x2e')]=function(_0x107a19){return request(_0x9efc('0x2f'),{'options':{'where':{'id':_0x107a19},'attributes':['name']}});};exports[_0x9efc('0x30')]=function(_0x3b74d7,_0x57b743){return request('LoginUser',{'body':{'interface':_0x57b743},'options':{'where':_0x3b74d7}});};exports['agentPause']=function(_0x36c786,_0x18ea94,_0x3c4279){return request('PauseUser',{'body':{'type':_0x18ea94,'uniqueid':_0x3c4279},'options':{'where':_0x36c786}});};exports[_0x9efc('0x31')]=function(_0x3d3dca){return request(_0x9efc('0x32'),{'body':{},'options':{'where':_0x3d3dca}});};exports[_0x9efc('0x33')]=function(_0x28b7b1){return request('LogoutUser',{'body':{},'options':{'where':_0x28b7b1}});}; \ No newline at end of file +var _0xec58=['save_name','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','createSquareReport','merge','arg_1','format','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createSquareMessage','CreateSquareMessage','ShowCmHopper','phone','ListId','LoginUser','PauseUser','agentLogout','LogoutUser','bluebird','jayson/promise','client','http','request','then','error','message','result','catch','getSquareProject','ShowSquareProject','production','ShowMailAccount','Smtp','name','email','getSquareProjectById','ShowVoiceQueue','getVariableById','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById','getSoundById','ShowSound'];(function(_0x250d50,_0x51a1ad){var _0x284ddd=function(_0xe58289){while(--_0xe58289){_0x250d50['push'](_0x250d50['shift']());}};_0x284ddd(++_0x51a1ad);}(_0xec58,0x11c));var _0x8ec5=function(_0x24563c,_0x49d7cd){_0x24563c=_0x24563c-0x0;var _0x14796e=_0xec58[_0x24563c];return _0x14796e;};'use strict';var BPromise=require(_0x8ec5('0x0'));var moment=require('moment');var _=require('lodash');var util=require('util');var jayson=require(_0x8ec5('0x1'));var client=jayson[_0x8ec5('0x2')][_0x8ec5('0x3')]({'port':0x2329});function request(_0x12c95e,_0x1281a7){return new BPromise(function(_0x2b628d,_0x52082e){return client[_0x8ec5('0x4')](_0x12c95e,_0x1281a7)[_0x8ec5('0x5')](function(_0x92d73e){if(_0x92d73e[_0x8ec5('0x6')]){return _0x52082e(_0x92d73e[_0x8ec5('0x6')][_0x8ec5('0x7')]);}else{return _0x2b628d(_0x92d73e[_0x8ec5('0x8')]);}})[_0x8ec5('0x9')](function(_0x375e5d){return _0x52082e(_0x375e5d);});});}exports[_0x8ec5('0xa')]=function(_0x20c976){return request(_0x8ec5('0xb'),{'options':{'raw':![],'where':{'name':_0x20c976},'attributes':[_0x8ec5('0xc')]}});};exports['getMailAccountById']=function(_0x5cdaed){return request(_0x8ec5('0xd'),{'options':{'raw':![],'where':{'id':_0x5cdaed},'include':[{'model':'MailServerOut','as':_0x8ec5('0xe')}],'attributes':['id',_0x8ec5('0xf'),_0x8ec5('0x10')]}});};exports[_0x8ec5('0x11')]=function(_0x5d9460){return request(_0x8ec5('0xb'),{'options':{'where':{'id':_0x5d9460},'attributes':[_0x8ec5('0xf')]}});};exports['getVoiceQueueById']=function(_0x1e6017){return request(_0x8ec5('0x12'),{'options':{'where':{'id':_0x1e6017},'attributes':[_0x8ec5('0xf')]}});};exports[_0x8ec5('0x13')]=function(_0x149eaa){return request('ShowVariable',{'options':{'where':{'id':_0x149eaa},'attributes':['name']}});};exports[_0x8ec5('0x14')]=function(_0x70cb95){return request(_0x8ec5('0x15'),{'options':{'where':{'id':_0x70cb95},'attributes':[_0x8ec5('0x16')]}});};exports[_0x8ec5('0x17')]=function(_0x199e1d){return request(_0x8ec5('0x18'),{'options':{'where':{'id':_0x199e1d},'attributes':[_0x8ec5('0xf')]}});};exports[_0x8ec5('0x19')]=function(_0x44f48b){return request('ShowTrunk',{'options':{'where':{'id':_0x44f48b},'attributes':[_0x8ec5('0xf')]}});};exports[_0x8ec5('0x1a')]=function(_0x10163a){return request(_0x8ec5('0x1b'),{'options':{'where':{'id':_0x10163a},'attributes':[_0x8ec5('0x1c')]}});};exports['getIntervalById']=function(_0x3fcab3){return request(_0x8ec5('0x1d'),{'options':{'raw':![],'where':{'id':_0x3fcab3},'include':[{'model':_0x8ec5('0x1e'),'as':_0x8ec5('0x1f')}]}});};exports[_0x8ec5('0x20')]=function(_0x308765){return request(_0x8ec5('0x21'),{'options':{'where':{'id':_0x308765},'attributes':['id','name']}});};exports[_0x8ec5('0x22')]=function(_0x1352c4){return request(_0x8ec5('0x23'),{'body':_0x1352c4});};exports[_0x8ec5('0x24')]=function(_0x5a970d){return request('CreateSquareDetailsReport',{'body':_0x5a970d});};exports[_0x8ec5('0x25')]=function(_0x31be1e){return request('CreateSquareReport',{'body':_[_0x8ec5('0x26')](_0x31be1e,{'project_name':_0x31be1e[_0x8ec5('0x27')],'prev_project_name':_0x31be1e['arg_2']||'','is_subproject':_0x31be1e['arg_2']?!![]:![],'leaveAt':moment()[_0x8ec5('0x28')](_0x8ec5('0x29'))})});};exports['createSquareRecording']=function(_0x1e1668){return request(_0x8ec5('0x2a'),{'body':_0x1e1668});};exports[_0x8ec5('0x2b')]=function(_0x2a2be7){return request(_0x8ec5('0x2c'),{'body':_0x2a2be7});};exports['createCmContact']=function(_0x44bdc4){return request(_0x8ec5('0x2d'),{'options':{'raw':![],'where':{'phone':_0x44bdc4[_0x8ec5('0x2e')],'ListId':_0x44bdc4[_0x8ec5('0x2f')]}}})[_0x8ec5('0x5')](function(_0x293b48){if(_0x293b48){return _0x293b48;}return request('CreateCmContact',{'body':_0x44bdc4});});};exports['getPauseById']=function(_0xd86fda){return request('ShowPause',{'options':{'where':{'id':_0xd86fda},'attributes':[_0x8ec5('0xf')]}});};exports['agentLogin']=function(_0x4ec217,_0x2a0d80){return request(_0x8ec5('0x30'),{'body':{'interface':_0x2a0d80},'options':{'where':_0x4ec217}});};exports['agentPause']=function(_0x1830e3,_0x2971c2,_0x587216){return request(_0x8ec5('0x31'),{'body':{'type':_0x2971c2,'uniqueid':_0x587216},'options':{'where':_0x1830e3}});};exports['agentUnpause']=function(_0xce7002){return request('UnpauseUser',{'body':{},'options':{'where':_0xce7002}});};exports[_0x8ec5('0x32')]=function(_0xe15e85){return request(_0x8ec5('0x33'),{'body':{},'options':{'where':_0xe15e85}});}; \ 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 7638ee4..7c94643 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 _0xccd1=['./lex','exports','./polly'];(function(_0x382345,_0xdf03d9){var _0x286bed=function(_0x4d894c){while(--_0x4d894c){_0x382345['push'](_0x382345['shift']());}};_0x286bed(++_0xdf03d9);}(_0xccd1,0xa1));var _0x1ccd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xccd1[_0x3dd15e];return _0x231fd0;};var polly=require(_0x1ccd('0x0'));var lex=require(_0x1ccd('0x1'));module[_0x1ccd('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x09ce=['exports','./polly'];(function(_0x388b42,_0x180041){var _0x5198f1=function(_0x3b8d25){while(--_0x3b8d25){_0x388b42['push'](_0x388b42['shift']());}};_0x5198f1(++_0x180041);}(_0x09ce,0x195));var _0xe09c=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x09ce[_0x122ef9];return _0x42fba0;};var polly=require(_0xe09c('0x0'));var lex=require('./lex');module[_0xe09c('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 9f6e414..9e6635c 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 _0xb07f=['exports','./lib/api'];(function(_0x50e0e2,_0x270d21){var _0x1bf6b8=function(_0x4b4063){while(--_0x4b4063){_0x50e0e2['push'](_0x50e0e2['shift']());}};_0x1bf6b8(++_0x270d21);}(_0xb07f,0x109));var _0xfb07=function(_0x126596,_0x56b2a9){_0x126596=_0x126596-0x0;var _0x21f435=_0xb07f[_0x126596];return _0x21f435;};'use strict';var lex=require(_0xfb07('0x0'));module[_0xfb07('0x1')]=function(_0x3088a0,_0xdf10d4,_0x2e561d,_0xc9317c,_0x3a262e,_0x25212c){return lex(_0x3088a0,_0xdf10d4,_0x2e561d,_0xc9317c,_0x3a262e,_0x25212c);}; \ No newline at end of file +var _0x8664=['./lib/api','exports'];(function(_0x3f3711,_0x57a639){var _0x785434=function(_0x1419c9){while(--_0x1419c9){_0x3f3711['push'](_0x3f3711['shift']());}};_0x785434(++_0x57a639);}(_0x8664,0x11a));var _0x4866=function(_0x18bd6a,_0x2de225){_0x18bd6a=_0x18bd6a-0x0;var _0x57f11b=_0x8664[_0x18bd6a];return _0x57f11b;};'use strict';var lex=require(_0x4866('0x0'));module[_0x4866('0x1')]=function(_0x45783e,_0x46a5b0,_0x93a8d7,_0x65c74c,_0x4b1b4b,_0x1187ed){return lex(_0x45783e,_0x46a5b0,_0x93a8d7,_0x65c74c,_0x4b1b4b,_0x1187ed);}; \ 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 fc705bf..947eb63 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 _0x7125=['LexRuntime','$LATEST','bluebird','slots','hasOwnProperty','slot_','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7125,0x144));var _0x5712=function(_0x3aabb9,_0x37a84d){_0x3aabb9=_0x3aabb9-0x0;var _0x461a41=_0x7125[_0x3aabb9];return _0x461a41;};'use strict';var BPromise=require(_0x5712('0x0'));var AWS=require('aws-sdk');function lexResult(_0x4caa85,_0x5c965b){return new BPromise(function(_0x2fdcde,_0x10ed0c){_0x4caa85['postText'](_0x5c965b,function(_0x15daa2,_0x2f3cee){if(_0x15daa2){_0x10ed0c(_0x15daa2);}if(_0x2f3cee[_0x5712('0x1')]){for(const _0x2f5822 in _0x2f3cee[_0x5712('0x1')]){if(_0x2f3cee['slots'][_0x5712('0x2')](_0x2f5822)){var _0x2beef3=_0x2f3cee[_0x5712('0x1')][_0x2f5822];_0x2f3cee[_0x5712('0x3')+_0x2f5822]=_0x2beef3;}}}_0x2fdcde(_0x2f3cee);});});}module[_0x5712('0x4')]=function(_0x52dcd4,_0x1702e0,_0x19c3c9,_0x22c838,_0x26f424,_0x13ef6e){var _0x3c99fe=new AWS[(_0x5712('0x5'))]({'accessKeyId':_0x1702e0,'secretAccessKey':_0x19c3c9,'region':_0x22c838});var _0x1fc347={'botAlias':_0x5712('0x6'),'botName':_0x13ef6e,'inputText':_0x26f424,'userId':_0x52dcd4};return lexResult(_0x3c99fe,_0x1fc347);}; \ No newline at end of file +var _0x5596=['slot_','exports','bluebird','aws-sdk','postText','slots'];(function(_0x24753d,_0x36c8e8){var _0x900a08=function(_0x494f5d){while(--_0x494f5d){_0x24753d['push'](_0x24753d['shift']());}};_0x900a08(++_0x36c8e8);}(_0x5596,0xec));var _0x6559=function(_0x899af5,_0x3c9934){_0x899af5=_0x899af5-0x0;var _0x469918=_0x5596[_0x899af5];return _0x469918;};'use strict';var BPromise=require(_0x6559('0x0'));var AWS=require(_0x6559('0x1'));function lexResult(_0x342afa,_0x528387){return new BPromise(function(_0x25c7dd,_0x3b2011){_0x342afa[_0x6559('0x2')](_0x528387,function(_0x4c7f29,_0x27018b){if(_0x4c7f29){_0x3b2011(_0x4c7f29);}if(_0x27018b[_0x6559('0x3')]){for(const _0x689115 in _0x27018b[_0x6559('0x3')]){if(_0x27018b[_0x6559('0x3')]['hasOwnProperty'](_0x689115)){var _0x58a9aa=_0x27018b['slots'][_0x689115];_0x27018b[_0x6559('0x4')+_0x689115]=_0x58a9aa;}}}_0x25c7dd(_0x27018b);});});}module[_0x6559('0x5')]=function(_0x2e2154,_0xac4678,_0x9e1e01,_0x1157cd,_0x1c3895,_0x9c2043){var _0x39d4df=new AWS['LexRuntime']({'accessKeyId':_0xac4678,'secretAccessKey':_0x9e1e01,'region':_0x1157cd});var _0xfad9fc={'botAlias':'$LATEST','botName':_0x9c2043,'inputText':_0x1c3895,'userId':_0x2e2154};return lexResult(_0x39d4df,_0xfad9fc);}; \ 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 a3859e1..4f594de 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 _0xfcb8=['exports','./lib/api'];(function(_0x868bf8,_0x290a75){var _0x57b04b=function(_0x34cd34){while(--_0x34cd34){_0x868bf8['push'](_0x868bf8['shift']());}};_0x57b04b(++_0x290a75);}(_0xfcb8,0x1db));var _0x8fcb=function(_0x54e6f5,_0x4f4e99){_0x54e6f5=_0x54e6f5-0x0;var _0x5e8794=_0xfcb8[_0x54e6f5];return _0x5e8794;};'use strict';var polly=require(_0x8fcb('0x0'));module[_0x8fcb('0x1')]=function(_0x18d4d3,_0x44e874,_0x2f4bb6,_0x202ee7,_0x160476,_0x137180,_0x5ec772){return polly(_0x18d4d3,_0x44e874,_0x2f4bb6,_0x202ee7,_0x160476,_0x137180,_0x5ec772);}; \ No newline at end of file +var _0x59ba=['exports'];(function(_0x47e59b,_0x598969){var _0x4cf443=function(_0x1ede61){while(--_0x1ede61){_0x47e59b['push'](_0x47e59b['shift']());}};_0x4cf443(++_0x598969);}(_0x59ba,0x1ab));var _0xa59b=function(_0x2dac37,_0x468436){_0x2dac37=_0x2dac37-0x0;var _0x4af2f1=_0x59ba[_0x2dac37];return _0x4af2f1;};'use strict';var polly=require('./lib/api');module[_0xa59b('0x0')]=function(_0x5b8b01,_0x59290a,_0x951c5,_0x126273,_0x2e9000,_0x37b2dd,_0x5ec250){return polly(_0x5b8b01,_0x59290a,_0x951c5,_0x126273,_0x2e9000,_0x37b2dd,_0x5ec250);}; \ 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 6ef12fa..91a55be 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 _0x7f46=['Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','path','bluebird','aws-sdk','synthesizeSpeech','AudioStream'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7f46,0x153));var _0x67f4=function(_0x46e6e3,_0x5e1396){_0x46e6e3=_0x46e6e3-0x0;var _0x4b0c5a=_0x7f46[_0x46e6e3];return _0x4b0c5a;};'use strict';var fs=require('fs');var path=require(_0x67f4('0x0'));var BPromise=require(_0x67f4('0x1'));var rs=require('randomstring');var AWS=require(_0x67f4('0x2'));function pollyResult(_0x4ee787,_0x2f03d5,_0x162db5){return new BPromise(function(_0x1c6c1a,_0x13d4be){_0x4ee787[_0x67f4('0x3')](_0x2f03d5,function(_0x3c2ce6,_0xafb805){if(_0x3c2ce6){_0x13d4be(_0x3c2ce6);}else if(_0xafb805){if(_0xafb805[_0x67f4('0x4')]instanceof Buffer){fs['writeFile'](_0x162db5,_0xafb805['AudioStream'],function(_0x457906){if(_0x457906){_0x13d4be(_0x457906);}else{_0x1c6c1a();}});}else{_0x13d4be(new Error(_0x67f4('0x5')));}}else{_0x13d4be(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x67f4('0x6')]=function(_0x10a7db,_0x40ca57,_0x3c4dca,_0x183b66,_0x555a2e,_0x27cfff,_0x534f56){var _0x2ffd0f=new AWS[(_0x67f4('0x7'))]({'accessKeyId':_0x10a7db,'secretAccessKey':_0x40ca57,'region':_0x3c4dca});var _0x1d4828={'Text':_0x555a2e,'TextType':_0x27cfff||'text','OutputFormat':'mp3','VoiceId':_0x183b66};return pollyResult(_0x2ffd0f,_0x1d4828,_0x534f56);}; \ No newline at end of file +var _0xfc3e=['AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','Polly','path','bluebird','randomstring','aws-sdk','synthesizeSpeech','writeFile'];(function(_0x26d26f,_0x302cce){var _0x5c8c0e=function(_0x519b9d){while(--_0x519b9d){_0x26d26f['push'](_0x26d26f['shift']());}};_0x5c8c0e(++_0x302cce);}(_0xfc3e,0xae));var _0xefc3=function(_0x437458,_0x47e7b3){_0x437458=_0x437458-0x0;var _0x33e219=_0xfc3e[_0x437458];return _0x33e219;};'use strict';var fs=require('fs');var path=require(_0xefc3('0x0'));var BPromise=require(_0xefc3('0x1'));var rs=require(_0xefc3('0x2'));var AWS=require(_0xefc3('0x3'));function pollyResult(_0x149bfb,_0x16f09a,_0x590a21){return new BPromise(function(_0x452b15,_0xeccaa2){_0x149bfb[_0xefc3('0x4')](_0x16f09a,function(_0x46c49e,_0x11cc02){if(_0x46c49e){_0xeccaa2(_0x46c49e);}else if(_0x11cc02){if(_0x11cc02['AudioStream']instanceof Buffer){fs[_0xefc3('0x5')](_0x590a21,_0x11cc02[_0xefc3('0x6')],function(_0x3f17e2){if(_0x3f17e2){_0xeccaa2(_0x3f17e2);}else{_0x452b15();}});}else{_0xeccaa2(new Error(_0xefc3('0x7')));}}else{_0xeccaa2(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module['exports']=function(_0x676bc4,_0x54a6a5,_0x4fb0eb,_0x1baa42,_0x4511c8,_0x44347e,_0x498e14){var _0x4a7432=new AWS[(_0xefc3('0x8'))]({'accessKeyId':_0x676bc4,'secretAccessKey':_0x54a6a5,'region':_0x4fb0eb});var _0x1a22a6={'Text':_0x4511c8,'TextType':_0x44347e||'text','OutputFormat':'mp3','VoiceId':_0x1baa42};return pollyResult(_0x4a7432,_0x1a22a6,_0x498e14);}; \ 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 4918d86..8e6fde3 100644 --- a/server/services/agi/scripts/google/asr/index.js +++ b/server/services/agi/scripts/google/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5b1c=['./lib/api'];(function(_0x2061c9,_0x183a2d){var _0x514f8b=function(_0x16fe30){while(--_0x16fe30){_0x2061c9['push'](_0x2061c9['shift']());}};_0x514f8b(++_0x183a2d);}(_0x5b1c,0x1b9));var _0xc5b1=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5b1c[_0x2641f9];return _0x585741;};'use strict';var asr=require(_0xc5b1('0x0'));module['exports']=function(_0x1b13b6,_0x1d69ae,_0x220d16,_0x14b59f){return asr(_0x1b13b6,_0x1d69ae,_0x220d16);}; \ No newline at end of file +var _0xcac2=['./lib/api','exports'];(function(_0x5afb7f,_0x7c1c4e){var _0xd02bbd=function(_0x5b50aa){while(--_0x5b50aa){_0x5afb7f['push'](_0x5afb7f['shift']());}};_0xd02bbd(++_0x7c1c4e);}(_0xcac2,0x1e8));var _0x2cac=function(_0x17de24,_0x3c6c3c){_0x17de24=_0x17de24-0x0;var _0x4a7763=_0xcac2[_0x17de24];return _0x4a7763;};'use strict';var asr=require(_0x2cac('0x0'));module[_0x2cac('0x1')]=function(_0x26e82c,_0x50026e,_0x2a9507,_0x305cc8){return asr(_0x26e82c,_0x50026e,_0x2a9507);}; \ 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 de0a3fa..8243bb2 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 _0xb3f7=['POST','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','exports','length','filepath\x20should\x20be\x20a\x20string','string','undefined','readFileSync','toString'];(function(_0x23bd0e,_0x2bc913){var _0x5ea03c=function(_0x30edb0){while(--_0x30edb0){_0x23bd0e['push'](_0x23bd0e['shift']());}};_0x5ea03c(++_0x2bc913);}(_0xb3f7,0x82));var _0x7b3f=function(_0x52236e,_0x5264ae){_0x52236e=_0x52236e-0x0;var _0x299548=_0xb3f7[_0x52236e];return _0x299548;};'use strict';var url=require(_0x7b3f('0x0'));var BPromise=require(_0x7b3f('0x1'));var fs=require('fs');var host=_0x7b3f('0x2');module[_0x7b3f('0x3')]=function(_0x28c5ac,_0x13af2b,_0x122d1a){return new BPromise(function(_0x1ae37c,_0x1a3813){var _0x368ec6;if(typeof _0x28c5ac!=='string'||_0x28c5ac[_0x7b3f('0x4')]===0x0){return _0x1a3813(_0x7b3f('0x5'));}if(typeof _0x13af2b!==_0x7b3f('0x6')||_0x13af2b[_0x7b3f('0x4')]===0x0){return _0x1a3813('key\x20should\x20be\x20a\x20string');}if(typeof _0x122d1a!==_0x7b3f('0x7')&&(typeof _0x122d1a!=='string'||_0x122d1a[_0x7b3f('0x4')]===0x0)){return _0x1a3813('lang\x20should\x20be\x20a\x20string');}try{_0x368ec6=fs[_0x7b3f('0x8')](_0x28c5ac)[_0x7b3f('0x9')]('base64');}catch(_0x572d26){return _0x1a3813(_0x572d26);}return _0x1ae37c({'method':_0x7b3f('0xa'),'uri':host+_0x7b3f('0xb')+_0x13af2b,'body':{'config':{'encoding':_0x7b3f('0xc'),'sampleRateHertz':_0x7b3f('0xd'),'languageCode':_0x122d1a},'audio':{'content':_0x368ec6}},'json':!![]});});}; \ No newline at end of file +var _0xef1e=['exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','8000','url','bluebird','https://speech.googleapis.com'];(function(_0x3cbe1c,_0x4bcabd){var _0x5ee08b=function(_0x5c53e6){while(--_0x5c53e6){_0x3cbe1c['push'](_0x3cbe1c['shift']());}};_0x5ee08b(++_0x4bcabd);}(_0xef1e,0x93));var _0xeef1=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xef1e[_0xa464c9];return _0x3d73c4;};'use strict';var url=require(_0xeef1('0x0'));var BPromise=require(_0xeef1('0x1'));var fs=require('fs');var host=_0xeef1('0x2');module[_0xeef1('0x3')]=function(_0x5d0420,_0x4c80d9,_0x3a9c6d){return new BPromise(function(_0x28db09,_0x3476d4){var _0xeefad9;if(typeof _0x5d0420!==_0xeef1('0x4')||_0x5d0420[_0xeef1('0x5')]===0x0){return _0x3476d4(_0xeef1('0x6'));}if(typeof _0x4c80d9!==_0xeef1('0x4')||_0x4c80d9[_0xeef1('0x5')]===0x0){return _0x3476d4(_0xeef1('0x7'));}if(typeof _0x3a9c6d!=='undefined'&&(typeof _0x3a9c6d!==_0xeef1('0x4')||_0x3a9c6d[_0xeef1('0x5')]===0x0)){return _0x3476d4(_0xeef1('0x8'));}try{_0xeefad9=fs[_0xeef1('0x9')](_0x5d0420)[_0xeef1('0xa')](_0xeef1('0xb'));}catch(_0x4431fa){return _0x3476d4(_0x4431fa);}return _0x28db09({'method':_0xeef1('0xc'),'uri':host+_0xeef1('0xd')+_0x4c80d9,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0xeef1('0xe'),'languageCode':_0x3a9c6d},'audio':{'content':_0xeefad9}},'json':!![]});});}; \ No newline at end of file diff --git a/server/services/agi/scripts/google/index.js b/server/services/agi/scripts/google/index.js index 32a37bd..6047a5c 100644 --- a/server/services/agi/scripts/google/index.js +++ b/server/services/agi/scripts/google/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['./asr'];(function(_0x556686,_0x52b24f){var _0x12f604=function(_0x51a803){while(--_0x51a803){_0x556686['push'](_0x556686['shift']());}};_0x12f604(++_0x52b24f);}(_0x3e74,0x175));var _0x43e7=function(_0x28370b,_0x5d5c1c){_0x28370b=_0x28370b-0x0;var _0x4d382e=_0x3e74[_0x28370b];return _0x4d382e;};var asr=require(_0x43e7('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0x70e0=['exports','./asr'];(function(_0x2002b3,_0x11e91c){var _0x2756f0=function(_0x4bf0b3){while(--_0x4bf0b3){_0x2002b3['push'](_0x2002b3['shift']());}};_0x2756f0(++_0x11e91c);}(_0x70e0,0x17b));var _0x070e=function(_0x1c96b0,_0x3e82cb){_0x1c96b0=_0x1c96b0-0x0;var _0x30b663=_0x70e0[_0x1c96b0];return _0x30b663;};var asr=require(_0x070e('0x0'));module[_0x070e('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index 3a47dec..14b2f5e 100644 --- a/server/services/agi/scripts/index.js +++ b/server/services/agi/scripts/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['text','channelData','CustomAction','AudioFromTts','Data','dirName','path','http','https','bluebird','sox','request-promise','util','querystring','moment','apiai-promise','md5','./google','./sestek','https://api.ispeech.org/api/rest','host','WHAT_EVER','get','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','info','finish\x20download\x20file','error','unlink','download\x20error','pipe','end','protocol','https:','data','transcode','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','base64','then','chmodSync','777','split','readFileSync','googleTTS','.mp3','goggleTTS\x20path','googleASR','asr','uri','results','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','stringify','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','code','metadata','endConversation','isFallbackIntent','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','awsLex','lex','format','freeform=3','parse','sestekNDA','nda'];(function(_0xdc1818,_0x2df46f){var _0x32db07=function(_0x21e903){while(--_0x21e903){_0xdc1818['push'](_0xdc1818['shift']());}};_0x32db07(++_0x2df46f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'use strict';var fs=require('fs');var path=require(_0x0a9e('0x0'));var http=require(_0x0a9e('0x1'));var https=require(_0x0a9e('0x2'));var urlParse=require('url')['parse'];var BPromise=require(_0x0a9e('0x3'));var rs=require('randomstring');var sox=require(_0x0a9e('0x4'));var rp=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var querystring=require(_0x0a9e('0x7'));var moment=require(_0x0a9e('0x8'));var tts=require('google-tts-api');var apiai=require(_0x0a9e('0x9'));var md5=require(_0x0a9e('0xa'));var google=require(_0x0a9e('0xb'));var aws=require('./aws');var tilde=require('./tilde');var sestek=require(_0x0a9e('0xc'));var logger=require('../../../config/logger')('agi');var ISPEECH_API=_0x0a9e('0xd');function downloadFile(_0xf81284,_0x307b3e){return new BPromise(function(_0x3ab53f,_0xfeb75b){var _0xbd1168=urlParse(_0xf81284);var _0x4a4c56=_0xbd1168['protocol']==='https:'?https:http;var _0x4cfe67={'host':_0xbd1168[_0x0a9e('0xe')],'path':_0xbd1168[_0x0a9e('0x0')],'headers':{'user-agent':_0x0a9e('0xf')}};_0x4a4c56[_0x0a9e('0x10')](_0x4cfe67,function(_0x32d742){if(_0x32d742[_0x0a9e('0x11')]!==0xc8){logger['error'](_0x0a9e('0x12')+_0xf81284+_0x0a9e('0x13')+_0x32d742[_0x0a9e('0x11')]+'\x20('+_0x32d742[_0x0a9e('0x14')]+')');_0xfeb75b(new Error(_0x0a9e('0x12')+_0xf81284+_0x0a9e('0x13')+_0x32d742['statusCode']+'\x20('+_0x32d742[_0x0a9e('0x14')]+')'));return;}var _0x5d0880=fs[_0x0a9e('0x15')](_0x307b3e);_0x5d0880['on']('finish',function(){logger[_0x0a9e('0x16')](_0x0a9e('0x17'));_0x5d0880['close'](_0x3ab53f);});_0x5d0880['on'](_0x0a9e('0x18'),function(_0x5a0a06){fs[_0x0a9e('0x19')](_0x307b3e);logger[_0x0a9e('0x18')](_0x0a9e('0x1a'),_0x5a0a06);_0xfeb75b(_0x5a0a06);});_0x32d742[_0x0a9e('0x1b')](_0x5d0880);})['on'](_0x0a9e('0x18'),function(_0x2eb11f){logger[_0x0a9e('0x18')](_0x2eb11f);_0xfeb75b(_0x2eb11f);})[_0x0a9e('0x1c')]();});}function uploadFile(_0x1314ae){return new BPromise(function(_0x112016,_0x1c696a){var _0x105080=urlParse(_0x1314ae);var _0x4bb1e3=_0x105080[_0x0a9e('0x1d')]===_0x0a9e('0x1e')?https:http;var _0x53682f={'host':_0x105080[_0x0a9e('0xe')],'path':_0x105080['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x4bb1e3[_0x0a9e('0x10')](_0x53682f,function(_0x432e56){if(_0x432e56[_0x0a9e('0x11')]!==0xc8){_0x1c696a(new Error(_0x0a9e('0x12')+_0x1314ae+'\x20failed,\x20status\x20code\x20=\x20'+_0x432e56[_0x0a9e('0x11')]+'\x20('+_0x432e56[_0x0a9e('0x14')]+')'));return;}var _0x3b45bc='';_0x432e56['on'](_0x0a9e('0x1f'),function(_0x370d86){_0x3b45bc+=_0x370d86;});_0x432e56['on'](_0x0a9e('0x1c'),function(){_0x112016(_0x3b45bc);});})['on'](_0x0a9e('0x18'),function(_0x5ea472){_0x1c696a(_0x5ea472);})['end']();});}function convertFile(_0x197ec0,_0x3a8e58){return new BPromise(function(_0x40c424,_0x33161b){var _0x526cf3=sox[_0x0a9e('0x20')](_0x197ec0,_0x3a8e58,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x526cf3['on'](_0x0a9e('0x18'),function(_0x5bfb33){logger[_0x0a9e('0x18')](_0x0a9e('0x21'),_0x5bfb33);_0x33161b(_0x5bfb33);});_0x526cf3['on'](_0x0a9e('0x1c'),function(){logger[_0x0a9e('0x16')](_0x0a9e('0x22'));_0x40c424();});_0x526cf3[_0x0a9e('0x23')]();});}function base64Decode(_0x11c3b6,_0x14de77){var _0x5a101a=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));fs['writeFileSync'](_0x5a101a,_0x11c3b6,_0x0a9e('0x28'));return convertFile(_0x5a101a,_0x14de77)[_0x0a9e('0x29')](function(){try{fs[_0x0a9e('0x19')](_0x5a101a);fs[_0x0a9e('0x2a')](_0x14de77,_0x0a9e('0x2b'));}catch(_0x563b45){logger[_0x0a9e('0x18')](_0x563b45);}return _0x14de77[_0x0a9e('0x2c')]('.')[0x0];});}function base64Encode(_0x1dbde2){var _0x540530=fs[_0x0a9e('0x2d')](_0x1dbde2);return new Buffer(_0x540530)['toString'](_0x0a9e('0x28'));}exports[_0x0a9e('0x2e')]=function(_0x1122db,_0x33bdb7){var _0x25ce3a,_0x5180f1;return tts(_0x1122db,_0x33bdb7||'en',0x1)[_0x0a9e('0x29')](function(_0x46f0a5){logger[_0x0a9e('0x16')](_0x46f0a5);_0x25ce3a=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));return downloadFile(_0x46f0a5,_0x25ce3a);})[_0x0a9e('0x29')](function(){_0x5180f1=path['resolve'](__dirname,_0x0a9e('0x25'),rs['generate'](0x4)+_0x0a9e('0x27'));return convertFile(_0x25ce3a,_0x5180f1);})[_0x0a9e('0x29')](function(){try{fs[_0x0a9e('0x19')](_0x25ce3a);fs[_0x0a9e('0x2a')](_0x5180f1,'777');}catch(_0x191e91){logger[_0x0a9e('0x18')](_0x191e91);}logger[_0x0a9e('0x16')](_0x0a9e('0x30'),_0x5180f1['split']('.')[0x0]);return _0x5180f1['split']('.')[0x0];});};exports[_0x0a9e('0x31')]=function(_0x5640eb,_0x24936a,_0x3d9717){return google[_0x0a9e('0x32')](_0x5640eb,_0x24936a,_0x3d9717)[_0x0a9e('0x29')](function(_0x4f41ae){logger[_0x0a9e('0x16')](_0x4f41ae[_0x0a9e('0x33')]);return rp(_0x4f41ae);})[_0x0a9e('0x29')](function(_0x533942){var _0x1dbf74='';var _0x1a180b=0x0;try{fs[_0x0a9e('0x19')](_0x5640eb);}catch(_0x4c1c0e){logger['error'](_0x4c1c0e);}if(_0x533942&&_0x533942[_0x0a9e('0x34')]){_0x1dbf74=_0x533942[_0x0a9e('0x34')]['map'](function(_0x2b814e){return _0x2b814e&&_0x2b814e[_0x0a9e('0x35')][0x0]&&_0x2b814e[_0x0a9e('0x35')][0x0][_0x0a9e('0x36')]?_0x2b814e['alternatives'][0x0]['transcript']:'';})[_0x0a9e('0x37')]('\x0a');_0x1a180b=_0x533942[_0x0a9e('0x34')]['map'](function(_0x183991){return _0x183991&&_0x183991[_0x0a9e('0x35')][0x0]&&_0x183991[_0x0a9e('0x35')][0x0]['confidence']?_0x183991[_0x0a9e('0x35')][0x0][_0x0a9e('0x38')]:0x0;})[_0x0a9e('0x37')]('\x0a');}logger[_0x0a9e('0x16')](_0x0a9e('0x39'),_0x1dbf74);logger[_0x0a9e('0x16')](_0x0a9e('0x3a'),_0x1a180b);return{'transcript':_0x1dbf74,'confidence':_0x1a180b};})[_0x0a9e('0x3b')](function(_0x23b089){logger[_0x0a9e('0x18')](_0x0a9e('0x3c'),_0x23b089[_0x0a9e('0x11')],_0x23b089[_0x0a9e('0x3d')],_0x23b089[_0x0a9e('0x3e')]);});};exports[_0x0a9e('0x3f')]=function(_0x4d04c8,_0x52628e,_0x473fdc,_0xb3795a){var _0x405c8f=apiai(_0x52628e,{'language':_0xb3795a||'en'});return _0x405c8f[_0x0a9e('0x40')](_0x473fdc,{'sessionId':md5(_0x4d04c8)})[_0x0a9e('0x29')](function(_0xc9a702){logger[_0x0a9e('0x16')](JSON[_0x0a9e('0x41')](_0xc9a702));return{'source':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x43')],'resolvedQuery':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x44')],'action':_0xc9a702['result'][_0x0a9e('0x45')],'actionIncomplete':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x46')],'speech':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x47')][_0x0a9e('0x48')],'score':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x49')],'statusCode':_0xc9a702['status'][_0x0a9e('0x4a')],'endConversation':_0xc9a702['result'][_0x0a9e('0x4b')][_0x0a9e('0x4c')]||![],'isFallbackIntent':_0xc9a702[_0x0a9e('0x42')]['metadata'][_0x0a9e('0x4d')]};});};exports[_0x0a9e('0x4e')]=function(_0x4774f4,_0x34aa5a,_0x45c845,_0x37be73){return tilde[_0x0a9e('0x32')](_0x4774f4,_0x34aa5a,_0x45c845,_0x37be73)['then'](function(_0x13f44d){try{fs[_0x0a9e('0x19')](_0x4774f4);}catch(_0x1b5e80){logger[_0x0a9e('0x18')](_0x1b5e80);}logger[_0x0a9e('0x16')](_0x0a9e('0x4f'),_0x13f44d[_0x0a9e('0x36')]);logger[_0x0a9e('0x16')](_0x0a9e('0x50'),_0x13f44d['confidence']);return _0x13f44d;});};exports[_0x0a9e('0x51')]=function(_0x3fe430,_0x4f7240,_0x4ae14b,_0x5ddf84,_0x1adfee,_0x4317e3){var _0x37edaa=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));var _0x375c18;return aws['polly'](_0x3fe430,_0x4f7240,_0x4ae14b,_0x5ddf84,_0x1adfee,_0x4317e3,_0x37edaa)['then'](function(){_0x375c18=path['resolve'](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));return convertFile(_0x37edaa,_0x375c18);})['then'](function(){try{fs[_0x0a9e('0x19')](_0x37edaa);fs[_0x0a9e('0x2a')](_0x375c18,'777');}catch(_0x5a88da){logger[_0x0a9e('0x18')](_0x5a88da);}return _0x375c18['split']('.')[0x0];});};exports[_0x0a9e('0x52')]=function(_0x4c3845,_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return aws[_0x0a9e('0x53')](_0x4c3845,_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da)['then'](function(_0x50f687){logger[_0x0a9e('0x16')](JSON[_0x0a9e('0x41')](_0x50f687));return _0x50f687;});};exports['ispeechTTS']=function(_0x145931,_0x5ce9ac,_0x211ef9,_0x523cd2){var _0xe22ccc=util['format']('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x145931,encodeURIComponent(_0x5ce9ac),_0x211ef9,_0x523cd2);var _0x5df0ad=path[_0x0a9e('0x24')](__dirname,'tmp',rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));var _0x3cfd00;return downloadFile(_0xe22ccc,_0x5df0ad)[_0x0a9e('0x29')](function(){_0x3cfd00=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));return convertFile(_0x5df0ad,_0x3cfd00);})['then'](function(){try{fs[_0x0a9e('0x19')](_0x5df0ad);fs[_0x0a9e('0x2a')](_0x3cfd00,_0x0a9e('0x2b'));}catch(_0x30c491){logger[_0x0a9e('0x18')](_0x30c491);}return _0x3cfd00[_0x0a9e('0x2c')]('.')[0x0];});};exports['ispeechASR']=function(_0x956fbe,_0x26bc80,_0x5239ef,_0x3649cc){var _0x5cc8fb=util[_0x0a9e('0x54')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x26bc80,_0x5239ef,base64Encode(_0x956fbe),_0x3649cc?util['format']('model=%s',encodeURIComponent(_0x3649cc)):_0x0a9e('0x55'));return uploadFile(_0x5cc8fb)['then'](function(_0x2244d6){return querystring[_0x0a9e('0x56')](_0x2244d6);});};exports[_0x0a9e('0x57')]=function(_0x7be420,_0x1cca9f){return sestek[_0x0a9e('0x58')](_0x7be420,_0x1cca9f)['then'](function(_0x1627a7){logger['info'](JSON[_0x0a9e('0x41')](_0x1627a7));var _0x1f07cb={'speech':_0x1627a7[_0x0a9e('0x59')],'action':_0x1627a7['channelData']?_0x1627a7[_0x0a9e('0x5a')][_0x0a9e('0x5b')]:undefined,'actiondata':_0x1627a7[_0x0a9e('0x5a')]?_0x1627a7[_0x0a9e('0x5a')]['CustomActionData']:undefined};if(_0x1627a7[_0x0a9e('0x5a')]&&_0x1627a7[_0x0a9e('0x5a')]['AudioFromTts']){return base64Decode(_0x1627a7[_0x0a9e('0x5a')][_0x0a9e('0x5c')][_0x0a9e('0x5d')],path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs['generate'](0x4)+_0x0a9e('0x27')))[_0x0a9e('0x29')](function(_0x281c7d){_0x1f07cb['audiofile']=_0x281c7d;return _0x1f07cb;});}return _0x1f07cb;});};exports[_0x0a9e('0x5e')]=function(){return __dirname;}; \ No newline at end of file +var _0xa9e0=['text','channelData','CustomAction','AudioFromTts','Data','dirName','path','http','https','bluebird','sox','request-promise','util','querystring','moment','apiai-promise','md5','./google','./sestek','https://api.ispeech.org/api/rest','host','WHAT_EVER','get','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','info','finish\x20download\x20file','error','unlink','download\x20error','pipe','end','protocol','https:','data','transcode','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','base64','then','chmodSync','777','split','readFileSync','googleTTS','.mp3','goggleTTS\x20path','googleASR','asr','uri','results','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','stringify','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','code','metadata','endConversation','isFallbackIntent','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','awsLex','lex','format','freeform=3','parse','sestekNDA','nda'];(function(_0x5156aa,_0x2bd8b1){var _0x4bd2ad=function(_0x336557){while(--_0x336557){_0x5156aa['push'](_0x5156aa['shift']());}};_0x4bd2ad(++_0x2bd8b1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'use strict';var fs=require('fs');var path=require(_0x0a9e('0x0'));var http=require(_0x0a9e('0x1'));var https=require(_0x0a9e('0x2'));var urlParse=require('url')['parse'];var BPromise=require(_0x0a9e('0x3'));var rs=require('randomstring');var sox=require(_0x0a9e('0x4'));var rp=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var querystring=require(_0x0a9e('0x7'));var moment=require(_0x0a9e('0x8'));var tts=require('google-tts-api');var apiai=require(_0x0a9e('0x9'));var md5=require(_0x0a9e('0xa'));var google=require(_0x0a9e('0xb'));var aws=require('./aws');var tilde=require('./tilde');var sestek=require(_0x0a9e('0xc'));var logger=require('../../../config/logger')('agi');var ISPEECH_API=_0x0a9e('0xd');function downloadFile(_0xf81284,_0x307b3e){return new BPromise(function(_0x3ab53f,_0xfeb75b){var _0xbd1168=urlParse(_0xf81284);var _0x4a4c56=_0xbd1168['protocol']==='https:'?https:http;var _0x4cfe67={'host':_0xbd1168[_0x0a9e('0xe')],'path':_0xbd1168[_0x0a9e('0x0')],'headers':{'user-agent':_0x0a9e('0xf')}};_0x4a4c56[_0x0a9e('0x10')](_0x4cfe67,function(_0x32d742){if(_0x32d742[_0x0a9e('0x11')]!==0xc8){logger['error'](_0x0a9e('0x12')+_0xf81284+_0x0a9e('0x13')+_0x32d742[_0x0a9e('0x11')]+'\x20('+_0x32d742[_0x0a9e('0x14')]+')');_0xfeb75b(new Error(_0x0a9e('0x12')+_0xf81284+_0x0a9e('0x13')+_0x32d742['statusCode']+'\x20('+_0x32d742[_0x0a9e('0x14')]+')'));return;}var _0x5d0880=fs[_0x0a9e('0x15')](_0x307b3e);_0x5d0880['on']('finish',function(){logger[_0x0a9e('0x16')](_0x0a9e('0x17'));_0x5d0880['close'](_0x3ab53f);});_0x5d0880['on'](_0x0a9e('0x18'),function(_0x5a0a06){fs[_0x0a9e('0x19')](_0x307b3e);logger[_0x0a9e('0x18')](_0x0a9e('0x1a'),_0x5a0a06);_0xfeb75b(_0x5a0a06);});_0x32d742[_0x0a9e('0x1b')](_0x5d0880);})['on'](_0x0a9e('0x18'),function(_0x2eb11f){logger[_0x0a9e('0x18')](_0x2eb11f);_0xfeb75b(_0x2eb11f);})[_0x0a9e('0x1c')]();});}function uploadFile(_0x1314ae){return new BPromise(function(_0x112016,_0x1c696a){var _0x105080=urlParse(_0x1314ae);var _0x4bb1e3=_0x105080[_0x0a9e('0x1d')]===_0x0a9e('0x1e')?https:http;var _0x53682f={'host':_0x105080[_0x0a9e('0xe')],'path':_0x105080['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x4bb1e3[_0x0a9e('0x10')](_0x53682f,function(_0x432e56){if(_0x432e56[_0x0a9e('0x11')]!==0xc8){_0x1c696a(new Error(_0x0a9e('0x12')+_0x1314ae+'\x20failed,\x20status\x20code\x20=\x20'+_0x432e56[_0x0a9e('0x11')]+'\x20('+_0x432e56[_0x0a9e('0x14')]+')'));return;}var _0x3b45bc='';_0x432e56['on'](_0x0a9e('0x1f'),function(_0x370d86){_0x3b45bc+=_0x370d86;});_0x432e56['on'](_0x0a9e('0x1c'),function(){_0x112016(_0x3b45bc);});})['on'](_0x0a9e('0x18'),function(_0x5ea472){_0x1c696a(_0x5ea472);})['end']();});}function convertFile(_0x197ec0,_0x3a8e58){return new BPromise(function(_0x40c424,_0x33161b){var _0x526cf3=sox[_0x0a9e('0x20')](_0x197ec0,_0x3a8e58,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x526cf3['on'](_0x0a9e('0x18'),function(_0x5bfb33){logger[_0x0a9e('0x18')](_0x0a9e('0x21'),_0x5bfb33);_0x33161b(_0x5bfb33);});_0x526cf3['on'](_0x0a9e('0x1c'),function(){logger[_0x0a9e('0x16')](_0x0a9e('0x22'));_0x40c424();});_0x526cf3[_0x0a9e('0x23')]();});}function base64Decode(_0x11c3b6,_0x14de77){var _0x5a101a=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));fs['writeFileSync'](_0x5a101a,_0x11c3b6,_0x0a9e('0x28'));return convertFile(_0x5a101a,_0x14de77)[_0x0a9e('0x29')](function(){try{fs[_0x0a9e('0x19')](_0x5a101a);fs[_0x0a9e('0x2a')](_0x14de77,_0x0a9e('0x2b'));}catch(_0x563b45){logger[_0x0a9e('0x18')](_0x563b45);}return _0x14de77[_0x0a9e('0x2c')]('.')[0x0];});}function base64Encode(_0x1dbde2){var _0x540530=fs[_0x0a9e('0x2d')](_0x1dbde2);return new Buffer(_0x540530)['toString'](_0x0a9e('0x28'));}exports[_0x0a9e('0x2e')]=function(_0x1122db,_0x33bdb7){var _0x25ce3a,_0x5180f1;return tts(_0x1122db,_0x33bdb7||'en',0x1)[_0x0a9e('0x29')](function(_0x46f0a5){logger[_0x0a9e('0x16')](_0x46f0a5);_0x25ce3a=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));return downloadFile(_0x46f0a5,_0x25ce3a);})[_0x0a9e('0x29')](function(){_0x5180f1=path['resolve'](__dirname,_0x0a9e('0x25'),rs['generate'](0x4)+_0x0a9e('0x27'));return convertFile(_0x25ce3a,_0x5180f1);})[_0x0a9e('0x29')](function(){try{fs[_0x0a9e('0x19')](_0x25ce3a);fs[_0x0a9e('0x2a')](_0x5180f1,'777');}catch(_0x191e91){logger[_0x0a9e('0x18')](_0x191e91);}logger[_0x0a9e('0x16')](_0x0a9e('0x30'),_0x5180f1['split']('.')[0x0]);return _0x5180f1['split']('.')[0x0];});};exports[_0x0a9e('0x31')]=function(_0x5640eb,_0x24936a,_0x3d9717){return google[_0x0a9e('0x32')](_0x5640eb,_0x24936a,_0x3d9717)[_0x0a9e('0x29')](function(_0x4f41ae){logger[_0x0a9e('0x16')](_0x4f41ae[_0x0a9e('0x33')]);return rp(_0x4f41ae);})[_0x0a9e('0x29')](function(_0x533942){var _0x1dbf74='';var _0x1a180b=0x0;try{fs[_0x0a9e('0x19')](_0x5640eb);}catch(_0x4c1c0e){logger['error'](_0x4c1c0e);}if(_0x533942&&_0x533942[_0x0a9e('0x34')]){_0x1dbf74=_0x533942[_0x0a9e('0x34')]['map'](function(_0x2b814e){return _0x2b814e&&_0x2b814e[_0x0a9e('0x35')][0x0]&&_0x2b814e[_0x0a9e('0x35')][0x0][_0x0a9e('0x36')]?_0x2b814e['alternatives'][0x0]['transcript']:'';})[_0x0a9e('0x37')]('\x0a');_0x1a180b=_0x533942[_0x0a9e('0x34')]['map'](function(_0x183991){return _0x183991&&_0x183991[_0x0a9e('0x35')][0x0]&&_0x183991[_0x0a9e('0x35')][0x0]['confidence']?_0x183991[_0x0a9e('0x35')][0x0][_0x0a9e('0x38')]:0x0;})[_0x0a9e('0x37')]('\x0a');}logger[_0x0a9e('0x16')](_0x0a9e('0x39'),_0x1dbf74);logger[_0x0a9e('0x16')](_0x0a9e('0x3a'),_0x1a180b);return{'transcript':_0x1dbf74,'confidence':_0x1a180b};})[_0x0a9e('0x3b')](function(_0x23b089){logger[_0x0a9e('0x18')](_0x0a9e('0x3c'),_0x23b089[_0x0a9e('0x11')],_0x23b089[_0x0a9e('0x3d')],_0x23b089[_0x0a9e('0x3e')]);});};exports[_0x0a9e('0x3f')]=function(_0x4d04c8,_0x52628e,_0x473fdc,_0xb3795a){var _0x405c8f=apiai(_0x52628e,{'language':_0xb3795a||'en'});return _0x405c8f[_0x0a9e('0x40')](_0x473fdc,{'sessionId':md5(_0x4d04c8)})[_0x0a9e('0x29')](function(_0xc9a702){logger[_0x0a9e('0x16')](JSON[_0x0a9e('0x41')](_0xc9a702));return{'source':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x43')],'resolvedQuery':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x44')],'action':_0xc9a702['result'][_0x0a9e('0x45')],'actionIncomplete':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x46')],'speech':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x47')][_0x0a9e('0x48')],'score':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x49')],'statusCode':_0xc9a702['status'][_0x0a9e('0x4a')],'endConversation':_0xc9a702['result'][_0x0a9e('0x4b')][_0x0a9e('0x4c')]||![],'isFallbackIntent':_0xc9a702[_0x0a9e('0x42')]['metadata'][_0x0a9e('0x4d')]};});};exports[_0x0a9e('0x4e')]=function(_0x4774f4,_0x34aa5a,_0x45c845,_0x37be73){return tilde[_0x0a9e('0x32')](_0x4774f4,_0x34aa5a,_0x45c845,_0x37be73)['then'](function(_0x13f44d){try{fs[_0x0a9e('0x19')](_0x4774f4);}catch(_0x1b5e80){logger[_0x0a9e('0x18')](_0x1b5e80);}logger[_0x0a9e('0x16')](_0x0a9e('0x4f'),_0x13f44d[_0x0a9e('0x36')]);logger[_0x0a9e('0x16')](_0x0a9e('0x50'),_0x13f44d['confidence']);return _0x13f44d;});};exports[_0x0a9e('0x51')]=function(_0x3fe430,_0x4f7240,_0x4ae14b,_0x5ddf84,_0x1adfee,_0x4317e3){var _0x37edaa=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));var _0x375c18;return aws['polly'](_0x3fe430,_0x4f7240,_0x4ae14b,_0x5ddf84,_0x1adfee,_0x4317e3,_0x37edaa)['then'](function(){_0x375c18=path['resolve'](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));return convertFile(_0x37edaa,_0x375c18);})['then'](function(){try{fs[_0x0a9e('0x19')](_0x37edaa);fs[_0x0a9e('0x2a')](_0x375c18,'777');}catch(_0x5a88da){logger[_0x0a9e('0x18')](_0x5a88da);}return _0x375c18['split']('.')[0x0];});};exports[_0x0a9e('0x52')]=function(_0x4c3845,_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return aws[_0x0a9e('0x53')](_0x4c3845,_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da)['then'](function(_0x50f687){logger[_0x0a9e('0x16')](JSON[_0x0a9e('0x41')](_0x50f687));return _0x50f687;});};exports['ispeechTTS']=function(_0x145931,_0x5ce9ac,_0x211ef9,_0x523cd2){var _0xe22ccc=util['format']('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x145931,encodeURIComponent(_0x5ce9ac),_0x211ef9,_0x523cd2);var _0x5df0ad=path[_0x0a9e('0x24')](__dirname,'tmp',rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));var _0x3cfd00;return downloadFile(_0xe22ccc,_0x5df0ad)[_0x0a9e('0x29')](function(){_0x3cfd00=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));return convertFile(_0x5df0ad,_0x3cfd00);})['then'](function(){try{fs[_0x0a9e('0x19')](_0x5df0ad);fs[_0x0a9e('0x2a')](_0x3cfd00,_0x0a9e('0x2b'));}catch(_0x30c491){logger[_0x0a9e('0x18')](_0x30c491);}return _0x3cfd00[_0x0a9e('0x2c')]('.')[0x0];});};exports['ispeechASR']=function(_0x956fbe,_0x26bc80,_0x5239ef,_0x3649cc){var _0x5cc8fb=util[_0x0a9e('0x54')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x26bc80,_0x5239ef,base64Encode(_0x956fbe),_0x3649cc?util['format']('model=%s',encodeURIComponent(_0x3649cc)):_0x0a9e('0x55'));return uploadFile(_0x5cc8fb)['then'](function(_0x2244d6){return querystring[_0x0a9e('0x56')](_0x2244d6);});};exports[_0x0a9e('0x57')]=function(_0x7be420,_0x1cca9f){return sestek[_0x0a9e('0x58')](_0x7be420,_0x1cca9f)['then'](function(_0x1627a7){logger['info'](JSON[_0x0a9e('0x41')](_0x1627a7));var _0x1f07cb={'speech':_0x1627a7[_0x0a9e('0x59')],'action':_0x1627a7['channelData']?_0x1627a7[_0x0a9e('0x5a')][_0x0a9e('0x5b')]:undefined,'actiondata':_0x1627a7[_0x0a9e('0x5a')]?_0x1627a7[_0x0a9e('0x5a')]['CustomActionData']:undefined};if(_0x1627a7[_0x0a9e('0x5a')]&&_0x1627a7[_0x0a9e('0x5a')]['AudioFromTts']){return base64Decode(_0x1627a7[_0x0a9e('0x5a')][_0x0a9e('0x5c')][_0x0a9e('0x5d')],path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs['generate'](0x4)+_0x0a9e('0x27')))[_0x0a9e('0x29')](function(_0x281c7d){_0x1f07cb['audiofile']=_0x281c7d;return _0x1f07cb;});}return _0x1f07cb;});};exports[_0x0a9e('0x5e')]=function(){return __dirname;}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/index.js b/server/services/agi/scripts/sestek/index.js index 69ee62d..ecb609d 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 _0x2ea6=['exports','./nda'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x2ea6,0x189));var _0x62ea=function(_0x2442b9,_0x3d87e9){_0x2442b9=_0x2442b9-0x0;var _0x31b571=_0x2ea6[_0x2442b9];return _0x31b571;};var nda=require(_0x62ea('0x0'));module[_0x62ea('0x1')]={'nda':nda}; \ No newline at end of file +var _0xdb79=['./nda'];(function(_0x3b677a,_0x274ecc){var _0x2e2eb6=function(_0x79d253){while(--_0x79d253){_0x3b677a['push'](_0x3b677a['shift']());}};_0x2e2eb6(++_0x274ecc);}(_0xdb79,0xa5));var _0x9db7=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0xdb79[_0x1ccdf7];return _0x52a0ae;};var nda=require(_0x9db7('0x0'));module['exports']={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 21740e7..78eaf41 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 _0xfbb5=['audio/wav','custom_action','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','POST','resolve','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','calleridname','dnid','text','Bearer\x20','access_token','project','body','channelData','ndagenerate_audio','AudioOutputSettings'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0xfbb5,0xc6));var _0x5fbb=function(_0xe5218c,_0x3cc4c3){_0xe5218c=_0xe5218c-0x0;var _0x32b00e=_0xfbb5[_0xe5218c];return _0x32b00e;};'use strict';var rp=require(_0x5fbb('0x0'));var url=require(_0x5fbb('0x1'));var logger=require(_0x5fbb('0x2'))(_0x5fbb('0x3'));module[_0x5fbb('0x4')]=function(_0x569503,_0x36d801){var _0x4b5fa7={'method':_0x5fbb('0x5'),'uri':url[_0x5fbb('0x6')](_0x36d801['ndauth_url'],'/token'),'form':{'grant_type':_0x5fbb('0x7'),'username':_0x36d801[_0x5fbb('0x8')],'password':_0x36d801[_0x5fbb('0x7')]},'json':!![]};return rp(_0x4b5fa7)[_0x5fbb('0x9')](function(_0x3be9e3){var _0x28507a={'method':_0x5fbb('0x5'),'uri':url[_0x5fbb('0x6')](_0x36d801[_0x5fbb('0xa')],_0x5fbb('0xb')),'body':{'type':_0x36d801[_0x5fbb('0xc')]||_0x5fbb('0xd'),'channelId':_0x5fbb('0xe'),'conversation':{'id':_0x569503[_0x5fbb('0xf')]},'from':{'id':_0x569503['callerid'],'name':_0x569503[_0x5fbb('0x10')]},'recipient':{'id':_0x569503[_0x5fbb('0x11')],'name':_0x569503['extension']},'text':_0x36d801[_0x5fbb('0x12')],'channelData':{}},'headers':{'Authorization':_0x5fbb('0x13')+_0x3be9e3[_0x5fbb('0x14')]},'json':!![]};if(_0x36d801[_0x5fbb('0x15')]){_0x28507a[_0x5fbb('0x16')][_0x5fbb('0x17')]['ProjectName']=_0x36d801[_0x5fbb('0x15')];}if(_0x36d801[_0x5fbb('0x18')]=='1'){_0x28507a[_0x5fbb('0x16')][_0x5fbb('0x17')][_0x5fbb('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x5fbb('0x1a')};}if(_0x36d801['custom_action']){_0x28507a[_0x5fbb('0x16')]['channelData']['CustomAction']=_0x36d801[_0x5fbb('0x1b')];if(_0x36d801[_0x5fbb('0x1c')]){_0x28507a[_0x5fbb('0x16')][_0x5fbb('0x17')][_0x5fbb('0x1d')]=_0x36d801[_0x5fbb('0x1c')];}}logger[_0x5fbb('0x1e')](JSON[_0x5fbb('0x1f')](_0x28507a));return rp(_0x28507a);});}; \ No newline at end of file +var _0x9435=['audio/wav','CustomAction','custom_action','custom_action_data','CustomActionData','info','request-promise','../../../../../config/logger','exports','POST','resolve','ndauth_url','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','callerid','calleridname','extension','text','Bearer\x20','access_token','project','body','channelData','AudioOutputSettings'];(function(_0x1113d9,_0x52cd99){var _0x4a5aa2=function(_0x1f0b6e){while(--_0x1f0b6e){_0x1113d9['push'](_0x1113d9['shift']());}};_0x4a5aa2(++_0x52cd99);}(_0x9435,0xf6));var _0x5943=function(_0x4a0ca9,_0x328761){_0x4a0ca9=_0x4a0ca9-0x0;var _0x31024f=_0x9435[_0x4a0ca9];return _0x31024f;};'use strict';var rp=require(_0x5943('0x0'));var url=require('url');var logger=require(_0x5943('0x1'))('agi');module[_0x5943('0x2')]=function(_0x47c4df,_0x3f8323){var _0x408816={'method':_0x5943('0x3'),'uri':url[_0x5943('0x4')](_0x3f8323[_0x5943('0x5')],'/token'),'form':{'grant_type':_0x5943('0x6'),'username':_0x3f8323[_0x5943('0x7')],'password':_0x3f8323[_0x5943('0x6')]},'json':!![]};return rp(_0x408816)[_0x5943('0x8')](function(_0x199808){var _0x2a28bd={'method':_0x5943('0x3'),'uri':url[_0x5943('0x4')](_0x3f8323[_0x5943('0x9')],_0x5943('0xa')),'body':{'type':_0x3f8323[_0x5943('0xb')]||_0x5943('0xc'),'channelId':_0x5943('0xd'),'conversation':{'id':_0x47c4df['uniqueid']},'from':{'id':_0x47c4df[_0x5943('0xe')],'name':_0x47c4df[_0x5943('0xf')]},'recipient':{'id':_0x47c4df['dnid'],'name':_0x47c4df[_0x5943('0x10')]},'text':_0x3f8323[_0x5943('0x11')],'channelData':{}},'headers':{'Authorization':_0x5943('0x12')+_0x199808[_0x5943('0x13')]},'json':!![]};if(_0x3f8323[_0x5943('0x14')]){_0x2a28bd[_0x5943('0x15')][_0x5943('0x16')]['ProjectName']=_0x3f8323['project'];}if(_0x3f8323['ndagenerate_audio']=='1'){_0x2a28bd['body'][_0x5943('0x16')][_0x5943('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x5943('0x18')};}if(_0x3f8323['custom_action']){_0x2a28bd[_0x5943('0x15')][_0x5943('0x16')][_0x5943('0x19')]=_0x3f8323[_0x5943('0x1a')];if(_0x3f8323[_0x5943('0x1b')]){_0x2a28bd['body'][_0x5943('0x16')][_0x5943('0x1c')]=_0x3f8323[_0x5943('0x1b')];}}logger[_0x5943('0x1d')](JSON['stringify'](_0x2a28bd));return rp(_0x2a28bd);});}; \ 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 5f05a27..432b29c 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 _0x6046=['exports','./lib/api'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x6046,0x15d));var _0x6604=function(_0x2a5bae,_0x53aa13){_0x2a5bae=_0x2a5bae-0x0;var _0x4790f1=_0x6046[_0x2a5bae];return _0x4790f1;};'use strict';var asr=require(_0x6604('0x0'));module[_0x6604('0x1')]=function(_0x4f24d7,_0x28f9b5,_0x81a4be,_0x142222){return asr(_0x4f24d7,_0x28f9b5,_0x81a4be,_0x142222);}; \ No newline at end of file +var _0x8cd4=['./lib/api','exports'];(function(_0x1ca266,_0x57b4b9){var _0x1ff7ff=function(_0x3d6ddc){while(--_0x3d6ddc){_0x1ca266['push'](_0x1ca266['shift']());}};_0x1ff7ff(++_0x57b4b9);}(_0x8cd4,0x15a));var _0x48cd=function(_0x5a08fd,_0x169a34){_0x5a08fd=_0x5a08fd-0x0;var _0xfb94aa=_0x8cd4[_0x5a08fd];return _0xfb94aa;};'use strict';var asr=require(_0x48cd('0x0'));module[_0x48cd('0x1')]=function(_0x394f56,_0x7ed552,_0x153369,_0x5d610a){return asr(_0x394f56,_0x7ed552,_0x153369,_0x5d610a);}; \ 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 fd84756..4ae038e 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 _0x0bff=['Open\x20Tilde\x20ASR\x20socket','unix','createReadStream','close','error','Tilde\x20ASR\x20send\x20error','parse','status','result','final','Tilde\x20ASR\x20hypoteses','transcript','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','stringify','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','message','bluebird','lodash','moment','crypto','../../../../../../config/logger','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','update','digest','hex'];(function(_0x3e31ab,_0x3e3e7b){var _0x13aa15=function(_0x399fad){while(--_0x399fad){_0x3e31ab['push'](_0x3e31ab['shift']());}};_0x13aa15(++_0x3e3e7b);}(_0x0bff,0xb0));var _0xf0bf=function(_0x367159,_0x37ce7f){_0x367159=_0x367159-0x0;var _0x5e63c6=_0x0bff[_0x367159];return _0x5e63c6;};'use strict';var BPromise=require(_0xf0bf('0x0'));var _=require(_0xf0bf('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xf0bf('0x2'));var crypto=require(_0xf0bf('0x3'));var logger=require(_0xf0bf('0x4'))('agi');module[_0xf0bf('0x5')]=function(_0xcbcde7,_0x52ced7,_0x5ed7b1,_0x143c44){return new BPromise(function(_0x54b22e,_0x1cd2f9){logger[_0xf0bf('0x6')](_0xf0bf('0x7'),_0x143c44||_0xf0bf('0x8'));var _0x153435=new WebSocket(_0x143c44||_0xf0bf('0x8'),{'perMessageDeflate':![]});var _0x50e593='';var _0x1c1d61='0';var _0x2e7b64='1';var _0x3a9d0c=_0xf0bf('0x9');function _0x1dad5d(_0x5a0ed3){var _0x5f254a=crypto[_0xf0bf('0xa')]('sha1');_0x5f254a[_0xf0bf('0xb')](_0x5a0ed3);return _0x5f254a[_0xf0bf('0xc')](_0xf0bf('0xd'));}function _0x533111(){try{logger[_0xf0bf('0x6')](_0xf0bf('0xe'));var _0x4e2f5f=moment()[_0xf0bf('0xf')]();var _0x4dbfc6=_0x1dad5d(_0x4e2f5f+_0x52ced7+_0x5ed7b1);_0x153435['send'](JSON['stringify']({'appID':_0x52ced7,'timestamp':_0x4e2f5f,'appKey':_0x4dbfc6}));var _0x56cfed=fs[_0xf0bf('0x10')](_0xcbcde7);_0x56cfed['on']('data',function(_0x57247b){_0x153435['send'](_0x57247b);});_0x56cfed['on'](_0xf0bf('0x11'),function(){_0x153435['send']('EOS');});}catch(_0x9eb10c){logger[_0xf0bf('0x12')](_0xf0bf('0x13'),JSON['stringify'](_0x9eb10c));_0x153435['terminate']();}}function _0x2828bf(_0x5e853e){try{if(_0x5e853e){var _0x26f18e=JSON[_0xf0bf('0x14')](_0x5e853e);switch(_0x26f18e[_0xf0bf('0x15')]){case 0x0:if(_0x26f18e[_0xf0bf('0x16')]){if(_0x26f18e[_0xf0bf('0x16')][_0xf0bf('0x17')]){logger[_0xf0bf('0x6')](_0xf0bf('0x18'),JSON['stringify'](_0x26f18e[_0xf0bf('0x16')]['hypotheses']));_0x50e593=_0x26f18e[_0xf0bf('0x16')]['hypotheses'][0x0][_0xf0bf('0x19')];_0x1c1d61=_0x26f18e[_0xf0bf('0x16')]['hypotheses'][0x0]['likelihood'];_0x2e7b64='0';_0x3a9d0c=_0xf0bf('0x1a');_0x153435[_0xf0bf('0x1b')]();}}break;case 0x1:logger[_0xf0bf('0x6')](_0xf0bf('0x9'));_0x2e7b64='1';_0x3a9d0c='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0xf0bf('0x6')](_0xf0bf('0x1c'));_0x2e7b64='2';_0x3a9d0c=_0xf0bf('0x1c');break;case 0x9:logger[_0xf0bf('0x6')](_0xf0bf('0x1d'));_0x2e7b64='9';_0x3a9d0c=_0xf0bf('0x1d');break;case 0xa:logger[_0xf0bf('0x6')](_0xf0bf('0x1e'));_0x2e7b64='10';_0x3a9d0c=_0xf0bf('0x1e');break;case 0xb:logger[_0xf0bf('0x6')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x2e7b64='11';_0x3a9d0c=_0xf0bf('0x1f');}}}catch(_0x2aa129){logger['error'](_0xf0bf('0x20'),JSON[_0xf0bf('0x21')](_0x2aa129));_0x153435[_0xf0bf('0x1b')]();}}function _0x93c773(){logger['info'](_0xf0bf('0x22'));_0x54b22e({'transcript':_0x50e593,'confidence':_0x1c1d61,'status':_0x2e7b64,'status_message':_0x3a9d0c});}function _0x2cdf65(_0x4c25ab){logger[_0xf0bf('0x12')](_0xf0bf('0x23'));if(!_[_0xf0bf('0x24')](_0x4c25ab)){logger[_0xf0bf('0x12')](_['isObject'](_0x4c25ab)?JSON[_0xf0bf('0x21')](_0x4c25ab):_0x4c25ab);}}_0x153435['on']('open',_0x533111);_0x153435['on'](_0xf0bf('0x25'),_0x2828bf);_0x153435['on']('close',_0x93c773);_0x153435['on'](_0xf0bf('0x12'),_0x2cdf65);});}; \ No newline at end of file +var _0xf697=['info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','hex','unix','send','stringify','createReadStream','data','error','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','terminate','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','open','message','close','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','exports'];(function(_0x270f54,_0x2e5293){var _0x501dec=function(_0x4b2b68){while(--_0x4b2b68){_0x270f54['push'](_0x270f54['shift']());}};_0x501dec(++_0x2e5293);}(_0xf697,0x68));var _0x7f69=function(_0x9ae07c,_0x4cba11){_0x9ae07c=_0x9ae07c-0x0;var _0x837b1f=_0xf697[_0x9ae07c];return _0x837b1f;};'use strict';var BPromise=require(_0x7f69('0x0'));var _=require(_0x7f69('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x7f69('0x2'));var crypto=require(_0x7f69('0x3'));var logger=require(_0x7f69('0x4'))(_0x7f69('0x5'));module[_0x7f69('0x6')]=function(_0x402f3c,_0x5839fb,_0x1a3df9,_0x302e71){return new BPromise(function(_0x508a58,_0x25ac93){logger[_0x7f69('0x7')](_0x7f69('0x8'),_0x302e71||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x311a58=new WebSocket(_0x302e71||_0x7f69('0x9'),{'perMessageDeflate':![]});var _0x524fb3='';var _0x4abad1='0';var _0x329f47='1';var _0x109ff0=_0x7f69('0xa');function _0x4ba77a(_0x1c9545){var _0xe119bb=crypto[_0x7f69('0xb')](_0x7f69('0xc'));_0xe119bb['update'](_0x1c9545);return _0xe119bb['digest'](_0x7f69('0xd'));}function _0x5909f5(){try{logger['info']('Open\x20Tilde\x20ASR\x20socket');var _0x46313c=moment()[_0x7f69('0xe')]();var _0x3392a4=_0x4ba77a(_0x46313c+_0x5839fb+_0x1a3df9);_0x311a58[_0x7f69('0xf')](JSON[_0x7f69('0x10')]({'appID':_0x5839fb,'timestamp':_0x46313c,'appKey':_0x3392a4}));var _0x4b11f1=fs[_0x7f69('0x11')](_0x402f3c);_0x4b11f1['on'](_0x7f69('0x12'),function(_0x48d5dd){_0x311a58[_0x7f69('0xf')](_0x48d5dd);});_0x4b11f1['on']('close',function(){_0x311a58[_0x7f69('0xf')]('EOS');});}catch(_0x376292){logger[_0x7f69('0x13')]('Tilde\x20ASR\x20send\x20error',JSON[_0x7f69('0x10')](_0x376292));_0x311a58['terminate']();}}function _0x331bbc(_0x418649){try{if(_0x418649){var _0x2471d9=JSON[_0x7f69('0x14')](_0x418649);switch(_0x2471d9[_0x7f69('0x15')]){case 0x0:if(_0x2471d9[_0x7f69('0x16')]){if(_0x2471d9[_0x7f69('0x16')][_0x7f69('0x17')]){logger[_0x7f69('0x7')](_0x7f69('0x18'),JSON[_0x7f69('0x10')](_0x2471d9[_0x7f69('0x16')][_0x7f69('0x19')]));_0x524fb3=_0x2471d9[_0x7f69('0x16')][_0x7f69('0x19')][0x0][_0x7f69('0x1a')];_0x4abad1=_0x2471d9[_0x7f69('0x16')][_0x7f69('0x19')][0x0][_0x7f69('0x1b')];_0x329f47='0';_0x109ff0='Success.';_0x311a58[_0x7f69('0x1c')]();}}break;case 0x1:logger[_0x7f69('0x7')](_0x7f69('0xa'));_0x329f47='1';_0x109ff0=_0x7f69('0xa');break;case 0x2:logger[_0x7f69('0x7')](_0x7f69('0x1d'));_0x329f47='2';_0x109ff0=_0x7f69('0x1d');break;case 0x9:logger[_0x7f69('0x7')](_0x7f69('0x1e'));_0x329f47='9';_0x109ff0=_0x7f69('0x1e');break;case 0xa:logger[_0x7f69('0x7')]('Authentication\x20failed.');_0x329f47='10';_0x109ff0='Authentication\x20failed.';break;case 0xb:logger['info'](_0x7f69('0x1f'));_0x329f47='11';_0x109ff0=_0x7f69('0x1f');}}}catch(_0x5c486c){logger[_0x7f69('0x13')](_0x7f69('0x20'),JSON['stringify'](_0x5c486c));_0x311a58[_0x7f69('0x1c')]();}}function _0x22dde4(){logger[_0x7f69('0x7')](_0x7f69('0x21'));_0x508a58({'transcript':_0x524fb3,'confidence':_0x4abad1,'status':_0x329f47,'status_message':_0x109ff0});}function _0x57c510(_0x518ace){logger['error']('Error\x20Tilde\x20ASR\x20socket');if(!_['isNil'](_0x518ace)){logger[_0x7f69('0x13')](_['isObject'](_0x518ace)?JSON['stringify'](_0x518ace):_0x518ace);}}_0x311a58['on'](_0x7f69('0x22'),_0x5909f5);_0x311a58['on'](_0x7f69('0x23'),_0x331bbc);_0x311a58['on'](_0x7f69('0x24'),_0x22dde4);_0x311a58['on'](_0x7f69('0x13'),_0x57c510);});}; \ 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 9bb454a..0a6c7ac 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 _0x008c=['./asr','exports'];(function(_0x17019f,_0x1e2237){var _0x4889c9=function(_0x31aff4){while(--_0x31aff4){_0x17019f['push'](_0x17019f['shift']());}};_0x4889c9(++_0x1e2237);}(_0x008c,0x188));var _0xc008=function(_0x34d38c,_0x4f1295){_0x34d38c=_0x34d38c-0x0;var _0x4be108=_0x008c[_0x34d38c];return _0x4be108;};var asr=require(_0xc008('0x0'));module[_0xc008('0x1')]={'asr':asr}; \ No newline at end of file +var _0x34e8=['./asr','exports'];(function(_0x4d7116,_0xdb8175){var _0x4593dc=function(_0x51d44e){while(--_0x51d44e){_0x4d7116['push'](_0x4d7116['shift']());}};_0x4593dc(++_0xdb8175);}(_0x34e8,0x12c));var _0x834e=function(_0x21dd57,_0xc7506b){_0x21dd57=_0x21dd57-0x0;var _0x426e58=_0x34e8[_0x21dd57];return _0x426e58;};var asr=require(_0x834e('0x0'));module[_0x834e('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 01c884b..7b68d5f 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 _0x1573=['error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','emit','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','EventEmitter','./error','./channel','127.0.0.1'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x1573,0x193));var _0x3157=function(_0x474e22,_0x5d5515){_0x474e22=_0x474e22-0x0;var _0x76a179=_0x1573[_0x474e22];return _0x76a179;};'use strict';var util=require(_0x3157('0x0'));var net=require('net');var EventEmitter=require('events')[_0x3157('0x1')];var AGIError=require(_0x3157('0x2'));var AGIChannel=require(_0x3157('0x3'));var AGIServer=function(_0x444ccd,_0x25f925,_0x279839){var _0x42275e=this,_0x444ccd=_0x444ccd||0x11dd,_0x25f925=_0x25f925||_0x3157('0x4'),_0x5f223f=null,_0x56d6f2=0x0;EventEmitter['call'](_0x42275e);function _0xdf0242(){if(!_0x444ccd){_0x42275e['emit'](_0x3157('0x5'),new AGIError(_0x3157('0x6')));return![];}_0x5f223f=net[_0x3157('0x7')]();_0x5f223f[_0x3157('0x8')](_0x444ccd,_0x25f925);_0x5f223f['on'](_0x3157('0x9'),function(){_0x42275e[_0x3157('0xa')]('listening');});_0x5f223f['on'](_0x3157('0xb'),function(_0x370683){_0x5f223f[_0x3157('0xc')](function(_0x2fb325,_0x2a225b){if(_0x2fb325){_0x42275e[_0x3157('0xa')]('error',new AGIError(_0x3157('0xd'),_0x2fb325));}else if(_0x279839&&_0x279839<0x0){_0x42275e[_0x3157('0xa')](_0x3157('0x5'),new AGIError(_0x3157('0xe')));_0x370683[_0x3157('0xf')]();}else if(_0x279839&&_0x279839>0x0&&_0x279839<_0x2a225b){_0x56d6f2+=0x1;_0x42275e['emit'](_0x3157('0x5'),new AGIError(_0x3157('0x10'),_0x56d6f2));_0x370683[_0x3157('0xf')]();}else{var _0x2441be=new AGIChannel(_0x370683);_0x2441be['on'](_0x3157('0x11'),function(){_0x42275e[_0x3157('0xa')](_0x3157('0xb'),_0x2441be);});}});});_0x5f223f['on'](_0x3157('0x5'),function(_0x1e81a9){_0x42275e[_0x3157('0xa')](_0x3157('0x5'),new AGIError(_0x3157('0xd'),_0x1e81a9[_0x3157('0x12')]));});_0x5f223f['on'](_0x3157('0x13'),function(){_0x42275e[_0x3157('0xa')]('close',new AGIError(_0x3157('0x14')));});}process[_0x3157('0x15')](function(){_0xdf0242();});};util[_0x3157('0x16')](AGIServer,EventEmitter);module[_0x3157('0x17')]=function(_0x4225ad,_0x12ecd8,_0x1eab91){return new AGIServer(_0x4225ad,_0x12ecd8,_0x1eab91);}; \ No newline at end of file +var _0xb2ca=['E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','exports','util','net','EventEmitter','./error','./channel','127.0.0.1','emit','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb2ca,0x1a8));var _0xab2c=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xb2ca[_0x138adb];return _0x1b27f2;};'use strict';var util=require(_0xab2c('0x0'));var net=require(_0xab2c('0x1'));var EventEmitter=require('events')[_0xab2c('0x2')];var AGIError=require(_0xab2c('0x3'));var AGIChannel=require(_0xab2c('0x4'));var AGIServer=function(_0x3adf9d,_0x396335,_0x9092a1){var _0x3c80f1=this,_0x3adf9d=_0x3adf9d||0x11dd,_0x396335=_0x396335||_0xab2c('0x5'),_0x3e9b88=null,_0x3efbc2=0x0;EventEmitter['call'](_0x3c80f1);function _0x33adc7(){if(!_0x3adf9d){_0x3c80f1[_0xab2c('0x6')](_0xab2c('0x7'),new AGIError(_0xab2c('0x8')));return![];}_0x3e9b88=net[_0xab2c('0x9')]();_0x3e9b88[_0xab2c('0xa')](_0x3adf9d,_0x396335);_0x3e9b88['on']('listening',function(){_0x3c80f1[_0xab2c('0x6')](_0xab2c('0xb'));});_0x3e9b88['on'](_0xab2c('0xc'),function(_0x4085f8){_0x3e9b88[_0xab2c('0xd')](function(_0x308592,_0x9383c5){if(_0x308592){_0x3c80f1[_0xab2c('0x6')](_0xab2c('0x7'),new AGIError('E_AGI_SERVER_ERROR',_0x308592));}else if(_0x9092a1&&_0x9092a1<0x0){_0x3c80f1['emit'](_0xab2c('0x7'),new AGIError(_0xab2c('0xe')));_0x4085f8[_0xab2c('0xf')]();}else if(_0x9092a1&&_0x9092a1>0x0&&_0x9092a1<_0x9383c5){_0x3efbc2+=0x1;_0x3c80f1[_0xab2c('0x6')](_0xab2c('0x7'),new AGIError(_0xab2c('0x10'),_0x3efbc2));_0x4085f8['destroy']();}else{var _0xcb6182=new AGIChannel(_0x4085f8);_0xcb6182['on'](_0xab2c('0x11'),function(){_0x3c80f1[_0xab2c('0x6')](_0xab2c('0xc'),_0xcb6182);});}});});_0x3e9b88['on']('error',function(_0x5cc6fb){_0x3c80f1['emit'](_0xab2c('0x7'),new AGIError(_0xab2c('0x12'),_0x5cc6fb[_0xab2c('0x13')]));});_0x3e9b88['on'](_0xab2c('0x14'),function(){_0x3c80f1[_0xab2c('0x6')](_0xab2c('0x14'),new AGIError(_0xab2c('0x15')));});}process[_0xab2c('0x16')](function(){_0x33adc7();});};util['inherits'](AGIServer,EventEmitter);module[_0xab2c('0x17')]=function(_0x222977,_0x4f4c7c,_0x99c052){return new AGIServer(_0x222977,_0x4f4c7c,_0x99c052);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 4f769da..6309f62 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 _0x0b60=['createSquareDetailsReport','uniqueid','label','agicommand','channel','arg_1','callerid','createSquareRecording','calleridname','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isNil','callback_','random','isEmpty','lastName','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','error','agentLogin','internal','%s/%s@from-sip/n','shellCommand','trim','replace','googleTTS','text','google_tts_language','googleDialogflow','key','dialogflow_language','sestekNDA','ispeechTTS','ispeechASR','en-US','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_voice','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','tildeASR','appid','appsecret','uri','clear','includes','clone','hasOwnProperty','isString','replaceAllVariables','split','length','getAndSetVariable','result','extra','setVariable','maxRetry','sync','Enter\x20in\x20AGI\x20(%s)\x20block','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','timeout','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','custom_app','noop','application','options','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','exec','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','grammar','MRCPRecog','RECOG_CONFIDENCE()','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','getSquareOdbc','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20found','forEach','keys','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','getUser','sip_id','Executed\x20command\x20%s','DIAL','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','toUpperCase','speech','Dialogflow\x20Result\x20%s','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','password','no\x20password\x20configured','ndassistant_url','out','audiofile','streamFile','.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','opts','url','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','no\x20file\x20audio\x20selected','file_id','no\x20variable\x20selected\x20for\x20the\x20result','getData','response','test','mindigit','maxdigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','stringify','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appsecret\x20configured','%s/recordings/%s','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','getIntervals','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','ispeechtts','unlink','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','operation','isArray','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','pause_id','playback','no\x20file\x20audio\x20found','Executed\x20command\x20%s\x20%s','PLAYBACK','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','saydigits','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','number','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','email','user','bcc','service','host','port','secure','auth','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','sms_text','sendSMS\x20message','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','start','START\x20CALLY\x20SQUARE','yes','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d','project_id','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','system','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','replaceAll','join','exports','path','lodash','odbc','randomstring','../../config/logger','agi','./scripts','menu','getdigits','getsecretdigits','mailRpc','prototype','getVariable','rpc','getVariableById','name','catch','getVoiceQueueById','then','getSquareProjectById','dsn','getSound','getSoundById','getSoundPath','getMailAccount','getMailAccountById','sendMailMessage','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','info','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage'];(function(_0x5d1e3e,_0x3b1803){var _0x112e67=function(_0x286141){while(--_0x286141){_0x5d1e3e['push'](_0x5d1e3e['shift']());}};_0x112e67(++_0x3b1803);}(_0x0b60,0x154));var _0x00b6=function(_0xc471d2,_0x26ab16){_0xc471d2=_0xc471d2-0x0;var _0x334c68=_0x0b60[_0xc471d2];return _0x334c68;};'use strict';var fs=require('fs');var path=require(_0x00b6('0x0'));var util=require('util');var _=require(_0x00b6('0x1'));var sh=require('shelljs');var odbc=require(_0x00b6('0x2'))();var rs=require(_0x00b6('0x3'));var moment=require('moment');var Mustache=require('mustache');var logger=require(_0x00b6('0x4'))(_0x00b6('0x5'));var config=require('../../config/environment');var scripts=require(_0x00b6('0x6'));var FILES_PATH='/var/opt/motion2/server/files';var verticesWithRetry=[_0x00b6('0x7'),_0x00b6('0x8'),_0x00b6('0x9')];var AGIVertices=function(_0x4b49ce,_0x3aa6f6,_0x5dee74){this['channel']=_0x4b49ce;this['rpc']=_0x3aa6f6;this[_0x00b6('0xa')]=_0x5dee74;};AGIVertices[_0x00b6('0xb')][_0x00b6('0xc')]=function(_0x569b68,_0x46de91){this[_0x00b6('0xd')][_0x00b6('0xe')](_0x569b68)['then'](function(_0x39ff0a){_0x46de91(null,_0x39ff0a?_0x39ff0a[_0x00b6('0xf')]:![]);})[_0x00b6('0x10')](function(_0xfa4006){_0x46de91(_0xfa4006);});};AGIVertices[_0x00b6('0xb')]['getVoiceQueue']=function(_0x1e2067,_0x4900a4){this[_0x00b6('0xd')][_0x00b6('0x11')](_0x1e2067)[_0x00b6('0x12')](function(_0x472374){_0x4900a4(null,_0x472374?_0x472374[_0x00b6('0xf')]:![]);})[_0x00b6('0x10')](function(_0x527b26){_0x4900a4(_0x527b26);});};AGIVertices[_0x00b6('0xb')]['getSquareProject']=function(_0x3eb59a,_0x2cdf06){this[_0x00b6('0xd')][_0x00b6('0x13')](_0x3eb59a)[_0x00b6('0x12')](function(_0x52a51f){_0x2cdf06(null,_0x52a51f?_0x52a51f['name']:![]);})[_0x00b6('0x10')](function(_0x410c4a){_0x2cdf06(_0x410c4a);});};AGIVertices[_0x00b6('0xb')]['getSquareOdbc']=function(_0x3a8346,_0x3e8b4c){this[_0x00b6('0xd')]['getSquareOdbcById'](_0x3a8346)[_0x00b6('0x12')](function(_0x26825a){_0x3e8b4c(null,_0x26825a?_0x26825a[_0x00b6('0x14')]:![]);})[_0x00b6('0x10')](function(_0x583ac1){_0x3e8b4c(_0x583ac1);});};AGIVertices[_0x00b6('0xb')]['getUser']=function(_0x25738c,_0x543967){this['rpc']['getUserById'](_0x25738c)[_0x00b6('0x12')](function(_0x1c0cb9){_0x543967(null,_0x1c0cb9?_0x1c0cb9['name']:![]);})[_0x00b6('0x10')](function(_0x53ec5e){_0x543967(_0x53ec5e);});};AGIVertices['prototype']['getTrunk']=function(_0x28c2a4,_0x1e1ff1){this['rpc']['getTrunkById'](_0x28c2a4)[_0x00b6('0x12')](function(_0x4d66b2){_0x1e1ff1(null,_0x4d66b2?_0x4d66b2[_0x00b6('0xf')]:![]);})['catch'](function(_0x3fa64e){_0x1e1ff1(_0x3fa64e);});};AGIVertices[_0x00b6('0xb')][_0x00b6('0x15')]=function(_0x583da7,_0x401252){var _0x226551=this;this[_0x00b6('0xd')][_0x00b6('0x16')](_0x583da7)[_0x00b6('0x12')](function(_0x17dda4){_0x401252(null,_0x17dda4?_0x226551[_0x00b6('0x17')](_0x17dda4['save_name']):![]);})[_0x00b6('0x10')](function(_0x51a131){_0x401252(_0x51a131);});};AGIVertices[_0x00b6('0xb')][_0x00b6('0x18')]=function(_0x5919c1,_0x4cf341){this[_0x00b6('0xd')][_0x00b6('0x19')](_0x5919c1)['then'](function(_0x22d293){_0x4cf341(null,_0x22d293?_0x22d293:![]);})[_0x00b6('0x10')](function(_0x5b3016){_0x4cf341(_0x5b3016);});};AGIVertices[_0x00b6('0xb')]['sendMailMessage']=function(_0x81d35c,_0x53d9cc,_0xb9d7e2){this[_0x00b6('0xa')][_0x00b6('0x1a')](_0x81d35c,_0x53d9cc)[_0x00b6('0x12')](function(){_0xb9d7e2(null);})['catch'](function(_0x21bcea){_0xb9d7e2(_0x21bcea);});};AGIVertices['prototype']['getIntervals']=function(_0x2515c9,_0x1fa09d){this[_0x00b6('0xd')][_0x00b6('0x1b')](_0x2515c9)[_0x00b6('0x12')](function(_0x369a3f){if(_0x369a3f){if(_0x369a3f[_0x00b6('0x1c')]){_0x1fa09d(null,[_0x369a3f[_0x00b6('0x1d')]]);}else{_0x1fa09d(null,_[_0x00b6('0x1e')](_0x369a3f[_0x00b6('0x1f')],_0x00b6('0x1d')));}}else{_0x1fa09d(null,![]);}})[_0x00b6('0x10')](function(_0x39182b){_0x1fa09d(_0x39182b);});};AGIVertices[_0x00b6('0xb')][_0x00b6('0x17')]=function(_0x5025dd){return util[_0x00b6('0x20')](_0x00b6('0x21'),FILES_PATH,_0x5025dd);};AGIVertices[_0x00b6('0xb')]['getQueryOdbc']=function(_0xd6007d,_0x9a860f,_0x108e52){odbc['open'](_0xd6007d,function(_0x281b55){if(_0x281b55){logger['error']('Error\x20getting\x20ODBC\x20connection\x20%s',_0x281b55);_0x108e52(_0x281b55);}else{logger[_0x00b6('0x22')]('ODBC\x20connection\x20successfully');odbc[_0x00b6('0x23')](_0x9a860f,function(_0x301f19,_0x32a077){if(_0x301f19){logger[_0x00b6('0x22')](_0x00b6('0x24'),_0x9a860f);_0x108e52(_0x301f19);}else{logger['info'](_0x00b6('0x25'),_0x9a860f);odbc[_0x00b6('0x26')](function(_0x1bcc87){if(_0x1bcc87){logger['error'](_0x00b6('0x27'),_0x1bcc87);}_0x108e52(null,_0x32a077);});}});}});};AGIVertices[_0x00b6('0xb')][_0x00b6('0x28')]=function(_0x1b5464,_0x536237){this[_0x00b6('0xd')][_0x00b6('0x29')](_0x1b5464)[_0x00b6('0x12')](function(_0x4e15ef){_0x536237(null,_0x4e15ef?_0x4e15ef:![]);})[_0x00b6('0x10')](function(_0xa9fd){_0x536237(_0xa9fd);});};AGIVertices[_0x00b6('0xb')][_0x00b6('0x2a')]=function(_0x25ca57,_0xb3a46c){this['rpc'][_0x00b6('0x2a')](_0x25ca57)[_0x00b6('0x12')](function(_0x806dae){_0xb3a46c(null,_0x806dae);})[_0x00b6('0x10')](function(_0x251dd0){_0xb3a46c(_0x251dd0);});};AGIVertices[_0x00b6('0xb')][_0x00b6('0x2b')]=function(_0x4f5f85,_0xa9a91b,_0x23d607){this[_0x00b6('0xd')][_0x00b6('0x2b')]({'uniqueid':this['channel'][_0x00b6('0x2c')],'node':_0x4f5f85[_0x00b6('0x2d')],'application':_0x4f5f85[_0x00b6('0x2e')],'data':_0xa9a91b||null,'project_name':this[_0x00b6('0x2f')][_0x00b6('0x30')],'callerid':this[_0x00b6('0x2f')][_0x00b6('0x31')]})['then'](function(_0x15206d){if(_0x23d607){_0x23d607(null,_0x15206d);}})['catch'](function(_0x264bfc){if(_0x23d607){_0x23d607(_0x264bfc);}});};AGIVertices[_0x00b6('0xb')][_0x00b6('0x32')]=function(_0x1a097b,_0x452d8d,_0x830306,_0x147e52){this[_0x00b6('0xd')]['createSquareRecording']({'uniqueid':this[_0x00b6('0x2f')]['uniqueid'],'callerid':this[_0x00b6('0x2f')][_0x00b6('0x31')],'calleridname':this['channel'][_0x00b6('0x33')],'context':this['channel']['context'],'extension':this[_0x00b6('0x2f')][_0x00b6('0x34')],'priority':this[_0x00b6('0x2f')][_0x00b6('0x35')],'accountcode':this[_0x00b6('0x2f')][_0x00b6('0x36')],'dnid':this[_0x00b6('0x2f')][_0x00b6('0x37')],'projectName':this['channel'][_0x00b6('0x30')],'saveName':_0x452d8d,'filename':_0x1a097b[_0x00b6('0x38')]||_0x452d8d,'savePath':_0x830306})['then'](function(_0xa320dc){_0x147e52(null,_0xa320dc);})[_0x00b6('0x10')](function(_0x5801d4){_0x147e52(_0x5801d4);});};AGIVertices[_0x00b6('0xb')][_0x00b6('0x39')]=function(_0x19f09d,_0x5e0583,_0x1ef63a){this[_0x00b6('0xd')]['createSquareMessage']({'uniqueid':this[_0x00b6('0x2f')][_0x00b6('0x2c')],'body':_0x19f09d,'direction':_0x5e0583})['then'](function(_0x402e0f){if(_0x1ef63a){_0x1ef63a(null,_0x402e0f);}})[_0x00b6('0x10')](function(_0x387072){if(_0x1ef63a){_0x1ef63a(_0x387072);}});};AGIVertices[_0x00b6('0xb')][_0x00b6('0x3a')]=function(_0x2a7108,_0x4178da){this['rpc']['createCmContact']({'firstName':_['isEmpty'](_0x2a7108['name'])||_[_0x00b6('0x3b')](_0x2a7108[_0x00b6('0xf')])?_0x00b6('0x3c')+Math[_0x00b6('0x3d')]():_0x2a7108[_0x00b6('0xf')],'lastName':_[_0x00b6('0x3e')](_0x2a7108[_0x00b6('0x3f')])||_[_0x00b6('0x3b')](_0x2a7108[_0x00b6('0x3f')])?null:_0x2a7108[_0x00b6('0x3f')],'phone':_0x2a7108['phone'],'ListId':_0x2a7108[_0x00b6('0x40')],'scheduledAt':_0x2a7108[_0x00b6('0x41')],'callbackUniqueid':this['channel']['uniqueid'],'tags':_0x00b6('0x42'),'description':_0x00b6('0x43')+_0x2a7108['scheduledAt'][_0x00b6('0x44')](),'priority':_0x2a7108[_0x00b6('0x45')]})[_0x00b6('0x12')](function(_0x28a0cd){_0x4178da(null,_0x28a0cd);})['catch'](function(_0x2feb0c){_0x4178da(_0x2feb0c);});};AGIVertices[_0x00b6('0xb')][_0x00b6('0x46')]=function(_0x57da41,_0x221490){this['rpc'][_0x00b6('0x47')](_0x57da41)['then'](function(_0x582226){_0x221490(null,_0x582226?_0x582226['name']:![]);})[_0x00b6('0x10')](function(_0x2b7450){_0x221490(_0x2b7450);});};AGIVertices[_0x00b6('0xb')][_0x00b6('0x48')]=function(_0xdf8f2a,_0x13939f,_0x27bb5e){var _0x4ed8f4={'role':_0x00b6('0x49')};_0x4ed8f4[_0xdf8f2a]=this[_0x00b6('0x2f')][_0x00b6('0x31')];this[_0x00b6('0xd')][_0x00b6('0x48')](_0x4ed8f4,_0x13939f,this[_0x00b6('0x2f')][_0x00b6('0x2c')])[_0x00b6('0x12')](function(_0x545522){_0x27bb5e(null,_[_0x00b6('0x3b')](_0x545522)?![]:!![]);})['catch'](function(_0x19f1bf){logger['error'](_0x19f1bf);_0x27bb5e(null,![]);});};AGIVertices['prototype'][_0x00b6('0x4a')]=function(_0x535857,_0x20f29d){var _0x456f08={'role':'agent'};_0x456f08[_0x535857]=this[_0x00b6('0x2f')][_0x00b6('0x31')];this[_0x00b6('0xd')][_0x00b6('0x4a')](_0x456f08)[_0x00b6('0x12')](function(_0x131408){_0x20f29d(null,_[_0x00b6('0x3b')](_0x131408)?![]:!![]);})['catch'](function(_0x11ba0d){logger['error'](_0x11ba0d);_0x20f29d(null,![]);});};AGIVertices[_0x00b6('0xb')][_0x00b6('0x4b')]=function(_0x27b272,_0x5532fa){var _0x226ccc={'role':_0x00b6('0x49')};_0x226ccc[_0x27b272]=this[_0x00b6('0x2f')][_0x00b6('0x31')];this[_0x00b6('0xd')]['agentLogout'](_0x226ccc)['then'](function(_0x3d8a72){_0x5532fa(null,_[_0x00b6('0x3b')](_0x3d8a72)?![]:!![]);})[_0x00b6('0x10')](function(_0x2447c1){logger[_0x00b6('0x4c')](_0x2447c1);_0x5532fa(null,![]);});};AGIVertices['prototype'][_0x00b6('0x4d')]=function(_0x25170f,_0x2f67e2){var _0xf4f618={'role':'agent'};_0xf4f618[_0x25170f]=this[_0x00b6('0x2f')]['callerid'];var _0x1ffc58=_0x25170f!=_0x00b6('0x4e')?util[_0x00b6('0x20')](_0x00b6('0x4f'),'LOCAL',this['channel'][_0x00b6('0x31')]):undefined;this[_0x00b6('0xd')]['agentLogin'](_0xf4f618,_0x1ffc58)['then'](function(_0x4d0b00){_0x2f67e2(null,_[_0x00b6('0x3b')](_0x4d0b00)?![]:!![]);})[_0x00b6('0x10')](function(_0x567198){logger['error'](_0x567198);_0x2f67e2(null,![]);});};AGIVertices[_0x00b6('0xb')][_0x00b6('0x50')]=function(_0x1a8bc5,_0x2701e5){sh['exec'](_[_0x00b6('0x51')](_0x1a8bc5),function(_0x3347be,_0x428d4e){var _0x3f512b=_0x428d4e[_0x00b6('0x52')](/(\r\n|\n|\r)/gm,'');_0x2701e5(null,_0x3f512b);});};AGIVertices[_0x00b6('0xb')][_0x00b6('0x53')]=function(_0x3d433a,_0x35216e){scripts[_0x00b6('0x53')](_0x3d433a[_0x00b6('0x54')],_0x3d433a[_0x00b6('0x55')]||'en',0x1)[_0x00b6('0x12')](function(_0x379633){_0x35216e(null,_0x379633);})['catch'](function(_0x261a0d){_0x35216e(_0x261a0d);});};AGIVertices['prototype'][_0x00b6('0x56')]=function(_0x3588be,_0x2528b3){scripts[_0x00b6('0x56')](this['channel'][_0x00b6('0x2c')],_0x3588be[_0x00b6('0x57')],_0x3588be[_0x00b6('0x54')],_0x3588be[_0x00b6('0x58')]||'en')[_0x00b6('0x12')](function(_0x1424c0){_0x2528b3(null,_0x1424c0);})[_0x00b6('0x10')](function(_0x10ee1f){_0x2528b3(_0x10ee1f);});};AGIVertices['prototype'][_0x00b6('0x59')]=function(_0x30ba4d,_0x20125d){scripts[_0x00b6('0x59')](this['channel'],_0x30ba4d)[_0x00b6('0x12')](function(_0x3dc18f){_0x20125d(null,_0x3dc18f);})[_0x00b6('0x10')](function(_0x4bed7e){_0x20125d(_0x4bed7e);});};AGIVertices['prototype'][_0x00b6('0x5a')]=function(_0x4d03db,_0x41aabe){scripts[_0x00b6('0x5a')](_0x4d03db[_0x00b6('0x57')],_0x4d03db[_0x00b6('0x54')],_0x4d03db['ispeech_tts_language']||'en-US',_0x4d03db['speed'])[_0x00b6('0x12')](function(_0x37ae4a){_0x41aabe(null,_0x37ae4a);})[_0x00b6('0x10')](function(_0x3cfe87){_0x41aabe(_0x3cfe87);});};AGIVertices[_0x00b6('0xb')][_0x00b6('0x5b')]=function(_0x1fbba9,_0x1e3c0f,_0x44efce){scripts[_0x00b6('0x5b')](_0x1e3c0f,_0x1fbba9['key'],_0x1fbba9['ispeech_asr_language']||_0x00b6('0x5c'),this[_0x00b6('0x5d')](_0x1fbba9['model'])?_0x1fbba9[_0x00b6('0x5e')]:undefined)[_0x00b6('0x12')](function(_0x1a9b5c){_0x44efce(null,_0x1a9b5c);})['catch'](function(_0x5097b3){_0x44efce(_0x5097b3);});};AGIVertices[_0x00b6('0xb')][_0x00b6('0x5f')]=function(_0x24dd1f,_0x992947){scripts['awsPolly'](_0x24dd1f[_0x00b6('0x60')],_0x24dd1f[_0x00b6('0x61')],_0x24dd1f['aws_polly_region'],_0x24dd1f[_0x00b6('0x62')]||'Amy',_0x24dd1f[_0x00b6('0x54')],_0x24dd1f[_0x00b6('0x63')]||_0x00b6('0x54'))[_0x00b6('0x12')](function(_0x3a391e){_0x992947(null,_0x3a391e);})['catch'](function(_0x2b45ec){_0x992947(_0x2b45ec);});};AGIVertices[_0x00b6('0xb')]['awsLex']=function(_0x33bbd2,_0x19b008){scripts[_0x00b6('0x64')](this['channel'][_0x00b6('0x2c')],_0x33bbd2[_0x00b6('0x60')],_0x33bbd2[_0x00b6('0x61')],_0x33bbd2[_0x00b6('0x65')],_0x33bbd2[_0x00b6('0x54')],_0x33bbd2[_0x00b6('0x66')])['then'](function(_0x223e1d){_0x19b008(null,_0x223e1d);})[_0x00b6('0x10')](function(_0x386daf){_0x19b008(_0x386daf);});};AGIVertices['prototype'][_0x00b6('0x67')]=function(_0x3395f3,_0x573169,_0x56ed30){scripts[_0x00b6('0x67')](_0x573169,_0x3395f3[_0x00b6('0x57')],_0x3395f3['google_asr_language']||_0x00b6('0x5c'))[_0x00b6('0x12')](function(_0x5cbc44){_0x56ed30(null,_0x5cbc44);})['catch'](function(_0xad4c9a){_0x56ed30(_0xad4c9a);});};AGIVertices['prototype'][_0x00b6('0x68')]=function(_0xb8edf5,_0x367246,_0x255de8){scripts[_0x00b6('0x68')](_0x367246,_0xb8edf5[_0x00b6('0x69')],_0xb8edf5[_0x00b6('0x6a')],_0xb8edf5[_0x00b6('0x6b')])[_0x00b6('0x12')](function(_0x223fc6){_0x255de8(null,_0x223fc6);})['catch'](function(_0x15c5e3){_0x255de8(_0x15c5e3);});};AGIVertices[_0x00b6('0xb')][_0x00b6('0x6c')]=function(_0x2e8bd1){var _0x2d526c=_[_0x00b6('0x6d')](verticesWithRetry,_0x2e8bd1[_0x00b6('0x2e')])?_0x2e8bd1:_[_0x00b6('0x6e')](_0x2e8bd1);for(var _0xde9173 in _0x2d526c){if(_0x2d526c[_0x00b6('0x6f')](_0xde9173)){if(_0x2d526c[_0xde9173]&&_[_0x00b6('0x70')](_0x2d526c[_0xde9173])){_0x2d526c[_0xde9173]=this[_0x00b6('0x71')](_0x2d526c[_0xde9173]);}}}return _0x2d526c;};AGIVertices[_0x00b6('0xb')][_0x00b6('0x71')]=function(_0x6cc2e7){var _0x55eff2=_0x6cc2e7[_0x00b6('0x72')]('{');for(var _0x26bc26=0x1;_0x26bc26<_0x55eff2[_0x00b6('0x73')];_0x26bc26+=0x1){var _0x2d659c=_0x55eff2[_0x26bc26][_0x00b6('0x72')]('}');if(_0x2d659c['length']>0x1){_0x6cc2e7=_0x6cc2e7['replaceAll']('{'+_0x2d659c[0x0]+'}',this['channel']['getVariable'](_0x2d659c[0x0])['extra']||_0x2d659c[0x0]);}}if(_0x55eff2[_0x00b6('0x73')]===0x1){return _0x6cc2e7[_0x00b6('0x44')]();}return this[_0x00b6('0x71')](_0x6cc2e7);};AGIVertices[_0x00b6('0xb')][_0x00b6('0x74')]=function(_0x48af7e,_0x2c5445){var _0x3f2b39=this[_0x00b6('0x2f')]['getVariable'](_0x48af7e);if(_0x3f2b39[_0x00b6('0x75')]===-0x1){return _0x3f2b39;}logger['info'](util['format']('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x2c5445,_0x3f2b39[_0x00b6('0x76')]));return this[_0x00b6('0x2f')][_0x00b6('0x77')](_0x2c5445,_0x3f2b39[_0x00b6('0x76')]);};AGIVertices[_0x00b6('0xb')]['isConfigured']=function(_0xdb380c){return _0xdb380c&&_0xdb380c!=='0'&&_0xdb380c!=='-1'&&_0xdb380c!=='';};AGIVertices[_0x00b6('0xb')][_0x00b6('0x78')]=function(_0x2993b3){this[_0x00b6('0x2b')][_0x00b6('0x79')](this,_0x2993b3,'-');_0x2993b3['retry']=_0x2993b3[_0x00b6('0x78')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x00b6('0xb')][_0x00b6('0x5')]=function(_0x5bbf12){logger[_0x00b6('0x22')](util[_0x00b6('0x20')](_0x00b6('0x7a'),_0x5bbf12['label']));return this[_0x00b6('0x2f')][_0x00b6('0x5')]([_0x5bbf12[_0x00b6('0x7b')],_0x5bbf12['args']]);};AGIVertices[_0x00b6('0xb')][_0x00b6('0x7c')]=function(_0x17f177){logger[_0x00b6('0x22')](util[_0x00b6('0x20')](_0x00b6('0x7d'),_0x17f177[_0x00b6('0x2d')]));if(this[_0x00b6('0x5d')](_0x17f177['timeout'])){logger[_0x00b6('0x22')](util[_0x00b6('0x20')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x17f177[_0x00b6('0x7e')]));var _0x141111=this[_0x00b6('0x2f')][_0x00b6('0x7f')](_0x17f177[_0x00b6('0x7e')]);if(_0x141111[_0x00b6('0x75')]===-0x1){return _0x141111;}}return this[_0x00b6('0x2f')][_0x00b6('0x7c')]();};AGIVertices[_0x00b6('0xb')]['callback']=function(_0x3bf795){logger[_0x00b6('0x22')](util[_0x00b6('0x20')](_0x00b6('0x80'),_0x3bf795[_0x00b6('0x2d')]));if(!this[_0x00b6('0x5d')](_0x3bf795['list_id'])){return this[_0x00b6('0x2f')][_0x00b6('0x4c')](_0x3bf795,'no\x20list\x20selected');}_0x3bf795[_0x00b6('0x41')]=moment();if(this[_0x00b6('0x5d')](_0x3bf795[_0x00b6('0x81')])){_0x3bf795['scheduledAt']=moment()['add'](_0x3bf795[_0x00b6('0x81')],_0x00b6('0x82'));}if(!this[_0x00b6('0x5d')](_0x3bf795[_0x00b6('0x45')])){_0x3bf795[_0x00b6('0x45')]=0x2;}this[_0x00b6('0x3a')][_0x00b6('0x79')](this,_0x3bf795);return this[_0x00b6('0x2f')]['noop'](util[_0x00b6('0x20')](_0x00b6('0x83'),_0x3bf795[_0x00b6('0x84')],_0x3bf795[_0x00b6('0x40')],_0x3bf795[_0x00b6('0x41')]));};AGIVertices[_0x00b6('0xb')][_0x00b6('0x85')]=function(_0x152328){logger[_0x00b6('0x22')](util['format']('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x152328[_0x00b6('0x2d')]));var _0x55e21b=this[_0x00b6('0x2f')]['exec'](_0x152328['application'],_0x152328['options']);if(_0x55e21b[_0x00b6('0x75')]===-0x1){return _0x55e21b;}return this[_0x00b6('0x2f')][_0x00b6('0x86')](util[_0x00b6('0x20')]('Executed\x20command\x20%s\x20%s',_0x152328[_0x00b6('0x87')],_0x152328[_0x00b6('0x88')]));};AGIVertices['prototype'][_0x00b6('0x89')]=function(_0x4017cd){logger[_0x00b6('0x22')](util['format'](_0x00b6('0x8a'),_0x4017cd[_0x00b6('0x2d')]));if(!this[_0x00b6('0x5d')](_0x4017cd[_0x00b6('0x54')])){return this[_0x00b6('0x2f')]['noop'](_0x00b6('0x8b'));}var _0x38c532='\x22'+_0x4017cd['text']+'\x22';if(this['isConfigured'](_0x4017cd[_0x00b6('0x88')])){_0x38c532+=','+_0x4017cd['options'];}var _0x29a2e3=this[_0x00b6('0x2f')][_0x00b6('0x8c')](_0x00b6('0x8d'),_0x38c532);if(_0x29a2e3['result']===-0x1){return _0x29a2e3;}return this[_0x00b6('0x2f')]['noop'](util[_0x00b6('0x20')](_0x00b6('0x8e'),_0x38c532));};AGIVertices[_0x00b6('0xb')]['sestektts']=function(_0x2c46f4){logger['info'](util[_0x00b6('0x20')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x2c46f4['label']));if(!this[_0x00b6('0x5d')](_0x2c46f4[_0x00b6('0x54')])){return this[_0x00b6('0x2f')][_0x00b6('0x86')](_0x00b6('0x8b'));}var _0x4a56da='\x22'+_0x2c46f4[_0x00b6('0x54')]+'\x22';if(this[_0x00b6('0x5d')](_0x2c46f4['options'])){_0x4a56da+=','+_0x2c46f4['options'];}var _0x47449f=this[_0x00b6('0x2f')][_0x00b6('0x8c')](_0x00b6('0x8d'),_0x4a56da);if(_0x47449f['result']===-0x1){return _0x47449f;}return this[_0x00b6('0x2f')][_0x00b6('0x86')](util[_0x00b6('0x20')](_0x00b6('0x8e'),_0x4a56da));};AGIVertices['prototype'][_0x00b6('0x8f')]=function(_0x40ef9b){logger['info'](util[_0x00b6('0x20')](_0x00b6('0x90'),_0x40ef9b[_0x00b6('0x2d')]));if(!this[_0x00b6('0x5d')](_0x40ef9b['grammar'])){return this[_0x00b6('0x2f')][_0x00b6('0x86')](_0x00b6('0x91'));}var _0x4d5fa0=_0x40ef9b[_0x00b6('0x92')];if(this['isConfigured'](_0x40ef9b[_0x00b6('0x88')])){_0x4d5fa0+=','+_0x40ef9b['options'];}var _0x2f4fbe=this['channel'][_0x00b6('0x8c')](_0x00b6('0x93'),_0x4d5fa0);if(_0x2f4fbe[_0x00b6('0x75')]===-0x1){return _0x2f4fbe;}var _0x4328de=this[_0x00b6('0x74')](_0x00b6('0x94'),'LUMENVOX_ASR_CONFIDENCE');if(_0x4328de['result']===-0x1){return _0x4328de;}var _0x55f964=this[_0x00b6('0x74')](_0x00b6('0x95'),_0x00b6('0x96'));if(_0x55f964['result']===-0x1){return _0x55f964;}var _0x836aa0=this['getAndSetVariable'](_0x00b6('0x97'),'LUMENVOX_ASR_INSTANCE');if(_0x836aa0[_0x00b6('0x75')]===-0x1){return _0x836aa0;}return this['channel']['noop'](util[_0x00b6('0x20')](_0x00b6('0x98'),_0x4d5fa0));};AGIVertices[_0x00b6('0xb')][_0x00b6('0x99')]=function(_0x2b942c){logger[_0x00b6('0x22')](util[_0x00b6('0x20')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x2b942c[_0x00b6('0x2d')]));if(!this[_0x00b6('0x5d')](_0x2b942c[_0x00b6('0x92')])){return this[_0x00b6('0x2f')]['noop'](_0x00b6('0x91'));}var _0x1c1933=_0x2b942c['grammar'];if(this[_0x00b6('0x5d')](_0x2b942c[_0x00b6('0x88')])){_0x1c1933+=','+_0x2b942c[_0x00b6('0x88')];}var _0x299684=this[_0x00b6('0x2f')]['exec'](_0x00b6('0x93'),_0x1c1933);if(_0x299684[_0x00b6('0x75')]===-0x1){return _0x299684;}var _0x2d4d23=this[_0x00b6('0x74')](_0x00b6('0x94'),_0x00b6('0x9a'));if(_0x2d4d23['result']===-0x1){return _0x2d4d23;}var _0x40fdfe=this[_0x00b6('0x74')]('RECOG_INPUT()',_0x00b6('0x9b'));if(_0x40fdfe[_0x00b6('0x75')]===-0x1){return _0x40fdfe;}var _0xc82edd=this[_0x00b6('0x74')]('RECOG_INSTANCE()','SESTEK_ASR_INSTANCE');if(_0xc82edd[_0x00b6('0x75')]===-0x1){return _0xc82edd;}return this[_0x00b6('0x2f')][_0x00b6('0x86')](util['format'](_0x00b6('0x98'),_0x1c1933));};AGIVertices[_0x00b6('0xb')][_0x00b6('0x9c')]=function(_0x8806fe){logger[_0x00b6('0x22')](util[_0x00b6('0x20')](_0x00b6('0x9d'),_0x8806fe[_0x00b6('0x2d')]));if(!this[_0x00b6('0x5d')](_0x8806fe[_0x00b6('0x9e')])){return this['channel']['error'](_0x8806fe,'no\x20database\x20selected');}var _0x3804f9=this[_0x00b6('0x9f')][_0x00b6('0x79')](this,_0x8806fe[_0x00b6('0x9e')]);if(!_0x3804f9){return this[_0x00b6('0x2f')][_0x00b6('0x4c')](_0x8806fe,_0x00b6('0xa0'));}if(!this['isConfigured'](_0x8806fe[_0x00b6('0x23')])){return this[_0x00b6('0x2f')][_0x00b6('0x4c')](_0x8806fe,_0x00b6('0xa1'));}var _0x1d856b=_0x8806fe[_0x00b6('0x23')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x00b6('0x2f')][_0x00b6('0x86')](util[_0x00b6('0x20')](_0x00b6('0xa2'),_0x1d856b));var _0x5f8df1=this['getQueryOdbc']['sync'](this,_0x3804f9,_0x1d856b);this[_0x00b6('0x2b')][_0x00b6('0x79')](this,_0x8806fe,_0x1d856b);if(!this[_0x00b6('0x5d')](_0x8806fe[_0x00b6('0xa3')])){return this[_0x00b6('0x2f')][_0x00b6('0x86')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x566502=this[_0x00b6('0xc')][_0x00b6('0x79')](this,_0x8806fe['variable_id']);if(!_0x566502){return this[_0x00b6('0x2f')][_0x00b6('0x4c')](_0x8806fe,_0x00b6('0xa4'));}var _0x5abe19=this;_0x5f8df1[_0x00b6('0xa5')](function(_0x33d1ba,_0x315c57){Object[_0x00b6('0xa6')](_0x33d1ba)[_0x00b6('0xa5')](function(_0x1e84b1){_0x5abe19[_0x00b6('0x2f')][_0x00b6('0x77')](util[_0x00b6('0x20')]('%s[%s][%s]',_0x566502,_0x315c57,_0x1e84b1),_0x33d1ba[_0x1e84b1]);});});this['channel'][_0x00b6('0x77')](util['format'](_0x00b6('0xa7'),_0x566502),_0x5f8df1[_0x00b6('0x73')]);return this[_0x00b6('0x2f')]['noop'](util[_0x00b6('0x20')](_0x00b6('0xa8'),_0x566502));};AGIVertices[_0x00b6('0xb')][_0x00b6('0xa9')]=function(_0xd0afdf){logger[_0x00b6('0xaa')](util[_0x00b6('0x20')](_0x00b6('0xab'),_0xd0afdf[_0x00b6('0x2d')]));if(!this['isConfigured'](_0xd0afdf['sip_id'])){return this[_0x00b6('0x2f')]['error'](_0xd0afdf,_0x00b6('0xac'));}var _0x46d323=this[_0x00b6('0xad')][_0x00b6('0x79')](this,_0xd0afdf[_0x00b6('0xae')]);if(!_0x46d323){return this[_0x00b6('0x2f')][_0x00b6('0x4c')](_0xd0afdf,'no\x20user\x20found');}var _0x5782ce=this['channel'][_0x00b6('0x8c')]('DIAL',[util['format']('SIP/%s',_0x46d323),_0xd0afdf['timeout'],_0xd0afdf['opts'],_0xd0afdf['url']]);if(_0x5782ce[_0x00b6('0x75')]===-0x1){return _0x5782ce;}return this[_0x00b6('0x2f')][_0x00b6('0x86')](util[_0x00b6('0x20')](_0x00b6('0xaf'),_0x00b6('0xb0')));};AGIVertices[_0x00b6('0xb')]['dialogflow']=function(_0x1fba37){logger['info'](util[_0x00b6('0x20')](_0x00b6('0xb1'),_0x1fba37[_0x00b6('0x2d')]));if(!this['isConfigured'](_0x1fba37['key'])){return this[_0x00b6('0x2f')]['noop'](_0x00b6('0xb2'));}if(!this[_0x00b6('0x5d')](_0x1fba37[_0x00b6('0x54')])){return this['channel']['noop'](_0x00b6('0x8b'));}this[_0x00b6('0x2f')][_0x00b6('0xb3')]=!![];this['createSquareDetailsReport'](_0x1fba37);this[_0x00b6('0x39')](_0x1fba37['text'],'in');this[_0x00b6('0x2f')][_0x00b6('0x86')](util[_0x00b6('0x20')]('Trying\x20Dialogflow:\x20%s',_0x1fba37[_0x00b6('0x54')]));var _0x444e40=this['googleDialogflow']['sync'](this,_0x1fba37);if(_0x444e40){for(var _0x2046ea in _0x444e40){if(_0x444e40[_0x00b6('0x6f')](_0x2046ea)){this['channel'][_0x00b6('0x77')](util[_0x00b6('0x20')]('DIALOGFLOW_%s',_0x2046ea[_0x00b6('0xb4')]()),_0x444e40[_0x2046ea]);}}this[_0x00b6('0x39')](_0x444e40[_0x00b6('0xb5')],'out');return this[_0x00b6('0x2f')][_0x00b6('0x86')](util['format'](_0x00b6('0xb6'),_0x444e40[_0x00b6('0xb5')]));}return this[_0x00b6('0x2f')]['error'](_0x1fba37,'Dialogflow\x20is\x20unreachable');};AGIVertices['prototype'][_0x00b6('0xb7')]=function(_0x21386e){logger[_0x00b6('0x22')](util[_0x00b6('0x20')](_0x00b6('0xb8'),_0x21386e[_0x00b6('0x2d')]));if(!this[_0x00b6('0x5d')](_0x21386e[_0x00b6('0xb9')])){return this[_0x00b6('0x2f')][_0x00b6('0x86')](_0x00b6('0xba'));}if(!this[_0x00b6('0x5d')](_0x21386e['username'])){return this[_0x00b6('0x2f')][_0x00b6('0x86')]('no\x20username\x20configured');}if(!this['isConfigured'](_0x21386e[_0x00b6('0xbb')])){return this[_0x00b6('0x2f')][_0x00b6('0x86')](_0x00b6('0xbc'));}if(!this[_0x00b6('0x5d')](_0x21386e[_0x00b6('0xbd')])){return this[_0x00b6('0x2f')]['noop'](_0x00b6('0x8b'));}this[_0x00b6('0x2f')][_0x00b6('0xb3')]=!![];this['createSquareDetailsReport'](_0x21386e);this[_0x00b6('0x39')](_0x21386e['text'],'in');this[_0x00b6('0x2f')]['noop'](util[_0x00b6('0x20')]('Trying\x20SestekNDA:\x20%s',_0x21386e['text']));var _0x1e81f2=this[_0x00b6('0x59')][_0x00b6('0x79')](this,_0x21386e);if(_0x1e81f2){for(var _0x50be1e in _0x1e81f2){if(_0x1e81f2['hasOwnProperty'](_0x50be1e)){this[_0x00b6('0x2f')][_0x00b6('0x77')](util[_0x00b6('0x20')]('SESTEK_NDA_%s',_0x50be1e['toUpperCase']()),_0x1e81f2[_0x50be1e]);}}this[_0x00b6('0x39')](_0x1e81f2['speech'],_0x00b6('0xbe'));if(_0x1e81f2['audiofile']){this['channel']['noop'](util[_0x00b6('0x20')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x1e81f2[_0x00b6('0xbf')]));var _0x184533=this['channel'][_0x00b6('0xc0')](_0x1e81f2[_0x00b6('0xbf')]);try{fs['unlink'](_0x1e81f2[_0x00b6('0xbf')]+_0x00b6('0xc1'));}catch(_0x34ee11){logger[_0x00b6('0x4c')](_0x34ee11);}return _0x184533;}else{return this[_0x00b6('0x2f')][_0x00b6('0x86')](util[_0x00b6('0x20')](_0x00b6('0xc2'),_0x1e81f2[_0x00b6('0xb5')]));}}return this['channel'][_0x00b6('0x4c')](_0x21386e,_0x00b6('0xc3'));};AGIVertices['prototype'][_0x00b6('0xc4')]=function(_0x3a0a12){logger[_0x00b6('0x22')](util[_0x00b6('0x20')](_0x00b6('0xc5'),_0x3a0a12['label']));return this['channel'][_0x00b6('0x86')]('end');};AGIVertices['prototype']['ext_dial']=function(_0x26ae44){logger[_0x00b6('0x22')](util['format'](_0x00b6('0xc6'),_0x26ae44[_0x00b6('0x2d')]));var _0x195ffc='';if(_0x26ae44[_0x00b6('0xc7')]){if(!this['isConfigured'](_0x26ae44[_0x00b6('0xc7')])){return this[_0x00b6('0x2f')][_0x00b6('0x4c')](_0x26ae44,_0x00b6('0xc8'));}else{var _0x244c07=parseInt(_0x26ae44['trunk_id'],0xa);if(isNaN(_0x244c07)){_0x195ffc=_0x26ae44['trunk_id'];}else{_0x195ffc=this[_0x00b6('0xc9')][_0x00b6('0x79')](this,_0x26ae44[_0x00b6('0xc7')]);if(!_0x195ffc){return this[_0x00b6('0x2f')][_0x00b6('0x4c')](_0x26ae44,_0x00b6('0xca'));}}}}else if(_0x26ae44[_0x00b6('0xcb')]){_0x195ffc=_0x26ae44[_0x00b6('0xcb')];}else{return this[_0x00b6('0x2f')]['error'](_0x26ae44,'no\x20trunk\x20selected');}var _0x477f66=this[_0x00b6('0x2f')][_0x00b6('0x8c')]('DIAL',[util['format'](_0x00b6('0xcc'),_0x195ffc,_0x26ae44[_0x00b6('0x84')]),_0x26ae44[_0x00b6('0x7e')],_0x26ae44[_0x00b6('0xcd')],_0x26ae44[_0x00b6('0xce')]]);if(_0x477f66[_0x00b6('0x75')]===-0x1){return _0x477f66;}return this[_0x00b6('0x2f')][_0x00b6('0x86')](util[_0x00b6('0x20')]('Executed\x20command\x20%s','DIAL'));};AGIVertices['prototype'][_0x00b6('0xcf')]=function(_0x9d6c5a){logger[_0x00b6('0x22')](util[_0x00b6('0x20')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x9d6c5a[_0x00b6('0x2d')]));return this[_0x00b6('0x2f')]['noop'](_0x00b6('0xcf'));};AGIVertices[_0x00b6('0xb')][_0x00b6('0x8')]=function(_0x4fd905){logger[_0x00b6('0x22')](util['format'](_0x00b6('0xd0'),_0x4fd905[_0x00b6('0x2d')]));if(_0x4fd905[_0x00b6('0xd1')]===0x0){return this[_0x00b6('0x78')](_0x4fd905);}_0x4fd905[_0x00b6('0xd1')]-=0x1;if(!this[_0x00b6('0x5d')](_0x4fd905['file_id'])){return this[_0x00b6('0x2f')][_0x00b6('0x4c')](_0x4fd905,_0x00b6('0xd2'));}var _0x286cec=this[_0x00b6('0x15')][_0x00b6('0x79')](this,_0x4fd905[_0x00b6('0xd3')]);if(!_0x286cec){return this['channel'][_0x00b6('0x4c')](_0x4fd905,'no\x20file\x20audio\x20found');}if(!this['isConfigured'](_0x4fd905[_0x00b6('0xa3')])){return this[_0x00b6('0x2f')][_0x00b6('0x4c')](_0x00b6('0xd4'));}var _0x2ea202=this[_0x00b6('0x2f')][_0x00b6('0xd5')](_0x286cec,_0x4fd905[_0x00b6('0xd6')],_0x4fd905['maxdigit']);var _0x3a7c11=_0x2ea202['result']?_0x2ea202[_0x00b6('0x75')]['toString']():'';logger[_0x00b6('0x22')](_0x00b6('0xd7'),JSON['stringify'](_0x2ea202));if(_0x2ea202[_0x00b6('0x75')]===-0x1){this[_0x00b6('0x2b')][_0x00b6('0x79')](this,_0x4fd905,_0x3a7c11);return _0x2ea202;}else if(_0x2ea202[_0x00b6('0x76')]===_0x00b6('0x7e')){_0x2ea202['result']=_0x3a7c11['length']>=parseInt(_0x4fd905['mindigit'])?'x':'i';}else{_0x2ea202[_0x00b6('0x75')]=_0x3a7c11[_0x00b6('0x73')]>=parseInt(_0x4fd905[_0x00b6('0xd8')])&&_0x3a7c11[_0x00b6('0x73')]<=parseInt(_0x4fd905[_0x00b6('0xd9')])?'x':'i';}var _0x40ce6b=this[_0x00b6('0xc')][_0x00b6('0x79')](this,_0x4fd905[_0x00b6('0xa3')]);if(!_0x40ce6b){return this[_0x00b6('0x2f')][_0x00b6('0x4c')](_0x4fd905,_0x00b6('0xa4'));}this[_0x00b6('0x2f')][_0x00b6('0x77')](_0x40ce6b,_0x3a7c11);if(this[_0x00b6('0x5d')](_0x4fd905['hiddendigitsnum'])){var _0x18bfaf=parseInt(_0x4fd905[_0x00b6('0xda')],0xa);var _0x3407a6=rs[_0x00b6('0xdb')]({'charset':'*','length':_0x18bfaf});var _0x120ead=_0x3a7c11[_0x00b6('0x73')];if(_0x120ead>0x0){if(_0x120ead>_0x18bfaf){this['createSquareDetailsReport']['sync'](this,_0x4fd905,_0x4fd905[_0x00b6('0xdc')]===_0x00b6('0xdd')?_0x3407a6+_0x3a7c11[_0x00b6('0xde')](_0x18bfaf):_0x3a7c11[_0x00b6('0xde')](0x0,_0x120ead-_0x18bfaf)+_0x3407a6);}else{this[_0x00b6('0x2b')][_0x00b6('0x79')](this,_0x4fd905,rs[_0x00b6('0xdb')]({'charset':'*','length':_0x120ead}));}}else{this[_0x00b6('0x2b')][_0x00b6('0x79')](this,_0x4fd905,'');}}else{this['createSquareDetailsReport'][_0x00b6('0x79')](this,_0x4fd905,_0x3a7c11);}return _0x2ea202;};AGIVertices[_0x00b6('0xb')][_0x00b6('0x9')]=function(_0x199053){logger[_0x00b6('0x22')](util[_0x00b6('0x20')](_0x00b6('0xdf'),_0x199053[_0x00b6('0x2d')]));return this[_0x00b6('0x8')](_0x199053);};AGIVertices['prototype'][_0x00b6('0xe0')]=function(_0x20ad1e){logger['info'](util[_0x00b6('0x20')](_0x00b6('0xe1'),_0x20ad1e[_0x00b6('0x2d')]));this[_0x00b6('0x2b')][_0x00b6('0x79')](this,_0x20ad1e,_0x20ad1e[_0x00b6('0xe2')]);return this[_0x00b6('0x2f')]['noop'](util['format'](_0x00b6('0xe3'),_0x20ad1e[_0x00b6('0xe2')]));};AGIVertices[_0x00b6('0xb')][_0x00b6('0xe4')]=function(_0x129739){logger['info'](util[_0x00b6('0x20')](_0x00b6('0xe5'),_0x129739[_0x00b6('0x2d')]));if(!this[_0x00b6('0x5d')](_0x129739[_0x00b6('0x60')])||!this['isConfigured'](_0x129739[_0x00b6('0x61')])){return this[_0x00b6('0x2f')][_0x00b6('0x86')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x00b6('0x5d')](_0x129739[_0x00b6('0x54')])){return this['channel'][_0x00b6('0x86')](_0x00b6('0x8b'));}this['channel'][_0x00b6('0x86')](util[_0x00b6('0x20')](_0x00b6('0xe6'),_0x129739['text']));var _0x5377ee=this['awsPolly']['sync'](this,_0x129739);if(_0x5377ee){this['channel'][_0x00b6('0x86')](util[_0x00b6('0x20')]('aws\x20Polly\x20%s\x20file\x20created',_0x5377ee));var _0x1f481a=this[_0x00b6('0x2f')][_0x00b6('0xc0')](_0x5377ee);try{fs['unlink'](_0x5377ee+_0x00b6('0xc1'));}catch(_0x28742b){logger[_0x00b6('0x4c')](_0x28742b);}return _0x1f481a;}return this[_0x00b6('0x2f')]['error'](_0x129739,_0x00b6('0xe7'));};AGIVertices['prototype'][_0x00b6('0xe8')]=function(_0x5056c8){logger[_0x00b6('0x22')](util[_0x00b6('0x20')](_0x00b6('0xe9'),_0x5056c8[_0x00b6('0x2d')]));if(!this[_0x00b6('0x5d')](_0x5056c8[_0x00b6('0x60')])||!this['isConfigured'](_0x5056c8[_0x00b6('0x61')])){return this['channel'][_0x00b6('0x86')](_0x00b6('0xea'));}if(!this[_0x00b6('0x5d')](_0x5056c8[_0x00b6('0x66')])){return this[_0x00b6('0x2f')][_0x00b6('0x86')]('no\x20bot\x20name\x20configured');}if(!this['isConfigured'](_0x5056c8[_0x00b6('0x54')])){return this[_0x00b6('0x2f')]['noop'](_0x00b6('0x8b'));}this[_0x00b6('0x2f')][_0x00b6('0xb3')]=!![];this[_0x00b6('0x2b')](_0x5056c8);this[_0x00b6('0x39')](_0x5056c8[_0x00b6('0x54')],'in');this[_0x00b6('0x2f')][_0x00b6('0x86')](util[_0x00b6('0x20')](_0x00b6('0xeb'),_0x5056c8[_0x00b6('0x54')]));var _0x3b0726=this['awsLex']['sync'](this,_0x5056c8);if(_0x3b0726){for(var _0x38956f in _0x3b0726){if(_0x3b0726['hasOwnProperty'](_0x38956f)&&_['isString'](_0x3b0726[_0x38956f])){this[_0x00b6('0x2f')][_0x00b6('0x77')](util[_0x00b6('0x20')](_0x00b6('0xec'),_0x38956f[_0x00b6('0xb4')]()),_0x3b0726[_0x38956f]);}}if(_[_0x00b6('0x3b')](_0x3b0726[_0x00b6('0xed')])){return this[_0x00b6('0x2f')][_0x00b6('0x86')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x00b6('0x39')](_0x3b0726[_0x00b6('0xed')],'out');return this[_0x00b6('0x2f')][_0x00b6('0x86')](util[_0x00b6('0x20')]('Amazon\x20Lex\x20Result\x20%s',_0x3b0726[_0x00b6('0xed')]));}}return this[_0x00b6('0x2f')][_0x00b6('0x4c')](_0x5056c8,_0x00b6('0xee'));};AGIVertices[_0x00b6('0xb')][_0x00b6('0xef')]=function(_0xf23d0d){logger['info'](util[_0x00b6('0x20')](_0x00b6('0xf0'),_0xf23d0d[_0x00b6('0x2d')],_0xf23d0d['timeout']));if(!this[_0x00b6('0x5d')](_0xf23d0d[_0x00b6('0x57')])){return this[_0x00b6('0x2f')]['noop'](_0x00b6('0xb2'));}var _0x4c0ca0=_0x00b6('0xf1');var _0x471bf0=util[_0x00b6('0x20')]('%s/recordings/%s',FILES_PATH,rs[_0x00b6('0xdb')](0x4));var _0x4f77fc=util[_0x00b6('0x20')]('%s.%s',_0x471bf0,_0x4c0ca0);var _0x38b44b=!![];if(_0xf23d0d[_0x00b6('0xf2')]===_0x00b6('0xf3')){_0x38b44b=![];}var _0x5d6bc1=this['channel'][_0x00b6('0xf4')](_0x471bf0,_0x4c0ca0,_0xf23d0d[_0x00b6('0xf5')],_0xf23d0d[_0x00b6('0x7e')],undefined,_0x38b44b);if(_0x5d6bc1[_0x00b6('0x75')]!==-0x1){this['channel']['noop'](util[_0x00b6('0x20')](_0x00b6('0xf6'),_0x4f77fc));var _0x12a1dd=this[_0x00b6('0x67')][_0x00b6('0x79')](this,_0xf23d0d,_0x4f77fc);if(_0x12a1dd){for(var _0xde1019 in _0x12a1dd){if(_0x12a1dd['hasOwnProperty'](_0xde1019)){this[_0x00b6('0x2f')][_0x00b6('0x77')](util[_0x00b6('0x20')]('GOOGLE_ASR_%s',_0xde1019[_0x00b6('0xb4')]()),_0x12a1dd[_0xde1019]);}}return this[_0x00b6('0x2f')][_0x00b6('0x86')](util['format'](_0x00b6('0xf7'),JSON[_0x00b6('0xf8')](_0x12a1dd)));}}return _0x5d6bc1;};AGIVertices['prototype'][_0x00b6('0xf9')]=function(_0x56b17c){logger[_0x00b6('0x22')](util[_0x00b6('0x20')](_0x00b6('0xfa'),_0x56b17c['label']));if(!this['isConfigured'](_0x56b17c[_0x00b6('0x69')])){return this[_0x00b6('0x2f')][_0x00b6('0x86')]('no\x20appid\x20configured');}if(!this[_0x00b6('0x5d')](_0x56b17c[_0x00b6('0x6a')])){return this[_0x00b6('0x2f')][_0x00b6('0x86')](_0x00b6('0xfb'));}var _0x51bddf=_0x00b6('0xf1');var _0x548137=util['format'](_0x00b6('0xfc'),FILES_PATH,rs[_0x00b6('0xdb')](0x4));var _0x5b6a8c=util[_0x00b6('0x20')]('%s.%s',_0x548137,_0x51bddf);var _0x3e6a12=!![];if(_0x56b17c[_0x00b6('0xf2')]===_0x00b6('0xf3')){_0x3e6a12=![];}var _0x3f9f45=this['channel'][_0x00b6('0xf4')](_0x548137,_0x51bddf,_0x56b17c[_0x00b6('0xf5')],_0x56b17c[_0x00b6('0x7e')],undefined,_0x3e6a12);if(_0x3f9f45[_0x00b6('0x75')]!==-0x1){this[_0x00b6('0x2f')][_0x00b6('0x86')](util[_0x00b6('0x20')](_0x00b6('0xfd'),_0x5b6a8c));var _0x6f1bb5=this[_0x00b6('0x68')][_0x00b6('0x79')](this,_0x56b17c,_0x5b6a8c);if(_0x6f1bb5){for(var _0x4ff6d9 in _0x6f1bb5){if(_0x6f1bb5[_0x00b6('0x6f')](_0x4ff6d9)){this[_0x00b6('0x2f')]['setVariable'](util[_0x00b6('0x20')]('TILDE_ASR_%s',_0x4ff6d9[_0x00b6('0xb4')]()),_0x6f1bb5[_0x4ff6d9]);}}return this['channel'][_0x00b6('0x86')](util['format'](_0x00b6('0xfe'),JSON[_0x00b6('0xf8')](_0x6f1bb5)));}}return _0x3f9f45;};AGIVertices['prototype'][_0x00b6('0xff')]=function(_0x50d48c){logger[_0x00b6('0x22')](util['format'](_0x00b6('0x100'),_0x50d48c[_0x00b6('0x2d')]));return this[_0x00b6('0x2f')][_0x00b6('0x101')](_0x50d48c[_0x00b6('0x102')],_0x50d48c['extension'],_0x50d48c[_0x00b6('0x35')]);};AGIVertices[_0x00b6('0xb')][_0x00b6('0x103')]=function(_0x4725e5){logger['info'](util['format'](_0x00b6('0x104'),_0x4725e5[_0x00b6('0x2d')]));if(!this[_0x00b6('0x5d')](_0x4725e5[_0x00b6('0x105')])){return this[_0x00b6('0x2f')]['error'](_0x4725e5,'no\x20condition\x20configured');}try{var _0x12558b=eval(_0x4725e5[_0x00b6('0x105')])?_0x00b6('0x106'):_0x00b6('0x107');this[_0x00b6('0x2f')][_0x00b6('0x86')](util[_0x00b6('0x20')](_0x00b6('0x108'),_0x4725e5['condition'],_0x12558b));return{'code':0xc8,'result':_0x12558b};}catch(_0x8a1bcd){return{'code':0xc8,'result':_0x00b6('0x107')};}};AGIVertices['prototype'][_0x00b6('0x109')]=function(_0x118360){logger[_0x00b6('0x22')](util[_0x00b6('0x20')](_0x00b6('0x10a'),_0x118360[_0x00b6('0x2d')]));if(!this['isConfigured'](_0x118360[_0x00b6('0x10b')])){return this[_0x00b6('0x2f')]['error'](_0x118360,_0x00b6('0x10c'));}var _0x201234=this[_0x00b6('0x10d')][_0x00b6('0x79')](this,_0x118360[_0x00b6('0x10b')]);if(!_0x201234){return this[_0x00b6('0x2f')][_0x00b6('0x4c')](_0x118360,_0x00b6('0x10e'));}for(var _0x761c03=0x0;_0x761c03<_0x201234[_0x00b6('0x73')];_0x761c03+=0x1){var _0x90aec3=this['channel'][_0x00b6('0xc')](util[_0x00b6('0x20')](_0x00b6('0x10f'),_0x201234[_0x761c03]));if(_0x90aec3[_0x00b6('0x75')]===-0x1){return _0x90aec3;}logger[_0x00b6('0x22')](util[_0x00b6('0x20')]('IFTIME\x20%s\x20%s',_0x201234[_0x761c03],_0x90aec3['extra']));if(_0x90aec3['extra']===_0x00b6('0x106')){logger['info'](util[_0x00b6('0x20')](_0x00b6('0x110'),_0x201234[_0x761c03],_0x00b6('0x106')));this[_0x00b6('0x2f')][_0x00b6('0x86')](util[_0x00b6('0x20')]('IFTIME\x20%s\x20%s',_0x201234[_0x761c03],_0x00b6('0x106')));return{'code':0xc8,'result':_0x00b6('0x106')};}else{logger[_0x00b6('0x22')](util[_0x00b6('0x20')](_0x00b6('0x110'),_0x201234[_0x761c03],_0x00b6('0x107')));this[_0x00b6('0x2f')]['noop'](util[_0x00b6('0x20')]('IFTIME\x20%s\x20%s',_0x201234[_0x761c03],_0x00b6('0x107')));}}return{'code':0xc8,'result':_0x00b6('0x107')};};AGIVertices[_0x00b6('0xb')]['hangup']=function(_0x40d3dc){logger[_0x00b6('0x22')](util[_0x00b6('0x20')](_0x00b6('0x111'),_0x40d3dc['label']));return this[_0x00b6('0x2f')]['hangup']();};AGIVertices[_0x00b6('0xb')][_0x00b6('0x112')]=function(_0x2e2394){logger[_0x00b6('0x22')](util[_0x00b6('0x20')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x2e2394[_0x00b6('0x2d')]));if(!this['isConfigured'](_0x2e2394[_0x00b6('0x57')])){return this[_0x00b6('0x2f')][_0x00b6('0x86')](_0x00b6('0xb2'));}var _0x3511d5='wav';var _0x431a10=util['format'](_0x00b6('0xfc'),FILES_PATH,rs[_0x00b6('0xdb')](0x4));var _0x825e1c=util[_0x00b6('0x20')]('%s.%s',_0x431a10,_0x3511d5);var _0x1c1ab7=!![];if(_0x2e2394['beep']==='NOBEEP'){_0x1c1ab7=![];}var _0x311cd7=this[_0x00b6('0x2f')][_0x00b6('0xf4')](_0x431a10,_0x3511d5,_0x2e2394[_0x00b6('0xf5')],_0x2e2394[_0x00b6('0x7e')],undefined,_0x1c1ab7);if(_0x311cd7[_0x00b6('0x75')]!==-0x1){this[_0x00b6('0x2f')][_0x00b6('0x86')](util[_0x00b6('0x20')](_0x00b6('0x113'),_0x825e1c));var _0x4ef70d=this[_0x00b6('0x5b')][_0x00b6('0x79')](this,_0x2e2394,_0x825e1c);if(_0x4ef70d){for(var _0x29ff71 in _0x4ef70d){if(_0x4ef70d['hasOwnProperty'](_0x29ff71)){this[_0x00b6('0x2f')][_0x00b6('0x77')](util[_0x00b6('0x20')](_0x00b6('0x114'),_0x29ff71[_0x00b6('0xb4')]()),_0x4ef70d[_0x29ff71]);}}return this['channel'][_0x00b6('0x86')](util[_0x00b6('0x20')]('IspeechASR\x20Result\x20%s',JSON[_0x00b6('0xf8')](_0x4ef70d)));}}return _0x311cd7;};AGIVertices['prototype'][_0x00b6('0x115')]=function(_0x2e40b9){logger[_0x00b6('0x22')](util['format']('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x2e40b9[_0x00b6('0x2d')]));if(!this[_0x00b6('0x5d')](_0x2e40b9['key'])){return this['channel'][_0x00b6('0x86')](_0x00b6('0xb2'));}if(!this['isConfigured'](_0x2e40b9[_0x00b6('0x54')])){return this[_0x00b6('0x2f')]['noop'](_0x00b6('0x8b'));}this[_0x00b6('0x2f')][_0x00b6('0x86')](util['format']('Trying\x20ispeech\x20TTS\x20%s',_0x2e40b9[_0x00b6('0x54')]));var _0x38c915=this[_0x00b6('0x5a')][_0x00b6('0x79')](this,_0x2e40b9);if(_0x38c915){this[_0x00b6('0x2f')][_0x00b6('0x86')](util[_0x00b6('0x20')]('ispeech\x20%s\x20file\x20created',_0x38c915));var _0x3b1e6e=this['channel'][_0x00b6('0xc0')](_0x38c915,_0x2e40b9[_0x00b6('0xf5')]);try{fs[_0x00b6('0x116')](_0x38c915+_0x00b6('0xc1'));}catch(_0x247720){logger['error'](_0x247720);}return _0x3b1e6e;}return this[_0x00b6('0x2f')][_0x00b6('0x4c')](_0x2e40b9,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x00b6('0xb')][_0x00b6('0x117')]=function(_0x53d49a){logger['info'](util[_0x00b6('0x20')](_0x00b6('0x118'),_0x53d49a[_0x00b6('0x2d')]));if(!this[_0x00b6('0x5d')](_0x53d49a[_0x00b6('0x119')])){return this[_0x00b6('0x2f')][_0x00b6('0x4c')](_0x53d49a,_0x00b6('0x11a'));}logger['info'](util[_0x00b6('0x20')](_0x00b6('0x11b'),this[_0x00b6('0x2f')][_0x00b6('0x31')],_0x53d49a[_0x00b6('0x119')]));var _0x15a870=this[_0x00b6('0x4d')]['sync'](this,_0x53d49a[_0x00b6('0x119')]);if(_0x15a870){logger[_0x00b6('0x22')](util[_0x00b6('0x20')](_0x00b6('0x11c'),this[_0x00b6('0x2f')][_0x00b6('0x31')],_0x53d49a[_0x00b6('0x119')]));this[_0x00b6('0x2f')]['noop'](util['format'](_0x00b6('0x11c'),this[_0x00b6('0x2f')][_0x00b6('0x31')],_0x53d49a[_0x00b6('0x119')]));return{'code':0xc8,'result':_0x00b6('0x11d')};}else{logger[_0x00b6('0x22')](util['format'](_0x00b6('0x11e'),this[_0x00b6('0x2f')][_0x00b6('0x31')],_0x53d49a['findBy']));this[_0x00b6('0x2f')][_0x00b6('0x86')](util[_0x00b6('0x20')](_0x00b6('0x11e'),this[_0x00b6('0x2f')][_0x00b6('0x31')],_0x53d49a[_0x00b6('0x119')]));return{'code':0xc8,'result':_0x00b6('0x11f')};}};AGIVertices[_0x00b6('0xb')][_0x00b6('0x120')]=function(_0x5157ac){logger[_0x00b6('0x22')](util[_0x00b6('0x20')](_0x00b6('0x121'),_0x5157ac[_0x00b6('0x2d')]));if(!this[_0x00b6('0x5d')](_0x5157ac[_0x00b6('0x119')])){return this[_0x00b6('0x2f')]['error'](_0x5157ac,'no\x20find\x20by\x20configured');}logger[_0x00b6('0x22')](util[_0x00b6('0x20')](_0x00b6('0x11b'),this[_0x00b6('0x2f')]['callerid'],_0x5157ac[_0x00b6('0x119')]));var _0x3c68f4=this[_0x00b6('0x4b')][_0x00b6('0x79')](this,_0x5157ac[_0x00b6('0x119')]);if(_0x3c68f4){logger[_0x00b6('0x22')](util[_0x00b6('0x20')](_0x00b6('0x11c'),this[_0x00b6('0x2f')][_0x00b6('0x31')],_0x5157ac[_0x00b6('0x119')]));this[_0x00b6('0x2f')][_0x00b6('0x86')](util[_0x00b6('0x20')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x00b6('0x2f')][_0x00b6('0x31')],_0x5157ac['findBy']));return{'code':0xc8,'result':_0x00b6('0x11d')};}else{logger[_0x00b6('0x22')](util[_0x00b6('0x20')](_0x00b6('0x11e'),this[_0x00b6('0x2f')][_0x00b6('0x31')],_0x5157ac[_0x00b6('0x119')]));this[_0x00b6('0x2f')][_0x00b6('0x86')](util[_0x00b6('0x20')](_0x00b6('0x11e'),this['channel'][_0x00b6('0x31')],_0x5157ac['findBy']));return{'code':0xc8,'result':_0x00b6('0x11f')};}};AGIVertices[_0x00b6('0xb')][_0x00b6('0x122')]=function(_0x1b73ca){logger[_0x00b6('0x22')](util[_0x00b6('0x20')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x1b73ca['label']));if(!this[_0x00b6('0x5d')](_0x1b73ca[_0x00b6('0x123')])){return this[_0x00b6('0x2f')]['error'](_0x1b73ca,'no\x20operation\x20configured');}this['channel'][_0x00b6('0x86')](util[_0x00b6('0x20')]('math\x20%s',_0x1b73ca[_0x00b6('0x123')]));var _0x1cb6bc=eval(_0x1b73ca['operation']);if(!this['isConfigured'](_0x1b73ca['variable_id'])){return this[_0x00b6('0x2f')][_0x00b6('0x86')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x51ac32=this[_0x00b6('0xc')]['sync'](this,_0x1b73ca[_0x00b6('0xa3')]);if(!_0x51ac32){return this[_0x00b6('0x2f')][_0x00b6('0x4c')](_0x1b73ca,'no\x20variable\x20found');}if(_[_0x00b6('0x124')](_0x1cb6bc)){var _0x175faa=this;_0x1cb6bc[_0x00b6('0xa5')](function(_0x23026d,_0x3f756b){_0x175faa[_0x00b6('0x2f')][_0x00b6('0x77')](util[_0x00b6('0x20')]('%s[%s]',_0x51ac32,_0x3f756b),_0x23026d);});return this[_0x00b6('0x2f')][_0x00b6('0x86')](util[_0x00b6('0x20')](_0x00b6('0x125'),_0x51ac32));}else{return this['channel']['setVariable'](_0x51ac32,_0x1cb6bc);}};AGIVertices[_0x00b6('0xb')][_0x00b6('0x7')]=function(_0x1f53a1){logger[_0x00b6('0x22')](util[_0x00b6('0x20')](_0x00b6('0x126'),_0x1f53a1[_0x00b6('0x2d')]));if(_0x1f53a1['retry']===0x0){return this[_0x00b6('0x78')](_0x1f53a1);}_0x1f53a1[_0x00b6('0xd1')]-=0x1;if(!this['isConfigured'](_0x1f53a1['file_id'])){return this[_0x00b6('0x2f')][_0x00b6('0x4c')](_0x1f53a1,_0x00b6('0xd2'));}var _0x43111a=this[_0x00b6('0x15')][_0x00b6('0x79')](this,_0x1f53a1[_0x00b6('0xd3')]);if(!_0x43111a){return this['channel'][_0x00b6('0x4c')](_0x1f53a1,'no\x20file\x20audio\x20found');}var _0x3b1ec0=this[_0x00b6('0x2f')]['getData'](_0x43111a,_0x1f53a1[_0x00b6('0xd6')],_0x1f53a1[_0x00b6('0x127')]);var _0x1ac6e7=_0x3b1ec0[_0x00b6('0x75')];if(_0x3b1ec0['result']===-0x1){this['createSquareDetailsReport'][_0x00b6('0x79')](this,_0x1f53a1,'-1');return _0x3b1ec0;}else if(_0x3b1ec0[_0x00b6('0x76')]===_0x00b6('0x7e')){_0x3b1ec0[_0x00b6('0x75')]=_0x3b1ec0[_0x00b6('0x75')][_0x00b6('0x73')]>0x0?_0x3b1ec0[_0x00b6('0x75')]:'t';}else if(_[_0x00b6('0x3e')](_0x3b1ec0[_0x00b6('0x75')])){_0x3b1ec0[_0x00b6('0x75')]='#';_0x1ac6e7='#';}if(!this[_0x00b6('0x5d')](_0x1f53a1[_0x00b6('0xa3')])){this[_0x00b6('0x2f')][_0x00b6('0x86')](_0x00b6('0xd4'));}else{var _0x2d611b=this[_0x00b6('0xc')][_0x00b6('0x79')](this,_0x1f53a1[_0x00b6('0xa3')]);if(!_0x2d611b){return this[_0x00b6('0x2f')][_0x00b6('0x4c')](_0x1f53a1,_0x00b6('0xa4'));}this['channel'][_0x00b6('0x77')](_0x2d611b,_0x1ac6e7);}this[_0x00b6('0x2b')][_0x00b6('0x79')](this,_0x1f53a1,_0x1ac6e7);return _0x3b1ec0;};AGIVertices[_0x00b6('0xb')][_0x00b6('0x86')]=function(_0x411c8f){logger[_0x00b6('0x22')](util[_0x00b6('0x20')](_0x00b6('0x128'),_0x411c8f[_0x00b6('0x2d')]));return this[_0x00b6('0x2f')]['noop'](_0x411c8f[_0x00b6('0x129')]||_0x411c8f[_0x00b6('0x2d')]);};AGIVertices[_0x00b6('0xb')][_0x00b6('0x12a')]=function(_0x317ccd){logger[_0x00b6('0x22')](util['format']('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x317ccd['label']));if(!this['isConfigured'](_0x317ccd['findBy'])){return this[_0x00b6('0x2f')][_0x00b6('0x4c')](_0x317ccd,'no\x20find\x20by\x20configured');}logger['info'](util['format'](_0x00b6('0x11b'),this[_0x00b6('0x2f')][_0x00b6('0x31')],_0x317ccd['findBy']));var _0x366a71=this[_0x00b6('0x46')][_0x00b6('0x79')](this,_0x317ccd[_0x00b6('0x12b')]);var _0x548bf8=this['agentPause'][_0x00b6('0x79')](this,_0x317ccd[_0x00b6('0x119')],_0x366a71);if(_0x548bf8){logger[_0x00b6('0x22')](util[_0x00b6('0x20')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x00b6('0x31')],_0x317ccd[_0x00b6('0x119')]));this[_0x00b6('0x2f')][_0x00b6('0x86')](util[_0x00b6('0x20')](_0x00b6('0x11c'),this[_0x00b6('0x2f')][_0x00b6('0x31')],_0x317ccd[_0x00b6('0x119')]));return{'code':0xc8,'result':_0x00b6('0x11d')};}else{logger['info'](util[_0x00b6('0x20')](_0x00b6('0x11e'),this[_0x00b6('0x2f')]['callerid'],_0x317ccd[_0x00b6('0x119')]));this[_0x00b6('0x2f')][_0x00b6('0x86')](util[_0x00b6('0x20')](_0x00b6('0x11c'),this[_0x00b6('0x2f')][_0x00b6('0x31')],_0x317ccd[_0x00b6('0x119')]));return{'code':0xc8,'result':_0x00b6('0x11f')};}};AGIVertices[_0x00b6('0xb')][_0x00b6('0x12c')]=function(_0x4fc759){logger['info'](util['format']('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x4fc759['label']));if(!this[_0x00b6('0x5d')](_0x4fc759['file_id'])){return this[_0x00b6('0x2f')]['error'](_0x4fc759,_0x00b6('0xd2'));}var _0x296cf7=this[_0x00b6('0x15')][_0x00b6('0x79')](this,_0x4fc759[_0x00b6('0xd3')]);if(!_0x296cf7){return this[_0x00b6('0x2f')][_0x00b6('0x4c')](_0x4fc759,_0x00b6('0x12d'));}var _0x2344f7=this[_0x00b6('0x2f')][_0x00b6('0x8c')]('PLAYBACK',[_0x296cf7,_0x4fc759[_0x00b6('0xcd')]]);if(_0x2344f7[_0x00b6('0x75')]===-0x1){return _0x2344f7;}return this[_0x00b6('0x2f')][_0x00b6('0x86')](util[_0x00b6('0x20')](_0x00b6('0x12e'),_0x00b6('0x12f'),_0x296cf7));};AGIVertices[_0x00b6('0xb')]['queue']=function(_0x45bb6c){logger['info'](util['format']('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x45bb6c[_0x00b6('0x2d')]));if(!this['isConfigured'](_0x45bb6c[_0x00b6('0x130')])){return this['channel'][_0x00b6('0x4c')](_0x45bb6c,_0x00b6('0x131'));}var _0x4cd5b8='';var _0x219349=parseInt(_0x45bb6c[_0x00b6('0x130')],0xa);if(isNaN(_0x219349)){_0x4cd5b8=_0x45bb6c[_0x00b6('0x130')];}else{_0x4cd5b8=this['getVoiceQueue']['sync'](this,_0x45bb6c[_0x00b6('0x130')]);if(!_0x4cd5b8){return this[_0x00b6('0x2f')][_0x00b6('0x4c')](_0x45bb6c,_0x00b6('0x132'));}}var _0x52e75a='';if(this['isConfigured'](_0x45bb6c[_0x00b6('0xd3')])){var _0x3373a5=this[_0x00b6('0x15')][_0x00b6('0x79')](this,_0x45bb6c[_0x00b6('0xd3')]);if(_0x3373a5){_0x52e75a=_0x3373a5;}}this[_0x00b6('0x2b')][_0x00b6('0x79')](this,_0x45bb6c,_0x4cd5b8);if(_0x45bb6c[_0x00b6('0xcd')]['indexOf']('x')<0x0){_0x45bb6c[_0x00b6('0xcd')]+='x';}if(_0x45bb6c[_0x00b6('0xcd')][_0x00b6('0x133')]('X')<0x0){_0x45bb6c[_0x00b6('0xcd')]+='X';}this['channel'][_0x00b6('0x77')](_0x00b6('0x134'),_0x4cd5b8?_0x4cd5b8[_0x00b6('0x135')]():'');var _0x2208f7=this[_0x00b6('0x2f')][_0x00b6('0x8c')](_0x00b6('0x136'),[_0x4cd5b8,_0x45bb6c[_0x00b6('0xcd')],_0x45bb6c[_0x00b6('0xce')],_0x52e75a,_0x45bb6c['timeout'],_0x45bb6c[_0x00b6('0x5')],_0x45bb6c[_0x00b6('0x137')],_0x45bb6c[_0x00b6('0x138')],'',_0x45bb6c['position']]);if(_0x2208f7[_0x00b6('0x75')]===-0x1){return _0x2208f7;}return this['channel'][_0x00b6('0x86')](util[_0x00b6('0x20')](_0x00b6('0x12e'),_0x00b6('0x136'),_0x4cd5b8));};AGIVertices[_0x00b6('0xb')][_0x00b6('0x139')]=function(_0x49eba0){logger['info'](util['format'](_0x00b6('0x13a'),_0x49eba0[_0x00b6('0x2d')]));var _0x4e0ba7=_0x49eba0[_0x00b6('0x13b')]||_0x00b6('0xf1');var _0x56e642=util[_0x00b6('0x20')](_0x00b6('0x13c'),this[_0x00b6('0x2f')][_0x00b6('0x2c')],rs[_0x00b6('0xdb')](0x5));var _0x38f281=util['format'](_0x00b6('0x13d'),FILES_PATH,_0x56e642,_0x4e0ba7);var _0x1555e1=util['format'](_0x00b6('0xfc'),FILES_PATH,_0x56e642);this[_0x00b6('0x32')][_0x00b6('0x79')](this,_0x49eba0,_0x56e642,_0x38f281);this[_0x00b6('0x2f')][_0x00b6('0x77')](_0x00b6('0x13e'),_0x56e642);logger[_0x00b6('0x22')](_0x00b6('0x13f'),_0x1555e1,_0x4e0ba7,_0x49eba0[_0x00b6('0x140')],_0x49eba0[_0x00b6('0x7e')]);return this[_0x00b6('0x2f')][_0x00b6('0xf4')](_0x1555e1,_0x4e0ba7,_0x49eba0[_0x00b6('0x140')],_0x49eba0[_0x00b6('0x7e')],undefined,!![]);};AGIVertices[_0x00b6('0xb')][_0x00b6('0x141')]=function(_0x47a85c){logger[_0x00b6('0x22')](util['format']('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x47a85c[_0x00b6('0x2d')]));return this['channel'][_0x00b6('0x142')](_0x47a85c[_0x00b6('0x143')]['replace'](/\s+/g,''),_0x47a85c[_0x00b6('0x140')]);};AGIVertices['prototype'][_0x00b6('0x144')]=function(_0x46a5e1){logger[_0x00b6('0x22')](util[_0x00b6('0x20')](_0x00b6('0x145'),_0x46a5e1[_0x00b6('0x2d')]));return this[_0x00b6('0x2f')]['sayNumber'](_0x46a5e1[_0x00b6('0x146')][_0x00b6('0x52')](/\s+/g,''),_0x46a5e1[_0x00b6('0x140')]);};AGIVertices['prototype'][_0x00b6('0x147')]=function(_0x1a9962){logger[_0x00b6('0x22')](util['format'](_0x00b6('0x148'),_0x1a9962['label']));return this[_0x00b6('0x2f')][_0x00b6('0x149')](_0x1a9962[_0x00b6('0x54')],_0x1a9962[_0x00b6('0x140')]);};AGIVertices['prototype']['sendMail']=function(_0x3473f9){logger['info'](util['format'](_0x00b6('0x14a'),_0x3473f9[_0x00b6('0x2d')]));if(!this[_0x00b6('0x5d')](_0x3473f9[_0x00b6('0x14b')])){return this[_0x00b6('0x2f')][_0x00b6('0x86')](_0x00b6('0x14c'));}var _0x138cc0=this[_0x00b6('0x18')][_0x00b6('0x79')](this,_0x3473f9['account_id']);if(!_0x138cc0||!_0x138cc0[_0x00b6('0x14d')]){return this[_0x00b6('0x2f')]['error'](_0x3473f9,_0x00b6('0x14e'));}var _0x2a256e={'from':util[_0x00b6('0x20')]('\x22%s\x22\x20<%s>',_0x138cc0[_0x00b6('0xf')],_0x138cc0[_0x00b6('0x14f')]||_0x138cc0[_0x00b6('0x14d')][_0x00b6('0x150')]),'to':_0x3473f9['to']||'','cc':_0x3473f9['cc']||'','bcc':_0x3473f9[_0x00b6('0x151')]||'','subject':_0x3473f9['subject'],'html':_0x3473f9[_0x00b6('0x54')],'text':_0x3473f9[_0x00b6('0x54')]};var _0x22c5b0={'tls':{'rejectUnauthorized':![]}};if(_0x138cc0[_0x00b6('0x14d')]['service']){_0x22c5b0[_0x00b6('0x152')]=_0x138cc0[_0x00b6('0x14d')][_0x00b6('0x152')];}else{_0x22c5b0[_0x00b6('0x153')]=_0x138cc0[_0x00b6('0x14d')][_0x00b6('0x153')];_0x22c5b0[_0x00b6('0x154')]=_0x138cc0[_0x00b6('0x14d')][_0x00b6('0x154')];_0x22c5b0[_0x00b6('0x155')]=_0x138cc0[_0x00b6('0x14d')][_0x00b6('0x155')];}if(_0x138cc0['Smtp']['authentication']){_0x22c5b0[_0x00b6('0x156')]={'user':_0x138cc0['Smtp'][_0x00b6('0x150')],'pass':_0x138cc0[_0x00b6('0x14d')][_0x00b6('0x157')]};}if(this['isConfigured'](_0x3473f9[_0x00b6('0x158')])){}logger['debug'](_0x00b6('0x159'),JSON[_0x00b6('0xf8')](_0x2a256e));this[_0x00b6('0x2b')][_0x00b6('0x79')](this,_0x3473f9,_0x3473f9[_0x00b6('0x14b')]);this[_0x00b6('0x2f')][_0x00b6('0x86')](util[_0x00b6('0x20')](_0x00b6('0x15a'),_0x138cc0[_0x00b6('0xf')]));this[_0x00b6('0x1a')][_0x00b6('0x79')](this,_0x22c5b0,_0x2a256e);return this['channel']['noop'](_0x00b6('0x15b'));};AGIVertices['prototype'][_0x00b6('0x15c')]=function(_0x16473f){logger[_0x00b6('0x22')](util[_0x00b6('0x20')](_0x00b6('0x15d'),_0x16473f[_0x00b6('0x2d')]));return this['channel'][_0x00b6('0x86')](_0x00b6('0x15e'));};AGIVertices['prototype']['sendSMS']=function(_0x51fa21){logger[_0x00b6('0x22')](util[_0x00b6('0x20')](_0x00b6('0x15f'),_0x51fa21[_0x00b6('0x2d')]));if(!this[_0x00b6('0x5d')](_0x51fa21[_0x00b6('0x160')])){return this[_0x00b6('0x2f')]['noop'](_0x00b6('0x161'));}var _0x32c784=this[_0x00b6('0x28')][_0x00b6('0x79')](this,_0x51fa21[_0x00b6('0x160')]);if(!_0x32c784){return this['channel']['error'](_0x51fa21,'no\x20sms\x20account\x20found');}var _0x3677bd={'body':_0x51fa21[_0x00b6('0x162')],'phone':_0x51fa21['to']||'','SmsAccountId':_0x32c784['id']};logger[_0x00b6('0xaa')](_0x00b6('0x163'),JSON[_0x00b6('0xf8')](_0x3677bd));this[_0x00b6('0x2b')]['sync'](this,_0x51fa21,_0x51fa21[_0x00b6('0x160')]);this['channel'][_0x00b6('0x86')](util['format']('Trying\x20SendSMS\x20with\x20account\x20%s',_0x32c784[_0x00b6('0xf')]));this[_0x00b6('0x2a')][_0x00b6('0x79')](this,_0x3677bd);return this[_0x00b6('0x2f')]['noop']('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x00b6('0xb')][_0x00b6('0x164')]=function(_0xf7a469){logger[_0x00b6('0x22')](util[_0x00b6('0x20')](_0x00b6('0x165'),_0xf7a469[_0x00b6('0x2d')]));if(!this[_0x00b6('0x5d')](_0xf7a469['variable_id'])){return this[_0x00b6('0x2f')][_0x00b6('0x4c')](_0xf7a469,_0x00b6('0x166'));}var _0xd05191=this[_0x00b6('0xc')][_0x00b6('0x79')](this,_0xf7a469[_0x00b6('0xa3')]);if(!_0xd05191){return this[_0x00b6('0x2f')][_0x00b6('0x4c')](_0xf7a469,'no\x20variable\x20found');}return this[_0x00b6('0x2f')][_0x00b6('0x77')](_0xd05191,_0xf7a469['variable_value']);};AGIVertices[_0x00b6('0xb')][_0x00b6('0x167')]=function(_0x366e7e){logger['info'](util['format']('Enter\x20in\x20START\x20(%s)\x20block',_0x366e7e[_0x00b6('0x2d')]));this[_0x00b6('0x2f')][_0x00b6('0x86')](_0x00b6('0x168'));if(_0x366e7e[_0x00b6('0x7c')]===_0x00b6('0x169')){this[_0x00b6('0x2f')][_0x00b6('0x86')]('Answer');return this[_0x00b6('0x2f')]['answer']();}return this[_0x00b6('0x2f')]['noop']('Skipped\x20Answer');};AGIVertices[_0x00b6('0xb')][_0x00b6('0x16a')]=function(_0x55f567){logger['info'](util[_0x00b6('0x20')](_0x00b6('0x16b'),_0x55f567[_0x00b6('0x2d')]));if(!this[_0x00b6('0x5d')](_0x55f567['project_id'])){return this[_0x00b6('0x2f')][_0x00b6('0x4c')](_0x55f567,'no\x20subproject\x20selected');}var _0x5dfd48=this[_0x00b6('0x16c')]['sync'](this,_0x55f567['project_id']);if(!this[_0x00b6('0x5d')](_0x5dfd48)){return this['channel']['error'](_0x55f567,util['format'](_0x00b6('0x16d'),_0x55f567[_0x00b6('0x16e')]));}if(_0x5dfd48===this[_0x00b6('0x2f')][_0x00b6('0x30')]){return this[_0x00b6('0x2f')][_0x00b6('0x4c')](_0x55f567,_0x00b6('0x16f'));}this[_0x00b6('0x2b')]['sync'](this,_0x55f567,_0x5dfd48);var _0x21a58e=this[_0x00b6('0x2f')][_0x00b6('0x8c')](_0x00b6('0x170'),util[_0x00b6('0x20')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x00b6('0x5')]['host']||'127.0.0.1',_0x5dfd48,this[_0x00b6('0x2f')][_0x00b6('0x30')]));if(_0x21a58e[_0x00b6('0x75')]===-0x1){return _0x21a58e;}return this[_0x00b6('0x2f')][_0x00b6('0x86')](util[_0x00b6('0x20')](_0x00b6('0x12e'),_0x00b6('0x170'),_0x5dfd48));};AGIVertices[_0x00b6('0xb')][_0x00b6('0x171')]=function(_0x2d801b){logger['info'](util[_0x00b6('0x20')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x2d801b[_0x00b6('0x2d')]));var _0x474d41=this[_0x00b6('0x50')]['sync'](this,_0x2d801b['command']);this[_0x00b6('0x2b')][_0x00b6('0x79')](this,_0x2d801b,_0x2d801b['command']);if(this['isConfigured'](_0x2d801b['variable_id'])){var _0x2bed1e=this['getVariable'][_0x00b6('0x79')](this,_0x2d801b[_0x00b6('0xa3')]);if(_0x2bed1e){this[_0x00b6('0x2f')][_0x00b6('0x77')](_0x2bed1e,_0x474d41);return this[_0x00b6('0x2f')][_0x00b6('0x86')](util[_0x00b6('0x20')](_0x00b6('0x172'),_0x2d801b[_0x00b6('0x7b')],_0x2bed1e));}}return this[_0x00b6('0x2f')][_0x00b6('0x86')](util[_0x00b6('0x20')](_0x00b6('0x173'),_0x2d801b[_0x00b6('0x7b')]));};AGIVertices[_0x00b6('0xb')]['tts']=function(_0x48c6f1){logger['info'](util[_0x00b6('0x20')](_0x00b6('0x174'),_0x48c6f1[_0x00b6('0x2d')]));if(!this[_0x00b6('0x5d')](_0x48c6f1[_0x00b6('0x54')])){return this[_0x00b6('0x2f')][_0x00b6('0x86')](_0x00b6('0x8b'));}this[_0x00b6('0x2f')][_0x00b6('0x86')](util[_0x00b6('0x20')](_0x00b6('0x175'),_0x48c6f1[_0x00b6('0x54')]));var _0x3a9443=this[_0x00b6('0x53')][_0x00b6('0x79')](this,_0x48c6f1);if(_0x3a9443){this[_0x00b6('0x2f')]['noop'](util['format'](_0x00b6('0x176'),_0x3a9443));var _0x54def9=this[_0x00b6('0x2f')][_0x00b6('0xc0')](_0x3a9443);try{fs[_0x00b6('0x116')](_0x3a9443+_0x00b6('0xc1'));}catch(_0x217285){logger['error'](_0x217285);}return _0x54def9;}return this[_0x00b6('0x2f')]['error'](_0x48c6f1,_0x00b6('0x177'));};AGIVertices[_0x00b6('0xb')]['unpause']=function(_0x498a91){logger[_0x00b6('0x22')](util[_0x00b6('0x20')](_0x00b6('0x178'),_0x498a91[_0x00b6('0x2d')]));if(!this[_0x00b6('0x5d')](_0x498a91[_0x00b6('0x119')])){return this[_0x00b6('0x2f')][_0x00b6('0x4c')](_0x498a91,_0x00b6('0x11a'));}logger[_0x00b6('0x22')](util['format'](_0x00b6('0x11b'),this['channel'][_0x00b6('0x31')],_0x498a91[_0x00b6('0x119')]));var _0x4473f7=this[_0x00b6('0x4a')]['sync'](this,_0x498a91['findBy']);if(_0x4473f7){logger['info'](util[_0x00b6('0x20')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x00b6('0x2f')][_0x00b6('0x31')],_0x498a91[_0x00b6('0x119')]));this[_0x00b6('0x2f')][_0x00b6('0x86')](util[_0x00b6('0x20')](_0x00b6('0x11c'),this[_0x00b6('0x2f')]['callerid'],_0x498a91[_0x00b6('0x119')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x00b6('0x20')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x00b6('0x2f')][_0x00b6('0x31')],_0x498a91[_0x00b6('0x119')]));this[_0x00b6('0x2f')][_0x00b6('0x86')](util[_0x00b6('0x20')](_0x00b6('0x11e'),this['channel'][_0x00b6('0x31')],_0x498a91['findBy']));return{'code':0xc8,'result':_0x00b6('0x11f')};}};AGIVertices['prototype'][_0x00b6('0x179')]=function(_0x3d1b37){logger[_0x00b6('0x22')](util['format'](_0x00b6('0x17a'),_0x3d1b37[_0x00b6('0x2d')]));var _0xdc1358=this[_0x00b6('0x2f')][_0x00b6('0x8c')]('VOICEMAIL',[_0x3d1b37['mailbox'],_0x3d1b37[_0x00b6('0x88')]]);if(_0xdc1358['result']===-0x1){return _0xdc1358;}return this['channel']['noop'](util[_0x00b6('0x20')](_0x00b6('0x12e'),'VOICEMAIL',_0x3d1b37[_0x00b6('0x17b')]));};AGIVertices[_0x00b6('0xb')]['vswitch']=function(_0x119ef1){logger[_0x00b6('0x22')](util['format']('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x119ef1[_0x00b6('0x2d')]));if(!this[_0x00b6('0x5d')](_0x119ef1['variable_id'])){return this[_0x00b6('0x2f')]['error'](_0x119ef1,'no\x20variable\x20selected');}var _0x1caa8c=this[_0x00b6('0xc')][_0x00b6('0x79')](this,_0x119ef1[_0x00b6('0xa3')]);if(!_0x1caa8c){return this['channel'][_0x00b6('0x4c')](_0x119ef1,_0x00b6('0xa4'));}var _0x311207=this[_0x00b6('0x2f')][_0x00b6('0xc')](_0x1caa8c);return{'code':0xc8,'result':_0x311207[_0x00b6('0x76')]?_0x311207[_0x00b6('0x76')]:'-'};};String[_0x00b6('0xb')][_0x00b6('0x17c')]=function(_0x1facb5,_0x55dd8d){return this[_0x00b6('0x72')](_0x1facb5)[_0x00b6('0x17d')](_0x55dd8d);};module[_0x00b6('0x17e')]=AGIVertices; \ No newline at end of file +var _0x3711=['Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20selected','file_id','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','getData','response','maxdigit','stringify','mindigit','hiddendigitsnum','hiddendigitspos','first','substr','generate','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','awspolly','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','streamFile','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s.%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','appid','no\x20appid\x20configured','%s/recordings/%s','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','getIntervals','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','no\x20key\x20configured','IspeechASR\x20Result\x20%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','isArray','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','indexOf','XMCS-QUEUE','macro','position','QUEUE','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','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','number','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','service','host','port','authentication','auth','template_id','debug','Trying\x20SendMail\x20with\x20account\x20%s','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','AGI','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','VOICEMAIL','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','exports','path','util','lodash','shelljs','odbc','moment','mustache','agi','./scripts','/var/opt/motion2/server/files','menu','getdigits','rpc','mailRpc','prototype','getVariable','getVariableById','then','getVoiceQueue','getVoiceQueueById','name','catch','getSquareProject','getSquareProjectById','getSquareOdbcById','dsn','getUser','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','sendMailMessage','getIntervalById','IntervalId','interval','map','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','channel','uniqueid','label','agicommand','callerid','createSquareRecording','context','extension','priority','accountcode','dnid','arg_1','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','phone','scheduledAt','callback','toString','callback_priority','getPause','getPauseById','agentPause','agentUnpause','agentLogout','agent','internal','%s/%s@from-sip/n','LOCAL','agentLogin','shellCommand','exec','trim','googleTTS','text','googleDialogflow','key','dialogflow_language','sestekNDA','ispeechTTS','en-US','speed','ispeechASR','ispeech_asr_language','isConfigured','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appsecret','clear','includes','clone','hasOwnProperty','isString','replaceAllVariables','split','length','replaceAll','extra','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','maxRetry','createSquareDetailsReport','sync','retry','Enter\x20in\x20AGI\x20(%s)\x20block','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','timeout','Wait\x20%s\x20seconds\x20before\x20answer','wait','result','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','add','noop','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','list_id','custom_app','options','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','Executed\x20command\x20MRCPSynth\x20%s','MRCPSynth','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','MRCPRecog','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','getSquareOdbc','no\x20query\x20configured','replace','query:\x20%s','variable_id','no\x20variable\x20found','keys','forEach','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20found','DIAL','SIP/%s','opts','url','Executed\x20command\x20%s','dialogflow','bot','DIALOGFLOW_%s','speech','Dialogflow\x20Result\x20%s','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','SESTEK_NDA_%s','toUpperCase','out','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block'];(function(_0x3403d5,_0x3d99fc){var _0xf9df4f=function(_0x33d748){while(--_0x33d748){_0x3403d5['push'](_0x3403d5['shift']());}};_0xf9df4f(++_0x3d99fc);}(_0x3711,0xac));var _0x1371=function(_0x23dd13,_0x3dc193){_0x23dd13=_0x23dd13-0x0;var _0x1f82cf=_0x3711[_0x23dd13];return _0x1f82cf;};'use strict';var fs=require('fs');var path=require(_0x1371('0x0'));var util=require(_0x1371('0x1'));var _=require(_0x1371('0x2'));var sh=require(_0x1371('0x3'));var odbc=require(_0x1371('0x4'))();var rs=require('randomstring');var moment=require(_0x1371('0x5'));var Mustache=require(_0x1371('0x6'));var logger=require('../../config/logger')(_0x1371('0x7'));var config=require('../../config/environment');var scripts=require(_0x1371('0x8'));var FILES_PATH=_0x1371('0x9');var verticesWithRetry=[_0x1371('0xa'),_0x1371('0xb'),'getsecretdigits'];var AGIVertices=function(_0x21d169,_0x15d2df,_0x3d29d){this['channel']=_0x21d169;this[_0x1371('0xc')]=_0x15d2df;this[_0x1371('0xd')]=_0x3d29d;};AGIVertices[_0x1371('0xe')][_0x1371('0xf')]=function(_0x129767,_0x7a984a){this[_0x1371('0xc')][_0x1371('0x10')](_0x129767)[_0x1371('0x11')](function(_0x5fd321){_0x7a984a(null,_0x5fd321?_0x5fd321['name']:![]);})['catch'](function(_0x4c606b){_0x7a984a(_0x4c606b);});};AGIVertices[_0x1371('0xe')][_0x1371('0x12')]=function(_0x32e605,_0x4a456b){this[_0x1371('0xc')][_0x1371('0x13')](_0x32e605)[_0x1371('0x11')](function(_0x3de5b5){_0x4a456b(null,_0x3de5b5?_0x3de5b5[_0x1371('0x14')]:![]);})[_0x1371('0x15')](function(_0x3b055f){_0x4a456b(_0x3b055f);});};AGIVertices['prototype'][_0x1371('0x16')]=function(_0x36cf85,_0x31b73f){this[_0x1371('0xc')][_0x1371('0x17')](_0x36cf85)[_0x1371('0x11')](function(_0x462a30){_0x31b73f(null,_0x462a30?_0x462a30[_0x1371('0x14')]:![]);})[_0x1371('0x15')](function(_0x3e6929){_0x31b73f(_0x3e6929);});};AGIVertices['prototype']['getSquareOdbc']=function(_0x597338,_0x12fc2a){this[_0x1371('0xc')][_0x1371('0x18')](_0x597338)[_0x1371('0x11')](function(_0x5dd4a2){_0x12fc2a(null,_0x5dd4a2?_0x5dd4a2[_0x1371('0x19')]:![]);})[_0x1371('0x15')](function(_0x25f702){_0x12fc2a(_0x25f702);});};AGIVertices[_0x1371('0xe')][_0x1371('0x1a')]=function(_0xc1d298,_0x397dab){this['rpc']['getUserById'](_0xc1d298)[_0x1371('0x11')](function(_0x1e4600){_0x397dab(null,_0x1e4600?_0x1e4600['name']:![]);})[_0x1371('0x15')](function(_0x74d641){_0x397dab(_0x74d641);});};AGIVertices['prototype'][_0x1371('0x1b')]=function(_0x16b565,_0x5a29b6){this[_0x1371('0xc')][_0x1371('0x1c')](_0x16b565)[_0x1371('0x11')](function(_0x5a58c5){_0x5a29b6(null,_0x5a58c5?_0x5a58c5[_0x1371('0x14')]:![]);})[_0x1371('0x15')](function(_0x1f6568){_0x5a29b6(_0x1f6568);});};AGIVertices[_0x1371('0xe')][_0x1371('0x1d')]=function(_0x501d4b,_0x412345){var _0xdd5481=this;this['rpc'][_0x1371('0x1e')](_0x501d4b)[_0x1371('0x11')](function(_0x3f0954){_0x412345(null,_0x3f0954?_0xdd5481[_0x1371('0x1f')](_0x3f0954[_0x1371('0x20')]):![]);})[_0x1371('0x15')](function(_0x4b99f9){_0x412345(_0x4b99f9);});};AGIVertices[_0x1371('0xe')][_0x1371('0x21')]=function(_0x47a015,_0x13831b){this[_0x1371('0xc')]['getMailAccountById'](_0x47a015)['then'](function(_0x59d791){_0x13831b(null,_0x59d791?_0x59d791:![]);})[_0x1371('0x15')](function(_0x1349d2){_0x13831b(_0x1349d2);});};AGIVertices['prototype']['sendMailMessage']=function(_0x340d29,_0x2764f1,_0x52b3e0){this[_0x1371('0xd')][_0x1371('0x22')](_0x340d29,_0x2764f1)[_0x1371('0x11')](function(){_0x52b3e0(null);})[_0x1371('0x15')](function(_0x2e6709){_0x52b3e0(_0x2e6709);});};AGIVertices[_0x1371('0xe')]['getIntervals']=function(_0x317b2f,_0x448366){this[_0x1371('0xc')][_0x1371('0x23')](_0x317b2f)[_0x1371('0x11')](function(_0x521ea8){if(_0x521ea8){if(_0x521ea8[_0x1371('0x24')]){_0x448366(null,[_0x521ea8[_0x1371('0x25')]]);}else{_0x448366(null,_[_0x1371('0x26')](_0x521ea8['Intervals'],_0x1371('0x25')));}}else{_0x448366(null,![]);}})[_0x1371('0x15')](function(_0x52b960){_0x448366(_0x52b960);});};AGIVertices['prototype'][_0x1371('0x1f')]=function(_0x3177ff){return util[_0x1371('0x27')](_0x1371('0x28'),FILES_PATH,_0x3177ff);};AGIVertices[_0x1371('0xe')][_0x1371('0x29')]=function(_0x51343d,_0x555cb7,_0x10645d){odbc[_0x1371('0x2a')](_0x51343d,function(_0x22e282){if(_0x22e282){logger[_0x1371('0x2b')](_0x1371('0x2c'),_0x22e282);_0x10645d(_0x22e282);}else{logger[_0x1371('0x2d')](_0x1371('0x2e'));odbc[_0x1371('0x2f')](_0x555cb7,function(_0x223841,_0x42cb6a){if(_0x223841){logger[_0x1371('0x2d')]('Error\x20executing\x20query\x20%s',_0x555cb7);_0x10645d(_0x223841);}else{logger[_0x1371('0x2d')](_0x1371('0x30'),_0x555cb7);odbc[_0x1371('0x31')](function(_0x2f4e1a){if(_0x2f4e1a){logger[_0x1371('0x2b')](_0x1371('0x32'),_0x2f4e1a);}_0x10645d(null,_0x42cb6a);});}});}});};AGIVertices[_0x1371('0xe')][_0x1371('0x33')]=function(_0x522e88,_0x98af0){this[_0x1371('0xc')]['getSmsAccountById'](_0x522e88)['then'](function(_0x22d367){_0x98af0(null,_0x22d367?_0x22d367:![]);})[_0x1371('0x15')](function(_0x282e0d){_0x98af0(_0x282e0d);});};AGIVertices[_0x1371('0xe')][_0x1371('0x34')]=function(_0x38b084,_0x5c9d52){this[_0x1371('0xc')][_0x1371('0x34')](_0x38b084)[_0x1371('0x11')](function(_0x40a737){_0x5c9d52(null,_0x40a737);})[_0x1371('0x15')](function(_0x3c6b94){_0x5c9d52(_0x3c6b94);});};AGIVertices[_0x1371('0xe')]['createSquareDetailsReport']=function(_0x50f271,_0x281dc1,_0x8909f3){this[_0x1371('0xc')]['createSquareDetailsReport']({'uniqueid':this[_0x1371('0x35')][_0x1371('0x36')],'node':_0x50f271[_0x1371('0x37')],'application':_0x50f271[_0x1371('0x38')],'data':_0x281dc1||null,'project_name':this[_0x1371('0x35')]['arg_1'],'callerid':this[_0x1371('0x35')][_0x1371('0x39')]})[_0x1371('0x11')](function(_0x1f27f1){if(_0x8909f3){_0x8909f3(null,_0x1f27f1);}})[_0x1371('0x15')](function(_0x29a9a6){if(_0x8909f3){_0x8909f3(_0x29a9a6);}});};AGIVertices[_0x1371('0xe')][_0x1371('0x3a')]=function(_0x2a7cd8,_0x2b900e,_0x39d65b,_0x2a79f8){this[_0x1371('0xc')][_0x1371('0x3a')]({'uniqueid':this['channel'][_0x1371('0x36')],'callerid':this[_0x1371('0x35')][_0x1371('0x39')],'calleridname':this['channel']['calleridname'],'context':this[_0x1371('0x35')][_0x1371('0x3b')],'extension':this[_0x1371('0x35')][_0x1371('0x3c')],'priority':this[_0x1371('0x35')][_0x1371('0x3d')],'accountcode':this[_0x1371('0x35')][_0x1371('0x3e')],'dnid':this['channel'][_0x1371('0x3f')],'projectName':this['channel'][_0x1371('0x40')],'saveName':_0x2b900e,'filename':_0x2a7cd8['file']||_0x2b900e,'savePath':_0x39d65b})['then'](function(_0x26b78b){_0x2a79f8(null,_0x26b78b);})[_0x1371('0x15')](function(_0x1eac72){_0x2a79f8(_0x1eac72);});};AGIVertices['prototype']['createSquareMessage']=function(_0x531472,_0x2d8f86,_0x6fe9cd){this[_0x1371('0xc')][_0x1371('0x41')]({'uniqueid':this[_0x1371('0x35')][_0x1371('0x36')],'body':_0x531472,'direction':_0x2d8f86})[_0x1371('0x11')](function(_0xbb0c78){if(_0x6fe9cd){_0x6fe9cd(null,_0xbb0c78);}})[_0x1371('0x15')](function(_0x48a6e3){if(_0x6fe9cd){_0x6fe9cd(_0x48a6e3);}});};AGIVertices[_0x1371('0xe')][_0x1371('0x42')]=function(_0x15010c,_0x20892c){this[_0x1371('0xc')]['createCmContact']({'firstName':_[_0x1371('0x43')](_0x15010c[_0x1371('0x14')])||_[_0x1371('0x44')](_0x15010c['name'])?'callback_'+Math[_0x1371('0x45')]():_0x15010c[_0x1371('0x14')],'lastName':_[_0x1371('0x43')](_0x15010c[_0x1371('0x46')])||_[_0x1371('0x44')](_0x15010c['lastName'])?null:_0x15010c[_0x1371('0x46')],'phone':_0x15010c[_0x1371('0x47')],'ListId':_0x15010c['list_id'],'scheduledAt':_0x15010c[_0x1371('0x48')],'callbackUniqueid':this[_0x1371('0x35')]['uniqueid'],'tags':_0x1371('0x49'),'description':'Callback\x20scheduled\x20at\x20'+_0x15010c['scheduledAt'][_0x1371('0x4a')](),'priority':_0x15010c[_0x1371('0x4b')]})['then'](function(_0x324031){_0x20892c(null,_0x324031);})[_0x1371('0x15')](function(_0x19ca51){_0x20892c(_0x19ca51);});};AGIVertices['prototype'][_0x1371('0x4c')]=function(_0x3c0cfd,_0x1e81e9){this[_0x1371('0xc')][_0x1371('0x4d')](_0x3c0cfd)['then'](function(_0x4bde7c){_0x1e81e9(null,_0x4bde7c?_0x4bde7c[_0x1371('0x14')]:![]);})[_0x1371('0x15')](function(_0x363e3d){_0x1e81e9(_0x363e3d);});};AGIVertices['prototype'][_0x1371('0x4e')]=function(_0x54095d,_0x865373,_0x5e2665){var _0x503a95={'role':'agent'};_0x503a95[_0x54095d]=this[_0x1371('0x35')][_0x1371('0x39')];this[_0x1371('0xc')]['agentPause'](_0x503a95,_0x865373,this[_0x1371('0x35')]['uniqueid'])[_0x1371('0x11')](function(_0x640b49){_0x5e2665(null,_['isNil'](_0x640b49)?![]:!![]);})[_0x1371('0x15')](function(_0x231681){logger['error'](_0x231681);_0x5e2665(null,![]);});};AGIVertices[_0x1371('0xe')][_0x1371('0x4f')]=function(_0x188b68,_0x257f77){var _0x2462f9={'role':'agent'};_0x2462f9[_0x188b68]=this[_0x1371('0x35')][_0x1371('0x39')];this[_0x1371('0xc')]['agentUnpause'](_0x2462f9)[_0x1371('0x11')](function(_0x12ff3c){_0x257f77(null,_[_0x1371('0x44')](_0x12ff3c)?![]:!![]);})[_0x1371('0x15')](function(_0x255a4a){logger['error'](_0x255a4a);_0x257f77(null,![]);});};AGIVertices['prototype'][_0x1371('0x50')]=function(_0x2ffd9d,_0x194910){var _0x36eeee={'role':'agent'};_0x36eeee[_0x2ffd9d]=this[_0x1371('0x35')]['callerid'];this['rpc'][_0x1371('0x50')](_0x36eeee)[_0x1371('0x11')](function(_0x3e4a44){_0x194910(null,_[_0x1371('0x44')](_0x3e4a44)?![]:!![]);})['catch'](function(_0x348b0d){logger['error'](_0x348b0d);_0x194910(null,![]);});};AGIVertices['prototype']['agentLogin']=function(_0x5565f2,_0x3104b2){var _0x16d382={'role':_0x1371('0x51')};_0x16d382[_0x5565f2]=this[_0x1371('0x35')][_0x1371('0x39')];var _0xbbf558=_0x5565f2!=_0x1371('0x52')?util['format'](_0x1371('0x53'),_0x1371('0x54'),this[_0x1371('0x35')][_0x1371('0x39')]):undefined;this[_0x1371('0xc')][_0x1371('0x55')](_0x16d382,_0xbbf558)[_0x1371('0x11')](function(_0x343b70){_0x3104b2(null,_['isNil'](_0x343b70)?![]:!![]);})[_0x1371('0x15')](function(_0x28ce7c){logger[_0x1371('0x2b')](_0x28ce7c);_0x3104b2(null,![]);});};AGIVertices['prototype'][_0x1371('0x56')]=function(_0x483497,_0x321a18){sh[_0x1371('0x57')](_[_0x1371('0x58')](_0x483497),function(_0xf495db,_0x2a3229){var _0x28327c=_0x2a3229['replace'](/(\r\n|\n|\r)/gm,'');_0x321a18(null,_0x28327c);});};AGIVertices[_0x1371('0xe')][_0x1371('0x59')]=function(_0x4fa4d3,_0x406fc7){scripts[_0x1371('0x59')](_0x4fa4d3[_0x1371('0x5a')],_0x4fa4d3['google_tts_language']||'en',0x1)['then'](function(_0x1305e6){_0x406fc7(null,_0x1305e6);})[_0x1371('0x15')](function(_0x111911){_0x406fc7(_0x111911);});};AGIVertices[_0x1371('0xe')][_0x1371('0x5b')]=function(_0x25a860,_0x45f6cb){scripts[_0x1371('0x5b')](this[_0x1371('0x35')]['uniqueid'],_0x25a860[_0x1371('0x5c')],_0x25a860[_0x1371('0x5a')],_0x25a860[_0x1371('0x5d')]||'en')[_0x1371('0x11')](function(_0x4bd271){_0x45f6cb(null,_0x4bd271);})[_0x1371('0x15')](function(_0x57b84e){_0x45f6cb(_0x57b84e);});};AGIVertices[_0x1371('0xe')]['sestekNDA']=function(_0x51fa43,_0x190799){scripts[_0x1371('0x5e')](this['channel'],_0x51fa43)['then'](function(_0x395d35){_0x190799(null,_0x395d35);})[_0x1371('0x15')](function(_0x84d1e6){_0x190799(_0x84d1e6);});};AGIVertices['prototype'][_0x1371('0x5f')]=function(_0x4a0d89,_0x52dc33){scripts[_0x1371('0x5f')](_0x4a0d89[_0x1371('0x5c')],_0x4a0d89[_0x1371('0x5a')],_0x4a0d89['ispeech_tts_language']||_0x1371('0x60'),_0x4a0d89[_0x1371('0x61')])[_0x1371('0x11')](function(_0x244b4b){_0x52dc33(null,_0x244b4b);})[_0x1371('0x15')](function(_0x254cf8){_0x52dc33(_0x254cf8);});};AGIVertices['prototype'][_0x1371('0x62')]=function(_0x2f639e,_0x2a4a5e,_0x3ae9f8){scripts[_0x1371('0x62')](_0x2a4a5e,_0x2f639e[_0x1371('0x5c')],_0x2f639e[_0x1371('0x63')]||'en-US',this[_0x1371('0x64')](_0x2f639e['model'])?_0x2f639e['model']:undefined)[_0x1371('0x11')](function(_0x394422){_0x3ae9f8(null,_0x394422);})[_0x1371('0x15')](function(_0x5296ee){_0x3ae9f8(_0x5296ee);});};AGIVertices['prototype'][_0x1371('0x65')]=function(_0x156597,_0x36ca46){scripts[_0x1371('0x65')](_0x156597[_0x1371('0x66')],_0x156597[_0x1371('0x67')],_0x156597[_0x1371('0x68')],_0x156597['aws_polly_voice']||'Amy',_0x156597[_0x1371('0x5a')],_0x156597[_0x1371('0x69')]||'text')[_0x1371('0x11')](function(_0x24103a){_0x36ca46(null,_0x24103a);})['catch'](function(_0xebb477){_0x36ca46(_0xebb477);});};AGIVertices[_0x1371('0xe')][_0x1371('0x6a')]=function(_0x1a7fe6,_0x5f6cf6){scripts[_0x1371('0x6a')](this[_0x1371('0x35')][_0x1371('0x36')],_0x1a7fe6[_0x1371('0x66')],_0x1a7fe6['aws_secret_access_key'],_0x1a7fe6[_0x1371('0x6b')],_0x1a7fe6[_0x1371('0x5a')],_0x1a7fe6[_0x1371('0x6c')])[_0x1371('0x11')](function(_0x337e39){_0x5f6cf6(null,_0x337e39);})[_0x1371('0x15')](function(_0x3da041){_0x5f6cf6(_0x3da041);});};AGIVertices['prototype'][_0x1371('0x6d')]=function(_0x5d26d6,_0x3138e9,_0x1e86f1){scripts[_0x1371('0x6d')](_0x3138e9,_0x5d26d6[_0x1371('0x5c')],_0x5d26d6[_0x1371('0x6e')]||_0x1371('0x60'))[_0x1371('0x11')](function(_0x5ea7eb){_0x1e86f1(null,_0x5ea7eb);})[_0x1371('0x15')](function(_0x505b37){_0x1e86f1(_0x505b37);});};AGIVertices[_0x1371('0xe')][_0x1371('0x6f')]=function(_0x38b186,_0x3ad961,_0x146098){scripts[_0x1371('0x6f')](_0x3ad961,_0x38b186['appid'],_0x38b186[_0x1371('0x70')],_0x38b186['uri'])['then'](function(_0x4003f7){_0x146098(null,_0x4003f7);})[_0x1371('0x15')](function(_0x3040ba){_0x146098(_0x3040ba);});};AGIVertices[_0x1371('0xe')][_0x1371('0x71')]=function(_0x21e493){var _0x3c06e1=_[_0x1371('0x72')](verticesWithRetry,_0x21e493[_0x1371('0x38')])?_0x21e493:_[_0x1371('0x73')](_0x21e493);for(var _0x1ff2fb in _0x3c06e1){if(_0x3c06e1[_0x1371('0x74')](_0x1ff2fb)){if(_0x3c06e1[_0x1ff2fb]&&_[_0x1371('0x75')](_0x3c06e1[_0x1ff2fb])){_0x3c06e1[_0x1ff2fb]=this[_0x1371('0x76')](_0x3c06e1[_0x1ff2fb]);}}}return _0x3c06e1;};AGIVertices[_0x1371('0xe')]['replaceAllVariables']=function(_0x365e4c){var _0x1eefc2=_0x365e4c[_0x1371('0x77')]('{');for(var _0x5dcca2=0x1;_0x5dcca2<_0x1eefc2[_0x1371('0x78')];_0x5dcca2+=0x1){var _0x1d9552=_0x1eefc2[_0x5dcca2][_0x1371('0x77')]('}');if(_0x1d9552[_0x1371('0x78')]>0x1){_0x365e4c=_0x365e4c[_0x1371('0x79')]('{'+_0x1d9552[0x0]+'}',this[_0x1371('0x35')][_0x1371('0xf')](_0x1d9552[0x0])[_0x1371('0x7a')]||_0x1d9552[0x0]);}}if(_0x1eefc2[_0x1371('0x78')]===0x1){return _0x365e4c[_0x1371('0x4a')]();}return this[_0x1371('0x76')](_0x365e4c);};AGIVertices['prototype'][_0x1371('0x7b')]=function(_0x1ef347,_0x6915cd){var _0x457673=this[_0x1371('0x35')][_0x1371('0xf')](_0x1ef347);if(_0x457673['result']===-0x1){return _0x457673;}logger['info'](util[_0x1371('0x27')](_0x1371('0x7c'),_0x6915cd,_0x457673['extra']));return this[_0x1371('0x35')][_0x1371('0x7d')](_0x6915cd,_0x457673[_0x1371('0x7a')]);};AGIVertices[_0x1371('0xe')][_0x1371('0x64')]=function(_0x181a32){return _0x181a32&&_0x181a32!=='0'&&_0x181a32!=='-1'&&_0x181a32!=='';};AGIVertices[_0x1371('0xe')][_0x1371('0x7e')]=function(_0xfe8d3a){this[_0x1371('0x7f')][_0x1371('0x80')](this,_0xfe8d3a,'-');_0xfe8d3a[_0x1371('0x81')]=_0xfe8d3a['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x1371('0xe')]['agi']=function(_0x3e1a88){logger['info'](util[_0x1371('0x27')](_0x1371('0x82'),_0x3e1a88['label']));return this[_0x1371('0x35')][_0x1371('0x7')]([_0x3e1a88[_0x1371('0x83')],_0x3e1a88['args']]);};AGIVertices[_0x1371('0xe')][_0x1371('0x84')]=function(_0x33ff74){logger[_0x1371('0x2d')](util[_0x1371('0x27')](_0x1371('0x85'),_0x33ff74['label']));if(this['isConfigured'](_0x33ff74[_0x1371('0x86')])){logger[_0x1371('0x2d')](util[_0x1371('0x27')](_0x1371('0x87'),_0x33ff74[_0x1371('0x86')]));var _0x5cdfb4=this['channel'][_0x1371('0x88')](_0x33ff74[_0x1371('0x86')]);if(_0x5cdfb4[_0x1371('0x89')]===-0x1){return _0x5cdfb4;}}return this['channel']['answer']();};AGIVertices[_0x1371('0xe')]['callback']=function(_0x5db862){logger[_0x1371('0x2d')](util[_0x1371('0x27')](_0x1371('0x8a'),_0x5db862[_0x1371('0x37')]));if(!this[_0x1371('0x64')](_0x5db862['list_id'])){return this['channel']['error'](_0x5db862,'no\x20list\x20selected');}_0x5db862[_0x1371('0x48')]=moment();if(this[_0x1371('0x64')](_0x5db862[_0x1371('0x8b')])){_0x5db862[_0x1371('0x48')]=moment()[_0x1371('0x8c')](_0x5db862[_0x1371('0x8b')],'minutes');}if(!this[_0x1371('0x64')](_0x5db862[_0x1371('0x4b')])){_0x5db862[_0x1371('0x4b')]=0x2;}this[_0x1371('0x42')][_0x1371('0x80')](this,_0x5db862);return this['channel'][_0x1371('0x8d')](util[_0x1371('0x27')](_0x1371('0x8e'),_0x5db862[_0x1371('0x47')],_0x5db862[_0x1371('0x8f')],_0x5db862[_0x1371('0x48')]));};AGIVertices[_0x1371('0xe')][_0x1371('0x90')]=function(_0x1b541e){logger['info'](util[_0x1371('0x27')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x1b541e[_0x1371('0x37')]));var _0x5d16a7=this[_0x1371('0x35')][_0x1371('0x57')](_0x1b541e['application'],_0x1b541e[_0x1371('0x91')]);if(_0x5d16a7[_0x1371('0x89')]===-0x1){return _0x5d16a7;}return this[_0x1371('0x35')][_0x1371('0x8d')](util[_0x1371('0x27')](_0x1371('0x92'),_0x1b541e[_0x1371('0x93')],_0x1b541e[_0x1371('0x91')]));};AGIVertices[_0x1371('0xe')][_0x1371('0x94')]=function(_0x3241f5){logger[_0x1371('0x2d')](util[_0x1371('0x27')](_0x1371('0x95'),_0x3241f5[_0x1371('0x37')]));if(!this[_0x1371('0x64')](_0x3241f5['text'])){return this[_0x1371('0x35')][_0x1371('0x8d')](_0x1371('0x96'));}var _0x163b14='\x22'+_0x3241f5['text']+'\x22';if(this[_0x1371('0x64')](_0x3241f5[_0x1371('0x91')])){_0x163b14+=','+_0x3241f5[_0x1371('0x91')];}var _0x583e77=this[_0x1371('0x35')][_0x1371('0x57')]('MRCPSynth',_0x163b14);if(_0x583e77[_0x1371('0x89')]===-0x1){return _0x583e77;}return this['channel']['noop'](util[_0x1371('0x27')](_0x1371('0x97'),_0x163b14));};AGIVertices['prototype']['sestektts']=function(_0x305353){logger[_0x1371('0x2d')](util[_0x1371('0x27')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x305353[_0x1371('0x37')]));if(!this[_0x1371('0x64')](_0x305353[_0x1371('0x5a')])){return this[_0x1371('0x35')][_0x1371('0x8d')](_0x1371('0x96'));}var _0x1e60e0='\x22'+_0x305353[_0x1371('0x5a')]+'\x22';if(this['isConfigured'](_0x305353[_0x1371('0x91')])){_0x1e60e0+=','+_0x305353[_0x1371('0x91')];}var _0x6b3968=this['channel']['exec'](_0x1371('0x98'),_0x1e60e0);if(_0x6b3968[_0x1371('0x89')]===-0x1){return _0x6b3968;}return this[_0x1371('0x35')][_0x1371('0x8d')](util[_0x1371('0x27')](_0x1371('0x97'),_0x1e60e0));};AGIVertices[_0x1371('0xe')][_0x1371('0x99')]=function(_0x5b4ff1){logger[_0x1371('0x2d')](util[_0x1371('0x27')](_0x1371('0x9a'),_0x5b4ff1[_0x1371('0x37')]));if(!this[_0x1371('0x64')](_0x5b4ff1[_0x1371('0x9b')])){return this[_0x1371('0x35')][_0x1371('0x8d')]('no\x20grammar\x20configured');}var _0xe252d5=_0x5b4ff1[_0x1371('0x9b')];if(this['isConfigured'](_0x5b4ff1[_0x1371('0x91')])){_0xe252d5+=','+_0x5b4ff1[_0x1371('0x91')];}var _0x2676ca=this[_0x1371('0x35')][_0x1371('0x57')](_0x1371('0x9c'),_0xe252d5);if(_0x2676ca[_0x1371('0x89')]===-0x1){return _0x2676ca;}var _0x405d6b=this['getAndSetVariable'](_0x1371('0x9d'),_0x1371('0x9e'));if(_0x405d6b[_0x1371('0x89')]===-0x1){return _0x405d6b;}var _0x191449=this['getAndSetVariable'](_0x1371('0x9f'),_0x1371('0xa0'));if(_0x191449[_0x1371('0x89')]===-0x1){return _0x191449;}var _0xb0452c=this[_0x1371('0x7b')](_0x1371('0xa1'),'LUMENVOX_ASR_INSTANCE');if(_0xb0452c[_0x1371('0x89')]===-0x1){return _0xb0452c;}return this[_0x1371('0x35')][_0x1371('0x8d')](util[_0x1371('0x27')](_0x1371('0xa2'),_0xe252d5));};AGIVertices[_0x1371('0xe')]['sestekasr']=function(_0x50c500){logger[_0x1371('0x2d')](util['format'](_0x1371('0xa3'),_0x50c500[_0x1371('0x37')]));if(!this['isConfigured'](_0x50c500[_0x1371('0x9b')])){return this['channel'][_0x1371('0x8d')]('no\x20grammar\x20configured');}var _0x536496=_0x50c500[_0x1371('0x9b')];if(this['isConfigured'](_0x50c500[_0x1371('0x91')])){_0x536496+=','+_0x50c500[_0x1371('0x91')];}var _0x31dad1=this[_0x1371('0x35')]['exec']('MRCPRecog',_0x536496);if(_0x31dad1[_0x1371('0x89')]===-0x1){return _0x31dad1;}var _0x4650ba=this[_0x1371('0x7b')](_0x1371('0x9d'),_0x1371('0xa4'));if(_0x4650ba[_0x1371('0x89')]===-0x1){return _0x4650ba;}var _0x1ab00c=this['getAndSetVariable']('RECOG_INPUT()',_0x1371('0xa5'));if(_0x1ab00c[_0x1371('0x89')]===-0x1){return _0x1ab00c;}var _0x16d49d=this[_0x1371('0x7b')](_0x1371('0xa1'),_0x1371('0xa6'));if(_0x16d49d[_0x1371('0x89')]===-0x1){return _0x16d49d;}return this['channel'][_0x1371('0x8d')](util[_0x1371('0x27')](_0x1371('0xa2'),_0x536496));};AGIVertices[_0x1371('0xe')][_0x1371('0xa7')]=function(_0x202ef1){logger['info'](util['format'](_0x1371('0xa8'),_0x202ef1['label']));if(!this[_0x1371('0x64')](_0x202ef1[_0x1371('0xa9')])){return this[_0x1371('0x35')]['error'](_0x202ef1,_0x1371('0xaa'));}var _0x539895=this[_0x1371('0xab')]['sync'](this,_0x202ef1[_0x1371('0xa9')]);if(!_0x539895){return this['channel'][_0x1371('0x2b')](_0x202ef1,'no\x20odbc\x20database\x20found');}if(!this[_0x1371('0x64')](_0x202ef1[_0x1371('0x2f')])){return this['channel'][_0x1371('0x2b')](_0x202ef1,_0x1371('0xac'));}var _0x3fe3f4=_0x202ef1['query'][_0x1371('0xad')](/(\r\n|\n|\r)/gm,'\x20');this[_0x1371('0x35')][_0x1371('0x8d')](util[_0x1371('0x27')](_0x1371('0xae'),_0x3fe3f4));var _0x1629bb=this[_0x1371('0x29')][_0x1371('0x80')](this,_0x539895,_0x3fe3f4);this[_0x1371('0x7f')]['sync'](this,_0x202ef1,_0x3fe3f4);if(!this[_0x1371('0x64')](_0x202ef1[_0x1371('0xaf')])){return this[_0x1371('0x35')][_0x1371('0x8d')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x58549c=this[_0x1371('0xf')][_0x1371('0x80')](this,_0x202ef1[_0x1371('0xaf')]);if(!_0x58549c){return this[_0x1371('0x35')][_0x1371('0x2b')](_0x202ef1,_0x1371('0xb0'));}var _0x1137fe=this;_0x1629bb['forEach'](function(_0x471384,_0x29e191){Object[_0x1371('0xb1')](_0x471384)[_0x1371('0xb2')](function(_0x4acf46){_0x1137fe[_0x1371('0x35')][_0x1371('0x7d')](util[_0x1371('0x27')](_0x1371('0xb3'),_0x58549c,_0x29e191,_0x4acf46),_0x471384[_0x4acf46]);});});this[_0x1371('0x35')][_0x1371('0x7d')](util[_0x1371('0x27')](_0x1371('0xb4'),_0x58549c),_0x1629bb['length']);return this[_0x1371('0x35')]['noop'](util['format'](_0x1371('0xb5'),_0x58549c));};AGIVertices[_0x1371('0xe')][_0x1371('0xb6')]=function(_0x795da2){logger['debug'](util[_0x1371('0x27')](_0x1371('0xb7'),_0x795da2[_0x1371('0x37')]));if(!this[_0x1371('0x64')](_0x795da2[_0x1371('0xb8')])){return this['channel'][_0x1371('0x2b')](_0x795da2,'no\x20user\x20selected');}var _0x3feb38=this['getUser'][_0x1371('0x80')](this,_0x795da2[_0x1371('0xb8')]);if(!_0x3feb38){return this[_0x1371('0x35')]['error'](_0x795da2,_0x1371('0xb9'));}var _0x5b5e82=this[_0x1371('0x35')][_0x1371('0x57')](_0x1371('0xba'),[util[_0x1371('0x27')](_0x1371('0xbb'),_0x3feb38),_0x795da2['timeout'],_0x795da2[_0x1371('0xbc')],_0x795da2[_0x1371('0xbd')]]);if(_0x5b5e82['result']===-0x1){return _0x5b5e82;}return this[_0x1371('0x35')][_0x1371('0x8d')](util['format'](_0x1371('0xbe'),_0x1371('0xba')));};AGIVertices['prototype'][_0x1371('0xbf')]=function(_0x122ce9){logger[_0x1371('0x2d')](util[_0x1371('0x27')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x122ce9[_0x1371('0x37')]));if(!this['isConfigured'](_0x122ce9[_0x1371('0x5c')])){return this[_0x1371('0x35')][_0x1371('0x8d')]('no\x20key\x20configured');}if(!this[_0x1371('0x64')](_0x122ce9['text'])){return this['channel']['noop']('no\x20text\x20configured');}this[_0x1371('0x35')][_0x1371('0xc0')]=!![];this[_0x1371('0x7f')](_0x122ce9);this[_0x1371('0x41')](_0x122ce9[_0x1371('0x5a')],'in');this[_0x1371('0x35')][_0x1371('0x8d')](util[_0x1371('0x27')]('Trying\x20Dialogflow:\x20%s',_0x122ce9[_0x1371('0x5a')]));var _0x34d812=this[_0x1371('0x5b')][_0x1371('0x80')](this,_0x122ce9);if(_0x34d812){for(var _0x3df27d in _0x34d812){if(_0x34d812[_0x1371('0x74')](_0x3df27d)){this[_0x1371('0x35')][_0x1371('0x7d')](util['format'](_0x1371('0xc1'),_0x3df27d['toUpperCase']()),_0x34d812[_0x3df27d]);}}this[_0x1371('0x41')](_0x34d812[_0x1371('0xc2')],'out');return this[_0x1371('0x35')]['noop'](util[_0x1371('0x27')](_0x1371('0xc3'),_0x34d812[_0x1371('0xc2')]));}return this[_0x1371('0x35')][_0x1371('0x2b')](_0x122ce9,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0x1371('0xe')][_0x1371('0xc4')]=function(_0xc30320){logger[_0x1371('0x2d')](util[_0x1371('0x27')](_0x1371('0xc5'),_0xc30320[_0x1371('0x37')]));if(!this[_0x1371('0x64')](_0xc30320[_0x1371('0xc6')])){return this['channel'][_0x1371('0x8d')](_0x1371('0xc7'));}if(!this[_0x1371('0x64')](_0xc30320[_0x1371('0xc8')])){return this[_0x1371('0x35')][_0x1371('0x8d')](_0x1371('0xc9'));}if(!this[_0x1371('0x64')](_0xc30320[_0x1371('0xca')])){return this[_0x1371('0x35')][_0x1371('0x8d')](_0x1371('0xcb'));}if(!this['isConfigured'](_0xc30320[_0x1371('0xcc')])){return this[_0x1371('0x35')]['noop'](_0x1371('0x96'));}this['channel']['bot']=!![];this[_0x1371('0x7f')](_0xc30320);this[_0x1371('0x41')](_0xc30320['text'],'in');this[_0x1371('0x35')][_0x1371('0x8d')](util['format']('Trying\x20SestekNDA:\x20%s',_0xc30320[_0x1371('0x5a')]));var _0x18ded0=this[_0x1371('0x5e')]['sync'](this,_0xc30320);if(_0x18ded0){for(var _0x411949 in _0x18ded0){if(_0x18ded0[_0x1371('0x74')](_0x411949)){this[_0x1371('0x35')][_0x1371('0x7d')](util[_0x1371('0x27')](_0x1371('0xcd'),_0x411949[_0x1371('0xce')]()),_0x18ded0[_0x411949]);}}this['createSquareMessage'](_0x18ded0[_0x1371('0xc2')],_0x1371('0xcf'));if(_0x18ded0[_0x1371('0xd0')]){this['channel'][_0x1371('0x8d')](util[_0x1371('0x27')](_0x1371('0xd1'),_0x18ded0[_0x1371('0xd0')]));var _0x3db9c7=this[_0x1371('0x35')]['streamFile'](_0x18ded0['audiofile']);try{fs[_0x1371('0xd2')](_0x18ded0[_0x1371('0xd0')]+_0x1371('0xd3'));}catch(_0x31f778){logger[_0x1371('0x2b')](_0x31f778);}return _0x3db9c7;}else{return this[_0x1371('0x35')][_0x1371('0x8d')](util[_0x1371('0x27')](_0x1371('0xd4'),_0x18ded0[_0x1371('0xc2')]));}}return this[_0x1371('0x35')]['error'](_0xc30320,_0x1371('0xd5'));};AGIVertices[_0x1371('0xe')][_0x1371('0xd6')]=function(_0x7d5562){logger[_0x1371('0x2d')](util['format'](_0x1371('0xd7'),_0x7d5562['label']));return this[_0x1371('0x35')]['noop'](_0x1371('0xd6'));};AGIVertices[_0x1371('0xe')][_0x1371('0xd8')]=function(_0x107c9c){logger[_0x1371('0x2d')](util[_0x1371('0x27')](_0x1371('0xd9'),_0x107c9c[_0x1371('0x37')]));var _0x187789='';if(_0x107c9c['trunk_id']){if(!this['isConfigured'](_0x107c9c[_0x1371('0xda')])){return this['channel'][_0x1371('0x2b')](_0x107c9c,_0x1371('0xdb'));}else{var _0x3e6b2d=parseInt(_0x107c9c[_0x1371('0xda')],0xa);if(isNaN(_0x3e6b2d)){_0x187789=_0x107c9c['trunk_id'];}else{_0x187789=this[_0x1371('0x1b')][_0x1371('0x80')](this,_0x107c9c['trunk_id']);if(!_0x187789){return this[_0x1371('0x35')][_0x1371('0x2b')](_0x107c9c,_0x1371('0xdc'));}}}}else if(_0x107c9c['trunk_name']){_0x187789=_0x107c9c['trunk_name'];}else{return this[_0x1371('0x35')][_0x1371('0x2b')](_0x107c9c,'no\x20trunk\x20selected');}var _0x200a9a=this[_0x1371('0x35')][_0x1371('0x57')](_0x1371('0xba'),[util[_0x1371('0x27')](_0x1371('0xdd'),_0x187789,_0x107c9c['phone']),_0x107c9c['timeout'],_0x107c9c[_0x1371('0xbc')],_0x107c9c[_0x1371('0xbd')]]);if(_0x200a9a['result']===-0x1){return _0x200a9a;}return this['channel']['noop'](util[_0x1371('0x27')](_0x1371('0xbe'),_0x1371('0xba')));};AGIVertices[_0x1371('0xe')][_0x1371('0xde')]=function(_0x25c22f){logger[_0x1371('0x2d')](util[_0x1371('0x27')](_0x1371('0xdf'),_0x25c22f[_0x1371('0x37')]));return this[_0x1371('0x35')][_0x1371('0x8d')](_0x1371('0xde'));};AGIVertices[_0x1371('0xe')][_0x1371('0xb')]=function(_0x210883){logger['info'](util[_0x1371('0x27')](_0x1371('0xe0'),_0x210883[_0x1371('0x37')]));if(_0x210883[_0x1371('0x81')]===0x0){return this[_0x1371('0x7e')](_0x210883);}_0x210883['retry']-=0x1;if(!this[_0x1371('0x64')](_0x210883['file_id'])){return this[_0x1371('0x35')][_0x1371('0x2b')](_0x210883,_0x1371('0xe1'));}var _0x4c2958=this[_0x1371('0x1d')][_0x1371('0x80')](this,_0x210883[_0x1371('0xe2')]);if(!_0x4c2958){return this['channel']['error'](_0x210883,_0x1371('0xe3'));}if(!this[_0x1371('0x64')](_0x210883['variable_id'])){return this[_0x1371('0x35')][_0x1371('0x2b')](_0x1371('0xe4'));}var _0x36ebb3=this[_0x1371('0x35')][_0x1371('0xe5')](_0x4c2958,_0x210883[_0x1371('0xe6')],_0x210883[_0x1371('0xe7')]);var _0x8f13f2=_0x36ebb3['result']?_0x36ebb3[_0x1371('0x89')]['toString']():'';logger[_0x1371('0x2d')]('test',JSON[_0x1371('0xe8')](_0x36ebb3));if(_0x36ebb3[_0x1371('0x89')]===-0x1){this[_0x1371('0x7f')][_0x1371('0x80')](this,_0x210883,_0x8f13f2);return _0x36ebb3;}else if(_0x36ebb3['extra']===_0x1371('0x86')){_0x36ebb3[_0x1371('0x89')]=_0x8f13f2['length']>=parseInt(_0x210883[_0x1371('0xe9')])?'x':'i';}else{_0x36ebb3['result']=_0x8f13f2['length']>=parseInt(_0x210883[_0x1371('0xe9')])&&_0x8f13f2[_0x1371('0x78')]<=parseInt(_0x210883[_0x1371('0xe7')])?'x':'i';}var _0x449ccd=this['getVariable'][_0x1371('0x80')](this,_0x210883['variable_id']);if(!_0x449ccd){return this['channel']['error'](_0x210883,_0x1371('0xb0'));}this['channel'][_0x1371('0x7d')](_0x449ccd,_0x8f13f2);if(this['isConfigured'](_0x210883[_0x1371('0xea')])){var _0x2cffdb=parseInt(_0x210883[_0x1371('0xea')],0xa);var _0x2e537a=rs['generate']({'charset':'*','length':_0x2cffdb});var _0x37a489=_0x8f13f2[_0x1371('0x78')];if(_0x37a489>0x0){if(_0x37a489>_0x2cffdb){this[_0x1371('0x7f')]['sync'](this,_0x210883,_0x210883[_0x1371('0xeb')]===_0x1371('0xec')?_0x2e537a+_0x8f13f2[_0x1371('0xed')](_0x2cffdb):_0x8f13f2[_0x1371('0xed')](0x0,_0x37a489-_0x2cffdb)+_0x2e537a);}else{this[_0x1371('0x7f')][_0x1371('0x80')](this,_0x210883,rs[_0x1371('0xee')]({'charset':'*','length':_0x37a489}));}}else{this[_0x1371('0x7f')][_0x1371('0x80')](this,_0x210883,'');}}else{this['createSquareDetailsReport'][_0x1371('0x80')](this,_0x210883,_0x8f13f2);}return _0x36ebb3;};AGIVertices['prototype']['getsecretdigits']=function(_0x265dc2){logger[_0x1371('0x2d')](util[_0x1371('0x27')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x265dc2[_0x1371('0x37')]));return this[_0x1371('0xb')](_0x265dc2);};AGIVertices['prototype'][_0x1371('0xef')]=function(_0x35316c){logger['info'](util[_0x1371('0x27')](_0x1371('0xf0'),_0x35316c[_0x1371('0x37')]));this[_0x1371('0x7f')]['sync'](this,_0x35316c,_0x35316c['goalname']);return this['channel'][_0x1371('0x8d')](util[_0x1371('0x27')](_0x1371('0xf1'),_0x35316c['goalname']));};AGIVertices[_0x1371('0xe')][_0x1371('0xf2')]=function(_0x2392cf){logger['info'](util[_0x1371('0x27')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x2392cf[_0x1371('0x37')]));if(!this[_0x1371('0x64')](_0x2392cf[_0x1371('0x66')])||!this[_0x1371('0x64')](_0x2392cf[_0x1371('0x67')])){return this[_0x1371('0x35')][_0x1371('0x8d')](_0x1371('0xf3'));}if(!this['isConfigured'](_0x2392cf[_0x1371('0x5a')])){return this[_0x1371('0x35')][_0x1371('0x8d')](_0x1371('0x96'));}this[_0x1371('0x35')][_0x1371('0x8d')](util[_0x1371('0x27')]('Trying\x20aws\x20Polly\x20%s',_0x2392cf['text']));var _0x8fd8cd=this[_0x1371('0x65')][_0x1371('0x80')](this,_0x2392cf);if(_0x8fd8cd){this[_0x1371('0x35')][_0x1371('0x8d')](util[_0x1371('0x27')](_0x1371('0xf4'),_0x8fd8cd));var _0x5e38ea=this[_0x1371('0x35')][_0x1371('0xf5')](_0x8fd8cd);try{fs[_0x1371('0xd2')](_0x8fd8cd+'.wav');}catch(_0x77880b){logger[_0x1371('0x2b')](_0x77880b);}return _0x5e38ea;}return this[_0x1371('0x35')][_0x1371('0x2b')](_0x2392cf,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0x1371('0xe')]['awslex']=function(_0x5ad31e){logger['info'](util[_0x1371('0x27')](_0x1371('0xf6'),_0x5ad31e[_0x1371('0x37')]));if(!this['isConfigured'](_0x5ad31e[_0x1371('0x66')])||!this[_0x1371('0x64')](_0x5ad31e['aws_secret_access_key'])){return this[_0x1371('0x35')][_0x1371('0x8d')](_0x1371('0xf3'));}if(!this['isConfigured'](_0x5ad31e[_0x1371('0x6c')])){return this[_0x1371('0x35')][_0x1371('0x8d')](_0x1371('0xf7'));}if(!this[_0x1371('0x64')](_0x5ad31e['text'])){return this['channel'][_0x1371('0x8d')](_0x1371('0x96'));}this[_0x1371('0x35')][_0x1371('0xc0')]=!![];this['createSquareDetailsReport'](_0x5ad31e);this[_0x1371('0x41')](_0x5ad31e[_0x1371('0x5a')],'in');this[_0x1371('0x35')][_0x1371('0x8d')](util[_0x1371('0x27')](_0x1371('0xf8'),_0x5ad31e[_0x1371('0x5a')]));var _0x36ded3=this[_0x1371('0x6a')]['sync'](this,_0x5ad31e);if(_0x36ded3){for(var _0x2b9459 in _0x36ded3){if(_0x36ded3[_0x1371('0x74')](_0x2b9459)&&_[_0x1371('0x75')](_0x36ded3[_0x2b9459])){this[_0x1371('0x35')][_0x1371('0x7d')](util['format'](_0x1371('0xf9'),_0x2b9459[_0x1371('0xce')]()),_0x36ded3[_0x2b9459]);}}if(_[_0x1371('0x44')](_0x36ded3[_0x1371('0xfa')])){return this[_0x1371('0x35')]['noop'](_0x1371('0xfb'));}else{this['createSquareMessage'](_0x36ded3[_0x1371('0xfa')],_0x1371('0xcf'));return this[_0x1371('0x35')][_0x1371('0x8d')](util[_0x1371('0x27')](_0x1371('0xfc'),_0x36ded3[_0x1371('0xfa')]));}}return this[_0x1371('0x35')][_0x1371('0x2b')](_0x5ad31e,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices['prototype'][_0x1371('0xfd')]=function(_0x223c8f){logger[_0x1371('0x2d')](util[_0x1371('0x27')](_0x1371('0xfe'),_0x223c8f[_0x1371('0x37')],_0x223c8f['timeout']));if(!this[_0x1371('0x64')](_0x223c8f['key'])){return this[_0x1371('0x35')][_0x1371('0x8d')]('no\x20key\x20configured');}var _0x564d3=_0x1371('0xff');var _0x2c8281=util['format']('%s/recordings/%s',FILES_PATH,rs[_0x1371('0xee')](0x4));var _0x543267=util[_0x1371('0x27')](_0x1371('0x100'),_0x2c8281,_0x564d3);var _0xf5cd5f=!![];if(_0x223c8f[_0x1371('0x101')]===_0x1371('0x102')){_0xf5cd5f=![];}var _0x102eba=this[_0x1371('0x35')][_0x1371('0x103')](_0x2c8281,_0x564d3,_0x223c8f[_0x1371('0x104')],_0x223c8f[_0x1371('0x86')],undefined,_0xf5cd5f);if(_0x102eba[_0x1371('0x89')]!==-0x1){this[_0x1371('0x35')][_0x1371('0x8d')](util[_0x1371('0x27')](_0x1371('0x105'),_0x543267));var _0x1baa97=this[_0x1371('0x6d')]['sync'](this,_0x223c8f,_0x543267);if(_0x1baa97){for(var _0xa710f3 in _0x1baa97){if(_0x1baa97[_0x1371('0x74')](_0xa710f3)){this['channel'][_0x1371('0x7d')](util[_0x1371('0x27')](_0x1371('0x106'),_0xa710f3['toUpperCase']()),_0x1baa97[_0xa710f3]);}}return this[_0x1371('0x35')][_0x1371('0x8d')](util[_0x1371('0x27')](_0x1371('0x107'),JSON[_0x1371('0xe8')](_0x1baa97)));}}return _0x102eba;};AGIVertices[_0x1371('0xe')][_0x1371('0x108')]=function(_0x2cfcc3){logger[_0x1371('0x2d')](util[_0x1371('0x27')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x2cfcc3[_0x1371('0x37')]));if(!this[_0x1371('0x64')](_0x2cfcc3[_0x1371('0x109')])){return this['channel'][_0x1371('0x8d')](_0x1371('0x10a'));}if(!this[_0x1371('0x64')](_0x2cfcc3[_0x1371('0x70')])){return this[_0x1371('0x35')][_0x1371('0x8d')]('no\x20appsecret\x20configured');}var _0x358e18='wav';var _0x316ea8=util[_0x1371('0x27')](_0x1371('0x10b'),FILES_PATH,rs[_0x1371('0xee')](0x4));var _0x4dc009=util[_0x1371('0x27')]('%s.%s',_0x316ea8,_0x358e18);var _0x635b70=!![];if(_0x2cfcc3[_0x1371('0x101')]===_0x1371('0x102')){_0x635b70=![];}var _0x23adc9=this['channel']['recordFile'](_0x316ea8,_0x358e18,_0x2cfcc3['intKey'],_0x2cfcc3['timeout'],undefined,_0x635b70);if(_0x23adc9[_0x1371('0x89')]!==-0x1){this[_0x1371('0x35')]['noop'](util['format'](_0x1371('0x10c'),_0x4dc009));var _0x5da154=this[_0x1371('0x6f')][_0x1371('0x80')](this,_0x2cfcc3,_0x4dc009);if(_0x5da154){for(var _0x132a91 in _0x5da154){if(_0x5da154['hasOwnProperty'](_0x132a91)){this[_0x1371('0x35')]['setVariable'](util['format'](_0x1371('0x10d'),_0x132a91[_0x1371('0xce')]()),_0x5da154[_0x132a91]);}}return this[_0x1371('0x35')][_0x1371('0x8d')](util[_0x1371('0x27')]('TildeASR\x20Result\x20%s',JSON[_0x1371('0xe8')](_0x5da154)));}}return _0x23adc9;};AGIVertices[_0x1371('0xe')][_0x1371('0x10e')]=function(_0x53e0da){logger[_0x1371('0x2d')](util['format'](_0x1371('0x10f'),_0x53e0da['label']));return this[_0x1371('0x35')][_0x1371('0x110')](_0x53e0da[_0x1371('0x3b')],_0x53e0da['extension'],_0x53e0da['priority']);};AGIVertices['prototype'][_0x1371('0x111')]=function(_0x149b2c){logger[_0x1371('0x2d')](util[_0x1371('0x27')](_0x1371('0x112'),_0x149b2c[_0x1371('0x37')]));if(!this[_0x1371('0x64')](_0x149b2c[_0x1371('0x113')])){return this[_0x1371('0x35')][_0x1371('0x2b')](_0x149b2c,_0x1371('0x114'));}try{var _0x367079=eval(_0x149b2c[_0x1371('0x113')])?_0x1371('0x115'):_0x1371('0x116');this['channel'][_0x1371('0x8d')](util[_0x1371('0x27')](_0x1371('0x117'),_0x149b2c[_0x1371('0x113')],_0x367079));return{'code':0xc8,'result':_0x367079};}catch(_0x52bb03){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x1371('0xe')]['gotoiftime']=function(_0x21ad0f){logger['info'](util[_0x1371('0x27')](_0x1371('0x118'),_0x21ad0f[_0x1371('0x37')]));if(!this[_0x1371('0x64')](_0x21ad0f[_0x1371('0x119')])){return this['channel'][_0x1371('0x2b')](_0x21ad0f,_0x1371('0x11a'));}var _0x414483=this[_0x1371('0x11b')][_0x1371('0x80')](this,_0x21ad0f[_0x1371('0x119')]);if(!_0x414483){return this['channel'][_0x1371('0x2b')](_0x21ad0f,'no\x20intervals\x20found');}for(var _0x1aed48=0x0;_0x1aed48<_0x414483[_0x1371('0x78')];_0x1aed48+=0x1){var _0x57f760=this[_0x1371('0x35')][_0x1371('0xf')](util['format']('IFTIME(%s?true:false)',_0x414483[_0x1aed48]));if(_0x57f760[_0x1371('0x89')]===-0x1){return _0x57f760;}logger[_0x1371('0x2d')](util[_0x1371('0x27')]('IFTIME\x20%s\x20%s',_0x414483[_0x1aed48],_0x57f760[_0x1371('0x7a')]));if(_0x57f760[_0x1371('0x7a')]==='true'){logger[_0x1371('0x2d')](util[_0x1371('0x27')](_0x1371('0x11c'),_0x414483[_0x1aed48],_0x1371('0x115')));this[_0x1371('0x35')][_0x1371('0x8d')](util['format'](_0x1371('0x11c'),_0x414483[_0x1aed48],_0x1371('0x115')));return{'code':0xc8,'result':_0x1371('0x115')};}else{logger[_0x1371('0x2d')](util['format'](_0x1371('0x11c'),_0x414483[_0x1aed48],_0x1371('0x116')));this[_0x1371('0x35')][_0x1371('0x8d')](util[_0x1371('0x27')](_0x1371('0x11c'),_0x414483[_0x1aed48],_0x1371('0x116')));}}return{'code':0xc8,'result':_0x1371('0x116')};};AGIVertices[_0x1371('0xe')]['hangup']=function(_0x49fec1){logger[_0x1371('0x2d')](util[_0x1371('0x27')](_0x1371('0x11d'),_0x49fec1[_0x1371('0x37')]));return this[_0x1371('0x35')][_0x1371('0x11e')]();};AGIVertices['prototype']['ispeechasr']=function(_0xf267fa){logger['info'](util['format'](_0x1371('0x11f'),_0xf267fa[_0x1371('0x37')]));if(!this[_0x1371('0x64')](_0xf267fa['key'])){return this[_0x1371('0x35')][_0x1371('0x8d')](_0x1371('0x120'));}var _0xe6033a=_0x1371('0xff');var _0x1fe48f=util[_0x1371('0x27')](_0x1371('0x10b'),FILES_PATH,rs[_0x1371('0xee')](0x4));var _0x591e5e=util[_0x1371('0x27')](_0x1371('0x100'),_0x1fe48f,_0xe6033a);var _0x53d700=!![];if(_0xf267fa['beep']===_0x1371('0x102')){_0x53d700=![];}var _0x509c6d=this[_0x1371('0x35')][_0x1371('0x103')](_0x1fe48f,_0xe6033a,_0xf267fa[_0x1371('0x104')],_0xf267fa[_0x1371('0x86')],undefined,_0x53d700);if(_0x509c6d[_0x1371('0x89')]!==-0x1){this[_0x1371('0x35')][_0x1371('0x8d')](util['format']('ispeech\x20%s\x20file\x20created',_0x591e5e));var _0x5dee8b=this[_0x1371('0x62')][_0x1371('0x80')](this,_0xf267fa,_0x591e5e);if(_0x5dee8b){for(var _0x2ef430 in _0x5dee8b){if(_0x5dee8b['hasOwnProperty'](_0x2ef430)){this[_0x1371('0x35')]['setVariable'](util[_0x1371('0x27')]('ISPEECH_ASR_%s',_0x2ef430[_0x1371('0xce')]()),_0x5dee8b[_0x2ef430]);}}return this[_0x1371('0x35')][_0x1371('0x8d')](util[_0x1371('0x27')](_0x1371('0x121'),JSON[_0x1371('0xe8')](_0x5dee8b)));}}return _0x509c6d;};AGIVertices[_0x1371('0xe')][_0x1371('0x122')]=function(_0x4e96b2){logger[_0x1371('0x2d')](util[_0x1371('0x27')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x4e96b2[_0x1371('0x37')]));if(!this['isConfigured'](_0x4e96b2['key'])){return this[_0x1371('0x35')][_0x1371('0x8d')](_0x1371('0x120'));}if(!this[_0x1371('0x64')](_0x4e96b2[_0x1371('0x5a')])){return this[_0x1371('0x35')][_0x1371('0x8d')]('no\x20text\x20configured');}this[_0x1371('0x35')][_0x1371('0x8d')](util['format'](_0x1371('0x123'),_0x4e96b2[_0x1371('0x5a')]));var _0x29b6bf=this['ispeechTTS'][_0x1371('0x80')](this,_0x4e96b2);if(_0x29b6bf){this[_0x1371('0x35')][_0x1371('0x8d')](util[_0x1371('0x27')](_0x1371('0x124'),_0x29b6bf));var _0x4540cd=this[_0x1371('0x35')][_0x1371('0xf5')](_0x29b6bf,_0x4e96b2[_0x1371('0x104')]);try{fs[_0x1371('0xd2')](_0x29b6bf+_0x1371('0xd3'));}catch(_0x3b9898){logger['error'](_0x3b9898);}return _0x4540cd;}return this[_0x1371('0x35')][_0x1371('0x2b')](_0x4e96b2,_0x1371('0x125'));};AGIVertices[_0x1371('0xe')][_0x1371('0x126')]=function(_0x1fdef7){logger[_0x1371('0x2d')](util[_0x1371('0x27')](_0x1371('0x127'),_0x1fdef7['label']));if(!this[_0x1371('0x64')](_0x1fdef7['findBy'])){return this[_0x1371('0x35')][_0x1371('0x2b')](_0x1fdef7,_0x1371('0x128'));}logger['info'](util['format'](_0x1371('0x129'),this['channel'][_0x1371('0x39')],_0x1fdef7[_0x1371('0x12a')]));var _0x74893=this['agentLogin'][_0x1371('0x80')](this,_0x1fdef7['findBy']);if(_0x74893){logger['info'](util[_0x1371('0x27')](_0x1371('0x12b'),this[_0x1371('0x35')][_0x1371('0x39')],_0x1fdef7['findBy']));this[_0x1371('0x35')][_0x1371('0x8d')](util[_0x1371('0x27')](_0x1371('0x12b'),this['channel'][_0x1371('0x39')],_0x1fdef7['findBy']));return{'code':0xc8,'result':_0x1371('0x12c')};}else{logger[_0x1371('0x2d')](util[_0x1371('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x1371('0x35')][_0x1371('0x39')],_0x1fdef7['findBy']));this[_0x1371('0x35')][_0x1371('0x8d')](util['format'](_0x1371('0x12d'),this[_0x1371('0x35')]['callerid'],_0x1fdef7[_0x1371('0x12a')]));return{'code':0xc8,'result':_0x1371('0x12e')};}};AGIVertices[_0x1371('0xe')][_0x1371('0x12f')]=function(_0x344ffb){logger['info'](util[_0x1371('0x27')](_0x1371('0x130'),_0x344ffb[_0x1371('0x37')]));if(!this['isConfigured'](_0x344ffb[_0x1371('0x12a')])){return this[_0x1371('0x35')]['error'](_0x344ffb,_0x1371('0x128'));}logger[_0x1371('0x2d')](util[_0x1371('0x27')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x1371('0x35')][_0x1371('0x39')],_0x344ffb['findBy']));var _0x236ad0=this['agentLogout'][_0x1371('0x80')](this,_0x344ffb['findBy']);if(_0x236ad0){logger['info'](util[_0x1371('0x27')](_0x1371('0x12b'),this[_0x1371('0x35')]['callerid'],_0x344ffb[_0x1371('0x12a')]));this['channel']['noop'](util[_0x1371('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x1371('0x35')][_0x1371('0x39')],_0x344ffb[_0x1371('0x12a')]));return{'code':0xc8,'result':_0x1371('0x12c')};}else{logger['info'](util[_0x1371('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x1371('0x39')],_0x344ffb[_0x1371('0x12a')]));this[_0x1371('0x35')][_0x1371('0x8d')](util[_0x1371('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0x344ffb[_0x1371('0x12a')]));return{'code':0xc8,'result':_0x1371('0x12e')};}};AGIVertices[_0x1371('0xe')][_0x1371('0x131')]=function(_0x5f5365){logger[_0x1371('0x2d')](util['format'](_0x1371('0x132'),_0x5f5365[_0x1371('0x37')]));if(!this['isConfigured'](_0x5f5365[_0x1371('0x133')])){return this[_0x1371('0x35')]['error'](_0x5f5365,_0x1371('0x134'));}this[_0x1371('0x35')]['noop'](util[_0x1371('0x27')](_0x1371('0x135'),_0x5f5365['operation']));var _0xefbcd4=eval(_0x5f5365[_0x1371('0x133')]);if(!this['isConfigured'](_0x5f5365['variable_id'])){return this[_0x1371('0x35')][_0x1371('0x8d')](_0x1371('0xe4'));}var _0x3abf90=this[_0x1371('0xf')]['sync'](this,_0x5f5365[_0x1371('0xaf')]);if(!_0x3abf90){return this[_0x1371('0x35')][_0x1371('0x2b')](_0x5f5365,'no\x20variable\x20found');}if(_[_0x1371('0x136')](_0xefbcd4)){var _0x5f1513=this;_0xefbcd4[_0x1371('0xb2')](function(_0xb7fa2d,_0x2236a8){_0x5f1513[_0x1371('0x35')][_0x1371('0x7d')](util[_0x1371('0x27')](_0x1371('0x137'),_0x3abf90,_0x2236a8),_0xb7fa2d);});return this['channel'][_0x1371('0x8d')](util['format'](_0x1371('0x138'),_0x3abf90));}else{return this[_0x1371('0x35')][_0x1371('0x7d')](_0x3abf90,_0xefbcd4);}};AGIVertices['prototype']['menu']=function(_0x3dcb5d){logger[_0x1371('0x2d')](util['format'](_0x1371('0x139'),_0x3dcb5d['label']));if(_0x3dcb5d['retry']===0x0){return this['maxRetry'](_0x3dcb5d);}_0x3dcb5d[_0x1371('0x81')]-=0x1;if(!this['isConfigured'](_0x3dcb5d[_0x1371('0xe2')])){return this[_0x1371('0x35')][_0x1371('0x2b')](_0x3dcb5d,_0x1371('0xe1'));}var _0x299ed1=this[_0x1371('0x1d')][_0x1371('0x80')](this,_0x3dcb5d[_0x1371('0xe2')]);if(!_0x299ed1){return this[_0x1371('0x35')][_0x1371('0x2b')](_0x3dcb5d,_0x1371('0xe3'));}var _0x15d3cc=this[_0x1371('0x35')][_0x1371('0xe5')](_0x299ed1,_0x3dcb5d[_0x1371('0xe6')],_0x3dcb5d[_0x1371('0x13a')]);var _0x4a47e7=_0x15d3cc[_0x1371('0x89')];if(_0x15d3cc[_0x1371('0x89')]===-0x1){this[_0x1371('0x7f')][_0x1371('0x80')](this,_0x3dcb5d,'-1');return _0x15d3cc;}else if(_0x15d3cc[_0x1371('0x7a')]==='timeout'){_0x15d3cc[_0x1371('0x89')]=_0x15d3cc['result'][_0x1371('0x78')]>0x0?_0x15d3cc[_0x1371('0x89')]:'t';}else if(_[_0x1371('0x43')](_0x15d3cc['result'])){_0x15d3cc[_0x1371('0x89')]='#';_0x4a47e7='#';}if(!this[_0x1371('0x64')](_0x3dcb5d[_0x1371('0xaf')])){this['channel'][_0x1371('0x8d')](_0x1371('0xe4'));}else{var _0xe24650=this[_0x1371('0xf')][_0x1371('0x80')](this,_0x3dcb5d[_0x1371('0xaf')]);if(!_0xe24650){return this['channel']['error'](_0x3dcb5d,'no\x20variable\x20found');}this[_0x1371('0x35')]['setVariable'](_0xe24650,_0x4a47e7);}this[_0x1371('0x7f')][_0x1371('0x80')](this,_0x3dcb5d,_0x4a47e7);return _0x15d3cc;};AGIVertices['prototype'][_0x1371('0x8d')]=function(_0x45b75b){logger[_0x1371('0x2d')](util[_0x1371('0x27')](_0x1371('0x13b'),_0x45b75b[_0x1371('0x37')]));return this[_0x1371('0x35')][_0x1371('0x8d')](_0x45b75b['output']||_0x45b75b[_0x1371('0x37')]);};AGIVertices[_0x1371('0xe')][_0x1371('0x13c')]=function(_0x354f9b){logger[_0x1371('0x2d')](util[_0x1371('0x27')](_0x1371('0x13d'),_0x354f9b[_0x1371('0x37')]));if(!this[_0x1371('0x64')](_0x354f9b['findBy'])){return this[_0x1371('0x35')]['error'](_0x354f9b,_0x1371('0x128'));}logger[_0x1371('0x2d')](util['format'](_0x1371('0x129'),this[_0x1371('0x35')]['callerid'],_0x354f9b[_0x1371('0x12a')]));var _0x3eafe9=this[_0x1371('0x4c')][_0x1371('0x80')](this,_0x354f9b[_0x1371('0x13e')]);var _0x30e972=this[_0x1371('0x4e')][_0x1371('0x80')](this,_0x354f9b[_0x1371('0x12a')],_0x3eafe9);if(_0x30e972){logger[_0x1371('0x2d')](util['format'](_0x1371('0x12b'),this[_0x1371('0x35')]['callerid'],_0x354f9b['findBy']));this[_0x1371('0x35')][_0x1371('0x8d')](util['format'](_0x1371('0x12b'),this[_0x1371('0x35')][_0x1371('0x39')],_0x354f9b[_0x1371('0x12a')]));return{'code':0xc8,'result':_0x1371('0x12c')};}else{logger[_0x1371('0x2d')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x1371('0x35')][_0x1371('0x39')],_0x354f9b[_0x1371('0x12a')]));this[_0x1371('0x35')][_0x1371('0x8d')](util[_0x1371('0x27')](_0x1371('0x12b'),this['channel'][_0x1371('0x39')],_0x354f9b[_0x1371('0x12a')]));return{'code':0xc8,'result':_0x1371('0x12e')};}};AGIVertices[_0x1371('0xe')]['playback']=function(_0x414081){logger[_0x1371('0x2d')](util[_0x1371('0x27')](_0x1371('0x13f'),_0x414081['label']));if(!this['isConfigured'](_0x414081['file_id'])){return this['channel']['error'](_0x414081,_0x1371('0xe1'));}var _0x1a8f90=this[_0x1371('0x1d')][_0x1371('0x80')](this,_0x414081[_0x1371('0xe2')]);if(!_0x1a8f90){return this[_0x1371('0x35')][_0x1371('0x2b')](_0x414081,'no\x20file\x20audio\x20found');}var _0x5462dc=this[_0x1371('0x35')][_0x1371('0x57')](_0x1371('0x140'),[_0x1a8f90,_0x414081[_0x1371('0xbc')]]);if(_0x5462dc['result']===-0x1){return _0x5462dc;}return this[_0x1371('0x35')]['noop'](util[_0x1371('0x27')](_0x1371('0x92'),_0x1371('0x140'),_0x1a8f90));};AGIVertices[_0x1371('0xe')][_0x1371('0x141')]=function(_0x76d75f){logger['info'](util[_0x1371('0x27')](_0x1371('0x142'),_0x76d75f[_0x1371('0x37')]));if(!this[_0x1371('0x64')](_0x76d75f[_0x1371('0x143')])){return this['channel']['error'](_0x76d75f,_0x1371('0x144'));}var _0x46e032='';var _0x374859=parseInt(_0x76d75f[_0x1371('0x143')],0xa);if(isNaN(_0x374859)){_0x46e032=_0x76d75f[_0x1371('0x143')];}else{_0x46e032=this[_0x1371('0x12')]['sync'](this,_0x76d75f[_0x1371('0x143')]);if(!_0x46e032){return this['channel']['error'](_0x76d75f,'no\x20queue\x20found');}}var _0x5bef2c='';if(this[_0x1371('0x64')](_0x76d75f[_0x1371('0xe2')])){var _0x32667f=this[_0x1371('0x1d')][_0x1371('0x80')](this,_0x76d75f[_0x1371('0xe2')]);if(_0x32667f){_0x5bef2c=_0x32667f;}}this[_0x1371('0x7f')][_0x1371('0x80')](this,_0x76d75f,_0x46e032);if(_0x76d75f['opts'][_0x1371('0x145')]('x')<0x0){_0x76d75f['opts']+='x';}if(_0x76d75f[_0x1371('0xbc')]['indexOf']('X')<0x0){_0x76d75f['opts']+='X';}this['channel'][_0x1371('0x7d')](_0x1371('0x146'),_0x46e032?_0x46e032['toLowerCase']():'');var _0x220bff=this[_0x1371('0x35')][_0x1371('0x57')]('QUEUE',[_0x46e032,_0x76d75f[_0x1371('0xbc')],_0x76d75f[_0x1371('0xbd')],_0x5bef2c,_0x76d75f[_0x1371('0x86')],_0x76d75f[_0x1371('0x7')],_0x76d75f[_0x1371('0x147')],_0x76d75f['gosub'],'',_0x76d75f[_0x1371('0x148')]]);if(_0x220bff['result']===-0x1){return _0x220bff;}return this[_0x1371('0x35')][_0x1371('0x8d')](util[_0x1371('0x27')](_0x1371('0x92'),_0x1371('0x149'),_0x46e032));};AGIVertices[_0x1371('0xe')][_0x1371('0x14a')]=function(_0x287cd1){logger[_0x1371('0x2d')](util[_0x1371('0x27')](_0x1371('0x14b'),_0x287cd1[_0x1371('0x37')]));var _0x4d4a57=_0x287cd1[_0x1371('0x14c')]||_0x1371('0xff');var _0x1f84c9=util[_0x1371('0x27')](_0x1371('0x14d'),this[_0x1371('0x35')][_0x1371('0x36')],rs['generate'](0x5));var _0x3ece86=util[_0x1371('0x27')](_0x1371('0x14e'),FILES_PATH,_0x1f84c9,_0x4d4a57);var _0xf51fa7=util['format'](_0x1371('0x10b'),FILES_PATH,_0x1f84c9);this[_0x1371('0x3a')][_0x1371('0x80')](this,_0x287cd1,_0x1f84c9,_0x3ece86);this['channel']['setVariable'](_0x1371('0x14f'),_0x1f84c9);logger[_0x1371('0x2d')](_0x1371('0x150'),_0xf51fa7,_0x4d4a57,_0x287cd1[_0x1371('0x151')],_0x287cd1[_0x1371('0x86')]);return this[_0x1371('0x35')][_0x1371('0x103')](_0xf51fa7,_0x4d4a57,_0x287cd1[_0x1371('0x151')],_0x287cd1[_0x1371('0x86')],undefined,!![]);};AGIVertices[_0x1371('0xe')][_0x1371('0x152')]=function(_0x19c95e){logger[_0x1371('0x2d')](util[_0x1371('0x27')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x19c95e[_0x1371('0x37')]));return this[_0x1371('0x35')]['sayDigits'](_0x19c95e[_0x1371('0x153')][_0x1371('0xad')](/\s+/g,''),_0x19c95e[_0x1371('0x151')]);};AGIVertices['prototype'][_0x1371('0x154')]=function(_0x3ea6b9){logger[_0x1371('0x2d')](util[_0x1371('0x27')](_0x1371('0x155'),_0x3ea6b9[_0x1371('0x37')]));return this[_0x1371('0x35')]['sayNumber'](_0x3ea6b9[_0x1371('0x156')][_0x1371('0xad')](/\s+/g,''),_0x3ea6b9[_0x1371('0x151')]);};AGIVertices[_0x1371('0xe')][_0x1371('0x157')]=function(_0x51c4ff){logger[_0x1371('0x2d')](util[_0x1371('0x27')](_0x1371('0x158'),_0x51c4ff[_0x1371('0x37')]));return this[_0x1371('0x35')][_0x1371('0x159')](_0x51c4ff[_0x1371('0x5a')],_0x51c4ff[_0x1371('0x151')]);};AGIVertices[_0x1371('0xe')][_0x1371('0x15a')]=function(_0x2a644a){logger[_0x1371('0x2d')](util['format'](_0x1371('0x15b'),_0x2a644a[_0x1371('0x37')]));if(!this[_0x1371('0x64')](_0x2a644a['account_id'])){return this[_0x1371('0x35')][_0x1371('0x8d')](_0x1371('0x15c'));}var _0x418ae0=this[_0x1371('0x21')][_0x1371('0x80')](this,_0x2a644a['account_id']);if(!_0x418ae0||!_0x418ae0[_0x1371('0x15d')]){return this[_0x1371('0x35')][_0x1371('0x2b')](_0x2a644a,_0x1371('0x15e'));}var _0x298e1e={'from':util[_0x1371('0x27')](_0x1371('0x15f'),_0x418ae0['name'],_0x418ae0['email']||_0x418ae0['Smtp']['user']),'to':_0x2a644a['to']||'','cc':_0x2a644a['cc']||'','bcc':_0x2a644a['bcc']||'','subject':_0x2a644a['subject'],'html':_0x2a644a[_0x1371('0x5a')],'text':_0x2a644a['text']};var _0x1550b4={'tls':{'rejectUnauthorized':![]}};if(_0x418ae0[_0x1371('0x15d')]['service']){_0x1550b4[_0x1371('0x160')]=_0x418ae0[_0x1371('0x15d')][_0x1371('0x160')];}else{_0x1550b4[_0x1371('0x161')]=_0x418ae0[_0x1371('0x15d')]['host'];_0x1550b4[_0x1371('0x162')]=_0x418ae0[_0x1371('0x15d')][_0x1371('0x162')];_0x1550b4['secure']=_0x418ae0[_0x1371('0x15d')]['secure'];}if(_0x418ae0[_0x1371('0x15d')][_0x1371('0x163')]){_0x1550b4[_0x1371('0x164')]={'user':_0x418ae0[_0x1371('0x15d')]['user'],'pass':_0x418ae0['Smtp']['pass']};}if(this[_0x1371('0x64')](_0x2a644a[_0x1371('0x165')])){}logger[_0x1371('0x166')]('sendMail\x20message',JSON['stringify'](_0x298e1e));this[_0x1371('0x7f')][_0x1371('0x80')](this,_0x2a644a,_0x2a644a['account_id']);this[_0x1371('0x35')][_0x1371('0x8d')](util[_0x1371('0x27')](_0x1371('0x167'),_0x418ae0[_0x1371('0x14')]));this['sendMailMessage'][_0x1371('0x80')](this,_0x1550b4,_0x298e1e);return this[_0x1371('0x35')][_0x1371('0x8d')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x1371('0xe')][_0x1371('0x168')]=function(_0x12bbdf){logger[_0x1371('0x2d')](util[_0x1371('0x27')](_0x1371('0x169'),_0x12bbdf[_0x1371('0x37')]));return this[_0x1371('0x35')][_0x1371('0x8d')](_0x1371('0x16a'));};AGIVertices['prototype'][_0x1371('0x16b')]=function(_0x4ed201){logger[_0x1371('0x2d')](util['format'](_0x1371('0x16c'),_0x4ed201[_0x1371('0x37')]));if(!this[_0x1371('0x64')](_0x4ed201[_0x1371('0x16d')])){return this[_0x1371('0x35')]['noop']('no\x20sms\x20account\x20configured');}var _0x24608e=this['getSmsAccount'][_0x1371('0x80')](this,_0x4ed201[_0x1371('0x16d')]);if(!_0x24608e){return this[_0x1371('0x35')][_0x1371('0x2b')](_0x4ed201,'no\x20sms\x20account\x20found');}var _0x4450b0={'body':_0x4ed201[_0x1371('0x16e')],'phone':_0x4ed201['to']||'','SmsAccountId':_0x24608e['id']};logger[_0x1371('0x166')](_0x1371('0x16f'),JSON[_0x1371('0xe8')](_0x4450b0));this[_0x1371('0x7f')][_0x1371('0x80')](this,_0x4ed201,_0x4ed201[_0x1371('0x16d')]);this[_0x1371('0x35')][_0x1371('0x8d')](util[_0x1371('0x27')](_0x1371('0x170'),_0x24608e[_0x1371('0x14')]));this[_0x1371('0x34')][_0x1371('0x80')](this,_0x4450b0);return this['channel'][_0x1371('0x8d')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x1371('0xe')]['set']=function(_0x49606d){logger[_0x1371('0x2d')](util[_0x1371('0x27')](_0x1371('0x171'),_0x49606d[_0x1371('0x37')]));if(!this[_0x1371('0x64')](_0x49606d['variable_id'])){return this[_0x1371('0x35')][_0x1371('0x2b')](_0x49606d,_0x1371('0x172'));}var _0x15b286=this[_0x1371('0xf')][_0x1371('0x80')](this,_0x49606d['variable_id']);if(!_0x15b286){return this['channel']['error'](_0x49606d,_0x1371('0xb0'));}return this[_0x1371('0x35')][_0x1371('0x7d')](_0x15b286,_0x49606d['variable_value']);};AGIVertices['prototype'][_0x1371('0x173')]=function(_0x3afa2f){logger[_0x1371('0x2d')](util[_0x1371('0x27')](_0x1371('0x174'),_0x3afa2f[_0x1371('0x37')]));this[_0x1371('0x35')][_0x1371('0x8d')](_0x1371('0x175'));if(_0x3afa2f['answer']===_0x1371('0x176')){this['channel'][_0x1371('0x8d')]('Answer');return this[_0x1371('0x35')]['answer']();}return this[_0x1371('0x35')][_0x1371('0x8d')]('Skipped\x20Answer');};AGIVertices[_0x1371('0xe')][_0x1371('0x177')]=function(_0x503b24){logger[_0x1371('0x2d')](util[_0x1371('0x27')](_0x1371('0x178'),_0x503b24[_0x1371('0x37')]));if(!this[_0x1371('0x64')](_0x503b24['project_id'])){return this[_0x1371('0x35')][_0x1371('0x2b')](_0x503b24,'no\x20subproject\x20selected');}var _0x1be972=this[_0x1371('0x16')][_0x1371('0x80')](this,_0x503b24[_0x1371('0x179')]);if(!this[_0x1371('0x64')](_0x1be972)){return this[_0x1371('0x35')]['error'](_0x503b24,util[_0x1371('0x27')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x503b24[_0x1371('0x179')]));}if(_0x1be972===this['channel'][_0x1371('0x40')]){return this['channel'][_0x1371('0x2b')](_0x503b24,_0x1371('0x17a'));}this[_0x1371('0x7f')][_0x1371('0x80')](this,_0x503b24,_0x1be972);var _0x1a173a=this['channel'][_0x1371('0x57')]('AGI',util[_0x1371('0x27')](_0x1371('0x17b'),config['agi'][_0x1371('0x161')]||'127.0.0.1',_0x1be972,this[_0x1371('0x35')][_0x1371('0x40')]));if(_0x1a173a['result']===-0x1){return _0x1a173a;}return this['channel'][_0x1371('0x8d')](util[_0x1371('0x27')]('Executed\x20command\x20%s\x20%s',_0x1371('0x17c'),_0x1be972));};AGIVertices[_0x1371('0xe')]['system']=function(_0x3d6499){logger['info'](util[_0x1371('0x27')](_0x1371('0x17d'),_0x3d6499[_0x1371('0x37')]));var _0x2f3e87=this['shellCommand'][_0x1371('0x80')](this,_0x3d6499[_0x1371('0x83')]);this[_0x1371('0x7f')]['sync'](this,_0x3d6499,_0x3d6499[_0x1371('0x83')]);if(this[_0x1371('0x64')](_0x3d6499[_0x1371('0xaf')])){var _0xca87d7=this['getVariable']['sync'](this,_0x3d6499[_0x1371('0xaf')]);if(_0xca87d7){this[_0x1371('0x35')][_0x1371('0x7d')](_0xca87d7,_0x2f3e87);return this[_0x1371('0x35')][_0x1371('0x8d')](util[_0x1371('0x27')](_0x1371('0x17e'),_0x3d6499[_0x1371('0x83')],_0xca87d7));}}return this[_0x1371('0x35')][_0x1371('0x8d')](util[_0x1371('0x27')](_0x1371('0x17f'),_0x3d6499[_0x1371('0x83')]));};AGIVertices['prototype'][_0x1371('0x180')]=function(_0x341847){logger[_0x1371('0x2d')](util['format'](_0x1371('0x181'),_0x341847[_0x1371('0x37')]));if(!this[_0x1371('0x64')](_0x341847['text'])){return this[_0x1371('0x35')][_0x1371('0x8d')](_0x1371('0x96'));}this[_0x1371('0x35')]['noop'](util[_0x1371('0x27')]('Trying\x20Google\x20TTS\x20%s',_0x341847['text']));var _0x4fbdc9=this[_0x1371('0x59')]['sync'](this,_0x341847);if(_0x4fbdc9){this[_0x1371('0x35')][_0x1371('0x8d')](util[_0x1371('0x27')]('Google\x20TTS\x20%s\x20file\x20created',_0x4fbdc9));var _0x1556c8=this[_0x1371('0x35')][_0x1371('0xf5')](_0x4fbdc9);try{fs['unlink'](_0x4fbdc9+_0x1371('0xd3'));}catch(_0x175a5d){logger['error'](_0x175a5d);}return _0x1556c8;}return this['channel'][_0x1371('0x2b')](_0x341847,_0x1371('0x182'));};AGIVertices[_0x1371('0xe')][_0x1371('0x183')]=function(_0x147797){logger['info'](util['format'](_0x1371('0x184'),_0x147797[_0x1371('0x37')]));if(!this[_0x1371('0x64')](_0x147797[_0x1371('0x12a')])){return this[_0x1371('0x35')][_0x1371('0x2b')](_0x147797,_0x1371('0x128'));}logger[_0x1371('0x2d')](util[_0x1371('0x27')](_0x1371('0x129'),this[_0x1371('0x35')][_0x1371('0x39')],_0x147797[_0x1371('0x12a')]));var _0x4d69fe=this[_0x1371('0x4f')]['sync'](this,_0x147797[_0x1371('0x12a')]);if(_0x4d69fe){logger[_0x1371('0x2d')](util[_0x1371('0x27')](_0x1371('0x12b'),this[_0x1371('0x35')][_0x1371('0x39')],_0x147797[_0x1371('0x12a')]));this[_0x1371('0x35')][_0x1371('0x8d')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x1371('0x35')][_0x1371('0x39')],_0x147797[_0x1371('0x12a')]));return{'code':0xc8,'result':_0x1371('0x12c')};}else{logger[_0x1371('0x2d')](util[_0x1371('0x27')](_0x1371('0x12d'),this[_0x1371('0x35')]['callerid'],_0x147797[_0x1371('0x12a')]));this['channel']['noop'](util[_0x1371('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x1371('0x35')][_0x1371('0x39')],_0x147797[_0x1371('0x12a')]));return{'code':0xc8,'result':_0x1371('0x12e')};}};AGIVertices['prototype'][_0x1371('0x185')]=function(_0x5db51e){logger[_0x1371('0x2d')](util[_0x1371('0x27')](_0x1371('0x186'),_0x5db51e[_0x1371('0x37')]));var _0x35cbf9=this[_0x1371('0x35')]['exec']('VOICEMAIL',[_0x5db51e[_0x1371('0x187')],_0x5db51e[_0x1371('0x91')]]);if(_0x35cbf9[_0x1371('0x89')]===-0x1){return _0x35cbf9;}return this[_0x1371('0x35')][_0x1371('0x8d')](util['format'](_0x1371('0x92'),_0x1371('0x188'),_0x5db51e[_0x1371('0x187')]));};AGIVertices[_0x1371('0xe')][_0x1371('0x189')]=function(_0x4af15b){logger[_0x1371('0x2d')](util['format'](_0x1371('0x18a'),_0x4af15b[_0x1371('0x37')]));if(!this['isConfigured'](_0x4af15b[_0x1371('0xaf')])){return this['channel'][_0x1371('0x2b')](_0x4af15b,_0x1371('0x172'));}var _0x44f98f=this[_0x1371('0xf')][_0x1371('0x80')](this,_0x4af15b[_0x1371('0xaf')]);if(!_0x44f98f){return this[_0x1371('0x35')][_0x1371('0x2b')](_0x4af15b,_0x1371('0xb0'));}var _0x57f49d=this[_0x1371('0x35')][_0x1371('0xf')](_0x44f98f);return{'code':0xc8,'result':_0x57f49d[_0x1371('0x7a')]?_0x57f49d[_0x1371('0x7a')]:'-'};};String['prototype'][_0x1371('0x79')]=function(_0x133574,_0x4ce630){return this[_0x1371('0x77')](_0x133574)['join'](_0x4ce630);};module[_0x1371('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 9b714fa..2aa49c2 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 _0x00bb=['transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','all','[ACW][syncAgentRingNoAnswer]\x20%s','util','lodash','moment','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','interface','ACW','mandatoryDispositionPause','name','Action','then','agents','getAgent','voicePause','info','destlinkedid','savePause','timer','stopAcw','acwTimeout','format','uniqueid','updateAcw','lastPauseAt','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','prototype','queue','saveUnpause','update','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','mandatoryDisposition','acw','[ACW][syncAgentConnectPreview]\x20%s','linkedid','isUndefined','attended','startAcw','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil'];(function(_0x15be23,_0x508f7d){var _0x4747e4=function(_0x1e7e13){while(--_0x1e7e13){_0x15be23['push'](_0x15be23['shift']());}};_0x4747e4(++_0x508f7d);}(_0x00bb,0x1d8));var _0xb00b=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x00bb[_0x29b609];return _0x54c952;};'use strict';var util=require(_0xb00b('0x0'));var _=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var ami=require('../ami');var logger=require(_0xb00b('0x3'))('acw');var RpcUser=require(_0xb00b('0x4'));var RpcVoiceAgentReport=require(_0xb00b('0x5'));function Acw(_0x582ef9){this[_0xb00b('0x6')]=_0x582ef9[_0xb00b('0x6')];this['agents']=_0x582ef9['agents'];this['timers']=_0x582ef9[_0xb00b('0x7')];this[_0xb00b('0x8')]={};ami['on'](_0xb00b('0x9'),this[_0xb00b('0xa')][_0xb00b('0xb')](this));ami['on'](_0xb00b('0xc'),this['syncHangupRequest']['bind'](this));ami['on'](_0xb00b('0xd'),this[_0xb00b('0xe')][_0xb00b('0xb')](this));ami['on'](_0xb00b('0xf'),this[_0xb00b('0x10')]['bind'](this));ami['on'](_0xb00b('0x11'),this['syncAttendedTransfer']['bind'](this));ami['on']('blindtransfer',this[_0xb00b('0x12')][_0xb00b('0xb')](this));ami['on'](_0xb00b('0x13'),this[_0xb00b('0x14')][_0xb00b('0xb')](this));}function getDiff(_0x1f1c1d){var _0x4ada81=moment()[_0xb00b('0x15')](0x0);var _0xb0d42e=moment(_0x1f1c1d)['milliseconds'](0x0);return _0x4ada81[_0xb00b('0x16')](_0xb0d42e,_0xb00b('0x17'));}Acw['prototype']['startAcw']=function(_0x9b471e){try{var _0x4dcd45=this;var _0x51d136=this[_0xb00b('0x8')][_0x9b471e][_0xb00b('0x18')];var _0x387d97=this[_0xb00b('0x8')][_0x9b471e]['queue'];var _0x2a7231=this['voiceQueues'][_0x387d97];var _0x415f91=![];var _0x5aa9a0=_0xb00b('0x19');if(_0x2a7231['mandatoryDisposition']){if(_0x2a7231[_0xb00b('0x1a')][_0xb00b('0x1b')]){_0x415f91=!![];_0x5aa9a0=_0x2a7231['mandatoryDispositionPause']['name'];}}ami[_0xb00b('0x1c')]({'action':'QueuePause','interface':_0x51d136,'paused':!![],'reason':_0x5aa9a0})[_0xb00b('0x1d')](function(_0x43da66){if(_0x4dcd45[_0xb00b('0x1e')][_0x51d136]){return RpcUser[_0xb00b('0x1f')](_0x4dcd45['agents'][_0x51d136]['id'])[_0xb00b('0x1d')](function(_0x4df284){if(_0x4df284&&!_0x4df284[_0xb00b('0x20')]){logger[_0xb00b('0x21')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x9b471e,_0x51d136,_0x387d97);var _0x231293=_0x4dcd45[_0xb00b('0x8')][_0x9b471e]['attended']&&_0x4dcd45[_0xb00b('0x8')][_0x9b471e][_0xb00b('0x22')]?_0x4dcd45['channels'][_0x9b471e][_0xb00b('0x22')]:_0x9b471e;return RpcUser[_0xb00b('0x23')](_0x4dcd45[_0xb00b('0x1e')][_0x51d136],_0x5aa9a0,_0x231293)[_0xb00b('0x1d')](function(_0x520e55){if(!_0x415f91){_0x4dcd45['timers'][_0x51d136]={};logger[_0xb00b('0x21')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x9b471e,_0x4dcd45['voiceQueues'][_0x387d97]['acwTimeout'],_0x51d136,_0x387d97);_0x4dcd45[_0xb00b('0x7')][_0x51d136][_0xb00b('0x24')]=setTimeout(_0x4dcd45[_0xb00b('0x25')][_0xb00b('0xb')](_0x4dcd45,_0x51d136),_0x4dcd45[_0xb00b('0x6')][_0x387d97][_0xb00b('0x26')]*0x3e8);_0x4dcd45[_0xb00b('0x7')][_0x51d136]['lastPauseAt']=moment()[_0xb00b('0x27')]('YYYY-MM-DD\x20HH:mm:ss');_0x4dcd45[_0xb00b('0x7')][_0x51d136][_0xb00b('0x28')]=_0x9b471e;_0x4dcd45[_0xb00b('0x7')][_0x51d136]['queue']=_0x387d97;_0x4dcd45[_0xb00b('0x7')][_0x51d136][_0xb00b('0x29')]=function(){var _0x16fbd5=getDiff(_0x4dcd45[_0xb00b('0x7')][_0x51d136][_0xb00b('0x2a')]);clearTimeout(_0x4dcd45[_0xb00b('0x7')][_0x51d136][_0xb00b('0x24')]);_0x4dcd45[_0xb00b('0x7')][_0x51d136][_0xb00b('0x24')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x16fbd5},_0x4dcd45[_0xb00b('0x7')][_0x51d136][_0xb00b('0x28')],_0x51d136)['then'](function(_0x593659){logger[_0xb00b('0x21')]('[%s][UPDATE][ACWTIME:%s]',_0x9b471e,_0x16fbd5,_0x593659);})[_0xb00b('0x2b')](function(_0x4d2ee5){logger[_0xb00b('0x2c')](_0xb00b('0x2d'),_0x9b471e,_0x4d2ee5);});delete _0x4dcd45[_0xb00b('0x7')][_0x51d136];};}});}else{logger[_0xb00b('0x21')](_0xb00b('0x2e'),_0x9b471e,_0x51d136,_0x387d97);}});}})[_0xb00b('0x2b')](function(_0x17f613){logger['error']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x9b471e,_0x4dcd45['voiceQueues'][_0x387d97][_0xb00b('0x26')],_0x51d136,_0x387d97);})[_0xb00b('0x2f')](function(){delete _0x4dcd45[_0xb00b('0x8')][_0x9b471e];});}catch(_0x2589cb){logger['error'](_0xb00b('0x30'),_0x2589cb[_0xb00b('0x31')]);}};Acw[_0xb00b('0x32')][_0xb00b('0x25')]=function(_0x261c80){try{var _0x39da49=this;if(_0x39da49[_0xb00b('0x7')][_0x261c80]){_0x39da49[_0xb00b('0x7')][_0x261c80]['timer']=![];var _0x55451e=_0x39da49[_0xb00b('0x7')][_0x261c80]['uniqueid'];var _0x1c8258=_0x39da49[_0xb00b('0x7')][_0x261c80][_0xb00b('0x33')];var _0x45ca74=_0x39da49[_0xb00b('0x6')][_0x1c8258][_0xb00b('0x26')];logger[_0xb00b('0x21')]('[TIMER][STOP][AGENT:%s]',_0x261c80);RpcUser[_0xb00b('0x34')](this[_0xb00b('0x1e')][_0x261c80]);RpcVoiceAgentReport[_0xb00b('0x35')]({'acwtime':_0x45ca74,'agentacw':!![]},_0x55451e,_0x261c80)[_0xb00b('0x1d')](function(_0x2496e2){logger[_0xb00b('0x21')]('[%s][UPDATE][ACWTIME:%s]',_0x55451e,_0x45ca74,_0x2496e2);})[_0xb00b('0x2b')](function(_0x3beb8f){logger['error'](_0xb00b('0x2d'),_0x55451e,_0x3beb8f);});}else{logger[_0xb00b('0x2c')](_0xb00b('0x36'),_0x261c80);if(_0x39da49[_0xb00b('0x7')]){logger[_0xb00b('0x21')]('[ACW][TIMERS]',JSON[_0xb00b('0x37')](_0x39da49[_0xb00b('0x7')]));}}}catch(_0xb76ede){logger[_0xb00b('0x2c')]('[ACW][STOP]\x20%s',_0xb76ede['message']);}};Acw[_0xb00b('0x32')][_0xb00b('0xa')]=function(_0x10a348){try{if(this[_0xb00b('0x6')][_0x10a348[_0xb00b('0x33')]]&&(this[_0xb00b('0x6')][_0x10a348[_0xb00b('0x33')]]['acw']||this[_0xb00b('0x6')][_0x10a348[_0xb00b('0x33')]][_0xb00b('0x38')])){if(this[_0xb00b('0x1e')][_0x10a348[_0xb00b('0x18')]]){this[_0xb00b('0x8')][_0x10a348[_0xb00b('0x28')]]={'queue':_0x10a348[_0xb00b('0x33')],'interface':_0x10a348[_0xb00b('0x18')],'destlinkedid':_0x10a348[_0xb00b('0x22')]};}}}catch(_0xc0dddd){logger[_0xb00b('0x2c')]('[ACW][syncAgentConnect]\x20%s',_0xc0dddd[_0xb00b('0x31')]);}};Acw[_0xb00b('0x32')][_0xb00b('0x14')]=function(_0x44afa0){try{if(this[_0xb00b('0x6')][_0x44afa0[_0xb00b('0x33')]]&&(this[_0xb00b('0x6')][_0x44afa0[_0xb00b('0x33')]][_0xb00b('0x39')]||this[_0xb00b('0x6')][_0x44afa0[_0xb00b('0x33')]][_0xb00b('0x38')])){if(this['agents'][_0x44afa0['interface']]){this['channels'][_0x44afa0[_0xb00b('0x28')]]={'queue':_0x44afa0[_0xb00b('0x33')],'interface':_0x44afa0['interface']};}}}catch(_0x31cee1){logger[_0xb00b('0x2c')](_0xb00b('0x3a'),_0x31cee1[_0xb00b('0x31')]);}};Acw['prototype']['syncHangupRequest']=function(_0x172729){try{if(this[_0xb00b('0x8')][_0x172729['uniqueid']]&&_['isUndefined'](this[_0xb00b('0x8')][_0x172729[_0xb00b('0x28')]]['attended'])){logger[_0xb00b('0x21')]('[%s][HANGUP:UNIQUEID]',_0x172729['uniqueid']);this['startAcw'](_0x172729[_0xb00b('0x28')]);}else if(this['channels'][_0x172729[_0xb00b('0x3b')]]&&_[_0xb00b('0x3c')](this[_0xb00b('0x8')][_0x172729[_0xb00b('0x3b')]][_0xb00b('0x3d')])){logger[_0xb00b('0x21')]('[%s][HANGUP:LINKEDID]',_0x172729['linkedid']);this[_0xb00b('0x3e')](_0x172729[_0xb00b('0x3b')]);}}catch(_0x559357){logger[_0xb00b('0x2c')](_0xb00b('0x3f'),_0x559357['message']);}};Acw[_0xb00b('0x32')][_0xb00b('0xe')]=function(_0x3b5d82){try{if(this['channels'][_0x3b5d82['uniqueid']]&&this[_0xb00b('0x8')][_0x3b5d82[_0xb00b('0x28')]][_0xb00b('0x3d')]){logger[_0xb00b('0x21')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x3b5d82[_0xb00b('0x28')]);this[_0xb00b('0x3e')](_0x3b5d82['uniqueid']);}else if(this['channels'][_0x3b5d82[_0xb00b('0x3b')]]&&this['channels'][_0x3b5d82[_0xb00b('0x3b')]][_0xb00b('0x3d')]){logger[_0xb00b('0x21')](_0xb00b('0x40'),_0x3b5d82[_0xb00b('0x3b')]);this[_0xb00b('0x3e')](_0x3b5d82['linkedid']);}}catch(_0x5d52a5){logger['error'](_0xb00b('0x41'),_0x5d52a5[_0xb00b('0x31')]);}};Acw[_0xb00b('0x32')]['syncAttendedTransfer']=function(_0x248335){try{if(!_[_0xb00b('0x42')](this[_0xb00b('0x8')][_0x248335['transfereeuniqueid']])){this[_0xb00b('0x3e')](_0x248335[_0xb00b('0x43')]);if(this[_0xb00b('0x8')][_0x248335[_0xb00b('0x44')]]){this[_0xb00b('0x8')][_0x248335[_0xb00b('0x44')]][_0xb00b('0x3d')]=!![];this[_0xb00b('0x8')][_0x248335['transfertargetuniqueid']]=this[_0xb00b('0x8')][_0x248335[_0xb00b('0x44')]];delete this[_0xb00b('0x8')][_0x248335['secondtransfereruniqueid']];}}else if(!_[_0xb00b('0x42')](this[_0xb00b('0x8')][_0x248335[_0xb00b('0x45')]])){this[_0xb00b('0x3e')](_0x248335[_0xb00b('0x45')]);if(this['channels'][_0x248335[_0xb00b('0x46')]]){this[_0xb00b('0x8')][_0x248335[_0xb00b('0x46')]][_0xb00b('0x3d')]=!![];this['channels'][_0x248335[_0xb00b('0x43')]]=this[_0xb00b('0x8')][_0x248335[_0xb00b('0x46')]];delete this[_0xb00b('0x8')][_0x248335[_0xb00b('0x46')]];}}}catch(_0x1e5ed8){logger[_0xb00b('0x2c')]('[ACW][syncAttendedTransfer]\x20%s',_0x1e5ed8[_0xb00b('0x31')]);}};Acw['prototype'][_0xb00b('0x12')]=function(_0x4c2186){try{if(this[_0xb00b('0x8')][_0x4c2186['transfereruniqueid']]){logger[_0xb00b('0x21')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0xb00b('0x37')](_0x4c2186[_0xb00b('0x47')]));this[_0xb00b('0x3e')](_0x4c2186['transfereruniqueid']);}else if(this['channels'][_0x4c2186['transfererlinkedid']]){logger[_0xb00b('0x21')](_0xb00b('0x48'),JSON[_0xb00b('0x37')](_0x4c2186['transfererlinkedid']));this[_0xb00b('0x3e')](_0x4c2186[_0xb00b('0x49')]);}}catch(_0xca87d4){logger[_0xb00b('0x2c')](_0xb00b('0x4a'),_0xca87d4['message']);}};Acw[_0xb00b('0x32')][_0xb00b('0x10')]=function(_0x5622a4){try{if(this[_0xb00b('0x6')][_0x5622a4[_0xb00b('0x33')]]&&this[_0xb00b('0x6')][_0x5622a4['queue']]['autopause']===_0xb00b('0x4b')){if(this[_0xb00b('0x1e')][_0x5622a4[_0xb00b('0x18')]]){logger['info']('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x5622a4['uniqueid'],_0x5622a4['interface'],_0x5622a4[_0xb00b('0x33')]);return RpcUser['savePause'](this[_0xb00b('0x1e')][_0x5622a4[_0xb00b('0x18')]],'Auto-Pause',_0x5622a4[_0xb00b('0x28')]);}}}catch(_0x1e7f3a){logger[_0xb00b('0x2c')](_0xb00b('0x4c'),_0x1e7f3a[_0xb00b('0x31')]);}};module['exports']=Acw; \ No newline at end of file +var _0xe14d=['agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','channels','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','Action','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','format','uniqueid','updateAcw','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','[ACW][START]\x20%s','message','saveUnpause','update','[%s][UPDATE][ACWTIME:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','startAcw','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','util','lodash','moment','../ami','acw','../rpc/user','voiceQueues','agents','timers','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup'];(function(_0x4fe70d,_0x58eb7a){var _0x2d820d=function(_0x910654){while(--_0x910654){_0x4fe70d['push'](_0x4fe70d['shift']());}};_0x2d820d(++_0x58eb7a);}(_0xe14d,0x1ee));var _0xde14=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0xe14d[_0x40bffc];return _0x3007e9;};'use strict';var util=require(_0xde14('0x0'));var _=require(_0xde14('0x1'));var moment=require(_0xde14('0x2'));var ami=require(_0xde14('0x3'));var logger=require('../../../config/logger')(_0xde14('0x4'));var RpcUser=require(_0xde14('0x5'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x1c3e94){this[_0xde14('0x6')]=_0x1c3e94[_0xde14('0x6')];this[_0xde14('0x7')]=_0x1c3e94[_0xde14('0x7')];this[_0xde14('0x8')]=_0x1c3e94['timers'];this['channels']={};ami['on'](_0xde14('0x9'),this[_0xde14('0xa')][_0xde14('0xb')](this));ami['on'](_0xde14('0xc'),this[_0xde14('0xd')][_0xde14('0xb')](this));ami['on'](_0xde14('0xe'),this[_0xde14('0xf')]['bind'](this));ami['on'](_0xde14('0x10'),this[_0xde14('0x11')][_0xde14('0xb')](this));ami['on'](_0xde14('0x12'),this[_0xde14('0x13')][_0xde14('0xb')](this));ami['on'](_0xde14('0x14'),this[_0xde14('0x15')][_0xde14('0xb')](this));ami['on'](_0xde14('0x16'),this[_0xde14('0x17')][_0xde14('0xb')](this));}function getDiff(_0x3521d4){var _0x281c54=moment()[_0xde14('0x18')](0x0);var _0x54c58b=moment(_0x3521d4)['milliseconds'](0x0);return _0x281c54[_0xde14('0x19')](_0x54c58b,_0xde14('0x1a'));}Acw[_0xde14('0x1b')]['startAcw']=function(_0x16aa55){try{var _0x31adb3=this;var _0x257390=this[_0xde14('0x1c')][_0x16aa55][_0xde14('0x1d')];var _0x1b9d4b=this[_0xde14('0x1c')][_0x16aa55][_0xde14('0x1e')];var _0x3cc317=this[_0xde14('0x6')][_0x1b9d4b];var _0x590a8b=![];var _0x3f5fcf=_0xde14('0x1f');if(_0x3cc317[_0xde14('0x20')]){if(_0x3cc317[_0xde14('0x21')]['name']){_0x590a8b=!![];_0x3f5fcf=_0x3cc317[_0xde14('0x21')]['name'];}}ami[_0xde14('0x22')]({'action':'QueuePause','interface':_0x257390,'paused':!![],'reason':_0x3f5fcf})[_0xde14('0x23')](function(_0x30fcf1){if(_0x31adb3[_0xde14('0x7')][_0x257390]){return RpcUser[_0xde14('0x24')](_0x31adb3[_0xde14('0x7')][_0x257390]['id'])[_0xde14('0x23')](function(_0x40b648){if(_0x40b648&&!_0x40b648[_0xde14('0x25')]){logger[_0xde14('0x26')](_0xde14('0x27'),_0x16aa55,_0x257390,_0x1b9d4b);var _0x475f2f=_0x31adb3[_0xde14('0x1c')][_0x16aa55][_0xde14('0x28')]&&_0x31adb3['channels'][_0x16aa55][_0xde14('0x29')]?_0x31adb3[_0xde14('0x1c')][_0x16aa55][_0xde14('0x29')]:_0x16aa55;return RpcUser[_0xde14('0x2a')](_0x31adb3[_0xde14('0x7')][_0x257390],_0x3f5fcf,_0x475f2f)[_0xde14('0x23')](function(_0x310d75){if(!_0x590a8b){_0x31adb3[_0xde14('0x8')][_0x257390]={};logger[_0xde14('0x26')](_0xde14('0x2b'),_0x16aa55,_0x31adb3['voiceQueues'][_0x1b9d4b][_0xde14('0x2c')],_0x257390,_0x1b9d4b);_0x31adb3[_0xde14('0x8')][_0x257390][_0xde14('0x2d')]=setTimeout(_0x31adb3[_0xde14('0x2e')]['bind'](_0x31adb3,_0x257390),_0x31adb3[_0xde14('0x6')][_0x1b9d4b][_0xde14('0x2c')]*0x3e8);_0x31adb3[_0xde14('0x8')][_0x257390]['lastPauseAt']=moment()[_0xde14('0x2f')]('YYYY-MM-DD\x20HH:mm:ss');_0x31adb3[_0xde14('0x8')][_0x257390][_0xde14('0x30')]=_0x16aa55;_0x31adb3[_0xde14('0x8')][_0x257390][_0xde14('0x1e')]=_0x1b9d4b;_0x31adb3[_0xde14('0x8')][_0x257390][_0xde14('0x31')]=function(){var _0xae9dca=getDiff(_0x31adb3[_0xde14('0x8')][_0x257390]['lastPauseAt']);clearTimeout(_0x31adb3[_0xde14('0x8')][_0x257390][_0xde14('0x2d')]);_0x31adb3['timers'][_0x257390][_0xde14('0x2d')]=![];RpcVoiceAgentReport['update']({'acwtime':_0xae9dca},_0x31adb3[_0xde14('0x8')][_0x257390][_0xde14('0x30')],_0x257390)[_0xde14('0x23')](function(_0x21a916){logger[_0xde14('0x26')]('[%s][UPDATE][ACWTIME:%s]',_0x16aa55,_0xae9dca,_0x21a916);})[_0xde14('0x32')](function(_0x57b98b){logger['error'](_0xde14('0x33'),_0x16aa55,_0x57b98b);});delete _0x31adb3[_0xde14('0x8')][_0x257390];};}});}else{logger[_0xde14('0x26')](_0xde14('0x34'),_0x16aa55,_0x257390,_0x1b9d4b);}});}})[_0xde14('0x32')](function(_0xa41c1e){logger[_0xde14('0x35')](_0xde14('0x2b'),_0x16aa55,_0x31adb3[_0xde14('0x6')][_0x1b9d4b]['acwTimeout'],_0x257390,_0x1b9d4b);})['finally'](function(){delete _0x31adb3[_0xde14('0x1c')][_0x16aa55];});}catch(_0x403007){logger[_0xde14('0x35')](_0xde14('0x36'),_0x403007[_0xde14('0x37')]);}};Acw[_0xde14('0x1b')][_0xde14('0x2e')]=function(_0x2b0bc4){try{var _0x2ac7ba=this;if(_0x2ac7ba['timers'][_0x2b0bc4]){_0x2ac7ba[_0xde14('0x8')][_0x2b0bc4]['timer']=![];var _0x4a363c=_0x2ac7ba['timers'][_0x2b0bc4][_0xde14('0x30')];var _0x258759=_0x2ac7ba[_0xde14('0x8')][_0x2b0bc4][_0xde14('0x1e')];var _0x1228d8=_0x2ac7ba[_0xde14('0x6')][_0x258759][_0xde14('0x2c')];logger[_0xde14('0x26')]('[TIMER][STOP][AGENT:%s]',_0x2b0bc4);RpcUser[_0xde14('0x38')](this[_0xde14('0x7')][_0x2b0bc4]);RpcVoiceAgentReport[_0xde14('0x39')]({'acwtime':_0x1228d8,'agentacw':!![]},_0x4a363c,_0x2b0bc4)[_0xde14('0x23')](function(_0x346566){logger[_0xde14('0x26')](_0xde14('0x3a'),_0x4a363c,_0x1228d8,_0x346566);})[_0xde14('0x32')](function(_0x50db0d){logger[_0xde14('0x35')](_0xde14('0x33'),_0x4a363c,_0x50db0d);});}else{logger[_0xde14('0x35')](_0xde14('0x3b'),_0x2b0bc4);if(_0x2ac7ba['timers']){logger['info'](_0xde14('0x3c'),JSON[_0xde14('0x3d')](_0x2ac7ba[_0xde14('0x8')]));}}}catch(_0x171080){logger[_0xde14('0x35')]('[ACW][STOP]\x20%s',_0x171080[_0xde14('0x37')]);}};Acw[_0xde14('0x1b')][_0xde14('0xa')]=function(_0x595fd5){try{if(this[_0xde14('0x6')][_0x595fd5['queue']]&&(this[_0xde14('0x6')][_0x595fd5['queue']][_0xde14('0x4')]||this[_0xde14('0x6')][_0x595fd5[_0xde14('0x1e')]][_0xde14('0x20')])){if(this[_0xde14('0x7')][_0x595fd5[_0xde14('0x1d')]]){this[_0xde14('0x1c')][_0x595fd5[_0xde14('0x30')]]={'queue':_0x595fd5['queue'],'interface':_0x595fd5[_0xde14('0x1d')],'destlinkedid':_0x595fd5['destlinkedid']};}}}catch(_0x430b22){logger['error'](_0xde14('0x3e'),_0x430b22[_0xde14('0x37')]);}};Acw[_0xde14('0x1b')][_0xde14('0x17')]=function(_0x40e7ae){try{if(this[_0xde14('0x6')][_0x40e7ae[_0xde14('0x1e')]]&&(this[_0xde14('0x6')][_0x40e7ae['queue']][_0xde14('0x4')]||this[_0xde14('0x6')][_0x40e7ae[_0xde14('0x1e')]][_0xde14('0x20')])){if(this['agents'][_0x40e7ae[_0xde14('0x1d')]]){this[_0xde14('0x1c')][_0x40e7ae[_0xde14('0x30')]]={'queue':_0x40e7ae[_0xde14('0x1e')],'interface':_0x40e7ae[_0xde14('0x1d')]};}}}catch(_0x19e12c){logger['error'](_0xde14('0x3f'),_0x19e12c['message']);}};Acw[_0xde14('0x1b')][_0xde14('0xd')]=function(_0x48a677){try{if(this[_0xde14('0x1c')][_0x48a677[_0xde14('0x30')]]&&_[_0xde14('0x40')](this[_0xde14('0x1c')][_0x48a677[_0xde14('0x30')]][_0xde14('0x28')])){logger[_0xde14('0x26')]('[%s][HANGUP:UNIQUEID]',_0x48a677[_0xde14('0x30')]);this['startAcw'](_0x48a677[_0xde14('0x30')]);}else if(this[_0xde14('0x1c')][_0x48a677[_0xde14('0x41')]]&&_[_0xde14('0x40')](this[_0xde14('0x1c')][_0x48a677[_0xde14('0x41')]][_0xde14('0x28')])){logger[_0xde14('0x26')](_0xde14('0x42'),_0x48a677[_0xde14('0x41')]);this['startAcw'](_0x48a677[_0xde14('0x41')]);}}catch(_0x1688c6){logger[_0xde14('0x35')](_0xde14('0x43'),_0x1688c6[_0xde14('0x37')]);}};Acw['prototype'][_0xde14('0xf')]=function(_0x4dc2e3){try{if(this[_0xde14('0x1c')][_0x4dc2e3[_0xde14('0x30')]]&&this[_0xde14('0x1c')][_0x4dc2e3[_0xde14('0x30')]][_0xde14('0x28')]){logger['info']('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x4dc2e3[_0xde14('0x30')]);this['startAcw'](_0x4dc2e3[_0xde14('0x30')]);}else if(this[_0xde14('0x1c')][_0x4dc2e3[_0xde14('0x41')]]&&this[_0xde14('0x1c')][_0x4dc2e3[_0xde14('0x41')]][_0xde14('0x28')]){logger[_0xde14('0x26')](_0xde14('0x44'),_0x4dc2e3[_0xde14('0x41')]);this['startAcw'](_0x4dc2e3[_0xde14('0x41')]);}}catch(_0x2c972b){logger[_0xde14('0x35')](_0xde14('0x45'),_0x2c972b[_0xde14('0x37')]);}};Acw['prototype'][_0xde14('0x13')]=function(_0x58790d){try{if(!_[_0xde14('0x46')](this[_0xde14('0x1c')][_0x58790d[_0xde14('0x47')]])){this[_0xde14('0x48')](_0x58790d[_0xde14('0x47')]);if(this[_0xde14('0x1c')][_0x58790d[_0xde14('0x49')]]){this[_0xde14('0x1c')][_0x58790d['secondtransfereruniqueid']]['attended']=!![];this['channels'][_0x58790d[_0xde14('0x4a')]]=this['channels'][_0x58790d['secondtransfereruniqueid']];delete this[_0xde14('0x1c')][_0x58790d[_0xde14('0x49')]];}}else if(!_[_0xde14('0x46')](this[_0xde14('0x1c')][_0x58790d[_0xde14('0x4a')]])){this[_0xde14('0x48')](_0x58790d[_0xde14('0x4a')]);if(this[_0xde14('0x1c')][_0x58790d[_0xde14('0x4b')]]){this['channels'][_0x58790d[_0xde14('0x4b')]][_0xde14('0x28')]=!![];this[_0xde14('0x1c')][_0x58790d['transfereeuniqueid']]=this[_0xde14('0x1c')][_0x58790d['origtransfereruniqueid']];delete this[_0xde14('0x1c')][_0x58790d[_0xde14('0x4b')]];}}}catch(_0x40ab83){logger[_0xde14('0x35')](_0xde14('0x4c'),_0x40ab83[_0xde14('0x37')]);}};Acw[_0xde14('0x1b')]['syncBlindTransfer']=function(_0x3a357a){try{if(this[_0xde14('0x1c')][_0x3a357a[_0xde14('0x4d')]]){logger[_0xde14('0x26')](_0xde14('0x4e'),JSON[_0xde14('0x3d')](_0x3a357a[_0xde14('0x4d')]));this['startAcw'](_0x3a357a['transfereruniqueid']);}else if(this[_0xde14('0x1c')][_0x3a357a[_0xde14('0x4f')]]){logger[_0xde14('0x26')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0xde14('0x3d')](_0x3a357a[_0xde14('0x4f')]));this[_0xde14('0x48')](_0x3a357a[_0xde14('0x4f')]);}}catch(_0x51e8ca){logger['error'](_0xde14('0x50'),_0x51e8ca[_0xde14('0x37')]);}};Acw[_0xde14('0x1b')][_0xde14('0x11')]=function(_0x136c21){try{if(this[_0xde14('0x6')][_0x136c21[_0xde14('0x1e')]]&&this[_0xde14('0x6')][_0x136c21[_0xde14('0x1e')]][_0xde14('0x51')]===_0xde14('0x52')){if(this[_0xde14('0x7')][_0x136c21[_0xde14('0x1d')]]){logger[_0xde14('0x26')](_0xde14('0x53'),_0x136c21[_0xde14('0x30')],_0x136c21[_0xde14('0x1d')],_0x136c21[_0xde14('0x1e')]);return RpcUser[_0xde14('0x2a')](this[_0xde14('0x7')][_0x136c21[_0xde14('0x1d')]],_0xde14('0x54'),_0x136c21[_0xde14('0x30')]);}}}catch(_0x4809fa){logger[_0xde14('0x35')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x4809fa[_0xde14('0x37')]);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 86bad55..98f1e20 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 _0x8146=['close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','info','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipPeerStatus','actionCoreShowChannels','exports','util','lodash','ami','../../config/environment','asterisk','port','keepConnected','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','Action','actionDeviceStateList','devicestatelist','sippeerstatus','actionQueueSummary','once'];(function(_0x27b7be,_0x538e2d){var _0x1aa77e=function(_0x52a210){while(--_0x52a210){_0x27b7be['push'](_0x27b7be['shift']());}};_0x1aa77e(++_0x538e2d);}(_0x8146,0x1eb));var _0x6814=function(_0x5bab26,_0x437a03){_0x5bab26=_0x5bab26-0x0;var _0x34e3f2=_0x8146[_0x5bab26];return _0x34e3f2;};'use strict';var Manager=require('asterisk-manager');var BPromise=require('bluebird');var moment=require('moment');var util=require(_0x6814('0x0'));var _=require(_0x6814('0x1'));var logger=require('../../config/logger')(_0x6814('0x2'));var config=require(_0x6814('0x3'));var ami=new Manager(config[_0x6814('0x4')][_0x6814('0x5')],config[_0x6814('0x4')]['ip'],config[_0x6814('0x4')]['username'],config[_0x6814('0x4')]['password'],!![]);ami[_0x6814('0x6')]();ami['Action']=BPromise['promisify'](ami[_0x6814('0x7')]);function error(_0x28799d){logger[_0x6814('0x8')](util[_0x6814('0x9')](_0x6814('0xa'),config[_0x6814('0x4')][_0x6814('0xb')],config[_0x6814('0x4')]['ip'],config[_0x6814('0x4')][_0x6814('0x5')],util[_0x6814('0xc')](_0x28799d,![],null)));}function close(){logger['error'](util[_0x6814('0x9')](_0x6814('0xd'),config[_0x6814('0x4')][_0x6814('0xb')],config[_0x6814('0x4')]['ip'],config[_0x6814('0x4')]['port']));}ami[_0x6814('0xe')]=function(){return function(){return ami[_0x6814('0xf')]({'action':'sipshowregistry'});};};ami[_0x6814('0x10')]=function(){return function(){return ami['Action']({'action':_0x6814('0x11')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0x6814('0xf')]({'action':_0x6814('0x12')});};};ami[_0x6814('0x13')]=function(){return function(){return ami[_0x6814('0xf')]({'action':'queuesummary'});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0x6814('0xf')]({'action':'coreshowchannels'});};};function connect(_0x114b5d){logger['info'](util[_0x6814('0x9')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0x6814('0x4')]['username'],config[_0x6814('0x4')]['ip'],config[_0x6814('0x4')]['port']));ami[_0x6814('0x14')](_0x6814('0x8'),error);ami[_0x6814('0x14')](_0x6814('0x15'),close);}ami['on'](_0x6814('0x16'),connect);ami['on'](_0x6814('0x17'),function(_0x5c35fa){logger['info'](util[_0x6814('0x9')](_0x6814('0x18'),config['asterisk'][_0x6814('0xb')],config[_0x6814('0x4')]['ip'],config['asterisk'][_0x6814('0x5')],util[_0x6814('0xc')](_0x5c35fa,![],null)));});ami['on']('fullybooted',function(_0x3c1dd2){logger[_0x6814('0x19')](util[_0x6814('0x9')](_0x6814('0x1a'),config['asterisk'][_0x6814('0xb')],config[_0x6814('0x4')]['ip'],config[_0x6814('0x4')][_0x6814('0x5')]));return BPromise[_0x6814('0x1b')]()[_0x6814('0x1c')](ami[_0x6814('0xe')]())['then'](ami[_0x6814('0x10')]())[_0x6814('0x1c')](ami[_0x6814('0x1d')]())[_0x6814('0x1c')](ami[_0x6814('0x13')]())[_0x6814('0x1c')](ami[_0x6814('0x1e')]())['catch'](function(_0x59ac9c){console['log'](_0x59ac9c);});});ami[_0x6814('0x14')](_0x6814('0x8'),error);ami[_0x6814('0x14')]('close',close);module[_0x6814('0x1f')]=ami; \ No newline at end of file +var _0xbcda=['Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','actionSipPeerStatus','sippeerstatus','queuesummary','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionCoreShowChannels','catch','log','exports','asterisk-manager','moment','util','lodash','../../config/logger','ami','../../config/environment','asterisk','port','username','password','keepConnected','Action','promisify','action','error','format'];(function(_0x278473,_0xb33f8a){var _0x1f6176=function(_0x1bdb25){while(--_0x1bdb25){_0x278473['push'](_0x278473['shift']());}};_0x1f6176(++_0xb33f8a);}(_0xbcda,0x189));var _0xabcd=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0xbcda[_0x1d9aa0];return _0x226868;};'use strict';var Manager=require(_0xabcd('0x0'));var BPromise=require('bluebird');var moment=require(_0xabcd('0x1'));var util=require(_0xabcd('0x2'));var _=require(_0xabcd('0x3'));var logger=require(_0xabcd('0x4'))(_0xabcd('0x5'));var config=require(_0xabcd('0x6'));var ami=new Manager(config[_0xabcd('0x7')][_0xabcd('0x8')],config['asterisk']['ip'],config[_0xabcd('0x7')][_0xabcd('0x9')],config[_0xabcd('0x7')][_0xabcd('0xa')],!![]);ami[_0xabcd('0xb')]();ami[_0xabcd('0xc')]=BPromise[_0xabcd('0xd')](ami[_0xabcd('0xe')]);function error(_0x4ff1a9){logger[_0xabcd('0xf')](util[_0xabcd('0x10')](_0xabcd('0x11'),config[_0xabcd('0x7')]['username'],config[_0xabcd('0x7')]['ip'],config['asterisk'][_0xabcd('0x8')],util[_0xabcd('0x12')](_0x4ff1a9,![],null)));}function close(){logger[_0xabcd('0xf')](util['format'](_0xabcd('0x13'),config[_0xabcd('0x7')][_0xabcd('0x9')],config[_0xabcd('0x7')]['ip'],config['asterisk'][_0xabcd('0x8')]));}ami[_0xabcd('0x14')]=function(){return function(){return ami[_0xabcd('0xc')]({'action':_0xabcd('0x15')});};};ami[_0xabcd('0x16')]=function(){return function(){return ami['Action']({'action':'devicestatelist'});};};ami[_0xabcd('0x17')]=function(){return function(){return ami['Action']({'action':_0xabcd('0x18')});};};ami['actionQueueSummary']=function(){return function(){return ami[_0xabcd('0xc')]({'action':_0xabcd('0x19')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0xabcd('0xc')]({'action':_0xabcd('0x1a')});};};function connect(_0x4dfb50){logger[_0xabcd('0x1b')](util[_0xabcd('0x10')](_0xabcd('0x1c'),config[_0xabcd('0x7')][_0xabcd('0x9')],config[_0xabcd('0x7')]['ip'],config[_0xabcd('0x7')][_0xabcd('0x8')]));ami[_0xabcd('0x1d')]('error',error);ami[_0xabcd('0x1d')](_0xabcd('0x1e'),close);}ami['on']('connect',connect);ami['on'](_0xabcd('0x1f'),function(_0x32529f){logger['info'](util[_0xabcd('0x10')](_0xabcd('0x20'),config[_0xabcd('0x7')][_0xabcd('0x9')],config['asterisk']['ip'],config[_0xabcd('0x7')][_0xabcd('0x8')],util['inspect'](_0x32529f,![],null)));});ami['on'](_0xabcd('0x21'),function(_0x13dbfa){logger['info'](util[_0xabcd('0x10')](_0xabcd('0x22'),config[_0xabcd('0x7')][_0xabcd('0x9')],config['asterisk']['ip'],config[_0xabcd('0x7')]['port']));return BPromise[_0xabcd('0x23')]()['then'](ami[_0xabcd('0x14')]())[_0xabcd('0x24')](ami[_0xabcd('0x16')]())[_0xabcd('0x24')](ami[_0xabcd('0x17')]())[_0xabcd('0x24')](ami['actionQueueSummary']())[_0xabcd('0x24')](ami[_0xabcd('0x25')]())[_0xabcd('0x26')](function(_0x4d4882){console[_0xabcd('0x27')](_0x4d4882);});});ami[_0xabcd('0x1d')]('error',error);ami[_0xabcd('0x1d')](_0xabcd('0x1e'),close);module[_0xabcd('0x28')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 91f0daf..b0952e1 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 _0x5803=['error','rpc','message','result','catch','jayson/promise','bluebird','ami','client','http','Request','request','then','memberReport'];(function(_0x48ee01,_0x32a83f){var _0x5f2c21=function(_0x5924f2){while(--_0x5924f2){_0x48ee01['push'](_0x48ee01['shift']());}};_0x5f2c21(++_0x32a83f);}(_0x5803,0x147));var _0x3580=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x5803[_0x413feb];return _0x40ee88;};'use strict';var jayson=require(_0x3580('0x0'));var BPromise=require(_0x3580('0x1'));var logger=require('../../config/logger')(_0x3580('0x2'));var client=jayson[_0x3580('0x3')][_0x3580('0x4')]({'port':0x2329});client[_0x3580('0x5')]=function(_0x345423,_0x53ec5b){return new BPromise(function(_0x9b5727,_0x3431f4){return client[_0x3580('0x6')](_0x345423,_0x53ec5b)[_0x3580('0x7')](function(_0x24f1c1){logger['debug']('rpc',_0x3580('0x8'),_0x345423,_0x53ec5b,_0x24f1c1);if(_0x24f1c1[_0x3580('0x9')]){logger[_0x3580('0x9')](_0x3580('0xa'),_0x3580('0x8'),_0x345423,_0x24f1c1['error'][_0x3580('0xb')],_0x53ec5b);return _0x3431f4(_0x24f1c1[_0x3580('0x9')][_0x3580('0xb')]);}else{return _0x9b5727(_0x24f1c1[_0x3580('0xc')]);}})[_0x3580('0xd')](function(_0x32217f){logger[_0x3580('0x9')](_0x3580('0xa'),_0x3580('0x8'),_0x345423,_0x32217f,_0x53ec5b);return _0x3431f4(_0x32217f);});});};module['exports']=client; \ No newline at end of file +var _0x74a6=['debug','memberReport','error','rpc','message','exports','bluebird','../../config/logger','client','http','request','then'];(function(_0x494a75,_0xdb8db9){var _0x518b3e=function(_0x5bec5){while(--_0x5bec5){_0x494a75['push'](_0x494a75['shift']());}};_0x518b3e(++_0xdb8db9);}(_0x74a6,0x192));var _0x674a=function(_0x4d674b,_0x176474){_0x4d674b=_0x4d674b-0x0;var _0x535a1f=_0x74a6[_0x4d674b];return _0x535a1f;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x674a('0x0'));var logger=require(_0x674a('0x1'))('ami');var client=jayson[_0x674a('0x2')][_0x674a('0x3')]({'port':0x2329});client['Request']=function(_0x248d1e,_0x4f3df9){return new BPromise(function(_0x1c886a,_0xf3623b){return client[_0x674a('0x4')](_0x248d1e,_0x4f3df9)[_0x674a('0x5')](function(_0x572276){logger[_0x674a('0x6')]('rpc',_0x674a('0x7'),_0x248d1e,_0x4f3df9,_0x572276);if(_0x572276['error']){logger[_0x674a('0x8')](_0x674a('0x9'),_0x674a('0x7'),_0x248d1e,_0x572276[_0x674a('0x8')][_0x674a('0xa')],_0x4f3df9);return _0xf3623b(_0x572276[_0x674a('0x8')][_0x674a('0xa')]);}else{return _0x1c886a(_0x572276['result']);}})['catch'](function(_0x40892f){logger['error'](_0x674a('0x9'),_0x674a('0x7'),_0x248d1e,_0x40892f,_0x4f3df9);return _0xf3623b(_0x40892f);});});};module[_0x674a('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 aa34ff8..c8e301b 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 _0x8583=['type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','dialCutDigit','number','substring','getQueue','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','queue'];(function(_0x588144,_0x29a077){var _0x5a6ae6=function(_0x473d66){while(--_0x473d66){_0x588144['push'](_0x588144['shift']());}};_0x5a6ae6(++_0x29a077);}(_0x8583,0x183));var _0x3858=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8583[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0x3858('0x0'));var _=require(_0x3858('0x1'));var moment=require(_0x3858('0x2'));function checkNameSurname(_0x5d9d48,_0x18d168,_0x1fa189){var _0x133116='';if(!_[_0x3858('0x3')](_0x18d168)&&_0x3858('0x4')===typeof _0x18d168){_0x133116+=_0x18d168;}if(!_[_0x3858('0x3')](_0x1fa189)&&_0x3858('0x4')===typeof _0x1fa189){_0x133116+='\x20'+_0x1fa189;}if(_0x133116!==''){return _0x133116;}return _0x5d9d48;}function Action(_0x1ff0df,_0x2dd673,_0x1796ef){this[_0x3858('0x5')]=_0x1ff0df;this[_0x3858('0x6')]=_0x1796ef||undefined;this[_0x3858('0x7')]=checkNameSurname(_0x2dd673[_0x3858('0x8')][_0x3858('0x9')],_0x2dd673[_0x3858('0x8')][_0x3858('0xa')],_0x2dd673[_0x3858('0x8')][_0x3858('0xb')]);this['number']=_0x2dd673[_0x3858('0x8')]['phone'];this[_0x3858('0xc')]=_0x1ff0df[_0x3858('0x7')];this['active']=_0x2dd673['active']||![];this['type']=_0x1ff0df[_0x3858('0xd')];this[_0x3858('0xe')]=_0x1ff0df[_0x3858('0xe')]||0x3;this[_0x3858('0xf')]=_0x2dd673[_0x3858('0xf')];this[_0x3858('0x10')]=_0x2dd673[_0x3858('0x10')];this['countcongestionretry']=_0x2dd673[_0x3858('0x11')];this[_0x3858('0x12')]=_0x2dd673[_0x3858('0x12')];this[_0x3858('0x13')]=_0x2dd673[_0x3858('0x13')];this[_0x3858('0x14')]=_0x2dd673['ListId'];this[_0x3858('0x15')]=_0x2dd673['UserId'];this[_0x3858('0x16')]=_0x2dd673[_0x3858('0x16')];this[_0x3858('0x17')]=_0x2dd673['CampaignId'];this[_0x3858('0x18')]=_0x2dd673['id'];this[_0x3858('0x19')]=_0x2dd673[_0x3858('0x8')]['firstName']||'';this['starttime']=moment()['format'](_0x3858('0x1a'));this[_0x3858('0x1b')]=_0x2dd673['callback'];this[_0x3858('0x1c')]=_0x2dd673[_0x3858('0x1c')];this['callbackat']=_0x2dd673['callbackat'];this[_0x3858('0x1d')]=_0x2dd673[_0x3858('0x1d')];this[_0x3858('0x1e')]='';this[_0x3858('0x1f')]='';}Action[_0x3858('0x20')][_0x3858('0x21')]=function(){return util[_0x3858('0x22')](_0x3858('0x23'),this['name'],this[_0x3858('0x5')][_0x3858('0x24')]>0x0?this[_0x3858('0x25')][_0x3858('0x26')](this[_0x3858('0x5')]['dialCutDigit']):this[_0x3858('0x25')]);};Action[_0x3858('0x20')][_0x3858('0x27')]=function(){return this[_0x3858('0xc')];};module['exports']=Action; \ No newline at end of file +var _0x6c2a=['dialCutDigit','number','substring','getQueue','exports','isNil','string','uniqueid','name','Contact','phone','lastName','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countnoanswerretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','firstName','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','voiceQueue'];(function(_0xcab6e3,_0x557093){var _0x94d411=function(_0x285881){while(--_0x285881){_0xcab6e3['push'](_0xcab6e3['shift']());}};_0x94d411(++_0x557093);}(_0x6c2a,0xbe));var _0xa6c2=function(_0x2556eb,_0x2795d0){_0x2556eb=_0x2556eb-0x0;var _0x9a882e=_0x6c2a[_0x2556eb];return _0x9a882e;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x1339ce,_0x527d76,_0x5d3665){var _0xdf6c3a='';if(!_[_0xa6c2('0x0')](_0x527d76)&&_0xa6c2('0x1')===typeof _0x527d76){_0xdf6c3a+=_0x527d76;}if(!_[_0xa6c2('0x0')](_0x5d3665)&&_0xa6c2('0x1')===typeof _0x5d3665){_0xdf6c3a+='\x20'+_0x5d3665;}if(_0xdf6c3a!==''){return _0xdf6c3a;}return _0x1339ce;}function Action(_0x5de3d5,_0x1a4189,_0x2576b6){this['voiceQueue']=_0x5de3d5;this[_0xa6c2('0x2')]=_0x2576b6||undefined;this[_0xa6c2('0x3')]=checkNameSurname(_0x1a4189[_0xa6c2('0x4')][_0xa6c2('0x5')],_0x1a4189[_0xa6c2('0x4')]['firstName'],_0x1a4189[_0xa6c2('0x4')][_0xa6c2('0x6')]);this['number']=_0x1a4189[_0xa6c2('0x4')][_0xa6c2('0x5')];this[_0xa6c2('0x7')]=_0x5de3d5[_0xa6c2('0x3')];this[_0xa6c2('0x8')]=_0x1a4189[_0xa6c2('0x8')]||![];this[_0xa6c2('0x9')]=_0x5de3d5[_0xa6c2('0x9')];this['dialQueueTimeout']=_0x5de3d5[_0xa6c2('0xa')]||0x3;this[_0xa6c2('0xb')]=_0x1a4189[_0xa6c2('0xb')];this[_0xa6c2('0xc')]=_0x1a4189[_0xa6c2('0xc')];this['countcongestionretry']=_0x1a4189['countcongestionretry'];this[_0xa6c2('0xd')]=_0x1a4189[_0xa6c2('0xd')];this[_0xa6c2('0xe')]=_0x1a4189[_0xa6c2('0xe')];this['ListId']=_0x1a4189[_0xa6c2('0xf')];this[_0xa6c2('0x10')]=_0x1a4189[_0xa6c2('0x10')];this[_0xa6c2('0x11')]=_0x1a4189['VoiceQueueId'];this[_0xa6c2('0x12')]=_0x1a4189[_0xa6c2('0x12')];this[_0xa6c2('0x13')]=_0x1a4189['id'];this['ContactFirstName']=_0x1a4189[_0xa6c2('0x4')][_0xa6c2('0x14')]||'';this['starttime']=moment()['format'](_0xa6c2('0x15'));this[_0xa6c2('0x16')]=_0x1a4189[_0xa6c2('0x16')];this['callbackuniqueid']=_0x1a4189[_0xa6c2('0x17')];this['callbackat']=_0x1a4189[_0xa6c2('0x18')];this[_0xa6c2('0x19')]=_0x1a4189[_0xa6c2('0x19')];this['originatecalleridnum']='';this[_0xa6c2('0x1a')]='';}Action[_0xa6c2('0x1b')][_0xa6c2('0x1c')]=function(){return util[_0xa6c2('0x1d')](_0xa6c2('0x1e'),this[_0xa6c2('0x3')],this[_0xa6c2('0x1f')][_0xa6c2('0x20')]>0x0?this[_0xa6c2('0x21')][_0xa6c2('0x22')](this[_0xa6c2('0x1f')][_0xa6c2('0x20')]):this['number']);};Action[_0xa6c2('0x1b')][_0xa6c2('0x23')]=function(){return this['queue'];};module[_0xa6c2('0x24')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 08b84c5..463b6ea 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 _0x9458=['talktime','endtime','membername','reason','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','seconds','state','statedesc','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','name','number','starttime','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime'];(function(_0x29741d,_0x2d4cd3){var _0x257f94=function(_0x99610d){while(--_0x99610d){_0x29741d['push'](_0x29741d['shift']());}};_0x257f94(++_0x2d4cd3);}(_0x9458,0xd7));var _0x8945=function(_0x3856eb,_0x1043a6){_0x3856eb=_0x3856eb-0x0;var _0x5a44f2=_0x9458[_0x3856eb];return _0x5a44f2;};'use strict';var util=require(_0x8945('0x0'));var _=require(_0x8945('0x1'));var moment=require('moment');function getSeconds(_0x157370,_0x1447d2){var _0x1a600d=moment(_0x157370)[_0x8945('0x2')](0x0);var _0x36430a=moment(_0x1447d2)[_0x8945('0x2')](0x0);return _0x1a600d['diff'](_0x36430a,_0x8945('0x3'));}function AgentComplete(_0x3f7e8d,_0x476d8a){this[_0x8945('0x4')]=0x4;this[_0x8945('0x5')]='Answer';this['scheduledat']=_0x3f7e8d[_0x8945('0x6')];this[_0x8945('0x7')]=_0x3f7e8d[_0x8945('0x7')];this['campaigntype']=_0x3f7e8d['type']===_0x8945('0x8')?_0x8945('0x9'):_0x3f7e8d['type'];this['countbusyretry']=_0x3f7e8d[_0x8945('0xa')];this[_0x8945('0xb')]=_0x3f7e8d[_0x8945('0xb')];this[_0x8945('0xc')]=_0x3f7e8d[_0x8945('0xc')];this[_0x8945('0xd')]=_0x3f7e8d[_0x8945('0xa')]+_0x3f7e8d[_0x8945('0xb')]+_0x3f7e8d[_0x8945('0xc')];this['uniqueid']=_0x476d8a[_0x8945('0xe')];this[_0x8945('0xf')]=_0x3f7e8d[_0x8945('0x10')];this['calleridnum']=_0x3f7e8d[_0x8945('0x11')];this[_0x8945('0x12')]=_0x3f7e8d[_0x8945('0x12')];this[_0x8945('0x13')]=_0x3f7e8d[_0x8945('0x13')];this[_0x8945('0x14')]=_0x3f7e8d[_0x8945('0x14')];this['endtime']=moment()[_0x8945('0x15')](_0x8945('0x16'));this[_0x8945('0x17')]=getSeconds(_0x3f7e8d[_0x8945('0x13')],_0x3f7e8d[_0x8945('0x12')]);this[_0x8945('0x18')]=getSeconds(_0x3f7e8d[_0x8945('0x14')],_0x3f7e8d[_0x8945('0x13')]);this[_0x8945('0x19')]=getSeconds(this[_0x8945('0x1a')],_0x3f7e8d[_0x8945('0x14')]);this[_0x8945('0x9')]=_0x476d8a[_0x8945('0x9')];this[_0x8945('0x1b')]=_0x476d8a['membername'];this['reason']=_0x476d8a[_0x8945('0x1c')];this['callback']=_0x3f7e8d['callback'];this[_0x8945('0x1d')]=_0x3f7e8d['callbackuniqueid'];this[_0x8945('0x1e')]=_0x3f7e8d['callbackat'];this[_0x8945('0x1f')]=_0x3f7e8d[_0x8945('0x1f')];this[_0x8945('0x20')]=_0x3f7e8d[_0x8945('0x20')];this[_0x8945('0x21')]=_0x3f7e8d[_0x8945('0x21')];this['UserId']=_0x3f7e8d[_0x8945('0x22')];this['VoiceQueueId']=_0x3f7e8d[_0x8945('0x23')];this[_0x8945('0x24')]=_0x3f7e8d[_0x8945('0x24')];this[_0x8945('0x25')]=_0x3f7e8d['originatecalleridnum']||'';this[_0x8945('0x26')]=_0x3f7e8d[_0x8945('0x26')]||'';}module[_0x8945('0x27')]=AgentComplete; \ No newline at end of file +var _0x63bf=['queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','diff','seconds','state','Answer','type','outbound'];(function(_0x3ba7ed,_0x35c59b){var _0x29053b=function(_0x133066){while(--_0x133066){_0x3ba7ed['push'](_0x3ba7ed['shift']());}};_0x29053b(++_0x35c59b);}(_0x63bf,0x199));var _0xf63b=function(_0x79cac3,_0x5c84e8){_0x79cac3=_0x79cac3-0x0;var _0x4f1b02=_0x63bf[_0x79cac3];return _0x4f1b02;};'use strict';var util=require(_0xf63b('0x0'));var _=require('lodash');var moment=require(_0xf63b('0x1'));function getSeconds(_0x344057,_0x56f8eb){var _0x29b7f8=moment(_0x344057)[_0xf63b('0x2')](0x0);var _0x398653=moment(_0x56f8eb)[_0xf63b('0x2')](0x0);return _0x29b7f8[_0xf63b('0x3')](_0x398653,_0xf63b('0x4'));}function AgentComplete(_0x812c9c,_0x14fd2e){this[_0xf63b('0x5')]=0x4;this['statedesc']=_0xf63b('0x6');this['scheduledat']=_0x812c9c['scheduledat'];this[_0xf63b('0x7')]=_0x812c9c[_0xf63b('0x7')];this['campaigntype']=_0x812c9c['type']===_0xf63b('0x8')?_0xf63b('0x9'):_0x812c9c[_0xf63b('0x7')];this[_0xf63b('0xa')]=_0x812c9c[_0xf63b('0xa')];this[_0xf63b('0xb')]=_0x812c9c[_0xf63b('0xb')];this['countnoanswerretry']=_0x812c9c[_0xf63b('0xc')];this[_0xf63b('0xd')]=_0x812c9c[_0xf63b('0xa')]+_0x812c9c[_0xf63b('0xb')]+_0x812c9c[_0xf63b('0xc')];this[_0xf63b('0xe')]=_0x14fd2e[_0xf63b('0xe')];this[_0xf63b('0xf')]=_0x812c9c[_0xf63b('0x10')];this[_0xf63b('0x11')]=_0x812c9c[_0xf63b('0x12')];this['starttime']=_0x812c9c[_0xf63b('0x13')];this[_0xf63b('0x14')]=_0x812c9c['responsetime'];this[_0xf63b('0x15')]=_0x812c9c['answertime'];this[_0xf63b('0x16')]=moment()['format'](_0xf63b('0x17'));this[_0xf63b('0x18')]=getSeconds(_0x812c9c['responsetime'],_0x812c9c['starttime']);this[_0xf63b('0x19')]=getSeconds(_0x812c9c[_0xf63b('0x15')],_0x812c9c[_0xf63b('0x14')]);this['talktime']=getSeconds(this[_0xf63b('0x16')],_0x812c9c[_0xf63b('0x15')]);this['queue']=_0x14fd2e[_0xf63b('0x9')];this['membername']=_0x14fd2e[_0xf63b('0x1a')];this['reason']=_0x14fd2e[_0xf63b('0x1b')];this[_0xf63b('0x1c')]=_0x812c9c[_0xf63b('0x1c')];this[_0xf63b('0x1d')]=_0x812c9c[_0xf63b('0x1d')];this['callbackat']=_0x812c9c[_0xf63b('0x1e')];this[_0xf63b('0x1f')]=_0x812c9c[_0xf63b('0x1f')];this[_0xf63b('0x20')]=_0x812c9c[_0xf63b('0x20')];this[_0xf63b('0x21')]=_0x812c9c[_0xf63b('0x21')];this['UserId']=_0x812c9c[_0xf63b('0x22')];this['VoiceQueueId']=_0x812c9c['VoiceQueueId'];this['CampaignId']=_0x812c9c[_0xf63b('0x23')];this[_0xf63b('0x24')]=_0x812c9c[_0xf63b('0x24')]||'';this['originatecalleridname']=_0x812c9c[_0xf63b('0x25')]||'';}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 ce83d5b..85224b0 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 _0x6333=['ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','milliseconds','seconds','scheduledat','type','countbusyretry','countcongestionretry','countnoanswerretry','queue','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','ContactId'];(function(_0x49bf99,_0x4c00b7){var _0x190c6b=function(_0x58aee9){while(--_0x58aee9){_0x49bf99['push'](_0x49bf99['shift']());}};_0x190c6b(++_0x4c00b7);}(_0x6333,0x83));var _0x3633=function(_0xb9a83c,_0x16a98e){_0xb9a83c=_0xb9a83c-0x0;var _0x26dc9f=_0x6333[_0xb9a83c];return _0x26dc9f;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function getSeconds(_0x2aa20f,_0x528e8c){var _0x2c7f7e=moment(_0x2aa20f)[_0x3633('0x0')](0x0);var _0x596f7e=moment(_0x528e8c)[_0x3633('0x0')](0x0);return _0x2c7f7e['diff'](_0x596f7e,_0x3633('0x1'));}function Final(_0x36d3c5){this['uniqueid']=_0x36d3c5['uniqueid'];this[_0x3633('0x2')]=_0x36d3c5[_0x3633('0x2')];this[_0x3633('0x3')]=_0x36d3c5['type'];this['campaigntype']=_0x36d3c5[_0x3633('0x3')]==='outbound'?'queue':_0x36d3c5[_0x3633('0x3')];this[_0x3633('0x4')]=_0x36d3c5[_0x3633('0x4')];this['countcongestionretry']=_0x36d3c5[_0x3633('0x5')];this[_0x3633('0x6')]=_0x36d3c5['countnoanswerretry'];this['countglobal']=_0x36d3c5[_0x3633('0x4')]+_0x36d3c5['countcongestionretry']+_0x36d3c5['countnoanswerretry'];this[_0x3633('0x7')]=_0x36d3c5[_0x3633('0x7')];this[_0x3633('0x8')]=_0x36d3c5[_0x3633('0x8')];this[_0x3633('0x9')]=_0x36d3c5['calleridnum'];this[_0x3633('0xa')]=_0x36d3c5[_0x3633('0xa')];this[_0x3633('0xb')]=_0x36d3c5[_0x3633('0xb')];this['endtime']=_0x36d3c5['responsetime'];this[_0x3633('0xc')]=_0x36d3c5[_0x3633('0xc')]||0x0;this[_0x3633('0xd')]=_0x36d3c5[_0x3633('0xd')]||0x0;this[_0x3633('0xe')]=_0x36d3c5[_0x3633('0xe')]||0x0;this['callback']=_0x36d3c5[_0x3633('0xf')];this[_0x3633('0x10')]=_0x36d3c5['callbackuniqueid'];this['callbackat']=_0x36d3c5[_0x3633('0x11')];this['recallme']=_0x36d3c5['recallme'];this[_0x3633('0x12')]=_0x36d3c5[_0x3633('0x12')];this[_0x3633('0x13')]=_0x36d3c5['ListId'];this[_0x3633('0x14')]=_0x36d3c5[_0x3633('0x14')];this[_0x3633('0x15')]=_0x36d3c5['VoiceQueueId'];this[_0x3633('0x16')]=_0x36d3c5[_0x3633('0x16')];this[_0x3633('0x17')]=_0x36d3c5['originatecalleridnum']||'';this[_0x3633('0x18')]=_0x36d3c5[_0x3633('0x18')]||'';}module['exports']=Final; \ No newline at end of file +var _0x8814=['callback','callbackat','recallme','ContactId','UserId','CampaignId','originatecalleridnum','originatecalleridname','util','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','queue','calleridname','calleridnum','starttime','responsetime','holdtime','talktime'];(function(_0x11fda1,_0xf100ac){var _0x456101=function(_0x275569){while(--_0x275569){_0x11fda1['push'](_0x11fda1['shift']());}};_0x456101(++_0xf100ac);}(_0x8814,0x1b8));var _0x4881=function(_0x497b1e,_0x586379){_0x497b1e=_0x497b1e-0x0;var _0x3f72e1=_0x8814[_0x497b1e];return _0x3f72e1;};'use strict';var util=require(_0x4881('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x203d22,_0x4dcd6f){var _0x3c988d=moment(_0x203d22)[_0x4881('0x1')](0x0);var _0x1f44e5=moment(_0x4dcd6f)[_0x4881('0x1')](0x0);return _0x3c988d['diff'](_0x1f44e5,_0x4881('0x2'));}function Final(_0x37bab3){this[_0x4881('0x3')]=_0x37bab3[_0x4881('0x3')];this['scheduledat']=_0x37bab3[_0x4881('0x4')];this['type']=_0x37bab3[_0x4881('0x5')];this[_0x4881('0x6')]=_0x37bab3[_0x4881('0x5')]===_0x4881('0x7')?'queue':_0x37bab3[_0x4881('0x5')];this[_0x4881('0x8')]=_0x37bab3['countbusyretry'];this[_0x4881('0x9')]=_0x37bab3[_0x4881('0x9')];this[_0x4881('0xa')]=_0x37bab3[_0x4881('0xa')];this[_0x4881('0xb')]=_0x37bab3[_0x4881('0x8')]+_0x37bab3['countcongestionretry']+_0x37bab3[_0x4881('0xa')];this[_0x4881('0xc')]=_0x37bab3[_0x4881('0xc')];this[_0x4881('0xd')]=_0x37bab3['calleridname'];this[_0x4881('0xe')]=_0x37bab3[_0x4881('0xe')];this[_0x4881('0xf')]=_0x37bab3[_0x4881('0xf')];this[_0x4881('0x10')]=_0x37bab3[_0x4881('0x10')];this['endtime']=_0x37bab3['responsetime'];this['ringtime']=_0x37bab3['ringtime']||0x0;this[_0x4881('0x11')]=_0x37bab3[_0x4881('0x11')]||0x0;this['talktime']=_0x37bab3[_0x4881('0x12')]||0x0;this[_0x4881('0x13')]=_0x37bab3[_0x4881('0x13')];this['callbackuniqueid']=_0x37bab3['callbackuniqueid'];this['callbackat']=_0x37bab3[_0x4881('0x14')];this['recallme']=_0x37bab3[_0x4881('0x15')];this[_0x4881('0x16')]=_0x37bab3['ContactId'];this['ListId']=_0x37bab3['ListId'];this['UserId']=_0x37bab3[_0x4881('0x17')];this['VoiceQueueId']=_0x37bab3['VoiceQueueId'];this[_0x4881('0x18')]=_0x37bab3[_0x4881('0x18')];this[_0x4881('0x19')]=_0x37bab3[_0x4881('0x19')]||'';this[_0x4881('0x1a')]=_0x37bab3[_0x4881('0x1a')]||'';}module['exports']=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 85c4c7f..65b0e47 100644 --- a/server/services/ami/dialer/hangup.js +++ b/server/services/ami/dialer/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['countglobal','countcongestionretry','countnoanswerretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','type','outbound','queue','countbusyretry'];(function(_0x541ea6,_0x51cab6){var _0x3c3e84=function(_0xc06bed){while(--_0xc06bed){_0x541ea6['push'](_0x541ea6['shift']());}};_0x3c3e84(++_0x51cab6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function getSeconds(_0x5dd881,_0x550fbc){var _0x18d5c9=moment(_0x5dd881)['milliseconds'](0x0);var _0x333808=moment(_0x550fbc)[_0x0a9e('0x3')](0x0);return _0x18d5c9[_0x0a9e('0x4')](_0x333808,_0x0a9e('0x5'));}function Hangup(_0x981158,_0x57b080){this[_0x0a9e('0x6')]=0x4;this[_0x0a9e('0x7')]=_0x0a9e('0x8');this['scheduledat']=_0x981158['scheduledat'];this[_0x0a9e('0x9')]=_0x981158['type'];this['campaigntype']=_0x981158[_0x0a9e('0x9')]===_0x0a9e('0xa')?_0x0a9e('0xb'):_0x981158[_0x0a9e('0x9')];this[_0x0a9e('0xc')]=_0x981158[_0x0a9e('0xc')];this['countcongestionretry']=_0x981158['countcongestionretry'];this['countnoanswerretry']=_0x981158['countnoanswerretry'];this[_0x0a9e('0xd')]=_0x981158[_0x0a9e('0xc')]+_0x981158[_0x0a9e('0xe')]+_0x981158[_0x0a9e('0xf')];this[_0x0a9e('0x10')]=_0x57b080[_0x0a9e('0x10')];this['calleridname']=_0x981158[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x981158[_0x0a9e('0x13')];this[_0x0a9e('0x14')]=_0x981158[_0x0a9e('0x14')];this[_0x0a9e('0x15')]=_0x981158['responsetime'];this[_0x0a9e('0x16')]=moment()['format'](_0x0a9e('0x17'));this['ringtime']=getSeconds(_0x981158[_0x0a9e('0x15')],_0x981158[_0x0a9e('0x14')]);this['holdtime']=0x0;this[_0x0a9e('0x18')]=getSeconds(this['endtime'],_0x981158[_0x0a9e('0x15')]);this[_0x0a9e('0xb')]=_0x981158[_0x0a9e('0xb')];this[_0x0a9e('0x19')]=_0x0a9e('0x1a');this[_0x0a9e('0x1b')]=_0x57b080[_0x0a9e('0x1c')];this[_0x0a9e('0x1d')]=_0x981158[_0x0a9e('0x1d')];this[_0x0a9e('0x1e')]=_0x981158[_0x0a9e('0x1e')];this[_0x0a9e('0x1f')]=_0x981158['callbackat'];this[_0x0a9e('0x20')]=_0x981158[_0x0a9e('0x20')];this['ContactId']=_0x981158[_0x0a9e('0x21')];this['ListId']=_0x981158['ListId'];this[_0x0a9e('0x22')]=_0x981158[_0x0a9e('0x22')];this[_0x0a9e('0x23')]=_0x981158[_0x0a9e('0x23')];this['CampaignId']=_0x981158[_0x0a9e('0x24')];}module[_0x0a9e('0x25')]=Hangup; \ No newline at end of file +var _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(_0x4e6cb3,_0x4898f1){var _0x353df2=function(_0x24fed2){while(--_0x24fed2){_0x4e6cb3['push'](_0x4e6cb3['shift']());}};_0x353df2(++_0x4898f1);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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 f1b66a4..23674d1 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 _0x10ce=['talktime','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','seconds','uniqueid','scheduledat','type','queue','countcongestionretry','countnoanswerretry','calleridname','name','calleridnum','starttime','responsetime','endtime','ringtime'];(function(_0x2302a1,_0x4bc33d){var _0x413cae=function(_0x233632){while(--_0x233632){_0x2302a1['push'](_0x2302a1['shift']());}};_0x413cae(++_0x4bc33d);}(_0x10ce,0x168));var _0xe10c=function(_0x40373e,_0x199b15){_0x40373e=_0x40373e-0x0;var _0x31d1f9=_0x10ce[_0x40373e];return _0x31d1f9;};'use strict';var util=require(_0xe10c('0x0'));var _=require('lodash');var moment=require(_0xe10c('0x1'));function getSeconds(_0x332b7d,_0x2a4abf){var _0x12fad0=moment(_0x332b7d)[_0xe10c('0x2')](0x0);var _0x3668d8=moment(_0x2a4abf)[_0xe10c('0x2')](0x0);return _0x12fad0['diff'](_0x3668d8,_0xe10c('0x3'));}function History(_0x240701){this[_0xe10c('0x4')]=_0x240701[_0xe10c('0x4')];this[_0xe10c('0x5')]=_0x240701[_0xe10c('0x5')]||undefined;this[_0xe10c('0x6')]=_0x240701['type'];this['campaigntype']=_0x240701['type']==='outbound'?_0xe10c('0x7'):_0x240701[_0xe10c('0x6')];this['countbusyretry']=_0x240701['countbusyretry'];this[_0xe10c('0x8')]=_0x240701[_0xe10c('0x8')];this['countnoanswerretry']=_0x240701[_0xe10c('0x9')];this['countglobal']=_0x240701['countbusyretry']+_0x240701[_0xe10c('0x8')]+_0x240701[_0xe10c('0x9')];this[_0xe10c('0x7')]=_0x240701[_0xe10c('0x7')];this[_0xe10c('0xa')]=_0x240701[_0xe10c('0xb')];this[_0xe10c('0xc')]=_0x240701['number'];this[_0xe10c('0xd')]=_0x240701[_0xe10c('0xd')];this[_0xe10c('0xe')]=_0x240701[_0xe10c('0xe')];this[_0xe10c('0xf')]=_0x240701[_0xe10c('0xe')];this[_0xe10c('0x10')]=getSeconds(_0x240701[_0xe10c('0xe')],_0x240701[_0xe10c('0xd')]);this['holdtime']=0x0;this[_0xe10c('0x11')]=0x0;this[_0xe10c('0x12')]=_0x240701[_0xe10c('0x12')];this['callbackuniqueid']=_0x240701[_0xe10c('0x13')];this['callbackat']=_0x240701['callbackat'];this['recallme']=_0x240701[_0xe10c('0x14')];this['ContactId']=_0x240701[_0xe10c('0x15')];this[_0xe10c('0x16')]=_0x240701[_0xe10c('0x16')];this['UserId']=_0x240701[_0xe10c('0x17')];this[_0xe10c('0x18')]=_0x240701['VoiceQueueId'];this[_0xe10c('0x19')]=_0x240701['CampaignId'];this[_0xe10c('0x1a')]=_0x240701[_0xe10c('0x1a')]||'';this[_0xe10c('0x1b')]=_0x240701['originatecalleridname']||'';}module[_0xe10c('0x1c')]=History; \ No newline at end of file +var _0x893f=['type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','calleridname','name','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','uniqueid','scheduledat'];(function(_0x5ccb57,_0x2a1c07){var _0x374644=function(_0x22de7d){while(--_0x22de7d){_0x5ccb57['push'](_0x5ccb57['shift']());}};_0x374644(++_0x2a1c07);}(_0x893f,0x1a7));var _0xf893=function(_0x5a19b0,_0x79ebfa){_0x5a19b0=_0x5a19b0-0x0;var _0x2051c4=_0x893f[_0x5a19b0];return _0x2051c4;};'use strict';var util=require(_0xf893('0x0'));var _=require(_0xf893('0x1'));var moment=require('moment');function getSeconds(_0x395f0a,_0x23ecce){var _0x4bc669=moment(_0x395f0a)[_0xf893('0x2')](0x0);var _0x270cc=moment(_0x23ecce)[_0xf893('0x2')](0x0);return _0x4bc669[_0xf893('0x3')](_0x270cc,'seconds');}function History(_0x2d95c1){this[_0xf893('0x4')]=_0x2d95c1[_0xf893('0x4')];this[_0xf893('0x5')]=_0x2d95c1[_0xf893('0x5')]||undefined;this[_0xf893('0x6')]=_0x2d95c1['type'];this[_0xf893('0x7')]=_0x2d95c1[_0xf893('0x6')]===_0xf893('0x8')?_0xf893('0x9'):_0x2d95c1[_0xf893('0x6')];this[_0xf893('0xa')]=_0x2d95c1[_0xf893('0xa')];this[_0xf893('0xb')]=_0x2d95c1['countcongestionretry'];this[_0xf893('0xc')]=_0x2d95c1[_0xf893('0xc')];this[_0xf893('0xd')]=_0x2d95c1[_0xf893('0xa')]+_0x2d95c1[_0xf893('0xb')]+_0x2d95c1[_0xf893('0xc')];this[_0xf893('0x9')]=_0x2d95c1[_0xf893('0x9')];this[_0xf893('0xe')]=_0x2d95c1[_0xf893('0xf')];this['calleridnum']=_0x2d95c1[_0xf893('0x10')];this[_0xf893('0x11')]=_0x2d95c1[_0xf893('0x11')];this[_0xf893('0x12')]=_0x2d95c1['responsetime'];this[_0xf893('0x13')]=_0x2d95c1[_0xf893('0x12')];this[_0xf893('0x14')]=getSeconds(_0x2d95c1['responsetime'],_0x2d95c1[_0xf893('0x11')]);this[_0xf893('0x15')]=0x0;this[_0xf893('0x16')]=0x0;this['callback']=_0x2d95c1['callback'];this['callbackuniqueid']=_0x2d95c1[_0xf893('0x17')];this[_0xf893('0x18')]=_0x2d95c1[_0xf893('0x18')];this[_0xf893('0x19')]=_0x2d95c1['recallme'];this[_0xf893('0x1a')]=_0x2d95c1['ContactId'];this[_0xf893('0x1b')]=_0x2d95c1[_0xf893('0x1b')];this[_0xf893('0x1c')]=_0x2d95c1[_0xf893('0x1c')];this['VoiceQueueId']=_0x2d95c1['VoiceQueueId'];this[_0xf893('0x1d')]=_0x2d95c1['CampaignId'];this[_0xf893('0x1e')]=_0x2d95c1['originatecalleridnum']||'';this[_0xf893('0x1f')]=_0x2d95c1['originatecalleridname']||'';}module[_0xf893('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 48510d8..e5d2e45 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 _0x34c0=['xcally-motion-dialer','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','TrunkBackup','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','dialCutDigit','substring','from-sip','OriginateError','[originate][error]','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','countbusyretry','countnoanswerretry','dialNoAnswerMaxRetry','add','minutes','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','countcongestionretry','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','object','[callProgressDetecting]','entity\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','[syncAgentComplete][createHistory][0]','checkRetriveMax','dialGlobalMaxRetry','reason\x200\x20no\x20such\x20number....','createStateFinal','countglobal','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','stateGlobal','outboundBusyCallsDay','Busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','getDataPredictive','recalculate\x20predictive\x20at','startMethodPredictive','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','outboundQueuePauses','predictiveIntervalHitRate','[CatchErlangB]','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','UserId','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','handleIvr','temp','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','dialLimitQueue','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','not_inuse','[actionOriginatePredictive]\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]','Ts\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','m\x20=\x20','p\x20=\x20','Umin\x20=\x20','exports','util','lodash','uuid','ioredis','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','./hangup','env','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','contactsId','uniqueId','ivrOriginated','queueBooked','queueBookedRR','agentconnect','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','newexten','varset','syncVarSet','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','NOT_ACTIVE','\x20NOT\x20Active','\x20INTERVAL_IS_NULL','Interval','INTERVAL_IS_NULL','isEmpty','Intervals','[ifTime][Action]','Error','milliseconds','diff','emit','type','outbound','strategy','available','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','waiting','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','stringify','md5','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','seconds','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','pTalking','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','actions','[actions]','hasOwnProperty','Action','status','catch','No\x20such\x20channel','[Dialer][checkChannel]','queue','updateOriginated','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','rescheduleContact','[rescheduleContact]\x20','getContactDialer','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','saveInDb','pick','ListId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','uniqueid','isNil','variable','amdstatus','exten','dialAMDActive','value','HANGUP','outboundAnswerCallsDay','state','HangupInAMD','membername','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','AMD','amd','[syncMachine][createHistory]','[syncMachine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','[syncMachineIvr][createHistory]','[syncMachineIvr]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','cause-txt','Unknow','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncAgentConnect','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','Abandoned','syncNewExten','channel','syncQueueMember','actionid','locked','stateinterface','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','run','[Catch][Preview][syncQueueStatusComplete]','ContactId','_rr','paused','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[unlock][syncQueueStatusComplete]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','loopCampaigns','checkIsTrunkReachable','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','command','iftime\x20%s,%s','interval','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','checkDialMethod','progressive','handlePower','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','loggedIn','dialGlobalInterval','dialTimezone','[syncQueueSummary]','syncCampaigns','[syncCampaigns]','\x5cw{0,','pow','replace','match','actionOriginate','voiceQueue\x20is\x20undefine','Contact','phone','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','ACTIVE'];(function(_0x2cb437,_0x2df0d4){var _0x2370d5=function(_0x47f451){while(--_0x47f451){_0x2cb437['push'](_0x2cb437['shift']());}};_0x2370d5(++_0x2df0d4);}(_0x34c0,0x9b));var _0x034c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x34c0[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0x034c('0x0'));var _=require(_0x034c('0x1'));var BPromise=require('bluebird');var uuid=require(_0x034c('0x2'));var moment=require('moment');var rr=require('rr');var md5=require('md5');var Redis=require(_0x034c('0x3'));var config=require('../../../config/environment/');var logger=require(_0x034c('0x4'))(_0x034c('0x5'));var loggerBooked=require(_0x034c('0x4'))(_0x034c('0x6'));var loggerPredictive=require('../../../config/logger')(_0x034c('0x7'));var loggerPredictiveCalls=require(_0x034c('0x4'))(_0x034c('0x8'));var loggerSyncQueueSummary=require(_0x034c('0x4'))(_0x034c('0x9'));var ami=require(_0x034c('0xa'));config[_0x034c('0xb')]=_['defaults'](config[_0x034c('0xb')],{'host':_0x034c('0xc'),'port':0x18eb});var io=require(_0x034c('0xd'))(new Redis(config[_0x034c('0xb')]));var cmHopper=require(_0x034c('0xe'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x034c('0xf'));var voiceQueueRt=require(_0x034c('0x10'));var Action=require(_0x034c('0x11'));var History=require(_0x034c('0x12'));var Final=require(_0x034c('0x13'));var AgentComplete=require(_0x034c('0x14'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0x034c('0x15'));var ipAgi=process[_0x034c('0x16')]['XCALLY_IP_AGI']||_0x034c('0x17');var strategy={'rrmemory':_0x034c('0x18'),'roundrobin':_0x034c('0x19')};var Sequence=function(){};Sequence[_0x034c('0x1a')][_0x034c('0x1b')]=function(_0xa6117d){this[_0x034c('0x1c')]=this[_0x034c('0x1c')]?this['tail'][_0x034c('0x1d')](_0xa6117d):_0xa6117d();};function Dialer(_0x2f0ed7,_0x1aaa50){this[_0x034c('0x1e')]=new Sequence();this[_0x034c('0x1f')]=_0x1aaa50;this[_0x034c('0x20')]=_0x2f0ed7['voiceQueues'];this['campaigns']=_0x2f0ed7[_0x034c('0x21')];this[_0x034c('0x22')]=_0x2f0ed7[_0x034c('0x22')];this[_0x034c('0x23')]=_0x2f0ed7[_0x034c('0x23')];this[_0x034c('0x24')]=config[_0x034c('0x24')]||0x2;this['channels']={};this['actions']={};this[_0x034c('0x25')]={};this[_0x034c('0x26')]={};this['optionPredictive']={};this['startPredictive']={};this['startProgressive']={};this[_0x034c('0x27')]={};this[_0x034c('0x28')]={};this[_0x034c('0x29')]={};ami['on'](_0x034c('0x2a'),this['syncAgentConnect'][_0x034c('0x2b')](this));ami['on'](_0x034c('0x2c'),this[_0x034c('0x2d')][_0x034c('0x2b')](this));ami['on']('originateresponse',this[_0x034c('0x2e')]['bind'](this));ami['on'](_0x034c('0x2f'),this[_0x034c('0x30')][_0x034c('0x2b')](this));ami['on'](_0x034c('0x31'),this[_0x034c('0x9')][_0x034c('0x2b')](this));ami['on']('hangup',this['syncHangup'][_0x034c('0x2b')](this));ami['on'](_0x034c('0x32'),this['syncNewExten'][_0x034c('0x2b')](this));ami['on'](_0x034c('0x33'),this[_0x034c('0x34')][_0x034c('0x2b')](this));ami['on'](_0x034c('0x35'),this['syncQueueMember'][_0x034c('0x2b')](this));ami['on'](_0x034c('0x36'),this[_0x034c('0x37')][_0x034c('0x2b')](this));this['loopCampaigns']();this[_0x034c('0x38')]();}function isNotNull(_0x11b027){return _0x11b027!==null&&!_[_0x034c('0x39')](_0x11b027);}function checkIsLoggedIn(_0x173463,_0x3ba8a8){return function(){if(_0x3ba8a8<=0x0){_0x173463[_0x034c('0x3a')]=_0x034c('0x3b');throw _0x173463[_0x034c('0x3c')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x248df1){return _0x248df1;}function checkIsActive(_0x56ff08,_0x5bef35){return function(){if(!isActive(_0x5bef35)){_0x56ff08[_0x034c('0x3a')]=_0x034c('0x3d');throw _0x56ff08[_0x034c('0x3c')]+_0x034c('0x3e');}};}function checkInterval(_0x5d1c3c){return function(){if(!isNotNull(_0x5d1c3c['Interval'])){_0x5d1c3c[_0x034c('0x3a')]='INTERVAL_IS_NULL';throw _0x5d1c3c[_0x034c('0x3c')]+_0x034c('0x3f');}if(!isNotNull(_0x5d1c3c[_0x034c('0x40')]['Intervals'])){_0x5d1c3c[_0x034c('0x3a')]=_0x034c('0x41');throw _0x5d1c3c[_0x034c('0x3c')]+_0x034c('0x3f');}if(!isNotNull(_[_0x034c('0x42')](_0x5d1c3c[_0x034c('0x40')][_0x034c('0x43')]))){_0x5d1c3c['message']='INTERVAL_IS_NULL';throw _0x5d1c3c[_0x034c('0x3c')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x177b0e,_0x5dab6d,_0x3f21c2){return{'action':_0x177b0e,'response':_0x5dab6d,'message':_0x3f21c2,'stack':_0x3f21c2};}function myreject(_0x5202b1){return function(_0x227827){return _0x5202b1(msgResponse(_0x034c('0x44'),_0x034c('0x45'),JSON['stringify'](_0x227827)));};}function getSeconds(_0x1b7006,_0x2980e8){var _0x461402=moment(_0x1b7006)[_0x034c('0x46')](0x0);var _0x4dc768=moment(_0x2980e8)[_0x034c('0x46')](0x0);return _0x461402[_0x034c('0x47')](_0x4dc768,'seconds');}function emit(_0x8d8d62,_0x11978c,_0xcf9e14){io['to'](_0x8d8d62)[_0x034c('0x48')](_0x11978c,_0xcf9e14);}function emitVoiceQueueSummary(_0x2faae1){if(_0x2faae1[_0x034c('0x49')]===_0x034c('0x4a')){var _0x1f9bfa={'id':_0x2faae1['id'],'name':_0x2faae1['name'],'strategy':_0x2faae1[_0x034c('0x4b')],'answered':_0x2faae1['answered'],'available':_0x2faae1[_0x034c('0x4c')],'loggedIn':_0x2faae1['loggedIn'],'pTalking':_0x2faae1['pTalking'],'sumBillable':_0x2faae1[_0x034c('0x4d')],'sumDuration':_0x2faae1[_0x034c('0x4e')],'sumHoldTime':_0x2faae1[_0x034c('0x4f')]||0x0,'talking':_0x2faae1[_0x034c('0x50')],'total':_0x2faae1[_0x034c('0x51')],'type':_0x2faae1[_0x034c('0x49')],'unmanaged':_0x2faae1[_0x034c('0x52')],'abandoned':_0x2faae1['abandoned'],'waiting':_0x2faae1[_0x034c('0x53')],'loggedInDb':_0x2faae1['loggedInDb'],'dialActive':_0x2faae1['dialActive'],'dialMethod':_0x2faae1[_0x034c('0x54')],'dialOriginateCallerIdName':_0x2faae1[_0x034c('0x55')],'dialOriginateCallerIdNumber':_0x2faae1[_0x034c('0x56')],'dialOriginateTimeout':_0x2faae1[_0x034c('0x57')],'dialPrefix':_0x2faae1[_0x034c('0x58')],'outboundAnswerAgiCallsDay':_0x2faae1[_0x034c('0x59')],'outboundAnswerCallsDay':_0x2faae1['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x2faae1[_0x034c('0x5a')],'outboundBusyCallsDay':_0x2faae1['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x2faae1[_0x034c('0x5b')],'outboundDropCallsDayACS':_0x2faae1['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x2faae1[_0x034c('0x5c')],'outboundDropCallsDayTimeout':_0x2faae1[_0x034c('0x5d')],'outboundNoAnswerCallsDay':_0x2faae1[_0x034c('0x5e')],'outboundNoSuchCallsDay':_0x2faae1['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x2faae1[_0x034c('0x5f')],'outboundReCallsDay':_0x2faae1[_0x034c('0x60')],'outboundRejectCallsDay':_0x2faae1[_0x034c('0x61')],'outboundUnknownCallsDay':_0x2faae1[_0x034c('0x62')],'predictiveIntervalAnsweredCalls':_0x2faae1['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x2faae1[_0x034c('0x63')],'predictiveIntervalAvgTalktime':_0x2faae1[_0x034c('0x64')],'predictiveIntervalDroppedCallsCallersExit':_0x2faae1['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x2faae1[_0x034c('0x65')],'predictiveIntervalErlangCalls':_0x2faae1[_0x034c('0x66')],'predictiveIntervalErlangCallsDroppedCalls':_0x2faae1['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x2faae1['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x2faae1[_0x034c('0x67')],'predictiveIntervalPauses':_0x2faae1[_0x034c('0x68')],'predictiveIntervalAvailable':_0x2faae1['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x2faae1['predictiveIntervalTotalCalls'],'message':_0x2faae1[_0x034c('0x3a')],'originated':_0x2faae1[_0x034c('0x69')],'erlangCalls':_0x2faae1[_0x034c('0x6a')],'erlangCallToSecond':_0x2faae1[_0x034c('0x6b')],'erlangAbandonmentRate':_0x2faae1[_0x034c('0x6c')],'erlangBusyFactor':_0x2faae1[_0x034c('0x6d')],'startPredictive':_0x2faae1[_0x034c('0x6e')],'startProgressive':_0x2faae1[_0x034c('0x6f')]};if(_0x2faae1['Trunk']){_0x1f9bfa['Trunk']={'id':_0x2faae1[_0x034c('0x70')]['id'],'name':_0x2faae1['Trunk'][_0x034c('0x3c')],'active':_0x2faae1[_0x034c('0x70')][_0x034c('0x71')],'callerid':_0x2faae1[_0x034c('0x70')][_0x034c('0x72')]};}if(_0x2faae1[_0x034c('0x40')]){_0x1f9bfa[_0x034c('0x40')]={'id':_0x2faae1[_0x034c('0x40')]['id'],'name':_0x2faae1[_0x034c('0x40')]['name']};}var _0x341a7f=md5(JSON[_0x034c('0x73')](_0x1f9bfa));if(_0x2faae1['md5']!==_0x341a7f){_0x2faae1[_0x034c('0x74')]=_0x341a7f;emit(util[_0x034c('0x75')](_0x034c('0x76'),_0x1f9bfa[_0x034c('0x3c')]),_0x034c('0x77'),_0x1f9bfa);}}}function emitCampaignSummary(_0x1fa3e1){if(_0x1fa3e1[_0x034c('0x49')]===_0x034c('0x78')){emit(util[_0x034c('0x75')](_0x034c('0x79'),_0x1fa3e1[_0x034c('0x3c')]),_0x034c('0x7a'),_0x1fa3e1);}}function checkGetDataPredictive(_0x357a3c){if(isNotNull(_0x357a3c)){if(!_[_0x034c('0x42')](_0x357a3c)){loggerPredictive[_0x034c('0x7b')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x034c('0x7b')](_0x034c('0x7c'),_0x357a3c[_0x034c('0x7d')]);loggerPredictive['info']('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x357a3c[_0x034c('0x7e')]);loggerPredictive['info']('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x357a3c[_0x034c('0x65')]);loggerPredictive['info'](_0x034c('0x7f'),_0x357a3c[_0x034c('0x80')]);loggerPredictive[_0x034c('0x7b')](_0x034c('0x81'),_0x357a3c[_0x034c('0x63')]);loggerPredictive[_0x034c('0x7b')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x357a3c[_0x034c('0x64')]);loggerPredictive['info'](_0x034c('0x82'));if(_0x357a3c[_0x034c('0x7d')]>0x0){if(!_[_0x034c('0x39')](_0x357a3c[_0x034c('0x64')])&&_0x357a3c[_0x034c('0x64')]>0x0){return!![];}else{loggerPredictive[_0x034c('0x7b')](_0x034c('0x83'));}if(!_[_0x034c('0x39')](_0x357a3c['predictiveIntervalAvgHoldtime'])&&_0x357a3c['predictiveIntervalAvgHoldtime']>0x0){return!![];}else{loggerPredictive[_0x034c('0x7b')](_0x034c('0x84'));}}else{loggerPredictive[_0x034c('0x7b')](_0x034c('0x85'));}}else{loggerPredictive[_0x034c('0x7b')](_0x034c('0x86'));}}else{loggerPredictive[_0x034c('0x7b')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0xed19ae){return function(_0x5a7d80){loggerPredictive[_0x034c('0x7b')](_0x034c('0x87'));loggerPredictive[_0x034c('0x7b')](_0x034c('0x88'),_0x5a7d80[_0x034c('0x6a')]);loggerPredictive[_0x034c('0x7b')](_0x034c('0x89'),_0x5a7d80['erlangCallToSecond']);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5a7d80[_0x034c('0x6c')]);loggerPredictive[_0x034c('0x7b')](_0x034c('0x8a'),_0x5a7d80[_0x034c('0x6d')]);loggerPredictive[_0x034c('0x7b')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5a7d80[_0x034c('0x6c')]);loggerPredictive[_0x034c('0x7b')](_0x034c('0x82'));_[_0x034c('0x8b')](_0xed19ae,_0x5a7d80);};}function getDiff(_0x199ddb){var _0x55d51a=moment()[_0x034c('0x46')](0x0);var _0x1aa092=moment(_0x199ddb)[_0x034c('0x46')](0x0);return _0x55d51a[_0x034c('0x47')](_0x1aa092,_0x034c('0x8c'));}function ifInterval(_0x5737e5,_0x2676dd){if(_[_0x034c('0x39')](_0x2676dd)){return![];}if(getDiff(_0x2676dd)<_0x5737e5*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x4e7bfd){if(isNotNull(_0x4e7bfd)){if(!_[_0x034c('0x39')](_0x4e7bfd[_0x034c('0x6f')])){_0x4e7bfd[_0x034c('0x6f')]=undefined;loggerPredictive[_0x034c('0x7b')](_0x4e7bfd[_0x034c('0x3c')],_0x034c('0x8d'));}if(!_['isUndefined'](_0x4e7bfd[_0x034c('0x6e')])){_0x4e7bfd['startPredictive']=undefined;loggerPredictive[_0x034c('0x7b')](_0x4e7bfd[_0x034c('0x3c')],_0x034c('0x8e'));}if(!_[_0x034c('0x39')](_0x4e7bfd[_0x034c('0x8f')])){clearInterval(_0x4e7bfd['handlePredictive']);_0x4e7bfd['handlePredictive']=undefined;loggerPredictive['info'](_0x4e7bfd[_0x034c('0x3c')],_0x034c('0x90'));}}}function erlangb(_0xd4d8d5,_0x248f75){if(_0x248f75===0x0){return 0x0;}var _0x55be2d=0x1;for(var _0xfaad41=0x1;_0xfaad41<=_0x248f75;_0xfaad41+=0x1){_0x55be2d=0x1+_0x55be2d*_0xfaad41/_0xd4d8d5;}return 0x1/_0x55be2d;}function isVoiceQueueOutbound(_0x39585a){return _0x39585a==='outbound';}function isNotPreview(_0x558b3a){return _0x558b3a!==_0x034c('0x1f');}function isCampaignIvr(_0x2f6da9){return _0x2f6da9===_0x034c('0x78');}function getCallerId(_0x5566cc,_0x5a054d,_0x37291f){if(!_[_0x034c('0x39')](_0x37291f)&&_0x034c('0x91')===typeof _0x37291f&&!_[_0x034c('0x42')](_0x37291f)){if(!_['isUndefined'](_0x5a054d)&&_0x034c('0x91')===typeof _0x5a054d&&!_[_0x034c('0x42')](_0x5a054d)){return util['format'](_0x034c('0x92'),_0x5a054d,_0x37291f);}return util[_0x034c('0x75')](_0x034c('0x92'),_0x37291f,_0x37291f);}if(!_[_0x034c('0x39')](_0x5566cc)&&_0x034c('0x91')===typeof _0x5566cc&&!_[_0x034c('0x42')](_0x5566cc)){return _0x5566cc;}return _0x034c('0x93');}function loggerCatchQueueSummary(_0x473146,_0x515d9b){return function(_0x28be3e){freeVariablesPredictive(_0x515d9b);emitVoiceQueueSummary(_0x515d9b);emitCampaignSummary(_0x515d9b);loggerSyncQueueSummary[_0x034c('0x94')](_0x473146,util[_0x034c('0x95')](_0x28be3e,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x58ec25,_0x546e37){return function(_0xf42fcd){loggerPredictive[_0x034c('0x94')](_0x546e37[_0x034c('0x3c')],_0x58ec25);loggerPredictive[_0x034c('0x94')](_0xf42fcd[_0x034c('0x96')]);freeVariablesPredictive(_0x546e37);};}function loggerCatch(_0x28e61f){return function(_0xe06b8d){logger[_0x034c('0x94')](_0x28e61f,util[_0x034c('0x95')](_0xe06b8d,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x54a196){return _0x54a196&&!_['isUndefined'](_0x54a196)&&_0x54a196[_0x034c('0x97')]>0x0;}function decremetOriginate(_0x2da2a8){if(!_['isUndefined'](_0x2da2a8)&&_0x2da2a8!==null){if(_0x2da2a8['hasOwnProperty'](_0x034c('0x69'))){if(_0x2da2a8[_0x034c('0x69')]>0x0){_0x2da2a8[_0x034c('0x69')]-=0x1;}else{logger[_0x034c('0x94')](_0x034c('0x98'));}}}else{logger[_0x034c('0x94')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x2e7ac3,_0x279773,_0x45ced0){if(_0x279773>_0x45ced0){for(var _0x5c7242=0x0;_0x5c7242<_0x279773-_0x45ced0;_0x5c7242+=0x1){decremetOriginate(_0x2e7ac3);}}}function loggerGetContactDialer(_0x5ef297,_0x4561d4,_0x181303){return function(_0x4fa48e){checkContactLowerLimitOriginate(_0x4561d4,_0x181303,0x0);logger[_0x034c('0x94')](_0x5ef297,util[_0x034c('0x95')](_0x4fa48e,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x123c72){return function(_0x3bfd46){if(isNotNull(_0x3bfd46)&&isNotNull(_0x3bfd46[0x0])){if(_0x3bfd46[0x0][_0x034c('0x99')]>0x0){_0x123c72[_0x034c('0x3a')]='RESCHEDULED_CONTACTS';logger['info'](_0x034c('0x9a')+_0x123c72['name'],_0x3bfd46[0x0]['contactsRescheduled'],_0x034c('0x9b'));}else{_0x123c72['message']=_0x034c('0x9c');logger[_0x034c('0x7b')](_0x034c('0x9d')+_0x123c72[_0x034c('0x3c')]);}}};}function notSendMessagesQueue(_0x47b87c){if(_0x47b87c[_0x034c('0x9e')]){freeVariablesPredictive(_0x47b87c);if(_0x47b87c['originated']===0x0&&_0x47b87c['talking']===0x0&&_0x47b87c[_0x034c('0x53')]===0x0&&(_0x47b87c[_0x034c('0x9f')]||0x0)===0x0){_0x47b87c[_0x034c('0x9e')]=![];_0x47b87c[_0x034c('0x4c')]=0x0;_0x47b87c[_0x034c('0x3a')]=_0x034c('0x3d');loggerSyncQueueSummary[_0x034c('0x94')](_0x034c('0xa0'),_0x47b87c[_0x034c('0x3c')],'is\x20not\x20active');}else{_0x47b87c[_0x034c('0x3a')]=_0x034c('0xa1');loggerSyncQueueSummary[_0x034c('0x94')](_0x034c('0xa0'),_0x47b87c['name'],_0x034c('0xa2'));}emitVoiceQueueSummary(_0x47b87c);}}function notSendMessagesCampaign(_0x2b7dee){if(_0x2b7dee[_0x034c('0x9e')]){if(_0x2b7dee['originated']===0x0){_0x2b7dee['sendMessageOneNotActive']=![];_0x2b7dee[_0x034c('0x3a')]=_0x034c('0x3d');loggerSyncQueueSummary[_0x034c('0x94')](_0x034c('0xa3'),_0x2b7dee[_0x034c('0x3c')],'is\x20not\x20active');}else{_0x2b7dee['message']=_0x034c('0xa1');loggerSyncQueueSummary[_0x034c('0x94')](_0x034c('0xa3'),_0x2b7dee[_0x034c('0x3c')],'is\x20disactive');}emitCampaignSummary(_0x2b7dee);}}function createObjHistory(_0x1ee587,_0x50f0b3,_0xed444,_0x421c40,_0x5305d5){_0x1ee587['message']=_0xed444;var _0xa0fdce=new Action(_0x1ee587,_0x50f0b3);var _0x47c501=new History(_0xa0fdce);_0x47c501['state']=_0x421c40;_0x47c501[_0x034c('0xa4')]=_0x5305d5;_0x47c501[_0x034c('0xa5')]=_0xa0fdce[_0x034c('0xa6')];return _0x47c501;}Dialer['prototype'][_0x034c('0x38')]=function(){var _0x40e841=this;setInterval(function(){_0x40e841[_0x034c('0xa7')](_0x40e841['uniqueId'],_0x034c('0xa8'));_0x40e841[_0x034c('0xa7')](_0x40e841[_0x034c('0xa9')],_0x034c('0xaa'));},0x32c8);};Dialer[_0x034c('0x1a')][_0x034c('0xa7')]=function(_0x541ec2,_0x10cf0c){var _0x37d4be=this;for(var _0x58b75b in _0x541ec2){if(_0x541ec2[_0x034c('0xab')](_0x58b75b)){this['sequence']['enqueue'](function(){if(!_['isNil'](_0x541ec2[_0x58b75b])){return ami[_0x034c('0xac')]({'action':_0x034c('0xad'),'channel':_0x541ec2[_0x58b75b]['channel']})[_0x034c('0xae')](function(_0x2e9b66){if(_0x2e9b66[_0x034c('0x3a')]===_0x034c('0xaf')){setTimeout(function(){if(_0x541ec2[_0x58b75b]&&_0x541ec2[_0x58b75b]['type']!==_0x034c('0x78')){_0x37d4be['updateOriginated'](_0x37d4be[_0x034c('0x20')][_0x541ec2[_0x58b75b]['queue']]);logger[_0x034c('0x94')](_0x034c('0xb0'),_0x10cf0c,_0x58b75b,_0x541ec2[_0x58b75b][_0x034c('0xb1')]);delete _0x541ec2[_0x58b75b];}if(_0x541ec2[_0x58b75b]&&_0x541ec2[_0x58b75b][_0x034c('0x49')]===_0x034c('0x78')){_0x37d4be[_0x034c('0xb2')](_0x37d4be[_0x034c('0x21')][_0x541ec2[_0x58b75b][_0x034c('0xb1')]]);logger[_0x034c('0x94')](_0x034c('0xb3'),_0x10cf0c,_0x58b75b,_0x541ec2[_0x58b75b]['queue']);delete _0x541ec2[_0x58b75b];}},0x2328);}});}});}}};Dialer['prototype'][_0x034c('0xb4')]=function(_0xd79de2){return BPromise[_0x034c('0xb5')]()[_0x034c('0xb6')](cmHopper[_0x034c('0xb4')](_0xd79de2))['catch'](loggerCatch(_0x034c('0xb7')));};Dialer['prototype'][_0x034c('0xb8')]=function(_0xc3e5e){return BPromise[_0x034c('0xb5')]()['then'](cmHopperBlack['checkIsBlackList'](_0xc3e5e))[_0x034c('0xae')](loggerCatch('[checkIsBlackList]\x20'));};Dialer[_0x034c('0x1a')][_0x034c('0xb9')]=function(_0x20579a){return BPromise[_0x034c('0xb5')]()[_0x034c('0xb6')](cmHopperBlack['checkIsBlackListIvr'](_0x20579a))['catch'](loggerCatch(_0x034c('0xba')));};Dialer[_0x034c('0x1a')][_0x034c('0xbb')]=function(_0x4a3b71){return BPromise[_0x034c('0xb5')]()[_0x034c('0xb6')](cmHopperHistory[_0x034c('0xbc')](_0x4a3b71))[_0x034c('0xae')](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0x034c('0x1a')][_0x034c('0xbd')]=function(_0x21d367){return BPromise[_0x034c('0xb5')]()['then'](cmHopper[_0x034c('0xbd')](_0x21d367))['catch'](loggerCatch(_0x034c('0xbe')));};Dialer[_0x034c('0x1a')][_0x034c('0xbf')]=function(_0x56e57d,_0xe55d44,_0x3783e0,_0x406455){return BPromise[_0x034c('0xb5')]()[_0x034c('0xb6')](cmHopper[_0x034c('0xbf')](_0x56e57d,_0xe55d44,_0x3783e0,_0x406455))[_0x034c('0xae')](loggerCatch('[getContactDialer]\x20'));};Dialer[_0x034c('0x1a')][_0x034c('0xc0')]=function(_0x298994,_0x4f47dc,_0x55429b){return BPromise[_0x034c('0xb5')]()['then'](cmHopper[_0x034c('0xc0')](_0x298994,_0x4f47dc,_0x55429b))[_0x034c('0xae')](loggerCatch('[getContactDialer]\x20'));};Dialer[_0x034c('0x1a')]['getVoiceQueueRtPauses']=function(_0x4a461d){return BPromise[_0x034c('0xb5')]()[_0x034c('0xb6')](voiceQueueRt[_0x034c('0xc1')](_0x4a461d))['catch'](loggerCatch(_0x034c('0xc2')));};Dialer[_0x034c('0x1a')][_0x034c('0xc3')]=function(_0x229b4f){return BPromise[_0x034c('0xb5')]()['then'](cmHopper[_0x034c('0xc3')](_0x229b4f))[_0x034c('0xae')](loggerCatch(_0x034c('0xc4')));};Dialer[_0x034c('0x1a')][_0x034c('0xc5')]=function(_0x3113ee){return BPromise[_0x034c('0xb5')]()[_0x034c('0xb6')](cmHopperHistory[_0x034c('0xc5')](_0x3113ee))[_0x034c('0xae')](loggerCatch(_0x034c('0xc6')));};Dialer[_0x034c('0x1a')][_0x034c('0xb2')]=function(_0x529f7e){if(!_[_0x034c('0x39')](_0x529f7e)&&_0x529f7e!==null){if(_0x529f7e[_0x034c('0xab')](_0x034c('0x69'))){if(_0x529f7e[_0x034c('0x69')]>0x0){_0x529f7e[_0x034c('0x69')]-=0x1;}else{logger[_0x034c('0x94')](_0x034c('0xc7'));}}}else{logger[_0x034c('0x94')](_0x034c('0xc8'));}};Dialer[_0x034c('0x1a')][_0x034c('0xc9')]=function(_0x16d3fa,_0x1cb5c4){var _0x3f7278=this;return function(_0x582c43){_0x3f7278['updateOriginated'](_0x1cb5c4);logger[_0x034c('0x94')](_0x16d3fa,util[_0x034c('0x95')](_0x582c43,{'showHidden':![],'depth':null}));};};Dialer[_0x034c('0x1a')][_0x034c('0xca')]=function(_0x4afea4,_0x4d2978,_0x34dede){var _0x2193fa={'state':0x19,'statedesc':'notFound'};this[_0x034c('0xb2')](_0x4d2978);this[_0x034c('0xcb')](_['merge'](_0x2193fa,_[_0x034c('0xcc')](_0x34dede,['ContactId',_0x034c('0xcd'),'UserId',_0x034c('0xce'),_0x034c('0xcf')])),_0x034c('0xd0'),_0x034c('0xd1'));logger[_0x034c('0x94')](_0x4afea4);};Dialer['prototype'][_0x034c('0xd2')]=function(_0x22532a){return _0x22532a===_0x034c('0xd3');};Dialer[_0x034c('0x1a')][_0x034c('0xd4')]=function(_0x2b2dfa){return!_[_0x034c('0x39')](_0x2b2dfa)&&_0x2b2dfa&&!_[_0x034c('0x39')](_0x2b2dfa[_0x034c('0x3c')])&&!_[_0x034c('0x39')](_0x2b2dfa['active'])&&_0x2b2dfa['active']&&(this[_0x034c('0x23')][util[_0x034c('0x75')](_0x034c('0xd5'),_0x2b2dfa[_0x034c('0x3c')])]['status']===_0x034c('0xd6')||this['trunks'][util['format'](_0x034c('0xd5'),_0x2b2dfa[_0x034c('0x3c')])][_0x034c('0xad')]==='unmonitored');};Dialer[_0x034c('0x1a')][_0x034c('0xcb')]=function(_0xb2a50a,_0x1a2c9b,_0x36f2b2){this['createHistory'](_0xb2a50a)[_0x034c('0xae')](loggerCatch(_0x1a2c9b));this[_0x034c('0xc3')](_0xb2a50a)['catch'](loggerCatch(_0x36f2b2));};Dialer['prototype'][_0x034c('0x34')]=function(_0x52c8f1){var _0x1df125=this[_0x034c('0x26')][_0x52c8f1[_0x034c('0xd7')]];var _0x394eb7;if(!_[_0x034c('0xd8')](_0x52c8f1)&&!_['isNil'](_0x52c8f1[_0x034c('0xd9')])&&!_[_0x034c('0xd8')](_0x52c8f1['variable'][_0x034c('0xda')])&&_0x52c8f1[_0x034c('0xdb')]==='xcally-motion-dialer'&&_0x1df125){if(_0x1df125['type']!==_0x034c('0x78')&&this['voiceQueues'][_0x1df125[_0x034c('0xb1')]][_0x034c('0xdc')]&&_0x52c8f1[_0x034c('0xdd')]===_0x034c('0xde')){delete this[_0x034c('0x26')][_0x52c8f1['uniqueid']];this[_0x034c('0xb2')](this[_0x034c('0x20')][_0x1df125[_0x034c('0xb1')]]);this[_0x034c('0x20')][_0x1df125[_0x034c('0xb1')]][_0x034c('0xdf')]+=0x1;this[_0x034c('0x20')][_0x1df125['queue']][_0x034c('0x59')]+=0x1;_0x394eb7=new Hangup(_0x1df125,_0x52c8f1);_0x394eb7[_0x034c('0xe0')]=0x12;_0x394eb7['statedesc']=_0x034c('0xe1');_0x394eb7[_0x034c('0xe2')]='AMD';this[_0x034c('0xcb')](_0x394eb7,_0x034c('0xe3'),_0x034c('0xe4'));}if(_0x1df125['type']!=='ivr'&&this[_0x034c('0x20')][_0x1df125[_0x034c('0xb1')]][_0x034c('0xdc')]&&_0x52c8f1[_0x034c('0xdd')]===_0x034c('0xe5')){delete this[_0x034c('0x26')][_0x52c8f1[_0x034c('0xd7')]];this['updateOriginated'](this['voiceQueues'][_0x1df125[_0x034c('0xb1')]]);this['voiceQueues'][_0x1df125[_0x034c('0xb1')]]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x1df125[_0x034c('0xb1')]][_0x034c('0x59')]+=0x1;_0x394eb7=new Hangup(_0x1df125,_0x52c8f1);_0x394eb7[_0x034c('0xe0')]=0x13;_0x394eb7[_0x034c('0xa4')]=_0x034c('0xe6');_0x394eb7[_0x034c('0xe2')]=_0x034c('0xe7');_0x394eb7[_0x034c('0xe8')]=!![];this['saveInDb'](_0x394eb7,_0x034c('0xe9'),_0x034c('0xea'));}if(_0x1df125[_0x034c('0x49')]===_0x034c('0x78')&&this[_0x034c('0x21')][_0x1df125[_0x034c('0xb1')]][_0x034c('0xdc')]&&_0x52c8f1[_0x034c('0xdd')]===_0x034c('0xde')){delete this[_0x034c('0x26')][_0x52c8f1[_0x034c('0xd7')]];this[_0x034c('0xb2')](this[_0x034c('0x21')][_0x1df125[_0x034c('0xb1')]]);_0x394eb7=new Hangup(_0x1df125,_0x52c8f1);_0x394eb7[_0x034c('0xe0')]=0x12;_0x394eb7[_0x034c('0xa4')]=_0x034c('0xe1');_0x394eb7['membername']='AMD';this[_0x034c('0xcb')](_0x394eb7,_0x034c('0xeb'),_0x034c('0xec'));}if(_0x1df125[_0x034c('0x49')]===_0x034c('0x78')&&this[_0x034c('0x21')][_0x1df125[_0x034c('0xb1')]]['dialAMDActive']&&_0x52c8f1[_0x034c('0xdd')]==='MACHINE'){delete this[_0x034c('0x26')][_0x52c8f1[_0x034c('0xd7')]];this['updateOriginated'](this['campaigns'][_0x1df125[_0x034c('0xb1')]]);_0x394eb7=new Hangup(_0x1df125,_0x52c8f1);_0x394eb7[_0x034c('0xe0')]=0x13;_0x394eb7['statedesc']=_0x034c('0xe6');_0x394eb7['membername']=_0x034c('0xe7');_0x394eb7['amd']=!![];this['saveInDb'](_0x394eb7,_0x034c('0xed'),_0x034c('0xee'));}}};Dialer[_0x034c('0x1a')]['syncHangup']=function(_0x3a2f52){var _0x3cfd04=this[_0x034c('0x26')][_0x3a2f52[_0x034c('0xd7')]];var _0xd00ac=this;var _0x1c488b;if(_0x3cfd04&&_0x3cfd04[_0x034c('0x49')]===_0x034c('0x78')){delete this[_0x034c('0x26')][_0x3a2f52[_0x034c('0xd7')]];this[_0x034c('0xb2')](this[_0x034c('0x21')][_0x3cfd04[_0x034c('0xb1')]]);this[_0x034c('0x21')][_0x3cfd04[_0x034c('0xb1')]][_0x034c('0xef')]+=0x1;_0x1c488b=new Hangup(_0x3cfd04,_0x3a2f52);this[_0x034c('0xc5')](_0x1c488b)[_0x034c('0xae')](loggerCatch(_0x034c('0xf0')));this[_0x034c('0xc3')](_0x1c488b)['catch'](loggerCatch(_0x034c('0xf1')));}if(_0x3cfd04&&_0x3cfd04['type']!=='ivr'&&isNotNull(this[_0x034c('0x20')][_0x3cfd04[_0x034c('0xb1')]][_0x034c('0xf2')])){delete this[_0x034c('0x26')][_0x3a2f52[_0x034c('0xd7')]];this['updateOriginated'](this['voiceQueues'][_0x3cfd04[_0x034c('0xb1')]]);this[_0x034c('0x20')][_0x3cfd04['queue']][_0x034c('0xdf')]+=0x1;this['voiceQueues'][_0x3cfd04[_0x034c('0xb1')]][_0x034c('0x59')]+=0x1;_0x1c488b=new Hangup(_0x3cfd04,_0x3a2f52);_0x1c488b['state']=0x10;_0x1c488b[_0x034c('0xa4')]=_0x034c('0xf3');_0x1c488b['membername']='AGI';this['createHistory'](_0x1c488b)['catch'](loggerCatch(_0x034c('0xf0')));this[_0x034c('0xc3')](_0x1c488b)[_0x034c('0xae')](loggerCatch('[syncHangupIvr]'));}if(_0x3cfd04&&_0x3cfd04[_0x034c('0x49')]!==_0x034c('0x78')&&!isNotNull(this[_0x034c('0x20')][_0x3cfd04[_0x034c('0xb1')]][_0x034c('0xf2')])){delete this['uniqueId'][_0x3a2f52[_0x034c('0xd7')]];this['updateOriginated'](this[_0x034c('0x20')][_0x3cfd04[_0x034c('0xb1')]]);this[_0x034c('0x20')][_0x3cfd04[_0x034c('0xb1')]][_0x034c('0x62')]+=0x1;_0x1c488b=new Hangup(_0x3cfd04,_0x3a2f52);_0x1c488b[_0x034c('0xe0')]=0xc;_0x1c488b[_0x034c('0xa4')]=_0x3a2f52[_0x034c('0xf4')];_0x1c488b[_0x034c('0xe2')]=_0x034c('0xf5');this[_0x034c('0xc5')](_0x1c488b)[_0x034c('0xae')](loggerCatch(_0x034c('0xf0')));this[_0x034c('0xc3')](_0x1c488b)['catch'](loggerCatch(_0x034c('0xf1')));}};Dialer['prototype']['syncAgentComplete']=function(_0x449d08){var _0x5d92d3=this[_0x034c('0x26')][_0x449d08[_0x034c('0xd7')]];var _0x28a21a=this;if(this[_0x034c('0x20')][_0x449d08[_0x034c('0xb1')]]){if(_0x5d92d3&&_0x5d92d3[_0x034c('0x49')]!=='ivr'){delete this[_0x034c('0x26')][_0x449d08['uniqueid']];this['voiceQueues'][_0x449d08[_0x034c('0xb1')]][_0x034c('0xdf')]+=0x1;var _0x1c3023=new AgentComplete(_0x5d92d3,_0x449d08);if(_0x449d08['reason']==='agent'){_0x1c3023['agiafterat']=this[_0x034c('0x20')][_0x449d08[_0x034c('0xb1')]][_0x034c('0xf6')]&&this[_0x034c('0x20')][_0x449d08[_0x034c('0xb1')]][_0x034c('0xf7')]?moment()[_0x034c('0x75')](_0x034c('0xf8')):undefined;}this[_0x034c('0xc5')](_0x1c3023)['catch'](loggerCatch(_0x034c('0xf9')));this[_0x034c('0xc3')](_0x1c3023)[_0x034c('0xae')](loggerCatch(_0x034c('0xfa')));}}};Dialer[_0x034c('0x1a')][_0x034c('0xfb')]=function(_0x13ecf1){if(this[_0x034c('0x20')][_0x13ecf1['queue']]){if(this[_0x034c('0x26')][_0x13ecf1[_0x034c('0xd7')]]&&this[_0x034c('0x26')][_0x13ecf1[_0x034c('0xd7')]]['type']!==_0x034c('0x78')){this['updateOriginated'](this[_0x034c('0x20')][_0x13ecf1[_0x034c('0xb1')]]);this['uniqueId'][_0x13ecf1[_0x034c('0xd7')]]['answertime']=moment()[_0x034c('0x75')](_0x034c('0xf8'));}}};Dialer['prototype'][_0x034c('0xfc')]=function(_0x3d5510){this[_0x034c('0xc5')](_0x3d5510)['catch'](loggerCatch(_0x034c('0xf9')));this['moveContactManagedDialer'](_0x3d5510)[_0x034c('0xae')](loggerCatch(_0x034c('0xfd')));};Dialer[_0x034c('0x1a')][_0x034c('0x2d')]=function(_0x4276f3){var _0x54c81b=this[_0x034c('0x26')][_0x4276f3[_0x034c('0xd7')]];var _0x422592=this;if(this['voiceQueues'][_0x4276f3[_0x034c('0xb1')]]){if(_0x54c81b&&_0x54c81b[_0x034c('0x49')]!==_0x034c('0x78')){delete this[_0x034c('0x26')][_0x4276f3['uniqueid']];this[_0x034c('0xb2')](this[_0x034c('0x20')][_0x4276f3['queue']]);_0x54c81b[_0x034c('0xfe')]=moment()['format'](_0x034c('0xf8'));var _0x163a64=new QueueCallerAbandon(_0x54c81b,_0x4276f3);if(getSeconds(_0x54c81b[_0x034c('0xfe')],_0x54c81b[_0x034c('0xff')])>=_0x54c81b[_0x034c('0x100')]){this[_0x034c('0x20')][_0x4276f3['queue']][_0x034c('0x65')]+=0x1;this[_0x034c('0x20')][_0x4276f3[_0x034c('0xb1')]]['outboundDropCallsDayTimeout']+=0x1;this[_0x034c('0x20')][_0x4276f3['queue']][_0x034c('0x101')]+=0x1;_0x163a64[_0x034c('0xe0')]=0xa;_0x163a64[_0x034c('0xa4')]=_0x034c('0x102');_0x163a64[_0x034c('0x103')]=_0x034c('0x104');_0x163a64['agiafterat']=this[_0x034c('0x20')][_0x4276f3[_0x034c('0xb1')]][_0x034c('0xf6')]?moment()[_0x034c('0x75')](_0x034c('0xf8')):undefined;this['queueCallerAbandonCreateState'](_0x163a64);}else{this[_0x034c('0x20')][_0x4276f3[_0x034c('0xb1')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x034c('0x20')][_0x4276f3[_0x034c('0xb1')]]['outboundDropCallsDayCallersExit']+=0x1;_0x163a64[_0x034c('0xe0')]=0xb;_0x163a64[_0x034c('0xa4')]=_0x034c('0x105');_0x163a64[_0x034c('0x103')]='CALLEREXIT';this['queueCallerAbandonCreateState'](_0x163a64);}}}};Dialer[_0x034c('0x1a')][_0x034c('0x106')]=function(_0x2a5f10){if(this[_0x034c('0xa9')][_0x2a5f10[_0x034c('0xd7')]]){this[_0x034c('0xa9')][_0x2a5f10[_0x034c('0xd7')]][_0x034c('0x107')]=_0x2a5f10[_0x034c('0x107')];}if(this[_0x034c('0x26')][_0x2a5f10[_0x034c('0xd7')]]){this[_0x034c('0x26')][_0x2a5f10['uniqueid']]['channel']=_0x2a5f10[_0x034c('0x107')];}};Dialer['prototype'][_0x034c('0x108')]=function(_0x5249d7){if(strategy[this[_0x034c('0x20')][this[_0x034c('0xa9')][_0x5249d7[_0x034c('0x109')]]['queue']]['strategy']]==='roundrobin'){if(this['actions'][_0x5249d7[_0x034c('0x109')]]&&_[_0x034c('0xd8')](this[_0x034c('0xa9')][_0x5249d7[_0x034c('0x109')]][_0x034c('0x10a')])&&_0x5249d7[_0x034c('0xad')]==='1'&&_0x5249d7['paused']==='0'){if(this[_0x034c('0x22')][_0x5249d7[_0x034c('0x10b')]]){if(!this['agents'][_0x5249d7['stateinterface']]['locked']){this[_0x034c('0x22')][_0x5249d7['stateinterface']][_0x034c('0x10a')]=!![];this[_0x034c('0xa9')][_0x5249d7[_0x034c('0x109')]]['locked']=!![];this['actions'][_0x5249d7[_0x034c('0x109')]]['stateinterface']=_0x5249d7['stateinterface'];}}}}else if((strategy[this[_0x034c('0x20')][this[_0x034c('0xa9')][_0x5249d7['actionid']][_0x034c('0xb1')]][_0x034c('0x4b')]]||_0x034c('0x18'))===_0x034c('0x18')){if(this[_0x034c('0xa9')][_0x5249d7[_0x034c('0x109')]]){if(this[_0x034c('0x22')][_0x5249d7[_0x034c('0x10b')]]){this['actions'][_0x5249d7['actionid']][_0x034c('0x10b')]=_0x5249d7['stateinterface'];if(_[_0x034c('0xd8')](this[_0x034c('0x28')][this[_0x034c('0xa9')][_0x5249d7[_0x034c('0x109')]][_0x034c('0xb1')]])){this[_0x034c('0x28')][this[_0x034c('0xa9')][_0x5249d7[_0x034c('0x109')]]['queue']]=[];}this[_0x034c('0x28')][this['actions'][_0x5249d7[_0x034c('0x109')]][_0x034c('0xb1')]][_0x034c('0x10c')](_[_0x034c('0x8b')](_[_0x034c('0xcc')](this[_0x034c('0xa9')][_0x5249d7['actionid']],[_0x034c('0x10d'),_0x034c('0x10b')]),{'status':_0x5249d7[_0x034c('0xad')],'paused':_0x5249d7['paused']}));}}}};function unlockQueueStatus(_0x5d83be,_0x44a75c){setTimeout(function(){if(_[_0x034c('0x39')](_0x5d83be[_0x034c('0x10e')])){loggerBooked['error'](_0x034c('0x10f'),_0x44a75c);}_0x5d83be['queueStatusComplete']=!![];loggerBooked[_0x034c('0x7b')]('[booked][unlockQueueStatus]',_0x44a75c,JSON[_0x034c('0x73')](_[_0x034c('0xcc')](_0x5d83be,[_0x034c('0x3c'),_0x034c('0x10e')])));},0x1f3);}Dialer[_0x034c('0x1a')][_0x034c('0x37')]=function(_0x5e01fc){var _0x1da603=this;var _0x1b2efd=_0x1da603[_0x034c('0x20')][_0x1da603[_0x034c('0xa9')][_0x5e01fc[_0x034c('0x109')]][_0x034c('0xb1')]];if(strategy[this[_0x034c('0x20')][this['actions'][_0x5e01fc[_0x034c('0x109')]][_0x034c('0xb1')]][_0x034c('0x4b')]]===_0x034c('0x19')){if(this[_0x034c('0xa9')][_0x5e01fc['actionid']]&&this[_0x034c('0xa9')][_0x5e01fc[_0x034c('0x109')]][_0x034c('0x10b')]){this[_0x034c('0x1f')][_0x034c('0x110')](this[_0x034c('0xa9')][_0x5e01fc[_0x034c('0x109')]][_0x034c('0x10d')],this[_0x034c('0xa9')][_0x5e01fc[_0x034c('0x109')]][_0x034c('0x10b')])[_0x034c('0xae')](function(_0x4846e3){logger[_0x034c('0x94')](_0x034c('0x111'),util[_0x034c('0x95')](_0x4846e3,{'showHidden':![],'depth':null}));})[_0x034c('0x1d')](function(){_0x1da603[_0x034c('0xb2')](_0x1da603[_0x034c('0x20')][_0x1da603[_0x034c('0xa9')][_0x5e01fc[_0x034c('0x109')]][_0x034c('0xb1')]]);_0x1da603['agents'][_0x1da603[_0x034c('0xa9')][_0x5e01fc[_0x034c('0x109')]][_0x034c('0x10b')]][_0x034c('0x10a')]=![];delete _0x1da603[_0x034c('0xa9')][_0x5e01fc['actionid']];unlockQueueStatus(_0x1b2efd);});}else{this['updateOriginated'](this[_0x034c('0x20')][this['actions'][_0x5e01fc['actionid']]['queue']]);this[_0x034c('0xbd')]({'active':![],'ContactId':this['actions'][_0x5e01fc[_0x034c('0x109')]][_0x034c('0x112')],'ListId':this[_0x034c('0xa9')][_0x5e01fc[_0x034c('0x109')]]['ListId'],'VoiceQueueId':this['actions'][_0x5e01fc['actionid']][_0x034c('0xce')]||undefined,'CampaignId':this[_0x034c('0xa9')][_0x5e01fc[_0x034c('0x109')]]['CampaignId']||undefined})[_0x034c('0xae')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x034c('0xa9')][_0x5e01fc[_0x034c('0x109')]];unlockQueueStatus(_0x1b2efd);}}else if((strategy[this[_0x034c('0x20')][this['actions'][_0x5e01fc[_0x034c('0x109')]][_0x034c('0xb1')]]['strategy']]||_0x034c('0x18'))===_0x034c('0x18')){var _0x1a0799;if(this[_0x034c('0xa9')][_0x5e01fc[_0x034c('0x109')]]&&!_[_0x034c('0x42')](this[_0x034c('0x28')][this['actions'][_0x5e01fc['actionid']][_0x034c('0xb1')]])){if(this[_0x034c('0x29')][_0x1da603[_0x034c('0xa9')][_0x5e01fc[_0x034c('0x109')]]['queue']]){this['queueBookedRR'][_0x1da603[_0x034c('0xa9')][_0x5e01fc[_0x034c('0x109')]][_0x034c('0xb1')]]=this[_0x034c('0x29')][this[_0x034c('0xa9')][_0x5e01fc[_0x034c('0x109')]]['queue']]?this['queueBookedRR'][this[_0x034c('0xa9')][_0x5e01fc[_0x034c('0x109')]][_0x034c('0xb1')]]:this[_0x034c('0x28')][this['actions'][_0x5e01fc[_0x034c('0x109')]]['queue']]?this['queueBooked'][this[_0x034c('0xa9')][_0x5e01fc['actionid']][_0x034c('0xb1')]][_0x034c('0x113')]||0x0:0x0;}this[_0x034c('0x28')][this[_0x034c('0xa9')][_0x5e01fc[_0x034c('0x109')]][_0x034c('0xb1')]]['_rr']=this[_0x034c('0x29')][this[_0x034c('0xa9')][_0x5e01fc['actionid']]['queue']];for(var _0x15e6c5=0x0;_0x15e6c5=0x0?!![]:![];})['catch'](myreject(_0x18320b)));}}else{_0x51d4db[_0x034c('0x10c')](ami['Action']({'action':_0x034c('0x12c'),'command':util[_0x034c('0x75')](_0x034c('0x12d'),_0x23f66f,!_[_0x034c('0x39')](config[_0x034c('0x129')][_0x54c246])?_0x54c246:'')})['then'](function(_0x44a999){return _0x44a999[_0x034c('0x12f')][_0x034c('0x130')](_0x034c('0x131'))>=0x0?!![]:![];})['catch'](myreject(_0x18320b)));}BPromise[_0x034c('0x132')](_0x51d4db)[_0x034c('0xb6')](function(_0x25ca65){var _0x1bb350=_[_0x034c('0x133')](_0x25ca65);if(_0x1bb350){return _0x1b0c13(_0x1bb350);}else{_0x3e7557[_0x034c('0x3a')]=_0x54907a?_0x034c('0x134'):_0x034c('0x135');return _0x18320b(msgResponse(_0x034c('0x136'),_0x034c('0x125'),_0x034c('0x137')+_0x54907a+'\x20'+_0x56b14d+_0x034c('0x138')+util[_0x034c('0x95')](_0x23f66f,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x54c246));}})[_0x034c('0xae')](function(_0x44e055){return _0x18320b(msgResponse(_0x034c('0x123'),'Failure',JSON['stringify'](_0x44e055)));});});};Dialer[_0x034c('0x1a')][_0x034c('0x139')]=function(_0x545ad4){var _0x1ff7b1=this;return function(){switch(_0x545ad4['dialMethod']){case _0x034c('0x13a'):freeVariablesPredictive(_0x545ad4);_0x1ff7b1[_0x034c('0x13b')](_0x545ad4,0x1);break;case'power':freeVariablesPredictive(_0x545ad4);_0x1ff7b1[_0x034c('0x13b')](_0x545ad4,_0x545ad4[_0x034c('0x13c')]);break;case _0x034c('0x7'):_0x1ff7b1[_0x034c('0x7')](_0x545ad4);break;case _0x034c('0x6'):freeVariablesPredictive(_0x545ad4);_0x1ff7b1[_0x034c('0x13b')](_0x545ad4,0x1);break;default:freeVariablesPredictive(_0x545ad4);logger[_0x034c('0x94')](_0x034c('0x13d'),_0x545ad4[_0x034c('0x3c')],_0x034c('0x13e'));}};};Dialer['prototype'][_0x034c('0x13f')]=function(_0x44f9fe){var _0x51429a=this;return function(){_0x51429a['handleIvr'](_0x44f9fe);};};Dialer[_0x034c('0x1a')][_0x034c('0x9')]=function(_0x3fc40e){var _0xea55f=this;if(isNotPreview(_0x3fc40e['dialMethod'])){if(isVoiceQueueOutbound(_0x3fc40e[_0x034c('0x49')])&&isActive(_0x3fc40e['dialActive'])){_0x3fc40e[_0x034c('0x9e')]=!![];BPromise[_0x034c('0xb5')]()['then'](checkIsLoggedIn(_0x3fc40e,_0x3fc40e[_0x034c('0x140')]))['then'](checkIsActive(_0x3fc40e,_0x3fc40e['dialActive']))[_0x034c('0xb6')](checkInterval(_0x3fc40e))['then'](_0xea55f[_0x034c('0x11f')](_0x3fc40e))[_0x034c('0xb6')](_0xea55f['checkIfTime'](_0x3fc40e[_0x034c('0x141')],_0x3fc40e[_0x034c('0x142')],_0x3fc40e[_0x034c('0x3c')],_0x3fc40e))['then'](_0xea55f[_0x034c('0x124')](_0x3fc40e['Interval'],_0x3fc40e['dialTimezone'],_0x3fc40e[_0x034c('0x3c')],_0x3fc40e))[_0x034c('0xb6')](_0xea55f['checkDialMethod'](_0x3fc40e))[_0x034c('0xae')](loggerCatchQueueSummary(_0x034c('0x143'),_0x3fc40e));}else{notSendMessagesQueue(_0x3fc40e);}}else{freeVariablesPredictive(_0x3fc40e);}};Dialer['prototype'][_0x034c('0x144')]=function(){var _0x5f150c=this;var _0x53dcc8;for(var _0x5b5f4f in this['campaigns']){if(this['campaigns'][_0x034c('0xab')](_0x5b5f4f)){_0x53dcc8=this[_0x034c('0x21')][_0x5b5f4f];if(isCampaignIvr(_0x53dcc8[_0x034c('0x49')])&&isActive(_0x53dcc8[_0x034c('0x71')])){_0x53dcc8[_0x034c('0x9e')]=!![];BPromise['resolve']()[_0x034c('0xb6')](checkIsActive(_0x53dcc8,_0x53dcc8['active']))[_0x034c('0xb6')](checkInterval(_0x53dcc8))[_0x034c('0xb6')](_0x5f150c['checkIsTrunkReachable'](_0x53dcc8))[_0x034c('0xb6')](_0x5f150c[_0x034c('0x122')](_0x53dcc8['dialGlobalInterval'],_0x53dcc8[_0x034c('0x142')],_0x53dcc8[_0x034c('0x3c')],_0x53dcc8))[_0x034c('0xb6')](_0x5f150c[_0x034c('0x124')](_0x53dcc8[_0x034c('0x40')],_0x53dcc8[_0x034c('0x142')],_0x53dcc8[_0x034c('0x3c')],_0x53dcc8))[_0x034c('0xb6')](_0x5f150c['launchHandleIvr'](_0x53dcc8))['catch'](loggerCatchQueueSummary(_0x034c('0x145'),_0x53dcc8));}else{notSendMessagesCampaign(_0x53dcc8);}}}};function getCallerIdRandom(_0x3ca164,_0x4c7cf8){var _0x4af4b6,_0x9b2938,_0x2a4208;if(_0x4c7cf8<=0x0){_0x4c7cf8=0x1;}_0x4af4b6=new RegExp(_0x034c('0x146')+_0x4c7cf8+'}$');_0x9b2938=Math[_0x034c('0x147')](0xa,_0x4c7cf8-0x1);_0x2a4208=Math[_0x034c('0x147')](0xa,_0x4c7cf8)-0x1;return util['format']('%s',_[_0x034c('0x148')](_0x3ca164,_0x4af4b6,_['random'](_0x9b2938,_0x2a4208)));}function extractCalleridName(_0x43cde5){var _0x246478=_0x43cde5[_0x034c('0x149')](/"(.*?)"/);return _0x246478?_0x246478[0x1]:_0x43cde5;}function extractCalleridNumber(_0x137449){var _0x2d0607=_0x137449[_0x034c('0x149')](/<(.*?)>/);return _0x2d0607?_0x2d0607[0x1]:_0x137449;}Dialer[_0x034c('0x1a')][_0x034c('0x14a')]=function(_0x4ac6fd,_0x4485e2){var _0xc9648e=this;var _0x9149cf=uuid['v4']();this['actions'][_0x9149cf]=new Action(_0x4ac6fd,_0x4485e2,_0x9149cf);return new BPromise(function(_0x41c628,_0x3200de){if(_[_0x034c('0x39')](_0x4ac6fd)&&'object'!==typeof _0x4ac6fd){return _0x3200de(msgResponse('originate',_0x034c('0x125'),_0x034c('0x14b')));}if(_[_0x034c('0x39')](_0x4485e2[_0x034c('0x14c')][_0x034c('0x14d')])||_0x4485e2[_0x034c('0x14c')][_0x034c('0x14d')]===null){return _0x3200de(msgResponse(_0x034c('0x14e'),_0x034c('0x125'),_0x034c('0x14f')));}var _0x43b777={'XMD-CALLERID':_0xc9648e['actions'][_0x9149cf][_0x034c('0x150')](),'XMD-AGI':_0x4ac6fd['dialQueueProject']?util[_0x034c('0x75')](_0x034c('0x151'),ipAgi,_0x4ac6fd['dialQueueProject']):_0x034c('0x152'),'XMD-AGIAFTER':_0x4ac6fd[_0x034c('0xf6')]?util['format'](_0x034c('0x151'),ipAgi,_0x4ac6fd[_0x034c('0xf6')]):'NONE','XMD-QUEUE':_0x4ac6fd[_0x034c('0x49')]==='outbound'?util['format'](_0x034c('0x153'),_0x4ac6fd[_0x034c('0x3c')],_0x4ac6fd[_0x034c('0x154')]||'',_0x4ac6fd[_0x034c('0xf7')]?'c':'',_0x4ac6fd['dialQueueTimeout']||0x3):_0x034c('0x152'),'XMD-CONTACTID':_0x4485e2[_0x034c('0x112')],'XMD-CDRTYPE':_0x034c('0x5'),'CALLERID(all)':_0xc9648e['actions'][_0x9149cf][_0x034c('0x150')](),'XMD-AMD':_0x4ac6fd[_0x034c('0xdc')]?_0x034c('0x155'):_0x034c('0x152'),'XMD-DESTINATION':_0x034c('0x156')};if(_0x4ac6fd[_0x034c('0xdc')]){_0x43b777[_0x034c('0x157')]=_0x4ac6fd['dialAMDInitialSilence']||0x9c4;_0x43b777[_0x034c('0x158')]=_0x4ac6fd['dialAMDGreeting']||0x5dc;_0x43b777[_0x034c('0x159')]=_0x4ac6fd['dialAMDAfterGreetingSilence']||0x320;_0x43b777['XMD-AMDTOTALANALYSISTIME']=_0x4ac6fd[_0x034c('0x15a')]||0x1388;_0x43b777[_0x034c('0x15b')]=_0x4ac6fd[_0x034c('0x15c')]||0x64;_0x43b777['XMD-AMDBETWEENWORDSSILENCE']=_0x4ac6fd[_0x034c('0x15d')]||0x32;_0x43b777[_0x034c('0x15e')]=_0x4ac6fd[_0x034c('0x15f')]||0x3;_0x43b777['XMD-AMDSILENCETHRESHOLD']=_0x4ac6fd[_0x034c('0x160')]||0x100;_0x43b777[_0x034c('0x161')]=_0x4ac6fd['dialAMDMaximumWordLength']||0x1388;}if(_0x4ac6fd[_0x034c('0x49')]==='outbound'){_0x43b777[_0x034c('0x162')]=_0x4485e2['VoiceQueueId'];}else{_0x43b777[_0x034c('0x163')]=_0x4485e2[_0x034c('0xcf')];}for(var _0x1190b6 in _0x4485e2[_0x034c('0x14c')]){if(_0x4485e2[_0x034c('0x14c')][_0x034c('0xab')](_0x1190b6)){if(isNotNull(_0x4485e2[_0x034c('0x14c')][_0x1190b6])&&_0x1190b6!=='id'&&_0x1190b6!==_0x034c('0x164')&&_0x1190b6!==_0x034c('0x165')&&_0x1190b6!==_0x034c('0x166')){_0x43b777[util[_0x034c('0x75')](_0x034c('0x167'),_0x034c('0x168'),_[_0x034c('0x169')](_0x1190b6))]=_0x4485e2[_0x034c('0x14c')][_0x1190b6];}}}var _0x5786b1=_0xc9648e[_0x034c('0xd4')](_0x4ac6fd[_0x034c('0x70')])?getCallerId(_0x4ac6fd[_0x034c('0x70')][_0x034c('0x72')],_0x4ac6fd[_0x034c('0x55')],_0x4ac6fd[_0x034c('0x16a')]>0x0?getCallerIdRandom(_0x4ac6fd['dialOriginateCallerIdNumber'],_0x4ac6fd[_0x034c('0x16a')]):_0x4ac6fd[_0x034c('0x56')]):getCallerId(_['isNil'](_0x4ac6fd['TrunkBackup'])?_0x4ac6fd['Trunk'][_0x034c('0x72')]:_0x4ac6fd[_0x034c('0x16b')][_0x034c('0x72')],_0x4ac6fd[_0x034c('0x55')],_0x4ac6fd[_0x034c('0x16a')]>0x0?getCallerIdRandom(_0x4ac6fd['dialOriginateCallerIdNumber'],_0x4ac6fd[_0x034c('0x16a')]):_0x4ac6fd[_0x034c('0x56')]);if(_0x5786b1){_0x43b777['XMD-ORIGINATECALLERIDNAME']=_0xc9648e[_0x034c('0xa9')][_0x9149cf][_0x034c('0x16c')]=extractCalleridName(_0x5786b1);_0x43b777[_0x034c('0x16d')]=_0xc9648e[_0x034c('0xa9')][_0x9149cf][_0x034c('0x16e')]=extractCalleridNumber(_0x5786b1);}return ami[_0x034c('0xac')]({'actionid':_0x9149cf,'action':'originate','channel':_0xc9648e[_0x034c('0xd4')](_0x4ac6fd[_0x034c('0x70')])?util['format'](_0x034c('0x16f'),_0x4ac6fd[_0x034c('0x70')]['name'],isNotNull(_0x4ac6fd[_0x034c('0x58')])?_0x4ac6fd[_0x034c('0x58')]['trim']()||'':'',_0x4ac6fd[_0x034c('0x170')]>0x0?_0x4485e2[_0x034c('0x14c')][_0x034c('0x14d')][_0x034c('0x171')](_0x4ac6fd[_0x034c('0x170')]):_0x4485e2[_0x034c('0x14c')]['phone']):util[_0x034c('0x75')](_0x034c('0x16f'),_[_0x034c('0xd8')](_0x4ac6fd[_0x034c('0x16b')])?_0x4ac6fd[_0x034c('0x70')][_0x034c('0x3c')]:_0x4ac6fd['TrunkBackup']['name'],isNotNull(_0x4ac6fd[_0x034c('0x58')])?_0x4ac6fd[_0x034c('0x58')]['trim']()||'':'',_0x4ac6fd['dialCutDigit']>0x0?_0x4485e2[_0x034c('0x14c')][_0x034c('0x14d')][_0x034c('0x171')](_0x4ac6fd['dialCutDigit']):_0x4485e2[_0x034c('0x14c')][_0x034c('0x14d')]),'callerid':_0x5786b1,'Exten':_0x034c('0x156'),'Context':_0x034c('0x172'),'Priority':'1','variable':_0x43b777,'timeout':(_0x4ac6fd['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x9149cf})[_0x034c('0xb6')](function(_0x1e0064){return _0x41c628(_0x1e0064);})[_0x034c('0xae')](function(_0x3eb3e3){_0x4ac6fd['outboundOriginateFailureCallsDay']+=0x1;var _0x4b30a1=new History(_0xc9648e['actions'][_0x9149cf]);logger[_0x034c('0x94')](util[_0x034c('0x75')]('[originateError]:\x20%s',JSON[_0x034c('0x73')](_0x3eb3e3)));_0x4b30a1['state']=0xe;_0x4b30a1[_0x034c('0xa4')]=_0x034c('0x173');_0x4b30a1[_0x034c('0xa6')]=moment()['format'](_0x034c('0xf8'));_0x4b30a1[_0x034c('0xa5')]=_0x4b30a1[_0x034c('0xa6')];_0xc9648e['createHistory'](_0x4b30a1)[_0x034c('0xae')](loggerCatch('[originate][error]'));_0xc9648e[_0x034c('0xc3')](_0x4b30a1)[_0x034c('0xae')](loggerCatch(_0x034c('0x174')))[_0x034c('0x1d')](function(){delete _0xc9648e[_0x034c('0xa9')][_0x9149cf];return _0x3200de(msgResponse(_0x034c('0x14e'),_0x034c('0x45'),'originate\x20action\x20Error'));});});});};Dialer[_0x034c('0x1a')][_0x034c('0x2e')]=function(_0x383b06){var _0x62a613=this[_0x034c('0xa9')][_0x383b06['actionid']];var _0x36e797=this;if(_0x62a613){delete this[_0x034c('0xa9')][_0x383b06['actionid']];_0x62a613[_0x034c('0xff')]=moment()['format'](_0x034c('0xf8'));var _0x5813d9=_0x62a613[_0x034c('0x49')]===_0x034c('0x78')?this[_0x034c('0x21')][_0x62a613[_0x034c('0xb1')]]:this[_0x034c('0x20')][_0x62a613[_0x034c('0x175')]()];if(!this['isSuccess'](_0x383b06[_0x034c('0x176')])){this[_0x034c('0xb2')](_0x5813d9);return this[_0x034c('0x177')](_0x62a613,_0x5813d9,_0x383b06)[_0x034c('0xb6')](function(_0x93efa7){})[_0x034c('0xae')](loggerCatch(_0x034c('0x178')));}else{this[_0x034c('0x26')][_0x383b06['uniqueid']]=_0x62a613;}}};Dialer[_0x034c('0x1a')]['checkRetriveMax']=function(_0x58d020,_0x1a0210,_0xd2f95d){var _0x3dbabf=new History(_0x1a0210);if(_0x3dbabf[_0x034c('0x179')]+_0x3dbabf['countcongestionretry']+_0x3dbabf[_0x034c('0x17a')]>=_0xd2f95d['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x58d020){case 0x3:if(_0x3dbabf[_0x034c('0x17a')]>=_0xd2f95d[_0x034c('0x17b')]-0x1){return!![];}else{this[_0x034c('0xbd')]({'active':![],'countnoanswerretry':_0x3dbabf[_0x034c('0x17a')]+=0x1,'scheduledat':moment()[_0x034c('0x17c')](_0xd2f95d['dialNoAnswerRetryFrequency'],_0x034c('0x17d'))[_0x034c('0x75')](_0x034c('0xf8')),'ContactId':_0x3dbabf['ContactId'],'ListId':_0x3dbabf[_0x034c('0xcd')],'VoiceQueueId':_0x3dbabf[_0x034c('0xce')]||undefined,'CampaignId':_0x3dbabf[_0x034c('0xcf')]||undefined})[_0x034c('0xae')](loggerCatch(_0x034c('0x17e')));}break;case 0x5:if(_0x3dbabf[_0x034c('0x179')]>=_0xd2f95d[_0x034c('0x17f')]-0x1){return!![];}else{this[_0x034c('0xbd')]({'active':![],'countbusyretry':_0x3dbabf['countbusyretry']+=0x1,'scheduledat':moment()[_0x034c('0x17c')](_0xd2f95d[_0x034c('0x180')],_0x034c('0x17d'))['format'](_0x034c('0xf8')),'ContactId':_0x3dbabf['ContactId'],'ListId':_0x3dbabf[_0x034c('0xcd')],'VoiceQueueId':_0x3dbabf[_0x034c('0xce')]||undefined,'CampaignId':_0x3dbabf[_0x034c('0xcf')]||undefined})[_0x034c('0xae')](loggerCatch('[rescheduleContact]\x20[Busy]'));}break;case 0x8:if(_0x3dbabf[_0x034c('0x181')]>=_0xd2f95d[_0x034c('0x182')]-0x1){return!![];}else{this[_0x034c('0xbd')]({'active':![],'countcongestionretry':_0x3dbabf['countcongestionretry']+=0x1,'scheduledat':moment()[_0x034c('0x17c')](_0xd2f95d[_0x034c('0x183')],_0x034c('0x17d'))['format'](_0x034c('0xf8')),'ContactId':_0x3dbabf[_0x034c('0x112')],'ListId':_0x3dbabf[_0x034c('0xcd')],'VoiceQueueId':_0x3dbabf[_0x034c('0xce')]||undefined,'CampaignId':_0x3dbabf[_0x034c('0xcf')]||undefined})[_0x034c('0xae')](loggerCatch(_0x034c('0x184')));}break;default:return!![];}};Dialer['prototype'][_0x034c('0x177')]=function(_0x3e0084,_0x3ce5ed,_0xc2dfcd){var _0x3e14b0=this;var _0x38cddd=new History(_0x3e0084);return new BPromise(function(_0x41d2c3,_0x3661b0){if(_[_0x034c('0x39')](_0x3ce5ed)&&_0x034c('0x185')!==typeof _0x3ce5ed){return _0x3661b0(msgResponse(_0x034c('0x186'),_0x034c('0x125'),_0x034c('0x187')));}if(_[_0x034c('0x39')](_0xc2dfcd)&&_0x034c('0x185')!==typeof _0xc2dfcd){return _0x3661b0(msgResponse('[callProgressDetecting]','Failure','evt\x20is\x20undefine'));}switch(_0xc2dfcd['reason']){case'0':_0x3ce5ed[_0x034c('0x188')]+=0x1;_0x38cddd[_0x034c('0xe0')]=0x0;_0x38cddd[_0x034c('0xa4')]=_0x034c('0x189');_0x3e14b0[_0x034c('0xc5')](_0x38cddd)[_0x034c('0xae')](loggerCatch(_0x034c('0x18a')));if(_0x3e14b0[_0x034c('0x18b')](0x0,_0x3e0084,_0x3ce5ed)){if(_0x38cddd[_0x034c('0x179')]+_0x38cddd['countcongestionretry']+_0x38cddd[_0x034c('0x17a')]>=_0x3ce5ed[_0x034c('0x18c')]){_0x3e14b0['stateGlobal'](_0x38cddd,_0x41d2c3,_0x3661b0,_0x034c('0x18d'));}else{_0x3e14b0[_0x034c('0x18e')](_0x38cddd,_0x41d2c3,_0x3661b0,_0x034c('0x18d'));}}break;case'3':_0x3ce5ed['outboundNoAnswerCallsDay']+=0x1;_0x38cddd[_0x034c('0xe0')]=0x3;_0x38cddd[_0x034c('0xa4')]='NoAnswer';_0x38cddd[_0x034c('0x17a')]+=0x1;_0x38cddd[_0x034c('0x18f')]+=0x1;_0x3e14b0[_0x034c('0xc5')](_0x38cddd)[_0x034c('0xae')](loggerCatch(_0x034c('0x190')));if(_0x3e14b0[_0x034c('0x18b')](0x3,_0x3e0084,_0x3ce5ed)){if(_0x38cddd[_0x034c('0x17a')]>=_0x3ce5ed[_0x034c('0x17b')]){_0x3e14b0['createStateFinal'](_0x38cddd,_0x41d2c3,_0x3661b0,_0x034c('0x191'));}else{_0x3e14b0[_0x034c('0x192')](_0x38cddd,_0x41d2c3,_0x3661b0,_0x034c('0x191'));}}break;case'5':_0x3ce5ed[_0x034c('0x193')]+=0x1;_0x38cddd[_0x034c('0xe0')]=0x5;_0x38cddd[_0x034c('0xa4')]=_0x034c('0x194');_0x38cddd[_0x034c('0x179')]+=0x1;_0x38cddd['countglobal']+=0x1;_0x3e14b0['createHistory'](_0x38cddd)[_0x034c('0xae')](loggerCatch(_0x034c('0x195')));if(_0x3e14b0[_0x034c('0x18b')](0x5,_0x3e0084,_0x3ce5ed)){if(_0x38cddd[_0x034c('0x179')]>=_0x3ce5ed[_0x034c('0x17f')]){_0x3e14b0['createStateFinal'](_0x38cddd,_0x41d2c3,_0x3661b0,_0x034c('0x196'));}else{_0x3e14b0[_0x034c('0x192')](_0x38cddd,_0x41d2c3,_0x3661b0,_0x034c('0x196'));}}break;case'8':_0x3ce5ed['outboundCongestionCallsDay']+=0x1;_0x38cddd['state']=0x8;_0x38cddd[_0x034c('0xa4')]=_0x034c('0x197');_0x38cddd[_0x034c('0x181')]+=0x1;_0x38cddd[_0x034c('0x18f')]+=0x1;_0x3e14b0[_0x034c('0xc5')](_0x38cddd)[_0x034c('0xae')](loggerCatch(_0x034c('0x198')));if(_0x3e14b0[_0x034c('0x18b')](0x8,_0x3e0084,_0x3ce5ed)){if(_0x38cddd['countcongestionretry']>=_0x3ce5ed[_0x034c('0x182')]){_0x3e14b0[_0x034c('0x18e')](_0x38cddd,_0x41d2c3,_0x3661b0,_0x034c('0x199'));}else{_0x3e14b0[_0x034c('0x192')](_0x38cddd,_0x41d2c3,_0x3661b0,_0x034c('0x199'));}}break;default:_0x3ce5ed[_0x034c('0x62')]+=0x1;_0x38cddd['state']=0xc;_0x38cddd[_0x034c('0xa4')]=_0xc2dfcd[_0x034c('0x19a')];_0x3e14b0[_0x034c('0xc5')](_0x38cddd)['catch'](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x3e14b0[_0x034c('0x18b')](_0xc2dfcd['reason'],_0x3e0084,_0x3ce5ed)){if(_0x38cddd[_0x034c('0x179')]+_0x38cddd[_0x034c('0x181')]+_0x38cddd[_0x034c('0x17a')]>=_0x3ce5ed['dialGlobalMaxRetry']){_0x3e14b0['stateGlobal'](_0x38cddd,_0x41d2c3,_0x3661b0,_0xc2dfcd[_0x034c('0x19a')]);}else{_0x3e14b0[_0x034c('0x18e')](_0x38cddd,_0x41d2c3,_0x3661b0,_0xc2dfcd[_0x034c('0x19a')]);}}}});};Dialer['prototype'][_0x034c('0x192')]=function(_0x422985,_0x7b2155,_0x2a6011,_0x34da8e){var _0x20b1c3=new Final(_0x422985);_0x20b1c3[_0x034c('0xe0')]=0xf;_0x20b1c3['statedesc']=_0x034c('0x19b');this[_0x034c('0x18e')](_0x20b1c3,_0x7b2155,_0x2a6011,_0x34da8e);};Dialer[_0x034c('0x1a')][_0x034c('0x18e')]=function(_0x1b3a0b,_0x1f87fc,_0x4b87e6,_0x5471ab){this[_0x034c('0xc3')](_0x1b3a0b)[_0x034c('0xb6')](function(_0x230c30){return _0x1f87fc(msgResponse('[callProgressDetecting]',_0x034c('0xd3'),_0x5471ab));})[_0x034c('0xae')](function(_0xbde46e){return _0x4b87e6(msgResponse(_0x034c('0x19c'),_0x034c('0x125'),_0x034c('0x19d')));});};Dialer[_0x034c('0x1a')]['predictive']=function(_0x164454){var _0x330d8e=this;var _0x10c7c3=_0x164454['dialPredictiveOptimizationPercentage']/0x64;var _0x1d2f7a=_0x164454['outboundDropCallsDayTimeout']/(_0x164454[_0x034c('0x5d')]+_0x164454[_0x034c('0xdf')]);var _0x4e4004=Math[_0x034c('0x19e')](_0x164454[_0x034c('0x19f')]*(_0x164454[_0x034c('0x1a0')]/0x64));var _0x12153c=Math[_0x034c('0x19e')](_0x164454[_0x034c('0x19f')]*(_0x164454[_0x034c('0x1a1')]/0x64));var _0x44bb7d=_0x164454[_0x034c('0x4c')]+_0x164454[_0x034c('0x50')];var _0x4eb7b4=Math[_0x034c('0x1a2')](_0x164454[_0x034c('0x6a')]*_0x164454['erlangAbandonmentRate']*_0x164454['predictiveIntervalHitRate']*_0x164454[_0x034c('0x67')]);if(_[_0x034c('0x39')](_0x164454[_0x034c('0x6f')])){if(!_['isUndefined'](_0x164454[_0x034c('0x6e')])){_0x164454[_0x034c('0x6e')]=undefined;loggerPredictive[_0x034c('0x94')]('[startMethodPredictive][StartProgressive]',_0x034c('0x1a3'));}if(!_[_0x034c('0x39')](_0x164454[_0x034c('0x8f')])){loggerPredictive[_0x034c('0x94')](_0x034c('0x1a4'),_0x034c('0x1a5'));clearInterval(_0x164454[_0x034c('0x8f')]);_0x164454[_0x034c('0x8f')]=undefined;}_0x164454['startProgressive']=moment()['format'](_0x034c('0xf8'));loggerPredictive[_0x034c('0x7b')](_0x164454['name'],_0x034c('0x1a6'),_0x164454['startProgressive']);this[_0x034c('0x13b')](_0x164454,0x1);}else if(ifInterval(_0x164454[_0x034c('0x1a7')],_0x164454[_0x034c('0x6f')])){this[_0x034c('0x13b')](_0x164454,0x1);loggerPredictiveCalls[_0x034c('0x7b')](_0x034c('0x1a8'),_0x164454['startProgressive'],_0x164454[_0x034c('0x3c')]);_0x164454[_0x034c('0x6a')]=0x0;_0x164454[_0x034c('0x101')]=0x0;}else if(_0x10c7c3<_0x1d2f7a&&_0x164454[_0x034c('0x1a9')]===_0x034c('0x1aa')){freeVariablesPredictive(_0x164454);loggerPredictive[_0x034c('0x7b')](_0x034c('0x1ab'),_0x034c('0x1ac'),_0x1d2f7a,_0x034c('0x6f'),_0x164454['name']);}else if(_0x4eb7b4<_0x164454['predictiveIntervalErlangCallsDroppedCalls']&&_0x164454[_0x034c('0x1a9')]===_0x034c('0x1aa')){freeVariablesPredictive(_0x164454);loggerPredictive[_0x034c('0x7b')](_0x034c('0x1ad'),'Max\x20Drop\x20',_0x4eb7b4,_0x034c('0x1ae'),_0x164454[_0x034c('0x101')],_0x034c('0x6f'),_0x164454[_0x034c('0x3c')]);}else if(!ifInterval(_0x164454[_0x034c('0x1a7')],_0x164454['startProgressive'])&&_['isUndefined'](_0x164454['startPredictive'])&&!_['isUndefined'](_0x164454[_0x034c('0x6f')])){_0x164454[_0x034c('0x6e')]=moment()[_0x034c('0x75')](_0x034c('0xf8'));loggerPredictive[_0x034c('0x7b')](_0x164454[_0x034c('0x3c')],'started\x20in\x20predictive\x20at',_0x164454[_0x034c('0x6e')]);this[_0x034c('0xbb')](_0x164454[_0x034c('0x1a7')])[_0x034c('0xb6')](this[_0x034c('0x1af')](_0x164454))[_0x034c('0xb6')](mergeDataErlangB(_0x164454))[_0x034c('0xb6')](this['startMethodPredictive'](_0x164454))[_0x034c('0xae')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x164454));}else if(!ifInterval(_0x164454['dialPredictiveInterval'],_0x164454[_0x034c('0x6e')])){_0x164454[_0x034c('0x101')]=0x0;_0x164454[_0x034c('0x6e')]=moment()[_0x034c('0x75')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x034c('0x7b')](_0x164454[_0x034c('0x3c')],_0x034c('0x1b0'),_0x164454[_0x034c('0x6e')]);clearInterval(_0x164454['handlePredictive']);_0x164454[_0x034c('0x8f')]=undefined;this[_0x034c('0xbb')](_0x164454['dialPredictiveInterval'])[_0x034c('0xb6')](this['getDataPredictive'](_0x164454))[_0x034c('0xb6')](mergeDataErlangB(_0x164454))[_0x034c('0xb6')](this[_0x034c('0x1b1')](_0x164454))[_0x034c('0xae')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x164454));}else if(_0x164454[_0x034c('0x19f')]&&_0x44bb7d<_0x164454[_0x034c('0x19f')]-_0x12153c){freeVariablesPredictive(_0x164454);loggerPredictive[_0x034c('0x7b')](_0x164454[_0x034c('0x3c')],_0x034c('0x1b2'),_0x44bb7d,_0x034c('0x1b3'),_0x164454[_0x034c('0x19f')],'-',_0x12153c,'=',_0x164454[_0x034c('0x19f')]-_0x12153c,')');}else if(_0x164454['predictiveIntervalAvailable']&&_0x44bb7d>_0x164454[_0x034c('0x19f')]+_0x4e4004){freeVariablesPredictive(_0x164454);loggerPredictive[_0x034c('0x7b')](_0x164454['name'],_0x034c('0x1b2'),_0x44bb7d,_0x034c('0x1b4'),_0x164454[_0x034c('0x19f')],'+',_0x4e4004,'=',_0x164454[_0x034c('0x19f')]+_0x4e4004,')');}};Dialer['prototype'][_0x034c('0x1af')]=function(_0x23001c){var _0x275db6=this;return function(_0x34e96d){return new BPromise(function(_0x764237,_0x509555){_[_0x034c('0x8b')](_0x23001c,_0x34e96d[0x0]);if(checkGetDataPredictive(_0x34e96d[0x0])){var _0x30f90f=_0x23001c[_0x034c('0x19f')]=_0x23001c[_0x034c('0x50')]+_0x23001c[_0x034c('0x4c')];var _0x3b7982=_0x23001c[_0x034c('0x1a7')]*0x3c;var _0x167597=_0x34e96d[0x0][_0x034c('0x64')]+_0x34e96d[0x0][_0x034c('0x63')];var _0x2cb3a5=(_0x34e96d[0x0][_0x034c('0x7e')]+_0x34e96d[0x0][_0x034c('0x65')]+_0x34e96d[0x0][_0x034c('0x80')])/_0x34e96d[0x0]['predictiveIntervalTotalCalls'];_0x23001c['predictiveIntervalHitRate']=_0x2cb3a5>0x0?_0x2cb3a5:0x1;switch(_0x23001c[_0x034c('0x1a9')]){case'dropRate':var _0x17c0f5=_0x23001c[_0x034c('0x1b5')]/0x64;return _0x275db6[_0x034c('0x1b6')](_0x30f90f,_0x3b7982,_0x167597,_0x2cb3a5,_0x17c0f5)[_0x034c('0xb6')](function(_0x1ac40c){return _0x764237(_0x1ac40c);});case _0x034c('0x1b7'):var _0x4abe2e=_0x23001c[_0x034c('0x1b5')]/0x64;return _0x275db6[_0x034c('0x1b8')](_0x30f90f,_0x3b7982,_0x167597,_0x2cb3a5,_0x4abe2e)['then'](function(_0x3137a7){return _0x764237(_0x3137a7);});default:return _0x509555(msgResponse(_0x034c('0x1b9'),_0x034c('0x125'),_0x034c('0x1ba')));}}else{return _0x509555(msgResponse('[getDataPredictive]','Failure',_0x034c('0x1bb')));}});};};Dialer['prototype']['getDataPredictiveOld']=function(_0x4d56d3){var _0x10d5cb=this;return function(_0x3a30d5){return new BPromise(function(_0x58827c,_0x19fb13){_[_0x034c('0x8b')](_0x4d56d3,_0x3a30d5[0x0]);if(checkGetDataPredictive(_0x3a30d5[0x0])){loggerPredictive['info'](JSON[_0x034c('0x73')](_0x3a30d5[0x0]));if(_0x4d56d3[_0x034c('0x1a9')]==='dropRate'){return _0x10d5cb[_0x034c('0xc1')](_0x4d56d3['id'])[_0x034c('0xb6')](function(_0x276ec7){var _0x12586b=_0x4d56d3[_0x034c('0x140')]-_0x276ec7[0x0][_0x034c('0x1bc')];var _0x58e1fa=_0x4d56d3[_0x034c('0x1a7')]*0x3c;var _0x30b06d=_0x3a30d5[0x0][_0x034c('0x64')]+_0x3a30d5[0x0][_0x034c('0x63')];var _0x281731=(_0x3a30d5[0x0][_0x034c('0x7e')]+_0x3a30d5[0x0][_0x034c('0x65')]+_0x3a30d5[0x0][_0x034c('0x80')])/_0x3a30d5[0x0][_0x034c('0x7d')];var _0x2c89eb=_0x4d56d3['dialPredictiveOptimizationPercentage']/0x64;_0x4d56d3[_0x034c('0x68')]=_0x276ec7[0x0][_0x034c('0x1bc')]||0x0;_0x4d56d3[_0x034c('0x1bd')]=_0x281731>0x0?_0x281731:0x1;return _0x10d5cb[_0x034c('0x1b6')](_0x12586b,_0x58e1fa,_0x30b06d,_0x281731,_0x2c89eb);})[_0x034c('0xb6')](function(_0x14d1d4){return _0x58827c(_0x14d1d4);})[_0x034c('0xae')](function(_0x44d577){return _0x19fb13(msgResponse(_0x034c('0x1be'),'Failure',JSON[_0x034c('0x73')](_0x44d577)));});}if(_0x4d56d3[_0x034c('0x1a9')]===_0x034c('0x1b7')){return _0x10d5cb['getVoiceQueueRtPauses'](_0x4d56d3['id'])[_0x034c('0xb6')](function(_0x69a4d1){var _0xac1c32=_0x4d56d3['loggedIn']-_0x69a4d1[0x0][_0x034c('0x1bc')];var _0x12a3ae=_0x4d56d3[_0x034c('0x1a7')]*0x3c;var _0x23929c=_0x3a30d5[0x0][_0x034c('0x64')]+_0x3a30d5[0x0][_0x034c('0x63')];var _0x84501b=(_0x3a30d5[0x0][_0x034c('0x7e')]+_0x3a30d5[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x3a30d5[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x3a30d5[0x0]['predictiveIntervalTotalCalls'];var _0x2fe065=_0x4d56d3[_0x034c('0x1b5')]/0x64;_0x4d56d3[_0x034c('0x68')]=_0x69a4d1[0x0][_0x034c('0x1bc')]||0x0;_0x4d56d3[_0x034c('0x1bd')]=_0x84501b>0x0?_0x84501b:0x1;return _0x10d5cb[_0x034c('0x1b8')](_0xac1c32,_0x12a3ae,_0x23929c,_0x84501b,_0x2fe065);})[_0x034c('0xb6')](function(_0x9c66f2){return _0x58827c(_0x9c66f2);})['catch'](function(_0x1643a8){return _0x19fb13(msgResponse(_0x034c('0x1be'),_0x034c('0x125'),JSON[_0x034c('0x73')](_0x1643a8)));});}}else{return _0x19fb13(msgResponse(_0x034c('0x1b9'),'Failure',_0x034c('0x1bb')));}});};};Dialer[_0x034c('0x1a')]['startMethodPredictive']=function(_0x2d15bc){var _0x3d045e=this;return function(){var _0x39b850=0x0;var _0x4cf084=Math[_0x034c('0x1a2')](_0x2d15bc[_0x034c('0x6b')]*0x3e8);if(_0x4cf084>0x0){_0x4cf084=_0x4cf084<0x64?0x64:_0x4cf084;loggerPredictive[_0x034c('0x7b')](_0x2d15bc[_0x034c('0x3c')],'one\x20call\x20every:',_0x4cf084,_0x034c('0x46'));_0x2d15bc[_0x034c('0x8f')]=setInterval(function(){_0x3d045e['handlePredictive'](_0x2d15bc);loggerPredictiveCalls['info'](_0x034c('0x1bf'),_0x39b850+=0x1);},_0x4cf084);}else{loggerPredictive['info'](_0x2d15bc[_0x034c('0x3c')],_0x034c('0x1c0'));}};};Dialer[_0x034c('0x1a')][_0x034c('0x1c1')]=function(_0x5c9502,_0x2ee119){var _0x4560f0=this;return function(_0x5c2193){if(_[_0x034c('0x42')](_0x5c2193)){if(_['isNil'](_0x2ee119[_0x034c('0x1c2')])||!_0x2ee119[_0x034c('0x1c3')]){if(_0x5c9502['dialMethod']===_0x034c('0x6')){_0x5c9502[_0x034c('0x10e')]=_[_0x034c('0x39')](_0x5c9502[_0x034c('0x10e')])?!![]:_0x5c9502[_0x034c('0x10e')];var _0x4c055c=uuid['v4']();_0x4560f0[_0x034c('0xa9')][_0x4c055c]=new Action(_0x5c9502,_0x2ee119,_0x4c055c);loggerBooked[_0x034c('0x7b')](_0x034c('0x1c4'),_0x4c055c,_0x034c('0x1c5'),JSON['stringify'](_0x5c9502[_0x034c('0x10e')]),_0x034c('0x1c6'),_0x5c9502[_0x034c('0x3c')]);if(_0x5c9502[_0x034c('0x10e')]){_0x5c9502[_0x034c('0x10e')]=![];_0x4560f0[_0x034c('0x28')][_0x4560f0[_0x034c('0xa9')][_0x4c055c][_0x034c('0xb1')]]=[];ami[_0x034c('0xac')]({'actionid':_0x4c055c,'action':_0x034c('0x1c7'),'queue':_0x5c9502[_0x034c('0x3c')]})[_0x034c('0xae')](function(_0x203c98){_0x4560f0[_0x034c('0xb2')](_0x5c9502);_0x4560f0['rescheduleContact']({'active':![],'ContactId':_0x4560f0[_0x034c('0xa9')][_0x4c055c][_0x034c('0x112')],'ListId':_0x4560f0['actions'][_0x4c055c][_0x034c('0xcd')],'VoiceQueueId':_0x4560f0[_0x034c('0xa9')][_0x4c055c]['VoiceQueueId']||undefined,'CampaignId':_0x4560f0[_0x034c('0xa9')][_0x4c055c][_0x034c('0xcf')]||undefined})[_0x034c('0xae')](loggerCatch(_0x034c('0x1c8')));delete _0x4560f0[_0x034c('0xa9')][_0x4c055c];});}else{loggerBooked[_0x034c('0x7b')]('[booked][checkContactBlack][else]',JSON[_0x034c('0x73')](_0x5c9502[_0x034c('0x10e')]),_0x034c('0x1c6'),_0x5c9502[_0x034c('0x3c')]);_0x4560f0[_0x034c('0xb2')](_0x5c9502);_0x4560f0[_0x034c('0xbd')]({'active':![],'ContactId':_0x4560f0[_0x034c('0xa9')][_0x4c055c][_0x034c('0x112')],'ListId':_0x4560f0[_0x034c('0xa9')][_0x4c055c][_0x034c('0xcd')],'VoiceQueueId':_0x4560f0[_0x034c('0xa9')][_0x4c055c]['VoiceQueueId']||undefined,'CampaignId':_0x4560f0[_0x034c('0xa9')][_0x4c055c][_0x034c('0xcf')]||undefined})[_0x034c('0xae')](loggerCatch(_0x034c('0x1c8')));delete _0x4560f0['actions'][_0x4c055c];}}else{return _0x4560f0[_0x034c('0x14a')](_0x5c9502,_0x2ee119);}}else{if(getDiff(_0x2ee119[_0x034c('0x1c9')])<_0x5c9502[_0x034c('0x1ca')]*0x3c){_0x4560f0['preview'][_0x034c('0x110')](_0x2ee119['id'])[_0x034c('0x1d')](function(){_0x4560f0['updateOriginated'](_0x5c9502);});}else{_0x5c9502[_0x034c('0x60')]+=0x1;_0x4560f0['updateOriginated'](_0x5c9502);if(_0x5c9502[_0x034c('0x1cb')]){_0x4560f0[_0x034c('0xbd')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x2ee119[_0x034c('0x112')],'ListId':_0x2ee119[_0x034c('0xcd')],'VoiceQueueId':_0x2ee119[_0x034c('0xce')]||undefined,'CampaignId':_0x2ee119[_0x034c('0xcf')]||undefined})[_0x034c('0xae')](loggerCatch(_0x034c('0x1cc')));_0x4560f0['createHistory'](createObjHistory(_0x5c9502,_0x2ee119,'RECALLINQUEUE',0x17,'RecallInQueue'))['catch'](loggerCatch(_0x034c('0x1cd')));}else{_0x4560f0[_0x034c('0xcb')](createObjHistory(_0x5c9502,_0x2ee119,_0x034c('0x1ce'),0x16,'RecallFailedTimeout'),'[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]');}}}}else{_0x5c9502[_0x034c('0x5a')]+=0x1;_0x4560f0[_0x034c('0xcb')](createObjHistory(_0x5c9502,_0x2ee119,_0x034c('0x1cf'),0xd,_0x034c('0x1d0')),_0x034c('0x1d1'),_0x034c('0x1d2'));throw _0x034c('0x1d3');}};};Dialer[_0x034c('0x1a')][_0x034c('0x1d4')]=function(_0x4ff775){var _0x4f6475=this;var _0x42d85f=[];var _0x367c9a=_0x4ff775['limitCalls']-_0x4ff775[_0x034c('0x69')]-_0x4ff775[_0x034c('0x1d5')];emitCampaignSummary(_0x4ff775);if(_0x367c9a>0x0){if(_0x367c9a>this['maxNumberOriginate']){_0x367c9a=this[_0x034c('0x24')];}_0x4ff775[_0x034c('0x1d5')]+=_0x367c9a;this[_0x034c('0xc0')](_0x4ff775['id'],_0x367c9a,_0x4ff775[_0x034c('0x1d6')])['then'](function(_0xefc1e9){_0x4ff775[_0x034c('0x1d5')]-=_0x367c9a;_0x4ff775[_0x034c('0x1d5')]=_0x4ff775['temp']>0x0?_0x4ff775[_0x034c('0x1d5')]:0x0;if(!checkContactEmpty(_0xefc1e9)){_0x4ff775['message']=_0x034c('0x9c');logger['info'](_0x034c('0x1d7')+_0x4ff775[_0x034c('0x3c')]);}else{_0x4ff775[_0x034c('0x69')]+=_0xefc1e9[_0x034c('0x97')];_0x4ff775['message']=_0x034c('0x1d8');for(var _0x5bbd18=0x0;_0x5bbd18<_0xefc1e9[_0x034c('0x97')];_0x5bbd18+=0x1){_0x4ff775[_0x034c('0x1d9')]+=0x1;if(_['isNil'](_0xefc1e9[_0x5bbd18])||_['isNil'](_0xefc1e9[_0x5bbd18][_0x034c('0x14c')])||_['isNil'](_0xefc1e9[_0x5bbd18][_0x034c('0x14c')]['phone'])){_0x4f6475['emptyContact'](_0x034c('0x1da'),_0x4ff775,_0xefc1e9[_0x5bbd18]);}else{_0x4f6475[_0x034c('0xb9')](_['pick'](_0xefc1e9[_0x5bbd18],[_0x034c('0xcf'),_0x034c('0x1db')]))[_0x034c('0xb6')](_0x4f6475[_0x034c('0x1c1')](_0x4ff775,_0xefc1e9[_0x5bbd18]))['catch'](_0x4f6475[_0x034c('0xc9')]('[actionOriginateIvr]\x20',_0x4ff775));}}}})[_0x034c('0xae')](loggerGetContactDialer('[getContactCampaign2]',_0x4ff775,_0x367c9a));}};Dialer[_0x034c('0x1a')][_0x034c('0x13b')]=function(_0x44fbf8,_0x3bd56a){var _0x3cd14e=this;var _0x556c56=[];var _0x25138f=_0x3bd56a>=0x1?_0x3bd56a:0x1;var _0x5273a1=[];if(_0x44fbf8[_0x034c('0x54')]==='booked'){_0x25138f=0x1;}var _0x195e0c=Math[_0x034c('0x1a2')](_0x44fbf8[_0x034c('0x4c')]*_0x25138f)-_0x44fbf8['originated']-_0x44fbf8[_0x034c('0x1d5')];emitVoiceQueueSummary(_0x44fbf8);if(_0x44fbf8[_0x034c('0x1dc')]>0x0){var _0x570638=_0x44fbf8[_0x034c('0x1dc')]-_0x44fbf8[_0x034c('0x69')]-_0x44fbf8[_0x034c('0x50')]-_0x44fbf8[_0x034c('0x1d5')]-_0x44fbf8[_0x034c('0x9f')];if(_0x195e0c>_0x570638){_0x195e0c=_0x570638;}}if(_0x195e0c>0x0){if(_0x44fbf8[_0x034c('0x54')]===_0x034c('0x6')){_0x195e0c=0x1;}if(_0x195e0c>this['maxNumberOriginate']){_0x195e0c=this[_0x034c('0x24')];}_0x44fbf8[_0x034c('0x1d5')]+=_0x195e0c;for(var _0x606fcf in this['agents']){if(this['agents'][_0x034c('0xab')](_0x606fcf)){if(this[_0x034c('0x22')][_0x606fcf][_0x034c('0xe0')]==='not_inuse'&&this[_0x034c('0x22')][_0x606fcf][_0x034c('0xad')]==='reachable'){_0x556c56['push'](this[_0x034c('0x22')][_0x606fcf]['id']);}}}this[_0x034c('0xbf')](_0x44fbf8['id'],_0x556c56,_0x195e0c,_0x44fbf8[_0x034c('0x1d6')])[_0x034c('0xb6')](function(_0x3c252f){_0x44fbf8['temp']-=_0x195e0c;_0x44fbf8['temp']=_0x44fbf8['temp']>0x0?_0x44fbf8[_0x034c('0x1d5')]:0x0;if(!checkContactEmpty(_0x3c252f)){_0x3cd14e[_0x034c('0xb4')](_0x44fbf8)[_0x034c('0xb6')](sendMessageReschedule(_0x44fbf8))['catch'](loggerCatch(_0x034c('0xb7')));}else{_0x44fbf8['originated']+=_0x3c252f[_0x034c('0x97')];_0x44fbf8[_0x034c('0x3a')]=_0x44fbf8['dialMethod']==='booked'?_0x034c('0x155'):_0x034c('0x1d8');for(var _0x5433ea=0x0;_0x5433ea<_0x3c252f[_0x034c('0x97')];_0x5433ea+=0x1){if(_[_0x034c('0xd8')](_0x3c252f[_0x5433ea])||_[_0x034c('0xd8')](_0x3c252f[_0x5433ea][_0x034c('0x14c')])||_['isNil'](_0x3c252f[_0x5433ea][_0x034c('0x14c')]['phone'])){_0x3cd14e['emptyContact'](_0x034c('0x1da'),_0x44fbf8,_0x3c252f[_0x5433ea]);}else{_0x3cd14e[_0x034c('0xb8')](_[_0x034c('0xcc')](_0x3c252f[_0x5433ea],['VoiceQueueId','Contact.phone']))[_0x034c('0xb6')](_0x3cd14e[_0x034c('0x1c1')](_0x44fbf8,_0x3c252f[_0x5433ea]))[_0x034c('0xae')](_0x3cd14e[_0x034c('0xc9')]('[actionOriginate]\x20',_0x44fbf8));}}}})[_0x034c('0xae')](loggerGetContactDialer(_0x034c('0x1dd'),_0x44fbf8,_0x195e0c));}};Dialer[_0x034c('0x1a')][_0x034c('0x8f')]=function(_0x3b6f83){var _0x53612e=this;if(_0x3b6f83[_0x034c('0x1dc')]>0x0){var _0x47e095=_0x3b6f83[_0x034c('0x1dc')]-_0x3b6f83[_0x034c('0x69')]-_0x3b6f83[_0x034c('0x50')];if(_0x47e095>0x0){this[_0x034c('0x1de')](_0x3b6f83);}else{loggerPredictiveCalls['info'](_0x034c('0x1df'));}}else{this[_0x034c('0x1de')](_0x3b6f83);}};Dialer[_0x034c('0x1a')][_0x034c('0x1de')]=function(_0x89bb13){var _0x42b349=this;var _0x30c11f=[];_0x89bb13['originated']+=0x1;for(var _0x492cf5 in this[_0x034c('0x22')]){if(this[_0x034c('0x22')][_0x034c('0xab')](_0x492cf5)){if(this['agents'][_0x492cf5][_0x034c('0xe0')]===_0x034c('0x1e0')&&this[_0x034c('0x22')][_0x492cf5]['status']==='reachable'){_0x30c11f[_0x034c('0x10c')](this[_0x034c('0x22')][_0x492cf5]['id']);}}}this[_0x034c('0xbf')](_0x89bb13['id'],_0x30c11f,0x1,_0x89bb13[_0x034c('0x1d6')])[_0x034c('0xb6')](function(_0x5df3e5){if(!checkContactEmpty(_0x5df3e5)){checkContactLowerLimitOriginate(_0x89bb13,0x1,0x0);_0x42b349[_0x034c('0xb4')](_0x89bb13)[_0x034c('0xb6')](sendMessageReschedule(_0x89bb13))['catch'](loggerCatch(_0x034c('0xb7')));}else{_0x89bb13[_0x034c('0x3a')]=_0x034c('0x1d8');if(_[_0x034c('0xd8')](_0x5df3e5[0x0])||_[_0x034c('0xd8')](_0x5df3e5[0x0][_0x034c('0x14c')])||_['isNil'](_0x5df3e5[0x0]['Contact'][_0x034c('0x14d')])){_0x42b349['emptyContact'](_0x034c('0x1da'),_0x89bb13,_0x5df3e5[0x0]);}else{_0x42b349[_0x034c('0xb8')](_[_0x034c('0xcc')](_0x5df3e5[0x0],['VoiceQueueId',_0x034c('0x1db')]))[_0x034c('0xb6')](_0x42b349['checkContactBlack'](_0x89bb13,_0x5df3e5[0x0]))['catch'](_0x42b349[_0x034c('0xc9')](_0x034c('0x1e1'),_0x89bb13));}}})[_0x034c('0xae')](loggerGetContactDialer('[getContactDialerPredictive]',_0x89bb13,0x1));emitVoiceQueueSummary(_0x89bb13);};Dialer[_0x034c('0x1a')][_0x034c('0x1b6')]=function(_0x275952,_0x4cf905,_0x32e7a0,_0xef867b,_0x5f23a8,_0x306027){loggerPredictive[_0x034c('0x7b')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x034c('0x7b')]('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',_0x275952);loggerPredictive[_0x034c('0x7b')](_0x034c('0x1e2'),_0x4cf905);loggerPredictive['info'](_0x034c('0x1e3'),_0x32e7a0);loggerPredictive[_0x034c('0x7b')](_0x034c('0x1e4'),_0xef867b);loggerPredictive[_0x034c('0x7b')](_0x034c('0x1e5'),_0x5f23a8);loggerPredictive[_0x034c('0x7b')](_0x034c('0x82'));return new BPromise(function(_0x4f92e7,_0x56ff24){if(_0x275952<=0x0||isNaN(_0x275952)){return _0x56ff24(msgResponse(_0x034c('0x1e6'),_0x034c('0x45'),'m\x20=\x20'+_0x275952));}if(_0x32e7a0<=0x0||isNaN(_0x32e7a0)){return _0x56ff24(msgResponse(_0x034c('0x1e6'),_0x034c('0x45'),_0x034c('0x1e7')+_0x32e7a0));}if(_0xef867b<=0x0||isNaN(_0xef867b)){return _0x56ff24(msgResponse(_0x034c('0x1e6'),_0x034c('0x45'),'p\x20=\x20'+_0xef867b));}if(_0x4cf905<=0x0||isNaN(_0x4cf905)){return _0x56ff24(msgResponse(_0x034c('0x1e6'),_0x034c('0x45'),_0x034c('0x1e8')+_0x4cf905));}if(_0x5f23a8<=0x0||isNaN(_0x5f23a8)){return _0x56ff24(msgResponse(_0x034c('0x1e6'),'Error',_0x034c('0x1e9')+_0x5f23a8));}_0x306027=_0x306027||0x0;var _0x37cbbb=0x1/_0x32e7a0;var _0x252678=0x0;var _0x2bcf96=0x0;var _0x1d4cf7=0x0;var _0x4e6cee=0x0;for(var _0x55f28d=0x0;_0x1d4cf7<_0x5f23a8;_0x55f28d+=0x1){_0x2bcf96=_0x55f28d/_0x4cf905;_0x252678=(_0xef867b*_0x2bcf96+_0x306027)/_0x37cbbb;_0x1d4cf7=erlangb(_0x252678,_0x275952);_0x4e6cee=_0x252678/_0x275952*(0x1-erlangb(_0x252678,_0x275952));}return _0x4f92e7({'erlangCalls':_0x55f28d,'erlangCallToSecond':_0x4cf905/_0x55f28d,'erlangAbandonmentRate':_0x1d4cf7,'erlangBusyFactor':_0x4e6cee});});};Dialer[_0x034c('0x1a')][_0x034c('0x1b8')]=function(_0x16086b,_0x1e2c48,_0x12511e,_0x2bf347,_0x1baf2a,_0x30100b){loggerPredictive[_0x034c('0x7b')](_0x034c('0x1ea'));loggerPredictive[_0x034c('0x7b')]('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',_0x16086b);loggerPredictive[_0x034c('0x7b')](_0x034c('0x1e2'),_0x1e2c48);loggerPredictive[_0x034c('0x7b')](_0x034c('0x1e3'),_0x12511e);loggerPredictive[_0x034c('0x7b')]('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',_0x2bf347);loggerPredictive['info'](_0x034c('0x1eb'),_0x1baf2a);loggerPredictive[_0x034c('0x7b')]('---------------------------');return new BPromise(function(_0x4ed6a,_0x5936f5){if(_0x16086b<=0x0||isNaN(_0x16086b)){return _0x5936f5(msgResponse(_0x034c('0x1ec'),_0x034c('0x45'),_0x034c('0x1ed')+_0x16086b));}if(_0x12511e<=0x0||isNaN(_0x12511e)){return _0x5936f5(msgResponse(_0x034c('0x1ec'),_0x034c('0x45'),_0x034c('0x1e7')+_0x12511e));}if(_0x2bf347<=0x0||isNaN(_0x2bf347)){return _0x5936f5(msgResponse(_0x034c('0x1ec'),'Error',_0x034c('0x1ee')+_0x2bf347));}if(_0x1e2c48<=0x0||isNaN(_0x1e2c48)){return _0x5936f5(msgResponse(_0x034c('0x1ec'),_0x034c('0x45'),_0x034c('0x1e8')+_0x1e2c48));}if(_0x1baf2a<=0x0||isNaN(_0x1baf2a)){return _0x5936f5(msgResponse(_0x034c('0x1ec'),_0x034c('0x45'),_0x034c('0x1ef')+_0x1baf2a));}_0x30100b=_0x30100b||0x0;var _0x180495=0x1/_0x12511e;var _0x464022=0x0;var _0xa39a6d=0x0;var _0xdb19b3=0x0;var _0x4e17f5=0x0;for(var _0x4fa2b8=0x0;_0x4e17f5<_0x1baf2a;_0x4fa2b8+=0x1){_0xa39a6d=_0x4fa2b8/_0x1e2c48;_0x464022=(_0x2bf347*_0xa39a6d+_0x30100b)/_0x180495;_0xdb19b3=erlangb(_0x464022,_0x16086b);_0x4e17f5=_0x464022/_0x16086b*(0x1-erlangb(_0x464022,_0x16086b));}return _0x4ed6a({'erlangCalls':_0x4fa2b8,'erlangCallToSecond':_0x1e2c48/_0x4fa2b8,'erlangAbandonmentRate':_0xdb19b3,'erlangBusyFactor':_0x4e17f5});});};module[_0x034c('0x1f0')]=Dialer; \ No newline at end of file +var _0xe24b=['NOT_ACTIVE','\x20NOT\x20Active','\x20INTERVAL_IS_NULL','Interval','Intervals','INTERVAL_IS_NULL','Error','stringify','milliseconds','diff','seconds','emit','type','outbound','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','waiting','loggedInDb','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','Trunk','callerid','format','voice:queue:%s','ivr','campaign:ivr:%s','campaign:save','isEmpty','info','-----\x20Stats\x20Predictive\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','isUndefined','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22\x22\x20<>','inspect','error','stack','length','hasOwnProperty','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','[uniqueid]','[actions]','prototype','clearZombieChannels','enqueue','Action','channel','catch','No\x20such\x20channel','queue','[Dialer][checkChannel]','updateOriginated','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','notFound','saveInDb','merge','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact]','isSuccess','isTrunkReachable','active','status','reachable','SIP/%s','unmonitored','uniqueid','isNil','variable','xcally-motion-dialer','dialAMDActive','value','HangupInAMD','membername','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','AMD','amd','[syncMachine][createHistory]','[syncMachine]','HANGUP','[syncHangupInAMDIvr]','Machine','[syncMachineIvr][createHistory]','[syncMachineIvr]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','dialQueueProject','AnswerAGI','AGI','cause-txt','[syncHangupIvr]','agent','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','droptime','YYYY-MM-DD\x20HH:mm:ss','responsetime','dialQueueTimeout','Drop','TIMEOUT','Abandoned','dropreason','CALLEREXIT','actionid','locked','paused','stateinterface','queueBooked','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','pick','run','ContactId','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','checkIfTime','ifTime','checkIfTimeIntervals','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','Failure','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','iftime\x20%s,%s','interval','indexOf','true','command','content','all','some','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialActive','dialGlobalInterval','dialTimezone','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','pow','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','ACTIVE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','createdAt','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','substring','dialCutDigit','trim','from-sip','[originateError]:\x20%s','OriginateError','starttime','originate\x20action\x20Error','getQueue','callProgressDetecting','checkRetriveMax','countcongestionretry','countnoanswerretry','dialGlobalMaxRetry','dialNoAnswerMaxRetry','add','dialNoAnswerRetryFrequency','minutes','[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','reason','[syncAgentComplete][createHistory][0]','countbusyretry','reason\x200\x20no\x20such\x20number....','createStateFinal','NoAnswer','countglobal','[syncAgentComplete][createHistory][3]','stateGlobal','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','[syncAgentComplete][createHistory][5]','dialBusyMaxRetry','reason\x205\x20busy','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','[syncAgentComplete][createHistory][?]','Global','Success','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','outboundDropCallsDayTimeout','round','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','dialPredictiveInterval','started\x20in\x20predictive\x20at','averageHandleTime','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','inBlackList','temp','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','Contact.phone','loggerHandler','[actionOriginateIvr]\x20','dialLimitQueue','not_inuse','tryOriginatePredictive','[actionOriginate]\x20','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','util','lodash','bluebird','uuid','md5','../../../config/environment/','dialer','booked','../../../config/logger','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','rrmemory','roundrobin','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBookedRR','agentconnect','syncAgentConnect','queuecallerabandon','syncQueueCallerAbandon','bind','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','message','AGENTS_NOT_LOGGED','name'];(function(_0x20dd1c,_0x6f04cf){var _0x2cc729=function(_0x607fef){while(--_0x607fef){_0x20dd1c['push'](_0x20dd1c['shift']());}};_0x2cc729(++_0x6f04cf);}(_0xe24b,0x1bf));var _0xbe24=function(_0x2a0fc4,_0x2eaf74){_0x2a0fc4=_0x2a0fc4-0x0;var _0x531d00=_0xe24b[_0x2a0fc4];return _0x531d00;};'use strict';var util=require(_0xbe24('0x0'));var _=require(_0xbe24('0x1'));var BPromise=require(_0xbe24('0x2'));var uuid=require(_0xbe24('0x3'));var moment=require('moment');var rr=require('rr');var md5=require(_0xbe24('0x4'));var Redis=require('ioredis');var config=require(_0xbe24('0x5'));var logger=require('../../../config/logger')(_0xbe24('0x6'));var loggerBooked=require('../../../config/logger')(_0xbe24('0x7'));var loggerPredictive=require(_0xbe24('0x8'))(_0xbe24('0x9'));var loggerPredictiveCalls=require('../../../config/logger')(_0xbe24('0xa'));var loggerSyncQueueSummary=require(_0xbe24('0x8'))(_0xbe24('0xb'));var ami=require(_0xbe24('0xc'));config[_0xbe24('0xd')]=_[_0xbe24('0xe')](config[_0xbe24('0xd')],{'host':_0xbe24('0xf'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xbe24('0xd')]));var cmHopper=require(_0xbe24('0x10'));var cmHopperFinal=require(_0xbe24('0x11'));var cmHopperHistory=require(_0xbe24('0x12'));var cmHopperBlack=require(_0xbe24('0x13'));var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require(_0xbe24('0x14'));var History=require(_0xbe24('0x15'));var Final=require(_0xbe24('0x16'));var AgentComplete=require(_0xbe24('0x17'));var QueueCallerAbandon=require(_0xbe24('0x18'));var Hangup=require(_0xbe24('0x19'));var ipAgi=process[_0xbe24('0x1a')][_0xbe24('0x1b')]||'127.0.0.1';var strategy={'rrmemory':_0xbe24('0x1c'),'roundrobin':_0xbe24('0x1d')};var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x5bd861){this[_0xbe24('0x1e')]=this[_0xbe24('0x1e')]?this['tail'][_0xbe24('0x1f')](_0x5bd861):_0x5bd861();};function Dialer(_0x17b2d0,_0x4fc065){this[_0xbe24('0x20')]=new Sequence();this[_0xbe24('0x21')]=_0x4fc065;this[_0xbe24('0x22')]=_0x17b2d0['voiceQueues'];this[_0xbe24('0x23')]=_0x17b2d0['campaigns'];this[_0xbe24('0x24')]=_0x17b2d0['agents'];this[_0xbe24('0x25')]=_0x17b2d0[_0xbe24('0x25')];this[_0xbe24('0x26')]=config[_0xbe24('0x26')]||0x2;this['channels']={};this[_0xbe24('0x27')]={};this[_0xbe24('0x28')]={};this[_0xbe24('0x29')]={};this[_0xbe24('0x2a')]={};this[_0xbe24('0x2b')]={};this[_0xbe24('0x2c')]={};this[_0xbe24('0x2d')]={};this['queueBooked']={};this[_0xbe24('0x2e')]={};ami['on'](_0xbe24('0x2f'),this[_0xbe24('0x30')]['bind'](this));ami['on'](_0xbe24('0x31'),this[_0xbe24('0x32')][_0xbe24('0x33')](this));ami['on'](_0xbe24('0x34'),this[_0xbe24('0x35')][_0xbe24('0x33')](this));ami['on'](_0xbe24('0x36'),this[_0xbe24('0x37')][_0xbe24('0x33')](this));ami['on'](_0xbe24('0x38'),this[_0xbe24('0xb')][_0xbe24('0x33')](this));ami['on'](_0xbe24('0x39'),this[_0xbe24('0x3a')][_0xbe24('0x33')](this));ami['on']('newexten',this[_0xbe24('0x3b')]['bind'](this));ami['on'](_0xbe24('0x3c'),this[_0xbe24('0x3d')][_0xbe24('0x33')](this));ami['on'](_0xbe24('0x3e'),this[_0xbe24('0x3f')][_0xbe24('0x33')](this));ami['on'](_0xbe24('0x40'),this[_0xbe24('0x41')]['bind'](this));this[_0xbe24('0x42')]();this[_0xbe24('0x43')]();}function isNotNull(_0xcda5b8){return _0xcda5b8!==null&&!_['isUndefined'](_0xcda5b8);}function checkIsLoggedIn(_0x2e671a,_0x335812){return function(){if(_0x335812<=0x0){_0x2e671a[_0xbe24('0x44')]=_0xbe24('0x45');throw _0x2e671a[_0xbe24('0x46')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x1ba7e4){return _0x1ba7e4;}function checkIsActive(_0x2adfe8,_0x1cad30){return function(){if(!isActive(_0x1cad30)){_0x2adfe8[_0xbe24('0x44')]=_0xbe24('0x47');throw _0x2adfe8['name']+_0xbe24('0x48');}};}function checkInterval(_0x2d3844){return function(){if(!isNotNull(_0x2d3844['Interval'])){_0x2d3844[_0xbe24('0x44')]='INTERVAL_IS_NULL';throw _0x2d3844[_0xbe24('0x46')]+_0xbe24('0x49');}if(!isNotNull(_0x2d3844[_0xbe24('0x4a')][_0xbe24('0x4b')])){_0x2d3844[_0xbe24('0x44')]=_0xbe24('0x4c');throw _0x2d3844['name']+_0xbe24('0x49');}if(!isNotNull(_['isEmpty'](_0x2d3844[_0xbe24('0x4a')][_0xbe24('0x4b')]))){_0x2d3844[_0xbe24('0x44')]=_0xbe24('0x4c');throw _0x2d3844['name']+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0xbac2f4,_0x54f341,_0x2139c6){return{'action':_0xbac2f4,'response':_0x54f341,'message':_0x2139c6,'stack':_0x2139c6};}function myreject(_0x205ea2){return function(_0x56af8f){return _0x205ea2(msgResponse('[ifTime][Action]',_0xbe24('0x4d'),JSON[_0xbe24('0x4e')](_0x56af8f)));};}function getSeconds(_0x1e5e4e,_0x4f5e36){var _0x490a3c=moment(_0x1e5e4e)[_0xbe24('0x4f')](0x0);var _0x5c5213=moment(_0x4f5e36)[_0xbe24('0x4f')](0x0);return _0x490a3c[_0xbe24('0x50')](_0x5c5213,_0xbe24('0x51'));}function emit(_0x11091f,_0x385a83,_0x1e4c01){io['to'](_0x11091f)[_0xbe24('0x52')](_0x385a83,_0x1e4c01);}function emitVoiceQueueSummary(_0x4d160f){if(_0x4d160f[_0xbe24('0x53')]===_0xbe24('0x54')){var _0x2d770d={'id':_0x4d160f['id'],'name':_0x4d160f['name'],'strategy':_0x4d160f[_0xbe24('0x55')],'answered':_0x4d160f['answered'],'available':_0x4d160f[_0xbe24('0x56')],'loggedIn':_0x4d160f[_0xbe24('0x57')],'pTalking':_0x4d160f[_0xbe24('0x58')],'sumBillable':_0x4d160f[_0xbe24('0x59')],'sumDuration':_0x4d160f[_0xbe24('0x5a')],'sumHoldTime':_0x4d160f[_0xbe24('0x5b')]||0x0,'talking':_0x4d160f[_0xbe24('0x5c')],'total':_0x4d160f[_0xbe24('0x5d')],'type':_0x4d160f['type'],'unmanaged':_0x4d160f[_0xbe24('0x5e')],'abandoned':_0x4d160f['abandoned'],'waiting':_0x4d160f[_0xbe24('0x5f')],'loggedInDb':_0x4d160f[_0xbe24('0x60')],'dialActive':_0x4d160f['dialActive'],'dialMethod':_0x4d160f[_0xbe24('0x61')],'dialOriginateCallerIdName':_0x4d160f['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x4d160f[_0xbe24('0x62')],'dialOriginateTimeout':_0x4d160f[_0xbe24('0x63')],'dialPrefix':_0x4d160f[_0xbe24('0x64')],'outboundAnswerAgiCallsDay':_0x4d160f[_0xbe24('0x65')],'outboundAnswerCallsDay':_0x4d160f[_0xbe24('0x66')],'outboundBlacklistCallsDay':_0x4d160f[_0xbe24('0x67')],'outboundBusyCallsDay':_0x4d160f['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x4d160f[_0xbe24('0x68')],'outboundDropCallsDayACS':_0x4d160f['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x4d160f[_0xbe24('0x69')],'outboundDropCallsDayTimeout':_0x4d160f['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x4d160f[_0xbe24('0x6a')],'outboundNoSuchCallsDay':_0x4d160f[_0xbe24('0x6b')],'outboundOriginateFailureCallsDay':_0x4d160f[_0xbe24('0x6c')],'outboundReCallsDay':_0x4d160f[_0xbe24('0x6d')],'outboundRejectCallsDay':_0x4d160f[_0xbe24('0x6e')],'outboundUnknownCallsDay':_0x4d160f[_0xbe24('0x6f')],'predictiveIntervalAnsweredCalls':_0x4d160f[_0xbe24('0x70')],'predictiveIntervalAvgHoldtime':_0x4d160f[_0xbe24('0x71')],'predictiveIntervalAvgTalktime':_0x4d160f[_0xbe24('0x72')],'predictiveIntervalDroppedCallsCallersExit':_0x4d160f[_0xbe24('0x73')],'predictiveIntervalDroppedCallsTimeout':_0x4d160f[_0xbe24('0x74')],'predictiveIntervalErlangCalls':_0x4d160f[_0xbe24('0x75')],'predictiveIntervalErlangCallsDroppedCalls':_0x4d160f[_0xbe24('0x76')],'predictiveIntervalHitRate':_0x4d160f['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x4d160f[_0xbe24('0x77')],'predictiveIntervalPauses':_0x4d160f[_0xbe24('0x78')],'predictiveIntervalAvailable':_0x4d160f[_0xbe24('0x79')],'predictiveIntervalTotalCalls':_0x4d160f[_0xbe24('0x7a')],'message':_0x4d160f['message'],'originated':_0x4d160f[_0xbe24('0x7b')],'erlangCalls':_0x4d160f[_0xbe24('0x7c')],'erlangCallToSecond':_0x4d160f['erlangCallToSecond'],'erlangAbandonmentRate':_0x4d160f[_0xbe24('0x7d')],'erlangBusyFactor':_0x4d160f[_0xbe24('0x7e')],'startPredictive':_0x4d160f[_0xbe24('0x2b')],'startProgressive':_0x4d160f[_0xbe24('0x2c')]};if(_0x4d160f['Trunk']){_0x2d770d[_0xbe24('0x7f')]={'id':_0x4d160f[_0xbe24('0x7f')]['id'],'name':_0x4d160f[_0xbe24('0x7f')]['name'],'active':_0x4d160f[_0xbe24('0x7f')]['active'],'callerid':_0x4d160f['Trunk'][_0xbe24('0x80')]};}if(_0x4d160f[_0xbe24('0x4a')]){_0x2d770d[_0xbe24('0x4a')]={'id':_0x4d160f[_0xbe24('0x4a')]['id'],'name':_0x4d160f[_0xbe24('0x4a')][_0xbe24('0x46')]};}var _0x3f8ac6=md5(JSON[_0xbe24('0x4e')](_0x2d770d));if(_0x4d160f[_0xbe24('0x4')]!==_0x3f8ac6){_0x4d160f['md5']=_0x3f8ac6;emit(util[_0xbe24('0x81')](_0xbe24('0x82'),_0x2d770d[_0xbe24('0x46')]),'voice_queue:save',_0x2d770d);}}}function emitCampaignSummary(_0x1b9e49){if(_0x1b9e49[_0xbe24('0x53')]===_0xbe24('0x83')){emit(util['format'](_0xbe24('0x84'),_0x1b9e49['name']),_0xbe24('0x85'),_0x1b9e49);}}function checkGetDataPredictive(_0x34b043){if(isNotNull(_0x34b043)){if(!_[_0xbe24('0x86')](_0x34b043)){loggerPredictive[_0xbe24('0x87')](_0xbe24('0x88'));loggerPredictive[_0xbe24('0x87')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x34b043[_0xbe24('0x7a')]);loggerPredictive[_0xbe24('0x87')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x34b043[_0xbe24('0x70')]);loggerPredictive[_0xbe24('0x87')](_0xbe24('0x89'),_0x34b043[_0xbe24('0x74')]);loggerPredictive[_0xbe24('0x87')](_0xbe24('0x8a'),_0x34b043[_0xbe24('0x73')]);loggerPredictive['info'](_0xbe24('0x8b'),_0x34b043[_0xbe24('0x71')]);loggerPredictive[_0xbe24('0x87')](_0xbe24('0x8c'),_0x34b043['predictiveIntervalAvgTalktime']);loggerPredictive[_0xbe24('0x87')]('---------------------------');if(_0x34b043[_0xbe24('0x7a')]>0x0){if(!_[_0xbe24('0x8d')](_0x34b043[_0xbe24('0x72')])&&_0x34b043['predictiveIntervalAvgTalktime']>0x0){return!![];}else{loggerPredictive[_0xbe24('0x87')](_0xbe24('0x8e'));}if(!_[_0xbe24('0x8d')](_0x34b043[_0xbe24('0x71')])&&_0x34b043[_0xbe24('0x71')]>0x0){return!![];}else{loggerPredictive[_0xbe24('0x87')](_0xbe24('0x8f'));}}else{loggerPredictive[_0xbe24('0x87')](_0xbe24('0x90'));}}else{loggerPredictive['info'](_0xbe24('0x91'));}}else{loggerPredictive[_0xbe24('0x87')](_0xbe24('0x91'));}return![];}function mergeDataErlangB(_0x5019b1){return function(_0x48e807){loggerPredictive[_0xbe24('0x87')](_0xbe24('0x92'));loggerPredictive[_0xbe24('0x87')](_0xbe24('0x93'),_0x48e807[_0xbe24('0x7c')]);loggerPredictive[_0xbe24('0x87')](_0xbe24('0x94'),_0x48e807['erlangCallToSecond']);loggerPredictive[_0xbe24('0x87')](_0xbe24('0x95'),_0x48e807['erlangAbandonmentRate']);loggerPredictive[_0xbe24('0x87')](_0xbe24('0x96'),_0x48e807[_0xbe24('0x7e')]);loggerPredictive['info'](_0xbe24('0x95'),_0x48e807[_0xbe24('0x7d')]);loggerPredictive[_0xbe24('0x87')](_0xbe24('0x97'));_['merge'](_0x5019b1,_0x48e807);};}function getDiff(_0x5bfed1){var _0x7aa491=moment()['milliseconds'](0x0);var _0x2e0b40=moment(_0x5bfed1)[_0xbe24('0x4f')](0x0);return _0x7aa491[_0xbe24('0x50')](_0x2e0b40,_0xbe24('0x51'));}function ifInterval(_0x1ff29a,_0x5c38bf){if(_[_0xbe24('0x8d')](_0x5c38bf)){return![];}if(getDiff(_0x5c38bf)<_0x1ff29a*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x324b0b){if(isNotNull(_0x324b0b)){if(!_['isUndefined'](_0x324b0b[_0xbe24('0x2c')])){_0x324b0b[_0xbe24('0x2c')]=undefined;loggerPredictive[_0xbe24('0x87')](_0x324b0b[_0xbe24('0x46')],_0xbe24('0x98'));}if(!_['isUndefined'](_0x324b0b[_0xbe24('0x2b')])){_0x324b0b[_0xbe24('0x2b')]=undefined;loggerPredictive[_0xbe24('0x87')](_0x324b0b['name'],_0xbe24('0x99'));}if(!_[_0xbe24('0x8d')](_0x324b0b['handlePredictive'])){clearInterval(_0x324b0b['handlePredictive']);_0x324b0b[_0xbe24('0x9a')]=undefined;loggerPredictive[_0xbe24('0x87')](_0x324b0b[_0xbe24('0x46')],_0xbe24('0x9b'));}}}function erlangb(_0x3f327b,_0x4fe9f3){if(_0x4fe9f3===0x0){return 0x0;}var _0x35f9d5=0x1;for(var _0x1326df=0x1;_0x1326df<=_0x4fe9f3;_0x1326df+=0x1){_0x35f9d5=0x1+_0x35f9d5*_0x1326df/_0x3f327b;}return 0x1/_0x35f9d5;}function isVoiceQueueOutbound(_0x49cfdf){return _0x49cfdf===_0xbe24('0x54');}function isNotPreview(_0x4528a2){return _0x4528a2!==_0xbe24('0x21');}function isCampaignIvr(_0x4607d2){return _0x4607d2===_0xbe24('0x83');}function getCallerId(_0x292d46,_0x296384,_0x2defc2){if(!_['isUndefined'](_0x2defc2)&&_0xbe24('0x9c')===typeof _0x2defc2&&!_[_0xbe24('0x86')](_0x2defc2)){if(!_[_0xbe24('0x8d')](_0x296384)&&_0xbe24('0x9c')===typeof _0x296384&&!_[_0xbe24('0x86')](_0x296384)){return util[_0xbe24('0x81')]('\x22%s\x22\x20<%s>',_0x296384,_0x2defc2);}return util[_0xbe24('0x81')]('\x22%s\x22\x20<%s>',_0x2defc2,_0x2defc2);}if(!_[_0xbe24('0x8d')](_0x292d46)&&_0xbe24('0x9c')===typeof _0x292d46&&!_['isEmpty'](_0x292d46)){return _0x292d46;}return _0xbe24('0x9d');}function loggerCatchQueueSummary(_0x15f262,_0x3df584){return function(_0x4088ec){freeVariablesPredictive(_0x3df584);emitVoiceQueueSummary(_0x3df584);emitCampaignSummary(_0x3df584);loggerSyncQueueSummary['error'](_0x15f262,util[_0xbe24('0x9e')](_0x4088ec,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x56c372,_0x42c95f){return function(_0x2afb00){loggerPredictive[_0xbe24('0x9f')](_0x42c95f['name'],_0x56c372);loggerPredictive['error'](_0x2afb00[_0xbe24('0xa0')]);freeVariablesPredictive(_0x42c95f);};}function loggerCatch(_0x196da7){return function(_0x164a63){logger['error'](_0x196da7,util[_0xbe24('0x9e')](_0x164a63,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x428df1){return _0x428df1&&!_[_0xbe24('0x8d')](_0x428df1)&&_0x428df1[_0xbe24('0xa1')]>0x0;}function decremetOriginate(_0x4505b7){if(!_[_0xbe24('0x8d')](_0x4505b7)&&_0x4505b7!==null){if(_0x4505b7[_0xbe24('0xa2')](_0xbe24('0x7b'))){if(_0x4505b7[_0xbe24('0x7b')]>0x0){_0x4505b7[_0xbe24('0x7b')]-=0x1;}else{logger['error'](_0xbe24('0xa3'));}}}else{logger['error'](_0xbe24('0xa4'));}}function checkContactLowerLimitOriginate(_0x18a9e2,_0x18524e,_0xeb432b){if(_0x18524e>_0xeb432b){for(var _0x421606=0x0;_0x421606<_0x18524e-_0xeb432b;_0x421606+=0x1){decremetOriginate(_0x18a9e2);}}}function loggerGetContactDialer(_0x24fb59,_0x43f283,_0xc38afe){return function(_0x40a1a4){checkContactLowerLimitOriginate(_0x43f283,_0xc38afe,0x0);logger[_0xbe24('0x9f')](_0x24fb59,util['inspect'](_0x40a1a4,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x4e4d4c){return function(_0xc9e545){if(isNotNull(_0xc9e545)&&isNotNull(_0xc9e545[0x0])){if(_0xc9e545[0x0][_0xbe24('0xa5')]>0x0){_0x4e4d4c[_0xbe24('0x44')]=_0xbe24('0xa6');logger['info'](_0xbe24('0xa7')+_0x4e4d4c['name'],_0xc9e545[0x0][_0xbe24('0xa5')],_0xbe24('0xa8'));}else{_0x4e4d4c[_0xbe24('0x44')]=_0xbe24('0xa9');logger[_0xbe24('0x87')](_0xbe24('0xaa')+_0x4e4d4c[_0xbe24('0x46')]);}}};}function notSendMessagesQueue(_0x4827c2){if(_0x4827c2[_0xbe24('0xab')]){freeVariablesPredictive(_0x4827c2);if(_0x4827c2[_0xbe24('0x7b')]===0x0&&_0x4827c2[_0xbe24('0x5c')]===0x0&&_0x4827c2[_0xbe24('0x5f')]===0x0&&(_0x4827c2[_0xbe24('0x58')]||0x0)===0x0){_0x4827c2[_0xbe24('0xab')]=![];_0x4827c2[_0xbe24('0x56')]=0x0;_0x4827c2[_0xbe24('0x44')]=_0xbe24('0x47');loggerSyncQueueSummary['error'](_0xbe24('0xac'),_0x4827c2[_0xbe24('0x46')],_0xbe24('0xad'));}else{_0x4827c2['message']=_0xbe24('0xae');loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x4827c2[_0xbe24('0x46')],_0xbe24('0xaf'));}emitVoiceQueueSummary(_0x4827c2);}}function notSendMessagesCampaign(_0x3d6eeb){if(_0x3d6eeb[_0xbe24('0xab')]){if(_0x3d6eeb[_0xbe24('0x7b')]===0x0){_0x3d6eeb['sendMessageOneNotActive']=![];_0x3d6eeb[_0xbe24('0x44')]=_0xbe24('0x47');loggerSyncQueueSummary[_0xbe24('0x9f')](_0xbe24('0xb0'),_0x3d6eeb[_0xbe24('0x46')],_0xbe24('0xad'));}else{_0x3d6eeb[_0xbe24('0x44')]=_0xbe24('0xae');loggerSyncQueueSummary[_0xbe24('0x9f')](_0xbe24('0xb0'),_0x3d6eeb[_0xbe24('0x46')],_0xbe24('0xaf'));}emitCampaignSummary(_0x3d6eeb);}}function createObjHistory(_0x2947d5,_0x560029,_0x1379ba,_0x3b340a,_0x4d5b19){_0x2947d5['message']=_0x1379ba;var _0x28c479=new Action(_0x2947d5,_0x560029);var _0x2c8006=new History(_0x28c479);_0x2c8006[_0xbe24('0xb1')]=_0x3b340a;_0x2c8006[_0xbe24('0xb2')]=_0x4d5b19;_0x2c8006[_0xbe24('0xb3')]=_0x28c479['starttime'];return _0x2c8006;}Dialer['prototype'][_0xbe24('0x43')]=function(){var _0x8ec65d=this;setInterval(function(){_0x8ec65d['clearZombieChannels'](_0x8ec65d[_0xbe24('0x29')],_0xbe24('0xb4'));_0x8ec65d['clearZombieChannels'](_0x8ec65d['actions'],_0xbe24('0xb5'));},0x32c8);};Dialer[_0xbe24('0xb6')][_0xbe24('0xb7')]=function(_0x4ecd98,_0x58be6a){var _0x481dfb=this;for(var _0x1458a8 in _0x4ecd98){if(_0x4ecd98[_0xbe24('0xa2')](_0x1458a8)){this[_0xbe24('0x20')][_0xbe24('0xb8')](function(){if(!_['isNil'](_0x4ecd98[_0x1458a8])){return ami[_0xbe24('0xb9')]({'action':'status','channel':_0x4ecd98[_0x1458a8][_0xbe24('0xba')]})[_0xbe24('0xbb')](function(_0x4fc59d){if(_0x4fc59d[_0xbe24('0x44')]===_0xbe24('0xbc')){setTimeout(function(){if(_0x4ecd98[_0x1458a8]&&_0x4ecd98[_0x1458a8][_0xbe24('0x53')]!==_0xbe24('0x83')){_0x481dfb['updateOriginated'](_0x481dfb[_0xbe24('0x22')][_0x4ecd98[_0x1458a8][_0xbe24('0xbd')]]);logger['error'](_0xbe24('0xbe'),_0x58be6a,_0x1458a8,_0x4ecd98[_0x1458a8][_0xbe24('0xbd')]);delete _0x4ecd98[_0x1458a8];}if(_0x4ecd98[_0x1458a8]&&_0x4ecd98[_0x1458a8]['type']==='ivr'){_0x481dfb[_0xbe24('0xbf')](_0x481dfb[_0xbe24('0x23')][_0x4ecd98[_0x1458a8][_0xbe24('0xbd')]]);logger['error'](_0xbe24('0xc0'),_0x58be6a,_0x1458a8,_0x4ecd98[_0x1458a8]['queue']);delete _0x4ecd98[_0x1458a8];}},0x2328);}});}});}}};Dialer[_0xbe24('0xb6')][_0xbe24('0xc1')]=function(_0x26428e){return BPromise[_0xbe24('0xc2')]()[_0xbe24('0xc3')](cmHopper[_0xbe24('0xc1')](_0x26428e))[_0xbe24('0xbb')](loggerCatch(_0xbe24('0xc4')));};Dialer[_0xbe24('0xb6')]['checkIsBlackList']=function(_0x3f58a8){return BPromise[_0xbe24('0xc2')]()['then'](cmHopperBlack[_0xbe24('0xc5')](_0x3f58a8))[_0xbe24('0xbb')](loggerCatch(_0xbe24('0xc6')));};Dialer['prototype'][_0xbe24('0xc7')]=function(_0x542764){return BPromise[_0xbe24('0xc2')]()['then'](cmHopperBlack['checkIsBlackListIvr'](_0x542764))['catch'](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0xbe24('0xb6')]['averageHandleTime']=function(_0x2fc412){return BPromise[_0xbe24('0xc2')]()[_0xbe24('0xc3')](cmHopperHistory['avgHandleTime'](_0x2fc412))[_0xbe24('0xbb')](loggerCatch(_0xbe24('0xc8')));};Dialer[_0xbe24('0xb6')][_0xbe24('0xc9')]=function(_0x4a7628){return BPromise[_0xbe24('0xc2')]()['then'](cmHopper[_0xbe24('0xc9')](_0x4a7628))['catch'](loggerCatch(_0xbe24('0xca')));};Dialer['prototype'][_0xbe24('0xcb')]=function(_0x8f769e,_0x498093,_0x176a05,_0x5af4a5){return BPromise[_0xbe24('0xc2')]()[_0xbe24('0xc3')](cmHopper['getContactDialer'](_0x8f769e,_0x498093,_0x176a05,_0x5af4a5))[_0xbe24('0xbb')](loggerCatch(_0xbe24('0xcc')));};Dialer['prototype'][_0xbe24('0xcd')]=function(_0x58e55d,_0xfbace0,_0x6a6b81){return BPromise['resolve']()['then'](cmHopper['getContactDialerIvr'](_0x58e55d,_0xfbace0,_0x6a6b81))[_0xbe24('0xbb')](loggerCatch(_0xbe24('0xcc')));};Dialer['prototype'][_0xbe24('0xce')]=function(_0x3b1a00){return BPromise[_0xbe24('0xc2')]()[_0xbe24('0xc3')](voiceQueueRt[_0xbe24('0xce')](_0x3b1a00))[_0xbe24('0xbb')](loggerCatch(_0xbe24('0xcf')));};Dialer[_0xbe24('0xb6')]['moveContactManagedDialer']=function(_0x345813){return BPromise[_0xbe24('0xc2')]()[_0xbe24('0xc3')](cmHopper[_0xbe24('0xd0')](_0x345813))[_0xbe24('0xbb')](loggerCatch(_0xbe24('0xd1')));};Dialer[_0xbe24('0xb6')][_0xbe24('0xd2')]=function(_0x28b985){return BPromise[_0xbe24('0xc2')]()[_0xbe24('0xc3')](cmHopperHistory['createHistory'](_0x28b985))[_0xbe24('0xbb')](loggerCatch(_0xbe24('0xd3')));};Dialer[_0xbe24('0xb6')][_0xbe24('0xbf')]=function(_0x3b0167){if(!_[_0xbe24('0x8d')](_0x3b0167)&&_0x3b0167!==null){if(_0x3b0167['hasOwnProperty']('originated')){if(_0x3b0167[_0xbe24('0x7b')]>0x0){_0x3b0167['originated']-=0x1;}else{logger['error'](_0xbe24('0xd4'));}}}else{logger[_0xbe24('0x9f')](_0xbe24('0xd5'));}};Dialer[_0xbe24('0xb6')]['loggerHandler']=function(_0x15bf8c,_0x48570d){var _0x273f13=this;return function(_0x12a3d1){_0x273f13['updateOriginated'](_0x48570d);logger[_0xbe24('0x9f')](_0x15bf8c,util[_0xbe24('0x9e')](_0x12a3d1,{'showHidden':![],'depth':null}));};};Dialer[_0xbe24('0xb6')][_0xbe24('0xd6')]=function(_0x1ba2a2,_0x2da51f,_0x5d66f4){var _0x32ba95={'state':0x19,'statedesc':_0xbe24('0xd7')};this[_0xbe24('0xbf')](_0x2da51f);this[_0xbe24('0xd8')](_[_0xbe24('0xd9')](_0x32ba95,_['pick'](_0x5d66f4,['ContactId',_0xbe24('0xda'),_0xbe24('0xdb'),_0xbe24('0xdc'),_0xbe24('0xdd')])),'[emptyContact][createHistory]',_0xbe24('0xde'));logger[_0xbe24('0x9f')](_0x1ba2a2);};Dialer[_0xbe24('0xb6')][_0xbe24('0xdf')]=function(_0x12d56b){return _0x12d56b==='Success';};Dialer[_0xbe24('0xb6')][_0xbe24('0xe0')]=function(_0x2c2cfe){return!_[_0xbe24('0x8d')](_0x2c2cfe)&&_0x2c2cfe&&!_[_0xbe24('0x8d')](_0x2c2cfe['name'])&&!_[_0xbe24('0x8d')](_0x2c2cfe[_0xbe24('0xe1')])&&_0x2c2cfe[_0xbe24('0xe1')]&&(this[_0xbe24('0x25')][util[_0xbe24('0x81')]('SIP/%s',_0x2c2cfe[_0xbe24('0x46')])][_0xbe24('0xe2')]===_0xbe24('0xe3')||this[_0xbe24('0x25')][util[_0xbe24('0x81')](_0xbe24('0xe4'),_0x2c2cfe['name'])][_0xbe24('0xe2')]===_0xbe24('0xe5'));};Dialer[_0xbe24('0xb6')][_0xbe24('0xd8')]=function(_0x3d6af3,_0x2912bb,_0x54fa3c){this[_0xbe24('0xd2')](_0x3d6af3)[_0xbe24('0xbb')](loggerCatch(_0x2912bb));this['moveContactManagedDialer'](_0x3d6af3)[_0xbe24('0xbb')](loggerCatch(_0x54fa3c));};Dialer[_0xbe24('0xb6')][_0xbe24('0x3d')]=function(_0x1995df){var _0xddcdb1=this[_0xbe24('0x29')][_0x1995df[_0xbe24('0xe6')]];var _0x173c5c;if(!_[_0xbe24('0xe7')](_0x1995df)&&!_[_0xbe24('0xe7')](_0x1995df[_0xbe24('0xe8')])&&!_[_0xbe24('0xe7')](_0x1995df[_0xbe24('0xe8')]['amdstatus'])&&_0x1995df['exten']===_0xbe24('0xe9')&&_0xddcdb1){if(_0xddcdb1['type']!==_0xbe24('0x83')&&this[_0xbe24('0x22')][_0xddcdb1[_0xbe24('0xbd')]][_0xbe24('0xea')]&&_0x1995df[_0xbe24('0xeb')]==='HANGUP'){delete this['uniqueId'][_0x1995df['uniqueid']];this[_0xbe24('0xbf')](this[_0xbe24('0x22')][_0xddcdb1['queue']]);this['voiceQueues'][_0xddcdb1[_0xbe24('0xbd')]][_0xbe24('0x66')]+=0x1;this[_0xbe24('0x22')][_0xddcdb1['queue']][_0xbe24('0x65')]+=0x1;_0x173c5c=new Hangup(_0xddcdb1,_0x1995df);_0x173c5c[_0xbe24('0xb1')]=0x12;_0x173c5c[_0xbe24('0xb2')]=_0xbe24('0xec');_0x173c5c[_0xbe24('0xed')]='AMD';this[_0xbe24('0xd8')](_0x173c5c,_0xbe24('0xee'),_0xbe24('0xef'));}if(_0xddcdb1[_0xbe24('0x53')]!==_0xbe24('0x83')&&this[_0xbe24('0x22')][_0xddcdb1[_0xbe24('0xbd')]][_0xbe24('0xea')]&&_0x1995df[_0xbe24('0xeb')]===_0xbe24('0xf0')){delete this[_0xbe24('0x29')][_0x1995df[_0xbe24('0xe6')]];this[_0xbe24('0xbf')](this[_0xbe24('0x22')][_0xddcdb1['queue']]);this['voiceQueues'][_0xddcdb1['queue']][_0xbe24('0x66')]+=0x1;this[_0xbe24('0x22')][_0xddcdb1[_0xbe24('0xbd')]][_0xbe24('0x65')]+=0x1;_0x173c5c=new Hangup(_0xddcdb1,_0x1995df);_0x173c5c[_0xbe24('0xb1')]=0x13;_0x173c5c[_0xbe24('0xb2')]='Machine';_0x173c5c[_0xbe24('0xed')]=_0xbe24('0xf1');_0x173c5c[_0xbe24('0xf2')]=!![];this[_0xbe24('0xd8')](_0x173c5c,_0xbe24('0xf3'),_0xbe24('0xf4'));}if(_0xddcdb1[_0xbe24('0x53')]===_0xbe24('0x83')&&this[_0xbe24('0x23')][_0xddcdb1[_0xbe24('0xbd')]]['dialAMDActive']&&_0x1995df[_0xbe24('0xeb')]===_0xbe24('0xf5')){delete this['uniqueId'][_0x1995df['uniqueid']];this[_0xbe24('0xbf')](this[_0xbe24('0x23')][_0xddcdb1[_0xbe24('0xbd')]]);_0x173c5c=new Hangup(_0xddcdb1,_0x1995df);_0x173c5c['state']=0x12;_0x173c5c[_0xbe24('0xb2')]=_0xbe24('0xec');_0x173c5c[_0xbe24('0xed')]='AMD';this[_0xbe24('0xd8')](_0x173c5c,'[syncHangupInAMDIvr][createHistory]',_0xbe24('0xf6'));}if(_0xddcdb1[_0xbe24('0x53')]===_0xbe24('0x83')&&this[_0xbe24('0x23')][_0xddcdb1[_0xbe24('0xbd')]][_0xbe24('0xea')]&&_0x1995df['value']===_0xbe24('0xf0')){delete this[_0xbe24('0x29')][_0x1995df[_0xbe24('0xe6')]];this['updateOriginated'](this[_0xbe24('0x23')][_0xddcdb1[_0xbe24('0xbd')]]);_0x173c5c=new Hangup(_0xddcdb1,_0x1995df);_0x173c5c[_0xbe24('0xb1')]=0x13;_0x173c5c[_0xbe24('0xb2')]=_0xbe24('0xf7');_0x173c5c[_0xbe24('0xed')]=_0xbe24('0xf1');_0x173c5c[_0xbe24('0xf2')]=!![];this[_0xbe24('0xd8')](_0x173c5c,_0xbe24('0xf8'),_0xbe24('0xf9'));}}};Dialer[_0xbe24('0xb6')][_0xbe24('0x3a')]=function(_0x455377){var _0x97b2d3=this[_0xbe24('0x29')][_0x455377[_0xbe24('0xe6')]];var _0x34b188=this;var _0x37fa65;if(_0x97b2d3&&_0x97b2d3[_0xbe24('0x53')]===_0xbe24('0x83')){delete this[_0xbe24('0x29')][_0x455377[_0xbe24('0xe6')]];this[_0xbe24('0xbf')](this['campaigns'][_0x97b2d3[_0xbe24('0xbd')]]);this[_0xbe24('0x23')][_0x97b2d3[_0xbe24('0xbd')]][_0xbe24('0xfa')]+=0x1;_0x37fa65=new Hangup(_0x97b2d3,_0x455377);this[_0xbe24('0xd2')](_0x37fa65)[_0xbe24('0xbb')](loggerCatch(_0xbe24('0xfb')));this[_0xbe24('0xd0')](_0x37fa65)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x97b2d3&&_0x97b2d3[_0xbe24('0x53')]!=='ivr'&&isNotNull(this[_0xbe24('0x22')][_0x97b2d3[_0xbe24('0xbd')]][_0xbe24('0xfc')])){delete this[_0xbe24('0x29')][_0x455377[_0xbe24('0xe6')]];this[_0xbe24('0xbf')](this[_0xbe24('0x22')][_0x97b2d3[_0xbe24('0xbd')]]);this[_0xbe24('0x22')][_0x97b2d3[_0xbe24('0xbd')]][_0xbe24('0x66')]+=0x1;this[_0xbe24('0x22')][_0x97b2d3[_0xbe24('0xbd')]][_0xbe24('0x65')]+=0x1;_0x37fa65=new Hangup(_0x97b2d3,_0x455377);_0x37fa65[_0xbe24('0xb1')]=0x10;_0x37fa65['statedesc']=_0xbe24('0xfd');_0x37fa65['membername']=_0xbe24('0xfe');this[_0xbe24('0xd2')](_0x37fa65)['catch'](loggerCatch(_0xbe24('0xfb')));this[_0xbe24('0xd0')](_0x37fa65)[_0xbe24('0xbb')](loggerCatch('[syncHangupIvr]'));}if(_0x97b2d3&&_0x97b2d3['type']!=='ivr'&&!isNotNull(this[_0xbe24('0x22')][_0x97b2d3[_0xbe24('0xbd')]]['dialQueueProject'])){delete this[_0xbe24('0x29')][_0x455377[_0xbe24('0xe6')]];this[_0xbe24('0xbf')](this[_0xbe24('0x22')][_0x97b2d3[_0xbe24('0xbd')]]);this[_0xbe24('0x22')][_0x97b2d3['queue']][_0xbe24('0x6f')]+=0x1;_0x37fa65=new Hangup(_0x97b2d3,_0x455377);_0x37fa65[_0xbe24('0xb1')]=0xc;_0x37fa65[_0xbe24('0xb2')]=_0x455377[_0xbe24('0xff')];_0x37fa65['membername']='Unknow';this['createHistory'](_0x37fa65)[_0xbe24('0xbb')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xbe24('0xd0')](_0x37fa65)[_0xbe24('0xbb')](loggerCatch(_0xbe24('0x100')));}};Dialer[_0xbe24('0xb6')][_0xbe24('0x37')]=function(_0x343355){var _0xf5841e=this['uniqueId'][_0x343355[_0xbe24('0xe6')]];var _0x519187=this;if(this[_0xbe24('0x22')][_0x343355['queue']]){if(_0xf5841e&&_0xf5841e[_0xbe24('0x53')]!=='ivr'){delete this[_0xbe24('0x29')][_0x343355['uniqueid']];this[_0xbe24('0x22')][_0x343355[_0xbe24('0xbd')]][_0xbe24('0x66')]+=0x1;var _0x48f1ed=new AgentComplete(_0xf5841e,_0x343355);if(_0x343355['reason']===_0xbe24('0x101')){_0x48f1ed[_0xbe24('0x102')]=this['voiceQueues'][_0x343355[_0xbe24('0xbd')]]['dialQueueProject2']&&this[_0xbe24('0x22')][_0x343355[_0xbe24('0xbd')]][_0xbe24('0x103')]?moment()[_0xbe24('0x81')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0xbe24('0xd2')](_0x48f1ed)[_0xbe24('0xbb')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0xbe24('0xd0')](_0x48f1ed)[_0xbe24('0xbb')](loggerCatch(_0xbe24('0x104')));}}};Dialer[_0xbe24('0xb6')][_0xbe24('0x30')]=function(_0x251a1e){if(this[_0xbe24('0x22')][_0x251a1e[_0xbe24('0xbd')]]){if(this[_0xbe24('0x29')][_0x251a1e['uniqueid']]&&this['uniqueId'][_0x251a1e['uniqueid']]['type']!==_0xbe24('0x83')){this['updateOriginated'](this[_0xbe24('0x22')][_0x251a1e[_0xbe24('0xbd')]]);this['uniqueId'][_0x251a1e[_0xbe24('0xe6')]][_0xbe24('0x105')]=moment()[_0xbe24('0x81')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer['prototype'][_0xbe24('0x106')]=function(_0x28684c){this['createHistory'](_0x28684c)[_0xbe24('0xbb')](loggerCatch(_0xbe24('0x107')));this[_0xbe24('0xd0')](_0x28684c)['catch'](loggerCatch(_0xbe24('0x108')));};Dialer[_0xbe24('0xb6')][_0xbe24('0x32')]=function(_0x4fb562){var _0x40e7e0=this[_0xbe24('0x29')][_0x4fb562[_0xbe24('0xe6')]];var _0x46a4b4=this;if(this[_0xbe24('0x22')][_0x4fb562[_0xbe24('0xbd')]]){if(_0x40e7e0&&_0x40e7e0[_0xbe24('0x53')]!==_0xbe24('0x83')){delete this['uniqueId'][_0x4fb562[_0xbe24('0xe6')]];this[_0xbe24('0xbf')](this[_0xbe24('0x22')][_0x4fb562[_0xbe24('0xbd')]]);_0x40e7e0[_0xbe24('0x109')]=moment()[_0xbe24('0x81')](_0xbe24('0x10a'));var _0x13ede3=new QueueCallerAbandon(_0x40e7e0,_0x4fb562);if(getSeconds(_0x40e7e0['droptime'],_0x40e7e0[_0xbe24('0x10b')])>=_0x40e7e0[_0xbe24('0x10c')]){this[_0xbe24('0x22')][_0x4fb562[_0xbe24('0xbd')]][_0xbe24('0x74')]+=0x1;this[_0xbe24('0x22')][_0x4fb562[_0xbe24('0xbd')]]['outboundDropCallsDayTimeout']+=0x1;this[_0xbe24('0x22')][_0x4fb562[_0xbe24('0xbd')]][_0xbe24('0x76')]+=0x1;_0x13ede3[_0xbe24('0xb1')]=0xa;_0x13ede3['statedesc']=_0xbe24('0x10d');_0x13ede3['dropreason']=_0xbe24('0x10e');_0x13ede3[_0xbe24('0x102')]=this[_0xbe24('0x22')][_0x4fb562[_0xbe24('0xbd')]]['dialQueueProject2']?moment()[_0xbe24('0x81')](_0xbe24('0x10a')):undefined;this[_0xbe24('0x106')](_0x13ede3);}else{this['voiceQueues'][_0x4fb562['queue']]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0xbe24('0x22')][_0x4fb562[_0xbe24('0xbd')]][_0xbe24('0x69')]+=0x1;_0x13ede3[_0xbe24('0xb1')]=0xb;_0x13ede3[_0xbe24('0xb2')]=_0xbe24('0x10f');_0x13ede3[_0xbe24('0x110')]=_0xbe24('0x111');this['queueCallerAbandonCreateState'](_0x13ede3);}}}};Dialer[_0xbe24('0xb6')]['syncNewExten']=function(_0x78d6af){if(this[_0xbe24('0x27')][_0x78d6af['uniqueid']]){this[_0xbe24('0x27')][_0x78d6af[_0xbe24('0xe6')]][_0xbe24('0xba')]=_0x78d6af[_0xbe24('0xba')];}if(this[_0xbe24('0x29')][_0x78d6af[_0xbe24('0xe6')]]){this['uniqueId'][_0x78d6af[_0xbe24('0xe6')]][_0xbe24('0xba')]=_0x78d6af[_0xbe24('0xba')];}};Dialer['prototype']['syncQueueMember']=function(_0x44e35a){if(strategy[this[_0xbe24('0x22')][this[_0xbe24('0x27')][_0x44e35a[_0xbe24('0x112')]][_0xbe24('0xbd')]][_0xbe24('0x55')]]==='roundrobin'){if(this[_0xbe24('0x27')][_0x44e35a[_0xbe24('0x112')]]&&_[_0xbe24('0xe7')](this[_0xbe24('0x27')][_0x44e35a['actionid']][_0xbe24('0x113')])&&_0x44e35a['status']==='1'&&_0x44e35a[_0xbe24('0x114')]==='0'){if(this['agents'][_0x44e35a[_0xbe24('0x115')]]){if(!this[_0xbe24('0x24')][_0x44e35a['stateinterface']][_0xbe24('0x113')]){this[_0xbe24('0x24')][_0x44e35a['stateinterface']][_0xbe24('0x113')]=!![];this['actions'][_0x44e35a['actionid']][_0xbe24('0x113')]=!![];this[_0xbe24('0x27')][_0x44e35a[_0xbe24('0x112')]][_0xbe24('0x115')]=_0x44e35a['stateinterface'];}}}}else if((strategy[this[_0xbe24('0x22')][this[_0xbe24('0x27')][_0x44e35a['actionid']][_0xbe24('0xbd')]][_0xbe24('0x55')]]||_0xbe24('0x1c'))===_0xbe24('0x1c')){if(this[_0xbe24('0x27')][_0x44e35a[_0xbe24('0x112')]]){if(this[_0xbe24('0x24')][_0x44e35a['stateinterface']]){this[_0xbe24('0x27')][_0x44e35a[_0xbe24('0x112')]]['stateinterface']=_0x44e35a['stateinterface'];if(_[_0xbe24('0xe7')](this[_0xbe24('0x116')][this[_0xbe24('0x27')][_0x44e35a[_0xbe24('0x112')]][_0xbe24('0xbd')]])){this['queueBooked'][this[_0xbe24('0x27')][_0x44e35a[_0xbe24('0x112')]]['queue']]=[];}this['queueBooked'][this[_0xbe24('0x27')][_0x44e35a[_0xbe24('0x112')]][_0xbe24('0xbd')]][_0xbe24('0x117')](_['merge'](_['pick'](this[_0xbe24('0x27')][_0x44e35a['actionid']],[_0xbe24('0x118'),_0xbe24('0x115')]),{'status':_0x44e35a[_0xbe24('0xe2')],'paused':_0x44e35a['paused']}));}}}};function unlockQueueStatus(_0x227e43,_0x2dde0e){setTimeout(function(){if(_[_0xbe24('0x8d')](_0x227e43[_0xbe24('0x119')])){loggerBooked[_0xbe24('0x9f')](_0xbe24('0x11a'),_0x2dde0e);}_0x227e43[_0xbe24('0x119')]=!![];loggerBooked[_0xbe24('0x87')](_0xbe24('0x11b'),_0x2dde0e,JSON[_0xbe24('0x4e')](_[_0xbe24('0x11c')](_0x227e43,[_0xbe24('0x46'),_0xbe24('0x119')])));},0x1f3);}Dialer[_0xbe24('0xb6')][_0xbe24('0x41')]=function(_0x192521){var _0x1fc3b0=this;var _0x111776=_0x1fc3b0['voiceQueues'][_0x1fc3b0[_0xbe24('0x27')][_0x192521[_0xbe24('0x112')]][_0xbe24('0xbd')]];if(strategy[this[_0xbe24('0x22')][this[_0xbe24('0x27')][_0x192521[_0xbe24('0x112')]][_0xbe24('0xbd')]][_0xbe24('0x55')]]===_0xbe24('0x1d')){if(this['actions'][_0x192521[_0xbe24('0x112')]]&&this['actions'][_0x192521['actionid']]['stateinterface']){this[_0xbe24('0x21')][_0xbe24('0x11d')](this[_0xbe24('0x27')][_0x192521[_0xbe24('0x112')]][_0xbe24('0x118')],this['actions'][_0x192521[_0xbe24('0x112')]][_0xbe24('0x115')])[_0xbe24('0xbb')](function(_0x79a7fb){logger[_0xbe24('0x9f')]('[Catch][Preview][syncQueueStatusComplete]',util[_0xbe24('0x9e')](_0x79a7fb,{'showHidden':![],'depth':null}));})['finally'](function(){_0x1fc3b0['updateOriginated'](_0x1fc3b0[_0xbe24('0x22')][_0x1fc3b0['actions'][_0x192521['actionid']]['queue']]);_0x1fc3b0[_0xbe24('0x24')][_0x1fc3b0['actions'][_0x192521['actionid']][_0xbe24('0x115')]][_0xbe24('0x113')]=![];delete _0x1fc3b0['actions'][_0x192521[_0xbe24('0x112')]];unlockQueueStatus(_0x111776);});}else{this[_0xbe24('0xbf')](this[_0xbe24('0x22')][this['actions'][_0x192521['actionid']][_0xbe24('0xbd')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0xbe24('0x27')][_0x192521[_0xbe24('0x112')]][_0xbe24('0x11e')],'ListId':this[_0xbe24('0x27')][_0x192521[_0xbe24('0x112')]]['ListId'],'VoiceQueueId':this[_0xbe24('0x27')][_0x192521['actionid']][_0xbe24('0xdc')]||undefined,'CampaignId':this[_0xbe24('0x27')][_0x192521['actionid']][_0xbe24('0xdd')]||undefined})['catch'](loggerCatch(_0xbe24('0x11f')));delete this[_0xbe24('0x27')][_0x192521['actionid']];unlockQueueStatus(_0x111776);}}else if((strategy[this[_0xbe24('0x22')][this[_0xbe24('0x27')][_0x192521[_0xbe24('0x112')]]['queue']][_0xbe24('0x55')]]||'rrmemory')==='rrmemory'){var _0x2ac10f;if(this[_0xbe24('0x27')][_0x192521[_0xbe24('0x112')]]&&!_[_0xbe24('0x86')](this['queueBooked'][this[_0xbe24('0x27')][_0x192521['actionid']][_0xbe24('0xbd')]])){if(this[_0xbe24('0x2e')][_0x1fc3b0[_0xbe24('0x27')][_0x192521[_0xbe24('0x112')]][_0xbe24('0xbd')]]){this[_0xbe24('0x2e')][_0x1fc3b0[_0xbe24('0x27')][_0x192521[_0xbe24('0x112')]][_0xbe24('0xbd')]]=this[_0xbe24('0x2e')][this['actions'][_0x192521[_0xbe24('0x112')]][_0xbe24('0xbd')]]?this['queueBookedRR'][this['actions'][_0x192521['actionid']][_0xbe24('0xbd')]]:this[_0xbe24('0x116')][this[_0xbe24('0x27')][_0x192521[_0xbe24('0x112')]]['queue']]?this[_0xbe24('0x116')][this['actions'][_0x192521[_0xbe24('0x112')]]['queue']]['_rr']||0x0:0x0;}this[_0xbe24('0x116')][this[_0xbe24('0x27')][_0x192521[_0xbe24('0x112')]]['queue']][_0xbe24('0x120')]=this['queueBookedRR'][this[_0xbe24('0x27')][_0x192521['actionid']][_0xbe24('0xbd')]];for(var _0x3cb92b=0x0;_0x3cb92b=0x0?!![]:![];})[_0xbe24('0xbb')](myreject(_0x143be2)));}}else{_0x5d46ce[_0xbe24('0x117')](ami[_0xbe24('0xb9')]({'action':_0xbe24('0x13d'),'command':util[_0xbe24('0x81')](_0xbe24('0x139'),_0x564df3,!_[_0xbe24('0x8d')](config[_0xbe24('0x135')][_0x1af631])?_0x1af631:'')})['then'](function(_0x58148c){return _0x58148c[_0xbe24('0x13e')]['indexOf']('true')>=0x0?!![]:![];})['catch'](myreject(_0x143be2)));}BPromise[_0xbe24('0x13f')](_0x5d46ce)[_0xbe24('0xc3')](function(_0x28b7b){var _0x28ab33=_[_0xbe24('0x140')](_0x28b7b);if(_0x28ab33){return _0x2716ef(_0x28ab33);}else{_0x21de20['message']=_0x5b2316?'GLOBAL_INTERVAL_IS_OVERTIME':_0xbe24('0x141');return _0x143be2(msgResponse(_0xbe24('0x142'),_0xbe24('0x134'),'Global:\x20'+_0x5b2316+'\x20'+_0x2b84ab+_0xbe24('0x143')+util[_0xbe24('0x9e')](_0x564df3,{'showHidden':![],'depth':null})+_0xbe24('0x144')+_0x1af631));}})[_0xbe24('0xbb')](function(_0x45bc88){return _0x143be2(msgResponse(_0xbe24('0x130'),'Failure',JSON[_0xbe24('0x4e')](_0x45bc88)));});});};Dialer['prototype'][_0xbe24('0x145')]=function(_0x53c8fa){var _0x369fd8=this;return function(){switch(_0x53c8fa[_0xbe24('0x61')]){case _0xbe24('0x146'):freeVariablesPredictive(_0x53c8fa);_0x369fd8[_0xbe24('0x147')](_0x53c8fa,0x1);break;case _0xbe24('0x148'):freeVariablesPredictive(_0x53c8fa);_0x369fd8['handlePower'](_0x53c8fa,_0x53c8fa['dialPowerLevel']);break;case'predictive':_0x369fd8['predictive'](_0x53c8fa);break;case'booked':freeVariablesPredictive(_0x53c8fa);_0x369fd8[_0xbe24('0x147')](_0x53c8fa,0x1);break;default:freeVariablesPredictive(_0x53c8fa);logger[_0xbe24('0x9f')](_0xbe24('0x149'),_0x53c8fa[_0xbe24('0x46')],_0xbe24('0x14a'));}};};Dialer['prototype'][_0xbe24('0x14b')]=function(_0x265519){var _0x25a718=this;return function(){_0x25a718[_0xbe24('0x14c')](_0x265519);};};Dialer[_0xbe24('0xb6')][_0xbe24('0xb')]=function(_0x56bdce){var _0x5796dd=this;if(isNotPreview(_0x56bdce['dialMethod'])){if(isVoiceQueueOutbound(_0x56bdce[_0xbe24('0x53')])&&isActive(_0x56bdce[_0xbe24('0x14d')])){_0x56bdce['sendMessageOneNotActive']=!![];BPromise[_0xbe24('0xc2')]()['then'](checkIsLoggedIn(_0x56bdce,_0x56bdce['loggedIn']))[_0xbe24('0xc3')](checkIsActive(_0x56bdce,_0x56bdce[_0xbe24('0x14d')]))[_0xbe24('0xc3')](checkInterval(_0x56bdce))[_0xbe24('0xc3')](_0x5796dd[_0xbe24('0x12d')](_0x56bdce))[_0xbe24('0xc3')](_0x5796dd['checkIfTime'](_0x56bdce[_0xbe24('0x14e')],_0x56bdce[_0xbe24('0x14f')],_0x56bdce[_0xbe24('0x46')],_0x56bdce))[_0xbe24('0xc3')](_0x5796dd[_0xbe24('0x131')](_0x56bdce[_0xbe24('0x4a')],_0x56bdce[_0xbe24('0x14f')],_0x56bdce['name'],_0x56bdce))[_0xbe24('0xc3')](_0x5796dd['checkDialMethod'](_0x56bdce))[_0xbe24('0xbb')](loggerCatchQueueSummary(_0xbe24('0x150'),_0x56bdce));}else{notSendMessagesQueue(_0x56bdce);}}else{freeVariablesPredictive(_0x56bdce);}};Dialer[_0xbe24('0xb6')][_0xbe24('0x12c')]=function(){var _0x2676b1=this;var _0x321c03;for(var _0x575f0d in this[_0xbe24('0x23')]){if(this[_0xbe24('0x23')][_0xbe24('0xa2')](_0x575f0d)){_0x321c03=this[_0xbe24('0x23')][_0x575f0d];if(isCampaignIvr(_0x321c03[_0xbe24('0x53')])&&isActive(_0x321c03[_0xbe24('0xe1')])){_0x321c03[_0xbe24('0xab')]=!![];BPromise['resolve']()[_0xbe24('0xc3')](checkIsActive(_0x321c03,_0x321c03[_0xbe24('0xe1')]))[_0xbe24('0xc3')](checkInterval(_0x321c03))[_0xbe24('0xc3')](_0x2676b1[_0xbe24('0x12d')](_0x321c03))['then'](_0x2676b1[_0xbe24('0x12f')](_0x321c03[_0xbe24('0x14e')],_0x321c03[_0xbe24('0x14f')],_0x321c03['name'],_0x321c03))[_0xbe24('0xc3')](_0x2676b1['checkIfTimeIntervals'](_0x321c03[_0xbe24('0x4a')],_0x321c03['dialTimezone'],_0x321c03['name'],_0x321c03))[_0xbe24('0xc3')](_0x2676b1[_0xbe24('0x14b')](_0x321c03))[_0xbe24('0xbb')](loggerCatchQueueSummary(_0xbe24('0x151'),_0x321c03));}else{notSendMessagesCampaign(_0x321c03);}}}};function getCallerIdRandom(_0x246a5b,_0xdc5dc4){var _0x4fc220,_0x3712d0,_0x18ec55;if(_0xdc5dc4<=0x0){_0xdc5dc4=0x1;}_0x4fc220=new RegExp(_0xbe24('0x152')+_0xdc5dc4+'}$');_0x3712d0=Math['pow'](0xa,_0xdc5dc4-0x1);_0x18ec55=Math[_0xbe24('0x153')](0xa,_0xdc5dc4)-0x1;return util[_0xbe24('0x81')]('%s',_['replace'](_0x246a5b,_0x4fc220,_['random'](_0x3712d0,_0x18ec55)));}function extractCalleridName(_0x1344bd){var _0x33cb66=_0x1344bd['match'](/"(.*?)"/);return _0x33cb66?_0x33cb66[0x1]:_0x1344bd;}function extractCalleridNumber(_0x5f1e27){var _0x573f83=_0x5f1e27[_0xbe24('0x154')](/<(.*?)>/);return _0x573f83?_0x573f83[0x1]:_0x5f1e27;}Dialer[_0xbe24('0xb6')][_0xbe24('0x155')]=function(_0xfd4aa7,_0x43f0d0){var _0x5bcbac=this;var _0x492861=uuid['v4']();this[_0xbe24('0x27')][_0x492861]=new Action(_0xfd4aa7,_0x43f0d0,_0x492861);return new BPromise(function(_0x1193d6,_0xec283c){if(_[_0xbe24('0x8d')](_0xfd4aa7)&&_0xbe24('0x156')!==typeof _0xfd4aa7){return _0xec283c(msgResponse(_0xbe24('0x157'),'Failure',_0xbe24('0x158')));}if(_[_0xbe24('0x8d')](_0x43f0d0[_0xbe24('0x159')][_0xbe24('0x15a')])||_0x43f0d0[_0xbe24('0x159')][_0xbe24('0x15a')]===null){return _0xec283c(msgResponse(_0xbe24('0x157'),_0xbe24('0x134'),_0xbe24('0x15b')));}var _0x221a3c={'XMD-CALLERID':_0x5bcbac[_0xbe24('0x27')][_0x492861][_0xbe24('0x15c')](),'XMD-AGI':_0xfd4aa7[_0xbe24('0xfc')]?util[_0xbe24('0x81')](_0xbe24('0x15d'),ipAgi,_0xfd4aa7['dialQueueProject']):_0xbe24('0x15e'),'XMD-AGIAFTER':_0xfd4aa7['dialQueueProject2']?util[_0xbe24('0x81')](_0xbe24('0x15d'),ipAgi,_0xfd4aa7['dialQueueProject2']):_0xbe24('0x15e'),'XMD-QUEUE':_0xfd4aa7['type']===_0xbe24('0x54')?util[_0xbe24('0x81')](_0xbe24('0x15f'),_0xfd4aa7[_0xbe24('0x46')],_0xfd4aa7['dialQueueOptions']||'',_0xfd4aa7[_0xbe24('0x103')]?'c':'',_0xfd4aa7[_0xbe24('0x10c')]||0x3):_0xbe24('0x15e'),'XMD-CONTACTID':_0x43f0d0[_0xbe24('0x11e')],'XMD-CDRTYPE':_0xbe24('0x6'),'CALLERID(all)':_0x5bcbac[_0xbe24('0x27')][_0x492861][_0xbe24('0x15c')](),'XMD-AMD':_0xfd4aa7[_0xbe24('0xea')]?_0xbe24('0x160'):_0xbe24('0x15e'),'XMD-DESTINATION':_0xbe24('0xe9')};if(_0xfd4aa7[_0xbe24('0xea')]){_0x221a3c['XMD-AMDINITIALSILENCE']=_0xfd4aa7[_0xbe24('0x161')]||0x9c4;_0x221a3c[_0xbe24('0x162')]=_0xfd4aa7[_0xbe24('0x163')]||0x5dc;_0x221a3c[_0xbe24('0x164')]=_0xfd4aa7[_0xbe24('0x165')]||0x320;_0x221a3c[_0xbe24('0x166')]=_0xfd4aa7[_0xbe24('0x167')]||0x1388;_0x221a3c[_0xbe24('0x168')]=_0xfd4aa7[_0xbe24('0x169')]||0x64;_0x221a3c['XMD-AMDBETWEENWORDSSILENCE']=_0xfd4aa7[_0xbe24('0x16a')]||0x32;_0x221a3c[_0xbe24('0x16b')]=_0xfd4aa7[_0xbe24('0x16c')]||0x3;_0x221a3c[_0xbe24('0x16d')]=_0xfd4aa7[_0xbe24('0x16e')]||0x100;_0x221a3c[_0xbe24('0x16f')]=_0xfd4aa7[_0xbe24('0x170')]||0x1388;}if(_0xfd4aa7[_0xbe24('0x53')]==='outbound'){_0x221a3c[_0xbe24('0x171')]=_0x43f0d0[_0xbe24('0xdc')];}else{_0x221a3c[_0xbe24('0x172')]=_0x43f0d0[_0xbe24('0xdd')];}for(var _0x353998 in _0x43f0d0[_0xbe24('0x159')]){if(_0x43f0d0[_0xbe24('0x159')][_0xbe24('0xa2')](_0x353998)){if(isNotNull(_0x43f0d0[_0xbe24('0x159')][_0x353998])&&_0x353998!=='id'&&_0x353998!=='tags'&&_0x353998!==_0xbe24('0x173')&&_0x353998!==_0xbe24('0x174')){_0x221a3c[util[_0xbe24('0x81')](_0xbe24('0x175'),_0xbe24('0x176'),_[_0xbe24('0x177')](_0x353998))]=_0x43f0d0[_0xbe24('0x159')][_0x353998];}}}var _0x34e943=_0x5bcbac['isTrunkReachable'](_0xfd4aa7[_0xbe24('0x7f')])?getCallerId(_0xfd4aa7['Trunk'][_0xbe24('0x80')],_0xfd4aa7['dialOriginateCallerIdName'],_0xfd4aa7[_0xbe24('0x178')]>0x0?getCallerIdRandom(_0xfd4aa7[_0xbe24('0x62')],_0xfd4aa7['dialRandomLastDigitCallerIdNumber']):_0xfd4aa7['dialOriginateCallerIdNumber']):getCallerId(_['isNil'](_0xfd4aa7[_0xbe24('0x12e')])?_0xfd4aa7[_0xbe24('0x7f')][_0xbe24('0x80')]:_0xfd4aa7['TrunkBackup']['callerid'],_0xfd4aa7['dialOriginateCallerIdName'],_0xfd4aa7[_0xbe24('0x178')]>0x0?getCallerIdRandom(_0xfd4aa7['dialOriginateCallerIdNumber'],_0xfd4aa7[_0xbe24('0x178')]):_0xfd4aa7['dialOriginateCallerIdNumber']);if(_0x34e943){_0x221a3c[_0xbe24('0x179')]=_0x5bcbac[_0xbe24('0x27')][_0x492861][_0xbe24('0x17a')]=extractCalleridName(_0x34e943);_0x221a3c[_0xbe24('0x17b')]=_0x5bcbac['actions'][_0x492861][_0xbe24('0x17c')]=extractCalleridNumber(_0x34e943);}return ami[_0xbe24('0xb9')]({'actionid':_0x492861,'action':_0xbe24('0x157'),'channel':_0x5bcbac['isTrunkReachable'](_0xfd4aa7['Trunk'])?util[_0xbe24('0x81')](_0xbe24('0x17d'),_0xfd4aa7[_0xbe24('0x7f')]['name'],isNotNull(_0xfd4aa7[_0xbe24('0x64')])?_0xfd4aa7[_0xbe24('0x64')]['trim']()||'':'',_0xfd4aa7['dialCutDigit']>0x0?_0x43f0d0[_0xbe24('0x159')][_0xbe24('0x15a')][_0xbe24('0x17e')](_0xfd4aa7[_0xbe24('0x17f')]):_0x43f0d0[_0xbe24('0x159')]['phone']):util[_0xbe24('0x81')]('SIP/%s/%s%s',_[_0xbe24('0xe7')](_0xfd4aa7[_0xbe24('0x12e')])?_0xfd4aa7['Trunk'][_0xbe24('0x46')]:_0xfd4aa7[_0xbe24('0x12e')][_0xbe24('0x46')],isNotNull(_0xfd4aa7['dialPrefix'])?_0xfd4aa7[_0xbe24('0x64')][_0xbe24('0x180')]()||'':'',_0xfd4aa7[_0xbe24('0x17f')]>0x0?_0x43f0d0['Contact'][_0xbe24('0x15a')][_0xbe24('0x17e')](_0xfd4aa7[_0xbe24('0x17f')]):_0x43f0d0[_0xbe24('0x159')][_0xbe24('0x15a')]),'callerid':_0x34e943,'Exten':'xcally-motion-dialer','Context':_0xbe24('0x181'),'Priority':'1','variable':_0x221a3c,'timeout':(_0xfd4aa7['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x492861})['then'](function(_0x3545ba){return _0x1193d6(_0x3545ba);})['catch'](function(_0x22db58){_0xfd4aa7[_0xbe24('0x6c')]+=0x1;var _0x1192f2=new History(_0x5bcbac['actions'][_0x492861]);logger[_0xbe24('0x9f')](util[_0xbe24('0x81')](_0xbe24('0x182'),JSON[_0xbe24('0x4e')](_0x22db58)));_0x1192f2[_0xbe24('0xb1')]=0xe;_0x1192f2[_0xbe24('0xb2')]=_0xbe24('0x183');_0x1192f2[_0xbe24('0x184')]=moment()['format'](_0xbe24('0x10a'));_0x1192f2[_0xbe24('0xb3')]=_0x1192f2[_0xbe24('0x184')];_0x5bcbac['createHistory'](_0x1192f2)[_0xbe24('0xbb')](loggerCatch('[originate][error]'));_0x5bcbac['moveContactManagedDialer'](_0x1192f2)[_0xbe24('0xbb')](loggerCatch('[originate][error]'))[_0xbe24('0x1f')](function(){delete _0x5bcbac[_0xbe24('0x27')][_0x492861];return _0xec283c(msgResponse('originate',_0xbe24('0x4d'),_0xbe24('0x185')));});});});};Dialer[_0xbe24('0xb6')]['syncOriginateResponse']=function(_0x23d25c){var _0x544482=this['actions'][_0x23d25c[_0xbe24('0x112')]];var _0x5514ae=this;if(_0x544482){delete this[_0xbe24('0x27')][_0x23d25c[_0xbe24('0x112')]];_0x544482[_0xbe24('0x10b')]=moment()[_0xbe24('0x81')](_0xbe24('0x10a'));var _0x15e08e=_0x544482[_0xbe24('0x53')]===_0xbe24('0x83')?this[_0xbe24('0x23')][_0x544482[_0xbe24('0xbd')]]:this[_0xbe24('0x22')][_0x544482[_0xbe24('0x186')]()];if(!this['isSuccess'](_0x23d25c['response'])){this[_0xbe24('0xbf')](_0x15e08e);return this[_0xbe24('0x187')](_0x544482,_0x15e08e,_0x23d25c)[_0xbe24('0xc3')](function(_0x5602e6){})[_0xbe24('0xbb')](loggerCatch('[callProgressDetecting]\x20'));}else{this[_0xbe24('0x29')][_0x23d25c[_0xbe24('0xe6')]]=_0x544482;}}};Dialer[_0xbe24('0xb6')][_0xbe24('0x188')]=function(_0x29469b,_0x33589b,_0x48bc5d){var _0x3d3e22=new History(_0x33589b);if(_0x3d3e22['countbusyretry']+_0x3d3e22[_0xbe24('0x189')]+_0x3d3e22[_0xbe24('0x18a')]>=_0x48bc5d[_0xbe24('0x18b')]-0x1){return!![];}switch(_0x29469b){case 0x3:if(_0x3d3e22[_0xbe24('0x18a')]>=_0x48bc5d[_0xbe24('0x18c')]-0x1){return!![];}else{this[_0xbe24('0xc9')]({'active':![],'countnoanswerretry':_0x3d3e22['countnoanswerretry']+=0x1,'scheduledat':moment()[_0xbe24('0x18d')](_0x48bc5d[_0xbe24('0x18e')],_0xbe24('0x18f'))[_0xbe24('0x81')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3d3e22[_0xbe24('0x11e')],'ListId':_0x3d3e22[_0xbe24('0xda')],'VoiceQueueId':_0x3d3e22[_0xbe24('0xdc')]||undefined,'CampaignId':_0x3d3e22[_0xbe24('0xdd')]||undefined})[_0xbe24('0xbb')](loggerCatch(_0xbe24('0x190')));}break;case 0x5:if(_0x3d3e22['countbusyretry']>=_0x48bc5d['dialBusyMaxRetry']-0x1){return!![];}else{this[_0xbe24('0xc9')]({'active':![],'countbusyretry':_0x3d3e22['countbusyretry']+=0x1,'scheduledat':moment()[_0xbe24('0x18d')](_0x48bc5d[_0xbe24('0x191')],_0xbe24('0x18f'))['format'](_0xbe24('0x10a')),'ContactId':_0x3d3e22[_0xbe24('0x11e')],'ListId':_0x3d3e22[_0xbe24('0xda')],'VoiceQueueId':_0x3d3e22[_0xbe24('0xdc')]||undefined,'CampaignId':_0x3d3e22[_0xbe24('0xdd')]||undefined})[_0xbe24('0xbb')](loggerCatch('[rescheduleContact]\x20[Busy]'));}break;case 0x8:if(_0x3d3e22['countcongestionretry']>=_0x48bc5d[_0xbe24('0x192')]-0x1){return!![];}else{this[_0xbe24('0xc9')]({'active':![],'countcongestionretry':_0x3d3e22[_0xbe24('0x189')]+=0x1,'scheduledat':moment()[_0xbe24('0x18d')](_0x48bc5d[_0xbe24('0x193')],_0xbe24('0x18f'))[_0xbe24('0x81')](_0xbe24('0x10a')),'ContactId':_0x3d3e22['ContactId'],'ListId':_0x3d3e22['ListId'],'VoiceQueueId':_0x3d3e22[_0xbe24('0xdc')]||undefined,'CampaignId':_0x3d3e22['CampaignId']||undefined})[_0xbe24('0xbb')](loggerCatch(_0xbe24('0x194')));}break;default:return!![];}};Dialer[_0xbe24('0xb6')][_0xbe24('0x187')]=function(_0x1372f0,_0x3a6ec3,_0x450f6c){var _0x5272b7=this;var _0x39a051=new History(_0x1372f0);return new BPromise(function(_0x281133,_0x3878b5){if(_[_0xbe24('0x8d')](_0x3a6ec3)&&_0xbe24('0x156')!==typeof _0x3a6ec3){return _0x3878b5(msgResponse(_0xbe24('0x195'),_0xbe24('0x134'),_0xbe24('0x196')));}if(_[_0xbe24('0x8d')](_0x450f6c)&&_0xbe24('0x156')!==typeof _0x450f6c){return _0x3878b5(msgResponse('[callProgressDetecting]','Failure',_0xbe24('0x197')));}switch(_0x450f6c[_0xbe24('0x198')]){case'0':_0x3a6ec3[_0xbe24('0x6b')]+=0x1;_0x39a051[_0xbe24('0xb1')]=0x0;_0x39a051[_0xbe24('0xb2')]='NoSuchNumber';_0x5272b7[_0xbe24('0xd2')](_0x39a051)[_0xbe24('0xbb')](loggerCatch(_0xbe24('0x199')));if(_0x5272b7[_0xbe24('0x188')](0x0,_0x1372f0,_0x3a6ec3)){if(_0x39a051[_0xbe24('0x19a')]+_0x39a051[_0xbe24('0x189')]+_0x39a051[_0xbe24('0x18a')]>=_0x3a6ec3[_0xbe24('0x18b')]){_0x5272b7['stateGlobal'](_0x39a051,_0x281133,_0x3878b5,_0xbe24('0x19b'));}else{_0x5272b7[_0xbe24('0x19c')](_0x39a051,_0x281133,_0x3878b5,_0xbe24('0x19b'));}}break;case'3':_0x3a6ec3[_0xbe24('0x6a')]+=0x1;_0x39a051['state']=0x3;_0x39a051[_0xbe24('0xb2')]=_0xbe24('0x19d');_0x39a051['countnoanswerretry']+=0x1;_0x39a051[_0xbe24('0x19e')]+=0x1;_0x5272b7[_0xbe24('0xd2')](_0x39a051)[_0xbe24('0xbb')](loggerCatch(_0xbe24('0x19f')));if(_0x5272b7[_0xbe24('0x188')](0x3,_0x1372f0,_0x3a6ec3)){if(_0x39a051['countnoanswerretry']>=_0x3a6ec3[_0xbe24('0x18c')]){_0x5272b7['createStateFinal'](_0x39a051,_0x281133,_0x3878b5,'reason\x203\x20ringing\x20no\x20answer');}else{_0x5272b7[_0xbe24('0x1a0')](_0x39a051,_0x281133,_0x3878b5,_0xbe24('0x1a1'));}}break;case'5':_0x3a6ec3[_0xbe24('0x1a2')]+=0x1;_0x39a051[_0xbe24('0xb1')]=0x5;_0x39a051[_0xbe24('0xb2')]='Busy';_0x39a051[_0xbe24('0x19a')]+=0x1;_0x39a051[_0xbe24('0x19e')]+=0x1;_0x5272b7[_0xbe24('0xd2')](_0x39a051)[_0xbe24('0xbb')](loggerCatch(_0xbe24('0x1a3')));if(_0x5272b7[_0xbe24('0x188')](0x5,_0x1372f0,_0x3a6ec3)){if(_0x39a051[_0xbe24('0x19a')]>=_0x3a6ec3[_0xbe24('0x1a4')]){_0x5272b7[_0xbe24('0x19c')](_0x39a051,_0x281133,_0x3878b5,'reason\x205\x20busy');}else{_0x5272b7[_0xbe24('0x1a0')](_0x39a051,_0x281133,_0x3878b5,_0xbe24('0x1a5'));}}break;case'8':_0x3a6ec3[_0xbe24('0x68')]+=0x1;_0x39a051[_0xbe24('0xb1')]=0x8;_0x39a051[_0xbe24('0xb2')]=_0xbe24('0x1a6');_0x39a051[_0xbe24('0x189')]+=0x1;_0x39a051[_0xbe24('0x19e')]+=0x1;_0x5272b7[_0xbe24('0xd2')](_0x39a051)[_0xbe24('0xbb')](loggerCatch(_0xbe24('0x1a7')));if(_0x5272b7[_0xbe24('0x188')](0x8,_0x1372f0,_0x3a6ec3)){if(_0x39a051[_0xbe24('0x189')]>=_0x3a6ec3[_0xbe24('0x192')]){_0x5272b7['createStateFinal'](_0x39a051,_0x281133,_0x3878b5,_0xbe24('0x1a8'));}else{_0x5272b7[_0xbe24('0x1a0')](_0x39a051,_0x281133,_0x3878b5,_0xbe24('0x1a8'));}}break;default:_0x3a6ec3[_0xbe24('0x6f')]+=0x1;_0x39a051['state']=0xc;_0x39a051[_0xbe24('0xb2')]=_0x450f6c[_0xbe24('0x198')];_0x5272b7[_0xbe24('0xd2')](_0x39a051)[_0xbe24('0xbb')](loggerCatch(_0xbe24('0x1a9')));if(_0x5272b7[_0xbe24('0x188')](_0x450f6c[_0xbe24('0x198')],_0x1372f0,_0x3a6ec3)){if(_0x39a051[_0xbe24('0x19a')]+_0x39a051['countcongestionretry']+_0x39a051[_0xbe24('0x18a')]>=_0x3a6ec3[_0xbe24('0x18b')]){_0x5272b7['stateGlobal'](_0x39a051,_0x281133,_0x3878b5,_0x450f6c[_0xbe24('0x198')]);}else{_0x5272b7[_0xbe24('0x19c')](_0x39a051,_0x281133,_0x3878b5,_0x450f6c[_0xbe24('0x198')]);}}}});};Dialer[_0xbe24('0xb6')][_0xbe24('0x1a0')]=function(_0x38fb95,_0x34e6dd,_0x4387e7,_0x3be030){var _0x5f5570=new Final(_0x38fb95);_0x5f5570[_0xbe24('0xb1')]=0xf;_0x5f5570['statedesc']=_0xbe24('0x1aa');this[_0xbe24('0x19c')](_0x5f5570,_0x34e6dd,_0x4387e7,_0x3be030);};Dialer[_0xbe24('0xb6')][_0xbe24('0x19c')]=function(_0x32ea22,_0x539224,_0x3935ef,_0xa81fc8){this['moveContactManagedDialer'](_0x32ea22)[_0xbe24('0xc3')](function(_0x26463d){return _0x539224(msgResponse(_0xbe24('0x195'),_0xbe24('0x1ab'),_0xa81fc8));})[_0xbe24('0xbb')](function(_0x2a8c0f){return _0x3935ef(msgResponse(_0xbe24('0x1ac'),_0xbe24('0x134'),_0xbe24('0x1ad')));});};Dialer[_0xbe24('0xb6')][_0xbe24('0x9')]=function(_0x269166){var _0x1edcaa=this;var _0x18626f=_0x269166[_0xbe24('0x1ae')]/0x64;var _0x3a4bf8=_0x269166['outboundDropCallsDayTimeout']/(_0x269166[_0xbe24('0x1af')]+_0x269166['outboundAnswerCallsDay']);var _0x20a9d0=Math[_0xbe24('0x1b0')](_0x269166['predictiveIntervalAvailable']*(_0x269166['predictiveIntervalMaxThreshold']/0x64));var _0x1c8db4=Math[_0xbe24('0x1b0')](_0x269166[_0xbe24('0x79')]*(_0x269166[_0xbe24('0x1b1')]/0x64));var _0x239815=_0x269166[_0xbe24('0x56')]+_0x269166[_0xbe24('0x5c')];var _0x1ea586=Math[_0xbe24('0x1b2')](_0x269166[_0xbe24('0x7c')]*_0x269166[_0xbe24('0x7d')]*_0x269166[_0xbe24('0x1b3')]*_0x269166['predictiveIntervalMultiplicativeFactor']);if(_[_0xbe24('0x8d')](_0x269166['startProgressive'])){if(!_[_0xbe24('0x8d')](_0x269166[_0xbe24('0x2b')])){_0x269166[_0xbe24('0x2b')]=undefined;loggerPredictive[_0xbe24('0x9f')](_0xbe24('0x1b4'),_0xbe24('0x1b5'));}if(!_['isUndefined'](_0x269166[_0xbe24('0x9a')])){loggerPredictive['error']('[startMethodPredictive][StartProgressive]',_0xbe24('0x1b6'));clearInterval(_0x269166[_0xbe24('0x9a')]);_0x269166[_0xbe24('0x9a')]=undefined;}_0x269166[_0xbe24('0x2c')]=moment()[_0xbe24('0x81')](_0xbe24('0x10a'));loggerPredictive[_0xbe24('0x87')](_0x269166[_0xbe24('0x46')],_0xbe24('0x1b7'),_0x269166[_0xbe24('0x2c')]);this[_0xbe24('0x147')](_0x269166,0x1);}else if(ifInterval(_0x269166['dialPredictiveInterval'],_0x269166['startProgressive'])){this['handlePower'](_0x269166,0x1);loggerPredictiveCalls['info'](_0xbe24('0x1b8'),_0x269166[_0xbe24('0x2c')],_0x269166['name']);_0x269166[_0xbe24('0x7c')]=0x0;_0x269166[_0xbe24('0x76')]=0x0;}else if(_0x18626f<_0x3a4bf8&&_0x269166[_0xbe24('0x1b9')]==='dropRate'){freeVariablesPredictive(_0x269166);loggerPredictive[_0xbe24('0x87')](_0xbe24('0x1ba'),'Dropped\x20calls\x20day',_0x3a4bf8,_0xbe24('0x2c'),_0x269166['name']);}else if(_0x1ea586<_0x269166[_0xbe24('0x76')]&&_0x269166[_0xbe24('0x1b9')]===_0xbe24('0x1bb')){freeVariablesPredictive(_0x269166);loggerPredictive[_0xbe24('0x87')](_0xbe24('0x1bc'),_0xbe24('0x1bd'),_0x1ea586,_0xbe24('0x1be'),_0x269166[_0xbe24('0x76')],'startProgressive',_0x269166['name']);}else if(!ifInterval(_0x269166[_0xbe24('0x1bf')],_0x269166[_0xbe24('0x2c')])&&_[_0xbe24('0x8d')](_0x269166['startPredictive'])&&!_[_0xbe24('0x8d')](_0x269166[_0xbe24('0x2c')])){_0x269166[_0xbe24('0x2b')]=moment()[_0xbe24('0x81')](_0xbe24('0x10a'));loggerPredictive[_0xbe24('0x87')](_0x269166[_0xbe24('0x46')],_0xbe24('0x1c0'),_0x269166['startPredictive']);this[_0xbe24('0x1c1')](_0x269166[_0xbe24('0x1bf')])[_0xbe24('0xc3')](this[_0xbe24('0x1c2')](_0x269166))[_0xbe24('0xc3')](mergeDataErlangB(_0x269166))[_0xbe24('0xc3')](this[_0xbe24('0x1c3')](_0x269166))[_0xbe24('0xbb')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x269166));}else if(!ifInterval(_0x269166[_0xbe24('0x1bf')],_0x269166['startPredictive'])){_0x269166[_0xbe24('0x76')]=0x0;_0x269166[_0xbe24('0x2b')]=moment()[_0xbe24('0x81')](_0xbe24('0x10a'));loggerPredictive[_0xbe24('0x87')](_0x269166[_0xbe24('0x46')],_0xbe24('0x1c4'),_0x269166[_0xbe24('0x2b')]);clearInterval(_0x269166[_0xbe24('0x9a')]);_0x269166[_0xbe24('0x9a')]=undefined;this[_0xbe24('0x1c1')](_0x269166['dialPredictiveInterval'])[_0xbe24('0xc3')](this['getDataPredictive'](_0x269166))['then'](mergeDataErlangB(_0x269166))[_0xbe24('0xc3')](this[_0xbe24('0x1c3')](_0x269166))[_0xbe24('0xbb')](loggerCatchPredictive(_0xbe24('0x1c5'),_0x269166));}else if(_0x269166['predictiveIntervalAvailable']&&_0x239815<_0x269166[_0xbe24('0x79')]-_0x1c8db4){freeVariablesPredictive(_0x269166);loggerPredictive[_0xbe24('0x87')](_0x269166['name'],_0xbe24('0x1c6'),_0x239815,')\x20are\x20less\x20than\x20threshold\x20(',_0x269166[_0xbe24('0x79')],'-',_0x1c8db4,'=',_0x269166[_0xbe24('0x79')]-_0x1c8db4,')');}else if(_0x269166[_0xbe24('0x79')]&&_0x239815>_0x269166[_0xbe24('0x79')]+_0x20a9d0){freeVariablesPredictive(_0x269166);loggerPredictive[_0xbe24('0x87')](_0x269166[_0xbe24('0x46')],_0xbe24('0x1c6'),_0x239815,_0xbe24('0x1c7'),_0x269166['predictiveIntervalAvailable'],'+',_0x20a9d0,'=',_0x269166[_0xbe24('0x79')]+_0x20a9d0,')');}};Dialer['prototype'][_0xbe24('0x1c2')]=function(_0x331789){var _0x3e16fe=this;return function(_0x191404){return new BPromise(function(_0x254e25,_0x536648){_[_0xbe24('0xd9')](_0x331789,_0x191404[0x0]);if(checkGetDataPredictive(_0x191404[0x0])){var _0x41520b=_0x331789[_0xbe24('0x79')]=_0x331789[_0xbe24('0x5c')]+_0x331789['available'];var _0x542eff=_0x331789[_0xbe24('0x1bf')]*0x3c;var _0x4f9cd7=_0x191404[0x0]['predictiveIntervalAvgTalktime']+_0x191404[0x0][_0xbe24('0x71')];var _0x58c345=(_0x191404[0x0][_0xbe24('0x70')]+_0x191404[0x0][_0xbe24('0x74')]+_0x191404[0x0][_0xbe24('0x73')])/_0x191404[0x0][_0xbe24('0x7a')];_0x331789[_0xbe24('0x1b3')]=_0x58c345>0x0?_0x58c345:0x1;switch(_0x331789[_0xbe24('0x1b9')]){case _0xbe24('0x1bb'):var _0x21d721=_0x331789[_0xbe24('0x1ae')]/0x64;return _0x3e16fe[_0xbe24('0x1c8')](_0x41520b,_0x542eff,_0x4f9cd7,_0x58c345,_0x21d721)[_0xbe24('0xc3')](function(_0x43c946){return _0x254e25(_0x43c946);});case _0xbe24('0x1c9'):var _0x2cd5d3=_0x331789['dialPredictiveOptimizationPercentage']/0x64;return _0x3e16fe[_0xbe24('0x1ca')](_0x41520b,_0x542eff,_0x4f9cd7,_0x58c345,_0x2cd5d3)['then'](function(_0x193744){return _0x254e25(_0x193744);});default:return _0x536648(msgResponse(_0xbe24('0x1cb'),_0xbe24('0x134'),_0xbe24('0x1cc')));}}else{return _0x536648(msgResponse(_0xbe24('0x1cb'),_0xbe24('0x134'),_0xbe24('0x1cd')));}});};};Dialer[_0xbe24('0xb6')][_0xbe24('0x1ce')]=function(_0x3ebf96){var _0x1a580a=this;return function(_0x2b0611){return new BPromise(function(_0x17d8c8,_0x4f9b7b){_['merge'](_0x3ebf96,_0x2b0611[0x0]);if(checkGetDataPredictive(_0x2b0611[0x0])){loggerPredictive[_0xbe24('0x87')](JSON[_0xbe24('0x4e')](_0x2b0611[0x0]));if(_0x3ebf96['dialPredictiveOptimization']===_0xbe24('0x1bb')){return _0x1a580a[_0xbe24('0xce')](_0x3ebf96['id'])[_0xbe24('0xc3')](function(_0x3290c3){var _0x4f2d4a=_0x3ebf96[_0xbe24('0x57')]-_0x3290c3[0x0][_0xbe24('0x1cf')];var _0xe506dd=_0x3ebf96['dialPredictiveInterval']*0x3c;var _0x3d9b29=_0x2b0611[0x0][_0xbe24('0x72')]+_0x2b0611[0x0][_0xbe24('0x71')];var _0x53f92f=(_0x2b0611[0x0]['predictiveIntervalAnsweredCalls']+_0x2b0611[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x2b0611[0x0][_0xbe24('0x73')])/_0x2b0611[0x0]['predictiveIntervalTotalCalls'];var _0x4ea248=_0x3ebf96[_0xbe24('0x1ae')]/0x64;_0x3ebf96[_0xbe24('0x78')]=_0x3290c3[0x0][_0xbe24('0x1cf')]||0x0;_0x3ebf96['predictiveIntervalHitRate']=_0x53f92f>0x0?_0x53f92f:0x1;return _0x1a580a[_0xbe24('0x1c8')](_0x4f2d4a,_0xe506dd,_0x3d9b29,_0x53f92f,_0x4ea248);})[_0xbe24('0xc3')](function(_0x517f1b){return _0x17d8c8(_0x517f1b);})['catch'](function(_0x868ed3){return _0x4f9b7b(msgResponse(_0xbe24('0x1d0'),'Failure',JSON['stringify'](_0x868ed3)));});}if(_0x3ebf96[_0xbe24('0x1b9')]===_0xbe24('0x1c9')){return _0x1a580a[_0xbe24('0xce')](_0x3ebf96['id'])[_0xbe24('0xc3')](function(_0x4ca57b){var _0x26c408=_0x3ebf96['loggedIn']-_0x4ca57b[0x0]['outboundQueuePauses'];var _0x832c5e=_0x3ebf96['dialPredictiveInterval']*0x3c;var _0x4348c6=_0x2b0611[0x0][_0xbe24('0x72')]+_0x2b0611[0x0][_0xbe24('0x71')];var _0x4b525d=(_0x2b0611[0x0]['predictiveIntervalAnsweredCalls']+_0x2b0611[0x0][_0xbe24('0x74')]+_0x2b0611[0x0][_0xbe24('0x73')])/_0x2b0611[0x0][_0xbe24('0x7a')];var _0x183c04=_0x3ebf96['dialPredictiveOptimizationPercentage']/0x64;_0x3ebf96[_0xbe24('0x78')]=_0x4ca57b[0x0]['outboundQueuePauses']||0x0;_0x3ebf96[_0xbe24('0x1b3')]=_0x4b525d>0x0?_0x4b525d:0x1;return _0x1a580a[_0xbe24('0x1ca')](_0x26c408,_0x832c5e,_0x4348c6,_0x4b525d,_0x183c04);})[_0xbe24('0xc3')](function(_0x4491d7){return _0x17d8c8(_0x4491d7);})[_0xbe24('0xbb')](function(_0x282603){return _0x4f9b7b(msgResponse(_0xbe24('0x1d0'),_0xbe24('0x134'),JSON[_0xbe24('0x4e')](_0x282603)));});}}else{return _0x4f9b7b(msgResponse('[getDataPredictive]',_0xbe24('0x134'),_0xbe24('0x1cd')));}});};};Dialer[_0xbe24('0xb6')][_0xbe24('0x1c3')]=function(_0x17516e){var _0x1b272c=this;return function(){var _0x57b514=0x0;var _0x37b032=Math[_0xbe24('0x1b2')](_0x17516e['erlangCallToSecond']*0x3e8);if(_0x37b032>0x0){_0x37b032=_0x37b032<0x64?0x64:_0x37b032;loggerPredictive[_0xbe24('0x87')](_0x17516e[_0xbe24('0x46')],_0xbe24('0x1d1'),_0x37b032,_0xbe24('0x4f'));_0x17516e['handlePredictive']=setInterval(function(){_0x1b272c[_0xbe24('0x9a')](_0x17516e);loggerPredictiveCalls['info'](_0xbe24('0x1d2'),_0x57b514+=0x1);},_0x37b032);}else{loggerPredictive['info'](_0x17516e[_0xbe24('0x46')],_0xbe24('0x1d3'));}};};Dialer[_0xbe24('0xb6')][_0xbe24('0x1d4')]=function(_0x12750a,_0xe1def3){var _0x4094a2=this;return function(_0x591ce9){if(_[_0xbe24('0x86')](_0x591ce9)){if(_[_0xbe24('0xe7')](_0xe1def3[_0xbe24('0xdb')])||!_0xe1def3[_0xbe24('0x1d5')]){if(_0x12750a[_0xbe24('0x61')]===_0xbe24('0x7')){_0x12750a[_0xbe24('0x119')]=_[_0xbe24('0x8d')](_0x12750a[_0xbe24('0x119')])?!![]:_0x12750a[_0xbe24('0x119')];var _0x388d19=uuid['v4']();_0x4094a2[_0xbe24('0x27')][_0x388d19]=new Action(_0x12750a,_0xe1def3,_0x388d19);loggerBooked['info'](_0xbe24('0x1d6'),_0x388d19,_0xbe24('0x1d7'),JSON[_0xbe24('0x4e')](_0x12750a['queueStatusComplete']),_0xbe24('0x1d8'),_0x12750a[_0xbe24('0x46')]);if(_0x12750a[_0xbe24('0x119')]){_0x12750a['queueStatusComplete']=![];_0x4094a2[_0xbe24('0x116')][_0x4094a2[_0xbe24('0x27')][_0x388d19]['queue']]=[];ami[_0xbe24('0xb9')]({'actionid':_0x388d19,'action':'queuestatus','queue':_0x12750a['name']})[_0xbe24('0xbb')](function(_0x214f7a){_0x4094a2['updateOriginated'](_0x12750a);_0x4094a2[_0xbe24('0xc9')]({'active':![],'ContactId':_0x4094a2[_0xbe24('0x27')][_0x388d19][_0xbe24('0x11e')],'ListId':_0x4094a2[_0xbe24('0x27')][_0x388d19]['ListId'],'VoiceQueueId':_0x4094a2[_0xbe24('0x27')][_0x388d19][_0xbe24('0xdc')]||undefined,'CampaignId':_0x4094a2[_0xbe24('0x27')][_0x388d19]['CampaignId']||undefined})[_0xbe24('0xbb')](loggerCatch(_0xbe24('0x1d9')));delete _0x4094a2[_0xbe24('0x27')][_0x388d19];});}else{loggerBooked[_0xbe24('0x87')](_0xbe24('0x1da'),JSON[_0xbe24('0x4e')](_0x12750a[_0xbe24('0x119')]),_0xbe24('0x1d8'),_0x12750a[_0xbe24('0x46')]);_0x4094a2['updateOriginated'](_0x12750a);_0x4094a2[_0xbe24('0xc9')]({'active':![],'ContactId':_0x4094a2[_0xbe24('0x27')][_0x388d19]['ContactId'],'ListId':_0x4094a2['actions'][_0x388d19][_0xbe24('0xda')],'VoiceQueueId':_0x4094a2[_0xbe24('0x27')][_0x388d19][_0xbe24('0xdc')]||undefined,'CampaignId':_0x4094a2[_0xbe24('0x27')][_0x388d19][_0xbe24('0xdd')]||undefined})[_0xbe24('0xbb')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x4094a2['actions'][_0x388d19];}}else{return _0x4094a2[_0xbe24('0x155')](_0x12750a,_0xe1def3);}}else{if(getDiff(_0xe1def3[_0xbe24('0x1db')])<_0x12750a['dialRecallMeTimeout']*0x3c){_0x4094a2[_0xbe24('0x21')]['run'](_0xe1def3['id'])['finally'](function(){_0x4094a2[_0xbe24('0xbf')](_0x12750a);});}else{_0x12750a['outboundReCallsDay']+=0x1;_0x4094a2[_0xbe24('0xbf')](_0x12750a);if(_0x12750a[_0xbe24('0x1dc')]){_0x4094a2[_0xbe24('0xc9')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0xe1def3[_0xbe24('0x11e')],'ListId':_0xe1def3[_0xbe24('0xda')],'VoiceQueueId':_0xe1def3[_0xbe24('0xdc')]||undefined,'CampaignId':_0xe1def3[_0xbe24('0xdd')]||undefined})[_0xbe24('0xbb')](loggerCatch(_0xbe24('0x1dd')));_0x4094a2[_0xbe24('0xd2')](createObjHistory(_0x12750a,_0xe1def3,_0xbe24('0x1de'),0x17,_0xbe24('0x1df')))[_0xbe24('0xbb')](loggerCatch(_0xbe24('0x1e0')));}else{_0x4094a2['saveInDb'](createObjHistory(_0x12750a,_0xe1def3,'RECALLFAILEDTIMEOUT',0x16,_0xbe24('0x1e1')),_0xbe24('0x1e2'),_0xbe24('0x1e3'));}}}}else{_0x12750a[_0xbe24('0x67')]+=0x1;_0x4094a2[_0xbe24('0xd8')](createObjHistory(_0x12750a,_0xe1def3,_0xbe24('0x1e4'),0xd,_0xbe24('0x1e5')),_0xbe24('0x1e6'),'[Originate][MoveBlacklist]');throw _0xbe24('0x1e7');}};};Dialer[_0xbe24('0xb6')][_0xbe24('0x14c')]=function(_0x533381){var _0x13be13=this;var _0x46060d=[];var _0x5356ed=_0x533381['limitCalls']-_0x533381[_0xbe24('0x7b')]-_0x533381[_0xbe24('0x1e8')];emitCampaignSummary(_0x533381);if(_0x5356ed>0x0){if(_0x5356ed>this[_0xbe24('0x26')]){_0x5356ed=this[_0xbe24('0x26')];}_0x533381[_0xbe24('0x1e8')]+=_0x5356ed;this[_0xbe24('0xcd')](_0x533381['id'],_0x5356ed,_0x533381[_0xbe24('0x1e9')])['then'](function(_0x396cd7){_0x533381[_0xbe24('0x1e8')]-=_0x5356ed;_0x533381['temp']=_0x533381[_0xbe24('0x1e8')]>0x0?_0x533381[_0xbe24('0x1e8')]:0x0;if(!checkContactEmpty(_0x396cd7)){_0x533381[_0xbe24('0x44')]=_0xbe24('0xa9');logger[_0xbe24('0x87')](_0xbe24('0x1ea')+_0x533381[_0xbe24('0x46')]);}else{_0x533381[_0xbe24('0x7b')]+=_0x396cd7[_0xbe24('0xa1')];_0x533381['message']=_0xbe24('0x1eb');for(var _0xdc9178=0x0;_0xdc9178<_0x396cd7[_0xbe24('0xa1')];_0xdc9178+=0x1){_0x533381[_0xbe24('0x1ec')]+=0x1;if(_[_0xbe24('0xe7')](_0x396cd7[_0xdc9178])||_[_0xbe24('0xe7')](_0x396cd7[_0xdc9178]['Contact'])||_['isNil'](_0x396cd7[_0xdc9178][_0xbe24('0x159')][_0xbe24('0x15a')])){_0x13be13[_0xbe24('0xd6')]('[actionOriginate]\x20',_0x533381,_0x396cd7[_0xdc9178]);}else{_0x13be13[_0xbe24('0xc7')](_[_0xbe24('0x11c')](_0x396cd7[_0xdc9178],[_0xbe24('0xdd'),_0xbe24('0x1ed')]))[_0xbe24('0xc3')](_0x13be13[_0xbe24('0x1d4')](_0x533381,_0x396cd7[_0xdc9178]))[_0xbe24('0xbb')](_0x13be13[_0xbe24('0x1ee')](_0xbe24('0x1ef'),_0x533381));}}}})['catch'](loggerGetContactDialer('[getContactCampaign2]',_0x533381,_0x5356ed));}};Dialer[_0xbe24('0xb6')][_0xbe24('0x147')]=function(_0x2a1440,_0x32d00b){var _0x47291b=this;var _0x314b2c=[];var _0x331366=_0x32d00b>=0x1?_0x32d00b:0x1;var _0x240d9b=[];if(_0x2a1440['dialMethod']===_0xbe24('0x7')){_0x331366=0x1;}var _0x3963c2=Math[_0xbe24('0x1b2')](_0x2a1440[_0xbe24('0x56')]*_0x331366)-_0x2a1440['originated']-_0x2a1440[_0xbe24('0x1e8')];emitVoiceQueueSummary(_0x2a1440);if(_0x2a1440['dialLimitQueue']>0x0){var _0x43dea2=_0x2a1440[_0xbe24('0x1f0')]-_0x2a1440[_0xbe24('0x7b')]-_0x2a1440['talking']-_0x2a1440[_0xbe24('0x1e8')]-_0x2a1440[_0xbe24('0x58')];if(_0x3963c2>_0x43dea2){_0x3963c2=_0x43dea2;}}if(_0x3963c2>0x0){if(_0x2a1440['dialMethod']===_0xbe24('0x7')){_0x3963c2=0x1;}if(_0x3963c2>this['maxNumberOriginate']){_0x3963c2=this[_0xbe24('0x26')];}_0x2a1440[_0xbe24('0x1e8')]+=_0x3963c2;for(var _0x5027c3 in this[_0xbe24('0x24')]){if(this[_0xbe24('0x24')][_0xbe24('0xa2')](_0x5027c3)){if(this[_0xbe24('0x24')][_0x5027c3][_0xbe24('0xb1')]===_0xbe24('0x1f1')&&this['agents'][_0x5027c3][_0xbe24('0xe2')]===_0xbe24('0xe3')){_0x314b2c[_0xbe24('0x117')](this[_0xbe24('0x24')][_0x5027c3]['id']);}}}this[_0xbe24('0xcb')](_0x2a1440['id'],_0x314b2c,_0x3963c2,_0x2a1440['dialOrderByScheduledAt'])['then'](function(_0xa43a81){_0x2a1440[_0xbe24('0x1e8')]-=_0x3963c2;_0x2a1440[_0xbe24('0x1e8')]=_0x2a1440[_0xbe24('0x1e8')]>0x0?_0x2a1440[_0xbe24('0x1e8')]:0x0;if(!checkContactEmpty(_0xa43a81)){_0x47291b['countReScheduled'](_0x2a1440)[_0xbe24('0xc3')](sendMessageReschedule(_0x2a1440))[_0xbe24('0xbb')](loggerCatch(_0xbe24('0xc4')));}else{_0x2a1440['originated']+=_0xa43a81[_0xbe24('0xa1')];_0x2a1440['message']=_0x2a1440[_0xbe24('0x61')]===_0xbe24('0x7')?_0xbe24('0x160'):_0xbe24('0x1eb');for(var _0x51bd67=0x0;_0x51bd67<_0xa43a81[_0xbe24('0xa1')];_0x51bd67+=0x1){if(_[_0xbe24('0xe7')](_0xa43a81[_0x51bd67])||_[_0xbe24('0xe7')](_0xa43a81[_0x51bd67][_0xbe24('0x159')])||_[_0xbe24('0xe7')](_0xa43a81[_0x51bd67][_0xbe24('0x159')][_0xbe24('0x15a')])){_0x47291b['emptyContact']('[actionOriginate]\x20',_0x2a1440,_0xa43a81[_0x51bd67]);}else{_0x47291b[_0xbe24('0xc5')](_[_0xbe24('0x11c')](_0xa43a81[_0x51bd67],[_0xbe24('0xdc'),'Contact.phone']))['then'](_0x47291b[_0xbe24('0x1d4')](_0x2a1440,_0xa43a81[_0x51bd67]))[_0xbe24('0xbb')](_0x47291b[_0xbe24('0x1ee')]('[actionOriginate]\x20',_0x2a1440));}}}})['catch'](loggerGetContactDialer('[getContactDialer2]',_0x2a1440,_0x3963c2));}};Dialer[_0xbe24('0xb6')][_0xbe24('0x9a')]=function(_0xb709c5){var _0x5d55e2=this;if(_0xb709c5[_0xbe24('0x1f0')]>0x0){var _0x25bda4=_0xb709c5[_0xbe24('0x1f0')]-_0xb709c5[_0xbe24('0x7b')]-_0xb709c5[_0xbe24('0x5c')];if(_0x25bda4>0x0){this[_0xbe24('0x1f2')](_0xb709c5);}else{loggerPredictiveCalls[_0xbe24('0x87')]('[handlePredictive][limitChannel]');}}else{this['tryOriginatePredictive'](_0xb709c5);}};Dialer['prototype'][_0xbe24('0x1f2')]=function(_0x27db93){var _0x4e1313=this;var _0x4bd3e7=[];_0x27db93[_0xbe24('0x7b')]+=0x1;for(var _0x32ae9b in this[_0xbe24('0x24')]){if(this['agents'][_0xbe24('0xa2')](_0x32ae9b)){if(this[_0xbe24('0x24')][_0x32ae9b]['state']===_0xbe24('0x1f1')&&this[_0xbe24('0x24')][_0x32ae9b][_0xbe24('0xe2')]==='reachable'){_0x4bd3e7[_0xbe24('0x117')](this[_0xbe24('0x24')][_0x32ae9b]['id']);}}}this[_0xbe24('0xcb')](_0x27db93['id'],_0x4bd3e7,0x1,_0x27db93['dialOrderByScheduledAt'])[_0xbe24('0xc3')](function(_0x3522ed){if(!checkContactEmpty(_0x3522ed)){checkContactLowerLimitOriginate(_0x27db93,0x1,0x0);_0x4e1313[_0xbe24('0xc1')](_0x27db93)[_0xbe24('0xc3')](sendMessageReschedule(_0x27db93))['catch'](loggerCatch(_0xbe24('0xc4')));}else{_0x27db93[_0xbe24('0x44')]=_0xbe24('0x1eb');if(_[_0xbe24('0xe7')](_0x3522ed[0x0])||_[_0xbe24('0xe7')](_0x3522ed[0x0][_0xbe24('0x159')])||_['isNil'](_0x3522ed[0x0][_0xbe24('0x159')][_0xbe24('0x15a')])){_0x4e1313[_0xbe24('0xd6')](_0xbe24('0x1f3'),_0x27db93,_0x3522ed[0x0]);}else{_0x4e1313[_0xbe24('0xc5')](_[_0xbe24('0x11c')](_0x3522ed[0x0],[_0xbe24('0xdc'),_0xbe24('0x1ed')]))[_0xbe24('0xc3')](_0x4e1313['checkContactBlack'](_0x27db93,_0x3522ed[0x0]))[_0xbe24('0xbb')](_0x4e1313[_0xbe24('0x1ee')](_0xbe24('0x1f4'),_0x27db93));}}})[_0xbe24('0xbb')](loggerGetContactDialer(_0xbe24('0x1f5'),_0x27db93,0x1));emitVoiceQueueSummary(_0x27db93);};Dialer[_0xbe24('0xb6')][_0xbe24('0x1c8')]=function(_0x23ec42,_0x58fa8e,_0x210c58,_0x1d7926,_0x5a2f69,_0x29e9b7){loggerPredictive['info'](_0xbe24('0x1f6'));loggerPredictive[_0xbe24('0x87')](_0xbe24('0x1f7'),_0x23ec42);loggerPredictive['info'](_0xbe24('0x1f8'),_0x58fa8e);loggerPredictive[_0xbe24('0x87')](_0xbe24('0x1f9'),_0x210c58);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',_0x1d7926);loggerPredictive[_0xbe24('0x87')](_0xbe24('0x1fa'),_0x5a2f69);loggerPredictive[_0xbe24('0x87')](_0xbe24('0x97'));return new BPromise(function(_0xb4bbc5,_0x44b2a0){if(_0x23ec42<=0x0||isNaN(_0x23ec42)){return _0x44b2a0(msgResponse(_0xbe24('0x1fb'),_0xbe24('0x4d'),_0xbe24('0x1fc')+_0x23ec42));}if(_0x210c58<=0x0||isNaN(_0x210c58)){return _0x44b2a0(msgResponse(_0xbe24('0x1fb'),_0xbe24('0x4d'),_0xbe24('0x1fd')+_0x210c58));}if(_0x1d7926<=0x0||isNaN(_0x1d7926)){return _0x44b2a0(msgResponse(_0xbe24('0x1fb'),_0xbe24('0x4d'),_0xbe24('0x1fe')+_0x1d7926));}if(_0x58fa8e<=0x0||isNaN(_0x58fa8e)){return _0x44b2a0(msgResponse('[abandonmentRate]','Error',_0xbe24('0x1ff')+_0x58fa8e));}if(_0x5a2f69<=0x0||isNaN(_0x5a2f69)){return _0x44b2a0(msgResponse('[abandonmentRate]',_0xbe24('0x4d'),'Amax\x20=\x20'+_0x5a2f69));}_0x29e9b7=_0x29e9b7||0x0;var _0x46ad4a=0x1/_0x210c58;var _0xef6d14=0x0;var _0x48498b=0x0;var _0x28c79e=0x0;var _0x36f8af=0x0;for(var _0x51ed03=0x0;_0x28c79e<_0x5a2f69;_0x51ed03+=0x1){_0x48498b=_0x51ed03/_0x58fa8e;_0xef6d14=(_0x1d7926*_0x48498b+_0x29e9b7)/_0x46ad4a;_0x28c79e=erlangb(_0xef6d14,_0x23ec42);_0x36f8af=_0xef6d14/_0x23ec42*(0x1-erlangb(_0xef6d14,_0x23ec42));}return _0xb4bbc5({'erlangCalls':_0x51ed03,'erlangCallToSecond':_0x58fa8e/_0x51ed03,'erlangAbandonmentRate':_0x28c79e,'erlangBusyFactor':_0x36f8af});});};Dialer['prototype'][_0xbe24('0x1ca')]=function(_0x59790e,_0x2835b1,_0x4e0d3d,_0x403078,_0x182a39,_0x21bb73){loggerPredictive[_0xbe24('0x87')](_0xbe24('0x200'));loggerPredictive[_0xbe24('0x87')]('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',_0x59790e);loggerPredictive[_0xbe24('0x87')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2835b1);loggerPredictive[_0xbe24('0x87')](_0xbe24('0x1f9'),_0x4e0d3d);loggerPredictive[_0xbe24('0x87')](_0xbe24('0x201'),_0x403078);loggerPredictive[_0xbe24('0x87')](_0xbe24('0x202'),_0x182a39);loggerPredictive[_0xbe24('0x87')](_0xbe24('0x97'));return new BPromise(function(_0x353b37,_0x3fcabe){if(_0x59790e<=0x0||isNaN(_0x59790e)){return _0x3fcabe(msgResponse(_0xbe24('0x203'),'Error','m\x20=\x20'+_0x59790e));}if(_0x4e0d3d<=0x0||isNaN(_0x4e0d3d)){return _0x3fcabe(msgResponse(_0xbe24('0x203'),_0xbe24('0x4d'),_0xbe24('0x1fd')+_0x4e0d3d));}if(_0x403078<=0x0||isNaN(_0x403078)){return _0x3fcabe(msgResponse(_0xbe24('0x203'),_0xbe24('0x4d'),_0xbe24('0x1fe')+_0x403078));}if(_0x2835b1<=0x0||isNaN(_0x2835b1)){return _0x3fcabe(msgResponse(_0xbe24('0x203'),'Error',_0xbe24('0x1ff')+_0x2835b1));}if(_0x182a39<=0x0||isNaN(_0x182a39)){return _0x3fcabe(msgResponse('[busyFactor]',_0xbe24('0x4d'),_0xbe24('0x204')+_0x182a39));}_0x21bb73=_0x21bb73||0x0;var _0x13a27e=0x1/_0x4e0d3d;var _0x563944=0x0;var _0x219ab9=0x0;var _0xf90485=0x0;var _0x4a5dba=0x0;for(var _0x2f00de=0x0;_0x4a5dba<_0x182a39;_0x2f00de+=0x1){_0x219ab9=_0x2f00de/_0x2835b1;_0x563944=(_0x403078*_0x219ab9+_0x21bb73)/_0x13a27e;_0xf90485=erlangb(_0x563944,_0x59790e);_0x4a5dba=_0x563944/_0x59790e*(0x1-erlangb(_0x563944,_0x59790e));}return _0x353b37({'erlangCalls':_0x2f00de,'erlangCallToSecond':_0x2835b1/_0x2f00de,'erlangAbandonmentRate':_0xf90485,'erlangBusyFactor':_0x4a5dba});});};module[_0xbe24('0x205')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 1e3d5ef..3e9bf3e 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 _0x1e86=['originatecalleridname','util','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','uniqueid','name','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','queue','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum'];(function(_0x28c3f4,_0x52f8e6){var _0x1388a8=function(_0x46f5a6){while(--_0x46f5a6){_0x28c3f4['push'](_0x28c3f4['shift']());}};_0x1388a8(++_0x52f8e6);}(_0x1e86,0x173));var _0x61e8=function(_0x1d5f65,_0x92be4){_0x1d5f65=_0x1d5f65-0x0;var _0x35103d=_0x1e86[_0x1d5f65];return _0x35103d;};'use strict';var util=require(_0x61e8('0x0'));var _=require('lodash');var moment=require(_0x61e8('0x1'));function getSeconds(_0x3ed1c6,_0x141634){var _0x31f899=moment(_0x3ed1c6)[_0x61e8('0x2')](0x0);var _0x524051=moment(_0x141634)[_0x61e8('0x2')](0x0);return _0x31f899[_0x61e8('0x3')](_0x524051,_0x61e8('0x4'));}function QueueCallerAbandon(_0x1a23c1,_0x172da5){this[_0x61e8('0x5')]=_0x1a23c1[_0x61e8('0x5')];this[_0x61e8('0x6')]=_0x1a23c1['type'];this[_0x61e8('0x7')]=_0x1a23c1[_0x61e8('0x6')]==='outbound'?'queue':_0x1a23c1[_0x61e8('0x6')];this[_0x61e8('0x8')]=_0x1a23c1[_0x61e8('0x8')];this[_0x61e8('0x9')]=_0x1a23c1[_0x61e8('0x9')];this[_0x61e8('0xa')]=_0x1a23c1[_0x61e8('0xa')];this['countglobal']=_0x1a23c1[_0x61e8('0x8')]+_0x1a23c1[_0x61e8('0x9')]+_0x1a23c1[_0x61e8('0xa')];this['uniqueid']=_0x172da5[_0x61e8('0xb')];this['calleridname']=_0x1a23c1[_0x61e8('0xc')];this[_0x61e8('0xd')]=_0x1a23c1[_0x61e8('0xe')];this['starttime']=_0x1a23c1[_0x61e8('0xf')];this[_0x61e8('0x10')]=_0x1a23c1[_0x61e8('0x10')];this['droptime']=_0x1a23c1[_0x61e8('0x11')];this[_0x61e8('0x12')]=this[_0x61e8('0x11')];this[_0x61e8('0x13')]=getSeconds(_0x1a23c1[_0x61e8('0x10')],_0x1a23c1[_0x61e8('0xf')]);this[_0x61e8('0x14')]=getSeconds(this['droptime'],_0x1a23c1['responsetime']);this[_0x61e8('0x15')]=0x0;this[_0x61e8('0x16')]=_0x172da5[_0x61e8('0x16')];this[_0x61e8('0x17')]=_0x172da5[_0x61e8('0x18')];this[_0x61e8('0x19')]=_0x172da5['reason'];this[_0x61e8('0x1a')]=_0x1a23c1[_0x61e8('0x1a')];this[_0x61e8('0x1b')]=_0x1a23c1[_0x61e8('0x1b')];this[_0x61e8('0x1c')]=_0x1a23c1[_0x61e8('0x1c')];this[_0x61e8('0x1d')]=_0x1a23c1[_0x61e8('0x1d')];this[_0x61e8('0x1e')]=_0x1a23c1[_0x61e8('0x1e')];this[_0x61e8('0x1f')]=_0x1a23c1[_0x61e8('0x1f')];this[_0x61e8('0x20')]=_0x1a23c1[_0x61e8('0x20')];this[_0x61e8('0x21')]=_0x1a23c1['VoiceQueueId'];this[_0x61e8('0x22')]=_0x1a23c1[_0x61e8('0x22')];this[_0x61e8('0x23')]=_0x1a23c1[_0x61e8('0x23')]||'';this[_0x61e8('0x24')]=_0x1a23c1['originatecalleridname']||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file +var _0xb1a5=['countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','name','number','starttime','responsetime','droptime','endtime','ringtime','talktime','queue','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','scheduledat','type','campaigntype','outbound'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb1a5,0x1cd));var _0x5b1a=function(_0x551728,_0x41deee){_0x551728=_0x551728-0x0;var _0x378098=_0xb1a5[_0x551728];return _0x378098;};'use strict';var util=require(_0x5b1a('0x0'));var _=require('lodash');var moment=require(_0x5b1a('0x1'));function getSeconds(_0x13cf40,_0x2194d2){var _0x4103ab=moment(_0x13cf40)[_0x5b1a('0x2')](0x0);var _0x257233=moment(_0x2194d2)[_0x5b1a('0x2')](0x0);return _0x4103ab['diff'](_0x257233,'seconds');}function QueueCallerAbandon(_0x32dc49,_0x3e5529){this[_0x5b1a('0x3')]=_0x32dc49[_0x5b1a('0x3')];this['type']=_0x32dc49[_0x5b1a('0x4')];this[_0x5b1a('0x5')]=_0x32dc49[_0x5b1a('0x4')]===_0x5b1a('0x6')?'queue':_0x32dc49[_0x5b1a('0x4')];this[_0x5b1a('0x7')]=_0x32dc49[_0x5b1a('0x7')];this['countcongestionretry']=_0x32dc49[_0x5b1a('0x8')];this[_0x5b1a('0x9')]=_0x32dc49[_0x5b1a('0x9')];this[_0x5b1a('0xa')]=_0x32dc49[_0x5b1a('0x7')]+_0x32dc49[_0x5b1a('0x8')]+_0x32dc49[_0x5b1a('0x9')];this['uniqueid']=_0x3e5529[_0x5b1a('0xb')];this['calleridname']=_0x32dc49[_0x5b1a('0xc')];this['calleridnum']=_0x32dc49[_0x5b1a('0xd')];this[_0x5b1a('0xe')]=_0x32dc49[_0x5b1a('0xe')];this['responsetime']=_0x32dc49[_0x5b1a('0xf')];this[_0x5b1a('0x10')]=_0x32dc49[_0x5b1a('0x10')];this[_0x5b1a('0x11')]=this['droptime'];this[_0x5b1a('0x12')]=getSeconds(_0x32dc49['responsetime'],_0x32dc49['starttime']);this['holdtime']=getSeconds(this['droptime'],_0x32dc49[_0x5b1a('0xf')]);this[_0x5b1a('0x13')]=0x0;this[_0x5b1a('0x14')]=_0x3e5529[_0x5b1a('0x14')];this[_0x5b1a('0x15')]=_0x3e5529[_0x5b1a('0x16')];this[_0x5b1a('0x17')]=_0x3e5529[_0x5b1a('0x17')];this[_0x5b1a('0x18')]=_0x32dc49[_0x5b1a('0x18')];this[_0x5b1a('0x19')]=_0x32dc49['callbackuniqueid'];this[_0x5b1a('0x1a')]=_0x32dc49[_0x5b1a('0x1a')];this[_0x5b1a('0x1b')]=_0x32dc49[_0x5b1a('0x1b')];this[_0x5b1a('0x1c')]=_0x32dc49[_0x5b1a('0x1c')];this['ListId']=_0x32dc49[_0x5b1a('0x1d')];this[_0x5b1a('0x1e')]=_0x32dc49['UserId'];this[_0x5b1a('0x1f')]=_0x32dc49[_0x5b1a('0x1f')];this[_0x5b1a('0x20')]=_0x32dc49[_0x5b1a('0x20')];this[_0x5b1a('0x21')]=_0x32dc49[_0x5b1a('0x21')]||'';this[_0x5b1a('0x22')]=_0x32dc49['originatecalleridname']||'';}module[_0x5b1a('0x23')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 356a674..6aaf5e9 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 _0x0066=['tech','Trunk','name','localstationid','headerinfo','path','AttachmentId','exports','util','moment','uniqueid','channel','%s/%s/%s'];(function(_0x20b72c,_0x74fcad){var _0x543564=function(_0x13a81f){while(--_0x13a81f){_0x20b72c['push'](_0x20b72c['shift']());}};_0x543564(++_0x74fcad);}(_0x0066,0x15a));var _0x6006=function(_0x68ea42,_0x3e8ad7){_0x68ea42=_0x68ea42-0x0;var _0x3ecd60=_0x0066[_0x68ea42];return _0x3ecd60;};'use strict';var util=require(_0x6006('0x0'));var _=require('lodash');var moment=require(_0x6006('0x1'));function Action(_0xfa357d,_0x3f031e,_0x500545){this[_0x6006('0x2')]=_0xfa357d||undefined;this[_0x6006('0x3')]=util['format'](_0x6006('0x4'),_0x3f031e[_0x6006('0x5')],_0x3f031e[_0x6006('0x6')][_0x6006('0x7')],_0x500545['fax']);this[_0x6006('0x8')]=_0x3f031e['localstationid'];this[_0x6006('0x9')]=_0x3f031e[_0x6006('0x9')];this[_0x6006('0xa')]=_0x500545['path'];this[_0x6006('0xb')]=_0x500545[_0x6006('0xb')];}module[_0x6006('0xc')]=Action; \ No newline at end of file +var _0x5fc2=['util','moment','uniqueid','channel','format','%s/%s/%s','tech','Trunk','name','fax','localstationid','headerinfo','path','AttachmentId'];(function(_0xbeb0e4,_0x204d46){var _0x3783e5=function(_0x220c33){while(--_0x220c33){_0xbeb0e4['push'](_0xbeb0e4['shift']());}};_0x3783e5(++_0x204d46);}(_0x5fc2,0x188));var _0x25fc=function(_0x246115,_0x398123){_0x246115=_0x246115-0x0;var _0x385878=_0x5fc2[_0x246115];return _0x385878;};'use strict';var util=require(_0x25fc('0x0'));var _=require('lodash');var moment=require(_0x25fc('0x1'));function Action(_0x4b2797,_0x4dfbf7,_0x33f7c6){this[_0x25fc('0x2')]=_0x4b2797||undefined;this[_0x25fc('0x3')]=util[_0x25fc('0x4')](_0x25fc('0x5'),_0x4dfbf7[_0x25fc('0x6')],_0x4dfbf7[_0x25fc('0x7')][_0x25fc('0x8')],_0x33f7c6[_0x25fc('0x9')]);this['localstationid']=_0x4dfbf7[_0x25fc('0xa')];this[_0x25fc('0xb')]=_0x4dfbf7[_0x25fc('0xb')];this[_0x25fc('0xc')]=_0x33f7c6[_0x25fc('0xc')];this[_0x25fc('0xd')]=_0x33f7c6[_0x25fc('0xd')];}module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index ce86afe..8d198fc 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 _0x5e21=['Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','.pdf','isTrunkReachable','isNil','format','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','lodash','bluebird','uuid','moment','tiff2pdf','./util/gs','fax','../ami','./rpcDb','./util/util','./action','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','newexten','faxstatus','syncFaxStatus','hangup','syncHangup','originateresponse','syncOriginateResponse','context','from-voip-provider','hasOwnProperty','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','prototype','syncNewState','channelstate','channelstatedesc','syncNewExten','variable','value','operation','status','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','application/pdf','then','notify','catch','\x20notify\x20','error','\x20receiveFax\x20','stringify','merge','pick','response','reason','AttachmentId','update','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate','FaxAccountId','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','checkTrunk','path','execute','%s/%s.tif','dir','XMF-PATH'];(function(_0x3fc4ac,_0x46e89e){var _0x2adf27=function(_0x5462f7){while(--_0x5462f7){_0x3fc4ac['push'](_0x3fc4ac['shift']());}};_0x2adf27(++_0x46e89e);}(_0x5e21,0x1f0));var _0x15e2=function(_0x1dcd0a,_0x563489){_0x1dcd0a=_0x1dcd0a-0x0;var _0x52790c=_0x5e21[_0x1dcd0a];return _0x52790c;};'use strict';var util=require('util');var _=require(_0x15e2('0x0'));var BPromise=require(_0x15e2('0x1'));var uuid=require(_0x15e2('0x2'));var moment=require(_0x15e2('0x3'));var path=require('path');var tiff2pdf=require(_0x15e2('0x4'));var gs=require(_0x15e2('0x5'));var logger=require('../../../config/logger')(_0x15e2('0x6'));var ami=require(_0x15e2('0x7'));var rpcDb=require(_0x15e2('0x8'));var Channel=require('./channel');var ut=require(_0x15e2('0x9'));var Action=require(_0x15e2('0xa'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x15e2('0xb'));var faxMessage=require(_0x15e2('0xc'));function Fax(_0x574eb4){this[_0x15e2('0xd')]={};this['faxAccounts']=_0x574eb4[_0x15e2('0xe')];this[_0x15e2('0xf')]=_0x574eb4[_0x15e2('0xf')];this[_0x15e2('0x10')]={};ami['on'](_0x15e2('0x11'),this[_0x15e2('0x12')][_0x15e2('0x13')](this));ami['on'](_0x15e2('0x14'),this[_0x15e2('0x15')][_0x15e2('0x13')](this));ami['on'](_0x15e2('0x16'),this['syncNewState'][_0x15e2('0x13')](this));ami['on'](_0x15e2('0x17'),this['syncNewExten']['bind'](this));ami['on'](_0x15e2('0x18'),this[_0x15e2('0x19')]['bind'](this));ami['on']('receivefax',this['syncReceiveFax']['bind'](this));ami['on'](_0x15e2('0x1a'),this[_0x15e2('0x1b')]['bind'](this));ami['on'](_0x15e2('0x1c'),this[_0x15e2('0x1d')]['bind'](this));}Fax['prototype'][_0x15e2('0x12')]=function(_0x369fab){if(_0x369fab[_0x15e2('0x1e')]===_0x15e2('0x1f')){for(var _0x33f982 in this[_0x15e2('0xe')]){if(this['faxAccounts'][_0x15e2('0x20')](_0x33f982)){if(_0x369fab['exten']===this[_0x15e2('0xe')][_0x33f982][_0x15e2('0x21')]){this[_0x15e2('0xd')][_0x369fab[_0x15e2('0x22')]]={};this[_0x15e2('0xd')][_0x369fab['uniqueid']]['channel']=_0x369fab[_0x15e2('0x23')];this[_0x15e2('0xd')][_0x369fab['uniqueid']]['id']=this[_0x15e2('0xe')][_0x33f982]['id'];this['channels'][_0x369fab[_0x15e2('0x22')]]['name']=this[_0x15e2('0xe')][_0x33f982][_0x15e2('0x24')];logger['info'](_0x369fab[_0x15e2('0x22')],'\x20syncNewchannel\x20');}}}}if(this[_0x15e2('0x10')][_0x369fab[_0x15e2('0x22')]]){this[_0x15e2('0xd')][_0x369fab[_0x15e2('0x22')]]={};this[_0x15e2('0xd')][_0x369fab[_0x15e2('0x22')]]['channel']=_0x369fab['channel'];logger[_0x15e2('0x25')](_0x369fab['uniqueid'],_0x15e2('0x26'));}};Fax[_0x15e2('0x27')][_0x15e2('0x15')]=function(_0xaae355){if(this['channels'][_0xaae355[_0x15e2('0x22')]]){for(var _0xf4e5d1 in _0xaae355['variable']){if(_0xaae355['variable'][_0x15e2('0x20')](_0xf4e5d1)){this[_0x15e2('0xd')][_0xaae355[_0x15e2('0x22')]][_0xf4e5d1]=_0xaae355['value'];}}}};Fax[_0x15e2('0x27')][_0x15e2('0x28')]=function(_0x40121b){if(this['channels'][_0x40121b['uniqueid']]){this[_0x15e2('0xd')][_0x40121b[_0x15e2('0x22')]][_0x15e2('0x29')]=_0x40121b[_0x15e2('0x29')];this['channels'][_0x40121b[_0x15e2('0x22')]][_0x15e2('0x2a')]=_0x40121b[_0x15e2('0x2a')];}};Fax[_0x15e2('0x27')][_0x15e2('0x2b')]=function(_0x2159f1){if(this[_0x15e2('0xd')][_0x2159f1[_0x15e2('0x22')]]){for(var _0x3fd98f in _0x2159f1[_0x15e2('0x2c')]){if(_0x2159f1['variable'][_0x15e2('0x20')](_0x3fd98f)){this[_0x15e2('0xd')][_0x2159f1[_0x15e2('0x22')]][_0x3fd98f]=_0x2159f1[_0x15e2('0x2d')];}}}};Fax[_0x15e2('0x27')]['syncFaxStatus']=function(_0x44c0a7){if(this[_0x15e2('0xd')][_0x44c0a7[_0x15e2('0x22')]]){this[_0x15e2('0xd')][_0x44c0a7[_0x15e2('0x22')]][_0x15e2('0x2e')]=_0x44c0a7[_0x15e2('0x2e')];this[_0x15e2('0xd')][_0x44c0a7[_0x15e2('0x22')]][_0x15e2('0x2f')]=_0x44c0a7[_0x15e2('0x2f')];this[_0x15e2('0xd')][_0x44c0a7[_0x15e2('0x22')]][_0x15e2('0x21')]=_0x44c0a7[_0x15e2('0x21')];this[_0x15e2('0xd')][_0x44c0a7['uniqueid']][_0x15e2('0x30')]=_0x44c0a7[_0x15e2('0x30')];logger['info'](_0x44c0a7['uniqueid'],_0x15e2('0x31'));}};Fax[_0x15e2('0x27')][_0x15e2('0x32')]=function(_0x206807){var _0x5b025b=this;if(this[_0x15e2('0xd')][_0x206807[_0x15e2('0x22')]]){var _0x4dc8c0=this[_0x15e2('0xd')][_0x206807[_0x15e2('0x22')]]['id'];this['channels'][_0x206807[_0x15e2('0x22')]][_0x15e2('0x33')]=_0x206807[_0x15e2('0x33')];this[_0x15e2('0xd')][_0x206807[_0x15e2('0x22')]][_0x15e2('0x34')]=_0x206807[_0x15e2('0x34')];this[_0x15e2('0xd')][_0x206807['uniqueid']][_0x15e2('0x21')]=_0x206807[_0x15e2('0x21')];this[_0x15e2('0xd')][_0x206807[_0x15e2('0x22')]][_0x15e2('0x35')]=_0x206807[_0x15e2('0x35')];this[_0x15e2('0xd')][_0x206807[_0x15e2('0x22')]][_0x15e2('0x36')]=_0x206807[_0x15e2('0x36')];this['channels'][_0x206807[_0x15e2('0x22')]][_0x15e2('0x30')]=_0x206807[_0x15e2('0x30')];this[_0x15e2('0xd')][_0x206807['uniqueid']][_0x15e2('0x37')]=_0x206807[_0x15e2('0x37')];if(this[_0x15e2('0xd')][_0x206807[_0x15e2('0x22')]]['pagestransferred']>0x0){tiff2pdf(_0x206807[_0x15e2('0x30')],_0x15e2('0x38'),function(_0x531288){logger[_0x15e2('0x25')](_0x206807[_0x15e2('0x22')],_0x15e2('0x39'),_0x531288[_0x15e2('0x3a')]);attachment[_0x15e2('0x3b')]({'name':path[_0x15e2('0x3c')](_0x206807[_0x15e2('0x30')])[_0x15e2('0x24')],'basename':path[_0x15e2('0x3c')](_0x206807[_0x15e2('0x30')])[_0x15e2('0x24')]+'.pdf','type':_0x15e2('0x3d')})[_0x15e2('0x3e')](function(_0x3ce965){faxAccount[_0x15e2('0x3f')](_0x4dc8c0,{'from':_0x206807[_0x15e2('0x37')],'mapKey':_0x15e2('0x6'),'body':path[_0x15e2('0x3c')](_0x206807[_0x15e2('0x30')])[_0x15e2('0x24')]+'.pdf','AttachmentId':_0x3ce965['id']})[_0x15e2('0x40')](function(_0x16d802){logger['error'](_0x206807[_0x15e2('0x22')],_0x15e2('0x41'),JSON['stringify'](_0x16d802));});})['catch'](function(_0x165c40){logger[_0x15e2('0x42')](_0x206807[_0x15e2('0x22')],_0x15e2('0x43'),JSON[_0x15e2('0x44')](_0x165c40));});});}logger[_0x15e2('0x25')](_0x206807['uniqueid'],_0x15e2('0x43'));}};Fax[_0x15e2('0x27')][_0x15e2('0x1d')]=function(_0x2c0941){if(this[_0x15e2('0x10')][_0x2c0941[_0x15e2('0x22')]]){_[_0x15e2('0x45')](this['channels'][_0x2c0941[_0x15e2('0x22')]],_[_0x15e2('0x46')](_0x2c0941,[_0x15e2('0x47'),_0x15e2('0x48')]));}};function updateStatus(_0x58db33){if(_0x58db33[_0x15e2('0x49')]){faxMessage[_0x15e2('0x4a')](_0x58db33[_0x15e2('0x49')],{'failMessage':'SENDING\x20FAILED\x20'})[_0x15e2('0x3e')](function(_0x41d01e){ut[_0x15e2('0x4b')]('[Fax][Message][Error][Updated]',_0x41d01e);})[_0x15e2('0x40')](function(_0x27dc1a){ut[_0x15e2('0x4b')](_0x15e2('0x4c'),_0x27dc1a);});}else{ut[_0x15e2('0x4b')](_0x15e2('0x4d'));}}Fax[_0x15e2('0x27')][_0x15e2('0x4e')]=function(_0x41d589,_0x7679c6,_0x35cb61){var _0x4fb9e0=this;var _0x239698={};if(_0x7679c6){_0x239698={'read':_0x7679c6};}else{_0x239698={'failMessage':_0x35cb61};}if(this[_0x15e2('0x10')][_0x41d589]['AttachmentId']){faxMessage[_0x15e2('0x4a')](this[_0x15e2('0x10')][_0x41d589][_0x15e2('0x49')],_0x239698)[_0x15e2('0x3e')](function(_0x5a39d7){ut[_0x15e2('0x4b')](_0x15e2('0x4f'),_0x5a39d7);})[_0x15e2('0x40')](function(_0xd5ad54){ut[_0x15e2('0x4b')](_0x15e2('0x50'),_0xd5ad54);})[_0x15e2('0x51')](function(){delete _0x4fb9e0[_0x15e2('0xd')][_0x41d589];delete _0x4fb9e0[_0x15e2('0x10')][_0x41d589];});}else{ut['logger'](_0x15e2('0x52'));delete this[_0x15e2('0xd')][_0x41d589];delete this['actions'][_0x41d589];}};Fax[_0x15e2('0x27')]['syncHangup']=function(_0x35e0cf){var _0x913cea=this;if(this['channels'][_0x35e0cf[_0x15e2('0x22')]]){if(this[_0x15e2('0x10')][_0x35e0cf[_0x15e2('0x22')]]){this[_0x15e2('0xd')][_0x35e0cf['uniqueid']]['id']=this[_0x15e2('0x10')][_0x35e0cf[_0x15e2('0x22')]]['id'];this[_0x15e2('0xd')][_0x35e0cf[_0x15e2('0x22')]]['name']=this['actions'][_0x35e0cf[_0x15e2('0x22')]][_0x15e2('0x24')];}logger[_0x15e2('0x25')](_0x35e0cf[_0x15e2('0x22')],this[_0x15e2('0x10')][_0x35e0cf[_0x15e2('0x22')]]?_0x15e2('0x53'):_0x15e2('0x54'),JSON[_0x15e2('0x44')](this['channels'][_0x35e0cf[_0x15e2('0x22')]]));if(this[_0x15e2('0x10')][_0x35e0cf[_0x15e2('0x22')]]){if(this[_0x15e2('0xd')][_0x35e0cf[_0x15e2('0x22')]]['faxpages']>0x0&&this[_0x15e2('0xd')][_0x35e0cf['uniqueid']][_0x15e2('0x18')]===_0x15e2('0x55')){this[_0x15e2('0x4e')](_0x35e0cf[_0x15e2('0x22')],!![]);}else{this[_0x15e2('0x4e')](_0x35e0cf[_0x15e2('0x22')],![],this[_0x15e2('0xd')][_0x35e0cf[_0x15e2('0x22')]][_0x15e2('0x56')]?_0x15e2('0x57')+this['channels'][_0x35e0cf[_0x15e2('0x22')]][_0x15e2('0x56')]:_0x15e2('0x58'));}}}};Fax[_0x15e2('0x27')]['send']=function(_0x32c458){var _0x5d4a78=this;return new BPromise(function(_0x19eb6d,_0x3d2a23){_0x5d4a78[_0x15e2('0x59')](_0x32c458,_0x5d4a78['faxAccounts'][_0x32c458[_0x15e2('0x5a')]])[_0x15e2('0x3e')](function(_0x3446f5){ut['logger'](_0x15e2('0x5b'),_0x3446f5);_0x19eb6d(ut[_0x15e2('0x3a')]('Fax\x20received'));})[_0x15e2('0x40')](function(_0xe10546){ut[_0x15e2('0x4b')](_0x15e2('0x5c'),_0xe10546);updateStatus(_0x32c458);_0x3d2a23(ut[_0x15e2('0x3a')]('Fax\x20failed'));});});};Fax['prototype']['checkAfterSend']=function(_0x273ed0){var _0xb26e8=this;return new BPromise(function(_0x5b8e85,_0x1f4f3a){var _0x2839a8=_0xb26e8[_0x15e2('0x5d')](_0xb26e8['faxAccounts'][_0x273ed0[_0x15e2('0x5a')]]['Trunk'],_0x273ed0);if(_0x2839a8['isValid']){_0x5b8e85(ut[_0x15e2('0x3a')]('Trunk\x20Reachable'));}else{_0x1f4f3a(ut[_0x15e2('0x3a')](_0x2839a8['message']));}});};function originate(_0x311721,_0x4f34c7,_0x1ecd55){return new BPromise(function(_0x2ff08e,_0x19c3b2){if(_0x1ecd55){var _0x264bc=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[_0x15e2('0x3c')](_0x311721['path'])[_0x15e2('0x24')],_0x311721[_0x15e2('0x5e')]);gs[_0x15e2('0x5f')](_0x264bc)['then'](function(){_0x311721[_0x15e2('0x5e')]=util['format'](_0x15e2('0x60'),path[_0x15e2('0x3c')](_0x311721['path'])[_0x15e2('0x61')],path[_0x15e2('0x3c')](_0x311721[_0x15e2('0x5e')])[_0x15e2('0x24')]);_0x4f34c7[_0x15e2('0x62')]=_0x311721['path'];ut[_0x15e2('0x4b')](_0x15e2('0x63'),'');ami[_0x15e2('0x64')](ut[_0x15e2('0x65')](_0x311721,_0x4f34c7))[_0x15e2('0x3e')](function(_0x5bbe16){_0x2ff08e(_0x5bbe16);})[_0x15e2('0x40')](function(_0x4d60b6){_0x19c3b2(_0x4d60b6);});})[_0x15e2('0x40')](function(_0x1f1714){_0x19c3b2(_0x1f1714);});}else{ami['Action'](ut['variablesAction'](_0x311721,_0x4f34c7))['then'](function(_0x19f9f5){_0x2ff08e(_0x19f9f5);})['catch'](function(_0x58c41a){_0x19c3b2(_0x58c41a);});}});}Fax[_0x15e2('0x27')][_0x15e2('0x59')]=function(_0x2f94ab,_0x4dbf40){var _0x51db23=this;return new BPromise(function(_0x3f7ce3,_0x389e3f){var _0x386bea=uuid['v4']();var _0x5d7729=ut[_0x15e2('0x66')](_0x2f94ab,_0x4dbf40);_0x51db23[_0x15e2('0x10')][_0x386bea]=new Action(_0x386bea,_0x4dbf40,_0x2f94ab);var _0x25b52d=_0x51db23['actions'][_0x386bea];if(path['parse'](_0x2f94ab['path'])[_0x15e2('0x67')]===_0x15e2('0x68')){originate(_0x25b52d,_0x5d7729,!![])[_0x15e2('0x3e')](function(_0x9604a1){_0x3f7ce3(_0x9604a1);})[_0x15e2('0x40')](function(_0x2bda09){_0x389e3f(_0x2bda09);});}else{originate(_0x25b52d,_0x5d7729,![])['then'](function(_0x4ce467){_0x3f7ce3(_0x4ce467);})[_0x15e2('0x40')](function(_0x44394a){_0x389e3f(_0x44394a);});}});};Fax[_0x15e2('0x27')][_0x15e2('0x69')]=function(_0x1f7245){return!_[_0x15e2('0x6a')](_0x1f7245)&&!_[_0x15e2('0x6a')](_0x1f7245[_0x15e2('0x24')])&&!_[_0x15e2('0x6a')](_0x1f7245['active'])&&_0x1f7245['active']&&!_['isNil'](this[_0x15e2('0xf')][util[_0x15e2('0x6b')]('SIP/%s',_0x1f7245[_0x15e2('0x24')])])&&!_[_0x15e2('0x6a')](this[_0x15e2('0xf')][util[_0x15e2('0x6b')](_0x15e2('0x6c'),_0x1f7245[_0x15e2('0x24')])][_0x15e2('0x2f')])&&(this['trunks'][util[_0x15e2('0x6b')](_0x15e2('0x6c'),_0x1f7245[_0x15e2('0x24')])][_0x15e2('0x2f')]===_0x15e2('0x6d')||this['trunks'][util[_0x15e2('0x6b')](_0x15e2('0x6c'),_0x1f7245['name'])][_0x15e2('0x2f')]===_0x15e2('0x6e'));};Fax[_0x15e2('0x27')][_0x15e2('0x5d')]=function(_0x5ab75a,_0x274f6f){if(!this[_0x15e2('0x69')](_0x5ab75a)){ut[_0x15e2('0x4b')](_0x15e2('0x6f'),_[_0x15e2('0x6a')](_0x5ab75a)?'':_0x5ab75a['name']+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x15e2('0x70')};}if(_[_0x15e2('0x6a')](_0x274f6f['fax'])){ut[_0x15e2('0x4b')](_0x15e2('0x71'),JSON[_0x15e2('0x44')](_0x274f6f));return{'isValid':![],'message':_0x15e2('0x72')};}if(_[_0x15e2('0x6a')](_0x274f6f['path'])){ut['logger'](_0x15e2('0x73'),JSON[_0x15e2('0x44')](_0x274f6f));return{'isValid':![],'message':_0x15e2('0x74')};}return{'isValid':!![],'message':_0x15e2('0x75')};};module[_0x15e2('0x76')]=Fax; \ No newline at end of file +var _0x4245=['filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','application/pdf','then','.pdf','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Empty\x20Fax','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','uuid','path','tiff2pdf','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','syncVarSet','newstate','syncNewState','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','operation','status'];(function(_0x4664db,_0x1de672){var _0x5615b4=function(_0x54fb5a){while(--_0x54fb5a){_0x4664db['push'](_0x4664db['shift']());}};_0x5615b4(++_0x1de672);}(_0x4245,0x1bc));var _0x5424=function(_0x164d76,_0x492e9a){_0x164d76=_0x164d76-0x0;var _0x4ff753=_0x4245[_0x164d76];return _0x4ff753;};'use strict';var util=require(_0x5424('0x0'));var _=require(_0x5424('0x1'));var BPromise=require(_0x5424('0x2'));var uuid=require(_0x5424('0x3'));var moment=require('moment');var path=require(_0x5424('0x4'));var tiff2pdf=require(_0x5424('0x5'));var gs=require('./util/gs');var logger=require('../../../config/logger')(_0x5424('0x6'));var ami=require(_0x5424('0x7'));var rpcDb=require(_0x5424('0x8'));var Channel=require(_0x5424('0x9'));var ut=require(_0x5424('0xa'));var Action=require(_0x5424('0xb'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x5424('0xc'));var faxMessage=require(_0x5424('0xd'));function Fax(_0x8ded40){this[_0x5424('0xe')]={};this['faxAccounts']=_0x8ded40[_0x5424('0xf')];this[_0x5424('0x10')]=_0x8ded40[_0x5424('0x10')];this[_0x5424('0x11')]={};ami['on'](_0x5424('0x12'),this[_0x5424('0x13')][_0x5424('0x14')](this));ami['on']('varset',this[_0x5424('0x15')][_0x5424('0x14')](this));ami['on'](_0x5424('0x16'),this[_0x5424('0x17')][_0x5424('0x14')](this));ami['on']('newexten',this['syncNewExten'][_0x5424('0x14')](this));ami['on'](_0x5424('0x18'),this[_0x5424('0x19')][_0x5424('0x14')](this));ami['on'](_0x5424('0x1a'),this[_0x5424('0x1b')][_0x5424('0x14')](this));ami['on'](_0x5424('0x1c'),this[_0x5424('0x1d')][_0x5424('0x14')](this));ami['on'](_0x5424('0x1e'),this[_0x5424('0x1f')][_0x5424('0x14')](this));}Fax[_0x5424('0x20')][_0x5424('0x13')]=function(_0x4fa775){if(_0x4fa775[_0x5424('0x21')]===_0x5424('0x22')){for(var _0x1efb54 in this['faxAccounts']){if(this[_0x5424('0xf')][_0x5424('0x23')](_0x1efb54)){if(_0x4fa775[_0x5424('0x24')]===this[_0x5424('0xf')][_0x1efb54][_0x5424('0x25')]){this[_0x5424('0xe')][_0x4fa775[_0x5424('0x26')]]={};this['channels'][_0x4fa775[_0x5424('0x26')]][_0x5424('0x27')]=_0x4fa775[_0x5424('0x27')];this[_0x5424('0xe')][_0x4fa775[_0x5424('0x26')]]['id']=this['faxAccounts'][_0x1efb54]['id'];this[_0x5424('0xe')][_0x4fa775['uniqueid']][_0x5424('0x28')]=this['faxAccounts'][_0x1efb54][_0x5424('0x28')];logger[_0x5424('0x29')](_0x4fa775[_0x5424('0x26')],_0x5424('0x2a'));}}}}if(this['actions'][_0x4fa775[_0x5424('0x26')]]){this[_0x5424('0xe')][_0x4fa775[_0x5424('0x26')]]={};this[_0x5424('0xe')][_0x4fa775[_0x5424('0x26')]][_0x5424('0x27')]=_0x4fa775[_0x5424('0x27')];logger['info'](_0x4fa775[_0x5424('0x26')],_0x5424('0x2a'));}};Fax[_0x5424('0x20')][_0x5424('0x15')]=function(_0x1d3e03){if(this[_0x5424('0xe')][_0x1d3e03[_0x5424('0x26')]]){for(var _0x5a151b in _0x1d3e03[_0x5424('0x2b')]){if(_0x1d3e03[_0x5424('0x2b')][_0x5424('0x23')](_0x5a151b)){this[_0x5424('0xe')][_0x1d3e03['uniqueid']][_0x5a151b]=_0x1d3e03[_0x5424('0x2c')];}}}};Fax[_0x5424('0x20')][_0x5424('0x17')]=function(_0x228694){if(this['channels'][_0x228694[_0x5424('0x26')]]){this[_0x5424('0xe')][_0x228694[_0x5424('0x26')]][_0x5424('0x2d')]=_0x228694[_0x5424('0x2d')];this[_0x5424('0xe')][_0x228694['uniqueid']]['channelstatedesc']=_0x228694['channelstatedesc'];}};Fax[_0x5424('0x20')]['syncNewExten']=function(_0x571f19){if(this['channels'][_0x571f19[_0x5424('0x26')]]){for(var _0x36c82c in _0x571f19[_0x5424('0x2b')]){if(_0x571f19[_0x5424('0x2b')][_0x5424('0x23')](_0x36c82c)){this[_0x5424('0xe')][_0x571f19['uniqueid']][_0x36c82c]=_0x571f19[_0x5424('0x2c')];}}}};Fax[_0x5424('0x20')][_0x5424('0x19')]=function(_0x5c79e3){if(this[_0x5424('0xe')][_0x5c79e3['uniqueid']]){this[_0x5424('0xe')][_0x5c79e3[_0x5424('0x26')]][_0x5424('0x2e')]=_0x5c79e3[_0x5424('0x2e')];this[_0x5424('0xe')][_0x5c79e3[_0x5424('0x26')]][_0x5424('0x2f')]=_0x5c79e3[_0x5424('0x2f')];this[_0x5424('0xe')][_0x5c79e3[_0x5424('0x26')]][_0x5424('0x25')]=_0x5c79e3[_0x5424('0x25')];this[_0x5424('0xe')][_0x5c79e3['uniqueid']]['filename']=_0x5c79e3[_0x5424('0x30')];logger[_0x5424('0x29')](_0x5c79e3[_0x5424('0x26')],_0x5424('0x31'));}};Fax['prototype'][_0x5424('0x1b')]=function(_0x2714a3){var _0x31dc7d=this;if(this[_0x5424('0xe')][_0x2714a3['uniqueid']]){var _0x3c07e0=this[_0x5424('0xe')][_0x2714a3[_0x5424('0x26')]]['id'];this[_0x5424('0xe')][_0x2714a3['uniqueid']][_0x5424('0x32')]=_0x2714a3[_0x5424('0x32')];this[_0x5424('0xe')][_0x2714a3['uniqueid']][_0x5424('0x33')]=_0x2714a3[_0x5424('0x33')];this[_0x5424('0xe')][_0x2714a3[_0x5424('0x26')]]['localstationid']=_0x2714a3[_0x5424('0x25')];this['channels'][_0x2714a3[_0x5424('0x26')]][_0x5424('0x34')]=_0x2714a3[_0x5424('0x34')];this[_0x5424('0xe')][_0x2714a3['uniqueid']]['transferrate']=_0x2714a3['transferrate'];this[_0x5424('0xe')][_0x2714a3['uniqueid']][_0x5424('0x30')]=_0x2714a3[_0x5424('0x30')];this[_0x5424('0xe')][_0x2714a3[_0x5424('0x26')]][_0x5424('0x35')]=_0x2714a3[_0x5424('0x35')];if(this[_0x5424('0xe')][_0x2714a3[_0x5424('0x26')]]['pagestransferred']>0x0){tiff2pdf(_0x2714a3[_0x5424('0x30')],_0x5424('0x36'),function(_0xef0736){logger[_0x5424('0x29')](_0x2714a3['uniqueid'],_0x5424('0x37'),_0xef0736[_0x5424('0x38')]);attachment[_0x5424('0x39')]({'name':path[_0x5424('0x3a')](_0x2714a3[_0x5424('0x30')])['name'],'basename':path[_0x5424('0x3a')](_0x2714a3['filename'])[_0x5424('0x28')]+'.pdf','type':_0x5424('0x3b')})[_0x5424('0x3c')](function(_0x530467){faxAccount['notify'](_0x3c07e0,{'from':_0x2714a3[_0x5424('0x35')],'mapKey':'fax','body':path[_0x5424('0x3a')](_0x2714a3[_0x5424('0x30')])[_0x5424('0x28')]+_0x5424('0x3d'),'AttachmentId':_0x530467['id']})[_0x5424('0x3e')](function(_0x561455){logger[_0x5424('0x3f')](_0x2714a3[_0x5424('0x26')],_0x5424('0x40'),JSON[_0x5424('0x41')](_0x561455));});})['catch'](function(_0x57981e){logger['error'](_0x2714a3[_0x5424('0x26')],'\x20receiveFax\x20',JSON[_0x5424('0x41')](_0x57981e));});});}logger[_0x5424('0x29')](_0x2714a3[_0x5424('0x26')],_0x5424('0x42'));}};Fax[_0x5424('0x20')][_0x5424('0x1f')]=function(_0x4db742){if(this[_0x5424('0x11')][_0x4db742['uniqueid']]){_[_0x5424('0x43')](this['channels'][_0x4db742[_0x5424('0x26')]],_[_0x5424('0x44')](_0x4db742,[_0x5424('0x45'),_0x5424('0x46')]));}};function updateStatus(_0x38d1e5){if(_0x38d1e5[_0x5424('0x47')]){faxMessage[_0x5424('0x48')](_0x38d1e5['AttachmentId'],{'failMessage':_0x5424('0x49')})[_0x5424('0x3c')](function(_0x5ed8e5){ut['logger']('[Fax][Message][Error][Updated]',_0x5ed8e5);})[_0x5424('0x3e')](function(_0x588874){ut[_0x5424('0x4a')](_0x5424('0x4b'),_0x588874);});}else{ut['logger'](_0x5424('0x4c'));}}Fax[_0x5424('0x20')][_0x5424('0x4d')]=function(_0xf8335c,_0x1ef081,_0x5db6e6){var _0x4d3d26=this;var _0x23b8cf={};if(_0x1ef081){_0x23b8cf={'read':_0x1ef081};}else{_0x23b8cf={'failMessage':_0x5db6e6};}if(this['actions'][_0xf8335c][_0x5424('0x47')]){faxMessage[_0x5424('0x48')](this[_0x5424('0x11')][_0xf8335c][_0x5424('0x47')],_0x23b8cf)[_0x5424('0x3c')](function(_0x27a33a){ut[_0x5424('0x4a')](_0x5424('0x4e'),_0x27a33a);})['catch'](function(_0x3c2c20){ut[_0x5424('0x4a')](_0x5424('0x4f'),_0x3c2c20);})[_0x5424('0x50')](function(){delete _0x4d3d26[_0x5424('0xe')][_0xf8335c];delete _0x4d3d26[_0x5424('0x11')][_0xf8335c];});}else{ut['logger'](_0x5424('0x51'));delete this[_0x5424('0xe')][_0xf8335c];delete this['actions'][_0xf8335c];}};Fax[_0x5424('0x20')][_0x5424('0x1d')]=function(_0x5e8003){var _0x427654=this;if(this['channels'][_0x5e8003['uniqueid']]){if(this[_0x5424('0x11')][_0x5e8003[_0x5424('0x26')]]){this[_0x5424('0xe')][_0x5e8003[_0x5424('0x26')]]['id']=this['actions'][_0x5e8003[_0x5424('0x26')]]['id'];this[_0x5424('0xe')][_0x5e8003[_0x5424('0x26')]][_0x5424('0x28')]=this['actions'][_0x5e8003[_0x5424('0x26')]][_0x5424('0x28')];}logger[_0x5424('0x29')](_0x5e8003[_0x5424('0x26')],this[_0x5424('0x11')][_0x5e8003[_0x5424('0x26')]]?_0x5424('0x52'):_0x5424('0x53'),JSON[_0x5424('0x41')](this[_0x5424('0xe')][_0x5e8003[_0x5424('0x26')]]));if(this[_0x5424('0x11')][_0x5e8003[_0x5424('0x26')]]){if(this[_0x5424('0xe')][_0x5e8003[_0x5424('0x26')]][_0x5424('0x54')]>0x0&&this[_0x5424('0xe')][_0x5e8003[_0x5424('0x26')]]['faxstatus']===_0x5424('0x55')){this[_0x5424('0x4d')](_0x5e8003['uniqueid'],!![]);}else{this[_0x5424('0x4d')](_0x5e8003['uniqueid'],![],this[_0x5424('0xe')][_0x5e8003['uniqueid']][_0x5424('0x56')]?_0x5424('0x57')+this[_0x5424('0xe')][_0x5e8003[_0x5424('0x26')]]['faxstatusstring']:_0x5424('0x58'));}}}};Fax['prototype'][_0x5424('0x59')]=function(_0x58f091){var _0x253f65=this;return new BPromise(function(_0x1551c5,_0xd08abb){_0x253f65[_0x5424('0x5a')](_0x58f091,_0x253f65[_0x5424('0xf')][_0x58f091[_0x5424('0x5b')]])[_0x5424('0x3c')](function(_0x107097){ut['logger'](_0x5424('0x5c'),_0x107097);_0x1551c5(ut['message'](_0x5424('0x5d')));})[_0x5424('0x3e')](function(_0x21be0f){ut[_0x5424('0x4a')](_0x5424('0x5e'),_0x21be0f);updateStatus(_0x58f091);_0xd08abb(ut[_0x5424('0x38')](_0x5424('0x5f')));});});};Fax[_0x5424('0x20')][_0x5424('0x60')]=function(_0x2301e9){var _0x2eba5c=this;return new BPromise(function(_0xded1f0,_0x4bffa1){var _0x545d7b=_0x2eba5c[_0x5424('0x61')](_0x2eba5c[_0x5424('0xf')][_0x2301e9['FaxAccountId']][_0x5424('0x62')],_0x2301e9);if(_0x545d7b[_0x5424('0x63')]){_0xded1f0(ut[_0x5424('0x38')](_0x5424('0x64')));}else{_0x4bffa1(ut[_0x5424('0x38')](_0x545d7b[_0x5424('0x38')]));}});};function originate(_0x410fe0,_0x55445e,_0x4ae4c3){return new BPromise(function(_0x222bc6,_0x430407){if(_0x4ae4c3){var _0xdb21b=util[_0x5424('0x65')]('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[_0x5424('0x3a')](_0x410fe0[_0x5424('0x4')])[_0x5424('0x28')],_0x410fe0[_0x5424('0x4')]);gs[_0x5424('0x66')](_0xdb21b)[_0x5424('0x3c')](function(){_0x410fe0[_0x5424('0x4')]=util[_0x5424('0x65')](_0x5424('0x67'),path[_0x5424('0x3a')](_0x410fe0[_0x5424('0x4')])[_0x5424('0x68')],path[_0x5424('0x3a')](_0x410fe0[_0x5424('0x4')])[_0x5424('0x28')]);_0x55445e[_0x5424('0x69')]=_0x410fe0[_0x5424('0x4')];ut[_0x5424('0x4a')](_0x5424('0x6a'),'');ami[_0x5424('0x6b')](ut['variablesAction'](_0x410fe0,_0x55445e))[_0x5424('0x3c')](function(_0x35def6){_0x222bc6(_0x35def6);})['catch'](function(_0x789f1e){_0x430407(_0x789f1e);});})[_0x5424('0x3e')](function(_0x2ebb5f){_0x430407(_0x2ebb5f);});}else{ami['Action'](ut[_0x5424('0x6c')](_0x410fe0,_0x55445e))[_0x5424('0x3c')](function(_0x4ccdb7){_0x222bc6(_0x4ccdb7);})[_0x5424('0x3e')](function(_0x1d6338){_0x430407(_0x1d6338);});}});}Fax[_0x5424('0x20')][_0x5424('0x5a')]=function(_0x35a6dc,_0x1f5e05){var _0x4aab2c=this;return new BPromise(function(_0x407851,_0x2d70ba){var _0x918ed9=uuid['v4']();var _0x3fcc8b=ut[_0x5424('0x6d')](_0x35a6dc,_0x1f5e05);_0x4aab2c[_0x5424('0x11')][_0x918ed9]=new Action(_0x918ed9,_0x1f5e05,_0x35a6dc);var _0x2d3e4b=_0x4aab2c[_0x5424('0x11')][_0x918ed9];if(path[_0x5424('0x3a')](_0x35a6dc[_0x5424('0x4')])[_0x5424('0x6e')]===_0x5424('0x3d')){originate(_0x2d3e4b,_0x3fcc8b,!![])[_0x5424('0x3c')](function(_0x5798fe){_0x407851(_0x5798fe);})[_0x5424('0x3e')](function(_0x4799b3){_0x2d70ba(_0x4799b3);});}else{originate(_0x2d3e4b,_0x3fcc8b,![])['then'](function(_0x163b90){_0x407851(_0x163b90);})[_0x5424('0x3e')](function(_0x719fd8){_0x2d70ba(_0x719fd8);});}});};Fax['prototype'][_0x5424('0x6f')]=function(_0x1d71a3){return!_[_0x5424('0x70')](_0x1d71a3)&&!_['isNil'](_0x1d71a3[_0x5424('0x28')])&&!_['isNil'](_0x1d71a3[_0x5424('0x71')])&&_0x1d71a3[_0x5424('0x71')]&&!_['isNil'](this[_0x5424('0x10')][util[_0x5424('0x65')](_0x5424('0x72'),_0x1d71a3[_0x5424('0x28')])])&&!_['isNil'](this[_0x5424('0x10')][util[_0x5424('0x65')](_0x5424('0x72'),_0x1d71a3[_0x5424('0x28')])][_0x5424('0x2f')])&&(this[_0x5424('0x10')][util[_0x5424('0x65')](_0x5424('0x72'),_0x1d71a3[_0x5424('0x28')])][_0x5424('0x2f')]===_0x5424('0x73')||this[_0x5424('0x10')][util[_0x5424('0x65')](_0x5424('0x72'),_0x1d71a3[_0x5424('0x28')])][_0x5424('0x2f')]===_0x5424('0x74'));};Fax[_0x5424('0x20')][_0x5424('0x61')]=function(_0x4b6302,_0x5331f0){if(!this[_0x5424('0x6f')](_0x4b6302)){ut[_0x5424('0x4a')](_0x5424('0x75'),_[_0x5424('0x70')](_0x4b6302)?'':_0x4b6302[_0x5424('0x28')]+_0x5424('0x76'));return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_['isNil'](_0x5331f0['fax'])){ut[_0x5424('0x4a')]('[Fax][checkTrunk][Empty\x20Fax]',JSON['stringify'](_0x5331f0));return{'isValid':![],'message':_0x5424('0x77')};}if(_[_0x5424('0x70')](_0x5331f0[_0x5424('0x4')])){ut[_0x5424('0x4a')]('[Fax][checkTrunk][Empty\x20path]',JSON[_0x5424('0x41')](_0x5331f0));return{'isValid':![],'message':_0x5424('0x78')};}return{'isValid':!![],'message':_0x5424('0x79')};};module[_0x5424('0x7a')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index d437887..32709c7 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 _0x5410=['preview','../rpc/faxAccount','error','inspect','notify','resolve','catch','[Notify]\x20','util','bluebird'];(function(_0x16c7c8,_0x2fc32f){var _0x99277c=function(_0x48d7ad){while(--_0x48d7ad){_0x16c7c8['push'](_0x16c7c8['shift']());}};_0x99277c(++_0x2fc32f);}(_0x5410,0x18e));var _0x0541=function(_0x204a34,_0x396023){_0x204a34=_0x204a34-0x0;var _0x5591c6=_0x5410[_0x204a34];return _0x5591c6;};'use strict';var util=require(_0x0541('0x0'));var BPromise=require(_0x0541('0x1'));var logger=require('../../../config/logger')(_0x0541('0x2'));var _=require('lodash');var faxAccount=require(_0x0541('0x3'));function loggerCatch(_0x423160){return function(_0x4b2955){logger[_0x0541('0x4')](_0x423160,util[_0x0541('0x5')](_0x4b2955,{'showHidden':![],'depth':null}));};}exports[_0x0541('0x6')]=function(_0x221a11,_0x908b9a){return BPromise[_0x0541('0x7')]()['then'](faxAccount[_0x0541('0x6')](_0x221a11,_0x908b9a))[_0x0541('0x8')](loggerCatch(_0x0541('0x9')));}; \ No newline at end of file +var _0xf97c=['notify','resolve','[Notify]\x20','util','bluebird','../../../config/logger','lodash','../rpc/faxAccount'];(function(_0x49cf57,_0x428742){var _0x15eca3=function(_0x3c8468){while(--_0x3c8468){_0x49cf57['push'](_0x49cf57['shift']());}};_0x15eca3(++_0x428742);}(_0xf97c,0xbb));var _0xcf97=function(_0x56feee,_0x4d26c7){_0x56feee=_0x56feee-0x0;var _0x554d3e=_0xf97c[_0x56feee];return _0x554d3e;};'use strict';var util=require(_0xcf97('0x0'));var BPromise=require(_0xcf97('0x1'));var logger=require(_0xcf97('0x2'))('preview');var _=require(_0xcf97('0x3'));var faxAccount=require(_0xcf97('0x4'));function loggerCatch(_0x2cc395){return function(_0x3d8b58){logger['error'](_0x2cc395,util['inspect'](_0x3d8b58,{'showHidden':![],'depth':null}));};}exports[_0xcf97('0x5')]=function(_0x3c74db,_0x30fc68){return BPromise[_0xcf97('0x6')]()['then'](faxAccount[_0xcf97('0x5')](_0x3c74db,_0x30fc68))['catch'](loggerCatch(_0xcf97('0x7')));}; \ 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 aded54f..b1854a4 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 _0x9a8e=['../../../../config/logger','fax','bluebird','child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect','util'];(function(_0x54baa4,_0x464c84){var _0x10e435=function(_0x4e125a){while(--_0x4e125a){_0x54baa4['push'](_0x54baa4['shift']());}};_0x10e435(++_0x464c84);}(_0x9a8e,0xaf));var _0xe9a8=function(_0x1f388b,_0x5a51f5){_0x1f388b=_0x1f388b-0x0;var _0x4d07ee=_0x9a8e[_0x1f388b];return _0x4d07ee;};'use strict';var util=require(_0xe9a8('0x0'));var logger=require(_0xe9a8('0x1'))(_0xe9a8('0x2'));var BPromise=require(_0xe9a8('0x3'));var exec=require(_0xe9a8('0x4'))[_0xe9a8('0x5')];exports[_0xe9a8('0x6')]=function(_0x2faa20){return new BPromise(function(_0x888b3b,_0x28dfe9){exec(_0x2faa20,function(_0x300e2b,_0x52e160,_0x59ff2c){logger['info']('Exec\x20gs',_0x52e160);if(_0x300e2b){logger[_0xe9a8('0x7')](_0xe9a8('0x8'),_0xe9a8('0x9'),util[_0xe9a8('0xa')](_0x300e2b,{'showHidden':![],'depth':null}),_0x52e160,_0x59ff2c);_0x28dfe9(_0x300e2b);}_0x888b3b(_0x52e160);});});}; \ No newline at end of file +var _0xd4e1=['Exec\x20gs','info','\x20Error\x20:','util','fax','exec'];(function(_0x9b41fc,_0x44ac55){var _0x5883c3=function(_0x1e9f81){while(--_0x1e9f81){_0x9b41fc['push'](_0x9b41fc['shift']());}};_0x5883c3(++_0x44ac55);}(_0xd4e1,0x8d));var _0x1d4e=function(_0x5e1d15,_0x3394b7){_0x5e1d15=_0x5e1d15-0x0;var _0x5b1584=_0xd4e1[_0x5e1d15];return _0x5b1584;};'use strict';var util=require(_0x1d4e('0x0'));var logger=require('../../../../config/logger')(_0x1d4e('0x1'));var BPromise=require('bluebird');var exec=require('child_process')[_0x1d4e('0x2')];exports['execute']=function(_0x1f75ed){return new BPromise(function(_0x27dbcf,_0x582aeb){exec(_0x1f75ed,function(_0x2e77d8,_0x50dd39,_0x24b966){logger['info'](_0x1d4e('0x3'),_0x50dd39);if(_0x2e77d8){logger[_0x1d4e('0x4')]('Exec\x20gs',_0x1d4e('0x5'),util['inspect'](_0x2e77d8,{'showHidden':![],'depth':null}),_0x50dd39,_0x24b966);_0x582aeb(_0x2e77d8);}_0x27dbcf(_0x50dd39);});});}; \ 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 2feb4ae..4c06ebc 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 _0x60f1=['addVariables','ecm','headerinfo','minrate','maxrate','format','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','channel','xcally-motion-fax','from-sip','util','lodash','moment','fax','logger','inspect'];(function(_0x4553ea,_0x3e207b){var _0xb8fc44=function(_0x26c5a5){while(--_0x26c5a5){_0x4553ea['push'](_0x4553ea['shift']());}};_0xb8fc44(++_0x3e207b);}(_0x60f1,0x174));var _0x160f=function(_0x3494e8,_0x4111ea){_0x3494e8=_0x3494e8-0x0;var _0x20bd8c=_0x60f1[_0x3494e8];return _0x20bd8c;};'use strict';var util=require(_0x160f('0x0'));var _=require(_0x160f('0x1'));var moment=require(_0x160f('0x2'));var logger=require('../../../../config/logger')(_0x160f('0x3'));exports['message']=function(_0x39348f){return{'message':_0x39348f};};exports[_0x160f('0x4')]=function(_0x1e1998,_0x433e9e){logger['info'](_0x1e1998,util[_0x160f('0x5')](_0x433e9e,{'showHidden':![],'depth':null}));};exports[_0x160f('0x6')]=function(_0x3d1717,_0x5f2221){var _0xb5a6a0={'XMF-ECM':_0x5f2221[_0x160f('0x7')],'XMF-HEADERINFO':_0x5f2221[_0x160f('0x8')],'XMF-MINRATE':_0x5f2221[_0x160f('0x9')],'XMF-MAXRATE':_0x5f2221[_0x160f('0xa')],'XMF-MODEM':util[_0x160f('0xb')]('\x22%s\x22',_0x5f2221['modem']),'XMF-GATEWAY':_0x5f2221[_0x160f('0xc')],'XMF-FAXDETECT':_0x5f2221[_0x160f('0xd')],'XMF-T38TIMEOUT':_0x5f2221[_0x160f('0xe')],'XMF-LOCALSTATIONID':_0x5f2221[_0x160f('0xf')],'XMF-PATH':_0x3d1717[_0x160f('0x10')]};return _0xb5a6a0;};exports[_0x160f('0x11')]=function(_0x3a985b,_0x46a55a){return{'actionid':_0x3a985b['uniqueid'],'action':'originate','channel':_0x3a985b[_0x160f('0x12')],'Exten':_0x160f('0x13'),'Context':_0x160f('0x14'),'Priority':'1','callerid':util[_0x160f('0xb')]('\x22%s\x22\x20<%s>',_0x3a985b[_0x160f('0x8')]?_0x3a985b[_0x160f('0x8')]:'',_0x3a985b[_0x160f('0xf')]),'variable':_0x46a55a,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x3a985b['uniqueid']};}; \ No newline at end of file +var _0x0595=['moment','fax','info','addVariables','ecm','maxrate','format','\x22%s\x22','modem','gateway','t38timeout','path','uniqueid','originate','channel','from-sip','\x22%s\x22\x20<%s>','headerinfo','localstationid','util','lodash'];(function(_0x3db9b7,_0x17195b){var _0x304a1f=function(_0x4853f7){while(--_0x4853f7){_0x3db9b7['push'](_0x3db9b7['shift']());}};_0x304a1f(++_0x17195b);}(_0x0595,0x18d));var _0x5059=function(_0x1cd719,_0x4ae6c3){_0x1cd719=_0x1cd719-0x0;var _0x199f7a=_0x0595[_0x1cd719];return _0x199f7a;};'use strict';var util=require(_0x5059('0x0'));var _=require(_0x5059('0x1'));var moment=require(_0x5059('0x2'));var logger=require('../../../../config/logger')(_0x5059('0x3'));exports['message']=function(_0x4cb8f4){return{'message':_0x4cb8f4};};exports['logger']=function(_0x1707eb,_0x1d346b){logger[_0x5059('0x4')](_0x1707eb,util['inspect'](_0x1d346b,{'showHidden':![],'depth':null}));};exports[_0x5059('0x5')]=function(_0x3fca70,_0x26217d){var _0x549ffb={'XMF-ECM':_0x26217d[_0x5059('0x6')],'XMF-HEADERINFO':_0x26217d['headerinfo'],'XMF-MINRATE':_0x26217d['minrate'],'XMF-MAXRATE':_0x26217d[_0x5059('0x7')],'XMF-MODEM':util[_0x5059('0x8')](_0x5059('0x9'),_0x26217d[_0x5059('0xa')]),'XMF-GATEWAY':_0x26217d[_0x5059('0xb')],'XMF-FAXDETECT':_0x26217d['faxdetect'],'XMF-T38TIMEOUT':_0x26217d[_0x5059('0xc')],'XMF-LOCALSTATIONID':_0x26217d['localstationid'],'XMF-PATH':_0x3fca70[_0x5059('0xd')]};return _0x549ffb;};exports['variablesAction']=function(_0x43deb9,_0x44536b){return{'actionid':_0x43deb9[_0x5059('0xe')],'action':_0x5059('0xf'),'channel':_0x43deb9[_0x5059('0x10')],'Exten':'xcally-motion-fax','Context':_0x5059('0x11'),'Priority':'1','callerid':util[_0x5059('0x8')](_0x5059('0x12'),_0x43deb9['headerinfo']?_0x43deb9[_0x5059('0x13')]:'',_0x43deb9[_0x5059('0x14')]),'variable':_0x44536b,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x43deb9['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index f5c62a7..9b051a6 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 _0xf5a2=['./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','then','getAgents','initAgents','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','initTemplates','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','initServicenowAccounts','getDynamics365Accounts','getCampaigns','getVoiceExtensions','getFaxAccounts','resolve','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','listen','bluebird','util','moment','./server','./realtime','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/voiceExtension','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk'];(function(_0x50e593,_0x3ae998){var _0x3821d0=function(_0x53c295){while(--_0x53c295){_0x50e593['push'](_0x50e593['shift']());}};_0x3821d0(++_0x3ae998);}(_0xf5a2,0xed));var _0x2f5a=function(_0x1b8f42,_0x398681){_0x1b8f42=_0x1b8f42-0x0;var _0x122954=_0xf5a2[_0x1b8f42];return _0x122954;};'use strict';var BPromise=require(_0x2f5a('0x0'));var util=require(_0x2f5a('0x1'));var moment=require(_0x2f5a('0x2'));var server=require(_0x2f5a('0x3'));var Realtime=require(_0x2f5a('0x4'));var Report=require('./report');var Acw=require(_0x2f5a('0x5'));var Trigger=require(_0x2f5a('0x6'));var Dialer=require(_0x2f5a('0x7'));var Preview=require(_0x2f5a('0x8'));var Fax=require(_0x2f5a('0x9'));var user=require(_0x2f5a('0xa'));var voiceQueue=require(_0x2f5a('0xb'));var voiceQueueReport=require(_0x2f5a('0xc'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x2f5a('0xd'));var trigger=require('./rpc/trigger');var template=require('./rpc/template');var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require('./rpc/campaign');var voiceExtension=require(_0x2f5a('0xe'));var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x2f5a('0xf'));var salesforce=require(_0x2f5a('0x10'));var sugarcrm=require(_0x2f5a('0x11'));var freshdesk=require(_0x2f5a('0x12'));var desk=require(_0x2f5a('0x13'));var zoho=require(_0x2f5a('0x14'));var vtiger=require(_0x2f5a('0x15'));var servicenow=require(_0x2f5a('0x16'));var dynamics365=require(_0x2f5a('0x17'));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()[_0x2f5a('0x18')](_0x2f5a('0x19'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x2f5a('0x18')](_0x2f5a('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0x2f5a('0x1a')](user[_0x2f5a('0x1b')]())[_0x2f5a('0x1a')](realtime[_0x2f5a('0x1c')]())[_0x2f5a('0x1a')](user['getTelephones']())[_0x2f5a('0x1a')](realtime[_0x2f5a('0x1d')]())['then'](trunk[_0x2f5a('0x1e')]())[_0x2f5a('0x1a')](realtime[_0x2f5a('0x1f')]())[_0x2f5a('0x1a')](voiceQueue[_0x2f5a('0x20')]())[_0x2f5a('0x1a')](realtime[_0x2f5a('0x21')]())[_0x2f5a('0x1a')](trigger[_0x2f5a('0x22')]())[_0x2f5a('0x1a')](realtime[_0x2f5a('0x23')]())['then'](template['getTemplates']())[_0x2f5a('0x1a')](realtime[_0x2f5a('0x24')]())[_0x2f5a('0x1a')](zendesk['getZendeskAccounts']())[_0x2f5a('0x1a')](realtime[_0x2f5a('0x25')]())['then'](salesforce[_0x2f5a('0x26')]())[_0x2f5a('0x1a')](realtime[_0x2f5a('0x27')]())[_0x2f5a('0x1a')](sugarcrm[_0x2f5a('0x28')]())[_0x2f5a('0x1a')](realtime[_0x2f5a('0x29')]())[_0x2f5a('0x1a')](freshdesk[_0x2f5a('0x2a')]())[_0x2f5a('0x1a')](realtime[_0x2f5a('0x2b')]())[_0x2f5a('0x1a')](desk[_0x2f5a('0x2c')]())[_0x2f5a('0x1a')](realtime[_0x2f5a('0x2d')]())[_0x2f5a('0x1a')](zoho['getZohoAccounts']())[_0x2f5a('0x1a')](realtime[_0x2f5a('0x2e')]())['then'](vtiger[_0x2f5a('0x2f')]())[_0x2f5a('0x1a')](realtime[_0x2f5a('0x30')]())[_0x2f5a('0x1a')](servicenow['getServicenowAccounts']())[_0x2f5a('0x1a')](realtime[_0x2f5a('0x31')]())[_0x2f5a('0x1a')](dynamics365[_0x2f5a('0x32')]())[_0x2f5a('0x1a')](realtime['initDynamics365Accounts']())[_0x2f5a('0x1a')](campaign[_0x2f5a('0x33')]())[_0x2f5a('0x1a')](realtime['initCampaigns']())[_0x2f5a('0x1a')](voiceExtension[_0x2f5a('0x34')]())[_0x2f5a('0x1a')](realtime['initVoiceExtensions']())[_0x2f5a('0x1a')](faxAccount[_0x2f5a('0x35')]())[_0x2f5a('0x1a')](realtime['initFaxAccounts']())['then'](function(){return realtime;});}function initParams(){return BPromise[_0x2f5a('0x36')]()[_0x2f5a('0x1a')](voiceQueueReport[_0x2f5a('0x37')]())['then'](realtime[_0x2f5a('0x38')]())[_0x2f5a('0x1a')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x2f5a('0x1a')](realtime[_0x2f5a('0x39')]())[_0x2f5a('0x1a')](cmHopperHistory['getCampaignHopperHistory']())[_0x2f5a('0x1a')](realtime[_0x2f5a('0x3a')]())[_0x2f5a('0x1a')](voiceCallReport[_0x2f5a('0x3b')]())[_0x2f5a('0x1a')](realtime[_0x2f5a('0x3c')]())[_0x2f5a('0x1a')](function(_0x52460c){})[_0x2f5a('0x3d')](function(_0x19c4c9){console[_0x2f5a('0x3e')](_0x19c4c9);});}function main(){return server[_0x2f5a('0x3f')](realtime,preview,fax)[_0x2f5a('0x1a')](function(_0x5260f1){return initRealtime();})[_0x2f5a('0x1a')](function(){return initParams();})['then'](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x2f5a('0x3d')](function(_0x47c1f3){console['log'](_0x47c1f3);});}main(); \ No newline at end of file +var _0x5dee=['initSugarcrmAccounts','getDeskAccounts','initDeskAccounts','initVtigerAccounts','initServicenowAccounts','getDynamics365Accounts','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','catch','log','listen','sync','bluebird','util','moment','./server','./realtime','./report','./acw','./dialer','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trunk','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','getAgents','initAgents','getTelephones','then','getTrunks','initTrunks','initVoiceQueues','initTriggers','getTemplates','getZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts'];(function(_0x5a5d6c,_0x4be248){var _0x28952e=function(_0x276908){while(--_0x276908){_0x5a5d6c['push'](_0x5a5d6c['shift']());}};_0x28952e(++_0x4be248);}(_0x5dee,0x13f));var _0xe5de=function(_0x41a75c,_0x30d258){_0x41a75c=_0x41a75c-0x0;var _0x13dfb9=_0x5dee[_0x41a75c];return _0x13dfb9;};'use strict';var BPromise=require(_0xe5de('0x0'));var util=require(_0xe5de('0x1'));var moment=require(_0xe5de('0x2'));var server=require(_0xe5de('0x3'));var Realtime=require(_0xe5de('0x4'));var Report=require(_0xe5de('0x5'));var Acw=require(_0xe5de('0x6'));var Trigger=require('./trigger');var Dialer=require(_0xe5de('0x7'));var Preview=require('./preview');var Fax=require(_0xe5de('0x8'));var user=require(_0xe5de('0x9'));var voiceQueue=require(_0xe5de('0xa'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0xe5de('0xb'));var trunk=require(_0xe5de('0xc'));var trigger=require('./rpc/trigger');var template=require(_0xe5de('0xd'));var cmHopperHistory=require(_0xe5de('0xe'));var campaign=require(_0xe5de('0xf'));var voiceExtension=require(_0xe5de('0x10'));var faxAccount=require(_0xe5de('0x11'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0xe5de('0x12'));var sugarcrm=require(_0xe5de('0x13'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0xe5de('0x14'));var zoho=require(_0xe5de('0x15'));var vtiger=require(_0xe5de('0x16'));var servicenow=require(_0xe5de('0x17'));var dynamics365=require(_0xe5de('0x18'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xe5de('0x19')](_0xe5de('0x1a'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xe5de('0x19')](_0xe5de('0x1a'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xe5de('0x1b')]()['then'](user[_0xe5de('0x1c')]())['then'](realtime[_0xe5de('0x1d')]())['then'](user[_0xe5de('0x1e')]())[_0xe5de('0x1f')](realtime['initTelephones']())[_0xe5de('0x1f')](trunk[_0xe5de('0x20')]())[_0xe5de('0x1f')](realtime[_0xe5de('0x21')]())['then'](voiceQueue['getVoiceQueues']())['then'](realtime[_0xe5de('0x22')]())['then'](trigger['getTriggers']())[_0xe5de('0x1f')](realtime[_0xe5de('0x23')]())['then'](template[_0xe5de('0x24')]())[_0xe5de('0x1f')](realtime['initTemplates']())[_0xe5de('0x1f')](zendesk[_0xe5de('0x25')]())[_0xe5de('0x1f')](realtime['initZendeskAccounts']())[_0xe5de('0x1f')](salesforce[_0xe5de('0x26')]())[_0xe5de('0x1f')](realtime[_0xe5de('0x27')]())[_0xe5de('0x1f')](sugarcrm[_0xe5de('0x28')]())[_0xe5de('0x1f')](realtime[_0xe5de('0x29')]())[_0xe5de('0x1f')](freshdesk['getFreshdeskAccounts']())['then'](realtime['initFreshdeskAccounts']())[_0xe5de('0x1f')](desk[_0xe5de('0x2a')]())[_0xe5de('0x1f')](realtime[_0xe5de('0x2b')]())[_0xe5de('0x1f')](zoho['getZohoAccounts']())[_0xe5de('0x1f')](realtime['initZohoAccounts']())['then'](vtiger['getVtigerAccounts']())['then'](realtime[_0xe5de('0x2c')]())[_0xe5de('0x1f')](servicenow['getServicenowAccounts']())['then'](realtime[_0xe5de('0x2d')]())[_0xe5de('0x1f')](dynamics365[_0xe5de('0x2e')]())[_0xe5de('0x1f')](realtime['initDynamics365Accounts']())[_0xe5de('0x1f')](campaign['getCampaigns']())[_0xe5de('0x1f')](realtime['initCampaigns']())[_0xe5de('0x1f')](voiceExtension[_0xe5de('0x2f')]())[_0xe5de('0x1f')](realtime[_0xe5de('0x30')]())[_0xe5de('0x1f')](faxAccount[_0xe5de('0x31')]())[_0xe5de('0x1f')](realtime[_0xe5de('0x32')]())[_0xe5de('0x1f')](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0xe5de('0x1f')](voiceQueueReport['getVoiceQueueReports']())[_0xe5de('0x1f')](realtime[_0xe5de('0x33')]())[_0xe5de('0x1f')](cmHopperHistory[_0xe5de('0x34')]())[_0xe5de('0x1f')](realtime[_0xe5de('0x35')]())[_0xe5de('0x1f')](cmHopperHistory[_0xe5de('0x36')]())[_0xe5de('0x1f')](realtime['initCampaignHopperHistory']())[_0xe5de('0x1f')](voiceCallReport[_0xe5de('0x37')]())[_0xe5de('0x1f')](realtime['initVoiceCallReports']())[_0xe5de('0x1f')](function(_0x2ef021){})[_0xe5de('0x38')](function(_0x9c4a2b){console[_0xe5de('0x39')](_0x9c4a2b);});}function main(){return server[_0xe5de('0x3a')](realtime,preview,fax)[_0xe5de('0x1f')](function(_0x268a76){return initRealtime();})['then'](function(){return initParams();})[_0xe5de('0x1f')](function(){report[_0xe5de('0x3b')]();setInterval(initRealtime,0x1388);})[_0xe5de('0x38')](function(_0x883034){console[_0xe5de('0x39')](_0x883034);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 355bc3c..e3b078a 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 _0x9997=['voiceStatusCallerIdNumber','voiceStatusQueue','local','prototype','updateStatusRealtime','not_inuse','idle','inuse','talking','format','fullname','stateTime','status','online','stringify','user:%s','lodash','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','email','accountcode','state','unknown','address','phone','mobile','voiceStatus','voiceStatusTime'];(function(_0x4fa721,_0x32d327){var _0xffbd79=function(_0x5420aa){while(--_0x5420aa){_0x4fa721['push'](_0x4fa721['shift']());}};_0xffbd79(++_0x32d327);}(_0x9997,0x120));var _0x7999=function(_0x2543d6,_0x3a5e78){_0x2543d6=_0x2543d6-0x0;var _0x55213c=_0x9997[_0x2543d6];return _0x55213c;};'use strict';var _=require(_0x7999('0x0'));var util=require('util');var moment=require(_0x7999('0x1'));var md5=require(_0x7999('0x2'));var Redis=require(_0x7999('0x3'));var config=require(_0x7999('0x4'));config[_0x7999('0x5')]=_['defaults'](config[_0x7999('0x5')],{'host':_0x7999('0x6'),'port':0x18eb});var io=require(_0x7999('0x7'))(new Redis(config[_0x7999('0x5')]));function Agent(_0x364b38){this['id']=_0x364b38['id']||0x0;this[_0x7999('0x8')]=_0x364b38['name']||'';this[_0x7999('0x9')]=_0x364b38[_0x7999('0x9')]||'';this[_0x7999('0xa')]=_0x364b38[_0x7999('0xa')]||'';this['fullname']=_0x364b38['fullname']||'';this[_0x7999('0xb')]=_0x7999('0xc');this['stateTime']=0x0;this['status']=_0x7999('0xc');this[_0x7999('0xd')]='';this[_0x7999('0xe')]='';this[_0x7999('0xf')]='';this['interface']='';this['online']=_0x364b38['online']||![];this[_0x7999('0x10')]=_0x7999('0xc');this[_0x7999('0x11')]=0x0;this[_0x7999('0x12')]='';this[_0x7999('0x13')]='';this['onhold']=![];this[_0x7999('0x14')]=![];this['md5']='';}Agent[_0x7999('0x15')][_0x7999('0x16')]=function(_0x1fc89d){var _0x57dc2f;if(_0x1fc89d&&_0x1fc89d[_0x7999('0xb')]){_0x57dc2f=_0x1fc89d[_0x7999('0xb')]['toLowerCase']();switch(_0x57dc2f){case _0x7999('0x17'):_0x57dc2f=_0x7999('0x18');break;case _0x7999('0x19'):_0x57dc2f=_0x7999('0x1a');break;}}if(_0x57dc2f&&this[_0x7999('0x10')]!==_0x57dc2f||_0x1fc89d['statePause']){this['voiceStatusTime']=_['toNumber'](moment()[_0x7999('0x1b')]('x'));}if(_0x57dc2f){this[_0x7999('0x10')]=_0x57dc2f;}var _0x45ab7c={'id':this['id'],'name':this[_0x7999('0x8')],'email':this[_0x7999('0x9')],'accountcode':this[_0x7999('0xa')],'fullname':this[_0x7999('0x1c')],'state':this['state'],'stateTime':this[_0x7999('0x1d')],'status':this[_0x7999('0x1e')],'address':this[_0x7999('0xd')],'online':this[_0x7999('0x1f')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x7999('0x11')],'voiceStatusCallerIdNumber':this[_0x7999('0x12')],'voiceStatusQueue':this[_0x7999('0x13')],'interface':this['interface'],'onhold':this['onhold']};var _0x43cc06=md5(JSON[_0x7999('0x20')](_0x45ab7c));if(this[_0x7999('0x2')]!==_0x43cc06){this[_0x7999('0x2')]=_0x43cc06;io['to'](util[_0x7999('0x1b')](_0x7999('0x21'),_0x45ab7c[_0x7999('0x8')]))['emit']('user:save',_0x45ab7c);}};module['exports']=Agent; \ No newline at end of file +var _0x742c=['ioredis','redis','defaults','localhost','name','email','accountcode','fullname','state','unknown','stateTime','address','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause','toNumber','status','interface','stringify','format','user:%s','emit','user:save','exports','util','md5'];(function(_0x330ac6,_0x3adc83){var _0x59b845=function(_0x191b10){while(--_0x191b10){_0x330ac6['push'](_0x330ac6['shift']());}};_0x59b845(++_0x3adc83);}(_0x742c,0x1c6));var _0xc742=function(_0x4fc80b,_0xfe1b3d){_0x4fc80b=_0x4fc80b-0x0;var _0x119dba=_0x742c[_0x4fc80b];return _0x119dba;};'use strict';var _=require('lodash');var util=require(_0xc742('0x0'));var moment=require('moment');var md5=require(_0xc742('0x1'));var Redis=require(_0xc742('0x2'));var config=require('../../../config/environment');config[_0xc742('0x3')]=_[_0xc742('0x4')](config['redis'],{'host':_0xc742('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc742('0x3')]));function Agent(_0x290a88){this['id']=_0x290a88['id']||0x0;this[_0xc742('0x6')]=_0x290a88[_0xc742('0x6')]||'';this[_0xc742('0x7')]=_0x290a88[_0xc742('0x7')]||'';this[_0xc742('0x8')]=_0x290a88[_0xc742('0x8')]||'';this[_0xc742('0x9')]=_0x290a88[_0xc742('0x9')]||'';this[_0xc742('0xa')]=_0xc742('0xb');this[_0xc742('0xc')]=0x0;this['status']='unknown';this[_0xc742('0xd')]='';this['phone']='';this[_0xc742('0xe')]='';this['interface']='';this[_0xc742('0xf')]=_0x290a88[_0xc742('0xf')]||![];this[_0xc742('0x10')]=_0xc742('0xb');this[_0xc742('0x11')]=0x0;this[_0xc742('0x12')]='';this[_0xc742('0x13')]='';this[_0xc742('0x14')]=![];this['local']=![];this[_0xc742('0x1')]='';}Agent[_0xc742('0x15')][_0xc742('0x16')]=function(_0xaf3140){var _0x55a547;if(_0xaf3140&&_0xaf3140[_0xc742('0xa')]){_0x55a547=_0xaf3140[_0xc742('0xa')][_0xc742('0x17')]();switch(_0x55a547){case _0xc742('0x18'):_0x55a547=_0xc742('0x19');break;case _0xc742('0x1a'):_0x55a547=_0xc742('0x1b');break;}}if(_0x55a547&&this['voiceStatus']!==_0x55a547||_0xaf3140[_0xc742('0x1c')]){this[_0xc742('0x11')]=_[_0xc742('0x1d')](moment()['format']('x'));}if(_0x55a547){this[_0xc742('0x10')]=_0x55a547;}var _0x2799e2={'id':this['id'],'name':this[_0xc742('0x6')],'email':this[_0xc742('0x7')],'accountcode':this[_0xc742('0x8')],'fullname':this[_0xc742('0x9')],'state':this['state'],'stateTime':this['stateTime'],'status':this[_0xc742('0x1e')],'address':this['address'],'online':this[_0xc742('0xf')],'voiceStatus':this[_0xc742('0x10')],'voiceStatusTime':this[_0xc742('0x11')],'voiceStatusCallerIdNumber':this[_0xc742('0x12')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0xc742('0x1f')],'onhold':this[_0xc742('0x14')]};var _0x3b1f61=md5(JSON[_0xc742('0x20')](_0x2799e2));if(this[_0xc742('0x1')]!==_0x3b1f61){this[_0xc742('0x1')]=_0x3b1f61;io['to'](util[_0xc742('0x21')](_0xc742('0x22'),_0x2799e2['name']))[_0xc742('0x23')](_0xc742('0x24'),_0x2799e2);}};module[_0xc742('0x25')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index b1d077e..6a2ab49 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 _0x22dd=['message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','SquareProject','dialQueueProject','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays'];(function(_0x213518,_0x51e022){var _0x1baf75=function(_0x5c8444){while(--_0x5c8444){_0x213518['push'](_0x213518['shift']());}};_0x1baf75(++_0x51e022);}(_0x22dd,0xe4));var _0xd22d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x22dd[_0x3dd15e];return _0x231fd0;};'use strict';function Campaign(_0x3c5b33){this['id']=_0x3c5b33['id']||0x0;this[_0xd22d('0x0')]=_0x3c5b33[_0xd22d('0x0')]||'';this['type']=_0x3c5b33['type']||_0xd22d('0x1');this[_0xd22d('0x2')]=0x0;this[_0xd22d('0x3')]=0x0;this[_0xd22d('0x4')]=0x0;this[_0xd22d('0x5')]=0x0;this[_0xd22d('0x6')]='';this[_0xd22d('0x7')]=!![];this[_0xd22d('0x8')]=_0x3c5b33[_0xd22d('0x8')];this[_0xd22d('0x9')]=_0x3c5b33['limitCalls'];this[_0xd22d('0xa')]=_0x3c5b33[_0xd22d('0xa')]||null;this['dialGlobalInterval']=_0x3c5b33[_0xd22d('0xb')]?_0x3c5b33['dialGlobalInterval']:null;this[_0xd22d('0xc')]=_0x3c5b33['dialOriginateCallerIdName'];this[_0xd22d('0xd')]=_0x3c5b33[_0xd22d('0xd')];this[_0xd22d('0xe')]=_0x3c5b33[_0xd22d('0xe')]||0x1e;this[_0xd22d('0xf')]=_0x3c5b33[_0xd22d('0xf')];this[_0xd22d('0x10')]=_0x3c5b33[_0xd22d('0x10')];this['dialBusyMaxRetry']=_0x3c5b33[_0xd22d('0x11')];this[_0xd22d('0x12')]=_0x3c5b33['dialBusyRetryFrequency'];this[_0xd22d('0x13')]=_0x3c5b33[_0xd22d('0x13')];this['dialNoAnswerRetryFrequency']=_0x3c5b33['dialNoAnswerRetryFrequency'];this['dialGlobalMaxRetry']=_0x3c5b33[_0xd22d('0x14')];this['dialOrderByScheduledAt']=_0x3c5b33[_0xd22d('0x15')]||'DESC';this[_0xd22d('0x16')]=_0x3c5b33['dialPrefix']||undefined;this[_0xd22d('0x17')]=_0x3c5b33[_0xd22d('0x17')]||undefined;this['dialCutDigit']=_0x3c5b33[_0xd22d('0x18')]||undefined;this[_0xd22d('0x19')]=_0x3c5b33[_0xd22d('0x19')]?_0x3c5b33[_0xd22d('0x19')]:undefined;this['Trunk']=_0x3c5b33['Trunk']?_0x3c5b33[_0xd22d('0x1a')]:undefined;this['Interval']=_0x3c5b33['Interval']?_0x3c5b33['Interval']:undefined;this[_0xd22d('0x1b')]=_0x3c5b33[_0xd22d('0x1b')]?_0x3c5b33[_0xd22d('0x1b')]:undefined;this[_0xd22d('0x1c')]=_0x3c5b33[_0xd22d('0x1b')]?_0x3c5b33['SquareProject'][_0xd22d('0x0')]:undefined;this['dialAMDActive']=_0x3c5b33['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x3c5b33[_0xd22d('0x1d')];this[_0xd22d('0x1e')]=_0x3c5b33[_0xd22d('0x1e')];this[_0xd22d('0x1f')]=_0x3c5b33[_0xd22d('0x1f')];this[_0xd22d('0x20')]=_0x3c5b33[_0xd22d('0x20')];this['dialAMDMinWordLength']=_0x3c5b33[_0xd22d('0x21')];this[_0xd22d('0x22')]=_0x3c5b33['dialAMDBetweenWordsSilence'];this['dialAMDMaximumNumberOfWords']=_0x3c5b33[_0xd22d('0x23')];this[_0xd22d('0x24')]=_0x3c5b33['dialAMDSilenceThreshold'];this[_0xd22d('0x25')]=_0x3c5b33[_0xd22d('0x25')];}module[_0xd22d('0x26')]=Campaign; \ No newline at end of file +var _0x6f7a=['TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit'];(function(_0x552dc3,_0x475401){var _0x495c3a=function(_0x55827d){while(--_0x55827d){_0x552dc3['push'](_0x552dc3['shift']());}};_0x495c3a(++_0x475401);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x31d41e,_0x4d4b2e){_0x31d41e=_0x31d41e-0x0;var _0x1f6ee0=_0x6f7a[_0x31d41e];return _0x1f6ee0;};'use strict';function Campaign(_0x31411a){this['id']=_0x31411a['id']||0x0;this[_0xa6f7('0x0')]=_0x31411a[_0xa6f7('0x0')]||'';this[_0xa6f7('0x1')]=_0x31411a['type']||_0xa6f7('0x2');this[_0xa6f7('0x3')]=0x0;this[_0xa6f7('0x4')]=0x0;this[_0xa6f7('0x5')]=0x0;this[_0xa6f7('0x6')]=0x0;this[_0xa6f7('0x7')]='';this[_0xa6f7('0x8')]=!![];this[_0xa6f7('0x9')]=_0x31411a[_0xa6f7('0x9')];this[_0xa6f7('0xa')]=_0x31411a[_0xa6f7('0xa')];this['dialTimezone']=_0x31411a['dialTimezone']||null;this[_0xa6f7('0xb')]=_0x31411a[_0xa6f7('0xb')]?_0x31411a[_0xa6f7('0xb')]:null;this[_0xa6f7('0xc')]=_0x31411a[_0xa6f7('0xc')];this['dialOriginateCallerIdNumber']=_0x31411a['dialOriginateCallerIdNumber'];this[_0xa6f7('0xd')]=_0x31411a[_0xa6f7('0xd')]||0x1e;this['dialCongestionMaxRetry']=_0x31411a[_0xa6f7('0xe')];this['dialCongestionRetryFrequency']=_0x31411a[_0xa6f7('0xf')];this[_0xa6f7('0x10')]=_0x31411a[_0xa6f7('0x10')];this[_0xa6f7('0x11')]=_0x31411a['dialBusyRetryFrequency'];this[_0xa6f7('0x12')]=_0x31411a['dialNoAnswerMaxRetry'];this[_0xa6f7('0x13')]=_0x31411a[_0xa6f7('0x13')];this[_0xa6f7('0x14')]=_0x31411a['dialGlobalMaxRetry'];this[_0xa6f7('0x15')]=_0x31411a['dialOrderByScheduledAt']||_0xa6f7('0x16');this['dialPrefix']=_0x31411a[_0xa6f7('0x17')]||undefined;this[_0xa6f7('0x18')]=_0x31411a[_0xa6f7('0x18')]||undefined;this['dialCutDigit']=_0x31411a[_0xa6f7('0x19')]||undefined;this[_0xa6f7('0x1a')]=_0x31411a[_0xa6f7('0x1a')]?_0x31411a[_0xa6f7('0x1a')]:undefined;this['Trunk']=_0x31411a['Trunk']?_0x31411a[_0xa6f7('0x1b')]:undefined;this['Interval']=_0x31411a[_0xa6f7('0x1c')]?_0x31411a[_0xa6f7('0x1c')]:undefined;this['SquareProject']=_0x31411a[_0xa6f7('0x1d')]?_0x31411a[_0xa6f7('0x1d')]:undefined;this[_0xa6f7('0x1e')]=_0x31411a[_0xa6f7('0x1d')]?_0x31411a[_0xa6f7('0x1d')][_0xa6f7('0x0')]:undefined;this['dialAMDActive']=_0x31411a[_0xa6f7('0x1f')]||![];this[_0xa6f7('0x20')]=_0x31411a['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x31411a['dialAMDGreeting'];this[_0xa6f7('0x21')]=_0x31411a[_0xa6f7('0x21')];this['dialAMDTotalAnalysisTime']=_0x31411a['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x31411a[_0xa6f7('0x22')];this[_0xa6f7('0x23')]=_0x31411a[_0xa6f7('0x23')];this['dialAMDMaximumNumberOfWords']=_0x31411a['dialAMDMaximumNumberOfWords'];this[_0xa6f7('0x24')]=_0x31411a['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0x31411a[_0xa6f7('0x25')];}module['exports']=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 2f845ec..c8dc817 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 _0x1280=['monitors','transfercalleridnum','transferconnectedlinenum','exports','starttime','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','uniqueid','linkedid','exten','answered','unmanaged','abandoned','lastapplication','lastdata','billableseconds','holdtime','tag','disposition','monitor'];(function(_0x5af0fc,_0x2bf9b3){var _0x157825=function(_0x1e5402){while(--_0x1e5402){_0x5af0fc['push'](_0x5af0fc['shift']());}};_0x157825(++_0x2bf9b3);}(_0x1280,0xac));var _0x0128=function(_0x4ed1d4,_0x512d9a){_0x4ed1d4=_0x4ed1d4-0x0;var _0x28e363=_0x1280[_0x4ed1d4];return _0x28e363;};'use strict';function Channel(){this[_0x0128('0x0')]=null;this['channel']='';this[_0x0128('0x1')]='';this[_0x0128('0x2')]=0x0;this[_0x0128('0x3')]='';this[_0x0128('0x4')]=undefined;this[_0x0128('0x5')]=undefined;this[_0x0128('0x6')]=0x0;this['context']='';this[_0x0128('0x7')]=0x0;this[_0x0128('0x8')]=0x0;this[_0x0128('0x9')]=0x0;this[_0x0128('0xa')]=![];this['answertime']=null;this['endtime']=null;this[_0x0128('0xb')]=![];this[_0x0128('0xc')]=![];this[_0x0128('0xd')]='';this[_0x0128('0xe')]='';this['duration']=0x0;this[_0x0128('0xf')]=0x0;this[_0x0128('0x10')]=0x0;this['type']=null;this[_0x0128('0x11')]=null;this[_0x0128('0x12')]=null;this[_0x0128('0x13')]=![];this['monitorFilename']=null;this['queue']=null;this[_0x0128('0x14')]=[];this[_0x0128('0x15')]=undefined;this[_0x0128('0x16')]=undefined;this['mohtime']=0x0;}module[_0x0128('0x17')]=Channel; \ No newline at end of file +var _0x3974=['abandoned','lastapplication','lastdata','duration','holdtime','type','tag','monitorFilename','queue','monitors','transferconnectedlinenum','mohtime','exports','starttime','channel','destinationchannel','connectedlinenum','connectedlinename','accountcode','context','uniqueid','exten','answered','answertime','endtime'];(function(_0x316047,_0x19b753){var _0x530327=function(_0x352667){while(--_0x352667){_0x316047['push'](_0x316047['shift']());}};_0x530327(++_0x19b753);}(_0x3974,0xbc));var _0x4397=function(_0x3f98d4,_0x7c94fe){_0x3f98d4=_0x3f98d4-0x0;var _0x221f09=_0x3974[_0x3f98d4];return _0x221f09;};'use strict';function Channel(){this[_0x4397('0x0')]=null;this[_0x4397('0x1')]='';this[_0x4397('0x2')]='';this['calleridnum']=0x0;this['calleridname']='';this[_0x4397('0x3')]=undefined;this[_0x4397('0x4')]=undefined;this[_0x4397('0x5')]=0x0;this[_0x4397('0x6')]='';this[_0x4397('0x7')]=0x0;this['linkedid']=0x0;this[_0x4397('0x8')]=0x0;this[_0x4397('0x9')]=![];this[_0x4397('0xa')]=null;this[_0x4397('0xb')]=null;this['unmanaged']=![];this[_0x4397('0xc')]=![];this[_0x4397('0xd')]='';this[_0x4397('0xe')]='';this[_0x4397('0xf')]=0x0;this['billableseconds']=0x0;this[_0x4397('0x10')]=0x0;this[_0x4397('0x11')]=null;this[_0x4397('0x12')]=null;this['disposition']=null;this['monitor']=![];this[_0x4397('0x13')]=null;this[_0x4397('0x14')]=null;this[_0x4397('0x15')]=[];this['transfercalleridnum']=undefined;this[_0x4397('0x16')]=undefined;this[_0x4397('0x17')]=0x0;}module[_0x4397('0x18')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 57bc066..33d5c2b 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 _0x04ea=['exports','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0x04ea,0x1bd));var _0xa04e=function(_0xbca80b,_0x5cd39f){_0xbca80b=_0xbca80b-0x0;var _0x484524=_0x04ea[_0xbca80b];return _0x484524;};'use strict';function DeskAccount(_0x5ebd21){this['id']=_0x5ebd21['id']||0x0;this['name']=_0x5ebd21['name']||'';this[_0xa04e('0x0')]=_0x5ebd21['username']||'';this[_0xa04e('0x1')]=_0x5ebd21['remoteUri']||'';this[_0xa04e('0x2')]=_0x5ebd21[_0xa04e('0x2')]||'';this[_0xa04e('0x3')]=_0x5ebd21[_0xa04e('0x3')]||'';this['consumerKey']=_0x5ebd21[_0xa04e('0x4')]||'';this[_0xa04e('0x5')]=_0x5ebd21[_0xa04e('0x5')]||'';this[_0xa04e('0x6')]=_0x5ebd21[_0xa04e('0x6')]||'';this['tokenSecret']=_0x5ebd21[_0xa04e('0x7')]||'';this[_0xa04e('0x8')]=_0x5ebd21[_0xa04e('0x8')]||'';this[_0xa04e('0x9')]=_0x5ebd21[_0xa04e('0x9')]||'';this[_0xa04e('0xa')]=_0x5ebd21['Configurations']||{};}module[_0xa04e('0xb')]=DeskAccount; \ No newline at end of file +var _0xcc8c=['remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','name','username'];(function(_0x2a9622,_0x278ca9){var _0x3bdcad=function(_0x379933){while(--_0x379933){_0x2a9622['push'](_0x2a9622['shift']());}};_0x3bdcad(++_0x278ca9);}(_0xcc8c,0x172));var _0xccc8=function(_0x1fc735,_0x11db60){_0x1fc735=_0x1fc735-0x0;var _0x574095=_0xcc8c[_0x1fc735];return _0x574095;};'use strict';function DeskAccount(_0x1c6cf7){this['id']=_0x1c6cf7['id']||0x0;this['name']=_0x1c6cf7[_0xccc8('0x0')]||'';this[_0xccc8('0x1')]=_0x1c6cf7[_0xccc8('0x1')]||'';this[_0xccc8('0x2')]=_0x1c6cf7[_0xccc8('0x2')]||'';this[_0xccc8('0x3')]=_0x1c6cf7[_0xccc8('0x3')]||'';this[_0xccc8('0x4')]=_0x1c6cf7[_0xccc8('0x4')]||'';this['consumerKey']=_0x1c6cf7[_0xccc8('0x5')]||'';this['consumerSecret']=_0x1c6cf7[_0xccc8('0x6')]||'';this[_0xccc8('0x7')]=_0x1c6cf7[_0xccc8('0x7')]||'';this[_0xccc8('0x8')]=_0x1c6cf7[_0xccc8('0x8')]||'';this[_0xccc8('0x9')]=_0x1c6cf7['type']||'';this['serverUrl']=_0x1c6cf7[_0xccc8('0xa')]||'';this[_0xccc8('0xb')]=_0x1c6cf7[_0xccc8('0xb')]||{};}module['exports']=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index e378ff4..7efbb5a 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 _0xee30=['clientSecret','serverUrl','Configurations','exports','name','username','password','remoteUri','tenantId','clientId'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0xee30,0x7c));var _0x0ee3=function(_0x42c254,_0x20f56c){_0x42c254=_0x42c254-0x0;var _0x1bfd2b=_0xee30[_0x42c254];return _0x1bfd2b;};'use strict';function Dynamics365Account(_0x5e8420){this['id']=_0x5e8420['id']||0x0;this['name']=_0x5e8420[_0x0ee3('0x0')]||'';this[_0x0ee3('0x1')]=_0x5e8420[_0x0ee3('0x1')]||'';this[_0x0ee3('0x2')]=_0x5e8420['password']||'';this[_0x0ee3('0x3')]=_0x5e8420[_0x0ee3('0x3')]||'';this[_0x0ee3('0x4')]=_0x5e8420[_0x0ee3('0x4')]||'';this[_0x0ee3('0x5')]=_0x5e8420[_0x0ee3('0x5')]||'';this[_0x0ee3('0x6')]=_0x5e8420[_0x0ee3('0x6')]||{};this['serverUrl']=_0x5e8420[_0x0ee3('0x7')]||'';this[_0x0ee3('0x8')]=_0x5e8420['Configurations']||{};}module[_0x0ee3('0x9')]=Dynamics365Account; \ No newline at end of file +var _0xfef1=['Configurations','name','password','remoteUri','tenantId','clientId','clientSecret','serverUrl'];(function(_0x326e79,_0x33dc91){var _0x37eb89=function(_0xbaef25){while(--_0xbaef25){_0x326e79['push'](_0x326e79['shift']());}};_0x37eb89(++_0x33dc91);}(_0xfef1,0xf1));var _0x1fef=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xfef1[_0x54d4fe];return _0x1ab5bb;};'use strict';function Dynamics365Account(_0x174628){this['id']=_0x174628['id']||0x0;this['name']=_0x174628[_0x1fef('0x0')]||'';this['username']=_0x174628['username']||'';this[_0x1fef('0x1')]=_0x174628[_0x1fef('0x1')]||'';this[_0x1fef('0x2')]=_0x174628[_0x1fef('0x2')]||'';this[_0x1fef('0x3')]=_0x174628[_0x1fef('0x3')]||'';this[_0x1fef('0x4')]=_0x174628[_0x1fef('0x4')]||'';this[_0x1fef('0x5')]=_0x174628['clientSecret']||{};this[_0x1fef('0x6')]=_0x174628[_0x1fef('0x6')]||'';this['Configurations']=_0x174628[_0x1fef('0x7')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 375a2e0..2edee99 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 _0xa75b=['description','ecm','headerinfo','localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports'];(function(_0x22f2a8,_0x56fd00){var _0x5196b2=function(_0xa398b5){while(--_0xa398b5){_0x22f2a8['push'](_0x22f2a8['shift']());}};_0x5196b2(++_0x56fd00);}(_0xa75b,0x170));var _0xba75=function(_0x3543d8,_0x1f01c7){_0x3543d8=_0x3543d8-0x0;var _0x123c62=_0xa75b[_0x3543d8];return _0x123c62;};'use strict';function FaxAccount(_0x5b33c5){this['id']=_0x5b33c5['id']||0x0;this['name']=_0x5b33c5['name']||'';this[_0xba75('0x0')]=_0x5b33c5[_0xba75('0x0')];this[_0xba75('0x1')]=_0x5b33c5[_0xba75('0x1')];this[_0xba75('0x2')]=_0x5b33c5[_0xba75('0x2')];this[_0xba75('0x3')]=_0x5b33c5[_0xba75('0x3')];this[_0xba75('0x4')]=_0x5b33c5[_0xba75('0x4')]||0x960;this[_0xba75('0x5')]=_0x5b33c5[_0xba75('0x5')]||0x3840;this[_0xba75('0x6')]=_0x5b33c5['modem']||'v17,v27,v29';this[_0xba75('0x7')]=_0x5b33c5['gateway']||'no';this['faxdetect']=_0x5b33c5[_0xba75('0x8')]||'no';this['t38timeout']=_0x5b33c5[_0xba75('0x9')]||0x1388;this[_0xba75('0xa')]=_0x5b33c5[_0xba75('0xa')]||_0xba75('0xb');this[_0xba75('0xc')]=_0x5b33c5[_0xba75('0xc')]?_0x5b33c5[_0xba75('0xc')]:undefined;this[_0xba75('0xd')]=_0x5b33c5[_0xba75('0xd')];this[_0xba75('0xe')]=_0x5b33c5[_0xba75('0xe')];}module[_0xba75('0xf')]=FaxAccount; \ No newline at end of file +var _0xbf6e=['modem','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','name','description','ecm','headerinfo','localstationid','minrate','maxrate'];(function(_0x238869,_0x35fcab){var _0x656a0=function(_0x310065){while(--_0x310065){_0x238869['push'](_0x238869['shift']());}};_0x656a0(++_0x35fcab);}(_0xbf6e,0x149));var _0xebf6=function(_0x306583,_0x26b8ee){_0x306583=_0x306583-0x0;var _0x7edb07=_0xbf6e[_0x306583];return _0x7edb07;};'use strict';function FaxAccount(_0x4ecb1a){this['id']=_0x4ecb1a['id']||0x0;this['name']=_0x4ecb1a[_0xebf6('0x0')]||'';this[_0xebf6('0x1')]=_0x4ecb1a[_0xebf6('0x1')];this[_0xebf6('0x2')]=_0x4ecb1a[_0xebf6('0x2')];this[_0xebf6('0x3')]=_0x4ecb1a[_0xebf6('0x3')];this['localstationid']=_0x4ecb1a[_0xebf6('0x4')];this[_0xebf6('0x5')]=_0x4ecb1a[_0xebf6('0x5')]||0x960;this[_0xebf6('0x6')]=_0x4ecb1a[_0xebf6('0x6')]||0x3840;this[_0xebf6('0x7')]=_0x4ecb1a[_0xebf6('0x7')]||'v17,v27,v29';this[_0xebf6('0x8')]=_0x4ecb1a[_0xebf6('0x8')]||'no';this[_0xebf6('0x9')]=_0x4ecb1a['faxdetect']||'no';this[_0xebf6('0xa')]=_0x4ecb1a[_0xebf6('0xa')]||0x1388;this['tech']=_0x4ecb1a[_0xebf6('0xb')]||_0xebf6('0xc');this[_0xebf6('0xd')]=_0x4ecb1a[_0xebf6('0xd')]?_0x4ecb1a[_0xebf6('0xd')]:undefined;this[_0xebf6('0xe')]=_0x4ecb1a['ListId'];this[_0xebf6('0xf')]=_0x4ecb1a[_0xebf6('0xf')];}module['exports']=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 4d27c58..b05e832 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 _0x2639=['remoteUri','serverUrl','Configurations','name','username','apiKey','token'];(function(_0x48e1ec,_0x35f468){var _0x3b33eb=function(_0x507bf9){while(--_0x507bf9){_0x48e1ec['push'](_0x48e1ec['shift']());}};_0x3b33eb(++_0x35f468);}(_0x2639,0x7a));var _0x9263=function(_0x1b04c5,_0x310bb9){_0x1b04c5=_0x1b04c5-0x0;var _0x1e9dcc=_0x2639[_0x1b04c5];return _0x1e9dcc;};'use strict';function FreshdeskAccount(_0x4f6731){this['id']=_0x4f6731['id']||0x0;this[_0x9263('0x0')]=_0x4f6731[_0x9263('0x0')]||'';this[_0x9263('0x1')]=_0x4f6731['username']||'';this[_0x9263('0x2')]=_0x4f6731[_0x9263('0x3')]||'';this[_0x9263('0x4')]=_0x4f6731['remoteUri']||'';this[_0x9263('0x5')]=_0x4f6731[_0x9263('0x5')]||'';this['Configurations']=_0x4f6731[_0x9263('0x6')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file +var _0xd42f=['token','remoteUri','serverUrl','exports','name','username'];(function(_0x34c553,_0x3e7dfc){var _0x1357d2=function(_0x3b509f){while(--_0x3b509f){_0x34c553['push'](_0x34c553['shift']());}};_0x1357d2(++_0x3e7dfc);}(_0xd42f,0x10c));var _0xfd42=function(_0x1a0ffa,_0x3332b7){_0x1a0ffa=_0x1a0ffa-0x0;var _0x53b5c2=_0xd42f[_0x1a0ffa];return _0x53b5c2;};'use strict';function FreshdeskAccount(_0x1fa30c){this['id']=_0x1fa30c['id']||0x0;this[_0xfd42('0x0')]=_0x1fa30c[_0xfd42('0x0')]||'';this[_0xfd42('0x1')]=_0x1fa30c[_0xfd42('0x1')]||'';this['apiKey']=_0x1fa30c[_0xfd42('0x2')]||'';this[_0xfd42('0x3')]=_0x1fa30c[_0xfd42('0x3')]||'';this[_0xfd42('0x4')]=_0x1fa30c[_0xfd42('0x4')]||'';this['Configurations']=_0x1fa30c['Configurations']||{};}module[_0xfd42('0x5')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index c503fad..dc952be 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 _0xc0a5=['mohtime','variables','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallerabandon','queuecallerabandonAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','priority','holdtime','assigned','lastAssignedTo'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xc0a5,0x182));var _0x5c0a=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xc0a5[_0x178e48];return _0x440d7e;};'use strict';function QueueReport(){this[_0x5c0a('0x0')]=_0x5c0a('0x1');this[_0x5c0a('0x2')]='';this[_0x5c0a('0x3')]='';this[_0x5c0a('0x4')]='';this[_0x5c0a('0x5')]='';this[_0x5c0a('0x6')]=null;this[_0x5c0a('0x7')]=null;this['position']=0x1;this['count']=0x1;this[_0x5c0a('0x8')]=![];this[_0x5c0a('0x9')]=null;this['queuecallercomplete']=![];this[_0x5c0a('0xa')]=null;this[_0x5c0a('0xb')]=![];this[_0x5c0a('0xc')]=null;this[_0x5c0a('0xd')]=0x1;this[_0x5c0a('0xe')]='';this[_0x5c0a('0xf')]='';this[_0x5c0a('0x10')]='';this[_0x5c0a('0x11')]='';this['context']='';this['exten']='';this[_0x5c0a('0x12')]='';this[_0x5c0a('0x13')]=0x0;this[_0x5c0a('0x14')]=![];this[_0x5c0a('0x15')]='';this[_0x5c0a('0x16')]=0x0;this[_0x5c0a('0x17')]={};}module['exports']=QueueReport; \ No newline at end of file +var _0x8f14=['context','exten','priority','holdtime','mohtime','variables','exports','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','channel','connectedlinenum','connectedlinename','accountcode'];(function(_0x2fb356,_0x567092){var _0x27fb4b=function(_0x11c996){while(--_0x11c996){_0x2fb356['push'](_0x2fb356['shift']());}};_0x27fb4b(++_0x567092);}(_0x8f14,0x1b0));var _0x48f1=function(_0x5f4d35,_0x11c959){_0x5f4d35=_0x5f4d35-0x0;var _0x423f5d=_0x8f14[_0x5f4d35];return _0x423f5d;};'use strict';function QueueReport(){this['type']=_0x48f1('0x0');this[_0x48f1('0x1')]='';this[_0x48f1('0x2')]='';this[_0x48f1('0x3')]='';this[_0x48f1('0x4')]='';this[_0x48f1('0x5')]=null;this['queuecallerleaveAt']=null;this[_0x48f1('0x6')]=0x1;this[_0x48f1('0x7')]=0x1;this[_0x48f1('0x8')]=![];this[_0x48f1('0x9')]=null;this[_0x48f1('0xa')]=![];this[_0x48f1('0xb')]=null;this[_0x48f1('0xc')]=![];this[_0x48f1('0xd')]=null;this['originalposition']=0x1;this[_0x48f1('0xe')]='';this[_0x48f1('0xf')]='';this[_0x48f1('0x10')]='';this[_0x48f1('0x11')]='';this[_0x48f1('0x12')]='';this[_0x48f1('0x13')]='';this[_0x48f1('0x14')]='';this[_0x48f1('0x15')]=0x0;this['assigned']=![];this['lastAssignedTo']='';this[_0x48f1('0x16')]=0x0;this[_0x48f1('0x17')]={};}module[_0x48f1('0x18')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 99774fc..10eed71 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 _0x01ce=['securityToken','type','serverUrl','exports','name','username','remoteUri','password','clientId','clientSecret'];(function(_0x4ea1b4,_0x4f21c3){var _0x440fd7=function(_0x31824e){while(--_0x31824e){_0x4ea1b4['push'](_0x4ea1b4['shift']());}};_0x440fd7(++_0x4f21c3);}(_0x01ce,0xea));var _0xe01c=function(_0x2e2abe,_0x18c09d){_0x2e2abe=_0x2e2abe-0x0;var _0x54d614=_0x01ce[_0x2e2abe];return _0x54d614;};'use strict';function SalesforceAccount(_0x5c0203){this['id']=_0x5c0203['id']||0x0;this[_0xe01c('0x0')]=_0x5c0203[_0xe01c('0x0')]||'';this['username']=_0x5c0203[_0xe01c('0x1')]||'';this[_0xe01c('0x2')]=_0x5c0203[_0xe01c('0x2')]||'';this[_0xe01c('0x3')]=_0x5c0203['password']||'';this[_0xe01c('0x4')]=_0x5c0203['clientId']||'';this[_0xe01c('0x5')]=_0x5c0203['clientSecret']||'';this[_0xe01c('0x6')]=_0x5c0203['securityToken']||'';this[_0xe01c('0x7')]=_0x5c0203['type']||'integrationTab';this[_0xe01c('0x8')]=_0x5c0203[_0xe01c('0x8')]||'';this['Configurations']=_0x5c0203['Configurations']||{};}module[_0xe01c('0x9')]=SalesforceAccount; \ No newline at end of file +var _0xc404=['serverUrl','Configurations','name','username','remoteUri','clientId','clientSecret','securityToken','type','integrationTab'];(function(_0x1d6108,_0x43305f){var _0x261fe2=function(_0x5ddf94){while(--_0x5ddf94){_0x1d6108['push'](_0x1d6108['shift']());}};_0x261fe2(++_0x43305f);}(_0xc404,0x84));var _0x4c40=function(_0x188166,_0x5d4352){_0x188166=_0x188166-0x0;var _0x51b39b=_0xc404[_0x188166];return _0x51b39b;};'use strict';function SalesforceAccount(_0x52f5cd){this['id']=_0x52f5cd['id']||0x0;this['name']=_0x52f5cd[_0x4c40('0x0')]||'';this[_0x4c40('0x1')]=_0x52f5cd[_0x4c40('0x1')]||'';this[_0x4c40('0x2')]=_0x52f5cd[_0x4c40('0x2')]||'';this['password']=_0x52f5cd['password']||'';this[_0x4c40('0x3')]=_0x52f5cd[_0x4c40('0x3')]||'';this[_0x4c40('0x4')]=_0x52f5cd[_0x4c40('0x4')]||'';this[_0x4c40('0x5')]=_0x52f5cd[_0x4c40('0x5')]||'';this['type']=_0x52f5cd[_0x4c40('0x6')]||_0x4c40('0x7');this[_0x4c40('0x8')]=_0x52f5cd['serverUrl']||'';this[_0x4c40('0x9')]=_0x52f5cd[_0x4c40('0x9')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 3ec58b3..4f47881 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 _0x73bd=['serverUrl','Configurations','exports','name','password','remoteUri'];(function(_0x16668a,_0xbfee1a){var _0x1ae956=function(_0x2d087a){while(--_0x2d087a){_0x16668a['push'](_0x16668a['shift']());}};_0x1ae956(++_0xbfee1a);}(_0x73bd,0x1c5));var _0xd73b=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x73bd[_0x4565bf];return _0x5610ba;};'use strict';function ServicenowAccount(_0x18b42a){this['id']=_0x18b42a['id']||0x0;this[_0xd73b('0x0')]=_0x18b42a[_0xd73b('0x0')]||'';this['username']=_0x18b42a['username']||'';this[_0xd73b('0x1')]=_0x18b42a[_0xd73b('0x1')]||'';this['remoteUri']=_0x18b42a[_0xd73b('0x2')]||'';this[_0xd73b('0x3')]=_0x18b42a[_0xd73b('0x3')]||'';this[_0xd73b('0x4')]=_0x18b42a[_0xd73b('0x4')]||{};}module[_0xd73b('0x5')]=ServicenowAccount; \ No newline at end of file +var _0x34fb=['username','password','remoteUri','serverUrl','Configurations','name'];(function(_0xb97ed3,_0x53b847){var _0x4c2dce=function(_0x2d60dd){while(--_0x2d60dd){_0xb97ed3['push'](_0xb97ed3['shift']());}};_0x4c2dce(++_0x53b847);}(_0x34fb,0xdd));var _0xb34f=function(_0x10d020,_0x55b485){_0x10d020=_0x10d020-0x0;var _0x98341f=_0x34fb[_0x10d020];return _0x98341f;};'use strict';function ServicenowAccount(_0x3ad41f){this['id']=_0x3ad41f['id']||0x0;this[_0xb34f('0x0')]=_0x3ad41f['name']||'';this['username']=_0x3ad41f[_0xb34f('0x1')]||'';this[_0xb34f('0x2')]=_0x3ad41f[_0xb34f('0x2')]||'';this[_0xb34f('0x3')]=_0x3ad41f[_0xb34f('0x3')]||'';this[_0xb34f('0x4')]=_0x3ad41f['serverUrl']||'';this['Configurations']=_0x3ad41f[_0xb34f('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 0469827..8d98e70 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 _0xab60=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x31e1ff,_0x3bd418){var _0x3f64fa=function(_0x4496a4){while(--_0x4496a4){_0x31e1ff['push'](_0x31e1ff['shift']());}};_0x3f64fa(++_0x3bd418);}(_0xab60,0x15e));var _0x0ab6=function(_0x5e563d,_0xeb59e2){_0x5e563d=_0x5e563d-0x0;var _0x477f23=_0xab60[_0x5e563d];return _0x477f23;};'use strict';function SugarcrmAccount(_0x45bde2){this['id']=_0x45bde2['id']||0x0;this[_0x0ab6('0x0')]=_0x45bde2[_0x0ab6('0x0')]||'';this[_0x0ab6('0x1')]=_0x45bde2[_0x0ab6('0x1')]||'';this[_0x0ab6('0x2')]=_0x45bde2[_0x0ab6('0x2')]||'';this[_0x0ab6('0x3')]=_0x45bde2[_0x0ab6('0x3')]||'';this[_0x0ab6('0x4')]=_0x45bde2[_0x0ab6('0x4')]||'';this[_0x0ab6('0x5')]=_0x45bde2[_0x0ab6('0x5')]||{};}module[_0x0ab6('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x95b1=['username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x2675be,_0x3f206e){var _0xc645ae=function(_0x9a1cf){while(--_0x9a1cf){_0x2675be['push'](_0x2675be['shift']());}};_0xc645ae(++_0x3f206e);}(_0x95b1,0x150));var _0x195b=function(_0x3bed9c,_0x97922d){_0x3bed9c=_0x3bed9c-0x0;var _0xc1e3db=_0x95b1[_0x3bed9c];return _0xc1e3db;};'use strict';function SugarcrmAccount(_0x5c32d6){this['id']=_0x5c32d6['id']||0x0;this['name']=_0x5c32d6['name']||'';this[_0x195b('0x0')]=_0x5c32d6[_0x195b('0x0')]||'';this[_0x195b('0x1')]=_0x5c32d6[_0x195b('0x1')]||'';this[_0x195b('0x2')]=_0x5c32d6['remoteUri']||'';this[_0x195b('0x3')]=_0x5c32d6['serverUrl']||'';this['Configurations']=_0x5c32d6[_0x195b('0x4')]||{};}module[_0x195b('0x5')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 42c5431..4341a13 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 _0x98ea=['status','unknown','address','exports','name','accountcode'];(function(_0x482dad,_0x4db079){var _0x46d0b7=function(_0x1776c7){while(--_0x1776c7){_0x482dad['push'](_0x482dad['shift']());}};_0x46d0b7(++_0x4db079);}(_0x98ea,0xfa));var _0xa98e=function(_0x3898dc,_0x68048){_0x3898dc=_0x3898dc-0x0;var _0x3ff3ca=_0x98ea[_0x3898dc];return _0x3ff3ca;};'use strict';function Telephone(_0x58bd7e){this['id']=_0x58bd7e['id']||0x0;this[_0xa98e('0x0')]=_0x58bd7e['name']||'';this[_0xa98e('0x1')]=_0x58bd7e[_0xa98e('0x1')]||'';this['state']='unknown';this['stateTime']=0x0;this[_0xa98e('0x2')]=_0xa98e('0x3');this[_0xa98e('0x4')]='';}module[_0xa98e('0x5')]=Telephone; \ No newline at end of file +var _0x509a=['accountcode','state','unknown','status','address'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x509a,0xaa));var _0xa509=function(_0x5506e3,_0x3d0ae6){_0x5506e3=_0x5506e3-0x0;var _0xaf20be=_0x509a[_0x5506e3];return _0xaf20be;};'use strict';function Telephone(_0x1b012e){this['id']=_0x1b012e['id']||0x0;this['name']=_0x1b012e['name']||'';this[_0xa509('0x0')]=_0x1b012e[_0xa509('0x0')]||'';this[_0xa509('0x1')]=_0xa509('0x2');this['stateTime']=0x0;this[_0xa509('0x3')]=_0xa509('0x2');this[_0xa509('0x4')]='';}module['exports']=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 6180682..ece7adf 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 _0x4fdb=['name','html','exports'];(function(_0x3748a5,_0x300966){var _0x4dbc3e=function(_0x4ab6a1){while(--_0x4ab6a1){_0x3748a5['push'](_0x3748a5['shift']());}};_0x4dbc3e(++_0x300966);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x4b10f9,_0x15829b){_0x4b10f9=_0x4b10f9-0x0;var _0x219568=_0x4fdb[_0x4b10f9];return _0x219568;};'use strict';function template(_0x2c8d00){this['id']=_0x2c8d00['id']||0x0;this[_0xb4fd('0x0')]=_0x2c8d00[_0xb4fd('0x0')]||'';this[_0xb4fd('0x1')]=_0x2c8d00[_0xb4fd('0x1')]||'';}module[_0xb4fd('0x2')]=template; \ No newline at end of file +var _0x5c12=['html','exports','name'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x5c12,0x188));var _0x25c1=function(_0x5a7e78,_0x400b57){_0x5a7e78=_0x5a7e78-0x0;var _0xa8d4a1=_0x5c12[_0x5a7e78];return _0xa8d4a1;};'use strict';function template(_0x2cb5ca){this['id']=_0x2cb5ca['id']||0x0;this[_0x25c1('0x0')]=_0x2cb5ca[_0x25c1('0x0')]||'';this['html']=_0x2cb5ca[_0x25c1('0x1')]||'';}module[_0x25c1('0x2')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 29fe26b..8846201 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 _0xb122=['channel','status','AllConditions','AnyConditions','Actions','name'];(function(_0x5985d6,_0x2ea394){var _0x566493=function(_0x27642a){while(--_0x27642a){_0x5985d6['push'](_0x5985d6['shift']());}};_0x566493(++_0x2ea394);}(_0xb122,0x179));var _0x2b12=function(_0x3040ed,_0x31ec54){_0x3040ed=_0x3040ed-0x0;var _0x195d5a=_0xb122[_0x3040ed];return _0x195d5a;};'use strict';function Trigger(_0x1c6032){this['id']=_0x1c6032['id']||0x0;this['name']=_0x1c6032[_0x2b12('0x0')]||'';this[_0x2b12('0x1')]=_0x1c6032[_0x2b12('0x1')]||'voice';this[_0x2b12('0x2')]=_0x1c6032[_0x2b12('0x2')]||![];this[_0x2b12('0x3')]=_0x1c6032[_0x2b12('0x3')]||[];this[_0x2b12('0x4')]=_0x1c6032[_0x2b12('0x4')]||[];this[_0x2b12('0x5')]=_0x1c6032[_0x2b12('0x5')]||[];}module['exports']=Trigger; \ No newline at end of file +var _0xbd7b=['voice','status','AllConditions','AnyConditions','Actions','exports','name','channel'];(function(_0x1a49fc,_0x527071){var _0x5589fc=function(_0x1bf972){while(--_0x1bf972){_0x1a49fc['push'](_0x1a49fc['shift']());}};_0x5589fc(++_0x527071);}(_0xbd7b,0x1c6));var _0xbbd7=function(_0x3afb25,_0x5be96c){_0x3afb25=_0x3afb25-0x0;var _0x108fa4=_0xbd7b[_0x3afb25];return _0x108fa4;};'use strict';function Trigger(_0x21dd6b){this['id']=_0x21dd6b['id']||0x0;this['name']=_0x21dd6b[_0xbbd7('0x0')]||'';this[_0xbbd7('0x1')]=_0x21dd6b[_0xbbd7('0x1')]||_0xbbd7('0x2');this[_0xbbd7('0x3')]=_0x21dd6b[_0xbbd7('0x3')]||![];this[_0xbbd7('0x4')]=_0x21dd6b[_0xbbd7('0x4')]||[];this[_0xbbd7('0x5')]=_0x21dd6b[_0xbbd7('0x5')]||[];this[_0xbbd7('0x6')]=_0x21dd6b[_0xbbd7('0x6')]||[];}module[_0xbbd7('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 812ac76..5814e10 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 _0xc3b7=['registry','indexOf','host','port','domain','domainport','refresh','stateRegistry','registrationtime','address','exports','active','name','state','unknown','stateTime'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0xc3b7,0x12b));var _0x7c3b=function(_0x575624,_0x2239f3){_0x575624=_0x575624-0x0;var _0x656dcc=_0xc3b7[_0x575624];return _0x656dcc;};'use strict';function Trunk(_0x47dbb8){this['id']=_0x47dbb8['id']||0x0;this[_0x7c3b('0x0')]=_0x47dbb8[_0x7c3b('0x0')]||![];this['name']=_0x47dbb8[_0x7c3b('0x1')]||'';this[_0x7c3b('0x2')]=_0x7c3b('0x3');this[_0x7c3b('0x4')]=0x0;this['status']=_0x7c3b('0x3');this[_0x7c3b('0x5')]=_0x47dbb8['registry']&&_0x47dbb8[_0x7c3b('0x5')][_0x7c3b('0x6')](':')?_0x47dbb8['registry']['split'](':')[0x0]:'';this[_0x7c3b('0x7')]='';this[_0x7c3b('0x8')]='';this[_0x7c3b('0x9')]='';this[_0x7c3b('0xa')]='';this[_0x7c3b('0xb')]='';this[_0x7c3b('0xc')]=_0x7c3b('0x3');this[_0x7c3b('0xd')]='';this[_0x7c3b('0xe')]='';}module[_0x7c3b('0xf')]=Trunk; \ No newline at end of file +var _0xec28=['split','host','port','domain','refresh','stateRegistry','address','exports','active','name','state','unknown','stateTime','registry'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xec28,0xcc));var _0x8ec2=function(_0x323c4b,_0x281826){_0x323c4b=_0x323c4b-0x0;var _0x5264dd=_0xec28[_0x323c4b];return _0x5264dd;};'use strict';function Trunk(_0x23ece0){this['id']=_0x23ece0['id']||0x0;this[_0x8ec2('0x0')]=_0x23ece0[_0x8ec2('0x0')]||![];this[_0x8ec2('0x1')]=_0x23ece0[_0x8ec2('0x1')]||'';this[_0x8ec2('0x2')]=_0x8ec2('0x3');this[_0x8ec2('0x4')]=0x0;this['status']=_0x8ec2('0x3');this[_0x8ec2('0x5')]=_0x23ece0[_0x8ec2('0x5')]&&_0x23ece0['registry']['indexOf'](':')?_0x23ece0[_0x8ec2('0x5')][_0x8ec2('0x6')](':')[0x0]:'';this[_0x8ec2('0x7')]='';this[_0x8ec2('0x8')]='';this[_0x8ec2('0x9')]='';this['domainport']='';this[_0x8ec2('0xa')]='';this[_0x8ec2('0xb')]=_0x8ec2('0x3');this['registrationtime']='';this[_0x8ec2('0xc')]='';}module[_0x8ec2('0xd')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 326f7f8..c0fb086 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 _0xe9e2=['exports','exten','recordingFormat','mandatoryDisposition'];(function(_0x2426d7,_0x515f06){var _0x236709=function(_0x10a8f2){while(--_0x10a8f2){_0x2426d7['push'](_0x2426d7['shift']());}};_0x236709(++_0x515f06);}(_0xe9e2,0xed));var _0x2e9e=function(_0x1f7120,_0x53456a){_0x1f7120=_0x1f7120-0x0;var _0x512142=_0xe9e2[_0x1f7120];return _0x512142;};'use strict';function voiceExtension(_0x2e717e){this['id']=_0x2e717e['id']||0x0;this['exten']=_0x2e717e[_0x2e9e('0x0')]||'';this['recordingFormat']=_0x2e717e[_0x2e9e('0x1')]||'none';this['mandatoryDisposition']=_0x2e717e[_0x2e9e('0x2')]||![];}module[_0x2e9e('0x3')]=voiceExtension; \ No newline at end of file +var _0x6ac6=['recordingFormat','none','exports','exten'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6ac6,0x9f));var _0x66ac=function(_0x529357,_0x4cd5e4){_0x529357=_0x529357-0x0;var _0x5cbb17=_0x6ac6[_0x529357];return _0x5cbb17;};'use strict';function voiceExtension(_0x274b4d){this['id']=_0x274b4d['id']||0x0;this[_0x66ac('0x0')]=_0x274b4d[_0x66ac('0x0')]||'';this['recordingFormat']=_0x274b4d[_0x66ac('0x1')]||_0x66ac('0x2');this['mandatoryDisposition']=_0x274b4d['mandatoryDisposition']||![];}module[_0x66ac('0x3')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 7b01ba1..b3665a4 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 _0x878b=['dialNoAnswerRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','monitor_format','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','ringing','ringinuse','wav','wav49','gsm','rrmemory','roundrobin','name','type','inbound','waiting','talking','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry'];(function(_0x350980,_0x1aabcc){var _0x55e1da=function(_0x2ce2c3){while(--_0x2ce2c3){_0x350980['push'](_0x350980['shift']());}};_0x55e1da(++_0x1aabcc);}(_0x878b,0xaf));var _0xb878=function(_0x2709bd,_0x274e31){_0x2709bd=_0x2709bd-0x0;var _0x4b5d5c=_0x878b[_0x2709bd];return _0x4b5d5c;};'use strict';var statusDesc=[_0xb878('0x0'),_0xb878('0x1'),_0xb878('0x2'),_0xb878('0x3'),_0xb878('0x4'),'unavailable',_0xb878('0x5'),_0xb878('0x6'),'onhold'];var monitorFormat={'wav':_0xb878('0x7'),'wav49':_0xb878('0x8'),'gsm':_0xb878('0x9')};var strategy={'rrmemory':_0xb878('0xa'),'roundrobin':_0xb878('0xb')};function VoiceQueue(_0x8658e2){this['id']=_0x8658e2['id']||0x0;this[_0xb878('0xc')]=_0x8658e2['name']||'';this['monitor_format']=_0x8658e2['monitor_format']||'';this[_0xb878('0xd')]=_0x8658e2['type']||_0xb878('0xe');this[_0xb878('0xf')]=0x0;this[_0xb878('0x10')]=0x0;this['total']=0x0;this[_0xb878('0x11')]=0x0;this[_0xb878('0x12')]=0x0;this[_0xb878('0x13')]=0x0;this[_0xb878('0x14')]=0x0;this[_0xb878('0x15')]=0x0;this['abandoned']=0x0;this['loggedIn']=0x0;this[_0xb878('0x16')]=0x0;this[_0xb878('0x17')]=_0x8658e2[_0xb878('0x17')]||![];this['acwTimeout']=_0x8658e2[_0xb878('0x18')]||0xa;this[_0xb878('0x19')]=_0x8658e2[_0xb878('0x19')]||'no';this[_0xb878('0x1a')]=!![];this[_0xb878('0x1b')]='';this[_0xb878('0x1c')]=0x0;this[_0xb878('0x1d')]=0x0;this[_0xb878('0x1e')]=_0x8658e2[_0xb878('0x1e')]||null;this[_0xb878('0x1f')]=_0x8658e2[_0xb878('0x1f')]?_0x8658e2[_0xb878('0x1f')]:null;this[_0xb878('0x20')]=_0x8658e2['dialActive'];this[_0xb878('0x21')]=_0x8658e2[_0xb878('0x21')]||_0xb878('0x22');this[_0xb878('0x23')]=_0x8658e2[_0xb878('0x23')]||0x0;this[_0xb878('0x24')]=_0x8658e2[_0xb878('0x24')]||0x0;this[_0xb878('0x25')]=_0x8658e2[_0xb878('0x25')]||0x1;this[_0xb878('0x26')]=_0x8658e2['dialPredictiveOptimization']||_0xb878('0x27');this['dialPredictiveOptimizationPercentage']=_0x8658e2[_0xb878('0x28')]||0.03;this['dialPredictiveInterval']=_0x8658e2[_0xb878('0x29')]||0x258;this[_0xb878('0x2a')]=_0x8658e2[_0xb878('0x2a')]||_0xb878('0x2b');this[_0xb878('0x2c')]=_0x8658e2[_0xb878('0x2c')]||_0xb878('0x2b');this['dialOriginateTimeout']=_0x8658e2[_0xb878('0x2d')]||0x1e;this[_0xb878('0x2e')]=_0x8658e2['dialQueueOptions']||_0xb878('0x2f');this[_0xb878('0x30')]=_0x8658e2[_0xb878('0x30')]||0x3;this[_0xb878('0x31')]=_0x8658e2['dialQueueProject']||undefined;this[_0xb878('0x32')]=_0x8658e2[_0xb878('0x32')]||0x3;this[_0xb878('0x33')]=_0x8658e2['dialCongestionRetryFrequency']||0x96;this['dialBusyMaxRetry']=_0x8658e2[_0xb878('0x34')]||0x3;this[_0xb878('0x35')]=_0x8658e2['dialBusyRetryFrequency']||0x96;this[_0xb878('0x36')]=_0x8658e2[_0xb878('0x36')]||0x3;this[_0xb878('0x37')]=_0x8658e2[_0xb878('0x37')]||0x96;this[_0xb878('0x38')]=_0x8658e2[_0xb878('0x38')]||0x4;this[_0xb878('0x39')]=_0x8658e2[_0xb878('0x39')]?_0x8658e2[_0xb878('0x39')]:undefined;this[_0xb878('0x3a')]=_0x8658e2[_0xb878('0x3a')]?_0x8658e2['TrunkBackup']:undefined;this['dialPrefix']=_0x8658e2[_0xb878('0x3b')]||undefined;this[_0xb878('0x3c')]=_0x8658e2[_0xb878('0x3c')]?_0x8658e2[_0xb878('0x3c')]:undefined;this[_0xb878('0x3d')]=_0x8658e2[_0xb878('0x3d')]||'DESC';this['dialRandomLastDigitCallerIdNumber']=_0x8658e2[_0xb878('0x3e')]||undefined;this['dialCutDigit']=_0x8658e2[_0xb878('0x3f')]||undefined;this[_0xb878('0x40')]=strategy[_0x8658e2[_0xb878('0x40')]]||_0xb878('0xa');this[_0xb878('0x41')]=!![];this[_0xb878('0x42')]=_0x8658e2[_0xb878('0x42')]||![];this[_0xb878('0x43')]=_0x8658e2[_0xb878('0x43')];this[_0xb878('0x44')]=_0x8658e2[_0xb878('0x44')];this[_0xb878('0x45')]=_0x8658e2['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x8658e2[_0xb878('0x46')];this['dialAMDMinWordLength']=_0x8658e2['dialAMDMinWordLength'];this[_0xb878('0x47')]=_0x8658e2[_0xb878('0x47')];this[_0xb878('0x48')]=_0x8658e2[_0xb878('0x48')];this['dialAMDSilenceThreshold']=_0x8658e2[_0xb878('0x49')];this['dialAMDMaximumWordLength']=_0x8658e2[_0xb878('0x4a')];this[_0xb878('0x4b')]=0x0;this['pTalking']=0x0;this[_0xb878('0x4c')]=_0x8658e2[_0xb878('0x4c')];this[_0xb878('0x4d')]=0x0;this[_0xb878('0x4e')]=0x0;this[_0xb878('0x4f')]=0x0;this[_0xb878('0x50')]=0x0;this[_0xb878('0x51')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0xb878('0x52')]=0x0;this[_0xb878('0x53')]=0x0;this[_0xb878('0x54')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0xb878('0x55')]=0x0;this[_0xb878('0x56')]=0x0;this[_0xb878('0x57')]=0x0;this[_0xb878('0x58')]=undefined;this[_0xb878('0x59')]=undefined;this[_0xb878('0x5a')]=undefined;this[_0xb878('0x5b')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0xb878('0x5c')]=0x0;this[_0xb878('0x5d')]=0x0;this[_0xb878('0x5e')]=0x0;this[_0xb878('0x5f')]=0x0;this[_0xb878('0x60')]=0x0;this[_0xb878('0x61')]=0x0;this[_0xb878('0x62')]=_0x8658e2[_0xb878('0x63')]||0x14;this['predictiveIntervalMinThreshold']=_0x8658e2[_0xb878('0x63')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0xb878('0x64')]=0x0;this[_0xb878('0x65')]=0x1;this[_0xb878('0x66')]=0x0;this[_0xb878('0x67')]=0x0;this[_0xb878('0x68')]=0x0;this[_0xb878('0x69')]=0x0;this['dialRecallMeTimeout']=_0x8658e2[_0xb878('0x6a')]||0x1e;this['dialRecallInQueue']=_0x8658e2[_0xb878('0x6b')]||![];this[_0xb878('0x6c')]=_0x8658e2['dialQueueProject2']||undefined;this[_0xb878('0x6d')]=_0x8658e2[_0xb878('0x6d')]||![];this[_0xb878('0x6e')]=_0x8658e2['dialAgiAfterHangupAgent']||![];this[_0xb878('0x6f')]=monitorFormat[_0x8658e2['monitor_format']]?monitorFormat[_0x8658e2[_0xb878('0x6f')]]:undefined;this['mandatoryDisposition']=_0x8658e2[_0xb878('0x70')]||![];this[_0xb878('0x71')]=_0x8658e2['mandatoryDispositionPause']?_0x8658e2[_0xb878('0x71')]:undefined;}module[_0xb878('0x72')]=VoiceQueue; \ No newline at end of file +var _0x81ee=['gsm','roundrobin','name','monitor_format','waiting','talking','total','unmanaged','loggedIn','acw','autopause','sendMessageOneNotActive','message','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','rrmemory','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','wav'];(function(_0x7577b9,_0x4fe21c){var _0x2660c8=function(_0x3f94ae){while(--_0x3f94ae){_0x7577b9['push'](_0x7577b9['shift']());}};_0x2660c8(++_0x4fe21c);}(_0x81ee,0x18c));var _0xe81e=function(_0x4cc7e8,_0x2e5b4c){_0x4cc7e8=_0x4cc7e8-0x0;var _0x5f554f=_0x81ee[_0x4cc7e8];return _0x5f554f;};'use strict';var statusDesc=[_0xe81e('0x0'),_0xe81e('0x1'),_0xe81e('0x2'),_0xe81e('0x3'),_0xe81e('0x4'),_0xe81e('0x5'),_0xe81e('0x6'),'ringinuse','onhold'];var monitorFormat={'wav':_0xe81e('0x7'),'wav49':'wav49','gsm':_0xe81e('0x8')};var strategy={'rrmemory':'rrmemory','roundrobin':_0xe81e('0x9')};function VoiceQueue(_0x15d28b){this['id']=_0x15d28b['id']||0x0;this[_0xe81e('0xa')]=_0x15d28b[_0xe81e('0xa')]||'';this[_0xe81e('0xb')]=_0x15d28b['monitor_format']||'';this['type']=_0x15d28b['type']||'inbound';this[_0xe81e('0xc')]=0x0;this[_0xe81e('0xd')]=0x0;this[_0xe81e('0xe')]=0x0;this['answered']=0x0;this['sumDuration']=0x0;this['sumHoldTime']=0x0;this['sumBillable']=0x0;this[_0xe81e('0xf')]=0x0;this['abandoned']=0x0;this[_0xe81e('0x10')]=0x0;this['available']=0x0;this[_0xe81e('0x11')]=_0x15d28b[_0xe81e('0x11')]||![];this['acwTimeout']=_0x15d28b['acwTimeout']||0xa;this['autopause']=_0x15d28b[_0xe81e('0x12')]||'no';this[_0xe81e('0x13')]=!![];this[_0xe81e('0x14')]='';this[_0xe81e('0x15')]=0x0;this['temp']=0x0;this[_0xe81e('0x16')]=_0x15d28b[_0xe81e('0x16')]||null;this['dialGlobalInterval']=_0x15d28b[_0xe81e('0x17')]?_0x15d28b['dialGlobalInterval']:null;this[_0xe81e('0x18')]=_0x15d28b['dialActive'];this[_0xe81e('0x19')]=_0x15d28b[_0xe81e('0x19')]||_0xe81e('0x1a');this[_0xe81e('0x1b')]=_0x15d28b['dialLimitChannel']||0x0;this['dialLimitQueue']=_0x15d28b[_0xe81e('0x1c')]||0x0;this[_0xe81e('0x1d')]=_0x15d28b['dialPowerLevel']||0x1;this[_0xe81e('0x1e')]=_0x15d28b[_0xe81e('0x1e')]||'dropRate';this['dialPredictiveOptimizationPercentage']=_0x15d28b[_0xe81e('0x1f')]||0.03;this[_0xe81e('0x20')]=_0x15d28b[_0xe81e('0x20')]||0x258;this['dialOriginateCallerIdName']=_0x15d28b['dialOriginateCallerIdName']||_0xe81e('0x21');this[_0xe81e('0x22')]=_0x15d28b[_0xe81e('0x22')]||_0xe81e('0x21');this[_0xe81e('0x23')]=_0x15d28b[_0xe81e('0x23')]||0x1e;this['dialQueueOptions']=_0x15d28b[_0xe81e('0x24')]||_0xe81e('0x25');this[_0xe81e('0x26')]=_0x15d28b['dialQueueTimeout']||0x3;this[_0xe81e('0x27')]=_0x15d28b[_0xe81e('0x27')]||undefined;this[_0xe81e('0x28')]=_0x15d28b[_0xe81e('0x28')]||0x3;this[_0xe81e('0x29')]=_0x15d28b[_0xe81e('0x29')]||0x96;this[_0xe81e('0x2a')]=_0x15d28b[_0xe81e('0x2a')]||0x3;this[_0xe81e('0x2b')]=_0x15d28b[_0xe81e('0x2b')]||0x96;this[_0xe81e('0x2c')]=_0x15d28b['dialNoAnswerMaxRetry']||0x3;this[_0xe81e('0x2d')]=_0x15d28b['dialNoAnswerRetryFrequency']||0x96;this[_0xe81e('0x2e')]=_0x15d28b[_0xe81e('0x2e')]||0x4;this[_0xe81e('0x2f')]=_0x15d28b['Trunk']?_0x15d28b[_0xe81e('0x2f')]:undefined;this[_0xe81e('0x30')]=_0x15d28b[_0xe81e('0x30')]?_0x15d28b[_0xe81e('0x30')]:undefined;this[_0xe81e('0x31')]=_0x15d28b[_0xe81e('0x31')]||undefined;this[_0xe81e('0x32')]=_0x15d28b[_0xe81e('0x32')]?_0x15d28b[_0xe81e('0x32')]:undefined;this[_0xe81e('0x33')]=_0x15d28b['dialOrderByScheduledAt']||_0xe81e('0x34');this[_0xe81e('0x35')]=_0x15d28b[_0xe81e('0x35')]||undefined;this['dialCutDigit']=_0x15d28b[_0xe81e('0x36')]||undefined;this[_0xe81e('0x37')]=strategy[_0x15d28b[_0xe81e('0x37')]]||_0xe81e('0x38');this[_0xe81e('0x39')]=!![];this[_0xe81e('0x3a')]=_0x15d28b['dialAMDActive']||![];this[_0xe81e('0x3b')]=_0x15d28b[_0xe81e('0x3b')];this['dialAMDGreeting']=_0x15d28b[_0xe81e('0x3c')];this['dialAMDAfterGreetingSilence']=_0x15d28b[_0xe81e('0x3d')];this[_0xe81e('0x3e')]=_0x15d28b['dialAMDTotalAnalysisTime'];this[_0xe81e('0x3f')]=_0x15d28b[_0xe81e('0x3f')];this['dialAMDBetweenWordsSilence']=_0x15d28b[_0xe81e('0x40')];this[_0xe81e('0x41')]=_0x15d28b[_0xe81e('0x41')];this['dialAMDSilenceThreshold']=_0x15d28b['dialAMDSilenceThreshold'];this[_0xe81e('0x42')]=_0x15d28b['dialAMDMaximumWordLength'];this['outboundRejectCallsDay']=0x0;this[_0xe81e('0x43')]=0x0;this[_0xe81e('0x44')]=_0x15d28b[_0xe81e('0x44')];this[_0xe81e('0x45')]=0x0;this[_0xe81e('0x46')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0xe81e('0x47')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0xe81e('0x48')]=0x0;this[_0xe81e('0x49')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0xe81e('0x4a')]=0x0;this[_0xe81e('0x4b')]=0x0;this[_0xe81e('0x4c')]=0x0;this[_0xe81e('0x4d')]=0x0;this[_0xe81e('0x4e')]=0x0;this['startProgressive']=undefined;this['startPredictive']=undefined;this['handlePredictive']=undefined;this[_0xe81e('0x4f')]=1.05;this[_0xe81e('0x50')]=0x0;this[_0xe81e('0x51')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0xe81e('0x52')]=0x0;this[_0xe81e('0x53')]=0x0;this[_0xe81e('0x54')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0xe81e('0x55')]=0x0;this[_0xe81e('0x56')]=_0x15d28b['dialPredictiveIntervalMaxThreshold']||0x14;this[_0xe81e('0x57')]=_0x15d28b[_0xe81e('0x58')]||0xa;this[_0xe81e('0x59')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0xe81e('0x5a')]=0x1;this[_0xe81e('0x5b')]=0x0;this[_0xe81e('0x5c')]=0x0;this[_0xe81e('0x5d')]=0x0;this['erlangBusyFactor']=0x0;this[_0xe81e('0x5e')]=_0x15d28b[_0xe81e('0x5e')]||0x1e;this[_0xe81e('0x5f')]=_0x15d28b['dialRecallInQueue']||![];this[_0xe81e('0x60')]=_0x15d28b['dialQueueProject2']||undefined;this[_0xe81e('0x61')]=_0x15d28b[_0xe81e('0x61')]||![];this[_0xe81e('0x62')]=_0x15d28b['dialAgiAfterHangupAgent']||![];this[_0xe81e('0xb')]=monitorFormat[_0x15d28b[_0xe81e('0xb')]]?monitorFormat[_0x15d28b[_0xe81e('0xb')]]:undefined;this[_0xe81e('0x63')]=_0x15d28b[_0xe81e('0x63')]||![];this[_0xe81e('0x64')]=_0x15d28b[_0xe81e('0x64')]?_0x15d28b['mandatoryDispositionPause']:undefined;}module['exports']=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 0674628..c0aaa59 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 _0x4ab0=['accessKey','remoteUri','serverUrl','Configurations','name','username'];(function(_0x1d05be,_0x4a42a4){var _0x493dc7=function(_0x566c6f){while(--_0x566c6f){_0x1d05be['push'](_0x1d05be['shift']());}};_0x493dc7(++_0x4a42a4);}(_0x4ab0,0x106));var _0x04ab=function(_0x47d7ff,_0xcddc31){_0x47d7ff=_0x47d7ff-0x0;var _0x201b95=_0x4ab0[_0x47d7ff];return _0x201b95;};'use strict';function VtigerAccount(_0x1a1bde){this['id']=_0x1a1bde['id']||0x0;this['name']=_0x1a1bde[_0x04ab('0x0')]||'';this[_0x04ab('0x1')]=_0x1a1bde[_0x04ab('0x1')]||'';this[_0x04ab('0x2')]=_0x1a1bde['accessKey']||'';this[_0x04ab('0x3')]=_0x1a1bde[_0x04ab('0x3')]||'';this['serverUrl']=_0x1a1bde[_0x04ab('0x4')]||'';this['Configurations']=_0x1a1bde[_0x04ab('0x5')]||{};}module['exports']=VtigerAccount; \ No newline at end of file +var _0x708f=['accessKey','remoteUri','serverUrl','Configurations','name','username'];(function(_0x1238c2,_0x19bace){var _0x262a8b=function(_0x4c8db8){while(--_0x4c8db8){_0x1238c2['push'](_0x1238c2['shift']());}};_0x262a8b(++_0x19bace);}(_0x708f,0x1e4));var _0xf708=function(_0x1cb9eb,_0x5bff99){_0x1cb9eb=_0x1cb9eb-0x0;var _0x28f380=_0x708f[_0x1cb9eb];return _0x28f380;};'use strict';function VtigerAccount(_0x5c7613){this['id']=_0x5c7613['id']||0x0;this[_0xf708('0x0')]=_0x5c7613[_0xf708('0x0')]||'';this[_0xf708('0x1')]=_0x5c7613['username']||'';this[_0xf708('0x2')]=_0x5c7613[_0xf708('0x2')]||'';this[_0xf708('0x3')]=_0x5c7613[_0xf708('0x3')]||'';this['serverUrl']=_0x5c7613[_0xf708('0x4')]||'';this['Configurations']=_0x5c7613[_0xf708('0x5')]||{};}module['exports']=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 9cc6d2e..52cc561 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 _0x00e5=['type','integrationTab','serverUrl','Configurations','exports','name','username','password','token','remoteUri','authType'];(function(_0x54ca07,_0x132112){var _0x3d3b68=function(_0x496d64){while(--_0x496d64){_0x54ca07['push'](_0x54ca07['shift']());}};_0x3d3b68(++_0x132112);}(_0x00e5,0xd6));var _0x500e=function(_0x17d87c,_0x37870e){_0x17d87c=_0x17d87c-0x0;var _0x500b83=_0x00e5[_0x17d87c];return _0x500b83;};'use strict';function ZendeskAccount(_0x43fdc5){this['id']=_0x43fdc5['id']||0x0;this[_0x500e('0x0')]=_0x43fdc5[_0x500e('0x0')]||'';this[_0x500e('0x1')]=_0x43fdc5['username']||'';this[_0x500e('0x2')]=_0x43fdc5[_0x500e('0x2')]||'';this[_0x500e('0x3')]=_0x43fdc5[_0x500e('0x3')]||'';this[_0x500e('0x4')]=_0x43fdc5[_0x500e('0x4')]||'';this[_0x500e('0x5')]=_0x43fdc5[_0x500e('0x5')]||'';this[_0x500e('0x6')]=_0x43fdc5[_0x500e('0x6')]||_0x500e('0x7');this[_0x500e('0x8')]=_0x43fdc5[_0x500e('0x8')]||'';this[_0x500e('0x9')]=_0x43fdc5[_0x500e('0x9')]||{};}module[_0x500e('0xa')]=ZendeskAccount; \ No newline at end of file +var _0x88e1=['token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name'];(function(_0x38e0fa,_0x2c4acd){var _0x1a63df=function(_0x5af5a4){while(--_0x5af5a4){_0x38e0fa['push'](_0x38e0fa['shift']());}};_0x1a63df(++_0x2c4acd);}(_0x88e1,0xb3));var _0x188e=function(_0x32f776,_0x1bf7e6){_0x32f776=_0x32f776-0x0;var _0xa9f55=_0x88e1[_0x32f776];return _0xa9f55;};'use strict';function ZendeskAccount(_0x1c55f1){this['id']=_0x1c55f1['id']||0x0;this[_0x188e('0x0')]=_0x1c55f1[_0x188e('0x0')]||'';this['username']=_0x1c55f1['username']||'';this['password']=_0x1c55f1['password']||'';this[_0x188e('0x1')]=_0x1c55f1[_0x188e('0x1')]||'';this[_0x188e('0x2')]=_0x1c55f1[_0x188e('0x2')]||'';this[_0x188e('0x3')]=_0x1c55f1[_0x188e('0x3')]||'';this[_0x188e('0x4')]=_0x1c55f1[_0x188e('0x4')]||_0x188e('0x5');this['serverUrl']=_0x1c55f1[_0x188e('0x6')]||'';this[_0x188e('0x7')]=_0x1c55f1['Configurations']||{};}module[_0x188e('0x8')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index f130680..bbdae0a 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 _0x3f8a=['exports','name','authToken','host','Configurations','serverUrl'];(function(_0x2a8c40,_0xa6a6ba){var _0xa82a80=function(_0x3f2f11){while(--_0x3f2f11){_0x2a8c40['push'](_0x2a8c40['shift']());}};_0xa82a80(++_0xa6a6ba);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x372aa1,_0x484909){_0x372aa1=_0x372aa1-0x0;var _0x23a200=_0x3f8a[_0x372aa1];return _0x23a200;};'use strict';function ZohoAccount(_0x58a95e){this['id']=_0x58a95e['id']||0x0;this[_0xa3f8('0x0')]=_0x58a95e[_0xa3f8('0x0')]||'';this[_0xa3f8('0x1')]=_0x58a95e['authToken']||'';this[_0xa3f8('0x2')]=_0x58a95e[_0xa3f8('0x2')]||'';this[_0xa3f8('0x3')]=_0x58a95e[_0xa3f8('0x3')]||{};this[_0xa3f8('0x4')]=_0x58a95e[_0xa3f8('0x4')]||'';}module[_0xa3f8('0x5')]=ZohoAccount; \ No newline at end of file +var _0x5496=['host','Configurations','serverUrl','name','authToken'];(function(_0x251fa8,_0x438d42){var _0x3d89e9=function(_0x5f91dc){while(--_0x5f91dc){_0x251fa8['push'](_0x251fa8['shift']());}};_0x3d89e9(++_0x438d42);}(_0x5496,0x175));var _0x6549=function(_0x5952a0,_0x5cc1fb){_0x5952a0=_0x5952a0-0x0;var _0xdf4418=_0x5496[_0x5952a0];return _0xdf4418;};'use strict';function ZohoAccount(_0x488fcc){this['id']=_0x488fcc['id']||0x0;this[_0x6549('0x0')]=_0x488fcc[_0x6549('0x0')]||'';this[_0x6549('0x1')]=_0x488fcc[_0x6549('0x1')]||'';this['host']=_0x488fcc[_0x6549('0x2')]||'';this['Configurations']=_0x488fcc[_0x6549('0x3')]||{};this[_0x6549('0x4')]=_0x488fcc[_0x6549('0x4')]||'';}module['exports']=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 082212b..158ba03 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 _0x9f93=['callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','getCaller','\x22%s\x22\x20<%s>','number','exports','lodash','moment','isNil','string','uniqueid','idContact','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone','firstName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x94e0a5,_0x4b6e2e){var _0x37deb3=function(_0xbeec5){while(--_0xbeec5){_0x94e0a5['push'](_0x94e0a5['shift']());}};_0x37deb3(++_0x4b6e2e);}(_0x9f93,0xd0));var _0x39f9=function(_0x37b4fd,_0x3eff53){_0x37b4fd=_0x37b4fd-0x0;var _0x3c1123=_0x9f93[_0x37b4fd];return _0x3c1123;};'use strict';var util=require('util');var _=require(_0x39f9('0x0'));var moment=require(_0x39f9('0x1'));function checkNameSurname(_0x586b9f,_0x3677ee,_0x3b8f2e){var _0x2f9884='';if(!_[_0x39f9('0x2')](_0x3677ee)&&_0x39f9('0x3')===typeof _0x3677ee){_0x2f9884+=_0x3677ee;}if(!_[_0x39f9('0x2')](_0x3b8f2e)&&_0x39f9('0x3')===typeof _0x3b8f2e){_0x2f9884+='\x20'+_0x3b8f2e;}if(_0x2f9884!==''){return _0x2f9884;}return _0x586b9f;}function Action(_0x253ee6,_0x1bd537,_0x4fade7,_0x34711e,_0x300053){this[_0x39f9('0x4')]=_0x4fade7||undefined;this[_0x39f9('0x5')]=_0x253ee6['id'];this[_0x39f9('0x6')]=_0x1bd537[_0x39f9('0x7')];this['type']=_0x1bd537[_0x39f9('0x8')];this[_0x39f9('0x9')]=_0x39f9('0x6');this[_0x39f9('0xa')]=![];this[_0x39f9('0xb')]=_[_0x39f9('0x2')](_0x253ee6[_0x39f9('0xc')])?undefined:_0x253ee6[_0x39f9('0xc')][_0x39f9('0x7')];this[_0x39f9('0xd')]=this[_0x39f9('0xb')]?util[_0x39f9('0xe')](_0x39f9('0xf'),this[_0x39f9('0xb')]):_0x34711e||undefined;this[_0x39f9('0x10')]=checkNameSurname(_0x253ee6[_0x39f9('0x11')][_0x39f9('0x12')],_0x253ee6[_0x39f9('0x11')][_0x39f9('0x13')],_0x253ee6['Contact']['lastName']);this[_0x39f9('0x14')]=_0x253ee6[_0x39f9('0x14')]||![];this[_0x39f9('0x15')]=_0x253ee6[_0x39f9('0x11')]['phone'];this[_0x39f9('0x16')]=_0x253ee6[_0x39f9('0x16')];this['countbusyretry']=_0x253ee6[_0x39f9('0x17')]||0x0;this['countcongestionretry']=_0x253ee6[_0x39f9('0x18')]||0x0;this['countnoanswerretry']=_0x253ee6[_0x39f9('0x19')]||0x0;this['countglobal']=(_0x253ee6[_0x39f9('0x17')]||0x0)+(_0x253ee6[_0x39f9('0x18')]||0x0)+(_0x253ee6[_0x39f9('0x19')]||0x0);this[_0x39f9('0x1a')]=_0x253ee6[_0x39f9('0x1a')];this[_0x39f9('0x1b')]=_0x253ee6[_0x39f9('0x1b')];this['callbackat']=_0x253ee6[_0x39f9('0x1c')];this['recallme']=_0x253ee6[_0x39f9('0x1d')];this['ContactId']=_0x253ee6[_0x39f9('0x1e')];this[_0x39f9('0x1f')]=_0x253ee6[_0x39f9('0x1f')];this[_0x39f9('0x20')]=_['isNil'](_0x253ee6[_0x39f9('0xc')])?_0x253ee6[_0x39f9('0x20')]:_0x253ee6['Agent']['id'];this[_0x39f9('0x21')]=_0x253ee6[_0x39f9('0x21')];this[_0x39f9('0x22')]='';this['originatecalleridname']='';}Action['prototype'][_0x39f9('0x23')]=function(){return util['format'](_0x39f9('0x24'),this['calleridname'],this[_0x39f9('0x25')]);};module[_0x39f9('0x26')]=Action; \ No newline at end of file +var _0x1ff5=['callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','\x22%s\x22\x20<%s>','exports','util','lodash','moment','isNil','string','uniqueid','name','type','queue','membername','Agent','SIP/%s','calleridname','phone','firstName','Contact','lastName','active','scheduledat','countbusyretry','countnoanswerretry','countglobal','countcongestionretry'];(function(_0x29ac44,_0x3fc390){var _0x44e733=function(_0x8bedc5){while(--_0x8bedc5){_0x29ac44['push'](_0x29ac44['shift']());}};_0x44e733(++_0x3fc390);}(_0x1ff5,0x93));var _0x51ff=function(_0x3cbf16,_0x48f57d){_0x3cbf16=_0x3cbf16-0x0;var _0x27e32f=_0x1ff5[_0x3cbf16];return _0x27e32f;};'use strict';var util=require(_0x51ff('0x0'));var _=require(_0x51ff('0x1'));var moment=require(_0x51ff('0x2'));function checkNameSurname(_0x39a8b3,_0x3e2b66,_0x2e4675){var _0x5498ae='';if(!_[_0x51ff('0x3')](_0x3e2b66)&&_0x51ff('0x4')===typeof _0x3e2b66){_0x5498ae+=_0x3e2b66;}if(!_['isNil'](_0x2e4675)&&'string'===typeof _0x2e4675){_0x5498ae+='\x20'+_0x2e4675;}if(_0x5498ae!==''){return _0x5498ae;}return _0x39a8b3;}function Action(_0x187d21,_0x5dca74,_0x10f84f,_0x4922dc,_0x457f49){this[_0x51ff('0x5')]=_0x10f84f||undefined;this['idContact']=_0x187d21['id'];this['queue']=_0x5dca74[_0x51ff('0x6')];this['type']=_0x5dca74[_0x51ff('0x7')];this['campaigntype']=_0x51ff('0x8');this['dialAnswer']=![];this[_0x51ff('0x9')]=_[_0x51ff('0x3')](_0x187d21[_0x51ff('0xa')])?undefined:_0x187d21[_0x51ff('0xa')]['name'];this['channelAgent']=this[_0x51ff('0x9')]?util['format'](_0x51ff('0xb'),this[_0x51ff('0x9')]):_0x4922dc||undefined;this[_0x51ff('0xc')]=checkNameSurname(_0x187d21['Contact'][_0x51ff('0xd')],_0x187d21['Contact'][_0x51ff('0xe')],_0x187d21[_0x51ff('0xf')][_0x51ff('0x10')]);this[_0x51ff('0x11')]=_0x187d21['active']||![];this['calleridnum']=_0x187d21['Contact'][_0x51ff('0xd')];this[_0x51ff('0x12')]=_0x187d21['scheduledat'];this[_0x51ff('0x13')]=_0x187d21[_0x51ff('0x13')]||0x0;this['countcongestionretry']=_0x187d21['countcongestionretry']||0x0;this[_0x51ff('0x14')]=_0x187d21['countnoanswerretry']||0x0;this[_0x51ff('0x15')]=(_0x187d21['countbusyretry']||0x0)+(_0x187d21[_0x51ff('0x16')]||0x0)+(_0x187d21['countnoanswerretry']||0x0);this[_0x51ff('0x17')]=_0x187d21['callback'];this[_0x51ff('0x18')]=_0x187d21[_0x51ff('0x18')];this['callbackat']=_0x187d21[_0x51ff('0x19')];this[_0x51ff('0x1a')]=_0x187d21[_0x51ff('0x1a')];this['ContactId']=_0x187d21[_0x51ff('0x1b')];this[_0x51ff('0x1c')]=_0x187d21[_0x51ff('0x1c')];this['UserId']=_[_0x51ff('0x3')](_0x187d21[_0x51ff('0xa')])?_0x187d21[_0x51ff('0x1d')]:_0x187d21['Agent']['id'];this[_0x51ff('0x1e')]=_0x187d21[_0x51ff('0x1e')];this[_0x51ff('0x1f')]='';this['originatecalleridname']='';}Action['prototype']['getCaller']=function(){return util['format'](_0x51ff('0x20'),this['calleridname'],this['number']);};module[_0x51ff('0x21')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 318b7f9..b29b67b 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 _0x0fa9=['available','loggedIn','pTalking','sumHoldTime','talking','total','type','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalPauses','predictiveIntervalAvailable','message','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','callerid','Interval','stringify','md5','format','voice:queue:%s','voice_queue:save','voice_queue_channel:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','syncCampaigns','clearZombieChannels','hasOwnProperty','setMessage','clearZombieChannel','actions','info','Queue','queue','originated:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[action]','getContactRecallMe','agentReadyId','agents','then','isNil','getDiff','scheduledat','run','logger2','[RecallMe]','catch','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','NoSuchNumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','linkedid','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','pTalking:\x20','custom:agentconnect','connect','custom:agentConnectPreview','buildAcw','complete','buildObj','outboundAnswerCallsDay','answered','decrementTalkink','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','[syncHangup][talking][decrement]','\x20Queue','BUSY','countbusyretry','Busy','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','scheduledAt','dialBusyRetryFrequency','unlockAgent','activeContact','NOANSWER','countnoanswerretry','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','countcongestionretry','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','AgentReject','[syncHangupRequest][logAgentReject]','unlockContact','idContact','disableContact','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','createAgentHistory','logAgent','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','called','Calling','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','unlock','execRun','getContactPreview','recallme','isValid','Contact.phone','Call\x20unsuccessful','validateContact','Agent','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','dialRandomLastDigitCallerIdNumber','getCallerId','originatecalleridname','originatecalleridnum','addVariables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','isFailure','response','custom:agentringnoanswer','Answer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][cause]','destuniqueid','dialstatus','addVariable','variables','syncVarSet','filterKey','variable','keys','value','error','inspect','syncAttendedTransfer','transfertargetlinkedid','transfererlinkedid','util','moment','ioredis','../../../config/environment','preview','actionPreview','./rpcDb','./util/util','redis','localhost','socket.io-emitter','prototype','enqueue','tail','sequence','campaignsPreview','voiceQueues','trunks','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','attendedtransfer','blindtransfer','loopCampaigns','emit','outbound','name','strategy'];(function(_0x5a991f,_0x4a1ef3){var _0x569d4a=function(_0x2bb91c){while(--_0x2bb91c){_0x5a991f['push'](_0x5a991f['shift']());}};_0x569d4a(++_0x4a1ef3);}(_0x0fa9,0x10a));var _0x90fa=function(_0x19dba8,_0xa5f935){_0x19dba8=_0x19dba8-0x0;var _0x4e8df1=_0x0fa9[_0x19dba8];return _0x4e8df1;};'use strict';var util=require(_0x90fa('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0x90fa('0x1'));var md5=require('md5');var Redis=require(_0x90fa('0x2'));var config=require(_0x90fa('0x3'));var logger=require('../../../config/logger')(_0x90fa('0x4'));var loggerAction=require('../../../config/logger')(_0x90fa('0x5'));var ami=require('../ami');var rpcDb=require(_0x90fa('0x6'));var Action=require('./action');var ut=require(_0x90fa('0x7'));config[_0x90fa('0x8')]=_['defaults'](config[_0x90fa('0x8')],{'host':_0x90fa('0x9'),'port':0x18eb});var io=require(_0x90fa('0xa'))(new Redis(config[_0x90fa('0x8')]));var Sequence=function(){};Sequence[_0x90fa('0xb')][_0x90fa('0xc')]=function(_0x371ac8){this['tail']=this[_0x90fa('0xd')]?this['tail']['finally'](_0x371ac8):_0x371ac8();};function Preview(_0x1274fa){this[_0x90fa('0xe')]=new Sequence();this[_0x90fa('0xf')]=_0x1274fa[_0x90fa('0x10')];this[_0x90fa('0x11')]=_0x1274fa['trunks'];this['actions']={};this['agents']=_0x1274fa['agents'];this[_0x90fa('0x12')]=0x0;ami['on'](_0x90fa('0x13'),this[_0x90fa('0x14')][_0x90fa('0x15')](this));ami['on'](_0x90fa('0x16'),this[_0x90fa('0x17')][_0x90fa('0x15')](this));ami['on'](_0x90fa('0x18'),this[_0x90fa('0x19')]['bind'](this));ami['on'](_0x90fa('0x1a'),this[_0x90fa('0x1b')][_0x90fa('0x15')](this));ami['on'](_0x90fa('0x1c'),this[_0x90fa('0x1d')][_0x90fa('0x15')](this));ami['on'](_0x90fa('0x1e'),this['syncVarSet'][_0x90fa('0x15')](this));ami['on'](_0x90fa('0x1f'),this['syncAttendedTransfer'][_0x90fa('0x15')](this));ami['on'](_0x90fa('0x20'),this['syncBlindTransfer'][_0x90fa('0x15')](this));this[_0x90fa('0x21')](this[_0x90fa('0xf')]);}function emit(_0x28ab94,_0x4ee17d,_0x5ae41e){io['to'](_0x28ab94)[_0x90fa('0x22')](_0x4ee17d,_0x5ae41e);}function emitCampaignPreview(_0x850617){if(_0x850617['type']===_0x90fa('0x23')){var _0x149dd4={'id':_0x850617['id'],'name':_0x850617[_0x90fa('0x24')],'strategy':_0x850617[_0x90fa('0x25')],'answered':_0x850617['answered'],'available':_0x850617[_0x90fa('0x26')],'loggedIn':_0x850617[_0x90fa('0x27')],'pTalking':_0x850617[_0x90fa('0x28')],'sumBillable':_0x850617['sumBillable'],'sumDuration':_0x850617['sumDuration'],'sumHoldTime':_0x850617[_0x90fa('0x29')]||0x0,'talking':_0x850617[_0x90fa('0x2a')],'total':_0x850617[_0x90fa('0x2b')],'type':_0x850617[_0x90fa('0x2c')],'unmanaged':_0x850617['unmanaged'],'abandoned':_0x850617[_0x90fa('0x2d')],'waiting':_0x850617[_0x90fa('0x2e')],'loggedInDb':_0x850617[_0x90fa('0x2f')],'dialActive':_0x850617[_0x90fa('0x30')],'dialMethod':_0x850617[_0x90fa('0x31')],'dialOriginateCallerIdName':_0x850617[_0x90fa('0x32')],'dialOriginateCallerIdNumber':_0x850617[_0x90fa('0x33')],'dialOriginateTimeout':_0x850617[_0x90fa('0x34')],'dialPrefix':_0x850617[_0x90fa('0x35')],'outboundAnswerAgiCallsDay':_0x850617[_0x90fa('0x36')],'outboundAnswerCallsDay':_0x850617['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x850617['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x850617['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x850617[_0x90fa('0x37')],'outboundDropCallsDayACS':_0x850617[_0x90fa('0x38')],'outboundDropCallsDayCallersExit':_0x850617[_0x90fa('0x39')],'outboundDropCallsDayTimeout':_0x850617[_0x90fa('0x3a')],'outboundNoAnswerCallsDay':_0x850617[_0x90fa('0x3b')],'outboundNoSuchCallsDay':_0x850617[_0x90fa('0x3c')],'outboundOriginateFailureCallsDay':_0x850617[_0x90fa('0x3d')],'outboundReCallsDay':_0x850617[_0x90fa('0x3e')],'outboundRejectCallsDay':_0x850617[_0x90fa('0x3f')],'outboundUnknownCallsDay':_0x850617[_0x90fa('0x40')],'predictiveIntervalAnsweredCalls':_0x850617[_0x90fa('0x41')],'predictiveIntervalAvgHoldtime':_0x850617[_0x90fa('0x42')],'predictiveIntervalAvgTalktime':_0x850617['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x850617[_0x90fa('0x43')],'predictiveIntervalDroppedCallsTimeout':_0x850617[_0x90fa('0x44')],'predictiveIntervalErlangCalls':_0x850617['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x850617[_0x90fa('0x45')],'predictiveIntervalHitRate':_0x850617['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x850617['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x850617[_0x90fa('0x46')],'predictiveIntervalAvailable':_0x850617[_0x90fa('0x47')],'predictiveIntervalTotalCalls':_0x850617['predictiveIntervalTotalCalls'],'message':_0x850617[_0x90fa('0x48')],'originated':_0x850617[_0x90fa('0x49')],'erlangCalls':_0x850617[_0x90fa('0x4a')],'erlangCallToSecond':_0x850617['erlangCallToSecond'],'erlangAbandonmentRate':_0x850617[_0x90fa('0x4b')],'erlangBusyFactor':_0x850617[_0x90fa('0x4c')],'startPredictive':_0x850617[_0x90fa('0x4d')],'startProgressive':_0x850617['startProgressive']};if(_0x850617[_0x90fa('0x4e')]){_0x149dd4['Trunk']={'id':_0x850617[_0x90fa('0x4e')]['id'],'name':_0x850617['Trunk'][_0x90fa('0x24')],'active':_0x850617['Trunk'][_0x90fa('0x4f')],'callerid':_0x850617[_0x90fa('0x4e')][_0x90fa('0x50')]};}if(_0x850617[_0x90fa('0x51')]){_0x149dd4[_0x90fa('0x51')]={'id':_0x850617[_0x90fa('0x51')]['id'],'name':_0x850617[_0x90fa('0x51')][_0x90fa('0x24')]};}var _0x786f9f=md5(JSON[_0x90fa('0x52')](_0x149dd4));if(_0x850617[_0x90fa('0x53')]!==_0x786f9f){_0x850617[_0x90fa('0x53')]=_0x786f9f;emit(util[_0x90fa('0x54')](_0x90fa('0x55'),_0x149dd4['name']),_0x90fa('0x56'),_0x149dd4);}}}function emitVoiceQueueChannelRemove(_0x1ca3e3){emit(util[_0x90fa('0x54')]('voice:queue:%s',_0x1ca3e3['name']),_0x90fa('0x57'),_0x1ca3e3);}function notSendMessagesQueue(_0x1c0a48){if(_0x1c0a48[_0x90fa('0x58')]){if(_0x1c0a48['originated']===0x0&&_0x1c0a48[_0x90fa('0x28')]===0x0){_0x1c0a48[_0x90fa('0x58')]=![];_0x1c0a48[_0x90fa('0x26')]=0x0;_0x1c0a48[_0x90fa('0x59')]=0x0;_0x1c0a48[_0x90fa('0x48')]=_0x90fa('0x5a');ut[_0x90fa('0x5b')](_0x90fa('0x5c'),_0x1c0a48[_0x90fa('0x24')]+_0x90fa('0x5d'));}else{_0x1c0a48['message']=_0x90fa('0x5e');ut[_0x90fa('0x5b')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x1c0a48[_0x90fa('0x24')]+'\x20is\x20disactive');}emitCampaignPreview(_0x1c0a48);}}Preview[_0x90fa('0xb')][_0x90fa('0x21')]=function(){var _0x172241=this;setInterval(function(){_0x172241[_0x90fa('0x5f')]();},0x7cf);};Preview[_0x90fa('0xb')][_0x90fa('0x5f')]=function(){var _0x2fd850=this[_0x90fa('0xf')];this[_0x90fa('0x12')]+=0x1;for(var _0x3eeb6a in _0x2fd850){if(_0x2fd850['hasOwnProperty'](_0x3eeb6a)&&(_0x2fd850[_0x3eeb6a]['dialMethod']===_0x90fa('0x4')||_0x2fd850[_0x3eeb6a]['dialMethod']==='booked')&&_0x2fd850[_0x3eeb6a][_0x90fa('0x2c')]==='outbound'){if(this['clockClearZombieChannels']>0x7){this[_0x90fa('0x12')]=0x0;this[_0x90fa('0x60')]();}}if(_0x2fd850[_0x90fa('0x61')](_0x3eeb6a)&&_0x2fd850[_0x3eeb6a][_0x90fa('0x31')]===_0x90fa('0x4')&&_0x2fd850[_0x3eeb6a]['type']===_0x90fa('0x23')){if(_0x2fd850[_0x3eeb6a][_0x90fa('0x30')]){this[_0x90fa('0x62')](_0x2fd850[_0x3eeb6a]);this['recallMe'](_0x2fd850[_0x3eeb6a]);}else{notSendMessagesQueue(_0x2fd850[_0x3eeb6a]);}}}};Preview['prototype'][_0x90fa('0x63')]=function(_0x129fe0){var _0x2eb246=this;this[_0x90fa('0xe')][_0x90fa('0xc')](function(){if(!_['isNil'](_0x2eb246[_0x90fa('0x64')][_0x129fe0])){loggerAction[_0x90fa('0x65')]('[clearZombieChannels][talking]',_0x129fe0,_0x90fa('0x66'),_0x2eb246[_0x90fa('0x64')][_0x129fe0][_0x90fa('0x67')],_0x90fa('0x68'),JSON['stringify'](_0x2eb246[_0x90fa('0xf')][_0x2eb246[_0x90fa('0x64')][_0x129fe0][_0x90fa('0x67')]][_0x90fa('0x49')]),'pTalking:\x20',JSON[_0x90fa('0x52')](_0x2eb246[_0x90fa('0xf')][_0x2eb246[_0x90fa('0x64')][_0x129fe0][_0x90fa('0x67')]][_0x90fa('0x28')]),JSON[_0x90fa('0x52')](_0x2eb246['actions'][_0x129fe0][_0x90fa('0x69')]),JSON[_0x90fa('0x52')](_[_0x90fa('0x6a')](_0x2eb246[_0x90fa('0x64')][_0x129fe0],[_0x90fa('0x6b'),_0x90fa('0x6c'),_0x90fa('0x6d'),_0x90fa('0x6e')])));return ami[_0x90fa('0x6f')]({'action':_0x90fa('0x70'),'channel':_0x2eb246[_0x90fa('0x64')][_0x129fe0][_0x90fa('0x71')]})['catch'](function(_0x203fdc){if(_0x203fdc[_0x90fa('0x48')]===_0x90fa('0x72')){setTimeout(function(){if(_0x2eb246[_0x90fa('0x64')][_0x129fe0]){ut[_0x90fa('0x73')](_0x2eb246['campaignsPreview'][_0x2eb246[_0x90fa('0x64')][_0x129fe0][_0x90fa('0x67')]],'[clearZombieChannel]');if(_0x2eb246[_0x90fa('0x64')][_0x129fe0][_0x90fa('0x69')]===!![]){ut['decrementTalkink'](_0x2eb246[_0x90fa('0xf')][_0x2eb246['actions'][_0x129fe0][_0x90fa('0x67')]],_0x90fa('0x74'));ut[_0x90fa('0x75')](_0x90fa('0x76')+_0x129fe0,_0x2eb246[_0x90fa('0x64')][_0x129fe0][_0x90fa('0x67')]);}ut[_0x90fa('0x75')]('[Dialer][checkChannel][Preview]'+_0x129fe0,_0x2eb246[_0x90fa('0x64')][_0x129fe0][_0x90fa('0x67')]);delete _0x2eb246[_0x90fa('0x64')][_0x129fe0];}},0x2328);}});}});};Preview['prototype'][_0x90fa('0x60')]=function(){var _0x7c2ac8=this;loggerAction['info'](_0x90fa('0x77'),_['size'](this[_0x90fa('0x64')]));for(var _0xbe70ac in this['actions']){if(_0x7c2ac8['actions'][_0x90fa('0x61')](_0xbe70ac)){_0x7c2ac8[_0x90fa('0x63')](_0xbe70ac);}}};Preview[_0x90fa('0xb')]['recallMe']=function(_0x46489f){var _0x507587=this;rpcDb[_0x90fa('0x78')](_0x46489f['id'],ut[_0x90fa('0x79')](this[_0x90fa('0x7a')]))[_0x90fa('0x7b')](function(_0xe57079){if(!_[_0x90fa('0x7c')](_0xe57079)){for(var _0xc827=0x0;_0xc827<_0xe57079['length'];_0xc827+=0x1){if(ut[_0x90fa('0x7d')](_0xe57079[_0xc827][_0x90fa('0x7e')])<_0x46489f['dialRecallMeTimeout']*0x3c){_0x507587[_0x90fa('0x7f')](_0xe57079[_0xc827]['id'])['then'](ut[_0x90fa('0x80')](_0x90fa('0x81')))[_0x90fa('0x82')](ut[_0x90fa('0x80')]('[RecallMe]'));}else{var _0x259b38=new Action(_0xe57079[_0xc827],_0x46489f);_0x259b38[_0x90fa('0x83')]=moment()[_0x90fa('0x54')](_0x90fa('0x84'));_0x46489f[_0x90fa('0x3e')]+=0x1;ut[_0x90fa('0x85')](_0x259b38,0x17,_0x90fa('0x86'));if(_0x46489f['dialRecallInQueue']){rpcDb[_0x90fa('0x87')](ut[_0x90fa('0x88')](_0xe57079[_0xc827]));rpcDb[_0x90fa('0x89')](_0x259b38,_0x90fa('0x8a'));}else{ut[_0x90fa('0x85')](_0x259b38,0x16,_0x90fa('0x8b'));rpcDb['createCustomerHistory'](_0x259b38,_0x90fa('0x8c'));rpcDb[_0x90fa('0x8d')](_0x259b38,_0x90fa('0x8c'));}}}}})['catch'](ut['logger2'](_0x90fa('0x8e')));};Preview[_0x90fa('0xb')]['setMessage']=function(_0x3ef92c){_0x3ef92c[_0x90fa('0x58')]=!![];if(ut['IsNotLoggedIn'](_0x3ef92c[_0x90fa('0x27')])){_0x3ef92c[_0x90fa('0x48')]=_0x90fa('0x8f');}else if(!ut[_0x90fa('0x90')](_0x3ef92c['dialActive'])){_0x3ef92c['message']=_0x90fa('0x5a');}else if(!this[_0x90fa('0x91')](_0x3ef92c[_0x90fa('0x4e')])){if(!this[_0x90fa('0x91')](_0x3ef92c[_0x90fa('0x92')])){_0x3ef92c[_0x90fa('0x48')]=_0x90fa('0x93');}else{_0x3ef92c[_0x90fa('0x48')]=_0x90fa('0x94');}}else{_0x3ef92c[_0x90fa('0x48')]=_0x90fa('0x94');}emitCampaignPreview(_0x3ef92c);};Preview[_0x90fa('0xb')][_0x90fa('0x95')]=function(_0x320569,_0x56f314,_0x56d9af){var _0x3a9e6a=this;var _0x409154=this['actions'][_0x56f314];var _0x14a326=this['campaignsPreview'][_0x409154[_0x90fa('0x67')]];var _0x2286f8;if(_0x14a326){switch(_0x56d9af){case'1':_0x14a326[_0x90fa('0x3c')]+=0x1;_0x409154[_0x90fa('0x96')]=ut[_0x90fa('0x97')](_0x409154);ut['logCustomer'](_0x409154,0x0,_0x90fa('0x98'));rpcDb[_0x90fa('0x89')](_0x409154,_0x90fa('0x99'));if(ut['totalGlobal'](_0x409154)>=_0x14a326[_0x90fa('0x9a')]){_0x2286f8=ut[_0x90fa('0x9b')](_0x409154,0xf,_0x90fa('0x9c'));rpcDb['createCustomerFinal'](_0x2286f8,_0x90fa('0x9d'));}else{rpcDb['createCustomerFinal'](_0x409154,_0x90fa('0x9d'));}delete this['actions'][_0x320569[_0x90fa('0x9e')]];break;case _0x90fa('0x9f'):var _0x3fcbcf=moment()[_0x90fa('0x54')](_0x90fa('0x84'));_0x409154[_0x90fa('0xa0')]=_0x3fcbcf;_0x409154[_0x90fa('0xa1')]=_0x3fcbcf;_0x409154[_0x90fa('0x69')]=!![];_0x14a326['pTalking']+=0x1;logger[_0x90fa('0x65')](_0x90fa('0xa2'),_0x409154[_0x90fa('0xa3')],'\x20Queue',_0x14a326[_0x90fa('0x24')],_0x90fa('0xa4'),_0x14a326[_0x90fa('0x28')]);ami[_0x90fa('0x22')](_0x90fa('0xa5'),ut['buildObj'](_0x409154,_0x90fa('0xa6')));if(_0x14a326['acw']){ami[_0x90fa('0x22')](_0x90fa('0xa7'),ut[_0x90fa('0xa8')](_0x409154));}break;case'16':ami[_0x90fa('0x22')]('custom:agentcomplete',ut['buildObj'](_0x409154,_0x90fa('0xa9')));emitVoiceQueueChannelRemove(ut[_0x90fa('0xaa')](_0x409154,_0x90fa('0xa9')));_0x14a326[_0x90fa('0xab')]+=0x1;_0x14a326['total']+=0x1;_0x14a326[_0x90fa('0xac')]+=0x1;ut[_0x90fa('0xad')](_0x14a326,_0x90fa('0xae'));_0x409154[_0x90fa('0x96')]=ut[_0x90fa('0x97')](_0x409154);ut['logCustomer'](_0x409154,0x4,'Answer');rpcDb[_0x90fa('0x89')](_0x409154,_0x90fa('0xaf'));rpcDb[_0x90fa('0x8d')](_0x409154,_0x90fa('0xb0'));rpcDb[_0x90fa('0xb1')](_0x409154);_0x14a326[_0x90fa('0xb2')]+=_0x409154['talktime'];_0x14a326['sumBillable']+=_0x409154['talktime'];logger[_0x90fa('0x65')](_0x90fa('0xb3'),_0x409154[_0x90fa('0xa3')],_0x90fa('0xb4'),_0x14a326[_0x90fa('0x24')],'pTalking:\x20',_0x14a326[_0x90fa('0x28')]);delete this[_0x90fa('0x64')][_0x320569[_0x90fa('0x9e')]];break;case _0x90fa('0xb5'):_0x14a326['outboundBusyCallsDay']+=0x1;_0x409154[_0x90fa('0xb6')]+=0x1;_0x409154[_0x90fa('0x96')]=ut[_0x90fa('0x97')](_0x409154);ut['logCustomer'](_0x409154,0x5,_0x90fa('0xb7'));rpcDb[_0x90fa('0x89')](_0x409154,'[callProgressDetectingCustomer][logBusy]');if(ut['totalGlobal'](_0x409154)>=_0x14a326['dialGlobalMaxRetry']){_0x2286f8=ut['cloneAction'](_0x409154,0xf,_0x90fa('0x9c'));rpcDb['createCustomerFinal'](_0x2286f8,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x409154[_0x90fa('0xb6')]>=_0x14a326[_0x90fa('0xb8')]){rpcDb[_0x90fa('0x8d')](_0x409154,_0x90fa('0xb9'));}else{rpcDb['rescheduleContact'](ut[_0x90fa('0xba')](_0x409154,'countbusyretry',_0x14a326[_0x90fa('0xbb')]),_0x409154[_0x90fa('0xbc')],_0x409154[_0x90fa('0xbd')]);}}break;case _0x90fa('0xbe'):_0x14a326['outboundNoAnswerCallsDay']+=0x1;_0x409154[_0x90fa('0xbf')]+=0x1;_0x409154[_0x90fa('0x96')]=ut[_0x90fa('0x97')](_0x409154);ut[_0x90fa('0x85')](_0x409154,0x3,'NoAnswer');rpcDb['createCustomerHistory'](_0x409154,_0x90fa('0xc0'));if(ut[_0x90fa('0x97')](_0x409154)>=_0x14a326['dialGlobalMaxRetry']){_0x2286f8=ut[_0x90fa('0x9b')](_0x409154,0xf,_0x90fa('0x9c'));rpcDb['createCustomerFinal'](_0x2286f8,_0x90fa('0xc1'));}else{if(_0x409154[_0x90fa('0xbf')]>=_0x14a326[_0x90fa('0xc2')]){rpcDb[_0x90fa('0x8d')](_0x409154,_0x90fa('0xc0'));}else{rpcDb['rescheduleContact'](ut[_0x90fa('0xba')](_0x409154,_0x90fa('0xbf'),_0x14a326['dialNoAnswerRetryFrequency']),_0x409154[_0x90fa('0xbc')],_0x409154[_0x90fa('0xbd')]);}}break;case'CONGESTION':_0x14a326[_0x90fa('0x37')]+=0x1;_0x409154[_0x90fa('0xc3')]+=0x1;_0x409154[_0x90fa('0x96')]=ut[_0x90fa('0x97')](_0x409154);ut[_0x90fa('0x85')](_0x409154,0x8,'Congestion');rpcDb[_0x90fa('0x89')](_0x409154,_0x90fa('0xc4'));if(ut[_0x90fa('0x97')](_0x409154)>=_0x14a326[_0x90fa('0x9a')]){_0x2286f8=ut[_0x90fa('0x9b')](_0x409154,0xf,_0x90fa('0x9c'));rpcDb[_0x90fa('0x8d')](_0x2286f8,_0x90fa('0xc5'));}else{if(_0x409154['countcongestionretry']>=_0x14a326[_0x90fa('0xc6')]){rpcDb[_0x90fa('0x8d')](_0x409154,_0x90fa('0xc4'));}else{rpcDb['rescheduleContact'](ut[_0x90fa('0xba')](_0x409154,'countcongestionretry',_0x14a326[_0x90fa('0xbb')]),_0x409154[_0x90fa('0xbc')],_0x409154[_0x90fa('0xbd')]);}}break;case'CANCEL':_0x14a326[_0x90fa('0x3f')]+=0x1;_0x409154[_0x90fa('0x96')]=ut[_0x90fa('0x97')](_0x409154);ut[_0x90fa('0x85')](_0x409154,0x14,_0x90fa('0xc7'));rpcDb['createCustomerHistory'](_0x409154,_0x90fa('0xc8'));if(_0x409154[_0x90fa('0xbc')]){rpcDb[_0x90fa('0xc9')](_0x409154[_0x90fa('0xca')]);}if(_0x409154[_0x90fa('0xbd')]){rpcDb[_0x90fa('0xcb')](_0x409154['idContact']);}break;default:if(_0x409154['dialAnswer']){ut[_0x90fa('0xad')](_0x14a326,_0x90fa('0xcc'));ut[_0x90fa('0x75')](_0x90fa('0xcd')+_0x14a326['name'],_0x320569);}_0x14a326[_0x90fa('0x40')]+=0x1;_0x409154[_0x90fa('0x96')]=ut['totalGlobal'](_0x409154);ut[_0x90fa('0x85')](_0x409154,0xc,_0x320569['cause-txt']||_0x320569['dialstatus']);rpcDb[_0x90fa('0x89')](_0x409154,_0x90fa('0xce'));if(ut[_0x90fa('0x97')](_0x409154)>=_0x14a326[_0x90fa('0x9a')]){_0x2286f8=ut[_0x90fa('0x9b')](_0x409154,0xf,_0x90fa('0x9c'));rpcDb['createCustomerFinal'](_0x2286f8,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb['createCustomerFinal'](_0x409154,_0x90fa('0xcf'));}delete this[_0x90fa('0x64')][_0x320569['linkedid']];}if(!(_0x409154[_0x90fa('0x69')]&&_0x56d9af==='16')){ut[_0x90fa('0x73')](_0x14a326,_0x90fa('0xd0'));logger[_0x90fa('0x65')]('[originated][decrement][callProgressDetectingCustomer]',_0x409154[_0x90fa('0xa3')],'\x20Queue',_0x14a326['name'],_0x90fa('0x68'),_0x14a326[_0x90fa('0x49')]);}if(_0x56d9af!==_0x90fa('0x9f')){delete this['actions'][_0x320569[_0x90fa('0x9e')]];delete this[_0x90fa('0x64')][_0x320569[_0x90fa('0xd1')]];}}};Preview['prototype'][_0x90fa('0xd2')]=function(_0x46472d,_0x5c933a,_0x4b9e00){if(_['isUndefined'](_0x5c933a)&&_0x90fa('0xd3')!==typeof _0x5c933a){return;}if(_[_0x90fa('0xd4')](_0x4b9e00)&&_0x90fa('0xd3')!==typeof _0x4b9e00){return;}switch(_0x4b9e00[_0x90fa('0xd5')]){case'0':ut['logAgent'](_0x46472d,0x0,_0x90fa('0x98'));rpcDb[_0x90fa('0xd6')](_0x46472d,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0x90fa('0xd7')](_0x46472d,0x3,'NoAnswer');rpcDb[_0x90fa('0xd6')](_0x46472d,_0x90fa('0xd8'));break;case'5':ut[_0x90fa('0xd7')](_0x46472d,0x5,_0x90fa('0xb7'));rpcDb['createAgentHistory'](_0x46472d,_0x90fa('0xd9'));break;case'8':ut[_0x90fa('0xd7')](_0x46472d,0x8,_0x90fa('0xda'));rpcDb[_0x90fa('0xd6')](_0x46472d,_0x90fa('0xdb'));break;case'22':ut['logAgent'](_0x46472d,0x16,'AnswerAGI');rpcDb['createAgentHistory'](_0x46472d,_0x90fa('0xdc'));break;default:ut[_0x90fa('0xd7')](_0x46472d,0xc,_0x4b9e00[_0x90fa('0xd5')]);rpcDb[_0x90fa('0xd6')](_0x46472d,_0x90fa('0xdb'));}ut[_0x90fa('0x73')](_0x5c933a,_0x90fa('0xdd'));logger[_0x90fa('0x65')](_0x90fa('0xde'),_0x46472d[_0x90fa('0xa3')],_0x90fa('0xb4'),_0x5c933a[_0x90fa('0x24')],_0x90fa('0x68'),_0x5c933a[_0x90fa('0x49')]);delete this[_0x90fa('0x64')][_0x46472d[_0x90fa('0xa3')]];};Preview[_0x90fa('0xb')][_0x90fa('0xdf')]=function(_0x2461fe,_0x5dbcab,_0x48dd96,_0x25c25d,_0x4e2b42){var _0x5a34dc=this;return new BPromise(function(_0x39a920,_0x425794){if(_[_0x90fa('0x7c')](_0x5dbcab)||_[_0x90fa('0x7c')](_0x5dbcab[_0x90fa('0xe0')])||_[_0x90fa('0x7c')](_0x5dbcab[_0x90fa('0xe0')][_0x90fa('0xe1')])||_[_0x90fa('0x7c')](_0x5dbcab[_0x90fa('0x6d')])){_0x425794(ut['message'](_0x90fa('0xe2'),_0x25c25d,_0x4e2b42));return;}var _0x224f2f=uuid['v4']();var _0x5b169c=_0x5a34dc['campaignsPreview'][_0x5dbcab[_0x90fa('0x66')][_0x90fa('0x24')]];var _0xc3be9b=_0x48dd96?_0x5a34dc[_0x90fa('0x7a')][_0x48dd96]['id']:undefined;_0x5a34dc[_0x90fa('0x64')][_0x224f2f]=new Action(_0x5dbcab,_0x5b169c,_0x224f2f,_0x48dd96,_0xc3be9b);var _0x43e35c=_0x5a34dc[_0x90fa('0x64')][_0x224f2f];_0x43e35c[_0x90fa('0xbc')]=_0x25c25d;_0x43e35c[_0x90fa('0xbd')]=_0x4e2b42;_0x43e35c[_0x90fa('0xe3')]=_0x48dd96;if(_[_0x90fa('0xe4')](_0x2461fe)){_0x5a34dc[_0x90fa('0xe5')](_0x43e35c,_0x5b169c,_0x5dbcab,_0x48dd96)[_0x90fa('0x7b')](function(_0xc62164){logger[_0x90fa('0x65')](_0x90fa('0xe6'),_0x90fa('0xe7')+_0x43e35c[_0x90fa('0x67')]+'\x20IdHopper:\x20'+_0x43e35c[_0x90fa('0xca')],JSON[_0x90fa('0x52')](_0xc62164));ami['emit']('custom:agentcalled',ut[_0x90fa('0xaa')](_0x43e35c,_0x90fa('0xe8')));_0x39a920(ut[_0x90fa('0x48')](_0x90fa('0xe9')));})[_0x90fa('0x82')](function(_0x5b46a4){ut[_0x90fa('0x5b')](_0x90fa('0xea'),_0x5b46a4);_0x425794(ut[_0x90fa('0x48')](_0x90fa('0xeb'),_0x25c25d,_0x4e2b42));});}else{_0x5b169c[_0x90fa('0xec')]+=0x1;ut[_0x90fa('0xed')](_0x43e35c);rpcDb[_0x90fa('0xee')](_0x43e35c,_0x90fa('0xef'));delete _0x5a34dc['actions'][_0x224f2f];_0x425794(ut[_0x90fa('0x48')](_0x90fa('0xf0'),_0x25c25d,_0x4e2b42));}});};Preview[_0x90fa('0xb')][_0x90fa('0x91')]=function(_0x14e8d6){return!_[_0x90fa('0x7c')](_0x14e8d6)&&!_[_0x90fa('0x7c')](_0x14e8d6['name'])&&!_[_0x90fa('0x7c')](_0x14e8d6['active'])&&_0x14e8d6['active']&&!_[_0x90fa('0x7c')](this[_0x90fa('0x11')][util[_0x90fa('0x54')](_0x90fa('0xf1'),_0x14e8d6['name'])])&&!_[_0x90fa('0x7c')](this[_0x90fa('0x11')][util['format'](_0x90fa('0xf1'),_0x14e8d6[_0x90fa('0x24')])][_0x90fa('0x70')])&&(this['trunks'][util[_0x90fa('0x54')](_0x90fa('0xf1'),_0x14e8d6[_0x90fa('0x24')])][_0x90fa('0x70')]===_0x90fa('0xf2')||this[_0x90fa('0x11')][util['format'](_0x90fa('0xf1'),_0x14e8d6[_0x90fa('0x24')])][_0x90fa('0x70')]===_0x90fa('0xf3'));};Preview['prototype']['run']=function(_0x198501,_0x46706b){var _0x19bb9e=this;return new BPromise(function(_0x2b130b,_0x199c6c){_0x19bb9e['execRun'](_0x198501,_0x46706b)[_0x90fa('0x7b')](function(_0x30e812){_0x2b130b(_[_0x90fa('0x6a')](_0x30e812,[_0x90fa('0x48')]));})[_0x90fa('0x82')](function(_0x37f587){if(_0x37f587[_0x90fa('0xf4')]){rpcDb[_0x90fa('0xc9')](_0x198501);}if(_0x37f587[_0x90fa('0x4f')]){rpcDb[_0x90fa('0xcb')](_0x198501);}_0x199c6c(_[_0x90fa('0x6a')](_0x37f587,[_0x90fa('0x48')]));});});};Preview[_0x90fa('0xb')][_0x90fa('0xf5')]=function(_0x199e9a,_0x5068d8){var _0x525f65=this;return new BPromise(function(_0xbb102d,_0x118988){var _0x5889d1,_0xd59eae;rpcDb[_0x90fa('0xf6')](_0x199e9a)[_0x90fa('0x7b')](function(_0x27ab12){if(!_['isNil'](_0x27ab12[0x0])){_0xd59eae=_0x27ab12[0x0]['recallme']?![]:!![];_0x5889d1=_0x27ab12[0x0][_0x90fa('0xf7')]?!![]:![];_0x5889d1=_0x5068d8?!![]:_0x5889d1;}var _0x172496=_0x525f65['validateContact'](_0x27ab12);if(_0x172496[_0x90fa('0xf8')]){rpcDb['checkIsBlackList'](_[_0x90fa('0x6a')](_0x27ab12[0x0],[_0x90fa('0x6d'),_0x90fa('0xf9')]))[_0x90fa('0x7b')](function(_0x41cc85){_0x525f65[_0x90fa('0xdf')](_0x41cc85,_0x27ab12[0x0],_0x5068d8,_0xd59eae,_0x5889d1)[_0x90fa('0x7b')](function(_0xe76f11){_0xbb102d(_0xe76f11);})['catch'](function(_0x1648a4){_0x118988(_0x1648a4);});})[_0x90fa('0x82')](function(_0x251499){ut[_0x90fa('0x5b')]('[Preview][checkIsBlackList]',_0x251499);_0x118988(ut[_0x90fa('0x48')](_0x90fa('0xfa'),_0xd59eae,_0x5889d1));});}else{_0x118988(ut[_0x90fa('0x48')](_0x172496[_0x90fa('0x48')],_0xd59eae,_0x5889d1));}})[_0x90fa('0x82')](function(_0x1d5653){ut[_0x90fa('0x5b')]('[Preview][getContactPreview]',_0x1d5653);_0x118988(ut[_0x90fa('0x48')]('Call\x20unsuccessful',![],!![]));});});};Preview[_0x90fa('0xb')][_0x90fa('0xfb')]=function(_0x2ab4cb){if(_[_0x90fa('0x7c')](_0x2ab4cb)||_['isEmpty'](_0x2ab4cb)||!_[_0x90fa('0x7c')](_0x2ab4cb[0x0][_0x90fa('0xfc')])&&_['isNil'](_0x2ab4cb[0x0][_0x90fa('0xfc')][_0x90fa('0x24')])){ut[_0x90fa('0x5b')]('[Preview][validateContact][Empty\x20Contact]',_0x2ab4cb);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x1ced8b=this['campaignsPreview'][_0x2ab4cb[0x0][_0x90fa('0x66')][_0x90fa('0x24')]];_0x1ced8b[_0x90fa('0x48')]=_0x90fa('0x94');if(_[_0x90fa('0x7c')](_0x1ced8b)){ut[_0x90fa('0x5b')](_0x90fa('0xfd'),_0x1ced8b);return{'isValid':![],'message':_0x90fa('0xfe')};}if(!this[_0x90fa('0x91')](_0x1ced8b[_0x90fa('0x4e')])){ut[_0x90fa('0x5b')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x90fa('0xff')+_0x1ced8b[_0x90fa('0x24')]+_0x90fa('0x100'));if(!this[_0x90fa('0x91')](_0x1ced8b[_0x90fa('0x92')])){ut[_0x90fa('0x5b')](_0x90fa('0x101'),_0x1ced8b['name']+_0x90fa('0x102'));return{'isValid':![],'message':_0x90fa('0x103')};}}if(!ut[_0x90fa('0x90')](_0x1ced8b[_0x90fa('0x30')])){ut[_0x90fa('0x5b')](_0x90fa('0x104'),_0x1ced8b['name']+'\x20Not\x20Active');return{'isValid':![],'message':_0x90fa('0xff')+_0x1ced8b[_0x90fa('0x24')]+_0x90fa('0x105')};}return{'isValid':!![],'message':_0x90fa('0x106')};};Preview[_0x90fa('0xb')][_0x90fa('0xe5')]=function(_0x42c44d,_0x445095,_0x4e37ce,_0x317c5c){var _0x3a90d8=this;return new BPromise(function(_0x2759ac,_0x8c14da){var _0x2ab975=_0x42c44d[_0x90fa('0xa3')];var _0x5a3ac1=_0x3a90d8['isTrunkReachable'](_0x445095[_0x90fa('0x4e')])?util[_0x90fa('0x54')](_0x90fa('0x107'),_0x445095[_0x90fa('0x4e')]['name'],_[_0x90fa('0x7c')](_0x445095[_0x90fa('0x35')])?'':_0x445095[_0x90fa('0x35')][_0x90fa('0x108')]()||'',_0x445095['dialCutDigit']>0x0?_0x4e37ce['Contact'][_0x90fa('0xe1')]['substring'](_0x445095[_0x90fa('0x109')]):_0x4e37ce[_0x90fa('0xe0')]['phone']):util[_0x90fa('0x54')](_0x90fa('0x107'),_[_0x90fa('0x7c')](_0x445095['TrunkBackup'])?_0x445095[_0x90fa('0x4e')][_0x90fa('0x24')]:_0x445095[_0x90fa('0x92')][_0x90fa('0x24')],_[_0x90fa('0x7c')](_0x445095[_0x90fa('0x35')])?'':_0x445095['dialPrefix'][_0x90fa('0x108')]()||'',_0x445095[_0x90fa('0x109')]>0x0?_0x4e37ce[_0x90fa('0xe0')][_0x90fa('0xe1')][_0x90fa('0x10a')](_0x445095['dialCutDigit']):_0x4e37ce['Contact'][_0x90fa('0xe1')]);var _0x1beffc=_0x3a90d8[_0x90fa('0x91')](_0x445095[_0x90fa('0x4e')])?ut['getCallerId'](_0x445095[_0x90fa('0x4e')][_0x90fa('0x50')],_0x445095[_0x90fa('0x32')],_0x445095[_0x90fa('0x10b')]>0x0?ut['getCallerIdRandom'](_0x445095[_0x90fa('0x33')],_0x445095[_0x90fa('0x10b')]):_0x445095[_0x90fa('0x33')]):ut[_0x90fa('0x10c')](_['isNil'](_0x445095[_0x90fa('0x92')])?_0x445095['Trunk'][_0x90fa('0x50')]:_0x445095[_0x90fa('0x92')][_0x90fa('0x50')],_0x445095[_0x90fa('0x32')],_0x445095[_0x90fa('0x10b')]>0x0?ut['getCallerIdRandom'](_0x445095[_0x90fa('0x33')],_0x445095[_0x90fa('0x10b')]):_0x445095[_0x90fa('0x33')]);if(_0x1beffc){_0x42c44d[_0x90fa('0x10d')]=ut['extractCalleridName'](_0x1beffc);_0x42c44d[_0x90fa('0x10e')]=ut['extractCalleridNumber'](_0x1beffc);}var _0x14a072=ut[_0x90fa('0x10f')](_0x445095,_0x4e37ce,_0x5a3ac1,_0x1beffc,_0x2ab975,_0x42c44d);_['merge'](_0x42c44d,ut['toLowerVariables'](_0x14a072));_0x42c44d[_0x90fa('0x83')]=moment()[_0x90fa('0x54')](_0x90fa('0x84'));ami[_0x90fa('0x6f')](ut[_0x90fa('0x110')](_0x42c44d,_0x445095,_0x14a072,_0x42c44d[_0x90fa('0xbd')],_0x317c5c))[_0x90fa('0x7b')](function(_0x5b9daf){_0x445095[_0x90fa('0x49')]+=0x1;logger[_0x90fa('0x65')](_0x90fa('0x111'),_0x2ab975,_0x90fa('0xb4'),_0x445095[_0x90fa('0x24')],_0x90fa('0x68'),_0x445095[_0x90fa('0x49')]);_0x2759ac(_0x5b9daf);})['catch'](function(_0x21dbd0){ut['logAgent'](_0x42c44d,0xe,_0x90fa('0x112'));rpcDb[_0x90fa('0xd6')](_0x42c44d,_0x90fa('0x113'));_0x8c14da(_0x21dbd0);});});};Preview['prototype'][_0x90fa('0x1d')]=function(_0x39e7f1){if(this[_0x90fa('0x64')][_0x39e7f1['linkedid']]){this[_0x90fa('0x64')][_0x39e7f1[_0x90fa('0x9e')]][_0x90fa('0x71')]=_0x39e7f1[_0x90fa('0x71')];}};Preview[_0x90fa('0xb')][_0x90fa('0x14')]=function(_0x43becd){var _0x3cffcd=this;var _0x2202e5=this[_0x90fa('0x64')][_0x43becd[_0x90fa('0x114')]];if(_0x2202e5){if(_0x2202e5[_0x90fa('0xe3')]&&this['agents'][_0x2202e5[_0x90fa('0xe3')]]){ut[_0x90fa('0x115')](_0x2202e5,this[_0x90fa('0x7a')][_0x2202e5['lookAgent']][_0x90fa('0x24')],this[_0x90fa('0x7a')][_0x2202e5['lookAgent']]['id']);}var _0x531c19=_['clone'](_0x2202e5);_0x531c19[_0x90fa('0xa0')]=moment()[_0x90fa('0x54')]('YYYY-MM-DD\x20HH:mm:ss');var _0x376219=_0x3cffcd[_0x90fa('0xf')][_0x2202e5[_0x90fa('0x67')]];if(ut[_0x90fa('0x116')](_0x43becd[_0x90fa('0x117')])){if(_0x2202e5['unlockAgent']){rpcDb['unlockContact'](_0x2202e5[_0x90fa('0xca')]);}if(_0x2202e5[_0x90fa('0xbd')]){rpcDb[_0x90fa('0xcb')](_0x2202e5[_0x90fa('0xca')]);}ami[_0x90fa('0x22')](_0x90fa('0x118'),ut[_0x90fa('0xaa')](_0x2202e5,'rejected'));this[_0x90fa('0xd2')](_0x531c19,_0x376219,_0x43becd);}else{_0x2202e5[_0x90fa('0x83')]=moment()[_0x90fa('0x54')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0x90fa('0xd7')](_0x531c19,0x4,_0x90fa('0x119'));rpcDb['createAgentHistory'](_0x531c19,_0x90fa('0x11a'));}}};Preview[_0x90fa('0xb')][_0x90fa('0x17')]=function(_0x7340f9){var _0x4b7ad0=this;var _0x59fbf6=this[_0x90fa('0x64')][_0x7340f9[_0x90fa('0x9e')]];var _0x518614;if(_0x59fbf6){_0x518614=this['campaignsPreview'][_0x59fbf6[_0x90fa('0x67')]];logger[_0x90fa('0x65')](_0x90fa('0x11b'),_0x7340f9['linkedid'],_0x90fa('0xb4'),_0x518614[_0x90fa('0x24')],'pTalking:\x20',_0x518614[_0x90fa('0x28')]);}if(this[_0x90fa('0x64')][_0x7340f9['linkedid']]&&_0x7340f9[_0x90fa('0x9e')]!==_0x7340f9['uniqueid']){if(_0x7340f9[_0x90fa('0x11c')]==='16'&&this[_0x90fa('0x64')][_0x7340f9[_0x90fa('0x9e')]][_0x90fa('0x69')]){this['callProgressDetectingCustomer'](_0x7340f9,_0x7340f9['linkedid'],_0x7340f9[_0x90fa('0x11c')]);}else if(this['actions'][_0x7340f9[_0x90fa('0x9e')]][_0x90fa('0x69')]){logger[_0x90fa('0x65')]('[syncHangup][talking][cause]',_0x7340f9[_0x90fa('0x9e')],_0x7340f9[_0x90fa('0x11c')],_0x90fa('0xb4'),_0x518614[_0x90fa('0x24')],_0x90fa('0xa4'),_0x518614[_0x90fa('0x28')]);this[_0x90fa('0x95')](_0x7340f9,_0x7340f9[_0x90fa('0x9e')],_0x7340f9['cause']);}}else if(_0x59fbf6&&_[_0x90fa('0x7c')](_0x59fbf6[_0x90fa('0x11d')])&&_0x518614[_0x90fa('0x11e')]&&_0x7340f9['linkedid']===_0x7340f9[_0x90fa('0xa3')]&&_[_0x90fa('0x7c')](_0x7340f9[_0x90fa('0xd5')])&&_0x7340f9[_0x90fa('0x11c')]==='16'&&_0x7340f9[_0x90fa('0x11f')]==='6'&&_[_0x90fa('0xd4')](_0x59fbf6[_0x90fa('0x120')])){if(_0x59fbf6[_0x90fa('0xbc')]){rpcDb[_0x90fa('0xc9')](_0x59fbf6[_0x90fa('0xca')]);}if(_0x59fbf6['activeContact']){rpcDb[_0x90fa('0xcb')](_0x59fbf6[_0x90fa('0xca')]);}_0x7340f9[_0x90fa('0xd5')]='22';this[_0x90fa('0xd2')](_0x59fbf6,_0x518614,_0x7340f9);}else if(_0x59fbf6&&_0x59fbf6['transfer']){if(_0x7340f9[_0x90fa('0x11c')]==='16'&&this[_0x90fa('0x64')][_0x7340f9[_0x90fa('0x9e')]][_0x90fa('0x69')]){logger['info']('[syncHangup][talking][transfer]',_0x7340f9[_0x90fa('0x9e')],_0x7340f9[_0x90fa('0x11c')],_0x90fa('0xb4'),_0x518614[_0x90fa('0x24')],'pTalking:\x20',_0x518614[_0x90fa('0x28')]);this[_0x90fa('0x95')](_0x7340f9,_0x7340f9['linkedid'],_0x7340f9[_0x90fa('0x11c')]);}else if(this['actions'][_0x7340f9[_0x90fa('0x9e')]][_0x90fa('0x69')]){logger[_0x90fa('0x65')](_0x90fa('0x121'),_0x7340f9['linkedid'],_0x7340f9[_0x90fa('0x11c')],_0x90fa('0xb4'),_0x518614[_0x90fa('0x24')],_0x90fa('0xa4'),_0x518614[_0x90fa('0x28')]);this[_0x90fa('0x95')](_0x7340f9,_0x7340f9[_0x90fa('0x9e')],_0x7340f9[_0x90fa('0x11c')]);}}};Preview[_0x90fa('0xb')][_0x90fa('0x1b')]=function(_0x3e0335){if(this[_0x90fa('0x64')][_0x3e0335[_0x90fa('0xd1')]]&&_0x3e0335[_0x90fa('0xd1')]!==_0x3e0335[_0x90fa('0x122')]){this[_0x90fa('0x95')](_0x3e0335,_0x3e0335[_0x90fa('0xd1')],_0x3e0335[_0x90fa('0x123')]);}};Preview[_0x90fa('0xb')][_0x90fa('0x19')]=function(_0x46d1b0){if(this[_0x90fa('0x64')][_0x46d1b0[_0x90fa('0x9e')]]&&_0x46d1b0[_0x90fa('0x9e')]!==_0x46d1b0[_0x90fa('0xa3')]&&!this['actions'][_0x46d1b0[_0x90fa('0x9e')]][_0x90fa('0x69')]){if(_0x46d1b0[_0x90fa('0x11c')]==='1'){this['callProgressDetectingCustomer'](_0x46d1b0,_0x46d1b0[_0x90fa('0x9e')],_0x46d1b0[_0x90fa('0x11c')]);}}};Preview[_0x90fa('0xb')][_0x90fa('0x124')]=function(_0x38f08a,_0x32f77d,_0x4cc77b){if(this[_0x90fa('0x64')][_0x38f08a]){if(_[_0x90fa('0x7c')](this[_0x90fa('0x64')][_0x38f08a]['variables'])){this[_0x90fa('0x64')][_0x38f08a]['variables']={};}this['actions'][_0x38f08a][_0x90fa('0x125')][_0x32f77d]=_0x4cc77b;}};Preview[_0x90fa('0xb')][_0x90fa('0x126')]=function(_0x55acd3){try{if(!_[_0x90fa('0x7c')](_0x55acd3)){if(ut[_0x90fa('0x127')](_['keys'](_0x55acd3[_0x90fa('0x128')])[0x0])){this[_0x90fa('0x124')](_0x55acd3[_0x90fa('0xa3')],_[_0x90fa('0x129')](_0x55acd3[_0x90fa('0x128')])[0x0],_0x55acd3[_0x90fa('0x12a')]);}}}catch(_0x17c60d){logger[_0x90fa('0x12b')]('[syncVarSet][Preview]',util[_0x90fa('0x12c')](_0x17c60d,{'showHidden':![],'depth':null}));}};Preview[_0x90fa('0xb')][_0x90fa('0x12d')]=function(_0x54120c){if(_0x54120c){if(this['actions'][_0x54120c[_0x90fa('0x12e')]]){this[_0x90fa('0x64')][_0x54120c[_0x90fa('0x12e')]][_0x90fa('0x120')]=!![];}}};Preview[_0x90fa('0xb')]['syncBlindTransfer']=function(_0x4fbed5){if(_0x4fbed5){if(this[_0x90fa('0x64')][_0x4fbed5[_0x90fa('0x12f')]]){this[_0x90fa('0x64')][_0x4fbed5[_0x90fa('0x12f')]][_0x90fa('0x120')]=!![];}}};module['exports']=Preview; \ No newline at end of file +var _0x6e09=['custom:agentcomplete','complete','total','decrementTalkink','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','talktime','sumBillable','[syncHangup][talking][decrement]','BUSY','countbusyretry','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','rescheduleContact','scheduledAt','dialBusyRetryFrequency','unlockAgent','activeContact','NOANSWER','countnoanswerretry','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','countcongestionretry','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','AgentReject','disableContact','idContact','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logBusy]','AnswerAGI','[callProgressDetectingAgent][logCongestion]','checkInBlack','Contact','phone','lookAgent','isEmpty','execCall','[Preview][execCall][success]','\x20IdHopper:\x20','custom:agentcalled','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','active','SIP/%s','reachable','unmonitored','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','Agent','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','SIP/%s/%s%s','trim','substring','dialCutDigit','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','addVariables','merge','toLowerVariables','starttime','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','isFailure','response','rejected','Answer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','dialstatus','variables','syncVarSet','filterKey','addVariable','keys','variable','value','error','[syncVarSet][Preview]','syncAttendedTransfer','transfererlinkedid','exports','util','bluebird','uuid','moment','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','attendedtransfer','blindtransfer','loopCampaigns','emit','type','outbound','answered','pTalking','sumDuration','sumHoldTime','talking','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','callerid','Interval','name','stringify','md5','voice:queue:%s','voice_queue:save','sendMessageOneNotActive','paused','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20disactive','syncCampaigns','hasOwnProperty','booked','clearZombieChannels','setMessage','clearZombieChannel','enqueue','isNil','info','[clearZombieChannels][talking]','Queue','queue','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[action]','size','recallMe','getContactRecallMe','agentReadyId','then','length','getDiff','dialRecallMeTimeout','run','logger2','[RecallMe]','format','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','IsNotLoggedIn','loggedIn','AGENTS_NOT_LOGGED','isActive','NOT_ACTIVE','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','linkedid','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','buildObj','connect','acw','custom:agentConnectPreview','buildAcw'];(function(_0x5396d7,_0x516b21){var _0x3055ac=function(_0x711ce1){while(--_0x711ce1){_0x5396d7['push'](_0x5396d7['shift']());}};_0x3055ac(++_0x516b21);}(_0x6e09,0x85));var _0x96e0=function(_0x3d8995,_0x5f4f4b){_0x3d8995=_0x3d8995-0x0;var _0x5dd8ed=_0x6e09[_0x3d8995];return _0x5dd8ed;};'use strict';var util=require(_0x96e0('0x0'));var _=require('lodash');var BPromise=require(_0x96e0('0x1'));var uuid=require(_0x96e0('0x2'));var moment=require(_0x96e0('0x3'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x96e0('0x4'));var logger=require(_0x96e0('0x5'))(_0x96e0('0x6'));var loggerAction=require(_0x96e0('0x5'))(_0x96e0('0x7'));var ami=require(_0x96e0('0x8'));var rpcDb=require(_0x96e0('0x9'));var Action=require(_0x96e0('0xa'));var ut=require(_0x96e0('0xb'));config[_0x96e0('0xc')]=_[_0x96e0('0xd')](config[_0x96e0('0xc')],{'host':_0x96e0('0xe'),'port':0x18eb});var io=require(_0x96e0('0xf'))(new Redis(config[_0x96e0('0xc')]));var Sequence=function(){};Sequence[_0x96e0('0x10')]['enqueue']=function(_0x2e4ab9){this['tail']=this[_0x96e0('0x11')]?this[_0x96e0('0x11')][_0x96e0('0x12')](_0x2e4ab9):_0x2e4ab9();};function Preview(_0x4efff9){this[_0x96e0('0x13')]=new Sequence();this[_0x96e0('0x14')]=_0x4efff9[_0x96e0('0x15')];this[_0x96e0('0x16')]=_0x4efff9[_0x96e0('0x16')];this[_0x96e0('0x17')]={};this[_0x96e0('0x18')]=_0x4efff9[_0x96e0('0x18')];this[_0x96e0('0x19')]=0x0;ami['on']('originateresponse',this[_0x96e0('0x1a')][_0x96e0('0x1b')](this));ami['on'](_0x96e0('0x1c'),this[_0x96e0('0x1d')][_0x96e0('0x1b')](this));ami['on'](_0x96e0('0x1e'),this[_0x96e0('0x1f')]['bind'](this));ami['on'](_0x96e0('0x20'),this[_0x96e0('0x21')][_0x96e0('0x1b')](this));ami['on'](_0x96e0('0x22'),this[_0x96e0('0x23')][_0x96e0('0x1b')](this));ami['on'](_0x96e0('0x24'),this['syncVarSet'][_0x96e0('0x1b')](this));ami['on'](_0x96e0('0x25'),this['syncAttendedTransfer'][_0x96e0('0x1b')](this));ami['on'](_0x96e0('0x26'),this['syncBlindTransfer'][_0x96e0('0x1b')](this));this[_0x96e0('0x27')](this['campaignsPreview']);}function emit(_0x551faa,_0x4e94b5,_0x440ee6){io['to'](_0x551faa)[_0x96e0('0x28')](_0x4e94b5,_0x440ee6);}function emitCampaignPreview(_0x322e01){if(_0x322e01[_0x96e0('0x29')]===_0x96e0('0x2a')){var _0x154f0c={'id':_0x322e01['id'],'name':_0x322e01['name'],'strategy':_0x322e01['strategy'],'answered':_0x322e01[_0x96e0('0x2b')],'available':_0x322e01['available'],'loggedIn':_0x322e01['loggedIn'],'pTalking':_0x322e01[_0x96e0('0x2c')],'sumBillable':_0x322e01['sumBillable'],'sumDuration':_0x322e01[_0x96e0('0x2d')],'sumHoldTime':_0x322e01[_0x96e0('0x2e')]||0x0,'talking':_0x322e01[_0x96e0('0x2f')],'total':_0x322e01['total'],'type':_0x322e01[_0x96e0('0x29')],'unmanaged':_0x322e01[_0x96e0('0x30')],'abandoned':_0x322e01[_0x96e0('0x31')],'waiting':_0x322e01[_0x96e0('0x32')],'loggedInDb':_0x322e01[_0x96e0('0x33')],'dialActive':_0x322e01[_0x96e0('0x34')],'dialMethod':_0x322e01[_0x96e0('0x35')],'dialOriginateCallerIdName':_0x322e01[_0x96e0('0x36')],'dialOriginateCallerIdNumber':_0x322e01['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x322e01['dialOriginateTimeout'],'dialPrefix':_0x322e01[_0x96e0('0x37')],'outboundAnswerAgiCallsDay':_0x322e01[_0x96e0('0x38')],'outboundAnswerCallsDay':_0x322e01['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x322e01[_0x96e0('0x39')],'outboundBusyCallsDay':_0x322e01[_0x96e0('0x3a')],'outboundCongestionCallsDay':_0x322e01[_0x96e0('0x3b')],'outboundDropCallsDayACS':_0x322e01[_0x96e0('0x3c')],'outboundDropCallsDayCallersExit':_0x322e01[_0x96e0('0x3d')],'outboundDropCallsDayTimeout':_0x322e01['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x322e01[_0x96e0('0x3e')],'outboundNoSuchCallsDay':_0x322e01[_0x96e0('0x3f')],'outboundOriginateFailureCallsDay':_0x322e01[_0x96e0('0x40')],'outboundReCallsDay':_0x322e01[_0x96e0('0x41')],'outboundRejectCallsDay':_0x322e01[_0x96e0('0x42')],'outboundUnknownCallsDay':_0x322e01[_0x96e0('0x43')],'predictiveIntervalAnsweredCalls':_0x322e01[_0x96e0('0x44')],'predictiveIntervalAvgHoldtime':_0x322e01[_0x96e0('0x45')],'predictiveIntervalAvgTalktime':_0x322e01['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x322e01[_0x96e0('0x46')],'predictiveIntervalDroppedCallsTimeout':_0x322e01[_0x96e0('0x47')],'predictiveIntervalErlangCalls':_0x322e01['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x322e01[_0x96e0('0x48')],'predictiveIntervalHitRate':_0x322e01['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x322e01[_0x96e0('0x49')],'predictiveIntervalPauses':_0x322e01[_0x96e0('0x4a')],'predictiveIntervalAvailable':_0x322e01[_0x96e0('0x4b')],'predictiveIntervalTotalCalls':_0x322e01[_0x96e0('0x4c')],'message':_0x322e01[_0x96e0('0x4d')],'originated':_0x322e01[_0x96e0('0x4e')],'erlangCalls':_0x322e01[_0x96e0('0x4f')],'erlangCallToSecond':_0x322e01[_0x96e0('0x50')],'erlangAbandonmentRate':_0x322e01[_0x96e0('0x51')],'erlangBusyFactor':_0x322e01[_0x96e0('0x52')],'startPredictive':_0x322e01['startPredictive'],'startProgressive':_0x322e01[_0x96e0('0x53')]};if(_0x322e01[_0x96e0('0x54')]){_0x154f0c['Trunk']={'id':_0x322e01[_0x96e0('0x54')]['id'],'name':_0x322e01['Trunk']['name'],'active':_0x322e01[_0x96e0('0x54')]['active'],'callerid':_0x322e01[_0x96e0('0x54')][_0x96e0('0x55')]};}if(_0x322e01[_0x96e0('0x56')]){_0x154f0c['Interval']={'id':_0x322e01[_0x96e0('0x56')]['id'],'name':_0x322e01[_0x96e0('0x56')][_0x96e0('0x57')]};}var _0x51c6d3=md5(JSON[_0x96e0('0x58')](_0x154f0c));if(_0x322e01[_0x96e0('0x59')]!==_0x51c6d3){_0x322e01['md5']=_0x51c6d3;emit(util['format'](_0x96e0('0x5a'),_0x154f0c[_0x96e0('0x57')]),_0x96e0('0x5b'),_0x154f0c);}}}function emitVoiceQueueChannelRemove(_0x5b2e5f){emit(util['format']('voice:queue:%s',_0x5b2e5f[_0x96e0('0x57')]),'voice_queue_channel:remove',_0x5b2e5f);}function notSendMessagesQueue(_0x27426a){if(_0x27426a[_0x96e0('0x5c')]){if(_0x27426a[_0x96e0('0x4e')]===0x0&&_0x27426a['pTalking']===0x0){_0x27426a[_0x96e0('0x5c')]=![];_0x27426a['available']=0x0;_0x27426a[_0x96e0('0x5d')]=0x0;_0x27426a[_0x96e0('0x4d')]='NOT_ACTIVE';ut[_0x96e0('0x5e')](_0x96e0('0x5f'),_0x27426a['name']+_0x96e0('0x60'));}else{_0x27426a[_0x96e0('0x4d')]='IS_DISACTIVED';ut[_0x96e0('0x5e')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x27426a[_0x96e0('0x57')]+_0x96e0('0x61'));}emitCampaignPreview(_0x27426a);}}Preview[_0x96e0('0x10')]['loopCampaigns']=function(){var _0x5a6fca=this;setInterval(function(){_0x5a6fca[_0x96e0('0x62')]();},0x7cf);};Preview[_0x96e0('0x10')][_0x96e0('0x62')]=function(){var _0x347d23=this[_0x96e0('0x14')];this['clockClearZombieChannels']+=0x1;for(var _0x940001 in _0x347d23){if(_0x347d23[_0x96e0('0x63')](_0x940001)&&(_0x347d23[_0x940001][_0x96e0('0x35')]===_0x96e0('0x6')||_0x347d23[_0x940001]['dialMethod']===_0x96e0('0x64'))&&_0x347d23[_0x940001][_0x96e0('0x29')]===_0x96e0('0x2a')){if(this[_0x96e0('0x19')]>0x7){this[_0x96e0('0x19')]=0x0;this[_0x96e0('0x65')]();}}if(_0x347d23[_0x96e0('0x63')](_0x940001)&&_0x347d23[_0x940001]['dialMethod']===_0x96e0('0x6')&&_0x347d23[_0x940001][_0x96e0('0x29')]===_0x96e0('0x2a')){if(_0x347d23[_0x940001]['dialActive']){this[_0x96e0('0x66')](_0x347d23[_0x940001]);this['recallMe'](_0x347d23[_0x940001]);}else{notSendMessagesQueue(_0x347d23[_0x940001]);}}}};Preview['prototype'][_0x96e0('0x67')]=function(_0x2c2248){var _0x4b2dd6=this;this[_0x96e0('0x13')][_0x96e0('0x68')](function(){if(!_[_0x96e0('0x69')](_0x4b2dd6['actions'][_0x2c2248])){loggerAction[_0x96e0('0x6a')](_0x96e0('0x6b'),_0x2c2248,_0x96e0('0x6c'),_0x4b2dd6[_0x96e0('0x17')][_0x2c2248][_0x96e0('0x6d')],'originated:\x20',JSON[_0x96e0('0x58')](_0x4b2dd6[_0x96e0('0x14')][_0x4b2dd6[_0x96e0('0x17')][_0x2c2248][_0x96e0('0x6d')]][_0x96e0('0x4e')]),_0x96e0('0x6e'),JSON[_0x96e0('0x58')](_0x4b2dd6[_0x96e0('0x14')][_0x4b2dd6[_0x96e0('0x17')][_0x2c2248]['queue']][_0x96e0('0x2c')]),JSON[_0x96e0('0x58')](_0x4b2dd6[_0x96e0('0x17')][_0x2c2248][_0x96e0('0x6f')]),JSON[_0x96e0('0x58')](_[_0x96e0('0x70')](_0x4b2dd6[_0x96e0('0x17')][_0x2c2248],[_0x96e0('0x71'),_0x96e0('0x72'),_0x96e0('0x73'),_0x96e0('0x74')])));return ami['Action']({'action':_0x96e0('0x75'),'channel':_0x4b2dd6[_0x96e0('0x17')][_0x2c2248][_0x96e0('0x76')]})[_0x96e0('0x77')](function(_0x25c96a){if(_0x25c96a['message']===_0x96e0('0x78')){setTimeout(function(){if(_0x4b2dd6[_0x96e0('0x17')][_0x2c2248]){ut[_0x96e0('0x79')](_0x4b2dd6[_0x96e0('0x14')][_0x4b2dd6['actions'][_0x2c2248][_0x96e0('0x6d')]],_0x96e0('0x7a'));if(_0x4b2dd6[_0x96e0('0x17')][_0x2c2248][_0x96e0('0x6f')]===!![]){ut['decrementTalkink'](_0x4b2dd6[_0x96e0('0x14')][_0x4b2dd6[_0x96e0('0x17')][_0x2c2248]['queue']],_0x96e0('0x7a'));ut[_0x96e0('0x7b')](_0x96e0('0x7c')+_0x2c2248,_0x4b2dd6[_0x96e0('0x17')][_0x2c2248][_0x96e0('0x6d')]);}ut[_0x96e0('0x7b')]('[Dialer][checkChannel][Preview]'+_0x2c2248,_0x4b2dd6[_0x96e0('0x17')][_0x2c2248][_0x96e0('0x6d')]);delete _0x4b2dd6[_0x96e0('0x17')][_0x2c2248];}},0x2328);}});}});};Preview[_0x96e0('0x10')]['clearZombieChannels']=function(){var _0x1a1fcf=this;loggerAction['info'](_0x96e0('0x7d'),_[_0x96e0('0x7e')](this[_0x96e0('0x17')]));for(var _0x197f2c in this['actions']){if(_0x1a1fcf[_0x96e0('0x17')][_0x96e0('0x63')](_0x197f2c)){_0x1a1fcf[_0x96e0('0x67')](_0x197f2c);}}};Preview[_0x96e0('0x10')][_0x96e0('0x7f')]=function(_0x184501){var _0x3d500b=this;rpcDb[_0x96e0('0x80')](_0x184501['id'],ut[_0x96e0('0x81')](this[_0x96e0('0x18')]))[_0x96e0('0x82')](function(_0x49fade){if(!_[_0x96e0('0x69')](_0x49fade)){for(var _0x3be1dd=0x0;_0x3be1dd<_0x49fade[_0x96e0('0x83')];_0x3be1dd+=0x1){if(ut[_0x96e0('0x84')](_0x49fade[_0x3be1dd]['scheduledat'])<_0x184501[_0x96e0('0x85')]*0x3c){_0x3d500b[_0x96e0('0x86')](_0x49fade[_0x3be1dd]['id'])[_0x96e0('0x82')](ut[_0x96e0('0x87')](_0x96e0('0x88')))['catch'](ut[_0x96e0('0x87')](_0x96e0('0x88')));}else{var _0x44cada=new Action(_0x49fade[_0x3be1dd],_0x184501);_0x44cada['starttime']=moment()[_0x96e0('0x89')](_0x96e0('0x8a'));_0x184501['outboundReCallsDay']+=0x1;ut[_0x96e0('0x8b')](_0x44cada,0x17,_0x96e0('0x8c'));if(_0x184501['dialRecallInQueue']){rpcDb[_0x96e0('0x8d')](ut[_0x96e0('0x8e')](_0x49fade[_0x3be1dd]));rpcDb[_0x96e0('0x8f')](_0x44cada,_0x96e0('0x90'));}else{ut[_0x96e0('0x8b')](_0x44cada,0x16,_0x96e0('0x91'));rpcDb[_0x96e0('0x8f')](_0x44cada,_0x96e0('0x92'));rpcDb[_0x96e0('0x93')](_0x44cada,_0x96e0('0x92'));}}}}})[_0x96e0('0x77')](ut['logger2']('[getContactRecallMe]'));};Preview[_0x96e0('0x10')][_0x96e0('0x66')]=function(_0xd4641){_0xd4641[_0x96e0('0x5c')]=!![];if(ut[_0x96e0('0x94')](_0xd4641[_0x96e0('0x95')])){_0xd4641[_0x96e0('0x4d')]=_0x96e0('0x96');}else if(!ut[_0x96e0('0x97')](_0xd4641[_0x96e0('0x34')])){_0xd4641[_0x96e0('0x4d')]=_0x96e0('0x98');}else if(!this[_0x96e0('0x99')](_0xd4641[_0x96e0('0x54')])){if(!this[_0x96e0('0x99')](_0xd4641[_0x96e0('0x9a')])){_0xd4641['message']='TRUNK_IS_NOT_REACHABLE';}else{_0xd4641[_0x96e0('0x4d')]=_0x96e0('0x9b');}}else{_0xd4641[_0x96e0('0x4d')]='ACTIVE';}emitCampaignPreview(_0xd4641);};Preview[_0x96e0('0x10')][_0x96e0('0x9c')]=function(_0x4de4c9,_0x10dbed,_0x2dea07){var _0x419018=this;var _0x551468=this[_0x96e0('0x17')][_0x10dbed];var _0x3bd9d7=this[_0x96e0('0x14')][_0x551468[_0x96e0('0x6d')]];var _0x1b00e9;if(_0x3bd9d7){switch(_0x2dea07){case'1':_0x3bd9d7[_0x96e0('0x3f')]+=0x1;_0x551468[_0x96e0('0x9d')]=ut[_0x96e0('0x9e')](_0x551468);ut[_0x96e0('0x8b')](_0x551468,0x0,'NoSuchNumber');rpcDb['createCustomerHistory'](_0x551468,_0x96e0('0x9f'));if(ut[_0x96e0('0x9e')](_0x551468)>=_0x3bd9d7[_0x96e0('0xa0')]){_0x1b00e9=ut[_0x96e0('0xa1')](_0x551468,0xf,_0x96e0('0xa2'));rpcDb['createCustomerFinal'](_0x1b00e9,_0x96e0('0xa3'));}else{rpcDb[_0x96e0('0x93')](_0x551468,'[callProgressDetectingCustomer][logNoSuchGlobal]');}delete this[_0x96e0('0x17')][_0x4de4c9[_0x96e0('0xa4')]];break;case'ANSWER':var _0x69ca5b=moment()['format'](_0x96e0('0x8a'));_0x551468[_0x96e0('0xa5')]=_0x69ca5b;_0x551468[_0x96e0('0xa6')]=_0x69ca5b;_0x551468[_0x96e0('0x6f')]=!![];_0x3bd9d7[_0x96e0('0x2c')]+=0x1;logger[_0x96e0('0x6a')](_0x96e0('0xa7'),_0x551468[_0x96e0('0xa8')],_0x96e0('0xa9'),_0x3bd9d7['name'],_0x96e0('0x6e'),_0x3bd9d7[_0x96e0('0x2c')]);ami[_0x96e0('0x28')](_0x96e0('0xaa'),ut[_0x96e0('0xab')](_0x551468,_0x96e0('0xac')));if(_0x3bd9d7[_0x96e0('0xad')]){ami[_0x96e0('0x28')](_0x96e0('0xae'),ut[_0x96e0('0xaf')](_0x551468));}break;case'16':ami[_0x96e0('0x28')](_0x96e0('0xb0'),ut[_0x96e0('0xab')](_0x551468,_0x96e0('0xb1')));emitVoiceQueueChannelRemove(ut['buildObj'](_0x551468,'complete'));_0x3bd9d7['outboundAnswerCallsDay']+=0x1;_0x3bd9d7[_0x96e0('0xb2')]+=0x1;_0x3bd9d7[_0x96e0('0x2b')]+=0x1;ut[_0x96e0('0xb3')](_0x3bd9d7,'[16]');_0x551468[_0x96e0('0x9d')]=ut[_0x96e0('0x9e')](_0x551468);ut['logCustomer'](_0x551468,0x4,'Answer');rpcDb[_0x96e0('0x8f')](_0x551468,_0x96e0('0xb4'));rpcDb['createCustomerFinal'](_0x551468,_0x96e0('0xb5'));rpcDb['crateCustomerReportQueue'](_0x551468);_0x3bd9d7[_0x96e0('0x2d')]+=_0x551468[_0x96e0('0xb6')];_0x3bd9d7[_0x96e0('0xb7')]+=_0x551468[_0x96e0('0xb6')];logger[_0x96e0('0x6a')](_0x96e0('0xb8'),_0x551468[_0x96e0('0xa8')],'\x20Queue',_0x3bd9d7['name'],_0x96e0('0x6e'),_0x3bd9d7[_0x96e0('0x2c')]);delete this[_0x96e0('0x17')][_0x4de4c9[_0x96e0('0xa4')]];break;case _0x96e0('0xb9'):_0x3bd9d7[_0x96e0('0x3a')]+=0x1;_0x551468[_0x96e0('0xba')]+=0x1;_0x551468[_0x96e0('0x9d')]=ut[_0x96e0('0x9e')](_0x551468);ut['logCustomer'](_0x551468,0x5,'Busy');rpcDb[_0x96e0('0x8f')](_0x551468,'[callProgressDetectingCustomer][logBusy]');if(ut['totalGlobal'](_0x551468)>=_0x3bd9d7['dialGlobalMaxRetry']){_0x1b00e9=ut[_0x96e0('0xa1')](_0x551468,0xf,_0x96e0('0xa2'));rpcDb[_0x96e0('0x93')](_0x1b00e9,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x551468[_0x96e0('0xba')]>=_0x3bd9d7[_0x96e0('0xbb')]){rpcDb['createCustomerFinal'](_0x551468,_0x96e0('0xbc'));}else{rpcDb[_0x96e0('0xbd')](ut[_0x96e0('0xbe')](_0x551468,_0x96e0('0xba'),_0x3bd9d7[_0x96e0('0xbf')]),_0x551468[_0x96e0('0xc0')],_0x551468[_0x96e0('0xc1')]);}}break;case _0x96e0('0xc2'):_0x3bd9d7[_0x96e0('0x3e')]+=0x1;_0x551468[_0x96e0('0xc3')]+=0x1;_0x551468[_0x96e0('0x9d')]=ut['totalGlobal'](_0x551468);ut['logCustomer'](_0x551468,0x3,'NoAnswer');rpcDb[_0x96e0('0x8f')](_0x551468,_0x96e0('0xc4'));if(ut[_0x96e0('0x9e')](_0x551468)>=_0x3bd9d7[_0x96e0('0xa0')]){_0x1b00e9=ut[_0x96e0('0xa1')](_0x551468,0xf,_0x96e0('0xa2'));rpcDb['createCustomerFinal'](_0x1b00e9,_0x96e0('0xc5'));}else{if(_0x551468[_0x96e0('0xc3')]>=_0x3bd9d7[_0x96e0('0xc6')]){rpcDb['createCustomerFinal'](_0x551468,_0x96e0('0xc4'));}else{rpcDb[_0x96e0('0xbd')](ut[_0x96e0('0xbe')](_0x551468,_0x96e0('0xc3'),_0x3bd9d7[_0x96e0('0xc7')]),_0x551468[_0x96e0('0xc0')],_0x551468[_0x96e0('0xc1')]);}}break;case'CONGESTION':_0x3bd9d7[_0x96e0('0x3b')]+=0x1;_0x551468[_0x96e0('0xc8')]+=0x1;_0x551468[_0x96e0('0x9d')]=ut[_0x96e0('0x9e')](_0x551468);ut[_0x96e0('0x8b')](_0x551468,0x8,'Congestion');rpcDb[_0x96e0('0x8f')](_0x551468,_0x96e0('0xc9'));if(ut[_0x96e0('0x9e')](_0x551468)>=_0x3bd9d7[_0x96e0('0xa0')]){_0x1b00e9=ut[_0x96e0('0xa1')](_0x551468,0xf,_0x96e0('0xa2'));rpcDb[_0x96e0('0x93')](_0x1b00e9,_0x96e0('0xca'));}else{if(_0x551468['countcongestionretry']>=_0x3bd9d7[_0x96e0('0xcb')]){rpcDb['createCustomerFinal'](_0x551468,_0x96e0('0xc9'));}else{rpcDb[_0x96e0('0xbd')](ut[_0x96e0('0xbe')](_0x551468,'countcongestionretry',_0x3bd9d7[_0x96e0('0xbf')]),_0x551468[_0x96e0('0xc0')],_0x551468[_0x96e0('0xc1')]);}}break;case _0x96e0('0xcc'):_0x3bd9d7[_0x96e0('0x42')]+=0x1;_0x551468[_0x96e0('0x9d')]=ut[_0x96e0('0x9e')](_0x551468);ut[_0x96e0('0x8b')](_0x551468,0x14,_0x96e0('0xcd'));rpcDb[_0x96e0('0x8f')](_0x551468,'[syncHangupRequest][logAgentReject]');if(_0x551468[_0x96e0('0xc0')]){rpcDb['unlockContact'](_0x551468['idContact']);}if(_0x551468['activeContact']){rpcDb[_0x96e0('0xce')](_0x551468[_0x96e0('0xcf')]);}break;default:if(_0x551468[_0x96e0('0x6f')]){ut[_0x96e0('0xb3')](_0x3bd9d7,'[default]');ut[_0x96e0('0x7b')](_0x96e0('0xd0')+_0x3bd9d7[_0x96e0('0x57')],_0x4de4c9);}_0x3bd9d7['outboundUnknownCallsDay']+=0x1;_0x551468[_0x96e0('0x9d')]=ut[_0x96e0('0x9e')](_0x551468);ut[_0x96e0('0x8b')](_0x551468,0xc,_0x4de4c9['cause-txt']||_0x4de4c9['dialstatus']);rpcDb[_0x96e0('0x8f')](_0x551468,_0x96e0('0xd1'));if(ut['totalGlobal'](_0x551468)>=_0x3bd9d7['dialGlobalMaxRetry']){_0x1b00e9=ut['cloneAction'](_0x551468,0xf,_0x96e0('0xa2'));rpcDb[_0x96e0('0x93')](_0x1b00e9,_0x96e0('0xd2'));}else{rpcDb[_0x96e0('0x93')](_0x551468,_0x96e0('0xd2'));}delete this[_0x96e0('0x17')][_0x4de4c9[_0x96e0('0xa4')]];}if(!(_0x551468[_0x96e0('0x6f')]&&_0x2dea07==='16')){ut[_0x96e0('0x79')](_0x3bd9d7,_0x96e0('0xd3'));logger['info']('[originated][decrement][callProgressDetectingCustomer]',_0x551468[_0x96e0('0xa8')],'\x20Queue',_0x3bd9d7[_0x96e0('0x57')],'originated:\x20',_0x3bd9d7[_0x96e0('0x4e')]);}if(_0x2dea07!=='ANSWER'){delete this['actions'][_0x4de4c9[_0x96e0('0xa4')]];delete this[_0x96e0('0x17')][_0x4de4c9[_0x96e0('0xd4')]];}}};Preview[_0x96e0('0x10')][_0x96e0('0xd5')]=function(_0x48ecb9,_0x5b425a,_0x41a6e3){if(_[_0x96e0('0xd6')](_0x5b425a)&&_0x96e0('0xd7')!==typeof _0x5b425a){return;}if(_[_0x96e0('0xd6')](_0x41a6e3)&&_0x96e0('0xd7')!==typeof _0x41a6e3){return;}switch(_0x41a6e3[_0x96e0('0xd8')]){case'0':ut[_0x96e0('0xd9')](_0x48ecb9,0x0,'NoSuchNumber');rpcDb['createAgentHistory'](_0x48ecb9,_0x96e0('0xda'));break;case'3':ut[_0x96e0('0xd9')](_0x48ecb9,0x3,_0x96e0('0xdb'));rpcDb[_0x96e0('0xdc')](_0x48ecb9,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0x96e0('0xd9')](_0x48ecb9,0x5,'Busy');rpcDb['createAgentHistory'](_0x48ecb9,_0x96e0('0xdd'));break;case'8':ut['logAgent'](_0x48ecb9,0x8,'Congestion');rpcDb[_0x96e0('0xdc')](_0x48ecb9,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x96e0('0xd9')](_0x48ecb9,0x16,_0x96e0('0xde'));rpcDb['createAgentHistory'](_0x48ecb9,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut['logAgent'](_0x48ecb9,0xc,_0x41a6e3['reason']);rpcDb['createAgentHistory'](_0x48ecb9,_0x96e0('0xdf'));}ut[_0x96e0('0x79')](_0x5b425a,'[callProgressDetectingAgent]');logger[_0x96e0('0x6a')]('[originated][decrement][callProgressDetectingAgent]',_0x48ecb9[_0x96e0('0xa8')],_0x96e0('0xa9'),_0x5b425a['name'],'originated:\x20',_0x5b425a[_0x96e0('0x4e')]);delete this[_0x96e0('0x17')][_0x48ecb9[_0x96e0('0xa8')]];};Preview[_0x96e0('0x10')][_0x96e0('0xe0')]=function(_0x4cdd71,_0x2f9f73,_0x40cf0f,_0xb6dd27,_0x5556f1){var _0x1de464=this;return new BPromise(function(_0x241210,_0x238fcc){if(_[_0x96e0('0x69')](_0x2f9f73)||_[_0x96e0('0x69')](_0x2f9f73['Contact'])||_['isNil'](_0x2f9f73[_0x96e0('0xe1')][_0x96e0('0xe2')])||_[_0x96e0('0x69')](_0x2f9f73[_0x96e0('0x73')])){_0x238fcc(ut['message']('Contact\x20is\x20undefined',_0xb6dd27,_0x5556f1));return;}var _0xe96567=uuid['v4']();var _0x3ccb2f=_0x1de464[_0x96e0('0x14')][_0x2f9f73['Queue'][_0x96e0('0x57')]];var _0x914feb=_0x40cf0f?_0x1de464[_0x96e0('0x18')][_0x40cf0f]['id']:undefined;_0x1de464['actions'][_0xe96567]=new Action(_0x2f9f73,_0x3ccb2f,_0xe96567,_0x40cf0f,_0x914feb);var _0xb64c06=_0x1de464[_0x96e0('0x17')][_0xe96567];_0xb64c06[_0x96e0('0xc0')]=_0xb6dd27;_0xb64c06[_0x96e0('0xc1')]=_0x5556f1;_0xb64c06[_0x96e0('0xe3')]=_0x40cf0f;if(_[_0x96e0('0xe4')](_0x4cdd71)){_0x1de464[_0x96e0('0xe5')](_0xb64c06,_0x3ccb2f,_0x2f9f73,_0x40cf0f)[_0x96e0('0x82')](function(_0x1e57f4){logger['info'](_0x96e0('0xe6'),'Queue:\x20'+_0xb64c06['queue']+_0x96e0('0xe7')+_0xb64c06[_0x96e0('0xcf')],JSON[_0x96e0('0x58')](_0x1e57f4));ami['emit'](_0x96e0('0xe8'),ut[_0x96e0('0xab')](_0xb64c06,'called'));_0x241210(ut['message']('Calling'));})[_0x96e0('0x77')](function(_0x210fbf){ut[_0x96e0('0x5e')](_0x96e0('0xe9'),_0x210fbf);_0x238fcc(ut[_0x96e0('0x4d')](_0x96e0('0xea'),_0xb6dd27,_0x5556f1));});}else{_0x3ccb2f[_0x96e0('0x39')]+=0x1;ut[_0x96e0('0xeb')](_0xb64c06);rpcDb[_0x96e0('0xec')](_0xb64c06,_0x96e0('0xed'));delete _0x1de464[_0x96e0('0x17')][_0xe96567];_0x238fcc(ut[_0x96e0('0x4d')]('Contact\x20in\x20black\x20List',_0xb6dd27,_0x5556f1));}});};Preview[_0x96e0('0x10')][_0x96e0('0x99')]=function(_0x4c5c55){return!_[_0x96e0('0x69')](_0x4c5c55)&&!_[_0x96e0('0x69')](_0x4c5c55[_0x96e0('0x57')])&&!_['isNil'](_0x4c5c55['active'])&&_0x4c5c55[_0x96e0('0xee')]&&!_[_0x96e0('0x69')](this[_0x96e0('0x16')][util[_0x96e0('0x89')](_0x96e0('0xef'),_0x4c5c55['name'])])&&!_['isNil'](this['trunks'][util['format'](_0x96e0('0xef'),_0x4c5c55[_0x96e0('0x57')])][_0x96e0('0x75')])&&(this[_0x96e0('0x16')][util['format']('SIP/%s',_0x4c5c55[_0x96e0('0x57')])]['status']===_0x96e0('0xf0')||this[_0x96e0('0x16')][util[_0x96e0('0x89')](_0x96e0('0xef'),_0x4c5c55[_0x96e0('0x57')])][_0x96e0('0x75')]===_0x96e0('0xf1'));};Preview[_0x96e0('0x10')]['run']=function(_0x4aaa0d,_0x2cbd58){var _0x1984dc=this;return new BPromise(function(_0x4faba5,_0x2f5ce0){_0x1984dc[_0x96e0('0xf2')](_0x4aaa0d,_0x2cbd58)[_0x96e0('0x82')](function(_0x43ed1d){_0x4faba5(_[_0x96e0('0x70')](_0x43ed1d,[_0x96e0('0x4d')]));})['catch'](function(_0x59df8a){if(_0x59df8a[_0x96e0('0xf3')]){rpcDb[_0x96e0('0xf4')](_0x4aaa0d);}if(_0x59df8a[_0x96e0('0xee')]){rpcDb[_0x96e0('0xce')](_0x4aaa0d);}_0x2f5ce0(_['pick'](_0x59df8a,['message']));});});};Preview[_0x96e0('0x10')][_0x96e0('0xf2')]=function(_0x4c80b1,_0x523111){var _0x4e04f1=this;return new BPromise(function(_0x9e8689,_0x4b7956){var _0x15e3f5,_0x37a4b9;rpcDb[_0x96e0('0xf5')](_0x4c80b1)[_0x96e0('0x82')](function(_0xd0eccb){if(!_[_0x96e0('0x69')](_0xd0eccb[0x0])){_0x37a4b9=_0xd0eccb[0x0][_0x96e0('0xf6')]?![]:!![];_0x15e3f5=_0xd0eccb[0x0][_0x96e0('0xf6')]?!![]:![];_0x15e3f5=_0x523111?!![]:_0x15e3f5;}var _0x26a9d2=_0x4e04f1[_0x96e0('0xf7')](_0xd0eccb);if(_0x26a9d2[_0x96e0('0xf8')]){rpcDb[_0x96e0('0xf9')](_[_0x96e0('0x70')](_0xd0eccb[0x0],[_0x96e0('0x73'),_0x96e0('0xfa')]))[_0x96e0('0x82')](function(_0x3f5a58){_0x4e04f1[_0x96e0('0xe0')](_0x3f5a58,_0xd0eccb[0x0],_0x523111,_0x37a4b9,_0x15e3f5)[_0x96e0('0x82')](function(_0x2cad18){_0x9e8689(_0x2cad18);})[_0x96e0('0x77')](function(_0x2ebdf4){_0x4b7956(_0x2ebdf4);});})[_0x96e0('0x77')](function(_0x121407){ut[_0x96e0('0x5e')](_0x96e0('0xfb'),_0x121407);_0x4b7956(ut[_0x96e0('0x4d')](_0x96e0('0xfc'),_0x37a4b9,_0x15e3f5));});}else{_0x4b7956(ut['message'](_0x26a9d2[_0x96e0('0x4d')],_0x37a4b9,_0x15e3f5));}})[_0x96e0('0x77')](function(_0x4b4380){ut[_0x96e0('0x5e')]('[Preview][getContactPreview]',_0x4b4380);_0x4b7956(ut[_0x96e0('0x4d')]('Call\x20unsuccessful',![],!![]));});});};Preview['prototype']['validateContact']=function(_0x24b7f3){if(_[_0x96e0('0x69')](_0x24b7f3)||_[_0x96e0('0xe4')](_0x24b7f3)||!_[_0x96e0('0x69')](_0x24b7f3[0x0][_0x96e0('0xfd')])&&_[_0x96e0('0x69')](_0x24b7f3[0x0][_0x96e0('0xfd')][_0x96e0('0x57')])){ut[_0x96e0('0x5e')](_0x96e0('0xfe'),_0x24b7f3);return{'isValid':![],'message':_0x96e0('0xff')};}var _0x4ed320=this[_0x96e0('0x14')][_0x24b7f3[0x0][_0x96e0('0x6c')][_0x96e0('0x57')]];_0x4ed320['message']=_0x96e0('0x9b');if(_['isNil'](_0x4ed320)){ut['logger'](_0x96e0('0x100'),_0x4ed320);return{'isValid':![],'message':_0x96e0('0x101')};}if(!this['isTrunkReachable'](_0x4ed320['Trunk'])){ut[_0x96e0('0x5e')](_0x96e0('0x102'),_0x96e0('0x103')+_0x4ed320[_0x96e0('0x57')]+_0x96e0('0x104'));if(!this[_0x96e0('0x99')](_0x4ed320['TrunkBackup'])){ut[_0x96e0('0x5e')](_0x96e0('0x102'),_0x4ed320['name']+_0x96e0('0x105'));return{'isValid':![],'message':_0x96e0('0x106')};}}if(!ut[_0x96e0('0x97')](_0x4ed320[_0x96e0('0x34')])){ut[_0x96e0('0x5e')]('[Preview][validateContact][Campaign\x20Active]',_0x4ed320[_0x96e0('0x57')]+'\x20Not\x20Active');return{'isValid':![],'message':_0x96e0('0x103')+_0x4ed320['name']+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview['prototype'][_0x96e0('0xe5')]=function(_0xf30296,_0x566508,_0x543a55,_0x581b86){var _0x5b61a8=this;return new BPromise(function(_0x26c572,_0x2833b6){var _0x188cf1=_0xf30296[_0x96e0('0xa8')];var _0x540926=_0x5b61a8[_0x96e0('0x99')](_0x566508[_0x96e0('0x54')])?util[_0x96e0('0x89')](_0x96e0('0x107'),_0x566508['Trunk'][_0x96e0('0x57')],_[_0x96e0('0x69')](_0x566508[_0x96e0('0x37')])?'':_0x566508[_0x96e0('0x37')][_0x96e0('0x108')]()||'',_0x566508['dialCutDigit']>0x0?_0x543a55['Contact'][_0x96e0('0xe2')][_0x96e0('0x109')](_0x566508['dialCutDigit']):_0x543a55[_0x96e0('0xe1')][_0x96e0('0xe2')]):util[_0x96e0('0x89')](_0x96e0('0x107'),_[_0x96e0('0x69')](_0x566508['TrunkBackup'])?_0x566508[_0x96e0('0x54')]['name']:_0x566508['TrunkBackup'][_0x96e0('0x57')],_[_0x96e0('0x69')](_0x566508['dialPrefix'])?'':_0x566508['dialPrefix'][_0x96e0('0x108')]()||'',_0x566508[_0x96e0('0x10a')]>0x0?_0x543a55[_0x96e0('0xe1')]['phone'][_0x96e0('0x109')](_0x566508[_0x96e0('0x10a')]):_0x543a55[_0x96e0('0xe1')]['phone']);var _0x2d1897=_0x5b61a8['isTrunkReachable'](_0x566508[_0x96e0('0x54')])?ut[_0x96e0('0x10b')](_0x566508['Trunk']['callerid'],_0x566508[_0x96e0('0x36')],_0x566508[_0x96e0('0x10c')]>0x0?ut[_0x96e0('0x10d')](_0x566508[_0x96e0('0x10e')],_0x566508[_0x96e0('0x10c')]):_0x566508[_0x96e0('0x10e')]):ut[_0x96e0('0x10b')](_[_0x96e0('0x69')](_0x566508[_0x96e0('0x9a')])?_0x566508[_0x96e0('0x54')][_0x96e0('0x55')]:_0x566508['TrunkBackup'][_0x96e0('0x55')],_0x566508[_0x96e0('0x36')],_0x566508[_0x96e0('0x10c')]>0x0?ut['getCallerIdRandom'](_0x566508['dialOriginateCallerIdNumber'],_0x566508[_0x96e0('0x10c')]):_0x566508['dialOriginateCallerIdNumber']);if(_0x2d1897){_0xf30296[_0x96e0('0x10f')]=ut[_0x96e0('0x110')](_0x2d1897);_0xf30296[_0x96e0('0x111')]=ut['extractCalleridNumber'](_0x2d1897);}var _0x4b3bb9=ut[_0x96e0('0x112')](_0x566508,_0x543a55,_0x540926,_0x2d1897,_0x188cf1,_0xf30296);_[_0x96e0('0x113')](_0xf30296,ut[_0x96e0('0x114')](_0x4b3bb9));_0xf30296[_0x96e0('0x115')]=moment()[_0x96e0('0x89')]('YYYY-MM-DD\x20HH:mm:ss');ami['Action'](ut[_0x96e0('0x116')](_0xf30296,_0x566508,_0x4b3bb9,_0xf30296[_0x96e0('0xc1')],_0x581b86))[_0x96e0('0x82')](function(_0x301c01){_0x566508['originated']+=0x1;logger['info'](_0x96e0('0x117'),_0x188cf1,_0x96e0('0xa9'),_0x566508[_0x96e0('0x57')],'originated:\x20',_0x566508[_0x96e0('0x4e')]);_0x26c572(_0x301c01);})['catch'](function(_0x52be6d){ut[_0x96e0('0xd9')](_0xf30296,0xe,_0x96e0('0x118'));rpcDb['createAgentHistory'](_0xf30296,_0x96e0('0x119'));_0x2833b6(_0x52be6d);});});};Preview[_0x96e0('0x10')]['syncNewExten']=function(_0x4bc657){if(this['actions'][_0x4bc657[_0x96e0('0xa4')]]){this[_0x96e0('0x17')][_0x4bc657[_0x96e0('0xa4')]][_0x96e0('0x76')]=_0x4bc657[_0x96e0('0x76')];}};Preview['prototype'][_0x96e0('0x1a')]=function(_0x5e03b9){var _0x2528b4=this;var _0x32893c=this['actions'][_0x5e03b9[_0x96e0('0x11a')]];if(_0x32893c){if(_0x32893c['lookAgent']&&this[_0x96e0('0x18')][_0x32893c[_0x96e0('0xe3')]]){ut[_0x96e0('0x11b')](_0x32893c,this['agents'][_0x32893c[_0x96e0('0xe3')]]['name'],this['agents'][_0x32893c[_0x96e0('0xe3')]]['id']);}var _0x4abbde=_['clone'](_0x32893c);_0x4abbde['responsetime']=moment()[_0x96e0('0x89')](_0x96e0('0x8a'));var _0x2a1d22=_0x2528b4['campaignsPreview'][_0x32893c['queue']];if(ut[_0x96e0('0x11c')](_0x5e03b9[_0x96e0('0x11d')])){if(_0x32893c[_0x96e0('0xc0')]){rpcDb['unlockContact'](_0x32893c[_0x96e0('0xcf')]);}if(_0x32893c[_0x96e0('0xc1')]){rpcDb[_0x96e0('0xce')](_0x32893c['idContact']);}ami['emit']('custom:agentringnoanswer',ut[_0x96e0('0xab')](_0x32893c,_0x96e0('0x11e')));this['callProgressDetectingAgent'](_0x4abbde,_0x2a1d22,_0x5e03b9);}else{_0x32893c['starttime']=moment()['format'](_0x96e0('0x8a'));ut[_0x96e0('0xd9')](_0x4abbde,0x4,_0x96e0('0x11f'));rpcDb[_0x96e0('0xdc')](_0x4abbde,_0x96e0('0x120'));}}};Preview[_0x96e0('0x10')][_0x96e0('0x1d')]=function(_0x47f72f){var _0x3739fb=this;var _0x5a6ff1=this[_0x96e0('0x17')][_0x47f72f[_0x96e0('0xa4')]];var _0x2c036b;if(_0x5a6ff1){_0x2c036b=this['campaignsPreview'][_0x5a6ff1['queue']];logger[_0x96e0('0x6a')](_0x96e0('0x121'),_0x47f72f[_0x96e0('0xa4')],_0x96e0('0xa9'),_0x2c036b[_0x96e0('0x57')],_0x96e0('0x6e'),_0x2c036b[_0x96e0('0x2c')]);}if(this[_0x96e0('0x17')][_0x47f72f[_0x96e0('0xa4')]]&&_0x47f72f[_0x96e0('0xa4')]!==_0x47f72f[_0x96e0('0xa8')]){if(_0x47f72f[_0x96e0('0x122')]==='16'&&this['actions'][_0x47f72f[_0x96e0('0xa4')]][_0x96e0('0x6f')]){this['callProgressDetectingCustomer'](_0x47f72f,_0x47f72f[_0x96e0('0xa4')],_0x47f72f[_0x96e0('0x122')]);}else if(this['actions'][_0x47f72f[_0x96e0('0xa4')]][_0x96e0('0x6f')]){logger[_0x96e0('0x6a')](_0x96e0('0x123'),_0x47f72f[_0x96e0('0xa4')],_0x47f72f[_0x96e0('0x122')],_0x96e0('0xa9'),_0x2c036b['name'],_0x96e0('0x6e'),_0x2c036b[_0x96e0('0x2c')]);this[_0x96e0('0x9c')](_0x47f72f,_0x47f72f[_0x96e0('0xa4')],_0x47f72f[_0x96e0('0x122')]);}}else if(_0x5a6ff1&&_['isNil'](_0x5a6ff1['statedesc'])&&_0x2c036b['dialQueueProject']&&_0x47f72f['linkedid']===_0x47f72f[_0x96e0('0xa8')]&&_[_0x96e0('0x69')](_0x47f72f[_0x96e0('0xd8')])&&_0x47f72f[_0x96e0('0x122')]==='16'&&_0x47f72f[_0x96e0('0x124')]==='6'&&_[_0x96e0('0xd6')](_0x5a6ff1['transfer'])){if(_0x5a6ff1[_0x96e0('0xc0')]){rpcDb[_0x96e0('0xf4')](_0x5a6ff1[_0x96e0('0xcf')]);}if(_0x5a6ff1[_0x96e0('0xc1')]){rpcDb[_0x96e0('0xce')](_0x5a6ff1[_0x96e0('0xcf')]);}_0x47f72f[_0x96e0('0xd8')]='22';this['callProgressDetectingAgent'](_0x5a6ff1,_0x2c036b,_0x47f72f);}else if(_0x5a6ff1&&_0x5a6ff1[_0x96e0('0x125')]){if(_0x47f72f[_0x96e0('0x122')]==='16'&&this[_0x96e0('0x17')][_0x47f72f[_0x96e0('0xa4')]][_0x96e0('0x6f')]){logger['info'](_0x96e0('0x126'),_0x47f72f[_0x96e0('0xa4')],_0x47f72f[_0x96e0('0x122')],_0x96e0('0xa9'),_0x2c036b[_0x96e0('0x57')],_0x96e0('0x6e'),_0x2c036b[_0x96e0('0x2c')]);this[_0x96e0('0x9c')](_0x47f72f,_0x47f72f[_0x96e0('0xa4')],_0x47f72f[_0x96e0('0x122')]);}else if(this[_0x96e0('0x17')][_0x47f72f[_0x96e0('0xa4')]]['dialAnswer']){logger['info'](_0x96e0('0x123'),_0x47f72f[_0x96e0('0xa4')],_0x47f72f[_0x96e0('0x122')],_0x96e0('0xa9'),_0x2c036b[_0x96e0('0x57')],_0x96e0('0x6e'),_0x2c036b[_0x96e0('0x2c')]);this['callProgressDetectingCustomer'](_0x47f72f,_0x47f72f[_0x96e0('0xa4')],_0x47f72f[_0x96e0('0x122')]);}}};Preview['prototype']['syncDialEnd']=function(_0x54f7f8){if(this[_0x96e0('0x17')][_0x54f7f8[_0x96e0('0xd4')]]&&_0x54f7f8[_0x96e0('0xd4')]!==_0x54f7f8[_0x96e0('0x127')]){this['callProgressDetectingCustomer'](_0x54f7f8,_0x54f7f8[_0x96e0('0xd4')],_0x54f7f8[_0x96e0('0x128')]);}};Preview['prototype']['syncHangupRequest']=function(_0x2e150b){if(this[_0x96e0('0x17')][_0x2e150b[_0x96e0('0xa4')]]&&_0x2e150b[_0x96e0('0xa4')]!==_0x2e150b[_0x96e0('0xa8')]&&!this[_0x96e0('0x17')][_0x2e150b[_0x96e0('0xa4')]][_0x96e0('0x6f')]){if(_0x2e150b[_0x96e0('0x122')]==='1'){this['callProgressDetectingCustomer'](_0x2e150b,_0x2e150b['linkedid'],_0x2e150b[_0x96e0('0x122')]);}}};Preview[_0x96e0('0x10')]['addVariable']=function(_0x109eb8,_0x4b6822,_0x39e7ce){if(this[_0x96e0('0x17')][_0x109eb8]){if(_['isNil'](this['actions'][_0x109eb8]['variables'])){this['actions'][_0x109eb8][_0x96e0('0x129')]={};}this[_0x96e0('0x17')][_0x109eb8][_0x96e0('0x129')][_0x4b6822]=_0x39e7ce;}};Preview['prototype'][_0x96e0('0x12a')]=function(_0x1dcc08){try{if(!_[_0x96e0('0x69')](_0x1dcc08)){if(ut[_0x96e0('0x12b')](_['keys'](_0x1dcc08['variable'])[0x0])){this[_0x96e0('0x12c')](_0x1dcc08[_0x96e0('0xa8')],_[_0x96e0('0x12d')](_0x1dcc08[_0x96e0('0x12e')])[0x0],_0x1dcc08[_0x96e0('0x12f')]);}}}catch(_0x31a907){logger[_0x96e0('0x130')](_0x96e0('0x131'),util['inspect'](_0x31a907,{'showHidden':![],'depth':null}));}};Preview[_0x96e0('0x10')][_0x96e0('0x132')]=function(_0x551f0d){if(_0x551f0d){if(this[_0x96e0('0x17')][_0x551f0d['transfertargetlinkedid']]){this[_0x96e0('0x17')][_0x551f0d['transfertargetlinkedid']]['transfer']=!![];}}};Preview['prototype']['syncBlindTransfer']=function(_0x3fca41){if(_0x3fca41){if(this[_0x96e0('0x17')][_0x3fca41[_0x96e0('0x133')]]){this[_0x96e0('0x17')][_0x3fca41[_0x96e0('0x133')]][_0x96e0('0x125')]=!![];}}};module[_0x96e0('0x134')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index d9b9653..5f85d3c 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 _0xa1dd=['../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/voiceQueueReport','error','inspect','resolve','catch','[createHistory]\x20','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createHistory','createAgentHistory','createCustomerFinal','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','from-sip','exten','assigned','queuecallerexitreason','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','../../../config/logger','preview','lodash','../rpc/cmHopper'];(function(_0x12ba59,_0x139b9d){var _0x147a9c=function(_0xf1804a){while(--_0xf1804a){_0x12ba59['push'](_0x12ba59['shift']());}};_0x147a9c(++_0x139b9d);}(_0xa1dd,0x1ea));var _0xda1d=function(_0x183c14,_0x5c78e2){_0x183c14=_0x183c14-0x0;var _0x5d33cd=_0xa1dd[_0x183c14];return _0x5d33cd;};'use strict';var util=require(_0xda1d('0x0'));var BPromise=require('bluebird');var logger=require(_0xda1d('0x1'))(_0xda1d('0x2'));var _=require(_0xda1d('0x3'));var cmHopper=require(_0xda1d('0x4'));var cmHopperFinal=require(_0xda1d('0x5'));var cmHopperHistory=require(_0xda1d('0x6'));var cmHopperBlack=require(_0xda1d('0x7'));var voiceQueueRt=require(_0xda1d('0x8'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0xda1d('0x9'));function loggerCatch(_0xa6ab08){return function(_0x18053f){logger[_0xda1d('0xa')](_0xa6ab08,util[_0xda1d('0xb')](_0x18053f,{'showHidden':![],'depth':null}));};}function create(_0x3b4570){return BPromise[_0xda1d('0xc')]()['then'](cmHopperHistory['createHistory'](_0x3b4570))[_0xda1d('0xd')](loggerCatch(_0xda1d('0xe')));}function createAgent(_0x2f11e1){return BPromise[_0xda1d('0xc')]()[_0xda1d('0xf')](agentReportPreview['createHistory'](_0x2f11e1))[_0xda1d('0xd')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x26895b){return BPromise[_0xda1d('0xc')]()[_0xda1d('0xf')](cmHopper[_0xda1d('0x10')](_0x26895b,!![]))[_0xda1d('0xd')](loggerCatch(_0xda1d('0x11')));}exports[_0xda1d('0x12')]=function(_0xad985){return BPromise[_0xda1d('0xc')]()[_0xda1d('0xf')](cmHopperBlack[_0xda1d('0x12')](_0xad985))[_0xda1d('0xd')](loggerCatch(_0xda1d('0x13')));};exports[_0xda1d('0x14')]=function(_0x235603){return BPromise[_0xda1d('0xc')]()[_0xda1d('0xf')](cmHopper[_0xda1d('0x14')](_0x235603))[_0xda1d('0xd')](loggerCatch('[getContactPreview]\x20'));};exports[_0xda1d('0x15')]=function(_0x5616d8,_0x496a7c){create(_0x5616d8)[_0xda1d('0xd')](loggerCatch(_0x496a7c));moveContact(_0x5616d8)[_0xda1d('0xd')](loggerCatch(_0x496a7c));};exports[_0xda1d('0x16')]=function(_0x140299,_0x4f08d9){createAgent(_0x140299)[_0xda1d('0xd')](loggerCatch(_0x4f08d9));};exports['createCustomerHistory']=function(_0x8bcdec,_0x2b35a4){create(_0x8bcdec)['catch'](loggerCatch(_0x2b35a4));};exports[_0xda1d('0x17')]=function(_0x31b07d,_0x18fa96){moveContact(_0x31b07d)['catch'](loggerCatch(_0x18fa96));};exports[_0xda1d('0x18')]=function(_0x463425,_0x3041de,_0x1182fc){if(_0x3041de){_0x463425['UserId']=null;}if(_0x1182fc){_0x463425[_0xda1d('0x19')]=![];}return BPromise[_0xda1d('0xc')]()[_0xda1d('0xf')](cmHopper[_0xda1d('0x18')](_0x463425))[_0xda1d('0xd')](loggerCatch(_0xda1d('0x1a')));};exports['countReScheduled']=function(_0x55b863){return BPromise['resolve']()[_0xda1d('0xf')](cmHopper[_0xda1d('0x1b')](_0x55b863))[_0xda1d('0xd')](loggerCatch(_0xda1d('0x1c')));};exports[_0xda1d('0x1d')]=function(_0x2e9b8d){return BPromise[_0xda1d('0xc')]()[_0xda1d('0xf')](cmHopper['unlockContact']({'UserId':null},_0x2e9b8d,0x1))[_0xda1d('0xd')](loggerCatch(_0xda1d('0x1e')));};exports['disableContact']=function(_0x35a7d3){return BPromise[_0xda1d('0xc')]()[_0xda1d('0xf')](cmHopper[_0xda1d('0x1d')]({'active':![]},_0x35a7d3,0x1))[_0xda1d('0xd')](loggerCatch(_0xda1d('0x1f')));};exports[_0xda1d('0x20')]=function(_0x38b259){var _0xb38b23={};_0xb38b23[_0xda1d('0x21')]=_0x38b259['type'];_0xb38b23[_0xda1d('0x22')]=_0x38b259[_0xda1d('0x22')];_0xb38b23[_0xda1d('0x23')]=_0x38b259[_0xda1d('0x23')];_0xb38b23[_0xda1d('0x24')]=_0x38b259[_0xda1d('0x24')];_0xb38b23[_0xda1d('0x25')]=_0x38b259[_0xda1d('0x25')];_0xb38b23[_0xda1d('0x26')]=_0x38b259['answertime'];_0xb38b23[_0xda1d('0x27')]=_0x38b259[_0xda1d('0x28')];_0xb38b23[_0xda1d('0x29')]=0x1;_0xb38b23[_0xda1d('0x2a')]=_0x38b259[_0xda1d('0x2b')];_0xb38b23[_0xda1d('0x2c')]=_0x38b259[_0xda1d('0x2d')];_0xb38b23['context']=_0xda1d('0x2e');_0xb38b23[_0xda1d('0x2f')]='xcally-motion-preview';_0xb38b23['holdtime']=0x0;_0xb38b23[_0xda1d('0x30')]=0x1;_0xb38b23['lastAssignedTo']=_0x38b259[_0xda1d('0x2d')];_0xb38b23[_0xda1d('0x31')]='COMPLETED';return BPromise[_0xda1d('0xc')]()[_0xda1d('0xf')](voiceQueueReport['create'](_0xb38b23))[_0xda1d('0xd')](loggerCatch(_0xda1d('0x32')));};exports[_0xda1d('0x33')]=function(_0x223094,_0x40ecc1){return BPromise['resolve']()[_0xda1d('0xf')](cmHopper['getContactRecallMe'](_0x223094,_0x40ecc1))['catch'](loggerCatch(_0xda1d('0x34')));};exports[_0xda1d('0x35')]=function(_0x2ee4f6){return BPromise[_0xda1d('0xc')]()[_0xda1d('0xf')](cmHopper[_0xda1d('0x18')](_0x2ee4f6,!![],!![]))[_0xda1d('0xd')](loggerCatch(_0xda1d('0x36')));}; \ No newline at end of file +var _0x3804=['[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','answertime','queuecallercompleteAt','endtime','connectedlinename','membername','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','error','resolve','createHistory','catch','then','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','rescheduleContact'];(function(_0x4c3593,_0x4ea381){var _0x1172d1=function(_0x434b93){while(--_0x434b93){_0x4c3593['push'](_0x4c3593['shift']());}};_0x1172d1(++_0x4ea381);}(_0x3804,0x175));var _0x4380=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3804[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x4380('0x0'));var BPromise=require(_0x4380('0x1'));var logger=require(_0x4380('0x2'))(_0x4380('0x3'));var _=require(_0x4380('0x4'));var cmHopper=require(_0x4380('0x5'));var cmHopperFinal=require(_0x4380('0x6'));var cmHopperHistory=require(_0x4380('0x7'));var cmHopperBlack=require(_0x4380('0x8'));var voiceQueueRt=require(_0x4380('0x9'));var agentReportPreview=require(_0x4380('0xa'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x30e767){return function(_0x35bddf){logger[_0x4380('0xb')](_0x30e767,util['inspect'](_0x35bddf,{'showHidden':![],'depth':null}));};}function create(_0x47ecc8){return BPromise[_0x4380('0xc')]()['then'](cmHopperHistory[_0x4380('0xd')](_0x47ecc8))[_0x4380('0xe')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x3e5b14){return BPromise[_0x4380('0xc')]()[_0x4380('0xf')](agentReportPreview[_0x4380('0xd')](_0x3e5b14))[_0x4380('0xe')](loggerCatch(_0x4380('0x10')));}function moveContact(_0x4a8e1e){return BPromise[_0x4380('0xc')]()[_0x4380('0xf')](cmHopper[_0x4380('0x11')](_0x4a8e1e,!![]))[_0x4380('0xe')](loggerCatch(_0x4380('0x12')));}exports[_0x4380('0x13')]=function(_0xee1254){return BPromise['resolve']()['then'](cmHopperBlack[_0x4380('0x13')](_0xee1254))[_0x4380('0xe')](loggerCatch(_0x4380('0x14')));};exports[_0x4380('0x15')]=function(_0x563603){return BPromise['resolve']()['then'](cmHopper[_0x4380('0x15')](_0x563603))['catch'](loggerCatch(_0x4380('0x16')));};exports[_0x4380('0xd')]=function(_0x425d45,_0x288b59){create(_0x425d45)[_0x4380('0xe')](loggerCatch(_0x288b59));moveContact(_0x425d45)[_0x4380('0xe')](loggerCatch(_0x288b59));};exports[_0x4380('0x17')]=function(_0x4c0a5b,_0x23203c){createAgent(_0x4c0a5b)[_0x4380('0xe')](loggerCatch(_0x23203c));};exports[_0x4380('0x18')]=function(_0x4f7b62,_0x3bfe02){create(_0x4f7b62)[_0x4380('0xe')](loggerCatch(_0x3bfe02));};exports['createCustomerFinal']=function(_0x121f24,_0x220a7){moveContact(_0x121f24)[_0x4380('0xe')](loggerCatch(_0x220a7));};exports[_0x4380('0x19')]=function(_0x1c0dd1,_0x494572,_0x2f56cc){if(_0x494572){_0x1c0dd1['UserId']=null;}if(_0x2f56cc){_0x1c0dd1['active']=![];}return BPromise['resolve']()[_0x4380('0xf')](cmHopper[_0x4380('0x19')](_0x1c0dd1))['catch'](loggerCatch(_0x4380('0x1a')));};exports[_0x4380('0x1b')]=function(_0x5a1b0b){return BPromise[_0x4380('0xc')]()[_0x4380('0xf')](cmHopper[_0x4380('0x1b')](_0x5a1b0b))[_0x4380('0xe')](loggerCatch(_0x4380('0x1c')));};exports[_0x4380('0x1d')]=function(_0x225fee){return BPromise[_0x4380('0xc')]()[_0x4380('0xf')](cmHopper[_0x4380('0x1d')]({'UserId':null},_0x225fee,0x1))[_0x4380('0xe')](loggerCatch('[unlockContact]\x20'));};exports[_0x4380('0x1e')]=function(_0x27226d){return BPromise[_0x4380('0xc')]()['then'](cmHopper[_0x4380('0x1d')]({'active':![]},_0x27226d,0x1))[_0x4380('0xe')](loggerCatch(_0x4380('0x1f')));};exports[_0x4380('0x20')]=function(_0x1c9611){var _0x144331={};_0x144331[_0x4380('0x21')]=_0x1c9611[_0x4380('0x21')];_0x144331[_0x4380('0x22')]=_0x1c9611[_0x4380('0x22')];_0x144331[_0x4380('0x23')]=_0x1c9611[_0x4380('0x23')];_0x144331[_0x4380('0x24')]=_0x1c9611[_0x4380('0x24')];_0x144331[_0x4380('0x25')]=_0x1c9611[_0x4380('0x25')];_0x144331[_0x4380('0x26')]=_0x1c9611['answertime'];_0x144331[_0x4380('0x27')]=_0x1c9611[_0x4380('0x28')];_0x144331['queuecallercomplete']=0x1;_0x144331[_0x4380('0x29')]=_0x1c9611[_0x4380('0x2a')];_0x144331[_0x4380('0x2b')]=_0x1c9611[_0x4380('0x2c')];_0x144331['context']='from-sip';_0x144331[_0x4380('0x2d')]=_0x4380('0x2e');_0x144331[_0x4380('0x2f')]=0x0;_0x144331[_0x4380('0x30')]=0x1;_0x144331[_0x4380('0x31')]=_0x1c9611[_0x4380('0x2c')];_0x144331['queuecallerexitreason']=_0x4380('0x32');return BPromise['resolve']()[_0x4380('0xf')](voiceQueueReport[_0x4380('0x33')](_0x144331))[_0x4380('0xe')](loggerCatch(_0x4380('0x34')));};exports[_0x4380('0x35')]=function(_0x1f081a,_0x390c71){return BPromise[_0x4380('0xc')]()[_0x4380('0xf')](cmHopper[_0x4380('0x35')](_0x1f081a,_0x390c71))[_0x4380('0xe')](loggerCatch(_0x4380('0x36')));};exports[_0x4380('0x37')]=function(_0x2886f6){return BPromise['resolve']()[_0x4380('0xf')](cmHopper[_0x4380('0x19')](_0x2886f6,!![],!![]))['catch'](loggerCatch(_0x4380('0x38')));}; \ 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 8afec5e..7a199e4 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 _0xf6d8=['xmd-voicequeueid','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','random','extractCalleridName','extractCalleridNumber','util','lodash','moment','preview','env','XCALLY_IP_AGI','milliseconds','diff','error','info','inspect','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','Queue','calleridname','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','\x22agi://%s/square,%s\x22','dialQueueProject','originatecalleridnum','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','ringtime','logLookAgent','membername','UserId','talktime','answertime','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','calleridnum','from-sip','timeout','totalGlobal','countnoanswerretry','cloneAction','Global','active','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','name','queue','interface','channelAgent','not_inuse','status','reachable','push','getDiff','createBody','CampaignId','filterKey','idContact','type','campaigntype','countbusyretry','countcongestionretry','countglobal','callback','recallme','sipcallid'];(function(_0x3a543e,_0x4ad8c0){var _0x285b28=function(_0x5b02be){while(--_0x5b02be){_0x3a543e['push'](_0x3a543e['shift']());}};_0x285b28(++_0x4ad8c0);}(_0xf6d8,0x12d));var _0x8f6d=function(_0x3d76b8,_0xca83ce){_0x3d76b8=_0x3d76b8-0x0;var _0x3d3548=_0xf6d8[_0x3d76b8];return _0x3d3548;};'use strict';var util=require(_0x8f6d('0x0'));var _=require(_0x8f6d('0x1'));var moment=require(_0x8f6d('0x2'));var logger=require('../../../../config/logger')(_0x8f6d('0x3'));var ipAgi=process[_0x8f6d('0x4')][_0x8f6d('0x5')]||'127.0.0.1';function getSeconds(_0x30372d,_0x581812){var _0x108a16=moment(_0x30372d)[_0x8f6d('0x6')](0x0);var _0x548c15=moment(_0x581812)[_0x8f6d('0x6')](0x0);return _0x108a16[_0x8f6d('0x7')](_0x548c15,'seconds');}exports['loggerCatch']=function(_0x2e7d30){return function(_0x48ba0f){logger[_0x8f6d('0x8')](_0x2e7d30,util['inspect'](_0x48ba0f,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x28a1ff,_0x2a0f01){logger[_0x8f6d('0x9')](_0x28a1ff,util[_0x8f6d('0xa')](_0x2a0f01,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x4e7573,_0x5bd575){logger[_0x8f6d('0x8')](_0x4e7573,util[_0x8f6d('0xa')](_0x5bd575,{'showHidden':![],'depth':null}));};exports[_0x8f6d('0xb')]=function(_0xe2b988){return function(_0x209c49){logger['info'](_0xe2b988,util[_0x8f6d('0xa')](_0x209c49,{'showHidden':![],'depth':null}));};};exports[_0x8f6d('0xc')]=function(_0x4b7704,_0x123aa7,_0x5c0f0d){return{'message':_0x4b7704,'unlock':_0x123aa7,'active':_0x5c0f0d};};exports[_0x8f6d('0xd')]=function(_0x1be4c9,_0x16bc33,_0x3f0527){if(!_[_0x8f6d('0xe')](_0x3f0527)&&_0x8f6d('0xf')===typeof _0x3f0527&&!_[_0x8f6d('0x10')](_0x3f0527)){if(!_['isUndefined'](_0x16bc33)&&_0x8f6d('0xf')===typeof _0x16bc33&&!_['isEmpty'](_0x16bc33)){return util[_0x8f6d('0x11')](_0x8f6d('0x12'),_0x16bc33,_0x3f0527);}return util[_0x8f6d('0x11')]('\x22%s\x22\x20<%s>',_0x3f0527,_0x3f0527);}if(!_[_0x8f6d('0xe')](_0x1be4c9)&&_0x8f6d('0xf')===typeof _0x1be4c9&&!_[_0x8f6d('0x10')](_0x1be4c9)){return _0x1be4c9;}return _0x8f6d('0x13');};exports[_0x8f6d('0x14')]=function(_0x4456cb){if(_[_0x8f6d('0x15')](_0x4456cb)){return![];}return _0x4456cb;};exports['addVariables']=function(_0x4002ef,_0x3e11c8,_0x5253b0,_0x4be49f,_0x4299cc,_0xe04919){var _0x621a9b={'XMD-QUEUE':_0x3e11c8[_0x8f6d('0x16')]?_0x3e11c8[_0x8f6d('0x16')]['name']:'','XMD-CALLERID':_0x4be49f,'XMD-CALLERID-PREVIEW':_0xe04919?util[_0x8f6d('0x11')]('\x22%s\x22\x20<%s>',_0xe04919[_0x8f6d('0x17')],_0xe04919['calleridnum']):_0x4be49f,'XMD-DIALID':_0x4299cc,'XMD-CONTACTID':_0x3e11c8[_0x8f6d('0x18')],'XMD-CDRTYPE':_0x8f6d('0x19'),'CALLERID(all)':_0x4be49f,'XMD-VOICEQUEUEID':_0x3e11c8[_0x8f6d('0x1a')],'XMD-DIALCHANNEL':_0x5253b0,'XMD-DIALTIMEOUT':_0x4002ef[_0x8f6d('0x1b')]||0x1e,'XMD-DIALOPTIONS':util[_0x8f6d('0x11')]('\x22rtTxX%s%s\x22',_0x4002ef[_0x8f6d('0x1c')]?'g':'',_[_0x8f6d('0x10')](_0x4002ef[_0x8f6d('0x1d')])?'':_0x8f6d('0x1e')),'XMD-DIALURL':_0x4002ef[_0x8f6d('0x1f')]||'','XMD-AGI':_0x4002ef['dialQueueProject']?util[_0x8f6d('0x11')](_0x8f6d('0x20'),ipAgi,_0x4002ef[_0x8f6d('0x21')]):'NONE','XMD-AGIAFTER':_0x4002ef['dialQueueProject2']?util[_0x8f6d('0x11')]('\x22agi://%s/square,%s\x22',ipAgi,_0x4002ef[_0x8f6d('0x1c')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0xe04919?_0xe04919[_0x8f6d('0x22')]:'','XMD-ORIGINATECALLERIDNAME':_0xe04919?_0xe04919['originatecalleridname']:'','XMD-DESTINATION':_0x8f6d('0x23')};if(!_[_0x8f6d('0x10')](_0x4002ef[_0x8f6d('0x1d')])){_0x621a9b[util[_0x8f6d('0x11')]('%s',_0x8f6d('0x24'))]=_0x4002ef[_0x8f6d('0x1d')];_0x621a9b[util[_0x8f6d('0x11')]('%s',_0x8f6d('0x25'))]=_0x4299cc;}if(_0x3e11c8&&_0x3e11c8['Contact']){for(var _0x35576e in _0x3e11c8[_0x8f6d('0x26')]){if(_0x3e11c8[_0x8f6d('0x26')][_0x8f6d('0x27')](_0x35576e)){if(!_[_0x8f6d('0x15')](_0x3e11c8[_0x8f6d('0x26')][_0x35576e])&&_0x35576e!=='id'&&_0x35576e!==_0x8f6d('0x28')&&_0x35576e!==_0x8f6d('0x29')&&_0x35576e!=='updatedAt'){_0x621a9b[util[_0x8f6d('0x11')](_0x8f6d('0x2a'),_0x8f6d('0x2b'),_[_0x8f6d('0x2c')](_0x35576e))]=_0x3e11c8[_0x8f6d('0x26')][_0x35576e];}}}}return _0x621a9b;};exports[_0x8f6d('0x2d')]=function(_0x4b795b){var _0x5df008={};for(var _0x1b93e6 in _0x4b795b){if(_0x4b795b[_0x8f6d('0x27')](_0x1b93e6)){_0x5df008[util[_0x8f6d('0x11')]('%s',_[_0x8f6d('0x2e')](_0x1b93e6))]=_0x4b795b[_0x1b93e6];}}return{'variables':_0x5df008};};exports[_0x8f6d('0x2f')]=function(_0x2088fc,_0x14c821){if(!_['isNil'](_0x2088fc)){if(_0x2088fc['hasOwnProperty'](_0x8f6d('0x30'))){if(_0x2088fc[_0x8f6d('0x30')]>0x0){_0x2088fc[_0x8f6d('0x30')]-=0x1;}else{logger[_0x8f6d('0x8')](_0x8f6d('0x31'),_0x14c821);}}}else{logger[_0x8f6d('0x8')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x14c821);}};exports['logBlacklist']=function(_0xb074e9){var _0x5c52cc=moment()[_0x8f6d('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0xb074e9[_0x8f6d('0x32')]=0xd;_0xb074e9[_0x8f6d('0x33')]=_0x8f6d('0x34');_0xb074e9[_0x8f6d('0x35')]=_0x5c52cc;_0xb074e9[_0x8f6d('0x36')]=_0x5c52cc;_0xb074e9[_0x8f6d('0x37')]=_0x5c52cc;};exports[_0x8f6d('0x38')]=function(_0x32e978,_0x521da9,_0x2f8dfb){var _0x581f1b=moment()[_0x8f6d('0x11')](_0x8f6d('0x39'));_0x32e978[_0x8f6d('0x32')]=_0x521da9;_0x32e978[_0x8f6d('0x33')]=_0x2f8dfb;_0x32e978[_0x8f6d('0x36')]=_0x581f1b;_0x32e978[_0x8f6d('0x3a')]=getSeconds(_0x32e978[_0x8f6d('0x36')],_0x32e978[_0x8f6d('0x35')]);};exports[_0x8f6d('0x3b')]=function(_0x2baf2f,_0x48e2f8,_0x38ce2b){_0x2baf2f[_0x8f6d('0x3c')]=_0x48e2f8;_0x2baf2f[_0x8f6d('0x3d')]=_0x38ce2b;};exports['logCustomer']=function(_0x11a193,_0x2adac9,_0x59f08a){var _0x78c779=moment()[_0x8f6d('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x11a193[_0x8f6d('0x32')]=_0x2adac9;_0x11a193[_0x8f6d('0x33')]=_0x59f08a;_0x11a193[_0x8f6d('0x36')]=_0x11a193[_0x8f6d('0x36')]?_0x11a193[_0x8f6d('0x36')]:_0x78c779;_0x11a193['endtime']=_0x11a193[_0x8f6d('0x37')]?_0x11a193['endtime']:_0x78c779;_0x11a193[_0x8f6d('0x3a')]=getSeconds(_0x11a193[_0x8f6d('0x36')]||0x0,_0x11a193[_0x8f6d('0x35')]||0x0);_0x11a193[_0x8f6d('0x3e')]=_0x11a193[_0x8f6d('0x3f')]?getSeconds(_0x11a193[_0x8f6d('0x37')],_0x11a193[_0x8f6d('0x3f')]):0x0;};exports['isFailure']=function(_0x5e5b7e){return _0x5e5b7e===_0x8f6d('0x40');};exports[_0x8f6d('0x41')]=function(_0x4c07de,_0x354894,_0x3b9707,_0xae7cc0,_0x4932de){var _0x5689d2=_0xae7cc0?_0x8f6d('0x42'):_0x4c07de[_0x8f6d('0x17')];_0x5689d2=_0x4932de?_0x8f6d('0x43'):_0x5689d2;return{'actionid':_0x4c07de[_0x8f6d('0x44')],'action':_0x8f6d('0x45'),'channel':_0x4c07de['channelAgent'],'callerid':util[_0x8f6d('0x11')](_0x8f6d('0x12'),_0x5689d2,_0x4c07de[_0x8f6d('0x46')]),'Exten':'xcally-motion-preview','Context':_0x8f6d('0x47'),'Priority':'1','variable':_0x3b9707,'timeout':(_0x354894[_0x8f6d('0x48')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4c07de[_0x8f6d('0x44')]};};exports[_0x8f6d('0x49')]=function(_0x2d0d20){return _0x2d0d20['countbusyretry']+_0x2d0d20['countcongestionretry']+_0x2d0d20[_0x8f6d('0x4a')];};exports[_0x8f6d('0x4b')]=function(_0x204155){var _0x1dc1f5=_['clone'](_0x204155);_0x1dc1f5[_0x8f6d('0x32')]=0xf;_0x1dc1f5[_0x8f6d('0x33')]=_0x8f6d('0x4c');return _0x1dc1f5;};exports['scheduledAt']=function(_0x3b4adc,_0xa63da2,_0x32e344){var _0x2c8e85={};_0x2c8e85[_0xa63da2]=_0x3b4adc[_0xa63da2];_0x2c8e85[_0x8f6d('0x4d')]=![];_0x2c8e85[_0x8f6d('0x4e')]=moment()[_0x8f6d('0x4f')](_0x32e344,_0x8f6d('0x50'))[_0x8f6d('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x2c8e85[_0x8f6d('0x18')]=_0x3b4adc[_0x8f6d('0x18')];_0x2c8e85[_0x8f6d('0x51')]=_0x3b4adc['ListId'];_0x2c8e85[_0x8f6d('0x1a')]=_0x3b4adc['VoiceQueueId']||undefined;return _0x2c8e85;};exports[_0x8f6d('0x52')]=function(_0x4686b2,_0x35ac81){if(!_[_0x8f6d('0x15')](_0x4686b2)){if(_0x4686b2[_0x8f6d('0x53')]>0x0){_0x4686b2[_0x8f6d('0x53')]-=0x1;}else{logger[_0x8f6d('0x8')](_0x35ac81,_0x8f6d('0x54'));}}else{logger[_0x8f6d('0x8')](_0x35ac81,_0x8f6d('0x55'));}};exports[_0x8f6d('0x56')]=function(_0x538564){if(_0x538564<=0x0){return!![];}return![];};exports[_0x8f6d('0x57')]=function(_0x130210,_0x488ee4){_0x130210[_0x8f6d('0x58')]=_0x488ee4;_0x130210[_0x8f6d('0x59')]=_0x130210[_0x8f6d('0x5a')];_0x130210[_0x8f6d('0x5b')]=_0x130210['channelAgent'];return _0x130210;};exports['buildAcw']=function(_0x4f1251){var _0x2c1828={};_0x2c1828[_0x8f6d('0x5a')]=_0x4f1251[_0x8f6d('0x5a')];_0x2c1828[_0x8f6d('0x5b')]=_0x4f1251[_0x8f6d('0x5c')];_0x2c1828[_0x8f6d('0x44')]=_0x4f1251[_0x8f6d('0x44')];return _0x2c1828;};exports['agentReadyId']=function(_0x154d19){var _0x2b450b=[];for(var _0x112522 in _0x154d19){if(_0x154d19[_0x8f6d('0x27')](_0x112522)){if(!_[_0x8f6d('0x15')](_0x154d19[_0x112522])&&_0x154d19[_0x112522]['state']===_0x8f6d('0x5d')&&_0x154d19[_0x112522][_0x8f6d('0x5e')]===_0x8f6d('0x5f')){_0x2b450b[_0x8f6d('0x60')](_0x154d19[_0x112522]['id']);}}}return _0x2b450b;};exports[_0x8f6d('0x61')]=function(_0x566501){var _0x1d1729=moment()['milliseconds'](0x0);var _0x2ebaba=moment(_0x566501)['milliseconds'](0x0);return _0x1d1729['diff'](_0x2ebaba,'seconds');};exports[_0x8f6d('0x62')]=function(_0xd3e33d){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0xd3e33d['ContactId'],'ListId':_0xd3e33d[_0x8f6d('0x51')],'VoiceQueueId':_0xd3e33d[_0x8f6d('0x1a')]||undefined,'CampaignId':_0xd3e33d[_0x8f6d('0x63')]||undefined};};exports[_0x8f6d('0x64')]=function(_0x7082ba){if(_0x7082ba===_0x8f6d('0x44')||_0x7082ba===_0x8f6d('0x65')||_0x7082ba===_0x8f6d('0x5a')||_0x7082ba===_0x8f6d('0x66')||_0x7082ba===_0x8f6d('0x67')||_0x7082ba==='dialAnswer'||_0x7082ba==='membername'||_0x7082ba===_0x8f6d('0x5c')||_0x7082ba==='calleridname'||_0x7082ba===_0x8f6d('0x4d')||_0x7082ba==='calleridnum'||_0x7082ba===_0x8f6d('0x4e')||_0x7082ba===_0x8f6d('0x68')||_0x7082ba===_0x8f6d('0x69')||_0x7082ba===_0x8f6d('0x4a')||_0x7082ba===_0x8f6d('0x6a')||_0x7082ba===_0x8f6d('0x6b')||_0x7082ba==='callbackuniqueid'||_0x7082ba==='callbackat'||_0x7082ba===_0x8f6d('0x6c')||_0x7082ba===_0x8f6d('0x18')||_0x7082ba==='ListId'||_0x7082ba===_0x8f6d('0x3d')||_0x7082ba===_0x8f6d('0x1a')||_0x7082ba===_0x8f6d('0x6d')||_0x7082ba===_0x8f6d('0x6e')||_0x7082ba==='xmd-queue'||_0x7082ba==='xmd-phone'||_0x7082ba===_0x8f6d('0x6f')||_0x7082ba===_0x8f6d('0x70')||_0x7082ba===_0x8f6d('0x71')||_0x7082ba===_0x8f6d('0x72')||_0x7082ba===_0x8f6d('0x73')||_0x7082ba===_0x8f6d('0x74')||_0x7082ba===_0x8f6d('0x75')||_0x7082ba===_0x8f6d('0x76')||_0x7082ba===_0x8f6d('0x77')||_0x7082ba===_0x8f6d('0x78')||_0x7082ba===_0x8f6d('0x79')||_0x7082ba===_0x8f6d('0x7a')||_0x7082ba===_0x8f6d('0x7b')||_0x7082ba===_0x8f6d('0x7c')||_0x7082ba===_0x8f6d('0x7d')||_0x7082ba===_0x8f6d('0x7e')||_0x7082ba===_0x8f6d('0x7f')||_0x7082ba===_0x8f6d('0x80')||_0x7082ba===_0x8f6d('0x81')||_0x7082ba==='rtpaudioqos'||_0x7082ba===_0x8f6d('0x7b')||_0x7082ba===_0x8f6d('0x7c')||_0x7082ba===_0x8f6d('0x7d')||_0x7082ba===_0x8f6d('0x7e')||_0x7082ba==='rtpaudioqoslossbridged'||_0x7082ba===_0x8f6d('0x80')||_0x7082ba===_0x8f6d('0x81')||_0x7082ba===_0x8f6d('0x82')||_0x7082ba===_0x8f6d('0x83')||_0x7082ba===_0x8f6d('0x32')||_0x7082ba===_0x8f6d('0x33')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x32a4d8,_0x3ee0ab){var _0x4f01b2,_0x300034,_0x45ce06;if(_0x3ee0ab<=0x0){_0x3ee0ab=0x1;}_0x4f01b2=new RegExp(_0x8f6d('0x84')+_0x3ee0ab+'}$');_0x300034=Math[_0x8f6d('0x85')](0xa,_0x3ee0ab-0x1);_0x45ce06=Math['pow'](0xa,_0x3ee0ab)-0x1;return util['format']('%s',_['replace'](_0x32a4d8,_0x4f01b2,_[_0x8f6d('0x86')](_0x300034,_0x45ce06)));};exports[_0x8f6d('0x87')]=function(_0x1dcfe5){var _0x23e0b4=_0x1dcfe5['match'](/"(.*?)"/);return _0x23e0b4?_0x23e0b4[0x1]:_0x1dcfe5;};exports[_0x8f6d('0x88')]=function(_0x4c99e0){var _0x124f91=_0x4c99e0['match'](/<(.*?)>/);return _0x124f91?_0x124f91[0x1]:_0x4c99e0;}; \ No newline at end of file +var _0x5d0a=['seconds','loggerCatch','error','inspect','logger','info','loggerError','message','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','addVariables','Queue','name','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','NONE','originatecalleridname','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','isNil','createdAt','updatedAt','%s%s','toUpper','toLowerVariables','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','statedesc','Blacklist','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','membername','UserId','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','RECALL','calleridname','BOOKED','uniqueid','originate','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','cloneAction','clone','Global','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','buildObj','lastevent','queue','interface','agentReadyId','not_inuse','status','reachable','push','getDiff','createBody','CampaignId','idContact','type','campaigntype','channelAgent','active','calleridnum','countnoanswerretry','countglobal','recallme','sipcallid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialid','xmd-dialchannel','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','pow','replace','random','extractCalleridName','match','util','moment','../../../../config/logger','preview','env','127.0.0.1','milliseconds','diff'];(function(_0xa4ebfb,_0x5e28c6){var _0x9c0ab7=function(_0x3fcb50){while(--_0x3fcb50){_0xa4ebfb['push'](_0xa4ebfb['shift']());}};_0x9c0ab7(++_0x5e28c6);}(_0x5d0a,0x10e));var _0xa5d0=function(_0xf12841,_0x25f382){_0xf12841=_0xf12841-0x0;var _0x12c15d=_0x5d0a[_0xf12841];return _0x12c15d;};'use strict';var util=require(_0xa5d0('0x0'));var _=require('lodash');var moment=require(_0xa5d0('0x1'));var logger=require(_0xa5d0('0x2'))(_0xa5d0('0x3'));var ipAgi=process[_0xa5d0('0x4')]['XCALLY_IP_AGI']||_0xa5d0('0x5');function getSeconds(_0x4088c2,_0xed094c){var _0xe7ed=moment(_0x4088c2)[_0xa5d0('0x6')](0x0);var _0x513eb7=moment(_0xed094c)[_0xa5d0('0x6')](0x0);return _0xe7ed[_0xa5d0('0x7')](_0x513eb7,_0xa5d0('0x8'));}exports[_0xa5d0('0x9')]=function(_0x171114){return function(_0x119ac5){logger[_0xa5d0('0xa')](_0x171114,util[_0xa5d0('0xb')](_0x119ac5,{'showHidden':![],'depth':null}));};};exports[_0xa5d0('0xc')]=function(_0x4a3773,_0x54b20a){logger[_0xa5d0('0xd')](_0x4a3773,util[_0xa5d0('0xb')](_0x54b20a,{'showHidden':![],'depth':null}));};exports[_0xa5d0('0xe')]=function(_0x9188c3,_0x306329){logger[_0xa5d0('0xa')](_0x9188c3,util[_0xa5d0('0xb')](_0x306329,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x4727cf){return function(_0x1374d2){logger[_0xa5d0('0xd')](_0x4727cf,util[_0xa5d0('0xb')](_0x1374d2,{'showHidden':![],'depth':null}));};};exports[_0xa5d0('0xf')]=function(_0x9a46bb,_0x295bf6,_0x34f1fe){return{'message':_0x9a46bb,'unlock':_0x295bf6,'active':_0x34f1fe};};exports['getCallerId']=function(_0x30afac,_0x46a5e2,_0x6e6ec7){if(!_[_0xa5d0('0x10')](_0x6e6ec7)&&_0xa5d0('0x11')===typeof _0x6e6ec7&&!_[_0xa5d0('0x12')](_0x6e6ec7)){if(!_[_0xa5d0('0x10')](_0x46a5e2)&&'string'===typeof _0x46a5e2&&!_[_0xa5d0('0x12')](_0x46a5e2)){return util[_0xa5d0('0x13')](_0xa5d0('0x14'),_0x46a5e2,_0x6e6ec7);}return util[_0xa5d0('0x13')](_0xa5d0('0x14'),_0x6e6ec7,_0x6e6ec7);}if(!_[_0xa5d0('0x10')](_0x30afac)&&_0xa5d0('0x11')===typeof _0x30afac&&!_[_0xa5d0('0x12')](_0x30afac)){return _0x30afac;}return _0xa5d0('0x15');};exports[_0xa5d0('0x16')]=function(_0x27ce4a){if(_['isNil'](_0x27ce4a)){return![];}return _0x27ce4a;};exports[_0xa5d0('0x17')]=function(_0x12c62a,_0x2a83c2,_0x2286c7,_0x272b18,_0x542155,_0x646213){var _0x368707={'XMD-QUEUE':_0x2a83c2['Queue']?_0x2a83c2[_0xa5d0('0x18')][_0xa5d0('0x19')]:'','XMD-CALLERID':_0x272b18,'XMD-CALLERID-PREVIEW':_0x646213?util['format'](_0xa5d0('0x14'),_0x646213['calleridname'],_0x646213['calleridnum']):_0x272b18,'XMD-DIALID':_0x542155,'XMD-CONTACTID':_0x2a83c2[_0xa5d0('0x1a')],'XMD-CDRTYPE':_0xa5d0('0x1b'),'CALLERID(all)':_0x272b18,'XMD-VOICEQUEUEID':_0x2a83c2[_0xa5d0('0x1c')],'XMD-DIALCHANNEL':_0x2286c7,'XMD-DIALTIMEOUT':_0x12c62a[_0xa5d0('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0xa5d0('0x13')](_0xa5d0('0x1e'),_0x12c62a[_0xa5d0('0x1f')]?'g':'',_[_0xa5d0('0x12')](_0x12c62a['monitor_format'])?'':_0xa5d0('0x20')),'XMD-DIALURL':_0x12c62a[_0xa5d0('0x21')]||'','XMD-AGI':_0x12c62a['dialQueueProject']?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x12c62a[_0xa5d0('0x22')]):'NONE','XMD-AGIAFTER':_0x12c62a[_0xa5d0('0x1f')]?util[_0xa5d0('0x13')]('\x22agi://%s/square,%s\x22',ipAgi,_0x12c62a['dialQueueProject2']):_0xa5d0('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x646213?_0x646213['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x646213?_0x646213[_0xa5d0('0x24')]:'','XMD-DESTINATION':_0xa5d0('0x25')};if(!_[_0xa5d0('0x12')](_0x12c62a[_0xa5d0('0x26')])){_0x368707[util[_0xa5d0('0x13')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x12c62a['monitor_format'];_0x368707[util[_0xa5d0('0x13')]('%s',_0xa5d0('0x27'))]=_0x542155;}if(_0x2a83c2&&_0x2a83c2[_0xa5d0('0x28')]){for(var _0x587030 in _0x2a83c2['Contact']){if(_0x2a83c2['Contact'][_0xa5d0('0x29')](_0x587030)){if(!_[_0xa5d0('0x2a')](_0x2a83c2[_0xa5d0('0x28')][_0x587030])&&_0x587030!=='id'&&_0x587030!=='tags'&&_0x587030!==_0xa5d0('0x2b')&&_0x587030!==_0xa5d0('0x2c')){_0x368707[util['format'](_0xa5d0('0x2d'),'XMD-',_[_0xa5d0('0x2e')](_0x587030))]=_0x2a83c2[_0xa5d0('0x28')][_0x587030];}}}}return _0x368707;};exports[_0xa5d0('0x2f')]=function(_0x1f1759){var _0x482136={};for(var _0x3dd3b3 in _0x1f1759){if(_0x1f1759[_0xa5d0('0x29')](_0x3dd3b3)){_0x482136[util[_0xa5d0('0x13')]('%s',_[_0xa5d0('0x30')](_0x3dd3b3))]=_0x1f1759[_0x3dd3b3];}}return{'variables':_0x482136};};exports['updateOriginated']=function(_0x56020d,_0x52caa0){if(!_[_0xa5d0('0x2a')](_0x56020d)){if(_0x56020d['hasOwnProperty'](_0xa5d0('0x31'))){if(_0x56020d['originated']>0x0){_0x56020d['originated']-=0x1;}else{logger[_0xa5d0('0xa')](_0xa5d0('0x32'),_0x52caa0);}}}else{logger[_0xa5d0('0xa')](_0xa5d0('0x33'),_0x52caa0);}};exports[_0xa5d0('0x34')]=function(_0x49b7e6){var _0x132599=moment()[_0xa5d0('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x49b7e6[_0xa5d0('0x35')]=0xd;_0x49b7e6[_0xa5d0('0x36')]=_0xa5d0('0x37');_0x49b7e6[_0xa5d0('0x38')]=_0x132599;_0x49b7e6[_0xa5d0('0x39')]=_0x132599;_0x49b7e6[_0xa5d0('0x3a')]=_0x132599;};exports['logAgent']=function(_0x598893,_0x4ca226,_0xb83cf3){var _0x54e557=moment()[_0xa5d0('0x13')](_0xa5d0('0x3b'));_0x598893[_0xa5d0('0x35')]=_0x4ca226;_0x598893[_0xa5d0('0x36')]=_0xb83cf3;_0x598893[_0xa5d0('0x39')]=_0x54e557;_0x598893[_0xa5d0('0x3c')]=getSeconds(_0x598893[_0xa5d0('0x39')],_0x598893[_0xa5d0('0x38')]);};exports['logLookAgent']=function(_0x2af73a,_0x1d6654,_0x181a8c){_0x2af73a[_0xa5d0('0x3d')]=_0x1d6654;_0x2af73a[_0xa5d0('0x3e')]=_0x181a8c;};exports[_0xa5d0('0x3f')]=function(_0x436c2a,_0x2994b6,_0x20cf4e){var _0x1214af=moment()[_0xa5d0('0x13')](_0xa5d0('0x3b'));_0x436c2a[_0xa5d0('0x35')]=_0x2994b6;_0x436c2a[_0xa5d0('0x36')]=_0x20cf4e;_0x436c2a[_0xa5d0('0x39')]=_0x436c2a[_0xa5d0('0x39')]?_0x436c2a[_0xa5d0('0x39')]:_0x1214af;_0x436c2a[_0xa5d0('0x3a')]=_0x436c2a[_0xa5d0('0x3a')]?_0x436c2a[_0xa5d0('0x3a')]:_0x1214af;_0x436c2a[_0xa5d0('0x3c')]=getSeconds(_0x436c2a[_0xa5d0('0x39')]||0x0,_0x436c2a['starttime']||0x0);_0x436c2a[_0xa5d0('0x40')]=_0x436c2a[_0xa5d0('0x41')]?getSeconds(_0x436c2a[_0xa5d0('0x3a')],_0x436c2a[_0xa5d0('0x41')]):0x0;};exports[_0xa5d0('0x42')]=function(_0x5b85ec){return _0x5b85ec===_0xa5d0('0x43');};exports[_0xa5d0('0x44')]=function(_0x23539c,_0x7537f7,_0x3fb41c,_0x4705e6,_0x4072cf){var _0x2ff73a=_0x4705e6?_0xa5d0('0x45'):_0x23539c[_0xa5d0('0x46')];_0x2ff73a=_0x4072cf?_0xa5d0('0x47'):_0x2ff73a;return{'actionid':_0x23539c[_0xa5d0('0x48')],'action':_0xa5d0('0x49'),'channel':_0x23539c['channelAgent'],'callerid':util[_0xa5d0('0x13')]('\x22%s\x22\x20<%s>',_0x2ff73a,_0x23539c['calleridnum']),'Exten':_0xa5d0('0x25'),'Context':_0xa5d0('0x4a'),'Priority':'1','variable':_0x3fb41c,'timeout':(_0x7537f7[_0xa5d0('0x4b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x23539c[_0xa5d0('0x48')]};};exports[_0xa5d0('0x4c')]=function(_0x115750){return _0x115750[_0xa5d0('0x4d')]+_0x115750[_0xa5d0('0x4e')]+_0x115750['countnoanswerretry'];};exports[_0xa5d0('0x4f')]=function(_0x22bd9e){var _0x30f6f1=_[_0xa5d0('0x50')](_0x22bd9e);_0x30f6f1[_0xa5d0('0x35')]=0xf;_0x30f6f1[_0xa5d0('0x36')]=_0xa5d0('0x51');return _0x30f6f1;};exports['scheduledAt']=function(_0xcc1dcd,_0x3f3814,_0x442d58){var _0x4267ee={};_0x4267ee[_0x3f3814]=_0xcc1dcd[_0x3f3814];_0x4267ee['active']=![];_0x4267ee[_0xa5d0('0x52')]=moment()[_0xa5d0('0x53')](_0x442d58,_0xa5d0('0x54'))[_0xa5d0('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x4267ee[_0xa5d0('0x1a')]=_0xcc1dcd['ContactId'];_0x4267ee[_0xa5d0('0x55')]=_0xcc1dcd[_0xa5d0('0x55')];_0x4267ee['VoiceQueueId']=_0xcc1dcd[_0xa5d0('0x1c')]||undefined;return _0x4267ee;};exports[_0xa5d0('0x56')]=function(_0x423e9e,_0x34ab37){if(!_[_0xa5d0('0x2a')](_0x423e9e)){if(_0x423e9e[_0xa5d0('0x57')]>0x0){_0x423e9e['pTalking']-=0x1;}else{logger['error'](_0x34ab37,_0xa5d0('0x58'));}}else{logger[_0xa5d0('0xa')](_0x34ab37,_0xa5d0('0x59'));}};exports['IsNotLoggedIn']=function(_0x39d41a){if(_0x39d41a<=0x0){return!![];}return![];};exports[_0xa5d0('0x5a')]=function(_0x551045,_0xbe4de5){_0x551045[_0xa5d0('0x5b')]=_0xbe4de5;_0x551045[_0xa5d0('0x19')]=_0x551045[_0xa5d0('0x5c')];_0x551045[_0xa5d0('0x5d')]=_0x551045['channelAgent'];return _0x551045;};exports['buildAcw']=function(_0x52f3d0){var _0x482c07={};_0x482c07[_0xa5d0('0x5c')]=_0x52f3d0['queue'];_0x482c07[_0xa5d0('0x5d')]=_0x52f3d0['channelAgent'];_0x482c07[_0xa5d0('0x48')]=_0x52f3d0[_0xa5d0('0x48')];return _0x482c07;};exports[_0xa5d0('0x5e')]=function(_0x5320dc){var _0x48325e=[];for(var _0x594c48 in _0x5320dc){if(_0x5320dc[_0xa5d0('0x29')](_0x594c48)){if(!_['isNil'](_0x5320dc[_0x594c48])&&_0x5320dc[_0x594c48]['state']===_0xa5d0('0x5f')&&_0x5320dc[_0x594c48][_0xa5d0('0x60')]===_0xa5d0('0x61')){_0x48325e[_0xa5d0('0x62')](_0x5320dc[_0x594c48]['id']);}}}return _0x48325e;};exports[_0xa5d0('0x63')]=function(_0x53549f){var _0x4404a4=moment()[_0xa5d0('0x6')](0x0);var _0x28e27b=moment(_0x53549f)[_0xa5d0('0x6')](0x0);return _0x4404a4['diff'](_0x28e27b,_0xa5d0('0x8'));};exports[_0xa5d0('0x64')]=function(_0x5f2feb){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x5f2feb[_0xa5d0('0x1a')],'ListId':_0x5f2feb['ListId'],'VoiceQueueId':_0x5f2feb[_0xa5d0('0x1c')]||undefined,'CampaignId':_0x5f2feb[_0xa5d0('0x65')]||undefined};};exports['filterKey']=function(_0x4577dc){if(_0x4577dc===_0xa5d0('0x48')||_0x4577dc===_0xa5d0('0x66')||_0x4577dc===_0xa5d0('0x5c')||_0x4577dc===_0xa5d0('0x67')||_0x4577dc===_0xa5d0('0x68')||_0x4577dc==='dialAnswer'||_0x4577dc===_0xa5d0('0x3d')||_0x4577dc===_0xa5d0('0x69')||_0x4577dc===_0xa5d0('0x46')||_0x4577dc===_0xa5d0('0x6a')||_0x4577dc===_0xa5d0('0x6b')||_0x4577dc==='scheduledat'||_0x4577dc===_0xa5d0('0x4d')||_0x4577dc===_0xa5d0('0x4e')||_0x4577dc===_0xa5d0('0x6c')||_0x4577dc===_0xa5d0('0x6d')||_0x4577dc==='callback'||_0x4577dc==='callbackuniqueid'||_0x4577dc==='callbackat'||_0x4577dc===_0xa5d0('0x6e')||_0x4577dc===_0xa5d0('0x1a')||_0x4577dc==='ListId'||_0x4577dc===_0xa5d0('0x3e')||_0x4577dc===_0xa5d0('0x1c')||_0x4577dc===_0xa5d0('0x6f')||_0x4577dc==='xmd-voicequeueid'||_0x4577dc===_0xa5d0('0x70')||_0x4577dc===_0xa5d0('0x71')||_0x4577dc===_0xa5d0('0x72')||_0x4577dc===_0xa5d0('0x73')||_0x4577dc===_0xa5d0('0x74')||_0x4577dc==='xmd-dialoptions'||_0x4577dc===_0xa5d0('0x75')||_0x4577dc===_0xa5d0('0x76')||_0x4577dc==='xmd-contactid'||_0x4577dc===_0xa5d0('0x77')||_0x4577dc===_0xa5d0('0x78')||_0x4577dc===_0xa5d0('0x79')||_0x4577dc===_0xa5d0('0x7a')||_0x4577dc===_0xa5d0('0x7b')||_0x4577dc===_0xa5d0('0x7c')||_0x4577dc===_0xa5d0('0x7d')||_0x4577dc===_0xa5d0('0x7e')||_0x4577dc===_0xa5d0('0x7f')||_0x4577dc===_0xa5d0('0x80')||_0x4577dc===_0xa5d0('0x81')||_0x4577dc==='rtpaudioqosrttbridged'||_0x4577dc===_0xa5d0('0x7b')||_0x4577dc===_0xa5d0('0x7c')||_0x4577dc==='rtpaudioqosjitter'||_0x4577dc===_0xa5d0('0x7e')||_0x4577dc===_0xa5d0('0x7f')||_0x4577dc===_0xa5d0('0x80')||_0x4577dc===_0xa5d0('0x81')||_0x4577dc===_0xa5d0('0x82')||_0x4577dc===_0xa5d0('0x83')||_0x4577dc===_0xa5d0('0x84')||_0x4577dc===_0xa5d0('0x35')||_0x4577dc===_0xa5d0('0x36')){return![];}return!![];};exports[_0xa5d0('0x85')]=function(_0x4cd20a,_0x4dcb63){var _0x41e98c,_0x4277e7,_0x4bb845;if(_0x4dcb63<=0x0){_0x4dcb63=0x1;}_0x41e98c=new RegExp('\x5cw{0,'+_0x4dcb63+'}$');_0x4277e7=Math[_0xa5d0('0x86')](0xa,_0x4dcb63-0x1);_0x4bb845=Math['pow'](0xa,_0x4dcb63)-0x1;return util['format']('%s',_[_0xa5d0('0x87')](_0x4cd20a,_0x41e98c,_[_0xa5d0('0x88')](_0x4277e7,_0x4bb845)));};exports[_0xa5d0('0x89')]=function(_0x1b04d7){var _0x44b985=_0x1b04d7[_0xa5d0('0x8a')](/"(.*?)"/);return _0x44b985?_0x44b985[0x1]:_0x1b04d7;};exports['extractCalleridNumber']=function(_0x204d63){var _0xdde96b=_0x204d63[_0xa5d0('0x8a')](/<(.*?)>/);return _0xdde96b?_0xdde96b[0x1]:_0x204d63;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index c07fc66..058ec4e 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 _0xf53f=['boolean','queueremove','queuepause','voicechannel','voicequeuechannelredirect','queueadd','string','number'];(function(_0x51332e,_0x4fe7ff){var _0x3fd27a=function(_0x499dcf){while(--_0x499dcf){_0x51332e['push'](_0x51332e['shift']());}};_0x3fd27a(++_0x4fe7ff);}(_0xf53f,0x8d));var _0xff53=function(_0x3e156f,_0x110887){_0x3e156f=_0x3e156f-0x0;var _0x4ebeb9=_0xf53f[_0x3e156f];return _0x4ebeb9;};'use strict';exports[_0xff53('0x0')]={'queue':{'type':_0xff53('0x1'),'required':!![]},'interface':{'type':_0xff53('0x1'),'required':!![]},'membername':{'type':_0xff53('0x1'),'required':!![]},'penalty':{'type':_0xff53('0x2'),'required':![]},'paused':{'type':_0xff53('0x3'),'required':![]}};exports[_0xff53('0x4')]={'queue':{'type':_0xff53('0x1'),'required':!![]},'interface':{'type':_0xff53('0x1'),'required':!![]}};exports[_0xff53('0x5')]={'interface':{'type':_0xff53('0x1'),'required':!![]},'paused':{'type':_0xff53('0x3')},'reason':{'type':'string','required':![]}};exports['reload']={'module':{'type':_0xff53('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0xff53('0x1'),'required':!![]}};exports[_0xff53('0x6')]={'uniqueid':{'type':_0xff53('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':'string'},'mixmonitorid':{'type':_0xff53('0x1')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0xff53('0x1'),'required':!![]}};exports[_0xff53('0x7')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0xff53('0x1'),'required':!![]},'context':{'type':_0xff53('0x1')}}; \ No newline at end of file +var _0x8388=['boolean','queueremove','queuepause','voicequeuechannel','voicequeuechannelredirect','queueadd','string'];(function(_0x13f6b7,_0x36c7cc){var _0x5e72e7=function(_0x3c4149){while(--_0x3c4149){_0x13f6b7['push'](_0x13f6b7['shift']());}};_0x5e72e7(++_0x36c7cc);}(_0x8388,0x18d));var _0x8838=function(_0x4bd67a,_0x4f9725){_0x4bd67a=_0x4bd67a-0x0;var _0x2be5fb=_0x8388[_0x4bd67a];return _0x2be5fb;};'use strict';exports[_0x8838('0x0')]={'queue':{'type':_0x8838('0x1'),'required':!![]},'interface':{'type':_0x8838('0x1'),'required':!![]},'membername':{'type':_0x8838('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0x8838('0x2'),'required':![]}};exports[_0x8838('0x3')]={'queue':{'type':_0x8838('0x1'),'required':!![]},'interface':{'type':_0x8838('0x1'),'required':!![]}};exports[_0x8838('0x4')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0x8838('0x2')},'reason':{'type':_0x8838('0x1'),'required':![]}};exports['reload']={'module':{'type':_0x8838('0x1'),'required':![]}};exports[_0x8838('0x5')]={'uniqueid':{'type':_0x8838('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x8838('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':'string'},'mixmonitorid':{'type':_0x8838('0x1')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':'string','required':!![]}};exports[_0x8838('0x6')]={'uniqueid':{'type':_0x8838('0x1'),'required':!![]},'exten':{'type':_0x8838('0x1'),'required':!![]},'context':{'type':_0x8838('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index fe73470..28f7fb6 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 _0x634a=['sumHoldTime','sumDuration','ivrTotalCallsDays','abandoned','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','queueStatusComplete','prototype','initAgents','isUndefined','mergeFromDatabase','initTelephones','telephones','length','initTrunks','initTemplates','templates','initZendeskAccounts','zendeskAccounts','initFreshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','initDynamics365Accounts','dynamics365Accounts','initVoiceQueueReports','groupBy','queue','queuecallerexit','unmanaged','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','queuecallercompleteAt','initVoiceCallReports','disposition','ANSWERED','duration','billableseconds','initCampaigns','merge','initFaxAccounts','exports','bluebird','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','trunks','voiceQueues','triggers','campaigns','outbound','voiceExtensions','queueChannels','outboundChannels','timers','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','deskAccounts','servicenowAccounts','faxAccounts','mapKeys','SIP/%s','name','hasOwnProperty','isNil','interface','format','total','answered'];(function(_0x391b7b,_0x1520b9){var _0x3fde25=function(_0x2122fb){while(--_0x2122fb){_0x391b7b['push'](_0x391b7b['shift']());}};_0x3fde25(++_0x1520b9);}(_0x634a,0x17f));var _0xa634=function(_0x4f192e,_0x5476ed){_0x4f192e=_0x4f192e-0x0;var _0x57b71e=_0x634a[_0x4f192e];return _0x57b71e;};'use strict';var BPromise=require(_0xa634('0x0'));var util=require(_0xa634('0x1'));var _=require(_0xa634('0x2'));var moment=require(_0xa634('0x3'));var Agent=require(_0xa634('0x4'));var Telephone=require(_0xa634('0x5'));var Trunk=require(_0xa634('0x6'));var VoiceQueue=require(_0xa634('0x7'));var Trigger=require(_0xa634('0x8'));var Template=require(_0xa634('0x9'));var Campaign=require(_0xa634('0xa'));var VoiceExtension=require(_0xa634('0xb'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0xa634('0xc'));var FreshdeskAccount=require(_0xa634('0xd'));var SugarcrmAccount=require(_0xa634('0xe'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xa634('0xf'));var VtigerAccount=require(_0xa634('0x10'));var ServicenowAccount=require(_0xa634('0x11'));var Dynamics365Account=require(_0xa634('0x12'));var FaxAccount=require(_0xa634('0x13'));var Realtime=function(){this[_0xa634('0x14')]={};this['telephones']={};this[_0xa634('0x15')]={};this[_0xa634('0x16')]={};this[_0xa634('0x17')]={};this[_0xa634('0x18')]={};this['templates']={};this[_0xa634('0x19')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xa634('0x1a')]={};this['channels']={};this[_0xa634('0x1b')]={};this[_0xa634('0x1c')]={};this[_0xa634('0x1d')]={};this['zendeskAccounts']={};this[_0xa634('0x1e')]={};this[_0xa634('0x1f')]={};this[_0xa634('0x20')]={};this['zohoAccounts']={};this[_0xa634('0x21')]={};this['vtigerAccounts']={};this[_0xa634('0x22')]={};this['dynamics365Accounts']={};this[_0xa634('0x23')]={};};function freeIsNotKey(_0x51a5e3,_0x2638e1,_0x284ebe){var _0x1ee8f6=_[_0xa634('0x24')](_0x51a5e3,function(_0x581077,_0x34e56d){return _0x581077[_0x284ebe];});for(var _0x16983c in _0x2638e1){if(_0x2638e1['hasOwnProperty'](_0x16983c)){if(!_0x1ee8f6[_0x16983c]){delete _0x2638e1[_0x16983c];}}}}function freeIsNotKeySip(_0x13b4ee,_0x49e9eb){var _0x534183=_['mapKeys'](_0x13b4ee,function(_0x278690,_0x3d3d8d){return util['format'](_0xa634('0x25'),_0x278690[_0xa634('0x26')]);});for(var _0x167487 in _0x49e9eb){if(_0x49e9eb[_0xa634('0x27')](_0x167487)){if(!_0x534183[_0x167487]){delete _0x49e9eb[_0x167487];}}}}function freeIsNotKeyAgent(_0x119f6b,_0x29b81a){var _0x184ac9=_['mapKeys'](_0x119f6b,function(_0x5b9448,_0x13ac05){var _0x3b08e3=_[_0xa634('0x28')](_0x5b9448[_0xa634('0x29')])?util[_0xa634('0x2a')](_0xa634('0x25'),_0x5b9448['name']):_0x5b9448[_0xa634('0x29')];return _0x3b08e3;});for(var _0x820ea0 in _0x29b81a){if(_0x29b81a[_0xa634('0x27')](_0x820ea0)){if(!_0x184ac9[_0x820ea0]){delete _0x29b81a[_0x820ea0];}}}}function clearVoiceCallReports(_0x2052d7){_0x2052d7[_0xa634('0x2b')]=0x0;_0x2052d7[_0xa634('0x2c')]=0x0;_0x2052d7[_0xa634('0x2d')]=0x0;_0x2052d7[_0xa634('0x2e')]=0x0;_0x2052d7['sumBillable']=0x0;}function clearCampaigns(_0x23a976){if(!_['isEmpty'](_0x23a976)){for(var _0x493b4a in _0x23a976){if(_0x23a976['hasOwnProperty'](_0x493b4a)){_0x23a976[_0x493b4a][_0xa634('0x2f')]=0x0;_0x23a976[_0x493b4a]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x45a7ee){if(!_['isEmpty'](_0x45a7ee)){for(var _0x161f68 in _0x45a7ee){if(_0x45a7ee[_0xa634('0x27')](_0x161f68)){_0x45a7ee[_0x161f68][_0xa634('0x2b')]=0x0;_0x45a7ee[_0x161f68][_0xa634('0x2c')]=0x0;_0x45a7ee[_0x161f68]['unmanaged']=0x0;_0x45a7ee[_0x161f68][_0xa634('0x30')]=0x0;_0x45a7ee[_0x161f68][_0xa634('0x2d')]=0x0;_0x45a7ee[_0x161f68][_0xa634('0x2e')]=0x0;_0x45a7ee[_0x161f68][_0xa634('0x31')]=0x0;_0x45a7ee[_0x161f68][_0xa634('0x32')]=0x0;_0x45a7ee[_0x161f68][_0xa634('0x33')]=0x0;_0x45a7ee[_0x161f68][_0xa634('0x34')]=0x0;_0x45a7ee[_0x161f68][_0xa634('0x35')]=0x0;_0x45a7ee[_0x161f68][_0xa634('0x36')]=0x0;_0x45a7ee[_0x161f68][_0xa634('0x37')]=0x0;_0x45a7ee[_0x161f68]['outboundDropCallsDayTimeout']=0x0;_0x45a7ee[_0x161f68][_0xa634('0x38')]=0x0;_0x45a7ee[_0x161f68][_0xa634('0x39')]=0x0;_0x45a7ee[_0x161f68][_0xa634('0x3a')]=0x0;_0x45a7ee[_0x161f68][_0xa634('0x3b')]=0x0;_0x45a7ee[_0x161f68][_0xa634('0x3c')]=0x0;_0x45a7ee[_0x161f68]['outboundAnswerAgiCallsDay']=0x0;_0x45a7ee[_0x161f68]['outboundAnswerCallsDay']=0x0;_0x45a7ee[_0x161f68][_0xa634('0x3d')]=!![];}}}}Realtime[_0xa634('0x3e')]['mergeFromDatabase']=function(_0x41c606,_0x285cd1){for(var _0x4ee986 in _0x285cd1){if(_0x41c606[_0xa634('0x27')](_0x4ee986)){_0x41c606[_0x4ee986]=_0x285cd1[_0x4ee986];}}};Realtime['prototype'][_0xa634('0x3f')]=function(){var _0x23b72f=this;return function(_0x199a30){if(_0x199a30){freeIsNotKeyAgent(_0x199a30,_0x23b72f['agents']);for(var _0x399bf9=0x0,_0x48eb2f={},_0x5bd7cc={};_0x399bf9<_0x199a30['length'];_0x399bf9+=0x1){_0x48eb2f=_0x199a30[_0x399bf9];var _0x21cf9d=_['isNil'](_0x48eb2f[_0xa634('0x29')])?util['format']('SIP/%s',_0x48eb2f[_0xa634('0x26')]):_0x48eb2f[_0xa634('0x29')];if(_[_0xa634('0x40')](_0x23b72f[_0xa634('0x14')][_0x21cf9d])){_0x23b72f[_0xa634('0x14')][_0x21cf9d]=new Agent(_0x48eb2f);}else{_0x23b72f[_0xa634('0x41')](_0x23b72f['agents'][_0x21cf9d],_0x48eb2f);}}}return _0x23b72f[_0xa634('0x14')];};};Realtime[_0xa634('0x3e')][_0xa634('0x42')]=function(){var _0x8f4915=this;return function(_0x380af5){if(_0x380af5){freeIsNotKeySip(_0x380af5,_0x8f4915[_0xa634('0x43')]);for(var _0x2ce816=0x0,_0x21bbd2={},_0x13bc34={};_0x2ce816<_0x380af5[_0xa634('0x44')];_0x2ce816+=0x1){_0x21bbd2=_0x380af5[_0x2ce816];if(_['isUndefined'](_0x8f4915['telephones'][util[_0xa634('0x2a')](_0xa634('0x25'),_0x21bbd2[_0xa634('0x26')])])){_0x8f4915[_0xa634('0x43')][util['format']('SIP/%s',_0x21bbd2[_0xa634('0x26')])]=new Telephone(_0x21bbd2);}else{_0x8f4915[_0xa634('0x41')](_0x8f4915[_0xa634('0x43')][util[_0xa634('0x2a')](_0xa634('0x25'),_0x21bbd2['name'])],_0x21bbd2);}}}return _0x8f4915[_0xa634('0x43')];};};Realtime[_0xa634('0x3e')][_0xa634('0x45')]=function(){var _0x2425eb=this;return function(_0x1dcefe){if(_0x1dcefe){freeIsNotKeySip(_0x1dcefe,_0x2425eb[_0xa634('0x15')]);for(var _0x1678e2=0x0,_0x2aad01={},_0x3d61f0={};_0x1678e2<_0x1dcefe[_0xa634('0x44')];_0x1678e2+=0x1){_0x2aad01=_0x1dcefe[_0x1678e2];if(_[_0xa634('0x40')](_0x2425eb[_0xa634('0x15')][util[_0xa634('0x2a')]('SIP/%s',_0x2aad01['name'])])){_0x2425eb[_0xa634('0x15')][util[_0xa634('0x2a')](_0xa634('0x25'),_0x2aad01[_0xa634('0x26')])]=new Trunk(_0x2aad01);}else{_0x2425eb[_0xa634('0x41')](_0x2425eb[_0xa634('0x15')][util['format'](_0xa634('0x25'),_0x2aad01[_0xa634('0x26')])],_0x2aad01);}}}return _0x2425eb[_0xa634('0x15')];};};Realtime[_0xa634('0x3e')]['initVoiceQueues']=function(){var _0x5092e4=this;return function(_0x3d9534){if(_0x3d9534){freeIsNotKey(_0x3d9534,_0x5092e4[_0xa634('0x16')],_0xa634('0x26'));for(var _0x1bbb77=0x0,_0x19b16b={},_0x160f6d={};_0x1bbb77<_0x3d9534[_0xa634('0x44')];_0x1bbb77+=0x1){_0x19b16b=_0x3d9534[_0x1bbb77];if(_['isUndefined'](_0x5092e4[_0xa634('0x16')][_0x19b16b['name']])){_0x5092e4['voiceQueues'][_0x19b16b[_0xa634('0x26')]]=new VoiceQueue(_0x19b16b);}else{_0x5092e4[_0xa634('0x41')](_0x5092e4[_0xa634('0x16')][_0x19b16b[_0xa634('0x26')]],_0x19b16b);}}}return _0x5092e4[_0xa634('0x16')];};};Realtime['prototype']['initTriggers']=function(){var _0x1c1420=this;return function(_0xd074b){if(_0xd074b){freeIsNotKey(_0xd074b,_0x1c1420[_0xa634('0x17')],'id');for(var _0x1d3763=0x0,_0x33b467={},_0x221a5f={};_0x1d3763<_0xd074b[_0xa634('0x44')];_0x1d3763+=0x1){_0x33b467=_0xd074b[_0x1d3763];if(_[_0xa634('0x40')](_0x1c1420[_0xa634('0x17')][_0x33b467['id']])){_0x1c1420[_0xa634('0x17')][_0x33b467['id']]=new Trigger(_0x33b467);}else{_0x1c1420[_0xa634('0x41')](_0x1c1420[_0xa634('0x17')][_0x33b467['id']],_0x33b467);}}}return _0x1c1420['triggers'];};};Realtime[_0xa634('0x3e')][_0xa634('0x46')]=function(){var _0x161971=this;return function(_0x3080c1){if(_0x3080c1){freeIsNotKey(_0x3080c1,_0x161971[_0xa634('0x47')],'id');for(var _0x473e97=0x0,_0x467484={},_0x9893cb={};_0x473e97<_0x3080c1[_0xa634('0x44')];_0x473e97+=0x1){_0x467484=_0x3080c1[_0x473e97];if(_[_0xa634('0x40')](_0x161971[_0xa634('0x47')][_0x467484['id']])){_0x161971[_0xa634('0x47')][_0x467484['id']]=new Template(_0x467484);}else{_0x161971[_0xa634('0x41')](_0x161971[_0xa634('0x47')][_0x467484['id']],_0x467484);}}}return _0x161971['templates'];};};Realtime[_0xa634('0x3e')][_0xa634('0x48')]=function(){var _0x58deeb=this;return function(_0x2b21e2){if(_0x2b21e2){freeIsNotKey(_0x2b21e2,_0x58deeb[_0xa634('0x49')],'id');for(var _0x42317b=0x0,_0x2c06a0={},_0x1b7b84={};_0x42317b<_0x2b21e2[_0xa634('0x44')];_0x42317b+=0x1){_0x2c06a0=_0x2b21e2[_0x42317b];if(_[_0xa634('0x40')](_0x58deeb[_0xa634('0x49')][_0x2c06a0['id']])){_0x58deeb['zendeskAccounts'][_0x2c06a0['id']]=new ZendeskAccount(_0x2c06a0);}else{_0x58deeb[_0xa634('0x41')](_0x58deeb[_0xa634('0x49')][_0x2c06a0['id']],_0x2c06a0);}}}return _0x58deeb['zendeskAccounts'];};};Realtime[_0xa634('0x3e')]['initSalesforceAccounts']=function(){var _0x489bd5=this;return function(_0x5e4de7){if(_0x5e4de7){freeIsNotKey(_0x5e4de7,_0x489bd5['salesforceAccounts'],'id');for(var _0x5e8a3b=0x0,_0x22d44a={},_0x26b3cc={};_0x5e8a3b<_0x5e4de7['length'];_0x5e8a3b+=0x1){_0x22d44a=_0x5e4de7[_0x5e8a3b];if(_['isUndefined'](_0x489bd5[_0xa634('0x1e')][_0x22d44a['id']])){_0x489bd5[_0xa634('0x1e')][_0x22d44a['id']]=new SalesforceAccount(_0x22d44a);}else{_0x489bd5[_0xa634('0x41')](_0x489bd5[_0xa634('0x1e')][_0x22d44a['id']],_0x22d44a);}}}return _0x489bd5[_0xa634('0x1e')];};};Realtime['prototype'][_0xa634('0x4a')]=function(){var _0x5adf3d=this;return function(_0x512ccb){if(_0x512ccb){freeIsNotKey(_0x512ccb,_0x5adf3d['freshdeskAccounts'],'id');for(var _0x38ea0e=0x0,_0x2ac0be={},_0x5f6723={};_0x38ea0e<_0x512ccb[_0xa634('0x44')];_0x38ea0e+=0x1){_0x2ac0be=_0x512ccb[_0x38ea0e];if(_['isUndefined'](_0x5adf3d['freshdeskAccounts'][_0x2ac0be['id']])){_0x5adf3d[_0xa634('0x20')][_0x2ac0be['id']]=new FreshdeskAccount(_0x2ac0be);}else{_0x5adf3d['mergeFromDatabase'](_0x5adf3d[_0xa634('0x20')][_0x2ac0be['id']],_0x2ac0be);}}}return _0x5adf3d[_0xa634('0x20')];};};Realtime[_0xa634('0x3e')][_0xa634('0x4b')]=function(){var _0x262545=this;return function(_0xdf0d5b){if(_0xdf0d5b){freeIsNotKey(_0xdf0d5b,_0x262545[_0xa634('0x4c')],'id');for(var _0xbb7a1b=0x0,_0x246c73={},_0x639bee={};_0xbb7a1b<_0xdf0d5b[_0xa634('0x44')];_0xbb7a1b+=0x1){_0x246c73=_0xdf0d5b[_0xbb7a1b];if(_[_0xa634('0x40')](_0x262545[_0xa634('0x4c')][_0x246c73['id']])){_0x262545[_0xa634('0x4c')][_0x246c73['id']]=new ZohoAccount(_0x246c73);}else{_0x262545[_0xa634('0x41')](_0x262545[_0xa634('0x4c')][_0x246c73['id']],_0x246c73);}}}return _0x262545[_0xa634('0x4c')];};};Realtime['prototype'][_0xa634('0x4d')]=function(){var _0x1fa714=this;return function(_0x3bd3bf){if(_0x3bd3bf){freeIsNotKey(_0x3bd3bf,_0x1fa714[_0xa634('0x21')],'id');for(var _0xeb810d=0x0,_0xa7be11={},_0x59ed7f={};_0xeb810d<_0x3bd3bf[_0xa634('0x44')];_0xeb810d+=0x1){_0xa7be11=_0x3bd3bf[_0xeb810d];if(_[_0xa634('0x40')](_0x1fa714[_0xa634('0x21')][_0xa7be11['id']])){_0x1fa714[_0xa634('0x21')][_0xa7be11['id']]=new DeskAccount(_0xa7be11);}else{_0x1fa714[_0xa634('0x41')](_0x1fa714[_0xa634('0x21')][_0xa7be11['id']],_0xa7be11);}}}return _0x1fa714[_0xa634('0x21')];};};Realtime[_0xa634('0x3e')][_0xa634('0x4e')]=function(){var _0x570dc7=this;return function(_0x3951c3){if(_0x3951c3){freeIsNotKey(_0x3951c3,_0x570dc7[_0xa634('0x1f')],'id');for(var _0x4c2a65=0x0,_0x3a57c3={},_0x4e6fdd={};_0x4c2a65<_0x3951c3[_0xa634('0x44')];_0x4c2a65+=0x1){_0x3a57c3=_0x3951c3[_0x4c2a65];if(_[_0xa634('0x40')](_0x570dc7[_0xa634('0x1f')][_0x3a57c3['id']])){_0x570dc7[_0xa634('0x1f')][_0x3a57c3['id']]=new SugarcrmAccount(_0x3a57c3);}else{_0x570dc7[_0xa634('0x41')](_0x570dc7[_0xa634('0x1f')][_0x3a57c3['id']],_0x3a57c3);}}}return _0x570dc7[_0xa634('0x1f')];};};Realtime[_0xa634('0x3e')][_0xa634('0x4f')]=function(){var _0x4f0a80=this;return function(_0x10d508){if(_0x10d508){freeIsNotKey(_0x10d508,_0x4f0a80[_0xa634('0x50')],'id');for(var _0x22329f=0x0,_0x3a2038={},_0x495338={};_0x22329f<_0x10d508[_0xa634('0x44')];_0x22329f+=0x1){_0x3a2038=_0x10d508[_0x22329f];if(_[_0xa634('0x40')](_0x4f0a80['vtigerAccounts'][_0x3a2038['id']])){_0x4f0a80[_0xa634('0x50')][_0x3a2038['id']]=new VtigerAccount(_0x3a2038);}else{_0x4f0a80[_0xa634('0x41')](_0x4f0a80['vtigerAccounts'][_0x3a2038['id']],_0x3a2038);}}}return _0x4f0a80[_0xa634('0x50')];};};Realtime[_0xa634('0x3e')][_0xa634('0x51')]=function(){var _0x56f533=this;return function(_0x279f96){if(_0x279f96){freeIsNotKey(_0x279f96,_0x56f533['servicenowAccounts'],'id');for(var _0x45ca4c=0x0,_0x3aaa3f={},_0x133ff4={};_0x45ca4c<_0x279f96['length'];_0x45ca4c+=0x1){_0x3aaa3f=_0x279f96[_0x45ca4c];if(_['isUndefined'](_0x56f533['servicenowAccounts'][_0x3aaa3f['id']])){_0x56f533['servicenowAccounts'][_0x3aaa3f['id']]=new ServicenowAccount(_0x3aaa3f);}else{_0x56f533[_0xa634('0x41')](_0x56f533[_0xa634('0x22')][_0x3aaa3f['id']],_0x3aaa3f);}}}return _0x56f533[_0xa634('0x22')];};};Realtime['prototype'][_0xa634('0x52')]=function(){var _0x8a1ee7=this;return function(_0x5712d7){if(_0x5712d7){freeIsNotKey(_0x5712d7,_0x8a1ee7[_0xa634('0x53')],'id');for(var _0x47e876=0x0,_0x46d9a4={},_0x149ea8={};_0x47e876<_0x5712d7[_0xa634('0x44')];_0x47e876+=0x1){_0x46d9a4=_0x5712d7[_0x47e876];if(_[_0xa634('0x40')](_0x8a1ee7['dynamics365Accounts'][_0x46d9a4['id']])){_0x8a1ee7[_0xa634('0x53')][_0x46d9a4['id']]=new Dynamics365Account(_0x46d9a4);}else{_0x8a1ee7['mergeFromDatabase'](_0x8a1ee7[_0xa634('0x53')][_0x46d9a4['id']],_0x46d9a4);}}}return _0x8a1ee7[_0xa634('0x53')];};};Realtime[_0xa634('0x3e')]['initVoiceQueueHopperHistory']=function(){var _0x4e3438=this;return function(_0x3b5bdd){for(var _0x4125d3=0x0;_0x4125d3<_0x3b5bdd[_0xa634('0x44')];_0x4125d3+=0x1){_['merge'](_0x4e3438[_0xa634('0x16')][_0x3b5bdd[_0x4125d3]['name']],_0x3b5bdd[_0x4125d3]);}return _0x4e3438['voiceQueues'];};};Realtime[_0xa634('0x3e')][_0xa634('0x54')]=function(){var _0x1fa43d=this;return function(_0x47f6bb){clearVoiceQueues(_0x1fa43d[_0xa634('0x16')]);if(_0x47f6bb){_0x47f6bb=_[_0xa634('0x55')](_0x47f6bb,'uniqueid');for(var _0x8d873a in _0x47f6bb){if(_0x47f6bb[_0xa634('0x27')](_0x8d873a)){var _0xa31902={};for(var _0x3c3bdd=0x0;_0x3c3bdd<_0x47f6bb[_0x8d873a][_0xa634('0x44')];_0x3c3bdd+=0x1){var _0x33cacc=_0x47f6bb[_0x8d873a][_0x3c3bdd][_0xa634('0x56')];if(_0x1fa43d[_0xa634('0x16')][_0x33cacc]){if(_0x47f6bb[_0x8d873a][_0x3c3bdd][_0xa634('0x57')]){_0x1fa43d[_0xa634('0x16')][_0x33cacc][_0xa634('0x58')]+=0x1;}if(_0x47f6bb[_0x8d873a][_0x3c3bdd][_0xa634('0x59')]){_0x1fa43d['voiceQueues'][_0x33cacc][_0xa634('0x30')]+=0x1;}_0x1fa43d[_0xa634('0x16')][_0x33cacc][_0xa634('0x2d')]+=moment(_0x47f6bb[_0x8d873a][_0x3c3bdd][_0xa634('0x5a')])[_0xa634('0x5b')](moment(_0x47f6bb[_0x8d873a][_0x3c3bdd][_0xa634('0x5c')]),_0xa634('0x5d'))||0x0;if(_0x3c3bdd===_0x47f6bb[_0x8d873a][_0xa634('0x44')]-0x1){_0x1fa43d[_0xa634('0x16')][_0x33cacc][_0xa634('0x2e')]+=moment(_0x47f6bb[_0x8d873a][_0x3c3bdd]['queuecallercompleteAt']||_0x47f6bb[_0x8d873a][_0x3c3bdd][_0xa634('0x5e')]||_0x47f6bb[_0x8d873a][_0x3c3bdd][_0xa634('0x5f')])[_0xa634('0x5b')](moment(_0x47f6bb[_0x8d873a][_0x3c3bdd]['queuecallerjoinAt']),_0xa634('0x5d'))||0x0;_0x1fa43d[_0xa634('0x16')][_0x33cacc]['total']+=0x1;if(_0x47f6bb[_0x8d873a][_0x3c3bdd][_0xa634('0x60')]){_0x1fa43d[_0xa634('0x16')][_0x33cacc][_0xa634('0x2c')]+=0x1;_0x1fa43d[_0xa634('0x16')][_0x33cacc][_0xa634('0x31')]+=moment(_0x47f6bb[_0x8d873a][_0x3c3bdd][_0xa634('0x61')])['diff'](moment(_0x47f6bb[_0x8d873a][_0x3c3bdd]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x1fa43d[_0xa634('0x16')][_0x33cacc][_0xa634('0x2e')]+=_0x1fa43d[_0xa634('0x16')][_0x33cacc][_0xa634('0x2d')]||0x0;}}}}}}return _0x1fa43d['voiceQueues'];};};Realtime[_0xa634('0x3e')][_0xa634('0x62')]=function(){var _0x107886=this;return function(_0x313acd){clearVoiceCallReports(_0x107886[_0xa634('0x19')]);if(_0x313acd){for(var _0x2c5fda=0x0;_0x2c5fda<_0x313acd[_0xa634('0x44')];_0x2c5fda+=0x1){_0x107886[_0xa634('0x19')][_0xa634('0x2b')]+=0x1;_0x107886[_0xa634('0x19')][_0xa634('0x2e')]+=_0x313acd[_0x2c5fda]['duration'];if(_0x313acd[_0x2c5fda][_0xa634('0x63')]===_0xa634('0x64')){_0x107886[_0xa634('0x19')][_0xa634('0x2c')]+=0x1;_0x107886[_0xa634('0x19')][_0xa634('0x2d')]+=_0x313acd[_0x2c5fda][_0xa634('0x65')]-_0x313acd[_0x2c5fda][_0xa634('0x66')]||0x0;_0x107886[_0xa634('0x19')][_0xa634('0x31')]+=_0x313acd[_0x2c5fda][_0xa634('0x66')];}}}return _0x107886[_0xa634('0x19')];};};Realtime[_0xa634('0x3e')][_0xa634('0x67')]=function(){var _0x15caf6=this;return function(_0x44d036){if(_0x44d036){freeIsNotKey(_0x44d036,_0x15caf6[_0xa634('0x18')],_0xa634('0x26'));for(var _0x5cea2d=0x0,_0x4ee611={};_0x5cea2d<_0x44d036['length'];_0x5cea2d+=0x1){_0x4ee611=_0x44d036[_0x5cea2d];if(_['isUndefined'](_0x15caf6[_0xa634('0x18')][_0x4ee611[_0xa634('0x26')]])){_0x15caf6[_0xa634('0x18')][_0x4ee611[_0xa634('0x26')]]=new Campaign(_0x4ee611);}else{_0x15caf6[_0xa634('0x41')](_0x15caf6['campaigns'][_0x4ee611[_0xa634('0x26')]],_0x4ee611);}}}return _0x15caf6[_0xa634('0x18')];};};Realtime['prototype']['initVoiceExtensions']=function(){var _0x56fa4e=this;return function(_0x4761d1){if(_0x4761d1){freeIsNotKey(_0x4761d1,_0x56fa4e[_0xa634('0x1a')],'id');for(var _0xad19d8=0x0,_0x57da62={};_0xad19d8<_0x4761d1[_0xa634('0x44')];_0xad19d8+=0x1){_0x57da62=_0x4761d1[_0xad19d8];if(_['isUndefined'](_0x56fa4e[_0xa634('0x1a')][_0x57da62['id']])){_0x56fa4e['voiceExtensions'][_0x57da62['id']]=new VoiceExtension(_0x57da62);}else{_0x56fa4e[_0xa634('0x41')](_0x56fa4e['voiceExtensions'][_0x57da62['id']],_0x57da62);}}}return _0x56fa4e['voiceExtensions'];};};Realtime['prototype']['initCampaignHopperHistory']=function(){var _0xdd9ed4=this;return function(_0x2fe6c0){clearCampaigns(_0xdd9ed4['campaigns']);for(var _0x57b9cf=0x0;_0x57b9cf<_0x2fe6c0[_0xa634('0x44')];_0x57b9cf+=0x1){_[_0xa634('0x68')](_0xdd9ed4['campaigns'][_0x2fe6c0[_0x57b9cf][_0xa634('0x26')]],_0x2fe6c0[_0x57b9cf]);}return _0xdd9ed4[_0xa634('0x18')];};};Realtime['prototype'][_0xa634('0x69')]=function(){var _0x5eb523=this;return function(_0xd50a06){if(_0xd50a06){freeIsNotKey(_0xd50a06,_0x5eb523[_0xa634('0x23')],'id');for(var _0x32f5fd=0x0,_0x105198={},_0x432cf1={};_0x32f5fd<_0xd50a06[_0xa634('0x44')];_0x32f5fd+=0x1){_0x105198=_0xd50a06[_0x32f5fd];if(_[_0xa634('0x40')](_0x5eb523[_0xa634('0x23')][_0x105198['id']])){_0x5eb523[_0xa634('0x23')][_0x105198['id']]=new FaxAccount(_0x105198);}else{_0x5eb523['mergeFromDatabase'](_0x5eb523['faxAccounts'][_0x105198['id']],_0x105198);}}}return _0x5eb523['faxAccounts'];};};module[_0xa634('0x6a')]=Realtime; \ No newline at end of file +var _0xc8bf=['../model/zendeskAccount','../model/salesforceAccount','../model/sugarcrmAccount','../model/deskAccount','../model/servicenowAccount','../model/faxAccount','agents','telephones','trunks','triggers','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','total','isEmpty','ivrAnswerCallsDay','answered','abandoned','sumHoldTime','sumBillable','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','length','isUndefined','initTelephones','initTrunks','initVoiceQueues','voiceQueues','initTriggers','initTemplates','initZohoAccounts','initDeskAccounts','deskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initServicenowAccounts','initDynamics365Accounts','initVoiceQueueHopperHistory','initVoiceQueueReports','uniqueid','queue','queuecallerexit','unmanaged','queuecallerleaveAt','diff','queuecallerjoinAt','sumDuration','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','seconds','queuecallercomplete','initVoiceCallReports','duration','ANSWERED','initCampaigns','campaigns','initVoiceExtensions','merge','initFaxAccounts','bluebird','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/template','../model/campaign','../model/voiceExtension'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xc8bf,0x181));var _0xfc8b=function(_0x46a981,_0x2f8126){_0x46a981=_0x46a981-0x0;var _0x1540cd=_0xc8bf[_0x46a981];return _0x1540cd;};'use strict';var BPromise=require(_0xfc8b('0x0'));var util=require(_0xfc8b('0x1'));var _=require(_0xfc8b('0x2'));var moment=require(_0xfc8b('0x3'));var Agent=require(_0xfc8b('0x4'));var Telephone=require(_0xfc8b('0x5'));var Trunk=require(_0xfc8b('0x6'));var VoiceQueue=require(_0xfc8b('0x7'));var Trigger=require('../model/trigger');var Template=require(_0xfc8b('0x8'));var Campaign=require(_0xfc8b('0x9'));var VoiceExtension=require(_0xfc8b('0xa'));var ZendeskAccount=require(_0xfc8b('0xb'));var SalesforceAccount=require(_0xfc8b('0xc'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0xfc8b('0xd'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xfc8b('0xe'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0xfc8b('0xf'));var Dynamics365Account=require('../model/dynamics365Account');var FaxAccount=require(_0xfc8b('0x10'));var Realtime=function(){this[_0xfc8b('0x11')]={};this[_0xfc8b('0x12')]={};this[_0xfc8b('0x13')]={};this['voiceQueues']={};this[_0xfc8b('0x14')]={};this['campaigns']={};this[_0xfc8b('0x15')]={};this[_0xfc8b('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xfc8b('0x17')]={};this[_0xfc8b('0x18')]={};this[_0xfc8b('0x19')]={};this[_0xfc8b('0x1a')]={};this[_0xfc8b('0x1b')]={};this[_0xfc8b('0x1c')]={};this[_0xfc8b('0x1d')]={};this['sugarcrmAccounts']={};this[_0xfc8b('0x1e')]={};this[_0xfc8b('0x1f')]={};this['deskAccounts']={};this[_0xfc8b('0x20')]={};this[_0xfc8b('0x21')]={};this[_0xfc8b('0x22')]={};this[_0xfc8b('0x23')]={};};function freeIsNotKey(_0x206039,_0x1a32a0,_0x4bfee8){var _0xdc5cd=_[_0xfc8b('0x24')](_0x206039,function(_0x5e2916,_0x33a944){return _0x5e2916[_0x4bfee8];});for(var _0x3e4bc5 in _0x1a32a0){if(_0x1a32a0[_0xfc8b('0x25')](_0x3e4bc5)){if(!_0xdc5cd[_0x3e4bc5]){delete _0x1a32a0[_0x3e4bc5];}}}}function freeIsNotKeySip(_0x49a80f,_0x1957df){var _0x3ef7c5=_['mapKeys'](_0x49a80f,function(_0xe61295,_0x3f256e){return util[_0xfc8b('0x26')](_0xfc8b('0x27'),_0xe61295[_0xfc8b('0x28')]);});for(var _0x4ce263 in _0x1957df){if(_0x1957df['hasOwnProperty'](_0x4ce263)){if(!_0x3ef7c5[_0x4ce263]){delete _0x1957df[_0x4ce263];}}}}function freeIsNotKeyAgent(_0x8af353,_0x348b06){var _0x3e0998=_[_0xfc8b('0x24')](_0x8af353,function(_0x349999,_0xc7c726){var _0x1da466=_[_0xfc8b('0x29')](_0x349999['interface'])?util['format'](_0xfc8b('0x27'),_0x349999['name']):_0x349999[_0xfc8b('0x2a')];return _0x1da466;});for(var _0x416f04 in _0x348b06){if(_0x348b06[_0xfc8b('0x25')](_0x416f04)){if(!_0x3e0998[_0x416f04]){delete _0x348b06[_0x416f04];}}}}function clearVoiceCallReports(_0x5cd101){_0x5cd101[_0xfc8b('0x2b')]=0x0;_0x5cd101['answered']=0x0;_0x5cd101['sumHoldTime']=0x0;_0x5cd101['sumDuration']=0x0;_0x5cd101['sumBillable']=0x0;}function clearCampaigns(_0x5345ed){if(!_[_0xfc8b('0x2c')](_0x5345ed)){for(var _0x29e056 in _0x5345ed){if(_0x5345ed[_0xfc8b('0x25')](_0x29e056)){_0x5345ed[_0x29e056]['ivrTotalCallsDays']=0x0;_0x5345ed[_0x29e056][_0xfc8b('0x2d')]=0x0;}}}}function clearVoiceQueues(_0x242106){if(!_[_0xfc8b('0x2c')](_0x242106)){for(var _0x7204db in _0x242106){if(_0x242106['hasOwnProperty'](_0x7204db)){_0x242106[_0x7204db][_0xfc8b('0x2b')]=0x0;_0x242106[_0x7204db][_0xfc8b('0x2e')]=0x0;_0x242106[_0x7204db]['unmanaged']=0x0;_0x242106[_0x7204db][_0xfc8b('0x2f')]=0x0;_0x242106[_0x7204db][_0xfc8b('0x30')]=0x0;_0x242106[_0x7204db]['sumDuration']=0x0;_0x242106[_0x7204db][_0xfc8b('0x31')]=0x0;_0x242106[_0x7204db][_0xfc8b('0x32')]=0x0;_0x242106[_0x7204db]['outboundNoAnswerCallsDay']=0x0;_0x242106[_0x7204db]['outboundBusyCallsDay']=0x0;_0x242106[_0x7204db][_0xfc8b('0x33')]=0x0;_0x242106[_0x7204db]['outboundNoSuchCallsDay']=0x0;_0x242106[_0x7204db][_0xfc8b('0x34')]=0x0;_0x242106[_0x7204db][_0xfc8b('0x35')]=0x0;_0x242106[_0x7204db][_0xfc8b('0x36')]=0x0;_0x242106[_0x7204db][_0xfc8b('0x37')]=0x0;_0x242106[_0x7204db]['outboundOriginateFailureCallsDay']=0x0;_0x242106[_0x7204db][_0xfc8b('0x38')]=0x0;_0x242106[_0x7204db]['outboundReCallsDay']=0x0;_0x242106[_0x7204db][_0xfc8b('0x32')]=0x0;_0x242106[_0x7204db][_0xfc8b('0x39')]=0x0;_0x242106[_0x7204db][_0xfc8b('0x3a')]=!![];}}}}Realtime[_0xfc8b('0x3b')][_0xfc8b('0x3c')]=function(_0x1cbb09,_0x4dcd68){for(var _0x51963a in _0x4dcd68){if(_0x1cbb09[_0xfc8b('0x25')](_0x51963a)){_0x1cbb09[_0x51963a]=_0x4dcd68[_0x51963a];}}};Realtime[_0xfc8b('0x3b')]['initAgents']=function(){var _0x117f45=this;return function(_0x5b62cf){if(_0x5b62cf){freeIsNotKeyAgent(_0x5b62cf,_0x117f45[_0xfc8b('0x11')]);for(var _0x591030=0x0,_0x134600={},_0x11c972={};_0x591030<_0x5b62cf[_0xfc8b('0x3d')];_0x591030+=0x1){_0x134600=_0x5b62cf[_0x591030];var _0x36f3a4=_[_0xfc8b('0x29')](_0x134600[_0xfc8b('0x2a')])?util[_0xfc8b('0x26')](_0xfc8b('0x27'),_0x134600['name']):_0x134600[_0xfc8b('0x2a')];if(_[_0xfc8b('0x3e')](_0x117f45['agents'][_0x36f3a4])){_0x117f45[_0xfc8b('0x11')][_0x36f3a4]=new Agent(_0x134600);}else{_0x117f45[_0xfc8b('0x3c')](_0x117f45[_0xfc8b('0x11')][_0x36f3a4],_0x134600);}}}return _0x117f45['agents'];};};Realtime['prototype'][_0xfc8b('0x3f')]=function(){var _0x2ca818=this;return function(_0x1a1019){if(_0x1a1019){freeIsNotKeySip(_0x1a1019,_0x2ca818['telephones']);for(var _0x32bd86=0x0,_0x11fb3b={},_0x16b11c={};_0x32bd86<_0x1a1019[_0xfc8b('0x3d')];_0x32bd86+=0x1){_0x11fb3b=_0x1a1019[_0x32bd86];if(_['isUndefined'](_0x2ca818[_0xfc8b('0x12')][util[_0xfc8b('0x26')](_0xfc8b('0x27'),_0x11fb3b[_0xfc8b('0x28')])])){_0x2ca818[_0xfc8b('0x12')][util[_0xfc8b('0x26')]('SIP/%s',_0x11fb3b[_0xfc8b('0x28')])]=new Telephone(_0x11fb3b);}else{_0x2ca818['mergeFromDatabase'](_0x2ca818[_0xfc8b('0x12')][util[_0xfc8b('0x26')](_0xfc8b('0x27'),_0x11fb3b['name'])],_0x11fb3b);}}}return _0x2ca818[_0xfc8b('0x12')];};};Realtime['prototype'][_0xfc8b('0x40')]=function(){var _0x4ffc3d=this;return function(_0x493074){if(_0x493074){freeIsNotKeySip(_0x493074,_0x4ffc3d[_0xfc8b('0x13')]);for(var _0x2eb0d5=0x0,_0x5f4718={},_0x4ca744={};_0x2eb0d5<_0x493074[_0xfc8b('0x3d')];_0x2eb0d5+=0x1){_0x5f4718=_0x493074[_0x2eb0d5];if(_[_0xfc8b('0x3e')](_0x4ffc3d[_0xfc8b('0x13')][util[_0xfc8b('0x26')](_0xfc8b('0x27'),_0x5f4718[_0xfc8b('0x28')])])){_0x4ffc3d[_0xfc8b('0x13')][util['format'](_0xfc8b('0x27'),_0x5f4718['name'])]=new Trunk(_0x5f4718);}else{_0x4ffc3d[_0xfc8b('0x3c')](_0x4ffc3d[_0xfc8b('0x13')][util['format'](_0xfc8b('0x27'),_0x5f4718[_0xfc8b('0x28')])],_0x5f4718);}}}return _0x4ffc3d['trunks'];};};Realtime['prototype'][_0xfc8b('0x41')]=function(){var _0x298c8d=this;return function(_0x4ce14b){if(_0x4ce14b){freeIsNotKey(_0x4ce14b,_0x298c8d['voiceQueues'],_0xfc8b('0x28'));for(var _0x29e612=0x0,_0xe193f5={},_0x3be527={};_0x29e612<_0x4ce14b[_0xfc8b('0x3d')];_0x29e612+=0x1){_0xe193f5=_0x4ce14b[_0x29e612];if(_[_0xfc8b('0x3e')](_0x298c8d[_0xfc8b('0x42')][_0xe193f5[_0xfc8b('0x28')]])){_0x298c8d['voiceQueues'][_0xe193f5[_0xfc8b('0x28')]]=new VoiceQueue(_0xe193f5);}else{_0x298c8d['mergeFromDatabase'](_0x298c8d[_0xfc8b('0x42')][_0xe193f5[_0xfc8b('0x28')]],_0xe193f5);}}}return _0x298c8d[_0xfc8b('0x42')];};};Realtime[_0xfc8b('0x3b')][_0xfc8b('0x43')]=function(){var _0x55470f=this;return function(_0x5807e6){if(_0x5807e6){freeIsNotKey(_0x5807e6,_0x55470f[_0xfc8b('0x14')],'id');for(var _0xd1a4a0=0x0,_0x4d7ac={},_0x2a858a={};_0xd1a4a0<_0x5807e6['length'];_0xd1a4a0+=0x1){_0x4d7ac=_0x5807e6[_0xd1a4a0];if(_[_0xfc8b('0x3e')](_0x55470f['triggers'][_0x4d7ac['id']])){_0x55470f[_0xfc8b('0x14')][_0x4d7ac['id']]=new Trigger(_0x4d7ac);}else{_0x55470f['mergeFromDatabase'](_0x55470f[_0xfc8b('0x14')][_0x4d7ac['id']],_0x4d7ac);}}}return _0x55470f[_0xfc8b('0x14')];};};Realtime[_0xfc8b('0x3b')][_0xfc8b('0x44')]=function(){var _0x178b6a=this;return function(_0x19146a){if(_0x19146a){freeIsNotKey(_0x19146a,_0x178b6a[_0xfc8b('0x15')],'id');for(var _0x102ffc=0x0,_0x542466={},_0x4aa1fa={};_0x102ffc<_0x19146a[_0xfc8b('0x3d')];_0x102ffc+=0x1){_0x542466=_0x19146a[_0x102ffc];if(_[_0xfc8b('0x3e')](_0x178b6a[_0xfc8b('0x15')][_0x542466['id']])){_0x178b6a[_0xfc8b('0x15')][_0x542466['id']]=new Template(_0x542466);}else{_0x178b6a[_0xfc8b('0x3c')](_0x178b6a[_0xfc8b('0x15')][_0x542466['id']],_0x542466);}}}return _0x178b6a[_0xfc8b('0x15')];};};Realtime[_0xfc8b('0x3b')]['initZendeskAccounts']=function(){var _0x20fc8b=this;return function(_0x48056f){if(_0x48056f){freeIsNotKey(_0x48056f,_0x20fc8b[_0xfc8b('0x1c')],'id');for(var _0x235ecd=0x0,_0x28c8a2={},_0x4acbb7={};_0x235ecd<_0x48056f[_0xfc8b('0x3d')];_0x235ecd+=0x1){_0x28c8a2=_0x48056f[_0x235ecd];if(_['isUndefined'](_0x20fc8b[_0xfc8b('0x1c')][_0x28c8a2['id']])){_0x20fc8b[_0xfc8b('0x1c')][_0x28c8a2['id']]=new ZendeskAccount(_0x28c8a2);}else{_0x20fc8b['mergeFromDatabase'](_0x20fc8b['zendeskAccounts'][_0x28c8a2['id']],_0x28c8a2);}}}return _0x20fc8b[_0xfc8b('0x1c')];};};Realtime[_0xfc8b('0x3b')]['initSalesforceAccounts']=function(){var _0x1fa50b=this;return function(_0x5b73c9){if(_0x5b73c9){freeIsNotKey(_0x5b73c9,_0x1fa50b[_0xfc8b('0x1d')],'id');for(var _0x33c606=0x0,_0x234b5e={},_0x5d92bf={};_0x33c606<_0x5b73c9[_0xfc8b('0x3d')];_0x33c606+=0x1){_0x234b5e=_0x5b73c9[_0x33c606];if(_['isUndefined'](_0x1fa50b[_0xfc8b('0x1d')][_0x234b5e['id']])){_0x1fa50b[_0xfc8b('0x1d')][_0x234b5e['id']]=new SalesforceAccount(_0x234b5e);}else{_0x1fa50b['mergeFromDatabase'](_0x1fa50b[_0xfc8b('0x1d')][_0x234b5e['id']],_0x234b5e);}}}return _0x1fa50b[_0xfc8b('0x1d')];};};Realtime[_0xfc8b('0x3b')]['initFreshdeskAccounts']=function(){var _0x3a4efb=this;return function(_0x1e25d6){if(_0x1e25d6){freeIsNotKey(_0x1e25d6,_0x3a4efb['freshdeskAccounts'],'id');for(var _0x4440d7=0x0,_0x5853d8={},_0x54c7c0={};_0x4440d7<_0x1e25d6[_0xfc8b('0x3d')];_0x4440d7+=0x1){_0x5853d8=_0x1e25d6[_0x4440d7];if(_['isUndefined'](_0x3a4efb[_0xfc8b('0x1e')][_0x5853d8['id']])){_0x3a4efb[_0xfc8b('0x1e')][_0x5853d8['id']]=new FreshdeskAccount(_0x5853d8);}else{_0x3a4efb[_0xfc8b('0x3c')](_0x3a4efb[_0xfc8b('0x1e')][_0x5853d8['id']],_0x5853d8);}}}return _0x3a4efb[_0xfc8b('0x1e')];};};Realtime['prototype'][_0xfc8b('0x45')]=function(){var _0xf33845=this;return function(_0x31ba99){if(_0x31ba99){freeIsNotKey(_0x31ba99,_0xf33845[_0xfc8b('0x1f')],'id');for(var _0x2bdbf2=0x0,_0x20a0a5={},_0x342612={};_0x2bdbf2<_0x31ba99[_0xfc8b('0x3d')];_0x2bdbf2+=0x1){_0x20a0a5=_0x31ba99[_0x2bdbf2];if(_[_0xfc8b('0x3e')](_0xf33845[_0xfc8b('0x1f')][_0x20a0a5['id']])){_0xf33845[_0xfc8b('0x1f')][_0x20a0a5['id']]=new ZohoAccount(_0x20a0a5);}else{_0xf33845[_0xfc8b('0x3c')](_0xf33845[_0xfc8b('0x1f')][_0x20a0a5['id']],_0x20a0a5);}}}return _0xf33845[_0xfc8b('0x1f')];};};Realtime[_0xfc8b('0x3b')][_0xfc8b('0x46')]=function(){var _0x70816e=this;return function(_0x32a9f8){if(_0x32a9f8){freeIsNotKey(_0x32a9f8,_0x70816e['deskAccounts'],'id');for(var _0x5183c=0x0,_0x388e0a={},_0x5bb06e={};_0x5183c<_0x32a9f8[_0xfc8b('0x3d')];_0x5183c+=0x1){_0x388e0a=_0x32a9f8[_0x5183c];if(_[_0xfc8b('0x3e')](_0x70816e[_0xfc8b('0x47')][_0x388e0a['id']])){_0x70816e[_0xfc8b('0x47')][_0x388e0a['id']]=new DeskAccount(_0x388e0a);}else{_0x70816e['mergeFromDatabase'](_0x70816e[_0xfc8b('0x47')][_0x388e0a['id']],_0x388e0a);}}}return _0x70816e[_0xfc8b('0x47')];};};Realtime['prototype'][_0xfc8b('0x48')]=function(){var _0x32e078=this;return function(_0x48185c){if(_0x48185c){freeIsNotKey(_0x48185c,_0x32e078[_0xfc8b('0x49')],'id');for(var _0x581f71=0x0,_0xd26530={},_0x5eb58f={};_0x581f71<_0x48185c[_0xfc8b('0x3d')];_0x581f71+=0x1){_0xd26530=_0x48185c[_0x581f71];if(_[_0xfc8b('0x3e')](_0x32e078[_0xfc8b('0x49')][_0xd26530['id']])){_0x32e078['sugarcrmAccounts'][_0xd26530['id']]=new SugarcrmAccount(_0xd26530);}else{_0x32e078['mergeFromDatabase'](_0x32e078[_0xfc8b('0x49')][_0xd26530['id']],_0xd26530);}}}return _0x32e078[_0xfc8b('0x49')];};};Realtime[_0xfc8b('0x3b')]['initVtigerAccounts']=function(){var _0x37858e=this;return function(_0x589e12){if(_0x589e12){freeIsNotKey(_0x589e12,_0x37858e['vtigerAccounts'],'id');for(var _0x41e161=0x0,_0x7870c0={},_0x409fb5={};_0x41e161<_0x589e12[_0xfc8b('0x3d')];_0x41e161+=0x1){_0x7870c0=_0x589e12[_0x41e161];if(_['isUndefined'](_0x37858e['vtigerAccounts'][_0x7870c0['id']])){_0x37858e[_0xfc8b('0x20')][_0x7870c0['id']]=new VtigerAccount(_0x7870c0);}else{_0x37858e[_0xfc8b('0x3c')](_0x37858e['vtigerAccounts'][_0x7870c0['id']],_0x7870c0);}}}return _0x37858e[_0xfc8b('0x20')];};};Realtime[_0xfc8b('0x3b')][_0xfc8b('0x4a')]=function(){var _0x2aa5dc=this;return function(_0x4d4db7){if(_0x4d4db7){freeIsNotKey(_0x4d4db7,_0x2aa5dc[_0xfc8b('0x21')],'id');for(var _0xc46689=0x0,_0x27c2a8={},_0x1f4d41={};_0xc46689<_0x4d4db7['length'];_0xc46689+=0x1){_0x27c2a8=_0x4d4db7[_0xc46689];if(_[_0xfc8b('0x3e')](_0x2aa5dc[_0xfc8b('0x21')][_0x27c2a8['id']])){_0x2aa5dc[_0xfc8b('0x21')][_0x27c2a8['id']]=new ServicenowAccount(_0x27c2a8);}else{_0x2aa5dc[_0xfc8b('0x3c')](_0x2aa5dc['servicenowAccounts'][_0x27c2a8['id']],_0x27c2a8);}}}return _0x2aa5dc['servicenowAccounts'];};};Realtime[_0xfc8b('0x3b')][_0xfc8b('0x4b')]=function(){var _0x6b42a=this;return function(_0x3a389a){if(_0x3a389a){freeIsNotKey(_0x3a389a,_0x6b42a[_0xfc8b('0x22')],'id');for(var _0x9084a4=0x0,_0x33f4a0={},_0x289eaa={};_0x9084a4<_0x3a389a[_0xfc8b('0x3d')];_0x9084a4+=0x1){_0x33f4a0=_0x3a389a[_0x9084a4];if(_[_0xfc8b('0x3e')](_0x6b42a[_0xfc8b('0x22')][_0x33f4a0['id']])){_0x6b42a[_0xfc8b('0x22')][_0x33f4a0['id']]=new Dynamics365Account(_0x33f4a0);}else{_0x6b42a[_0xfc8b('0x3c')](_0x6b42a[_0xfc8b('0x22')][_0x33f4a0['id']],_0x33f4a0);}}}return _0x6b42a[_0xfc8b('0x22')];};};Realtime[_0xfc8b('0x3b')][_0xfc8b('0x4c')]=function(){var _0x575c5=this;return function(_0x9c8908){for(var _0x19532d=0x0;_0x19532d<_0x9c8908['length'];_0x19532d+=0x1){_['merge'](_0x575c5[_0xfc8b('0x42')][_0x9c8908[_0x19532d][_0xfc8b('0x28')]],_0x9c8908[_0x19532d]);}return _0x575c5[_0xfc8b('0x42')];};};Realtime['prototype'][_0xfc8b('0x4d')]=function(){var _0x47a294=this;return function(_0xc30672){clearVoiceQueues(_0x47a294[_0xfc8b('0x42')]);if(_0xc30672){_0xc30672=_['groupBy'](_0xc30672,_0xfc8b('0x4e'));for(var _0x1607ed in _0xc30672){if(_0xc30672['hasOwnProperty'](_0x1607ed)){var _0x5108d4={};for(var _0x524585=0x0;_0x524585<_0xc30672[_0x1607ed][_0xfc8b('0x3d')];_0x524585+=0x1){var _0x3b1473=_0xc30672[_0x1607ed][_0x524585][_0xfc8b('0x4f')];if(_0x47a294[_0xfc8b('0x42')][_0x3b1473]){if(_0xc30672[_0x1607ed][_0x524585][_0xfc8b('0x50')]){_0x47a294[_0xfc8b('0x42')][_0x3b1473][_0xfc8b('0x51')]+=0x1;}if(_0xc30672[_0x1607ed][_0x524585]['queuecallerabandon']){_0x47a294[_0xfc8b('0x42')][_0x3b1473]['abandoned']+=0x1;}_0x47a294[_0xfc8b('0x42')][_0x3b1473][_0xfc8b('0x30')]+=moment(_0xc30672[_0x1607ed][_0x524585][_0xfc8b('0x52')])[_0xfc8b('0x53')](moment(_0xc30672[_0x1607ed][_0x524585][_0xfc8b('0x54')]),'seconds')||0x0;if(_0x524585===_0xc30672[_0x1607ed][_0xfc8b('0x3d')]-0x1){_0x47a294[_0xfc8b('0x42')][_0x3b1473][_0xfc8b('0x55')]+=moment(_0xc30672[_0x1607ed][_0x524585][_0xfc8b('0x56')]||_0xc30672[_0x1607ed][_0x524585][_0xfc8b('0x57')]||_0xc30672[_0x1607ed][_0x524585][_0xfc8b('0x58')])[_0xfc8b('0x53')](moment(_0xc30672[_0x1607ed][_0x524585][_0xfc8b('0x54')]),_0xfc8b('0x59'))||0x0;_0x47a294[_0xfc8b('0x42')][_0x3b1473][_0xfc8b('0x2b')]+=0x1;if(_0xc30672[_0x1607ed][_0x524585][_0xfc8b('0x5a')]){_0x47a294[_0xfc8b('0x42')][_0x3b1473][_0xfc8b('0x2e')]+=0x1;_0x47a294[_0xfc8b('0x42')][_0x3b1473][_0xfc8b('0x31')]+=moment(_0xc30672[_0x1607ed][_0x524585][_0xfc8b('0x56')])[_0xfc8b('0x53')](moment(_0xc30672[_0x1607ed][_0x524585]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x47a294[_0xfc8b('0x42')][_0x3b1473]['sumDuration']+=_0x47a294[_0xfc8b('0x42')][_0x3b1473][_0xfc8b('0x30')]||0x0;}}}}}}return _0x47a294[_0xfc8b('0x42')];};};Realtime[_0xfc8b('0x3b')][_0xfc8b('0x5b')]=function(){var _0x5bcbb9=this;return function(_0x302894){clearVoiceCallReports(_0x5bcbb9[_0xfc8b('0x16')]);if(_0x302894){for(var _0x4656fe=0x0;_0x4656fe<_0x302894[_0xfc8b('0x3d')];_0x4656fe+=0x1){_0x5bcbb9[_0xfc8b('0x16')]['total']+=0x1;_0x5bcbb9[_0xfc8b('0x16')]['sumDuration']+=_0x302894[_0x4656fe][_0xfc8b('0x5c')];if(_0x302894[_0x4656fe]['disposition']===_0xfc8b('0x5d')){_0x5bcbb9[_0xfc8b('0x16')][_0xfc8b('0x2e')]+=0x1;_0x5bcbb9[_0xfc8b('0x16')][_0xfc8b('0x30')]+=_0x302894[_0x4656fe][_0xfc8b('0x5c')]-_0x302894[_0x4656fe]['billableseconds']||0x0;_0x5bcbb9[_0xfc8b('0x16')]['sumBillable']+=_0x302894[_0x4656fe]['billableseconds'];}}}return _0x5bcbb9[_0xfc8b('0x16')];};};Realtime['prototype'][_0xfc8b('0x5e')]=function(){var _0x906f42=this;return function(_0x4a9c0c){if(_0x4a9c0c){freeIsNotKey(_0x4a9c0c,_0x906f42['campaigns'],_0xfc8b('0x28'));for(var _0x1e7cb4=0x0,_0x22c935={};_0x1e7cb4<_0x4a9c0c[_0xfc8b('0x3d')];_0x1e7cb4+=0x1){_0x22c935=_0x4a9c0c[_0x1e7cb4];if(_[_0xfc8b('0x3e')](_0x906f42[_0xfc8b('0x5f')][_0x22c935['name']])){_0x906f42[_0xfc8b('0x5f')][_0x22c935[_0xfc8b('0x28')]]=new Campaign(_0x22c935);}else{_0x906f42[_0xfc8b('0x3c')](_0x906f42['campaigns'][_0x22c935[_0xfc8b('0x28')]],_0x22c935);}}}return _0x906f42[_0xfc8b('0x5f')];};};Realtime['prototype'][_0xfc8b('0x60')]=function(){var _0x1813ab=this;return function(_0x13b65e){if(_0x13b65e){freeIsNotKey(_0x13b65e,_0x1813ab['voiceExtensions'],'id');for(var _0x3b33ab=0x0,_0x33b9c2={};_0x3b33ab<_0x13b65e['length'];_0x3b33ab+=0x1){_0x33b9c2=_0x13b65e[_0x3b33ab];if(_[_0xfc8b('0x3e')](_0x1813ab[_0xfc8b('0x17')][_0x33b9c2['id']])){_0x1813ab[_0xfc8b('0x17')][_0x33b9c2['id']]=new VoiceExtension(_0x33b9c2);}else{_0x1813ab[_0xfc8b('0x3c')](_0x1813ab[_0xfc8b('0x17')][_0x33b9c2['id']],_0x33b9c2);}}}return _0x1813ab[_0xfc8b('0x17')];};};Realtime[_0xfc8b('0x3b')]['initCampaignHopperHistory']=function(){var _0x3578d5=this;return function(_0x5ab672){clearCampaigns(_0x3578d5['campaigns']);for(var _0x1fbb2b=0x0;_0x1fbb2b<_0x5ab672['length'];_0x1fbb2b+=0x1){_[_0xfc8b('0x61')](_0x3578d5[_0xfc8b('0x5f')][_0x5ab672[_0x1fbb2b][_0xfc8b('0x28')]],_0x5ab672[_0x1fbb2b]);}return _0x3578d5['campaigns'];};};Realtime[_0xfc8b('0x3b')][_0xfc8b('0x62')]=function(){var _0x59d33d=this;return function(_0x5e1df6){if(_0x5e1df6){freeIsNotKey(_0x5e1df6,_0x59d33d[_0xfc8b('0x23')],'id');for(var _0x3615d6=0x0,_0x494c6f={},_0x5c4fe9={};_0x3615d6<_0x5e1df6[_0xfc8b('0x3d')];_0x3615d6+=0x1){_0x494c6f=_0x5e1df6[_0x3615d6];if(_[_0xfc8b('0x3e')](_0x59d33d[_0xfc8b('0x23')][_0x494c6f['id']])){_0x59d33d[_0xfc8b('0x23')][_0x494c6f['id']]=new FaxAccount(_0x494c6f);}else{_0x59d33d[_0xfc8b('0x3c')](_0x59d33d['faxAccounts'][_0x494c6f['id']],_0x494c6f);}}}return _0x59d33d[_0xfc8b('0x23')];};};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 79b7704..958b1a5 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 _0x007d=['./voiceDialReport','./userReport','agents','telephones','prototype','realtime','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','voiceCallReport','voiceDialReport','attendedtransfer','findAgent','find','accountcode','name','isNil','interface','format','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','create','destination','exten','dialer','lastdata','queue','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','channel','calleridnum','disposition','ANSWERED','calleridname','monitor','monitors','createdAt','connectedlinename','xcally-motion-dialer','voiceAgentReport','isArray','forEach','startsWith','Local','substring','indexOf','phone','lastIndexOf','membername','blindTransfer','attendedTransfer','exports','bluebird','lodash','moment','util','../../../config/logger','ami','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport'];(function(_0x2b7c54,_0x385434){var _0x18d0c3=function(_0x25df45){while(--_0x25df45){_0x2b7c54['push'](_0x2b7c54['shift']());}};_0x18d0c3(++_0x385434);}(_0x007d,0x18e));var _0xd007=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x007d[_0x57b54c];return _0x59cc19;};'use strict';var BPromise=require(_0xd007('0x0'));var _=require(_0xd007('0x1'));var moment=require(_0xd007('0x2'));var util=require(_0xd007('0x3'));var config=require('../../../config/environment');var logger=require(_0xd007('0x4'))(_0xd007('0x5'));var ami=require(_0xd007('0x6'));var RpcVoiceAgentReport=require(_0xd007('0x7'));var RpcVoiceCallReport=require(_0xd007('0x8'));var RpcVoiceDialReport=require(_0xd007('0x9'));var RpcMemberReport=require(_0xd007('0xa'));var RpcVoiceQueueReport=require(_0xd007('0xb'));var RpcVoiceRecording=require(_0xd007('0xc'));var RpcVoiceTransferReport=require(_0xd007('0xd'));var VoiceQueueReport=require(_0xd007('0xe'));var VoiceCallReport=require(_0xd007('0xf'));var VoiceAgentReport=require(_0xd007('0x10'));var VoiceDialReport=require(_0xd007('0x11'));var UserReport=require(_0xd007('0x12'));function Report(_0x5ee03b){this['realtime']=_0x5ee03b;this[_0xd007('0x13')]=_0x5ee03b[_0xd007('0x13')];this[_0xd007('0x14')]=_0x5ee03b[_0xd007('0x14')];}Report[_0xd007('0x15')]['sync']=function(_0x508aee){var _0x33073d=new VoiceQueueReport(this[_0xd007('0x16')]);var _0x43bd6d=new VoiceAgentReport(this['realtime']);var _0x220935=new VoiceDialReport(this[_0xd007('0x16')]);var _0x498f49=new VoiceCallReport(this['realtime']);var _0x556baa=new UserReport(this[_0xd007('0x16')]);if(config[_0xd007('0x17')]&&config[_0xd007('0x17')][_0xd007('0x18')]){ami['on'](_0xd007('0x19'),this[_0xd007('0x1a')][_0xd007('0x1b')](this));ami['on']('custom:voiceCallReport',this[_0xd007('0x1c')]['bind'](this));ami['on']('custom:voiceAgentReport',this['voiceAgentReport'][_0xd007('0x1b')](this));ami['on']('custom:voiceDialReport',this[_0xd007('0x1d')][_0xd007('0x1b')](this));ami['on']('blindtransfer',this['blindTransfer'][_0xd007('0x1b')](this));ami['on'](_0xd007('0x1e'),this['attendedTransfer'][_0xd007('0x1b')](this));}};Report[_0xd007('0x15')][_0xd007('0x1f')]=function(_0xc3a76e){var _0x179c49=undefined;_0x179c49=_[_0xd007('0x20')](this[_0xd007('0x13')],function(_0x2b2054){return _0x2b2054[_0xd007('0x21')]==_0xc3a76e||_0x2b2054[_0xd007('0x22')]==_0xc3a76e;});if(_[_0xd007('0x23')](_0x179c49)){var _0x48c4a0=_[_0xd007('0x20')](this[_0xd007('0x14')],function(_0x2e6e80){return _0x2e6e80[_0xd007('0x21')]==_0xc3a76e||_0x2e6e80[_0xd007('0x22')]==_0xc3a76e;});if(_0x48c4a0){_0x179c49=_[_0xd007('0x20')](this['agents'],function(_0xaf8e98){return _0xaf8e98[_0xd007('0x24')]==util[_0xd007('0x25')](_0xd007('0x26'),_0x48c4a0[_0xd007('0x22')]);});}}return _0x179c49;};Report[_0xd007('0x15')]['voiceQueueReport']=function(_0x2eea38){for(var _0x48d4df=0x0;_0x48d4df<_0x2eea38[_0xd007('0x27')];_0x48d4df+=0x1){var _0x4995f2=this['findAgent'](_0x2eea38[_0x48d4df][_0xd007('0x28')]);if(_0x4995f2){_0x2eea38[_0x48d4df]['accountcode']=_0x4995f2[_0xd007('0x21')];_0x2eea38[_0x48d4df][_0xd007('0x29')]=!![];_0x2eea38[_0x48d4df][_0xd007('0x2a')]=_0x4995f2[_0xd007('0x22')];_0x2eea38[_0x48d4df]['interface']=_['isNil'](_0x4995f2[_0xd007('0x24')])?util[_0xd007('0x25')](_0xd007('0x26'),_0x4995f2[_0xd007('0x22')]):_0x4995f2['interface'];if(_0x2eea38[_0x48d4df]['queuecallercomplete']){_0x2eea38[_0x48d4df][_0xd007('0x2b')]=moment()[_0xd007('0x25')](_0xd007('0x2c'));}if(_0x2eea38[_0x48d4df]['queuecallerexit']){_0x2eea38[_0x48d4df][_0xd007('0x2d')]=moment()['format'](_0xd007('0x2c'));}RpcMemberReport['voiceQueueReport'](_0x2eea38[_0x48d4df]);}RpcVoiceQueueReport[_0xd007('0x2e')](_0x2eea38[_0x48d4df]);}};function extractCalleridNumber(_0x5198bc){var _0x317d48=_0x5198bc['match'](/<(.*?)>/);return _0x317d48?_0x317d48[0x1]:_0x5198bc;}Report['prototype'][_0xd007('0x1c')]=function(_0x5f880c){_0x5f880c['destination']=_0x5f880c[_0xd007('0x2f')]||_0x5f880c[_0xd007('0x30')];if(_0x5f880c['type']==_0xd007('0x31')){_0x5f880c['lastapplication']='queue';_0x5f880c[_0xd007('0x32')]=_0x5f880c[_0xd007('0x33')];if(_0x5f880c[_0xd007('0x34')]==_0xd007('0x35')){_0x5f880c[_0xd007('0x21')]='';_0x5f880c['destination']=extractCalleridNumber(_0x5f880c[_0xd007('0x36')]);}else if(_0x5f880c[_0xd007('0x34')]==_0xd007('0x37')){if(_0x5f880c[_0xd007('0x2f')]==_0xd007('0x38')){_0x5f880c[_0xd007('0x2f')]=extractCalleridNumber(_0x5f880c[_0xd007('0x39')]);_0x5f880c['calleridnum']=_0x5f880c[_0xd007('0x3a')];_0x5f880c[_0xd007('0x3b')]=[_0x5f880c[_0xd007('0x3c')],_0x5f880c['channel']=_0x5f880c['destinationchannel']][0x0];_0x5f880c[_0xd007('0x36')]=_0x5f880c[_0xd007('0x39')];}else{_0x5f880c['destination']=_0x5f880c[_0xd007('0x3d')];_0x5f880c[_0xd007('0x3d')]=_0x5f880c[_0xd007('0x3a')];if(_0x5f880c[_0xd007('0x3e')]==_0xd007('0x3f')){_0x5f880c[_0xd007('0x21')]=_0x5f880c[_0xd007('0x28')];}else{_0x5f880c['accountcode']='';}}}}else{_0x5f880c[_0xd007('0x36')]=util[_0xd007('0x25')]('\x22%s\x22\x20<%s>',_0x5f880c[_0xd007('0x40')],_0x5f880c[_0xd007('0x3d')]);}RpcVoiceCallReport['create'](_0x5f880c);if(_0x5f880c[_0xd007('0x41')]){for(var _0x15f44f=0x0;_0x15f44f<_0x5f880c[_0xd007('0x42')][_0xd007('0x27')];_0x15f44f+=0x1){_0x5f880c['monitorFilename']=_0x5f880c[_0xd007('0x42')][_0x15f44f]['filename'];_0x5f880c[_0xd007('0x43')]=_0x5f880c[_0xd007('0x42')][_0x15f44f][_0xd007('0x43')];if(_0x5f880c[_0xd007('0x30')]==_0xd007('0x38')){_0x5f880c[_0xd007('0x3d')]=_0x5f880c['connectedlinenum'];_0x5f880c[_0xd007('0x40')]=_0x5f880c[_0xd007('0x44')];_0x5f880c[_0xd007('0x28')]=_0x5f880c[_0xd007('0x21')];_0x5f880c[_0xd007('0x44')]=_0x5f880c['membername'];_0x5f880c[_0xd007('0x30')]=_0x5f880c[_0xd007('0x3a')];}else if(_0x5f880c[_0xd007('0x30')]==_0xd007('0x45')){_0x5f880c[_0xd007('0x3d')]=_0x5f880c[_0xd007('0x2f')];_0x5f880c[_0xd007('0x30')]=_0x5f880c[_0xd007('0x3a')];}RpcVoiceRecording[_0xd007('0x2e')](_0x5f880c);}}};Report['prototype'][_0xd007('0x46')]=function(_0x25079d){if(_[_0xd007('0x47')](_0x25079d)){_0x25079d[_0xd007('0x48')](function(_0x299951){RpcVoiceAgentReport[_0xd007('0x2e')](_0x299951);});}else{RpcVoiceAgentReport[_0xd007('0x2e')](_0x25079d);}};Report['prototype']['voiceDialReport']=function(_0x586b89){RpcVoiceDialReport[_0xd007('0x2e')](_0x586b89);var _0x4f6e09=undefined;var _0x1771cc=_0x586b89[_0xd007('0x3c')];if(_[_0xd007('0x49')](_0x1771cc,_0xd007('0x4a'))){var _0x4f71b2=_0x1771cc[_0xd007('0x4b')](_0x1771cc[_0xd007('0x4c')]('/')+0x1,_0x1771cc[_0xd007('0x4c')]('@'));_0x4f6e09=_[_0xd007('0x20')](this[_0xd007('0x13')],function(_0x1373f3){return _0x1373f3['mobile']==_0x4f71b2||_0x1373f3[_0xd007('0x4d')]==_0x4f71b2||_0x1373f3[_0xd007('0x21')]==_0x4f71b2;});}else{var _0x4f71b2=_0x1771cc[_0xd007('0x4b')](_0x1771cc[_0xd007('0x4c')]('/')+0x1,_0x1771cc[_0xd007('0x4e')]('-'));_0x4f6e09=this[_0xd007('0x1f')](_0x4f71b2);}if(_0x4f6e09){_0x586b89[_0xd007('0x24')]=_['isNil'](_0x4f6e09[_0xd007('0x24')])?util['format'](_0xd007('0x26'),_0x4f6e09['name']):_0x4f6e09[_0xd007('0x24')];_0x586b89[_0xd007('0x4f')]=_0x4f6e09[_0xd007('0x22')];_0x586b89[_0xd007('0x21')]=_0x4f6e09[_0xd007('0x21')];RpcMemberReport['voiceDialReport'](_0x586b89);}};Report[_0xd007('0x15')]['blindTransfer']=function(_0x1be19e){RpcVoiceTransferReport[_0xd007('0x50')](_0x1be19e);};Report[_0xd007('0x15')][_0xd007('0x51')]=function(_0x451f13){RpcVoiceTransferReport[_0xd007('0x51')](_0x451f13);};module[_0xd007('0x52')]=Report; \ No newline at end of file +var _0x0dc6=['util','../../../config/environment','../../../config/logger','ami','../ami','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceTransferReport','./voiceQueueReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','disabled','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','name','find','accountcode','interface','format','SIP/%s','length','connectedlinenum','assigned','isNil','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','create','voiceCallReport','destination','exten','type','dialer','queue','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','disposition','\x22%s\x22\x20<%s>','calleridname','monitor','monitorFilename','filename','createdAt','connectedlinename','isArray','voiceDialReport','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','membername','exports','bluebird'];(function(_0x4bfbda,_0x332198){var _0x3811c8=function(_0x3233c7){while(--_0x3233c7){_0x4bfbda['push'](_0x4bfbda['shift']());}};_0x3811c8(++_0x332198);}(_0x0dc6,0x13b));var _0x60dc=function(_0x2fd69d,_0xeb1037){_0x2fd69d=_0x2fd69d-0x0;var _0x5d5ef3=_0x0dc6[_0x2fd69d];return _0x5d5ef3;};'use strict';var BPromise=require(_0x60dc('0x0'));var _=require('lodash');var moment=require('moment');var util=require(_0x60dc('0x1'));var config=require(_0x60dc('0x2'));var logger=require(_0x60dc('0x3'))(_0x60dc('0x4'));var ami=require(_0x60dc('0x5'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x60dc('0x6'));var RpcVoiceDialReport=require(_0x60dc('0x7'));var RpcMemberReport=require(_0x60dc('0x8'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0x60dc('0x9'));var VoiceQueueReport=require(_0x60dc('0xa'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0x60dc('0xb'));var VoiceDialReport=require(_0x60dc('0xc'));var UserReport=require(_0x60dc('0xd'));function Report(_0x28f634){this[_0x60dc('0xe')]=_0x28f634;this[_0x60dc('0xf')]=_0x28f634[_0x60dc('0xf')];this[_0x60dc('0x10')]=_0x28f634[_0x60dc('0x10')];}Report[_0x60dc('0x11')][_0x60dc('0x12')]=function(_0x256c09){var _0xd6b1a9=new VoiceQueueReport(this[_0x60dc('0xe')]);var _0x432c8d=new VoiceAgentReport(this['realtime']);var _0x1998e9=new VoiceDialReport(this['realtime']);var _0x480726=new VoiceCallReport(this[_0x60dc('0xe')]);var _0x4de25f=new UserReport(this[_0x60dc('0xe')]);if(config['xdr']&&config['xdr'][_0x60dc('0x13')]){ami['on'](_0x60dc('0x14'),this[_0x60dc('0x15')]['bind'](this));ami['on'](_0x60dc('0x16'),this['voiceCallReport'][_0x60dc('0x17')](this));ami['on'](_0x60dc('0x18'),this[_0x60dc('0x19')]['bind'](this));ami['on']('custom:voiceDialReport',this['voiceDialReport']['bind'](this));ami['on'](_0x60dc('0x1a'),this[_0x60dc('0x1b')]['bind'](this));ami['on'](_0x60dc('0x1c'),this[_0x60dc('0x1d')][_0x60dc('0x17')](this));}};Report[_0x60dc('0x11')][_0x60dc('0x1e')]=function(_0xfbf4a5){var _0x1e117b=undefined;_0x1e117b=_['find'](this[_0x60dc('0xf')],function(_0x55c29d){return _0x55c29d['accountcode']==_0xfbf4a5||_0x55c29d[_0x60dc('0x1f')]==_0xfbf4a5;});if(_['isNil'](_0x1e117b)){var _0x90a7a7=_[_0x60dc('0x20')](this[_0x60dc('0x10')],function(_0x162f79){return _0x162f79[_0x60dc('0x21')]==_0xfbf4a5||_0x162f79[_0x60dc('0x1f')]==_0xfbf4a5;});if(_0x90a7a7){_0x1e117b=_[_0x60dc('0x20')](this['agents'],function(_0x520508){return _0x520508[_0x60dc('0x22')]==util[_0x60dc('0x23')](_0x60dc('0x24'),_0x90a7a7[_0x60dc('0x1f')]);});}}return _0x1e117b;};Report[_0x60dc('0x11')][_0x60dc('0x15')]=function(_0x517589){for(var _0x19e8e2=0x0;_0x19e8e2<_0x517589[_0x60dc('0x25')];_0x19e8e2+=0x1){var _0x1adbad=this[_0x60dc('0x1e')](_0x517589[_0x19e8e2][_0x60dc('0x26')]);if(_0x1adbad){_0x517589[_0x19e8e2][_0x60dc('0x21')]=_0x1adbad[_0x60dc('0x21')];_0x517589[_0x19e8e2][_0x60dc('0x27')]=!![];_0x517589[_0x19e8e2]['lastAssignedTo']=_0x1adbad[_0x60dc('0x1f')];_0x517589[_0x19e8e2][_0x60dc('0x22')]=_[_0x60dc('0x28')](_0x1adbad[_0x60dc('0x22')])?util[_0x60dc('0x23')](_0x60dc('0x24'),_0x1adbad[_0x60dc('0x1f')]):_0x1adbad[_0x60dc('0x22')];if(_0x517589[_0x19e8e2]['queuecallercomplete']){_0x517589[_0x19e8e2][_0x60dc('0x29')]=moment()[_0x60dc('0x23')](_0x60dc('0x2a'));}if(_0x517589[_0x19e8e2][_0x60dc('0x2b')]){_0x517589[_0x19e8e2]['queuecallerexitAt']=moment()[_0x60dc('0x23')](_0x60dc('0x2a'));}RpcMemberReport['voiceQueueReport'](_0x517589[_0x19e8e2]);}RpcVoiceQueueReport[_0x60dc('0x2c')](_0x517589[_0x19e8e2]);}};function extractCalleridNumber(_0x231237){var _0x3ecd89=_0x231237['match'](/<(.*?)>/);return _0x3ecd89?_0x3ecd89[0x1]:_0x231237;}Report[_0x60dc('0x11')][_0x60dc('0x2d')]=function(_0x55bb12){_0x55bb12[_0x60dc('0x2e')]=_0x55bb12[_0x60dc('0x2e')]||_0x55bb12[_0x60dc('0x2f')];if(_0x55bb12[_0x60dc('0x30')]==_0x60dc('0x31')){_0x55bb12['lastapplication']=_0x60dc('0x32');_0x55bb12['lastdata']=_0x55bb12[_0x60dc('0x32')];if(_0x55bb12[_0x60dc('0x33')]==_0x60dc('0x34')){_0x55bb12[_0x60dc('0x21')]='';_0x55bb12[_0x60dc('0x2e')]=extractCalleridNumber(_0x55bb12[_0x60dc('0x35')]);}else if(_0x55bb12[_0x60dc('0x33')]==_0x60dc('0x36')){if(_0x55bb12[_0x60dc('0x2e')]==_0x60dc('0x37')){_0x55bb12['destination']=extractCalleridNumber(_0x55bb12[_0x60dc('0x38')]);_0x55bb12[_0x60dc('0x39')]=_0x55bb12[_0x60dc('0x3a')];_0x55bb12[_0x60dc('0x3b')]=[_0x55bb12['channel'],_0x55bb12['channel']=_0x55bb12[_0x60dc('0x3b')]][0x0];_0x55bb12[_0x60dc('0x35')]=_0x55bb12[_0x60dc('0x38')];}else{_0x55bb12[_0x60dc('0x2e')]=_0x55bb12[_0x60dc('0x39')];_0x55bb12[_0x60dc('0x39')]=_0x55bb12[_0x60dc('0x3a')];if(_0x55bb12[_0x60dc('0x3c')]=='ANSWERED'){_0x55bb12[_0x60dc('0x21')]=_0x55bb12[_0x60dc('0x26')];}else{_0x55bb12['accountcode']='';}}}}else{_0x55bb12['callerid']=util[_0x60dc('0x23')](_0x60dc('0x3d'),_0x55bb12[_0x60dc('0x3e')],_0x55bb12['calleridnum']);}RpcVoiceCallReport[_0x60dc('0x2c')](_0x55bb12);if(_0x55bb12[_0x60dc('0x3f')]){for(var _0x417d1d=0x0;_0x417d1d<_0x55bb12['monitors'][_0x60dc('0x25')];_0x417d1d+=0x1){_0x55bb12[_0x60dc('0x40')]=_0x55bb12['monitors'][_0x417d1d][_0x60dc('0x41')];_0x55bb12['createdAt']=_0x55bb12['monitors'][_0x417d1d][_0x60dc('0x42')];if(_0x55bb12[_0x60dc('0x2f')]==_0x60dc('0x37')){_0x55bb12[_0x60dc('0x39')]=_0x55bb12[_0x60dc('0x26')];_0x55bb12[_0x60dc('0x3e')]=_0x55bb12[_0x60dc('0x43')];_0x55bb12['connectedlinenum']=_0x55bb12['accountcode'];_0x55bb12[_0x60dc('0x43')]=_0x55bb12['membername'];_0x55bb12[_0x60dc('0x2f')]=_0x55bb12[_0x60dc('0x3a')];}else if(_0x55bb12['exten']=='xcally-motion-dialer'){_0x55bb12[_0x60dc('0x39')]=_0x55bb12[_0x60dc('0x2e')];_0x55bb12[_0x60dc('0x2f')]=_0x55bb12['originatecalleridnum'];}RpcVoiceRecording[_0x60dc('0x2c')](_0x55bb12);}}};Report[_0x60dc('0x11')][_0x60dc('0x19')]=function(_0x434fbe){if(_[_0x60dc('0x44')](_0x434fbe)){_0x434fbe['forEach'](function(_0x2c3038){RpcVoiceAgentReport['create'](_0x2c3038);});}else{RpcVoiceAgentReport[_0x60dc('0x2c')](_0x434fbe);}};Report[_0x60dc('0x11')][_0x60dc('0x45')]=function(_0x4a5463){RpcVoiceDialReport['create'](_0x4a5463);var _0x509f31=undefined;var _0x23cd27=_0x4a5463['channel'];if(_[_0x60dc('0x46')](_0x23cd27,_0x60dc('0x47'))){var _0x346a72=_0x23cd27[_0x60dc('0x48')](_0x23cd27[_0x60dc('0x49')]('/')+0x1,_0x23cd27['indexOf']('@'));_0x509f31=_[_0x60dc('0x20')](this['agents'],function(_0x5bf042){return _0x5bf042[_0x60dc('0x4a')]==_0x346a72||_0x5bf042[_0x60dc('0x4b')]==_0x346a72||_0x5bf042[_0x60dc('0x21')]==_0x346a72;});}else{var _0x346a72=_0x23cd27[_0x60dc('0x48')](_0x23cd27[_0x60dc('0x49')]('/')+0x1,_0x23cd27[_0x60dc('0x4c')]('-'));_0x509f31=this[_0x60dc('0x1e')](_0x346a72);}if(_0x509f31){_0x4a5463['interface']=_[_0x60dc('0x28')](_0x509f31[_0x60dc('0x22')])?util[_0x60dc('0x23')](_0x60dc('0x24'),_0x509f31['name']):_0x509f31[_0x60dc('0x22')];_0x4a5463[_0x60dc('0x4d')]=_0x509f31[_0x60dc('0x1f')];_0x4a5463['accountcode']=_0x509f31['accountcode'];RpcMemberReport['voiceDialReport'](_0x4a5463);}};Report[_0x60dc('0x11')][_0x60dc('0x1b')]=function(_0x8d91c7){RpcVoiceTransferReport[_0x60dc('0x1b')](_0x8d91c7);};Report[_0x60dc('0x11')][_0x60dc('0x1d')]=function(_0x5ef2db){RpcVoiceTransferReport[_0x60dc('0x1d')](_0x5ef2db);};module[_0x60dc('0x4e')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index eefca8e..d202489 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 _0xf3b3=['accountcode','[syncDeviceState][UserReport]','registered','peer','status','address','[syncPeerStatus][UserReport]','exports','lodash','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','defaults','redis','localhost','socket.io-emitter','trunks','agents','registryentry','bind','registry','syncRegistry','syncDeviceState','peerstatus','syncPeerStatus','loopSyncRealTimeShow','then','actionSipShowRegistry','actionDeviceStateList','actionSipPeerStatus','catch','[loopSyncRealTimeShow]','error','inspect','prototype','resolve','isNotNull','isUndefined','emit','username','stateRegistry','state','omit','event','actionid','format','trunk:%s','name','trunk:save','[syncRegistry][UserReport]','device','local','toLowerCase','inuse','stateTime','updateStatusRealtime','telephones','toNumber','telephone:%s','telephone:save','startsWith','Local','substring','indexOf','mobile','phone'];(function(_0x314f95,_0x33f646){var _0x397feb=function(_0x34ed40){while(--_0x34ed40){_0x314f95['push'](_0x314f95['shift']());}};_0x397feb(++_0x33f646);}(_0xf3b3,0x92));var _0x3f3b=function(_0x383356,_0x33d2f5){_0x383356=_0x383356-0x0;var _0x32ee5a=_0xf3b3[_0x383356];return _0x32ee5a;};'use strict';var _=require(_0x3f3b('0x0'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x3f3b('0x1'));var Redis=require(_0x3f3b('0x2'));var config=require(_0x3f3b('0x3'));var logger=require(_0x3f3b('0x4'))(_0x3f3b('0x5'));var ami=require(_0x3f3b('0x6'));config['redis']=_[_0x3f3b('0x7')](config[_0x3f3b('0x8')],{'host':_0x3f3b('0x9'),'port':0x18eb});var io=require(_0x3f3b('0xa'))(new Redis(config[_0x3f3b('0x8')]));function UserReport(_0x7e66c9){this['trunks']=_0x7e66c9[_0x3f3b('0xb')];this[_0x3f3b('0xc')]=_0x7e66c9['agents'];this['telephones']=_0x7e66c9['telephones'];ami['on'](_0x3f3b('0xd'),this['syncRegistry'][_0x3f3b('0xe')](this));ami['on'](_0x3f3b('0xf'),this[_0x3f3b('0x10')][_0x3f3b('0xe')](this));ami['on']('devicestatechange',this[_0x3f3b('0x11')][_0x3f3b('0xe')](this));ami['on'](_0x3f3b('0x12'),this[_0x3f3b('0x13')][_0x3f3b('0xe')](this));this[_0x3f3b('0x14')]();return BPromise['resolve']()[_0x3f3b('0x15')](ami[_0x3f3b('0x16')]())[_0x3f3b('0x15')](ami[_0x3f3b('0x17')]())[_0x3f3b('0x15')](ami[_0x3f3b('0x18')]())[_0x3f3b('0x19')](loggerCatch(_0x3f3b('0x1a')));}function loggerCatch(_0x2c8cf3){return function(_0x68c7b9){logger[_0x3f3b('0x1b')](_0x2c8cf3,util[_0x3f3b('0x1c')](_0x68c7b9,{'showHidden':![],'depth':null}));};}UserReport[_0x3f3b('0x1d')][_0x3f3b('0x14')]=function(){setInterval(function(){BPromise[_0x3f3b('0x1e')]()['then'](ami[_0x3f3b('0x16')]())[_0x3f3b('0x15')](ami['actionDeviceStateList']())[_0x3f3b('0x15')](ami[_0x3f3b('0x18')]())[_0x3f3b('0x19')](loggerCatch('[loopSyncRealTimeShow]'));},0x32c8);};UserReport[_0x3f3b('0x1d')][_0x3f3b('0x1f')]=function(_0x2f660c){return _0x2f660c!==null&&!_[_0x3f3b('0x20')](_0x2f660c);};UserReport['prototype']['emit']=function(_0x1f13b5,_0x44775e,_0x348a49){io['to'](_0x1f13b5)[_0x3f3b('0x21')](_0x44775e,_0x348a49);};UserReport[_0x3f3b('0x1d')][_0x3f3b('0x10')]=function(_0x24b64b){try{if(this[_0x3f3b('0x1f')](_0x24b64b)){var _0x42b2f8=_['find'](this[_0x3f3b('0xb')],{'registry':_0x24b64b[_0x3f3b('0x22')]});if(_0x42b2f8){_0x24b64b[_0x3f3b('0x23')]=_0x24b64b[_0x3f3b('0x24')];_['merge'](_0x42b2f8,_[_0x3f3b('0x25')](_0x24b64b,[_0x3f3b('0x26'),_0x3f3b('0x27'),_0x3f3b('0x22'),_0x3f3b('0x24')]));this[_0x3f3b('0x21')](util[_0x3f3b('0x28')](_0x3f3b('0x29'),_0x42b2f8[_0x3f3b('0x2a')]),_0x3f3b('0x2b'),_0x42b2f8);}}}catch(_0x17bbc3){logger[_0x3f3b('0x1b')](_0x3f3b('0x2c'),util['inspect'](_0x17bbc3,{'showHidden':![],'depth':null}));}};UserReport[_0x3f3b('0x1d')][_0x3f3b('0x11')]=function(_0x403e2a){try{if(this[_0x3f3b('0x1f')](_0x403e2a)){if(this[_0x3f3b('0xc')][_0x403e2a[_0x3f3b('0x2d')]]){if(!this[_0x3f3b('0xc')][_0x403e2a['device']][_0x3f3b('0x2e')]||_0x403e2a['state'][_0x3f3b('0x2f')]()==_0x3f3b('0x30')){this[_0x3f3b('0xc')][_0x403e2a['device']][_0x3f3b('0x2e')]=![];if(this[_0x3f3b('0xc')][_0x403e2a[_0x3f3b('0x2d')]][_0x3f3b('0x24')]!==_0x403e2a[_0x3f3b('0x24')][_0x3f3b('0x2f')]()){this[_0x3f3b('0xc')][_0x403e2a[_0x3f3b('0x2d')]][_0x3f3b('0x31')]=_['toNumber'](moment()[_0x3f3b('0x28')]('x'));}this[_0x3f3b('0xc')][_0x403e2a[_0x3f3b('0x2d')]][_0x3f3b('0x24')]=_0x403e2a[_0x3f3b('0x24')][_0x3f3b('0x2f')]();this[_0x3f3b('0xc')][_0x403e2a[_0x3f3b('0x2d')]][_0x3f3b('0x32')](_0x403e2a);}}else if(this['telephones'][_0x403e2a[_0x3f3b('0x2d')]]){if(this[_0x3f3b('0x33')][_0x403e2a[_0x3f3b('0x2d')]][_0x3f3b('0x24')]!==_0x403e2a[_0x3f3b('0x24')]['toLowerCase']()){this[_0x3f3b('0x33')][_0x403e2a[_0x3f3b('0x2d')]][_0x3f3b('0x31')]=_[_0x3f3b('0x34')](moment()['format']('x'));}this[_0x3f3b('0x33')][_0x403e2a['device']][_0x3f3b('0x24')]=_0x403e2a[_0x3f3b('0x24')][_0x3f3b('0x2f')]();this[_0x3f3b('0x21')](util['format'](_0x3f3b('0x35'),this[_0x3f3b('0x33')][_0x403e2a['device']][_0x3f3b('0x2a')]),_0x3f3b('0x36'),this[_0x3f3b('0x33')][_0x403e2a[_0x3f3b('0x2d')]]);}else if(this['trunks'][_0x403e2a[_0x3f3b('0x2d')]]){if(this['trunks'][_0x403e2a[_0x3f3b('0x2d')]][_0x3f3b('0x24')]!==_0x403e2a[_0x3f3b('0x24')][_0x3f3b('0x2f')]()){this[_0x3f3b('0xb')][_0x403e2a[_0x3f3b('0x2d')]][_0x3f3b('0x31')]=_[_0x3f3b('0x34')](moment()[_0x3f3b('0x28')]('x'));}this[_0x3f3b('0xb')][_0x403e2a[_0x3f3b('0x2d')]][_0x3f3b('0x24')]=_0x403e2a[_0x3f3b('0x24')][_0x3f3b('0x2f')]();this[_0x3f3b('0x21')](util[_0x3f3b('0x28')](_0x3f3b('0x29'),this[_0x3f3b('0xb')][_0x403e2a['device']][_0x3f3b('0x2a')]),_0x3f3b('0x2b'),this[_0x3f3b('0xb')][_0x403e2a[_0x3f3b('0x2d')]]);}else if(_[_0x3f3b('0x37')](_0x403e2a[_0x3f3b('0x2d')],'Queue')){}else if(_[_0x3f3b('0x37')](_0x403e2a[_0x3f3b('0x2d')],_0x3f3b('0x38'))){var _0x202641=_0x403e2a[_0x3f3b('0x2d')];var _0xe37930=_0x202641[_0x3f3b('0x39')](_0x202641[_0x3f3b('0x3a')]('/')+0x1,_0x202641[_0x3f3b('0x3a')]('@'));var _0xa51467=_['find'](this[_0x3f3b('0xc')],function(_0x4cba92){return _0x4cba92[_0x3f3b('0x3b')]==_0xe37930||_0x4cba92[_0x3f3b('0x3c')]==_0xe37930||_0x4cba92[_0x3f3b('0x3d')]==_0xe37930;});if(_0xa51467){if(_0xa51467[_0x3f3b('0x24')]!==_0x403e2a[_0x3f3b('0x24')][_0x3f3b('0x2f')]()){_0xa51467[_0x3f3b('0x31')]=_[_0x3f3b('0x34')](moment()[_0x3f3b('0x28')]('x'));}_0xa51467[_0x3f3b('0x24')]=_0x403e2a['state'][_0x3f3b('0x2f')]();_0xa51467['local']=!![];_0xa51467[_0x3f3b('0x32')](_0x403e2a);}}else{}}}catch(_0x512c80){logger[_0x3f3b('0x1b')](_0x3f3b('0x3e'),util[_0x3f3b('0x1c')](_0x512c80,{'showHidden':![],'depth':null}));}};UserReport[_0x3f3b('0x1d')][_0x3f3b('0x13')]=function(_0x382bea){try{if(this[_0x3f3b('0x1f')](_0x382bea)&&this['isNotNull'](_0x382bea[_0x3f3b('0x12')])){if(this['agents'][_0x382bea['peer']]){if(!this['agents'][_0x382bea['peer']][_0x3f3b('0x2e')]||_0x382bea[_0x3f3b('0x12')][_0x3f3b('0x2f')]()==_0x3f3b('0x3f')){this[_0x3f3b('0xc')][_0x382bea[_0x3f3b('0x40')]][_0x3f3b('0x2e')]=![];this[_0x3f3b('0xc')][_0x382bea[_0x3f3b('0x40')]][_0x3f3b('0x41')]=_0x382bea[_0x3f3b('0x12')][_0x3f3b('0x2f')]();this[_0x3f3b('0xc')][_0x382bea[_0x3f3b('0x40')]]['address']=_0x382bea[_0x3f3b('0x42')];this['agents'][_0x382bea[_0x3f3b('0x40')]][_0x3f3b('0x32')](_0x382bea);}}else if(this[_0x3f3b('0x33')][_0x382bea[_0x3f3b('0x40')]]){this[_0x3f3b('0x33')][_0x382bea[_0x3f3b('0x40')]]['status']=_0x382bea['peerstatus'][_0x3f3b('0x2f')]();this[_0x3f3b('0x33')][_0x382bea[_0x3f3b('0x40')]][_0x3f3b('0x42')]=_0x382bea[_0x3f3b('0x42')];this[_0x3f3b('0x21')](util[_0x3f3b('0x28')](_0x3f3b('0x35'),this[_0x3f3b('0x33')][_0x382bea[_0x3f3b('0x40')]][_0x3f3b('0x2a')]),_0x3f3b('0x36'),this['telephones'][_0x382bea[_0x3f3b('0x40')]]);}else if(this[_0x3f3b('0xb')][_0x382bea['peer']]){this[_0x3f3b('0xb')][_0x382bea[_0x3f3b('0x40')]][_0x3f3b('0x41')]=_0x382bea['peerstatus']['toLowerCase']();this[_0x3f3b('0xb')][_0x382bea[_0x3f3b('0x40')]]['address']=_0x382bea[_0x3f3b('0x42')];this[_0x3f3b('0x21')](util['format']('trunk:%s',this[_0x3f3b('0xb')][_0x382bea['peer']][_0x3f3b('0x2a')]),_0x3f3b('0x2b'),this['trunks'][_0x382bea[_0x3f3b('0x40')]]);}else{}}}catch(_0x24fd55){logger['error'](_0x3f3b('0x43'),util['inspect'](_0x24fd55,{'showHidden':![],'depth':null}));}};module[_0x3f3b('0x44')]=UserReport; \ No newline at end of file +var _0x59de=['devicestatechange','syncDeviceState','peerstatus','loopSyncRealTimeShow','resolve','then','actionSipShowRegistry','actionDeviceStateList','actionSipPeerStatus','catch','[loopSyncRealTimeShow]','inspect','prototype','isNotNull','isUndefined','emit','find','username','state','merge','format','trunk:%s','name','trunk:save','[syncRegistry][UserReport]','device','toLowerCase','inuse','local','stateTime','toNumber','updateStatusRealtime','telephone:%s','telephone:save','startsWith','Queue','Local','substring','indexOf','mobile','phone','error','[syncDeviceState][UserReport]','peer','registered','status','address','[syncPeerStatus][UserReport]','exports','lodash','moment','bluebird','util','ioredis','../../../config/environment','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','registry'];(function(_0x7b4bd8,_0x383ae8){var _0x1b70ce=function(_0x597000){while(--_0x597000){_0x7b4bd8['push'](_0x7b4bd8['shift']());}};_0x1b70ce(++_0x383ae8);}(_0x59de,0x13d));var _0xe59d=function(_0xa711b,_0x81a280){_0xa711b=_0xa711b-0x0;var _0x1f061d=_0x59de[_0xa711b];return _0x1f061d;};'use strict';var _=require(_0xe59d('0x0'));var moment=require(_0xe59d('0x1'));var BPromise=require(_0xe59d('0x2'));var util=require(_0xe59d('0x3'));var Redis=require(_0xe59d('0x4'));var config=require(_0xe59d('0x5'));var logger=require('../../../config/logger')('ami');var ami=require(_0xe59d('0x6'));config[_0xe59d('0x7')]=_[_0xe59d('0x8')](config['redis'],{'host':_0xe59d('0x9'),'port':0x18eb});var io=require(_0xe59d('0xa'))(new Redis(config[_0xe59d('0x7')]));function UserReport(_0x245e91){this[_0xe59d('0xb')]=_0x245e91[_0xe59d('0xb')];this[_0xe59d('0xc')]=_0x245e91[_0xe59d('0xc')];this[_0xe59d('0xd')]=_0x245e91[_0xe59d('0xd')];ami['on'](_0xe59d('0xe'),this[_0xe59d('0xf')][_0xe59d('0x10')](this));ami['on'](_0xe59d('0x11'),this['syncRegistry']['bind'](this));ami['on'](_0xe59d('0x12'),this[_0xe59d('0x13')]['bind'](this));ami['on'](_0xe59d('0x14'),this['syncPeerStatus'][_0xe59d('0x10')](this));this[_0xe59d('0x15')]();return BPromise[_0xe59d('0x16')]()[_0xe59d('0x17')](ami[_0xe59d('0x18')]())[_0xe59d('0x17')](ami[_0xe59d('0x19')]())['then'](ami[_0xe59d('0x1a')]())[_0xe59d('0x1b')](loggerCatch(_0xe59d('0x1c')));}function loggerCatch(_0x606a1b){return function(_0x58e4b5){logger['error'](_0x606a1b,util[_0xe59d('0x1d')](_0x58e4b5,{'showHidden':![],'depth':null}));};}UserReport['prototype'][_0xe59d('0x15')]=function(){setInterval(function(){BPromise[_0xe59d('0x16')]()[_0xe59d('0x17')](ami[_0xe59d('0x18')]())['then'](ami['actionDeviceStateList']())[_0xe59d('0x17')](ami[_0xe59d('0x1a')]())[_0xe59d('0x1b')](loggerCatch(_0xe59d('0x1c')));},0x32c8);};UserReport[_0xe59d('0x1e')][_0xe59d('0x1f')]=function(_0x442985){return _0x442985!==null&&!_[_0xe59d('0x20')](_0x442985);};UserReport['prototype'][_0xe59d('0x21')]=function(_0x210369,_0x249a00,_0x105b8b){io['to'](_0x210369)[_0xe59d('0x21')](_0x249a00,_0x105b8b);};UserReport[_0xe59d('0x1e')][_0xe59d('0xf')]=function(_0x4d3445){try{if(this[_0xe59d('0x1f')](_0x4d3445)){var _0x2e6616=_[_0xe59d('0x22')](this[_0xe59d('0xb')],{'registry':_0x4d3445[_0xe59d('0x23')]});if(_0x2e6616){_0x4d3445['stateRegistry']=_0x4d3445[_0xe59d('0x24')];_[_0xe59d('0x25')](_0x2e6616,_['omit'](_0x4d3445,['event','actionid','username',_0xe59d('0x24')]));this[_0xe59d('0x21')](util[_0xe59d('0x26')](_0xe59d('0x27'),_0x2e6616[_0xe59d('0x28')]),_0xe59d('0x29'),_0x2e6616);}}}catch(_0x5e4701){logger['error'](_0xe59d('0x2a'),util[_0xe59d('0x1d')](_0x5e4701,{'showHidden':![],'depth':null}));}};UserReport[_0xe59d('0x1e')][_0xe59d('0x13')]=function(_0x4ae5a1){try{if(this[_0xe59d('0x1f')](_0x4ae5a1)){if(this[_0xe59d('0xc')][_0x4ae5a1[_0xe59d('0x2b')]]){if(!this[_0xe59d('0xc')][_0x4ae5a1[_0xe59d('0x2b')]]['local']||_0x4ae5a1[_0xe59d('0x24')][_0xe59d('0x2c')]()==_0xe59d('0x2d')){this[_0xe59d('0xc')][_0x4ae5a1[_0xe59d('0x2b')]][_0xe59d('0x2e')]=![];if(this[_0xe59d('0xc')][_0x4ae5a1[_0xe59d('0x2b')]][_0xe59d('0x24')]!==_0x4ae5a1[_0xe59d('0x24')][_0xe59d('0x2c')]()){this[_0xe59d('0xc')][_0x4ae5a1[_0xe59d('0x2b')]][_0xe59d('0x2f')]=_[_0xe59d('0x30')](moment()[_0xe59d('0x26')]('x'));}this[_0xe59d('0xc')][_0x4ae5a1[_0xe59d('0x2b')]][_0xe59d('0x24')]=_0x4ae5a1[_0xe59d('0x24')][_0xe59d('0x2c')]();this[_0xe59d('0xc')][_0x4ae5a1[_0xe59d('0x2b')]][_0xe59d('0x31')](_0x4ae5a1);}}else if(this[_0xe59d('0xd')][_0x4ae5a1[_0xe59d('0x2b')]]){if(this['telephones'][_0x4ae5a1['device']][_0xe59d('0x24')]!==_0x4ae5a1[_0xe59d('0x24')]['toLowerCase']()){this[_0xe59d('0xd')][_0x4ae5a1[_0xe59d('0x2b')]][_0xe59d('0x2f')]=_[_0xe59d('0x30')](moment()[_0xe59d('0x26')]('x'));}this[_0xe59d('0xd')][_0x4ae5a1[_0xe59d('0x2b')]][_0xe59d('0x24')]=_0x4ae5a1[_0xe59d('0x24')][_0xe59d('0x2c')]();this[_0xe59d('0x21')](util['format'](_0xe59d('0x32'),this['telephones'][_0x4ae5a1[_0xe59d('0x2b')]][_0xe59d('0x28')]),_0xe59d('0x33'),this[_0xe59d('0xd')][_0x4ae5a1[_0xe59d('0x2b')]]);}else if(this[_0xe59d('0xb')][_0x4ae5a1[_0xe59d('0x2b')]]){if(this['trunks'][_0x4ae5a1[_0xe59d('0x2b')]]['state']!==_0x4ae5a1[_0xe59d('0x24')]['toLowerCase']()){this[_0xe59d('0xb')][_0x4ae5a1[_0xe59d('0x2b')]][_0xe59d('0x2f')]=_[_0xe59d('0x30')](moment()['format']('x'));}this['trunks'][_0x4ae5a1[_0xe59d('0x2b')]][_0xe59d('0x24')]=_0x4ae5a1[_0xe59d('0x24')][_0xe59d('0x2c')]();this[_0xe59d('0x21')](util[_0xe59d('0x26')](_0xe59d('0x27'),this['trunks'][_0x4ae5a1[_0xe59d('0x2b')]][_0xe59d('0x28')]),_0xe59d('0x29'),this[_0xe59d('0xb')][_0x4ae5a1[_0xe59d('0x2b')]]);}else if(_[_0xe59d('0x34')](_0x4ae5a1[_0xe59d('0x2b')],_0xe59d('0x35'))){}else if(_[_0xe59d('0x34')](_0x4ae5a1[_0xe59d('0x2b')],_0xe59d('0x36'))){var _0x5dde3e=_0x4ae5a1[_0xe59d('0x2b')];var _0x296add=_0x5dde3e[_0xe59d('0x37')](_0x5dde3e['indexOf']('/')+0x1,_0x5dde3e[_0xe59d('0x38')]('@'));var _0x504ec6=_[_0xe59d('0x22')](this[_0xe59d('0xc')],function(_0x983c4){return _0x983c4[_0xe59d('0x39')]==_0x296add||_0x983c4[_0xe59d('0x3a')]==_0x296add||_0x983c4['accountcode']==_0x296add;});if(_0x504ec6){if(_0x504ec6[_0xe59d('0x24')]!==_0x4ae5a1[_0xe59d('0x24')]['toLowerCase']()){_0x504ec6[_0xe59d('0x2f')]=_['toNumber'](moment()[_0xe59d('0x26')]('x'));}_0x504ec6[_0xe59d('0x24')]=_0x4ae5a1[_0xe59d('0x24')][_0xe59d('0x2c')]();_0x504ec6[_0xe59d('0x2e')]=!![];_0x504ec6['updateStatusRealtime'](_0x4ae5a1);}}else{}}}catch(_0x2836ff){logger[_0xe59d('0x3b')](_0xe59d('0x3c'),util[_0xe59d('0x1d')](_0x2836ff,{'showHidden':![],'depth':null}));}};UserReport[_0xe59d('0x1e')]['syncPeerStatus']=function(_0x255cad){try{if(this[_0xe59d('0x1f')](_0x255cad)&&this[_0xe59d('0x1f')](_0x255cad[_0xe59d('0x14')])){if(this[_0xe59d('0xc')][_0x255cad[_0xe59d('0x3d')]]){if(!this['agents'][_0x255cad[_0xe59d('0x3d')]][_0xe59d('0x2e')]||_0x255cad[_0xe59d('0x14')][_0xe59d('0x2c')]()==_0xe59d('0x3e')){this[_0xe59d('0xc')][_0x255cad[_0xe59d('0x3d')]][_0xe59d('0x2e')]=![];this['agents'][_0x255cad['peer']][_0xe59d('0x3f')]=_0x255cad['peerstatus'][_0xe59d('0x2c')]();this[_0xe59d('0xc')][_0x255cad[_0xe59d('0x3d')]][_0xe59d('0x40')]=_0x255cad['address'];this[_0xe59d('0xc')][_0x255cad[_0xe59d('0x3d')]][_0xe59d('0x31')](_0x255cad);}}else if(this[_0xe59d('0xd')][_0x255cad['peer']]){this[_0xe59d('0xd')][_0x255cad[_0xe59d('0x3d')]][_0xe59d('0x3f')]=_0x255cad['peerstatus'][_0xe59d('0x2c')]();this['telephones'][_0x255cad[_0xe59d('0x3d')]]['address']=_0x255cad[_0xe59d('0x40')];this['emit'](util['format'](_0xe59d('0x32'),this[_0xe59d('0xd')][_0x255cad['peer']][_0xe59d('0x28')]),_0xe59d('0x33'),this['telephones'][_0x255cad[_0xe59d('0x3d')]]);}else if(this[_0xe59d('0xb')][_0x255cad[_0xe59d('0x3d')]]){this['trunks'][_0x255cad['peer']][_0xe59d('0x3f')]=_0x255cad[_0xe59d('0x14')][_0xe59d('0x2c')]();this[_0xe59d('0xb')][_0x255cad[_0xe59d('0x3d')]][_0xe59d('0x40')]=_0x255cad[_0xe59d('0x40')];this[_0xe59d('0x21')](util['format'](_0xe59d('0x27'),this[_0xe59d('0xb')][_0x255cad[_0xe59d('0x3d')]][_0xe59d('0x28')]),_0xe59d('0x29'),this[_0xe59d('0xb')][_0x255cad['peer']]);}else{}}}catch(_0x5677d1){logger[_0xe59d('0x3b')](_0xe59d('0x41'),util[_0xe59d('0x1d')](_0x5677d1,{'showHidden':![],'depth':null}));}};module[_0xe59d('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 9a3dd7f..e8f3fb7 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 _0xa486=['memberpenalty','memberrealtime','includes','syncHangup','values','[syncHangup][VoiceAgentReport]','transfereeuniqueid','origtransfereruniqueid','diff','seconds','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','channel','substring','lastIndexOf','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','[syncMusicOnHoldStop][VoiceAgentReport]','lodash','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','socket.io-emitter','channels','voiceQueues','agents','variables','agentcalled','bind','agentringnoanswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','varset','syncVarSet','hangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','syncAgentCalled','uniqueid','format','called','queue','inbound','merge','omit','destuniqueid','membername','user:called','error','[syncAgentCalled][VoiceAgentReport]','inspect','syncAgentConnect','agentconnectAt','YYYY-MM-DD\x20HH:mm:ss','lastevent','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','interface','pick','destconnectedlinenum','agentringnoanswerAt','reason','answered_elsewhere','answeredelsewheremembername','custom:agentansweredelsewhere','[syncAgentConnect][VoiceAgentReport]','rejected','custom:agentringnoanswer','[syncAgentRingNoAnswer][VoiceAgentReport]','hasOwnProperty','abandoned','custom:agentqueuecallerabandon','[syncQueueCallerAbandon][VoiceAgentReport]','agentcompleteAt','complete','talktime','transfer','agent','acw','acwtime','acwTimeout','user:agentcomplete','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','keys','variable','value','addVariable','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','memberdynamic','memberinterface','memberlastcall'];(function(_0x5380f5,_0x276c31){var _0x6eb70a=function(_0x588e7e){while(--_0x588e7e){_0x5380f5['push'](_0x5380f5['shift']());}};_0x6eb70a(++_0x276c31);}(_0xa486,0x174));var _0x6a48=function(_0x19d571,_0x4a65fd){_0x19d571=_0x19d571-0x0;var _0x40333c=_0xa486[_0x19d571];return _0x40333c;};'use strict';var _=require(_0x6a48('0x0'));var moment=require('moment');var util=require(_0x6a48('0x1'));var Redis=require(_0x6a48('0x2'));var config=require(_0x6a48('0x3'));var logger=require(_0x6a48('0x4'))(_0x6a48('0x5'));var ami=require(_0x6a48('0x6'));config[_0x6a48('0x7')]=_[_0x6a48('0x8')](config[_0x6a48('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x6a48('0x9'))(new Redis(config[_0x6a48('0x7')]));function VoiceAgentReport(_0x3692b5){this[_0x6a48('0xa')]={};this['voiceQueues']=_0x3692b5[_0x6a48('0xb')];this[_0x6a48('0xc')]=_0x3692b5[_0x6a48('0xc')];this[_0x6a48('0xd')]={};ami['on'](_0x6a48('0xe'),this['syncAgentCalled'][_0x6a48('0xf')](this));ami['on']('agentconnect',this['syncAgentConnect'][_0x6a48('0xf')](this));ami['on'](_0x6a48('0x10'),this['syncAgentRingNoAnswer'][_0x6a48('0xf')](this));ami['on'](_0x6a48('0x11'),this[_0x6a48('0x12')][_0x6a48('0xf')](this));ami['on'](_0x6a48('0x13'),this['syncAgentComplete']['bind'](this));ami['on'](_0x6a48('0x14'),this[_0x6a48('0x15')][_0x6a48('0xf')](this));ami['on'](_0x6a48('0x16'),this['syncHangup']['bind'](this));ami['on'](_0x6a48('0x17'),this[_0x6a48('0x18')]['bind'](this));ami['on'](_0x6a48('0x19'),this[_0x6a48('0x1a')][_0x6a48('0xf')](this));ami['on'](_0x6a48('0x1b'),this[_0x6a48('0x1c')][_0x6a48('0xf')](this));ami['on'](_0x6a48('0x1d'),this[_0x6a48('0x1e')]['bind'](this));}VoiceAgentReport[_0x6a48('0x1f')][_0x6a48('0x20')]=function(_0x12c05c,_0x175fbc,_0x551963){io['to'](_0x12c05c)[_0x6a48('0x20')](_0x175fbc,_0x551963);};VoiceAgentReport[_0x6a48('0x1f')][_0x6a48('0x21')]=function(_0x1f947e){return _0x1f947e!==null&&!_[_0x6a48('0x22')](_0x1f947e);};VoiceAgentReport[_0x6a48('0x1f')][_0x6a48('0x23')]=function(_0x428bb4){try{if(this[_0x6a48('0x21')](_0x428bb4)){if(_[_0x6a48('0x22')](this[_0x6a48('0xa')][_0x428bb4[_0x6a48('0x24')]])){this[_0x6a48('0xa')][_0x428bb4[_0x6a48('0x24')]]={};}if(_['isUndefined'](this['channels'][_0x428bb4[_0x6a48('0x24')]][_0x428bb4['destuniqueid']])){this[_0x6a48('0xa')][_0x428bb4[_0x6a48('0x24')]][_0x428bb4['destuniqueid']]={'agentcalledAt':moment()[_0x6a48('0x25')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0x6a48('0x26'),'variables':this[_0x6a48('0xd')][_0x428bb4[_0x6a48('0x24')]],'type':this[_0x6a48('0xb')][_0x428bb4['queue']]?this[_0x6a48('0xb')][_0x428bb4[_0x6a48('0x27')]]['type']||_0x6a48('0x28'):_0x6a48('0x28')};}_[_0x6a48('0x29')](this[_0x6a48('0xa')][_0x428bb4[_0x6a48('0x24')]][_0x428bb4['destuniqueid']],_[_0x6a48('0x2a')](_0x428bb4,['event','privilege']));ami[_0x6a48('0x20')]('custom:agentcalled',this[_0x6a48('0xa')][_0x428bb4['uniqueid']][_0x428bb4[_0x6a48('0x2b')]]);this[_0x6a48('0x20')](util[_0x6a48('0x25')]('user:%s',_0x428bb4[_0x6a48('0x2c')]),_0x6a48('0x2d'),this['channels'][_0x428bb4[_0x6a48('0x24')]][_0x428bb4[_0x6a48('0x2b')]]);}}catch(_0x405edb){logger[_0x6a48('0x2e')](_0x6a48('0x2f'),util[_0x6a48('0x30')](_0x405edb,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6a48('0x1f')][_0x6a48('0x31')]=function(_0x5b4c5c){try{if(this[_0x6a48('0x21')](_0x5b4c5c)){if(this[_0x6a48('0xa')][_0x5b4c5c[_0x6a48('0x24')]]){for(var _0x356b96 in this[_0x6a48('0xa')][_0x5b4c5c[_0x6a48('0x24')]]){if(this[_0x6a48('0xa')][_0x5b4c5c[_0x6a48('0x24')]]['hasOwnProperty'](_0x356b96)){if(_0x5b4c5c['destuniqueid']===_0x356b96){this[_0x6a48('0xa')][_0x5b4c5c['uniqueid']][_0x356b96][_0x6a48('0x32')]=moment()[_0x6a48('0x25')](_0x6a48('0x33'));this[_0x6a48('0xa')][_0x5b4c5c[_0x6a48('0x24')]][_0x356b96][_0x6a48('0x34')]=_0x6a48('0x35');this[_0x6a48('0xa')][_0x5b4c5c['uniqueid']][_0x356b96][_0x6a48('0x36')]=_0x5b4c5c[_0x6a48('0x36')];this['channels'][_0x5b4c5c[_0x6a48('0x24')]][_0x356b96][_0x6a48('0x37')]=_0x5b4c5c[_0x6a48('0x37')];this[_0x6a48('0xa')][_0x5b4c5c[_0x6a48('0x24')]][_0x356b96][_0x6a48('0x38')]=_0x5b4c5c['connectedlinename'];this[_0x6a48('0xa')][_0x5b4c5c[_0x6a48('0x24')]][_0x356b96][_0x6a48('0x39')]=_0x5b4c5c[_0x6a48('0x39')];this[_0x6a48('0xa')][_0x5b4c5c[_0x6a48('0x24')]][_0x356b96][_0x6a48('0x3a')]=_0x5b4c5c['destchannelstatedesc'];_['merge'](this[_0x6a48('0xc')][_0x5b4c5c[_0x6a48('0x3b')]],_[_0x6a48('0x3c')](_0x5b4c5c,[_0x6a48('0x27'),_0x6a48('0x3d')]));this['emit'](util[_0x6a48('0x25')]('user:%s',_0x5b4c5c[_0x6a48('0x2c')]),'user:agentconnect',this[_0x6a48('0xa')][_0x5b4c5c[_0x6a48('0x24')]][_0x5b4c5c['destuniqueid']]);ami[_0x6a48('0x20')]('custom:agentconnect',this[_0x6a48('0xa')][_0x5b4c5c['uniqueid']][_0x356b96]);}else if(!this[_0x6a48('0xa')][_0x5b4c5c[_0x6a48('0x24')]][_0x356b96]['agentringnoanswer']&&!this['channels'][_0x5b4c5c['uniqueid']][_0x356b96]['agentcomplete']){this[_0x6a48('0xa')][_0x5b4c5c[_0x6a48('0x24')]][_0x356b96]['agentringnoanswer']=!![];this['channels'][_0x5b4c5c[_0x6a48('0x24')]][_0x356b96][_0x6a48('0x3e')]=moment()['format'](_0x6a48('0x33'));this[_0x6a48('0xa')][_0x5b4c5c[_0x6a48('0x24')]][_0x356b96][_0x6a48('0x3f')]='answered_elsewhere';this[_0x6a48('0xa')][_0x5b4c5c[_0x6a48('0x24')]][_0x356b96][_0x6a48('0x34')]=_0x6a48('0x40');this[_0x6a48('0xa')][_0x5b4c5c[_0x6a48('0x24')]][_0x356b96]['answeredelsewheredestinationuniqueid']=_0x5b4c5c[_0x6a48('0x2b')];this[_0x6a48('0xa')][_0x5b4c5c[_0x6a48('0x24')]][_0x356b96][_0x6a48('0x41')]=_0x5b4c5c[_0x6a48('0x2c')];ami[_0x6a48('0x20')](_0x6a48('0x42'),this[_0x6a48('0xa')][_0x5b4c5c[_0x6a48('0x24')]][_0x356b96]);}}}}}}catch(_0x15dbac){logger[_0x6a48('0x2e')](_0x6a48('0x43'),util[_0x6a48('0x30')](_0x15dbac,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6a48('0x1f')]['syncAgentRingNoAnswer']=function(_0x5d5c6a){try{if(this[_0x6a48('0x21')](_0x5d5c6a)){if(this[_0x6a48('0xa')][_0x5d5c6a[_0x6a48('0x24')]]&&this[_0x6a48('0xa')][_0x5d5c6a['uniqueid']][_0x5d5c6a[_0x6a48('0x2b')]]){this['channels'][_0x5d5c6a[_0x6a48('0x24')]][_0x5d5c6a[_0x6a48('0x2b')]][_0x6a48('0x10')]=!![];this[_0x6a48('0xa')][_0x5d5c6a['uniqueid']][_0x5d5c6a['destuniqueid']][_0x6a48('0x3e')]=moment()[_0x6a48('0x25')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x5d5c6a['uniqueid']][_0x5d5c6a[_0x6a48('0x2b')]][_0x6a48('0x3f')]=_0x6a48('0x44');this['channels'][_0x5d5c6a['uniqueid']][_0x5d5c6a[_0x6a48('0x2b')]][_0x6a48('0x34')]=_0x6a48('0x44');ami['emit'](_0x6a48('0x45'),this[_0x6a48('0xa')][_0x5d5c6a['uniqueid']][_0x5d5c6a[_0x6a48('0x2b')]]);}}}catch(_0x11b7e9){logger[_0x6a48('0x2e')](_0x6a48('0x46'),util[_0x6a48('0x30')](_0x11b7e9,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6a48('0x1f')]['syncQueueCallerAbandon']=function(_0xfa9783){try{if(this[_0x6a48('0x21')](_0xfa9783)){if(this[_0x6a48('0xa')][_0xfa9783[_0x6a48('0x24')]]){for(var _0x444985 in this[_0x6a48('0xa')][_0xfa9783[_0x6a48('0x24')]]){if(this['channels'][_0xfa9783['uniqueid']][_0x6a48('0x47')](_0x444985)&&!this[_0x6a48('0xa')][_0xfa9783[_0x6a48('0x24')]][_0x444985][_0x6a48('0x10')]&&!this[_0x6a48('0xa')][_0xfa9783[_0x6a48('0x24')]][_0x444985][_0x6a48('0x13')]){this['channels'][_0xfa9783[_0x6a48('0x24')]][_0x444985][_0x6a48('0x10')]=!![];this['channels'][_0xfa9783['uniqueid']][_0x444985][_0x6a48('0x3e')]=moment()['format'](_0x6a48('0x33'));this[_0x6a48('0xa')][_0xfa9783[_0x6a48('0x24')]][_0x444985][_0x6a48('0x3f')]='abandoned';this['channels'][_0xfa9783['uniqueid']][_0x444985][_0x6a48('0x34')]=_0x6a48('0x48');ami[_0x6a48('0x20')](_0x6a48('0x49'),this[_0x6a48('0xa')][_0xfa9783['uniqueid']][_0x444985]);}}}}}catch(_0xde3e9e){logger['error'](_0x6a48('0x4a'),util[_0x6a48('0x30')](_0xde3e9e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6a48('0x1f')]['syncAgentComplete']=function(_0x4d6eaa){try{if(this['isNotNull'](_0x4d6eaa)){if(this['channels'][_0x4d6eaa[_0x6a48('0x24')]]){for(var _0x53fc6b in this[_0x6a48('0xa')][_0x4d6eaa['uniqueid']]){if(this[_0x6a48('0xa')][_0x4d6eaa[_0x6a48('0x24')]][_0x6a48('0x47')](_0x53fc6b)){if(this[_0x6a48('0xa')][_0x4d6eaa[_0x6a48('0x24')]][_0x53fc6b][_0x6a48('0x32')]&&!this[_0x6a48('0xa')][_0x4d6eaa['uniqueid']][_0x53fc6b]['agentcomplete']){this[_0x6a48('0xa')][_0x4d6eaa[_0x6a48('0x24')]][_0x53fc6b]['agentcomplete']=!![];this[_0x6a48('0xa')][_0x4d6eaa[_0x6a48('0x24')]][_0x53fc6b][_0x6a48('0x4b')]=moment()['format'](_0x6a48('0x33'));this[_0x6a48('0xa')][_0x4d6eaa['uniqueid']][_0x53fc6b]['lastevent']=_0x6a48('0x4c');this['channels'][_0x4d6eaa[_0x6a48('0x24')]][_0x53fc6b][_0x6a48('0x4d')]=_0x4d6eaa['talktime'];this[_0x6a48('0xa')][_0x4d6eaa[_0x6a48('0x24')]][_0x53fc6b]['reason']=_0x4d6eaa['reason']==_0x6a48('0x4e')?_0x6a48('0x4f'):_0x4d6eaa[_0x6a48('0x3f')];if(this[_0x6a48('0xb')][_0x4d6eaa[_0x6a48('0x27')]]&&this['voiceQueues'][_0x4d6eaa[_0x6a48('0x27')]][_0x6a48('0x50')]){this['channels'][_0x4d6eaa['uniqueid']][_0x53fc6b]['agentacw']=!![];this['channels'][_0x4d6eaa[_0x6a48('0x24')]][_0x53fc6b][_0x6a48('0x51')]=this[_0x6a48('0xb')][_0x4d6eaa[_0x6a48('0x27')]][_0x6a48('0x52')];}this[_0x6a48('0xc')][_0x4d6eaa[_0x6a48('0x3b')]]=_[_0x6a48('0x2a')](this[_0x6a48('0xc')][_0x4d6eaa[_0x6a48('0x3b')]],['queue','destconnectedlinenum']);this[_0x6a48('0x20')](util[_0x6a48('0x25')]('user:%s',_0x4d6eaa[_0x6a48('0x2c')]),_0x6a48('0x53'),this[_0x6a48('0xa')][_0x4d6eaa[_0x6a48('0x24')]][_0x53fc6b]);ami[_0x6a48('0x20')](_0x6a48('0x54'),this[_0x6a48('0xa')][_0x4d6eaa[_0x6a48('0x24')]][_0x53fc6b]);}}}}}}catch(_0x18d704){logger[_0x6a48('0x2e')](_0x6a48('0x55'),util[_0x6a48('0x30')](_0x18d704,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6a48('0x1f')][_0x6a48('0x15')]=function(_0x3b6ce2){try{if(this[_0x6a48('0x21')](_0x3b6ce2)){this['addVariable'](_0x3b6ce2[_0x6a48('0x24')],_[_0x6a48('0x56')](_0x3b6ce2[_0x6a48('0x57')])[0x0],_0x3b6ce2[_0x6a48('0x58')]);if(this[_0x6a48('0xa')][_0x3b6ce2[_0x6a48('0x24')]]){for(var _0xf062f4 in this[_0x6a48('0xa')][_0x3b6ce2[_0x6a48('0x24')]]){if(this[_0x6a48('0xa')][_0x3b6ce2[_0x6a48('0x24')]]['hasOwnProperty'](_0xf062f4)){if(_['isUndefined'](this[_0x6a48('0xa')][_0x3b6ce2[_0x6a48('0x24')]][_0xf062f4][_0x6a48('0xd')])){this['channels'][_0x3b6ce2[_0x6a48('0x24')]][_0xf062f4][_0x6a48('0xd')]={};}this['channels'][_0x3b6ce2[_0x6a48('0x24')]][_0xf062f4][_0x6a48('0xd')]=this[_0x6a48('0xd')][_0x3b6ce2[_0x6a48('0x24')]];}}}}}catch(_0x265357){logger[_0x6a48('0x2e')]('[syncVarSet][VoiceAgentReport]',util[_0x6a48('0x30')](_0x265357,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6a48('0x1f')][_0x6a48('0x59')]=function(_0x5cb7d7,_0x1d33b4,_0x5a0b3d){var _0x3beb6f=['rtpaudioqos',_0x6a48('0x5a'),_0x6a48('0x5b'),_0x6a48('0x5c'),'rtpaudioqosloss','rtpaudioqoslossbridged',_0x6a48('0x5d'),_0x6a48('0x5e'),'sipcallid','sipuri',_0x6a48('0x5f'),_0x6a48('0x60'),'membercalls',_0x6a48('0x61'),_0x6a48('0x62'),_0x6a48('0x63'),_0x6a48('0x2c'),_0x6a48('0x64'),_0x6a48('0x65')];if(!_['isNil'](_0x1d33b4)&&!_[_0x6a48('0x66')](_0x3beb6f,_0x1d33b4)){if(_[_0x6a48('0x22')](this[_0x6a48('0xd')][_0x5cb7d7])){this[_0x6a48('0xd')][_0x5cb7d7]={};}this[_0x6a48('0xd')][_0x5cb7d7][_0x1d33b4]=_0x5a0b3d;}};VoiceAgentReport[_0x6a48('0x1f')][_0x6a48('0x67')]=function(_0x5185e7){try{if(this[_0x6a48('0x21')](_0x5185e7)){if(this[_0x6a48('0xa')][_0x5185e7[_0x6a48('0x24')]]){for(var _0x32b3ac in this[_0x6a48('0xa')][_0x5185e7[_0x6a48('0x24')]]){if(this['channels'][_0x5185e7[_0x6a48('0x24')]][_0x6a48('0x47')](_0x32b3ac)){if(this[_0x6a48('0xa')][_0x5185e7[_0x6a48('0x24')]][_0x32b3ac][_0x6a48('0x3f')]=='transfer'&&this[_0x6a48('0xa')][_0x5185e7['uniqueid']][_0x32b3ac]['agentcomplete']){this[_0x6a48('0xa')][_0x5185e7[_0x6a48('0x24')]][_0x32b3ac][_0x6a48('0x4b')]=moment()['format'](_0x6a48('0x33'));}}}ami[_0x6a48('0x20')]('custom:voiceAgentReport',_[_0x6a48('0x68')](this['channels'][_0x5185e7[_0x6a48('0x24')]]));delete this[_0x6a48('0xa')][_0x5185e7[_0x6a48('0x24')]];}if(this[_0x6a48('0xd')][_0x5185e7[_0x6a48('0x24')]]){delete this[_0x6a48('0xd')][_0x5185e7['uniqueid']];}}}catch(_0x58f8a4){logger[_0x6a48('0x2e')](_0x6a48('0x69'),util[_0x6a48('0x30')](_0x58f8a4,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncAttendedTransfer']=function(_0x4a4c83){try{if(this['isNotNull'](_0x4a4c83)){if(this['channels'][_0x4a4c83[_0x6a48('0x6a')]]){for(var _0x390a94 in this[_0x6a48('0xa')][_0x4a4c83[_0x6a48('0x6a')]]){if(this['channels'][_0x4a4c83[_0x6a48('0x6a')]][_0x6a48('0x47')](_0x390a94)){if(_0x4a4c83[_0x6a48('0x6b')]===_0x390a94){var _0x4b6c5d=moment();this['channels'][_0x4a4c83['transfereeuniqueid']][_0x390a94][_0x6a48('0x13')]=!![];this[_0x6a48('0xa')][_0x4a4c83[_0x6a48('0x6a')]][_0x390a94][_0x6a48('0x4b')]=moment()['format'](_0x6a48('0x33'));this['channels'][_0x4a4c83[_0x6a48('0x6a')]][_0x390a94]['reason']=_0x6a48('0x4e');this[_0x6a48('0xa')][_0x4a4c83['transfereeuniqueid']][_0x390a94][_0x6a48('0x34')]='complete';this[_0x6a48('0xa')][_0x4a4c83[_0x6a48('0x6a')]][_0x390a94][_0x6a48('0x4d')]=_0x4b6c5d[_0x6a48('0x6c')](this[_0x6a48('0xa')][_0x4a4c83[_0x6a48('0x6a')]][_0x390a94][_0x6a48('0x32')],_0x6a48('0x6d'));}}}}if(this[_0x6a48('0xa')][_0x4a4c83['secondtransfereruniqueid']]){var _0x2d578b=this['channels'][_0x4a4c83['secondtransfereruniqueid']];this[_0x6a48('0xa')][_0x4a4c83[_0x6a48('0x6e')]]=this[_0x6a48('0xa')][_0x4a4c83[_0x6a48('0x6a')]];this['channels'][_0x4a4c83[_0x6a48('0x6a')]]=_0x2d578b;}}}catch(_0x9270b1){logger[_0x6a48('0x2e')](_0x6a48('0x6f'),util['inspect'](_0x9270b1,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6a48('0x1f')]['syncBlindTransfer']=function(_0xd26d7f){try{if(this[_0x6a48('0x21')](_0xd26d7f)){if(this[_0x6a48('0xa')][_0xd26d7f['transfereeuniqueid']]){for(var _0x177123 in this[_0x6a48('0xa')][_0xd26d7f[_0x6a48('0x6a')]]){if(this['channels'][_0xd26d7f['transfereeuniqueid']]['hasOwnProperty'](_0x177123)){if(_0xd26d7f['transfereruniqueid']===_0x177123){var _0x2041ba=moment();this[_0x6a48('0xa')][_0xd26d7f['transfereeuniqueid']][_0x177123][_0x6a48('0x13')]=!![];this[_0x6a48('0xa')][_0xd26d7f[_0x6a48('0x6a')]][_0x177123][_0x6a48('0x4b')]=_0x2041ba;this[_0x6a48('0xa')][_0xd26d7f[_0x6a48('0x6a')]][_0x177123][_0x6a48('0x3f')]=_0x6a48('0x4e');this[_0x6a48('0xa')][_0xd26d7f[_0x6a48('0x6a')]][_0x177123][_0x6a48('0x34')]=_0x6a48('0x4c');this[_0x6a48('0xa')][_0xd26d7f[_0x6a48('0x6a')]][_0x177123][_0x6a48('0x4d')]=_0x2041ba[_0x6a48('0x6c')](this[_0x6a48('0xa')][_0xd26d7f[_0x6a48('0x6a')]][_0x177123][_0x6a48('0x32')],_0x6a48('0x6d'));}}}}}}catch(_0x5d1545){logger['error']('[syncBlindTransfer][VoiceAgentReport]',util['inspect'](_0x5d1545,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6a48('0x1f')][_0x6a48('0x18')]=function(_0x29e5db){var _0x385540='';try{if(this[_0x6a48('0x21')](_0x29e5db)){if(_0x29e5db[_0x6a48('0x70')]){_0x385540=_0x29e5db['channel'][_0x6a48('0x71')](0x0,_0x29e5db[_0x6a48('0x70')][_0x6a48('0x72')]('-'));if(this[_0x6a48('0xc')][_0x385540]){this[_0x6a48('0xc')][_0x385540][_0x6a48('0x73')]=!![];}}}}catch(_0x27aa0c){logger[_0x6a48('0x2e')](_0x6a48('0x74'),util[_0x6a48('0x30')](_0x27aa0c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6a48('0x1f')]['syncMusicOnHoldStop']=function(_0x31c302){var _0x4982d1='';try{if(this[_0x6a48('0x21')](_0x31c302)){if(_0x31c302[_0x6a48('0x70')]){_0x4982d1=_0x31c302[_0x6a48('0x70')][_0x6a48('0x71')](0x0,_0x31c302[_0x6a48('0x70')][_0x6a48('0x72')]('-'));if(this[_0x6a48('0xc')][_0x4982d1]){this['agents'][_0x4982d1]['onhold']=![];}}}}catch(_0x11ca8b){logger[_0x6a48('0x2e')](_0x6a48('0x75'),util[_0x6a48('0x30')](_0x11ca8b,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file +var _0x68db=['abandoned','custom:agentqueuecallerabandon','complete','talktime','agent','acw','agentacw','acwtime','acwTimeout','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','addVariable','keys','variable','value','[syncVarSet][VoiceAgentReport]','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','membercalls','memberinterface','memberpenalty','isNil','includes','transfer','agentcompleteAt','transfereeuniqueid','origtransfereruniqueid','diff','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','transfereruniqueid','seconds','channel','substring','lastIndexOf','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','[syncMusicOnHoldStop][VoiceAgentReport]','exports','lodash','moment','util','../../../config/environment','../../../config/logger','redis','localhost','socket.io-emitter','channels','voiceQueues','agents','variables','syncAgentCalled','bind','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','emit','prototype','isNotNull','isUndefined','uniqueid','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','type','inbound','merge','omit','event','privilege','custom:agentcalled','user:%s','membername','user:called','error','[syncAgentCalled][VoiceAgentReport]','inspect','hasOwnProperty','agentconnectAt','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','interface','pick','destconnectedlinenum','user:agentconnect','agentringnoanswerAt','reason','answered_elsewhere','lastevent','answeredelsewheredestinationuniqueid','answeredelsewheremembername','custom:agentansweredelsewhere','[syncAgentConnect][VoiceAgentReport]','rejected','custom:agentringnoanswer','[syncAgentRingNoAnswer][VoiceAgentReport]'];(function(_0x1a8e9c,_0x42bea1){var _0x32d97e=function(_0x316e57){while(--_0x316e57){_0x1a8e9c['push'](_0x1a8e9c['shift']());}};_0x32d97e(++_0x42bea1);}(_0x68db,0x19b));var _0xb68d=function(_0x5fabf2,_0x4d94a7){_0x5fabf2=_0x5fabf2-0x0;var _0x57d1c4=_0x68db[_0x5fabf2];return _0x57d1c4;};'use strict';var _=require(_0xb68d('0x0'));var moment=require(_0xb68d('0x1'));var util=require(_0xb68d('0x2'));var Redis=require('ioredis');var config=require(_0xb68d('0x3'));var logger=require(_0xb68d('0x4'))('ami');var ami=require('../ami');config['redis']=_['defaults'](config[_0xb68d('0x5')],{'host':_0xb68d('0x6'),'port':0x18eb});var io=require(_0xb68d('0x7'))(new Redis(config[_0xb68d('0x5')]));function VoiceAgentReport(_0x4b4e5a){this[_0xb68d('0x8')]={};this[_0xb68d('0x9')]=_0x4b4e5a[_0xb68d('0x9')];this[_0xb68d('0xa')]=_0x4b4e5a[_0xb68d('0xa')];this[_0xb68d('0xb')]={};ami['on']('agentcalled',this[_0xb68d('0xc')][_0xb68d('0xd')](this));ami['on']('agentconnect',this[_0xb68d('0xe')]['bind'](this));ami['on'](_0xb68d('0xf'),this[_0xb68d('0x10')][_0xb68d('0xd')](this));ami['on']('queuecallerabandon',this[_0xb68d('0x11')][_0xb68d('0xd')](this));ami['on'](_0xb68d('0x12'),this[_0xb68d('0x13')][_0xb68d('0xd')](this));ami['on'](_0xb68d('0x14'),this[_0xb68d('0x15')][_0xb68d('0xd')](this));ami['on'](_0xb68d('0x16'),this[_0xb68d('0x17')]['bind'](this));ami['on'](_0xb68d('0x18'),this[_0xb68d('0x19')]['bind'](this));ami['on'](_0xb68d('0x1a'),this[_0xb68d('0x1b')][_0xb68d('0xd')](this));ami['on'](_0xb68d('0x1c'),this[_0xb68d('0x1d')][_0xb68d('0xd')](this));ami['on'](_0xb68d('0x1e'),this[_0xb68d('0x1f')][_0xb68d('0xd')](this));}VoiceAgentReport['prototype']['emit']=function(_0x484db7,_0x6c4a97,_0x2dbf78){io['to'](_0x484db7)[_0xb68d('0x20')](_0x6c4a97,_0x2dbf78);};VoiceAgentReport[_0xb68d('0x21')][_0xb68d('0x22')]=function(_0x894538){return _0x894538!==null&&!_[_0xb68d('0x23')](_0x894538);};VoiceAgentReport[_0xb68d('0x21')][_0xb68d('0xc')]=function(_0xe30868){try{if(this[_0xb68d('0x22')](_0xe30868)){if(_['isUndefined'](this[_0xb68d('0x8')][_0xe30868[_0xb68d('0x24')]])){this[_0xb68d('0x8')][_0xe30868[_0xb68d('0x24')]]={};}if(_[_0xb68d('0x23')](this['channels'][_0xe30868[_0xb68d('0x24')]][_0xe30868[_0xb68d('0x25')]])){this[_0xb68d('0x8')][_0xe30868[_0xb68d('0x24')]][_0xe30868['destuniqueid']]={'agentcalledAt':moment()[_0xb68d('0x26')](_0xb68d('0x27')),'lastevent':_0xb68d('0x28'),'variables':this['variables'][_0xe30868[_0xb68d('0x24')]],'type':this[_0xb68d('0x9')][_0xe30868[_0xb68d('0x29')]]?this[_0xb68d('0x9')][_0xe30868[_0xb68d('0x29')]][_0xb68d('0x2a')]||'inbound':_0xb68d('0x2b')};}_[_0xb68d('0x2c')](this[_0xb68d('0x8')][_0xe30868[_0xb68d('0x24')]][_0xe30868[_0xb68d('0x25')]],_[_0xb68d('0x2d')](_0xe30868,[_0xb68d('0x2e'),_0xb68d('0x2f')]));ami[_0xb68d('0x20')](_0xb68d('0x30'),this['channels'][_0xe30868[_0xb68d('0x24')]][_0xe30868['destuniqueid']]);this[_0xb68d('0x20')](util[_0xb68d('0x26')](_0xb68d('0x31'),_0xe30868[_0xb68d('0x32')]),_0xb68d('0x33'),this[_0xb68d('0x8')][_0xe30868[_0xb68d('0x24')]][_0xe30868[_0xb68d('0x25')]]);}}catch(_0x4149e8){logger[_0xb68d('0x34')](_0xb68d('0x35'),util[_0xb68d('0x36')](_0x4149e8,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb68d('0x21')][_0xb68d('0xe')]=function(_0x2586f9){try{if(this[_0xb68d('0x22')](_0x2586f9)){if(this[_0xb68d('0x8')][_0x2586f9['uniqueid']]){for(var _0x2d96c4 in this[_0xb68d('0x8')][_0x2586f9[_0xb68d('0x24')]]){if(this[_0xb68d('0x8')][_0x2586f9[_0xb68d('0x24')]][_0xb68d('0x37')](_0x2d96c4)){if(_0x2586f9[_0xb68d('0x25')]===_0x2d96c4){this[_0xb68d('0x8')][_0x2586f9[_0xb68d('0x24')]][_0x2d96c4][_0xb68d('0x38')]=moment()['format'](_0xb68d('0x27'));this['channels'][_0x2586f9[_0xb68d('0x24')]][_0x2d96c4]['lastevent']='connect';this[_0xb68d('0x8')][_0x2586f9[_0xb68d('0x24')]][_0x2d96c4][_0xb68d('0x39')]=_0x2586f9[_0xb68d('0x39')];this[_0xb68d('0x8')][_0x2586f9[_0xb68d('0x24')]][_0x2d96c4][_0xb68d('0x3a')]=_0x2586f9[_0xb68d('0x3a')];this[_0xb68d('0x8')][_0x2586f9[_0xb68d('0x24')]][_0x2d96c4][_0xb68d('0x3b')]=_0x2586f9[_0xb68d('0x3b')];this[_0xb68d('0x8')][_0x2586f9[_0xb68d('0x24')]][_0x2d96c4][_0xb68d('0x3c')]=_0x2586f9[_0xb68d('0x3c')];this[_0xb68d('0x8')][_0x2586f9[_0xb68d('0x24')]][_0x2d96c4][_0xb68d('0x3d')]=_0x2586f9[_0xb68d('0x3d')];_[_0xb68d('0x2c')](this[_0xb68d('0xa')][_0x2586f9[_0xb68d('0x3e')]],_[_0xb68d('0x3f')](_0x2586f9,[_0xb68d('0x29'),_0xb68d('0x40')]));this['emit'](util['format']('user:%s',_0x2586f9[_0xb68d('0x32')]),_0xb68d('0x41'),this[_0xb68d('0x8')][_0x2586f9[_0xb68d('0x24')]][_0x2586f9[_0xb68d('0x25')]]);ami[_0xb68d('0x20')]('custom:agentconnect',this[_0xb68d('0x8')][_0x2586f9[_0xb68d('0x24')]][_0x2d96c4]);}else if(!this[_0xb68d('0x8')][_0x2586f9[_0xb68d('0x24')]][_0x2d96c4][_0xb68d('0xf')]&&!this[_0xb68d('0x8')][_0x2586f9[_0xb68d('0x24')]][_0x2d96c4][_0xb68d('0x12')]){this[_0xb68d('0x8')][_0x2586f9['uniqueid']][_0x2d96c4][_0xb68d('0xf')]=!![];this[_0xb68d('0x8')][_0x2586f9[_0xb68d('0x24')]][_0x2d96c4][_0xb68d('0x42')]=moment()['format'](_0xb68d('0x27'));this[_0xb68d('0x8')][_0x2586f9[_0xb68d('0x24')]][_0x2d96c4][_0xb68d('0x43')]=_0xb68d('0x44');this[_0xb68d('0x8')][_0x2586f9[_0xb68d('0x24')]][_0x2d96c4][_0xb68d('0x45')]='answered_elsewhere';this['channels'][_0x2586f9['uniqueid']][_0x2d96c4][_0xb68d('0x46')]=_0x2586f9['destuniqueid'];this['channels'][_0x2586f9[_0xb68d('0x24')]][_0x2d96c4][_0xb68d('0x47')]=_0x2586f9['membername'];ami[_0xb68d('0x20')](_0xb68d('0x48'),this[_0xb68d('0x8')][_0x2586f9[_0xb68d('0x24')]][_0x2d96c4]);}}}}}}catch(_0x1e73dd){logger['error'](_0xb68d('0x49'),util[_0xb68d('0x36')](_0x1e73dd,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb68d('0x21')]['syncAgentRingNoAnswer']=function(_0x56d74d){try{if(this['isNotNull'](_0x56d74d)){if(this['channels'][_0x56d74d[_0xb68d('0x24')]]&&this[_0xb68d('0x8')][_0x56d74d[_0xb68d('0x24')]][_0x56d74d['destuniqueid']]){this['channels'][_0x56d74d[_0xb68d('0x24')]][_0x56d74d['destuniqueid']]['agentringnoanswer']=!![];this[_0xb68d('0x8')][_0x56d74d['uniqueid']][_0x56d74d[_0xb68d('0x25')]][_0xb68d('0x42')]=moment()[_0xb68d('0x26')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xb68d('0x8')][_0x56d74d[_0xb68d('0x24')]][_0x56d74d[_0xb68d('0x25')]]['reason']=_0xb68d('0x4a');this[_0xb68d('0x8')][_0x56d74d[_0xb68d('0x24')]][_0x56d74d['destuniqueid']][_0xb68d('0x45')]=_0xb68d('0x4a');ami[_0xb68d('0x20')](_0xb68d('0x4b'),this['channels'][_0x56d74d[_0xb68d('0x24')]][_0x56d74d[_0xb68d('0x25')]]);}}}catch(_0x1cd2d8){logger[_0xb68d('0x34')](_0xb68d('0x4c'),util[_0xb68d('0x36')](_0x1cd2d8,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb68d('0x21')]['syncQueueCallerAbandon']=function(_0x2392ad){try{if(this[_0xb68d('0x22')](_0x2392ad)){if(this['channels'][_0x2392ad['uniqueid']]){for(var _0x31ba46 in this[_0xb68d('0x8')][_0x2392ad['uniqueid']]){if(this[_0xb68d('0x8')][_0x2392ad[_0xb68d('0x24')]][_0xb68d('0x37')](_0x31ba46)&&!this[_0xb68d('0x8')][_0x2392ad[_0xb68d('0x24')]][_0x31ba46][_0xb68d('0xf')]&&!this[_0xb68d('0x8')][_0x2392ad[_0xb68d('0x24')]][_0x31ba46][_0xb68d('0x12')]){this['channels'][_0x2392ad['uniqueid']][_0x31ba46][_0xb68d('0xf')]=!![];this[_0xb68d('0x8')][_0x2392ad['uniqueid']][_0x31ba46][_0xb68d('0x42')]=moment()[_0xb68d('0x26')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xb68d('0x8')][_0x2392ad[_0xb68d('0x24')]][_0x31ba46]['reason']=_0xb68d('0x4d');this[_0xb68d('0x8')][_0x2392ad['uniqueid']][_0x31ba46][_0xb68d('0x45')]=_0xb68d('0x4d');ami[_0xb68d('0x20')](_0xb68d('0x4e'),this[_0xb68d('0x8')][_0x2392ad[_0xb68d('0x24')]][_0x31ba46]);}}}}}catch(_0x49c76c){logger['error']('[syncQueueCallerAbandon][VoiceAgentReport]',util[_0xb68d('0x36')](_0x49c76c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb68d('0x21')]['syncAgentComplete']=function(_0x47162d){try{if(this[_0xb68d('0x22')](_0x47162d)){if(this['channels'][_0x47162d[_0xb68d('0x24')]]){for(var _0xc6ecfa in this[_0xb68d('0x8')][_0x47162d[_0xb68d('0x24')]]){if(this[_0xb68d('0x8')][_0x47162d['uniqueid']]['hasOwnProperty'](_0xc6ecfa)){if(this[_0xb68d('0x8')][_0x47162d[_0xb68d('0x24')]][_0xc6ecfa][_0xb68d('0x38')]&&!this[_0xb68d('0x8')][_0x47162d['uniqueid']][_0xc6ecfa][_0xb68d('0x12')]){this[_0xb68d('0x8')][_0x47162d[_0xb68d('0x24')]][_0xc6ecfa][_0xb68d('0x12')]=!![];this['channels'][_0x47162d[_0xb68d('0x24')]][_0xc6ecfa]['agentcompleteAt']=moment()[_0xb68d('0x26')](_0xb68d('0x27'));this[_0xb68d('0x8')][_0x47162d[_0xb68d('0x24')]][_0xc6ecfa][_0xb68d('0x45')]=_0xb68d('0x4f');this['channels'][_0x47162d['uniqueid']][_0xc6ecfa]['talktime']=_0x47162d[_0xb68d('0x50')];this[_0xb68d('0x8')][_0x47162d[_0xb68d('0x24')]][_0xc6ecfa][_0xb68d('0x43')]=_0x47162d['reason']=='transfer'?_0xb68d('0x51'):_0x47162d[_0xb68d('0x43')];if(this[_0xb68d('0x9')][_0x47162d[_0xb68d('0x29')]]&&this[_0xb68d('0x9')][_0x47162d['queue']][_0xb68d('0x52')]){this['channels'][_0x47162d[_0xb68d('0x24')]][_0xc6ecfa][_0xb68d('0x53')]=!![];this[_0xb68d('0x8')][_0x47162d['uniqueid']][_0xc6ecfa][_0xb68d('0x54')]=this[_0xb68d('0x9')][_0x47162d[_0xb68d('0x29')]][_0xb68d('0x55')];}this[_0xb68d('0xa')][_0x47162d['interface']]=_[_0xb68d('0x2d')](this[_0xb68d('0xa')][_0x47162d[_0xb68d('0x3e')]],[_0xb68d('0x29'),'destconnectedlinenum']);this[_0xb68d('0x20')](util['format'](_0xb68d('0x31'),_0x47162d[_0xb68d('0x32')]),'user:agentcomplete',this['channels'][_0x47162d[_0xb68d('0x24')]][_0xc6ecfa]);ami[_0xb68d('0x20')](_0xb68d('0x56'),this[_0xb68d('0x8')][_0x47162d[_0xb68d('0x24')]][_0xc6ecfa]);}}}}}}catch(_0x1aa629){logger['error'](_0xb68d('0x57'),util['inspect'](_0x1aa629,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb68d('0x21')][_0xb68d('0x15')]=function(_0x1fee09){try{if(this[_0xb68d('0x22')](_0x1fee09)){this[_0xb68d('0x58')](_0x1fee09['uniqueid'],_[_0xb68d('0x59')](_0x1fee09[_0xb68d('0x5a')])[0x0],_0x1fee09[_0xb68d('0x5b')]);if(this[_0xb68d('0x8')][_0x1fee09[_0xb68d('0x24')]]){for(var _0xfbb41f in this[_0xb68d('0x8')][_0x1fee09[_0xb68d('0x24')]]){if(this[_0xb68d('0x8')][_0x1fee09[_0xb68d('0x24')]]['hasOwnProperty'](_0xfbb41f)){if(_[_0xb68d('0x23')](this[_0xb68d('0x8')][_0x1fee09[_0xb68d('0x24')]][_0xfbb41f]['variables'])){this[_0xb68d('0x8')][_0x1fee09[_0xb68d('0x24')]][_0xfbb41f][_0xb68d('0xb')]={};}this[_0xb68d('0x8')][_0x1fee09[_0xb68d('0x24')]][_0xfbb41f][_0xb68d('0xb')]=this[_0xb68d('0xb')][_0x1fee09[_0xb68d('0x24')]];}}}}}catch(_0x35370a){logger[_0xb68d('0x34')](_0xb68d('0x5c'),util[_0xb68d('0x36')](_0x35370a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb68d('0x21')][_0xb68d('0x58')]=function(_0x4996f8,_0x4a806c,_0x407b17){var _0x472d3d=['rtpaudioqos',_0xb68d('0x5d'),_0xb68d('0x5e'),'rtpaudioqosjitterbridged',_0xb68d('0x5f'),_0xb68d('0x60'),_0xb68d('0x61'),_0xb68d('0x62'),_0xb68d('0x63'),'sipuri',_0xb68d('0x64'),'bridgepvtcallid',_0xb68d('0x65'),'memberdynamic',_0xb68d('0x66'),'memberlastcall',_0xb68d('0x32'),_0xb68d('0x67'),'memberrealtime'];if(!_[_0xb68d('0x68')](_0x4a806c)&&!_[_0xb68d('0x69')](_0x472d3d,_0x4a806c)){if(_[_0xb68d('0x23')](this[_0xb68d('0xb')][_0x4996f8])){this[_0xb68d('0xb')][_0x4996f8]={};}this[_0xb68d('0xb')][_0x4996f8][_0x4a806c]=_0x407b17;}};VoiceAgentReport['prototype'][_0xb68d('0x17')]=function(_0x44ca62){try{if(this['isNotNull'](_0x44ca62)){if(this['channels'][_0x44ca62[_0xb68d('0x24')]]){for(var _0x4a75a5 in this[_0xb68d('0x8')][_0x44ca62[_0xb68d('0x24')]]){if(this['channels'][_0x44ca62[_0xb68d('0x24')]][_0xb68d('0x37')](_0x4a75a5)){if(this[_0xb68d('0x8')][_0x44ca62[_0xb68d('0x24')]][_0x4a75a5][_0xb68d('0x43')]==_0xb68d('0x6a')&&this['channels'][_0x44ca62[_0xb68d('0x24')]][_0x4a75a5][_0xb68d('0x12')]){this[_0xb68d('0x8')][_0x44ca62['uniqueid']][_0x4a75a5][_0xb68d('0x6b')]=moment()['format'](_0xb68d('0x27'));}}}ami[_0xb68d('0x20')]('custom:voiceAgentReport',_['values'](this[_0xb68d('0x8')][_0x44ca62[_0xb68d('0x24')]]));delete this[_0xb68d('0x8')][_0x44ca62['uniqueid']];}if(this[_0xb68d('0xb')][_0x44ca62[_0xb68d('0x24')]]){delete this['variables'][_0x44ca62['uniqueid']];}}}catch(_0x26efc7){logger[_0xb68d('0x34')]('[syncHangup][VoiceAgentReport]',util[_0xb68d('0x36')](_0x26efc7,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb68d('0x21')][_0xb68d('0x1d')]=function(_0xe69533){try{if(this[_0xb68d('0x22')](_0xe69533)){if(this[_0xb68d('0x8')][_0xe69533['transfereeuniqueid']]){for(var _0x151a8f in this['channels'][_0xe69533[_0xb68d('0x6c')]]){if(this[_0xb68d('0x8')][_0xe69533[_0xb68d('0x6c')]][_0xb68d('0x37')](_0x151a8f)){if(_0xe69533[_0xb68d('0x6d')]===_0x151a8f){var _0x5c2514=moment();this[_0xb68d('0x8')][_0xe69533[_0xb68d('0x6c')]][_0x151a8f][_0xb68d('0x12')]=!![];this['channels'][_0xe69533['transfereeuniqueid']][_0x151a8f][_0xb68d('0x6b')]=moment()['format'](_0xb68d('0x27'));this[_0xb68d('0x8')][_0xe69533['transfereeuniqueid']][_0x151a8f]['reason']='transfer';this[_0xb68d('0x8')][_0xe69533['transfereeuniqueid']][_0x151a8f][_0xb68d('0x45')]=_0xb68d('0x4f');this[_0xb68d('0x8')][_0xe69533[_0xb68d('0x6c')]][_0x151a8f]['talktime']=_0x5c2514[_0xb68d('0x6e')](this[_0xb68d('0x8')][_0xe69533['transfereeuniqueid']][_0x151a8f][_0xb68d('0x38')],'seconds');}}}}if(this[_0xb68d('0x8')][_0xe69533['secondtransfereruniqueid']]){var _0x233d21=this[_0xb68d('0x8')][_0xe69533[_0xb68d('0x6f')]];this[_0xb68d('0x8')][_0xe69533['secondtransfereruniqueid']]=this[_0xb68d('0x8')][_0xe69533[_0xb68d('0x6c')]];this[_0xb68d('0x8')][_0xe69533[_0xb68d('0x6c')]]=_0x233d21;}}}catch(_0x29cca4){logger['error'](_0xb68d('0x70'),util[_0xb68d('0x36')](_0x29cca4,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb68d('0x21')][_0xb68d('0x1f')]=function(_0x4030b9){try{if(this['isNotNull'](_0x4030b9)){if(this['channels'][_0x4030b9[_0xb68d('0x6c')]]){for(var _0x489358 in this[_0xb68d('0x8')][_0x4030b9[_0xb68d('0x6c')]]){if(this[_0xb68d('0x8')][_0x4030b9['transfereeuniqueid']]['hasOwnProperty'](_0x489358)){if(_0x4030b9[_0xb68d('0x71')]===_0x489358){var _0x5c5fb3=moment();this['channels'][_0x4030b9[_0xb68d('0x6c')]][_0x489358][_0xb68d('0x12')]=!![];this['channels'][_0x4030b9[_0xb68d('0x6c')]][_0x489358][_0xb68d('0x6b')]=_0x5c5fb3;this['channels'][_0x4030b9[_0xb68d('0x6c')]][_0x489358][_0xb68d('0x43')]=_0xb68d('0x6a');this[_0xb68d('0x8')][_0x4030b9['transfereeuniqueid']][_0x489358][_0xb68d('0x45')]=_0xb68d('0x4f');this[_0xb68d('0x8')][_0x4030b9[_0xb68d('0x6c')]][_0x489358]['talktime']=_0x5c5fb3[_0xb68d('0x6e')](this[_0xb68d('0x8')][_0x4030b9[_0xb68d('0x6c')]][_0x489358][_0xb68d('0x38')],_0xb68d('0x72'));}}}}}}catch(_0xfec28d){logger[_0xb68d('0x34')]('[syncBlindTransfer][VoiceAgentReport]',util[_0xb68d('0x36')](_0xfec28d,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xb68d('0x19')]=function(_0x1cc4a5){var _0x158b97='';try{if(this['isNotNull'](_0x1cc4a5)){if(_0x1cc4a5[_0xb68d('0x73')]){_0x158b97=_0x1cc4a5[_0xb68d('0x73')][_0xb68d('0x74')](0x0,_0x1cc4a5[_0xb68d('0x73')][_0xb68d('0x75')]('-'));if(this[_0xb68d('0xa')][_0x158b97]){this[_0xb68d('0xa')][_0x158b97][_0xb68d('0x76')]=!![];}}}}catch(_0x11d8e3){logger['error'](_0xb68d('0x77'),util['inspect'](_0x11d8e3,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xb68d('0x1b')]=function(_0x52ea91){var _0x69b9b4='';try{if(this[_0xb68d('0x22')](_0x52ea91)){if(_0x52ea91[_0xb68d('0x73')]){_0x69b9b4=_0x52ea91[_0xb68d('0x73')][_0xb68d('0x74')](0x0,_0x52ea91[_0xb68d('0x73')][_0xb68d('0x75')]('-'));if(this[_0xb68d('0xa')][_0x69b9b4]){this[_0xb68d('0xa')][_0x69b9b4][_0xb68d('0x76')]=![];}}}}catch(_0x26a88b){logger[_0xb68d('0x34')](_0xb68d('0x78'),util['inspect'](_0x26a88b,{'showHidden':![],'depth':null}));}};module[_0xb68d('0x79')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 1ce72cc..62567b3 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 _0xfa52=['monitorFilename','find','monitors','isNil','rec','variable','mixmonitor_filename','value','xmd-phone','xmd-cdrtype','xmd-queue','originatecalleridnum','xmd-destination','destination','xmd-callerid-preview','sipcallid','sipcalluniqueid','parse','sipcalllinkedid','[syncVarSet][VoiceCallReport]','diff','billableseconds','omit','user:agentcomplete','accountcode','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','transfertargetcalleridnum','[syncAttendedTransfer][VoiceCallReport]','transfereecalleridnum','extension','BlindTransfer','[syncBlindTransfer][VoiceCallReport]','mohstarttime','[syncMusicOnHoldStart][VoiceCallReport]','mohtime','milliseconds','[syncMusicOnHoldStop][VoiceCallReport]','bluebird','lodash','moment','util','path','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','unknown','not_inuse','inuse','busy','invalid','ringing','ringinuse','onhold','agi','dial','playback','voicemail','NO\x20ANSWER','ANSWERED','FAILED','redis','localhost','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','bind','newexten','newstate','varset','hangup','syncHangup','newcallerid','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','resolve','then','actionCoreShowChannels','catch','log','prototype','isNotNull','emit','syncNewCallerId','uniqueid','isUndefined','keys','error','[syncNewCallerId][VoiceCallReport]','inspect','syncNewChannel','linkedid','channel','OutgoingSpoolFailed','starttime','format','YYYY-MM-DD\x20HH:mm:ss','disposition','channelstate','merge','pick','context','from-sip','split','destconnectedlinenum','exten','user:%s','user:agentconnect','application','toLowerCase','appdata','subtract','duration','seconds','includes','lastapplication','lastdata','applicationdata','set','match','queue','[syncNewExten][VoiceCallReport]','syncNewState','answered','answertime','holdtime','calleridnum','xcally-motion-preview','connectedlinenum','calleridname','destinationchannel','toNumber','membername','name','UserId','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','monitor','replace','.wav49'];(function(_0x1ae491,_0x5b83b9){var _0x4958a5=function(_0xf0f364){while(--_0xf0f364){_0x1ae491['push'](_0x1ae491['shift']());}};_0x4958a5(++_0x5b83b9);}(_0xfa52,0x160));var _0x2fa5=function(_0xbbc7d4,_0x67248d){_0xbbc7d4=_0xbbc7d4-0x0;var _0x2a7f25=_0xfa52[_0xbbc7d4];return _0x2a7f25;};'use strict';var BPromise=require(_0x2fa5('0x0'));var _=require(_0x2fa5('0x1'));var moment=require(_0x2fa5('0x2'));var util=require(_0x2fa5('0x3'));var path=require(_0x2fa5('0x4'));var Redis=require(_0x2fa5('0x5'));var config=require(_0x2fa5('0x6'));var logger=require(_0x2fa5('0x7'))(_0x2fa5('0x8'));var ami=require(_0x2fa5('0x9'));var Channel=require(_0x2fa5('0xa'));var statusDesc=[_0x2fa5('0xb'),_0x2fa5('0xc'),_0x2fa5('0xd'),_0x2fa5('0xe'),_0x2fa5('0xf'),'unavailable',_0x2fa5('0x10'),_0x2fa5('0x11'),_0x2fa5('0x12')];var applications=['set','queue',_0x2fa5('0x13'),_0x2fa5('0x14'),_0x2fa5('0x15'),_0x2fa5('0x16')];var dispositions=[_0x2fa5('0x17'),'FAILED','FAILED','NO\x20ANSWER','NO\x20ANSWER',_0x2fa5('0x17'),_0x2fa5('0x18'),'BUSY','FAILED',_0x2fa5('0x19'),'FAILED'];var actions={};config[_0x2fa5('0x1a')]=_['defaults'](config[_0x2fa5('0x1a')],{'host':_0x2fa5('0x1b'),'port':0x18eb});var io=require(_0x2fa5('0x1c'))(new Redis(config[_0x2fa5('0x1a')]));function VoiceCallReport(_0x4eb36a){this['channels']=_0x4eb36a[_0x2fa5('0x1d')];this[_0x2fa5('0x1e')]=_0x4eb36a[_0x2fa5('0x1e')];ami['on'](_0x2fa5('0x1f'),this[_0x2fa5('0x20')][_0x2fa5('0x21')](this));ami['on'](_0x2fa5('0x22'),this[_0x2fa5('0x20')]['bind'](this));ami['on']('newchannel',this['syncNewChannel'][_0x2fa5('0x21')](this));ami['on'](_0x2fa5('0x23'),this['syncNewState'][_0x2fa5('0x21')](this));ami['on'](_0x2fa5('0x24'),this['syncVarSet'][_0x2fa5('0x21')](this));ami['on'](_0x2fa5('0x25'),this[_0x2fa5('0x26')]['bind'](this));ami['on'](_0x2fa5('0x27'),this['syncNewCallerId']['bind'](this));ami['on'](_0x2fa5('0x28'),this[_0x2fa5('0x29')][_0x2fa5('0x21')](this));ami['on'](_0x2fa5('0x2a'),this[_0x2fa5('0x2b')][_0x2fa5('0x21')](this));ami['on'](_0x2fa5('0x2c'),this[_0x2fa5('0x2d')][_0x2fa5('0x21')](this));ami['on'](_0x2fa5('0x2e'),this[_0x2fa5('0x2f')][_0x2fa5('0x21')](this));return BPromise[_0x2fa5('0x30')]()[_0x2fa5('0x31')](ami[_0x2fa5('0x32')]())[_0x2fa5('0x33')](function(_0x5cfebc){console[_0x2fa5('0x34')](_0x5cfebc);});}VoiceCallReport[_0x2fa5('0x35')][_0x2fa5('0x36')]=function(_0x52419d){return _0x52419d!==null&&!_['isUndefined'](_0x52419d);};VoiceCallReport[_0x2fa5('0x35')][_0x2fa5('0x37')]=function(_0x34679b,_0x67c2ea,_0x5b68d1){io['to'](_0x34679b)['emit'](_0x67c2ea,_0x5b68d1);};VoiceCallReport[_0x2fa5('0x35')][_0x2fa5('0x38')]=function(_0x58a442){try{if(this[_0x2fa5('0x36')](_0x58a442)){if(_0x58a442[_0x2fa5('0x39')]===_0x58a442['linkedid']){if(!_[_0x2fa5('0x3a')](this[_0x2fa5('0x1d')][_0x58a442[_0x2fa5('0x39')]])){_['merge'](this[_0x2fa5('0x1d')][_0x58a442['uniqueid']],_['pick'](_0x58a442,_[_0x2fa5('0x3b')](this[_0x2fa5('0x1d')][_0x58a442[_0x2fa5('0x39')]])));}}}}catch(_0x1db356){logger[_0x2fa5('0x3c')](_0x2fa5('0x3d'),util[_0x2fa5('0x3e')](_0x1db356,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2fa5('0x35')][_0x2fa5('0x3f')]=function(_0x4b0e4d){try{if(this[_0x2fa5('0x36')](_0x4b0e4d)){if(_0x4b0e4d[_0x2fa5('0x39')]===_0x4b0e4d[_0x2fa5('0x40')]&&_0x4b0e4d[_0x2fa5('0x41')]!=_0x2fa5('0x42')){if(_[_0x2fa5('0x3a')](this[_0x2fa5('0x1d')][_0x4b0e4d[_0x2fa5('0x39')]])){this[_0x2fa5('0x1d')][_0x4b0e4d[_0x2fa5('0x39')]]=new Channel();this['channels'][_0x4b0e4d[_0x2fa5('0x39')]][_0x2fa5('0x43')]=moment()[_0x2fa5('0x44')](_0x2fa5('0x45'));this['channels'][_0x4b0e4d[_0x2fa5('0x39')]][_0x2fa5('0x46')]=dispositions[_['toNumber'](_0x4b0e4d[_0x2fa5('0x47')])];_[_0x2fa5('0x48')](this[_0x2fa5('0x1d')][_0x4b0e4d['uniqueid']],_[_0x2fa5('0x49')](_0x4b0e4d,_['keys'](this[_0x2fa5('0x1d')][_0x4b0e4d[_0x2fa5('0x39')]])));if(_0x4b0e4d[_0x2fa5('0x4a')]===_0x2fa5('0x4b')){if(this[_0x2fa5('0x1e')][_0x4b0e4d[_0x2fa5('0x41')][_0x2fa5('0x4c')]('-')[0x0]]){this[_0x2fa5('0x1e')][_0x4b0e4d[_0x2fa5('0x41')]['split']('-')[0x0]][_0x2fa5('0x4d')]=_0x4b0e4d[_0x2fa5('0x4e')];this['emit'](util[_0x2fa5('0x44')](_0x2fa5('0x4f'),this['agents'][_0x4b0e4d[_0x2fa5('0x41')][_0x2fa5('0x4c')]('-')[0x0]]['name']),_0x2fa5('0x50'),{'destaccountcode':this[_0x2fa5('0x1e')][_0x4b0e4d[_0x2fa5('0x41')][_0x2fa5('0x4c')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x4b0e4d[_0x2fa5('0x4e')]});}}}}}}catch(_0x3f4921){logger[_0x2fa5('0x3c')]('[syncNewChannel][VoiceCallReport]',util[_0x2fa5('0x3e')](_0x3f4921,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2fa5('0x35')]['syncNewExten']=function(_0x562c0c){try{if(this[_0x2fa5('0x36')](_0x562c0c)){if(_0x562c0c['uniqueid']===_0x562c0c[_0x2fa5('0x40')]&&_0x562c0c[_0x2fa5('0x4e')]!='h'&&_0x562c0c[_0x2fa5('0x41')]!=_0x2fa5('0x42')){_0x562c0c[_0x2fa5('0x51')]=_0x562c0c[_0x2fa5('0x51')][_0x2fa5('0x52')]();_0x562c0c['applicationdata']=(_0x562c0c[_0x2fa5('0x53')]||_0x562c0c['applicationdata'])[_0x2fa5('0x52')]();if(_[_0x2fa5('0x3a')](this[_0x2fa5('0x1d')][_0x562c0c[_0x2fa5('0x39')]])){this['channels'][_0x562c0c['uniqueid']]=new Channel();this[_0x2fa5('0x1d')][_0x562c0c['uniqueid']][_0x2fa5('0x43')]=_0x562c0c['duration']?moment()[_0x2fa5('0x54')](moment[_0x2fa5('0x55')](_0x562c0c[_0x2fa5('0x55')])[_0x2fa5('0x56')](),_0x2fa5('0x56'))['format'](_0x2fa5('0x45')):moment()['format'](_0x2fa5('0x45'));this[_0x2fa5('0x1d')][_0x562c0c[_0x2fa5('0x39')]][_0x2fa5('0x46')]=_0x2fa5('0x17');}_[_0x2fa5('0x48')](this[_0x2fa5('0x1d')][_0x562c0c[_0x2fa5('0x39')]],_[_0x2fa5('0x49')](_0x562c0c,_[_0x2fa5('0x3b')](this['channels'][_0x562c0c[_0x2fa5('0x39')]])));if(_[_0x2fa5('0x57')](applications,_0x562c0c[_0x2fa5('0x51')])){this[_0x2fa5('0x1d')][_0x562c0c[_0x2fa5('0x39')]][_0x2fa5('0x58')]=_0x562c0c['application'];this['channels'][_0x562c0c[_0x2fa5('0x39')]][_0x2fa5('0x59')]=_0x562c0c[_0x2fa5('0x5a')];if(_0x562c0c[_0x2fa5('0x51')]===_0x2fa5('0x5b')&&_['startsWith'](_0x562c0c[_0x2fa5('0x5a')],'cdr(')){var _0x395ac1=_0x562c0c[_0x2fa5('0x5a')][_0x2fa5('0x4c')]('=');var _0x21e17b=_0x395ac1[0x0][_0x2fa5('0x5c')](/cdr\((.*)\)/);if(_0x21e17b){this[_0x2fa5('0x1d')][_0x562c0c[_0x2fa5('0x39')]][_0x21e17b[0x1]]=_0x395ac1[0x1];}}else if(_0x562c0c[_0x2fa5('0x51')]===_0x2fa5('0x5d')){this['channels'][_0x562c0c[_0x2fa5('0x39')]][_0x2fa5('0x5d')]=_0x562c0c[_0x2fa5('0x5a')][_0x2fa5('0x4c')](',')[0x0];}}}}}catch(_0x30e7b0){logger[_0x2fa5('0x3c')](_0x2fa5('0x5e'),util[_0x2fa5('0x3e')](_0x30e7b0,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2fa5('0x35')][_0x2fa5('0x5f')]=function(_0x172c5e){try{if(this[_0x2fa5('0x36')](_0x172c5e)){if(_0x172c5e[_0x2fa5('0x39')]!==_0x172c5e[_0x2fa5('0x40')]){if(this[_0x2fa5('0x1d')][_0x172c5e[_0x2fa5('0x40')]]){if(_0x172c5e['channelstate']==='6'){if(!this[_0x2fa5('0x1d')][_0x172c5e['linkedid']][_0x2fa5('0x60')]){var _0x5745dd=moment();this[_0x2fa5('0x1d')][_0x172c5e[_0x2fa5('0x40')]][_0x2fa5('0x60')]=!![];this[_0x2fa5('0x1d')][_0x172c5e['linkedid']][_0x2fa5('0x61')]=_0x5745dd['format'](_0x2fa5('0x45'));if(this[_0x2fa5('0x1d')][_0x172c5e[_0x2fa5('0x40')]][_0x2fa5('0x43')]){this[_0x2fa5('0x1d')][_0x172c5e[_0x2fa5('0x40')]][_0x2fa5('0x62')]=_0x5745dd['diff'](this[_0x2fa5('0x1d')][_0x172c5e[_0x2fa5('0x40')]][_0x2fa5('0x43')],_0x2fa5('0x56'));}}this[_0x2fa5('0x1d')][_0x172c5e[_0x2fa5('0x40')]][_0x2fa5('0x40')]=_0x172c5e[_0x2fa5('0x39')];if(_0x172c5e[_0x2fa5('0x63')]!==_0x2fa5('0x64')){this['channels'][_0x172c5e['linkedid']][_0x2fa5('0x65')]=_0x172c5e[_0x2fa5('0x63')];}this[_0x2fa5('0x1d')][_0x172c5e[_0x2fa5('0x40')]]['connectedlinename']=_0x172c5e[_0x2fa5('0x66')];this[_0x2fa5('0x1d')][_0x172c5e[_0x2fa5('0x40')]][_0x2fa5('0x67')]=_0x172c5e[_0x2fa5('0x41')];this[_0x2fa5('0x1d')][_0x172c5e['linkedid']]['disposition']=dispositions[_[_0x2fa5('0x68')](_0x172c5e[_0x2fa5('0x47')])];if(this[_0x2fa5('0x1e')][_0x172c5e[_0x2fa5('0x41')]['split']('-')[0x0]]){this[_0x2fa5('0x1d')][_0x172c5e[_0x2fa5('0x40')]]['UserId']=this[_0x2fa5('0x1e')][_0x172c5e[_0x2fa5('0x41')][_0x2fa5('0x4c')]('-')[0x0]]['id'];this[_0x2fa5('0x1d')][_0x172c5e[_0x2fa5('0x40')]][_0x2fa5('0x69')]=this[_0x2fa5('0x1e')][_0x172c5e[_0x2fa5('0x41')]['split']('-')[0x0]][_0x2fa5('0x6a')];}}}}else{if(this[_0x2fa5('0x1d')][_0x172c5e[_0x2fa5('0x39')]]){if(_0x172c5e[_0x2fa5('0x47')]==='6'){if(this[_0x2fa5('0x1e')][_0x172c5e[_0x2fa5('0x41')][_0x2fa5('0x4c')]('-')[0x0]]){this[_0x2fa5('0x1d')][_0x172c5e[_0x2fa5('0x39')]][_0x2fa5('0x6b')]=this['agents'][_0x172c5e['channel'][_0x2fa5('0x4c')]('-')[0x0]]['id'];this[_0x2fa5('0x1d')][_0x172c5e[_0x2fa5('0x39')]][_0x2fa5('0x69')]=this['agents'][_0x172c5e[_0x2fa5('0x41')][_0x2fa5('0x4c')]('-')[0x0]][_0x2fa5('0x6a')];}}}}}}catch(_0xe37767){logger[_0x2fa5('0x3c')](_0x2fa5('0x6c'),util[_0x2fa5('0x3e')](_0xe37767,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2fa5('0x35')][_0x2fa5('0x6d')]=function(_0x72d337,_0x298708){if(this[_0x2fa5('0x1d')][_0x72d337]){this['channels'][_0x72d337][_0x2fa5('0x6e')]=!![];if(_['endsWith'](_0x298708,'.wav49')){_0x298708=_0x298708[_0x2fa5('0x6f')](_0x2fa5('0x70'),'.WAV');}this[_0x2fa5('0x1d')][_0x72d337][_0x2fa5('0x71')]=_0x298708;var _0x1c0d32=_[_0x2fa5('0x72')](this[_0x2fa5('0x1d')][_0x72d337][_0x2fa5('0x73')],{'filename':_0x298708});if(_[_0x2fa5('0x74')](_0x1c0d32)){this[_0x2fa5('0x1d')][_0x72d337][_0x2fa5('0x73')]['push']({'filename':_0x298708,'createdAt':moment()[_0x2fa5('0x44')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0x2fa5('0x75')});}}};VoiceCallReport['prototype']['syncVarSet']=function(_0x578aa9){try{if(this[_0x2fa5('0x36')](_0x578aa9)){if(this[_0x2fa5('0x1d')][_0x578aa9[_0x2fa5('0x39')]]&&_0x578aa9[_0x2fa5('0x41')]!='OutgoingSpoolFailed'){if(this[_0x2fa5('0x36')](_0x578aa9[_0x2fa5('0x76')])){if(this[_0x2fa5('0x36')](_0x578aa9[_0x2fa5('0x76')][_0x2fa5('0x77')])){this[_0x2fa5('0x6d')](_0x578aa9['uniqueid'],_0x578aa9[_0x2fa5('0x78')]);}else if(this[_0x2fa5('0x36')](_0x578aa9[_0x2fa5('0x76')][_0x2fa5('0x79')])){this[_0x2fa5('0x1d')][_0x578aa9[_0x2fa5('0x39')]][_0x2fa5('0x63')]=_0x578aa9[_0x2fa5('0x78')];}else if(this[_0x2fa5('0x36')](_0x578aa9[_0x2fa5('0x76')]['xmd-callerid'])){this[_0x2fa5('0x1d')][_0x578aa9[_0x2fa5('0x39')]]['callerid']=_0x578aa9[_0x2fa5('0x78')];}else if(this['isNotNull'](_0x578aa9['variable'][_0x2fa5('0x7a')])){this[_0x2fa5('0x1d')][_0x578aa9['uniqueid']]['type']=_0x578aa9[_0x2fa5('0x78')];}else if(this[_0x2fa5('0x36')](_0x578aa9['variable'][_0x2fa5('0x7b')])){this[_0x2fa5('0x1d')][_0x578aa9[_0x2fa5('0x39')]][_0x2fa5('0x5d')]=_0x578aa9[_0x2fa5('0x78')]['split'](',')[0x0];}else if(this['isNotNull'](_0x578aa9['variable']['xmd-originatecalleridnum'])){this[_0x2fa5('0x1d')][_0x578aa9[_0x2fa5('0x39')]][_0x2fa5('0x7c')]=_0x578aa9['value'];}else if(this[_0x2fa5('0x36')](_0x578aa9[_0x2fa5('0x76')][_0x2fa5('0x7d')])){this[_0x2fa5('0x1d')][_0x578aa9[_0x2fa5('0x39')]][_0x2fa5('0x7e')]=_0x578aa9[_0x2fa5('0x78')];}else if(this[_0x2fa5('0x36')](_0x578aa9['variable'][_0x2fa5('0x7f')])){this['channels'][_0x578aa9[_0x2fa5('0x39')]]['calleridpreview']=_0x578aa9[_0x2fa5('0x78')];}else if(this[_0x2fa5('0x36')](_0x578aa9[_0x2fa5('0x76')]['xmcs-queue'])){this[_0x2fa5('0x1d')][_0x578aa9[_0x2fa5('0x39')]][_0x2fa5('0x5d')]=_0x578aa9['value'];}else if(this['isNotNull'](_0x578aa9['variable'][_0x2fa5('0x80')])){this[_0x2fa5('0x1d')][_0x578aa9['uniqueid']][_0x2fa5('0x81')]=_0x578aa9['value'];}}}else if(this[_0x2fa5('0x36')](_0x578aa9[_0x2fa5('0x76')]['mixmonitor_filename'])){if(_0x578aa9['value']){var _0x12eb7c=path[_0x2fa5('0x82')](_0x578aa9[_0x2fa5('0x78')])[_0x2fa5('0x6a')];this['syncMixMonitorFilename'](_0x12eb7c,_0x578aa9[_0x2fa5('0x78')]);}}else if(this[_0x2fa5('0x1d')][_0x578aa9[_0x2fa5('0x40')]]){if(this[_0x2fa5('0x36')](_0x578aa9[_0x2fa5('0x76')])){if(this[_0x2fa5('0x36')](_0x578aa9[_0x2fa5('0x76')][_0x2fa5('0x80')])){this[_0x2fa5('0x1d')][_0x578aa9[_0x2fa5('0x40')]][_0x2fa5('0x83')]=_0x578aa9[_0x2fa5('0x78')];}}}}}catch(_0x2fdde2){logger['error'](_0x2fa5('0x84'),util[_0x2fa5('0x3e')](_0x2fdde2,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2fa5('0x35')][_0x2fa5('0x26')]=function(_0x3c04ae){try{if(this[_0x2fa5('0x36')](_0x3c04ae)){if(this['channels'][_0x3c04ae[_0x2fa5('0x39')]]){var _0x1cabed=moment();this[_0x2fa5('0x1d')][_0x3c04ae['uniqueid']]['endtime']=_0x1cabed[_0x2fa5('0x44')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x2fa5('0x1d')][_0x3c04ae[_0x2fa5('0x39')]][_0x2fa5('0x55')]=_0x1cabed[_0x2fa5('0x85')](this[_0x2fa5('0x1d')][_0x3c04ae[_0x2fa5('0x39')]][_0x2fa5('0x43')],'seconds');if(this[_0x2fa5('0x1d')][_0x3c04ae[_0x2fa5('0x39')]][_0x2fa5('0x60')]){this[_0x2fa5('0x1d')][_0x3c04ae['uniqueid']]['billableseconds']=_0x1cabed['diff'](this['channels'][_0x3c04ae['uniqueid']]['answertime'],'seconds');this['channels'][_0x3c04ae[_0x2fa5('0x39')]][_0x2fa5('0x62')]=this[_0x2fa5('0x1d')][_0x3c04ae[_0x2fa5('0x39')]][_0x2fa5('0x55')]-this[_0x2fa5('0x1d')][_0x3c04ae['uniqueid']][_0x2fa5('0x86')];}if(_0x3c04ae[_0x2fa5('0x4a')]===_0x2fa5('0x4b')){if(this[_0x2fa5('0x1e')][_0x3c04ae[_0x2fa5('0x41')][_0x2fa5('0x4c')]('-')[0x0]]){this[_0x2fa5('0x1e')][_0x3c04ae[_0x2fa5('0x41')][_0x2fa5('0x4c')]('-')[0x0]]=_[_0x2fa5('0x87')](this[_0x2fa5('0x1e')][_0x3c04ae[_0x2fa5('0x41')][_0x2fa5('0x4c')]('-')[0x0]],[_0x2fa5('0x4d')]);this[_0x2fa5('0x37')](util[_0x2fa5('0x44')](_0x2fa5('0x4f'),this['agents'][_0x3c04ae[_0x2fa5('0x41')][_0x2fa5('0x4c')]('-')[0x0]][_0x2fa5('0x6a')]),_0x2fa5('0x88'),{'destaccountcode':this[_0x2fa5('0x1e')][_0x3c04ae[_0x2fa5('0x41')]['split']('-')[0x0]][_0x2fa5('0x89')]});}}ami[_0x2fa5('0x37')]('custom:voiceCallReport',this[_0x2fa5('0x1d')][_0x3c04ae[_0x2fa5('0x39')]]);delete this[_0x2fa5('0x1d')][_0x3c04ae[_0x2fa5('0x39')]];}}}catch(_0x452909){logger[_0x2fa5('0x3c')]('[syncHangup][VoiceCallReport]',util[_0x2fa5('0x3e')](_0x452909,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2fa5('0x35')][_0x2fa5('0x29')]=function(_0x31ae86){try{if(this['isNotNull'](_0x31ae86)){if(this['channels'][_0x31ae86[_0x2fa5('0x8a')]]){this['channels'][_0x31ae86['transfereeuniqueid']][_0x2fa5('0x8b')]=_0x31ae86[_0x2fa5('0x8c')];this[_0x2fa5('0x1d')][_0x31ae86[_0x2fa5('0x8a')]][_0x2fa5('0x8d')]=_0x31ae86['transfertargetcalleridnum'];if(this['channels'][_0x31ae86[_0x2fa5('0x8e')]]){var _0x431c7a=this['channels'][_0x31ae86[_0x2fa5('0x8e')]];this[_0x2fa5('0x1d')][_0x31ae86[_0x2fa5('0x8e')]]=this[_0x2fa5('0x1d')][_0x31ae86['transfereeuniqueid']];this[_0x2fa5('0x1d')][_0x31ae86[_0x2fa5('0x8a')]]=_0x431c7a;}}else if(this['channels'][_0x31ae86[_0x2fa5('0x8f')]]){this['channels'][_0x31ae86[_0x2fa5('0x8f')]][_0x2fa5('0x8b')]=_0x31ae86[_0x2fa5('0x8c')];this[_0x2fa5('0x1d')][_0x31ae86[_0x2fa5('0x8f')]]['transferconnectedlinenum']=_0x31ae86[_0x2fa5('0x90')];if(this[_0x2fa5('0x1d')][_0x31ae86['origtransfereruniqueid']]){var _0x431c7a=this['channels'][_0x31ae86['origtransfereruniqueid']];this['channels'][_0x31ae86['origtransfereruniqueid']]=this[_0x2fa5('0x1d')][_0x31ae86[_0x2fa5('0x8f')]];this[_0x2fa5('0x1d')][_0x31ae86[_0x2fa5('0x8f')]]=_0x431c7a;}}}}catch(_0x2cc233){logger[_0x2fa5('0x3c')](_0x2fa5('0x91'),util['inspect'](_0x2cc233,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2fa5('0x35')][_0x2fa5('0x2b')]=function(_0x257fa2){try{if(this[_0x2fa5('0x36')](_0x257fa2)){if(this[_0x2fa5('0x1d')][_0x257fa2[_0x2fa5('0x8a')]]){this[_0x2fa5('0x1d')][_0x257fa2[_0x2fa5('0x8a')]][_0x2fa5('0x8b')]=_0x257fa2[_0x2fa5('0x92')];this['channels'][_0x257fa2[_0x2fa5('0x8a')]][_0x2fa5('0x8d')]=_0x257fa2[_0x2fa5('0x93')];this[_0x2fa5('0x26')]({'event':_0x2fa5('0x94'),'uniqueid':_0x257fa2[_0x2fa5('0x8a')],'context':_0x257fa2[_0x2fa5('0x4a')],'channel':_0x257fa2['transfererchannel']});}}}catch(_0x464eff){logger[_0x2fa5('0x3c')](_0x2fa5('0x95'),util[_0x2fa5('0x3e')](_0x464eff,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2fa5('0x35')][_0x2fa5('0x2d')]=function(_0x3648d1){try{if(this['isNotNull'](_0x3648d1)){if(this[_0x2fa5('0x1d')][_0x3648d1[_0x2fa5('0x39')]]){if(!_[_0x2fa5('0x74')](this[_0x2fa5('0x1d')][_0x3648d1[_0x2fa5('0x39')]]['answertime'])){this[_0x2fa5('0x1d')][_0x3648d1[_0x2fa5('0x39')]][_0x2fa5('0x96')]=moment()[_0x2fa5('0x44')](_0x2fa5('0x45'));}}}}catch(_0x3db963){logger[_0x2fa5('0x3c')](_0x2fa5('0x97'),util['inspect'](_0x3db963,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2fa5('0x35')][_0x2fa5('0x2f')]=function(_0x20e990){try{if(this['isNotNull'](_0x20e990)){if(this[_0x2fa5('0x1d')][_0x20e990[_0x2fa5('0x39')]]){if(!_[_0x2fa5('0x74')](this['channels'][_0x20e990[_0x2fa5('0x39')]]['mohstarttime'])){this[_0x2fa5('0x1d')][_0x20e990[_0x2fa5('0x39')]][_0x2fa5('0x98')]+=moment()[_0x2fa5('0x99')](0x0)[_0x2fa5('0x85')](this[_0x2fa5('0x1d')][_0x20e990[_0x2fa5('0x39')]][_0x2fa5('0x96')],'seconds');delete this[_0x2fa5('0x1d')][_0x20e990[_0x2fa5('0x39')]][_0x2fa5('0x96')];}}}}catch(_0x210942){logger[_0x2fa5('0x3c')](_0x2fa5('0x9a'),util[_0x2fa5('0x3e')](_0x210942,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport; \ No newline at end of file +var _0xbc80=['YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','pick','from-sip','split','destconnectedlinenum','exten','user:%s','name','application','toLowerCase','applicationdata','duration','seconds','includes','lastapplication','set','startsWith','cdr(','error','[syncNewExten][VoiceCallReport]','answered','answertime','holdtime','calleridnum','xcally-motion-preview','connectedlinenum','connectedlinename','calleridname','destinationchannel','UserId','membername','syncMixMonitorFilename','monitor','endsWith','monitorFilename','find','monitors','isNil','rec','variable','mixmonitor_filename','xmd-phone','xmd-callerid','callerid','value','xmd-originatecalleridnum','originatecalleridnum','destination','calleridpreview','xmcs-queue','sipcallid','sipcalllinkedid','[syncVarSet][VoiceCallReport]','endtime','billableseconds','context','omit','user:agentcomplete','accountcode','custom:voiceCallReport','[syncHangup][VoiceCallReport]','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','transfereecalleridnum','extension','BlindTransfer','[syncBlindTransfer][VoiceCallReport]','mohstarttime','mohtime','milliseconds','diff','[syncMusicOnHoldStop][VoiceCallReport]','exports','bluebird','lodash','util','path','ioredis','ami','../ami','../model/channel','unknown','not_inuse','inuse','invalid','ringinuse','onhold','queue','dial','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','localhost','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','bind','newchannel','syncNewChannel','newstate','varset','syncVarSet','hangup','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','resolve','actionCoreShowChannels','catch','prototype','isUndefined','emit','isNotNull','linkedid','uniqueid','merge','keys','inspect','channel','OutgoingSpoolFailed','starttime','format'];(function(_0x4ed0b3,_0x513c96){var _0x59fa10=function(_0x1bfc90){while(--_0x1bfc90){_0x4ed0b3['push'](_0x4ed0b3['shift']());}};_0x59fa10(++_0x513c96);}(_0xbc80,0x171));var _0x0bc8=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0xbc80[_0x39c734];return _0xb2a2f9;};'use strict';var BPromise=require(_0x0bc8('0x0'));var _=require(_0x0bc8('0x1'));var moment=require('moment');var util=require(_0x0bc8('0x2'));var path=require(_0x0bc8('0x3'));var Redis=require(_0x0bc8('0x4'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x0bc8('0x5'));var ami=require(_0x0bc8('0x6'));var Channel=require(_0x0bc8('0x7'));var statusDesc=[_0x0bc8('0x8'),_0x0bc8('0x9'),_0x0bc8('0xa'),'busy',_0x0bc8('0xb'),'unavailable','ringing',_0x0bc8('0xc'),_0x0bc8('0xd')];var applications=['set',_0x0bc8('0xe'),'agi',_0x0bc8('0xf'),'playback',_0x0bc8('0x10')];var dispositions=[_0x0bc8('0x11'),_0x0bc8('0x12'),_0x0bc8('0x12'),_0x0bc8('0x11'),_0x0bc8('0x11'),'NO\x20ANSWER',_0x0bc8('0x13'),_0x0bc8('0x14'),_0x0bc8('0x12'),_0x0bc8('0x12'),_0x0bc8('0x12')];var actions={};config[_0x0bc8('0x15')]=_['defaults'](config[_0x0bc8('0x15')],{'host':_0x0bc8('0x16'),'port':0x18eb});var io=require(_0x0bc8('0x17'))(new Redis(config['redis']));function VoiceCallReport(_0x4e1543){this['channels']=_0x4e1543[_0x0bc8('0x18')];this[_0x0bc8('0x19')]=_0x4e1543['agents'];ami['on'](_0x0bc8('0x1a'),this[_0x0bc8('0x1b')][_0x0bc8('0x1c')](this));ami['on']('newexten',this['syncNewExten'][_0x0bc8('0x1c')](this));ami['on'](_0x0bc8('0x1d'),this[_0x0bc8('0x1e')][_0x0bc8('0x1c')](this));ami['on'](_0x0bc8('0x1f'),this['syncNewState'][_0x0bc8('0x1c')](this));ami['on'](_0x0bc8('0x20'),this[_0x0bc8('0x21')][_0x0bc8('0x1c')](this));ami['on'](_0x0bc8('0x22'),this[_0x0bc8('0x23')]['bind'](this));ami['on'](_0x0bc8('0x24'),this[_0x0bc8('0x25')][_0x0bc8('0x1c')](this));ami['on'](_0x0bc8('0x26'),this[_0x0bc8('0x27')]['bind'](this));ami['on'](_0x0bc8('0x28'),this[_0x0bc8('0x29')][_0x0bc8('0x1c')](this));ami['on'](_0x0bc8('0x2a'),this[_0x0bc8('0x2b')][_0x0bc8('0x1c')](this));ami['on']('musiconholdstop',this['syncMusicOnHoldStop'][_0x0bc8('0x1c')](this));return BPromise[_0x0bc8('0x2c')]()['then'](ami[_0x0bc8('0x2d')]())[_0x0bc8('0x2e')](function(_0x5e0b85){console['log'](_0x5e0b85);});}VoiceCallReport[_0x0bc8('0x2f')]['isNotNull']=function(_0x1707c9){return _0x1707c9!==null&&!_[_0x0bc8('0x30')](_0x1707c9);};VoiceCallReport[_0x0bc8('0x2f')][_0x0bc8('0x31')]=function(_0x5e87a0,_0x171355,_0x3f1099){io['to'](_0x5e87a0)['emit'](_0x171355,_0x3f1099);};VoiceCallReport[_0x0bc8('0x2f')][_0x0bc8('0x25')]=function(_0x24f394){try{if(this[_0x0bc8('0x32')](_0x24f394)){if(_0x24f394['uniqueid']===_0x24f394[_0x0bc8('0x33')]){if(!_['isUndefined'](this[_0x0bc8('0x18')][_0x24f394[_0x0bc8('0x34')]])){_[_0x0bc8('0x35')](this[_0x0bc8('0x18')][_0x24f394[_0x0bc8('0x34')]],_['pick'](_0x24f394,_[_0x0bc8('0x36')](this[_0x0bc8('0x18')][_0x24f394['uniqueid']])));}}}}catch(_0x1633df){logger['error']('[syncNewCallerId][VoiceCallReport]',util[_0x0bc8('0x37')](_0x1633df,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0bc8('0x2f')][_0x0bc8('0x1e')]=function(_0x4f58b2){try{if(this[_0x0bc8('0x32')](_0x4f58b2)){if(_0x4f58b2[_0x0bc8('0x34')]===_0x4f58b2[_0x0bc8('0x33')]&&_0x4f58b2[_0x0bc8('0x38')]!=_0x0bc8('0x39')){if(_['isUndefined'](this[_0x0bc8('0x18')][_0x4f58b2[_0x0bc8('0x34')]])){this[_0x0bc8('0x18')][_0x4f58b2[_0x0bc8('0x34')]]=new Channel();this['channels'][_0x4f58b2[_0x0bc8('0x34')]][_0x0bc8('0x3a')]=moment()[_0x0bc8('0x3b')](_0x0bc8('0x3c'));this[_0x0bc8('0x18')][_0x4f58b2['uniqueid']][_0x0bc8('0x3d')]=dispositions[_[_0x0bc8('0x3e')](_0x4f58b2[_0x0bc8('0x3f')])];_['merge'](this['channels'][_0x4f58b2['uniqueid']],_[_0x0bc8('0x40')](_0x4f58b2,_[_0x0bc8('0x36')](this[_0x0bc8('0x18')][_0x4f58b2[_0x0bc8('0x34')]])));if(_0x4f58b2['context']===_0x0bc8('0x41')){if(this[_0x0bc8('0x19')][_0x4f58b2[_0x0bc8('0x38')][_0x0bc8('0x42')]('-')[0x0]]){this[_0x0bc8('0x19')][_0x4f58b2[_0x0bc8('0x38')][_0x0bc8('0x42')]('-')[0x0]][_0x0bc8('0x43')]=_0x4f58b2[_0x0bc8('0x44')];this['emit'](util['format'](_0x0bc8('0x45'),this[_0x0bc8('0x19')][_0x4f58b2['channel'][_0x0bc8('0x42')]('-')[0x0]][_0x0bc8('0x46')]),'user:agentconnect',{'destaccountcode':this[_0x0bc8('0x19')][_0x4f58b2[_0x0bc8('0x38')][_0x0bc8('0x42')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x4f58b2[_0x0bc8('0x44')]});}}}}}}catch(_0x1dc82e){logger['error']('[syncNewChannel][VoiceCallReport]',util[_0x0bc8('0x37')](_0x1dc82e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0bc8('0x2f')][_0x0bc8('0x1b')]=function(_0x1ae128){try{if(this[_0x0bc8('0x32')](_0x1ae128)){if(_0x1ae128[_0x0bc8('0x34')]===_0x1ae128[_0x0bc8('0x33')]&&_0x1ae128[_0x0bc8('0x44')]!='h'&&_0x1ae128['channel']!='OutgoingSpoolFailed'){_0x1ae128[_0x0bc8('0x47')]=_0x1ae128['application'][_0x0bc8('0x48')]();_0x1ae128['applicationdata']=(_0x1ae128['appdata']||_0x1ae128[_0x0bc8('0x49')])[_0x0bc8('0x48')]();if(_['isUndefined'](this[_0x0bc8('0x18')][_0x1ae128['uniqueid']])){this[_0x0bc8('0x18')][_0x1ae128['uniqueid']]=new Channel();this['channels'][_0x1ae128[_0x0bc8('0x34')]][_0x0bc8('0x3a')]=_0x1ae128[_0x0bc8('0x4a')]?moment()['subtract'](moment[_0x0bc8('0x4a')](_0x1ae128[_0x0bc8('0x4a')])[_0x0bc8('0x4b')](),_0x0bc8('0x4b'))[_0x0bc8('0x3b')](_0x0bc8('0x3c')):moment()[_0x0bc8('0x3b')](_0x0bc8('0x3c'));this['channels'][_0x1ae128['uniqueid']][_0x0bc8('0x3d')]=_0x0bc8('0x11');}_['merge'](this[_0x0bc8('0x18')][_0x1ae128['uniqueid']],_[_0x0bc8('0x40')](_0x1ae128,_['keys'](this['channels'][_0x1ae128[_0x0bc8('0x34')]])));if(_[_0x0bc8('0x4c')](applications,_0x1ae128[_0x0bc8('0x47')])){this[_0x0bc8('0x18')][_0x1ae128[_0x0bc8('0x34')]][_0x0bc8('0x4d')]=_0x1ae128[_0x0bc8('0x47')];this[_0x0bc8('0x18')][_0x1ae128[_0x0bc8('0x34')]]['lastdata']=_0x1ae128['applicationdata'];if(_0x1ae128[_0x0bc8('0x47')]===_0x0bc8('0x4e')&&_[_0x0bc8('0x4f')](_0x1ae128[_0x0bc8('0x49')],_0x0bc8('0x50'))){var _0x4046cb=_0x1ae128[_0x0bc8('0x49')][_0x0bc8('0x42')]('=');var _0x5b2ad9=_0x4046cb[0x0]['match'](/cdr\((.*)\)/);if(_0x5b2ad9){this['channels'][_0x1ae128[_0x0bc8('0x34')]][_0x5b2ad9[0x1]]=_0x4046cb[0x1];}}else if(_0x1ae128[_0x0bc8('0x47')]===_0x0bc8('0xe')){this[_0x0bc8('0x18')][_0x1ae128[_0x0bc8('0x34')]][_0x0bc8('0xe')]=_0x1ae128[_0x0bc8('0x49')][_0x0bc8('0x42')](',')[0x0];}}}}}catch(_0x51594a){logger[_0x0bc8('0x51')](_0x0bc8('0x52'),util[_0x0bc8('0x37')](_0x51594a,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0bc8('0x2f')]['syncNewState']=function(_0x57d19c){try{if(this[_0x0bc8('0x32')](_0x57d19c)){if(_0x57d19c[_0x0bc8('0x34')]!==_0x57d19c[_0x0bc8('0x33')]){if(this['channels'][_0x57d19c[_0x0bc8('0x33')]]){if(_0x57d19c['channelstate']==='6'){if(!this[_0x0bc8('0x18')][_0x57d19c[_0x0bc8('0x33')]][_0x0bc8('0x53')]){var _0x42b177=moment();this[_0x0bc8('0x18')][_0x57d19c[_0x0bc8('0x33')]][_0x0bc8('0x53')]=!![];this['channels'][_0x57d19c['linkedid']][_0x0bc8('0x54')]=_0x42b177[_0x0bc8('0x3b')](_0x0bc8('0x3c'));if(this['channels'][_0x57d19c[_0x0bc8('0x33')]]['starttime']){this[_0x0bc8('0x18')][_0x57d19c['linkedid']][_0x0bc8('0x55')]=_0x42b177['diff'](this['channels'][_0x57d19c[_0x0bc8('0x33')]][_0x0bc8('0x3a')],'seconds');}}this[_0x0bc8('0x18')][_0x57d19c[_0x0bc8('0x33')]]['linkedid']=_0x57d19c['uniqueid'];if(_0x57d19c[_0x0bc8('0x56')]!==_0x0bc8('0x57')){this[_0x0bc8('0x18')][_0x57d19c[_0x0bc8('0x33')]][_0x0bc8('0x58')]=_0x57d19c[_0x0bc8('0x56')];}this[_0x0bc8('0x18')][_0x57d19c['linkedid']][_0x0bc8('0x59')]=_0x57d19c[_0x0bc8('0x5a')];this[_0x0bc8('0x18')][_0x57d19c['linkedid']][_0x0bc8('0x5b')]=_0x57d19c[_0x0bc8('0x38')];this[_0x0bc8('0x18')][_0x57d19c[_0x0bc8('0x33')]][_0x0bc8('0x3d')]=dispositions[_[_0x0bc8('0x3e')](_0x57d19c[_0x0bc8('0x3f')])];if(this[_0x0bc8('0x19')][_0x57d19c[_0x0bc8('0x38')][_0x0bc8('0x42')]('-')[0x0]]){this[_0x0bc8('0x18')][_0x57d19c[_0x0bc8('0x33')]][_0x0bc8('0x5c')]=this[_0x0bc8('0x19')][_0x57d19c[_0x0bc8('0x38')][_0x0bc8('0x42')]('-')[0x0]]['id'];this['channels'][_0x57d19c[_0x0bc8('0x33')]]['membername']=this['agents'][_0x57d19c['channel']['split']('-')[0x0]][_0x0bc8('0x46')];}}}}else{if(this['channels'][_0x57d19c[_0x0bc8('0x34')]]){if(_0x57d19c[_0x0bc8('0x3f')]==='6'){if(this['agents'][_0x57d19c[_0x0bc8('0x38')][_0x0bc8('0x42')]('-')[0x0]]){this[_0x0bc8('0x18')][_0x57d19c['uniqueid']][_0x0bc8('0x5c')]=this[_0x0bc8('0x19')][_0x57d19c[_0x0bc8('0x38')][_0x0bc8('0x42')]('-')[0x0]]['id'];this[_0x0bc8('0x18')][_0x57d19c[_0x0bc8('0x34')]][_0x0bc8('0x5d')]=this[_0x0bc8('0x19')][_0x57d19c['channel'][_0x0bc8('0x42')]('-')[0x0]][_0x0bc8('0x46')];}}}}}}catch(_0x1e28c3){logger[_0x0bc8('0x51')]('[syncNewState][VoiceCallReport]',util[_0x0bc8('0x37')](_0x1e28c3,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0bc8('0x2f')][_0x0bc8('0x5e')]=function(_0x4c818e,_0xd36947){if(this[_0x0bc8('0x18')][_0x4c818e]){this[_0x0bc8('0x18')][_0x4c818e][_0x0bc8('0x5f')]=!![];if(_[_0x0bc8('0x60')](_0xd36947,'.wav49')){_0xd36947=_0xd36947['replace']('.wav49','.WAV');}this[_0x0bc8('0x18')][_0x4c818e][_0x0bc8('0x61')]=_0xd36947;var _0x2cd83c=_[_0x0bc8('0x62')](this[_0x0bc8('0x18')][_0x4c818e][_0x0bc8('0x63')],{'filename':_0xd36947});if(_[_0x0bc8('0x64')](_0x2cd83c)){this[_0x0bc8('0x18')][_0x4c818e][_0x0bc8('0x63')]['push']({'filename':_0xd36947,'createdAt':moment()[_0x0bc8('0x3b')](_0x0bc8('0x3c')),'mixmonitorid':'','status':_0x0bc8('0x65')});}}};VoiceCallReport[_0x0bc8('0x2f')][_0x0bc8('0x21')]=function(_0x2007eb){try{if(this[_0x0bc8('0x32')](_0x2007eb)){if(this[_0x0bc8('0x18')][_0x2007eb[_0x0bc8('0x34')]]&&_0x2007eb[_0x0bc8('0x38')]!=_0x0bc8('0x39')){if(this[_0x0bc8('0x32')](_0x2007eb[_0x0bc8('0x66')])){if(this[_0x0bc8('0x32')](_0x2007eb[_0x0bc8('0x66')][_0x0bc8('0x67')])){this[_0x0bc8('0x5e')](_0x2007eb[_0x0bc8('0x34')],_0x2007eb['value']);}else if(this[_0x0bc8('0x32')](_0x2007eb['variable'][_0x0bc8('0x68')])){this[_0x0bc8('0x18')][_0x2007eb[_0x0bc8('0x34')]][_0x0bc8('0x56')]=_0x2007eb['value'];}else if(this[_0x0bc8('0x32')](_0x2007eb['variable'][_0x0bc8('0x69')])){this['channels'][_0x2007eb[_0x0bc8('0x34')]][_0x0bc8('0x6a')]=_0x2007eb[_0x0bc8('0x6b')];}else if(this[_0x0bc8('0x32')](_0x2007eb[_0x0bc8('0x66')]['xmd-cdrtype'])){this['channels'][_0x2007eb[_0x0bc8('0x34')]]['type']=_0x2007eb[_0x0bc8('0x6b')];}else if(this['isNotNull'](_0x2007eb[_0x0bc8('0x66')]['xmd-queue'])){this['channels'][_0x2007eb[_0x0bc8('0x34')]][_0x0bc8('0xe')]=_0x2007eb[_0x0bc8('0x6b')]['split'](',')[0x0];}else if(this[_0x0bc8('0x32')](_0x2007eb[_0x0bc8('0x66')][_0x0bc8('0x6c')])){this[_0x0bc8('0x18')][_0x2007eb['uniqueid']][_0x0bc8('0x6d')]=_0x2007eb[_0x0bc8('0x6b')];}else if(this[_0x0bc8('0x32')](_0x2007eb[_0x0bc8('0x66')]['xmd-destination'])){this[_0x0bc8('0x18')][_0x2007eb['uniqueid']][_0x0bc8('0x6e')]=_0x2007eb['value'];}else if(this['isNotNull'](_0x2007eb['variable']['xmd-callerid-preview'])){this[_0x0bc8('0x18')][_0x2007eb[_0x0bc8('0x34')]][_0x0bc8('0x6f')]=_0x2007eb[_0x0bc8('0x6b')];}else if(this[_0x0bc8('0x32')](_0x2007eb[_0x0bc8('0x66')][_0x0bc8('0x70')])){this[_0x0bc8('0x18')][_0x2007eb[_0x0bc8('0x34')]]['queue']=_0x2007eb[_0x0bc8('0x6b')];}else if(this['isNotNull'](_0x2007eb[_0x0bc8('0x66')][_0x0bc8('0x71')])){this[_0x0bc8('0x18')][_0x2007eb[_0x0bc8('0x34')]]['sipcalluniqueid']=_0x2007eb[_0x0bc8('0x6b')];}}}else if(this[_0x0bc8('0x32')](_0x2007eb[_0x0bc8('0x66')][_0x0bc8('0x67')])){if(_0x2007eb['value']){var _0x13f1b7=path['parse'](_0x2007eb[_0x0bc8('0x6b')])[_0x0bc8('0x46')];this['syncMixMonitorFilename'](_0x13f1b7,_0x2007eb[_0x0bc8('0x6b')]);}}else if(this[_0x0bc8('0x18')][_0x2007eb[_0x0bc8('0x33')]]){if(this[_0x0bc8('0x32')](_0x2007eb[_0x0bc8('0x66')])){if(this[_0x0bc8('0x32')](_0x2007eb[_0x0bc8('0x66')]['sipcallid'])){this[_0x0bc8('0x18')][_0x2007eb[_0x0bc8('0x33')]][_0x0bc8('0x72')]=_0x2007eb[_0x0bc8('0x6b')];}}}}}catch(_0x5ab213){logger[_0x0bc8('0x51')](_0x0bc8('0x73'),util[_0x0bc8('0x37')](_0x5ab213,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0bc8('0x2f')][_0x0bc8('0x23')]=function(_0x3ebace){try{if(this[_0x0bc8('0x32')](_0x3ebace)){if(this['channels'][_0x3ebace[_0x0bc8('0x34')]]){var _0x2efdbe=moment();this[_0x0bc8('0x18')][_0x3ebace[_0x0bc8('0x34')]][_0x0bc8('0x74')]=_0x2efdbe['format'](_0x0bc8('0x3c'));this[_0x0bc8('0x18')][_0x3ebace[_0x0bc8('0x34')]]['duration']=_0x2efdbe['diff'](this[_0x0bc8('0x18')][_0x3ebace[_0x0bc8('0x34')]][_0x0bc8('0x3a')],'seconds');if(this['channels'][_0x3ebace[_0x0bc8('0x34')]][_0x0bc8('0x53')]){this['channels'][_0x3ebace[_0x0bc8('0x34')]][_0x0bc8('0x75')]=_0x2efdbe['diff'](this[_0x0bc8('0x18')][_0x3ebace[_0x0bc8('0x34')]]['answertime'],_0x0bc8('0x4b'));this[_0x0bc8('0x18')][_0x3ebace[_0x0bc8('0x34')]][_0x0bc8('0x55')]=this[_0x0bc8('0x18')][_0x3ebace[_0x0bc8('0x34')]][_0x0bc8('0x4a')]-this[_0x0bc8('0x18')][_0x3ebace['uniqueid']][_0x0bc8('0x75')];}if(_0x3ebace[_0x0bc8('0x76')]==='from-sip'){if(this[_0x0bc8('0x19')][_0x3ebace['channel'][_0x0bc8('0x42')]('-')[0x0]]){this['agents'][_0x3ebace[_0x0bc8('0x38')]['split']('-')[0x0]]=_[_0x0bc8('0x77')](this[_0x0bc8('0x19')][_0x3ebace['channel'][_0x0bc8('0x42')]('-')[0x0]],['destconnectedlinenum']);this[_0x0bc8('0x31')](util[_0x0bc8('0x3b')](_0x0bc8('0x45'),this['agents'][_0x3ebace[_0x0bc8('0x38')][_0x0bc8('0x42')]('-')[0x0]]['name']),_0x0bc8('0x78'),{'destaccountcode':this[_0x0bc8('0x19')][_0x3ebace['channel'][_0x0bc8('0x42')]('-')[0x0]][_0x0bc8('0x79')]});}}ami['emit'](_0x0bc8('0x7a'),this[_0x0bc8('0x18')][_0x3ebace[_0x0bc8('0x34')]]);delete this['channels'][_0x3ebace[_0x0bc8('0x34')]];}}}catch(_0x270789){logger['error'](_0x0bc8('0x7b'),util[_0x0bc8('0x37')](_0x270789,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x0bc8('0x27')]=function(_0x317f07){try{if(this[_0x0bc8('0x32')](_0x317f07)){if(this['channels'][_0x317f07['transfereeuniqueid']]){this[_0x0bc8('0x18')][_0x317f07[_0x0bc8('0x7c')]][_0x0bc8('0x7d')]=_0x317f07[_0x0bc8('0x7e')];this['channels'][_0x317f07[_0x0bc8('0x7c')]][_0x0bc8('0x7f')]=_0x317f07[_0x0bc8('0x80')];if(this[_0x0bc8('0x18')][_0x317f07['secondtransfereruniqueid']]){var _0x31b11f=this[_0x0bc8('0x18')][_0x317f07[_0x0bc8('0x81')]];this[_0x0bc8('0x18')][_0x317f07[_0x0bc8('0x81')]]=this[_0x0bc8('0x18')][_0x317f07[_0x0bc8('0x7c')]];this['channels'][_0x317f07[_0x0bc8('0x7c')]]=_0x31b11f;}}else if(this[_0x0bc8('0x18')][_0x317f07[_0x0bc8('0x82')]]){this[_0x0bc8('0x18')][_0x317f07[_0x0bc8('0x82')]][_0x0bc8('0x7d')]=_0x317f07[_0x0bc8('0x7e')];this['channels'][_0x317f07['transfertargetuniqueid']][_0x0bc8('0x7f')]=_0x317f07['transfertargetcalleridnum'];if(this[_0x0bc8('0x18')][_0x317f07[_0x0bc8('0x83')]]){var _0x31b11f=this['channels'][_0x317f07[_0x0bc8('0x83')]];this['channels'][_0x317f07['origtransfereruniqueid']]=this[_0x0bc8('0x18')][_0x317f07[_0x0bc8('0x82')]];this[_0x0bc8('0x18')][_0x317f07[_0x0bc8('0x82')]]=_0x31b11f;}}}}catch(_0x577c53){logger[_0x0bc8('0x51')](_0x0bc8('0x84'),util[_0x0bc8('0x37')](_0x577c53,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0bc8('0x2f')]['syncBlindTransfer']=function(_0x56476e){try{if(this['isNotNull'](_0x56476e)){if(this[_0x0bc8('0x18')][_0x56476e['transfereeuniqueid']]){this[_0x0bc8('0x18')][_0x56476e['transfereeuniqueid']][_0x0bc8('0x7d')]=_0x56476e[_0x0bc8('0x85')];this['channels'][_0x56476e[_0x0bc8('0x7c')]][_0x0bc8('0x7f')]=_0x56476e[_0x0bc8('0x86')];this[_0x0bc8('0x23')]({'event':_0x0bc8('0x87'),'uniqueid':_0x56476e[_0x0bc8('0x7c')],'context':_0x56476e[_0x0bc8('0x76')],'channel':_0x56476e['transfererchannel']});}}}catch(_0xb735e4){logger[_0x0bc8('0x51')](_0x0bc8('0x88'),util['inspect'](_0xb735e4,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0bc8('0x2f')]['syncMusicOnHoldStart']=function(_0x43f465){try{if(this['isNotNull'](_0x43f465)){if(this[_0x0bc8('0x18')][_0x43f465[_0x0bc8('0x34')]]){if(!_[_0x0bc8('0x64')](this[_0x0bc8('0x18')][_0x43f465[_0x0bc8('0x34')]][_0x0bc8('0x54')])){this[_0x0bc8('0x18')][_0x43f465['uniqueid']][_0x0bc8('0x89')]=moment()[_0x0bc8('0x3b')](_0x0bc8('0x3c'));}}}}catch(_0x39fd3a){logger[_0x0bc8('0x51')]('[syncMusicOnHoldStart][VoiceCallReport]',util[_0x0bc8('0x37')](_0x39fd3a,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x0bc8('0x2f')]['syncMusicOnHoldStop']=function(_0x4fbc6d){try{if(this[_0x0bc8('0x32')](_0x4fbc6d)){if(this[_0x0bc8('0x18')][_0x4fbc6d[_0x0bc8('0x34')]]){if(!_[_0x0bc8('0x64')](this['channels'][_0x4fbc6d[_0x0bc8('0x34')]][_0x0bc8('0x89')])){this[_0x0bc8('0x18')][_0x4fbc6d['uniqueid']][_0x0bc8('0x8a')]+=moment()[_0x0bc8('0x8b')](0x0)[_0x0bc8('0x8c')](this[_0x0bc8('0x18')][_0x4fbc6d['uniqueid']][_0x0bc8('0x89')],_0x0bc8('0x4b'));delete this[_0x0bc8('0x18')][_0x4fbc6d[_0x0bc8('0x34')]][_0x0bc8('0x89')];}}}}catch(_0x564ccf){logger[_0x0bc8('0x51')](_0x0bc8('0x8d'),util[_0x0bc8('0x37')](_0x564ccf,{'showHidden':![],'depth':null}));}};module[_0x0bc8('0x8e')]=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index 7b23e89..9d10d6b 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 _0xb815=['rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','membercalls','memberdynamic','memberinterface','membername','memberpenalty','memberrealtime','includes','syncHangup','endtime','diff','starttime','seconds','total','answered','holdtime','billableseconds','sumBillable','sumDuration','custom:dialend','[syncHangup][VoiceDialReport]','lodash','moment','util','ioredis','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','outboundChannels','outbound','dialbegin','syncDialBegin','dialend','bind','varset','syncVarSet','hangup','prototype','isNotNull','isUndefined','emit','uniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','omit','event','privilege','voice:outbound','voice_outbound_channel:save','[syncDialBegin][VoiceDialReport]','inspect','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','lastevent','connect','custom:dialconnect','error','[syncDialEnd][VoiceDialReport]','keys','value','variable','outboundrouteid','variables','addVariable','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged'];(function(_0x1bb926,_0x58f074){var _0x53508e=function(_0xe3bc33){while(--_0xe3bc33){_0x1bb926['push'](_0x1bb926['shift']());}};_0x53508e(++_0x58f074);}(_0xb815,0x10a));var _0x5b81=function(_0x20fe7c,_0x15af9c){_0x20fe7c=_0x20fe7c-0x0;var _0x3f18ee=_0xb815[_0x20fe7c];return _0x3f18ee;};'use strict';var _=require(_0x5b81('0x0'));var moment=require(_0x5b81('0x1'));var util=require(_0x5b81('0x2'));var Redis=require(_0x5b81('0x3'));var config=require('../../../config/environment');var logger=require(_0x5b81('0x4'))(_0x5b81('0x5'));var ami=require(_0x5b81('0x6'));config[_0x5b81('0x7')]=_[_0x5b81('0x8')](config['redis'],{'host':_0x5b81('0x9'),'port':0x18eb});var io=require(_0x5b81('0xa'))(new Redis(config[_0x5b81('0x7')]));function VoiceDialReport(_0xcc6723){this[_0x5b81('0xb')]=_0xcc6723[_0x5b81('0xc')];this[_0x5b81('0xd')]=_0xcc6723[_0x5b81('0xd')];this['variables']={};ami['on'](_0x5b81('0xe'),this[_0x5b81('0xf')]['bind'](this));ami['on'](_0x5b81('0x10'),this['syncDialEnd'][_0x5b81('0x11')](this));ami['on'](_0x5b81('0x12'),this[_0x5b81('0x13')]['bind'](this));ami['on'](_0x5b81('0x14'),this['syncHangup'][_0x5b81('0x11')](this));}VoiceDialReport[_0x5b81('0x15')][_0x5b81('0x16')]=function(_0x385ee4){return _0x385ee4!==null&&!_[_0x5b81('0x17')](_0x385ee4);};VoiceDialReport[_0x5b81('0x15')][_0x5b81('0x18')]=function(_0x9c5f55,_0x357733,_0x321536){io['to'](_0x9c5f55)[_0x5b81('0x18')](_0x357733,_0x321536);};VoiceDialReport[_0x5b81('0x15')][_0x5b81('0xf')]=function(_0x53dc12){try{if(this[_0x5b81('0x16')](_0x53dc12)){if(this[_0x5b81('0xb')][_0x53dc12[_0x5b81('0x19')]]){_['merge'](this[_0x5b81('0xb')][_0x53dc12['uniqueid']],{'starttime':moment()[_0x5b81('0x1a')](_0x5b81('0x1b')),'lastevent':_0x5b81('0x1c'),'interface':_0x53dc12[_0x5b81('0x1d')][_0x5b81('0x1e')](0x0,_0x53dc12['channel'][_0x5b81('0x1f')]('-')),'membername':_0x53dc12[_0x5b81('0x1d')]['substring'](_0x53dc12[_0x5b81('0x1d')][_0x5b81('0x1f')]('/')+0x1,_0x53dc12[_0x5b81('0x1d')][_0x5b81('0x1f')]('-'))},_[_0x5b81('0x20')](_0x53dc12,[_0x5b81('0x21'),_0x5b81('0x22')]));this[_0x5b81('0x18')](_0x5b81('0x23'),_0x5b81('0x24'),this[_0x5b81('0xb')][_0x53dc12[_0x5b81('0x19')]]);ami['emit']('custom:dialbegin',this[_0x5b81('0xb')][_0x53dc12[_0x5b81('0x19')]]);}}}catch(_0x55312f){logger['error'](_0x5b81('0x25'),util[_0x5b81('0x26')](_0x55312f,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x5b81('0x15')]['syncDialEnd']=function(_0x321ef1){try{if(this[_0x5b81('0x16')](_0x321ef1)){if(this[_0x5b81('0xb')][_0x321ef1[_0x5b81('0x19')]]){this[_0x5b81('0xb')][_0x321ef1[_0x5b81('0x19')]][_0x5b81('0x27')]=_0x321ef1[_0x5b81('0x27')];if(_0x321ef1[_0x5b81('0x27')]===_0x5b81('0x28')){this[_0x5b81('0xb')][_0x321ef1[_0x5b81('0x19')]][_0x5b81('0x29')]=_0x321ef1[_0x5b81('0x29')];this['channels'][_0x321ef1[_0x5b81('0x19')]][_0x5b81('0x2a')]=_0x321ef1[_0x5b81('0x2a')];this[_0x5b81('0xb')][_0x321ef1[_0x5b81('0x19')]][_0x5b81('0x2b')]=moment()[_0x5b81('0x1a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x5b81('0xb')][_0x321ef1[_0x5b81('0x19')]][_0x5b81('0x2c')]=_0x5b81('0x2d');ami[_0x5b81('0x18')](_0x5b81('0x2e'),this['channels'][_0x321ef1[_0x5b81('0x19')]]);}this['emit']('voice:outbound',_0x5b81('0x24'),this[_0x5b81('0xb')][_0x321ef1[_0x5b81('0x19')]]);}}}catch(_0x3ce763){logger[_0x5b81('0x2f')](_0x5b81('0x30'),util[_0x5b81('0x26')](_0x3ce763,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['syncVarSet']=function(_0x1031b5){try{if(this['isNotNull'](_0x1031b5)){this['addVariable'](_0x1031b5['uniqueid'],_[_0x5b81('0x31')](_0x1031b5['variable'])[0x0],_0x1031b5[_0x5b81('0x32')]);if(this['isNotNull'](_0x1031b5[_0x5b81('0x33')])&&this[_0x5b81('0x16')](_0x1031b5[_0x5b81('0x33')][_0x5b81('0x34')])){if(_[_0x5b81('0x17')](this[_0x5b81('0xb')][_0x1031b5[_0x5b81('0x19')]])){this[_0x5b81('0xb')][_0x1031b5['uniqueid']]={'routeId':_0x1031b5[_0x5b81('0x32')],'variables':this[_0x5b81('0x35')][_0x1031b5[_0x5b81('0x19')]]};this[_0x5b81('0x18')](_0x5b81('0x23'),'voice_outbound_channel:save',this['channels'][_0x1031b5['uniqueid']]);}}}}catch(_0x437987){logger[_0x5b81('0x2f')]('[syncVarSet][VoiceDialReport]',util[_0x5b81('0x26')](_0x437987,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x5b81('0x15')][_0x5b81('0x36')]=function(_0x51da5d,_0xc0295d,_0x45d61d){var _0x318502=['rtpaudioqos','rtpaudioqosbridged',_0x5b81('0x37'),_0x5b81('0x38'),'rtpaudioqosloss',_0x5b81('0x39'),_0x5b81('0x3a'),_0x5b81('0x3b'),'sipcallid',_0x5b81('0x3c'),'bridgepeer','bridgepvtcallid',_0x5b81('0x3d'),_0x5b81('0x3e'),_0x5b81('0x3f'),'memberlastcall',_0x5b81('0x40'),_0x5b81('0x41'),_0x5b81('0x42')];if(!_['isNil'](_0xc0295d)&&!_[_0x5b81('0x43')](_0x318502,_0xc0295d)){if(_[_0x5b81('0x17')](this[_0x5b81('0x35')][_0x51da5d])){this[_0x5b81('0x35')][_0x51da5d]={};}this['variables'][_0x51da5d][_0xc0295d]=_0x45d61d;}};VoiceDialReport['prototype'][_0x5b81('0x44')]=function(_0x417b01){try{if(this[_0x5b81('0x16')](_0x417b01)){if(this[_0x5b81('0xb')][_0x417b01[_0x5b81('0x19')]]){this[_0x5b81('0xb')][_0x417b01[_0x5b81('0x19')]][_0x5b81('0x45')]=moment()[_0x5b81('0x1a')](_0x5b81('0x1b'));this[_0x5b81('0xb')][_0x417b01[_0x5b81('0x19')]]['duration']=moment(this[_0x5b81('0xb')][_0x417b01[_0x5b81('0x19')]][_0x5b81('0x45')])[_0x5b81('0x46')](this[_0x5b81('0xb')][_0x417b01[_0x5b81('0x19')]][_0x5b81('0x47')],_0x5b81('0x48'));this['channels'][_0x417b01[_0x5b81('0x19')]][_0x5b81('0x2c')]='complete';this[_0x5b81('0xd')][_0x5b81('0x49')]+=0x1;if(this['channels'][_0x417b01[_0x5b81('0x19')]][_0x5b81('0x2b')]){this[_0x5b81('0xd')][_0x5b81('0x4a')]+=0x1;this[_0x5b81('0xb')][_0x417b01[_0x5b81('0x19')]][_0x5b81('0x4b')]=moment(this[_0x5b81('0xb')][_0x417b01[_0x5b81('0x19')]][_0x5b81('0x2b')])[_0x5b81('0x46')](this[_0x5b81('0xb')][_0x417b01[_0x5b81('0x19')]][_0x5b81('0x47')],_0x5b81('0x48'));this['channels'][_0x417b01['uniqueid']][_0x5b81('0x4c')]=moment(this['channels'][_0x417b01[_0x5b81('0x19')]]['endtime'])[_0x5b81('0x46')](this[_0x5b81('0xb')][_0x417b01[_0x5b81('0x19')]][_0x5b81('0x2b')],_0x5b81('0x48'));this[_0x5b81('0xd')]['sumHoldTime']+=this[_0x5b81('0xb')][_0x417b01[_0x5b81('0x19')]][_0x5b81('0x4b')]||0x0;this[_0x5b81('0xd')][_0x5b81('0x4d')]+=this[_0x5b81('0xb')][_0x417b01[_0x5b81('0x19')]][_0x5b81('0x4c')];}this[_0x5b81('0xd')][_0x5b81('0x4e')]+=this[_0x5b81('0xb')][_0x417b01[_0x5b81('0x19')]]['duration'];ami[_0x5b81('0x18')]('custom:voiceDialReport',this[_0x5b81('0xb')][_0x417b01[_0x5b81('0x19')]]);ami[_0x5b81('0x18')](_0x5b81('0x4f'),this[_0x5b81('0xb')][_0x417b01[_0x5b81('0x19')]]);this[_0x5b81('0x18')]('voice:outbound','voice_outbound:save',this[_0x5b81('0xd')]);this[_0x5b81('0x18')](_0x5b81('0x23'),'voice_outbound_channel:remove',this[_0x5b81('0xb')][_0x417b01[_0x5b81('0x19')]]);delete this['channels'][_0x417b01[_0x5b81('0x19')]];}if(this[_0x5b81('0x35')][_0x417b01[_0x5b81('0x19')]]){delete this[_0x5b81('0x35')][_0x417b01[_0x5b81('0x19')]];}}}catch(_0x56eba8){logger[_0x5b81('0x2f')](_0x5b81('0x50'),util[_0x5b81('0x26')](_0x56eba8,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport; \ No newline at end of file +var _0x6fe6=['../ami','redis','localhost','socket.io-emitter','channels','outboundChannels','outbound','variables','syncDialBegin','bind','syncDialEnd','varset','syncVarSet','hangup','isNotNull','prototype','emit','uniqueid','merge','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','omit','voice:outbound','voice_outbound_channel:save','custom:dialbegin','[syncDialBegin][VoiceDialReport]','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','lastevent','connect','custom:dialconnect','error','inspect','addVariable','value','variable','outboundrouteid','isUndefined','[syncVarSet][VoiceDialReport]','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer','memberdynamic','memberinterface','membername','memberrealtime','isNil','includes','syncHangup','endtime','format','duration','diff','starttime','seconds','complete','total','answered','holdtime','billableseconds','sumHoldTime','sumBillable','sumDuration','custom:voiceDialReport','custom:dialend','[syncHangup][VoiceDialReport]','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami'];(function(_0x24201a,_0x3ed184){var _0x36a6b9=function(_0x300d74){while(--_0x300d74){_0x24201a['push'](_0x24201a['shift']());}};_0x36a6b9(++_0x3ed184);}(_0x6fe6,0x14d));var _0x66fe=function(_0x40d7ce,_0xea7ca2){_0x40d7ce=_0x40d7ce-0x0;var _0x13ddb8=_0x6fe6[_0x40d7ce];return _0x13ddb8;};'use strict';var _=require(_0x66fe('0x0'));var moment=require(_0x66fe('0x1'));var util=require(_0x66fe('0x2'));var Redis=require(_0x66fe('0x3'));var config=require(_0x66fe('0x4'));var logger=require(_0x66fe('0x5'))(_0x66fe('0x6'));var ami=require(_0x66fe('0x7'));config[_0x66fe('0x8')]=_['defaults'](config['redis'],{'host':_0x66fe('0x9'),'port':0x18eb});var io=require(_0x66fe('0xa'))(new Redis(config['redis']));function VoiceDialReport(_0x1bfee5){this[_0x66fe('0xb')]=_0x1bfee5[_0x66fe('0xc')];this[_0x66fe('0xd')]=_0x1bfee5['outbound'];this[_0x66fe('0xe')]={};ami['on']('dialbegin',this[_0x66fe('0xf')][_0x66fe('0x10')](this));ami['on']('dialend',this[_0x66fe('0x11')][_0x66fe('0x10')](this));ami['on'](_0x66fe('0x12'),this[_0x66fe('0x13')][_0x66fe('0x10')](this));ami['on'](_0x66fe('0x14'),this['syncHangup'][_0x66fe('0x10')](this));}VoiceDialReport['prototype'][_0x66fe('0x15')]=function(_0x56e973){return _0x56e973!==null&&!_['isUndefined'](_0x56e973);};VoiceDialReport[_0x66fe('0x16')][_0x66fe('0x17')]=function(_0x3dac1e,_0x27dbfa,_0x2402cd){io['to'](_0x3dac1e)[_0x66fe('0x17')](_0x27dbfa,_0x2402cd);};VoiceDialReport[_0x66fe('0x16')][_0x66fe('0xf')]=function(_0x2edc3f){try{if(this[_0x66fe('0x15')](_0x2edc3f)){if(this[_0x66fe('0xb')][_0x2edc3f[_0x66fe('0x18')]]){_[_0x66fe('0x19')](this['channels'][_0x2edc3f[_0x66fe('0x18')]],{'starttime':moment()['format'](_0x66fe('0x1a')),'lastevent':_0x66fe('0x1b'),'interface':_0x2edc3f[_0x66fe('0x1c')]['substring'](0x0,_0x2edc3f[_0x66fe('0x1c')]['lastIndexOf']('-')),'membername':_0x2edc3f[_0x66fe('0x1c')][_0x66fe('0x1d')](_0x2edc3f[_0x66fe('0x1c')][_0x66fe('0x1e')]('/')+0x1,_0x2edc3f[_0x66fe('0x1c')][_0x66fe('0x1e')]('-'))},_[_0x66fe('0x1f')](_0x2edc3f,['event','privilege']));this['emit'](_0x66fe('0x20'),_0x66fe('0x21'),this['channels'][_0x2edc3f[_0x66fe('0x18')]]);ami[_0x66fe('0x17')](_0x66fe('0x22'),this['channels'][_0x2edc3f[_0x66fe('0x18')]]);}}}catch(_0x5b33b1){logger['error'](_0x66fe('0x23'),util['inspect'](_0x5b33b1,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x66fe('0x16')][_0x66fe('0x11')]=function(_0x465914){try{if(this[_0x66fe('0x15')](_0x465914)){if(this[_0x66fe('0xb')][_0x465914[_0x66fe('0x18')]]){this[_0x66fe('0xb')][_0x465914['uniqueid']][_0x66fe('0x24')]=_0x465914[_0x66fe('0x24')];if(_0x465914[_0x66fe('0x24')]===_0x66fe('0x25')){this[_0x66fe('0xb')][_0x465914[_0x66fe('0x18')]][_0x66fe('0x26')]=_0x465914[_0x66fe('0x26')];this[_0x66fe('0xb')][_0x465914[_0x66fe('0x18')]][_0x66fe('0x27')]=_0x465914[_0x66fe('0x27')];this[_0x66fe('0xb')][_0x465914[_0x66fe('0x18')]][_0x66fe('0x28')]=moment()['format'](_0x66fe('0x1a'));this[_0x66fe('0xb')][_0x465914[_0x66fe('0x18')]][_0x66fe('0x29')]=_0x66fe('0x2a');ami[_0x66fe('0x17')](_0x66fe('0x2b'),this[_0x66fe('0xb')][_0x465914[_0x66fe('0x18')]]);}this[_0x66fe('0x17')](_0x66fe('0x20'),_0x66fe('0x21'),this[_0x66fe('0xb')][_0x465914['uniqueid']]);}}}catch(_0x3727da){logger[_0x66fe('0x2c')]('[syncDialEnd][VoiceDialReport]',util[_0x66fe('0x2d')](_0x3727da,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x66fe('0x16')][_0x66fe('0x13')]=function(_0x59f3ee){try{if(this[_0x66fe('0x15')](_0x59f3ee)){this[_0x66fe('0x2e')](_0x59f3ee[_0x66fe('0x18')],_['keys'](_0x59f3ee['variable'])[0x0],_0x59f3ee[_0x66fe('0x2f')]);if(this['isNotNull'](_0x59f3ee[_0x66fe('0x30')])&&this[_0x66fe('0x15')](_0x59f3ee[_0x66fe('0x30')][_0x66fe('0x31')])){if(_[_0x66fe('0x32')](this['channels'][_0x59f3ee[_0x66fe('0x18')]])){this[_0x66fe('0xb')][_0x59f3ee[_0x66fe('0x18')]]={'routeId':_0x59f3ee[_0x66fe('0x2f')],'variables':this[_0x66fe('0xe')][_0x59f3ee[_0x66fe('0x18')]]};this[_0x66fe('0x17')](_0x66fe('0x20'),_0x66fe('0x21'),this[_0x66fe('0xb')][_0x59f3ee[_0x66fe('0x18')]]);}}}}catch(_0x532127){logger['error'](_0x66fe('0x33'),util[_0x66fe('0x2d')](_0x532127,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x66fe('0x16')][_0x66fe('0x2e')]=function(_0x474199,_0x24cef3,_0x634465){var _0x395385=[_0x66fe('0x34'),'rtpaudioqosbridged',_0x66fe('0x35'),_0x66fe('0x36'),_0x66fe('0x37'),_0x66fe('0x38'),_0x66fe('0x39'),'rtpaudioqosrttbridged',_0x66fe('0x3a'),_0x66fe('0x3b'),_0x66fe('0x3c'),'bridgepvtcallid','membercalls',_0x66fe('0x3d'),_0x66fe('0x3e'),'memberlastcall',_0x66fe('0x3f'),'memberpenalty',_0x66fe('0x40')];if(!_[_0x66fe('0x41')](_0x24cef3)&&!_[_0x66fe('0x42')](_0x395385,_0x24cef3)){if(_[_0x66fe('0x32')](this[_0x66fe('0xe')][_0x474199])){this['variables'][_0x474199]={};}this[_0x66fe('0xe')][_0x474199][_0x24cef3]=_0x634465;}};VoiceDialReport[_0x66fe('0x16')][_0x66fe('0x43')]=function(_0x14e66a){try{if(this[_0x66fe('0x15')](_0x14e66a)){if(this[_0x66fe('0xb')][_0x14e66a['uniqueid']]){this[_0x66fe('0xb')][_0x14e66a['uniqueid']][_0x66fe('0x44')]=moment()[_0x66fe('0x45')](_0x66fe('0x1a'));this[_0x66fe('0xb')][_0x14e66a[_0x66fe('0x18')]][_0x66fe('0x46')]=moment(this[_0x66fe('0xb')][_0x14e66a['uniqueid']][_0x66fe('0x44')])[_0x66fe('0x47')](this[_0x66fe('0xb')][_0x14e66a[_0x66fe('0x18')]][_0x66fe('0x48')],_0x66fe('0x49'));this['channels'][_0x14e66a['uniqueid']][_0x66fe('0x29')]=_0x66fe('0x4a');this[_0x66fe('0xd')][_0x66fe('0x4b')]+=0x1;if(this[_0x66fe('0xb')][_0x14e66a[_0x66fe('0x18')]][_0x66fe('0x28')]){this[_0x66fe('0xd')][_0x66fe('0x4c')]+=0x1;this[_0x66fe('0xb')][_0x14e66a[_0x66fe('0x18')]][_0x66fe('0x4d')]=moment(this[_0x66fe('0xb')][_0x14e66a[_0x66fe('0x18')]][_0x66fe('0x28')])[_0x66fe('0x47')](this[_0x66fe('0xb')][_0x14e66a[_0x66fe('0x18')]][_0x66fe('0x48')],_0x66fe('0x49'));this[_0x66fe('0xb')][_0x14e66a['uniqueid']][_0x66fe('0x4e')]=moment(this[_0x66fe('0xb')][_0x14e66a['uniqueid']]['endtime'])[_0x66fe('0x47')](this[_0x66fe('0xb')][_0x14e66a[_0x66fe('0x18')]][_0x66fe('0x28')],_0x66fe('0x49'));this['outbound'][_0x66fe('0x4f')]+=this[_0x66fe('0xb')][_0x14e66a['uniqueid']][_0x66fe('0x4d')]||0x0;this[_0x66fe('0xd')][_0x66fe('0x50')]+=this[_0x66fe('0xb')][_0x14e66a[_0x66fe('0x18')]][_0x66fe('0x4e')];}this[_0x66fe('0xd')][_0x66fe('0x51')]+=this[_0x66fe('0xb')][_0x14e66a[_0x66fe('0x18')]][_0x66fe('0x46')];ami[_0x66fe('0x17')](_0x66fe('0x52'),this[_0x66fe('0xb')][_0x14e66a[_0x66fe('0x18')]]);ami[_0x66fe('0x17')](_0x66fe('0x53'),this['channels'][_0x14e66a[_0x66fe('0x18')]]);this['emit'](_0x66fe('0x20'),'voice_outbound:save',this[_0x66fe('0xd')]);this[_0x66fe('0x17')]('voice:outbound','voice_outbound_channel:remove',this[_0x66fe('0xb')][_0x14e66a['uniqueid']]);delete this['channels'][_0x14e66a['uniqueid']];}if(this['variables'][_0x14e66a[_0x66fe('0x18')]]){delete this[_0x66fe('0xe')][_0x14e66a[_0x66fe('0x18')]];}}}catch(_0x2428c4){logger[_0x66fe('0x2c')](_0x66fe('0x54'),util[_0x66fe('0x2d')](_0x2428c4,{'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 1ccad55..298d57f 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 _0x0827=['originalposition','queuecallerabandonAt','queuecallerexitreason','ABANDONED','lastAssignedTo','queuecallerleaveAt','connectedlinenum','connectedlinename','[syncQueueCallerLeave][VoiceQueueReport]','[syncAgentConnect][VoiceQueueReport]','membername','queuecallerexit','queuecallerexitAt','transfer','COMPLETED','startsWith','toLowerCase','linkedid','queuecallerjoinAt','add','seconds','FORWARDTRANSFER','transfertype','destexten','transferuniqueid','COMPLETEDBY','toUpperCase','[syncAgentComplete][VoiceQueueReport]','addVariable','variable','value','queuestatus','queueposition','EXITWITHKEY','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipuri','memberdynamic','memberinterface','memberlastcall','memberpenalty','length','diff','milliseconds','custom:queuecallerunmanaged','custom:queuecallerabandon','custom:voiceQueueReport','[syncHangup][VoiceQueueReport]','transfereeuniqueid','transferexten','secondtransfererexten','ATTENDEDTRANSFER','ATTENDED','secondtransfereruniqueid','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[syncAttendedTransfer][VoiceQueueReport]','BLINDTRANSFER','BLIND','extension','BlindTransfer','context','transfererchannel','[syncBlindTransfer][VoiceQueueReport]','mohstarttime','[syncMusicOnHoldStart][VoiceQueueReport]','mohtime','[syncMusicOnHoldStop][VoiceQueueReport]','exports','moment','md5','ioredis','../../../config/environment','ami','../ami','../model/queueReport','redis','defaults','socket.io-emitter','prototype','enqueue','tail','sequence','queueReports','agents','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','syncQueueSummary','bind','syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerLeave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','syncVarSet','hangup','syncHangup','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','syncAttendedTransfer','blindtransfer','isUndefined','hasOwnProperty','isEmpty','originated','talking','pTalking','waiting','queueStatusComplete','unlockRR','clearZombieChannels','channels','switch','isNil','Action','status','channel','catch','message','No\x20such\x20channel','error','[voiceQueueReport][checkChannel]','[voiceQueueReport][checkQueueReport]','clearQueueReport','emitVoiceQueueChannelRemove','inspect','emit','emitVoiceQueueChannelSave','format','voice:queue:%s','name','voice_queue_channel:remove','emitVoiceQueueSummary','type','inbound','strategy','available','loggedIn','sumBillable','sumDuration','sumHoldTime','total','unmanaged','abandoned','Trunk','callerid','Interval','voice_queue:save','isNotNull','loopQueueShow','queues','[queues]','then','queue','countBy','callers','toNumber','loggedin','custom:queuesummary','[syncQueueSummary][VoiceQueueReport]','uniqueid','YYYY-MM-DD\x20HH:mm:ss','position','count','merge','push','syncQueueCallerAbandon','last','queuecallercomplete','queuecallercompleteAt','holdtime'];(function(_0x1c2821,_0x1b467b){var _0x5a8e39=function(_0x16c799){while(--_0x16c799){_0x1c2821['push'](_0x1c2821['shift']());}};_0x5a8e39(++_0x1b467b);}(_0x0827,0x106));var _0x7082=function(_0x51674a,_0x77ccff){_0x51674a=_0x51674a-0x0;var _0x13fca6=_0x0827[_0x51674a];return _0x13fca6;};'use strict';var _=require('lodash');var moment=require(_0x7082('0x0'));var BPromise=require('bluebird');var util=require('util');var md5=require(_0x7082('0x1'));var Redis=require(_0x7082('0x2'));var config=require(_0x7082('0x3'));var logger=require('../../../config/logger')(_0x7082('0x4'));var ami=require(_0x7082('0x5'));var QueueReport=require(_0x7082('0x6'));config[_0x7082('0x7')]=_[_0x7082('0x8')](config[_0x7082('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x7082('0x9'))(new Redis(config[_0x7082('0x7')]));var Sequence=function(){};Sequence[_0x7082('0xa')][_0x7082('0xb')]=function(_0x22f372){this[_0x7082('0xc')]=this[_0x7082('0xc')]?this[_0x7082('0xc')]['finally'](_0x22f372):_0x22f372();};function VoiceQueueReport(_0x3aaf0e){this[_0x7082('0xd')]=new Sequence();this[_0x7082('0xe')]={};this['agents']=_0x3aaf0e[_0x7082('0xf')];this['channels']=_0x3aaf0e[_0x7082('0x10')];this[_0x7082('0x11')]=_0x3aaf0e['voiceQueues'];this[_0x7082('0x12')]=!![];this[_0x7082('0x13')]=_0x3aaf0e[_0x7082('0x13')];this[_0x7082('0x14')]={};ami['on'](_0x7082('0x15'),this[_0x7082('0x16')][_0x7082('0x17')](this));ami['on']('queuesummarycomplete',this[_0x7082('0x18')][_0x7082('0x17')](this));ami['on'](_0x7082('0x19'),this[_0x7082('0x1a')]['bind'](this));ami['on'](_0x7082('0x1b'),this['syncQueueCallerAbandon'][_0x7082('0x17')](this));ami['on']('queuecallerleave',this[_0x7082('0x1c')][_0x7082('0x17')](this));ami['on'](_0x7082('0x1d'),this[_0x7082('0x1e')]['bind'](this));ami['on'](_0x7082('0x1f'),this[_0x7082('0x20')][_0x7082('0x17')](this));ami['on']('varset',this[_0x7082('0x21')]['bind'](this));ami['on'](_0x7082('0x22'),this[_0x7082('0x23')][_0x7082('0x17')](this));ami['on'](_0x7082('0x24'),this[_0x7082('0x25')][_0x7082('0x17')](this));ami['on'](_0x7082('0x26'),this[_0x7082('0x27')]['bind'](this));ami['on'](_0x7082('0x28'),this['syncMusicOnHoldStop'][_0x7082('0x17')](this));ami['on'](_0x7082('0x29'),this[_0x7082('0x2a')]['bind'](this));ami['on'](_0x7082('0x2b'),this['syncBlindTransfer'][_0x7082('0x17')](this));this['loopQueueSummary']();this['loopQueueShow']();}function isNotNull(_0x43d8cb){return _0x43d8cb!==null&&!_[_0x7082('0x2c')](_0x43d8cb);}function clearChannels(_0x4cccff){if(!_['isEmpty'](_0x4cccff)){for(var _0x5694bf in _0x4cccff){if(_0x4cccff[_0x7082('0x2d')](_0x5694bf)){delete _0x4cccff[_0x5694bf];}}}}function clearCampaigns(_0x15055f){if(!_[_0x7082('0x2e')](_0x15055f)){for(var _0x540a49 in _0x15055f){if(_0x15055f[_0x7082('0x2d')](_0x540a49)){_0x15055f[_0x540a49][_0x7082('0x2f')]=0x0;}}}}function clearVoiceQueues(_0x17c6f4){if(!_[_0x7082('0x2e')](_0x17c6f4)){for(var _0x44e11b in _0x17c6f4){if(_0x17c6f4[_0x7082('0x2d')](_0x44e11b)){_0x17c6f4[_0x44e11b][_0x7082('0x2f')]=0x0;_0x17c6f4[_0x44e11b][_0x7082('0x30')]=0x0;_0x17c6f4[_0x44e11b][_0x7082('0x31')]=0x0;_0x17c6f4[_0x44e11b][_0x7082('0x32')]=0x0;_0x17c6f4[_0x44e11b][_0x7082('0x33')]=!![];}}}}function clearAgentBooked(_0x353aed){if(!_[_0x7082('0x2e')](_0x353aed)){for(var _0x28a186 in _0x353aed){if(_0x353aed[_0x7082('0x2d')](_0x28a186)){_0x353aed[_0x28a186][_0x7082('0x34')]=!![];}}}}VoiceQueueReport[_0x7082('0xa')][_0x7082('0x35')]=function(){var _0x493e74=this;for(var _0x13e651 in this[_0x7082('0x36')]){if(this[_0x7082('0x36')][_0x7082('0x2d')](_0x13e651)&&!this['channels'][_0x13e651][_0x7082('0x37')]){this[_0x7082('0xd')]['enqueue'](function(){if(!_[_0x7082('0x38')](_0x493e74['channels'][_0x13e651])){return ami[_0x7082('0x39')]({'action':_0x7082('0x3a'),'channel':_0x493e74[_0x7082('0x36')][_0x13e651][_0x7082('0x3b')]})[_0x7082('0x3c')](function(_0x4b4346){if(_0x4b4346[_0x7082('0x3d')]===_0x7082('0x3e')){setTimeout(function(){if(_0x493e74[_0x7082('0x36')][_0x13e651]){delete _0x493e74[_0x7082('0x36')][_0x13e651];logger[_0x7082('0x3f')](_0x7082('0x40'),_0x13e651);}if(_0x493e74[_0x7082('0xe')][_0x13e651]){delete _0x493e74[_0x7082('0xe')][_0x13e651];logger[_0x7082('0x3f')](_0x7082('0x41'),_0x13e651);}if(_0x493e74[_0x7082('0x14')][_0x13e651]){delete _0x493e74[_0x7082('0x14')][_0x13e651];logger[_0x7082('0x3f')]('[voiceQueueReport][checkVariables]',_0x13e651);}},0x1f40);}});}});}}};VoiceQueueReport['prototype'][_0x7082('0x25')]=function(){logger['error']('[FullyBooted]\x20clear\x20realtime');clearChannels(this[_0x7082('0x36')]);this[_0x7082('0x42')](this[_0x7082('0xe')]);clearAgentBooked(this[_0x7082('0xf')]);clearVoiceQueues(this[_0x7082('0x11')]);clearCampaigns(this['campaigns']);};VoiceQueueReport['prototype'][_0x7082('0x42')]=function(_0x588631){var _0xbf2504=this;if(!_[_0x7082('0x2e')](_0x588631)){for(var _0x5c784f in _0x588631){if(_0x588631[_0x7082('0x2d')](_0x5c784f)){_0xbf2504[_0x7082('0x43')](_0x588631[_0x5c784f]);delete _0x588631[_0x5c784f];}}}};function loggerCatch(_0x1f8b98){return function(_0x270d23){logger[_0x7082('0x3f')](_0x1f8b98,util[_0x7082('0x44')](_0x270d23,{'showHidden':![],'depth':null}));};}VoiceQueueReport[_0x7082('0xa')][_0x7082('0x45')]=function(_0x4fcd68,_0x30a0fb,_0x21ceb1){io['to'](_0x4fcd68)[_0x7082('0x45')](_0x30a0fb,_0x21ceb1);};VoiceQueueReport['prototype'][_0x7082('0x46')]=function(_0x36179a){this[_0x7082('0x45')](util[_0x7082('0x47')](_0x7082('0x48'),_0x36179a[_0x7082('0x49')]),'voice_queue_channel:save',_0x36179a);};VoiceQueueReport[_0x7082('0xa')][_0x7082('0x43')]=function(_0x3e66b8){this[_0x7082('0x45')](util['format'](_0x7082('0x48'),_0x3e66b8[_0x7082('0x49')]),_0x7082('0x4a'),_0x3e66b8);};VoiceQueueReport[_0x7082('0xa')][_0x7082('0x4b')]=function(_0x5db1a0){if(_0x5db1a0[_0x7082('0x4c')]===_0x7082('0x4d')){var _0x473b28={'id':_0x5db1a0['id'],'name':_0x5db1a0['name'],'strategy':_0x5db1a0[_0x7082('0x4e')],'answered':_0x5db1a0['answered'],'available':_0x5db1a0[_0x7082('0x4f')],'loggedIn':_0x5db1a0[_0x7082('0x50')],'pTalking':_0x5db1a0[_0x7082('0x31')],'sumBillable':_0x5db1a0[_0x7082('0x51')],'sumDuration':_0x5db1a0[_0x7082('0x52')],'sumHoldTime':_0x5db1a0[_0x7082('0x53')]||0x0,'talking':_0x5db1a0[_0x7082('0x30')],'total':_0x5db1a0[_0x7082('0x54')],'type':_0x5db1a0[_0x7082('0x4c')],'unmanaged':_0x5db1a0[_0x7082('0x55')],'abandoned':_0x5db1a0[_0x7082('0x56')],'waiting':_0x5db1a0['waiting']};if(_0x5db1a0[_0x7082('0x57')]){_0x473b28[_0x7082('0x57')]={'id':_0x5db1a0[_0x7082('0x57')]['id'],'name':_0x5db1a0[_0x7082('0x57')][_0x7082('0x49')],'active':_0x5db1a0[_0x7082('0x57')]['active'],'callerid':_0x5db1a0[_0x7082('0x57')][_0x7082('0x58')]};}if(_0x5db1a0[_0x7082('0x59')]){_0x473b28[_0x7082('0x59')]={'id':_0x5db1a0[_0x7082('0x59')]['id'],'name':_0x5db1a0[_0x7082('0x59')][_0x7082('0x49')]};}var _0x5c97af=md5(JSON['stringify'](_0x473b28));if(_0x5db1a0[_0x7082('0x1')]!==_0x5c97af){_0x5db1a0[_0x7082('0x1')]=_0x5c97af;this['emit'](util[_0x7082('0x47')](_0x7082('0x48'),_0x473b28[_0x7082('0x49')]),_0x7082('0x5a'),_0x473b28);}}};VoiceQueueReport['prototype'][_0x7082('0x5b')]=function(_0x4d6a43){return _0x4d6a43!==null&&!_[_0x7082('0x2c')](_0x4d6a43);};VoiceQueueReport[_0x7082('0xa')][_0x7082('0x5c')]=function(){var _0xe37e3f=this;setInterval(function(){_0xe37e3f['clearZombieChannels']();ami[_0x7082('0x39')]({'action':_0x7082('0x5d')})['catch'](loggerCatch(_0x7082('0x5e')));},0x2710);};VoiceQueueReport[_0x7082('0xa')]['loopQueueSummary']=function(){var _0x1ed352=this;setInterval(function(){if(_0x1ed352[_0x7082('0x12')]){return ami[_0x7082('0x39')]({'action':_0x7082('0x15')})[_0x7082('0x5f')](function(_0x1c8c1b){_0x1ed352[_0x7082('0x12')]=![];})['catch'](loggerCatch('[queuesummary]'));}},0x3e8);};VoiceQueueReport[_0x7082('0xa')][_0x7082('0x16')]=function(_0x3855e4){try{if(this[_0x7082('0x5b')](_0x3855e4)&&this[_0x7082('0x5b')](_0x3855e4[_0x7082('0x60')])){if(this[_0x7082('0x11')][_0x3855e4['queue']]){var _0x48d65f=_[_0x7082('0x61')](this[_0x7082('0x36')],_0x7082('0x60'))[_0x3855e4['queue']]||0x0;var _0x4d9202=_0x48d65f-_0x3855e4[_0x7082('0x62')];if(this[_0x7082('0x11')][_0x3855e4[_0x7082('0x60')]][_0x7082('0x32')]!==_[_0x7082('0x63')](_0x3855e4[_0x7082('0x62')])||this['voiceQueues'][_0x3855e4['queue']][_0x7082('0x50')]!==_[_0x7082('0x63')](_0x3855e4[_0x7082('0x64')])||this[_0x7082('0x11')][_0x3855e4[_0x7082('0x60')]]['available']!==_[_0x7082('0x63')](_0x3855e4[_0x7082('0x4f')])||this[_0x7082('0x11')][_0x3855e4[_0x7082('0x60')]][_0x7082('0x30')]!==_0x4d9202){this[_0x7082('0x11')][_0x3855e4[_0x7082('0x60')]][_0x7082('0x32')]=_[_0x7082('0x63')](_0x3855e4[_0x7082('0x62')]);this[_0x7082('0x11')][_0x3855e4['queue']][_0x7082('0x50')]=_['toNumber'](_0x3855e4['loggedin']);this[_0x7082('0x11')][_0x3855e4[_0x7082('0x60')]][_0x7082('0x4f')]=_['toNumber'](_0x3855e4[_0x7082('0x4f')]);this['voiceQueues'][_0x3855e4[_0x7082('0x60')]][_0x7082('0x30')]=_0x4d9202>0x0?_0x4d9202:0x0;this[_0x7082('0x11')][_0x3855e4['queue']]['talking']=this[_0x7082('0x11')][_0x3855e4[_0x7082('0x60')]][_0x7082('0x30')]>_['toNumber'](_0x3855e4[_0x7082('0x64')])?_['toNumber'](_0x3855e4[_0x7082('0x64')]):this[_0x7082('0x11')][_0x3855e4[_0x7082('0x60')]][_0x7082('0x30')];this[_0x7082('0x4b')](this[_0x7082('0x11')][_0x3855e4[_0x7082('0x60')]]);}ami['emit'](_0x7082('0x65'),this[_0x7082('0x11')][_0x3855e4[_0x7082('0x60')]]);}}}catch(_0x519ea9){logger[_0x7082('0x3f')](_0x7082('0x66'),util[_0x7082('0x44')](_0x519ea9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7082('0xa')][_0x7082('0x18')]=function(_0x559a72){this['flagQueueSummary']=!![];};VoiceQueueReport[_0x7082('0xa')]['syncNewExten']=function(_0x217ddb){};VoiceQueueReport[_0x7082('0xa')][_0x7082('0x1a')]=function(_0x29a2e1){try{if(this['isNotNull'](_0x29a2e1)){if(_['isUndefined'](this[_0x7082('0xe')][_0x29a2e1[_0x7082('0x67')]])){this[_0x7082('0xe')][_0x29a2e1['uniqueid']]=[];this[_0x7082('0x36')][_0x29a2e1[_0x7082('0x67')]]={};}var _0x3989f6=new QueueReport();_0x3989f6[_0x7082('0x49')]=_0x29a2e1[_0x7082('0x60')];_0x3989f6[_0x7082('0x4c')]=this['voiceQueues'][_0x3989f6[_0x7082('0x49')]]&&this[_0x7082('0x11')][_0x3989f6[_0x7082('0x49')]][_0x7082('0x4c')]?this[_0x7082('0x11')][_0x3989f6[_0x7082('0x49')]][_0x7082('0x4c')]||_0x7082('0x4d'):'inbound';_0x3989f6[_0x7082('0x60')]=_0x29a2e1[_0x7082('0x60')];_0x3989f6['queuecallerjoinAt']=moment()[_0x7082('0x47')](_0x7082('0x68'));_0x3989f6[_0x7082('0x69')]=_0x29a2e1[_0x7082('0x69')];_0x3989f6[_0x7082('0x6a')]=_0x29a2e1[_0x7082('0x6a')];_[_0x7082('0x6b')](_0x3989f6,_['pick'](_0x29a2e1,_['keys'](_0x3989f6)));this[_0x7082('0xe')][_0x29a2e1[_0x7082('0x67')]][_0x7082('0x6c')](_0x3989f6);this['channels'][_0x29a2e1[_0x7082('0x67')]]=_0x3989f6;this[_0x7082('0x46')](_0x3989f6);}}catch(_0xd3ad94){logger['error']('[syncQueueCallerJoin][VoiceQueueReport]',util['inspect'](_0xd3ad94,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7082('0xa')][_0x7082('0x6d')]=function(_0x54d66b){try{if(this['isNotNull'](_0x54d66b)){if(this[_0x7082('0xe')][_0x54d66b['uniqueid']]){var _0x2e30bf=_[_0x7082('0x6e')](this[_0x7082('0xe')][_0x54d66b['uniqueid']]);_0x2e30bf[_0x7082('0x6f')]=![];_0x2e30bf[_0x7082('0x70')]=null;_0x2e30bf[_0x7082('0x71')]=_0x54d66b[_0x7082('0x71')];_0x2e30bf[_0x7082('0x72')]=_0x54d66b[_0x7082('0x72')];_0x2e30bf[_0x7082('0x1b')]=!![];_0x2e30bf[_0x7082('0x73')]=moment()[_0x7082('0x47')](_0x7082('0x68'));_0x2e30bf[_0x7082('0x74')]=_0x7082('0x75');_0x2e30bf[_0x7082('0x76')]=null;this['channels'][_0x54d66b[_0x7082('0x67')]]=_0x2e30bf;this['emitVoiceQueueChannelRemove'](_0x2e30bf);}}}catch(_0x2f4031){logger[_0x7082('0x3f')]('[syncQueueCallerAbandon][VoiceQueueReport]',util[_0x7082('0x44')](_0x2f4031,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7082('0x1c')]=function(_0x2f3c9d){try{if(this['isNotNull'](_0x2f3c9d)){if(this['queueReports'][_0x2f3c9d[_0x7082('0x67')]]){var _0x21d9fe=_[_0x7082('0x6e')](this[_0x7082('0xe')][_0x2f3c9d[_0x7082('0x67')]]);_0x21d9fe[_0x7082('0x77')]=moment()[_0x7082('0x47')](_0x7082('0x68'));_0x21d9fe[_0x7082('0x78')]=_0x2f3c9d['connectedlinenum'];_0x21d9fe[_0x7082('0x79')]=_0x2f3c9d[_0x7082('0x79')];this[_0x7082('0x36')][_0x2f3c9d['uniqueid']]=_0x21d9fe;this[_0x7082('0x46')](_0x21d9fe);}}}catch(_0xef33a5){logger['error'](_0x7082('0x7a'),util[_0x7082('0x44')](_0xef33a5,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7082('0x20')]=function(_0x2ea7aa){try{if(this['isNotNull'](_0x2ea7aa)){if(this['queueReports'][_0x2ea7aa[_0x7082('0x67')]]){var _0x341fe1=_[_0x7082('0x6e')](this[_0x7082('0xe')][_0x2ea7aa[_0x7082('0x67')]]);_0x341fe1[_0x7082('0x6f')]=!![];_0x341fe1[_0x7082('0x74')]='COMPLETEDBYAGENT';}}}catch(_0x18ef3a){logger[_0x7082('0x3f')](_0x7082('0x7b'),util[_0x7082('0x44')](_0x18ef3a,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7082('0x1e')]=function(_0x59d699){try{if(this[_0x7082('0x5b')](_0x59d699)){if(this[_0x7082('0xe')][_0x59d699[_0x7082('0x67')]]){var _0x1d33a3=_['last'](this['queueReports'][_0x59d699[_0x7082('0x67')]]);_0x1d33a3[_0x7082('0x1b')]=![];_0x1d33a3['queuecallerabandonAt']=null;_0x1d33a3['assigned']=!![];_0x1d33a3[_0x7082('0x76')]=_0x59d699[_0x7082('0x7c')];_0x1d33a3['holdtime']=_0x59d699[_0x7082('0x71')];_0x1d33a3[_0x7082('0x6f')]=!![];_0x1d33a3[_0x7082('0x7d')]=![];_0x1d33a3[_0x7082('0x7e')]=null;if(!_0x1d33a3[_0x7082('0x7f')]){if(_0x59d699['reason']=='transfer'){_0x1d33a3[_0x7082('0x74')]=_0x7082('0x80');}else{if(_[_0x7082('0x81')](_0x59d699[_0x7082('0x3b')][_0x7082('0x82')](),'local/')){if(this[_0x7082('0xe')][_0x59d699[_0x7082('0x83')]]){var _0x6b49dc=_[_0x7082('0x6e')](this[_0x7082('0xe')][_0x59d699['linkedid']]);_0x6b49dc[_0x7082('0x6f')]=![];_0x6b49dc[_0x7082('0x7d')]=!![];_0x6b49dc[_0x7082('0x7e')]=moment(_0x1d33a3[_0x7082('0x84')])[_0x7082('0x85')](_0x59d699['holdtime'],_0x7082('0x86'))[_0x7082('0x47')]('YYYY-MM-DD\x20HH:mm:ss');_0x6b49dc[_0x7082('0x74')]=_0x7082('0x87');_0x6b49dc[_0x7082('0x7f')]=!![];_0x6b49dc[_0x7082('0x88')]='FORWARD';_0x6b49dc['transferexten']=_0x59d699[_0x7082('0x89')];_0x6b49dc[_0x7082('0x8a')]=_0x59d699['uniqueid'];var _0xefa21a=this[_0x7082('0xe')][_0x59d699[_0x7082('0x83')]];this[_0x7082('0xe')][_0x59d699[_0x7082('0x83')]]=this[_0x7082('0xe')][_0x59d699[_0x7082('0x67')]];this['queueReports'][_0x59d699[_0x7082('0x67')]]=_0xefa21a;}}else{_0x1d33a3[_0x7082('0x74')]=_0x7082('0x8b')+_0x59d699['reason'][_0x7082('0x8c')]();}}}this[_0x7082('0x36')][_0x59d699[_0x7082('0x67')]]=_0x1d33a3;this['emitVoiceQueueChannelRemove'](_0x1d33a3);}}}catch(_0x51c5e6){logger[_0x7082('0x3f')](_0x7082('0x8d'),util[_0x7082('0x44')](_0x51c5e6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7082('0xa')][_0x7082('0x21')]=function(_0x404a6f){try{if(this[_0x7082('0x5b')](_0x404a6f)){this[_0x7082('0x8e')](_0x404a6f['uniqueid'],_['keys'](_0x404a6f[_0x7082('0x8f')])[0x0],_0x404a6f[_0x7082('0x90')]);if(this[_0x7082('0xe')][_0x404a6f['uniqueid']]){var _0x4ed35a=_[_0x7082('0x6e')](this['queueReports'][_0x404a6f[_0x7082('0x67')]]);if(_0x4ed35a){if(this['isNotNull'](_0x404a6f[_0x7082('0x8f')])&&this['isNotNull'](_0x404a6f[_0x7082('0x8f')][_0x7082('0x91')])){switch(_0x404a6f[_0x7082('0x90')]){case'CONTINUE':_0x4ed35a[_0x7082('0x7d')]=![];_0x4ed35a[_0x7082('0x7e')]=null;break;default:_0x4ed35a[_0x7082('0x7d')]=!![];_0x4ed35a['queuecallerexitAt']=moment()['format'](_0x7082('0x68'));_0x4ed35a[_0x7082('0x77')]=moment()[_0x7082('0x47')](_0x7082('0x68'));}_0x4ed35a[_0x7082('0x1b')]=![];_0x4ed35a['queuecallerabandonAt']=null;_0x4ed35a[_0x7082('0x74')]=_0x404a6f[_0x7082('0x90')];this[_0x7082('0x36')][_0x404a6f[_0x7082('0x67')]]=_0x4ed35a;this[_0x7082('0x43')](_0x4ed35a);}else if(this[_0x7082('0x5b')](_0x404a6f[_0x7082('0x8f')])&&this[_0x7082('0x5b')](_0x404a6f[_0x7082('0x8f')][_0x7082('0x92')])){if(!_0x4ed35a['queuecallerabandon']){_0x4ed35a[_0x7082('0x7d')]=!![];_0x4ed35a[_0x7082('0x7e')]=moment()[_0x7082('0x47')]('YYYY-MM-DD\x20HH:mm:ss');_0x4ed35a['queuecallerexitreason']=_0x7082('0x93');_0x4ed35a[_0x7082('0x77')]=moment()[_0x7082('0x47')](_0x7082('0x68'));this['channels'][_0x404a6f[_0x7082('0x67')]]=_0x4ed35a;}}_0x4ed35a[_0x7082('0x14')]=this['variables'][_0x404a6f[_0x7082('0x67')]];}}}}catch(_0xec19a6){logger[_0x7082('0x3f')]('[syncVarSet][VoiceQueueReport]',util[_0x7082('0x44')](_0xec19a6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7082('0xa')][_0x7082('0x8e')]=function(_0x46a189,_0x2a595d,_0x476ff5){var _0x30a816=['rtpaudioqos',_0x7082('0x94'),_0x7082('0x95'),_0x7082('0x96'),_0x7082('0x97'),_0x7082('0x98'),'rtpaudioqosrtt',_0x7082('0x99'),'sipcallid',_0x7082('0x9a'),'bridgepeer','bridgepvtcallid','membercalls',_0x7082('0x9b'),_0x7082('0x9c'),_0x7082('0x9d'),_0x7082('0x7c'),_0x7082('0x9e'),'memberrealtime'];if(!_['isNil'](_0x2a595d)&&!_['includes'](_0x30a816,_0x2a595d)){if(_[_0x7082('0x2c')](this[_0x7082('0x14')][_0x46a189])){this[_0x7082('0x14')][_0x46a189]={};}this[_0x7082('0x14')][_0x46a189][_0x2a595d]=_0x476ff5;}};VoiceQueueReport['prototype'][_0x7082('0x23')]=function(_0x982a3a){try{if(this[_0x7082('0x5b')](_0x982a3a)){if(this['queueReports'][_0x982a3a[_0x7082('0x67')]]){for(var _0x1f37bf=0x0,_0x4b4690={};_0x1f37bf0x0?_0x3d64a7:0x0;this['voiceQueues'][_0x27b129[_0x76f8('0x61')]][_0x76f8('0x33')]=this[_0x76f8('0x14')][_0x27b129[_0x76f8('0x61')]]['talking']>_[_0x76f8('0x63')](_0x27b129['loggedin'])?_['toNumber'](_0x27b129['loggedin']):this[_0x76f8('0x14')][_0x27b129[_0x76f8('0x61')]]['talking'];this[_0x76f8('0x4d')](this[_0x76f8('0x14')][_0x27b129[_0x76f8('0x61')]]);}ami['emit'](_0x76f8('0x66'),this[_0x76f8('0x14')][_0x27b129[_0x76f8('0x61')]]);}}}catch(_0x2a5290){logger['error'](_0x76f8('0x67'),util[_0x76f8('0x46')](_0x2a5290,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x76f8('0xc')]['syncQueueSummaryComplete']=function(_0x4d4636){this[_0x76f8('0x15')]=!![];};VoiceQueueReport['prototype'][_0x76f8('0x68')]=function(_0x405c3e){};VoiceQueueReport[_0x76f8('0xc')][_0x76f8('0x1c')]=function(_0x4eeac6){try{if(this[_0x76f8('0x5b')](_0x4eeac6)){if(_['isUndefined'](this[_0x76f8('0x3f')][_0x4eeac6[_0x76f8('0x69')]])){this[_0x76f8('0x3f')][_0x4eeac6[_0x76f8('0x69')]]=[];this[_0x76f8('0x12')][_0x4eeac6['uniqueid']]={};}var _0x47b7d9=new QueueReport();_0x47b7d9[_0x76f8('0x4a')]=_0x4eeac6[_0x76f8('0x61')];_0x47b7d9[_0x76f8('0x4e')]=this[_0x76f8('0x14')][_0x47b7d9[_0x76f8('0x4a')]]&&this[_0x76f8('0x14')][_0x47b7d9[_0x76f8('0x4a')]]['type']?this['voiceQueues'][_0x47b7d9[_0x76f8('0x4a')]][_0x76f8('0x4e')]||_0x76f8('0x4f'):'inbound';_0x47b7d9[_0x76f8('0x61')]=_0x4eeac6[_0x76f8('0x61')];_0x47b7d9[_0x76f8('0x6a')]=moment()[_0x76f8('0x48')](_0x76f8('0x6b'));_0x47b7d9['position']=_0x4eeac6[_0x76f8('0x6c')];_0x47b7d9[_0x76f8('0x6d')]=_0x4eeac6[_0x76f8('0x6d')];_['merge'](_0x47b7d9,_[_0x76f8('0x6e')](_0x4eeac6,_[_0x76f8('0x6f')](_0x47b7d9)));this['queueReports'][_0x4eeac6[_0x76f8('0x69')]][_0x76f8('0x70')](_0x47b7d9);this[_0x76f8('0x12')][_0x4eeac6[_0x76f8('0x69')]]=_0x47b7d9;this[_0x76f8('0x71')](_0x47b7d9);}}catch(_0x1fbcba){logger[_0x76f8('0x40')](_0x76f8('0x72'),util[_0x76f8('0x46')](_0x1fbcba,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x76f8('0xc')][_0x76f8('0x1e')]=function(_0x614502){try{if(this[_0x76f8('0x5b')](_0x614502)){if(this[_0x76f8('0x3f')][_0x614502[_0x76f8('0x69')]]){var _0x46865b=_[_0x76f8('0x73')](this['queueReports'][_0x614502[_0x76f8('0x69')]]);_0x46865b[_0x76f8('0x74')]=![];_0x46865b[_0x76f8('0x75')]=null;_0x46865b[_0x76f8('0x76')]=_0x614502[_0x76f8('0x76')];_0x46865b[_0x76f8('0x77')]=_0x614502[_0x76f8('0x77')];_0x46865b['queuecallerabandon']=!![];_0x46865b[_0x76f8('0x78')]=moment()[_0x76f8('0x48')](_0x76f8('0x6b'));_0x46865b[_0x76f8('0x79')]=_0x76f8('0x7a');_0x46865b[_0x76f8('0x7b')]=null;this['channels'][_0x614502['uniqueid']]=_0x46865b;this[_0x76f8('0x45')](_0x46865b);}}}catch(_0x4cd512){logger[_0x76f8('0x40')](_0x76f8('0x7c'),util[_0x76f8('0x46')](_0x4cd512,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerLeave']=function(_0x207586){try{if(this['isNotNull'](_0x207586)){if(this['queueReports'][_0x207586['uniqueid']]){var _0x206b46=_[_0x76f8('0x73')](this[_0x76f8('0x3f')][_0x207586[_0x76f8('0x69')]]);_0x206b46[_0x76f8('0x7d')]=moment()[_0x76f8('0x48')](_0x76f8('0x6b'));_0x206b46[_0x76f8('0x7e')]=_0x207586['connectedlinenum'];_0x206b46['connectedlinename']=_0x207586[_0x76f8('0x7f')];this[_0x76f8('0x12')][_0x207586[_0x76f8('0x69')]]=_0x206b46;this[_0x76f8('0x71')](_0x206b46);}}}catch(_0x150312){logger['error'](_0x76f8('0x80'),util[_0x76f8('0x46')](_0x150312,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x76f8('0xc')][_0x76f8('0x23')]=function(_0x2e49c7){try{if(this[_0x76f8('0x5b')](_0x2e49c7)){if(this[_0x76f8('0x3f')][_0x2e49c7['uniqueid']]){var _0xcc0a8e=_[_0x76f8('0x73')](this[_0x76f8('0x3f')][_0x2e49c7['uniqueid']]);_0xcc0a8e[_0x76f8('0x74')]=!![];_0xcc0a8e['queuecallerexitreason']='COMPLETEDBYAGENT';}}}catch(_0xb0c10f){logger[_0x76f8('0x40')](_0x76f8('0x81'),util['inspect'](_0xb0c10f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x76f8('0xc')]['syncAgentComplete']=function(_0x251a88){try{if(this['isNotNull'](_0x251a88)){if(this[_0x76f8('0x3f')][_0x251a88[_0x76f8('0x69')]]){var _0x3b34d0=_['last'](this['queueReports'][_0x251a88['uniqueid']]);_0x3b34d0['queuecallerabandon']=![];_0x3b34d0[_0x76f8('0x78')]=null;_0x3b34d0[_0x76f8('0x82')]=!![];_0x3b34d0[_0x76f8('0x7b')]=_0x251a88[_0x76f8('0x83')];_0x3b34d0[_0x76f8('0x76')]=_0x251a88[_0x76f8('0x76')];_0x3b34d0[_0x76f8('0x74')]=!![];_0x3b34d0[_0x76f8('0x84')]=![];_0x3b34d0[_0x76f8('0x85')]=null;if(!_0x3b34d0[_0x76f8('0x86')]){if(_0x251a88['reason']==_0x76f8('0x86')){_0x3b34d0[_0x76f8('0x79')]=_0x76f8('0x87');}else{if(_['startsWith'](_0x251a88[_0x76f8('0x3a')][_0x76f8('0x88')](),_0x76f8('0x89'))){if(this['queueReports'][_0x251a88[_0x76f8('0x8a')]]){var _0xac4394=_[_0x76f8('0x73')](this['queueReports'][_0x251a88[_0x76f8('0x8a')]]);_0xac4394['queuecallercomplete']=![];_0xac4394[_0x76f8('0x84')]=!![];_0xac4394[_0x76f8('0x85')]=moment(_0x3b34d0[_0x76f8('0x6a')])['add'](_0x251a88['holdtime'],_0x76f8('0x8b'))[_0x76f8('0x48')](_0x76f8('0x6b'));_0xac4394[_0x76f8('0x79')]=_0x76f8('0x8c');_0xac4394[_0x76f8('0x86')]=!![];_0xac4394['transfertype']=_0x76f8('0x8d');_0xac4394[_0x76f8('0x8e')]=_0x251a88[_0x76f8('0x8f')];_0xac4394[_0x76f8('0x90')]=_0x251a88[_0x76f8('0x69')];var _0x29a22c=this[_0x76f8('0x3f')][_0x251a88[_0x76f8('0x8a')]];this[_0x76f8('0x3f')][_0x251a88[_0x76f8('0x8a')]]=this[_0x76f8('0x3f')][_0x251a88[_0x76f8('0x69')]];this['queueReports'][_0x251a88[_0x76f8('0x69')]]=_0x29a22c;}}else{_0x3b34d0[_0x76f8('0x79')]=_0x76f8('0x91')+_0x251a88[_0x76f8('0x92')][_0x76f8('0x93')]();}}}this[_0x76f8('0x12')][_0x251a88[_0x76f8('0x69')]]=_0x3b34d0;this[_0x76f8('0x45')](_0x3b34d0);}}}catch(_0xa37cbc){logger[_0x76f8('0x40')](_0x76f8('0x94'),util[_0x76f8('0x46')](_0xa37cbc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x76f8('0xc')]['syncVarSet']=function(_0x3fee79){try{if(this['isNotNull'](_0x3fee79)){this[_0x76f8('0x95')](_0x3fee79[_0x76f8('0x69')],_[_0x76f8('0x6f')](_0x3fee79[_0x76f8('0x96')])[0x0],_0x3fee79[_0x76f8('0x97')]);if(this[_0x76f8('0x3f')][_0x3fee79[_0x76f8('0x69')]]){var _0x1e3254=_[_0x76f8('0x73')](this[_0x76f8('0x3f')][_0x3fee79[_0x76f8('0x69')]]);if(_0x1e3254){if(this[_0x76f8('0x5b')](_0x3fee79[_0x76f8('0x96')])&&this[_0x76f8('0x5b')](_0x3fee79[_0x76f8('0x96')]['queuestatus'])){switch(_0x3fee79[_0x76f8('0x97')]){case _0x76f8('0x98'):_0x1e3254[_0x76f8('0x84')]=![];_0x1e3254[_0x76f8('0x85')]=null;break;default:_0x1e3254[_0x76f8('0x84')]=!![];_0x1e3254[_0x76f8('0x85')]=moment()['format'](_0x76f8('0x6b'));_0x1e3254[_0x76f8('0x7d')]=moment()['format'](_0x76f8('0x6b'));}_0x1e3254[_0x76f8('0x1d')]=![];_0x1e3254['queuecallerabandonAt']=null;_0x1e3254[_0x76f8('0x79')]=_0x3fee79[_0x76f8('0x97')];this[_0x76f8('0x12')][_0x3fee79[_0x76f8('0x69')]]=_0x1e3254;this[_0x76f8('0x45')](_0x1e3254);}else if(this['isNotNull'](_0x3fee79[_0x76f8('0x96')])&&this[_0x76f8('0x5b')](_0x3fee79[_0x76f8('0x96')]['queueposition'])){if(!_0x1e3254[_0x76f8('0x1d')]){_0x1e3254[_0x76f8('0x84')]=!![];_0x1e3254[_0x76f8('0x85')]=moment()[_0x76f8('0x48')](_0x76f8('0x6b'));_0x1e3254['queuecallerexitreason']=_0x76f8('0x99');_0x1e3254[_0x76f8('0x7d')]=moment()[_0x76f8('0x48')](_0x76f8('0x6b'));this[_0x76f8('0x12')][_0x3fee79[_0x76f8('0x69')]]=_0x1e3254;}}_0x1e3254['variables']=this['variables'][_0x3fee79['uniqueid']];}}}}catch(_0x41c1ba){logger[_0x76f8('0x40')]('[syncVarSet][VoiceQueueReport]',util['inspect'](_0x41c1ba,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x76f8('0x95')]=function(_0xe20e30,_0x56ccc4,_0x365905){var _0x1fc489=[_0x76f8('0x9a'),_0x76f8('0x9b'),'rtpaudioqosjitter','rtpaudioqosjitterbridged',_0x76f8('0x9c'),_0x76f8('0x9d'),'rtpaudioqosrtt',_0x76f8('0x9e'),_0x76f8('0x9f'),_0x76f8('0xa0'),_0x76f8('0xa1'),_0x76f8('0xa2'),_0x76f8('0xa3'),_0x76f8('0xa4'),_0x76f8('0xa5'),'memberlastcall',_0x76f8('0x83'),_0x76f8('0xa6'),_0x76f8('0xa7')];if(!_[_0x76f8('0xa8')](_0x56ccc4)&&!_[_0x76f8('0xa9')](_0x1fc489,_0x56ccc4)){if(_['isUndefined'](this[_0x76f8('0x17')][_0xe20e30])){this[_0x76f8('0x17')][_0xe20e30]={};}this[_0x76f8('0x17')][_0xe20e30][_0x56ccc4]=_0x365905;}};VoiceQueueReport[_0x76f8('0xc')][_0x76f8('0x27')]=function(_0x177f73){try{if(this['isNotNull'](_0x177f73)){if(this[_0x76f8('0x3f')][_0x177f73[_0x76f8('0x69')]]){for(var _0x36b715=0x0,_0x31522f={};_0x36b715=0x0?moment(_0x146dab[_0x2f2e('0x18')])[_0x2f2e('0x19')](_0x146dab['starttime'],'seconds'):null,'data1':_0x2f2e('0x1a'),'data2':_0x146dab[_0x2f2e('0x12')],'data3':_0x146dab[_0x2f2e('0xf')],'data4':_0x146dab[_0x2f2e('0x1b')]||null,'role':_0x2f2e('0x11'),'internal':_0x146dab['accountcode']?_[_0x2f2e('0x13')](_0x146dab[_0x2f2e('0x12')]):undefined,'uniqueid':_0x146dab['uniqueid']},'log':_0x2f2e('0x5')});}; \ No newline at end of file +var _0x6aca=['queuecallerexitAt','Request','lastAssignedTo','isNil','format','SIP/%s','interface','TALKING','diff','queuecallerleaveAt','seconds','inbound','calleridnum','exten','agent','toNumber','uniqueid','CreateMemberReport','voiceDialReport','voice','starttime','endtime','outbound','accountcode','dialstring','lodash','../client','voiceQueueReport','queuecallercompleteAt'];(function(_0x4b8ed5,_0x398396){var _0x403efd=function(_0x466b53){while(--_0x466b53){_0x4b8ed5['push'](_0x4b8ed5['shift']());}};_0x403efd(++_0x398396);}(_0x6aca,0x1af));var _0xa6ac=function(_0x12012d,_0x46e1f6){_0x12012d=_0x12012d-0x0;var _0x2ccaf1=_0x6aca[_0x12012d];return _0x2ccaf1;};'use strict';var moment=require('moment');var _=require(_0xa6ac('0x0'));var util=require('util');var client=require(_0xa6ac('0x1'));exports[_0xa6ac('0x2')]=function(_0x1df978){var _0x5a8005=_0x1df978[_0xa6ac('0x3')]||_0x1df978[_0xa6ac('0x4')];return client[_0xa6ac('0x5')]('CreateMemberReport',{'body':{'channel':'voice','membername':_0x1df978[_0xa6ac('0x6')],'interface':_[_0xa6ac('0x7')](_0x1df978['interface'])?util[_0xa6ac('0x8')](_0xa6ac('0x9'),_0x1df978[_0xa6ac('0x6')]):_0x1df978[_0xa6ac('0xa')],'type':_0xa6ac('0xb'),'enterAt':_0x1df978['queuecallerleaveAt'],'exitAt':_0x5a8005,'duration':moment(_0x5a8005)[_0xa6ac('0xc')](_0x1df978[_0xa6ac('0xd')],_0xa6ac('0xe')),'data1':_0xa6ac('0xf'),'data2':_0x1df978[_0xa6ac('0x10')],'data3':_0x1df978[_0xa6ac('0x11')],'data4':null,'data5':_0x1df978['queue'],'role':_0xa6ac('0x12'),'internal':_0x1df978['accountcode']?_[_0xa6ac('0x13')](_0x1df978['accountcode']):undefined,'uniqueid':_0x1df978[_0xa6ac('0x14')]},'log':_0xa6ac('0x15')});};exports[_0xa6ac('0x16')]=function(_0x757f8c){return client[_0xa6ac('0x5')]('CreateMemberReport',{'body':{'channel':_0xa6ac('0x17'),'membername':_0x757f8c['membername'],'interface':_0x757f8c[_0xa6ac('0xa')],'type':_0xa6ac('0xb'),'enterAt':_0x757f8c[_0xa6ac('0x18')],'exitAt':_0x757f8c['endtime'],'duration':moment(_0x757f8c[_0xa6ac('0x19')])[_0xa6ac('0xc')](_0x757f8c['starttime'],_0xa6ac('0xe'))>=0x0?moment(_0x757f8c['endtime'])[_0xa6ac('0xc')](_0x757f8c[_0xa6ac('0x18')],_0xa6ac('0xe')):null,'data1':_0xa6ac('0x1a'),'data2':_0x757f8c[_0xa6ac('0x1b')],'data3':_0x757f8c['exten'],'data4':_0x757f8c[_0xa6ac('0x1c')]||null,'role':_0xa6ac('0x12'),'internal':_0x757f8c[_0xa6ac('0x1b')]?_['toNumber'](_0x757f8c[_0xa6ac('0x1b')]):undefined,'uniqueid':_0x757f8c[_0xa6ac('0x14')]},'log':_0xa6ac('0x15')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 3bcec4c..580288f 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 _0x41ac=['../client','getTemplates','Request','GetTemplate','name','html'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x41ac,0x168));var _0xc41a=function(_0x46b7fc,_0x583a07){_0x46b7fc=_0x46b7fc-0x0;var _0x6a4702=_0x41ac[_0x46b7fc];return _0x6a4702;};'use strict';var client=require(_0xc41a('0x0'));exports[_0xc41a('0x1')]=function(_0x5c2d2d){return function(_0x803fa4){return client[_0xc41a('0x2')](_0xc41a('0x3'),{'options':{'raw':!![],'attributes':['id',_0xc41a('0x4'),_0xc41a('0x5')]},'log':_0xc41a('0x3')});};}; \ No newline at end of file +var _0x212a=['GetTemplate','html','getTemplates'];(function(_0x2924ca,_0x387f59){var _0x556b7e=function(_0x4292cd){while(--_0x4292cd){_0x2924ca['push'](_0x2924ca['shift']());}};_0x556b7e(++_0x387f59);}(_0x212a,0x140));var _0xa212=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x212a[_0x5d6456];return _0x4d66c1;};'use strict';var client=require('../client');exports[_0xa212('0x0')]=function(_0x2c1685){return function(_0x553574){return client['Request'](_0xa212('0x1'),{'options':{'raw':!![],'attributes':['id','name',_0xa212('0x2')]},'log':_0xa212('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 4935a48..feacdaa 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(_0x2af9af,_0x1ac3f1){var _0x324293=function(_0x496512){while(--_0x496512){_0x2af9af['push'](_0x2af9af['shift']());}};_0x324293(++_0x1ac3f1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'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(_0x14d8ab,_0x12682a){var _0x578d8b=function(_0x4a535e){while(--_0x4a535e){_0x14d8ab['push'](_0x14d8ab['shift']());}};_0x578d8b(++_0x12682a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'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 8f00edf..b9237c0 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 _0x5f58=['getTrunks','Request','GetTrunk','name','registry','../client'];(function(_0x54806b,_0x581f89){var _0x58a7ae=function(_0x30bbce){while(--_0x30bbce){_0x54806b['push'](_0x54806b['shift']());}};_0x58a7ae(++_0x581f89);}(_0x5f58,0xcb));var _0x85f5=function(_0x5cf5fd,_0x4bca34){_0x5cf5fd=_0x5cf5fd-0x0;var _0x4a53ec=_0x5f58[_0x5cf5fd];return _0x4a53ec;};'use strict';var client=require(_0x85f5('0x0'));exports[_0x85f5('0x1')]=function(_0x574a7f){return function(_0x45be59){return client[_0x85f5('0x2')](_0x85f5('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x85f5('0x4'),_0x85f5('0x5')]},'log':_0x85f5('0x3')});};}; \ No newline at end of file +var _0xd0ca=['registry','GetTrunk','../client','Request','name'];(function(_0xed4881,_0x45771c){var _0x7fcbd5=function(_0x36b960){while(--_0x36b960){_0xed4881['push'](_0xed4881['shift']());}};_0x7fcbd5(++_0x45771c);}(_0xd0ca,0x11f));var _0xad0c=function(_0x34b3ad,_0x6801c7){_0x34b3ad=_0x34b3ad-0x0;var _0x2ea3cd=_0xd0ca[_0x34b3ad];return _0x2ea3cd;};'use strict';var client=require(_0xad0c('0x0'));exports['getTrunks']=function(_0x527ee3){return function(_0x220075){return client[_0xad0c('0x1')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xad0c('0x2'),_0xad0c('0x3')]},'log':_0xad0c('0x4')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 28c2d2c..6e06b6d 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 _0xca0f=['mobile','interface','getTelephones','GetUser','telephone','internal','PauseUser','savePause','UnpauseUser','getAgent','ShowUser','agent','lastLoginAt','voicePause','../client','getAgents','Request','name','email','accountcode','fullname','online','pauseType','phone'];(function(_0x18350a,_0x105fe4){var _0x33050e=function(_0x460c3f){while(--_0x460c3f){_0x18350a['push'](_0x18350a['shift']());}};_0x33050e(++_0x105fe4);}(_0xca0f,0x9e));var _0xfca0=function(_0x13ef78,_0x508cd1){_0x13ef78=_0x13ef78-0x0;var _0x583212=_0xca0f[_0x13ef78];return _0x583212;};'use strict';var client=require(_0xfca0('0x0'));exports[_0xfca0('0x1')]=function(){return function(){return client[_0xfca0('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0xfca0('0x3'),_0xfca0('0x4'),_0xfca0('0x5'),_0xfca0('0x6'),_0xfca0('0x7'),'lastLoginAt',_0xfca0('0x8'),'lastPauseAt','voicePause',_0xfca0('0x9'),_0xfca0('0xa'),_0xfca0('0xb')]},'log':'getAgents'});};};exports[_0xfca0('0xc')]=function(){return function(){return client[_0xfca0('0x2')](_0xfca0('0xd'),{'options':{'raw':!![],'where':{'role':_0xfca0('0xe')},'attributes':['id','name',_0xfca0('0x5'),_0xfca0('0xf')]},'log':_0xfca0('0xc')});};};exports['savePause']=function(_0x538d93,_0x2bc8aa,_0x37d223){return client[_0xfca0('0x2')](_0xfca0('0x10'),{'body':{'type':_0x2bc8aa,'uniqueid':_0x37d223},'options':{'where':{'id':_0x538d93['id']}},'log':_0xfca0('0x11')});};exports['saveUnpause']=function(_0x556572){return client[_0xfca0('0x2')](_0xfca0('0x12'),{'body':{},'options':{'where':{'id':_0x556572['id']}},'log':_0xfca0('0x11')});};exports[_0xfca0('0x13')]=function(_0x1c7d59){return client[_0xfca0('0x2')](_0xfca0('0x14'),{'options':{'raw':![],'where':{'role':_0xfca0('0x15'),'id':_0x1c7d59},'attributes':['id','name','email',_0xfca0('0x5'),_0xfca0('0x6'),_0xfca0('0x7'),_0xfca0('0x16'),_0xfca0('0x8'),'lastPauseAt',_0xfca0('0x17'),_0xfca0('0xb')]},'log':_0xfca0('0x13')});}; \ No newline at end of file +var _0x7b96=['getAgents','Request','name','email','accountcode','fullname','lastLoginAt','pauseType','lastPauseAt','mobile','interface','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','ShowUser','agent','online','voicePause','getAgent'];(function(_0xddb4ee,_0x5c6d41){var _0x4eee58=function(_0xd9e87f){while(--_0xd9e87f){_0xddb4ee['push'](_0xddb4ee['shift']());}};_0x4eee58(++_0x5c6d41);}(_0x7b96,0x84));var _0x67b9=function(_0x300874,_0x549110){_0x300874=_0x300874-0x0;var _0x1157c0=_0x7b96[_0x300874];return _0x1157c0;};'use strict';var client=require('../client');exports[_0x67b9('0x0')]=function(){return function(){return client[_0x67b9('0x1')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x67b9('0x2'),_0x67b9('0x3'),_0x67b9('0x4'),_0x67b9('0x5'),'online',_0x67b9('0x6'),_0x67b9('0x7'),_0x67b9('0x8'),'voicePause','phone',_0x67b9('0x9'),_0x67b9('0xa')]},'log':_0x67b9('0x0')});};};exports[_0x67b9('0xb')]=function(){return function(){return client[_0x67b9('0x1')]('GetUser',{'options':{'raw':!![],'where':{'role':_0x67b9('0xc')},'attributes':['id',_0x67b9('0x2'),'accountcode',_0x67b9('0xd')]},'log':_0x67b9('0xb')});};};exports[_0x67b9('0xe')]=function(_0x515842,_0xdb8bff,_0x10c25f){return client['Request'](_0x67b9('0xf'),{'body':{'type':_0xdb8bff,'uniqueid':_0x10c25f},'options':{'where':{'id':_0x515842['id']}},'log':_0x67b9('0xe')});};exports[_0x67b9('0x10')]=function(_0x3735fd){return client[_0x67b9('0x1')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x3735fd['id']}},'log':'savePause'});};exports['getAgent']=function(_0x442237){return client['Request'](_0x67b9('0x11'),{'options':{'raw':![],'where':{'role':_0x67b9('0x12'),'id':_0x442237},'attributes':['id',_0x67b9('0x2'),_0x67b9('0x3'),_0x67b9('0x4'),'fullname',_0x67b9('0x13'),_0x67b9('0x6'),_0x67b9('0x7'),'lastPauseAt',_0x67b9('0x14'),_0x67b9('0xa')]},'log':_0x67b9('0x15')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 8092e8c..94c056c 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 _0x2dee=['UpdateVoiceAgentReport','../client','Request','CreateVoiceAgentReport','update'];(function(_0x3a0d38,_0x56fbc0){var _0x57cb61=function(_0x3af837){while(--_0x3af837){_0x3a0d38['push'](_0x3a0d38['shift']());}};_0x57cb61(++_0x56fbc0);}(_0x2dee,0xa6));var _0xe2de=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x2dee[_0x3bf83f];return _0x22c4a9;};'use strict';var client=require(_0xe2de('0x0'));exports['create']=function(_0x108452){return client[_0xe2de('0x1')](_0xe2de('0x2'),{'body':_0x108452,'log':_0xe2de('0x2')});};exports[_0xe2de('0x3')]=function(_0x1b6082,_0x177ccd,_0x4b7ec1){return client[_0xe2de('0x1')](_0xe2de('0x4'),{'body':_0x1b6082,'options':{'where':{'uniqueid':_0x177ccd,'interface':_0x4b7ec1}},'log':_0xe2de('0x4')});}; \ No newline at end of file +var _0x5ac4=['create','Request','CreateVoiceAgentReport','UpdateVoiceAgentReport','../client'];(function(_0x1d37b2,_0x4af81f){var _0x3b0c4c=function(_0xe83793){while(--_0xe83793){_0x1d37b2['push'](_0x1d37b2['shift']());}};_0x3b0c4c(++_0x4af81f);}(_0x5ac4,0xae));var _0x45ac=function(_0x1bf28b,_0x223ed9){_0x1bf28b=_0x1bf28b-0x0;var _0xde7676=_0x5ac4[_0x1bf28b];return _0xde7676;};'use strict';var client=require(_0x45ac('0x0'));exports[_0x45ac('0x1')]=function(_0x56f035){return client[_0x45ac('0x2')](_0x45ac('0x3'),{'body':_0x56f035,'log':_0x45ac('0x3')});};exports['update']=function(_0x5a79fb,_0x4599ae,_0x53010c){return client['Request'](_0x45ac('0x4'),{'body':_0x5a79fb,'options':{'where':{'uniqueid':_0x4599ae,'interface':_0x53010c}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 50668e7..ab5855b 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 _0xa8dc=['day','format','endOf','type','disposition','GetVoiceCallReports','moment','util','../client','Request','merge','calleridnum','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport'];(function(_0x7c8779,_0x2b7036){var _0x5922c0=function(_0x3d9710){while(--_0x3d9710){_0x7c8779['push'](_0x7c8779['shift']());}};_0x5922c0(++_0x2b7036);}(_0xa8dc,0xf6));var _0xca8d=function(_0x529325,_0x4a3d90){_0x529325=_0x529325-0x0;var _0x3b3915=_0xa8dc[_0x529325];return _0x3b3915;};'use strict';var moment=require(_0xca8d('0x0'));var util=require(_0xca8d('0x1'));var _=require('lodash');var client=require(_0xca8d('0x2'));exports['create']=function(_0x1627fd){return client[_0xca8d('0x3')]('CreateVoiceCallReport',{'body':_[_0xca8d('0x4')](_0x1627fd,{'source':_0x1627fd[_0xca8d('0x5')],'destinationcontext':_0x1627fd['context'],'callerid':_0x1627fd[_0xca8d('0x6')],'amaflags':_0xca8d('0x7')}),'log':'CreateVoiceCallReport'});};exports[_0xca8d('0x8')]=function(){return function(){return client[_0xca8d('0x3')](_0xca8d('0x9'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()['startOf'](_0xca8d('0xa'))[_0xca8d('0xb')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xca8d('0xc')]('day')[_0xca8d('0xb')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0xca8d('0xd'),_0xca8d('0xe'),'duration','billableseconds']},'log':_0xca8d('0xf')});};}; \ No newline at end of file +var _0x6108=['format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration','billableseconds','GetVoiceCallReports','moment','util','lodash','create','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','Request','GetVoiceCallReport','outbound','startOf','day'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x6108,0x14a));var _0x8610=function(_0x93658c,_0x485f3e){_0x93658c=_0x93658c-0x0;var _0x2f178d=_0x6108[_0x93658c];return _0x2f178d;};'use strict';var moment=require(_0x8610('0x0'));var util=require(_0x8610('0x1'));var _=require(_0x8610('0x2'));var client=require('../client');exports[_0x8610('0x3')]=function(_0x313afb){return client['Request'](_0x8610('0x4'),{'body':_[_0x8610('0x5')](_0x313afb,{'source':_0x313afb[_0x8610('0x6')],'destinationcontext':_0x313afb[_0x8610('0x7')],'callerid':_0x313afb[_0x8610('0x8')],'amaflags':_0x8610('0x9')}),'log':_0x8610('0x4')});};exports['getVoiceCallReports']=function(){return function(){return client[_0x8610('0xa')](_0x8610('0xb'),{'options':{'where':{'type':[_0x8610('0xc')],'createdAt':{'$between':[moment()[_0x8610('0xd')](_0x8610('0xe'))[_0x8610('0xf')](_0x8610('0x10')),moment()[_0x8610('0x11')](_0x8610('0xe'))[_0x8610('0xf')](_0x8610('0x10'))]}},'attributes':[_0x8610('0x12'),_0x8610('0x13'),_0x8610('0x14'),_0x8610('0x15')]},'log':_0x8610('0x16')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 2daa010..c5eec6b 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 _0xa8df=['create','Request','CreateVoiceDialReport'];(function(_0x4be188,_0x284391){var _0x4848f3=function(_0x4bba24){while(--_0x4bba24){_0x4be188['push'](_0x4be188['shift']());}};_0x4848f3(++_0x284391);}(_0xa8df,0x14a));var _0xfa8d=function(_0x566c8f,_0x47fa48){_0x566c8f=_0x566c8f-0x0;var _0x328878=_0xa8df[_0x566c8f];return _0x328878;};'use strict';var client=require('../client');exports[_0xfa8d('0x0')]=function(_0xbf74c7){return client[_0xfa8d('0x1')](_0xfa8d('0x2'),{'body':_0xbf74c7,'log':_0xfa8d('0x2')});}; \ No newline at end of file +var _0xfa68=['CreateVoiceDialReport','../client'];(function(_0x12ca5f,_0x223d98){var _0xfc3ae9=function(_0x1928fb){while(--_0x1928fb){_0x12ca5f['push'](_0x12ca5f['shift']());}};_0xfc3ae9(++_0x223d98);}(_0xfa68,0xf5));var _0x8fa6=function(_0x44721a,_0x5b49ff){_0x44721a=_0x44721a-0x0;var _0x4c2868=_0xfa68[_0x44721a];return _0x4c2868;};'use strict';var client=require(_0x8fa6('0x0'));exports['create']=function(_0x21cf5a){return client['Request'](_0x8fa6('0x1'),{'body':_0x21cf5a,'log':'CreateVoiceDialReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 8636edc..d4bdf65 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 _0x1e58=['getVoiceExtensions','Request','exten','recordingFormat','../client'];(function(_0x35327a,_0x1fb34f){var _0x1839d0=function(_0x1fecfb){while(--_0x1fecfb){_0x35327a['push'](_0x35327a['shift']());}};_0x1839d0(++_0x1fb34f);}(_0x1e58,0x81));var _0x81e5=function(_0x33c2bf,_0x2e1c66){_0x33c2bf=_0x33c2bf-0x0;var _0x5591eb=_0x1e58[_0x33c2bf];return _0x5591eb;};'use strict';var client=require(_0x81e5('0x0'));exports[_0x81e5('0x1')]=function(){return function(){return client[_0x81e5('0x2')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x81e5('0x3'),_0x81e5('0x4')],'where':{'VoiceExtensionId':null}},'log':_0x81e5('0x1')});};}; \ No newline at end of file +var _0xd828=['exten','getVoiceExtensions','Request','GetVoiceExtension'];(function(_0x34a8c8,_0x31e259){var _0x1fe6e5=function(_0x30f28d){while(--_0x30f28d){_0x34a8c8['push'](_0x34a8c8['shift']());}};_0x1fe6e5(++_0x31e259);}(_0xd828,0x1a6));var _0x8d82=function(_0x28ad43,_0x3046cf){_0x28ad43=_0x28ad43-0x0;var _0x3b3197=_0xd828[_0x28ad43];return _0x3b3197;};'use strict';var client=require('../client');exports['getVoiceExtensions']=function(){return function(){return client[_0x8d82('0x0')](_0x8d82('0x1'),{'options':{'raw':!![],'attributes':['id',_0x8d82('0x2'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x8d82('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index e60fb1c..631175f 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 _0x041e=['Pause','mandatoryDispositionPause','TrunkBackup','callerid','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialMethod','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','dialCutDigit','mandatoryDisposition','dialPredictiveIntervalMinThreshold','Trunk','active'];(function(_0x55fdf1,_0x133350){var _0x18857d=function(_0x58bbec){while(--_0x58bbec){_0x55fdf1['push'](_0x55fdf1['shift']());}};_0x18857d(++_0x133350);}(_0x041e,0x73));var _0xe041=function(_0x4534a5,_0x5067a2){_0x4534a5=_0x4534a5-0x0;var _0x552740=_0x041e[_0x4534a5];return _0x552740;};'use strict';var client=require(_0xe041('0x0'));exports[_0xe041('0x1')]=function(){return function(){return client[_0xe041('0x2')](_0xe041('0x3'),{'options':{'raw':![],'attributes':['id',_0xe041('0x4'),_0xe041('0x5'),_0xe041('0x6'),_0xe041('0x7'),_0xe041('0x8'),_0xe041('0x9'),'dialActive',_0xe041('0xa'),_0xe041('0xb'),_0xe041('0xc'),'dialPowerLevel',_0xe041('0xd'),_0xe041('0xe'),_0xe041('0xf'),'dialOriginateCallerIdName',_0xe041('0x10'),_0xe041('0x11'),_0xe041('0x12'),_0xe041('0x13'),_0xe041('0x14'),_0xe041('0x15'),'dialCongestionRetryFrequency',_0xe041('0x16'),_0xe041('0x17'),'dialNoAnswerMaxRetry',_0xe041('0x18'),'dialGlobalMaxRetry',_0xe041('0x19'),_0xe041('0x1a'),_0xe041('0x1b'),_0xe041('0x1c'),_0xe041('0x1d'),_0xe041('0x1e'),_0xe041('0x1f'),_0xe041('0x20'),'dialAMDTotalAnalysisTime','dialAMDMinWordLength',_0xe041('0x21'),_0xe041('0x22'),'dialAMDSilenceThreshold','dialAMDMaximumWordLength',_0xe041('0x23'),_0xe041('0x24'),_0xe041('0x25'),_0xe041('0x26'),_0xe041('0x27'),_0xe041('0x28'),_0xe041('0x29'),_0xe041('0x8'),'strategy','dialRandomLastDigitCallerIdNumber',_0xe041('0x2a'),_0xe041('0x2b'),'dialPredictiveIntervalMaxThreshold',_0xe041('0x2c')],'include':[{'model':_0xe041('0x2d'),'as':'Trunk','attributes':['id','name','callerid',_0xe041('0x2e')]},{'model':_0xe041('0x2f'),'as':_0xe041('0x30'),'attributes':['id','name']},{'model':_0xe041('0x2d'),'as':_0xe041('0x31'),'attributes':['id','name',_0xe041('0x32'),_0xe041('0x2e')]},{'model':_0xe041('0x33'),'as':_0xe041('0x33'),'attributes':['id',_0xe041('0x4')],'include':[{'model':_0xe041('0x33'),'as':_0xe041('0x34'),'attributes':['id',_0xe041('0x4'),_0xe041('0x35')]}]}]},'log':_0xe041('0x1')});};}; \ No newline at end of file +var _0x96bd=['dialPredictiveIntervalMaxThreshold','Trunk','callerid','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','../client','Request','GetVoiceQueue','name','acw','acwTimeout','monitor_format','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','dialRandomLastDigitCallerIdNumber','dialCutDigit','mandatoryDisposition'];(function(_0x5d50e9,_0x27447f){var _0x11ddc6=function(_0x3e31b5){while(--_0x3e31b5){_0x5d50e9['push'](_0x5d50e9['shift']());}};_0x11ddc6(++_0x27447f);}(_0x96bd,0x112));var _0xd96b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x96bd[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0xd96b('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0xd96b('0x1')](_0xd96b('0x2'),{'options':{'raw':![],'attributes':['id',_0xd96b('0x3'),_0xd96b('0x4'),_0xd96b('0x5'),'autopause',_0xd96b('0x6'),'type',_0xd96b('0x7'),_0xd96b('0x8'),_0xd96b('0x9'),_0xd96b('0xa'),_0xd96b('0xb'),_0xd96b('0xc'),_0xd96b('0xd'),_0xd96b('0xe'),_0xd96b('0xf'),_0xd96b('0x10'),_0xd96b('0x11'),'dialQueueOptions','dialQueueTimeout',_0xd96b('0x12'),_0xd96b('0x13'),'dialCongestionRetryFrequency','dialBusyMaxRetry',_0xd96b('0x14'),_0xd96b('0x15'),_0xd96b('0x16'),_0xd96b('0x17'),_0xd96b('0x18'),'dialGlobalInterval',_0xd96b('0x19'),'dialCheckDuplicateType',_0xd96b('0x1a'),_0xd96b('0x1b'),_0xd96b('0x1c'),_0xd96b('0x1d'),_0xd96b('0x1e'),_0xd96b('0x1f'),_0xd96b('0x20'),_0xd96b('0x21'),'dialAMDSilenceThreshold',_0xd96b('0x22'),'timeout',_0xd96b('0x23'),_0xd96b('0x24'),_0xd96b('0x25'),_0xd96b('0x26'),_0xd96b('0x27'),_0xd96b('0x28'),_0xd96b('0x6'),'strategy',_0xd96b('0x29'),_0xd96b('0x2a'),_0xd96b('0x2b'),_0xd96b('0x2c'),'dialPredictiveIntervalMinThreshold'],'include':[{'model':_0xd96b('0x2d'),'as':_0xd96b('0x2d'),'attributes':['id',_0xd96b('0x3'),_0xd96b('0x2e'),'active']},{'model':_0xd96b('0x2f'),'as':_0xd96b('0x30'),'attributes':['id','name']},{'model':'Trunk','as':_0xd96b('0x31'),'attributes':['id',_0xd96b('0x3'),_0xd96b('0x2e'),'active']},{'model':_0xd96b('0x32'),'as':_0xd96b('0x32'),'attributes':['id',_0xd96b('0x3')],'include':[{'model':_0xd96b('0x32'),'as':_0xd96b('0x33'),'attributes':['id',_0xd96b('0x3'),_0xd96b('0x34')]}]}]},'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 72ce012..be47773 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 _0x069e=['queue','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallerexitAt','queuecallerabandon','queuecallerabandonAt','GetVoiceQueueReports','moment','../client','create','Request','CreateVoiceQueueReport','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','uniqueid'];(function(_0x18a741,_0x527310){var _0xf7bf4f=function(_0x24290d){while(--_0x24290d){_0x18a741['push'](_0x18a741['shift']());}};_0xf7bf4f(++_0x527310);}(_0x069e,0x98));var _0xe069=function(_0x48be61,_0x204c04){_0x48be61=_0x48be61-0x0;var _0x55fcd9=_0x069e[_0x48be61];return _0x55fcd9;};'use strict';var moment=require(_0xe069('0x0'));var _=require('lodash');var client=require(_0xe069('0x1'));exports[_0xe069('0x2')]=function(_0x30be1e){return client[_0xe069('0x3')](_0xe069('0x4'),{'body':_0x30be1e,'log':_0xe069('0x4')});};exports['getVoiceQueueReports']=function(){return function(){return client['Request']('GetVoiceQueueReport',{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0xe069('0x5'))[_0xe069('0x6')](_0xe069('0x7')),moment()[_0xe069('0x8')](_0xe069('0x5'))['format'](_0xe069('0x7'))]}},'attributes':[_0xe069('0x9'),_0xe069('0xa'),_0xe069('0xb'),_0xe069('0xc'),_0xe069('0xd'),'queuecallercompleteAt','queuecallerexit',_0xe069('0xe'),_0xe069('0xf'),_0xe069('0x10')]},'log':_0xe069('0x11')});};}; \ No newline at end of file +var _0xbf66=['YYYY-MM-DD\x20HH:mm:ss','queue','queuecallerleaveAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','queuecallerabandonAt','GetVoiceQueueReports','create','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','day','format'];(function(_0x346426,_0x277eb4){var _0x58b6ca=function(_0x19b2bd){while(--_0x19b2bd){_0x346426['push'](_0x346426['shift']());}};_0x58b6ca(++_0x277eb4);}(_0xbf66,0x198));var _0x6bf6=function(_0x393c76,_0x21cbb8){_0x393c76=_0x393c76-0x0;var _0x4c979c=_0xbf66[_0x393c76];return _0x4c979c;};'use strict';var moment=require('moment');var _=require('lodash');var client=require('../client');exports[_0x6bf6('0x0')]=function(_0x5144c9){return client[_0x6bf6('0x1')](_0x6bf6('0x2'),{'body':_0x5144c9,'log':_0x6bf6('0x2')});};exports[_0x6bf6('0x3')]=function(){return function(){return client[_0x6bf6('0x1')](_0x6bf6('0x4'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x6bf6('0x5')](_0x6bf6('0x6'))[_0x6bf6('0x7')](_0x6bf6('0x8')),moment()['endOf'](_0x6bf6('0x6'))[_0x6bf6('0x7')](_0x6bf6('0x8'))]}},'attributes':['uniqueid',_0x6bf6('0x9'),'queuecallerjoinAt',_0x6bf6('0xa'),'queuecallercomplete',_0x6bf6('0xb'),_0x6bf6('0xc'),_0x6bf6('0xd'),'queuecallerabandon',_0x6bf6('0xe')]},'log':_0x6bf6('0xf')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index bb95dc5..e10263e 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 _0xaba4=['Request','GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses'];(function(_0x22b8d4,_0x3eb15f){var _0x15163d=function(_0x262b67){while(--_0x262b67){_0x22b8d4['push'](_0x22b8d4['shift']());}};_0x15163d(++_0x3eb15f);}(_0xaba4,0x162));var _0x4aba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaba4[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x4aba('0x0'));exports[_0x4aba('0x1')]=function(_0x4091f2){return function(){return client[_0x4aba('0x2')](_0x4aba('0x3'),{'options':{'where':{'VoiceQueueId':_0x4091f2,'paused':!![]},'raw':!![]},'log':_0x4aba('0x1')});};}; \ No newline at end of file +var _0xa095=['getVoiceQueueRtPauses','GetVoiceQueueRtPauses'];(function(_0x2f623c,_0x18b1c6){var _0xcdec0d=function(_0x4ba21f){while(--_0x4ba21f){_0x2f623c['push'](_0x2f623c['shift']());}};_0xcdec0d(++_0x18b1c6);}(_0xa095,0x1c4));var _0x5a09=function(_0x7148a3,_0x1c6652){_0x7148a3=_0x7148a3-0x0;var _0x52f31d=_0xa095[_0x7148a3];return _0x52f31d;};'use strict';var client=require('../client');exports[_0x5a09('0x0')]=function(_0x1dde9f){return function(){return client['Request'](_0x5a09('0x1'),{'options':{'where':{'VoiceQueueId':_0x1dde9f,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 451232a..e48cc52 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 _0x059e=['lodash','../client','create','Request','CreateVoiceRecording','merge'];(function(_0x25c884,_0x369ea8){var _0x405708=function(_0x37af36){while(--_0x37af36){_0x25c884['push'](_0x25c884['shift']());}};_0x405708(++_0x369ea8);}(_0x059e,0x8a));var _0xe059=function(_0x19e7f4,_0x1ff3be){_0x19e7f4=_0x19e7f4-0x0;var _0x44214c=_0x059e[_0x19e7f4];return _0x44214c;};'use strict';var _=require(_0xe059('0x0'));var client=require(_0xe059('0x1'));exports[_0xe059('0x2')]=function(_0x111f50){return client[_0xe059('0x3')](_0xe059('0x4'),{'body':_[_0xe059('0x5')](_0x111f50,{'value':_0x111f50['monitorFilename']}),'log':_0xe059('0x4')});}; \ No newline at end of file +var _0x07ff=['merge','monitorFilename','../client','create'];(function(_0x5f53d3,_0x1b4c49){var _0x21a40f=function(_0x229882){while(--_0x229882){_0x5f53d3['push'](_0x5f53d3['shift']());}};_0x21a40f(++_0x1b4c49);}(_0x07ff,0x142));var _0xf07f=function(_0x2073ce,_0x447987){_0x2073ce=_0x2073ce-0x0;var _0x1b675f=_0x07ff[_0x2073ce];return _0x1b675f;};'use strict';var _=require('lodash');var client=require(_0xf07f('0x0'));exports[_0xf07f('0x1')]=function(_0x20e02a){return client['Request']('CreateVoiceRecording',{'body':_[_0xf07f('0x2')](_0x20e02a,{'value':_0x20e02a[_0xf07f('0x3')]}),'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 9017808..d733502 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 _0x4343=['CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','isexternal','extension','blind','attendedTransfer','Request','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','blindTransfer'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0x4343,0x11d));var _0x3434=function(_0x12c7e1,_0x5eef5c){_0x12c7e1=_0x12c7e1-0x0;var _0x4bcff7=_0x4343[_0x12c7e1];return _0x4bcff7;};'use strict';var client=require(_0x3434('0x0'));exports[_0x3434('0x1')]=function(_0x7524f2){return client['Request'](_0x3434('0x2'),{'body':{'result':_0x7524f2[_0x3434('0x3')],'transfererchannel':_0x7524f2[_0x3434('0x4')],'transferercalleridnum':_0x7524f2[_0x3434('0x5')],'transferercalleridname':_0x7524f2[_0x3434('0x6')],'transfererconnectedlinenum':_0x7524f2['transfererconnectedlinenum'],'transfererconnectedlinename':_0x7524f2['transfererconnectedlinename'],'transfereraccountcode':_0x7524f2[_0x3434('0x7')],'transferercontext':_0x7524f2[_0x3434('0x8')],'transfererexten':_0x7524f2[_0x3434('0x9')],'transfererlinkedid':_0x7524f2[_0x3434('0xa')],'transfereechannel':_0x7524f2[_0x3434('0xb')],'transfereecalleridnum':_0x7524f2[_0x3434('0xc')],'transfereecalleridname':_0x7524f2[_0x3434('0xd')],'transfereeconnectedlinenum':_0x7524f2[_0x3434('0xe')],'transfereeconnectedlinename':_0x7524f2[_0x3434('0xf')],'transfereeaccountcode':_0x7524f2[_0x3434('0x10')],'transfereecontext':_0x7524f2[_0x3434('0x11')],'transfereeexten':_0x7524f2[_0x3434('0x12')],'transfereelinkedid':_0x7524f2['transfereelinkedid'],'isexternal':_0x7524f2[_0x3434('0x13')],'context':_0x7524f2['context'],'extension':_0x7524f2[_0x3434('0x14')],'type':_0x3434('0x15')},'log':_0x3434('0x2')});};exports[_0x3434('0x16')]=function(_0x1df5fe){return client[_0x3434('0x17')](_0x3434('0x2'),{'body':{'result':_0x1df5fe[_0x3434('0x3')],'transfererchannel':_0x1df5fe['origtransfererchannel'],'transferercalleridnum':_0x1df5fe[_0x3434('0x18')],'transferercalleridname':_0x1df5fe[_0x3434('0x19')],'transfererconnectedlinenum':_0x1df5fe[_0x3434('0x1a')],'transfererconnectedlinename':_0x1df5fe[_0x3434('0x1b')],'transfereraccountcode':_0x1df5fe['origtransfereraccountcode'],'transferercontext':_0x1df5fe[_0x3434('0x1c')],'transfererexten':_0x1df5fe[_0x3434('0x1d')],'transfererlinkedid':_0x1df5fe[_0x3434('0x1e')],'transfereechannel':_0x1df5fe[_0x3434('0x1f')],'transfereecalleridnum':_0x1df5fe[_0x3434('0x20')],'transfereecalleridname':_0x1df5fe['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x1df5fe['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x1df5fe[_0x3434('0x21')],'transfereeaccountcode':_0x1df5fe[_0x3434('0x22')],'transfereecontext':_0x1df5fe[_0x3434('0x23')],'transfereeexten':_0x1df5fe[_0x3434('0x24')],'transfereelinkedid':_0x1df5fe[_0x3434('0x25')],'isexternal':_0x1df5fe[_0x3434('0x13')],'context':_0x1df5fe[_0x3434('0x26')],'extension':_0x1df5fe[_0x3434('0x27')],'type':_0x3434('0x28')},'log':_0x3434('0x2')});}; \ No newline at end of file +var _0xc545=['transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','blindTransfer','Request','CreateVoiceTransferReport','transfererchannel','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','isexternal','context','extension','blind','attendedTransfer','result','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename'];(function(_0x23184a,_0xd5385d){var _0x1cf99e=function(_0x3d6a30){while(--_0x3d6a30){_0x23184a['push'](_0x23184a['shift']());}};_0x1cf99e(++_0xd5385d);}(_0xc545,0x18a));var _0x5c54=function(_0x1d527d,_0x76d122){_0x1d527d=_0x1d527d-0x0;var _0x57e2d7=_0xc545[_0x1d527d];return _0x57e2d7;};'use strict';var client=require(_0x5c54('0x0'));exports[_0x5c54('0x1')]=function(_0x440b64){return client[_0x5c54('0x2')](_0x5c54('0x3'),{'body':{'result':_0x440b64['result'],'transfererchannel':_0x440b64[_0x5c54('0x4')],'transferercalleridnum':_0x440b64['transferercalleridnum'],'transferercalleridname':_0x440b64[_0x5c54('0x5')],'transfererconnectedlinenum':_0x440b64[_0x5c54('0x6')],'transfererconnectedlinename':_0x440b64[_0x5c54('0x7')],'transfereraccountcode':_0x440b64[_0x5c54('0x8')],'transferercontext':_0x440b64['transferercontext'],'transfererexten':_0x440b64[_0x5c54('0x9')],'transfererlinkedid':_0x440b64[_0x5c54('0xa')],'transfereechannel':_0x440b64[_0x5c54('0xb')],'transfereecalleridnum':_0x440b64[_0x5c54('0xc')],'transfereecalleridname':_0x440b64[_0x5c54('0xd')],'transfereeconnectedlinenum':_0x440b64[_0x5c54('0xe')],'transfereeconnectedlinename':_0x440b64[_0x5c54('0xf')],'transfereeaccountcode':_0x440b64[_0x5c54('0x10')],'transfereecontext':_0x440b64[_0x5c54('0x11')],'transfereeexten':_0x440b64[_0x5c54('0x12')],'transfereelinkedid':_0x440b64['transfereelinkedid'],'isexternal':_0x440b64[_0x5c54('0x13')],'context':_0x440b64[_0x5c54('0x14')],'extension':_0x440b64[_0x5c54('0x15')],'type':_0x5c54('0x16')},'log':_0x5c54('0x3')});};exports[_0x5c54('0x17')]=function(_0x16c29c){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0x16c29c[_0x5c54('0x18')],'transfererchannel':_0x16c29c[_0x5c54('0x19')],'transferercalleridnum':_0x16c29c[_0x5c54('0x1a')],'transferercalleridname':_0x16c29c[_0x5c54('0x1b')],'transfererconnectedlinenum':_0x16c29c[_0x5c54('0x1c')],'transfererconnectedlinename':_0x16c29c[_0x5c54('0x1d')],'transfereraccountcode':_0x16c29c[_0x5c54('0x1e')],'transferercontext':_0x16c29c[_0x5c54('0x1f')],'transfererexten':_0x16c29c['secondtransfererexten'],'transfererlinkedid':_0x16c29c[_0x5c54('0x20')],'transfereechannel':_0x16c29c[_0x5c54('0x21')],'transfereecalleridnum':_0x16c29c['transfertargetcalleridnum'],'transfereecalleridname':_0x16c29c['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x16c29c[_0x5c54('0x22')],'transfereeconnectedlinename':_0x16c29c[_0x5c54('0x23')],'transfereeaccountcode':_0x16c29c[_0x5c54('0x24')],'transfereecontext':_0x16c29c[_0x5c54('0x25')],'transfereeexten':_0x16c29c[_0x5c54('0x26')],'transfereelinkedid':_0x16c29c[_0x5c54('0x27')],'isexternal':_0x16c29c['isexternal'],'context':_0x16c29c[_0x5c54('0x28')],'extension':_0x16c29c[_0x5c54('0x29')],'type':_0x5c54('0x2a')},'log':_0x5c54('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 6846a46..4f07368 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 _0x1167=['Action','message','error','ami\x20disconnected','command','action','Command','then','content','catch','voiceQueues','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','total','type','waiting','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','length','values','channels','map','find','uniqueid','format','%s.%s','filename','wav','MixMonitor','channel','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','isNil','monitors','push','YYYY-MM-DD\x20HH:mm:ss','rec','mixmonitorid','status','validate','StopMixMonitor','destinationchannel','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','queueChannels','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','outboundChannels','campaigns','event','Event\x20name\x20mandatory','emit','custom:','send','checkAfterSend','server','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','../properties','listen','%s/%s','name','timers','timer','agents','updateStatusRealtime','pause','QueuePause','isConnected','asterisk','username','join','pick','keys','module','Reload'];(function(_0x4fbd15,_0x3b2a17){var _0x736e2c=function(_0x313c25){while(--_0x313c25){_0x4fbd15['push'](_0x4fbd15['shift']());}};_0x736e2c(++_0x3b2a17);}(_0x1167,0xf2));var _0x7116=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x1167[_0x3e5086];return _0xfeb102;};'use strict';var _=require('lodash');var util=require('util');var jayson=require(_0x7116('0x0'));var schema=require('validate');var BPromise=require(_0x7116('0x1'));var moment=require('moment');var config=require('../../../config/environment');var properties=require(_0x7116('0x2'));var ami=require('../ami');exports[_0x7116('0x3')]=function(_0x525beb,_0x21e3e1,_0x1af8c5){return new BPromise(function(_0x5d212a,_0x2bc7bf){var _0x2ec08b={'QueuePause':function(_0x5a178f){return new Promise(function(_0x448474,_0x2cb79a){var _0x534da4=util['format'](_0x7116('0x4'),'SIP',_0x5a178f[_0x7116('0x5')]);if(_0x525beb[_0x7116('0x6')]&&_0x525beb['timers'][_0x534da4]&&_0x525beb['timers'][_0x534da4][_0x7116('0x7')]){_0x525beb[_0x7116('0x6')][_0x534da4]['updateAcw']();}if(_0x525beb[_0x7116('0x8')][_0x534da4]){_0x525beb[_0x7116('0x8')][_0x534da4][_0x7116('0x9')]({'statePause':_0x5a178f[_0x7116('0xa')]?!![]:![]});}_0x448474({'code':0xc8,'message':_0x7116('0xb')});});},'Reload':function(_0x4660c4){var _0x267366=this;return new Promise(function(_0x6d7ed,_0xbfc00a){if(ami[_0x7116('0xc')]()==![]){return _0xbfc00a(_0x267366['error'](0x1f4,[config['asterisk']['ip'],config[_0x7116('0xd')][_0x7116('0xe')],'ami\x20disconnected'][_0x7116('0xf')]('\x20')));}_0x4660c4=_[_0x7116('0x10')](_0x4660c4,_[_0x7116('0x11')](properties[_0x7116('0x12')]));_0x4660c4['action']=_0x7116('0x13');return ami[_0x7116('0x14')](_0x4660c4)['then'](function(_0x45c522){_0x6d7ed({'code':0xc8,'message':_0x45c522[_0x7116('0x15')]});})['catch'](function(_0x2d4d01){_0xbfc00a(_0x267366['error'](0x1f5,_0x2d4d01[_0x7116('0x15')]));});});},'Command':function(_0x586d88){var _0x54ed2b=this;return new Promise(function(_0x2fec6a,_0x540b1f){if(ami[_0x7116('0xc')]()==![]){return _0x540b1f(_0x54ed2b[_0x7116('0x16')](0x1f4,[config[_0x7116('0xd')]['ip'],config[_0x7116('0xd')][_0x7116('0xe')],_0x7116('0x17')][_0x7116('0xf')]('\x20')));}_0x586d88=_['pick'](_0x586d88,_0x7116('0x18'));_0x586d88[_0x7116('0x19')]=_0x7116('0x1a');return ami[_0x7116('0x14')](_0x586d88)[_0x7116('0x1b')](function(_0xd5a47f){_0x2fec6a({'code':0xc8,'message':_0xd5a47f[_0x7116('0x1c')]});})[_0x7116('0x1d')](function(_0x5bd431){_0x540b1f(_0x54ed2b['error'](0x1f5,_0x5bd431[_0x7116('0x15')]));});});},'VoiceQueues':function(_0x4d51e3){return new Promise(function(_0x404a69,_0x390fce){var _0x260834=[];for(var _0x5c855b in _0x525beb[_0x7116('0x1e')]){if(_0x525beb[_0x7116('0x1e')]['hasOwnProperty'](_0x5c855b)){var _0x117123=_0x525beb['voiceQueues'][_0x5c855b];var _0x84e73d={'id':_0x117123['id'],'name':_0x117123[_0x7116('0x5')],'strategy':_0x117123[_0x7116('0x1f')],'answered':_0x117123[_0x7116('0x20')],'available':_0x117123[_0x7116('0x21')],'loggedIn':_0x117123[_0x7116('0x22')],'pTalking':_0x117123[_0x7116('0x23')],'sumBillable':_0x117123[_0x7116('0x24')],'sumDuration':_0x117123[_0x7116('0x25')],'sumHoldTime':_0x117123['sumHoldTime']||0x0,'talking':_0x117123['talking'],'total':_0x117123[_0x7116('0x26')],'type':_0x117123[_0x7116('0x27')],'unmanaged':_0x117123['unmanaged'],'abandoned':_0x117123['abandoned'],'waiting':_0x117123[_0x7116('0x28')],'loggedInDb':_0x117123['loggedInDb']};if(_0x117123[_0x7116('0x27')]===_0x7116('0x29')){_0x84e73d['dialActive']=_0x117123[_0x7116('0x2a')];_0x84e73d[_0x7116('0x2b')]=_0x117123[_0x7116('0x2b')];_0x84e73d[_0x7116('0x2c')]=_0x117123[_0x7116('0x2c')];_0x84e73d[_0x7116('0x2d')]=_0x117123[_0x7116('0x2d')];_0x84e73d[_0x7116('0x2e')]=_0x117123[_0x7116('0x2e')];_0x84e73d['dialPrefix']=_0x117123[_0x7116('0x2f')];_0x84e73d[_0x7116('0x30')]=_0x117123[_0x7116('0x30')];_0x84e73d[_0x7116('0x31')]=_0x117123[_0x7116('0x31')];_0x84e73d[_0x7116('0x32')]=_0x117123[_0x7116('0x32')];_0x84e73d[_0x7116('0x33')]=_0x117123[_0x7116('0x33')];_0x84e73d['outboundCongestionCallsDay']=_0x117123[_0x7116('0x34')];_0x84e73d[_0x7116('0x35')]=_0x117123['outboundDropCallsDayACS'];_0x84e73d['outboundDropCallsDayCallersExit']=_0x117123[_0x7116('0x36')];_0x84e73d['outboundDropCallsDayTimeout']=_0x117123['outboundDropCallsDayTimeout'];_0x84e73d[_0x7116('0x37')]=_0x117123['outboundNoAnswerCallsDay'];_0x84e73d[_0x7116('0x38')]=_0x117123[_0x7116('0x38')];_0x84e73d[_0x7116('0x39')]=_0x117123[_0x7116('0x39')];_0x84e73d[_0x7116('0x3a')]=_0x117123['outboundReCallsDay'];_0x84e73d[_0x7116('0x3b')]=_0x117123[_0x7116('0x3b')];_0x84e73d[_0x7116('0x3c')]=_0x117123[_0x7116('0x3c')];_0x84e73d[_0x7116('0x3d')]=_0x117123['predictiveIntervalAnsweredCalls'];_0x84e73d[_0x7116('0x3e')]=_0x117123['predictiveIntervalAvgHoldtime'];_0x84e73d[_0x7116('0x3f')]=_0x117123[_0x7116('0x3f')];_0x84e73d['predictiveIntervalDroppedCallsCallersExit']=_0x117123[_0x7116('0x40')];_0x84e73d[_0x7116('0x41')]=_0x117123[_0x7116('0x41')];_0x84e73d[_0x7116('0x42')]=_0x117123[_0x7116('0x42')];_0x84e73d['predictiveIntervalErlangCallsDroppedCalls']=_0x117123[_0x7116('0x43')];_0x84e73d[_0x7116('0x44')]=_0x117123[_0x7116('0x44')];_0x84e73d[_0x7116('0x45')]=_0x117123[_0x7116('0x45')];_0x84e73d[_0x7116('0x46')]=_0x117123[_0x7116('0x46')];_0x84e73d[_0x7116('0x47')]=_0x117123[_0x7116('0x47')];_0x84e73d[_0x7116('0x48')]=_0x117123[_0x7116('0x48')];_0x84e73d[_0x7116('0x15')]=_0x117123[_0x7116('0x15')];_0x84e73d[_0x7116('0x49')]=_0x117123[_0x7116('0x49')];_0x84e73d[_0x7116('0x4a')]=_0x117123[_0x7116('0x4a')];_0x84e73d[_0x7116('0x4b')]=_0x117123[_0x7116('0x4b')];_0x84e73d['erlangAbandonmentRate']=_0x117123[_0x7116('0x4c')];_0x84e73d[_0x7116('0x4d')]=_0x117123[_0x7116('0x4d')];_0x84e73d[_0x7116('0x4e')]=_0x117123['startPredictive'];_0x84e73d[_0x7116('0x4f')]=_0x117123[_0x7116('0x4f')];}if(_0x117123['Trunk']){_0x84e73d[_0x7116('0x50')]={'id':_0x117123[_0x7116('0x50')]['id'],'name':_0x117123[_0x7116('0x50')]['name'],'active':_0x117123['Trunk'][_0x7116('0x51')],'callerid':_0x117123[_0x7116('0x50')]['callerid']};}if(_0x117123[_0x7116('0x52')]){_0x84e73d['Interval']={'id':_0x117123[_0x7116('0x52')]['id'],'name':_0x117123['Interval'][_0x7116('0x5')]};}_0x260834['push'](_0x84e73d);}}_0x404a69({'count':_0x260834[_0x7116('0x53')],'rows':_0x260834});});},'VoiceChannels':function(_0x121833){return new Promise(function(_0x28e119,_0x4d3976){var _0x302bed=_[_0x7116('0x54')](_0x525beb[_0x7116('0x55')]);_0x28e119({'count':_0x302bed['length'],'rows':_0x302bed});});},'VoiceChannelMixMonitor':function(_0x4da08b){var _0x5a7df3=this;return new Promise(function(_0x57af48,_0x2e0b3e){if(ami[_0x7116('0xc')]()==![]){return _0x2e0b3e(_0x5a7df3[_0x7116('0x16')](0x1f4,[config[_0x7116('0xd')]['ip'],config[_0x7116('0xd')][_0x7116('0xe')],'ami\x20disconnected'][_0x7116('0xf')]('\x20')));}var _0x549dac=schema(properties['voicechannel'])['validate'](_0x4da08b);if(_0x549dac[_0x7116('0x53')]>0x0){return _0x2e0b3e(_0x5a7df3['error'](0x1f4,_[_0x7116('0x56')](_0x549dac,'message')[_0x7116('0xf')](',\x20')));}var _0x55f75b=_[_0x7116('0x57')](_0x525beb[_0x7116('0x55')],{'uniqueid':_0x4da08b[_0x7116('0x58')]});if(_0x55f75b&&_0x55f75b['channel']){var _0x558a20=util[_0x7116('0x59')](_0x7116('0x5a'),_0x4da08b[_0x7116('0x5b')]||_0x4da08b[_0x7116('0x58')],_0x4da08b[_0x7116('0x59')]||_0x7116('0x5c'));return ami['Action']({'action':_0x7116('0x5d'),'channel':_0x55f75b[_0x7116('0x5e')],'file':_0x558a20,'options':_0x7116('0x5f')})['then'](function(_0x460cc4){var _0x2cb7af=_[_0x7116('0x57')](_0x55f75b['monitors'],{'filename':_0x7116('0x60')+_0x558a20[_0x7116('0x61')]()});if(_[_0x7116('0x62')](_0x2cb7af)){_0x55f75b[_0x7116('0x63')][_0x7116('0x64')]({'filename':_0x7116('0x60')+_0x558a20['toLowerCase'](),'createdAt':moment()[_0x7116('0x59')](_0x7116('0x65')),'mixmonitorid':_0x460cc4['mixmonitorid'],'status':_0x7116('0x66')});}else{_0x2cb7af[_0x7116('0x67')]=_0x460cc4[_0x7116('0x67')];_0x2cb7af[_0x7116('0x68')]=_0x7116('0x66');}_0x57af48({'code':0xc8,'message':[_0x4da08b[_0x7116('0x58')],'MixMonitor\x20Success',_0x460cc4[_0x7116('0x67')]][_0x7116('0xf')]('\x20'),'mixmonitorid':_0x460cc4[_0x7116('0x67')]});})[_0x7116('0x1d')](function(_0x8a563){_0x2e0b3e(_0x5a7df3[_0x7116('0x16')](0x1f5,[_0x4da08b[_0x7116('0x58')],_0x8a563[_0x7116('0x15')][_0x7116('0x61')]()][_0x7116('0xf')]('\x20')));});}else{return _0x2e0b3e(_0x5a7df3[_0x7116('0x16')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x505f64){var _0x26b0ae=this;return new Promise(function(_0x39e448,_0x385004){if(ami[_0x7116('0xc')]()==![]){return _0x385004(_0x26b0ae['error'](0x1f4,[config[_0x7116('0xd')]['ip'],config[_0x7116('0xd')][_0x7116('0xe')],_0x7116('0x17')][_0x7116('0xf')]('\x20')));}var _0x4ed66e=schema(properties['voicechannel'])[_0x7116('0x69')](_0x505f64);if(_0x4ed66e[_0x7116('0x53')]>0x0){return _0x385004(_0x26b0ae[_0x7116('0x16')](0x1f4,_[_0x7116('0x56')](_0x4ed66e,_0x7116('0x15'))['join'](',\x20')));}var _0x2af83d=_[_0x7116('0x57')](_0x525beb[_0x7116('0x55')],{'uniqueid':_0x505f64[_0x7116('0x58')]});if(_0x2af83d){return BPromise['resolve']()[_0x7116('0x1b')](function(){if(_0x2af83d['channel']){return ami[_0x7116('0x14')]({'action':_0x7116('0x6a'),'channel':_0x2af83d[_0x7116('0x5e')],'mixmonitorid':_0x505f64[_0x7116('0x67')]})[_0x7116('0x1d')](function(_0x5b0e15){});}})['then'](function(){if(_0x2af83d[_0x7116('0x6b')]){return ami[_0x7116('0x14')]({'action':'StopMixMonitor','channel':_0x2af83d[_0x7116('0x6b')],'mixmonitorid':_0x505f64[_0x7116('0x67')]})[_0x7116('0x1d')](function(_0x2d8824){});}})[_0x7116('0x1b')](function(_0x65557f){var _0xca148a=_['find'](_0x2af83d['monitors'],{'mixmonitorid':_0x505f64[_0x7116('0x67')]});if(_0xca148a){_0xca148a['status']='stop';}})[_0x7116('0x1b')](function(){var _0x1acad6=util[_0x7116('0x59')](_0x7116('0x5a'),_0x505f64[_0x7116('0x5b')]||_0x505f64[_0x7116('0x58')],_0x505f64[_0x7116('0x59')]||'wav');var _0x8f1f73=_[_0x7116('0x57')](_0x2af83d[_0x7116('0x63')],{'filename':_0x7116('0x60')+_0x1acad6[_0x7116('0x61')]()});if(_0x8f1f73){_0x8f1f73[_0x7116('0x68')]='stop';}})[_0x7116('0x1b')](function(){_0x39e448({'code':0xc8,'message':[_0x505f64[_0x7116('0x58')],_0x7116('0x6c')][_0x7116('0xf')]('\x20')});})[_0x7116('0x1d')](function(_0x4d0f8e){_0x385004(_0x26b0ae[_0x7116('0x16')](0x1f5,[_0x505f64['uniqueid'],_0x4d0f8e[_0x7116('0x15')]['toLowerCase']()][_0x7116('0xf')]('\x20')));});}else{return _0x385004(_0x26b0ae[_0x7116('0x16')](0x1f5,_0x7116('0x6d')));}});},'VoiceQueuesChannels':function(_0x3792db){return new Promise(function(_0x511bf7,_0x291167){var _0xa28ebf=_['values'](_0x525beb[_0x7116('0x6e')]);_0x511bf7({'count':_0xa28ebf['length'],'rows':_0xa28ebf});});},'VoiceQueuesChannel':function(_0x5a58a1){var _0x4d4d83=this;return new Promise(function(_0x306cc7,_0x39cb44){var _0x52857=schema(properties['voicequeuechannel'])['validate'](_0x5a58a1);if(_0x52857[_0x7116('0x53')]>0x0){return _0x39cb44(_0x4d4d83['error'](0x1f4,_[_0x7116('0x56')](_0x52857,_0x7116('0x15'))['join'](',\x20')));}var _0x187018=_[_0x7116('0x57')](_0x525beb['queueChannels'],{'uniqueid':_0x5a58a1[_0x7116('0x58')]});if(_0x187018){_0x306cc7(_0x187018);}else{return _0x39cb44(_0x4d4d83[_0x7116('0x16')](0x1f5,_0x7116('0x6d')));}});},'VoiceQueuesChannelHangup':function(_0x488868){var _0x5ce423=this;return new Promise(function(_0x5cf7f7,_0x4de94d){if(ami[_0x7116('0xc')]()==![]){return _0x4de94d(_0x5ce423[_0x7116('0x16')](0x1f4,[config[_0x7116('0xd')]['ip'],config[_0x7116('0xd')]['username'],_0x7116('0x17')]['join']('\x20')));}var _0x2c191d=schema(properties[_0x7116('0x6f')])[_0x7116('0x69')](_0x488868);if(_0x2c191d[_0x7116('0x53')]>0x0){return _0x4de94d(_0x5ce423[_0x7116('0x16')](0x1f4,_[_0x7116('0x56')](_0x2c191d,_0x7116('0x15'))[_0x7116('0xf')](',\x20')));}var _0x57017b=_[_0x7116('0x57')](_0x525beb[_0x7116('0x6e')],{'uniqueid':_0x488868[_0x7116('0x58')]});if(_0x57017b&&_0x57017b[_0x7116('0x5e')]){return ami[_0x7116('0x14')]({'action':_0x7116('0x70'),'channel':_0x57017b['channel']})[_0x7116('0x1b')](function(_0x4d98e5){_0x5cf7f7({'code':0xc8,'message':[_0x488868['uniqueid'],_0x4d98e5[_0x7116('0x15')][_0x7116('0x61')]()][_0x7116('0xf')]('\x20')});})[_0x7116('0x1d')](function(_0xfc98c3){_0x4de94d(_0x5ce423[_0x7116('0x16')](0x1f5,[_0x488868[_0x7116('0x58')],_0xfc98c3[_0x7116('0x15')]['toLowerCase']()][_0x7116('0xf')]('\x20')));});}else{return _0x4de94d(_0x5ce423[_0x7116('0x16')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x14433e){var _0xa01f0=this;return new Promise(function(_0x2858fe,_0x337200){if(ami[_0x7116('0xc')]()==![]){return _0x337200(_0xa01f0['error'](0x1f4,[config[_0x7116('0xd')]['ip'],config[_0x7116('0xd')][_0x7116('0xe')],_0x7116('0x17')]['join']('\x20')));}var _0x4533ff=schema(properties[_0x7116('0x71')])['validate'](_0x14433e);if(_0x4533ff[_0x7116('0x53')]>0x0){return _0x337200(_0xa01f0['error'](0x1f4,_[_0x7116('0x56')](_0x4533ff,_0x7116('0x15'))['join'](',\x20')));}var _0x5dcccd=_[_0x7116('0x57')](_0x525beb['queueChannels'],{'uniqueid':_0x14433e[_0x7116('0x58')]});if(_0x5dcccd&&_0x5dcccd['channel']){return ami['Action']({'action':_0x7116('0x72'),'channel':_0x5dcccd[_0x7116('0x5e')],'exten':_0x14433e[_0x7116('0x73')],'context':_0x14433e[_0x7116('0x74')]||_0x5dcccd[_0x7116('0x74')],'priority':0x1})[_0x7116('0x1b')](function(_0x2a34c5){_0x2858fe({'code':0xc8,'message':[_0x14433e[_0x7116('0x58')],_0x2a34c5[_0x7116('0x15')][_0x7116('0x61')]()][_0x7116('0xf')]('\x20')});})[_0x7116('0x1d')](function(_0x7aef4a){_0x337200(_0xa01f0[_0x7116('0x16')](0x1f5,[_0x14433e[_0x7116('0x58')],_0x7aef4a[_0x7116('0x15')][_0x7116('0x61')]()]['join']('\x20')));});}else{return _0x337200(_0xa01f0[_0x7116('0x16')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x12291b){return new Promise(function(_0x388692,_0x4921cc){var _0x218acb=_[_0x7116('0x54')](_0x525beb[_0x7116('0x8')]);_0x388692({'count':_0x218acb[_0x7116('0x53')],'rows':_0x218acb});});},'Telephones':function(_0x593767){return new Promise(function(_0x1f41a8,_0x280229){var _0x1dd5ce=_[_0x7116('0x54')](_0x525beb[_0x7116('0x75')]);_0x1f41a8({'count':_0x1dd5ce[_0x7116('0x53')],'rows':_0x1dd5ce});});},'Trunks':function(_0x5ebcf9){return new Promise(function(_0xb3f12d,_0x554a99){var _0x106126=_['values'](_0x525beb['trunks']);_0xb3f12d({'count':_0x106126['length'],'rows':_0x106126});});},'OutboundChannels':function(_0x194b0c){return new Promise(function(_0x4f4964,_0xb2ba5c){var _0x14305f=_[_0x7116('0x54')](_0x525beb[_0x7116('0x76')]);_0x4f4964({'count':_0x14305f[_0x7116('0x53')],'rows':_0x14305f});});},'Outbound':function(_0x1ba013){return new Promise(function(_0x44c3b7,_0x443cba){_0x44c3b7(_0x525beb[_0x7116('0x29')]);});},'Campaigns':function(_0x580657){return new Promise(function(_0x583471,_0xf51b8b){var _0x1b56d7=_[_0x7116('0x54')](_0x525beb[_0x7116('0x77')]);_0x583471({'count':_0x1b56d7[_0x7116('0x53')],'rows':_0x1b56d7});});},'VoiceQueuesPreview':function(_0x4c9859){var _0x592bb9=this;return new Promise(function(_0x59880f,_0x5d3ca0){_0x21e3e1['run'](_0x4c9859['id'])[_0x7116('0x1b')](function(_0x1d016c){_0x59880f({'code':0xc8,'message':_0x1d016c[_0x7116('0x15')]});})['catch'](function(_0x1a0d13){_0x5d3ca0(_0x592bb9[_0x7116('0x16')](0x1f4,_0x1a0d13[_0x7116('0x15')]));});});},'EventManager':function(_0x19c2a1){var _0x3c6964=this;return new Promise(function(_0x5c3323,_0x101c5c){if(!_0x19c2a1[_0x7116('0x78')]){return _0x101c5c(_0x3c6964[_0x7116('0x16')](0x1f4,_0x7116('0x79')));}ami[_0x7116('0x7a')](_0x7116('0x7b')+_0x19c2a1[_0x7116('0x78')],_0x19c2a1[_0x7116('0x15')]);_0x5c3323({'code':0xc8,'message':_0x19c2a1});});},'FaxAccounts':function(_0x4bc750){return new Promise(function(_0x8b34e8,_0x49dfa3){var _0x117722=_[_0x7116('0x54')](_0x525beb['faxAccounts']);_0x8b34e8({'count':_0x117722['length'],'rows':_0x117722});});},'SendFax':function(_0x12fbda){var _0x364449=this;return new Promise(function(_0x1a9581,_0x275059){_0x1af8c5[_0x7116('0x7c')](_0x12fbda)[_0x7116('0x1b')](function(_0x1d3a42){_0x1a9581({'code':0xc8,'message':_0x1d3a42[_0x7116('0x15')]});})[_0x7116('0x1d')](function(_0x3f0ef9){_0x275059(_0x364449['error'](0x1f4,_0x3f0ef9[_0x7116('0x15')]));});});},'CheckAfterSend':function(_0x3dc0c1){var _0x615799=this;return new Promise(function(_0x3acfb2,_0x5a3458){_0x1af8c5[_0x7116('0x7d')](_0x3dc0c1)[_0x7116('0x1b')](function(_0x2a96de){_0x3acfb2({'code':0xc8,'message':_0x2a96de[_0x7116('0x15')]});})[_0x7116('0x1d')](function(_0x2754ee){_0x5a3458(_0x615799[_0x7116('0x16')](0x1f4,_0x2754ee[_0x7116('0x15')]));});});}};var _0x4fc7c1=jayson[_0x7116('0x7e')](_0x2ec08b)['http']();_0x4fc7c1['on'](_0x7116('0x16'),function(_0x4aace3){return _0x2bc7bf(_0x4aace3);});_0x4fc7c1[_0x7116('0x3')](0x232a,_0x7116('0x7f'),function(){console[_0x7116('0x80')](_0x7116('0x81'),0x232a);return _0x5d212a(_0x7116('0x82')+0x232a);});});}; \ No newline at end of file +var _0x4685=['mixmonitorid','status','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','map','resolve','StopMixMonitor','wav','stop','StopMixMonitor\x20Success','voicequeuechannel','queueChannels','voicequeuechannelhangup','Hangup','Redirect','exten','context','values','agents','telephones','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','emit','faxAccounts','send','server','http','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','validate','bluebird','moment','../properties','../ami','listen','format','%s/%s','name','timers','timer','updateAcw','pause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','command','Command','content','catch','voiceQueues','strategy','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','type','unmanaged','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','callerid','Interval','push','length','channels','voicechannel','find','uniqueid','%s.%s','filename','channel','ai(mixmonitorid)','toLowerCase','isNil','monitors','/var/spool/asterisk/monitor/','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x595013,_0x65a215){var _0x2a29e3=function(_0x307bf8){while(--_0x307bf8){_0x595013['push'](_0x595013['shift']());}};_0x2a29e3(++_0x65a215);}(_0x4685,0x130));var _0x5468=function(_0x1c42c5,_0x2dba7a){_0x1c42c5=_0x1c42c5-0x0;var _0x1ddc16=_0x4685[_0x1c42c5];return _0x1ddc16;};'use strict';var _=require(_0x5468('0x0'));var util=require('util');var jayson=require('jayson/promise');var schema=require(_0x5468('0x1'));var BPromise=require(_0x5468('0x2'));var moment=require(_0x5468('0x3'));var config=require('../../../config/environment');var properties=require(_0x5468('0x4'));var ami=require(_0x5468('0x5'));exports[_0x5468('0x6')]=function(_0x2eccc2,_0x1bb445,_0x2528e4){return new BPromise(function(_0xed0bbe,_0x14bea0){var _0x39c460={'QueuePause':function(_0x5a886a){return new Promise(function(_0x462633,_0xd78f25){var _0x97d38a=util[_0x5468('0x7')](_0x5468('0x8'),'SIP',_0x5a886a[_0x5468('0x9')]);if(_0x2eccc2['timers']&&_0x2eccc2['timers'][_0x97d38a]&&_0x2eccc2[_0x5468('0xa')][_0x97d38a][_0x5468('0xb')]){_0x2eccc2[_0x5468('0xa')][_0x97d38a][_0x5468('0xc')]();}if(_0x2eccc2['agents'][_0x97d38a]){_0x2eccc2['agents'][_0x97d38a]['updateStatusRealtime']({'statePause':_0x5a886a[_0x5468('0xd')]?!![]:![]});}_0x462633({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x25ad2f){var _0x130b2f=this;return new Promise(function(_0x29715a,_0x10e446){if(ami[_0x5468('0xe')]()==![]){return _0x10e446(_0x130b2f[_0x5468('0xf')](0x1f4,[config[_0x5468('0x10')]['ip'],config[_0x5468('0x10')][_0x5468('0x11')],_0x5468('0x12')][_0x5468('0x13')]('\x20')));}_0x25ad2f=_[_0x5468('0x14')](_0x25ad2f,_[_0x5468('0x15')](properties[_0x5468('0x16')]));_0x25ad2f[_0x5468('0x17')]=_0x5468('0x18');return ami[_0x5468('0x19')](_0x25ad2f)[_0x5468('0x1a')](function(_0x1fed3f){_0x29715a({'code':0xc8,'message':_0x1fed3f[_0x5468('0x1b')]});})['catch'](function(_0x5df3c0){_0x10e446(_0x130b2f[_0x5468('0xf')](0x1f5,_0x5df3c0[_0x5468('0x1b')]));});});},'Command':function(_0x2596b3){var _0x44670d=this;return new Promise(function(_0x10ee69,_0x5df517){if(ami['isConnected']()==![]){return _0x5df517(_0x44670d['error'](0x1f4,[config[_0x5468('0x10')]['ip'],config[_0x5468('0x10')][_0x5468('0x11')],'ami\x20disconnected']['join']('\x20')));}_0x2596b3=_['pick'](_0x2596b3,_0x5468('0x1c'));_0x2596b3[_0x5468('0x17')]=_0x5468('0x1d');return ami['Action'](_0x2596b3)['then'](function(_0x1bcb3f){_0x10ee69({'code':0xc8,'message':_0x1bcb3f[_0x5468('0x1e')]});})[_0x5468('0x1f')](function(_0x298226){_0x5df517(_0x44670d[_0x5468('0xf')](0x1f5,_0x298226[_0x5468('0x1b')]));});});},'VoiceQueues':function(_0x136be5){return new Promise(function(_0xb169e4,_0x4285b1){var _0x2748a6=[];for(var _0x5d544a in _0x2eccc2[_0x5468('0x20')]){if(_0x2eccc2[_0x5468('0x20')]['hasOwnProperty'](_0x5d544a)){var _0x59f2f7=_0x2eccc2[_0x5468('0x20')][_0x5d544a];var _0x227af4={'id':_0x59f2f7['id'],'name':_0x59f2f7[_0x5468('0x9')],'strategy':_0x59f2f7[_0x5468('0x21')],'answered':_0x59f2f7[_0x5468('0x22')],'available':_0x59f2f7[_0x5468('0x23')],'loggedIn':_0x59f2f7[_0x5468('0x24')],'pTalking':_0x59f2f7[_0x5468('0x25')],'sumBillable':_0x59f2f7['sumBillable'],'sumDuration':_0x59f2f7[_0x5468('0x26')],'sumHoldTime':_0x59f2f7[_0x5468('0x27')]||0x0,'talking':_0x59f2f7[_0x5468('0x28')],'total':_0x59f2f7[_0x5468('0x29')],'type':_0x59f2f7[_0x5468('0x2a')],'unmanaged':_0x59f2f7[_0x5468('0x2b')],'abandoned':_0x59f2f7['abandoned'],'waiting':_0x59f2f7[_0x5468('0x2c')],'loggedInDb':_0x59f2f7[_0x5468('0x2d')]};if(_0x59f2f7[_0x5468('0x2a')]===_0x5468('0x2e')){_0x227af4['dialActive']=_0x59f2f7[_0x5468('0x2f')];_0x227af4[_0x5468('0x30')]=_0x59f2f7[_0x5468('0x30')];_0x227af4['dialOriginateCallerIdName']=_0x59f2f7[_0x5468('0x31')];_0x227af4['dialOriginateCallerIdNumber']=_0x59f2f7['dialOriginateCallerIdNumber'];_0x227af4['dialOriginateTimeout']=_0x59f2f7[_0x5468('0x32')];_0x227af4['dialPrefix']=_0x59f2f7[_0x5468('0x33')];_0x227af4[_0x5468('0x34')]=_0x59f2f7['outboundAnswerAgiCallsDay'];_0x227af4[_0x5468('0x35')]=_0x59f2f7[_0x5468('0x35')];_0x227af4['outboundBlacklistCallsDay']=_0x59f2f7[_0x5468('0x36')];_0x227af4['outboundBusyCallsDay']=_0x59f2f7['outboundBusyCallsDay'];_0x227af4[_0x5468('0x37')]=_0x59f2f7['outboundCongestionCallsDay'];_0x227af4[_0x5468('0x38')]=_0x59f2f7[_0x5468('0x38')];_0x227af4['outboundDropCallsDayCallersExit']=_0x59f2f7[_0x5468('0x39')];_0x227af4['outboundDropCallsDayTimeout']=_0x59f2f7[_0x5468('0x3a')];_0x227af4[_0x5468('0x3b')]=_0x59f2f7[_0x5468('0x3b')];_0x227af4[_0x5468('0x3c')]=_0x59f2f7['outboundNoSuchCallsDay'];_0x227af4[_0x5468('0x3d')]=_0x59f2f7[_0x5468('0x3d')];_0x227af4['outboundReCallsDay']=_0x59f2f7[_0x5468('0x3e')];_0x227af4[_0x5468('0x3f')]=_0x59f2f7['outboundRejectCallsDay'];_0x227af4[_0x5468('0x40')]=_0x59f2f7[_0x5468('0x40')];_0x227af4[_0x5468('0x41')]=_0x59f2f7['predictiveIntervalAnsweredCalls'];_0x227af4[_0x5468('0x42')]=_0x59f2f7['predictiveIntervalAvgHoldtime'];_0x227af4['predictiveIntervalAvgTalktime']=_0x59f2f7[_0x5468('0x43')];_0x227af4[_0x5468('0x44')]=_0x59f2f7[_0x5468('0x44')];_0x227af4[_0x5468('0x45')]=_0x59f2f7[_0x5468('0x45')];_0x227af4[_0x5468('0x46')]=_0x59f2f7['predictiveIntervalErlangCalls'];_0x227af4['predictiveIntervalErlangCallsDroppedCalls']=_0x59f2f7[_0x5468('0x47')];_0x227af4['predictiveIntervalHitRate']=_0x59f2f7[_0x5468('0x48')];_0x227af4[_0x5468('0x49')]=_0x59f2f7[_0x5468('0x49')];_0x227af4[_0x5468('0x4a')]=_0x59f2f7[_0x5468('0x4a')];_0x227af4[_0x5468('0x4b')]=_0x59f2f7[_0x5468('0x4b')];_0x227af4[_0x5468('0x4c')]=_0x59f2f7['predictiveIntervalTotalCalls'];_0x227af4[_0x5468('0x1b')]=_0x59f2f7[_0x5468('0x1b')];_0x227af4[_0x5468('0x4d')]=_0x59f2f7[_0x5468('0x4d')];_0x227af4[_0x5468('0x4e')]=_0x59f2f7[_0x5468('0x4e')];_0x227af4[_0x5468('0x4f')]=_0x59f2f7[_0x5468('0x4f')];_0x227af4[_0x5468('0x50')]=_0x59f2f7[_0x5468('0x50')];_0x227af4['erlangBusyFactor']=_0x59f2f7['erlangBusyFactor'];_0x227af4[_0x5468('0x51')]=_0x59f2f7[_0x5468('0x51')];_0x227af4[_0x5468('0x52')]=_0x59f2f7['startProgressive'];}if(_0x59f2f7[_0x5468('0x53')]){_0x227af4[_0x5468('0x53')]={'id':_0x59f2f7['Trunk']['id'],'name':_0x59f2f7[_0x5468('0x53')]['name'],'active':_0x59f2f7[_0x5468('0x53')]['active'],'callerid':_0x59f2f7[_0x5468('0x53')][_0x5468('0x54')]};}if(_0x59f2f7[_0x5468('0x55')]){_0x227af4[_0x5468('0x55')]={'id':_0x59f2f7[_0x5468('0x55')]['id'],'name':_0x59f2f7[_0x5468('0x55')][_0x5468('0x9')]};}_0x2748a6[_0x5468('0x56')](_0x227af4);}}_0xb169e4({'count':_0x2748a6[_0x5468('0x57')],'rows':_0x2748a6});});},'VoiceChannels':function(_0x3437ae){return new Promise(function(_0x4e73c0,_0x3e07c8){var _0xca9009=_['values'](_0x2eccc2[_0x5468('0x58')]);_0x4e73c0({'count':_0xca9009[_0x5468('0x57')],'rows':_0xca9009});});},'VoiceChannelMixMonitor':function(_0x3b8cc3){var _0x236c74=this;return new Promise(function(_0x5e3f90,_0x43c6f1){if(ami[_0x5468('0xe')]()==![]){return _0x43c6f1(_0x236c74[_0x5468('0xf')](0x1f4,[config[_0x5468('0x10')]['ip'],config[_0x5468('0x10')][_0x5468('0x11')],_0x5468('0x12')][_0x5468('0x13')]('\x20')));}var _0x1a389b=schema(properties[_0x5468('0x59')])[_0x5468('0x1')](_0x3b8cc3);if(_0x1a389b[_0x5468('0x57')]>0x0){return _0x43c6f1(_0x236c74[_0x5468('0xf')](0x1f4,_['map'](_0x1a389b,_0x5468('0x1b'))[_0x5468('0x13')](',\x20')));}var _0x3e80e8=_[_0x5468('0x5a')](_0x2eccc2[_0x5468('0x58')],{'uniqueid':_0x3b8cc3[_0x5468('0x5b')]});if(_0x3e80e8&&_0x3e80e8['channel']){var _0x4b29ec=util[_0x5468('0x7')](_0x5468('0x5c'),_0x3b8cc3[_0x5468('0x5d')]||_0x3b8cc3[_0x5468('0x5b')],_0x3b8cc3['format']||'wav');return ami[_0x5468('0x19')]({'action':'MixMonitor','channel':_0x3e80e8[_0x5468('0x5e')],'file':_0x4b29ec,'options':_0x5468('0x5f')})['then'](function(_0x3cb3d9){var _0x2bc74a=_['find'](_0x3e80e8['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x4b29ec[_0x5468('0x60')]()});if(_[_0x5468('0x61')](_0x2bc74a)){_0x3e80e8[_0x5468('0x62')][_0x5468('0x56')]({'filename':_0x5468('0x63')+_0x4b29ec[_0x5468('0x60')](),'createdAt':moment()[_0x5468('0x7')](_0x5468('0x64')),'mixmonitorid':_0x3cb3d9[_0x5468('0x65')],'status':'rec'});}else{_0x2bc74a[_0x5468('0x65')]=_0x3cb3d9['mixmonitorid'];_0x2bc74a[_0x5468('0x66')]=_0x5468('0x67');}_0x5e3f90({'code':0xc8,'message':[_0x3b8cc3[_0x5468('0x5b')],_0x5468('0x68'),_0x3cb3d9[_0x5468('0x65')]][_0x5468('0x13')]('\x20'),'mixmonitorid':_0x3cb3d9['mixmonitorid']});})['catch'](function(_0x5d6891){_0x43c6f1(_0x236c74[_0x5468('0xf')](0x1f5,[_0x3b8cc3[_0x5468('0x5b')],_0x5d6891[_0x5468('0x1b')][_0x5468('0x60')]()][_0x5468('0x13')]('\x20')));});}else{return _0x43c6f1(_0x236c74[_0x5468('0xf')](0x1f5,_0x5468('0x69')));}});},'VoiceChannelStopMixMonitor':function(_0x69f53d){var _0x31e865=this;return new Promise(function(_0x33b11d,_0x498cfb){if(ami[_0x5468('0xe')]()==![]){return _0x498cfb(_0x31e865['error'](0x1f4,[config[_0x5468('0x10')]['ip'],config[_0x5468('0x10')][_0x5468('0x11')],_0x5468('0x12')][_0x5468('0x13')]('\x20')));}var _0x4a6b70=schema(properties[_0x5468('0x59')])[_0x5468('0x1')](_0x69f53d);if(_0x4a6b70[_0x5468('0x57')]>0x0){return _0x498cfb(_0x31e865['error'](0x1f4,_[_0x5468('0x6a')](_0x4a6b70,_0x5468('0x1b'))[_0x5468('0x13')](',\x20')));}var _0x82cd71=_['find'](_0x2eccc2['channels'],{'uniqueid':_0x69f53d['uniqueid']});if(_0x82cd71){return BPromise[_0x5468('0x6b')]()[_0x5468('0x1a')](function(){if(_0x82cd71[_0x5468('0x5e')]){return ami[_0x5468('0x19')]({'action':_0x5468('0x6c'),'channel':_0x82cd71['channel'],'mixmonitorid':_0x69f53d[_0x5468('0x65')]})[_0x5468('0x1f')](function(_0x46ab4d){});}})[_0x5468('0x1a')](function(){if(_0x82cd71['destinationchannel']){return ami[_0x5468('0x19')]({'action':_0x5468('0x6c'),'channel':_0x82cd71['destinationchannel'],'mixmonitorid':_0x69f53d['mixmonitorid']})['catch'](function(_0x4beca6){});}})['then'](function(_0x64d955){var _0xbd92b=_[_0x5468('0x5a')](_0x82cd71[_0x5468('0x62')],{'mixmonitorid':_0x69f53d['mixmonitorid']});if(_0xbd92b){_0xbd92b[_0x5468('0x66')]='stop';}})[_0x5468('0x1a')](function(){var _0xa0a1a1=util['format'](_0x5468('0x5c'),_0x69f53d[_0x5468('0x5d')]||_0x69f53d[_0x5468('0x5b')],_0x69f53d[_0x5468('0x7')]||_0x5468('0x6d'));var _0x348582=_['find'](_0x82cd71[_0x5468('0x62')],{'filename':_0x5468('0x63')+_0xa0a1a1[_0x5468('0x60')]()});if(_0x348582){_0x348582['status']=_0x5468('0x6e');}})[_0x5468('0x1a')](function(){_0x33b11d({'code':0xc8,'message':[_0x69f53d[_0x5468('0x5b')],_0x5468('0x6f')][_0x5468('0x13')]('\x20')});})[_0x5468('0x1f')](function(_0x582d1e){_0x498cfb(_0x31e865['error'](0x1f5,[_0x69f53d[_0x5468('0x5b')],_0x582d1e[_0x5468('0x1b')][_0x5468('0x60')]()]['join']('\x20')));});}else{return _0x498cfb(_0x31e865['error'](0x1f5,_0x5468('0x69')));}});},'VoiceQueuesChannels':function(_0x27c575){return new Promise(function(_0x491ae1,_0x54e211){var _0x592ac9=_['values'](_0x2eccc2['queueChannels']);_0x491ae1({'count':_0x592ac9['length'],'rows':_0x592ac9});});},'VoiceQueuesChannel':function(_0x45433d){var _0x4a928f=this;return new Promise(function(_0x112781,_0xf845c4){var _0x1736f6=schema(properties[_0x5468('0x70')])[_0x5468('0x1')](_0x45433d);if(_0x1736f6[_0x5468('0x57')]>0x0){return _0xf845c4(_0x4a928f[_0x5468('0xf')](0x1f4,_[_0x5468('0x6a')](_0x1736f6,_0x5468('0x1b'))[_0x5468('0x13')](',\x20')));}var _0x544757=_[_0x5468('0x5a')](_0x2eccc2[_0x5468('0x71')],{'uniqueid':_0x45433d[_0x5468('0x5b')]});if(_0x544757){_0x112781(_0x544757);}else{return _0xf845c4(_0x4a928f[_0x5468('0xf')](0x1f5,_0x5468('0x69')));}});},'VoiceQueuesChannelHangup':function(_0x8eba43){var _0x15809a=this;return new Promise(function(_0x1ef787,_0x4087a5){if(ami[_0x5468('0xe')]()==![]){return _0x4087a5(_0x15809a[_0x5468('0xf')](0x1f4,[config[_0x5468('0x10')]['ip'],config[_0x5468('0x10')][_0x5468('0x11')],'ami\x20disconnected'][_0x5468('0x13')]('\x20')));}var _0x575067=schema(properties[_0x5468('0x72')])[_0x5468('0x1')](_0x8eba43);if(_0x575067[_0x5468('0x57')]>0x0){return _0x4087a5(_0x15809a[_0x5468('0xf')](0x1f4,_[_0x5468('0x6a')](_0x575067,_0x5468('0x1b'))[_0x5468('0x13')](',\x20')));}var _0x4787e2=_['find'](_0x2eccc2[_0x5468('0x71')],{'uniqueid':_0x8eba43['uniqueid']});if(_0x4787e2&&_0x4787e2['channel']){return ami[_0x5468('0x19')]({'action':_0x5468('0x73'),'channel':_0x4787e2[_0x5468('0x5e')]})[_0x5468('0x1a')](function(_0x32aa3c){_0x1ef787({'code':0xc8,'message':[_0x8eba43[_0x5468('0x5b')],_0x32aa3c[_0x5468('0x1b')][_0x5468('0x60')]()][_0x5468('0x13')]('\x20')});})[_0x5468('0x1f')](function(_0x1564a8){_0x4087a5(_0x15809a[_0x5468('0xf')](0x1f5,[_0x8eba43[_0x5468('0x5b')],_0x1564a8[_0x5468('0x1b')][_0x5468('0x60')]()][_0x5468('0x13')]('\x20')));});}else{return _0x4087a5(_0x15809a[_0x5468('0xf')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x29c078){var _0x5ef25d=this;return new Promise(function(_0x51c536,_0x5c1f76){if(ami[_0x5468('0xe')]()==![]){return _0x5c1f76(_0x5ef25d[_0x5468('0xf')](0x1f4,[config['asterisk']['ip'],config[_0x5468('0x10')][_0x5468('0x11')],'ami\x20disconnected'][_0x5468('0x13')]('\x20')));}var _0x2819d5=schema(properties['voicequeuechannelredirect'])[_0x5468('0x1')](_0x29c078);if(_0x2819d5['length']>0x0){return _0x5c1f76(_0x5ef25d[_0x5468('0xf')](0x1f4,_[_0x5468('0x6a')](_0x2819d5,'message')[_0x5468('0x13')](',\x20')));}var _0x4b898f=_[_0x5468('0x5a')](_0x2eccc2['queueChannels'],{'uniqueid':_0x29c078[_0x5468('0x5b')]});if(_0x4b898f&&_0x4b898f[_0x5468('0x5e')]){return ami[_0x5468('0x19')]({'action':_0x5468('0x74'),'channel':_0x4b898f[_0x5468('0x5e')],'exten':_0x29c078[_0x5468('0x75')],'context':_0x29c078[_0x5468('0x76')]||_0x4b898f[_0x5468('0x76')],'priority':0x1})['then'](function(_0x17b80b){_0x51c536({'code':0xc8,'message':[_0x29c078[_0x5468('0x5b')],_0x17b80b['message']['toLowerCase']()][_0x5468('0x13')]('\x20')});})['catch'](function(_0xed9b68){_0x5c1f76(_0x5ef25d['error'](0x1f5,[_0x29c078['uniqueid'],_0xed9b68[_0x5468('0x1b')]['toLowerCase']()]['join']('\x20')));});}else{return _0x5c1f76(_0x5ef25d[_0x5468('0xf')](0x1f5,_0x5468('0x69')));}});},'Agents':function(_0x350b4e){return new Promise(function(_0x185005,_0x105663){var _0x238666=_[_0x5468('0x77')](_0x2eccc2[_0x5468('0x78')]);_0x185005({'count':_0x238666[_0x5468('0x57')],'rows':_0x238666});});},'Telephones':function(_0x4a32e4){return new Promise(function(_0x6e3bfb,_0x1b6f02){var _0x586f9f=_[_0x5468('0x77')](_0x2eccc2[_0x5468('0x79')]);_0x6e3bfb({'count':_0x586f9f['length'],'rows':_0x586f9f});});},'Trunks':function(_0x19d0a4){return new Promise(function(_0x20d895,_0x4325c7){var _0x3a33ec=_['values'](_0x2eccc2['trunks']);_0x20d895({'count':_0x3a33ec['length'],'rows':_0x3a33ec});});},'OutboundChannels':function(_0x4631b3){return new Promise(function(_0x494bb6,_0x249b27){var _0xcc0e0c=_[_0x5468('0x77')](_0x2eccc2[_0x5468('0x7a')]);_0x494bb6({'count':_0xcc0e0c[_0x5468('0x57')],'rows':_0xcc0e0c});});},'Outbound':function(_0x5b779a){return new Promise(function(_0x215c93,_0x22c029){_0x215c93(_0x2eccc2[_0x5468('0x2e')]);});},'Campaigns':function(_0x5c0ecd){return new Promise(function(_0x1252bf,_0x12f154){var _0x34da25=_[_0x5468('0x77')](_0x2eccc2[_0x5468('0x7b')]);_0x1252bf({'count':_0x34da25[_0x5468('0x57')],'rows':_0x34da25});});},'VoiceQueuesPreview':function(_0xa3e734){var _0x915a26=this;return new Promise(function(_0x32624c,_0x69f1e4){_0x1bb445[_0x5468('0x7c')](_0xa3e734['id'])[_0x5468('0x1a')](function(_0x36f25c){_0x32624c({'code':0xc8,'message':_0x36f25c['message']});})['catch'](function(_0x41394b){_0x69f1e4(_0x915a26[_0x5468('0xf')](0x1f4,_0x41394b[_0x5468('0x1b')]));});});},'EventManager':function(_0x4bf389){var _0x23de60=this;return new Promise(function(_0x5f3280,_0x2ee5fd){if(!_0x4bf389[_0x5468('0x7d')]){return _0x2ee5fd(_0x23de60['error'](0x1f4,_0x5468('0x7e')));}ami[_0x5468('0x7f')]('custom:'+_0x4bf389[_0x5468('0x7d')],_0x4bf389['message']);_0x5f3280({'code':0xc8,'message':_0x4bf389});});},'FaxAccounts':function(_0x241df9){return new Promise(function(_0x194dfc,_0x1643ac){var _0x26421d=_[_0x5468('0x77')](_0x2eccc2[_0x5468('0x80')]);_0x194dfc({'count':_0x26421d[_0x5468('0x57')],'rows':_0x26421d});});},'SendFax':function(_0x4dd752){var _0x39221f=this;return new Promise(function(_0x39f09a,_0x2b7144){_0x2528e4[_0x5468('0x81')](_0x4dd752)['then'](function(_0x2d7451){_0x39f09a({'code':0xc8,'message':_0x2d7451[_0x5468('0x1b')]});})['catch'](function(_0x50e352){_0x2b7144(_0x39221f[_0x5468('0xf')](0x1f4,_0x50e352['message']));});});},'CheckAfterSend':function(_0x50cf3d){var _0x56c17b=this;return new Promise(function(_0x142a7e,_0x3ba7c3){_0x2528e4['checkAfterSend'](_0x50cf3d)[_0x5468('0x1a')](function(_0x3df2ec){_0x142a7e({'code':0xc8,'message':_0x3df2ec[_0x5468('0x1b')]});})[_0x5468('0x1f')](function(_0x595dd5){_0x3ba7c3(_0x56c17b[_0x5468('0xf')](0x1f4,_0x595dd5[_0x5468('0x1b')]));});});}};var _0x4c9c5b=jayson[_0x5468('0x82')](_0x39c460)[_0x5468('0x83')]();_0x4c9c5b['on'](_0x5468('0xf'),function(_0x521525){return _0x14bea0(_0x521525);});_0x4c9c5b[_0x5468('0x6')](0x232a,'127.0.0.1',function(){console[_0x5468('0x84')](_0x5468('0x85'),0x232a);return _0xed0bbe(_0x5468('0x86')+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 81b04f6..ffa6b0b 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 _0x86aa=['error','Error\x20creating\x20contact','action','bluebird','util','lodash','ioredis','../../../../config/environment','../../../../config/logger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','stringify','emit','exec','autoCreate','data2','data1','isNil','routeId','firstName','calleridname','','calleridnum','uniqueid','destcalleridname','destcalleridnum','then','showContact','xmd-contactid2','format','user:%s','name','toLowerCase','merge','createContact','trigger:%s'];(function(_0x3e402a,_0x105ddf){var _0x30ff95=function(_0x55e420){while(--_0x55e420){_0x3e402a['push'](_0x3e402a['shift']());}};_0x30ff95(++_0x105ddf);}(_0x86aa,0x7b));var _0xa86a=function(_0x193ea3,_0x536987){_0x193ea3=_0x193ea3-0x0;var _0x30aadf=_0x86aa[_0x193ea3];return _0x30aadf;};'use strict';var BPromise=require(_0xa86a('0x0'));var util=require(_0xa86a('0x1'));var _=require(_0xa86a('0x2'));var Redis=require(_0xa86a('0x3'));var config=require(_0xa86a('0x4'));var logger=require(_0xa86a('0x5'))('trigger');var cmContactRpc=require(_0xa86a('0x6'));config[_0xa86a('0x7')]=_[_0xa86a('0x8')](config[_0xa86a('0x7')],{'host':_0xa86a('0x9'),'port':0x18eb});var io=require(_0xa86a('0xa'))(new Redis(config[_0xa86a('0x7')]));function emit(_0x2988a,_0x35557f,_0x47ece8){logger[_0xa86a('0xb')](_0x2988a,_0x35557f,JSON[_0xa86a('0xc')](_0x47ece8));io['to'](_0x2988a)[_0xa86a('0xd')](_0x35557f,_0x47ece8);}exports[_0xa86a('0xe')]=function(_0xdd56d8,_0x4ef5ad,_0x1f6def){_0x1f6def[_0xa86a('0xf')]=0x0;if(_0x4ef5ad[_0xa86a('0x10')]&&parseInt(_0x4ef5ad['data2'],0xa)){var _0x322db4={'ListId':parseInt(_0x4ef5ad[_0xa86a('0x11')],0xa),'phone':_0x1f6def['calleridnum']};if(_[_0xa86a('0x12')](_0x1f6def[_0xa86a('0x13')])){_0x322db4[_0xa86a('0x14')]=_0x1f6def[_0xa86a('0x15')]&&_0x1f6def[_0xa86a('0x15')]!==_0xa86a('0x16')?_0x1f6def[_0xa86a('0x15')]:_0x1f6def[_0xa86a('0x17')]||_0x1f6def[_0xa86a('0x18')];}else{_0x322db4[_0xa86a('0x14')]=_0x1f6def[_0xa86a('0x19')]&&_0x1f6def[_0xa86a('0x19')]!==_0xa86a('0x16')?_0x1f6def[_0xa86a('0x19')]:_0x1f6def[_0xa86a('0x1a')]||_0x1f6def[_0xa86a('0x18')];_0x322db4['phone']=_0x1f6def['destcalleridname']&&_0x1f6def['destcalleridname']!==_0xa86a('0x16')?_0x1f6def[_0xa86a('0x19')]:_0x1f6def[_0xa86a('0x1a')]||_0x1f6def[_0xa86a('0x18')];}BPromise['resolve']()[_0xa86a('0x1b')](cmContactRpc[_0xa86a('0x1c')]({'where':_['omit'](_0x322db4,[_0xa86a('0x14')])}))[_0xa86a('0x1b')](function(_0x1ba289){if(_0x1ba289){_0x1f6def[_0xa86a('0x1d')]=_0x1ba289['id'];emit(util[_0xa86a('0x1e')](_0xa86a('0x1f'),_0xdd56d8[_0xa86a('0x20')]),util['format']('trigger:%s',_0x4ef5ad['action'][_0xa86a('0x21')]()),_[_0xa86a('0x22')](_0x1f6def,{'ListId':parseInt(_0x4ef5ad[_0xa86a('0x11')],0xa)}));return;}else{return BPromise['resolve']()[_0xa86a('0x1b')](cmContactRpc[_0xa86a('0x23')](_0x322db4));}})[_0xa86a('0x1b')](function(_0x33c8aa){if(_0x33c8aa){_0x1f6def['xmd-contactid2']=_0x33c8aa['id'];emit(util['format'](_0xa86a('0x1f'),_0xdd56d8[_0xa86a('0x20')]),util[_0xa86a('0x1e')](_0xa86a('0x24'),_0x4ef5ad['action']['toLowerCase']()),_[_0xa86a('0x22')](_0x1f6def,{'ListId':parseInt(_0x4ef5ad[_0xa86a('0x11')],0xa)}));}})['catch'](function(_0x1c407a){logger[_0xa86a('0x25')](_0xa86a('0x26'),JSON[_0xa86a('0xc')](_0x1c407a));});}else{if(_0xdd56d8){emit(util[_0xa86a('0x1e')](_0xa86a('0x1f'),_0xdd56d8['name']),util[_0xa86a('0x1e')](_0xa86a('0x24'),_0x4ef5ad[_0xa86a('0x27')][_0xa86a('0x21')]()),_[_0xa86a('0x22')]({'ListId':parseInt(_0x4ef5ad['data1'],0xa)},_0x1f6def));}}}; \ No newline at end of file +var _0xc7e4=['action','toLowerCase','merge','data1','createContact','catch','error','Error\x20creating\x20contact','stringify','util','lodash','../../../../config/environment','../../../../config/logger','trigger','redis','defaults','localhost','emit','exec','autoCreate','data2','isNil','routeId','firstName','calleridname','calleridnum','destcalleridname','','destcalleridnum','uniqueid','phone','resolve','then','showContact','omit','xmd-contactid2','format','user:%s','name','trigger:%s'];(function(_0x36fd79,_0x5c2f22){var _0x1347c1=function(_0x59fb86){while(--_0x59fb86){_0x36fd79['push'](_0x36fd79['shift']());}};_0x1347c1(++_0x5c2f22);}(_0xc7e4,0xf9));var _0x4c7e=function(_0x44872a,_0x2e659d){_0x44872a=_0x44872a-0x0;var _0x13254a=_0xc7e4[_0x44872a];return _0x13254a;};'use strict';var BPromise=require('bluebird');var util=require(_0x4c7e('0x0'));var _=require(_0x4c7e('0x1'));var Redis=require('ioredis');var config=require(_0x4c7e('0x2'));var logger=require(_0x4c7e('0x3'))(_0x4c7e('0x4'));var cmContactRpc=require('../../rpc/cmContact');config[_0x4c7e('0x5')]=_[_0x4c7e('0x6')](config[_0x4c7e('0x5')],{'host':_0x4c7e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4c7e('0x5')]));function emit(_0x3125db,_0x3f74d0,_0x2e0d07){logger['info'](_0x3125db,_0x3f74d0,JSON['stringify'](_0x2e0d07));io['to'](_0x3125db)[_0x4c7e('0x8')](_0x3f74d0,_0x2e0d07);}exports[_0x4c7e('0x9')]=function(_0x465a58,_0x11ff0a,_0xebb2e7){_0xebb2e7[_0x4c7e('0xa')]=0x0;if(_0x11ff0a[_0x4c7e('0xb')]&&parseInt(_0x11ff0a[_0x4c7e('0xb')],0xa)){var _0x2aa659={'ListId':parseInt(_0x11ff0a['data1'],0xa),'phone':_0xebb2e7['calleridnum']};if(_[_0x4c7e('0xc')](_0xebb2e7[_0x4c7e('0xd')])){_0x2aa659[_0x4c7e('0xe')]=_0xebb2e7[_0x4c7e('0xf')]&&_0xebb2e7[_0x4c7e('0xf')]!==''?_0xebb2e7[_0x4c7e('0xf')]:_0xebb2e7[_0x4c7e('0x10')]||_0xebb2e7['uniqueid'];}else{_0x2aa659['firstName']=_0xebb2e7[_0x4c7e('0x11')]&&_0xebb2e7['destcalleridname']!==_0x4c7e('0x12')?_0xebb2e7['destcalleridname']:_0xebb2e7[_0x4c7e('0x13')]||_0xebb2e7[_0x4c7e('0x14')];_0x2aa659[_0x4c7e('0x15')]=_0xebb2e7[_0x4c7e('0x11')]&&_0xebb2e7[_0x4c7e('0x11')]!==''?_0xebb2e7['destcalleridname']:_0xebb2e7[_0x4c7e('0x13')]||_0xebb2e7[_0x4c7e('0x14')];}BPromise[_0x4c7e('0x16')]()[_0x4c7e('0x17')](cmContactRpc[_0x4c7e('0x18')]({'where':_[_0x4c7e('0x19')](_0x2aa659,['firstName'])}))[_0x4c7e('0x17')](function(_0x1507f7){if(_0x1507f7){_0xebb2e7[_0x4c7e('0x1a')]=_0x1507f7['id'];emit(util[_0x4c7e('0x1b')](_0x4c7e('0x1c'),_0x465a58[_0x4c7e('0x1d')]),util[_0x4c7e('0x1b')](_0x4c7e('0x1e'),_0x11ff0a[_0x4c7e('0x1f')][_0x4c7e('0x20')]()),_[_0x4c7e('0x21')](_0xebb2e7,{'ListId':parseInt(_0x11ff0a[_0x4c7e('0x22')],0xa)}));return;}else{return BPromise[_0x4c7e('0x16')]()[_0x4c7e('0x17')](cmContactRpc[_0x4c7e('0x23')](_0x2aa659));}})[_0x4c7e('0x17')](function(_0x5266d7){if(_0x5266d7){_0xebb2e7[_0x4c7e('0x1a')]=_0x5266d7['id'];emit(util['format']('user:%s',_0x465a58[_0x4c7e('0x1d')]),util[_0x4c7e('0x1b')](_0x4c7e('0x1e'),_0x11ff0a[_0x4c7e('0x1f')]['toLowerCase']()),_[_0x4c7e('0x21')](_0xebb2e7,{'ListId':parseInt(_0x11ff0a[_0x4c7e('0x22')],0xa)}));}})[_0x4c7e('0x24')](function(_0x31d9fb){logger[_0x4c7e('0x25')](_0x4c7e('0x26'),JSON[_0x4c7e('0x27')](_0x31d9fb));});}else{if(_0x465a58){emit(util['format'](_0x4c7e('0x1c'),_0x465a58[_0x4c7e('0x1d')]),util[_0x4c7e('0x1b')]('trigger:%s',_0x11ff0a['action'][_0x4c7e('0x20')]()),_[_0x4c7e('0x21')]({'ListId':parseInt(_0x11ff0a[_0x4c7e('0x22')],0xa)},_0xebb2e7));}}}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 8032556..8a3c3e2 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 _0xe9f9=['trigger:%s:%s','format','trigger:%s','exec','integration','queue','routeId','urlforward','script','buildUri','parse','query','search','checkTrigger','AllConditions','every','some','checkConditions','channel','field','account','chat','ChatWebsiteId','value','upperFirst','AccountId','interaction','message','event','operator','agent','membername','lastevent','util','url','mustache','ioredis','./urlforward','./integration','./script','../../../config/environment','../../../config/logger','../ami','defaults','redis','localhost','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','accounts','servicenowAccounts','custom:agentcalled','custom:agentconnect','syncCustomEvent','custom:agentringnoanswer','bind','custom:agentcomplete','custom:queuecallerabandon','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:closedinteraction','custom:incomingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','info','stringify','clone','checkTriggers','interface','merge','Actions','length','action','toLowerCase','contactmanager','motionbar','browser','data1','TemplateId','data2','html','render','template\x20not\x20found','uri','isNil','data3','data4','uriLocation','windowWidth','data5','800','windowHeight','data6','600','winApplication','user:%s','name'];(function(_0x1e1b8a,_0x37df03){var _0x390a6f=function(_0x1afb84){while(--_0x1afb84){_0x1e1b8a['push'](_0x1e1b8a['shift']());}};_0x390a6f(++_0x37df03);}(_0xe9f9,0x174));var _0x9e9f=function(_0x2ab5c4,_0x15816a){_0x2ab5c4=_0x2ab5c4-0x0;var _0x4e79ed=_0xe9f9[_0x2ab5c4];return _0x4e79ed;};'use strict';var util=require(_0x9e9f('0x0'));var _=require('lodash');var url=require(_0x9e9f('0x1'));var Mustache=require(_0x9e9f('0x2'));var Redis=require(_0x9e9f('0x3'));var urlforward=require(_0x9e9f('0x4'));var integration=require(_0x9e9f('0x5'));var cmContact=require('./cmContact');var script=require(_0x9e9f('0x6'));var cmContactRpc=require('../rpc/cmContact');var config=require(_0x9e9f('0x7'));var logger=require(_0x9e9f('0x8'))('trigger');var ami=require(_0x9e9f('0x9'));config['redis']=_[_0x9e9f('0xa')](config[_0x9e9f('0xb')],{'host':_0x9e9f('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9e9f('0xb')]));var operators={'equals':function(_0x3a4291,_0x2e1e8e){return _0x3a4291==_0x2e1e8e;},'not_equals':function(_0x29aebc,_0xa837dd){return _0x29aebc!=_0xa837dd;}};var barAndWebActions=[_0x9e9f('0xd'),'url',_0x9e9f('0xe')];function Trigger(_0x408a12){this[_0x9e9f('0xf')]=_0x408a12['triggers'];this[_0x9e9f('0x10')]=_0x408a12[_0x9e9f('0x10')];this[_0x9e9f('0x11')]=_0x408a12[_0x9e9f('0x11')];this[_0x9e9f('0x12')]=_0x408a12[_0x9e9f('0x12')];this[_0x9e9f('0x13')]=_0x408a12[_0x9e9f('0x13')];this[_0x9e9f('0x14')]=_0x408a12['zendeskAccounts'];this['freshdeskAccounts']=_0x408a12[_0x9e9f('0x15')];this[_0x9e9f('0x16')]=_0x408a12[_0x9e9f('0x16')];this[_0x9e9f('0x17')]=_0x408a12[_0x9e9f('0x17')];this[_0x9e9f('0x18')]=_0x408a12['zohoAccounts'];this[_0x9e9f('0x19')]=_0x408a12['deskAccounts'];this[_0x9e9f('0x1a')]=_0x408a12['vtigerAccounts'];this['servicenowAccounts']=_0x408a12['servicenowAccounts'];this[_0x9e9f('0x1b')]=_0x408a12[_0x9e9f('0x1b')];this[_0x9e9f('0x1c')]={'zendesk':this[_0x9e9f('0x14')],'salesforce':this['salesforceAccounts'],'freshdesk':this[_0x9e9f('0x15')],'sugarcrm':this[_0x9e9f('0x17')],'zoho':this[_0x9e9f('0x18')],'desk':this['deskAccounts'],'vtiger':this[_0x9e9f('0x1a')],'servicenow':this[_0x9e9f('0x1d')],'dynamics365':this[_0x9e9f('0x1b')]};ami['on'](_0x9e9f('0x1e'),this['syncCustomEvent']['bind'](this));ami['on'](_0x9e9f('0x1f'),this[_0x9e9f('0x20')]['bind'](this));ami['on'](_0x9e9f('0x21'),this[_0x9e9f('0x20')][_0x9e9f('0x22')](this));ami['on'](_0x9e9f('0x23'),this['syncCustomEvent'][_0x9e9f('0x22')](this));ami['on'](_0x9e9f('0x24'),this['syncCustomEvent']['bind'](this));ami['on'](_0x9e9f('0x25'),this[_0x9e9f('0x26')]['bind'](this));ami['on'](_0x9e9f('0x27'),this[_0x9e9f('0x26')]['bind'](this));ami['on'](_0x9e9f('0x28'),this[_0x9e9f('0x26')]['bind'](this));ami['on']('custom:newinteraction',this[_0x9e9f('0x20')][_0x9e9f('0x22')](this));ami['on'](_0x9e9f('0x29'),this[_0x9e9f('0x20')]['bind'](this));ami['on'](_0x9e9f('0x2a'),this[_0x9e9f('0x20')][_0x9e9f('0x22')](this));ami['on']('custom:outgoingmessage',this[_0x9e9f('0x20')][_0x9e9f('0x22')](this));ami['on'](_0x9e9f('0x2b'),this['syncCustomEvent'][_0x9e9f('0x22')](this));ami['on'](_0x9e9f('0x2c'),this[_0x9e9f('0x20')][_0x9e9f('0x22')](this));}Trigger[_0x9e9f('0x2d')][_0x9e9f('0x2e')]=function(_0x3b3a2a,_0x24c0f3,_0x5673c9){logger[_0x9e9f('0x2f')](_0x3b3a2a,_0x24c0f3,JSON[_0x9e9f('0x30')](_0x5673c9));io['to'](_0x3b3a2a)[_0x9e9f('0x2e')](_0x24c0f3,_0x5673c9);};Trigger[_0x9e9f('0x2d')]['syncCustomEvent']=function(_0x31d875){var _0x2f859c=_[_0x9e9f('0x31')](_0x31d875);this[_0x9e9f('0x32')](_0x2f859c);};Trigger[_0x9e9f('0x2d')][_0x9e9f('0x26')]=function(_0x303cf3){if(this[_0x9e9f('0x10')][_0x303cf3[_0x9e9f('0x33')]]){this[_0x9e9f('0x20')](_0x303cf3);}};Trigger[_0x9e9f('0x2d')][_0x9e9f('0x32')]=function(_0x26d9c0){var _0xb5c232;for(var _0x41b153 in this[_0x9e9f('0xf')]){if(this[_0x9e9f('0xf')]['hasOwnProperty'](_0x41b153)){if(this['triggers'][_0x41b153]['status']){_0xb5c232=this['checkTrigger'](this[_0x9e9f('0xf')][_0x41b153],_0x26d9c0);if(_0xb5c232){_[_0x9e9f('0x34')](_0x26d9c0,_0x26d9c0['variables']);for(var _0x1e4dbf=0x0,_0x47c854,_0xbdd5d3,_0x135278;_0x1e4dbf0x0){_0x2e953b=_[_0x13fd('0x27')](_0x28498e,_0x2b4c03);}return _0x2e953b;}function getCustomFields(_0x507313,_0x5929ca){var _0x7e9a0c=[];var _0x30b838={'custom_fields':{}};if(_0x507313[_0x13fd('0x28')]>0x0){_[_0x13fd('0x29')](_0x507313,function(_0x2269e0){if(_0x2269e0['type']===_0x13fd('0x2a')&&_0x2269e0[_0x13fd('0x2b')]&&!_0x2269e0['customField']){_0x30b838[_0x2269e0[_0x13fd('0x2b')][_0x13fd('0x2c')]()]=_0x2269e0[_0x13fd('0x2d')][_0x13fd('0x22')]();}else if(_0x2269e0[_0x13fd('0x2e')]===_0x13fd('0x2a')&&_0x2269e0['idField']&&_0x2269e0['customField']){_0x30b838['custom_fields'][_0x2269e0[_0x13fd('0x2f')]]=_0x2269e0[_0x13fd('0x2d')][_0x13fd('0x22')]();}else if(_0x2269e0[_0x13fd('0x2e')]==='variable'&&_0x2269e0[_0x13fd('0x30')]&&_0x2269e0['idField']&&_0x2269e0['customField']){_0x5929ca[_0x2269e0[_0x13fd('0x30')]]&&(_0x30b838[_0x13fd('0x31')][_0x2269e0[_0x13fd('0x2f')]]=_0x5929ca[_0x2269e0[_0x13fd('0x30')]][_0x13fd('0x22')]());}else if(_0x2269e0['type']===_0x13fd('0x32')&&_0x2269e0[_0x13fd('0x33')]&&_0x2269e0['Variable']['name']&&_0x2269e0[_0x13fd('0x2f')]&&_0x2269e0[_0x13fd('0x34')]){_0x5929ca[_0x2269e0[_0x13fd('0x33')][_0x13fd('0x35')][_0x13fd('0x2c')]()]&&(_0x30b838[_0x13fd('0x31')][_0x2269e0[_0x13fd('0x2f')]]=_0x5929ca[_0x2269e0['Variable'][_0x13fd('0x35')][_0x13fd('0x2c')]()][_0x13fd('0x22')]());}});}if(_0x30b838['priority']){_0x30b838[_0x13fd('0x36')]=Number(_0x30b838['priority']);}return _0x30b838;}function getTicket(_0x154499,_0x17752f,_0x44201b,_0x1cf101,_0x85b49){logger['info'](_0x13fd('0x37'));var _0x3d9fd6=_[_0x13fd('0x38')]({'subject':intUtil[_0x13fd('0x39')](_0x1cf101[_0x13fd('0x3a')],_0x85b49,'\x20'),'type':_0x13fd('0x3b'),'status':_0x13fd('0x3c'),'labels':['xCALLY',_0x13fd('0x3d'),_0x13fd('0x3e')][_0x13fd('0x3f')](getTags(_0x1cf101[_0x13fd('0x40')],'name')),'description':intUtil[_0x13fd('0x39')](_0x1cf101[_0x13fd('0x41')],_0x85b49,'\x0a'),'_links':{'assigned_user':{'href':util[_0x13fd('0xd')](_0x13fd('0x42'),_0x17752f['id']),'class':_0x13fd('0x43')}},'message':{'direction':'in','body':intUtil[_0x13fd('0x39')](_0x1cf101[_0x13fd('0x41')],_0x85b49,'\x0a')}},getCustomFields(_0x1cf101[_0x13fd('0x44')],_0x85b49));return request({'uri':util['format']('%s/customers/%d/cases',_0x154499[_0x13fd('0xe')],_0x44201b['id']),'method':'POST','body':_0x3d9fd6});}exports[_0x13fd('0x45')]=function(_0xec0162,_0xfc9ca,_0x207495,_0x137a22,_0x26d1c5,_0x1f20b6){var _0x36f5f3,_0x4608a1;_0x1f20b6['remoteUri']=intUtil['stripTrailingSlash'](_0x1f20b6[_0x13fd('0xe')]);_0x1f20b6['serverUrl']=intUtil[_0x13fd('0x46')](_0x1f20b6[_0x13fd('0x47')]);if(_0x26d1c5&&_0x26d1c5[_0x13fd('0x48')]){logger[_0x13fd('0xb')](_0x13fd('0x49'),_0x13fd('0x4a'));_0xfc9ca['recordingURL']=util[_0x13fd('0xd')](_0x13fd('0x4b'),_0x1f20b6[_0x13fd('0x47')],_0xfc9ca['uniqueid'],md5(_0xfc9ca[_0x13fd('0x4c')]));}else{_0xfc9ca[_0x13fd('0x4d')]='';}headers[_0x13fd('0x4e')]=getAuth(_0x1f20b6);return getUser(_0x1f20b6,_0x137a22[_0x13fd('0x4f')])[_0x13fd('0x13')](function(_0x46443b){_0x36f5f3=_0x46443b;logger[_0x13fd('0xb')](_0x13fd('0x50'),_0x36f5f3['id']);return getEndUser(_0x1f20b6,_0xfc9ca[_0x13fd('0x51')],_0xfc9ca[_0x13fd('0x52')]);})['then'](function(_0x34d737){_0x4608a1=_0x34d737;logger[_0x13fd('0xb')]('The\x20Enduser\x20ID\x20is:',_0x4608a1['id']);return getTicket(_0x1f20b6,_0x36f5f3,_0x4608a1,_0x207495,_0xfc9ca);})[_0x13fd('0x13')](function(_0x4ace74){if(_0x4ace74){logger[_0x13fd('0xb')](_0x13fd('0x53'));logger['info'](_0x13fd('0x54'),_0x4ace74['id']);switch(_0x1f20b6[_0x13fd('0x2e')]){case _0x13fd('0x55'):logger[_0x13fd('0xb')]('[QUEUE]',_0x13fd('0x56'));emit(util['format'](_0x13fd('0x57'),_0x137a22['name']),_0x13fd('0x58'),{'recordId':_0x4ace74['id']});break;case _0x13fd('0x59'):logger[_0x13fd('0xb')](_0x13fd('0x49'),_0x13fd('0x5a'));emit(util[_0x13fd('0xd')](_0x13fd('0x57'),_0x137a22[_0x13fd('0x35')]),'trigger:browser:url',{'uri':util[_0x13fd('0xd')](_0x13fd('0x5b'),_0x4ace74['id'])});break;default:logger[_0x13fd('0x5c')](_0x13fd('0x49'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x13fd('0x5d')](function(_0x41727f){console[_0x13fd('0x5c')](_0x41727f);logger[_0x13fd('0x5c')]('[QUEUE]',JSON[_0x13fd('0x19')](_0x41727f));});};exports[_0x13fd('0x5e')]=function(_0x5eb77a,_0x412ff1,_0x36e5c5,_0x1b5e74,_0x49abb4,_0x20c32f,_0x1efa8c){var _0x5b65fc,_0x37fd02;_0x20c32f[_0x13fd('0xe')]=intUtil[_0x13fd('0x46')](_0x20c32f['remoteUri']);_0x20c32f['serverUrl']=intUtil[_0x13fd('0x46')](_0x20c32f[_0x13fd('0x47')]);if(_0x1efa8c&&_0x1efa8c[_0x13fd('0x5f')]&&_0x1efa8c['recordingFormat']!==_0x13fd('0x60')){logger[_0x13fd('0xb')](_0x13fd('0x61'),_0x13fd('0x4a'));_0x412ff1[_0x13fd('0x4d')]=util[_0x13fd('0xd')](_0x13fd('0x4b'),_0x20c32f[_0x13fd('0x47')],_0x412ff1[_0x13fd('0x4c')],md5(_0x412ff1[_0x13fd('0x4c')]));}headers[_0x13fd('0x4e')]=getAuth(_0x20c32f);return getUser(_0x20c32f,_0x1b5e74[_0x13fd('0x4f')])[_0x13fd('0x13')](function(_0x4b0191){_0x5b65fc=_0x4b0191;logger[_0x13fd('0xb')](_0x13fd('0x50'),_0x5b65fc['id']);return getEndUser(_0x20c32f,_0x412ff1['destcalleridname'],_0x412ff1[_0x13fd('0x62')]);})['then'](function(_0x2ae256){_0x37fd02=_0x2ae256;logger['info']('The\x20Enduser\x20ID\x20is:',_0x37fd02['id']);return getTicket(_0x20c32f,_0x5b65fc,_0x37fd02,_0x36e5c5,_0x412ff1);})[_0x13fd('0x13')](function(_0x50666e){if(_0x50666e){logger['info'](_0x13fd('0x53'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x50666e['id']);switch(_0x20c32f[_0x13fd('0x2e')]){case _0x13fd('0x55'):logger['info'](_0x13fd('0x49'),_0x13fd('0x56'));emit(util[_0x13fd('0xd')](_0x13fd('0x57'),_0x1b5e74[_0x13fd('0x35')]),_0x13fd('0x58'),{'recordId':_0x50666e['id']});break;case'newTab':logger[_0x13fd('0xb')](_0x13fd('0x49'),_0x13fd('0x5a'));emit(util[_0x13fd('0xd')](_0x13fd('0x57'),_0x1b5e74[_0x13fd('0x35')]),_0x13fd('0x63'),{'uri':util[_0x13fd('0xd')](_0x13fd('0x64'),_0x20c32f[_0x13fd('0xe')],_0x50666e['id'])});break;default:logger[_0x13fd('0x5c')]('[OUTBOUND]','Desk\x20account\x20type\x20not\x20recognized');}}})[_0x13fd('0x5d')](function(_0x1283c7){logger[_0x13fd('0x5c')](_0x13fd('0x61'),JSON['stringify'](_0x1283c7));});};exports[_0x13fd('0x65')]=function(_0x152adc,_0x56d5ad,_0x5b3185,_0x5464d3,_0x2732b2,_0x4f83a8){var _0x2acacc,_0x2c00b4;_0x4f83a8[_0x13fd('0xe')]=intUtil[_0x13fd('0x46')](_0x4f83a8[_0x13fd('0xe')]);_0x4f83a8[_0x13fd('0x47')]=intUtil[_0x13fd('0x46')](_0x4f83a8[_0x13fd('0x47')]);if(_0x2732b2&&_0x2732b2['monitor_format']){logger[_0x13fd('0xb')](_0x13fd('0x66'),_0x13fd('0x4a'));_0x56d5ad['recordingURL']=util['format'](_0x13fd('0x4b'),_0x4f83a8[_0x13fd('0x47')],_0x56d5ad['uniqueid'],md5(_0x56d5ad[_0x13fd('0x4c')]));}else{_0x56d5ad['recordingURL']='';}headers[_0x13fd('0x4e')]=getAuth(_0x4f83a8);return getUser(_0x4f83a8)[_0x13fd('0x13')](function(_0x3eff40){_0x2acacc=_0x3eff40;logger[_0x13fd('0xb')](_0x13fd('0x50'),_0x2acacc['id']);return getEndUser(_0x4f83a8,_0x56d5ad[_0x13fd('0x51')],_0x56d5ad[_0x13fd('0x52')]);})['then'](function(_0x458dd6){_0x2c00b4=_0x458dd6;logger[_0x13fd('0xb')](_0x13fd('0x67'),_0x2c00b4['id']);return getTicket(_0x4f83a8,_0x2acacc,_0x2c00b4,_0x5b3185,_0x56d5ad);})[_0x13fd('0x13')](function(_0x4a32fc){if(_0x4a32fc){logger[_0x13fd('0xb')](_0x13fd('0x53'));logger[_0x13fd('0xb')](_0x13fd('0x54'),_0x4a32fc['id']);}})[_0x13fd('0x5d')](function(_0x3f728a){logger[_0x13fd('0x5c')]('[ABANDONED]',JSON[_0x13fd('0x19')](_0x3f728a));});}; \ No newline at end of file +var _0x42b5=['map','type','string','nameField','toLowerCase','customField','custom_fields','idField','variable','variableName','customVariable','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY','concat','Tags','/api/v2/users/%d','Descriptions','Fields','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','user:%s','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','catch','error','outbound','recordingFormat','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','trigger:desk:display','abandoned','[ABANDONED]','calleridnum','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','desk','redis','defaults','localhost','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','remoteUri','total_entries','find','entries','then','Agent\x20found!','%s/users/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','[HTTP]','stringify','GET','basic','%s:%s','username','password','authType','token','Basic\x20%s','toString','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','length'];(function(_0x301e78,_0x4ea017){var _0x2f4ce2=function(_0x37e71a){while(--_0x37e71a){_0x301e78['push'](_0x301e78['shift']());}};_0x2f4ce2(++_0x4ea017);}(_0x42b5,0x1d6));var _0x542b=function(_0x47cc74,_0x4598df){_0x47cc74=_0x47cc74-0x0;var _0xdfe813=_0x42b5[_0x47cc74];return _0xdfe813;};'use strict';var _=require(_0x542b('0x0'));var rp=require(_0x542b('0x1'));var md5=require(_0x542b('0x2'));var util=require(_0x542b('0x3'));var Redis=require(_0x542b('0x4'));var intUtil=require(_0x542b('0x5'));var config=require(_0x542b('0x6'));var logger=require(_0x542b('0x7'))(_0x542b('0x8'));config[_0x542b('0x9')]=_[_0x542b('0xa')](config[_0x542b('0x9')],{'host':_0x542b('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x542b('0x9')]));function emit(_0x782088,_0x3a9798,_0x5b0509){io['to'](_0x782088)[_0x542b('0xc')](_0x3a9798,_0x5b0509);}var headers={'Content-Type':_0x542b('0xd'),'Accept':_0x542b('0xd')};function getUser(_0x1d8f52,_0x1b774c){if(intUtil[_0x542b('0xe')](_0x1b774c)===!![]){logger[_0x542b('0xf')](_0x542b('0x10'),_0x1b774c);return request({'uri':util[_0x542b('0x11')](_0x542b('0x12'),_0x1d8f52[_0x542b('0x13')])})['then'](function(_0x22d27e){if(_0x22d27e[_0x542b('0x14')]){return _[_0x542b('0x15')](_0x22d27e['_embedded'][_0x542b('0x16')],{'email':_0x1b774c});}})[_0x542b('0x17')](function(_0x3e3052){if(_0x3e3052){logger[_0x542b('0xf')](_0x542b('0x18'));return _0x3e3052;}else{logger[_0x542b('0xf')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x542b('0x11')](_0x542b('0x19'),_0x1d8f52[_0x542b('0x13')])});}});}else{logger['info'](_0x542b('0x1a'));return request({'uri':util[_0x542b('0x11')](_0x542b('0x19'),_0x1d8f52['remoteUri'])});}}function request(_0x58e388){logger['debug'](_0x542b('0x1b'),JSON[_0x542b('0x1c')](_0x58e388));return rp(_[_0x542b('0xa')](_0x58e388,{'method':_0x542b('0x1d'),'headers':headers,'json':!![]}));}function getAuth(_0x1c5eeb){var _0x5d522d;if(_0x1c5eeb['authType']===_0x542b('0x1e')){_0x5d522d=util[_0x542b('0x11')](_0x542b('0x1f'),_0x1c5eeb[_0x542b('0x20')],_0x1c5eeb[_0x542b('0x21')]);}else if(_0x1c5eeb[_0x542b('0x22')]===_0x542b('0x23')){_0x5d522d=util['format']('%s/token:%s',_0x1c5eeb[_0x542b('0x20')],_0x1c5eeb[_0x542b('0x23')]);}return util[_0x542b('0x11')](_0x542b('0x24'),new Buffer(_0x5d522d)[_0x542b('0x25')]('base64'));}function getEndUser(_0x2c1ad5,_0x1cb9e9,_0x263d68){logger['info'](_0x542b('0x26'),_0x263d68);return request({'uri':util[_0x542b('0x11')]('%s/customers/search',_0x2c1ad5['remoteUri']),'qs':{'phone':_0x263d68}})['then'](function(_0x3ee86b){if(_0x3ee86b[_0x542b('0x14')]){logger[_0x542b('0xf')](_0x542b('0x27'));return _0x3ee86b['_embedded'][_0x542b('0x16')][0x0];}else{logger[_0x542b('0xf')](_0x542b('0x28'));return request({'uri':util[_0x542b('0x11')](_0x542b('0x29'),_0x2c1ad5[_0x542b('0x13')]),'method':_0x542b('0x2a'),'body':{'first_name':_0x1cb9e9,'title':_0x1cb9e9,'phone_numbers':[{'type':_0x542b('0x2b'),'value':_0x263d68}]}});}});}function getTags(_0x2fa4a7,_0x2ebd61){var _0x3492de=[];if(_0x2fa4a7&&_0x2fa4a7[_0x542b('0x2c')]>0x0){_0x3492de=_[_0x542b('0x2d')](_0x2fa4a7,_0x2ebd61);}return _0x3492de;}function getCustomFields(_0x92f12,_0x4ce861){var _0x358a17=[];var _0x5e32da={'custom_fields':{}};if(_0x92f12[_0x542b('0x2c')]>0x0){_['forEach'](_0x92f12,function(_0x1bb4ae){if(_0x1bb4ae[_0x542b('0x2e')]===_0x542b('0x2f')&&_0x1bb4ae[_0x542b('0x30')]&&!_0x1bb4ae['customField']){_0x5e32da[_0x1bb4ae['nameField'][_0x542b('0x31')]()]=_0x1bb4ae['content']['toString']();}else if(_0x1bb4ae[_0x542b('0x2e')]==='string'&&_0x1bb4ae['idField']&&_0x1bb4ae[_0x542b('0x32')]){_0x5e32da[_0x542b('0x33')][_0x1bb4ae[_0x542b('0x34')]]=_0x1bb4ae['content'][_0x542b('0x25')]();}else if(_0x1bb4ae[_0x542b('0x2e')]===_0x542b('0x35')&&_0x1bb4ae[_0x542b('0x36')]&&_0x1bb4ae['idField']&&_0x1bb4ae['customField']){_0x4ce861[_0x1bb4ae[_0x542b('0x36')]]&&(_0x5e32da[_0x542b('0x33')][_0x1bb4ae[_0x542b('0x34')]]=_0x4ce861[_0x1bb4ae[_0x542b('0x36')]]['toString']());}else if(_0x1bb4ae['type']===_0x542b('0x37')&&_0x1bb4ae[_0x542b('0x38')]&&_0x1bb4ae[_0x542b('0x38')]['name']&&_0x1bb4ae['idField']&&_0x1bb4ae[_0x542b('0x32')]){_0x4ce861[_0x1bb4ae[_0x542b('0x38')][_0x542b('0x39')][_0x542b('0x31')]()]&&(_0x5e32da[_0x542b('0x33')][_0x1bb4ae[_0x542b('0x34')]]=_0x4ce861[_0x1bb4ae[_0x542b('0x38')][_0x542b('0x39')][_0x542b('0x31')]()]['toString']());}});}if(_0x5e32da[_0x542b('0x3a')]){_0x5e32da['priority']=Number(_0x5e32da[_0x542b('0x3a')]);}return _0x5e32da;}function getTicket(_0x22e45a,_0xf60249,_0x227052,_0x215f7e,_0x137a22){logger[_0x542b('0xf')](_0x542b('0x3b'));var _0x11ffce=_[_0x542b('0x3c')]({'subject':intUtil[_0x542b('0x3d')](_0x215f7e[_0x542b('0x3e')],_0x137a22,'\x20'),'type':_0x542b('0x3f'),'status':_0x542b('0x40'),'labels':[_0x542b('0x41'),'Motion','CTI'][_0x542b('0x42')](getTags(_0x215f7e[_0x542b('0x43')],'name')),'description':intUtil[_0x542b('0x3d')](_0x215f7e['Descriptions'],_0x137a22,'\x0a'),'_links':{'assigned_user':{'href':util[_0x542b('0x11')](_0x542b('0x44'),_0xf60249['id']),'class':'user'}},'message':{'direction':'in','body':intUtil[_0x542b('0x3d')](_0x215f7e[_0x542b('0x45')],_0x137a22,'\x0a')}},getCustomFields(_0x215f7e[_0x542b('0x46')],_0x137a22));return request({'uri':util[_0x542b('0x11')]('%s/customers/%d/cases',_0x22e45a['remoteUri'],_0x227052['id']),'method':_0x542b('0x2a'),'body':_0x11ffce});}exports[_0x542b('0x47')]=function(_0x1ec74b,_0x1892d2,_0x3c9a33,_0x5d58ab,_0xd1f837,_0x2d7d59){var _0x5a623c,_0x54441f;_0x2d7d59['remoteUri']=intUtil[_0x542b('0x48')](_0x2d7d59[_0x542b('0x13')]);_0x2d7d59['serverUrl']=intUtil[_0x542b('0x48')](_0x2d7d59[_0x542b('0x49')]);if(_0xd1f837&&_0xd1f837[_0x542b('0x4a')]){logger['info'](_0x542b('0x4b'),_0x542b('0x4c'));_0x1892d2[_0x542b('0x4d')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2d7d59[_0x542b('0x49')],_0x1892d2['uniqueid'],md5(_0x1892d2['uniqueid']));}else{_0x1892d2['recordingURL']='';}headers[_0x542b('0x4e')]=getAuth(_0x2d7d59);return getUser(_0x2d7d59,_0x5d58ab[_0x542b('0x4f')])[_0x542b('0x17')](function(_0x4b5ec9){_0x5a623c=_0x4b5ec9;logger[_0x542b('0xf')](_0x542b('0x50'),_0x5a623c['id']);return getEndUser(_0x2d7d59,_0x1892d2[_0x542b('0x51')],_0x1892d2['calleridnum']);})['then'](function(_0x3aa2ca){_0x54441f=_0x3aa2ca;logger[_0x542b('0xf')](_0x542b('0x52'),_0x54441f['id']);return getTicket(_0x2d7d59,_0x5a623c,_0x54441f,_0x3c9a33,_0x1892d2);})['then'](function(_0x16142b){if(_0x16142b){logger[_0x542b('0xf')](_0x542b('0x53'));logger[_0x542b('0xf')](_0x542b('0x54'),_0x16142b['id']);switch(_0x2d7d59[_0x542b('0x2e')]){case _0x542b('0x55'):logger[_0x542b('0xf')](_0x542b('0x4b'),_0x542b('0x56'));emit(util[_0x542b('0x11')](_0x542b('0x57'),_0x5d58ab[_0x542b('0x39')]),'trigger:desk:display',{'recordId':_0x16142b['id']});break;case _0x542b('0x58'):logger[_0x542b('0xf')](_0x542b('0x4b'),_0x542b('0x59'));emit(util[_0x542b('0x11')]('user:%s',_0x5d58ab[_0x542b('0x39')]),_0x542b('0x5a'),{'uri':util[_0x542b('0x11')](_0x542b('0x5b'),_0x16142b['id'])});break;default:logger['error'](_0x542b('0x4b'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x542b('0x5c')](function(_0x3a711e){console[_0x542b('0x5d')](_0x3a711e);logger[_0x542b('0x5d')](_0x542b('0x4b'),JSON[_0x542b('0x1c')](_0x3a711e));});};exports[_0x542b('0x5e')]=function(_0x58fe13,_0x4c5004,_0x20ae40,_0x24d226,_0x4ee83f,_0x1eaab1,_0x4f6244){var _0x4ac942,_0x4d7045;_0x1eaab1['remoteUri']=intUtil[_0x542b('0x48')](_0x1eaab1['remoteUri']);_0x1eaab1[_0x542b('0x49')]=intUtil[_0x542b('0x48')](_0x1eaab1[_0x542b('0x49')]);if(_0x4f6244&&_0x4f6244[_0x542b('0x5f')]&&_0x4f6244[_0x542b('0x5f')]!=='none'){logger[_0x542b('0xf')](_0x542b('0x60'),_0x542b('0x4c'));_0x4c5004[_0x542b('0x4d')]=util['format'](_0x542b('0x61'),_0x1eaab1[_0x542b('0x49')],_0x4c5004[_0x542b('0x62')],md5(_0x4c5004[_0x542b('0x62')]));}headers['Authorization']=getAuth(_0x1eaab1);return getUser(_0x1eaab1,_0x24d226[_0x542b('0x4f')])[_0x542b('0x17')](function(_0x44cb30){_0x4ac942=_0x44cb30;logger[_0x542b('0xf')]('The\x20User\x20ID\x20is:',_0x4ac942['id']);return getEndUser(_0x1eaab1,_0x4c5004['destcalleridname'],_0x4c5004['destcalleridnum']);})[_0x542b('0x17')](function(_0x1bbaab){_0x4d7045=_0x1bbaab;logger['info'](_0x542b('0x52'),_0x4d7045['id']);return getTicket(_0x1eaab1,_0x4ac942,_0x4d7045,_0x20ae40,_0x4c5004);})['then'](function(_0x198e82){if(_0x198e82){logger['info'](_0x542b('0x53'));logger[_0x542b('0xf')](_0x542b('0x54'),_0x198e82['id']);switch(_0x1eaab1['type']){case'integrationTab':logger[_0x542b('0xf')](_0x542b('0x4b'),_0x542b('0x56'));emit(util['format']('user:%s',_0x24d226[_0x542b('0x39')]),_0x542b('0x63'),{'recordId':_0x198e82['id']});break;case'newTab':logger[_0x542b('0xf')](_0x542b('0x4b'),_0x542b('0x59'));emit(util[_0x542b('0x11')](_0x542b('0x57'),_0x24d226[_0x542b('0x39')]),_0x542b('0x5a'),{'uri':util[_0x542b('0x11')]('%s/agent/tickets/%s',_0x1eaab1[_0x542b('0x13')],_0x198e82['id'])});break;default:logger[_0x542b('0x5d')](_0x542b('0x60'),'Desk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x279369){logger[_0x542b('0x5d')]('[OUTBOUND]',JSON['stringify'](_0x279369));});};exports[_0x542b('0x64')]=function(_0x11dd31,_0x1c32b9,_0x39da14,_0x4ff175,_0x13144b,_0xfba714){var _0x2b8a4f,_0x428ecb;_0xfba714['remoteUri']=intUtil[_0x542b('0x48')](_0xfba714['remoteUri']);_0xfba714[_0x542b('0x49')]=intUtil[_0x542b('0x48')](_0xfba714[_0x542b('0x49')]);if(_0x13144b&&_0x13144b['monitor_format']){logger[_0x542b('0xf')](_0x542b('0x65'),_0x542b('0x4c'));_0x1c32b9[_0x542b('0x4d')]=util[_0x542b('0x11')](_0x542b('0x61'),_0xfba714[_0x542b('0x49')],_0x1c32b9['uniqueid'],md5(_0x1c32b9[_0x542b('0x62')]));}else{_0x1c32b9['recordingURL']='';}headers['Authorization']=getAuth(_0xfba714);return getUser(_0xfba714)['then'](function(_0x5b81bf){_0x2b8a4f=_0x5b81bf;logger[_0x542b('0xf')](_0x542b('0x50'),_0x2b8a4f['id']);return getEndUser(_0xfba714,_0x1c32b9[_0x542b('0x51')],_0x1c32b9[_0x542b('0x66')]);})[_0x542b('0x17')](function(_0xe43cbd){_0x428ecb=_0xe43cbd;logger[_0x542b('0xf')]('The\x20Enduser\x20ID\x20is:',_0x428ecb['id']);return getTicket(_0xfba714,_0x2b8a4f,_0x428ecb,_0x39da14,_0x1c32b9);})[_0x542b('0x17')](function(_0xf86a51){if(_0xf86a51){logger[_0x542b('0xf')](_0x542b('0x53'));logger[_0x542b('0xf')]('The\x20Ticket\x20ID\x20is:',_0xf86a51['id']);}})[_0x542b('0x5c')](function(_0x3d0015){logger[_0x542b('0x5d')](_0x542b('0x65'),JSON[_0x542b('0x1c')](_0x3d0015));});}; \ 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 9746231..5b285c4 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 _0xa9c6=['remoteUri','serverUrl','abandoned','%s/api/data/v9.0/','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL',']\x20The\x20User\x20email\x20is:','userEmail',']\x20The\x20Enduser\x20ID\x20is:',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','error',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','request-promise','util','./util','ioredis','../../../../config/logger','../../../../config/environment','redis','defaults','socket.io-emitter','POST','clientId','username','password','clientSecret','then','catch','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','validateEmail','email','length','internalemailaddress','isdisabled','systemuserid','userId','info','toLowerCase','outbound','calleridnum','contacts','/systemusers(','headers','odata-entityid','lastIndexOf','contacts?$select=telephone1','destcalleridnum','telephone1','contactid',']\x20Enduser\x20created!','enduserId',']\x20Enduser\x20Created!','forEach','type','string','nameField','customField','idField','substring','indexOf','content','incident','incidents','getString','Subjects','Descriptions','Fields','ticketType','phonecall','phonecalls','assign','queue','callDirection','/contacts(','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','trigger:browser:url'];(function(_0x2b8d15,_0x391291){var _0x35bf42=function(_0x3530e7){while(--_0x3530e7){_0x2b8d15['push'](_0x2b8d15['shift']());}};_0x35bf42(++_0x391291);}(_0xa9c6,0x140));var _0x6a9c=function(_0x49e132,_0xaf827a){_0x49e132=_0x49e132-0x0;var _0x6403c2=_0xa9c6[_0x49e132];return _0x6403c2;};'use strict';var _=require(_0x6a9c('0x0'));var BPromise=require(_0x6a9c('0x1'));var rp=require(_0x6a9c('0x2'));var util=require(_0x6a9c('0x3'));var intUtil=require(_0x6a9c('0x4'));var md5=require('md5');var Redis=require(_0x6a9c('0x5'));var logger=require(_0x6a9c('0x6'))('dynamics365');var config=require(_0x6a9c('0x7'));config[_0x6a9c('0x8')]=_[_0x6a9c('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x6a9c('0xa'))(new Redis(config[_0x6a9c('0x8')]));function getAuthToken(_0x2bb8cc,_0x7e802,_0x56f51a){var _0x42556c={'method':_0x6a9c('0xb'),'uri':_0x7e802,'form':{'client_id':_0x2bb8cc[_0x6a9c('0xc')],'resource':_0x2bb8cc['remoteUri'],'username':_0x2bb8cc[_0x6a9c('0xd')],'password':_0x2bb8cc[_0x6a9c('0xe')],'grant_type':'password','client_secret':_0x2bb8cc[_0x6a9c('0xf')]},'json':!![]};return rp(_0x42556c)[_0x6a9c('0x10')](function(_0x41358a){return _0x41358a['access_token'];})[_0x6a9c('0x11')](function(_0x8c3ddd){logger['error']('['+[_0x56f51a[_0x6a9c('0x12')]()]+_0x6a9c('0x13'));return _0x8c3ddd[_0x6a9c('0x14')];});}function getUser(_0x56afe7,_0x2f4821,_0x518e5c,_0x4fe35d,_0x40400a,_0xb45711){return new BPromise(function(_0x5457bb,_0x2b83a8){return getAuthToken(_0x2f4821,_0x4fe35d,_0xb45711)[_0x6a9c('0x10')](function(_0x546737){var _0x32f7a7={'method':_0x6a9c('0x15'),'uri':_0x40400a+_0x6a9c('0x16'),'headers':{'Authorization':_0x6a9c('0x17')+_0x546737,'OData-Version':_0x6a9c('0x18')},'json':!![]};return rp(_0x32f7a7);})[_0x6a9c('0x10')](function(_0x2613f7){var _0x1fceb0=_0x2613f7[_0x6a9c('0x19')];var _0x5a5acb=![];var _0xd569e0=null;if(!_['isNil'](_0x518e5c)){if(intUtil[_0x6a9c('0x1a')](_0x518e5c[_0x6a9c('0x1b')])){_0x56afe7['userEmail']=_0x518e5c['email'];for(_0xd569e0=0x0;_0xd569e0<_0x1fceb0[_0x6a9c('0x1c')];_0xd569e0++){if(_0x1fceb0[_0xd569e0][_0x6a9c('0x1d')]===_0x518e5c[_0x6a9c('0x1b')]&&!_0x1fceb0[_0xd569e0][_0x6a9c('0x1e')]){_0x5a5acb=!![];logger['info']('['+[_0xb45711['toUpperCase']()]+']\x20Agent\x20found\x20'+_0x1fceb0[_0xd569e0][_0x6a9c('0x1f')]+'!');_0x56afe7[_0x6a9c('0x20')]=_0x1fceb0[_0xd569e0][_0x6a9c('0x1f')];}}}}if(!_0x5a5acb){logger[_0x6a9c('0x21')]('['+[_0xb45711[_0x6a9c('0x12')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x56afe7['userEmail']=_0x2f4821[_0x6a9c('0xd')];for(_0xd569e0=0x0;_0xd569e0<_0x1fceb0[_0x6a9c('0x1c')];_0xd569e0++){if(_0x1fceb0[_0xd569e0][_0x6a9c('0x1d')]===_0x2f4821[_0x6a9c('0xd')]){_0x56afe7[_0x6a9c('0x20')]=_0x1fceb0[_0xd569e0][_0x6a9c('0x1f')];}}}_0x5457bb(_0x56afe7);})[_0x6a9c('0x11')](function(_0x2c9ebc){_0x2b83a8(_0x2c9ebc['message']);});});}function createEndUser(_0x437988,_0x5d51ab,_0xd34bda,_0x5897a4,_0x1493bb,_0x526eaf){return new BPromise(function(_0x34ec09,_0x23b54b){return getAuthToken(_0x5d51ab,_0xd34bda,_0x526eaf)[_0x6a9c('0x10')](function(_0x3fe781){var _0x18e7b1=_0x526eaf[_0x6a9c('0x22')]()===_0x6a9c('0x23')?_0x1493bb['destcalleridnum']:_0x1493bb[_0x6a9c('0x24')];var _0x4e9ff4={'method':_0x6a9c('0xb'),'uri':_0x5897a4+_0x6a9c('0x25'),'body':{'telephone1':_0x18e7b1,'fullname':_0x18e7b1,'firstname':_0x18e7b1,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x6a9c('0x26')+_0x437988[_0x6a9c('0x20')]+')'},'headers':{'Authorization':_0x6a9c('0x17')+_0x3fe781,'OData-Version':_0x6a9c('0x18')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x4e9ff4);})[_0x6a9c('0x10')](function(_0x360ff6){var _0x39603c=_0x360ff6[_0x6a9c('0x27')][_0x6a9c('0x28')];var _0x5cff00=_0x39603c['substring'](_0x39603c[_0x6a9c('0x29')]('(')+0x1,_0x39603c['lastIndexOf'](')'));_0x437988['enduserId']=_0x5cff00;_0x34ec09(_0x437988);})['catch'](function(_0x165a91){_0x23b54b(_0x165a91[_0x6a9c('0x14')]);});});}function getEndUser(_0x59faea,_0x51883b,_0x5afe3b,_0x1d3e3a,_0x35c2bd,_0x1865e1){return new BPromise(function(_0x123c94,_0xff0c5a){return getAuthToken(_0x51883b,_0x5afe3b,_0x1865e1)[_0x6a9c('0x10')](function(_0x14d4e6){var _0x47efec={'method':_0x6a9c('0x15'),'uri':_0x1d3e3a+_0x6a9c('0x2a'),'headers':{'Authorization':_0x6a9c('0x17')+_0x14d4e6,'If-None-Match':null,'OData-Version':_0x6a9c('0x18')},'json':!![]};return rp(_0x47efec);})[_0x6a9c('0x10')](function(_0xfd99ce){var _0x2f44c5=null;if(_0xfd99ce){var _0x15063a=_0xfd99ce[_0x6a9c('0x19')];var _0x5c1755=![];for(_0x2f44c5=0x0;_0x2f44c5<_0x15063a[_0x6a9c('0x1c')];_0x2f44c5++){var _0x13bcc0=_0x1865e1[_0x6a9c('0x22')]()===_0x6a9c('0x23')?_0x35c2bd[_0x6a9c('0x2b')]:_0x35c2bd[_0x6a9c('0x24')];if(_0x15063a[_0x2f44c5][_0x6a9c('0x2c')]===_0x13bcc0){_0x5c1755=!![];_0x59faea['enduserId']=_0x15063a[_0x2f44c5][_0x6a9c('0x2d')];}}if(_0x5c1755){_0x123c94(_0x59faea);}else{return createEndUser(_0x59faea,_0x51883b,_0x5afe3b,_0x1d3e3a,_0x35c2bd,_0x1865e1)[_0x6a9c('0x10')](function(_0x392782){logger[_0x6a9c('0x21')]('['+[_0x1865e1['toUpperCase']()]+_0x6a9c('0x2e'),_0x392782[_0x6a9c('0x2f')]);_0x123c94(_0x392782);});}}else{return createEndUser(_0x59faea,_0x51883b,_0x5afe3b,_0x1d3e3a,_0x35c2bd,_0x1865e1)[_0x6a9c('0x10')](function(_0x1455a0){logger['info']('['+[_0x1865e1[_0x6a9c('0x12')]()]+_0x6a9c('0x30'),_0x1455a0[_0x6a9c('0x2f')]);_0x123c94(_0x1455a0);});}});});}function getCustomFields(_0x1839f1,_0x3d0d12,_0xe3e981){var _0x4ea8a3={};if(_0x1839f1[_0x6a9c('0x1c')]>0x0){_[_0x6a9c('0x31')](_0x1839f1,function(_0x1d6701){if(_0x1d6701[_0x6a9c('0x32')]===_0x6a9c('0x33')&&_0x1d6701[_0x6a9c('0x34')]&&!_0x1d6701[_0x6a9c('0x35')]){var _0xdb70b=_0x1d6701[_0x6a9c('0x36')][_0x6a9c('0x22')]();var _0x860954=_0xdb70b[_0x6a9c('0x37')](0x0,_0xdb70b[_0x6a9c('0x38')]('_'));var _0x151086=_0xdb70b[_0x6a9c('0x37')](_0xdb70b[_0x6a9c('0x38')]('_')+0x1);if(_0x860954===_0xe3e981){_0x4ea8a3[_0x151086]=_0x1d6701[_0x6a9c('0x39')];}}});}return _0x4ea8a3;}function getTicket(_0x3b45bb,_0x240f20,_0x2507ba,_0x433b1f,_0x2f51d2,_0x5921db,_0x2ecded){return new BPromise(function(_0x1c60d2,_0x35ff5e){var _0x3bceab;return getAuthToken(_0x240f20,_0x2507ba,_0x2ecded)[_0x6a9c('0x10')](function(_0x1d4988){if(_0x5921db['ticketType']===_0x6a9c('0x3a')){_0x3bceab={'method':_0x6a9c('0xb'),'uri':_0x433b1f+_0x6a9c('0x3b'),'body':Object['assign']({},{'title':intUtil[_0x6a9c('0x3c')](_0x5921db[_0x6a9c('0x3d')],_0x2f51d2,'\x20'),'description':intUtil['getString'](_0x5921db[_0x6a9c('0x3e')],_0x2f51d2,'\x0a'),'customerid_contact@odata.bind':'/contacts('+_0x3b45bb[_0x6a9c('0x2f')]+')','ownerid@odata.bind':_0x6a9c('0x26')+_0x3b45bb[_0x6a9c('0x20')]+')','caseorigincode':'1'},getCustomFields(_0x5921db[_0x6a9c('0x3f')],_0x2f51d2,_0x5921db[_0x6a9c('0x40')])),'headers':{'Authorization':_0x6a9c('0x17')+_0x1d4988,'OData-Version':_0x6a9c('0x18')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x5921db[_0x6a9c('0x40')]===_0x6a9c('0x41')){_0x3bceab={'method':'POST','uri':_0x433b1f+_0x6a9c('0x42'),'body':Object[_0x6a9c('0x43')]({},{'subject':intUtil['getString'](_0x5921db['Subjects'],_0x2f51d2,'\x20'),'phonenumber':String(_0x2f51d2[_0x6a9c('0x24')]),'description':intUtil[_0x6a9c('0x3c')](_0x5921db[_0x6a9c('0x3e')],_0x2f51d2,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0x3b45bb[_0x6a9c('0x2f')]+')','ownerid@odata.bind':_0x6a9c('0x26')+_0x3b45bb[_0x6a9c('0x20')]+')','directioncode':_0x3b45bb['callDirection']===_0x6a9c('0x44')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x6a9c('0x26')+_0x3b45bb[_0x6a9c('0x20')]+')','participationtypemask':_0x3b45bb[_0x6a9c('0x45')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x6a9c('0x46')+_0x3b45bb[_0x6a9c('0x2f')]+')','participationtypemask':_0x3b45bb[_0x6a9c('0x45')]==='queue'?0x1:0x2}]},getCustomFields(_0x5921db[_0x6a9c('0x3f')],_0x2f51d2,_0x5921db[_0x6a9c('0x40')])),'headers':{'Authorization':_0x6a9c('0x17')+_0x1d4988,'OData-Version':_0x6a9c('0x18')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x3bceab);})[_0x6a9c('0x10')](function(_0x54267d){var _0x5a719f=_0x54267d[_0x6a9c('0x27')]['odata-entityid'];var _0x5918bd=_0x5a719f['substring'](_0x5a719f[_0x6a9c('0x29')]('(')+0x1,_0x5a719f[_0x6a9c('0x29')](')'));_0x3b45bb[_0x6a9c('0x47')]=_0x5918bd;_0x1c60d2(_0x3b45bb);})[_0x6a9c('0x11')](function(_0x53fb31){_0x35ff5e(_0x53fb31[_0x6a9c('0x14')]);});});}function emit(_0x3f956a,_0x15db16,_0x4397da,_0x4d3838){var _0x2d72c0={'uri':util[_0x6a9c('0x48')](_0x6a9c('0x49'),_0x3f956a,_0x4397da,_0x4d3838)};io['to'](util[_0x6a9c('0x48')](_0x6a9c('0x4a'),_0x15db16))['emit'](_0x6a9c('0x4b'),_0x2d72c0);}exports['cs']=function(_0x84819b,_0x17cbe5,_0x722b69,_0x5851be,_0x14d2e9,_0x8f9dfa,_0x18f058,_0x5ee47f){var _0x17a0ba={};_0x8f9dfa['remoteUri']=intUtil['stripTrailingSlash'](_0x8f9dfa[_0x6a9c('0x4c')]);_0x8f9dfa[_0x6a9c('0x4d')]=intUtil['stripTrailingSlash'](_0x8f9dfa[_0x6a9c('0x4d')]);_0x17a0ba['callDirection']=_0x5ee47f===_0x6a9c('0x44')||_0x5ee47f===_0x6a9c('0x4e')?_0x6a9c('0x44'):_0x6a9c('0x23');var _0x49e14b=util['format'](_0x6a9c('0x4f'),_0x8f9dfa['remoteUri']);var _0x2f108a=util[_0x6a9c('0x48')]('https://login.microsoftonline.com/%s/oauth2/token',_0x8f9dfa[_0x6a9c('0x50')]);var _0x4f5fb5=util['format'](_0x6a9c('0x51'),_0x8f9dfa['serverUrl'],_0x17cbe5[_0x6a9c('0x52')],md5(_0x17cbe5[_0x6a9c('0x52')]));if(_0x14d2e9&&_0x14d2e9[_0x6a9c('0x53')]){logger[_0x6a9c('0x21')](_0x6a9c('0x54'),_0x6a9c('0x55'));_0x17cbe5['recordingURL']=_0x4f5fb5;}else if(_0x18f058&&_0x18f058[_0x6a9c('0x56')]&&_0x18f058[_0x6a9c('0x56')]!==_0x6a9c('0x57')){logger[_0x6a9c('0x21')](_0x6a9c('0x58'),_0x6a9c('0x55'));_0x17cbe5[_0x6a9c('0x59')]=_0x4f5fb5;}else{_0x17cbe5[_0x6a9c('0x59')]='';}return getUser(_0x17a0ba,_0x8f9dfa,_0x5851be,_0x2f108a,_0x49e14b,_0x5ee47f)[_0x6a9c('0x10')](function(_0x4feb20){logger[_0x6a9c('0x21')]('['+_0x5ee47f[_0x6a9c('0x12')]()+']\x20The\x20User\x20ID\x20is:',_0x4feb20['userId']);logger[_0x6a9c('0x21')]('['+_0x5ee47f['toUpperCase']()+_0x6a9c('0x5a'),_0x4feb20[_0x6a9c('0x5b')]);return getEndUser(_0x4feb20,_0x8f9dfa,_0x2f108a,_0x49e14b,_0x17cbe5,_0x5ee47f);})[_0x6a9c('0x10')](function(_0x4fcf8a){logger[_0x6a9c('0x21')]('['+_0x5ee47f[_0x6a9c('0x12')]()+_0x6a9c('0x5c'),_0x4fcf8a['enduserId']);logger[_0x6a9c('0x21')]('['+_0x5ee47f[_0x6a9c('0x12')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x17cbe5['calleridnum']);return getTicket(_0x4fcf8a,_0x8f9dfa,_0x2f108a,_0x49e14b,_0x17cbe5,_0x722b69,_0x5ee47f);})[_0x6a9c('0x10')](function(_0x258023){logger[_0x6a9c('0x21')](util[_0x6a9c('0x48')]('['+_0x5ee47f['toUpperCase']()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x722b69[_0x6a9c('0x40')],_0x258023[_0x6a9c('0x47')]));logger[_0x6a9c('0x21')](util['format']('['+_0x5ee47f[_0x6a9c('0x12')]()+_0x6a9c('0x5d'),_0x5ee47f));if(_0x5ee47f!==_0x6a9c('0x4e')){logger[_0x6a9c('0x21')]('['+_0x5ee47f[_0x6a9c('0x12')]()+']',_0x6a9c('0x5e'));emit(_0x8f9dfa[_0x6a9c('0x4c')],_0x5851be[_0x6a9c('0x5f')],_0x722b69[_0x6a9c('0x40')],_0x258023['ticketId']);}})[_0x6a9c('0x11')](function(_0x140da1){logger[_0x6a9c('0x60')]('['+_0x5ee47f[_0x6a9c('0x12')]()+_0x6a9c('0x61'),util[_0x6a9c('0x62')](_0x140da1,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x2285=['username','password','clientSecret','then','catch','error','toUpperCase','message','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','userEmail','length','internalemailaddress','email','info',']\x20Agent\x20found\x20','systemuserid','userId','toLowerCase','destcalleridnum','calleridnum','contacts','odata-entityid','lastIndexOf','GET','contacts?$select=telephone1','outbound','telephone1',']\x20Enduser\x20Created!','enduserId','type','string','nameField','customField','idField','substring','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','/systemusers(','Fields','phonecall','phonecalls','callDirection','queue','headers','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','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','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','bluebird','request-promise','util','./util','md5','../../../../config/logger','dynamics365','redis','defaults','socket.io-emitter','POST','clientId','remoteUri'];(function(_0x3d7022,_0x59dfd5){var _0x40870b=function(_0x20c643){while(--_0x20c643){_0x3d7022['push'](_0x3d7022['shift']());}};_0x40870b(++_0x59dfd5);}(_0x2285,0x177));var _0x5228=function(_0x38f436,_0x414324){_0x38f436=_0x38f436-0x0;var _0x43147b=_0x2285[_0x38f436];return _0x43147b;};'use strict';var _=require('lodash');var BPromise=require(_0x5228('0x0'));var rp=require(_0x5228('0x1'));var util=require(_0x5228('0x2'));var intUtil=require(_0x5228('0x3'));var md5=require(_0x5228('0x4'));var Redis=require('ioredis');var logger=require(_0x5228('0x5'))(_0x5228('0x6'));var config=require('../../../../config/environment');config[_0x5228('0x7')]=_[_0x5228('0x8')](config[_0x5228('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x5228('0x9'))(new Redis(config[_0x5228('0x7')]));function getAuthToken(_0x192393,_0x322b86,_0x81c9c6){var _0x7fe3f0={'method':_0x5228('0xa'),'uri':_0x322b86,'form':{'client_id':_0x192393[_0x5228('0xb')],'resource':_0x192393[_0x5228('0xc')],'username':_0x192393[_0x5228('0xd')],'password':_0x192393['password'],'grant_type':_0x5228('0xe'),'client_secret':_0x192393[_0x5228('0xf')]},'json':!![]};return rp(_0x7fe3f0)[_0x5228('0x10')](function(_0x128f28){return _0x128f28['access_token'];})[_0x5228('0x11')](function(_0x313fcb){logger[_0x5228('0x12')]('['+[_0x81c9c6[_0x5228('0x13')]()]+']\x20Wrong\x20credentials!');return _0x313fcb[_0x5228('0x14')];});}function getUser(_0x1386a2,_0x1d2ed9,_0x16274a,_0x19c075,_0x530f36,_0x4d74d7){return new BPromise(function(_0x11efcb,_0x3711dc){return getAuthToken(_0x1d2ed9,_0x19c075,_0x4d74d7)['then'](function(_0xa4aab9){var _0x271e3b={'method':'GET','uri':_0x530f36+_0x5228('0x15'),'headers':{'Authorization':_0x5228('0x16')+_0xa4aab9,'OData-Version':_0x5228('0x17')},'json':!![]};return rp(_0x271e3b);})[_0x5228('0x10')](function(_0x5ebf0c){var _0x3191ea=_0x5ebf0c[_0x5228('0x18')];var _0x5c9abd=![];var _0x41b812=null;if(!_[_0x5228('0x19')](_0x16274a)){if(intUtil[_0x5228('0x1a')](_0x16274a['email'])){_0x1386a2[_0x5228('0x1b')]=_0x16274a['email'];for(_0x41b812=0x0;_0x41b812<_0x3191ea[_0x5228('0x1c')];_0x41b812++){if(_0x3191ea[_0x41b812][_0x5228('0x1d')]===_0x16274a[_0x5228('0x1e')]&&!_0x3191ea[_0x41b812]['isdisabled']){_0x5c9abd=!![];logger[_0x5228('0x1f')]('['+[_0x4d74d7[_0x5228('0x13')]()]+_0x5228('0x20')+_0x3191ea[_0x41b812][_0x5228('0x21')]+'!');_0x1386a2['userId']=_0x3191ea[_0x41b812]['systemuserid'];}}}}if(!_0x5c9abd){logger[_0x5228('0x1f')]('['+[_0x4d74d7[_0x5228('0x13')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x1386a2[_0x5228('0x1b')]=_0x1d2ed9[_0x5228('0xd')];for(_0x41b812=0x0;_0x41b812<_0x3191ea[_0x5228('0x1c')];_0x41b812++){if(_0x3191ea[_0x41b812][_0x5228('0x1d')]===_0x1d2ed9[_0x5228('0xd')]){_0x1386a2[_0x5228('0x22')]=_0x3191ea[_0x41b812][_0x5228('0x21')];}}}_0x11efcb(_0x1386a2);})['catch'](function(_0xe8d11f){_0x3711dc(_0xe8d11f['message']);});});}function createEndUser(_0x253207,_0x3f587d,_0x4bb5eb,_0x594edf,_0x53cb40,_0xfc158e){return new BPromise(function(_0x9db71e,_0x204617){return getAuthToken(_0x3f587d,_0x4bb5eb,_0xfc158e)['then'](function(_0x1c1707){var _0x3a5d5d=_0xfc158e[_0x5228('0x23')]()==='outbound'?_0x53cb40[_0x5228('0x24')]:_0x53cb40[_0x5228('0x25')];var _0x3e2561={'method':_0x5228('0xa'),'uri':_0x594edf+_0x5228('0x26'),'body':{'telephone1':_0x3a5d5d,'fullname':_0x3a5d5d,'firstname':_0x3a5d5d,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x253207[_0x5228('0x22')]+')'},'headers':{'Authorization':_0x5228('0x16')+_0x1c1707,'OData-Version':_0x5228('0x17')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x3e2561);})[_0x5228('0x10')](function(_0x3b6174){var _0x4b6b3c=_0x3b6174['headers'][_0x5228('0x27')];var _0x38488b=_0x4b6b3c['substring'](_0x4b6b3c['lastIndexOf']('(')+0x1,_0x4b6b3c[_0x5228('0x28')](')'));_0x253207['enduserId']=_0x38488b;_0x9db71e(_0x253207);})[_0x5228('0x11')](function(_0x10aebd){_0x204617(_0x10aebd['message']);});});}function getEndUser(_0x26c400,_0x57ead3,_0x589adb,_0x3a8250,_0x96f5f2,_0x1470de){return new BPromise(function(_0x2ad7c0,_0x568c62){return getAuthToken(_0x57ead3,_0x589adb,_0x1470de)[_0x5228('0x10')](function(_0x38781c){var _0x33c913={'method':_0x5228('0x29'),'uri':_0x3a8250+_0x5228('0x2a'),'headers':{'Authorization':_0x5228('0x16')+_0x38781c,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x33c913);})[_0x5228('0x10')](function(_0x5dce78){var _0x1ca305=null;if(_0x5dce78){var _0x81f4eb=_0x5dce78['value'];var _0x5c182e=![];for(_0x1ca305=0x0;_0x1ca305<_0x81f4eb['length'];_0x1ca305++){var _0x1cdccc=_0x1470de[_0x5228('0x23')]()===_0x5228('0x2b')?_0x96f5f2[_0x5228('0x24')]:_0x96f5f2[_0x5228('0x25')];if(_0x81f4eb[_0x1ca305][_0x5228('0x2c')]===_0x1cdccc){_0x5c182e=!![];_0x26c400['enduserId']=_0x81f4eb[_0x1ca305]['contactid'];}}if(_0x5c182e){_0x2ad7c0(_0x26c400);}else{return createEndUser(_0x26c400,_0x57ead3,_0x589adb,_0x3a8250,_0x96f5f2,_0x1470de)[_0x5228('0x10')](function(_0x1bd2e3){logger['info']('['+[_0x1470de[_0x5228('0x13')]()]+']\x20Enduser\x20created!',_0x1bd2e3['enduserId']);_0x2ad7c0(_0x1bd2e3);});}}else{return createEndUser(_0x26c400,_0x57ead3,_0x589adb,_0x3a8250,_0x96f5f2,_0x1470de)[_0x5228('0x10')](function(_0x52ad08){logger[_0x5228('0x1f')]('['+[_0x1470de[_0x5228('0x13')]()]+_0x5228('0x2d'),_0x52ad08[_0x5228('0x2e')]);_0x2ad7c0(_0x52ad08);});}});});}function getCustomFields(_0x342f3a,_0x725c90,_0x47bb96){var _0x5631d9={};if(_0x342f3a[_0x5228('0x1c')]>0x0){_['forEach'](_0x342f3a,function(_0x266c0d){if(_0x266c0d[_0x5228('0x2f')]===_0x5228('0x30')&&_0x266c0d[_0x5228('0x31')]&&!_0x266c0d[_0x5228('0x32')]){var _0x54eb31=_0x266c0d[_0x5228('0x33')]['toLowerCase']();var _0x2126f6=_0x54eb31[_0x5228('0x34')](0x0,_0x54eb31[_0x5228('0x35')]('_'));var _0x3ba6fc=_0x54eb31[_0x5228('0x34')](_0x54eb31[_0x5228('0x35')]('_')+0x1);if(_0x2126f6===_0x47bb96){_0x5631d9[_0x3ba6fc]=_0x266c0d[_0x5228('0x36')];}}});}return _0x5631d9;}function getTicket(_0x562bed,_0x46983d,_0x4cc96a,_0x4a74d6,_0x487ff3,_0x143410,_0x89489e){return new BPromise(function(_0xd32912,_0x290095){var _0x3e4940;return getAuthToken(_0x46983d,_0x4cc96a,_0x89489e)[_0x5228('0x10')](function(_0x2f70cd){if(_0x143410[_0x5228('0x37')]===_0x5228('0x38')){_0x3e4940={'method':_0x5228('0xa'),'uri':_0x4a74d6+_0x5228('0x39'),'body':Object[_0x5228('0x3a')]({},{'title':intUtil[_0x5228('0x3b')](_0x143410[_0x5228('0x3c')],_0x487ff3,'\x20'),'description':intUtil[_0x5228('0x3b')](_0x143410[_0x5228('0x3d')],_0x487ff3,'\x0a'),'customerid_contact@odata.bind':_0x5228('0x3e')+_0x562bed['enduserId']+')','ownerid@odata.bind':_0x5228('0x3f')+_0x562bed[_0x5228('0x22')]+')','caseorigincode':'1'},getCustomFields(_0x143410[_0x5228('0x40')],_0x487ff3,_0x143410[_0x5228('0x37')])),'headers':{'Authorization':_0x5228('0x16')+_0x2f70cd,'OData-Version':_0x5228('0x17')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x143410[_0x5228('0x37')]===_0x5228('0x41')){_0x3e4940={'method':_0x5228('0xa'),'uri':_0x4a74d6+_0x5228('0x42'),'body':Object['assign']({},{'subject':intUtil['getString'](_0x143410['Subjects'],_0x487ff3,'\x20'),'phonenumber':String(_0x487ff3[_0x5228('0x25')]),'description':intUtil['getString'](_0x143410[_0x5228('0x3d')],_0x487ff3,'\x0a'),'regardingobjectid_contact@odata.bind':_0x5228('0x3e')+_0x562bed[_0x5228('0x2e')]+')','ownerid@odata.bind':'/systemusers('+_0x562bed[_0x5228('0x22')]+')','directioncode':_0x562bed[_0x5228('0x43')]==='queue'?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x5228('0x3f')+_0x562bed[_0x5228('0x22')]+')','participationtypemask':_0x562bed['callDirection']==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x5228('0x3e')+_0x562bed[_0x5228('0x2e')]+')','participationtypemask':_0x562bed[_0x5228('0x43')]===_0x5228('0x44')?0x1:0x2}]},getCustomFields(_0x143410[_0x5228('0x40')],_0x487ff3,_0x143410[_0x5228('0x37')])),'headers':{'Authorization':_0x5228('0x16')+_0x2f70cd,'OData-Version':_0x5228('0x17')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x3e4940);})['then'](function(_0x31a442){var _0x3fcab0=_0x31a442[_0x5228('0x45')][_0x5228('0x27')];var _0x221622=_0x3fcab0['substring'](_0x3fcab0[_0x5228('0x28')]('(')+0x1,_0x3fcab0['lastIndexOf'](')'));_0x562bed[_0x5228('0x46')]=_0x221622;_0xd32912(_0x562bed);})[_0x5228('0x11')](function(_0x4685c4){_0x290095(_0x4685c4[_0x5228('0x14')]);});});}function emit(_0x3460c0,_0x34995e,_0x24f4a9,_0x46f7a9){var _0x5ec7f6={'uri':util[_0x5228('0x47')](_0x5228('0x48'),_0x3460c0,_0x24f4a9,_0x46f7a9)};io['to'](util['format'](_0x5228('0x49'),_0x34995e))[_0x5228('0x4a')](_0x5228('0x4b'),_0x5ec7f6);}exports['cs']=function(_0x20e65b,_0x38cc0a,_0x1a2cae,_0x16ea83,_0x5b0ad3,_0x462b6f,_0xeb7d8c,_0x2ffeb9){var _0x335a3e={};_0x462b6f['remoteUri']=intUtil['stripTrailingSlash'](_0x462b6f[_0x5228('0xc')]);_0x462b6f['serverUrl']=intUtil['stripTrailingSlash'](_0x462b6f[_0x5228('0x4c')]);_0x335a3e[_0x5228('0x43')]=_0x2ffeb9===_0x5228('0x44')||_0x2ffeb9===_0x5228('0x4d')?'queue':_0x5228('0x2b');var _0x91a4c=util[_0x5228('0x47')](_0x5228('0x4e'),_0x462b6f[_0x5228('0xc')]);var _0xe51e0a=util[_0x5228('0x47')](_0x5228('0x4f'),_0x462b6f[_0x5228('0x50')]);var _0xfd9914=util[_0x5228('0x47')](_0x5228('0x51'),_0x462b6f[_0x5228('0x4c')],_0x38cc0a[_0x5228('0x52')],md5(_0x38cc0a[_0x5228('0x52')]));if(_0x5b0ad3&&_0x5b0ad3[_0x5228('0x53')]){logger['info'](_0x5228('0x54'),_0x5228('0x55'));_0x38cc0a[_0x5228('0x56')]=_0xfd9914;}else if(_0xeb7d8c&&_0xeb7d8c['recordingFormat']&&_0xeb7d8c[_0x5228('0x57')]!==_0x5228('0x58')){logger[_0x5228('0x1f')](_0x5228('0x59'),_0x5228('0x55'));_0x38cc0a[_0x5228('0x56')]=_0xfd9914;}else{_0x38cc0a[_0x5228('0x56')]='';}return getUser(_0x335a3e,_0x462b6f,_0x16ea83,_0xe51e0a,_0x91a4c,_0x2ffeb9)[_0x5228('0x10')](function(_0x3188b1){logger[_0x5228('0x1f')]('['+_0x2ffeb9[_0x5228('0x13')]()+_0x5228('0x5a'),_0x3188b1[_0x5228('0x22')]);logger[_0x5228('0x1f')]('['+_0x2ffeb9[_0x5228('0x13')]()+_0x5228('0x5b'),_0x3188b1[_0x5228('0x1b')]);return getEndUser(_0x3188b1,_0x462b6f,_0xe51e0a,_0x91a4c,_0x38cc0a,_0x2ffeb9);})['then'](function(_0x1f52c3){logger[_0x5228('0x1f')]('['+_0x2ffeb9[_0x5228('0x13')]()+_0x5228('0x5c'),_0x1f52c3[_0x5228('0x2e')]);logger[_0x5228('0x1f')]('['+_0x2ffeb9[_0x5228('0x13')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x38cc0a['calleridnum']);return getTicket(_0x1f52c3,_0x462b6f,_0xe51e0a,_0x91a4c,_0x38cc0a,_0x1a2cae,_0x2ffeb9);})[_0x5228('0x10')](function(_0x418861){logger[_0x5228('0x1f')](util[_0x5228('0x47')]('['+_0x2ffeb9[_0x5228('0x13')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x1a2cae[_0x5228('0x37')],_0x418861[_0x5228('0x46')]));logger[_0x5228('0x1f')](util[_0x5228('0x47')]('['+_0x2ffeb9['toUpperCase']()+_0x5228('0x5d'),_0x2ffeb9));if(_0x2ffeb9!==_0x5228('0x4d')){logger['info']('['+_0x2ffeb9['toUpperCase']()+']',_0x5228('0x5e'));emit(_0x462b6f[_0x5228('0xc')],_0x16ea83['name'],_0x1a2cae['ticketType'],_0x418861[_0x5228('0x46')]);}})[_0x5228('0x11')](function(_0x5125e2){logger[_0x5228('0x12')]('['+_0x2ffeb9['toUpperCase']()+_0x5228('0x5f'),util[_0x5228('0x60')](_0x5125e2,{'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 e8a147f..ba90f89 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 _0x8848=['Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','POST','Enduser\x20created.','apiKey','toString','base64','debug','[HTTP]','stringify','GET','forEach','customField','nameField','toLowerCase','type','string','idField','variable','variableName','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','[OUTBOUND]','destcalleridname','destcalleridnum','monitor_format','[ABANDONED]','lodash','request-promise','util','./util','../../../../config/environment','freshdesk','redis','defaults','application/json','emit','info','merge','format','Caller\x20-\x20%s','Tags','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','Agent\x20found!','email'];(function(_0x4e5601,_0x59a9ef){var _0x449deb=function(_0x4a4aeb){while(--_0x4a4aeb){_0x4e5601['push'](_0x4e5601['shift']());}};_0x449deb(++_0x59a9ef);}(_0x8848,0x17d));var _0x8884=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x8848[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0x8884('0x0'));var rp=require(_0x8884('0x1'));var md5=require('md5');var util=require(_0x8884('0x2'));var Redis=require('ioredis');var intUtil=require(_0x8884('0x3'));var config=require(_0x8884('0x4'));var logger=require('../../../../config/logger')(_0x8884('0x5'));config[_0x8884('0x6')]=_[_0x8884('0x7')](config[_0x8884('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8884('0x6')]));var headers={'Content-Type':_0x8884('0x8'),'Accept':_0x8884('0x8')};function emit(_0x494657,_0x3a021e,_0x19819e){io['to'](_0x494657)[_0x8884('0x9')](_0x3a021e,_0x19819e);}function getTicket(_0x2a4396,_0x48db5a,_0x1e48a3,_0x4d9310,_0x420c56){logger[_0x8884('0xa')]('Creating\x20new\x20ticket...');var _0x34f3fe=_[_0x8884('0xb')]({'responder_id':_0x48db5a['id'],'requester_id':_0x1e48a3['id'],'name':util[_0x8884('0xc')](_0x8884('0xd'),_0x420c56['calleridname']),'phone':_0x420c56['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x4d9310['Subjects'],_0x420c56,'\x20'),'description':intUtil['getString'](_0x4d9310['Descriptions'],_0x420c56,'
'),'tags':getTags(_0x4d9310[_0x8884('0xe')],'name')},getCustomFields(_0x4d9310[_0x8884('0xf')],_0x420c56));_0x34f3fe[_0x8884('0x10')]=_[_0x8884('0x11')](_[_0x8884('0x12')](_0x34f3fe[_0x8884('0x10')],'id'),_0x8884('0x13'));return request({'uri':util[_0x8884('0xc')](_0x8884('0x14'),_0x2a4396[_0x8884('0x15')]),'method':'POST','body':_0x34f3fe})[_0x8884('0x16')](function(_0xe2cf7){logger[_0x8884('0xa')](_0x8884('0x17'));return _0xe2cf7;});}function getUser(_0x301542,_0x356157){if(intUtil[_0x8884('0x18')](_0x356157)){return request({'uri':util[_0x8884('0xc')](_0x8884('0x19'),_0x301542[_0x8884('0x15')]),'qs':{'email':_0x356157}})[_0x8884('0x16')](function(_0xc789c6){if(_0xc789c6[_0x8884('0x1a')]){logger[_0x8884('0xa')](_0x8884('0x1b'));return _['find'](_0xc789c6,function(_0x3bb60d){return _0x3bb60d['contact'][_0x8884('0x1c')]===_0x356157;});}else{logger[_0x8884('0xa')](_0x8884('0x1d'));return request({'uri':util[_0x8884('0xc')]('%s/api/v2/agents/me',_0x301542[_0x8884('0x15')])})[_0x8884('0x16')](function(_0x3efed9){logger['info']('Admin\x20account\x20selected.');return _0x3efed9;});}});}else{logger[_0x8884('0xa')](_0x8884('0x1e'));return request({'uri':util['format']('%s/api/v2/agents/me',_0x301542['remoteUri'])})['then'](function(_0x17b292){logger[_0x8884('0xa')](_0x8884('0x1f'));return _0x17b292;});}}function getEndUser(_0x4b4839,_0x318851,_0x19b7a4){logger[_0x8884('0xa')](_0x8884('0x20'),_0x19b7a4);return request({'uri':util['format'](_0x8884('0x21'),_0x4b4839[_0x8884('0x15')]),'qs':{'phone':_0x19b7a4}})[_0x8884('0x16')](function(_0x54fcf1){if(_0x54fcf1[_0x8884('0x1a')]){logger[_0x8884('0xa')](_0x8884('0x22'));return _['find'](_0x54fcf1,{'phone':_0x19b7a4});}else{logger[_0x8884('0xa')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format']('%s/api/v2/contacts',_0x4b4839[_0x8884('0x15')]),'method':_0x8884('0x23'),'body':{'name':_0x318851,'phone':_0x19b7a4}})[_0x8884('0x16')](function(_0x5f30f3){logger[_0x8884('0xa')](_0x8884('0x24'));return _0x5f30f3;});}});}function getAuth(_0x38fdbd){return util[_0x8884('0xc')]('Basic\x20%s',new Buffer(_0x38fdbd[_0x8884('0x25')]+':X')[_0x8884('0x26')](_0x8884('0x27')));}function request(_0x2e5bd4){logger[_0x8884('0x28')](_0x8884('0x29'),JSON[_0x8884('0x2a')](_0x2e5bd4));return rp(_['defaults'](_0x2e5bd4,{'method':_0x8884('0x2b'),'headers':headers,'json':!![]}));}function getTags(_0x4eb511,_0x3db70f){var _0x3fc409=[];if(_0x4eb511&&_0x4eb511[_0x8884('0x1a')]>0x0){_0x3fc409=_['map'](_0x4eb511,_0x3db70f);}return _0x3fc409;}function getCustomFields(_0x310d03,_0x37e708){var _0x2d339a=[];var _0x58e5c1={'custom_fields':[]};if(_0x310d03[_0x8884('0x1a')]>0x0){_[_0x8884('0x2c')](_0x310d03,function(_0x12541c){if(_0x12541c['type']==='string'&&_0x12541c['nameField']&&!_0x12541c[_0x8884('0x2d')]){_0x58e5c1[_0x12541c[_0x8884('0x2e')][_0x8884('0x2f')]()]=_0x12541c['content']['toString']();}else if(_0x12541c[_0x8884('0x30')]===_0x8884('0x31')&&_0x12541c[_0x8884('0x32')]&&_0x12541c[_0x8884('0x2d')]){_0x58e5c1[_0x8884('0x10')]['push']({'id':_0x12541c[_0x8884('0x32')],'value':_0x12541c['content']['toString']()});}else if(_0x12541c['type']===_0x8884('0x33')&&_0x12541c[_0x8884('0x34')]&&_0x12541c['idField']&&_0x12541c[_0x8884('0x2d')]){_0x37e708[_0x12541c[_0x8884('0x34')]]&&_0x58e5c1[_0x8884('0x10')]['push']({'id':_0x12541c[_0x8884('0x32')],'value':_0x37e708[_0x12541c['variableName']][_0x8884('0x26')]()});}else if(_0x12541c[_0x8884('0x30')]===_0x8884('0x35')&&_0x12541c[_0x8884('0x36')]&&_0x12541c['Variable']['name']&&_0x12541c[_0x8884('0x32')]&&_0x12541c[_0x8884('0x2d')]){_0x37e708[_0x12541c[_0x8884('0x36')][_0x8884('0x37')][_0x8884('0x2f')]()]&&_0x58e5c1[_0x8884('0x10')]['push']({'id':_0x12541c[_0x8884('0x32')],'value':_0x37e708[_0x12541c[_0x8884('0x36')][_0x8884('0x37')]['toLowerCase']()][_0x8884('0x26')]()});}});}return _0x58e5c1;}exports[_0x8884('0x38')]=function(_0x582842,_0x3aba27,_0x1baa1a,_0x237fca,_0x53f1c4,_0x461d0f){var _0x5e1327,_0xd8aab3;_0x461d0f[_0x8884('0x15')]=intUtil[_0x8884('0x39')](_0x461d0f[_0x8884('0x15')]);_0x461d0f[_0x8884('0x3a')]=intUtil[_0x8884('0x39')](_0x461d0f['serverUrl']);if(_0x53f1c4&&_0x53f1c4['monitor_format']){logger['info'](_0x8884('0x3b'),_0x8884('0x3c'));_0x3aba27[_0x8884('0x3d')]=util[_0x8884('0xc')](_0x8884('0x3e'),_0x461d0f['serverUrl'],_0x3aba27['uniqueid'],md5(_0x3aba27[_0x8884('0x3f')]));}else{_0x3aba27['recordingURL']='';}headers[_0x8884('0x40')]=getAuth(_0x461d0f);return getUser(_0x461d0f,_0x237fca[_0x8884('0x1c')])[_0x8884('0x16')](function(_0x5baa8f){_0x5e1327=_0x5baa8f;logger['info'](_0x8884('0x41'),_0x5e1327['id']);return getEndUser(_0x461d0f,_0x3aba27[_0x8884('0x42')],_0x3aba27[_0x8884('0x43')]);})[_0x8884('0x16')](function(_0x433213){_0xd8aab3=_0x433213;logger[_0x8884('0xa')](_0x8884('0x44'),_0xd8aab3['id']);return getTicket(_0x461d0f,_0x5e1327,_0xd8aab3,_0x1baa1a,_0x3aba27);})[_0x8884('0x16')](function(_0x329142){if(_0x329142&&_0x329142['id']){logger[_0x8884('0xa')](_0x8884('0x17'));logger[_0x8884('0xa')](_0x8884('0x45'),_0x329142['id']);logger[_0x8884('0xa')](_0x8884('0x3b'),_0x8884('0x46'));emit(util[_0x8884('0xc')](_0x8884('0x47'),_0x237fca[_0x8884('0x37')]),_0x8884('0x48'),{'uri':util[_0x8884('0xc')](_0x8884('0x49'),_0x461d0f[_0x8884('0x15')],_0x329142['id'])});}})[_0x8884('0x4a')](function(_0x1006f4){logger[_0x8884('0x4b')](_0x8884('0x3b'),JSON[_0x8884('0x2a')](_0x1006f4));});};exports[_0x8884('0x4c')]=function(_0x5be07f,_0x57116d,_0x44dfa8,_0x4e0276,_0x422898,_0x29c2a3,_0x1b48b7){var _0x4a0065,_0x5690e1;_0x29c2a3[_0x8884('0x15')]=intUtil[_0x8884('0x39')](_0x29c2a3[_0x8884('0x15')]);_0x29c2a3[_0x8884('0x3a')]=intUtil['stripTrailingSlash'](_0x29c2a3[_0x8884('0x3a')]);if(_0x1b48b7&&_0x1b48b7['recordingFormat']&&_0x1b48b7['recordingFormat']!=='none'){logger[_0x8884('0xa')](_0x8884('0x4d'),'Recording\x20is\x20enabled!');_0x57116d['recordingURL']=util[_0x8884('0xc')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x29c2a3[_0x8884('0x3a')],_0x57116d[_0x8884('0x3f')],md5(_0x57116d[_0x8884('0x3f')]));}headers['Authorization']=getAuth(_0x29c2a3);return getUser(_0x29c2a3,_0x4e0276['email'])['then'](function(_0x2cd73a){_0x4a0065=_0x2cd73a;logger[_0x8884('0xa')](_0x8884('0x41'),_0x4a0065['id']);return getEndUser(_0x29c2a3,_0x57116d[_0x8884('0x4e')],_0x57116d[_0x8884('0x4f')]);})[_0x8884('0x16')](function(_0x4ae725){_0x5690e1=_0x4ae725;logger['info'](_0x8884('0x44'),_0x5690e1['id']);return getTicket(_0x29c2a3,_0x4a0065,_0x5690e1,_0x44dfa8,_0x57116d);})['then'](function(_0x340aba){if(_0x340aba&&_0x340aba['id']){logger[_0x8884('0xa')](_0x8884('0x17'));logger[_0x8884('0xa')](_0x8884('0x45'),_0x340aba['id']);logger['info']('[OUTBOUND]',_0x8884('0x46'));emit(util['format'](_0x8884('0x47'),_0x4e0276[_0x8884('0x37')]),_0x8884('0x48'),{'uri':util[_0x8884('0xc')](_0x8884('0x49'),_0x29c2a3[_0x8884('0x15')],_0x340aba['id'])});}})[_0x8884('0x4a')](function(_0x47b1d3){logger[_0x8884('0x4b')](_0x8884('0x4d'),JSON['stringify'](_0x47b1d3));});};exports['abandoned']=function(_0x44a1d2,_0x17dede,_0x14a2ff,_0xe2c6b1,_0x2cc843,_0x1a5032){var _0x167e47,_0x1eaaf7;_0x1a5032['remoteUri']=intUtil[_0x8884('0x39')](_0x1a5032[_0x8884('0x15')]);_0x1a5032[_0x8884('0x3a')]=intUtil['stripTrailingSlash'](_0x1a5032[_0x8884('0x3a')]);if(_0x2cc843&&_0x2cc843[_0x8884('0x50')]){logger[_0x8884('0xa')]('[ABANDONED]',_0x8884('0x3c'));_0x17dede['recordingURL']=util[_0x8884('0xc')](_0x8884('0x3e'),_0x1a5032[_0x8884('0x3a')],_0x17dede['uniqueid'],md5(_0x17dede[_0x8884('0x3f')]));}else{_0x17dede[_0x8884('0x3d')]='';}headers[_0x8884('0x40')]=getAuth(_0x1a5032);return getUser(_0x1a5032,'')[_0x8884('0x16')](function(_0x4fd84b){_0x167e47=_0x4fd84b;logger[_0x8884('0xa')]('The\x20User\x20ID\x20is:',_0x167e47['id']);return getEndUser(_0x1a5032,_0x17dede[_0x8884('0x42')],_0x17dede['calleridnum']);})['then'](function(_0x2b194e){_0x1eaaf7=_0x2b194e;logger[_0x8884('0xa')](_0x8884('0x44'),_0x1eaaf7['id']);return getTicket(_0x1a5032,_0x167e47,_0x1eaaf7,_0x14a2ff,_0x17dede);})[_0x8884('0x16')](function(_0x17c59d){if(_0x17c59d){logger[_0x8884('0xa')](_0x8884('0x17'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x17c59d['id']);}})['catch'](function(_0x5dc58f){logger[_0x8884('0x4b')](_0x8884('0x51'),JSON['stringify'](_0x5dc58f));});}; \ No newline at end of file +var _0x5b0b=['recordingURL','uniqueid','%s/helpdesk/tickets/%d','error','abandoned','monitor_format','[ABANDONED]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','lodash','request-promise','md5','util','../../../../config/environment','freshdesk','redis','socket.io-emitter','application/json','emit','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridnum','getString','Descriptions','
','Tags','name','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','info','Agent\x20found!','find','email','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','apiKey','toString','base64','debug','[HTTP]','defaults','GET','map','forEach','type','string','nameField','toLowerCase','content','idField','customField','push','variableName','customVariable','Variable','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','Authorization','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','stringify','outbound','[OUTBOUND]'];(function(_0x4af611,_0x2faa1d){var _0x6de111=function(_0x5a3d1e){while(--_0x5a3d1e){_0x4af611['push'](_0x4af611['shift']());}};_0x6de111(++_0x2faa1d);}(_0x5b0b,0x1bb));var _0xb5b0=function(_0xe6eb47,_0x4aef04){_0xe6eb47=_0xe6eb47-0x0;var _0x6b7f0e=_0x5b0b[_0xe6eb47];return _0x6b7f0e;};'use strict';var _=require(_0xb5b0('0x0'));var rp=require(_0xb5b0('0x1'));var md5=require(_0xb5b0('0x2'));var util=require(_0xb5b0('0x3'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0xb5b0('0x4'));var logger=require('../../../../config/logger')(_0xb5b0('0x5'));config[_0xb5b0('0x6')]=_['defaults'](config[_0xb5b0('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xb5b0('0x7'))(new Redis(config[_0xb5b0('0x6')]));var headers={'Content-Type':'application/json','Accept':_0xb5b0('0x8')};function emit(_0xa8b1f0,_0x306891,_0xd16306){io['to'](_0xa8b1f0)[_0xb5b0('0x9')](_0x306891,_0xd16306);}function getTicket(_0x2cd6ec,_0x349734,_0x308014,_0x2d00b8,_0x472c7b){logger['info'](_0xb5b0('0xa'));var _0x3a5736=_[_0xb5b0('0xb')]({'responder_id':_0x349734['id'],'requester_id':_0x308014['id'],'name':util[_0xb5b0('0xc')](_0xb5b0('0xd'),_0x472c7b['calleridname']),'phone':_0x472c7b[_0xb5b0('0xe')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xb5b0('0xf')](_0x2d00b8['Subjects'],_0x472c7b,'\x20'),'description':intUtil['getString'](_0x2d00b8[_0xb5b0('0x10')],_0x472c7b,_0xb5b0('0x11')),'tags':getTags(_0x2d00b8[_0xb5b0('0x12')],_0xb5b0('0x13'))},getCustomFields(_0x2d00b8['Fields'],_0x472c7b));_0x3a5736[_0xb5b0('0x14')]=_[_0xb5b0('0x15')](_[_0xb5b0('0x16')](_0x3a5736[_0xb5b0('0x14')],'id'),_0xb5b0('0x17'));return request({'uri':util[_0xb5b0('0xc')](_0xb5b0('0x18'),_0x2cd6ec[_0xb5b0('0x19')]),'method':_0xb5b0('0x1a'),'body':_0x3a5736})[_0xb5b0('0x1b')](function(_0x1e0ed4){logger['info'](_0xb5b0('0x1c'));return _0x1e0ed4;});}function getUser(_0xeebd30,_0x12c714){if(intUtil[_0xb5b0('0x1d')](_0x12c714)){return request({'uri':util[_0xb5b0('0xc')](_0xb5b0('0x1e'),_0xeebd30[_0xb5b0('0x19')]),'qs':{'email':_0x12c714}})[_0xb5b0('0x1b')](function(_0x2c0b6e){if(_0x2c0b6e[_0xb5b0('0x1f')]){logger[_0xb5b0('0x20')](_0xb5b0('0x21'));return _[_0xb5b0('0x22')](_0x2c0b6e,function(_0xbdb7dc){return _0xbdb7dc['contact'][_0xb5b0('0x23')]===_0x12c714;});}else{logger[_0xb5b0('0x20')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xb5b0('0x24'),_0xeebd30[_0xb5b0('0x19')])})['then'](function(_0x41ad37){logger['info'](_0xb5b0('0x25'));return _0x41ad37;});}});}else{logger[_0xb5b0('0x20')](_0xb5b0('0x26'));return request({'uri':util[_0xb5b0('0xc')](_0xb5b0('0x24'),_0xeebd30['remoteUri'])})['then'](function(_0x8e7ad1){logger['info'](_0xb5b0('0x25'));return _0x8e7ad1;});}}function getEndUser(_0x48f3ca,_0x518df4,_0x490f77){logger['info'](_0xb5b0('0x27'),_0x490f77);return request({'uri':util[_0xb5b0('0xc')](_0xb5b0('0x28'),_0x48f3ca[_0xb5b0('0x19')]),'qs':{'phone':_0x490f77}})[_0xb5b0('0x1b')](function(_0x51f3ed){if(_0x51f3ed['length']){logger['info']('Enduser\x20found!');return _[_0xb5b0('0x22')](_0x51f3ed,{'phone':_0x490f77});}else{logger[_0xb5b0('0x20')](_0xb5b0('0x29'));return request({'uri':util['format']('%s/api/v2/contacts',_0x48f3ca['remoteUri']),'method':_0xb5b0('0x1a'),'body':{'name':_0x518df4,'phone':_0x490f77}})[_0xb5b0('0x1b')](function(_0x32f3bd){logger[_0xb5b0('0x20')](_0xb5b0('0x2a'));return _0x32f3bd;});}});}function getAuth(_0x1e0b89){return util['format']('Basic\x20%s',new Buffer(_0x1e0b89[_0xb5b0('0x2b')]+':X')[_0xb5b0('0x2c')](_0xb5b0('0x2d')));}function request(_0xa16a7f){logger[_0xb5b0('0x2e')](_0xb5b0('0x2f'),JSON['stringify'](_0xa16a7f));return rp(_[_0xb5b0('0x30')](_0xa16a7f,{'method':_0xb5b0('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x2fdc0b,_0x243ebb){var _0x5b355b=[];if(_0x2fdc0b&&_0x2fdc0b[_0xb5b0('0x1f')]>0x0){_0x5b355b=_[_0xb5b0('0x32')](_0x2fdc0b,_0x243ebb);}return _0x5b355b;}function getCustomFields(_0x2e9ac7,_0x2cc819){var _0x316f7e=[];var _0x2010bf={'custom_fields':[]};if(_0x2e9ac7[_0xb5b0('0x1f')]>0x0){_[_0xb5b0('0x33')](_0x2e9ac7,function(_0x293844){if(_0x293844[_0xb5b0('0x34')]===_0xb5b0('0x35')&&_0x293844[_0xb5b0('0x36')]&&!_0x293844['customField']){_0x2010bf[_0x293844['nameField'][_0xb5b0('0x37')]()]=_0x293844[_0xb5b0('0x38')][_0xb5b0('0x2c')]();}else if(_0x293844[_0xb5b0('0x34')]===_0xb5b0('0x35')&&_0x293844[_0xb5b0('0x39')]&&_0x293844[_0xb5b0('0x3a')]){_0x2010bf[_0xb5b0('0x14')][_0xb5b0('0x3b')]({'id':_0x293844[_0xb5b0('0x39')],'value':_0x293844[_0xb5b0('0x38')][_0xb5b0('0x2c')]()});}else if(_0x293844[_0xb5b0('0x34')]==='variable'&&_0x293844[_0xb5b0('0x3c')]&&_0x293844[_0xb5b0('0x39')]&&_0x293844[_0xb5b0('0x3a')]){_0x2cc819[_0x293844[_0xb5b0('0x3c')]]&&_0x2010bf['custom_fields']['push']({'id':_0x293844[_0xb5b0('0x39')],'value':_0x2cc819[_0x293844[_0xb5b0('0x3c')]][_0xb5b0('0x2c')]()});}else if(_0x293844[_0xb5b0('0x34')]===_0xb5b0('0x3d')&&_0x293844[_0xb5b0('0x3e')]&&_0x293844[_0xb5b0('0x3e')][_0xb5b0('0x13')]&&_0x293844[_0xb5b0('0x39')]&&_0x293844[_0xb5b0('0x3a')]){_0x2cc819[_0x293844[_0xb5b0('0x3e')][_0xb5b0('0x13')][_0xb5b0('0x37')]()]&&_0x2010bf['custom_fields']['push']({'id':_0x293844[_0xb5b0('0x39')],'value':_0x2cc819[_0x293844[_0xb5b0('0x3e')]['name'][_0xb5b0('0x37')]()][_0xb5b0('0x2c')]()});}});}return _0x2010bf;}exports['queue']=function(_0x48661d,_0x55f70f,_0x3c3d53,_0xeeb65e,_0x205d81,_0x1b4f07){var _0x558544,_0x36f307;_0x1b4f07['remoteUri']=intUtil['stripTrailingSlash'](_0x1b4f07[_0xb5b0('0x19')]);_0x1b4f07[_0xb5b0('0x3f')]=intUtil[_0xb5b0('0x40')](_0x1b4f07[_0xb5b0('0x3f')]);if(_0x205d81&&_0x205d81['monitor_format']){logger[_0xb5b0('0x20')](_0xb5b0('0x41'),_0xb5b0('0x42'));_0x55f70f['recordingURL']=util[_0xb5b0('0xc')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1b4f07[_0xb5b0('0x3f')],_0x55f70f['uniqueid'],md5(_0x55f70f['uniqueid']));}else{_0x55f70f['recordingURL']='';}headers[_0xb5b0('0x43')]=getAuth(_0x1b4f07);return getUser(_0x1b4f07,_0xeeb65e['email'])[_0xb5b0('0x1b')](function(_0x541752){_0x558544=_0x541752;logger['info'](_0xb5b0('0x44'),_0x558544['id']);return getEndUser(_0x1b4f07,_0x55f70f[_0xb5b0('0x45')],_0x55f70f['calleridnum']);})['then'](function(_0x54a2a7){_0x36f307=_0x54a2a7;logger[_0xb5b0('0x20')](_0xb5b0('0x46'),_0x36f307['id']);return getTicket(_0x1b4f07,_0x558544,_0x36f307,_0x3c3d53,_0x55f70f);})[_0xb5b0('0x1b')](function(_0x3c3dc5){if(_0x3c3dc5&&_0x3c3dc5['id']){logger['info'](_0xb5b0('0x1c'));logger['info'](_0xb5b0('0x47'),_0x3c3dc5['id']);logger['info'](_0xb5b0('0x41'),_0xb5b0('0x48'));emit(util[_0xb5b0('0xc')](_0xb5b0('0x49'),_0xeeb65e[_0xb5b0('0x13')]),_0xb5b0('0x4a'),{'uri':util[_0xb5b0('0xc')]('%s/helpdesk/tickets/%d',_0x1b4f07[_0xb5b0('0x19')],_0x3c3dc5['id'])});}})[_0xb5b0('0x4b')](function(_0x2dc6cc){logger['error']('[QUEUE]',JSON[_0xb5b0('0x4c')](_0x2dc6cc));});};exports[_0xb5b0('0x4d')]=function(_0x35889b,_0xb9787b,_0xedd995,_0x226790,_0x357a83,_0x21281e,_0x29f093){var _0x5ecc28,_0x509bd7;_0x21281e[_0xb5b0('0x19')]=intUtil[_0xb5b0('0x40')](_0x21281e[_0xb5b0('0x19')]);_0x21281e['serverUrl']=intUtil[_0xb5b0('0x40')](_0x21281e[_0xb5b0('0x3f')]);if(_0x29f093&&_0x29f093['recordingFormat']&&_0x29f093['recordingFormat']!=='none'){logger[_0xb5b0('0x20')](_0xb5b0('0x4e'),_0xb5b0('0x42'));_0xb9787b[_0xb5b0('0x4f')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x21281e[_0xb5b0('0x3f')],_0xb9787b['uniqueid'],md5(_0xb9787b[_0xb5b0('0x50')]));}headers[_0xb5b0('0x43')]=getAuth(_0x21281e);return getUser(_0x21281e,_0x226790[_0xb5b0('0x23')])[_0xb5b0('0x1b')](function(_0x4da024){_0x5ecc28=_0x4da024;logger[_0xb5b0('0x20')](_0xb5b0('0x44'),_0x5ecc28['id']);return getEndUser(_0x21281e,_0xb9787b['destcalleridname'],_0xb9787b['destcalleridnum']);})[_0xb5b0('0x1b')](function(_0x3c8229){_0x509bd7=_0x3c8229;logger[_0xb5b0('0x20')](_0xb5b0('0x46'),_0x509bd7['id']);return getTicket(_0x21281e,_0x5ecc28,_0x509bd7,_0xedd995,_0xb9787b);})[_0xb5b0('0x1b')](function(_0x3869ef){if(_0x3869ef&&_0x3869ef['id']){logger[_0xb5b0('0x20')](_0xb5b0('0x1c'));logger[_0xb5b0('0x20')]('The\x20Ticket\x20ID\x20is:',_0x3869ef['id']);logger[_0xb5b0('0x20')](_0xb5b0('0x4e'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xb5b0('0xc')]('user:%s',_0x226790[_0xb5b0('0x13')]),'trigger:browser:url',{'uri':util['format'](_0xb5b0('0x51'),_0x21281e[_0xb5b0('0x19')],_0x3869ef['id'])});}})[_0xb5b0('0x4b')](function(_0x10dbb3){logger[_0xb5b0('0x52')](_0xb5b0('0x4e'),JSON[_0xb5b0('0x4c')](_0x10dbb3));});};exports[_0xb5b0('0x53')]=function(_0xaf5a6b,_0x3d0162,_0x39e268,_0xb5bc2e,_0x45389f,_0x58f677){var _0x54cb4e,_0x2f49ef;_0x58f677['remoteUri']=intUtil[_0xb5b0('0x40')](_0x58f677['remoteUri']);_0x58f677[_0xb5b0('0x3f')]=intUtil[_0xb5b0('0x40')](_0x58f677[_0xb5b0('0x3f')]);if(_0x45389f&&_0x45389f[_0xb5b0('0x54')]){logger[_0xb5b0('0x20')](_0xb5b0('0x55'),_0xb5b0('0x42'));_0x3d0162[_0xb5b0('0x4f')]=util[_0xb5b0('0xc')](_0xb5b0('0x56'),_0x58f677['serverUrl'],_0x3d0162[_0xb5b0('0x50')],md5(_0x3d0162['uniqueid']));}else{_0x3d0162[_0xb5b0('0x4f')]='';}headers['Authorization']=getAuth(_0x58f677);return getUser(_0x58f677,'')[_0xb5b0('0x1b')](function(_0x3ac115){_0x54cb4e=_0x3ac115;logger[_0xb5b0('0x20')]('The\x20User\x20ID\x20is:',_0x54cb4e['id']);return getEndUser(_0x58f677,_0x3d0162['calleridname'],_0x3d0162[_0xb5b0('0xe')]);})[_0xb5b0('0x1b')](function(_0x55d5ef){_0x2f49ef=_0x55d5ef;logger[_0xb5b0('0x20')](_0xb5b0('0x46'),_0x2f49ef['id']);return getTicket(_0x58f677,_0x54cb4e,_0x2f49ef,_0x39e268,_0x3d0162);})[_0xb5b0('0x1b')](function(_0x798e76){if(_0x798e76){logger['info'](_0xb5b0('0x1c'));logger[_0xb5b0('0x20')](_0xb5b0('0x47'),_0x798e76['id']);}})[_0xb5b0('0x4b')](function(_0x42fe85){logger[_0xb5b0('0x52')](_0xb5b0('0x55'),JSON[_0xb5b0('0x4c')](_0x42fe85));});}; \ 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 9f9ce02..a01143e 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 _0x2c5c=['data1','sugarcrm','zoho','vtiger','dynamics365','unknown\x20integration','../../../../config/logger','error','%s\x20configuration\x20#%s\x20not\x20found','[EXEC]','format','%s\x20account\x20#%s\x20not\x20found','util','./salesforce','./sugarcrm','./freshdesk','./vtiger','./dynamics365','salesforce','freshdesk','desk','servicenow','exec','includes','toLowerCase','data2','find','Configurations','data3','queue','routeId','log','EVENT\x20UNKNOWN'];(function(_0x5b37d9,_0x1c2c52){var _0x1d9dc6=function(_0x83362){while(--_0x83362){_0x5b37d9['push'](_0x5b37d9['shift']());}};_0x1d9dc6(++_0x1c2c52);}(_0x2c5c,0xf3));var _0xc2c5=function(_0x46e03d,_0x25199c){_0x46e03d=_0x46e03d-0x0;var _0x3675a0=_0x2c5c[_0x46e03d];return _0x3675a0;};'use strict';var _=require('lodash');var util=require(_0xc2c5('0x0'));var zendesk=require('./zendesk');var salesforce=require(_0xc2c5('0x1'));var sugarcrm=require(_0xc2c5('0x2'));var freshdesk=require(_0xc2c5('0x3'));var zoho=require('./zoho');var desk=require('./desk');var vtiger=require(_0xc2c5('0x4'));var servicenow=require('./servicenow');var dynamics365=require(_0xc2c5('0x5'));var integrations=['zendesk',_0xc2c5('0x6'),'sugarcrm',_0xc2c5('0x7'),'zoho',_0xc2c5('0x8'),'vtiger',_0xc2c5('0x9'),'dynamics365'];exports[_0xc2c5('0xa')]=function(_0x13b5db,_0x42abf1,_0x42b160,_0x454896,_0x2a2ec7,_0x150e0d){if(_0x42b160){if(_[_0xc2c5('0xb')](integrations,_0x13b5db['data1']['toLowerCase']())){try{var _0xa475a0=null;var _0x5a6ddf='';var _0x435292=_0x42b160[_0x13b5db['data1'][_0xc2c5('0xc')]()];if(_0x435292){var _0x3d4326=_0x435292[_0x13b5db[_0xc2c5('0xd')]];if(_0x3d4326){var _0x1e6d30=_[_0xc2c5('0xe')](_0x3d4326[_0xc2c5('0xf')],{'id':parseInt(_0x13b5db[_0xc2c5('0x10')],0xa)});if(_0x1e6d30){if(_0x454896){if(_0x2a2ec7&&_0x42abf1[_0xc2c5('0x11')]){_0x5a6ddf=_0xc2c5('0x11');}else if(_0x42abf1[_0xc2c5('0x12')]){_0x5a6ddf='outbound';}else{console[_0xc2c5('0x13')](_0xc2c5('0x14'),_0x42abf1);}}else{_0x5a6ddf='abandoned';}switch(_0x13b5db[_0xc2c5('0x15')]['toLowerCase']()){case'zendesk':zendesk[_0x5a6ddf](_0x13b5db,_0x42abf1,_0x1e6d30,_0x454896,_0x2a2ec7,_0x3d4326,_0x150e0d);break;case'salesforce':salesforce[_0x5a6ddf](_0x13b5db,_0x42abf1,_0x1e6d30,_0x454896,_0x2a2ec7,_0x3d4326,_0x150e0d);break;case _0xc2c5('0x16'):sugarcrm[_0x5a6ddf](_0x13b5db,_0x42abf1,_0x1e6d30,_0x454896,_0x2a2ec7,_0x3d4326,_0x150e0d);break;case _0xc2c5('0x7'):freshdesk[_0x5a6ddf](_0x13b5db,_0x42abf1,_0x1e6d30,_0x454896,_0x2a2ec7,_0x3d4326,_0x150e0d);break;case _0xc2c5('0x17'):zoho[_0x5a6ddf](_0x13b5db,_0x42abf1,_0x1e6d30,_0x454896,_0x2a2ec7,_0x3d4326,_0x150e0d);break;case _0xc2c5('0x8'):desk[_0x5a6ddf](_0x13b5db,_0x42abf1,_0x1e6d30,_0x454896,_0x2a2ec7,_0x3d4326,_0x150e0d);break;case _0xc2c5('0x18'):vtiger[_0x5a6ddf](_0x13b5db,_0x42abf1,_0x1e6d30,_0x454896,_0x2a2ec7,_0x3d4326,_0x150e0d);break;case _0xc2c5('0x9'):servicenow['cs'](_0x13b5db,_0x42abf1,_0x1e6d30,_0x454896,_0x2a2ec7,_0x3d4326,_0x150e0d,_0x5a6ddf);break;case _0xc2c5('0x19'):dynamics365['cs'](_0x13b5db,_0x42abf1,_0x1e6d30,_0x454896,_0x2a2ec7,_0x3d4326,_0x150e0d,_0x5a6ddf);break;default:console[_0xc2c5('0x13')](_0xc2c5('0x1a'));}}else{_0xa475a0=require(_0xc2c5('0x1b'))(_0x13b5db[_0xc2c5('0x15')][_0xc2c5('0xc')]());_0xa475a0[_0xc2c5('0x1c')]('[EXEC]',util['format'](_0xc2c5('0x1d'),_0x13b5db[_0xc2c5('0x15')][_0xc2c5('0xc')](),_0x13b5db[_0xc2c5('0x10')]));}}else{_0xa475a0=require(_0xc2c5('0x1b'))(_0x13b5db[_0xc2c5('0x15')][_0xc2c5('0xc')]());_0xa475a0['error'](_0xc2c5('0x1e'),util[_0xc2c5('0x1f')](_0xc2c5('0x20'),_0x13b5db[_0xc2c5('0x15')]['toLowerCase'](),_0x13b5db[_0xc2c5('0xd')]));}}else{}}catch(_0x103111){console[_0xc2c5('0x1c')](_0x103111);}}}}; \ No newline at end of file +var _0xe509=['./dynamics365','zendesk','salesforce','sugarcrm','zoho','desk','servicenow','dynamics365','exec','includes','data1','toLowerCase','data2','find','Configurations','queue','outbound','log','EVENT\x20UNKNOWN','abandoned','freshdesk','vtiger','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','data3','%s\x20account\x20#%s\x20not\x20found','lodash','util','./salesforce','./sugarcrm','./freshdesk','./zoho','./vtiger','./servicenow'];(function(_0x585ebf,_0x13c9ca){var _0x40fe15=function(_0xbca22e){while(--_0xbca22e){_0x585ebf['push'](_0x585ebf['shift']());}};_0x40fe15(++_0x13c9ca);}(_0xe509,0xdc));var _0x9e50=function(_0x366388,_0x4595a6){_0x366388=_0x366388-0x0;var _0x41c97e=_0xe509[_0x366388];return _0x41c97e;};'use strict';var _=require(_0x9e50('0x0'));var util=require(_0x9e50('0x1'));var zendesk=require('./zendesk');var salesforce=require(_0x9e50('0x2'));var sugarcrm=require(_0x9e50('0x3'));var freshdesk=require(_0x9e50('0x4'));var zoho=require(_0x9e50('0x5'));var desk=require('./desk');var vtiger=require(_0x9e50('0x6'));var servicenow=require(_0x9e50('0x7'));var dynamics365=require(_0x9e50('0x8'));var integrations=[_0x9e50('0x9'),_0x9e50('0xa'),_0x9e50('0xb'),'freshdesk',_0x9e50('0xc'),_0x9e50('0xd'),'vtiger',_0x9e50('0xe'),_0x9e50('0xf')];exports[_0x9e50('0x10')]=function(_0x55f2bd,_0x8f7243,_0x1d2687,_0x381000,_0x90d492,_0x40ebbd){if(_0x1d2687){if(_[_0x9e50('0x11')](integrations,_0x55f2bd[_0x9e50('0x12')][_0x9e50('0x13')]())){try{var _0x13f21f=null;var _0x34c31d='';var _0x5868ea=_0x1d2687[_0x55f2bd['data1'][_0x9e50('0x13')]()];if(_0x5868ea){var _0x5b1c89=_0x5868ea[_0x55f2bd[_0x9e50('0x14')]];if(_0x5b1c89){var _0x5885a5=_[_0x9e50('0x15')](_0x5b1c89[_0x9e50('0x16')],{'id':parseInt(_0x55f2bd['data3'],0xa)});if(_0x5885a5){if(_0x381000){if(_0x90d492&&_0x8f7243[_0x9e50('0x17')]){_0x34c31d='queue';}else if(_0x8f7243['routeId']){_0x34c31d=_0x9e50('0x18');}else{console[_0x9e50('0x19')](_0x9e50('0x1a'),_0x8f7243);}}else{_0x34c31d=_0x9e50('0x1b');}switch(_0x55f2bd[_0x9e50('0x12')][_0x9e50('0x13')]()){case _0x9e50('0x9'):zendesk[_0x34c31d](_0x55f2bd,_0x8f7243,_0x5885a5,_0x381000,_0x90d492,_0x5b1c89,_0x40ebbd);break;case _0x9e50('0xa'):salesforce[_0x34c31d](_0x55f2bd,_0x8f7243,_0x5885a5,_0x381000,_0x90d492,_0x5b1c89,_0x40ebbd);break;case _0x9e50('0xb'):sugarcrm[_0x34c31d](_0x55f2bd,_0x8f7243,_0x5885a5,_0x381000,_0x90d492,_0x5b1c89,_0x40ebbd);break;case _0x9e50('0x1c'):freshdesk[_0x34c31d](_0x55f2bd,_0x8f7243,_0x5885a5,_0x381000,_0x90d492,_0x5b1c89,_0x40ebbd);break;case _0x9e50('0xc'):zoho[_0x34c31d](_0x55f2bd,_0x8f7243,_0x5885a5,_0x381000,_0x90d492,_0x5b1c89,_0x40ebbd);break;case _0x9e50('0xd'):desk[_0x34c31d](_0x55f2bd,_0x8f7243,_0x5885a5,_0x381000,_0x90d492,_0x5b1c89,_0x40ebbd);break;case _0x9e50('0x1d'):vtiger[_0x34c31d](_0x55f2bd,_0x8f7243,_0x5885a5,_0x381000,_0x90d492,_0x5b1c89,_0x40ebbd);break;case _0x9e50('0xe'):servicenow['cs'](_0x55f2bd,_0x8f7243,_0x5885a5,_0x381000,_0x90d492,_0x5b1c89,_0x40ebbd,_0x34c31d);break;case'dynamics365':dynamics365['cs'](_0x55f2bd,_0x8f7243,_0x5885a5,_0x381000,_0x90d492,_0x5b1c89,_0x40ebbd,_0x34c31d);break;default:console[_0x9e50('0x19')](_0x9e50('0x1e'));}}else{_0x13f21f=require(_0x9e50('0x1f'))(_0x55f2bd[_0x9e50('0x12')][_0x9e50('0x13')]());_0x13f21f[_0x9e50('0x20')](_0x9e50('0x21'),util[_0x9e50('0x22')](_0x9e50('0x23'),_0x55f2bd[_0x9e50('0x12')]['toLowerCase'](),_0x55f2bd[_0x9e50('0x24')]));}}else{_0x13f21f=require(_0x9e50('0x1f'))(_0x55f2bd[_0x9e50('0x12')]['toLowerCase']());_0x13f21f['error'](_0x9e50('0x21'),util[_0x9e50('0x22')](_0x9e50('0x25'),_0x55f2bd[_0x9e50('0x12')][_0x9e50('0x13')](),_0x55f2bd[_0x9e50('0x14')]));}}else{}}catch(_0x3f824b){console[_0x9e50('0x20')](_0x3f824b);}}}}; \ 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 bc3eb15..c7927f4 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 _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(_0x12a5c9,_0x15dbed){var _0x12eade=function(_0x118495){while(--_0x118495){_0x12a5c9['push'](_0x12a5c9['shift']());}};_0x12eade(++_0x15dbed);}(_0x9c44,0x178));var _0x49c4=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x9c44[_0x2064e5];return _0x21a233;};'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 +var _0xa9e0=['identity','resolve','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','Contact','Lead','contact','lead','Phone','Name','Enduser\x20with\x20phone\x20%s\x20found.','format','Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','upperFirst','type','string','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','password','concat','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','recordingURL','email','calleridname','calleridnum','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','user:%s','trigger:salesforce:display','%s/%s/e','error','catch','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','Fields','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','trigger:browser:url','Salesforce\x20account\x20type\x20not\x20recognized','stringify','abandoned','[ABANDONED]','[ABANDONED]\x20Ticket\x20%s\x20created.','lodash','request-promise','moment','jsforce','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','defaults','redis','localhost','emit','ticketType','Task','assign','utc','getString','Subjects','Descriptions','WhoId','Case','ContactId','create','isNil','validateEmail','sobject','User','find','execute','then','length','Email','Agent\x20%s\x20found.','info','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.'];(function(_0x393bc5,_0x416494){var _0x17038d=function(_0xc4434f){while(--_0xc4434f){_0x393bc5['push'](_0x393bc5['shift']());}};_0x17038d(++_0x416494);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var md5=require('md5');var jsforce=require(_0x0a9e('0x3'));var util=require('util');var Redis=require(_0x0a9e('0x4'));var intUtil=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));config['redis']=_[_0x0a9e('0x9')](config[_0x0a9e('0xa')],{'host':_0x0a9e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0xe42b77,_0x56465b,_0x52cace){io['to'](_0xe42b77)[_0x0a9e('0xc')](_0x56465b,_0x52cace);}function getTicket(_0xf81284,_0x307b3e,_0x3ab53f,_0xfeb75b,_0xbd1168,_0x4a4c56,_0x50dfb2,_0x527cdd){var _0x4cfe67={};if(_0xfeb75b[_0x0a9e('0xd')]===_0x0a9e('0xe')){_0x4cfe67=Object[_0x0a9e('0xf')]({},{'OwnerId':_0x307b3e['id'],'ActivityDate':moment[_0x0a9e('0x10')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0x0a9e('0x11')](_0xfeb75b[_0x0a9e('0x12')],_0xbd1168,'\x20'),'Description':intUtil['getString'](_0xfeb75b[_0x0a9e('0x13')],_0xbd1168,'\x0a')},getCustomFields(_0x4a4c56,_0xbd1168));if(_0x3ab53f){_0x4cfe67[_0x0a9e('0x14')]=_0x3ab53f['id'];}}else if(_0xfeb75b[_0x0a9e('0xd')]===_0x0a9e('0x15')){_0x4cfe67=Object[_0x0a9e('0xf')]({},{'OwnerId':_0x307b3e['id'],'Subject':intUtil[_0x0a9e('0x11')](_0xfeb75b['Subjects'],_0xbd1168,'\x20'),'Description':intUtil[_0x0a9e('0x11')](_0xfeb75b['Descriptions'],_0xbd1168,'\x0a')},getCustomFields(_0x4a4c56,_0xbd1168));if(_0x3ab53f){_0x4cfe67[_0x0a9e('0x16')]=_0x3ab53f['id'];}}return _0x50dfb2['sobject'](_0xfeb75b[_0x0a9e('0xd')])[_0x0a9e('0x17')](_0x4cfe67);}function getUser(_0x48f32d,_0x225616,_0x5a0a06){if(!_[_0x0a9e('0x18')](_0x225616)&&intUtil[_0x0a9e('0x19')](_0x225616)){var _0x106033={'Email':_0x225616};var _0x205fd6={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x5a0a06[_0x0a9e('0x1a')](_0x0a9e('0x1b'))[_0x0a9e('0x1c')](_0x106033,_0x205fd6)[_0x0a9e('0x1d')]()[_0x0a9e('0x1e')](function(_0x112016){if(_0x112016[_0x0a9e('0x1f')]){var _0x105080=_['find'](_0x112016,function(_0x2c3407){return _0x2c3407[_0x0a9e('0x20')]===_0x225616;});if(_0x105080){logger['info'](_0x0a9e('0x21'),_0x225616);return BPromise['resolve']({'id':_0x105080['Id'],'name':_0x105080['Name']});}}else{logger[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x225616);return _0x5a0a06[_0x0a9e('0x24')]()[_0x0a9e('0x1e')](function(_0x4abc77){return BPromise[_0x0a9e('0x25')]({'id':_0x4abc77[_0x0a9e('0x26')],'name':_0x4abc77[_0x0a9e('0x27')]});});}});}else{logger[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x225616);return _0x5a0a06[_0x0a9e('0x24')]()[_0x0a9e('0x1e')](function(_0x5ea472){return BPromise['resolve']({'id':_0x5ea472[_0x0a9e('0x26')],'name':_0x5ea472[_0x0a9e('0x27')]});});}}function getEndUser(_0x40c424,_0x33161b,_0x526cf3,_0x384319,_0x479bc4){var _0x45a1e7={'Phone':_0x384319};var _0x5bfb33={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x0a9e('0x25')]()[_0x0a9e('0x1e')](function(){if(_0x33161b[_0x0a9e('0xd')]===_0x0a9e('0xe')){logger[_0x0a9e('0x22')](_0x0a9e('0x28'),_0x384319,_0x33161b[_0x0a9e('0x29')]);switch(_0x33161b[_0x0a9e('0x29')]){case'contact_lead':return _0x479bc4[_0x0a9e('0x1a')](_0x0a9e('0x2a'))[_0x0a9e('0x1c')](_0x45a1e7,_0x5bfb33)[_0x0a9e('0x1d')]()['then'](function(_0x15b200){if(_0x15b200&&_0x15b200[_0x0a9e('0x1f')]){return _0x15b200;}else{return _0x479bc4[_0x0a9e('0x1a')](_0x0a9e('0x2b'))[_0x0a9e('0x1c')](_0x45a1e7,_0x5bfb33);}});case _0x0a9e('0x2c'):return _0x479bc4[_0x0a9e('0x1a')](_0x0a9e('0x2a'))[_0x0a9e('0x1c')](_0x45a1e7,_0x5bfb33)['execute']();case _0x0a9e('0x2d'):return _0x479bc4['sobject'](_0x0a9e('0x2b'))[_0x0a9e('0x1c')](_0x45a1e7,_0x5bfb33);default:return null;}}else if(_0x33161b[_0x0a9e('0xd')]===_0x0a9e('0x15')){logger[_0x0a9e('0x22')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x384319,_0x0a9e('0x2c'));return _0x479bc4[_0x0a9e('0x1a')](_0x0a9e('0x2a'))[_0x0a9e('0x1c')](_0x45a1e7,_0x5bfb33)[_0x0a9e('0x1d')]();}})[_0x0a9e('0x1e')](function(_0x332d35){if(_0x332d35&&_0x332d35[_0x0a9e('0x1f')]){var _0x5583a4=_[_0x0a9e('0x1c')](_0x332d35,function(_0x5e7238){return _0x5e7238[_0x0a9e('0x2e')]===_0x384319;});if(_0x5583a4){return BPromise[_0x0a9e('0x25')]({'id':_0x5583a4['Id'],'name':_0x5583a4[_0x0a9e('0x2f')],'phone':_0x5583a4[_0x0a9e('0x2e')]});}}})['then'](function(_0x191e91){if(_0x191e91){logger[_0x0a9e('0x22')](_0x0a9e('0x30'),_0x384319);return BPromise[_0x0a9e('0x25')](_0x191e91);}else{logger['info']('Enduser\x20with\x20phone\x20%s\x20not\x20found.',_0x384319);var _0x1e8694={'LastName':_0x526cf3!==''?_0x526cf3:util[_0x0a9e('0x31')](_0x0a9e('0x32'),_0x384319),'Phone':_0x384319};if(_0x33161b[_0x0a9e('0x33')]){if(_0x33161b[_0x0a9e('0x33')]==='contact'){logger[_0x0a9e('0x22')](_0x0a9e('0x34'),_0x384319,_0x33161b[_0x0a9e('0x33')]);}else if(_0x33161b['moduleCreate']===_0x0a9e('0x2d')&&_0x33161b[_0x0a9e('0xd')]===_0x0a9e('0xe')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x384319,_0x33161b[_0x0a9e('0x33')]);_0x1e8694[_0x0a9e('0x35')]='No\x20Company';}else{return null;}}return _0x479bc4[_0x0a9e('0x1a')](_[_0x0a9e('0x36')](_0x33161b[_0x0a9e('0x33')]))[_0x0a9e('0x17')](_0x1e8694);}});}function getCustomFields(_0x4b38d9,_0x5a594b){var _0x15e37d={};if(_0x4b38d9[_0x0a9e('0x1f')]>0x0){_['forEach'](_0x4b38d9,function(_0x183991){if(_0x183991[_0x0a9e('0x37')]===_0x0a9e('0x38')&&_0x183991['idField']){_0x15e37d[_0x183991[_0x0a9e('0x39')]]=_0x183991[_0x0a9e('0x3a')][_0x0a9e('0x3b')]();}else if(_0x183991[_0x0a9e('0x37')]===_0x0a9e('0x3c')&&_0x183991[_0x0a9e('0x3d')]&&_0x183991[_0x0a9e('0x39')]){_0x5a594b[_0x183991[_0x0a9e('0x3d')]]&&(_0x15e37d[_0x183991[_0x0a9e('0x39')]]=_0x5a594b[_0x183991[_0x0a9e('0x3d')]][_0x0a9e('0x3b')]());}else if(_0x183991[_0x0a9e('0x37')]===_0x0a9e('0x3e')&&_0x183991[_0x0a9e('0x3f')]&&_0x183991[_0x0a9e('0x3f')]['name']&&_0x183991['idField']){_0x5a594b[_0x183991[_0x0a9e('0x3f')][_0x0a9e('0x40')][_0x0a9e('0x41')]()]&&(_0x15e37d[_0x183991[_0x0a9e('0x39')]]=_0x5a594b[_0x183991[_0x0a9e('0x3f')][_0x0a9e('0x40')][_0x0a9e('0x41')]()][_0x0a9e('0x3b')]());}});}return _0x15e37d;}function getConnection(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x42')][_0x0a9e('0x43')](_0x432fcc['securityToken']);var _0x117c99=new jsforce[(_0x0a9e('0x44'))]({'oauth2':{'loginUrl':_0x432fcc[_0x0a9e('0x45')]||_0x0a9e('0x46'),'clientId':_0x432fcc[_0x0a9e('0x47')],'clientSecret':_0x432fcc[_0x0a9e('0x48')]}});return _0x117c99[_0x0a9e('0x49')](_0x432fcc[_0x0a9e('0x4a')],_0x25c6e6)['then'](function(){logger[_0x0a9e('0x22')]('Connection\x20established.');return _0x117c99;});}exports[_0x0a9e('0x4b')]=function(_0x476688,_0x8d6dd1,_0x562fb4,_0x14bec2,_0x7f6eb1,_0x4774f4){var _0x34aa5a,_0x45c845,_0x37be73,_0x45bf7f;_0x4774f4['serverUrl']=intUtil[_0x0a9e('0x4c')](_0x4774f4[_0x0a9e('0x4d')]);_0x4774f4[_0x0a9e('0x45')]=intUtil[_0x0a9e('0x4c')](_0x4774f4[_0x0a9e('0x45')]);if(_0x7f6eb1&&_0x7f6eb1[_0x0a9e('0x4e')]){logger[_0x0a9e('0x22')](_0x0a9e('0x4f'),_0x0a9e('0x50'));_0x8d6dd1['recordingURL']=util[_0x0a9e('0x31')](_0x0a9e('0x51'),_0x4774f4['serverUrl'],_0x8d6dd1['uniqueid'],md5(_0x8d6dd1['uniqueid']));}else{_0x8d6dd1[_0x0a9e('0x52')]='';}return getConnection(_0x4774f4)[_0x0a9e('0x1e')](function(_0x37edaa){_0x45bf7f=_0x37edaa;return getUser(_0x4774f4,_0x14bec2[_0x0a9e('0x53')],_0x45bf7f);})[_0x0a9e('0x1e')](function(_0x30decb){_0x34aa5a=_0x30decb;return getEndUser(_0x4774f4,_0x562fb4,_0x8d6dd1[_0x0a9e('0x54')],_0x8d6dd1[_0x0a9e('0x55')],_0x45bf7f);})['then'](function(_0x4b1b9f){_0x45c845=_0x4b1b9f;return getTicket(_0x4774f4,_0x34aa5a,_0x45c845,_0x562fb4,_0x8d6dd1,_0x562fb4['Fields'],_0x45bf7f,_0x0a9e('0x4b'));})[_0x0a9e('0x1e')](function(_0x14d602){_0x37be73=_0x14d602;logger['info'](_0x0a9e('0x56'),_0x37be73['id']);logger[_0x0a9e('0x22')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x37be73['id'],_0x14bec2['name'],_0x4774f4[_0x0a9e('0x37')]);switch(_0x4774f4['type']){case _0x0a9e('0x57'):emit(util['format'](_0x0a9e('0x58'),_0x14bec2[_0x0a9e('0x40')]),_0x0a9e('0x59'),{'recordId':_0x37be73['id']});break;case'newTab':emit(util[_0x0a9e('0x31')](_0x0a9e('0x58'),_0x14bec2['name']),'trigger:browser:url',{'uri':util[_0x0a9e('0x31')](_0x0a9e('0x5a'),_0x45bf7f['instanceUrl'],_0x37be73['id'])});break;default:logger[_0x0a9e('0x5b')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x0a9e('0x5c')](function(_0x523cd2){logger[_0x0a9e('0x5b')]('[QUEUE]',JSON['stringify'](_0x523cd2));});};exports['outbound']=function(_0x2da03c,_0x47de4c,_0x2f7092,_0x65432,_0x3cfd00,_0x19b4df,_0x232830){var _0x272738,_0xd10662,_0x28d814,_0x4e67ab;_0x19b4df[_0x0a9e('0x4d')]=intUtil[_0x0a9e('0x4c')](_0x19b4df[_0x0a9e('0x4d')]);_0x19b4df[_0x0a9e('0x45')]=intUtil[_0x0a9e('0x4c')](_0x19b4df[_0x0a9e('0x45')]);if(_0x232830&&_0x232830['recordingFormat']&&_0x232830[_0x0a9e('0x5d')]!==_0x0a9e('0x5e')){logger['info'](_0x0a9e('0x5f'),'Recording\x20is\x20enabled!');_0x47de4c[_0x0a9e('0x52')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x19b4df['serverUrl'],_0x47de4c[_0x0a9e('0x60')],md5(_0x47de4c['uniqueid']));}return getConnection(_0x19b4df)[_0x0a9e('0x1e')](function(_0x1fc70e){_0x4e67ab=_0x1fc70e;return getUser(_0x19b4df,_0x65432[_0x0a9e('0x53')],_0x4e67ab);})[_0x0a9e('0x1e')](function(_0x1cca9f){_0x272738=_0x1cca9f;return getEndUser(_0x19b4df,_0x2f7092,_0x47de4c[_0x0a9e('0x61')],_0x47de4c['destcalleridnum'],_0x4e67ab);})[_0x0a9e('0x1e')](function(_0x5854cc){_0xd10662=_0x5854cc;return getTicket(_0x19b4df,_0x272738,_0xd10662,_0x2f7092,_0x47de4c,_0x2f7092[_0x0a9e('0x62')],_0x4e67ab,_0x0a9e('0x63'));})[_0x0a9e('0x1e')](function(_0x5adf8f){_0x28d814=_0x5adf8f;logger[_0x0a9e('0x22')](_0x0a9e('0x64'),_0x28d814['id']);logger[_0x0a9e('0x22')](_0x0a9e('0x65'),_0x28d814['id'],_0x65432['name'],_0x19b4df[_0x0a9e('0x37')]);switch(_0x19b4df[_0x0a9e('0x37')]){case'integrationTab':emit(util[_0x0a9e('0x31')](_0x0a9e('0x58'),_0x65432[_0x0a9e('0x40')]),_0x0a9e('0x59'),{'recordId':_0x28d814['id']});break;case _0x0a9e('0x66'):emit(util['format'](_0x0a9e('0x58'),_0x65432[_0x0a9e('0x40')]),_0x0a9e('0x67'),{'uri':util['format'](_0x0a9e('0x5a'),_0x4e67ab['instanceUrl'],_0x28d814['id'])});break;default:logger['error'](_0x0a9e('0x5f'),_0x0a9e('0x68'));}})[_0x0a9e('0x5c')](function(_0x19c995){logger[_0x0a9e('0x5b')](_0x0a9e('0x5f'),JSON[_0x0a9e('0x69')](_0x19c995));});};exports[_0x0a9e('0x6a')]=function(_0x2d7205,_0x1cc4f3,_0x2e89b7,_0x19012b,_0x2bbb86,_0x2b8192){var _0x320898,_0x412a72,_0x2a28c0,_0x4257c9;_0x2b8192['serverUrl']=intUtil[_0x0a9e('0x4c')](_0x2b8192[_0x0a9e('0x4d')]);_0x2b8192[_0x0a9e('0x45')]=intUtil['stripTrailingSlash'](_0x2b8192[_0x0a9e('0x45')]);if(_0x2bbb86&&_0x2bbb86[_0x0a9e('0x4e')]){logger['info'](_0x0a9e('0x6b'),_0x0a9e('0x50'));_0x1cc4f3[_0x0a9e('0x52')]=util[_0x0a9e('0x31')](_0x0a9e('0x51'),_0x2b8192['serverUrl'],_0x1cc4f3['uniqueid'],md5(_0x1cc4f3['uniqueid']));}else{_0x1cc4f3[_0x0a9e('0x52')]='';}return getConnection(_0x2b8192)[_0x0a9e('0x1e')](function(_0x1104ad){_0x4257c9=_0x1104ad;if(!_[_0x0a9e('0x18')](_0x19012b)){return getUser(_0x2b8192,_0x19012b[_0x0a9e('0x40')],_0x4257c9);}else{return getUser(_0x2b8192,null,_0x4257c9);}})[_0x0a9e('0x1e')](function(_0xeef20){_0x320898=_0xeef20;return getEndUser(_0x2b8192,_0x2e89b7,_0x1cc4f3[_0x0a9e('0x54')],_0x1cc4f3['calleridnum'],_0x4257c9);})[_0x0a9e('0x1e')](function(_0xcbc8b2){_0x412a72=_0xcbc8b2;return getTicket(_0x2b8192,_0x320898,_0x412a72,_0x2e89b7,_0x1cc4f3,_0x2e89b7[_0x0a9e('0x62')],_0x4257c9);})['then'](function(_0x2bdc44){_0x2a28c0=_0x2bdc44;logger['info'](_0x0a9e('0x6c'),_0x2a28c0['id']);logger[_0x0a9e('0x22')]('[ABANDONED]\x20Integration\x20account\x20type\x20%s.',_0x2b8192[_0x0a9e('0x37')]);})[_0x0a9e('0x5c')](function(_0x2cc7a7){logger[_0x0a9e('0x5b')]('[ABANDONED]',JSON[_0x0a9e('0x69')](_0x2cc7a7));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/servicenow.js b/server/services/ami/trigger/integration/servicenow.js index 04185aa..da94b43 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 _0x5395=['remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','email','calleridnum','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','request-promise','ioredis','./util','../../../../config/environment','servicenow','redis','defaults','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','GET','userEmail','then','result','active','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','endUserNumber','user','true','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','string','customField','idField','content','toString','type','toLowerCase','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','number',']\x20getTicket\x20crm','label','label_entry','Incident','Incident\x20-\x20','ticketNumber','forEach','push','all','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','format','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x5395,0x150));var _0x5539=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x5395[_0x46698a];return _0x356db0;};'use strict';var _=require(_0x5539('0x0'));var Promise=require('bluebird');var rp=require(_0x5539('0x1'));var util=require('util');var md5=require('md5');var Redis=require(_0x5539('0x2'));var intUtil=require(_0x5539('0x3'));var config=require(_0x5539('0x4'));var logger=require('../../../../config/logger')(_0x5539('0x5'));config[_0x5539('0x6')]=_[_0x5539('0x7')](config[_0x5539('0x6')],{'host':_0x5539('0x8'),'port':0x18eb});var io=require(_0x5539('0x9'))(new Redis(config[_0x5539('0x6')]));function getAdminUser(_0x16af83,_0x56b645,_0x37fb7d,_0x32af1c,_0x10fefa,_0x417b4c){return new Promise(function(_0x5e44a2,_0x5513f6){var _0x5558e9={'method':'GET','uri':_0x32af1c+_0x5539('0xa')+'&'+_0x10fefa+'&'+_0x417b4c,'auth':_0x56b645,'json':!![]};return rp(_0x5558e9)['then'](function(_0x3caf33){if(_0x3caf33['result'][_0x5539('0xb')]>0x0){_0x37fb7d[_0x5539('0xc')]=_0x3caf33['result'][0x0][_0x5539('0xd')];}logger[_0x5539('0xe')]('['+[_0x16af83[_0x5539('0xf')]()]+_0x5539('0x10'),_0x37fb7d);_0x5e44a2(_0x37fb7d);})[_0x5539('0x11')](function(_0x3f9d46){logger[_0x5539('0x12')]('['+[_0x16af83['toUpperCase']()]+']',_0x3f9d46[_0x5539('0x13')]);_0x5513f6(_0x3f9d46[_0x5539('0x13')]);});});}function getUser(_0x4e111f,_0x42129b,_0x53a861,_0x3d1ad7,_0x53b670){return function(_0x3d1585){logger[_0x5539('0xe')]('['+[_0x4e111f[_0x5539('0xf')]()]+_0x5539('0x14'),_0x3d1585);return new Promise(function(_0x437b01,_0x2994f0){if(intUtil['validateEmail'](_0x3d1585['userEmail'])){var _0x52476f={'method':_0x5539('0x15'),'uri':_0x53a861+'sys_user?sysparm_query=email%3D'+_0x3d1585[_0x5539('0x16')]+'&'+_0x3d1ad7+'&'+_0x53b670,'auth':_0x42129b,'json':!![]};logger[_0x5539('0xe')]('['+[_0x4e111f[_0x5539('0xf')]()]+'],\x20getUser\x20rp\x20obj',_0x52476f);return rp(_0x52476f)[_0x5539('0x17')](function(_0x5c52e7){logger['info']('['+[_0x4e111f[_0x5539('0xf')]()]+'],\x20getUser\x20entity',_0x5c52e7);if(_0x5c52e7[_0x5539('0x18')][_0x5539('0xb')]>0x0&&String(_0x5c52e7[_0x5539('0x18')][0x0][_0x5539('0x19')])==='true'){_0x3d1585['userId']=_0x5c52e7['result'][0x0][_0x5539('0xd')];}else{_0x3d1585[_0x5539('0x1a')]=_0x3d1585[_0x5539('0xc')];_0x3d1585[_0x5539('0x16')]=_0x3d1585[_0x5539('0x1b')];}logger[_0x5539('0xe')]('['+[_0x4e111f[_0x5539('0xf')]()]+_0x5539('0x1c'),_0x3d1585);_0x437b01(_0x3d1585);})[_0x5539('0x11')](function(_0x3e46f6){logger[_0x5539('0x12')]('['+[_0x4e111f[_0x5539('0xf')]()]+']',_0x3e46f6[_0x5539('0x13')]);_0x2994f0(_0x3e46f6[_0x5539('0x13')]);});}else{logger[_0x5539('0xe')]('['+[_0x4e111f[_0x5539('0xf')]()]+_0x5539('0x1d'));_0x3d1585['userId']=_0x3d1585['adminId'];_0x3d1585[_0x5539('0x16')]=_0x3d1585[_0x5539('0x1b')];_0x437b01(_0x3d1585);}});};}function createEndUser(_0x4a6c79,_0x619186,_0x5c0be7,_0x58844f,_0x2679dd){logger[_0x5539('0xe')]('['+[_0x4a6c79['toUpperCase']()]+_0x5539('0x1e'),_0x5c0be7);return new Promise(function(_0x14974f,_0x52d175){var _0x481f49={'method':_0x5539('0x1f'),'uri':_0x58844f+'sys_user?'+_0x2679dd,'body':{'user_name':_0x5c0be7[_0x5539('0x20')],'roles':_0x5539('0x21'),'first_name':_0x5c0be7['endUserNumber'],'active':_0x5539('0x22'),'date_format':'System','phone':_0x5c0be7[_0x5539('0x20')]},'auth':_0x619186,'json':!![]};return rp(_0x481f49)['then'](function(_0x529f46){logger[_0x5539('0xe')]('['+[_0x4a6c79['toUpperCase']()]+_0x5539('0x23'),_0x529f46[_0x5539('0x18')]);_0x5c0be7[_0x5539('0x24')]=_0x529f46['result'][_0x5539('0xd')];_0x14974f(_0x5c0be7);})[_0x5539('0x11')](function(_0x412f14){logger['error']('['+[_0x4a6c79[_0x5539('0xf')]()]+']',_0x412f14[_0x5539('0x13')]);_0x52d175(_0x412f14[_0x5539('0x13')]);});});}function getEndUser(_0xef6b3e,_0x40d9ac,_0x5d1b3a,_0x66a33c,_0x5b849e){return function(_0x460247){logger[_0x5539('0xe')]('['+[_0xef6b3e['toUpperCase']()]+_0x5539('0x25'),_0x460247);return new Promise(function(_0x21212d,_0x49abe9){var _0x51d1ed={'method':_0x5539('0x15'),'uri':_0x5d1b3a+'sys_user?sysparm_query=phone%3D'+_0x460247[_0x5539('0x20')]+'&'+_0x66a33c+'&'+_0x5b849e,'auth':_0x40d9ac,'json':!![]};return rp(_0x51d1ed)['then'](function(_0x217a7a){if(_0x217a7a[_0x5539('0x18')][_0x5539('0xb')]>0x0){_0x460247[_0x5539('0x24')]=_0x217a7a[_0x5539('0x18')][0x0]['sys_id'];logger['info']('['+[_0xef6b3e[_0x5539('0xf')]()]+_0x5539('0x26'),_0x460247);_0x21212d(_0x460247);}else{return createEndUser(_0xef6b3e,_0x40d9ac,_0x460247,_0x5d1b3a,_0x66a33c)[_0x5539('0x17')](function(_0x1d6ea0){logger['info']('['+[_0xef6b3e[_0x5539('0xf')]()]+_0x5539('0x27'),_0x1d6ea0);_0x21212d(_0x1d6ea0);});}})[_0x5539('0x11')](function(_0x20457a){logger[_0x5539('0x12')]('['+[_0xef6b3e[_0x5539('0xf')]()]+']',_0x20457a['message']);_0x49abe9(_0x20457a['message']);});});};}function getCustomFields(_0x5b52bc,_0x440f45){var _0x3b685d={};if(_0x5b52bc[_0x5539('0xb')]>0x0){_['forEach'](_0x5b52bc,function(_0x6ceeb2){if(_0x6ceeb2['type']===_0x5539('0x28')&&_0x6ceeb2['nameField']&&!_0x6ceeb2[_0x5539('0x29')]){_0x3b685d[_0x6ceeb2[_0x5539('0x2a')]['toLowerCase']()]=_0x6ceeb2[_0x5539('0x2b')][_0x5539('0x2c')]();}else if(_0x6ceeb2[_0x5539('0x2d')]===_0x5539('0x28')&&_0x6ceeb2[_0x5539('0x2a')]&&_0x6ceeb2[_0x5539('0x29')]){_0x3b685d[_0x6ceeb2[_0x5539('0x2a')][_0x5539('0x2e')]()]=_0x6ceeb2[_0x5539('0x2b')][_0x5539('0x2c')]();}else if(_0x6ceeb2[_0x5539('0x2d')]==='variable'&&_0x6ceeb2[_0x5539('0x2f')]&&_0x6ceeb2[_0x5539('0x2a')]&&_0x6ceeb2[_0x5539('0x29')]){_0x3b685d[_0x6ceeb2[_0x5539('0x2a')][_0x5539('0x2e')]()]=_0x440f45[_0x6ceeb2[_0x5539('0x2f')]][_0x5539('0x2c')]();}else if(_0x6ceeb2[_0x5539('0x2d')]===_0x5539('0x30')&&_0x6ceeb2[_0x5539('0x31')]&&_0x6ceeb2[_0x5539('0x31')][_0x5539('0x32')]&&_0x6ceeb2[_0x5539('0x2a')]&&_0x6ceeb2[_0x5539('0x29')]){_0x3b685d[_0x6ceeb2[_0x5539('0x2a')][_0x5539('0x2e')]()]=_0x440f45[_0x6ceeb2[_0x5539('0x31')][_0x5539('0x32')][_0x5539('0x2e')]()]['toString']();}});}return _0x3b685d;}function getTicket(_0x29146b,_0x40daa7,_0x4b31c7,_0x2ba492,_0x3e7543,_0x18a1b4){return function(_0x28233b){logger[_0x5539('0xe')]('['+[_0x29146b['toUpperCase']()]+_0x5539('0x33'),_0x28233b);return new Promise(function(_0x3ee3bb,_0x23304e){var _0x4db110=_0x29146b[_0x5539('0x2e')]()===_0x5539('0x34')?_0x28233b[_0x5539('0x1a')]:_0x28233b[_0x5539('0x24')];var _0x2234ba={'method':_0x5539('0x1f'),'uri':_0x4b31c7+'incident'+'?'+_0x18a1b4,'body':Object[_0x5539('0x35')]({},{'active':'true','caller_id':_0x4db110,'assigned_to':_0x28233b[_0x5539('0x1a')],'short_description':intUtil[_0x5539('0x36')](_0x2ba492[_0x5539('0x37')],_0x3e7543,'\x20'),'description':intUtil[_0x5539('0x36')](_0x2ba492[_0x5539('0x38')],_0x3e7543,'\x0a')},getCustomFields(_0x2ba492[_0x5539('0x39')],_0x3e7543)),'auth':_0x40daa7,'json':!![]};return rp(_0x2234ba)[_0x5539('0x17')](function(_0x19388f){logger[_0x5539('0xe')]('['+[_0x29146b[_0x5539('0xf')]()]+_0x5539('0x3a'),_0x19388f[_0x5539('0x18')]);_0x28233b[_0x5539('0x3b')]=_0x19388f['result'][_0x5539('0xd')];_0x28233b['ticketNumber']=_0x19388f[_0x5539('0x18')][_0x5539('0x3c')];logger['info']('['+[_0x29146b['toUpperCase']()]+_0x5539('0x3d'),_0x28233b);_0x3ee3bb(_0x28233b);})[_0x5539('0x11')](function(_0x39d4de){logger['error']('['+[_0x29146b[_0x5539('0xf')]()]+']',_0x39d4de['message']);_0x23304e(_0x39d4de[_0x5539('0x13')]);});});};}function createRemoteTag(_0x4cdff1,_0x3e546c,_0x345325,_0x52d7ad){return new Promise(function(_0x35305c,_0x52cf3c){var _0x105020={'method':_0x5539('0x1f'),'uri':_0x345325+'label'+'?'+_0x52d7ad,'body':{'short_description':_0x4cdff1,'global':!![],'active':!![],'name':_0x4cdff1},'auth':_0x3e546c,'json':!![]};return rp(_0x105020)[_0x5539('0x17')](function(_0x4322d9){var _0x4ac6fc=_0x4322d9[_0x5539('0x18')][_0x5539('0xd')];_0x35305c(_0x4ac6fc);});});}function getRemoteTag(_0x219eca,_0xbdd32c,_0x39a13b,_0x26deea,_0x4c3e75){return new Promise(function(_0x4f45ea,_0x90a80f){var _0x290c3f={'method':_0x5539('0x15'),'uri':_0x39a13b+_0x5539('0x3e')+'?sysparm_query=name%3D'+_0x219eca+'&'+_0x26deea,'auth':_0xbdd32c,'json':!![]};return rp(_0x290c3f)[_0x5539('0x17')](function(_0x152563){if(_0x152563['result'][_0x5539('0xb')]>0x0){var _0x258ce4=_0x152563['result'][0x0][_0x5539('0xd')];_0x4f45ea(_0x258ce4);}else{return createRemoteTag(_0x219eca,_0xbdd32c,_0x39a13b,_0x26deea)[_0x5539('0x17')](function(_0x39db72){_0x4f45ea(_0x39db72);});}});});}function assignTagToIncident(_0x248e51,_0xdb92c9,_0x3a9565,_0x1a0811,_0x574dd0){return new Promise(function(_0x1e6b5e,_0x2b0936){var _0x3b39dd={'method':_0x5539('0x1f'),'uri':_0x3a9565+_0x5539('0x3f')+'?'+_0x574dd0,'body':{'label':_0x248e51,'table':'incident','id_type':_0x5539('0x40'),'table_key':_0x1a0811['ticketId'],'title':_0x5539('0x41')+_0x1a0811[_0x5539('0x42')],'id_display':_0x1a0811['ticketNumber']},'auth':_0xdb92c9,'json':!![]};return rp(_0x3b39dd)[_0x5539('0x17')](function(_0x22451b){_0x1e6b5e();})['catch'](function(){_0x1e6b5e();});});}function manageTags(_0xa8241a,_0x891bef,_0x5763ab,_0x3b4247,_0x4cc4ea,_0x4d30c2,_0x78cc41){return new Promise(function(_0x3a00f2,_0x2e8511){var _0x1fda23=[];_0x891bef[_0x5539('0x43')](function(_0x10e252){_0x1fda23[_0x5539('0x44')](getRemoteTag(_0x10e252,_0x5763ab,_0x3b4247,_0x4d30c2,_0x78cc41));});return Promise[_0x5539('0x45')](_0x1fda23)[_0x5539('0x17')](function(_0x53c791){if(_0x53c791['length']){logger['info']('['+[_0xa8241a[_0x5539('0xf')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x53c791);var _0x3cc9e2=[];_0x53c791[_0x5539('0x43')](function(_0x4f14da){_0x3cc9e2[_0x5539('0x44')](assignTagToIncident(_0x4f14da,_0x5763ab,_0x3b4247,_0x4cc4ea,_0x4d30c2));});return Promise[_0x5539('0x45')](_0x3cc9e2)['then'](function(){_0x3a00f2();})[_0x5539('0x11')](function(){_0x3a00f2();});}else{_0x3a00f2();}});});}function getTags(_0x417c8f,_0x63cc37,_0x434086,_0x4932a4,_0x491f63,_0x1cec62){return function(_0x421805){return new Promise(function(_0x2a27a7,_0x4a5ab4){var _0x1ad805=[];var _0x231d11=_0x4932a4[_0x5539('0x46')];if(_0x231d11&&_0x231d11[_0x5539('0xb')]>0x0){_0x1ad805=_[_0x5539('0x47')](_0x231d11,'name');}if(_0x1ad805['length']>0x0){return manageTags(_0x417c8f,_0x1ad805,_0x63cc37,_0x434086,_0x421805,_0x491f63,_0x1cec62)['then'](function(){_0x2a27a7(_0x421805);});}else{_0x2a27a7(_0x421805);}});};}function emit(_0x3f088c,_0xd9bd78,_0x17388f){var _0x5914e0=_0x5539('0x48')+_0x5539('0x49')+_0x5539('0x4a')+_0x5539('0x4b');var _0x12003d={'uri':_0x3f088c+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x17388f+_0x5914e0};io['to'](util[_0x5539('0x4c')](_0x5539('0x4d'),_0xd9bd78))[_0x5539('0x4e')](_0x5539('0x4f'),_0x12003d);}exports['cs']=function(_0x10d021,_0x42fc3a,_0x201c3e,_0x28e931,_0x32c278,_0x1219a2,_0x11987a,_0x320e26){var _0xa58d2e={};var _0xb9e2eb={'user':_0x1219a2[_0x5539('0x50')],'pass':_0x1219a2[_0x5539('0x51')]};var _0xbe8850=_0x5539('0x52');var _0x3559d6=_0x5539('0x53');_0x1219a2[_0x5539('0x54')]=intUtil[_0x5539('0x55')](_0x1219a2[_0x5539('0x54')]);_0x1219a2[_0x5539('0x56')]=intUtil[_0x5539('0x55')](_0x1219a2[_0x5539('0x56')]);var _0x334d3f=util[_0x5539('0x4c')](_0x5539('0x57'),_0x1219a2[_0x5539('0x54')]);_0xa58d2e[_0x5539('0x16')]=!_['isNil'](_0x28e931)?_0x28e931[_0x5539('0x58')]:null;_0xa58d2e[_0x5539('0x1b')]=_0x1219a2[_0x5539('0x58')];_0xa58d2e['endUserNumber']=_0x320e26[_0x5539('0x2e')]()==='outbound'?_0x42fc3a['destcalleridnum']:_0x42fc3a[_0x5539('0x59')];_0xa58d2e['callDirection']=_0x320e26===_0x5539('0x5a')||_0x320e26===_0x5539('0x5b')?_0x5539('0x5a'):_0x5539('0x34');var _0x74093e=util['format'](_0x5539('0x5c'),_0x1219a2[_0x5539('0x56')],_0x42fc3a[_0x5539('0x5d')],md5(_0x42fc3a[_0x5539('0x5d')]));if(_0x32c278&&_0x32c278[_0x5539('0x5e')]){logger[_0x5539('0xe')](_0x5539('0x5f'),_0x5539('0x60'));_0x42fc3a[_0x5539('0x61')]=_0x74093e;}else if(_0x11987a&&_0x11987a['recordingFormat']&&_0x11987a[_0x5539('0x62')]!==_0x5539('0x63')){logger[_0x5539('0xe')](_0x5539('0x64'),'Recording\x20is\x20enabled!');_0x42fc3a[_0x5539('0x61')]=_0x74093e;}else{_0x42fc3a[_0x5539('0x61')]='';}return getAdminUser(_0x320e26,_0xb9e2eb,_0xa58d2e,_0x334d3f,_0x3559d6,_0xbe8850)[_0x5539('0x17')](getUser(_0x320e26,_0xb9e2eb,_0x334d3f,_0x3559d6,_0xbe8850))[_0x5539('0x17')](getEndUser(_0x320e26,_0xb9e2eb,_0x334d3f,_0x3559d6,_0xbe8850))[_0x5539('0x17')](getTicket(_0x320e26,_0xb9e2eb,_0x334d3f,_0x201c3e,_0x42fc3a,_0x3559d6))[_0x5539('0x17')](function(_0x4e10e7){logger['info'](util[_0x5539('0x4c')](_0x5539('0x65'),_0x4e10e7[_0x5539('0x3b')]));logger['info'](util[_0x5539('0x4c')](_0x5539('0x66'),_0x320e26));if(_0x320e26!=='abandoned'){logger[_0x5539('0xe')]('['+[_0x320e26[_0x5539('0xf')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x1219a2['remoteUri'],_0x28e931[_0x5539('0x32')],_0x4e10e7[_0x5539('0x3b')]);}})[_0x5539('0x11')](function(_0x154393){logger[_0x5539('0x12')]('['+[_0x320e26[_0x5539('0xf')]()]+_0x5539('0x67'),util[_0x5539('0x68')](_0x154393,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x078c=['sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','adminEmail','],\x20getUser\x20crm','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','length','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','type','string','nameField','idField','toLowerCase','toString','customField','content','variableName','customVariable','Variable','name','POST','incident','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','forEach','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','format','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','stripTrailingSlash','serverUrl','isNil','email','outbound','destcalleridnum','calleridnum','abandoned','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','remoteUri',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x078c,0x19f));var _0xc078=function(_0x3d38ae,_0x51102b){_0x3d38ae=_0x3d38ae-0x0;var _0x3757ee=_0x078c[_0x3d38ae];return _0x3757ee;};'use strict';var _=require(_0xc078('0x0'));var Promise=require('bluebird');var rp=require(_0xc078('0x1'));var util=require(_0xc078('0x2'));var md5=require('md5');var Redis=require(_0xc078('0x3'));var intUtil=require(_0xc078('0x4'));var config=require(_0xc078('0x5'));var logger=require(_0xc078('0x6'))('servicenow');config[_0xc078('0x7')]=_[_0xc078('0x8')](config[_0xc078('0x7')],{'host':_0xc078('0x9'),'port':0x18eb});var io=require(_0xc078('0xa'))(new Redis(config[_0xc078('0x7')]));function getAdminUser(_0x22661e,_0x4030b1,_0x4d56df,_0x543ad6,_0x59b6a6,_0x28dc54){return new Promise(function(_0x1bd3ba,_0x47aca0){var _0xf3ab2c={'method':_0xc078('0xb'),'uri':_0x543ad6+_0xc078('0xc')+'&'+_0x59b6a6+'&'+_0x28dc54,'auth':_0x4030b1,'json':!![]};return rp(_0xf3ab2c)[_0xc078('0xd')](function(_0x1c37af){if(_0x1c37af['result']['length']>0x0){_0x4d56df[_0xc078('0xe')]=_0x1c37af[_0xc078('0xf')][0x0][_0xc078('0x10')];}logger[_0xc078('0x11')]('['+[_0x22661e[_0xc078('0x12')]()]+_0xc078('0x13'),_0x4d56df);_0x1bd3ba(_0x4d56df);})[_0xc078('0x14')](function(_0x3a3fa8){logger[_0xc078('0x15')]('['+[_0x22661e[_0xc078('0x12')]()]+']',_0x3a3fa8[_0xc078('0x16')]);_0x47aca0(_0x3a3fa8[_0xc078('0x16')]);});});}function getUser(_0x3bd50b,_0x36b6b1,_0x404ab0,_0x5a1cbc,_0x39e242){return function(_0x113618){logger[_0xc078('0x11')]('['+[_0x3bd50b['toUpperCase']()]+_0xc078('0x17'),_0x113618);return new Promise(function(_0x5ab33a,_0x5eb7c4){if(intUtil[_0xc078('0x18')](_0x113618['userEmail'])){var _0x2ec2d5={'method':'GET','uri':_0x404ab0+_0xc078('0x19')+_0x113618[_0xc078('0x1a')]+'&'+_0x5a1cbc+'&'+_0x39e242,'auth':_0x36b6b1,'json':!![]};logger[_0xc078('0x11')]('['+[_0x3bd50b['toUpperCase']()]+_0xc078('0x1b'),_0x2ec2d5);return rp(_0x2ec2d5)['then'](function(_0xcf2627){logger[_0xc078('0x11')]('['+[_0x3bd50b[_0xc078('0x12')]()]+_0xc078('0x1c'),_0xcf2627);if(_0xcf2627[_0xc078('0xf')]['length']>0x0&&String(_0xcf2627[_0xc078('0xf')][0x0][_0xc078('0x1d')])===_0xc078('0x1e')){_0x113618[_0xc078('0x1f')]=_0xcf2627['result'][0x0][_0xc078('0x10')];}else{_0x113618[_0xc078('0x1f')]=_0x113618[_0xc078('0xe')];_0x113618[_0xc078('0x1a')]=_0x113618[_0xc078('0x20')];}logger[_0xc078('0x11')]('['+[_0x3bd50b[_0xc078('0x12')]()]+_0xc078('0x21'),_0x113618);_0x5ab33a(_0x113618);})[_0xc078('0x14')](function(_0x3017a3){logger[_0xc078('0x15')]('['+[_0x3bd50b['toUpperCase']()]+']',_0x3017a3['message']);_0x5eb7c4(_0x3017a3[_0xc078('0x16')]);});}else{logger['info']('['+[_0x3bd50b['toUpperCase']()]+']\x20using\x20admin\x20profile');_0x113618[_0xc078('0x1f')]=_0x113618['adminId'];_0x113618[_0xc078('0x1a')]=_0x113618[_0xc078('0x20')];_0x5ab33a(_0x113618);}});};}function createEndUser(_0x2d46c9,_0x22f7e9,_0xd43338,_0x2b257c,_0x7c965e){logger[_0xc078('0x11')]('['+[_0x2d46c9[_0xc078('0x12')]()]+_0xc078('0x22'),_0xd43338);return new Promise(function(_0x1b9223,_0x5e376c){var _0x2ea3c3={'method':'POST','uri':_0x2b257c+_0xc078('0x23')+_0x7c965e,'body':{'user_name':_0xd43338[_0xc078('0x24')],'roles':_0xc078('0x25'),'first_name':_0xd43338[_0xc078('0x24')],'active':'true','date_format':_0xc078('0x26'),'phone':_0xd43338['endUserNumber']},'auth':_0x22f7e9,'json':!![]};return rp(_0x2ea3c3)['then'](function(_0x34e802){logger[_0xc078('0x11')]('['+[_0x2d46c9['toUpperCase']()]+_0xc078('0x27'),_0x34e802[_0xc078('0xf')]);_0xd43338[_0xc078('0x28')]=_0x34e802['result']['sys_id'];_0x1b9223(_0xd43338);})[_0xc078('0x14')](function(_0x4ff791){logger[_0xc078('0x15')]('['+[_0x2d46c9[_0xc078('0x12')]()]+']',_0x4ff791['message']);_0x5e376c(_0x4ff791[_0xc078('0x16')]);});});}function getEndUser(_0x1429e0,_0x289f84,_0x5a0d3c,_0x4263e7,_0x2cb624){return function(_0x3fb772){logger['info']('['+[_0x1429e0['toUpperCase']()]+_0xc078('0x29'),_0x3fb772);return new Promise(function(_0x364d3c,_0x5c672c){var _0x4d4cfb={'method':'GET','uri':_0x5a0d3c+'sys_user?sysparm_query=phone%3D'+_0x3fb772['endUserNumber']+'&'+_0x4263e7+'&'+_0x2cb624,'auth':_0x289f84,'json':!![]};return rp(_0x4d4cfb)[_0xc078('0xd')](function(_0x2ff087){if(_0x2ff087[_0xc078('0xf')][_0xc078('0x2a')]>0x0){_0x3fb772['endUserId']=_0x2ff087[_0xc078('0xf')][0x0]['sys_id'];logger['info']('['+[_0x1429e0[_0xc078('0x12')]()]+_0xc078('0x2b'),_0x3fb772);_0x364d3c(_0x3fb772);}else{return createEndUser(_0x1429e0,_0x289f84,_0x3fb772,_0x5a0d3c,_0x4263e7)[_0xc078('0xd')](function(_0x8b5f10){logger[_0xc078('0x11')]('['+[_0x1429e0[_0xc078('0x12')]()]+_0xc078('0x2c'),_0x8b5f10);_0x364d3c(_0x8b5f10);});}})[_0xc078('0x14')](function(_0x534def){logger['error']('['+[_0x1429e0['toUpperCase']()]+']',_0x534def['message']);_0x5c672c(_0x534def[_0xc078('0x16')]);});});};}function getCustomFields(_0x5de28a,_0x122555){var _0x4c6d76={};if(_0x5de28a[_0xc078('0x2a')]>0x0){_['forEach'](_0x5de28a,function(_0x59182e){if(_0x59182e[_0xc078('0x2d')]===_0xc078('0x2e')&&_0x59182e[_0xc078('0x2f')]&&!_0x59182e['customField']){_0x4c6d76[_0x59182e[_0xc078('0x30')][_0xc078('0x31')]()]=_0x59182e['content'][_0xc078('0x32')]();}else if(_0x59182e[_0xc078('0x2d')]===_0xc078('0x2e')&&_0x59182e[_0xc078('0x30')]&&_0x59182e[_0xc078('0x33')]){_0x4c6d76[_0x59182e['idField'][_0xc078('0x31')]()]=_0x59182e[_0xc078('0x34')][_0xc078('0x32')]();}else if(_0x59182e['type']==='variable'&&_0x59182e[_0xc078('0x35')]&&_0x59182e['idField']&&_0x59182e['customField']){_0x4c6d76[_0x59182e[_0xc078('0x30')][_0xc078('0x31')]()]=_0x122555[_0x59182e['variableName']][_0xc078('0x32')]();}else if(_0x59182e['type']===_0xc078('0x36')&&_0x59182e['Variable']&&_0x59182e[_0xc078('0x37')][_0xc078('0x38')]&&_0x59182e[_0xc078('0x30')]&&_0x59182e[_0xc078('0x33')]){_0x4c6d76[_0x59182e['idField'][_0xc078('0x31')]()]=_0x122555[_0x59182e[_0xc078('0x37')][_0xc078('0x38')][_0xc078('0x31')]()]['toString']();}});}return _0x4c6d76;}function getTicket(_0x477401,_0x2e6980,_0x1416f9,_0x38a3f2,_0x2565c5,_0x5647dd){return function(_0x2efae2){logger['info']('['+[_0x477401['toUpperCase']()]+']\x20getTicket\x20input\x20crm',_0x2efae2);return new Promise(function(_0xbdd2ff,_0x4659f6){var _0x35b3e1=_0x477401['toLowerCase']()==='outbound'?_0x2efae2[_0xc078('0x1f')]:_0x2efae2[_0xc078('0x28')];var _0x5a59e0={'method':_0xc078('0x39'),'uri':_0x1416f9+_0xc078('0x3a')+'?'+_0x5647dd,'body':Object['assign']({},{'active':_0xc078('0x1e'),'caller_id':_0x35b3e1,'assigned_to':_0x2efae2['userId'],'short_description':intUtil[_0xc078('0x3b')](_0x38a3f2[_0xc078('0x3c')],_0x2565c5,'\x20'),'description':intUtil[_0xc078('0x3b')](_0x38a3f2[_0xc078('0x3d')],_0x2565c5,'\x0a')},getCustomFields(_0x38a3f2[_0xc078('0x3e')],_0x2565c5)),'auth':_0x2e6980,'json':!![]};return rp(_0x5a59e0)[_0xc078('0xd')](function(_0x59e9b9){logger[_0xc078('0x11')]('['+[_0x477401[_0xc078('0x12')]()]+_0xc078('0x3f'),_0x59e9b9[_0xc078('0xf')]);_0x2efae2[_0xc078('0x40')]=_0x59e9b9['result'][_0xc078('0x10')];_0x2efae2[_0xc078('0x41')]=_0x59e9b9['result'][_0xc078('0x42')];logger[_0xc078('0x11')]('['+[_0x477401[_0xc078('0x12')]()]+']\x20getTicket\x20crm',_0x2efae2);_0xbdd2ff(_0x2efae2);})[_0xc078('0x14')](function(_0x5e3021){logger[_0xc078('0x15')]('['+[_0x477401[_0xc078('0x12')]()]+']',_0x5e3021[_0xc078('0x16')]);_0x4659f6(_0x5e3021[_0xc078('0x16')]);});});};}function createRemoteTag(_0x5bf30c,_0x14e76c,_0x3c1cc2,_0x26f8ab){return new Promise(function(_0x3de9b7,_0x2751d7){var _0x142b1d={'method':_0xc078('0x39'),'uri':_0x3c1cc2+_0xc078('0x43')+'?'+_0x26f8ab,'body':{'short_description':_0x5bf30c,'global':!![],'active':!![],'name':_0x5bf30c},'auth':_0x14e76c,'json':!![]};return rp(_0x142b1d)[_0xc078('0xd')](function(_0x1c04ef){var _0x27de1e=_0x1c04ef['result'][_0xc078('0x10')];_0x3de9b7(_0x27de1e);});});}function getRemoteTag(_0x51fa14,_0x15de18,_0x1929cf,_0x4926be,_0x5cdc37){return new Promise(function(_0x5c30d9,_0x4da9d6){var _0xff7428={'method':_0xc078('0xb'),'uri':_0x1929cf+_0xc078('0x43')+_0xc078('0x44')+_0x51fa14+'&'+_0x4926be,'auth':_0x15de18,'json':!![]};return rp(_0xff7428)[_0xc078('0xd')](function(_0x81024a){if(_0x81024a[_0xc078('0xf')][_0xc078('0x2a')]>0x0){var _0x2225b7=_0x81024a['result'][0x0]['sys_id'];_0x5c30d9(_0x2225b7);}else{return createRemoteTag(_0x51fa14,_0x15de18,_0x1929cf,_0x4926be)[_0xc078('0xd')](function(_0x24112b){_0x5c30d9(_0x24112b);});}});});}function assignTagToIncident(_0x358dd4,_0x2955c4,_0x29f02c,_0x178748,_0x345b93){return new Promise(function(_0x202725,_0x21d04d){var _0x4547a3={'method':'POST','uri':_0x29f02c+_0xc078('0x45')+'?'+_0x345b93,'body':{'label':_0x358dd4,'table':'incident','id_type':_0xc078('0x46'),'table_key':_0x178748[_0xc078('0x40')],'title':_0xc078('0x47')+_0x178748[_0xc078('0x41')],'id_display':_0x178748[_0xc078('0x41')]},'auth':_0x2955c4,'json':!![]};return rp(_0x4547a3)['then'](function(_0xd2dbd7){_0x202725();})['catch'](function(){_0x202725();});});}function manageTags(_0x20af79,_0x482399,_0x2535e2,_0x4bc972,_0x4baa79,_0x270ff3,_0x35c4d9){return new Promise(function(_0x36067a,_0x547ed9){var _0x3eb742=[];_0x482399[_0xc078('0x48')](function(_0x304a22){_0x3eb742[_0xc078('0x49')](getRemoteTag(_0x304a22,_0x2535e2,_0x4bc972,_0x270ff3,_0x35c4d9));});return Promise[_0xc078('0x4a')](_0x3eb742)[_0xc078('0xd')](function(_0x191c30){if(_0x191c30[_0xc078('0x2a')]){logger[_0xc078('0x11')]('['+[_0x20af79[_0xc078('0x12')]()]+_0xc078('0x4b'),_0x191c30);var _0x54cbee=[];_0x191c30['forEach'](function(_0x439ee9){_0x54cbee[_0xc078('0x49')](assignTagToIncident(_0x439ee9,_0x2535e2,_0x4bc972,_0x4baa79,_0x270ff3));});return Promise[_0xc078('0x4a')](_0x54cbee)[_0xc078('0xd')](function(){_0x36067a();})[_0xc078('0x14')](function(){_0x36067a();});}else{_0x36067a();}});});}function getTags(_0x47741b,_0x127b46,_0x4f7de5,_0x989bef,_0x2a8705,_0x1368a1){return function(_0x2a8907){return new Promise(function(_0x2eb572,_0x451dea){var _0x10da92=[];var _0x2728c5=_0x989bef[_0xc078('0x4c')];if(_0x2728c5&&_0x2728c5[_0xc078('0x2a')]>0x0){_0x10da92=_[_0xc078('0x4d')](_0x2728c5,_0xc078('0x38'));}if(_0x10da92[_0xc078('0x2a')]>0x0){return manageTags(_0x47741b,_0x10da92,_0x127b46,_0x4f7de5,_0x2a8907,_0x2a8705,_0x1368a1)[_0xc078('0xd')](function(){_0x2eb572(_0x2a8907);});}else{_0x2eb572(_0x2a8907);}});};}function emit(_0x593fee,_0xbfc8ad,_0x256218){var _0x190aa1='%26sysparm_record_target%3Dincident'+_0xc078('0x4e')+_0xc078('0x4f')+'%255EORDERBYDESCnumber';var _0x2301fc={'uri':_0x593fee+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x256218+_0x190aa1};io['to'](util[_0xc078('0x50')](_0xc078('0x51'),_0xbfc8ad))[_0xc078('0x52')](_0xc078('0x53'),_0x2301fc);}exports['cs']=function(_0x24ad8d,_0x4aa14d,_0x210e35,_0xebdd30,_0x2ede88,_0x5b8bbb,_0x3d6165,_0x1b99cf){var _0x22d25e={};var _0x93d01a={'user':_0x5b8bbb[_0xc078('0x54')],'pass':_0x5b8bbb[_0xc078('0x55')]};var _0x2eb353=_0xc078('0x56');var _0x7945c4=_0xc078('0x57');_0x5b8bbb['remoteUri']=intUtil[_0xc078('0x58')](_0x5b8bbb['remoteUri']);_0x5b8bbb['serverUrl']=intUtil[_0xc078('0x58')](_0x5b8bbb[_0xc078('0x59')]);var _0x4eec1a=util[_0xc078('0x50')]('%s/api/now/table/',_0x5b8bbb['remoteUri']);_0x22d25e[_0xc078('0x1a')]=!_[_0xc078('0x5a')](_0xebdd30)?_0xebdd30[_0xc078('0x5b')]:null;_0x22d25e[_0xc078('0x20')]=_0x5b8bbb[_0xc078('0x5b')];_0x22d25e['endUserNumber']=_0x1b99cf['toLowerCase']()===_0xc078('0x5c')?_0x4aa14d[_0xc078('0x5d')]:_0x4aa14d[_0xc078('0x5e')];_0x22d25e['callDirection']=_0x1b99cf==='queue'||_0x1b99cf===_0xc078('0x5f')?_0xc078('0x60'):_0xc078('0x5c');var _0x5b0c59=util[_0xc078('0x50')](_0xc078('0x61'),_0x5b8bbb[_0xc078('0x59')],_0x4aa14d[_0xc078('0x62')],md5(_0x4aa14d[_0xc078('0x62')]));if(_0x2ede88&&_0x2ede88[_0xc078('0x63')]){logger[_0xc078('0x11')]('[QUEUE]',_0xc078('0x64'));_0x4aa14d['recordingURL']=_0x5b0c59;}else if(_0x3d6165&&_0x3d6165[_0xc078('0x65')]&&_0x3d6165['recordingFormat']!==_0xc078('0x66')){logger['info'](_0xc078('0x67'),_0xc078('0x64'));_0x4aa14d[_0xc078('0x68')]=_0x5b0c59;}else{_0x4aa14d[_0xc078('0x68')]='';}return getAdminUser(_0x1b99cf,_0x93d01a,_0x22d25e,_0x4eec1a,_0x7945c4,_0x2eb353)['then'](getUser(_0x1b99cf,_0x93d01a,_0x4eec1a,_0x7945c4,_0x2eb353))['then'](getEndUser(_0x1b99cf,_0x93d01a,_0x4eec1a,_0x7945c4,_0x2eb353))[_0xc078('0xd')](getTicket(_0x1b99cf,_0x93d01a,_0x4eec1a,_0x210e35,_0x4aa14d,_0x7945c4))['then'](function(_0x5f50d4){logger['info'](util[_0xc078('0x50')](_0xc078('0x69'),_0x5f50d4['ticketId']));logger[_0xc078('0x11')](util['format'](_0xc078('0x6a'),_0x1b99cf));if(_0x1b99cf!==_0xc078('0x5f')){logger[_0xc078('0x11')]('['+[_0x1b99cf['toUpperCase']()]+']',_0xc078('0x6b'));emit(_0x5b8bbb[_0xc078('0x6c')],_0xebdd30[_0xc078('0x38')],_0x5f50d4[_0xc078('0x40')]);}})[_0xc078('0x14')](function(_0x501de0){logger[_0xc078('0x15')]('['+[_0x1b99cf[_0xc078('0x12')]()]+_0xc078('0x6d'),util['inspect'](_0x501de0,{'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 aa72ee1..d2de3dc 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 _0x720d=['getString','assigned_user_id','created_by','description','Descriptions','toISOString','replace','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','length','forEach','variableName','push','idField','JSON','Calls','format','Basic\x20%s','apiKey','toString','get_server_info','info','Getting\x20agent\x20with\x20name','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','value','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','get_entry_list','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','stringify','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','type','string','nameField','customField','toLowerCase','content','variable','customVariable','Variable','custom_fields','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','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','version','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[QUEUE]','trigger:browser:url','catch','error','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','Fields','users','contacts','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','user:%s','abandoned','[ABANDONED]','calleridname','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','defaults','redis','localhost','socket.io-emitter','emit','name'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x720d,0xe3));var _0xd720=function(_0x21d62b,_0x2f38b1){_0x21d62b=_0x21d62b-0x0;var _0x45d415=_0x720d[_0x21d62b];return _0x45d415;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0xd720('0x0'));var md5=require('md5');var util=require(_0xd720('0x1'));var Redis=require(_0xd720('0x2'));var intUtil=require(_0xd720('0x3'));var config=require(_0xd720('0x4'));var logger=require(_0xd720('0x5'))(_0xd720('0x6'));config['redis']=_[_0xd720('0x7')](config[_0xd720('0x8')],{'host':_0xd720('0x9'),'port':0x18eb});var io=require(_0xd720('0xa'))(new Redis(config[_0xd720('0x8')]));var def={'method':'POST','json':!![]};function emit(_0x45c7b2,_0x36209d,_0x17c856){io['to'](_0x45c7b2)[_0xd720('0xb')](_0x36209d,_0x17c856);}function getTicket(_0x31b855,_0x19e130,_0x441a3b,_0x31376a,_0x547a12,_0x2bf6f3,_0x3d95a6,_0x346569){logger['info']('Creating\x20new\x20ticket...');var _0x35df8c=new Date();var _0x5d3d0e=[{'name':_0xd720('0xc'),'value':intUtil[_0xd720('0xd')](_0x31376a['Subjects'],_0x547a12,'\x20')},{'name':_0xd720('0xe'),'value':_0x19e130['id']},{'name':_0xd720('0xf'),'value':_0x19e130['id']},{'name':_0xd720('0x10'),'value':intUtil[_0xd720('0xd')](_0x31376a[_0xd720('0x11')],_0x547a12,'\x0a')},{'name':'date_start','value':_0x35df8c[_0xd720('0x12')]()['slice'](0x0,0x13)[_0xd720('0x13')]('T','\x20')},{'name':_0xd720('0x14'),'value':'0'},{'name':_0xd720('0x15'),'value':'15'},{'name':_0xd720('0x16'),'value':_0x441a3b['id']},{'name':_0xd720('0x17'),'value':'Contacts'},{'name':_0xd720('0x18'),'value':_0x441a3b[_0xd720('0xc')]},{'name':_0xd720('0x19'),'value':_0x346569}];if(_0x2bf6f3[_0xd720('0x1a')]){_[_0xd720('0x1b')](_0x2bf6f3,function(_0x5f1f91){if(_0x547a12[_0x5f1f91[_0xd720('0x1c')]]){_0x5d3d0e[_0xd720('0x1d')]({'name':_0x5f1f91[_0xd720('0x1e')],'value':_0x547a12[_0x5f1f91[_0xd720('0x1c')]]});}});}return request({'form':{'method':'set_entry','input_type':_0xd720('0x1f'),'response_type':_0xd720('0x1f'),'rest_data':JSON['stringify']({'session':_0x3d95a6['id'],'module_name':_0xd720('0x20'),'name_value_list':_0x5d3d0e})}});}function getAuth(_0x3d1ebe){return util[_0xd720('0x21')](_0xd720('0x22'),new Buffer(_0x3d1ebe[_0xd720('0x23')]+':X')[_0xd720('0x24')]('base64'));}function getServerInfo(_0x100016){return request({'form':{'method':_0xd720('0x25'),'input_type':'JSON','response_type':_0xd720('0x1f'),'rest_data':JSON['stringify']({'session':_0x100016['id']})}});}function getUser(_0x423c2c,_0x4664f0,_0x14a1c8){if(!_['isNil'](_0x4664f0)){logger[_0xd720('0x26')](_0xd720('0x27'),_0x4664f0);return request({'form':{'method':'get_entry_list','input_type':_0xd720('0x1f'),'response_type':_0xd720('0x1f'),'rest_data':JSON['stringify']({'session':_0x14a1c8['id'],'module_name':_0xd720('0x28'),'query':util[_0xd720('0x21')](_0xd720('0x29'),_0x4664f0),'order_by':'','offset':'0','select_fields':['id',_0xd720('0xc'),_0xd720('0x2a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xd720('0x2b')](function(_0x2af65d){if(_0x2af65d[_0xd720('0x2c')][_0xd720('0x1a')]){var _0x477706=_[_0xd720('0x2d')](_0x2af65d[_0xd720('0x2c')],function(_0x226ee2){return _0x226ee2[_0xd720('0x2e')][_0xd720('0x2a')][_0xd720('0x2f')]===_0x4664f0;});if(_0x477706){logger[_0xd720('0x26')]('Agent\x20found!');return BPromise[_0xd720('0x30')]({'id':_0x477706[_0xd720('0x2e')]['id'][_0xd720('0x2f')],'name':_0x477706['name_value_list'][_0xd720('0xc')]['value']});}}logger[_0xd720('0x26')](_0xd720('0x31'));return BPromise[_0xd720('0x30')]({'id':_0x14a1c8[_0xd720('0x2e')]['user_id'][_0xd720('0x2f')],'name':_0x14a1c8[_0xd720('0x2e')][_0xd720('0x2a')][_0xd720('0x2f')]});});}else{logger['info'](_0xd720('0x32'));return BPromise[_0xd720('0x30')]({'id':_0x14a1c8[_0xd720('0x2e')]['user_id'][_0xd720('0x2f')],'name':_0x14a1c8['name_value_list'][_0xd720('0x2a')][_0xd720('0x2f')]});}}function getEndUser(_0x4b46ab,_0x58b5b5,_0xe125f4,_0x113daa){logger['info'](_0xd720('0x33'),_0xe125f4);return request({'form':{'method':_0xd720('0x34'),'input_type':'JSON','response_type':_0xd720('0x1f'),'rest_data':JSON['stringify']({'session':_0x113daa['id'],'module_name':_0xd720('0x35'),'query':util[_0xd720('0x21')](_0xd720('0x36'),_0xe125f4),'order_by':'','offset':'0','select_fields':['id',_0xd720('0xc'),_0xd720('0x37')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xd720('0x2b')](function(_0x591887){if(_0x591887[_0xd720('0x2c')][_0xd720('0x1a')]){var _0x1554ee=_[_0xd720('0x2d')](_0x591887[_0xd720('0x2c')],function(_0x488fed){return _0x488fed['name_value_list'][_0xd720('0x37')][_0xd720('0x2f')]===_0xe125f4;});if(_0x1554ee){logger[_0xd720('0x26')]('Enduser\x20found!');return BPromise[_0xd720('0x30')]({'id':_0x1554ee['name_value_list']['id'][_0xd720('0x2f')],'name':_0x1554ee[_0xd720('0x2e')][_0xd720('0xc')]['value'],'phone':_0x1554ee[_0xd720('0x2e')][_0xd720('0x37')][_0xd720('0x2f')]});}}else{logger[_0xd720('0x26')](_0xd720('0x38'));return request({'form':{'method':_0xd720('0x39'),'input_type':_0xd720('0x1f'),'response_type':'JSON','rest_data':JSON[_0xd720('0x3a')]({'session':_0x113daa['id'],'module_name':_0xd720('0x35'),'name_value_list':[{'name':_0xd720('0x3b'),'value':_0x58b5b5!==_0xd720('0x3c')?_0x58b5b5:util[_0xd720('0x21')](_0xd720('0x3d'),_0xe125f4)},{'name':_0xd720('0x37'),'value':_0xe125f4}]})}})[_0xd720('0x2b')](function(_0x5a3026){logger[_0xd720('0x26')](_0xd720('0x3e'));return BPromise[_0xd720('0x30')]({'id':_0x5a3026['id'],'name':_0x5a3026[_0xd720('0x2c')]['first_name']['value'],'phone':_0x5a3026['entry_list']['phone_home'][_0xd720('0x2f')]});});}});}function request(_0x430c4f){logger[_0xd720('0x3f')](_0xd720('0x40'),JSON[_0xd720('0x3a')](_0x430c4f));return rp(_[_0xd720('0x41')](def,_0x430c4f));}function getTags(_0x22607a,_0x361133){var _0xccbd3d=[];if(_0x22607a&&_0x22607a[_0xd720('0x1a')]>0x0){_0xccbd3d=_[_0xd720('0x42')](_0x22607a,_0x361133);}return _0xccbd3d;}function getCustomFields(_0x31b619,_0x19dcff){var _0x2cfae8=[];var _0x400468={'custom_fields':[]};if(_0x31b619[_0xd720('0x1a')]>0x0){_['forEach'](_0x31b619,function(_0x4716f5){if(_0x4716f5[_0xd720('0x43')]===_0xd720('0x44')&&_0x4716f5[_0xd720('0x45')]&&!_0x4716f5[_0xd720('0x46')]){_0x400468[_0x4716f5[_0xd720('0x45')][_0xd720('0x47')]()]=_0x4716f5[_0xd720('0x48')][_0xd720('0x24')]();}else if(_0x4716f5['type']===_0xd720('0x44')&&_0x4716f5[_0xd720('0x1e')]&&_0x4716f5[_0xd720('0x46')]){_0x400468['custom_fields'][_0xd720('0x1d')]({'id':_0x4716f5['idField'],'value':_0x4716f5[_0xd720('0x48')][_0xd720('0x24')]()});}else if(_0x4716f5['type']===_0xd720('0x49')&&_0x4716f5[_0xd720('0x1c')]&&_0x4716f5['idField']&&_0x4716f5[_0xd720('0x46')]){_0x19dcff[_0x4716f5[_0xd720('0x1c')]]&&_0x400468['custom_fields']['push']({'id':_0x4716f5['idField'],'value':_0x19dcff[_0x4716f5[_0xd720('0x1c')]]['toString']()});}else if(_0x4716f5[_0xd720('0x43')]===_0xd720('0x4a')&&_0x4716f5[_0xd720('0x4b')]&&_0x4716f5[_0xd720('0x4b')][_0xd720('0xc')]&&_0x4716f5[_0xd720('0x1e')]&&_0x4716f5[_0xd720('0x46')]){_0x19dcff[_0x4716f5[_0xd720('0x4b')]['name'][_0xd720('0x47')]()]&&_0x400468[_0xd720('0x4c')][_0xd720('0x1d')]({'id':_0x4716f5[_0xd720('0x1e')],'value':_0x19dcff[_0x4716f5[_0xd720('0x4b')][_0xd720('0xc')][_0xd720('0x47')]()][_0xd720('0x24')]()});}});}return _0x400468;}function getConnection(_0x40e095){return request({'method':'POST','form':{'method':_0xd720('0x4d'),'input_type':'JSON','response_type':_0xd720('0x1f'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x40e095[_0xd720('0x4e')],'password':_0x40e095[_0xd720('0x4f')],'encryption':_0xd720('0x50')},'application':_0xd720('0x51')})}})[_0xd720('0x2b')](function(_0x14ea19){var _0x3dce1d=_0x14ea19;if(_0x3dce1d['id']){def[_0xd720('0x52')]=_0x3dce1d['id'];return BPromise[_0xd720('0x30')](_0x3dce1d);}else{throw new Error(util[_0xd720('0x21')](_0xd720('0x53'),_0x40e095['id']));}});}function setRelationship(_0x69b3d5,_0x224ace,_0x19f27f,_0x5affcb){return request({'form':{'method':_0xd720('0x54'),'input_type':_0xd720('0x1f'),'response_type':'JSON','rest_data':JSON[_0xd720('0x3a')]({'session':_0x69b3d5['id'],'module_name':_0xd720('0x20'),'module_id':_0x19f27f['id'],'link_field_name':_0x5affcb,'related_ids':[_0x224ace['id']]})}});}exports[_0xd720('0x55')]=function(_0x551d62,_0x517a15,_0x661ac4,_0x32b3fc,_0x1231b0,_0x2b5f6c){var _0x26b99d,_0x4c7a5a,_0x88a284,_0x1d17f0;_0x2b5f6c[_0xd720('0x56')]=intUtil[_0xd720('0x57')](_0x2b5f6c[_0xd720('0x56')]);_0x2b5f6c['serverUrl']=intUtil['stripTrailingSlash'](_0x2b5f6c[_0xd720('0x58')]);def[_0xd720('0x59')]=util[_0xd720('0x21')](_0xd720('0x5a'),_0x2b5f6c[_0xd720('0x56')]);if(_0x1231b0&&_0x1231b0[_0xd720('0x5b')]){logger[_0xd720('0x26')]('[QUEUE]','Recording\x20is\x20enabled!');_0x517a15[_0xd720('0x5c')]=util[_0xd720('0x21')](_0xd720('0x5d'),_0x2b5f6c[_0xd720('0x58')],_0x517a15[_0xd720('0x5e')],md5(_0x517a15['uniqueid']));}else{_0x517a15[_0xd720('0x5c')]='';}return getConnection(_0x2b5f6c)['then'](function(_0x1801f4){_0x1d17f0=_0x1801f4;return getUser(_0x2b5f6c,_0x32b3fc[_0xd720('0xc')],_0x1d17f0);})[_0xd720('0x2b')](function(_0x28d539){_0x26b99d=_0x28d539;logger[_0xd720('0x26')](_0xd720('0x5f'),_0x26b99d['id']);return getEndUser(_0x2b5f6c,_0x517a15['calleridname'],_0x517a15['calleridnum'],_0x1d17f0);})[_0xd720('0x2b')](function(_0x1839bf){_0x4c7a5a=_0x1839bf;logger[_0xd720('0x26')](_0xd720('0x60'),_0x4c7a5a['id']);return getTicket(_0x2b5f6c,_0x26b99d,_0x4c7a5a,_0x661ac4,_0x517a15,_0x661ac4['Fields'],_0x1d17f0,'Inbound');})[_0xd720('0x2b')](function(_0x1bb6f6){_0x88a284=_0x1bb6f6;logger[_0xd720('0x26')](_0xd720('0x61'));logger[_0xd720('0x26')](_0xd720('0x62'),_0x88a284['id']);return setRelationship(_0x1d17f0,_0x26b99d,_0x88a284,'users');})['then'](function(){return setRelationship(_0x1d17f0,_0x4c7a5a,_0x88a284,'contacts');})[_0xd720('0x2b')](function(){return getServerInfo(_0x1d17f0);})[_0xd720('0x2b')](function(_0x1b90d7){var _0x1aeb31=parseInt(_0x1b90d7[_0xd720('0x63')][_0xd720('0x64')](0x0));var _0x2ebfdc=util[_0xd720('0x21')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x2b5f6c[_0xd720('0x56')],_0x88a284['id']);if(_0x1aeb31>0x6){_0x2ebfdc=util[_0xd720('0x21')](_0xd720('0x65'),_0x2b5f6c[_0xd720('0x56')],_0x88a284['id']);}logger[_0xd720('0x26')](_0xd720('0x66'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xd720('0x21')]('user:%s',_0x32b3fc['name']),_0xd720('0x67'),{'uri':_0x2ebfdc});})[_0xd720('0x68')](function(_0xf38903){logger[_0xd720('0x69')]('[QUEUE]',JSON[_0xd720('0x3a')](_0xf38903));});};exports[_0xd720('0x6a')]=function(_0x2ad805,_0x4d16ac,_0x6794e4,_0x452444,_0xd3dff1,_0x229f5e,_0x32017d){var _0x558435,_0x55a106,_0x536a1c,_0x220780;_0x229f5e['remoteUri']=intUtil[_0xd720('0x57')](_0x229f5e[_0xd720('0x56')]);_0x229f5e[_0xd720('0x58')]=intUtil[_0xd720('0x57')](_0x229f5e['serverUrl']);def[_0xd720('0x59')]=util[_0xd720('0x21')](_0xd720('0x5a'),_0x229f5e['remoteUri']);if(_0x32017d&&_0x32017d[_0xd720('0x6b')]&&_0x32017d[_0xd720('0x6b')]!==_0xd720('0x6c')){logger[_0xd720('0x26')](_0xd720('0x6d'),_0xd720('0x6e'));_0x4d16ac[_0xd720('0x5c')]=util[_0xd720('0x21')](_0xd720('0x5d'),_0x229f5e[_0xd720('0x58')],_0x4d16ac[_0xd720('0x5e')],md5(_0x4d16ac[_0xd720('0x5e')]));}return getConnection(_0x229f5e)[_0xd720('0x2b')](function(_0x15b194){_0x220780=_0x15b194;return getUser(_0x229f5e,_0x452444[_0xd720('0xc')],_0x220780);})[_0xd720('0x2b')](function(_0x4d1fb4){_0x558435=_0x4d1fb4;logger[_0xd720('0x26')](_0xd720('0x5f'),_0x558435['id']);return getEndUser(_0x229f5e,_0x4d16ac[_0xd720('0x6f')],_0x4d16ac['destcalleridnum'],_0x220780);})[_0xd720('0x2b')](function(_0x2a3a5b){_0x55a106=_0x2a3a5b;logger[_0xd720('0x26')](_0xd720('0x60'),_0x55a106['id']);return getTicket(_0x229f5e,_0x558435,_0x55a106,_0x6794e4,_0x4d16ac,_0x6794e4[_0xd720('0x70')],_0x220780,'Outbound');})['then'](function(_0xe1f388){_0x536a1c=_0xe1f388;logger['info']('Ticket\x20created!');logger[_0xd720('0x26')](_0xd720('0x62'),_0x536a1c['id']);return setRelationship(_0x220780,_0x558435,_0x536a1c,_0xd720('0x71'));})[_0xd720('0x2b')](function(){return setRelationship(_0x220780,_0x55a106,_0x536a1c,_0xd720('0x72'));})[_0xd720('0x2b')](function(){return getServerInfo(_0x220780);})[_0xd720('0x2b')](function(_0x1703ab){var _0x2784e2=parseInt(_0x1703ab['version'][_0xd720('0x64')](0x0));var _0x3dc1d8=util[_0xd720('0x21')](_0xd720('0x73'),_0x229f5e[_0xd720('0x56')],_0x536a1c['id']);if(_0x2784e2>0x6){_0x3dc1d8=util[_0xd720('0x21')](_0xd720('0x65'),_0x229f5e[_0xd720('0x56')],_0x536a1c['id']);}logger[_0xd720('0x26')](_0xd720('0x6d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xd720('0x74'),_0x452444['name']),_0xd720('0x67'),{'uri':_0x3dc1d8});})[_0xd720('0x68')](function(_0x14d788){logger[_0xd720('0x69')]('[OUTBOUND]',JSON[_0xd720('0x3a')](_0x14d788));});};exports[_0xd720('0x75')]=function(_0xc4a691,_0x64e38a,_0x4ee35c,_0x5495c1,_0x2cdfe7,_0x170e2e){var _0x18825d,_0x5a595b,_0x3ea0e1,_0x590023;_0x170e2e['remoteUri']=intUtil[_0xd720('0x57')](_0x170e2e[_0xd720('0x56')]);_0x170e2e[_0xd720('0x58')]=intUtil[_0xd720('0x57')](_0x170e2e[_0xd720('0x58')]);def[_0xd720('0x59')]=util[_0xd720('0x21')]('%s/service/v4_1/rest.php',_0x170e2e[_0xd720('0x56')]);if(_0x2cdfe7&&_0x2cdfe7[_0xd720('0x5b')]){logger[_0xd720('0x26')](_0xd720('0x76'),_0xd720('0x6e'));_0x64e38a[_0xd720('0x5c')]=util[_0xd720('0x21')](_0xd720('0x5d'),_0x170e2e[_0xd720('0x58')],_0x64e38a[_0xd720('0x5e')],md5(_0x64e38a[_0xd720('0x5e')]));}else{_0x64e38a[_0xd720('0x5c')]='';}return getConnection(_0x170e2e)[_0xd720('0x2b')](function(_0x1e4477){_0x590023=_0x1e4477;if(!_['isNil'](_0x5495c1)){return getUser(_0x170e2e,_0x5495c1[_0xd720('0xc')],_0x590023);}else{return getUser(_0x170e2e,null,_0x590023);}})[_0xd720('0x2b')](function(_0x128793){_0x18825d=_0x128793;logger[_0xd720('0x26')](_0xd720('0x5f'),_0x18825d['id']);return getEndUser(_0x170e2e,_0x64e38a[_0xd720('0x77')],_0x64e38a['calleridnum'],_0x590023);})[_0xd720('0x2b')](function(_0x3630ec){_0x5a595b=_0x3630ec;logger[_0xd720('0x26')](_0xd720('0x60'),_0x5a595b['id']);return getTicket(_0x170e2e,_0x18825d,_0x5a595b,_0x4ee35c,_0x64e38a,_0x4ee35c[_0xd720('0x70')],_0x590023,'Inbound');})[_0xd720('0x2b')](function(_0xd5adaa){_0x3ea0e1=_0xd5adaa;logger[_0xd720('0x26')](_0xd720('0x61'));logger[_0xd720('0x26')](_0xd720('0x62'),_0x3ea0e1['id']);return setRelationship(_0x590023,_0x18825d,_0x3ea0e1,_0xd720('0x71'));})[_0xd720('0x2b')](function(){return setRelationship(_0x590023,_0x5a595b,_0x3ea0e1,'contacts');})[_0xd720('0x2b')](function(){return getServerInfo(_0x590023);})[_0xd720('0x68')](function(_0x170b85){logger[_0xd720('0x69')](_0xd720('0x76'),JSON['stringify'](_0x170b85));});}; \ No newline at end of file +var _0x4ab6=['Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','error','outbound','recordingFormat','none','[OUTBOUND]','recordingURL','destcalleridnum','Fields','Outbound','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','user:%s','[ABANDONED]','calleridnum','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','Creating\x20new\x20ticket...','name','Subjects','assigned_user_id','created_by','description','getString','Descriptions','date_start','toISOString','slice','replace','duration_hours','parent_type','parent_name','direction','length','forEach','idField','variableName','set_entry','JSON','stringify','format','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','then','entry_list','find','user_name','value','Agent\x20found!','resolve','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','type','string','nameField','customField','toLowerCase','custom_fields','push','content','variable','customVariable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','set_relationship','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','remoteUri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Inbound'];(function(_0x33100c,_0x40621a){var _0x3dbbb8=function(_0x55ccaf){while(--_0x55ccaf){_0x33100c['push'](_0x33100c['shift']());}};_0x3dbbb8(++_0x40621a);}(_0x4ab6,0x10d));var _0x64ab=function(_0x1df3ec,_0x3a8b71){_0x1df3ec=_0x1df3ec-0x0;var _0x353b67=_0x4ab6[_0x1df3ec];return _0x353b67;};'use strict';var _=require('lodash');var rp=require(_0x64ab('0x0'));var BPromise=require(_0x64ab('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0x64ab('0x2'));var intUtil=require('./util');var config=require(_0x64ab('0x3'));var logger=require(_0x64ab('0x4'))(_0x64ab('0x5'));config[_0x64ab('0x6')]=_[_0x64ab('0x7')](config[_0x64ab('0x6')],{'host':_0x64ab('0x8'),'port':0x18eb});var io=require(_0x64ab('0x9'))(new Redis(config[_0x64ab('0x6')]));var def={'method':_0x64ab('0xa'),'json':!![]};function emit(_0x224d67,_0x3a708f,_0x453f3e){io['to'](_0x224d67)[_0x64ab('0xb')](_0x3a708f,_0x453f3e);}function getTicket(_0x1b5d9b,_0x3e3dc5,_0x1de242,_0x12e754,_0x52521b,_0x43dcda,_0x6d55a5,_0x5bd1ad){logger['info'](_0x64ab('0xc'));var _0x4c08f9=new Date();var _0x1ced91=[{'name':_0x64ab('0xd'),'value':intUtil['getString'](_0x12e754[_0x64ab('0xe')],_0x52521b,'\x20')},{'name':_0x64ab('0xf'),'value':_0x3e3dc5['id']},{'name':_0x64ab('0x10'),'value':_0x3e3dc5['id']},{'name':_0x64ab('0x11'),'value':intUtil[_0x64ab('0x12')](_0x12e754[_0x64ab('0x13')],_0x52521b,'\x0a')},{'name':_0x64ab('0x14'),'value':_0x4c08f9[_0x64ab('0x15')]()[_0x64ab('0x16')](0x0,0x13)[_0x64ab('0x17')]('T','\x20')},{'name':_0x64ab('0x18'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':'parent_id','value':_0x1de242['id']},{'name':_0x64ab('0x19'),'value':'Contacts'},{'name':_0x64ab('0x1a'),'value':_0x1de242[_0x64ab('0xd')]},{'name':_0x64ab('0x1b'),'value':_0x5bd1ad}];if(_0x43dcda[_0x64ab('0x1c')]){_[_0x64ab('0x1d')](_0x43dcda,function(_0x1d4b13){if(_0x52521b[_0x1d4b13['variableName']]){_0x1ced91['push']({'name':_0x1d4b13[_0x64ab('0x1e')],'value':_0x52521b[_0x1d4b13[_0x64ab('0x1f')]]});}});}return request({'form':{'method':_0x64ab('0x20'),'input_type':_0x64ab('0x21'),'response_type':_0x64ab('0x21'),'rest_data':JSON[_0x64ab('0x22')]({'session':_0x6d55a5['id'],'module_name':'Calls','name_value_list':_0x1ced91})}});}function getAuth(_0x3e335c){return util[_0x64ab('0x23')](_0x64ab('0x24'),new Buffer(_0x3e335c[_0x64ab('0x25')]+':X')[_0x64ab('0x26')](_0x64ab('0x27')));}function getServerInfo(_0x413f66){return request({'form':{'method':_0x64ab('0x28'),'input_type':_0x64ab('0x21'),'response_type':_0x64ab('0x21'),'rest_data':JSON[_0x64ab('0x22')]({'session':_0x413f66['id']})}});}function getUser(_0x555184,_0x3db9ed,_0x3c7581){if(!_[_0x64ab('0x29')](_0x3db9ed)){logger[_0x64ab('0x2a')](_0x64ab('0x2b'),_0x3db9ed);return request({'form':{'method':_0x64ab('0x2c'),'input_type':_0x64ab('0x21'),'response_type':_0x64ab('0x21'),'rest_data':JSON[_0x64ab('0x22')]({'session':_0x3c7581['id'],'module_name':_0x64ab('0x2d'),'query':util[_0x64ab('0x23')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x3db9ed),'order_by':'','offset':'0','select_fields':['id',_0x64ab('0xd'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x64ab('0x2e')](function(_0x289d1d){if(_0x289d1d[_0x64ab('0x2f')][_0x64ab('0x1c')]){var _0x40727c=_[_0x64ab('0x30')](_0x289d1d['entry_list'],function(_0x257c56){return _0x257c56['name_value_list'][_0x64ab('0x31')][_0x64ab('0x32')]===_0x3db9ed;});if(_0x40727c){logger[_0x64ab('0x2a')](_0x64ab('0x33'));return BPromise[_0x64ab('0x34')]({'id':_0x40727c[_0x64ab('0x35')]['id'][_0x64ab('0x32')],'name':_0x40727c[_0x64ab('0x35')][_0x64ab('0xd')][_0x64ab('0x32')]});}}logger['info'](_0x64ab('0x36'));return BPromise[_0x64ab('0x34')]({'id':_0x3c7581[_0x64ab('0x35')][_0x64ab('0x37')][_0x64ab('0x32')],'name':_0x3c7581['name_value_list'][_0x64ab('0x31')]['value']});});}else{logger[_0x64ab('0x2a')](_0x64ab('0x38'));return BPromise[_0x64ab('0x34')]({'id':_0x3c7581[_0x64ab('0x35')][_0x64ab('0x37')]['value'],'name':_0x3c7581[_0x64ab('0x35')]['user_name'][_0x64ab('0x32')]});}}function getEndUser(_0x4c92a0,_0x3cca50,_0xae2abc,_0x1b1357){logger[_0x64ab('0x2a')]('Searching\x20enduser\x20with\x20phone',_0xae2abc);return request({'form':{'method':_0x64ab('0x2c'),'input_type':_0x64ab('0x21'),'response_type':'JSON','rest_data':JSON[_0x64ab('0x22')]({'session':_0x1b1357['id'],'module_name':_0x64ab('0x39'),'query':util['format'](_0x64ab('0x3a'),_0xae2abc),'order_by':'','offset':'0','select_fields':['id','name',_0x64ab('0x3b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x64ab('0x2e')](function(_0x238a16){if(_0x238a16[_0x64ab('0x2f')][_0x64ab('0x1c')]){var _0xd4ef8e=_[_0x64ab('0x30')](_0x238a16[_0x64ab('0x2f')],function(_0x28c133){return _0x28c133[_0x64ab('0x35')]['phone_home'][_0x64ab('0x32')]===_0xae2abc;});if(_0xd4ef8e){logger[_0x64ab('0x2a')]('Enduser\x20found!');return BPromise[_0x64ab('0x34')]({'id':_0xd4ef8e[_0x64ab('0x35')]['id']['value'],'name':_0xd4ef8e[_0x64ab('0x35')]['name'][_0x64ab('0x32')],'phone':_0xd4ef8e[_0x64ab('0x35')][_0x64ab('0x3b')][_0x64ab('0x32')]});}}else{logger[_0x64ab('0x2a')](_0x64ab('0x3c'));return request({'form':{'method':'set_entry','input_type':_0x64ab('0x21'),'response_type':'JSON','rest_data':JSON[_0x64ab('0x22')]({'session':_0x1b1357['id'],'module_name':'Contacts','name_value_list':[{'name':_0x64ab('0x3d'),'value':_0x3cca50!==_0x64ab('0x3e')?_0x3cca50:util['format'](_0x64ab('0x3f'),_0xae2abc)},{'name':_0x64ab('0x3b'),'value':_0xae2abc}]})}})['then'](function(_0x399770){logger[_0x64ab('0x2a')](_0x64ab('0x40'));return BPromise['resolve']({'id':_0x399770['id'],'name':_0x399770[_0x64ab('0x2f')]['first_name'][_0x64ab('0x32')],'phone':_0x399770['entry_list'][_0x64ab('0x3b')][_0x64ab('0x32')]});});}});}function request(_0x27e596){logger[_0x64ab('0x41')](_0x64ab('0x42'),JSON[_0x64ab('0x22')](_0x27e596));return rp(_[_0x64ab('0x43')](def,_0x27e596));}function getTags(_0x69a818,_0xa4e2c3){var _0x2a73b2=[];if(_0x69a818&&_0x69a818[_0x64ab('0x1c')]>0x0){_0x2a73b2=_[_0x64ab('0x44')](_0x69a818,_0xa4e2c3);}return _0x2a73b2;}function getCustomFields(_0x154a16,_0x310e03){var _0x1fd368=[];var _0x485c40={'custom_fields':[]};if(_0x154a16[_0x64ab('0x1c')]>0x0){_[_0x64ab('0x1d')](_0x154a16,function(_0x39cf3f){if(_0x39cf3f[_0x64ab('0x45')]===_0x64ab('0x46')&&_0x39cf3f[_0x64ab('0x47')]&&!_0x39cf3f[_0x64ab('0x48')]){_0x485c40[_0x39cf3f[_0x64ab('0x47')][_0x64ab('0x49')]()]=_0x39cf3f['content'][_0x64ab('0x26')]();}else if(_0x39cf3f[_0x64ab('0x45')]===_0x64ab('0x46')&&_0x39cf3f[_0x64ab('0x1e')]&&_0x39cf3f[_0x64ab('0x48')]){_0x485c40[_0x64ab('0x4a')][_0x64ab('0x4b')]({'id':_0x39cf3f[_0x64ab('0x1e')],'value':_0x39cf3f[_0x64ab('0x4c')][_0x64ab('0x26')]()});}else if(_0x39cf3f[_0x64ab('0x45')]===_0x64ab('0x4d')&&_0x39cf3f[_0x64ab('0x1f')]&&_0x39cf3f['idField']&&_0x39cf3f['customField']){_0x310e03[_0x39cf3f[_0x64ab('0x1f')]]&&_0x485c40[_0x64ab('0x4a')][_0x64ab('0x4b')]({'id':_0x39cf3f[_0x64ab('0x1e')],'value':_0x310e03[_0x39cf3f[_0x64ab('0x1f')]][_0x64ab('0x26')]()});}else if(_0x39cf3f['type']===_0x64ab('0x4e')&&_0x39cf3f[_0x64ab('0x4f')]&&_0x39cf3f[_0x64ab('0x4f')][_0x64ab('0xd')]&&_0x39cf3f['idField']&&_0x39cf3f[_0x64ab('0x48')]){_0x310e03[_0x39cf3f[_0x64ab('0x4f')]['name'][_0x64ab('0x49')]()]&&_0x485c40['custom_fields'][_0x64ab('0x4b')]({'id':_0x39cf3f['idField'],'value':_0x310e03[_0x39cf3f['Variable'][_0x64ab('0xd')][_0x64ab('0x49')]()][_0x64ab('0x26')]()});}});}return _0x485c40;}function getConnection(_0x188526){return request({'method':'POST','form':{'method':_0x64ab('0x50'),'input_type':_0x64ab('0x21'),'response_type':'JSON','rest_data':JSON['stringify']({'user_auth':{'user_name':_0x188526[_0x64ab('0x51')],'password':_0x188526[_0x64ab('0x52')],'encryption':_0x64ab('0x53')},'application':_0x64ab('0x54')})}})[_0x64ab('0x2e')](function(_0x111da4){var _0x2b9990=_0x111da4;if(_0x2b9990['id']){def[_0x64ab('0x55')]=_0x2b9990['id'];return BPromise[_0x64ab('0x34')](_0x2b9990);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x188526['id']));}});}function setRelationship(_0x2b93bc,_0x121d29,_0xb7ba84,_0x1ca7fc){return request({'form':{'method':_0x64ab('0x56'),'input_type':'JSON','response_type':_0x64ab('0x21'),'rest_data':JSON[_0x64ab('0x22')]({'session':_0x2b93bc['id'],'module_name':'Calls','module_id':_0xb7ba84['id'],'link_field_name':_0x1ca7fc,'related_ids':[_0x121d29['id']]})}});}exports['queue']=function(_0x160ae2,_0x1b5ce8,_0x9a599d,_0x2a1271,_0x299c23,_0x546ad0){var _0x3adaa8,_0x3d83af,_0x527248,_0x4e37b8;_0x546ad0['remoteUri']=intUtil[_0x64ab('0x57')](_0x546ad0['remoteUri']);_0x546ad0[_0x64ab('0x58')]=intUtil[_0x64ab('0x57')](_0x546ad0[_0x64ab('0x58')]);def[_0x64ab('0x59')]=util[_0x64ab('0x23')](_0x64ab('0x5a'),_0x546ad0[_0x64ab('0x5b')]);if(_0x299c23&&_0x299c23[_0x64ab('0x5c')]){logger[_0x64ab('0x2a')](_0x64ab('0x5d'),_0x64ab('0x5e'));_0x1b5ce8['recordingURL']=util[_0x64ab('0x23')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x546ad0[_0x64ab('0x58')],_0x1b5ce8[_0x64ab('0x5f')],md5(_0x1b5ce8[_0x64ab('0x5f')]));}else{_0x1b5ce8['recordingURL']='';}return getConnection(_0x546ad0)[_0x64ab('0x2e')](function(_0x395d67){_0x4e37b8=_0x395d67;return getUser(_0x546ad0,_0x2a1271['name'],_0x4e37b8);})[_0x64ab('0x2e')](function(_0x9dfc4c){_0x3adaa8=_0x9dfc4c;logger[_0x64ab('0x2a')](_0x64ab('0x60'),_0x3adaa8['id']);return getEndUser(_0x546ad0,_0x1b5ce8[_0x64ab('0x61')],_0x1b5ce8['calleridnum'],_0x4e37b8);})[_0x64ab('0x2e')](function(_0x43f3fd){_0x3d83af=_0x43f3fd;logger[_0x64ab('0x2a')](_0x64ab('0x62'),_0x3d83af['id']);return getTicket(_0x546ad0,_0x3adaa8,_0x3d83af,_0x9a599d,_0x1b5ce8,_0x9a599d['Fields'],_0x4e37b8,_0x64ab('0x63'));})[_0x64ab('0x2e')](function(_0x59e731){_0x527248=_0x59e731;logger['info'](_0x64ab('0x64'));logger[_0x64ab('0x2a')](_0x64ab('0x65'),_0x527248['id']);return setRelationship(_0x4e37b8,_0x3adaa8,_0x527248,_0x64ab('0x66'));})[_0x64ab('0x2e')](function(){return setRelationship(_0x4e37b8,_0x3d83af,_0x527248,_0x64ab('0x67'));})['then'](function(){return getServerInfo(_0x4e37b8);})[_0x64ab('0x2e')](function(_0x7413fd){var _0x2cc8f7=parseInt(_0x7413fd[_0x64ab('0x68')][_0x64ab('0x69')](0x0));var _0x14c246=util[_0x64ab('0x23')](_0x64ab('0x6a'),_0x546ad0['remoteUri'],_0x527248['id']);if(_0x2cc8f7>0x6){_0x14c246=util[_0x64ab('0x23')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x546ad0['remoteUri'],_0x527248['id']);}logger[_0x64ab('0x2a')](_0x64ab('0x5d'),_0x64ab('0x6b'));emit(util[_0x64ab('0x23')]('user:%s',_0x2a1271[_0x64ab('0xd')]),_0x64ab('0x6c'),{'uri':_0x14c246});})[_0x64ab('0x6d')](function(_0x4cac07){logger[_0x64ab('0x6e')]('[QUEUE]',JSON['stringify'](_0x4cac07));});};exports[_0x64ab('0x6f')]=function(_0x1824c1,_0x1d1b8e,_0x5b0caf,_0x2b282b,_0x5d0b41,_0x42f6c8,_0x1db56f){var _0x3bbf4f,_0x1a16d8,_0x3dd08f,_0x32075d;_0x42f6c8[_0x64ab('0x5b')]=intUtil[_0x64ab('0x57')](_0x42f6c8['remoteUri']);_0x42f6c8[_0x64ab('0x58')]=intUtil['stripTrailingSlash'](_0x42f6c8['serverUrl']);def[_0x64ab('0x59')]=util[_0x64ab('0x23')](_0x64ab('0x5a'),_0x42f6c8[_0x64ab('0x5b')]);if(_0x1db56f&&_0x1db56f[_0x64ab('0x70')]&&_0x1db56f[_0x64ab('0x70')]!==_0x64ab('0x71')){logger['info'](_0x64ab('0x72'),_0x64ab('0x5e'));_0x1d1b8e[_0x64ab('0x73')]=util[_0x64ab('0x23')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x42f6c8[_0x64ab('0x58')],_0x1d1b8e['uniqueid'],md5(_0x1d1b8e['uniqueid']));}return getConnection(_0x42f6c8)['then'](function(_0x1722e7){_0x32075d=_0x1722e7;return getUser(_0x42f6c8,_0x2b282b['name'],_0x32075d);})[_0x64ab('0x2e')](function(_0x22288d){_0x3bbf4f=_0x22288d;logger[_0x64ab('0x2a')](_0x64ab('0x60'),_0x3bbf4f['id']);return getEndUser(_0x42f6c8,_0x1d1b8e['destcalleridname'],_0x1d1b8e[_0x64ab('0x74')],_0x32075d);})['then'](function(_0x539e7c){_0x1a16d8=_0x539e7c;logger[_0x64ab('0x2a')](_0x64ab('0x62'),_0x1a16d8['id']);return getTicket(_0x42f6c8,_0x3bbf4f,_0x1a16d8,_0x5b0caf,_0x1d1b8e,_0x5b0caf[_0x64ab('0x75')],_0x32075d,_0x64ab('0x76'));})['then'](function(_0x59e907){_0x3dd08f=_0x59e907;logger['info'](_0x64ab('0x64'));logger[_0x64ab('0x2a')]('The\x20Ticket\x20ID\x20is:',_0x3dd08f['id']);return setRelationship(_0x32075d,_0x3bbf4f,_0x3dd08f,'users');})[_0x64ab('0x2e')](function(){return setRelationship(_0x32075d,_0x1a16d8,_0x3dd08f,_0x64ab('0x67'));})['then'](function(){return getServerInfo(_0x32075d);})[_0x64ab('0x2e')](function(_0x358577){var _0x61e53f=parseInt(_0x358577[_0x64ab('0x68')][_0x64ab('0x69')](0x0));var _0x592092=util[_0x64ab('0x23')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x42f6c8[_0x64ab('0x5b')],_0x3dd08f['id']);if(_0x61e53f>0x6){_0x592092=util[_0x64ab('0x23')](_0x64ab('0x77'),_0x42f6c8[_0x64ab('0x5b')],_0x3dd08f['id']);}logger[_0x64ab('0x2a')](_0x64ab('0x72'),_0x64ab('0x6b'));emit(util['format'](_0x64ab('0x78'),_0x2b282b[_0x64ab('0xd')]),_0x64ab('0x6c'),{'uri':_0x592092});})[_0x64ab('0x6d')](function(_0x3cc29c){logger['error']('[OUTBOUND]',JSON['stringify'](_0x3cc29c));});};exports['abandoned']=function(_0xbca5fb,_0x1fdd55,_0x3a9f40,_0x247e10,_0x19a4ec,_0x1a9b54){var _0x3afe50,_0x3aa425,_0xa1bb0d,_0x62cadd;_0x1a9b54['remoteUri']=intUtil[_0x64ab('0x57')](_0x1a9b54['remoteUri']);_0x1a9b54['serverUrl']=intUtil[_0x64ab('0x57')](_0x1a9b54['serverUrl']);def[_0x64ab('0x59')]=util[_0x64ab('0x23')](_0x64ab('0x5a'),_0x1a9b54[_0x64ab('0x5b')]);if(_0x19a4ec&&_0x19a4ec[_0x64ab('0x5c')]){logger['info'](_0x64ab('0x79'),_0x64ab('0x5e'));_0x1fdd55[_0x64ab('0x73')]=util[_0x64ab('0x23')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1a9b54[_0x64ab('0x58')],_0x1fdd55[_0x64ab('0x5f')],md5(_0x1fdd55[_0x64ab('0x5f')]));}else{_0x1fdd55[_0x64ab('0x73')]='';}return getConnection(_0x1a9b54)[_0x64ab('0x2e')](function(_0x1b6220){_0x62cadd=_0x1b6220;if(!_[_0x64ab('0x29')](_0x247e10)){return getUser(_0x1a9b54,_0x247e10[_0x64ab('0xd')],_0x62cadd);}else{return getUser(_0x1a9b54,null,_0x62cadd);}})['then'](function(_0x23222f){_0x3afe50=_0x23222f;logger[_0x64ab('0x2a')](_0x64ab('0x60'),_0x3afe50['id']);return getEndUser(_0x1a9b54,_0x1fdd55[_0x64ab('0x61')],_0x1fdd55[_0x64ab('0x7a')],_0x62cadd);})[_0x64ab('0x2e')](function(_0x7cb3c8){_0x3aa425=_0x7cb3c8;logger['info']('The\x20Enduser\x20ID\x20is:',_0x3aa425['id']);return getTicket(_0x1a9b54,_0x3afe50,_0x3aa425,_0x3a9f40,_0x1fdd55,_0x3a9f40[_0x64ab('0x75')],_0x62cadd,'Inbound');})[_0x64ab('0x2e')](function(_0x49371d){_0xa1bb0d=_0x49371d;logger['info'](_0x64ab('0x64'));logger['info'](_0x64ab('0x65'),_0xa1bb0d['id']);return setRelationship(_0x62cadd,_0x3afe50,_0xa1bb0d,_0x64ab('0x66'));})[_0x64ab('0x2e')](function(){return setRelationship(_0x62cadd,_0x3aa425,_0xa1bb0d,'contacts');})[_0x64ab('0x2e')](function(){return getServerInfo(_0x62cadd);})[_0x64ab('0x6d')](function(_0x4f8e45){logger[_0x64ab('0x6e')](_0x64ab('0x79'),JSON['stringify'](_0x4f8e45));});}; \ 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 e80578c..040e8c1 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 _0x7997=['name','toLowerCase','keyType','key','format','%s:\x20%s','keyContent','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','getString','length','string','push','content','type','variable','variableName','toString','customVariable','Variable'];(function(_0x444aba,_0x47a4f4){var _0xd6be69=function(_0x9ec441){while(--_0x9ec441){_0x444aba['push'](_0x444aba['shift']());}};_0xd6be69(++_0x47a4f4);}(_0x7997,0x11c));var _0x7799=function(_0x3f5b69,_0x2b0dcb){_0x3f5b69=_0x3f5b69-0x0;var _0x48cf38=_0x7997[_0x3f5b69];return _0x48cf38;};'use strict';var _=require(_0x7799('0x0'));var util=require(_0x7799('0x1'));exports[_0x7799('0x2')]=function(_0x1c3b5a,_0x6df837,_0x359cd3){var _0x21b385=[];if(_0x1c3b5a['length']>0x0){var _0x2ea716=_['sortBy'](_0x1c3b5a,['id']);for(var _0x58ae97=0x0;_0x58ae97<_0x2ea716[_0x7799('0x3')];_0x58ae97++){var _0x48f964=_0x2ea716[_0x58ae97];if(_0x48f964['type']===_0x7799('0x4')){_0x21b385[_0x7799('0x5')](_0x48f964[_0x7799('0x6')]);}else if(_0x48f964[_0x7799('0x7')]===_0x7799('0x8')&&_0x48f964[_0x7799('0x9')]){_0x6df837[_0x48f964[_0x7799('0x9')]]&&_0x21b385[_0x7799('0x5')](_0x6df837[_0x48f964[_0x7799('0x9')]][_0x7799('0xa')]());}else if(_0x48f964[_0x7799('0x7')]===_0x7799('0xb')&&_0x48f964[_0x7799('0xc')]&&_0x48f964['Variable'][_0x7799('0xd')]){_0x6df837[_0x48f964['Variable'][_0x7799('0xd')][_0x7799('0xe')]()]&&_0x21b385[_0x7799('0x5')](_0x6df837[_0x48f964[_0x7799('0xc')][_0x7799('0xd')]['toLowerCase']()][_0x7799('0xa')]());}else if(_0x48f964['type']==='keyValue'){if(_0x48f964[_0x7799('0xf')]===_0x7799('0x4')&&_0x48f964[_0x7799('0x10')]){_0x21b385[_0x7799('0x5')](util[_0x7799('0x11')](_0x7799('0x12'),_0x48f964[_0x7799('0x10')],_0x48f964[_0x7799('0x13')]));}else if(_0x48f964[_0x7799('0xf')]===_0x7799('0x8')&&_0x48f964[_0x7799('0x9')]&&_0x48f964[_0x7799('0x10')]){_0x6df837[_0x48f964[_0x7799('0x9')]]&&_0x21b385[_0x7799('0x5')](util[_0x7799('0x11')](_0x7799('0x12'),_0x48f964[_0x7799('0x10')],_0x6df837[_0x48f964[_0x7799('0x9')]]));}else if(_0x48f964['keyType']===_0x7799('0xb')&&_0x48f964[_0x7799('0xc')]&&_0x48f964[_0x7799('0xc')]['name']&&_0x48f964[_0x7799('0x10')]){_0x6df837[_0x48f964[_0x7799('0xc')][_0x7799('0xd')][_0x7799('0xe')]()]&&_0x21b385[_0x7799('0x5')](util[_0x7799('0x11')](_0x7799('0x12'),_0x48f964[_0x7799('0x10')],_0x6df837[_0x48f964[_0x7799('0xc')][_0x7799('0xd')]['toLowerCase']()]));}}}}return _0x21b385['join'](_0x359cd3);};exports[_0x7799('0x14')]=function(_0x3f63c7){var _0x5760ab=_0x3f63c7[_0x7799('0x15')](-0x1);if(_0x5760ab==='/'){_0x3f63c7=_0x3f63c7[_0x7799('0x16')](0x0,_0x3f63c7[_0x7799('0x17')](_0x5760ab));}return _0x3f63c7;};exports[_0x7799('0x18')]=function(_0x3088ae){if(!_[_0x7799('0x19')](_0x3088ae)&&_0x3088ae!==''){var _0x51a166=/^(([^<>()\[\]\\.,;:\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 _0x51a166[_0x7799('0x1a')](String(_0x3088ae)['toLowerCase']());}else{return![];}}; \ No newline at end of file +var _0xaa0f=['variableName','%s:\x20%s','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','test','length','sortBy','type','string','push','content','variable','toString','customVariable','Variable','name','toLowerCase','keyValue','key','format','keyType'];(function(_0x54b7b6,_0x67d736){var _0x8f2b35=function(_0x2d3a3a){while(--_0x2d3a3a){_0x54b7b6['push'](_0x54b7b6['shift']());}};_0x8f2b35(++_0x67d736);}(_0xaa0f,0x1b2));var _0xfaa0=function(_0x12e3e3,_0x501eaf){_0x12e3e3=_0x12e3e3-0x0;var _0x26602e=_0xaa0f[_0x12e3e3];return _0x26602e;};'use strict';var _=require('lodash');var util=require('util');exports['getString']=function(_0x9246cd,_0x2748ff,_0x429c49){var _0x4aa6b2=[];if(_0x9246cd[_0xfaa0('0x0')]>0x0){var _0x330cc7=_[_0xfaa0('0x1')](_0x9246cd,['id']);for(var _0x597a2f=0x0;_0x597a2f<_0x330cc7[_0xfaa0('0x0')];_0x597a2f++){var _0x3ca390=_0x330cc7[_0x597a2f];if(_0x3ca390[_0xfaa0('0x2')]===_0xfaa0('0x3')){_0x4aa6b2[_0xfaa0('0x4')](_0x3ca390[_0xfaa0('0x5')]);}else if(_0x3ca390[_0xfaa0('0x2')]===_0xfaa0('0x6')&&_0x3ca390['variableName']){_0x2748ff[_0x3ca390['variableName']]&&_0x4aa6b2[_0xfaa0('0x4')](_0x2748ff[_0x3ca390['variableName']][_0xfaa0('0x7')]());}else if(_0x3ca390[_0xfaa0('0x2')]===_0xfaa0('0x8')&&_0x3ca390[_0xfaa0('0x9')]&&_0x3ca390[_0xfaa0('0x9')][_0xfaa0('0xa')]){_0x2748ff[_0x3ca390[_0xfaa0('0x9')]['name'][_0xfaa0('0xb')]()]&&_0x4aa6b2[_0xfaa0('0x4')](_0x2748ff[_0x3ca390[_0xfaa0('0x9')][_0xfaa0('0xa')][_0xfaa0('0xb')]()][_0xfaa0('0x7')]());}else if(_0x3ca390['type']===_0xfaa0('0xc')){if(_0x3ca390['keyType']===_0xfaa0('0x3')&&_0x3ca390[_0xfaa0('0xd')]){_0x4aa6b2[_0xfaa0('0x4')](util[_0xfaa0('0xe')]('%s:\x20%s',_0x3ca390[_0xfaa0('0xd')],_0x3ca390['keyContent']));}else if(_0x3ca390[_0xfaa0('0xf')]==='variable'&&_0x3ca390[_0xfaa0('0x10')]&&_0x3ca390[_0xfaa0('0xd')]){_0x2748ff[_0x3ca390[_0xfaa0('0x10')]]&&_0x4aa6b2['push'](util['format'](_0xfaa0('0x11'),_0x3ca390[_0xfaa0('0xd')],_0x2748ff[_0x3ca390[_0xfaa0('0x10')]]));}else if(_0x3ca390[_0xfaa0('0xf')]===_0xfaa0('0x8')&&_0x3ca390[_0xfaa0('0x9')]&&_0x3ca390['Variable'][_0xfaa0('0xa')]&&_0x3ca390[_0xfaa0('0xd')]){_0x2748ff[_0x3ca390[_0xfaa0('0x9')][_0xfaa0('0xa')][_0xfaa0('0xb')]()]&&_0x4aa6b2[_0xfaa0('0x4')](util['format'](_0xfaa0('0x11'),_0x3ca390[_0xfaa0('0xd')],_0x2748ff[_0x3ca390[_0xfaa0('0x9')][_0xfaa0('0xa')]['toLowerCase']()]));}}}}return _0x4aa6b2[_0xfaa0('0x12')](_0x429c49);};exports[_0xfaa0('0x13')]=function(_0x5ef1af){var _0x3975ad=_0x5ef1af[_0xfaa0('0x14')](-0x1);if(_0x3975ad==='/'){_0x5ef1af=_0x5ef1af[_0xfaa0('0x15')](0x0,_0x5ef1af[_0xfaa0('0x16')](_0x3975ad));}return _0x5ef1af;};exports[_0xfaa0('0x17')]=function(_0x3005dd){if(!_['isNil'](_0x3005dd)&&_0x3005dd!==''){var _0xa6c7ad=/^(([^<>()\[\]\\.,;:\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 _0xa6c7ad[_0xfaa0('0x18')](String(_0x3005dd)[_0xfaa0('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 49df237..63f9a47 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 _0x05b6=['Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridnum','abandoned','monitor_format','[ABANDONED]','calleridname','The\x20Enduser\x20ID\x20is:','lodash','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','type','string','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','Descriptions','POST','format','%s/webservice.php','remoteUri','create','admin','sessionName','then','resolve','result','error','statusCode','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','username','catch','[vTiger],\x20%s,\x20%s,\x20%s','getUser','stringify','Searching\x20end\x20user\x20with\x20phone','query','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','length','Enduser\x20found!','Contacts','Enduser\x20created.','lastname','phone','getEndUser','getchallenge','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split'];(function(_0x4f7987,_0x3af1f3){var _0x1becb2=function(_0x541562){while(--_0x541562){_0x4f7987['push'](_0x4f7987['shift']());}};_0x1becb2(++_0x3af1f3);}(_0x05b6,0x74));var _0x605b=function(_0x57a4d0,_0xa6e6b){_0x57a4d0=_0x57a4d0-0x0;var _0xaaadee=_0x05b6[_0x57a4d0];return _0xaaadee;};'use strict';var _=require(_0x605b('0x0'));var rp=require('request-promise');var BPromise=require(_0x605b('0x1'));var md5=require(_0x605b('0x2'));var util=require(_0x605b('0x3'));var Redis=require(_0x605b('0x4'));var intUtil=require(_0x605b('0x5'));var config=require(_0x605b('0x6'));var logger=require(_0x605b('0x7'))(_0x605b('0x8'));config[_0x605b('0x9')]=_[_0x605b('0xa')](config[_0x605b('0x9')],{'host':_0x605b('0xb'),'port':0x18eb});var io=require(_0x605b('0xc'))(new Redis(config[_0x605b('0x9')]));function emit(_0x37b8b1,_0x275ed3,_0xb5dd63){io['to'](_0x37b8b1)[_0x605b('0xd')](_0x275ed3,_0xb5dd63);}function getCustomFields(_0x29cb54,_0x49936a){var _0x131717={};if(_0x29cb54['length']>0x0){_['forEach'](_0x29cb54,function(_0x5148e5){if(_0x5148e5[_0x605b('0xe')]===_0x605b('0xf')&&_0x5148e5[_0x605b('0x10')]){_0x131717[_0x5148e5[_0x605b('0x10')]]=_0x5148e5[_0x605b('0x11')][_0x605b('0x12')]();}else if(_0x5148e5[_0x605b('0xe')]===_0x605b('0x13')&&_0x5148e5[_0x605b('0x14')]&&_0x5148e5[_0x605b('0x10')]&&_0x49936a[_0x5148e5[_0x605b('0x14')]]){_0x131717[_0x5148e5[_0x605b('0x10')]]=_0x49936a[_0x5148e5[_0x605b('0x14')]][_0x605b('0x12')]();}else if(_0x5148e5['type']===_0x605b('0x15')&&_0x5148e5[_0x605b('0x16')]&&_0x5148e5['Variable']['name']&&_0x5148e5['idField']&&_0x49936a[_0x5148e5[_0x605b('0x16')][_0x605b('0x17')]['toLowerCase']()]){_0x131717[_0x5148e5[_0x605b('0x10')]]=_0x49936a[_0x5148e5[_0x605b('0x16')][_0x605b('0x17')][_0x605b('0x18')]()][_0x605b('0x12')]();}});}return _0x131717;}function createTicket(_0x5974f8,_0xc383d2,_0x1233a5,_0x54c1a1,_0x2c1553,_0x4e3df4,_0x2a6a74){logger[_0x605b('0x19')](_0x605b('0x1a'));var _0x5a8de3=_[_0x605b('0x1b')]({'parent_id':'','assigned_user_id':_0xc383d2['id'],'ticketpriorities':_0x605b('0x1c'),'ticketstatus':_0x605b('0x1d'),'ticket_title':intUtil[_0x605b('0x1e')](_0x54c1a1[_0x605b('0x1f')],_0x2c1553,'\x20'),'description':intUtil[_0x605b('0x1e')](_0x54c1a1[_0x605b('0x20')],_0x2c1553,'\x0a'),'contact_id':_0x1233a5['id']},getCustomFields(_0x4e3df4,_0x2c1553));var _0x48adf5={'method':_0x605b('0x21'),'uri':util[_0x605b('0x22')](_0x605b('0x23'),_0x5974f8[_0x605b('0x24')]),'form':{'operation':_0x605b('0x25'),'username':_0x605b('0x26'),'sessionName':_0x2a6a74[_0x605b('0x27')],'elementType':'HelpDesk','element':JSON['stringify'](_0x5a8de3)},'json':!![]};return request(_0x48adf5)[_0x605b('0x28')](function(_0x4996da){if(_0x4996da['success']){return BPromise[_0x605b('0x29')]({'id':_0x4996da[_0x605b('0x2a')]['id']});}else{throw new Error(util[_0x605b('0x22')]('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON['stringify'](_0x4996da[_0x605b('0x2b')])));}})['catch'](function(_0x337a20){var _0x5d18f0=_0x337a20[_0x605b('0x2c')]||0x1f4;logger[_0x605b('0x2b')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x605b('0x2d'),_0x5d18f0,JSON['stringify'](_0x337a20));});}function getUser(_0x470ec8,_0x2a6ad2,_0xcf7b8f){if(intUtil[_0x605b('0x2e')](_0x2a6ad2)){logger[_0x605b('0x19')](_0x605b('0x2f'),_0x2a6ad2);return request({'method':_0x605b('0x30'),'uri':util[_0x605b('0x22')](_0x605b('0x23'),_0x470ec8[_0x605b('0x24')]),'qs':{'operation':'query','username':_0x605b('0x26'),'sessionName':_0xcf7b8f[_0x605b('0x27')],'query':util[_0x605b('0x22')](_0x605b('0x31'),_0x2a6ad2)},'json':!![]})['then'](function(_0x91915f){if(_0x91915f[_0x605b('0x32')]&&_0x91915f[_0x605b('0x2a')]['length']){logger[_0x605b('0x19')](_0x605b('0x33'));return BPromise['resolve']({'id':_0x91915f[_0x605b('0x2a')][0x0]['id'],'email':_0x91915f['result'][0x0][_0x605b('0x34')],'name':_0x91915f['result'][0x0][_0x605b('0x35')]+'\x20'+_0x91915f[_0x605b('0x2a')][_0x605b('0x36')]});}else{logger['info'](_0x605b('0x37'));return BPromise[_0x605b('0x29')]({'id':_0xcf7b8f[_0x605b('0x38')],'email':_0x470ec8[_0x605b('0x39')],'name':_0x605b('0x26')});}})[_0x605b('0x3a')](function(_0x30c775){var _0x4684c5=_0x30c775['statusCode']||0x1f4;logger[_0x605b('0x2b')](_0x605b('0x3b'),'getUser',_0x4684c5,JSON['stringify'](_0x30c775));});}else{logger['info'](_0x605b('0x37'));return BPromise[_0x605b('0x29')]({'id':_0xcf7b8f[_0x605b('0x38')],'email':_0x470ec8[_0x605b('0x39')],'name':_0x605b('0x26')})[_0x605b('0x3a')](function(_0x4ce170){var _0x2e227c=_0x4ce170[_0x605b('0x2c')]||0x1f4;logger[_0x605b('0x2b')](_0x605b('0x3b'),_0x605b('0x3c'),_0x2e227c,JSON[_0x605b('0x3d')](_0x4ce170));});}}function getEndUser(_0x43fe26,_0x495235,_0x5a1475,_0x3d556a){logger[_0x605b('0x19')](_0x605b('0x3e'),_0x5a1475);return request({'method':_0x605b('0x30'),'uri':util['format'](_0x605b('0x23'),_0x43fe26[_0x605b('0x24')]),'qs':{'operation':_0x605b('0x3f'),'username':'admin','sessionName':_0x3d556a['sessionName'],'query':util[_0x605b('0x22')](_0x605b('0x40'),_0x5a1475,_0x5a1475,_0x5a1475,_0x5a1475,_0x5a1475)},'json':!![]})['then'](function(_0x599128){if(_0x599128[_0x605b('0x32')]&&_0x599128[_0x605b('0x2a')][_0x605b('0x41')]){logger[_0x605b('0x19')](_0x605b('0x42'));return BPromise[_0x605b('0x29')]({'id':_0x599128[_0x605b('0x2a')][0x0]['id'],'name':_0x599128[_0x605b('0x2a')][0x0]['firstname']+'\x20'+_0x599128[_0x605b('0x2a')][0x0]['lastname'],'phone':_0x5a1475});}else{logger[_0x605b('0x19')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':_0x605b('0x21'),'uri':util[_0x605b('0x22')](_0x605b('0x23'),_0x43fe26[_0x605b('0x24')]),'form':{'operation':_0x605b('0x25'),'sessionName':_0x3d556a[_0x605b('0x27')],'elementType':_0x605b('0x43'),'element':JSON['stringify']({'lastname':_0x495235,'phone':_0x5a1475,'assigned_user_id':'\x20'})},'json':!![]})[_0x605b('0x28')](function(_0x168e93){logger[_0x605b('0x19')](_0x605b('0x44'));return BPromise[_0x605b('0x29')]({'id':_0x168e93[_0x605b('0x2a')]['id'],'name':_0x168e93[_0x605b('0x2a')][_0x605b('0x45')],'phone':_0x168e93['result'][_0x605b('0x46')]});})['catch'](function(_0x10e156){var _0x3e4489=_0x10e156['statusCode']||0x1f4;logger['error'](_0x605b('0x3b'),_0x605b('0x47'),_0x3e4489,JSON[_0x605b('0x3d')](_0x10e156));});}});}function getConnection(_0x6fc450){var _0x2f631f=_0x6fc450[_0x605b('0x39')];var _0x5d1e78=_0x6fc450['accessKey'];return request({'method':'GET','uri':util[_0x605b('0x22')]('%s/webservice.php',_0x6fc450['remoteUri']),'qs':{'operation':_0x605b('0x48'),'username':_0x2f631f},'json':!![]})[_0x605b('0x28')](function(_0x16c182){if(_0x16c182[_0x605b('0x32')]){return request({'method':_0x605b('0x21'),'uri':util[_0x605b('0x22')](_0x605b('0x23'),_0x6fc450[_0x605b('0x24')]),'form':{'operation':_0x605b('0x49'),'username':'admin','accessKey':md5(_0x16c182[_0x605b('0x2a')]['token']+_0x5d1e78)},'json':!![]});}})['then'](function(_0x98954f){if(_0x98954f['success']){return BPromise[_0x605b('0x29')](_0x98954f[_0x605b('0x2a')]);}else{throw new Error(util[_0x605b('0x22')](_0x605b('0x4a'),_0x6fc450['id']));}})[_0x605b('0x3a')](function(_0x31ea20){var _0x32d0bc=_0x31ea20[_0x605b('0x2c')]||0x1f4;logger['error'](_0x605b('0x3b'),_0x605b('0x4b'),_0x32d0bc,JSON[_0x605b('0x3d')](_0x31ea20));});}function request(_0x2860fc){logger['info'](_0x605b('0x4c'),JSON[_0x605b('0x3d')](_0x2860fc));return rp(_0x2860fc);}exports[_0x605b('0x4d')]=function(_0x18cdd0,_0x43c532,_0x187bd9,_0xa0e850,_0x56dd62,_0x4ddd59){var _0x37cf1d,_0x10b95d,_0x47b666,_0x2934c1;_0x4ddd59['remoteUri']=intUtil[_0x605b('0x4e')](_0x4ddd59[_0x605b('0x24')]);if(_0x56dd62&&_0x56dd62['monitor_format']){logger['info'](_0x605b('0x4f'),_0x605b('0x50'));_0x43c532['recordingURL']=util[_0x605b('0x22')](_0x605b('0x51'),_0x4ddd59[_0x605b('0x52')],_0x43c532[_0x605b('0x53')],md5(_0x43c532['uniqueid']));}else{_0x43c532[_0x605b('0x54')]='';}return getConnection(_0x4ddd59)[_0x605b('0x28')](function(_0x5835ef){_0x2934c1=_0x5835ef;return getUser(_0x4ddd59,_0xa0e850[_0x605b('0x55')],_0x2934c1);})[_0x605b('0x28')](function(_0x571f85){_0x37cf1d=_0x571f85;logger[_0x605b('0x19')]('The\x20User\x20ID\x20is:',_0x37cf1d['id']);return getEndUser(_0x4ddd59,_0x43c532['calleridname'],_0x43c532[_0x605b('0x56')],_0x2934c1);})[_0x605b('0x28')](function(_0x47acb6){_0x10b95d=_0x47acb6;logger['info']('The\x20Enduser\x20ID\x20is:',_0x10b95d['id']);return createTicket(_0x4ddd59,_0x37cf1d,_0x10b95d,_0x187bd9,_0x43c532,_0x187bd9[_0x605b('0x57')],_0x2934c1);})[_0x605b('0x28')](function(_0x4791b7){_0x47b666=_0x4791b7;logger[_0x605b('0x19')](_0x605b('0x58'));logger[_0x605b('0x19')](_0x605b('0x59'),_0x47b666['id']);var _0x16d0e7=util['format'](_0x605b('0x5a'),_0x4ddd59['remoteUri'],_[_0x605b('0x5b')](_0x47b666['id'],'x')[0x1]);logger[_0x605b('0x19')](_0x605b('0x4f'),_0x605b('0x5c'));emit(util[_0x605b('0x22')]('user:%s',_0xa0e850[_0x605b('0x17')]),_0x605b('0x5d'),{'uri':_0x16d0e7});})[_0x605b('0x3a')](function(_0x43a96b){logger[_0x605b('0x2b')](_0x605b('0x4f'),JSON[_0x605b('0x3d')](_0x43a96b));});};exports['outbound']=function(_0x3690be,_0x912821,_0x34ad52,_0x5c65ac,_0x341da9,_0x22fb6d,_0x1bed6d){var _0x18380e,_0x203ed5,_0x551fe4,_0x12b036;_0x22fb6d['remoteUri']=intUtil[_0x605b('0x4e')](_0x22fb6d[_0x605b('0x24')]);_0x22fb6d[_0x605b('0x52')]=intUtil['stripTrailingSlash'](_0x22fb6d[_0x605b('0x52')]);if(_0x1bed6d&&_0x1bed6d[_0x605b('0x5e')]&&_0x1bed6d['recordingFormat']!==_0x605b('0x5f')){logger[_0x605b('0x19')](_0x605b('0x60'),_0x605b('0x50'));_0x912821[_0x605b('0x54')]=util[_0x605b('0x22')](_0x605b('0x51'),_0x22fb6d['serverUrl'],_0x912821[_0x605b('0x53')],md5(_0x912821['uniqueid']));}return getConnection(_0x22fb6d)['then'](function(_0x192c9e){_0x12b036=_0x192c9e;return getUser(_0x22fb6d,_0x5c65ac[_0x605b('0x55')],_0x12b036);})[_0x605b('0x28')](function(_0x2b2a53){_0x18380e=_0x2b2a53;logger[_0x605b('0x19')](_0x605b('0x61'),_0x18380e['id']);return getEndUser(_0x22fb6d,_0x912821['destcalleridname'],_0x912821[_0x605b('0x62')],_0x12b036);})[_0x605b('0x28')](function(_0x5c7641){_0x203ed5=_0x5c7641;logger['info']('The\x20Enduser\x20ID\x20is:',_0x203ed5['id']);return createTicket(_0x22fb6d,_0x18380e,_0x203ed5,_0x34ad52,_0x912821,_0x34ad52[_0x605b('0x57')],_0x12b036);})[_0x605b('0x28')](function(_0x5e14d0){_0x551fe4=_0x5e14d0;logger['info'](_0x605b('0x58'));logger['info'](_0x605b('0x59'),_0x551fe4['id']);var _0x5a5f3d=util['format']('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x22fb6d['remoteUri'],_[_0x605b('0x5b')](_0x551fe4['id'],'x')[0x1]);logger['info']('[OUTBOUND]',_0x605b('0x5c'));emit(util[_0x605b('0x22')]('user:%s',_0x5c65ac['name']),'trigger:browser:url',{'uri':_0x5a5f3d});})['catch'](function(_0x42c8aa){logger[_0x605b('0x2b')](_0x605b('0x60'),JSON[_0x605b('0x3d')](_0x42c8aa));});};exports[_0x605b('0x63')]=function(_0x150a15,_0x4a5971,_0x58ba0e,_0x5dea38,_0x5194f8,_0x3abeef){var _0x161eee,_0x4869b7,_0x3550a1,_0xc013f8;_0x3abeef[_0x605b('0x24')]=intUtil[_0x605b('0x4e')](_0x3abeef[_0x605b('0x24')]);_0x3abeef[_0x605b('0x52')]=intUtil[_0x605b('0x4e')](_0x3abeef[_0x605b('0x52')]);if(_0x5194f8&&_0x5194f8[_0x605b('0x64')]){logger[_0x605b('0x19')](_0x605b('0x65'),_0x605b('0x50'));_0x4a5971[_0x605b('0x54')]=util[_0x605b('0x22')](_0x605b('0x51'),_0x3abeef[_0x605b('0x52')],_0x4a5971[_0x605b('0x53')],md5(_0x4a5971[_0x605b('0x53')]));}else{_0x4a5971[_0x605b('0x54')]='';}return getConnection(_0x3abeef)[_0x605b('0x28')](function(_0x569073){_0xc013f8=_0x569073;return getUser(_0x3abeef,'',_0xc013f8);})['then'](function(_0xc6d47e){_0x161eee=_0xc6d47e;logger[_0x605b('0x19')](_0x605b('0x61'),_0x161eee['id']);return getEndUser(_0x3abeef,_0x4a5971[_0x605b('0x66')],_0x4a5971[_0x605b('0x56')],_0xc013f8);})['then'](function(_0x6a4519){_0x4869b7=_0x6a4519;logger['info'](_0x605b('0x67'),_0x4869b7['id']);return createTicket(_0x3abeef,_0x161eee,_0x4869b7,_0x58ba0e,_0x4a5971,_0x58ba0e[_0x605b('0x57')],_0xc013f8);})[_0x605b('0x28')](function(_0x5d61a0){_0x3550a1=_0x5d61a0;logger[_0x605b('0x19')]('Ticket\x20created!');logger[_0x605b('0x19')](_0x605b('0x59'),_0x3550a1['id']);})['catch'](function(_0x4a7ba8){logger[_0x605b('0x2b')](_0x605b('0x65'),JSON[_0x605b('0x3d')](_0x4a7ba8));});}; \ No newline at end of file +var _0x6c4b=['GET','query','Agent\x20found!','resolve','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','username','catch','[vTiger],\x20%s,\x20%s,\x20%s','getUser','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','stripTrailingSlash','serverUrl','recordingFormat','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','abandoned','[ABANDONED]','calleridname','calleridnum','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','socket.io-emitter','emit','length','type','string','idField','content','toString','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','getString','Subjects','Descriptions','POST','format','%s/webservice.php','remoteUri','create','admin','sessionName','HelpDesk','then','success','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','stringify','error','statusCode','createTicket','validateEmail','Getting\x20agent\x20with\x20email'];(function(_0x302a10,_0x4615b6){var _0x1d229b=function(_0x19262a){while(--_0x19262a){_0x302a10['push'](_0x302a10['shift']());}};_0x1d229b(++_0x4615b6);}(_0x6c4b,0x93));var _0xb6c4=function(_0x4f217e,_0xdecb81){_0x4f217e=_0x4f217e-0x0;var _0x4a5e3b=_0x6c4b[_0x4f217e];return _0x4a5e3b;};'use strict';var _=require(_0xb6c4('0x0'));var rp=require(_0xb6c4('0x1'));var BPromise=require(_0xb6c4('0x2'));var md5=require('md5');var util=require(_0xb6c4('0x3'));var Redis=require(_0xb6c4('0x4'));var intUtil=require(_0xb6c4('0x5'));var config=require(_0xb6c4('0x6'));var logger=require(_0xb6c4('0x7'))(_0xb6c4('0x8'));config['redis']=_['defaults'](config[_0xb6c4('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xb6c4('0xa'))(new Redis(config[_0xb6c4('0x9')]));function emit(_0x554935,_0x312141,_0x19c12a){io['to'](_0x554935)[_0xb6c4('0xb')](_0x312141,_0x19c12a);}function getCustomFields(_0x193250,_0x131e11){var _0x46b134={};if(_0x193250[_0xb6c4('0xc')]>0x0){_['forEach'](_0x193250,function(_0x22d6fa){if(_0x22d6fa[_0xb6c4('0xd')]===_0xb6c4('0xe')&&_0x22d6fa[_0xb6c4('0xf')]){_0x46b134[_0x22d6fa['idField']]=_0x22d6fa[_0xb6c4('0x10')][_0xb6c4('0x11')]();}else if(_0x22d6fa[_0xb6c4('0xd')]===_0xb6c4('0x12')&&_0x22d6fa[_0xb6c4('0x13')]&&_0x22d6fa[_0xb6c4('0xf')]&&_0x131e11[_0x22d6fa[_0xb6c4('0x13')]]){_0x46b134[_0x22d6fa[_0xb6c4('0xf')]]=_0x131e11[_0x22d6fa['variableName']]['toString']();}else if(_0x22d6fa[_0xb6c4('0xd')]==='customVariable'&&_0x22d6fa[_0xb6c4('0x14')]&&_0x22d6fa[_0xb6c4('0x14')][_0xb6c4('0x15')]&&_0x22d6fa['idField']&&_0x131e11[_0x22d6fa[_0xb6c4('0x14')][_0xb6c4('0x15')][_0xb6c4('0x16')]()]){_0x46b134[_0x22d6fa['idField']]=_0x131e11[_0x22d6fa[_0xb6c4('0x14')][_0xb6c4('0x15')][_0xb6c4('0x16')]()][_0xb6c4('0x11')]();}});}return _0x46b134;}function createTicket(_0x5566f7,_0x1002cc,_0x36929e,_0x55eb35,_0x4898c7,_0x5d2906,_0x3226cd){logger[_0xb6c4('0x17')](_0xb6c4('0x18'));var _0x192950=_[_0xb6c4('0x19')]({'parent_id':'','assigned_user_id':_0x1002cc['id'],'ticketpriorities':'Normal','ticketstatus':'Open','ticket_title':intUtil[_0xb6c4('0x1a')](_0x55eb35[_0xb6c4('0x1b')],_0x4898c7,'\x20'),'description':intUtil[_0xb6c4('0x1a')](_0x55eb35[_0xb6c4('0x1c')],_0x4898c7,'\x0a'),'contact_id':_0x36929e['id']},getCustomFields(_0x5d2906,_0x4898c7));var _0x124a49={'method':_0xb6c4('0x1d'),'uri':util[_0xb6c4('0x1e')](_0xb6c4('0x1f'),_0x5566f7[_0xb6c4('0x20')]),'form':{'operation':_0xb6c4('0x21'),'username':_0xb6c4('0x22'),'sessionName':_0x3226cd[_0xb6c4('0x23')],'elementType':_0xb6c4('0x24'),'element':JSON['stringify'](_0x192950)},'json':!![]};return request(_0x124a49)[_0xb6c4('0x25')](function(_0x11a4ff){if(_0x11a4ff[_0xb6c4('0x26')]){return BPromise['resolve']({'id':_0x11a4ff[_0xb6c4('0x27')]['id']});}else{throw new Error(util[_0xb6c4('0x1e')](_0xb6c4('0x28'),JSON[_0xb6c4('0x29')](_0x11a4ff[_0xb6c4('0x2a')])));}})['catch'](function(_0x1f822e){var _0x17beaa=_0x1f822e[_0xb6c4('0x2b')]||0x1f4;logger[_0xb6c4('0x2a')]('[vTiger],\x20%s,\x20%s,\x20%s',_0xb6c4('0x2c'),_0x17beaa,JSON['stringify'](_0x1f822e));});}function getUser(_0xaacf17,_0x58e7e8,_0xe0e62e){if(intUtil[_0xb6c4('0x2d')](_0x58e7e8)){logger[_0xb6c4('0x17')](_0xb6c4('0x2e'),_0x58e7e8);return request({'method':_0xb6c4('0x2f'),'uri':util[_0xb6c4('0x1e')](_0xb6c4('0x1f'),_0xaacf17[_0xb6c4('0x20')]),'qs':{'operation':_0xb6c4('0x30'),'username':_0xb6c4('0x22'),'sessionName':_0xe0e62e[_0xb6c4('0x23')],'query':util[_0xb6c4('0x1e')]('SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;',_0x58e7e8)},'json':!![]})['then'](function(_0x15d0fd){if(_0x15d0fd[_0xb6c4('0x26')]&&_0x15d0fd[_0xb6c4('0x27')]['length']){logger['info'](_0xb6c4('0x31'));return BPromise[_0xb6c4('0x32')]({'id':_0x15d0fd[_0xb6c4('0x27')][0x0]['id'],'email':_0x15d0fd[_0xb6c4('0x27')][0x0][_0xb6c4('0x33')],'name':_0x15d0fd[_0xb6c4('0x27')][0x0][_0xb6c4('0x34')]+'\x20'+_0x15d0fd[_0xb6c4('0x27')][_0xb6c4('0x35')]});}else{logger['info'](_0xb6c4('0x36'));return BPromise[_0xb6c4('0x32')]({'id':_0xe0e62e[_0xb6c4('0x37')],'email':_0xaacf17[_0xb6c4('0x38')],'name':_0xb6c4('0x22')});}})[_0xb6c4('0x39')](function(_0xbef9bf){var _0x408507=_0xbef9bf[_0xb6c4('0x2b')]||0x1f4;logger[_0xb6c4('0x2a')](_0xb6c4('0x3a'),_0xb6c4('0x3b'),_0x408507,JSON[_0xb6c4('0x29')](_0xbef9bf));});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0xb6c4('0x32')]({'id':_0xe0e62e['userId'],'email':_0xaacf17[_0xb6c4('0x38')],'name':_0xb6c4('0x22')})[_0xb6c4('0x39')](function(_0x386ce3){var _0x3f019c=_0x386ce3['statusCode']||0x1f4;logger[_0xb6c4('0x2a')](_0xb6c4('0x3a'),_0xb6c4('0x3b'),_0x3f019c,JSON[_0xb6c4('0x29')](_0x386ce3));});}}function getEndUser(_0x272394,_0x1785f8,_0x8a21c3,_0x59f73f){logger[_0xb6c4('0x17')](_0xb6c4('0x3c'),_0x8a21c3);return request({'method':_0xb6c4('0x2f'),'uri':util[_0xb6c4('0x1e')](_0xb6c4('0x1f'),_0x272394['remoteUri']),'qs':{'operation':_0xb6c4('0x30'),'username':_0xb6c4('0x22'),'sessionName':_0x59f73f[_0xb6c4('0x23')],'query':util['format'](_0xb6c4('0x3d'),_0x8a21c3,_0x8a21c3,_0x8a21c3,_0x8a21c3,_0x8a21c3)},'json':!![]})[_0xb6c4('0x25')](function(_0x42eba5){if(_0x42eba5[_0xb6c4('0x26')]&&_0x42eba5[_0xb6c4('0x27')][_0xb6c4('0xc')]){logger[_0xb6c4('0x17')]('Enduser\x20found!');return BPromise['resolve']({'id':_0x42eba5[_0xb6c4('0x27')][0x0]['id'],'name':_0x42eba5[_0xb6c4('0x27')][0x0][_0xb6c4('0x3e')]+'\x20'+_0x42eba5[_0xb6c4('0x27')][0x0][_0xb6c4('0x3f')],'phone':_0x8a21c3});}else{logger[_0xb6c4('0x17')](_0xb6c4('0x40'));return request({'method':_0xb6c4('0x1d'),'uri':util[_0xb6c4('0x1e')](_0xb6c4('0x1f'),_0x272394[_0xb6c4('0x20')]),'form':{'operation':_0xb6c4('0x21'),'sessionName':_0x59f73f[_0xb6c4('0x23')],'elementType':'Contacts','element':JSON[_0xb6c4('0x29')]({'lastname':_0x1785f8,'phone':_0x8a21c3,'assigned_user_id':'\x20'})},'json':!![]})[_0xb6c4('0x25')](function(_0x5e5166){logger['info']('Enduser\x20created.');return BPromise[_0xb6c4('0x32')]({'id':_0x5e5166[_0xb6c4('0x27')]['id'],'name':_0x5e5166['result'][_0xb6c4('0x3f')],'phone':_0x5e5166[_0xb6c4('0x27')]['phone']});})[_0xb6c4('0x39')](function(_0x22552c){var _0x2fd2b2=_0x22552c[_0xb6c4('0x2b')]||0x1f4;logger[_0xb6c4('0x2a')](_0xb6c4('0x3a'),'getEndUser',_0x2fd2b2,JSON[_0xb6c4('0x29')](_0x22552c));});}});}function getConnection(_0xce0e0a){var _0x5ad093=_0xce0e0a[_0xb6c4('0x38')];var _0x19d6bd=_0xce0e0a[_0xb6c4('0x41')];return request({'method':'GET','uri':util[_0xb6c4('0x1e')](_0xb6c4('0x1f'),_0xce0e0a[_0xb6c4('0x20')]),'qs':{'operation':_0xb6c4('0x42'),'username':_0x5ad093},'json':!![]})[_0xb6c4('0x25')](function(_0x4a9375){if(_0x4a9375[_0xb6c4('0x26')]){return request({'method':_0xb6c4('0x1d'),'uri':util[_0xb6c4('0x1e')](_0xb6c4('0x1f'),_0xce0e0a[_0xb6c4('0x20')]),'form':{'operation':'login','username':_0xb6c4('0x22'),'accessKey':md5(_0x4a9375[_0xb6c4('0x27')][_0xb6c4('0x43')]+_0x19d6bd)},'json':!![]});}})[_0xb6c4('0x25')](function(_0x3c3521){if(_0x3c3521[_0xb6c4('0x26')]){return BPromise['resolve'](_0x3c3521[_0xb6c4('0x27')]);}else{throw new Error(util['format'](_0xb6c4('0x44'),_0xce0e0a['id']));}})[_0xb6c4('0x39')](function(_0x412052){var _0x418fa4=_0x412052[_0xb6c4('0x2b')]||0x1f4;logger[_0xb6c4('0x2a')](_0xb6c4('0x3a'),'getConnection',_0x418fa4,JSON[_0xb6c4('0x29')](_0x412052));});}function request(_0x4d8a4e){logger[_0xb6c4('0x17')](_0xb6c4('0x45'),JSON['stringify'](_0x4d8a4e));return rp(_0x4d8a4e);}exports[_0xb6c4('0x46')]=function(_0x1bd3ce,_0x563272,_0x35edb3,_0x1ffe1b,_0x37dc6f,_0x2cf3c8){var _0xd3beae,_0xd8a683,_0x2897f0,_0x4d4b39;_0x2cf3c8['remoteUri']=intUtil['stripTrailingSlash'](_0x2cf3c8['remoteUri']);if(_0x37dc6f&&_0x37dc6f[_0xb6c4('0x47')]){logger[_0xb6c4('0x17')](_0xb6c4('0x48'),_0xb6c4('0x49'));_0x563272[_0xb6c4('0x4a')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2cf3c8['serverUrl'],_0x563272['uniqueid'],md5(_0x563272[_0xb6c4('0x4b')]));}else{_0x563272['recordingURL']='';}return getConnection(_0x2cf3c8)[_0xb6c4('0x25')](function(_0x2e79a3){_0x4d4b39=_0x2e79a3;return getUser(_0x2cf3c8,_0x1ffe1b[_0xb6c4('0x4c')],_0x4d4b39);})['then'](function(_0x32a760){_0xd3beae=_0x32a760;logger[_0xb6c4('0x17')](_0xb6c4('0x4d'),_0xd3beae['id']);return getEndUser(_0x2cf3c8,_0x563272['calleridname'],_0x563272['calleridnum'],_0x4d4b39);})[_0xb6c4('0x25')](function(_0xca7087){_0xd8a683=_0xca7087;logger['info'](_0xb6c4('0x4e'),_0xd8a683['id']);return createTicket(_0x2cf3c8,_0xd3beae,_0xd8a683,_0x35edb3,_0x563272,_0x35edb3[_0xb6c4('0x4f')],_0x4d4b39);})[_0xb6c4('0x25')](function(_0x334a05){_0x2897f0=_0x334a05;logger[_0xb6c4('0x17')]('Ticket\x20created!');logger['info'](_0xb6c4('0x50'),_0x2897f0['id']);var _0x596d51=util[_0xb6c4('0x1e')](_0xb6c4('0x51'),_0x2cf3c8['remoteUri'],_[_0xb6c4('0x52')](_0x2897f0['id'],'x')[0x1]);logger[_0xb6c4('0x17')](_0xb6c4('0x48'),_0xb6c4('0x53'));emit(util[_0xb6c4('0x1e')](_0xb6c4('0x54'),_0x1ffe1b[_0xb6c4('0x15')]),_0xb6c4('0x55'),{'uri':_0x596d51});})[_0xb6c4('0x39')](function(_0x5e783a){logger[_0xb6c4('0x2a')]('[QUEUE]',JSON[_0xb6c4('0x29')](_0x5e783a));});};exports[_0xb6c4('0x56')]=function(_0xf294d3,_0x9f1a21,_0x3130ce,_0x42827e,_0xa5fa70,_0x1b19d1,_0x5c1498){var _0x1f9d9b,_0x183b60,_0x204ba4,_0x3865bc;_0x1b19d1[_0xb6c4('0x20')]=intUtil[_0xb6c4('0x57')](_0x1b19d1[_0xb6c4('0x20')]);_0x1b19d1[_0xb6c4('0x58')]=intUtil[_0xb6c4('0x57')](_0x1b19d1[_0xb6c4('0x58')]);if(_0x5c1498&&_0x5c1498['recordingFormat']&&_0x5c1498[_0xb6c4('0x59')]!=='none'){logger['info'](_0xb6c4('0x5a'),_0xb6c4('0x49'));_0x9f1a21[_0xb6c4('0x4a')]=util[_0xb6c4('0x1e')](_0xb6c4('0x5b'),_0x1b19d1[_0xb6c4('0x58')],_0x9f1a21[_0xb6c4('0x4b')],md5(_0x9f1a21[_0xb6c4('0x4b')]));}return getConnection(_0x1b19d1)[_0xb6c4('0x25')](function(_0x53fea0){_0x3865bc=_0x53fea0;return getUser(_0x1b19d1,_0x42827e[_0xb6c4('0x4c')],_0x3865bc);})[_0xb6c4('0x25')](function(_0x25b8ff){_0x1f9d9b=_0x25b8ff;logger[_0xb6c4('0x17')](_0xb6c4('0x4d'),_0x1f9d9b['id']);return getEndUser(_0x1b19d1,_0x9f1a21[_0xb6c4('0x5c')],_0x9f1a21['destcalleridnum'],_0x3865bc);})['then'](function(_0x27b984){_0x183b60=_0x27b984;logger[_0xb6c4('0x17')](_0xb6c4('0x4e'),_0x183b60['id']);return createTicket(_0x1b19d1,_0x1f9d9b,_0x183b60,_0x3130ce,_0x9f1a21,_0x3130ce[_0xb6c4('0x4f')],_0x3865bc);})[_0xb6c4('0x25')](function(_0x741b84){_0x204ba4=_0x741b84;logger[_0xb6c4('0x17')]('Ticket\x20created!');logger['info'](_0xb6c4('0x50'),_0x204ba4['id']);var _0x3b896b=util['format']('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x1b19d1[_0xb6c4('0x20')],_[_0xb6c4('0x52')](_0x204ba4['id'],'x')[0x1]);logger[_0xb6c4('0x17')](_0xb6c4('0x5a'),_0xb6c4('0x53'));emit(util[_0xb6c4('0x1e')](_0xb6c4('0x54'),_0x42827e[_0xb6c4('0x15')]),_0xb6c4('0x55'),{'uri':_0x3b896b});})[_0xb6c4('0x39')](function(_0x4b552c){logger[_0xb6c4('0x2a')](_0xb6c4('0x5a'),JSON[_0xb6c4('0x29')](_0x4b552c));});};exports[_0xb6c4('0x5d')]=function(_0x1ab46a,_0x3a2d34,_0x18cd98,_0x46e3bd,_0x1321f3,_0x493519){var _0x442b32,_0xebf822,_0xfed01e,_0x27bcc9;_0x493519['remoteUri']=intUtil[_0xb6c4('0x57')](_0x493519['remoteUri']);_0x493519[_0xb6c4('0x58')]=intUtil[_0xb6c4('0x57')](_0x493519[_0xb6c4('0x58')]);if(_0x1321f3&&_0x1321f3['monitor_format']){logger[_0xb6c4('0x17')](_0xb6c4('0x5e'),_0xb6c4('0x49'));_0x3a2d34[_0xb6c4('0x4a')]=util[_0xb6c4('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x493519[_0xb6c4('0x58')],_0x3a2d34[_0xb6c4('0x4b')],md5(_0x3a2d34[_0xb6c4('0x4b')]));}else{_0x3a2d34[_0xb6c4('0x4a')]='';}return getConnection(_0x493519)['then'](function(_0x5b1b69){_0x27bcc9=_0x5b1b69;return getUser(_0x493519,'',_0x27bcc9);})[_0xb6c4('0x25')](function(_0x496cc9){_0x442b32=_0x496cc9;logger[_0xb6c4('0x17')]('The\x20User\x20ID\x20is:',_0x442b32['id']);return getEndUser(_0x493519,_0x3a2d34[_0xb6c4('0x5f')],_0x3a2d34[_0xb6c4('0x60')],_0x27bcc9);})[_0xb6c4('0x25')](function(_0x4ff9c4){_0xebf822=_0x4ff9c4;logger['info'](_0xb6c4('0x4e'),_0xebf822['id']);return createTicket(_0x493519,_0x442b32,_0xebf822,_0x18cd98,_0x3a2d34,_0x18cd98['Fields'],_0x27bcc9);})['then'](function(_0x325c47){_0xfed01e=_0x325c47;logger[_0xb6c4('0x17')]('Ticket\x20created!');logger[_0xb6c4('0x17')](_0xb6c4('0x50'),_0xfed01e['id']);})[_0xb6c4('0x39')](function(_0x13a050){logger[_0xb6c4('0x2a')](_0xb6c4('0x5e'),JSON[_0xb6c4('0x29')](_0x13a050));});}; \ 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 942d914..5e89161 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 _0xe564=['../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Descriptions','Fields','then','info','Ticket\x20created!','validateEmail','Getting\x20agent\x20with\x20email','format','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','%s/search.json','results','length','filter','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','%s/token:%s','token','toString','base64','debug','[HTTP]','stringify','GET','forEach','type','nameField','toLowerCase','string','idField','customField','push','content','variableName','custom_fields','customVariable','Variable','queue','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','error','Zendesk\x20account\x20type\x20not\x20recognized','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','stripTrailingSlash','recordingFormat','[OUTBOUND]','email','destcalleridname','destcalleridnum','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','abandoned','[ABANDONED]','[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe564,0xd6));var _0x4e56=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe564[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4e56('0x0'));var rp=require(_0x4e56('0x1'));var md5=require(_0x4e56('0x2'));var util=require(_0x4e56('0x3'));var Redis=require(_0x4e56('0x4'));var intUtil=require(_0x4e56('0x5'));var config=require(_0x4e56('0x6'));var logger=require(_0x4e56('0x7'))(_0x4e56('0x8'));config[_0x4e56('0x9')]=_[_0x4e56('0xa')](config[_0x4e56('0x9')],{'host':_0x4e56('0xb'),'port':0x18eb});var io=require(_0x4e56('0xc'))(new Redis(config['redis']));function emit(_0xa51850,_0x3b7076,_0x28f67b){io['to'](_0xa51850)[_0x4e56('0xd')](_0x3b7076,_0x28f67b);}var headers={'Content-Type':_0x4e56('0xe'),'Accept':_0x4e56('0xe')};function getTicket(_0x2c4463,_0x4c694c,_0xeb4b3a,_0x5d3990,_0x484713){logger['info']('Creating\x20new\x20ticket...');return request({'uri':util['format'](_0x4e56('0xf'),_0x2c4463[_0x4e56('0x10')]),'method':_0x4e56('0x11'),'body':{'ticket':_[_0x4e56('0x12')]({'requester_id':_0xeb4b3a['id'],'submitter_id':_0x4c694c?_0x4c694c['id']:undefined,'assignee_id':_0x4c694c?_0x4c694c['id']:undefined,'tags':getTags(_0x5d3990[_0x4e56('0x13')],_0x4e56('0x14')),'subject':intUtil['getString'](_0x5d3990['Subjects'],_0x484713,'\x20'),'description':intUtil[_0x4e56('0x15')](_0x5d3990[_0x4e56('0x16')],_0x484713,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x5d3990[_0x4e56('0x16')],_0x484713,'\x0a')}},getCustomFields(_0x5d3990[_0x4e56('0x17')],_0x484713))}})[_0x4e56('0x18')](function(_0x4c56c6){logger[_0x4e56('0x19')](_0x4e56('0x1a'));return _0x4c56c6['ticket'];});}function getUser(_0x1d6564,_0x105d32){if(intUtil[_0x4e56('0x1b')](_0x105d32)){logger[_0x4e56('0x19')](_0x4e56('0x1c'),_0x105d32);return request({'uri':util[_0x4e56('0x1d')]('%s/search.json',_0x1d6564[_0x4e56('0x10')]),'qs':{'query':util['format'](_0x4e56('0x1e'),_0x105d32)}})[_0x4e56('0x18')](function(_0x1b7236){if(_0x1b7236[_0x4e56('0x1f')]){logger[_0x4e56('0x19')](_0x4e56('0x20'));return _[_0x4e56('0x21')](_0x1b7236['results'],{'email':_0x105d32,'role':'agent'});}else{logger[_0x4e56('0x19')](_0x4e56('0x22'));return request({'uri':util[_0x4e56('0x1d')](_0x4e56('0x23'),_0x1d6564[_0x4e56('0x10')])})[_0x4e56('0x18')](function(_0x3dc2d2){logger[_0x4e56('0x19')](_0x4e56('0x24'));return _0x3dc2d2['user'];});}});}else{logger[_0x4e56('0x19')](_0x4e56('0x22'));return request({'uri':util['format']('%s/users/me.json',_0x1d6564[_0x4e56('0x10')])})[_0x4e56('0x18')](function(_0x1c5ed4){logger[_0x4e56('0x19')](_0x4e56('0x24'));return _0x1c5ed4[_0x4e56('0x25')];});}}function getEndUser(_0x797c5,_0x1cb6a8,_0x3e4bcf){logger[_0x4e56('0x19')](_0x4e56('0x26'),_0x3e4bcf);return request({'uri':util['format'](_0x4e56('0x27'),_0x797c5[_0x4e56('0x10')]),'qs':{'query':util[_0x4e56('0x1d')]('type:user\x20role:end-user\x20phone:%s',_0x3e4bcf)}})['then'](function(_0x54d938){var _0x3b08bc;if(_0x54d938[_0x4e56('0x28')][_0x4e56('0x29')]){_0x54d938[_0x4e56('0x28')]=_[_0x4e56('0x2a')](_0x54d938[_0x4e56('0x28')],{'suspended':![],'role':'end-user'});if(_0x54d938[_0x4e56('0x28')][_0x4e56('0x29')]){_0x3b08bc=_[_0x4e56('0x2b')](_0x54d938['results']);}}if(_0x3b08bc){logger['info'](_0x4e56('0x2c'));return _0x3b08bc;}else{logger[_0x4e56('0x19')](_0x4e56('0x2d'));return request({'uri':util[_0x4e56('0x1d')]('%s/users.json',_0x797c5[_0x4e56('0x10')]),'method':_0x4e56('0x11'),'body':{'user':{'role':'end-user','name':util[_0x4e56('0x1d')](_0x4e56('0x2e'),_0x1cb6a8||_0x3e4bcf),'phone':_0x3e4bcf}}})[_0x4e56('0x18')](function(_0x32760c){logger[_0x4e56('0x19')](_0x4e56('0x2f'));return _0x32760c['user'];});}});}function getAuth(_0x4c9c39){var _0x5cf67e;if(_0x4c9c39[_0x4e56('0x30')]===_0x4e56('0x31')){_0x5cf67e=util[_0x4e56('0x1d')](_0x4e56('0x32'),_0x4c9c39[_0x4e56('0x33')],_0x4c9c39[_0x4e56('0x31')]);}else if(_0x4c9c39[_0x4e56('0x30')]==='token'){_0x5cf67e=util[_0x4e56('0x1d')](_0x4e56('0x34'),_0x4c9c39['username'],_0x4c9c39[_0x4e56('0x35')]);}return util[_0x4e56('0x1d')]('Basic\x20%s',new Buffer(_0x5cf67e)[_0x4e56('0x36')](_0x4e56('0x37')));}function request(_0xb2b822){logger[_0x4e56('0x38')](_0x4e56('0x39'),JSON[_0x4e56('0x3a')](_0xb2b822));return rp(_[_0x4e56('0xa')](_0xb2b822,{'method':_0x4e56('0x3b'),'headers':headers,'json':!![]}));}function getTags(_0x3e4457,_0x3259b5){var _0x7c95f6=[];if(_0x3e4457&&_0x3e4457[_0x4e56('0x29')]>0x0){_0x7c95f6=_['map'](_0x3e4457,_0x3259b5);}return _0x7c95f6;}function getCustomFields(_0x3de642,_0x93352a){var _0x3da5cb=[];var _0x5dc868={'custom_fields':[]};if(_0x3de642[_0x4e56('0x29')]>0x0){_[_0x4e56('0x3c')](_0x3de642,function(_0x5980cb){if(_0x5980cb[_0x4e56('0x3d')]==='string'&&_0x5980cb[_0x4e56('0x3e')]&&!_0x5980cb['customField']){_0x5dc868[_0x5980cb[_0x4e56('0x3e')][_0x4e56('0x3f')]()]=_0x5980cb['content']['toString']();}else if(_0x5980cb['type']===_0x4e56('0x40')&&_0x5980cb[_0x4e56('0x41')]&&_0x5980cb[_0x4e56('0x42')]){_0x5dc868['custom_fields'][_0x4e56('0x43')]({'id':_0x5980cb[_0x4e56('0x41')],'value':_0x5980cb[_0x4e56('0x44')][_0x4e56('0x36')]()});}else if(_0x5980cb[_0x4e56('0x3d')]==='variable'&&_0x5980cb[_0x4e56('0x45')]&&_0x5980cb[_0x4e56('0x41')]&&_0x5980cb['customField']){_0x93352a[_0x5980cb['variableName']]&&_0x5dc868[_0x4e56('0x46')]['push']({'id':_0x5980cb['idField'],'value':_0x93352a[_0x5980cb[_0x4e56('0x45')]][_0x4e56('0x36')]()});}else if(_0x5980cb['type']===_0x4e56('0x47')&&_0x5980cb[_0x4e56('0x48')]&&_0x5980cb[_0x4e56('0x48')]['name']&&_0x5980cb[_0x4e56('0x41')]&&_0x5980cb[_0x4e56('0x42')]){_0x93352a[_0x5980cb['Variable'][_0x4e56('0x14')]['toLowerCase']()]&&_0x5dc868[_0x4e56('0x46')]['push']({'id':_0x5980cb[_0x4e56('0x41')],'value':_0x93352a[_0x5980cb[_0x4e56('0x48')][_0x4e56('0x14')][_0x4e56('0x3f')]()]['toString']()});}});}return _0x5dc868;}exports[_0x4e56('0x49')]=function(_0x5c5347,_0x57e3a0,_0x16c531,_0xc96c3c,_0x282d33,_0x57d4f9){var _0x330c80,_0x3d429d;_0x57d4f9[_0x4e56('0x10')]=intUtil['stripTrailingSlash'](_0x57d4f9['remoteUri']);_0x57d4f9[_0x4e56('0x4a')]=intUtil['stripTrailingSlash'](_0x57d4f9[_0x4e56('0x4a')]);if(_0x282d33&&_0x282d33[_0x4e56('0x4b')]){logger['info'](_0x4e56('0x4c'),_0x4e56('0x4d'));_0x57e3a0[_0x4e56('0x4e')]=util[_0x4e56('0x1d')](_0x4e56('0x4f'),_0x57d4f9['serverUrl'],_0x57e3a0[_0x4e56('0x50')],md5(_0x57e3a0['uniqueid']));}else{_0x57e3a0['recordingURL']='';}headers[_0x4e56('0x51')]=getAuth(_0x57d4f9);return getUser(_0x57d4f9,_0xc96c3c['email'])[_0x4e56('0x18')](function(_0x3db29a){_0x330c80=_0x3db29a;logger[_0x4e56('0x19')](_0x4e56('0x52'),_0x330c80['id']);return getEndUser(_0x57d4f9,_0x57e3a0[_0x4e56('0x53')],_0x57e3a0[_0x4e56('0x54')]);})['then'](function(_0x2611b0){_0x3d429d=_0x2611b0;logger[_0x4e56('0x19')](_0x4e56('0x55'),_0x3d429d['id']);return getTicket(_0x57d4f9,_0x330c80,_0x3d429d,_0x16c531,_0x57e3a0);})[_0x4e56('0x18')](function(_0x3ac867){if(_0x3ac867){logger[_0x4e56('0x19')](_0x4e56('0x56'),_0x3ac867['id']);switch(_0x57d4f9[_0x4e56('0x3d')]){case _0x4e56('0x57'):logger[_0x4e56('0x19')]('[QUEUE]',_0x4e56('0x58'));return request({'uri':util[_0x4e56('0x1d')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x57d4f9[_0x4e56('0x10')],_0x330c80['id'],_0x3ac867['id']),'method':_0x4e56('0x11')});case _0x4e56('0x59'):logger[_0x4e56('0x19')](_0x4e56('0x4c'),_0x4e56('0x5a'));emit(util[_0x4e56('0x1d')](_0x4e56('0x5b'),_0xc96c3c[_0x4e56('0x14')]),_0x4e56('0x5c'),{'uri':util[_0x4e56('0x1d')](_0x4e56('0x5d'),_0x57d4f9[_0x4e56('0x10')],_0x3ac867['id'])});break;default:logger[_0x4e56('0x5e')](_0x4e56('0x4c'),_0x4e56('0x5f'));}}})['catch'](function(_0x3f86ee){logger['error'](_0x4e56('0x60'),util[_0x4e56('0x61')](_0x3f86ee,{'showHidden':!![],'depth':null}));});};exports[_0x4e56('0x62')]=function(_0x7f929d,_0x5140d7,_0x7f5eeb,_0x503639,_0x766745,_0x49a2f3,_0x51df5b){var _0xd9b6ae,_0x231ac1;_0x49a2f3[_0x4e56('0x10')]=intUtil[_0x4e56('0x63')](_0x49a2f3['remoteUri']);_0x49a2f3[_0x4e56('0x4a')]=intUtil[_0x4e56('0x63')](_0x49a2f3[_0x4e56('0x4a')]);if(_0x51df5b&&_0x51df5b[_0x4e56('0x64')]&&_0x51df5b['recordingFormat']!=='none'){logger[_0x4e56('0x19')](_0x4e56('0x65'),_0x4e56('0x4d'));_0x5140d7[_0x4e56('0x4e')]=util[_0x4e56('0x1d')](_0x4e56('0x4f'),_0x49a2f3[_0x4e56('0x4a')],_0x5140d7[_0x4e56('0x50')],md5(_0x5140d7['uniqueid']));}headers[_0x4e56('0x51')]=getAuth(_0x49a2f3);return getUser(_0x49a2f3,_0x503639[_0x4e56('0x66')])[_0x4e56('0x18')](function(_0x2d4435){_0xd9b6ae=_0x2d4435;logger[_0x4e56('0x19')](_0x4e56('0x52'),_0xd9b6ae['id']);return getEndUser(_0x49a2f3,_0x5140d7[_0x4e56('0x67')],_0x5140d7[_0x4e56('0x68')]);})[_0x4e56('0x18')](function(_0x250cd2){_0x231ac1=_0x250cd2;logger[_0x4e56('0x19')]('The\x20Enduser\x20ID\x20is:',_0x231ac1['id']);return getTicket(_0x49a2f3,_0xd9b6ae,_0x231ac1,_0x7f5eeb,_0x5140d7);})[_0x4e56('0x18')](function(_0x3a7661){if(_0x3a7661){logger[_0x4e56('0x19')](_0x4e56('0x56'),_0x3a7661['id']);switch(_0x49a2f3['type']){case _0x4e56('0x57'):logger[_0x4e56('0x19')]('[OUTBOUND]',_0x4e56('0x58'));return request({'uri':util[_0x4e56('0x1d')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x49a2f3[_0x4e56('0x10')],_0xd9b6ae['id'],_0x3a7661['id']),'method':_0x4e56('0x11')});case _0x4e56('0x59'):logger[_0x4e56('0x19')](_0x4e56('0x65'),_0x4e56('0x5a'));emit(util[_0x4e56('0x1d')](_0x4e56('0x5b'),_0x503639[_0x4e56('0x14')]),_0x4e56('0x5c'),{'uri':util[_0x4e56('0x1d')](_0x4e56('0x5d'),_0x49a2f3[_0x4e56('0x10')],_0x3a7661['id'])});break;default:logger[_0x4e56('0x5e')]('[OUTBOUND]','Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x4e56('0x69')](function(_0x1ddbdf){logger[_0x4e56('0x5e')](_0x4e56('0x6a'),util[_0x4e56('0x61')](_0x1ddbdf,{'showHidden':!![],'depth':null}));});};exports[_0x4e56('0x6b')]=function(_0x1810ee,_0x47c4d7,_0x3b0f91,_0x4a95f1,_0x201863,_0x4b6286){var _0x231082,_0x5590bf;_0x4b6286[_0x4e56('0x10')]=intUtil['stripTrailingSlash'](_0x4b6286[_0x4e56('0x10')]);_0x4b6286['serverUrl']=intUtil[_0x4e56('0x63')](_0x4b6286[_0x4e56('0x4a')]);if(_0x201863&&_0x201863[_0x4e56('0x4b')]){logger[_0x4e56('0x19')](_0x4e56('0x6c'),_0x4e56('0x4d'));_0x47c4d7[_0x4e56('0x4e')]=util[_0x4e56('0x1d')](_0x4e56('0x4f'),_0x4b6286[_0x4e56('0x4a')],_0x47c4d7[_0x4e56('0x50')],md5(_0x47c4d7[_0x4e56('0x50')]));}else{_0x47c4d7[_0x4e56('0x4e')]='';}headers[_0x4e56('0x51')]=getAuth(_0x4b6286);return getUser(_0x4b6286)[_0x4e56('0x18')](function(_0x3bf0cc){_0x231082=_0x3bf0cc;logger[_0x4e56('0x19')](_0x4e56('0x52'),_0x231082['id']);return getEndUser(_0x4b6286,_0x47c4d7[_0x4e56('0x53')],_0x47c4d7[_0x4e56('0x54')]);})[_0x4e56('0x18')](function(_0x583803){_0x5590bf=_0x583803;logger[_0x4e56('0x19')](_0x4e56('0x55'),_0x5590bf['id']);return getTicket(_0x4b6286,_0x231082,_0x5590bf,_0x3b0f91,_0x47c4d7);})[_0x4e56('0x18')](function(_0x2374e9){if(_0x2374e9){logger[_0x4e56('0x19')](_0x4e56('0x56'),_0x2374e9['id']);}})[_0x4e56('0x69')](function(_0x31998d){logger[_0x4e56('0x5e')](_0x4e56('0x6d'),util[_0x4e56('0x61')](_0x31998d,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x6a0f=['Enduser\x20created.','authType','password','%s:%s','token','%s/token:%s','Basic\x20%s','toString','debug','[HTTP]','stringify','GET','map','forEach','type','string','nameField','customField','toLowerCase','content','custom_fields','push','idField','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','user:%s','trigger:browser:url','%s/agent/tickets/%s','error','catch','inspect','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','Zendesk\x20account\x20type\x20not\x20recognized','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','abandoned','[ABANDONED]','[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration','lodash','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','defaults','redis','socket.io-emitter','emit','application/json','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','info','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','results','length','end-user','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6a0f,0xb0));var _0xf6a0=function(_0x5698df,_0x389910){_0x5698df=_0x5698df-0x0;var _0x5752b2=_0x6a0f[_0x5698df];return _0x5752b2;};'use strict';var _=require(_0xf6a0('0x0'));var rp=require('request-promise');var md5=require(_0xf6a0('0x1'));var util=require(_0xf6a0('0x2'));var Redis=require(_0xf6a0('0x3'));var intUtil=require(_0xf6a0('0x4'));var config=require(_0xf6a0('0x5'));var logger=require(_0xf6a0('0x6'))(_0xf6a0('0x7'));config['redis']=_[_0xf6a0('0x8')](config[_0xf6a0('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xf6a0('0xa'))(new Redis(config[_0xf6a0('0x9')]));function emit(_0x410453,_0x4b7f85,_0x422665){io['to'](_0x410453)[_0xf6a0('0xb')](_0x4b7f85,_0x422665);}var headers={'Content-Type':_0xf6a0('0xc'),'Accept':_0xf6a0('0xc')};function getTicket(_0x10e349,_0x5eb0dc,_0x130d88,_0x5c6476,_0x4d6c42){logger['info'](_0xf6a0('0xd'));return request({'uri':util[_0xf6a0('0xe')](_0xf6a0('0xf'),_0x10e349[_0xf6a0('0x10')]),'method':_0xf6a0('0x11'),'body':{'ticket':_['merge']({'requester_id':_0x130d88['id'],'submitter_id':_0x5eb0dc?_0x5eb0dc['id']:undefined,'assignee_id':_0x5eb0dc?_0x5eb0dc['id']:undefined,'tags':getTags(_0x5c6476[_0xf6a0('0x12')],_0xf6a0('0x13')),'subject':intUtil[_0xf6a0('0x14')](_0x5c6476[_0xf6a0('0x15')],_0x4d6c42,'\x20'),'description':intUtil[_0xf6a0('0x14')](_0x5c6476[_0xf6a0('0x16')],_0x4d6c42,'\x0a'),'comment':{'public':![],'body':intUtil[_0xf6a0('0x14')](_0x5c6476[_0xf6a0('0x16')],_0x4d6c42,'\x0a')}},getCustomFields(_0x5c6476[_0xf6a0('0x17')],_0x4d6c42))}})[_0xf6a0('0x18')](function(_0x28accd){logger['info'](_0xf6a0('0x19'));return _0x28accd[_0xf6a0('0x1a')];});}function getUser(_0x25f02c,_0x2b9a8a){if(intUtil[_0xf6a0('0x1b')](_0x2b9a8a)){logger[_0xf6a0('0x1c')](_0xf6a0('0x1d'),_0x2b9a8a);return request({'uri':util[_0xf6a0('0xe')](_0xf6a0('0x1e'),_0x25f02c[_0xf6a0('0x10')]),'qs':{'query':util['format'](_0xf6a0('0x1f'),_0x2b9a8a)}})[_0xf6a0('0x18')](function(_0x44f506){if(_0x44f506[_0xf6a0('0x20')]){logger['info'](_0xf6a0('0x21'));return _[_0xf6a0('0x22')](_0x44f506['results'],{'email':_0x2b9a8a,'role':_0xf6a0('0x23')});}else{logger[_0xf6a0('0x1c')](_0xf6a0('0x24'));return request({'uri':util[_0xf6a0('0xe')](_0xf6a0('0x25'),_0x25f02c[_0xf6a0('0x10')])})['then'](function(_0x4db3c0){logger[_0xf6a0('0x1c')](_0xf6a0('0x26'));return _0x4db3c0['user'];});}});}else{logger[_0xf6a0('0x1c')](_0xf6a0('0x24'));return request({'uri':util[_0xf6a0('0xe')](_0xf6a0('0x25'),_0x25f02c['remoteUri'])})[_0xf6a0('0x18')](function(_0x4b03b0){logger['info'](_0xf6a0('0x26'));return _0x4b03b0[_0xf6a0('0x27')];});}}function getEndUser(_0x3fccc0,_0xde457c,_0x4a4eb7){logger[_0xf6a0('0x1c')](_0xf6a0('0x28'),_0x4a4eb7);return request({'uri':util[_0xf6a0('0xe')](_0xf6a0('0x1e'),_0x3fccc0[_0xf6a0('0x10')]),'qs':{'query':util['format'](_0xf6a0('0x29'),_0x4a4eb7)}})['then'](function(_0x39468c){var _0x40472e;if(_0x39468c[_0xf6a0('0x2a')][_0xf6a0('0x2b')]){_0x39468c[_0xf6a0('0x2a')]=_['filter'](_0x39468c[_0xf6a0('0x2a')],{'suspended':![],'role':_0xf6a0('0x2c')});if(_0x39468c[_0xf6a0('0x2a')][_0xf6a0('0x2b')]){_0x40472e=_['first'](_0x39468c['results']);}}if(_0x40472e){logger['info'](_0xf6a0('0x2d'));return _0x40472e;}else{logger[_0xf6a0('0x1c')](_0xf6a0('0x2e'));return request({'uri':util[_0xf6a0('0xe')](_0xf6a0('0x2f'),_0x3fccc0[_0xf6a0('0x10')]),'method':_0xf6a0('0x11'),'body':{'user':{'role':_0xf6a0('0x2c'),'name':util[_0xf6a0('0xe')]('Caller\x20-\x20%s',_0xde457c||_0x4a4eb7),'phone':_0x4a4eb7}}})[_0xf6a0('0x18')](function(_0x137141){logger[_0xf6a0('0x1c')](_0xf6a0('0x30'));return _0x137141[_0xf6a0('0x27')];});}});}function getAuth(_0x3838de){var _0x5cab73;if(_0x3838de[_0xf6a0('0x31')]===_0xf6a0('0x32')){_0x5cab73=util[_0xf6a0('0xe')](_0xf6a0('0x33'),_0x3838de['username'],_0x3838de[_0xf6a0('0x32')]);}else if(_0x3838de[_0xf6a0('0x31')]===_0xf6a0('0x34')){_0x5cab73=util[_0xf6a0('0xe')](_0xf6a0('0x35'),_0x3838de['username'],_0x3838de['token']);}return util[_0xf6a0('0xe')](_0xf6a0('0x36'),new Buffer(_0x5cab73)[_0xf6a0('0x37')]('base64'));}function request(_0x43b0bf){logger[_0xf6a0('0x38')](_0xf6a0('0x39'),JSON[_0xf6a0('0x3a')](_0x43b0bf));return rp(_['defaults'](_0x43b0bf,{'method':_0xf6a0('0x3b'),'headers':headers,'json':!![]}));}function getTags(_0x52d6ba,_0x248a52){var _0xef3474=[];if(_0x52d6ba&&_0x52d6ba[_0xf6a0('0x2b')]>0x0){_0xef3474=_[_0xf6a0('0x3c')](_0x52d6ba,_0x248a52);}return _0xef3474;}function getCustomFields(_0xe433ee,_0x50d7eb){var _0x57ee8b=[];var _0x1acafb={'custom_fields':[]};if(_0xe433ee['length']>0x0){_[_0xf6a0('0x3d')](_0xe433ee,function(_0x201dad){if(_0x201dad[_0xf6a0('0x3e')]===_0xf6a0('0x3f')&&_0x201dad[_0xf6a0('0x40')]&&!_0x201dad[_0xf6a0('0x41')]){_0x1acafb[_0x201dad[_0xf6a0('0x40')][_0xf6a0('0x42')]()]=_0x201dad[_0xf6a0('0x43')][_0xf6a0('0x37')]();}else if(_0x201dad[_0xf6a0('0x3e')]==='string'&&_0x201dad['idField']&&_0x201dad[_0xf6a0('0x41')]){_0x1acafb[_0xf6a0('0x44')][_0xf6a0('0x45')]({'id':_0x201dad[_0xf6a0('0x46')],'value':_0x201dad[_0xf6a0('0x43')][_0xf6a0('0x37')]()});}else if(_0x201dad[_0xf6a0('0x3e')]===_0xf6a0('0x47')&&_0x201dad['variableName']&&_0x201dad['idField']&&_0x201dad['customField']){_0x50d7eb[_0x201dad[_0xf6a0('0x48')]]&&_0x1acafb[_0xf6a0('0x44')][_0xf6a0('0x45')]({'id':_0x201dad[_0xf6a0('0x46')],'value':_0x50d7eb[_0x201dad['variableName']][_0xf6a0('0x37')]()});}else if(_0x201dad[_0xf6a0('0x3e')]===_0xf6a0('0x49')&&_0x201dad['Variable']&&_0x201dad[_0xf6a0('0x4a')][_0xf6a0('0x13')]&&_0x201dad[_0xf6a0('0x46')]&&_0x201dad[_0xf6a0('0x41')]){_0x50d7eb[_0x201dad[_0xf6a0('0x4a')][_0xf6a0('0x13')]['toLowerCase']()]&&_0x1acafb[_0xf6a0('0x44')][_0xf6a0('0x45')]({'id':_0x201dad['idField'],'value':_0x50d7eb[_0x201dad[_0xf6a0('0x4a')][_0xf6a0('0x13')][_0xf6a0('0x42')]()][_0xf6a0('0x37')]()});}});}return _0x1acafb;}exports[_0xf6a0('0x4b')]=function(_0x2d3695,_0x380f19,_0x537219,_0x559ceb,_0x298d9d,_0x589c28){var _0x4d241f,_0x4f894b;_0x589c28['remoteUri']=intUtil[_0xf6a0('0x4c')](_0x589c28[_0xf6a0('0x10')]);_0x589c28[_0xf6a0('0x4d')]=intUtil[_0xf6a0('0x4c')](_0x589c28['serverUrl']);if(_0x298d9d&&_0x298d9d[_0xf6a0('0x4e')]){logger[_0xf6a0('0x1c')]('[QUEUE]',_0xf6a0('0x4f'));_0x380f19[_0xf6a0('0x50')]=util['format'](_0xf6a0('0x51'),_0x589c28[_0xf6a0('0x4d')],_0x380f19['uniqueid'],md5(_0x380f19['uniqueid']));}else{_0x380f19['recordingURL']='';}headers[_0xf6a0('0x52')]=getAuth(_0x589c28);return getUser(_0x589c28,_0x559ceb[_0xf6a0('0x53')])['then'](function(_0x593457){_0x4d241f=_0x593457;logger[_0xf6a0('0x1c')](_0xf6a0('0x54'),_0x4d241f['id']);return getEndUser(_0x589c28,_0x380f19[_0xf6a0('0x55')],_0x380f19[_0xf6a0('0x56')]);})[_0xf6a0('0x18')](function(_0x2df4ad){_0x4f894b=_0x2df4ad;logger[_0xf6a0('0x1c')](_0xf6a0('0x57'),_0x4f894b['id']);return getTicket(_0x589c28,_0x4d241f,_0x4f894b,_0x537219,_0x380f19);})[_0xf6a0('0x18')](function(_0x4b5740){if(_0x4b5740){logger[_0xf6a0('0x1c')]('The\x20Ticket\x20ID\x20is:',_0x4b5740['id']);switch(_0x589c28[_0xf6a0('0x3e')]){case _0xf6a0('0x58'):logger[_0xf6a0('0x1c')](_0xf6a0('0x59'),_0xf6a0('0x5a'));return request({'uri':util[_0xf6a0('0xe')](_0xf6a0('0x5b'),_0x589c28[_0xf6a0('0x10')],_0x4d241f['id'],_0x4b5740['id']),'method':_0xf6a0('0x11')});case _0xf6a0('0x5c'):logger[_0xf6a0('0x1c')](_0xf6a0('0x59'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xf6a0('0xe')](_0xf6a0('0x5d'),_0x559ceb[_0xf6a0('0x13')]),_0xf6a0('0x5e'),{'uri':util['format'](_0xf6a0('0x5f'),_0x589c28[_0xf6a0('0x10')],_0x4b5740['id'])});break;default:logger[_0xf6a0('0x60')](_0xf6a0('0x59'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xf6a0('0x61')](function(_0x45cb09){logger['error']('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0xf6a0('0x62')](_0x45cb09,{'showHidden':!![],'depth':null}));});};exports[_0xf6a0('0x63')]=function(_0x20f949,_0x38b63b,_0x324708,_0xdcb65c,_0x30c6be,_0x27518b,_0x50e5b3){var _0x46f5b6,_0x455ad1;_0x27518b[_0xf6a0('0x10')]=intUtil['stripTrailingSlash'](_0x27518b[_0xf6a0('0x10')]);_0x27518b[_0xf6a0('0x4d')]=intUtil[_0xf6a0('0x4c')](_0x27518b[_0xf6a0('0x4d')]);if(_0x50e5b3&&_0x50e5b3[_0xf6a0('0x64')]&&_0x50e5b3[_0xf6a0('0x64')]!==_0xf6a0('0x65')){logger[_0xf6a0('0x1c')](_0xf6a0('0x66'),_0xf6a0('0x4f'));_0x38b63b[_0xf6a0('0x50')]=util['format'](_0xf6a0('0x51'),_0x27518b[_0xf6a0('0x4d')],_0x38b63b['uniqueid'],md5(_0x38b63b[_0xf6a0('0x67')]));}headers[_0xf6a0('0x52')]=getAuth(_0x27518b);return getUser(_0x27518b,_0xdcb65c['email'])[_0xf6a0('0x18')](function(_0x36e944){_0x46f5b6=_0x36e944;logger[_0xf6a0('0x1c')](_0xf6a0('0x54'),_0x46f5b6['id']);return getEndUser(_0x27518b,_0x38b63b[_0xf6a0('0x68')],_0x38b63b[_0xf6a0('0x69')]);})[_0xf6a0('0x18')](function(_0x5c119b){_0x455ad1=_0x5c119b;logger[_0xf6a0('0x1c')](_0xf6a0('0x57'),_0x455ad1['id']);return getTicket(_0x27518b,_0x46f5b6,_0x455ad1,_0x324708,_0x38b63b);})[_0xf6a0('0x18')](function(_0x19fb02){if(_0x19fb02){logger[_0xf6a0('0x1c')](_0xf6a0('0x6a'),_0x19fb02['id']);switch(_0x27518b[_0xf6a0('0x3e')]){case _0xf6a0('0x58'):logger[_0xf6a0('0x1c')]('[OUTBOUND]',_0xf6a0('0x5a'));return request({'uri':util[_0xf6a0('0xe')](_0xf6a0('0x5b'),_0x27518b['remoteUri'],_0x46f5b6['id'],_0x19fb02['id']),'method':'POST'});case _0xf6a0('0x5c'):logger[_0xf6a0('0x1c')](_0xf6a0('0x66'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xf6a0('0xe')](_0xf6a0('0x5d'),_0xdcb65c[_0xf6a0('0x13')]),_0xf6a0('0x5e'),{'uri':util[_0xf6a0('0xe')](_0xf6a0('0x5f'),_0x27518b[_0xf6a0('0x10')],_0x19fb02['id'])});break;default:logger[_0xf6a0('0x60')](_0xf6a0('0x66'),_0xf6a0('0x6b'));}}})[_0xf6a0('0x61')](function(_0x14b751){logger[_0xf6a0('0x60')](_0xf6a0('0x6c'),util[_0xf6a0('0x62')](_0x14b751,{'showHidden':!![],'depth':null}));});};exports[_0xf6a0('0x6d')]=function(_0x1ecbda,_0x554643,_0x4a406d,_0x208880,_0x4be408,_0x216851){var _0xcd6365,_0x37ec89;_0x216851['remoteUri']=intUtil['stripTrailingSlash'](_0x216851['remoteUri']);_0x216851[_0xf6a0('0x4d')]=intUtil[_0xf6a0('0x4c')](_0x216851['serverUrl']);if(_0x4be408&&_0x4be408[_0xf6a0('0x4e')]){logger[_0xf6a0('0x1c')](_0xf6a0('0x6e'),_0xf6a0('0x4f'));_0x554643['recordingURL']=util[_0xf6a0('0xe')](_0xf6a0('0x51'),_0x216851[_0xf6a0('0x4d')],_0x554643[_0xf6a0('0x67')],md5(_0x554643[_0xf6a0('0x67')]));}else{_0x554643['recordingURL']='';}headers[_0xf6a0('0x52')]=getAuth(_0x216851);return getUser(_0x216851)[_0xf6a0('0x18')](function(_0xe4dc09){_0xcd6365=_0xe4dc09;logger[_0xf6a0('0x1c')](_0xf6a0('0x54'),_0xcd6365['id']);return getEndUser(_0x216851,_0x554643[_0xf6a0('0x55')],_0x554643[_0xf6a0('0x56')]);})[_0xf6a0('0x18')](function(_0x7e505f){_0x37ec89=_0x7e505f;logger[_0xf6a0('0x1c')](_0xf6a0('0x57'),_0x37ec89['id']);return getTicket(_0x216851,_0xcd6365,_0x37ec89,_0x4a406d,_0x554643);})['then'](function(_0x1f177f){if(_0x1f177f){logger[_0xf6a0('0x1c')](_0xf6a0('0x6a'),_0x1f177f['id']);}})[_0xf6a0('0x61')](function(_0x304b5d){logger[_0xf6a0('0x60')](_0xf6a0('0x6f'),util[_0xf6a0('0x62')](_0x304b5d,{'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 f6e6bcd..8b84b9a 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 _0x8a58=['Leads','val','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s%s%s','Enduser\x20created.','https://crm.%s/crm/private/json/Leads/getRecordById','debug','[HTTP]','type','string','idField','variable','variableName','toString','customVariable','Variable','name','toLowerCase','queue','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','Outbound','The\x20Call\x20ID\x20is:','https://crm.%s/crm/EntityInfo.do?module=Calls&id=%s','catch','monitor_format','[ABANDONED]','lodash','util','./util','xml2json','moment','ioredis','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','application/json','info','Creating\x20new\x20call...','merge','outbound','starttime','format','YYYY-MM-DD\x20HH:mm:ss','Subjects','Fields','lastevent','called','Called','complete','Call\x20Result','Answered','rejected','abandoned','Abandoned','talktime','Call\x20Duration','utc','mm:ss','endtime','diff','CONTACTID','LEADID','SEID','','hasOwnProperty','%s','encodeXML','','POST','host','crmapi','then','parse','response','result','recorddetail','Call\x20created!','stringify','GET','https://crm.%s/crm/private/json/Users/getUsers','AllUsers','authToken','users','zoho\x20data\x20users','user','isArrayLikeObject','find','Standard','active','isNil','Using\x20the\x20admin\x20account!','Administrator','log','zoho\x20user','profile','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','error','Searching\x20enduser\x20with\x20phone','((Phone:%s))','Enduser\x20found\x20in\x20Contacts!','Contacts','row','length','content','https://crm.%s/crm/private/json/Leads/searchRecords'];(function(_0x16c248,_0x42ec2c){var _0x26e279=function(_0x2c39f4){while(--_0x2c39f4){_0x16c248['push'](_0x16c248['shift']());}};_0x26e279(++_0x42ec2c);}(_0x8a58,0x130));var _0x88a5=function(_0x1f0865,_0x1a285d){_0x1f0865=_0x1f0865-0x0;var _0x58cecc=_0x8a58[_0x1f0865];return _0x58cecc;};'use strict';var _=require(_0x88a5('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0x88a5('0x1'));var intUtil=require(_0x88a5('0x2'));var parser=require(_0x88a5('0x3'));var entities=require('entities');var moment=require(_0x88a5('0x4'));var Redis=require(_0x88a5('0x5'));var config=require(_0x88a5('0x6'));var logger=require(_0x88a5('0x7'))(_0x88a5('0x8'));config[_0x88a5('0x9')]=_[_0x88a5('0xa')](config['redis'],{'host':_0x88a5('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x88a5('0x9')]));function emit(_0x50ec17,_0x2b0323,_0x2b4361){io['to'](_0x50ec17)['emit'](_0x2b0323,_0x2b4361);}var headers={'Content-Type':_0x88a5('0xc'),'Accept':_0x88a5('0xc')};function getCall(_0x183171,_0x151b0e,_0x4c1137,_0x175b63,_0x369483,_0x52daa1){logger[_0x88a5('0xd')](_0x88a5('0xe'));var _0x235053=_[_0x88a5('0xf')]({'SMOWNERID':_0x151b0e['id'],'Call Type':_0x52daa1||'inbound','Call Start Time':(_0x52daa1===_0x88a5('0x10')?_0x369483[_0x88a5('0x11')]:_0x369483['agentcalledAt'])||moment()[_0x88a5('0x12')](_0x88a5('0x13')),'Subject':intUtil['getString'](_0x175b63[_0x88a5('0x14')],_0x369483,'\x20'),'Description':intUtil['getString'](_0x175b63['Descriptions'],_0x369483,'\x0a')},getCustomFields(_0x175b63[_0x88a5('0x15')],_0x369483));switch(_0x369483[_0x88a5('0x16')]){case _0x88a5('0x17'):_0x235053['Call\x20Result']=_0x88a5('0x18');break;case _0x88a5('0x19'):case'connect':_0x235053[_0x88a5('0x1a')]=_0x88a5('0x1b');break;case _0x88a5('0x1c'):_0x235053[_0x88a5('0x1a')]='Rejected';break;case _0x88a5('0x1d'):_0x235053[_0x88a5('0x1a')]=_0x88a5('0x1e');break;default:}if(_0x369483[_0x88a5('0x1f')]){_0x235053[_0x88a5('0x20')]=moment[_0x88a5('0x21')](parseInt(_0x369483[_0x88a5('0x1f')])*0x3e8)[_0x88a5('0x12')](_0x88a5('0x22'));}else if(_0x369483['answertime']&&_0x369483[_0x88a5('0x23')]){_0x235053['Call\x20Duration']=moment[_0x88a5('0x21')](moment(_0x369483['endtime'],_0x88a5('0x13'))[_0x88a5('0x24')](moment(_0x369483['starttime'],_0x88a5('0x13'))))[_0x88a5('0x12')](_0x88a5('0x22'));}if(_0x4c1137[_0x88a5('0x25')]){_0x235053[_0x88a5('0x25')]=_0x4c1137[_0x88a5('0x25')];}else if(_0x4c1137[_0x88a5('0x26')]){_0x235053['SEMODULE']='Leads';_0x235053[_0x88a5('0x27')]=_0x4c1137[_0x88a5('0x26')];}var _0x811396=_0x88a5('0x28');for(var _0x4e99dd in _0x235053){if(_0x235053[_0x88a5('0x29')](_0x4e99dd)){_0x811396+=util['format'](_0x88a5('0x2a'),entities[_0x88a5('0x2b')](_0x4e99dd),entities[_0x88a5('0x2b')](_0x235053[_0x4e99dd]));}}_0x811396+=_0x88a5('0x2c');return request({'method':_0x88a5('0x2d'),'uri':util[_0x88a5('0x12')]('https://crm.%s/crm/private/xml/Calls/insertRecords',_0x183171[_0x88a5('0x2e')]),'qs':{'authtoken':_0x183171['authToken'],'scope':_0x88a5('0x2f'),'xmlData':_0x811396},'json':!![]})[_0x88a5('0x30')](function(_0x16ba9b){_0x16ba9b=JSON[_0x88a5('0x31')](parser['toJson'](_0x16ba9b));if(_0x16ba9b[_0x88a5('0x32')]){if(_0x16ba9b[_0x88a5('0x32')]['result']&&_0x16ba9b[_0x88a5('0x32')][_0x88a5('0x33')][_0x88a5('0x34')]){logger[_0x88a5('0xd')](_0x88a5('0x35'));return{'id':_0x16ba9b[_0x88a5('0x32')][_0x88a5('0x33')][_0x88a5('0x34')]['FL'][0x0]['$t']};}}throw new Error('Error\x20on\x20call\x20creation:\x20'+JSON[_0x88a5('0x36')](_0x16ba9b));});}function getUser(_0x1d4dbc,_0x3b73c8){return request({'method':_0x88a5('0x37'),'uri':util[_0x88a5('0x12')](_0x88a5('0x38'),_0x1d4dbc[_0x88a5('0x2e')]),'qs':{'type':_0x88a5('0x39'),'authtoken':_0x1d4dbc[_0x88a5('0x3a')],'scope':_0x88a5('0x2f')},'json':!![]})['then'](function(_0x1236ea){if(_0x1236ea[_0x88a5('0x3b')]&&_0x1236ea[_0x88a5('0x3b')]['user']){var _0x2ee869;console['log'](_0x88a5('0x3c'),_0x1236ea['users'][_0x88a5('0x3d')]);if(_[_0x88a5('0x3e')](_0x1236ea[_0x88a5('0x3b')][_0x88a5('0x3d')])){console['log'](_0x88a5('0x3c'),_0x1236ea[_0x88a5('0x3b')][_0x88a5('0x3d')]);if(!_['isNil'](_0x3b73c8)){_0x2ee869=_[_0x88a5('0x3f')](_0x1236ea[_0x88a5('0x3b')]['user'],{'email':_0x3b73c8,'profile':_0x88a5('0x40'),'status':_0x88a5('0x41')});}if(!_[_0x88a5('0x42')](_0x2ee869)){logger['info']('Agent\x20found!');}else{logger[_0x88a5('0xd')](_0x88a5('0x43'));_0x2ee869=_['find'](_0x1236ea[_0x88a5('0x3b')][_0x88a5('0x3d')],{'profile':_0x88a5('0x44')});}console[_0x88a5('0x45')](_0x88a5('0x46'),_0x2ee869);return _0x2ee869;}else{if(_0x1236ea['users'][_0x88a5('0x3d')][_0x88a5('0x47')]==='Administrator'){logger[_0x88a5('0xd')](_0x88a5('0x43'));_0x2ee869=_0x1236ea[_0x88a5('0x3b')][_0x88a5('0x3d')];return _0x2ee869;}else{logger['error'](_0x88a5('0x48'),JSON[_0x88a5('0x36')](_0x1236ea));throw new Error(_0x88a5('0x49')+JSON['stringify'](_0x1236ea));}}}else{logger[_0x88a5('0x4a')](_0x88a5('0x48'),JSON[_0x88a5('0x36')](_0x1236ea));throw new Error(_0x88a5('0x49')+JSON[_0x88a5('0x36')](_0x1236ea));}});}function getEndUser(_0x4d8e6a,_0x3683b4,_0x4335e0){logger[_0x88a5('0xd')](_0x88a5('0x4b'),_0x4335e0);return request({'method':_0x88a5('0x37'),'uri':util[_0x88a5('0x12')]('https://crm.%s/crm/private/json/Contacts/searchRecords',_0x4d8e6a[_0x88a5('0x2e')]),'qs':{'authtoken':_0x4d8e6a[_0x88a5('0x3a')],'scope':'crmapi','criteria':util[_0x88a5('0x12')](_0x88a5('0x4c'),_0x4335e0)},'json':!![]})[_0x88a5('0x30')](function(_0x36b277){if(_0x36b277[_0x88a5('0x32')]&&_0x36b277[_0x88a5('0x32')]['result']){logger[_0x88a5('0xd')](_0x88a5('0x4d'));var _0x1c0fb4={};var _0x5c51f8=_0x36b277[_0x88a5('0x32')][_0x88a5('0x33')][_0x88a5('0x4e')][_0x88a5('0x4f')]['no']?_0x36b277[_0x88a5('0x32')][_0x88a5('0x33')]['Contacts'][_0x88a5('0x4f')]['FL']:_0x36b277[_0x88a5('0x32')][_0x88a5('0x33')][_0x88a5('0x4e')][_0x88a5('0x4f')][0x0]['FL'];for(var _0x396bbb=0x0,_0x2d872e=_0x5c51f8[_0x88a5('0x50')];_0x396bbb<_0x2d872e;_0x396bbb++){_0x1c0fb4[_0x5c51f8[_0x396bbb]['val']]=_0x5c51f8[_0x396bbb][_0x88a5('0x51')];}return _0x1c0fb4;}else{return request({'method':_0x88a5('0x37'),'uri':util[_0x88a5('0x12')](_0x88a5('0x52'),_0x4d8e6a['host']),'qs':{'authtoken':_0x4d8e6a[_0x88a5('0x3a')],'scope':'crmapi','criteria':util[_0x88a5('0x12')]('((Phone:%s))',_0x4335e0)},'json':!![]})['then'](function(_0x5e0c3){if(_0x5e0c3[_0x88a5('0x32')]&&_0x5e0c3[_0x88a5('0x32')][_0x88a5('0x33')]){logger[_0x88a5('0xd')]('Enduser\x20found\x20in\x20Leads!');var _0x28517f={};var _0x3485d8=_0x5e0c3[_0x88a5('0x32')][_0x88a5('0x33')][_0x88a5('0x53')]['row']['no']?_0x5e0c3[_0x88a5('0x32')][_0x88a5('0x33')][_0x88a5('0x53')][_0x88a5('0x4f')]['FL']:_0x5e0c3[_0x88a5('0x32')][_0x88a5('0x33')][_0x88a5('0x53')][_0x88a5('0x4f')][0x0]['FL'];for(var _0x52abef=0x0,_0x41964d=_0x3485d8[_0x88a5('0x50')];_0x52abef<_0x41964d;_0x52abef++){_0x28517f[_0x3485d8[_0x52abef][_0x88a5('0x54')]]=_0x3485d8[_0x52abef][_0x88a5('0x51')];}return _0x28517f;}else{logger[_0x88a5('0xd')](_0x88a5('0x55'));_0x3683b4=getName(_0x3683b4);return request({'method':_0x88a5('0x2d'),'uri':util[_0x88a5('0x12')]('https://crm.%s/crm/private/xml/Leads/insertRecords',_0x4d8e6a[_0x88a5('0x2e')]),'qs':{'authtoken':_0x4d8e6a['authToken'],'scope':_0x88a5('0x2f'),'xmlData':util[_0x88a5('0x12')](_0x88a5('0x56'),entities[_0x88a5('0x2b')](_0x3683b4[0x0]),entities['encodeXML'](_0x3683b4[0x1]),_0x4335e0)},'json':!![]})[_0x88a5('0x30')](function(_0x4e667b){_0x4e667b=JSON[_0x88a5('0x31')](parser['toJson'](_0x4e667b));if(_0x4e667b[_0x88a5('0x32')]){if(_0x4e667b[_0x88a5('0x32')]['result']&&_0x4e667b['response'][_0x88a5('0x33')][_0x88a5('0x34')]){logger[_0x88a5('0xd')](_0x88a5('0x57'));return request({'method':_0x88a5('0x37'),'uri':util[_0x88a5('0x12')](_0x88a5('0x58'),_0x4d8e6a['host']),'qs':{'authtoken':_0x4d8e6a[_0x88a5('0x3a')],'scope':'crmapi','id':_0x4e667b[_0x88a5('0x32')]['result'][_0x88a5('0x34')]['FL'][0x0]['$t']},'json':!![]});}}throw new Error('Error\x20on\x20Lead\x20creation:\x20'+JSON[_0x88a5('0x36')](_0x4e667b));})[_0x88a5('0x30')](function(_0x1dc69d){if(_0x1dc69d[_0x88a5('0x32')]){if(_0x1dc69d[_0x88a5('0x32')][_0x88a5('0x33')]){var _0x5f1d66={};for(var _0x5f4dcb=0x0,_0x17a4f2=_0x1dc69d[_0x88a5('0x32')][_0x88a5('0x33')][_0x88a5('0x53')][_0x88a5('0x4f')]['FL']['length'];_0x5f4dcb<_0x17a4f2;_0x5f4dcb++){_0x5f1d66[_0x1dc69d[_0x88a5('0x32')][_0x88a5('0x33')]['Leads'][_0x88a5('0x4f')]['FL'][_0x5f4dcb]['val']]=_0x1dc69d['response'][_0x88a5('0x33')]['Leads'][_0x88a5('0x4f')]['FL'][_0x5f4dcb][_0x88a5('0x51')];}return _0x5f1d66;}}throw new Error('Error\x20on\x20Lead\x20retrieve:\x20'+JSON[_0x88a5('0x36')](_0x1dc69d));});}});}});}function request(_0x3013d6){logger[_0x88a5('0x59')](_0x88a5('0x5a'),JSON[_0x88a5('0x36')](_0x3013d6));return rp(_0x3013d6);}function getCustomFields(_0x49c98f,_0x28eac8){var _0x4be310={};if(_0x49c98f[_0x88a5('0x50')]>0x0){_['forEach'](_0x49c98f,function(_0x4b8fc6){if(_0x4b8fc6[_0x88a5('0x5b')]===_0x88a5('0x5c')&&_0x4b8fc6[_0x88a5('0x5d')]){_0x4be310[_0x4b8fc6['idField']]=_0x4b8fc6[_0x88a5('0x51')]['toString']();}else if(_0x4b8fc6['type']===_0x88a5('0x5e')&&_0x4b8fc6[_0x88a5('0x5f')]&&_0x4b8fc6[_0x88a5('0x5d')]&&_0x28eac8[_0x4b8fc6[_0x88a5('0x5f')]]){_0x4be310[_0x4b8fc6[_0x88a5('0x5d')]]=_0x28eac8[_0x4b8fc6[_0x88a5('0x5f')]][_0x88a5('0x60')]();}else if(_0x4b8fc6[_0x88a5('0x5b')]===_0x88a5('0x61')&&_0x4b8fc6['Variable']&&_0x4b8fc6[_0x88a5('0x62')]['name']&&_0x4b8fc6[_0x88a5('0x5d')]&&_0x28eac8[_0x4b8fc6[_0x88a5('0x62')][_0x88a5('0x63')]['toLowerCase']()]){_0x4be310[_0x4b8fc6[_0x88a5('0x5d')]]=_0x28eac8[_0x4b8fc6[_0x88a5('0x62')][_0x88a5('0x63')][_0x88a5('0x64')]()][_0x88a5('0x60')]();}});}return _0x4be310;}function getName(_0x1e000a){if(_0x1e000a['indexOf']('\x20')>0x0){var _0x27f1a1=_0x1e000a['split'](/ (.+)/);if(_0x27f1a1[0x1]){return _0x27f1a1;}}return[_0x1e000a,_0x1e000a];}exports[_0x88a5('0x65')]=function(_0x1dda83,_0x53ad26,_0x5e404f,_0x38ff6a,_0x3af808,_0x47564f){var _0x53e9a7,_0x50843f;_0x47564f[_0x88a5('0x2e')]=intUtil['stripTrailingSlash'](_0x47564f[_0x88a5('0x2e')]);_0x47564f[_0x88a5('0x66')]=intUtil[_0x88a5('0x67')](_0x47564f[_0x88a5('0x66')]);if(_0x3af808&&_0x3af808['monitor_format']){logger[_0x88a5('0xd')](_0x88a5('0x68'),_0x88a5('0x69'));_0x53ad26[_0x88a5('0x6a')]=util[_0x88a5('0x12')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x47564f[_0x88a5('0x66')],_0x53ad26['uniqueid'],md5(_0x53ad26[_0x88a5('0x6b')]));}else{_0x53ad26[_0x88a5('0x6a')]='';}return getUser(_0x47564f,_0x38ff6a[_0x88a5('0x6c')])[_0x88a5('0x30')](function(_0x44b750){_0x53e9a7=_0x44b750;logger['info'](_0x88a5('0x6d'),_0x53e9a7['id']);return getEndUser(_0x47564f,_0x53ad26[_0x88a5('0x6e')],_0x53ad26[_0x88a5('0x6f')]);})[_0x88a5('0x30')](function(_0x219503){_0x50843f=_0x219503;logger['info'](_0x88a5('0x70'),_0x50843f[_0x88a5('0x25')]||_0x50843f[_0x88a5('0x26')]);return getCall(_0x47564f,_0x53e9a7,_0x50843f,_0x5e404f,_0x53ad26,_0x88a5('0x71'));})['then'](function(_0x114b91){if(_0x114b91){logger[_0x88a5('0xd')]('The\x20Call\x20ID\x20is:',_0x114b91['id']);logger[_0x88a5('0xd')](_0x88a5('0x68'),_0x88a5('0x72'));emit(util['format'](_0x88a5('0x73'),_0x38ff6a[_0x88a5('0x63')]),_0x88a5('0x74'),{'uri':util[_0x88a5('0x12')]('https://crm.%s/crm/EntityInfo.do?module=Calls&id=%s',_0x47564f[_0x88a5('0x2e')],_0x114b91['id'])});}})['catch'](function(_0x547e1d){logger[_0x88a5('0x4a')](_0x88a5('0x68'),JSON[_0x88a5('0x36')](_0x547e1d));});};exports['outbound']=function(_0xcd5153,_0x2efc34,_0x331097,_0x1beef4,_0x3173b6,_0x3651aa,_0x105d9b){var _0xa20aa9,_0xd036c8;_0x3651aa[_0x88a5('0x2e')]=intUtil[_0x88a5('0x67')](_0x3651aa['host']);_0x3651aa[_0x88a5('0x66')]=intUtil[_0x88a5('0x67')](_0x3651aa[_0x88a5('0x66')]);if(_0x105d9b&&_0x105d9b['recordingFormat']&&_0x105d9b[_0x88a5('0x75')]!==_0x88a5('0x76')){logger[_0x88a5('0xd')](_0x88a5('0x77'),_0x88a5('0x69'));_0x2efc34[_0x88a5('0x6a')]=util[_0x88a5('0x12')](_0x88a5('0x78'),_0x3651aa[_0x88a5('0x66')],_0x2efc34[_0x88a5('0x6b')],md5(_0x2efc34['uniqueid']));}return getUser(_0x3651aa,_0x1beef4[_0x88a5('0x6c')])['then'](function(_0x5dfa19){_0xa20aa9=_0x5dfa19;logger[_0x88a5('0xd')](_0x88a5('0x6d'),_0xa20aa9['id']);return getEndUser(_0x3651aa,_0x2efc34[_0x88a5('0x79')],_0x2efc34[_0x88a5('0x7a')]);})[_0x88a5('0x30')](function(_0x8eb5c2){_0xd036c8=_0x8eb5c2;logger[_0x88a5('0xd')](_0x88a5('0x70'),_0xd036c8[_0x88a5('0x25')]||_0xd036c8[_0x88a5('0x26')]);return getCall(_0x3651aa,_0xa20aa9,_0xd036c8,_0x331097,_0x2efc34,_0x88a5('0x7b'));})['then'](function(_0x17fac0){if(_0x17fac0){logger[_0x88a5('0xd')](_0x88a5('0x7c'),_0x17fac0['id']);logger['info'](_0x88a5('0x77'),_0x88a5('0x72'));emit(util[_0x88a5('0x12')](_0x88a5('0x73'),_0x1beef4[_0x88a5('0x63')]),'trigger:browser:url',{'uri':util[_0x88a5('0x12')](_0x88a5('0x7d'),_0x3651aa[_0x88a5('0x2e')],_0x17fac0['id'])});}})[_0x88a5('0x7e')](function(_0x6c780){logger['error']('[OUTBOUND]',JSON[_0x88a5('0x36')](_0x6c780));});};exports['abandoned']=function(_0x3f7c96,_0x463cdc,_0x4ef64e,_0x4d9c39,_0x520da7,_0x5e2936){var _0x39df2f,_0x408750;_0x5e2936[_0x88a5('0x2e')]=intUtil[_0x88a5('0x67')](_0x5e2936[_0x88a5('0x2e')]);_0x5e2936[_0x88a5('0x66')]=intUtil[_0x88a5('0x67')](_0x5e2936[_0x88a5('0x66')]);if(_0x520da7&&_0x520da7[_0x88a5('0x7f')]){logger[_0x88a5('0xd')](_0x88a5('0x80'),'Recording\x20is\x20enabled!');_0x463cdc[_0x88a5('0x6a')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5e2936[_0x88a5('0x66')],_0x463cdc[_0x88a5('0x6b')],md5(_0x463cdc[_0x88a5('0x6b')]));}else{_0x463cdc[_0x88a5('0x6a')]='';}return getUser(_0x5e2936)[_0x88a5('0x30')](function(_0x275ade){_0x39df2f=_0x275ade;logger[_0x88a5('0xd')](_0x88a5('0x6d'),_0x39df2f['id']);return getEndUser(_0x5e2936,_0x463cdc[_0x88a5('0x6e')],_0x463cdc['calleridnum']);})[_0x88a5('0x30')](function(_0x3bc0cb){_0x408750=_0x3bc0cb;logger['info'](_0x88a5('0x70'),_0x408750[_0x88a5('0x25')]||_0x408750[_0x88a5('0x26')]);return getCall(_0x5e2936,_0x39df2f,_0x408750,_0x4ef64e,_0x463cdc,'Inbound');})[_0x88a5('0x30')](function(_0x224505){if(_0x224505){logger[_0x88a5('0xd')]('The\x20Call\x20ID\x20is:',_0x224505['id']);}})[_0x88a5('0x7e')](function(_0x5766d1){logger[_0x88a5('0x4a')](_0x88a5('0x80'),JSON[_0x88a5('0x36')](_0x5766d1));});}; \ No newline at end of file +var _0xd194=['format','getString','Subjects','Descriptions','Fields','lastevent','complete','connect','Call\x20Result','Answered','abandoned','Abandoned','utc','endtime','Call\x20Duration','YYYY-MM-DD\x20HH:mm:ss','diff','mm:ss','CONTACTID','LEADID','Leads','SEID','hasOwnProperty','%s','encodeXML','','POST','https://crm.%s/crm/private/xml/Calls/insertRecords','authToken','crmapi','then','parse','toJson','response','result','recorddetail','Call\x20created!','Error\x20on\x20call\x20creation:\x20','stringify','GET','host','AllUsers','users','user','zoho\x20data\x20users','isArrayLikeObject','log','isNil','find','active','Using\x20the\x20admin\x20account!','Administrator','zoho\x20user','profile','error','The\x20failing\x20result\x20is','https://crm.%s/crm/private/json/Contacts/searchRecords','((Phone:%s))','Contacts','row','length','val','content','https://crm.%s/crm/private/xml/Leads/insertRecords','Enduser\x20created.','https://crm.%s/crm/private/json/Leads/getRecordById','Error\x20on\x20Lead\x20retrieve:\x20','[HTTP]','forEach','string','idField','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase','split','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','recordingFormat','[OUTBOUND]','user:%s','catch','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','[ABANDONED]','request-promise','./util','xml2json','entities','moment','ioredis','../../../../config/environment','zoho','defaults','redis','localhost','socket.io-emitter','application/json','info','merge','inbound','outbound','agentcalledAt'];(function(_0x2f2df6,_0x2cd3fd){var _0x45ba06=function(_0x3c0f2d){while(--_0x3c0f2d){_0x2f2df6['push'](_0x2f2df6['shift']());}};_0x45ba06(++_0x2cd3fd);}(_0xd194,0x159));var _0x4d19=function(_0x40b3d3,_0x579418){_0x40b3d3=_0x40b3d3-0x0;var _0x2587a2=_0xd194[_0x40b3d3];return _0x2587a2;};'use strict';var _=require('lodash');var rp=require(_0x4d19('0x0'));var md5=require('md5');var util=require('util');var intUtil=require(_0x4d19('0x1'));var parser=require(_0x4d19('0x2'));var entities=require(_0x4d19('0x3'));var moment=require(_0x4d19('0x4'));var Redis=require(_0x4d19('0x5'));var config=require(_0x4d19('0x6'));var logger=require('../../../../config/logger')(_0x4d19('0x7'));config['redis']=_[_0x4d19('0x8')](config[_0x4d19('0x9')],{'host':_0x4d19('0xa'),'port':0x18eb});var io=require(_0x4d19('0xb'))(new Redis(config[_0x4d19('0x9')]));function emit(_0x561493,_0x1114ee,_0x545cda){io['to'](_0x561493)['emit'](_0x1114ee,_0x545cda);}var headers={'Content-Type':'application/json','Accept':_0x4d19('0xc')};function getCall(_0x12a198,_0x135607,_0x7dd714,_0x28140b,_0x35ec2f,_0x32a4b7){logger[_0x4d19('0xd')]('Creating\x20new\x20call...');var _0x19d823=_[_0x4d19('0xe')]({'SMOWNERID':_0x135607['id'],'Call Type':_0x32a4b7||_0x4d19('0xf'),'Call Start Time':(_0x32a4b7===_0x4d19('0x10')?_0x35ec2f['starttime']:_0x35ec2f[_0x4d19('0x11')])||moment()[_0x4d19('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'Subject':intUtil[_0x4d19('0x13')](_0x28140b[_0x4d19('0x14')],_0x35ec2f,'\x20'),'Description':intUtil[_0x4d19('0x13')](_0x28140b[_0x4d19('0x15')],_0x35ec2f,'\x0a')},getCustomFields(_0x28140b[_0x4d19('0x16')],_0x35ec2f));switch(_0x35ec2f[_0x4d19('0x17')]){case'called':_0x19d823['Call\x20Result']='Called';break;case _0x4d19('0x18'):case _0x4d19('0x19'):_0x19d823[_0x4d19('0x1a')]=_0x4d19('0x1b');break;case'rejected':_0x19d823[_0x4d19('0x1a')]='Rejected';break;case _0x4d19('0x1c'):_0x19d823['Call\x20Result']=_0x4d19('0x1d');break;default:}if(_0x35ec2f['talktime']){_0x19d823['Call\x20Duration']=moment[_0x4d19('0x1e')](parseInt(_0x35ec2f['talktime'])*0x3e8)['format']('mm:ss');}else if(_0x35ec2f['answertime']&&_0x35ec2f[_0x4d19('0x1f')]){_0x19d823[_0x4d19('0x20')]=moment[_0x4d19('0x1e')](moment(_0x35ec2f[_0x4d19('0x1f')],_0x4d19('0x21'))[_0x4d19('0x22')](moment(_0x35ec2f['starttime'],_0x4d19('0x21'))))[_0x4d19('0x12')](_0x4d19('0x23'));}if(_0x7dd714[_0x4d19('0x24')]){_0x19d823[_0x4d19('0x24')]=_0x7dd714['CONTACTID'];}else if(_0x7dd714[_0x4d19('0x25')]){_0x19d823['SEMODULE']=_0x4d19('0x26');_0x19d823[_0x4d19('0x27')]=_0x7dd714[_0x4d19('0x25')];}var _0x39503e='';for(var _0x148bd7 in _0x19d823){if(_0x19d823[_0x4d19('0x28')](_0x148bd7)){_0x39503e+=util[_0x4d19('0x12')](_0x4d19('0x29'),entities[_0x4d19('0x2a')](_0x148bd7),entities['encodeXML'](_0x19d823[_0x148bd7]));}}_0x39503e+=_0x4d19('0x2b');return request({'method':_0x4d19('0x2c'),'uri':util[_0x4d19('0x12')](_0x4d19('0x2d'),_0x12a198['host']),'qs':{'authtoken':_0x12a198[_0x4d19('0x2e')],'scope':_0x4d19('0x2f'),'xmlData':_0x39503e},'json':!![]})[_0x4d19('0x30')](function(_0x2d1765){_0x2d1765=JSON[_0x4d19('0x31')](parser[_0x4d19('0x32')](_0x2d1765));if(_0x2d1765[_0x4d19('0x33')]){if(_0x2d1765[_0x4d19('0x33')][_0x4d19('0x34')]&&_0x2d1765['response'][_0x4d19('0x34')][_0x4d19('0x35')]){logger[_0x4d19('0xd')](_0x4d19('0x36'));return{'id':_0x2d1765[_0x4d19('0x33')][_0x4d19('0x34')][_0x4d19('0x35')]['FL'][0x0]['$t']};}}throw new Error(_0x4d19('0x37')+JSON[_0x4d19('0x38')](_0x2d1765));});}function getUser(_0x345009,_0x5a67c3){return request({'method':_0x4d19('0x39'),'uri':util['format']('https://crm.%s/crm/private/json/Users/getUsers',_0x345009[_0x4d19('0x3a')]),'qs':{'type':_0x4d19('0x3b'),'authtoken':_0x345009[_0x4d19('0x2e')],'scope':_0x4d19('0x2f')},'json':!![]})[_0x4d19('0x30')](function(_0x250c33){if(_0x250c33['users']&&_0x250c33[_0x4d19('0x3c')][_0x4d19('0x3d')]){var _0x4b60ec;console['log'](_0x4d19('0x3e'),_0x250c33[_0x4d19('0x3c')][_0x4d19('0x3d')]);if(_[_0x4d19('0x3f')](_0x250c33[_0x4d19('0x3c')]['user'])){console[_0x4d19('0x40')]('zoho\x20data\x20users',_0x250c33['users']['user']);if(!_[_0x4d19('0x41')](_0x5a67c3)){_0x4b60ec=_[_0x4d19('0x42')](_0x250c33[_0x4d19('0x3c')]['user'],{'email':_0x5a67c3,'profile':'Standard','status':_0x4d19('0x43')});}if(!_[_0x4d19('0x41')](_0x4b60ec)){logger[_0x4d19('0xd')]('Agent\x20found!');}else{logger[_0x4d19('0xd')](_0x4d19('0x44'));_0x4b60ec=_['find'](_0x250c33[_0x4d19('0x3c')]['user'],{'profile':_0x4d19('0x45')});}console['log'](_0x4d19('0x46'),_0x4b60ec);return _0x4b60ec;}else{if(_0x250c33['users'][_0x4d19('0x3d')][_0x4d19('0x47')]==='Administrator'){logger[_0x4d19('0xd')](_0x4d19('0x44'));_0x4b60ec=_0x250c33[_0x4d19('0x3c')][_0x4d19('0x3d')];return _0x4b60ec;}else{logger[_0x4d19('0x48')](_0x4d19('0x49'),JSON[_0x4d19('0x38')](_0x250c33));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x4d19('0x38')](_0x250c33));}}}else{logger[_0x4d19('0x48')](_0x4d19('0x49'),JSON[_0x4d19('0x38')](_0x250c33));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x4d19('0x38')](_0x250c33));}});}function getEndUser(_0x105d75,_0x23042a,_0x32519f){logger['info']('Searching\x20enduser\x20with\x20phone',_0x32519f);return request({'method':_0x4d19('0x39'),'uri':util[_0x4d19('0x12')](_0x4d19('0x4a'),_0x105d75[_0x4d19('0x3a')]),'qs':{'authtoken':_0x105d75['authToken'],'scope':'crmapi','criteria':util[_0x4d19('0x12')](_0x4d19('0x4b'),_0x32519f)},'json':!![]})[_0x4d19('0x30')](function(_0x1e01eb){if(_0x1e01eb[_0x4d19('0x33')]&&_0x1e01eb[_0x4d19('0x33')][_0x4d19('0x34')]){logger[_0x4d19('0xd')]('Enduser\x20found\x20in\x20Contacts!');var _0x7ace3a={};var _0x50a65b=_0x1e01eb[_0x4d19('0x33')][_0x4d19('0x34')][_0x4d19('0x4c')]['row']['no']?_0x1e01eb['response'][_0x4d19('0x34')]['Contacts'][_0x4d19('0x4d')]['FL']:_0x1e01eb[_0x4d19('0x33')][_0x4d19('0x34')][_0x4d19('0x4c')][_0x4d19('0x4d')][0x0]['FL'];for(var _0x5431ad=0x0,_0x4d44cd=_0x50a65b[_0x4d19('0x4e')];_0x5431ad<_0x4d44cd;_0x5431ad++){_0x7ace3a[_0x50a65b[_0x5431ad][_0x4d19('0x4f')]]=_0x50a65b[_0x5431ad]['content'];}return _0x7ace3a;}else{return request({'method':_0x4d19('0x39'),'uri':util[_0x4d19('0x12')]('https://crm.%s/crm/private/json/Leads/searchRecords',_0x105d75['host']),'qs':{'authtoken':_0x105d75[_0x4d19('0x2e')],'scope':'crmapi','criteria':util[_0x4d19('0x12')]('((Phone:%s))',_0x32519f)},'json':!![]})['then'](function(_0x11fe86){if(_0x11fe86[_0x4d19('0x33')]&&_0x11fe86['response'][_0x4d19('0x34')]){logger[_0x4d19('0xd')]('Enduser\x20found\x20in\x20Leads!');var _0xe45218={};var _0x1cf470=_0x11fe86[_0x4d19('0x33')]['result'][_0x4d19('0x26')][_0x4d19('0x4d')]['no']?_0x11fe86['response']['result'][_0x4d19('0x26')]['row']['FL']:_0x11fe86[_0x4d19('0x33')][_0x4d19('0x34')]['Leads'][_0x4d19('0x4d')][0x0]['FL'];for(var _0x29b3ba=0x0,_0x126b79=_0x1cf470[_0x4d19('0x4e')];_0x29b3ba<_0x126b79;_0x29b3ba++){_0xe45218[_0x1cf470[_0x29b3ba][_0x4d19('0x4f')]]=_0x1cf470[_0x29b3ba][_0x4d19('0x50')];}return _0xe45218;}else{logger[_0x4d19('0xd')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');_0x23042a=getName(_0x23042a);return request({'method':_0x4d19('0x2c'),'uri':util[_0x4d19('0x12')](_0x4d19('0x51'),_0x105d75[_0x4d19('0x3a')]),'qs':{'authtoken':_0x105d75['authToken'],'scope':'crmapi','xmlData':util[_0x4d19('0x12')]('%s%s%s',entities[_0x4d19('0x2a')](_0x23042a[0x0]),entities['encodeXML'](_0x23042a[0x1]),_0x32519f)},'json':!![]})['then'](function(_0x428620){_0x428620=JSON[_0x4d19('0x31')](parser[_0x4d19('0x32')](_0x428620));if(_0x428620['response']){if(_0x428620[_0x4d19('0x33')][_0x4d19('0x34')]&&_0x428620['response']['result'][_0x4d19('0x35')]){logger[_0x4d19('0xd')](_0x4d19('0x52'));return request({'method':_0x4d19('0x39'),'uri':util[_0x4d19('0x12')](_0x4d19('0x53'),_0x105d75[_0x4d19('0x3a')]),'qs':{'authtoken':_0x105d75[_0x4d19('0x2e')],'scope':_0x4d19('0x2f'),'id':_0x428620[_0x4d19('0x33')][_0x4d19('0x34')][_0x4d19('0x35')]['FL'][0x0]['$t']},'json':!![]});}}throw new Error('Error\x20on\x20Lead\x20creation:\x20'+JSON[_0x4d19('0x38')](_0x428620));})['then'](function(_0x494e3e){if(_0x494e3e['response']){if(_0x494e3e[_0x4d19('0x33')][_0x4d19('0x34')]){var _0x3b5ae9={};for(var _0x1b7500=0x0,_0x79267c=_0x494e3e[_0x4d19('0x33')]['result'][_0x4d19('0x26')][_0x4d19('0x4d')]['FL']['length'];_0x1b7500<_0x79267c;_0x1b7500++){_0x3b5ae9[_0x494e3e[_0x4d19('0x33')][_0x4d19('0x34')]['Leads'][_0x4d19('0x4d')]['FL'][_0x1b7500][_0x4d19('0x4f')]]=_0x494e3e['response'][_0x4d19('0x34')][_0x4d19('0x26')][_0x4d19('0x4d')]['FL'][_0x1b7500][_0x4d19('0x50')];}return _0x3b5ae9;}}throw new Error(_0x4d19('0x54')+JSON['stringify'](_0x494e3e));});}});}});}function request(_0x2ef713){logger['debug'](_0x4d19('0x55'),JSON[_0x4d19('0x38')](_0x2ef713));return rp(_0x2ef713);}function getCustomFields(_0x252fc6,_0x5bcd60){var _0x5bc6f3={};if(_0x252fc6['length']>0x0){_[_0x4d19('0x56')](_0x252fc6,function(_0x2a3736){if(_0x2a3736['type']===_0x4d19('0x57')&&_0x2a3736[_0x4d19('0x58')]){_0x5bc6f3[_0x2a3736[_0x4d19('0x58')]]=_0x2a3736['content'][_0x4d19('0x59')]();}else if(_0x2a3736[_0x4d19('0x5a')]===_0x4d19('0x5b')&&_0x2a3736[_0x4d19('0x5c')]&&_0x2a3736[_0x4d19('0x58')]&&_0x5bcd60[_0x2a3736['variableName']]){_0x5bc6f3[_0x2a3736['idField']]=_0x5bcd60[_0x2a3736['variableName']][_0x4d19('0x59')]();}else if(_0x2a3736[_0x4d19('0x5a')]===_0x4d19('0x5d')&&_0x2a3736[_0x4d19('0x5e')]&&_0x2a3736[_0x4d19('0x5e')][_0x4d19('0x5f')]&&_0x2a3736['idField']&&_0x5bcd60[_0x2a3736['Variable'][_0x4d19('0x5f')][_0x4d19('0x60')]()]){_0x5bc6f3[_0x2a3736[_0x4d19('0x58')]]=_0x5bcd60[_0x2a3736[_0x4d19('0x5e')][_0x4d19('0x5f')][_0x4d19('0x60')]()]['toString']();}});}return _0x5bc6f3;}function getName(_0x200a15){if(_0x200a15['indexOf']('\x20')>0x0){var _0x176c5f=_0x200a15[_0x4d19('0x61')](/ (.+)/);if(_0x176c5f[0x1]){return _0x176c5f;}}return[_0x200a15,_0x200a15];}exports[_0x4d19('0x62')]=function(_0x25fc05,_0x1f05a3,_0x1b2d8a,_0x53d64b,_0x714e0d,_0x4f0ec4){var _0x546757,_0x3dabcb;_0x4f0ec4['host']=intUtil[_0x4d19('0x63')](_0x4f0ec4['host']);_0x4f0ec4[_0x4d19('0x64')]=intUtil[_0x4d19('0x63')](_0x4f0ec4[_0x4d19('0x64')]);if(_0x714e0d&&_0x714e0d[_0x4d19('0x65')]){logger[_0x4d19('0xd')](_0x4d19('0x66'),_0x4d19('0x67'));_0x1f05a3['recordingURL']=util[_0x4d19('0x12')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4f0ec4[_0x4d19('0x64')],_0x1f05a3[_0x4d19('0x68')],md5(_0x1f05a3['uniqueid']));}else{_0x1f05a3[_0x4d19('0x69')]='';}return getUser(_0x4f0ec4,_0x53d64b[_0x4d19('0x6a')])['then'](function(_0xd87c73){_0x546757=_0xd87c73;logger[_0x4d19('0xd')](_0x4d19('0x6b'),_0x546757['id']);return getEndUser(_0x4f0ec4,_0x1f05a3[_0x4d19('0x6c')],_0x1f05a3[_0x4d19('0x6d')]);})[_0x4d19('0x30')](function(_0x2b2b9b){_0x3dabcb=_0x2b2b9b;logger[_0x4d19('0xd')](_0x4d19('0x6e'),_0x3dabcb['CONTACTID']||_0x3dabcb[_0x4d19('0x25')]);return getCall(_0x4f0ec4,_0x546757,_0x3dabcb,_0x1b2d8a,_0x1f05a3,_0x4d19('0x6f'));})[_0x4d19('0x30')](function(_0x44059f){if(_0x44059f){logger[_0x4d19('0xd')](_0x4d19('0x70'),_0x44059f['id']);logger[_0x4d19('0xd')]('[QUEUE]',_0x4d19('0x71'));emit(util['format']('user:%s',_0x53d64b[_0x4d19('0x5f')]),_0x4d19('0x72'),{'uri':util[_0x4d19('0x12')]('https://crm.%s/crm/EntityInfo.do?module=Calls&id=%s',_0x4f0ec4[_0x4d19('0x3a')],_0x44059f['id'])});}})['catch'](function(_0x311192){logger[_0x4d19('0x48')](_0x4d19('0x66'),JSON[_0x4d19('0x38')](_0x311192));});};exports[_0x4d19('0x10')]=function(_0x7b4863,_0x34141b,_0x3513bc,_0x2967d6,_0x3590da,_0x34b493,_0x39edbd){var _0x3f7181,_0x32401a;_0x34b493[_0x4d19('0x3a')]=intUtil[_0x4d19('0x63')](_0x34b493['host']);_0x34b493['serverUrl']=intUtil[_0x4d19('0x63')](_0x34b493[_0x4d19('0x64')]);if(_0x39edbd&&_0x39edbd[_0x4d19('0x73')]&&_0x39edbd[_0x4d19('0x73')]!=='none'){logger['info'](_0x4d19('0x74'),_0x4d19('0x67'));_0x34141b['recordingURL']=util[_0x4d19('0x12')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x34b493[_0x4d19('0x64')],_0x34141b[_0x4d19('0x68')],md5(_0x34141b[_0x4d19('0x68')]));}return getUser(_0x34b493,_0x2967d6[_0x4d19('0x6a')])[_0x4d19('0x30')](function(_0x5874cf){_0x3f7181=_0x5874cf;logger[_0x4d19('0xd')]('The\x20User\x20ID\x20is:',_0x3f7181['id']);return getEndUser(_0x34b493,_0x34141b['destcalleridname'],_0x34141b['destcalleridnum']);})[_0x4d19('0x30')](function(_0x205ad6){_0x32401a=_0x205ad6;logger['info'](_0x4d19('0x6e'),_0x32401a['CONTACTID']||_0x32401a['LEADID']);return getCall(_0x34b493,_0x3f7181,_0x32401a,_0x3513bc,_0x34141b,'Outbound');})[_0x4d19('0x30')](function(_0x12dc46){if(_0x12dc46){logger[_0x4d19('0xd')]('The\x20Call\x20ID\x20is:',_0x12dc46['id']);logger[_0x4d19('0xd')](_0x4d19('0x74'),_0x4d19('0x71'));emit(util['format'](_0x4d19('0x75'),_0x2967d6['name']),_0x4d19('0x72'),{'uri':util[_0x4d19('0x12')]('https://crm.%s/crm/EntityInfo.do?module=Calls&id=%s',_0x34b493[_0x4d19('0x3a')],_0x12dc46['id'])});}})[_0x4d19('0x76')](function(_0x41be8b){logger[_0x4d19('0x48')](_0x4d19('0x74'),JSON['stringify'](_0x41be8b));});};exports[_0x4d19('0x1c')]=function(_0x29fea5,_0x2dd481,_0x53417e,_0x4f67e4,_0x273e6c,_0x4d46b1){var _0x5132bd,_0xc67488;_0x4d46b1[_0x4d19('0x3a')]=intUtil[_0x4d19('0x63')](_0x4d46b1[_0x4d19('0x3a')]);_0x4d46b1['serverUrl']=intUtil[_0x4d19('0x63')](_0x4d46b1[_0x4d19('0x64')]);if(_0x273e6c&&_0x273e6c[_0x4d19('0x65')]){logger[_0x4d19('0xd')]('[ABANDONED]','Recording\x20is\x20enabled!');_0x2dd481[_0x4d19('0x69')]=util[_0x4d19('0x12')](_0x4d19('0x77'),_0x4d46b1[_0x4d19('0x64')],_0x2dd481[_0x4d19('0x68')],md5(_0x2dd481['uniqueid']));}else{_0x2dd481[_0x4d19('0x69')]='';}return getUser(_0x4d46b1)[_0x4d19('0x30')](function(_0x31e125){_0x5132bd=_0x31e125;logger[_0x4d19('0xd')]('The\x20User\x20ID\x20is:',_0x5132bd['id']);return getEndUser(_0x4d46b1,_0x2dd481[_0x4d19('0x6c')],_0x2dd481['calleridnum']);})[_0x4d19('0x30')](function(_0x1e4005){_0xc67488=_0x1e4005;logger[_0x4d19('0xd')](_0x4d19('0x6e'),_0xc67488[_0x4d19('0x24')]||_0xc67488[_0x4d19('0x25')]);return getCall(_0x4d46b1,_0x5132bd,_0xc67488,_0x53417e,_0x2dd481,'Inbound');})[_0x4d19('0x30')](function(_0x1ae4d2){if(_0x1ae4d2){logger[_0x4d19('0xd')]('The\x20Call\x20ID\x20is:',_0x1ae4d2['id']);}})[_0x4d19('0x76')](function(_0x2826b6){logger['error'](_0x4d19('0x78'),JSON['stringify'](_0x2826b6));});}; \ 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 42880fb..6a2504a 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(_0x223345,_0x54f791){var _0x1bea3b=function(_0x354a5d){while(--_0x354a5d){_0x223345['push'](_0x223345['shift']());}};_0x1bea3b(++_0x54f791);}(_0x7a54,0x106));var _0x47a5=function(_0xe15047,_0x44207a){_0xe15047=_0xe15047-0x0;var _0x8fdeca=_0x7a54[_0xe15047];return _0x8fdeca;};'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(_0x1272a5,_0x406f2a){var _0x387d71=function(_0x2d6492){while(--_0x2d6492){_0x1272a5['push'](_0x1272a5['shift']());}};_0x387d71(++_0x406f2a);}(_0x7a54,0x106));var _0x47a5=function(_0x1a4c95,_0x2323b0){_0x1a4c95=_0x1a4c95-0x0;var _0x4a5b2c=_0x7a54[_0x1a4c95];return _0x4a5b2c;};'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 b0dfb41..02704ee 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 _0x5ec6=['object','statusCode','catch','error','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','lodash','../../../../config/logger','exec','data1','toUpperCase','data2','headers','parse','render','data6','stack','GET','PUT','data7','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then',',\x20request\x20body:\x20'];(function(_0x563299,_0x3a95a6){var _0x377ff8=function(_0x153410){while(--_0x153410){_0x563299['push'](_0x563299['shift']());}};_0x377ff8(++_0x3a95a6);}(_0x5ec6,0x7f));var _0x65ec=function(_0x2292a6,_0x419234){_0x2292a6=_0x2292a6-0x0;var _0x42f59c=_0x5ec6[_0x2292a6];return _0x42f59c;};'use strict';var rp=require(_0x65ec('0x0'));var util=require(_0x65ec('0x1'));var _=require(_0x65ec('0x2'));var Mustache=require('mustache');var logger=require(_0x65ec('0x3'))('trigger');exports[_0x65ec('0x4')]=function(_0x4c659e,_0x33751d){var _0x4c1772,_0xf2c7b7;var _0x54b638={'method':_0x4c659e[_0x65ec('0x5')][_0x65ec('0x6')](),'uri':encodeURI(Mustache['render'](_0x4c659e[_0x65ec('0x7')],_0x33751d)),'json':!![],'resolveWithFullResponse':!![]};try{_0x54b638[_0x65ec('0x8')]=_0x4c659e['data6']?JSON[_0x65ec('0x9')](Mustache[_0x65ec('0xa')](_0x4c659e[_0x65ec('0xb')],_0x33751d)):{};}catch(_0x50e5c4){logger['error'](_0x50e5c4[_0x65ec('0xc')]);}switch(_0x4c659e['data1'][_0x65ec('0x6')]()){case _0x65ec('0xd'):_0x54b638['qs']=_0x33751d;break;case'POST':case _0x65ec('0xe'):_0x4c1772={};if(_0x4c659e[_0x65ec('0xf')]){_0x4c1772=Mustache['render'](_0x4c659e[_0x65ec('0xf')],_0x33751d);}else{_0x4c1772=_0x33751d;}_0x54b638[_0x65ec('0x10')]=JSON['parse'](_0x4c1772);break;}logger[_0x65ec('0x11')](util[_0x65ec('0x12')](_0x65ec('0x13'),_0x4c659e[_0x65ec('0x5')],_0x4c659e[_0x65ec('0x7')],JSON[_0x65ec('0x14')](_0x54b638)));rp(_0x54b638)[_0x65ec('0x15')](function(_0x3edbfd){_0x4c1772=!_['isNil'](_0x4c1772)?_0x65ec('0x16')+_0x4c1772:'';_0xf2c7b7=typeof _0x3edbfd[_0x65ec('0x10')]===_0x65ec('0x17')?JSON['stringify'](_0x3edbfd['body']):_0x3edbfd[_0x65ec('0x10')];logger[_0x65ec('0x11')](util[_0x65ec('0x12')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x4c659e[_0x65ec('0x5')],_0x4c659e[_0x65ec('0x7')],_0x3edbfd[_0x65ec('0x18')],_0xf2c7b7));})[_0x65ec('0x19')](function(_0x29ebc4){logger[_0x65ec('0x1a')](util[_0x65ec('0x12')](_0x65ec('0x1b'),_0x4c659e[_0x65ec('0x5')],_0x4c659e[_0x65ec('0x7')],_0x29ebc4[_0x65ec('0x18')],_0x29ebc4[_0x65ec('0x1c')],_0x29ebc4[_0x65ec('0x1d')]));});}; \ No newline at end of file +var _0x3e22=['error','GET','POST','PUT','data7','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','message','util','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','headers','parse','data6'];(function(_0x4c7d50,_0x580218){var _0x3fb9c2=function(_0x3115d3){while(--_0x3115d3){_0x4c7d50['push'](_0x4c7d50['shift']());}};_0x3fb9c2(++_0x580218);}(_0x3e22,0xa8));var _0x23e2=function(_0x2cced7,_0x5694df){_0x2cced7=_0x2cced7-0x0;var _0x4543ce=_0x3e22[_0x2cced7];return _0x4543ce;};'use strict';var rp=require('request-promise');var util=require(_0x23e2('0x0'));var _=require('lodash');var Mustache=require(_0x23e2('0x1'));var logger=require(_0x23e2('0x2'))(_0x23e2('0x3'));exports[_0x23e2('0x4')]=function(_0x5b078c,_0x4fcb3e){var _0x2058ab,_0x3188c2;var _0x4add5a={'method':_0x5b078c[_0x23e2('0x5')][_0x23e2('0x6')](),'uri':encodeURI(Mustache[_0x23e2('0x7')](_0x5b078c[_0x23e2('0x8')],_0x4fcb3e)),'json':!![],'resolveWithFullResponse':!![]};try{_0x4add5a[_0x23e2('0x9')]=_0x5b078c['data6']?JSON[_0x23e2('0xa')](Mustache[_0x23e2('0x7')](_0x5b078c[_0x23e2('0xb')],_0x4fcb3e)):{};}catch(_0x75da0a){logger[_0x23e2('0xc')](_0x75da0a['stack']);}switch(_0x5b078c[_0x23e2('0x5')][_0x23e2('0x6')]()){case _0x23e2('0xd'):_0x4add5a['qs']=_0x4fcb3e;break;case _0x23e2('0xe'):case _0x23e2('0xf'):_0x2058ab={};if(_0x5b078c['data7']){_0x2058ab=Mustache['render'](_0x5b078c[_0x23e2('0x10')],_0x4fcb3e);}else{_0x2058ab=_0x4fcb3e;}_0x4add5a[_0x23e2('0x11')]=JSON[_0x23e2('0xa')](_0x2058ab);break;}logger[_0x23e2('0x12')](util[_0x23e2('0x13')](_0x23e2('0x14'),_0x5b078c[_0x23e2('0x5')],_0x5b078c[_0x23e2('0x8')],JSON[_0x23e2('0x15')](_0x4add5a)));rp(_0x4add5a)[_0x23e2('0x16')](function(_0x21aa80){_0x2058ab=!_[_0x23e2('0x17')](_0x2058ab)?_0x23e2('0x18')+_0x2058ab:'';_0x3188c2=typeof _0x21aa80[_0x23e2('0x11')]==='object'?JSON[_0x23e2('0x15')](_0x21aa80[_0x23e2('0x11')]):_0x21aa80[_0x23e2('0x11')];logger[_0x23e2('0x12')](util[_0x23e2('0x13')](_0x23e2('0x19'),_0x5b078c[_0x23e2('0x5')],_0x5b078c[_0x23e2('0x8')],_0x21aa80[_0x23e2('0x1a')],_0x3188c2));})[_0x23e2('0x1b')](function(_0x251e52){logger[_0x23e2('0xc')](util['format'](_0x23e2('0x1c'),_0x5b078c[_0x23e2('0x5')],_0x5b078c['data2'],_0x251e52[_0x23e2('0x1a')],_0x251e52['name'],_0x251e52[_0x23e2('0x1d')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index c5d2960..7cf02f7 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 _0x5af0=['client','http','Request','request','then','rpc','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','routing'];(function(_0x3108ca,_0x17b37d){var _0x116038=function(_0x37d30d){while(--_0x37d30d){_0x3108ca['push'](_0x3108ca['shift']());}};_0x116038(++_0x17b37d);}(_0x5af0,0x1eb));var _0x05af=function(_0x2062dd,_0x1d983c){_0x2062dd=_0x2062dd-0x0;var _0x2f3be5=_0x5af0[_0x2062dd];return _0x2f3be5;};'use strict';var jayson=require(_0x05af('0x0'));var BPromise=require(_0x05af('0x1'));var logger=require(_0x05af('0x2'))(_0x05af('0x3'));var client=jayson[_0x05af('0x4')][_0x05af('0x5')]({'port':0x2329});client[_0x05af('0x6')]=function(_0x8c87f7,_0x518abd){return new BPromise(function(_0x3b00d9,_0x5751d0){return client[_0x05af('0x7')](_0x8c87f7,_0x518abd)[_0x05af('0x8')](function(_0x2a8ef6){logger['debug'](_0x05af('0x9'),'routing',_0x8c87f7,_0x518abd,_0x2a8ef6);if(_0x2a8ef6[_0x05af('0xa')]){logger[_0x05af('0xa')](_0x05af('0x9'),'routing',_0x8c87f7,_0x2a8ef6['error']['message'],_0x518abd);return _0x5751d0(_0x2a8ef6['error'][_0x05af('0xb')]);}else{return _0x3b00d9(_0x2a8ef6[_0x05af('0xc')]);}})[_0x05af('0xd')](function(_0x48680f){logger[_0x05af('0xa')]('rpc','routing',_0x8c87f7,_0x48680f,_0x518abd);return _0x5751d0(_0x48680f);});});};module[_0x05af('0xe')]=client; \ No newline at end of file +var _0x6732=['../../config/logger','routing','http','Request','then','debug','rpc','error','message','result','catch','jayson/promise','bluebird'];(function(_0x968a21,_0x11ca15){var _0x3d73b8=function(_0x45cb2c){while(--_0x45cb2c){_0x968a21['push'](_0x968a21['shift']());}};_0x3d73b8(++_0x11ca15);}(_0x6732,0x66));var _0x2673=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6732[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require(_0x2673('0x0'));var BPromise=require(_0x2673('0x1'));var logger=require(_0x2673('0x2'))(_0x2673('0x3'));var client=jayson['client'][_0x2673('0x4')]({'port':0x2329});client[_0x2673('0x5')]=function(_0x5467cd,_0xfef746){return new BPromise(function(_0x3ac2c4,_0x5c7f5c){return client['request'](_0x5467cd,_0xfef746)[_0x2673('0x6')](function(_0x2ec408){logger[_0x2673('0x7')](_0x2673('0x8'),_0x2673('0x3'),_0x5467cd,_0xfef746,_0x2ec408);if(_0x2ec408[_0x2673('0x9')]){logger[_0x2673('0x9')](_0x2673('0x8'),_0x2673('0x3'),_0x5467cd,_0x2ec408[_0x2673('0x9')][_0x2673('0xa')],_0xfef746);return _0x5c7f5c(_0x2ec408[_0x2673('0x9')][_0x2673('0xa')]);}else{return _0x3ac2c4(_0x2ec408[_0x2673('0xb')]);}})[_0x2673('0xc')](function(_0x4380b9){logger[_0x2673('0x9')](_0x2673('0x8'),_0x2673('0x3'),_0x5467cd,_0x4380b9,_0xfef746);return _0x5c7f5c(_0x4380b9);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index fb221df..8105540 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 _0x64af=['log','bluebird','./server','./lib/email','./rpc/mailAccount','resolve','then','initMailAccounts','refresh','catch'];(function(_0x53da19,_0x2eb319){var _0x41af4a=function(_0x4193fa){while(--_0x4193fa){_0x53da19['push'](_0x53da19['shift']());}};_0x41af4a(++_0x2eb319);}(_0x64af,0xb5));var _0xf64a=function(_0x4a96ef,_0x5c1383){_0x4a96ef=_0x4a96ef-0x0;var _0x330714=_0x64af[_0x4a96ef];return _0x330714;};'use strict';var BPromise=require(_0xf64a('0x0'));var server=require(_0xf64a('0x1'));var Realtime=require('./realtime');var EmailChannel=require(_0xf64a('0x2'));var mailAccount=require(_0xf64a('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0xf64a('0x4')]()[_0xf64a('0x5')](mailAccount['getMailAccounts']())['then'](realtime[_0xf64a('0x6')]())['then'](function(){email[_0xf64a('0x7')](realtime['mailAccounts']);return realtime;});}function main(){return server['listen'](realtime,email)['then'](function(_0x23fea7){return initRealtime();})[_0xf64a('0x5')](function(_0x2a53c2){return setInterval(initRealtime,0x2710);})[_0xf64a('0x8')](function(_0x57a6a8){console[_0xf64a('0x9')](_0x57a6a8);});}main(); \ No newline at end of file +var _0x2edf=['bluebird','./server','./lib/email','./rpc/mailAccount','resolve','then','initMailAccounts','refresh','mailAccounts','catch','log'];(function(_0x3b0321,_0x38a21a){var _0x23aba3=function(_0x222baf){while(--_0x222baf){_0x3b0321['push'](_0x3b0321['shift']());}};_0x23aba3(++_0x38a21a);}(_0x2edf,0x1ef));var _0xf2ed=function(_0x107f10,_0x5529f2){_0x107f10=_0x107f10-0x0;var _0x811cab=_0x2edf[_0x107f10];return _0x811cab;};'use strict';var BPromise=require(_0xf2ed('0x0'));var server=require(_0xf2ed('0x1'));var Realtime=require('./realtime');var EmailChannel=require(_0xf2ed('0x2'));var mailAccount=require(_0xf2ed('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0xf2ed('0x4')]()[_0xf2ed('0x5')](mailAccount['getMailAccounts']())[_0xf2ed('0x5')](realtime[_0xf2ed('0x6')]())[_0xf2ed('0x5')](function(){email[_0xf2ed('0x7')](realtime[_0xf2ed('0x8')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0xf2ed('0x5')](function(_0x48a805){return initRealtime();})[_0xf2ed('0x5')](function(_0x5a32d0){return setInterval(initRealtime,0x2710);})[_0xf2ed('0x9')](function(_0x33903f){console[_0xf2ed('0xa')](_0x33903f);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 11c5d14..4e20c04 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 _0x7880=['New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','error','messageStatus','send','verifySmtp','Smtp','verify','exports','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','smtp','prototype','emit','name','key','active','Imap','status','total','isNil','mailAccount:update','refresh','imapAccounts','hasOwnProperty','box','bind','email','end','handleImapEnd','handleImapError','handleImapBox','connected','messages','handleImapEmail','info'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x7880,0x1f4));var _0x0788=function(_0x21f588,_0x3f63ae){_0x21f588=_0x21f588-0x0;var _0x3b28cb=_0x7880[_0x21f588];return _0x3b28cb;};'use strict';var _=require('lodash');var moment=require(_0x0788('0x0'));var BPromise=require(_0x0788('0x1'));var md5=require(_0x0788('0x2'));var Redis=require(_0x0788('0x3'));var config=require(_0x0788('0x4'));var logger=require(_0x0788('0x5'))('email');config[_0x0788('0x6')]=_[_0x0788('0x7')](config[_0x0788('0x6')],{'host':_0x0788('0x8'),'port':0x18eb});var io=require(_0x0788('0x9'))(new Redis(config[_0x0788('0x6')]));var EmailImap=require(_0x0788('0xa'));var EmailSmtp=require(_0x0788('0xb'));var mailAccount=require(_0x0788('0xc'));var md5Accounts={};function EmailChannel(_0x422f8b){logger['info'](_0x0788('0xd'));this['mailAccounts']=_0x422f8b[_0x0788('0xe')];this['imapAccounts']={};this[_0x0788('0xf')]=new EmailSmtp();}EmailChannel[_0x0788('0x10')][_0x0788('0x11')]=function(_0xee8670){var _0x469ebe=this['mailAccounts'][_0xee8670];var _0x1920b3={'id':_0x469ebe['id'],'name':_0x469ebe[_0x0788('0x12')],'key':_0x469ebe[_0x0788('0x13')],'active':_0x469ebe[_0x0788('0x14')],'Imap':{'status':_0x469ebe[_0x0788('0x15')][_0x0788('0x16')],'messageStatus':_0x469ebe[_0x0788('0x15')]['messageStatus'],'total':_0x469ebe[_0x0788('0x15')][_0x0788('0x17')]}};if(_[_0x0788('0x18')](md5Accounts[_0xee8670])){md5Accounts[_0xee8670]={};}var _0x13cf07=md5(JSON['stringify'](_0x1920b3));if(md5Accounts[_0xee8670][_0x0788('0x2')]!==_0x13cf07){md5Accounts[_0xee8670]['md5']=_0x13cf07;io[_0x0788('0x11')](_0x0788('0x19'),_0x1920b3);}};EmailChannel[_0x0788('0x10')][_0x0788('0x1a')]=function(_0x2ddd1a){for(var _0x430e34 in _0x2ddd1a){if(_0x2ddd1a['hasOwnProperty'](_0x430e34)){if(_0x2ddd1a[_0x430e34]['Imap']&&_0x2ddd1a[_0x430e34][_0x0788('0x14')]){var _0x461d9d=_0x2ddd1a[_0x430e34]['Imap'];if(!this[_0x0788('0x1b')][_0x0788('0x1c')](_0x461d9d['id'])){this[_0x0788('0x1b')][_0x461d9d['id']]=new EmailImap(_0x461d9d,_0x2ddd1a[_0x430e34]['email']);this[_0x0788('0x1b')][_0x461d9d['id']]['on'](_0x0788('0x1d'),this['handleImapBox'][_0x0788('0x1e')](this,_0x430e34));this['imapAccounts'][_0x461d9d['id']]['on'](_0x0788('0x1f'),this['handleImapEmail'][_0x0788('0x1e')](this,_0x430e34));this[_0x0788('0x1b')][_0x461d9d['id']]['on'](_0x0788('0x20'),this[_0x0788('0x21')][_0x0788('0x1e')](this,_0x430e34));this['imapAccounts'][_0x461d9d['id']]['on']('error',this[_0x0788('0x22')][_0x0788('0x1e')](this,_0x430e34));}}else{if(_[_0x0788('0x18')](this[_0x0788('0xe')][_0x430e34]['Imap'])){this['mailAccounts'][_0x430e34][_0x0788('0x15')]={};}this[_0x0788('0xe')][_0x430e34][_0x0788('0x15')]['status']='disabled';this[_0x0788('0xe')][_0x430e34][_0x0788('0x15')]['messageStatus']='';this['emit'](_0x430e34);}}}};EmailChannel[_0x0788('0x10')][_0x0788('0x23')]=function(_0x57fda1,_0x286730){if(this[_0x0788('0xe')][_0x57fda1]){this[_0x0788('0xe')][_0x57fda1][_0x0788('0x15')][_0x0788('0x16')]=_0x0788('0x24');this[_0x0788('0xe')][_0x57fda1][_0x0788('0x15')]['messageStatus']=_0x286730['name'];if(_0x286730[_0x0788('0x25')]){this[_0x0788('0xe')][_0x57fda1]['Imap']['total']=_0x286730[_0x0788('0x25')][_0x0788('0x17')];}return this[_0x0788('0x11')](_0x57fda1);}};EmailChannel[_0x0788('0x10')][_0x0788('0x26')]=function(_0x44bff2,_0x327d67){logger[_0x0788('0x27')](_0x0788('0x28'),_0x327d67[_0x0788('0x29')],_0x327d67['lastName'],_0x327d67[_0x0788('0x2a')],_0x44bff2);if(this[_0x0788('0xe')][_0x44bff2]){return mailAccount[_0x0788('0x2b')](_0x44bff2,_0x327d67)[_0x0788('0x2c')](function(_0xce4534){if(_0xce4534){logger[_0x0788('0x27')](_0x0788('0x2d'));}})[_0x0788('0x2e')](function(_0x1cb6c0){logger[_0x0788('0x2f')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON['stringify'](_0x1cb6c0));});}};EmailChannel['prototype']['handleImapEnd']=function(_0x516cce){if(this['mailAccounts'][_0x516cce]&&this[_0x0788('0xe')][_0x516cce][_0x0788('0x15')]){if(this[_0x0788('0x1b')][this['mailAccounts'][_0x516cce][_0x0788('0x15')]['id']]){delete this[_0x0788('0x1b')][this[_0x0788('0xe')][_0x516cce][_0x0788('0x15')]['id']];}this['mailAccounts'][_0x516cce][_0x0788('0x15')]['lastSync']=moment();this[_0x0788('0x11')](_0x516cce);}};EmailChannel['prototype'][_0x0788('0x22')]=function(_0x1beb1f,_0x498e16){if(this[_0x0788('0xe')][_0x1beb1f]){this[_0x0788('0xe')][_0x1beb1f]['Imap'][_0x0788('0x16')]='error';this[_0x0788('0xe')][_0x1beb1f]['Imap'][_0x0788('0x30')]=_0x498e16;return this['emit'](_0x1beb1f);}};EmailChannel[_0x0788('0x10')]['sendMail']=function(_0x5dc77e,_0x3e31f8){return this[_0x0788('0xf')][_0x0788('0x31')](_0x5dc77e,_0x3e31f8);};EmailChannel[_0x0788('0x10')][_0x0788('0x32')]=function(_0x53da74){var _0x530c5a=this;if(this['mailAccounts'][_0x53da74['id']]){if(_['isNil'](this[_0x0788('0xe')][_0x53da74['id']][_0x0788('0x33')])){this[_0x0788('0xe')][_0x53da74['id']][_0x0788('0x33')]={};}this[_0x0788('0xe')][_0x53da74['id']]['Smtp']['lastSync']=moment();return new BPromise(function(_0x3d03a4,_0x6770a8){return _0x530c5a[_0x0788('0xf')][_0x0788('0x34')](_0x53da74)[_0x0788('0x2c')](function(_0x4316aa){_0x530c5a[_0x0788('0xe')][_0x53da74['id']][_0x0788('0x33')][_0x0788('0x16')]='verified';_0x530c5a['mailAccounts'][_0x53da74['id']][_0x0788('0x33')][_0x0788('0x30')]='';_0x530c5a[_0x0788('0x11')](_0x53da74['id']);_0x3d03a4(_0x4316aa);})['catch'](function(_0x5ab353){_0x530c5a['mailAccounts'][_0x53da74['id']][_0x0788('0x33')][_0x0788('0x16')]=_0x0788('0x2f');_0x530c5a[_0x0788('0xe')][_0x53da74['id']][_0x0788('0x33')][_0x0788('0x30')]=_0x5ab353;_0x530c5a[_0x0788('0x11')](_0x53da74['id']);_0x6770a8(_0x5ab353);});});}return this[_0x0788('0xf')]['verify'](_0x53da74);};module[_0x0788('0x35')]=EmailChannel; \ No newline at end of file +var _0x9a5a=['ioredis','../../../config/logger','email','redis','defaults','localhost','./imap','./smtp','../rpc/mailAccount','mailAccounts','imapAccounts','smtp','prototype','emit','key','active','Imap','status','total','isNil','stringify','mailAccount:update','refresh','hasOwnProperty','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','disabled','messageStatus','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','then','info','Mail\x20accepted\x20from\x20routing','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','handleImapError','sendMail','send','verifySmtp','Smtp','verified','exports','lodash','moment','bluebird','md5'];(function(_0x590ef7,_0x175f08){var _0x4c2634=function(_0xf94570){while(--_0xf94570){_0x590ef7['push'](_0x590ef7['shift']());}};_0x4c2634(++_0x175f08);}(_0x9a5a,0x194));var _0xa9a5=function(_0x3e6070,_0x2aafac){_0x3e6070=_0x3e6070-0x0;var _0x170549=_0x9a5a[_0x3e6070];return _0x170549;};'use strict';var _=require(_0xa9a5('0x0'));var moment=require(_0xa9a5('0x1'));var BPromise=require(_0xa9a5('0x2'));var md5=require(_0xa9a5('0x3'));var Redis=require(_0xa9a5('0x4'));var config=require('../../../config/environment');var logger=require(_0xa9a5('0x5'))(_0xa9a5('0x6'));config[_0xa9a5('0x7')]=_[_0xa9a5('0x8')](config[_0xa9a5('0x7')],{'host':_0xa9a5('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa9a5('0x7')]));var EmailImap=require(_0xa9a5('0xa'));var EmailSmtp=require(_0xa9a5('0xb'));var mailAccount=require(_0xa9a5('0xc'));var md5Accounts={};function EmailChannel(_0x24e1bd){logger['info']('start\x20email\x20channel');this['mailAccounts']=_0x24e1bd[_0xa9a5('0xd')];this[_0xa9a5('0xe')]={};this[_0xa9a5('0xf')]=new EmailSmtp();}EmailChannel[_0xa9a5('0x10')][_0xa9a5('0x11')]=function(_0x3c0f91){var _0x1324b0=this['mailAccounts'][_0x3c0f91];var _0x54b0b4={'id':_0x1324b0['id'],'name':_0x1324b0['name'],'key':_0x1324b0[_0xa9a5('0x12')],'active':_0x1324b0[_0xa9a5('0x13')],'Imap':{'status':_0x1324b0[_0xa9a5('0x14')][_0xa9a5('0x15')],'messageStatus':_0x1324b0[_0xa9a5('0x14')]['messageStatus'],'total':_0x1324b0[_0xa9a5('0x14')][_0xa9a5('0x16')]}};if(_[_0xa9a5('0x17')](md5Accounts[_0x3c0f91])){md5Accounts[_0x3c0f91]={};}var _0x453b49=md5(JSON[_0xa9a5('0x18')](_0x54b0b4));if(md5Accounts[_0x3c0f91][_0xa9a5('0x3')]!==_0x453b49){md5Accounts[_0x3c0f91]['md5']=_0x453b49;io[_0xa9a5('0x11')](_0xa9a5('0x19'),_0x54b0b4);}};EmailChannel[_0xa9a5('0x10')][_0xa9a5('0x1a')]=function(_0x5bbfeb){for(var _0x3353ca in _0x5bbfeb){if(_0x5bbfeb[_0xa9a5('0x1b')](_0x3353ca)){if(_0x5bbfeb[_0x3353ca][_0xa9a5('0x14')]&&_0x5bbfeb[_0x3353ca]['active']){var _0x3c505b=_0x5bbfeb[_0x3353ca]['Imap'];if(!this['imapAccounts'][_0xa9a5('0x1b')](_0x3c505b['id'])){this[_0xa9a5('0xe')][_0x3c505b['id']]=new EmailImap(_0x3c505b,_0x5bbfeb[_0x3353ca]['email']);this[_0xa9a5('0xe')][_0x3c505b['id']]['on']('box',this[_0xa9a5('0x1c')][_0xa9a5('0x1d')](this,_0x3353ca));this[_0xa9a5('0xe')][_0x3c505b['id']]['on'](_0xa9a5('0x6'),this[_0xa9a5('0x1e')][_0xa9a5('0x1d')](this,_0x3353ca));this[_0xa9a5('0xe')][_0x3c505b['id']]['on'](_0xa9a5('0x1f'),this[_0xa9a5('0x20')][_0xa9a5('0x1d')](this,_0x3353ca));this[_0xa9a5('0xe')][_0x3c505b['id']]['on'](_0xa9a5('0x21'),this['handleImapError']['bind'](this,_0x3353ca));}}else{if(_['isNil'](this[_0xa9a5('0xd')][_0x3353ca]['Imap'])){this[_0xa9a5('0xd')][_0x3353ca][_0xa9a5('0x14')]={};}this[_0xa9a5('0xd')][_0x3353ca]['Imap'][_0xa9a5('0x15')]=_0xa9a5('0x22');this[_0xa9a5('0xd')][_0x3353ca]['Imap']['messageStatus']='';this[_0xa9a5('0x11')](_0x3353ca);}}}};EmailChannel[_0xa9a5('0x10')][_0xa9a5('0x1c')]=function(_0x58c94c,_0x2c498b){if(this[_0xa9a5('0xd')][_0x58c94c]){this['mailAccounts'][_0x58c94c][_0xa9a5('0x14')][_0xa9a5('0x15')]='connected';this[_0xa9a5('0xd')][_0x58c94c]['Imap'][_0xa9a5('0x23')]=_0x2c498b['name'];if(_0x2c498b[_0xa9a5('0x24')]){this[_0xa9a5('0xd')][_0x58c94c]['Imap']['total']=_0x2c498b[_0xa9a5('0x24')]['total'];}return this[_0xa9a5('0x11')](_0x58c94c);}};EmailChannel[_0xa9a5('0x10')]['handleImapEmail']=function(_0x2ad16c,_0x464f30){logger['info'](_0xa9a5('0x25'),_0x464f30[_0xa9a5('0x26')],_0x464f30['lastName'],_0x464f30['from'],_0x2ad16c);if(this['mailAccounts'][_0x2ad16c]){return mailAccount['notify'](_0x2ad16c,_0x464f30)[_0xa9a5('0x27')](function(_0x5e3810){if(_0x5e3810){logger[_0xa9a5('0x28')](_0xa9a5('0x29'));}})['catch'](function(_0xcbdd3a){logger[_0xa9a5('0x21')](_0xa9a5('0x2a'),JSON['stringify'](_0xcbdd3a));});}};EmailChannel['prototype'][_0xa9a5('0x20')]=function(_0x3d361e){if(this['mailAccounts'][_0x3d361e]&&this[_0xa9a5('0xd')][_0x3d361e][_0xa9a5('0x14')]){if(this[_0xa9a5('0xe')][this[_0xa9a5('0xd')][_0x3d361e][_0xa9a5('0x14')]['id']]){delete this[_0xa9a5('0xe')][this[_0xa9a5('0xd')][_0x3d361e]['Imap']['id']];}this['mailAccounts'][_0x3d361e][_0xa9a5('0x14')][_0xa9a5('0x2b')]=moment();this[_0xa9a5('0x11')](_0x3d361e);}};EmailChannel[_0xa9a5('0x10')][_0xa9a5('0x2c')]=function(_0x19034f,_0xc6861b){if(this[_0xa9a5('0xd')][_0x19034f]){this[_0xa9a5('0xd')][_0x19034f]['Imap'][_0xa9a5('0x15')]='error';this[_0xa9a5('0xd')][_0x19034f]['Imap']['messageStatus']=_0xc6861b;return this[_0xa9a5('0x11')](_0x19034f);}};EmailChannel[_0xa9a5('0x10')][_0xa9a5('0x2d')]=function(_0x305a7a,_0x544baa){return this[_0xa9a5('0xf')][_0xa9a5('0x2e')](_0x305a7a,_0x544baa);};EmailChannel[_0xa9a5('0x10')][_0xa9a5('0x2f')]=function(_0x1441a3){var _0x20d267=this;if(this[_0xa9a5('0xd')][_0x1441a3['id']]){if(_[_0xa9a5('0x17')](this[_0xa9a5('0xd')][_0x1441a3['id']][_0xa9a5('0x30')])){this[_0xa9a5('0xd')][_0x1441a3['id']]['Smtp']={};}this[_0xa9a5('0xd')][_0x1441a3['id']]['Smtp'][_0xa9a5('0x2b')]=moment();return new BPromise(function(_0x2db9e5,_0x364334){return _0x20d267[_0xa9a5('0xf')]['verify'](_0x1441a3)[_0xa9a5('0x27')](function(_0x3658dd){_0x20d267[_0xa9a5('0xd')][_0x1441a3['id']]['Smtp']['status']=_0xa9a5('0x31');_0x20d267['mailAccounts'][_0x1441a3['id']][_0xa9a5('0x30')][_0xa9a5('0x23')]='';_0x20d267[_0xa9a5('0x11')](_0x1441a3['id']);_0x2db9e5(_0x3658dd);})['catch'](function(_0x1d41d7){_0x20d267[_0xa9a5('0xd')][_0x1441a3['id']][_0xa9a5('0x30')]['status']=_0xa9a5('0x21');_0x20d267['mailAccounts'][_0x1441a3['id']][_0xa9a5('0x30')][_0xa9a5('0x23')]=_0x1d41d7;_0x20d267['emit'](_0x1441a3['id']);_0x364334(_0x1d41d7);});});}return this[_0xa9a5('0xf')]['verify'](_0x1441a3);};module[_0xa9a5('0x32')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index ebf8e0f..fe2989a 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 _0x3b34=['textCode','hasOwnProperty','upperFirst','exports','path','util','imap','lodash','randomstring','mailparser','simpleParser','Iconv','events','EventEmitter','./utils','../../../config/logger','email','INBOX','account','getAccount','ready','handleReady','bind','once','end','handleEnd','error','inherits','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','required','anonymous@xcally.com','prototype','openBox','mailbox','handleOpenBox','handleError','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchError','body','handleMessageBody','attributes','handleMessageAttributes','handleSimpleParser','handleMessageEnd','parser','closeBox','stringify'];(function(_0x1d9e18,_0x59004d){var _0x3e0aec=function(_0x4265a3){while(--_0x4265a3){_0x1d9e18['push'](_0x1d9e18['shift']());}};_0x3e0aec(++_0x59004d);}(_0x3b34,0x108));var _0x43b3=function(_0x27f7df,_0x8c77d4){_0x27f7df=_0x27f7df-0x0;var _0x4213f8=_0x3b34[_0x27f7df];return _0x4213f8;};'use strict';var fs=require('fs');var path=require(_0x43b3('0x0'));var util=require(_0x43b3('0x1'));var Imap=require(_0x43b3('0x2'));var _=require(_0x43b3('0x3'));var rs=require(_0x43b3('0x4'));var simpleParser=require(_0x43b3('0x5'))[_0x43b3('0x6')];var Iconv=require('iconv')[_0x43b3('0x7')];var EventEmitter=require(_0x43b3('0x8'))[_0x43b3('0x9')];var utils=require(_0x43b3('0xa'));var logger=require(_0x43b3('0xb'))(_0x43b3('0xc'));function EmailImap(_0x5bb1c6,_0x27c6f8){this['mailbox']=_0x43b3('0xd');this[_0x43b3('0xe')]=this[_0x43b3('0xf')](_0x5bb1c6,_0x27c6f8);this[_0x43b3('0x2')]=new Imap(this[_0x43b3('0xe')]);this['imap']['once'](_0x43b3('0x10'),this[_0x43b3('0x11')][_0x43b3('0x12')](this));this[_0x43b3('0x2')][_0x43b3('0x13')](_0x43b3('0x14'),this[_0x43b3('0x15')][_0x43b3('0x12')](this));this[_0x43b3('0x2')]['on'](_0x43b3('0x16'),this['handleError']['bind'](this));this['imap']['connect']();}util[_0x43b3('0x17')](EmailImap,EventEmitter);EmailImap['prototype'][_0x43b3('0xf')]=function(_0x197686,_0x38b148){var _0x1b8787={'connTimeout':_0x197686[_0x43b3('0x18')]?_0x197686[_0x43b3('0x18')]*0x3e8:0x2710,'authTimeout':_0x197686[_0x43b3('0x19')]?_0x197686[_0x43b3('0x19')]*0x3e8:0x1388};if(_[_0x43b3('0x1a')](_0x197686[_0x43b3('0x1b')])){if(_0x197686[_0x43b3('0x1c')]){_0x1b8787[_0x43b3('0x1d')]=_0x197686[_0x43b3('0x1d')];_0x1b8787[_0x43b3('0x1e')]=_0x197686[_0x43b3('0x1e')];}_0x1b8787[_0x43b3('0x1f')]=_0x197686['host'];_0x1b8787[_0x43b3('0x20')]=_0x197686[_0x43b3('0x20')]||0x3e1;if(_0x197686[_0x43b3('0x21')]){_0x1b8787[_0x43b3('0x21')]=!![];}else{_0x1b8787[_0x43b3('0x21')]=![];_0x1b8787['autotls']=_0x43b3('0x22');}}else{_0x1b8787[_0x43b3('0x1d')]=_0x197686[_0x43b3('0x1d')];_0x1b8787[_0x43b3('0x1e')]=_0x197686[_0x43b3('0x1e')];_0x1b8787[_0x43b3('0x1f')]=utils['getHost'](_0x197686['service']);_0x1b8787[_0x43b3('0x20')]=0x3e1;_0x1b8787[_0x43b3('0x21')]=!![];}_0x1b8787[_0x43b3('0xc')]=_0x38b148||_0x197686[_0x43b3('0x1d')]||_0x43b3('0x23');return _0x1b8787;};EmailImap[_0x43b3('0x24')][_0x43b3('0x11')]=function(){this[_0x43b3('0x2')][_0x43b3('0x25')](this[_0x43b3('0x26')],![],this[_0x43b3('0x27')][_0x43b3('0x12')](this));};EmailImap['prototype'][_0x43b3('0x27')]=function(_0x3a102e,_0x47f328){if(_0x3a102e){this[_0x43b3('0x28')](_0x3a102e,!![]);}else{this[_0x43b3('0x29')](_0x43b3('0x2a'),_0x47f328);this[_0x43b3('0x2b')]();}};EmailImap[_0x43b3('0x24')][_0x43b3('0x2c')]=function(_0x34fd27){if(_0x34fd27){this[_0x43b3('0x28')](_0x34fd27,!![]);}else{this[_0x43b3('0x2')][_0x43b3('0x14')]();}};EmailImap['prototype']['readUnseen']=function(){this[_0x43b3('0x2')][_0x43b3('0x2d')]([_0x43b3('0x2e')],this[_0x43b3('0x2f')]['bind'](this));};EmailImap[_0x43b3('0x24')][_0x43b3('0x2f')]=function(_0x2c5a2f,_0x11159d){if(_0x2c5a2f){this[_0x43b3('0x28')](_0x2c5a2f,!![]);}else{if(_0x11159d[_0x43b3('0x30')]){try{var _0x426e57=this['imap'][_0x43b3('0x31')](_0x11159d,{'bodies':'','markSeen':!![]});_0x426e57['on'](_0x43b3('0x32'),this['handleFetchMessage'][_0x43b3('0x12')](this));_0x426e57[_0x43b3('0x13')](_0x43b3('0x16'),this[_0x43b3('0x33')][_0x43b3('0x12')](this));_0x426e57[_0x43b3('0x13')](_0x43b3('0x14'),this['handleFetchEnd']['bind'](this));}catch(_0x11f375){logger[_0x43b3('0x16')](_0x11f375);}}else{this[_0x43b3('0x2')]['closeBox'](!![],this['handleCloseBox'][_0x43b3('0x12')](this));}}};EmailImap[_0x43b3('0x24')]['handleFetchMessage']=function(_0x20d055,_0x160e60){_0x20d055['on'](_0x43b3('0x34'),this[_0x43b3('0x35')][_0x43b3('0x12')](this));_0x20d055['once'](_0x43b3('0x36'),this[_0x43b3('0x37')]['bind'](this));_0x20d055[_0x43b3('0x13')]('end',this['handleMessageEnd']['bind'](this));};EmailImap[_0x43b3('0x24')][_0x43b3('0x35')]=function(_0x3b31e7,_0x44f852){simpleParser(_0x3b31e7,{'Iconv':Iconv},this[_0x43b3('0x38')][_0x43b3('0x12')](this));};EmailImap[_0x43b3('0x24')][_0x43b3('0x37')]=function(_0x3f1bf7){};EmailImap[_0x43b3('0x24')][_0x43b3('0x39')]=function(){};EmailImap[_0x43b3('0x24')][_0x43b3('0x38')]=function(_0x2f8032,_0x4260aa){if(_0x2f8032){logger[_0x43b3('0x16')](_0x2f8032);}else{var _0x19db61=this;utils[_0x43b3('0x3a')](this[_0x43b3('0xe')],_0x4260aa,function(_0xbcfe15){_0x19db61[_0x43b3('0x29')](_0x43b3('0xc'),_0xbcfe15);});}};EmailImap['prototype']['handleFetchEnd']=function(){this['imap'][_0x43b3('0x3b')](!![],this['handleCloseBox'][_0x43b3('0x12')](this));};EmailImap[_0x43b3('0x24')][_0x43b3('0x33')]=function(_0x1dc908){this['handleError'](_0x1dc908);this[_0x43b3('0x2')][_0x43b3('0x3b')](!![],this[_0x43b3('0x2c')][_0x43b3('0x12')](this));};EmailImap[_0x43b3('0x24')][_0x43b3('0x15')]=function(){this['emit']('end');};EmailImap['prototype']['handleError']=function(_0x1fd845,_0x28a082){logger['error']('handleError',this[_0x43b3('0xe')][_0x43b3('0xc')],JSON[_0x43b3('0x3c')](_0x1fd845));var _0x3ef697='';if(_0x1fd845){if(_0x1fd845[_0x43b3('0x3d')]){_0x3ef697=_0x1fd845[_0x43b3('0x3d')];}else{for(var _0x4422d1 in _0x1fd845){if(_0x1fd845[_0x43b3('0x3e')](_0x4422d1)){_0x3ef697+=_[_0x43b3('0x3f')](_0x4422d1)+':\x20'+_0x1fd845[_0x4422d1]+'\x0a';}}}}if(_0x28a082){this[_0x43b3('0x2')][_0x43b3('0x14')]();}else{this['emit'](_0x43b3('0x16'),_0x3ef697);this[_0x43b3('0x29')](_0x43b3('0x14'));}};module[_0x43b3('0x40')]=EmailImap; \ No newline at end of file +var _0xc964=['hasOwnProperty','upperFirst','path','util','lodash','randomstring','mailparser','iconv','events','EventEmitter','./utils','../../../config/logger','email','INBOX','account','getAccount','imap','bind','once','handleEnd','error','handleError','inherits','prototype','connTimeout','authTimeout','isNil','authentication','user','password','host','port','tls','autotls','required','service','anonymous@xcally.com','handleReady','openBox','mailbox','handleOpenBox','box','readUnseen','handleCloseBox','end','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchEnd','closeBox','handleFetchMessage','handleMessageBody','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','emit','handleFetchError','stringify','textCode'];(function(_0x2d66cd,_0x591ac9){var _0x57c255=function(_0x33a59c){while(--_0x33a59c){_0x2d66cd['push'](_0x2d66cd['shift']());}};_0x57c255(++_0x591ac9);}(_0xc964,0x7e));var _0x4c96=function(_0x16d3c2,_0x5bf0c3){_0x16d3c2=_0x16d3c2-0x0;var _0x417d73=_0xc964[_0x16d3c2];return _0x417d73;};'use strict';var fs=require('fs');var path=require(_0x4c96('0x0'));var util=require(_0x4c96('0x1'));var Imap=require('imap');var _=require(_0x4c96('0x2'));var rs=require(_0x4c96('0x3'));var simpleParser=require(_0x4c96('0x4'))['simpleParser'];var Iconv=require(_0x4c96('0x5'))['Iconv'];var EventEmitter=require(_0x4c96('0x6'))[_0x4c96('0x7')];var utils=require(_0x4c96('0x8'));var logger=require(_0x4c96('0x9'))(_0x4c96('0xa'));function EmailImap(_0x1fa8a0,_0x4070a5){this['mailbox']=_0x4c96('0xb');this[_0x4c96('0xc')]=this[_0x4c96('0xd')](_0x1fa8a0,_0x4070a5);this['imap']=new Imap(this[_0x4c96('0xc')]);this[_0x4c96('0xe')]['once']('ready',this['handleReady'][_0x4c96('0xf')](this));this[_0x4c96('0xe')][_0x4c96('0x10')]('end',this[_0x4c96('0x11')]['bind'](this));this['imap']['on'](_0x4c96('0x12'),this[_0x4c96('0x13')][_0x4c96('0xf')](this));this['imap']['connect']();}util[_0x4c96('0x14')](EmailImap,EventEmitter);EmailImap[_0x4c96('0x15')][_0x4c96('0xd')]=function(_0x4d80c9,_0xe42458){var _0x334165={'connTimeout':_0x4d80c9[_0x4c96('0x16')]?_0x4d80c9[_0x4c96('0x16')]*0x3e8:0x2710,'authTimeout':_0x4d80c9[_0x4c96('0x17')]?_0x4d80c9[_0x4c96('0x17')]*0x3e8:0x1388};if(_[_0x4c96('0x18')](_0x4d80c9['service'])){if(_0x4d80c9[_0x4c96('0x19')]){_0x334165['user']=_0x4d80c9[_0x4c96('0x1a')];_0x334165['password']=_0x4d80c9[_0x4c96('0x1b')];}_0x334165['host']=_0x4d80c9[_0x4c96('0x1c')];_0x334165[_0x4c96('0x1d')]=_0x4d80c9[_0x4c96('0x1d')]||0x3e1;if(_0x4d80c9[_0x4c96('0x1e')]){_0x334165[_0x4c96('0x1e')]=!![];}else{_0x334165[_0x4c96('0x1e')]=![];_0x334165[_0x4c96('0x1f')]=_0x4c96('0x20');}}else{_0x334165[_0x4c96('0x1a')]=_0x4d80c9[_0x4c96('0x1a')];_0x334165[_0x4c96('0x1b')]=_0x4d80c9['password'];_0x334165['host']=utils['getHost'](_0x4d80c9[_0x4c96('0x21')]);_0x334165[_0x4c96('0x1d')]=0x3e1;_0x334165[_0x4c96('0x1e')]=!![];}_0x334165[_0x4c96('0xa')]=_0xe42458||_0x4d80c9[_0x4c96('0x1a')]||_0x4c96('0x22');return _0x334165;};EmailImap['prototype'][_0x4c96('0x23')]=function(){this[_0x4c96('0xe')][_0x4c96('0x24')](this[_0x4c96('0x25')],![],this[_0x4c96('0x26')][_0x4c96('0xf')](this));};EmailImap['prototype'][_0x4c96('0x26')]=function(_0x2bfd69,_0x4aeb36){if(_0x2bfd69){this[_0x4c96('0x13')](_0x2bfd69,!![]);}else{this['emit'](_0x4c96('0x27'),_0x4aeb36);this[_0x4c96('0x28')]();}};EmailImap[_0x4c96('0x15')][_0x4c96('0x29')]=function(_0x59a913){if(_0x59a913){this[_0x4c96('0x13')](_0x59a913,!![]);}else{this[_0x4c96('0xe')][_0x4c96('0x2a')]();}};EmailImap[_0x4c96('0x15')][_0x4c96('0x28')]=function(){this[_0x4c96('0xe')]['search']([_0x4c96('0x2b')],this[_0x4c96('0x2c')][_0x4c96('0xf')](this));};EmailImap[_0x4c96('0x15')][_0x4c96('0x2c')]=function(_0x1712c4,_0x4c5e1a){if(_0x1712c4){this['handleError'](_0x1712c4,!![]);}else{if(_0x4c5e1a[_0x4c96('0x2d')]){try{var _0x454252=this[_0x4c96('0xe')][_0x4c96('0x2e')](_0x4c5e1a,{'bodies':'','markSeen':!![]});_0x454252['on'](_0x4c96('0x2f'),this['handleFetchMessage'][_0x4c96('0xf')](this));_0x454252['once'](_0x4c96('0x12'),this['handleFetchError'][_0x4c96('0xf')](this));_0x454252[_0x4c96('0x10')](_0x4c96('0x2a'),this[_0x4c96('0x30')][_0x4c96('0xf')](this));}catch(_0x1faf24){logger[_0x4c96('0x12')](_0x1faf24);}}else{this[_0x4c96('0xe')][_0x4c96('0x31')](!![],this[_0x4c96('0x29')][_0x4c96('0xf')](this));}}};EmailImap[_0x4c96('0x15')][_0x4c96('0x32')]=function(_0xa1e751,_0x209274){_0xa1e751['on']('body',this[_0x4c96('0x33')][_0x4c96('0xf')](this));_0xa1e751[_0x4c96('0x10')]('attributes',this[_0x4c96('0x34')]['bind'](this));_0xa1e751[_0x4c96('0x10')]('end',this[_0x4c96('0x35')][_0x4c96('0xf')](this));};EmailImap[_0x4c96('0x15')]['handleMessageBody']=function(_0x5d0f4e,_0x367230){simpleParser(_0x5d0f4e,{'Iconv':Iconv},this[_0x4c96('0x36')]['bind'](this));};EmailImap[_0x4c96('0x15')][_0x4c96('0x34')]=function(_0x830182){};EmailImap[_0x4c96('0x15')]['handleMessageEnd']=function(){};EmailImap[_0x4c96('0x15')][_0x4c96('0x36')]=function(_0x178e6c,_0x112116){if(_0x178e6c){logger[_0x4c96('0x12')](_0x178e6c);}else{var _0x5be1c3=this;utils[_0x4c96('0x37')](this[_0x4c96('0xc')],_0x112116,function(_0x5615f2){_0x5be1c3[_0x4c96('0x38')](_0x4c96('0xa'),_0x5615f2);});}};EmailImap[_0x4c96('0x15')][_0x4c96('0x30')]=function(){this[_0x4c96('0xe')][_0x4c96('0x31')](!![],this[_0x4c96('0x29')]['bind'](this));};EmailImap[_0x4c96('0x15')][_0x4c96('0x39')]=function(_0x2e0001){this[_0x4c96('0x13')](_0x2e0001);this[_0x4c96('0xe')][_0x4c96('0x31')](!![],this[_0x4c96('0x29')][_0x4c96('0xf')](this));};EmailImap[_0x4c96('0x15')][_0x4c96('0x11')]=function(){this['emit'](_0x4c96('0x2a'));};EmailImap[_0x4c96('0x15')][_0x4c96('0x13')]=function(_0x2b4a5f,_0x6e94f1){logger['error'](_0x4c96('0x13'),this[_0x4c96('0xc')][_0x4c96('0xa')],JSON[_0x4c96('0x3a')](_0x2b4a5f));var _0x557f94='';if(_0x2b4a5f){if(_0x2b4a5f[_0x4c96('0x3b')]){_0x557f94=_0x2b4a5f[_0x4c96('0x3b')];}else{for(var _0x5e39d2 in _0x2b4a5f){if(_0x2b4a5f[_0x4c96('0x3c')](_0x5e39d2)){_0x557f94+=_[_0x4c96('0x3d')](_0x5e39d2)+':\x20'+_0x2b4a5f[_0x5e39d2]+'\x0a';}}}}if(_0x6e94f1){this['imap'][_0x4c96('0x2a')]();}else{this[_0x4c96('0x38')](_0x4c96('0x12'),_0x557f94);this[_0x4c96('0x38')](_0x4c96('0x2a'));}};module['exports']=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index d6c998c..27a2b44 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 _0xc0f4=['createTransport','Not\x20verifired','exports','nodemailer','bluebird','nodemailer-plugin-inline-base64','prototype','send','sendMail','toString','verify'];(function(_0x173c8b,_0x187140){var _0x3f1019=function(_0x57aa25){while(--_0x57aa25){_0x173c8b['push'](_0x173c8b['shift']());}};_0x3f1019(++_0x187140);}(_0xc0f4,0x9d));var _0x4c0f=function(_0x3b5a16,_0x5c4bb4){_0x3b5a16=_0x3b5a16-0x0;var _0x121c37=_0xc0f4[_0x3b5a16];return _0x121c37;};'use strict';var nodemailer=require(_0x4c0f('0x0'));var BPromise=require(_0x4c0f('0x1'));var inlineBase64=require(_0x4c0f('0x2'));function EmailSmtp(){}EmailSmtp[_0x4c0f('0x3')][_0x4c0f('0x4')]=function(_0x4728e8,_0x272cc8){return new BPromise(function(_0x5b01f5,_0x40e4d3){var _0x27512a=nodemailer['createTransport'](_0x4728e8);_0x27512a['use']('compile',inlineBase64());_0x27512a[_0x4c0f('0x5')](_0x272cc8,function(_0x1d3fef,_0x1cf1f1){if(_0x1d3fef){_0x40e4d3(_0x1d3fef[_0x4c0f('0x6')]());}else{_0x5b01f5(_0x1cf1f1);}});});};EmailSmtp['prototype'][_0x4c0f('0x7')]=function(_0x29d321){return new BPromise(function(_0x115c27,_0x32bef3){var _0x51a2c4=nodemailer[_0x4c0f('0x8')](_0x29d321);_0x51a2c4[_0x4c0f('0x7')](function(_0x38811f,_0xe7f803){if(_0x38811f){_0x32bef3(_0x38811f[_0x4c0f('0x6')]());}else{if(_0xe7f803){_0x115c27(_0xe7f803);}else{_0x32bef3(_0x4c0f('0x9'));}}});});};module[_0x4c0f('0xa')]=EmailSmtp; \ No newline at end of file +var _0x03aa=['nodemailer','bluebird','nodemailer-plugin-inline-base64','prototype','send','createTransport','sendMail','toString','Not\x20verifired','exports'];(function(_0x1eca68,_0x25a76b){var _0x11e8a3=function(_0x33ea8a){while(--_0x33ea8a){_0x1eca68['push'](_0x1eca68['shift']());}};_0x11e8a3(++_0x25a76b);}(_0x03aa,0x10e));var _0xa03a=function(_0x36c24d,_0x310acd){_0x36c24d=_0x36c24d-0x0;var _0x4d7059=_0x03aa[_0x36c24d];return _0x4d7059;};'use strict';var nodemailer=require(_0xa03a('0x0'));var BPromise=require(_0xa03a('0x1'));var inlineBase64=require(_0xa03a('0x2'));function EmailSmtp(){}EmailSmtp[_0xa03a('0x3')][_0xa03a('0x4')]=function(_0x470de7,_0x36034a){return new BPromise(function(_0x25c11e,_0x1dbedf){var _0x5bf330=nodemailer[_0xa03a('0x5')](_0x470de7);_0x5bf330['use']('compile',inlineBase64());_0x5bf330[_0xa03a('0x6')](_0x36034a,function(_0x52583c,_0x44ccba){if(_0x52583c){_0x1dbedf(_0x52583c['toString']());}else{_0x25c11e(_0x44ccba);}});});};EmailSmtp[_0xa03a('0x3')]['verify']=function(_0xa12778){return new BPromise(function(_0x2fdeac,_0x1d2826){var _0x3e61e3=nodemailer[_0xa03a('0x5')](_0xa12778);_0x3e61e3['verify'](function(_0x39778b,_0x5e087a){if(_0x39778b){_0x1d2826(_0x39778b[_0xa03a('0x7')]());}else{if(_0x5e087a){_0x2fdeac(_0x5e087a);}else{_0x1d2826(_0xa03a('0x8'));}}});});};module[_0xa03a('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 6cd867a..bfda2c6 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 _0x5d4e=['anonymous','generate','@xcally.com','value','name','split','join','Anonymous','length','pop','address','isEmpty','html','test','replace','body','textAsHtml','originTo','message','originCc','includes','bcc','attachments','attach','type','attachment','now','root','server/files/attachments/','content','push','contentType','parser','from','subject','messageId','inReplyTo','date','format','filter','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','Attachments','Title','Data','

Empty\x20message

','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','moment','randomstring','path','util','node-tnef','email','../../../config/environment','head'];(function(_0x2e889d,_0x537e27){var _0x47fc2a=function(_0x4327bb){while(--_0x4327bb){_0x2e889d['push'](_0x2e889d['shift']());}};_0x47fc2a(++_0x537e27);}(_0x5d4e,0x138));var _0xe5d4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5d4e[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var moment=require(_0xe5d4('0x0'));var random=require(_0xe5d4('0x1'));var fs=require('fs');var path=require(_0xe5d4('0x2'));var util=require(_0xe5d4('0x3'));var tnef=require(_0xe5d4('0x4'));var logger=require('../../../config/logger')(_0xe5d4('0x5'));var config=require(_0xe5d4('0x6'));function getAddress(_0x2f6fc9){var _0x56b27a=_[_0xe5d4('0x7')](_0x2f6fc9['value']);return _0x56b27a&&_0x56b27a['address']?_0x56b27a['address']:_0xe5d4('0x8')+random[_0xe5d4('0x9')](0x6)+_0xe5d4('0xa');}function getFirstName(_0x1b332f){var _0x318504=_[_0xe5d4('0x7')](_0x1b332f[_0xe5d4('0xb')]);if(_0x318504&&_0x318504[_0xe5d4('0xc')]){var _0x23bfb3=_0x318504[_0xe5d4('0xc')][_0xe5d4('0xd')](/\s+/);return _0x23bfb3['length']?_0x23bfb3['slice'](0x0,-0x1)[_0xe5d4('0xe')]('\x20'):_0x318504[_0xe5d4('0xc')];}return _0xe5d4('0xf');}function getLastName(_0x472c73){var _0x62c55b=_[_0xe5d4('0x7')](_0x472c73[_0xe5d4('0xb')]);if(_0x62c55b&&_0x62c55b[_0xe5d4('0xc')]){var _0x35104b=_0x62c55b['name']['split'](/\s+/);return _0x35104b[_0xe5d4('0x10')]>0x1?_0x35104b[_0xe5d4('0x11')]():'';}return'';}function getMails(_0x4d0756,_0x9af39d){var _0x3a3017='';for(var _0x3dee9f=0x0;_0x3dee9f<_0x9af39d[_0xe5d4('0xb')][_0xe5d4('0x10')];_0x3dee9f+=0x1){if(_0x9af39d[_0xe5d4('0xb')][_0x3dee9f][_0xe5d4('0x12')]!==_0x4d0756){if(!_[_0xe5d4('0x13')](_0x3a3017)){_0x3a3017+=',';}_0x3a3017+=_0x9af39d[_0xe5d4('0xb')][_0x3dee9f][_0xe5d4('0xc')]||_0x9af39d[_0xe5d4('0xb')][_0x3dee9f][_0xe5d4('0x12')]||'';_0x3a3017+='\x20<';_0x3a3017+=_0x9af39d[_0xe5d4('0xb')][_0x3dee9f][_0xe5d4('0x12')]?_0x9af39d[_0xe5d4('0xb')][_0x3dee9f][_0xe5d4('0x12')]:_0xe5d4('0x8')+random[_0xe5d4('0x9')](0x6)+_0xe5d4('0xa');_0x3a3017+='>';}}return _0x3a3017;}function parseEmail(_0x3253fe,_0x4fe536,_0x222791){if(_0x4fe536[_0xe5d4('0x14')]){var _0x4c632f=/)<[^<]*)*<\/script>/gi;while(_0x4c632f[_0xe5d4('0x15')](_0x4fe536[_0xe5d4('0x14')])){_0x4fe536[_0xe5d4('0x14')]=_0x4fe536[_0xe5d4('0x14')][_0xe5d4('0x16')](_0x4c632f,'');}_0x222791[_0xe5d4('0x17')]=_0x4fe536['html'];}else{_0x222791['body']=_0x4fe536[_0xe5d4('0x18')];}if(_0x222791[_0xe5d4('0x17')]){_0x222791['body']=_0x222791[_0xe5d4('0x17')][_0xe5d4('0x16')](/Empty\x20message

';if(_0x333db1[_0xe5d4('0x34')]){for(var _0x16d9f6=0x0;_0x16d9f6<_0x333db1['Attachments'][_0xe5d4('0x10')];_0x16d9f6++){var _0x956d08=_0x333db1[_0xe5d4('0x34')][_0x16d9f6];_0x475388[_0xe5d4('0x1a')][_0xe5d4('0x1e')][_0xe5d4('0x26')]({'filename':_0x956d08[_0xe5d4('0x35')],'content':new Buffer(_0x956d08[_0xe5d4('0x36')])});}}}_0x107d4c(parseEmail(_0x2ceee5,_0x278484,_0x475388));});}else{_0x278484[_0xe5d4('0x14')]=_0xe5d4('0x37');_0x107d4c(parseEmail(_0x2ceee5,_0x278484,_0x475388));}}else{_0x107d4c(parseEmail(_0x2ceee5,_0x278484,_0x475388));}};exports['getHost']=function(_0xc7d014){switch(_0xc7d014){case _0xe5d4('0x38'):return _0xe5d4('0x39');case _0xe5d4('0x3a'):return _0xe5d4('0x3b');case'hotmail':return _0xe5d4('0x3c');case _0xe5d4('0x3d'):return _0xe5d4('0x3e');}return _0xe5d4('0x3f');}; \ No newline at end of file +var _0x0085=['html','body','textAsHtml','replace','Empty\x20message

','Attachments','Title','Data','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook.office365.com','127.0.0.1','lodash','moment','path','util','email','../../../config/environment','head','value','address','@xcally.com','name','length','slice','Anonymous','pop','isEmpty','anonymous','generate','test'];(function(_0x175d49,_0x5a9812){var _0x4d9255=function(_0x2d4500){while(--_0x2d4500){_0x175d49['push'](_0x175d49['shift']());}};_0x4d9255(++_0x5a9812);}(_0x0085,0x185));var _0x5008=function(_0x55b89e,_0x385c49){_0x55b89e=_0x55b89e-0x0;var _0xad64f0=_0x0085[_0x55b89e];return _0xad64f0;};'use strict';var _=require(_0x5008('0x0'));var moment=require(_0x5008('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0x5008('0x2'));var util=require(_0x5008('0x3'));var tnef=require('node-tnef');var logger=require('../../../config/logger')(_0x5008('0x4'));var config=require(_0x5008('0x5'));function getAddress(_0x59c996){var _0x19d412=_[_0x5008('0x6')](_0x59c996[_0x5008('0x7')]);return _0x19d412&&_0x19d412[_0x5008('0x8')]?_0x19d412[_0x5008('0x8')]:'anonymous'+random['generate'](0x6)+_0x5008('0x9');}function getFirstName(_0x27cb95){var _0x4c270b=_['head'](_0x27cb95[_0x5008('0x7')]);if(_0x4c270b&&_0x4c270b['name']){var _0x1e2b4a=_0x4c270b[_0x5008('0xa')]['split'](/\s+/);return _0x1e2b4a[_0x5008('0xb')]?_0x1e2b4a[_0x5008('0xc')](0x0,-0x1)['join']('\x20'):_0x4c270b[_0x5008('0xa')];}return _0x5008('0xd');}function getLastName(_0xb56eab){var _0x547a48=_[_0x5008('0x6')](_0xb56eab[_0x5008('0x7')]);if(_0x547a48&&_0x547a48['name']){var _0x4d865b=_0x547a48['name']['split'](/\s+/);return _0x4d865b[_0x5008('0xb')]>0x1?_0x4d865b[_0x5008('0xe')]():'';}return'';}function getMails(_0xb9413d,_0x430131){var _0x1f957a='';for(var _0x4d46f3=0x0;_0x4d46f3<_0x430131['value'][_0x5008('0xb')];_0x4d46f3+=0x1){if(_0x430131[_0x5008('0x7')][_0x4d46f3][_0x5008('0x8')]!==_0xb9413d){if(!_[_0x5008('0xf')](_0x1f957a)){_0x1f957a+=',';}_0x1f957a+=_0x430131['value'][_0x4d46f3][_0x5008('0xa')]||_0x430131[_0x5008('0x7')][_0x4d46f3][_0x5008('0x8')]||'';_0x1f957a+='\x20<';_0x1f957a+=_0x430131[_0x5008('0x7')][_0x4d46f3]['address']?_0x430131[_0x5008('0x7')][_0x4d46f3][_0x5008('0x8')]:_0x5008('0x10')+random[_0x5008('0x11')](0x6)+'@xcally.com';_0x1f957a+='>';}}return _0x1f957a;}function parseEmail(_0x1eb0d2,_0x2941e4,_0x2dbbe9){if(_0x2941e4['html']){var _0x280b67=/)<[^<]*)*<\/script>/gi;while(_0x280b67[_0x5008('0x12')](_0x2941e4[_0x5008('0x13')])){_0x2941e4[_0x5008('0x13')]=_0x2941e4['html']['replace'](_0x280b67,'');}_0x2dbbe9[_0x5008('0x14')]=_0x2941e4[_0x5008('0x13')];}else{_0x2dbbe9[_0x5008('0x14')]=_0x2941e4[_0x5008('0x15')];}if(_0x2dbbe9[_0x5008('0x14')]){_0x2dbbe9[_0x5008('0x14')]=_0x2dbbe9['body'][_0x5008('0x16')](/0x0){if(this[_0x176c4c+_0xa9ca('0x24')]>0x0&&this[_0x176c4c+_0xa9ca('0x23')]>=this[_0x176c4c+_0xa9ca('0x24')]){return _0xa9ca('0x25');}else{return _0xa9ca('0x26');}}else{return'idle';}};Agent[_0xa9ca('0x27')]['updateRealtime']=function(){var _0x5eb770=[_0xa9ca('0x28'),_0xa9ca('0x29'),_0xa9ca('0x2a'),_0xa9ca('0x2b'),_0xa9ca('0x2c')];for(var _0x4e8a56=0x0;_0x4e8a56<_0x5eb770[_0xa9ca('0x2d')];_0x4e8a56+=0x1){var _0x4b9dbd=this[_0xa9ca('0x2e')](_0x5eb770[_0x4e8a56]);if(this[_0x5eb770[_0x4e8a56]+_0xa9ca('0x2f')]!==_0x4b9dbd){this[_0x5eb770[_0x4e8a56]+_0xa9ca('0x30')]=_['toNumber'](moment()['format']('x'));}this[_0x5eb770[_0x4e8a56]+'Status']=_0x4b9dbd;}var _0x54d6b7={'id':this['id'],'name':this['name'],'online':this[_0xa9ca('0x8')],'voicePause':this[_0xa9ca('0x9')],'chatPause':this[_0xa9ca('0xa')],'mailPause':this[_0xa9ca('0xb')],'smsPause':this['smsPause'],'faxPause':this[_0xa9ca('0xc')],'openchannelPause':this[_0xa9ca('0xe')],'chatStatus':this[_0xa9ca('0xf')],'chatStatusTime':this[_0xa9ca('0x10')],'chatCapacity':this[_0xa9ca('0x11')],'chatCurrentCapacity':this[_0xa9ca('0x31')],'mailStatus':this[_0xa9ca('0x12')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0xa9ca('0x14')],'mailCurrentCapacity':this[_0xa9ca('0x15')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0xa9ca('0x17')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this['smsStatus'],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0xa9ca('0x1b')],'smsCurrentCapacity':this['smsCurrentCapacity'],'openchannelStatus':this[_0xa9ca('0x1d')],'openchannelStatusTime':this[_0xa9ca('0x32')],'openchannelCapacity':this[_0xa9ca('0x1e')],'openchannelCurrentCapacity':this[_0xa9ca('0x1f')],'busy':this[_0xa9ca('0x20')],'busyQueue':this[_0xa9ca('0x21')]};var _0x211a09=md5(JSON['stringify'](_0x54d6b7));if(this['md5']!==_0x211a09){this[_0xa9ca('0x2')]=_0x211a09;io[_0xa9ca('0x33')](_0xa9ca('0x34'),_0x54d6b7);}};module['exports']=Agent; \ No newline at end of file +var _0xbee0=['getChannelStatus','CurrentCapacity','Capacity','maxcapacity','mail','chat','fax','Status','format','voicePause','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxCurrentCapacity','smsCurrentCapacity','openchannelStatus','emit','lodash','moment','ioredis','../../../config/environment','redis','defaults','localhost','name','online','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','smsStatus','smsStatusTime','smsCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','md5','updateRealtime','prototype'];(function(_0x289a67,_0x1e5a3c){var _0x572b49=function(_0x22e036){while(--_0x22e036){_0x289a67['push'](_0x289a67['shift']());}};_0x572b49(++_0x1e5a3c);}(_0xbee0,0xab));var _0x0bee=function(_0x4d64e5,_0x1a99e5){_0x4d64e5=_0x4d64e5-0x0;var _0xd99957=_0xbee0[_0x4d64e5];return _0xd99957;};'use strict';var _=require(_0x0bee('0x0'));var moment=require(_0x0bee('0x1'));var md5=require('md5');var Redis=require(_0x0bee('0x2'));var config=require(_0x0bee('0x3'));config[_0x0bee('0x4')]=_[_0x0bee('0x5')](config[_0x0bee('0x4')],{'host':_0x0bee('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0bee('0x4')]));function Agent(_0x203f8f){this['id']=_0x203f8f['id']||0x0;this[_0x0bee('0x7')]=_0x203f8f['name']||'';this[_0x0bee('0x8')]=_0x203f8f['online']||!![];this['voicePause']=_0x203f8f['voicePause']||![];this[_0x0bee('0x9')]=_0x203f8f[_0x0bee('0x9')]||![];this['mailPause']=_0x203f8f[_0x0bee('0xa')]||![];this[_0x0bee('0xb')]=_0x203f8f[_0x0bee('0xb')]||![];this[_0x0bee('0xc')]=_0x203f8f[_0x0bee('0xc')]||![];this[_0x0bee('0xd')]=_0x203f8f[_0x0bee('0xd')]||![];this[_0x0bee('0xe')]=_0x0bee('0xf');this[_0x0bee('0x10')]=0x0;this[_0x0bee('0x11')]=_0x203f8f[_0x0bee('0x11')]||0x0;this[_0x0bee('0x12')]=0x0;this['mailStatus']=_0x0bee('0xf');this['mailStatusTime']=0x0;this['mailCapacity']=_0x203f8f['mailCapacity']||0x0;this['mailCurrentCapacity']=0x0;this[_0x0bee('0x13')]=_0x0bee('0xf');this[_0x0bee('0x14')]=0x0;this[_0x0bee('0x15')]=_0x203f8f['faxCapacity']||0x0;this['faxCurrentCapacity']=0x0;this[_0x0bee('0x16')]=_0x0bee('0xf');this[_0x0bee('0x17')]=0x0;this['smsCapacity']=_0x203f8f[_0x0bee('0x18')]||0x0;this['smsCurrentCapacity']=0x0;this['openchannelStatus']='unknown';this[_0x0bee('0x19')]=0x0;this[_0x0bee('0x1a')]=_0x203f8f['openchannelCapacity']||0x0;this[_0x0bee('0x1b')]=0x0;this[_0x0bee('0x1c')]=![];this[_0x0bee('0x1d')]=undefined;this[_0x0bee('0x1e')]='';this[_0x0bee('0x1f')]();}Agent[_0x0bee('0x20')][_0x0bee('0x21')]=function(_0x5c72bd){if(this[_0x5c72bd+_0x0bee('0x22')]>0x0){if(this[_0x5c72bd+'Capacity']>0x0&&this[_0x5c72bd+_0x0bee('0x22')]>=this[_0x5c72bd+_0x0bee('0x23')]){return _0x0bee('0x24');}else{return'working';}}else{return'idle';}};Agent[_0x0bee('0x20')][_0x0bee('0x1f')]=function(){var _0x28da72=[_0x0bee('0x25'),_0x0bee('0x26'),'openchannel',_0x0bee('0x27'),'sms'];for(var _0x516995=0x0;_0x516995<_0x28da72['length'];_0x516995+=0x1){var _0x1ec361=this[_0x0bee('0x21')](_0x28da72[_0x516995]);if(this[_0x28da72[_0x516995]+_0x0bee('0x28')]!==_0x1ec361){this[_0x28da72[_0x516995]+'StatusTime']=_['toNumber'](moment()[_0x0bee('0x29')]('x'));}this[_0x28da72[_0x516995]+_0x0bee('0x28')]=_0x1ec361;}var _0x24b605={'id':this['id'],'name':this[_0x0bee('0x7')],'online':this[_0x0bee('0x8')],'voicePause':this[_0x0bee('0x2a')],'chatPause':this['chatPause'],'mailPause':this['mailPause'],'smsPause':this[_0x0bee('0xc')],'faxPause':this[_0x0bee('0xb')],'openchannelPause':this[_0x0bee('0xd')],'chatStatus':this[_0x0bee('0xe')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x0bee('0x11')],'chatCurrentCapacity':this[_0x0bee('0x12')],'mailStatus':this[_0x0bee('0x2b')],'mailStatusTime':this[_0x0bee('0x2c')],'mailCapacity':this[_0x0bee('0x2d')],'mailCurrentCapacity':this[_0x0bee('0x2e')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0x0bee('0x14')],'faxCapacity':this[_0x0bee('0x15')],'faxCurrentCapacity':this[_0x0bee('0x2f')],'smsStatus':this['smsStatus'],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0x0bee('0x18')],'smsCurrentCapacity':this[_0x0bee('0x30')],'openchannelStatus':this[_0x0bee('0x31')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x0bee('0x1a')],'openchannelCurrentCapacity':this[_0x0bee('0x1b')],'busy':this[_0x0bee('0x1c')],'busyQueue':this['busyQueue']};var _0x5aeb10=md5(JSON['stringify'](_0x24b605));if(this[_0x0bee('0x1e')]!==_0x5aeb10){this[_0x0bee('0x1e')]=_0x5aeb10;io[_0x0bee('0x32')]('user:save',_0x24b605);}};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 146ac51..3e5ffb8 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 _0x7948=['Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','updateRealtime','loggedIn','paused','length','online','chatPause','available','stringify','format','chat:queue:%s','chat_queue:save','exports','lodash','md5','util','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall'];(function(_0x126645,_0x2e33b4){var _0x210941=function(_0x26e5f1){while(--_0x26e5f1){_0x126645['push'](_0x126645['shift']());}};_0x210941(++_0x2e33b4);}(_0x7948,0x18b));var _0x8794=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x7948[_0x5f09c5];return _0x426ad9;};'use strict';var _=require(_0x8794('0x0'));var md5=require(_0x8794('0x1'));var util=require(_0x8794('0x2'));var Redis=require('ioredis');var config=require(_0x8794('0x3'));config[_0x8794('0x4')]=_[_0x8794('0x5')](config[_0x8794('0x4')],{'host':_0x8794('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function ChatQueue(_0x1281ad){this['id']=_0x1281ad['id']||0x0;this[_0x8794('0x7')]=_0x1281ad[_0x8794('0x7')]||'';this[_0x8794('0x8')]=_0x1281ad[_0x8794('0x8')]||0xa;this['strategy']=_0x1281ad[_0x8794('0x9')]||_0x8794('0xa');this[_0x8794('0xb')]=_0x1281ad['Agents'];this[_0x8794('0xc')]={};this[_0x8794('0xd')]=0x0;this[_0x8794('0x1')]='';this[_0x8794('0xe')]();this['updateRealtime']();}ChatQueue[_0x8794('0xf')][_0x8794('0xe')]=function(){var _0xcc13da=this[_0x8794('0xc')][_0x8794('0x10')];this[_0x8794('0xc')]=_['map'](this['Agents'],'id');this['mapAgentsId']['_rr']=_0xcc13da;};ChatQueue[_0x8794('0xf')][_0x8794('0x11')]=function(){this[_0x8794('0x12')]=0x0;this[_0x8794('0x13')]=0x0;for(var _0x4d4cc5=0x0;_0x4d4cc5=0x0?this[_0x8794('0x17')]:0x0;var _0x398d13={'id':this['id'],'available':this[_0x8794('0x17')],'loggedIn':this[_0x8794('0x12')],'name':this[_0x8794('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x3f06b7=md5(JSON[_0x8794('0x18')](_0x398d13));if(this['md5']!==_0x3f06b7){this[_0x8794('0x1')]=_0x3f06b7;io['to'](util[_0x8794('0x19')](_0x8794('0x1a'),_0x398d13[_0x8794('0x7')]))['emit'](_0x8794('0x1b'),_0x398d13);}};module[_0x8794('0x1c')]=ChatQueue; \ No newline at end of file +var _0x1a4f=['updateRouting','mapAgentsId','_rr','map','prototype','updateRealtime','paused','length','online','chatPause','available','loggedIn','format','chat:queue:%s','emit','exports','md5','util','ioredis','../../../config/environment','redis','defaults','name','timeout','strategy','beepall','Agents','waiting'];(function(_0x6173fc,_0x32aadf){var _0x965fbe=function(_0x50d5b3){while(--_0x50d5b3){_0x6173fc['push'](_0x6173fc['shift']());}};_0x965fbe(++_0x32aadf);}(_0x1a4f,0x198));var _0xf1a4=function(_0x3f09ba,_0x4fd917){_0x3f09ba=_0x3f09ba-0x0;var _0x10aa03=_0x1a4f[_0x3f09ba];return _0x10aa03;};'use strict';var _=require('lodash');var md5=require(_0xf1a4('0x0'));var util=require(_0xf1a4('0x1'));var Redis=require(_0xf1a4('0x2'));var config=require(_0xf1a4('0x3'));config[_0xf1a4('0x4')]=_[_0xf1a4('0x5')](config[_0xf1a4('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf1a4('0x4')]));function ChatQueue(_0x303db0){this['id']=_0x303db0['id']||0x0;this[_0xf1a4('0x6')]=_0x303db0[_0xf1a4('0x6')]||'';this[_0xf1a4('0x7')]=_0x303db0[_0xf1a4('0x7')]||0xa;this[_0xf1a4('0x8')]=_0x303db0[_0xf1a4('0x8')]||_0xf1a4('0x9');this['Agents']=_0x303db0[_0xf1a4('0xa')];this['mapAgentsId']={};this[_0xf1a4('0xb')]=0x0;this[_0xf1a4('0x0')]='';this['updateRouting']();this['updateRealtime']();}ChatQueue['prototype'][_0xf1a4('0xc')]=function(){var _0x3dc162=this[_0xf1a4('0xd')][_0xf1a4('0xe')];this['mapAgentsId']=_[_0xf1a4('0xf')](this[_0xf1a4('0xa')],'id');this[_0xf1a4('0xd')][_0xf1a4('0xe')]=_0x3dc162;};ChatQueue[_0xf1a4('0x10')][_0xf1a4('0x11')]=function(){this['loggedIn']=0x0;this[_0xf1a4('0x12')]=0x0;for(var _0x158900=0x0;_0x158900=0x0?this[_0xf1a4('0x16')]:0x0;var _0x5e3435={'id':this['id'],'available':this['available'],'loggedIn':this[_0xf1a4('0x17')],'name':this[_0xf1a4('0x6')],'paused':this[_0xf1a4('0x12')],'waiting':this[_0xf1a4('0xb')]};var _0x3efc84=md5(JSON['stringify'](_0x5e3435));if(this['md5']!==_0x3efc84){this[_0xf1a4('0x0')]=_0x3efc84;io['to'](util[_0xf1a4('0x18')](_0xf1a4('0x19'),_0x5e3435['name']))[_0xf1a4('0x1a')]('chat_queue:save',_0x5e3435);}};module[_0xf1a4('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 3464847..beb76f5 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 _0x6335=['lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','paused','length','online','faxPause','available','stringify','format','fax:queue:%s','emit','fax_queue:save','exports'];(function(_0x13e724,_0x296739){var _0x334a44=function(_0x28f54e){while(--_0x28f54e){_0x13e724['push'](_0x13e724['shift']());}};_0x334a44(++_0x296739);}(_0x6335,0x80));var _0x5633=function(_0x13ccd2,_0x43200e){_0x13ccd2=_0x13ccd2-0x0;var _0x1145b7=_0x6335[_0x13ccd2];return _0x1145b7;};'use strict';var _=require(_0x5633('0x0'));var md5=require(_0x5633('0x1'));var util=require(_0x5633('0x2'));var Redis=require(_0x5633('0x3'));var config=require(_0x5633('0x4'));config[_0x5633('0x5')]=_['defaults'](config[_0x5633('0x5')],{'host':_0x5633('0x6'),'port':0x18eb});var io=require(_0x5633('0x7'))(new Redis(config['redis']));function FaxQueue(_0x105700){this['id']=_0x105700['id']||0x0;this[_0x5633('0x8')]=_0x105700[_0x5633('0x8')]||'';this[_0x5633('0x9')]=_0x105700['timeout']||0xa;this[_0x5633('0xa')]=_0x105700[_0x5633('0xa')]||_0x5633('0xb');this[_0x5633('0xc')]=_0x105700[_0x5633('0xc')];this['mapAgentsId']={};this[_0x5633('0xd')]=0x0;this[_0x5633('0x1')]='';this[_0x5633('0xe')]();this[_0x5633('0xf')]();}FaxQueue[_0x5633('0x10')][_0x5633('0xe')]=function(){var _0xeaa801=this[_0x5633('0x11')][_0x5633('0x12')];this['mapAgentsId']=_[_0x5633('0x13')](this['Agents'],'id');this[_0x5633('0x11')][_0x5633('0x12')]=_0xeaa801;};FaxQueue[_0x5633('0x10')][_0x5633('0xf')]=function(){this[_0x5633('0x14')]=0x0;this[_0x5633('0x15')]=0x0;for(var _0x28234d=0x0;_0x28234d=0x0?this[_0x5633('0x19')]:0x0;var _0x35152d={'id':this['id'],'available':this[_0x5633('0x19')],'loggedIn':this[_0x5633('0x14')],'name':this[_0x5633('0x8')],'paused':this[_0x5633('0x15')],'waiting':this[_0x5633('0xd')]};var _0x56f1a8=md5(JSON[_0x5633('0x1a')](_0x35152d));if(this[_0x5633('0x1')]!==_0x56f1a8){this['md5']=_0x56f1a8;io['to'](util[_0x5633('0x1b')](_0x5633('0x1c'),_0x35152d[_0x5633('0x8')]))[_0x5633('0x1d')](_0x5633('0x1e'),_0x35152d);}};module[_0x5633('0x1f')]=FaxQueue; \ No newline at end of file +var _0xeca9=['socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','loggedIn','length','online','faxPause','available','paused','stringify','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','ioredis','redis','defaults','localhost'];(function(_0x17474a,_0xd1a49c){var _0x3a5495=function(_0x10e1b4){while(--_0x10e1b4){_0x17474a['push'](_0x17474a['shift']());}};_0x3a5495(++_0xd1a49c);}(_0xeca9,0x14e));var _0x9eca=function(_0xed9e71,_0x55bada){_0xed9e71=_0xed9e71-0x0;var _0x1e624a=_0xeca9[_0xed9e71];return _0x1e624a;};'use strict';var _=require(_0x9eca('0x0'));var md5=require(_0x9eca('0x1'));var util=require(_0x9eca('0x2'));var Redis=require(_0x9eca('0x3'));var config=require('../../../config/environment');config[_0x9eca('0x4')]=_[_0x9eca('0x5')](config['redis'],{'host':_0x9eca('0x6'),'port':0x18eb});var io=require(_0x9eca('0x7'))(new Redis(config[_0x9eca('0x4')]));function FaxQueue(_0x57db83){this['id']=_0x57db83['id']||0x0;this[_0x9eca('0x8')]=_0x57db83[_0x9eca('0x8')]||'';this[_0x9eca('0x9')]=_0x57db83[_0x9eca('0x9')]||0xa;this[_0x9eca('0xa')]=_0x57db83[_0x9eca('0xa')]||_0x9eca('0xb');this['Agents']=_0x57db83[_0x9eca('0xc')];this['mapAgentsId']={};this[_0x9eca('0xd')]=0x0;this[_0x9eca('0x1')]='';this[_0x9eca('0xe')]();this[_0x9eca('0xf')]();}FaxQueue[_0x9eca('0x10')][_0x9eca('0xe')]=function(){var _0x6700ff=this[_0x9eca('0x11')]['_rr'];this[_0x9eca('0x11')]=_['map'](this['Agents'],'id');this[_0x9eca('0x11')][_0x9eca('0x12')]=_0x6700ff;};FaxQueue[_0x9eca('0x10')][_0x9eca('0xf')]=function(){this[_0x9eca('0x13')]=0x0;this['paused']=0x0;for(var _0x599319=0x0;_0x599319=0x0?this['available']:0x0;var _0xb85fb9={'id':this['id'],'available':this[_0x9eca('0x17')],'loggedIn':this[_0x9eca('0x13')],'name':this['name'],'paused':this[_0x9eca('0x18')],'waiting':this[_0x9eca('0xd')]};var _0x2c11f5=md5(JSON[_0x9eca('0x19')](_0xb85fb9));if(this[_0x9eca('0x1')]!==_0x2c11f5){this[_0x9eca('0x1')]=_0x2c11f5;io['to'](util[_0x9eca('0x1a')](_0x9eca('0x1b'),_0xb85fb9[_0x9eca('0x8')]))[_0x9eca('0x1c')](_0x9eca('0x1d'),_0xb85fb9);}};module[_0x9eca('0x1e')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 7a0a91c..1fa32d7 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 _0x0fc7=['Intervals','exports','name'];(function(_0x48fb76,_0x1411e9){var _0x2f1956=function(_0x9f38f6){while(--_0x9f38f6){_0x48fb76['push'](_0x48fb76['shift']());}};_0x2f1956(++_0x1411e9);}(_0x0fc7,0x95));var _0x70fc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0fc7[_0x3dd15e];return _0x231fd0;};'use strict';function Interval(_0x43f24b){this['id']=_0x43f24b['id']||0x0;this['name']=_0x43f24b[_0x70fc('0x0')]||'';this[_0x70fc('0x1')]=_0x43f24b[_0x70fc('0x1')]||{};}module[_0x70fc('0x2')]=Interval; \ No newline at end of file +var _0x2080=['exports','name','Intervals'];(function(_0x2e97d4,_0x2b5781){var _0x1d2d44=function(_0x31dc7b){while(--_0x31dc7b){_0x2e97d4['push'](_0x2e97d4['shift']());}};_0x1d2d44(++_0x2b5781);}(_0x2080,0x19f));var _0x0208=function(_0x5eb456,_0x11789b){_0x5eb456=_0x5eb456-0x0;var _0x435279=_0x2080[_0x5eb456];return _0x435279;};'use strict';function Interval(_0x124783){this['id']=_0x124783['id']||0x0;this['name']=_0x124783[_0x0208('0x0')]||'';this[_0x0208('0x1')]=_0x124783[_0x0208('0x1')]||{};}module[_0x0208('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 5db8e76..73e5f73 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 _0xabce=['beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','mailPause','available','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy'];(function(_0x38494c,_0x5393f5){var _0x591aec=function(_0x1ac449){while(--_0x1ac449){_0x38494c['push'](_0x38494c['shift']());}};_0x591aec(++_0x5393f5);}(_0xabce,0x103));var _0xeabc=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xabce[_0x2160a9];return _0xa88cf7;};'use strict';var _=require(_0xeabc('0x0'));var md5=require(_0xeabc('0x1'));var util=require(_0xeabc('0x2'));var Redis=require(_0xeabc('0x3'));var config=require(_0xeabc('0x4'));config['redis']=_['defaults'](config[_0xeabc('0x5')],{'host':_0xeabc('0x6'),'port':0x18eb});var io=require(_0xeabc('0x7'))(new Redis(config['redis']));function MailQueue(_0x54e4a8){this['id']=_0x54e4a8['id']||0x0;this[_0xeabc('0x8')]=_0x54e4a8['name']||'';this[_0xeabc('0x9')]=_0x54e4a8['timeout']||0xa;this[_0xeabc('0xa')]=_0x54e4a8[_0xeabc('0xa')]||_0xeabc('0xb');this['Agents']=_0x54e4a8[_0xeabc('0xc')];this[_0xeabc('0xd')]={};this[_0xeabc('0xe')]=0x0;this[_0xeabc('0x1')]='';this[_0xeabc('0xf')]();this[_0xeabc('0x10')]();}MailQueue[_0xeabc('0x11')][_0xeabc('0xf')]=function(){var _0xdb5022=this[_0xeabc('0xd')][_0xeabc('0x12')];this[_0xeabc('0xd')]=_[_0xeabc('0x13')](this[_0xeabc('0xc')],'id');this[_0xeabc('0xd')][_0xeabc('0x12')]=_0xdb5022;};MailQueue['prototype'][_0xeabc('0x10')]=function(){this[_0xeabc('0x14')]=0x0;this[_0xeabc('0x15')]=0x0;for(var _0x55f0de=0x0;_0x55f0de=0x0?this[_0xeabc('0x19')]:0x0;var _0x16f08b={'id':this['id'],'available':this[_0xeabc('0x19')],'loggedIn':this[_0xeabc('0x14')],'name':this[_0xeabc('0x8')],'paused':this[_0xeabc('0x15')],'waiting':this['waiting']};var _0x1253e4=md5(JSON['stringify'](_0x16f08b));if(this[_0xeabc('0x1')]!==_0x1253e4){this[_0xeabc('0x1')]=_0x1253e4;io['to'](util['format'](_0xeabc('0x1a'),_0x16f08b[_0xeabc('0x8')]))[_0xeabc('0x1b')](_0xeabc('0x1c'),_0x16f08b);}};module[_0xeabc('0x1d')]=MailQueue; \ No newline at end of file +var _0xa701=['socket.io-emitter','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','mapAgentsId','map','prototype','loggedIn','length','online','mailPause','available','name','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','md5','util','redis','localhost'];(function(_0x4811ab,_0x1ab7d5){var _0x377174=function(_0x3cb2c3){while(--_0x3cb2c3){_0x4811ab['push'](_0x4811ab['shift']());}};_0x377174(++_0x1ab7d5);}(_0xa701,0xd4));var _0x1a70=function(_0x16121b,_0x3cf212){_0x16121b=_0x16121b-0x0;var _0x312661=_0xa701[_0x16121b];return _0x312661;};'use strict';var _=require('lodash');var md5=require(_0x1a70('0x0'));var util=require(_0x1a70('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x1a70('0x2')]=_['defaults'](config['redis'],{'host':_0x1a70('0x3'),'port':0x18eb});var io=require(_0x1a70('0x4'))(new Redis(config[_0x1a70('0x2')]));function MailQueue(_0xf76760){this['id']=_0xf76760['id']||0x0;this['name']=_0xf76760['name']||'';this[_0x1a70('0x5')]=_0xf76760[_0x1a70('0x5')]||0xa;this[_0x1a70('0x6')]=_0xf76760[_0x1a70('0x6')]||_0x1a70('0x7');this[_0x1a70('0x8')]=_0xf76760[_0x1a70('0x8')];this['mapAgentsId']={};this[_0x1a70('0x9')]=0x0;this[_0x1a70('0x0')]='';this[_0x1a70('0xa')]();this[_0x1a70('0xb')]();}MailQueue['prototype'][_0x1a70('0xa')]=function(){var _0x4305bd=this[_0x1a70('0xc')]['_rr'];this['mapAgentsId']=_[_0x1a70('0xd')](this['Agents'],'id');this[_0x1a70('0xc')]['_rr']=_0x4305bd;};MailQueue[_0x1a70('0xe')]['updateRealtime']=function(){this[_0x1a70('0xf')]=0x0;this['paused']=0x0;for(var _0x4c1b7f=0x0;_0x4c1b7f=0x0?this[_0x1a70('0x13')]:0x0;var _0xcb545c={'id':this['id'],'available':this['available'],'loggedIn':this[_0x1a70('0xf')],'name':this[_0x1a70('0x14')],'paused':this['paused'],'waiting':this['waiting']};var _0x12e24d=md5(JSON[_0x1a70('0x15')](_0xcb545c));if(this[_0x1a70('0x0')]!==_0x12e24d){this[_0x1a70('0x0')]=_0x12e24d;io['to'](util[_0x1a70('0x16')](_0x1a70('0x17'),_0xcb545c[_0x1a70('0x14')]))[_0x1a70('0x18')](_0x1a70('0x19'),_0xcb545c);}};module[_0x1a70('0x1a')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 2365715..14231cd 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 _0x34f2=['waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','paused','length','online','available','stringify','openchannel:queue:%s','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','strategy','beepall','Agents'];(function(_0x5e2862,_0x4760eb){var _0x8dcad4=function(_0x205ddf){while(--_0x205ddf){_0x5e2862['push'](_0x5e2862['shift']());}};_0x8dcad4(++_0x4760eb);}(_0x34f2,0x160));var _0x234f=function(_0x3c7ec4,_0x2228b8){_0x3c7ec4=_0x3c7ec4-0x0;var _0x5c52d7=_0x34f2[_0x3c7ec4];return _0x5c52d7;};'use strict';var _=require(_0x234f('0x0'));var md5=require(_0x234f('0x1'));var util=require(_0x234f('0x2'));var Redis=require(_0x234f('0x3'));var config=require(_0x234f('0x4'));config[_0x234f('0x5')]=_['defaults'](config[_0x234f('0x5')],{'host':_0x234f('0x6'),'port':0x18eb});var io=require(_0x234f('0x7'))(new Redis(config[_0x234f('0x5')]));function OpenchannelQueue(_0x4417bf){this['id']=_0x4417bf['id']||0x0;this[_0x234f('0x8')]=_0x4417bf['name']||'';this['timeout']=_0x4417bf['timeout']||0xa;this[_0x234f('0x9')]=_0x4417bf[_0x234f('0x9')]||_0x234f('0xa');this[_0x234f('0xb')]=_0x4417bf['Agents'];this['mapAgentsId']={};this[_0x234f('0xc')]=0x0;this['md5']='';this[_0x234f('0xd')]();this[_0x234f('0xe')]();}OpenchannelQueue[_0x234f('0xf')][_0x234f('0xd')]=function(){var _0x1ca5f9=this[_0x234f('0x10')][_0x234f('0x11')];this[_0x234f('0x10')]=_[_0x234f('0x12')](this[_0x234f('0xb')],'id');this['mapAgentsId']['_rr']=_0x1ca5f9;};OpenchannelQueue[_0x234f('0xf')]['updateRealtime']=function(){this[_0x234f('0x13')]=0x0;this[_0x234f('0x14')]=0x0;for(var _0x76f6cc=0x0;_0x76f6cc=0x0?this['available']:0x0;var _0x1b268f={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x234f('0x8')],'paused':this[_0x234f('0x14')],'waiting':this[_0x234f('0xc')]};var _0x5503af=md5(JSON[_0x234f('0x18')](_0x1b268f));if(this['md5']!==_0x5503af){this[_0x234f('0x1')]=_0x5503af;io['to'](util['format'](_0x234f('0x19'),_0x1b268f[_0x234f('0x8')]))['emit'](_0x234f('0x1a'),_0x1b268f);}};module[_0x234f('0x1b')]=OpenchannelQueue; \ No newline at end of file +var _0x0bf4=['paused','length','online','openchannelPause','available','waiting','stringify','format','openchannel:queue:%s','emit','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','strategy','beepall','Agents','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn'];(function(_0x31dd84,_0x271b28){var _0x44c128=function(_0x126340){while(--_0x126340){_0x31dd84['push'](_0x31dd84['shift']());}};_0x44c128(++_0x271b28);}(_0x0bf4,0x103));var _0x40bf=function(_0x481604,_0x276ff8){_0x481604=_0x481604-0x0;var _0x1ca4ed=_0x0bf4[_0x481604];return _0x1ca4ed;};'use strict';var _=require(_0x40bf('0x0'));var md5=require(_0x40bf('0x1'));var util=require(_0x40bf('0x2'));var Redis=require(_0x40bf('0x3'));var config=require(_0x40bf('0x4'));config[_0x40bf('0x5')]=_[_0x40bf('0x6')](config['redis'],{'host':_0x40bf('0x7'),'port':0x18eb});var io=require(_0x40bf('0x8'))(new Redis(config[_0x40bf('0x5')]));function OpenchannelQueue(_0x420c91){this['id']=_0x420c91['id']||0x0;this[_0x40bf('0x9')]=_0x420c91[_0x40bf('0x9')]||'';this['timeout']=_0x420c91['timeout']||0xa;this[_0x40bf('0xa')]=_0x420c91[_0x40bf('0xa')]||_0x40bf('0xb');this[_0x40bf('0xc')]=_0x420c91[_0x40bf('0xc')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x40bf('0x1')]='';this[_0x40bf('0xd')]();this[_0x40bf('0xe')]();}OpenchannelQueue[_0x40bf('0xf')][_0x40bf('0xd')]=function(){var _0x2ca2a1=this[_0x40bf('0x10')][_0x40bf('0x11')];this[_0x40bf('0x10')]=_[_0x40bf('0x12')](this['Agents'],'id');this[_0x40bf('0x10')]['_rr']=_0x2ca2a1;};OpenchannelQueue[_0x40bf('0xf')][_0x40bf('0xe')]=function(){this[_0x40bf('0x13')]=0x0;this[_0x40bf('0x14')]=0x0;for(var _0x499769=0x0;_0x499769=0x0?this[_0x40bf('0x18')]:0x0;var _0x2bc1de={'id':this['id'],'available':this[_0x40bf('0x18')],'loggedIn':this[_0x40bf('0x13')],'name':this[_0x40bf('0x9')],'paused':this[_0x40bf('0x14')],'waiting':this[_0x40bf('0x19')]};var _0x41ba9d=md5(JSON[_0x40bf('0x1a')](_0x2bc1de));if(this[_0x40bf('0x1')]!==_0x41ba9d){this[_0x40bf('0x1')]=_0x41ba9d;io['to'](util[_0x40bf('0x1b')](_0x40bf('0x1c'),_0x2bc1de['name']))[_0x40bf('0x1d')]('openchannel_queue:save',_0x2bc1de);}};module[_0x40bf('0x1e')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index d257b7f..8402dbc 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 _0x5676=['emit','sms_queue:save','util','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','beepall','Agents','mapAgentsId','waiting','md5','updateRealtime','_rr','map','prototype','loggedIn','length','smsPause','paused','available','stringify','format','sms:queue:%s'];(function(_0x14f373,_0x3defcf){var _0x4ca198=function(_0x427aaa){while(--_0x427aaa){_0x14f373['push'](_0x14f373['shift']());}};_0x4ca198(++_0x3defcf);}(_0x5676,0x188));var _0x6567=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x5676[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x6567('0x0'));var Redis=require('ioredis');var config=require(_0x6567('0x1'));config[_0x6567('0x2')]=_[_0x6567('0x3')](config[_0x6567('0x2')],{'host':'localhost','port':0x18eb});var io=require(_0x6567('0x4'))(new Redis(config[_0x6567('0x2')]));function SmsQueue(_0x4b78b9){this['id']=_0x4b78b9['id']||0x0;this['name']=_0x4b78b9[_0x6567('0x5')]||'';this[_0x6567('0x6')]=_0x4b78b9[_0x6567('0x6')]||0xa;this['strategy']=_0x4b78b9['strategy']||_0x6567('0x7');this[_0x6567('0x8')]=_0x4b78b9[_0x6567('0x8')];this[_0x6567('0x9')]={};this[_0x6567('0xa')]=0x0;this[_0x6567('0xb')]='';this['updateRouting']();this[_0x6567('0xc')]();}SmsQueue['prototype']['updateRouting']=function(){var _0x174376=this[_0x6567('0x9')][_0x6567('0xd')];this[_0x6567('0x9')]=_[_0x6567('0xe')](this[_0x6567('0x8')],'id');this[_0x6567('0x9')][_0x6567('0xd')]=_0x174376;};SmsQueue[_0x6567('0xf')][_0x6567('0xc')]=function(){this[_0x6567('0x10')]=0x0;this['paused']=0x0;for(var _0x44af7a=0x0;_0x44af7a=0x0?this[_0x6567('0x14')]:0x0;var _0x3787de={'id':this['id'],'available':this[_0x6567('0x14')],'loggedIn':this['loggedIn'],'name':this[_0x6567('0x5')],'paused':this[_0x6567('0x13')],'waiting':this[_0x6567('0xa')]};var _0x1527a7=md5(JSON[_0x6567('0x15')](_0x3787de));if(this[_0x6567('0xb')]!==_0x1527a7){this['md5']=_0x1527a7;io['to'](util[_0x6567('0x16')](_0x6567('0x17'),_0x3787de[_0x6567('0x5')]))[_0x6567('0x18')](_0x6567('0x19'),_0x3787de);}};module['exports']=SmsQueue; \ No newline at end of file +var _0x2894=['beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','online','available','format','sms:queue:%s','sms_queue:save','lodash','md5','ioredis','../../../config/environment','defaults','localhost','socket.io-emitter','redis','name','timeout','strategy'];(function(_0x42eadd,_0x27b652){var _0x52a1b8=function(_0x103ccb){while(--_0x103ccb){_0x42eadd['push'](_0x42eadd['shift']());}};_0x52a1b8(++_0x27b652);}(_0x2894,0xb2));var _0x4289=function(_0x11668c,_0x1913b1){_0x11668c=_0x11668c-0x0;var _0x354c9b=_0x2894[_0x11668c];return _0x354c9b;};'use strict';var _=require(_0x4289('0x0'));var md5=require(_0x4289('0x1'));var util=require('util');var Redis=require(_0x4289('0x2'));var config=require(_0x4289('0x3'));config['redis']=_[_0x4289('0x4')](config['redis'],{'host':_0x4289('0x5'),'port':0x18eb});var io=require(_0x4289('0x6'))(new Redis(config[_0x4289('0x7')]));function SmsQueue(_0x1f7dc8){this['id']=_0x1f7dc8['id']||0x0;this[_0x4289('0x8')]=_0x1f7dc8[_0x4289('0x8')]||'';this['timeout']=_0x1f7dc8[_0x4289('0x9')]||0xa;this[_0x4289('0xa')]=_0x1f7dc8['strategy']||_0x4289('0xb');this[_0x4289('0xc')]=_0x1f7dc8['Agents'];this[_0x4289('0xd')]={};this[_0x4289('0xe')]=0x0;this[_0x4289('0x1')]='';this[_0x4289('0xf')]();this[_0x4289('0x10')]();}SmsQueue[_0x4289('0x11')][_0x4289('0xf')]=function(){var _0x9e0039=this[_0x4289('0xd')][_0x4289('0x12')];this[_0x4289('0xd')]=_['map'](this[_0x4289('0xc')],'id');this[_0x4289('0xd')][_0x4289('0x12')]=_0x9e0039;};SmsQueue[_0x4289('0x11')][_0x4289('0x10')]=function(){this[_0x4289('0x13')]=0x0;this[_0x4289('0x14')]=0x0;for(var _0x6d6c9d=0x0;_0x6d6c9d=0x0?this[_0x4289('0x17')]:0x0;var _0x2c0183={'id':this['id'],'available':this[_0x4289('0x17')],'loggedIn':this[_0x4289('0x13')],'name':this[_0x4289('0x8')],'paused':this[_0x4289('0x14')],'waiting':this[_0x4289('0xe')]};var _0x1c3f77=md5(JSON['stringify'](_0x2c0183));if(this['md5']!==_0x1c3f77){this['md5']=_0x1c3f77;io['to'](util[_0x4289('0x18')](_0x4289('0x19'),_0x2c0183[_0x4289('0x8')]))['emit'](_0x4289('0x1a'),_0x2c0183);}};module['exports']=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 7c1ed8b..bb17ac1 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 _0x92b5=['exports','bluebird','util','lodash','moment','../model/chatQueue','../model/mailQueue','agents','intervals','smsQueues','mailQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','prototype','mergeFromDatabase','hasOwnProperty','initAgents','length','initOpenchannelQueues','openchannelQueues','isUndefined','initChatQueues','chatQueues','updateRouting','updateRealtime','initSmsQueues','initMailQueues','initFaxQueues'];(function(_0x4cab1e,_0xfc5cde){var _0x1a8cd8=function(_0x2ce2b6){while(--_0x2ce2b6){_0x4cab1e['push'](_0x4cab1e['shift']());}};_0x1a8cd8(++_0xfc5cde);}(_0x92b5,0x7d));var _0x592b=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x92b5[_0x15bc81];return _0x59440e;};'use strict';var BPromise=require(_0x592b('0x0'));var util=require(_0x592b('0x1'));var _=require(_0x592b('0x2'));var moment=require(_0x592b('0x3'));var Agent=require('../model/agent');var Interval=require('../model/interval');var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x592b('0x4'));var SmsQueue=require('../model/smsQueue');var MailQueue=require(_0x592b('0x5'));var FaxQueue=require('../model/faxQueue');var Realtime=function(){this[_0x592b('0x6')]={};this[_0x592b('0x7')]={};this['openchannelQueues']={};this['chatQueues']={};this[_0x592b('0x8')]={};this[_0x592b('0x9')]={};this[_0x592b('0xa')]={};this[_0x592b('0xb')]={};this[_0x592b('0xc')]={};this['openchannelQueuesWaitingInteractions']={};this[_0x592b('0xd')]={};this[_0x592b('0xe')]={};};function freeIsNotKey(_0x167f00,_0x1b162e,_0x12667b){var _0x172cc0=_['mapKeys'](_0x167f00,function(_0x53003e,_0x273ab7){return _0x53003e[_0x12667b];});for(var _0x1cc4da in _0x1b162e){if(_0x1b162e['hasOwnProperty'](_0x1cc4da)){if(!_0x172cc0[_0x1cc4da]){delete _0x1b162e[_0x1cc4da];}}}}Realtime[_0x592b('0xf')][_0x592b('0x10')]=function(_0x414406,_0x5700db){for(var _0x42deef in _0x5700db){if(_0x414406[_0x592b('0x11')](_0x42deef)){_0x414406[_0x42deef]=_0x5700db[_0x42deef];}}};Realtime[_0x592b('0xf')][_0x592b('0x12')]=function(){var _0x89f4c7=this;return function(_0x55667f){if(_0x55667f){freeIsNotKey(_0x55667f,_0x89f4c7[_0x592b('0x6')],'id');for(var _0x588b19=0x0,_0x34fd2a={},_0x4bf2ac={};_0x588b19<_0x55667f[_0x592b('0x13')];_0x588b19+=0x1){_0x34fd2a=_0x55667f[_0x588b19];if(_['isUndefined'](_0x89f4c7[_0x592b('0x6')][_0x34fd2a['id']])){_0x89f4c7[_0x592b('0x6')][_0x34fd2a['id']]=new Agent(_0x34fd2a);}else{_0x89f4c7[_0x592b('0x10')](_0x89f4c7[_0x592b('0x6')][_0x34fd2a['id']],_0x34fd2a);}}}return _0x89f4c7['agents'];};};Realtime[_0x592b('0xf')]['initIntervals']=function(){var _0x2bb445=this;return function(_0x51f332){if(_0x51f332){freeIsNotKey(_0x51f332,_0x2bb445[_0x592b('0x7')],'id');for(var _0x57266c=0x0,_0x5ec196={},_0x3e5954={};_0x57266c<_0x51f332[_0x592b('0x13')];_0x57266c+=0x1){_0x5ec196=_0x51f332[_0x57266c];if(_['isUndefined'](_0x2bb445[_0x592b('0x7')][_0x5ec196['id']])){_0x2bb445[_0x592b('0x7')][_0x5ec196['id']]=new Interval(_0x5ec196);}else{_0x2bb445['mergeFromDatabase'](_0x2bb445[_0x592b('0x7')][_0x5ec196['id']],_0x5ec196);}}}return _0x2bb445['intervals'];};};Realtime['prototype'][_0x592b('0x14')]=function(){var _0x3af10d=this;return function(_0x275d17){if(_0x275d17){freeIsNotKey(_0x275d17,_0x3af10d[_0x592b('0x15')],'id');for(var _0x3ef7a9=0x0,_0x749acb={},_0x48689b={};_0x3ef7a9<_0x275d17[_0x592b('0x13')];_0x3ef7a9+=0x1){_0x749acb=_0x275d17[_0x3ef7a9];if(_[_0x592b('0x16')](_0x3af10d['openchannelQueues'][_0x749acb['id']])){_0x3af10d[_0x592b('0x15')][_0x749acb['id']]=new OpenchannelQueue(_0x749acb);}else{_0x3af10d[_0x592b('0x10')](_0x3af10d[_0x592b('0x15')][_0x749acb['id']],_0x749acb);}_0x3af10d[_0x592b('0x15')][_0x749acb['id']]['updateRouting']();_0x3af10d['openchannelQueues'][_0x749acb['id']]['updateRealtime']();}}return _0x3af10d[_0x592b('0x15')];};};Realtime['prototype'][_0x592b('0x17')]=function(){var _0x5d9b04=this;return function(_0x24a099){if(_0x24a099){freeIsNotKey(_0x24a099,_0x5d9b04['chatQueues'],'id');for(var _0x38ebab=0x0,_0x59efd7={},_0x1016d0={};_0x38ebab<_0x24a099['length'];_0x38ebab+=0x1){_0x59efd7=_0x24a099[_0x38ebab];if(_[_0x592b('0x16')](_0x5d9b04['chatQueues'][_0x59efd7['id']])){_0x5d9b04[_0x592b('0x18')][_0x59efd7['id']]=new ChatQueue(_0x59efd7);}else{_0x5d9b04[_0x592b('0x10')](_0x5d9b04[_0x592b('0x18')][_0x59efd7['id']],_0x59efd7);}_0x5d9b04[_0x592b('0x18')][_0x59efd7['id']][_0x592b('0x19')]();_0x5d9b04[_0x592b('0x18')][_0x59efd7['id']][_0x592b('0x1a')]();}}return _0x5d9b04[_0x592b('0x18')];};};Realtime['prototype'][_0x592b('0x1b')]=function(){var _0xa4f19a=this;return function(_0x23bcc6){if(_0x23bcc6){freeIsNotKey(_0x23bcc6,_0xa4f19a[_0x592b('0x8')],'id');for(var _0x45cc19=0x0,_0x2653ad={},_0x4fe5d9={};_0x45cc19<_0x23bcc6[_0x592b('0x13')];_0x45cc19+=0x1){_0x2653ad=_0x23bcc6[_0x45cc19];if(_[_0x592b('0x16')](_0xa4f19a[_0x592b('0x8')][_0x2653ad['id']])){_0xa4f19a[_0x592b('0x8')][_0x2653ad['id']]=new SmsQueue(_0x2653ad);}else{_0xa4f19a[_0x592b('0x10')](_0xa4f19a['smsQueues'][_0x2653ad['id']],_0x2653ad);}_0xa4f19a[_0x592b('0x8')][_0x2653ad['id']][_0x592b('0x19')]();_0xa4f19a['smsQueues'][_0x2653ad['id']][_0x592b('0x1a')]();}}return _0xa4f19a[_0x592b('0x8')];};};Realtime[_0x592b('0xf')][_0x592b('0x1c')]=function(){var _0x2cf646=this;return function(_0x314449){if(_0x314449){freeIsNotKey(_0x314449,_0x2cf646[_0x592b('0x9')],'id');for(var _0x4df5a5=0x0,_0x43eb78={},_0x3d7eda={};_0x4df5a5<_0x314449[_0x592b('0x13')];_0x4df5a5+=0x1){_0x43eb78=_0x314449[_0x4df5a5];if(_['isUndefined'](_0x2cf646[_0x592b('0x9')][_0x43eb78['id']])){_0x2cf646[_0x592b('0x9')][_0x43eb78['id']]=new MailQueue(_0x43eb78);}else{_0x2cf646[_0x592b('0x10')](_0x2cf646['mailQueues'][_0x43eb78['id']],_0x43eb78);}_0x2cf646[_0x592b('0x9')][_0x43eb78['id']][_0x592b('0x19')]();_0x2cf646[_0x592b('0x9')][_0x43eb78['id']]['updateRealtime']();}}return _0x2cf646[_0x592b('0x9')];};};Realtime[_0x592b('0xf')][_0x592b('0x1d')]=function(){var _0x3f6480=this;return function(_0x30167b){if(_0x30167b){freeIsNotKey(_0x30167b,_0x3f6480[_0x592b('0xa')],'id');for(var _0x386ba6=0x0,_0x281535={},_0x1b2006={};_0x386ba6<_0x30167b[_0x592b('0x13')];_0x386ba6+=0x1){_0x281535=_0x30167b[_0x386ba6];if(_[_0x592b('0x16')](_0x3f6480[_0x592b('0xa')][_0x281535['id']])){_0x3f6480[_0x592b('0xa')][_0x281535['id']]=new FaxQueue(_0x281535);}else{_0x3f6480[_0x592b('0x10')](_0x3f6480[_0x592b('0xa')][_0x281535['id']],_0x281535);}_0x3f6480['faxQueues'][_0x281535['id']]['updateRouting']();_0x3f6480['faxQueues'][_0x281535['id']][_0x592b('0x1a')]();}}return _0x3f6480[_0x592b('0xa')];};};module[_0x592b('0x1e')]=Realtime; \ No newline at end of file +var _0x48e6=['exports','bluebird','util','lodash','../model/agent','../model/interval','../model/openchannelQueue','../model/chatQueue','../model/faxQueue','agents','openchannelQueues','mailQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','faxQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','length','isUndefined','initIntervals','intervals','initOpenchannelQueues','updateRouting','updateRealtime','initChatQueues','chatQueues','smsQueues','initMailQueues','initFaxQueues'];(function(_0x5ad5fc,_0x4cc540){var _0x61fe4f=function(_0x65fe3a){while(--_0x65fe3a){_0x5ad5fc['push'](_0x5ad5fc['shift']());}};_0x61fe4f(++_0x4cc540);}(_0x48e6,0x85));var _0x648e=function(_0x39f0d2,_0x4ecbc3){_0x39f0d2=_0x39f0d2-0x0;var _0x3be2bf=_0x48e6[_0x39f0d2];return _0x3be2bf;};'use strict';var BPromise=require(_0x648e('0x0'));var util=require(_0x648e('0x1'));var _=require(_0x648e('0x2'));var moment=require('moment');var Agent=require(_0x648e('0x3'));var Interval=require(_0x648e('0x4'));var OpenchannelQueue=require(_0x648e('0x5'));var ChatQueue=require(_0x648e('0x6'));var SmsQueue=require('../model/smsQueue');var MailQueue=require('../model/mailQueue');var FaxQueue=require(_0x648e('0x7'));var Realtime=function(){this[_0x648e('0x8')]={};this['intervals']={};this[_0x648e('0x9')]={};this['chatQueues']={};this['smsQueues']={};this[_0x648e('0xa')]={};this[_0x648e('0xb')]={};this[_0x648e('0xc')]={};this[_0x648e('0xd')]={};this['openchannelQueuesWaitingInteractions']={};this['smsQueuesWaitingInteractions']={};this[_0x648e('0xe')]={};};function freeIsNotKey(_0x3f4506,_0x43259d,_0x247e51){var _0x451398=_[_0x648e('0xf')](_0x3f4506,function(_0xc2b867,_0x1ec309){return _0xc2b867[_0x247e51];});for(var _0x4aea2b in _0x43259d){if(_0x43259d[_0x648e('0x10')](_0x4aea2b)){if(!_0x451398[_0x4aea2b]){delete _0x43259d[_0x4aea2b];}}}}Realtime[_0x648e('0x11')][_0x648e('0x12')]=function(_0x3d505f,_0x59a28d){for(var _0x2ce8ed in _0x59a28d){if(_0x3d505f['hasOwnProperty'](_0x2ce8ed)){_0x3d505f[_0x2ce8ed]=_0x59a28d[_0x2ce8ed];}}};Realtime[_0x648e('0x11')][_0x648e('0x13')]=function(){var _0x11cf92=this;return function(_0x279892){if(_0x279892){freeIsNotKey(_0x279892,_0x11cf92['agents'],'id');for(var _0x376ef7=0x0,_0x5d005d={},_0x53c47a={};_0x376ef7<_0x279892[_0x648e('0x14')];_0x376ef7+=0x1){_0x5d005d=_0x279892[_0x376ef7];if(_[_0x648e('0x15')](_0x11cf92['agents'][_0x5d005d['id']])){_0x11cf92[_0x648e('0x8')][_0x5d005d['id']]=new Agent(_0x5d005d);}else{_0x11cf92[_0x648e('0x12')](_0x11cf92[_0x648e('0x8')][_0x5d005d['id']],_0x5d005d);}}}return _0x11cf92['agents'];};};Realtime[_0x648e('0x11')][_0x648e('0x16')]=function(){var _0x3ac4cb=this;return function(_0x471949){if(_0x471949){freeIsNotKey(_0x471949,_0x3ac4cb[_0x648e('0x17')],'id');for(var _0x2882eb=0x0,_0x69cd74={},_0x3be5e3={};_0x2882eb<_0x471949['length'];_0x2882eb+=0x1){_0x69cd74=_0x471949[_0x2882eb];if(_[_0x648e('0x15')](_0x3ac4cb['intervals'][_0x69cd74['id']])){_0x3ac4cb[_0x648e('0x17')][_0x69cd74['id']]=new Interval(_0x69cd74);}else{_0x3ac4cb['mergeFromDatabase'](_0x3ac4cb[_0x648e('0x17')][_0x69cd74['id']],_0x69cd74);}}}return _0x3ac4cb[_0x648e('0x17')];};};Realtime[_0x648e('0x11')][_0x648e('0x18')]=function(){var _0x1056f=this;return function(_0x90501e){if(_0x90501e){freeIsNotKey(_0x90501e,_0x1056f[_0x648e('0x9')],'id');for(var _0x3add59=0x0,_0x132e03={},_0x4d4037={};_0x3add59<_0x90501e[_0x648e('0x14')];_0x3add59+=0x1){_0x132e03=_0x90501e[_0x3add59];if(_[_0x648e('0x15')](_0x1056f[_0x648e('0x9')][_0x132e03['id']])){_0x1056f['openchannelQueues'][_0x132e03['id']]=new OpenchannelQueue(_0x132e03);}else{_0x1056f['mergeFromDatabase'](_0x1056f[_0x648e('0x9')][_0x132e03['id']],_0x132e03);}_0x1056f[_0x648e('0x9')][_0x132e03['id']][_0x648e('0x19')]();_0x1056f[_0x648e('0x9')][_0x132e03['id']][_0x648e('0x1a')]();}}return _0x1056f[_0x648e('0x9')];};};Realtime[_0x648e('0x11')][_0x648e('0x1b')]=function(){var _0x25767d=this;return function(_0x4703df){if(_0x4703df){freeIsNotKey(_0x4703df,_0x25767d[_0x648e('0x1c')],'id');for(var _0xaf1f92=0x0,_0x5e8257={},_0x479f41={};_0xaf1f92<_0x4703df[_0x648e('0x14')];_0xaf1f92+=0x1){_0x5e8257=_0x4703df[_0xaf1f92];if(_[_0x648e('0x15')](_0x25767d[_0x648e('0x1c')][_0x5e8257['id']])){_0x25767d[_0x648e('0x1c')][_0x5e8257['id']]=new ChatQueue(_0x5e8257);}else{_0x25767d[_0x648e('0x12')](_0x25767d['chatQueues'][_0x5e8257['id']],_0x5e8257);}_0x25767d[_0x648e('0x1c')][_0x5e8257['id']][_0x648e('0x19')]();_0x25767d[_0x648e('0x1c')][_0x5e8257['id']][_0x648e('0x1a')]();}}return _0x25767d['chatQueues'];};};Realtime[_0x648e('0x11')]['initSmsQueues']=function(){var _0x463228=this;return function(_0x350c74){if(_0x350c74){freeIsNotKey(_0x350c74,_0x463228[_0x648e('0x1d')],'id');for(var _0x4fbdf3=0x0,_0x52a9de={},_0x359846={};_0x4fbdf3<_0x350c74[_0x648e('0x14')];_0x4fbdf3+=0x1){_0x52a9de=_0x350c74[_0x4fbdf3];if(_['isUndefined'](_0x463228[_0x648e('0x1d')][_0x52a9de['id']])){_0x463228[_0x648e('0x1d')][_0x52a9de['id']]=new SmsQueue(_0x52a9de);}else{_0x463228['mergeFromDatabase'](_0x463228[_0x648e('0x1d')][_0x52a9de['id']],_0x52a9de);}_0x463228[_0x648e('0x1d')][_0x52a9de['id']][_0x648e('0x19')]();_0x463228[_0x648e('0x1d')][_0x52a9de['id']]['updateRealtime']();}}return _0x463228[_0x648e('0x1d')];};};Realtime[_0x648e('0x11')][_0x648e('0x1e')]=function(){var _0x3e42f5=this;return function(_0x24c435){if(_0x24c435){freeIsNotKey(_0x24c435,_0x3e42f5['mailQueues'],'id');for(var _0xd80c59=0x0,_0x38426e={},_0x3c8ce5={};_0xd80c59<_0x24c435[_0x648e('0x14')];_0xd80c59+=0x1){_0x38426e=_0x24c435[_0xd80c59];if(_[_0x648e('0x15')](_0x3e42f5[_0x648e('0xa')][_0x38426e['id']])){_0x3e42f5['mailQueues'][_0x38426e['id']]=new MailQueue(_0x38426e);}else{_0x3e42f5['mergeFromDatabase'](_0x3e42f5[_0x648e('0xa')][_0x38426e['id']],_0x38426e);}_0x3e42f5[_0x648e('0xa')][_0x38426e['id']]['updateRouting']();_0x3e42f5[_0x648e('0xa')][_0x38426e['id']][_0x648e('0x1a')]();}}return _0x3e42f5[_0x648e('0xa')];};};Realtime[_0x648e('0x11')][_0x648e('0x1f')]=function(){var _0x57efba=this;return function(_0x1f52f3){if(_0x1f52f3){freeIsNotKey(_0x1f52f3,_0x57efba[_0x648e('0xb')],'id');for(var _0x44f15d=0x0,_0x6c4fc4={},_0x12c0b3={};_0x44f15d<_0x1f52f3[_0x648e('0x14')];_0x44f15d+=0x1){_0x6c4fc4=_0x1f52f3[_0x44f15d];if(_[_0x648e('0x15')](_0x57efba['faxQueues'][_0x6c4fc4['id']])){_0x57efba[_0x648e('0xb')][_0x6c4fc4['id']]=new FaxQueue(_0x6c4fc4);}else{_0x57efba[_0x648e('0x12')](_0x57efba[_0x648e('0xb')][_0x6c4fc4['id']],_0x6c4fc4);}_0x57efba['faxQueues'][_0x6c4fc4['id']][_0x648e('0x19')]();_0x57efba[_0x648e('0xb')][_0x6c4fc4['id']]['updateRealtime']();}}return _0x57efba[_0x648e('0xb')];};};module[_0x648e('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 16def01..c940989 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 _0x5478=['addTags','Request','AddTagsToChatInteraction','addTagsToChatInteraction','../client','UpdateChatInteraction','updateChatInteraction'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x5478,0xdd));var _0x8547=function(_0x35c5a8,_0x8ecb48){_0x35c5a8=_0x35c5a8-0x0;var _0x34782c=_0x5478[_0x35c5a8];return _0x34782c;};'use strict';var client=require(_0x8547('0x0'));exports['update']=function(_0xc24a14,_0x39719c){return client['Request'](_0x8547('0x1'),{'body':_0x39719c,'options':{'where':{'id':_0xc24a14}},'log':_0x8547('0x2')});};exports[_0x8547('0x3')]=function(_0x17837d,_0x35204a){return client[_0x8547('0x4')](_0x8547('0x5'),{'body':_0x35204a,'options':{'where':{'id':_0x17837d}},'log':_0x8547('0x6')});}; \ No newline at end of file +var _0x2abb=['AddTagsToChatInteraction','update','Request','UpdateChatInteraction','updateChatInteraction','addTags'];(function(_0x1d5f71,_0x4285d0){var _0x160c3d=function(_0x592641){while(--_0x592641){_0x1d5f71['push'](_0x1d5f71['shift']());}};_0x160c3d(++_0x4285d0);}(_0x2abb,0x157));var _0xb2ab=function(_0x56e527,_0x1e9ac0){_0x56e527=_0x56e527-0x0;var _0x1c44a0=_0x2abb[_0x56e527];return _0x1c44a0;};'use strict';var client=require('../client');exports[_0xb2ab('0x0')]=function(_0x4fa350,_0x10c7ca){return client[_0xb2ab('0x1')](_0xb2ab('0x2'),{'body':_0x10c7ca,'options':{'where':{'id':_0x4fa350}},'log':_0xb2ab('0x3')});};exports[_0xb2ab('0x4')]=function(_0xe6866e,_0x22da0c){return client[_0xb2ab('0x1')](_0xb2ab('0x5'),{'body':_0x22da0c,'options':{'where':{'id':_0xe6866e}},'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 7e7cd73..a04c595 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 _0x3ad1=['create','Request','CreateChatMessage','../client'];(function(_0x1381df,_0xa4f9e9){var _0x3dd915=function(_0x104735){while(--_0x104735){_0x1381df['push'](_0x1381df['shift']());}};_0x3dd915(++_0xa4f9e9);}(_0x3ad1,0x93));var _0x13ad=function(_0xb2ab76,_0x43d299){_0xb2ab76=_0xb2ab76-0x0;var _0x4ce4c5=_0x3ad1[_0xb2ab76];return _0x4ce4c5;};'use strict';var client=require(_0x13ad('0x0'));exports[_0x13ad('0x1')]=function(_0x574248){return client[_0x13ad('0x2')](_0x13ad('0x3'),{'body':_0x574248,'log':'createChatMessage'});}; \ No newline at end of file +var _0xc732=['Request','CreateChatMessage','createChatMessage','../client','create'];(function(_0x257a0,_0x42d2b4){var _0x8a44ed=function(_0x51b193){while(--_0x51b193){_0x257a0['push'](_0x257a0['shift']());}};_0x8a44ed(++_0x42d2b4);}(_0xc732,0x198));var _0x2c73=function(_0x34a163,_0x486dd9){_0x34a163=_0x34a163-0x0;var _0x5916df=_0xc732[_0x34a163];return _0x5916df;};'use strict';var client=require(_0x2c73('0x0'));exports[_0x2c73('0x1')]=function(_0x55cf85){return client[_0x2c73('0x2')](_0x2c73('0x3'),{'body':_0x55cf85,'log':_0x2c73('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 4143ddf..61a56fe 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 _0x5ef2=['name','timeout','strategy','User','Agents','online','../client','GetChatQueue'];(function(_0x3bae9b,_0x5c45cb){var _0x3a1517=function(_0x29751d){while(--_0x29751d){_0x3bae9b['push'](_0x3bae9b['shift']());}};_0x3a1517(++_0x5c45cb);}(_0x5ef2,0x96));var _0x25ef=function(_0x19a2ea,_0x28d61d){_0x19a2ea=_0x19a2ea-0x0;var _0x5c79df=_0x5ef2[_0x19a2ea];return _0x5c79df;};'use strict';var client=require(_0x25ef('0x0'));exports['getChatQueues']=function(){return function(){return client['Request'](_0x25ef('0x1'),{'options':{'raw':![],'attributes':['id',_0x25ef('0x2'),_0x25ef('0x3'),_0x25ef('0x4')],'include':[{'model':_0x25ef('0x5'),'as':_0x25ef('0x6'),'attributes':['id',_0x25ef('0x2'),_0x25ef('0x7'),'chatPause']}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0x53d5=['Request','GetChatQueue','name','timeout','online','getChatQueues'];(function(_0xe0108f,_0x1cd889){var _0x5f5c68=function(_0x7e3202){while(--_0x7e3202){_0xe0108f['push'](_0xe0108f['shift']());}};_0x5f5c68(++_0x1cd889);}(_0x53d5,0x149));var _0x553d=function(_0x543e6b,_0x218c9a){_0x543e6b=_0x543e6b-0x0;var _0xffb501=_0x53d5[_0x543e6b];return _0xffb501;};'use strict';var client=require('../client');exports[_0x553d('0x0')]=function(){return function(){return client[_0x553d('0x1')](_0x553d('0x2'),{'options':{'raw':![],'attributes':['id',_0x553d('0x3'),_0x553d('0x4'),'strategy'],'include':[{'model':'User','as':'Agents','attributes':['id',_0x553d('0x3'),_0x553d('0x5'),'chatPause']}]},'log':_0x553d('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index feae5b9..afd6f46 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 _0xe914=['DESC','../client','create','Request','CreateChatQueueReport','update','UpdateChatQueueReport'];(function(_0x2f6961,_0x31ea74){var _0x451beb=function(_0x41d065){while(--_0x41d065){_0x2f6961['push'](_0x2f6961['shift']());}};_0x451beb(++_0x31ea74);}(_0xe914,0x7f));var _0x4e91=function(_0x40e604,_0x5a41eb){_0x40e604=_0x40e604-0x0;var _0x21a242=_0xe914[_0x40e604];return _0x21a242;};'use strict';var client=require(_0x4e91('0x0'));exports[_0x4e91('0x1')]=function(_0x4b9ac6){return client[_0x4e91('0x2')](_0x4e91('0x3'),{'body':_0x4b9ac6,'log':_0x4e91('0x3')});};exports[_0x4e91('0x4')]=function(_0x297dc0,_0x59e102){return client['Request'](_0x4e91('0x5'),{'body':_0x59e102,'options':{'where':{'uniqueid':_0x297dc0},'order':[['id',_0x4e91('0x6')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0x1978=['update','UpdateChatQueueReport','create','Request','CreateChatQueueReport'];(function(_0x53212a,_0x5740c0){var _0x56ac1b=function(_0x36a3c5){while(--_0x36a3c5){_0x53212a['push'](_0x53212a['shift']());}};_0x56ac1b(++_0x5740c0);}(_0x1978,0x174));var _0x8197=function(_0x1da92f,_0x23fd81){_0x1da92f=_0x1da92f-0x0;var _0x1c21b3=_0x1978[_0x1da92f];return _0x1c21b3;};'use strict';var client=require('../client');exports[_0x8197('0x0')]=function(_0x254e41){return client[_0x8197('0x1')](_0x8197('0x2'),{'body':_0x254e41,'log':_0x8197('0x2')});};exports[_0x8197('0x3')]=function(_0x38fffe,_0x346978){return client[_0x8197('0x1')](_0x8197('0x4'),{'body':_0x346978,'options':{'where':{'uniqueid':_0x38fffe},'order':[['id','DESC']],'limit':0x1},'log':_0x8197('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 453a6a3..e05df80 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 _0xdf83=['../client','Request','UpdateFaxInteraction','addTagsToFaxInteraction'];(function(_0x489d25,_0x16967f){var _0x36454b=function(_0x377916){while(--_0x377916){_0x489d25['push'](_0x489d25['shift']());}};_0x36454b(++_0x16967f);}(_0xdf83,0x15c));var _0x3df8=function(_0x550a68,_0x194192){_0x550a68=_0x550a68-0x0;var _0x2f7c9e=_0xdf83[_0x550a68];return _0x2f7c9e;};'use strict';var client=require(_0x3df8('0x0'));exports['update']=function(_0xb41f52,_0x274f86){return client[_0x3df8('0x1')](_0x3df8('0x2'),{'body':_0x274f86,'options':{'where':{'id':_0xb41f52}},'log':'updateFaxInteraction'});};exports['addTags']=function(_0x4f2475,_0x5f953d){return client['Request']('AddTagsToFaxInteraction',{'body':_0x5f953d,'options':{'where':{'id':_0x4f2475}},'log':_0x3df8('0x3')});}; \ No newline at end of file +var _0x9bff=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction'];(function(_0x59dbc3,_0xfc1f22){var _0x1ba735=function(_0x5bc380){while(--_0x5bc380){_0x59dbc3['push'](_0x59dbc3['shift']());}};_0x1ba735(++_0xfc1f22);}(_0x9bff,0xb4));var _0xf9bf=function(_0xf9e76,_0x2e6b9a){_0xf9e76=_0xf9e76-0x0;var _0x119a9b=_0x9bff[_0xf9e76];return _0x119a9b;};'use strict';var client=require('../client');exports['update']=function(_0x5a2802,_0x16a352){return client[_0xf9bf('0x0')](_0xf9bf('0x1'),{'body':_0x16a352,'options':{'where':{'id':_0x5a2802}},'log':'updateFaxInteraction'});};exports[_0xf9bf('0x2')]=function(_0xa03052,_0x156cbd){return client['Request'](_0xf9bf('0x3'),{'body':_0x156cbd,'options':{'where':{'id':_0xa03052}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 8db373a..a57e6cb 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 _0x3ffc=['../client','Request'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x3ffc,0x104));var _0xc3ff=function(_0x5aa023,_0x1cf1d2){_0x5aa023=_0x5aa023-0x0;var _0x31ceb5=_0x3ffc[_0x5aa023];return _0x31ceb5;};'use strict';var client=require(_0xc3ff('0x0'));exports['create']=function(_0x492d0){return client[_0xc3ff('0x1')]('CreateFaxMessage',{'body':_0x492d0,'log':'createFaxMessage'});}; \ No newline at end of file +var _0x1801=['createFaxMessage','../client'];(function(_0x3935f8,_0x20ae2b){var _0x834c5f=function(_0x1f32bf){while(--_0x1f32bf){_0x3935f8['push'](_0x3935f8['shift']());}};_0x834c5f(++_0x20ae2b);}(_0x1801,0x1ad));var _0x1180=function(_0x4005ec,_0x1833df){_0x4005ec=_0x4005ec-0x0;var _0x1c893d=_0x1801[_0x4005ec];return _0x1c893d;};'use strict';var client=require(_0x1180('0x0'));exports['create']=function(_0x571314){return client['Request']('CreateFaxMessage',{'body':_0x571314,'log':_0x1180('0x1')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 7632664..fcdade0 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 _0xa13e=['GetFaxQueue','name','timeout','strategy','Agents','online','faxPause','../client','getFaxQueues','Request'];(function(_0x362cbc,_0x1a122e){var _0x5e98a5=function(_0xd6992e){while(--_0xd6992e){_0x362cbc['push'](_0x362cbc['shift']());}};_0x5e98a5(++_0x1a122e);}(_0xa13e,0x1e7));var _0xea13=function(_0x466766,_0x2bf9fd){_0x466766=_0x466766-0x0;var _0x434107=_0xa13e[_0x466766];return _0x434107;};'use strict';var client=require(_0xea13('0x0'));exports[_0xea13('0x1')]=function(){return function(){return client[_0xea13('0x2')](_0xea13('0x3'),{'options':{'raw':![],'attributes':['id',_0xea13('0x4'),_0xea13('0x5'),_0xea13('0x6')],'include':[{'model':'User','as':_0xea13('0x7'),'attributes':['id','name',_0xea13('0x8'),_0xea13('0x9')]}]},'log':_0xea13('0x1')});};}; \ No newline at end of file +var _0x5cb1=['timeout','strategy','User','online','faxPause','getFaxQueues','../client','Request','GetFaxQueue','name'];(function(_0x58b44a,_0x1a7aa6){var _0xd6779d=function(_0x40d8f3){while(--_0x40d8f3){_0x58b44a['push'](_0x58b44a['shift']());}};_0xd6779d(++_0x1a7aa6);}(_0x5cb1,0x11e));var _0x15cb=function(_0x8e9386,_0x3cc60f){_0x8e9386=_0x8e9386-0x0;var _0x4abf26=_0x5cb1[_0x8e9386];return _0x4abf26;};'use strict';var client=require(_0x15cb('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0x15cb('0x1')](_0x15cb('0x2'),{'options':{'raw':![],'attributes':['id',_0x15cb('0x3'),_0x15cb('0x4'),_0x15cb('0x5')],'include':[{'model':_0x15cb('0x6'),'as':'Agents','attributes':['id',_0x15cb('0x3'),_0x15cb('0x7'),_0x15cb('0x8')]}]},'log':_0x15cb('0x9')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 01e6f39..05461c5 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 _0x89c9=['update','UpdateFaxQueueReport','../client','create','Request','CreateFaxQueueReport'];(function(_0x3102ab,_0x481c69){var _0x232720=function(_0x47cdf5){while(--_0x47cdf5){_0x3102ab['push'](_0x3102ab['shift']());}};_0x232720(++_0x481c69);}(_0x89c9,0xb0));var _0x989c=function(_0x1075b8,_0xd606e2){_0x1075b8=_0x1075b8-0x0;var _0x5d047f=_0x89c9[_0x1075b8];return _0x5d047f;};'use strict';var client=require(_0x989c('0x0'));exports[_0x989c('0x1')]=function(_0x2df999){return client[_0x989c('0x2')](_0x989c('0x3'),{'body':_0x2df999,'log':_0x989c('0x3')});};exports[_0x989c('0x4')]=function(_0x42f3ea,_0x2996f1){return client['Request']('UpdateFaxQueueReport',{'body':_0x2996f1,'options':{'where':{'uniqueid':_0x42f3ea},'order':[['id','DESC']],'limit':0x1},'log':_0x989c('0x5')});}; \ No newline at end of file +var _0x3cb7=['update','UpdateFaxQueueReport','DESC','../client','create','Request','CreateFaxQueueReport'];(function(_0xffa302,_0xfd695c){var _0x38ea4b=function(_0xaa04c3){while(--_0xaa04c3){_0xffa302['push'](_0xffa302['shift']());}};_0x38ea4b(++_0xfd695c);}(_0x3cb7,0x1ae));var _0x73cb=function(_0x2c3458,_0x1f7efd){_0x2c3458=_0x2c3458-0x0;var _0x3f7e02=_0x3cb7[_0x2c3458];return _0x3f7e02;};'use strict';var client=require(_0x73cb('0x0'));exports[_0x73cb('0x1')]=function(_0x48e9be){return client[_0x73cb('0x2')](_0x73cb('0x3'),{'body':_0x48e9be,'log':_0x73cb('0x3')});};exports[_0x73cb('0x4')]=function(_0x5b1c9d,_0x5f923d){return client[_0x73cb('0x2')](_0x73cb('0x5'),{'body':_0x5f923d,'options':{'where':{'uniqueid':_0x5b1c9d},'order':[['id',_0x73cb('0x6')]],'limit':0x1},'log':_0x73cb('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 8326d78..1205dc0 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 _0x49db=['interval','../client','getIntervals','Request','GetInterval','name','Intervals'];(function(_0x66a2a8,_0x55f060){var _0x4d0e60=function(_0x348d57){while(--_0x348d57){_0x66a2a8['push'](_0x66a2a8['shift']());}};_0x4d0e60(++_0x55f060);}(_0x49db,0xc5));var _0xb49d=function(_0x361125,_0x317f3e){_0x361125=_0x361125-0x0;var _0x4afe91=_0x49db[_0x361125];return _0x4afe91;};'use strict';var client=require(_0xb49d('0x0'));exports[_0xb49d('0x1')]=function(){return function(){return client[_0xb49d('0x2')](_0xb49d('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xb49d('0x4')],'include':[{'model':'Interval','as':_0xb49d('0x5'),'attributes':['id',_0xb49d('0x4'),_0xb49d('0x6')]}]},'log':'getIntervals'});};}; \ No newline at end of file +var _0x0713=['getIntervals','Request','GetInterval','name','Interval','Intervals','interval'];(function(_0x80421f,_0x197b48){var _0x4f183a=function(_0x38dbc9){while(--_0x38dbc9){_0x80421f['push'](_0x80421f['shift']());}};_0x4f183a(++_0x197b48);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getIntervals']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x3071('0x2')],'include':[{'model':_0x3071('0x3'),'as':_0x3071('0x4'),'attributes':['id','name',_0x3071('0x5')]}]},'log':_0x3071('0x6')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index f1fd538..7567583 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 _0x0f56=['updateMailInteraction','addTags','AddTagsToMailInteraction','../client','Request','UpdateMailInteraction'];(function(_0x1ed41a,_0x472f78){var _0x5d45a9=function(_0x1b5903){while(--_0x1b5903){_0x1ed41a['push'](_0x1ed41a['shift']());}};_0x5d45a9(++_0x472f78);}(_0x0f56,0x117));var _0x60f5=function(_0x3666cc,_0x553098){_0x3666cc=_0x3666cc-0x0;var _0x8facb1=_0x0f56[_0x3666cc];return _0x8facb1;};'use strict';var client=require(_0x60f5('0x0'));exports['update']=function(_0x8072da,_0x86da7){return client[_0x60f5('0x1')](_0x60f5('0x2'),{'body':_0x86da7,'options':{'where':{'id':_0x8072da}},'log':_0x60f5('0x3')});};exports[_0x60f5('0x4')]=function(_0x142c9f,_0x11610e){return client['Request'](_0x60f5('0x5'),{'body':_0x11610e,'options':{'where':{'id':_0x142c9f}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xcbf9=['AddTagsToMailInteraction','addTagsToChatInteraction','Request','UpdateMailInteraction','updateMailInteraction','addTags'];(function(_0xd6061e,_0x30c238){var _0xa4003a=function(_0x495134){while(--_0x495134){_0xd6061e['push'](_0xd6061e['shift']());}};_0xa4003a(++_0x30c238);}(_0xcbf9,0xce));var _0x9cbf=function(_0x3bdadd,_0x5e586d){_0x3bdadd=_0x3bdadd-0x0;var _0x43535a=_0xcbf9[_0x3bdadd];return _0x43535a;};'use strict';var client=require('../client');exports['update']=function(_0x44667d,_0x4e6354){return client[_0x9cbf('0x0')](_0x9cbf('0x1'),{'body':_0x4e6354,'options':{'where':{'id':_0x44667d}},'log':_0x9cbf('0x2')});};exports[_0x9cbf('0x3')]=function(_0x38fc13,_0x112308){return client[_0x9cbf('0x0')](_0x9cbf('0x4'),{'body':_0x112308,'options':{'where':{'id':_0x38fc13}},'log':_0x9cbf('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index d5f3c82..222ee18 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 _0x8a6c=['createMailMessage','../client','Request','CreateMailMessage'];(function(_0x4a01b0,_0x27961b){var _0x585fb6=function(_0x375edb){while(--_0x375edb){_0x4a01b0['push'](_0x4a01b0['shift']());}};_0x585fb6(++_0x27961b);}(_0x8a6c,0x141));var _0xc8a6=function(_0x5b7ee0,_0x5aac35){_0x5b7ee0=_0x5b7ee0-0x0;var _0xcf5ca1=_0x8a6c[_0x5b7ee0];return _0xcf5ca1;};'use strict';var client=require(_0xc8a6('0x0'));exports['create']=function(_0x9a9c42){return client[_0xc8a6('0x1')](_0xc8a6('0x2'),{'body':_0x9a9c42,'log':_0xc8a6('0x3')});}; \ No newline at end of file +var _0xd4c0=['Request','CreateMailMessage','createMailMessage','../client','create'];(function(_0x157224,_0x143991){var _0x136e26=function(_0x3d19ea){while(--_0x3d19ea){_0x157224['push'](_0x157224['shift']());}};_0x136e26(++_0x143991);}(_0xd4c0,0x143));var _0x0d4c=function(_0x245d7f,_0x448a4c){_0x245d7f=_0x245d7f-0x0;var _0x2e94ab=_0xd4c0[_0x245d7f];return _0x2e94ab;};'use strict';var client=require(_0x0d4c('0x0'));exports[_0x0d4c('0x1')]=function(_0x55db1b){return client[_0x0d4c('0x2')](_0x0d4c('0x3'),{'body':_0x55db1b,'log':_0x0d4c('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 85f2261..8463f72 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 _0x21f4=['Agents','online','mailPause','../client','getMailQueues','Request','GetMailQueue','name','timeout','strategy','User'];(function(_0x5c58a4,_0x2109f3){var _0x39619f=function(_0x5a18cd){while(--_0x5a18cd){_0x5c58a4['push'](_0x5c58a4['shift']());}};_0x39619f(++_0x2109f3);}(_0x21f4,0x9d));var _0x421f=function(_0x1a6b7f,_0x475cef){_0x1a6b7f=_0x1a6b7f-0x0;var _0x38646b=_0x21f4[_0x1a6b7f];return _0x38646b;};'use strict';var client=require(_0x421f('0x0'));exports[_0x421f('0x1')]=function(){return function(){return client[_0x421f('0x2')](_0x421f('0x3'),{'options':{'raw':![],'attributes':['id',_0x421f('0x4'),_0x421f('0x5'),_0x421f('0x6')],'include':[{'model':_0x421f('0x7'),'as':_0x421f('0x8'),'attributes':['id',_0x421f('0x4'),_0x421f('0x9'),_0x421f('0xa')]}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0x0ba7=['User','Agents','name','mailPause','getMailQueues','../client','Request','GetMailQueue','timeout','strategy'];(function(_0x51996f,_0x32ab69){var _0x33e3b6=function(_0x39f68f){while(--_0x39f68f){_0x51996f['push'](_0x51996f['shift']());}};_0x33e3b6(++_0x32ab69);}(_0x0ba7,0x1bd));var _0x70ba=function(_0x2e00ce,_0x1da366){_0x2e00ce=_0x2e00ce-0x0;var _0x2e044e=_0x0ba7[_0x2e00ce];return _0x2e044e;};'use strict';var client=require(_0x70ba('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x70ba('0x1')](_0x70ba('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x70ba('0x3'),_0x70ba('0x4')],'include':[{'model':_0x70ba('0x5'),'as':_0x70ba('0x6'),'attributes':['id',_0x70ba('0x7'),'online',_0x70ba('0x8')]}]},'log':_0x70ba('0x9')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 22083ab..75b86ea 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 _0x6d17=['UpdateMailQueueReport','create','Request','CreateMailQueueReport','update','DESC'];(function(_0x54245b,_0x346572){var _0x4ecf38=function(_0x5e393a){while(--_0x5e393a){_0x54245b['push'](_0x54245b['shift']());}};_0x4ecf38(++_0x346572);}(_0x6d17,0xaf));var _0x76d1=function(_0x9d639c,_0x524dbe){_0x9d639c=_0x9d639c-0x0;var _0x1671de=_0x6d17[_0x9d639c];return _0x1671de;};'use strict';var client=require('../client');exports[_0x76d1('0x0')]=function(_0x1d304a){return client[_0x76d1('0x1')]('CreateMailQueueReport',{'body':_0x1d304a,'log':_0x76d1('0x2')});};exports[_0x76d1('0x3')]=function(_0x58e5df,_0x1937d8){return client[_0x76d1('0x1')]('UpdateMailQueueReport',{'body':_0x1937d8,'options':{'where':{'uniqueid':_0x58e5df},'order':[['id',_0x76d1('0x4')]],'limit':0x1},'log':_0x76d1('0x5')});}; \ No newline at end of file +var _0x680a=['UpdateMailQueueReport','../client','Request','CreateMailQueueReport','update'];(function(_0x2f5a22,_0x5e9f03){var _0x326b70=function(_0x1b7bf9){while(--_0x1b7bf9){_0x2f5a22['push'](_0x2f5a22['shift']());}};_0x326b70(++_0x5e9f03);}(_0x680a,0x178));var _0xa680=function(_0x5b6af2,_0x4f94f9){_0x5b6af2=_0x5b6af2-0x0;var _0x29277d=_0x680a[_0x5b6af2];return _0x29277d;};'use strict';var client=require(_0xa680('0x0'));exports['create']=function(_0x1cc37e){return client[_0xa680('0x1')](_0xa680('0x2'),{'body':_0x1cc37e,'log':_0xa680('0x2')});};exports[_0xa680('0x3')]=function(_0x1ea096,_0x9b665d){return client[_0xa680('0x1')]('UpdateMailQueueReport',{'body':_0x9b665d,'options':{'where':{'uniqueid':_0x1ea096},'order':[['id','DESC']],'limit':0x1},'log':_0xa680('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index f5994a8..46aa8d4 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 _0x81e8=['addTags','AddTagsToOpenchannelInteraction','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction'];(function(_0x1db481,_0x1627b2){var _0x3db95b=function(_0x2d54e4){while(--_0x2d54e4){_0x1db481['push'](_0x1db481['shift']());}};_0x3db95b(++_0x1627b2);}(_0x81e8,0x160));var _0x881e=function(_0x3e0375,_0x7d6214){_0x3e0375=_0x3e0375-0x0;var _0x11ac5d=_0x81e8[_0x3e0375];return _0x11ac5d;};'use strict';var client=require('../client');exports['update']=function(_0x1ea992,_0x285648){return client[_0x881e('0x0')](_0x881e('0x1'),{'body':_0x285648,'options':{'where':{'id':_0x1ea992}},'log':_0x881e('0x2')});};exports[_0x881e('0x3')]=function(_0x3b2b22,_0x3d10b3){return client['Request'](_0x881e('0x4'),{'body':_0x3d10b3,'options':{'where':{'id':_0x3b2b22}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x5e4f=['addTagsToChatInteraction','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction'];(function(_0x3de4f8,_0x336c7d){var _0x3d81fc=function(_0x53b9f9){while(--_0x53b9f9){_0x3de4f8['push'](_0x3de4f8['shift']());}};_0x3d81fc(++_0x336c7d);}(_0x5e4f,0x105));var _0xf5e4=function(_0x2ec37e,_0x93586a){_0x2ec37e=_0x2ec37e-0x0;var _0x3c5980=_0x5e4f[_0x2ec37e];return _0x3c5980;};'use strict';var client=require('../client');exports[_0xf5e4('0x0')]=function(_0x3a3213,_0x4a07ce){return client[_0xf5e4('0x1')](_0xf5e4('0x2'),{'body':_0x4a07ce,'options':{'where':{'id':_0x3a3213}},'log':_0xf5e4('0x3')});};exports['addTags']=function(_0x420d28,_0x2d5299){return client[_0xf5e4('0x1')]('AddTagsToOpenchannelInteraction',{'body':_0x2d5299,'options':{'where':{'id':_0x420d28}},'log':_0xf5e4('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 2f7475b..540e685 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(_0x3d76fb,_0x5ccf03){var _0x3abd75=function(_0x41cf81){while(--_0x41cf81){_0x3d76fb['push'](_0x3d76fb['shift']());}};_0x3abd75(++_0x5ccf03);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x599609,_0x5618fb){_0x599609=_0x599609-0x0;var _0xe86e77=_0x6f0d[_0x599609];return _0xe86e77;};'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 _0xedd9=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0xedd9,0xfc));var _0x9edd=function(_0x341569,_0x1edec3){_0x341569=_0x341569-0x0;var _0x2cb5c7=_0xedd9[_0x341569];return _0x2cb5c7;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(_0x2d7989){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'body':_0x2d7989,'log':_0x9edd('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 54107a1..2d89327 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 _0x3ee1=['../client','Request','GetOpenchannelQueue','name','timeout','User','Agents','online','openchannelPause'];(function(_0x4dfa76,_0x53e4fb){var _0x14d3eb=function(_0x3ccf07){while(--_0x3ccf07){_0x4dfa76['push'](_0x4dfa76['shift']());}};_0x14d3eb(++_0x53e4fb);}(_0x3ee1,0x1b0));var _0x13ee=function(_0x461279,_0x196117){_0x461279=_0x461279-0x0;var _0x20f193=_0x3ee1[_0x461279];return _0x20f193;};'use strict';var client=require(_0x13ee('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0x13ee('0x1')](_0x13ee('0x2'),{'options':{'raw':![],'attributes':['id',_0x13ee('0x3'),_0x13ee('0x4'),'strategy'],'include':[{'model':_0x13ee('0x5'),'as':_0x13ee('0x6'),'attributes':['id',_0x13ee('0x3'),_0x13ee('0x7'),_0x13ee('0x8')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0x35a3=['online','getOpenchannelQueues','Request','name','timeout','strategy','User','Agents'];(function(_0x5e083f,_0x1fcb9a){var _0x21b949=function(_0x25f1ee){while(--_0x25f1ee){_0x5e083f['push'](_0x5e083f['shift']());}};_0x21b949(++_0x1fcb9a);}(_0x35a3,0xb1));var _0x335a=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x35a3[_0x618414];return _0x21c19a;};'use strict';var client=require('../client');exports[_0x335a('0x0')]=function(){return function(){return client[_0x335a('0x1')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x335a('0x2'),_0x335a('0x3'),_0x335a('0x4')],'include':[{'model':_0x335a('0x5'),'as':_0x335a('0x6'),'attributes':['id',_0x335a('0x2'),_0x335a('0x7'),'openchannelPause']}]},'log':_0x335a('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 95506d5..f272789 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 _0x8aff=['../client','create','Request','CreateOpenchannelQueueReport','update','DESC','UpdateOpenchannelQueueReport'];(function(_0x6a6f3e,_0x14bb19){var _0x59361d=function(_0x1c89e0){while(--_0x1c89e0){_0x6a6f3e['push'](_0x6a6f3e['shift']());}};_0x59361d(++_0x14bb19);}(_0x8aff,0x118));var _0xf8af=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x8aff[_0x1203f];return _0x365f0a;};'use strict';var client=require(_0xf8af('0x0'));exports[_0xf8af('0x1')]=function(_0x11f2b5){return client[_0xf8af('0x2')](_0xf8af('0x3'),{'body':_0x11f2b5,'log':'CreateOpenchannelQueueReport'});};exports[_0xf8af('0x4')]=function(_0x4de4af,_0x309573){return client[_0xf8af('0x2')]('UpdateOpenchannelQueueReport',{'body':_0x309573,'options':{'where':{'uniqueid':_0x4de4af},'order':[['id',_0xf8af('0x5')]],'limit':0x1},'log':_0xf8af('0x6')});}; \ No newline at end of file +var _0x276f=['../client','create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC'];(function(_0x4f32c8,_0x2b23c3){var _0xa4602a=function(_0x3e346b){while(--_0x3e346b){_0x4f32c8['push'](_0x4f32c8['shift']());}};_0xa4602a(++_0x2b23c3);}(_0x276f,0x1d5));var _0xf276=function(_0x34f6bf,_0x2afbc7){_0x34f6bf=_0x34f6bf-0x0;var _0xe9b9fa=_0x276f[_0x34f6bf];return _0xe9b9fa;};'use strict';var client=require(_0xf276('0x0'));exports[_0xf276('0x1')]=function(_0x31ef6d){return client[_0xf276('0x2')](_0xf276('0x3'),{'body':_0x31ef6d,'log':'CreateOpenchannelQueueReport'});};exports[_0xf276('0x4')]=function(_0x45e5a6,_0x52ee5b){return client[_0xf276('0x2')](_0xf276('0x5'),{'body':_0x52ee5b,'options':{'where':{'uniqueid':_0x45e5a6},'order':[['id',_0xf276('0x6')]],'limit':0x1},'log':_0xf276('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 9f6f514..21b9b56 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 _0x61e1=['addTags','Request','addTagsToSmsInteraction','../client','update','updateSmsInteraction'];(function(_0x39f90a,_0x4e7d74){var _0x31a1d9=function(_0x4a2a20){while(--_0x4a2a20){_0x39f90a['push'](_0x39f90a['shift']());}};_0x31a1d9(++_0x4e7d74);}(_0x61e1,0x19b));var _0x161e=function(_0x3e5edd,_0x41e983){_0x3e5edd=_0x3e5edd-0x0;var _0x5dad23=_0x61e1[_0x3e5edd];return _0x5dad23;};'use strict';var client=require(_0x161e('0x0'));exports[_0x161e('0x1')]=function(_0x2b2c19,_0x27cd95){return client['Request']('UpdateSmsInteraction',{'body':_0x27cd95,'options':{'where':{'id':_0x2b2c19}},'log':_0x161e('0x2')});};exports[_0x161e('0x3')]=function(_0x43777b,_0x8f4915){return client[_0x161e('0x4')]('AddTagsToSmsInteraction',{'body':_0x8f4915,'options':{'where':{'id':_0x43777b}},'log':_0x161e('0x5')});}; \ No newline at end of file +var _0x7b78=['Request','UpdateSmsInteraction','updateSmsInteraction','addTags','addTagsToSmsInteraction','../client','update'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0x7b78,0xad));var _0x87b7=function(_0x5b1e00,_0x2af427){_0x5b1e00=_0x5b1e00-0x0;var _0x1b05ce=_0x7b78[_0x5b1e00];return _0x1b05ce;};'use strict';var client=require(_0x87b7('0x0'));exports[_0x87b7('0x1')]=function(_0x2a7110,_0x3dad93){return client[_0x87b7('0x2')](_0x87b7('0x3'),{'body':_0x3dad93,'options':{'where':{'id':_0x2a7110}},'log':_0x87b7('0x4')});};exports[_0x87b7('0x5')]=function(_0x244f7e,_0x2af8ce){return client[_0x87b7('0x2')]('AddTagsToSmsInteraction',{'body':_0x2af8ce,'options':{'where':{'id':_0x244f7e}},'log':_0x87b7('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 69623b3..1f4fdc9 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 _0xf461=['../client','CreateSmsMessage'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0xf461,0xba));var _0x1f46=function(_0x8ebebe,_0x5456f0){_0x8ebebe=_0x8ebebe-0x0;var _0x153663=_0xf461[_0x8ebebe];return _0x153663;};'use strict';var client=require(_0x1f46('0x0'));exports['create']=function(_0x5e6ebc){return client['Request'](_0x1f46('0x1'),{'body':_0x5e6ebc,'log':'createSmsMessage'});}; \ No newline at end of file +var _0x577e=['create','CreateSmsMessage','createSmsMessage'];(function(_0x38532c,_0x1e01be){var _0x24b2a0=function(_0xd62a4f){while(--_0xd62a4f){_0x38532c['push'](_0x38532c['shift']());}};_0x24b2a0(++_0x1e01be);}(_0x577e,0x1f2));var _0xe577=function(_0x3712e2,_0x32d752){_0x3712e2=_0x3712e2-0x0;var _0x1faff4=_0x577e[_0x3712e2];return _0x1faff4;};'use strict';var client=require('../client');exports[_0xe577('0x0')]=function(_0x3e1342){return client['Request'](_0xe577('0x1'),{'body':_0x3e1342,'log':_0xe577('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index bc9ba53..920c69d 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 _0x3be2=['online','smsPause','../client','getSmsQueues','GetSmsQueue','timeout','User','Agents'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3be2,0xfa));var _0x23be=function(_0x411ec8,_0x5a89e0){_0x411ec8=_0x411ec8-0x0;var _0x5620cd=_0x3be2[_0x411ec8];return _0x5620cd;};'use strict';var client=require(_0x23be('0x0'));exports[_0x23be('0x1')]=function(){return function(){return client['Request'](_0x23be('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x23be('0x3'),'strategy'],'include':[{'model':_0x23be('0x4'),'as':_0x23be('0x5'),'attributes':['id','name',_0x23be('0x6'),_0x23be('0x7')]}]},'log':_0x23be('0x1')});};}; \ No newline at end of file +var _0xf069=['Request','GetSmsQueue','name','timeout','strategy','Agents','online','smsPause','../client','getSmsQueues'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xf069,0x1ca));var _0x9f06=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf069[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x9f06('0x0'));exports[_0x9f06('0x1')]=function(){return function(){return client[_0x9f06('0x2')](_0x9f06('0x3'),{'options':{'raw':![],'attributes':['id',_0x9f06('0x4'),_0x9f06('0x5'),_0x9f06('0x6')],'include':[{'model':'User','as':_0x9f06('0x7'),'attributes':['id',_0x9f06('0x4'),_0x9f06('0x8'),_0x9f06('0x9')]}]},'log':_0x9f06('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index eea871e..ada879a 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 _0x46ec=['DESC','../client','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x46ec,0x145));var _0xc46e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x46ec[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0xc46e('0x0'));exports['create']=function(_0x52d5b0){return client[_0xc46e('0x1')](_0xc46e('0x2'),{'body':_0x52d5b0,'log':_0xc46e('0x2')});};exports[_0xc46e('0x3')]=function(_0x2ec68e,_0x20b331){return client['Request'](_0xc46e('0x4'),{'body':_0x20b331,'options':{'where':{'uniqueid':_0x2ec68e},'order':[['id',_0xc46e('0x5')]],'limit':0x1},'log':_0xc46e('0x4')});}; \ No newline at end of file +var _0x9195=['update','Request','UpdateSmsQueueReport','../client','create','CreateSmsQueueReport'];(function(_0x16ab1e,_0x28608c){var _0x143bf5=function(_0x147fbd){while(--_0x147fbd){_0x16ab1e['push'](_0x16ab1e['shift']());}};_0x143bf5(++_0x28608c);}(_0x9195,0x129));var _0x5919=function(_0x401b7f,_0x56a4d2){_0x401b7f=_0x401b7f-0x0;var _0x245483=_0x9195[_0x401b7f];return _0x245483;};'use strict';var client=require(_0x5919('0x0'));exports[_0x5919('0x1')]=function(_0x135470){return client['Request']('CreateSmsQueueReport',{'body':_0x135470,'log':_0x5919('0x2')});};exports[_0x5919('0x3')]=function(_0x3e09f6,_0x10906b){return client[_0x5919('0x4')]('UpdateSmsQueueReport',{'body':_0x10906b,'options':{'where':{'uniqueid':_0x3e09f6},'order':[['id','DESC']],'limit':0x1},'log':_0x5919('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 74cf794..006c8c7 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 _0x2dd4=['faxPause','smsPause','openchannelPause','chatCapacity','smsCapacity','openchannelCapacity','../client','getAgents','Request','GetUser','agent','online','lastPauseAt','voicePause','chatPause'];(function(_0x5926d6,_0x2bdb34){var _0x2270b8=function(_0x17738e){while(--_0x17738e){_0x5926d6['push'](_0x5926d6['shift']());}};_0x2270b8(++_0x2bdb34);}(_0x2dd4,0x6f));var _0x42dd=function(_0x444de3,_0x5b0a39){_0x444de3=_0x444de3-0x0;var _0x5940da=_0x2dd4[_0x444de3];return _0x5940da;};'use strict';var client=require(_0x42dd('0x0'));exports[_0x42dd('0x1')]=function(){return function(){return client[_0x42dd('0x2')](_0x42dd('0x3'),{'options':{'raw':!![],'where':{'role':_0x42dd('0x4')},'attributes':['id','name',_0x42dd('0x5'),'pauseType',_0x42dd('0x6'),_0x42dd('0x7'),_0x42dd('0x8'),'mailPause',_0x42dd('0x9'),_0x42dd('0xa'),_0x42dd('0xb'),_0x42dd('0xc'),'mailCapacity','faxCapacity',_0x42dd('0xd'),_0x42dd('0xe')]},'log':_0x42dd('0x1')});};}; \ No newline at end of file +var _0xbee9=['getAgents','GetUser','online','pauseType','voicePause','chatPause','mailPause','openchannelPause','chatCapacity','smsCapacity','openchannelCapacity','../client'];(function(_0x265524,_0x3a8c41){var _0x20d0e5=function(_0x43e66b){while(--_0x43e66b){_0x265524['push'](_0x265524['shift']());}};_0x20d0e5(++_0x3a8c41);}(_0xbee9,0x197));var _0x9bee=function(_0x5e4cf7,_0xf59479){_0x5e4cf7=_0x5e4cf7-0x0;var _0x3b5d66=_0xbee9[_0x5e4cf7];return _0x3b5d66;};'use strict';var client=require(_0x9bee('0x0'));exports[_0x9bee('0x1')]=function(){return function(){return client['Request'](_0x9bee('0x2'),{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id','name',_0x9bee('0x3'),_0x9bee('0x4'),'lastPauseAt',_0x9bee('0x5'),_0x9bee('0x6'),_0x9bee('0x7'),'faxPause','smsPause',_0x9bee('0x8'),_0x9bee('0x9'),'mailCapacity','faxCapacity',_0x9bee('0xa'),_0x9bee('0xb')]},'log':'getAgents'});};}; \ 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 9a33926..e18a6b9 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 _0xd80d=['[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','message','stop','find','agents','createQueue','atimeout','channel','START:%s','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','close','[%s][AGENT]\x20ROUTING\x20END','next','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','format'];(function(_0x4908ae,_0x245bad){var _0x31c7c5=function(_0x402832){while(--_0x402832){_0x4908ae['push'](_0x4908ae['shift']());}};_0x31c7c5(++_0x245bad);}(_0xd80d,0xd2));var _0xdd80=function(_0x1b8107,_0xbc6dce){_0x1b8107=_0x1b8107-0x0;var _0xed9687=_0xd80d[_0x1b8107];return _0xed9687;};'use strict';var schema=require(_0xdd80('0x0'));var _=require(_0xdd80('0x1'));var util=require(_0xdd80('0x2'));var seqqueue=require(_0xdd80('0x3'));var logger=require(_0xdd80('0x4'))(_0xdd80('0x5'));var strategy=require(_0xdd80('0x6'));var queue=schema({'name':{'type':'string','required':!![],'message':_0xdd80('0x7')},'timeout':{'type':_0xdd80('0x8'),'message':_0xdd80('0x9')}});function writeLog(_0xacf218,_0x117358,_0x34165a){return logger[_0xdd80('0xa')](util[_0xdd80('0xb')](_0xdd80('0xc'),_0xacf218,_0x117358['name'],_0x34165a));}function handleFindAgent(_0xa3ebff){return function(_0x462761){return _0x462761[_0xdd80('0xd')][_0xdd80('0xe')]()===_0xa3ebff['toLowerCase']();};}exports[_0xdd80('0xf')]=function(_0x163ab6,_0x33136d,_0x918998,_0x4dab6e){return function(_0x422dae){try{var _0x5740f5={'name':_0x33136d[0x0],'timeout':_0x33136d[0x1]};var _0x5c1883=queue[_0xdd80('0x0')](_0x5740f5,{'typecast':!![]});if(_0x5c1883[_0xdd80('0x10')]){logger[_0xdd80('0x11')](_0xdd80('0x12'),_0x163ab6,_[_0xdd80('0x13')](_0x5c1883,_0xdd80('0x14'))['join'](',\x20'));_0x422dae[_0xdd80('0x15')]();}else{var _0x43d435=_[_0xdd80('0x16')](_0x918998[_0xdd80('0x17')],handleFindAgent(_0x5740f5[_0xdd80('0xd')]));if(_0x43d435){var _0x57a3ba=(_0x5740f5['timeout']||0xa)*0x3e8;var _0x1092c4,_0x1250b4;var _0x1297d9=seqqueue[_0xdd80('0x18')](_0x57a3ba);_0x1297d9['id']=_0x163ab6;_0x1297d9[_0xdd80('0x19')]=_0x57a3ba;_0x1297d9[_0xdd80('0x1a')]=_0x4dab6e[_0xdd80('0x1a')];writeLog(_0x163ab6,_0x43d435,util[_0xdd80('0xb')](_0xdd80('0x1b'),_0x57a3ba));_0x918998[_0xdd80('0x1c')][_0x163ab6]['on']('end',function(){_0x1297d9['close']();clearTimeout(_0x1250b4);_0x1250b4=undefined;if(_0x918998[_0xdd80('0x1c')][_0x163ab6]){delete _0x918998['rules'][_0x163ab6];}logger[_0xdd80('0xa')](_0xdd80('0x1d'),_0x163ab6);_0x422dae[_0xdd80('0x15')]();});_0x1250b4=setTimeout(function(){clearTimeout(_0x1250b4);_0x1297d9[_0xdd80('0x1e')]();logger[_0xdd80('0xa')](_0xdd80('0x1f'),_0x163ab6);_0x422dae[_0xdd80('0x20')]();},_0x57a3ba);strategy[_0xdd80('0x21')](_0x1297d9,_0x43d435,_0x918998,_0x4dab6e);}else{logger[_0xdd80('0x11')](_0xdd80('0x22'),_0x163ab6,_0x5740f5[_0xdd80('0xd')]);_0x422dae[_0xdd80('0x15')]();}}}catch(_0x3114dc){console['log'](_0x3114dc);logger[_0xdd80('0x11')](_0xdd80('0x23'),_0x163ab6,_0x3114dc[_0xdd80('0x24')]);_0x422dae['stop']();}};}; \ No newline at end of file +var _0x27ea=['join','agents','timeout','createQueue','atimeout','channel','format','START:%s','rules','end','close','info','[%s][AGENT]\x20ROUTING\x20STOPPED','stop','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','validate','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','message'];(function(_0xa3234b,_0x510e40){var _0x219248=function(_0x473aee){while(--_0x473aee){_0xa3234b['push'](_0xa3234b['shift']());}};_0x219248(++_0x510e40);}(_0x27ea,0x1e7));var _0xa27e=function(_0x55d193,_0x370f97){_0x55d193=_0x55d193-0x0;var _0xdfef2d=_0x27ea[_0x55d193];return _0xdfef2d;};'use strict';var schema=require(_0xa27e('0x0'));var _=require(_0xa27e('0x1'));var util=require(_0xa27e('0x2'));var seqqueue=require(_0xa27e('0x3'));var logger=require(_0xa27e('0x4'))(_0xa27e('0x5'));var strategy=require(_0xa27e('0x6'));var queue=schema({'name':{'type':_0xa27e('0x7'),'required':!![],'message':_0xa27e('0x8')},'timeout':{'type':_0xa27e('0x9'),'message':_0xa27e('0xa')}});function writeLog(_0x25f563,_0x1339b0,_0x24522b){return logger['info'](util['format'](_0xa27e('0xb'),_0x25f563,_0x1339b0[_0xa27e('0xc')],_0x24522b));}function handleFindAgent(_0x52d64a){return function(_0x3e3ad2){return _0x3e3ad2['name']['toLowerCase']()===_0x52d64a[_0xa27e('0xd')]();};}exports[_0xa27e('0xe')]=function(_0xfac919,_0x25fac2,_0x36744e,_0x1df933){return function(_0x553b51){try{var _0x32b835={'name':_0x25fac2[0x0],'timeout':_0x25fac2[0x1]};var _0x56d573=queue[_0xa27e('0x0')](_0x32b835,{'typecast':!![]});if(_0x56d573[_0xa27e('0xf')]){logger[_0xa27e('0x10')](_0xa27e('0x11'),_0xfac919,_[_0xa27e('0x12')](_0x56d573,_0xa27e('0x13'))[_0xa27e('0x14')](',\x20'));_0x553b51['stop']();}else{var _0x1cf8b5=_['find'](_0x36744e[_0xa27e('0x15')],handleFindAgent(_0x32b835[_0xa27e('0xc')]));if(_0x1cf8b5){var _0x205c9d=(_0x32b835[_0xa27e('0x16')]||0xa)*0x3e8;var _0x19a0ef,_0x5d5444;var _0x4ff0bd=seqqueue[_0xa27e('0x17')](_0x205c9d);_0x4ff0bd['id']=_0xfac919;_0x4ff0bd[_0xa27e('0x18')]=_0x205c9d;_0x4ff0bd[_0xa27e('0x19')]=_0x1df933['channel'];writeLog(_0xfac919,_0x1cf8b5,util[_0xa27e('0x1a')](_0xa27e('0x1b'),_0x205c9d));_0x36744e[_0xa27e('0x1c')][_0xfac919]['on'](_0xa27e('0x1d'),function(){_0x4ff0bd[_0xa27e('0x1e')]();clearTimeout(_0x5d5444);_0x5d5444=undefined;if(_0x36744e[_0xa27e('0x1c')][_0xfac919]){delete _0x36744e['rules'][_0xfac919];}logger[_0xa27e('0x1f')](_0xa27e('0x20'),_0xfac919);_0x553b51[_0xa27e('0x21')]();});_0x5d5444=setTimeout(function(){clearTimeout(_0x5d5444);_0x4ff0bd[_0xa27e('0x1e')]();logger[_0xa27e('0x1f')](_0xa27e('0x22'),_0xfac919);_0x553b51[_0xa27e('0x23')]();},_0x205c9d);strategy[_0xa27e('0x24')](_0x4ff0bd,_0x1cf8b5,_0x36744e,_0x1df933);}else{logger['error'](_0xa27e('0x25'),_0xfac919,_0x32b835[_0xa27e('0xc')]);_0x553b51[_0xa27e('0x21')]();}}}catch(_0xcf90de){console['log'](_0xcf90de);logger[_0xa27e('0x10')](_0xa27e('0x26'),_0xfac919,_0xcf90de['stack']);_0x553b51[_0xa27e('0x21')]();}};}; \ 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 00e1834..4d7d070 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 _0xf2dd=['getMustacheRender','Message','create','then','catch','error','stringify','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','LexRuntime','message','postText','next','amazonlex','dialogState','lodash','aws-sdk','routing','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','format','out','channel','chat','ChatWebsiteId','upperFirst','InteractionId','created','isEmpty','body'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xf2dd,0x1d7));var _0xdf2d=function(_0xc7348b,_0x145880){_0xc7348b=_0xc7348b-0x0;var _0x307cec=_0xf2dd[_0xc7348b];return _0x307cec;};'use strict';var _=require(_0xdf2d('0x0'));var moment=require('moment');var AWS=require(_0xdf2d('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0xdf2d('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xdf2d('0x3')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xdf2d('0x4')),'faxMessage':require(_0xdf2d('0x5'))};exports[_0xdf2d('0x6')]=function(_0x10d3f4,_0x1245a8){return function(_0x434136){try{if(!_[_0xdf2d('0x7')](this[_0xdf2d('0x8')][_0xdf2d('0x9')])){logger[_0xdf2d('0xa')](_0xdf2d('0xb'),_0x10d3f4,_0xdf2d('0xc'));return _0x434136['next']();}var _0x48dc0b={'ContactId':this['contact']['id'],'sentAt':moment()[_0xdf2d('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xdf2d('0xe')};var _0x2d6860=this[_0xdf2d('0xf')];if(_0x2d6860===_0xdf2d('0x10')){_0x48dc0b[_0xdf2d('0x11')]=this['account']['id'];}else{_0x48dc0b[_[_0xdf2d('0x12')](_0x2d6860)+'AccountId']=this['account']['id'];}_0x48dc0b[_[_0xdf2d('0x12')](_0x2d6860)+_0xdf2d('0x13')]=this['interaction']['id'];if(this[_0xdf2d('0x8')][_0xdf2d('0x14')]){var _0x2eac37=_0x1245a8[0x4];if(!_[_0xdf2d('0x15')](_0x2eac37)){_0x48dc0b[_0xdf2d('0x16')]=utils[_0xdf2d('0x17')](_0x2eac37,this);return rpc[_0x2d6860+_0xdf2d('0x18')][_0xdf2d('0x19')](_0x48dc0b)[_0xdf2d('0x1a')](function(_0x341bb7){logger[_0xdf2d('0xa')](_0xdf2d('0xb'),_0x10d3f4,_0x48dc0b[_0xdf2d('0x16')]);})[_0xdf2d('0x1b')](function(_0x459ee1){logger[_0xdf2d('0x1c')](_0xdf2d('0xb'),_0x10d3f4,JSON[_0xdf2d('0x1d')](_0x459ee1));})['finally'](function(){logger[_0xdf2d('0xa')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x10d3f4);_0x434136['stop']();});}else{logger[_0xdf2d('0xa')](_0xdf2d('0x1e'),_0x10d3f4);_0x434136[_0xdf2d('0x1f')]();}}else{var _0x14f31f=this;var _0x4cbb71=new AWS[(_0xdf2d('0x20'))]({'accessKeyId':_0x1245a8[0x0],'secretAccessKey':_0x1245a8[0x1],'region':_0x1245a8[0x2]});var _0x1608de={'botAlias':'$LATEST','botName':_0x1245a8[0x3],'inputText':this[_0xdf2d('0x21')][_0xdf2d('0x16')],'userId':this[_0xdf2d('0x8')]['id']['toString']()};_0x4cbb71[_0xdf2d('0x22')](_0x1608de,function(_0x58cc70,_0x5f26f2){if(_0x58cc70){logger[_0xdf2d('0x1c')](_0xdf2d('0xb'),_0x10d3f4,_0x58cc70['message']);_0x434136[_0xdf2d('0x23')]();}else if(_0x5f26f2&&_0x5f26f2[_0xdf2d('0x21')]){_0x14f31f['body'][_0xdf2d('0x24')]=_0x5f26f2;_0x48dc0b[_0xdf2d('0x16')]=_0x5f26f2[_0xdf2d('0x21')];return rpc[_0x2d6860+_0xdf2d('0x18')][_0xdf2d('0x19')](_0x48dc0b)[_0xdf2d('0x1a')](function(_0x1b92be){logger[_0xdf2d('0xa')](_0xdf2d('0xb'),_0x10d3f4,_0x48dc0b[_0xdf2d('0x16')]);if(_0x5f26f2[_0xdf2d('0x25')]=='Failed'){_0x434136[_0xdf2d('0x23')]();}else{_0x434136['stop']();}})[_0xdf2d('0x1b')](function(_0x3fcbfe){logger['error'](_0xdf2d('0xb'),_0x10d3f4,JSON['stringify'](_0x3fcbfe));_0x434136[_0xdf2d('0x23')]();});}else{_0x434136[_0xdf2d('0x23')]();}});}}catch(_0xa92c33){logger[_0xdf2d('0x1c')](_0xdf2d('0xb'),_0x10d3f4,JSON[_0xdf2d('0x1d')](_0xa92c33));_0x434136[_0xdf2d('0x1f')]();}};}; \ No newline at end of file +var _0x9818=['account','upperFirst','AccountId','InteractionId','created','getMustacheRender','Message','create','then','catch','error','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','info','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','$LATEST','message','body','toString','postText','next','amazonlex','Failed','stringify','lodash','moment','aws-sdk','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','[%s][AMAZONLEX]\x20%s','format','out','channel'];(function(_0x3ab82f,_0xad698a){var _0x55a258=function(_0x462a13){while(--_0x462a13){_0x3ab82f['push'](_0x3ab82f['shift']());}};_0x55a258(++_0xad698a);}(_0x9818,0x97));var _0x8981=function(_0x4e9c63,_0x9a4d9c){_0x4e9c63=_0x4e9c63-0x0;var _0x501ef0=_0x9818[_0x4e9c63];return _0x501ef0;};'use strict';var _=require(_0x8981('0x0'));var moment=require(_0x8981('0x1'));var AWS=require(_0x8981('0x2'));var utils=require(_0x8981('0x3'));var logger=require('../../../../config/logger')(_0x8981('0x4'));var rpc={'chatMessage':require(_0x8981('0x5')),'openchannelMessage':require(_0x8981('0x6')),'mailMessage':require(_0x8981('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x8981('0x8'))};exports[_0x8981('0x9')]=function(_0x1f9b23,_0x384f72){return function(_0x17d49d){try{if(!_[_0x8981('0xa')](this[_0x8981('0xb')][_0x8981('0xc')])){logger['info'](_0x8981('0xd'),_0x1f9b23,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x17d49d['next']();}var _0xa4c8be={'ContactId':this['contact']['id'],'sentAt':moment()[_0x8981('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x8981('0xf')};var _0x434e0d=this[_0x8981('0x10')];if(_0x434e0d==='chat'){_0xa4c8be['ChatWebsiteId']=this[_0x8981('0x11')]['id'];}else{_0xa4c8be[_[_0x8981('0x12')](_0x434e0d)+_0x8981('0x13')]=this[_0x8981('0x11')]['id'];}_0xa4c8be[_[_0x8981('0x12')](_0x434e0d)+_0x8981('0x14')]=this[_0x8981('0xb')]['id'];if(this[_0x8981('0xb')][_0x8981('0x15')]){var _0x3390f9=_0x384f72[0x4];if(!_['isEmpty'](_0x3390f9)){_0xa4c8be['body']=utils[_0x8981('0x16')](_0x3390f9,this);return rpc[_0x434e0d+_0x8981('0x17')][_0x8981('0x18')](_0xa4c8be)[_0x8981('0x19')](function(_0x4120a2){logger['info']('[%s][AMAZONLEX]\x20%s',_0x1f9b23,_0xa4c8be['body']);})[_0x8981('0x1a')](function(_0x5cdeac){logger[_0x8981('0x1b')](_0x8981('0xd'),_0x1f9b23,JSON['stringify'](_0x5cdeac));})[_0x8981('0x1c')](function(){logger['info'](_0x8981('0x1d'),_0x1f9b23);_0x17d49d[_0x8981('0x1e')]();});}else{logger[_0x8981('0x1f')](_0x8981('0x20'),_0x1f9b23);_0x17d49d[_0x8981('0x1e')]();}}else{var _0x5d6b8a=this;var _0x486562=new AWS['LexRuntime']({'accessKeyId':_0x384f72[0x0],'secretAccessKey':_0x384f72[0x1],'region':_0x384f72[0x2]});var _0x560d42={'botAlias':_0x8981('0x21'),'botName':_0x384f72[0x3],'inputText':this[_0x8981('0x22')][_0x8981('0x23')],'userId':this[_0x8981('0xb')]['id'][_0x8981('0x24')]()};_0x486562[_0x8981('0x25')](_0x560d42,function(_0x21d3b4,_0x79ac7b){if(_0x21d3b4){logger[_0x8981('0x1b')]('[%s][AMAZONLEX]\x20%s',_0x1f9b23,_0x21d3b4['message']);_0x17d49d[_0x8981('0x26')]();}else if(_0x79ac7b&&_0x79ac7b[_0x8981('0x22')]){_0x5d6b8a['body'][_0x8981('0x27')]=_0x79ac7b;_0xa4c8be['body']=_0x79ac7b[_0x8981('0x22')];return rpc[_0x434e0d+_0x8981('0x17')][_0x8981('0x18')](_0xa4c8be)[_0x8981('0x19')](function(_0x228c9a){logger[_0x8981('0x1f')]('[%s][AMAZONLEX]\x20%s',_0x1f9b23,_0xa4c8be[_0x8981('0x23')]);if(_0x79ac7b['dialogState']==_0x8981('0x28')){_0x17d49d[_0x8981('0x26')]();}else{_0x17d49d[_0x8981('0x1e')]();}})[_0x8981('0x1a')](function(_0x29060d){logger[_0x8981('0x1b')](_0x8981('0xd'),_0x1f9b23,JSON[_0x8981('0x29')](_0x29060d));_0x17d49d[_0x8981('0x26')]();});}else{_0x17d49d['next']();}});}}catch(_0x1526e8){logger[_0x8981('0x1b')](_0x8981('0xd'),_0x1f9b23,JSON['stringify'](_0x1526e8));_0x17d49d['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 6f87ad2..3953245 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 _0xa9e0=['messageId','html','replace','body',''+_[_0x0a9e('0x29')](_0xbd1168[_0x0a9e('0x2a')],_0x0a9e('0x2b'),_0x0a9e('0x2c'))+'';return mailRpc[_0x0a9e('0x2d')](_0x20f109,_0xbd1168)[_0x0a9e('0x2e')](function(_0x1843b2){logger[_0x0a9e('0x2f')](_0x0a9e('0x30'),_0x57b080);_0xbd1168[_0x0a9e('0x27')]=_0x1843b2[_0x0a9e('0x10')][_0x0a9e('0x27')];return rpc[_0x3ab53f+_0x0a9e('0x1d')]['create'](_0xbd1168);})[_0x0a9e('0x2e')](function(_0x5d1e0e){logger[_0x0a9e('0x2f')](_0x0a9e('0xb'),_0x57b080,JSON[_0x0a9e('0x31')](_0x5d1e0e));})[_0x0a9e('0x32')](function(_0x25ce3a){logger['error'](_0x0a9e('0x33'),_0x57b080,JSON[_0x0a9e('0x31')](_0x25ce3a));})[_0x0a9e('0x34')](function(){_0x441e3a[_0x0a9e('0xd')]();});}else{return rpc[this[_0x0a9e('0xe')]+_0x0a9e('0x1d')][_0x0a9e('0x35')](_0xbd1168)[_0x0a9e('0x2e')](function(_0x5583a4){logger[_0x0a9e('0x2f')]('[%s][AUTOREPLY]\x20%s',_0x57b080,_0xbd1168[_0x0a9e('0x2a')]);})[_0x0a9e('0x32')](function(_0x2b7e7f){logger[_0x0a9e('0x36')]('[%s][AUTOREPLY]\x20%s',_0x57b080,JSON[_0x0a9e('0x31')](_0x2b7e7f));})[_0x0a9e('0x34')](function(){_0x441e3a[_0x0a9e('0xd')]();});}}}catch(_0x15de0e){logger['error']('[%s][AUTOREPLY]\x20%s',_0x57b080,JSON[_0x0a9e('0x31')](_0x15de0e));_0x441e3a['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 d39dfba..5fca76d 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 _0x9434=['stringify','finally','stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','consequence','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','info','error','[%s][CLOSE]\x20%s'];(function(_0x5c6bc9,_0x4276f7){var _0x5b1fa5=function(_0x351e82){while(--_0x351e82){_0x5c6bc9['push'](_0x5c6bc9['shift']());}};_0x5b1fa5(++_0x4276f7);}(_0x9434,0x168));var _0x4943=function(_0x1aea9c,_0x4559ae){_0x1aea9c=_0x1aea9c-0x0;var _0x5e75ef=_0x9434[_0x1aea9c];return _0x5e75ef;};'use strict';var moment=require(_0x4943('0x0'));var logger=require(_0x4943('0x1'))(_0x4943('0x2'));var rpc={'chatInteraction':require(_0x4943('0x3')),'openchannelInteraction':require(_0x4943('0x4')),'smsInteraction':require(_0x4943('0x5')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x4943('0x6'))};exports[_0x4943('0x7')]=function(_0x5117c7,_0x2ce3d9,_0x43b5b0,_0x4f930e){return function(_0x394d9d){try{logger['info']('[%s][CLOSE]\x20reason\x20%s',_0x5117c7,_0x2ce3d9[0x0]);var _0x3ae08d={'closed':0x1,'closedAt':moment()[_0x4943('0x8')](_0x4943('0x9')),'closeReason':_0x4943('0xa'),'disposition':_0x2ce3d9[0x0]};if(rpc[_0x4f930e[_0x4943('0xb')]+'Interaction']){rpc[_0x4f930e['channel']+_0x4943('0xc')][_0x4943('0xd')](_0x4f930e[_0x4943('0xe')]['id'],_0x3ae08d)['then'](function(_0xc7fda7){logger[_0x4943('0xf')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x5117c7,_0x4f930e[_0x4943('0xe')]['id']);})['catch'](function(_0x590f41){logger[_0x4943('0x10')](_0x4943('0x11'),_0x5117c7,JSON[_0x4943('0x12')](_0x590f41));})[_0x4943('0x13')](function(){_0x394d9d[_0x4943('0x14')]();});}}catch(_0x24bdd7){logger[_0x4943('0x10')]('[%s][CLOSE]\x20%s',_0x5117c7,JSON[_0x4943('0x12')](_0x24bdd7));_0x394d9d[_0x4943('0x14')]();}};}; \ No newline at end of file +var _0x76d2=['[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stop','stringify','moment','../../../../config/logger','routing','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','Interaction','channel','update','interaction','then'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x76d2,0xf8));var _0x276d=function(_0x2d509c,_0x538522){_0x2d509c=_0x2d509c-0x0;var _0xa32a0d=_0x76d2[_0x2d509c];return _0xa32a0d;};'use strict';var moment=require(_0x276d('0x0'));var logger=require(_0x276d('0x1'))(_0x276d('0x2'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x276d('0x3')),'smsInteraction':require(_0x276d('0x4')),'mailInteraction':require(_0x276d('0x5')),'faxInteraction':require(_0x276d('0x6'))};exports['consequence']=function(_0x5f21ff,_0xa888b4,_0x2303bc,_0x27729d){return function(_0x1904bf){try{logger[_0x276d('0x7')](_0x276d('0x8'),_0x5f21ff,_0xa888b4[0x0]);var _0x357d9a={'closed':0x1,'closedAt':moment()[_0x276d('0x9')](_0x276d('0xa')),'closeReason':'system','disposition':_0xa888b4[0x0]};if(rpc[_0x27729d['channel']+_0x276d('0xb')]){rpc[_0x27729d[_0x276d('0xc')]+_0x276d('0xb')][_0x276d('0xd')](_0x27729d[_0x276d('0xe')]['id'],_0x357d9a)[_0x276d('0xf')](function(_0x5a115f){logger['info'](_0x276d('0x10'),_0x5f21ff,_0x27729d[_0x276d('0xe')]['id']);})[_0x276d('0x11')](function(_0x147a1e){logger[_0x276d('0x12')](_0x276d('0x13'),_0x5f21ff,JSON['stringify'](_0x147a1e));})['finally'](function(){_0x1904bf[_0x276d('0x14')]();});}}catch(_0x341446){logger[_0x276d('0x12')](_0x276d('0x13'),_0x5f21ff,JSON[_0x276d('0x15')](_0x341446));_0x1904bf[_0x276d('0x14')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index 663fe0d..2691edf 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 _0x6dc7=['UserId','[%s][DIALOGFLOW]\x20%s','contact','format','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','created','body','getMustacheRender','create','then','info','catch','error','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','message','result','speech','Message','endConversation','next','stringify','lodash','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','isNil'];(function(_0x3133ed,_0xfcb5d){var _0x3c2d24=function(_0x2753a4){while(--_0x2753a4){_0x3133ed['push'](_0x3133ed['shift']());}};_0x3c2d24(++_0xfcb5d);}(_0x6dc7,0x1b8));var _0x76dc=function(_0x425b10,_0xe4cbbe){_0x425b10=_0x425b10-0x0;var _0x1eecfe=_0x6dc7[_0x425b10];return _0x1eecfe;};'use strict';var _=require(_0x76dc('0x0'));var moment=require(_0x76dc('0x1'));var apiai=require(_0x76dc('0x2'));var md5=require(_0x76dc('0x3'));var utils=require(_0x76dc('0x4'));var logger=require(_0x76dc('0x5'))(_0x76dc('0x6'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x76dc('0x7')),'smsMessage':require(_0x76dc('0x8')),'faxMessage':require(_0x76dc('0x9'))};exports['consequence']=function(_0x1946dd,_0x218021){return function(_0x526ca5){try{if(!_[_0x76dc('0xa')](this['interaction'][_0x76dc('0xb')])){logger['info'](_0x76dc('0xc'),_0x1946dd,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x526ca5['next']();}var _0xdceb83={'ContactId':this[_0x76dc('0xd')]['id'],'sentAt':moment()[_0x76dc('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};var _0x23f644=this[_0x76dc('0xf')];if(_0x23f644===_0x76dc('0x10')){_0xdceb83[_0x76dc('0x11')]=this[_0x76dc('0x12')]['id'];}else{_0xdceb83[_[_0x76dc('0x13')](_0x23f644)+_0x76dc('0x14')]=this[_0x76dc('0x12')]['id'];}_0xdceb83[_['upperFirst'](_0x23f644)+_0x76dc('0x15')]=this[_0x76dc('0x16')]['id'];if(this['interaction'][_0x76dc('0x17')]){var _0x430d53=_0x218021[0x2];if(!_['isEmpty'](_0x430d53)){_0xdceb83[_0x76dc('0x18')]=utils[_0x76dc('0x19')](_0x430d53,this);return rpc[_0x23f644+'Message'][_0x76dc('0x1a')](_0xdceb83)[_0x76dc('0x1b')](function(_0x52c3bc){logger[_0x76dc('0x1c')]('[%s][DIALOGFLOW]\x20%s',_0x1946dd,_0xdceb83[_0x76dc('0x18')]);})[_0x76dc('0x1d')](function(_0xbcc17b){logger[_0x76dc('0x1e')](_0x76dc('0xc'),_0x1946dd,JSON['stringify'](_0xbcc17b));})['finally'](function(){logger[_0x76dc('0x1c')](_0x76dc('0x1f'),_0x1946dd);_0x526ca5['stop']();});}else{logger[_0x76dc('0x1c')](_0x76dc('0x20'),_0x1946dd);_0x526ca5[_0x76dc('0x21')]();}}else{var _0x2c32f3=this;var _0x27e68b=apiai(_0x218021[0x0],{'language':_0x218021[0x1]||'en'});return _0x27e68b['textRequest'](this[_0x76dc('0x22')][_0x76dc('0x18')],{'sessionId':md5(this[_0x76dc('0x16')]['id'])})[_0x76dc('0x1b')](function(_0x1d9117){_0x2c32f3[_0x76dc('0x18')]['dialogflow']=_0x1d9117;_0xdceb83[_0x76dc('0x18')]=_0x1d9117[_0x76dc('0x23')]['fulfillment'][_0x76dc('0x24')];return rpc[_0x23f644+_0x76dc('0x25')]['create'](_0xdceb83)[_0x76dc('0x1b')](function(_0x5819ad){logger[_0x76dc('0x1c')](_0x76dc('0xc'),_0x1946dd,_0xdceb83[_0x76dc('0x18')]);if(_0x1d9117[_0x76dc('0x23')]['metadata'][_0x76dc('0x26')]){_0x526ca5[_0x76dc('0x27')]();}else{_0x526ca5[_0x76dc('0x21')]();}})[_0x76dc('0x1d')](function(_0x4d30de){logger[_0x76dc('0x1e')](_0x76dc('0xc'),_0x1946dd,JSON[_0x76dc('0x28')](_0x4d30de));_0x526ca5[_0x76dc('0x27')]();});})[_0x76dc('0x1d')](function(_0x44989f){logger[_0x76dc('0x1e')](_0x76dc('0xc'),_0x1946dd,_0x44989f[_0x76dc('0x22')]);_0x526ca5['next']();});}}catch(_0x52648e){logger[_0x76dc('0x1e')](_0x76dc('0xc'),_0x1946dd,JSON[_0x76dc('0x28')](_0x52648e));_0x526ca5['stop']();}};}; \ No newline at end of file +var _0x72f9=['InteractionId','interaction','created','isEmpty','getMustacheRender','create','then','catch','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','textRequest','message','body','dialogflow','result','fulfillment','speech','Message','metadata','endConversation','next','lodash','moment','apiai-promise','md5','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','out','channel','ChatWebsiteId','account','AccountId'];(function(_0x471b6c,_0x5ea554){var _0x297956=function(_0x27ae98){while(--_0x27ae98){_0x471b6c['push'](_0x471b6c['shift']());}};_0x297956(++_0x5ea554);}(_0x72f9,0x1a5));var _0x972f=function(_0x4b91c4,_0x23f35f){_0x4b91c4=_0x4b91c4-0x0;var _0x25cb80=_0x72f9[_0x4b91c4];return _0x25cb80;};'use strict';var _=require(_0x972f('0x0'));var moment=require(_0x972f('0x1'));var apiai=require(_0x972f('0x2'));var md5=require(_0x972f('0x3'));var utils=require(_0x972f('0x4'));var logger=require(_0x972f('0x5'))('routing');var rpc={'chatMessage':require(_0x972f('0x6')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x972f('0x7')),'smsMessage':require(_0x972f('0x8')),'faxMessage':require(_0x972f('0x9'))};exports['consequence']=function(_0x19200d,_0x8c540c){return function(_0x2364ca){try{if(!_['isNil'](this['interaction']['UserId'])){logger[_0x972f('0xa')](_0x972f('0xb'),_0x19200d,_0x972f('0xc'));return _0x2364ca['next']();}var _0x37b15f={'ContactId':this[_0x972f('0xd')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x972f('0xe')};var _0xb52aa7=this[_0x972f('0xf')];if(_0xb52aa7==='chat'){_0x37b15f[_0x972f('0x10')]=this[_0x972f('0x11')]['id'];}else{_0x37b15f[_['upperFirst'](_0xb52aa7)+_0x972f('0x12')]=this[_0x972f('0x11')]['id'];}_0x37b15f[_['upperFirst'](_0xb52aa7)+_0x972f('0x13')]=this[_0x972f('0x14')]['id'];if(this[_0x972f('0x14')][_0x972f('0x15')]){var _0x372fbe=_0x8c540c[0x2];if(!_[_0x972f('0x16')](_0x372fbe)){_0x37b15f['body']=utils[_0x972f('0x17')](_0x372fbe,this);return rpc[_0xb52aa7+'Message'][_0x972f('0x18')](_0x37b15f)[_0x972f('0x19')](function(_0x420144){logger[_0x972f('0xa')](_0x972f('0xb'),_0x19200d,_0x37b15f['body']);})[_0x972f('0x1a')](function(_0x1ebdcf){logger[_0x972f('0x1b')](_0x972f('0xb'),_0x19200d,JSON[_0x972f('0x1c')](_0x1ebdcf));})[_0x972f('0x1d')](function(){logger[_0x972f('0xa')](_0x972f('0x1e'),_0x19200d);_0x2364ca['stop']();});}else{logger['info'](_0x972f('0x1f'),_0x19200d);_0x2364ca[_0x972f('0x20')]();}}else{var _0x45a7f7=this;var _0x203c71=apiai(_0x8c540c[0x0],{'language':_0x8c540c[0x1]||'en'});return _0x203c71[_0x972f('0x21')](this[_0x972f('0x22')][_0x972f('0x23')],{'sessionId':md5(this[_0x972f('0x14')]['id'])})['then'](function(_0x2afa3a){_0x45a7f7['body'][_0x972f('0x24')]=_0x2afa3a;_0x37b15f[_0x972f('0x23')]=_0x2afa3a[_0x972f('0x25')][_0x972f('0x26')][_0x972f('0x27')];return rpc[_0xb52aa7+_0x972f('0x28')]['create'](_0x37b15f)[_0x972f('0x19')](function(_0x3a129b){logger['info'](_0x972f('0xb'),_0x19200d,_0x37b15f[_0x972f('0x23')]);if(_0x2afa3a[_0x972f('0x25')][_0x972f('0x29')][_0x972f('0x2a')]){_0x2364ca['next']();}else{_0x2364ca[_0x972f('0x20')]();}})[_0x972f('0x1a')](function(_0x17832a){logger['error'](_0x972f('0xb'),_0x19200d,JSON[_0x972f('0x1c')](_0x17832a));_0x2364ca[_0x972f('0x2b')]();});})[_0x972f('0x1a')](function(_0x489037){logger[_0x972f('0x1b')]('[%s][DIALOGFLOW]\x20%s',_0x19200d,_0x489037['message']);_0x2364ca[_0x972f('0x2b')]();});}}catch(_0x47c6f3){logger[_0x972f('0x1b')](_0x972f('0xb'),_0x19200d,JSON[_0x972f('0x1c')](_0x47c6f3));_0x2364ca[_0x972f('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 0832fa0..dac9f99 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 _0x1cb0=['string','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','getMustacheRender','length','error','[%s][GOTOIF]\x20%s','map','join','condition','priorityTrue','priorityFalse','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','rules','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','stringify','validate','lodash','html-to-text','routing'];(function(_0x5941c1,_0x827962){var _0x4a0865=function(_0x2d0e1c){while(--_0x2d0e1c){_0x5941c1['push'](_0x5941c1['shift']());}};_0x4a0865(++_0x827962);}(_0x1cb0,0xa4));var _0x01cb=function(_0x478f6b,_0x32d534){_0x478f6b=_0x478f6b-0x0;var _0x56dc63=_0x1cb0[_0x478f6b];return _0x56dc63;};'use strict';var schema=require(_0x01cb('0x0'));var _=require(_0x01cb('0x1'));var htmlToText=require(_0x01cb('0x2'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x01cb('0x3'));var gotoif=schema({'condition':{'type':_0x01cb('0x4'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x01cb('0x5'),'message':_0x01cb('0x6')},'priorityFalse':{'type':_0x01cb('0x5'),'message':_0x01cb('0x7')}});exports[_0x01cb('0x8')]=function(_0x5ec70d,_0xdb32){return function(_0x18c81d){try{var _0x4acb2b={'condition':htmlToText['fromString'](utils[_0x01cb('0x9')](_0xdb32[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0xdb32[0x1],'priorityFalse':_0xdb32[0x2]};var _0x542fe1=gotoif[_0x01cb('0x0')](_0x4acb2b,{'typecast':!![]});if(_0x542fe1[_0x01cb('0xa')]){logger[_0x01cb('0xb')](_0x01cb('0xc'),_0x5ec70d,_[_0x01cb('0xd')](_0x542fe1,'message')[_0x01cb('0xe')](',\x20'));_0x18c81d['stop']();}else{try{var _0x2e9d30=eval('('+_0x4acb2b[_0x01cb('0xf')]+')');var _0x27b094=_0x2e9d30?_0x4acb2b[_0x01cb('0x10')]:_0x4acb2b[_0x01cb('0x11')];logger['info'](_0x01cb('0x12'),_0x5ec70d,_0x4acb2b[_0x01cb('0xf')],_0x2e9d30,_0x27b094||'next');if(_0x27b094){var _0x4f942f=_['findIndex'](_0x18c81d[_0x01cb('0x13')](),{'p':_0x27b094});if(_0x4f942f>=0x0){logger[_0x01cb('0x14')](_0x01cb('0x15'),_0x5ec70d,_0x27b094||_0x01cb('0x16'),_0x4f942f);_0x18c81d['next'](_0x4f942f);}else{logger['info'](_0x01cb('0x17'),_0x5ec70d,_0x27b094||_0x01cb('0x16'));_0x18c81d[_0x01cb('0x18')]();}}else{_0x18c81d[_0x01cb('0x16')]();}}catch(_0x5921a3){logger[_0x01cb('0xb')](_0x01cb('0x19'),_0x5ec70d,_0x5921a3[_0x01cb('0x1a')]);_0x18c81d[_0x01cb('0x18')]();}}}catch(_0xa03359){logger[_0x01cb('0xb')](_0x01cb('0xc'),_0x5ec70d,JSON[_0x01cb('0x1b')](_0xa03359));_0x18c81d['stop']();}};}; \ No newline at end of file +var _0xc4aa=['stop','condition','priorityTrue','next','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','info','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','validate','html-to-text','./utils','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','map','message'];(function(_0x5acb2d,_0xf24b60){var _0x3820f1=function(_0x181837){while(--_0x181837){_0x5acb2d['push'](_0x5acb2d['shift']());}};_0x3820f1(++_0xf24b60);}(_0xc4aa,0x175));var _0xac4a=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xc4aa[_0x2d2c16];return _0x53f2fb;};'use strict';var schema=require(_0xac4a('0x0'));var _=require('lodash');var htmlToText=require(_0xac4a('0x1'));var utils=require(_0xac4a('0x2'));var logger=require('../../../../config/logger')(_0xac4a('0x3'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0xac4a('0x4')},'priorityTrue':{'type':'number','message':_0xac4a('0x5')},'priorityFalse':{'type':_0xac4a('0x6'),'message':_0xac4a('0x7')}});exports[_0xac4a('0x8')]=function(_0x2eb7ed,_0x21b224){return function(_0x10e5fb){try{var _0x2ab7c2={'condition':htmlToText[_0xac4a('0x9')](utils[_0xac4a('0xa')](_0x21b224[0x0],this),{'wordwrap':![]})[_0xac4a('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x21b224[0x1],'priorityFalse':_0x21b224[0x2]};var _0x4d359f=gotoif[_0xac4a('0x0')](_0x2ab7c2,{'typecast':!![]});if(_0x4d359f[_0xac4a('0xc')]){logger[_0xac4a('0xd')](_0xac4a('0xe'),_0x2eb7ed,_[_0xac4a('0xf')](_0x4d359f,_0xac4a('0x10'))['join'](',\x20'));_0x10e5fb[_0xac4a('0x11')]();}else{try{var _0x204420=eval('('+_0x2ab7c2[_0xac4a('0x12')]+')');var _0x43fdfe=_0x204420?_0x2ab7c2[_0xac4a('0x13')]:_0x2ab7c2['priorityFalse'];logger['info']('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x2eb7ed,_0x2ab7c2[_0xac4a('0x12')],_0x204420,_0x43fdfe||_0xac4a('0x14'));if(_0x43fdfe){var _0xaa9a4f=_['findIndex'](_0x10e5fb[_0xac4a('0x15')](),{'p':_0x43fdfe});if(_0xaa9a4f>=0x0){logger['info'](_0xac4a('0x16'),_0x2eb7ed,_0x43fdfe||'next',_0xaa9a4f);_0x10e5fb[_0xac4a('0x14')](_0xaa9a4f);}else{logger[_0xac4a('0x17')](_0xac4a('0x18'),_0x2eb7ed,_0x43fdfe||_0xac4a('0x14'));_0x10e5fb[_0xac4a('0x11')]();}}else{_0x10e5fb['next']();}}catch(_0x9bf961){logger['error'](_0xac4a('0x19'),_0x2eb7ed,_0x9bf961['message']);_0x10e5fb[_0xac4a('0x11')]();}}}catch(_0x3994e2){logger[_0xac4a('0xd')]('[%s][GOTOIF]\x20%s',_0x2eb7ed,JSON['stringify'](_0x3994e2));_0x10e5fb[_0xac4a('0x11')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index f1d9c1e..b828549 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 _0xd338=['priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','length','error','[%s][GOTOP]\x20%s','join','stop','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','info','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','next','stringify','validate','lodash','routing','number'];(function(_0x2c248c,_0x35d9c6){var _0x4d5967=function(_0x4af230){while(--_0x4af230){_0x2c248c['push'](_0x2c248c['shift']());}};_0x4d5967(++_0x35d9c6);}(_0xd338,0x178));var _0x8d33=function(_0x5180c3,_0x4b35f7){_0x5180c3=_0x5180c3-0x0;var _0x55c975=_0xd338[_0x5180c3];return _0x55c975;};'use strict';var schema=require(_0x8d33('0x0'));var _=require(_0x8d33('0x1'));var logger=require('../../../../config/logger')(_0x8d33('0x2'));var gotop=schema({'priority':{'type':_0x8d33('0x3'),'required':!![],'message':_0x8d33('0x4')}});exports['consequence']=function(_0x108f33,_0x211634){return function(_0x46bde3){try{var _0xe89b39={'priority':_0x211634[0x0]};var _0x100b6d=gotop[_0x8d33('0x0')](_0xe89b39,{'typecast':!![]});if(_0x100b6d[_0x8d33('0x5')]){logger[_0x8d33('0x6')](_0x8d33('0x7'),_0x108f33,_['map'](_0x100b6d,'message')[_0x8d33('0x8')](',\x20'));_0x46bde3[_0x8d33('0x9')]();}else{logger['info'](_0x8d33('0xa'),_0x108f33,_0xe89b39[_0x8d33('0xb')]);if(_0xe89b39[_0x8d33('0xb')]){var _0x4039db=_[_0x8d33('0xc')](_0x46bde3[_0x8d33('0xd')](),{'p':_0xe89b39[_0x8d33('0xb')]});if(_0x4039db>=0x0){logger[_0x8d33('0xe')](_0x8d33('0xf'),_0x108f33,_0xe89b39[_0x8d33('0xb')]||'next',_0x4039db);_0x46bde3['next'](_0x4039db);}else{logger[_0x8d33('0xe')](_0x8d33('0x10'),_0x108f33,_0xe89b39[_0x8d33('0xb')]||_0x8d33('0x11'));_0x46bde3[_0x8d33('0x9')]();}}else{_0x46bde3['next']();}}}catch(_0x591c07){logger[_0x8d33('0x6')](_0x8d33('0x7'),_0x108f33,JSON[_0x8d33('0x12')](_0x591c07));_0x46bde3[_0x8d33('0x9')]();}};}; \ No newline at end of file +var _0xf923=['priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','map','message','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','validate','lodash','../../../../config/logger','routing','number'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xf923,0x19f));var _0x3f92=function(_0x111e94,_0x31c837){_0x111e94=_0x111e94-0x0;var _0x3de107=_0xf923[_0x111e94];return _0x3de107;};'use strict';var schema=require(_0x3f92('0x0'));var _=require(_0x3f92('0x1'));var logger=require(_0x3f92('0x2'))(_0x3f92('0x3'));var gotop=schema({'priority':{'type':_0x3f92('0x4'),'required':!![],'message':_0x3f92('0x5')}});exports[_0x3f92('0x6')]=function(_0x122d79,_0x8dac2e){return function(_0x109ec2){try{var _0x368890={'priority':_0x8dac2e[0x0]};var _0x57f348=gotop[_0x3f92('0x0')](_0x368890,{'typecast':!![]});if(_0x57f348[_0x3f92('0x7')]){logger[_0x3f92('0x8')](_0x3f92('0x9'),_0x122d79,_[_0x3f92('0xa')](_0x57f348,_0x3f92('0xb'))['join'](',\x20'));_0x109ec2[_0x3f92('0xc')]();}else{logger[_0x3f92('0xd')](_0x3f92('0xe'),_0x122d79,_0x368890['priority']);if(_0x368890[_0x3f92('0xf')]){var _0x20f700=_[_0x3f92('0x10')](_0x109ec2[_0x3f92('0x11')](),{'p':_0x368890[_0x3f92('0xf')]});if(_0x20f700>=0x0){logger[_0x3f92('0xd')](_0x3f92('0x12'),_0x122d79,_0x368890[_0x3f92('0xf')]||_0x3f92('0x13'),_0x20f700);_0x109ec2['next'](_0x20f700);}else{logger[_0x3f92('0xd')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x122d79,_0x368890[_0x3f92('0xf')]||'next');_0x109ec2[_0x3f92('0xc')]();}}else{_0x109ec2[_0x3f92('0x13')]();}}}catch(_0x52ff9f){logger[_0x3f92('0x8')]('[%s][GOTOP]\x20%s',_0x122d79,JSON['stringify'](_0x52ff9f));_0x109ec2[_0x3f92('0xc')]();}};}; \ 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 bb81dca..6cb3aa5 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 _0xeba8=['[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','InteractionId','interaction','Message','then','info'];(function(_0x4b70a2,_0x5d0fbd){var _0x2170fa=function(_0x245bf2){while(--_0x245bf2){_0x4b70a2['push'](_0x4b70a2['shift']());}};_0x2170fa(++_0x5d0fbd);}(_0xeba8,0x19c));var _0x8eba=function(_0x504df1,_0x289598){_0x504df1=_0x504df1-0x0;var _0x1063b5=_0xeba8[_0x504df1];return _0x1063b5;};'use strict';var _=require('lodash');var utils=require(_0x8eba('0x0'));var logger=require(_0x8eba('0x1'))(_0x8eba('0x2'));var rpc={'chatMessage':require(_0x8eba('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x8eba('0x4')),'smsMessage':require(_0x8eba('0x5')),'faxMessage':require(_0x8eba('0x6'))};exports[_0x8eba('0x7')]=function(_0x1a0f15,_0x4f6aee){return function(_0x4ec9fc){try{var _0x5825c6={'body':utils[_0x8eba('0x8')](_0x4f6aee[0x0],this),'ContactId':this[_0x8eba('0x9')]['id']};if(this[_0x8eba('0xa')]===_0x8eba('0xb')){_0x5825c6[_0x8eba('0xc')]=this[_0x8eba('0xd')]['id'];}else{_0x5825c6[_[_0x8eba('0xe')](this[_0x8eba('0xa')])+'AccountId']=this[_0x8eba('0xd')]['id'];}_0x5825c6[_[_0x8eba('0xe')](this[_0x8eba('0xa')])+_0x8eba('0xf')]=this[_0x8eba('0x10')]['id'];if(rpc[this[_0x8eba('0xa')]+_0x8eba('0x11')]){return rpc[this[_0x8eba('0xa')]+_0x8eba('0x11')]['create'](_0x5825c6)[_0x8eba('0x12')](function(_0x17cdc1){logger[_0x8eba('0x13')](_0x8eba('0x14'),_0x1a0f15,_0x5825c6[_0x8eba('0x15')]);_0x4ec9fc[_0x8eba('0x16')]();})[_0x8eba('0x17')](function(_0x129f95){logger[_0x8eba('0x18')](_0x8eba('0x14'),_0x1a0f15,JSON[_0x8eba('0x19')](_0x129f95));_0x4ec9fc[_0x8eba('0x1a')]();});}}catch(_0x5bb296){logger['error'](_0x8eba('0x14'),_0x1a0f15,JSON[_0x8eba('0x19')](_0x5bb296));_0x4ec9fc[_0x8eba('0x1a')]();}};}; \ No newline at end of file +var _0xf602=['account','interaction','Message','create','then','[%s][MESSAGE]\x20%s','body','next','error','stringify','stop','lodash','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','getMustacheRender','contact','channel','chat'];(function(_0x486b72,_0x1653cb){var _0x4dc8aa=function(_0x2ec93e){while(--_0x2ec93e){_0x486b72['push'](_0x486b72['shift']());}};_0x4dc8aa(++_0x1653cb);}(_0xf602,0x1c0));var _0x2f60=function(_0x30604b,_0x3405e8){_0x30604b=_0x30604b-0x0;var _0x500e76=_0xf602[_0x30604b];return _0x500e76;};'use strict';var _=require(_0x2f60('0x0'));var utils=require(_0x2f60('0x1'));var logger=require(_0x2f60('0x2'))('routing');var rpc={'chatMessage':require(_0x2f60('0x3')),'openchannelMessage':require(_0x2f60('0x4')),'mailMessage':require(_0x2f60('0x5')),'smsMessage':require(_0x2f60('0x6')),'faxMessage':require(_0x2f60('0x7'))};exports['consequence']=function(_0x11ff3d,_0x3e6c61){return function(_0x671ccb){try{var _0x1cbc0a={'body':utils[_0x2f60('0x8')](_0x3e6c61[0x0],this),'ContactId':this[_0x2f60('0x9')]['id']};if(this[_0x2f60('0xa')]===_0x2f60('0xb')){_0x1cbc0a['ChatWebsiteId']=this[_0x2f60('0xc')]['id'];}else{_0x1cbc0a[_['upperFirst'](this[_0x2f60('0xa')])+'AccountId']=this[_0x2f60('0xc')]['id'];}_0x1cbc0a[_['upperFirst'](this[_0x2f60('0xa')])+'InteractionId']=this[_0x2f60('0xd')]['id'];if(rpc[this[_0x2f60('0xa')]+_0x2f60('0xe')]){return rpc[this['channel']+'Message'][_0x2f60('0xf')](_0x1cbc0a)[_0x2f60('0x10')](function(_0x47fc4e){logger['info'](_0x2f60('0x11'),_0x11ff3d,_0x1cbc0a[_0x2f60('0x12')]);_0x671ccb[_0x2f60('0x13')]();})['catch'](function(_0x2bfc76){logger[_0x2f60('0x14')](_0x2f60('0x11'),_0x11ff3d,JSON[_0x2f60('0x15')](_0x2bfc76));_0x671ccb[_0x2f60('0x16')]();});}}catch(_0x59e872){logger[_0x2f60('0x14')](_0x2f60('0x11'),_0x11ff3d,JSON['stringify'](_0x59e872));_0x671ccb[_0x2f60('0x16')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index 6c7f243..74a145d 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 _0x3de9=['routing','consequence','info','[%s][NOOP]\x20%s','next','error','stringify','../../../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3de9,0x187));var _0x93de=function(_0x1cf645,_0x99ab93){_0x1cf645=_0x1cf645-0x0;var _0x30db74=_0x3de9[_0x1cf645];return _0x30db74;};'use strict';var utils=require('./utils');var logger=require(_0x93de('0x0'))(_0x93de('0x1'));exports[_0x93de('0x2')]=function(_0x39ab37,_0x181b80){return function(_0x46ebc1){try{logger[_0x93de('0x3')](_0x93de('0x4'),_0x39ab37,utils['getMustacheRender'](_0x181b80[0x0],this));_0x46ebc1[_0x93de('0x5')]();}catch(_0x2d91e9){logger[_0x93de('0x6')](_0x93de('0x4'),_0x39ab37,JSON[_0x93de('0x7')](_0x2d91e9));_0x46ebc1['stop']();}};}; \ No newline at end of file +var _0xa55d=['../../../../config/logger','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','stop','./utils'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xa55d,0x147));var _0xda55=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xa55d[_0x3bf83f];return _0x22c4a9;};'use strict';var utils=require(_0xda55('0x0'));var logger=require(_0xda55('0x1'))('routing');exports[_0xda55('0x2')]=function(_0x434fa1,_0x530a3e){return function(_0x44a206){try{logger[_0xda55('0x3')](_0xda55('0x4'),_0x434fa1,utils[_0xda55('0x5')](_0x530a3e[0x0],this));_0x44a206[_0xda55('0x6')]();}catch(_0x1c83a2){logger['error'](_0xda55('0x4'),_0x434fa1,JSON['stringify'](_0x1c83a2));_0x44a206[_0xda55('0x7')]();}};}; \ 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 698eb81..b16c61c 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 _0xf104=['number','timeout\x20is\x20a\x20number','body','from','contact','list','upperFirst','channel','QueueId','interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','waiting','YYYY-MM-DD\x20HH:mm:ss','accepted','[%s][STOP:QUEUE][NAME:%s]','update','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','end','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','[%s][QUEUE]\x20ROUTING\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','defaults','localhost','redis','queue_id','account','queue','joinAt','format','pick','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/faxQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x10173d,_0x2f5db5){var _0x13fa40=function(_0x5d6580){while(--_0x5d6580){_0x10173d['push'](_0x10173d['shift']());}};_0x13fa40(++_0x2f5db5);}(_0xf104,0x11b));var _0x4f10=function(_0x352f61,_0x3248ff){_0x352f61=_0x352f61-0x0;var _0x398608=_0xf104[_0x352f61];return _0x398608;};'use strict';var schema=require(_0x4f10('0x0'));var _=require(_0x4f10('0x1'));var util=require(_0x4f10('0x2'));var seqqueue=require(_0x4f10('0x3'));var moment=require(_0x4f10('0x4'));var Redis=require(_0x4f10('0x5'));var config=require(_0x4f10('0x6'));var logger=require(_0x4f10('0x7'))(_0x4f10('0x8'));var strategy=require(_0x4f10('0x9'));config['redis']=_[_0x4f10('0xa')](config['redis'],{'host':_0x4f10('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4f10('0xc')]));var attributes=['id',_0x4f10('0xd'),_0x4f10('0xe'),_0x4f10('0xf'),'from',_0x4f10('0x10')];function emit(_0x224d65,_0x26adf6,_0x408dc4){io['to'](_0x224d65)['emit'](_0x26adf6,_0x408dc4);}function emitChannelQueueInteraction(_0x558e14,_0x3e2659,_0x3f7d38,_0x26e9a9,_0x47fd30,_0x5df872,_0x421588,_0x28ff11){_0x3f7d38[_0x4f10('0xd')]=_0x28ff11;_0x3f7d38[_0x4f10('0xf')]=_0x3e2659;_0x3f7d38[_0x4f10('0xe')]=_0x26e9a9;_0x3f7d38['id']=_0x47fd30;if(_0x5df872){_0x421588[util[_0x4f10('0x11')]('%sQueuesWaitingInteractions',_0x558e14)][_0x47fd30]=_[_0x4f10('0x12')](_0x3f7d38,attributes);}else{delete _0x421588[util['format'](_0x4f10('0x13'),_0x558e14)][_0x47fd30];}emit(util[_0x4f10('0x11')](_0x4f10('0x14'),_0x558e14,_0x3e2659),util[_0x4f10('0x11')](_0x4f10('0x15'),_0x558e14,_0x5df872?_0x4f10('0x16'):_0x4f10('0x17')),_[_0x4f10('0x12')](_0x3f7d38,attributes));}var rpc={'openchannelQueueReport':require(_0x4f10('0x18')),'mailQueueReport':require(_0x4f10('0x19')),'chatQueueReport':require(_0x4f10('0x1a')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0x4f10('0x1b'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0x4f10('0x1c')},'timeout':{'type':_0x4f10('0x1d'),'message':_0x4f10('0x1e')}});function startRouting(_0x94367b,_0x289aee,_0xe9ab17,_0x4ffddf){if(_0x94367b&&_0x289aee&&_0xe9ab17){_0x289aee['waiting']+=0x1;var _0x21a9bc={'uniqueid':_0x94367b,'from':_0xe9ab17['body']?_0xe9ab17[_0x4f10('0x1f')][_0x4f10('0x20')]:'','joinAt':moment()[_0x4f10('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xe9ab17[_0x4f10('0x21')]?_0xe9ab17[_0x4f10('0x21')]['id']:null,'ListId':_0xe9ab17[_0x4f10('0x22')]?_0xe9ab17[_0x4f10('0x22')]['id']:null};_0x21a9bc[_[_0x4f10('0x23')](_0xe9ab17[_0x4f10('0x24')])+_0x4f10('0x25')]=_0x289aee['id']||null;_0x21a9bc[_[_0x4f10('0x23')](_0xe9ab17[_0x4f10('0x24')])+'InteractionId']=_0xe9ab17[_0x4f10('0x26')]?_0xe9ab17[_0x4f10('0x26')]['id']:null;_0x21a9bc[_[_0x4f10('0x23')](_0xe9ab17[_0x4f10('0x24')])+_0x4f10('0x27')]=_0xe9ab17[_0x4f10('0x28')]?_0xe9ab17['message']['id']:null;_0x21a9bc[_[_0x4f10('0x23')](_0xe9ab17[_0x4f10('0x24')])+(_0xe9ab17[_0x4f10('0x24')]!==_0x4f10('0x29')?_0x4f10('0x2a'):_0x4f10('0x2b'))]=_0xe9ab17[_0x4f10('0xe')]?_0xe9ab17[_0x4f10('0xe')]['id']:null;logger[_0x4f10('0x2c')](util[_0x4f10('0x11')](_0x4f10('0x2d'),_0x94367b,_0x289aee['name']));emitChannelQueueInteraction(_0xe9ab17['channel'],_0x289aee[_0x4f10('0x2e')],_0x21a9bc,_0xe9ab17[_0x4f10('0xe')][_0x4f10('0x2e')],_0xe9ab17[_0x4f10('0x28')]['id'],!![],_0x4ffddf,_0x289aee['id']);if(rpc[_0xe9ab17[_0x4f10('0x24')]+_0x4f10('0x2f')]){return rpc[_0xe9ab17[_0x4f10('0x24')]+_0x4f10('0x2f')][_0x4f10('0x30')](_0x21a9bc)[_0x4f10('0x31')](function(_0x52b798){logger[_0x4f10('0x32')](_0x4f10('0x33'));});}}}function stopRouting(_0x317056,_0x44f124,_0x2cb9fb,_0x24d870){if(_0x317056&&_0x44f124){_0x44f124[_0x4f10('0x34')]-=0x1;var _0x553fd1={'leaveAt':moment()[_0x4f10('0x11')](_0x4f10('0x35')),'acceptAt':moment()[_0x4f10('0x11')](_0x4f10('0x35')),'reason':_0x4f10('0x36')};logger[_0x4f10('0x2c')](util[_0x4f10('0x11')](_0x4f10('0x37'),_0x317056,_0x44f124[_0x4f10('0x2e')]));emitChannelQueueInteraction(_0x2cb9fb[_0x4f10('0x24')],_0x44f124[_0x4f10('0x2e')],_0x2cb9fb['body'],_0x2cb9fb[_0x4f10('0xe')]['name'],_0x2cb9fb['message']['id'],![],_0x24d870,_0x44f124['id']);if(rpc[_0x2cb9fb['channel']+_0x4f10('0x2f')]){return rpc[_0x2cb9fb[_0x4f10('0x24')]+'QueueReport'][_0x4f10('0x38')](_0x317056,_0x553fd1)['catch'](function(_0x13ecb4){logger['error']('update\x20queue\x20report');});}}}function endRouting(_0x4d8118,_0x5a1b2a,_0x160905,_0x35ee39){if(_0x4d8118&&_0x5a1b2a){_0x5a1b2a['waiting']-=0x1;var _0x16d6b3={'leaveAt':moment()['format'](_0x4f10('0x35')),'exitAt':moment()[_0x4f10('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x4f10('0x39')};logger[_0x4f10('0x2c')](util[_0x4f10('0x11')](_0x4f10('0x3a'),_0x4d8118,_0x5a1b2a[_0x4f10('0x2e')]));emitChannelQueueInteraction(_0x160905[_0x4f10('0x24')],_0x5a1b2a[_0x4f10('0x2e')],_0x160905[_0x4f10('0x1f')],_0x160905[_0x4f10('0xe')][_0x4f10('0x2e')],_0x160905[_0x4f10('0x28')]['id'],![],_0x35ee39);if(rpc[_0x160905[_0x4f10('0x24')]+_0x4f10('0x2f')]){return rpc[_0x160905[_0x4f10('0x24')]+_0x4f10('0x2f')][_0x4f10('0x38')](_0x4d8118,_0x16d6b3)[_0x4f10('0x31')](function(_0x407003){logger[_0x4f10('0x32')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x541786){return function(_0x31e7cb){return _0x31e7cb[_0x4f10('0x2e')][_0x4f10('0x3b')]()===_0x541786[_0x4f10('0x3b')]();};}exports[_0x4f10('0x3c')]=function(_0xefc2ba,_0x4d2e4a,_0x5a0018,_0x4db742){return function(_0x287e75){try{var _0x5245d9={'name':_0x4d2e4a[0x0],'timeout':_0x4d2e4a[0x1]};var _0x420408=queue['validate'](_0x5245d9,{'typecast':!![]});if(_0x420408['length']){logger[_0x4f10('0x32')](_0x4f10('0x3d'),_0xefc2ba,_[_0x4f10('0x3e')](_0x420408,_0x4f10('0x28'))[_0x4f10('0x3f')](',\x20'));_0x287e75[_0x4f10('0x40')]();}else{var _0x3f116c=_[_0x4f10('0x41')](_0x5a0018[_0x4db742[_0x4f10('0x24')]+_0x4f10('0x42')],handleFindQueue(_0x5245d9[_0x4f10('0x2e')]));if(_0x3f116c){startRouting(_0xefc2ba,_0x3f116c,_0x4db742,_0x5a0018);var _0x56a5dc=(_0x3f116c[_0x4f10('0x39')]||0xa)*0x3e8;var _0x3226a5=(_0x5245d9['timeout']||0x14)*0x3e8;var _0x2b00f5,_0x22edbb;if(_0x56a5dc>_0x3226a5){_0x3226a5=_0x56a5dc;}var _0x5e35bd=seqqueue['createQueue'](_0x56a5dc);_0x5e35bd['id']=_0xefc2ba;_0x5e35bd['atimeout']=_0x56a5dc;_0x5e35bd['qtimeout']=_0x3226a5;_0x5e35bd[_0x4f10('0x24')]=_0x4db742['channel'];_0x5a0018['rules'][_0xefc2ba]['on'](_0x4f10('0x43'),function(){stopRouting(_0xefc2ba,_0x3f116c,_0x4db742,_0x5a0018);_0x5e35bd['close'](!![]);clearTimeout(_0x2b00f5);_0x2b00f5=undefined;if(_0x5a0018[_0x4f10('0x44')][_0xefc2ba]){delete _0x5a0018[_0x4f10('0x44')][_0xefc2ba];}logger[_0x4f10('0x2c')](_0x4f10('0x45'),_0xefc2ba);_0x287e75[_0x4f10('0x40')]();});_0x2b00f5=setTimeout(function(){endRouting(_0xefc2ba,_0x3f116c,_0x4db742,_0x5a0018);clearTimeout(_0x2b00f5);_0x5e35bd['close'](!![]);logger[_0x4f10('0x2c')](_0x4f10('0x46'),_0xefc2ba);_0x287e75[_0x4f10('0x47')]();},_0x3226a5);switch(_0x3f116c[_0x4f10('0x48')]){case _0x4f10('0x49'):strategy[_0x4f10('0x49')](_0x5e35bd,_0x3f116c,_0x5a0018,_0x4db742);break;default:strategy[_0x4f10('0x4a')](_0x5e35bd,_0x3f116c,_0x5a0018,_0x4db742);}}else{logger[_0x4f10('0x32')](_0x4f10('0x4b'),_0xefc2ba,_0x5245d9[_0x4f10('0x2e')]);_0x287e75[_0x4f10('0x40')]();}}}catch(_0x25ea16){console[_0x4f10('0x4c')](_0x25ea16);logger[_0x4f10('0x32')]('[%s][QUEUE]\x20%s',_0xefc2ba,_0x25ea16[_0x4f10('0x4d')]);_0x287e75[_0x4f10('0x40')]();}};}; \ No newline at end of file +var _0xda3f=['%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','chat','WebsiteId','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','accepted','info','[%s][STOP:QUEUE][NAME:%s]','error','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','update','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','stop','find','Queues','timeout','createQueue','atimeout','qtimeout','end','close','rules','[%s][QUEUE]\x20ROUTING\x20END','next','strategy','rrmemory','log','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','queue_id','from','emit','queue','account','format','pick','%sQueuesWaitingInteractions'];(function(_0x20767a,_0x395951){var _0x376bf2=function(_0x2b4992){while(--_0x2b4992){_0x20767a['push'](_0x20767a['shift']());}};_0x376bf2(++_0x395951);}(_0xda3f,0x173));var _0xfda3=function(_0x529c3b,_0x45917e){_0x529c3b=_0x529c3b-0x0;var _0x117ccc=_0xda3f[_0x529c3b];return _0x117ccc;};'use strict';var schema=require(_0xfda3('0x0'));var _=require(_0xfda3('0x1'));var util=require(_0xfda3('0x2'));var seqqueue=require(_0xfda3('0x3'));var moment=require(_0xfda3('0x4'));var Redis=require(_0xfda3('0x5'));var config=require(_0xfda3('0x6'));var logger=require(_0xfda3('0x7'))('routing');var strategy=require('./strategy');config[_0xfda3('0x8')]=_[_0xfda3('0x9')](config[_0xfda3('0x8')],{'host':_0xfda3('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xfda3('0x8')]));var attributes=['id',_0xfda3('0xb'),'account','queue',_0xfda3('0xc'),'joinAt'];function emit(_0x70fc2a,_0x2570ca,_0x44b0ed){io['to'](_0x70fc2a)[_0xfda3('0xd')](_0x2570ca,_0x44b0ed);}function emitChannelQueueInteraction(_0x3689be,_0x472f01,_0x12cef5,_0x5758b7,_0x16507b,_0x446029,_0x48bd9c,_0x22f280){_0x12cef5[_0xfda3('0xb')]=_0x22f280;_0x12cef5[_0xfda3('0xe')]=_0x472f01;_0x12cef5[_0xfda3('0xf')]=_0x5758b7;_0x12cef5['id']=_0x16507b;if(_0x446029){_0x48bd9c[util[_0xfda3('0x10')]('%sQueuesWaitingInteractions',_0x3689be)][_0x16507b]=_[_0xfda3('0x11')](_0x12cef5,attributes);}else{delete _0x48bd9c[util[_0xfda3('0x10')](_0xfda3('0x12'),_0x3689be)][_0x16507b];}emit(util[_0xfda3('0x10')](_0xfda3('0x13'),_0x3689be,_0x472f01),util[_0xfda3('0x10')](_0xfda3('0x14'),_0x3689be,_0x446029?_0xfda3('0x15'):_0xfda3('0x16')),_['pick'](_0x12cef5,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xfda3('0x17')),'chatQueueReport':require(_0xfda3('0x18')),'smsQueueReport':require(_0xfda3('0x19')),'faxQueueReport':require(_0xfda3('0x1a'))};var queue=schema({'name':{'type':_0xfda3('0x1b'),'required':!![],'message':_0xfda3('0x1c')},'timeout':{'type':_0xfda3('0x1d'),'message':_0xfda3('0x1e')}});function startRouting(_0xee5b,_0x181cba,_0x5d0fa2,_0x1138f4){if(_0xee5b&&_0x181cba&&_0x5d0fa2){_0x181cba[_0xfda3('0x1f')]+=0x1;var _0x48adfd={'uniqueid':_0xee5b,'from':_0x5d0fa2['body']?_0x5d0fa2[_0xfda3('0x20')][_0xfda3('0xc')]:'','joinAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5d0fa2[_0xfda3('0x21')]?_0x5d0fa2['contact']['id']:null,'ListId':_0x5d0fa2[_0xfda3('0x22')]?_0x5d0fa2[_0xfda3('0x22')]['id']:null};_0x48adfd[_[_0xfda3('0x23')](_0x5d0fa2[_0xfda3('0x24')])+_0xfda3('0x25')]=_0x181cba['id']||null;_0x48adfd[_[_0xfda3('0x23')](_0x5d0fa2[_0xfda3('0x24')])+_0xfda3('0x26')]=_0x5d0fa2[_0xfda3('0x27')]?_0x5d0fa2[_0xfda3('0x27')]['id']:null;_0x48adfd[_['upperFirst'](_0x5d0fa2[_0xfda3('0x24')])+_0xfda3('0x28')]=_0x5d0fa2['message']?_0x5d0fa2[_0xfda3('0x29')]['id']:null;_0x48adfd[_[_0xfda3('0x23')](_0x5d0fa2[_0xfda3('0x24')])+(_0x5d0fa2[_0xfda3('0x24')]!==_0xfda3('0x2a')?'AccountId':_0xfda3('0x2b'))]=_0x5d0fa2[_0xfda3('0xf')]?_0x5d0fa2['account']['id']:null;logger['info'](util[_0xfda3('0x10')](_0xfda3('0x2c'),_0xee5b,_0x181cba[_0xfda3('0x2d')]));emitChannelQueueInteraction(_0x5d0fa2[_0xfda3('0x24')],_0x181cba[_0xfda3('0x2d')],_0x48adfd,_0x5d0fa2[_0xfda3('0xf')][_0xfda3('0x2d')],_0x5d0fa2[_0xfda3('0x29')]['id'],!![],_0x1138f4,_0x181cba['id']);if(rpc[_0x5d0fa2[_0xfda3('0x24')]+_0xfda3('0x2e')]){return rpc[_0x5d0fa2[_0xfda3('0x24')]+_0xfda3('0x2e')][_0xfda3('0x2f')](_0x48adfd)[_0xfda3('0x30')](function(_0x21abea){logger['error'](_0xfda3('0x31'));});}}}function stopRouting(_0x350e06,_0x39ef25,_0x3fdb9e,_0x4b4495){if(_0x350e06&&_0x39ef25){_0x39ef25[_0xfda3('0x1f')]-=0x1;var _0x233771={'leaveAt':moment()[_0xfda3('0x10')](_0xfda3('0x32')),'acceptAt':moment()[_0xfda3('0x10')](_0xfda3('0x32')),'reason':_0xfda3('0x33')};logger[_0xfda3('0x34')](util[_0xfda3('0x10')](_0xfda3('0x35'),_0x350e06,_0x39ef25[_0xfda3('0x2d')]));emitChannelQueueInteraction(_0x3fdb9e[_0xfda3('0x24')],_0x39ef25[_0xfda3('0x2d')],_0x3fdb9e[_0xfda3('0x20')],_0x3fdb9e[_0xfda3('0xf')][_0xfda3('0x2d')],_0x3fdb9e['message']['id'],![],_0x4b4495,_0x39ef25['id']);if(rpc[_0x3fdb9e[_0xfda3('0x24')]+'QueueReport']){return rpc[_0x3fdb9e[_0xfda3('0x24')]+_0xfda3('0x2e')]['update'](_0x350e06,_0x233771)[_0xfda3('0x30')](function(_0x342a11){logger[_0xfda3('0x36')](_0xfda3('0x37'));});}}}function endRouting(_0x57a8eb,_0x2cf319,_0x220635,_0x376b97){if(_0x57a8eb&&_0x2cf319){_0x2cf319['waiting']-=0x1;var _0x2c3783={'leaveAt':moment()[_0xfda3('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0xfda3('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':'timeout'};logger['info'](util[_0xfda3('0x10')](_0xfda3('0x38'),_0x57a8eb,_0x2cf319[_0xfda3('0x2d')]));emitChannelQueueInteraction(_0x220635[_0xfda3('0x24')],_0x2cf319[_0xfda3('0x2d')],_0x220635[_0xfda3('0x20')],_0x220635[_0xfda3('0xf')]['name'],_0x220635[_0xfda3('0x29')]['id'],![],_0x376b97);if(rpc[_0x220635['channel']+_0xfda3('0x2e')]){return rpc[_0x220635['channel']+_0xfda3('0x2e')][_0xfda3('0x39')](_0x57a8eb,_0x2c3783)[_0xfda3('0x30')](function(_0x350576){logger['error'](_0xfda3('0x37'));});}}}function handleFindQueue(_0x332535){return function(_0x5c3981){return _0x5c3981['name'][_0xfda3('0x3a')]()===_0x332535[_0xfda3('0x3a')]();};}exports[_0xfda3('0x3b')]=function(_0x573d1c,_0x4408ee,_0x187c2a,_0x501d71){return function(_0x53a205){try{var _0x4c4f98={'name':_0x4408ee[0x0],'timeout':_0x4408ee[0x1]};var _0x2a2441=queue[_0xfda3('0x0')](_0x4c4f98,{'typecast':!![]});if(_0x2a2441[_0xfda3('0x3c')]){logger[_0xfda3('0x36')](_0xfda3('0x3d'),_0x573d1c,_['map'](_0x2a2441,_0xfda3('0x29'))['join'](',\x20'));_0x53a205[_0xfda3('0x3e')]();}else{var _0x5d8744=_[_0xfda3('0x3f')](_0x187c2a[_0x501d71[_0xfda3('0x24')]+_0xfda3('0x40')],handleFindQueue(_0x4c4f98[_0xfda3('0x2d')]));if(_0x5d8744){startRouting(_0x573d1c,_0x5d8744,_0x501d71,_0x187c2a);var _0x4139b3=(_0x5d8744[_0xfda3('0x41')]||0xa)*0x3e8;var _0x5acc7d=(_0x4c4f98[_0xfda3('0x41')]||0x14)*0x3e8;var _0xfea1fd,_0x49f7f7;if(_0x4139b3>_0x5acc7d){_0x5acc7d=_0x4139b3;}var _0x235247=seqqueue[_0xfda3('0x42')](_0x4139b3);_0x235247['id']=_0x573d1c;_0x235247[_0xfda3('0x43')]=_0x4139b3;_0x235247[_0xfda3('0x44')]=_0x5acc7d;_0x235247[_0xfda3('0x24')]=_0x501d71['channel'];_0x187c2a['rules'][_0x573d1c]['on'](_0xfda3('0x45'),function(){stopRouting(_0x573d1c,_0x5d8744,_0x501d71,_0x187c2a);_0x235247[_0xfda3('0x46')](!![]);clearTimeout(_0xfea1fd);_0xfea1fd=undefined;if(_0x187c2a[_0xfda3('0x47')][_0x573d1c]){delete _0x187c2a[_0xfda3('0x47')][_0x573d1c];}logger[_0xfda3('0x34')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x573d1c);_0x53a205['stop']();});_0xfea1fd=setTimeout(function(){endRouting(_0x573d1c,_0x5d8744,_0x501d71,_0x187c2a);clearTimeout(_0xfea1fd);_0x235247['close'](!![]);logger[_0xfda3('0x34')](_0xfda3('0x48'),_0x573d1c);_0x53a205[_0xfda3('0x49')]();},_0x5acc7d);switch(_0x5d8744[_0xfda3('0x4a')]){case'rrmemory':strategy[_0xfda3('0x4b')](_0x235247,_0x5d8744,_0x187c2a,_0x501d71);break;default:strategy['beepall'](_0x235247,_0x5d8744,_0x187c2a,_0x501d71);}}else{logger['error']('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x573d1c,_0x4c4f98[_0xfda3('0x2d')]);_0x53a205[_0xfda3('0x3e')]();}}}catch(_0x2097dd){console[_0xfda3('0x4c')](_0x2097dd);logger[_0xfda3('0x36')]('[%s][QUEUE]\x20%s',_0x573d1c,_0x2097dd[_0xfda3('0x4d')]);_0x53a205[_0xfda3('0x3e')]();}};}; \ 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 efbf15b..4364bbd 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 _0xc0c5=['prototype','handleDrained','info','[%s][AGENT]\x20try\x20with\x20%s','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','agents','channel','busy','busyQueue','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','handleTimeout','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT','exports','lodash','uuid','routing','notificationId','squeue','agent','realtime','push','handleRun','bind','timeout','drained'];(function(_0x2c2a1b,_0x4b73d1){var _0x594bca=function(_0x3b9d04){while(--_0x3b9d04){_0x2c2a1b['push'](_0x2c2a1b['shift']());}};_0x594bca(++_0x4b73d1);}(_0xc0c5,0x126));var _0x5c0c=function(_0x43b08,_0x15f967){_0x43b08=_0x43b08-0x0;var _0x5e05f4=_0xc0c5[_0x43b08];return _0x5e05f4;};'use strict';var _=require(_0x5c0c('0x0'));var uuid=require(_0x5c0c('0x1'));var util=require('./util');var logger=require('../../../../../config/logger')(_0x5c0c('0x2'));var Agent=function(_0x39b385,_0x4eb318,_0x182687,_0xf7c468){this[_0x5c0c('0x3')]=uuid['v4']();this[_0x5c0c('0x4')]=_0x39b385;this[_0x5c0c('0x5')]=_0x4eb318;this[_0x5c0c('0x6')]=_0x182687;this[_0x5c0c('0x2')]=_0xf7c468;this[_0x5c0c('0x4')][_0x5c0c('0x7')](this[_0x5c0c('0x8')][_0x5c0c('0x9')](this),this['handleTimeout'][_0x5c0c('0x9')](this));this['squeue']['on'](_0x5c0c('0xa'),this['handleTimeout'][_0x5c0c('0x9')](this));this[_0x5c0c('0x4')]['on'](_0x5c0c('0xb'),this['handleDrained']['bind'](this));};Agent[_0x5c0c('0xc')]['push']=function(){this['squeue']['push'](this[_0x5c0c('0x8')][_0x5c0c('0x9')](this),this['handleTimeout'][_0x5c0c('0x9')](this));};Agent[_0x5c0c('0xc')][_0x5c0c('0xd')]=function(){this['handleTimeout'](!![]);};Agent['prototype']['handleRun']=function(_0x482518){logger[_0x5c0c('0xe')](_0x5c0c('0xf'),this[_0x5c0c('0x4')]['id'],this[_0x5c0c('0x5')]['id']);if(_['isNil'](this[_0x5c0c('0x6')]['agents'][this['agent']['id']])){logger['info'](_0x5c0c('0x10'),this[_0x5c0c('0x4')]['id'],this[_0x5c0c('0x5')]['id']);setTimeout(this[_0x5c0c('0x7')][_0x5c0c('0x9')](this),0x3e8);}else{if(this['routing'][_0x5c0c('0x11')]||util[_0x5c0c('0x12')](this[_0x5c0c('0x4')]['id'],this['realtime'][_0x5c0c('0x13')][this[_0x5c0c('0x5')]['id']],this[_0x5c0c('0x4')][_0x5c0c('0x14')],![])){this['realtime'][_0x5c0c('0x13')][this[_0x5c0c('0x5')]['id']][_0x5c0c('0x15')]=!![];this[_0x5c0c('0x6')][_0x5c0c('0x13')][this['agent']['id']][_0x5c0c('0x16')]=undefined;util['showNotification'](this['notificationId'],this[_0x5c0c('0x4')]['id'],this[_0x5c0c('0x6')][_0x5c0c('0x13')][this[_0x5c0c('0x5')]['id']],null,this[_0x5c0c('0x2')]);util[_0x5c0c('0x17')](this['squeue']['id'],this[_0x5c0c('0x6')][_0x5c0c('0x13')][this[_0x5c0c('0x5')]['id']],_0x5c0c('0x18')+(this[_0x5c0c('0x2')][_0x5c0c('0x11')]?_0x5c0c('0x19'):''));}else{logger[_0x5c0c('0xe')](_0x5c0c('0x1a'),this['squeue']['id'],this[_0x5c0c('0x5')]['id']);setTimeout(this[_0x5c0c('0x7')]['bind'](this),0x3e8);}}};Agent['prototype'][_0x5c0c('0x1b')]=function(_0x17fcb1){if(_[_0x5c0c('0x1c')](this['realtime'][_0x5c0c('0x13')][this[_0x5c0c('0x5')]['id']])){return logger[_0x5c0c('0xe')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x5c0c('0x4')]['id'],this['agent']['id']);}else{logger[_0x5c0c('0xe')](_0x5c0c('0x1d'),this[_0x5c0c('0x4')]['id'],this[_0x5c0c('0x5')]['id']);util[_0x5c0c('0x1e')](this[_0x5c0c('0x3')],this[_0x5c0c('0x4')]['id'],this[_0x5c0c('0x6')]['agents'][this[_0x5c0c('0x5')]['id']],null,this[_0x5c0c('0x2')]);this['realtime'][_0x5c0c('0x13')][this[_0x5c0c('0x5')]['id']][_0x5c0c('0x15')]=![];this[_0x5c0c('0x6')][_0x5c0c('0x13')][this[_0x5c0c('0x5')]['id']][_0x5c0c('0x16')]=undefined;util[_0x5c0c('0x17')](this[_0x5c0c('0x4')]['id'],this[_0x5c0c('0x6')][_0x5c0c('0x13')][this['agent']['id']],_0x17fcb1?_0x5c0c('0x1f'):_0x5c0c('0x20'));}if(!_0x17fcb1){setTimeout(this[_0x5c0c('0x7')][_0x5c0c('0x9')](this),0x3e8);}};function agent(_0x22c5c9,_0x2825f5,_0x239cf8,_0x1a19fd){return new Agent(_0x22c5c9,_0x2825f5,_0x239cf8,_0x1a19fd);}module[_0x5c0c('0x21')]=agent; \ No newline at end of file +var _0x09a9=['busy','notificationId','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','busyQueue','STOP','TIMEOUT','lodash','uuid','./util','../../../../../config/logger','squeue','agent','realtime','routing','handleRun','bind','drained','handleDrained','prototype','push','handleTimeout','isNil','agents','info','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel'];(function(_0x52d460,_0x1da4ef){var _0x1f8600=function(_0xee0720){while(--_0xee0720){_0x52d460['push'](_0x52d460['shift']());}};_0x1f8600(++_0x1da4ef);}(_0x09a9,0x1ca));var _0x909a=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x09a9[_0x2064e5];return _0x21a233;};'use strict';var _=require(_0x909a('0x0'));var uuid=require(_0x909a('0x1'));var util=require(_0x909a('0x2'));var logger=require(_0x909a('0x3'))('routing');var Agent=function(_0x555f29,_0x32df55,_0x16b6c6,_0x285fef){this['notificationId']=uuid['v4']();this[_0x909a('0x4')]=_0x555f29;this[_0x909a('0x5')]=_0x32df55;this[_0x909a('0x6')]=_0x16b6c6;this[_0x909a('0x7')]=_0x285fef;this[_0x909a('0x4')]['push'](this[_0x909a('0x8')]['bind'](this),this['handleTimeout'][_0x909a('0x9')](this));this[_0x909a('0x4')]['on']('timeout',this['handleTimeout'][_0x909a('0x9')](this));this[_0x909a('0x4')]['on'](_0x909a('0xa'),this[_0x909a('0xb')][_0x909a('0x9')](this));};Agent[_0x909a('0xc')][_0x909a('0xd')]=function(){this['squeue'][_0x909a('0xd')](this['handleRun']['bind'](this),this['handleTimeout'][_0x909a('0x9')](this));};Agent['prototype'][_0x909a('0xb')]=function(){this[_0x909a('0xe')](!![]);};Agent[_0x909a('0xc')][_0x909a('0x8')]=function(_0x29e477){logger['info']('[%s][AGENT]\x20try\x20with\x20%s',this[_0x909a('0x4')]['id'],this[_0x909a('0x5')]['id']);if(_[_0x909a('0xf')](this['realtime'][_0x909a('0x10')][this[_0x909a('0x5')]['id']])){logger[_0x909a('0x11')](_0x909a('0x12'),this['squeue']['id'],this[_0x909a('0x5')]['id']);setTimeout(this[_0x909a('0xd')][_0x909a('0x9')](this),0x3e8);}else{if(this['routing'][_0x909a('0x13')]||util[_0x909a('0x14')](this[_0x909a('0x4')]['id'],this[_0x909a('0x6')][_0x909a('0x10')][this[_0x909a('0x5')]['id']],this[_0x909a('0x4')][_0x909a('0x15')],![])){this['realtime']['agents'][this[_0x909a('0x5')]['id']][_0x909a('0x16')]=!![];this['realtime']['agents'][this[_0x909a('0x5')]['id']]['busyQueue']=undefined;util['showNotification'](this[_0x909a('0x17')],this['squeue']['id'],this[_0x909a('0x6')][_0x909a('0x10')][this[_0x909a('0x5')]['id']],null,this[_0x909a('0x7')]);util[_0x909a('0x18')](this[_0x909a('0x4')]['id'],this[_0x909a('0x6')][_0x909a('0x10')][this[_0x909a('0x5')]['id']],_0x909a('0x19')+(this[_0x909a('0x7')][_0x909a('0x13')]?_0x909a('0x1a'):''));}else{logger[_0x909a('0x11')](_0x909a('0x1b'),this[_0x909a('0x4')]['id'],this[_0x909a('0x5')]['id']);setTimeout(this[_0x909a('0xd')][_0x909a('0x9')](this),0x3e8);}}};Agent[_0x909a('0xc')][_0x909a('0xe')]=function(_0x812f61){if(_['isNil'](this[_0x909a('0x6')]['agents'][this[_0x909a('0x5')]['id']])){return logger[_0x909a('0x11')](_0x909a('0x12'),this['squeue']['id'],this[_0x909a('0x5')]['id']);}else{logger[_0x909a('0x11')](_0x909a('0x1c'),this[_0x909a('0x4')]['id'],this[_0x909a('0x5')]['id']);util['hideNotification'](this[_0x909a('0x17')],this[_0x909a('0x4')]['id'],this[_0x909a('0x6')][_0x909a('0x10')][this[_0x909a('0x5')]['id']],null,this[_0x909a('0x7')]);this['realtime'][_0x909a('0x10')][this[_0x909a('0x5')]['id']][_0x909a('0x16')]=![];this[_0x909a('0x6')][_0x909a('0x10')][this[_0x909a('0x5')]['id']][_0x909a('0x1d')]=undefined;util[_0x909a('0x18')](this['squeue']['id'],this[_0x909a('0x6')]['agents'][this['agent']['id']],_0x812f61?_0x909a('0x1e'):_0x909a('0x1f'));}if(!_0x812f61){setTimeout(this['push'][_0x909a('0x9')](this),0x3e8);}};function agent(_0x3c9865,_0x19004a,_0x319807,_0xb78cc9){return new Agent(_0x3c9865,_0x19004a,_0x319807,_0xb78cc9);}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 e46b3d9..c55c946 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 _0xb745=['channel','writeLog','busy','busyQueue','name','showNotification','hideNotification','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','push','handleRun','handleTimeout','timeout','bind','handleDrained','prototype','isNil','queue','Agents','length','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','realtime','agents'];(function(_0x24d10c,_0x35543c){var _0x4a091d=function(_0x4edb55){while(--_0x4edb55){_0x24d10c['push'](_0x24d10c['shift']());}};_0x4a091d(++_0x35543c);}(_0xb745,0x6d));var _0x5b74=function(_0x3bd4e5,_0x33854f){_0x3bd4e5=_0x3bd4e5-0x0;var _0x2d1522=_0xb745[_0x3bd4e5];return _0x2d1522;};'use strict';var _=require(_0x5b74('0x0'));var uuid=require(_0x5b74('0x1'));var util=require(_0x5b74('0x2'));var logger=require(_0x5b74('0x3'))(_0x5b74('0x4'));var Beepall=function(_0x5dda6d,_0xae6d28,_0x4c3eb8,_0x14d140){this[_0x5b74('0x5')]=uuid['v4']();this['squeue']=_0x5dda6d;this['queue']=_0xae6d28;this['realtime']=_0x4c3eb8;this[_0x5b74('0x4')]=_0x14d140;this[_0x5b74('0x6')][_0x5b74('0x7')](this[_0x5b74('0x8')]['bind'](this),this[_0x5b74('0x9')]['bind'](this));this[_0x5b74('0x6')]['on'](_0x5b74('0xa'),this[_0x5b74('0x9')][_0x5b74('0xb')](this));this['squeue']['on']('drained',this[_0x5b74('0xc')][_0x5b74('0xb')](this));};Beepall['prototype'][_0x5b74('0x7')]=function(){this[_0x5b74('0x6')]['push'](this[_0x5b74('0x8')][_0x5b74('0xb')](this),this[_0x5b74('0x9')]['bind'](this));};Beepall[_0x5b74('0xd')][_0x5b74('0xc')]=function(_0x21e933){this[_0x5b74('0x9')](!![]);};Beepall['prototype'][_0x5b74('0x8')]=function(_0x2ca33c){var _0x5573e3=!![];if(!_[_0x5b74('0xe')](this[_0x5b74('0xf')])&&!_[_0x5b74('0xe')](this['queue'][_0x5b74('0x10')])&&this['queue'][_0x5b74('0x10')]['length']>0x0){for(var _0x5d8a9e=0x0,_0xdb6633;_0x5d8a9e0x0){for(var _0x1197f3=0x0,_0x1a4dab;_0x1197f30x0&&_0x37f41d[_0x58c985+'CurrentCapacity']>=_0x37f41d[_0x58c985+_0x94ba('0x23')]){writeLog(_0x1f1fe9,_0x37f41d,_0x58c985['toUpperCase']()+_0x94ba('0x26'));return![];}}return!![];};exports[_0x94ba('0x27')]=function(_0x2e6765,_0x5a51b7,_0x479a6b,_0x5631d3,_0x3b07d1){return sendNotification(!![],_0x2e6765,_0x5a51b7,_0x479a6b,_0x5631d3,_0x3b07d1);};exports['hideNotification']=function(_0x45154b,_0x40ac77,_0x472953,_0x21a7ee,_0x364641){return sendNotification(![],_0x45154b,_0x40ac77,_0x472953,_0x21a7ee,_0x364641);};exports[_0x94ba('0x28')]=writeLog; \ No newline at end of file +var _0x200c=['user:save','split','\x20interaction','account','notificationShake','body','queue','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','format','message','notification:%s','save','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','BUSY','online','OFFLINE','Pause','PAUSE','Capacity','CurrentCapacity','\x20MAXCAPACITY','hideNotification','writeLog','lodash','util','../utils','mustache','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','localhost','emit','user:%s','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x200c,0x112));var _0xc200=function(_0xd46d4d,_0x42e7ec){_0xd46d4d=_0xd46d4d-0x0;var _0x5b3a74=_0x200c[_0xd46d4d];return _0x5b3a74;};'use strict';var _=require(_0xc200('0x0'));var util=require(_0xc200('0x1'));var utils=require(_0xc200('0x2'));var Mustache=require(_0xc200('0x3'));var Redis=require('ioredis');var config=require(_0xc200('0x4'));var logger=require(_0xc200('0x5'))(_0xc200('0x6'));config[_0xc200('0x7')]=_[_0xc200('0x8')](config[_0xc200('0x7')],{'host':_0xc200('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc200('0x7')]));function emit(_0x5cdfc0,_0x1310b9,_0x21cd6e){io['to'](_0x5cdfc0)[_0xc200('0xa')](_0x1310b9,_0x21cd6e);}function sendNotification(_0x299ac2,_0x526b80,_0x281149,_0x4aec9a,_0x4b07d2,_0x4a9e3c){io['to'](util['format'](_0xc200('0xb'),_0x4aec9a[_0xc200('0xc')]))['emit'](_0xc200('0xd'),_0x4aec9a);var _0x4709bd=_0x4a9e3c||{};var _0x4effbe=_0x281149[_0xc200('0xe')]('.');var _0x413397={'uniqueid':_0x526b80,'channel':_0x4effbe[0x0],'id':_0x4effbe[0x1],'title':_0x4effbe[0x0]+_0xc200('0xf'),'interactionId':_0x4effbe[0x2],'queue':_0x4b07d2?_0x4b07d2[_0xc200('0xc')]:null,'sound':_0x4709bd[_0xc200('0x10')]['notificationSound'],'shake':_0x4709bd['account'][_0xc200('0x11')]};try{if(!_0x4709bd[_0xc200('0x12')]){_0x4709bd[_0xc200('0x12')]={};}if(_0x4b07d2){_0x4709bd[_0xc200('0x12')]['queue']=_0x4b07d2;}else if(_0x4709bd[_0xc200('0x12')]['queue']){delete _0x4709bd[_0xc200('0x12')][_0xc200('0x13')];}_0x413397[_0xc200('0x14')]=utils[_0xc200('0x15')](_0x4709bd['account'][_0xc200('0x16')],_0x4709bd);}catch(_0xb1cd99){_0x413397['msg']=_0xc200('0x17');logger[_0xc200('0x18')](util[_0xc200('0x19')]('[%s][QUEUE]\x20%s',_0x526b80,_0xb1cd99[_0xc200('0x1a')]));}io['to'](util[_0xc200('0x19')]('user:%s',_0x4aec9a[_0xc200('0xc')]))['emit'](util[_0xc200('0x19')](_0xc200('0x1b'),_0x299ac2?_0xc200('0x1c'):'remove'),_0x413397);}function writeLog(_0x5b396f,_0x13c725,_0x12e4a6){return logger['info'](util['format'](_0xc200('0x1d'),_0x5b396f,_0x13c725[_0xc200('0xc')],_0x12e4a6));}exports[_0xc200('0x1e')]=function(_0x3ef91e,_0x5a18e2,_0x6aeea3,_0x39ef68){if(_0x5a18e2['busy']){writeLog(_0x3ef91e,_0x5a18e2,_0xc200('0x1f'));return![];}if(!_0x5a18e2[_0xc200('0x20')]){writeLog(_0x3ef91e,_0x5a18e2,_0xc200('0x21'));return![];}if(_0x5a18e2[_0x6aeea3+_0xc200('0x22')]){writeLog(_0x3ef91e,_0x5a18e2,_0xc200('0x23'));return![];}if(_0x39ef68&&_0x5a18e2['hasOwnProperty'](_0x6aeea3+_0xc200('0x24'))&&_0x5a18e2['hasOwnProperty'](_0x6aeea3+_0xc200('0x25'))){if(_0x5a18e2[_0x6aeea3+_0xc200('0x24')]>0x0&&_0x5a18e2[_0x6aeea3+'CurrentCapacity']>=_0x5a18e2[_0x6aeea3+'Capacity']){writeLog(_0x3ef91e,_0x5a18e2,_0x6aeea3['toUpperCase']()+_0xc200('0x26'));return![];}}return!![];};exports['showNotification']=function(_0x477576,_0x53fc5c,_0x22b5b8,_0x4510c7,_0x4fcdd7){return sendNotification(!![],_0x477576,_0x53fc5c,_0x22b5b8,_0x4510c7,_0x4fcdd7);};exports[_0xc200('0x27')]=function(_0x1f4144,_0x2b1272,_0x470adc,_0x102af0,_0x3be5db){return sendNotification(![],_0x1f4144,_0x2b1272,_0x470adc,_0x102af0,_0x3be5db);};exports[_0xc200('0x28')]=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 08213be..407d177 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 _0xc2af=['isEmpty','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','validate','shelljs','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','replace','isNil'];(function(_0x1a03c9,_0xdd3dc1){var _0x12b6bf=function(_0x310b57){while(--_0x310b57){_0x1a03c9['push'](_0x1a03c9['shift']());}};_0x12b6bf(++_0xdd3dc1);}(_0xc2af,0xdc));var _0xfc2a=function(_0x469889,_0x5bd340){_0x469889=_0x469889-0x0;var _0x28bcba=_0xc2af[_0x469889];return _0x28bcba;};'use strict';var schema=require(_0xfc2a('0x0'));var sh=require(_0xfc2a('0x1'));var _=require('lodash');var utils=require(_0xfc2a('0x2'));var logger=require(_0xfc2a('0x3'))(_0xfc2a('0x4'));var system=schema({'command':{'type':_0xfc2a('0x5'),'required':!![],'message':_0xfc2a('0x6')}});exports['consequence']=function(_0x172ef2,_0x58cba9){return function(_0x4ead3e){try{var _0x5dd466={'command':_0x58cba9[0x0]};var _0xc57916=system['validate'](_0x5dd466,{'typecast':!![]});if(_0xc57916[_0xfc2a('0x7')]){logger['error'](_0xfc2a('0x8'),_0x172ef2,_[_0xfc2a('0x9')](_0xc57916,_0xfc2a('0xa'))[_0xfc2a('0xb')](',\x20'));logger[_0xfc2a('0xc')](_0xfc2a('0xd'),_0x172ef2);_0x4ead3e[_0xfc2a('0xe')]();}else{var _0x563fad=this;var _0x4e4b87=utils['getMustacheRender'](_0x58cba9[0x0],this);logger[_0xfc2a('0xc')](_0xfc2a('0xf'),_0x172ef2,_0x4e4b87);sh[_0xfc2a('0x10')](_[_0xfc2a('0x11')](_0x4e4b87),function(_0xd6958d,_0x395445){logger['info']('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x172ef2,_0xd6958d);if(_0xd6958d==0x0){var _0x3389a6=_0x395445[_0xfc2a('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0xfc2a('0x13')](_0x58cba9[0x1])||_[_0xfc2a('0x14')](_0x58cba9[0x1])){logger[_0xfc2a('0xc')]('[%s][SYSTEM]\x20no\x20variable',_0x172ef2);_0x563fad[_0xfc2a('0x15')][_0x58cba9[0x1]]=_0x3389a6;}else{logger[_0xfc2a('0xc')](_0xfc2a('0x16'),_0x172ef2,_0x58cba9[0x1],_0x3389a6);_0x563fad['body'][_0x58cba9[0x1]]=_0x3389a6;}}_0x4ead3e[_0xfc2a('0xe')]();});}}catch(_0x2dadb3){logger['error'](_0xfc2a('0x8'),_0x172ef2,_[_0xfc2a('0x17')](_0x2dadb3)?JSON['stringify'](_0x2dadb3):_0x2dadb3);logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x172ef2);_0x4ead3e['next']();}};}; \ No newline at end of file +var _0xe46b=['[%s][SYSTEM]\x20%s','map','message','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','info','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','validate','../../../../config/logger','routing','string','length','error'];(function(_0xcc9a1,_0x228b7c){var _0x292564=function(_0x41f620){while(--_0x41f620){_0xcc9a1['push'](_0xcc9a1['shift']());}};_0x292564(++_0x228b7c);}(_0xe46b,0xe0));var _0xbe46=function(_0x12a0ff,_0x48afb9){_0x12a0ff=_0x12a0ff-0x0;var _0x5f3900=_0xe46b[_0x12a0ff];return _0x5f3900;};'use strict';var schema=require(_0xbe46('0x0'));var sh=require('shelljs');var _=require('lodash');var utils=require('./utils');var logger=require(_0xbe46('0x1'))(_0xbe46('0x2'));var system=schema({'command':{'type':_0xbe46('0x3'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x98c907,_0x2d14b){return function(_0x13515e){try{var _0x213e4e={'command':_0x2d14b[0x0]};var _0x401698=system[_0xbe46('0x0')](_0x213e4e,{'typecast':!![]});if(_0x401698[_0xbe46('0x4')]){logger[_0xbe46('0x5')](_0xbe46('0x6'),_0x98c907,_[_0xbe46('0x7')](_0x401698,_0xbe46('0x8'))['join'](',\x20'));logger['info'](_0xbe46('0x9'),_0x98c907);_0x13515e[_0xbe46('0xa')]();}else{var _0x1df608=this;var _0x2b34ad=utils[_0xbe46('0xb')](_0x2d14b[0x0],this);logger[_0xbe46('0xc')](_0xbe46('0xd'),_0x98c907,_0x2b34ad);sh[_0xbe46('0xe')](_[_0xbe46('0xf')](_0x2b34ad),function(_0x3c459d,_0x47b97c){logger['info']('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x98c907,_0x3c459d);if(_0x3c459d==0x0){var _0x331e47=_0x47b97c['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0xbe46('0x10')](_0x2d14b[0x1])||_[_0xbe46('0x11')](_0x2d14b[0x1])){logger[_0xbe46('0xc')](_0xbe46('0x12'),_0x98c907);_0x1df608[_0xbe46('0x13')][_0x2d14b[0x1]]=_0x331e47;}else{logger['info'](_0xbe46('0x14'),_0x98c907,_0x2d14b[0x1],_0x331e47);_0x1df608['body'][_0x2d14b[0x1]]=_0x331e47;}}_0x13515e[_0xbe46('0xa')]();});}}catch(_0x4758e2){logger['error']('[%s][SYSTEM]\x20%s',_0x98c907,_[_0xbe46('0x15')](_0x4758e2)?JSON[_0xbe46('0x16')](_0x4758e2):_0x4758e2);logger['info'](_0xbe46('0x9'),_0x98c907);_0x13515e[_0xbe46('0xa')]();}};}; \ 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 4242800..f9151f0 100644 --- a/server/services/routing/server/applications/tag.js +++ b/server/services/routing/server/applications/tag.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['finally','error','validate','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','[%s][TAG]\x20%s','map','join','next','channel','Interaction','addTags','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x56ab50,_0x675f1f){var _0x8f2232=function(_0xef0a99){while(--_0xef0a99){_0x56ab50['push'](_0x56ab50['shift']());}};_0x8f2232(++_0x675f1f);}(_0x7a54,0x106));var _0x47a5=function(_0x48a5e0,_0x4a5e0a){_0x48a5e0=_0x48a5e0-0x0;var _0x4e43b6=_0x7a54[_0x48a5e0];return _0x4e43b6;};'use strict';var schema=require(_0x47a5('0x0'));var _=require(_0x47a5('0x1'));var rpc={'chatInteraction':require(_0x47a5('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x47a5('0x3')),'mailInteraction':require(_0x47a5('0x4')),'faxInteraction':require('../../rpc/faxInteraction')};var logger=require(_0x47a5('0x5'))(_0x47a5('0x6'));var tag=schema({'tag':{'type':_0x47a5('0x7'),'required':!![],'message':_0x47a5('0x8')}});exports[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629,_0x59199c,_0x343372){return function(_0x30e405){try{var _0x506eda={'tag':_0x3d5629[0x0]};var _0x194fb0=tag['validate'](_0x506eda,{'typecast':!![]});if(_0x194fb0['length']){logger['error'](_0x47a5('0xa'),_0x545a97,_[_0x47a5('0xb')](_0x194fb0,'message')[_0x47a5('0xc')](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x545a97);_0x30e405[_0x47a5('0xd')]();}else{var _0x69e4d4={'ids':[_0x3d5629[0x0]]};if(rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')]){rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')][_0x47a5('0x10')](_0x343372['interaction']['id'],_0x69e4d4)[_0x47a5('0x11')](function(_0x221b54){logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x545a97,_0x3d5629[0x1],_0x343372[_0x47a5('0xe')],_0x343372[_0x47a5('0x14')]['id']);})[_0x47a5('0x15')](function(_0x190faa){logger['error'](_0x47a5('0xa'),_0x545a97,JSON[_0x47a5('0x16')](_0x190faa));logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);})[_0x47a5('0x18')](function(){_0x30e405['next']();});}}}catch(_0x549de3){logger[_0x47a5('0x19')]('[%s][TAG]\x20%s',_0x545a97,_['isObject'](_0x549de3)?JSON[_0x47a5('0x16')](_0x549de3):_0x549de3);logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);_0x30e405[_0x47a5('0xd')]();}};}; \ No newline at end of file +var _0x9957=['join','info','next','Interaction','channel','addTags','interaction','then','catch','stringify','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','message'];(function(_0x4ac3da,_0x3ee33a){var _0xd1ffc7=function(_0x40f837){while(--_0x40f837){_0x4ac3da['push'](_0x4ac3da['shift']());}};_0xd1ffc7(++_0x3ee33a);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'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 18086f3..f8b407f 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 _0xb575=['list','mustache','lodash','body','contact','account','interaction'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0xb575,0xda));var _0x5b57=function(_0x423c75,_0x4d78f){_0x423c75=_0x423c75-0x0;var _0x5d679f=_0xb575[_0x423c75];return _0x5d679f;};'use strict';var Mustache=require(_0x5b57('0x0'));var _=require(_0x5b57('0x1'));module['exports']={'getMustacheRender':function(_0x2b9acb,_0x4c5b3f){return Mustache['render'](_0x2b9acb,_['merge'](_0x4c5b3f[_0x5b57('0x2')],{'contact':_0x4c5b3f[_0x5b57('0x3')],'message':_0x4c5b3f['message'],'account':_0x4c5b3f[_0x5b57('0x4')],'interaction':_0x4c5b3f[_0x5b57('0x5')],'list':_0x4c5b3f[_0x5b57('0x6')]}))||'';}}; \ No newline at end of file +var _0xba47=['merge','body','message','account','mustache','lodash','exports','render'];(function(_0x260185,_0x16816e){var _0x2b750e=function(_0x5f18a2){while(--_0x5f18a2){_0x260185['push'](_0x260185['shift']());}};_0x2b750e(++_0x16816e);}(_0xba47,0x1ac));var _0x7ba4=function(_0x5f53c4,_0x236ee4){_0x5f53c4=_0x5f53c4-0x0;var _0x4c212e=_0xba47[_0x5f53c4];return _0x4c212e;};'use strict';var Mustache=require(_0x7ba4('0x0'));var _=require(_0x7ba4('0x1'));module[_0x7ba4('0x2')]={'getMustacheRender':function(_0x4c18e5,_0x22c430){return Mustache[_0x7ba4('0x3')](_0x4c18e5,_[_0x7ba4('0x4')](_0x22c430[_0x7ba4('0x5')],{'contact':_0x22c430['contact'],'message':_0x22c430[_0x7ba4('0x6')],'account':_0x22c430[_0x7ba4('0x7')],'interaction':_0x22c430['interaction'],'list':_0x22c430['list']}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 96ff21e..d527883 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 _0xea0d=['routing','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','rules','channel','message','isArray','applications','length','existsSync','join','app','.js','autoreply','split','push','slice','appdata','amazonlex','tag','TagId','format','%s:%s:%s','./interval','condition','intervals','consequence','priority','info','Push\x20new\x20rule','on\x20interval','Please\x20create\x20a\x20new\x20file\x20under','matchPath','emit','end','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','interaction','QueueReport','update','UserId','catch','error','error\x20update\x20queue\x20report','message\x20is\x20empty','agent','agents','busy','busyQueue','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','loggedIn','name','paused','waiting','mailQueues','available','openchannelQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','http','stringify','listen','log','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','uuid','../../../config/environment','../../../config/logger'];(function(_0x1f7627,_0x20b30e){var _0x5abbf5=function(_0x247691){while(--_0x247691){_0x1f7627['push'](_0x1f7627['shift']());}};_0x5abbf5(++_0x20b30e);}(_0xea0d,0x106));var _0xdea0=function(_0x20a761,_0x2ffd85){_0x20a761=_0x20a761-0x0;var _0x284a38=_0xea0d[_0x20a761];return _0x284a38;};'use strict';var _=require(_0xdea0('0x0'));var util=require(_0xdea0('0x1'));var path=require(_0xdea0('0x2'));var fs=require('fs');var jayson=require(_0xdea0('0x3'));var BPromise=require(_0xdea0('0x4'));var uuid=require(_0xdea0('0x5'));var config=require(_0xdea0('0x6'));var logger=require(_0xdea0('0x7'))(_0xdea0('0x8'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport')};var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0xdea0('0x9')),'smsQueueReport':require(_0xdea0('0xa')),'faxQueueReport':require(_0xdea0('0xb'))};var RuleEngine=require(_0xdea0('0xc'));function getId(_0x1301da,_0x2ee677,_0x486bee){return util['format'](_0xdea0('0xd'),_0x1301da,_0x2ee677||0x0,_0x486bee||0x0);}function getIntervals(_0x213ef4,_0x5a6ac2){var _0x17ac56=[];if(!_[_0xdea0('0xe')](_0x5a6ac2['IntervalId'])&&!_['isNil'](_0x213ef4[_0x5a6ac2[_0xdea0('0xf')]])&&!_['isNil'](_0x213ef4[_0x5a6ac2[_0xdea0('0xf')]][_0xdea0('0x10')])){_0x17ac56=_[_0xdea0('0x11')](_0x213ef4[_0x5a6ac2[_0xdea0('0xf')]][_0xdea0('0x10')],_0xdea0('0x12'));}else if(!_[_0xdea0('0xe')](_0x5a6ac2[_0xdea0('0x12')])){_0x17ac56=[_0x5a6ac2[_0xdea0('0x12')]];}return _0x17ac56;}exports['listen']=function(_0x26198f){_0x26198f[_0xdea0('0x13')]={};return new BPromise(function(_0xa942,_0x157f73){var _0x2c21c1={'Start':function(_0x350a73){var _0x4c6263=this;return new Promise(function(_0x358e4c,_0x5bef04){if(_0x350a73){try{var _0x4a4eed=[];var _0x53b870=getId(_0x350a73[_0xdea0('0x14')],_0x350a73[_0xdea0('0x15')]?_0x350a73[_0xdea0('0x15')]['id']:0x0,_0x350a73['interaction']?_0x350a73['interaction']['id']:0x0);if(_0x350a73['applications']&&_[_0xdea0('0x16')](_0x350a73[_0xdea0('0x17')])&&_0x350a73[_0xdea0('0x17')][_0xdea0('0x18')]){for(var _0x4f5e93=0x0;_0x4f5e93<_0x350a73[_0xdea0('0x17')][_0xdea0('0x18')];_0x4f5e93+=0x1){var _0x2e871c=_0x350a73[_0xdea0('0x17')][_0x4f5e93];if(fs[_0xdea0('0x19')](path[_0xdea0('0x1a')](__dirname,_0xdea0('0x17'),_0x2e871c[_0xdea0('0x1b')]+_0xdea0('0x1c')))){var _0x19dc43=[];switch(_0x2e871c[_0xdea0('0x1b')]['toLowerCase']()){case _0xdea0('0x1d'):var _0x2fdb73=_0x2e871c['appdata'][_0xdea0('0x1e')](',');_0x19dc43[_0xdea0('0x1f')](_0x2fdb73[0x0]);_0x19dc43['push'](_0x2fdb73[_0xdea0('0x20')](0x1,_0x2fdb73[_0xdea0('0x18')])[_0xdea0('0x1a')](','));break;case'dialogflow':var _0x2fdb73=_0x2e871c[_0xdea0('0x21')][_0xdea0('0x1e')](',');_0x19dc43[_0xdea0('0x1f')](_0x2fdb73[0x0]);_0x19dc43[_0xdea0('0x1f')](_0x2fdb73[0x1]);_0x19dc43[_0xdea0('0x1f')](_0x2fdb73[_0xdea0('0x20')](0x2,_0x2fdb73['length'])[_0xdea0('0x1a')](','));break;case _0xdea0('0x22'):var _0x2fdb73=_0x2e871c[_0xdea0('0x21')][_0xdea0('0x1e')](',');_0x19dc43['push'](_0x2fdb73[0x0]);_0x19dc43[_0xdea0('0x1f')](_0x2fdb73[0x1]);_0x19dc43[_0xdea0('0x1f')](_0x2fdb73[0x2]);_0x19dc43['push'](_0x2fdb73[0x3]);_0x19dc43[_0xdea0('0x1f')](_0x2fdb73[_0xdea0('0x20')](0x4,_0x2fdb73[_0xdea0('0x18')])['join'](','));break;case _0xdea0('0x15'):_0x19dc43[_0xdea0('0x1f')](_0x2e871c[_0xdea0('0x21')]);break;case _0xdea0('0x23'):_0x19dc43[_0xdea0('0x1f')](_0x2e871c[_0xdea0('0x24')]);_0x19dc43[_0xdea0('0x1f')](_0x2e871c[_0xdea0('0x21')]);break;default:_0x19dc43=_[_0xdea0('0xe')](_0x2e871c[_0xdea0('0x21')])?[]:_0x2e871c[_0xdea0('0x21')][_0xdea0('0x1e')](',');}var _0x3ce749={'id':util[_0xdea0('0x25')](_0xdea0('0x26'),_0x53b870,_0x2e871c['id'],_0x2e871c[_0xdea0('0x1b')]),'condition':require(_0xdea0('0x27'))[_0xdea0('0x28')](_0x53b870,getIntervals(_0x26198f[_0xdea0('0x29')],_0x2e871c),_0x26198f),'consequence':require('./applications/'+_0x2e871c[_0xdea0('0x1b')])[_0xdea0('0x2a')](_0x53b870,_0x19dc43,_0x26198f,_0x350a73),'p':_0x2e871c[_0xdea0('0x2b')]||0x0};logger[_0xdea0('0x2c')](_0xdea0('0x2d'),_0x3ce749['id'],_0xdea0('0x2e'),getIntervals(_0x26198f[_0xdea0('0x29')],_0x2e871c)[_0xdea0('0x1a')]('\x20|\x20'));_0x4a4eed[_0xdea0('0x1f')](_0x3ce749);}else{logger['error'](_0xdea0('0x2f'),path['join'](__dirname,_0xdea0('0x17'),_0x2e871c['app']+_0xdea0('0x1c')));}}_0x26198f[_0xdea0('0x13')][_0x53b870]=new RuleEngine(_0x4a4eed);_0x26198f[_0xdea0('0x13')][_0x53b870]['execute'](_0x350a73,function(_0x426fd4){logger[_0xdea0('0x2c')]('Applications\x20executed',JSON['stringify'](_0x426fd4[_0xdea0('0x30')]));if(_0x26198f[_0xdea0('0x13')][_0x53b870]){_0x26198f['rules'][_0x53b870][_0xdea0('0x31')](_0xdea0('0x32'));}});return _0x358e4c({'code':0xc8,'message':_0x350a73});}else{logger['info'](_0xdea0('0x33'));return _0x358e4c({'code':0xc8,'message':_0x350a73});}}catch(_0x216a7b){logger['error'](_0x216a7b[_0xdea0('0x34')]);return _0x5bef04(_0x4c6263['error'](0x1f4,_0x216a7b));}}return _0x5bef04(_0xdea0('0x35'));});},'AcceptMessage':function(_0x1b7699){var _0x3fd184=this;return new Promise(function(_0x267b68,_0xce9f4f){if(_0x1b7699[_0xdea0('0x15')]&&_0x1b7699['message']['id']){try{var _0x2abd27=getId(_0x1b7699[_0xdea0('0x14')],_0x1b7699[_0xdea0('0x15')]?_0x1b7699['message']['id']:0x0,_0x1b7699[_0xdea0('0x36')]?_0x1b7699['interaction']['id']:0x0);if(_0x26198f[_0xdea0('0x13')][_0x2abd27]){_0x26198f[_0xdea0('0x13')][_0x2abd27][_0xdea0('0x31')](_0xdea0('0x32'));if(rpc[_0x1b7699[_0xdea0('0x14')]+_0xdea0('0x37')]){rpc[_0x1b7699[_0xdea0('0x14')]+'QueueReport'][_0xdea0('0x38')](_0x2abd27,{'UserId':_0x1b7699[_0xdea0('0x15')][_0xdea0('0x39')]})[_0xdea0('0x3a')](function(_0x40da0a){logger[_0xdea0('0x3b')](_0xdea0('0x3c'));});}}return _0x267b68({'code':0xc8,'message':_0x1b7699});}catch(_0x2f54eb){logger[_0xdea0('0x3b')](_0x2f54eb['stack']);return _0xce9f4f(_0x3fd184[_0xdea0('0x3b')](0x1f4,_0x2f54eb));}}logger[_0xdea0('0x3b')]('message\x20is\x20empty');return _0xce9f4f(_0x3fd184['error'](0x1f4,_0xdea0('0x3d')));});},'RejectMessage':function(_0x2b0b2d){var _0xb427b7=this;return new Promise(function(_0x351464,_0x4bbc2f){if(_0x2b0b2d[_0xdea0('0x3e')]&&_0x2b0b2d[_0xdea0('0x3e')]['id']){try{if(_0x26198f[_0xdea0('0x3f')][_0x2b0b2d[_0xdea0('0x3e')]['id']]){_0x26198f[_0xdea0('0x3f')][_0x2b0b2d[_0xdea0('0x3e')]['id']][_0xdea0('0x40')]=![];_0x26198f['agents'][_0x2b0b2d[_0xdea0('0x3e')]['id']][_0xdea0('0x41')]=undefined;}return _0x351464({'code':0xc8,'message':_0x2b0b2d});}catch(_0x591cd3){logger[_0xdea0('0x3b')](_0x591cd3[_0xdea0('0x34')]);return _0x4bbc2f(_0xb427b7[_0xdea0('0x3b')](0x1f4,_0x591cd3));}}logger['error'](_0xdea0('0x3d'));return _0x4bbc2f(_0xb427b7['error'](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x1b3707){var _0x4581c5=this;return new Promise(function(_0x548e7a,_0x4a77a8){if(_0x1b3707[_0xdea0('0x14')]&&_0x1b3707[_0xdea0('0x36')]&&_0x1b3707[_0xdea0('0x36')]['id']){try{var _0x15348c=getId(_0x1b3707[_0xdea0('0x14')],_0x1b3707[_0xdea0('0x15')]?_0x1b3707['message']['id']:0x0,_0x1b3707['interaction']?_0x1b3707['interaction']['id']:0x0);if(_0x26198f[_0xdea0('0x13')][_0x15348c]){_0x26198f['rules'][_0x15348c][_0xdea0('0x31')]('end');}return _0x548e7a({'code':0xc8,'message':_0x1b3707});}catch(_0x45ed37){logger[_0xdea0('0x3b')](_0x45ed37[_0xdea0('0x34')]);return _0x4a77a8(_0x4581c5[_0xdea0('0x3b')](0x1f4,_0x45ed37));}}logger['error']('message\x20is\x20empty');return _0x4a77a8(_0x4581c5[_0xdea0('0x3b')](0x1f4,_0xdea0('0x3d')));});},'AgentCapacity':function(_0x3987ed){var _0x2b4479=this;return new Promise(function(_0x3e4df8,_0x5732c2){if(_0x26198f[_0xdea0('0x3f')]['hasOwnProperty'](_0x3987ed['id'])){for(var _0x2d4900 in _0x3987ed[_0xdea0('0x42')]){if(_0x3987ed[_0xdea0('0x42')][_0xdea0('0x43')](_0x2d4900)){if(_0x26198f['agents'][_0x3987ed['id']][_0xdea0('0x43')](_0x2d4900+_0xdea0('0x44'))){_0x26198f[_0xdea0('0x3f')][_0x3987ed['id']][_0x2d4900+_0xdea0('0x44')]=parseInt(_0x3987ed['capacity'][_0x2d4900],0xa);}}}_0x26198f['agents'][_0x3987ed['id']][_0xdea0('0x45')]();return _0x3e4df8({'code':0xc8,'message':_0x26198f[_0xdea0('0x3f')][_0x3987ed['id']]});}else{return _0x5732c2(_0x2b4479[_0xdea0('0x3b')](0x1f4,_0xdea0('0x46')));}});},'Agents':function(_0xc4aa6e){return new Promise(function(_0x5941ff,_0x533bbf){var _0x1d83df=_[_0xdea0('0x47')](_0x26198f[_0xdea0('0x3f')]);_0x5941ff({'count':_0x1d83df[_0xdea0('0x18')],'rows':_0x1d83df});});},'ChatQueues':function(_0x2476e8){return new Promise(function(_0x42812b,_0x5f1cb0){var _0x548464=[];for(var _0xdc8892 in _0x26198f[_0xdea0('0x48')]){if(_0x26198f[_0xdea0('0x48')][_0xdea0('0x43')](_0xdc8892)){var _0x4acac0=_0x26198f[_0xdea0('0x48')][_0xdc8892];var _0x2eb165={'id':_0x4acac0['id'],'available':_0x4acac0['available'],'loggedIn':_0x4acac0[_0xdea0('0x49')],'name':_0x4acac0[_0xdea0('0x4a')],'paused':_0x4acac0[_0xdea0('0x4b')],'waiting':_0x4acac0[_0xdea0('0x4c')]};_0x548464['push'](_0x2eb165);}}_0x42812b({'count':_0x548464[_0xdea0('0x18')],'rows':_0x548464});});},'MailQueues':function(_0x5434f8){return new Promise(function(_0x402044,_0x29a115){var _0x230bb4=[];for(var _0x2294c7 in _0x26198f[_0xdea0('0x4d')]){if(_0x26198f['mailQueues'][_0xdea0('0x43')](_0x2294c7)){var _0x3d10de=_0x26198f[_0xdea0('0x4d')][_0x2294c7];var _0x56fdfc={'id':_0x3d10de['id'],'available':_0x3d10de[_0xdea0('0x4e')],'loggedIn':_0x3d10de['loggedIn'],'name':_0x3d10de[_0xdea0('0x4a')],'paused':_0x3d10de[_0xdea0('0x4b')],'waiting':_0x3d10de[_0xdea0('0x4c')]};_0x230bb4[_0xdea0('0x1f')](_0x56fdfc);}}_0x402044({'count':_0x230bb4[_0xdea0('0x18')],'rows':_0x230bb4});});},'OpenchannelQueues':function(_0x146453){return new Promise(function(_0x3075cb,_0x4a9c8b){var _0xbf3145=[];for(var _0x4f7400 in _0x26198f[_0xdea0('0x4f')]){if(_0x26198f[_0xdea0('0x4f')][_0xdea0('0x43')](_0x4f7400)){var _0x5751f5=_0x26198f['openchannelQueues'][_0x4f7400];var _0x4b7898={'id':_0x5751f5['id'],'available':_0x5751f5[_0xdea0('0x4e')],'loggedIn':_0x5751f5[_0xdea0('0x49')],'name':_0x5751f5[_0xdea0('0x4a')],'paused':_0x5751f5[_0xdea0('0x4b')],'waiting':_0x5751f5[_0xdea0('0x4c')]};_0xbf3145[_0xdea0('0x1f')](_0x4b7898);}}_0x3075cb({'count':_0xbf3145[_0xdea0('0x18')],'rows':_0xbf3145});});},'SmsQueues':function(_0x5d04ee){return new Promise(function(_0x14126d,_0x187383){var _0x3fa735=[];for(var _0x43f984 in _0x26198f['smsQueues']){if(_0x26198f['smsQueues'][_0xdea0('0x43')](_0x43f984)){var _0x5af253=_0x26198f['smsQueues'][_0x43f984];var _0x412199={'id':_0x5af253['id'],'available':_0x5af253['available'],'loggedIn':_0x5af253[_0xdea0('0x49')],'name':_0x5af253[_0xdea0('0x4a')],'paused':_0x5af253[_0xdea0('0x4b')],'waiting':_0x5af253[_0xdea0('0x4c')]};_0x3fa735['push'](_0x412199);}}_0x14126d({'count':_0x3fa735['length'],'rows':_0x3fa735});});},'FaxQueues':function(_0x479076){return new Promise(function(_0x47c19f,_0x3e1283){var _0x2f366b=[];for(var _0x40d72d in _0x26198f['faxQueues']){if(_0x26198f[_0xdea0('0x50')]['hasOwnProperty'](_0x40d72d)){var _0x3d1103=_0x26198f[_0xdea0('0x50')][_0x40d72d];var _0x3b3b18={'id':_0x3d1103['id'],'available':_0x3d1103['available'],'loggedIn':_0x3d1103[_0xdea0('0x49')],'name':_0x3d1103[_0xdea0('0x4a')],'paused':_0x3d1103['paused'],'waiting':_0x3d1103[_0xdea0('0x4c')]};_0x2f366b[_0xdea0('0x1f')](_0x3b3b18);}}_0x47c19f({'count':_0x2f366b[_0xdea0('0x18')],'rows':_0x2f366b});});},'ChatQueuesWaitingInteractions':function(_0x11fb1f){return new Promise(function(_0x55aaea,_0x244f1b){var _0x4ee4ab=_[_0xdea0('0x47')](_0x26198f['chatQueuesWaitingInteractions']);_0x55aaea({'count':_0x4ee4ab[_0xdea0('0x18')],'rows':_0x4ee4ab});});},'MailQueuesWaitingInteractions':function(_0x46f386){return new Promise(function(_0xcac5f2,_0x1488d2){var _0x572f36=_[_0xdea0('0x47')](_0x26198f[_0xdea0('0x51')]);_0xcac5f2({'count':_0x572f36['length'],'rows':_0x572f36});});},'OpenchannelQueuesWaitingInteractions':function(_0x3c4f05){return new Promise(function(_0x1b6e55,_0x1b8db3){var _0x19a3c3=_[_0xdea0('0x47')](_0x26198f[_0xdea0('0x52')]);_0x1b6e55({'count':_0x19a3c3[_0xdea0('0x18')],'rows':_0x19a3c3});});},'SmsQueuesWaitingInteractions':function(_0x1ad63e){return new Promise(function(_0x1d650b,_0x8032dc){var _0x22bfb8=_['values'](_0x26198f[_0xdea0('0x53')]);_0x1d650b({'count':_0x22bfb8[_0xdea0('0x18')],'rows':_0x22bfb8});});},'FaxQueuesWaitingInteractions':function(_0x3a30b9){return new Promise(function(_0x234c1b,_0x20f5d5){var _0x4d5068=_[_0xdea0('0x47')](_0x26198f[_0xdea0('0x54')]);_0x234c1b({'count':_0x4d5068['length'],'rows':_0x4d5068});});}};var _0x2a0497=jayson['server'](_0x2c21c1)[_0xdea0('0x55')]();_0x2a0497['on'](_0xdea0('0x3b'),function(_0x38b8c8){logger[_0xdea0('0x3b')](JSON[_0xdea0('0x56')](_0x38b8c8));return _0x157f73(_0x38b8c8);});_0x2a0497[_0xdea0('0x57')](0x232c,'127.0.0.1',function(){console[_0xdea0('0x58')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0xa942(_0xdea0('0x59')+0x232c);});});}; \ No newline at end of file +var _0x337a=['length','existsSync','app','.js','autoreply','appdata','split','push','slice','dialogflow','join','amazonlex','TagId','%s:%s:%s','./interval','condition','intervals','./applications/','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','rules','Applications\x20executed','stringify','matchPath','end','stack','routing\x20is\x20empty','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','agent','agents','busy','busyQueue','emit','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','path','jayson/promise','bluebird','../../../config/environment','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','%s.%s.%s','IntervalId','isNil','map','Intervals','interval','channel','message','interaction','isArray','applications'];(function(_0x26e174,_0x505507){var _0x2f3da7=function(_0x4d2812){while(--_0x4d2812){_0x26e174['push'](_0x26e174['shift']());}};_0x2f3da7(++_0x505507);}(_0x337a,0xf5));var _0xa337=function(_0x395203,_0xa0cf76){_0x395203=_0x395203-0x0;var _0x2d441c=_0x337a[_0x395203];return _0x2d441c;};'use strict';var _=require('lodash');var util=require('util');var path=require(_0xa337('0x0'));var fs=require('fs');var jayson=require(_0xa337('0x1'));var BPromise=require(_0xa337('0x2'));var uuid=require('uuid');var config=require(_0xa337('0x3'));var logger=require('../../../config/logger')(_0xa337('0x4'));var rpc={'openchannelQueueReport':require(_0xa337('0x5'))};var rpc={'openchannelQueueReport':require(_0xa337('0x5')),'mailQueueReport':require(_0xa337('0x6')),'chatQueueReport':require(_0xa337('0x7')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0xa337('0x8'))};var RuleEngine=require(_0xa337('0x9'));function getId(_0x48c26d,_0x1289f9,_0x20c8c1){return util[_0xa337('0xa')](_0xa337('0xb'),_0x48c26d,_0x1289f9||0x0,_0x20c8c1||0x0);}function getIntervals(_0x1a8e18,_0x26d6f9){var _0x3342b9=[];if(!_['isNil'](_0x26d6f9[_0xa337('0xc')])&&!_[_0xa337('0xd')](_0x1a8e18[_0x26d6f9[_0xa337('0xc')]])&&!_[_0xa337('0xd')](_0x1a8e18[_0x26d6f9[_0xa337('0xc')]]['Intervals'])){_0x3342b9=_[_0xa337('0xe')](_0x1a8e18[_0x26d6f9[_0xa337('0xc')]][_0xa337('0xf')],'interval');}else if(!_[_0xa337('0xd')](_0x26d6f9[_0xa337('0x10')])){_0x3342b9=[_0x26d6f9[_0xa337('0x10')]];}return _0x3342b9;}exports['listen']=function(_0x1533a8){_0x1533a8['rules']={};return new BPromise(function(_0x545460,_0x3a297e){var _0x5835b1={'Start':function(_0x3fef14){var _0x41976d=this;return new Promise(function(_0x2b4b9f,_0x529033){if(_0x3fef14){try{var _0x56777e=[];var _0x559c9d=getId(_0x3fef14[_0xa337('0x11')],_0x3fef14[_0xa337('0x12')]?_0x3fef14[_0xa337('0x12')]['id']:0x0,_0x3fef14[_0xa337('0x13')]?_0x3fef14[_0xa337('0x13')]['id']:0x0);if(_0x3fef14['applications']&&_[_0xa337('0x14')](_0x3fef14[_0xa337('0x15')])&&_0x3fef14[_0xa337('0x15')][_0xa337('0x16')]){for(var _0x488f2a=0x0;_0x488f2a<_0x3fef14[_0xa337('0x15')][_0xa337('0x16')];_0x488f2a+=0x1){var _0x4415b9=_0x3fef14[_0xa337('0x15')][_0x488f2a];if(fs[_0xa337('0x17')](path['join'](__dirname,_0xa337('0x15'),_0x4415b9[_0xa337('0x18')]+_0xa337('0x19')))){var _0x4da4ba=[];switch(_0x4415b9[_0xa337('0x18')]['toLowerCase']()){case _0xa337('0x1a'):var _0x18e6ff=_0x4415b9[_0xa337('0x1b')][_0xa337('0x1c')](',');_0x4da4ba[_0xa337('0x1d')](_0x18e6ff[0x0]);_0x4da4ba[_0xa337('0x1d')](_0x18e6ff[_0xa337('0x1e')](0x1,_0x18e6ff[_0xa337('0x16')])['join'](','));break;case _0xa337('0x1f'):var _0x18e6ff=_0x4415b9[_0xa337('0x1b')][_0xa337('0x1c')](',');_0x4da4ba['push'](_0x18e6ff[0x0]);_0x4da4ba[_0xa337('0x1d')](_0x18e6ff[0x1]);_0x4da4ba[_0xa337('0x1d')](_0x18e6ff[_0xa337('0x1e')](0x2,_0x18e6ff[_0xa337('0x16')])[_0xa337('0x20')](','));break;case _0xa337('0x21'):var _0x18e6ff=_0x4415b9[_0xa337('0x1b')][_0xa337('0x1c')](',');_0x4da4ba[_0xa337('0x1d')](_0x18e6ff[0x0]);_0x4da4ba[_0xa337('0x1d')](_0x18e6ff[0x1]);_0x4da4ba[_0xa337('0x1d')](_0x18e6ff[0x2]);_0x4da4ba[_0xa337('0x1d')](_0x18e6ff[0x3]);_0x4da4ba[_0xa337('0x1d')](_0x18e6ff['slice'](0x4,_0x18e6ff[_0xa337('0x16')])[_0xa337('0x20')](','));break;case _0xa337('0x12'):_0x4da4ba[_0xa337('0x1d')](_0x4415b9[_0xa337('0x1b')]);break;case'tag':_0x4da4ba['push'](_0x4415b9[_0xa337('0x22')]);_0x4da4ba[_0xa337('0x1d')](_0x4415b9[_0xa337('0x1b')]);break;default:_0x4da4ba=_[_0xa337('0xd')](_0x4415b9['appdata'])?[]:_0x4415b9['appdata'][_0xa337('0x1c')](',');}var _0x58a05d={'id':util[_0xa337('0xa')](_0xa337('0x23'),_0x559c9d,_0x4415b9['id'],_0x4415b9[_0xa337('0x18')]),'condition':require(_0xa337('0x24'))[_0xa337('0x25')](_0x559c9d,getIntervals(_0x1533a8[_0xa337('0x26')],_0x4415b9),_0x1533a8),'consequence':require(_0xa337('0x27')+_0x4415b9[_0xa337('0x18')])['consequence'](_0x559c9d,_0x4da4ba,_0x1533a8,_0x3fef14),'p':_0x4415b9[_0xa337('0x28')]||0x0};logger[_0xa337('0x29')](_0xa337('0x2a'),_0x58a05d['id'],_0xa337('0x2b'),getIntervals(_0x1533a8[_0xa337('0x26')],_0x4415b9)[_0xa337('0x20')](_0xa337('0x2c')));_0x56777e[_0xa337('0x1d')](_0x58a05d);}else{logger[_0xa337('0x2d')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0xa337('0x20')](__dirname,'applications',_0x4415b9['app']+_0xa337('0x19')));}}_0x1533a8[_0xa337('0x2e')][_0x559c9d]=new RuleEngine(_0x56777e);_0x1533a8[_0xa337('0x2e')][_0x559c9d]['execute'](_0x3fef14,function(_0x333734){logger['info'](_0xa337('0x2f'),JSON[_0xa337('0x30')](_0x333734[_0xa337('0x31')]));if(_0x1533a8['rules'][_0x559c9d]){_0x1533a8[_0xa337('0x2e')][_0x559c9d]['emit'](_0xa337('0x32'));}});return _0x2b4b9f({'code':0xc8,'message':_0x3fef14});}else{logger[_0xa337('0x29')]('No\x20applications\x20to\x20execute');return _0x2b4b9f({'code':0xc8,'message':_0x3fef14});}}catch(_0x347744){logger[_0xa337('0x2d')](_0x347744[_0xa337('0x33')]);return _0x529033(_0x41976d[_0xa337('0x2d')](0x1f4,_0x347744));}}return _0x529033(_0xa337('0x34'));});},'AcceptMessage':function(_0x52df71){var _0x98644f=this;return new Promise(function(_0xb61cc7,_0x5ad0a0){if(_0x52df71[_0xa337('0x12')]&&_0x52df71['message']['id']){try{var _0x53eae2=getId(_0x52df71[_0xa337('0x11')],_0x52df71['message']?_0x52df71[_0xa337('0x12')]['id']:0x0,_0x52df71[_0xa337('0x13')]?_0x52df71[_0xa337('0x13')]['id']:0x0);if(_0x1533a8['rules'][_0x53eae2]){_0x1533a8['rules'][_0x53eae2]['emit'](_0xa337('0x32'));if(rpc[_0x52df71['channel']+_0xa337('0x35')]){rpc[_0x52df71[_0xa337('0x11')]+'QueueReport'][_0xa337('0x36')](_0x53eae2,{'UserId':_0x52df71[_0xa337('0x12')][_0xa337('0x37')]})[_0xa337('0x38')](function(_0x292fc7){logger[_0xa337('0x2d')](_0xa337('0x39'));});}}return _0xb61cc7({'code':0xc8,'message':_0x52df71});}catch(_0x3aa1ed){logger[_0xa337('0x2d')](_0x3aa1ed[_0xa337('0x33')]);return _0x5ad0a0(_0x98644f[_0xa337('0x2d')](0x1f4,_0x3aa1ed));}}logger[_0xa337('0x2d')](_0xa337('0x3a'));return _0x5ad0a0(_0x98644f[_0xa337('0x2d')](0x1f4,_0xa337('0x3a')));});},'RejectMessage':function(_0x190658){var _0x3d23e4=this;return new Promise(function(_0xaa3788,_0x5a1054){if(_0x190658['agent']&&_0x190658[_0xa337('0x3b')]['id']){try{if(_0x1533a8[_0xa337('0x3c')][_0x190658[_0xa337('0x3b')]['id']]){_0x1533a8[_0xa337('0x3c')][_0x190658[_0xa337('0x3b')]['id']][_0xa337('0x3d')]=![];_0x1533a8[_0xa337('0x3c')][_0x190658['agent']['id']][_0xa337('0x3e')]=undefined;}return _0xaa3788({'code':0xc8,'message':_0x190658});}catch(_0x33b31c){logger[_0xa337('0x2d')](_0x33b31c['stack']);return _0x5a1054(_0x3d23e4[_0xa337('0x2d')](0x1f4,_0x33b31c));}}logger[_0xa337('0x2d')](_0xa337('0x3a'));return _0x5a1054(_0x3d23e4[_0xa337('0x2d')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x1f5180){var _0x361533=this;return new Promise(function(_0x2c9513,_0x2f4de5){if(_0x1f5180['channel']&&_0x1f5180[_0xa337('0x13')]&&_0x1f5180[_0xa337('0x13')]['id']){try{var _0x4508f7=getId(_0x1f5180[_0xa337('0x11')],_0x1f5180[_0xa337('0x12')]?_0x1f5180[_0xa337('0x12')]['id']:0x0,_0x1f5180['interaction']?_0x1f5180[_0xa337('0x13')]['id']:0x0);if(_0x1533a8['rules'][_0x4508f7]){_0x1533a8[_0xa337('0x2e')][_0x4508f7][_0xa337('0x3f')](_0xa337('0x32'));}return _0x2c9513({'code':0xc8,'message':_0x1f5180});}catch(_0x2ed3d0){logger[_0xa337('0x2d')](_0x2ed3d0[_0xa337('0x33')]);return _0x2f4de5(_0x361533[_0xa337('0x2d')](0x1f4,_0x2ed3d0));}}logger[_0xa337('0x2d')](_0xa337('0x3a'));return _0x2f4de5(_0x361533[_0xa337('0x2d')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0xb25593){var _0x289d58=this;return new Promise(function(_0x25066d,_0x12b107){if(_0x1533a8[_0xa337('0x3c')]['hasOwnProperty'](_0xb25593['id'])){for(var _0x30bfc0 in _0xb25593[_0xa337('0x40')]){if(_0xb25593[_0xa337('0x40')][_0xa337('0x41')](_0x30bfc0)){if(_0x1533a8[_0xa337('0x3c')][_0xb25593['id']][_0xa337('0x41')](_0x30bfc0+_0xa337('0x42'))){_0x1533a8[_0xa337('0x3c')][_0xb25593['id']][_0x30bfc0+_0xa337('0x42')]=parseInt(_0xb25593[_0xa337('0x40')][_0x30bfc0],0xa);}}}_0x1533a8[_0xa337('0x3c')][_0xb25593['id']][_0xa337('0x43')]();return _0x25066d({'code':0xc8,'message':_0x1533a8[_0xa337('0x3c')][_0xb25593['id']]});}else{return _0x12b107(_0x289d58[_0xa337('0x2d')](0x1f4,_0xa337('0x44')));}});},'Agents':function(_0x5ae738){return new Promise(function(_0x40db10,_0x2339bb){var _0x5b21c8=_[_0xa337('0x45')](_0x1533a8[_0xa337('0x3c')]);_0x40db10({'count':_0x5b21c8[_0xa337('0x16')],'rows':_0x5b21c8});});},'ChatQueues':function(_0x167e42){return new Promise(function(_0x5e7310,_0x3c9bd3){var _0x12b16c=[];for(var _0x3ba016 in _0x1533a8[_0xa337('0x46')]){if(_0x1533a8[_0xa337('0x46')][_0xa337('0x41')](_0x3ba016)){var _0x440956=_0x1533a8[_0xa337('0x46')][_0x3ba016];var _0x363ce1={'id':_0x440956['id'],'available':_0x440956[_0xa337('0x47')],'loggedIn':_0x440956[_0xa337('0x48')],'name':_0x440956[_0xa337('0x49')],'paused':_0x440956[_0xa337('0x4a')],'waiting':_0x440956[_0xa337('0x4b')]};_0x12b16c[_0xa337('0x1d')](_0x363ce1);}}_0x5e7310({'count':_0x12b16c['length'],'rows':_0x12b16c});});},'MailQueues':function(_0x4175cb){return new Promise(function(_0x11d865,_0x1fe463){var _0x55ae6f=[];for(var _0x545d1d in _0x1533a8[_0xa337('0x4c')]){if(_0x1533a8['mailQueues'][_0xa337('0x41')](_0x545d1d)){var _0x3ce143=_0x1533a8['mailQueues'][_0x545d1d];var _0x590f6e={'id':_0x3ce143['id'],'available':_0x3ce143[_0xa337('0x47')],'loggedIn':_0x3ce143[_0xa337('0x48')],'name':_0x3ce143[_0xa337('0x49')],'paused':_0x3ce143[_0xa337('0x4a')],'waiting':_0x3ce143[_0xa337('0x4b')]};_0x55ae6f[_0xa337('0x1d')](_0x590f6e);}}_0x11d865({'count':_0x55ae6f['length'],'rows':_0x55ae6f});});},'OpenchannelQueues':function(_0x534174){return new Promise(function(_0x3d3971,_0x2048ae){var _0x3d4bea=[];for(var _0x4bd2cb in _0x1533a8['openchannelQueues']){if(_0x1533a8[_0xa337('0x4d')][_0xa337('0x41')](_0x4bd2cb)){var _0x59f738=_0x1533a8[_0xa337('0x4d')][_0x4bd2cb];var _0x524c5b={'id':_0x59f738['id'],'available':_0x59f738['available'],'loggedIn':_0x59f738[_0xa337('0x48')],'name':_0x59f738[_0xa337('0x49')],'paused':_0x59f738['paused'],'waiting':_0x59f738['waiting']};_0x3d4bea[_0xa337('0x1d')](_0x524c5b);}}_0x3d3971({'count':_0x3d4bea['length'],'rows':_0x3d4bea});});},'SmsQueues':function(_0x20c703){return new Promise(function(_0x2d7069,_0x177f25){var _0x2dd1a4=[];for(var _0x324e73 in _0x1533a8[_0xa337('0x4e')]){if(_0x1533a8[_0xa337('0x4e')]['hasOwnProperty'](_0x324e73)){var _0x544765=_0x1533a8[_0xa337('0x4e')][_0x324e73];var _0x6de509={'id':_0x544765['id'],'available':_0x544765[_0xa337('0x47')],'loggedIn':_0x544765[_0xa337('0x48')],'name':_0x544765[_0xa337('0x49')],'paused':_0x544765['paused'],'waiting':_0x544765['waiting']};_0x2dd1a4[_0xa337('0x1d')](_0x6de509);}}_0x2d7069({'count':_0x2dd1a4[_0xa337('0x16')],'rows':_0x2dd1a4});});},'FaxQueues':function(_0x4835ba){return new Promise(function(_0x520ba6,_0x29134b){var _0x4a3da6=[];for(var _0x26331c in _0x1533a8[_0xa337('0x4f')]){if(_0x1533a8[_0xa337('0x4f')][_0xa337('0x41')](_0x26331c)){var _0x5a7023=_0x1533a8[_0xa337('0x4f')][_0x26331c];var _0xad72e3={'id':_0x5a7023['id'],'available':_0x5a7023[_0xa337('0x47')],'loggedIn':_0x5a7023[_0xa337('0x48')],'name':_0x5a7023[_0xa337('0x49')],'paused':_0x5a7023['paused'],'waiting':_0x5a7023[_0xa337('0x4b')]};_0x4a3da6[_0xa337('0x1d')](_0xad72e3);}}_0x520ba6({'count':_0x4a3da6[_0xa337('0x16')],'rows':_0x4a3da6});});},'ChatQueuesWaitingInteractions':function(_0x2b10f8){return new Promise(function(_0x2ad078,_0x5c1c47){var _0x38a981=_[_0xa337('0x45')](_0x1533a8['chatQueuesWaitingInteractions']);_0x2ad078({'count':_0x38a981['length'],'rows':_0x38a981});});},'MailQueuesWaitingInteractions':function(_0x22b86a){return new Promise(function(_0x34b8f6,_0x237d33){var _0x3c9e6f=_['values'](_0x1533a8[_0xa337('0x50')]);_0x34b8f6({'count':_0x3c9e6f['length'],'rows':_0x3c9e6f});});},'OpenchannelQueuesWaitingInteractions':function(_0x366a1e){return new Promise(function(_0x2fc1a6,_0x5c2361){var _0x2fdaf6=_['values'](_0x1533a8['openchannelQueuesWaitingInteractions']);_0x2fc1a6({'count':_0x2fdaf6['length'],'rows':_0x2fdaf6});});},'SmsQueuesWaitingInteractions':function(_0x2bdc10){return new Promise(function(_0xda5a11,_0x4f0cb1){var _0xd4b8e5=_['values'](_0x1533a8[_0xa337('0x51')]);_0xda5a11({'count':_0xd4b8e5[_0xa337('0x16')],'rows':_0xd4b8e5});});},'FaxQueuesWaitingInteractions':function(_0x46ce6b){return new Promise(function(_0x556d6b,_0x17246c){var _0x3d102e=_[_0xa337('0x45')](_0x1533a8[_0xa337('0x52')]);_0x556d6b({'count':_0x3d102e['length'],'rows':_0x3d102e});});}};var _0x3c0a03=jayson[_0xa337('0x53')](_0x5835b1)[_0xa337('0x54')]();_0x3c0a03['on']('error',function(_0x232acc){logger[_0xa337('0x2d')](JSON[_0xa337('0x30')](_0x232acc));return _0x3a297e(_0x232acc);});_0x3c0a03['listen'](0x232c,_0xa337('0x55'),function(){console[_0xa337('0x56')](_0xa337('0x57'),0x232c);return _0x545460(_0xa337('0x58')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 62c17f1..807201e 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 _0xfb49=['iftime\x20%s','indexOf','true','all','some','info','join','\x20|\x20','when','log','[%s][INTERVAL]\x20%s\x20%s','stack','util','bluebird','jayson/promise','lodash','routing','client','http','request','then','error','message','result','catch','condition','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','push','Command','format'];(function(_0x46939d,_0xc1b36d){var _0x5105e8=function(_0x536281){while(--_0x536281){_0x46939d['push'](_0x46939d['shift']());}};_0x5105e8(++_0xc1b36d);}(_0xfb49,0x1ac));var _0x9fb4=function(_0x3b56c0,_0xe100d8){_0x3b56c0=_0x3b56c0-0x0;var _0x377efe=_0xfb49[_0x3b56c0];return _0x377efe;};'use strict';var util=require(_0x9fb4('0x0'));var BPromise=require(_0x9fb4('0x1'));var jayson=require(_0x9fb4('0x2'));var _=require(_0x9fb4('0x3'));var logger=require('../../../config/logger')(_0x9fb4('0x4'));var client=jayson[_0x9fb4('0x5')][_0x9fb4('0x6')]({'port':0x232a});function request(_0x445a23,_0x3ba310){return new BPromise(function(_0x55f397,_0x12e1c0){return client[_0x9fb4('0x7')](_0x445a23,_0x3ba310)[_0x9fb4('0x8')](function(_0x51ab4e){if(_0x51ab4e[_0x9fb4('0x9')]){return _0x12e1c0(_0x51ab4e['error'][_0x9fb4('0xa')]);}else{return _0x55f397(_0x51ab4e[_0x9fb4('0xb')]);}})[_0x9fb4('0xc')](function(_0x61eea8){return _0x12e1c0(_0x61eea8);});});}exports[_0x9fb4('0xd')]=function(_0x4ac902,_0x1fd88a,_0x16cb55){return function(_0x3f10e7){if(_0x16cb55[_0x9fb4('0xe')]&&!_0x16cb55[_0x9fb4('0xe')][_0x4ac902]){logger['info'](_0x9fb4('0xf'),_0x4ac902);return _0x3f10e7[_0x9fb4('0x10')]();}var _0x3d6911=[];for(var _0x426efa=0x0;_0x426efa<_0x1fd88a['length'];_0x426efa+=0x1){_0x3d6911[_0x9fb4('0x11')](request(_0x9fb4('0x12'),{'command':util[_0x9fb4('0x13')](_0x9fb4('0x14'),_0x1fd88a[_0x426efa])})[_0x9fb4('0x8')](function(_0xc4838b){return _0xc4838b&&_0xc4838b['message']&&_0xc4838b[_0x9fb4('0xa')][_0x9fb4('0x15')](_0x9fb4('0x16'))>=0x0?!![]:![];})[_0x9fb4('0xc')](function(_0x7cfdd3){logger[_0x9fb4('0x9')]('[%s][INTERVAL]\x20%s',_0x4ac902,_0x1fd88a[_0x426efa]);}));}BPromise[_0x9fb4('0x17')](_0x3d6911)['then'](function(_0x5a64f5){var _0x46231c=_[_0x9fb4('0x18')](_0x5a64f5);logger[_0x9fb4('0x19')]('[%s][INTERVAL]\x20%s\x20%s',_0x4ac902,_0x1fd88a[_0x9fb4('0x1a')](_0x9fb4('0x1b')),_0x46231c);_0x3f10e7[_0x9fb4('0x1c')](_0x46231c);})[_0x9fb4('0xc')](function(_0x540188){console[_0x9fb4('0x1d')](_0x540188);logger[_0x9fb4('0x9')](_0x9fb4('0x1e'),_0x4ac902,_0x1fd88a[_0x9fb4('0x1a')](_0x9fb4('0x1b')),_0x540188[_0x9fb4('0x1f')]);_0x3f10e7[_0x9fb4('0x10')]();});};}; \ No newline at end of file +var _0xed04=['stop','length','Command','iftime\x20%s','indexOf','error','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','log','\x20|\x20','stack','util','bluebird','jayson/promise','../../../config/logger','routing','client','http','then','message','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED'];(function(_0x57ef3b,_0x404284){var _0x1a820a=function(_0x290bd8){while(--_0x290bd8){_0x57ef3b['push'](_0x57ef3b['shift']());}};_0x1a820a(++_0x404284);}(_0xed04,0xf6));var _0x4ed0=function(_0x5dc424,_0x4b48be){_0x5dc424=_0x5dc424-0x0;var _0x1dc446=_0xed04[_0x5dc424];return _0x1dc446;};'use strict';var util=require(_0x4ed0('0x0'));var BPromise=require(_0x4ed0('0x1'));var jayson=require(_0x4ed0('0x2'));var _=require('lodash');var logger=require(_0x4ed0('0x3'))(_0x4ed0('0x4'));var client=jayson[_0x4ed0('0x5')][_0x4ed0('0x6')]({'port':0x232a});function request(_0x369d28,_0x4b3c6f){return new BPromise(function(_0x12f9ab,_0x3ef69d){return client['request'](_0x369d28,_0x4b3c6f)[_0x4ed0('0x7')](function(_0x2b514d){if(_0x2b514d['error']){return _0x3ef69d(_0x2b514d['error'][_0x4ed0('0x8')]);}else{return _0x12f9ab(_0x2b514d[_0x4ed0('0x9')]);}})[_0x4ed0('0xa')](function(_0x456827){return _0x3ef69d(_0x456827);});});}exports[_0x4ed0('0xb')]=function(_0x2b5d26,_0x1f6368,_0x39a491){return function(_0x49ef0e){if(_0x39a491[_0x4ed0('0xc')]&&!_0x39a491[_0x4ed0('0xc')][_0x2b5d26]){logger[_0x4ed0('0xd')](_0x4ed0('0xe'),_0x2b5d26);return _0x49ef0e[_0x4ed0('0xf')]();}var _0x4e88e5=[];for(var _0x4d70c4=0x0;_0x4d70c4<_0x1f6368[_0x4ed0('0x10')];_0x4d70c4+=0x1){_0x4e88e5['push'](request(_0x4ed0('0x11'),{'command':util['format'](_0x4ed0('0x12'),_0x1f6368[_0x4d70c4])})['then'](function(_0x4e617e){return _0x4e617e&&_0x4e617e[_0x4ed0('0x8')]&&_0x4e617e['message'][_0x4ed0('0x13')]('true')>=0x0?!![]:![];})[_0x4ed0('0xa')](function(_0x1f514e){logger[_0x4ed0('0x14')](_0x4ed0('0x15'),_0x2b5d26,_0x1f6368[_0x4d70c4]);}));}BPromise[_0x4ed0('0x16')](_0x4e88e5)['then'](function(_0x1b0ce0){var _0x35d7d9=_[_0x4ed0('0x17')](_0x1b0ce0);logger[_0x4ed0('0xd')](_0x4ed0('0x18'),_0x2b5d26,_0x1f6368[_0x4ed0('0x19')]('\x20|\x20'),_0x35d7d9);_0x49ef0e['when'](_0x35d7d9);})[_0x4ed0('0xa')](function(_0x5e68ba){console[_0x4ed0('0x1a')](_0x5e68ba);logger[_0x4ed0('0x14')](_0x4ed0('0x18'),_0x2b5d26,_0x1f6368[_0x4ed0('0x19')](_0x4ed0('0x1b')),_0x5e68ba[_0x4ed0('0x1c')]);_0x49ef0e['stop']();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 282c394..9661940 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 _0x1978=['transfereruniqueid','transfer','transfertype','blind','transferexten','extension','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','ATTENDED','secondtransfereruniqueid','origtransfererexten','transferuniqueid','transfereeuniqueid','agententerreason','clone','calleridnum','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','hangup','lodash','util','./utils','info','format','channel','interface','connectedlinenum','queue','getVoiceQueueByName','then','type','agentcomplete','acwtime','agentacw','request','CreateVoiceAgentReport','destuniqueid','agentcalled','agentcalledAt','now','lastevent','called','connectedlinename','error','stack','agentringnoanswer','isNil','rejected','reason','holdtime','ringtime','talktime','queuecallerabandon','forIn','uniqueid','agentringnoanswerAt','abandoned','agentconnect','agentconnectAt','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcompleteAt','diffTime','complete','blindtransfer'];(function(_0xd97a9c,_0x1a3cc2){var _0x1b4b9a=function(_0x4efb14){while(--_0x4efb14){_0xd97a9c['push'](_0xd97a9c['shift']());}};_0x1b4b9a(++_0x1a3cc2);}(_0x1978,0x174));var _0x8197=function(_0x175736,_0x1b6669){_0x175736=_0x175736-0x0;var _0x3c1411=_0x1978[_0x175736];return _0x3c1411;};'use strict';var _=require(_0x8197('0x0'));var util=require(_0x8197('0x1'));var utils=require(_0x8197('0x2'));var agents={};var transfers={};function writeDB(_0x3e77fb,_0x3abaff){utils[_0x8197('0x3')](util[_0x8197('0x4')]('AGENT|%s|%s|%s|%s|%s|%s|%s|%s',_0x3e77fb['uniqueid'],_0x3e77fb[_0x8197('0x5')],_0x3e77fb['queue'],_0x3e77fb['membername'],_0x3e77fb[_0x8197('0x6')],_0x3e77fb['calleridnum'],_0x3e77fb[_0x8197('0x7')],_0x3e77fb['lastevent']));if(_0x3e77fb[_0x8197('0x8')]){utils[_0x8197('0x9')](_0x3e77fb[_0x8197('0x8')])[_0x8197('0xa')](function(_0x57b9cc){if(_0x57b9cc){_0x3e77fb['type']=_0x57b9cc[_0x8197('0xb')];_0x3e77fb['agentacw']=_0x3e77fb[_0x8197('0xc')]?_0x57b9cc['acw']:![];_0x3e77fb[_0x8197('0xd')]=_0x3e77fb[_0x8197('0xe')]?_0x57b9cc['acwTimeout']:0x0;}utils[_0x8197('0xf')]('CreateVoiceAgentReport',_0x3e77fb);});}else{utils['request'](_0x8197('0x10'),_0x3e77fb);}if(_0x3abaff){delete transfers[_0x3e77fb['uniqueid']];}else{delete agents[_0x3e77fb[_0x8197('0x11')]];}}exports[_0x8197('0x12')]=function(_0x3e9ec1){try{agents[_0x3e9ec1['destuniqueid']]=_0x3e9ec1;agents[_0x3e9ec1[_0x8197('0x11')]][_0x8197('0x13')]=utils[_0x8197('0x14')]();agents[_0x3e9ec1[_0x8197('0x11')]][_0x8197('0x15')]=_0x8197('0x16');agents[_0x3e9ec1[_0x8197('0x11')]][_0x8197('0x7')]=null;agents[_0x3e9ec1['destuniqueid']][_0x8197('0x17')]=null;}catch(_0x29259c){utils[_0x8197('0x18')](_0x29259c[_0x8197('0x19')]);}};exports[_0x8197('0x1a')]=function(_0x51edf1){try{if(!_[_0x8197('0x1b')](agents[_0x51edf1[_0x8197('0x11')]])){agents[_0x51edf1['destuniqueid']]['agentringnoanswer']=!![];agents[_0x51edf1['destuniqueid']]['agentringnoanswerAt']=utils[_0x8197('0x14')]();agents[_0x51edf1[_0x8197('0x11')]]['lastevent']=_0x8197('0x1c');agents[_0x51edf1['destuniqueid']][_0x8197('0x1d')]=_0x8197('0x1c');agents[_0x51edf1['destuniqueid']][_0x8197('0x1e')]=_0x51edf1[_0x8197('0x1f')]?parseInt(_0x51edf1[_0x8197('0x1f')])/0x3e8:0x0;agents[_0x51edf1[_0x8197('0x11')]][_0x8197('0x20')]=0x0;writeDB(agents[_0x51edf1[_0x8197('0x11')]]);}}catch(_0x1d53ad){utils[_0x8197('0x18')](_0x1d53ad[_0x8197('0x19')]);}};exports[_0x8197('0x21')]=function(_0x2284c4){try{_[_0x8197('0x22')](agents,function(_0x4c12f1,_0x15de66){if(_0x4c12f1[_0x8197('0x23')]==_0x2284c4[_0x8197('0x23')]){_0x4c12f1[_0x8197('0x1a')]=!![];_0x4c12f1[_0x8197('0x24')]=utils[_0x8197('0x14')]();_0x4c12f1['lastevent']=_0x8197('0x25');_0x4c12f1['reason']=_0x8197('0x25');_0x4c12f1[_0x8197('0x1e')]=_0x2284c4['holdtime'];_0x4c12f1[_0x8197('0x20')]=0x0;writeDB(_0x4c12f1);}});}catch(_0x313b2c){utils[_0x8197('0x18')](_0x313b2c[_0x8197('0x19')]);}};exports[_0x8197('0x26')]=function(_0x1996ce){try{if(agents[_0x1996ce[_0x8197('0x11')]]){agents[_0x1996ce[_0x8197('0x11')]][_0x8197('0x27')]=utils['now']();agents[_0x1996ce['destuniqueid']][_0x8197('0x7')]=_0x1996ce[_0x8197('0x7')];agents[_0x1996ce[_0x8197('0x11')]][_0x8197('0x17')]=_0x1996ce[_0x8197('0x17')];agents[_0x1996ce[_0x8197('0x11')]][_0x8197('0x1e')]=_0x1996ce['ringtime'];agents[_0x1996ce[_0x8197('0x11')]][_0x8197('0x15')]=_0x8197('0x28');_['forIn'](agents,function(_0x4106d8,_0x29053e){if(_0x4106d8['destuniqueid']!=_0x1996ce[_0x8197('0x11')]&&_0x4106d8['uniqueid']==_0x1996ce[_0x8197('0x23')]){_0x4106d8[_0x8197('0x20')]=0x0;_0x4106d8[_0x8197('0x1e')]=_0x1996ce['ringtime'];_0x4106d8[_0x8197('0x1a')]=!![];_0x4106d8[_0x8197('0x24')]=utils[_0x8197('0x14')]();_0x4106d8[_0x8197('0x15')]=_0x8197('0x29');_0x4106d8[_0x8197('0x1d')]='answered_elsewhere';_0x4106d8[_0x8197('0x2a')]=_0x1996ce[_0x8197('0x11')];_0x4106d8[_0x8197('0x2b')]=_0x1996ce['membername'];writeDB(_0x4106d8);}});}}catch(_0x51ba6e){utils[_0x8197('0x18')](_0x51ba6e[_0x8197('0x19')]);}};exports[_0x8197('0xc')]=function(_0x50ee19){try{if(!_[_0x8197('0x1b')](agents[_0x50ee19[_0x8197('0x11')]])){agents[_0x50ee19[_0x8197('0x11')]][_0x8197('0xc')]=!![];agents[_0x50ee19['destuniqueid']][_0x8197('0x2c')]=utils[_0x8197('0x14')]();agents[_0x50ee19[_0x8197('0x11')]][_0x8197('0x20')]=utils[_0x8197('0x2d')](agents[_0x50ee19[_0x8197('0x11')]][_0x8197('0x2c')],agents[_0x50ee19[_0x8197('0x11')]][_0x8197('0x27')]);agents[_0x50ee19[_0x8197('0x11')]]['reason']=_0x50ee19['reason'];agents[_0x50ee19[_0x8197('0x11')]][_0x8197('0x15')]=_0x8197('0x2e');writeDB(agents[_0x50ee19[_0x8197('0x11')]]);}}catch(_0x540a60){utils[_0x8197('0x18')](_0x540a60[_0x8197('0x19')]);}};exports[_0x8197('0x2f')]=function(_0x29caa0){try{if(!_['isNil'](agents[_0x29caa0[_0x8197('0x30')]])){agents[_0x29caa0[_0x8197('0x30')]][_0x8197('0x31')]=!![];agents[_0x29caa0[_0x8197('0x30')]][_0x8197('0x32')]=_0x8197('0x33');agents[_0x29caa0['transfereruniqueid']][_0x8197('0x34')]=_0x29caa0[_0x8197('0x35')];agents[_0x29caa0[_0x8197('0x30')]]['transferuniqueid']=agents[_0x29caa0[_0x8197('0x30')]]['uniqueid'];}}catch(_0x53d520){utils[_0x8197('0x18')](_0x53d520[_0x8197('0x19')]);}};exports[_0x8197('0x36')]=function(_0x217869){try{if(_0x217869[_0x8197('0x37')]==_0x217869[_0x8197('0x38')]){if(!_[_0x8197('0x1b')](agents[_0x217869['secondtransfereruniqueid']])){agents[_0x217869['secondtransfereruniqueid']][_0x8197('0x31')]=!![];agents[_0x217869['secondtransfereruniqueid']][_0x8197('0x32')]=_0x8197('0x39');agents[_0x217869[_0x8197('0x3a')]][_0x8197('0x34')]=_0x217869[_0x8197('0x3b')];agents[_0x217869[_0x8197('0x3a')]][_0x8197('0x3c')]=_0x217869[_0x8197('0x37')];}if(_0x217869[_0x8197('0x3d')]&&agents[_0x217869[_0x8197('0x3d')]]){agents[_0x217869[_0x8197('0x3d')]][_0x8197('0x3e')]=0x1;transfers[_0x217869[_0x8197('0x3d')]]=_[_0x8197('0x3f')](agents[_0x217869[_0x8197('0x3d')]]);transfers[_0x217869[_0x8197('0x3d')]][_0x8197('0x40')]=agents[_0x217869[_0x8197('0x3a')]][_0x8197('0x40')];transfers[_0x217869['transfereeuniqueid']][_0x8197('0x41')]=agents[_0x217869[_0x8197('0x3a')]][_0x8197('0x41')];transfers[_0x217869[_0x8197('0x3d')]][_0x8197('0x13')]=utils[_0x8197('0x14')]();transfers[_0x217869[_0x8197('0x3d')]][_0x8197('0x27')]=utils[_0x8197('0x14')]();transfers[_0x217869['transfereeuniqueid']][_0x8197('0x1e')]=0x0;transfers[_0x217869[_0x8197('0x3d')]][_0x8197('0x3e')]=0x2;}}else if(_0x217869[_0x8197('0x3a')]==_0x217869[_0x8197('0x42')]){if(!_['isNil'](agents[_0x217869[_0x8197('0x37')]])){agents[_0x217869[_0x8197('0x37')]]['transfer']=!![];agents[_0x217869[_0x8197('0x37')]][_0x8197('0x32')]='ATTENDED';agents[_0x217869[_0x8197('0x37')]][_0x8197('0x34')]=_0x217869[_0x8197('0x43')];agents[_0x217869['origtransfereruniqueid']]['transferuniqueid']=_0x217869['secondtransfereruniqueid'];}if(_0x217869[_0x8197('0x44')]&&agents[_0x217869[_0x8197('0x44')]]){agents[_0x217869[_0x8197('0x44')]][_0x8197('0x3e')]=0x1;transfers[_0x217869[_0x8197('0x44')]]=_['clone'](agents[_0x217869[_0x8197('0x44')]]);transfers[_0x217869[_0x8197('0x44')]][_0x8197('0x40')]=agents[_0x217869['origtransfereruniqueid']][_0x8197('0x40')];transfers[_0x217869[_0x8197('0x44')]]['calleridname']=agents[_0x217869['origtransfereruniqueid']][_0x8197('0x41')];transfers[_0x217869[_0x8197('0x44')]][_0x8197('0x13')]=utils[_0x8197('0x14')]();transfers[_0x217869['transfertargetuniqueid']][_0x8197('0x27')]=utils[_0x8197('0x14')]();transfers[_0x217869['transfertargetuniqueid']]['holdtime']=0x0;transfers[_0x217869[_0x8197('0x44')]]['agententerreason']=0x2;}}}catch(_0x3ecda0){utils[_0x8197('0x18')](_0x3ecda0[_0x8197('0x19')]);}};exports[_0x8197('0x45')]=function(_0x36bd12){try{if(transfers[_0x36bd12[_0x8197('0x23')]]){transfers[_0x36bd12['uniqueid']][_0x8197('0xc')]=!![];transfers[_0x36bd12[_0x8197('0x23')]]['agentcompleteAt']=utils[_0x8197('0x14')]();transfers[_0x36bd12[_0x8197('0x23')]][_0x8197('0x20')]=utils['diffTime'](transfers[_0x36bd12[_0x8197('0x23')]][_0x8197('0x2c')],transfers[_0x36bd12[_0x8197('0x23')]]['agentconnectAt']);transfers[_0x36bd12['uniqueid']][_0x8197('0x1d')]='agent';transfers[_0x36bd12['uniqueid']][_0x8197('0x15')]='complete';writeDB(transfers[_0x36bd12[_0x8197('0x23')]],!![]);}if(agents[_0x36bd12[_0x8197('0x23')]]&&agents[_0x36bd12['uniqueid']][_0x8197('0x27')]){agents[_0x36bd12['uniqueid']][_0x8197('0xc')]=!![];agents[_0x36bd12[_0x8197('0x23')]][_0x8197('0x2c')]=utils[_0x8197('0x14')]();agents[_0x36bd12[_0x8197('0x23')]][_0x8197('0x20')]=utils[_0x8197('0x2d')](agents[_0x36bd12[_0x8197('0x23')]]['agentcompleteAt'],agents[_0x36bd12[_0x8197('0x23')]]['agentconnectAt']);agents[_0x36bd12[_0x8197('0x23')]]['reason']=agents[_0x36bd12[_0x8197('0x23')]][_0x8197('0x31')]?_0x8197('0x31'):'agent';agents[_0x36bd12[_0x8197('0x23')]][_0x8197('0x15')]='complete';writeDB(agents[_0x36bd12[_0x8197('0x23')]]);}}catch(_0x217db6){utils[_0x8197('0x18')](_0x217db6[_0x8197('0x19')]);}}; \ No newline at end of file +var _0x416e=['uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','now','called','error','stack','isNil','agentringnoanswerAt','rejected','reason','ringtime','talktime','queuecallerabandon','agentringnoanswer','abandoned','agentconnectAt','connectedlinename','holdtime','connect','answered_elsewhere','answeredelsewheremembername','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','blind','transferexten','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfer','transfertype','ATTENDED','transfereeuniqueid','calleridname','agentcalledAt','agententerreason','secondtransfererexten','transfertargetuniqueid','clone','hangup','agent','lodash','util','info','AGENT|%s|%s|%s|%s|%s|%s|%s|%s'];(function(_0x5b31ad,_0x31a2f6){var _0x4fcdb3=function(_0x272753){while(--_0x272753){_0x5b31ad['push'](_0x5b31ad['shift']());}};_0x4fcdb3(++_0x31a2f6);}(_0x416e,0xc5));var _0xe416=function(_0x18eaa8,_0x2dc5f4){_0x18eaa8=_0x18eaa8-0x0;var _0x5acb63=_0x416e[_0x18eaa8];return _0x5acb63;};'use strict';var _=require(_0xe416('0x0'));var util=require(_0xe416('0x1'));var utils=require('./utils');var agents={};var transfers={};function writeDB(_0x38c73b,_0x1fb39e){utils[_0xe416('0x2')](util['format'](_0xe416('0x3'),_0x38c73b[_0xe416('0x4')],_0x38c73b[_0xe416('0x5')],_0x38c73b[_0xe416('0x6')],_0x38c73b[_0xe416('0x7')],_0x38c73b[_0xe416('0x8')],_0x38c73b[_0xe416('0x9')],_0x38c73b[_0xe416('0xa')],_0x38c73b[_0xe416('0xb')]));if(_0x38c73b[_0xe416('0x6')]){utils[_0xe416('0xc')](_0x38c73b[_0xe416('0x6')])[_0xe416('0xd')](function(_0x4771fc){if(_0x4771fc){_0x38c73b[_0xe416('0xe')]=_0x4771fc[_0xe416('0xe')];_0x38c73b[_0xe416('0xf')]=_0x38c73b[_0xe416('0x10')]?_0x4771fc[_0xe416('0x11')]:![];_0x38c73b[_0xe416('0x12')]=_0x38c73b['agentacw']?_0x4771fc[_0xe416('0x13')]:0x0;}utils[_0xe416('0x14')](_0xe416('0x15'),_0x38c73b);});}else{utils['request']('CreateVoiceAgentReport',_0x38c73b);}if(_0x1fb39e){delete transfers[_0x38c73b['uniqueid']];}else{delete agents[_0x38c73b[_0xe416('0x16')]];}}exports[_0xe416('0x17')]=function(_0x54230b){try{agents[_0x54230b[_0xe416('0x16')]]=_0x54230b;agents[_0x54230b[_0xe416('0x16')]]['agentcalledAt']=utils[_0xe416('0x18')]();agents[_0x54230b[_0xe416('0x16')]]['lastevent']=_0xe416('0x19');agents[_0x54230b[_0xe416('0x16')]][_0xe416('0xa')]=null;agents[_0x54230b['destuniqueid']]['connectedlinename']=null;}catch(_0x2a6f57){utils[_0xe416('0x1a')](_0x2a6f57[_0xe416('0x1b')]);}};exports['agentringnoanswer']=function(_0x39fe24){try{if(!_[_0xe416('0x1c')](agents[_0x39fe24['destuniqueid']])){agents[_0x39fe24[_0xe416('0x16')]]['agentringnoanswer']=!![];agents[_0x39fe24['destuniqueid']][_0xe416('0x1d')]=utils['now']();agents[_0x39fe24[_0xe416('0x16')]][_0xe416('0xb')]=_0xe416('0x1e');agents[_0x39fe24[_0xe416('0x16')]][_0xe416('0x1f')]='rejected';agents[_0x39fe24[_0xe416('0x16')]]['holdtime']=_0x39fe24['ringtime']?parseInt(_0x39fe24[_0xe416('0x20')])/0x3e8:0x0;agents[_0x39fe24[_0xe416('0x16')]][_0xe416('0x21')]=0x0;writeDB(agents[_0x39fe24[_0xe416('0x16')]]);}}catch(_0x5b011a){utils['error'](_0x5b011a[_0xe416('0x1b')]);}};exports[_0xe416('0x22')]=function(_0x5d5d12){try{_['forIn'](agents,function(_0xd132ef,_0x4e88e0){if(_0xd132ef['uniqueid']==_0x5d5d12[_0xe416('0x4')]){_0xd132ef[_0xe416('0x23')]=!![];_0xd132ef[_0xe416('0x1d')]=utils['now']();_0xd132ef[_0xe416('0xb')]=_0xe416('0x24');_0xd132ef[_0xe416('0x1f')]=_0xe416('0x24');_0xd132ef['holdtime']=_0x5d5d12['holdtime'];_0xd132ef['talktime']=0x0;writeDB(_0xd132ef);}});}catch(_0x5ba622){utils[_0xe416('0x1a')](_0x5ba622['stack']);}};exports['agentconnect']=function(_0x57d065){try{if(agents[_0x57d065[_0xe416('0x16')]]){agents[_0x57d065[_0xe416('0x16')]][_0xe416('0x25')]=utils[_0xe416('0x18')]();agents[_0x57d065[_0xe416('0x16')]][_0xe416('0xa')]=_0x57d065['connectedlinenum'];agents[_0x57d065[_0xe416('0x16')]][_0xe416('0x26')]=_0x57d065[_0xe416('0x26')];agents[_0x57d065[_0xe416('0x16')]][_0xe416('0x27')]=_0x57d065[_0xe416('0x20')];agents[_0x57d065['destuniqueid']][_0xe416('0xb')]=_0xe416('0x28');_['forIn'](agents,function(_0x51d138,_0x229e53){if(_0x51d138[_0xe416('0x16')]!=_0x57d065['destuniqueid']&&_0x51d138[_0xe416('0x4')]==_0x57d065[_0xe416('0x4')]){_0x51d138[_0xe416('0x21')]=0x0;_0x51d138[_0xe416('0x27')]=_0x57d065[_0xe416('0x20')];_0x51d138[_0xe416('0x23')]=!![];_0x51d138[_0xe416('0x1d')]=utils['now']();_0x51d138[_0xe416('0xb')]='answered_elsewhere';_0x51d138[_0xe416('0x1f')]=_0xe416('0x29');_0x51d138['answeredelsewheredestinationuniqueid']=_0x57d065['destuniqueid'];_0x51d138[_0xe416('0x2a')]=_0x57d065[_0xe416('0x7')];writeDB(_0x51d138);}});}}catch(_0x5df684){utils['error'](_0x5df684['stack']);}};exports[_0xe416('0x10')]=function(_0x9be663){try{if(!_[_0xe416('0x1c')](agents[_0x9be663[_0xe416('0x16')]])){agents[_0x9be663[_0xe416('0x16')]][_0xe416('0x10')]=!![];agents[_0x9be663[_0xe416('0x16')]][_0xe416('0x2b')]=utils['now']();agents[_0x9be663['destuniqueid']][_0xe416('0x21')]=utils[_0xe416('0x2c')](agents[_0x9be663['destuniqueid']][_0xe416('0x2b')],agents[_0x9be663['destuniqueid']][_0xe416('0x25')]);agents[_0x9be663['destuniqueid']][_0xe416('0x1f')]=_0x9be663[_0xe416('0x1f')];agents[_0x9be663[_0xe416('0x16')]][_0xe416('0xb')]=_0xe416('0x2d');writeDB(agents[_0x9be663['destuniqueid']]);}}catch(_0x39216a){utils[_0xe416('0x1a')](_0x39216a[_0xe416('0x1b')]);}};exports[_0xe416('0x2e')]=function(_0x9c0d8c){try{if(!_[_0xe416('0x1c')](agents[_0x9c0d8c[_0xe416('0x2f')]])){agents[_0x9c0d8c[_0xe416('0x2f')]]['transfer']=!![];agents[_0x9c0d8c[_0xe416('0x2f')]]['transfertype']=_0xe416('0x30');agents[_0x9c0d8c[_0xe416('0x2f')]][_0xe416('0x31')]=_0x9c0d8c['extension'];agents[_0x9c0d8c[_0xe416('0x2f')]][_0xe416('0x32')]=agents[_0x9c0d8c['transfereruniqueid']][_0xe416('0x4')];}}catch(_0x5a6be8){utils[_0xe416('0x1a')](_0x5a6be8['stack']);}};exports[_0xe416('0x33')]=function(_0x3fcba5){try{if(_0x3fcba5[_0xe416('0x34')]==_0x3fcba5[_0xe416('0x35')]){if(!_[_0xe416('0x1c')](agents[_0x3fcba5[_0xe416('0x36')]])){agents[_0x3fcba5[_0xe416('0x36')]][_0xe416('0x37')]=!![];agents[_0x3fcba5[_0xe416('0x36')]][_0xe416('0x38')]=_0xe416('0x39');agents[_0x3fcba5['secondtransfereruniqueid']]['transferexten']=_0x3fcba5['origtransfererexten'];agents[_0x3fcba5[_0xe416('0x36')]][_0xe416('0x32')]=_0x3fcba5[_0xe416('0x34')];}if(_0x3fcba5[_0xe416('0x3a')]&&agents[_0x3fcba5[_0xe416('0x3a')]]){agents[_0x3fcba5['transfereeuniqueid']]['agententerreason']=0x1;transfers[_0x3fcba5[_0xe416('0x3a')]]=_['clone'](agents[_0x3fcba5[_0xe416('0x3a')]]);transfers[_0x3fcba5[_0xe416('0x3a')]][_0xe416('0x9')]=agents[_0x3fcba5[_0xe416('0x36')]][_0xe416('0x9')];transfers[_0x3fcba5[_0xe416('0x3a')]]['calleridname']=agents[_0x3fcba5[_0xe416('0x36')]][_0xe416('0x3b')];transfers[_0x3fcba5['transfereeuniqueid']][_0xe416('0x3c')]=utils[_0xe416('0x18')]();transfers[_0x3fcba5['transfereeuniqueid']][_0xe416('0x25')]=utils['now']();transfers[_0x3fcba5[_0xe416('0x3a')]][_0xe416('0x27')]=0x0;transfers[_0x3fcba5['transfereeuniqueid']][_0xe416('0x3d')]=0x2;}}else if(_0x3fcba5['secondtransfereruniqueid']==_0x3fcba5['secondtransfererlinkedid']){if(!_[_0xe416('0x1c')](agents[_0x3fcba5[_0xe416('0x34')]])){agents[_0x3fcba5['origtransfereruniqueid']]['transfer']=!![];agents[_0x3fcba5[_0xe416('0x34')]][_0xe416('0x38')]='ATTENDED';agents[_0x3fcba5[_0xe416('0x34')]][_0xe416('0x31')]=_0x3fcba5[_0xe416('0x3e')];agents[_0x3fcba5[_0xe416('0x34')]][_0xe416('0x32')]=_0x3fcba5[_0xe416('0x36')];}if(_0x3fcba5['transfertargetuniqueid']&&agents[_0x3fcba5[_0xe416('0x3f')]]){agents[_0x3fcba5[_0xe416('0x3f')]][_0xe416('0x3d')]=0x1;transfers[_0x3fcba5[_0xe416('0x3f')]]=_[_0xe416('0x40')](agents[_0x3fcba5['transfertargetuniqueid']]);transfers[_0x3fcba5['transfertargetuniqueid']][_0xe416('0x9')]=agents[_0x3fcba5['origtransfereruniqueid']][_0xe416('0x9')];transfers[_0x3fcba5[_0xe416('0x3f')]][_0xe416('0x3b')]=agents[_0x3fcba5[_0xe416('0x34')]][_0xe416('0x3b')];transfers[_0x3fcba5[_0xe416('0x3f')]][_0xe416('0x3c')]=utils['now']();transfers[_0x3fcba5[_0xe416('0x3f')]]['agentconnectAt']=utils[_0xe416('0x18')]();transfers[_0x3fcba5[_0xe416('0x3f')]][_0xe416('0x27')]=0x0;transfers[_0x3fcba5['transfertargetuniqueid']][_0xe416('0x3d')]=0x2;}}}catch(_0x4315e4){utils[_0xe416('0x1a')](_0x4315e4[_0xe416('0x1b')]);}};exports[_0xe416('0x41')]=function(_0x4ec0b9){try{if(transfers[_0x4ec0b9['uniqueid']]){transfers[_0x4ec0b9[_0xe416('0x4')]][_0xe416('0x10')]=!![];transfers[_0x4ec0b9['uniqueid']]['agentcompleteAt']=utils['now']();transfers[_0x4ec0b9['uniqueid']][_0xe416('0x21')]=utils['diffTime'](transfers[_0x4ec0b9[_0xe416('0x4')]][_0xe416('0x2b')],transfers[_0x4ec0b9[_0xe416('0x4')]][_0xe416('0x25')]);transfers[_0x4ec0b9['uniqueid']][_0xe416('0x1f')]='agent';transfers[_0x4ec0b9[_0xe416('0x4')]][_0xe416('0xb')]=_0xe416('0x2d');writeDB(transfers[_0x4ec0b9[_0xe416('0x4')]],!![]);}if(agents[_0x4ec0b9[_0xe416('0x4')]]&&agents[_0x4ec0b9['uniqueid']]['agentconnectAt']){agents[_0x4ec0b9[_0xe416('0x4')]]['agentcomplete']=!![];agents[_0x4ec0b9['uniqueid']][_0xe416('0x2b')]=utils[_0xe416('0x18')]();agents[_0x4ec0b9[_0xe416('0x4')]][_0xe416('0x21')]=utils['diffTime'](agents[_0x4ec0b9[_0xe416('0x4')]][_0xe416('0x2b')],agents[_0x4ec0b9['uniqueid']][_0xe416('0x25')]);agents[_0x4ec0b9[_0xe416('0x4')]]['reason']=agents[_0x4ec0b9[_0xe416('0x4')]][_0xe416('0x37')]?_0xe416('0x37'):_0xe416('0x42');agents[_0x4ec0b9[_0xe416('0x4')]][_0xe416('0xb')]=_0xe416('0x2d');writeDB(agents[_0x4ec0b9[_0xe416('0x4')]]);}}catch(_0x5f50ac){utils[_0xe416('0x1a')](_0x5f50ac[_0xe416('0x1b')]);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index f17cd71..b3d6b4a 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 _0xd705=['musiconholdstartAt','mohtime','varset','variable','xmd-phone','value','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmcs-queue','lastapplication','Queue','lastdata','queue','ContactId','outboundrouteid','routeid','sipcallid','application','toLowerCase','set','appdata','cdr','split','substring','lastIndexOf','noop','execif','gotoif','lodash','util','./utils','NO\x20ANSWER','FAILED','BUSY','info','format','CALL|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','type','accountcode','destination','callerid','disposition','then','UserId','request','CreateVoiceCallReport','newchannel','OutgoingSpoolFailed','calleridnum','exten','context','now','DOCUMENTATION','error','isNil','channelstate','systemanswertime','linkedid','transfer','destinationchannel','answertime','toNumber','ANSWERED','stack','hangup','calleridname','endtime','diffTime','starttime','billableseconds','localtwolinkedid','transfereechannel','userfield','_attended','origtransfererchannel','musiconholdstart'];(function(_0x1cb267,_0xab55ce){var _0x8b30ff=function(_0x119b6e){while(--_0x119b6e){_0x1cb267['push'](_0x1cb267['shift']());}};_0x8b30ff(++_0xab55ce);}(_0xd705,0x159));var _0x5d70=function(_0x532011,_0x1b1386){_0x532011=_0x532011-0x0;var _0x56f5df=_0xd705[_0x532011];return _0x56f5df;};'use strict';var _=require(_0x5d70('0x0'));var util=require(_0x5d70('0x1'));var utils=require(_0x5d70('0x2'));var dispositions=[_0x5d70('0x3'),'FAILED',_0x5d70('0x4'),_0x5d70('0x3'),_0x5d70('0x3'),_0x5d70('0x3'),'ANSWERED',_0x5d70('0x5'),_0x5d70('0x4'),_0x5d70('0x4'),_0x5d70('0x4')];var channels={};function writeDB(_0x414cc5){utils[_0x5d70('0x6')](util[_0x5d70('0x7')](_0x5d70('0x8'),_0x414cc5[_0x5d70('0x9')],_0x414cc5[_0x5d70('0xa')],_0x414cc5[_0x5d70('0xb')],_0x414cc5[_0x5d70('0xc')],_0x414cc5['source'],_0x414cc5[_0x5d70('0xd')],_0x414cc5[_0x5d70('0xe')],_0x414cc5[_0x5d70('0xf')]));if(_0x414cc5['accountcode']){utils['getUserByInternal'](_0x414cc5[_0x5d70('0xc')])[_0x5d70('0x10')](function(_0x5c0fe6){if(_0x5c0fe6){_0x414cc5[_0x5d70('0x11')]=_0x5c0fe6['id'];}utils[_0x5d70('0x12')]('CreateVoiceCallReport',_0x414cc5);});}else{utils[_0x5d70('0x12')](_0x5d70('0x13'),_0x414cc5);}if(channels[_0x414cc5['uniqueid']]){delete channels[_0x414cc5['uniqueid']];}}exports[_0x5d70('0x14')]=function(_0x479d10){try{if(_0x479d10['uniqueid']==_0x479d10['linkedid']&&_0x479d10[_0x5d70('0xa')]!=_0x5d70('0x15')){channels[_0x479d10['uniqueid']]={'uniqueid':_0x479d10[_0x5d70('0x9')],'accountcode':_0x479d10[_0x5d70('0xc')],'source':_0x479d10[_0x5d70('0x16')],'destination':_0x479d10[_0x5d70('0x17')],'destinationcontext':_0x479d10[_0x5d70('0x18')],'channel':_0x479d10['channel'],'starttime':utils[_0x5d70('0x19')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x5d70('0x3'),'amaflags':_0x5d70('0x1a')};}}catch(_0x62b7de){utils[_0x5d70('0x1b')](_0x62b7de['stack']);}};exports['newstate']=function(_0x579116){try{if(!_[_0x5d70('0x1c')](channels[_0x579116['uniqueid']])&&_0x579116[_0x5d70('0x1d')]==0x6){if(_[_0x5d70('0x1c')](channels[_0x579116[_0x5d70('0x9')]]['systemanswertime'])){channels[_0x579116['uniqueid']][_0x5d70('0x1e')]=utils[_0x5d70('0x19')]();}}else if(!_[_0x5d70('0x1c')](channels[_0x579116[_0x5d70('0x1f')]])&&_0x579116['channelstate']==0x6&&_0x579116[_0x5d70('0x18')]!=_0x5d70('0x20')){channels[_0x579116[_0x5d70('0x1f')]][_0x5d70('0xc')]=_0x579116[_0x5d70('0xc')];channels[_0x579116['linkedid']][_0x5d70('0x21')]=_0x579116[_0x5d70('0xa')];if(_['isNil'](channels[_0x579116['linkedid']][_0x5d70('0x22')])){channels[_0x579116[_0x5d70('0x1f')]][_0x5d70('0x22')]=utils['now']();}channels[_0x579116[_0x5d70('0x1f')]][_0x5d70('0xf')]=dispositions[_[_0x5d70('0x23')](_0x579116[_0x5d70('0x1d')])]||_0x5d70('0x24');}}catch(_0x55a4fa){utils[_0x5d70('0x1b')](_0x55a4fa[_0x5d70('0x25')]);}};exports[_0x5d70('0x26')]=function(_0x224e5c){try{if(!_['isNil'](channels[_0x224e5c['uniqueid']])){if(_[_0x5d70('0x1c')](channels[_0x224e5c[_0x5d70('0x9')]]['callerid'])){channels[_0x224e5c[_0x5d70('0x9')]][_0x5d70('0xe')]=_0x224e5c[_0x5d70('0x27')]+'\x20<'+_0x224e5c[_0x5d70('0x16')]+'>';}channels[_0x224e5c[_0x5d70('0x9')]][_0x5d70('0x28')]=utils['now']();channels[_0x224e5c[_0x5d70('0x9')]]['duration']=utils[_0x5d70('0x29')](channels[_0x224e5c['uniqueid']][_0x5d70('0x28')],channels[_0x224e5c[_0x5d70('0x9')]][_0x5d70('0x2a')]);channels[_0x224e5c[_0x5d70('0x9')]][_0x5d70('0x2b')]=channels[_0x224e5c[_0x5d70('0x9')]][_0x5d70('0x22')]?utils[_0x5d70('0x29')](channels[_0x224e5c[_0x5d70('0x9')]]['endtime'],channels[_0x224e5c['uniqueid']][_0x5d70('0x22')]):0x0;writeDB(channels[_0x224e5c[_0x5d70('0x9')]]);}}catch(_0x237cfa){utils[_0x5d70('0x1b')](_0x237cfa[_0x5d70('0x25')]);}};exports['attendedtransfer']=function(_0x2dcd51){try{if(!_['isNil'](channels[_0x2dcd51['localtwolinkedid']])){if(channels[_0x2dcd51[_0x5d70('0x2c')]][_0x5d70('0xa')]==_0x2dcd51[_0x5d70('0x2d')]){channels[_0x2dcd51[_0x5d70('0x2c')]][_0x5d70('0x21')]=_0x2dcd51['secondtransfererchannel'];channels[_0x2dcd51['localtwolinkedid']][_0x5d70('0x2e')]=_0x5d70('0x2f');}else if(channels[_0x2dcd51[_0x5d70('0x2c')]][_0x5d70('0xa')]=_0x2dcd51['transfertargetchannel']){channels[_0x2dcd51[_0x5d70('0x2c')]]['destinationchannel']=_0x2dcd51[_0x5d70('0x30')];channels[_0x2dcd51[_0x5d70('0x2c')]]['userfield']=_0x5d70('0x2f');}}}catch(_0x3183f8){utils[_0x5d70('0x1b')](_0x3183f8['stack']);}};exports[_0x5d70('0x31')]=function(_0x3c5652){try{if(!_[_0x5d70('0x1c')](channels[_0x3c5652['uniqueid']])){channels[_0x3c5652[_0x5d70('0x9')]][_0x5d70('0x32')]=utils[_0x5d70('0x19')]();}}catch(_0x645b94){utils[_0x5d70('0x1b')](_0x645b94['stack']);}};exports['musiconholdstop']=function(_0x546971){try{if(!_[_0x5d70('0x1c')](channels[_0x546971[_0x5d70('0x9')]])){if(!_[_0x5d70('0x1c')](channels[_0x546971[_0x5d70('0x9')]]['musiconholdstartAt'])){channels[_0x546971[_0x5d70('0x9')]][_0x5d70('0x33')]+=utils[_0x5d70('0x29')](utils['now'](),channels[_0x546971[_0x5d70('0x9')]]['musiconholdstartAt']);delete channels[_0x546971['uniqueid']][_0x5d70('0x32')];}}}catch(_0x596e07){utils[_0x5d70('0x1b')](_0x596e07[_0x5d70('0x25')]);}};exports[_0x5d70('0x34')]=function(_0x5e1b8a){try{if(!_[_0x5d70('0x1c')](channels[_0x5e1b8a[_0x5d70('0x9')]])){if(!_[_0x5d70('0x1c')](_0x5e1b8a[_0x5d70('0x35')]['xmd-originatecalleridnum'])){channels[_0x5e1b8a[_0x5d70('0x9')]]['source']=_0x5e1b8a['value'];}if(!_[_0x5d70('0x1c')](_0x5e1b8a['variable'][_0x5d70('0x36')])){channels[_0x5e1b8a[_0x5d70('0x9')]][_0x5d70('0xd')]=_0x5e1b8a[_0x5d70('0x37')];channels[_0x5e1b8a[_0x5d70('0x9')]][_0x5d70('0xe')]='\x22'+_0x5e1b8a[_0x5d70('0x37')]+_0x5d70('0x38')+_0x5e1b8a[_0x5d70('0x37')]+'>';}if(!_['isNil'](_0x5e1b8a[_0x5d70('0x35')][_0x5d70('0x39')])||!_['isNil'](_0x5e1b8a[_0x5d70('0x35')][_0x5d70('0x3a')])){channels[_0x5e1b8a[_0x5d70('0x9')]][_0x5d70('0xe')]=_0x5e1b8a['value'];}if(!_['isNil'](_0x5e1b8a[_0x5d70('0x35')]['xmd-queue'])||!_[_0x5d70('0x1c')](_0x5e1b8a[_0x5d70('0x35')][_0x5d70('0x3b')])){channels[_0x5e1b8a[_0x5d70('0x9')]][_0x5d70('0x3c')]=_0x5d70('0x3d');channels[_0x5e1b8a['uniqueid']][_0x5d70('0x3e')]=_0x5e1b8a[_0x5d70('0x37')];channels[_0x5e1b8a[_0x5d70('0x9')]][_0x5d70('0x3f')]=!![];}if(!_['isNil'](_0x5e1b8a[_0x5d70('0x35')]['xmd-contactid'])){channels[_0x5e1b8a[_0x5d70('0x9')]][_0x5d70('0x40')]=_0x5e1b8a['value'];}if(!_[_0x5d70('0x1c')](_0x5e1b8a[_0x5d70('0x35')]['xmd-cdrtype'])){channels[_0x5e1b8a['uniqueid']]['type']=_0x5e1b8a[_0x5d70('0x37')];}if(!_[_0x5d70('0x1c')](_0x5e1b8a['variable'][_0x5d70('0x41')])){channels[_0x5e1b8a[_0x5d70('0x9')]][_0x5d70('0x42')]=_0x5e1b8a[_0x5d70('0x37')];}if(!_[_0x5d70('0x1c')](_0x5e1b8a[_0x5d70('0x35')][_0x5d70('0x43')])){channels[_0x5e1b8a[_0x5d70('0x9')]][_0x5d70('0x43')]=_0x5e1b8a[_0x5d70('0x37')];}}}catch(_0x4a3803){utils['error'](_0x4a3803[_0x5d70('0x25')]);}};exports['newexten']=function(_0x1c3d44){try{if(!_[_0x5d70('0x1c')](channels[_0x1c3d44[_0x5d70('0x9')]])){if(_0x1c3d44[_0x5d70('0x44')][_0x5d70('0x45')]()==_0x5d70('0x46')&&_['startsWith'](_0x1c3d44[_0x5d70('0x47')][_0x5d70('0x45')](),_0x5d70('0x48'))){var _0x17ab27=_0x1c3d44[_0x5d70('0x47')][_0x5d70('0x49')]('=');var _0x5b8f06=_0x17ab27[0x0][_0x5d70('0x4a')](_0x17ab27[0x0][_0x5d70('0x4b')]('(')+0x1,_0x17ab27[0x0]['lastIndexOf'](')'));var _0x5dc45d=_0x17ab27[0x1];channels[_0x1c3d44[_0x5d70('0x9')]][_0x5b8f06]=_0x5dc45d;}if(!_['includes']([_0x5d70('0x26'),_0x5d70('0x4c'),_0x5d70('0x4d'),_0x5d70('0x46'),_0x5d70('0x4e')],_0x1c3d44[_0x5d70('0x44')][_0x5d70('0x45')]())){channels[_0x1c3d44[_0x5d70('0x9')]]['lastapplication']=_0x1c3d44[_0x5d70('0x44')];channels[_0x1c3d44[_0x5d70('0x9')]][_0x5d70('0x3e')]=_0x1c3d44[_0x5d70('0x47')];}}}catch(_0x2f2a7a){utils[_0x5d70('0x1b')](_0x2f2a7a[_0x5d70('0x25')]);}}; \ No newline at end of file +var _0x554a=['ContactId','outboundrouteid','routeid','sipcallid','application','toLowerCase','set','startsWith','cdr','appdata','lastIndexOf','noop','execif','gotoif','lastapplication','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','format','CALL|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','type','accountcode','source','destination','callerid','getUserByInternal','then','UserId','request','CreateVoiceCallReport','linkedid','OutgoingSpoolFailed','calleridnum','exten','context','now','DOCUMENTATION','error','stack','newstate','isNil','channelstate','systemanswertime','destinationchannel','answertime','toNumber','hangup','endtime','duration','diffTime','localtwolinkedid','secondtransfererchannel','userfield','transfertargetchannel','origtransfererchannel','_attended','musiconholdstart','musiconholdstartAt','musiconholdstop','mohtime','varset','variable','xmd-originatecalleridnum','value','xmd-phone','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','lastdata','xmd-contactid'];(function(_0x2b9e8a,_0x7b21d4){var _0x520e67=function(_0x22bce8){while(--_0x22bce8){_0x2b9e8a['push'](_0x2b9e8a['shift']());}};_0x520e67(++_0x7b21d4);}(_0x554a,0x195));var _0xa554=function(_0x464d4e,_0x11491c){_0x464d4e=_0x464d4e-0x0;var _0x52aaec=_0x554a[_0x464d4e];return _0x52aaec;};'use strict';var _=require(_0xa554('0x0'));var util=require(_0xa554('0x1'));var utils=require(_0xa554('0x2'));var dispositions=[_0xa554('0x3'),_0xa554('0x4'),_0xa554('0x4'),'NO\x20ANSWER',_0xa554('0x3'),_0xa554('0x3'),_0xa554('0x5'),_0xa554('0x6'),_0xa554('0x4'),_0xa554('0x4'),_0xa554('0x4')];var channels={};function writeDB(_0xd710a4){utils['info'](util[_0xa554('0x7')](_0xa554('0x8'),_0xd710a4[_0xa554('0x9')],_0xd710a4[_0xa554('0xa')],_0xd710a4[_0xa554('0xb')],_0xd710a4[_0xa554('0xc')],_0xd710a4[_0xa554('0xd')],_0xd710a4[_0xa554('0xe')],_0xd710a4[_0xa554('0xf')],_0xd710a4['disposition']));if(_0xd710a4[_0xa554('0xc')]){utils[_0xa554('0x10')](_0xd710a4[_0xa554('0xc')])[_0xa554('0x11')](function(_0x33583a){if(_0x33583a){_0xd710a4[_0xa554('0x12')]=_0x33583a['id'];}utils[_0xa554('0x13')](_0xa554('0x14'),_0xd710a4);});}else{utils[_0xa554('0x13')](_0xa554('0x14'),_0xd710a4);}if(channels[_0xd710a4[_0xa554('0x9')]]){delete channels[_0xd710a4[_0xa554('0x9')]];}}exports['newchannel']=function(_0x28bb25){try{if(_0x28bb25[_0xa554('0x9')]==_0x28bb25[_0xa554('0x15')]&&_0x28bb25[_0xa554('0xa')]!=_0xa554('0x16')){channels[_0x28bb25[_0xa554('0x9')]]={'uniqueid':_0x28bb25[_0xa554('0x9')],'accountcode':_0x28bb25[_0xa554('0xc')],'source':_0x28bb25[_0xa554('0x17')],'destination':_0x28bb25[_0xa554('0x18')],'destinationcontext':_0x28bb25[_0xa554('0x19')],'channel':_0x28bb25[_0xa554('0xa')],'starttime':utils[_0xa554('0x1a')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xa554('0x3'),'amaflags':_0xa554('0x1b')};}}catch(_0x502164){utils[_0xa554('0x1c')](_0x502164[_0xa554('0x1d')]);}};exports[_0xa554('0x1e')]=function(_0x2ebf71){try{if(!_[_0xa554('0x1f')](channels[_0x2ebf71[_0xa554('0x9')]])&&_0x2ebf71[_0xa554('0x20')]==0x6){if(_[_0xa554('0x1f')](channels[_0x2ebf71['uniqueid']][_0xa554('0x21')])){channels[_0x2ebf71[_0xa554('0x9')]]['systemanswertime']=utils[_0xa554('0x1a')]();}}else if(!_[_0xa554('0x1f')](channels[_0x2ebf71[_0xa554('0x15')]])&&_0x2ebf71[_0xa554('0x20')]==0x6&&_0x2ebf71[_0xa554('0x19')]!='transfer'){channels[_0x2ebf71[_0xa554('0x15')]][_0xa554('0xc')]=_0x2ebf71[_0xa554('0xc')];channels[_0x2ebf71['linkedid']][_0xa554('0x22')]=_0x2ebf71[_0xa554('0xa')];if(_[_0xa554('0x1f')](channels[_0x2ebf71[_0xa554('0x15')]][_0xa554('0x23')])){channels[_0x2ebf71[_0xa554('0x15')]][_0xa554('0x23')]=utils['now']();}channels[_0x2ebf71['linkedid']]['disposition']=dispositions[_[_0xa554('0x24')](_0x2ebf71[_0xa554('0x20')])]||'ANSWERED';}}catch(_0x3b3bfc){utils[_0xa554('0x1c')](_0x3b3bfc['stack']);}};exports[_0xa554('0x25')]=function(_0x88c478){try{if(!_[_0xa554('0x1f')](channels[_0x88c478['uniqueid']])){if(_[_0xa554('0x1f')](channels[_0x88c478['uniqueid']][_0xa554('0xf')])){channels[_0x88c478[_0xa554('0x9')]][_0xa554('0xf')]=_0x88c478['calleridname']+'\x20<'+_0x88c478[_0xa554('0x17')]+'>';}channels[_0x88c478[_0xa554('0x9')]][_0xa554('0x26')]=utils[_0xa554('0x1a')]();channels[_0x88c478[_0xa554('0x9')]][_0xa554('0x27')]=utils[_0xa554('0x28')](channels[_0x88c478[_0xa554('0x9')]][_0xa554('0x26')],channels[_0x88c478[_0xa554('0x9')]]['starttime']);channels[_0x88c478[_0xa554('0x9')]]['billableseconds']=channels[_0x88c478[_0xa554('0x9')]][_0xa554('0x23')]?utils[_0xa554('0x28')](channels[_0x88c478[_0xa554('0x9')]][_0xa554('0x26')],channels[_0x88c478[_0xa554('0x9')]][_0xa554('0x23')]):0x0;writeDB(channels[_0x88c478['uniqueid']]);}}catch(_0x36c5c3){utils[_0xa554('0x1c')](_0x36c5c3[_0xa554('0x1d')]);}};exports['attendedtransfer']=function(_0x47c18a){try{if(!_['isNil'](channels[_0x47c18a[_0xa554('0x29')]])){if(channels[_0x47c18a[_0xa554('0x29')]][_0xa554('0xa')]==_0x47c18a['transfereechannel']){channels[_0x47c18a['localtwolinkedid']][_0xa554('0x22')]=_0x47c18a[_0xa554('0x2a')];channels[_0x47c18a[_0xa554('0x29')]][_0xa554('0x2b')]='_attended';}else if(channels[_0x47c18a[_0xa554('0x29')]][_0xa554('0xa')]=_0x47c18a[_0xa554('0x2c')]){channels[_0x47c18a[_0xa554('0x29')]][_0xa554('0x22')]=_0x47c18a[_0xa554('0x2d')];channels[_0x47c18a[_0xa554('0x29')]][_0xa554('0x2b')]=_0xa554('0x2e');}}}catch(_0x198f53){utils['error'](_0x198f53['stack']);}};exports[_0xa554('0x2f')]=function(_0x3d3209){try{if(!_[_0xa554('0x1f')](channels[_0x3d3209['uniqueid']])){channels[_0x3d3209['uniqueid']][_0xa554('0x30')]=utils[_0xa554('0x1a')]();}}catch(_0x43d903){utils['error'](_0x43d903[_0xa554('0x1d')]);}};exports[_0xa554('0x31')]=function(_0xc703){try{if(!_['isNil'](channels[_0xc703[_0xa554('0x9')]])){if(!_['isNil'](channels[_0xc703[_0xa554('0x9')]][_0xa554('0x30')])){channels[_0xc703[_0xa554('0x9')]][_0xa554('0x32')]+=utils['diffTime'](utils['now'](),channels[_0xc703[_0xa554('0x9')]][_0xa554('0x30')]);delete channels[_0xc703['uniqueid']][_0xa554('0x30')];}}}catch(_0x49c9fb){utils[_0xa554('0x1c')](_0x49c9fb[_0xa554('0x1d')]);}};exports[_0xa554('0x33')]=function(_0x1bdd29){try{if(!_[_0xa554('0x1f')](channels[_0x1bdd29['uniqueid']])){if(!_[_0xa554('0x1f')](_0x1bdd29[_0xa554('0x34')][_0xa554('0x35')])){channels[_0x1bdd29[_0xa554('0x9')]][_0xa554('0xd')]=_0x1bdd29[_0xa554('0x36')];}if(!_[_0xa554('0x1f')](_0x1bdd29['variable'][_0xa554('0x37')])){channels[_0x1bdd29['uniqueid']][_0xa554('0xe')]=_0x1bdd29[_0xa554('0x36')];channels[_0x1bdd29[_0xa554('0x9')]][_0xa554('0xf')]='\x22'+_0x1bdd29[_0xa554('0x36')]+_0xa554('0x38')+_0x1bdd29[_0xa554('0x36')]+'>';}if(!_['isNil'](_0x1bdd29[_0xa554('0x34')][_0xa554('0x39')])||!_[_0xa554('0x1f')](_0x1bdd29['variable'][_0xa554('0x3a')])){channels[_0x1bdd29['uniqueid']][_0xa554('0xf')]=_0x1bdd29[_0xa554('0x36')];}if(!_['isNil'](_0x1bdd29[_0xa554('0x34')][_0xa554('0x3b')])||!_[_0xa554('0x1f')](_0x1bdd29[_0xa554('0x34')][_0xa554('0x3c')])){channels[_0x1bdd29['uniqueid']]['lastapplication']='Queue';channels[_0x1bdd29[_0xa554('0x9')]][_0xa554('0x3d')]=_0x1bdd29['value'];channels[_0x1bdd29[_0xa554('0x9')]]['queue']=!![];}if(!_[_0xa554('0x1f')](_0x1bdd29[_0xa554('0x34')][_0xa554('0x3e')])){channels[_0x1bdd29[_0xa554('0x9')]][_0xa554('0x3f')]=_0x1bdd29[_0xa554('0x36')];}if(!_[_0xa554('0x1f')](_0x1bdd29[_0xa554('0x34')]['xmd-cdrtype'])){channels[_0x1bdd29[_0xa554('0x9')]]['type']=_0x1bdd29[_0xa554('0x36')];}if(!_[_0xa554('0x1f')](_0x1bdd29['variable'][_0xa554('0x40')])){channels[_0x1bdd29[_0xa554('0x9')]][_0xa554('0x41')]=_0x1bdd29[_0xa554('0x36')];}if(!_[_0xa554('0x1f')](_0x1bdd29['variable'][_0xa554('0x42')])){channels[_0x1bdd29['uniqueid']][_0xa554('0x42')]=_0x1bdd29[_0xa554('0x36')];}}}catch(_0x1ac8f1){utils[_0xa554('0x1c')](_0x1ac8f1[_0xa554('0x1d')]);}};exports['newexten']=function(_0x4a7551){try{if(!_[_0xa554('0x1f')](channels[_0x4a7551[_0xa554('0x9')]])){if(_0x4a7551[_0xa554('0x43')][_0xa554('0x44')]()==_0xa554('0x45')&&_[_0xa554('0x46')](_0x4a7551['appdata'][_0xa554('0x44')](),_0xa554('0x47'))){var _0x177d7e=_0x4a7551[_0xa554('0x48')]['split']('=');var _0x1429c3=_0x177d7e[0x0]['substring'](_0x177d7e[0x0][_0xa554('0x49')]('(')+0x1,_0x177d7e[0x0][_0xa554('0x49')](')'));var _0x5b57a2=_0x177d7e[0x1];channels[_0x4a7551['uniqueid']][_0x1429c3]=_0x5b57a2;}if(!_['includes']([_0xa554('0x25'),_0xa554('0x4a'),_0xa554('0x4b'),'set',_0xa554('0x4c')],_0x4a7551['application'][_0xa554('0x44')]())){channels[_0x4a7551['uniqueid']][_0xa554('0x4d')]=_0x4a7551[_0xa554('0x43')];channels[_0x4a7551['uniqueid']]['lastdata']=_0x4a7551['appdata'];}}}catch(_0x37367e){utils[_0xa554('0x1c')](_0x37367e[_0xa554('0x1d')]);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 75eef63..24dbdaa 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 _0x3fa4=['shutdown','info','SHUTDOWN','fullybooted','FULLYBOOTED','error','close','CLOSE','managerevent','./utils','CONNECTED'];(function(_0x5c1151,_0x518602){var _0x58ab77=function(_0x3fe264){while(--_0x3fe264){_0x5c1151['push'](_0x5c1151['shift']());}};_0x58ab77(++_0x518602);}(_0x3fa4,0xf0));var _0x43fa=function(_0x495c33,_0x4d2899){_0x495c33=_0x495c33-0x0;var _0x4c0d10=_0x3fa4[_0x495c33];return _0x4c0d10;};'use strict';var utils=require(_0x43fa('0x0'));var _=require('lodash');exports['connect']=function(){utils['info'](_0x43fa('0x1'));};exports[_0x43fa('0x2')]=function(){utils[_0x43fa('0x3')](_0x43fa('0x4'));};exports[_0x43fa('0x5')]=function(){utils[_0x43fa('0x3')](_0x43fa('0x6'));};exports['error']=function(_0x2c7789){utils[_0x43fa('0x7')](_0x2c7789);};exports[_0x43fa('0x8')]=function(){utils['info'](_0x43fa('0x9'));};exports[_0x43fa('0xa')]=function(_0x1dc401){}; \ No newline at end of file +var _0x1af3=['CLOSE','managerevent','./utils','lodash','connect','info','CONNECTED','shutdown','SHUTDOWN','fullybooted','error','close'];(function(_0x2b0262,_0x18e91d){var _0x3c6e84=function(_0x2fd7ba){while(--_0x2fd7ba){_0x2b0262['push'](_0x2b0262['shift']());}};_0x3c6e84(++_0x18e91d);}(_0x1af3,0x1ca));var _0x31af=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0x1af3[_0x2cf2e9];return _0xd3670d;};'use strict';var utils=require(_0x31af('0x0'));var _=require(_0x31af('0x1'));exports[_0x31af('0x2')]=function(){utils[_0x31af('0x3')](_0x31af('0x4'));};exports[_0x31af('0x5')]=function(){utils[_0x31af('0x3')](_0x31af('0x6'));};exports[_0x31af('0x7')]=function(){utils[_0x31af('0x3')]('FULLYBOOTED');};exports[_0x31af('0x8')]=function(_0x416162){utils[_0x31af('0x8')](_0x416162);};exports[_0x31af('0x9')]=function(){utils['info'](_0x31af('0xa'));};exports[_0x31af('0xb')]=function(_0x406dd8){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index e3a1cc1..69452ac 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 _0xd4df=['variable','outboundrouteid','value','assign','starttime','now','lastevent','called','dialend','dialstatus','ANSWER','answertime','connect','hangup','diffTime','holdtime','endtime','billableseconds','./utils','info','format','uniqueid','channel','dialstring','calleridnum','connectedlinenum','request','CreateVoiceDialReport','newexten','application','toLowerCase','set','startsWith','appdata','cdr(routeid)','split','error','stack','varset','isNil'];(function(_0x182800,_0x2776f2){var _0x425505=function(_0x2aae86){while(--_0x2aae86){_0x182800['push'](_0x182800['shift']());}};_0x425505(++_0x2776f2);}(_0xd4df,0xb2));var _0xfd4d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd4df[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xfd4d('0x0'));var dials={};function writeDB(_0x598d57){utils[_0xfd4d('0x1')](util[_0xfd4d('0x2')]('DIAL|%s|%s|%s|%s|%s|%s',_0x598d57[_0xfd4d('0x3')],_0x598d57[_0xfd4d('0x4')],_0x598d57[_0xfd4d('0x5')],_0x598d57[_0xfd4d('0x6')],_0x598d57[_0xfd4d('0x7')],_0x598d57['dialstatus']));utils[_0xfd4d('0x8')](_0xfd4d('0x9'),_0x598d57);delete dials[_0x598d57[_0xfd4d('0x3')]];}exports[_0xfd4d('0xa')]=function(_0xe6be39){try{if(_0xe6be39[_0xfd4d('0xb')][_0xfd4d('0xc')]()==_0xfd4d('0xd')&&_[_0xfd4d('0xe')](_0xe6be39[_0xfd4d('0xf')][_0xfd4d('0xc')](),_0xfd4d('0x10'))){var _0x2119c0=_0xe6be39[_0xfd4d('0xf')][_0xfd4d('0x11')]('=');dials[_0xe6be39[_0xfd4d('0x3')]]={'routeId':_0x2119c0[0x1]};}}catch(_0x25d925){utils[_0xfd4d('0x12')](_0x25d925[_0xfd4d('0x13')]);}};exports[_0xfd4d('0x14')]=function(_0x33410c){try{if(!_[_0xfd4d('0x15')](_0x33410c[_0xfd4d('0x16')][_0xfd4d('0x17')])){dials[_0x33410c[_0xfd4d('0x3')]]={'routeId':_0x33410c[_0xfd4d('0x18')]};}}catch(_0x5b1ddc){utils[_0xfd4d('0x12')](_0x5b1ddc[_0xfd4d('0x13')]);}};exports['dialbegin']=function(_0x4cd196){try{if(!_[_0xfd4d('0x15')](dials[_0x4cd196[_0xfd4d('0x3')]])){dials[_0x4cd196['uniqueid']]=_[_0xfd4d('0x19')](dials[_0x4cd196[_0xfd4d('0x3')]],_0x4cd196);dials[_0x4cd196[_0xfd4d('0x3')]][_0xfd4d('0x1a')]=utils[_0xfd4d('0x1b')]();dials[_0x4cd196[_0xfd4d('0x3')]][_0xfd4d('0x1c')]=_0xfd4d('0x1d');}}catch(_0x4b12ce){utils[_0xfd4d('0x12')](_0x4b12ce['stack']);}};exports[_0xfd4d('0x1e')]=function(_0x4bea20){try{if(!_['isNil'](dials[_0x4bea20[_0xfd4d('0x3')]])){dials[_0x4bea20[_0xfd4d('0x3')]][_0xfd4d('0x1f')]=_0x4bea20[_0xfd4d('0x1f')];if(_0x4bea20[_0xfd4d('0x1f')]==_0xfd4d('0x20')){dials[_0x4bea20['uniqueid']]=_['assign'](dials[_0x4bea20[_0xfd4d('0x3')]],_0x4bea20);dials[_0x4bea20['uniqueid']][_0xfd4d('0x21')]=utils[_0xfd4d('0x1b')]();dials[_0x4bea20['uniqueid']][_0xfd4d('0x1c')]=_0xfd4d('0x22');}}}catch(_0x27e59a){utils[_0xfd4d('0x12')](_0x27e59a['stack']);}};exports[_0xfd4d('0x23')]=function(_0x161748){try{if(!_[_0xfd4d('0x15')](dials[_0x161748['uniqueid']])){dials[_0x161748[_0xfd4d('0x3')]]=_[_0xfd4d('0x19')](dials[_0x161748[_0xfd4d('0x3')]],{'endtime':utils[_0xfd4d('0x1b')](),'lastevent':'complete'});dials[_0x161748[_0xfd4d('0x3')]]['duration']=utils[_0xfd4d('0x24')](dials[_0x161748[_0xfd4d('0x3')]]['endtime'],dials[_0x161748[_0xfd4d('0x3')]][_0xfd4d('0x1a')]);dials[_0x161748['uniqueid']][_0xfd4d('0x25')]=utils[_0xfd4d('0x24')](dials[_0x161748[_0xfd4d('0x3')]][_0xfd4d('0x21')]||dials[_0x161748[_0xfd4d('0x3')]][_0xfd4d('0x26')],dials[_0x161748[_0xfd4d('0x3')]][_0xfd4d('0x1a')]);dials[_0x161748['uniqueid']][_0xfd4d('0x27')]=dials[_0x161748[_0xfd4d('0x3')]][_0xfd4d('0x21')]?utils['diffTime'](dials[_0x161748['uniqueid']][_0xfd4d('0x26')],dials[_0x161748[_0xfd4d('0x3')]][_0xfd4d('0x21')]):0x0;writeDB(dials[_0x161748[_0xfd4d('0x3')]]);}}catch(_0x4ba99d){utils[_0xfd4d('0x12')](_0x4ba99d[_0xfd4d('0x13')]);}}; \ No newline at end of file +var _0x4cda=['varset','isNil','variable','outboundrouteid','value','dialbegin','assign','now','lastevent','error','dialstatus','ANSWER','answertime','connect','hangup','complete','duration','diffTime','endtime','starttime','holdtime','billableseconds','lodash','util','./utils','info','format','uniqueid','dialstring','calleridnum','connectedlinenum','request','CreateVoiceDialReport','newexten','application','set','startsWith','toLowerCase','appdata','split','stack'];(function(_0x298aad,_0x28f384){var _0x1297b5=function(_0x22370d){while(--_0x22370d){_0x298aad['push'](_0x298aad['shift']());}};_0x1297b5(++_0x28f384);}(_0x4cda,0x1d9));var _0xa4cd=function(_0x301dab,_0x38050a){_0x301dab=_0x301dab-0x0;var _0x2500a2=_0x4cda[_0x301dab];return _0x2500a2;};'use strict';var _=require(_0xa4cd('0x0'));var util=require(_0xa4cd('0x1'));var utils=require(_0xa4cd('0x2'));var dials={};function writeDB(_0x3b5e03){utils[_0xa4cd('0x3')](util[_0xa4cd('0x4')]('DIAL|%s|%s|%s|%s|%s|%s',_0x3b5e03[_0xa4cd('0x5')],_0x3b5e03['channel'],_0x3b5e03[_0xa4cd('0x6')],_0x3b5e03[_0xa4cd('0x7')],_0x3b5e03[_0xa4cd('0x8')],_0x3b5e03['dialstatus']));utils[_0xa4cd('0x9')](_0xa4cd('0xa'),_0x3b5e03);delete dials[_0x3b5e03[_0xa4cd('0x5')]];}exports[_0xa4cd('0xb')]=function(_0x10d077){try{if(_0x10d077[_0xa4cd('0xc')]['toLowerCase']()==_0xa4cd('0xd')&&_[_0xa4cd('0xe')](_0x10d077['appdata'][_0xa4cd('0xf')](),'cdr(routeid)')){var _0x43a462=_0x10d077[_0xa4cd('0x10')][_0xa4cd('0x11')]('=');dials[_0x10d077[_0xa4cd('0x5')]]={'routeId':_0x43a462[0x1]};}}catch(_0x46660a){utils['error'](_0x46660a[_0xa4cd('0x12')]);}};exports[_0xa4cd('0x13')]=function(_0x3b74f4){try{if(!_[_0xa4cd('0x14')](_0x3b74f4[_0xa4cd('0x15')][_0xa4cd('0x16')])){dials[_0x3b74f4[_0xa4cd('0x5')]]={'routeId':_0x3b74f4[_0xa4cd('0x17')]};}}catch(_0x2437a0){utils['error'](_0x2437a0['stack']);}};exports[_0xa4cd('0x18')]=function(_0x194368){try{if(!_['isNil'](dials[_0x194368[_0xa4cd('0x5')]])){dials[_0x194368['uniqueid']]=_[_0xa4cd('0x19')](dials[_0x194368[_0xa4cd('0x5')]],_0x194368);dials[_0x194368[_0xa4cd('0x5')]]['starttime']=utils[_0xa4cd('0x1a')]();dials[_0x194368[_0xa4cd('0x5')]][_0xa4cd('0x1b')]='called';}}catch(_0x1e42fc){utils[_0xa4cd('0x1c')](_0x1e42fc[_0xa4cd('0x12')]);}};exports['dialend']=function(_0x32a8b3){try{if(!_[_0xa4cd('0x14')](dials[_0x32a8b3[_0xa4cd('0x5')]])){dials[_0x32a8b3[_0xa4cd('0x5')]][_0xa4cd('0x1d')]=_0x32a8b3['dialstatus'];if(_0x32a8b3['dialstatus']==_0xa4cd('0x1e')){dials[_0x32a8b3[_0xa4cd('0x5')]]=_[_0xa4cd('0x19')](dials[_0x32a8b3['uniqueid']],_0x32a8b3);dials[_0x32a8b3[_0xa4cd('0x5')]][_0xa4cd('0x1f')]=utils[_0xa4cd('0x1a')]();dials[_0x32a8b3[_0xa4cd('0x5')]]['lastevent']=_0xa4cd('0x20');}}}catch(_0x3148fb){utils[_0xa4cd('0x1c')](_0x3148fb['stack']);}};exports[_0xa4cd('0x21')]=function(_0x4afdca){try{if(!_[_0xa4cd('0x14')](dials[_0x4afdca['uniqueid']])){dials[_0x4afdca[_0xa4cd('0x5')]]=_[_0xa4cd('0x19')](dials[_0x4afdca[_0xa4cd('0x5')]],{'endtime':utils[_0xa4cd('0x1a')](),'lastevent':_0xa4cd('0x22')});dials[_0x4afdca[_0xa4cd('0x5')]][_0xa4cd('0x23')]=utils[_0xa4cd('0x24')](dials[_0x4afdca[_0xa4cd('0x5')]][_0xa4cd('0x25')],dials[_0x4afdca[_0xa4cd('0x5')]][_0xa4cd('0x26')]);dials[_0x4afdca[_0xa4cd('0x5')]][_0xa4cd('0x27')]=utils[_0xa4cd('0x24')](dials[_0x4afdca['uniqueid']]['answertime']||dials[_0x4afdca[_0xa4cd('0x5')]]['endtime'],dials[_0x4afdca[_0xa4cd('0x5')]][_0xa4cd('0x26')]);dials[_0x4afdca[_0xa4cd('0x5')]][_0xa4cd('0x28')]=dials[_0x4afdca[_0xa4cd('0x5')]][_0xa4cd('0x1f')]?utils[_0xa4cd('0x24')](dials[_0x4afdca[_0xa4cd('0x5')]][_0xa4cd('0x25')],dials[_0x4afdca[_0xa4cd('0x5')]]['answertime']):0x0;writeDB(dials[_0x4afdca[_0xa4cd('0x5')]]);}}catch(_0x4739a4){utils['error'](_0x4739a4[_0xa4cd('0x12')]);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 8d39314..ec8fdc6 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 _0xb000=['error','close','managerevent','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','asterisk-manager','../../config/environment','./utils','port','asterisk','username','password','keepConnected','xdr','info','./agents.controller','./queues.controller','./recordings.controller','./members.controller','connect','shutdown','fullybooted'];(function(_0x53373a,_0x5ee7e4){var _0x40baec=function(_0xd1e2d){while(--_0xd1e2d){_0x53373a['push'](_0x53373a['shift']());}};_0x40baec(++_0x5ee7e4);}(_0xb000,0x8b));var _0x0b00=function(_0x264545,_0x214037){_0x264545=_0x264545-0x0;var _0x114d10=_0xb000[_0x264545];return _0x114d10;};var AsteriskManager=require(_0x0b00('0x0'));var config=require(_0x0b00('0x1'));var utils=require(_0x0b00('0x2'));var ami=new AsteriskManager(config['asterisk'][_0x0b00('0x3')],config[_0x0b00('0x4')]['ip'],config['asterisk'][_0x0b00('0x5')],config[_0x0b00('0x4')][_0x0b00('0x6')],!![]);ami[_0x0b00('0x7')]();if(config[_0x0b00('0x8')]&&config['xdr']['disabled']){utils[_0x0b00('0x9')]('XDR\x20DISABLED');}else{var agents=require(_0x0b00('0xa'));var calls=require('./calls.controller');var queues=require(_0x0b00('0xb'));var recordings=require(_0x0b00('0xc'));var members=require(_0x0b00('0xd'));var dials=require('./dials.controller');var transfers=require('./transfers.controller');var core=require('./core.controller');ami['on'](_0x0b00('0xe'),core[_0x0b00('0xe')]);ami['on']('shutdown',core[_0x0b00('0xf')]);ami['on'](_0x0b00('0x10'),core['fullybooted']);ami['on'](_0x0b00('0x11'),core[_0x0b00('0x11')]);ami['on']('close',core[_0x0b00('0x12')]);ami['on']('managerevent',core[_0x0b00('0x13')]);ami['on']('devicestatechange',function(_0x1d73c3){try{members['devicestatechange'](_0x1d73c3);}catch(_0x289044){utils[_0x0b00('0x11')](_0x289044);}});ami['on'](_0x0b00('0x14'),function(_0xa242b5){try{agents['agentcalled'](_0xa242b5);}catch(_0x2261e3){utils[_0x0b00('0x11')](_0x2261e3);}});ami['on']('agentringnoanswer',function(_0x148fe2){try{agents[_0x0b00('0x15')](_0x148fe2);}catch(_0x284583){utils['error'](_0x284583);}});ami['on']('agentconnect',function(_0x22d0df){try{agents[_0x0b00('0x16')](_0x22d0df);queues[_0x0b00('0x16')](_0x22d0df);}catch(_0x2c73b2){utils['error'](_0x2c73b2);}});ami['on'](_0x0b00('0x17'),function(_0x3ecbde){try{agents[_0x0b00('0x17')](_0x3ecbde);queues['agentcomplete'](_0x3ecbde);members[_0x0b00('0x17')](_0x3ecbde);}catch(_0x234a2f){utils[_0x0b00('0x11')](_0x234a2f);}});ami['on']('queuecallerabandon',function(_0x3cc644){try{agents[_0x0b00('0x18')](_0x3cc644);queues['queuecallerabandon'](_0x3cc644);}catch(_0x34c4ca){utils['error'](_0x34c4ca);}});ami['on']('queuecallerjoin',function(_0x2df248){try{queues[_0x0b00('0x19')](_0x2df248);recordings[_0x0b00('0x19')](_0x2df248);}catch(_0x12da4a){utils[_0x0b00('0x11')](_0x12da4a);}});ami['on'](_0x0b00('0x1a'),function(_0x1a1c72){try{queues[_0x0b00('0x1a')](_0x1a1c72);}catch(_0x4eb2da){utils['error'](_0x4eb2da);}});ami['on'](_0x0b00('0x1b'),function(_0x1e4763){try{queues['musiconholdstart'](_0x1e4763);calls[_0x0b00('0x1b')](_0x1e4763);}catch(_0x1b2d3c){utils[_0x0b00('0x11')](_0x1b2d3c);}});ami['on'](_0x0b00('0x1c'),function(_0x1c7960){try{queues[_0x0b00('0x1c')](_0x1c7960);calls[_0x0b00('0x1c')](_0x1c7960);}catch(_0x150e4a){utils[_0x0b00('0x11')](_0x150e4a);}});ami['on'](_0x0b00('0x1d'),function(_0x2bd12e){try{calls[_0x0b00('0x1d')](_0x2bd12e);recordings[_0x0b00('0x1d')](_0x2bd12e);}catch(_0x1b2486){utils['error'](_0x1b2486);}});ami['on'](_0x0b00('0x1e'),function(_0x167f2f){try{calls[_0x0b00('0x1e')](_0x167f2f);recordings[_0x0b00('0x1e')](_0x167f2f);dials[_0x0b00('0x1e')](_0x167f2f);agents[_0x0b00('0x1e')](_0x167f2f);queues[_0x0b00('0x1e')](_0x167f2f);}catch(_0x2b91c3){utils[_0x0b00('0x11')](_0x2b91c3);}});ami['on'](_0x0b00('0x1f'),function(_0x25fe73){try{members[_0x0b00('0x1f')](_0x25fe73);}catch(_0x27d1f2){utils['error'](_0x27d1f2);}});ami['on'](_0x0b00('0x20'),function(_0xc81616){try{queues[_0x0b00('0x20')](_0xc81616);agents['blindtransfer'](_0xc81616);transfers[_0x0b00('0x20')](_0xc81616);}catch(_0x12a4f9){utils[_0x0b00('0x11')](_0x12a4f9);}});ami['on'](_0x0b00('0x21'),function(_0xa986c4){try{queues[_0x0b00('0x21')](_0xa986c4);transfers[_0x0b00('0x21')](_0xa986c4);agents[_0x0b00('0x21')](_0xa986c4);calls[_0x0b00('0x21')](_0xa986c4);}catch(_0xcef53){utils[_0x0b00('0x11')](_0xcef53);}});ami['on'](_0x0b00('0x22'),function(_0x53f680){try{queues['varset'](_0x53f680);recordings[_0x0b00('0x22')](_0x53f680);calls[_0x0b00('0x22')](_0x53f680);dials[_0x0b00('0x22')](_0x53f680);}catch(_0x16549c){utils['error'](_0x16549c);}});ami['on'](_0x0b00('0x23'),function(_0x52d1fd){try{calls[_0x0b00('0x23')](_0x52d1fd);recordings['newexten'](_0x52d1fd);dials[_0x0b00('0x23')](_0x52d1fd);}catch(_0x12b630){utils[_0x0b00('0x11')](_0x12b630);}});ami['on'](_0x0b00('0x24'),function(_0x164e7e){try{calls[_0x0b00('0x24')](_0x164e7e);recordings['newchannel'](_0x164e7e);}catch(_0x5dd7de){utils[_0x0b00('0x11')](_0x5dd7de);}});ami['on'](_0x0b00('0x25'),function(_0x29372b){try{dials['dialbegin'](_0x29372b);}catch(_0x43e6e3){utils[_0x0b00('0x11')](_0x43e6e3);}});ami['on'](_0x0b00('0x26'),function(_0x285f98){try{dials[_0x0b00('0x26')](_0x285f98);}catch(_0x5aaea5){utils['error'](_0x5aaea5);}});} \ No newline at end of file +var _0x43ae=['managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newchannel','dialbegin','dialend','asterisk-manager','../../config/environment','asterisk','port','username','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','fullybooted','error','close'];(function(_0x51aeae,_0x5f135d){var _0x857c95=function(_0x4ebf75){while(--_0x4ebf75){_0x51aeae['push'](_0x51aeae['shift']());}};_0x857c95(++_0x5f135d);}(_0x43ae,0x199));var _0xe43a=function(_0x565018,_0x5f1e90){_0x565018=_0x565018-0x0;var _0x53715c=_0x43ae[_0x565018];return _0x53715c;};var AsteriskManager=require(_0xe43a('0x0'));var config=require(_0xe43a('0x1'));var utils=require('./utils');var ami=new AsteriskManager(config[_0xe43a('0x2')][_0xe43a('0x3')],config['asterisk']['ip'],config[_0xe43a('0x2')][_0xe43a('0x4')],config[_0xe43a('0x2')]['password'],!![]);ami[_0xe43a('0x5')]();if(config[_0xe43a('0x6')]&&config[_0xe43a('0x6')][_0xe43a('0x7')]){utils[_0xe43a('0x8')](_0xe43a('0x9'));}else{var agents=require(_0xe43a('0xa'));var calls=require('./calls.controller');var queues=require('./queues.controller');var recordings=require(_0xe43a('0xb'));var members=require(_0xe43a('0xc'));var dials=require(_0xe43a('0xd'));var transfers=require(_0xe43a('0xe'));var core=require(_0xe43a('0xf'));ami['on']('connect',core[_0xe43a('0x10')]);ami['on']('shutdown',core['shutdown']);ami['on'](_0xe43a('0x11'),core[_0xe43a('0x11')]);ami['on']('error',core[_0xe43a('0x12')]);ami['on'](_0xe43a('0x13'),core[_0xe43a('0x13')]);ami['on'](_0xe43a('0x14'),core['managerevent']);ami['on']('devicestatechange',function(_0x50cda5){try{members[_0xe43a('0x15')](_0x50cda5);}catch(_0x1d4a23){utils['error'](_0x1d4a23);}});ami['on'](_0xe43a('0x16'),function(_0x4da2b0){try{agents[_0xe43a('0x16')](_0x4da2b0);}catch(_0x49b4cd){utils['error'](_0x49b4cd);}});ami['on'](_0xe43a('0x17'),function(_0x4dd9ea){try{agents[_0xe43a('0x17')](_0x4dd9ea);}catch(_0x129e66){utils[_0xe43a('0x12')](_0x129e66);}});ami['on'](_0xe43a('0x18'),function(_0x35afe6){try{agents[_0xe43a('0x18')](_0x35afe6);queues[_0xe43a('0x18')](_0x35afe6);}catch(_0xddec2){utils[_0xe43a('0x12')](_0xddec2);}});ami['on'](_0xe43a('0x19'),function(_0x42265f){try{agents['agentcomplete'](_0x42265f);queues[_0xe43a('0x19')](_0x42265f);members[_0xe43a('0x19')](_0x42265f);}catch(_0xab3208){utils['error'](_0xab3208);}});ami['on']('queuecallerabandon',function(_0x379ad1){try{agents['queuecallerabandon'](_0x379ad1);queues['queuecallerabandon'](_0x379ad1);}catch(_0xb78f1e){utils['error'](_0xb78f1e);}});ami['on'](_0xe43a('0x1a'),function(_0x43dde1){try{queues['queuecallerjoin'](_0x43dde1);recordings[_0xe43a('0x1a')](_0x43dde1);}catch(_0x230c65){utils[_0xe43a('0x12')](_0x230c65);}});ami['on'](_0xe43a('0x1b'),function(_0x2f5ec3){try{queues[_0xe43a('0x1b')](_0x2f5ec3);}catch(_0x287d8f){utils[_0xe43a('0x12')](_0x287d8f);}});ami['on'](_0xe43a('0x1c'),function(_0x2aff59){try{queues[_0xe43a('0x1c')](_0x2aff59);calls['musiconholdstart'](_0x2aff59);}catch(_0x568f50){utils[_0xe43a('0x12')](_0x568f50);}});ami['on'](_0xe43a('0x1d'),function(_0x7838a9){try{queues[_0xe43a('0x1d')](_0x7838a9);calls['musiconholdstop'](_0x7838a9);}catch(_0xc03771){utils[_0xe43a('0x12')](_0xc03771);}});ami['on']('newstate',function(_0x5dfb6b){try{calls[_0xe43a('0x1e')](_0x5dfb6b);recordings[_0xe43a('0x1e')](_0x5dfb6b);}catch(_0x5e332a){utils[_0xe43a('0x12')](_0x5e332a);}});ami['on'](_0xe43a('0x1f'),function(_0x127f1b){try{calls['hangup'](_0x127f1b);recordings[_0xe43a('0x1f')](_0x127f1b);dials[_0xe43a('0x1f')](_0x127f1b);agents[_0xe43a('0x1f')](_0x127f1b);queues[_0xe43a('0x1f')](_0x127f1b);}catch(_0x377840){utils[_0xe43a('0x12')](_0x377840);}});ami['on'](_0xe43a('0x20'),function(_0x560e65){try{members['cdr'](_0x560e65);}catch(_0x4537fa){utils[_0xe43a('0x12')](_0x4537fa);}});ami['on'](_0xe43a('0x21'),function(_0x74d374){try{queues['blindtransfer'](_0x74d374);agents[_0xe43a('0x21')](_0x74d374);transfers['blindtransfer'](_0x74d374);}catch(_0x56450a){utils[_0xe43a('0x12')](_0x56450a);}});ami['on']('attendedtransfer',function(_0x39afa8){try{queues[_0xe43a('0x22')](_0x39afa8);transfers[_0xe43a('0x22')](_0x39afa8);agents[_0xe43a('0x22')](_0x39afa8);calls[_0xe43a('0x22')](_0x39afa8);}catch(_0x1d44f8){utils[_0xe43a('0x12')](_0x1d44f8);}});ami['on'](_0xe43a('0x23'),function(_0x1d5d56){try{queues[_0xe43a('0x23')](_0x1d5d56);recordings[_0xe43a('0x23')](_0x1d5d56);calls[_0xe43a('0x23')](_0x1d5d56);dials['varset'](_0x1d5d56);}catch(_0x257dcc){utils['error'](_0x257dcc);}});ami['on']('newexten',function(_0x45af3a){try{calls['newexten'](_0x45af3a);recordings['newexten'](_0x45af3a);dials['newexten'](_0x45af3a);}catch(_0x832449){utils['error'](_0x832449);}});ami['on'](_0xe43a('0x24'),function(_0x4718ca){try{calls[_0xe43a('0x24')](_0x4718ca);recordings[_0xe43a('0x24')](_0x4718ca);}catch(_0x2f97f2){utils['error'](_0x2f97f2);}});ami['on'](_0xe43a('0x25'),function(_0x41eaaf){try{dials[_0xe43a('0x25')](_0x41eaaf);}catch(_0x4d8e0f){utils[_0xe43a('0x12')](_0x4d8e0f);}});ami['on'](_0xe43a('0x26'),function(_0x518034){try{dials['dialend'](_0x518034);}catch(_0xd484fc){utils[_0xe43a('0x12')](_0xd484fc);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 8fff0e5..e7ea986 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 _0x049f=['format','MEMBER|%s|%s|%s|%s|%s|%s','uniqueid','data2','membername','type','interface','then','internal','request','CreateMemberReport','getUserByName','split','name','catch','startsWith','devicestatechange','INUSE','BUSY','TALKING','now','agent','NOT_INUSE','device','exitAt','enterAt','agentcomplete','assign','queue','cdr','channel','source','data3','destination','isNil','data1','lodash','./utils','Local/_attended@transfer','info'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x049f,0x164));var _0xf049=function(_0xef4cf0,_0x16c9c3){_0xef4cf0=_0xef4cf0-0x0;var _0x497ad2=_0x049f[_0xef4cf0];return _0x497ad2;};'use strict';var _=require(_0xf049('0x0'));var util=require('util');var utils=require(_0xf049('0x1'));var members={};var exclude=[_0xf049('0x2'),'Queue:'];function writeDB(_0x59d86c){utils[_0xf049('0x3')](util[_0xf049('0x4')](_0xf049('0x5'),_0x59d86c[_0xf049('0x6')],_0x59d86c['interface'],_0x59d86c['channel'],_0x59d86c[_0xf049('0x7')],_0x59d86c[_0xf049('0x8')],_0x59d86c[_0xf049('0x9')]));if(_0x59d86c['interface']){utils['getUserByInterface'](_0x59d86c[_0xf049('0xa')])[_0xf049('0xb')](function(_0x144331){if(_0x144331){_0x59d86c[_0xf049('0x8')]=_0x144331['name'];_0x59d86c['internal']=_0x144331[_0xf049('0xc')];utils[_0xf049('0xd')](_0xf049('0xe'),_0x59d86c);}else{utils[_0xf049('0xf')](_0x59d86c['interface'][_0xf049('0x10')]('/')[0x1])[_0xf049('0xb')](function(_0x46fc2d){if(_0x46fc2d){_0x59d86c['membername']=_0x46fc2d[_0xf049('0x11')];_0x59d86c[_0xf049('0xc')]=_0x46fc2d[_0xf049('0xc')];utils['request'](_0xf049('0xe'),_0x59d86c);}});}})[_0xf049('0x12')](function(_0x8e8561){utils['error'](_0x8e8561);});}delete members[_0x59d86c[_0xf049('0xa')]];}function startsWith(_0x3d9ae2,_0x357a7d){return _['some'](_0x3d9ae2,function(_0x492b48){return _[_0xf049('0x13')](_0x357a7d,_0x492b48);});}exports[_0xf049('0x14')]=function(_0x466b04){switch(_0x466b04['state']){case _0xf049('0x15'):case _0xf049('0x16'):if(!startsWith(exclude,_0x466b04['device'])){members[_0x466b04['device']]={'channel':'voice','interface':_0x466b04['device'],'type':_0xf049('0x17'),'enterAt':utils[_0xf049('0x18')](),'role':_0xf049('0x19')};}break;case _0xf049('0x1a'):if(!_['isNil'](members[_0x466b04[_0xf049('0x1b')]])){members[_0x466b04[_0xf049('0x1b')]][_0xf049('0x1c')]=utils[_0xf049('0x18')]();members[_0x466b04['device']]['duration']=utils['diffTime'](members[_0x466b04[_0xf049('0x1b')]][_0xf049('0x1c')],members[_0x466b04[_0xf049('0x1b')]][_0xf049('0x1d')]);if(members[_0x466b04['device']][_0xf049('0x6')]){writeDB(members[_0x466b04[_0xf049('0x1b')]]);}}default:break;}};exports[_0xf049('0x1e')]=function(_0x3181b7){if(!_['isNil'](members[_0x3181b7[_0xf049('0xa')]])){members[_0x3181b7[_0xf049('0xa')]]=_[_0xf049('0x1f')](members[_0x3181b7['interface']],{'data4':_0x3181b7[_0xf049('0x20')],'uniqueid':_0x3181b7['uniqueid']});}};exports[_0xf049('0x21')]=function(_0x43624b){if(_0x43624b[_0xf049('0x22')]){var _0x1d2ce7=_0x43624b[_0xf049('0x22')][_0xf049('0x10')]('-')[0x0];if(!_['isNil'](members[_0x1d2ce7])){members[_0x1d2ce7]=_['assign'](members[_0x1d2ce7],{'data1':members[_0x1d2ce7]['data1']||_0x43624b[_0xf049('0x9')],'data2':members[_0x1d2ce7]['data2']||_0x43624b[_0xf049('0x23')],'data3':members[_0x1d2ce7][_0xf049('0x24')]||_0x43624b[_0xf049('0x25')],'uniqueid':members[_0x1d2ce7][_0xf049('0x6')]||_0x43624b[_0xf049('0x6')]});if(members[_0x1d2ce7]['exitAt']){writeDB(members[_0x1d2ce7]);}}}if(_0x43624b['destinationchannel']){var _0x31d774=_0x43624b['destinationchannel'][_0xf049('0x10')]('-')[0x0];if(!_[_0xf049('0x26')](members[_0x31d774])){members[_0x31d774]=_[_0xf049('0x1f')](members[_0x31d774],{'data1':members[_0x31d774][_0xf049('0x27')]||_0x43624b[_0xf049('0x9')],'data2':members[_0x31d774][_0xf049('0x7')]||_0x43624b[_0xf049('0x23')],'data3':members[_0x31d774][_0xf049('0x24')]||_0x43624b['destination'],'uniqueid':members[_0x31d774][_0xf049('0x6')]||_0x43624b[_0xf049('0x6')]});if(members[_0x31d774][_0xf049('0x1c')]){writeDB(members[_0x31d774]);}}}}; \ No newline at end of file +var _0xafc4=['split','startsWith','devicestatechange','BUSY','device','voice','now','agent','NOT_INUSE','isNil','exitAt','duration','enterAt','agentcomplete','assign','queue','data1','source','data3','destination','destinationchannel','lodash','util','./utils','Local/_attended@transfer','info','format','MEMBER|%s|%s|%s|%s|%s|%s','uniqueid','channel','data2','membername','type','interface','then','name','internal','request','getUserByName'];(function(_0x501b70,_0x24ddba){var _0x1f61ae=function(_0x1593a4){while(--_0x1593a4){_0x501b70['push'](_0x501b70['shift']());}};_0x1f61ae(++_0x24ddba);}(_0xafc4,0x1e9));var _0x4afc=function(_0x296b4d,_0x6c48ae){_0x296b4d=_0x296b4d-0x0;var _0x1085b9=_0xafc4[_0x296b4d];return _0x1085b9;};'use strict';var _=require(_0x4afc('0x0'));var util=require(_0x4afc('0x1'));var utils=require(_0x4afc('0x2'));var members={};var exclude=[_0x4afc('0x3'),'Queue:'];function writeDB(_0x4c56c4){utils[_0x4afc('0x4')](util[_0x4afc('0x5')](_0x4afc('0x6'),_0x4c56c4[_0x4afc('0x7')],_0x4c56c4['interface'],_0x4c56c4[_0x4afc('0x8')],_0x4c56c4[_0x4afc('0x9')],_0x4c56c4[_0x4afc('0xa')],_0x4c56c4[_0x4afc('0xb')]));if(_0x4c56c4[_0x4afc('0xc')]){utils['getUserByInterface'](_0x4c56c4['interface'])[_0x4afc('0xd')](function(_0x46bf54){if(_0x46bf54){_0x4c56c4['membername']=_0x46bf54[_0x4afc('0xe')];_0x4c56c4[_0x4afc('0xf')]=_0x46bf54[_0x4afc('0xf')];utils[_0x4afc('0x10')]('CreateMemberReport',_0x4c56c4);}else{utils[_0x4afc('0x11')](_0x4c56c4[_0x4afc('0xc')][_0x4afc('0x12')]('/')[0x1])[_0x4afc('0xd')](function(_0x3a28a9){if(_0x3a28a9){_0x4c56c4[_0x4afc('0xa')]=_0x3a28a9[_0x4afc('0xe')];_0x4c56c4[_0x4afc('0xf')]=_0x3a28a9[_0x4afc('0xf')];utils[_0x4afc('0x10')]('CreateMemberReport',_0x4c56c4);}});}})['catch'](function(_0x27150f){utils['error'](_0x27150f);});}delete members[_0x4c56c4[_0x4afc('0xc')]];}function startsWith(_0x35895f,_0x358a7b){return _['some'](_0x35895f,function(_0x12f758){return _[_0x4afc('0x13')](_0x358a7b,_0x12f758);});}exports[_0x4afc('0x14')]=function(_0x5eb8ea){switch(_0x5eb8ea['state']){case'INUSE':case _0x4afc('0x15'):if(!startsWith(exclude,_0x5eb8ea[_0x4afc('0x16')])){members[_0x5eb8ea[_0x4afc('0x16')]]={'channel':_0x4afc('0x17'),'interface':_0x5eb8ea[_0x4afc('0x16')],'type':'TALKING','enterAt':utils[_0x4afc('0x18')](),'role':_0x4afc('0x19')};}break;case _0x4afc('0x1a'):if(!_[_0x4afc('0x1b')](members[_0x5eb8ea[_0x4afc('0x16')]])){members[_0x5eb8ea['device']][_0x4afc('0x1c')]=utils[_0x4afc('0x18')]();members[_0x5eb8ea['device']][_0x4afc('0x1d')]=utils['diffTime'](members[_0x5eb8ea[_0x4afc('0x16')]][_0x4afc('0x1c')],members[_0x5eb8ea['device']][_0x4afc('0x1e')]);if(members[_0x5eb8ea[_0x4afc('0x16')]][_0x4afc('0x7')]){writeDB(members[_0x5eb8ea['device']]);}}default:break;}};exports[_0x4afc('0x1f')]=function(_0x7ba531){if(!_[_0x4afc('0x1b')](members[_0x7ba531[_0x4afc('0xc')]])){members[_0x7ba531[_0x4afc('0xc')]]=_[_0x4afc('0x20')](members[_0x7ba531[_0x4afc('0xc')]],{'data4':_0x7ba531[_0x4afc('0x21')],'uniqueid':_0x7ba531['uniqueid']});}};exports['cdr']=function(_0x482bd4){if(_0x482bd4[_0x4afc('0x8')]){var _0x3c0715=_0x482bd4[_0x4afc('0x8')][_0x4afc('0x12')]('-')[0x0];if(!_[_0x4afc('0x1b')](members[_0x3c0715])){members[_0x3c0715]=_[_0x4afc('0x20')](members[_0x3c0715],{'data1':members[_0x3c0715][_0x4afc('0x22')]||_0x482bd4[_0x4afc('0xb')],'data2':members[_0x3c0715]['data2']||_0x482bd4[_0x4afc('0x23')],'data3':members[_0x3c0715][_0x4afc('0x24')]||_0x482bd4[_0x4afc('0x25')],'uniqueid':members[_0x3c0715][_0x4afc('0x7')]||_0x482bd4[_0x4afc('0x7')]});if(members[_0x3c0715][_0x4afc('0x1c')]){writeDB(members[_0x3c0715]);}}}if(_0x482bd4['destinationchannel']){var _0x4b165b=_0x482bd4[_0x4afc('0x26')][_0x4afc('0x12')]('-')[0x0];if(!_[_0x4afc('0x1b')](members[_0x4b165b])){members[_0x4b165b]=_[_0x4afc('0x20')](members[_0x4b165b],{'data1':members[_0x4b165b][_0x4afc('0x22')]||_0x482bd4[_0x4afc('0xb')],'data2':members[_0x4b165b][_0x4afc('0x9')]||_0x482bd4[_0x4afc('0x23')],'data3':members[_0x4b165b]['data3']||_0x482bd4[_0x4afc('0x25')],'uniqueid':members[_0x4b165b]['uniqueid']||_0x482bd4['uniqueid']});if(members[_0x4b165b]['exitAt']){writeDB(members[_0x4b165b]);}}}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index efcdab1..e130aa8 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 _0x8874=['secondtransfererlinkedid','origtransfererlinkedid','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','ATTENDED','secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid','musiconholdstart','musiconholdstartAt','diffTime','lodash','util','./utils','info','format','QUEUE|%s|%s|%s|%s|%s|%s|%s','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','queuecallerjoin','assign','position','now','hangup','uniqueid','queuecallerleaveAt','queuecallerexit','queuecallercomplete','queuecallercompleteAt','transfereduniqueid','queuecallerenterreason','isNil','variable','queuestatus','queuecallerabandon','queuecallerabandonAt','value','toUpperCase','queueposition','queuecallerexitAt','queuecallerleave','holdtime','queuecallerjoinAt','connectedlinenum','connectedlinename','destaccountcode','membername','agentcomplete','assigned','reason','transfer','TRANSFER','COMPLETEDBY','transfereeuniqueid','transfertype','transferexten','extension','transferuniqueid','origtransfereruniqueid'];(function(_0x2bcb3a,_0x533554){var _0x51688a=function(_0x438bd9){while(--_0x438bd9){_0x2bcb3a['push'](_0x2bcb3a['shift']());}};_0x51688a(++_0x533554);}(_0x8874,0xe3));var _0x4887=function(_0x4bc25f,_0x17eee9){_0x4bc25f=_0x4bc25f-0x0;var _0x3e3367=_0x8874[_0x4bc25f];return _0x3e3367;};'use strict';var _=require(_0x4887('0x0'));var util=require(_0x4887('0x1'));var utils=require(_0x4887('0x2'));var queues={};function writeDB(_0x20e2c0){utils[_0x4887('0x3')](util[_0x4887('0x4')](_0x4887('0x5'),_0x20e2c0['uniqueid'],_0x20e2c0[_0x4887('0x6')],_0x20e2c0[_0x4887('0x7')],_0x20e2c0[_0x4887('0x8')],_0x20e2c0[_0x4887('0x9')],_0x20e2c0[_0x4887('0xa')],_0x20e2c0[_0x4887('0xb')]));if(_0x20e2c0[_0x4887('0x7')]){utils[_0x4887('0xc')](_0x20e2c0[_0x4887('0x7')])[_0x4887('0xd')](function(_0x40c02d){if(_0x40c02d){_0x20e2c0[_0x4887('0xe')]=_0x40c02d[_0x4887('0xe')];}utils[_0x4887('0xf')](_0x4887('0x10'),_0x20e2c0);});}else{utils[_0x4887('0xf')](_0x4887('0x10'),_0x20e2c0);}if(_0x20e2c0['transfereduniqueid']){delete queues[_0x20e2c0['transfereduniqueid']];}else{delete queues[_0x20e2c0['uniqueid']];}}exports[_0x4887('0x11')]=function(_0x4472c3){queues[_0x4472c3['uniqueid']]=_[_0x4887('0x12')](_0x4472c3,{'originalposition':_0x4472c3[_0x4887('0x13')],'queuecallerjoinAt':utils[_0x4887('0x14')](),'mohtime':0x0});};exports[_0x4887('0x15')]=function(_0x5f3c20){if(!_['isNil'](queues[_0x5f3c20[_0x4887('0x16')]])){if(queues[_0x5f3c20[_0x4887('0x16')]][_0x4887('0x17')]){if(!queues[_0x5f3c20[_0x4887('0x16')]]['queuecallerabandon']&&!queues[_0x5f3c20['uniqueid']][_0x4887('0x18')]){queues[_0x5f3c20[_0x4887('0x16')]][_0x4887('0x19')]=!![];queues[_0x5f3c20[_0x4887('0x16')]][_0x4887('0x1a')]=utils['now']();queues[_0x5f3c20[_0x4887('0x16')]]['queuecallerexitreason']='COMPLETEDBYAGENT';}writeDB(queues[_0x5f3c20[_0x4887('0x16')]]);}else{if(queues[_0x5f3c20[_0x4887('0x16')]][_0x4887('0x1b')]){queues[queues[_0x5f3c20[_0x4887('0x16')]][_0x4887('0x1b')]]=queues[_0x5f3c20[_0x4887('0x16')]];queues[queues[_0x5f3c20[_0x4887('0x16')]][_0x4887('0x1b')]][_0x4887('0x1c')]=0x2;delete queues[_0x5f3c20['uniqueid']];}}}};exports['varset']=function(_0x2ff209){if(!_[_0x4887('0x1d')](_0x2ff209[_0x4887('0x1e')][_0x4887('0x1f')])){if(!_[_0x4887('0x1d')](queues[_0x2ff209['uniqueid']])){queues[_0x2ff209[_0x4887('0x16')]][_0x4887('0x20')]=![];queues[_0x2ff209[_0x4887('0x16')]][_0x4887('0x21')]=null;queues[_0x2ff209[_0x4887('0x16')]][_0x4887('0x18')]=!![];queues[_0x2ff209[_0x4887('0x16')]]['queuecallerexitAt']=utils['now']();queues[_0x2ff209[_0x4887('0x16')]]['queuecallerexitreason']=_0x2ff209[_0x4887('0x22')][_0x4887('0x23')]();writeDB(queues[_0x2ff209[_0x4887('0x16')]]);}}else if(!_['isNil'](_0x2ff209['variable'][_0x4887('0x24')])){if(!_['isNil'](queues[_0x2ff209[_0x4887('0x16')]])&&!queues[_0x2ff209[_0x4887('0x16')]][_0x4887('0x20')]){queues[_0x2ff209[_0x4887('0x16')]][_0x4887('0x20')]=![];queues[_0x2ff209[_0x4887('0x16')]][_0x4887('0x21')]=null;queues[_0x2ff209[_0x4887('0x16')]]['queuecallerexit']=!![];queues[_0x2ff209[_0x4887('0x16')]][_0x4887('0x25')]=utils[_0x4887('0x14')]();queues[_0x2ff209[_0x4887('0x16')]][_0x4887('0xb')]='EXITWITHKEY';}}};exports[_0x4887('0x20')]=function(_0x39d488){if(!_['isNil'](queues[_0x39d488['uniqueid']])){queues[_0x39d488[_0x4887('0x16')]][_0x4887('0x18')]=![];queues[_0x39d488[_0x4887('0x16')]][_0x4887('0x25')]=null;queues[_0x39d488[_0x4887('0x16')]][_0x4887('0x20')]=!![];queues[_0x39d488[_0x4887('0x16')]][_0x4887('0x21')]=utils[_0x4887('0x14')]();queues[_0x39d488[_0x4887('0x16')]]['queuecallerexitreason']='ABANDONED';}};exports[_0x4887('0x26')]=function(_0xbad3ca){if(!_[_0x4887('0x1d')](queues[_0xbad3ca[_0x4887('0x16')]])){queues[_0xbad3ca[_0x4887('0x16')]][_0x4887('0x26')]=!![];queues[_0xbad3ca[_0x4887('0x16')]]['queuecallerleaveAt']=utils['now']();queues[_0xbad3ca[_0x4887('0x16')]][_0x4887('0x27')]=utils['diffTime'](queues[_0xbad3ca[_0x4887('0x16')]][_0x4887('0x17')],queues[_0xbad3ca[_0x4887('0x16')]][_0x4887('0x28')]);queues[_0xbad3ca[_0x4887('0x16')]][_0x4887('0x13')]=_0xbad3ca[_0x4887('0x13')];queues[_0xbad3ca[_0x4887('0x16')]]['count']=_0xbad3ca['count'];queues[_0xbad3ca[_0x4887('0x16')]][_0x4887('0x29')]=_0xbad3ca['connectedlinenum'];queues[_0xbad3ca[_0x4887('0x16')]][_0x4887('0x2a')]=_0xbad3ca[_0x4887('0x2a')];}};exports['agentconnect']=function(_0x15f23d){if(!_[_0x4887('0x1d')](queues[_0x15f23d[_0x4887('0x16')]])){queues[_0x15f23d[_0x4887('0x16')]][_0x4887('0x20')]=![];queues[_0x15f23d['uniqueid']]['queuecallerabandon']=![];queues[_0x15f23d[_0x4887('0x16')]][_0x4887('0x21')]=null;queues[_0x15f23d[_0x4887('0x16')]][_0x4887('0x18')]=![];queues[_0x15f23d[_0x4887('0x16')]][_0x4887('0x25')]=null;queues[_0x15f23d[_0x4887('0x16')]]['assigned']=!![];queues[_0x15f23d[_0x4887('0x16')]][_0x4887('0xa')]=_0x15f23d[_0x4887('0x2b')];queues[_0x15f23d['uniqueid']]['lastAssignedTo']=_0x15f23d[_0x4887('0x2c')];}};exports[_0x4887('0x2d')]=function(_0x21c46e){if(!_[_0x4887('0x1d')](queues[_0x21c46e[_0x4887('0x16')]])){if(queues[_0x21c46e[_0x4887('0x16')]]['queuecallerleaveAt']){queues[_0x21c46e[_0x4887('0x16')]][_0x4887('0x20')]=![];queues[_0x21c46e[_0x4887('0x16')]]['queuecallerabandon']=![];queues[_0x21c46e[_0x4887('0x16')]][_0x4887('0x21')]=null;queues[_0x21c46e['uniqueid']][_0x4887('0x18')]=![];queues[_0x21c46e[_0x4887('0x16')]][_0x4887('0x25')]=null;queues[_0x21c46e['uniqueid']][_0x4887('0x2e')]=!![];queues[_0x21c46e['uniqueid']]['lastAssignedTo']=_0x21c46e[_0x4887('0x2c')];queues[_0x21c46e[_0x4887('0x16')]][_0x4887('0x19')]=!![];queues[_0x21c46e['uniqueid']][_0x4887('0x1a')]=utils[_0x4887('0x14')]();if(_0x21c46e[_0x4887('0x2f')]==_0x4887('0x30')){if(!queues[_0x21c46e['uniqueid']][_0x4887('0x30')]){queues[_0x21c46e[_0x4887('0x16')]][_0x4887('0xb')]=_0x4887('0x31');}}else{queues[_0x21c46e[_0x4887('0x16')]]['queuecallerexitreason']=_0x4887('0x32')+_0x21c46e[_0x4887('0x2f')][_0x4887('0x23')]();}writeDB(queues[_0x21c46e[_0x4887('0x16')]]);}}};exports['blindtransfer']=function(_0x42f353){if(!_[_0x4887('0x1d')](queues[_0x42f353['transfereeuniqueid']])){queues[_0x42f353['transfereeuniqueid']][_0x4887('0x30')]=!![];queues[_0x42f353[_0x4887('0x33')]][_0x4887('0x34')]='BLIND';queues[_0x42f353[_0x4887('0x33')]][_0x4887('0x35')]=_0x42f353[_0x4887('0x36')];queues[_0x42f353['transfereeuniqueid']][_0x4887('0x37')]=_0x42f353[_0x4887('0x33')];queues[_0x42f353[_0x4887('0x33')]]['queuecallerexitreason']='BLINDTRANSFER';}};exports['attendedtransfer']=function(_0x4090de){try{if(_0x4090de[_0x4887('0x38')]==_0x4090de['origtransfererlinkedid']){if(!_[_0x4887('0x1d')](queues[_0x4090de[_0x4887('0x39')]])){queues[_0x4090de[_0x4887('0x39')]][_0x4887('0x30')]=!![];queues[_0x4090de[_0x4887('0x39')]][_0x4887('0x34')]='ATTENDED';queues[_0x4090de[_0x4887('0x39')]][_0x4887('0x35')]=_0x4090de['origtransfererexten'];queues[_0x4090de[_0x4887('0x39')]]['transferuniqueid']=_0x4090de['origtransfereruniqueid'];queues[_0x4090de[_0x4887('0x39')]][_0x4887('0xb')]='ATTENDEDTRANSFER';}if(!_[_0x4887('0x1d')](queues[_0x4090de[_0x4887('0x3a')]])){if(_0x4090de[_0x4887('0x3b')]&&queues[_0x4090de['transfereelinkedid']]){queues[_0x4090de[_0x4887('0x3b')]][_0x4887('0x1c')]=0x1;queues[_0x4090de['transfereeuniqueid']]=_[_0x4887('0x3c')](queues[_0x4090de['transfereelinkedid']]);queues[_0x4090de[_0x4887('0x33')]][_0x4887('0x1b')]=_0x4090de[_0x4887('0x3d')];queues[_0x4090de['transfereeuniqueid']][_0x4887('0x1c')]=0x2;queues[_0x4090de[_0x4887('0x33')]][_0x4887('0x9')]=queues[_0x4090de['secondtransfererlinkedid']][_0x4887('0x9')];queues[_0x4090de[_0x4887('0x33')]]['calleridname']=queues[_0x4090de[_0x4887('0x39')]][_0x4887('0x3e')];queues[_0x4090de[_0x4887('0x33')]][_0x4887('0x28')]=utils['now']();queues[_0x4090de[_0x4887('0x33')]][_0x4887('0x17')]=utils[_0x4887('0x14')]();queues[_0x4090de[_0x4887('0x33')]][_0x4887('0x27')]=0x0;queues[_0x4090de[_0x4887('0x33')]][_0x4887('0x3f')]=0x0;}else{queues[_0x4090de['origtransfererlinkedid']][_0x4887('0x1b')]=_0x4090de[_0x4887('0x39')];}}}else if(_0x4090de['secondtransfereruniqueid']==_0x4090de['secondtransfererlinkedid']){if(!_['isNil'](queues[_0x4090de[_0x4887('0x3a')]])){queues[_0x4090de[_0x4887('0x3a')]][_0x4887('0x30')]=!![];queues[_0x4090de[_0x4887('0x3a')]][_0x4887('0x34')]=_0x4887('0x40');queues[_0x4090de[_0x4887('0x3a')]][_0x4887('0x35')]=_0x4090de[_0x4887('0x41')];queues[_0x4090de[_0x4887('0x3a')]][_0x4887('0x37')]=_0x4090de['secondtransfereruniqueid'];queues[_0x4090de[_0x4887('0x3a')]][_0x4887('0xb')]=_0x4887('0x42');}if(!_[_0x4887('0x1d')](queues[_0x4090de['secondtransfererlinkedid']])){if(_0x4090de['transfertargetlinkedid']&&queues[_0x4090de[_0x4887('0x43')]]){queues[_0x4090de['transfertargetlinkedid']][_0x4887('0x1c')]=0x1;queues[_0x4090de['transfertargetuniqueid']]=_['clone'](queues[_0x4090de[_0x4887('0x43')]]);queues[_0x4090de[_0x4887('0x3d')]]['transfereduniqueid']=_0x4090de[_0x4887('0x3d')];queues[_0x4090de[_0x4887('0x3d')]][_0x4887('0x1c')]=0x2;queues[_0x4090de[_0x4887('0x3d')]][_0x4887('0x9')]=queues[_0x4090de[_0x4887('0x3a')]][_0x4887('0x9')];queues[_0x4090de[_0x4887('0x3d')]][_0x4887('0x3e')]=queues[_0x4090de['origtransfererlinkedid']][_0x4887('0x3e')];queues[_0x4090de[_0x4887('0x3d')]][_0x4887('0x28')]=utils[_0x4887('0x14')]();queues[_0x4090de[_0x4887('0x3d')]]['queuecallerleaveAt']=utils[_0x4887('0x14')]();queues[_0x4090de[_0x4887('0x3d')]][_0x4887('0x27')]=0x0;queues[_0x4090de[_0x4887('0x3d')]][_0x4887('0x3f')]=0x0;}else{queues[_0x4090de[_0x4887('0x39')]]['transfereduniqueid']=_0x4090de['origtransfererlinkedid'];}}}}catch(_0x2f951e){utils['error'](_0x2f951e['stack']);}};exports[_0x4887('0x44')]=function(_0x863d86){if(!_[_0x4887('0x1d')](queues[_0x863d86[_0x4887('0x16')]])){queues[_0x863d86[_0x4887('0x16')]][_0x4887('0x45')]=utils[_0x4887('0x14')]();}};exports['musiconholdstop']=function(_0x296f7f){if(!_[_0x4887('0x1d')](queues[_0x296f7f[_0x4887('0x16')]])){if(!_[_0x4887('0x1d')](queues[_0x296f7f[_0x4887('0x16')]][_0x4887('0x45')])){queues[_0x296f7f[_0x4887('0x16')]][_0x4887('0x3f')]+=utils[_0x4887('0x46')](utils[_0x4887('0x14')](),queues[_0x296f7f[_0x4887('0x16')]][_0x4887('0x45')]);delete queues[_0x296f7f['uniqueid']][_0x4887('0x45')];}}}; \ No newline at end of file +var _0xaf3b=['queuecallerexitAt','value','toUpperCase','variable','EXITWITHKEY','ABANDONED','queuecallerleave','queuecallerleaveAt','holdtime','diffTime','queuecallerjoinAt','count','connectedlinename','agentconnect','assigned','lastAssignedTo','membername','agentcomplete','queuecallercomplete','reason','transfer','COMPLETEDBY','blindtransfer','transfereeuniqueid','BLIND','transferexten','transferuniqueid','BLINDTRANSFER','attendedtransfer','origtransfererlinkedid','secondtransfererlinkedid','transfertype','origtransfererexten','origtransfereruniqueid','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','secondtransfereruniqueid','ATTENDED','secondtransfererexten','transfertargetlinkedid','error','stack','musiconholdstop','musiconholdstartAt','lodash','util','./utils','info','uniqueid','channel','queue','calleridnum','accountcode','queuecallerexitreason','type','request','CreateVoiceQueueReport','transfereduniqueid','assign','position','now','hangup','isNil','queuecallerabandon','queuecallerexit','COMPLETEDBYAGENT','queuecallerenterreason','queuestatus','queuecallerabandonAt'];(function(_0x2de160,_0x727945){var _0x2e174a=function(_0x554b5){while(--_0x554b5){_0x2de160['push'](_0x2de160['shift']());}};_0x2e174a(++_0x727945);}(_0xaf3b,0x154));var _0xbaf3=function(_0x509125,_0x4675af){_0x509125=_0x509125-0x0;var _0x1ee7c2=_0xaf3b[_0x509125];return _0x1ee7c2;};'use strict';var _=require(_0xbaf3('0x0'));var util=require(_0xbaf3('0x1'));var utils=require(_0xbaf3('0x2'));var queues={};function writeDB(_0x5aea6b){utils[_0xbaf3('0x3')](util['format']('QUEUE|%s|%s|%s|%s|%s|%s|%s',_0x5aea6b[_0xbaf3('0x4')],_0x5aea6b[_0xbaf3('0x5')],_0x5aea6b[_0xbaf3('0x6')],_0x5aea6b['lastAssignedTo'],_0x5aea6b[_0xbaf3('0x7')],_0x5aea6b[_0xbaf3('0x8')],_0x5aea6b[_0xbaf3('0x9')]));if(_0x5aea6b[_0xbaf3('0x6')]){utils['getVoiceQueueByName'](_0x5aea6b[_0xbaf3('0x6')])['then'](function(_0x384814){if(_0x384814){_0x5aea6b[_0xbaf3('0xa')]=_0x384814['type'];}utils[_0xbaf3('0xb')](_0xbaf3('0xc'),_0x5aea6b);});}else{utils[_0xbaf3('0xb')](_0xbaf3('0xc'),_0x5aea6b);}if(_0x5aea6b[_0xbaf3('0xd')]){delete queues[_0x5aea6b[_0xbaf3('0xd')]];}else{delete queues[_0x5aea6b['uniqueid']];}}exports['queuecallerjoin']=function(_0x49e32c){queues[_0x49e32c[_0xbaf3('0x4')]]=_[_0xbaf3('0xe')](_0x49e32c,{'originalposition':_0x49e32c[_0xbaf3('0xf')],'queuecallerjoinAt':utils[_0xbaf3('0x10')](),'mohtime':0x0});};exports[_0xbaf3('0x11')]=function(_0x2d9cca){if(!_[_0xbaf3('0x12')](queues[_0x2d9cca[_0xbaf3('0x4')]])){if(queues[_0x2d9cca[_0xbaf3('0x4')]]['queuecallerleaveAt']){if(!queues[_0x2d9cca[_0xbaf3('0x4')]][_0xbaf3('0x13')]&&!queues[_0x2d9cca[_0xbaf3('0x4')]][_0xbaf3('0x14')]){queues[_0x2d9cca[_0xbaf3('0x4')]]['queuecallercomplete']=!![];queues[_0x2d9cca[_0xbaf3('0x4')]]['queuecallercompleteAt']=utils[_0xbaf3('0x10')]();queues[_0x2d9cca[_0xbaf3('0x4')]][_0xbaf3('0x9')]=_0xbaf3('0x15');}writeDB(queues[_0x2d9cca[_0xbaf3('0x4')]]);}else{if(queues[_0x2d9cca[_0xbaf3('0x4')]][_0xbaf3('0xd')]){queues[queues[_0x2d9cca[_0xbaf3('0x4')]]['transfereduniqueid']]=queues[_0x2d9cca[_0xbaf3('0x4')]];queues[queues[_0x2d9cca[_0xbaf3('0x4')]][_0xbaf3('0xd')]][_0xbaf3('0x16')]=0x2;delete queues[_0x2d9cca['uniqueid']];}}}};exports['varset']=function(_0x5451be){if(!_['isNil'](_0x5451be['variable'][_0xbaf3('0x17')])){if(!_[_0xbaf3('0x12')](queues[_0x5451be[_0xbaf3('0x4')]])){queues[_0x5451be[_0xbaf3('0x4')]][_0xbaf3('0x13')]=![];queues[_0x5451be[_0xbaf3('0x4')]][_0xbaf3('0x18')]=null;queues[_0x5451be['uniqueid']][_0xbaf3('0x14')]=!![];queues[_0x5451be[_0xbaf3('0x4')]][_0xbaf3('0x19')]=utils[_0xbaf3('0x10')]();queues[_0x5451be[_0xbaf3('0x4')]][_0xbaf3('0x9')]=_0x5451be[_0xbaf3('0x1a')][_0xbaf3('0x1b')]();writeDB(queues[_0x5451be[_0xbaf3('0x4')]]);}}else if(!_['isNil'](_0x5451be[_0xbaf3('0x1c')]['queueposition'])){if(!_[_0xbaf3('0x12')](queues[_0x5451be[_0xbaf3('0x4')]])&&!queues[_0x5451be[_0xbaf3('0x4')]][_0xbaf3('0x13')]){queues[_0x5451be['uniqueid']]['queuecallerabandon']=![];queues[_0x5451be[_0xbaf3('0x4')]][_0xbaf3('0x18')]=null;queues[_0x5451be[_0xbaf3('0x4')]][_0xbaf3('0x14')]=!![];queues[_0x5451be[_0xbaf3('0x4')]]['queuecallerexitAt']=utils[_0xbaf3('0x10')]();queues[_0x5451be[_0xbaf3('0x4')]][_0xbaf3('0x9')]=_0xbaf3('0x1d');}}};exports[_0xbaf3('0x13')]=function(_0x465a94){if(!_[_0xbaf3('0x12')](queues[_0x465a94[_0xbaf3('0x4')]])){queues[_0x465a94['uniqueid']][_0xbaf3('0x14')]=![];queues[_0x465a94[_0xbaf3('0x4')]][_0xbaf3('0x19')]=null;queues[_0x465a94[_0xbaf3('0x4')]]['queuecallerabandon']=!![];queues[_0x465a94[_0xbaf3('0x4')]][_0xbaf3('0x18')]=utils[_0xbaf3('0x10')]();queues[_0x465a94[_0xbaf3('0x4')]][_0xbaf3('0x9')]=_0xbaf3('0x1e');}};exports[_0xbaf3('0x1f')]=function(_0x38e23c){if(!_['isNil'](queues[_0x38e23c['uniqueid']])){queues[_0x38e23c[_0xbaf3('0x4')]][_0xbaf3('0x1f')]=!![];queues[_0x38e23c[_0xbaf3('0x4')]][_0xbaf3('0x20')]=utils[_0xbaf3('0x10')]();queues[_0x38e23c[_0xbaf3('0x4')]][_0xbaf3('0x21')]=utils[_0xbaf3('0x22')](queues[_0x38e23c[_0xbaf3('0x4')]][_0xbaf3('0x20')],queues[_0x38e23c['uniqueid']][_0xbaf3('0x23')]);queues[_0x38e23c[_0xbaf3('0x4')]][_0xbaf3('0xf')]=_0x38e23c[_0xbaf3('0xf')];queues[_0x38e23c[_0xbaf3('0x4')]][_0xbaf3('0x24')]=_0x38e23c['count'];queues[_0x38e23c['uniqueid']]['connectedlinenum']=_0x38e23c['connectedlinenum'];queues[_0x38e23c[_0xbaf3('0x4')]][_0xbaf3('0x25')]=_0x38e23c['connectedlinename'];}};exports[_0xbaf3('0x26')]=function(_0x5b334f){if(!_[_0xbaf3('0x12')](queues[_0x5b334f[_0xbaf3('0x4')]])){queues[_0x5b334f[_0xbaf3('0x4')]][_0xbaf3('0x13')]=![];queues[_0x5b334f[_0xbaf3('0x4')]][_0xbaf3('0x13')]=![];queues[_0x5b334f[_0xbaf3('0x4')]][_0xbaf3('0x18')]=null;queues[_0x5b334f[_0xbaf3('0x4')]]['queuecallerexit']=![];queues[_0x5b334f[_0xbaf3('0x4')]]['queuecallerexitAt']=null;queues[_0x5b334f['uniqueid']][_0xbaf3('0x27')]=!![];queues[_0x5b334f[_0xbaf3('0x4')]][_0xbaf3('0x8')]=_0x5b334f['destaccountcode'];queues[_0x5b334f[_0xbaf3('0x4')]][_0xbaf3('0x28')]=_0x5b334f[_0xbaf3('0x29')];}};exports[_0xbaf3('0x2a')]=function(_0x1bf443){if(!_[_0xbaf3('0x12')](queues[_0x1bf443[_0xbaf3('0x4')]])){if(queues[_0x1bf443[_0xbaf3('0x4')]]['queuecallerleaveAt']){queues[_0x1bf443[_0xbaf3('0x4')]][_0xbaf3('0x13')]=![];queues[_0x1bf443[_0xbaf3('0x4')]][_0xbaf3('0x13')]=![];queues[_0x1bf443[_0xbaf3('0x4')]][_0xbaf3('0x18')]=null;queues[_0x1bf443['uniqueid']][_0xbaf3('0x14')]=![];queues[_0x1bf443[_0xbaf3('0x4')]]['queuecallerexitAt']=null;queues[_0x1bf443[_0xbaf3('0x4')]]['assigned']=!![];queues[_0x1bf443[_0xbaf3('0x4')]]['lastAssignedTo']=_0x1bf443[_0xbaf3('0x29')];queues[_0x1bf443[_0xbaf3('0x4')]][_0xbaf3('0x2b')]=!![];queues[_0x1bf443[_0xbaf3('0x4')]]['queuecallercompleteAt']=utils[_0xbaf3('0x10')]();if(_0x1bf443[_0xbaf3('0x2c')]==_0xbaf3('0x2d')){if(!queues[_0x1bf443['uniqueid']][_0xbaf3('0x2d')]){queues[_0x1bf443[_0xbaf3('0x4')]]['queuecallerexitreason']='TRANSFER';}}else{queues[_0x1bf443[_0xbaf3('0x4')]][_0xbaf3('0x9')]=_0xbaf3('0x2e')+_0x1bf443[_0xbaf3('0x2c')][_0xbaf3('0x1b')]();}writeDB(queues[_0x1bf443[_0xbaf3('0x4')]]);}}};exports[_0xbaf3('0x2f')]=function(_0x41c72d){if(!_['isNil'](queues[_0x41c72d[_0xbaf3('0x30')]])){queues[_0x41c72d['transfereeuniqueid']][_0xbaf3('0x2d')]=!![];queues[_0x41c72d[_0xbaf3('0x30')]]['transfertype']=_0xbaf3('0x31');queues[_0x41c72d['transfereeuniqueid']][_0xbaf3('0x32')]=_0x41c72d['extension'];queues[_0x41c72d[_0xbaf3('0x30')]][_0xbaf3('0x33')]=_0x41c72d['transfereeuniqueid'];queues[_0x41c72d[_0xbaf3('0x30')]][_0xbaf3('0x9')]=_0xbaf3('0x34');}};exports[_0xbaf3('0x35')]=function(_0x28e4c8){try{if(_0x28e4c8['origtransfereruniqueid']==_0x28e4c8[_0xbaf3('0x36')]){if(!_[_0xbaf3('0x12')](queues[_0x28e4c8['secondtransfererlinkedid']])){queues[_0x28e4c8[_0xbaf3('0x37')]][_0xbaf3('0x2d')]=!![];queues[_0x28e4c8[_0xbaf3('0x37')]][_0xbaf3('0x38')]='ATTENDED';queues[_0x28e4c8[_0xbaf3('0x37')]][_0xbaf3('0x32')]=_0x28e4c8[_0xbaf3('0x39')];queues[_0x28e4c8[_0xbaf3('0x37')]][_0xbaf3('0x33')]=_0x28e4c8[_0xbaf3('0x3a')];queues[_0x28e4c8[_0xbaf3('0x37')]][_0xbaf3('0x9')]=_0xbaf3('0x3b');}if(!_[_0xbaf3('0x12')](queues[_0x28e4c8[_0xbaf3('0x36')]])){if(_0x28e4c8[_0xbaf3('0x3c')]&&queues[_0x28e4c8['transfereelinkedid']]){queues[_0x28e4c8['transfereelinkedid']][_0xbaf3('0x16')]=0x1;queues[_0x28e4c8['transfereeuniqueid']]=_[_0xbaf3('0x3d')](queues[_0x28e4c8[_0xbaf3('0x3c')]]);queues[_0x28e4c8['transfereeuniqueid']][_0xbaf3('0xd')]=_0x28e4c8[_0xbaf3('0x3e')];queues[_0x28e4c8[_0xbaf3('0x30')]][_0xbaf3('0x16')]=0x2;queues[_0x28e4c8[_0xbaf3('0x30')]][_0xbaf3('0x7')]=queues[_0x28e4c8[_0xbaf3('0x37')]]['calleridnum'];queues[_0x28e4c8[_0xbaf3('0x30')]][_0xbaf3('0x3f')]=queues[_0x28e4c8[_0xbaf3('0x37')]][_0xbaf3('0x3f')];queues[_0x28e4c8['transfereeuniqueid']][_0xbaf3('0x23')]=utils['now']();queues[_0x28e4c8[_0xbaf3('0x30')]]['queuecallerleaveAt']=utils[_0xbaf3('0x10')]();queues[_0x28e4c8[_0xbaf3('0x30')]][_0xbaf3('0x21')]=0x0;queues[_0x28e4c8[_0xbaf3('0x30')]][_0xbaf3('0x40')]=0x0;}else{queues[_0x28e4c8[_0xbaf3('0x36')]][_0xbaf3('0xd')]=_0x28e4c8['secondtransfererlinkedid'];}}}else if(_0x28e4c8[_0xbaf3('0x41')]==_0x28e4c8['secondtransfererlinkedid']){if(!_[_0xbaf3('0x12')](queues[_0x28e4c8['origtransfererlinkedid']])){queues[_0x28e4c8[_0xbaf3('0x36')]][_0xbaf3('0x2d')]=!![];queues[_0x28e4c8[_0xbaf3('0x36')]][_0xbaf3('0x38')]=_0xbaf3('0x42');queues[_0x28e4c8[_0xbaf3('0x36')]][_0xbaf3('0x32')]=_0x28e4c8[_0xbaf3('0x43')];queues[_0x28e4c8[_0xbaf3('0x36')]][_0xbaf3('0x33')]=_0x28e4c8['secondtransfereruniqueid'];queues[_0x28e4c8[_0xbaf3('0x36')]][_0xbaf3('0x9')]=_0xbaf3('0x3b');}if(!_[_0xbaf3('0x12')](queues[_0x28e4c8[_0xbaf3('0x37')]])){if(_0x28e4c8[_0xbaf3('0x44')]&&queues[_0x28e4c8['transfertargetlinkedid']]){queues[_0x28e4c8[_0xbaf3('0x44')]][_0xbaf3('0x16')]=0x1;queues[_0x28e4c8[_0xbaf3('0x3e')]]=_[_0xbaf3('0x3d')](queues[_0x28e4c8[_0xbaf3('0x44')]]);queues[_0x28e4c8['transfertargetuniqueid']][_0xbaf3('0xd')]=_0x28e4c8[_0xbaf3('0x3e')];queues[_0x28e4c8[_0xbaf3('0x3e')]]['queuecallerenterreason']=0x2;queues[_0x28e4c8[_0xbaf3('0x3e')]][_0xbaf3('0x7')]=queues[_0x28e4c8[_0xbaf3('0x36')]][_0xbaf3('0x7')];queues[_0x28e4c8['transfertargetuniqueid']][_0xbaf3('0x3f')]=queues[_0x28e4c8[_0xbaf3('0x36')]]['calleridname'];queues[_0x28e4c8[_0xbaf3('0x3e')]][_0xbaf3('0x23')]=utils[_0xbaf3('0x10')]();queues[_0x28e4c8[_0xbaf3('0x3e')]]['queuecallerleaveAt']=utils[_0xbaf3('0x10')]();queues[_0x28e4c8[_0xbaf3('0x3e')]][_0xbaf3('0x21')]=0x0;queues[_0x28e4c8[_0xbaf3('0x3e')]][_0xbaf3('0x40')]=0x0;}else{queues[_0x28e4c8[_0xbaf3('0x37')]]['transfereduniqueid']=_0x28e4c8[_0xbaf3('0x36')];}}}}catch(_0x4e0ca0){utils[_0xbaf3('0x45')](_0x4e0ca0[_0xbaf3('0x46')]);}};exports['musiconholdstart']=function(_0x14dfc8){if(!_[_0xbaf3('0x12')](queues[_0x14dfc8[_0xbaf3('0x4')]])){queues[_0x14dfc8[_0xbaf3('0x4')]]['musiconholdstartAt']=utils[_0xbaf3('0x10')]();}};exports[_0xbaf3('0x47')]=function(_0x5f1a5f){if(!_['isNil'](queues[_0x5f1a5f[_0xbaf3('0x4')]])){if(!_['isNil'](queues[_0x5f1a5f[_0xbaf3('0x4')]][_0xbaf3('0x48')])){queues[_0x5f1a5f['uniqueid']][_0xbaf3('0x40')]+=utils[_0xbaf3('0x22')](utils['now'](),queues[_0x5f1a5f[_0xbaf3('0x4')]][_0xbaf3('0x48')]);delete queues[_0x5f1a5f[_0xbaf3('0x4')]][_0xbaf3('0x48')];}}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 9764b7a..4cd9db3 100644 --- a/server/services/xdr/recordings.controller.js +++ b/server/services/xdr/recordings.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['CreateVoiceRecording','newchannel','uniqueid','linkedid','exten','context','channel','error','isNil','channelstate','stack','varset','variable','value','.WAV','find','monitors','hangup','calleridname','connectedlinenum','connectedlinename','forEach','clone','newexten','application','toLowerCase','startsWith','appdata','cdr','split','substring','lastIndexOf','queuecallerjoin','queue','lodash','./utils','accountcode','getUserByInternal','then','membername','name','UserId','request'];(function(_0x1a4cc6,_0x4eaff0){var _0x5386b4=function(_0x591ffa){while(--_0x591ffa){_0x1a4cc6['push'](_0x1a4cc6['shift']());}};_0x5386b4(++_0x4eaff0);}(_0xe706,0xa3));var _0x6e70=function(_0x188703,_0x596b26){_0x188703=_0x188703-0x0;var _0x1a0c81=_0xe706[_0x188703];return _0x1a0c81;};'use strict';var _=require(_0x6e70('0x0'));var utils=require(_0x6e70('0x1'));var recordings={};function writeDB(_0x311951){utils['debug'](_0x311951);if(_0x311951[_0x6e70('0x2')]){utils[_0x6e70('0x3')](_0x311951[_0x6e70('0x2')])[_0x6e70('0x4')](function(_0x142c27){if(_0x142c27){_0x311951[_0x6e70('0x5')]=_0x142c27[_0x6e70('0x6')];_0x311951[_0x6e70('0x7')]=_0x142c27['id'];}utils[_0x6e70('0x8')](_0x6e70('0x9'),_0x311951);});}else{utils[_0x6e70('0x8')](_0x6e70('0x9'),_0x311951);}}exports[_0x6e70('0xa')]=function(_0x188ed3){try{if(_0x188ed3[_0x6e70('0xb')]==_0x188ed3[_0x6e70('0xc')]){recordings[_0x188ed3[_0x6e70('0xb')]]={'uniqueid':_0x188ed3[_0x6e70('0xb')],'accountcode':_0x188ed3[_0x6e70('0x2')],'exten':_0x188ed3[_0x6e70('0xd')],'context':_0x188ed3[_0x6e70('0xe')],'channel':_0x188ed3[_0x6e70('0xf')],'monitors':[]};}}catch(_0x37b3e0){utils[_0x6e70('0x10')](_0x37b3e0['stack']);}};exports['newstate']=function(_0x3594c1){try{if(!_[_0x6e70('0x11')](recordings[_0x3594c1[_0x6e70('0xb')]])&&_0x3594c1[_0x6e70('0x12')]==0x6){}else if(!_[_0x6e70('0x11')](recordings[_0x3594c1[_0x6e70('0xc')]])&&_0x3594c1[_0x6e70('0x12')]==0x6&&_0x3594c1[_0x6e70('0xe')]!='transfer'){recordings[_0x3594c1['linkedid']]['accountcode']=_0x3594c1[_0x6e70('0x2')];}}catch(_0x5a37a6){utils['error'](_0x5a37a6[_0x6e70('0x13')]);}};exports[_0x6e70('0x14')]=function(_0x5d9263){try{if(!_[_0x6e70('0x11')](_0x5d9263['variable'])&&!_[_0x6e70('0x11')](_0x5d9263[_0x6e70('0x15')]['mixmonitor_filename'])){if(_['endsWith'](_0x5d9263[_0x6e70('0x16')],'.wav49')){_0x5d9263[_0x6e70('0x16')]=_0x5d9263[_0x6e70('0x16')]['replace']('.wav49',_0x6e70('0x17'));}if(recordings[_0x5d9263[_0x6e70('0xc')]]){var _0x2368eb=_[_0x6e70('0x18')](recordings[_0x5d9263[_0x6e70('0xc')]][_0x6e70('0x19')],{'value':_0x5d9263[_0x6e70('0x16')]});if(_[_0x6e70('0x11')](_0x2368eb)){recordings[_0x5d9263[_0x6e70('0xc')]][_0x6e70('0x19')]['push']({'value':_0x5d9263[_0x6e70('0x16')]});}}}}catch(_0x344b65){utils[_0x6e70('0x10')](_0x344b65['stack']);}};exports[_0x6e70('0x1a')]=function(_0xa5d49){try{if(!_[_0x6e70('0x11')](recordings[_0xa5d49['uniqueid']])){recordings[_0xa5d49[_0x6e70('0xb')]]['calleridnum']=_0xa5d49['calleridnum'];recordings[_0xa5d49['uniqueid']][_0x6e70('0x1b')]=_0xa5d49[_0x6e70('0x1b')];recordings[_0xa5d49['uniqueid']][_0x6e70('0x1c')]=_0xa5d49[_0x6e70('0x1c')];recordings[_0xa5d49['uniqueid']][_0x6e70('0x1d')]=_0xa5d49[_0x6e70('0x1d')];if(recordings[_0xa5d49[_0x6e70('0xb')]]['type']=='outbound'&&recordings[_0xa5d49[_0x6e70('0xb')]][_0x6e70('0x2')]){recordings[_0xa5d49[_0x6e70('0xb')]][_0x6e70('0x1c')]=recordings[_0xa5d49[_0x6e70('0xb')]]['accountcode'];recordings[_0xa5d49[_0x6e70('0xb')]][_0x6e70('0x1d')]='';}recordings[_0xa5d49[_0x6e70('0xb')]][_0x6e70('0x19')][_0x6e70('0x1e')](_0x20a225=>{var _0x3f78d2=_[_0x6e70('0x1f')](recordings[_0xa5d49[_0x6e70('0xb')]]);_0x3f78d2[_0x6e70('0x16')]=_0x20a225['value'];writeDB(_0x3f78d2);});delete recordings[_0xa5d49[_0x6e70('0xb')]];}}catch(_0x50d60b){utils[_0x6e70('0x10')](_0x50d60b['stack']);}};exports[_0x6e70('0x20')]=function(_0x2722e8){try{if(!_[_0x6e70('0x11')](recordings[_0x2722e8['uniqueid']])){if(_0x2722e8[_0x6e70('0x21')][_0x6e70('0x22')]()=='set'&&_[_0x6e70('0x23')](_0x2722e8[_0x6e70('0x24')]['toLowerCase'](),_0x6e70('0x25'))){var _0x3665a1=_0x2722e8[_0x6e70('0x24')][_0x6e70('0x26')]('=');var _0x3b4a13=_0x3665a1[0x0][_0x6e70('0x27')](_0x3665a1[0x0][_0x6e70('0x28')]('(')+0x1,_0x3665a1[0x0][_0x6e70('0x28')](')'));var _0xf146fd=_0x3665a1[0x1];recordings[_0x2722e8[_0x6e70('0xb')]][_0x3b4a13]=_0xf146fd;}}}catch(_0x4d32d8){utils[_0x6e70('0x10')](_0x4d32d8['stack']);}};exports[_0x6e70('0x29')]=function(_0x3222a2){try{if(!_[_0x6e70('0x11')](recordings[_0x3222a2[_0x6e70('0xb')]])){recordings[_0x3222a2[_0x6e70('0xb')]][_0x6e70('0x2a')]=_0x3222a2[_0x6e70('0x2a')];}}catch(_0xdd0bee){utils[_0x6e70('0x10')](_0xdd0bee[_0x6e70('0x13')]);}}; \ No newline at end of file +var _0xe706=['CreateVoiceRecording','newchannel','uniqueid','linkedid','exten','context','channel','error','isNil','channelstate','stack','varset','variable','value','.WAV','find','monitors','hangup','calleridname','connectedlinenum','connectedlinename','forEach','clone','newexten','application','toLowerCase','startsWith','appdata','cdr','split','substring','lastIndexOf','queuecallerjoin','queue','lodash','./utils','accountcode','getUserByInternal','then','membername','name','UserId','request'];(function(_0x475a18,_0x3ed4f1){var _0x3d233c=function(_0x32dace){while(--_0x32dace){_0x475a18['push'](_0x475a18['shift']());}};_0x3d233c(++_0x3ed4f1);}(_0xe706,0xa3));var _0x6e70=function(_0x2cfb2b,_0x30c0f1){_0x2cfb2b=_0x2cfb2b-0x0;var _0x403a5c=_0xe706[_0x2cfb2b];return _0x403a5c;};'use strict';var _=require(_0x6e70('0x0'));var utils=require(_0x6e70('0x1'));var recordings={};function writeDB(_0x311951){utils['debug'](_0x311951);if(_0x311951[_0x6e70('0x2')]){utils[_0x6e70('0x3')](_0x311951[_0x6e70('0x2')])[_0x6e70('0x4')](function(_0x142c27){if(_0x142c27){_0x311951[_0x6e70('0x5')]=_0x142c27[_0x6e70('0x6')];_0x311951[_0x6e70('0x7')]=_0x142c27['id'];}utils[_0x6e70('0x8')](_0x6e70('0x9'),_0x311951);});}else{utils[_0x6e70('0x8')](_0x6e70('0x9'),_0x311951);}}exports[_0x6e70('0xa')]=function(_0x188ed3){try{if(_0x188ed3[_0x6e70('0xb')]==_0x188ed3[_0x6e70('0xc')]){recordings[_0x188ed3[_0x6e70('0xb')]]={'uniqueid':_0x188ed3[_0x6e70('0xb')],'accountcode':_0x188ed3[_0x6e70('0x2')],'exten':_0x188ed3[_0x6e70('0xd')],'context':_0x188ed3[_0x6e70('0xe')],'channel':_0x188ed3[_0x6e70('0xf')],'monitors':[]};}}catch(_0x37b3e0){utils[_0x6e70('0x10')](_0x37b3e0['stack']);}};exports['newstate']=function(_0x3594c1){try{if(!_[_0x6e70('0x11')](recordings[_0x3594c1[_0x6e70('0xb')]])&&_0x3594c1[_0x6e70('0x12')]==0x6){}else if(!_[_0x6e70('0x11')](recordings[_0x3594c1[_0x6e70('0xc')]])&&_0x3594c1[_0x6e70('0x12')]==0x6&&_0x3594c1[_0x6e70('0xe')]!='transfer'){recordings[_0x3594c1['linkedid']]['accountcode']=_0x3594c1[_0x6e70('0x2')];}}catch(_0x5a37a6){utils['error'](_0x5a37a6[_0x6e70('0x13')]);}};exports[_0x6e70('0x14')]=function(_0x5d9263){try{if(!_[_0x6e70('0x11')](_0x5d9263['variable'])&&!_[_0x6e70('0x11')](_0x5d9263[_0x6e70('0x15')]['mixmonitor_filename'])){if(_['endsWith'](_0x5d9263[_0x6e70('0x16')],'.wav49')){_0x5d9263[_0x6e70('0x16')]=_0x5d9263[_0x6e70('0x16')]['replace']('.wav49',_0x6e70('0x17'));}if(recordings[_0x5d9263[_0x6e70('0xc')]]){var _0x2368eb=_[_0x6e70('0x18')](recordings[_0x5d9263[_0x6e70('0xc')]][_0x6e70('0x19')],{'value':_0x5d9263[_0x6e70('0x16')]});if(_[_0x6e70('0x11')](_0x2368eb)){recordings[_0x5d9263[_0x6e70('0xc')]][_0x6e70('0x19')]['push']({'value':_0x5d9263[_0x6e70('0x16')]});}}}}catch(_0x344b65){utils[_0x6e70('0x10')](_0x344b65['stack']);}};exports[_0x6e70('0x1a')]=function(_0xa5d49){try{if(!_[_0x6e70('0x11')](recordings[_0xa5d49['uniqueid']])){recordings[_0xa5d49[_0x6e70('0xb')]]['calleridnum']=_0xa5d49['calleridnum'];recordings[_0xa5d49['uniqueid']][_0x6e70('0x1b')]=_0xa5d49[_0x6e70('0x1b')];recordings[_0xa5d49['uniqueid']][_0x6e70('0x1c')]=_0xa5d49[_0x6e70('0x1c')];recordings[_0xa5d49['uniqueid']][_0x6e70('0x1d')]=_0xa5d49[_0x6e70('0x1d')];if(recordings[_0xa5d49[_0x6e70('0xb')]]['type']=='outbound'&&recordings[_0xa5d49[_0x6e70('0xb')]][_0x6e70('0x2')]){recordings[_0xa5d49[_0x6e70('0xb')]][_0x6e70('0x1c')]=recordings[_0xa5d49[_0x6e70('0xb')]]['accountcode'];recordings[_0xa5d49[_0x6e70('0xb')]][_0x6e70('0x1d')]='';}recordings[_0xa5d49[_0x6e70('0xb')]][_0x6e70('0x19')][_0x6e70('0x1e')](_0x20a225=>{var _0x3f78d2=_[_0x6e70('0x1f')](recordings[_0xa5d49[_0x6e70('0xb')]]);_0x3f78d2[_0x6e70('0x16')]=_0x20a225['value'];writeDB(_0x3f78d2);});delete recordings[_0xa5d49[_0x6e70('0xb')]];}}catch(_0x50d60b){utils[_0x6e70('0x10')](_0x50d60b['stack']);}};exports[_0x6e70('0x20')]=function(_0x2722e8){try{if(!_[_0x6e70('0x11')](recordings[_0x2722e8['uniqueid']])){if(_0x2722e8[_0x6e70('0x21')][_0x6e70('0x22')]()=='set'&&_[_0x6e70('0x23')](_0x2722e8[_0x6e70('0x24')]['toLowerCase'](),_0x6e70('0x25'))){var _0x3665a1=_0x2722e8[_0x6e70('0x24')][_0x6e70('0x26')]('=');var _0x3b4a13=_0x3665a1[0x0][_0x6e70('0x27')](_0x3665a1[0x0][_0x6e70('0x28')]('(')+0x1,_0x3665a1[0x0][_0x6e70('0x28')](')'));var _0xf146fd=_0x3665a1[0x1];recordings[_0x2722e8[_0x6e70('0xb')]][_0x3b4a13]=_0xf146fd;}}}catch(_0x4d32d8){utils[_0x6e70('0x10')](_0x4d32d8['stack']);}};exports[_0x6e70('0x29')]=function(_0x3222a2){try{if(!_[_0x6e70('0x11')](recordings[_0x3222a2[_0x6e70('0xb')]])){recordings[_0x3222a2[_0x6e70('0xb')]][_0x6e70('0x2a')]=_0x3222a2[_0x6e70('0x2a')];}}catch(_0xdd0bee){utils[_0x6e70('0x10')](_0xdd0bee[_0x6e70('0x13')]);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index a824f57..76f8fc7 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 _0x6ed1=['type','CreateVoiceTransferReport','blind','error','stack','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','attended','transfereechannel','assign','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','lodash','util','./utils','info','format','TRANSFER|%s'];(function(_0x4aaedd,_0x2a05cd){var _0x39d5b5=function(_0x5568e8){while(--_0x5568e8){_0x4aaedd['push'](_0x4aaedd['shift']());}};_0x39d5b5(++_0x2a05cd);}(_0x6ed1,0x173));var _0x16ed=function(_0x455284,_0x383648){_0x455284=_0x455284-0x0;var _0x3e70dc=_0x6ed1[_0x455284];return _0x3e70dc;};'use strict';var _=require(_0x16ed('0x0'));var util=require(_0x16ed('0x1'));var utils=require(_0x16ed('0x2'));function writeDB(_0x576368){utils[_0x16ed('0x3')](util[_0x16ed('0x4')](_0x16ed('0x5'),_0x576368[_0x16ed('0x6')]));utils['request'](_0x16ed('0x7'),_0x576368);}exports['blindtransfer']=function(_0x37ca4e){try{_0x37ca4e['type']=_0x16ed('0x8');writeDB(_0x37ca4e);}catch(_0x4aeda5){utils[_0x16ed('0x9')](_0x4aeda5[_0x16ed('0xa')]);}};exports['attendedtransfer']=function(_0x64d13d){try{_0x64d13d=_['assign'](_0x64d13d,{'transfererchannel':_0x64d13d[_0x16ed('0xb')],'transferercalleridnum':_0x64d13d[_0x16ed('0xc')],'transferercalleridname':_0x64d13d[_0x16ed('0xd')],'transfererconnectedlinenum':_0x64d13d[_0x16ed('0xe')],'transfererconnectedlinename':_0x64d13d[_0x16ed('0xf')],'transfereraccountcode':_0x64d13d[_0x16ed('0x10')],'transferercontext':_0x64d13d[_0x16ed('0x11')],'transfererexten':_0x64d13d[_0x16ed('0x12')],'transfererlinkedid':_0x64d13d[_0x16ed('0x13')],'context':_0x64d13d[_0x16ed('0x14')],'extension':_0x64d13d['origtransfererexten'],'type':_0x16ed('0x15')});if(_['isNil'](_0x64d13d[_0x16ed('0x16')])){_0x64d13d=_[_0x16ed('0x17')](_0x64d13d,{'transfereechannel':_0x64d13d['transfertargetchannel'],'transfereecalleridnum':_0x64d13d[_0x16ed('0x18')],'transfereecalleridname':_0x64d13d['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x64d13d[_0x16ed('0x19')],'transfereeconnectedlinename':_0x64d13d[_0x16ed('0x1a')],'transfereeaccountcode':_0x64d13d[_0x16ed('0x1b')],'transfereecontext':_0x64d13d[_0x16ed('0x1c')],'transfereeexten':_0x64d13d['transfertargetexten'],'transfereelinkedid':_0x64d13d['transfertargetlinkedid']});}writeDB(_0x64d13d);}catch(_0x245081){utils[_0x16ed('0x9')](_0x245081[_0x16ed('0xa')]);}}; \ No newline at end of file +var _0x44e4=['origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','lodash','./utils','TRANSFER|%s','CreateVoiceTransferReport','type','blind','error','stack','attendedtransfer','assign','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransferercontext','secondtransfererexten'];(function(_0x1602ef,_0x447aba){var _0x5870ee=function(_0x4d94e7){while(--_0x4d94e7){_0x1602ef['push'](_0x1602ef['shift']());}};_0x5870ee(++_0x447aba);}(_0x44e4,0xeb));var _0x444e=function(_0x56c70f,_0x4e4493){_0x56c70f=_0x56c70f-0x0;var _0x3812ed=_0x44e4[_0x56c70f];return _0x3812ed;};'use strict';var _=require(_0x444e('0x0'));var util=require('util');var utils=require(_0x444e('0x1'));function writeDB(_0x255bd5){utils['info'](util['format'](_0x444e('0x2'),_0x255bd5['type']));utils['request'](_0x444e('0x3'),_0x255bd5);}exports['blindtransfer']=function(_0x24ab53){try{_0x24ab53[_0x444e('0x4')]=_0x444e('0x5');writeDB(_0x24ab53);}catch(_0x513b9d){utils[_0x444e('0x6')](_0x513b9d[_0x444e('0x7')]);}};exports[_0x444e('0x8')]=function(_0x349a7c){try{_0x349a7c=_[_0x444e('0x9')](_0x349a7c,{'transfererchannel':_0x349a7c[_0x444e('0xa')],'transferercalleridnum':_0x349a7c[_0x444e('0xb')],'transferercalleridname':_0x349a7c['origtransferercalleridname'],'transfererconnectedlinenum':_0x349a7c[_0x444e('0xc')],'transfererconnectedlinename':_0x349a7c['secondtransfererconnectedlinename'],'transfereraccountcode':_0x349a7c['origtransfereraccountcode'],'transferercontext':_0x349a7c[_0x444e('0xd')],'transfererexten':_0x349a7c[_0x444e('0xe')],'transfererlinkedid':_0x349a7c[_0x444e('0xf')],'context':_0x349a7c[_0x444e('0x10')],'extension':_0x349a7c[_0x444e('0x11')],'type':_0x444e('0x12')});if(_['isNil'](_0x349a7c['transfereechannel'])){_0x349a7c=_[_0x444e('0x9')](_0x349a7c,{'transfereechannel':_0x349a7c[_0x444e('0x13')],'transfereecalleridnum':_0x349a7c[_0x444e('0x14')],'transfereecalleridname':_0x349a7c['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x349a7c['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x349a7c[_0x444e('0x15')],'transfereeaccountcode':_0x349a7c[_0x444e('0x16')],'transfereecontext':_0x349a7c['transfertargetcontext'],'transfereeexten':_0x349a7c[_0x444e('0x17')],'transfereelinkedid':_0x349a7c[_0x444e('0x18')]});}writeDB(_0x349a7c);}catch(_0x30f41e){utils[_0x444e('0x6')](_0x30f41e[_0x444e('0x7')]);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 1e00b38..3c67e58 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 _0xfc86=['catch','GetUser','internal','interface','GETUSER|','result','length','FOUND','NOTFOUND','getUserByInternal','getVoiceQueueByName','name','type','acw','addTime','seconds','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','format','diffTime','diff','sumTime','now','isAfter','isBefore','jayson/promise','moment','bluebird','client','../../config/logger','xdr','info','debug','stringify','error','stack','request','then'];(function(_0x637800,_0x336c24){var _0x28ad13=function(_0xa03005){while(--_0xa03005){_0x637800['push'](_0x637800['shift']());}};_0x28ad13(++_0x336c24);}(_0xfc86,0x68));var _0x6fc8=function(_0x599c94,_0x464f0e){_0x599c94=_0x599c94-0x0;var _0x34e215=_0xfc86[_0x599c94];return _0x34e215;};'use strict';var jayson=require(_0x6fc8('0x0'));var moment=require(_0x6fc8('0x1'));var BPromise=require(_0x6fc8('0x2'));var client=jayson[_0x6fc8('0x3')]['http']({'port':0x2329});var logger=require(_0x6fc8('0x4'))(_0x6fc8('0x5'));exports[_0x6fc8('0x6')]=function(_0x3b7032){logger[_0x6fc8('0x6')](_0x3b7032);};exports[_0x6fc8('0x7')]=function(_0x36bb97){logger['debug'](JSON[_0x6fc8('0x8')](_0x36bb97));};exports[_0x6fc8('0x9')]=function(_0x40b613){logger[_0x6fc8('0x9')](_0x40b613[_0x6fc8('0xa')]);};exports[_0x6fc8('0xb')]=function(_0x11cdae,_0xb69947){return client['request'](_0x11cdae,{'body':_0xb69947})[_0x6fc8('0xc')](function(_0x1048c4){logger['debug'](JSON[_0x6fc8('0x8')](_0x1048c4));})[_0x6fc8('0xd')](function(_0x8fadd8){logger['error'](_0x8fadd8[_0x6fc8('0xa')]);});};function getUser(_0x554355){return client[_0x6fc8('0xb')](_0x6fc8('0xe'),{'options':{'raw':!![],'attributes':['id',_0x6fc8('0xf'),'name',_0x6fc8('0x10')],'where':_0x554355,'limit':0x1}})[_0x6fc8('0xc')](function(_0x41b8aa){logger[_0x6fc8('0x6')](_0x6fc8('0x11')+JSON[_0x6fc8('0x8')](_0x554355)+'|'+(_0x41b8aa[_0x6fc8('0x12')][_0x6fc8('0x13')]?_0x6fc8('0x14'):_0x6fc8('0x15')));return _0x41b8aa['result'][_0x6fc8('0x13')]?_0x41b8aa[_0x6fc8('0x12')][0x0]:null;});}exports[_0x6fc8('0x16')]=function(_0x12ceb5){return new BPromise(function(_0x170e48,_0x5859e7){if(_0x12ceb5){return getUser({'internal':_0x12ceb5})['then'](function(_0x5d583b){return _0x170e48(_0x5d583b);})[_0x6fc8('0xd')](function(_0x252753){logger[_0x6fc8('0x9')](_0x252753['stack']);return _0x170e48(null);});}else{return _0x170e48(null);}});};exports['getUserByInterface']=function(_0xc575f6){return new BPromise(function(_0x3919b3,_0x15505c){if(_0xc575f6){return getUser({'interface':_0xc575f6})[_0x6fc8('0xc')](function(_0x5f125b){return _0x3919b3(_0x5f125b);})[_0x6fc8('0xd')](function(_0x2e9fae){logger['error'](_0x2e9fae[_0x6fc8('0xa')]);return _0x3919b3(null);});}else{return _0x3919b3(null);}});};exports['getUserByName']=function(_0x45baf7){return new BPromise(function(_0x22f592,_0x45f3d3){if(_0x45baf7){return getUser({'name':_0x45baf7})[_0x6fc8('0xc')](function(_0x135174){return _0x22f592(_0x135174);})[_0x6fc8('0xd')](function(_0x6f87e1){logger[_0x6fc8('0x9')](_0x6f87e1[_0x6fc8('0xa')]);return _0x22f592(null);});}else{return _0x22f592(null);}});};exports[_0x6fc8('0x17')]=function(_0x384800){return new BPromise(function(_0x1a8838,_0x3dcf05){if(_0x384800){return client[_0x6fc8('0xb')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0x6fc8('0x18'),_0x6fc8('0x19'),_0x6fc8('0x1a'),'acwTimeout'],'where':{'name':_0x384800},'limit':0x1}})[_0x6fc8('0xc')](function(_0x180127){logger[_0x6fc8('0x6')]('GETVOICEQUEUEBYNAME|'+_0x384800+'|'+(_0x180127[_0x6fc8('0x12')][_0x6fc8('0x13')]?_0x6fc8('0x14'):_0x6fc8('0x15')));return _0x1a8838(_0x180127[_0x6fc8('0x12')][_0x6fc8('0x13')]?_0x180127[_0x6fc8('0x12')][0x0]:null);})[_0x6fc8('0xd')](function(_0x126f32){logger[_0x6fc8('0x9')](_0x126f32[_0x6fc8('0xa')]);return _0x1a8838(null);});}else{return _0x1a8838(null);}});};exports[_0x6fc8('0x1b')]=function(_0x5aeaf1,_0x3c40b1){return moment(_0x5aeaf1)['add'](_0x3c40b1,_0x6fc8('0x1c'))['format'](_0x6fc8('0x1d'));};exports[_0x6fc8('0x1e')]=function(_0x2db439,_0x1ccc60){return moment(_0x2db439)[_0x6fc8('0x1f')](_0x1ccc60,_0x6fc8('0x1c'))[_0x6fc8('0x20')](_0x6fc8('0x1d'));};exports[_0x6fc8('0x21')]=function(_0x543e7b,_0x57537b){return moment(_0x543e7b)[_0x6fc8('0x22')](moment(_0x57537b),_0x6fc8('0x1c'));};exports[_0x6fc8('0x23')]=function(_0x4c3e4f,_0x46d593){return parseInt(_0x4c3e4f,0xa)+parseInt(_0x46d593,0xa);};exports[_0x6fc8('0x24')]=function(){return moment()[_0x6fc8('0x20')](_0x6fc8('0x1d'));};exports[_0x6fc8('0x25')]=function(_0xa81eb8,_0x1c5616){if(_0x1c5616){return moment(_0xa81eb8)['isAfter'](_0x1c5616);}else{return!![];}};exports['isBefore']=function(_0x26ab73,_0x14a2d1){if(_0x14a2d1){return moment(_0x26ab73)[_0x6fc8('0x26')](_0x14a2d1);}else if(_0x26ab73){return!![];}else{return![];}}; \ No newline at end of file +var _0x764a=['FOUND','length','getUserByInternal','getUserByName','GetVoiceQueue','type','acwTimeout','GETVOICEQUEUEBYNAME|','NOTFOUND','addTime','add','format','subtractTime','subtract','seconds','YYYY-MM-DD\x20HH:mm:ss','diff','now','isAfter','isBefore','jayson/promise','bluebird','client','http','../../config/logger','xdr','info','debug','stringify','error','stack','request','then','catch','GetUser','name','interface','GETUSER|','result'];(function(_0x38e901,_0x19814e){var _0x1366dc=function(_0x4c5a4f){while(--_0x4c5a4f){_0x38e901['push'](_0x38e901['shift']());}};_0x1366dc(++_0x19814e);}(_0x764a,0xb0));var _0xa764=function(_0x1833b3,_0x2d8512){_0x1833b3=_0x1833b3-0x0;var _0x1f7721=_0x764a[_0x1833b3];return _0x1f7721;};'use strict';var jayson=require(_0xa764('0x0'));var moment=require('moment');var BPromise=require(_0xa764('0x1'));var client=jayson[_0xa764('0x2')][_0xa764('0x3')]({'port':0x2329});var logger=require(_0xa764('0x4'))(_0xa764('0x5'));exports['info']=function(_0x38c5dd){logger[_0xa764('0x6')](_0x38c5dd);};exports[_0xa764('0x7')]=function(_0x3339a7){logger[_0xa764('0x7')](JSON[_0xa764('0x8')](_0x3339a7));};exports[_0xa764('0x9')]=function(_0x18c141){logger['error'](_0x18c141[_0xa764('0xa')]);};exports[_0xa764('0xb')]=function(_0x1893df,_0x5eab16){return client[_0xa764('0xb')](_0x1893df,{'body':_0x5eab16})[_0xa764('0xc')](function(_0x3c8c22){logger[_0xa764('0x7')](JSON[_0xa764('0x8')](_0x3c8c22));})[_0xa764('0xd')](function(_0x4c621e){logger[_0xa764('0x9')](_0x4c621e[_0xa764('0xa')]);});};function getUser(_0x34fa2e){return client['request'](_0xa764('0xe'),{'options':{'raw':!![],'attributes':['id','internal',_0xa764('0xf'),_0xa764('0x10')],'where':_0x34fa2e,'limit':0x1}})[_0xa764('0xc')](function(_0x550742){logger['info'](_0xa764('0x11')+JSON[_0xa764('0x8')](_0x34fa2e)+'|'+(_0x550742[_0xa764('0x12')]['length']?_0xa764('0x13'):'NOTFOUND'));return _0x550742['result'][_0xa764('0x14')]?_0x550742['result'][0x0]:null;});}exports[_0xa764('0x15')]=function(_0x35fe8a){return new BPromise(function(_0xa5b0e8,_0x378158){if(_0x35fe8a){return getUser({'internal':_0x35fe8a})['then'](function(_0x26edad){return _0xa5b0e8(_0x26edad);})[_0xa764('0xd')](function(_0x3c6a7e){logger['error'](_0x3c6a7e[_0xa764('0xa')]);return _0xa5b0e8(null);});}else{return _0xa5b0e8(null);}});};exports['getUserByInterface']=function(_0x5c83d7){return new BPromise(function(_0x144251,_0x3b4e30){if(_0x5c83d7){return getUser({'interface':_0x5c83d7})['then'](function(_0x21f9c8){return _0x144251(_0x21f9c8);})[_0xa764('0xd')](function(_0x249011){logger[_0xa764('0x9')](_0x249011[_0xa764('0xa')]);return _0x144251(null);});}else{return _0x144251(null);}});};exports[_0xa764('0x16')]=function(_0x5eef3f){return new BPromise(function(_0x3586d7,_0x4dd4d4){if(_0x5eef3f){return getUser({'name':_0x5eef3f})[_0xa764('0xc')](function(_0xe92864){return _0x3586d7(_0xe92864);})[_0xa764('0xd')](function(_0xad321b){logger['error'](_0xad321b[_0xa764('0xa')]);return _0x3586d7(null);});}else{return _0x3586d7(null);}});};exports['getVoiceQueueByName']=function(_0x217092){return new BPromise(function(_0x311e1d,_0x2863ad){if(_0x217092){return client[_0xa764('0xb')](_0xa764('0x17'),{'options':{'raw':!![],'attributes':['id','name',_0xa764('0x18'),'acw',_0xa764('0x19')],'where':{'name':_0x217092},'limit':0x1}})[_0xa764('0xc')](function(_0x5571e2){logger[_0xa764('0x6')](_0xa764('0x1a')+_0x217092+'|'+(_0x5571e2['result'][_0xa764('0x14')]?_0xa764('0x13'):_0xa764('0x1b')));return _0x311e1d(_0x5571e2[_0xa764('0x12')][_0xa764('0x14')]?_0x5571e2['result'][0x0]:null);})[_0xa764('0xd')](function(_0x4ed058){logger[_0xa764('0x9')](_0x4ed058[_0xa764('0xa')]);return _0x311e1d(null);});}else{return _0x311e1d(null);}});};exports[_0xa764('0x1c')]=function(_0x4427c3,_0x32a7ee){return moment(_0x4427c3)[_0xa764('0x1d')](_0x32a7ee,'seconds')[_0xa764('0x1e')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xa764('0x1f')]=function(_0x5d05fb,_0xd6d63d){return moment(_0x5d05fb)[_0xa764('0x20')](_0xd6d63d,_0xa764('0x21'))[_0xa764('0x1e')](_0xa764('0x22'));};exports['diffTime']=function(_0x5853e3,_0x420f8d){return moment(_0x5853e3)[_0xa764('0x23')](moment(_0x420f8d),_0xa764('0x21'));};exports['sumTime']=function(_0x4daa52,_0x29cf01){return parseInt(_0x4daa52,0xa)+parseInt(_0x29cf01,0xa);};exports[_0xa764('0x24')]=function(){return moment()[_0xa764('0x1e')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xa764('0x25')]=function(_0x55a2eb,_0x126492){if(_0x126492){return moment(_0x55a2eb)[_0xa764('0x25')](_0x126492);}else{return!![];}};exports[_0xa764('0x26')]=function(_0x17b299,_0x11b64d){if(_0x11b64d){return moment(_0x17b299)[_0xa764('0x26')](_0x11b64d);}else if(_0x17b299){return!![];}else{return![];}}; \ No newline at end of file